diff --git a/data/cpp-keep.json b/data/cpp-keep.json deleted file mode 100644 index cb32130f601865cde56d9da49714541e2d6b5cd9..0000000000000000000000000000000000000000 --- a/data/cpp-keep.json +++ /dev/null @@ -1,1934 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "cpp", - "prompt": "#include\n#include\n// For a given number n, find the largest number that divides n evenly, smaller than n\n// >>> largest_divisor(15)\n// 5\nlong largest_divisor(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = largest_divisor;\n assert(candidate((3)) == (1));\n assert(candidate((7)) == (1));\n assert(candidate((10)) == (5));\n assert(candidate((100)) == (50));\n assert(candidate((49)) == (7));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_47_median", - "language": "cpp", - "prompt": "#include\n#include\n// Return median of elements in the list l.\n// >>> median([3, 1, 2, 4, 5])\n// 3\n// >>> median([-10, 4, 6, 1000, 10, 20])\n// 15.0\nfloat median(std::vector l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = median;\n assert(candidate((std::vector({(long)3, (long)1, (long)2, (long)4, (long)5}))) == (float(3)));\n assert(candidate((std::vector({(long)-10, (long)4, (long)6, (long)1000, (long)10, (long)20}))) == (8.0));\n assert(candidate((std::vector({(long)5}))) == (float(5)));\n assert(candidate((std::vector({(long)6, (long)5}))) == (5.5));\n assert(candidate((std::vector({(long)8, (long)1, (long)3, (long)9, (long)9, (long)2, (long)7}))) == (float(7)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "cpp", - "prompt": "#include\n#include\n// Given two lists operator, and operand. The first list has basic algebra operations, and \n// the second list is a list of integers. Use the two given lists to build the algebric \n// expression and return the evaluation of this expression.\n// The basic algebra operations:\n// Addition ( + ) \n// Subtraction ( - ) \n// Multiplication ( * ) \n// Floor division ( // ) \n// Exponentiation ( ** ) \n// Example:\n// operator['+', '*', '-']\n// array = [2, 3, 4, 5]\n// result = 2 + 3 * 4 - 5\n// => result = 9\n// Note:\n// The length of operator list is equal to the length of operand list minus one.\n// Operand is a list of of non-negative integers.\n// Operator list has at least one operator, and operand list has at least two operands.\nlong do_algebra(std::vector op, std::vector operand) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = do_algebra;\n assert(candidate((std::vector({(std::string)\"**\", (std::string)\"*\", (std::string)\"+\"})), (std::vector({(long)2, (long)3, (long)4, (long)5}))) == (37));\n assert(candidate((std::vector({(std::string)\"+\", (std::string)\"*\", (std::string)\"-\"})), (std::vector({(long)2, (long)3, (long)4, (long)5}))) == (9));\n assert(candidate((std::vector({(std::string)\"//\", (std::string)\"*\"})), (std::vector({(long)7, (long)3, (long)4}))) == (8));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "cpp", - "prompt": "#include\n#include\n// Return maximum element in the list.\n// >>> max_element([1, 2, 3])\n// 3\n// >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n// 123\nlong max_element(std::vector l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = max_element;\n assert(candidate((std::vector({(long)1, (long)2, (long)3}))) == (3));\n assert(candidate((std::vector({(long)5, (long)3, (long)-5, (long)2, (long)-3, (long)3, (long)9, (long)0, (long)124, (long)1, (long)-10}))) == (124));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function which returns the largest index of an element which\n// is not greater than or equal to the element immediately preceding it. If\n// no such element exists then return -1. The given array will not contain\n// duplicate values.\n// Examples:\n// can_arrange([1,2,4,3,5]) = 3\n// can_arrange([1,2,3]) = -1\nlong can_arrange(std::vector arr) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = can_arrange;\n assert(candidate((std::vector({(long)1, (long)2, (long)4, (long)3, (long)5}))) == (3));\n assert(candidate((std::vector({(long)1, (long)2, (long)4, (long)5}))) == (-1));\n assert(candidate((std::vector({(long)1, (long)4, (long)2, (long)5, (long)6, (long)7, (long)8, (long)9, (long)10}))) == (2));\n assert(candidate((std::vector({(long)4, (long)8, (long)5, (long)7, (long)3}))) == (4));\n assert(candidate((std::vector())) == (-1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "cpp", - "prompt": "#include\n#include\n// Imagine a road that's a perfectly straight infinitely long line.\n// n cars are driving left to right; simultaneously, a different set of n cars\n// are driving right to left. The two sets of cars start out being very far from\n// each other. All cars move in the same speed. Two cars are said to collide\n// when a car that's moving left to right hits a car that's moving right to left.\n// However, the cars are infinitely sturdy and strong; as a result, they continue moving\n// in their trajectory as if they did not collide.\n// This function outputs the number of such collisions.\nlong car_race_collision(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = car_race_collision;\n assert(candidate((2)) == (4));\n assert(candidate((3)) == (9));\n assert(candidate((4)) == (16));\n assert(candidate((8)) == (64));\n assert(candidate((10)) == (100));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function that returns True if the last character\n// of a given string is an alphabetical character and is not\n// a part of a word, and False otherwise.\n// Note: \"word\" is a group of characters separated by space.\n// Examples:\n// check_if_last_char_is_a_letter(\"apple pie\") \u279e False\n// check_if_last_char_is_a_letter(\"apple pi e\") \u279e True\n// check_if_last_char_is_a_letter(\"apple pi e \") \u279e False\n// check_if_last_char_is_a_letter(\"\") \u279e False\nbool check_if_last_char_is_a_letter(std::string txt) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = check_if_last_char_is_a_letter;\n assert(candidate((\"apple\")) == (false));\n assert(candidate((\"apple pi e\")) == (true));\n assert(candidate((\"eeeee\")) == (false));\n assert(candidate((\"A\")) == (true));\n assert(candidate((\"Pumpkin pie \")) == (false));\n assert(candidate((\"Pumpkin pie 1\")) == (false));\n assert(candidate((\"\")) == (false));\n assert(candidate((\"eeeee e \")) == (false));\n assert(candidate((\"apple pie\")) == (false));\n assert(candidate((\"apple pi e \")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "cpp", - "prompt": "#include\n#include\n// Return true if a given number is prime, and false otherwise.\n// >>> is_prime(6)\n// False\n// >>> is_prime(101)\n// True\n// >>> is_prime(11)\n// True\n// >>> is_prime(13441)\n// True\n// >>> is_prime(61)\n// True\n// >>> is_prime(4)\n// False\n// >>> is_prime(1)\n// False\nbool is_prime(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = is_prime;\n assert(candidate((6)) == (false));\n assert(candidate((101)) == (true));\n assert(candidate((11)) == (true));\n assert(candidate((13441)) == (true));\n assert(candidate((61)) == (true));\n assert(candidate((4)) == (false));\n assert(candidate((1)) == (false));\n assert(candidate((5)) == (true));\n assert(candidate((11)) == (true));\n assert(candidate((17)) == (true));\n assert(candidate((85)) == (false));\n assert(candidate((77)) == (false));\n assert(candidate((255379)) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "cpp", - "prompt": "#include\n#include\n// Given a list of positive integers x. return a sorted list of all \n// elements that hasn't any even digit.\n// Note: Returned list should be sorted in increasing order.\n// For example:\n// >>> unique_digits([15, 33, 1422, 1])\n// [1, 15, 33]\n// >>> unique_digits([152, 323, 1422, 10])\n// []\nstd::vector unique_digits(std::vector x) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = unique_digits;\n assert(candidate((std::vector({(long)15, (long)33, (long)1422, (long)1}))) == (std::vector({(long)1, (long)15, (long)33})));\n assert(candidate((std::vector({(long)152, (long)323, (long)1422, (long)10}))) == (std::vector()));\n assert(candidate((std::vector({(long)12345, (long)2033, (long)111, (long)151}))) == (std::vector({(long)111, (long)151})));\n assert(candidate((std::vector({(long)135, (long)103, (long)31}))) == (std::vector({(long)31, (long)135})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "cpp", - "prompt": "#include\n#include\n// Input are two strings a and b consisting only of 1s and 0s.\n// Perform binary XOR on these inputs and return result also as a string.\n// >>> string_xor('010', '110')\n// '100'\nstd::string string_xor(std::string a, std::string b) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = string_xor;\n assert(candidate((\"111000\"), (\"101010\")) == (\"010010\"));\n assert(candidate((\"1\"), (\"1\")) == (\"0\"));\n assert(candidate((\"0101\"), (\"0000\")) == (\"0101\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "cpp", - "prompt": "#include\n#include\n// sum_to_n is a function that sums numbers from 1 to n.\n// >>> sum_to_n(30)\n// 465\n// >>> sum_to_n(100)\n// 5050\n// >>> sum_to_n(5)\n// 15\n// >>> sum_to_n(10)\n// 55\n// >>> sum_to_n(1)\n// 1\nlong sum_to_n(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = sum_to_n;\n assert(candidate((1)) == (1));\n assert(candidate((6)) == (21));\n assert(candidate((11)) == (66));\n assert(candidate((30)) == (465));\n assert(candidate((100)) == (5050));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "cpp", - "prompt": "#include\n#include\n// Given a list of numbers, return the sum of squares of the numbers\n// in the list that are odd. Ignore numbers that are negative or not integers.\n// double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10\n// double_the_difference([-1, -2, 0]) == 0\n// double_the_difference([9, -2]) == 81\n// double_the_difference([0]) == 0 \n// If the input list is empty, return 0.\nlong double_the_difference(std::vector lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = double_the_difference;\n assert(candidate((std::vector())) == (0));\n assert(candidate((std::vector({(float)5.0, (float)4.0}))) == (25));\n assert(candidate((std::vector({(float)0.1, (float)0.2, (float)0.3}))) == (0));\n assert(candidate((std::vector({(float)-10.0, (float)-20.0, (float)-30.0}))) == (0));\n assert(candidate((std::vector({(float)-1.0, (float)-2.0, (float)8.0}))) == (0));\n assert(candidate((std::vector({(float)0.2, (float)3.0, (float)5.0}))) == (34));\n assert(candidate((std::vector({(float)-9.0, (float)-7.0, (float)-5.0, (float)-3.0, (float)-1.0, (float)1.0, (float)3.0, (float)5.0, (float)7.0, (float)9.0}))) == (165));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "cpp", - "prompt": "#include\n#include\n// Return length of given string\n// >>> strlen('')\n// 0\n// >>> strlen('abc')\n// 3\nlong string_length(std::string string) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = string_length;\n assert(candidate((\"\")) == (0));\n assert(candidate((\"x\")) == (1));\n assert(candidate((\"asdasnakj\")) == (9));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "cpp", - "prompt": "#include\n#include\n// You'll be given a string of words, and your task is to count the number\n// of boredoms. A boredom is a sentence that starts with the word \"I\".\n// Sentences are delimited by '.', '?' or '!'.\n// For example:\n// >>> is_bored(\"Hello world\")\n// 0\n// >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n// 1\nlong is_bored(std::string S) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = is_bored;\n assert(candidate((\"Hello world\")) == (0));\n assert(candidate((\"Is the sky blue?\")) == (0));\n assert(candidate((\"I love It !\")) == (1));\n assert(candidate((\"bIt\")) == (0));\n assert(candidate((\"I feel good today. I will be productive. will kill It\")) == (2));\n assert(candidate((\"You and I are going for a walk\")) == (0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function vowels_count which takes a string representing\n// a word as input and returns the number of vowels in the string.\n// Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n// vowel, but only when it is at the end of the given word.\n// Example:\n// >>> vowels_count(\"abcde\")\n// 2\n// >>> vowels_count(\"ACEDY\")\n// 3\nlong vowels_count(std::string s) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = vowels_count;\n assert(candidate((\"abcde\")) == (2));\n assert(candidate((\"Alone\")) == (3));\n assert(candidate((\"key\")) == (2));\n assert(candidate((\"bye\")) == (1));\n assert(candidate((\"keY\")) == (2));\n assert(candidate((\"bYe\")) == (1));\n assert(candidate((\"ACEDY\")) == (3));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "cpp", - "prompt": "#include\n#include\n// Return n-th Fibonacci number.\n// >>> fib(10)\n// 55\n// >>> fib(1)\n// 1\n// >>> fib(8)\n// 21\nlong fib(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = fib;\n assert(candidate((10)) == (55));\n assert(candidate((1)) == (1));\n assert(candidate((8)) == (21));\n assert(candidate((11)) == (89));\n assert(candidate((12)) == (144));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "cpp", - "prompt": "#include\n#include\n// Your task is to implement a function that will simplify the expression\n// x * n. The function returns True if x * n evaluates to a whole number and False\n// otherwise. Both x and n, are string representation of a fraction, and have the following format,\n// / where both numerator and denominator are positive whole numbers.\n// You can assume that x, and n are valid fractions, and do not have zero as denominator.\n// simplify(\"1/5\", \"5/1\") = True\n// simplify(\"1/6\", \"2/1\") = False\n// simplify(\"7/10\", \"10/2\") = False\nbool simplify(std::string x, std::string n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = simplify;\n assert(candidate((\"1/5\"), (\"5/1\")) == (true));\n assert(candidate((\"1/6\"), (\"2/1\")) == (false));\n assert(candidate((\"5/1\"), (\"3/1\")) == (true));\n assert(candidate((\"7/10\"), (\"10/2\")) == (false));\n assert(candidate((\"2/10\"), (\"50/10\")) == (true));\n assert(candidate((\"7/2\"), (\"4/2\")) == (true));\n assert(candidate((\"11/6\"), (\"6/1\")) == (true));\n assert(candidate((\"2/3\"), (\"5/2\")) == (false));\n assert(candidate((\"5/2\"), (\"3/5\")) == (false));\n assert(candidate((\"2/4\"), (\"8/4\")) == (true));\n assert(candidate((\"2/4\"), (\"4/2\")) == (true));\n assert(candidate((\"1/5\"), (\"5/1\")) == (true));\n assert(candidate((\"1/5\"), (\"1/5\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "cpp", - "prompt": "#include\n#include\n// Given a string s, count the number of uppercase vowels in even indices.\n// For example:\n// count_upper('aBCdEf') returns 1\n// count_upper('abcdefg') returns 0\n// count_upper('dBBE') returns 0\nlong count_upper(std::string s) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = count_upper;\n assert(candidate((\"aBCdEf\")) == (1));\n assert(candidate((\"abcdefg\")) == (0));\n assert(candidate((\"dBBE\")) == (0));\n assert(candidate((\"B\")) == (0));\n assert(candidate((\"U\")) == (1));\n assert(candidate((\"\")) == (0));\n assert(candidate((\"EEEE\")) == (2));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a rectangular grid of wells. Each row represents a single well,\n// and each 1 in a row represents a single unit of water.\n// Each well has a corresponding bucket that can be used to extract water from it, \n// and all buckets have the same capacity.\n// Your task is to use the buckets to empty the wells.\n// Output the number of times you need to lower the buckets.\n// Example 1:\n// Input: \n// grid : [[0,0,1,0], [0,1,0,0], [1,1,1,1]]\n// bucket_capacity : 1\n// Output: 6\n// Example 2:\n// Input: \n// grid : [[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]]\n// bucket_capacity : 2\n// Output: 5\n// Example 3:\n// Input: \n// grid : [[0,0,0], [0,0,0]]\n// bucket_capacity : 5\n// Output: 0\n// Constraints:\n// * all wells have the same length\n// * 1 <= grid.length <= 10^2\n// * 1 <= grid[:,1].length <= 10^2\n// * grid[i][j] -> 0 | 1\n// * 1 <= capacity <= 10\nlong max_fill(std::vector> grid, long capacity) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = max_fill;\n assert(candidate((std::vector>({(std::vector)std::vector({(long)0, (long)0, (long)1, (long)0}), (std::vector)std::vector({(long)0, (long)1, (long)0, (long)0}), (std::vector)std::vector({(long)1, (long)1, (long)1, (long)1})})), (1)) == (6));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)0, (long)0, (long)1, (long)1}), (std::vector)std::vector({(long)0, (long)0, (long)0, (long)0}), (std::vector)std::vector({(long)1, (long)1, (long)1, (long)1}), (std::vector)std::vector({(long)0, (long)1, (long)1, (long)1})})), (2)) == (5));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)0, (long)0, (long)0}), (std::vector)std::vector({(long)0, (long)0, (long)0})})), (5)) == (0));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)1, (long)1, (long)1}), (std::vector)std::vector({(long)1, (long)1, (long)1, (long)1})})), (2)) == (4));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)1, (long)1, (long)1}), (std::vector)std::vector({(long)1, (long)1, (long)1, (long)1})})), (9)) == (2));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "cpp", - "prompt": "#include\n#include\n// Given an array arr of integers and a positive integer k, return a sorted list \n// of length k with the maximum k numbers in arr.\n// Example 1:\n// Input: arr = [-3, -4, 5], k = 3\n// Output: [-4, -3, 5]\n// Example 2:\n// Input: arr = [4, -4, 4], k = 2\n// Output: [4, 4]\n// Example 3:\n// Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1\n// Output: [2]\n// Note:\n// 1. The length of the array will be in the range of [1, 1000].\n// 2. The elements in the array will be in the range of [-1000, 1000].\n// 3. 0 <= k <= len(arr)\nstd::vector maximum(std::vector arr, long k) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = maximum;\n assert(candidate((std::vector({(long)-3, (long)-4, (long)5})), (3)) == (std::vector({(long)-4, (long)-3, (long)5})));\n assert(candidate((std::vector({(long)4, (long)-4, (long)4})), (2)) == (std::vector({(long)4, (long)4})));\n assert(candidate((std::vector({(long)-3, (long)2, (long)1, (long)2, (long)-1, (long)-2, (long)1})), (1)) == (std::vector({(long)2})));\n assert(candidate((std::vector({(long)123, (long)-123, (long)20, (long)0, (long)1, (long)2, (long)-3})), (3)) == (std::vector({(long)2, (long)20, (long)123})));\n assert(candidate((std::vector({(long)-123, (long)20, (long)0, (long)1, (long)2, (long)-3})), (4)) == (std::vector({(long)0, (long)1, (long)2, (long)20})));\n assert(candidate((std::vector({(long)5, (long)15, (long)0, (long)3, (long)-13, (long)-8, (long)0})), (7)) == (std::vector({(long)-13, (long)-8, (long)0, (long)0, (long)3, (long)5, (long)15})));\n assert(candidate((std::vector({(long)-1, (long)0, (long)2, (long)5, (long)3, (long)-10})), (2)) == (std::vector({(long)3, (long)5})));\n assert(candidate((std::vector({(long)1, (long)0, (long)5, (long)-7})), (1)) == (std::vector({(long)5})));\n assert(candidate((std::vector({(long)4, (long)-4})), (2)) == (std::vector({(long)-4, (long)4})));\n assert(candidate((std::vector({(long)-10, (long)10})), (2)) == (std::vector({(long)-10, (long)10})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)-23, (long)243, (long)-400, (long)0})), (0)) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that takes a message, and encodes in such a \n// way that it swaps case of all letters, replaces all vowels in \n// the message with the letter that appears 2 places ahead of that \n// vowel in the english alphabet. \n// Assume only letters. \n// Examples:\n// >>> encode('test')\n// 'TGST'\n// >>> encode('This is a message')\n// 'tHKS KS C MGSSCGG'\nstd::string encode(std::string message) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = encode;\n assert(candidate((\"TEST\")) == (\"tgst\"));\n assert(candidate((\"Mudasir\")) == (\"mWDCSKR\"));\n assert(candidate((\"YES\")) == (\"ygs\"));\n assert(candidate((\"This is a message\")) == (\"tHKS KS C MGSSCGG\"));\n assert(candidate((\"I DoNt KnOw WhAt tO WrItE\")) == (\"k dQnT kNqW wHcT Tq wRkTg\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "cpp", - "prompt": "#include\n#include\n// remove_vowels is a function that takes string and returns string without vowels.\n// >>> remove_vowels('')\n// ''\n// >>> remove_vowels('abcdef')\n// 'bcdf'\n// >>> remove_vowels('aaaaa')\n// ''\n// >>> remove_vowels('aaBAA')\n// 'B'\n// >>> remove_vowels('zbcd')\n// 'zbcd'\nstd::string remove_vowels(std::string text) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = remove_vowels;\n assert(candidate((\"\")) == (\"\"));\n assert(candidate((\"abcdef\\nghijklm\")) == (\"bcdf\\nghjklm\"));\n assert(candidate((\"fedcba\")) == (\"fdcb\"));\n assert(candidate((\"eeeee\")) == (\"\"));\n assert(candidate((\"acBAA\")) == (\"cB\"));\n assert(candidate((\"EcBOO\")) == (\"cB\"));\n assert(candidate((\"ybcd\")) == (\"ybcd\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "cpp", - "prompt": "#include\n#include\n// Return only positive numbers in the list.\n// >>> get_positive([-1, 2, -4, 5, 6])\n// [2, 5, 6]\n// >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n// [5, 3, 2, 3, 9, 123, 1]\nstd::vector get_positive(std::vector l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = get_positive;\n assert(candidate((std::vector({(long)-1, (long)-2, (long)4, (long)5, (long)6}))) == (std::vector({(long)4, (long)5, (long)6})));\n assert(candidate((std::vector({(long)5, (long)3, (long)-5, (long)2, (long)3, (long)3, (long)9, (long)0, (long)123, (long)1, (long)-10}))) == (std::vector({(long)5, (long)3, (long)2, (long)3, (long)3, (long)9, (long)123, (long)1})));\n assert(candidate((std::vector({(long)-1, (long)-2}))) == (std::vector()));\n assert(candidate((std::vector())) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "cpp", - "prompt": "#include\n#include\n// Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n// >>> string_sequence(0)\n// '0'\n// >>> string_sequence(5)\n// '0 1 2 3 4 5'\nstd::string string_sequence(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = string_sequence;\n assert(candidate((0)) == (\"0\"));\n assert(candidate((3)) == (\"0 1 2 3\"));\n assert(candidate((10)) == (\"0 1 2 3 4 5 6 7 8 9 10\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "cpp", - "prompt": "#include\n#include\n// Given a positive integer n, you have to make a pile of n levels of stones.\n// The first level has n stones.\n// The number of stones in the next level is:\n// - the next odd number if n is odd.\n// - the next even number if n is even.\n// Return the number of stones in each level in a list, where element at index\n// i represents the number of stones in the level (i+1).\n// Examples:\n// >>> make_a_pile(3)\n// [3, 5, 7]\nstd::vector make_a_pile(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = make_a_pile;\n assert(candidate((3)) == (std::vector({(long)3, (long)5, (long)7})));\n assert(candidate((4)) == (std::vector({(long)4, (long)6, (long)8, (long)10})));\n assert(candidate((5)) == (std::vector({(long)5, (long)7, (long)9, (long)11, (long)13})));\n assert(candidate((6)) == (std::vector({(long)6, (long)8, (long)10, (long)12, (long)14, (long)16})));\n assert(candidate((8)) == (std::vector({(long)8, (long)10, (long)12, (long)14, (long)16, (long)18, (long)20, (long)22})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "cpp", - "prompt": "#include\n#include\n// Task\n// 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\n// then check if the result string is palindrome.\n// A string is called palindrome if it reads the same backward as forward.\n// You should return a tuple containing the result string and True/False for the check.\n// Example\n// For s = \"abcde\", c = \"ae\", the result should be ('bcd',False)\n// For s = \"abcdef\", c = \"b\" the result should be ('acdef',False)\n// For s = \"abcdedcba\", c = \"ab\", the result should be ('cdedc',True)\nstd::tuple reverse_delete(std::string s, std::string c) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = reverse_delete;\n assert(candidate((\"abcde\"), (\"ae\")) == (std::make_tuple(\"bcd\", false)));\n assert(candidate((\"abcdef\"), (\"b\")) == (std::make_tuple(\"acdef\", false)));\n assert(candidate((\"abcdedcba\"), (\"ab\")) == (std::make_tuple(\"cdedc\", true)));\n assert(candidate((\"dwik\"), (\"w\")) == (std::make_tuple(\"dik\", false)));\n assert(candidate((\"a\"), (\"a\")) == (std::make_tuple(\"\", true)));\n assert(candidate((\"abcdedcba\"), (\"\")) == (std::make_tuple(\"abcdedcba\", true)));\n assert(candidate((\"abcdedcba\"), (\"v\")) == (std::make_tuple(\"abcdedcba\", true)));\n assert(candidate((\"vabba\"), (\"v\")) == (std::make_tuple(\"abba\", true)));\n assert(candidate((\"mamma\"), (\"mia\")) == (std::make_tuple(\"\", true)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "cpp", - "prompt": "#include\n#include\n// For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n// >>> flip_case('Hello')\n// 'hELLO'\nstd::string flip_case(std::string string) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = flip_case;\n assert(candidate((\"\")) == (\"\"));\n assert(candidate((\"Hello!\")) == (\"hELLO!\"));\n assert(candidate((\"These violent delights have violent ends\")) == (\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a string s.\n// if s[i] is a letter, reverse its case from lower to upper or vise versa, \n// otherwise keep it as it is.\n// If the string contains no letters, reverse the string.\n// The function should return the resulted string.\n// Examples\n// solve(\"1234\") = \"4321\"\n// solve(\"ab\") = \"AB\"\n// solve(\"#a@C\") = \"#A@c\"\nstd::string solve(std::string s) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = solve;\n assert(candidate((\"AsDf\")) == (\"aSdF\"));\n assert(candidate((\"1234\")) == (\"4321\"));\n assert(candidate((\"ab\")) == (\"AB\"));\n assert(candidate((\"#a@C\")) == (\"#A@c\"));\n assert(candidate((\"#AsdfW^45\")) == (\"#aSDFw^45\"));\n assert(candidate((\"#6@2\")) == (\"2@6#\"));\n assert(candidate((\"#$a^D\")) == (\"#$A^d\"));\n assert(candidate((\"#ccc\")) == (\"#CCC\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "cpp", - "prompt": "#include\n#include\n// Filter an input list of strings only for ones that start with a given prefix.\n// >>> filter_by_prefix([], 'a')\n// []\n// >>> filter_by_prefix(['abc', 'bcd', 'cde', 'array'], 'a')\n// ['abc', 'array']\nstd::vector filter_by_prefix(std::vector strings, std::string prefix) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = filter_by_prefix;\n assert(candidate((std::vector()), (\"john\")) == (std::vector()));\n assert(candidate((std::vector({(std::string)\"xxx\", (std::string)\"asd\", (std::string)\"xxy\", (std::string)\"john doe\", (std::string)\"xxxAAA\", (std::string)\"xxx\"})), (\"xxx\")) == (std::vector({(std::string)\"xxx\", (std::string)\"xxxAAA\", (std::string)\"xxx\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "cpp", - "prompt": "#include\n#include\n// This function takes two positive numbers x and y and returns the\n// biggest even integer number that is in the range [x, y] inclusive. If \n// there's no such number, then the function should return -1.\n// For example:\n// choose_num(12, 15) = 14\n// choose_num(13, 12) = -1\nlong choose_num(long x, long y) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = choose_num;\n assert(candidate((12), (15)) == (14));\n assert(candidate((13), (12)) == (-1));\n assert(candidate((33), (12354)) == (12354));\n assert(candidate((5234), (5233)) == (-1));\n assert(candidate((6), (29)) == (28));\n assert(candidate((27), (10)) == (-1));\n assert(candidate((7), (7)) == (-1));\n assert(candidate((546), (546)) == (546));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a string representing a sentence,\n// the sentence contains some words separated by a space,\n// and you have to return a string that contains the words from the original sentence,\n// whose lengths are prime numbers,\n// the order of the words in the new string should be the same as the original one.\n// Example 1:\n// Input: sentence = \"This is a test\"\n// Output: \"is\"\n// Example 2:\n// Input: sentence = \"lets go for swimming\"\n// Output: \"go for\"\n// Constraints:\n// * 1 <= len(sentence) <= 100\n// * sentence contains only letters\nstd::string words_in_sentence(std::string sentence) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = words_in_sentence;\n assert(candidate((\"This is a test\")) == (\"is\"));\n assert(candidate((\"lets go for swimming\")) == (\"go for\"));\n assert(candidate((\"there is no place available here\")) == (\"there is no place\"));\n assert(candidate((\"Hi I am Hussein\")) == (\"Hi am Hussein\"));\n assert(candidate((\"go for it\")) == (\"go for it\"));\n assert(candidate((\"here\")) == (\"\"));\n assert(candidate((\"here is\")) == (\"is\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "cpp", - "prompt": "#include\n#include\n// Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n// >>> intersperse([], 4)\n// []\n// >>> intersperse([1, 2, 3], 4)\n// [1, 4, 2, 4, 3]\nstd::vector intersperse(std::vector numbers, long delimeter) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = intersperse;\n assert(candidate((std::vector()), (7)) == (std::vector()));\n assert(candidate((std::vector({(long)5, (long)6, (long)3, (long)2})), (8)) == (std::vector({(long)5, (long)8, (long)6, (long)8, (long)3, (long)8, (long)2})));\n assert(candidate((std::vector({(long)2, (long)2, (long)2})), (2)) == (std::vector({(long)2, (long)2, (long)2, (long)2, (long)2})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "cpp", - "prompt": "#include\n#include\n// Your task is to write a function that returns true if a number x is a simple\n// power of n and false in other cases.\n// x is a simple power of n if n**int=x\n// For example:\n// is_simple_power(1, 4) => true\n// is_simple_power(2, 2) => true\n// is_simple_power(8, 2) => true\n// is_simple_power(3, 2) => false\n// is_simple_power(3, 1) => false\n// is_simple_power(5, 3) => false\nbool is_simple_power(long x, long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = is_simple_power;\n assert(candidate((16), (2)) == (true));\n assert(candidate((143214), (16)) == (false));\n assert(candidate((4), (2)) == (true));\n assert(candidate((9), (3)) == (true));\n assert(candidate((16), (4)) == (true));\n assert(candidate((24), (2)) == (false));\n assert(candidate((128), (4)) == (false));\n assert(candidate((12), (6)) == (false));\n assert(candidate((1), (1)) == (true));\n assert(candidate((1), (12)) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that returns true if the given number is the multiplication of 3 prime numbers\n// and false otherwise.\n// Knowing that (a) is less then 100. \n// Example:\n// is_multiply_prime(30) == True\n// 30 = 2 * 3 * 5\nbool is_multiply_prime(long a) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = is_multiply_prime;\n assert(candidate((5)) == (false));\n assert(candidate((30)) == (true));\n assert(candidate((8)) == (true));\n assert(candidate((10)) == (false));\n assert(candidate((125)) == (true));\n assert(candidate((105)) == (true));\n assert(candidate((126)) == (false));\n assert(candidate((729)) == (false));\n assert(candidate((891)) == (false));\n assert(candidate((1001)) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "cpp", - "prompt": "#include\n#include\n// Given the lengths of the three sides of a triangle. Return True if the three\n// sides form a right-angled triangle, False otherwise.\n// A right-angled triangle is a triangle in which one angle is right angle or \n// 90 degree.\n// Example:\n// right_angle_triangle(3, 4, 5) == True\n// right_angle_triangle(1, 2, 3) == False\nbool right_angle_triangle(long a, long b, long c) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = right_angle_triangle;\n assert(candidate((3), (4), (5)) == (true));\n assert(candidate((1), (2), (3)) == (false));\n assert(candidate((10), (6), (8)) == (true));\n assert(candidate((2), (2), (2)) == (false));\n assert(candidate((7), (24), (25)) == (true));\n assert(candidate((10), (5), (7)) == (false));\n assert(candidate((5), (12), (13)) == (true));\n assert(candidate((15), (8), (17)) == (true));\n assert(candidate((48), (55), (73)) == (true));\n assert(candidate((1), (1), (1)) == (false));\n assert(candidate((2), (2), (10)) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function that takes 3 numbers.\n// Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n// Returns false in any other cases.\n// Examples\n// any_int(5, 2, 7) \u279e True\n// any_int(3, 2, 2) \u279e False\n// any_int(3, -2, 1) \u279e True\n// any_int(3.6, -2.2, 2) \u279e False\nbool any_int(float x, float y, float z) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = any_int;\n assert(candidate((float(2)), (float(3)), (float(1))) == (true));\n assert(candidate((2.5), (float(2)), (float(3))) == (false));\n assert(candidate((1.5), (float(5)), (3.5)) == (false));\n assert(candidate((float(2)), (float(6)), (float(2))) == (false));\n assert(candidate((float(4)), (float(2)), (float(2))) == (true));\n assert(candidate((2.2), (2.2), (2.2)) == (false));\n assert(candidate((float(-4)), (float(6)), (float(2))) == (true));\n assert(candidate((float(2)), (float(1)), (float(1))) == (true));\n assert(candidate((float(3)), (float(4)), (float(7))) == (true));\n assert(candidate((3.0), (float(4)), (float(7))) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "cpp", - "prompt": "#include\n#include\n// This function takes a list l and returns a list l' such that\n// l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n// to the values of the corresponding indicies of l, but sorted.\n// >>> sort_third([1, 2, 3])\n// [1, 2, 3]\n// >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n// [2, 6, 3, 4, 8, 9, 5]\nstd::vector sort_third(std::vector l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = sort_third;\n assert(candidate((std::vector({(long)5, (long)6, (long)3, (long)4, (long)8, (long)9, (long)2}))) == (std::vector({(long)2, (long)6, (long)3, (long)4, (long)8, (long)9, (long)5})));\n assert(candidate((std::vector({(long)5, (long)8, (long)3, (long)4, (long)6, (long)9, (long)2}))) == (std::vector({(long)2, (long)8, (long)3, (long)4, (long)6, (long)9, (long)5})));\n assert(candidate((std::vector({(long)5, (long)6, (long)9, (long)4, (long)8, (long)3, (long)2}))) == (std::vector({(long)2, (long)6, (long)9, (long)4, (long)8, (long)3, (long)5})));\n assert(candidate((std::vector({(long)5, (long)6, (long)3, (long)4, (long)8, (long)9, (long)2, (long)1}))) == (std::vector({(long)2, (long)6, (long)3, (long)4, (long)8, (long)9, (long)5, (long)1})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_53_add", - "language": "cpp", - "prompt": "#include\n#include\n// Add two numbers x and y\n// >>> add(2, 3)\n// 5\n// >>> add(5, 7)\n// 12\nlong add(long x, long y) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = add;\n assert(candidate((0), (1)) == (1));\n assert(candidate((1), (0)) == (1));\n assert(candidate((2), (3)) == (5));\n assert(candidate((5), (7)) == (12));\n assert(candidate((7), (5)) == (12));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_69_search", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n// zero, and has a frequency greater than or equal to the value of the integer itself. \n// The frequency of an integer is the number of times it appears in the list.\n// If no such a value exist, return -1.\n// Examples:\n// search([4, 1, 2, 2, 3, 1]) == 2\n// search([1, 2, 2, 3, 3, 3, 4, 4, 4]) == 3\n// search([5, 5, 4, 4, 4]) == -1\nlong search(std::vector lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = search;\n assert(candidate((std::vector({(long)5, (long)5, (long)5, (long)5, (long)1}))) == (1));\n assert(candidate((std::vector({(long)4, (long)1, (long)4, (long)1, (long)4, (long)4}))) == (4));\n assert(candidate((std::vector({(long)3, (long)3}))) == (-1));\n assert(candidate((std::vector({(long)8, (long)8, (long)8, (long)8, (long)8, (long)8, (long)8, (long)8}))) == (8));\n assert(candidate((std::vector({(long)2, (long)3, (long)3, (long)2, (long)2}))) == (2));\n assert(candidate((std::vector({(long)2, (long)7, (long)8, (long)8, (long)4, (long)8, (long)7, (long)3, (long)9, (long)6, (long)5, (long)10, (long)4, (long)3, (long)6, (long)7, (long)1, (long)7, (long)4, (long)10, (long)8, (long)1}))) == (1));\n assert(candidate((std::vector({(long)3, (long)2, (long)8, (long)2}))) == (2));\n assert(candidate((std::vector({(long)6, (long)7, (long)1, (long)8, (long)8, (long)10, (long)5, (long)8, (long)5, (long)3, (long)10}))) == (1));\n assert(candidate((std::vector({(long)8, (long)8, (long)3, (long)6, (long)5, (long)6, (long)4}))) == (-1));\n assert(candidate((std::vector({(long)6, (long)9, (long)6, (long)7, (long)1, (long)4, (long)7, (long)1, (long)8, (long)8, (long)9, (long)8, (long)10, (long)10, (long)8, (long)4, (long)10, (long)4, (long)10, (long)1, (long)2, (long)9, (long)5, (long)7, (long)9}))) == (1));\n assert(candidate((std::vector({(long)1, (long)9, (long)10, (long)1, (long)3}))) == (1));\n assert(candidate((std::vector({(long)6, (long)9, (long)7, (long)5, (long)8, (long)7, (long)5, (long)3, (long)7, (long)5, (long)10, (long)10, (long)3, (long)6, (long)10, (long)2, (long)8, (long)6, (long)5, (long)4, (long)9, (long)5, (long)3, (long)10}))) == (5));\n assert(candidate((std::vector({(long)1}))) == (1));\n assert(candidate((std::vector({(long)8, (long)8, (long)10, (long)6, (long)4, (long)3, (long)5, (long)8, (long)2, (long)4, (long)2, (long)8, (long)4, (long)6, (long)10, (long)4, (long)2, (long)1, (long)10, (long)2, (long)1, (long)1, (long)5}))) == (4));\n assert(candidate((std::vector({(long)2, (long)10, (long)4, (long)8, (long)2, (long)10, (long)5, (long)1, (long)2, (long)9, (long)5, (long)5, (long)6, (long)3, (long)8, (long)6, (long)4, (long)10}))) == (2));\n assert(candidate((std::vector({(long)1, (long)6, (long)10, (long)1, (long)6, (long)9, (long)10, (long)8, (long)6, (long)8, (long)7, (long)3}))) == (1));\n assert(candidate((std::vector({(long)9, (long)2, (long)4, (long)1, (long)5, (long)1, (long)5, (long)2, (long)5, (long)7, (long)7, (long)7, (long)3, (long)10, (long)1, (long)5, (long)4, (long)2, (long)8, (long)4, (long)1, (long)9, (long)10, (long)7, (long)10, (long)2, (long)8, (long)10, (long)9, (long)4}))) == (4));\n assert(candidate((std::vector({(long)2, (long)6, (long)4, (long)2, (long)8, (long)7, (long)5, (long)6, (long)4, (long)10, (long)4, (long)6, (long)3, (long)7, (long)8, (long)8, (long)3, (long)1, (long)4, (long)2, (long)2, (long)10, (long)7}))) == (4));\n assert(candidate((std::vector({(long)9, (long)8, (long)6, (long)10, (long)2, (long)6, (long)10, (long)2, (long)7, (long)8, (long)10, (long)3, (long)8, (long)2, (long)6, (long)2, (long)3, (long)1}))) == (2));\n assert(candidate((std::vector({(long)5, (long)5, (long)3, (long)9, (long)5, (long)6, (long)3, (long)2, (long)8, (long)5, (long)6, (long)10, (long)10, (long)6, (long)8, (long)4, (long)10, (long)7, (long)7, (long)10, (long)8}))) == (-1));\n assert(candidate((std::vector({(long)10}))) == (-1));\n assert(candidate((std::vector({(long)9, (long)7, (long)7, (long)2, (long)4, (long)7, (long)2, (long)10, (long)9, (long)7, (long)5, (long)7, (long)2}))) == (2));\n assert(candidate((std::vector({(long)5, (long)4, (long)10, (long)2, (long)1, (long)1, (long)10, (long)3, (long)6, (long)1, (long)8}))) == (1));\n assert(candidate((std::vector({(long)7, (long)9, (long)9, (long)9, (long)3, (long)4, (long)1, (long)5, (long)9, (long)1, (long)2, (long)1, (long)1, (long)10, (long)7, (long)5, (long)6, (long)7, (long)6, (long)7, (long)7, (long)6}))) == (1));\n assert(candidate((std::vector({(long)3, (long)10, (long)10, (long)9, (long)2}))) == (-1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that takes a string and returns True if the string\n// length is a prime number or False otherwise\n// Examples\n// prime_length('Hello') == True\n// prime_length('abcdcba') == True\n// prime_length('kittens') == True\n// prime_length('orange') == False\nbool prime_length(std::string string) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = prime_length;\n assert(candidate((\"Hello\")) == (true));\n assert(candidate((\"abcdcba\")) == (true));\n assert(candidate((\"kittens\")) == (true));\n assert(candidate((\"orange\")) == (false));\n assert(candidate((\"wow\")) == (true));\n assert(candidate((\"world\")) == (true));\n assert(candidate((\"MadaM\")) == (true));\n assert(candidate((\"Wow\")) == (true));\n assert(candidate((\"\")) == (false));\n assert(candidate((\"HI\")) == (true));\n assert(candidate((\"go\")) == (true));\n assert(candidate((\"gogo\")) == (false));\n assert(candidate((\"aaaaaaaaaaaaaaa\")) == (false));\n assert(candidate((\"Madam\")) == (true));\n assert(candidate((\"M\")) == (false));\n assert(candidate((\"0\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_58_common", - "language": "cpp", - "prompt": "#include\n#include\n// Return sorted unique common elements for two lists.\n// >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n// [1, 5, 653]\n// >>> common([5, 3, 2, 8], [3, 2])\n// [2, 3]\nstd::vector common(std::vector l1, std::vector l2) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = common;\n assert(candidate((std::vector({(long)1, (long)4, (long)3, (long)34, (long)653, (long)2, (long)5})), (std::vector({(long)5, (long)7, (long)1, (long)5, (long)9, (long)653, (long)121}))) == (std::vector({(long)1, (long)5, (long)653})));\n assert(candidate((std::vector({(long)5, (long)3, (long)2, (long)8})), (std::vector({(long)3, (long)2}))) == (std::vector({(long)2, (long)3})));\n assert(candidate((std::vector({(long)4, (long)3, (long)2, (long)8})), (std::vector({(long)3, (long)2, (long)4}))) == (std::vector({(long)2, (long)3, (long)4})));\n assert(candidate((std::vector({(long)4, (long)3, (long)2, (long)8})), (std::vector())) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "cpp", - "prompt": "#include\n#include\n// The Brazilian factorial is defined as:\n// brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n// where n > 0\n// For example:\n// >>> special_factorial(4)\n// 288\n// The function will receive an integer as input and should return the special\n// factorial of this integer.\nlong special_factorial(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = special_factorial;\n assert(candidate((4)) == (288));\n assert(candidate((5)) == (34560));\n assert(candidate((7)) == (125411328000));\n assert(candidate((1)) == (1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "cpp", - "prompt": "#include\n#include\n// In this problem, you will implement a function that takes two lists of numbers,\n// and determines whether it is possible to perform an exchange of elements\n// between them to make lst1 a list of only even numbers.\n// There is no limit on the number of exchanged elements between lst1 and lst2.\n// If it is possible to exchange elements between the lst1 and lst2 to make\n// all the elements of lst1 to be even, return \"YES\".\n// Otherwise, return \"NO\".\n// For example:\n// exchange([1, 2, 3, 4], [1, 2, 3, 4]) => \"YES\"\n// exchange([1, 2, 3, 4], [1, 5, 3, 4]) => \"NO\"\n// It is assumed that the input lists will be non-empty.\nstd::string exchange(std::vector lst1, std::vector lst2) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = exchange;\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4})), (std::vector({(long)1, (long)2, (long)3, (long)4}))) == (\"YES\"));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4})), (std::vector({(long)1, (long)5, (long)3, (long)4}))) == (\"NO\"));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4})), (std::vector({(long)2, (long)1, (long)4, (long)3}))) == (\"YES\"));\n assert(candidate((std::vector({(long)5, (long)7, (long)3})), (std::vector({(long)2, (long)6, (long)4}))) == (\"YES\"));\n assert(candidate((std::vector({(long)5, (long)7, (long)3})), (std::vector({(long)2, (long)6, (long)3}))) == (\"NO\"));\n assert(candidate((std::vector({(long)3, (long)2, (long)6, (long)1, (long)8, (long)9})), (std::vector({(long)3, (long)5, (long)5, (long)1, (long)1, (long)1}))) == (\"NO\"));\n assert(candidate((std::vector({(long)100, (long)200})), (std::vector({(long)200, (long)200}))) == (\"YES\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "cpp", - "prompt": "#include\n#include\n// Given a non-empty array of integers arr and an integer k, return\n// the sum of the elements with at most two digits from the first k elements of arr.\n// Example:\n// Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4\n// Output: 24 # sum of 21 + 3\n// Constraints:\n// 1. 1 <= len(arr) <= 100\n// 2. 1 <= k <= len(arr)\nlong add_elements(std::vector arr, long k) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = add_elements;\n assert(candidate((std::vector({(long)1, (long)-2, (long)-3, (long)41, (long)57, (long)76, (long)87, (long)88, (long)99})), (3)) == (-4));\n assert(candidate((std::vector({(long)111, (long)121, (long)3, (long)4000, (long)5, (long)6})), (2)) == (0));\n assert(candidate((std::vector({(long)11, (long)21, (long)3, (long)90, (long)5, (long)6, (long)7, (long)8, (long)9})), (4)) == (125));\n assert(candidate((std::vector({(long)111, (long)21, (long)3, (long)4000, (long)5, (long)6, (long)7, (long)8, (long)9})), (4)) == (24));\n assert(candidate((std::vector({(long)1})), (1)) == (1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "cpp", - "prompt": "#include\n#include\n// A simple program which should return the value of x if n is \n// a prime number and should return the value of y otherwise.\n// Examples:\n// for x_or_y(7, 34, 12) == 34\n// for x_or_y(15, 8, 5) == 5\nlong x_or_y(long n, long x, long y) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = x_or_y;\n assert(candidate((7), (34), (12)) == (34));\n assert(candidate((15), (8), (5)) == (5));\n assert(candidate((3), (33), (5212)) == (33));\n assert(candidate((1259), (3), (52)) == (3));\n assert(candidate((7919), (-1), (12)) == (-1));\n assert(candidate((3609), (1245), (583)) == (583));\n assert(candidate((91), (56), (129)) == (129));\n assert(candidate((6), (34), (1234)) == (1234));\n assert(candidate((1), (2), (0)) == (0));\n assert(candidate((2), (2), (0)) == (2));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "cpp", - "prompt": "#include\n#include\n// Given length of a side and high return area for a triangle.\n// >>> triangle_area(5, 3)\n// 7.5\nfloat triangle_area(long a, long h) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = triangle_area;\n assert(candidate((5), (3)) == (7.5));\n assert(candidate((2), (2)) == (2.0));\n assert(candidate((10), (8)) == (40.0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "cpp", - "prompt": "#include\n#include\n// Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n// the last couple centuries. However, what people don't know is Tribonacci sequence.\n// Tribonacci sequence is defined by the recurrence:\n// tri(1) = 3\n// tri(n) = 1 + n / 2, if n is even.\n// tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n// For example:\n// tri(2) = 1 + (2 / 2) = 2\n// tri(4) = 3\n// tri(3) = tri(2) + tri(1) + tri(4)\n// = 2 + 3 + 3 = 8 \n// You are given a non-negative integer number n, you have to a return a list of the \n// first n + 1 numbers of the Tribonacci sequence.\n// Examples:\n// tri(3) = [1, 3, 2, 8]\nstd::vector tri(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = tri;\n assert(candidate((3)) == (std::vector({(long)1, (long)3, (long)2, (long)8})));\n assert(candidate((4)) == (std::vector({(long)1, (long)3, (long)2, (long)8, (long)3})));\n assert(candidate((5)) == (std::vector({(long)1, (long)3, (long)2, (long)8, (long)3, (long)15})));\n assert(candidate((6)) == (std::vector({(long)1, (long)3, (long)2, (long)8, (long)3, (long)15, (long)4})));\n assert(candidate((7)) == (std::vector({(long)1, (long)3, (long)2, (long)8, (long)3, (long)15, (long)4, (long)24})));\n assert(candidate((8)) == (std::vector({(long)1, (long)3, (long)2, (long)8, (long)3, (long)15, (long)4, (long)24, (long)5})));\n assert(candidate((9)) == (std::vector({(long)1, (long)3, (long)2, (long)8, (long)3, (long)15, (long)4, (long)24, (long)5, (long)35})));\n assert(candidate((20)) == (std::vector({(long)1, (long)3, (long)2, (long)8, (long)3, (long)15, (long)4, (long)24, (long)5, (long)35, (long)6, (long)48, (long)7, (long)63, (long)8, (long)80, (long)9, (long)99, (long)10, (long)120, (long)11})));\n assert(candidate((0)) == (std::vector({(long)1})));\n assert(candidate((1)) == (std::vector({(long)1, (long)3})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a list of two strings, both strings consist of open\n// parentheses '(' or close parentheses ')' only.\n// Your job is to check if it is possible to concatenate the two strings in\n// some order, that the resulting string will be good.\n// A string S is considered to be good if and only if all parentheses in S\n// are balanced. For example: the string '(())()' is good, while the string\n// '())' is not.\n// Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n// Examples:\n// match_parens(['()(', ')']) == 'Yes'\n// match_parens([')', ')']) == 'No'\nstd::string match_parens(std::vector lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = match_parens;\n assert(candidate((std::vector({(std::string)\"()(\", (std::string)\")\"}))) == (\"Yes\"));\n assert(candidate((std::vector({(std::string)\")\", (std::string)\")\"}))) == (\"No\"));\n assert(candidate((std::vector({(std::string)\"(()(())\", (std::string)\"())())\"}))) == (\"No\"));\n assert(candidate((std::vector({(std::string)\")())\", (std::string)\"(()()(\"}))) == (\"Yes\"));\n assert(candidate((std::vector({(std::string)\"(())))\", (std::string)\"(()())((\"}))) == (\"Yes\"));\n assert(candidate((std::vector({(std::string)\"()\", (std::string)\"())\"}))) == (\"No\"));\n assert(candidate((std::vector({(std::string)\"(()(\", (std::string)\"()))()\"}))) == (\"Yes\"));\n assert(candidate((std::vector({(std::string)\"((((\", (std::string)\"((())\"}))) == (\"No\"));\n assert(candidate((std::vector({(std::string)\")(()\", (std::string)\"(()(\"}))) == (\"No\"));\n assert(candidate((std::vector({(std::string)\")(\", (std::string)\")(\"}))) == (\"No\"));\n assert(candidate((std::vector({(std::string)\"(\", (std::string)\")\"}))) == (\"Yes\"));\n assert(candidate((std::vector({(std::string)\")\", (std::string)\"(\"}))) == (\"Yes\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "cpp", - "prompt": "#include\n#include\n// From a list of integers, remove all elements that occur more than once.\n// Keep order of elements left the same as in the input.\n// >>> remove_duplicates([1, 2, 3, 2, 4])\n// [1, 3, 4]\nstd::vector remove_duplicates(std::vector numbers) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = remove_duplicates;\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4}))) == (std::vector({(long)1, (long)2, (long)3, (long)4})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)2, (long)4, (long)3, (long)5}))) == (std::vector({(long)1, (long)4, (long)5})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "cpp", - "prompt": "#include\n#include\n// Return a greatest common divisor of two integers a and b\n// >>> greatest_common_divisor(3, 5)\n// 1\n// >>> greatest_common_divisor(25, 15)\n// 5\nlong greatest_common_divisor(long a, long b) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = greatest_common_divisor;\n assert(candidate((3), (7)) == (1));\n assert(candidate((10), (15)) == (5));\n assert(candidate((49), (14)) == (7));\n assert(candidate((144), (60)) == (12));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "cpp", - "prompt": "#include\n#include\n// Checks if given string is a palindrome\n// >>> is_palindrome('')\n// True\n// >>> is_palindrome('aba')\n// True\n// >>> is_palindrome('aaaaa')\n// True\n// >>> is_palindrome('zbcd')\n// False\nbool is_palindrome(std::string text) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = is_palindrome;\n assert(candidate((\"\")) == (true));\n assert(candidate((\"aba\")) == (true));\n assert(candidate((\"aaaaa\")) == (true));\n assert(candidate((\"zbcd\")) == (false));\n assert(candidate((\"xywyx\")) == (true));\n assert(candidate((\"xywyz\")) == (false));\n assert(candidate((\"xywzx\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "cpp", - "prompt": "#include\n#include\n// xs represent coefficients of a polynomial.\n// xs[0] + xs[1] * x + xs[2] * x^2 + ....\n// Return derivative of this polynomial in the same form.\n// >>> derivative([3, 1, 2, 4, 5])\n// [1, 4, 12, 20]\n// >>> derivative([1, 2, 3])\n// [2, 6]\nstd::vector derivative(std::vector xs) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = derivative;\n assert(candidate((std::vector({(long)3, (long)1, (long)2, (long)4, (long)5}))) == (std::vector({(long)1, (long)4, (long)12, (long)20})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3}))) == (std::vector({(long)2, (long)6})));\n assert(candidate((std::vector({(long)3, (long)2, (long)1}))) == (std::vector({(long)2, (long)2})));\n assert(candidate((std::vector({(long)3, (long)2, (long)1, (long)0, (long)4}))) == (std::vector({(long)2, (long)2, (long)0, (long)16})));\n assert(candidate((std::vector({(long)1}))) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "cpp", - "prompt": "#include\n#include\n// In this task, you will be given a string that represents a number of apples and oranges \n// that are distributed in a basket of fruit this basket contains \n// apples, oranges, and mango fruits. Given the string that represents the total number of \n// the oranges and apples and an integer that represent the total number of the fruits \n// in the basket return the number of the mango fruits in the basket.\n// for examble:\n// fruit_distribution(\"5 apples and 6 oranges\", 19) ->19 - 5 - 6 = 8\n// fruit_distribution(\"0 apples and 1 oranges\",3) -> 3 - 0 - 1 = 2\n// fruit_distribution(\"2 apples and 3 oranges\", 100) -> 100 - 2 - 3 = 95\n// fruit_distribution(\"100 apples and 1 oranges\",120) -> 120 - 100 - 1 = 19\nlong fruit_distribution(std::string s, long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = fruit_distribution;\n assert(candidate((\"5 apples and 6 oranges\"), (19)) == (8));\n assert(candidate((\"5 apples and 6 oranges\"), (21)) == (10));\n assert(candidate((\"0 apples and 1 oranges\"), (3)) == (2));\n assert(candidate((\"1 apples and 0 oranges\"), (3)) == (2));\n assert(candidate((\"2 apples and 3 oranges\"), (100)) == (95));\n assert(candidate((\"2 apples and 3 oranges\"), (5)) == (0));\n assert(candidate((\"1 apples and 100 oranges\"), (120)) == (19));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that takes an integer a and returns True \n// if this ingeger is a cube of some integer number.\n// Note: you may assume the input is always valid.\n// Examples:\n// iscube(1) ==> True\n// iscube(2) ==> False\n// iscube(-1) ==> True\n// iscube(64) ==> True\n// iscube(0) ==> True\n// iscube(180) ==> False\nbool iscube(long a) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = iscube;\n assert(candidate((1)) == (true));\n assert(candidate((2)) == (false));\n assert(candidate((-1)) == (true));\n assert(candidate((64)) == (true));\n assert(candidate((180)) == (false));\n assert(candidate((1000)) == (true));\n assert(candidate((0)) == (true));\n assert(candidate((1729)) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "cpp", - "prompt": "#include\n#include\n// In this Kata, you have to sort an array of non-negative integers according to\n// number of ones in their binary representation in ascending order.\n// For similar number of ones, sort based on decimal value.\n// It must be implemented like this:\n// >>> sort_array([1, 5, 2, 3, 4]) == [1, 2, 3, 4, 5]\n// >>> sort_array([-2, -3, -4, -5, -6]) == [-6, -5, -4, -3, -2]\n// >>> sort_array([1, 0, 2, 3, 4]) [0, 1, 2, 3, 4]\nstd::vector sort_array(std::vector arr) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = sort_array;\n assert(candidate((std::vector({(long)1, (long)5, (long)2, (long)3, (long)4}))) == (std::vector({(long)1, (long)2, (long)4, (long)3, (long)5})));\n assert(candidate((std::vector({(long)-2, (long)-3, (long)-4, (long)-5, (long)-6}))) == (std::vector({(long)-4, (long)-2, (long)-6, (long)-5, (long)-3})));\n assert(candidate((std::vector({(long)1, (long)0, (long)2, (long)3, (long)4}))) == (std::vector({(long)0, (long)1, (long)2, (long)4, (long)3})));\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)2, (long)5, (long)77, (long)4, (long)5, (long)3, (long)5, (long)7, (long)2, (long)3, (long)4}))) == (std::vector({(long)2, (long)2, (long)4, (long)4, (long)3, (long)3, (long)5, (long)5, (long)5, (long)7, (long)77})));\n assert(candidate((std::vector({(long)3, (long)6, (long)44, (long)12, (long)32, (long)5}))) == (std::vector({(long)32, (long)3, (long)5, (long)6, (long)12, (long)44})));\n assert(candidate((std::vector({(long)2, (long)4, (long)8, (long)16, (long)32}))) == (std::vector({(long)2, (long)4, (long)8, (long)16, (long)32})));\n assert(candidate((std::vector({(long)2, (long)4, (long)8, (long)16, (long)32}))) == (std::vector({(long)2, (long)4, (long)8, (long)16, (long)32})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "cpp", - "prompt": "#include\n#include\n// Given a list of strings, where each string consists of only digits, return a list.\n// Each element i of the output should be \"the number of odd elements in the\n// string i of the input.\" where all the i's should be replaced by the number\n// of odd digits in the i'th string of the input.\n// >>> odd_count(['1234567'])\n// [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n// >>> odd_count(['3',\"11111111\"])\n// [\"the number of odd elements 1n the str1ng 1 of the 1nput.\",\n// \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\nstd::vector odd_count(std::vector lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = odd_count;\n assert(candidate((std::vector({(std::string)\"1234567\"}))) == (std::vector({(std::string)\"the number of odd elements 4n the str4ng 4 of the 4nput.\"})));\n assert(candidate((std::vector({(std::string)\"3\", (std::string)\"11111111\"}))) == (std::vector({(std::string)\"the number of odd elements 1n the str1ng 1 of the 1nput.\", (std::string)\"the number of odd elements 8n the str8ng 8 of the 8nput.\"})));\n assert(candidate((std::vector({(std::string)\"271\", (std::string)\"137\", (std::string)\"314\"}))) == (std::vector({(std::string)\"the number of odd elements 2n the str2ng 2 of the 2nput.\", (std::string)\"the number of odd elements 3n the str3ng 3 of the 3nput.\", (std::string)\"the number of odd elements 2n the str2ng 2 of the 2nput.\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "cpp", - "prompt": "#include\n#include\n// brackets is a string of \"(\" and \")\".\n// return True if every opening bracket has a corresponding closing bracket.\n// >>> correct_bracketing(\"(\")\n// False\n// >>> correct_bracketing(\"()\")\n// True\n// >>> correct_bracketing(\"(()())\")\n// True\n// >>> correct_bracketing(\")(()\")\n// False\nbool correct_bracketing(std::string brackets) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = correct_bracketing;\n assert(candidate((\"()\")) == (true));\n assert(candidate((\"(()())\")) == (true));\n assert(candidate((\"()()(()())()\")) == (true));\n assert(candidate((\"()()((()()())())(()()(()))\")) == (true));\n assert(candidate((\"((()())))\")) == (false));\n assert(candidate((\")(()\")) == (false));\n assert(candidate((\"(\")) == (false));\n assert(candidate((\"((((\")) == (false));\n assert(candidate((\")\")) == (false));\n assert(candidate((\"(()\")) == (false));\n assert(candidate((\"()()(()())())(()\")) == (false));\n assert(candidate((\"()()(()())()))()\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "cpp", - "prompt": "#include\n#include\n// Task\n// Write a function that takes a string as input and returns the sum of the upper characters only'\n// ASCII codes.\n// Examples:\n// digitSum(\"\") => 0\n// digitSum(\"abAB\") => 131\n// digitSum(\"abcCd\") => 67\n// digitSum(\"helloE\") => 69\n// digitSum(\"woArBld\") => 131\n// digitSum(\"aAaaaXa\") => 153\nlong digitSum(std::string s) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = digitSum;\n assert(candidate((\"\")) == (0));\n assert(candidate((\"abAB\")) == (131));\n assert(candidate((\"abcCd\")) == (67));\n assert(candidate((\"helloE\")) == (69));\n assert(candidate((\"woArBld\")) == (131));\n assert(candidate((\"aAaaaXa\")) == (153));\n assert(candidate((\" How are yOu?\")) == (151));\n assert(candidate((\"You arE Very Smart\")) == (327));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that accepts a list of strings as a parameter,\n// deletes the strings that have odd lengths from it,\n// and returns the resulted list with a sorted order,\n// The list is always a list of strings and never an array of numbers,\n// and it may contain duplicates.\n// The order of the list should be ascending by length of each word, and you\n// should return the list sorted by that rule.\n// If two words have the same length, sort the list alphabetically.\n// The function should return a list of strings in sorted order.\n// You may assume that all words will have the same length.\n// For example:\n// assert list_sort([\"aa\", \"a\", \"aaa\"]) => [\"aa\"]\n// assert list_sort([\"ab\", \"a\", \"aaa\", \"cd\"]) => [\"ab\", \"cd\"]\nstd::vector sorted_list_sum(std::vector lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = sorted_list_sum;\n assert(candidate((std::vector({(std::string)\"aa\", (std::string)\"a\", (std::string)\"aaa\"}))) == (std::vector({(std::string)\"aa\"})));\n assert(candidate((std::vector({(std::string)\"school\", (std::string)\"AI\", (std::string)\"asdf\", (std::string)\"b\"}))) == (std::vector({(std::string)\"AI\", (std::string)\"asdf\", (std::string)\"school\"})));\n assert(candidate((std::vector({(std::string)\"d\", (std::string)\"b\", (std::string)\"c\", (std::string)\"a\"}))) == (std::vector()));\n assert(candidate((std::vector({(std::string)\"d\", (std::string)\"dcba\", (std::string)\"abcd\", (std::string)\"a\"}))) == (std::vector({(std::string)\"abcd\", (std::string)\"dcba\"})));\n assert(candidate((std::vector({(std::string)\"AI\", (std::string)\"ai\", (std::string)\"au\"}))) == (std::vector({(std::string)\"AI\", (std::string)\"ai\", (std::string)\"au\"})));\n assert(candidate((std::vector({(std::string)\"a\", (std::string)\"b\", (std::string)\"b\", (std::string)\"c\", (std::string)\"c\", (std::string)\"a\"}))) == (std::vector()));\n assert(candidate((std::vector({(std::string)\"aaaa\", (std::string)\"bbbb\", (std::string)\"dd\", (std::string)\"cc\"}))) == (std::vector({(std::string)\"cc\", (std::string)\"dd\", (std::string)\"aaaa\", (std::string)\"bbbb\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "cpp", - "prompt": "#include\n#include\n// You are given an array arr of integers and you need to return\n// sum of magnitudes of integers multiplied by product of all signs\n// of each number in the array, represented by 1, -1 or 0.\n// Note: return None for empty arr.\n// Example:\n// >>> prod_signs([1, 2, 2, -4]) == -9\n// >>> prod_signs([0, 1]) == 0\n// >>> prod_signs([]) == None\nstd::optional prod_signs(std::vector arr) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = prod_signs;\n assert(candidate((std::vector({(long)1, (long)2, (long)2, (long)-4}))) == -9);\n assert(candidate((std::vector({(long)0, (long)1}))) == 0);\n assert(candidate((std::vector({(long)1, (long)1, (long)1, (long)2, (long)3, (long)-1, (long)1}))) == -10);\n assert(candidate((std::vector())) == std::nullopt);\n assert(candidate((std::vector({(long)2, (long)4, (long)1, (long)2, (long)-1, (long)-1, (long)9}))) == 20);\n assert(candidate((std::vector({(long)-1, (long)1, (long)-1, (long)1}))) == 4);\n assert(candidate((std::vector({(long)-1, (long)1, (long)1, (long)1}))) == -4);\n assert(candidate((std::vector({(long)-1, (long)1, (long)1, (long)0}))) == 0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "cpp", - "prompt": "#include\n#include\n// Return list with elements incremented by 1.\n// >>> incr_list([1, 2, 3])\n// [2, 3, 4]\n// >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123])\n// [6, 4, 6, 3, 4, 4, 10, 1, 124]\nstd::vector incr_list(std::vector l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = incr_list;\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)3, (long)2, (long)1}))) == (std::vector({(long)4, (long)3, (long)2})));\n assert(candidate((std::vector({(long)5, (long)2, (long)5, (long)2, (long)3, (long)3, (long)9, (long)0, (long)123}))) == (std::vector({(long)6, (long)3, (long)6, (long)3, (long)4, (long)4, (long)10, (long)1, (long)124})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "cpp", - "prompt": "#include\n#include\n// From a given list of integers, generate a list of rolling maximum element found until given moment\n// in the sequence.\n// >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n// [1, 2, 3, 3, 3, 4, 4]\nstd::vector rolling_max(std::vector numbers) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = rolling_max;\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4}))) == (std::vector({(long)1, (long)2, (long)3, (long)4})));\n assert(candidate((std::vector({(long)4, (long)3, (long)2, (long)1}))) == (std::vector({(long)4, (long)4, (long)4, (long)4})));\n assert(candidate((std::vector({(long)3, (long)2, (long)3, (long)100, (long)3}))) == (std::vector({(long)3, (long)3, (long)3, (long)100, (long)100})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "cpp", - "prompt": "#include\n#include\n// Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n// separate those group into separate strings and return the list of those.\n// Separate groups are balanced (each open brace is properly closed) and not nested within each other\n// Ignore any spaces in the input string.\n// >>> separate_paren_groups('( ) (( )) (( )( ))')\n// ['()', '(())', '(()())']\nstd::vector separate_paren_groups(std::string paren_string) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = separate_paren_groups;\n assert(candidate((\"(()()) ((())) () ((())()())\")) == (std::vector({(std::string)\"(()())\", (std::string)\"((()))\", (std::string)\"()\", (std::string)\"((())()())\"})));\n assert(candidate((\"() (()) ((())) (((())))\")) == (std::vector({(std::string)\"()\", (std::string)\"(())\", (std::string)\"((()))\", (std::string)\"(((())))\"})));\n assert(candidate((\"(()(())((())))\")) == (std::vector({(std::string)\"(()(())((())))\"})));\n assert(candidate((\"( ) (( )) (( )( ))\")) == (std::vector({(std::string)\"()\", (std::string)\"(())\", (std::string)\"(()())\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "cpp", - "prompt": "#include\n#include\n// You will be given a string of words separated by commas or spaces. Your task is\n// to split the string into words and return an array of the words.\n// For example:\n// words_string(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n// words_string(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\nstd::vector words_string(std::string s) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = words_string;\n assert(candidate((\"Hi, my name is John\")) == (std::vector({(std::string)\"Hi\", (std::string)\"my\", (std::string)\"name\", (std::string)\"is\", (std::string)\"John\"})));\n assert(candidate((\"One, two, three, four, five, six\")) == (std::vector({(std::string)\"One\", (std::string)\"two\", (std::string)\"three\", (std::string)\"four\", (std::string)\"five\", (std::string)\"six\"})));\n assert(candidate((\"Hi, my name\")) == (std::vector({(std::string)\"Hi\", (std::string)\"my\", (std::string)\"name\"})));\n assert(candidate((\"One,, two, three, four, five, six,\")) == (std::vector({(std::string)\"One\", (std::string)\"two\", (std::string)\"three\", (std::string)\"four\", (std::string)\"five\", (std::string)\"six\"})));\n assert(candidate((\"\")) == (std::vector()));\n assert(candidate((\"ahmed , gamal\")) == (std::vector({(std::string)\"ahmed\", (std::string)\"gamal\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "cpp", - "prompt": "#include\n#include\nunion Union_long_float_std_string{\n long f0;\n float f1;\n std::string f2; Union_long_float_std_string(long _f0) : f0(_f0) {}\n Union_long_float_std_string(float _f1) : f1(_f1) {}\n Union_long_float_std_string(std::string _f2) : f2(_f2) {}\n ~Union_long_float_std_string() {}\n bool operator==(long f) {\n return f0 == f ;\n } bool operator==(float f) {\n return f1 == f ;\n } bool operator==(std::string f) {\n return f2 == f ;\n }\n};\nunion Union_long_float_std_string_std_nullopt{\n long f0;\n float f1;\n std::string f2;\n std::nullopt f3; Union_long_float_std_string_std_nullopt(long _f0) : f0(_f0) {}\n Union_long_float_std_string_std_nullopt(float _f1) : f1(_f1) {}\n Union_long_float_std_string_std_nullopt(std::string _f2) : f2(_f2) {}\n Union_long_float_std_string_std_nullopt(std::nullopt _f3) : f3(_f3) {}\n ~Union_long_float_std_string_std_nullopt() {}\n bool operator==(long f) {\n return f0 == f ;\n } bool operator==(float f) {\n return f1 == f ;\n } bool operator==(std::string f) {\n return f2 == f ;\n } bool operator==(std::nullopt f) {\n return f3 == f ;\n }\n};\n// Create a function that takes integers, floats, or strings representing\n// real numbers, and returns the larger variable in its given variable type.\n// Return None if the values are equal.\n// Note: If a real number is represented as a string, the floating point might be . or ,\n// compare_one(1, 2.5) \u279e 2.5\n// compare_one(1, \"2,3\") \u279e \"2,3\"\n// compare_one(\"5,1\", \"6\") \u279e \"6\"\n// compare_one(\"1\", 1) \u279e None\nUnion_long_float_std_string_std_nullopt compare_one(Union_long_float_std_string a, Union_long_float_std_string b) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_137_compare_one.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = compare_one;\n assert(candidate(1, 2) == 2);\n assert(candidate(1, 2.5) == 2.5);\n assert(candidate(2, 3) == 3);\n assert(candidate(5, 6) == 6);\n assert(candidate(1, \"2,3\") == \"2,3\");\n assert(candidate(\"5,1\", \"6\") == \"6\");\n assert(candidate(\"1\", \"2\") == \"2\");\n assert(candidate(\"1\", 1) == std::nullopt);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "cpp", - "prompt": "#include\n#include\n// Filter given list of any python values only for integers\n// >>> filter_integers(['a', 3.14, 5])\n// [5]\n// >>> filter_integers([1, 2, 3, 'abc', {}, []])\n// [1, 2, 3]\nstd::vector filter_integers(std::vector values) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = filter_integers;\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({4, std::map(), std::vector(), 23.2, 9, \"adasd\"}))) == (std::vector({(long)4, (long)9})));\n assert(candidate((std::vector({3, \"c\", 3, 3, \"a\", \"b\"}))) == (std::vector({(long)3, (long)3, (long)3})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "cpp", - "prompt": "#include\n#include\n// This function takes a list l and returns a list l' such that\n// l' is identical to l in the odd indicies, while its values at the even indicies are equal\n// to the values of the even indicies of l, but sorted.\n// >>> sort_even([1, 2, 3])\n// [1, 2, 3]\n// >>> sort_even([5, 6, 3, 4])\n// [3, 6, 5, 4]\nstd::vector sort_even(std::vector l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = sort_even;\n assert(candidate((std::vector({(long)1, (long)2, (long)3}))) == (std::vector({(long)1, (long)2, (long)3})));\n assert(candidate((std::vector({(long)5, (long)3, (long)-5, (long)2, (long)-3, (long)3, (long)9, (long)0, (long)123, (long)1, (long)-10}))) == (std::vector({(long)-10, (long)3, (long)-5, (long)2, (long)-3, (long)3, (long)5, (long)0, (long)9, (long)1, (long)123})));\n assert(candidate((std::vector({(long)5, (long)8, (long)-12, (long)4, (long)23, (long)2, (long)3, (long)11, (long)12, (long)-10}))) == (std::vector({(long)-12, (long)8, (long)3, (long)4, (long)5, (long)2, (long)12, (long)11, (long)23, (long)-10})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "cpp", - "prompt": "#include\n#include\n// I think we all remember that feeling when the result of some long-awaited\n// event is finally known. The feelings and thoughts you have at that moment are\n// definitely worth noting down and comparing.\n// Your task is to determine if a person correctly guessed the results of a number of matches.\n// You are given two arrays of scores and guesses of equal length, where each index shows a match. \n// Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n// the value is 0, and if not, the value is the absolute difference between the guess and the score.\n// example:\n// compare([1,2,3,4,5,1],[1,2,3,4,2,-2]) -> [0,0,0,0,3,3]\n// compare([0,5,0,0,0,4],[4,1,1,0,0,-2]) -> [4,4,1,0,0,6]\nstd::vector compare(std::vector game, std::vector guess) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = compare;\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)1})), (std::vector({(long)1, (long)2, (long)3, (long)4, (long)2, (long)-2}))) == (std::vector({(long)0, (long)0, (long)0, (long)0, (long)3, (long)3})));\n assert(candidate((std::vector({(long)0, (long)0, (long)0, (long)0, (long)0, (long)0})), (std::vector({(long)0, (long)0, (long)0, (long)0, (long)0, (long)0}))) == (std::vector({(long)0, (long)0, (long)0, (long)0, (long)0, (long)0})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3})), (std::vector({(long)-1, (long)-2, (long)-3}))) == (std::vector({(long)2, (long)4, (long)6})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)5})), (std::vector({(long)-1, (long)2, (long)3, (long)4}))) == (std::vector({(long)2, (long)0, (long)0, (long)1})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "cpp", - "prompt": "#include\n#include\n// Given a positive integer n, return a tuple that has the number of even and odd\n// integer palindromes that fall within the range(1, n), inclusive.\n// Example 1:\n// Input: 3\n// Output: (1, 2)\n// Explanation:\n// Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n// Example 2:\n// Input: 12\n// Output: (4, 6)\n// Explanation:\n// Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n// Note:\n// 1. 1 <= n <= 10^3\n// 2. returned tuple has the number of even and odd integer palindromes respectively.\nstd::tuple even_odd_palindrome(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = even_odd_palindrome;\n assert(candidate((123)) == (std::make_tuple(8, 13)));\n assert(candidate((12)) == (std::make_tuple(4, 6)));\n assert(candidate((3)) == (std::make_tuple(1, 2)));\n assert(candidate((63)) == (std::make_tuple(6, 8)));\n assert(candidate((25)) == (std::make_tuple(5, 6)));\n assert(candidate((19)) == (std::make_tuple(4, 6)));\n assert(candidate((9)) == (std::make_tuple(4, 5)));\n assert(candidate((1)) == (std::make_tuple(0, 1)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "cpp", - "prompt": "#include\n#include\n// The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fib4(0) -> 0\n// fib4(1) -> 0\n// fib4(2) -> 2\n// fib4(3) -> 0\n// fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n// Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n// >>> fib4(5)\n// 4\n// >>> fib4(6)\n// 8\n// >>> fib4(7)\n// 14\nlong fib4(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = fib4;\n assert(candidate((5)) == (4));\n assert(candidate((8)) == (28));\n assert(candidate((10)) == (104));\n assert(candidate((12)) == (386));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "cpp", - "prompt": "#include\n#include\n// Given two positive integers a and b, return the even digits between a\n// and b, in ascending order.\n// For example:\n// generate_integers(2, 8) => [2, 4, 6, 8]\n// generate_integers(8, 2) => [2, 4, 6, 8]\n// generate_integers(10, 14) => []\nstd::vector generate_integers(long a, long b) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = generate_integers;\n assert(candidate((2), (10)) == (std::vector({(long)2, (long)4, (long)6, (long)8})));\n assert(candidate((10), (2)) == (std::vector({(long)2, (long)4, (long)6, (long)8})));\n assert(candidate((132), (2)) == (std::vector({(long)2, (long)4, (long)6, (long)8})));\n assert(candidate((17), (89)) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "cpp", - "prompt": "#include\n#include\n// For a given list of input numbers, calculate Mean Absolute Deviation\n// around the mean of this dataset.\n// Mean Absolute Deviation is the average absolute difference between each\n// element and a centerpoint (mean in this case):\n// MAD = average | x - x_mean |\n// >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n// 1.0\nfloat mean_absolute_deviation(std::vector numbers) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = mean_absolute_deviation;\n assert(candidate((std::vector({(float)1.0, (float)2.0}))) == (0.5));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0}))) == (1.0));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0, (float)5.0}))) == (1.2));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function encrypt that takes a string as an argument and\n// returns a string encrypted with the alphabet being rotated. \n// The alphabet should be rotated in a manner such that the letters \n// shift down by two multiplied to two places.\n// For example:\n// encrypt('hi') returns 'lm'\n// encrypt('asdfghjkl') returns 'ewhjklnop'\n// encrypt('gf') returns 'kj'\n// encrypt('et') returns 'ix'\nstd::string encrypt(std::string s) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = encrypt;\n assert(candidate((\"hi\")) == (\"lm\"));\n assert(candidate((\"asdfghjkl\")) == (\"ewhjklnop\"));\n assert(candidate((\"gf\")) == (\"kj\"));\n assert(candidate((\"et\")) == (\"ix\"));\n assert(candidate((\"faewfawefaewg\")) == (\"jeiajeaijeiak\"));\n assert(candidate((\"hellomyfriend\")) == (\"lippsqcjvmirh\"));\n assert(candidate((\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\")) == (\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\"));\n assert(candidate((\"a\")) == (\"e\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "cpp", - "prompt": "#include\n#include\n// Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n// The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n// as follows: start with any positive integer n. Then each term is obtained from the \n// previous term as follows: if the previous term is even, the next term is one half of \n// the previous term. If the previous term is odd, the next term is 3 times the previous\n// term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n// Note: \n// 1. Collatz(1) is [1].\n// 2. returned list sorted in increasing order.\n// For example:\n// get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\nstd::vector get_odd_collatz(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = get_odd_collatz;\n assert(candidate((14)) == (std::vector({(long)1, (long)5, (long)7, (long)11, (long)13, (long)17})));\n assert(candidate((5)) == (std::vector({(long)1, (long)5})));\n assert(candidate((12)) == (std::vector({(long)1, (long)3, (long)5})));\n assert(candidate((1)) == (std::vector({(long)1})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "cpp", - "prompt": "#include\n#include\n// Find how many times a given substring can be found in the original string. Count overlaping cases.\n// >>> how_many_times('', 'a')\n// 0\n// >>> how_many_times('aaa', 'a')\n// 3\n// >>> how_many_times('aaaa', 'aa')\n// 3\nlong how_many_times(std::string string, std::string substring) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = how_many_times;\n assert(candidate((\"\"), (\"x\")) == (0));\n assert(candidate((\"xyxyxyx\"), (\"x\")) == (4));\n assert(candidate((\"cacacacac\"), (\"cac\")) == (4));\n assert(candidate((\"john doe\"), (\"john\")) == (1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "cpp", - "prompt": "#include\n#include\n// We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n// numbers in the array will be randomly ordered. Your task is to determine if\n// it is possible to get an array sorted in non-decreasing order by performing \n// the following operation on the given array:\n// You are allowed to perform right shift operation any number of times.\n// One right shift operation means shifting all elements of the array by one\n// position in the right direction. The last element of the array will be moved to\n// the starting position in the array i.e. 0th index. \n// If it is possible to obtain the sorted array by performing the above operation\n// then return True else return False.\n// If the given array is empty then return True.\n// Note: The given list is guaranteed to have unique elements.\n// For Example:\n// move_one_ball([3, 4, 5, 1, 2])==>True\n// Explanation: By performin 2 right shift operations, non-decreasing order can\n// be achieved for the given array.\n// move_one_ball([3, 5, 4, 1, 2])==>False\n// Explanation:It is not possible to get non-decreasing order for the given\n// array by performing any number of right shift operations.\nbool move_one_ball(std::vector arr) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = move_one_ball;\n assert(candidate((std::vector({(long)3, (long)4, (long)5, (long)1, (long)2}))) == (true));\n assert(candidate((std::vector({(long)3, (long)5, (long)10, (long)1, (long)2}))) == (true));\n assert(candidate((std::vector({(long)4, (long)3, (long)1, (long)2}))) == (false));\n assert(candidate((std::vector({(long)3, (long)5, (long)4, (long)1, (long)2}))) == (false));\n assert(candidate((std::vector())) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function which sorts the given list of integers\n// in ascending order according to the sum of their digits.\n// Note: if there are several items with similar sum of their digits,\n// order them based on their index in original list.\n// For example:\n// >>> order_by_points([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]\n// >>> order_by_points([]) == []\nstd::vector order_by_points(std::vector nums) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = order_by_points;\n assert(candidate((std::vector({(long)1, (long)11, (long)-1, (long)-11, (long)-12}))) == (std::vector({(long)-1, (long)-11, (long)1, (long)-12, (long)11})));\n assert(candidate((std::vector({(long)1234, (long)423, (long)463, (long)145, (long)2, (long)423, (long)423, (long)53, (long)6, (long)37, (long)3457, (long)3, (long)56, (long)0, (long)46}))) == (std::vector({(long)0, (long)2, (long)3, (long)6, (long)53, (long)423, (long)423, (long)423, (long)1234, (long)145, (long)37, (long)46, (long)56, (long)463, (long)3457})));\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)1, (long)-11, (long)-32, (long)43, (long)54, (long)-98, (long)2, (long)-3}))) == (std::vector({(long)-3, (long)-32, (long)-98, (long)-11, (long)1, (long)2, (long)43, (long)54})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6, (long)7, (long)8, (long)9, (long)10, (long)11}))) == (std::vector({(long)1, (long)10, (long)2, (long)11, (long)3, (long)4, (long)5, (long)6, (long)7, (long)8, (long)9})));\n assert(candidate((std::vector({(long)0, (long)6, (long)6, (long)-76, (long)-21, (long)23, (long)4}))) == (std::vector({(long)-76, (long)-21, (long)0, (long)4, (long)23, (long)6, (long)6})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "cpp", - "prompt": "#include\n#include\n// Return list of prime factors of given integer in the order from smallest to largest.\n// Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n// Input number should be equal to the product of all factors\n// >>> factorize(8)\n// [2, 2, 2]\n// >>> factorize(25)\n// [5, 5]\n// >>> factorize(70)\n// [2, 5, 7]\nstd::vector factorize(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = factorize;\n assert(candidate((2)) == (std::vector({(long)2})));\n assert(candidate((4)) == (std::vector({(long)2, (long)2})));\n assert(candidate((8)) == (std::vector({(long)2, (long)2, (long)2})));\n assert(candidate((57)) == (std::vector({(long)3, (long)19})));\n assert(candidate((3249)) == (std::vector({(long)3, (long)3, (long)19, (long)19})));\n assert(candidate((185193)) == (std::vector({(long)3, (long)3, (long)3, (long)19, (long)19, (long)19})));\n assert(candidate((20577)) == (std::vector({(long)3, (long)19, (long)19, (long)19})));\n assert(candidate((18)) == (std::vector({(long)2, (long)3, (long)3})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "cpp", - "prompt": "#include\n#include\n// Return True if all numbers in the list l are below threshold t.\n// >>> below_threshold([1, 2, 4, 10], 100)\n// True\n// >>> below_threshold([1, 20, 4, 10], 5)\n// False\nbool below_threshold(std::vector l, long t) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = below_threshold;\n assert(candidate((std::vector({(long)1, (long)2, (long)4, (long)10})), (100)) == (true));\n assert(candidate((std::vector({(long)1, (long)20, (long)4, (long)10})), (5)) == (false));\n assert(candidate((std::vector({(long)1, (long)20, (long)4, (long)10})), (21)) == (true));\n assert(candidate((std::vector({(long)1, (long)20, (long)4, (long)10})), (22)) == (true));\n assert(candidate((std::vector({(long)1, (long)8, (long)4, (long)10})), (11)) == (true));\n assert(candidate((std::vector({(long)1, (long)8, (long)4, (long)10})), (10)) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "cpp", - "prompt": "#include\n#include\nunion Union_std_string_long{\n std::string f0;\n long f1; Union_std_string_long(std::string _f0) : f0(_f0) {}\n Union_std_string_long(long _f1) : f1(_f1) {}\n ~Union_std_string_long() {}\n bool operator==(std::string f) {\n return f0 == f ;\n } bool operator==(long f) {\n return f1 == f ;\n }\n};\n// You are given two positive integers n and m, and your task is to compute the\n// average of the integers from n through m (including n and m). \n// Round the answer to the nearest integer and convert that to binary.\n// If n is greater than m, return -1.\n// Example:\n// rounded_avg(1, 5) => \"0b11\"\n// rounded_avg(7, 5) => -1\n// rounded_avg(10, 20) => \"0b1111\"\n// rounded_avg(20, 33) => \"0b11010\"\nUnion_std_string_long rounded_avg(long n, long m) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = rounded_avg;\n assert(candidate((1), (5)) == \"0b11\");\n assert(candidate((7), (13)) == \"0b1010\");\n assert(candidate((964), (977)) == \"0b1111001010\");\n assert(candidate((996), (997)) == \"0b1111100100\");\n assert(candidate((560), (851)) == \"0b1011000010\");\n assert(candidate((185), (546)) == \"0b101101110\");\n assert(candidate((362), (496)) == \"0b110101101\");\n assert(candidate((350), (902)) == \"0b1001110010\");\n assert(candidate((197), (233)) == \"0b11010111\");\n assert(candidate((7), (5)) == -1);\n assert(candidate((5), (1)) == -1);\n assert(candidate((5), (5)) == \"0b101\");\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "cpp", - "prompt": "#include\n#include\n// Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n// For each of the group, output the deepest level of nesting of parentheses.\n// E.g. (()()) has maximum two levels of nesting while ((())) has three.\n// >>> parse_nested_parens('(()()) ((())) () ((())()())')\n// [2, 3, 1, 3]\nstd::vector parse_nested_parens(std::string paren_string) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = parse_nested_parens;\n assert(candidate((\"(()()) ((())) () ((())()())\")) == (std::vector({(long)2, (long)3, (long)1, (long)3})));\n assert(candidate((\"() (()) ((())) (((())))\")) == (std::vector({(long)1, (long)2, (long)3, (long)4})));\n assert(candidate((\"(()(())((())))\")) == (std::vector({(long)4})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "cpp", - "prompt": "#include\n#include\n// Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n// Examples\n// solution([5, 8, 7, 1]) ==> 12\n// solution([3, 3, 3, 3, 3]) ==> 9\n// solution([30, 13, 24, 321]) ==>0\nlong solution(std::vector lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = solution;\n assert(candidate((std::vector({(long)5, (long)8, (long)7, (long)1}))) == (12));\n assert(candidate((std::vector({(long)3, (long)3, (long)3, (long)3, (long)3}))) == (9));\n assert(candidate((std::vector({(long)30, (long)13, (long)24, (long)321}))) == (0));\n assert(candidate((std::vector({(long)5, (long)9}))) == (5));\n assert(candidate((std::vector({(long)2, (long)4, (long)8}))) == (0));\n assert(candidate((std::vector({(long)30, (long)13, (long)23, (long)32}))) == (23));\n assert(candidate((std::vector({(long)3, (long)13, (long)2, (long)9}))) == (3));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a positive integer n. You have to create an integer array a of length n.\n// For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n// Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n// and a[i] + a[j] + a[k] is a multiple of 3.\n// Example :\n// Input: n = 5\n// Output: 1\n// Explanation: \n// a = [1, 3, 7, 13, 21]\n// The only valid triple is (1, 7, 13).\nlong get_max_triples(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = get_max_triples;\n assert(candidate((5)) == (1));\n assert(candidate((6)) == (4));\n assert(candidate((10)) == (36));\n assert(candidate((100)) == (53361));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "cpp", - "prompt": "#include\n#include\n// There are eight planets in our solar system: the closerst to the Sun \n// is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n// Uranus, Neptune.\n// Write a function that takes two planet names as strings planet1 and planet2. \n// The function should return a tuple containing all planets whose orbits are \n// located between the orbit of planet1 and the orbit of planet2, sorted by \n// the proximity to the sun. \n// The function should return an empty tuple if planet1 or planet2\n// are not correct planet names. \n// Examples\n// bf(\"Jupiter\", \"Neptune\") ==> (\"Saturn\", \"Uranus\")\n// bf(\"Earth\", \"Mercury\") ==> (\"Venus\")\n// bf(\"Mercury\", \"Uranus\") ==> (\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\")\nstd::vector bf(std::string planet1, std::string planet2) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = bf;\n assert(candidate((\"Jupiter\"), (\"Neptune\")) == (std::vector({(std::string)\"Saturn\", (std::string)\"Uranus\"})));\n assert(candidate((\"Earth\"), (\"Mercury\")) == (std::vector({(std::string)\"Venus\"})));\n assert(candidate((\"Mercury\"), (\"Uranus\")) == (std::vector({(std::string)\"Venus\", (std::string)\"Earth\", (std::string)\"Mars\", (std::string)\"Jupiter\", (std::string)\"Saturn\"})));\n assert(candidate((\"Neptune\"), (\"Venus\")) == (std::vector({(std::string)\"Earth\", (std::string)\"Mars\", (std::string)\"Jupiter\", (std::string)\"Saturn\", (std::string)\"Uranus\"})));\n assert(candidate((\"Earth\"), (\"Earth\")) == (std::vector()));\n assert(candidate((\"Mars\"), (\"Earth\")) == (std::vector()));\n assert(candidate((\"Jupiter\"), (\"Makemake\")) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a list of integers.\n// Write a function next_smallest() that returns the 2nd smallest element of the list.\n// Return None if there is no such element.\n// next_smallest([1, 2, 3, 4, 5]) == 2\n// next_smallest([5, 1, 4, 3, 2]) == 2\n// next_smallest([]) == None\n// next_smallest([1, 1]) == None\nstd::optional next_smallest(std::vector lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = next_smallest;\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5}))) == 2);\n assert(candidate((std::vector({(long)5, (long)1, (long)4, (long)3, (long)2}))) == 2);\n assert(candidate((std::vector())) == std::nullopt);\n assert(candidate((std::vector({(long)1, (long)1}))) == std::nullopt);\n assert(candidate((std::vector({(long)1, (long)1, (long)1, (long)1, (long)0}))) == 1);\n assert(candidate((std::vector({(long)1, (long)1}))) == std::nullopt);\n assert(candidate((std::vector({(long)-35, (long)34, (long)12, (long)-45}))) == -35);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "cpp", - "prompt": "#include\n#include\n// Input is a space-delimited string of numberals from 'zero' to 'nine'.\n// Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n// Return the string with numbers sorted from smallest to largest\n// >>> sort_numbers('three one five')\n// 'one three five'\nstd::string sort_numbers(std::string numbers) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = sort_numbers;\n assert(candidate((\"\")) == (\"\"));\n assert(candidate((\"three\")) == (\"three\"));\n assert(candidate((\"three five nine\")) == (\"three five nine\"));\n assert(candidate((\"five zero four seven nine eight\")) == (\"zero four five seven eight nine\"));\n assert(candidate((\"six five four three two one zero\")) == (\"zero one two three four five six\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "cpp", - "prompt": "#include\n#include\n// You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n// cycpattern_check(\"abcd\",\"abd\") => False\n// cycpattern_check(\"hello\",\"ell\") => True\n// cycpattern_check(\"whassup\",\"psus\") => False\n// cycpattern_check(\"abab\",\"baa\") => True\n// cycpattern_check(\"efef\",\"eeff\") => False\n// cycpattern_check(\"himenss\",\"simen\") => True\nbool cycpattern_check(std::string a, std::string b) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = cycpattern_check;\n assert(candidate((\"xyzw\"), (\"xyw\")) == (false));\n assert(candidate((\"yello\"), (\"ell\")) == (true));\n assert(candidate((\"whattup\"), (\"ptut\")) == (false));\n assert(candidate((\"efef\"), (\"fee\")) == (true));\n assert(candidate((\"abab\"), (\"aabb\")) == (false));\n assert(candidate((\"winemtt\"), (\"tinem\")) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "cpp", - "prompt": "#include\n#include\n// You will be given a number in decimal form and your task is to convert it to\n// binary format. The function should return a string, with each character representing a binary\n// number. Each character in the string will be '0' or '1'.\n// There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n// The extra characters are there to help with the format.\n// Examples:\n// decimal_to_binary(15) # returns \"db1111db\"\n// decimal_to_binary(32) # returns \"db100000db\"\nstd::string decimal_to_binary(long decimal) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = decimal_to_binary;\n assert(candidate((0)) == (\"db0db\"));\n assert(candidate((32)) == (\"db100000db\"));\n assert(candidate((103)) == (\"db1100111db\"));\n assert(candidate((15)) == (\"db1111db\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "cpp", - "prompt": "#include\n#include\n// Filter an input list of strings only for ones that contain given substring\n// >>> filter_by_substring([], 'a')\n// []\n// >>> filter_by_substring(['abc', 'bacd', 'cde', 'array'], 'a')\n// ['abc', 'bacd', 'array']\nstd::vector filter_by_substring(std::vector strings, std::string substring) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = filter_by_substring;\n assert(candidate((std::vector()), (\"john\")) == (std::vector()));\n assert(candidate((std::vector({(std::string)\"xxx\", (std::string)\"asd\", (std::string)\"xxy\", (std::string)\"john doe\", (std::string)\"xxxAAA\", (std::string)\"xxx\"})), (\"xxx\")) == (std::vector({(std::string)\"xxx\", (std::string)\"xxxAAA\", (std::string)\"xxx\"})));\n assert(candidate((std::vector({(std::string)\"xxx\", (std::string)\"asd\", (std::string)\"aaaxxy\", (std::string)\"john doe\", (std::string)\"xxxAAA\", (std::string)\"xxx\"})), (\"xx\")) == (std::vector({(std::string)\"xxx\", (std::string)\"aaaxxy\", (std::string)\"xxxAAA\", (std::string)\"xxx\"})));\n assert(candidate((std::vector({(std::string)\"grunt\", (std::string)\"trumpet\", (std::string)\"prune\", (std::string)\"gruesome\"})), (\"run\")) == (std::vector({(std::string)\"grunt\", (std::string)\"prune\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "cpp", - "prompt": "#include\n#include\n// Given an integer. return a tuple that has the number of even and odd digits respectively.\n// Example:\n// even_odd_count(-12) ==> (1, 1)\n// even_odd_count(123) ==> (1, 2)\nstd::tuple even_odd_count(long num) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = even_odd_count;\n assert(candidate((7)) == (std::make_tuple(0, 1)));\n assert(candidate((-78)) == (std::make_tuple(1, 1)));\n assert(candidate((3452)) == (std::make_tuple(2, 2)));\n assert(candidate((346211)) == (std::make_tuple(3, 3)));\n assert(candidate((-345821)) == (std::make_tuple(3, 3)));\n assert(candidate((-2)) == (std::make_tuple(1, 0)));\n assert(candidate((-45347)) == (std::make_tuple(2, 3)));\n assert(candidate((0)) == (std::make_tuple(1, 0)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that accepts a list of strings.\n// The list contains different words. Return the word with maximum number\n// of unique characters. If multiple strings have maximum number of unique\n// characters, return the one which comes first in lexicographical order.\n// find_max([\"name\", \"of\", \"string\"]) == \"string\"\n// find_max([\"name\", \"enam\", \"game\"]) == \"enam\"\n// find_max([\"aaaaaaa\", \"bb\" ,\"cc\"]) == \"\"aaaaaaa\"\nstd::string find_max(std::vector words) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = find_max;\n assert(candidate((std::vector({(std::string)\"name\", (std::string)\"of\", (std::string)\"string\"}))) == (\"string\"));\n assert(candidate((std::vector({(std::string)\"name\", (std::string)\"enam\", (std::string)\"game\"}))) == (\"enam\"));\n assert(candidate((std::vector({(std::string)\"aaaaaaa\", (std::string)\"bb\", (std::string)\"cc\"}))) == (\"aaaaaaa\"));\n assert(candidate((std::vector({(std::string)\"abc\", (std::string)\"cba\"}))) == (\"abc\"));\n assert(candidate((std::vector({(std::string)\"play\", (std::string)\"this\", (std::string)\"game\", (std::string)\"of\", (std::string)\"footbott\"}))) == (\"footbott\"));\n assert(candidate((std::vector({(std::string)\"we\", (std::string)\"are\", (std::string)\"gonna\", (std::string)\"rock\"}))) == (\"gonna\"));\n assert(candidate((std::vector({(std::string)\"we\", (std::string)\"are\", (std::string)\"a\", (std::string)\"mad\", (std::string)\"nation\"}))) == (\"nation\"));\n assert(candidate((std::vector({(std::string)\"this\", (std::string)\"is\", (std::string)\"a\", (std::string)\"prrk\"}))) == (\"this\"));\n assert(candidate((std::vector({(std::string)\"b\"}))) == (\"b\"));\n assert(candidate((std::vector({(std::string)\"play\", (std::string)\"play\", (std::string)\"play\"}))) == (\"play\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "cpp", - "prompt": "#include\n#include\n// Given a positive integer n, return the count of the numbers of n-digit\n// positive integers that start or end with 1.\nlong starts_one_ends(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = starts_one_ends;\n assert(candidate((1)) == (1));\n assert(candidate((2)) == (18));\n assert(candidate((3)) == (180));\n assert(candidate((4)) == (1800));\n assert(candidate((5)) == (18000));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function that returns a tuple (a, b), where 'a' is\n// the largest of negative integers, and 'b' is the smallest\n// of positive integers in a list.\n// If there is no negative or positive integers, return them as None.\n// Examples:\n// largest_smallest_integers([2, 4, 1, 3, 5, 7]) == (None, 1)\n// largest_smallest_integers([]) == (None, None)\n// largest_smallest_integers([0]) == (None, None)\nstd::tuple, std::optional> largest_smallest_integers(std::vector lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = largest_smallest_integers;\n assert(candidate((std::vector({(long)2, (long)4, (long)1, (long)3, (long)5, (long)7}))) == std::make_tuple(std::optional(std::nullopt), std::optional(1)));\n assert(candidate((std::vector({(long)2, (long)4, (long)1, (long)3, (long)5, (long)7, (long)0}))) == std::make_tuple(std::optional(std::nullopt), std::optional(1)));\n assert(candidate((std::vector({(long)1, (long)3, (long)2, (long)4, (long)5, (long)6, (long)-2}))) == std::make_tuple(-2, 1));\n assert(candidate((std::vector({(long)4, (long)5, (long)3, (long)6, (long)2, (long)7, (long)-7}))) == std::make_tuple(-7, 2));\n assert(candidate((std::vector({(long)7, (long)3, (long)8, (long)4, (long)9, (long)2, (long)5, (long)-9}))) == std::make_tuple(-9, 2));\n assert(candidate((std::vector())) == std::make_tuple(std::optional(std::nullopt), std::optional(std::nullopt)));\n assert(candidate((std::vector({(long)0}))) == std::make_tuple(std::optional(std::nullopt), std::optional(std::nullopt)));\n assert(candidate((std::vector({(long)-1, (long)-3, (long)-5, (long)-6}))) == std::make_tuple(std::optional(-1), std::optional(std::nullopt)));\n assert(candidate((std::vector({(long)-1, (long)-3, (long)-5, (long)-6, (long)0}))) == std::make_tuple(std::optional(-1), std::optional(std::nullopt)));\n assert(candidate((std::vector({(long)-6, (long)-4, (long)-4, (long)-3, (long)1}))) == std::make_tuple(-3, 1));\n assert(candidate((std::vector({(long)-6, (long)-4, (long)-4, (long)-3, (long)-100, (long)1}))) == std::make_tuple(-3, 1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "cpp", - "prompt": "#include\n#include\n// \"Given an array representing a branch of a tree that has non-negative integer nodes\n// your task is to pluck one of the nodes and return it.\n// The plucked node should be the node with the smallest even value.\n// If multiple nodes with the same smallest even value are found return the node that has smallest index.\n// The plucked node should be returned in a list, [ smalest_value, its index ],\n// If there are no even values or the given array is empty, return [].\n// Example 1:\n// Input: [4,2,3]\n// Output: [2, 1]\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 2:\n// Input: [1,2,3]\n// Output: [2, 1]\n// Explanation: 2 has the smallest even value, and 2 has the smallest index. \n// Example 3:\n// Input: []\n// Output: []\n// Example 4:\n// Input: [5, 0, 3, 0, 4, 2]\n// Output: [0, 1]\n// Explanation: 0 is the smallest value, but there are two zeros,\n// so we will choose the first zero, which has the smallest index.\n// Constraints:\n// * 1 <= nodes.length <= 10000\n// * 0 <= node.value\nstd::vector pluck(std::vector arr) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = pluck;\n assert(candidate((std::vector({(long)4, (long)2, (long)3}))) == (std::vector({(long)2, (long)1})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3}))) == (std::vector({(long)2, (long)1})));\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)5, (long)0, (long)3, (long)0, (long)4, (long)2}))) == (std::vector({(long)0, (long)1})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)0, (long)5, (long)3}))) == (std::vector({(long)0, (long)3})));\n assert(candidate((std::vector({(long)5, (long)4, (long)8, (long)4, (long)8}))) == (std::vector({(long)4, (long)1})));\n assert(candidate((std::vector({(long)7, (long)6, (long)7, (long)1}))) == (std::vector({(long)6, (long)1})));\n assert(candidate((std::vector({(long)7, (long)9, (long)7, (long)1}))) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function count_nums which takes an array of integers and returns\n// the number of elements which has a sum of digits > 0.\n// If a number is negative, then its first signed digit will be negative:\n// e.g. -123 has signed digits -1, 2, and 3.\n// >>> count_nums([]) == 0\n// >>> count_nums([-1, 11, -11]) == 1\n// >>> count_nums([1, 1, 2]) == 3\nlong count_nums(std::vector arr) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = count_nums;\n assert(candidate((std::vector())) == (0));\n assert(candidate((std::vector({(long)-1, (long)-2, (long)0}))) == (0));\n assert(candidate((std::vector({(long)1, (long)1, (long)2, (long)-2, (long)3, (long)4, (long)5}))) == (6));\n assert(candidate((std::vector({(long)1, (long)6, (long)9, (long)-6, (long)0, (long)1, (long)5}))) == (5));\n assert(candidate((std::vector({(long)1, (long)100, (long)98, (long)-7, (long)1, (long)-1}))) == (4));\n assert(candidate((std::vector({(long)12, (long)23, (long)34, (long)-45, (long)-56, (long)0}))) == (5));\n assert(candidate((std::vector({(long)0, (long)1}))) == (1));\n assert(candidate((std::vector({(long)1}))) == (1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "cpp", - "prompt": "#include\n#include\n// Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n// each cell of the grid contains a value. Every integer in the range [1, N * N]\n// inclusive appears exactly once on the cells of the grid.\n// You have to find the minimum path of length k in the grid. You can start\n// from any cell, and in each step you can move to any of the neighbor cells,\n// in other words, you can go to cells which share an edge with you current\n// cell.\n// Please note that a path of length k means visiting exactly k cells (not\n// necessarily distinct).\n// You CANNOT go off the grid.\n// A path A (of length k) is considered less than a path B (of length k) if\n// after making the ordered lists of the values on the cells that A and B go\n// through (let's call them lst_A and lst_B), lst_A is lexicographically less\n// than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n// such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n// lst_A[j] = lst_B[j].\n// It is guaranteed that the answer is unique.\n// Return an ordered list of the values on the cells that the minimum path go through.\n// Examples:\n// Input: grid = [ [1,2,3], [4,5,6], [7,8,9]], k = 3\n// Output: [1, 2, 1]\n// Input: grid = [ [5,9,3], [4,1,6], [7,8,2]], k = 1\n// Output: [1]\nstd::vector minPath(std::vector> grid, long k) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = minPath;\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)2, (long)3}), (std::vector)std::vector({(long)4, (long)5, (long)6}), (std::vector)std::vector({(long)7, (long)8, (long)9})})), (3)) == (std::vector({(long)1, (long)2, (long)1})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)5, (long)9, (long)3}), (std::vector)std::vector({(long)4, (long)1, (long)6}), (std::vector)std::vector({(long)7, (long)8, (long)2})})), (1)) == (std::vector({(long)1})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)2, (long)3, (long)4}), (std::vector)std::vector({(long)5, (long)6, (long)7, (long)8}), (std::vector)std::vector({(long)9, (long)10, (long)11, (long)12}), (std::vector)std::vector({(long)13, (long)14, (long)15, (long)16})})), (4)) == (std::vector({(long)1, (long)2, (long)1, (long)2})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)6, (long)4, (long)13, (long)10}), (std::vector)std::vector({(long)5, (long)7, (long)12, (long)1}), (std::vector)std::vector({(long)3, (long)16, (long)11, (long)15}), (std::vector)std::vector({(long)8, (long)14, (long)9, (long)2})})), (7)) == (std::vector({(long)1, (long)10, (long)1, (long)10, (long)1, (long)10, (long)1})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)8, (long)14, (long)9, (long)2}), (std::vector)std::vector({(long)6, (long)4, (long)13, (long)15}), (std::vector)std::vector({(long)5, (long)7, (long)1, (long)12}), (std::vector)std::vector({(long)3, (long)10, (long)11, (long)16})})), (5)) == (std::vector({(long)1, (long)7, (long)1, (long)7, (long)1})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)11, (long)8, (long)7, (long)2}), (std::vector)std::vector({(long)5, (long)16, (long)14, (long)4}), (std::vector)std::vector({(long)9, (long)3, (long)15, (long)6}), (std::vector)std::vector({(long)12, (long)13, (long)10, (long)1})})), (9)) == (std::vector({(long)1, (long)6, (long)1, (long)6, (long)1, (long)6, (long)1, (long)6, (long)1})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)12, (long)13, (long)10, (long)1}), (std::vector)std::vector({(long)9, (long)3, (long)15, (long)6}), (std::vector)std::vector({(long)5, (long)16, (long)14, (long)4}), (std::vector)std::vector({(long)11, (long)8, (long)7, (long)2})})), (12)) == (std::vector({(long)1, (long)6, (long)1, (long)6, (long)1, (long)6, (long)1, (long)6, (long)1, (long)6, (long)1, (long)6})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)2, (long)7, (long)4}), (std::vector)std::vector({(long)3, (long)1, (long)5}), (std::vector)std::vector({(long)6, (long)8, (long)9})})), (8)) == (std::vector({(long)1, (long)3, (long)1, (long)3, (long)1, (long)3, (long)1, (long)3})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)6, (long)1, (long)5}), (std::vector)std::vector({(long)3, (long)8, (long)9}), (std::vector)std::vector({(long)2, (long)7, (long)4})})), (8)) == (std::vector({(long)1, (long)5, (long)1, (long)5, (long)1, (long)5, (long)1, (long)5})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)2}), (std::vector)std::vector({(long)3, (long)4})})), (10)) == (std::vector({(long)1, (long)2, (long)1, (long)2, (long)1, (long)2, (long)1, (long)2, (long)1, (long)2})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)3}), (std::vector)std::vector({(long)3, (long)2})})), (10)) == (std::vector({(long)1, (long)3, (long)1, (long)3, (long)1, (long)3, (long)1, (long)3, (long)1, (long)3})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "cpp", - "prompt": "#include\n#include\n// Given list of integers, return list in strange order.\n// Strange sorting, is when you start with the minimum value,\n// then maximum of the remaining integers, then minimum and so on.\n// Examples:\n// strange_sort_list([1, 2, 3, 4]) == [1, 4, 2, 3]\n// strange_sort_list([5, 5, 5, 5]) == [5, 5, 5, 5]\n// strange_sort_list([]) == []\nstd::vector strange_sort_list(std::vector lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = strange_sort_list;\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4}))) == (std::vector({(long)1, (long)4, (long)2, (long)3})));\n assert(candidate((std::vector({(long)5, (long)6, (long)7, (long)8, (long)9}))) == (std::vector({(long)5, (long)9, (long)6, (long)8, (long)7})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5}))) == (std::vector({(long)1, (long)5, (long)2, (long)4, (long)3})));\n assert(candidate((std::vector({(long)5, (long)6, (long)7, (long)8, (long)9, (long)1}))) == (std::vector({(long)1, (long)9, (long)5, (long)8, (long)6, (long)7})));\n assert(candidate((std::vector({(long)5, (long)5, (long)5, (long)5}))) == (std::vector({(long)5, (long)5, (long)5, (long)5})));\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6, (long)7, (long)8}))) == (std::vector({(long)1, (long)8, (long)2, (long)7, (long)3, (long)6, (long)4, (long)5})));\n assert(candidate((std::vector({(long)0, (long)2, (long)2, (long)2, (long)5, (long)5, (long)-5, (long)-5}))) == (std::vector({(long)-5, (long)5, (long)-5, (long)5, (long)0, (long)2, (long)2, (long)2})));\n assert(candidate((std::vector({(long)111111}))) == (std::vector({(long)111111})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "cpp", - "prompt": "#include\n#include\n// Given a string 'text', return its md5 hash equivalent string.\n// If 'text' is an empty string, return None.\n// >>> string_to_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'\nstd::optional string_to_md5(std::string text) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = string_to_md5;\n assert(candidate((\"Hello world\")) == \"3e25960a79dbc69b674cd4ec67a72c62\");\n assert(candidate((\"\")) == std::nullopt);\n assert(candidate((\"A B C\")) == \"0ef78513b0cb8cef12743f5aeb35f888\");\n assert(candidate((\"password\")) == \"5f4dcc3b5aa765d61d8327deb882cf99\");\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a word. Your task is to find the closest vowel that stands between \n// two consonants from the right side of the word (case sensitive).\n// Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n// find any vowel met the above condition. \n// You may assume that the given string contains English letter only.\n// Example:\n// get_closest_vowel(\"yogurt\") ==> \"u\"\n// get_closest_vowel(\"FULL\") ==> \"U\"\n// get_closest_vowel(\"quick\") ==> \"\"\n// get_closest_vowel(\"ab\") ==> \"\"\nstd::string get_closest_vowel(std::string word) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = get_closest_vowel;\n assert(candidate((\"yogurt\")) == (\"u\"));\n assert(candidate((\"full\")) == (\"u\"));\n assert(candidate((\"easy\")) == (\"\"));\n assert(candidate((\"eAsy\")) == (\"\"));\n assert(candidate((\"ali\")) == (\"\"));\n assert(candidate((\"bad\")) == (\"a\"));\n assert(candidate((\"most\")) == (\"o\"));\n assert(candidate((\"ab\")) == (\"\"));\n assert(candidate((\"ba\")) == (\"\"));\n assert(candidate((\"quick\")) == (\"\"));\n assert(candidate((\"anime\")) == (\"i\"));\n assert(candidate((\"Asia\")) == (\"\"));\n assert(candidate((\"Above\")) == (\"o\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "cpp", - "prompt": "#include\n#include\n// Change numerical base of input number x to base.\n// return string representation after the conversion.\n// base numbers are less than 10.\n// >>> change_base(8, 3)\n// '22'\n// >>> change_base(8, 2)\n// '1000'\n// >>> change_base(7, 2)\n// '111'\nstd::string change_base(long x, long base) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = change_base;\n assert(candidate((8), (3)) == (\"22\"));\n assert(candidate((9), (3)) == (\"100\"));\n assert(candidate((234), (2)) == (\"11101010\"));\n assert(candidate((16), (2)) == (\"10000\"));\n assert(candidate((8), (2)) == (\"1000\"));\n assert(candidate((7), (2)) == (\"111\"));\n assert(candidate((2), (3)) == (\"2\"));\n assert(candidate((3), (4)) == (\"3\"));\n assert(candidate((4), (5)) == (\"4\"));\n assert(candidate((5), (6)) == (\"5\"));\n assert(candidate((6), (7)) == (\"6\"));\n assert(candidate((7), (8)) == (\"7\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "cpp", - "prompt": "#include\n#include\n// Check if in given list of numbers, are any two numbers closer to each other than\n// given threshold.\n// >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n// False\n// >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n// True\nbool has_close_elements(std::vector numbers, float threshold) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = has_close_elements;\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.9, (float)4.0, (float)5.0, (float)2.2})), (0.3)) == (true));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.9, (float)4.0, (float)5.0, (float)2.2})), (0.05)) == (false));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)5.9, (float)4.0, (float)5.0})), (0.95)) == (true));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)5.9, (float)4.0, (float)5.0})), (0.8)) == (false));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0, (float)5.0, (float)2.0})), (0.1)) == (true));\n assert(candidate((std::vector({(float)1.1, (float)2.2, (float)3.1, (float)4.1, (float)5.1})), (1.0)) == (true));\n assert(candidate((std::vector({(float)1.1, (float)2.2, (float)3.1, (float)4.1, (float)5.1})), (0.5)) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function that takes a string as input which contains only square brackets.\n// The function should return True if and only if there is a valid subsequence of brackets \n// where at least one bracket in the subsequence is nested.\n// is_nested('[[]]') \u279e True\n// is_nested('[]]]]]]][[[[[]') \u279e False\n// is_nested('[][]') \u279e False\n// is_nested('[]') \u279e False\n// is_nested('[[][]]') \u279e True\n// is_nested('[[]][[') \u279e True\nbool is_nested(std::string string) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = is_nested;\n assert(candidate((\"[[]]\")) == (true));\n assert(candidate((\"[]]]]]]][[[[[]\")) == (false));\n assert(candidate((\"[][]\")) == (false));\n assert(candidate((\"[]\")) == (false));\n assert(candidate((\"[[[[]]]]\")) == (true));\n assert(candidate((\"[]]]]]]]]]]\")) == (false));\n assert(candidate((\"[][][[]]\")) == (true));\n assert(candidate((\"[[]\")) == (false));\n assert(candidate((\"[]]\")) == (false));\n assert(candidate((\"[[]][[\")) == (true));\n assert(candidate((\"[[][]]\")) == (true));\n assert(candidate((\"\")) == (false));\n assert(candidate((\"[[[[[[[[\")) == (false));\n assert(candidate((\"]]]]]]]]\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "cpp", - "prompt": "#include\n#include\n// Concatenate list of strings into a single string\n// >>> concatenate([])\n// ''\n// >>> concatenate(['a', 'b', 'c'])\n// 'abc'\nstd::string concatenate(std::vector strings) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = concatenate;\n assert(candidate((std::vector())) == (\"\"));\n assert(candidate((std::vector({(std::string)\"x\", (std::string)\"y\", (std::string)\"z\"}))) == (\"xyz\"));\n assert(candidate((std::vector({(std::string)\"x\", (std::string)\"y\", (std::string)\"z\", (std::string)\"w\", (std::string)\"k\"}))) == (\"xyzwk\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "cpp", - "prompt": "#include\n#include\n// prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n// >>> prime_fib(1)\n// 2\n// >>> prime_fib(2)\n// 3\n// >>> prime_fib(3)\n// 5\n// >>> prime_fib(4)\n// 13\n// >>> prime_fib(5)\n// 89\nlong prime_fib(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = prime_fib;\n assert(candidate((1)) == (2));\n assert(candidate((2)) == (3));\n assert(candidate((3)) == (5));\n assert(candidate((4)) == (13));\n assert(candidate((5)) == (89));\n assert(candidate((6)) == (233));\n assert(candidate((7)) == (1597));\n assert(candidate((8)) == (28657));\n assert(candidate((9)) == (514229));\n assert(candidate((10)) == (433494437));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "cpp", - "prompt": "#include\n#include\n// From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n// other and return them in order (smaller number, larger number).\n// >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n// (2.0, 2.2)\n// >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n// (2.0, 2.0)\nstd::tuple find_closest_elements(std::vector numbers) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = find_closest_elements;\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.9, (float)4.0, (float)5.0, (float)2.2}))) == (std::make_tuple(3.9, 4.0)));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)5.9, (float)4.0, (float)5.0}))) == (std::make_tuple(5.0, 5.9)));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0, (float)5.0, (float)2.2}))) == (std::make_tuple(2.0, 2.2)));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0, (float)5.0, (float)2.0}))) == (std::make_tuple(2.0, 2.0)));\n assert(candidate((std::vector({(float)1.1, (float)2.2, (float)3.1, (float)4.1, (float)5.1}))) == (std::make_tuple(2.2, 3.1)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "cpp", - "prompt": "#include\n#include\n// You have been tasked to write a function that receives \n// a hexadecimal number as a string and counts the number of hexadecimal \n// digits that are primes (prime number, or a prime, is a natural number \n// greater than 1 that is not a product of two smaller natural numbers).\n// Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n// Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n// So you have to determine a number of the following digits: 2, 3, 5, 7, \n// B (=decimal 11), D (=decimal 13).\n// Note: you may assume the input is always correct or empty string, \n// and symbols A,B,C,D,E,F are always uppercase.\n// Examples:\n// For num = \"AB\" the output should be 1.\n// For num = \"1077E\" the output should be 2.\n// For num = \"ABED1A33\" the output should be 4.\n// For num = \"123456789ABCDEF0\" the output should be 6.\n// For num = \"2020\" the output should be 2.\nlong hex_key(std::string num) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = hex_key;\n assert(candidate((\"AB\")) == (1));\n assert(candidate((\"1077E\")) == (2));\n assert(candidate((\"ABED1A33\")) == (4));\n assert(candidate((\"2020\")) == (2));\n assert(candidate((\"123456789ABCDEF0\")) == (6));\n assert(candidate((\"112233445566778899AABBCCDDEEFF00\")) == (12));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "cpp", - "prompt": "#include\n#include\n// Complete the function that takes two integers and returns \n// the product of their unit digits.\n// Assume the input is always valid.\n// Examples:\n// multiply(148, 412) should return 16.\n// multiply(19, 28) should return 72.\n// multiply(2020, 1851) should return 0.\n// multiply(14,-15) should return 20.\nlong multiply(long a, long b) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = multiply;\n assert(candidate((148), (412)) == (16));\n assert(candidate((19), (28)) == (72));\n assert(candidate((2020), (1851)) == (0));\n assert(candidate((14), (-15)) == (20));\n assert(candidate((76), (67)) == (42));\n assert(candidate((17), (27)) == (49));\n assert(candidate((0), (1)) == (0));\n assert(candidate((0), (0)) == (0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "cpp", - "prompt": "#include\n#include\n// Given list of numbers (of at least two elements), apply a linear transform to that list,\n// such that the smallest number will become 0 and the largest will become 1\n// >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n// [0.0, 0.25, 0.5, 0.75, 1.0]\nstd::vector rescale_to_unit(std::vector numbers) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = rescale_to_unit;\n assert(candidate((std::vector({(float)2.0, (float)49.9}))) == (std::vector({(float)0.0, (float)1.0})));\n assert(candidate((std::vector({(float)100.0, (float)49.9}))) == (std::vector({(float)1.0, (float)0.0})));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0, (float)5.0}))) == (std::vector({(float)0.0, (float)0.25, (float)0.5, (float)0.75, (float)1.0})));\n assert(candidate((std::vector({(float)2.0, (float)1.0, (float)5.0, (float)3.0, (float)4.0}))) == (std::vector({(float)0.25, (float)0.0, (float)1.0, (float)0.5, (float)0.75})));\n assert(candidate((std::vector({(float)12.0, (float)11.0, (float)15.0, (float)13.0, (float)14.0}))) == (std::vector({(float)0.25, (float)0.0, (float)1.0, (float)0.5, (float)0.75})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "cpp", - "prompt": "#include\n#include\n// Given a positive integer n, return the product of the odd digits.\n// Return 0 if all digits are even.\n// For example:\n// digits(1) == 1\n// digits(4) == 0\n// digits(235) == 15\nlong digits(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = digits;\n assert(candidate((5)) == (5));\n assert(candidate((54)) == (5));\n assert(candidate((120)) == (1));\n assert(candidate((5014)) == (5));\n assert(candidate((98765)) == (315));\n assert(candidate((5576543)) == (2625));\n assert(candidate((2468)) == (0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "cpp", - "prompt": "#include\n#include\n// You will be given the name of a class (a string) and a list of extensions.\n// The extensions are to be used to load additional classes to the class. The\n// strength of the extension is as follows: Let CAP be the number of the uppercase\n// letters in the extension's name, and let SM be the number of lowercase letters \n// in the extension's name, the strength is given by the fraction CAP - SM. \n// You should find the strongest extension and return a string in this \n// format: ClassName.StrongestExtensionName.\n// If there are two or more extensions with the same strength, you should\n// choose the one that comes first in the list.\n// For example, if you are given \"Slices\" as the class and a list of the\n// extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n// return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n// (its strength is -1).\n// Example:\n// for Strongest_Extension('my_class', ['AA', 'Be', 'CC']) == 'my_class.AA'\nstd::string Strongest_Extension(std::string class_name, std::vector extensions) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = Strongest_Extension;\n assert(candidate((\"Watashi\"), (std::vector({(std::string)\"tEN\", (std::string)\"niNE\", (std::string)\"eIGHt8OKe\"}))) == (\"Watashi.eIGHt8OKe\"));\n assert(candidate((\"Boku123\"), (std::vector({(std::string)\"nani\", (std::string)\"NazeDa\", (std::string)\"YEs.WeCaNe\", (std::string)\"32145tggg\"}))) == (\"Boku123.YEs.WeCaNe\"));\n assert(candidate((\"__YESIMHERE\"), (std::vector({(std::string)\"t\", (std::string)\"eMptY\", (std::string)\"nothing\", (std::string)\"zeR00\", (std::string)\"NuLl__\", (std::string)\"123NoooneB321\"}))) == (\"__YESIMHERE.NuLl__\"));\n assert(candidate((\"K\"), (std::vector({(std::string)\"Ta\", (std::string)\"TAR\", (std::string)\"t234An\", (std::string)\"cosSo\"}))) == (\"K.TAR\"));\n assert(candidate((\"__HAHA\"), (std::vector({(std::string)\"Tab\", (std::string)\"123\", (std::string)\"781345\", (std::string)\"-_-\"}))) == (\"__HAHA.123\"));\n assert(candidate((\"YameRore\"), (std::vector({(std::string)\"HhAas\", (std::string)\"okIWILL123\", (std::string)\"WorkOut\", (std::string)\"Fails\", (std::string)\"-_-\"}))) == (\"YameRore.okIWILL123\"));\n assert(candidate((\"finNNalLLly\"), (std::vector({(std::string)\"Die\", (std::string)\"NowW\", (std::string)\"Wow\", (std::string)\"WoW\"}))) == (\"finNNalLLly.WoW\"));\n assert(candidate((\"_\"), (std::vector({(std::string)\"Bb\", (std::string)\"91245\"}))) == (\"_.Bb\"));\n assert(candidate((\"Sp\"), (std::vector({(std::string)\"671235\", (std::string)\"Bb\"}))) == (\"Sp.671235\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "cpp", - "prompt": "#include\n#include\n// Given a string representing a space separated lowercase letters, return a dictionary\n// of the letter with the most repetition and containing the corresponding count.\n// If several letters have the same occurrence, return all of them.\n// Example:\n// histogram('a b c') == {'a': 1, 'b': 1, 'c': 1}\n// histogram('a b b a') == {'a': 2, 'b': 2}\n// histogram('a b c a b') == {'a': 2, 'b': 2}\n// histogram('b b b b a') == {'b': 4}\n// histogram('') == {}\nstd::map histogram(std::string test) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = histogram;\n assert(candidate((\"a b b a\")) == (std::map({{\"a\", 2}, {\"b\", 2}})));\n assert(candidate((\"a b c a b\")) == (std::map({{\"a\", 2}, {\"b\", 2}})));\n assert(candidate((\"a b c d g\")) == (std::map({{\"a\", 1}, {\"b\", 1}, {\"c\", 1}, {\"d\", 1}, {\"g\", 1}})));\n assert(candidate((\"r t g\")) == (std::map({{\"r\", 1}, {\"t\", 1}, {\"g\", 1}})));\n assert(candidate((\"b b b b a\")) == (std::map({{\"b\", 4}})));\n assert(candidate((\"r t g\")) == (std::map({{\"r\", 1}, {\"t\", 1}, {\"g\", 1}})));\n assert(candidate((\"\")) == (std::map()));\n assert(candidate((\"a\")) == (std::map({{\"a\", 1}})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "cpp", - "prompt": "#include\n#include\n// pairs_sum_to_zero takes a list of integers as an input.\n// it returns True if there are two distinct elements in the list that\n// sum to zero, and False otherwise.\n// >>> pairs_sum_to_zero([1, 3, 5, 0])\n// False\n// >>> pairs_sum_to_zero([1, 3, -2, 1])\n// False\n// >>> pairs_sum_to_zero([1, 2, 3, 7])\n// False\n// >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7])\n// True\n// >>> pairs_sum_to_zero([1])\n// False\nbool pairs_sum_to_zero(std::vector l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = pairs_sum_to_zero;\n assert(candidate((std::vector({(long)1, (long)3, (long)5, (long)0}))) == (false));\n assert(candidate((std::vector({(long)1, (long)3, (long)-2, (long)1}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)7}))) == (false));\n assert(candidate((std::vector({(long)2, (long)4, (long)-5, (long)3, (long)5, (long)7}))) == (true));\n assert(candidate((std::vector({(long)1}))) == (false));\n assert(candidate((std::vector({(long)-3, (long)9, (long)-1, (long)3, (long)2, (long)30}))) == (true));\n assert(candidate((std::vector({(long)-3, (long)9, (long)-1, (long)3, (long)2, (long)31}))) == (true));\n assert(candidate((std::vector({(long)-3, (long)9, (long)-1, (long)4, (long)2, (long)30}))) == (false));\n assert(candidate((std::vector({(long)-3, (long)9, (long)-1, (long)4, (long)2, (long)31}))) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that accepts two lists of strings and returns the list that has \n// total number of chars in the all strings of the list less than the other list.\n// if the two lists have the same number of chars, return the first list.\n// Examples\n// total_match([], []) \u279e []\n// total_match(['hi', 'admin'], ['hI', 'Hi']) \u279e ['hI', 'Hi']\n// total_match(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) \u279e ['hi', 'admin']\n// total_match(['hi', 'admin'], ['hI', 'hi', 'hi']) \u279e ['hI', 'hi', 'hi']\n// total_match(['4'], ['1', '2', '3', '4', '5']) \u279e ['4']\nstd::vector total_match(std::vector lst1, std::vector lst2) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = total_match;\n assert(candidate((std::vector()), (std::vector())) == (std::vector()));\n assert(candidate((std::vector({(std::string)\"hi\", (std::string)\"admin\"})), (std::vector({(std::string)\"hi\", (std::string)\"hi\"}))) == (std::vector({(std::string)\"hi\", (std::string)\"hi\"})));\n assert(candidate((std::vector({(std::string)\"hi\", (std::string)\"admin\"})), (std::vector({(std::string)\"hi\", (std::string)\"hi\", (std::string)\"admin\", (std::string)\"project\"}))) == (std::vector({(std::string)\"hi\", (std::string)\"admin\"})));\n assert(candidate((std::vector({(std::string)\"4\"})), (std::vector({(std::string)\"1\", (std::string)\"2\", (std::string)\"3\", (std::string)\"4\", (std::string)\"5\"}))) == (std::vector({(std::string)\"4\"})));\n assert(candidate((std::vector({(std::string)\"hi\", (std::string)\"admin\"})), (std::vector({(std::string)\"hI\", (std::string)\"Hi\"}))) == (std::vector({(std::string)\"hI\", (std::string)\"Hi\"})));\n assert(candidate((std::vector({(std::string)\"hi\", (std::string)\"admin\"})), (std::vector({(std::string)\"hI\", (std::string)\"hi\", (std::string)\"hi\"}))) == (std::vector({(std::string)\"hI\", (std::string)\"hi\", (std::string)\"hi\"})));\n assert(candidate((std::vector({(std::string)\"hi\", (std::string)\"admin\"})), (std::vector({(std::string)\"hI\", (std::string)\"hi\", (std::string)\"hii\"}))) == (std::vector({(std::string)\"hi\", (std::string)\"admin\"})));\n assert(candidate((std::vector()), (std::vector({(std::string)\"this\"}))) == (std::vector()));\n assert(candidate((std::vector({(std::string)\"this\"})), (std::vector())) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "cpp", - "prompt": "#include\n#include\n// Circular shift the digits of the integer x, shift the digits right by shift\n// and return the result as a string.\n// If shift > number of digits, return digits reversed.\n// >>> circular_shift(12, 1)\n// \"21\"\n// >>> circular_shift(12, 2)\n// \"12\"\nstd::string circular_shift(long x, long shift) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = circular_shift;\n assert(candidate((100), (2)) == (\"001\"));\n assert(candidate((12), (2)) == (\"12\"));\n assert(candidate((97), (8)) == (\"79\"));\n assert(candidate((12), (1)) == (\"21\"));\n assert(candidate((11), (101)) == (\"11\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "cpp", - "prompt": "#include\n#include\n// Return True is list elements are monotonically increasing or decreasing.\n// >>> monotonic([1, 2, 4, 20])\n// True\n// >>> monotonic([1, 20, 4, 10])\n// False\n// >>> monotonic([4, 1, 0, -10])\n// True\nbool monotonic(std::vector l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = monotonic;\n assert(candidate((std::vector({(long)1, (long)2, (long)4, (long)10}))) == (true));\n assert(candidate((std::vector({(long)1, (long)2, (long)4, (long)20}))) == (true));\n assert(candidate((std::vector({(long)1, (long)20, (long)4, (long)10}))) == (false));\n assert(candidate((std::vector({(long)4, (long)1, (long)0, (long)-10}))) == (true));\n assert(candidate((std::vector({(long)4, (long)1, (long)1, (long)0}))) == (true));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)2, (long)5, (long)60}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)60}))) == (true));\n assert(candidate((std::vector({(long)9, (long)9, (long)9, (long)9}))) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "cpp", - "prompt": "#include\n#include\n// Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n// Example\n// is_equal_to_sum_even(4) == False\n// is_equal_to_sum_even(6) == False\n// is_equal_to_sum_even(8) == True\nbool is_equal_to_sum_even(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = is_equal_to_sum_even;\n assert(candidate((4)) == (false));\n assert(candidate((6)) == (false));\n assert(candidate((8)) == (true));\n assert(candidate((10)) == (true));\n assert(candidate((11)) == (false));\n assert(candidate((12)) == (true));\n assert(candidate((13)) == (false));\n assert(candidate((16)) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "cpp", - "prompt": "#include\n#include\n// Input to this function is a string representing musical notes in a special ASCII format.\n// Your task is to parse this string and return list of integers corresponding to how many beats does each\n// not last.\n// Here is a legend:\n// 'o' - whole note, lasts four beats\n// 'o|' - half note, lasts two beats\n// '.|' - quater note, lasts one beat\n// >>> parse_music('o o| .| o| o| .| .| .| .| o o')\n// [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\nstd::vector parse_music(std::string music_string) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = parse_music;\n assert(candidate((\"\")) == (std::vector()));\n assert(candidate((\"o o o o\")) == (std::vector({(long)4, (long)4, (long)4, (long)4})));\n assert(candidate((\".| .| .| .|\")) == (std::vector({(long)1, (long)1, (long)1, (long)1})));\n assert(candidate((\"o| o| .| .| o o o o\")) == (std::vector({(long)2, (long)2, (long)1, (long)1, (long)4, (long)4, (long)4, (long)4})));\n assert(candidate((\"o| .| o| .| o o| o o|\")) == (std::vector({(long)2, (long)1, (long)2, (long)1, (long)4, (long)2, (long)4, (long)2})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "cpp", - "prompt": "#include\n#include\n// \"\n// This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n// multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n// change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n// Examples:\n// For lst = [1,2,3] the output should be 6\n// For lst = [] the output should be 0\n// For lst = [-1,-5,2,-1,-5] the output should be -126\nlong sum_squares(std::vector lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = sum_squares;\n assert(candidate((std::vector({(long)1, (long)2, (long)3}))) == (6));\n assert(candidate((std::vector({(long)1, (long)4, (long)9}))) == (14));\n assert(candidate((std::vector())) == (0));\n assert(candidate((std::vector({(long)1, (long)1, (long)1, (long)1, (long)1, (long)1, (long)1, (long)1, (long)1}))) == (9));\n assert(candidate((std::vector({(long)-1, (long)-1, (long)-1, (long)-1, (long)-1, (long)-1, (long)-1, (long)-1, (long)-1}))) == (-3));\n assert(candidate((std::vector({(long)0}))) == (0));\n assert(candidate((std::vector({(long)-1, (long)-5, (long)2, (long)-1, (long)-5}))) == (-126));\n assert(candidate((std::vector({(long)-56, (long)-99, (long)1, (long)0, (long)-2}))) == (3030));\n assert(candidate((std::vector({(long)-1, (long)0, (long)0, (long)0, (long)0, (long)0, (long)0, (long)0, (long)-1}))) == (0));\n assert(candidate((std::vector({(long)-16, (long)-9, (long)-2, (long)36, (long)36, (long)26, (long)-20, (long)25, (long)-40, (long)20, (long)-4, (long)12, (long)-26, (long)35, (long)37}))) == (-14196));\n assert(candidate((std::vector({(long)-1, (long)-3, (long)17, (long)-1, (long)-15, (long)13, (long)-1, (long)14, (long)-14, (long)-12, (long)-5, (long)14, (long)-14, (long)6, (long)13, (long)11, (long)16, (long)16, (long)4, (long)10}))) == (-1448));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "cpp", - "prompt": "#include\n#include\n// triples_sum_to_zero takes a list of integers as an input.\n// it returns True if there are three distinct elements in the list that\n// sum to zero, and False otherwise.\n// >>> triples_sum_to_zero([1, 3, 5, 0])\n// False\n// >>> triples_sum_to_zero([1, 3, -2, 1])\n// True\n// >>> triples_sum_to_zero([1, 2, 3, 7])\n// False\n// >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n// True\n// >>> triples_sum_to_zero([1])\n// False\nbool triples_sum_to_zero(std::vector l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = triples_sum_to_zero;\n assert(candidate((std::vector({(long)1, (long)3, (long)5, (long)0}))) == (false));\n assert(candidate((std::vector({(long)1, (long)3, (long)5, (long)-1}))) == (false));\n assert(candidate((std::vector({(long)1, (long)3, (long)-2, (long)1}))) == (true));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)7}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)5, (long)7}))) == (false));\n assert(candidate((std::vector({(long)2, (long)4, (long)-5, (long)3, (long)9, (long)7}))) == (true));\n assert(candidate((std::vector({(long)1}))) == (false));\n assert(candidate((std::vector({(long)1, (long)3, (long)5, (long)-100}))) == (false));\n assert(candidate((std::vector({(long)100, (long)3, (long)5, (long)-100}))) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "cpp", - "prompt": "#include\n#include\n// brackets is a string of \"<\" and \">\".\n// return True if every opening bracket has a corresponding closing bracket.\n// >>> correct_bracketing(\"<\")\n// False\n// >>> correct_bracketing(\"<>\")\n// True\n// >>> correct_bracketing(\"<<><>>\")\n// True\n// >>> correct_bracketing(\"><<>\")\n// False\nbool correct_bracketing(std::string brackets) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = correct_bracketing;\n assert(candidate((\"<>\")) == (true));\n assert(candidate((\"<<><>>\")) == (true));\n assert(candidate((\"<><><<><>><>\")) == (true));\n assert(candidate((\"<><><<<><><>><>><<><><<>>>\")) == (true));\n assert(candidate((\"<<<><>>>>\")) == (false));\n assert(candidate((\"><<>\")) == (false));\n assert(candidate((\"<\")) == (false));\n assert(candidate((\"<<<<\")) == (false));\n assert(candidate((\">\")) == (false));\n assert(candidate((\"<<>\")) == (false));\n assert(candidate((\"<><><<><>><>><<>\")) == (false));\n assert(candidate((\"<><><<><>><>>><>\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that takes an array of numbers as input and returns \n// the number of elements in the array that are greater than 10 and both \n// first and last digits of a number are odd (1, 3, 5, 7, 9).\n// For example:\n// specialFilter([15, -73, 14, -15]) => 1 \n// specialFilter([33, -2, -3, 45, 21, 109]) => 2\nlong specialFilter(std::vector nums) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = specialFilter;\n assert(candidate((std::vector({(long)5, (long)-2, (long)1, (long)-5}))) == (0));\n assert(candidate((std::vector({(long)15, (long)-73, (long)14, (long)-15}))) == (1));\n assert(candidate((std::vector({(long)33, (long)-2, (long)-3, (long)45, (long)21, (long)109}))) == (2));\n assert(candidate((std::vector({(long)43, (long)-12, (long)93, (long)125, (long)121, (long)109}))) == (4));\n assert(candidate((std::vector({(long)71, (long)-2, (long)-33, (long)75, (long)21, (long)19}))) == (3));\n assert(candidate((std::vector({(long)1}))) == (0));\n assert(candidate((std::vector())) == (0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "cpp", - "prompt": "#include\n#include\n// Given a dictionary, return True if all keys are strings in lower \n// case or all keys are strings in upper case, else return False.\n// The function should return False is the given dictionary is empty.\n// Examples:\n// check_dict_case({\"a\":\"apple\", \"b\":\"banana\"}) should return True.\n// check_dict_case({\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}) should return False.\n// check_dict_case({\"a\":\"apple\", \"8\":\"banana\", \"a\":\"apple\"}) should return False.\n// check_dict_case({\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}) should return False.\n// check_dict_case({\"STATE\":\"NC\", \"ZIP\":\"12345\" }) should return True.\nbool check_dict_case(std::map dict) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = check_dict_case;\n assert(candidate((std::map({{\"p\", \"pineapple\"}, {\"b\", \"banana\"}}))) == (true));\n assert(candidate((std::map({{\"p\", \"pineapple\"}, {\"A\", \"banana\"}, {\"B\", \"banana\"}}))) == (false));\n assert(candidate((std::map({{\"p\", \"pineapple\"}, {\"5\", \"banana\"}, {\"a\", \"apple\"}}))) == (false));\n assert(candidate((std::map({{\"Name\", \"John\"}, {\"Age\", \"36\"}, {\"City\", \"Houston\"}}))) == (false));\n assert(candidate((std::map({{\"STATE\", \"NC\"}, {\"ZIP\", \"12345\"}}))) == (true));\n assert(candidate((std::map({{\"fruit\", \"Orange\"}, {\"taste\", \"Sweet\"}}))) == (true));\n assert(candidate((std::map())) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "cpp", - "prompt": "#include\n#include\nunion Union_std_vector_std_string__long{\n std::vector f0;\n long f1; Union_std_vector_std_string__long(std::vector _f0) : f0(_f0) {}\n Union_std_vector_std_string__long(long _f1) : f1(_f1) {}\n ~Union_std_vector_std_string__long() {}\n bool operator==(std::vector f) {\n return f0 == f ;\n } bool operator==(long f) {\n return f1 == f ;\n }\n};\n// Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n// should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n// alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n// Examples\n// split_words(\"Hello world!\") \u279e [\"Hello\", \"world!\"]\n// split_words(\"Hello,world!\") \u279e [\"Hello\", \"world!\"]\n// split_words(\"abcdef\") == 3\nUnion_std_vector_std_string__long split_words(std::string txt) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = split_words;\n assert(candidate((\"Hello world!\")) == std::vector({(std::string)\"Hello\", (std::string)\"world!\"}));\n assert(candidate((\"Hello,world!\")) == std::vector({(std::string)\"Hello\", (std::string)\"world!\"}));\n assert(candidate((\"Hello world,!\")) == std::vector({(std::string)\"Hello\", (std::string)\"world,!\"}));\n assert(candidate((\"Hello,Hello,world !\")) == std::vector({(std::string)\"Hello,Hello,world\", (std::string)\"!\"}));\n assert(candidate((\"abcdef\")) == 3);\n assert(candidate((\"aaabb\")) == 2);\n assert(candidate((\"aaaBb\")) == 1);\n assert(candidate((\"\")) == 0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "cpp", - "prompt": "#include\n#include\n// The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fibfib(0) == 0\n// fibfib(1) == 0\n// fibfib(2) == 1\n// fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n// Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n// >>> fibfib(1)\n// 0\n// >>> fibfib(5)\n// 4\n// >>> fibfib(8)\n// 24\nlong fibfib(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = fibfib;\n assert(candidate((2)) == (1));\n assert(candidate((1)) == (0));\n assert(candidate((5)) == (4));\n assert(candidate((8)) == (24));\n assert(candidate((10)) == (81));\n assert(candidate((12)) == (274));\n assert(candidate((14)) == (927));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a list of numbers.\n// You need to return the sum of squared numbers in the given list,\n// round each element in the list to the upper int(Ceiling) first.\n// Examples:\n// For lst = [1,2,3] the output should be 14\n// For lst = [1,4,9] the output should be 98\n// For lst = [1,3,5,7] the output should be 84\n// For lst = [1.4,4.2,0] the output should be 29\n// For lst = [-2.4,1,1] the output should be 6\nlong sum_squares(std::vector lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = sum_squares;\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0}))) == (14));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0}))) == (14));\n assert(candidate((std::vector({(float)1.0, (float)3.0, (float)5.0, (float)7.0}))) == (84));\n assert(candidate((std::vector({(float)1.4, (float)4.2, (float)0.0}))) == (29));\n assert(candidate((std::vector({(float)-2.4, (float)1.0, (float)1.0}))) == (6));\n assert(candidate((std::vector({(float)100.0, (float)1.0, (float)15.0, (float)2.0}))) == (10230));\n assert(candidate((std::vector({(float)10000.0, (float)10000.0}))) == (200000000));\n assert(candidate((std::vector({(float)-1.4, (float)4.6, (float)6.3}))) == (75));\n assert(candidate((std::vector({(float)-1.4, (float)17.9, (float)18.9, (float)19.9}))) == (1086));\n assert(candidate((std::vector({(float)0.0}))) == (0));\n assert(candidate((std::vector({(float)-1.0}))) == (1));\n assert(candidate((std::vector({(float)-1.0, (float)1.0, (float)0.0}))) == (2));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_85_add", - "language": "cpp", - "prompt": "#include\n#include\n// Given a non-empty list of integers lst. add the even elements that are at odd indices..\n// Examples:\n// add([4, 2, 6, 7]) ==> 2\nlong add(std::vector lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = add;\n assert(candidate((std::vector({(long)4, (long)88}))) == (88));\n assert(candidate((std::vector({(long)4, (long)5, (long)6, (long)7, (long)2, (long)122}))) == (122));\n assert(candidate((std::vector({(long)4, (long)0, (long)6, (long)7}))) == (0));\n assert(candidate((std::vector({(long)4, (long)4, (long)6, (long)8}))) == (12));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "cpp", - "prompt": "#include\n#include\n// Return sorted unique elements in a list\n// >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123])\n// [0, 2, 3, 5, 9, 123]\nstd::vector unique(std::vector l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = unique;\n assert(candidate((std::vector({(long)5, (long)3, (long)5, (long)2, (long)3, (long)3, (long)9, (long)0, (long)123}))) == (std::vector({(long)0, (long)2, (long)3, (long)5, (long)9, (long)123})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "cpp", - "prompt": "#include\n#include\n// Given a string text, replace all spaces in it with underscores, \n// and if a string has more than 2 consecutive spaces, \n// then replace all consecutive spaces with - \n// fix_spaces(\"Example\") == \"Example\"\n// fix_spaces(\"Example 1\") == \"Example_1\"\n// fix_spaces(\" Example 2\") == \"_Example_2\"\n// fix_spaces(\" Example 3\") == \"_Example-3\"\nstd::string fix_spaces(std::string text) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = fix_spaces;\n assert(candidate((\"Example\")) == (\"Example\"));\n assert(candidate((\"Mudasir Hanif \")) == (\"Mudasir_Hanif_\"));\n assert(candidate((\"Yellow Yellow Dirty Fellow\")) == (\"Yellow_Yellow__Dirty__Fellow\"));\n assert(candidate((\"Exa mple\")) == (\"Exa-mple\"));\n assert(candidate((\" Exa 1 2 2 mple\")) == (\"-Exa_1_2_2_mple\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "cpp", - "prompt": "#include\n#include\n// Return 2^n modulo p (be aware of numerics).\n// >>> modp(3, 5)\n// 3\n// >>> modp(1101, 101)\n// 2\n// >>> modp(0, 101)\n// 1\n// >>> modp(3, 11)\n// 8\n// >>> modp(100, 101)\n// 1\nlong modp(long n, long p) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = modp;\n assert(candidate((3), (5)) == (3));\n assert(candidate((1101), (101)) == (2));\n assert(candidate((0), (101)) == (1));\n assert(candidate((3), (11)) == (8));\n assert(candidate((100), (101)) == (1));\n assert(candidate((30), (5)) == (4));\n assert(candidate((31), (5)) == (3));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "cpp", - "prompt": "#include\n#include\n// You have to write a function which validates a given date string and\n// returns True if the date is valid otherwise False.\n// The date is valid if all of the following rules are satisfied:\n// 1. The date string is not empty.\n// 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n// 3. The months should not be less than 1 or higher than 12.\n// 4. The date should be in the format: mm-dd-yyyy\n// for example: \n// valid_date('03-11-2000') => True\n// valid_date('15-01-2012') => False\n// valid_date('04-0-2040') => False\n// valid_date('06-04-2020') => True\n// valid_date('06/04/2020') => False\nbool valid_date(std::string date) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = valid_date;\n assert(candidate((\"03-11-2000\")) == (true));\n assert(candidate((\"15-01-2012\")) == (false));\n assert(candidate((\"04-0-2040\")) == (false));\n assert(candidate((\"06-04-2020\")) == (true));\n assert(candidate((\"01-01-2007\")) == (true));\n assert(candidate((\"03-32-2011\")) == (false));\n assert(candidate((\"\")) == (false));\n assert(candidate((\"04-31-3000\")) == (false));\n assert(candidate((\"06-06-2005\")) == (true));\n assert(candidate((\"21-31-2000\")) == (false));\n assert(candidate((\"04-12-2003\")) == (true));\n assert(candidate((\"04122003\")) == (false));\n assert(candidate((\"20030412\")) == (false));\n assert(candidate((\"2003-04\")) == (false));\n assert(candidate((\"2003-04-12\")) == (false));\n assert(candidate((\"04-2003\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that takes a string and returns an ordered version of it.\n// Ordered version of string, is a string where all words (separated by space)\n// are replaced by a new word where all the characters arranged in\n// ascending order based on ascii value.\n// Note: You should keep the order of words and blank spaces in the sentence.\n// For example:\n// anti_shuffle('Hi') returns 'Hi'\n// anti_shuffle('hello') returns 'ehllo'\n// anti_shuffle('Hello World!!!') returns 'Hello !!!Wdlor'\nstd::string anti_shuffle(std::string s) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = anti_shuffle;\n assert(candidate((\"Hi\")) == (\"Hi\"));\n assert(candidate((\"hello\")) == (\"ehllo\"));\n assert(candidate((\"number\")) == (\"bemnru\"));\n assert(candidate((\"abcd\")) == (\"abcd\"));\n assert(candidate((\"Hello World!!!\")) == (\"Hello !!!Wdlor\"));\n assert(candidate((\"\")) == (\"\"));\n assert(candidate((\"Hi. My name is Mister Robot. How are you?\")) == (\".Hi My aemn is Meirst .Rboot How aer ?ouy\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "cpp", - "prompt": "#include\n#include\n// Given a list of numbers, return whether or not they are sorted\n// in ascending order. If list has more than 1 duplicate of the same\n// number, return False. Assume no negative numbers and only integers.\n// Examples\n// is_sorted([5]) \u279e True\n// is_sorted([1, 2, 3, 4, 5]) \u279e True\n// is_sorted([1, 3, 2, 4, 5]) \u279e False\n// is_sorted([1, 2, 3, 4, 5, 6]) \u279e True\n// is_sorted([1, 2, 3, 4, 5, 6, 7]) \u279e True\n// is_sorted([1, 3, 2, 4, 5, 6, 7]) \u279e False\n// is_sorted([1, 2, 2, 3, 3, 4]) \u279e True\n// is_sorted([1, 2, 2, 2, 3, 4]) \u279e False\nbool is_sorted(std::vector lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = is_sorted;\n assert(candidate((std::vector({(long)5}))) == (true));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5}))) == (true));\n assert(candidate((std::vector({(long)1, (long)3, (long)2, (long)4, (long)5}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}))) == (true));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6, (long)7}))) == (true));\n assert(candidate((std::vector({(long)1, (long)3, (long)2, (long)4, (long)5, (long)6, (long)7}))) == (false));\n assert(candidate((std::vector())) == (true));\n assert(candidate((std::vector({(long)1}))) == (true));\n assert(candidate((std::vector({(long)3, (long)2, (long)1}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)2, (long)2, (long)3, (long)4}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)3, (long)3, (long)4}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)2, (long)3, (long)3, (long)4}))) == (true));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4}))) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a string s.\n// Your task is to check if the string is happy or not.\n// A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n// For example:\n// is_happy(a) => False\n// is_happy(aa) => False\n// is_happy(abcd) => True\n// is_happy(aabb) => False\n// is_happy(adb) => True\n// is_happy(xyy) => False\nbool is_happy(std::string s) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = is_happy;\n assert(candidate((\"a\")) == (false));\n assert(candidate((\"aa\")) == (false));\n assert(candidate((\"abcd\")) == (true));\n assert(candidate((\"aabb\")) == (false));\n assert(candidate((\"adb\")) == (true));\n assert(candidate((\"xyy\")) == (false));\n assert(candidate((\"iopaxpoi\")) == (true));\n assert(candidate((\"iopaxioi\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that returns True if the object q will fly, and False otherwise.\n// The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n// Example:\n// will_it_fly([1, 2], 5) \u279e False \n// # 1+2 is less than the maximum possible weight, but it's unbalanced.\n// will_it_fly([3, 2, 3], 1) \u279e False\n// # it's balanced, but 3+2+3 is more than the maximum possible weight.\n// will_it_fly([3, 2, 3], 9) \u279e True\n// # 3+2+3 is less than the maximum possible weight, and it's balanced.\n// will_it_fly([3], 5) \u279e True\n// # 3 is less than the maximum possible weight, and it's balanced.\nbool will_it_fly(std::vector q, long w) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = will_it_fly;\n assert(candidate((std::vector({(long)3, (long)2, (long)3})), (9)) == (true));\n assert(candidate((std::vector({(long)1, (long)2})), (5)) == (false));\n assert(candidate((std::vector({(long)3})), (5)) == (true));\n assert(candidate((std::vector({(long)3, (long)2, (long)3})), (1)) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)3})), (6)) == (false));\n assert(candidate((std::vector({(long)5})), (5)) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "cpp", - "prompt": "#include\n#include\n// Given an array of non-negative integers, return a copy of the given array after sorting,\n// you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n// or sort it in descending order if the sum( first index value, last index value) is even.\n// Note:\n// * don't change the given array.\n// Examples:\n// * sort_array([]) => []\n// * sort_array([5]) => [5]\n// * sort_array([2, 4, 3, 0, 1, 5]) => [0, 1, 2, 3, 4, 5]\n// * sort_array([2, 4, 3, 0, 1, 5, 6]) => [6, 5, 4, 3, 2, 1, 0]\nstd::vector sort_array(std::vector array) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = sort_array;\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)5}))) == (std::vector({(long)5})));\n assert(candidate((std::vector({(long)2, (long)4, (long)3, (long)0, (long)1, (long)5}))) == (std::vector({(long)0, (long)1, (long)2, (long)3, (long)4, (long)5})));\n assert(candidate((std::vector({(long)2, (long)4, (long)3, (long)0, (long)1, (long)5, (long)6}))) == (std::vector({(long)6, (long)5, (long)4, (long)3, (long)2, (long)1, (long)0})));\n assert(candidate((std::vector({(long)2, (long)1}))) == (std::vector({(long)1, (long)2})));\n assert(candidate((std::vector({(long)15, (long)42, (long)87, (long)32, (long)11, (long)0}))) == (std::vector({(long)0, (long)11, (long)15, (long)32, (long)42, (long)87})));\n assert(candidate((std::vector({(long)21, (long)14, (long)23, (long)11}))) == (std::vector({(long)23, (long)21, (long)14, (long)11})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "cpp", - "prompt": "#include\n#include\n// Implement a function that takes an non-negative integer and returns an array of the first n\n// integers that are prime numbers and less than n.\n// for example:\n// count_up_to(5) => [2,3]\n// count_up_to(11) => [2,3,5,7]\n// count_up_to(0) => []\n// count_up_to(20) => [2,3,5,7,11,13,17,19]\n// count_up_to(1) => []\n// count_up_to(18) => [2,3,5,7,11,13,17]\nstd::vector count_up_to(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = count_up_to;\n assert(candidate((5)) == (std::vector({(long)2, (long)3})));\n assert(candidate((6)) == (std::vector({(long)2, (long)3, (long)5})));\n assert(candidate((7)) == (std::vector({(long)2, (long)3, (long)5})));\n assert(candidate((10)) == (std::vector({(long)2, (long)3, (long)5, (long)7})));\n assert(candidate((0)) == (std::vector()));\n assert(candidate((22)) == (std::vector({(long)2, (long)3, (long)5, (long)7, (long)11, (long)13, (long)17, (long)19})));\n assert(candidate((1)) == (std::vector()));\n assert(candidate((18)) == (std::vector({(long)2, (long)3, (long)5, (long)7, (long)11, (long)13, (long)17})));\n assert(candidate((47)) == (std::vector({(long)2, (long)3, (long)5, (long)7, (long)11, (long)13, (long)17, (long)19, (long)23, (long)29, (long)31, (long)37, (long)41, (long)43})));\n assert(candidate((101)) == (std::vector({(long)2, (long)3, (long)5, (long)7, (long)11, (long)13, (long)17, (long)19, (long)23, (long)29, (long)31, (long)37, (long)41, (long)43, (long)47, (long)53, (long)59, (long)61, (long)67, (long)71, (long)73, (long)79, (long)83, (long)89, (long)97})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "cpp", - "prompt": "#include\n#include\n// Out of list of strings, return the longest one. Return the first one in case of multiple\n// strings of the same length. Return None in case the input list is empty.\n// >>> longest([])\n// >>> longest(['a', 'b', 'c'])\n// 'a'\n// >>> longest(['a', 'bb', 'ccc'])\n// 'ccc'\nstd::optional longest(std::vector strings) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = longest;\n assert(candidate((std::vector())) == std::nullopt);\n assert(candidate((std::vector({(std::string)\"x\", (std::string)\"y\", (std::string)\"z\"}))) == \"x\");\n assert(candidate((std::vector({(std::string)\"x\", (std::string)\"yyy\", (std::string)\"zzzz\", (std::string)\"www\", (std::string)\"kkkk\", (std::string)\"abc\"}))) == \"zzzz\");\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "cpp", - "prompt": "#include\n#include\n// Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n// reverse the resulting array, and then replace each digit by its corresponding name from\n// \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n// For example:\n// arr = [2, 1, 1, 4, 5, 8, 2, 3] \n// -> sort arr -> [1, 1, 2, 2, 3, 4, 5, 8] \n// -> reverse arr -> [8, 5, 4, 3, 2, 2, 1, 1]\n// return [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n// If the array is empty, return an empty array:\n// arr = []\n// return []\n// If the array has any strange number ignore it:\n// arr = [1, -1 , 55] \n// -> sort arr -> [-1, 1, 55]\n// -> reverse arr -> [55, 1, -1]\n// return = ['One']\nstd::vector by_length(std::vector arr) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = by_length;\n assert(candidate((std::vector({(long)2, (long)1, (long)1, (long)4, (long)5, (long)8, (long)2, (long)3}))) == (std::vector({(std::string)\"Eight\", (std::string)\"Five\", (std::string)\"Four\", (std::string)\"Three\", (std::string)\"Two\", (std::string)\"Two\", (std::string)\"One\", (std::string)\"One\"})));\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)1, (long)-1, (long)55}))) == (std::vector({(std::string)\"One\"})));\n assert(candidate((std::vector({(long)1, (long)-1, (long)3, (long)2}))) == (std::vector({(std::string)\"Three\", (std::string)\"Two\", (std::string)\"One\"})));\n assert(candidate((std::vector({(long)9, (long)4, (long)8}))) == (std::vector({(std::string)\"Nine\", (std::string)\"Eight\", (std::string)\"Four\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_106_f", - "language": "cpp", - "prompt": "#include\n#include\n// Implement the function f that takes n as a parameter,\n// 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\n// or the sum of numbers from 1 to i otherwise.\n// i starts from 1.\n// the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n// Example:\n// f(5) == [1, 2, 6, 24, 15]\nstd::vector f(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = f;\n assert(candidate((5)) == (std::vector({(long)1, (long)2, (long)6, (long)24, (long)15})));\n assert(candidate((7)) == (std::vector({(long)1, (long)2, (long)6, (long)24, (long)15, (long)720, (long)28})));\n assert(candidate((1)) == (std::vector({(long)1})));\n assert(candidate((3)) == (std::vector({(long)1, (long)2, (long)6})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "cpp", - "prompt": "#include\n#include\n// Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n// >>> fizz_buzz(50)\n// 0\n// >>> fizz_buzz(78)\n// 2\n// >>> fizz_buzz(79)\n// 3\nlong fizz_buzz(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = fizz_buzz;\n assert(candidate((50)) == (0));\n assert(candidate((78)) == (2));\n assert(candidate((79)) == (3));\n assert(candidate((100)) == (3));\n assert(candidate((200)) == (6));\n assert(candidate((4000)) == (192));\n assert(candidate((10000)) == (639));\n assert(candidate((100000)) == (8026));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "cpp", - "prompt": "#include\n#include\n// Given a positive floating point number, it can be decomposed into\n// and integer part (largest integer smaller than given number) and decimals\n// (leftover part always smaller than 1).\n// Return the decimal part of the number.\n// >>> truncate_number(3.5)\n// 0.5\nfloat truncate_number(float number) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = truncate_number;\n assert(candidate((3.5)) == (0.5));\n assert(candidate((1.25)) == (0.25));\n assert(candidate((123.0)) == (0.0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "cpp", - "prompt": "#include\n#include\n// For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n// Empty sum should be equal to 0 and empty product should be equal to 1.\n// >>> sum_product([])\n// (0, 1)\n// >>> sum_product([1, 2, 3, 4])\n// (10, 24)\nstd::tuple sum_product(std::vector numbers) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = sum_product;\n assert(candidate((std::vector())) == (std::make_tuple(0, 1)));\n assert(candidate((std::vector({(long)1, (long)1, (long)1}))) == (std::make_tuple(3, 1)));\n assert(candidate((std::vector({(long)100, (long)0}))) == (std::make_tuple(100, 0)));\n assert(candidate((std::vector({(long)3, (long)5, (long)7}))) == (std::make_tuple(15, 105)));\n assert(candidate((std::vector({(long)10}))) == (std::make_tuple(10, 10)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a 2 dimensional data, as a nested lists,\n// which is similar to matrix, however, unlike matrices,\n// each row may contain a different number of columns.\n// Given lst, and integer x, find integers x in the list,\n// and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n// each tuple is a coordinate - (row, columns), starting with 0.\n// Sort coordinates initially by rows in ascending order.\n// Also, sort coordinates of the row by columns in descending order.\n// Examples:\n// get_row([\n// [1,2,3,4,5,6],\n// [1,2,3,4,1,6],\n// [1,2,3,4,5,1]\n// ], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n// get_row([], 1) == []\n// get_row([[], [1], [1, 2, 3]], 3) == [(2, 2)]\nstd::vector> get_row(std::vector> lst, long x) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = get_row;\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)1, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)1})})), (1)) == (std::vector>({(std::tuple)std::make_tuple(0, 0), (std::tuple)std::make_tuple(1, 4), (std::tuple)std::make_tuple(1, 0), (std::tuple)std::make_tuple(2, 5), (std::tuple)std::make_tuple(2, 0)})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6})})), (2)) == (std::vector>({(std::tuple)std::make_tuple(0, 1), (std::tuple)std::make_tuple(1, 1), (std::tuple)std::make_tuple(2, 1), (std::tuple)std::make_tuple(3, 1), (std::tuple)std::make_tuple(4, 1), (std::tuple)std::make_tuple(5, 1)})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)1, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)1, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)1, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)1, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)1})})), (1)) == (std::vector>({(std::tuple)std::make_tuple(0, 0), (std::tuple)std::make_tuple(1, 0), (std::tuple)std::make_tuple(2, 1), (std::tuple)std::make_tuple(2, 0), (std::tuple)std::make_tuple(3, 2), (std::tuple)std::make_tuple(3, 0), (std::tuple)std::make_tuple(4, 3), (std::tuple)std::make_tuple(4, 0), (std::tuple)std::make_tuple(5, 4), (std::tuple)std::make_tuple(5, 0), (std::tuple)std::make_tuple(6, 5), (std::tuple)std::make_tuple(6, 0)})));\n assert(candidate((std::vector>()), (1)) == (std::vector>()));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1})})), (2)) == (std::vector>()));\n assert(candidate((std::vector>({(std::vector)std::vector(), (std::vector)std::vector({(long)1}), (std::vector)std::vector({(long)1, (long)2, (long)3})})), (3)) == (std::vector>({(std::tuple)std::make_tuple(2, 2)})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "cpp", - "prompt": "#include\n#include\n// You're a hungry rabbit, and you already have eaten a certain number of carrots,\n// but now you need to eat more carrots to complete the day's meals.\n// you should return an array of [ total number of eaten carrots after your meals,\n// the number of carrots left after your meals ]\n// if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n// Example:\n// * eat(5, 6, 10) -> [11, 4]\n// * eat(4, 8, 9) -> [12, 1]\n// * eat(1, 10, 10) -> [11, 0]\n// * eat(2, 11, 5) -> [7, 0]\n// Variables:\n// @number : integer\n// the number of carrots that you have eaten.\n// @need : integer\n// the number of carrots that you need to eat.\n// @remaining : integer\n// the number of remaining carrots thet exist in stock\n// Constrain:\n// * 0 <= number <= 1000\n// * 0 <= need <= 1000\n// * 0 <= remaining <= 1000\n// Have fun :)\nstd::vector eat(long number, long need, long remaining) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = eat;\n assert(candidate((5), (6), (10)) == (std::vector({(long)11, (long)4})));\n assert(candidate((4), (8), (9)) == (std::vector({(long)12, (long)1})));\n assert(candidate((1), (10), (10)) == (std::vector({(long)11, (long)0})));\n assert(candidate((2), (11), (5)) == (std::vector({(long)7, (long)0})));\n assert(candidate((4), (5), (7)) == (std::vector({(long)9, (long)2})));\n assert(candidate((4), (5), (1)) == (std::vector({(long)5, (long)0})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "cpp", - "prompt": "#include\n#include\n// Given a positive integer N, return the total sum of its digits in binary.\n// Example\n// For N = 1000, the sum of digits will be 1 the output should be \"1\".\n// For N = 150, the sum of digits will be 6 the output should be \"110\".\n// For N = 147, the sum of digits will be 12 the output should be \"1100\".\n// Variables:\n// @N integer\n// Constraints: 0 \u2264 N \u2264 10000.\n// Output:\n// a string of binary number\nstd::string solve(long N) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = solve;\n assert(candidate((1000)) == (\"1\"));\n assert(candidate((150)) == (\"110\"));\n assert(candidate((147)) == (\"1100\"));\n assert(candidate((333)) == (\"1001\"));\n assert(candidate((963)) == (\"10010\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a list of integers.\n// You need to find the largest prime value and return the sum of its digits.\n// Examples:\n// For lst = [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] the output should be 10\n// For lst = [1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1] the output should be 25\n// For lst = [1,3,1,32,5107,34,83278,109,163,23,2323,32,30,1,9,3] the output should be 13\n// For lst = [0,724,32,71,99,32,6,0,5,91,83,0,5,6] the output should be 11\n// For lst = [0,81,12,3,1,21] the output should be 3\n// For lst = [0,8,1,2,1,7] the output should be 7\nlong skjkasdkd(std::vector lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = skjkasdkd;\n assert(candidate((std::vector({(long)0, (long)3, (long)2, (long)1, (long)3, (long)5, (long)7, (long)4, (long)5, (long)5, (long)5, (long)2, (long)181, (long)32, (long)4, (long)32, (long)3, (long)2, (long)32, (long)324, (long)4, (long)3}))) == (10));\n assert(candidate((std::vector({(long)1, (long)0, (long)1, (long)8, (long)2, (long)4597, (long)2, (long)1, (long)3, (long)40, (long)1, (long)2, (long)1, (long)2, (long)4, (long)2, (long)5, (long)1}))) == (25));\n assert(candidate((std::vector({(long)1, (long)3, (long)1, (long)32, (long)5107, (long)34, (long)83278, (long)109, (long)163, (long)23, (long)2323, (long)32, (long)30, (long)1, (long)9, (long)3}))) == (13));\n assert(candidate((std::vector({(long)0, (long)724, (long)32, (long)71, (long)99, (long)32, (long)6, (long)0, (long)5, (long)91, (long)83, (long)0, (long)5, (long)6}))) == (11));\n assert(candidate((std::vector({(long)0, (long)81, (long)12, (long)3, (long)1, (long)21}))) == (3));\n assert(candidate((std::vector({(long)0, (long)8, (long)1, (long)2, (long)1, (long)7}))) == (7));\n assert(candidate((std::vector({(long)8191}))) == (19));\n assert(candidate((std::vector({(long)8191, (long)123456, (long)127, (long)7}))) == (19));\n assert(candidate((std::vector({(long)127, (long)97, (long)8192}))) == (10));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "cpp", - "prompt": "#include\n#include\n// Given an array arr of integers, find the minimum number of elements that\n// need to be changed to make the array palindromic. A palindromic array is an array that\n// is read the same backwards and forwards. In one change, you can change one element to any other element.\n// For example:\n// smallest_change([1,2,3,5,4,7,9,6]) == 4\n// smallest_change([1, 2, 3, 4, 3, 2, 2]) == 1\n// smallest_change([1, 2, 3, 2, 1]) == 0\nlong smallest_change(std::vector arr) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = smallest_change;\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)5, (long)4, (long)7, (long)9, (long)6}))) == (4));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)3, (long)2, (long)2}))) == (1));\n assert(candidate((std::vector({(long)1, (long)4, (long)2}))) == (1));\n assert(candidate((std::vector({(long)1, (long)4, (long)4, (long)2}))) == (1));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)2, (long)1}))) == (0));\n assert(candidate((std::vector({(long)3, (long)1, (long)1, (long)3}))) == (0));\n assert(candidate((std::vector({(long)1}))) == (0));\n assert(candidate((std::vector({(long)0, (long)1}))) == (1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "cpp", - "prompt": "#include\n#include\n// It is the last week of the semester and the teacher has to give the grades\n// to students. The teacher has been making her own algorithm for grading.\n// The only problem is, she has lost the code she used for grading.\n// She has given you a list of GPAs for some students and you have to write \n// a function that can output a list of letter grades using the following table:\n// GPA | Letter grade\n// 4.0 A+\n// > 3.7 A \n// > 3.3 A- \n// > 3.0 B+\n// > 2.7 B \n// > 2.3 B-\n// > 2.0 C+\n// > 1.7 C\n// > 1.3 C-\n// > 1.0 D+ \n// > 0.7 D \n// > 0.0 D-\n// 0.0 E\n// Example:\n// grade_equation([4.0, 3, 1.7, 2, 3.5]) ==> ['A+', 'B', 'C-', 'C', 'A-']\nstd::vector numerical_letter_grade(std::vector grades) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = numerical_letter_grade;\n assert(candidate((std::vector({(float)4.0, (float)3, (float)1.7, (float)2, (float)3.5}))) == (std::vector({(std::string)\"A+\", (std::string)\"B\", (std::string)\"C-\", (std::string)\"C\", (std::string)\"A-\"})));\n assert(candidate((std::vector({(float)1.2}))) == (std::vector({(std::string)\"D+\"})));\n assert(candidate((std::vector({(float)0.5}))) == (std::vector({(std::string)\"D-\"})));\n assert(candidate((std::vector({(float)0.0}))) == (std::vector({(std::string)\"E\"})));\n assert(candidate((std::vector({(float)1.0, (float)0.3, (float)1.5, (float)2.8, (float)3.3}))) == (std::vector({(std::string)\"D\", (std::string)\"D-\", (std::string)\"C-\", (std::string)\"B\", (std::string)\"B+\"})));\n assert(candidate((std::vector({(float)0.0, (float)0.7}))) == (std::vector({(std::string)\"E\", (std::string)\"D-\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "cpp", - "prompt": "#include\n#include\n// Given the lengths of the three sides of a triangle. Return the area of\n// the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n// Otherwise return -1\n// Three sides make a valid triangle when the sum of any two sides is greater \n// than the third side.\n// Example:\n// triangle_area(3, 4, 5) == 6.00\n// triangle_area(1, 2, 10) == -1\nfloat triangle_area(long a, long b, long c) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = triangle_area;\n assert(candidate((3), (4), (5)) == (6.0));\n assert(candidate((1), (2), (10)) == (float(-1)));\n assert(candidate((4), (8), (5)) == (8.18));\n assert(candidate((2), (2), (2)) == (1.73));\n assert(candidate((1), (2), (3)) == (float(-1)));\n assert(candidate((10), (5), (7)) == (16.25));\n assert(candidate((2), (6), (3)) == (float(-1)));\n assert(candidate((1), (1), (1)) == (0.43));\n assert(candidate((2), (2), (10)) == (float(-1)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "cpp", - "prompt": "#include\n#include\n// Check if two words have the same characters.\n// >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n// True\n// >>> same_chars('abcd', 'dddddddabc')\n// True\n// >>> same_chars('dddddddabc', 'abcd')\n// True\n// >>> same_chars('eabcd', 'dddddddabc')\n// False\n// >>> same_chars('abcd', 'dddddddabce')\n// False\n// >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc')\n// False\nbool same_chars(std::string s0, std::string s1) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = same_chars;\n assert(candidate((\"eabcdzzzz\"), (\"dddzzzzzzzddeddabc\")) == (true));\n assert(candidate((\"abcd\"), (\"dddddddabc\")) == (true));\n assert(candidate((\"dddddddabc\"), (\"abcd\")) == (true));\n assert(candidate((\"eabcd\"), (\"dddddddabc\")) == (false));\n assert(candidate((\"abcd\"), (\"dddddddabcf\")) == (false));\n assert(candidate((\"eabcdzzzz\"), (\"dddzzzzzzzddddabc\")) == (false));\n assert(candidate((\"aabb\"), (\"aaccc\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "cpp", - "prompt": "#include\n#include\n// Given an array of integers nums, find the minimum sum of any non-empty sub-array\n// of nums.\n// Example\n// minSubArraySum([2, 3, 4, 1, 2, 4]) == 1\n// minSubArraySum([-1, -2, -3]) == -6\nlong minSubArraySum(std::vector nums) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = minSubArraySum;\n assert(candidate((std::vector({(long)2, (long)3, (long)4, (long)1, (long)2, (long)4}))) == (1));\n assert(candidate((std::vector({(long)-1, (long)-2, (long)-3}))) == (-6));\n assert(candidate((std::vector({(long)-1, (long)-2, (long)-3, (long)2, (long)-10}))) == (-14));\n assert(candidate((std::vector({(long)-9999999999999999}))) == (-9999999999999999));\n assert(candidate((std::vector({(long)0, (long)10, (long)20, (long)1000000}))) == (0));\n assert(candidate((std::vector({(long)-1, (long)-2, (long)-3, (long)10, (long)-5}))) == (-6));\n assert(candidate((std::vector({(long)100, (long)-1, (long)-2, (long)-3, (long)10, (long)-5}))) == (-6));\n assert(candidate((std::vector({(long)10, (long)11, (long)13, (long)8, (long)3, (long)4}))) == (3));\n assert(candidate((std::vector({(long)100, (long)-33, (long)32, (long)-1, (long)0, (long)-2}))) == (-33));\n assert(candidate((std::vector({(long)-10}))) == (-10));\n assert(candidate((std::vector({(long)7}))) == (7));\n assert(candidate((std::vector({(long)1, (long)-1}))) == (-1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "cpp", - "prompt": "#include\n#include\n// Given a string s and a natural number n, you have been tasked to implement \n// a function that returns a list of all words from string s that contain exactly \n// n consonants, in order these words appear in the string s.\n// If the string s is empty then the function should return an empty list.\n// Note: you may assume the input string contains only letters and spaces.\n// Examples:\n// select_words(\"Mary had a little lamb\", 4) ==> [\"little\"]\n// select_words(\"Mary had a little lamb\", 3) ==> [\"Mary\", \"lamb\"]\n// select_words(\"simple white space\", 2) ==> []\n// select_words(\"Hello world\", 4) ==> [\"world\"]\n// select_words(\"Uncle sam\", 3) ==> [\"Uncle\"]\nstd::vector select_words(std::string s, long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = select_words;\n assert(candidate((\"Mary had a little lamb\"), (4)) == (std::vector({(std::string)\"little\"})));\n assert(candidate((\"Mary had a little lamb\"), (3)) == (std::vector({(std::string)\"Mary\", (std::string)\"lamb\"})));\n assert(candidate((\"simple white space\"), (2)) == (std::vector()));\n assert(candidate((\"Hello world\"), (4)) == (std::vector({(std::string)\"world\"})));\n assert(candidate((\"Uncle sam\"), (3)) == (std::vector({(std::string)\"Uncle\"})));\n assert(candidate((\"\"), (4)) == (std::vector()));\n assert(candidate((\"a b c d e f\"), (1)) == (std::vector({(std::string)\"b\", (std::string)\"c\", (std::string)\"d\", (std::string)\"f\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "cpp", - "prompt": "#include\n#include\n// Return list of all prefixes from shortest to longest of the input string\n// >>> all_prefixes('abc')\n// ['a', 'ab', 'abc']\nstd::vector all_prefixes(std::string string) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = all_prefixes;\n assert(candidate((\"\")) == (std::vector()));\n assert(candidate((\"asdfgh\")) == (std::vector({(std::string)\"a\", (std::string)\"as\", (std::string)\"asd\", (std::string)\"asdf\", (std::string)\"asdfg\", (std::string)\"asdfgh\"})));\n assert(candidate((\"WWW\")) == (std::vector({(std::string)\"W\", (std::string)\"WW\", (std::string)\"WWW\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function that takes a value (string) representing a number\n// and returns the closest integer to it. If the number is equidistant\n// from two integers, round it away from zero.\n// Examples\n// >>> closest_integer(\"10\")\n// 10\n// >>> closest_integer(\"15.3\")\n// 15\n// Note:\n// Rounding away from zero means that if the given number is equidistant\n// from two integers, the one you should return is the one that is the\n// farthest from zero. For example closest_integer(\"14.5\") should\n// return 15 and closest_integer(\"-14.5\") should return -15.\nlong closest_integer(std::string value) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = closest_integer;\n assert(candidate((\"10\")) == (10));\n assert(candidate((\"14.5\")) == (15));\n assert(candidate((\"-15.5\")) == (-16));\n assert(candidate((\"15.3\")) == (15));\n assert(candidate((\"0\")) == (0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function which takes a string representing a file's name, and returns\n// 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n// A file's name is considered to be valid if and only if all the following conditions \n// are met:\n// - There should not be more than three digits ('0'-'9') in the file's name.\n// - The file's name contains exactly one dot '.'\n// - The substring before the dot should not be empty, and it starts with a letter from \n// the latin alphapet ('a'-'z' and 'A'-'Z').\n// - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n// Examples:\n// file_name_check(\"example.txt\") # => 'Yes'\n// file_name_check(\"1example.dll\") # => 'No' (the name should start with a latin alphapet letter)\nstd::string file_name_check(std::string file_name) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = file_name_check;\n assert(candidate((\"example.txt\")) == (\"Yes\"));\n assert(candidate((\"1example.dll\")) == (\"No\"));\n assert(candidate((\"s1sdf3.asd\")) == (\"No\"));\n assert(candidate((\"K.dll\")) == (\"Yes\"));\n assert(candidate((\"MY16FILE3.exe\")) == (\"Yes\"));\n assert(candidate((\"His12FILE94.exe\")) == (\"No\"));\n assert(candidate((\"_Y.txt\")) == (\"No\"));\n assert(candidate((\"?aREYA.exe\")) == (\"No\"));\n assert(candidate((\"/this_is_valid.dll\")) == (\"No\"));\n assert(candidate((\"this_is_valid.wow\")) == (\"No\"));\n assert(candidate((\"this_is_valid.txt\")) == (\"Yes\"));\n assert(candidate((\"this_is_valid.txtexe\")) == (\"No\"));\n assert(candidate((\"#this2_i4s_5valid.ten\")) == (\"No\"));\n assert(candidate((\"@this1_is6_valid.exe\")) == (\"No\"));\n assert(candidate((\"this_is_12valid.6exe4.txt\")) == (\"No\"));\n assert(candidate((\"all.exe.txt\")) == (\"No\"));\n assert(candidate((\"I563_No.exe\")) == (\"Yes\"));\n assert(candidate((\"Is3youfault.txt\")) == (\"Yes\"));\n assert(candidate((\"no_one#knows.dll\")) == (\"Yes\"));\n assert(candidate((\"1I563_Yes3.exe\")) == (\"No\"));\n assert(candidate((\"I563_Yes3.txtt\")) == (\"No\"));\n assert(candidate((\"final..txt\")) == (\"No\"));\n assert(candidate((\"final132\")) == (\"No\"));\n assert(candidate((\"_f4indsartal132.\")) == (\"No\"));\n assert(candidate((\".txt\")) == (\"No\"));\n assert(candidate((\"s.\")) == (\"No\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "cpp", - "prompt": "#include\n#include\n// You are given two intervals,\n// where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n// The given intervals are closed which means that the interval (start, end)\n// includes both start and end.\n// For each given interval, it is assumed that its start is less or equal its end.\n// Your task is to determine whether the length of intersection of these two \n// intervals is a prime number.\n// Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n// which its length is 1, which not a prime number.\n// If the length of the intersection is a prime number, return \"YES\",\n// otherwise, return \"NO\".\n// If the two intervals don't intersect, return \"NO\".\n// [input/output] samples:\n// intersection((1, 2), (2, 3)) ==> \"NO\"\n// intersection((-1, 1), (0, 4)) ==> \"NO\"\n// intersection((-3, -1), (-5, 5)) ==> \"YES\"\nstd::string intersection(std::tuple interval1, std::tuple interval2) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = intersection;\n assert(candidate((std::make_tuple(1, 2)), (std::make_tuple(2, 3))) == (\"NO\"));\n assert(candidate((std::make_tuple(-1, 1)), (std::make_tuple(0, 4))) == (\"NO\"));\n assert(candidate((std::make_tuple(-3, -1)), (std::make_tuple(-5, 5))) == (\"YES\"));\n assert(candidate((std::make_tuple(-2, 2)), (std::make_tuple(-4, 0))) == (\"YES\"));\n assert(candidate((std::make_tuple(-11, 2)), (std::make_tuple(-1, -1))) == (\"NO\"));\n assert(candidate((std::make_tuple(1, 2)), (std::make_tuple(3, 5))) == (\"NO\"));\n assert(candidate((std::make_tuple(1, 2)), (std::make_tuple(1, 2))) == (\"NO\"));\n assert(candidate((std::make_tuple(-2, -2)), (std::make_tuple(-3, -2))) == (\"NO\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "cpp", - "prompt": "#include\n#include\n// Return the largest prime factor of n. Assume n > 1 and is not a prime.\n// >>> largest_prime_factor(13195)\n// 29\n// >>> largest_prime_factor(2048)\n// 2\nlong largest_prime_factor(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = largest_prime_factor;\n assert(candidate((15)) == (5));\n assert(candidate((27)) == (3));\n assert(candidate((63)) == (7));\n assert(candidate((330)) == (11));\n assert(candidate((13195)) == (29));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "cpp", - "prompt": "#include\n#include\n// Given a string, find out how many distinct characters (regardless of case) does it consist of\n// >>> count_distinct_characters('xyzXYZ')\n// 3\n// >>> count_distinct_characters('Jerry')\n// 4\nlong count_distinct_characters(std::string string) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = count_distinct_characters;\n assert(candidate((\"\")) == (0));\n assert(candidate((\"abcde\")) == (5));\n assert(candidate((\"abcdecadeCADE\")) == (5));\n assert(candidate((\"aaaaAAAAaaaa\")) == (1));\n assert(candidate((\"Jerry jERRY JeRRRY\")) == (5));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "cpp", - "prompt": "#include\n#include\n// You're given a list of deposit and withdrawal operations on a bank account that starts with\n// zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n// at that point function should return True. Otherwise it should return False.\n// >>> below_zero([1, 2, 3])\n// False\n// >>> below_zero([1, 2, -4, 5])\n// True\nbool below_zero(std::vector operations) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = below_zero;\n assert(candidate((std::vector())) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)-3, (long)1, (long)2, (long)-3}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)-4, (long)5, (long)6}))) == (true));\n assert(candidate((std::vector({(long)1, (long)-1, (long)2, (long)-2, (long)5, (long)-5, (long)4, (long)-4}))) == (false));\n assert(candidate((std::vector({(long)1, (long)-1, (long)2, (long)-2, (long)5, (long)-5, (long)4, (long)-5}))) == (true));\n assert(candidate((std::vector({(long)1, (long)-2, (long)2, (long)-2, (long)5, (long)-5, (long)4, (long)-4}))) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "cpp", - "prompt": "#include\n#include\n// Find the shortest palindrome that begins with a supplied string.\n// Algorithm idea is simple:\n// - Find the longest postfix of supplied string that is a palindrome.\n// - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n// >>> make_palindrome('')\n// ''\n// >>> make_palindrome('cat')\n// 'catac'\n// >>> make_palindrome('cata')\n// 'catac'\nstd::string make_palindrome(std::string string) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = make_palindrome;\n assert(candidate((\"\")) == (\"\"));\n assert(candidate((\"x\")) == (\"x\"));\n assert(candidate((\"xyz\")) == (\"xyzyx\"));\n assert(candidate((\"xyx\")) == (\"xyx\"));\n assert(candidate((\"jerry\")) == (\"jerryrrej\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "cpp", - "prompt": "#include\n#include\n// Given a positive integer, obtain its roman numeral equivalent as a string,\n// and return it in lowercase.\n// Restrictions: 1 <= num <= 1000\n// Examples:\n// >>> int_to_mini_roman(19) == 'xix'\n// >>> int_to_mini_roman(152) == 'clii'\n// >>> int_to_mini_roman(426) == 'cdxxvi'\nstd::string int_to_mini_roman(long number) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = int_to_mini_roman;\n assert(candidate((19)) == (\"xix\"));\n assert(candidate((152)) == (\"clii\"));\n assert(candidate((251)) == (\"ccli\"));\n assert(candidate((426)) == (\"cdxxvi\"));\n assert(candidate((500)) == (\"d\"));\n assert(candidate((1)) == (\"i\"));\n assert(candidate((4)) == (\"iv\"));\n assert(candidate((43)) == (\"xliii\"));\n assert(candidate((90)) == (\"xc\"));\n assert(candidate((94)) == (\"xciv\"));\n assert(candidate((532)) == (\"dxxxii\"));\n assert(candidate((900)) == (\"cm\"));\n assert(candidate((994)) == (\"cmxciv\"));\n assert(candidate((1000)) == (\"m\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - } -] \ No newline at end of file diff --git a/data/cpp-remove.json b/data/cpp-remove.json deleted file mode 100644 index 40f42229eb61ffc83c3366f7e6e4bab677ea0e79..0000000000000000000000000000000000000000 --- a/data/cpp-remove.json +++ /dev/null @@ -1,1898 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "cpp", - "prompt": "#include\n#include\n// For a given number n, find the largest number that divides n evenly, smaller than n\nlong largest_divisor(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = largest_divisor;\n assert(candidate((3)) == (1));\n assert(candidate((7)) == (1));\n assert(candidate((10)) == (5));\n assert(candidate((100)) == (50));\n assert(candidate((49)) == (7));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_47_median", - "language": "cpp", - "prompt": "#include\n#include\n// Return median of elements in the list l.\nfloat median(std::vector l) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = median;\n assert(candidate((std::vector({(long)3, (long)1, (long)2, (long)4, (long)5}))) == (float(3)));\n assert(candidate((std::vector({(long)-10, (long)4, (long)6, (long)1000, (long)10, (long)20}))) == (8.0));\n assert(candidate((std::vector({(long)5}))) == (float(5)));\n assert(candidate((std::vector({(long)6, (long)5}))) == (5.5));\n assert(candidate((std::vector({(long)8, (long)1, (long)3, (long)9, (long)9, (long)2, (long)7}))) == (float(7)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "cpp", - "prompt": "#include\n#include\n// Return maximum element in the list.\nlong max_element(std::vector l) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = max_element;\n assert(candidate((std::vector({(long)1, (long)2, (long)3}))) == (3));\n assert(candidate((std::vector({(long)5, (long)3, (long)-5, (long)2, (long)-3, (long)3, (long)9, (long)0, (long)124, (long)1, (long)-10}))) == (124));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function which returns the largest index of an element which\n// is not greater than or equal to the element immediately preceding it. If\n// no such element exists then return -1. The given array will not contain\n// duplicate values.\n// Examples:\nlong can_arrange(std::vector arr) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = can_arrange;\n assert(candidate((std::vector({(long)1, (long)2, (long)4, (long)3, (long)5}))) == (3));\n assert(candidate((std::vector({(long)1, (long)2, (long)4, (long)5}))) == (-1));\n assert(candidate((std::vector({(long)1, (long)4, (long)2, (long)5, (long)6, (long)7, (long)8, (long)9, (long)10}))) == (2));\n assert(candidate((std::vector({(long)4, (long)8, (long)5, (long)7, (long)3}))) == (4));\n assert(candidate((std::vector())) == (-1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function that returns True if the last character\n// of a given string is an alphabetical character and is not\n// a part of a word, and False otherwise.\n// Note: \"word\" is a group of characters separated by space.\n// Examples:\nbool check_if_last_char_is_a_letter(std::string txt) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = check_if_last_char_is_a_letter;\n assert(candidate((\"apple\")) == (false));\n assert(candidate((\"apple pi e\")) == (true));\n assert(candidate((\"eeeee\")) == (false));\n assert(candidate((\"A\")) == (true));\n assert(candidate((\"Pumpkin pie \")) == (false));\n assert(candidate((\"Pumpkin pie 1\")) == (false));\n assert(candidate((\"\")) == (false));\n assert(candidate((\"eeeee e \")) == (false));\n assert(candidate((\"apple pie\")) == (false));\n assert(candidate((\"apple pi e \")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "cpp", - "prompt": "#include\n#include\n// Return true if a given number is prime, and false otherwise.\nbool is_prime(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = is_prime;\n assert(candidate((6)) == (false));\n assert(candidate((101)) == (true));\n assert(candidate((11)) == (true));\n assert(candidate((13441)) == (true));\n assert(candidate((61)) == (true));\n assert(candidate((4)) == (false));\n assert(candidate((1)) == (false));\n assert(candidate((5)) == (true));\n assert(candidate((11)) == (true));\n assert(candidate((17)) == (true));\n assert(candidate((85)) == (false));\n assert(candidate((77)) == (false));\n assert(candidate((255379)) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "cpp", - "prompt": "#include\n#include\n// Given a list of positive integers x. return a sorted list of all \n// elements that hasn't any even digit.\n// Note: Returned list should be sorted in increasing order.\n// For example:\nstd::vector unique_digits(std::vector x) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = unique_digits;\n assert(candidate((std::vector({(long)15, (long)33, (long)1422, (long)1}))) == (std::vector({(long)1, (long)15, (long)33})));\n assert(candidate((std::vector({(long)152, (long)323, (long)1422, (long)10}))) == (std::vector()));\n assert(candidate((std::vector({(long)12345, (long)2033, (long)111, (long)151}))) == (std::vector({(long)111, (long)151})));\n assert(candidate((std::vector({(long)135, (long)103, (long)31}))) == (std::vector({(long)31, (long)135})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "cpp", - "prompt": "#include\n#include\n// Input are two strings a and b consisting only of 1s and 0s.\n// Perform binary XOR on these inputs and return result also as a string.\nstd::string string_xor(std::string a, std::string b) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = string_xor;\n assert(candidate((\"111000\"), (\"101010\")) == (\"010010\"));\n assert(candidate((\"1\"), (\"1\")) == (\"0\"));\n assert(candidate((\"0101\"), (\"0000\")) == (\"0101\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "cpp", - "prompt": "#include\n#include\n// sum_to_n is a function that sums numbers from 1 to n.\nlong sum_to_n(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = sum_to_n;\n assert(candidate((1)) == (1));\n assert(candidate((6)) == (21));\n assert(candidate((11)) == (66));\n assert(candidate((30)) == (465));\n assert(candidate((100)) == (5050));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "cpp", - "prompt": "#include\n#include\n// Given a list of numbers, return the sum of squares of the numbers\n// in the list that are odd. Ignore numbers that are negative or not integers.\n// If the input list is empty, return 0.\nlong double_the_difference(std::vector lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = double_the_difference;\n assert(candidate((std::vector())) == (0));\n assert(candidate((std::vector({(float)5.0, (float)4.0}))) == (25));\n assert(candidate((std::vector({(float)0.1, (float)0.2, (float)0.3}))) == (0));\n assert(candidate((std::vector({(float)-10.0, (float)-20.0, (float)-30.0}))) == (0));\n assert(candidate((std::vector({(float)-1.0, (float)-2.0, (float)8.0}))) == (0));\n assert(candidate((std::vector({(float)0.2, (float)3.0, (float)5.0}))) == (34));\n assert(candidate((std::vector({(float)-9.0, (float)-7.0, (float)-5.0, (float)-3.0, (float)-1.0, (float)1.0, (float)3.0, (float)5.0, (float)7.0, (float)9.0}))) == (165));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "cpp", - "prompt": "#include\n#include\n// Return length of given string\nlong string_length(std::string string) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = string_length;\n assert(candidate((\"\")) == (0));\n assert(candidate((\"x\")) == (1));\n assert(candidate((\"asdasnakj\")) == (9));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "cpp", - "prompt": "#include\n#include\n// You'll be given a string of words, and your task is to count the number\n// of boredoms. A boredom is a sentence that starts with the word \"I\".\n// Sentences are delimited by '.', '?' or '!'.\n// For example:\nlong is_bored(std::string S) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = is_bored;\n assert(candidate((\"Hello world\")) == (0));\n assert(candidate((\"Is the sky blue?\")) == (0));\n assert(candidate((\"I love It !\")) == (1));\n assert(candidate((\"bIt\")) == (0));\n assert(candidate((\"I feel good today. I will be productive. will kill It\")) == (2));\n assert(candidate((\"You and I are going for a walk\")) == (0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function vowels_count which takes a string representing\n// a word as input and returns the number of vowels in the string.\n// Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n// vowel, but only when it is at the end of the given word.\n// Example:\nlong vowels_count(std::string s) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = vowels_count;\n assert(candidate((\"abcde\")) == (2));\n assert(candidate((\"Alone\")) == (3));\n assert(candidate((\"key\")) == (2));\n assert(candidate((\"bye\")) == (1));\n assert(candidate((\"keY\")) == (2));\n assert(candidate((\"bYe\")) == (1));\n assert(candidate((\"ACEDY\")) == (3));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "cpp", - "prompt": "#include\n#include\n// Return n-th Fibonacci number.\nlong fib(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = fib;\n assert(candidate((10)) == (55));\n assert(candidate((1)) == (1));\n assert(candidate((8)) == (21));\n assert(candidate((11)) == (89));\n assert(candidate((12)) == (144));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "cpp", - "prompt": "#include\n#include\n// Your task is to implement a function that will simplify the expression\n// x * n. The function returns True if x * n evaluates to a whole number and False\n// otherwise. Both x and n, are string representation of a fraction, and have the following format,\n// / where both numerator and denominator are positive whole numbers.\n// You can assume that x, and n are valid fractions, and do not have zero as denominator.\nbool simplify(std::string x, std::string n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = simplify;\n assert(candidate((\"1/5\"), (\"5/1\")) == (true));\n assert(candidate((\"1/6\"), (\"2/1\")) == (false));\n assert(candidate((\"5/1\"), (\"3/1\")) == (true));\n assert(candidate((\"7/10\"), (\"10/2\")) == (false));\n assert(candidate((\"2/10\"), (\"50/10\")) == (true));\n assert(candidate((\"7/2\"), (\"4/2\")) == (true));\n assert(candidate((\"11/6\"), (\"6/1\")) == (true));\n assert(candidate((\"2/3\"), (\"5/2\")) == (false));\n assert(candidate((\"5/2\"), (\"3/5\")) == (false));\n assert(candidate((\"2/4\"), (\"8/4\")) == (true));\n assert(candidate((\"2/4\"), (\"4/2\")) == (true));\n assert(candidate((\"1/5\"), (\"5/1\")) == (true));\n assert(candidate((\"1/5\"), (\"1/5\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "cpp", - "prompt": "#include\n#include\n// Given a string s, count the number of uppercase vowels in even indices.\n// For example:\nlong count_upper(std::string s) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = count_upper;\n assert(candidate((\"aBCdEf\")) == (1));\n assert(candidate((\"abcdefg\")) == (0));\n assert(candidate((\"dBBE\")) == (0));\n assert(candidate((\"B\")) == (0));\n assert(candidate((\"U\")) == (1));\n assert(candidate((\"\")) == (0));\n assert(candidate((\"EEEE\")) == (2));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a rectangular grid of wells. Each row represents a single well,\n// and each 1 in a row represents a single unit of water.\n// Each well has a corresponding bucket that can be used to extract water from it, \n// and all buckets have the same capacity.\n// Your task is to use the buckets to empty the wells.\n// Output the number of times you need to lower the buckets.\n// Example 1:\n// Example 2:\n// Example 3:\n// Constraints:\n// * all wells have the same length\n// * 1 <= grid.length <= 10^2\n// * 1 <= grid[:,1].length <= 10^2\n// * grid[i][j] -> 0 | 1\n// * 1 <= capacity <= 10\nlong max_fill(std::vector> grid, long capacity) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = max_fill;\n assert(candidate((std::vector>({(std::vector)std::vector({(long)0, (long)0, (long)1, (long)0}), (std::vector)std::vector({(long)0, (long)1, (long)0, (long)0}), (std::vector)std::vector({(long)1, (long)1, (long)1, (long)1})})), (1)) == (6));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)0, (long)0, (long)1, (long)1}), (std::vector)std::vector({(long)0, (long)0, (long)0, (long)0}), (std::vector)std::vector({(long)1, (long)1, (long)1, (long)1}), (std::vector)std::vector({(long)0, (long)1, (long)1, (long)1})})), (2)) == (5));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)0, (long)0, (long)0}), (std::vector)std::vector({(long)0, (long)0, (long)0})})), (5)) == (0));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)1, (long)1, (long)1}), (std::vector)std::vector({(long)1, (long)1, (long)1, (long)1})})), (2)) == (4));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)1, (long)1, (long)1}), (std::vector)std::vector({(long)1, (long)1, (long)1, (long)1})})), (9)) == (2));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "cpp", - "prompt": "#include\n#include\n// Given an array arr of integers and a positive integer k, return a sorted list \n// of length k with the maximum k numbers in arr.\n// Example 1:\n// Example 2:\n// Example 3:\n// Note:\n// 1. The length of the array will be in the range of [1, 1000].\n// 2. The elements in the array will be in the range of [-1000, 1000].\n// 3. 0 <= k <= len(arr)\nstd::vector maximum(std::vector arr, long k) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = maximum;\n assert(candidate((std::vector({(long)-3, (long)-4, (long)5})), (3)) == (std::vector({(long)-4, (long)-3, (long)5})));\n assert(candidate((std::vector({(long)4, (long)-4, (long)4})), (2)) == (std::vector({(long)4, (long)4})));\n assert(candidate((std::vector({(long)-3, (long)2, (long)1, (long)2, (long)-1, (long)-2, (long)1})), (1)) == (std::vector({(long)2})));\n assert(candidate((std::vector({(long)123, (long)-123, (long)20, (long)0, (long)1, (long)2, (long)-3})), (3)) == (std::vector({(long)2, (long)20, (long)123})));\n assert(candidate((std::vector({(long)-123, (long)20, (long)0, (long)1, (long)2, (long)-3})), (4)) == (std::vector({(long)0, (long)1, (long)2, (long)20})));\n assert(candidate((std::vector({(long)5, (long)15, (long)0, (long)3, (long)-13, (long)-8, (long)0})), (7)) == (std::vector({(long)-13, (long)-8, (long)0, (long)0, (long)3, (long)5, (long)15})));\n assert(candidate((std::vector({(long)-1, (long)0, (long)2, (long)5, (long)3, (long)-10})), (2)) == (std::vector({(long)3, (long)5})));\n assert(candidate((std::vector({(long)1, (long)0, (long)5, (long)-7})), (1)) == (std::vector({(long)5})));\n assert(candidate((std::vector({(long)4, (long)-4})), (2)) == (std::vector({(long)-4, (long)4})));\n assert(candidate((std::vector({(long)-10, (long)10})), (2)) == (std::vector({(long)-10, (long)10})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)-23, (long)243, (long)-400, (long)0})), (0)) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that takes a message, and encodes in such a \n// way that it swaps case of all letters, replaces all vowels in \n// the message with the letter that appears 2 places ahead of that \n// vowel in the english alphabet. \n// Assume only letters. \n// Examples:\nstd::string encode(std::string message) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = encode;\n assert(candidate((\"TEST\")) == (\"tgst\"));\n assert(candidate((\"Mudasir\")) == (\"mWDCSKR\"));\n assert(candidate((\"YES\")) == (\"ygs\"));\n assert(candidate((\"This is a message\")) == (\"tHKS KS C MGSSCGG\"));\n assert(candidate((\"I DoNt KnOw WhAt tO WrItE\")) == (\"k dQnT kNqW wHcT Tq wRkTg\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "cpp", - "prompt": "#include\n#include\n// remove_vowels is a function that takes string and returns string without vowels.\nstd::string remove_vowels(std::string text) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = remove_vowels;\n assert(candidate((\"\")) == (\"\"));\n assert(candidate((\"abcdef\\nghijklm\")) == (\"bcdf\\nghjklm\"));\n assert(candidate((\"fedcba\")) == (\"fdcb\"));\n assert(candidate((\"eeeee\")) == (\"\"));\n assert(candidate((\"acBAA\")) == (\"cB\"));\n assert(candidate((\"EcBOO\")) == (\"cB\"));\n assert(candidate((\"ybcd\")) == (\"ybcd\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "cpp", - "prompt": "#include\n#include\n// Return only positive numbers in the list.\nstd::vector get_positive(std::vector l) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = get_positive;\n assert(candidate((std::vector({(long)-1, (long)-2, (long)4, (long)5, (long)6}))) == (std::vector({(long)4, (long)5, (long)6})));\n assert(candidate((std::vector({(long)5, (long)3, (long)-5, (long)2, (long)3, (long)3, (long)9, (long)0, (long)123, (long)1, (long)-10}))) == (std::vector({(long)5, (long)3, (long)2, (long)3, (long)3, (long)9, (long)123, (long)1})));\n assert(candidate((std::vector({(long)-1, (long)-2}))) == (std::vector()));\n assert(candidate((std::vector())) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "cpp", - "prompt": "#include\n#include\n// Return a string containing space-delimited numbers starting from 0 upto n inclusive.\nstd::string string_sequence(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = string_sequence;\n assert(candidate((0)) == (\"0\"));\n assert(candidate((3)) == (\"0 1 2 3\"));\n assert(candidate((10)) == (\"0 1 2 3 4 5 6 7 8 9 10\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "cpp", - "prompt": "#include\n#include\n// Given a positive integer n, you have to make a pile of n levels of stones.\n// The first level has n stones.\n// The number of stones in the next level is:\n// - the next odd number if n is odd.\n// - the next even number if n is even.\n// Return the number of stones in each level in a list, where element at index\n// i represents the number of stones in the level (i+1).\n// Examples:\nstd::vector make_a_pile(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = make_a_pile;\n assert(candidate((3)) == (std::vector({(long)3, (long)5, (long)7})));\n assert(candidate((4)) == (std::vector({(long)4, (long)6, (long)8, (long)10})));\n assert(candidate((5)) == (std::vector({(long)5, (long)7, (long)9, (long)11, (long)13})));\n assert(candidate((6)) == (std::vector({(long)6, (long)8, (long)10, (long)12, (long)14, (long)16})));\n assert(candidate((8)) == (std::vector({(long)8, (long)10, (long)12, (long)14, (long)16, (long)18, (long)20, (long)22})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "cpp", - "prompt": "#include\n#include\n// Task\n// 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\n// then check if the result string is palindrome.\n// A string is called palindrome if it reads the same backward as forward.\n// You should return a tuple containing the result string and True/False for the check.\n// Example\nstd::tuple reverse_delete(std::string s, std::string c) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = reverse_delete;\n assert(candidate((\"abcde\"), (\"ae\")) == (std::make_tuple(\"bcd\", false)));\n assert(candidate((\"abcdef\"), (\"b\")) == (std::make_tuple(\"acdef\", false)));\n assert(candidate((\"abcdedcba\"), (\"ab\")) == (std::make_tuple(\"cdedc\", true)));\n assert(candidate((\"dwik\"), (\"w\")) == (std::make_tuple(\"dik\", false)));\n assert(candidate((\"a\"), (\"a\")) == (std::make_tuple(\"\", true)));\n assert(candidate((\"abcdedcba\"), (\"\")) == (std::make_tuple(\"abcdedcba\", true)));\n assert(candidate((\"abcdedcba\"), (\"v\")) == (std::make_tuple(\"abcdedcba\", true)));\n assert(candidate((\"vabba\"), (\"v\")) == (std::make_tuple(\"abba\", true)));\n assert(candidate((\"mamma\"), (\"mia\")) == (std::make_tuple(\"\", true)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "cpp", - "prompt": "#include\n#include\n// For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\nstd::string flip_case(std::string string) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = flip_case;\n assert(candidate((\"\")) == (\"\"));\n assert(candidate((\"Hello!\")) == (\"hELLO!\"));\n assert(candidate((\"These violent delights have violent ends\")) == (\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a string s.\n// if s[i] is a letter, reverse its case from lower to upper or vise versa, \n// otherwise keep it as it is.\n// If the string contains no letters, reverse the string.\n// The function should return the resulted string.\n// Examples\nstd::string solve(std::string s) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = solve;\n assert(candidate((\"AsDf\")) == (\"aSdF\"));\n assert(candidate((\"1234\")) == (\"4321\"));\n assert(candidate((\"ab\")) == (\"AB\"));\n assert(candidate((\"#a@C\")) == (\"#A@c\"));\n assert(candidate((\"#AsdfW^45\")) == (\"#aSDFw^45\"));\n assert(candidate((\"#6@2\")) == (\"2@6#\"));\n assert(candidate((\"#$a^D\")) == (\"#$A^d\"));\n assert(candidate((\"#ccc\")) == (\"#CCC\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "cpp", - "prompt": "#include\n#include\n// Filter an input list of strings only for ones that start with a given prefix.\nstd::vector filter_by_prefix(std::vector strings, std::string prefix) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = filter_by_prefix;\n assert(candidate((std::vector()), (\"john\")) == (std::vector()));\n assert(candidate((std::vector({(std::string)\"xxx\", (std::string)\"asd\", (std::string)\"xxy\", (std::string)\"john doe\", (std::string)\"xxxAAA\", (std::string)\"xxx\"})), (\"xxx\")) == (std::vector({(std::string)\"xxx\", (std::string)\"xxxAAA\", (std::string)\"xxx\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "cpp", - "prompt": "#include\n#include\n// This function takes two positive numbers x and y and returns the\n// biggest even integer number that is in the range [x, y] inclusive. If \n// there's no such number, then the function should return -1.\n// For example:\nlong choose_num(long x, long y) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = choose_num;\n assert(candidate((12), (15)) == (14));\n assert(candidate((13), (12)) == (-1));\n assert(candidate((33), (12354)) == (12354));\n assert(candidate((5234), (5233)) == (-1));\n assert(candidate((6), (29)) == (28));\n assert(candidate((27), (10)) == (-1));\n assert(candidate((7), (7)) == (-1));\n assert(candidate((546), (546)) == (546));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a string representing a sentence,\n// the sentence contains some words separated by a space,\n// and you have to return a string that contains the words from the original sentence,\n// whose lengths are prime numbers,\n// the order of the words in the new string should be the same as the original one.\n// Example 1:\n// Example 2:\n// Constraints:\n// * 1 <= len(sentence) <= 100\n// * sentence contains only letters\nstd::string words_in_sentence(std::string sentence) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = words_in_sentence;\n assert(candidate((\"This is a test\")) == (\"is\"));\n assert(candidate((\"lets go for swimming\")) == (\"go for\"));\n assert(candidate((\"there is no place available here\")) == (\"there is no place\"));\n assert(candidate((\"Hi I am Hussein\")) == (\"Hi am Hussein\"));\n assert(candidate((\"go for it\")) == (\"go for it\"));\n assert(candidate((\"here\")) == (\"\"));\n assert(candidate((\"here is\")) == (\"is\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "cpp", - "prompt": "#include\n#include\n// Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\nstd::vector intersperse(std::vector numbers, long delimeter) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = intersperse;\n assert(candidate((std::vector()), (7)) == (std::vector()));\n assert(candidate((std::vector({(long)5, (long)6, (long)3, (long)2})), (8)) == (std::vector({(long)5, (long)8, (long)6, (long)8, (long)3, (long)8, (long)2})));\n assert(candidate((std::vector({(long)2, (long)2, (long)2})), (2)) == (std::vector({(long)2, (long)2, (long)2, (long)2, (long)2})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "cpp", - "prompt": "#include\n#include\n// Your task is to write a function that returns true if a number x is a simple\n// power of n and false in other cases.\n// x is a simple power of n if n**int=x\n// For example:\nbool is_simple_power(long x, long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = is_simple_power;\n assert(candidate((16), (2)) == (true));\n assert(candidate((143214), (16)) == (false));\n assert(candidate((4), (2)) == (true));\n assert(candidate((9), (3)) == (true));\n assert(candidate((16), (4)) == (true));\n assert(candidate((24), (2)) == (false));\n assert(candidate((128), (4)) == (false));\n assert(candidate((12), (6)) == (false));\n assert(candidate((1), (1)) == (true));\n assert(candidate((1), (12)) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that returns true if the given number is the multiplication of 3 prime numbers\n// and false otherwise.\n// Knowing that (a) is less then 100. \n// Example:\n// 30 = 2 * 3 * 5\nbool is_multiply_prime(long a) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = is_multiply_prime;\n assert(candidate((5)) == (false));\n assert(candidate((30)) == (true));\n assert(candidate((8)) == (true));\n assert(candidate((10)) == (false));\n assert(candidate((125)) == (true));\n assert(candidate((105)) == (true));\n assert(candidate((126)) == (false));\n assert(candidate((729)) == (false));\n assert(candidate((891)) == (false));\n assert(candidate((1001)) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "cpp", - "prompt": "#include\n#include\n// Given the lengths of the three sides of a triangle. Return True if the three\n// sides form a right-angled triangle, False otherwise.\n// A right-angled triangle is a triangle in which one angle is right angle or \n// 90 degree.\n// Example:\nbool right_angle_triangle(long a, long b, long c) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = right_angle_triangle;\n assert(candidate((3), (4), (5)) == (true));\n assert(candidate((1), (2), (3)) == (false));\n assert(candidate((10), (6), (8)) == (true));\n assert(candidate((2), (2), (2)) == (false));\n assert(candidate((7), (24), (25)) == (true));\n assert(candidate((10), (5), (7)) == (false));\n assert(candidate((5), (12), (13)) == (true));\n assert(candidate((15), (8), (17)) == (true));\n assert(candidate((48), (55), (73)) == (true));\n assert(candidate((1), (1), (1)) == (false));\n assert(candidate((2), (2), (10)) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function that takes 3 numbers.\n// Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n// Returns false in any other cases.\n// Examples\nbool any_int(float x, float y, float z) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = any_int;\n assert(candidate((float(2)), (float(3)), (float(1))) == (true));\n assert(candidate((2.5), (float(2)), (float(3))) == (false));\n assert(candidate((1.5), (float(5)), (3.5)) == (false));\n assert(candidate((float(2)), (float(6)), (float(2))) == (false));\n assert(candidate((float(4)), (float(2)), (float(2))) == (true));\n assert(candidate((2.2), (2.2), (2.2)) == (false));\n assert(candidate((float(-4)), (float(6)), (float(2))) == (true));\n assert(candidate((float(2)), (float(1)), (float(1))) == (true));\n assert(candidate((float(3)), (float(4)), (float(7))) == (true));\n assert(candidate((3.0), (float(4)), (float(7))) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "cpp", - "prompt": "#include\n#include\n// This function takes a list l and returns a list l' such that\n// l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n// to the values of the corresponding indicies of l, but sorted.\nstd::vector sort_third(std::vector l) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = sort_third;\n assert(candidate((std::vector({(long)5, (long)6, (long)3, (long)4, (long)8, (long)9, (long)2}))) == (std::vector({(long)2, (long)6, (long)3, (long)4, (long)8, (long)9, (long)5})));\n assert(candidate((std::vector({(long)5, (long)8, (long)3, (long)4, (long)6, (long)9, (long)2}))) == (std::vector({(long)2, (long)8, (long)3, (long)4, (long)6, (long)9, (long)5})));\n assert(candidate((std::vector({(long)5, (long)6, (long)9, (long)4, (long)8, (long)3, (long)2}))) == (std::vector({(long)2, (long)6, (long)9, (long)4, (long)8, (long)3, (long)5})));\n assert(candidate((std::vector({(long)5, (long)6, (long)3, (long)4, (long)8, (long)9, (long)2, (long)1}))) == (std::vector({(long)2, (long)6, (long)3, (long)4, (long)8, (long)9, (long)5, (long)1})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_53_add", - "language": "cpp", - "prompt": "#include\n#include\n// Add two numbers x and y\nlong add(long x, long y) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = add;\n assert(candidate((0), (1)) == (1));\n assert(candidate((1), (0)) == (1));\n assert(candidate((2), (3)) == (5));\n assert(candidate((5), (7)) == (12));\n assert(candidate((7), (5)) == (12));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_69_search", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n// zero, and has a frequency greater than or equal to the value of the integer itself. \n// The frequency of an integer is the number of times it appears in the list.\n// If no such a value exist, return -1.\n// Examples:\nlong search(std::vector lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = search;\n assert(candidate((std::vector({(long)5, (long)5, (long)5, (long)5, (long)1}))) == (1));\n assert(candidate((std::vector({(long)4, (long)1, (long)4, (long)1, (long)4, (long)4}))) == (4));\n assert(candidate((std::vector({(long)3, (long)3}))) == (-1));\n assert(candidate((std::vector({(long)8, (long)8, (long)8, (long)8, (long)8, (long)8, (long)8, (long)8}))) == (8));\n assert(candidate((std::vector({(long)2, (long)3, (long)3, (long)2, (long)2}))) == (2));\n assert(candidate((std::vector({(long)2, (long)7, (long)8, (long)8, (long)4, (long)8, (long)7, (long)3, (long)9, (long)6, (long)5, (long)10, (long)4, (long)3, (long)6, (long)7, (long)1, (long)7, (long)4, (long)10, (long)8, (long)1}))) == (1));\n assert(candidate((std::vector({(long)3, (long)2, (long)8, (long)2}))) == (2));\n assert(candidate((std::vector({(long)6, (long)7, (long)1, (long)8, (long)8, (long)10, (long)5, (long)8, (long)5, (long)3, (long)10}))) == (1));\n assert(candidate((std::vector({(long)8, (long)8, (long)3, (long)6, (long)5, (long)6, (long)4}))) == (-1));\n assert(candidate((std::vector({(long)6, (long)9, (long)6, (long)7, (long)1, (long)4, (long)7, (long)1, (long)8, (long)8, (long)9, (long)8, (long)10, (long)10, (long)8, (long)4, (long)10, (long)4, (long)10, (long)1, (long)2, (long)9, (long)5, (long)7, (long)9}))) == (1));\n assert(candidate((std::vector({(long)1, (long)9, (long)10, (long)1, (long)3}))) == (1));\n assert(candidate((std::vector({(long)6, (long)9, (long)7, (long)5, (long)8, (long)7, (long)5, (long)3, (long)7, (long)5, (long)10, (long)10, (long)3, (long)6, (long)10, (long)2, (long)8, (long)6, (long)5, (long)4, (long)9, (long)5, (long)3, (long)10}))) == (5));\n assert(candidate((std::vector({(long)1}))) == (1));\n assert(candidate((std::vector({(long)8, (long)8, (long)10, (long)6, (long)4, (long)3, (long)5, (long)8, (long)2, (long)4, (long)2, (long)8, (long)4, (long)6, (long)10, (long)4, (long)2, (long)1, (long)10, (long)2, (long)1, (long)1, (long)5}))) == (4));\n assert(candidate((std::vector({(long)2, (long)10, (long)4, (long)8, (long)2, (long)10, (long)5, (long)1, (long)2, (long)9, (long)5, (long)5, (long)6, (long)3, (long)8, (long)6, (long)4, (long)10}))) == (2));\n assert(candidate((std::vector({(long)1, (long)6, (long)10, (long)1, (long)6, (long)9, (long)10, (long)8, (long)6, (long)8, (long)7, (long)3}))) == (1));\n assert(candidate((std::vector({(long)9, (long)2, (long)4, (long)1, (long)5, (long)1, (long)5, (long)2, (long)5, (long)7, (long)7, (long)7, (long)3, (long)10, (long)1, (long)5, (long)4, (long)2, (long)8, (long)4, (long)1, (long)9, (long)10, (long)7, (long)10, (long)2, (long)8, (long)10, (long)9, (long)4}))) == (4));\n assert(candidate((std::vector({(long)2, (long)6, (long)4, (long)2, (long)8, (long)7, (long)5, (long)6, (long)4, (long)10, (long)4, (long)6, (long)3, (long)7, (long)8, (long)8, (long)3, (long)1, (long)4, (long)2, (long)2, (long)10, (long)7}))) == (4));\n assert(candidate((std::vector({(long)9, (long)8, (long)6, (long)10, (long)2, (long)6, (long)10, (long)2, (long)7, (long)8, (long)10, (long)3, (long)8, (long)2, (long)6, (long)2, (long)3, (long)1}))) == (2));\n assert(candidate((std::vector({(long)5, (long)5, (long)3, (long)9, (long)5, (long)6, (long)3, (long)2, (long)8, (long)5, (long)6, (long)10, (long)10, (long)6, (long)8, (long)4, (long)10, (long)7, (long)7, (long)10, (long)8}))) == (-1));\n assert(candidate((std::vector({(long)10}))) == (-1));\n assert(candidate((std::vector({(long)9, (long)7, (long)7, (long)2, (long)4, (long)7, (long)2, (long)10, (long)9, (long)7, (long)5, (long)7, (long)2}))) == (2));\n assert(candidate((std::vector({(long)5, (long)4, (long)10, (long)2, (long)1, (long)1, (long)10, (long)3, (long)6, (long)1, (long)8}))) == (1));\n assert(candidate((std::vector({(long)7, (long)9, (long)9, (long)9, (long)3, (long)4, (long)1, (long)5, (long)9, (long)1, (long)2, (long)1, (long)1, (long)10, (long)7, (long)5, (long)6, (long)7, (long)6, (long)7, (long)7, (long)6}))) == (1));\n assert(candidate((std::vector({(long)3, (long)10, (long)10, (long)9, (long)2}))) == (-1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that takes a string and returns True if the string\n// length is a prime number or False otherwise\n// Examples\nbool prime_length(std::string string) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = prime_length;\n assert(candidate((\"Hello\")) == (true));\n assert(candidate((\"abcdcba\")) == (true));\n assert(candidate((\"kittens\")) == (true));\n assert(candidate((\"orange\")) == (false));\n assert(candidate((\"wow\")) == (true));\n assert(candidate((\"world\")) == (true));\n assert(candidate((\"MadaM\")) == (true));\n assert(candidate((\"Wow\")) == (true));\n assert(candidate((\"\")) == (false));\n assert(candidate((\"HI\")) == (true));\n assert(candidate((\"go\")) == (true));\n assert(candidate((\"gogo\")) == (false));\n assert(candidate((\"aaaaaaaaaaaaaaa\")) == (false));\n assert(candidate((\"Madam\")) == (true));\n assert(candidate((\"M\")) == (false));\n assert(candidate((\"0\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_58_common", - "language": "cpp", - "prompt": "#include\n#include\n// Return sorted unique common elements for two lists.\nstd::vector common(std::vector l1, std::vector l2) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = common;\n assert(candidate((std::vector({(long)1, (long)4, (long)3, (long)34, (long)653, (long)2, (long)5})), (std::vector({(long)5, (long)7, (long)1, (long)5, (long)9, (long)653, (long)121}))) == (std::vector({(long)1, (long)5, (long)653})));\n assert(candidate((std::vector({(long)5, (long)3, (long)2, (long)8})), (std::vector({(long)3, (long)2}))) == (std::vector({(long)2, (long)3})));\n assert(candidate((std::vector({(long)4, (long)3, (long)2, (long)8})), (std::vector({(long)3, (long)2, (long)4}))) == (std::vector({(long)2, (long)3, (long)4})));\n assert(candidate((std::vector({(long)4, (long)3, (long)2, (long)8})), (std::vector())) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "cpp", - "prompt": "#include\n#include\n// The Brazilian factorial is defined as:\n// brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n// where n > 0\n// For example:\n// The function will receive an integer as input and should return the special\n// factorial of this integer.\nlong special_factorial(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = special_factorial;\n assert(candidate((4)) == (288));\n assert(candidate((5)) == (34560));\n assert(candidate((7)) == (125411328000));\n assert(candidate((1)) == (1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "cpp", - "prompt": "#include\n#include\n// In this problem, you will implement a function that takes two lists of numbers,\n// and determines whether it is possible to perform an exchange of elements\n// between them to make lst1 a list of only even numbers.\n// There is no limit on the number of exchanged elements between lst1 and lst2.\n// If it is possible to exchange elements between the lst1 and lst2 to make\n// all the elements of lst1 to be even, return \"YES\".\n// Otherwise, return \"NO\".\n// For example:\n// It is assumed that the input lists will be non-empty.\nstd::string exchange(std::vector lst1, std::vector lst2) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = exchange;\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4})), (std::vector({(long)1, (long)2, (long)3, (long)4}))) == (\"YES\"));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4})), (std::vector({(long)1, (long)5, (long)3, (long)4}))) == (\"NO\"));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4})), (std::vector({(long)2, (long)1, (long)4, (long)3}))) == (\"YES\"));\n assert(candidate((std::vector({(long)5, (long)7, (long)3})), (std::vector({(long)2, (long)6, (long)4}))) == (\"YES\"));\n assert(candidate((std::vector({(long)5, (long)7, (long)3})), (std::vector({(long)2, (long)6, (long)3}))) == (\"NO\"));\n assert(candidate((std::vector({(long)3, (long)2, (long)6, (long)1, (long)8, (long)9})), (std::vector({(long)3, (long)5, (long)5, (long)1, (long)1, (long)1}))) == (\"NO\"));\n assert(candidate((std::vector({(long)100, (long)200})), (std::vector({(long)200, (long)200}))) == (\"YES\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "cpp", - "prompt": "#include\n#include\n// Given a non-empty array of integers arr and an integer k, return\n// the sum of the elements with at most two digits from the first k elements of arr.\n// Example:\n// Constraints:\n// 1. 1 <= len(arr) <= 100\n// 2. 1 <= k <= len(arr)\nlong add_elements(std::vector arr, long k) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = add_elements;\n assert(candidate((std::vector({(long)1, (long)-2, (long)-3, (long)41, (long)57, (long)76, (long)87, (long)88, (long)99})), (3)) == (-4));\n assert(candidate((std::vector({(long)111, (long)121, (long)3, (long)4000, (long)5, (long)6})), (2)) == (0));\n assert(candidate((std::vector({(long)11, (long)21, (long)3, (long)90, (long)5, (long)6, (long)7, (long)8, (long)9})), (4)) == (125));\n assert(candidate((std::vector({(long)111, (long)21, (long)3, (long)4000, (long)5, (long)6, (long)7, (long)8, (long)9})), (4)) == (24));\n assert(candidate((std::vector({(long)1})), (1)) == (1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "cpp", - "prompt": "#include\n#include\n// A simple program which should return the value of x if n is \n// a prime number and should return the value of y otherwise.\n// Examples:\nlong x_or_y(long n, long x, long y) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = x_or_y;\n assert(candidate((7), (34), (12)) == (34));\n assert(candidate((15), (8), (5)) == (5));\n assert(candidate((3), (33), (5212)) == (33));\n assert(candidate((1259), (3), (52)) == (3));\n assert(candidate((7919), (-1), (12)) == (-1));\n assert(candidate((3609), (1245), (583)) == (583));\n assert(candidate((91), (56), (129)) == (129));\n assert(candidate((6), (34), (1234)) == (1234));\n assert(candidate((1), (2), (0)) == (0));\n assert(candidate((2), (2), (0)) == (2));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "cpp", - "prompt": "#include\n#include\n// Given length of a side and high return area for a triangle.\nfloat triangle_area(long a, long h) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = triangle_area;\n assert(candidate((5), (3)) == (7.5));\n assert(candidate((2), (2)) == (2.0));\n assert(candidate((10), (8)) == (40.0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "cpp", - "prompt": "#include\n#include\n// Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n// the last couple centuries. However, what people don't know is Tribonacci sequence.\n// Tribonacci sequence is defined by the recurrence:\n// tri(1) = 3\n// tri(n) = 1 + n / 2, if n is even.\n// tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n// For example:\n// tri(2) = 1 + (2 / 2) = 2\n// tri(4) = 3\n// tri(3) = tri(2) + tri(1) + tri(4)\n// = 2 + 3 + 3 = 8 \n// You are given a non-negative integer number n, you have to a return a list of the \n// first n + 1 numbers of the Tribonacci sequence.\n// Examples:\nstd::vector tri(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = tri;\n assert(candidate((3)) == (std::vector({(long)1, (long)3, (long)2, (long)8})));\n assert(candidate((4)) == (std::vector({(long)1, (long)3, (long)2, (long)8, (long)3})));\n assert(candidate((5)) == (std::vector({(long)1, (long)3, (long)2, (long)8, (long)3, (long)15})));\n assert(candidate((6)) == (std::vector({(long)1, (long)3, (long)2, (long)8, (long)3, (long)15, (long)4})));\n assert(candidate((7)) == (std::vector({(long)1, (long)3, (long)2, (long)8, (long)3, (long)15, (long)4, (long)24})));\n assert(candidate((8)) == (std::vector({(long)1, (long)3, (long)2, (long)8, (long)3, (long)15, (long)4, (long)24, (long)5})));\n assert(candidate((9)) == (std::vector({(long)1, (long)3, (long)2, (long)8, (long)3, (long)15, (long)4, (long)24, (long)5, (long)35})));\n assert(candidate((20)) == (std::vector({(long)1, (long)3, (long)2, (long)8, (long)3, (long)15, (long)4, (long)24, (long)5, (long)35, (long)6, (long)48, (long)7, (long)63, (long)8, (long)80, (long)9, (long)99, (long)10, (long)120, (long)11})));\n assert(candidate((0)) == (std::vector({(long)1})));\n assert(candidate((1)) == (std::vector({(long)1, (long)3})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a list of two strings, both strings consist of open\n// parentheses '(' or close parentheses ')' only.\n// Your job is to check if it is possible to concatenate the two strings in\n// some order, that the resulting string will be good.\n// A string S is considered to be good if and only if all parentheses in S\n// are balanced. For example: the string '(())()' is good, while the string\n// '())' is not.\n// Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n// Examples:\nstd::string match_parens(std::vector lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = match_parens;\n assert(candidate((std::vector({(std::string)\"()(\", (std::string)\")\"}))) == (\"Yes\"));\n assert(candidate((std::vector({(std::string)\")\", (std::string)\")\"}))) == (\"No\"));\n assert(candidate((std::vector({(std::string)\"(()(())\", (std::string)\"())())\"}))) == (\"No\"));\n assert(candidate((std::vector({(std::string)\")())\", (std::string)\"(()()(\"}))) == (\"Yes\"));\n assert(candidate((std::vector({(std::string)\"(())))\", (std::string)\"(()())((\"}))) == (\"Yes\"));\n assert(candidate((std::vector({(std::string)\"()\", (std::string)\"())\"}))) == (\"No\"));\n assert(candidate((std::vector({(std::string)\"(()(\", (std::string)\"()))()\"}))) == (\"Yes\"));\n assert(candidate((std::vector({(std::string)\"((((\", (std::string)\"((())\"}))) == (\"No\"));\n assert(candidate((std::vector({(std::string)\")(()\", (std::string)\"(()(\"}))) == (\"No\"));\n assert(candidate((std::vector({(std::string)\")(\", (std::string)\")(\"}))) == (\"No\"));\n assert(candidate((std::vector({(std::string)\"(\", (std::string)\")\"}))) == (\"Yes\"));\n assert(candidate((std::vector({(std::string)\")\", (std::string)\"(\"}))) == (\"Yes\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "cpp", - "prompt": "#include\n#include\n// From a list of integers, remove all elements that occur more than once.\n// Keep order of elements left the same as in the input.\nstd::vector remove_duplicates(std::vector numbers) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = remove_duplicates;\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4}))) == (std::vector({(long)1, (long)2, (long)3, (long)4})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)2, (long)4, (long)3, (long)5}))) == (std::vector({(long)1, (long)4, (long)5})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "cpp", - "prompt": "#include\n#include\n// Return a greatest common divisor of two integers a and b\nlong greatest_common_divisor(long a, long b) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = greatest_common_divisor;\n assert(candidate((3), (7)) == (1));\n assert(candidate((10), (15)) == (5));\n assert(candidate((49), (14)) == (7));\n assert(candidate((144), (60)) == (12));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "cpp", - "prompt": "#include\n#include\n// Checks if given string is a palindrome\nbool is_palindrome(std::string text) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = is_palindrome;\n assert(candidate((\"\")) == (true));\n assert(candidate((\"aba\")) == (true));\n assert(candidate((\"aaaaa\")) == (true));\n assert(candidate((\"zbcd\")) == (false));\n assert(candidate((\"xywyx\")) == (true));\n assert(candidate((\"xywyz\")) == (false));\n assert(candidate((\"xywzx\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "cpp", - "prompt": "#include\n#include\n// xs represent coefficients of a polynomial.\n// xs[0] + xs[1] * x + xs[2] * x^2 + ....\n// Return derivative of this polynomial in the same form.\nstd::vector derivative(std::vector xs) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = derivative;\n assert(candidate((std::vector({(long)3, (long)1, (long)2, (long)4, (long)5}))) == (std::vector({(long)1, (long)4, (long)12, (long)20})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3}))) == (std::vector({(long)2, (long)6})));\n assert(candidate((std::vector({(long)3, (long)2, (long)1}))) == (std::vector({(long)2, (long)2})));\n assert(candidate((std::vector({(long)3, (long)2, (long)1, (long)0, (long)4}))) == (std::vector({(long)2, (long)2, (long)0, (long)16})));\n assert(candidate((std::vector({(long)1}))) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "cpp", - "prompt": "#include\n#include\n// In this task, you will be given a string that represents a number of apples and oranges \n// that are distributed in a basket of fruit this basket contains \n// apples, oranges, and mango fruits. Given the string that represents the total number of \n// the oranges and apples and an integer that represent the total number of the fruits \n// in the basket return the number of the mango fruits in the basket.\n// for examble:\nlong fruit_distribution(std::string s, long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = fruit_distribution;\n assert(candidate((\"5 apples and 6 oranges\"), (19)) == (8));\n assert(candidate((\"5 apples and 6 oranges\"), (21)) == (10));\n assert(candidate((\"0 apples and 1 oranges\"), (3)) == (2));\n assert(candidate((\"1 apples and 0 oranges\"), (3)) == (2));\n assert(candidate((\"2 apples and 3 oranges\"), (100)) == (95));\n assert(candidate((\"2 apples and 3 oranges\"), (5)) == (0));\n assert(candidate((\"1 apples and 100 oranges\"), (120)) == (19));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that takes an integer a and returns True \n// if this ingeger is a cube of some integer number.\n// Note: you may assume the input is always valid.\n// Examples:\nbool iscube(long a) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = iscube;\n assert(candidate((1)) == (true));\n assert(candidate((2)) == (false));\n assert(candidate((-1)) == (true));\n assert(candidate((64)) == (true));\n assert(candidate((180)) == (false));\n assert(candidate((1000)) == (true));\n assert(candidate((0)) == (true));\n assert(candidate((1729)) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "cpp", - "prompt": "#include\n#include\n// In this Kata, you have to sort an array of non-negative integers according to\n// number of ones in their binary representation in ascending order.\n// For similar number of ones, sort based on decimal value.\n// It must be implemented like this:\nstd::vector sort_array(std::vector arr) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = sort_array;\n assert(candidate((std::vector({(long)1, (long)5, (long)2, (long)3, (long)4}))) == (std::vector({(long)1, (long)2, (long)4, (long)3, (long)5})));\n assert(candidate((std::vector({(long)-2, (long)-3, (long)-4, (long)-5, (long)-6}))) == (std::vector({(long)-4, (long)-2, (long)-6, (long)-5, (long)-3})));\n assert(candidate((std::vector({(long)1, (long)0, (long)2, (long)3, (long)4}))) == (std::vector({(long)0, (long)1, (long)2, (long)4, (long)3})));\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)2, (long)5, (long)77, (long)4, (long)5, (long)3, (long)5, (long)7, (long)2, (long)3, (long)4}))) == (std::vector({(long)2, (long)2, (long)4, (long)4, (long)3, (long)3, (long)5, (long)5, (long)5, (long)7, (long)77})));\n assert(candidate((std::vector({(long)3, (long)6, (long)44, (long)12, (long)32, (long)5}))) == (std::vector({(long)32, (long)3, (long)5, (long)6, (long)12, (long)44})));\n assert(candidate((std::vector({(long)2, (long)4, (long)8, (long)16, (long)32}))) == (std::vector({(long)2, (long)4, (long)8, (long)16, (long)32})));\n assert(candidate((std::vector({(long)2, (long)4, (long)8, (long)16, (long)32}))) == (std::vector({(long)2, (long)4, (long)8, (long)16, (long)32})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "cpp", - "prompt": "#include\n#include\n// Given a list of strings, where each string consists of only digits, return a list.\n// Each element i of the output should be \"the number of odd elements in the\n// string i of the input.\" where all the i's should be replaced by the number\n// of odd digits in the i'th string of the input.\nstd::vector odd_count(std::vector lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = odd_count;\n assert(candidate((std::vector({(std::string)\"1234567\"}))) == (std::vector({(std::string)\"the number of odd elements 4n the str4ng 4 of the 4nput.\"})));\n assert(candidate((std::vector({(std::string)\"3\", (std::string)\"11111111\"}))) == (std::vector({(std::string)\"the number of odd elements 1n the str1ng 1 of the 1nput.\", (std::string)\"the number of odd elements 8n the str8ng 8 of the 8nput.\"})));\n assert(candidate((std::vector({(std::string)\"271\", (std::string)\"137\", (std::string)\"314\"}))) == (std::vector({(std::string)\"the number of odd elements 2n the str2ng 2 of the 2nput.\", (std::string)\"the number of odd elements 3n the str3ng 3 of the 3nput.\", (std::string)\"the number of odd elements 2n the str2ng 2 of the 2nput.\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "cpp", - "prompt": "#include\n#include\n// brackets is a string of \"(\" and \")\".\n// return True if every opening bracket has a corresponding closing bracket.\nbool correct_bracketing(std::string brackets) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = correct_bracketing;\n assert(candidate((\"()\")) == (true));\n assert(candidate((\"(()())\")) == (true));\n assert(candidate((\"()()(()())()\")) == (true));\n assert(candidate((\"()()((()()())())(()()(()))\")) == (true));\n assert(candidate((\"((()())))\")) == (false));\n assert(candidate((\")(()\")) == (false));\n assert(candidate((\"(\")) == (false));\n assert(candidate((\"((((\")) == (false));\n assert(candidate((\")\")) == (false));\n assert(candidate((\"(()\")) == (false));\n assert(candidate((\"()()(()())())(()\")) == (false));\n assert(candidate((\"()()(()())()))()\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "cpp", - "prompt": "#include\n#include\n// Task\n// Write a function that takes a string as input and returns the sum of the upper characters only'\n// ASCII codes.\n// Examples:\nlong digitSum(std::string s) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = digitSum;\n assert(candidate((\"\")) == (0));\n assert(candidate((\"abAB\")) == (131));\n assert(candidate((\"abcCd\")) == (67));\n assert(candidate((\"helloE\")) == (69));\n assert(candidate((\"woArBld\")) == (131));\n assert(candidate((\"aAaaaXa\")) == (153));\n assert(candidate((\" How are yOu?\")) == (151));\n assert(candidate((\"You arE Very Smart\")) == (327));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that accepts a list of strings as a parameter,\n// deletes the strings that have odd lengths from it,\n// and returns the resulted list with a sorted order,\n// The list is always a list of strings and never an array of numbers,\n// and it may contain duplicates.\n// The order of the list should be ascending by length of each word, and you\n// should return the list sorted by that rule.\n// If two words have the same length, sort the list alphabetically.\n// The function should return a list of strings in sorted order.\n// You may assume that all words will have the same length.\n// For example:\nstd::vector sorted_list_sum(std::vector lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = sorted_list_sum;\n assert(candidate((std::vector({(std::string)\"aa\", (std::string)\"a\", (std::string)\"aaa\"}))) == (std::vector({(std::string)\"aa\"})));\n assert(candidate((std::vector({(std::string)\"school\", (std::string)\"AI\", (std::string)\"asdf\", (std::string)\"b\"}))) == (std::vector({(std::string)\"AI\", (std::string)\"asdf\", (std::string)\"school\"})));\n assert(candidate((std::vector({(std::string)\"d\", (std::string)\"b\", (std::string)\"c\", (std::string)\"a\"}))) == (std::vector()));\n assert(candidate((std::vector({(std::string)\"d\", (std::string)\"dcba\", (std::string)\"abcd\", (std::string)\"a\"}))) == (std::vector({(std::string)\"abcd\", (std::string)\"dcba\"})));\n assert(candidate((std::vector({(std::string)\"AI\", (std::string)\"ai\", (std::string)\"au\"}))) == (std::vector({(std::string)\"AI\", (std::string)\"ai\", (std::string)\"au\"})));\n assert(candidate((std::vector({(std::string)\"a\", (std::string)\"b\", (std::string)\"b\", (std::string)\"c\", (std::string)\"c\", (std::string)\"a\"}))) == (std::vector()));\n assert(candidate((std::vector({(std::string)\"aaaa\", (std::string)\"bbbb\", (std::string)\"dd\", (std::string)\"cc\"}))) == (std::vector({(std::string)\"cc\", (std::string)\"dd\", (std::string)\"aaaa\", (std::string)\"bbbb\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "cpp", - "prompt": "#include\n#include\n// You are given an array arr of integers and you need to return\n// sum of magnitudes of integers multiplied by product of all signs\n// of each number in the array, represented by 1, -1 or 0.\n// Note: return None for empty arr.\n// Example:\nstd::optional prod_signs(std::vector arr) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = prod_signs;\n assert(candidate((std::vector({(long)1, (long)2, (long)2, (long)-4}))) == -9);\n assert(candidate((std::vector({(long)0, (long)1}))) == 0);\n assert(candidate((std::vector({(long)1, (long)1, (long)1, (long)2, (long)3, (long)-1, (long)1}))) == -10);\n assert(candidate((std::vector())) == std::nullopt);\n assert(candidate((std::vector({(long)2, (long)4, (long)1, (long)2, (long)-1, (long)-1, (long)9}))) == 20);\n assert(candidate((std::vector({(long)-1, (long)1, (long)-1, (long)1}))) == 4);\n assert(candidate((std::vector({(long)-1, (long)1, (long)1, (long)1}))) == -4);\n assert(candidate((std::vector({(long)-1, (long)1, (long)1, (long)0}))) == 0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "cpp", - "prompt": "#include\n#include\n// Return list with elements incremented by 1.\nstd::vector incr_list(std::vector l) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = incr_list;\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)3, (long)2, (long)1}))) == (std::vector({(long)4, (long)3, (long)2})));\n assert(candidate((std::vector({(long)5, (long)2, (long)5, (long)2, (long)3, (long)3, (long)9, (long)0, (long)123}))) == (std::vector({(long)6, (long)3, (long)6, (long)3, (long)4, (long)4, (long)10, (long)1, (long)124})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "cpp", - "prompt": "#include\n#include\n// From a given list of integers, generate a list of rolling maximum element found until given moment\n// in the sequence.\nstd::vector rolling_max(std::vector numbers) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = rolling_max;\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4}))) == (std::vector({(long)1, (long)2, (long)3, (long)4})));\n assert(candidate((std::vector({(long)4, (long)3, (long)2, (long)1}))) == (std::vector({(long)4, (long)4, (long)4, (long)4})));\n assert(candidate((std::vector({(long)3, (long)2, (long)3, (long)100, (long)3}))) == (std::vector({(long)3, (long)3, (long)3, (long)100, (long)100})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "cpp", - "prompt": "#include\n#include\n// Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n// separate those group into separate strings and return the list of those.\n// Separate groups are balanced (each open brace is properly closed) and not nested within each other\n// Ignore any spaces in the input string.\nstd::vector separate_paren_groups(std::string paren_string) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = separate_paren_groups;\n assert(candidate((\"(()()) ((())) () ((())()())\")) == (std::vector({(std::string)\"(()())\", (std::string)\"((()))\", (std::string)\"()\", (std::string)\"((())()())\"})));\n assert(candidate((\"() (()) ((())) (((())))\")) == (std::vector({(std::string)\"()\", (std::string)\"(())\", (std::string)\"((()))\", (std::string)\"(((())))\"})));\n assert(candidate((\"(()(())((())))\")) == (std::vector({(std::string)\"(()(())((())))\"})));\n assert(candidate((\"( ) (( )) (( )( ))\")) == (std::vector({(std::string)\"()\", (std::string)\"(())\", (std::string)\"(()())\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "cpp", - "prompt": "#include\n#include\n// You will be given a string of words separated by commas or spaces. Your task is\n// to split the string into words and return an array of the words.\n// For example:\nstd::vector words_string(std::string s) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = words_string;\n assert(candidate((\"Hi, my name is John\")) == (std::vector({(std::string)\"Hi\", (std::string)\"my\", (std::string)\"name\", (std::string)\"is\", (std::string)\"John\"})));\n assert(candidate((\"One, two, three, four, five, six\")) == (std::vector({(std::string)\"One\", (std::string)\"two\", (std::string)\"three\", (std::string)\"four\", (std::string)\"five\", (std::string)\"six\"})));\n assert(candidate((\"Hi, my name\")) == (std::vector({(std::string)\"Hi\", (std::string)\"my\", (std::string)\"name\"})));\n assert(candidate((\"One,, two, three, four, five, six,\")) == (std::vector({(std::string)\"One\", (std::string)\"two\", (std::string)\"three\", (std::string)\"four\", (std::string)\"five\", (std::string)\"six\"})));\n assert(candidate((\"\")) == (std::vector()));\n assert(candidate((\"ahmed , gamal\")) == (std::vector({(std::string)\"ahmed\", (std::string)\"gamal\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "cpp", - "prompt": "#include\n#include\nunion Union_long_float_std_string{\n long f0;\n float f1;\n std::string f2; Union_long_float_std_string(long _f0) : f0(_f0) {}\n Union_long_float_std_string(float _f1) : f1(_f1) {}\n Union_long_float_std_string(std::string _f2) : f2(_f2) {}\n ~Union_long_float_std_string() {}\n bool operator==(long f) {\n return f0 == f ;\n } bool operator==(float f) {\n return f1 == f ;\n } bool operator==(std::string f) {\n return f2 == f ;\n }\n};\nunion Union_long_float_std_string_std_nullopt{\n long f0;\n float f1;\n std::string f2;\n std::nullopt f3; Union_long_float_std_string_std_nullopt(long _f0) : f0(_f0) {}\n Union_long_float_std_string_std_nullopt(float _f1) : f1(_f1) {}\n Union_long_float_std_string_std_nullopt(std::string _f2) : f2(_f2) {}\n Union_long_float_std_string_std_nullopt(std::nullopt _f3) : f3(_f3) {}\n ~Union_long_float_std_string_std_nullopt() {}\n bool operator==(long f) {\n return f0 == f ;\n } bool operator==(float f) {\n return f1 == f ;\n } bool operator==(std::string f) {\n return f2 == f ;\n } bool operator==(std::nullopt f) {\n return f3 == f ;\n }\n};\n// Create a function that takes integers, floats, or strings representing\n// real numbers, and returns the larger variable in its given variable type.\n// Return None if the values are equal.\n// Note: If a real number is represented as a string, the floating point might be . or ,\nUnion_long_float_std_string_std_nullopt compare_one(Union_long_float_std_string a, Union_long_float_std_string b) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = compare_one;\n assert(candidate(1, 2) == 2);\n assert(candidate(1, 2.5) == 2.5);\n assert(candidate(2, 3) == 3);\n assert(candidate(5, 6) == 6);\n assert(candidate(1, \"2,3\") == \"2,3\");\n assert(candidate(\"5,1\", \"6\") == \"6\");\n assert(candidate(\"1\", \"2\") == \"2\");\n assert(candidate(\"1\", 1) == std::nullopt);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "cpp", - "prompt": "#include\n#include\n// Filter given list of any python values only for integers\nstd::vector filter_integers(std::vector values) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = filter_integers;\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({4, std::map(), std::vector(), 23.2, 9, \"adasd\"}))) == (std::vector({(long)4, (long)9})));\n assert(candidate((std::vector({3, \"c\", 3, 3, \"a\", \"b\"}))) == (std::vector({(long)3, (long)3, (long)3})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "cpp", - "prompt": "#include\n#include\n// This function takes a list l and returns a list l' such that\n// l' is identical to l in the odd indicies, while its values at the even indicies are equal\n// to the values of the even indicies of l, but sorted.\nstd::vector sort_even(std::vector l) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = sort_even;\n assert(candidate((std::vector({(long)1, (long)2, (long)3}))) == (std::vector({(long)1, (long)2, (long)3})));\n assert(candidate((std::vector({(long)5, (long)3, (long)-5, (long)2, (long)-3, (long)3, (long)9, (long)0, (long)123, (long)1, (long)-10}))) == (std::vector({(long)-10, (long)3, (long)-5, (long)2, (long)-3, (long)3, (long)5, (long)0, (long)9, (long)1, (long)123})));\n assert(candidate((std::vector({(long)5, (long)8, (long)-12, (long)4, (long)23, (long)2, (long)3, (long)11, (long)12, (long)-10}))) == (std::vector({(long)-12, (long)8, (long)3, (long)4, (long)5, (long)2, (long)12, (long)11, (long)23, (long)-10})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "cpp", - "prompt": "#include\n#include\n// I think we all remember that feeling when the result of some long-awaited\n// event is finally known. The feelings and thoughts you have at that moment are\n// definitely worth noting down and comparing.\n// Your task is to determine if a person correctly guessed the results of a number of matches.\n// You are given two arrays of scores and guesses of equal length, where each index shows a match. \n// Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n// the value is 0, and if not, the value is the absolute difference between the guess and the score.\n// example:\nstd::vector compare(std::vector game, std::vector guess) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = compare;\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)1})), (std::vector({(long)1, (long)2, (long)3, (long)4, (long)2, (long)-2}))) == (std::vector({(long)0, (long)0, (long)0, (long)0, (long)3, (long)3})));\n assert(candidate((std::vector({(long)0, (long)0, (long)0, (long)0, (long)0, (long)0})), (std::vector({(long)0, (long)0, (long)0, (long)0, (long)0, (long)0}))) == (std::vector({(long)0, (long)0, (long)0, (long)0, (long)0, (long)0})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3})), (std::vector({(long)-1, (long)-2, (long)-3}))) == (std::vector({(long)2, (long)4, (long)6})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)5})), (std::vector({(long)-1, (long)2, (long)3, (long)4}))) == (std::vector({(long)2, (long)0, (long)0, (long)1})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "cpp", - "prompt": "#include\n#include\n// Given a positive integer n, return a tuple that has the number of even and odd\n// integer palindromes that fall within the range(1, n), inclusive.\n// Example 1:\n// Explanation:\n// Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n// Example 2:\n// Explanation:\n// Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n// Note:\n// 1. 1 <= n <= 10^3\n// 2. returned tuple has the number of even and odd integer palindromes respectively.\nstd::tuple even_odd_palindrome(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = even_odd_palindrome;\n assert(candidate((123)) == (std::make_tuple(8, 13)));\n assert(candidate((12)) == (std::make_tuple(4, 6)));\n assert(candidate((3)) == (std::make_tuple(1, 2)));\n assert(candidate((63)) == (std::make_tuple(6, 8)));\n assert(candidate((25)) == (std::make_tuple(5, 6)));\n assert(candidate((19)) == (std::make_tuple(4, 6)));\n assert(candidate((9)) == (std::make_tuple(4, 5)));\n assert(candidate((1)) == (std::make_tuple(0, 1)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "cpp", - "prompt": "#include\n#include\n// The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fib4(0) -> 0\n// fib4(1) -> 0\n// fib4(2) -> 2\n// fib4(3) -> 0\n// fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n// Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\nlong fib4(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = fib4;\n assert(candidate((5)) == (4));\n assert(candidate((8)) == (28));\n assert(candidate((10)) == (104));\n assert(candidate((12)) == (386));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "cpp", - "prompt": "#include\n#include\n// Given two positive integers a and b, return the even digits between a\n// and b, in ascending order.\n// For example:\nstd::vector generate_integers(long a, long b) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = generate_integers;\n assert(candidate((2), (10)) == (std::vector({(long)2, (long)4, (long)6, (long)8})));\n assert(candidate((10), (2)) == (std::vector({(long)2, (long)4, (long)6, (long)8})));\n assert(candidate((132), (2)) == (std::vector({(long)2, (long)4, (long)6, (long)8})));\n assert(candidate((17), (89)) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "cpp", - "prompt": "#include\n#include\n// For a given list of input numbers, calculate Mean Absolute Deviation\n// around the mean of this dataset.\n// Mean Absolute Deviation is the average absolute difference between each\n// element and a centerpoint (mean in this case):\n// MAD = average | x - x_mean |\nfloat mean_absolute_deviation(std::vector numbers) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = mean_absolute_deviation;\n assert(candidate((std::vector({(float)1.0, (float)2.0}))) == (0.5));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0}))) == (1.0));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0, (float)5.0}))) == (1.2));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function encrypt that takes a string as an argument and\n// returns a string encrypted with the alphabet being rotated. \n// The alphabet should be rotated in a manner such that the letters \n// shift down by two multiplied to two places.\n// For example:\nstd::string encrypt(std::string s) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = encrypt;\n assert(candidate((\"hi\")) == (\"lm\"));\n assert(candidate((\"asdfghjkl\")) == (\"ewhjklnop\"));\n assert(candidate((\"gf\")) == (\"kj\"));\n assert(candidate((\"et\")) == (\"ix\"));\n assert(candidate((\"faewfawefaewg\")) == (\"jeiajeaijeiak\"));\n assert(candidate((\"hellomyfriend\")) == (\"lippsqcjvmirh\"));\n assert(candidate((\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\")) == (\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\"));\n assert(candidate((\"a\")) == (\"e\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "cpp", - "prompt": "#include\n#include\n// Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n// The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n// as follows: start with any positive integer n. Then each term is obtained from the \n// previous term as follows: if the previous term is even, the next term is one half of \n// the previous term. If the previous term is odd, the next term is 3 times the previous\n// term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n// Note: \n// 1. Collatz(1) is [1].\n// 2. returned list sorted in increasing order.\n// For example:\n// get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\nstd::vector get_odd_collatz(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = get_odd_collatz;\n assert(candidate((14)) == (std::vector({(long)1, (long)5, (long)7, (long)11, (long)13, (long)17})));\n assert(candidate((5)) == (std::vector({(long)1, (long)5})));\n assert(candidate((12)) == (std::vector({(long)1, (long)3, (long)5})));\n assert(candidate((1)) == (std::vector({(long)1})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "cpp", - "prompt": "#include\n#include\n// Find how many times a given substring can be found in the original string. Count overlaping cases.\nlong how_many_times(std::string string, std::string substring) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = how_many_times;\n assert(candidate((\"\"), (\"x\")) == (0));\n assert(candidate((\"xyxyxyx\"), (\"x\")) == (4));\n assert(candidate((\"cacacacac\"), (\"cac\")) == (4));\n assert(candidate((\"john doe\"), (\"john\")) == (1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "cpp", - "prompt": "#include\n#include\n// We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n// numbers in the array will be randomly ordered. Your task is to determine if\n// it is possible to get an array sorted in non-decreasing order by performing \n// the following operation on the given array:\n// You are allowed to perform right shift operation any number of times.\n// One right shift operation means shifting all elements of the array by one\n// position in the right direction. The last element of the array will be moved to\n// the starting position in the array i.e. 0th index. \n// If it is possible to obtain the sorted array by performing the above operation\n// then return True else return False.\n// If the given array is empty then return True.\n// Note: The given list is guaranteed to have unique elements.\n// For Example:\n// Explanation: By performin 2 right shift operations, non-decreasing order can\n// be achieved for the given array.\n// Explanation:It is not possible to get non-decreasing order for the given\n// array by performing any number of right shift operations.\nbool move_one_ball(std::vector arr) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = move_one_ball;\n assert(candidate((std::vector({(long)3, (long)4, (long)5, (long)1, (long)2}))) == (true));\n assert(candidate((std::vector({(long)3, (long)5, (long)10, (long)1, (long)2}))) == (true));\n assert(candidate((std::vector({(long)4, (long)3, (long)1, (long)2}))) == (false));\n assert(candidate((std::vector({(long)3, (long)5, (long)4, (long)1, (long)2}))) == (false));\n assert(candidate((std::vector())) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function which sorts the given list of integers\n// in ascending order according to the sum of their digits.\n// Note: if there are several items with similar sum of their digits,\n// order them based on their index in original list.\n// For example:\nstd::vector order_by_points(std::vector nums) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = order_by_points;\n assert(candidate((std::vector({(long)1, (long)11, (long)-1, (long)-11, (long)-12}))) == (std::vector({(long)-1, (long)-11, (long)1, (long)-12, (long)11})));\n assert(candidate((std::vector({(long)1234, (long)423, (long)463, (long)145, (long)2, (long)423, (long)423, (long)53, (long)6, (long)37, (long)3457, (long)3, (long)56, (long)0, (long)46}))) == (std::vector({(long)0, (long)2, (long)3, (long)6, (long)53, (long)423, (long)423, (long)423, (long)1234, (long)145, (long)37, (long)46, (long)56, (long)463, (long)3457})));\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)1, (long)-11, (long)-32, (long)43, (long)54, (long)-98, (long)2, (long)-3}))) == (std::vector({(long)-3, (long)-32, (long)-98, (long)-11, (long)1, (long)2, (long)43, (long)54})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6, (long)7, (long)8, (long)9, (long)10, (long)11}))) == (std::vector({(long)1, (long)10, (long)2, (long)11, (long)3, (long)4, (long)5, (long)6, (long)7, (long)8, (long)9})));\n assert(candidate((std::vector({(long)0, (long)6, (long)6, (long)-76, (long)-21, (long)23, (long)4}))) == (std::vector({(long)-76, (long)-21, (long)0, (long)4, (long)23, (long)6, (long)6})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "cpp", - "prompt": "#include\n#include\n// Return list of prime factors of given integer in the order from smallest to largest.\n// Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n// Input number should be equal to the product of all factors\nstd::vector factorize(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = factorize;\n assert(candidate((2)) == (std::vector({(long)2})));\n assert(candidate((4)) == (std::vector({(long)2, (long)2})));\n assert(candidate((8)) == (std::vector({(long)2, (long)2, (long)2})));\n assert(candidate((57)) == (std::vector({(long)3, (long)19})));\n assert(candidate((3249)) == (std::vector({(long)3, (long)3, (long)19, (long)19})));\n assert(candidate((185193)) == (std::vector({(long)3, (long)3, (long)3, (long)19, (long)19, (long)19})));\n assert(candidate((20577)) == (std::vector({(long)3, (long)19, (long)19, (long)19})));\n assert(candidate((18)) == (std::vector({(long)2, (long)3, (long)3})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "cpp", - "prompt": "#include\n#include\n// Return True if all numbers in the list l are below threshold t.\nbool below_threshold(std::vector l, long t) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = below_threshold;\n assert(candidate((std::vector({(long)1, (long)2, (long)4, (long)10})), (100)) == (true));\n assert(candidate((std::vector({(long)1, (long)20, (long)4, (long)10})), (5)) == (false));\n assert(candidate((std::vector({(long)1, (long)20, (long)4, (long)10})), (21)) == (true));\n assert(candidate((std::vector({(long)1, (long)20, (long)4, (long)10})), (22)) == (true));\n assert(candidate((std::vector({(long)1, (long)8, (long)4, (long)10})), (11)) == (true));\n assert(candidate((std::vector({(long)1, (long)8, (long)4, (long)10})), (10)) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "cpp", - "prompt": "#include\n#include\nunion Union_std_string_long{\n std::string f0;\n long f1; Union_std_string_long(std::string _f0) : f0(_f0) {}\n Union_std_string_long(long _f1) : f1(_f1) {}\n ~Union_std_string_long() {}\n bool operator==(std::string f) {\n return f0 == f ;\n } bool operator==(long f) {\n return f1 == f ;\n }\n};\n// You are given two positive integers n and m, and your task is to compute the\n// average of the integers from n through m (including n and m). \n// Round the answer to the nearest integer and convert that to binary.\n// If n is greater than m, return -1.\n// Example:\nUnion_std_string_long rounded_avg(long n, long m) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = rounded_avg;\n assert(candidate((1), (5)) == \"0b11\");\n assert(candidate((7), (13)) == \"0b1010\");\n assert(candidate((964), (977)) == \"0b1111001010\");\n assert(candidate((996), (997)) == \"0b1111100100\");\n assert(candidate((560), (851)) == \"0b1011000010\");\n assert(candidate((185), (546)) == \"0b101101110\");\n assert(candidate((362), (496)) == \"0b110101101\");\n assert(candidate((350), (902)) == \"0b1001110010\");\n assert(candidate((197), (233)) == \"0b11010111\");\n assert(candidate((7), (5)) == -1);\n assert(candidate((5), (1)) == -1);\n assert(candidate((5), (5)) == \"0b101\");\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "cpp", - "prompt": "#include\n#include\n// Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n// For each of the group, output the deepest level of nesting of parentheses.\n// E.g. (()()) has maximum two levels of nesting while ((())) has three.\nstd::vector parse_nested_parens(std::string paren_string) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = parse_nested_parens;\n assert(candidate((\"(()()) ((())) () ((())()())\")) == (std::vector({(long)2, (long)3, (long)1, (long)3})));\n assert(candidate((\"() (()) ((())) (((())))\")) == (std::vector({(long)1, (long)2, (long)3, (long)4})));\n assert(candidate((\"(()(())((())))\")) == (std::vector({(long)4})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "cpp", - "prompt": "#include\n#include\n// Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n// Examples\nlong solution(std::vector lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = solution;\n assert(candidate((std::vector({(long)5, (long)8, (long)7, (long)1}))) == (12));\n assert(candidate((std::vector({(long)3, (long)3, (long)3, (long)3, (long)3}))) == (9));\n assert(candidate((std::vector({(long)30, (long)13, (long)24, (long)321}))) == (0));\n assert(candidate((std::vector({(long)5, (long)9}))) == (5));\n assert(candidate((std::vector({(long)2, (long)4, (long)8}))) == (0));\n assert(candidate((std::vector({(long)30, (long)13, (long)23, (long)32}))) == (23));\n assert(candidate((std::vector({(long)3, (long)13, (long)2, (long)9}))) == (3));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a positive integer n. You have to create an integer array a of length n.\n// For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n// Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n// and a[i] + a[j] + a[k] is a multiple of 3.\n// Example :\n// Explanation: \n// a = [1, 3, 7, 13, 21]\n// The only valid triple is (1, 7, 13).\nlong get_max_triples(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = get_max_triples;\n assert(candidate((5)) == (1));\n assert(candidate((6)) == (4));\n assert(candidate((10)) == (36));\n assert(candidate((100)) == (53361));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "cpp", - "prompt": "#include\n#include\n// There are eight planets in our solar system: the closerst to the Sun \n// is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n// Uranus, Neptune.\n// Write a function that takes two planet names as strings planet1 and planet2. \n// The function should return a tuple containing all planets whose orbits are \n// located between the orbit of planet1 and the orbit of planet2, sorted by \n// the proximity to the sun. \n// The function should return an empty tuple if planet1 or planet2\n// are not correct planet names. \n// Examples\nstd::vector bf(std::string planet1, std::string planet2) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = bf;\n assert(candidate((\"Jupiter\"), (\"Neptune\")) == (std::vector({(std::string)\"Saturn\", (std::string)\"Uranus\"})));\n assert(candidate((\"Earth\"), (\"Mercury\")) == (std::vector({(std::string)\"Venus\"})));\n assert(candidate((\"Mercury\"), (\"Uranus\")) == (std::vector({(std::string)\"Venus\", (std::string)\"Earth\", (std::string)\"Mars\", (std::string)\"Jupiter\", (std::string)\"Saturn\"})));\n assert(candidate((\"Neptune\"), (\"Venus\")) == (std::vector({(std::string)\"Earth\", (std::string)\"Mars\", (std::string)\"Jupiter\", (std::string)\"Saturn\", (std::string)\"Uranus\"})));\n assert(candidate((\"Earth\"), (\"Earth\")) == (std::vector()));\n assert(candidate((\"Mars\"), (\"Earth\")) == (std::vector()));\n assert(candidate((\"Jupiter\"), (\"Makemake\")) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a list of integers.\n// Write a function next_smallest() that returns the 2nd smallest element of the list.\n// Return None if there is no such element.\nstd::optional next_smallest(std::vector lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = next_smallest;\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5}))) == 2);\n assert(candidate((std::vector({(long)5, (long)1, (long)4, (long)3, (long)2}))) == 2);\n assert(candidate((std::vector())) == std::nullopt);\n assert(candidate((std::vector({(long)1, (long)1}))) == std::nullopt);\n assert(candidate((std::vector({(long)1, (long)1, (long)1, (long)1, (long)0}))) == 1);\n assert(candidate((std::vector({(long)1, (long)1}))) == std::nullopt);\n assert(candidate((std::vector({(long)-35, (long)34, (long)12, (long)-45}))) == -35);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "cpp", - "prompt": "#include\n#include\n// Input is a space-delimited string of numberals from 'zero' to 'nine'.\n// Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n// Return the string with numbers sorted from smallest to largest\nstd::string sort_numbers(std::string numbers) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = sort_numbers;\n assert(candidate((\"\")) == (\"\"));\n assert(candidate((\"three\")) == (\"three\"));\n assert(candidate((\"three five nine\")) == (\"three five nine\"));\n assert(candidate((\"five zero four seven nine eight\")) == (\"zero four five seven eight nine\"));\n assert(candidate((\"six five four three two one zero\")) == (\"zero one two three four five six\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "cpp", - "prompt": "#include\n#include\n// You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\nbool cycpattern_check(std::string a, std::string b) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = cycpattern_check;\n assert(candidate((\"xyzw\"), (\"xyw\")) == (false));\n assert(candidate((\"yello\"), (\"ell\")) == (true));\n assert(candidate((\"whattup\"), (\"ptut\")) == (false));\n assert(candidate((\"efef\"), (\"fee\")) == (true));\n assert(candidate((\"abab\"), (\"aabb\")) == (false));\n assert(candidate((\"winemtt\"), (\"tinem\")) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "cpp", - "prompt": "#include\n#include\n// You will be given a number in decimal form and your task is to convert it to\n// binary format. The function should return a string, with each character representing a binary\n// number. Each character in the string will be '0' or '1'.\n// There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n// The extra characters are there to help with the format.\n// Examples:\nstd::string decimal_to_binary(long decimal) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = decimal_to_binary;\n assert(candidate((0)) == (\"db0db\"));\n assert(candidate((32)) == (\"db100000db\"));\n assert(candidate((103)) == (\"db1100111db\"));\n assert(candidate((15)) == (\"db1111db\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "cpp", - "prompt": "#include\n#include\n// Filter an input list of strings only for ones that contain given substring\nstd::vector filter_by_substring(std::vector strings, std::string substring) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = filter_by_substring;\n assert(candidate((std::vector()), (\"john\")) == (std::vector()));\n assert(candidate((std::vector({(std::string)\"xxx\", (std::string)\"asd\", (std::string)\"xxy\", (std::string)\"john doe\", (std::string)\"xxxAAA\", (std::string)\"xxx\"})), (\"xxx\")) == (std::vector({(std::string)\"xxx\", (std::string)\"xxxAAA\", (std::string)\"xxx\"})));\n assert(candidate((std::vector({(std::string)\"xxx\", (std::string)\"asd\", (std::string)\"aaaxxy\", (std::string)\"john doe\", (std::string)\"xxxAAA\", (std::string)\"xxx\"})), (\"xx\")) == (std::vector({(std::string)\"xxx\", (std::string)\"aaaxxy\", (std::string)\"xxxAAA\", (std::string)\"xxx\"})));\n assert(candidate((std::vector({(std::string)\"grunt\", (std::string)\"trumpet\", (std::string)\"prune\", (std::string)\"gruesome\"})), (\"run\")) == (std::vector({(std::string)\"grunt\", (std::string)\"prune\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "cpp", - "prompt": "#include\n#include\n// Given an integer. return a tuple that has the number of even and odd digits respectively.\n// Example:\nstd::tuple even_odd_count(long num) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = even_odd_count;\n assert(candidate((7)) == (std::make_tuple(0, 1)));\n assert(candidate((-78)) == (std::make_tuple(1, 1)));\n assert(candidate((3452)) == (std::make_tuple(2, 2)));\n assert(candidate((346211)) == (std::make_tuple(3, 3)));\n assert(candidate((-345821)) == (std::make_tuple(3, 3)));\n assert(candidate((-2)) == (std::make_tuple(1, 0)));\n assert(candidate((-45347)) == (std::make_tuple(2, 3)));\n assert(candidate((0)) == (std::make_tuple(1, 0)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that accepts a list of strings.\n// The list contains different words. Return the word with maximum number\n// of unique characters. If multiple strings have maximum number of unique\n// characters, return the one which comes first in lexicographical order.\nstd::string find_max(std::vector words) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = find_max;\n assert(candidate((std::vector({(std::string)\"name\", (std::string)\"of\", (std::string)\"string\"}))) == (\"string\"));\n assert(candidate((std::vector({(std::string)\"name\", (std::string)\"enam\", (std::string)\"game\"}))) == (\"enam\"));\n assert(candidate((std::vector({(std::string)\"aaaaaaa\", (std::string)\"bb\", (std::string)\"cc\"}))) == (\"aaaaaaa\"));\n assert(candidate((std::vector({(std::string)\"abc\", (std::string)\"cba\"}))) == (\"abc\"));\n assert(candidate((std::vector({(std::string)\"play\", (std::string)\"this\", (std::string)\"game\", (std::string)\"of\", (std::string)\"footbott\"}))) == (\"footbott\"));\n assert(candidate((std::vector({(std::string)\"we\", (std::string)\"are\", (std::string)\"gonna\", (std::string)\"rock\"}))) == (\"gonna\"));\n assert(candidate((std::vector({(std::string)\"we\", (std::string)\"are\", (std::string)\"a\", (std::string)\"mad\", (std::string)\"nation\"}))) == (\"nation\"));\n assert(candidate((std::vector({(std::string)\"this\", (std::string)\"is\", (std::string)\"a\", (std::string)\"prrk\"}))) == (\"this\"));\n assert(candidate((std::vector({(std::string)\"b\"}))) == (\"b\"));\n assert(candidate((std::vector({(std::string)\"play\", (std::string)\"play\", (std::string)\"play\"}))) == (\"play\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function that returns a tuple (a, b), where 'a' is\n// the largest of negative integers, and 'b' is the smallest\n// of positive integers in a list.\n// If there is no negative or positive integers, return them as None.\n// Examples:\nstd::tuple, std::optional> largest_smallest_integers(std::vector lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = largest_smallest_integers;\n assert(candidate((std::vector({(long)2, (long)4, (long)1, (long)3, (long)5, (long)7}))) == std::make_tuple(std::optional(std::nullopt), std::optional(1)));\n assert(candidate((std::vector({(long)2, (long)4, (long)1, (long)3, (long)5, (long)7, (long)0}))) == std::make_tuple(std::optional(std::nullopt), std::optional(1)));\n assert(candidate((std::vector({(long)1, (long)3, (long)2, (long)4, (long)5, (long)6, (long)-2}))) == std::make_tuple(-2, 1));\n assert(candidate((std::vector({(long)4, (long)5, (long)3, (long)6, (long)2, (long)7, (long)-7}))) == std::make_tuple(-7, 2));\n assert(candidate((std::vector({(long)7, (long)3, (long)8, (long)4, (long)9, (long)2, (long)5, (long)-9}))) == std::make_tuple(-9, 2));\n assert(candidate((std::vector())) == std::make_tuple(std::optional(std::nullopt), std::optional(std::nullopt)));\n assert(candidate((std::vector({(long)0}))) == std::make_tuple(std::optional(std::nullopt), std::optional(std::nullopt)));\n assert(candidate((std::vector({(long)-1, (long)-3, (long)-5, (long)-6}))) == std::make_tuple(std::optional(-1), std::optional(std::nullopt)));\n assert(candidate((std::vector({(long)-1, (long)-3, (long)-5, (long)-6, (long)0}))) == std::make_tuple(std::optional(-1), std::optional(std::nullopt)));\n assert(candidate((std::vector({(long)-6, (long)-4, (long)-4, (long)-3, (long)1}))) == std::make_tuple(-3, 1));\n assert(candidate((std::vector({(long)-6, (long)-4, (long)-4, (long)-3, (long)-100, (long)1}))) == std::make_tuple(-3, 1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "cpp", - "prompt": "#include\n#include\n// \"Given an array representing a branch of a tree that has non-negative integer nodes\n// your task is to pluck one of the nodes and return it.\n// The plucked node should be the node with the smallest even value.\n// If multiple nodes with the same smallest even value are found return the node that has smallest index.\n// The plucked node should be returned in a list, [ smalest_value, its index ],\n// If there are no even values or the given array is empty, return [].\n// Example 1:\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 2:\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 3:\n// Example 4:\n// Explanation: 0 is the smallest value, but there are two zeros,\n// so we will choose the first zero, which has the smallest index.\n// Constraints:\n// * 1 <= nodes.length <= 10000\n// * 0 <= node.value\nstd::vector pluck(std::vector arr) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = pluck;\n assert(candidate((std::vector({(long)4, (long)2, (long)3}))) == (std::vector({(long)2, (long)1})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3}))) == (std::vector({(long)2, (long)1})));\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)5, (long)0, (long)3, (long)0, (long)4, (long)2}))) == (std::vector({(long)0, (long)1})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)0, (long)5, (long)3}))) == (std::vector({(long)0, (long)3})));\n assert(candidate((std::vector({(long)5, (long)4, (long)8, (long)4, (long)8}))) == (std::vector({(long)4, (long)1})));\n assert(candidate((std::vector({(long)7, (long)6, (long)7, (long)1}))) == (std::vector({(long)6, (long)1})));\n assert(candidate((std::vector({(long)7, (long)9, (long)7, (long)1}))) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function count_nums which takes an array of integers and returns\n// the number of elements which has a sum of digits > 0.\n// If a number is negative, then its first signed digit will be negative:\n// e.g. -123 has signed digits -1, 2, and 3.\nlong count_nums(std::vector arr) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = count_nums;\n assert(candidate((std::vector())) == (0));\n assert(candidate((std::vector({(long)-1, (long)-2, (long)0}))) == (0));\n assert(candidate((std::vector({(long)1, (long)1, (long)2, (long)-2, (long)3, (long)4, (long)5}))) == (6));\n assert(candidate((std::vector({(long)1, (long)6, (long)9, (long)-6, (long)0, (long)1, (long)5}))) == (5));\n assert(candidate((std::vector({(long)1, (long)100, (long)98, (long)-7, (long)1, (long)-1}))) == (4));\n assert(candidate((std::vector({(long)12, (long)23, (long)34, (long)-45, (long)-56, (long)0}))) == (5));\n assert(candidate((std::vector({(long)0, (long)1}))) == (1));\n assert(candidate((std::vector({(long)1}))) == (1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "cpp", - "prompt": "#include\n#include\n// Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n// each cell of the grid contains a value. Every integer in the range [1, N * N]\n// inclusive appears exactly once on the cells of the grid.\n// You have to find the minimum path of length k in the grid. You can start\n// from any cell, and in each step you can move to any of the neighbor cells,\n// in other words, you can go to cells which share an edge with you current\n// cell.\n// Please note that a path of length k means visiting exactly k cells (not\n// necessarily distinct).\n// You CANNOT go off the grid.\n// A path A (of length k) is considered less than a path B (of length k) if\n// after making the ordered lists of the values on the cells that A and B go\n// through (let's call them lst_A and lst_B), lst_A is lexicographically less\n// than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n// such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n// lst_A[j] = lst_B[j].\n// It is guaranteed that the answer is unique.\n// Return an ordered list of the values on the cells that the minimum path go through.\n// Examples:\nstd::vector minPath(std::vector> grid, long k) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = minPath;\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)2, (long)3}), (std::vector)std::vector({(long)4, (long)5, (long)6}), (std::vector)std::vector({(long)7, (long)8, (long)9})})), (3)) == (std::vector({(long)1, (long)2, (long)1})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)5, (long)9, (long)3}), (std::vector)std::vector({(long)4, (long)1, (long)6}), (std::vector)std::vector({(long)7, (long)8, (long)2})})), (1)) == (std::vector({(long)1})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)2, (long)3, (long)4}), (std::vector)std::vector({(long)5, (long)6, (long)7, (long)8}), (std::vector)std::vector({(long)9, (long)10, (long)11, (long)12}), (std::vector)std::vector({(long)13, (long)14, (long)15, (long)16})})), (4)) == (std::vector({(long)1, (long)2, (long)1, (long)2})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)6, (long)4, (long)13, (long)10}), (std::vector)std::vector({(long)5, (long)7, (long)12, (long)1}), (std::vector)std::vector({(long)3, (long)16, (long)11, (long)15}), (std::vector)std::vector({(long)8, (long)14, (long)9, (long)2})})), (7)) == (std::vector({(long)1, (long)10, (long)1, (long)10, (long)1, (long)10, (long)1})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)8, (long)14, (long)9, (long)2}), (std::vector)std::vector({(long)6, (long)4, (long)13, (long)15}), (std::vector)std::vector({(long)5, (long)7, (long)1, (long)12}), (std::vector)std::vector({(long)3, (long)10, (long)11, (long)16})})), (5)) == (std::vector({(long)1, (long)7, (long)1, (long)7, (long)1})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)11, (long)8, (long)7, (long)2}), (std::vector)std::vector({(long)5, (long)16, (long)14, (long)4}), (std::vector)std::vector({(long)9, (long)3, (long)15, (long)6}), (std::vector)std::vector({(long)12, (long)13, (long)10, (long)1})})), (9)) == (std::vector({(long)1, (long)6, (long)1, (long)6, (long)1, (long)6, (long)1, (long)6, (long)1})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)12, (long)13, (long)10, (long)1}), (std::vector)std::vector({(long)9, (long)3, (long)15, (long)6}), (std::vector)std::vector({(long)5, (long)16, (long)14, (long)4}), (std::vector)std::vector({(long)11, (long)8, (long)7, (long)2})})), (12)) == (std::vector({(long)1, (long)6, (long)1, (long)6, (long)1, (long)6, (long)1, (long)6, (long)1, (long)6, (long)1, (long)6})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)2, (long)7, (long)4}), (std::vector)std::vector({(long)3, (long)1, (long)5}), (std::vector)std::vector({(long)6, (long)8, (long)9})})), (8)) == (std::vector({(long)1, (long)3, (long)1, (long)3, (long)1, (long)3, (long)1, (long)3})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)6, (long)1, (long)5}), (std::vector)std::vector({(long)3, (long)8, (long)9}), (std::vector)std::vector({(long)2, (long)7, (long)4})})), (8)) == (std::vector({(long)1, (long)5, (long)1, (long)5, (long)1, (long)5, (long)1, (long)5})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)2}), (std::vector)std::vector({(long)3, (long)4})})), (10)) == (std::vector({(long)1, (long)2, (long)1, (long)2, (long)1, (long)2, (long)1, (long)2, (long)1, (long)2})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)3}), (std::vector)std::vector({(long)3, (long)2})})), (10)) == (std::vector({(long)1, (long)3, (long)1, (long)3, (long)1, (long)3, (long)1, (long)3, (long)1, (long)3})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "cpp", - "prompt": "#include\n#include\n// Given list of integers, return list in strange order.\n// Strange sorting, is when you start with the minimum value,\n// then maximum of the remaining integers, then minimum and so on.\n// Examples:\nstd::vector strange_sort_list(std::vector lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = strange_sort_list;\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4}))) == (std::vector({(long)1, (long)4, (long)2, (long)3})));\n assert(candidate((std::vector({(long)5, (long)6, (long)7, (long)8, (long)9}))) == (std::vector({(long)5, (long)9, (long)6, (long)8, (long)7})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5}))) == (std::vector({(long)1, (long)5, (long)2, (long)4, (long)3})));\n assert(candidate((std::vector({(long)5, (long)6, (long)7, (long)8, (long)9, (long)1}))) == (std::vector({(long)1, (long)9, (long)5, (long)8, (long)6, (long)7})));\n assert(candidate((std::vector({(long)5, (long)5, (long)5, (long)5}))) == (std::vector({(long)5, (long)5, (long)5, (long)5})));\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6, (long)7, (long)8}))) == (std::vector({(long)1, (long)8, (long)2, (long)7, (long)3, (long)6, (long)4, (long)5})));\n assert(candidate((std::vector({(long)0, (long)2, (long)2, (long)2, (long)5, (long)5, (long)-5, (long)-5}))) == (std::vector({(long)-5, (long)5, (long)-5, (long)5, (long)0, (long)2, (long)2, (long)2})));\n assert(candidate((std::vector({(long)111111}))) == (std::vector({(long)111111})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "cpp", - "prompt": "#include\n#include\n// Given a string 'text', return its md5 hash equivalent string.\n// If 'text' is an empty string, return None.\nstd::optional string_to_md5(std::string text) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = string_to_md5;\n assert(candidate((\"Hello world\")) == \"3e25960a79dbc69b674cd4ec67a72c62\");\n assert(candidate((\"\")) == std::nullopt);\n assert(candidate((\"A B C\")) == \"0ef78513b0cb8cef12743f5aeb35f888\");\n assert(candidate((\"password\")) == \"5f4dcc3b5aa765d61d8327deb882cf99\");\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a word. Your task is to find the closest vowel that stands between \n// two consonants from the right side of the word (case sensitive).\n// Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n// find any vowel met the above condition. \n// You may assume that the given string contains English letter only.\n// Example:\nstd::string get_closest_vowel(std::string word) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = get_closest_vowel;\n assert(candidate((\"yogurt\")) == (\"u\"));\n assert(candidate((\"full\")) == (\"u\"));\n assert(candidate((\"easy\")) == (\"\"));\n assert(candidate((\"eAsy\")) == (\"\"));\n assert(candidate((\"ali\")) == (\"\"));\n assert(candidate((\"bad\")) == (\"a\"));\n assert(candidate((\"most\")) == (\"o\"));\n assert(candidate((\"ab\")) == (\"\"));\n assert(candidate((\"ba\")) == (\"\"));\n assert(candidate((\"quick\")) == (\"\"));\n assert(candidate((\"anime\")) == (\"i\"));\n assert(candidate((\"Asia\")) == (\"\"));\n assert(candidate((\"Above\")) == (\"o\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "cpp", - "prompt": "#include\n#include\n// Change numerical base of input number x to base.\n// return string representation after the conversion.\n// base numbers are less than 10.\nstd::string change_base(long x, long base) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = change_base;\n assert(candidate((8), (3)) == (\"22\"));\n assert(candidate((9), (3)) == (\"100\"));\n assert(candidate((234), (2)) == (\"11101010\"));\n assert(candidate((16), (2)) == (\"10000\"));\n assert(candidate((8), (2)) == (\"1000\"));\n assert(candidate((7), (2)) == (\"111\"));\n assert(candidate((2), (3)) == (\"2\"));\n assert(candidate((3), (4)) == (\"3\"));\n assert(candidate((4), (5)) == (\"4\"));\n assert(candidate((5), (6)) == (\"5\"));\n assert(candidate((6), (7)) == (\"6\"));\n assert(candidate((7), (8)) == (\"7\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "cpp", - "prompt": "#include\n#include\n// Check if in given list of numbers, are any two numbers closer to each other than\n// given threshold.\nbool has_close_elements(std::vector numbers, float threshold) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = has_close_elements;\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.9, (float)4.0, (float)5.0, (float)2.2})), (0.3)) == (true));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.9, (float)4.0, (float)5.0, (float)2.2})), (0.05)) == (false));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)5.9, (float)4.0, (float)5.0})), (0.95)) == (true));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)5.9, (float)4.0, (float)5.0})), (0.8)) == (false));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0, (float)5.0, (float)2.0})), (0.1)) == (true));\n assert(candidate((std::vector({(float)1.1, (float)2.2, (float)3.1, (float)4.1, (float)5.1})), (1.0)) == (true));\n assert(candidate((std::vector({(float)1.1, (float)2.2, (float)3.1, (float)4.1, (float)5.1})), (0.5)) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function that takes a string as input which contains only square brackets.\n// The function should return True if and only if there is a valid subsequence of brackets \n// where at least one bracket in the subsequence is nested.\nbool is_nested(std::string string) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = is_nested;\n assert(candidate((\"[[]]\")) == (true));\n assert(candidate((\"[]]]]]]][[[[[]\")) == (false));\n assert(candidate((\"[][]\")) == (false));\n assert(candidate((\"[]\")) == (false));\n assert(candidate((\"[[[[]]]]\")) == (true));\n assert(candidate((\"[]]]]]]]]]]\")) == (false));\n assert(candidate((\"[][][[]]\")) == (true));\n assert(candidate((\"[[]\")) == (false));\n assert(candidate((\"[]]\")) == (false));\n assert(candidate((\"[[]][[\")) == (true));\n assert(candidate((\"[[][]]\")) == (true));\n assert(candidate((\"\")) == (false));\n assert(candidate((\"[[[[[[[[\")) == (false));\n assert(candidate((\"]]]]]]]]\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "cpp", - "prompt": "#include\n#include\n// Concatenate list of strings into a single string\nstd::string concatenate(std::vector strings) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = concatenate;\n assert(candidate((std::vector())) == (\"\"));\n assert(candidate((std::vector({(std::string)\"x\", (std::string)\"y\", (std::string)\"z\"}))) == (\"xyz\"));\n assert(candidate((std::vector({(std::string)\"x\", (std::string)\"y\", (std::string)\"z\", (std::string)\"w\", (std::string)\"k\"}))) == (\"xyzwk\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "cpp", - "prompt": "#include\n#include\n// prime_fib returns n-th number that is a Fibonacci number and it's also prime.\nlong prime_fib(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = prime_fib;\n assert(candidate((1)) == (2));\n assert(candidate((2)) == (3));\n assert(candidate((3)) == (5));\n assert(candidate((4)) == (13));\n assert(candidate((5)) == (89));\n assert(candidate((6)) == (233));\n assert(candidate((7)) == (1597));\n assert(candidate((8)) == (28657));\n assert(candidate((9)) == (514229));\n assert(candidate((10)) == (433494437));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "cpp", - "prompt": "#include\n#include\n// From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n// other and return them in order (smaller number, larger number).\nstd::tuple find_closest_elements(std::vector numbers) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = find_closest_elements;\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.9, (float)4.0, (float)5.0, (float)2.2}))) == (std::make_tuple(3.9, 4.0)));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)5.9, (float)4.0, (float)5.0}))) == (std::make_tuple(5.0, 5.9)));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0, (float)5.0, (float)2.2}))) == (std::make_tuple(2.0, 2.2)));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0, (float)5.0, (float)2.0}))) == (std::make_tuple(2.0, 2.0)));\n assert(candidate((std::vector({(float)1.1, (float)2.2, (float)3.1, (float)4.1, (float)5.1}))) == (std::make_tuple(2.2, 3.1)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "cpp", - "prompt": "#include\n#include\n// You have been tasked to write a function that receives \n// a hexadecimal number as a string and counts the number of hexadecimal \n// digits that are primes (prime number, or a prime, is a natural number \n// greater than 1 that is not a product of two smaller natural numbers).\n// Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n// Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n// So you have to determine a number of the following digits: 2, 3, 5, 7, \n// B (=decimal 11), D (=decimal 13).\n// Note: you may assume the input is always correct or empty string, \n// and symbols A,B,C,D,E,F are always uppercase.\n// Examples:\nlong hex_key(std::string num) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = hex_key;\n assert(candidate((\"AB\")) == (1));\n assert(candidate((\"1077E\")) == (2));\n assert(candidate((\"ABED1A33\")) == (4));\n assert(candidate((\"2020\")) == (2));\n assert(candidate((\"123456789ABCDEF0\")) == (6));\n assert(candidate((\"112233445566778899AABBCCDDEEFF00\")) == (12));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "cpp", - "prompt": "#include\n#include\n// Complete the function that takes two integers and returns \n// the product of their unit digits.\n// Assume the input is always valid.\n// Examples:\nlong multiply(long a, long b) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = multiply;\n assert(candidate((148), (412)) == (16));\n assert(candidate((19), (28)) == (72));\n assert(candidate((2020), (1851)) == (0));\n assert(candidate((14), (-15)) == (20));\n assert(candidate((76), (67)) == (42));\n assert(candidate((17), (27)) == (49));\n assert(candidate((0), (1)) == (0));\n assert(candidate((0), (0)) == (0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "cpp", - "prompt": "#include\n#include\n// Given list of numbers (of at least two elements), apply a linear transform to that list,\n// such that the smallest number will become 0 and the largest will become 1\nstd::vector rescale_to_unit(std::vector numbers) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = rescale_to_unit;\n assert(candidate((std::vector({(float)2.0, (float)49.9}))) == (std::vector({(float)0.0, (float)1.0})));\n assert(candidate((std::vector({(float)100.0, (float)49.9}))) == (std::vector({(float)1.0, (float)0.0})));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0, (float)5.0}))) == (std::vector({(float)0.0, (float)0.25, (float)0.5, (float)0.75, (float)1.0})));\n assert(candidate((std::vector({(float)2.0, (float)1.0, (float)5.0, (float)3.0, (float)4.0}))) == (std::vector({(float)0.25, (float)0.0, (float)1.0, (float)0.5, (float)0.75})));\n assert(candidate((std::vector({(float)12.0, (float)11.0, (float)15.0, (float)13.0, (float)14.0}))) == (std::vector({(float)0.25, (float)0.0, (float)1.0, (float)0.5, (float)0.75})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "cpp", - "prompt": "#include\n#include\n// Given a positive integer n, return the product of the odd digits.\n// Return 0 if all digits are even.\n// For example:\nlong digits(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = digits;\n assert(candidate((5)) == (5));\n assert(candidate((54)) == (5));\n assert(candidate((120)) == (1));\n assert(candidate((5014)) == (5));\n assert(candidate((98765)) == (315));\n assert(candidate((5576543)) == (2625));\n assert(candidate((2468)) == (0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "cpp", - "prompt": "#include\n#include\n// You will be given the name of a class (a string) and a list of extensions.\n// The extensions are to be used to load additional classes to the class. The\n// strength of the extension is as follows: Let CAP be the number of the uppercase\n// letters in the extension's name, and let SM be the number of lowercase letters \n// in the extension's name, the strength is given by the fraction CAP - SM. \n// You should find the strongest extension and return a string in this \n// format: ClassName.StrongestExtensionName.\n// If there are two or more extensions with the same strength, you should\n// choose the one that comes first in the list.\n// For example, if you are given \"Slices\" as the class and a list of the\n// extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n// return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n// (its strength is -1).\n// Example:\nstd::string Strongest_Extension(std::string class_name, std::vector extensions) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = Strongest_Extension;\n assert(candidate((\"Watashi\"), (std::vector({(std::string)\"tEN\", (std::string)\"niNE\", (std::string)\"eIGHt8OKe\"}))) == (\"Watashi.eIGHt8OKe\"));\n assert(candidate((\"Boku123\"), (std::vector({(std::string)\"nani\", (std::string)\"NazeDa\", (std::string)\"YEs.WeCaNe\", (std::string)\"32145tggg\"}))) == (\"Boku123.YEs.WeCaNe\"));\n assert(candidate((\"__YESIMHERE\"), (std::vector({(std::string)\"t\", (std::string)\"eMptY\", (std::string)\"nothing\", (std::string)\"zeR00\", (std::string)\"NuLl__\", (std::string)\"123NoooneB321\"}))) == (\"__YESIMHERE.NuLl__\"));\n assert(candidate((\"K\"), (std::vector({(std::string)\"Ta\", (std::string)\"TAR\", (std::string)\"t234An\", (std::string)\"cosSo\"}))) == (\"K.TAR\"));\n assert(candidate((\"__HAHA\"), (std::vector({(std::string)\"Tab\", (std::string)\"123\", (std::string)\"781345\", (std::string)\"-_-\"}))) == (\"__HAHA.123\"));\n assert(candidate((\"YameRore\"), (std::vector({(std::string)\"HhAas\", (std::string)\"okIWILL123\", (std::string)\"WorkOut\", (std::string)\"Fails\", (std::string)\"-_-\"}))) == (\"YameRore.okIWILL123\"));\n assert(candidate((\"finNNalLLly\"), (std::vector({(std::string)\"Die\", (std::string)\"NowW\", (std::string)\"Wow\", (std::string)\"WoW\"}))) == (\"finNNalLLly.WoW\"));\n assert(candidate((\"_\"), (std::vector({(std::string)\"Bb\", (std::string)\"91245\"}))) == (\"_.Bb\"));\n assert(candidate((\"Sp\"), (std::vector({(std::string)\"671235\", (std::string)\"Bb\"}))) == (\"Sp.671235\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "cpp", - "prompt": "#include\n#include\n// Given a string representing a space separated lowercase letters, return a dictionary\n// of the letter with the most repetition and containing the corresponding count.\n// If several letters have the same occurrence, return all of them.\n// Example:\nstd::map histogram(std::string test) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = histogram;\n assert(candidate((\"a b b a\")) == (std::map({{\"a\", 2}, {\"b\", 2}})));\n assert(candidate((\"a b c a b\")) == (std::map({{\"a\", 2}, {\"b\", 2}})));\n assert(candidate((\"a b c d g\")) == (std::map({{\"a\", 1}, {\"b\", 1}, {\"c\", 1}, {\"d\", 1}, {\"g\", 1}})));\n assert(candidate((\"r t g\")) == (std::map({{\"r\", 1}, {\"t\", 1}, {\"g\", 1}})));\n assert(candidate((\"b b b b a\")) == (std::map({{\"b\", 4}})));\n assert(candidate((\"r t g\")) == (std::map({{\"r\", 1}, {\"t\", 1}, {\"g\", 1}})));\n assert(candidate((\"\")) == (std::map()));\n assert(candidate((\"a\")) == (std::map({{\"a\", 1}})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "cpp", - "prompt": "#include\n#include\n// pairs_sum_to_zero takes a list of integers as an input.\n// it returns True if there are two distinct elements in the list that\n// sum to zero, and False otherwise.\nbool pairs_sum_to_zero(std::vector l) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = pairs_sum_to_zero;\n assert(candidate((std::vector({(long)1, (long)3, (long)5, (long)0}))) == (false));\n assert(candidate((std::vector({(long)1, (long)3, (long)-2, (long)1}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)7}))) == (false));\n assert(candidate((std::vector({(long)2, (long)4, (long)-5, (long)3, (long)5, (long)7}))) == (true));\n assert(candidate((std::vector({(long)1}))) == (false));\n assert(candidate((std::vector({(long)-3, (long)9, (long)-1, (long)3, (long)2, (long)30}))) == (true));\n assert(candidate((std::vector({(long)-3, (long)9, (long)-1, (long)3, (long)2, (long)31}))) == (true));\n assert(candidate((std::vector({(long)-3, (long)9, (long)-1, (long)4, (long)2, (long)30}))) == (false));\n assert(candidate((std::vector({(long)-3, (long)9, (long)-1, (long)4, (long)2, (long)31}))) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that accepts two lists of strings and returns the list that has \n// total number of chars in the all strings of the list less than the other list.\n// if the two lists have the same number of chars, return the first list.\n// Examples\nstd::vector total_match(std::vector lst1, std::vector lst2) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = total_match;\n assert(candidate((std::vector()), (std::vector())) == (std::vector()));\n assert(candidate((std::vector({(std::string)\"hi\", (std::string)\"admin\"})), (std::vector({(std::string)\"hi\", (std::string)\"hi\"}))) == (std::vector({(std::string)\"hi\", (std::string)\"hi\"})));\n assert(candidate((std::vector({(std::string)\"hi\", (std::string)\"admin\"})), (std::vector({(std::string)\"hi\", (std::string)\"hi\", (std::string)\"admin\", (std::string)\"project\"}))) == (std::vector({(std::string)\"hi\", (std::string)\"admin\"})));\n assert(candidate((std::vector({(std::string)\"4\"})), (std::vector({(std::string)\"1\", (std::string)\"2\", (std::string)\"3\", (std::string)\"4\", (std::string)\"5\"}))) == (std::vector({(std::string)\"4\"})));\n assert(candidate((std::vector({(std::string)\"hi\", (std::string)\"admin\"})), (std::vector({(std::string)\"hI\", (std::string)\"Hi\"}))) == (std::vector({(std::string)\"hI\", (std::string)\"Hi\"})));\n assert(candidate((std::vector({(std::string)\"hi\", (std::string)\"admin\"})), (std::vector({(std::string)\"hI\", (std::string)\"hi\", (std::string)\"hi\"}))) == (std::vector({(std::string)\"hI\", (std::string)\"hi\", (std::string)\"hi\"})));\n assert(candidate((std::vector({(std::string)\"hi\", (std::string)\"admin\"})), (std::vector({(std::string)\"hI\", (std::string)\"hi\", (std::string)\"hii\"}))) == (std::vector({(std::string)\"hi\", (std::string)\"admin\"})));\n assert(candidate((std::vector()), (std::vector({(std::string)\"this\"}))) == (std::vector()));\n assert(candidate((std::vector({(std::string)\"this\"})), (std::vector())) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "cpp", - "prompt": "#include\n#include\n// Circular shift the digits of the integer x, shift the digits right by shift\n// and return the result as a string.\n// If shift > number of digits, return digits reversed.\nstd::string circular_shift(long x, long shift) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = circular_shift;\n assert(candidate((100), (2)) == (\"001\"));\n assert(candidate((12), (2)) == (\"12\"));\n assert(candidate((97), (8)) == (\"79\"));\n assert(candidate((12), (1)) == (\"21\"));\n assert(candidate((11), (101)) == (\"11\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "cpp", - "prompt": "#include\n#include\n// Return True is list elements are monotonically increasing or decreasing.\nbool monotonic(std::vector l) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = monotonic;\n assert(candidate((std::vector({(long)1, (long)2, (long)4, (long)10}))) == (true));\n assert(candidate((std::vector({(long)1, (long)2, (long)4, (long)20}))) == (true));\n assert(candidate((std::vector({(long)1, (long)20, (long)4, (long)10}))) == (false));\n assert(candidate((std::vector({(long)4, (long)1, (long)0, (long)-10}))) == (true));\n assert(candidate((std::vector({(long)4, (long)1, (long)1, (long)0}))) == (true));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)2, (long)5, (long)60}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)60}))) == (true));\n assert(candidate((std::vector({(long)9, (long)9, (long)9, (long)9}))) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "cpp", - "prompt": "#include\n#include\n// Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n// Example\nbool is_equal_to_sum_even(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = is_equal_to_sum_even;\n assert(candidate((4)) == (false));\n assert(candidate((6)) == (false));\n assert(candidate((8)) == (true));\n assert(candidate((10)) == (true));\n assert(candidate((11)) == (false));\n assert(candidate((12)) == (true));\n assert(candidate((13)) == (false));\n assert(candidate((16)) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "cpp", - "prompt": "#include\n#include\n// Input to this function is a string representing musical notes in a special ASCII format.\n// Your task is to parse this string and return list of integers corresponding to how many beats does each\n// not last.\n// Here is a legend:\n// 'o' - whole note, lasts four beats\n// 'o|' - half note, lasts two beats\n// '.|' - quater note, lasts one beat\nstd::vector parse_music(std::string music_string) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = parse_music;\n assert(candidate((\"\")) == (std::vector()));\n assert(candidate((\"o o o o\")) == (std::vector({(long)4, (long)4, (long)4, (long)4})));\n assert(candidate((\".| .| .| .|\")) == (std::vector({(long)1, (long)1, (long)1, (long)1})));\n assert(candidate((\"o| o| .| .| o o o o\")) == (std::vector({(long)2, (long)2, (long)1, (long)1, (long)4, (long)4, (long)4, (long)4})));\n assert(candidate((\"o| .| o| .| o o| o o|\")) == (std::vector({(long)2, (long)1, (long)2, (long)1, (long)4, (long)2, (long)4, (long)2})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "cpp", - "prompt": "#include\n#include\n// \"\n// This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n// multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n// change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n// Examples:\nlong sum_squares(std::vector lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = sum_squares;\n assert(candidate((std::vector({(long)1, (long)2, (long)3}))) == (6));\n assert(candidate((std::vector({(long)1, (long)4, (long)9}))) == (14));\n assert(candidate((std::vector())) == (0));\n assert(candidate((std::vector({(long)1, (long)1, (long)1, (long)1, (long)1, (long)1, (long)1, (long)1, (long)1}))) == (9));\n assert(candidate((std::vector({(long)-1, (long)-1, (long)-1, (long)-1, (long)-1, (long)-1, (long)-1, (long)-1, (long)-1}))) == (-3));\n assert(candidate((std::vector({(long)0}))) == (0));\n assert(candidate((std::vector({(long)-1, (long)-5, (long)2, (long)-1, (long)-5}))) == (-126));\n assert(candidate((std::vector({(long)-56, (long)-99, (long)1, (long)0, (long)-2}))) == (3030));\n assert(candidate((std::vector({(long)-1, (long)0, (long)0, (long)0, (long)0, (long)0, (long)0, (long)0, (long)-1}))) == (0));\n assert(candidate((std::vector({(long)-16, (long)-9, (long)-2, (long)36, (long)36, (long)26, (long)-20, (long)25, (long)-40, (long)20, (long)-4, (long)12, (long)-26, (long)35, (long)37}))) == (-14196));\n assert(candidate((std::vector({(long)-1, (long)-3, (long)17, (long)-1, (long)-15, (long)13, (long)-1, (long)14, (long)-14, (long)-12, (long)-5, (long)14, (long)-14, (long)6, (long)13, (long)11, (long)16, (long)16, (long)4, (long)10}))) == (-1448));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "cpp", - "prompt": "#include\n#include\n// triples_sum_to_zero takes a list of integers as an input.\n// it returns True if there are three distinct elements in the list that\n// sum to zero, and False otherwise.\nbool triples_sum_to_zero(std::vector l) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = triples_sum_to_zero;\n assert(candidate((std::vector({(long)1, (long)3, (long)5, (long)0}))) == (false));\n assert(candidate((std::vector({(long)1, (long)3, (long)5, (long)-1}))) == (false));\n assert(candidate((std::vector({(long)1, (long)3, (long)-2, (long)1}))) == (true));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)7}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)5, (long)7}))) == (false));\n assert(candidate((std::vector({(long)2, (long)4, (long)-5, (long)3, (long)9, (long)7}))) == (true));\n assert(candidate((std::vector({(long)1}))) == (false));\n assert(candidate((std::vector({(long)1, (long)3, (long)5, (long)-100}))) == (false));\n assert(candidate((std::vector({(long)100, (long)3, (long)5, (long)-100}))) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "cpp", - "prompt": "#include\n#include\n// brackets is a string of \"<\" and \">\".\n// return True if every opening bracket has a corresponding closing bracket.\nbool correct_bracketing(std::string brackets) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = correct_bracketing;\n assert(candidate((\"<>\")) == (true));\n assert(candidate((\"<<><>>\")) == (true));\n assert(candidate((\"<><><<><>><>\")) == (true));\n assert(candidate((\"<><><<<><><>><>><<><><<>>>\")) == (true));\n assert(candidate((\"<<<><>>>>\")) == (false));\n assert(candidate((\"><<>\")) == (false));\n assert(candidate((\"<\")) == (false));\n assert(candidate((\"<<<<\")) == (false));\n assert(candidate((\">\")) == (false));\n assert(candidate((\"<<>\")) == (false));\n assert(candidate((\"<><><<><>><>><<>\")) == (false));\n assert(candidate((\"<><><<><>><>>><>\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that takes an array of numbers as input and returns \n// the number of elements in the array that are greater than 10 and both \n// first and last digits of a number are odd (1, 3, 5, 7, 9).\n// For example:\nlong specialFilter(std::vector nums) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = specialFilter;\n assert(candidate((std::vector({(long)5, (long)-2, (long)1, (long)-5}))) == (0));\n assert(candidate((std::vector({(long)15, (long)-73, (long)14, (long)-15}))) == (1));\n assert(candidate((std::vector({(long)33, (long)-2, (long)-3, (long)45, (long)21, (long)109}))) == (2));\n assert(candidate((std::vector({(long)43, (long)-12, (long)93, (long)125, (long)121, (long)109}))) == (4));\n assert(candidate((std::vector({(long)71, (long)-2, (long)-33, (long)75, (long)21, (long)19}))) == (3));\n assert(candidate((std::vector({(long)1}))) == (0));\n assert(candidate((std::vector())) == (0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "cpp", - "prompt": "#include\n#include\n// Given a dictionary, return True if all keys are strings in lower \n// case or all keys are strings in upper case, else return False.\n// The function should return False is the given dictionary is empty.\n// Examples:\nbool check_dict_case(std::map dict) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = check_dict_case;\n assert(candidate((std::map({{\"p\", \"pineapple\"}, {\"b\", \"banana\"}}))) == (true));\n assert(candidate((std::map({{\"p\", \"pineapple\"}, {\"A\", \"banana\"}, {\"B\", \"banana\"}}))) == (false));\n assert(candidate((std::map({{\"p\", \"pineapple\"}, {\"5\", \"banana\"}, {\"a\", \"apple\"}}))) == (false));\n assert(candidate((std::map({{\"Name\", \"John\"}, {\"Age\", \"36\"}, {\"City\", \"Houston\"}}))) == (false));\n assert(candidate((std::map({{\"STATE\", \"NC\"}, {\"ZIP\", \"12345\"}}))) == (true));\n assert(candidate((std::map({{\"fruit\", \"Orange\"}, {\"taste\", \"Sweet\"}}))) == (true));\n assert(candidate((std::map())) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "cpp", - "prompt": "#include\n#include\nunion Union_std_vector_std_string__long{\n std::vector f0;\n long f1; Union_std_vector_std_string__long(std::vector _f0) : f0(_f0) {}\n Union_std_vector_std_string__long(long _f1) : f1(_f1) {}\n ~Union_std_vector_std_string__long() {}\n bool operator==(std::vector f) {\n return f0 == f ;\n } bool operator==(long f) {\n return f1 == f ;\n }\n};\n// Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n// should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n// alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n// Examples\nUnion_std_vector_std_string__long split_words(std::string txt) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = split_words;\n assert(candidate((\"Hello world!\")) == std::vector({(std::string)\"Hello\", (std::string)\"world!\"}));\n assert(candidate((\"Hello,world!\")) == std::vector({(std::string)\"Hello\", (std::string)\"world!\"}));\n assert(candidate((\"Hello world,!\")) == std::vector({(std::string)\"Hello\", (std::string)\"world,!\"}));\n assert(candidate((\"Hello,Hello,world !\")) == std::vector({(std::string)\"Hello,Hello,world\", (std::string)\"!\"}));\n assert(candidate((\"abcdef\")) == 3);\n assert(candidate((\"aaabb\")) == 2);\n assert(candidate((\"aaaBb\")) == 1);\n assert(candidate((\"\")) == 0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "cpp", - "prompt": "#include\n#include\n// The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fibfib(0) == 0\n// fibfib(1) == 0\n// fibfib(2) == 1\n// fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n// Please write a function to efficiently compute the n-th element of the fibfib number sequence.\nlong fibfib(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = fibfib;\n assert(candidate((2)) == (1));\n assert(candidate((1)) == (0));\n assert(candidate((5)) == (4));\n assert(candidate((8)) == (24));\n assert(candidate((10)) == (81));\n assert(candidate((12)) == (274));\n assert(candidate((14)) == (927));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a list of numbers.\n// You need to return the sum of squared numbers in the given list,\n// round each element in the list to the upper int(Ceiling) first.\n// Examples:\nlong sum_squares(std::vector lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = sum_squares;\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0}))) == (14));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0}))) == (14));\n assert(candidate((std::vector({(float)1.0, (float)3.0, (float)5.0, (float)7.0}))) == (84));\n assert(candidate((std::vector({(float)1.4, (float)4.2, (float)0.0}))) == (29));\n assert(candidate((std::vector({(float)-2.4, (float)1.0, (float)1.0}))) == (6));\n assert(candidate((std::vector({(float)100.0, (float)1.0, (float)15.0, (float)2.0}))) == (10230));\n assert(candidate((std::vector({(float)10000.0, (float)10000.0}))) == (200000000));\n assert(candidate((std::vector({(float)-1.4, (float)4.6, (float)6.3}))) == (75));\n assert(candidate((std::vector({(float)-1.4, (float)17.9, (float)18.9, (float)19.9}))) == (1086));\n assert(candidate((std::vector({(float)0.0}))) == (0));\n assert(candidate((std::vector({(float)-1.0}))) == (1));\n assert(candidate((std::vector({(float)-1.0, (float)1.0, (float)0.0}))) == (2));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_85_add", - "language": "cpp", - "prompt": "#include\n#include\n// Given a non-empty list of integers lst. add the even elements that are at odd indices..\n// Examples:\nlong add(std::vector lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = add;\n assert(candidate((std::vector({(long)4, (long)88}))) == (88));\n assert(candidate((std::vector({(long)4, (long)5, (long)6, (long)7, (long)2, (long)122}))) == (122));\n assert(candidate((std::vector({(long)4, (long)0, (long)6, (long)7}))) == (0));\n assert(candidate((std::vector({(long)4, (long)4, (long)6, (long)8}))) == (12));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "cpp", - "prompt": "#include\n#include\n// Return sorted unique elements in a list\nstd::vector unique(std::vector l) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = unique;\n assert(candidate((std::vector({(long)5, (long)3, (long)5, (long)2, (long)3, (long)3, (long)9, (long)0, (long)123}))) == (std::vector({(long)0, (long)2, (long)3, (long)5, (long)9, (long)123})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "cpp", - "prompt": "#include\n#include\n// Given a string text, replace all spaces in it with underscores, \n// and if a string has more than 2 consecutive spaces, \n// then replace all consecutive spaces with -\nstd::string fix_spaces(std::string text) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = fix_spaces;\n assert(candidate((\"Example\")) == (\"Example\"));\n assert(candidate((\"Mudasir Hanif \")) == (\"Mudasir_Hanif_\"));\n assert(candidate((\"Yellow Yellow Dirty Fellow\")) == (\"Yellow_Yellow__Dirty__Fellow\"));\n assert(candidate((\"Exa mple\")) == (\"Exa-mple\"));\n assert(candidate((\" Exa 1 2 2 mple\")) == (\"-Exa_1_2_2_mple\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "cpp", - "prompt": "#include\n#include\n// Return 2^n modulo p (be aware of numerics).\nlong modp(long n, long p) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = modp;\n assert(candidate((3), (5)) == (3));\n assert(candidate((1101), (101)) == (2));\n assert(candidate((0), (101)) == (1));\n assert(candidate((3), (11)) == (8));\n assert(candidate((100), (101)) == (1));\n assert(candidate((30), (5)) == (4));\n assert(candidate((31), (5)) == (3));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "cpp", - "prompt": "#include\n#include\n// You have to write a function which validates a given date string and\n// returns True if the date is valid otherwise False.\n// The date is valid if all of the following rules are satisfied:\n// 1. The date string is not empty.\n// 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n// 3. The months should not be less than 1 or higher than 12.\n// 4. The date should be in the format: mm-dd-yyyy\nbool valid_date(std::string date) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = valid_date;\n assert(candidate((\"03-11-2000\")) == (true));\n assert(candidate((\"15-01-2012\")) == (false));\n assert(candidate((\"04-0-2040\")) == (false));\n assert(candidate((\"06-04-2020\")) == (true));\n assert(candidate((\"01-01-2007\")) == (true));\n assert(candidate((\"03-32-2011\")) == (false));\n assert(candidate((\"\")) == (false));\n assert(candidate((\"04-31-3000\")) == (false));\n assert(candidate((\"06-06-2005\")) == (true));\n assert(candidate((\"21-31-2000\")) == (false));\n assert(candidate((\"04-12-2003\")) == (true));\n assert(candidate((\"04122003\")) == (false));\n assert(candidate((\"20030412\")) == (false));\n assert(candidate((\"2003-04\")) == (false));\n assert(candidate((\"2003-04-12\")) == (false));\n assert(candidate((\"04-2003\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that takes a string and returns an ordered version of it.\n// Ordered version of string, is a string where all words (separated by space)\n// are replaced by a new word where all the characters arranged in\n// ascending order based on ascii value.\n// Note: You should keep the order of words and blank spaces in the sentence.\n// For example:\nstd::string anti_shuffle(std::string s) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = anti_shuffle;\n assert(candidate((\"Hi\")) == (\"Hi\"));\n assert(candidate((\"hello\")) == (\"ehllo\"));\n assert(candidate((\"number\")) == (\"bemnru\"));\n assert(candidate((\"abcd\")) == (\"abcd\"));\n assert(candidate((\"Hello World!!!\")) == (\"Hello !!!Wdlor\"));\n assert(candidate((\"\")) == (\"\"));\n assert(candidate((\"Hi. My name is Mister Robot. How are you?\")) == (\".Hi My aemn is Meirst .Rboot How aer ?ouy\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "cpp", - "prompt": "#include\n#include\n// Given a list of numbers, return whether or not they are sorted\n// in ascending order. If list has more than 1 duplicate of the same\n// number, return False. Assume no negative numbers and only integers.\n// Examples\nbool is_sorted(std::vector lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = is_sorted;\n assert(candidate((std::vector({(long)5}))) == (true));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5}))) == (true));\n assert(candidate((std::vector({(long)1, (long)3, (long)2, (long)4, (long)5}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}))) == (true));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6, (long)7}))) == (true));\n assert(candidate((std::vector({(long)1, (long)3, (long)2, (long)4, (long)5, (long)6, (long)7}))) == (false));\n assert(candidate((std::vector())) == (true));\n assert(candidate((std::vector({(long)1}))) == (true));\n assert(candidate((std::vector({(long)3, (long)2, (long)1}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)2, (long)2, (long)3, (long)4}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)3, (long)3, (long)4}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)2, (long)3, (long)3, (long)4}))) == (true));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4}))) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a string s.\n// Your task is to check if the string is happy or not.\n// A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n// For example:\nbool is_happy(std::string s) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = is_happy;\n assert(candidate((\"a\")) == (false));\n assert(candidate((\"aa\")) == (false));\n assert(candidate((\"abcd\")) == (true));\n assert(candidate((\"aabb\")) == (false));\n assert(candidate((\"adb\")) == (true));\n assert(candidate((\"xyy\")) == (false));\n assert(candidate((\"iopaxpoi\")) == (true));\n assert(candidate((\"iopaxioi\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that returns True if the object q will fly, and False otherwise.\n// The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n// Example:\n// # 1+2 is less than the maximum possible weight, but it's unbalanced.\n// # it's balanced, but 3+2+3 is more than the maximum possible weight.\n// # 3+2+3 is less than the maximum possible weight, and it's balanced.\n// # 3 is less than the maximum possible weight, and it's balanced.\nbool will_it_fly(std::vector q, long w) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = will_it_fly;\n assert(candidate((std::vector({(long)3, (long)2, (long)3})), (9)) == (true));\n assert(candidate((std::vector({(long)1, (long)2})), (5)) == (false));\n assert(candidate((std::vector({(long)3})), (5)) == (true));\n assert(candidate((std::vector({(long)3, (long)2, (long)3})), (1)) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)3})), (6)) == (false));\n assert(candidate((std::vector({(long)5})), (5)) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "cpp", - "prompt": "#include\n#include\n// Given an array of non-negative integers, return a copy of the given array after sorting,\n// you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n// or sort it in descending order if the sum( first index value, last index value) is even.\n// Note:\n// * don't change the given array.\n// Examples:\nstd::vector sort_array(std::vector array) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = sort_array;\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)5}))) == (std::vector({(long)5})));\n assert(candidate((std::vector({(long)2, (long)4, (long)3, (long)0, (long)1, (long)5}))) == (std::vector({(long)0, (long)1, (long)2, (long)3, (long)4, (long)5})));\n assert(candidate((std::vector({(long)2, (long)4, (long)3, (long)0, (long)1, (long)5, (long)6}))) == (std::vector({(long)6, (long)5, (long)4, (long)3, (long)2, (long)1, (long)0})));\n assert(candidate((std::vector({(long)2, (long)1}))) == (std::vector({(long)1, (long)2})));\n assert(candidate((std::vector({(long)15, (long)42, (long)87, (long)32, (long)11, (long)0}))) == (std::vector({(long)0, (long)11, (long)15, (long)32, (long)42, (long)87})));\n assert(candidate((std::vector({(long)21, (long)14, (long)23, (long)11}))) == (std::vector({(long)23, (long)21, (long)14, (long)11})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "cpp", - "prompt": "#include\n#include\n// Implement a function that takes an non-negative integer and returns an array of the first n\n// integers that are prime numbers and less than n.\n// for example:\nstd::vector count_up_to(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = count_up_to;\n assert(candidate((5)) == (std::vector({(long)2, (long)3})));\n assert(candidate((6)) == (std::vector({(long)2, (long)3, (long)5})));\n assert(candidate((7)) == (std::vector({(long)2, (long)3, (long)5})));\n assert(candidate((10)) == (std::vector({(long)2, (long)3, (long)5, (long)7})));\n assert(candidate((0)) == (std::vector()));\n assert(candidate((22)) == (std::vector({(long)2, (long)3, (long)5, (long)7, (long)11, (long)13, (long)17, (long)19})));\n assert(candidate((1)) == (std::vector()));\n assert(candidate((18)) == (std::vector({(long)2, (long)3, (long)5, (long)7, (long)11, (long)13, (long)17})));\n assert(candidate((47)) == (std::vector({(long)2, (long)3, (long)5, (long)7, (long)11, (long)13, (long)17, (long)19, (long)23, (long)29, (long)31, (long)37, (long)41, (long)43})));\n assert(candidate((101)) == (std::vector({(long)2, (long)3, (long)5, (long)7, (long)11, (long)13, (long)17, (long)19, (long)23, (long)29, (long)31, (long)37, (long)41, (long)43, (long)47, (long)53, (long)59, (long)61, (long)67, (long)71, (long)73, (long)79, (long)83, (long)89, (long)97})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "cpp", - "prompt": "#include\n#include\n// Out of list of strings, return the longest one. Return the first one in case of multiple\n// strings of the same length. Return None in case the input list is empty.\nstd::optional longest(std::vector strings) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = longest;\n assert(candidate((std::vector())) == std::nullopt);\n assert(candidate((std::vector({(std::string)\"x\", (std::string)\"y\", (std::string)\"z\"}))) == \"x\");\n assert(candidate((std::vector({(std::string)\"x\", (std::string)\"yyy\", (std::string)\"zzzz\", (std::string)\"www\", (std::string)\"kkkk\", (std::string)\"abc\"}))) == \"zzzz\");\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "cpp", - "prompt": "#include\n#include\n// Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n// reverse the resulting array, and then replace each digit by its corresponding name from\n// \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n// For example:\n// If the array is empty, return an empty array:\n// If the array has any strange number ignore it:\nstd::vector by_length(std::vector arr) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = by_length;\n assert(candidate((std::vector({(long)2, (long)1, (long)1, (long)4, (long)5, (long)8, (long)2, (long)3}))) == (std::vector({(std::string)\"Eight\", (std::string)\"Five\", (std::string)\"Four\", (std::string)\"Three\", (std::string)\"Two\", (std::string)\"Two\", (std::string)\"One\", (std::string)\"One\"})));\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)1, (long)-1, (long)55}))) == (std::vector({(std::string)\"One\"})));\n assert(candidate((std::vector({(long)1, (long)-1, (long)3, (long)2}))) == (std::vector({(std::string)\"Three\", (std::string)\"Two\", (std::string)\"One\"})));\n assert(candidate((std::vector({(long)9, (long)4, (long)8}))) == (std::vector({(std::string)\"Nine\", (std::string)\"Eight\", (std::string)\"Four\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_106_f", - "language": "cpp", - "prompt": "#include\n#include\n// Implement the function f that takes n as a parameter,\n// 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\n// or the sum of numbers from 1 to i otherwise.\n// i starts from 1.\n// the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n// Example:\nstd::vector f(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = f;\n assert(candidate((5)) == (std::vector({(long)1, (long)2, (long)6, (long)24, (long)15})));\n assert(candidate((7)) == (std::vector({(long)1, (long)2, (long)6, (long)24, (long)15, (long)720, (long)28})));\n assert(candidate((1)) == (std::vector({(long)1})));\n assert(candidate((3)) == (std::vector({(long)1, (long)2, (long)6})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "cpp", - "prompt": "#include\n#include\n// Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\nlong fizz_buzz(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = fizz_buzz;\n assert(candidate((50)) == (0));\n assert(candidate((78)) == (2));\n assert(candidate((79)) == (3));\n assert(candidate((100)) == (3));\n assert(candidate((200)) == (6));\n assert(candidate((4000)) == (192));\n assert(candidate((10000)) == (639));\n assert(candidate((100000)) == (8026));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "cpp", - "prompt": "#include\n#include\n// Given a positive floating point number, it can be decomposed into\n// and integer part (largest integer smaller than given number) and decimals\n// (leftover part always smaller than 1).\n// Return the decimal part of the number.\nfloat truncate_number(float number) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = truncate_number;\n assert(candidate((3.5)) == (0.5));\n assert(candidate((1.25)) == (0.25));\n assert(candidate((123.0)) == (0.0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "cpp", - "prompt": "#include\n#include\n// For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n// Empty sum should be equal to 0 and empty product should be equal to 1.\nstd::tuple sum_product(std::vector numbers) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = sum_product;\n assert(candidate((std::vector())) == (std::make_tuple(0, 1)));\n assert(candidate((std::vector({(long)1, (long)1, (long)1}))) == (std::make_tuple(3, 1)));\n assert(candidate((std::vector({(long)100, (long)0}))) == (std::make_tuple(100, 0)));\n assert(candidate((std::vector({(long)3, (long)5, (long)7}))) == (std::make_tuple(15, 105)));\n assert(candidate((std::vector({(long)10}))) == (std::make_tuple(10, 10)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a 2 dimensional data, as a nested lists,\n// which is similar to matrix, however, unlike matrices,\n// each row may contain a different number of columns.\n// Given lst, and integer x, find integers x in the list,\n// and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n// each tuple is a coordinate - (row, columns), starting with 0.\n// Sort coordinates initially by rows in ascending order.\n// Also, sort coordinates of the row by columns in descending order.\n// Examples:\nstd::vector> get_row(std::vector> lst, long x) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = get_row;\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)1, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)1})})), (1)) == (std::vector>({(std::tuple)std::make_tuple(0, 0), (std::tuple)std::make_tuple(1, 4), (std::tuple)std::make_tuple(1, 0), (std::tuple)std::make_tuple(2, 5), (std::tuple)std::make_tuple(2, 0)})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6})})), (2)) == (std::vector>({(std::tuple)std::make_tuple(0, 1), (std::tuple)std::make_tuple(1, 1), (std::tuple)std::make_tuple(2, 1), (std::tuple)std::make_tuple(3, 1), (std::tuple)std::make_tuple(4, 1), (std::tuple)std::make_tuple(5, 1)})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)1, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)1, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)1, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)1, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)1})})), (1)) == (std::vector>({(std::tuple)std::make_tuple(0, 0), (std::tuple)std::make_tuple(1, 0), (std::tuple)std::make_tuple(2, 1), (std::tuple)std::make_tuple(2, 0), (std::tuple)std::make_tuple(3, 2), (std::tuple)std::make_tuple(3, 0), (std::tuple)std::make_tuple(4, 3), (std::tuple)std::make_tuple(4, 0), (std::tuple)std::make_tuple(5, 4), (std::tuple)std::make_tuple(5, 0), (std::tuple)std::make_tuple(6, 5), (std::tuple)std::make_tuple(6, 0)})));\n assert(candidate((std::vector>()), (1)) == (std::vector>()));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1})})), (2)) == (std::vector>()));\n assert(candidate((std::vector>({(std::vector)std::vector(), (std::vector)std::vector({(long)1}), (std::vector)std::vector({(long)1, (long)2, (long)3})})), (3)) == (std::vector>({(std::tuple)std::make_tuple(2, 2)})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "cpp", - "prompt": "#include\n#include\n// You're a hungry rabbit, and you already have eaten a certain number of carrots,\n// but now you need to eat more carrots to complete the day's meals.\n// you should return an array of [ total number of eaten carrots after your meals,\n// the number of carrots left after your meals ]\n// if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n// Example:\n// Variables:\n// @number : integer\n// the number of carrots that you have eaten.\n// @need : integer\n// the number of carrots that you need to eat.\n// @remaining : integer\n// the number of remaining carrots thet exist in stock\n// Constrain:\n// * 0 <= number <= 1000\n// * 0 <= need <= 1000\n// * 0 <= remaining <= 1000\n// Have fun :)\nstd::vector eat(long number, long need, long remaining) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = eat;\n assert(candidate((5), (6), (10)) == (std::vector({(long)11, (long)4})));\n assert(candidate((4), (8), (9)) == (std::vector({(long)12, (long)1})));\n assert(candidate((1), (10), (10)) == (std::vector({(long)11, (long)0})));\n assert(candidate((2), (11), (5)) == (std::vector({(long)7, (long)0})));\n assert(candidate((4), (5), (7)) == (std::vector({(long)9, (long)2})));\n assert(candidate((4), (5), (1)) == (std::vector({(long)5, (long)0})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "cpp", - "prompt": "#include\n#include\n// Given a positive integer N, return the total sum of its digits in binary.\n// Example\n// Variables:\n// @N integer\n// Constraints: 0 \u2264 N \u2264 10000.\n// Output:\n// a string of binary number\nstd::string solve(long N) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = solve;\n assert(candidate((1000)) == (\"1\"));\n assert(candidate((150)) == (\"110\"));\n assert(candidate((147)) == (\"1100\"));\n assert(candidate((333)) == (\"1001\"));\n assert(candidate((963)) == (\"10010\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a list of integers.\n// You need to find the largest prime value and return the sum of its digits.\n// Examples:\nlong skjkasdkd(std::vector lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = skjkasdkd;\n assert(candidate((std::vector({(long)0, (long)3, (long)2, (long)1, (long)3, (long)5, (long)7, (long)4, (long)5, (long)5, (long)5, (long)2, (long)181, (long)32, (long)4, (long)32, (long)3, (long)2, (long)32, (long)324, (long)4, (long)3}))) == (10));\n assert(candidate((std::vector({(long)1, (long)0, (long)1, (long)8, (long)2, (long)4597, (long)2, (long)1, (long)3, (long)40, (long)1, (long)2, (long)1, (long)2, (long)4, (long)2, (long)5, (long)1}))) == (25));\n assert(candidate((std::vector({(long)1, (long)3, (long)1, (long)32, (long)5107, (long)34, (long)83278, (long)109, (long)163, (long)23, (long)2323, (long)32, (long)30, (long)1, (long)9, (long)3}))) == (13));\n assert(candidate((std::vector({(long)0, (long)724, (long)32, (long)71, (long)99, (long)32, (long)6, (long)0, (long)5, (long)91, (long)83, (long)0, (long)5, (long)6}))) == (11));\n assert(candidate((std::vector({(long)0, (long)81, (long)12, (long)3, (long)1, (long)21}))) == (3));\n assert(candidate((std::vector({(long)0, (long)8, (long)1, (long)2, (long)1, (long)7}))) == (7));\n assert(candidate((std::vector({(long)8191}))) == (19));\n assert(candidate((std::vector({(long)8191, (long)123456, (long)127, (long)7}))) == (19));\n assert(candidate((std::vector({(long)127, (long)97, (long)8192}))) == (10));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "cpp", - "prompt": "#include\n#include\n// Given an array arr of integers, find the minimum number of elements that\n// need to be changed to make the array palindromic. A palindromic array is an array that\n// is read the same backwards and forwards. In one change, you can change one element to any other element.\n// For example:\nlong smallest_change(std::vector arr) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = smallest_change;\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)5, (long)4, (long)7, (long)9, (long)6}))) == (4));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)3, (long)2, (long)2}))) == (1));\n assert(candidate((std::vector({(long)1, (long)4, (long)2}))) == (1));\n assert(candidate((std::vector({(long)1, (long)4, (long)4, (long)2}))) == (1));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)2, (long)1}))) == (0));\n assert(candidate((std::vector({(long)3, (long)1, (long)1, (long)3}))) == (0));\n assert(candidate((std::vector({(long)1}))) == (0));\n assert(candidate((std::vector({(long)0, (long)1}))) == (1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "cpp", - "prompt": "#include\n#include\n// It is the last week of the semester and the teacher has to give the grades\n// to students. The teacher has been making her own algorithm for grading.\n// The only problem is, she has lost the code she used for grading.\n// She has given you a list of GPAs for some students and you have to write \n// a function that can output a list of letter grades using the following table:\n// GPA | Letter grade\n// 4.0 A+\n// > 3.7 A \n// > 3.3 A- \n// > 3.0 B+\n// > 2.7 B \n// > 2.3 B-\n// > 2.0 C+\n// > 1.7 C\n// > 1.3 C-\n// > 1.0 D+ \n// > 0.7 D \n// > 0.0 D-\n// 0.0 E\n// Example:\nstd::vector numerical_letter_grade(std::vector grades) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = numerical_letter_grade;\n assert(candidate((std::vector({(float)4.0, (float)3, (float)1.7, (float)2, (float)3.5}))) == (std::vector({(std::string)\"A+\", (std::string)\"B\", (std::string)\"C-\", (std::string)\"C\", (std::string)\"A-\"})));\n assert(candidate((std::vector({(float)1.2}))) == (std::vector({(std::string)\"D+\"})));\n assert(candidate((std::vector({(float)0.5}))) == (std::vector({(std::string)\"D-\"})));\n assert(candidate((std::vector({(float)0.0}))) == (std::vector({(std::string)\"E\"})));\n assert(candidate((std::vector({(float)1.0, (float)0.3, (float)1.5, (float)2.8, (float)3.3}))) == (std::vector({(std::string)\"D\", (std::string)\"D-\", (std::string)\"C-\", (std::string)\"B\", (std::string)\"B+\"})));\n assert(candidate((std::vector({(float)0.0, (float)0.7}))) == (std::vector({(std::string)\"E\", (std::string)\"D-\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "cpp", - "prompt": "#include\n#include\n// Given the lengths of the three sides of a triangle. Return the area of\n// the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n// Otherwise return -1\n// Three sides make a valid triangle when the sum of any two sides is greater \n// than the third side.\n// Example:\nfloat triangle_area(long a, long b, long c) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = triangle_area;\n assert(candidate((3), (4), (5)) == (6.0));\n assert(candidate((1), (2), (10)) == (float(-1)));\n assert(candidate((4), (8), (5)) == (8.18));\n assert(candidate((2), (2), (2)) == (1.73));\n assert(candidate((1), (2), (3)) == (float(-1)));\n assert(candidate((10), (5), (7)) == (16.25));\n assert(candidate((2), (6), (3)) == (float(-1)));\n assert(candidate((1), (1), (1)) == (0.43));\n assert(candidate((2), (2), (10)) == (float(-1)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "cpp", - "prompt": "#include\n#include\n// Check if two words have the same characters.\nbool same_chars(std::string s0, std::string s1) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = same_chars;\n assert(candidate((\"eabcdzzzz\"), (\"dddzzzzzzzddeddabc\")) == (true));\n assert(candidate((\"abcd\"), (\"dddddddabc\")) == (true));\n assert(candidate((\"dddddddabc\"), (\"abcd\")) == (true));\n assert(candidate((\"eabcd\"), (\"dddddddabc\")) == (false));\n assert(candidate((\"abcd\"), (\"dddddddabcf\")) == (false));\n assert(candidate((\"eabcdzzzz\"), (\"dddzzzzzzzddddabc\")) == (false));\n assert(candidate((\"aabb\"), (\"aaccc\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "cpp", - "prompt": "#include\n#include\n// Given an array of integers nums, find the minimum sum of any non-empty sub-array\n// of nums.\n// Example\nlong minSubArraySum(std::vector nums) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = minSubArraySum;\n assert(candidate((std::vector({(long)2, (long)3, (long)4, (long)1, (long)2, (long)4}))) == (1));\n assert(candidate((std::vector({(long)-1, (long)-2, (long)-3}))) == (-6));\n assert(candidate((std::vector({(long)-1, (long)-2, (long)-3, (long)2, (long)-10}))) == (-14));\n assert(candidate((std::vector({(long)-9999999999999999}))) == (-9999999999999999));\n assert(candidate((std::vector({(long)0, (long)10, (long)20, (long)1000000}))) == (0));\n assert(candidate((std::vector({(long)-1, (long)-2, (long)-3, (long)10, (long)-5}))) == (-6));\n assert(candidate((std::vector({(long)100, (long)-1, (long)-2, (long)-3, (long)10, (long)-5}))) == (-6));\n assert(candidate((std::vector({(long)10, (long)11, (long)13, (long)8, (long)3, (long)4}))) == (3));\n assert(candidate((std::vector({(long)100, (long)-33, (long)32, (long)-1, (long)0, (long)-2}))) == (-33));\n assert(candidate((std::vector({(long)-10}))) == (-10));\n assert(candidate((std::vector({(long)7}))) == (7));\n assert(candidate((std::vector({(long)1, (long)-1}))) == (-1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "cpp", - "prompt": "#include\n#include\n// Given a string s and a natural number n, you have been tasked to implement \n// a function that returns a list of all words from string s that contain exactly \n// n consonants, in order these words appear in the string s.\n// If the string s is empty then the function should return an empty list.\n// Note: you may assume the input string contains only letters and spaces.\n// Examples:\nstd::vector select_words(std::string s, long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = select_words;\n assert(candidate((\"Mary had a little lamb\"), (4)) == (std::vector({(std::string)\"little\"})));\n assert(candidate((\"Mary had a little lamb\"), (3)) == (std::vector({(std::string)\"Mary\", (std::string)\"lamb\"})));\n assert(candidate((\"simple white space\"), (2)) == (std::vector()));\n assert(candidate((\"Hello world\"), (4)) == (std::vector({(std::string)\"world\"})));\n assert(candidate((\"Uncle sam\"), (3)) == (std::vector({(std::string)\"Uncle\"})));\n assert(candidate((\"\"), (4)) == (std::vector()));\n assert(candidate((\"a b c d e f\"), (1)) == (std::vector({(std::string)\"b\", (std::string)\"c\", (std::string)\"d\", (std::string)\"f\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "cpp", - "prompt": "#include\n#include\n// Return list of all prefixes from shortest to longest of the input string\nstd::vector all_prefixes(std::string string) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = all_prefixes;\n assert(candidate((\"\")) == (std::vector()));\n assert(candidate((\"asdfgh\")) == (std::vector({(std::string)\"a\", (std::string)\"as\", (std::string)\"asd\", (std::string)\"asdf\", (std::string)\"asdfg\", (std::string)\"asdfgh\"})));\n assert(candidate((\"WWW\")) == (std::vector({(std::string)\"W\", (std::string)\"WW\", (std::string)\"WWW\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function that takes a value (string) representing a number\n// and returns the closest integer to it. If the number is equidistant\n// from two integers, round it away from zero.\n// Examples\n// Note:\n// Rounding away from zero means that if the given number is equidistant\n// from two integers, the one you should return is the one that is the\n// farthest from zero. For example closest_integer(\"14.5\") should\n// return 15 and closest_integer(\"-14.5\") should return -15.\nlong closest_integer(std::string value) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = closest_integer;\n assert(candidate((\"10\")) == (10));\n assert(candidate((\"14.5\")) == (15));\n assert(candidate((\"-15.5\")) == (-16));\n assert(candidate((\"15.3\")) == (15));\n assert(candidate((\"0\")) == (0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function which takes a string representing a file's name, and returns\n// 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n// A file's name is considered to be valid if and only if all the following conditions \n// are met:\n// - There should not be more than three digits ('0'-'9') in the file's name.\n// - The file's name contains exactly one dot '.'\n// - The substring before the dot should not be empty, and it starts with a letter from \n// the latin alphapet ('a'-'z' and 'A'-'Z').\n// - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n// Examples:\nstd::string file_name_check(std::string file_name) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = file_name_check;\n assert(candidate((\"example.txt\")) == (\"Yes\"));\n assert(candidate((\"1example.dll\")) == (\"No\"));\n assert(candidate((\"s1sdf3.asd\")) == (\"No\"));\n assert(candidate((\"K.dll\")) == (\"Yes\"));\n assert(candidate((\"MY16FILE3.exe\")) == (\"Yes\"));\n assert(candidate((\"His12FILE94.exe\")) == (\"No\"));\n assert(candidate((\"_Y.txt\")) == (\"No\"));\n assert(candidate((\"?aREYA.exe\")) == (\"No\"));\n assert(candidate((\"/this_is_valid.dll\")) == (\"No\"));\n assert(candidate((\"this_is_valid.wow\")) == (\"No\"));\n assert(candidate((\"this_is_valid.txt\")) == (\"Yes\"));\n assert(candidate((\"this_is_valid.txtexe\")) == (\"No\"));\n assert(candidate((\"#this2_i4s_5valid.ten\")) == (\"No\"));\n assert(candidate((\"@this1_is6_valid.exe\")) == (\"No\"));\n assert(candidate((\"this_is_12valid.6exe4.txt\")) == (\"No\"));\n assert(candidate((\"all.exe.txt\")) == (\"No\"));\n assert(candidate((\"I563_No.exe\")) == (\"Yes\"));\n assert(candidate((\"Is3youfault.txt\")) == (\"Yes\"));\n assert(candidate((\"no_one#knows.dll\")) == (\"Yes\"));\n assert(candidate((\"1I563_Yes3.exe\")) == (\"No\"));\n assert(candidate((\"I563_Yes3.txtt\")) == (\"No\"));\n assert(candidate((\"final..txt\")) == (\"No\"));\n assert(candidate((\"final132\")) == (\"No\"));\n assert(candidate((\"_f4indsartal132.\")) == (\"No\"));\n assert(candidate((\".txt\")) == (\"No\"));\n assert(candidate((\"s.\")) == (\"No\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "cpp", - "prompt": "#include\n#include\n// You are given two intervals,\n// where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n// The given intervals are closed which means that the interval (start, end)\n// includes both start and end.\n// For each given interval, it is assumed that its start is less or equal its end.\n// Your task is to determine whether the length of intersection of these two \n// intervals is a prime number.\n// Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n// which its length is 1, which not a prime number.\n// If the length of the intersection is a prime number, return \"YES\",\n// otherwise, return \"NO\".\n// If the two intervals don't intersect, return \"NO\".\n// [input/output] samples:\nstd::string intersection(std::tuple interval1, std::tuple interval2) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = intersection;\n assert(candidate((std::make_tuple(1, 2)), (std::make_tuple(2, 3))) == (\"NO\"));\n assert(candidate((std::make_tuple(-1, 1)), (std::make_tuple(0, 4))) == (\"NO\"));\n assert(candidate((std::make_tuple(-3, -1)), (std::make_tuple(-5, 5))) == (\"YES\"));\n assert(candidate((std::make_tuple(-2, 2)), (std::make_tuple(-4, 0))) == (\"YES\"));\n assert(candidate((std::make_tuple(-11, 2)), (std::make_tuple(-1, -1))) == (\"NO\"));\n assert(candidate((std::make_tuple(1, 2)), (std::make_tuple(3, 5))) == (\"NO\"));\n assert(candidate((std::make_tuple(1, 2)), (std::make_tuple(1, 2))) == (\"NO\"));\n assert(candidate((std::make_tuple(-2, -2)), (std::make_tuple(-3, -2))) == (\"NO\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "cpp", - "prompt": "#include\n#include\n// Return the largest prime factor of n. Assume n > 1 and is not a prime.\nlong largest_prime_factor(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = largest_prime_factor;\n assert(candidate((15)) == (5));\n assert(candidate((27)) == (3));\n assert(candidate((63)) == (7));\n assert(candidate((330)) == (11));\n assert(candidate((13195)) == (29));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "cpp", - "prompt": "#include\n#include\n// Given a string, find out how many distinct characters (regardless of case) does it consist of\nlong count_distinct_characters(std::string string) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = count_distinct_characters;\n assert(candidate((\"\")) == (0));\n assert(candidate((\"abcde\")) == (5));\n assert(candidate((\"abcdecadeCADE\")) == (5));\n assert(candidate((\"aaaaAAAAaaaa\")) == (1));\n assert(candidate((\"Jerry jERRY JeRRRY\")) == (5));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "cpp", - "prompt": "#include\n#include\n// You're given a list of deposit and withdrawal operations on a bank account that starts with\n// zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n// at that point function should return True. Otherwise it should return False.\nbool below_zero(std::vector operations) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = below_zero;\n assert(candidate((std::vector())) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)-3, (long)1, (long)2, (long)-3}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)-4, (long)5, (long)6}))) == (true));\n assert(candidate((std::vector({(long)1, (long)-1, (long)2, (long)-2, (long)5, (long)-5, (long)4, (long)-4}))) == (false));\n assert(candidate((std::vector({(long)1, (long)-1, (long)2, (long)-2, (long)5, (long)-5, (long)4, (long)-5}))) == (true));\n assert(candidate((std::vector({(long)1, (long)-2, (long)2, (long)-2, (long)5, (long)-5, (long)4, (long)-4}))) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "cpp", - "prompt": "#include\n#include\n// Find the shortest palindrome that begins with a supplied string.\n// Algorithm idea is simple:\n// - Find the longest postfix of supplied string that is a palindrome.\n// - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\nstd::string make_palindrome(std::string string) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = make_palindrome;\n assert(candidate((\"\")) == (\"\"));\n assert(candidate((\"x\")) == (\"x\"));\n assert(candidate((\"xyz\")) == (\"xyzyx\"));\n assert(candidate((\"xyx\")) == (\"xyx\"));\n assert(candidate((\"jerry\")) == (\"jerryrrej\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "cpp", - "prompt": "#include\n#include\n// Given a positive integer, obtain its roman numeral equivalent as a string,\n// and return it in lowercase.\n// Restrictions: 1 <= num <= 1000\n// Examples:\nstd::string int_to_mini_roman(long number) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = int_to_mini_roman;\n assert(candidate((19)) == (\"xix\"));\n assert(candidate((152)) == (\"clii\"));\n assert(candidate((251)) == (\"ccli\"));\n assert(candidate((426)) == (\"cdxxvi\"));\n assert(candidate((500)) == (\"d\"));\n assert(candidate((1)) == (\"i\"));\n assert(candidate((4)) == (\"iv\"));\n assert(candidate((43)) == (\"xliii\"));\n assert(candidate((90)) == (\"xc\"));\n assert(candidate((94)) == (\"xciv\"));\n assert(candidate((532)) == (\"dxxxii\"));\n assert(candidate((900)) == (\"cm\"));\n assert(candidate((994)) == (\"cmxciv\"));\n assert(candidate((1000)) == (\"m\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - } -] \ No newline at end of file diff --git a/data/cpp-reworded.json b/data/cpp-reworded.json deleted file mode 100644 index e0a4f5c2d8aec34a5e3a3a2548578a9fbb887073..0000000000000000000000000000000000000000 --- a/data/cpp-reworded.json +++ /dev/null @@ -1,1934 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "cpp", - "prompt": "#include\n#include\n// For a given number n, find the largest number that divides n evenly, smaller than n\n// >>> largest_divisor((15))\n// (5)\nlong largest_divisor(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = largest_divisor;\n assert(candidate((3)) == (1));\n assert(candidate((7)) == (1));\n assert(candidate((10)) == (5));\n assert(candidate((100)) == (50));\n assert(candidate((49)) == (7));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_47_median", - "language": "cpp", - "prompt": "#include\n#include\n// Return median of elements in the vector l.\n// >>> median((std::vector({(long)3, (long)1, (long)2, (long)4, (long)5})))\n// (float(3))\n// >>> median((std::vector({(long)-10, (long)4, (long)6, (long)1000, (long)10, (long)20})))\n// (15.0)\nfloat median(std::vector l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = median;\n assert(candidate((std::vector({(long)3, (long)1, (long)2, (long)4, (long)5}))) == (float(3)));\n assert(candidate((std::vector({(long)-10, (long)4, (long)6, (long)1000, (long)10, (long)20}))) == (8.0));\n assert(candidate((std::vector({(long)5}))) == (float(5)));\n assert(candidate((std::vector({(long)6, (long)5}))) == (5.5));\n assert(candidate((std::vector({(long)8, (long)1, (long)3, (long)9, (long)9, (long)2, (long)7}))) == (float(7)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "cpp", - "prompt": "#include\n#include\n// Given two vectors operator, and operand. The first vector has basic algebra operations, and \n// the second vector is a vector of integers. Use the two given vectors to build the algebric \n// expression and return the evaluation of this expression.\n// The basic algebra operations:\n// Addition ( + ) \n// Subtraction ( - ) \n// Multiplication ( * ) \n// Floor division ( // ) \n// Exponentiation ( ** ) \n// Example:\n// operator['+', '*', '-']\n// vector = [2, 3, 4, 5]\n// result = 2 + 3 * 4 - 5\n// => result = 9\n// Note:\n// The length of operator vector is equal to the length of operand vector minus one.\n// Operand is a vector of of non-negative integers.\n// Operator vector has at least one operator, and operand vector has at least two operands.\nlong do_algebra(std::vector op, std::vector operand) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = do_algebra;\n assert(candidate((std::vector({(std::string)\"**\", (std::string)\"*\", (std::string)\"+\"})), (std::vector({(long)2, (long)3, (long)4, (long)5}))) == (37));\n assert(candidate((std::vector({(std::string)\"+\", (std::string)\"*\", (std::string)\"-\"})), (std::vector({(long)2, (long)3, (long)4, (long)5}))) == (9));\n assert(candidate((std::vector({(std::string)\"//\", (std::string)\"*\"})), (std::vector({(long)7, (long)3, (long)4}))) == (8));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "cpp", - "prompt": "#include\n#include\n// Return maximum element in the vector.\n// >>> max_element((std::vector({(long)1, (long)2, (long)3})))\n// (3)\n// >>> max_element((std::vector({(long)5, (long)3, (long)-5, (long)2, (long)-3, (long)3, (long)9, (long)0, (long)123, (long)1, (long)-10})))\n// (123)\nlong max_element(std::vector l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = max_element;\n assert(candidate((std::vector({(long)1, (long)2, (long)3}))) == (3));\n assert(candidate((std::vector({(long)5, (long)3, (long)-5, (long)2, (long)-3, (long)3, (long)9, (long)0, (long)124, (long)1, (long)-10}))) == (124));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function which returns the largest index of an element which\n// is not greater than or equal to the element immediately preceding it. If\n// no such element exists then return -1. The given vector will not contain\n// duplicate values.\n// Examples:\n// >>> can_arrange((std::vector({(long)1, (long)2, (long)4, (long)3, (long)5})))\n// (3)\n// >>> can_arrange((std::vector({(long)1, (long)2, (long)3})))\n// (-1)\nlong can_arrange(std::vector arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = can_arrange;\n assert(candidate((std::vector({(long)1, (long)2, (long)4, (long)3, (long)5}))) == (3));\n assert(candidate((std::vector({(long)1, (long)2, (long)4, (long)5}))) == (-1));\n assert(candidate((std::vector({(long)1, (long)4, (long)2, (long)5, (long)6, (long)7, (long)8, (long)9, (long)10}))) == (2));\n assert(candidate((std::vector({(long)4, (long)8, (long)5, (long)7, (long)3}))) == (4));\n assert(candidate((std::vector())) == (-1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "cpp", - "prompt": "#include\n#include\n// Imagine a road that's a perfectly straight infinitely long line.\n// n cars are driving left to right; simultaneously, a different set of n cars\n// are driving right to left. The two sets of cars start out being very far from\n// each other. All cars move in the same speed. Two cars are said to collide\n// when a car that's moving left to right hits a car that's moving right to left.\n// However, the cars are infinitely sturdy and strong; as a result, they continue moving\n// in their trajectory as if they did not collide.\n// This function outputs the number of such collisions.\nlong car_race_collision(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = car_race_collision;\n assert(candidate((2)) == (4));\n assert(candidate((3)) == (9));\n assert(candidate((4)) == (16));\n assert(candidate((8)) == (64));\n assert(candidate((10)) == (100));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function that returns true if the last character\n// of a given string is an alphabetical character and is not\n// a part of a word, and false otherwise.\n// Note: \"word\" is a group of characters separated by space.\n// Examples:\n// >>> check_if_last_char_is_a_letter((\"apple pie\"))\n// (false)\n// >>> check_if_last_char_is_a_letter((\"apple pi e\"))\n// (true)\n// >>> check_if_last_char_is_a_letter((\"apple pi e \"))\n// (false)\n// >>> check_if_last_char_is_a_letter((\"\"))\n// (false)\nbool check_if_last_char_is_a_letter(std::string txt) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = check_if_last_char_is_a_letter;\n assert(candidate((\"apple\")) == (false));\n assert(candidate((\"apple pi e\")) == (true));\n assert(candidate((\"eeeee\")) == (false));\n assert(candidate((\"A\")) == (true));\n assert(candidate((\"Pumpkin pie \")) == (false));\n assert(candidate((\"Pumpkin pie 1\")) == (false));\n assert(candidate((\"\")) == (false));\n assert(candidate((\"eeeee e \")) == (false));\n assert(candidate((\"apple pie\")) == (false));\n assert(candidate((\"apple pi e \")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "cpp", - "prompt": "#include\n#include\n// Return true if a given number is prime, and false otherwise.\n// >>> is_prime((6))\n// (false)\n// >>> is_prime((101))\n// (true)\n// >>> is_prime((11))\n// (true)\n// >>> is_prime((13441))\n// (true)\n// >>> is_prime((61))\n// (true)\n// >>> is_prime((4))\n// (false)\n// >>> is_prime((1))\n// (false)\nbool is_prime(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = is_prime;\n assert(candidate((6)) == (false));\n assert(candidate((101)) == (true));\n assert(candidate((11)) == (true));\n assert(candidate((13441)) == (true));\n assert(candidate((61)) == (true));\n assert(candidate((4)) == (false));\n assert(candidate((1)) == (false));\n assert(candidate((5)) == (true));\n assert(candidate((11)) == (true));\n assert(candidate((17)) == (true));\n assert(candidate((85)) == (false));\n assert(candidate((77)) == (false));\n assert(candidate((255379)) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "cpp", - "prompt": "#include\n#include\n// Given a vector of positive integers x. return a sorted vector of all \n// elements that hasn't any even digit.\n// Note: Returned vector should be sorted in increasing order.\n// For example:\n// >>> unique_digits((std::vector({(long)15, (long)33, (long)1422, (long)1})))\n// (std::vector({(long)1, (long)15, (long)33}))\n// >>> unique_digits((std::vector({(long)152, (long)323, (long)1422, (long)10})))\n// (std::vector())\nstd::vector unique_digits(std::vector x) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = unique_digits;\n assert(candidate((std::vector({(long)15, (long)33, (long)1422, (long)1}))) == (std::vector({(long)1, (long)15, (long)33})));\n assert(candidate((std::vector({(long)152, (long)323, (long)1422, (long)10}))) == (std::vector()));\n assert(candidate((std::vector({(long)12345, (long)2033, (long)111, (long)151}))) == (std::vector({(long)111, (long)151})));\n assert(candidate((std::vector({(long)135, (long)103, (long)31}))) == (std::vector({(long)31, (long)135})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "cpp", - "prompt": "#include\n#include\n// Input are two strings a and b consisting only of 1s and 0s.\n// Perform binary XOR on these inputs and return result also as a string.\n// >>> string_xor((\"010\"), (\"110\"))\n// (\"100\")\nstd::string string_xor(std::string a, std::string b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = string_xor;\n assert(candidate((\"111000\"), (\"101010\")) == (\"010010\"));\n assert(candidate((\"1\"), (\"1\")) == (\"0\"));\n assert(candidate((\"0101\"), (\"0000\")) == (\"0101\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "cpp", - "prompt": "#include\n#include\n// sum_to_n is a function that sums numbers from 1 to n.\n// >>> sum_to_n((30))\n// (465)\n// >>> sum_to_n((100))\n// (5050)\n// >>> sum_to_n((5))\n// (15)\n// >>> sum_to_n((10))\n// (55)\n// >>> sum_to_n((1))\n// (1)\nlong sum_to_n(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = sum_to_n;\n assert(candidate((1)) == (1));\n assert(candidate((6)) == (21));\n assert(candidate((11)) == (66));\n assert(candidate((30)) == (465));\n assert(candidate((100)) == (5050));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "cpp", - "prompt": "#include\n#include\n// Given a vector of numbers, return the sum of squares of the numbers\n// in the vector that are odd. Ignore numbers that are negative or not integers.\n// >>> double_the_difference((std::vector({(long)1, (long)3, (long)2, (long)0})))\n// (10)\n// >>> double_the_difference((std::vector({(long)-1, (long)-2, (long)0})))\n// (0)\n// >>> double_the_difference((std::vector({(long)9, (long)-2})))\n// (81)\n// >>> double_the_difference((std::vector({(long)0})))\n// (0)\n// If the input vector is empty, return 0.\nlong double_the_difference(std::vector lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = double_the_difference;\n assert(candidate((std::vector())) == (0));\n assert(candidate((std::vector({(float)5.0, (float)4.0}))) == (25));\n assert(candidate((std::vector({(float)0.1, (float)0.2, (float)0.3}))) == (0));\n assert(candidate((std::vector({(float)-10.0, (float)-20.0, (float)-30.0}))) == (0));\n assert(candidate((std::vector({(float)-1.0, (float)-2.0, (float)8.0}))) == (0));\n assert(candidate((std::vector({(float)0.2, (float)3.0, (float)5.0}))) == (34));\n assert(candidate((std::vector({(float)-9.0, (float)-7.0, (float)-5.0, (float)-3.0, (float)-1.0, (float)1.0, (float)3.0, (float)5.0, (float)7.0, (float)9.0}))) == (165));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "cpp", - "prompt": "#include\n#include\n// Return length of given string\n// >>> string_length((\"\"))\n// (0)\n// >>> string_length((\"abc\"))\n// (3)\nlong string_length(std::string string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = string_length;\n assert(candidate((\"\")) == (0));\n assert(candidate((\"x\")) == (1));\n assert(candidate((\"asdasnakj\")) == (9));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "cpp", - "prompt": "#include\n#include\n// You'll be given a string of words, and your task is to count the number\n// of boredoms. A boredom is a sentence that starts with the word \"I\".\n// Sentences are delimited by '.', '?' or '!'.\n// For example:\n// >>> is_bored((\"Hello world\"))\n// (0)\n// >>> is_bored((\"The sky is blue. The sun is shining. I love this weather\"))\n// (1)\nlong is_bored(std::string S) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = is_bored;\n assert(candidate((\"Hello world\")) == (0));\n assert(candidate((\"Is the sky blue?\")) == (0));\n assert(candidate((\"I love It !\")) == (1));\n assert(candidate((\"bIt\")) == (0));\n assert(candidate((\"I feel good today. I will be productive. will kill It\")) == (2));\n assert(candidate((\"You and I are going for a walk\")) == (0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function vowels_count which takes a string representing\n// a word as input and returns the number of vowels in the string.\n// Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n// vowel, but only when it is at the end of the given word.\n// Example:\n// >>> vowels_count((\"abcde\"))\n// (2)\n// >>> vowels_count((\"ACEDY\"))\n// (3)\nlong vowels_count(std::string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = vowels_count;\n assert(candidate((\"abcde\")) == (2));\n assert(candidate((\"Alone\")) == (3));\n assert(candidate((\"key\")) == (2));\n assert(candidate((\"bye\")) == (1));\n assert(candidate((\"keY\")) == (2));\n assert(candidate((\"bYe\")) == (1));\n assert(candidate((\"ACEDY\")) == (3));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "cpp", - "prompt": "#include\n#include\n// Return n-th Fibonacci number.\n// >>> fib((10))\n// (55)\n// >>> fib((1))\n// (1)\n// >>> fib((8))\n// (21)\nlong fib(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = fib;\n assert(candidate((10)) == (55));\n assert(candidate((1)) == (1));\n assert(candidate((8)) == (21));\n assert(candidate((11)) == (89));\n assert(candidate((12)) == (144));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "cpp", - "prompt": "#include\n#include\n// Your task is to implement a function that will simplify the expression\n// x * n. The function returns true if x * n evaluates to a whole number and false\n// otherwise. Both x and n, are string representation of a fraction, and have the following format,\n// / where both numerator and denominator are positive whole numbers.\n// You can assume that x, and n are valid fractions, and do not have zero as denominator.\n// >>> simplify((\"1/5\"), (\"5/1\"))\n// (true)\n// >>> simplify((\"1/6\"), (\"2/1\"))\n// (false)\n// >>> simplify((\"7/10\"), (\"10/2\"))\n// (false)\nbool simplify(std::string x, std::string n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = simplify;\n assert(candidate((\"1/5\"), (\"5/1\")) == (true));\n assert(candidate((\"1/6\"), (\"2/1\")) == (false));\n assert(candidate((\"5/1\"), (\"3/1\")) == (true));\n assert(candidate((\"7/10\"), (\"10/2\")) == (false));\n assert(candidate((\"2/10\"), (\"50/10\")) == (true));\n assert(candidate((\"7/2\"), (\"4/2\")) == (true));\n assert(candidate((\"11/6\"), (\"6/1\")) == (true));\n assert(candidate((\"2/3\"), (\"5/2\")) == (false));\n assert(candidate((\"5/2\"), (\"3/5\")) == (false));\n assert(candidate((\"2/4\"), (\"8/4\")) == (true));\n assert(candidate((\"2/4\"), (\"4/2\")) == (true));\n assert(candidate((\"1/5\"), (\"5/1\")) == (true));\n assert(candidate((\"1/5\"), (\"1/5\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "cpp", - "prompt": "#include\n#include\n// Given a string s, count the number of uppercase vowels in even indices.\n// For example:\n// >>> count_upper((\"aBCdEf\"))\n// (1)\n// >>> count_upper((\"abcdefg\"))\n// (0)\n// >>> count_upper((\"dBBE\"))\n// (0)\nlong count_upper(std::string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = count_upper;\n assert(candidate((\"aBCdEf\")) == (1));\n assert(candidate((\"abcdefg\")) == (0));\n assert(candidate((\"dBBE\")) == (0));\n assert(candidate((\"B\")) == (0));\n assert(candidate((\"U\")) == (1));\n assert(candidate((\"\")) == (0));\n assert(candidate((\"EEEE\")) == (2));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a rectangular grid of wells. Each row represents a single well,\n// and each 1 in a row represents a single unit of water.\n// Each well has a corresponding bucket that can be used to extract water from it, \n// and all buckets have the same capacity.\n// Your task is to use the buckets to empty the wells.\n// Output the number of times you need to lower the buckets.\n// Example 1:\n// >>> max_fill((std::vector>({(std::vector)std::vector({(long)0, (long)0, (long)1, (long)0}), (std::vector)std::vector({(long)0, (long)1, (long)0, (long)0}), (std::vector)std::vector({(long)1, (long)1, (long)1, (long)1})})), (1))\n// (6)\n// Example 2:\n// >>> max_fill((std::vector>({(std::vector)std::vector({(long)0, (long)0, (long)1, (long)1}), (std::vector)std::vector({(long)0, (long)0, (long)0, (long)0}), (std::vector)std::vector({(long)1, (long)1, (long)1, (long)1}), (std::vector)std::vector({(long)0, (long)1, (long)1, (long)1})})), (2))\n// (5)\n// Example 3:\n// >>> max_fill((std::vector>({(std::vector)std::vector({(long)0, (long)0, (long)0}), (std::vector)std::vector({(long)0, (long)0, (long)0})})), (5))\n// (0)\n// Constraints:\n// * all wells have the same length\n// * 1 <= grid.length <= 10^2\n// * 1 <= grid[:,1].length <= 10^2\n// * grid[i][j] -> 0 | 1\n// * 1 <= capacity <= 10\nlong max_fill(std::vector> grid, long capacity) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = max_fill;\n assert(candidate((std::vector>({(std::vector)std::vector({(long)0, (long)0, (long)1, (long)0}), (std::vector)std::vector({(long)0, (long)1, (long)0, (long)0}), (std::vector)std::vector({(long)1, (long)1, (long)1, (long)1})})), (1)) == (6));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)0, (long)0, (long)1, (long)1}), (std::vector)std::vector({(long)0, (long)0, (long)0, (long)0}), (std::vector)std::vector({(long)1, (long)1, (long)1, (long)1}), (std::vector)std::vector({(long)0, (long)1, (long)1, (long)1})})), (2)) == (5));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)0, (long)0, (long)0}), (std::vector)std::vector({(long)0, (long)0, (long)0})})), (5)) == (0));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)1, (long)1, (long)1}), (std::vector)std::vector({(long)1, (long)1, (long)1, (long)1})})), (2)) == (4));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)1, (long)1, (long)1}), (std::vector)std::vector({(long)1, (long)1, (long)1, (long)1})})), (9)) == (2));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "cpp", - "prompt": "#include\n#include\n// Given a vector arr of integers and a positive integer k, return a sorted vector \n// of length k with the maximum k numbers in arr.\n// Example 1:\n// >>> maximum((std::vector({(long)-3, (long)-4, (long)5})), (3))\n// (std::vector({(long)-4, (long)-3, (long)5}))\n// Example 2:\n// >>> maximum((std::vector({(long)4, (long)-4, (long)4})), (2))\n// (std::vector({(long)4, (long)4}))\n// Example 3:\n// >>> maximum((std::vector({(long)-3, (long)2, (long)1, (long)2, (long)-1, (long)-2, (long)1})), (1))\n// (std::vector({(long)2}))\n// Note:\n// 1. The length of the vector will be in the range of [1, 1000].\n// 2. The elements in the vector will be in the range of [-1000, 1000].\n// 3. 0 <= k <= len(arr)\nstd::vector maximum(std::vector arr, long k) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = maximum;\n assert(candidate((std::vector({(long)-3, (long)-4, (long)5})), (3)) == (std::vector({(long)-4, (long)-3, (long)5})));\n assert(candidate((std::vector({(long)4, (long)-4, (long)4})), (2)) == (std::vector({(long)4, (long)4})));\n assert(candidate((std::vector({(long)-3, (long)2, (long)1, (long)2, (long)-1, (long)-2, (long)1})), (1)) == (std::vector({(long)2})));\n assert(candidate((std::vector({(long)123, (long)-123, (long)20, (long)0, (long)1, (long)2, (long)-3})), (3)) == (std::vector({(long)2, (long)20, (long)123})));\n assert(candidate((std::vector({(long)-123, (long)20, (long)0, (long)1, (long)2, (long)-3})), (4)) == (std::vector({(long)0, (long)1, (long)2, (long)20})));\n assert(candidate((std::vector({(long)5, (long)15, (long)0, (long)3, (long)-13, (long)-8, (long)0})), (7)) == (std::vector({(long)-13, (long)-8, (long)0, (long)0, (long)3, (long)5, (long)15})));\n assert(candidate((std::vector({(long)-1, (long)0, (long)2, (long)5, (long)3, (long)-10})), (2)) == (std::vector({(long)3, (long)5})));\n assert(candidate((std::vector({(long)1, (long)0, (long)5, (long)-7})), (1)) == (std::vector({(long)5})));\n assert(candidate((std::vector({(long)4, (long)-4})), (2)) == (std::vector({(long)-4, (long)4})));\n assert(candidate((std::vector({(long)-10, (long)10})), (2)) == (std::vector({(long)-10, (long)10})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)-23, (long)243, (long)-400, (long)0})), (0)) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that takes a message, and encodes in such a \n// way that it swaps case of all letters, replaces all vowels in \n// the message with the letter that appears 2 places ahead of that \n// vowel in the english alphabet. \n// Assume only letters. \n// Examples:\n// >>> encode((\"test\"))\n// (\"TGST\")\n// >>> encode((\"This is a message\"))\n// (\"tHKS KS C MGSSCGG\")\nstd::string encode(std::string message) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = encode;\n assert(candidate((\"TEST\")) == (\"tgst\"));\n assert(candidate((\"Mudasir\")) == (\"mWDCSKR\"));\n assert(candidate((\"YES\")) == (\"ygs\"));\n assert(candidate((\"This is a message\")) == (\"tHKS KS C MGSSCGG\"));\n assert(candidate((\"I DoNt KnOw WhAt tO WrItE\")) == (\"k dQnT kNqW wHcT Tq wRkTg\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "cpp", - "prompt": "#include\n#include\n// remove_vowels is a function that takes string and returns string without vowels.\n// >>> remove_vowels((\"\"))\n// (\"\")\n// >>> remove_vowels((\"abcdef\"))\n// (\"bcdf\")\n// >>> remove_vowels((\"aaaaa\"))\n// (\"\")\n// >>> remove_vowels((\"aaBAA\"))\n// (\"B\")\n// >>> remove_vowels((\"zbcd\"))\n// (\"zbcd\")\nstd::string remove_vowels(std::string text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = remove_vowels;\n assert(candidate((\"\")) == (\"\"));\n assert(candidate((\"abcdef\\nghijklm\")) == (\"bcdf\\nghjklm\"));\n assert(candidate((\"fedcba\")) == (\"fdcb\"));\n assert(candidate((\"eeeee\")) == (\"\"));\n assert(candidate((\"acBAA\")) == (\"cB\"));\n assert(candidate((\"EcBOO\")) == (\"cB\"));\n assert(candidate((\"ybcd\")) == (\"ybcd\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "cpp", - "prompt": "#include\n#include\n// Return only positive numbers in the vector.\n// >>> get_positive((std::vector({(long)-1, (long)2, (long)-4, (long)5, (long)6})))\n// (std::vector({(long)2, (long)5, (long)6}))\n// >>> get_positive((std::vector({(long)5, (long)3, (long)-5, (long)2, (long)-3, (long)3, (long)9, (long)0, (long)123, (long)1, (long)-10})))\n// (std::vector({(long)5, (long)3, (long)2, (long)3, (long)9, (long)123, (long)1}))\nstd::vector get_positive(std::vector l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = get_positive;\n assert(candidate((std::vector({(long)-1, (long)-2, (long)4, (long)5, (long)6}))) == (std::vector({(long)4, (long)5, (long)6})));\n assert(candidate((std::vector({(long)5, (long)3, (long)-5, (long)2, (long)3, (long)3, (long)9, (long)0, (long)123, (long)1, (long)-10}))) == (std::vector({(long)5, (long)3, (long)2, (long)3, (long)3, (long)9, (long)123, (long)1})));\n assert(candidate((std::vector({(long)-1, (long)-2}))) == (std::vector()));\n assert(candidate((std::vector())) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "cpp", - "prompt": "#include\n#include\n// Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n// >>> string_sequence((0))\n// (\"0\")\n// >>> string_sequence((5))\n// (\"0 1 2 3 4 5\")\nstd::string string_sequence(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = string_sequence;\n assert(candidate((0)) == (\"0\"));\n assert(candidate((3)) == (\"0 1 2 3\"));\n assert(candidate((10)) == (\"0 1 2 3 4 5 6 7 8 9 10\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "cpp", - "prompt": "#include\n#include\n// Given a positive integer n, you have to make a pile of n levels of stones.\n// The first level has n stones.\n// The number of stones in the next level is:\n// - the next odd number if n is odd.\n// - the next even number if n is even.\n// Return the number of stones in each level in a vector, where element at index\n// i represents the number of stones in the level (i+1).\n// Examples:\n// >>> make_a_pile((3))\n// (std::vector({(long)3, (long)5, (long)7}))\nstd::vector make_a_pile(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = make_a_pile;\n assert(candidate((3)) == (std::vector({(long)3, (long)5, (long)7})));\n assert(candidate((4)) == (std::vector({(long)4, (long)6, (long)8, (long)10})));\n assert(candidate((5)) == (std::vector({(long)5, (long)7, (long)9, (long)11, (long)13})));\n assert(candidate((6)) == (std::vector({(long)6, (long)8, (long)10, (long)12, (long)14, (long)16})));\n assert(candidate((8)) == (std::vector({(long)8, (long)10, (long)12, (long)14, (long)16, (long)18, (long)20, (long)22})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "cpp", - "prompt": "#include\n#include\n// Task\n// 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\n// then check if the result string is palindrome.\n// A string is called palindrome if it reads the same backward as forward.\n// You should return a tuple containing the result string and true/false for the check.\n// Example\n// >>> reverse_delete((\"abcde\"), (\"ae\"))\n// (std::make_tuple(\"bcd\", false))\n// >>> reverse_delete((\"abcdef\"), (\"b\"))\n// (std::make_tuple(\"acdef\", false))\n// >>> reverse_delete((\"abcdedcba\"), (\"ab\"))\n// (std::make_tuple(\"cdedc\", true))\nstd::tuple reverse_delete(std::string s, std::string c) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = reverse_delete;\n assert(candidate((\"abcde\"), (\"ae\")) == (std::make_tuple(\"bcd\", false)));\n assert(candidate((\"abcdef\"), (\"b\")) == (std::make_tuple(\"acdef\", false)));\n assert(candidate((\"abcdedcba\"), (\"ab\")) == (std::make_tuple(\"cdedc\", true)));\n assert(candidate((\"dwik\"), (\"w\")) == (std::make_tuple(\"dik\", false)));\n assert(candidate((\"a\"), (\"a\")) == (std::make_tuple(\"\", true)));\n assert(candidate((\"abcdedcba\"), (\"\")) == (std::make_tuple(\"abcdedcba\", true)));\n assert(candidate((\"abcdedcba\"), (\"v\")) == (std::make_tuple(\"abcdedcba\", true)));\n assert(candidate((\"vabba\"), (\"v\")) == (std::make_tuple(\"abba\", true)));\n assert(candidate((\"mamma\"), (\"mia\")) == (std::make_tuple(\"\", true)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "cpp", - "prompt": "#include\n#include\n// For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n// >>> flip_case((\"Hello\"))\n// (\"hELLO\")\nstd::string flip_case(std::string string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = flip_case;\n assert(candidate((\"\")) == (\"\"));\n assert(candidate((\"Hello!\")) == (\"hELLO!\"));\n assert(candidate((\"These violent delights have violent ends\")) == (\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a string s.\n// if s[i] is a letter, reverse its case from lower to upper or vise versa, \n// otherwise keep it as it is.\n// If the string contains no letters, reverse the string.\n// The function should return the resulted string.\n// Examples\n// >>> solve((\"1234\"))\n// (\"4321\")\n// >>> solve((\"ab\"))\n// (\"AB\")\n// >>> solve((\"#a@C\"))\n// (\"#A@c\")\nstd::string solve(std::string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = solve;\n assert(candidate((\"AsDf\")) == (\"aSdF\"));\n assert(candidate((\"1234\")) == (\"4321\"));\n assert(candidate((\"ab\")) == (\"AB\"));\n assert(candidate((\"#a@C\")) == (\"#A@c\"));\n assert(candidate((\"#AsdfW^45\")) == (\"#aSDFw^45\"));\n assert(candidate((\"#6@2\")) == (\"2@6#\"));\n assert(candidate((\"#$a^D\")) == (\"#$A^d\"));\n assert(candidate((\"#ccc\")) == (\"#CCC\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "cpp", - "prompt": "#include\n#include\n// Filter an input vector of strings only for ones that start with a given prefix.\n// >>> filter_by_prefix((std::vector()), (\"a\"))\n// (std::vector())\n// >>> filter_by_prefix((std::vector({(std::string)\"abc\", (std::string)\"bcd\", (std::string)\"cde\", (std::string)\"array\"})), (\"a\"))\n// (std::vector({(std::string)\"abc\", (std::string)\"array\"}))\nstd::vector filter_by_prefix(std::vector strings, std::string prefix) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = filter_by_prefix;\n assert(candidate((std::vector()), (\"john\")) == (std::vector()));\n assert(candidate((std::vector({(std::string)\"xxx\", (std::string)\"asd\", (std::string)\"xxy\", (std::string)\"john doe\", (std::string)\"xxxAAA\", (std::string)\"xxx\"})), (\"xxx\")) == (std::vector({(std::string)\"xxx\", (std::string)\"xxxAAA\", (std::string)\"xxx\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "cpp", - "prompt": "#include\n#include\n// This function takes two positive numbers x and y and returns the\n// biggest even integer number that is in the range [x, y] inclusive. If \n// there's no such number, then the function should return -1.\n// For example:\n// >>> choose_num((12), (15))\n// (14)\n// >>> choose_num((13), (12))\n// (-1)\nlong choose_num(long x, long y) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = choose_num;\n assert(candidate((12), (15)) == (14));\n assert(candidate((13), (12)) == (-1));\n assert(candidate((33), (12354)) == (12354));\n assert(candidate((5234), (5233)) == (-1));\n assert(candidate((6), (29)) == (28));\n assert(candidate((27), (10)) == (-1));\n assert(candidate((7), (7)) == (-1));\n assert(candidate((546), (546)) == (546));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a string representing a sentence,\n// the sentence contains some words separated by a space,\n// and you have to return a string that contains the words from the original sentence,\n// whose lengths are prime numbers,\n// the order of the words in the new string should be the same as the original one.\n// Example 1:\n// >>> words_in_sentence((\"This is a test\"))\n// (\"is\")\n// Example 2:\n// >>> words_in_sentence((\"lets go for swimming\"))\n// (\"go for\")\n// Constraints:\n// * 1 <= len(sentence) <= 100\n// * sentence contains only letters\nstd::string words_in_sentence(std::string sentence) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = words_in_sentence;\n assert(candidate((\"This is a test\")) == (\"is\"));\n assert(candidate((\"lets go for swimming\")) == (\"go for\"));\n assert(candidate((\"there is no place available here\")) == (\"there is no place\"));\n assert(candidate((\"Hi I am Hussein\")) == (\"Hi am Hussein\"));\n assert(candidate((\"go for it\")) == (\"go for it\"));\n assert(candidate((\"here\")) == (\"\"));\n assert(candidate((\"here is\")) == (\"is\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "cpp", - "prompt": "#include\n#include\n// Insert a number 'delimeter' between every two consecutive elements of input vector `numbers'\n// >>> intersperse((std::vector()), (4))\n// (std::vector())\n// >>> intersperse((std::vector({(long)1, (long)2, (long)3})), (4))\n// (std::vector({(long)1, (long)4, (long)2, (long)4, (long)3}))\nstd::vector intersperse(std::vector numbers, long delimeter) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = intersperse;\n assert(candidate((std::vector()), (7)) == (std::vector()));\n assert(candidate((std::vector({(long)5, (long)6, (long)3, (long)2})), (8)) == (std::vector({(long)5, (long)8, (long)6, (long)8, (long)3, (long)8, (long)2})));\n assert(candidate((std::vector({(long)2, (long)2, (long)2})), (2)) == (std::vector({(long)2, (long)2, (long)2, (long)2, (long)2})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "cpp", - "prompt": "#include\n#include\n// Your task is to write a function that returns true if a number x is a simple\n// power of n and false in other cases.\n// x is a simple power of n if n**int=x\n// For example:\n// >>> is_simple_power((1), (4))\n// (true)\n// >>> is_simple_power((2), (2))\n// (true)\n// >>> is_simple_power((8), (2))\n// (true)\n// >>> is_simple_power((3), (2))\n// (false)\n// >>> is_simple_power((3), (1))\n// (false)\n// >>> is_simple_power((5), (3))\n// (false)\nbool is_simple_power(long x, long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = is_simple_power;\n assert(candidate((16), (2)) == (true));\n assert(candidate((143214), (16)) == (false));\n assert(candidate((4), (2)) == (true));\n assert(candidate((9), (3)) == (true));\n assert(candidate((16), (4)) == (true));\n assert(candidate((24), (2)) == (false));\n assert(candidate((128), (4)) == (false));\n assert(candidate((12), (6)) == (false));\n assert(candidate((1), (1)) == (true));\n assert(candidate((1), (12)) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that returns true if the given number is the multiplication of 3 prime numbers\n// and false otherwise.\n// Knowing that (a) is less then 100. \n// Example:\n// >>> is_multiply_prime((30))\n// (true)\n// 30 = 2 * 3 * 5\nbool is_multiply_prime(long a) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = is_multiply_prime;\n assert(candidate((5)) == (false));\n assert(candidate((30)) == (true));\n assert(candidate((8)) == (true));\n assert(candidate((10)) == (false));\n assert(candidate((125)) == (true));\n assert(candidate((105)) == (true));\n assert(candidate((126)) == (false));\n assert(candidate((729)) == (false));\n assert(candidate((891)) == (false));\n assert(candidate((1001)) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "cpp", - "prompt": "#include\n#include\n// Given the lengths of the three sides of a triangle. Return true if the three\n// sides form a right-angled triangle, false otherwise.\n// A right-angled triangle is a triangle in which one angle is right angle or \n// 90 degree.\n// Example:\n// >>> right_angle_triangle((3), (4), (5))\n// (true)\n// >>> right_angle_triangle((1), (2), (3))\n// (false)\nbool right_angle_triangle(long a, long b, long c) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = right_angle_triangle;\n assert(candidate((3), (4), (5)) == (true));\n assert(candidate((1), (2), (3)) == (false));\n assert(candidate((10), (6), (8)) == (true));\n assert(candidate((2), (2), (2)) == (false));\n assert(candidate((7), (24), (25)) == (true));\n assert(candidate((10), (5), (7)) == (false));\n assert(candidate((5), (12), (13)) == (true));\n assert(candidate((15), (8), (17)) == (true));\n assert(candidate((48), (55), (73)) == (true));\n assert(candidate((1), (1), (1)) == (false));\n assert(candidate((2), (2), (10)) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function that takes 3 numbers.\n// Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n// Returns false in any other cases.\n// Examples\n// >>> any_int((float(5)), (float(2)), (float(7)))\n// (true)\n// >>> any_int((float(3)), (float(2)), (float(2)))\n// (false)\n// >>> any_int((float(3)), (float(-2)), (float(1)))\n// (true)\n// >>> any_int((3.6), (-2.2), (float(2)))\n// (false)\nbool any_int(float x, float y, float z) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = any_int;\n assert(candidate((float(2)), (float(3)), (float(1))) == (true));\n assert(candidate((2.5), (float(2)), (float(3))) == (false));\n assert(candidate((1.5), (float(5)), (3.5)) == (false));\n assert(candidate((float(2)), (float(6)), (float(2))) == (false));\n assert(candidate((float(4)), (float(2)), (float(2))) == (true));\n assert(candidate((2.2), (2.2), (2.2)) == (false));\n assert(candidate((float(-4)), (float(6)), (float(2))) == (true));\n assert(candidate((float(2)), (float(1)), (float(1))) == (true));\n assert(candidate((float(3)), (float(4)), (float(7))) == (true));\n assert(candidate((3.0), (float(4)), (float(7))) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "cpp", - "prompt": "#include\n#include\n// This function takes a vector l and returns a vector l' such that\n// l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n// to the values of the corresponding indicies of l, but sorted.\n// >>> sort_third((std::vector({(long)1, (long)2, (long)3})))\n// (std::vector({(long)1, (long)2, (long)3}))\n// >>> sort_third((std::vector({(long)5, (long)6, (long)3, (long)4, (long)8, (long)9, (long)2})))\n// (std::vector({(long)2, (long)6, (long)3, (long)4, (long)8, (long)9, (long)5}))\nstd::vector sort_third(std::vector l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = sort_third;\n assert(candidate((std::vector({(long)5, (long)6, (long)3, (long)4, (long)8, (long)9, (long)2}))) == (std::vector({(long)2, (long)6, (long)3, (long)4, (long)8, (long)9, (long)5})));\n assert(candidate((std::vector({(long)5, (long)8, (long)3, (long)4, (long)6, (long)9, (long)2}))) == (std::vector({(long)2, (long)8, (long)3, (long)4, (long)6, (long)9, (long)5})));\n assert(candidate((std::vector({(long)5, (long)6, (long)9, (long)4, (long)8, (long)3, (long)2}))) == (std::vector({(long)2, (long)6, (long)9, (long)4, (long)8, (long)3, (long)5})));\n assert(candidate((std::vector({(long)5, (long)6, (long)3, (long)4, (long)8, (long)9, (long)2, (long)1}))) == (std::vector({(long)2, (long)6, (long)3, (long)4, (long)8, (long)9, (long)5, (long)1})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_53_add", - "language": "cpp", - "prompt": "#include\n#include\n// Add two numbers x and y\n// >>> add((2), (3))\n// (5)\n// >>> add((5), (7))\n// (12)\nlong add(long x, long y) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = add;\n assert(candidate((0), (1)) == (1));\n assert(candidate((1), (0)) == (1));\n assert(candidate((2), (3)) == (5));\n assert(candidate((5), (7)) == (12));\n assert(candidate((7), (5)) == (12));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_69_search", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a non-empty vector of positive integers. Return the greatest integer that is greater than \n// zero, and has a frequency greater than or equal to the value of the integer itself. \n// The frequency of an integer is the number of times it appears in the vector.\n// If no such a value exist, return -1.\n// Examples:\n// >>> search((std::vector({(long)4, (long)1, (long)2, (long)2, (long)3, (long)1})))\n// (2)\n// >>> search((std::vector({(long)1, (long)2, (long)2, (long)3, (long)3, (long)3, (long)4, (long)4, (long)4})))\n// (3)\n// >>> search((std::vector({(long)5, (long)5, (long)4, (long)4, (long)4})))\n// (-1)\nlong search(std::vector lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = search;\n assert(candidate((std::vector({(long)5, (long)5, (long)5, (long)5, (long)1}))) == (1));\n assert(candidate((std::vector({(long)4, (long)1, (long)4, (long)1, (long)4, (long)4}))) == (4));\n assert(candidate((std::vector({(long)3, (long)3}))) == (-1));\n assert(candidate((std::vector({(long)8, (long)8, (long)8, (long)8, (long)8, (long)8, (long)8, (long)8}))) == (8));\n assert(candidate((std::vector({(long)2, (long)3, (long)3, (long)2, (long)2}))) == (2));\n assert(candidate((std::vector({(long)2, (long)7, (long)8, (long)8, (long)4, (long)8, (long)7, (long)3, (long)9, (long)6, (long)5, (long)10, (long)4, (long)3, (long)6, (long)7, (long)1, (long)7, (long)4, (long)10, (long)8, (long)1}))) == (1));\n assert(candidate((std::vector({(long)3, (long)2, (long)8, (long)2}))) == (2));\n assert(candidate((std::vector({(long)6, (long)7, (long)1, (long)8, (long)8, (long)10, (long)5, (long)8, (long)5, (long)3, (long)10}))) == (1));\n assert(candidate((std::vector({(long)8, (long)8, (long)3, (long)6, (long)5, (long)6, (long)4}))) == (-1));\n assert(candidate((std::vector({(long)6, (long)9, (long)6, (long)7, (long)1, (long)4, (long)7, (long)1, (long)8, (long)8, (long)9, (long)8, (long)10, (long)10, (long)8, (long)4, (long)10, (long)4, (long)10, (long)1, (long)2, (long)9, (long)5, (long)7, (long)9}))) == (1));\n assert(candidate((std::vector({(long)1, (long)9, (long)10, (long)1, (long)3}))) == (1));\n assert(candidate((std::vector({(long)6, (long)9, (long)7, (long)5, (long)8, (long)7, (long)5, (long)3, (long)7, (long)5, (long)10, (long)10, (long)3, (long)6, (long)10, (long)2, (long)8, (long)6, (long)5, (long)4, (long)9, (long)5, (long)3, (long)10}))) == (5));\n assert(candidate((std::vector({(long)1}))) == (1));\n assert(candidate((std::vector({(long)8, (long)8, (long)10, (long)6, (long)4, (long)3, (long)5, (long)8, (long)2, (long)4, (long)2, (long)8, (long)4, (long)6, (long)10, (long)4, (long)2, (long)1, (long)10, (long)2, (long)1, (long)1, (long)5}))) == (4));\n assert(candidate((std::vector({(long)2, (long)10, (long)4, (long)8, (long)2, (long)10, (long)5, (long)1, (long)2, (long)9, (long)5, (long)5, (long)6, (long)3, (long)8, (long)6, (long)4, (long)10}))) == (2));\n assert(candidate((std::vector({(long)1, (long)6, (long)10, (long)1, (long)6, (long)9, (long)10, (long)8, (long)6, (long)8, (long)7, (long)3}))) == (1));\n assert(candidate((std::vector({(long)9, (long)2, (long)4, (long)1, (long)5, (long)1, (long)5, (long)2, (long)5, (long)7, (long)7, (long)7, (long)3, (long)10, (long)1, (long)5, (long)4, (long)2, (long)8, (long)4, (long)1, (long)9, (long)10, (long)7, (long)10, (long)2, (long)8, (long)10, (long)9, (long)4}))) == (4));\n assert(candidate((std::vector({(long)2, (long)6, (long)4, (long)2, (long)8, (long)7, (long)5, (long)6, (long)4, (long)10, (long)4, (long)6, (long)3, (long)7, (long)8, (long)8, (long)3, (long)1, (long)4, (long)2, (long)2, (long)10, (long)7}))) == (4));\n assert(candidate((std::vector({(long)9, (long)8, (long)6, (long)10, (long)2, (long)6, (long)10, (long)2, (long)7, (long)8, (long)10, (long)3, (long)8, (long)2, (long)6, (long)2, (long)3, (long)1}))) == (2));\n assert(candidate((std::vector({(long)5, (long)5, (long)3, (long)9, (long)5, (long)6, (long)3, (long)2, (long)8, (long)5, (long)6, (long)10, (long)10, (long)6, (long)8, (long)4, (long)10, (long)7, (long)7, (long)10, (long)8}))) == (-1));\n assert(candidate((std::vector({(long)10}))) == (-1));\n assert(candidate((std::vector({(long)9, (long)7, (long)7, (long)2, (long)4, (long)7, (long)2, (long)10, (long)9, (long)7, (long)5, (long)7, (long)2}))) == (2));\n assert(candidate((std::vector({(long)5, (long)4, (long)10, (long)2, (long)1, (long)1, (long)10, (long)3, (long)6, (long)1, (long)8}))) == (1));\n assert(candidate((std::vector({(long)7, (long)9, (long)9, (long)9, (long)3, (long)4, (long)1, (long)5, (long)9, (long)1, (long)2, (long)1, (long)1, (long)10, (long)7, (long)5, (long)6, (long)7, (long)6, (long)7, (long)7, (long)6}))) == (1));\n assert(candidate((std::vector({(long)3, (long)10, (long)10, (long)9, (long)2}))) == (-1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that takes a string and returns true if the string\n// length is a prime number or false otherwise\n// Examples\n// >>> prime_length((\"Hello\"))\n// (true)\n// >>> prime_length((\"abcdcba\"))\n// (true)\n// >>> prime_length((\"kittens\"))\n// (true)\n// >>> prime_length((\"orange\"))\n// (false)\nbool prime_length(std::string string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = prime_length;\n assert(candidate((\"Hello\")) == (true));\n assert(candidate((\"abcdcba\")) == (true));\n assert(candidate((\"kittens\")) == (true));\n assert(candidate((\"orange\")) == (false));\n assert(candidate((\"wow\")) == (true));\n assert(candidate((\"world\")) == (true));\n assert(candidate((\"MadaM\")) == (true));\n assert(candidate((\"Wow\")) == (true));\n assert(candidate((\"\")) == (false));\n assert(candidate((\"HI\")) == (true));\n assert(candidate((\"go\")) == (true));\n assert(candidate((\"gogo\")) == (false));\n assert(candidate((\"aaaaaaaaaaaaaaa\")) == (false));\n assert(candidate((\"Madam\")) == (true));\n assert(candidate((\"M\")) == (false));\n assert(candidate((\"0\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_58_common", - "language": "cpp", - "prompt": "#include\n#include\n// Return sorted unique common elements for two vectors.\n// >>> common((std::vector({(long)1, (long)4, (long)3, (long)34, (long)653, (long)2, (long)5})), (std::vector({(long)5, (long)7, (long)1, (long)5, (long)9, (long)653, (long)121})))\n// (std::vector({(long)1, (long)5, (long)653}))\n// >>> common((std::vector({(long)5, (long)3, (long)2, (long)8})), (std::vector({(long)3, (long)2})))\n// (std::vector({(long)2, (long)3}))\nstd::vector common(std::vector l1, std::vector l2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = common;\n assert(candidate((std::vector({(long)1, (long)4, (long)3, (long)34, (long)653, (long)2, (long)5})), (std::vector({(long)5, (long)7, (long)1, (long)5, (long)9, (long)653, (long)121}))) == (std::vector({(long)1, (long)5, (long)653})));\n assert(candidate((std::vector({(long)5, (long)3, (long)2, (long)8})), (std::vector({(long)3, (long)2}))) == (std::vector({(long)2, (long)3})));\n assert(candidate((std::vector({(long)4, (long)3, (long)2, (long)8})), (std::vector({(long)3, (long)2, (long)4}))) == (std::vector({(long)2, (long)3, (long)4})));\n assert(candidate((std::vector({(long)4, (long)3, (long)2, (long)8})), (std::vector())) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "cpp", - "prompt": "#include\n#include\n// The Brazilian factorial is defined as:\n// brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n// where n > 0\n// For example:\n// >>> special_factorial((4))\n// (288)\n// The function will receive an integer as input and should return the special\n// factorial of this integer.\nlong special_factorial(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = special_factorial;\n assert(candidate((4)) == (288));\n assert(candidate((5)) == (34560));\n assert(candidate((7)) == (125411328000));\n assert(candidate((1)) == (1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "cpp", - "prompt": "#include\n#include\n// In this problem, you will implement a function that takes two vectors of numbers,\n// and determines whether it is possible to perform an exchange of elements\n// between them to make lst1 a vector of only even numbers.\n// There is no limit on the number of exchanged elements between lst1 and lst2.\n// If it is possible to exchange elements between the lst1 and lst2 to make\n// all the elements of lst1 to be even, return \"YES\".\n// Otherwise, return \"NO\".\n// For example:\n// >>> exchange((std::vector({(long)1, (long)2, (long)3, (long)4})), (std::vector({(long)1, (long)2, (long)3, (long)4})))\n// (\"YES\")\n// >>> exchange((std::vector({(long)1, (long)2, (long)3, (long)4})), (std::vector({(long)1, (long)5, (long)3, (long)4})))\n// (\"NO\")\n// It is assumed that the input vectors will be non-empty.\nstd::string exchange(std::vector lst1, std::vector lst2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = exchange;\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4})), (std::vector({(long)1, (long)2, (long)3, (long)4}))) == (\"YES\"));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4})), (std::vector({(long)1, (long)5, (long)3, (long)4}))) == (\"NO\"));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4})), (std::vector({(long)2, (long)1, (long)4, (long)3}))) == (\"YES\"));\n assert(candidate((std::vector({(long)5, (long)7, (long)3})), (std::vector({(long)2, (long)6, (long)4}))) == (\"YES\"));\n assert(candidate((std::vector({(long)5, (long)7, (long)3})), (std::vector({(long)2, (long)6, (long)3}))) == (\"NO\"));\n assert(candidate((std::vector({(long)3, (long)2, (long)6, (long)1, (long)8, (long)9})), (std::vector({(long)3, (long)5, (long)5, (long)1, (long)1, (long)1}))) == (\"NO\"));\n assert(candidate((std::vector({(long)100, (long)200})), (std::vector({(long)200, (long)200}))) == (\"YES\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "cpp", - "prompt": "#include\n#include\n// Given a non-empty vector of integers arr and an integer k, return\n// the sum of the elements with at most two digits from the first k elements of arr.\n// Example:\n// >>> add_elements((std::vector({(long)111, (long)21, (long)3, (long)4000, (long)5, (long)6, (long)7, (long)8, (long)9})), (4))\n// (24)\n// Constraints:\n// 1. 1 <= len(arr) <= 100\n// 2. 1 <= k <= len(arr)\nlong add_elements(std::vector arr, long k) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = add_elements;\n assert(candidate((std::vector({(long)1, (long)-2, (long)-3, (long)41, (long)57, (long)76, (long)87, (long)88, (long)99})), (3)) == (-4));\n assert(candidate((std::vector({(long)111, (long)121, (long)3, (long)4000, (long)5, (long)6})), (2)) == (0));\n assert(candidate((std::vector({(long)11, (long)21, (long)3, (long)90, (long)5, (long)6, (long)7, (long)8, (long)9})), (4)) == (125));\n assert(candidate((std::vector({(long)111, (long)21, (long)3, (long)4000, (long)5, (long)6, (long)7, (long)8, (long)9})), (4)) == (24));\n assert(candidate((std::vector({(long)1})), (1)) == (1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "cpp", - "prompt": "#include\n#include\n// A simple program which should return the value of x if n is \n// a prime number and should return the value of y otherwise.\n// Examples:\n// >>> x_or_y((7), (34), (12))\n// (34)\n// >>> x_or_y((15), (8), (5))\n// (5)\nlong x_or_y(long n, long x, long y) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = x_or_y;\n assert(candidate((7), (34), (12)) == (34));\n assert(candidate((15), (8), (5)) == (5));\n assert(candidate((3), (33), (5212)) == (33));\n assert(candidate((1259), (3), (52)) == (3));\n assert(candidate((7919), (-1), (12)) == (-1));\n assert(candidate((3609), (1245), (583)) == (583));\n assert(candidate((91), (56), (129)) == (129));\n assert(candidate((6), (34), (1234)) == (1234));\n assert(candidate((1), (2), (0)) == (0));\n assert(candidate((2), (2), (0)) == (2));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "cpp", - "prompt": "#include\n#include\n// Given length of a side and high return area for a triangle.\n// >>> triangle_area((5), (3))\n// (7.5)\nfloat triangle_area(long a, long h) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = triangle_area;\n assert(candidate((5), (3)) == (7.5));\n assert(candidate((2), (2)) == (2.0));\n assert(candidate((10), (8)) == (40.0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "cpp", - "prompt": "#include\n#include\n// Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n// the last couple centuries. However, what people don't know is Tribonacci sequence.\n// Tribonacci sequence is defined by the recurrence:\n// tri(1) = 3\n// tri(n) = 1 + n / 2, if n is even.\n// tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n// For example:\n// tri(2) = 1 + (2 / 2) = 2\n// tri(4) = 3\n// tri(3) = tri(2) + tri(1) + tri(4)\n// = 2 + 3 + 3 = 8 \n// You are given a non-negative integer number n, you have to a return a vector of the \n// first n + 1 numbers of the Tribonacci sequence.\n// Examples:\n// >>> tri((3))\n// (std::vector({(long)1, (long)3, (long)2, (long)8}))\nstd::vector tri(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = tri;\n assert(candidate((3)) == (std::vector({(long)1, (long)3, (long)2, (long)8})));\n assert(candidate((4)) == (std::vector({(long)1, (long)3, (long)2, (long)8, (long)3})));\n assert(candidate((5)) == (std::vector({(long)1, (long)3, (long)2, (long)8, (long)3, (long)15})));\n assert(candidate((6)) == (std::vector({(long)1, (long)3, (long)2, (long)8, (long)3, (long)15, (long)4})));\n assert(candidate((7)) == (std::vector({(long)1, (long)3, (long)2, (long)8, (long)3, (long)15, (long)4, (long)24})));\n assert(candidate((8)) == (std::vector({(long)1, (long)3, (long)2, (long)8, (long)3, (long)15, (long)4, (long)24, (long)5})));\n assert(candidate((9)) == (std::vector({(long)1, (long)3, (long)2, (long)8, (long)3, (long)15, (long)4, (long)24, (long)5, (long)35})));\n assert(candidate((20)) == (std::vector({(long)1, (long)3, (long)2, (long)8, (long)3, (long)15, (long)4, (long)24, (long)5, (long)35, (long)6, (long)48, (long)7, (long)63, (long)8, (long)80, (long)9, (long)99, (long)10, (long)120, (long)11})));\n assert(candidate((0)) == (std::vector({(long)1})));\n assert(candidate((1)) == (std::vector({(long)1, (long)3})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a vector of two strings, both strings consist of open\n// parentheses '(' or close parentheses ')' only.\n// Your job is to check if it is possible to concatenate the two strings in\n// some order, that the resulting string will be good.\n// A string S is considered to be good if and only if all parentheses in S\n// are balanced. For example: the string '(())()' is good, while the string\n// '())' is not.\n// Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n// Examples:\n// >>> match_parens((std::vector({(std::string)\"()(\", (std::string)\")\"})))\n// (\"Yes\")\n// >>> match_parens((std::vector({(std::string)\")\", (std::string)\")\"})))\n// (\"No\")\nstd::string match_parens(std::vector lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = match_parens;\n assert(candidate((std::vector({(std::string)\"()(\", (std::string)\")\"}))) == (\"Yes\"));\n assert(candidate((std::vector({(std::string)\")\", (std::string)\")\"}))) == (\"No\"));\n assert(candidate((std::vector({(std::string)\"(()(())\", (std::string)\"())())\"}))) == (\"No\"));\n assert(candidate((std::vector({(std::string)\")())\", (std::string)\"(()()(\"}))) == (\"Yes\"));\n assert(candidate((std::vector({(std::string)\"(())))\", (std::string)\"(()())((\"}))) == (\"Yes\"));\n assert(candidate((std::vector({(std::string)\"()\", (std::string)\"())\"}))) == (\"No\"));\n assert(candidate((std::vector({(std::string)\"(()(\", (std::string)\"()))()\"}))) == (\"Yes\"));\n assert(candidate((std::vector({(std::string)\"((((\", (std::string)\"((())\"}))) == (\"No\"));\n assert(candidate((std::vector({(std::string)\")(()\", (std::string)\"(()(\"}))) == (\"No\"));\n assert(candidate((std::vector({(std::string)\")(\", (std::string)\")(\"}))) == (\"No\"));\n assert(candidate((std::vector({(std::string)\"(\", (std::string)\")\"}))) == (\"Yes\"));\n assert(candidate((std::vector({(std::string)\")\", (std::string)\"(\"}))) == (\"Yes\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "cpp", - "prompt": "#include\n#include\n// From a vector of integers, remove all elements that occur more than once.\n// Keep order of elements left the same as in the input.\n// >>> remove_duplicates((std::vector({(long)1, (long)2, (long)3, (long)2, (long)4})))\n// (std::vector({(long)1, (long)3, (long)4}))\nstd::vector remove_duplicates(std::vector numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = remove_duplicates;\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4}))) == (std::vector({(long)1, (long)2, (long)3, (long)4})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)2, (long)4, (long)3, (long)5}))) == (std::vector({(long)1, (long)4, (long)5})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "cpp", - "prompt": "#include\n#include\n// Return a greatest common divisor of two integers a and b\n// >>> greatest_common_divisor((3), (5))\n// (1)\n// >>> greatest_common_divisor((25), (15))\n// (5)\nlong greatest_common_divisor(long a, long b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = greatest_common_divisor;\n assert(candidate((3), (7)) == (1));\n assert(candidate((10), (15)) == (5));\n assert(candidate((49), (14)) == (7));\n assert(candidate((144), (60)) == (12));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "cpp", - "prompt": "#include\n#include\n// Checks if given string is a palindrome\n// >>> is_palindrome((\"\"))\n// (true)\n// >>> is_palindrome((\"aba\"))\n// (true)\n// >>> is_palindrome((\"aaaaa\"))\n// (true)\n// >>> is_palindrome((\"zbcd\"))\n// (false)\nbool is_palindrome(std::string text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = is_palindrome;\n assert(candidate((\"\")) == (true));\n assert(candidate((\"aba\")) == (true));\n assert(candidate((\"aaaaa\")) == (true));\n assert(candidate((\"zbcd\")) == (false));\n assert(candidate((\"xywyx\")) == (true));\n assert(candidate((\"xywyz\")) == (false));\n assert(candidate((\"xywzx\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "cpp", - "prompt": "#include\n#include\n// xs represent coefficients of a polynomial.\n// xs[0] + xs[1] * x + xs[2] * x^2 + ....\n// Return derivative of this polynomial in the same form.\n// >>> derivative((std::vector({(long)3, (long)1, (long)2, (long)4, (long)5})))\n// (std::vector({(long)1, (long)4, (long)12, (long)20}))\n// >>> derivative((std::vector({(long)1, (long)2, (long)3})))\n// (std::vector({(long)2, (long)6}))\nstd::vector derivative(std::vector xs) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = derivative;\n assert(candidate((std::vector({(long)3, (long)1, (long)2, (long)4, (long)5}))) == (std::vector({(long)1, (long)4, (long)12, (long)20})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3}))) == (std::vector({(long)2, (long)6})));\n assert(candidate((std::vector({(long)3, (long)2, (long)1}))) == (std::vector({(long)2, (long)2})));\n assert(candidate((std::vector({(long)3, (long)2, (long)1, (long)0, (long)4}))) == (std::vector({(long)2, (long)2, (long)0, (long)16})));\n assert(candidate((std::vector({(long)1}))) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "cpp", - "prompt": "#include\n#include\n// In this task, you will be given a string that represents a number of apples and oranges \n// that are distributed in a basket of fruit this basket contains \n// apples, oranges, and mango fruits. Given the string that represents the total number of \n// the oranges and apples and an integer that represent the total number of the fruits \n// in the basket return the number of the mango fruits in the basket.\n// for examble:\n// >>> fruit_distribution((\"5 apples and 6 oranges\"), (19))\n// (8)\n// >>> fruit_distribution((\"0 apples and 1 oranges\"), (3))\n// (2)\n// >>> fruit_distribution((\"2 apples and 3 oranges\"), (100))\n// (95)\n// >>> fruit_distribution((\"100 apples and 1 oranges\"), (120))\n// (19)\nlong fruit_distribution(std::string s, long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = fruit_distribution;\n assert(candidate((\"5 apples and 6 oranges\"), (19)) == (8));\n assert(candidate((\"5 apples and 6 oranges\"), (21)) == (10));\n assert(candidate((\"0 apples and 1 oranges\"), (3)) == (2));\n assert(candidate((\"1 apples and 0 oranges\"), (3)) == (2));\n assert(candidate((\"2 apples and 3 oranges\"), (100)) == (95));\n assert(candidate((\"2 apples and 3 oranges\"), (5)) == (0));\n assert(candidate((\"1 apples and 100 oranges\"), (120)) == (19));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that takes an integer a and returns true \n// if this ingeger is a cube of some integer number.\n// Note: you may assume the input is always valid.\n// Examples:\n// >>> iscube((1))\n// (true)\n// >>> iscube((2))\n// (false)\n// >>> iscube((-1))\n// (true)\n// >>> iscube((64))\n// (true)\n// >>> iscube((0))\n// (true)\n// >>> iscube((180))\n// (false)\nbool iscube(long a) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = iscube;\n assert(candidate((1)) == (true));\n assert(candidate((2)) == (false));\n assert(candidate((-1)) == (true));\n assert(candidate((64)) == (true));\n assert(candidate((180)) == (false));\n assert(candidate((1000)) == (true));\n assert(candidate((0)) == (true));\n assert(candidate((1729)) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "cpp", - "prompt": "#include\n#include\n// In this Kata, you have to sort a vector of non-negative integers according to\n// number of ones in their binary representation in ascending order.\n// For similar number of ones, sort based on decimal value.\n// It must be implemented like this:\n// >>> sort_array((std::vector({(long)1, (long)5, (long)2, (long)3, (long)4})))\n// (std::vector({(long)1, (long)2, (long)3, (long)4, (long)5}))\n// >>> sort_array((std::vector({(long)-2, (long)-3, (long)-4, (long)-5, (long)-6})))\n// (std::vector({(long)-6, (long)-5, (long)-4, (long)-3, (long)-2}))\n// >>> sort_array((std::vector({(long)1, (long)0, (long)2, (long)3, (long)4})))\n// (std::vector({(long)0, (long)1, (long)2, (long)3, (long)4}))\nstd::vector sort_array(std::vector arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = sort_array;\n assert(candidate((std::vector({(long)1, (long)5, (long)2, (long)3, (long)4}))) == (std::vector({(long)1, (long)2, (long)4, (long)3, (long)5})));\n assert(candidate((std::vector({(long)-2, (long)-3, (long)-4, (long)-5, (long)-6}))) == (std::vector({(long)-4, (long)-2, (long)-6, (long)-5, (long)-3})));\n assert(candidate((std::vector({(long)1, (long)0, (long)2, (long)3, (long)4}))) == (std::vector({(long)0, (long)1, (long)2, (long)4, (long)3})));\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)2, (long)5, (long)77, (long)4, (long)5, (long)3, (long)5, (long)7, (long)2, (long)3, (long)4}))) == (std::vector({(long)2, (long)2, (long)4, (long)4, (long)3, (long)3, (long)5, (long)5, (long)5, (long)7, (long)77})));\n assert(candidate((std::vector({(long)3, (long)6, (long)44, (long)12, (long)32, (long)5}))) == (std::vector({(long)32, (long)3, (long)5, (long)6, (long)12, (long)44})));\n assert(candidate((std::vector({(long)2, (long)4, (long)8, (long)16, (long)32}))) == (std::vector({(long)2, (long)4, (long)8, (long)16, (long)32})));\n assert(candidate((std::vector({(long)2, (long)4, (long)8, (long)16, (long)32}))) == (std::vector({(long)2, (long)4, (long)8, (long)16, (long)32})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "cpp", - "prompt": "#include\n#include\n// Given a vector of strings, where each string consists of only digits, return a vector.\n// Each element i of the output should be \"the number of odd elements in the\n// string i of the input.\" where all the i's should be replaced by the number\n// of odd digits in the i'th string of the input.\n// >>> odd_count((std::vector({(std::string)\"1234567\"})))\n// (std::vector({(std::string)\"the number of odd elements 4n the str4ng 4 of the 4nput.\"}))\n// >>> odd_count((std::vector({(std::string)\"3\", (std::string)\"11111111\"})))\n// (std::vector({(std::string)\"the number of odd elements 1n the str1ng 1 of the 1nput.\", (std::string)\"the number of odd elements 8n the str8ng 8 of the 8nput.\"}))\nstd::vector odd_count(std::vector lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = odd_count;\n assert(candidate((std::vector({(std::string)\"1234567\"}))) == (std::vector({(std::string)\"the number of odd elements 4n the str4ng 4 of the 4nput.\"})));\n assert(candidate((std::vector({(std::string)\"3\", (std::string)\"11111111\"}))) == (std::vector({(std::string)\"the number of odd elements 1n the str1ng 1 of the 1nput.\", (std::string)\"the number of odd elements 8n the str8ng 8 of the 8nput.\"})));\n assert(candidate((std::vector({(std::string)\"271\", (std::string)\"137\", (std::string)\"314\"}))) == (std::vector({(std::string)\"the number of odd elements 2n the str2ng 2 of the 2nput.\", (std::string)\"the number of odd elements 3n the str3ng 3 of the 3nput.\", (std::string)\"the number of odd elements 2n the str2ng 2 of the 2nput.\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "cpp", - "prompt": "#include\n#include\n// brackets is a string of \"(\" and \")\".\n// return true if every opening bracket has a corresponding closing bracket.\n// >>> correct_bracketing((\"(\"))\n// (false)\n// >>> correct_bracketing((\"()\"))\n// (true)\n// >>> correct_bracketing((\"(()())\"))\n// (true)\n// >>> correct_bracketing((\")(()\"))\n// (false)\nbool correct_bracketing(std::string brackets) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = correct_bracketing;\n assert(candidate((\"()\")) == (true));\n assert(candidate((\"(()())\")) == (true));\n assert(candidate((\"()()(()())()\")) == (true));\n assert(candidate((\"()()((()()())())(()()(()))\")) == (true));\n assert(candidate((\"((()())))\")) == (false));\n assert(candidate((\")(()\")) == (false));\n assert(candidate((\"(\")) == (false));\n assert(candidate((\"((((\")) == (false));\n assert(candidate((\")\")) == (false));\n assert(candidate((\"(()\")) == (false));\n assert(candidate((\"()()(()())())(()\")) == (false));\n assert(candidate((\"()()(()())()))()\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "cpp", - "prompt": "#include\n#include\n// Task\n// Write a function that takes a string as input and returns the sum of the upper characters only'\n// ASCII codes.\n// Examples:\n// >>> digitSum((\"\"))\n// (0)\n// >>> digitSum((\"abAB\"))\n// (131)\n// >>> digitSum((\"abcCd\"))\n// (67)\n// >>> digitSum((\"helloE\"))\n// (69)\n// >>> digitSum((\"woArBld\"))\n// (131)\n// >>> digitSum((\"aAaaaXa\"))\n// (153)\nlong digitSum(std::string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = digitSum;\n assert(candidate((\"\")) == (0));\n assert(candidate((\"abAB\")) == (131));\n assert(candidate((\"abcCd\")) == (67));\n assert(candidate((\"helloE\")) == (69));\n assert(candidate((\"woArBld\")) == (131));\n assert(candidate((\"aAaaaXa\")) == (153));\n assert(candidate((\" How are yOu?\")) == (151));\n assert(candidate((\"You arE Very Smart\")) == (327));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that accepts a vector of strings as a parameter,\n// deletes the strings that have odd lengths from it,\n// and returns the resulted vector with a sorted order,\n// The vector is always a vector of strings and never a vector of numbers,\n// and it may contain duplicates.\n// The order of the vector should be ascending by length of each word, and you\n// should return the vector sorted by that rule.\n// If two words have the same length, sort the vector alphabetically.\n// The function should return a vector of strings in sorted order.\n// You may assume that all words will have the same length.\n// For example:\n// >>> list_sort((std::vector({(std::string)\"aa\", (std::string)\"a\", (std::string)\"aaa\"})))\n// (std::vector({(std::string)\"aa\"}))\n// >>> list_sort((std::vector({(std::string)\"ab\", (std::string)\"a\", (std::string)\"aaa\", (std::string)\"cd\"})))\n// (std::vector({(std::string)\"ab\", (std::string)\"cd\"}))\nstd::vector sorted_list_sum(std::vector lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = sorted_list_sum;\n assert(candidate((std::vector({(std::string)\"aa\", (std::string)\"a\", (std::string)\"aaa\"}))) == (std::vector({(std::string)\"aa\"})));\n assert(candidate((std::vector({(std::string)\"school\", (std::string)\"AI\", (std::string)\"asdf\", (std::string)\"b\"}))) == (std::vector({(std::string)\"AI\", (std::string)\"asdf\", (std::string)\"school\"})));\n assert(candidate((std::vector({(std::string)\"d\", (std::string)\"b\", (std::string)\"c\", (std::string)\"a\"}))) == (std::vector()));\n assert(candidate((std::vector({(std::string)\"d\", (std::string)\"dcba\", (std::string)\"abcd\", (std::string)\"a\"}))) == (std::vector({(std::string)\"abcd\", (std::string)\"dcba\"})));\n assert(candidate((std::vector({(std::string)\"AI\", (std::string)\"ai\", (std::string)\"au\"}))) == (std::vector({(std::string)\"AI\", (std::string)\"ai\", (std::string)\"au\"})));\n assert(candidate((std::vector({(std::string)\"a\", (std::string)\"b\", (std::string)\"b\", (std::string)\"c\", (std::string)\"c\", (std::string)\"a\"}))) == (std::vector()));\n assert(candidate((std::vector({(std::string)\"aaaa\", (std::string)\"bbbb\", (std::string)\"dd\", (std::string)\"cc\"}))) == (std::vector({(std::string)\"cc\", (std::string)\"dd\", (std::string)\"aaaa\", (std::string)\"bbbb\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a vector arr of integers and you need to return\n// sum of magnitudes of integers multiplied by product of all signs\n// of each number in the vector, represented by 1, -1 or 0.\n// Note: return None for empty arr.\n// Example:\n// >>> prod_signs((std::vector({(long)1, (long)2, (long)2, (long)-4})))\n// 9\n// >>> prod_signs((std::vector({(long)0, (long)1})))\n// 0\n// >>> prod_signs((std::vector()))\n// std::nullopt\nstd::optional prod_signs(std::vector arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = prod_signs;\n assert(candidate((std::vector({(long)1, (long)2, (long)2, (long)-4}))) == -9);\n assert(candidate((std::vector({(long)0, (long)1}))) == 0);\n assert(candidate((std::vector({(long)1, (long)1, (long)1, (long)2, (long)3, (long)-1, (long)1}))) == -10);\n assert(candidate((std::vector())) == std::nullopt);\n assert(candidate((std::vector({(long)2, (long)4, (long)1, (long)2, (long)-1, (long)-1, (long)9}))) == 20);\n assert(candidate((std::vector({(long)-1, (long)1, (long)-1, (long)1}))) == 4);\n assert(candidate((std::vector({(long)-1, (long)1, (long)1, (long)1}))) == -4);\n assert(candidate((std::vector({(long)-1, (long)1, (long)1, (long)0}))) == 0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "cpp", - "prompt": "#include\n#include\n// Return vector with elements incremented by 1.\n// >>> incr_list((std::vector({(long)1, (long)2, (long)3})))\n// (std::vector({(long)2, (long)3, (long)4}))\n// >>> incr_list((std::vector({(long)5, (long)3, (long)5, (long)2, (long)3, (long)3, (long)9, (long)0, (long)123})))\n// (std::vector({(long)6, (long)4, (long)6, (long)3, (long)4, (long)4, (long)10, (long)1, (long)124}))\nstd::vector incr_list(std::vector l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = incr_list;\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)3, (long)2, (long)1}))) == (std::vector({(long)4, (long)3, (long)2})));\n assert(candidate((std::vector({(long)5, (long)2, (long)5, (long)2, (long)3, (long)3, (long)9, (long)0, (long)123}))) == (std::vector({(long)6, (long)3, (long)6, (long)3, (long)4, (long)4, (long)10, (long)1, (long)124})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "cpp", - "prompt": "#include\n#include\n// From a given vector of integers, generate a vector of rolling maximum element found until given moment\n// in the sequence.\n// >>> rolling_max((std::vector({(long)1, (long)2, (long)3, (long)2, (long)3, (long)4, (long)2})))\n// (std::vector({(long)1, (long)2, (long)3, (long)3, (long)3, (long)4, (long)4}))\nstd::vector rolling_max(std::vector numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = rolling_max;\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4}))) == (std::vector({(long)1, (long)2, (long)3, (long)4})));\n assert(candidate((std::vector({(long)4, (long)3, (long)2, (long)1}))) == (std::vector({(long)4, (long)4, (long)4, (long)4})));\n assert(candidate((std::vector({(long)3, (long)2, (long)3, (long)100, (long)3}))) == (std::vector({(long)3, (long)3, (long)3, (long)100, (long)100})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "cpp", - "prompt": "#include\n#include\n// Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n// separate those group into separate strings and return the vector of those.\n// Separate groups are balanced (each open brace is properly closed) and not nested within each other\n// Ignore any spaces in the input string.\n// >>> separate_paren_groups((\"( ) (( )) (( )( ))\"))\n// (std::vector({(std::string)\"()\", (std::string)\"(())\", (std::string)\"(()())\"}))\nstd::vector separate_paren_groups(std::string paren_string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = separate_paren_groups;\n assert(candidate((\"(()()) ((())) () ((())()())\")) == (std::vector({(std::string)\"(()())\", (std::string)\"((()))\", (std::string)\"()\", (std::string)\"((())()())\"})));\n assert(candidate((\"() (()) ((())) (((())))\")) == (std::vector({(std::string)\"()\", (std::string)\"(())\", (std::string)\"((()))\", (std::string)\"(((())))\"})));\n assert(candidate((\"(()(())((())))\")) == (std::vector({(std::string)\"(()(())((())))\"})));\n assert(candidate((\"( ) (( )) (( )( ))\")) == (std::vector({(std::string)\"()\", (std::string)\"(())\", (std::string)\"(()())\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "cpp", - "prompt": "#include\n#include\n// You will be given a string of words separated by commas or spaces. Your task is\n// to split the string into words and return a vector of the words.\n// For example:\n// >>> words_string((\"Hi, my name is John\"))\n// (std::vector({(std::string)\"Hi\", (std::string)\"my\", (std::string)\"name\", (std::string)\"is\", (std::string)\"John\"}))\n// >>> words_string((\"One, two, three, four, five, six\"))\n// (std::vector({(std::string)\"One\", (std::string)\"two\", (std::string)\"three\", (std::string)\"four\", (std::string)\"five\", (std::string)\"six\"}))\nstd::vector words_string(std::string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = words_string;\n assert(candidate((\"Hi, my name is John\")) == (std::vector({(std::string)\"Hi\", (std::string)\"my\", (std::string)\"name\", (std::string)\"is\", (std::string)\"John\"})));\n assert(candidate((\"One, two, three, four, five, six\")) == (std::vector({(std::string)\"One\", (std::string)\"two\", (std::string)\"three\", (std::string)\"four\", (std::string)\"five\", (std::string)\"six\"})));\n assert(candidate((\"Hi, my name\")) == (std::vector({(std::string)\"Hi\", (std::string)\"my\", (std::string)\"name\"})));\n assert(candidate((\"One,, two, three, four, five, six,\")) == (std::vector({(std::string)\"One\", (std::string)\"two\", (std::string)\"three\", (std::string)\"four\", (std::string)\"five\", (std::string)\"six\"})));\n assert(candidate((\"\")) == (std::vector()));\n assert(candidate((\"ahmed , gamal\")) == (std::vector({(std::string)\"ahmed\", (std::string)\"gamal\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "cpp", - "prompt": "#include\n#include\nunion Union_long_float_std_string{\n long f0;\n float f1;\n std::string f2; Union_long_float_std_string(long _f0) : f0(_f0) {}\n Union_long_float_std_string(float _f1) : f1(_f1) {}\n Union_long_float_std_string(std::string _f2) : f2(_f2) {}\n ~Union_long_float_std_string() {}\n bool operator==(long f) {\n return f0 == f ;\n } bool operator==(float f) {\n return f1 == f ;\n } bool operator==(std::string f) {\n return f2 == f ;\n }\n};\nunion Union_long_float_std_string_std_nullopt{\n long f0;\n float f1;\n std::string f2;\n std::nullopt f3; Union_long_float_std_string_std_nullopt(long _f0) : f0(_f0) {}\n Union_long_float_std_string_std_nullopt(float _f1) : f1(_f1) {}\n Union_long_float_std_string_std_nullopt(std::string _f2) : f2(_f2) {}\n Union_long_float_std_string_std_nullopt(std::nullopt _f3) : f3(_f3) {}\n ~Union_long_float_std_string_std_nullopt() {}\n bool operator==(long f) {\n return f0 == f ;\n } bool operator==(float f) {\n return f1 == f ;\n } bool operator==(std::string f) {\n return f2 == f ;\n } bool operator==(std::nullopt f) {\n return f3 == f ;\n }\n};\n// Create a function that takes integers, floats, or strings representing\n// real numbers, and returns the larger variable in its given variable type.\n// Return None if the values are equal.\n// Note: If a real number is represented as a string, the floating point might be . or ,\n// >>> compare_one(1, 2.5)\n// 2.5\n// >>> compare_one(1, \"2,3\")\n// \"2,3\"\n// >>> compare_one(\"5,1\", \"6\")\n// \"6\"\n// >>> compare_one(\"1\", 1)\n// std::nullopt\nUnion_long_float_std_string_std_nullopt compare_one(Union_long_float_std_string a, Union_long_float_std_string b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = compare_one;\n assert(candidate(1, 2) == 2);\n assert(candidate(1, 2.5) == 2.5);\n assert(candidate(2, 3) == 3);\n assert(candidate(5, 6) == 6);\n assert(candidate(1, \"2,3\") == \"2,3\");\n assert(candidate(\"5,1\", \"6\") == \"6\");\n assert(candidate(\"1\", \"2\") == \"2\");\n assert(candidate(\"1\", 1) == std::nullopt);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "cpp", - "prompt": "#include\n#include\n// Filter given vector of any cppthon values only for integers\n// >>> filter_integers((std::vector({(std::string)\"a\", (std::string)3.14, (std::string)5})))\n// (std::vector({(long)5}))\n// >>> filter_integers((std::vector({1, 2, 3, \"abc\", std::map(), std::vector()})))\n// (std::vector({(long)1, (long)2, (long)3}))\nstd::vector filter_integers(std::vector values) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = filter_integers;\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({4, std::map(), std::vector(), 23.2, 9, \"adasd\"}))) == (std::vector({(long)4, (long)9})));\n assert(candidate((std::vector({3, \"c\", 3, 3, \"a\", \"b\"}))) == (std::vector({(long)3, (long)3, (long)3})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "cpp", - "prompt": "#include\n#include\n// This function takes a vector l and returns a vector l' such that\n// l' is identical to l in the odd indicies, while its values at the even indicies are equal\n// to the values of the even indicies of l, but sorted.\n// >>> sort_even((std::vector({(long)1, (long)2, (long)3})))\n// (std::vector({(long)1, (long)2, (long)3}))\n// >>> sort_even((std::vector({(long)5, (long)6, (long)3, (long)4})))\n// (std::vector({(long)3, (long)6, (long)5, (long)4}))\nstd::vector sort_even(std::vector l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = sort_even;\n assert(candidate((std::vector({(long)1, (long)2, (long)3}))) == (std::vector({(long)1, (long)2, (long)3})));\n assert(candidate((std::vector({(long)5, (long)3, (long)-5, (long)2, (long)-3, (long)3, (long)9, (long)0, (long)123, (long)1, (long)-10}))) == (std::vector({(long)-10, (long)3, (long)-5, (long)2, (long)-3, (long)3, (long)5, (long)0, (long)9, (long)1, (long)123})));\n assert(candidate((std::vector({(long)5, (long)8, (long)-12, (long)4, (long)23, (long)2, (long)3, (long)11, (long)12, (long)-10}))) == (std::vector({(long)-12, (long)8, (long)3, (long)4, (long)5, (long)2, (long)12, (long)11, (long)23, (long)-10})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "cpp", - "prompt": "#include\n#include\n// I think we all remember that feeling when the result of some long-awaited\n// event is finally known. The feelings and thoughts you have at that moment are\n// definitely worth noting down and comparing.\n// Your task is to determine if a person correctly guessed the results of a number of matches.\n// You are given two vectors of scores and guesses of equal length, where each index shows a match. \n// Return a vector of the same length denoting how far off each guess was. If they have guessed correctly,\n// the value is 0, and if not, the value is the absolute difference between the guess and the score.\n// example:\n// >>> compare((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)1})), (std::vector({(long)1, (long)2, (long)3, (long)4, (long)2, (long)-2})))\n// (std::vector({(long)0, (long)0, (long)0, (long)0, (long)3, (long)3}))\n// >>> compare((std::vector({(long)0, (long)5, (long)0, (long)0, (long)0, (long)4})), (std::vector({(long)4, (long)1, (long)1, (long)0, (long)0, (long)-2})))\n// (std::vector({(long)4, (long)4, (long)1, (long)0, (long)0, (long)6}))\nstd::vector compare(std::vector game, std::vector guess) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = compare;\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)1})), (std::vector({(long)1, (long)2, (long)3, (long)4, (long)2, (long)-2}))) == (std::vector({(long)0, (long)0, (long)0, (long)0, (long)3, (long)3})));\n assert(candidate((std::vector({(long)0, (long)0, (long)0, (long)0, (long)0, (long)0})), (std::vector({(long)0, (long)0, (long)0, (long)0, (long)0, (long)0}))) == (std::vector({(long)0, (long)0, (long)0, (long)0, (long)0, (long)0})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3})), (std::vector({(long)-1, (long)-2, (long)-3}))) == (std::vector({(long)2, (long)4, (long)6})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)5})), (std::vector({(long)-1, (long)2, (long)3, (long)4}))) == (std::vector({(long)2, (long)0, (long)0, (long)1})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "cpp", - "prompt": "#include\n#include\n// Given a positive integer n, return a tuple that has the number of even and odd\n// integer palindromes that fall within the range(1, n), inclusive.\n// Example 1:\n// >>> even_odd_palindrome((3))\n// (std::make_tuple(1, 2))\n// Explanation:\n// Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n// Example 2:\n// >>> even_odd_palindrome((12))\n// (std::make_tuple(4, 6))\n// Explanation:\n// Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n// Note:\n// 1. 1 <= n <= 10^3\n// 2. returned tuple has the number of even and odd integer palindromes respectively.\nstd::tuple even_odd_palindrome(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = even_odd_palindrome;\n assert(candidate((123)) == (std::make_tuple(8, 13)));\n assert(candidate((12)) == (std::make_tuple(4, 6)));\n assert(candidate((3)) == (std::make_tuple(1, 2)));\n assert(candidate((63)) == (std::make_tuple(6, 8)));\n assert(candidate((25)) == (std::make_tuple(5, 6)));\n assert(candidate((19)) == (std::make_tuple(4, 6)));\n assert(candidate((9)) == (std::make_tuple(4, 5)));\n assert(candidate((1)) == (std::make_tuple(0, 1)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "cpp", - "prompt": "#include\n#include\n// The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fib4(0) -> 0\n// fib4(1) -> 0\n// fib4(2) -> 2\n// fib4(3) -> 0\n// fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n// Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n// >>> fib4((5))\n// (4)\n// >>> fib4((6))\n// (8)\n// >>> fib4((7))\n// (14)\nlong fib4(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = fib4;\n assert(candidate((5)) == (4));\n assert(candidate((8)) == (28));\n assert(candidate((10)) == (104));\n assert(candidate((12)) == (386));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "cpp", - "prompt": "#include\n#include\n// Given two positive integers a and b, return the even digits between a\n// and b, in ascending order.\n// For example:\n// >>> generate_integers((2), (8))\n// (std::vector({(long)2, (long)4, (long)6, (long)8}))\n// >>> generate_integers((8), (2))\n// (std::vector({(long)2, (long)4, (long)6, (long)8}))\n// >>> generate_integers((10), (14))\n// (std::vector())\nstd::vector generate_integers(long a, long b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = generate_integers;\n assert(candidate((2), (10)) == (std::vector({(long)2, (long)4, (long)6, (long)8})));\n assert(candidate((10), (2)) == (std::vector({(long)2, (long)4, (long)6, (long)8})));\n assert(candidate((132), (2)) == (std::vector({(long)2, (long)4, (long)6, (long)8})));\n assert(candidate((17), (89)) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "cpp", - "prompt": "#include\n#include\n// For a given vector of input numbers, calculate Mean Absolute Deviation\n// around the mean of this dataset.\n// Mean Absolute Deviation is the average absolute difference between each\n// element and a centerpoint (mean in this case):\n// MAD = average | x - x_mean |\n// >>> mean_absolute_deviation((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0})))\n// (1.0)\nfloat mean_absolute_deviation(std::vector numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = mean_absolute_deviation;\n assert(candidate((std::vector({(float)1.0, (float)2.0}))) == (0.5));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0}))) == (1.0));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0, (float)5.0}))) == (1.2));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function encrypt that takes a string as an argument and\n// returns a string encrypted with the alphabet being rotated. \n// The alphabet should be rotated in a manner such that the letters \n// shift down by two multiplied to two places.\n// For example:\n// >>> encrypt((\"hi\"))\n// (\"lm\")\n// >>> encrypt((\"asdfghjkl\"))\n// (\"ewhjklnop\")\n// >>> encrypt((\"gf\"))\n// (\"kj\")\n// >>> encrypt((\"et\"))\n// (\"ix\")\nstd::string encrypt(std::string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = encrypt;\n assert(candidate((\"hi\")) == (\"lm\"));\n assert(candidate((\"asdfghjkl\")) == (\"ewhjklnop\"));\n assert(candidate((\"gf\")) == (\"kj\"));\n assert(candidate((\"et\")) == (\"ix\"));\n assert(candidate((\"faewfawefaewg\")) == (\"jeiajeaijeiak\"));\n assert(candidate((\"hellomyfriend\")) == (\"lippsqcjvmirh\"));\n assert(candidate((\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\")) == (\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\"));\n assert(candidate((\"a\")) == (\"e\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "cpp", - "prompt": "#include\n#include\n// Given a positive integer n, return a sorted vector that has the odd numbers in collatz sequence.\n// The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n// as follows: start with any positive integer n. Then each term is obtained from the \n// previous term as follows: if the previous term is even, the next term is one half of \n// the previous term. If the previous term is odd, the next term is 3 times the previous\n// term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n// Note: \n// 1. Collatz(1) is [1].\n// 2. returned vector sorted in increasing order.\n// For example:\n// get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n// >>> get_odd_collatz((5))\n// (std::vector({(long)1, (long)5}))\nstd::vector get_odd_collatz(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = get_odd_collatz;\n assert(candidate((14)) == (std::vector({(long)1, (long)5, (long)7, (long)11, (long)13, (long)17})));\n assert(candidate((5)) == (std::vector({(long)1, (long)5})));\n assert(candidate((12)) == (std::vector({(long)1, (long)3, (long)5})));\n assert(candidate((1)) == (std::vector({(long)1})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "cpp", - "prompt": "#include\n#include\n// Find how many times a given substring can be found in the original string. Count overlaping cases.\n// >>> how_many_times((\"\"), (\"a\"))\n// (0)\n// >>> how_many_times((\"aaa\"), (\"a\"))\n// (3)\n// >>> how_many_times((\"aaaa\"), (\"aa\"))\n// (3)\nlong how_many_times(std::string string, std::string substring) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = how_many_times;\n assert(candidate((\"\"), (\"x\")) == (0));\n assert(candidate((\"xyxyxyx\"), (\"x\")) == (4));\n assert(candidate((\"cacacacac\"), (\"cac\")) == (4));\n assert(candidate((\"john doe\"), (\"john\")) == (1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "cpp", - "prompt": "#include\n#include\n// We have a vector 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n// numbers in the vector will be randomly ordered. Your task is to determine if\n// it is possible to get a vector sorted in non-decreasing order by performing \n// the following operation on the given vector:\n// You are allowed to perform right shift operation any number of times.\n// One right shift operation means shifting all elements of the vector by one\n// position in the right direction. The last element of the vector will be moved to\n// the starting position in the vector i.e. 0th index. \n// If it is possible to obtain the sorted vector by performing the above operation\n// then return true else return false.\n// If the given vector is empty then return true.\n// Note: The given vector is guaranteed to have unique elements.\n// For Example:\n// >>> move_one_ball((std::vector({(long)3, (long)4, (long)5, (long)1, (long)2})))\n// (true)\n// Explanation: By performin 2 right shift operations, non-decreasing order can\n// be achieved for the given vector.\n// >>> move_one_ball((std::vector({(long)3, (long)5, (long)4, (long)1, (long)2})))\n// (false)\n// Explanation:It is not possible to get non-decreasing order for the given\n// vector by performing any number of right shift operations.\nbool move_one_ball(std::vector arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = move_one_ball;\n assert(candidate((std::vector({(long)3, (long)4, (long)5, (long)1, (long)2}))) == (true));\n assert(candidate((std::vector({(long)3, (long)5, (long)10, (long)1, (long)2}))) == (true));\n assert(candidate((std::vector({(long)4, (long)3, (long)1, (long)2}))) == (false));\n assert(candidate((std::vector({(long)3, (long)5, (long)4, (long)1, (long)2}))) == (false));\n assert(candidate((std::vector())) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function which sorts the given vector of integers\n// in ascending order according to the sum of their digits.\n// Note: if there are several items with similar sum of their digits,\n// order them based on their index in original vector.\n// For example:\n// >>> order_by_points((std::vector({(long)1, (long)11, (long)-1, (long)-11, (long)-12})))\n// (std::vector({(long)-1, (long)-11, (long)1, (long)-12, (long)11}))\n// >>> order_by_points((std::vector()))\n// (std::vector())\nstd::vector order_by_points(std::vector nums) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = order_by_points;\n assert(candidate((std::vector({(long)1, (long)11, (long)-1, (long)-11, (long)-12}))) == (std::vector({(long)-1, (long)-11, (long)1, (long)-12, (long)11})));\n assert(candidate((std::vector({(long)1234, (long)423, (long)463, (long)145, (long)2, (long)423, (long)423, (long)53, (long)6, (long)37, (long)3457, (long)3, (long)56, (long)0, (long)46}))) == (std::vector({(long)0, (long)2, (long)3, (long)6, (long)53, (long)423, (long)423, (long)423, (long)1234, (long)145, (long)37, (long)46, (long)56, (long)463, (long)3457})));\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)1, (long)-11, (long)-32, (long)43, (long)54, (long)-98, (long)2, (long)-3}))) == (std::vector({(long)-3, (long)-32, (long)-98, (long)-11, (long)1, (long)2, (long)43, (long)54})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6, (long)7, (long)8, (long)9, (long)10, (long)11}))) == (std::vector({(long)1, (long)10, (long)2, (long)11, (long)3, (long)4, (long)5, (long)6, (long)7, (long)8, (long)9})));\n assert(candidate((std::vector({(long)0, (long)6, (long)6, (long)-76, (long)-21, (long)23, (long)4}))) == (std::vector({(long)-76, (long)-21, (long)0, (long)4, (long)23, (long)6, (long)6})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "cpp", - "prompt": "#include\n#include\n// Return vector of prime factors of given integer in the order from smallest to largest.\n// Each of the factors should be vectored number of times corresponding to how many times it appeares in factorization.\n// Input number should be equal to the product of all factors\n// >>> factorize((8))\n// (std::vector({(long)2, (long)2, (long)2}))\n// >>> factorize((25))\n// (std::vector({(long)5, (long)5}))\n// >>> factorize((70))\n// (std::vector({(long)2, (long)5, (long)7}))\nstd::vector factorize(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = factorize;\n assert(candidate((2)) == (std::vector({(long)2})));\n assert(candidate((4)) == (std::vector({(long)2, (long)2})));\n assert(candidate((8)) == (std::vector({(long)2, (long)2, (long)2})));\n assert(candidate((57)) == (std::vector({(long)3, (long)19})));\n assert(candidate((3249)) == (std::vector({(long)3, (long)3, (long)19, (long)19})));\n assert(candidate((185193)) == (std::vector({(long)3, (long)3, (long)3, (long)19, (long)19, (long)19})));\n assert(candidate((20577)) == (std::vector({(long)3, (long)19, (long)19, (long)19})));\n assert(candidate((18)) == (std::vector({(long)2, (long)3, (long)3})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "cpp", - "prompt": "#include\n#include\n// Return true if all numbers in the vector l are below threshold t.\n// >>> below_threshold((std::vector({(long)1, (long)2, (long)4, (long)10})), (100))\n// (true)\n// >>> below_threshold((std::vector({(long)1, (long)20, (long)4, (long)10})), (5))\n// (false)\nbool below_threshold(std::vector l, long t) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = below_threshold;\n assert(candidate((std::vector({(long)1, (long)2, (long)4, (long)10})), (100)) == (true));\n assert(candidate((std::vector({(long)1, (long)20, (long)4, (long)10})), (5)) == (false));\n assert(candidate((std::vector({(long)1, (long)20, (long)4, (long)10})), (21)) == (true));\n assert(candidate((std::vector({(long)1, (long)20, (long)4, (long)10})), (22)) == (true));\n assert(candidate((std::vector({(long)1, (long)8, (long)4, (long)10})), (11)) == (true));\n assert(candidate((std::vector({(long)1, (long)8, (long)4, (long)10})), (10)) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "cpp", - "prompt": "#include\n#include\nunion Union_std_string_long{\n std::string f0;\n long f1; Union_std_string_long(std::string _f0) : f0(_f0) {}\n Union_std_string_long(long _f1) : f1(_f1) {}\n ~Union_std_string_long() {}\n bool operator==(std::string f) {\n return f0 == f ;\n } bool operator==(long f) {\n return f1 == f ;\n }\n};\n// You are given two positive integers n and m, and your task is to compute the\n// average of the integers from n through m (including n and m). \n// Round the answer to the nearest integer and convert that to binary.\n// If n is greater than m, return -1.\n// Example:\n// >>> rounded_avg((1), (5))\n// \"0b11\"\n// >>> rounded_avg((7), (5))\n// -1\n// >>> rounded_avg((10), (20))\n// \"0b1111\"\n// >>> rounded_avg((20), (33))\n// \"0b11010\"\nUnion_std_string_long rounded_avg(long n, long m) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = rounded_avg;\n assert(candidate((1), (5)) == \"0b11\");\n assert(candidate((7), (13)) == \"0b1010\");\n assert(candidate((964), (977)) == \"0b1111001010\");\n assert(candidate((996), (997)) == \"0b1111100100\");\n assert(candidate((560), (851)) == \"0b1011000010\");\n assert(candidate((185), (546)) == \"0b101101110\");\n assert(candidate((362), (496)) == \"0b110101101\");\n assert(candidate((350), (902)) == \"0b1001110010\");\n assert(candidate((197), (233)) == \"0b11010111\");\n assert(candidate((7), (5)) == -1);\n assert(candidate((5), (1)) == -1);\n assert(candidate((5), (5)) == \"0b101\");\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "cpp", - "prompt": "#include\n#include\n// Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n// For each of the group, output the deepest level of nesting of parentheses.\n// E.g. (()()) has maximum two levels of nesting while ((())) has three.\n// >>> parse_nested_parens((\"(()()) ((())) () ((())()())\"))\n// (std::vector({(long)2, (long)3, (long)1, (long)3}))\nstd::vector parse_nested_parens(std::string paren_string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = parse_nested_parens;\n assert(candidate((\"(()()) ((())) () ((())()())\")) == (std::vector({(long)2, (long)3, (long)1, (long)3})));\n assert(candidate((\"() (()) ((())) (((())))\")) == (std::vector({(long)1, (long)2, (long)3, (long)4})));\n assert(candidate((\"(()(())((())))\")) == (std::vector({(long)4})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "cpp", - "prompt": "#include\n#include\n// Given a non-empty vector of integers, return the sum of all of the odd elements that are in even positions.\n// Examples\n// >>> solution((std::vector({(long)5, (long)8, (long)7, (long)1})))\n// (12)\n// >>> solution((std::vector({(long)3, (long)3, (long)3, (long)3, (long)3})))\n// (9)\n// >>> solution((std::vector({(long)30, (long)13, (long)24, (long)321})))\n// (0)\nlong solution(std::vector lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = solution;\n assert(candidate((std::vector({(long)5, (long)8, (long)7, (long)1}))) == (12));\n assert(candidate((std::vector({(long)3, (long)3, (long)3, (long)3, (long)3}))) == (9));\n assert(candidate((std::vector({(long)30, (long)13, (long)24, (long)321}))) == (0));\n assert(candidate((std::vector({(long)5, (long)9}))) == (5));\n assert(candidate((std::vector({(long)2, (long)4, (long)8}))) == (0));\n assert(candidate((std::vector({(long)30, (long)13, (long)23, (long)32}))) == (23));\n assert(candidate((std::vector({(long)3, (long)13, (long)2, (long)9}))) == (3));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a positive integer n. You have to create an integer vector a of length n.\n// For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n// Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n// and a[i] + a[j] + a[k] is a multiple of 3.\n// Example :\n// >>> get_max_triples((5))\n// (1)\n// Explanation: \n// a = [1, 3, 7, 13, 21]\n// The only valid triple is (1, 7, 13).\nlong get_max_triples(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = get_max_triples;\n assert(candidate((5)) == (1));\n assert(candidate((6)) == (4));\n assert(candidate((10)) == (36));\n assert(candidate((100)) == (53361));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "cpp", - "prompt": "#include\n#include\n// There are eight planets in our solar system: the closerst to the Sun \n// is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n// Uranus, Neptune.\n// Write a function that takes two planet names as strings planet1 and planet2. \n// The function should return a tuple containing all planets whose orbits are \n// located between the orbit of planet1 and the orbit of planet2, sorted by \n// the proximity to the sun. \n// The function should return an empty tuple if planet1 or planet2\n// are not correct planet names. \n// Examples\n// >>> bf((\"Jupiter\"), (\"Neptune\"))\n// (std::vector({(std::string)\"Saturn\", (std::string)\"Uranus\"}))\n// >>> bf((\"Earth\"), (\"Mercury\"))\n// (std::vector(\"Venus\"))\n// >>> bf((\"Mercury\"), (\"Uranus\"))\n// (std::vector({(std::string)\"Venus\", (std::string)\"Earth\", (std::string)\"Mars\", (std::string)\"Jupiter\", (std::string)\"Saturn\"}))\nstd::vector bf(std::string planet1, std::string planet2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = bf;\n assert(candidate((\"Jupiter\"), (\"Neptune\")) == (std::vector({(std::string)\"Saturn\", (std::string)\"Uranus\"})));\n assert(candidate((\"Earth\"), (\"Mercury\")) == (std::vector({(std::string)\"Venus\"})));\n assert(candidate((\"Mercury\"), (\"Uranus\")) == (std::vector({(std::string)\"Venus\", (std::string)\"Earth\", (std::string)\"Mars\", (std::string)\"Jupiter\", (std::string)\"Saturn\"})));\n assert(candidate((\"Neptune\"), (\"Venus\")) == (std::vector({(std::string)\"Earth\", (std::string)\"Mars\", (std::string)\"Jupiter\", (std::string)\"Saturn\", (std::string)\"Uranus\"})));\n assert(candidate((\"Earth\"), (\"Earth\")) == (std::vector()));\n assert(candidate((\"Mars\"), (\"Earth\")) == (std::vector()));\n assert(candidate((\"Jupiter\"), (\"Makemake\")) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a vector of integers.\n// Write a function next_smallest() that returns the 2nd smallest element of the vector.\n// Return None if there is no such element.\n// >>> next_smallest((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5})))\n// 2\n// >>> next_smallest((std::vector({(long)5, (long)1, (long)4, (long)3, (long)2})))\n// 2\n// >>> next_smallest((std::vector()))\n// std::nullopt\n// >>> next_smallest((std::vector({(long)1, (long)1})))\n// std::nullopt\nstd::optional next_smallest(std::vector lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = next_smallest;\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5}))) == 2);\n assert(candidate((std::vector({(long)5, (long)1, (long)4, (long)3, (long)2}))) == 2);\n assert(candidate((std::vector())) == std::nullopt);\n assert(candidate((std::vector({(long)1, (long)1}))) == std::nullopt);\n assert(candidate((std::vector({(long)1, (long)1, (long)1, (long)1, (long)0}))) == 1);\n assert(candidate((std::vector({(long)1, (long)1}))) == std::nullopt);\n assert(candidate((std::vector({(long)-35, (long)34, (long)12, (long)-45}))) == -35);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "cpp", - "prompt": "#include\n#include\n// Input is a space-delimited string of numberals from 'zero' to 'nine'.\n// Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n// Return the string with numbers sorted from smallest to largest\n// >>> sort_numbers((\"three one five\"))\n// (\"one three five\")\nstd::string sort_numbers(std::string numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = sort_numbers;\n assert(candidate((\"\")) == (\"\"));\n assert(candidate((\"three\")) == (\"three\"));\n assert(candidate((\"three five nine\")) == (\"three five nine\"));\n assert(candidate((\"five zero four seven nine eight\")) == (\"zero four five seven eight nine\"));\n assert(candidate((\"six five four three two one zero\")) == (\"zero one two three four five six\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "cpp", - "prompt": "#include\n#include\n// You are given 2 words. You need to return true if the second word or any of its rotations is a substring in the first word\n// >>> cycpattern_check((\"abcd\"), (\"abd\"))\n// (false)\n// >>> cycpattern_check((\"hello\"), (\"ell\"))\n// (true)\n// >>> cycpattern_check((\"whassup\"), (\"psus\"))\n// (false)\n// >>> cycpattern_check((\"abab\"), (\"baa\"))\n// (true)\n// >>> cycpattern_check((\"efef\"), (\"eeff\"))\n// (false)\n// >>> cycpattern_check((\"himenss\"), (\"simen\"))\n// (true)\nbool cycpattern_check(std::string a, std::string b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = cycpattern_check;\n assert(candidate((\"xyzw\"), (\"xyw\")) == (false));\n assert(candidate((\"yello\"), (\"ell\")) == (true));\n assert(candidate((\"whattup\"), (\"ptut\")) == (false));\n assert(candidate((\"efef\"), (\"fee\")) == (true));\n assert(candidate((\"abab\"), (\"aabb\")) == (false));\n assert(candidate((\"winemtt\"), (\"tinem\")) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "cpp", - "prompt": "#include\n#include\n// You will be given a number in decimal form and your task is to convert it to\n// binary format. The function should return a string, with each character representing a binary\n// number. Each character in the string will be '0' or '1'.\n// There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n// The extra characters are there to help with the format.\n// Examples:\n// >>> decimal_to_binary((15))\n// (\"db1111db\")\n// >>> decimal_to_binary((32))\n// (\"db100000db\")\nstd::string decimal_to_binary(long decimal) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = decimal_to_binary;\n assert(candidate((0)) == (\"db0db\"));\n assert(candidate((32)) == (\"db100000db\"));\n assert(candidate((103)) == (\"db1100111db\"));\n assert(candidate((15)) == (\"db1111db\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "cpp", - "prompt": "#include\n#include\n// Filter an input vector of strings only for ones that contain given substring\n// >>> filter_by_substring((std::vector()), (\"a\"))\n// (std::vector())\n// >>> filter_by_substring((std::vector({(std::string)\"abc\", (std::string)\"bacd\", (std::string)\"cde\", (std::string)\"array\"})), (\"a\"))\n// (std::vector({(std::string)\"abc\", (std::string)\"bacd\", (std::string)\"array\"}))\nstd::vector filter_by_substring(std::vector strings, std::string substring) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = filter_by_substring;\n assert(candidate((std::vector()), (\"john\")) == (std::vector()));\n assert(candidate((std::vector({(std::string)\"xxx\", (std::string)\"asd\", (std::string)\"xxy\", (std::string)\"john doe\", (std::string)\"xxxAAA\", (std::string)\"xxx\"})), (\"xxx\")) == (std::vector({(std::string)\"xxx\", (std::string)\"xxxAAA\", (std::string)\"xxx\"})));\n assert(candidate((std::vector({(std::string)\"xxx\", (std::string)\"asd\", (std::string)\"aaaxxy\", (std::string)\"john doe\", (std::string)\"xxxAAA\", (std::string)\"xxx\"})), (\"xx\")) == (std::vector({(std::string)\"xxx\", (std::string)\"aaaxxy\", (std::string)\"xxxAAA\", (std::string)\"xxx\"})));\n assert(candidate((std::vector({(std::string)\"grunt\", (std::string)\"trumpet\", (std::string)\"prune\", (std::string)\"gruesome\"})), (\"run\")) == (std::vector({(std::string)\"grunt\", (std::string)\"prune\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "cpp", - "prompt": "#include\n#include\n// Given an integer. return a tuple that has the number of even and odd digits respectively.\n// Example:\n// >>> even_odd_count((-12))\n// (std::make_tuple(1, 1))\n// >>> even_odd_count((123))\n// (std::make_tuple(1, 2))\nstd::tuple even_odd_count(long num) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = even_odd_count;\n assert(candidate((7)) == (std::make_tuple(0, 1)));\n assert(candidate((-78)) == (std::make_tuple(1, 1)));\n assert(candidate((3452)) == (std::make_tuple(2, 2)));\n assert(candidate((346211)) == (std::make_tuple(3, 3)));\n assert(candidate((-345821)) == (std::make_tuple(3, 3)));\n assert(candidate((-2)) == (std::make_tuple(1, 0)));\n assert(candidate((-45347)) == (std::make_tuple(2, 3)));\n assert(candidate((0)) == (std::make_tuple(1, 0)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that accepts a vector of strings.\n// The vector contains different words. Return the word with maximum number\n// of unique characters. If multiple strings have maximum number of unique\n// characters, return the one which comes first in lexicographical order.\n// >>> find_max((std::vector({(std::string)\"name\", (std::string)\"of\", (std::string)\"string\"})))\n// (\"string\")\n// >>> find_max((std::vector({(std::string)\"name\", (std::string)\"enam\", (std::string)\"game\"})))\n// (\"enam\")\n// >>> find_max((std::vector({(std::string)\"aaaaaaa\", (std::string)\"bb\", (std::string)\"cc\"})))\n// (\"aaaaaaa\")\nstd::string find_max(std::vector words) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = find_max;\n assert(candidate((std::vector({(std::string)\"name\", (std::string)\"of\", (std::string)\"string\"}))) == (\"string\"));\n assert(candidate((std::vector({(std::string)\"name\", (std::string)\"enam\", (std::string)\"game\"}))) == (\"enam\"));\n assert(candidate((std::vector({(std::string)\"aaaaaaa\", (std::string)\"bb\", (std::string)\"cc\"}))) == (\"aaaaaaa\"));\n assert(candidate((std::vector({(std::string)\"abc\", (std::string)\"cba\"}))) == (\"abc\"));\n assert(candidate((std::vector({(std::string)\"play\", (std::string)\"this\", (std::string)\"game\", (std::string)\"of\", (std::string)\"footbott\"}))) == (\"footbott\"));\n assert(candidate((std::vector({(std::string)\"we\", (std::string)\"are\", (std::string)\"gonna\", (std::string)\"rock\"}))) == (\"gonna\"));\n assert(candidate((std::vector({(std::string)\"we\", (std::string)\"are\", (std::string)\"a\", (std::string)\"mad\", (std::string)\"nation\"}))) == (\"nation\"));\n assert(candidate((std::vector({(std::string)\"this\", (std::string)\"is\", (std::string)\"a\", (std::string)\"prrk\"}))) == (\"this\"));\n assert(candidate((std::vector({(std::string)\"b\"}))) == (\"b\"));\n assert(candidate((std::vector({(std::string)\"play\", (std::string)\"play\", (std::string)\"play\"}))) == (\"play\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "cpp", - "prompt": "#include\n#include\n// Given a positive integer n, return the count of the numbers of n-digit\n// positive integers that start or end with 1.\nlong starts_one_ends(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = starts_one_ends;\n assert(candidate((1)) == (1));\n assert(candidate((2)) == (18));\n assert(candidate((3)) == (180));\n assert(candidate((4)) == (1800));\n assert(candidate((5)) == (18000));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function that returns a tuple (a, b), where 'a' is\n// the largest of negative integers, and 'b' is the smallest\n// of positive integers in a vector.\n// If there is no negative or positive integers, return them as None.\n// Examples:\n// >>> largest_smallest_integers((std::vector({(long)2, (long)4, (long)1, (long)3, (long)5, (long)7})))\n// std::make_tuple(std::optional(std::nullopt), std::optional(1))\n// >>> largest_smallest_integers((std::vector()))\n// std::make_tuple(std::optional(std::nullopt), std::optional(std::nullopt))\n// >>> largest_smallest_integers((std::vector({(long)0})))\n// std::make_tuple(std::optional(std::nullopt), std::optional(std::nullopt))\nstd::tuple, std::optional> largest_smallest_integers(std::vector lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = largest_smallest_integers;\n assert(candidate((std::vector({(long)2, (long)4, (long)1, (long)3, (long)5, (long)7}))) == std::make_tuple(std::optional(std::nullopt), std::optional(1)));\n assert(candidate((std::vector({(long)2, (long)4, (long)1, (long)3, (long)5, (long)7, (long)0}))) == std::make_tuple(std::optional(std::nullopt), std::optional(1)));\n assert(candidate((std::vector({(long)1, (long)3, (long)2, (long)4, (long)5, (long)6, (long)-2}))) == std::make_tuple(-2, 1));\n assert(candidate((std::vector({(long)4, (long)5, (long)3, (long)6, (long)2, (long)7, (long)-7}))) == std::make_tuple(-7, 2));\n assert(candidate((std::vector({(long)7, (long)3, (long)8, (long)4, (long)9, (long)2, (long)5, (long)-9}))) == std::make_tuple(-9, 2));\n assert(candidate((std::vector())) == std::make_tuple(std::optional(std::nullopt), std::optional(std::nullopt)));\n assert(candidate((std::vector({(long)0}))) == std::make_tuple(std::optional(std::nullopt), std::optional(std::nullopt)));\n assert(candidate((std::vector({(long)-1, (long)-3, (long)-5, (long)-6}))) == std::make_tuple(std::optional(-1), std::optional(std::nullopt)));\n assert(candidate((std::vector({(long)-1, (long)-3, (long)-5, (long)-6, (long)0}))) == std::make_tuple(std::optional(-1), std::optional(std::nullopt)));\n assert(candidate((std::vector({(long)-6, (long)-4, (long)-4, (long)-3, (long)1}))) == std::make_tuple(-3, 1));\n assert(candidate((std::vector({(long)-6, (long)-4, (long)-4, (long)-3, (long)-100, (long)1}))) == std::make_tuple(-3, 1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "cpp", - "prompt": "#include\n#include\n// \"Given a vector representing a branch of a tree that has non-negative integer nodes\n// your task is to pluck one of the nodes and return it.\n// The plucked node should be the node with the smallest even value.\n// If multiple nodes with the same smallest even value are found return the node that has smallest index.\n// The plucked node should be returned in a vector, [ smalest_value, its index ],\n// If there are no even values or the given vector is empty, return [].\n// Example 1:\n// >>> pluck((std::vector({(long)4, (long)2, (long)3})))\n// (std::vector({(long)2, (long)1}))\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 2:\n// >>> pluck((std::vector({(long)1, (long)2, (long)3})))\n// (std::vector({(long)2, (long)1}))\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 3:\n// >>> pluck((std::vector()))\n// (std::vector())\n// Example 4:\n// >>> pluck((std::vector({(long)5, (long)0, (long)3, (long)0, (long)4, (long)2})))\n// (std::vector({(long)0, (long)1}))\n// Explanation: 0 is the smallest value, but there are two zeros,\n// so we will choose the first zero, which has the smallest index.\n// Constraints:\n// * 1 <= nodes.length <= 10000\n// * 0 <= node.value\nstd::vector pluck(std::vector arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = pluck;\n assert(candidate((std::vector({(long)4, (long)2, (long)3}))) == (std::vector({(long)2, (long)1})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3}))) == (std::vector({(long)2, (long)1})));\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)5, (long)0, (long)3, (long)0, (long)4, (long)2}))) == (std::vector({(long)0, (long)1})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)0, (long)5, (long)3}))) == (std::vector({(long)0, (long)3})));\n assert(candidate((std::vector({(long)5, (long)4, (long)8, (long)4, (long)8}))) == (std::vector({(long)4, (long)1})));\n assert(candidate((std::vector({(long)7, (long)6, (long)7, (long)1}))) == (std::vector({(long)6, (long)1})));\n assert(candidate((std::vector({(long)7, (long)9, (long)7, (long)1}))) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function count_nums which takes a vector of integers and returns\n// the number of elements which has a sum of digits > 0.\n// If a number is negative, then its first signed digit will be negative:\n// e.g. -123 has signed digits -1, 2, and 3.\n// >>> count_nums((std::vector()))\n// (0)\n// >>> count_nums((std::vector({(long)-1, (long)11, (long)-11})))\n// (1)\n// >>> count_nums((std::vector({(long)1, (long)1, (long)2})))\n// (3)\nlong count_nums(std::vector arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = count_nums;\n assert(candidate((std::vector())) == (0));\n assert(candidate((std::vector({(long)-1, (long)-2, (long)0}))) == (0));\n assert(candidate((std::vector({(long)1, (long)1, (long)2, (long)-2, (long)3, (long)4, (long)5}))) == (6));\n assert(candidate((std::vector({(long)1, (long)6, (long)9, (long)-6, (long)0, (long)1, (long)5}))) == (5));\n assert(candidate((std::vector({(long)1, (long)100, (long)98, (long)-7, (long)1, (long)-1}))) == (4));\n assert(candidate((std::vector({(long)12, (long)23, (long)34, (long)-45, (long)-56, (long)0}))) == (5));\n assert(candidate((std::vector({(long)0, (long)1}))) == (1));\n assert(candidate((std::vector({(long)1}))) == (1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "cpp", - "prompt": "#include\n#include\n// Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n// each cell of the grid contains a value. Every integer in the range [1, N * N]\n// inclusive appears exactly once on the cells of the grid.\n// You have to find the minimum path of length k in the grid. You can start\n// from any cell, and in each step you can move to any of the neighbor cells,\n// in other words, you can go to cells which share an edge with you current\n// cell.\n// Please note that a path of length k means visiting exactly k cells (not\n// necessarily distinct).\n// You CANNOT go off the grid.\n// A path A (of length k) is considered less than a path B (of length k) if\n// after making the ordered vectors of the values on the cells that A and B go\n// through (let's call them lst_A and lst_B), lst_A is lexicographically less\n// than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n// such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n// lst_A[j] = lst_B[j].\n// It is guaranteed that the answer is unique.\n// Return an ordered vector of the values on the cells that the minimum path go through.\n// Examples: \n// >>> minPath((std::vector>({(std::vector)std::vector({(long)1, (long)2, (long)3}), (std::vector)std::vector({(long)4, (long)5, (long)6}), (std::vector)std::vector({(long)7, (long)8, (long)9})})), (3))\n// (std::vector({(long)1, (long)2, (long)1}))\n// >>> minPath((std::vector>({(std::vector)std::vector({(long)5, (long)9, (long)3}), (std::vector)std::vector({(long)4, (long)1, (long)6}), (std::vector)std::vector({(long)7, (long)8, (long)2})})), (1))\n// (std::vector({(long)1}))\nstd::vector minPath(std::vector> grid, long k) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = minPath;\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)2, (long)3}), (std::vector)std::vector({(long)4, (long)5, (long)6}), (std::vector)std::vector({(long)7, (long)8, (long)9})})), (3)) == (std::vector({(long)1, (long)2, (long)1})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)5, (long)9, (long)3}), (std::vector)std::vector({(long)4, (long)1, (long)6}), (std::vector)std::vector({(long)7, (long)8, (long)2})})), (1)) == (std::vector({(long)1})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)2, (long)3, (long)4}), (std::vector)std::vector({(long)5, (long)6, (long)7, (long)8}), (std::vector)std::vector({(long)9, (long)10, (long)11, (long)12}), (std::vector)std::vector({(long)13, (long)14, (long)15, (long)16})})), (4)) == (std::vector({(long)1, (long)2, (long)1, (long)2})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)6, (long)4, (long)13, (long)10}), (std::vector)std::vector({(long)5, (long)7, (long)12, (long)1}), (std::vector)std::vector({(long)3, (long)16, (long)11, (long)15}), (std::vector)std::vector({(long)8, (long)14, (long)9, (long)2})})), (7)) == (std::vector({(long)1, (long)10, (long)1, (long)10, (long)1, (long)10, (long)1})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)8, (long)14, (long)9, (long)2}), (std::vector)std::vector({(long)6, (long)4, (long)13, (long)15}), (std::vector)std::vector({(long)5, (long)7, (long)1, (long)12}), (std::vector)std::vector({(long)3, (long)10, (long)11, (long)16})})), (5)) == (std::vector({(long)1, (long)7, (long)1, (long)7, (long)1})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)11, (long)8, (long)7, (long)2}), (std::vector)std::vector({(long)5, (long)16, (long)14, (long)4}), (std::vector)std::vector({(long)9, (long)3, (long)15, (long)6}), (std::vector)std::vector({(long)12, (long)13, (long)10, (long)1})})), (9)) == (std::vector({(long)1, (long)6, (long)1, (long)6, (long)1, (long)6, (long)1, (long)6, (long)1})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)12, (long)13, (long)10, (long)1}), (std::vector)std::vector({(long)9, (long)3, (long)15, (long)6}), (std::vector)std::vector({(long)5, (long)16, (long)14, (long)4}), (std::vector)std::vector({(long)11, (long)8, (long)7, (long)2})})), (12)) == (std::vector({(long)1, (long)6, (long)1, (long)6, (long)1, (long)6, (long)1, (long)6, (long)1, (long)6, (long)1, (long)6})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)2, (long)7, (long)4}), (std::vector)std::vector({(long)3, (long)1, (long)5}), (std::vector)std::vector({(long)6, (long)8, (long)9})})), (8)) == (std::vector({(long)1, (long)3, (long)1, (long)3, (long)1, (long)3, (long)1, (long)3})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)6, (long)1, (long)5}), (std::vector)std::vector({(long)3, (long)8, (long)9}), (std::vector)std::vector({(long)2, (long)7, (long)4})})), (8)) == (std::vector({(long)1, (long)5, (long)1, (long)5, (long)1, (long)5, (long)1, (long)5})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)2}), (std::vector)std::vector({(long)3, (long)4})})), (10)) == (std::vector({(long)1, (long)2, (long)1, (long)2, (long)1, (long)2, (long)1, (long)2, (long)1, (long)2})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)3}), (std::vector)std::vector({(long)3, (long)2})})), (10)) == (std::vector({(long)1, (long)3, (long)1, (long)3, (long)1, (long)3, (long)1, (long)3, (long)1, (long)3})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "cpp", - "prompt": "#include\n#include\n// Given vector of integers, return vector in strange order.\n// Strange sorting, is when you start with the minimum value,\n// then maximum of the remaining integers, then minimum and so on.\n// Examples:\n// >>> strange_sort_list((std::vector({(long)1, (long)2, (long)3, (long)4})))\n// (std::vector({(long)1, (long)4, (long)2, (long)3}))\n// >>> strange_sort_list((std::vector({(long)5, (long)5, (long)5, (long)5})))\n// (std::vector({(long)5, (long)5, (long)5, (long)5}))\n// >>> strange_sort_list((std::vector()))\n// (std::vector())\nstd::vector strange_sort_list(std::vector lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = strange_sort_list;\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4}))) == (std::vector({(long)1, (long)4, (long)2, (long)3})));\n assert(candidate((std::vector({(long)5, (long)6, (long)7, (long)8, (long)9}))) == (std::vector({(long)5, (long)9, (long)6, (long)8, (long)7})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5}))) == (std::vector({(long)1, (long)5, (long)2, (long)4, (long)3})));\n assert(candidate((std::vector({(long)5, (long)6, (long)7, (long)8, (long)9, (long)1}))) == (std::vector({(long)1, (long)9, (long)5, (long)8, (long)6, (long)7})));\n assert(candidate((std::vector({(long)5, (long)5, (long)5, (long)5}))) == (std::vector({(long)5, (long)5, (long)5, (long)5})));\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6, (long)7, (long)8}))) == (std::vector({(long)1, (long)8, (long)2, (long)7, (long)3, (long)6, (long)4, (long)5})));\n assert(candidate((std::vector({(long)0, (long)2, (long)2, (long)2, (long)5, (long)5, (long)-5, (long)-5}))) == (std::vector({(long)-5, (long)5, (long)-5, (long)5, (long)0, (long)2, (long)2, (long)2})));\n assert(candidate((std::vector({(long)111111}))) == (std::vector({(long)111111})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "cpp", - "prompt": "#include\n#include\n// Given a string 'text', return its md5 hash equivalent string.\n// If 'text' is an empty string, return None.\n// >>> string_to_md5((\"Hello world\"))\n// \"3e25960a79dbc69b674cd4ec67a72c62\"\nstd::optional string_to_md5(std::string text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = string_to_md5;\n assert(candidate((\"Hello world\")) == \"3e25960a79dbc69b674cd4ec67a72c62\");\n assert(candidate((\"\")) == std::nullopt);\n assert(candidate((\"A B C\")) == \"0ef78513b0cb8cef12743f5aeb35f888\");\n assert(candidate((\"password\")) == \"5f4dcc3b5aa765d61d8327deb882cf99\");\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a word. Your task is to find the closest vowel that stands between \n// two consonants from the right side of the word (case sensitive).\n// Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n// find any vowel met the above condition. \n// You may assume that the given string contains English letter only.\n// Example:\n// >>> get_closest_vowel((\"yogurt\"))\n// (\"u\")\n// >>> get_closest_vowel((\"FULL\"))\n// (\"U\")\n// >>> get_closest_vowel((\"quick\"))\n// (\"\")\n// >>> get_closest_vowel((\"ab\"))\n// (\"\")\nstd::string get_closest_vowel(std::string word) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = get_closest_vowel;\n assert(candidate((\"yogurt\")) == (\"u\"));\n assert(candidate((\"full\")) == (\"u\"));\n assert(candidate((\"easy\")) == (\"\"));\n assert(candidate((\"eAsy\")) == (\"\"));\n assert(candidate((\"ali\")) == (\"\"));\n assert(candidate((\"bad\")) == (\"a\"));\n assert(candidate((\"most\")) == (\"o\"));\n assert(candidate((\"ab\")) == (\"\"));\n assert(candidate((\"ba\")) == (\"\"));\n assert(candidate((\"quick\")) == (\"\"));\n assert(candidate((\"anime\")) == (\"i\"));\n assert(candidate((\"Asia\")) == (\"\"));\n assert(candidate((\"Above\")) == (\"o\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "cpp", - "prompt": "#include\n#include\n// Change numerical base of input number x to base.\n// return string representation after the conversion.\n// base numbers are less than 10.\n// >>> change_base((8), (3))\n// (\"22\")\n// >>> change_base((8), (2))\n// (\"1000\")\n// >>> change_base((7), (2))\n// (\"111\")\nstd::string change_base(long x, long base) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = change_base;\n assert(candidate((8), (3)) == (\"22\"));\n assert(candidate((9), (3)) == (\"100\"));\n assert(candidate((234), (2)) == (\"11101010\"));\n assert(candidate((16), (2)) == (\"10000\"));\n assert(candidate((8), (2)) == (\"1000\"));\n assert(candidate((7), (2)) == (\"111\"));\n assert(candidate((2), (3)) == (\"2\"));\n assert(candidate((3), (4)) == (\"3\"));\n assert(candidate((4), (5)) == (\"4\"));\n assert(candidate((5), (6)) == (\"5\"));\n assert(candidate((6), (7)) == (\"6\"));\n assert(candidate((7), (8)) == (\"7\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "cpp", - "prompt": "#include\n#include\n// Check if in given vector of numbers, are any two numbers closer to each other than\n// given threshold.\n// >>> has_close_elements((std::vector({(float)1.0, (float)2.0, (float)3.0})), (0.5))\n// (false)\n// >>> has_close_elements((std::vector({(float)1.0, (float)2.8, (float)3.0, (float)4.0, (float)5.0, (float)2.0})), (0.3))\n// (true)\nbool has_close_elements(std::vector numbers, float threshold) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = has_close_elements;\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.9, (float)4.0, (float)5.0, (float)2.2})), (0.3)) == (true));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.9, (float)4.0, (float)5.0, (float)2.2})), (0.05)) == (false));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)5.9, (float)4.0, (float)5.0})), (0.95)) == (true));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)5.9, (float)4.0, (float)5.0})), (0.8)) == (false));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0, (float)5.0, (float)2.0})), (0.1)) == (true));\n assert(candidate((std::vector({(float)1.1, (float)2.2, (float)3.1, (float)4.1, (float)5.1})), (1.0)) == (true));\n assert(candidate((std::vector({(float)1.1, (float)2.2, (float)3.1, (float)4.1, (float)5.1})), (0.5)) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function that takes a string as input which contains only square brackets.\n// The function should return true if and only if there is a valid subsequence of brackets \n// where at least one bracket in the subsequence is nested.\n// >>> is_nested((\"[[]]\"))\n// (true)\n// >>> is_nested((\"[]]]]]]][[[[[]\"))\n// (false)\n// >>> is_nested((\"[][]\"))\n// (false)\n// >>> is_nested((\"[]\"))\n// (false)\n// >>> is_nested((\"[[][]]\"))\n// (true)\n// >>> is_nested((\"[[]][[\"))\n// (true)\nbool is_nested(std::string string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = is_nested;\n assert(candidate((\"[[]]\")) == (true));\n assert(candidate((\"[]]]]]]][[[[[]\")) == (false));\n assert(candidate((\"[][]\")) == (false));\n assert(candidate((\"[]\")) == (false));\n assert(candidate((\"[[[[]]]]\")) == (true));\n assert(candidate((\"[]]]]]]]]]]\")) == (false));\n assert(candidate((\"[][][[]]\")) == (true));\n assert(candidate((\"[[]\")) == (false));\n assert(candidate((\"[]]\")) == (false));\n assert(candidate((\"[[]][[\")) == (true));\n assert(candidate((\"[[][]]\")) == (true));\n assert(candidate((\"\")) == (false));\n assert(candidate((\"[[[[[[[[\")) == (false));\n assert(candidate((\"]]]]]]]]\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "cpp", - "prompt": "#include\n#include\n// Concatenate vector of strings into a single string\n// >>> concatenate((std::vector()))\n// (\"\")\n// >>> concatenate((std::vector({(std::string)\"a\", (std::string)\"b\", (std::string)\"c\"})))\n// (\"abc\")\nstd::string concatenate(std::vector strings) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = concatenate;\n assert(candidate((std::vector())) == (\"\"));\n assert(candidate((std::vector({(std::string)\"x\", (std::string)\"y\", (std::string)\"z\"}))) == (\"xyz\"));\n assert(candidate((std::vector({(std::string)\"x\", (std::string)\"y\", (std::string)\"z\", (std::string)\"w\", (std::string)\"k\"}))) == (\"xyzwk\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "cpp", - "prompt": "#include\n#include\n// prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n// >>> prime_fib((1))\n// (2)\n// >>> prime_fib((2))\n// (3)\n// >>> prime_fib((3))\n// (5)\n// >>> prime_fib((4))\n// (13)\n// >>> prime_fib((5))\n// (89)\nlong prime_fib(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = prime_fib;\n assert(candidate((1)) == (2));\n assert(candidate((2)) == (3));\n assert(candidate((3)) == (5));\n assert(candidate((4)) == (13));\n assert(candidate((5)) == (89));\n assert(candidate((6)) == (233));\n assert(candidate((7)) == (1597));\n assert(candidate((8)) == (28657));\n assert(candidate((9)) == (514229));\n assert(candidate((10)) == (433494437));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "cpp", - "prompt": "#include\n#include\n// From a supplied vector of numbers (of length at least two) select and return two that are the closest to each\n// other and return them in order (smaller number, larger number).\n// >>> find_closest_elements((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0, (float)5.0, (float)2.2})))\n// (std::make_tuple(2.0, 2.2))\n// >>> find_closest_elements((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0, (float)5.0, (float)2.0})))\n// (std::make_tuple(2.0, 2.0))\nstd::tuple find_closest_elements(std::vector numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = find_closest_elements;\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.9, (float)4.0, (float)5.0, (float)2.2}))) == (std::make_tuple(3.9, 4.0)));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)5.9, (float)4.0, (float)5.0}))) == (std::make_tuple(5.0, 5.9)));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0, (float)5.0, (float)2.2}))) == (std::make_tuple(2.0, 2.2)));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0, (float)5.0, (float)2.0}))) == (std::make_tuple(2.0, 2.0)));\n assert(candidate((std::vector({(float)1.1, (float)2.2, (float)3.1, (float)4.1, (float)5.1}))) == (std::make_tuple(2.2, 3.1)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "cpp", - "prompt": "#include\n#include\n// You have been tasked to write a function that receives \n// a hexadecimal number as a string and counts the number of hexadecimal \n// digits that are primes (prime number, or a prime, is a natural number \n// greater than 1 that is not a product of two smaller natural numbers).\n// Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n// Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n// So you have to determine a number of the following digits: 2, 3, 5, 7, \n// B (=decimal 11), D (=decimal 13).\n// Note: you may assume the input is always correct or empty string, \n// and symbols A,B,C,D,E,F are always uppercase.\n// Examples:\n// >>> hex_key((\"AB\"))\n// (1)\n// >>> hex_key((\"1077E\"))\n// (2)\n// >>> hex_key((\"ABED1A33\"))\n// (4)\n// >>> hex_key((\"123456789ABCDEF0\"))\n// (6)\n// >>> hex_key((\"2020\"))\n// (2)\nlong hex_key(std::string num) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = hex_key;\n assert(candidate((\"AB\")) == (1));\n assert(candidate((\"1077E\")) == (2));\n assert(candidate((\"ABED1A33\")) == (4));\n assert(candidate((\"2020\")) == (2));\n assert(candidate((\"123456789ABCDEF0\")) == (6));\n assert(candidate((\"112233445566778899AABBCCDDEEFF00\")) == (12));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "cpp", - "prompt": "#include\n#include\n// Complete the function that takes two integers and returns \n// the product of their unit digits.\n// Assume the input is always valid.\n// Examples:\n// >>> multiply((148), (412))\n// (16)\n// >>> multiply((19), (28))\n// (72)\n// >>> multiply((2020), (1851))\n// (0)\n// >>> multiply((14), (-15))\n// (20)\nlong multiply(long a, long b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = multiply;\n assert(candidate((148), (412)) == (16));\n assert(candidate((19), (28)) == (72));\n assert(candidate((2020), (1851)) == (0));\n assert(candidate((14), (-15)) == (20));\n assert(candidate((76), (67)) == (42));\n assert(candidate((17), (27)) == (49));\n assert(candidate((0), (1)) == (0));\n assert(candidate((0), (0)) == (0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "cpp", - "prompt": "#include\n#include\n// Given vector of numbers (of at least two elements), apply a linear transform to that vector,\n// such that the smallest number will become 0 and the largest will become 1\n// >>> rescale_to_unit((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0, (float)5.0})))\n// (std::vector({(float)0.0, (float)0.25, (float)0.5, (float)0.75, (float)1.0}))\nstd::vector rescale_to_unit(std::vector numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = rescale_to_unit;\n assert(candidate((std::vector({(float)2.0, (float)49.9}))) == (std::vector({(float)0.0, (float)1.0})));\n assert(candidate((std::vector({(float)100.0, (float)49.9}))) == (std::vector({(float)1.0, (float)0.0})));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0, (float)5.0}))) == (std::vector({(float)0.0, (float)0.25, (float)0.5, (float)0.75, (float)1.0})));\n assert(candidate((std::vector({(float)2.0, (float)1.0, (float)5.0, (float)3.0, (float)4.0}))) == (std::vector({(float)0.25, (float)0.0, (float)1.0, (float)0.5, (float)0.75})));\n assert(candidate((std::vector({(float)12.0, (float)11.0, (float)15.0, (float)13.0, (float)14.0}))) == (std::vector({(float)0.25, (float)0.0, (float)1.0, (float)0.5, (float)0.75})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "cpp", - "prompt": "#include\n#include\n// Given a positive integer n, return the product of the odd digits.\n// Return 0 if all digits are even.\n// For example:\n// >>> digits((1))\n// (1)\n// >>> digits((4))\n// (0)\n// >>> digits((235))\n// (15)\nlong digits(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = digits;\n assert(candidate((5)) == (5));\n assert(candidate((54)) == (5));\n assert(candidate((120)) == (1));\n assert(candidate((5014)) == (5));\n assert(candidate((98765)) == (315));\n assert(candidate((5576543)) == (2625));\n assert(candidate((2468)) == (0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "cpp", - "prompt": "#include\n#include\n// You will be given the name of a class (a string) and a vector of extensions.\n// The extensions are to be used to load additional classes to the class. The\n// strength of the extension is as follows: Let CAP be the number of the uppercase\n// letters in the extension's name, and let SM be the number of lowercase letters \n// in the extension's name, the strength is given by the fraction CAP - SM. \n// You should find the strongest extension and return a string in this \n// format: ClassName.StrongestExtensionName.\n// If there are two or more extensions with the same strength, you should\n// choose the one that comes first in the vector.\n// For example, if you are given \"Slices\" as the class and a vector of the\n// extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n// return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n// (its strength is -1).\n// Example:\n// >>> Strongest_Extension((\"my_class\"), (std::vector({(std::string)\"AA\", (std::string)\"Be\", (std::string)\"CC\"})))\n// (\"my_class.AA\")\nstd::string Strongest_Extension(std::string class_name, std::vector extensions) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = Strongest_Extension;\n assert(candidate((\"Watashi\"), (std::vector({(std::string)\"tEN\", (std::string)\"niNE\", (std::string)\"eIGHt8OKe\"}))) == (\"Watashi.eIGHt8OKe\"));\n assert(candidate((\"Boku123\"), (std::vector({(std::string)\"nani\", (std::string)\"NazeDa\", (std::string)\"YEs.WeCaNe\", (std::string)\"32145tggg\"}))) == (\"Boku123.YEs.WeCaNe\"));\n assert(candidate((\"__YESIMHERE\"), (std::vector({(std::string)\"t\", (std::string)\"eMptY\", (std::string)\"nothing\", (std::string)\"zeR00\", (std::string)\"NuLl__\", (std::string)\"123NoooneB321\"}))) == (\"__YESIMHERE.NuLl__\"));\n assert(candidate((\"K\"), (std::vector({(std::string)\"Ta\", (std::string)\"TAR\", (std::string)\"t234An\", (std::string)\"cosSo\"}))) == (\"K.TAR\"));\n assert(candidate((\"__HAHA\"), (std::vector({(std::string)\"Tab\", (std::string)\"123\", (std::string)\"781345\", (std::string)\"-_-\"}))) == (\"__HAHA.123\"));\n assert(candidate((\"YameRore\"), (std::vector({(std::string)\"HhAas\", (std::string)\"okIWILL123\", (std::string)\"WorkOut\", (std::string)\"Fails\", (std::string)\"-_-\"}))) == (\"YameRore.okIWILL123\"));\n assert(candidate((\"finNNalLLly\"), (std::vector({(std::string)\"Die\", (std::string)\"NowW\", (std::string)\"Wow\", (std::string)\"WoW\"}))) == (\"finNNalLLly.WoW\"));\n assert(candidate((\"_\"), (std::vector({(std::string)\"Bb\", (std::string)\"91245\"}))) == (\"_.Bb\"));\n assert(candidate((\"Sp\"), (std::vector({(std::string)\"671235\", (std::string)\"Bb\"}))) == (\"Sp.671235\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "cpp", - "prompt": "#include\n#include\n// Given a string representing a space separated lowercase letters, return a map\n// of the letter with the most repetition and containing the corresponding count.\n// If several letters have the same occurrence, return all of them.\n// Example:\n// >>> histogram((\"a b c\"))\n// (std::map({{\"a\", 1}, {\"b\", 1}, {\"c\", 1}}))\n// >>> histogram((\"a b b a\"))\n// (std::map({{\"a\", 2}, {\"b\", 2}}))\n// >>> histogram((\"a b c a b\"))\n// (std::map({{\"a\", 2}, {\"b\", 2}}))\n// >>> histogram((\"b b b b a\"))\n// (std::map({{\"b\", 4}}))\n// >>> histogram((\"\"))\n// (std::map())\nstd::map histogram(std::string test) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = histogram;\n assert(candidate((\"a b b a\")) == (std::map({{\"a\", 2}, {\"b\", 2}})));\n assert(candidate((\"a b c a b\")) == (std::map({{\"a\", 2}, {\"b\", 2}})));\n assert(candidate((\"a b c d g\")) == (std::map({{\"a\", 1}, {\"b\", 1}, {\"c\", 1}, {\"d\", 1}, {\"g\", 1}})));\n assert(candidate((\"r t g\")) == (std::map({{\"r\", 1}, {\"t\", 1}, {\"g\", 1}})));\n assert(candidate((\"b b b b a\")) == (std::map({{\"b\", 4}})));\n assert(candidate((\"r t g\")) == (std::map({{\"r\", 1}, {\"t\", 1}, {\"g\", 1}})));\n assert(candidate((\"\")) == (std::map()));\n assert(candidate((\"a\")) == (std::map({{\"a\", 1}})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "cpp", - "prompt": "#include\n#include\n// pairs_sum_to_zero takes a vector of integers as an input.\n// it returns true if there are two distinct elements in the vector that\n// sum to zero, and false otherwise.\n// >>> pairs_sum_to_zero((std::vector({(long)1, (long)3, (long)5, (long)0})))\n// (false)\n// >>> pairs_sum_to_zero((std::vector({(long)1, (long)3, (long)-2, (long)1})))\n// (false)\n// >>> pairs_sum_to_zero((std::vector({(long)1, (long)2, (long)3, (long)7})))\n// (false)\n// >>> pairs_sum_to_zero((std::vector({(long)2, (long)4, (long)-5, (long)3, (long)5, (long)7})))\n// (true)\n// >>> pairs_sum_to_zero((std::vector({(long)1})))\n// (false)\nbool pairs_sum_to_zero(std::vector l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = pairs_sum_to_zero;\n assert(candidate((std::vector({(long)1, (long)3, (long)5, (long)0}))) == (false));\n assert(candidate((std::vector({(long)1, (long)3, (long)-2, (long)1}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)7}))) == (false));\n assert(candidate((std::vector({(long)2, (long)4, (long)-5, (long)3, (long)5, (long)7}))) == (true));\n assert(candidate((std::vector({(long)1}))) == (false));\n assert(candidate((std::vector({(long)-3, (long)9, (long)-1, (long)3, (long)2, (long)30}))) == (true));\n assert(candidate((std::vector({(long)-3, (long)9, (long)-1, (long)3, (long)2, (long)31}))) == (true));\n assert(candidate((std::vector({(long)-3, (long)9, (long)-1, (long)4, (long)2, (long)30}))) == (false));\n assert(candidate((std::vector({(long)-3, (long)9, (long)-1, (long)4, (long)2, (long)31}))) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that accepts two vectors of strings and returns the vector that has \n// total number of chars in the all strings of the vector less than the other vector.\n// if the two vectors have the same number of chars, return the first vector.\n// Examples\n// >>> total_match((std::vector()), (std::vector()))\n// (std::vector())\n// >>> total_match((std::vector({(std::string)\"hi\", (std::string)\"admin\"})), (std::vector({(std::string)\"hI\", (std::string)\"Hi\"})))\n// (std::vector({(std::string)\"hI\", (std::string)\"Hi\"}))\n// >>> total_match((std::vector({(std::string)\"hi\", (std::string)\"admin\"})), (std::vector({(std::string)\"hi\", (std::string)\"hi\", (std::string)\"admin\", (std::string)\"project\"})))\n// (std::vector({(std::string)\"hi\", (std::string)\"admin\"}))\n// >>> total_match((std::vector({(std::string)\"hi\", (std::string)\"admin\"})), (std::vector({(std::string)\"hI\", (std::string)\"hi\", (std::string)\"hi\"})))\n// (std::vector({(std::string)\"hI\", (std::string)\"hi\", (std::string)\"hi\"}))\n// >>> total_match((std::vector({(std::string)\"4\"})), (std::vector({(std::string)\"1\", (std::string)\"2\", (std::string)\"3\", (std::string)\"4\", (std::string)\"5\"})))\n// (std::vector({(std::string)\"4\"}))\nstd::vector total_match(std::vector lst1, std::vector lst2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = total_match;\n assert(candidate((std::vector()), (std::vector())) == (std::vector()));\n assert(candidate((std::vector({(std::string)\"hi\", (std::string)\"admin\"})), (std::vector({(std::string)\"hi\", (std::string)\"hi\"}))) == (std::vector({(std::string)\"hi\", (std::string)\"hi\"})));\n assert(candidate((std::vector({(std::string)\"hi\", (std::string)\"admin\"})), (std::vector({(std::string)\"hi\", (std::string)\"hi\", (std::string)\"admin\", (std::string)\"project\"}))) == (std::vector({(std::string)\"hi\", (std::string)\"admin\"})));\n assert(candidate((std::vector({(std::string)\"4\"})), (std::vector({(std::string)\"1\", (std::string)\"2\", (std::string)\"3\", (std::string)\"4\", (std::string)\"5\"}))) == (std::vector({(std::string)\"4\"})));\n assert(candidate((std::vector({(std::string)\"hi\", (std::string)\"admin\"})), (std::vector({(std::string)\"hI\", (std::string)\"Hi\"}))) == (std::vector({(std::string)\"hI\", (std::string)\"Hi\"})));\n assert(candidate((std::vector({(std::string)\"hi\", (std::string)\"admin\"})), (std::vector({(std::string)\"hI\", (std::string)\"hi\", (std::string)\"hi\"}))) == (std::vector({(std::string)\"hI\", (std::string)\"hi\", (std::string)\"hi\"})));\n assert(candidate((std::vector({(std::string)\"hi\", (std::string)\"admin\"})), (std::vector({(std::string)\"hI\", (std::string)\"hi\", (std::string)\"hii\"}))) == (std::vector({(std::string)\"hi\", (std::string)\"admin\"})));\n assert(candidate((std::vector()), (std::vector({(std::string)\"this\"}))) == (std::vector()));\n assert(candidate((std::vector({(std::string)\"this\"})), (std::vector())) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "cpp", - "prompt": "#include\n#include\n// Circular shift the digits of the integer x, shift the digits right by shift\n// and return the result as a string.\n// If shift > number of digits, return digits reversed.\n// >>> circular_shift((12), (1))\n// (\"21\")\n// >>> circular_shift((12), (2))\n// (\"12\")\nstd::string circular_shift(long x, long shift) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = circular_shift;\n assert(candidate((100), (2)) == (\"001\"));\n assert(candidate((12), (2)) == (\"12\"));\n assert(candidate((97), (8)) == (\"79\"));\n assert(candidate((12), (1)) == (\"21\"));\n assert(candidate((11), (101)) == (\"11\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "cpp", - "prompt": "#include\n#include\n// Return true is vector elements are monotonically increasing or decreasing.\n// >>> monotonic((std::vector({(long)1, (long)2, (long)4, (long)20})))\n// (true)\n// >>> monotonic((std::vector({(long)1, (long)20, (long)4, (long)10})))\n// (false)\n// >>> monotonic((std::vector({(long)4, (long)1, (long)0, (long)-10})))\n// (true)\nbool monotonic(std::vector l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = monotonic;\n assert(candidate((std::vector({(long)1, (long)2, (long)4, (long)10}))) == (true));\n assert(candidate((std::vector({(long)1, (long)2, (long)4, (long)20}))) == (true));\n assert(candidate((std::vector({(long)1, (long)20, (long)4, (long)10}))) == (false));\n assert(candidate((std::vector({(long)4, (long)1, (long)0, (long)-10}))) == (true));\n assert(candidate((std::vector({(long)4, (long)1, (long)1, (long)0}))) == (true));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)2, (long)5, (long)60}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)60}))) == (true));\n assert(candidate((std::vector({(long)9, (long)9, (long)9, (long)9}))) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "cpp", - "prompt": "#include\n#include\n// Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n// Example\n// >>> is_equal_to_sum_even((4))\n// (false)\n// >>> is_equal_to_sum_even((6))\n// (false)\n// >>> is_equal_to_sum_even((8))\n// (true)\nbool is_equal_to_sum_even(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = is_equal_to_sum_even;\n assert(candidate((4)) == (false));\n assert(candidate((6)) == (false));\n assert(candidate((8)) == (true));\n assert(candidate((10)) == (true));\n assert(candidate((11)) == (false));\n assert(candidate((12)) == (true));\n assert(candidate((13)) == (false));\n assert(candidate((16)) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "cpp", - "prompt": "#include\n#include\n// Input to this function is a string representing musical notes in a special ASCII format.\n// Your task is to parse this string and return vector of integers corresponding to how many beats does each\n// not last.\n// Here is a legend:\n// 'o' - whole note, lasts four beats\n// 'o|' - half note, lasts two beats\n// '.|' - quater note, lasts one beat\n// >>> parse_music((\"o o| .| o| o| .| .| .| .| o o\"))\n// (std::vector({(long)4, (long)2, (long)1, (long)2, (long)2, (long)1, (long)1, (long)1, (long)1, (long)4, (long)4}))\nstd::vector parse_music(std::string music_string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = parse_music;\n assert(candidate((\"\")) == (std::vector()));\n assert(candidate((\"o o o o\")) == (std::vector({(long)4, (long)4, (long)4, (long)4})));\n assert(candidate((\".| .| .| .|\")) == (std::vector({(long)1, (long)1, (long)1, (long)1})));\n assert(candidate((\"o| o| .| .| o o o o\")) == (std::vector({(long)2, (long)2, (long)1, (long)1, (long)4, (long)4, (long)4, (long)4})));\n assert(candidate((\"o| .| o| .| o o| o o|\")) == (std::vector({(long)2, (long)1, (long)2, (long)1, (long)4, (long)2, (long)4, (long)2})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "cpp", - "prompt": "#include\n#include\n// \"\n// This function will take a vector of integers. For all entries in the vector, the function shall square the integer entry if its index is a \n// multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n// change the entries in the vector whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n// Examples:\n// >>> lst\n// (long({(long)1, (long)2, (long)3}))\n// >>> lst\n// (long())\n// >>> lst\n// (long({(long)-1, (long)-5, (long)2, (long)-1, (long)-5}))\nlong sum_squares(std::vector lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = sum_squares;\n assert(candidate((std::vector({(long)1, (long)2, (long)3}))) == (6));\n assert(candidate((std::vector({(long)1, (long)4, (long)9}))) == (14));\n assert(candidate((std::vector())) == (0));\n assert(candidate((std::vector({(long)1, (long)1, (long)1, (long)1, (long)1, (long)1, (long)1, (long)1, (long)1}))) == (9));\n assert(candidate((std::vector({(long)-1, (long)-1, (long)-1, (long)-1, (long)-1, (long)-1, (long)-1, (long)-1, (long)-1}))) == (-3));\n assert(candidate((std::vector({(long)0}))) == (0));\n assert(candidate((std::vector({(long)-1, (long)-5, (long)2, (long)-1, (long)-5}))) == (-126));\n assert(candidate((std::vector({(long)-56, (long)-99, (long)1, (long)0, (long)-2}))) == (3030));\n assert(candidate((std::vector({(long)-1, (long)0, (long)0, (long)0, (long)0, (long)0, (long)0, (long)0, (long)-1}))) == (0));\n assert(candidate((std::vector({(long)-16, (long)-9, (long)-2, (long)36, (long)36, (long)26, (long)-20, (long)25, (long)-40, (long)20, (long)-4, (long)12, (long)-26, (long)35, (long)37}))) == (-14196));\n assert(candidate((std::vector({(long)-1, (long)-3, (long)17, (long)-1, (long)-15, (long)13, (long)-1, (long)14, (long)-14, (long)-12, (long)-5, (long)14, (long)-14, (long)6, (long)13, (long)11, (long)16, (long)16, (long)4, (long)10}))) == (-1448));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "cpp", - "prompt": "#include\n#include\n// triples_sum_to_zero takes a vector of integers as an input.\n// it returns true if there are three distinct elements in the vector that\n// sum to zero, and false otherwise.\n// >>> triples_sum_to_zero((std::vector({(long)1, (long)3, (long)5, (long)0})))\n// (false)\n// >>> triples_sum_to_zero((std::vector({(long)1, (long)3, (long)-2, (long)1})))\n// (true)\n// >>> triples_sum_to_zero((std::vector({(long)1, (long)2, (long)3, (long)7})))\n// (false)\n// >>> triples_sum_to_zero((std::vector({(long)2, (long)4, (long)-5, (long)3, (long)9, (long)7})))\n// (true)\n// >>> triples_sum_to_zero((std::vector({(long)1})))\n// (false)\nbool triples_sum_to_zero(std::vector l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = triples_sum_to_zero;\n assert(candidate((std::vector({(long)1, (long)3, (long)5, (long)0}))) == (false));\n assert(candidate((std::vector({(long)1, (long)3, (long)5, (long)-1}))) == (false));\n assert(candidate((std::vector({(long)1, (long)3, (long)-2, (long)1}))) == (true));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)7}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)5, (long)7}))) == (false));\n assert(candidate((std::vector({(long)2, (long)4, (long)-5, (long)3, (long)9, (long)7}))) == (true));\n assert(candidate((std::vector({(long)1}))) == (false));\n assert(candidate((std::vector({(long)1, (long)3, (long)5, (long)-100}))) == (false));\n assert(candidate((std::vector({(long)100, (long)3, (long)5, (long)-100}))) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "cpp", - "prompt": "#include\n#include\n// brackets is a string of \"<\" and \">\".\n// return true if every opening bracket has a corresponding closing bracket.\n// >>> correct_bracketing((\"<\"))\n// (false)\n// >>> correct_bracketing((\"<>\"))\n// (true)\n// >>> correct_bracketing((\"<<><>>\"))\n// (true)\n// >>> correct_bracketing((\"><<>\"))\n// (false)\nbool correct_bracketing(std::string brackets) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = correct_bracketing;\n assert(candidate((\"<>\")) == (true));\n assert(candidate((\"<<><>>\")) == (true));\n assert(candidate((\"<><><<><>><>\")) == (true));\n assert(candidate((\"<><><<<><><>><>><<><><<>>>\")) == (true));\n assert(candidate((\"<<<><>>>>\")) == (false));\n assert(candidate((\"><<>\")) == (false));\n assert(candidate((\"<\")) == (false));\n assert(candidate((\"<<<<\")) == (false));\n assert(candidate((\">\")) == (false));\n assert(candidate((\"<<>\")) == (false));\n assert(candidate((\"<><><<><>><>><<>\")) == (false));\n assert(candidate((\"<><><<><>><>>><>\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that takes a vector of numbers as input and returns \n// the number of elements in the vector that are greater than 10 and both \n// first and last digits of a number are odd (1, 3, 5, 7, 9).\n// For example:\n// >>> specialFilter((std::vector({(long)15, (long)-73, (long)14, (long)-15})))\n// (1)\n// >>> specialFilter((std::vector({(long)33, (long)-2, (long)-3, (long)45, (long)21, (long)109})))\n// (2)\nlong specialFilter(std::vector nums) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = specialFilter;\n assert(candidate((std::vector({(long)5, (long)-2, (long)1, (long)-5}))) == (0));\n assert(candidate((std::vector({(long)15, (long)-73, (long)14, (long)-15}))) == (1));\n assert(candidate((std::vector({(long)33, (long)-2, (long)-3, (long)45, (long)21, (long)109}))) == (2));\n assert(candidate((std::vector({(long)43, (long)-12, (long)93, (long)125, (long)121, (long)109}))) == (4));\n assert(candidate((std::vector({(long)71, (long)-2, (long)-33, (long)75, (long)21, (long)19}))) == (3));\n assert(candidate((std::vector({(long)1}))) == (0));\n assert(candidate((std::vector())) == (0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "cpp", - "prompt": "#include\n#include\n// Given a map, return true if all keys are strings in lower \n// case or all keys are strings in upper case, else return false.\n// The function should return false is the given map is empty.\n// Examples:\n// >>> check_dict_case((std::map({{\"a\", \"apple\"}, {\"b\", \"banana\"}})))\n// (true)\n// >>> check_dict_case((std::map({{\"a\", \"apple\"}, {\"A\", \"banana\"}, {\"B\", \"banana\"}})))\n// (false)\n// >>> check_dict_case((std::map({{\"a\", \"apple\"}, {8, \"banana\"}, {\"a\", \"apple\"}})))\n// (false)\n// >>> check_dict_case((std::map({{\"Name\", \"John\"}, {\"Age\", \"36\"}, {\"City\", \"Houston\"}})))\n// (false)\n// >>> check_dict_case((std::map({{\"STATE\", \"NC\"}, {\"ZIP\", \"12345\"}})))\n// (true)\nbool check_dict_case(std::map dict) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = check_dict_case;\n assert(candidate((std::map({{\"p\", \"pineapple\"}, {\"b\", \"banana\"}}))) == (true));\n assert(candidate((std::map({{\"p\", \"pineapple\"}, {\"A\", \"banana\"}, {\"B\", \"banana\"}}))) == (false));\n assert(candidate((std::map({{\"p\", \"pineapple\"}, {\"5\", \"banana\"}, {\"a\", \"apple\"}}))) == (false));\n assert(candidate((std::map({{\"Name\", \"John\"}, {\"Age\", \"36\"}, {\"City\", \"Houston\"}}))) == (false));\n assert(candidate((std::map({{\"STATE\", \"NC\"}, {\"ZIP\", \"12345\"}}))) == (true));\n assert(candidate((std::map({{\"fruit\", \"Orange\"}, {\"taste\", \"Sweet\"}}))) == (true));\n assert(candidate((std::map())) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "cpp", - "prompt": "#include\n#include\nunion Union_std_vector_std_string__long{\n std::vector f0;\n long f1; Union_std_vector_std_string__long(std::vector _f0) : f0(_f0) {}\n Union_std_vector_std_string__long(long _f1) : f1(_f1) {}\n ~Union_std_vector_std_string__long() {}\n bool operator==(std::vector f) {\n return f0 == f ;\n } bool operator==(long f) {\n return f1 == f ;\n }\n};\n// Given a string of words, return a vector of words split on whitespace, if no whitespaces exists in the text you\n// should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n// alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n// Examples\n// >>> split_words((\"Hello world!\"))\n// std::vector({(std::string)\"Hello\", (std::string)\"world!\"})\n// >>> split_words((\"Hello,world!\"))\n// std::vector({(std::string)\"Hello\", (std::string)\"world!\"})\n// >>> split_words((\"abcdef\"))\n// 3\nUnion_std_vector_std_string__long split_words(std::string txt) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = split_words;\n assert(candidate((\"Hello world!\")) == std::vector({(std::string)\"Hello\", (std::string)\"world!\"}));\n assert(candidate((\"Hello,world!\")) == std::vector({(std::string)\"Hello\", (std::string)\"world!\"}));\n assert(candidate((\"Hello world,!\")) == std::vector({(std::string)\"Hello\", (std::string)\"world,!\"}));\n assert(candidate((\"Hello,Hello,world !\")) == std::vector({(std::string)\"Hello,Hello,world\", (std::string)\"!\"}));\n assert(candidate((\"abcdef\")) == 3);\n assert(candidate((\"aaabb\")) == 2);\n assert(candidate((\"aaaBb\")) == 1);\n assert(candidate((\"\")) == 0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "cpp", - "prompt": "#include\n#include\n// The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fibfib(0) == 0\n// fibfib(1) == 0\n// fibfib(2) == 1\n// fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n// Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n// >>> fibfib((1))\n// (0)\n// >>> fibfib((5))\n// (4)\n// >>> fibfib((8))\n// (24)\nlong fibfib(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = fibfib;\n assert(candidate((2)) == (1));\n assert(candidate((1)) == (0));\n assert(candidate((5)) == (4));\n assert(candidate((8)) == (24));\n assert(candidate((10)) == (81));\n assert(candidate((12)) == (274));\n assert(candidate((14)) == (927));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a vector of numbers.\n// You need to return the sum of squared numbers in the given vector,\n// round each element in the vector to the upper int(Ceiling) first.\n// Examples:\n// >>> lst((std::vector({(float)1.0, (float)2.0, (float)3.0})))\n// (14)\n// >>> lst((std::vector({(float)1.0, (float)4.0, (float)9.0})))\n// (98)\n// >>> lst((std::vector({(float)1.0, (float)3.0, (float)5.0, (float)7.0})))\n// (84)\n// >>> lst((std::vector({(float)1.4, (float)4.2, (float)0.0})))\n// (29)\n// >>> lst((std::vector({(float)-2.4, (float)1.0, (float)1.0})))\n// (6)\nlong sum_squares(std::vector lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = sum_squares;\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0}))) == (14));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0}))) == (14));\n assert(candidate((std::vector({(float)1.0, (float)3.0, (float)5.0, (float)7.0}))) == (84));\n assert(candidate((std::vector({(float)1.4, (float)4.2, (float)0.0}))) == (29));\n assert(candidate((std::vector({(float)-2.4, (float)1.0, (float)1.0}))) == (6));\n assert(candidate((std::vector({(float)100.0, (float)1.0, (float)15.0, (float)2.0}))) == (10230));\n assert(candidate((std::vector({(float)10000.0, (float)10000.0}))) == (200000000));\n assert(candidate((std::vector({(float)-1.4, (float)4.6, (float)6.3}))) == (75));\n assert(candidate((std::vector({(float)-1.4, (float)17.9, (float)18.9, (float)19.9}))) == (1086));\n assert(candidate((std::vector({(float)0.0}))) == (0));\n assert(candidate((std::vector({(float)-1.0}))) == (1));\n assert(candidate((std::vector({(float)-1.0, (float)1.0, (float)0.0}))) == (2));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_85_add", - "language": "cpp", - "prompt": "#include\n#include\n// Given a non-empty vector of integers lst. add the even elements that are at odd indices..\n// Examples:\n// >>> add((std::vector({(long)4, (long)2, (long)6, (long)7})))\n// (2)\nlong add(std::vector lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = add;\n assert(candidate((std::vector({(long)4, (long)88}))) == (88));\n assert(candidate((std::vector({(long)4, (long)5, (long)6, (long)7, (long)2, (long)122}))) == (122));\n assert(candidate((std::vector({(long)4, (long)0, (long)6, (long)7}))) == (0));\n assert(candidate((std::vector({(long)4, (long)4, (long)6, (long)8}))) == (12));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "cpp", - "prompt": "#include\n#include\n// Return sorted unique elements in a vector\n// >>> unique((std::vector({(long)5, (long)3, (long)5, (long)2, (long)3, (long)3, (long)9, (long)0, (long)123})))\n// (std::vector({(long)0, (long)2, (long)3, (long)5, (long)9, (long)123}))\nstd::vector unique(std::vector l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = unique;\n assert(candidate((std::vector({(long)5, (long)3, (long)5, (long)2, (long)3, (long)3, (long)9, (long)0, (long)123}))) == (std::vector({(long)0, (long)2, (long)3, (long)5, (long)9, (long)123})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "cpp", - "prompt": "#include\n#include\n// Given a string text, replace all spaces in it with underscores, \n// and if a string has more than 2 consecutive spaces, \n// then replace all consecutive spaces with - \n// >>> fix_spaces((\" Example\"))\n// (\"Example\")\n// >>> fix_spaces((\" Example 1\"))\n// (\"Example_1\")\n// >>> fix_spaces((\" Example 2\"))\n// (\"_Example_2\")\n// >>> fix_spaces((\" Example 3\"))\n// (\"_Example-3\")\nstd::string fix_spaces(std::string text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = fix_spaces;\n assert(candidate((\"Example\")) == (\"Example\"));\n assert(candidate((\"Mudasir Hanif \")) == (\"Mudasir_Hanif_\"));\n assert(candidate((\"Yellow Yellow Dirty Fellow\")) == (\"Yellow_Yellow__Dirty__Fellow\"));\n assert(candidate((\"Exa mple\")) == (\"Exa-mple\"));\n assert(candidate((\" Exa 1 2 2 mple\")) == (\"-Exa_1_2_2_mple\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "cpp", - "prompt": "#include\n#include\n// Return 2^n modulo p (be aware of numerics).\n// >>> modp((3), (5))\n// (3)\n// >>> modp((1101), (101))\n// (2)\n// >>> modp((0), (101))\n// (1)\n// >>> modp((3), (11))\n// (8)\n// >>> modp((100), (101))\n// (1)\nlong modp(long n, long p) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = modp;\n assert(candidate((3), (5)) == (3));\n assert(candidate((1101), (101)) == (2));\n assert(candidate((0), (101)) == (1));\n assert(candidate((3), (11)) == (8));\n assert(candidate((100), (101)) == (1));\n assert(candidate((30), (5)) == (4));\n assert(candidate((31), (5)) == (3));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "cpp", - "prompt": "#include\n#include\n// You have to write a function which validates a given date string and\n// returns true if the date is valid otherwise false.\n// The date is valid if all of the following rules are satisfied:\n// 1. The date string is not empty.\n// 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n// 3. The months should not be less than 1 or higher than 12.\n// 4. The date should be in the format: mm-dd-yyyy\n// >>> valid_date((\"03-11-2000\"))\n// (true)\n// >>> valid_date((\"15-01-2012\"))\n// (false)\n// >>> valid_date((\"04-0-2040\"))\n// (false)\n// >>> valid_date((\"06-04-2020\"))\n// (true)\n// >>> valid_date((\"06/04/2020\"))\n// (false)\nbool valid_date(std::string date) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = valid_date;\n assert(candidate((\"03-11-2000\")) == (true));\n assert(candidate((\"15-01-2012\")) == (false));\n assert(candidate((\"04-0-2040\")) == (false));\n assert(candidate((\"06-04-2020\")) == (true));\n assert(candidate((\"01-01-2007\")) == (true));\n assert(candidate((\"03-32-2011\")) == (false));\n assert(candidate((\"\")) == (false));\n assert(candidate((\"04-31-3000\")) == (false));\n assert(candidate((\"06-06-2005\")) == (true));\n assert(candidate((\"21-31-2000\")) == (false));\n assert(candidate((\"04-12-2003\")) == (true));\n assert(candidate((\"04122003\")) == (false));\n assert(candidate((\"20030412\")) == (false));\n assert(candidate((\"2003-04\")) == (false));\n assert(candidate((\"2003-04-12\")) == (false));\n assert(candidate((\"04-2003\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that takes a string and returns an ordered version of it.\n// Ordered version of string, is a string where all words (separated by space)\n// are replaced by a new word where all the characters arranged in\n// ascending order based on ascii value.\n// Note: You should keep the order of words and blank spaces in the sentence.\n// For example:\n// >>> anti_shuffle((\"Hi\"))\n// (\"Hi\")\n// >>> anti_shuffle((\"hello\"))\n// (\"ehllo\")\n// >>> anti_shuffle((\"Hello World!!!\"))\n// (\"Hello !!!Wdlor\")\nstd::string anti_shuffle(std::string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = anti_shuffle;\n assert(candidate((\"Hi\")) == (\"Hi\"));\n assert(candidate((\"hello\")) == (\"ehllo\"));\n assert(candidate((\"number\")) == (\"bemnru\"));\n assert(candidate((\"abcd\")) == (\"abcd\"));\n assert(candidate((\"Hello World!!!\")) == (\"Hello !!!Wdlor\"));\n assert(candidate((\"\")) == (\"\"));\n assert(candidate((\"Hi. My name is Mister Robot. How are you?\")) == (\".Hi My aemn is Meirst .Rboot How aer ?ouy\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "cpp", - "prompt": "#include\n#include\n// Given a vector of numbers, return whether or not they are sorted\n// in ascending order. If vector has more than 1 duplicate of the same\n// number, return false. Assume no negative numbers and only integers.\n// Examples\n// >>> is_sorted((std::vector({(long)5})))\n// (true)\n// >>> is_sorted((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5})))\n// (true)\n// >>> is_sorted((std::vector({(long)1, (long)3, (long)2, (long)4, (long)5})))\n// (false)\n// >>> is_sorted((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6})))\n// (true)\n// >>> is_sorted((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6, (long)7})))\n// (true)\n// >>> is_sorted((std::vector({(long)1, (long)3, (long)2, (long)4, (long)5, (long)6, (long)7})))\n// (false)\n// >>> is_sorted((std::vector({(long)1, (long)2, (long)2, (long)3, (long)3, (long)4})))\n// (true)\n// >>> is_sorted((std::vector({(long)1, (long)2, (long)2, (long)2, (long)3, (long)4})))\n// (false)\nbool is_sorted(std::vector lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = is_sorted;\n assert(candidate((std::vector({(long)5}))) == (true));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5}))) == (true));\n assert(candidate((std::vector({(long)1, (long)3, (long)2, (long)4, (long)5}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}))) == (true));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6, (long)7}))) == (true));\n assert(candidate((std::vector({(long)1, (long)3, (long)2, (long)4, (long)5, (long)6, (long)7}))) == (false));\n assert(candidate((std::vector())) == (true));\n assert(candidate((std::vector({(long)1}))) == (true));\n assert(candidate((std::vector({(long)3, (long)2, (long)1}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)2, (long)2, (long)3, (long)4}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)3, (long)3, (long)4}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)2, (long)3, (long)3, (long)4}))) == (true));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4}))) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a string s.\n// Your task is to check if the string is hapcpp or not.\n// A string is hapcpp if its length is at least 3 and every 3 consecutive letters are distinct\n// For example:\n// >>> is_happy((\"a\"))\n// (false)\n// >>> is_happy((\"aa\"))\n// (false)\n// >>> is_happy((\"abcd\"))\n// (true)\n// >>> is_happy((\"aabb\"))\n// (false)\n// >>> is_happy((\"adb\"))\n// (true)\n// >>> is_happy((\"xyy\"))\n// (false)\nbool is_happy(std::string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = is_happy;\n assert(candidate((\"a\")) == (false));\n assert(candidate((\"aa\")) == (false));\n assert(candidate((\"abcd\")) == (true));\n assert(candidate((\"aabb\")) == (false));\n assert(candidate((\"adb\")) == (true));\n assert(candidate((\"xyy\")) == (false));\n assert(candidate((\"iopaxpoi\")) == (true));\n assert(candidate((\"iopaxioi\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that returns true if the object q will fly, and false otherwise.\n// The object q will fly if it's balanced (it is a palindromic vector) and the sum of its elements is less than or equal the maximum possible weight w.\n// Example:\n// >>> will_it_fly((std::vector({(long)1, (long)2})), (5))\n// (false)\n// # 1+2 is less than the maximum possible weight, but it's unbalanced.\n// >>> will_it_fly((std::vector({(long)3, (long)2, (long)3})), (1))\n// (false)\n// # it's balanced, but 3+2+3 is more than the maximum possible weight.\n// >>> will_it_fly((std::vector({(long)3, (long)2, (long)3})), (9))\n// (true)\n// # 3+2+3 is less than the maximum possible weight, and it's balanced.\n// >>> will_it_fly((std::vector({(long)3})), (5))\n// (true)\n// # 3 is less than the maximum possible weight, and it's balanced.\nbool will_it_fly(std::vector q, long w) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = will_it_fly;\n assert(candidate((std::vector({(long)3, (long)2, (long)3})), (9)) == (true));\n assert(candidate((std::vector({(long)1, (long)2})), (5)) == (false));\n assert(candidate((std::vector({(long)3})), (5)) == (true));\n assert(candidate((std::vector({(long)3, (long)2, (long)3})), (1)) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)3})), (6)) == (false));\n assert(candidate((std::vector({(long)5})), (5)) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "cpp", - "prompt": "#include\n#include\n// Given a vector of non-negative integers, return a cocpp of the given vector after sorting,\n// you will sort the given vector in ascending order if the sum( first index value, last index value) is odd,\n// or sort it in descending order if the sum( first index value, last index value) is even.\n// Note:\n// * don't change the given vector.\n// Examples:\n// >>> sort_array((std::vector()))\n// (std::vector())\n// >>> sort_array((std::vector({(long)5})))\n// (std::vector({(long)5}))\n// >>> sort_array((std::vector({(long)2, (long)4, (long)3, (long)0, (long)1, (long)5})))\n// (std::vector({(long)0, (long)1, (long)2, (long)3, (long)4, (long)5}))\n// >>> sort_array((std::vector({(long)2, (long)4, (long)3, (long)0, (long)1, (long)5, (long)6})))\n// (std::vector({(long)6, (long)5, (long)4, (long)3, (long)2, (long)1, (long)0}))\nstd::vector sort_array(std::vector array) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = sort_array;\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)5}))) == (std::vector({(long)5})));\n assert(candidate((std::vector({(long)2, (long)4, (long)3, (long)0, (long)1, (long)5}))) == (std::vector({(long)0, (long)1, (long)2, (long)3, (long)4, (long)5})));\n assert(candidate((std::vector({(long)2, (long)4, (long)3, (long)0, (long)1, (long)5, (long)6}))) == (std::vector({(long)6, (long)5, (long)4, (long)3, (long)2, (long)1, (long)0})));\n assert(candidate((std::vector({(long)2, (long)1}))) == (std::vector({(long)1, (long)2})));\n assert(candidate((std::vector({(long)15, (long)42, (long)87, (long)32, (long)11, (long)0}))) == (std::vector({(long)0, (long)11, (long)15, (long)32, (long)42, (long)87})));\n assert(candidate((std::vector({(long)21, (long)14, (long)23, (long)11}))) == (std::vector({(long)23, (long)21, (long)14, (long)11})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "cpp", - "prompt": "#include\n#include\n// Implement a function that takes an non-negative integer and returns a vector of the first n\n// integers that are prime numbers and less than n.\n// for example:\n// >>> count_up_to((5))\n// (std::vector({(long)2, (long)3}))\n// >>> count_up_to((11))\n// (std::vector({(long)2, (long)3, (long)5, (long)7}))\n// >>> count_up_to((0))\n// (std::vector())\n// >>> count_up_to((20))\n// (std::vector({(long)2, (long)3, (long)5, (long)7, (long)11, (long)13, (long)17, (long)19}))\n// >>> count_up_to((1))\n// (std::vector())\n// >>> count_up_to((18))\n// (std::vector({(long)2, (long)3, (long)5, (long)7, (long)11, (long)13, (long)17}))\nstd::vector count_up_to(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = count_up_to;\n assert(candidate((5)) == (std::vector({(long)2, (long)3})));\n assert(candidate((6)) == (std::vector({(long)2, (long)3, (long)5})));\n assert(candidate((7)) == (std::vector({(long)2, (long)3, (long)5})));\n assert(candidate((10)) == (std::vector({(long)2, (long)3, (long)5, (long)7})));\n assert(candidate((0)) == (std::vector()));\n assert(candidate((22)) == (std::vector({(long)2, (long)3, (long)5, (long)7, (long)11, (long)13, (long)17, (long)19})));\n assert(candidate((1)) == (std::vector()));\n assert(candidate((18)) == (std::vector({(long)2, (long)3, (long)5, (long)7, (long)11, (long)13, (long)17})));\n assert(candidate((47)) == (std::vector({(long)2, (long)3, (long)5, (long)7, (long)11, (long)13, (long)17, (long)19, (long)23, (long)29, (long)31, (long)37, (long)41, (long)43})));\n assert(candidate((101)) == (std::vector({(long)2, (long)3, (long)5, (long)7, (long)11, (long)13, (long)17, (long)19, (long)23, (long)29, (long)31, (long)37, (long)41, (long)43, (long)47, (long)53, (long)59, (long)61, (long)67, (long)71, (long)73, (long)79, (long)83, (long)89, (long)97})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "cpp", - "prompt": "#include\n#include\n// Out of vector of strings, return the longest one. Return the first one in case of multiple\n// strings of the same length. Return None in case the input vector is empty.\n// >>> longest((std::vector()))\n// std::nullopt\n// >>> longest((std::vector({(std::string)\"a\", (std::string)\"b\", (std::string)\"c\"})))\n// \"a\"\n// >>> longest((std::vector({(std::string)\"a\", (std::string)\"bb\", (std::string)\"ccc\"})))\n// \"ccc\"\nstd::optional longest(std::vector strings) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = longest;\n assert(candidate((std::vector())) == std::nullopt);\n assert(candidate((std::vector({(std::string)\"x\", (std::string)\"y\", (std::string)\"z\"}))) == \"x\");\n assert(candidate((std::vector({(std::string)\"x\", (std::string)\"yyy\", (std::string)\"zzzz\", (std::string)\"www\", (std::string)\"kkkk\", (std::string)\"abc\"}))) == \"zzzz\");\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "cpp", - "prompt": "#include\n#include\n// Given a vector of integers, sort the integers that are between 1 and 9 inclusive,\n// reverse the resulting vector, and then replace each digit by its corresponding name from\n// \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n// For example:\n// >>> by_length((std::vector({(long)2, (long)1, (long)1, (long)4, (long)5, (long)8, (long)2, (long)3})))\n// (std::vector({(std::string)\"Eight\", (std::string)\"Five\", (std::string)\"Four\", (std::string)\"Three\", (std::string)\"Two\", (std::string)\"Two\", (std::string)\"One\", (std::string)\"One\"}))\n// If the vector is empty, return an empty vector:\n// >>> by_length((std::vector()))\n// (std::vector())\n// If the vector has any strange number ignore it:\n// >>> by_length((std::vector({(long)1, (long)-1, (long)55})))\n// (std::vector({(std::string)\"One\"}))\nstd::vector by_length(std::vector arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = by_length;\n assert(candidate((std::vector({(long)2, (long)1, (long)1, (long)4, (long)5, (long)8, (long)2, (long)3}))) == (std::vector({(std::string)\"Eight\", (std::string)\"Five\", (std::string)\"Four\", (std::string)\"Three\", (std::string)\"Two\", (std::string)\"Two\", (std::string)\"One\", (std::string)\"One\"})));\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)1, (long)-1, (long)55}))) == (std::vector({(std::string)\"One\"})));\n assert(candidate((std::vector({(long)1, (long)-1, (long)3, (long)2}))) == (std::vector({(std::string)\"Three\", (std::string)\"Two\", (std::string)\"One\"})));\n assert(candidate((std::vector({(long)9, (long)4, (long)8}))) == (std::vector({(std::string)\"Nine\", (std::string)\"Eight\", (std::string)\"Four\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_106_f", - "language": "cpp", - "prompt": "#include\n#include\n// Implement the function f that takes n as a parameter,\n// and returns a vector of size n, such that the value of the element at index i is the factorial of i if i is even\n// or the sum of numbers from 1 to i otherwise.\n// i starts from 1.\n// the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n// Example:\n// >>> f((5))\n// (std::vector({(long)1, (long)2, (long)6, (long)24, (long)15}))\nstd::vector f(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = f;\n assert(candidate((5)) == (std::vector({(long)1, (long)2, (long)6, (long)24, (long)15})));\n assert(candidate((7)) == (std::vector({(long)1, (long)2, (long)6, (long)24, (long)15, (long)720, (long)28})));\n assert(candidate((1)) == (std::vector({(long)1})));\n assert(candidate((3)) == (std::vector({(long)1, (long)2, (long)6})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "cpp", - "prompt": "#include\n#include\n// Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n// >>> fizz_buzz((50))\n// (0)\n// >>> fizz_buzz((78))\n// (2)\n// >>> fizz_buzz((79))\n// (3)\nlong fizz_buzz(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = fizz_buzz;\n assert(candidate((50)) == (0));\n assert(candidate((78)) == (2));\n assert(candidate((79)) == (3));\n assert(candidate((100)) == (3));\n assert(candidate((200)) == (6));\n assert(candidate((4000)) == (192));\n assert(candidate((10000)) == (639));\n assert(candidate((100000)) == (8026));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "cpp", - "prompt": "#include\n#include\n// Given a positive floating point number, it can be decomposed into\n// and integer part (largest integer smaller than given number) and decimals\n// (leftover part always smaller than 1).\n// Return the decimal part of the number.\n// >>> truncate_number((3.5))\n// (0.5)\nfloat truncate_number(float number) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = truncate_number;\n assert(candidate((3.5)) == (0.5));\n assert(candidate((1.25)) == (0.25));\n assert(candidate((123.0)) == (0.0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "cpp", - "prompt": "#include\n#include\n// For a given vector of integers, return a tuple consisting of a sum and a product of all the integers in a vector.\n// Empty sum should be equal to 0 and empty product should be equal to 1.\n// >>> sum_product((std::vector()))\n// (std::make_tuple(0, 1))\n// >>> sum_product((std::vector({(long)1, (long)2, (long)3, (long)4})))\n// (std::make_tuple(10, 24))\nstd::tuple sum_product(std::vector numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = sum_product;\n assert(candidate((std::vector())) == (std::make_tuple(0, 1)));\n assert(candidate((std::vector({(long)1, (long)1, (long)1}))) == (std::make_tuple(3, 1)));\n assert(candidate((std::vector({(long)100, (long)0}))) == (std::make_tuple(100, 0)));\n assert(candidate((std::vector({(long)3, (long)5, (long)7}))) == (std::make_tuple(15, 105)));\n assert(candidate((std::vector({(long)10}))) == (std::make_tuple(10, 10)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a 2 dimensional data, as a nested vectors,\n// which is similar to matrix, however, unlike matrices,\n// each row may contain a different number of columns.\n// Given lst, and integer x, find integers x in the vector,\n// and return vector of tuples, [(x1, y1), (x2, y2) ...] such that\n// each tuple is a coordinate - (row, columns), starting with 0.\n// Sort coordinates initially by rows in ascending order.\n// Also, sort coordinates of the row by columns in descending order.\n// Examples:\n// >>> get_row((std::vector>({(std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)1, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)1})})), (1))\n// (std::vector>({(std::tuple)std::make_tuple(0, 0), (std::tuple)std::make_tuple(1, 4), (std::tuple)std::make_tuple(1, 0), (std::tuple)std::make_tuple(2, 5), (std::tuple)std::make_tuple(2, 0)}))\n// >>> get_row((std::vector>()), (1))\n// (std::vector>())\n// >>> get_row((std::vector>({(std::vector)std::vector(), (std::vector)std::vector({(long)1}), (std::vector)std::vector({(long)1, (long)2, (long)3})})), (3))\n// (std::vector>({(std::tuple)std::make_tuple(2, 2)}))\nstd::vector> get_row(std::vector> lst, long x) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = get_row;\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)1, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)1})})), (1)) == (std::vector>({(std::tuple)std::make_tuple(0, 0), (std::tuple)std::make_tuple(1, 4), (std::tuple)std::make_tuple(1, 0), (std::tuple)std::make_tuple(2, 5), (std::tuple)std::make_tuple(2, 0)})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6})})), (2)) == (std::vector>({(std::tuple)std::make_tuple(0, 1), (std::tuple)std::make_tuple(1, 1), (std::tuple)std::make_tuple(2, 1), (std::tuple)std::make_tuple(3, 1), (std::tuple)std::make_tuple(4, 1), (std::tuple)std::make_tuple(5, 1)})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)1, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)1, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)1, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)1, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)1})})), (1)) == (std::vector>({(std::tuple)std::make_tuple(0, 0), (std::tuple)std::make_tuple(1, 0), (std::tuple)std::make_tuple(2, 1), (std::tuple)std::make_tuple(2, 0), (std::tuple)std::make_tuple(3, 2), (std::tuple)std::make_tuple(3, 0), (std::tuple)std::make_tuple(4, 3), (std::tuple)std::make_tuple(4, 0), (std::tuple)std::make_tuple(5, 4), (std::tuple)std::make_tuple(5, 0), (std::tuple)std::make_tuple(6, 5), (std::tuple)std::make_tuple(6, 0)})));\n assert(candidate((std::vector>()), (1)) == (std::vector>()));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1})})), (2)) == (std::vector>()));\n assert(candidate((std::vector>({(std::vector)std::vector(), (std::vector)std::vector({(long)1}), (std::vector)std::vector({(long)1, (long)2, (long)3})})), (3)) == (std::vector>({(std::tuple)std::make_tuple(2, 2)})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "cpp", - "prompt": "#include\n#include\n// You're a hungry rabbit, and you already have eaten a certain number of carrots,\n// but now you need to eat more carrots to complete the day's meals.\n// you should return a vector of [ total number of eaten carrots after your meals,\n// the number of carrots left after your meals ]\n// if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n// Example:\n// >>> eat((5), (6), (10))\n// (std::vector({(long)11, (long)4}))\n// >>> eat((4), (8), (9))\n// (std::vector({(long)12, (long)1}))\n// >>> eat((1), (10), (10))\n// (std::vector({(long)11, (long)0}))\n// >>> eat((2), (11), (5))\n// (std::vector({(long)7, (long)0}))\n// Variables:\n// @number : integer\n// the number of carrots that you have eaten.\n// @need : integer\n// the number of carrots that you need to eat.\n// @remaining : integer\n// the number of remaining carrots thet exist in stock\n// Constrain:\n// * 0 <= number <= 1000\n// * 0 <= need <= 1000\n// * 0 <= remaining <= 1000\n// Have fun :)\nstd::vector eat(long number, long need, long remaining) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = eat;\n assert(candidate((5), (6), (10)) == (std::vector({(long)11, (long)4})));\n assert(candidate((4), (8), (9)) == (std::vector({(long)12, (long)1})));\n assert(candidate((1), (10), (10)) == (std::vector({(long)11, (long)0})));\n assert(candidate((2), (11), (5)) == (std::vector({(long)7, (long)0})));\n assert(candidate((4), (5), (7)) == (std::vector({(long)9, (long)2})));\n assert(candidate((4), (5), (1)) == (std::vector({(long)5, (long)0})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "cpp", - "prompt": "#include\n#include\n// Given a positive integer N, return the total sum of its digits in binary.\n// Example\n// >>> solve((1000))\n// (\"1\")\n// >>> solve((150))\n// (\"110\")\n// >>> solve((147))\n// (\"1100\")\n// Variables:\n// @N integer\n// Constraints: 0 \u2264 N \u2264 10000.\n// Output:\n// a string of binary number\nstd::string solve(long N) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = solve;\n assert(candidate((1000)) == (\"1\"));\n assert(candidate((150)) == (\"110\"));\n assert(candidate((147)) == (\"1100\"));\n assert(candidate((333)) == (\"1001\"));\n assert(candidate((963)) == (\"10010\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a vector of integers.\n// You need to find the largest prime value and return the sum of its digits.\n// Examples:\n// >>> skjkasdkd((std::vector({(long)0, (long)3, (long)2, (long)1, (long)3, (long)5, (long)7, (long)4, (long)5, (long)5, (long)5, (long)2, (long)181, (long)32, (long)4, (long)32, (long)3, (long)2, (long)32, (long)324, (long)4, (long)3})))\n// (10)\n// >>> skjkasdkd((std::vector({(long)1, (long)0, (long)1, (long)8, (long)2, (long)4597, (long)2, (long)1, (long)3, (long)40, (long)1, (long)2, (long)1, (long)2, (long)4, (long)2, (long)5, (long)1})))\n// (25)\n// >>> skjkasdkd((std::vector({(long)1, (long)3, (long)1, (long)32, (long)5107, (long)34, (long)83278, (long)109, (long)163, (long)23, (long)2323, (long)32, (long)30, (long)1, (long)9, (long)3})))\n// (13)\n// >>> skjkasdkd((std::vector({(long)0, (long)724, (long)32, (long)71, (long)99, (long)32, (long)6, (long)0, (long)5, (long)91, (long)83, (long)0, (long)5, (long)6})))\n// (11)\n// >>> skjkasdkd((std::vector({(long)0, (long)81, (long)12, (long)3, (long)1, (long)21})))\n// (3)\n// >>> skjkasdkd((std::vector({(long)0, (long)8, (long)1, (long)2, (long)1, (long)7})))\n// (7)\nlong skjkasdkd(std::vector lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = skjkasdkd;\n assert(candidate((std::vector({(long)0, (long)3, (long)2, (long)1, (long)3, (long)5, (long)7, (long)4, (long)5, (long)5, (long)5, (long)2, (long)181, (long)32, (long)4, (long)32, (long)3, (long)2, (long)32, (long)324, (long)4, (long)3}))) == (10));\n assert(candidate((std::vector({(long)1, (long)0, (long)1, (long)8, (long)2, (long)4597, (long)2, (long)1, (long)3, (long)40, (long)1, (long)2, (long)1, (long)2, (long)4, (long)2, (long)5, (long)1}))) == (25));\n assert(candidate((std::vector({(long)1, (long)3, (long)1, (long)32, (long)5107, (long)34, (long)83278, (long)109, (long)163, (long)23, (long)2323, (long)32, (long)30, (long)1, (long)9, (long)3}))) == (13));\n assert(candidate((std::vector({(long)0, (long)724, (long)32, (long)71, (long)99, (long)32, (long)6, (long)0, (long)5, (long)91, (long)83, (long)0, (long)5, (long)6}))) == (11));\n assert(candidate((std::vector({(long)0, (long)81, (long)12, (long)3, (long)1, (long)21}))) == (3));\n assert(candidate((std::vector({(long)0, (long)8, (long)1, (long)2, (long)1, (long)7}))) == (7));\n assert(candidate((std::vector({(long)8191}))) == (19));\n assert(candidate((std::vector({(long)8191, (long)123456, (long)127, (long)7}))) == (19));\n assert(candidate((std::vector({(long)127, (long)97, (long)8192}))) == (10));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "cpp", - "prompt": "#include\n#include\n// Given a vector arr of integers, find the minimum number of elements that\n// need to be changed to make the vector palindromic. A palindromic vector is a vector that\n// is read the same backwards and forwards. In one change, you can change one element to any other element.\n// For example:\n// >>> smallest_change((std::vector({(long)1, (long)2, (long)3, (long)5, (long)4, (long)7, (long)9, (long)6})))\n// (4)\n// >>> smallest_change((std::vector({(long)1, (long)2, (long)3, (long)4, (long)3, (long)2, (long)2})))\n// (1)\n// >>> smallest_change((std::vector({(long)1, (long)2, (long)3, (long)2, (long)1})))\n// (0)\nlong smallest_change(std::vector arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = smallest_change;\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)5, (long)4, (long)7, (long)9, (long)6}))) == (4));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)3, (long)2, (long)2}))) == (1));\n assert(candidate((std::vector({(long)1, (long)4, (long)2}))) == (1));\n assert(candidate((std::vector({(long)1, (long)4, (long)4, (long)2}))) == (1));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)2, (long)1}))) == (0));\n assert(candidate((std::vector({(long)3, (long)1, (long)1, (long)3}))) == (0));\n assert(candidate((std::vector({(long)1}))) == (0));\n assert(candidate((std::vector({(long)0, (long)1}))) == (1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "cpp", - "prompt": "#include\n#include\n// It is the last week of the semester and the teacher has to give the grades\n// to students. The teacher has been making her own algorithm for grading.\n// The only problem is, she has lost the code she used for grading.\n// She has given you a vector of GPAs for some students and you have to write \n// a function that can output a vector of letter grades using the following table:\n// GPA | Letter grade\n// 4.0 A+\n// > 3.7 A \n// > 3.3 A- \n// > 3.0 B+\n// > 2.7 B \n// > 2.3 B-\n// > 2.0 C+\n// > 1.7 C\n// > 1.3 C-\n// > 1.0 D+ \n// > 0.7 D \n// > 0.0 D-\n// 0.0 E\n// Example:\n// >>> grade_equation((std::vector({(float)4.0, (float)3, (float)1.7, (float)2, (float)3.5})))\n// (std::vector({(std::string)\"A+\", (std::string)\"B\", (std::string)\"C-\", (std::string)\"C\", (std::string)\"A-\"}))\nstd::vector numerical_letter_grade(std::vector grades) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = numerical_letter_grade;\n assert(candidate((std::vector({(float)4.0, (float)3, (float)1.7, (float)2, (float)3.5}))) == (std::vector({(std::string)\"A+\", (std::string)\"B\", (std::string)\"C-\", (std::string)\"C\", (std::string)\"A-\"})));\n assert(candidate((std::vector({(float)1.2}))) == (std::vector({(std::string)\"D+\"})));\n assert(candidate((std::vector({(float)0.5}))) == (std::vector({(std::string)\"D-\"})));\n assert(candidate((std::vector({(float)0.0}))) == (std::vector({(std::string)\"E\"})));\n assert(candidate((std::vector({(float)1.0, (float)0.3, (float)1.5, (float)2.8, (float)3.3}))) == (std::vector({(std::string)\"D\", (std::string)\"D-\", (std::string)\"C-\", (std::string)\"B\", (std::string)\"B+\"})));\n assert(candidate((std::vector({(float)0.0, (float)0.7}))) == (std::vector({(std::string)\"E\", (std::string)\"D-\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "cpp", - "prompt": "#include\n#include\n// Given the lengths of the three sides of a triangle. Return the area of\n// the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n// Otherwise return -1\n// Three sides make a valid triangle when the sum of any two sides is greater \n// than the third side.\n// Example:\n// >>> triangle_area((3), (4), (5))\n// (6.0)\n// >>> triangle_area((1), (2), (10))\n// (float(-1))\nfloat triangle_area(long a, long b, long c) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = triangle_area;\n assert(candidate((3), (4), (5)) == (6.0));\n assert(candidate((1), (2), (10)) == (float(-1)));\n assert(candidate((4), (8), (5)) == (8.18));\n assert(candidate((2), (2), (2)) == (1.73));\n assert(candidate((1), (2), (3)) == (float(-1)));\n assert(candidate((10), (5), (7)) == (16.25));\n assert(candidate((2), (6), (3)) == (float(-1)));\n assert(candidate((1), (1), (1)) == (0.43));\n assert(candidate((2), (2), (10)) == (float(-1)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "cpp", - "prompt": "#include\n#include\n// Check if two words have the same characters.\n// >>> same_chars((\"eabcdzzzz\"), (\"dddzzzzzzzddeddabc\"))\n// (true)\n// >>> same_chars((\"abcd\"), (\"dddddddabc\"))\n// (true)\n// >>> same_chars((\"dddddddabc\"), (\"abcd\"))\n// (true)\n// >>> same_chars((\"eabcd\"), (\"dddddddabc\"))\n// (false)\n// >>> same_chars((\"abcd\"), (\"dddddddabce\"))\n// (false)\n// >>> same_chars((\"eabcdzzzz\"), (\"dddzzzzzzzddddabc\"))\n// (false)\nbool same_chars(std::string s0, std::string s1) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = same_chars;\n assert(candidate((\"eabcdzzzz\"), (\"dddzzzzzzzddeddabc\")) == (true));\n assert(candidate((\"abcd\"), (\"dddddddabc\")) == (true));\n assert(candidate((\"dddddddabc\"), (\"abcd\")) == (true));\n assert(candidate((\"eabcd\"), (\"dddddddabc\")) == (false));\n assert(candidate((\"abcd\"), (\"dddddddabcf\")) == (false));\n assert(candidate((\"eabcdzzzz\"), (\"dddzzzzzzzddddabc\")) == (false));\n assert(candidate((\"aabb\"), (\"aaccc\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "cpp", - "prompt": "#include\n#include\n// Given a vector of integers nums, find the minimum sum of any non-empty sub-vector\n// of nums.\n// Example\n// >>> minSubArraySum((std::vector({(long)2, (long)3, (long)4, (long)1, (long)2, (long)4})))\n// (1)\n// >>> minSubArraySum((std::vector({(long)-1, (long)-2, (long)-3})))\n// (-6)\nlong minSubArraySum(std::vector nums) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = minSubArraySum;\n assert(candidate((std::vector({(long)2, (long)3, (long)4, (long)1, (long)2, (long)4}))) == (1));\n assert(candidate((std::vector({(long)-1, (long)-2, (long)-3}))) == (-6));\n assert(candidate((std::vector({(long)-1, (long)-2, (long)-3, (long)2, (long)-10}))) == (-14));\n assert(candidate((std::vector({(long)-9999999999999999}))) == (-9999999999999999));\n assert(candidate((std::vector({(long)0, (long)10, (long)20, (long)1000000}))) == (0));\n assert(candidate((std::vector({(long)-1, (long)-2, (long)-3, (long)10, (long)-5}))) == (-6));\n assert(candidate((std::vector({(long)100, (long)-1, (long)-2, (long)-3, (long)10, (long)-5}))) == (-6));\n assert(candidate((std::vector({(long)10, (long)11, (long)13, (long)8, (long)3, (long)4}))) == (3));\n assert(candidate((std::vector({(long)100, (long)-33, (long)32, (long)-1, (long)0, (long)-2}))) == (-33));\n assert(candidate((std::vector({(long)-10}))) == (-10));\n assert(candidate((std::vector({(long)7}))) == (7));\n assert(candidate((std::vector({(long)1, (long)-1}))) == (-1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "cpp", - "prompt": "#include\n#include\n// Given a string s and a natural number n, you have been tasked to implement \n// a function that returns a vector of all words from string s that contain exactly \n// n consonants, in order these words appear in the string s.\n// If the string s is empty then the function should return an empty vector.\n// Note: you may assume the input string contains only letters and spaces.\n// Examples:\n// >>> select_words((\"Mary had a little lamb\"), (4))\n// (std::vector({(std::string)\"little\"}))\n// >>> select_words((\"Mary had a little lamb\"), (3))\n// (std::vector({(std::string)\"Mary\", (std::string)\"lamb\"}))\n// >>> select_words((\"simple white space\"), (2))\n// (std::vector())\n// >>> select_words((\"Hello world\"), (4))\n// (std::vector({(std::string)\"world\"}))\n// >>> select_words((\"Uncle sam\"), (3))\n// (std::vector({(std::string)\"Uncle\"}))\nstd::vector select_words(std::string s, long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = select_words;\n assert(candidate((\"Mary had a little lamb\"), (4)) == (std::vector({(std::string)\"little\"})));\n assert(candidate((\"Mary had a little lamb\"), (3)) == (std::vector({(std::string)\"Mary\", (std::string)\"lamb\"})));\n assert(candidate((\"simple white space\"), (2)) == (std::vector()));\n assert(candidate((\"Hello world\"), (4)) == (std::vector({(std::string)\"world\"})));\n assert(candidate((\"Uncle sam\"), (3)) == (std::vector({(std::string)\"Uncle\"})));\n assert(candidate((\"\"), (4)) == (std::vector()));\n assert(candidate((\"a b c d e f\"), (1)) == (std::vector({(std::string)\"b\", (std::string)\"c\", (std::string)\"d\", (std::string)\"f\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "cpp", - "prompt": "#include\n#include\n// Return vector of all prefixes from shortest to longest of the input string\n// >>> all_prefixes((\"abc\"))\n// (std::vector({(std::string)\"a\", (std::string)\"ab\", (std::string)\"abc\"}))\nstd::vector all_prefixes(std::string string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = all_prefixes;\n assert(candidate((\"\")) == (std::vector()));\n assert(candidate((\"asdfgh\")) == (std::vector({(std::string)\"a\", (std::string)\"as\", (std::string)\"asd\", (std::string)\"asdf\", (std::string)\"asdfg\", (std::string)\"asdfgh\"})));\n assert(candidate((\"WWW\")) == (std::vector({(std::string)\"W\", (std::string)\"WW\", (std::string)\"WWW\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function that takes a value (string) representing a number\n// and returns the closest integer to it. If the number is equidistant\n// from two integers, round it away from zero.\n// Examples\n// >>> closest_integer((\"10\"))\n// (10)\n// >>> closest_integer((\"15.3\"))\n// (15)\n// Note:\n// Rounding away from zero means that if the given number is equidistant\n// from two integers, the one you should return is the one that is the\n// farthest from zero. For example closest_integer(\"14.5\") should\n// return 15 and closest_integer(\"-14.5\") should return -15.\nlong closest_integer(std::string value) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = closest_integer;\n assert(candidate((\"10\")) == (10));\n assert(candidate((\"14.5\")) == (15));\n assert(candidate((\"-15.5\")) == (-16));\n assert(candidate((\"15.3\")) == (15));\n assert(candidate((\"0\")) == (0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function which takes a string representing a file's name, and returns\n// 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n// A file's name is considered to be valid if and only if all the following conditions \n// are met:\n// - There should not be more than three digits ('0'-'9') in the file's name.\n// - The file's name contains exactly one dot '.'\n// - The substring before the dot should not be empty, and it starts with a letter from \n// the latin alphapet ('a'-'z' and 'A'-'Z').\n// - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n// Examples:\n// >>> file_name_check((\"example.txt\"))\n// (\"Yes\")\n// >>> file_name_check((\"1example.dll\"))\n// (\"No\")\nstd::string file_name_check(std::string file_name) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = file_name_check;\n assert(candidate((\"example.txt\")) == (\"Yes\"));\n assert(candidate((\"1example.dll\")) == (\"No\"));\n assert(candidate((\"s1sdf3.asd\")) == (\"No\"));\n assert(candidate((\"K.dll\")) == (\"Yes\"));\n assert(candidate((\"MY16FILE3.exe\")) == (\"Yes\"));\n assert(candidate((\"His12FILE94.exe\")) == (\"No\"));\n assert(candidate((\"_Y.txt\")) == (\"No\"));\n assert(candidate((\"?aREYA.exe\")) == (\"No\"));\n assert(candidate((\"/this_is_valid.dll\")) == (\"No\"));\n assert(candidate((\"this_is_valid.wow\")) == (\"No\"));\n assert(candidate((\"this_is_valid.txt\")) == (\"Yes\"));\n assert(candidate((\"this_is_valid.txtexe\")) == (\"No\"));\n assert(candidate((\"#this2_i4s_5valid.ten\")) == (\"No\"));\n assert(candidate((\"@this1_is6_valid.exe\")) == (\"No\"));\n assert(candidate((\"this_is_12valid.6exe4.txt\")) == (\"No\"));\n assert(candidate((\"all.exe.txt\")) == (\"No\"));\n assert(candidate((\"I563_No.exe\")) == (\"Yes\"));\n assert(candidate((\"Is3youfault.txt\")) == (\"Yes\"));\n assert(candidate((\"no_one#knows.dll\")) == (\"Yes\"));\n assert(candidate((\"1I563_Yes3.exe\")) == (\"No\"));\n assert(candidate((\"I563_Yes3.txtt\")) == (\"No\"));\n assert(candidate((\"final..txt\")) == (\"No\"));\n assert(candidate((\"final132\")) == (\"No\"));\n assert(candidate((\"_f4indsartal132.\")) == (\"No\"));\n assert(candidate((\".txt\")) == (\"No\"));\n assert(candidate((\"s.\")) == (\"No\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "cpp", - "prompt": "#include\n#include\n// You are given two intervals,\n// where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n// The given intervals are closed which means that the interval (start, end)\n// includes both start and end.\n// For each given interval, it is assumed that its start is less or equal its end.\n// Your task is to determine whether the length of intersection of these two \n// intervals is a prime number.\n// Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n// which its length is 1, which not a prime number.\n// If the length of the intersection is a prime number, return \"YES\",\n// otherwise, return \"NO\".\n// If the two intervals don't intersect, return \"NO\".\n// [input/output] samples:\n// >>> intersection((std::make_tuple(1, 2)), (std::make_tuple(2, 3)))\n// (\"NO\")\n// >>> intersection((std::make_tuple(-1, 1)), (std::make_tuple(0, 4)))\n// (\"NO\")\n// >>> intersection((std::make_tuple(-3, -1)), (std::make_tuple(-5, 5)))\n// (\"YES\")\nstd::string intersection(std::tuple interval1, std::tuple interval2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = intersection;\n assert(candidate((std::make_tuple(1, 2)), (std::make_tuple(2, 3))) == (\"NO\"));\n assert(candidate((std::make_tuple(-1, 1)), (std::make_tuple(0, 4))) == (\"NO\"));\n assert(candidate((std::make_tuple(-3, -1)), (std::make_tuple(-5, 5))) == (\"YES\"));\n assert(candidate((std::make_tuple(-2, 2)), (std::make_tuple(-4, 0))) == (\"YES\"));\n assert(candidate((std::make_tuple(-11, 2)), (std::make_tuple(-1, -1))) == (\"NO\"));\n assert(candidate((std::make_tuple(1, 2)), (std::make_tuple(3, 5))) == (\"NO\"));\n assert(candidate((std::make_tuple(1, 2)), (std::make_tuple(1, 2))) == (\"NO\"));\n assert(candidate((std::make_tuple(-2, -2)), (std::make_tuple(-3, -2))) == (\"NO\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "cpp", - "prompt": "#include\n#include\n// Return the largest prime factor of n. Assume n > 1 and is not a prime.\n// >>> largest_prime_factor((13195))\n// (29)\n// >>> largest_prime_factor((2048))\n// (2)\nlong largest_prime_factor(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = largest_prime_factor;\n assert(candidate((15)) == (5));\n assert(candidate((27)) == (3));\n assert(candidate((63)) == (7));\n assert(candidate((330)) == (11));\n assert(candidate((13195)) == (29));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "cpp", - "prompt": "#include\n#include\n// Given a string, find out how many distinct characters (regardless of case) does it consist of\n// >>> count_distinct_characters((\"xyzXYZ\"))\n// (3)\n// >>> count_distinct_characters((\"Jerry\"))\n// (4)\nlong count_distinct_characters(std::string string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = count_distinct_characters;\n assert(candidate((\"\")) == (0));\n assert(candidate((\"abcde\")) == (5));\n assert(candidate((\"abcdecadeCADE\")) == (5));\n assert(candidate((\"aaaaAAAAaaaa\")) == (1));\n assert(candidate((\"Jerry jERRY JeRRRY\")) == (5));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "cpp", - "prompt": "#include\n#include\n// You're given a vector of deposit and withdrawal operations on a bank account that starts with\n// zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n// at that point function should return true. Otherwise it should return false.\n// >>> below_zero((std::vector({(long)1, (long)2, (long)3})))\n// (false)\n// >>> below_zero((std::vector({(long)1, (long)2, (long)-4, (long)5})))\n// (true)\nbool below_zero(std::vector operations) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = below_zero;\n assert(candidate((std::vector())) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)-3, (long)1, (long)2, (long)-3}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)-4, (long)5, (long)6}))) == (true));\n assert(candidate((std::vector({(long)1, (long)-1, (long)2, (long)-2, (long)5, (long)-5, (long)4, (long)-4}))) == (false));\n assert(candidate((std::vector({(long)1, (long)-1, (long)2, (long)-2, (long)5, (long)-5, (long)4, (long)-5}))) == (true));\n assert(candidate((std::vector({(long)1, (long)-2, (long)2, (long)-2, (long)5, (long)-5, (long)4, (long)-4}))) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "cpp", - "prompt": "#include\n#include\n// Find the shortest palindrome that begins with a supplied string.\n// Algorithm idea is simple:\n// - Find the longest postfix of supplied string that is a palindrome.\n// - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n// >>> make_palindrome((\"\"))\n// (\"\")\n// >>> make_palindrome((\"cat\"))\n// (\"catac\")\n// >>> make_palindrome((\"cata\"))\n// (\"catac\")\nstd::string make_palindrome(std::string string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = make_palindrome;\n assert(candidate((\"\")) == (\"\"));\n assert(candidate((\"x\")) == (\"x\"));\n assert(candidate((\"xyz\")) == (\"xyzyx\"));\n assert(candidate((\"xyx\")) == (\"xyx\"));\n assert(candidate((\"jerry\")) == (\"jerryrrej\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "cpp", - "prompt": "#include\n#include\n// Given a positive integer, obtain its roman numeral equivalent as a string,\n// and return it in lowercase.\n// Restrictions: 1 <= num <= 1000\n// Examples:\n// >>> int_to_mini_roman((19))\n// (\"xix\")\n// >>> int_to_mini_roman((152))\n// (\"clii\")\n// >>> int_to_mini_roman((426))\n// (\"cdxxvi\")\nstd::string int_to_mini_roman(long number) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "reworded", - "tests": "}\nint main() {\n auto candidate = int_to_mini_roman;\n assert(candidate((19)) == (\"xix\"));\n assert(candidate((152)) == (\"clii\"));\n assert(candidate((251)) == (\"ccli\"));\n assert(candidate((426)) == (\"cdxxvi\"));\n assert(candidate((500)) == (\"d\"));\n assert(candidate((1)) == (\"i\"));\n assert(candidate((4)) == (\"iv\"));\n assert(candidate((43)) == (\"xliii\"));\n assert(candidate((90)) == (\"xc\"));\n assert(candidate((94)) == (\"xciv\"));\n assert(candidate((532)) == (\"dxxxii\"));\n assert(candidate((900)) == (\"cm\"));\n assert(candidate((994)) == (\"cmxciv\"));\n assert(candidate((1000)) == (\"m\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - } -] \ No newline at end of file diff --git a/data/cpp-transform.json b/data/cpp-transform.json deleted file mode 100644 index 270622a1e671401236dc8ab772554a128276e836..0000000000000000000000000000000000000000 --- a/data/cpp-transform.json +++ /dev/null @@ -1,1934 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "cpp", - "prompt": "#include\n#include\n// For a given number n, find the largest number that divides n evenly, smaller than n\n// >>> largest_divisor((15))\n// (5)\nlong largest_divisor(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = largest_divisor;\n assert(candidate((3)) == (1));\n assert(candidate((7)) == (1));\n assert(candidate((10)) == (5));\n assert(candidate((100)) == (50));\n assert(candidate((49)) == (7));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_47_median", - "language": "cpp", - "prompt": "#include\n#include\n// Return median of elements in the list l.\n// >>> median((std::vector({(long)3, (long)1, (long)2, (long)4, (long)5})))\n// (float(3))\n// >>> median((std::vector({(long)-10, (long)4, (long)6, (long)1000, (long)10, (long)20})))\n// (15.0)\nfloat median(std::vector l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = median;\n assert(candidate((std::vector({(long)3, (long)1, (long)2, (long)4, (long)5}))) == (float(3)));\n assert(candidate((std::vector({(long)-10, (long)4, (long)6, (long)1000, (long)10, (long)20}))) == (8.0));\n assert(candidate((std::vector({(long)5}))) == (float(5)));\n assert(candidate((std::vector({(long)6, (long)5}))) == (5.5));\n assert(candidate((std::vector({(long)8, (long)1, (long)3, (long)9, (long)9, (long)2, (long)7}))) == (float(7)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "cpp", - "prompt": "#include\n#include\n// Given two lists operator, and operand. The first list has basic algebra operations, and \n// the second list is a list of integers. Use the two given lists to build the algebric \n// expression and return the evaluation of this expression.\n// The basic algebra operations:\n// Addition ( + ) \n// Subtraction ( - ) \n// Multiplication ( * ) \n// Floor division ( // ) \n// Exponentiation ( ** ) \n// Example:\n// operator['+', '*', '-']\n// array = [2, 3, 4, 5]\n// result = 2 + 3 * 4 - 5\n// => result = 9\n// Note:\n// The length of operator list is equal to the length of operand list minus one.\n// Operand is a list of of non-negative integers.\n// Operator list has at least one operator, and operand list has at least two operands.\nlong do_algebra(std::vector op, std::vector operand) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = do_algebra;\n assert(candidate((std::vector({(std::string)\"**\", (std::string)\"*\", (std::string)\"+\"})), (std::vector({(long)2, (long)3, (long)4, (long)5}))) == (37));\n assert(candidate((std::vector({(std::string)\"+\", (std::string)\"*\", (std::string)\"-\"})), (std::vector({(long)2, (long)3, (long)4, (long)5}))) == (9));\n assert(candidate((std::vector({(std::string)\"//\", (std::string)\"*\"})), (std::vector({(long)7, (long)3, (long)4}))) == (8));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "cpp", - "prompt": "#include\n#include\n// Return maximum element in the list.\n// >>> max_element((std::vector({(long)1, (long)2, (long)3})))\n// (3)\n// >>> max_element((std::vector({(long)5, (long)3, (long)-5, (long)2, (long)-3, (long)3, (long)9, (long)0, (long)123, (long)1, (long)-10})))\n// (123)\nlong max_element(std::vector l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = max_element;\n assert(candidate((std::vector({(long)1, (long)2, (long)3}))) == (3));\n assert(candidate((std::vector({(long)5, (long)3, (long)-5, (long)2, (long)-3, (long)3, (long)9, (long)0, (long)124, (long)1, (long)-10}))) == (124));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function which returns the largest index of an element which\n// is not greater than or equal to the element immediately preceding it. If\n// no such element exists then return -1. The given array will not contain\n// duplicate values.\n// Examples:\n// >>> can_arrange((std::vector({(long)1, (long)2, (long)4, (long)3, (long)5})))\n// (3)\n// >>> can_arrange((std::vector({(long)1, (long)2, (long)3})))\n// (-1)\nlong can_arrange(std::vector arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = can_arrange;\n assert(candidate((std::vector({(long)1, (long)2, (long)4, (long)3, (long)5}))) == (3));\n assert(candidate((std::vector({(long)1, (long)2, (long)4, (long)5}))) == (-1));\n assert(candidate((std::vector({(long)1, (long)4, (long)2, (long)5, (long)6, (long)7, (long)8, (long)9, (long)10}))) == (2));\n assert(candidate((std::vector({(long)4, (long)8, (long)5, (long)7, (long)3}))) == (4));\n assert(candidate((std::vector())) == (-1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "cpp", - "prompt": "#include\n#include\n// Imagine a road that's a perfectly straight infinitely long line.\n// n cars are driving left to right; simultaneously, a different set of n cars\n// are driving right to left. The two sets of cars start out being very far from\n// each other. All cars move in the same speed. Two cars are said to collide\n// when a car that's moving left to right hits a car that's moving right to left.\n// However, the cars are infinitely sturdy and strong; as a result, they continue moving\n// in their trajectory as if they did not collide.\n// This function outputs the number of such collisions.\nlong car_race_collision(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = car_race_collision;\n assert(candidate((2)) == (4));\n assert(candidate((3)) == (9));\n assert(candidate((4)) == (16));\n assert(candidate((8)) == (64));\n assert(candidate((10)) == (100));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function that returns True if the last character\n// of a given string is an alphabetical character and is not\n// a part of a word, and False otherwise.\n// Note: \"word\" is a group of characters separated by space.\n// Examples:\n// >>> check_if_last_char_is_a_letter((\"apple pie\"))\n// (false)\n// >>> check_if_last_char_is_a_letter((\"apple pi e\"))\n// (true)\n// >>> check_if_last_char_is_a_letter((\"apple pi e \"))\n// (false)\n// >>> check_if_last_char_is_a_letter((\"\"))\n// (false)\nbool check_if_last_char_is_a_letter(std::string txt) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = check_if_last_char_is_a_letter;\n assert(candidate((\"apple\")) == (false));\n assert(candidate((\"apple pi e\")) == (true));\n assert(candidate((\"eeeee\")) == (false));\n assert(candidate((\"A\")) == (true));\n assert(candidate((\"Pumpkin pie \")) == (false));\n assert(candidate((\"Pumpkin pie 1\")) == (false));\n assert(candidate((\"\")) == (false));\n assert(candidate((\"eeeee e \")) == (false));\n assert(candidate((\"apple pie\")) == (false));\n assert(candidate((\"apple pi e \")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "cpp", - "prompt": "#include\n#include\n// Return true if a given number is prime, and false otherwise.\n// >>> is_prime((6))\n// (false)\n// >>> is_prime((101))\n// (true)\n// >>> is_prime((11))\n// (true)\n// >>> is_prime((13441))\n// (true)\n// >>> is_prime((61))\n// (true)\n// >>> is_prime((4))\n// (false)\n// >>> is_prime((1))\n// (false)\nbool is_prime(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = is_prime;\n assert(candidate((6)) == (false));\n assert(candidate((101)) == (true));\n assert(candidate((11)) == (true));\n assert(candidate((13441)) == (true));\n assert(candidate((61)) == (true));\n assert(candidate((4)) == (false));\n assert(candidate((1)) == (false));\n assert(candidate((5)) == (true));\n assert(candidate((11)) == (true));\n assert(candidate((17)) == (true));\n assert(candidate((85)) == (false));\n assert(candidate((77)) == (false));\n assert(candidate((255379)) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "cpp", - "prompt": "#include\n#include\n// Given a list of positive integers x. return a sorted list of all \n// elements that hasn't any even digit.\n// Note: Returned list should be sorted in increasing order.\n// For example:\n// >>> unique_digits((std::vector({(long)15, (long)33, (long)1422, (long)1})))\n// (std::vector({(long)1, (long)15, (long)33}))\n// >>> unique_digits((std::vector({(long)152, (long)323, (long)1422, (long)10})))\n// (std::vector())\nstd::vector unique_digits(std::vector x) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = unique_digits;\n assert(candidate((std::vector({(long)15, (long)33, (long)1422, (long)1}))) == (std::vector({(long)1, (long)15, (long)33})));\n assert(candidate((std::vector({(long)152, (long)323, (long)1422, (long)10}))) == (std::vector()));\n assert(candidate((std::vector({(long)12345, (long)2033, (long)111, (long)151}))) == (std::vector({(long)111, (long)151})));\n assert(candidate((std::vector({(long)135, (long)103, (long)31}))) == (std::vector({(long)31, (long)135})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "cpp", - "prompt": "#include\n#include\n// Input are two strings a and b consisting only of 1s and 0s.\n// Perform binary XOR on these inputs and return result also as a string.\n// >>> string_xor((\"010\"), (\"110\"))\n// (\"100\")\nstd::string string_xor(std::string a, std::string b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = string_xor;\n assert(candidate((\"111000\"), (\"101010\")) == (\"010010\"));\n assert(candidate((\"1\"), (\"1\")) == (\"0\"));\n assert(candidate((\"0101\"), (\"0000\")) == (\"0101\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "cpp", - "prompt": "#include\n#include\n// sum_to_n is a function that sums numbers from 1 to n.\n// >>> sum_to_n((30))\n// (465)\n// >>> sum_to_n((100))\n// (5050)\n// >>> sum_to_n((5))\n// (15)\n// >>> sum_to_n((10))\n// (55)\n// >>> sum_to_n((1))\n// (1)\nlong sum_to_n(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = sum_to_n;\n assert(candidate((1)) == (1));\n assert(candidate((6)) == (21));\n assert(candidate((11)) == (66));\n assert(candidate((30)) == (465));\n assert(candidate((100)) == (5050));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "cpp", - "prompt": "#include\n#include\n// Given a list of numbers, return the sum of squares of the numbers\n// in the list that are odd. Ignore numbers that are negative or not integers.\n// >>> double_the_difference((std::vector({(long)1, (long)3, (long)2, (long)0})))\n// (10)\n// >>> double_the_difference((std::vector({(long)-1, (long)-2, (long)0})))\n// (0)\n// >>> double_the_difference((std::vector({(long)9, (long)-2})))\n// (81)\n// >>> double_the_difference((std::vector({(long)0})))\n// (0)\n// If the input list is empty, return 0.\nlong double_the_difference(std::vector lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = double_the_difference;\n assert(candidate((std::vector())) == (0));\n assert(candidate((std::vector({(float)5.0, (float)4.0}))) == (25));\n assert(candidate((std::vector({(float)0.1, (float)0.2, (float)0.3}))) == (0));\n assert(candidate((std::vector({(float)-10.0, (float)-20.0, (float)-30.0}))) == (0));\n assert(candidate((std::vector({(float)-1.0, (float)-2.0, (float)8.0}))) == (0));\n assert(candidate((std::vector({(float)0.2, (float)3.0, (float)5.0}))) == (34));\n assert(candidate((std::vector({(float)-9.0, (float)-7.0, (float)-5.0, (float)-3.0, (float)-1.0, (float)1.0, (float)3.0, (float)5.0, (float)7.0, (float)9.0}))) == (165));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "cpp", - "prompt": "#include\n#include\n// Return length of given string\n// >>> string_length((\"\"))\n// (0)\n// >>> string_length((\"abc\"))\n// (3)\nlong string_length(std::string string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = string_length;\n assert(candidate((\"\")) == (0));\n assert(candidate((\"x\")) == (1));\n assert(candidate((\"asdasnakj\")) == (9));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "cpp", - "prompt": "#include\n#include\n// You'll be given a string of words, and your task is to count the number\n// of boredoms. A boredom is a sentence that starts with the word \"I\".\n// Sentences are delimited by '.', '?' or '!'.\n// For example:\n// >>> is_bored((\"Hello world\"))\n// (0)\n// >>> is_bored((\"The sky is blue. The sun is shining. I love this weather\"))\n// (1)\nlong is_bored(std::string S) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = is_bored;\n assert(candidate((\"Hello world\")) == (0));\n assert(candidate((\"Is the sky blue?\")) == (0));\n assert(candidate((\"I love It !\")) == (1));\n assert(candidate((\"bIt\")) == (0));\n assert(candidate((\"I feel good today. I will be productive. will kill It\")) == (2));\n assert(candidate((\"You and I are going for a walk\")) == (0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function vowels_count which takes a string representing\n// a word as input and returns the number of vowels in the string.\n// Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n// vowel, but only when it is at the end of the given word.\n// Example:\n// >>> vowels_count((\"abcde\"))\n// (2)\n// >>> vowels_count((\"ACEDY\"))\n// (3)\nlong vowels_count(std::string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = vowels_count;\n assert(candidate((\"abcde\")) == (2));\n assert(candidate((\"Alone\")) == (3));\n assert(candidate((\"key\")) == (2));\n assert(candidate((\"bye\")) == (1));\n assert(candidate((\"keY\")) == (2));\n assert(candidate((\"bYe\")) == (1));\n assert(candidate((\"ACEDY\")) == (3));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "cpp", - "prompt": "#include\n#include\n// Return n-th Fibonacci number.\n// >>> fib((10))\n// (55)\n// >>> fib((1))\n// (1)\n// >>> fib((8))\n// (21)\nlong fib(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = fib;\n assert(candidate((10)) == (55));\n assert(candidate((1)) == (1));\n assert(candidate((8)) == (21));\n assert(candidate((11)) == (89));\n assert(candidate((12)) == (144));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "cpp", - "prompt": "#include\n#include\n// Your task is to implement a function that will simplify the expression\n// x * n. The function returns True if x * n evaluates to a whole number and False\n// otherwise. Both x and n, are string representation of a fraction, and have the following format,\n// / where both numerator and denominator are positive whole numbers.\n// You can assume that x, and n are valid fractions, and do not have zero as denominator.\n// >>> simplify((\"1/5\"), (\"5/1\"))\n// (true)\n// >>> simplify((\"1/6\"), (\"2/1\"))\n// (false)\n// >>> simplify((\"7/10\"), (\"10/2\"))\n// (false)\nbool simplify(std::string x, std::string n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = simplify;\n assert(candidate((\"1/5\"), (\"5/1\")) == (true));\n assert(candidate((\"1/6\"), (\"2/1\")) == (false));\n assert(candidate((\"5/1\"), (\"3/1\")) == (true));\n assert(candidate((\"7/10\"), (\"10/2\")) == (false));\n assert(candidate((\"2/10\"), (\"50/10\")) == (true));\n assert(candidate((\"7/2\"), (\"4/2\")) == (true));\n assert(candidate((\"11/6\"), (\"6/1\")) == (true));\n assert(candidate((\"2/3\"), (\"5/2\")) == (false));\n assert(candidate((\"5/2\"), (\"3/5\")) == (false));\n assert(candidate((\"2/4\"), (\"8/4\")) == (true));\n assert(candidate((\"2/4\"), (\"4/2\")) == (true));\n assert(candidate((\"1/5\"), (\"5/1\")) == (true));\n assert(candidate((\"1/5\"), (\"1/5\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "cpp", - "prompt": "#include\n#include\n// Given a string s, count the number of uppercase vowels in even indices.\n// For example:\n// >>> count_upper((\"aBCdEf\"))\n// (1)\n// >>> count_upper((\"abcdefg\"))\n// (0)\n// >>> count_upper((\"dBBE\"))\n// (0)\nlong count_upper(std::string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = count_upper;\n assert(candidate((\"aBCdEf\")) == (1));\n assert(candidate((\"abcdefg\")) == (0));\n assert(candidate((\"dBBE\")) == (0));\n assert(candidate((\"B\")) == (0));\n assert(candidate((\"U\")) == (1));\n assert(candidate((\"\")) == (0));\n assert(candidate((\"EEEE\")) == (2));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a rectangular grid of wells. Each row represents a single well,\n// and each 1 in a row represents a single unit of water.\n// Each well has a corresponding bucket that can be used to extract water from it, \n// and all buckets have the same capacity.\n// Your task is to use the buckets to empty the wells.\n// Output the number of times you need to lower the buckets.\n// Example 1:\n// >>> max_fill((std::vector>({(std::vector)std::vector({(long)0, (long)0, (long)1, (long)0}), (std::vector)std::vector({(long)0, (long)1, (long)0, (long)0}), (std::vector)std::vector({(long)1, (long)1, (long)1, (long)1})})), (1))\n// (6)\n// Example 2:\n// >>> max_fill((std::vector>({(std::vector)std::vector({(long)0, (long)0, (long)1, (long)1}), (std::vector)std::vector({(long)0, (long)0, (long)0, (long)0}), (std::vector)std::vector({(long)1, (long)1, (long)1, (long)1}), (std::vector)std::vector({(long)0, (long)1, (long)1, (long)1})})), (2))\n// (5)\n// Example 3:\n// >>> max_fill((std::vector>({(std::vector)std::vector({(long)0, (long)0, (long)0}), (std::vector)std::vector({(long)0, (long)0, (long)0})})), (5))\n// (0)\n// Constraints:\n// * all wells have the same length\n// * 1 <= grid.length <= 10^2\n// * 1 <= grid[:,1].length <= 10^2\n// * grid[i][j] -> 0 | 1\n// * 1 <= capacity <= 10\nlong max_fill(std::vector> grid, long capacity) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = max_fill;\n assert(candidate((std::vector>({(std::vector)std::vector({(long)0, (long)0, (long)1, (long)0}), (std::vector)std::vector({(long)0, (long)1, (long)0, (long)0}), (std::vector)std::vector({(long)1, (long)1, (long)1, (long)1})})), (1)) == (6));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)0, (long)0, (long)1, (long)1}), (std::vector)std::vector({(long)0, (long)0, (long)0, (long)0}), (std::vector)std::vector({(long)1, (long)1, (long)1, (long)1}), (std::vector)std::vector({(long)0, (long)1, (long)1, (long)1})})), (2)) == (5));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)0, (long)0, (long)0}), (std::vector)std::vector({(long)0, (long)0, (long)0})})), (5)) == (0));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)1, (long)1, (long)1}), (std::vector)std::vector({(long)1, (long)1, (long)1, (long)1})})), (2)) == (4));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)1, (long)1, (long)1}), (std::vector)std::vector({(long)1, (long)1, (long)1, (long)1})})), (9)) == (2));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "cpp", - "prompt": "#include\n#include\n// Given an array arr of integers and a positive integer k, return a sorted list \n// of length k with the maximum k numbers in arr.\n// Example 1:\n// >>> maximum((std::vector({(long)-3, (long)-4, (long)5})), (3))\n// (std::vector({(long)-4, (long)-3, (long)5}))\n// Example 2:\n// >>> maximum((std::vector({(long)4, (long)-4, (long)4})), (2))\n// (std::vector({(long)4, (long)4}))\n// Example 3:\n// >>> maximum((std::vector({(long)-3, (long)2, (long)1, (long)2, (long)-1, (long)-2, (long)1})), (1))\n// (std::vector({(long)2}))\n// Note:\n// 1. The length of the array will be in the range of [1, 1000].\n// 2. The elements in the array will be in the range of [-1000, 1000].\n// 3. 0 <= k <= len(arr)\nstd::vector maximum(std::vector arr, long k) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = maximum;\n assert(candidate((std::vector({(long)-3, (long)-4, (long)5})), (3)) == (std::vector({(long)-4, (long)-3, (long)5})));\n assert(candidate((std::vector({(long)4, (long)-4, (long)4})), (2)) == (std::vector({(long)4, (long)4})));\n assert(candidate((std::vector({(long)-3, (long)2, (long)1, (long)2, (long)-1, (long)-2, (long)1})), (1)) == (std::vector({(long)2})));\n assert(candidate((std::vector({(long)123, (long)-123, (long)20, (long)0, (long)1, (long)2, (long)-3})), (3)) == (std::vector({(long)2, (long)20, (long)123})));\n assert(candidate((std::vector({(long)-123, (long)20, (long)0, (long)1, (long)2, (long)-3})), (4)) == (std::vector({(long)0, (long)1, (long)2, (long)20})));\n assert(candidate((std::vector({(long)5, (long)15, (long)0, (long)3, (long)-13, (long)-8, (long)0})), (7)) == (std::vector({(long)-13, (long)-8, (long)0, (long)0, (long)3, (long)5, (long)15})));\n assert(candidate((std::vector({(long)-1, (long)0, (long)2, (long)5, (long)3, (long)-10})), (2)) == (std::vector({(long)3, (long)5})));\n assert(candidate((std::vector({(long)1, (long)0, (long)5, (long)-7})), (1)) == (std::vector({(long)5})));\n assert(candidate((std::vector({(long)4, (long)-4})), (2)) == (std::vector({(long)-4, (long)4})));\n assert(candidate((std::vector({(long)-10, (long)10})), (2)) == (std::vector({(long)-10, (long)10})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)-23, (long)243, (long)-400, (long)0})), (0)) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that takes a message, and encodes in such a \n// way that it swaps case of all letters, replaces all vowels in \n// the message with the letter that appears 2 places ahead of that \n// vowel in the english alphabet. \n// Assume only letters. \n// Examples:\n// >>> encode((\"test\"))\n// (\"TGST\")\n// >>> encode((\"This is a message\"))\n// (\"tHKS KS C MGSSCGG\")\nstd::string encode(std::string message) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = encode;\n assert(candidate((\"TEST\")) == (\"tgst\"));\n assert(candidate((\"Mudasir\")) == (\"mWDCSKR\"));\n assert(candidate((\"YES\")) == (\"ygs\"));\n assert(candidate((\"This is a message\")) == (\"tHKS KS C MGSSCGG\"));\n assert(candidate((\"I DoNt KnOw WhAt tO WrItE\")) == (\"k dQnT kNqW wHcT Tq wRkTg\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "cpp", - "prompt": "#include\n#include\n// remove_vowels is a function that takes string and returns string without vowels.\n// >>> remove_vowels((\"\"))\n// (\"\")\n// >>> remove_vowels((\"abcdef\"))\n// (\"bcdf\")\n// >>> remove_vowels((\"aaaaa\"))\n// (\"\")\n// >>> remove_vowels((\"aaBAA\"))\n// (\"B\")\n// >>> remove_vowels((\"zbcd\"))\n// (\"zbcd\")\nstd::string remove_vowels(std::string text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = remove_vowels;\n assert(candidate((\"\")) == (\"\"));\n assert(candidate((\"abcdef\\nghijklm\")) == (\"bcdf\\nghjklm\"));\n assert(candidate((\"fedcba\")) == (\"fdcb\"));\n assert(candidate((\"eeeee\")) == (\"\"));\n assert(candidate((\"acBAA\")) == (\"cB\"));\n assert(candidate((\"EcBOO\")) == (\"cB\"));\n assert(candidate((\"ybcd\")) == (\"ybcd\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "cpp", - "prompt": "#include\n#include\n// Return only positive numbers in the list.\n// >>> get_positive((std::vector({(long)-1, (long)2, (long)-4, (long)5, (long)6})))\n// (std::vector({(long)2, (long)5, (long)6}))\n// >>> get_positive((std::vector({(long)5, (long)3, (long)-5, (long)2, (long)-3, (long)3, (long)9, (long)0, (long)123, (long)1, (long)-10})))\n// (std::vector({(long)5, (long)3, (long)2, (long)3, (long)9, (long)123, (long)1}))\nstd::vector get_positive(std::vector l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = get_positive;\n assert(candidate((std::vector({(long)-1, (long)-2, (long)4, (long)5, (long)6}))) == (std::vector({(long)4, (long)5, (long)6})));\n assert(candidate((std::vector({(long)5, (long)3, (long)-5, (long)2, (long)3, (long)3, (long)9, (long)0, (long)123, (long)1, (long)-10}))) == (std::vector({(long)5, (long)3, (long)2, (long)3, (long)3, (long)9, (long)123, (long)1})));\n assert(candidate((std::vector({(long)-1, (long)-2}))) == (std::vector()));\n assert(candidate((std::vector())) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "cpp", - "prompt": "#include\n#include\n// Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n// >>> string_sequence((0))\n// (\"0\")\n// >>> string_sequence((5))\n// (\"0 1 2 3 4 5\")\nstd::string string_sequence(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = string_sequence;\n assert(candidate((0)) == (\"0\"));\n assert(candidate((3)) == (\"0 1 2 3\"));\n assert(candidate((10)) == (\"0 1 2 3 4 5 6 7 8 9 10\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "cpp", - "prompt": "#include\n#include\n// Given a positive integer n, you have to make a pile of n levels of stones.\n// The first level has n stones.\n// The number of stones in the next level is:\n// - the next odd number if n is odd.\n// - the next even number if n is even.\n// Return the number of stones in each level in a list, where element at index\n// i represents the number of stones in the level (i+1).\n// Examples:\n// >>> make_a_pile((3))\n// (std::vector({(long)3, (long)5, (long)7}))\nstd::vector make_a_pile(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = make_a_pile;\n assert(candidate((3)) == (std::vector({(long)3, (long)5, (long)7})));\n assert(candidate((4)) == (std::vector({(long)4, (long)6, (long)8, (long)10})));\n assert(candidate((5)) == (std::vector({(long)5, (long)7, (long)9, (long)11, (long)13})));\n assert(candidate((6)) == (std::vector({(long)6, (long)8, (long)10, (long)12, (long)14, (long)16})));\n assert(candidate((8)) == (std::vector({(long)8, (long)10, (long)12, (long)14, (long)16, (long)18, (long)20, (long)22})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "cpp", - "prompt": "#include\n#include\n// Task\n// 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\n// then check if the result string is palindrome.\n// A string is called palindrome if it reads the same backward as forward.\n// You should return a tuple containing the result string and True/False for the check.\n// Example\n// >>> reverse_delete((\"abcde\"), (\"ae\"))\n// (std::make_tuple(\"bcd\", false))\n// >>> reverse_delete((\"abcdef\"), (\"b\"))\n// (std::make_tuple(\"acdef\", false))\n// >>> reverse_delete((\"abcdedcba\"), (\"ab\"))\n// (std::make_tuple(\"cdedc\", true))\nstd::tuple reverse_delete(std::string s, std::string c) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = reverse_delete;\n assert(candidate((\"abcde\"), (\"ae\")) == (std::make_tuple(\"bcd\", false)));\n assert(candidate((\"abcdef\"), (\"b\")) == (std::make_tuple(\"acdef\", false)));\n assert(candidate((\"abcdedcba\"), (\"ab\")) == (std::make_tuple(\"cdedc\", true)));\n assert(candidate((\"dwik\"), (\"w\")) == (std::make_tuple(\"dik\", false)));\n assert(candidate((\"a\"), (\"a\")) == (std::make_tuple(\"\", true)));\n assert(candidate((\"abcdedcba\"), (\"\")) == (std::make_tuple(\"abcdedcba\", true)));\n assert(candidate((\"abcdedcba\"), (\"v\")) == (std::make_tuple(\"abcdedcba\", true)));\n assert(candidate((\"vabba\"), (\"v\")) == (std::make_tuple(\"abba\", true)));\n assert(candidate((\"mamma\"), (\"mia\")) == (std::make_tuple(\"\", true)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "cpp", - "prompt": "#include\n#include\n// For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n// >>> flip_case((\"Hello\"))\n// (\"hELLO\")\nstd::string flip_case(std::string string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = flip_case;\n assert(candidate((\"\")) == (\"\"));\n assert(candidate((\"Hello!\")) == (\"hELLO!\"));\n assert(candidate((\"These violent delights have violent ends\")) == (\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a string s.\n// if s[i] is a letter, reverse its case from lower to upper or vise versa, \n// otherwise keep it as it is.\n// If the string contains no letters, reverse the string.\n// The function should return the resulted string.\n// Examples\n// >>> solve((\"1234\"))\n// (\"4321\")\n// >>> solve((\"ab\"))\n// (\"AB\")\n// >>> solve((\"#a@C\"))\n// (\"#A@c\")\nstd::string solve(std::string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = solve;\n assert(candidate((\"AsDf\")) == (\"aSdF\"));\n assert(candidate((\"1234\")) == (\"4321\"));\n assert(candidate((\"ab\")) == (\"AB\"));\n assert(candidate((\"#a@C\")) == (\"#A@c\"));\n assert(candidate((\"#AsdfW^45\")) == (\"#aSDFw^45\"));\n assert(candidate((\"#6@2\")) == (\"2@6#\"));\n assert(candidate((\"#$a^D\")) == (\"#$A^d\"));\n assert(candidate((\"#ccc\")) == (\"#CCC\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "cpp", - "prompt": "#include\n#include\n// Filter an input list of strings only for ones that start with a given prefix.\n// >>> filter_by_prefix((std::vector()), (\"a\"))\n// (std::vector())\n// >>> filter_by_prefix((std::vector({(std::string)\"abc\", (std::string)\"bcd\", (std::string)\"cde\", (std::string)\"array\"})), (\"a\"))\n// (std::vector({(std::string)\"abc\", (std::string)\"array\"}))\nstd::vector filter_by_prefix(std::vector strings, std::string prefix) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = filter_by_prefix;\n assert(candidate((std::vector()), (\"john\")) == (std::vector()));\n assert(candidate((std::vector({(std::string)\"xxx\", (std::string)\"asd\", (std::string)\"xxy\", (std::string)\"john doe\", (std::string)\"xxxAAA\", (std::string)\"xxx\"})), (\"xxx\")) == (std::vector({(std::string)\"xxx\", (std::string)\"xxxAAA\", (std::string)\"xxx\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "cpp", - "prompt": "#include\n#include\n// This function takes two positive numbers x and y and returns the\n// biggest even integer number that is in the range [x, y] inclusive. If \n// there's no such number, then the function should return -1.\n// For example:\n// >>> choose_num((12), (15))\n// (14)\n// >>> choose_num((13), (12))\n// (-1)\nlong choose_num(long x, long y) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = choose_num;\n assert(candidate((12), (15)) == (14));\n assert(candidate((13), (12)) == (-1));\n assert(candidate((33), (12354)) == (12354));\n assert(candidate((5234), (5233)) == (-1));\n assert(candidate((6), (29)) == (28));\n assert(candidate((27), (10)) == (-1));\n assert(candidate((7), (7)) == (-1));\n assert(candidate((546), (546)) == (546));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a string representing a sentence,\n// the sentence contains some words separated by a space,\n// and you have to return a string that contains the words from the original sentence,\n// whose lengths are prime numbers,\n// the order of the words in the new string should be the same as the original one.\n// Example 1:\n// >>> words_in_sentence((\"This is a test\"))\n// (\"is\")\n// Example 2:\n// >>> words_in_sentence((\"lets go for swimming\"))\n// (\"go for\")\n// Constraints:\n// * 1 <= len(sentence) <= 100\n// * sentence contains only letters\nstd::string words_in_sentence(std::string sentence) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = words_in_sentence;\n assert(candidate((\"This is a test\")) == (\"is\"));\n assert(candidate((\"lets go for swimming\")) == (\"go for\"));\n assert(candidate((\"there is no place available here\")) == (\"there is no place\"));\n assert(candidate((\"Hi I am Hussein\")) == (\"Hi am Hussein\"));\n assert(candidate((\"go for it\")) == (\"go for it\"));\n assert(candidate((\"here\")) == (\"\"));\n assert(candidate((\"here is\")) == (\"is\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "cpp", - "prompt": "#include\n#include\n// Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n// >>> intersperse((std::vector()), (4))\n// (std::vector())\n// >>> intersperse((std::vector({(long)1, (long)2, (long)3})), (4))\n// (std::vector({(long)1, (long)4, (long)2, (long)4, (long)3}))\nstd::vector intersperse(std::vector numbers, long delimeter) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = intersperse;\n assert(candidate((std::vector()), (7)) == (std::vector()));\n assert(candidate((std::vector({(long)5, (long)6, (long)3, (long)2})), (8)) == (std::vector({(long)5, (long)8, (long)6, (long)8, (long)3, (long)8, (long)2})));\n assert(candidate((std::vector({(long)2, (long)2, (long)2})), (2)) == (std::vector({(long)2, (long)2, (long)2, (long)2, (long)2})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "cpp", - "prompt": "#include\n#include\n// Your task is to write a function that returns true if a number x is a simple\n// power of n and false in other cases.\n// x is a simple power of n if n**int=x\n// For example:\n// >>> is_simple_power((1), (4))\n// (true)\n// >>> is_simple_power((2), (2))\n// (true)\n// >>> is_simple_power((8), (2))\n// (true)\n// >>> is_simple_power((3), (2))\n// (false)\n// >>> is_simple_power((3), (1))\n// (false)\n// >>> is_simple_power((5), (3))\n// (false)\nbool is_simple_power(long x, long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = is_simple_power;\n assert(candidate((16), (2)) == (true));\n assert(candidate((143214), (16)) == (false));\n assert(candidate((4), (2)) == (true));\n assert(candidate((9), (3)) == (true));\n assert(candidate((16), (4)) == (true));\n assert(candidate((24), (2)) == (false));\n assert(candidate((128), (4)) == (false));\n assert(candidate((12), (6)) == (false));\n assert(candidate((1), (1)) == (true));\n assert(candidate((1), (12)) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that returns true if the given number is the multiplication of 3 prime numbers\n// and false otherwise.\n// Knowing that (a) is less then 100. \n// Example:\n// >>> is_multiply_prime((30))\n// (true)\n// 30 = 2 * 3 * 5\nbool is_multiply_prime(long a) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = is_multiply_prime;\n assert(candidate((5)) == (false));\n assert(candidate((30)) == (true));\n assert(candidate((8)) == (true));\n assert(candidate((10)) == (false));\n assert(candidate((125)) == (true));\n assert(candidate((105)) == (true));\n assert(candidate((126)) == (false));\n assert(candidate((729)) == (false));\n assert(candidate((891)) == (false));\n assert(candidate((1001)) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "cpp", - "prompt": "#include\n#include\n// Given the lengths of the three sides of a triangle. Return True if the three\n// sides form a right-angled triangle, False otherwise.\n// A right-angled triangle is a triangle in which one angle is right angle or \n// 90 degree.\n// Example:\n// >>> right_angle_triangle((3), (4), (5))\n// (true)\n// >>> right_angle_triangle((1), (2), (3))\n// (false)\nbool right_angle_triangle(long a, long b, long c) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = right_angle_triangle;\n assert(candidate((3), (4), (5)) == (true));\n assert(candidate((1), (2), (3)) == (false));\n assert(candidate((10), (6), (8)) == (true));\n assert(candidate((2), (2), (2)) == (false));\n assert(candidate((7), (24), (25)) == (true));\n assert(candidate((10), (5), (7)) == (false));\n assert(candidate((5), (12), (13)) == (true));\n assert(candidate((15), (8), (17)) == (true));\n assert(candidate((48), (55), (73)) == (true));\n assert(candidate((1), (1), (1)) == (false));\n assert(candidate((2), (2), (10)) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function that takes 3 numbers.\n// Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n// Returns false in any other cases.\n// Examples\n// >>> any_int((float(5)), (float(2)), (float(7)))\n// (true)\n// >>> any_int((float(3)), (float(2)), (float(2)))\n// (false)\n// >>> any_int((float(3)), (float(-2)), (float(1)))\n// (true)\n// >>> any_int((3.6), (-2.2), (float(2)))\n// (false)\nbool any_int(float x, float y, float z) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = any_int;\n assert(candidate((float(2)), (float(3)), (float(1))) == (true));\n assert(candidate((2.5), (float(2)), (float(3))) == (false));\n assert(candidate((1.5), (float(5)), (3.5)) == (false));\n assert(candidate((float(2)), (float(6)), (float(2))) == (false));\n assert(candidate((float(4)), (float(2)), (float(2))) == (true));\n assert(candidate((2.2), (2.2), (2.2)) == (false));\n assert(candidate((float(-4)), (float(6)), (float(2))) == (true));\n assert(candidate((float(2)), (float(1)), (float(1))) == (true));\n assert(candidate((float(3)), (float(4)), (float(7))) == (true));\n assert(candidate((3.0), (float(4)), (float(7))) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "cpp", - "prompt": "#include\n#include\n// This function takes a list l and returns a list l' such that\n// l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n// to the values of the corresponding indicies of l, but sorted.\n// >>> sort_third((std::vector({(long)1, (long)2, (long)3})))\n// (std::vector({(long)1, (long)2, (long)3}))\n// >>> sort_third((std::vector({(long)5, (long)6, (long)3, (long)4, (long)8, (long)9, (long)2})))\n// (std::vector({(long)2, (long)6, (long)3, (long)4, (long)8, (long)9, (long)5}))\nstd::vector sort_third(std::vector l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = sort_third;\n assert(candidate((std::vector({(long)5, (long)6, (long)3, (long)4, (long)8, (long)9, (long)2}))) == (std::vector({(long)2, (long)6, (long)3, (long)4, (long)8, (long)9, (long)5})));\n assert(candidate((std::vector({(long)5, (long)8, (long)3, (long)4, (long)6, (long)9, (long)2}))) == (std::vector({(long)2, (long)8, (long)3, (long)4, (long)6, (long)9, (long)5})));\n assert(candidate((std::vector({(long)5, (long)6, (long)9, (long)4, (long)8, (long)3, (long)2}))) == (std::vector({(long)2, (long)6, (long)9, (long)4, (long)8, (long)3, (long)5})));\n assert(candidate((std::vector({(long)5, (long)6, (long)3, (long)4, (long)8, (long)9, (long)2, (long)1}))) == (std::vector({(long)2, (long)6, (long)3, (long)4, (long)8, (long)9, (long)5, (long)1})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_53_add", - "language": "cpp", - "prompt": "#include\n#include\n// Add two numbers x and y\n// >>> add((2), (3))\n// (5)\n// >>> add((5), (7))\n// (12)\nlong add(long x, long y) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = add;\n assert(candidate((0), (1)) == (1));\n assert(candidate((1), (0)) == (1));\n assert(candidate((2), (3)) == (5));\n assert(candidate((5), (7)) == (12));\n assert(candidate((7), (5)) == (12));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_69_search", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n// zero, and has a frequency greater than or equal to the value of the integer itself. \n// The frequency of an integer is the number of times it appears in the list.\n// If no such a value exist, return -1.\n// Examples:\n// >>> search((std::vector({(long)4, (long)1, (long)2, (long)2, (long)3, (long)1})))\n// (2)\n// >>> search((std::vector({(long)1, (long)2, (long)2, (long)3, (long)3, (long)3, (long)4, (long)4, (long)4})))\n// (3)\n// >>> search((std::vector({(long)5, (long)5, (long)4, (long)4, (long)4})))\n// (-1)\nlong search(std::vector lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = search;\n assert(candidate((std::vector({(long)5, (long)5, (long)5, (long)5, (long)1}))) == (1));\n assert(candidate((std::vector({(long)4, (long)1, (long)4, (long)1, (long)4, (long)4}))) == (4));\n assert(candidate((std::vector({(long)3, (long)3}))) == (-1));\n assert(candidate((std::vector({(long)8, (long)8, (long)8, (long)8, (long)8, (long)8, (long)8, (long)8}))) == (8));\n assert(candidate((std::vector({(long)2, (long)3, (long)3, (long)2, (long)2}))) == (2));\n assert(candidate((std::vector({(long)2, (long)7, (long)8, (long)8, (long)4, (long)8, (long)7, (long)3, (long)9, (long)6, (long)5, (long)10, (long)4, (long)3, (long)6, (long)7, (long)1, (long)7, (long)4, (long)10, (long)8, (long)1}))) == (1));\n assert(candidate((std::vector({(long)3, (long)2, (long)8, (long)2}))) == (2));\n assert(candidate((std::vector({(long)6, (long)7, (long)1, (long)8, (long)8, (long)10, (long)5, (long)8, (long)5, (long)3, (long)10}))) == (1));\n assert(candidate((std::vector({(long)8, (long)8, (long)3, (long)6, (long)5, (long)6, (long)4}))) == (-1));\n assert(candidate((std::vector({(long)6, (long)9, (long)6, (long)7, (long)1, (long)4, (long)7, (long)1, (long)8, (long)8, (long)9, (long)8, (long)10, (long)10, (long)8, (long)4, (long)10, (long)4, (long)10, (long)1, (long)2, (long)9, (long)5, (long)7, (long)9}))) == (1));\n assert(candidate((std::vector({(long)1, (long)9, (long)10, (long)1, (long)3}))) == (1));\n assert(candidate((std::vector({(long)6, (long)9, (long)7, (long)5, (long)8, (long)7, (long)5, (long)3, (long)7, (long)5, (long)10, (long)10, (long)3, (long)6, (long)10, (long)2, (long)8, (long)6, (long)5, (long)4, (long)9, (long)5, (long)3, (long)10}))) == (5));\n assert(candidate((std::vector({(long)1}))) == (1));\n assert(candidate((std::vector({(long)8, (long)8, (long)10, (long)6, (long)4, (long)3, (long)5, (long)8, (long)2, (long)4, (long)2, (long)8, (long)4, (long)6, (long)10, (long)4, (long)2, (long)1, (long)10, (long)2, (long)1, (long)1, (long)5}))) == (4));\n assert(candidate((std::vector({(long)2, (long)10, (long)4, (long)8, (long)2, (long)10, (long)5, (long)1, (long)2, (long)9, (long)5, (long)5, (long)6, (long)3, (long)8, (long)6, (long)4, (long)10}))) == (2));\n assert(candidate((std::vector({(long)1, (long)6, (long)10, (long)1, (long)6, (long)9, (long)10, (long)8, (long)6, (long)8, (long)7, (long)3}))) == (1));\n assert(candidate((std::vector({(long)9, (long)2, (long)4, (long)1, (long)5, (long)1, (long)5, (long)2, (long)5, (long)7, (long)7, (long)7, (long)3, (long)10, (long)1, (long)5, (long)4, (long)2, (long)8, (long)4, (long)1, (long)9, (long)10, (long)7, (long)10, (long)2, (long)8, (long)10, (long)9, (long)4}))) == (4));\n assert(candidate((std::vector({(long)2, (long)6, (long)4, (long)2, (long)8, (long)7, (long)5, (long)6, (long)4, (long)10, (long)4, (long)6, (long)3, (long)7, (long)8, (long)8, (long)3, (long)1, (long)4, (long)2, (long)2, (long)10, (long)7}))) == (4));\n assert(candidate((std::vector({(long)9, (long)8, (long)6, (long)10, (long)2, (long)6, (long)10, (long)2, (long)7, (long)8, (long)10, (long)3, (long)8, (long)2, (long)6, (long)2, (long)3, (long)1}))) == (2));\n assert(candidate((std::vector({(long)5, (long)5, (long)3, (long)9, (long)5, (long)6, (long)3, (long)2, (long)8, (long)5, (long)6, (long)10, (long)10, (long)6, (long)8, (long)4, (long)10, (long)7, (long)7, (long)10, (long)8}))) == (-1));\n assert(candidate((std::vector({(long)10}))) == (-1));\n assert(candidate((std::vector({(long)9, (long)7, (long)7, (long)2, (long)4, (long)7, (long)2, (long)10, (long)9, (long)7, (long)5, (long)7, (long)2}))) == (2));\n assert(candidate((std::vector({(long)5, (long)4, (long)10, (long)2, (long)1, (long)1, (long)10, (long)3, (long)6, (long)1, (long)8}))) == (1));\n assert(candidate((std::vector({(long)7, (long)9, (long)9, (long)9, (long)3, (long)4, (long)1, (long)5, (long)9, (long)1, (long)2, (long)1, (long)1, (long)10, (long)7, (long)5, (long)6, (long)7, (long)6, (long)7, (long)7, (long)6}))) == (1));\n assert(candidate((std::vector({(long)3, (long)10, (long)10, (long)9, (long)2}))) == (-1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that takes a string and returns True if the string\n// length is a prime number or False otherwise\n// Examples\n// >>> prime_length((\"Hello\"))\n// (true)\n// >>> prime_length((\"abcdcba\"))\n// (true)\n// >>> prime_length((\"kittens\"))\n// (true)\n// >>> prime_length((\"orange\"))\n// (false)\nbool prime_length(std::string string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = prime_length;\n assert(candidate((\"Hello\")) == (true));\n assert(candidate((\"abcdcba\")) == (true));\n assert(candidate((\"kittens\")) == (true));\n assert(candidate((\"orange\")) == (false));\n assert(candidate((\"wow\")) == (true));\n assert(candidate((\"world\")) == (true));\n assert(candidate((\"MadaM\")) == (true));\n assert(candidate((\"Wow\")) == (true));\n assert(candidate((\"\")) == (false));\n assert(candidate((\"HI\")) == (true));\n assert(candidate((\"go\")) == (true));\n assert(candidate((\"gogo\")) == (false));\n assert(candidate((\"aaaaaaaaaaaaaaa\")) == (false));\n assert(candidate((\"Madam\")) == (true));\n assert(candidate((\"M\")) == (false));\n assert(candidate((\"0\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_58_common", - "language": "cpp", - "prompt": "#include\n#include\n// Return sorted unique common elements for two lists.\n// >>> common((std::vector({(long)1, (long)4, (long)3, (long)34, (long)653, (long)2, (long)5})), (std::vector({(long)5, (long)7, (long)1, (long)5, (long)9, (long)653, (long)121})))\n// (std::vector({(long)1, (long)5, (long)653}))\n// >>> common((std::vector({(long)5, (long)3, (long)2, (long)8})), (std::vector({(long)3, (long)2})))\n// (std::vector({(long)2, (long)3}))\nstd::vector common(std::vector l1, std::vector l2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = common;\n assert(candidate((std::vector({(long)1, (long)4, (long)3, (long)34, (long)653, (long)2, (long)5})), (std::vector({(long)5, (long)7, (long)1, (long)5, (long)9, (long)653, (long)121}))) == (std::vector({(long)1, (long)5, (long)653})));\n assert(candidate((std::vector({(long)5, (long)3, (long)2, (long)8})), (std::vector({(long)3, (long)2}))) == (std::vector({(long)2, (long)3})));\n assert(candidate((std::vector({(long)4, (long)3, (long)2, (long)8})), (std::vector({(long)3, (long)2, (long)4}))) == (std::vector({(long)2, (long)3, (long)4})));\n assert(candidate((std::vector({(long)4, (long)3, (long)2, (long)8})), (std::vector())) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "cpp", - "prompt": "#include\n#include\n// The Brazilian factorial is defined as:\n// brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n// where n > 0\n// For example:\n// >>> special_factorial((4))\n// (288)\n// The function will receive an integer as input and should return the special\n// factorial of this integer.\nlong special_factorial(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = special_factorial;\n assert(candidate((4)) == (288));\n assert(candidate((5)) == (34560));\n assert(candidate((7)) == (125411328000));\n assert(candidate((1)) == (1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "cpp", - "prompt": "#include\n#include\n// In this problem, you will implement a function that takes two lists of numbers,\n// and determines whether it is possible to perform an exchange of elements\n// between them to make lst1 a list of only even numbers.\n// There is no limit on the number of exchanged elements between lst1 and lst2.\n// If it is possible to exchange elements between the lst1 and lst2 to make\n// all the elements of lst1 to be even, return \"YES\".\n// Otherwise, return \"NO\".\n// For example:\n// >>> exchange((std::vector({(long)1, (long)2, (long)3, (long)4})), (std::vector({(long)1, (long)2, (long)3, (long)4})))\n// (\"YES\")\n// >>> exchange((std::vector({(long)1, (long)2, (long)3, (long)4})), (std::vector({(long)1, (long)5, (long)3, (long)4})))\n// (\"NO\")\n// It is assumed that the input lists will be non-empty.\nstd::string exchange(std::vector lst1, std::vector lst2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = exchange;\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4})), (std::vector({(long)1, (long)2, (long)3, (long)4}))) == (\"YES\"));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4})), (std::vector({(long)1, (long)5, (long)3, (long)4}))) == (\"NO\"));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4})), (std::vector({(long)2, (long)1, (long)4, (long)3}))) == (\"YES\"));\n assert(candidate((std::vector({(long)5, (long)7, (long)3})), (std::vector({(long)2, (long)6, (long)4}))) == (\"YES\"));\n assert(candidate((std::vector({(long)5, (long)7, (long)3})), (std::vector({(long)2, (long)6, (long)3}))) == (\"NO\"));\n assert(candidate((std::vector({(long)3, (long)2, (long)6, (long)1, (long)8, (long)9})), (std::vector({(long)3, (long)5, (long)5, (long)1, (long)1, (long)1}))) == (\"NO\"));\n assert(candidate((std::vector({(long)100, (long)200})), (std::vector({(long)200, (long)200}))) == (\"YES\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "cpp", - "prompt": "#include\n#include\n// Given a non-empty array of integers arr and an integer k, return\n// the sum of the elements with at most two digits from the first k elements of arr.\n// Example:\n// >>> add_elements((std::vector({(long)111, (long)21, (long)3, (long)4000, (long)5, (long)6, (long)7, (long)8, (long)9})), (4))\n// (24)\n// Constraints:\n// 1. 1 <= len(arr) <= 100\n// 2. 1 <= k <= len(arr)\nlong add_elements(std::vector arr, long k) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = add_elements;\n assert(candidate((std::vector({(long)1, (long)-2, (long)-3, (long)41, (long)57, (long)76, (long)87, (long)88, (long)99})), (3)) == (-4));\n assert(candidate((std::vector({(long)111, (long)121, (long)3, (long)4000, (long)5, (long)6})), (2)) == (0));\n assert(candidate((std::vector({(long)11, (long)21, (long)3, (long)90, (long)5, (long)6, (long)7, (long)8, (long)9})), (4)) == (125));\n assert(candidate((std::vector({(long)111, (long)21, (long)3, (long)4000, (long)5, (long)6, (long)7, (long)8, (long)9})), (4)) == (24));\n assert(candidate((std::vector({(long)1})), (1)) == (1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "cpp", - "prompt": "#include\n#include\n// A simple program which should return the value of x if n is \n// a prime number and should return the value of y otherwise.\n// Examples:\n// >>> x_or_y((7), (34), (12))\n// (34)\n// >>> x_or_y((15), (8), (5))\n// (5)\nlong x_or_y(long n, long x, long y) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = x_or_y;\n assert(candidate((7), (34), (12)) == (34));\n assert(candidate((15), (8), (5)) == (5));\n assert(candidate((3), (33), (5212)) == (33));\n assert(candidate((1259), (3), (52)) == (3));\n assert(candidate((7919), (-1), (12)) == (-1));\n assert(candidate((3609), (1245), (583)) == (583));\n assert(candidate((91), (56), (129)) == (129));\n assert(candidate((6), (34), (1234)) == (1234));\n assert(candidate((1), (2), (0)) == (0));\n assert(candidate((2), (2), (0)) == (2));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "cpp", - "prompt": "#include\n#include\n// Given length of a side and high return area for a triangle.\n// >>> triangle_area((5), (3))\n// (7.5)\nfloat triangle_area(long a, long h) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = triangle_area;\n assert(candidate((5), (3)) == (7.5));\n assert(candidate((2), (2)) == (2.0));\n assert(candidate((10), (8)) == (40.0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "cpp", - "prompt": "#include\n#include\n// Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n// the last couple centuries. However, what people don't know is Tribonacci sequence.\n// Tribonacci sequence is defined by the recurrence:\n// tri(1) = 3\n// tri(n) = 1 + n / 2, if n is even.\n// tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n// For example:\n// tri(2) = 1 + (2 / 2) = 2\n// tri(4) = 3\n// tri(3) = tri(2) + tri(1) + tri(4)\n// = 2 + 3 + 3 = 8 \n// You are given a non-negative integer number n, you have to a return a list of the \n// first n + 1 numbers of the Tribonacci sequence.\n// Examples:\n// >>> tri((3))\n// (std::vector({(long)1, (long)3, (long)2, (long)8}))\nstd::vector tri(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = tri;\n assert(candidate((3)) == (std::vector({(long)1, (long)3, (long)2, (long)8})));\n assert(candidate((4)) == (std::vector({(long)1, (long)3, (long)2, (long)8, (long)3})));\n assert(candidate((5)) == (std::vector({(long)1, (long)3, (long)2, (long)8, (long)3, (long)15})));\n assert(candidate((6)) == (std::vector({(long)1, (long)3, (long)2, (long)8, (long)3, (long)15, (long)4})));\n assert(candidate((7)) == (std::vector({(long)1, (long)3, (long)2, (long)8, (long)3, (long)15, (long)4, (long)24})));\n assert(candidate((8)) == (std::vector({(long)1, (long)3, (long)2, (long)8, (long)3, (long)15, (long)4, (long)24, (long)5})));\n assert(candidate((9)) == (std::vector({(long)1, (long)3, (long)2, (long)8, (long)3, (long)15, (long)4, (long)24, (long)5, (long)35})));\n assert(candidate((20)) == (std::vector({(long)1, (long)3, (long)2, (long)8, (long)3, (long)15, (long)4, (long)24, (long)5, (long)35, (long)6, (long)48, (long)7, (long)63, (long)8, (long)80, (long)9, (long)99, (long)10, (long)120, (long)11})));\n assert(candidate((0)) == (std::vector({(long)1})));\n assert(candidate((1)) == (std::vector({(long)1, (long)3})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a list of two strings, both strings consist of open\n// parentheses '(' or close parentheses ')' only.\n// Your job is to check if it is possible to concatenate the two strings in\n// some order, that the resulting string will be good.\n// A string S is considered to be good if and only if all parentheses in S\n// are balanced. For example: the string '(())()' is good, while the string\n// '())' is not.\n// Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n// Examples:\n// >>> match_parens((std::vector({(std::string)\"()(\", (std::string)\")\"})))\n// (\"Yes\")\n// >>> match_parens((std::vector({(std::string)\")\", (std::string)\")\"})))\n// (\"No\")\nstd::string match_parens(std::vector lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = match_parens;\n assert(candidate((std::vector({(std::string)\"()(\", (std::string)\")\"}))) == (\"Yes\"));\n assert(candidate((std::vector({(std::string)\")\", (std::string)\")\"}))) == (\"No\"));\n assert(candidate((std::vector({(std::string)\"(()(())\", (std::string)\"())())\"}))) == (\"No\"));\n assert(candidate((std::vector({(std::string)\")())\", (std::string)\"(()()(\"}))) == (\"Yes\"));\n assert(candidate((std::vector({(std::string)\"(())))\", (std::string)\"(()())((\"}))) == (\"Yes\"));\n assert(candidate((std::vector({(std::string)\"()\", (std::string)\"())\"}))) == (\"No\"));\n assert(candidate((std::vector({(std::string)\"(()(\", (std::string)\"()))()\"}))) == (\"Yes\"));\n assert(candidate((std::vector({(std::string)\"((((\", (std::string)\"((())\"}))) == (\"No\"));\n assert(candidate((std::vector({(std::string)\")(()\", (std::string)\"(()(\"}))) == (\"No\"));\n assert(candidate((std::vector({(std::string)\")(\", (std::string)\")(\"}))) == (\"No\"));\n assert(candidate((std::vector({(std::string)\"(\", (std::string)\")\"}))) == (\"Yes\"));\n assert(candidate((std::vector({(std::string)\")\", (std::string)\"(\"}))) == (\"Yes\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "cpp", - "prompt": "#include\n#include\n// From a list of integers, remove all elements that occur more than once.\n// Keep order of elements left the same as in the input.\n// >>> remove_duplicates((std::vector({(long)1, (long)2, (long)3, (long)2, (long)4})))\n// (std::vector({(long)1, (long)3, (long)4}))\nstd::vector remove_duplicates(std::vector numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = remove_duplicates;\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4}))) == (std::vector({(long)1, (long)2, (long)3, (long)4})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)2, (long)4, (long)3, (long)5}))) == (std::vector({(long)1, (long)4, (long)5})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "cpp", - "prompt": "#include\n#include\n// Return a greatest common divisor of two integers a and b\n// >>> greatest_common_divisor((3), (5))\n// (1)\n// >>> greatest_common_divisor((25), (15))\n// (5)\nlong greatest_common_divisor(long a, long b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = greatest_common_divisor;\n assert(candidate((3), (7)) == (1));\n assert(candidate((10), (15)) == (5));\n assert(candidate((49), (14)) == (7));\n assert(candidate((144), (60)) == (12));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "cpp", - "prompt": "#include\n#include\n// Checks if given string is a palindrome\n// >>> is_palindrome((\"\"))\n// (true)\n// >>> is_palindrome((\"aba\"))\n// (true)\n// >>> is_palindrome((\"aaaaa\"))\n// (true)\n// >>> is_palindrome((\"zbcd\"))\n// (false)\nbool is_palindrome(std::string text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = is_palindrome;\n assert(candidate((\"\")) == (true));\n assert(candidate((\"aba\")) == (true));\n assert(candidate((\"aaaaa\")) == (true));\n assert(candidate((\"zbcd\")) == (false));\n assert(candidate((\"xywyx\")) == (true));\n assert(candidate((\"xywyz\")) == (false));\n assert(candidate((\"xywzx\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "cpp", - "prompt": "#include\n#include\n// xs represent coefficients of a polynomial.\n// xs[0] + xs[1] * x + xs[2] * x^2 + ....\n// Return derivative of this polynomial in the same form.\n// >>> derivative((std::vector({(long)3, (long)1, (long)2, (long)4, (long)5})))\n// (std::vector({(long)1, (long)4, (long)12, (long)20}))\n// >>> derivative((std::vector({(long)1, (long)2, (long)3})))\n// (std::vector({(long)2, (long)6}))\nstd::vector derivative(std::vector xs) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = derivative;\n assert(candidate((std::vector({(long)3, (long)1, (long)2, (long)4, (long)5}))) == (std::vector({(long)1, (long)4, (long)12, (long)20})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3}))) == (std::vector({(long)2, (long)6})));\n assert(candidate((std::vector({(long)3, (long)2, (long)1}))) == (std::vector({(long)2, (long)2})));\n assert(candidate((std::vector({(long)3, (long)2, (long)1, (long)0, (long)4}))) == (std::vector({(long)2, (long)2, (long)0, (long)16})));\n assert(candidate((std::vector({(long)1}))) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "cpp", - "prompt": "#include\n#include\n// In this task, you will be given a string that represents a number of apples and oranges \n// that are distributed in a basket of fruit this basket contains \n// apples, oranges, and mango fruits. Given the string that represents the total number of \n// the oranges and apples and an integer that represent the total number of the fruits \n// in the basket return the number of the mango fruits in the basket.\n// for examble:\n// >>> fruit_distribution((\"5 apples and 6 oranges\"), (19))\n// (8)\n// >>> fruit_distribution((\"0 apples and 1 oranges\"), (3))\n// (2)\n// >>> fruit_distribution((\"2 apples and 3 oranges\"), (100))\n// (95)\n// >>> fruit_distribution((\"100 apples and 1 oranges\"), (120))\n// (19)\nlong fruit_distribution(std::string s, long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = fruit_distribution;\n assert(candidate((\"5 apples and 6 oranges\"), (19)) == (8));\n assert(candidate((\"5 apples and 6 oranges\"), (21)) == (10));\n assert(candidate((\"0 apples and 1 oranges\"), (3)) == (2));\n assert(candidate((\"1 apples and 0 oranges\"), (3)) == (2));\n assert(candidate((\"2 apples and 3 oranges\"), (100)) == (95));\n assert(candidate((\"2 apples and 3 oranges\"), (5)) == (0));\n assert(candidate((\"1 apples and 100 oranges\"), (120)) == (19));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that takes an integer a and returns True \n// if this ingeger is a cube of some integer number.\n// Note: you may assume the input is always valid.\n// Examples:\n// >>> iscube((1))\n// (true)\n// >>> iscube((2))\n// (false)\n// >>> iscube((-1))\n// (true)\n// >>> iscube((64))\n// (true)\n// >>> iscube((0))\n// (true)\n// >>> iscube((180))\n// (false)\nbool iscube(long a) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = iscube;\n assert(candidate((1)) == (true));\n assert(candidate((2)) == (false));\n assert(candidate((-1)) == (true));\n assert(candidate((64)) == (true));\n assert(candidate((180)) == (false));\n assert(candidate((1000)) == (true));\n assert(candidate((0)) == (true));\n assert(candidate((1729)) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "cpp", - "prompt": "#include\n#include\n// In this Kata, you have to sort an array of non-negative integers according to\n// number of ones in their binary representation in ascending order.\n// For similar number of ones, sort based on decimal value.\n// It must be implemented like this:\n// >>> sort_array((std::vector({(long)1, (long)5, (long)2, (long)3, (long)4})))\n// (std::vector({(long)1, (long)2, (long)3, (long)4, (long)5}))\n// >>> sort_array((std::vector({(long)-2, (long)-3, (long)-4, (long)-5, (long)-6})))\n// (std::vector({(long)-6, (long)-5, (long)-4, (long)-3, (long)-2}))\n// >>> sort_array((std::vector({(long)1, (long)0, (long)2, (long)3, (long)4})))\n// (std::vector({(long)0, (long)1, (long)2, (long)3, (long)4}))\nstd::vector sort_array(std::vector arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = sort_array;\n assert(candidate((std::vector({(long)1, (long)5, (long)2, (long)3, (long)4}))) == (std::vector({(long)1, (long)2, (long)4, (long)3, (long)5})));\n assert(candidate((std::vector({(long)-2, (long)-3, (long)-4, (long)-5, (long)-6}))) == (std::vector({(long)-4, (long)-2, (long)-6, (long)-5, (long)-3})));\n assert(candidate((std::vector({(long)1, (long)0, (long)2, (long)3, (long)4}))) == (std::vector({(long)0, (long)1, (long)2, (long)4, (long)3})));\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)2, (long)5, (long)77, (long)4, (long)5, (long)3, (long)5, (long)7, (long)2, (long)3, (long)4}))) == (std::vector({(long)2, (long)2, (long)4, (long)4, (long)3, (long)3, (long)5, (long)5, (long)5, (long)7, (long)77})));\n assert(candidate((std::vector({(long)3, (long)6, (long)44, (long)12, (long)32, (long)5}))) == (std::vector({(long)32, (long)3, (long)5, (long)6, (long)12, (long)44})));\n assert(candidate((std::vector({(long)2, (long)4, (long)8, (long)16, (long)32}))) == (std::vector({(long)2, (long)4, (long)8, (long)16, (long)32})));\n assert(candidate((std::vector({(long)2, (long)4, (long)8, (long)16, (long)32}))) == (std::vector({(long)2, (long)4, (long)8, (long)16, (long)32})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "cpp", - "prompt": "#include\n#include\n// Given a list of strings, where each string consists of only digits, return a list.\n// Each element i of the output should be \"the number of odd elements in the\n// string i of the input.\" where all the i's should be replaced by the number\n// of odd digits in the i'th string of the input.\n// >>> odd_count((std::vector({(std::string)\"1234567\"})))\n// (std::vector({(std::string)\"the number of odd elements 4n the str4ng 4 of the 4nput.\"}))\n// >>> odd_count((std::vector({(std::string)\"3\", (std::string)\"11111111\"})))\n// (std::vector({(std::string)\"the number of odd elements 1n the str1ng 1 of the 1nput.\", (std::string)\"the number of odd elements 8n the str8ng 8 of the 8nput.\"}))\nstd::vector odd_count(std::vector lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = odd_count;\n assert(candidate((std::vector({(std::string)\"1234567\"}))) == (std::vector({(std::string)\"the number of odd elements 4n the str4ng 4 of the 4nput.\"})));\n assert(candidate((std::vector({(std::string)\"3\", (std::string)\"11111111\"}))) == (std::vector({(std::string)\"the number of odd elements 1n the str1ng 1 of the 1nput.\", (std::string)\"the number of odd elements 8n the str8ng 8 of the 8nput.\"})));\n assert(candidate((std::vector({(std::string)\"271\", (std::string)\"137\", (std::string)\"314\"}))) == (std::vector({(std::string)\"the number of odd elements 2n the str2ng 2 of the 2nput.\", (std::string)\"the number of odd elements 3n the str3ng 3 of the 3nput.\", (std::string)\"the number of odd elements 2n the str2ng 2 of the 2nput.\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "cpp", - "prompt": "#include\n#include\n// brackets is a string of \"(\" and \")\".\n// return True if every opening bracket has a corresponding closing bracket.\n// >>> correct_bracketing((\"(\"))\n// (false)\n// >>> correct_bracketing((\"()\"))\n// (true)\n// >>> correct_bracketing((\"(()())\"))\n// (true)\n// >>> correct_bracketing((\")(()\"))\n// (false)\nbool correct_bracketing(std::string brackets) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = correct_bracketing;\n assert(candidate((\"()\")) == (true));\n assert(candidate((\"(()())\")) == (true));\n assert(candidate((\"()()(()())()\")) == (true));\n assert(candidate((\"()()((()()())())(()()(()))\")) == (true));\n assert(candidate((\"((()())))\")) == (false));\n assert(candidate((\")(()\")) == (false));\n assert(candidate((\"(\")) == (false));\n assert(candidate((\"((((\")) == (false));\n assert(candidate((\")\")) == (false));\n assert(candidate((\"(()\")) == (false));\n assert(candidate((\"()()(()())())(()\")) == (false));\n assert(candidate((\"()()(()())()))()\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "cpp", - "prompt": "#include\n#include\n// Task\n// Write a function that takes a string as input and returns the sum of the upper characters only'\n// ASCII codes.\n// Examples:\n// >>> digitSum((\"\"))\n// (0)\n// >>> digitSum((\"abAB\"))\n// (131)\n// >>> digitSum((\"abcCd\"))\n// (67)\n// >>> digitSum((\"helloE\"))\n// (69)\n// >>> digitSum((\"woArBld\"))\n// (131)\n// >>> digitSum((\"aAaaaXa\"))\n// (153)\nlong digitSum(std::string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = digitSum;\n assert(candidate((\"\")) == (0));\n assert(candidate((\"abAB\")) == (131));\n assert(candidate((\"abcCd\")) == (67));\n assert(candidate((\"helloE\")) == (69));\n assert(candidate((\"woArBld\")) == (131));\n assert(candidate((\"aAaaaXa\")) == (153));\n assert(candidate((\" How are yOu?\")) == (151));\n assert(candidate((\"You arE Very Smart\")) == (327));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that accepts a list of strings as a parameter,\n// deletes the strings that have odd lengths from it,\n// and returns the resulted list with a sorted order,\n// The list is always a list of strings and never an array of numbers,\n// and it may contain duplicates.\n// The order of the list should be ascending by length of each word, and you\n// should return the list sorted by that rule.\n// If two words have the same length, sort the list alphabetically.\n// The function should return a list of strings in sorted order.\n// You may assume that all words will have the same length.\n// For example:\n// >>> list_sort((std::vector({(std::string)\"aa\", (std::string)\"a\", (std::string)\"aaa\"})))\n// (std::vector({(std::string)\"aa\"}))\n// >>> list_sort((std::vector({(std::string)\"ab\", (std::string)\"a\", (std::string)\"aaa\", (std::string)\"cd\"})))\n// (std::vector({(std::string)\"ab\", (std::string)\"cd\"}))\nstd::vector sorted_list_sum(std::vector lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = sorted_list_sum;\n assert(candidate((std::vector({(std::string)\"aa\", (std::string)\"a\", (std::string)\"aaa\"}))) == (std::vector({(std::string)\"aa\"})));\n assert(candidate((std::vector({(std::string)\"school\", (std::string)\"AI\", (std::string)\"asdf\", (std::string)\"b\"}))) == (std::vector({(std::string)\"AI\", (std::string)\"asdf\", (std::string)\"school\"})));\n assert(candidate((std::vector({(std::string)\"d\", (std::string)\"b\", (std::string)\"c\", (std::string)\"a\"}))) == (std::vector()));\n assert(candidate((std::vector({(std::string)\"d\", (std::string)\"dcba\", (std::string)\"abcd\", (std::string)\"a\"}))) == (std::vector({(std::string)\"abcd\", (std::string)\"dcba\"})));\n assert(candidate((std::vector({(std::string)\"AI\", (std::string)\"ai\", (std::string)\"au\"}))) == (std::vector({(std::string)\"AI\", (std::string)\"ai\", (std::string)\"au\"})));\n assert(candidate((std::vector({(std::string)\"a\", (std::string)\"b\", (std::string)\"b\", (std::string)\"c\", (std::string)\"c\", (std::string)\"a\"}))) == (std::vector()));\n assert(candidate((std::vector({(std::string)\"aaaa\", (std::string)\"bbbb\", (std::string)\"dd\", (std::string)\"cc\"}))) == (std::vector({(std::string)\"cc\", (std::string)\"dd\", (std::string)\"aaaa\", (std::string)\"bbbb\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "cpp", - "prompt": "#include\n#include\n// You are given an array arr of integers and you need to return\n// sum of magnitudes of integers multiplied by product of all signs\n// of each number in the array, represented by 1, -1 or 0.\n// Note: return None for empty arr.\n// Example:\n// >>> prod_signs((std::vector({(long)1, (long)2, (long)2, (long)-4})))\n// 9\n// >>> prod_signs((std::vector({(long)0, (long)1})))\n// 0\n// >>> prod_signs((std::vector()))\n// std::nullopt\nstd::optional prod_signs(std::vector arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = prod_signs;\n assert(candidate((std::vector({(long)1, (long)2, (long)2, (long)-4}))) == -9);\n assert(candidate((std::vector({(long)0, (long)1}))) == 0);\n assert(candidate((std::vector({(long)1, (long)1, (long)1, (long)2, (long)3, (long)-1, (long)1}))) == -10);\n assert(candidate((std::vector())) == std::nullopt);\n assert(candidate((std::vector({(long)2, (long)4, (long)1, (long)2, (long)-1, (long)-1, (long)9}))) == 20);\n assert(candidate((std::vector({(long)-1, (long)1, (long)-1, (long)1}))) == 4);\n assert(candidate((std::vector({(long)-1, (long)1, (long)1, (long)1}))) == -4);\n assert(candidate((std::vector({(long)-1, (long)1, (long)1, (long)0}))) == 0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "cpp", - "prompt": "#include\n#include\n// Return list with elements incremented by 1.\n// >>> incr_list((std::vector({(long)1, (long)2, (long)3})))\n// (std::vector({(long)2, (long)3, (long)4}))\n// >>> incr_list((std::vector({(long)5, (long)3, (long)5, (long)2, (long)3, (long)3, (long)9, (long)0, (long)123})))\n// (std::vector({(long)6, (long)4, (long)6, (long)3, (long)4, (long)4, (long)10, (long)1, (long)124}))\nstd::vector incr_list(std::vector l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = incr_list;\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)3, (long)2, (long)1}))) == (std::vector({(long)4, (long)3, (long)2})));\n assert(candidate((std::vector({(long)5, (long)2, (long)5, (long)2, (long)3, (long)3, (long)9, (long)0, (long)123}))) == (std::vector({(long)6, (long)3, (long)6, (long)3, (long)4, (long)4, (long)10, (long)1, (long)124})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "cpp", - "prompt": "#include\n#include\n// From a given list of integers, generate a list of rolling maximum element found until given moment\n// in the sequence.\n// >>> rolling_max((std::vector({(long)1, (long)2, (long)3, (long)2, (long)3, (long)4, (long)2})))\n// (std::vector({(long)1, (long)2, (long)3, (long)3, (long)3, (long)4, (long)4}))\nstd::vector rolling_max(std::vector numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = rolling_max;\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4}))) == (std::vector({(long)1, (long)2, (long)3, (long)4})));\n assert(candidate((std::vector({(long)4, (long)3, (long)2, (long)1}))) == (std::vector({(long)4, (long)4, (long)4, (long)4})));\n assert(candidate((std::vector({(long)3, (long)2, (long)3, (long)100, (long)3}))) == (std::vector({(long)3, (long)3, (long)3, (long)100, (long)100})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "cpp", - "prompt": "#include\n#include\n// Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n// separate those group into separate strings and return the list of those.\n// Separate groups are balanced (each open brace is properly closed) and not nested within each other\n// Ignore any spaces in the input string.\n// >>> separate_paren_groups((\"( ) (( )) (( )( ))\"))\n// (std::vector({(std::string)\"()\", (std::string)\"(())\", (std::string)\"(()())\"}))\nstd::vector separate_paren_groups(std::string paren_string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = separate_paren_groups;\n assert(candidate((\"(()()) ((())) () ((())()())\")) == (std::vector({(std::string)\"(()())\", (std::string)\"((()))\", (std::string)\"()\", (std::string)\"((())()())\"})));\n assert(candidate((\"() (()) ((())) (((())))\")) == (std::vector({(std::string)\"()\", (std::string)\"(())\", (std::string)\"((()))\", (std::string)\"(((())))\"})));\n assert(candidate((\"(()(())((())))\")) == (std::vector({(std::string)\"(()(())((())))\"})));\n assert(candidate((\"( ) (( )) (( )( ))\")) == (std::vector({(std::string)\"()\", (std::string)\"(())\", (std::string)\"(()())\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "cpp", - "prompt": "#include\n#include\n// You will be given a string of words separated by commas or spaces. Your task is\n// to split the string into words and return an array of the words.\n// For example:\n// >>> words_string((\"Hi, my name is John\"))\n// (std::vector({(std::string)\"Hi\", (std::string)\"my\", (std::string)\"name\", (std::string)\"is\", (std::string)\"John\"}))\n// >>> words_string((\"One, two, three, four, five, six\"))\n// (std::vector({(std::string)\"One\", (std::string)\"two\", (std::string)\"three\", (std::string)\"four\", (std::string)\"five\", (std::string)\"six\"}))\nstd::vector words_string(std::string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = words_string;\n assert(candidate((\"Hi, my name is John\")) == (std::vector({(std::string)\"Hi\", (std::string)\"my\", (std::string)\"name\", (std::string)\"is\", (std::string)\"John\"})));\n assert(candidate((\"One, two, three, four, five, six\")) == (std::vector({(std::string)\"One\", (std::string)\"two\", (std::string)\"three\", (std::string)\"four\", (std::string)\"five\", (std::string)\"six\"})));\n assert(candidate((\"Hi, my name\")) == (std::vector({(std::string)\"Hi\", (std::string)\"my\", (std::string)\"name\"})));\n assert(candidate((\"One,, two, three, four, five, six,\")) == (std::vector({(std::string)\"One\", (std::string)\"two\", (std::string)\"three\", (std::string)\"four\", (std::string)\"five\", (std::string)\"six\"})));\n assert(candidate((\"\")) == (std::vector()));\n assert(candidate((\"ahmed , gamal\")) == (std::vector({(std::string)\"ahmed\", (std::string)\"gamal\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "cpp", - "prompt": "#include\n#include\nunion Union_long_float_std_string{\n long f0;\n float f1;\n std::string f2; Union_long_float_std_string(long _f0) : f0(_f0) {}\n Union_long_float_std_string(float _f1) : f1(_f1) {}\n Union_long_float_std_string(std::string _f2) : f2(_f2) {}\n ~Union_long_float_std_string() {}\n bool operator==(long f) {\n return f0 == f ;\n } bool operator==(float f) {\n return f1 == f ;\n } bool operator==(std::string f) {\n return f2 == f ;\n }\n};\nunion Union_long_float_std_string_std_nullopt{\n long f0;\n float f1;\n std::string f2;\n std::nullopt f3; Union_long_float_std_string_std_nullopt(long _f0) : f0(_f0) {}\n Union_long_float_std_string_std_nullopt(float _f1) : f1(_f1) {}\n Union_long_float_std_string_std_nullopt(std::string _f2) : f2(_f2) {}\n Union_long_float_std_string_std_nullopt(std::nullopt _f3) : f3(_f3) {}\n ~Union_long_float_std_string_std_nullopt() {}\n bool operator==(long f) {\n return f0 == f ;\n } bool operator==(float f) {\n return f1 == f ;\n } bool operator==(std::string f) {\n return f2 == f ;\n } bool operator==(std::nullopt f) {\n return f3 == f ;\n }\n};\n// Create a function that takes integers, floats, or strings representing\n// real numbers, and returns the larger variable in its given variable type.\n// Return None if the values are equal.\n// Note: If a real number is represented as a string, the floating point might be . or ,\n// >>> compare_one(1, 2.5)\n// 2.5\n// >>> compare_one(1, \"2,3\")\n// \"2,3\"\n// >>> compare_one(\"5,1\", \"6\")\n// \"6\"\n// >>> compare_one(\"1\", 1)\n// std::nullopt\nUnion_long_float_std_string_std_nullopt compare_one(Union_long_float_std_string a, Union_long_float_std_string b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = compare_one;\n assert(candidate(1, 2) == 2);\n assert(candidate(1, 2.5) == 2.5);\n assert(candidate(2, 3) == 3);\n assert(candidate(5, 6) == 6);\n assert(candidate(1, \"2,3\") == \"2,3\");\n assert(candidate(\"5,1\", \"6\") == \"6\");\n assert(candidate(\"1\", \"2\") == \"2\");\n assert(candidate(\"1\", 1) == std::nullopt);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "cpp", - "prompt": "#include\n#include\n// Filter given list of any python values only for integers\n// >>> filter_integers((std::vector({(std::string)\"a\", (std::string)3.14, (std::string)5})))\n// (std::vector({(long)5}))\n// >>> filter_integers((std::vector({1, 2, 3, \"abc\", std::map(), std::vector()})))\n// (std::vector({(long)1, (long)2, (long)3}))\nstd::vector filter_integers(std::vector values) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = filter_integers;\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({4, std::map(), std::vector(), 23.2, 9, \"adasd\"}))) == (std::vector({(long)4, (long)9})));\n assert(candidate((std::vector({3, \"c\", 3, 3, \"a\", \"b\"}))) == (std::vector({(long)3, (long)3, (long)3})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "cpp", - "prompt": "#include\n#include\n// This function takes a list l and returns a list l' such that\n// l' is identical to l in the odd indicies, while its values at the even indicies are equal\n// to the values of the even indicies of l, but sorted.\n// >>> sort_even((std::vector({(long)1, (long)2, (long)3})))\n// (std::vector({(long)1, (long)2, (long)3}))\n// >>> sort_even((std::vector({(long)5, (long)6, (long)3, (long)4})))\n// (std::vector({(long)3, (long)6, (long)5, (long)4}))\nstd::vector sort_even(std::vector l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = sort_even;\n assert(candidate((std::vector({(long)1, (long)2, (long)3}))) == (std::vector({(long)1, (long)2, (long)3})));\n assert(candidate((std::vector({(long)5, (long)3, (long)-5, (long)2, (long)-3, (long)3, (long)9, (long)0, (long)123, (long)1, (long)-10}))) == (std::vector({(long)-10, (long)3, (long)-5, (long)2, (long)-3, (long)3, (long)5, (long)0, (long)9, (long)1, (long)123})));\n assert(candidate((std::vector({(long)5, (long)8, (long)-12, (long)4, (long)23, (long)2, (long)3, (long)11, (long)12, (long)-10}))) == (std::vector({(long)-12, (long)8, (long)3, (long)4, (long)5, (long)2, (long)12, (long)11, (long)23, (long)-10})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "cpp", - "prompt": "#include\n#include\n// I think we all remember that feeling when the result of some long-awaited\n// event is finally known. The feelings and thoughts you have at that moment are\n// definitely worth noting down and comparing.\n// Your task is to determine if a person correctly guessed the results of a number of matches.\n// You are given two arrays of scores and guesses of equal length, where each index shows a match. \n// Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n// the value is 0, and if not, the value is the absolute difference between the guess and the score.\n// example:\n// >>> compare((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)1})), (std::vector({(long)1, (long)2, (long)3, (long)4, (long)2, (long)-2})))\n// (std::vector({(long)0, (long)0, (long)0, (long)0, (long)3, (long)3}))\n// >>> compare((std::vector({(long)0, (long)5, (long)0, (long)0, (long)0, (long)4})), (std::vector({(long)4, (long)1, (long)1, (long)0, (long)0, (long)-2})))\n// (std::vector({(long)4, (long)4, (long)1, (long)0, (long)0, (long)6}))\nstd::vector compare(std::vector game, std::vector guess) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = compare;\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)1})), (std::vector({(long)1, (long)2, (long)3, (long)4, (long)2, (long)-2}))) == (std::vector({(long)0, (long)0, (long)0, (long)0, (long)3, (long)3})));\n assert(candidate((std::vector({(long)0, (long)0, (long)0, (long)0, (long)0, (long)0})), (std::vector({(long)0, (long)0, (long)0, (long)0, (long)0, (long)0}))) == (std::vector({(long)0, (long)0, (long)0, (long)0, (long)0, (long)0})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3})), (std::vector({(long)-1, (long)-2, (long)-3}))) == (std::vector({(long)2, (long)4, (long)6})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)5})), (std::vector({(long)-1, (long)2, (long)3, (long)4}))) == (std::vector({(long)2, (long)0, (long)0, (long)1})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "cpp", - "prompt": "#include\n#include\n// Given a positive integer n, return a tuple that has the number of even and odd\n// integer palindromes that fall within the range(1, n), inclusive.\n// Example 1:\n// >>> even_odd_palindrome((3))\n// (std::make_tuple(1, 2))\n// Explanation:\n// Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n// Example 2:\n// >>> even_odd_palindrome((12))\n// (std::make_tuple(4, 6))\n// Explanation:\n// Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n// Note:\n// 1. 1 <= n <= 10^3\n// 2. returned tuple has the number of even and odd integer palindromes respectively.\nstd::tuple even_odd_palindrome(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = even_odd_palindrome;\n assert(candidate((123)) == (std::make_tuple(8, 13)));\n assert(candidate((12)) == (std::make_tuple(4, 6)));\n assert(candidate((3)) == (std::make_tuple(1, 2)));\n assert(candidate((63)) == (std::make_tuple(6, 8)));\n assert(candidate((25)) == (std::make_tuple(5, 6)));\n assert(candidate((19)) == (std::make_tuple(4, 6)));\n assert(candidate((9)) == (std::make_tuple(4, 5)));\n assert(candidate((1)) == (std::make_tuple(0, 1)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "cpp", - "prompt": "#include\n#include\n// The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fib4(0) -> 0\n// fib4(1) -> 0\n// fib4(2) -> 2\n// fib4(3) -> 0\n// fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n// Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n// >>> fib4((5))\n// (4)\n// >>> fib4((6))\n// (8)\n// >>> fib4((7))\n// (14)\nlong fib4(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = fib4;\n assert(candidate((5)) == (4));\n assert(candidate((8)) == (28));\n assert(candidate((10)) == (104));\n assert(candidate((12)) == (386));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "cpp", - "prompt": "#include\n#include\n// Given two positive integers a and b, return the even digits between a\n// and b, in ascending order.\n// For example:\n// >>> generate_integers((2), (8))\n// (std::vector({(long)2, (long)4, (long)6, (long)8}))\n// >>> generate_integers((8), (2))\n// (std::vector({(long)2, (long)4, (long)6, (long)8}))\n// >>> generate_integers((10), (14))\n// (std::vector())\nstd::vector generate_integers(long a, long b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = generate_integers;\n assert(candidate((2), (10)) == (std::vector({(long)2, (long)4, (long)6, (long)8})));\n assert(candidate((10), (2)) == (std::vector({(long)2, (long)4, (long)6, (long)8})));\n assert(candidate((132), (2)) == (std::vector({(long)2, (long)4, (long)6, (long)8})));\n assert(candidate((17), (89)) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "cpp", - "prompt": "#include\n#include\n// For a given list of input numbers, calculate Mean Absolute Deviation\n// around the mean of this dataset.\n// Mean Absolute Deviation is the average absolute difference between each\n// element and a centerpoint (mean in this case):\n// MAD = average | x - x_mean |\n// >>> mean_absolute_deviation((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0})))\n// (1.0)\nfloat mean_absolute_deviation(std::vector numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = mean_absolute_deviation;\n assert(candidate((std::vector({(float)1.0, (float)2.0}))) == (0.5));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0}))) == (1.0));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0, (float)5.0}))) == (1.2));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function encrypt that takes a string as an argument and\n// returns a string encrypted with the alphabet being rotated. \n// The alphabet should be rotated in a manner such that the letters \n// shift down by two multiplied to two places.\n// For example:\n// >>> encrypt((\"hi\"))\n// (\"lm\")\n// >>> encrypt((\"asdfghjkl\"))\n// (\"ewhjklnop\")\n// >>> encrypt((\"gf\"))\n// (\"kj\")\n// >>> encrypt((\"et\"))\n// (\"ix\")\nstd::string encrypt(std::string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = encrypt;\n assert(candidate((\"hi\")) == (\"lm\"));\n assert(candidate((\"asdfghjkl\")) == (\"ewhjklnop\"));\n assert(candidate((\"gf\")) == (\"kj\"));\n assert(candidate((\"et\")) == (\"ix\"));\n assert(candidate((\"faewfawefaewg\")) == (\"jeiajeaijeiak\"));\n assert(candidate((\"hellomyfriend\")) == (\"lippsqcjvmirh\"));\n assert(candidate((\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\")) == (\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\"));\n assert(candidate((\"a\")) == (\"e\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "cpp", - "prompt": "#include\n#include\n// Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n// The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n// as follows: start with any positive integer n. Then each term is obtained from the \n// previous term as follows: if the previous term is even, the next term is one half of \n// the previous term. If the previous term is odd, the next term is 3 times the previous\n// term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n// Note: \n// 1. Collatz(1) is [1].\n// 2. returned list sorted in increasing order.\n// For example:\n// get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n// >>> get_odd_collatz((5))\n// (std::vector({(long)1, (long)5}))\nstd::vector get_odd_collatz(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = get_odd_collatz;\n assert(candidate((14)) == (std::vector({(long)1, (long)5, (long)7, (long)11, (long)13, (long)17})));\n assert(candidate((5)) == (std::vector({(long)1, (long)5})));\n assert(candidate((12)) == (std::vector({(long)1, (long)3, (long)5})));\n assert(candidate((1)) == (std::vector({(long)1})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "cpp", - "prompt": "#include\n#include\n// Find how many times a given substring can be found in the original string. Count overlaping cases.\n// >>> how_many_times((\"\"), (\"a\"))\n// (0)\n// >>> how_many_times((\"aaa\"), (\"a\"))\n// (3)\n// >>> how_many_times((\"aaaa\"), (\"aa\"))\n// (3)\nlong how_many_times(std::string string, std::string substring) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = how_many_times;\n assert(candidate((\"\"), (\"x\")) == (0));\n assert(candidate((\"xyxyxyx\"), (\"x\")) == (4));\n assert(candidate((\"cacacacac\"), (\"cac\")) == (4));\n assert(candidate((\"john doe\"), (\"john\")) == (1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "cpp", - "prompt": "#include\n#include\n// We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n// numbers in the array will be randomly ordered. Your task is to determine if\n// it is possible to get an array sorted in non-decreasing order by performing \n// the following operation on the given array:\n// You are allowed to perform right shift operation any number of times.\n// One right shift operation means shifting all elements of the array by one\n// position in the right direction. The last element of the array will be moved to\n// the starting position in the array i.e. 0th index. \n// If it is possible to obtain the sorted array by performing the above operation\n// then return True else return False.\n// If the given array is empty then return True.\n// Note: The given list is guaranteed to have unique elements.\n// For Example:\n// >>> move_one_ball((std::vector({(long)3, (long)4, (long)5, (long)1, (long)2})))\n// (true)\n// Explanation: By performin 2 right shift operations, non-decreasing order can\n// be achieved for the given array.\n// >>> move_one_ball((std::vector({(long)3, (long)5, (long)4, (long)1, (long)2})))\n// (false)\n// Explanation:It is not possible to get non-decreasing order for the given\n// array by performing any number of right shift operations.\nbool move_one_ball(std::vector arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = move_one_ball;\n assert(candidate((std::vector({(long)3, (long)4, (long)5, (long)1, (long)2}))) == (true));\n assert(candidate((std::vector({(long)3, (long)5, (long)10, (long)1, (long)2}))) == (true));\n assert(candidate((std::vector({(long)4, (long)3, (long)1, (long)2}))) == (false));\n assert(candidate((std::vector({(long)3, (long)5, (long)4, (long)1, (long)2}))) == (false));\n assert(candidate((std::vector())) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function which sorts the given list of integers\n// in ascending order according to the sum of their digits.\n// Note: if there are several items with similar sum of their digits,\n// order them based on their index in original list.\n// For example:\n// >>> order_by_points((std::vector({(long)1, (long)11, (long)-1, (long)-11, (long)-12})))\n// (std::vector({(long)-1, (long)-11, (long)1, (long)-12, (long)11}))\n// >>> order_by_points((std::vector()))\n// (std::vector())\nstd::vector order_by_points(std::vector nums) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = order_by_points;\n assert(candidate((std::vector({(long)1, (long)11, (long)-1, (long)-11, (long)-12}))) == (std::vector({(long)-1, (long)-11, (long)1, (long)-12, (long)11})));\n assert(candidate((std::vector({(long)1234, (long)423, (long)463, (long)145, (long)2, (long)423, (long)423, (long)53, (long)6, (long)37, (long)3457, (long)3, (long)56, (long)0, (long)46}))) == (std::vector({(long)0, (long)2, (long)3, (long)6, (long)53, (long)423, (long)423, (long)423, (long)1234, (long)145, (long)37, (long)46, (long)56, (long)463, (long)3457})));\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)1, (long)-11, (long)-32, (long)43, (long)54, (long)-98, (long)2, (long)-3}))) == (std::vector({(long)-3, (long)-32, (long)-98, (long)-11, (long)1, (long)2, (long)43, (long)54})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6, (long)7, (long)8, (long)9, (long)10, (long)11}))) == (std::vector({(long)1, (long)10, (long)2, (long)11, (long)3, (long)4, (long)5, (long)6, (long)7, (long)8, (long)9})));\n assert(candidate((std::vector({(long)0, (long)6, (long)6, (long)-76, (long)-21, (long)23, (long)4}))) == (std::vector({(long)-76, (long)-21, (long)0, (long)4, (long)23, (long)6, (long)6})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "cpp", - "prompt": "#include\n#include\n// Return list of prime factors of given integer in the order from smallest to largest.\n// Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n// Input number should be equal to the product of all factors\n// >>> factorize((8))\n// (std::vector({(long)2, (long)2, (long)2}))\n// >>> factorize((25))\n// (std::vector({(long)5, (long)5}))\n// >>> factorize((70))\n// (std::vector({(long)2, (long)5, (long)7}))\nstd::vector factorize(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = factorize;\n assert(candidate((2)) == (std::vector({(long)2})));\n assert(candidate((4)) == (std::vector({(long)2, (long)2})));\n assert(candidate((8)) == (std::vector({(long)2, (long)2, (long)2})));\n assert(candidate((57)) == (std::vector({(long)3, (long)19})));\n assert(candidate((3249)) == (std::vector({(long)3, (long)3, (long)19, (long)19})));\n assert(candidate((185193)) == (std::vector({(long)3, (long)3, (long)3, (long)19, (long)19, (long)19})));\n assert(candidate((20577)) == (std::vector({(long)3, (long)19, (long)19, (long)19})));\n assert(candidate((18)) == (std::vector({(long)2, (long)3, (long)3})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "cpp", - "prompt": "#include\n#include\n// Return True if all numbers in the list l are below threshold t.\n// >>> below_threshold((std::vector({(long)1, (long)2, (long)4, (long)10})), (100))\n// (true)\n// >>> below_threshold((std::vector({(long)1, (long)20, (long)4, (long)10})), (5))\n// (false)\nbool below_threshold(std::vector l, long t) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = below_threshold;\n assert(candidate((std::vector({(long)1, (long)2, (long)4, (long)10})), (100)) == (true));\n assert(candidate((std::vector({(long)1, (long)20, (long)4, (long)10})), (5)) == (false));\n assert(candidate((std::vector({(long)1, (long)20, (long)4, (long)10})), (21)) == (true));\n assert(candidate((std::vector({(long)1, (long)20, (long)4, (long)10})), (22)) == (true));\n assert(candidate((std::vector({(long)1, (long)8, (long)4, (long)10})), (11)) == (true));\n assert(candidate((std::vector({(long)1, (long)8, (long)4, (long)10})), (10)) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "cpp", - "prompt": "#include\n#include\nunion Union_std_string_long{\n std::string f0;\n long f1; Union_std_string_long(std::string _f0) : f0(_f0) {}\n Union_std_string_long(long _f1) : f1(_f1) {}\n ~Union_std_string_long() {}\n bool operator==(std::string f) {\n return f0 == f ;\n } bool operator==(long f) {\n return f1 == f ;\n }\n};\n// You are given two positive integers n and m, and your task is to compute the\n// average of the integers from n through m (including n and m). \n// Round the answer to the nearest integer and convert that to binary.\n// If n is greater than m, return -1.\n// Example:\n// >>> rounded_avg((1), (5))\n// \"0b11\"\n// >>> rounded_avg((7), (5))\n// -1\n// >>> rounded_avg((10), (20))\n// \"0b1111\"\n// >>> rounded_avg((20), (33))\n// \"0b11010\"\nUnion_std_string_long rounded_avg(long n, long m) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = rounded_avg;\n assert(candidate((1), (5)) == \"0b11\");\n assert(candidate((7), (13)) == \"0b1010\");\n assert(candidate((964), (977)) == \"0b1111001010\");\n assert(candidate((996), (997)) == \"0b1111100100\");\n assert(candidate((560), (851)) == \"0b1011000010\");\n assert(candidate((185), (546)) == \"0b101101110\");\n assert(candidate((362), (496)) == \"0b110101101\");\n assert(candidate((350), (902)) == \"0b1001110010\");\n assert(candidate((197), (233)) == \"0b11010111\");\n assert(candidate((7), (5)) == -1);\n assert(candidate((5), (1)) == -1);\n assert(candidate((5), (5)) == \"0b101\");\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "cpp", - "prompt": "#include\n#include\n// Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n// For each of the group, output the deepest level of nesting of parentheses.\n// E.g. (()()) has maximum two levels of nesting while ((())) has three.\n// >>> parse_nested_parens((\"(()()) ((())) () ((())()())\"))\n// (std::vector({(long)2, (long)3, (long)1, (long)3}))\nstd::vector parse_nested_parens(std::string paren_string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = parse_nested_parens;\n assert(candidate((\"(()()) ((())) () ((())()())\")) == (std::vector({(long)2, (long)3, (long)1, (long)3})));\n assert(candidate((\"() (()) ((())) (((())))\")) == (std::vector({(long)1, (long)2, (long)3, (long)4})));\n assert(candidate((\"(()(())((())))\")) == (std::vector({(long)4})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "cpp", - "prompt": "#include\n#include\n// Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n// Examples\n// >>> solution((std::vector({(long)5, (long)8, (long)7, (long)1})))\n// (12)\n// >>> solution((std::vector({(long)3, (long)3, (long)3, (long)3, (long)3})))\n// (9)\n// >>> solution((std::vector({(long)30, (long)13, (long)24, (long)321})))\n// (0)\nlong solution(std::vector lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = solution;\n assert(candidate((std::vector({(long)5, (long)8, (long)7, (long)1}))) == (12));\n assert(candidate((std::vector({(long)3, (long)3, (long)3, (long)3, (long)3}))) == (9));\n assert(candidate((std::vector({(long)30, (long)13, (long)24, (long)321}))) == (0));\n assert(candidate((std::vector({(long)5, (long)9}))) == (5));\n assert(candidate((std::vector({(long)2, (long)4, (long)8}))) == (0));\n assert(candidate((std::vector({(long)30, (long)13, (long)23, (long)32}))) == (23));\n assert(candidate((std::vector({(long)3, (long)13, (long)2, (long)9}))) == (3));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a positive integer n. You have to create an integer array a of length n.\n// For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n// Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n// and a[i] + a[j] + a[k] is a multiple of 3.\n// Example :\n// >>> get_max_triples((5))\n// (1)\n// Explanation: \n// a = [1, 3, 7, 13, 21]\n// The only valid triple is (1, 7, 13).\nlong get_max_triples(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = get_max_triples;\n assert(candidate((5)) == (1));\n assert(candidate((6)) == (4));\n assert(candidate((10)) == (36));\n assert(candidate((100)) == (53361));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "cpp", - "prompt": "#include\n#include\n// There are eight planets in our solar system: the closerst to the Sun \n// is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n// Uranus, Neptune.\n// Write a function that takes two planet names as strings planet1 and planet2. \n// The function should return a tuple containing all planets whose orbits are \n// located between the orbit of planet1 and the orbit of planet2, sorted by \n// the proximity to the sun. \n// The function should return an empty tuple if planet1 or planet2\n// are not correct planet names. \n// Examples\n// >>> bf((\"Jupiter\"), (\"Neptune\"))\n// (std::vector({(std::string)\"Saturn\", (std::string)\"Uranus\"}))\n// >>> bf((\"Earth\"), (\"Mercury\"))\n// (std::vector(\"Venus\"))\n// >>> bf((\"Mercury\"), (\"Uranus\"))\n// (std::vector({(std::string)\"Venus\", (std::string)\"Earth\", (std::string)\"Mars\", (std::string)\"Jupiter\", (std::string)\"Saturn\"}))\nstd::vector bf(std::string planet1, std::string planet2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = bf;\n assert(candidate((\"Jupiter\"), (\"Neptune\")) == (std::vector({(std::string)\"Saturn\", (std::string)\"Uranus\"})));\n assert(candidate((\"Earth\"), (\"Mercury\")) == (std::vector({(std::string)\"Venus\"})));\n assert(candidate((\"Mercury\"), (\"Uranus\")) == (std::vector({(std::string)\"Venus\", (std::string)\"Earth\", (std::string)\"Mars\", (std::string)\"Jupiter\", (std::string)\"Saturn\"})));\n assert(candidate((\"Neptune\"), (\"Venus\")) == (std::vector({(std::string)\"Earth\", (std::string)\"Mars\", (std::string)\"Jupiter\", (std::string)\"Saturn\", (std::string)\"Uranus\"})));\n assert(candidate((\"Earth\"), (\"Earth\")) == (std::vector()));\n assert(candidate((\"Mars\"), (\"Earth\")) == (std::vector()));\n assert(candidate((\"Jupiter\"), (\"Makemake\")) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a list of integers.\n// Write a function next_smallest() that returns the 2nd smallest element of the list.\n// Return None if there is no such element.\n// >>> next_smallest((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5})))\n// 2\n// >>> next_smallest((std::vector({(long)5, (long)1, (long)4, (long)3, (long)2})))\n// 2\n// >>> next_smallest((std::vector()))\n// std::nullopt\n// >>> next_smallest((std::vector({(long)1, (long)1})))\n// std::nullopt\nstd::optional next_smallest(std::vector lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = next_smallest;\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5}))) == 2);\n assert(candidate((std::vector({(long)5, (long)1, (long)4, (long)3, (long)2}))) == 2);\n assert(candidate((std::vector())) == std::nullopt);\n assert(candidate((std::vector({(long)1, (long)1}))) == std::nullopt);\n assert(candidate((std::vector({(long)1, (long)1, (long)1, (long)1, (long)0}))) == 1);\n assert(candidate((std::vector({(long)1, (long)1}))) == std::nullopt);\n assert(candidate((std::vector({(long)-35, (long)34, (long)12, (long)-45}))) == -35);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "cpp", - "prompt": "#include\n#include\n// Input is a space-delimited string of numberals from 'zero' to 'nine'.\n// Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n// Return the string with numbers sorted from smallest to largest\n// >>> sort_numbers((\"three one five\"))\n// (\"one three five\")\nstd::string sort_numbers(std::string numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = sort_numbers;\n assert(candidate((\"\")) == (\"\"));\n assert(candidate((\"three\")) == (\"three\"));\n assert(candidate((\"three five nine\")) == (\"three five nine\"));\n assert(candidate((\"five zero four seven nine eight\")) == (\"zero four five seven eight nine\"));\n assert(candidate((\"six five four three two one zero\")) == (\"zero one two three four five six\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "cpp", - "prompt": "#include\n#include\n// You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n// >>> cycpattern_check((\"abcd\"), (\"abd\"))\n// (false)\n// >>> cycpattern_check((\"hello\"), (\"ell\"))\n// (true)\n// >>> cycpattern_check((\"whassup\"), (\"psus\"))\n// (false)\n// >>> cycpattern_check((\"abab\"), (\"baa\"))\n// (true)\n// >>> cycpattern_check((\"efef\"), (\"eeff\"))\n// (false)\n// >>> cycpattern_check((\"himenss\"), (\"simen\"))\n// (true)\nbool cycpattern_check(std::string a, std::string b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = cycpattern_check;\n assert(candidate((\"xyzw\"), (\"xyw\")) == (false));\n assert(candidate((\"yello\"), (\"ell\")) == (true));\n assert(candidate((\"whattup\"), (\"ptut\")) == (false));\n assert(candidate((\"efef\"), (\"fee\")) == (true));\n assert(candidate((\"abab\"), (\"aabb\")) == (false));\n assert(candidate((\"winemtt\"), (\"tinem\")) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "cpp", - "prompt": "#include\n#include\n// You will be given a number in decimal form and your task is to convert it to\n// binary format. The function should return a string, with each character representing a binary\n// number. Each character in the string will be '0' or '1'.\n// There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n// The extra characters are there to help with the format.\n// Examples:\n// >>> decimal_to_binary((15))\n// (\"db1111db\")\n// >>> decimal_to_binary((32))\n// (\"db100000db\")\nstd::string decimal_to_binary(long decimal) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = decimal_to_binary;\n assert(candidate((0)) == (\"db0db\"));\n assert(candidate((32)) == (\"db100000db\"));\n assert(candidate((103)) == (\"db1100111db\"));\n assert(candidate((15)) == (\"db1111db\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "cpp", - "prompt": "#include\n#include\n// Filter an input list of strings only for ones that contain given substring\n// >>> filter_by_substring((std::vector()), (\"a\"))\n// (std::vector())\n// >>> filter_by_substring((std::vector({(std::string)\"abc\", (std::string)\"bacd\", (std::string)\"cde\", (std::string)\"array\"})), (\"a\"))\n// (std::vector({(std::string)\"abc\", (std::string)\"bacd\", (std::string)\"array\"}))\nstd::vector filter_by_substring(std::vector strings, std::string substring) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = filter_by_substring;\n assert(candidate((std::vector()), (\"john\")) == (std::vector()));\n assert(candidate((std::vector({(std::string)\"xxx\", (std::string)\"asd\", (std::string)\"xxy\", (std::string)\"john doe\", (std::string)\"xxxAAA\", (std::string)\"xxx\"})), (\"xxx\")) == (std::vector({(std::string)\"xxx\", (std::string)\"xxxAAA\", (std::string)\"xxx\"})));\n assert(candidate((std::vector({(std::string)\"xxx\", (std::string)\"asd\", (std::string)\"aaaxxy\", (std::string)\"john doe\", (std::string)\"xxxAAA\", (std::string)\"xxx\"})), (\"xx\")) == (std::vector({(std::string)\"xxx\", (std::string)\"aaaxxy\", (std::string)\"xxxAAA\", (std::string)\"xxx\"})));\n assert(candidate((std::vector({(std::string)\"grunt\", (std::string)\"trumpet\", (std::string)\"prune\", (std::string)\"gruesome\"})), (\"run\")) == (std::vector({(std::string)\"grunt\", (std::string)\"prune\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "cpp", - "prompt": "#include\n#include\n// Given an integer. return a tuple that has the number of even and odd digits respectively.\n// Example:\n// >>> even_odd_count((-12))\n// (std::make_tuple(1, 1))\n// >>> even_odd_count((123))\n// (std::make_tuple(1, 2))\nstd::tuple even_odd_count(long num) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = even_odd_count;\n assert(candidate((7)) == (std::make_tuple(0, 1)));\n assert(candidate((-78)) == (std::make_tuple(1, 1)));\n assert(candidate((3452)) == (std::make_tuple(2, 2)));\n assert(candidate((346211)) == (std::make_tuple(3, 3)));\n assert(candidate((-345821)) == (std::make_tuple(3, 3)));\n assert(candidate((-2)) == (std::make_tuple(1, 0)));\n assert(candidate((-45347)) == (std::make_tuple(2, 3)));\n assert(candidate((0)) == (std::make_tuple(1, 0)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that accepts a list of strings.\n// The list contains different words. Return the word with maximum number\n// of unique characters. If multiple strings have maximum number of unique\n// characters, return the one which comes first in lexicographical order.\n// >>> find_max((std::vector({(std::string)\"name\", (std::string)\"of\", (std::string)\"string\"})))\n// (\"string\")\n// >>> find_max((std::vector({(std::string)\"name\", (std::string)\"enam\", (std::string)\"game\"})))\n// (\"enam\")\n// >>> find_max((std::vector({(std::string)\"aaaaaaa\", (std::string)\"bb\", (std::string)\"cc\"})))\n// (\"aaaaaaa\")\nstd::string find_max(std::vector words) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = find_max;\n assert(candidate((std::vector({(std::string)\"name\", (std::string)\"of\", (std::string)\"string\"}))) == (\"string\"));\n assert(candidate((std::vector({(std::string)\"name\", (std::string)\"enam\", (std::string)\"game\"}))) == (\"enam\"));\n assert(candidate((std::vector({(std::string)\"aaaaaaa\", (std::string)\"bb\", (std::string)\"cc\"}))) == (\"aaaaaaa\"));\n assert(candidate((std::vector({(std::string)\"abc\", (std::string)\"cba\"}))) == (\"abc\"));\n assert(candidate((std::vector({(std::string)\"play\", (std::string)\"this\", (std::string)\"game\", (std::string)\"of\", (std::string)\"footbott\"}))) == (\"footbott\"));\n assert(candidate((std::vector({(std::string)\"we\", (std::string)\"are\", (std::string)\"gonna\", (std::string)\"rock\"}))) == (\"gonna\"));\n assert(candidate((std::vector({(std::string)\"we\", (std::string)\"are\", (std::string)\"a\", (std::string)\"mad\", (std::string)\"nation\"}))) == (\"nation\"));\n assert(candidate((std::vector({(std::string)\"this\", (std::string)\"is\", (std::string)\"a\", (std::string)\"prrk\"}))) == (\"this\"));\n assert(candidate((std::vector({(std::string)\"b\"}))) == (\"b\"));\n assert(candidate((std::vector({(std::string)\"play\", (std::string)\"play\", (std::string)\"play\"}))) == (\"play\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "cpp", - "prompt": "#include\n#include\n// Given a positive integer n, return the count of the numbers of n-digit\n// positive integers that start or end with 1.\nlong starts_one_ends(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = starts_one_ends;\n assert(candidate((1)) == (1));\n assert(candidate((2)) == (18));\n assert(candidate((3)) == (180));\n assert(candidate((4)) == (1800));\n assert(candidate((5)) == (18000));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function that returns a tuple (a, b), where 'a' is\n// the largest of negative integers, and 'b' is the smallest\n// of positive integers in a list.\n// If there is no negative or positive integers, return them as None.\n// Examples:\n// >>> largest_smallest_integers((std::vector({(long)2, (long)4, (long)1, (long)3, (long)5, (long)7})))\n// std::make_tuple(std::optional(std::nullopt), std::optional(1))\n// >>> largest_smallest_integers((std::vector()))\n// std::make_tuple(std::optional(std::nullopt), std::optional(std::nullopt))\n// >>> largest_smallest_integers((std::vector({(long)0})))\n// std::make_tuple(std::optional(std::nullopt), std::optional(std::nullopt))\nstd::tuple, std::optional> largest_smallest_integers(std::vector lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = largest_smallest_integers;\n assert(candidate((std::vector({(long)2, (long)4, (long)1, (long)3, (long)5, (long)7}))) == std::make_tuple(std::optional(std::nullopt), std::optional(1)));\n assert(candidate((std::vector({(long)2, (long)4, (long)1, (long)3, (long)5, (long)7, (long)0}))) == std::make_tuple(std::optional(std::nullopt), std::optional(1)));\n assert(candidate((std::vector({(long)1, (long)3, (long)2, (long)4, (long)5, (long)6, (long)-2}))) == std::make_tuple(-2, 1));\n assert(candidate((std::vector({(long)4, (long)5, (long)3, (long)6, (long)2, (long)7, (long)-7}))) == std::make_tuple(-7, 2));\n assert(candidate((std::vector({(long)7, (long)3, (long)8, (long)4, (long)9, (long)2, (long)5, (long)-9}))) == std::make_tuple(-9, 2));\n assert(candidate((std::vector())) == std::make_tuple(std::optional(std::nullopt), std::optional(std::nullopt)));\n assert(candidate((std::vector({(long)0}))) == std::make_tuple(std::optional(std::nullopt), std::optional(std::nullopt)));\n assert(candidate((std::vector({(long)-1, (long)-3, (long)-5, (long)-6}))) == std::make_tuple(std::optional(-1), std::optional(std::nullopt)));\n assert(candidate((std::vector({(long)-1, (long)-3, (long)-5, (long)-6, (long)0}))) == std::make_tuple(std::optional(-1), std::optional(std::nullopt)));\n assert(candidate((std::vector({(long)-6, (long)-4, (long)-4, (long)-3, (long)1}))) == std::make_tuple(-3, 1));\n assert(candidate((std::vector({(long)-6, (long)-4, (long)-4, (long)-3, (long)-100, (long)1}))) == std::make_tuple(-3, 1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "cpp", - "prompt": "#include\n#include\n// \"Given an array representing a branch of a tree that has non-negative integer nodes\n// your task is to pluck one of the nodes and return it.\n// The plucked node should be the node with the smallest even value.\n// If multiple nodes with the same smallest even value are found return the node that has smallest index.\n// The plucked node should be returned in a list, [ smalest_value, its index ],\n// If there are no even values or the given array is empty, return [].\n// Example 1:\n// >>> pluck((std::vector({(long)4, (long)2, (long)3})))\n// (std::vector({(long)2, (long)1}))\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 2:\n// >>> pluck((std::vector({(long)1, (long)2, (long)3})))\n// (std::vector({(long)2, (long)1}))\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 3:\n// >>> pluck((std::vector()))\n// (std::vector())\n// Example 4:\n// >>> pluck((std::vector({(long)5, (long)0, (long)3, (long)0, (long)4, (long)2})))\n// (std::vector({(long)0, (long)1}))\n// Explanation: 0 is the smallest value, but there are two zeros,\n// so we will choose the first zero, which has the smallest index.\n// Constraints:\n// * 1 <= nodes.length <= 10000\n// * 0 <= node.value\nstd::vector pluck(std::vector arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = pluck;\n assert(candidate((std::vector({(long)4, (long)2, (long)3}))) == (std::vector({(long)2, (long)1})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3}))) == (std::vector({(long)2, (long)1})));\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)5, (long)0, (long)3, (long)0, (long)4, (long)2}))) == (std::vector({(long)0, (long)1})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)0, (long)5, (long)3}))) == (std::vector({(long)0, (long)3})));\n assert(candidate((std::vector({(long)5, (long)4, (long)8, (long)4, (long)8}))) == (std::vector({(long)4, (long)1})));\n assert(candidate((std::vector({(long)7, (long)6, (long)7, (long)1}))) == (std::vector({(long)6, (long)1})));\n assert(candidate((std::vector({(long)7, (long)9, (long)7, (long)1}))) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function count_nums which takes an array of integers and returns\n// the number of elements which has a sum of digits > 0.\n// If a number is negative, then its first signed digit will be negative:\n// e.g. -123 has signed digits -1, 2, and 3.\n// >>> count_nums((std::vector()))\n// (0)\n// >>> count_nums((std::vector({(long)-1, (long)11, (long)-11})))\n// (1)\n// >>> count_nums((std::vector({(long)1, (long)1, (long)2})))\n// (3)\nlong count_nums(std::vector arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = count_nums;\n assert(candidate((std::vector())) == (0));\n assert(candidate((std::vector({(long)-1, (long)-2, (long)0}))) == (0));\n assert(candidate((std::vector({(long)1, (long)1, (long)2, (long)-2, (long)3, (long)4, (long)5}))) == (6));\n assert(candidate((std::vector({(long)1, (long)6, (long)9, (long)-6, (long)0, (long)1, (long)5}))) == (5));\n assert(candidate((std::vector({(long)1, (long)100, (long)98, (long)-7, (long)1, (long)-1}))) == (4));\n assert(candidate((std::vector({(long)12, (long)23, (long)34, (long)-45, (long)-56, (long)0}))) == (5));\n assert(candidate((std::vector({(long)0, (long)1}))) == (1));\n assert(candidate((std::vector({(long)1}))) == (1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "cpp", - "prompt": "#include\n#include\n// Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n// each cell of the grid contains a value. Every integer in the range [1, N * N]\n// inclusive appears exactly once on the cells of the grid.\n// You have to find the minimum path of length k in the grid. You can start\n// from any cell, and in each step you can move to any of the neighbor cells,\n// in other words, you can go to cells which share an edge with you current\n// cell.\n// Please note that a path of length k means visiting exactly k cells (not\n// necessarily distinct).\n// You CANNOT go off the grid.\n// A path A (of length k) is considered less than a path B (of length k) if\n// after making the ordered lists of the values on the cells that A and B go\n// through (let's call them lst_A and lst_B), lst_A is lexicographically less\n// than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n// such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n// lst_A[j] = lst_B[j].\n// It is guaranteed that the answer is unique.\n// Return an ordered list of the values on the cells that the minimum path go through.\n// Examples: \n// >>> minPath((std::vector>({(std::vector)std::vector({(long)1, (long)2, (long)3}), (std::vector)std::vector({(long)4, (long)5, (long)6}), (std::vector)std::vector({(long)7, (long)8, (long)9})})), (3))\n// (std::vector({(long)1, (long)2, (long)1}))\n// >>> minPath((std::vector>({(std::vector)std::vector({(long)5, (long)9, (long)3}), (std::vector)std::vector({(long)4, (long)1, (long)6}), (std::vector)std::vector({(long)7, (long)8, (long)2})})), (1))\n// (std::vector({(long)1}))\nstd::vector minPath(std::vector> grid, long k) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = minPath;\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)2, (long)3}), (std::vector)std::vector({(long)4, (long)5, (long)6}), (std::vector)std::vector({(long)7, (long)8, (long)9})})), (3)) == (std::vector({(long)1, (long)2, (long)1})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)5, (long)9, (long)3}), (std::vector)std::vector({(long)4, (long)1, (long)6}), (std::vector)std::vector({(long)7, (long)8, (long)2})})), (1)) == (std::vector({(long)1})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)2, (long)3, (long)4}), (std::vector)std::vector({(long)5, (long)6, (long)7, (long)8}), (std::vector)std::vector({(long)9, (long)10, (long)11, (long)12}), (std::vector)std::vector({(long)13, (long)14, (long)15, (long)16})})), (4)) == (std::vector({(long)1, (long)2, (long)1, (long)2})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)6, (long)4, (long)13, (long)10}), (std::vector)std::vector({(long)5, (long)7, (long)12, (long)1}), (std::vector)std::vector({(long)3, (long)16, (long)11, (long)15}), (std::vector)std::vector({(long)8, (long)14, (long)9, (long)2})})), (7)) == (std::vector({(long)1, (long)10, (long)1, (long)10, (long)1, (long)10, (long)1})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)8, (long)14, (long)9, (long)2}), (std::vector)std::vector({(long)6, (long)4, (long)13, (long)15}), (std::vector)std::vector({(long)5, (long)7, (long)1, (long)12}), (std::vector)std::vector({(long)3, (long)10, (long)11, (long)16})})), (5)) == (std::vector({(long)1, (long)7, (long)1, (long)7, (long)1})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)11, (long)8, (long)7, (long)2}), (std::vector)std::vector({(long)5, (long)16, (long)14, (long)4}), (std::vector)std::vector({(long)9, (long)3, (long)15, (long)6}), (std::vector)std::vector({(long)12, (long)13, (long)10, (long)1})})), (9)) == (std::vector({(long)1, (long)6, (long)1, (long)6, (long)1, (long)6, (long)1, (long)6, (long)1})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)12, (long)13, (long)10, (long)1}), (std::vector)std::vector({(long)9, (long)3, (long)15, (long)6}), (std::vector)std::vector({(long)5, (long)16, (long)14, (long)4}), (std::vector)std::vector({(long)11, (long)8, (long)7, (long)2})})), (12)) == (std::vector({(long)1, (long)6, (long)1, (long)6, (long)1, (long)6, (long)1, (long)6, (long)1, (long)6, (long)1, (long)6})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)2, (long)7, (long)4}), (std::vector)std::vector({(long)3, (long)1, (long)5}), (std::vector)std::vector({(long)6, (long)8, (long)9})})), (8)) == (std::vector({(long)1, (long)3, (long)1, (long)3, (long)1, (long)3, (long)1, (long)3})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)6, (long)1, (long)5}), (std::vector)std::vector({(long)3, (long)8, (long)9}), (std::vector)std::vector({(long)2, (long)7, (long)4})})), (8)) == (std::vector({(long)1, (long)5, (long)1, (long)5, (long)1, (long)5, (long)1, (long)5})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)2}), (std::vector)std::vector({(long)3, (long)4})})), (10)) == (std::vector({(long)1, (long)2, (long)1, (long)2, (long)1, (long)2, (long)1, (long)2, (long)1, (long)2})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)3}), (std::vector)std::vector({(long)3, (long)2})})), (10)) == (std::vector({(long)1, (long)3, (long)1, (long)3, (long)1, (long)3, (long)1, (long)3, (long)1, (long)3})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "cpp", - "prompt": "#include\n#include\n// Given list of integers, return list in strange order.\n// Strange sorting, is when you start with the minimum value,\n// then maximum of the remaining integers, then minimum and so on.\n// Examples:\n// >>> strange_sort_list((std::vector({(long)1, (long)2, (long)3, (long)4})))\n// (std::vector({(long)1, (long)4, (long)2, (long)3}))\n// >>> strange_sort_list((std::vector({(long)5, (long)5, (long)5, (long)5})))\n// (std::vector({(long)5, (long)5, (long)5, (long)5}))\n// >>> strange_sort_list((std::vector()))\n// (std::vector())\nstd::vector strange_sort_list(std::vector lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = strange_sort_list;\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4}))) == (std::vector({(long)1, (long)4, (long)2, (long)3})));\n assert(candidate((std::vector({(long)5, (long)6, (long)7, (long)8, (long)9}))) == (std::vector({(long)5, (long)9, (long)6, (long)8, (long)7})));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5}))) == (std::vector({(long)1, (long)5, (long)2, (long)4, (long)3})));\n assert(candidate((std::vector({(long)5, (long)6, (long)7, (long)8, (long)9, (long)1}))) == (std::vector({(long)1, (long)9, (long)5, (long)8, (long)6, (long)7})));\n assert(candidate((std::vector({(long)5, (long)5, (long)5, (long)5}))) == (std::vector({(long)5, (long)5, (long)5, (long)5})));\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6, (long)7, (long)8}))) == (std::vector({(long)1, (long)8, (long)2, (long)7, (long)3, (long)6, (long)4, (long)5})));\n assert(candidate((std::vector({(long)0, (long)2, (long)2, (long)2, (long)5, (long)5, (long)-5, (long)-5}))) == (std::vector({(long)-5, (long)5, (long)-5, (long)5, (long)0, (long)2, (long)2, (long)2})));\n assert(candidate((std::vector({(long)111111}))) == (std::vector({(long)111111})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "cpp", - "prompt": "#include\n#include\n// Given a string 'text', return its md5 hash equivalent string.\n// If 'text' is an empty string, return None.\n// >>> string_to_md5((\"Hello world\"))\n// \"3e25960a79dbc69b674cd4ec67a72c62\"\nstd::optional string_to_md5(std::string text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = string_to_md5;\n assert(candidate((\"Hello world\")) == \"3e25960a79dbc69b674cd4ec67a72c62\");\n assert(candidate((\"\")) == std::nullopt);\n assert(candidate((\"A B C\")) == \"0ef78513b0cb8cef12743f5aeb35f888\");\n assert(candidate((\"password\")) == \"5f4dcc3b5aa765d61d8327deb882cf99\");\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a word. Your task is to find the closest vowel that stands between \n// two consonants from the right side of the word (case sensitive).\n// Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n// find any vowel met the above condition. \n// You may assume that the given string contains English letter only.\n// Example:\n// >>> get_closest_vowel((\"yogurt\"))\n// (\"u\")\n// >>> get_closest_vowel((\"FULL\"))\n// (\"U\")\n// >>> get_closest_vowel((\"quick\"))\n// (\"\")\n// >>> get_closest_vowel((\"ab\"))\n// (\"\")\nstd::string get_closest_vowel(std::string word) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = get_closest_vowel;\n assert(candidate((\"yogurt\")) == (\"u\"));\n assert(candidate((\"full\")) == (\"u\"));\n assert(candidate((\"easy\")) == (\"\"));\n assert(candidate((\"eAsy\")) == (\"\"));\n assert(candidate((\"ali\")) == (\"\"));\n assert(candidate((\"bad\")) == (\"a\"));\n assert(candidate((\"most\")) == (\"o\"));\n assert(candidate((\"ab\")) == (\"\"));\n assert(candidate((\"ba\")) == (\"\"));\n assert(candidate((\"quick\")) == (\"\"));\n assert(candidate((\"anime\")) == (\"i\"));\n assert(candidate((\"Asia\")) == (\"\"));\n assert(candidate((\"Above\")) == (\"o\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "cpp", - "prompt": "#include\n#include\n// Change numerical base of input number x to base.\n// return string representation after the conversion.\n// base numbers are less than 10.\n// >>> change_base((8), (3))\n// (\"22\")\n// >>> change_base((8), (2))\n// (\"1000\")\n// >>> change_base((7), (2))\n// (\"111\")\nstd::string change_base(long x, long base) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = change_base;\n assert(candidate((8), (3)) == (\"22\"));\n assert(candidate((9), (3)) == (\"100\"));\n assert(candidate((234), (2)) == (\"11101010\"));\n assert(candidate((16), (2)) == (\"10000\"));\n assert(candidate((8), (2)) == (\"1000\"));\n assert(candidate((7), (2)) == (\"111\"));\n assert(candidate((2), (3)) == (\"2\"));\n assert(candidate((3), (4)) == (\"3\"));\n assert(candidate((4), (5)) == (\"4\"));\n assert(candidate((5), (6)) == (\"5\"));\n assert(candidate((6), (7)) == (\"6\"));\n assert(candidate((7), (8)) == (\"7\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "cpp", - "prompt": "#include\n#include\n// Check if in given list of numbers, are any two numbers closer to each other than\n// given threshold.\n// >>> has_close_elements((std::vector({(float)1.0, (float)2.0, (float)3.0})), (0.5))\n// (false)\n// >>> has_close_elements((std::vector({(float)1.0, (float)2.8, (float)3.0, (float)4.0, (float)5.0, (float)2.0})), (0.3))\n// (true)\nbool has_close_elements(std::vector numbers, float threshold) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = has_close_elements;\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.9, (float)4.0, (float)5.0, (float)2.2})), (0.3)) == (true));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.9, (float)4.0, (float)5.0, (float)2.2})), (0.05)) == (false));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)5.9, (float)4.0, (float)5.0})), (0.95)) == (true));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)5.9, (float)4.0, (float)5.0})), (0.8)) == (false));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0, (float)5.0, (float)2.0})), (0.1)) == (true));\n assert(candidate((std::vector({(float)1.1, (float)2.2, (float)3.1, (float)4.1, (float)5.1})), (1.0)) == (true));\n assert(candidate((std::vector({(float)1.1, (float)2.2, (float)3.1, (float)4.1, (float)5.1})), (0.5)) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function that takes a string as input which contains only square brackets.\n// The function should return True if and only if there is a valid subsequence of brackets \n// where at least one bracket in the subsequence is nested.\n// >>> is_nested((\"[[]]\"))\n// (true)\n// >>> is_nested((\"[]]]]]]][[[[[]\"))\n// (false)\n// >>> is_nested((\"[][]\"))\n// (false)\n// >>> is_nested((\"[]\"))\n// (false)\n// >>> is_nested((\"[[][]]\"))\n// (true)\n// >>> is_nested((\"[[]][[\"))\n// (true)\nbool is_nested(std::string string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = is_nested;\n assert(candidate((\"[[]]\")) == (true));\n assert(candidate((\"[]]]]]]][[[[[]\")) == (false));\n assert(candidate((\"[][]\")) == (false));\n assert(candidate((\"[]\")) == (false));\n assert(candidate((\"[[[[]]]]\")) == (true));\n assert(candidate((\"[]]]]]]]]]]\")) == (false));\n assert(candidate((\"[][][[]]\")) == (true));\n assert(candidate((\"[[]\")) == (false));\n assert(candidate((\"[]]\")) == (false));\n assert(candidate((\"[[]][[\")) == (true));\n assert(candidate((\"[[][]]\")) == (true));\n assert(candidate((\"\")) == (false));\n assert(candidate((\"[[[[[[[[\")) == (false));\n assert(candidate((\"]]]]]]]]\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "cpp", - "prompt": "#include\n#include\n// Concatenate list of strings into a single string\n// >>> concatenate((std::vector()))\n// (\"\")\n// >>> concatenate((std::vector({(std::string)\"a\", (std::string)\"b\", (std::string)\"c\"})))\n// (\"abc\")\nstd::string concatenate(std::vector strings) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = concatenate;\n assert(candidate((std::vector())) == (\"\"));\n assert(candidate((std::vector({(std::string)\"x\", (std::string)\"y\", (std::string)\"z\"}))) == (\"xyz\"));\n assert(candidate((std::vector({(std::string)\"x\", (std::string)\"y\", (std::string)\"z\", (std::string)\"w\", (std::string)\"k\"}))) == (\"xyzwk\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "cpp", - "prompt": "#include\n#include\n// prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n// >>> prime_fib((1))\n// (2)\n// >>> prime_fib((2))\n// (3)\n// >>> prime_fib((3))\n// (5)\n// >>> prime_fib((4))\n// (13)\n// >>> prime_fib((5))\n// (89)\nlong prime_fib(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = prime_fib;\n assert(candidate((1)) == (2));\n assert(candidate((2)) == (3));\n assert(candidate((3)) == (5));\n assert(candidate((4)) == (13));\n assert(candidate((5)) == (89));\n assert(candidate((6)) == (233));\n assert(candidate((7)) == (1597));\n assert(candidate((8)) == (28657));\n assert(candidate((9)) == (514229));\n assert(candidate((10)) == (433494437));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "cpp", - "prompt": "#include\n#include\n// From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n// other and return them in order (smaller number, larger number).\n// >>> find_closest_elements((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0, (float)5.0, (float)2.2})))\n// (std::make_tuple(2.0, 2.2))\n// >>> find_closest_elements((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0, (float)5.0, (float)2.0})))\n// (std::make_tuple(2.0, 2.0))\nstd::tuple find_closest_elements(std::vector numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = find_closest_elements;\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.9, (float)4.0, (float)5.0, (float)2.2}))) == (std::make_tuple(3.9, 4.0)));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)5.9, (float)4.0, (float)5.0}))) == (std::make_tuple(5.0, 5.9)));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0, (float)5.0, (float)2.2}))) == (std::make_tuple(2.0, 2.2)));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0, (float)5.0, (float)2.0}))) == (std::make_tuple(2.0, 2.0)));\n assert(candidate((std::vector({(float)1.1, (float)2.2, (float)3.1, (float)4.1, (float)5.1}))) == (std::make_tuple(2.2, 3.1)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "cpp", - "prompt": "#include\n#include\n// You have been tasked to write a function that receives \n// a hexadecimal number as a string and counts the number of hexadecimal \n// digits that are primes (prime number, or a prime, is a natural number \n// greater than 1 that is not a product of two smaller natural numbers).\n// Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n// Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n// So you have to determine a number of the following digits: 2, 3, 5, 7, \n// B (=decimal 11), D (=decimal 13).\n// Note: you may assume the input is always correct or empty string, \n// and symbols A,B,C,D,E,F are always uppercase.\n// Examples:\n// >>> hex_key((\"AB\"))\n// (1)\n// >>> hex_key((\"1077E\"))\n// (2)\n// >>> hex_key((\"ABED1A33\"))\n// (4)\n// >>> hex_key((\"123456789ABCDEF0\"))\n// (6)\n// >>> hex_key((\"2020\"))\n// (2)\nlong hex_key(std::string num) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = hex_key;\n assert(candidate((\"AB\")) == (1));\n assert(candidate((\"1077E\")) == (2));\n assert(candidate((\"ABED1A33\")) == (4));\n assert(candidate((\"2020\")) == (2));\n assert(candidate((\"123456789ABCDEF0\")) == (6));\n assert(candidate((\"112233445566778899AABBCCDDEEFF00\")) == (12));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "cpp", - "prompt": "#include\n#include\n// Complete the function that takes two integers and returns \n// the product of their unit digits.\n// Assume the input is always valid.\n// Examples:\n// >>> multiply((148), (412))\n// (16)\n// >>> multiply((19), (28))\n// (72)\n// >>> multiply((2020), (1851))\n// (0)\n// >>> multiply((14), (-15))\n// (20)\nlong multiply(long a, long b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = multiply;\n assert(candidate((148), (412)) == (16));\n assert(candidate((19), (28)) == (72));\n assert(candidate((2020), (1851)) == (0));\n assert(candidate((14), (-15)) == (20));\n assert(candidate((76), (67)) == (42));\n assert(candidate((17), (27)) == (49));\n assert(candidate((0), (1)) == (0));\n assert(candidate((0), (0)) == (0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "cpp", - "prompt": "#include\n#include\n// Given list of numbers (of at least two elements), apply a linear transform to that list,\n// such that the smallest number will become 0 and the largest will become 1\n// >>> rescale_to_unit((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0, (float)5.0})))\n// (std::vector({(float)0.0, (float)0.25, (float)0.5, (float)0.75, (float)1.0}))\nstd::vector rescale_to_unit(std::vector numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = rescale_to_unit;\n assert(candidate((std::vector({(float)2.0, (float)49.9}))) == (std::vector({(float)0.0, (float)1.0})));\n assert(candidate((std::vector({(float)100.0, (float)49.9}))) == (std::vector({(float)1.0, (float)0.0})));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0, (float)4.0, (float)5.0}))) == (std::vector({(float)0.0, (float)0.25, (float)0.5, (float)0.75, (float)1.0})));\n assert(candidate((std::vector({(float)2.0, (float)1.0, (float)5.0, (float)3.0, (float)4.0}))) == (std::vector({(float)0.25, (float)0.0, (float)1.0, (float)0.5, (float)0.75})));\n assert(candidate((std::vector({(float)12.0, (float)11.0, (float)15.0, (float)13.0, (float)14.0}))) == (std::vector({(float)0.25, (float)0.0, (float)1.0, (float)0.5, (float)0.75})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "cpp", - "prompt": "#include\n#include\n// Given a positive integer n, return the product of the odd digits.\n// Return 0 if all digits are even.\n// For example:\n// >>> digits((1))\n// (1)\n// >>> digits((4))\n// (0)\n// >>> digits((235))\n// (15)\nlong digits(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = digits;\n assert(candidate((5)) == (5));\n assert(candidate((54)) == (5));\n assert(candidate((120)) == (1));\n assert(candidate((5014)) == (5));\n assert(candidate((98765)) == (315));\n assert(candidate((5576543)) == (2625));\n assert(candidate((2468)) == (0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "cpp", - "prompt": "#include\n#include\n// You will be given the name of a class (a string) and a list of extensions.\n// The extensions are to be used to load additional classes to the class. The\n// strength of the extension is as follows: Let CAP be the number of the uppercase\n// letters in the extension's name, and let SM be the number of lowercase letters \n// in the extension's name, the strength is given by the fraction CAP - SM. \n// You should find the strongest extension and return a string in this \n// format: ClassName.StrongestExtensionName.\n// If there are two or more extensions with the same strength, you should\n// choose the one that comes first in the list.\n// For example, if you are given \"Slices\" as the class and a list of the\n// extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n// return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n// (its strength is -1).\n// Example:\n// >>> Strongest_Extension((\"my_class\"), (std::vector({(std::string)\"AA\", (std::string)\"Be\", (std::string)\"CC\"})))\n// (\"my_class.AA\")\nstd::string Strongest_Extension(std::string class_name, std::vector extensions) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = Strongest_Extension;\n assert(candidate((\"Watashi\"), (std::vector({(std::string)\"tEN\", (std::string)\"niNE\", (std::string)\"eIGHt8OKe\"}))) == (\"Watashi.eIGHt8OKe\"));\n assert(candidate((\"Boku123\"), (std::vector({(std::string)\"nani\", (std::string)\"NazeDa\", (std::string)\"YEs.WeCaNe\", (std::string)\"32145tggg\"}))) == (\"Boku123.YEs.WeCaNe\"));\n assert(candidate((\"__YESIMHERE\"), (std::vector({(std::string)\"t\", (std::string)\"eMptY\", (std::string)\"nothing\", (std::string)\"zeR00\", (std::string)\"NuLl__\", (std::string)\"123NoooneB321\"}))) == (\"__YESIMHERE.NuLl__\"));\n assert(candidate((\"K\"), (std::vector({(std::string)\"Ta\", (std::string)\"TAR\", (std::string)\"t234An\", (std::string)\"cosSo\"}))) == (\"K.TAR\"));\n assert(candidate((\"__HAHA\"), (std::vector({(std::string)\"Tab\", (std::string)\"123\", (std::string)\"781345\", (std::string)\"-_-\"}))) == (\"__HAHA.123\"));\n assert(candidate((\"YameRore\"), (std::vector({(std::string)\"HhAas\", (std::string)\"okIWILL123\", (std::string)\"WorkOut\", (std::string)\"Fails\", (std::string)\"-_-\"}))) == (\"YameRore.okIWILL123\"));\n assert(candidate((\"finNNalLLly\"), (std::vector({(std::string)\"Die\", (std::string)\"NowW\", (std::string)\"Wow\", (std::string)\"WoW\"}))) == (\"finNNalLLly.WoW\"));\n assert(candidate((\"_\"), (std::vector({(std::string)\"Bb\", (std::string)\"91245\"}))) == (\"_.Bb\"));\n assert(candidate((\"Sp\"), (std::vector({(std::string)\"671235\", (std::string)\"Bb\"}))) == (\"Sp.671235\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "cpp", - "prompt": "#include\n#include\n// Given a string representing a space separated lowercase letters, return a dictionary\n// of the letter with the most repetition and containing the corresponding count.\n// If several letters have the same occurrence, return all of them.\n// Example:\n// >>> histogram((\"a b c\"))\n// (std::map({{\"a\", 1}, {\"b\", 1}, {\"c\", 1}}))\n// >>> histogram((\"a b b a\"))\n// (std::map({{\"a\", 2}, {\"b\", 2}}))\n// >>> histogram((\"a b c a b\"))\n// (std::map({{\"a\", 2}, {\"b\", 2}}))\n// >>> histogram((\"b b b b a\"))\n// (std::map({{\"b\", 4}}))\n// >>> histogram((\"\"))\n// (std::map())\nstd::map histogram(std::string test) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = histogram;\n assert(candidate((\"a b b a\")) == (std::map({{\"a\", 2}, {\"b\", 2}})));\n assert(candidate((\"a b c a b\")) == (std::map({{\"a\", 2}, {\"b\", 2}})));\n assert(candidate((\"a b c d g\")) == (std::map({{\"a\", 1}, {\"b\", 1}, {\"c\", 1}, {\"d\", 1}, {\"g\", 1}})));\n assert(candidate((\"r t g\")) == (std::map({{\"r\", 1}, {\"t\", 1}, {\"g\", 1}})));\n assert(candidate((\"b b b b a\")) == (std::map({{\"b\", 4}})));\n assert(candidate((\"r t g\")) == (std::map({{\"r\", 1}, {\"t\", 1}, {\"g\", 1}})));\n assert(candidate((\"\")) == (std::map()));\n assert(candidate((\"a\")) == (std::map({{\"a\", 1}})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "cpp", - "prompt": "#include\n#include\n// pairs_sum_to_zero takes a list of integers as an input.\n// it returns True if there are two distinct elements in the list that\n// sum to zero, and False otherwise.\n// >>> pairs_sum_to_zero((std::vector({(long)1, (long)3, (long)5, (long)0})))\n// (false)\n// >>> pairs_sum_to_zero((std::vector({(long)1, (long)3, (long)-2, (long)1})))\n// (false)\n// >>> pairs_sum_to_zero((std::vector({(long)1, (long)2, (long)3, (long)7})))\n// (false)\n// >>> pairs_sum_to_zero((std::vector({(long)2, (long)4, (long)-5, (long)3, (long)5, (long)7})))\n// (true)\n// >>> pairs_sum_to_zero((std::vector({(long)1})))\n// (false)\nbool pairs_sum_to_zero(std::vector l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = pairs_sum_to_zero;\n assert(candidate((std::vector({(long)1, (long)3, (long)5, (long)0}))) == (false));\n assert(candidate((std::vector({(long)1, (long)3, (long)-2, (long)1}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)7}))) == (false));\n assert(candidate((std::vector({(long)2, (long)4, (long)-5, (long)3, (long)5, (long)7}))) == (true));\n assert(candidate((std::vector({(long)1}))) == (false));\n assert(candidate((std::vector({(long)-3, (long)9, (long)-1, (long)3, (long)2, (long)30}))) == (true));\n assert(candidate((std::vector({(long)-3, (long)9, (long)-1, (long)3, (long)2, (long)31}))) == (true));\n assert(candidate((std::vector({(long)-3, (long)9, (long)-1, (long)4, (long)2, (long)30}))) == (false));\n assert(candidate((std::vector({(long)-3, (long)9, (long)-1, (long)4, (long)2, (long)31}))) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that accepts two lists of strings and returns the list that has \n// total number of chars in the all strings of the list less than the other list.\n// if the two lists have the same number of chars, return the first list.\n// Examples\n// >>> total_match((std::vector()), (std::vector()))\n// (std::vector())\n// >>> total_match((std::vector({(std::string)\"hi\", (std::string)\"admin\"})), (std::vector({(std::string)\"hI\", (std::string)\"Hi\"})))\n// (std::vector({(std::string)\"hI\", (std::string)\"Hi\"}))\n// >>> total_match((std::vector({(std::string)\"hi\", (std::string)\"admin\"})), (std::vector({(std::string)\"hi\", (std::string)\"hi\", (std::string)\"admin\", (std::string)\"project\"})))\n// (std::vector({(std::string)\"hi\", (std::string)\"admin\"}))\n// >>> total_match((std::vector({(std::string)\"hi\", (std::string)\"admin\"})), (std::vector({(std::string)\"hI\", (std::string)\"hi\", (std::string)\"hi\"})))\n// (std::vector({(std::string)\"hI\", (std::string)\"hi\", (std::string)\"hi\"}))\n// >>> total_match((std::vector({(std::string)\"4\"})), (std::vector({(std::string)\"1\", (std::string)\"2\", (std::string)\"3\", (std::string)\"4\", (std::string)\"5\"})))\n// (std::vector({(std::string)\"4\"}))\nstd::vector total_match(std::vector lst1, std::vector lst2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = total_match;\n assert(candidate((std::vector()), (std::vector())) == (std::vector()));\n assert(candidate((std::vector({(std::string)\"hi\", (std::string)\"admin\"})), (std::vector({(std::string)\"hi\", (std::string)\"hi\"}))) == (std::vector({(std::string)\"hi\", (std::string)\"hi\"})));\n assert(candidate((std::vector({(std::string)\"hi\", (std::string)\"admin\"})), (std::vector({(std::string)\"hi\", (std::string)\"hi\", (std::string)\"admin\", (std::string)\"project\"}))) == (std::vector({(std::string)\"hi\", (std::string)\"admin\"})));\n assert(candidate((std::vector({(std::string)\"4\"})), (std::vector({(std::string)\"1\", (std::string)\"2\", (std::string)\"3\", (std::string)\"4\", (std::string)\"5\"}))) == (std::vector({(std::string)\"4\"})));\n assert(candidate((std::vector({(std::string)\"hi\", (std::string)\"admin\"})), (std::vector({(std::string)\"hI\", (std::string)\"Hi\"}))) == (std::vector({(std::string)\"hI\", (std::string)\"Hi\"})));\n assert(candidate((std::vector({(std::string)\"hi\", (std::string)\"admin\"})), (std::vector({(std::string)\"hI\", (std::string)\"hi\", (std::string)\"hi\"}))) == (std::vector({(std::string)\"hI\", (std::string)\"hi\", (std::string)\"hi\"})));\n assert(candidate((std::vector({(std::string)\"hi\", (std::string)\"admin\"})), (std::vector({(std::string)\"hI\", (std::string)\"hi\", (std::string)\"hii\"}))) == (std::vector({(std::string)\"hi\", (std::string)\"admin\"})));\n assert(candidate((std::vector()), (std::vector({(std::string)\"this\"}))) == (std::vector()));\n assert(candidate((std::vector({(std::string)\"this\"})), (std::vector())) == (std::vector()));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "cpp", - "prompt": "#include\n#include\n// Circular shift the digits of the integer x, shift the digits right by shift\n// and return the result as a string.\n// If shift > number of digits, return digits reversed.\n// >>> circular_shift((12), (1))\n// (\"21\")\n// >>> circular_shift((12), (2))\n// (\"12\")\nstd::string circular_shift(long x, long shift) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = circular_shift;\n assert(candidate((100), (2)) == (\"001\"));\n assert(candidate((12), (2)) == (\"12\"));\n assert(candidate((97), (8)) == (\"79\"));\n assert(candidate((12), (1)) == (\"21\"));\n assert(candidate((11), (101)) == (\"11\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "cpp", - "prompt": "#include\n#include\n// Return True is list elements are monotonically increasing or decreasing.\n// >>> monotonic((std::vector({(long)1, (long)2, (long)4, (long)20})))\n// (true)\n// >>> monotonic((std::vector({(long)1, (long)20, (long)4, (long)10})))\n// (false)\n// >>> monotonic((std::vector({(long)4, (long)1, (long)0, (long)-10})))\n// (true)\nbool monotonic(std::vector l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = monotonic;\n assert(candidate((std::vector({(long)1, (long)2, (long)4, (long)10}))) == (true));\n assert(candidate((std::vector({(long)1, (long)2, (long)4, (long)20}))) == (true));\n assert(candidate((std::vector({(long)1, (long)20, (long)4, (long)10}))) == (false));\n assert(candidate((std::vector({(long)4, (long)1, (long)0, (long)-10}))) == (true));\n assert(candidate((std::vector({(long)4, (long)1, (long)1, (long)0}))) == (true));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)2, (long)5, (long)60}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)60}))) == (true));\n assert(candidate((std::vector({(long)9, (long)9, (long)9, (long)9}))) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "cpp", - "prompt": "#include\n#include\n// Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n// Example\n// >>> is_equal_to_sum_even((4))\n// (false)\n// >>> is_equal_to_sum_even((6))\n// (false)\n// >>> is_equal_to_sum_even((8))\n// (true)\nbool is_equal_to_sum_even(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = is_equal_to_sum_even;\n assert(candidate((4)) == (false));\n assert(candidate((6)) == (false));\n assert(candidate((8)) == (true));\n assert(candidate((10)) == (true));\n assert(candidate((11)) == (false));\n assert(candidate((12)) == (true));\n assert(candidate((13)) == (false));\n assert(candidate((16)) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "cpp", - "prompt": "#include\n#include\n// Input to this function is a string representing musical notes in a special ASCII format.\n// Your task is to parse this string and return list of integers corresponding to how many beats does each\n// not last.\n// Here is a legend:\n// 'o' - whole note, lasts four beats\n// 'o|' - half note, lasts two beats\n// '.|' - quater note, lasts one beat\n// >>> parse_music((\"o o| .| o| o| .| .| .| .| o o\"))\n// (std::vector({(long)4, (long)2, (long)1, (long)2, (long)2, (long)1, (long)1, (long)1, (long)1, (long)4, (long)4}))\nstd::vector parse_music(std::string music_string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = parse_music;\n assert(candidate((\"\")) == (std::vector()));\n assert(candidate((\"o o o o\")) == (std::vector({(long)4, (long)4, (long)4, (long)4})));\n assert(candidate((\".| .| .| .|\")) == (std::vector({(long)1, (long)1, (long)1, (long)1})));\n assert(candidate((\"o| o| .| .| o o o o\")) == (std::vector({(long)2, (long)2, (long)1, (long)1, (long)4, (long)4, (long)4, (long)4})));\n assert(candidate((\"o| .| o| .| o o| o o|\")) == (std::vector({(long)2, (long)1, (long)2, (long)1, (long)4, (long)2, (long)4, (long)2})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "cpp", - "prompt": "#include\n#include\n// \"\n// This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n// multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n// change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n// Examples:\n// >>> lst\n// (long({(long)1, (long)2, (long)3}))\n// >>> lst\n// (long())\n// >>> lst\n// (long({(long)-1, (long)-5, (long)2, (long)-1, (long)-5}))\nlong sum_squares(std::vector lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = sum_squares;\n assert(candidate((std::vector({(long)1, (long)2, (long)3}))) == (6));\n assert(candidate((std::vector({(long)1, (long)4, (long)9}))) == (14));\n assert(candidate((std::vector())) == (0));\n assert(candidate((std::vector({(long)1, (long)1, (long)1, (long)1, (long)1, (long)1, (long)1, (long)1, (long)1}))) == (9));\n assert(candidate((std::vector({(long)-1, (long)-1, (long)-1, (long)-1, (long)-1, (long)-1, (long)-1, (long)-1, (long)-1}))) == (-3));\n assert(candidate((std::vector({(long)0}))) == (0));\n assert(candidate((std::vector({(long)-1, (long)-5, (long)2, (long)-1, (long)-5}))) == (-126));\n assert(candidate((std::vector({(long)-56, (long)-99, (long)1, (long)0, (long)-2}))) == (3030));\n assert(candidate((std::vector({(long)-1, (long)0, (long)0, (long)0, (long)0, (long)0, (long)0, (long)0, (long)-1}))) == (0));\n assert(candidate((std::vector({(long)-16, (long)-9, (long)-2, (long)36, (long)36, (long)26, (long)-20, (long)25, (long)-40, (long)20, (long)-4, (long)12, (long)-26, (long)35, (long)37}))) == (-14196));\n assert(candidate((std::vector({(long)-1, (long)-3, (long)17, (long)-1, (long)-15, (long)13, (long)-1, (long)14, (long)-14, (long)-12, (long)-5, (long)14, (long)-14, (long)6, (long)13, (long)11, (long)16, (long)16, (long)4, (long)10}))) == (-1448));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "cpp", - "prompt": "#include\n#include\n// triples_sum_to_zero takes a list of integers as an input.\n// it returns True if there are three distinct elements in the list that\n// sum to zero, and False otherwise.\n// >>> triples_sum_to_zero((std::vector({(long)1, (long)3, (long)5, (long)0})))\n// (false)\n// >>> triples_sum_to_zero((std::vector({(long)1, (long)3, (long)-2, (long)1})))\n// (true)\n// >>> triples_sum_to_zero((std::vector({(long)1, (long)2, (long)3, (long)7})))\n// (false)\n// >>> triples_sum_to_zero((std::vector({(long)2, (long)4, (long)-5, (long)3, (long)9, (long)7})))\n// (true)\n// >>> triples_sum_to_zero((std::vector({(long)1})))\n// (false)\nbool triples_sum_to_zero(std::vector l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = triples_sum_to_zero;\n assert(candidate((std::vector({(long)1, (long)3, (long)5, (long)0}))) == (false));\n assert(candidate((std::vector({(long)1, (long)3, (long)5, (long)-1}))) == (false));\n assert(candidate((std::vector({(long)1, (long)3, (long)-2, (long)1}))) == (true));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)7}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)5, (long)7}))) == (false));\n assert(candidate((std::vector({(long)2, (long)4, (long)-5, (long)3, (long)9, (long)7}))) == (true));\n assert(candidate((std::vector({(long)1}))) == (false));\n assert(candidate((std::vector({(long)1, (long)3, (long)5, (long)-100}))) == (false));\n assert(candidate((std::vector({(long)100, (long)3, (long)5, (long)-100}))) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "cpp", - "prompt": "#include\n#include\n// brackets is a string of \"<\" and \">\".\n// return True if every opening bracket has a corresponding closing bracket.\n// >>> correct_bracketing((\"<\"))\n// (false)\n// >>> correct_bracketing((\"<>\"))\n// (true)\n// >>> correct_bracketing((\"<<><>>\"))\n// (true)\n// >>> correct_bracketing((\"><<>\"))\n// (false)\nbool correct_bracketing(std::string brackets) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = correct_bracketing;\n assert(candidate((\"<>\")) == (true));\n assert(candidate((\"<<><>>\")) == (true));\n assert(candidate((\"<><><<><>><>\")) == (true));\n assert(candidate((\"<><><<<><><>><>><<><><<>>>\")) == (true));\n assert(candidate((\"<<<><>>>>\")) == (false));\n assert(candidate((\"><<>\")) == (false));\n assert(candidate((\"<\")) == (false));\n assert(candidate((\"<<<<\")) == (false));\n assert(candidate((\">\")) == (false));\n assert(candidate((\"<<>\")) == (false));\n assert(candidate((\"<><><<><>><>><<>\")) == (false));\n assert(candidate((\"<><><<><>><>>><>\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that takes an array of numbers as input and returns \n// the number of elements in the array that are greater than 10 and both \n// first and last digits of a number are odd (1, 3, 5, 7, 9).\n// For example:\n// >>> specialFilter((std::vector({(long)15, (long)-73, (long)14, (long)-15})))\n// (1)\n// >>> specialFilter((std::vector({(long)33, (long)-2, (long)-3, (long)45, (long)21, (long)109})))\n// (2)\nlong specialFilter(std::vector nums) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = specialFilter;\n assert(candidate((std::vector({(long)5, (long)-2, (long)1, (long)-5}))) == (0));\n assert(candidate((std::vector({(long)15, (long)-73, (long)14, (long)-15}))) == (1));\n assert(candidate((std::vector({(long)33, (long)-2, (long)-3, (long)45, (long)21, (long)109}))) == (2));\n assert(candidate((std::vector({(long)43, (long)-12, (long)93, (long)125, (long)121, (long)109}))) == (4));\n assert(candidate((std::vector({(long)71, (long)-2, (long)-33, (long)75, (long)21, (long)19}))) == (3));\n assert(candidate((std::vector({(long)1}))) == (0));\n assert(candidate((std::vector())) == (0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "cpp", - "prompt": "#include\n#include\n// Given a dictionary, return True if all keys are strings in lower \n// case or all keys are strings in upper case, else return False.\n// The function should return False is the given dictionary is empty.\n// Examples:\n// >>> check_dict_case((std::map({{\"a\", \"apple\"}, {\"b\", \"banana\"}})))\n// (true)\n// >>> check_dict_case((std::map({{\"a\", \"apple\"}, {\"A\", \"banana\"}, {\"B\", \"banana\"}})))\n// (false)\n// >>> check_dict_case((std::map({{\"a\", \"apple\"}, {8, \"banana\"}, {\"a\", \"apple\"}})))\n// (false)\n// >>> check_dict_case((std::map({{\"Name\", \"John\"}, {\"Age\", \"36\"}, {\"City\", \"Houston\"}})))\n// (false)\n// >>> check_dict_case((std::map({{\"STATE\", \"NC\"}, {\"ZIP\", \"12345\"}})))\n// (true)\nbool check_dict_case(std::map dict) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = check_dict_case;\n assert(candidate((std::map({{\"p\", \"pineapple\"}, {\"b\", \"banana\"}}))) == (true));\n assert(candidate((std::map({{\"p\", \"pineapple\"}, {\"A\", \"banana\"}, {\"B\", \"banana\"}}))) == (false));\n assert(candidate((std::map({{\"p\", \"pineapple\"}, {\"5\", \"banana\"}, {\"a\", \"apple\"}}))) == (false));\n assert(candidate((std::map({{\"Name\", \"John\"}, {\"Age\", \"36\"}, {\"City\", \"Houston\"}}))) == (false));\n assert(candidate((std::map({{\"STATE\", \"NC\"}, {\"ZIP\", \"12345\"}}))) == (true));\n assert(candidate((std::map({{\"fruit\", \"Orange\"}, {\"taste\", \"Sweet\"}}))) == (true));\n assert(candidate((std::map())) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "cpp", - "prompt": "#include\n#include\nunion Union_std_vector_std_string__long{\n std::vector f0;\n long f1; Union_std_vector_std_string__long(std::vector _f0) : f0(_f0) {}\n Union_std_vector_std_string__long(long _f1) : f1(_f1) {}\n ~Union_std_vector_std_string__long() {}\n bool operator==(std::vector f) {\n return f0 == f ;\n } bool operator==(long f) {\n return f1 == f ;\n }\n};\n// Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n// should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n// alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n// Examples\n// >>> split_words((\"Hello world!\"))\n// std::vector({(std::string)\"Hello\", (std::string)\"world!\"})\n// >>> split_words((\"Hello,world!\"))\n// std::vector({(std::string)\"Hello\", (std::string)\"world!\"})\n// >>> split_words((\"abcdef\"))\n// 3\nUnion_std_vector_std_string__long split_words(std::string txt) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = split_words;\n assert(candidate((\"Hello world!\")) == std::vector({(std::string)\"Hello\", (std::string)\"world!\"}));\n assert(candidate((\"Hello,world!\")) == std::vector({(std::string)\"Hello\", (std::string)\"world!\"}));\n assert(candidate((\"Hello world,!\")) == std::vector({(std::string)\"Hello\", (std::string)\"world,!\"}));\n assert(candidate((\"Hello,Hello,world !\")) == std::vector({(std::string)\"Hello,Hello,world\", (std::string)\"!\"}));\n assert(candidate((\"abcdef\")) == 3);\n assert(candidate((\"aaabb\")) == 2);\n assert(candidate((\"aaaBb\")) == 1);\n assert(candidate((\"\")) == 0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "cpp", - "prompt": "#include\n#include\n// The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fibfib(0) == 0\n// fibfib(1) == 0\n// fibfib(2) == 1\n// fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n// Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n// >>> fibfib((1))\n// (0)\n// >>> fibfib((5))\n// (4)\n// >>> fibfib((8))\n// (24)\nlong fibfib(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = fibfib;\n assert(candidate((2)) == (1));\n assert(candidate((1)) == (0));\n assert(candidate((5)) == (4));\n assert(candidate((8)) == (24));\n assert(candidate((10)) == (81));\n assert(candidate((12)) == (274));\n assert(candidate((14)) == (927));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a list of numbers.\n// You need to return the sum of squared numbers in the given list,\n// round each element in the list to the upper int(Ceiling) first.\n// Examples:\n// >>> lst((std::vector({(float)1.0, (float)2.0, (float)3.0})))\n// (14)\n// >>> lst((std::vector({(float)1.0, (float)4.0, (float)9.0})))\n// (98)\n// >>> lst((std::vector({(float)1.0, (float)3.0, (float)5.0, (float)7.0})))\n// (84)\n// >>> lst((std::vector({(float)1.4, (float)4.2, (float)0.0})))\n// (29)\n// >>> lst((std::vector({(float)-2.4, (float)1.0, (float)1.0})))\n// (6)\nlong sum_squares(std::vector lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = sum_squares;\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0}))) == (14));\n assert(candidate((std::vector({(float)1.0, (float)2.0, (float)3.0}))) == (14));\n assert(candidate((std::vector({(float)1.0, (float)3.0, (float)5.0, (float)7.0}))) == (84));\n assert(candidate((std::vector({(float)1.4, (float)4.2, (float)0.0}))) == (29));\n assert(candidate((std::vector({(float)-2.4, (float)1.0, (float)1.0}))) == (6));\n assert(candidate((std::vector({(float)100.0, (float)1.0, (float)15.0, (float)2.0}))) == (10230));\n assert(candidate((std::vector({(float)10000.0, (float)10000.0}))) == (200000000));\n assert(candidate((std::vector({(float)-1.4, (float)4.6, (float)6.3}))) == (75));\n assert(candidate((std::vector({(float)-1.4, (float)17.9, (float)18.9, (float)19.9}))) == (1086));\n assert(candidate((std::vector({(float)0.0}))) == (0));\n assert(candidate((std::vector({(float)-1.0}))) == (1));\n assert(candidate((std::vector({(float)-1.0, (float)1.0, (float)0.0}))) == (2));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_85_add", - "language": "cpp", - "prompt": "#include\n#include\n// Given a non-empty list of integers lst. add the even elements that are at odd indices..\n// Examples:\n// >>> add((std::vector({(long)4, (long)2, (long)6, (long)7})))\n// (2)\nlong add(std::vector lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = add;\n assert(candidate((std::vector({(long)4, (long)88}))) == (88));\n assert(candidate((std::vector({(long)4, (long)5, (long)6, (long)7, (long)2, (long)122}))) == (122));\n assert(candidate((std::vector({(long)4, (long)0, (long)6, (long)7}))) == (0));\n assert(candidate((std::vector({(long)4, (long)4, (long)6, (long)8}))) == (12));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "cpp", - "prompt": "#include\n#include\n// Return sorted unique elements in a list\n// >>> unique((std::vector({(long)5, (long)3, (long)5, (long)2, (long)3, (long)3, (long)9, (long)0, (long)123})))\n// (std::vector({(long)0, (long)2, (long)3, (long)5, (long)9, (long)123}))\nstd::vector unique(std::vector l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = unique;\n assert(candidate((std::vector({(long)5, (long)3, (long)5, (long)2, (long)3, (long)3, (long)9, (long)0, (long)123}))) == (std::vector({(long)0, (long)2, (long)3, (long)5, (long)9, (long)123})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "cpp", - "prompt": "#include\n#include\n// Given a string text, replace all spaces in it with underscores, \n// and if a string has more than 2 consecutive spaces, \n// then replace all consecutive spaces with - \n// >>> fix_spaces((\" Example\"))\n// (\"Example\")\n// >>> fix_spaces((\" Example 1\"))\n// (\"Example_1\")\n// >>> fix_spaces((\" Example 2\"))\n// (\"_Example_2\")\n// >>> fix_spaces((\" Example 3\"))\n// (\"_Example-3\")\nstd::string fix_spaces(std::string text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = fix_spaces;\n assert(candidate((\"Example\")) == (\"Example\"));\n assert(candidate((\"Mudasir Hanif \")) == (\"Mudasir_Hanif_\"));\n assert(candidate((\"Yellow Yellow Dirty Fellow\")) == (\"Yellow_Yellow__Dirty__Fellow\"));\n assert(candidate((\"Exa mple\")) == (\"Exa-mple\"));\n assert(candidate((\" Exa 1 2 2 mple\")) == (\"-Exa_1_2_2_mple\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "cpp", - "prompt": "#include\n#include\n// Return 2^n modulo p (be aware of numerics).\n// >>> modp((3), (5))\n// (3)\n// >>> modp((1101), (101))\n// (2)\n// >>> modp((0), (101))\n// (1)\n// >>> modp((3), (11))\n// (8)\n// >>> modp((100), (101))\n// (1)\nlong modp(long n, long p) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = modp;\n assert(candidate((3), (5)) == (3));\n assert(candidate((1101), (101)) == (2));\n assert(candidate((0), (101)) == (1));\n assert(candidate((3), (11)) == (8));\n assert(candidate((100), (101)) == (1));\n assert(candidate((30), (5)) == (4));\n assert(candidate((31), (5)) == (3));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "cpp", - "prompt": "#include\n#include\n// You have to write a function which validates a given date string and\n// returns True if the date is valid otherwise False.\n// The date is valid if all of the following rules are satisfied:\n// 1. The date string is not empty.\n// 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n// 3. The months should not be less than 1 or higher than 12.\n// 4. The date should be in the format: mm-dd-yyyy\n// >>> valid_date((\"03-11-2000\"))\n// (true)\n// >>> valid_date((\"15-01-2012\"))\n// (false)\n// >>> valid_date((\"04-0-2040\"))\n// (false)\n// >>> valid_date((\"06-04-2020\"))\n// (true)\n// >>> valid_date((\"06/04/2020\"))\n// (false)\nbool valid_date(std::string date) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = valid_date;\n assert(candidate((\"03-11-2000\")) == (true));\n assert(candidate((\"15-01-2012\")) == (false));\n assert(candidate((\"04-0-2040\")) == (false));\n assert(candidate((\"06-04-2020\")) == (true));\n assert(candidate((\"01-01-2007\")) == (true));\n assert(candidate((\"03-32-2011\")) == (false));\n assert(candidate((\"\")) == (false));\n assert(candidate((\"04-31-3000\")) == (false));\n assert(candidate((\"06-06-2005\")) == (true));\n assert(candidate((\"21-31-2000\")) == (false));\n assert(candidate((\"04-12-2003\")) == (true));\n assert(candidate((\"04122003\")) == (false));\n assert(candidate((\"20030412\")) == (false));\n assert(candidate((\"2003-04\")) == (false));\n assert(candidate((\"2003-04-12\")) == (false));\n assert(candidate((\"04-2003\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that takes a string and returns an ordered version of it.\n// Ordered version of string, is a string where all words (separated by space)\n// are replaced by a new word where all the characters arranged in\n// ascending order based on ascii value.\n// Note: You should keep the order of words and blank spaces in the sentence.\n// For example:\n// >>> anti_shuffle((\"Hi\"))\n// (\"Hi\")\n// >>> anti_shuffle((\"hello\"))\n// (\"ehllo\")\n// >>> anti_shuffle((\"Hello World!!!\"))\n// (\"Hello !!!Wdlor\")\nstd::string anti_shuffle(std::string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = anti_shuffle;\n assert(candidate((\"Hi\")) == (\"Hi\"));\n assert(candidate((\"hello\")) == (\"ehllo\"));\n assert(candidate((\"number\")) == (\"bemnru\"));\n assert(candidate((\"abcd\")) == (\"abcd\"));\n assert(candidate((\"Hello World!!!\")) == (\"Hello !!!Wdlor\"));\n assert(candidate((\"\")) == (\"\"));\n assert(candidate((\"Hi. My name is Mister Robot. How are you?\")) == (\".Hi My aemn is Meirst .Rboot How aer ?ouy\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "cpp", - "prompt": "#include\n#include\n// Given a list of numbers, return whether or not they are sorted\n// in ascending order. If list has more than 1 duplicate of the same\n// number, return False. Assume no negative numbers and only integers.\n// Examples\n// >>> is_sorted((std::vector({(long)5})))\n// (true)\n// >>> is_sorted((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5})))\n// (true)\n// >>> is_sorted((std::vector({(long)1, (long)3, (long)2, (long)4, (long)5})))\n// (false)\n// >>> is_sorted((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6})))\n// (true)\n// >>> is_sorted((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6, (long)7})))\n// (true)\n// >>> is_sorted((std::vector({(long)1, (long)3, (long)2, (long)4, (long)5, (long)6, (long)7})))\n// (false)\n// >>> is_sorted((std::vector({(long)1, (long)2, (long)2, (long)3, (long)3, (long)4})))\n// (true)\n// >>> is_sorted((std::vector({(long)1, (long)2, (long)2, (long)2, (long)3, (long)4})))\n// (false)\nbool is_sorted(std::vector lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = is_sorted;\n assert(candidate((std::vector({(long)5}))) == (true));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5}))) == (true));\n assert(candidate((std::vector({(long)1, (long)3, (long)2, (long)4, (long)5}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}))) == (true));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6, (long)7}))) == (true));\n assert(candidate((std::vector({(long)1, (long)3, (long)2, (long)4, (long)5, (long)6, (long)7}))) == (false));\n assert(candidate((std::vector())) == (true));\n assert(candidate((std::vector({(long)1}))) == (true));\n assert(candidate((std::vector({(long)3, (long)2, (long)1}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)2, (long)2, (long)3, (long)4}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)3, (long)3, (long)4}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)2, (long)3, (long)3, (long)4}))) == (true));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4}))) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a string s.\n// Your task is to check if the string is happy or not.\n// A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n// For example:\n// >>> is_happy((\"a\"))\n// (false)\n// >>> is_happy((\"aa\"))\n// (false)\n// >>> is_happy((\"abcd\"))\n// (true)\n// >>> is_happy((\"aabb\"))\n// (false)\n// >>> is_happy((\"adb\"))\n// (true)\n// >>> is_happy((\"xyy\"))\n// (false)\nbool is_happy(std::string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = is_happy;\n assert(candidate((\"a\")) == (false));\n assert(candidate((\"aa\")) == (false));\n assert(candidate((\"abcd\")) == (true));\n assert(candidate((\"aabb\")) == (false));\n assert(candidate((\"adb\")) == (true));\n assert(candidate((\"xyy\")) == (false));\n assert(candidate((\"iopaxpoi\")) == (true));\n assert(candidate((\"iopaxioi\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "cpp", - "prompt": "#include\n#include\n// Write a function that returns True if the object q will fly, and False otherwise.\n// The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n// Example:\n// >>> will_it_fly((std::vector({(long)1, (long)2})), (5))\n// (false)\n// # 1+2 is less than the maximum possible weight, but it's unbalanced.\n// >>> will_it_fly((std::vector({(long)3, (long)2, (long)3})), (1))\n// (false)\n// # it's balanced, but 3+2+3 is more than the maximum possible weight.\n// >>> will_it_fly((std::vector({(long)3, (long)2, (long)3})), (9))\n// (true)\n// # 3+2+3 is less than the maximum possible weight, and it's balanced.\n// >>> will_it_fly((std::vector({(long)3})), (5))\n// (true)\n// # 3 is less than the maximum possible weight, and it's balanced.\nbool will_it_fly(std::vector q, long w) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = will_it_fly;\n assert(candidate((std::vector({(long)3, (long)2, (long)3})), (9)) == (true));\n assert(candidate((std::vector({(long)1, (long)2})), (5)) == (false));\n assert(candidate((std::vector({(long)3})), (5)) == (true));\n assert(candidate((std::vector({(long)3, (long)2, (long)3})), (1)) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)3})), (6)) == (false));\n assert(candidate((std::vector({(long)5})), (5)) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "cpp", - "prompt": "#include\n#include\n// Given an array of non-negative integers, return a copy of the given array after sorting,\n// you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n// or sort it in descending order if the sum( first index value, last index value) is even.\n// Note:\n// * don't change the given array.\n// Examples:\n// >>> sort_array((std::vector()))\n// (std::vector())\n// >>> sort_array((std::vector({(long)5})))\n// (std::vector({(long)5}))\n// >>> sort_array((std::vector({(long)2, (long)4, (long)3, (long)0, (long)1, (long)5})))\n// (std::vector({(long)0, (long)1, (long)2, (long)3, (long)4, (long)5}))\n// >>> sort_array((std::vector({(long)2, (long)4, (long)3, (long)0, (long)1, (long)5, (long)6})))\n// (std::vector({(long)6, (long)5, (long)4, (long)3, (long)2, (long)1, (long)0}))\nstd::vector sort_array(std::vector array) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = sort_array;\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)5}))) == (std::vector({(long)5})));\n assert(candidate((std::vector({(long)2, (long)4, (long)3, (long)0, (long)1, (long)5}))) == (std::vector({(long)0, (long)1, (long)2, (long)3, (long)4, (long)5})));\n assert(candidate((std::vector({(long)2, (long)4, (long)3, (long)0, (long)1, (long)5, (long)6}))) == (std::vector({(long)6, (long)5, (long)4, (long)3, (long)2, (long)1, (long)0})));\n assert(candidate((std::vector({(long)2, (long)1}))) == (std::vector({(long)1, (long)2})));\n assert(candidate((std::vector({(long)15, (long)42, (long)87, (long)32, (long)11, (long)0}))) == (std::vector({(long)0, (long)11, (long)15, (long)32, (long)42, (long)87})));\n assert(candidate((std::vector({(long)21, (long)14, (long)23, (long)11}))) == (std::vector({(long)23, (long)21, (long)14, (long)11})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "cpp", - "prompt": "#include\n#include\n// Implement a function that takes an non-negative integer and returns an array of the first n\n// integers that are prime numbers and less than n.\n// for example:\n// >>> count_up_to((5))\n// (std::vector({(long)2, (long)3}))\n// >>> count_up_to((11))\n// (std::vector({(long)2, (long)3, (long)5, (long)7}))\n// >>> count_up_to((0))\n// (std::vector())\n// >>> count_up_to((20))\n// (std::vector({(long)2, (long)3, (long)5, (long)7, (long)11, (long)13, (long)17, (long)19}))\n// >>> count_up_to((1))\n// (std::vector())\n// >>> count_up_to((18))\n// (std::vector({(long)2, (long)3, (long)5, (long)7, (long)11, (long)13, (long)17}))\nstd::vector count_up_to(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = count_up_to;\n assert(candidate((5)) == (std::vector({(long)2, (long)3})));\n assert(candidate((6)) == (std::vector({(long)2, (long)3, (long)5})));\n assert(candidate((7)) == (std::vector({(long)2, (long)3, (long)5})));\n assert(candidate((10)) == (std::vector({(long)2, (long)3, (long)5, (long)7})));\n assert(candidate((0)) == (std::vector()));\n assert(candidate((22)) == (std::vector({(long)2, (long)3, (long)5, (long)7, (long)11, (long)13, (long)17, (long)19})));\n assert(candidate((1)) == (std::vector()));\n assert(candidate((18)) == (std::vector({(long)2, (long)3, (long)5, (long)7, (long)11, (long)13, (long)17})));\n assert(candidate((47)) == (std::vector({(long)2, (long)3, (long)5, (long)7, (long)11, (long)13, (long)17, (long)19, (long)23, (long)29, (long)31, (long)37, (long)41, (long)43})));\n assert(candidate((101)) == (std::vector({(long)2, (long)3, (long)5, (long)7, (long)11, (long)13, (long)17, (long)19, (long)23, (long)29, (long)31, (long)37, (long)41, (long)43, (long)47, (long)53, (long)59, (long)61, (long)67, (long)71, (long)73, (long)79, (long)83, (long)89, (long)97})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "cpp", - "prompt": "#include\n#include\n// Out of list of strings, return the longest one. Return the first one in case of multiple\n// strings of the same length. Return None in case the input list is empty.\n// >>> longest((std::vector()))\n// std::nullopt\n// >>> longest((std::vector({(std::string)\"a\", (std::string)\"b\", (std::string)\"c\"})))\n// \"a\"\n// >>> longest((std::vector({(std::string)\"a\", (std::string)\"bb\", (std::string)\"ccc\"})))\n// \"ccc\"\nstd::optional longest(std::vector strings) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = longest;\n assert(candidate((std::vector())) == std::nullopt);\n assert(candidate((std::vector({(std::string)\"x\", (std::string)\"y\", (std::string)\"z\"}))) == \"x\");\n assert(candidate((std::vector({(std::string)\"x\", (std::string)\"yyy\", (std::string)\"zzzz\", (std::string)\"www\", (std::string)\"kkkk\", (std::string)\"abc\"}))) == \"zzzz\");\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "cpp", - "prompt": "#include\n#include\n// Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n// reverse the resulting array, and then replace each digit by its corresponding name from\n// \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n// For example:\n// >>> by_length((std::vector({(long)2, (long)1, (long)1, (long)4, (long)5, (long)8, (long)2, (long)3})))\n// (std::vector({(std::string)\"Eight\", (std::string)\"Five\", (std::string)\"Four\", (std::string)\"Three\", (std::string)\"Two\", (std::string)\"Two\", (std::string)\"One\", (std::string)\"One\"}))\n// If the array is empty, return an empty array:\n// >>> by_length((std::vector()))\n// (std::vector())\n// If the array has any strange number ignore it:\n// >>> by_length((std::vector({(long)1, (long)-1, (long)55})))\n// (std::vector({(std::string)\"One\"}))\nstd::vector by_length(std::vector arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = by_length;\n assert(candidate((std::vector({(long)2, (long)1, (long)1, (long)4, (long)5, (long)8, (long)2, (long)3}))) == (std::vector({(std::string)\"Eight\", (std::string)\"Five\", (std::string)\"Four\", (std::string)\"Three\", (std::string)\"Two\", (std::string)\"Two\", (std::string)\"One\", (std::string)\"One\"})));\n assert(candidate((std::vector())) == (std::vector()));\n assert(candidate((std::vector({(long)1, (long)-1, (long)55}))) == (std::vector({(std::string)\"One\"})));\n assert(candidate((std::vector({(long)1, (long)-1, (long)3, (long)2}))) == (std::vector({(std::string)\"Three\", (std::string)\"Two\", (std::string)\"One\"})));\n assert(candidate((std::vector({(long)9, (long)4, (long)8}))) == (std::vector({(std::string)\"Nine\", (std::string)\"Eight\", (std::string)\"Four\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_106_f", - "language": "cpp", - "prompt": "#include\n#include\n// Implement the function f that takes n as a parameter,\n// 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\n// or the sum of numbers from 1 to i otherwise.\n// i starts from 1.\n// the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n// Example:\n// >>> f((5))\n// (std::vector({(long)1, (long)2, (long)6, (long)24, (long)15}))\nstd::vector f(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = f;\n assert(candidate((5)) == (std::vector({(long)1, (long)2, (long)6, (long)24, (long)15})));\n assert(candidate((7)) == (std::vector({(long)1, (long)2, (long)6, (long)24, (long)15, (long)720, (long)28})));\n assert(candidate((1)) == (std::vector({(long)1})));\n assert(candidate((3)) == (std::vector({(long)1, (long)2, (long)6})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "cpp", - "prompt": "#include\n#include\n// Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n// >>> fizz_buzz((50))\n// (0)\n// >>> fizz_buzz((78))\n// (2)\n// >>> fizz_buzz((79))\n// (3)\nlong fizz_buzz(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = fizz_buzz;\n assert(candidate((50)) == (0));\n assert(candidate((78)) == (2));\n assert(candidate((79)) == (3));\n assert(candidate((100)) == (3));\n assert(candidate((200)) == (6));\n assert(candidate((4000)) == (192));\n assert(candidate((10000)) == (639));\n assert(candidate((100000)) == (8026));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "cpp", - "prompt": "#include\n#include\n// Given a positive floating point number, it can be decomposed into\n// and integer part (largest integer smaller than given number) and decimals\n// (leftover part always smaller than 1).\n// Return the decimal part of the number.\n// >>> truncate_number((3.5))\n// (0.5)\nfloat truncate_number(float number) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = truncate_number;\n assert(candidate((3.5)) == (0.5));\n assert(candidate((1.25)) == (0.25));\n assert(candidate((123.0)) == (0.0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "cpp", - "prompt": "#include\n#include\n// For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n// Empty sum should be equal to 0 and empty product should be equal to 1.\n// >>> sum_product((std::vector()))\n// (std::make_tuple(0, 1))\n// >>> sum_product((std::vector({(long)1, (long)2, (long)3, (long)4})))\n// (std::make_tuple(10, 24))\nstd::tuple sum_product(std::vector numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = sum_product;\n assert(candidate((std::vector())) == (std::make_tuple(0, 1)));\n assert(candidate((std::vector({(long)1, (long)1, (long)1}))) == (std::make_tuple(3, 1)));\n assert(candidate((std::vector({(long)100, (long)0}))) == (std::make_tuple(100, 0)));\n assert(candidate((std::vector({(long)3, (long)5, (long)7}))) == (std::make_tuple(15, 105)));\n assert(candidate((std::vector({(long)10}))) == (std::make_tuple(10, 10)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a 2 dimensional data, as a nested lists,\n// which is similar to matrix, however, unlike matrices,\n// each row may contain a different number of columns.\n// Given lst, and integer x, find integers x in the list,\n// and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n// each tuple is a coordinate - (row, columns), starting with 0.\n// Sort coordinates initially by rows in ascending order.\n// Also, sort coordinates of the row by columns in descending order.\n// Examples:\n// >>> get_row((std::vector>({(std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)1, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)1})})), (1))\n// (std::vector>({(std::tuple)std::make_tuple(0, 0), (std::tuple)std::make_tuple(1, 4), (std::tuple)std::make_tuple(1, 0), (std::tuple)std::make_tuple(2, 5), (std::tuple)std::make_tuple(2, 0)}))\n// >>> get_row((std::vector>()), (1))\n// (std::vector>())\n// >>> get_row((std::vector>({(std::vector)std::vector(), (std::vector)std::vector({(long)1}), (std::vector)std::vector({(long)1, (long)2, (long)3})})), (3))\n// (std::vector>({(std::tuple)std::make_tuple(2, 2)}))\nstd::vector> get_row(std::vector> lst, long x) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = get_row;\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)1, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)1})})), (1)) == (std::vector>({(std::tuple)std::make_tuple(0, 0), (std::tuple)std::make_tuple(1, 4), (std::tuple)std::make_tuple(1, 0), (std::tuple)std::make_tuple(2, 5), (std::tuple)std::make_tuple(2, 0)})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6})})), (2)) == (std::vector>({(std::tuple)std::make_tuple(0, 1), (std::tuple)std::make_tuple(1, 1), (std::tuple)std::make_tuple(2, 1), (std::tuple)std::make_tuple(3, 1), (std::tuple)std::make_tuple(4, 1), (std::tuple)std::make_tuple(5, 1)})));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)1, (long)3, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)1, (long)4, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)1, (long)5, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)1, (long)6}), (std::vector)std::vector({(long)1, (long)2, (long)3, (long)4, (long)5, (long)1})})), (1)) == (std::vector>({(std::tuple)std::make_tuple(0, 0), (std::tuple)std::make_tuple(1, 0), (std::tuple)std::make_tuple(2, 1), (std::tuple)std::make_tuple(2, 0), (std::tuple)std::make_tuple(3, 2), (std::tuple)std::make_tuple(3, 0), (std::tuple)std::make_tuple(4, 3), (std::tuple)std::make_tuple(4, 0), (std::tuple)std::make_tuple(5, 4), (std::tuple)std::make_tuple(5, 0), (std::tuple)std::make_tuple(6, 5), (std::tuple)std::make_tuple(6, 0)})));\n assert(candidate((std::vector>()), (1)) == (std::vector>()));\n assert(candidate((std::vector>({(std::vector)std::vector({(long)1})})), (2)) == (std::vector>()));\n assert(candidate((std::vector>({(std::vector)std::vector(), (std::vector)std::vector({(long)1}), (std::vector)std::vector({(long)1, (long)2, (long)3})})), (3)) == (std::vector>({(std::tuple)std::make_tuple(2, 2)})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "cpp", - "prompt": "#include\n#include\n// You're a hungry rabbit, and you already have eaten a certain number of carrots,\n// but now you need to eat more carrots to complete the day's meals.\n// you should return an array of [ total number of eaten carrots after your meals,\n// the number of carrots left after your meals ]\n// if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n// Example:\n// >>> eat((5), (6), (10))\n// (std::vector({(long)11, (long)4}))\n// >>> eat((4), (8), (9))\n// (std::vector({(long)12, (long)1}))\n// >>> eat((1), (10), (10))\n// (std::vector({(long)11, (long)0}))\n// >>> eat((2), (11), (5))\n// (std::vector({(long)7, (long)0}))\n// Variables:\n// @number : integer\n// the number of carrots that you have eaten.\n// @need : integer\n// the number of carrots that you need to eat.\n// @remaining : integer\n// the number of remaining carrots thet exist in stock\n// Constrain:\n// * 0 <= number <= 1000\n// * 0 <= need <= 1000\n// * 0 <= remaining <= 1000\n// Have fun :)\nstd::vector eat(long number, long need, long remaining) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = eat;\n assert(candidate((5), (6), (10)) == (std::vector({(long)11, (long)4})));\n assert(candidate((4), (8), (9)) == (std::vector({(long)12, (long)1})));\n assert(candidate((1), (10), (10)) == (std::vector({(long)11, (long)0})));\n assert(candidate((2), (11), (5)) == (std::vector({(long)7, (long)0})));\n assert(candidate((4), (5), (7)) == (std::vector({(long)9, (long)2})));\n assert(candidate((4), (5), (1)) == (std::vector({(long)5, (long)0})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "cpp", - "prompt": "#include\n#include\n// Given a positive integer N, return the total sum of its digits in binary.\n// Example\n// >>> solve((1000))\n// (\"1\")\n// >>> solve((150))\n// (\"110\")\n// >>> solve((147))\n// (\"1100\")\n// Variables:\n// @N integer\n// Constraints: 0 \u2264 N \u2264 10000.\n// Output:\n// a string of binary number\nstd::string solve(long N) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = solve;\n assert(candidate((1000)) == (\"1\"));\n assert(candidate((150)) == (\"110\"));\n assert(candidate((147)) == (\"1100\"));\n assert(candidate((333)) == (\"1001\"));\n assert(candidate((963)) == (\"10010\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "cpp", - "prompt": "#include\n#include\n// You are given a list of integers.\n// You need to find the largest prime value and return the sum of its digits.\n// Examples:\n// >>> skjkasdkd((std::vector({(long)0, (long)3, (long)2, (long)1, (long)3, (long)5, (long)7, (long)4, (long)5, (long)5, (long)5, (long)2, (long)181, (long)32, (long)4, (long)32, (long)3, (long)2, (long)32, (long)324, (long)4, (long)3})))\n// (10)\n// >>> skjkasdkd((std::vector({(long)1, (long)0, (long)1, (long)8, (long)2, (long)4597, (long)2, (long)1, (long)3, (long)40, (long)1, (long)2, (long)1, (long)2, (long)4, (long)2, (long)5, (long)1})))\n// (25)\n// >>> skjkasdkd((std::vector({(long)1, (long)3, (long)1, (long)32, (long)5107, (long)34, (long)83278, (long)109, (long)163, (long)23, (long)2323, (long)32, (long)30, (long)1, (long)9, (long)3})))\n// (13)\n// >>> skjkasdkd((std::vector({(long)0, (long)724, (long)32, (long)71, (long)99, (long)32, (long)6, (long)0, (long)5, (long)91, (long)83, (long)0, (long)5, (long)6})))\n// (11)\n// >>> skjkasdkd((std::vector({(long)0, (long)81, (long)12, (long)3, (long)1, (long)21})))\n// (3)\n// >>> skjkasdkd((std::vector({(long)0, (long)8, (long)1, (long)2, (long)1, (long)7})))\n// (7)\nlong skjkasdkd(std::vector lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = skjkasdkd;\n assert(candidate((std::vector({(long)0, (long)3, (long)2, (long)1, (long)3, (long)5, (long)7, (long)4, (long)5, (long)5, (long)5, (long)2, (long)181, (long)32, (long)4, (long)32, (long)3, (long)2, (long)32, (long)324, (long)4, (long)3}))) == (10));\n assert(candidate((std::vector({(long)1, (long)0, (long)1, (long)8, (long)2, (long)4597, (long)2, (long)1, (long)3, (long)40, (long)1, (long)2, (long)1, (long)2, (long)4, (long)2, (long)5, (long)1}))) == (25));\n assert(candidate((std::vector({(long)1, (long)3, (long)1, (long)32, (long)5107, (long)34, (long)83278, (long)109, (long)163, (long)23, (long)2323, (long)32, (long)30, (long)1, (long)9, (long)3}))) == (13));\n assert(candidate((std::vector({(long)0, (long)724, (long)32, (long)71, (long)99, (long)32, (long)6, (long)0, (long)5, (long)91, (long)83, (long)0, (long)5, (long)6}))) == (11));\n assert(candidate((std::vector({(long)0, (long)81, (long)12, (long)3, (long)1, (long)21}))) == (3));\n assert(candidate((std::vector({(long)0, (long)8, (long)1, (long)2, (long)1, (long)7}))) == (7));\n assert(candidate((std::vector({(long)8191}))) == (19));\n assert(candidate((std::vector({(long)8191, (long)123456, (long)127, (long)7}))) == (19));\n assert(candidate((std::vector({(long)127, (long)97, (long)8192}))) == (10));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "cpp", - "prompt": "#include\n#include\n// Given an array arr of integers, find the minimum number of elements that\n// need to be changed to make the array palindromic. A palindromic array is an array that\n// is read the same backwards and forwards. In one change, you can change one element to any other element.\n// For example:\n// >>> smallest_change((std::vector({(long)1, (long)2, (long)3, (long)5, (long)4, (long)7, (long)9, (long)6})))\n// (4)\n// >>> smallest_change((std::vector({(long)1, (long)2, (long)3, (long)4, (long)3, (long)2, (long)2})))\n// (1)\n// >>> smallest_change((std::vector({(long)1, (long)2, (long)3, (long)2, (long)1})))\n// (0)\nlong smallest_change(std::vector arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = smallest_change;\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)5, (long)4, (long)7, (long)9, (long)6}))) == (4));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)4, (long)3, (long)2, (long)2}))) == (1));\n assert(candidate((std::vector({(long)1, (long)4, (long)2}))) == (1));\n assert(candidate((std::vector({(long)1, (long)4, (long)4, (long)2}))) == (1));\n assert(candidate((std::vector({(long)1, (long)2, (long)3, (long)2, (long)1}))) == (0));\n assert(candidate((std::vector({(long)3, (long)1, (long)1, (long)3}))) == (0));\n assert(candidate((std::vector({(long)1}))) == (0));\n assert(candidate((std::vector({(long)0, (long)1}))) == (1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "cpp", - "prompt": "#include\n#include\n// It is the last week of the semester and the teacher has to give the grades\n// to students. The teacher has been making her own algorithm for grading.\n// The only problem is, she has lost the code she used for grading.\n// She has given you a list of GPAs for some students and you have to write \n// a function that can output a list of letter grades using the following table:\n// GPA | Letter grade\n// 4.0 A+\n// > 3.7 A \n// > 3.3 A- \n// > 3.0 B+\n// > 2.7 B \n// > 2.3 B-\n// > 2.0 C+\n// > 1.7 C\n// > 1.3 C-\n// > 1.0 D+ \n// > 0.7 D \n// > 0.0 D-\n// 0.0 E\n// Example:\n// >>> grade_equation((std::vector({(float)4.0, (float)3, (float)1.7, (float)2, (float)3.5})))\n// (std::vector({(std::string)\"A+\", (std::string)\"B\", (std::string)\"C-\", (std::string)\"C\", (std::string)\"A-\"}))\nstd::vector numerical_letter_grade(std::vector grades) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = numerical_letter_grade;\n assert(candidate((std::vector({(float)4.0, (float)3, (float)1.7, (float)2, (float)3.5}))) == (std::vector({(std::string)\"A+\", (std::string)\"B\", (std::string)\"C-\", (std::string)\"C\", (std::string)\"A-\"})));\n assert(candidate((std::vector({(float)1.2}))) == (std::vector({(std::string)\"D+\"})));\n assert(candidate((std::vector({(float)0.5}))) == (std::vector({(std::string)\"D-\"})));\n assert(candidate((std::vector({(float)0.0}))) == (std::vector({(std::string)\"E\"})));\n assert(candidate((std::vector({(float)1.0, (float)0.3, (float)1.5, (float)2.8, (float)3.3}))) == (std::vector({(std::string)\"D\", (std::string)\"D-\", (std::string)\"C-\", (std::string)\"B\", (std::string)\"B+\"})));\n assert(candidate((std::vector({(float)0.0, (float)0.7}))) == (std::vector({(std::string)\"E\", (std::string)\"D-\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "cpp", - "prompt": "#include\n#include\n// Given the lengths of the three sides of a triangle. Return the area of\n// the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n// Otherwise return -1\n// Three sides make a valid triangle when the sum of any two sides is greater \n// than the third side.\n// Example:\n// >>> triangle_area((3), (4), (5))\n// (6.0)\n// >>> triangle_area((1), (2), (10))\n// (float(-1))\nfloat triangle_area(long a, long b, long c) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = triangle_area;\n assert(candidate((3), (4), (5)) == (6.0));\n assert(candidate((1), (2), (10)) == (float(-1)));\n assert(candidate((4), (8), (5)) == (8.18));\n assert(candidate((2), (2), (2)) == (1.73));\n assert(candidate((1), (2), (3)) == (float(-1)));\n assert(candidate((10), (5), (7)) == (16.25));\n assert(candidate((2), (6), (3)) == (float(-1)));\n assert(candidate((1), (1), (1)) == (0.43));\n assert(candidate((2), (2), (10)) == (float(-1)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "cpp", - "prompt": "#include\n#include\n// Check if two words have the same characters.\n// >>> same_chars((\"eabcdzzzz\"), (\"dddzzzzzzzddeddabc\"))\n// (true)\n// >>> same_chars((\"abcd\"), (\"dddddddabc\"))\n// (true)\n// >>> same_chars((\"dddddddabc\"), (\"abcd\"))\n// (true)\n// >>> same_chars((\"eabcd\"), (\"dddddddabc\"))\n// (false)\n// >>> same_chars((\"abcd\"), (\"dddddddabce\"))\n// (false)\n// >>> same_chars((\"eabcdzzzz\"), (\"dddzzzzzzzddddabc\"))\n// (false)\nbool same_chars(std::string s0, std::string s1) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = same_chars;\n assert(candidate((\"eabcdzzzz\"), (\"dddzzzzzzzddeddabc\")) == (true));\n assert(candidate((\"abcd\"), (\"dddddddabc\")) == (true));\n assert(candidate((\"dddddddabc\"), (\"abcd\")) == (true));\n assert(candidate((\"eabcd\"), (\"dddddddabc\")) == (false));\n assert(candidate((\"abcd\"), (\"dddddddabcf\")) == (false));\n assert(candidate((\"eabcdzzzz\"), (\"dddzzzzzzzddddabc\")) == (false));\n assert(candidate((\"aabb\"), (\"aaccc\")) == (false));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "cpp", - "prompt": "#include\n#include\n// Given an array of integers nums, find the minimum sum of any non-empty sub-array\n// of nums.\n// Example\n// >>> minSubArraySum((std::vector({(long)2, (long)3, (long)4, (long)1, (long)2, (long)4})))\n// (1)\n// >>> minSubArraySum((std::vector({(long)-1, (long)-2, (long)-3})))\n// (-6)\nlong minSubArraySum(std::vector nums) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = minSubArraySum;\n assert(candidate((std::vector({(long)2, (long)3, (long)4, (long)1, (long)2, (long)4}))) == (1));\n assert(candidate((std::vector({(long)-1, (long)-2, (long)-3}))) == (-6));\n assert(candidate((std::vector({(long)-1, (long)-2, (long)-3, (long)2, (long)-10}))) == (-14));\n assert(candidate((std::vector({(long)-9999999999999999}))) == (-9999999999999999));\n assert(candidate((std::vector({(long)0, (long)10, (long)20, (long)1000000}))) == (0));\n assert(candidate((std::vector({(long)-1, (long)-2, (long)-3, (long)10, (long)-5}))) == (-6));\n assert(candidate((std::vector({(long)100, (long)-1, (long)-2, (long)-3, (long)10, (long)-5}))) == (-6));\n assert(candidate((std::vector({(long)10, (long)11, (long)13, (long)8, (long)3, (long)4}))) == (3));\n assert(candidate((std::vector({(long)100, (long)-33, (long)32, (long)-1, (long)0, (long)-2}))) == (-33));\n assert(candidate((std::vector({(long)-10}))) == (-10));\n assert(candidate((std::vector({(long)7}))) == (7));\n assert(candidate((std::vector({(long)1, (long)-1}))) == (-1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "cpp", - "prompt": "#include\n#include\n// Given a string s and a natural number n, you have been tasked to implement \n// a function that returns a list of all words from string s that contain exactly \n// n consonants, in order these words appear in the string s.\n// If the string s is empty then the function should return an empty list.\n// Note: you may assume the input string contains only letters and spaces.\n// Examples:\n// >>> select_words((\"Mary had a little lamb\"), (4))\n// (std::vector({(std::string)\"little\"}))\n// >>> select_words((\"Mary had a little lamb\"), (3))\n// (std::vector({(std::string)\"Mary\", (std::string)\"lamb\"}))\n// >>> select_words((\"simple white space\"), (2))\n// (std::vector())\n// >>> select_words((\"Hello world\"), (4))\n// (std::vector({(std::string)\"world\"}))\n// >>> select_words((\"Uncle sam\"), (3))\n// (std::vector({(std::string)\"Uncle\"}))\nstd::vector select_words(std::string s, long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = select_words;\n assert(candidate((\"Mary had a little lamb\"), (4)) == (std::vector({(std::string)\"little\"})));\n assert(candidate((\"Mary had a little lamb\"), (3)) == (std::vector({(std::string)\"Mary\", (std::string)\"lamb\"})));\n assert(candidate((\"simple white space\"), (2)) == (std::vector()));\n assert(candidate((\"Hello world\"), (4)) == (std::vector({(std::string)\"world\"})));\n assert(candidate((\"Uncle sam\"), (3)) == (std::vector({(std::string)\"Uncle\"})));\n assert(candidate((\"\"), (4)) == (std::vector()));\n assert(candidate((\"a b c d e f\"), (1)) == (std::vector({(std::string)\"b\", (std::string)\"c\", (std::string)\"d\", (std::string)\"f\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "cpp", - "prompt": "#include\n#include\n// Return list of all prefixes from shortest to longest of the input string\n// >>> all_prefixes((\"abc\"))\n// (std::vector({(std::string)\"a\", (std::string)\"ab\", (std::string)\"abc\"}))\nstd::vector all_prefixes(std::string string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = all_prefixes;\n assert(candidate((\"\")) == (std::vector()));\n assert(candidate((\"asdfgh\")) == (std::vector({(std::string)\"a\", (std::string)\"as\", (std::string)\"asd\", (std::string)\"asdf\", (std::string)\"asdfg\", (std::string)\"asdfgh\"})));\n assert(candidate((\"WWW\")) == (std::vector({(std::string)\"W\", (std::string)\"WW\", (std::string)\"WWW\"})));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function that takes a value (string) representing a number\n// and returns the closest integer to it. If the number is equidistant\n// from two integers, round it away from zero.\n// Examples\n// >>> closest_integer((\"10\"))\n// (10)\n// >>> closest_integer((\"15.3\"))\n// (15)\n// Note:\n// Rounding away from zero means that if the given number is equidistant\n// from two integers, the one you should return is the one that is the\n// farthest from zero. For example closest_integer(\"14.5\") should\n// return 15 and closest_integer(\"-14.5\") should return -15.\nlong closest_integer(std::string value) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = closest_integer;\n assert(candidate((\"10\")) == (10));\n assert(candidate((\"14.5\")) == (15));\n assert(candidate((\"-15.5\")) == (-16));\n assert(candidate((\"15.3\")) == (15));\n assert(candidate((\"0\")) == (0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "cpp", - "prompt": "#include\n#include\n// Create a function which takes a string representing a file's name, and returns\n// 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n// A file's name is considered to be valid if and only if all the following conditions \n// are met:\n// - There should not be more than three digits ('0'-'9') in the file's name.\n// - The file's name contains exactly one dot '.'\n// - The substring before the dot should not be empty, and it starts with a letter from \n// the latin alphapet ('a'-'z' and 'A'-'Z').\n// - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n// Examples:\n// >>> file_name_check((\"example.txt\"))\n// (\"Yes\")\n// >>> file_name_check((\"1example.dll\"))\n// (\"No\")\nstd::string file_name_check(std::string file_name) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = file_name_check;\n assert(candidate((\"example.txt\")) == (\"Yes\"));\n assert(candidate((\"1example.dll\")) == (\"No\"));\n assert(candidate((\"s1sdf3.asd\")) == (\"No\"));\n assert(candidate((\"K.dll\")) == (\"Yes\"));\n assert(candidate((\"MY16FILE3.exe\")) == (\"Yes\"));\n assert(candidate((\"His12FILE94.exe\")) == (\"No\"));\n assert(candidate((\"_Y.txt\")) == (\"No\"));\n assert(candidate((\"?aREYA.exe\")) == (\"No\"));\n assert(candidate((\"/this_is_valid.dll\")) == (\"No\"));\n assert(candidate((\"this_is_valid.wow\")) == (\"No\"));\n assert(candidate((\"this_is_valid.txt\")) == (\"Yes\"));\n assert(candidate((\"this_is_valid.txtexe\")) == (\"No\"));\n assert(candidate((\"#this2_i4s_5valid.ten\")) == (\"No\"));\n assert(candidate((\"@this1_is6_valid.exe\")) == (\"No\"));\n assert(candidate((\"this_is_12valid.6exe4.txt\")) == (\"No\"));\n assert(candidate((\"all.exe.txt\")) == (\"No\"));\n assert(candidate((\"I563_No.exe\")) == (\"Yes\"));\n assert(candidate((\"Is3youfault.txt\")) == (\"Yes\"));\n assert(candidate((\"no_one#knows.dll\")) == (\"Yes\"));\n assert(candidate((\"1I563_Yes3.exe\")) == (\"No\"));\n assert(candidate((\"I563_Yes3.txtt\")) == (\"No\"));\n assert(candidate((\"final..txt\")) == (\"No\"));\n assert(candidate((\"final132\")) == (\"No\"));\n assert(candidate((\"_f4indsartal132.\")) == (\"No\"));\n assert(candidate((\".txt\")) == (\"No\"));\n assert(candidate((\"s.\")) == (\"No\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "cpp", - "prompt": "#include\n#include\n// You are given two intervals,\n// where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n// The given intervals are closed which means that the interval (start, end)\n// includes both start and end.\n// For each given interval, it is assumed that its start is less or equal its end.\n// Your task is to determine whether the length of intersection of these two \n// intervals is a prime number.\n// Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n// which its length is 1, which not a prime number.\n// If the length of the intersection is a prime number, return \"YES\",\n// otherwise, return \"NO\".\n// If the two intervals don't intersect, return \"NO\".\n// [input/output] samples:\n// >>> intersection((std::make_tuple(1, 2)), (std::make_tuple(2, 3)))\n// (\"NO\")\n// >>> intersection((std::make_tuple(-1, 1)), (std::make_tuple(0, 4)))\n// (\"NO\")\n// >>> intersection((std::make_tuple(-3, -1)), (std::make_tuple(-5, 5)))\n// (\"YES\")\nstd::string intersection(std::tuple interval1, std::tuple interval2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = intersection;\n assert(candidate((std::make_tuple(1, 2)), (std::make_tuple(2, 3))) == (\"NO\"));\n assert(candidate((std::make_tuple(-1, 1)), (std::make_tuple(0, 4))) == (\"NO\"));\n assert(candidate((std::make_tuple(-3, -1)), (std::make_tuple(-5, 5))) == (\"YES\"));\n assert(candidate((std::make_tuple(-2, 2)), (std::make_tuple(-4, 0))) == (\"YES\"));\n assert(candidate((std::make_tuple(-11, 2)), (std::make_tuple(-1, -1))) == (\"NO\"));\n assert(candidate((std::make_tuple(1, 2)), (std::make_tuple(3, 5))) == (\"NO\"));\n assert(candidate((std::make_tuple(1, 2)), (std::make_tuple(1, 2))) == (\"NO\"));\n assert(candidate((std::make_tuple(-2, -2)), (std::make_tuple(-3, -2))) == (\"NO\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "cpp", - "prompt": "#include\n#include\n// Return the largest prime factor of n. Assume n > 1 and is not a prime.\n// >>> largest_prime_factor((13195))\n// (29)\n// >>> largest_prime_factor((2048))\n// (2)\nlong largest_prime_factor(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = largest_prime_factor;\n assert(candidate((15)) == (5));\n assert(candidate((27)) == (3));\n assert(candidate((63)) == (7));\n assert(candidate((330)) == (11));\n assert(candidate((13195)) == (29));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "cpp", - "prompt": "#include\n#include\n// Given a string, find out how many distinct characters (regardless of case) does it consist of\n// >>> count_distinct_characters((\"xyzXYZ\"))\n// (3)\n// >>> count_distinct_characters((\"Jerry\"))\n// (4)\nlong count_distinct_characters(std::string string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = count_distinct_characters;\n assert(candidate((\"\")) == (0));\n assert(candidate((\"abcde\")) == (5));\n assert(candidate((\"abcdecadeCADE\")) == (5));\n assert(candidate((\"aaaaAAAAaaaa\")) == (1));\n assert(candidate((\"Jerry jERRY JeRRRY\")) == (5));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "cpp", - "prompt": "#include\n#include\n// You're given a list of deposit and withdrawal operations on a bank account that starts with\n// zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n// at that point function should return True. Otherwise it should return False.\n// >>> below_zero((std::vector({(long)1, (long)2, (long)3})))\n// (false)\n// >>> below_zero((std::vector({(long)1, (long)2, (long)-4, (long)5})))\n// (true)\nbool below_zero(std::vector operations) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = below_zero;\n assert(candidate((std::vector())) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)-3, (long)1, (long)2, (long)-3}))) == (false));\n assert(candidate((std::vector({(long)1, (long)2, (long)-4, (long)5, (long)6}))) == (true));\n assert(candidate((std::vector({(long)1, (long)-1, (long)2, (long)-2, (long)5, (long)-5, (long)4, (long)-4}))) == (false));\n assert(candidate((std::vector({(long)1, (long)-1, (long)2, (long)-2, (long)5, (long)-5, (long)4, (long)-5}))) == (true));\n assert(candidate((std::vector({(long)1, (long)-2, (long)2, (long)-2, (long)5, (long)-5, (long)4, (long)-4}))) == (true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "cpp", - "prompt": "#include\n#include\n// Find the shortest palindrome that begins with a supplied string.\n// Algorithm idea is simple:\n// - Find the longest postfix of supplied string that is a palindrome.\n// - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n// >>> make_palindrome((\"\"))\n// (\"\")\n// >>> make_palindrome((\"cat\"))\n// (\"catac\")\n// >>> make_palindrome((\"cata\"))\n// (\"catac\")\nstd::string make_palindrome(std::string string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = make_palindrome;\n assert(candidate((\"\")) == (\"\"));\n assert(candidate((\"x\")) == (\"x\"));\n assert(candidate((\"xyz\")) == (\"xyzyx\"));\n assert(candidate((\"xyx\")) == (\"xyx\"));\n assert(candidate((\"jerry\")) == (\"jerryrrej\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "cpp", - "prompt": "#include\n#include\n// Given a positive integer, obtain its roman numeral equivalent as a string,\n// and return it in lowercase.\n// Restrictions: 1 <= num <= 1000\n// Examples:\n// >>> int_to_mini_roman((19))\n// (\"xix\")\n// >>> int_to_mini_roman((152))\n// (\"clii\")\n// >>> int_to_mini_roman((426))\n// (\"cdxxvi\")\nstd::string int_to_mini_roman(long number) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "}\nint main() {\n auto candidate = int_to_mini_roman;\n assert(candidate((19)) == (\"xix\"));\n assert(candidate((152)) == (\"clii\"));\n assert(candidate((251)) == (\"ccli\"));\n assert(candidate((426)) == (\"cdxxvi\"));\n assert(candidate((500)) == (\"d\"));\n assert(candidate((1)) == (\"i\"));\n assert(candidate((4)) == (\"iv\"));\n assert(candidate((43)) == (\"xliii\"));\n assert(candidate((90)) == (\"xc\"));\n assert(candidate((94)) == (\"xciv\"));\n assert(candidate((532)) == (\"dxxxii\"));\n assert(candidate((900)) == (\"cm\"));\n assert(candidate((994)) == (\"cmxciv\"));\n assert(candidate((1000)) == (\"m\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - } -] \ No newline at end of file diff --git a/data/cs-keep.json b/data/cs-keep.json deleted file mode 100644 index 6f46194a5025c519ea690c994f1d7cea2716eaba..0000000000000000000000000000000000000000 --- a/data/cs-keep.json +++ /dev/null @@ -1,1898 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // For a given number n, find the largest number that divides n evenly, smaller than n\n // >>> largest_divisor(15)\n // 5\n public static long LargestDivisor(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(LargestDivisor((3L)) == (1L));\n Debug.Assert(LargestDivisor((7L)) == (1L));\n Debug.Assert(LargestDivisor((10L)) == (5L));\n Debug.Assert(LargestDivisor((100L)) == (50L));\n Debug.Assert(LargestDivisor((49L)) == (7L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_47_median", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return median of elements in the list l.\n // >>> median([3, 1, 2, 4, 5])\n // 3\n // >>> median([-10, 4, 6, 1000, 10, 20])\n // 15.0\n public static float Median(List l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Median((new List(new long[]{(long)3L, (long)1L, (long)2L, (long)4L, (long)5L}))) == (float)3L);\n Debug.Assert(Median((new List(new long[]{(long)-10L, (long)4L, (long)6L, (long)1000L, (long)10L, (long)20L}))) == (8.0f));\n Debug.Assert(Median((new List(new long[]{(long)5L}))) == (float)5L);\n Debug.Assert(Median((new List(new long[]{(long)6L, (long)5L}))) == (5.5f));\n Debug.Assert(Median((new List(new long[]{(long)8L, (long)1L, (long)3L, (long)9L, (long)9L, (long)2L, (long)7L}))) == (float)7L);\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given two lists operator, and operand. The first list has basic algebra operations, and \n // the second list is a list of integers. Use the two given lists to build the algebric \n // expression and return the evaluation of this expression.\n // The basic algebra operations:\n // Addition ( + ) \n // Subtraction ( - ) \n // Multiplication ( * ) \n // Floor division ( // ) \n // Exponentiation ( ** ) \n // Example:\n // operator['+', '*', '-']\n // array = [2, 3, 4, 5]\n // result = 2 + 3 * 4 - 5\n // => result = 9\n // Note:\n // The length of operator list is equal to the length of operand list minus one.\n // Operand is a list of of non-negative integers.\n // Operator list has at least one operator, and operand list has at least two operands.\n public static long DoAlgebra(List op, List operand) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(DoAlgebra((new List(new string[]{(string)\"**\", (string)\"*\", (string)\"+\"})), (new List(new long[]{(long)2L, (long)3L, (long)4L, (long)5L}))) == (37L));\n Debug.Assert(DoAlgebra((new List(new string[]{(string)\"+\", (string)\"*\", (string)\"-\"})), (new List(new long[]{(long)2L, (long)3L, (long)4L, (long)5L}))) == (9L));\n Debug.Assert(DoAlgebra((new List(new string[]{(string)\"//\", (string)\"*\"})), (new List(new long[]{(long)7L, (long)3L, (long)4L}))) == (8L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return maximum element in the list.\n // >>> max_element([1, 2, 3])\n // 3\n // >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n // 123\n public static long MaxElement(List l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(MaxElement((new List(new long[]{(long)1L, (long)2L, (long)3L}))) == (3L));\n Debug.Assert(MaxElement((new List(new long[]{(long)5L, (long)3L, (long)-5L, (long)2L, (long)-3L, (long)3L, (long)9L, (long)0L, (long)124L, (long)1L, (long)-10L}))) == (124L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function which returns the largest index of an element which\n // is not greater than or equal to the element immediately preceding it. If\n // no such element exists then return -1. The given array will not contain\n // duplicate values.\n // Examples:\n // can_arrange([1,2,4,3,5]) = 3\n // can_arrange([1,2,3]) = -1\n public static long CanArrange(List arr) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CanArrange((new List(new long[]{(long)1L, (long)2L, (long)4L, (long)3L, (long)5L}))) == (3L));\n Debug.Assert(CanArrange((new List(new long[]{(long)1L, (long)2L, (long)4L, (long)5L}))) == (-1L));\n Debug.Assert(CanArrange((new List(new long[]{(long)1L, (long)4L, (long)2L, (long)5L, (long)6L, (long)7L, (long)8L, (long)9L, (long)10L}))) == (2L));\n Debug.Assert(CanArrange((new List(new long[]{(long)4L, (long)8L, (long)5L, (long)7L, (long)3L}))) == (4L));\n Debug.Assert(CanArrange((new List())) == (-1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Imagine a road that's a perfectly straight infinitely long line.\n // n cars are driving left to right; simultaneously, a different set of n cars\n // are driving right to left. The two sets of cars start out being very far from\n // each other. All cars move in the same speed. Two cars are said to collide\n // when a car that's moving left to right hits a car that's moving right to left.\n // However, the cars are infinitely sturdy and strong; as a result, they continue moving\n // in their trajectory as if they did not collide.\n // This function outputs the number of such collisions.\n public static long CarRaceCollision(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CarRaceCollision((2L)) == (4L));\n Debug.Assert(CarRaceCollision((3L)) == (9L));\n Debug.Assert(CarRaceCollision((4L)) == (16L));\n Debug.Assert(CarRaceCollision((8L)) == (64L));\n Debug.Assert(CarRaceCollision((10L)) == (100L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function that returns True if the last character\n // of a given string is an alphabetical character and is not\n // a part of a word, and False otherwise.\n // Note: \"word\" is a group of characters separated by space.\n // Examples:\n // check_if_last_char_is_a_letter(\"apple pie\") \u279e False\n // check_if_last_char_is_a_letter(\"apple pi e\") \u279e True\n // check_if_last_char_is_a_letter(\"apple pi e \") \u279e False\n // check_if_last_char_is_a_letter(\"\") \u279e False\n public static bool CheckIfLastCharIsALetter(string txt) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CheckIfLastCharIsALetter((\"apple\")) == (false));\n Debug.Assert(CheckIfLastCharIsALetter((\"apple pi e\")) == (true));\n Debug.Assert(CheckIfLastCharIsALetter((\"eeeee\")) == (false));\n Debug.Assert(CheckIfLastCharIsALetter((\"A\")) == (true));\n Debug.Assert(CheckIfLastCharIsALetter((\"Pumpkin pie \")) == (false));\n Debug.Assert(CheckIfLastCharIsALetter((\"Pumpkin pie 1\")) == (false));\n Debug.Assert(CheckIfLastCharIsALetter((\"\")) == (false));\n Debug.Assert(CheckIfLastCharIsALetter((\"eeeee e \")) == (false));\n Debug.Assert(CheckIfLastCharIsALetter((\"apple pie\")) == (false));\n Debug.Assert(CheckIfLastCharIsALetter((\"apple pi e \")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return true if a given number is prime, and false otherwise.\n // >>> is_prime(6)\n // False\n // >>> is_prime(101)\n // True\n // >>> is_prime(11)\n // True\n // >>> is_prime(13441)\n // True\n // >>> is_prime(61)\n // True\n // >>> is_prime(4)\n // False\n // >>> is_prime(1)\n // False\n public static bool IsPrime(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsPrime((6L)) == (false));\n Debug.Assert(IsPrime((101L)) == (true));\n Debug.Assert(IsPrime((11L)) == (true));\n Debug.Assert(IsPrime((13441L)) == (true));\n Debug.Assert(IsPrime((61L)) == (true));\n Debug.Assert(IsPrime((4L)) == (false));\n Debug.Assert(IsPrime((1L)) == (false));\n Debug.Assert(IsPrime((5L)) == (true));\n Debug.Assert(IsPrime((11L)) == (true));\n Debug.Assert(IsPrime((17L)) == (true));\n Debug.Assert(IsPrime((85L)) == (false));\n Debug.Assert(IsPrime((77L)) == (false));\n Debug.Assert(IsPrime((255379L)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a list of positive integers x. return a sorted list of all \n // elements that hasn't any even digit.\n // Note: Returned list should be sorted in increasing order.\n // For example:\n // >>> unique_digits([15, 33, 1422, 1])\n // [1, 15, 33]\n // >>> unique_digits([152, 323, 1422, 10])\n // []\n public static List UniqueDigits(List x) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(UniqueDigits((new List(new long[]{(long)15L, (long)33L, (long)1422L, (long)1L}))).Equals((new List(new long[]{(long)1L, (long)15L, (long)33L}))));\n Debug.Assert(UniqueDigits((new List(new long[]{(long)152L, (long)323L, (long)1422L, (long)10L}))).Equals((new List())));\n Debug.Assert(UniqueDigits((new List(new long[]{(long)12345L, (long)2033L, (long)111L, (long)151L}))).Equals((new List(new long[]{(long)111L, (long)151L}))));\n Debug.Assert(UniqueDigits((new List(new long[]{(long)135L, (long)103L, (long)31L}))).Equals((new List(new long[]{(long)31L, (long)135L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Input are two strings a and b consisting only of 1s and 0s.\n // Perform binary XOR on these inputs and return result also as a string.\n // >>> string_xor('010', '110')\n // '100'\n public static string StringXor(string a, string b) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(StringXor((\"111000\"), (\"101010\")).Equals((\"010010\")));\n Debug.Assert(StringXor((\"1\"), (\"1\")).Equals((\"0\")));\n Debug.Assert(StringXor((\"0101\"), (\"0000\")).Equals((\"0101\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // sum_to_n is a function that sums numbers from 1 to n.\n // >>> sum_to_n(30)\n // 465\n // >>> sum_to_n(100)\n // 5050\n // >>> sum_to_n(5)\n // 15\n // >>> sum_to_n(10)\n // 55\n // >>> sum_to_n(1)\n // 1\n public static long SumToN(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SumToN((1L)) == (1L));\n Debug.Assert(SumToN((6L)) == (21L));\n Debug.Assert(SumToN((11L)) == (66L));\n Debug.Assert(SumToN((30L)) == (465L));\n Debug.Assert(SumToN((100L)) == (5050L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a list of numbers, return the sum of squares of the numbers\n // in the list that are odd. Ignore numbers that are negative or not integers.\n // double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10\n // double_the_difference([-1, -2, 0]) == 0\n // double_the_difference([9, -2]) == 81\n // double_the_difference([0]) == 0 \n // If the input list is empty, return 0.\n public static long DoubleTheDifference(List lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(DoubleTheDifference((new List())) == (0L));\n Debug.Assert(DoubleTheDifference((new List(new float[]{(float)5.0f, (float)4.0f}))) == (25L));\n Debug.Assert(DoubleTheDifference((new List(new float[]{(float)0.1f, (float)0.2f, (float)0.3f}))) == (0L));\n Debug.Assert(DoubleTheDifference((new List(new float[]{(float)-10.0f, (float)-20.0f, (float)-30.0f}))) == (0L));\n Debug.Assert(DoubleTheDifference((new List(new float[]{(float)-1.0f, (float)-2.0f, (float)8.0f}))) == (0L));\n Debug.Assert(DoubleTheDifference((new List(new float[]{(float)0.2f, (float)3.0f, (float)5.0f}))) == (34L));\n Debug.Assert(DoubleTheDifference((new List(new float[]{(float)-9.0f, (float)-7.0f, (float)-5.0f, (float)-3.0f, (float)-1.0f, (float)1.0f, (float)3.0f, (float)5.0f, (float)7.0f, (float)9.0f}))) == (165L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return length of given string\n // >>> strlen('')\n // 0\n // >>> strlen('abc')\n // 3\n public static long Strlen(string str) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Strlen((\"\")) == (0L));\n Debug.Assert(Strlen((\"x\")) == (1L));\n Debug.Assert(Strlen((\"asdasnakj\")) == (9L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You'll be given a string of words, and your task is to count the number\n // of boredoms. A boredom is a sentence that starts with the word \"I\".\n // Sentences are delimited by '.', '?' or '!'.\n // For example:\n // >>> is_bored(\"Hello world\")\n // 0\n // >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n // 1\n public static long IsBored(string S) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsBored((\"Hello world\")) == (0L));\n Debug.Assert(IsBored((\"Is the sky blue?\")) == (0L));\n Debug.Assert(IsBored((\"I love It !\")) == (1L));\n Debug.Assert(IsBored((\"bIt\")) == (0L));\n Debug.Assert(IsBored((\"I feel good today. I will be productive. will kill It\")) == (2L));\n Debug.Assert(IsBored((\"You and I are going for a walk\")) == (0L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function vowels_count which takes a string representing\n // a word as input and returns the number of vowels in the string.\n // Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n // vowel, but only when it is at the end of the given word.\n // Example:\n // >>> vowels_count(\"abcde\")\n // 2\n // >>> vowels_count(\"ACEDY\")\n // 3\n public static long VowelsCount(string s) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(VowelsCount((\"abcde\")) == (2L));\n Debug.Assert(VowelsCount((\"Alone\")) == (3L));\n Debug.Assert(VowelsCount((\"key\")) == (2L));\n Debug.Assert(VowelsCount((\"bye\")) == (1L));\n Debug.Assert(VowelsCount((\"keY\")) == (2L));\n Debug.Assert(VowelsCount((\"bYe\")) == (1L));\n Debug.Assert(VowelsCount((\"ACEDY\")) == (3L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return n-th Fibonacci number.\n // >>> fib(10)\n // 55\n // >>> fib(1)\n // 1\n // >>> fib(8)\n // 21\n public static long Fib(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Fib((10L)) == (55L));\n Debug.Assert(Fib((1L)) == (1L));\n Debug.Assert(Fib((8L)) == (21L));\n Debug.Assert(Fib((11L)) == (89L));\n Debug.Assert(Fib((12L)) == (144L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Your task is to implement a function that will simplify the expression\n // x * n. The function returns True if x * n evaluates to a whole number and False\n // otherwise. Both x and n, are string representation of a fraction, and have the following format,\n // / where both numerator and denominator are positive whole numbers.\n // You can assume that x, and n are valid fractions, and do not have zero as denominator.\n // simplify(\"1/5\", \"5/1\") = True\n // simplify(\"1/6\", \"2/1\") = False\n // simplify(\"7/10\", \"10/2\") = False\n public static bool Simplify(string x, string n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Simplify((\"1/5\"), (\"5/1\")) == (true));\n Debug.Assert(Simplify((\"1/6\"), (\"2/1\")) == (false));\n Debug.Assert(Simplify((\"5/1\"), (\"3/1\")) == (true));\n Debug.Assert(Simplify((\"7/10\"), (\"10/2\")) == (false));\n Debug.Assert(Simplify((\"2/10\"), (\"50/10\")) == (true));\n Debug.Assert(Simplify((\"7/2\"), (\"4/2\")) == (true));\n Debug.Assert(Simplify((\"11/6\"), (\"6/1\")) == (true));\n Debug.Assert(Simplify((\"2/3\"), (\"5/2\")) == (false));\n Debug.Assert(Simplify((\"5/2\"), (\"3/5\")) == (false));\n Debug.Assert(Simplify((\"2/4\"), (\"8/4\")) == (true));\n Debug.Assert(Simplify((\"2/4\"), (\"4/2\")) == (true));\n Debug.Assert(Simplify((\"1/5\"), (\"5/1\")) == (true));\n Debug.Assert(Simplify((\"1/5\"), (\"1/5\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a string s, count the number of uppercase vowels in even indices.\n // For example:\n // count_upper('aBCdEf') returns 1\n // count_upper('abcdefg') returns 0\n // count_upper('dBBE') returns 0\n public static long CountUpper(string s) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CountUpper((\"aBCdEf\")) == (1L));\n Debug.Assert(CountUpper((\"abcdefg\")) == (0L));\n Debug.Assert(CountUpper((\"dBBE\")) == (0L));\n Debug.Assert(CountUpper((\"B\")) == (0L));\n Debug.Assert(CountUpper((\"U\")) == (1L));\n Debug.Assert(CountUpper((\"\")) == (0L));\n Debug.Assert(CountUpper((\"EEEE\")) == (2L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a rectangular grid of wells. Each row represents a single well,\n // and each 1 in a row represents a single unit of water.\n // Each well has a corresponding bucket that can be used to extract water from it, \n // and all buckets have the same capacity.\n // Your task is to use the buckets to empty the wells.\n // Output the number of times you need to lower the buckets.\n // Example 1:\n // Input: \n // grid : [[0,0,1,0], [0,1,0,0], [1,1,1,1]]\n // bucket_capacity : 1\n // Output: 6\n // Example 2:\n // Input: \n // grid : [[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]]\n // bucket_capacity : 2\n // Output: 5\n // Example 3:\n // Input: \n // grid : [[0,0,0], [0,0,0]]\n // bucket_capacity : 5\n // Output: 0\n // Constraints:\n // * all wells have the same length\n // * 1 <= grid.length <= 10^2\n // * 1 <= grid[:,1].length <= 10^2\n // * grid[i][j] -> 0 | 1\n // * 1 <= capacity <= 10\n public static long MaxFill(List> grid, long capacity) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(MaxFill((new List>(new List[]{(List)new List(new long[]{(long)0L, (long)0L, (long)1L, (long)0L}), (List)new List(new long[]{(long)0L, (long)1L, (long)0L, (long)0L}), (List)new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L})})), (1L)) == (6L));\n Debug.Assert(MaxFill((new List>(new List[]{(List)new List(new long[]{(long)0L, (long)0L, (long)1L, (long)1L}), (List)new List(new long[]{(long)0L, (long)0L, (long)0L, (long)0L}), (List)new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L}), (List)new List(new long[]{(long)0L, (long)1L, (long)1L, (long)1L})})), (2L)) == (5L));\n Debug.Assert(MaxFill((new List>(new List[]{(List)new List(new long[]{(long)0L, (long)0L, (long)0L}), (List)new List(new long[]{(long)0L, (long)0L, (long)0L})})), (5L)) == (0L));\n Debug.Assert(MaxFill((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L}), (List)new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L})})), (2L)) == (4L));\n Debug.Assert(MaxFill((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L}), (List)new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L})})), (9L)) == (2L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given an array arr of integers and a positive integer k, return a sorted list \n // of length k with the maximum k numbers in arr.\n // Example 1:\n // Input: arr = [-3, -4, 5], k = 3\n // Output: [-4, -3, 5]\n // Example 2:\n // Input: arr = [4, -4, 4], k = 2\n // Output: [4, 4]\n // Example 3:\n // Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1\n // Output: [2]\n // Note:\n // 1. The length of the array will be in the range of [1, 1000].\n // 2. The elements in the array will be in the range of [-1000, 1000].\n // 3. 0 <= k <= len(arr)\n public static List Maximum(List arr, long k) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Maximum((new List(new long[]{(long)-3L, (long)-4L, (long)5L})), (3L)).Equals((new List(new long[]{(long)-4L, (long)-3L, (long)5L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)4L, (long)-4L, (long)4L})), (2L)).Equals((new List(new long[]{(long)4L, (long)4L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)-3L, (long)2L, (long)1L, (long)2L, (long)-1L, (long)-2L, (long)1L})), (1L)).Equals((new List(new long[]{(long)2L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)123L, (long)-123L, (long)20L, (long)0L, (long)1L, (long)2L, (long)-3L})), (3L)).Equals((new List(new long[]{(long)2L, (long)20L, (long)123L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)-123L, (long)20L, (long)0L, (long)1L, (long)2L, (long)-3L})), (4L)).Equals((new List(new long[]{(long)0L, (long)1L, (long)2L, (long)20L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)5L, (long)15L, (long)0L, (long)3L, (long)-13L, (long)-8L, (long)0L})), (7L)).Equals((new List(new long[]{(long)-13L, (long)-8L, (long)0L, (long)0L, (long)3L, (long)5L, (long)15L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)-1L, (long)0L, (long)2L, (long)5L, (long)3L, (long)-10L})), (2L)).Equals((new List(new long[]{(long)3L, (long)5L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)1L, (long)0L, (long)5L, (long)-7L})), (1L)).Equals((new List(new long[]{(long)5L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)4L, (long)-4L})), (2L)).Equals((new List(new long[]{(long)-4L, (long)4L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)-10L, (long)10L})), (2L)).Equals((new List(new long[]{(long)-10L, (long)10L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)-23L, (long)243L, (long)-400L, (long)0L})), (0L)).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that takes a message, and encodes in such a \n // way that it swaps case of all letters, replaces all vowels in \n // the message with the letter that appears 2 places ahead of that \n // vowel in the english alphabet. \n // Assume only letters. \n // Examples:\n // >>> encode('test')\n // 'TGST'\n // >>> encode('This is a message')\n // 'tHKS KS C MGSSCGG'\n public static string Encode(string message) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Encode((\"TEST\")).Equals((\"tgst\")));\n Debug.Assert(Encode((\"Mudasir\")).Equals((\"mWDCSKR\")));\n Debug.Assert(Encode((\"YES\")).Equals((\"ygs\")));\n Debug.Assert(Encode((\"This is a message\")).Equals((\"tHKS KS C MGSSCGG\")));\n Debug.Assert(Encode((\"I DoNt KnOw WhAt tO WrItE\")).Equals((\"k dQnT kNqW wHcT Tq wRkTg\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // remove_vowels is a function that takes string and returns string without vowels.\n // >>> remove_vowels('')\n // ''\n // >>> remove_vowels('abcdef')\n // 'bcdf'\n // >>> remove_vowels('aaaaa')\n // ''\n // >>> remove_vowels('aaBAA')\n // 'B'\n // >>> remove_vowels('zbcd')\n // 'zbcd'\n public static string RemoveVowels(string text) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(RemoveVowels((\"\")).Equals((\"\")));\n Debug.Assert(RemoveVowels((\"abcdef\\nghijklm\")).Equals((\"bcdf\\nghjklm\")));\n Debug.Assert(RemoveVowels((\"fedcba\")).Equals((\"fdcb\")));\n Debug.Assert(RemoveVowels((\"eeeee\")).Equals((\"\")));\n Debug.Assert(RemoveVowels((\"acBAA\")).Equals((\"cB\")));\n Debug.Assert(RemoveVowels((\"EcBOO\")).Equals((\"cB\")));\n Debug.Assert(RemoveVowels((\"ybcd\")).Equals((\"ybcd\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return only positive numbers in the list.\n // >>> get_positive([-1, 2, -4, 5, 6])\n // [2, 5, 6]\n // >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n // [5, 3, 2, 3, 9, 123, 1]\n public static List GetPositive(List l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(GetPositive((new List(new long[]{(long)-1L, (long)-2L, (long)4L, (long)5L, (long)6L}))).Equals((new List(new long[]{(long)4L, (long)5L, (long)6L}))));\n Debug.Assert(GetPositive((new List(new long[]{(long)5L, (long)3L, (long)-5L, (long)2L, (long)3L, (long)3L, (long)9L, (long)0L, (long)123L, (long)1L, (long)-10L}))).Equals((new List(new long[]{(long)5L, (long)3L, (long)2L, (long)3L, (long)3L, (long)9L, (long)123L, (long)1L}))));\n Debug.Assert(GetPositive((new List(new long[]{(long)-1L, (long)-2L}))).Equals((new List())));\n Debug.Assert(GetPositive((new List())).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n // >>> string_sequence(0)\n // '0'\n // >>> string_sequence(5)\n // '0 1 2 3 4 5'\n public static string StringSequence(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(StringSequence((0L)).Equals((\"0\")));\n Debug.Assert(StringSequence((3L)).Equals((\"0 1 2 3\")));\n Debug.Assert(StringSequence((10L)).Equals((\"0 1 2 3 4 5 6 7 8 9 10\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a positive integer n, you have to make a pile of n levels of stones.\n // The first level has n stones.\n // The number of stones in the next level is:\n // - the next odd number if n is odd.\n // - the next even number if n is even.\n // Return the number of stones in each level in a list, where element at index\n // i represents the number of stones in the level (i+1).\n // Examples:\n // >>> make_a_pile(3)\n // [3, 5, 7]\n public static List MakeAPile(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(MakeAPile((3L)).Equals((new List(new long[]{(long)3L, (long)5L, (long)7L}))));\n Debug.Assert(MakeAPile((4L)).Equals((new List(new long[]{(long)4L, (long)6L, (long)8L, (long)10L}))));\n Debug.Assert(MakeAPile((5L)).Equals((new List(new long[]{(long)5L, (long)7L, (long)9L, (long)11L, (long)13L}))));\n Debug.Assert(MakeAPile((6L)).Equals((new List(new long[]{(long)6L, (long)8L, (long)10L, (long)12L, (long)14L, (long)16L}))));\n Debug.Assert(MakeAPile((8L)).Equals((new List(new long[]{(long)8L, (long)10L, (long)12L, (long)14L, (long)16L, (long)18L, (long)20L, (long)22L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Task\n // 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\n // then check if the result string is palindrome.\n // A string is called palindrome if it reads the same backward as forward.\n // You should return a tuple containing the result string and True/False for the check.\n // Example\n // For s = \"abcde\", c = \"ae\", the result should be ('bcd',False)\n // For s = \"abcdef\", c = \"b\" the result should be ('acdef',False)\n // For s = \"abcdedcba\", c = \"ab\", the result should be ('cdedc',True)\n public static Tuple ReverseDelete(string s, string c) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ReverseDelete((\"abcde\"), (\"ae\")).Equals((Tuple.Create(\"bcd\", false))));\n Debug.Assert(ReverseDelete((\"abcdef\"), (\"b\")).Equals((Tuple.Create(\"acdef\", false))));\n Debug.Assert(ReverseDelete((\"abcdedcba\"), (\"ab\")).Equals((Tuple.Create(\"cdedc\", true))));\n Debug.Assert(ReverseDelete((\"dwik\"), (\"w\")).Equals((Tuple.Create(\"dik\", false))));\n Debug.Assert(ReverseDelete((\"a\"), (\"a\")).Equals((Tuple.Create(\"\", true))));\n Debug.Assert(ReverseDelete((\"abcdedcba\"), (\"\")).Equals((Tuple.Create(\"abcdedcba\", true))));\n Debug.Assert(ReverseDelete((\"abcdedcba\"), (\"v\")).Equals((Tuple.Create(\"abcdedcba\", true))));\n Debug.Assert(ReverseDelete((\"vabba\"), (\"v\")).Equals((Tuple.Create(\"abba\", true))));\n Debug.Assert(ReverseDelete((\"mamma\"), (\"mia\")).Equals((Tuple.Create(\"\", true))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n // >>> flip_case('Hello')\n // 'hELLO'\n public static string FlipCase(string str) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FlipCase((\"\")).Equals((\"\")));\n Debug.Assert(FlipCase((\"Hello!\")).Equals((\"hELLO!\")));\n Debug.Assert(FlipCase((\"These violent delights have violent ends\")).Equals((\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a string s.\n // if s[i] is a letter, reverse its case from lower to upper or vise versa, \n // otherwise keep it as it is.\n // If the string contains no letters, reverse the string.\n // The function should return the resulted string.\n // Examples\n // solve(\"1234\") = \"4321\"\n // solve(\"ab\") = \"AB\"\n // solve(\"#a@C\") = \"#A@c\"\n public static string Solve(string s) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Solve((\"AsDf\")).Equals((\"aSdF\")));\n Debug.Assert(Solve((\"1234\")).Equals((\"4321\")));\n Debug.Assert(Solve((\"ab\")).Equals((\"AB\")));\n Debug.Assert(Solve((\"#a@C\")).Equals((\"#A@c\")));\n Debug.Assert(Solve((\"#AsdfW^45\")).Equals((\"#aSDFw^45\")));\n Debug.Assert(Solve((\"#6@2\")).Equals((\"2@6#\")));\n Debug.Assert(Solve((\"#$a^D\")).Equals((\"#$A^d\")));\n Debug.Assert(Solve((\"#ccc\")).Equals((\"#CCC\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Filter an input list of strings only for ones that start with a given prefix.\n // >>> filter_by_prefix([], 'a')\n // []\n // >>> filter_by_prefix(['abc', 'bcd', 'cde', 'array'], 'a')\n // ['abc', 'array']\n public static List FilterByPrefix(List strings, string prefix) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FilterByPrefix((new List()), (\"john\")).Equals((new List())));\n Debug.Assert(FilterByPrefix((new List(new string[]{(string)\"xxx\", (string)\"asd\", (string)\"xxy\", (string)\"john doe\", (string)\"xxxAAA\", (string)\"xxx\"})), (\"xxx\")).Equals((new List(new string[]{(string)\"xxx\", (string)\"xxxAAA\", (string)\"xxx\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // This function takes two positive numbers x and y and returns the\n // biggest even integer number that is in the range [x, y] inclusive. If \n // there's no such number, then the function should return -1.\n // For example:\n // choose_num(12, 15) = 14\n // choose_num(13, 12) = -1\n public static long ChooseNum(long x, long y) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ChooseNum((12L), (15L)) == (14L));\n Debug.Assert(ChooseNum((13L), (12L)) == (-1L));\n Debug.Assert(ChooseNum((33L), (12354L)) == (12354L));\n Debug.Assert(ChooseNum((5234L), (5233L)) == (-1L));\n Debug.Assert(ChooseNum((6L), (29L)) == (28L));\n Debug.Assert(ChooseNum((27L), (10L)) == (-1L));\n Debug.Assert(ChooseNum((7L), (7L)) == (-1L));\n Debug.Assert(ChooseNum((546L), (546L)) == (546L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a string representing a sentence,\n // the sentence contains some words separated by a space,\n // and you have to return a string that contains the words from the original sentence,\n // whose lengths are prime numbers,\n // the order of the words in the new string should be the same as the original one.\n // Example 1:\n // Input: sentence = \"This is a test\"\n // Output: \"is\"\n // Example 2:\n // Input: sentence = \"lets go for swimming\"\n // Output: \"go for\"\n // Constraints:\n // * 1 <= len(sentence) <= 100\n // * sentence contains only letters\n public static string WordsInSentence(string sentence) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(WordsInSentence((\"This is a test\")).Equals((\"is\")));\n Debug.Assert(WordsInSentence((\"lets go for swimming\")).Equals((\"go for\")));\n Debug.Assert(WordsInSentence((\"there is no place available here\")).Equals((\"there is no place\")));\n Debug.Assert(WordsInSentence((\"Hi I am Hussein\")).Equals((\"Hi am Hussein\")));\n Debug.Assert(WordsInSentence((\"go for it\")).Equals((\"go for it\")));\n Debug.Assert(WordsInSentence((\"here\")).Equals((\"\")));\n Debug.Assert(WordsInSentence((\"here is\")).Equals((\"is\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n // >>> intersperse([], 4)\n // []\n // >>> intersperse([1, 2, 3], 4)\n // [1, 4, 2, 4, 3]\n public static List Intersperse(List numbers, long delimeter) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Intersperse((new List()), (7L)).Equals((new List())));\n Debug.Assert(Intersperse((new List(new long[]{(long)5L, (long)6L, (long)3L, (long)2L})), (8L)).Equals((new List(new long[]{(long)5L, (long)8L, (long)6L, (long)8L, (long)3L, (long)8L, (long)2L}))));\n Debug.Assert(Intersperse((new List(new long[]{(long)2L, (long)2L, (long)2L})), (2L)).Equals((new List(new long[]{(long)2L, (long)2L, (long)2L, (long)2L, (long)2L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Your task is to write a function that returns true if a number x is a simple\n // power of n and false in other cases.\n // x is a simple power of n if n**int=x\n // For example:\n // is_simple_power(1, 4) => true\n // is_simple_power(2, 2) => true\n // is_simple_power(8, 2) => true\n // is_simple_power(3, 2) => false\n // is_simple_power(3, 1) => false\n // is_simple_power(5, 3) => false\n public static bool IsSimplePower(long x, long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsSimplePower((16L), (2L)) == (true));\n Debug.Assert(IsSimplePower((143214L), (16L)) == (false));\n Debug.Assert(IsSimplePower((4L), (2L)) == (true));\n Debug.Assert(IsSimplePower((9L), (3L)) == (true));\n Debug.Assert(IsSimplePower((16L), (4L)) == (true));\n Debug.Assert(IsSimplePower((24L), (2L)) == (false));\n Debug.Assert(IsSimplePower((128L), (4L)) == (false));\n Debug.Assert(IsSimplePower((12L), (6L)) == (false));\n Debug.Assert(IsSimplePower((1L), (1L)) == (true));\n Debug.Assert(IsSimplePower((1L), (12L)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that returns true if the given number is the multiplication of 3 prime numbers\n // and false otherwise.\n // Knowing that (a) is less then 100. \n // Example:\n // is_multiply_prime(30) == True\n // 30 = 2 * 3 * 5\n public static bool IsMultiplyPrime(long a) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsMultiplyPrime((5L)) == (false));\n Debug.Assert(IsMultiplyPrime((30L)) == (true));\n Debug.Assert(IsMultiplyPrime((8L)) == (true));\n Debug.Assert(IsMultiplyPrime((10L)) == (false));\n Debug.Assert(IsMultiplyPrime((125L)) == (true));\n Debug.Assert(IsMultiplyPrime((105L)) == (true));\n Debug.Assert(IsMultiplyPrime((126L)) == (false));\n Debug.Assert(IsMultiplyPrime((729L)) == (false));\n Debug.Assert(IsMultiplyPrime((891L)) == (false));\n Debug.Assert(IsMultiplyPrime((1001L)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given the lengths of the three sides of a triangle. Return True if the three\n // sides form a right-angled triangle, False otherwise.\n // A right-angled triangle is a triangle in which one angle is right angle or \n // 90 degree.\n // Example:\n // right_angle_triangle(3, 4, 5) == True\n // right_angle_triangle(1, 2, 3) == False\n public static bool RightAngleTriangle(long a, long b, long c) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(RightAngleTriangle((3L), (4L), (5L)) == (true));\n Debug.Assert(RightAngleTriangle((1L), (2L), (3L)) == (false));\n Debug.Assert(RightAngleTriangle((10L), (6L), (8L)) == (true));\n Debug.Assert(RightAngleTriangle((2L), (2L), (2L)) == (false));\n Debug.Assert(RightAngleTriangle((7L), (24L), (25L)) == (true));\n Debug.Assert(RightAngleTriangle((10L), (5L), (7L)) == (false));\n Debug.Assert(RightAngleTriangle((5L), (12L), (13L)) == (true));\n Debug.Assert(RightAngleTriangle((15L), (8L), (17L)) == (true));\n Debug.Assert(RightAngleTriangle((48L), (55L), (73L)) == (true));\n Debug.Assert(RightAngleTriangle((1L), (1L), (1L)) == (false));\n Debug.Assert(RightAngleTriangle((2L), (2L), (10L)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function that takes 3 numbers.\n // Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n // Returns false in any other cases.\n // Examples\n // any_int(5, 2, 7) \u279e True\n // any_int(3, 2, 2) \u279e False\n // any_int(3, -2, 1) \u279e True\n // any_int(3.6, -2.2, 2) \u279e False\n public static bool AnyInt(float x, float y, float z) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(AnyInt((float)2L, (float)3L, (float)1L) == (true));\n Debug.Assert(AnyInt((2.5f), (float)2L, (float)3L) == (false));\n Debug.Assert(AnyInt((1.5f), (float)5L, (3.5f)) == (false));\n Debug.Assert(AnyInt((float)2L, (float)6L, (float)2L) == (false));\n Debug.Assert(AnyInt((float)4L, (float)2L, (float)2L) == (true));\n Debug.Assert(AnyInt((2.2f), (2.2f), (2.2f)) == (false));\n Debug.Assert(AnyInt((float)-4L, (float)6L, (float)2L) == (true));\n Debug.Assert(AnyInt((float)2L, (float)1L, (float)1L) == (true));\n Debug.Assert(AnyInt((float)3L, (float)4L, (float)7L) == (true));\n Debug.Assert(AnyInt((3.0f), (float)4L, (float)7L) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // This function takes a list l and returns a list l' such that\n // l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n // to the values of the corresponding indicies of l, but sorted.\n // >>> sort_third([1, 2, 3])\n // [1, 2, 3]\n // >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n // [2, 6, 3, 4, 8, 9, 5]\n public static List SortThird(List l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SortThird((new List(new long[]{(long)5L, (long)6L, (long)3L, (long)4L, (long)8L, (long)9L, (long)2L}))).Equals((new List(new long[]{(long)2L, (long)6L, (long)3L, (long)4L, (long)8L, (long)9L, (long)5L}))));\n Debug.Assert(SortThird((new List(new long[]{(long)5L, (long)8L, (long)3L, (long)4L, (long)6L, (long)9L, (long)2L}))).Equals((new List(new long[]{(long)2L, (long)8L, (long)3L, (long)4L, (long)6L, (long)9L, (long)5L}))));\n Debug.Assert(SortThird((new List(new long[]{(long)5L, (long)6L, (long)9L, (long)4L, (long)8L, (long)3L, (long)2L}))).Equals((new List(new long[]{(long)2L, (long)6L, (long)9L, (long)4L, (long)8L, (long)3L, (long)5L}))));\n Debug.Assert(SortThird((new List(new long[]{(long)5L, (long)6L, (long)3L, (long)4L, (long)8L, (long)9L, (long)2L, (long)1L}))).Equals((new List(new long[]{(long)2L, (long)6L, (long)3L, (long)4L, (long)8L, (long)9L, (long)5L, (long)1L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_53_add", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Add two numbers x and y\n // >>> add(2, 3)\n // 5\n // >>> add(5, 7)\n // 12\n public static long Add(long x, long y) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Add((0L), (1L)) == (1L));\n Debug.Assert(Add((1L), (0L)) == (1L));\n Debug.Assert(Add((2L), (3L)) == (5L));\n Debug.Assert(Add((5L), (7L)) == (12L));\n Debug.Assert(Add((7L), (5L)) == (12L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_69_search", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n // zero, and has a frequency greater than or equal to the value of the integer itself. \n // The frequency of an integer is the number of times it appears in the list.\n // If no such a value exist, return -1.\n // Examples:\n // search([4, 1, 2, 2, 3, 1]) == 2\n // search([1, 2, 2, 3, 3, 3, 4, 4, 4]) == 3\n // search([5, 5, 4, 4, 4]) == -1\n public static long Search(List lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Search((new List(new long[]{(long)5L, (long)5L, (long)5L, (long)5L, (long)1L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)4L, (long)1L, (long)4L, (long)1L, (long)4L, (long)4L}))) == (4L));\n Debug.Assert(Search((new List(new long[]{(long)3L, (long)3L}))) == (-1L));\n Debug.Assert(Search((new List(new long[]{(long)8L, (long)8L, (long)8L, (long)8L, (long)8L, (long)8L, (long)8L, (long)8L}))) == (8L));\n Debug.Assert(Search((new List(new long[]{(long)2L, (long)3L, (long)3L, (long)2L, (long)2L}))) == (2L));\n Debug.Assert(Search((new List(new long[]{(long)2L, (long)7L, (long)8L, (long)8L, (long)4L, (long)8L, (long)7L, (long)3L, (long)9L, (long)6L, (long)5L, (long)10L, (long)4L, (long)3L, (long)6L, (long)7L, (long)1L, (long)7L, (long)4L, (long)10L, (long)8L, (long)1L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)3L, (long)2L, (long)8L, (long)2L}))) == (2L));\n Debug.Assert(Search((new List(new long[]{(long)6L, (long)7L, (long)1L, (long)8L, (long)8L, (long)10L, (long)5L, (long)8L, (long)5L, (long)3L, (long)10L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)8L, (long)8L, (long)3L, (long)6L, (long)5L, (long)6L, (long)4L}))) == (-1L));\n Debug.Assert(Search((new List(new long[]{(long)6L, (long)9L, (long)6L, (long)7L, (long)1L, (long)4L, (long)7L, (long)1L, (long)8L, (long)8L, (long)9L, (long)8L, (long)10L, (long)10L, (long)8L, (long)4L, (long)10L, (long)4L, (long)10L, (long)1L, (long)2L, (long)9L, (long)5L, (long)7L, (long)9L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)1L, (long)9L, (long)10L, (long)1L, (long)3L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)6L, (long)9L, (long)7L, (long)5L, (long)8L, (long)7L, (long)5L, (long)3L, (long)7L, (long)5L, (long)10L, (long)10L, (long)3L, (long)6L, (long)10L, (long)2L, (long)8L, (long)6L, (long)5L, (long)4L, (long)9L, (long)5L, (long)3L, (long)10L}))) == (5L));\n Debug.Assert(Search((new List(new long[]{(long)1L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)8L, (long)8L, (long)10L, (long)6L, (long)4L, (long)3L, (long)5L, (long)8L, (long)2L, (long)4L, (long)2L, (long)8L, (long)4L, (long)6L, (long)10L, (long)4L, (long)2L, (long)1L, (long)10L, (long)2L, (long)1L, (long)1L, (long)5L}))) == (4L));\n Debug.Assert(Search((new List(new long[]{(long)2L, (long)10L, (long)4L, (long)8L, (long)2L, (long)10L, (long)5L, (long)1L, (long)2L, (long)9L, (long)5L, (long)5L, (long)6L, (long)3L, (long)8L, (long)6L, (long)4L, (long)10L}))) == (2L));\n Debug.Assert(Search((new List(new long[]{(long)1L, (long)6L, (long)10L, (long)1L, (long)6L, (long)9L, (long)10L, (long)8L, (long)6L, (long)8L, (long)7L, (long)3L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)9L, (long)2L, (long)4L, (long)1L, (long)5L, (long)1L, (long)5L, (long)2L, (long)5L, (long)7L, (long)7L, (long)7L, (long)3L, (long)10L, (long)1L, (long)5L, (long)4L, (long)2L, (long)8L, (long)4L, (long)1L, (long)9L, (long)10L, (long)7L, (long)10L, (long)2L, (long)8L, (long)10L, (long)9L, (long)4L}))) == (4L));\n Debug.Assert(Search((new List(new long[]{(long)2L, (long)6L, (long)4L, (long)2L, (long)8L, (long)7L, (long)5L, (long)6L, (long)4L, (long)10L, (long)4L, (long)6L, (long)3L, (long)7L, (long)8L, (long)8L, (long)3L, (long)1L, (long)4L, (long)2L, (long)2L, (long)10L, (long)7L}))) == (4L));\n Debug.Assert(Search((new List(new long[]{(long)9L, (long)8L, (long)6L, (long)10L, (long)2L, (long)6L, (long)10L, (long)2L, (long)7L, (long)8L, (long)10L, (long)3L, (long)8L, (long)2L, (long)6L, (long)2L, (long)3L, (long)1L}))) == (2L));\n Debug.Assert(Search((new List(new long[]{(long)5L, (long)5L, (long)3L, (long)9L, (long)5L, (long)6L, (long)3L, (long)2L, (long)8L, (long)5L, (long)6L, (long)10L, (long)10L, (long)6L, (long)8L, (long)4L, (long)10L, (long)7L, (long)7L, (long)10L, (long)8L}))) == (-1L));\n Debug.Assert(Search((new List(new long[]{(long)10L}))) == (-1L));\n Debug.Assert(Search((new List(new long[]{(long)9L, (long)7L, (long)7L, (long)2L, (long)4L, (long)7L, (long)2L, (long)10L, (long)9L, (long)7L, (long)5L, (long)7L, (long)2L}))) == (2L));\n Debug.Assert(Search((new List(new long[]{(long)5L, (long)4L, (long)10L, (long)2L, (long)1L, (long)1L, (long)10L, (long)3L, (long)6L, (long)1L, (long)8L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)7L, (long)9L, (long)9L, (long)9L, (long)3L, (long)4L, (long)1L, (long)5L, (long)9L, (long)1L, (long)2L, (long)1L, (long)1L, (long)10L, (long)7L, (long)5L, (long)6L, (long)7L, (long)6L, (long)7L, (long)7L, (long)6L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)3L, (long)10L, (long)10L, (long)9L, (long)2L}))) == (-1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that takes a string and returns True if the string\n // length is a prime number or False otherwise\n // Examples\n // prime_length('Hello') == True\n // prime_length('abcdcba') == True\n // prime_length('kittens') == True\n // prime_length('orange') == False\n public static bool PrimeLength(string str) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(PrimeLength((\"Hello\")) == (true));\n Debug.Assert(PrimeLength((\"abcdcba\")) == (true));\n Debug.Assert(PrimeLength((\"kittens\")) == (true));\n Debug.Assert(PrimeLength((\"orange\")) == (false));\n Debug.Assert(PrimeLength((\"wow\")) == (true));\n Debug.Assert(PrimeLength((\"world\")) == (true));\n Debug.Assert(PrimeLength((\"MadaM\")) == (true));\n Debug.Assert(PrimeLength((\"Wow\")) == (true));\n Debug.Assert(PrimeLength((\"\")) == (false));\n Debug.Assert(PrimeLength((\"HI\")) == (true));\n Debug.Assert(PrimeLength((\"go\")) == (true));\n Debug.Assert(PrimeLength((\"gogo\")) == (false));\n Debug.Assert(PrimeLength((\"aaaaaaaaaaaaaaa\")) == (false));\n Debug.Assert(PrimeLength((\"Madam\")) == (true));\n Debug.Assert(PrimeLength((\"M\")) == (false));\n Debug.Assert(PrimeLength((\"0\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_58_common", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return sorted unique common elements for two lists.\n // >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n // [1, 5, 653]\n // >>> common([5, 3, 2, 8], [3, 2])\n // [2, 3]\n public static List Common(List l1, List l2) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Common((new List(new long[]{(long)1L, (long)4L, (long)3L, (long)34L, (long)653L, (long)2L, (long)5L})), (new List(new long[]{(long)5L, (long)7L, (long)1L, (long)5L, (long)9L, (long)653L, (long)121L}))).Equals((new List(new long[]{(long)1L, (long)5L, (long)653L}))));\n Debug.Assert(Common((new List(new long[]{(long)5L, (long)3L, (long)2L, (long)8L})), (new List(new long[]{(long)3L, (long)2L}))).Equals((new List(new long[]{(long)2L, (long)3L}))));\n Debug.Assert(Common((new List(new long[]{(long)4L, (long)3L, (long)2L, (long)8L})), (new List(new long[]{(long)3L, (long)2L, (long)4L}))).Equals((new List(new long[]{(long)2L, (long)3L, (long)4L}))));\n Debug.Assert(Common((new List(new long[]{(long)4L, (long)3L, (long)2L, (long)8L})), (new List())).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // The Brazilian factorial is defined as:\n // brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n // where n > 0\n // For example:\n // >>> special_factorial(4)\n // 288\n // The function will receive an integer as input and should return the special\n // factorial of this integer.\n public static long SpecialFactorial(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SpecialFactorial((4L)) == (288L));\n Debug.Assert(SpecialFactorial((5L)) == (34560L));\n Debug.Assert(SpecialFactorial((7L)) == (125411328000L));\n Debug.Assert(SpecialFactorial((1L)) == (1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // In this problem, you will implement a function that takes two lists of numbers,\n // and determines whether it is possible to perform an exchange of elements\n // between them to make lst1 a list of only even numbers.\n // There is no limit on the number of exchanged elements between lst1 and lst2.\n // If it is possible to exchange elements between the lst1 and lst2 to make\n // all the elements of lst1 to be even, return \"YES\".\n // Otherwise, return \"NO\".\n // For example:\n // exchange([1, 2, 3, 4], [1, 2, 3, 4]) => \"YES\"\n // exchange([1, 2, 3, 4], [1, 5, 3, 4]) => \"NO\"\n // It is assumed that the input lists will be non-empty.\n public static string Exchange(List lst1, List lst2) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Exchange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L})), (new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))).Equals((\"YES\")));\n Debug.Assert(Exchange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L})), (new List(new long[]{(long)1L, (long)5L, (long)3L, (long)4L}))).Equals((\"NO\")));\n Debug.Assert(Exchange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L})), (new List(new long[]{(long)2L, (long)1L, (long)4L, (long)3L}))).Equals((\"YES\")));\n Debug.Assert(Exchange((new List(new long[]{(long)5L, (long)7L, (long)3L})), (new List(new long[]{(long)2L, (long)6L, (long)4L}))).Equals((\"YES\")));\n Debug.Assert(Exchange((new List(new long[]{(long)5L, (long)7L, (long)3L})), (new List(new long[]{(long)2L, (long)6L, (long)3L}))).Equals((\"NO\")));\n Debug.Assert(Exchange((new List(new long[]{(long)3L, (long)2L, (long)6L, (long)1L, (long)8L, (long)9L})), (new List(new long[]{(long)3L, (long)5L, (long)5L, (long)1L, (long)1L, (long)1L}))).Equals((\"NO\")));\n Debug.Assert(Exchange((new List(new long[]{(long)100L, (long)200L})), (new List(new long[]{(long)200L, (long)200L}))).Equals((\"YES\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a non-empty array of integers arr and an integer k, return\n // the sum of the elements with at most two digits from the first k elements of arr.\n // Example:\n // Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4\n // Output: 24 # sum of 21 + 3\n // Constraints:\n // 1. 1 <= len(arr) <= 100\n // 2. 1 <= k <= len(arr)\n public static long AddElements(List arr, long k) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(AddElements((new List(new long[]{(long)1L, (long)-2L, (long)-3L, (long)41L, (long)57L, (long)76L, (long)87L, (long)88L, (long)99L})), (3L)) == (-4L));\n Debug.Assert(AddElements((new List(new long[]{(long)111L, (long)121L, (long)3L, (long)4000L, (long)5L, (long)6L})), (2L)) == (0L));\n Debug.Assert(AddElements((new List(new long[]{(long)11L, (long)21L, (long)3L, (long)90L, (long)5L, (long)6L, (long)7L, (long)8L, (long)9L})), (4L)) == (125L));\n Debug.Assert(AddElements((new List(new long[]{(long)111L, (long)21L, (long)3L, (long)4000L, (long)5L, (long)6L, (long)7L, (long)8L, (long)9L})), (4L)) == (24L));\n Debug.Assert(AddElements((new List(new long[]{(long)1L})), (1L)) == (1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // A simple program which should return the value of x if n is \n // a prime number and should return the value of y otherwise.\n // Examples:\n // for x_or_y(7, 34, 12) == 34\n // for x_or_y(15, 8, 5) == 5\n public static long XOrY(long n, long x, long y) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(XOrY((7L), (34L), (12L)) == (34L));\n Debug.Assert(XOrY((15L), (8L), (5L)) == (5L));\n Debug.Assert(XOrY((3L), (33L), (5212L)) == (33L));\n Debug.Assert(XOrY((1259L), (3L), (52L)) == (3L));\n Debug.Assert(XOrY((7919L), (-1L), (12L)) == (-1L));\n Debug.Assert(XOrY((3609L), (1245L), (583L)) == (583L));\n Debug.Assert(XOrY((91L), (56L), (129L)) == (129L));\n Debug.Assert(XOrY((6L), (34L), (1234L)) == (1234L));\n Debug.Assert(XOrY((1L), (2L), (0L)) == (0L));\n Debug.Assert(XOrY((2L), (2L), (0L)) == (2L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given length of a side and high return area for a triangle.\n // >>> triangle_area(5, 3)\n // 7.5\n public static float TriangleArea(long a, long h) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(TriangleArea((5L), (3L)) == (7.5f));\n Debug.Assert(TriangleArea((2L), (2L)) == (2.0f));\n Debug.Assert(TriangleArea((10L), (8L)) == (40.0f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n // the last couple centuries. However, what people don't know is Tribonacci sequence.\n // Tribonacci sequence is defined by the recurrence:\n // tri(1) = 3\n // tri(n) = 1 + n / 2, if n is even.\n // tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n // For example:\n // tri(2) = 1 + (2 / 2) = 2\n // tri(4) = 3\n // tri(3) = tri(2) + tri(1) + tri(4)\n // = 2 + 3 + 3 = 8 \n // You are given a non-negative integer number n, you have to a return a list of the \n // first n + 1 numbers of the Tribonacci sequence.\n // Examples:\n // tri(3) = [1, 3, 2, 8]\n public static List Tri(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Tri((3L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L}))));\n Debug.Assert(Tri((4L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L, (long)3L}))));\n Debug.Assert(Tri((5L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L, (long)3L, (long)15L}))));\n Debug.Assert(Tri((6L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L, (long)3L, (long)15L, (long)4L}))));\n Debug.Assert(Tri((7L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L, (long)3L, (long)15L, (long)4L, (long)24L}))));\n Debug.Assert(Tri((8L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L, (long)3L, (long)15L, (long)4L, (long)24L, (long)5L}))));\n Debug.Assert(Tri((9L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L, (long)3L, (long)15L, (long)4L, (long)24L, (long)5L, (long)35L}))));\n Debug.Assert(Tri((20L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L, (long)3L, (long)15L, (long)4L, (long)24L, (long)5L, (long)35L, (long)6L, (long)48L, (long)7L, (long)63L, (long)8L, (long)80L, (long)9L, (long)99L, (long)10L, (long)120L, (long)11L}))));\n Debug.Assert(Tri((0L)).Equals((new List(new long[]{(long)1L}))));\n Debug.Assert(Tri((1L)).Equals((new List(new long[]{(long)1L, (long)3L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a list of two strings, both strings consist of open\n // parentheses '(' or close parentheses ')' only.\n // Your job is to check if it is possible to concatenate the two strings in\n // some order, that the resulting string will be good.\n // A string S is considered to be good if and only if all parentheses in S\n // are balanced. For example: the string '(())()' is good, while the string\n // '())' is not.\n // Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n // Examples:\n // match_parens(['()(', ')']) == 'Yes'\n // match_parens([')', ')']) == 'No'\n public static string MatchParens(List lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(MatchParens((new List(new string[]{(string)\"()(\", (string)\")\"}))).Equals((\"Yes\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\")\", (string)\")\"}))).Equals((\"No\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\"(()(())\", (string)\"())())\"}))).Equals((\"No\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\")())\", (string)\"(()()(\"}))).Equals((\"Yes\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\"(())))\", (string)\"(()())((\"}))).Equals((\"Yes\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\"()\", (string)\"())\"}))).Equals((\"No\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\"(()(\", (string)\"()))()\"}))).Equals((\"Yes\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\"((((\", (string)\"((())\"}))).Equals((\"No\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\")(()\", (string)\"(()(\"}))).Equals((\"No\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\")(\", (string)\")(\"}))).Equals((\"No\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\"(\", (string)\")\"}))).Equals((\"Yes\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\")\", (string)\"(\"}))).Equals((\"Yes\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // From a list of integers, remove all elements that occur more than once.\n // Keep order of elements left the same as in the input.\n // >>> remove_duplicates([1, 2, 3, 2, 4])\n // [1, 3, 4]\n public static List RemoveDuplicates(List numbers) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(RemoveDuplicates((new List())).Equals((new List())));\n Debug.Assert(RemoveDuplicates((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))).Equals((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))));\n Debug.Assert(RemoveDuplicates((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)2L, (long)4L, (long)3L, (long)5L}))).Equals((new List(new long[]{(long)1L, (long)4L, (long)5L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return a greatest common divisor of two integers a and b\n // >>> greatest_common_divisor(3, 5)\n // 1\n // >>> greatest_common_divisor(25, 15)\n // 5\n public static long GreatestCommonDivisor(long a, long b) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(GreatestCommonDivisor((3L), (7L)) == (1L));\n Debug.Assert(GreatestCommonDivisor((10L), (15L)) == (5L));\n Debug.Assert(GreatestCommonDivisor((49L), (14L)) == (7L));\n Debug.Assert(GreatestCommonDivisor((144L), (60L)) == (12L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Checks if given string is a palindrome\n // >>> is_palindrome('')\n // True\n // >>> is_palindrome('aba')\n // True\n // >>> is_palindrome('aaaaa')\n // True\n // >>> is_palindrome('zbcd')\n // False\n public static bool IsPalindrome(string text) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsPalindrome((\"\")) == (true));\n Debug.Assert(IsPalindrome((\"aba\")) == (true));\n Debug.Assert(IsPalindrome((\"aaaaa\")) == (true));\n Debug.Assert(IsPalindrome((\"zbcd\")) == (false));\n Debug.Assert(IsPalindrome((\"xywyx\")) == (true));\n Debug.Assert(IsPalindrome((\"xywyz\")) == (false));\n Debug.Assert(IsPalindrome((\"xywzx\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // xs represent coefficients of a polynomial.\n // xs[0] + xs[1] * x + xs[2] * x^2 + ....\n // Return derivative of this polynomial in the same form.\n // >>> derivative([3, 1, 2, 4, 5])\n // [1, 4, 12, 20]\n // >>> derivative([1, 2, 3])\n // [2, 6]\n public static List Derivative(List xs) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Derivative((new List(new long[]{(long)3L, (long)1L, (long)2L, (long)4L, (long)5L}))).Equals((new List(new long[]{(long)1L, (long)4L, (long)12L, (long)20L}))));\n Debug.Assert(Derivative((new List(new long[]{(long)1L, (long)2L, (long)3L}))).Equals((new List(new long[]{(long)2L, (long)6L}))));\n Debug.Assert(Derivative((new List(new long[]{(long)3L, (long)2L, (long)1L}))).Equals((new List(new long[]{(long)2L, (long)2L}))));\n Debug.Assert(Derivative((new List(new long[]{(long)3L, (long)2L, (long)1L, (long)0L, (long)4L}))).Equals((new List(new long[]{(long)2L, (long)2L, (long)0L, (long)16L}))));\n Debug.Assert(Derivative((new List(new long[]{(long)1L}))).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // In this task, you will be given a string that represents a number of apples and oranges \n // that are distributed in a basket of fruit this basket contains \n // apples, oranges, and mango fruits. Given the string that represents the total number of \n // the oranges and apples and an integer that represent the total number of the fruits \n // in the basket return the number of the mango fruits in the basket.\n // for examble:\n // fruit_distribution(\"5 apples and 6 oranges\", 19) ->19 - 5 - 6 = 8\n // fruit_distribution(\"0 apples and 1 oranges\",3) -> 3 - 0 - 1 = 2\n // fruit_distribution(\"2 apples and 3 oranges\", 100) -> 100 - 2 - 3 = 95\n // fruit_distribution(\"100 apples and 1 oranges\",120) -> 120 - 100 - 1 = 19\n public static long FruitDistribution(string s, long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FruitDistribution((\"5 apples and 6 oranges\"), (19L)) == (8L));\n Debug.Assert(FruitDistribution((\"5 apples and 6 oranges\"), (21L)) == (10L));\n Debug.Assert(FruitDistribution((\"0 apples and 1 oranges\"), (3L)) == (2L));\n Debug.Assert(FruitDistribution((\"1 apples and 0 oranges\"), (3L)) == (2L));\n Debug.Assert(FruitDistribution((\"2 apples and 3 oranges\"), (100L)) == (95L));\n Debug.Assert(FruitDistribution((\"2 apples and 3 oranges\"), (5L)) == (0L));\n Debug.Assert(FruitDistribution((\"1 apples and 100 oranges\"), (120L)) == (19L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that takes an integer a and returns True \n // if this ingeger is a cube of some integer number.\n // Note: you may assume the input is always valid.\n // Examples:\n // iscube(1) ==> True\n // iscube(2) ==> False\n // iscube(-1) ==> True\n // iscube(64) ==> True\n // iscube(0) ==> True\n // iscube(180) ==> False\n public static bool Iscube(long a) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Iscube((1L)) == (true));\n Debug.Assert(Iscube((2L)) == (false));\n Debug.Assert(Iscube((-1L)) == (true));\n Debug.Assert(Iscube((64L)) == (true));\n Debug.Assert(Iscube((180L)) == (false));\n Debug.Assert(Iscube((1000L)) == (true));\n Debug.Assert(Iscube((0L)) == (true));\n Debug.Assert(Iscube((1729L)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // In this Kata, you have to sort an array of non-negative integers according to\n // number of ones in their binary representation in ascending order.\n // For similar number of ones, sort based on decimal value.\n // It must be implemented like this:\n // >>> sort_array([1, 5, 2, 3, 4]) == [1, 2, 3, 4, 5]\n // >>> sort_array([-2, -3, -4, -5, -6]) == [-6, -5, -4, -3, -2]\n // >>> sort_array([1, 0, 2, 3, 4]) [0, 1, 2, 3, 4]\n public static List SortArray(List arr) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SortArray((new List(new long[]{(long)1L, (long)5L, (long)2L, (long)3L, (long)4L}))).Equals((new List(new long[]{(long)1L, (long)2L, (long)4L, (long)3L, (long)5L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)-2L, (long)-3L, (long)-4L, (long)-5L, (long)-6L}))).Equals((new List(new long[]{(long)-4L, (long)-2L, (long)-6L, (long)-5L, (long)-3L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)1L, (long)0L, (long)2L, (long)3L, (long)4L}))).Equals((new List(new long[]{(long)0L, (long)1L, (long)2L, (long)4L, (long)3L}))));\n Debug.Assert(SortArray((new List())).Equals((new List())));\n Debug.Assert(SortArray((new List(new long[]{(long)2L, (long)5L, (long)77L, (long)4L, (long)5L, (long)3L, (long)5L, (long)7L, (long)2L, (long)3L, (long)4L}))).Equals((new List(new long[]{(long)2L, (long)2L, (long)4L, (long)4L, (long)3L, (long)3L, (long)5L, (long)5L, (long)5L, (long)7L, (long)77L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)3L, (long)6L, (long)44L, (long)12L, (long)32L, (long)5L}))).Equals((new List(new long[]{(long)32L, (long)3L, (long)5L, (long)6L, (long)12L, (long)44L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)2L, (long)4L, (long)8L, (long)16L, (long)32L}))).Equals((new List(new long[]{(long)2L, (long)4L, (long)8L, (long)16L, (long)32L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)2L, (long)4L, (long)8L, (long)16L, (long)32L}))).Equals((new List(new long[]{(long)2L, (long)4L, (long)8L, (long)16L, (long)32L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a list of strings, where each string consists of only digits, return a list.\n // Each element i of the output should be \"the number of odd elements in the\n // string i of the input.\" where all the i's should be replaced by the number\n // of odd digits in the i'th string of the input.\n // >>> odd_count(['1234567'])\n // [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n // >>> odd_count(['3',\"11111111\"])\n // [\"the number of odd elements 1n the str1ng 1 of the 1nput.\",\n // \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\n public static List OddCount(List lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(OddCount((new List(new string[]{(string)\"1234567\"}))).Equals((new List(new string[]{(string)\"the number of odd elements 4n the str4ng 4 of the 4nput.\"}))));\n Debug.Assert(OddCount((new List(new string[]{(string)\"3\", (string)\"11111111\"}))).Equals((new List(new string[]{(string)\"the number of odd elements 1n the str1ng 1 of the 1nput.\", (string)\"the number of odd elements 8n the str8ng 8 of the 8nput.\"}))));\n Debug.Assert(OddCount((new List(new string[]{(string)\"271\", (string)\"137\", (string)\"314\"}))).Equals((new List(new string[]{(string)\"the number of odd elements 2n the str2ng 2 of the 2nput.\", (string)\"the number of odd elements 3n the str3ng 3 of the 3nput.\", (string)\"the number of odd elements 2n the str2ng 2 of the 2nput.\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // brackets is a string of \"(\" and \")\".\n // return True if every opening bracket has a corresponding closing bracket.\n // >>> correct_bracketing(\"(\")\n // False\n // >>> correct_bracketing(\"()\")\n // True\n // >>> correct_bracketing(\"(()())\")\n // True\n // >>> correct_bracketing(\")(()\")\n // False\n public static bool CorrectBracketing(string brackets) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CorrectBracketing((\"()\")) == (true));\n Debug.Assert(CorrectBracketing((\"(()())\")) == (true));\n Debug.Assert(CorrectBracketing((\"()()(()())()\")) == (true));\n Debug.Assert(CorrectBracketing((\"()()((()()())())(()()(()))\")) == (true));\n Debug.Assert(CorrectBracketing((\"((()())))\")) == (false));\n Debug.Assert(CorrectBracketing((\")(()\")) == (false));\n Debug.Assert(CorrectBracketing((\"(\")) == (false));\n Debug.Assert(CorrectBracketing((\"((((\")) == (false));\n Debug.Assert(CorrectBracketing((\")\")) == (false));\n Debug.Assert(CorrectBracketing((\"(()\")) == (false));\n Debug.Assert(CorrectBracketing((\"()()(()())())(()\")) == (false));\n Debug.Assert(CorrectBracketing((\"()()(()())()))()\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Task\n // Write a function that takes a string as input and returns the sum of the upper characters only'\n // ASCII codes.\n // Examples:\n // digitSum(\"\") => 0\n // digitSum(\"abAB\") => 131\n // digitSum(\"abcCd\") => 67\n // digitSum(\"helloE\") => 69\n // digitSum(\"woArBld\") => 131\n // digitSum(\"aAaaaXa\") => 153\n public static long Digitsum(string s) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Digitsum((\"\")) == (0L));\n Debug.Assert(Digitsum((\"abAB\")) == (131L));\n Debug.Assert(Digitsum((\"abcCd\")) == (67L));\n Debug.Assert(Digitsum((\"helloE\")) == (69L));\n Debug.Assert(Digitsum((\"woArBld\")) == (131L));\n Debug.Assert(Digitsum((\"aAaaaXa\")) == (153L));\n Debug.Assert(Digitsum((\" How are yOu?\")) == (151L));\n Debug.Assert(Digitsum((\"You arE Very Smart\")) == (327L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that accepts a list of strings as a parameter,\n // deletes the strings that have odd lengths from it,\n // and returns the resulted list with a sorted order,\n // The list is always a list of strings and never an array of numbers,\n // and it may contain duplicates.\n // The order of the list should be ascending by length of each word, and you\n // should return the list sorted by that rule.\n // If two words have the same length, sort the list alphabetically.\n // The function should return a list of strings in sorted order.\n // You may assume that all words will have the same length.\n // For example:\n // assert list_sort([\"aa\", \"a\", \"aaa\"]) => [\"aa\"]\n // assert list_sort([\"ab\", \"a\", \"aaa\", \"cd\"]) => [\"ab\", \"cd\"]\n public static List SortedListSum(List lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SortedListSum((new List(new string[]{(string)\"aa\", (string)\"a\", (string)\"aaa\"}))).Equals((new List(new string[]{(string)\"aa\"}))));\n Debug.Assert(SortedListSum((new List(new string[]{(string)\"school\", (string)\"AI\", (string)\"asdf\", (string)\"b\"}))).Equals((new List(new string[]{(string)\"AI\", (string)\"asdf\", (string)\"school\"}))));\n Debug.Assert(SortedListSum((new List(new string[]{(string)\"d\", (string)\"b\", (string)\"c\", (string)\"a\"}))).Equals((new List())));\n Debug.Assert(SortedListSum((new List(new string[]{(string)\"d\", (string)\"dcba\", (string)\"abcd\", (string)\"a\"}))).Equals((new List(new string[]{(string)\"abcd\", (string)\"dcba\"}))));\n Debug.Assert(SortedListSum((new List(new string[]{(string)\"AI\", (string)\"ai\", (string)\"au\"}))).Equals((new List(new string[]{(string)\"AI\", (string)\"ai\", (string)\"au\"}))));\n Debug.Assert(SortedListSum((new List(new string[]{(string)\"a\", (string)\"b\", (string)\"b\", (string)\"c\", (string)\"c\", (string)\"a\"}))).Equals((new List())));\n Debug.Assert(SortedListSum((new List(new string[]{(string)\"aaaa\", (string)\"bbbb\", (string)\"dd\", (string)\"cc\"}))).Equals((new List(new string[]{(string)\"cc\", (string)\"dd\", (string)\"aaaa\", (string)\"bbbb\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given an array arr of integers and you need to return\n // sum of magnitudes of integers multiplied by product of all signs\n // of each number in the array, represented by 1, -1 or 0.\n // Note: return None for empty arr.\n // Example:\n // >>> prod_signs([1, 2, 2, -4]) == -9\n // >>> prod_signs([0, 1]) == 0\n // >>> prod_signs([]) == None\n public static Nullable ProdSigns(List arr) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ProdSigns((new List(new long[]{(long)1L, (long)2L, (long)2L, (long)-4L}))).Equals(-9L));\n Debug.Assert(ProdSigns((new List(new long[]{(long)0L, (long)1L}))).Equals(0L));\n Debug.Assert(ProdSigns((new List(new long[]{(long)1L, (long)1L, (long)1L, (long)2L, (long)3L, (long)-1L, (long)1L}))).Equals(-10L));\n Debug.Assert(ProdSigns((new List())).Equals(null));\n Debug.Assert(ProdSigns((new List(new long[]{(long)2L, (long)4L, (long)1L, (long)2L, (long)-1L, (long)-1L, (long)9L}))).Equals(20L));\n Debug.Assert(ProdSigns((new List(new long[]{(long)-1L, (long)1L, (long)-1L, (long)1L}))).Equals(4L));\n Debug.Assert(ProdSigns((new List(new long[]{(long)-1L, (long)1L, (long)1L, (long)1L}))).Equals(-4L));\n Debug.Assert(ProdSigns((new List(new long[]{(long)-1L, (long)1L, (long)1L, (long)0L}))).Equals(0L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return list with elements incremented by 1.\n // >>> incr_list([1, 2, 3])\n // [2, 3, 4]\n // >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123])\n // [6, 4, 6, 3, 4, 4, 10, 1, 124]\n public static List IncrList(List l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IncrList((new List())).Equals((new List())));\n Debug.Assert(IncrList((new List(new long[]{(long)3L, (long)2L, (long)1L}))).Equals((new List(new long[]{(long)4L, (long)3L, (long)2L}))));\n Debug.Assert(IncrList((new List(new long[]{(long)5L, (long)2L, (long)5L, (long)2L, (long)3L, (long)3L, (long)9L, (long)0L, (long)123L}))).Equals((new List(new long[]{(long)6L, (long)3L, (long)6L, (long)3L, (long)4L, (long)4L, (long)10L, (long)1L, (long)124L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // From a given list of integers, generate a list of rolling maximum element found until given moment\n // in the sequence.\n // >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n // [1, 2, 3, 3, 3, 4, 4]\n public static List RollingMax(List numbers) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(RollingMax((new List())).Equals((new List())));\n Debug.Assert(RollingMax((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))).Equals((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))));\n Debug.Assert(RollingMax((new List(new long[]{(long)4L, (long)3L, (long)2L, (long)1L}))).Equals((new List(new long[]{(long)4L, (long)4L, (long)4L, (long)4L}))));\n Debug.Assert(RollingMax((new List(new long[]{(long)3L, (long)2L, (long)3L, (long)100L, (long)3L}))).Equals((new List(new long[]{(long)3L, (long)3L, (long)3L, (long)100L, (long)100L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n // separate those group into separate strings and return the list of those.\n // Separate groups are balanced (each open brace is properly closed) and not nested within each other\n // Ignore any spaces in the input string.\n // >>> separate_paren_groups('( ) (( )) (( )( ))')\n // ['()', '(())', '(()())']\n public static List SeparateParenGroups(string paren_string) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SeparateParenGroups((\"(()()) ((())) () ((())()())\")).Equals((new List(new string[]{(string)\"(()())\", (string)\"((()))\", (string)\"()\", (string)\"((())()())\"}))));\n Debug.Assert(SeparateParenGroups((\"() (()) ((())) (((())))\")).Equals((new List(new string[]{(string)\"()\", (string)\"(())\", (string)\"((()))\", (string)\"(((())))\"}))));\n Debug.Assert(SeparateParenGroups((\"(()(())((())))\")).Equals((new List(new string[]{(string)\"(()(())((())))\"}))));\n Debug.Assert(SeparateParenGroups((\"( ) (( )) (( )( ))\")).Equals((new List(new string[]{(string)\"()\", (string)\"(())\", (string)\"(()())\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You will be given a string of words separated by commas or spaces. Your task is\n // to split the string into words and return an array of the words.\n // For example:\n // words_string(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n // words_string(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\n public static List WordsString(string s) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(WordsString((\"Hi, my name is John\")).Equals((new List(new string[]{(string)\"Hi\", (string)\"my\", (string)\"name\", (string)\"is\", (string)\"John\"}))));\n Debug.Assert(WordsString((\"One, two, three, four, five, six\")).Equals((new List(new string[]{(string)\"One\", (string)\"two\", (string)\"three\", (string)\"four\", (string)\"five\", (string)\"six\"}))));\n Debug.Assert(WordsString((\"Hi, my name\")).Equals((new List(new string[]{(string)\"Hi\", (string)\"my\", (string)\"name\"}))));\n Debug.Assert(WordsString((\"One,, two, three, four, five, six,\")).Equals((new List(new string[]{(string)\"One\", (string)\"two\", (string)\"three\", (string)\"four\", (string)\"five\", (string)\"six\"}))));\n Debug.Assert(WordsString((\"\")).Equals((new List())));\n Debug.Assert(WordsString((\"ahmed , gamal\")).Equals((new List(new string[]{(string)\"ahmed\", (string)\"gamal\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Filter given list of any python values only for integers\n // >>> filter_integers(['a', 3.14, 5])\n // [5]\n // >>> filter_integers([1, 2, 3, 'abc', {}, []])\n // [1, 2, 3]\n public static List FilterIntegers(List values) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FilterIntegers((new List())).Equals((new List())));\n Debug.Assert(FilterIntegers((new List(new object[]{4L, new List(), 23.2f, 9L, \"adasd\"}))).Equals((new List(new long[]{(long)4L, (long)9L}))));\n Debug.Assert(FilterIntegers((new List(new object[]{3L, \"c\", 3L, 3L, \"a\", \"b\"}))).Equals((new List(new long[]{(long)3L, (long)3L, (long)3L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // This function takes a list l and returns a list l' such that\n // l' is identical to l in the odd indicies, while its values at the even indicies are equal\n // to the values of the even indicies of l, but sorted.\n // >>> sort_even([1, 2, 3])\n // [1, 2, 3]\n // >>> sort_even([5, 6, 3, 4])\n // [3, 6, 5, 4]\n public static List SortEven(List l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SortEven((new List(new long[]{(long)1L, (long)2L, (long)3L}))).Equals((new List(new long[]{(long)1L, (long)2L, (long)3L}))));\n Debug.Assert(SortEven((new List(new long[]{(long)5L, (long)3L, (long)-5L, (long)2L, (long)-3L, (long)3L, (long)9L, (long)0L, (long)123L, (long)1L, (long)-10L}))).Equals((new List(new long[]{(long)-10L, (long)3L, (long)-5L, (long)2L, (long)-3L, (long)3L, (long)5L, (long)0L, (long)9L, (long)1L, (long)123L}))));\n Debug.Assert(SortEven((new List(new long[]{(long)5L, (long)8L, (long)-12L, (long)4L, (long)23L, (long)2L, (long)3L, (long)11L, (long)12L, (long)-10L}))).Equals((new List(new long[]{(long)-12L, (long)8L, (long)3L, (long)4L, (long)5L, (long)2L, (long)12L, (long)11L, (long)23L, (long)-10L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // I think we all remember that feeling when the result of some long-awaited\n // event is finally known. The feelings and thoughts you have at that moment are\n // definitely worth noting down and comparing.\n // Your task is to determine if a person correctly guessed the results of a number of matches.\n // You are given two arrays of scores and guesses of equal length, where each index shows a match. \n // Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n // the value is 0, and if not, the value is the absolute difference between the guess and the score.\n // example:\n // compare([1,2,3,4,5,1],[1,2,3,4,2,-2]) -> [0,0,0,0,3,3]\n // compare([0,5,0,0,0,4],[4,1,1,0,0,-2]) -> [4,4,1,0,0,6]\n public static List Compare(List game, List guess) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Compare((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)1L})), (new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)2L, (long)-2L}))).Equals((new List(new long[]{(long)0L, (long)0L, (long)0L, (long)0L, (long)3L, (long)3L}))));\n Debug.Assert(Compare((new List(new long[]{(long)0L, (long)0L, (long)0L, (long)0L, (long)0L, (long)0L})), (new List(new long[]{(long)0L, (long)0L, (long)0L, (long)0L, (long)0L, (long)0L}))).Equals((new List(new long[]{(long)0L, (long)0L, (long)0L, (long)0L, (long)0L, (long)0L}))));\n Debug.Assert(Compare((new List(new long[]{(long)1L, (long)2L, (long)3L})), (new List(new long[]{(long)-1L, (long)-2L, (long)-3L}))).Equals((new List(new long[]{(long)2L, (long)4L, (long)6L}))));\n Debug.Assert(Compare((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)5L})), (new List(new long[]{(long)-1L, (long)2L, (long)3L, (long)4L}))).Equals((new List(new long[]{(long)2L, (long)0L, (long)0L, (long)1L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a positive integer n, return a tuple that has the number of even and odd\n // integer palindromes that fall within the range(1, n), inclusive.\n // Example 1:\n // Input: 3\n // Output: (1, 2)\n // Explanation:\n // Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n // Example 2:\n // Input: 12\n // Output: (4, 6)\n // Explanation:\n // Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n // Note:\n // 1. 1 <= n <= 10^3\n // 2. returned tuple has the number of even and odd integer palindromes respectively.\n public static Tuple EvenOddPalindrome(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(EvenOddPalindrome((123L)).Equals((Tuple.Create(8L, 13L))));\n Debug.Assert(EvenOddPalindrome((12L)).Equals((Tuple.Create(4L, 6L))));\n Debug.Assert(EvenOddPalindrome((3L)).Equals((Tuple.Create(1L, 2L))));\n Debug.Assert(EvenOddPalindrome((63L)).Equals((Tuple.Create(6L, 8L))));\n Debug.Assert(EvenOddPalindrome((25L)).Equals((Tuple.Create(5L, 6L))));\n Debug.Assert(EvenOddPalindrome((19L)).Equals((Tuple.Create(4L, 6L))));\n Debug.Assert(EvenOddPalindrome((9L)).Equals((Tuple.Create(4L, 5L))));\n Debug.Assert(EvenOddPalindrome((1L)).Equals((Tuple.Create(0L, 1L))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n // fib4(0) -> 0\n // fib4(1) -> 0\n // fib4(2) -> 2\n // fib4(3) -> 0\n // fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n // Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n // >>> fib4(5)\n // 4\n // >>> fib4(6)\n // 8\n // >>> fib4(7)\n // 14\n public static long Fib4(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Fib4((5L)) == (4L));\n Debug.Assert(Fib4((8L)) == (28L));\n Debug.Assert(Fib4((10L)) == (104L));\n Debug.Assert(Fib4((12L)) == (386L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given two positive integers a and b, return the even digits between a\n // and b, in ascending order.\n // For example:\n // generate_integers(2, 8) => [2, 4, 6, 8]\n // generate_integers(8, 2) => [2, 4, 6, 8]\n // generate_integers(10, 14) => []\n public static List GenerateIntegers(long a, long b) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(GenerateIntegers((2L), (10L)).Equals((new List(new long[]{(long)2L, (long)4L, (long)6L, (long)8L}))));\n Debug.Assert(GenerateIntegers((10L), (2L)).Equals((new List(new long[]{(long)2L, (long)4L, (long)6L, (long)8L}))));\n Debug.Assert(GenerateIntegers((132L), (2L)).Equals((new List(new long[]{(long)2L, (long)4L, (long)6L, (long)8L}))));\n Debug.Assert(GenerateIntegers((17L), (89L)).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // For a given list of input numbers, calculate Mean Absolute Deviation\n // around the mean of this dataset.\n // Mean Absolute Deviation is the average absolute difference between each\n // element and a centerpoint (mean in this case):\n // MAD = average | x - x_mean |\n // >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n // 1.0\n public static float MeanAbsoluteDeviation(List numbers) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(MeanAbsoluteDeviation((new List(new float[]{(float)1.0f, (float)2.0f}))) == (0.5f));\n Debug.Assert(MeanAbsoluteDeviation((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f}))) == (1.0f));\n Debug.Assert(MeanAbsoluteDeviation((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f}))) == (1.2f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function encrypt that takes a string as an argument and\n // returns a string encrypted with the alphabet being rotated. \n // The alphabet should be rotated in a manner such that the letters \n // shift down by two multiplied to two places.\n // For example:\n // encrypt('hi') returns 'lm'\n // encrypt('asdfghjkl') returns 'ewhjklnop'\n // encrypt('gf') returns 'kj'\n // encrypt('et') returns 'ix'\n public static string Encrypt(string s) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Encrypt((\"hi\")).Equals((\"lm\")));\n Debug.Assert(Encrypt((\"asdfghjkl\")).Equals((\"ewhjklnop\")));\n Debug.Assert(Encrypt((\"gf\")).Equals((\"kj\")));\n Debug.Assert(Encrypt((\"et\")).Equals((\"ix\")));\n Debug.Assert(Encrypt((\"faewfawefaewg\")).Equals((\"jeiajeaijeiak\")));\n Debug.Assert(Encrypt((\"hellomyfriend\")).Equals((\"lippsqcjvmirh\")));\n Debug.Assert(Encrypt((\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\")).Equals((\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\")));\n Debug.Assert(Encrypt((\"a\")).Equals((\"e\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n // The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n // as follows: start with any positive integer n. Then each term is obtained from the \n // previous term as follows: if the previous term is even, the next term is one half of \n // the previous term. If the previous term is odd, the next term is 3 times the previous\n // term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n // Note: \n // 1. Collatz(1) is [1].\n // 2. returned list sorted in increasing order.\n // For example:\n // get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n public static List GetOddCollatz(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(GetOddCollatz((14L)).Equals((new List(new long[]{(long)1L, (long)5L, (long)7L, (long)11L, (long)13L, (long)17L}))));\n Debug.Assert(GetOddCollatz((5L)).Equals((new List(new long[]{(long)1L, (long)5L}))));\n Debug.Assert(GetOddCollatz((12L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)5L}))));\n Debug.Assert(GetOddCollatz((1L)).Equals((new List(new long[]{(long)1L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Find how many times a given substring can be found in the original string. Count overlaping cases.\n // >>> how_many_times('', 'a')\n // 0\n // >>> how_many_times('aaa', 'a')\n // 3\n // >>> how_many_times('aaaa', 'aa')\n // 3\n public static long HowManyTimes(string str, string substring) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(HowManyTimes((\"\"), (\"x\")) == (0L));\n Debug.Assert(HowManyTimes((\"xyxyxyx\"), (\"x\")) == (4L));\n Debug.Assert(HowManyTimes((\"cacacacac\"), (\"cac\")) == (4L));\n Debug.Assert(HowManyTimes((\"john doe\"), (\"john\")) == (1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n // numbers in the array will be randomly ordered. Your task is to determine if\n // it is possible to get an array sorted in non-decreasing order by performing \n // the following operation on the given array:\n // You are allowed to perform right shift operation any number of times.\n // One right shift operation means shifting all elements of the array by one\n // position in the right direction. The last element of the array will be moved to\n // the starting position in the array i.e. 0th index. \n // If it is possible to obtain the sorted array by performing the above operation\n // then return True else return False.\n // If the given array is empty then return True.\n // Note: The given list is guaranteed to have unique elements.\n // For Example:\n // move_one_ball([3, 4, 5, 1, 2])==>True\n // Explanation: By performin 2 right shift operations, non-decreasing order can\n // be achieved for the given array.\n // move_one_ball([3, 5, 4, 1, 2])==>False\n // Explanation:It is not possible to get non-decreasing order for the given\n // array by performing any number of right shift operations.\n public static bool MoveOneBall(List arr) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(MoveOneBall((new List(new long[]{(long)3L, (long)4L, (long)5L, (long)1L, (long)2L}))) == (true));\n Debug.Assert(MoveOneBall((new List(new long[]{(long)3L, (long)5L, (long)10L, (long)1L, (long)2L}))) == (true));\n Debug.Assert(MoveOneBall((new List(new long[]{(long)4L, (long)3L, (long)1L, (long)2L}))) == (false));\n Debug.Assert(MoveOneBall((new List(new long[]{(long)3L, (long)5L, (long)4L, (long)1L, (long)2L}))) == (false));\n Debug.Assert(MoveOneBall((new List())) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function which sorts the given list of integers\n // in ascending order according to the sum of their digits.\n // Note: if there are several items with similar sum of their digits,\n // order them based on their index in original list.\n // For example:\n // >>> order_by_points([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]\n // >>> order_by_points([]) == []\n public static List OrderByPoints(List nums) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(OrderByPoints((new List(new long[]{(long)1L, (long)11L, (long)-1L, (long)-11L, (long)-12L}))).Equals((new List(new long[]{(long)-1L, (long)-11L, (long)1L, (long)-12L, (long)11L}))));\n Debug.Assert(OrderByPoints((new List(new long[]{(long)1234L, (long)423L, (long)463L, (long)145L, (long)2L, (long)423L, (long)423L, (long)53L, (long)6L, (long)37L, (long)3457L, (long)3L, (long)56L, (long)0L, (long)46L}))).Equals((new List(new long[]{(long)0L, (long)2L, (long)3L, (long)6L, (long)53L, (long)423L, (long)423L, (long)423L, (long)1234L, (long)145L, (long)37L, (long)46L, (long)56L, (long)463L, (long)3457L}))));\n Debug.Assert(OrderByPoints((new List())).Equals((new List())));\n Debug.Assert(OrderByPoints((new List(new long[]{(long)1L, (long)-11L, (long)-32L, (long)43L, (long)54L, (long)-98L, (long)2L, (long)-3L}))).Equals((new List(new long[]{(long)-3L, (long)-32L, (long)-98L, (long)-11L, (long)1L, (long)2L, (long)43L, (long)54L}))));\n Debug.Assert(OrderByPoints((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L, (long)7L, (long)8L, (long)9L, (long)10L, (long)11L}))).Equals((new List(new long[]{(long)1L, (long)10L, (long)2L, (long)11L, (long)3L, (long)4L, (long)5L, (long)6L, (long)7L, (long)8L, (long)9L}))));\n Debug.Assert(OrderByPoints((new List(new long[]{(long)0L, (long)6L, (long)6L, (long)-76L, (long)-21L, (long)23L, (long)4L}))).Equals((new List(new long[]{(long)-76L, (long)-21L, (long)0L, (long)4L, (long)23L, (long)6L, (long)6L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return list of prime factors of given integer in the order from smallest to largest.\n // Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n // Input number should be equal to the product of all factors\n // >>> factorize(8)\n // [2, 2, 2]\n // >>> factorize(25)\n // [5, 5]\n // >>> factorize(70)\n // [2, 5, 7]\n public static List Factorize(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Factorize((2L)).Equals((new List(new long[]{(long)2L}))));\n Debug.Assert(Factorize((4L)).Equals((new List(new long[]{(long)2L, (long)2L}))));\n Debug.Assert(Factorize((8L)).Equals((new List(new long[]{(long)2L, (long)2L, (long)2L}))));\n Debug.Assert(Factorize((57L)).Equals((new List(new long[]{(long)3L, (long)19L}))));\n Debug.Assert(Factorize((3249L)).Equals((new List(new long[]{(long)3L, (long)3L, (long)19L, (long)19L}))));\n Debug.Assert(Factorize((185193L)).Equals((new List(new long[]{(long)3L, (long)3L, (long)3L, (long)19L, (long)19L, (long)19L}))));\n Debug.Assert(Factorize((20577L)).Equals((new List(new long[]{(long)3L, (long)19L, (long)19L, (long)19L}))));\n Debug.Assert(Factorize((18L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)3L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return True if all numbers in the list l are below threshold t.\n // >>> below_threshold([1, 2, 4, 10], 100)\n // True\n // >>> below_threshold([1, 20, 4, 10], 5)\n // False\n public static bool BelowThreshold(List l, long t) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(BelowThreshold((new List(new long[]{(long)1L, (long)2L, (long)4L, (long)10L})), (100L)) == (true));\n Debug.Assert(BelowThreshold((new List(new long[]{(long)1L, (long)20L, (long)4L, (long)10L})), (5L)) == (false));\n Debug.Assert(BelowThreshold((new List(new long[]{(long)1L, (long)20L, (long)4L, (long)10L})), (21L)) == (true));\n Debug.Assert(BelowThreshold((new List(new long[]{(long)1L, (long)20L, (long)4L, (long)10L})), (22L)) == (true));\n Debug.Assert(BelowThreshold((new List(new long[]{(long)1L, (long)8L, (long)4L, (long)10L})), (11L)) == (true));\n Debug.Assert(BelowThreshold((new List(new long[]{(long)1L, (long)8L, (long)4L, (long)10L})), (10L)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n // For each of the group, output the deepest level of nesting of parentheses.\n // E.g. (()()) has maximum two levels of nesting while ((())) has three.\n // >>> parse_nested_parens('(()()) ((())) () ((())()())')\n // [2, 3, 1, 3]\n public static List ParseNestedParens(string paren_string) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ParseNestedParens((\"(()()) ((())) () ((())()())\")).Equals((new List(new long[]{(long)2L, (long)3L, (long)1L, (long)3L}))));\n Debug.Assert(ParseNestedParens((\"() (()) ((())) (((())))\")).Equals((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))));\n Debug.Assert(ParseNestedParens((\"(()(())((())))\")).Equals((new List(new long[]{(long)4L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n // Examples\n // solution([5, 8, 7, 1]) ==> 12\n // solution([3, 3, 3, 3, 3]) ==> 9\n // solution([30, 13, 24, 321]) ==>0\n public static long Solution(List lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Solution((new List(new long[]{(long)5L, (long)8L, (long)7L, (long)1L}))) == (12L));\n Debug.Assert(Solution((new List(new long[]{(long)3L, (long)3L, (long)3L, (long)3L, (long)3L}))) == (9L));\n Debug.Assert(Solution((new List(new long[]{(long)30L, (long)13L, (long)24L, (long)321L}))) == (0L));\n Debug.Assert(Solution((new List(new long[]{(long)5L, (long)9L}))) == (5L));\n Debug.Assert(Solution((new List(new long[]{(long)2L, (long)4L, (long)8L}))) == (0L));\n Debug.Assert(Solution((new List(new long[]{(long)30L, (long)13L, (long)23L, (long)32L}))) == (23L));\n Debug.Assert(Solution((new List(new long[]{(long)3L, (long)13L, (long)2L, (long)9L}))) == (3L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a positive integer n. You have to create an integer array a of length n.\n // For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n // Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n // and a[i] + a[j] + a[k] is a multiple of 3.\n // Example :\n // Input: n = 5\n // Output: 1\n // Explanation: \n // a = [1, 3, 7, 13, 21]\n // The only valid triple is (1, 7, 13).\n public static long GetMaxTriples(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(GetMaxTriples((5L)) == (1L));\n Debug.Assert(GetMaxTriples((6L)) == (4L));\n Debug.Assert(GetMaxTriples((10L)) == (36L));\n Debug.Assert(GetMaxTriples((100L)) == (53361L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // There are eight planets in our solar system: the closerst to the Sun \n // is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n // Uranus, Neptune.\n // Write a function that takes two planet names as strings planet1 and planet2. \n // The function should return a tuple containing all planets whose orbits are \n // located between the orbit of planet1 and the orbit of planet2, sorted by \n // the proximity to the sun. \n // The function should return an empty tuple if planet1 or planet2\n // are not correct planet names. \n // Examples\n // bf(\"Jupiter\", \"Neptune\") ==> (\"Saturn\", \"Uranus\")\n // bf(\"Earth\", \"Mercury\") ==> (\"Venus\")\n // bf(\"Mercury\", \"Uranus\") ==> (\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\")\n public static List Bf(string planet1, string planet2) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Bf((\"Jupiter\"), (\"Neptune\")).Equals((new List(new string[]{(string)\"Saturn\", (string)\"Uranus\"}))));\n Debug.Assert(Bf((\"Earth\"), (\"Mercury\")).Equals((new List(new string[]{(string)\"Venus\"}))));\n Debug.Assert(Bf((\"Mercury\"), (\"Uranus\")).Equals((new List(new string[]{(string)\"Venus\", (string)\"Earth\", (string)\"Mars\", (string)\"Jupiter\", (string)\"Saturn\"}))));\n Debug.Assert(Bf((\"Neptune\"), (\"Venus\")).Equals((new List(new string[]{(string)\"Earth\", (string)\"Mars\", (string)\"Jupiter\", (string)\"Saturn\", (string)\"Uranus\"}))));\n Debug.Assert(Bf((\"Earth\"), (\"Earth\")).Equals((new List())));\n Debug.Assert(Bf((\"Mars\"), (\"Earth\")).Equals((new List())));\n Debug.Assert(Bf((\"Jupiter\"), (\"Makemake\")).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a list of integers.\n // Write a function next_smallest() that returns the 2nd smallest element of the list.\n // Return None if there is no such element.\n // next_smallest([1, 2, 3, 4, 5]) == 2\n // next_smallest([5, 1, 4, 3, 2]) == 2\n // next_smallest([]) == None\n // next_smallest([1, 1]) == None\n public static Nullable NextSmallest(List lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(NextSmallest((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L}))).Equals(2L));\n Debug.Assert(NextSmallest((new List(new long[]{(long)5L, (long)1L, (long)4L, (long)3L, (long)2L}))).Equals(2L));\n Debug.Assert(NextSmallest((new List())).Equals(null));\n Debug.Assert(NextSmallest((new List(new long[]{(long)1L, (long)1L}))).Equals(null));\n Debug.Assert(NextSmallest((new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L, (long)0L}))).Equals(1L));\n Debug.Assert(NextSmallest((new List(new long[]{(long)1L, (long)1L}))).Equals(null));\n Debug.Assert(NextSmallest((new List(new long[]{(long)-35L, (long)34L, (long)12L, (long)-45L}))).Equals(-35L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Input is a space-delimited string of numberals from 'zero' to 'nine'.\n // Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n // Return the string with numbers sorted from smallest to largest\n // >>> sort_numbers('three one five')\n // 'one three five'\n public static string SortNumbers(string numbers) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SortNumbers((\"\")).Equals((\"\")));\n Debug.Assert(SortNumbers((\"three\")).Equals((\"three\")));\n Debug.Assert(SortNumbers((\"three five nine\")).Equals((\"three five nine\")));\n Debug.Assert(SortNumbers((\"five zero four seven nine eight\")).Equals((\"zero four five seven eight nine\")));\n Debug.Assert(SortNumbers((\"six five four three two one zero\")).Equals((\"zero one two three four five six\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n // cycpattern_check(\"abcd\",\"abd\") => False\n // cycpattern_check(\"hello\",\"ell\") => True\n // cycpattern_check(\"whassup\",\"psus\") => False\n // cycpattern_check(\"abab\",\"baa\") => True\n // cycpattern_check(\"efef\",\"eeff\") => False\n // cycpattern_check(\"himenss\",\"simen\") => True\n public static bool CycpatternCheck(string a, string b) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CycpatternCheck((\"xyzw\"), (\"xyw\")) == (false));\n Debug.Assert(CycpatternCheck((\"yello\"), (\"ell\")) == (true));\n Debug.Assert(CycpatternCheck((\"whattup\"), (\"ptut\")) == (false));\n Debug.Assert(CycpatternCheck((\"efef\"), (\"fee\")) == (true));\n Debug.Assert(CycpatternCheck((\"abab\"), (\"aabb\")) == (false));\n Debug.Assert(CycpatternCheck((\"winemtt\"), (\"tinem\")) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You will be given a number in decimal form and your task is to convert it to\n // binary format. The function should return a string, with each character representing a binary\n // number. Each character in the string will be '0' or '1'.\n // There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n // The extra characters are there to help with the format.\n // Examples:\n // decimal_to_binary(15) # returns \"db1111db\"\n // decimal_to_binary(32) # returns \"db100000db\"\n public static string DecimalToBinary(long decimalNum) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(DecimalToBinary((0L)).Equals((\"db0db\")));\n Debug.Assert(DecimalToBinary((32L)).Equals((\"db100000db\")));\n Debug.Assert(DecimalToBinary((103L)).Equals((\"db1100111db\")));\n Debug.Assert(DecimalToBinary((15L)).Equals((\"db1111db\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Filter an input list of strings only for ones that contain given substring\n // >>> filter_by_substring([], 'a')\n // []\n // >>> filter_by_substring(['abc', 'bacd', 'cde', 'array'], 'a')\n // ['abc', 'bacd', 'array']\n public static List FilterBySubstring(List strings, string substring) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FilterBySubstring((new List()), (\"john\")).Equals((new List())));\n Debug.Assert(FilterBySubstring((new List(new string[]{(string)\"xxx\", (string)\"asd\", (string)\"xxy\", (string)\"john doe\", (string)\"xxxAAA\", (string)\"xxx\"})), (\"xxx\")).Equals((new List(new string[]{(string)\"xxx\", (string)\"xxxAAA\", (string)\"xxx\"}))));\n Debug.Assert(FilterBySubstring((new List(new string[]{(string)\"xxx\", (string)\"asd\", (string)\"aaaxxy\", (string)\"john doe\", (string)\"xxxAAA\", (string)\"xxx\"})), (\"xx\")).Equals((new List(new string[]{(string)\"xxx\", (string)\"aaaxxy\", (string)\"xxxAAA\", (string)\"xxx\"}))));\n Debug.Assert(FilterBySubstring((new List(new string[]{(string)\"grunt\", (string)\"trumpet\", (string)\"prune\", (string)\"gruesome\"})), (\"run\")).Equals((new List(new string[]{(string)\"grunt\", (string)\"prune\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given an integer. return a tuple that has the number of even and odd digits respectively.\n // Example:\n // even_odd_count(-12) ==> (1, 1)\n // even_odd_count(123) ==> (1, 2)\n public static Tuple EvenOddCount(long num) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(EvenOddCount((7L)).Equals((Tuple.Create(0L, 1L))));\n Debug.Assert(EvenOddCount((-78L)).Equals((Tuple.Create(1L, 1L))));\n Debug.Assert(EvenOddCount((3452L)).Equals((Tuple.Create(2L, 2L))));\n Debug.Assert(EvenOddCount((346211L)).Equals((Tuple.Create(3L, 3L))));\n Debug.Assert(EvenOddCount((-345821L)).Equals((Tuple.Create(3L, 3L))));\n Debug.Assert(EvenOddCount((-2L)).Equals((Tuple.Create(1L, 0L))));\n Debug.Assert(EvenOddCount((-45347L)).Equals((Tuple.Create(2L, 3L))));\n Debug.Assert(EvenOddCount((0L)).Equals((Tuple.Create(1L, 0L))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that accepts a list of strings.\n // The list contains different words. Return the word with maximum number\n // of unique characters. If multiple strings have maximum number of unique\n // characters, return the one which comes first in lexicographical order.\n // find_max([\"name\", \"of\", \"string\"]) == \"string\"\n // find_max([\"name\", \"enam\", \"game\"]) == \"enam\"\n // find_max([\"aaaaaaa\", \"bb\" ,\"cc\"]) == \"\"aaaaaaa\"\n public static string FindMax(List words) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FindMax((new List(new string[]{(string)\"name\", (string)\"of\", (string)\"string\"}))).Equals((\"string\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"name\", (string)\"enam\", (string)\"game\"}))).Equals((\"enam\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"aaaaaaa\", (string)\"bb\", (string)\"cc\"}))).Equals((\"aaaaaaa\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"abc\", (string)\"cba\"}))).Equals((\"abc\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"play\", (string)\"this\", (string)\"game\", (string)\"of\", (string)\"footbott\"}))).Equals((\"footbott\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"we\", (string)\"are\", (string)\"gonna\", (string)\"rock\"}))).Equals((\"gonna\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"we\", (string)\"are\", (string)\"a\", (string)\"mad\", (string)\"nation\"}))).Equals((\"nation\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"this\", (string)\"is\", (string)\"a\", (string)\"prrk\"}))).Equals((\"this\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"b\"}))).Equals((\"b\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"play\", (string)\"play\", (string)\"play\"}))).Equals((\"play\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a positive integer n, return the count of the numbers of n-digit\n // positive integers that start or end with 1.\n public static long StartsOneEnds(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(StartsOneEnds((1L)) == (1L));\n Debug.Assert(StartsOneEnds((2L)) == (18L));\n Debug.Assert(StartsOneEnds((3L)) == (180L));\n Debug.Assert(StartsOneEnds((4L)) == (1800L));\n Debug.Assert(StartsOneEnds((5L)) == (18000L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function that returns a tuple (a, b), where 'a' is\n // the largest of negative integers, and 'b' is the smallest\n // of positive integers in a list.\n // If there is no negative or positive integers, return them as None.\n // Examples:\n // largest_smallest_integers([2, 4, 1, 3, 5, 7]) == (None, 1)\n // largest_smallest_integers([]) == (None, None)\n // largest_smallest_integers([0]) == (None, None)\n public static Tuple, Nullable> LargestSmallestIntegers(List lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)2L, (long)4L, (long)1L, (long)3L, (long)5L, (long)7L}))).Equals(Tuple.Create((Nullable)null, 1L)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)2L, (long)4L, (long)1L, (long)3L, (long)5L, (long)7L, (long)0L}))).Equals(Tuple.Create((Nullable)null, 1L)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)4L, (long)5L, (long)6L, (long)-2L}))).Equals(Tuple.Create(-2L, 1L)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)4L, (long)5L, (long)3L, (long)6L, (long)2L, (long)7L, (long)-7L}))).Equals(Tuple.Create(-7L, 2L)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)7L, (long)3L, (long)8L, (long)4L, (long)9L, (long)2L, (long)5L, (long)-9L}))).Equals(Tuple.Create(-9L, 2L)));\n Debug.Assert(LargestSmallestIntegers((new List())).Equals(Tuple.Create((Nullable)null, (Nullable)null)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)0L}))).Equals(Tuple.Create((Nullable)null, (Nullable)null)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)-1L, (long)-3L, (long)-5L, (long)-6L}))).Equals(Tuple.Create(-1L, (Nullable)null)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)-1L, (long)-3L, (long)-5L, (long)-6L, (long)0L}))).Equals(Tuple.Create(-1L, (Nullable)null)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)-6L, (long)-4L, (long)-4L, (long)-3L, (long)1L}))).Equals(Tuple.Create(-3L, 1L)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)-6L, (long)-4L, (long)-4L, (long)-3L, (long)-100L, (long)1L}))).Equals(Tuple.Create(-3L, 1L)));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // \"Given an array representing a branch of a tree that has non-negative integer nodes\n // your task is to pluck one of the nodes and return it.\n // The plucked node should be the node with the smallest even value.\n // If multiple nodes with the same smallest even value are found return the node that has smallest index.\n // The plucked node should be returned in a list, [ smalest_value, its index ],\n // If there are no even values or the given array is empty, return [].\n // Example 1:\n // Input: [4,2,3]\n // Output: [2, 1]\n // Explanation: 2 has the smallest even value, and 2 has the smallest index.\n // Example 2:\n // Input: [1,2,3]\n // Output: [2, 1]\n // Explanation: 2 has the smallest even value, and 2 has the smallest index. \n // Example 3:\n // Input: []\n // Output: []\n // Example 4:\n // Input: [5, 0, 3, 0, 4, 2]\n // Output: [0, 1]\n // Explanation: 0 is the smallest value, but there are two zeros,\n // so we will choose the first zero, which has the smallest index.\n // Constraints:\n // * 1 <= nodes.length <= 10000\n // * 0 <= node.value\n public static List Pluck(List arr) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Pluck((new List(new long[]{(long)4L, (long)2L, (long)3L}))).Equals((new List(new long[]{(long)2L, (long)1L}))));\n Debug.Assert(Pluck((new List(new long[]{(long)1L, (long)2L, (long)3L}))).Equals((new List(new long[]{(long)2L, (long)1L}))));\n Debug.Assert(Pluck((new List())).Equals((new List())));\n Debug.Assert(Pluck((new List(new long[]{(long)5L, (long)0L, (long)3L, (long)0L, (long)4L, (long)2L}))).Equals((new List(new long[]{(long)0L, (long)1L}))));\n Debug.Assert(Pluck((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)0L, (long)5L, (long)3L}))).Equals((new List(new long[]{(long)0L, (long)3L}))));\n Debug.Assert(Pluck((new List(new long[]{(long)5L, (long)4L, (long)8L, (long)4L, (long)8L}))).Equals((new List(new long[]{(long)4L, (long)1L}))));\n Debug.Assert(Pluck((new List(new long[]{(long)7L, (long)6L, (long)7L, (long)1L}))).Equals((new List(new long[]{(long)6L, (long)1L}))));\n Debug.Assert(Pluck((new List(new long[]{(long)7L, (long)9L, (long)7L, (long)1L}))).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function count_nums which takes an array of integers and returns\n // the number of elements which has a sum of digits > 0.\n // If a number is negative, then its first signed digit will be negative:\n // e.g. -123 has signed digits -1, 2, and 3.\n // >>> count_nums([]) == 0\n // >>> count_nums([-1, 11, -11]) == 1\n // >>> count_nums([1, 1, 2]) == 3\n public static long CountNums(List arr) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CountNums((new List())) == (0L));\n Debug.Assert(CountNums((new List(new long[]{(long)-1L, (long)-2L, (long)0L}))) == (0L));\n Debug.Assert(CountNums((new List(new long[]{(long)1L, (long)1L, (long)2L, (long)-2L, (long)3L, (long)4L, (long)5L}))) == (6L));\n Debug.Assert(CountNums((new List(new long[]{(long)1L, (long)6L, (long)9L, (long)-6L, (long)0L, (long)1L, (long)5L}))) == (5L));\n Debug.Assert(CountNums((new List(new long[]{(long)1L, (long)100L, (long)98L, (long)-7L, (long)1L, (long)-1L}))) == (4L));\n Debug.Assert(CountNums((new List(new long[]{(long)12L, (long)23L, (long)34L, (long)-45L, (long)-56L, (long)0L}))) == (5L));\n Debug.Assert(CountNums((new List(new long[]{(long)0L, (long)1L}))) == (1L));\n Debug.Assert(CountNums((new List(new long[]{(long)1L}))) == (1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n // each cell of the grid contains a value. Every integer in the range [1, N * N]\n // inclusive appears exactly once on the cells of the grid.\n // You have to find the minimum path of length k in the grid. You can start\n // from any cell, and in each step you can move to any of the neighbor cells,\n // in other words, you can go to cells which share an edge with you current\n // cell.\n // Please note that a path of length k means visiting exactly k cells (not\n // necessarily distinct).\n // You CANNOT go off the grid.\n // A path A (of length k) is considered less than a path B (of length k) if\n // after making the ordered lists of the values on the cells that A and B go\n // through (let's call them lst_A and lst_B), lst_A is lexicographically less\n // than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n // such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n // lst_A[j] = lst_B[j].\n // It is guaranteed that the answer is unique.\n // Return an ordered list of the values on the cells that the minimum path go through.\n // Examples:\n // Input: grid = [ [1,2,3], [4,5,6], [7,8,9]], k = 3\n // Output: [1, 2, 1]\n // Input: grid = [ [5,9,3], [4,1,6], [7,8,2]], k = 1\n // Output: [1]\n public static List Minpath(List> grid, long k) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)2L, (long)3L}), (List)new List(new long[]{(long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)7L, (long)8L, (long)9L})})), (3L)).Equals((new List(new long[]{(long)1L, (long)2L, (long)1L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)5L, (long)9L, (long)3L}), (List)new List(new long[]{(long)4L, (long)1L, (long)6L}), (List)new List(new long[]{(long)7L, (long)8L, (long)2L})})), (1L)).Equals((new List(new long[]{(long)1L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}), (List)new List(new long[]{(long)5L, (long)6L, (long)7L, (long)8L}), (List)new List(new long[]{(long)9L, (long)10L, (long)11L, (long)12L}), (List)new List(new long[]{(long)13L, (long)14L, (long)15L, (long)16L})})), (4L)).Equals((new List(new long[]{(long)1L, (long)2L, (long)1L, (long)2L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)6L, (long)4L, (long)13L, (long)10L}), (List)new List(new long[]{(long)5L, (long)7L, (long)12L, (long)1L}), (List)new List(new long[]{(long)3L, (long)16L, (long)11L, (long)15L}), (List)new List(new long[]{(long)8L, (long)14L, (long)9L, (long)2L})})), (7L)).Equals((new List(new long[]{(long)1L, (long)10L, (long)1L, (long)10L, (long)1L, (long)10L, (long)1L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)8L, (long)14L, (long)9L, (long)2L}), (List)new List(new long[]{(long)6L, (long)4L, (long)13L, (long)15L}), (List)new List(new long[]{(long)5L, (long)7L, (long)1L, (long)12L}), (List)new List(new long[]{(long)3L, (long)10L, (long)11L, (long)16L})})), (5L)).Equals((new List(new long[]{(long)1L, (long)7L, (long)1L, (long)7L, (long)1L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)11L, (long)8L, (long)7L, (long)2L}), (List)new List(new long[]{(long)5L, (long)16L, (long)14L, (long)4L}), (List)new List(new long[]{(long)9L, (long)3L, (long)15L, (long)6L}), (List)new List(new long[]{(long)12L, (long)13L, (long)10L, (long)1L})})), (9L)).Equals((new List(new long[]{(long)1L, (long)6L, (long)1L, (long)6L, (long)1L, (long)6L, (long)1L, (long)6L, (long)1L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)12L, (long)13L, (long)10L, (long)1L}), (List)new List(new long[]{(long)9L, (long)3L, (long)15L, (long)6L}), (List)new List(new long[]{(long)5L, (long)16L, (long)14L, (long)4L}), (List)new List(new long[]{(long)11L, (long)8L, (long)7L, (long)2L})})), (12L)).Equals((new List(new long[]{(long)1L, (long)6L, (long)1L, (long)6L, (long)1L, (long)6L, (long)1L, (long)6L, (long)1L, (long)6L, (long)1L, (long)6L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)2L, (long)7L, (long)4L}), (List)new List(new long[]{(long)3L, (long)1L, (long)5L}), (List)new List(new long[]{(long)6L, (long)8L, (long)9L})})), (8L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)1L, (long)3L, (long)1L, (long)3L, (long)1L, (long)3L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)6L, (long)1L, (long)5L}), (List)new List(new long[]{(long)3L, (long)8L, (long)9L}), (List)new List(new long[]{(long)2L, (long)7L, (long)4L})})), (8L)).Equals((new List(new long[]{(long)1L, (long)5L, (long)1L, (long)5L, (long)1L, (long)5L, (long)1L, (long)5L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)2L}), (List)new List(new long[]{(long)3L, (long)4L})})), (10L)).Equals((new List(new long[]{(long)1L, (long)2L, (long)1L, (long)2L, (long)1L, (long)2L, (long)1L, (long)2L, (long)1L, (long)2L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)3L}), (List)new List(new long[]{(long)3L, (long)2L})})), (10L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)1L, (long)3L, (long)1L, (long)3L, (long)1L, (long)3L, (long)1L, (long)3L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given list of integers, return list in strange order.\n // Strange sorting, is when you start with the minimum value,\n // then maximum of the remaining integers, then minimum and so on.\n // Examples:\n // strange_sort_list([1, 2, 3, 4]) == [1, 4, 2, 3]\n // strange_sort_list([5, 5, 5, 5]) == [5, 5, 5, 5]\n // strange_sort_list([]) == []\n public static List StrangeSortList(List lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(StrangeSortList((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))).Equals((new List(new long[]{(long)1L, (long)4L, (long)2L, (long)3L}))));\n Debug.Assert(StrangeSortList((new List(new long[]{(long)5L, (long)6L, (long)7L, (long)8L, (long)9L}))).Equals((new List(new long[]{(long)5L, (long)9L, (long)6L, (long)8L, (long)7L}))));\n Debug.Assert(StrangeSortList((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L}))).Equals((new List(new long[]{(long)1L, (long)5L, (long)2L, (long)4L, (long)3L}))));\n Debug.Assert(StrangeSortList((new List(new long[]{(long)5L, (long)6L, (long)7L, (long)8L, (long)9L, (long)1L}))).Equals((new List(new long[]{(long)1L, (long)9L, (long)5L, (long)8L, (long)6L, (long)7L}))));\n Debug.Assert(StrangeSortList((new List(new long[]{(long)5L, (long)5L, (long)5L, (long)5L}))).Equals((new List(new long[]{(long)5L, (long)5L, (long)5L, (long)5L}))));\n Debug.Assert(StrangeSortList((new List())).Equals((new List())));\n Debug.Assert(StrangeSortList((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L, (long)7L, (long)8L}))).Equals((new List(new long[]{(long)1L, (long)8L, (long)2L, (long)7L, (long)3L, (long)6L, (long)4L, (long)5L}))));\n Debug.Assert(StrangeSortList((new List(new long[]{(long)0L, (long)2L, (long)2L, (long)2L, (long)5L, (long)5L, (long)-5L, (long)-5L}))).Equals((new List(new long[]{(long)-5L, (long)5L, (long)-5L, (long)5L, (long)0L, (long)2L, (long)2L, (long)2L}))));\n Debug.Assert(StrangeSortList((new List(new long[]{(long)111111L}))).Equals((new List(new long[]{(long)111111L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a string 'text', return its md5 hash equivalent string.\n // If 'text' is an empty string, return None.\n // >>> string_to_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'\n public static string StringToMd5(string text) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(StringToMd5((\"Hello world\")).Equals((\"3e25960a79dbc69b674cd4ec67a72c62\")));\n Debug.Assert(StringToMd5((\"\")).Equals(null));\n Debug.Assert(StringToMd5((\"A B C\")).Equals((\"0ef78513b0cb8cef12743f5aeb35f888\")));\n Debug.Assert(StringToMd5((\"password\")).Equals((\"5f4dcc3b5aa765d61d8327deb882cf99\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a word. Your task is to find the closest vowel that stands between \n // two consonants from the right side of the word (case sensitive).\n // Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n // find any vowel met the above condition. \n // You may assume that the given string contains English letter only.\n // Example:\n // get_closest_vowel(\"yogurt\") ==> \"u\"\n // get_closest_vowel(\"FULL\") ==> \"U\"\n // get_closest_vowel(\"quick\") ==> \"\"\n // get_closest_vowel(\"ab\") ==> \"\"\n public static string GetClosestVowel(string word) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(GetClosestVowel((\"yogurt\")).Equals((\"u\")));\n Debug.Assert(GetClosestVowel((\"full\")).Equals((\"u\")));\n Debug.Assert(GetClosestVowel((\"easy\")).Equals((\"\")));\n Debug.Assert(GetClosestVowel((\"eAsy\")).Equals((\"\")));\n Debug.Assert(GetClosestVowel((\"ali\")).Equals((\"\")));\n Debug.Assert(GetClosestVowel((\"bad\")).Equals((\"a\")));\n Debug.Assert(GetClosestVowel((\"most\")).Equals((\"o\")));\n Debug.Assert(GetClosestVowel((\"ab\")).Equals((\"\")));\n Debug.Assert(GetClosestVowel((\"ba\")).Equals((\"\")));\n Debug.Assert(GetClosestVowel((\"quick\")).Equals((\"\")));\n Debug.Assert(GetClosestVowel((\"anime\")).Equals((\"i\")));\n Debug.Assert(GetClosestVowel((\"Asia\")).Equals((\"\")));\n Debug.Assert(GetClosestVowel((\"Above\")).Equals((\"o\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Change numerical base of input number x to base.\n // return string representation after the conversion.\n // base numbers are less than 10.\n // >>> change_base(8, 3)\n // '22'\n // >>> change_base(8, 2)\n // '1000'\n // >>> change_base(7, 2)\n // '111'\n public static string ChangeBase(long x, long numBase) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ChangeBase((8L), (3L)).Equals((\"22\")));\n Debug.Assert(ChangeBase((9L), (3L)).Equals((\"100\")));\n Debug.Assert(ChangeBase((234L), (2L)).Equals((\"11101010\")));\n Debug.Assert(ChangeBase((16L), (2L)).Equals((\"10000\")));\n Debug.Assert(ChangeBase((8L), (2L)).Equals((\"1000\")));\n Debug.Assert(ChangeBase((7L), (2L)).Equals((\"111\")));\n Debug.Assert(ChangeBase((2L), (3L)).Equals((\"2\")));\n Debug.Assert(ChangeBase((3L), (4L)).Equals((\"3\")));\n Debug.Assert(ChangeBase((4L), (5L)).Equals((\"4\")));\n Debug.Assert(ChangeBase((5L), (6L)).Equals((\"5\")));\n Debug.Assert(ChangeBase((6L), (7L)).Equals((\"6\")));\n Debug.Assert(ChangeBase((7L), (8L)).Equals((\"7\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Check if in given list of numbers, are any two numbers closer to each other than\n // given threshold.\n // >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n // False\n // >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n // True\n public static bool HasCloseElements(List numbers, float threshold) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(HasCloseElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.9f, (float)4.0f, (float)5.0f, (float)2.2f})), (0.3f)) == (true));\n Debug.Assert(HasCloseElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.9f, (float)4.0f, (float)5.0f, (float)2.2f})), (0.05f)) == (false));\n Debug.Assert(HasCloseElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)5.9f, (float)4.0f, (float)5.0f})), (0.95f)) == (true));\n Debug.Assert(HasCloseElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)5.9f, (float)4.0f, (float)5.0f})), (0.8f)) == (false));\n Debug.Assert(HasCloseElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.0f})), (0.1f)) == (true));\n Debug.Assert(HasCloseElements((new List(new float[]{(float)1.1f, (float)2.2f, (float)3.1f, (float)4.1f, (float)5.1f})), (1.0f)) == (true));\n Debug.Assert(HasCloseElements((new List(new float[]{(float)1.1f, (float)2.2f, (float)3.1f, (float)4.1f, (float)5.1f})), (0.5f)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function that takes a string as input which contains only square brackets.\n // The function should return True if and only if there is a valid subsequence of brackets \n // where at least one bracket in the subsequence is nested.\n // is_nested('[[]]') \u279e True\n // is_nested('[]]]]]]][[[[[]') \u279e False\n // is_nested('[][]') \u279e False\n // is_nested('[]') \u279e False\n // is_nested('[[][]]') \u279e True\n // is_nested('[[]][[') \u279e True\n public static bool IsNested(string str) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsNested((\"[[]]\")) == (true));\n Debug.Assert(IsNested((\"[]]]]]]][[[[[]\")) == (false));\n Debug.Assert(IsNested((\"[][]\")) == (false));\n Debug.Assert(IsNested((\"[]\")) == (false));\n Debug.Assert(IsNested((\"[[[[]]]]\")) == (true));\n Debug.Assert(IsNested((\"[]]]]]]]]]]\")) == (false));\n Debug.Assert(IsNested((\"[][][[]]\")) == (true));\n Debug.Assert(IsNested((\"[[]\")) == (false));\n Debug.Assert(IsNested((\"[]]\")) == (false));\n Debug.Assert(IsNested((\"[[]][[\")) == (true));\n Debug.Assert(IsNested((\"[[][]]\")) == (true));\n Debug.Assert(IsNested((\"\")) == (false));\n Debug.Assert(IsNested((\"[[[[[[[[\")) == (false));\n Debug.Assert(IsNested((\"]]]]]]]]\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Concatenate list of strings into a single string\n // >>> concatenate([])\n // ''\n // >>> concatenate(['a', 'b', 'c'])\n // 'abc'\n public static string Concatenate(List strings) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Concatenate((new List())).Equals((\"\")));\n Debug.Assert(Concatenate((new List(new string[]{(string)\"x\", (string)\"y\", (string)\"z\"}))).Equals((\"xyz\")));\n Debug.Assert(Concatenate((new List(new string[]{(string)\"x\", (string)\"y\", (string)\"z\", (string)\"w\", (string)\"k\"}))).Equals((\"xyzwk\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n // >>> prime_fib(1)\n // 2\n // >>> prime_fib(2)\n // 3\n // >>> prime_fib(3)\n // 5\n // >>> prime_fib(4)\n // 13\n // >>> prime_fib(5)\n // 89\n public static long PrimeFib(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(PrimeFib((1L)) == (2L));\n Debug.Assert(PrimeFib((2L)) == (3L));\n Debug.Assert(PrimeFib((3L)) == (5L));\n Debug.Assert(PrimeFib((4L)) == (13L));\n Debug.Assert(PrimeFib((5L)) == (89L));\n Debug.Assert(PrimeFib((6L)) == (233L));\n Debug.Assert(PrimeFib((7L)) == (1597L));\n Debug.Assert(PrimeFib((8L)) == (28657L));\n Debug.Assert(PrimeFib((9L)) == (514229L));\n Debug.Assert(PrimeFib((10L)) == (433494437L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n // other and return them in order (smaller number, larger number).\n // >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n // (2.0, 2.2)\n // >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n // (2.0, 2.0)\n public static Tuple FindClosestElements(List numbers) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FindClosestElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.9f, (float)4.0f, (float)5.0f, (float)2.2f}))).Equals((Tuple.Create(3.9f, 4.0f))));\n Debug.Assert(FindClosestElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)5.9f, (float)4.0f, (float)5.0f}))).Equals((Tuple.Create(5.0f, 5.9f))));\n Debug.Assert(FindClosestElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.2f}))).Equals((Tuple.Create(2.0f, 2.2f))));\n Debug.Assert(FindClosestElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.0f}))).Equals((Tuple.Create(2.0f, 2.0f))));\n Debug.Assert(FindClosestElements((new List(new float[]{(float)1.1f, (float)2.2f, (float)3.1f, (float)4.1f, (float)5.1f}))).Equals((Tuple.Create(2.2f, 3.1f))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You have been tasked to write a function that receives \n // a hexadecimal number as a string and counts the number of hexadecimal \n // digits that are primes (prime number, or a prime, is a natural number \n // greater than 1 that is not a product of two smaller natural numbers).\n // Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n // Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n // So you have to determine a number of the following digits: 2, 3, 5, 7, \n // B (=decimal 11), D (=decimal 13).\n // Note: you may assume the input is always correct or empty string, \n // and symbols A,B,C,D,E,F are always uppercase.\n // Examples:\n // For num = \"AB\" the output should be 1.\n // For num = \"1077E\" the output should be 2.\n // For num = \"ABED1A33\" the output should be 4.\n // For num = \"123456789ABCDEF0\" the output should be 6.\n // For num = \"2020\" the output should be 2.\n public static long HexKey(string num) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(HexKey((\"AB\")) == (1L));\n Debug.Assert(HexKey((\"1077E\")) == (2L));\n Debug.Assert(HexKey((\"ABED1A33\")) == (4L));\n Debug.Assert(HexKey((\"2020\")) == (2L));\n Debug.Assert(HexKey((\"123456789ABCDEF0\")) == (6L));\n Debug.Assert(HexKey((\"112233445566778899AABBCCDDEEFF00\")) == (12L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Complete the function that takes two integers and returns \n // the product of their unit digits.\n // Assume the input is always valid.\n // Examples:\n // multiply(148, 412) should return 16.\n // multiply(19, 28) should return 72.\n // multiply(2020, 1851) should return 0.\n // multiply(14,-15) should return 20.\n public static long Multiply(long a, long b) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Multiply((148L), (412L)) == (16L));\n Debug.Assert(Multiply((19L), (28L)) == (72L));\n Debug.Assert(Multiply((2020L), (1851L)) == (0L));\n Debug.Assert(Multiply((14L), (-15L)) == (20L));\n Debug.Assert(Multiply((76L), (67L)) == (42L));\n Debug.Assert(Multiply((17L), (27L)) == (49L));\n Debug.Assert(Multiply((0L), (1L)) == (0L));\n Debug.Assert(Multiply((0L), (0L)) == (0L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given list of numbers (of at least two elements), apply a linear transform to that list,\n // such that the smallest number will become 0 and the largest will become 1\n // >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n // [0.0, 0.25, 0.5, 0.75, 1.0]\n public static List RescaleToUnit(List numbers) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(RescaleToUnit((new List(new float[]{(float)2.0f, (float)49.9f}))).Equals((new List(new float[]{(float)0.0f, (float)1.0f}))));\n Debug.Assert(RescaleToUnit((new List(new float[]{(float)100.0f, (float)49.9f}))).Equals((new List(new float[]{(float)1.0f, (float)0.0f}))));\n Debug.Assert(RescaleToUnit((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f}))).Equals((new List(new float[]{(float)0.0f, (float)0.25f, (float)0.5f, (float)0.75f, (float)1.0f}))));\n Debug.Assert(RescaleToUnit((new List(new float[]{(float)2.0f, (float)1.0f, (float)5.0f, (float)3.0f, (float)4.0f}))).Equals((new List(new float[]{(float)0.25f, (float)0.0f, (float)1.0f, (float)0.5f, (float)0.75f}))));\n Debug.Assert(RescaleToUnit((new List(new float[]{(float)12.0f, (float)11.0f, (float)15.0f, (float)13.0f, (float)14.0f}))).Equals((new List(new float[]{(float)0.25f, (float)0.0f, (float)1.0f, (float)0.5f, (float)0.75f}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a positive integer n, return the product of the odd digits.\n // Return 0 if all digits are even.\n // For example:\n // digits(1) == 1\n // digits(4) == 0\n // digits(235) == 15\n public static long Digits(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Digits((5L)) == (5L));\n Debug.Assert(Digits((54L)) == (5L));\n Debug.Assert(Digits((120L)) == (1L));\n Debug.Assert(Digits((5014L)) == (5L));\n Debug.Assert(Digits((98765L)) == (315L));\n Debug.Assert(Digits((5576543L)) == (2625L));\n Debug.Assert(Digits((2468L)) == (0L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You will be given the name of a class (a string) and a list of extensions.\n // The extensions are to be used to load additional classes to the class. The\n // strength of the extension is as follows: Let CAP be the number of the uppercase\n // letters in the extension's name, and let SM be the number of lowercase letters \n // in the extension's name, the strength is given by the fraction CAP - SM. \n // You should find the strongest extension and return a string in this \n // format: ClassName.StrongestExtensionName.\n // If there are two or more extensions with the same strength, you should\n // choose the one that comes first in the list.\n // For example, if you are given \"Slices\" as the class and a list of the\n // extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n // return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n // (its strength is -1).\n // Example:\n // for Strongest_Extension('my_class', ['AA', 'Be', 'CC']) == 'my_class.AA'\n public static string StrongestExtension(string class_name, List extensions) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(StrongestExtension((\"Watashi\"), (new List(new string[]{(string)\"tEN\", (string)\"niNE\", (string)\"eIGHt8OKe\"}))).Equals((\"Watashi.eIGHt8OKe\")));\n Debug.Assert(StrongestExtension((\"Boku123\"), (new List(new string[]{(string)\"nani\", (string)\"NazeDa\", (string)\"YEs.WeCaNe\", (string)\"32145tggg\"}))).Equals((\"Boku123.YEs.WeCaNe\")));\n Debug.Assert(StrongestExtension((\"__YESIMHERE\"), (new List(new string[]{(string)\"t\", (string)\"eMptY\", (string)\"nothing\", (string)\"zeR00\", (string)\"NuLl__\", (string)\"123NoooneB321\"}))).Equals((\"__YESIMHERE.NuLl__\")));\n Debug.Assert(StrongestExtension((\"K\"), (new List(new string[]{(string)\"Ta\", (string)\"TAR\", (string)\"t234An\", (string)\"cosSo\"}))).Equals((\"K.TAR\")));\n Debug.Assert(StrongestExtension((\"__HAHA\"), (new List(new string[]{(string)\"Tab\", (string)\"123\", (string)\"781345\", (string)\"-_-\"}))).Equals((\"__HAHA.123\")));\n Debug.Assert(StrongestExtension((\"YameRore\"), (new List(new string[]{(string)\"HhAas\", (string)\"okIWILL123\", (string)\"WorkOut\", (string)\"Fails\", (string)\"-_-\"}))).Equals((\"YameRore.okIWILL123\")));\n Debug.Assert(StrongestExtension((\"finNNalLLly\"), (new List(new string[]{(string)\"Die\", (string)\"NowW\", (string)\"Wow\", (string)\"WoW\"}))).Equals((\"finNNalLLly.WoW\")));\n Debug.Assert(StrongestExtension((\"_\"), (new List(new string[]{(string)\"Bb\", (string)\"91245\"}))).Equals((\"_.Bb\")));\n Debug.Assert(StrongestExtension((\"Sp\"), (new List(new string[]{(string)\"671235\", (string)\"Bb\"}))).Equals((\"Sp.671235\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a string representing a space separated lowercase letters, return a dictionary\n // of the letter with the most repetition and containing the corresponding count.\n // If several letters have the same occurrence, return all of them.\n // Example:\n // histogram('a b c') == {'a': 1, 'b': 1, 'c': 1}\n // histogram('a b b a') == {'a': 2, 'b': 2}\n // histogram('a b c a b') == {'a': 2, 'b': 2}\n // histogram('b b b b a') == {'b': 4}\n // histogram('') == {}\n public static Dictionary Histogram(string test) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Histogram((\"a b b a\")).Equals((new Dictionary(){{\"a\", 2L}, {\"b\", 2L}})));\n Debug.Assert(Histogram((\"a b c a b\")).Equals((new Dictionary(){{\"a\", 2L}, {\"b\", 2L}})));\n Debug.Assert(Histogram((\"a b c d g\")).Equals((new Dictionary(){{\"a\", 1L}, {\"b\", 1L}, {\"c\", 1L}, {\"d\", 1L}, {\"g\", 1L}})));\n Debug.Assert(Histogram((\"r t g\")).Equals((new Dictionary(){{\"r\", 1L}, {\"t\", 1L}, {\"g\", 1L}})));\n Debug.Assert(Histogram((\"b b b b a\")).Equals((new Dictionary(){{\"b\", 4L}})));\n Debug.Assert(Histogram((\"r t g\")).Equals((new Dictionary(){{\"r\", 1L}, {\"t\", 1L}, {\"g\", 1L}})));\n Debug.Assert(Histogram((\"\")).Equals((new Dictionary())));\n Debug.Assert(Histogram((\"a\")).Equals((new Dictionary(){{\"a\", 1L}})));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // pairs_sum_to_zero takes a list of integers as an input.\n // it returns True if there are two distinct elements in the list that\n // sum to zero, and False otherwise.\n // >>> pairs_sum_to_zero([1, 3, 5, 0])\n // False\n // >>> pairs_sum_to_zero([1, 3, -2, 1])\n // False\n // >>> pairs_sum_to_zero([1, 2, 3, 7])\n // False\n // >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7])\n // True\n // >>> pairs_sum_to_zero([1])\n // False\n public static bool PairsSumToZero(List l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)1L, (long)3L, (long)5L, (long)0L}))) == (false));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)1L, (long)3L, (long)-2L, (long)1L}))) == (false));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)7L}))) == (false));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)2L, (long)4L, (long)-5L, (long)3L, (long)5L, (long)7L}))) == (true));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)1L}))) == (false));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)-3L, (long)9L, (long)-1L, (long)3L, (long)2L, (long)30L}))) == (true));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)-3L, (long)9L, (long)-1L, (long)3L, (long)2L, (long)31L}))) == (true));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)-3L, (long)9L, (long)-1L, (long)4L, (long)2L, (long)30L}))) == (false));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)-3L, (long)9L, (long)-1L, (long)4L, (long)2L, (long)31L}))) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that accepts two lists of strings and returns the list that has \n // total number of chars in the all strings of the list less than the other list.\n // if the two lists have the same number of chars, return the first list.\n // Examples\n // total_match([], []) \u279e []\n // total_match(['hi', 'admin'], ['hI', 'Hi']) \u279e ['hI', 'Hi']\n // total_match(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) \u279e ['hi', 'admin']\n // total_match(['hi', 'admin'], ['hI', 'hi', 'hi']) \u279e ['hI', 'hi', 'hi']\n // total_match(['4'], ['1', '2', '3', '4', '5']) \u279e ['4']\n public static List TotalMatch(List lst1, List lst2) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(TotalMatch((new List()), (new List())).Equals((new List())));\n Debug.Assert(TotalMatch((new List(new string[]{(string)\"hi\", (string)\"admin\"})), (new List(new string[]{(string)\"hi\", (string)\"hi\"}))).Equals((new List(new string[]{(string)\"hi\", (string)\"hi\"}))));\n Debug.Assert(TotalMatch((new List(new string[]{(string)\"hi\", (string)\"admin\"})), (new List(new string[]{(string)\"hi\", (string)\"hi\", (string)\"admin\", (string)\"project\"}))).Equals((new List(new string[]{(string)\"hi\", (string)\"admin\"}))));\n Debug.Assert(TotalMatch((new List(new string[]{(string)\"4\"})), (new List(new string[]{(string)\"1\", (string)\"2\", (string)\"3\", (string)\"4\", (string)\"5\"}))).Equals((new List(new string[]{(string)\"4\"}))));\n Debug.Assert(TotalMatch((new List(new string[]{(string)\"hi\", (string)\"admin\"})), (new List(new string[]{(string)\"hI\", (string)\"Hi\"}))).Equals((new List(new string[]{(string)\"hI\", (string)\"Hi\"}))));\n Debug.Assert(TotalMatch((new List(new string[]{(string)\"hi\", (string)\"admin\"})), (new List(new string[]{(string)\"hI\", (string)\"hi\", (string)\"hi\"}))).Equals((new List(new string[]{(string)\"hI\", (string)\"hi\", (string)\"hi\"}))));\n Debug.Assert(TotalMatch((new List(new string[]{(string)\"hi\", (string)\"admin\"})), (new List(new string[]{(string)\"hI\", (string)\"hi\", (string)\"hii\"}))).Equals((new List(new string[]{(string)\"hi\", (string)\"admin\"}))));\n Debug.Assert(TotalMatch((new List()), (new List(new string[]{(string)\"this\"}))).Equals((new List())));\n Debug.Assert(TotalMatch((new List(new string[]{(string)\"this\"})), (new List())).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Circular shift the digits of the integer x, shift the digits right by shift\n // and return the result as a string.\n // If shift > number of digits, return digits reversed.\n // >>> circular_shift(12, 1)\n // \"21\"\n // >>> circular_shift(12, 2)\n // \"12\"\n public static string CircularShift(long x, long shift) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CircularShift((100L), (2L)).Equals((\"001\")));\n Debug.Assert(CircularShift((12L), (2L)).Equals((\"12\")));\n Debug.Assert(CircularShift((97L), (8L)).Equals((\"79\")));\n Debug.Assert(CircularShift((12L), (1L)).Equals((\"21\")));\n Debug.Assert(CircularShift((11L), (101L)).Equals((\"11\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return True is list elements are monotonically increasing or decreasing.\n // >>> monotonic([1, 2, 4, 20])\n // True\n // >>> monotonic([1, 20, 4, 10])\n // False\n // >>> monotonic([4, 1, 0, -10])\n // True\n public static bool Monotonic(List l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Monotonic((new List(new long[]{(long)1L, (long)2L, (long)4L, (long)10L}))) == (true));\n Debug.Assert(Monotonic((new List(new long[]{(long)1L, (long)2L, (long)4L, (long)20L}))) == (true));\n Debug.Assert(Monotonic((new List(new long[]{(long)1L, (long)20L, (long)4L, (long)10L}))) == (false));\n Debug.Assert(Monotonic((new List(new long[]{(long)4L, (long)1L, (long)0L, (long)-10L}))) == (true));\n Debug.Assert(Monotonic((new List(new long[]{(long)4L, (long)1L, (long)1L, (long)0L}))) == (true));\n Debug.Assert(Monotonic((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)2L, (long)5L, (long)60L}))) == (false));\n Debug.Assert(Monotonic((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)60L}))) == (true));\n Debug.Assert(Monotonic((new List(new long[]{(long)9L, (long)9L, (long)9L, (long)9L}))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n // Example\n // is_equal_to_sum_even(4) == False\n // is_equal_to_sum_even(6) == False\n // is_equal_to_sum_even(8) == True\n public static bool IsEqualToSumEven(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsEqualToSumEven((4L)) == (false));\n Debug.Assert(IsEqualToSumEven((6L)) == (false));\n Debug.Assert(IsEqualToSumEven((8L)) == (true));\n Debug.Assert(IsEqualToSumEven((10L)) == (true));\n Debug.Assert(IsEqualToSumEven((11L)) == (false));\n Debug.Assert(IsEqualToSumEven((12L)) == (true));\n Debug.Assert(IsEqualToSumEven((13L)) == (false));\n Debug.Assert(IsEqualToSumEven((16L)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Input to this function is a string representing musical notes in a special ASCII format.\n // Your task is to parse this string and return list of integers corresponding to how many beats does each\n // not last.\n // Here is a legend:\n // 'o' - whole note, lasts four beats\n // 'o|' - half note, lasts two beats\n // '.|' - quater note, lasts one beat\n // >>> parse_music('o o| .| o| o| .| .| .| .| o o')\n // [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\n public static List ParseMusic(string music_string) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ParseMusic((\"\")).Equals((new List())));\n Debug.Assert(ParseMusic((\"o o o o\")).Equals((new List(new long[]{(long)4L, (long)4L, (long)4L, (long)4L}))));\n Debug.Assert(ParseMusic((\".| .| .| .|\")).Equals((new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L}))));\n Debug.Assert(ParseMusic((\"o| o| .| .| o o o o\")).Equals((new List(new long[]{(long)2L, (long)2L, (long)1L, (long)1L, (long)4L, (long)4L, (long)4L, (long)4L}))));\n Debug.Assert(ParseMusic((\"o| .| o| .| o o| o o|\")).Equals((new List(new long[]{(long)2L, (long)1L, (long)2L, (long)1L, (long)4L, (long)2L, (long)4L, (long)2L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // \"\n // This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n // multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n // change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n // Examples:\n // For lst = [1,2,3] the output should be 6\n // For lst = [] the output should be 0\n // For lst = [-1,-5,2,-1,-5] the output should be -126\n public static long SumSquares(List lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SumSquares((new List(new long[]{(long)1L, (long)2L, (long)3L}))) == (6L));\n Debug.Assert(SumSquares((new List(new long[]{(long)1L, (long)4L, (long)9L}))) == (14L));\n Debug.Assert(SumSquares((new List())) == (0L));\n Debug.Assert(SumSquares((new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L, (long)1L, (long)1L, (long)1L, (long)1L, (long)1L}))) == (9L));\n Debug.Assert(SumSquares((new List(new long[]{(long)-1L, (long)-1L, (long)-1L, (long)-1L, (long)-1L, (long)-1L, (long)-1L, (long)-1L, (long)-1L}))) == (-3L));\n Debug.Assert(SumSquares((new List(new long[]{(long)0L}))) == (0L));\n Debug.Assert(SumSquares((new List(new long[]{(long)-1L, (long)-5L, (long)2L, (long)-1L, (long)-5L}))) == (-126L));\n Debug.Assert(SumSquares((new List(new long[]{(long)-56L, (long)-99L, (long)1L, (long)0L, (long)-2L}))) == (3030L));\n Debug.Assert(SumSquares((new List(new long[]{(long)-1L, (long)0L, (long)0L, (long)0L, (long)0L, (long)0L, (long)0L, (long)0L, (long)-1L}))) == (0L));\n Debug.Assert(SumSquares((new List(new long[]{(long)-16L, (long)-9L, (long)-2L, (long)36L, (long)36L, (long)26L, (long)-20L, (long)25L, (long)-40L, (long)20L, (long)-4L, (long)12L, (long)-26L, (long)35L, (long)37L}))) == (-14196L));\n Debug.Assert(SumSquares((new List(new long[]{(long)-1L, (long)-3L, (long)17L, (long)-1L, (long)-15L, (long)13L, (long)-1L, (long)14L, (long)-14L, (long)-12L, (long)-5L, (long)14L, (long)-14L, (long)6L, (long)13L, (long)11L, (long)16L, (long)16L, (long)4L, (long)10L}))) == (-1448L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // triples_sum_to_zero takes a list of integers as an input.\n // it returns True if there are three distinct elements in the list that\n // sum to zero, and False otherwise.\n // >>> triples_sum_to_zero([1, 3, 5, 0])\n // False\n // >>> triples_sum_to_zero([1, 3, -2, 1])\n // True\n // >>> triples_sum_to_zero([1, 2, 3, 7])\n // False\n // >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n // True\n // >>> triples_sum_to_zero([1])\n // False\n public static bool TriplesSumToZero(List l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)1L, (long)3L, (long)5L, (long)0L}))) == (false));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)1L, (long)3L, (long)5L, (long)-1L}))) == (false));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)1L, (long)3L, (long)-2L, (long)1L}))) == (true));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)7L}))) == (false));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)1L, (long)2L, (long)5L, (long)7L}))) == (false));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)2L, (long)4L, (long)-5L, (long)3L, (long)9L, (long)7L}))) == (true));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)1L}))) == (false));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)1L, (long)3L, (long)5L, (long)-100L}))) == (false));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)100L, (long)3L, (long)5L, (long)-100L}))) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // brackets is a string of \"<\" and \">\".\n // return True if every opening bracket has a corresponding closing bracket.\n // >>> correct_bracketing(\"<\")\n // False\n // >>> correct_bracketing(\"<>\")\n // True\n // >>> correct_bracketing(\"<<><>>\")\n // True\n // >>> correct_bracketing(\"><<>\")\n // False\n public static bool CorrectBracketing(string brackets) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CorrectBracketing((\"<>\")) == (true));\n Debug.Assert(CorrectBracketing((\"<<><>>\")) == (true));\n Debug.Assert(CorrectBracketing((\"<><><<><>><>\")) == (true));\n Debug.Assert(CorrectBracketing((\"<><><<<><><>><>><<><><<>>>\")) == (true));\n Debug.Assert(CorrectBracketing((\"<<<><>>>>\")) == (false));\n Debug.Assert(CorrectBracketing((\"><<>\")) == (false));\n Debug.Assert(CorrectBracketing((\"<\")) == (false));\n Debug.Assert(CorrectBracketing((\"<<<<\")) == (false));\n Debug.Assert(CorrectBracketing((\">\")) == (false));\n Debug.Assert(CorrectBracketing((\"<<>\")) == (false));\n Debug.Assert(CorrectBracketing((\"<><><<><>><>><<>\")) == (false));\n Debug.Assert(CorrectBracketing((\"<><><<><>><>>><>\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that takes an array of numbers as input and returns \n // the number of elements in the array that are greater than 10 and both \n // first and last digits of a number are odd (1, 3, 5, 7, 9).\n // For example:\n // specialFilter([15, -73, 14, -15]) => 1 \n // specialFilter([33, -2, -3, 45, 21, 109]) => 2\n public static long Specialfilter(List nums) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Specialfilter((new List(new long[]{(long)5L, (long)-2L, (long)1L, (long)-5L}))) == (0L));\n Debug.Assert(Specialfilter((new List(new long[]{(long)15L, (long)-73L, (long)14L, (long)-15L}))) == (1L));\n Debug.Assert(Specialfilter((new List(new long[]{(long)33L, (long)-2L, (long)-3L, (long)45L, (long)21L, (long)109L}))) == (2L));\n Debug.Assert(Specialfilter((new List(new long[]{(long)43L, (long)-12L, (long)93L, (long)125L, (long)121L, (long)109L}))) == (4L));\n Debug.Assert(Specialfilter((new List(new long[]{(long)71L, (long)-2L, (long)-33L, (long)75L, (long)21L, (long)19L}))) == (3L));\n Debug.Assert(Specialfilter((new List(new long[]{(long)1L}))) == (0L));\n Debug.Assert(Specialfilter((new List())) == (0L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a dictionary, return True if all keys are strings in lower \n // case or all keys are strings in upper case, else return False.\n // The function should return False is the given dictionary is empty.\n // Examples:\n // check_dict_case({\"a\":\"apple\", \"b\":\"banana\"}) should return True.\n // check_dict_case({\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}) should return False.\n // check_dict_case({\"a\":\"apple\", \"8\":\"banana\", \"a\":\"apple\"}) should return False.\n // check_dict_case({\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}) should return False.\n // check_dict_case({\"STATE\":\"NC\", \"ZIP\":\"12345\" }) should return True.\n public static bool CheckDictCase(Dictionary dict) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CheckDictCase((new Dictionary(){{\"p\", \"pineapple\"}, {\"b\", \"banana\"}})) == (true));\n Debug.Assert(CheckDictCase((new Dictionary(){{\"p\", \"pineapple\"}, {\"A\", \"banana\"}, {\"B\", \"banana\"}})) == (false));\n Debug.Assert(CheckDictCase((new Dictionary(){{\"p\", \"pineapple\"}, {\"5\", \"banana\"}, {\"a\", \"apple\"}})) == (false));\n Debug.Assert(CheckDictCase((new Dictionary(){{\"Name\", \"John\"}, {\"Age\", \"36\"}, {\"City\", \"Houston\"}})) == (false));\n Debug.Assert(CheckDictCase((new Dictionary(){{\"STATE\", \"NC\"}, {\"ZIP\", \"12345\"}})) == (true));\n Debug.Assert(CheckDictCase((new Dictionary(){{\"fruit\", \"Orange\"}, {\"taste\", \"Sweet\"}})) == (true));\n Debug.Assert(CheckDictCase((new Dictionary())) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n // fibfib(0) == 0\n // fibfib(1) == 0\n // fibfib(2) == 1\n // fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n // Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n // >>> fibfib(1)\n // 0\n // >>> fibfib(5)\n // 4\n // >>> fibfib(8)\n // 24\n public static long Fibfib(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Fibfib((2L)) == (1L));\n Debug.Assert(Fibfib((1L)) == (0L));\n Debug.Assert(Fibfib((5L)) == (4L));\n Debug.Assert(Fibfib((8L)) == (24L));\n Debug.Assert(Fibfib((10L)) == (81L));\n Debug.Assert(Fibfib((12L)) == (274L));\n Debug.Assert(Fibfib((14L)) == (927L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a list of numbers.\n // You need to return the sum of squared numbers in the given list,\n // round each element in the list to the upper int(Ceiling) first.\n // Examples:\n // For lst = [1,2,3] the output should be 14\n // For lst = [1,4,9] the output should be 98\n // For lst = [1,3,5,7] the output should be 84\n // For lst = [1.4,4.2,0] the output should be 29\n // For lst = [-2.4,1,1] the output should be 6\n public static long SumSquares(List lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SumSquares((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f}))) == (14L));\n Debug.Assert(SumSquares((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f}))) == (14L));\n Debug.Assert(SumSquares((new List(new float[]{(float)1.0f, (float)3.0f, (float)5.0f, (float)7.0f}))) == (84L));\n Debug.Assert(SumSquares((new List(new float[]{(float)1.4f, (float)4.2f, (float)0.0f}))) == (29L));\n Debug.Assert(SumSquares((new List(new float[]{(float)-2.4f, (float)1.0f, (float)1.0f}))) == (6L));\n Debug.Assert(SumSquares((new List(new float[]{(float)100.0f, (float)1.0f, (float)15.0f, (float)2.0f}))) == (10230L));\n Debug.Assert(SumSquares((new List(new float[]{(float)10000.0f, (float)10000.0f}))) == (200000000L));\n Debug.Assert(SumSquares((new List(new float[]{(float)-1.4f, (float)4.6f, (float)6.3f}))) == (75L));\n Debug.Assert(SumSquares((new List(new float[]{(float)-1.4f, (float)17.9f, (float)18.9f, (float)19.9f}))) == (1086L));\n Debug.Assert(SumSquares((new List(new float[]{(float)0.0f}))) == (0L));\n Debug.Assert(SumSquares((new List(new float[]{(float)-1.0f}))) == (1L));\n Debug.Assert(SumSquares((new List(new float[]{(float)-1.0f, (float)1.0f, (float)0.0f}))) == (2L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_85_add", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a non-empty list of integers lst. add the even elements that are at odd indices..\n // Examples:\n // add([4, 2, 6, 7]) ==> 2\n public static long Add(List lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Add((new List(new long[]{(long)4L, (long)88L}))) == (88L));\n Debug.Assert(Add((new List(new long[]{(long)4L, (long)5L, (long)6L, (long)7L, (long)2L, (long)122L}))) == (122L));\n Debug.Assert(Add((new List(new long[]{(long)4L, (long)0L, (long)6L, (long)7L}))) == (0L));\n Debug.Assert(Add((new List(new long[]{(long)4L, (long)4L, (long)6L, (long)8L}))) == (12L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return sorted unique elements in a list\n // >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123])\n // [0, 2, 3, 5, 9, 123]\n public static List Unique(List l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Unique((new List(new long[]{(long)5L, (long)3L, (long)5L, (long)2L, (long)3L, (long)3L, (long)9L, (long)0L, (long)123L}))).Equals((new List(new long[]{(long)0L, (long)2L, (long)3L, (long)5L, (long)9L, (long)123L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a string text, replace all spaces in it with underscores, \n // and if a string has more than 2 consecutive spaces, \n // then replace all consecutive spaces with - \n // fix_spaces(\"Example\") == \"Example\"\n // fix_spaces(\"Example 1\") == \"Example_1\"\n // fix_spaces(\" Example 2\") == \"_Example_2\"\n // fix_spaces(\" Example 3\") == \"_Example-3\"\n public static string FixSpaces(string text) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FixSpaces((\"Example\")).Equals((\"Example\")));\n Debug.Assert(FixSpaces((\"Mudasir Hanif \")).Equals((\"Mudasir_Hanif_\")));\n Debug.Assert(FixSpaces((\"Yellow Yellow Dirty Fellow\")).Equals((\"Yellow_Yellow__Dirty__Fellow\")));\n Debug.Assert(FixSpaces((\"Exa mple\")).Equals((\"Exa-mple\")));\n Debug.Assert(FixSpaces((\" Exa 1 2 2 mple\")).Equals((\"-Exa_1_2_2_mple\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return 2^n modulo p (be aware of numerics).\n // >>> modp(3, 5)\n // 3\n // >>> modp(1101, 101)\n // 2\n // >>> modp(0, 101)\n // 1\n // >>> modp(3, 11)\n // 8\n // >>> modp(100, 101)\n // 1\n public static long Modp(long n, long p) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Modp((3L), (5L)) == (3L));\n Debug.Assert(Modp((1101L), (101L)) == (2L));\n Debug.Assert(Modp((0L), (101L)) == (1L));\n Debug.Assert(Modp((3L), (11L)) == (8L));\n Debug.Assert(Modp((100L), (101L)) == (1L));\n Debug.Assert(Modp((30L), (5L)) == (4L));\n Debug.Assert(Modp((31L), (5L)) == (3L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You have to write a function which validates a given date string and\n // returns True if the date is valid otherwise False.\n // The date is valid if all of the following rules are satisfied:\n // 1. The date string is not empty.\n // 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n // 3. The months should not be less than 1 or higher than 12.\n // 4. The date should be in the format: mm-dd-yyyy\n // for example: \n // valid_date('03-11-2000') => True\n // valid_date('15-01-2012') => False\n // valid_date('04-0-2040') => False\n // valid_date('06-04-2020') => True\n // valid_date('06/04/2020') => False\n public static bool ValidDate(string date) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ValidDate((\"03-11-2000\")) == (true));\n Debug.Assert(ValidDate((\"15-01-2012\")) == (false));\n Debug.Assert(ValidDate((\"04-0-2040\")) == (false));\n Debug.Assert(ValidDate((\"06-04-2020\")) == (true));\n Debug.Assert(ValidDate((\"01-01-2007\")) == (true));\n Debug.Assert(ValidDate((\"03-32-2011\")) == (false));\n Debug.Assert(ValidDate((\"\")) == (false));\n Debug.Assert(ValidDate((\"04-31-3000\")) == (false));\n Debug.Assert(ValidDate((\"06-06-2005\")) == (true));\n Debug.Assert(ValidDate((\"21-31-2000\")) == (false));\n Debug.Assert(ValidDate((\"04-12-2003\")) == (true));\n Debug.Assert(ValidDate((\"04122003\")) == (false));\n Debug.Assert(ValidDate((\"20030412\")) == (false));\n Debug.Assert(ValidDate((\"2003-04\")) == (false));\n Debug.Assert(ValidDate((\"2003-04-12\")) == (false));\n Debug.Assert(ValidDate((\"04-2003\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that takes a string and returns an ordered version of it.\n // Ordered version of string, is a string where all words (separated by space)\n // are replaced by a new word where all the characters arranged in\n // ascending order based on ascii value.\n // Note: You should keep the order of words and blank spaces in the sentence.\n // For example:\n // anti_shuffle('Hi') returns 'Hi'\n // anti_shuffle('hello') returns 'ehllo'\n // anti_shuffle('Hello World!!!') returns 'Hello !!!Wdlor'\n public static string AntiShuffle(string s) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(AntiShuffle((\"Hi\")).Equals((\"Hi\")));\n Debug.Assert(AntiShuffle((\"hello\")).Equals((\"ehllo\")));\n Debug.Assert(AntiShuffle((\"number\")).Equals((\"bemnru\")));\n Debug.Assert(AntiShuffle((\"abcd\")).Equals((\"abcd\")));\n Debug.Assert(AntiShuffle((\"Hello World!!!\")).Equals((\"Hello !!!Wdlor\")));\n Debug.Assert(AntiShuffle((\"\")).Equals((\"\")));\n Debug.Assert(AntiShuffle((\"Hi. My name is Mister Robot. How are you?\")).Equals((\".Hi My aemn is Meirst .Rboot How aer ?ouy\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a list of numbers, return whether or not they are sorted\n // in ascending order. If list has more than 1 duplicate of the same\n // number, return False. Assume no negative numbers and only integers.\n // Examples\n // is_sorted([5]) \u279e True\n // is_sorted([1, 2, 3, 4, 5]) \u279e True\n // is_sorted([1, 3, 2, 4, 5]) \u279e False\n // is_sorted([1, 2, 3, 4, 5, 6]) \u279e True\n // is_sorted([1, 2, 3, 4, 5, 6, 7]) \u279e True\n // is_sorted([1, 3, 2, 4, 5, 6, 7]) \u279e False\n // is_sorted([1, 2, 2, 3, 3, 4]) \u279e True\n // is_sorted([1, 2, 2, 2, 3, 4]) \u279e False\n public static bool IsSorted(List lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsSorted((new List(new long[]{(long)5L}))) == (true));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L}))) == (true));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)4L, (long)5L}))) == (false));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}))) == (true));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L, (long)7L}))) == (true));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)4L, (long)5L, (long)6L, (long)7L}))) == (false));\n Debug.Assert(IsSorted((new List())) == (true));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L}))) == (true));\n Debug.Assert(IsSorted((new List(new long[]{(long)3L, (long)2L, (long)1L}))) == (false));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)2L, (long)2L, (long)2L, (long)3L, (long)4L}))) == (false));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)3L, (long)3L, (long)4L}))) == (false));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)2L, (long)2L, (long)3L, (long)3L, (long)4L}))) == (true));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a string s.\n // Your task is to check if the string is happy or not.\n // A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n // For example:\n // is_happy(a) => False\n // is_happy(aa) => False\n // is_happy(abcd) => True\n // is_happy(aabb) => False\n // is_happy(adb) => True\n // is_happy(xyy) => False\n public static bool IsHappy(string s) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsHappy((\"a\")) == (false));\n Debug.Assert(IsHappy((\"aa\")) == (false));\n Debug.Assert(IsHappy((\"abcd\")) == (true));\n Debug.Assert(IsHappy((\"aabb\")) == (false));\n Debug.Assert(IsHappy((\"adb\")) == (true));\n Debug.Assert(IsHappy((\"xyy\")) == (false));\n Debug.Assert(IsHappy((\"iopaxpoi\")) == (true));\n Debug.Assert(IsHappy((\"iopaxioi\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that returns True if the object q will fly, and False otherwise.\n // The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n // Example:\n // will_it_fly([1, 2], 5) \u279e False \n // # 1+2 is less than the maximum possible weight, but it's unbalanced.\n // will_it_fly([3, 2, 3], 1) \u279e False\n // # it's balanced, but 3+2+3 is more than the maximum possible weight.\n // will_it_fly([3, 2, 3], 9) \u279e True\n // # 3+2+3 is less than the maximum possible weight, and it's balanced.\n // will_it_fly([3], 5) \u279e True\n // # 3 is less than the maximum possible weight, and it's balanced.\n public static bool WillItFly(List q, long w) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(WillItFly((new List(new long[]{(long)3L, (long)2L, (long)3L})), (9L)) == (true));\n Debug.Assert(WillItFly((new List(new long[]{(long)1L, (long)2L})), (5L)) == (false));\n Debug.Assert(WillItFly((new List(new long[]{(long)3L})), (5L)) == (true));\n Debug.Assert(WillItFly((new List(new long[]{(long)3L, (long)2L, (long)3L})), (1L)) == (false));\n Debug.Assert(WillItFly((new List(new long[]{(long)1L, (long)2L, (long)3L})), (6L)) == (false));\n Debug.Assert(WillItFly((new List(new long[]{(long)5L})), (5L)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given an array of non-negative integers, return a copy of the given array after sorting,\n // you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n // or sort it in descending order if the sum( first index value, last index value) is even.\n // Note:\n // * don't change the given array.\n // Examples:\n // * sort_array([]) => []\n // * sort_array([5]) => [5]\n // * sort_array([2, 4, 3, 0, 1, 5]) => [0, 1, 2, 3, 4, 5]\n // * sort_array([2, 4, 3, 0, 1, 5, 6]) => [6, 5, 4, 3, 2, 1, 0]\n public static List SortArray(List array) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SortArray((new List())).Equals((new List())));\n Debug.Assert(SortArray((new List(new long[]{(long)5L}))).Equals((new List(new long[]{(long)5L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)2L, (long)4L, (long)3L, (long)0L, (long)1L, (long)5L}))).Equals((new List(new long[]{(long)0L, (long)1L, (long)2L, (long)3L, (long)4L, (long)5L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)2L, (long)4L, (long)3L, (long)0L, (long)1L, (long)5L, (long)6L}))).Equals((new List(new long[]{(long)6L, (long)5L, (long)4L, (long)3L, (long)2L, (long)1L, (long)0L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)2L, (long)1L}))).Equals((new List(new long[]{(long)1L, (long)2L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)15L, (long)42L, (long)87L, (long)32L, (long)11L, (long)0L}))).Equals((new List(new long[]{(long)0L, (long)11L, (long)15L, (long)32L, (long)42L, (long)87L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)21L, (long)14L, (long)23L, (long)11L}))).Equals((new List(new long[]{(long)23L, (long)21L, (long)14L, (long)11L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Implement a function that takes an non-negative integer and returns an array of the first n\n // integers that are prime numbers and less than n.\n // for example:\n // count_up_to(5) => [2,3]\n // count_up_to(11) => [2,3,5,7]\n // count_up_to(0) => []\n // count_up_to(20) => [2,3,5,7,11,13,17,19]\n // count_up_to(1) => []\n // count_up_to(18) => [2,3,5,7,11,13,17]\n public static List CountUpTo(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CountUpTo((5L)).Equals((new List(new long[]{(long)2L, (long)3L}))));\n Debug.Assert(CountUpTo((6L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)5L}))));\n Debug.Assert(CountUpTo((7L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)5L}))));\n Debug.Assert(CountUpTo((10L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)5L, (long)7L}))));\n Debug.Assert(CountUpTo((0L)).Equals((new List())));\n Debug.Assert(CountUpTo((22L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)5L, (long)7L, (long)11L, (long)13L, (long)17L, (long)19L}))));\n Debug.Assert(CountUpTo((1L)).Equals((new List())));\n Debug.Assert(CountUpTo((18L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)5L, (long)7L, (long)11L, (long)13L, (long)17L}))));\n Debug.Assert(CountUpTo((47L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)5L, (long)7L, (long)11L, (long)13L, (long)17L, (long)19L, (long)23L, (long)29L, (long)31L, (long)37L, (long)41L, (long)43L}))));\n Debug.Assert(CountUpTo((101L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)5L, (long)7L, (long)11L, (long)13L, (long)17L, (long)19L, (long)23L, (long)29L, (long)31L, (long)37L, (long)41L, (long)43L, (long)47L, (long)53L, (long)59L, (long)61L, (long)67L, (long)71L, (long)73L, (long)79L, (long)83L, (long)89L, (long)97L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Out of list of strings, return the longest one. Return the first one in case of multiple\n // strings of the same length. Return None in case the input list is empty.\n // >>> longest([])\n // >>> longest(['a', 'b', 'c'])\n // 'a'\n // >>> longest(['a', 'bb', 'ccc'])\n // 'ccc'\n public static string Longest(List strings) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Longest((new List())).Equals(null));\n Debug.Assert(Longest((new List(new string[]{(string)\"x\", (string)\"y\", (string)\"z\"}))).Equals((\"x\")));\n Debug.Assert(Longest((new List(new string[]{(string)\"x\", (string)\"yyy\", (string)\"zzzz\", (string)\"www\", (string)\"kkkk\", (string)\"abc\"}))).Equals((\"zzzz\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n // reverse the resulting array, and then replace each digit by its corresponding name from\n // \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n // For example:\n // arr = [2, 1, 1, 4, 5, 8, 2, 3] \n // -> sort arr -> [1, 1, 2, 2, 3, 4, 5, 8] \n // -> reverse arr -> [8, 5, 4, 3, 2, 2, 1, 1]\n // return [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n // If the array is empty, return an empty array:\n // arr = []\n // return []\n // If the array has any strange number ignore it:\n // arr = [1, -1 , 55] \n // -> sort arr -> [-1, 1, 55]\n // -> reverse arr -> [55, 1, -1]\n // return = ['One']\n public static List ByLength(List arr) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ByLength((new List(new long[]{(long)2L, (long)1L, (long)1L, (long)4L, (long)5L, (long)8L, (long)2L, (long)3L}))).Equals((new List(new string[]{(string)\"Eight\", (string)\"Five\", (string)\"Four\", (string)\"Three\", (string)\"Two\", (string)\"Two\", (string)\"One\", (string)\"One\"}))));\n Debug.Assert(ByLength((new List())).Equals((new List())));\n Debug.Assert(ByLength((new List(new long[]{(long)1L, (long)-1L, (long)55L}))).Equals((new List(new string[]{(string)\"One\"}))));\n Debug.Assert(ByLength((new List(new long[]{(long)1L, (long)-1L, (long)3L, (long)2L}))).Equals((new List(new string[]{(string)\"Three\", (string)\"Two\", (string)\"One\"}))));\n Debug.Assert(ByLength((new List(new long[]{(long)9L, (long)4L, (long)8L}))).Equals((new List(new string[]{(string)\"Nine\", (string)\"Eight\", (string)\"Four\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_106_f", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Implement the function f that takes n as a parameter,\n // 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\n // or the sum of numbers from 1 to i otherwise.\n // i starts from 1.\n // the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n // Example:\n // f(5) == [1, 2, 6, 24, 15]\n public static List F(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(F((5L)).Equals((new List(new long[]{(long)1L, (long)2L, (long)6L, (long)24L, (long)15L}))));\n Debug.Assert(F((7L)).Equals((new List(new long[]{(long)1L, (long)2L, (long)6L, (long)24L, (long)15L, (long)720L, (long)28L}))));\n Debug.Assert(F((1L)).Equals((new List(new long[]{(long)1L}))));\n Debug.Assert(F((3L)).Equals((new List(new long[]{(long)1L, (long)2L, (long)6L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n // >>> fizz_buzz(50)\n // 0\n // >>> fizz_buzz(78)\n // 2\n // >>> fizz_buzz(79)\n // 3\n public static long FizzBuzz(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FizzBuzz((50L)) == (0L));\n Debug.Assert(FizzBuzz((78L)) == (2L));\n Debug.Assert(FizzBuzz((79L)) == (3L));\n Debug.Assert(FizzBuzz((100L)) == (3L));\n Debug.Assert(FizzBuzz((200L)) == (6L));\n Debug.Assert(FizzBuzz((4000L)) == (192L));\n Debug.Assert(FizzBuzz((10000L)) == (639L));\n Debug.Assert(FizzBuzz((100000L)) == (8026L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a positive floating point number, it can be decomposed into\n // and integer part (largest integer smaller than given number) and decimals\n // (leftover part always smaller than 1).\n // Return the decimal part of the number.\n // >>> truncate_number(3.5)\n // 0.5\n public static float TruncateNumber(float number) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(TruncateNumber((3.5f)) == (0.5f));\n Debug.Assert(TruncateNumber((1.25f)) == (0.25f));\n Debug.Assert(TruncateNumber((123.0f)) == (0.0f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n // Empty sum should be equal to 0 and empty product should be equal to 1.\n // >>> sum_product([])\n // (0, 1)\n // >>> sum_product([1, 2, 3, 4])\n // (10, 24)\n public static Tuple SumProduct(List numbers) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SumProduct((new List())).Equals((Tuple.Create(0L, 1L))));\n Debug.Assert(SumProduct((new List(new long[]{(long)1L, (long)1L, (long)1L}))).Equals((Tuple.Create(3L, 1L))));\n Debug.Assert(SumProduct((new List(new long[]{(long)100L, (long)0L}))).Equals((Tuple.Create(100L, 0L))));\n Debug.Assert(SumProduct((new List(new long[]{(long)3L, (long)5L, (long)7L}))).Equals((Tuple.Create(15L, 105L))));\n Debug.Assert(SumProduct((new List(new long[]{(long)10L}))).Equals((Tuple.Create(10L, 10L))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a 2 dimensional data, as a nested lists,\n // which is similar to matrix, however, unlike matrices,\n // each row may contain a different number of columns.\n // Given lst, and integer x, find integers x in the list,\n // and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n // each tuple is a coordinate - (row, columns), starting with 0.\n // Sort coordinates initially by rows in ascending order.\n // Also, sort coordinates of the row by columns in descending order.\n // Examples:\n // get_row([\n // [1,2,3,4,5,6],\n // [1,2,3,4,1,6],\n // [1,2,3,4,5,1]\n // ], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n // get_row([], 1) == []\n // get_row([[], [1], [1, 2, 3]], 3) == [(2, 2)]\n public static List> GetRow(List> lst, long x) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(GetRow((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)1L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)1L})})), (1L)).Equals((new List>(new Tuple[]{(Tuple)Tuple.Create(0L, 0L), (Tuple)Tuple.Create(1L, 4L), (Tuple)Tuple.Create(1L, 0L), (Tuple)Tuple.Create(2L, 5L), (Tuple)Tuple.Create(2L, 0L)}))));\n Debug.Assert(GetRow((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L})})), (2L)).Equals((new List>(new Tuple[]{(Tuple)Tuple.Create(0L, 1L), (Tuple)Tuple.Create(1L, 1L), (Tuple)Tuple.Create(2L, 1L), (Tuple)Tuple.Create(3L, 1L), (Tuple)Tuple.Create(4L, 1L), (Tuple)Tuple.Create(5L, 1L)}))));\n Debug.Assert(GetRow((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)1L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)1L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)1L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)1L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)1L})})), (1L)).Equals((new List>(new Tuple[]{(Tuple)Tuple.Create(0L, 0L), (Tuple)Tuple.Create(1L, 0L), (Tuple)Tuple.Create(2L, 1L), (Tuple)Tuple.Create(2L, 0L), (Tuple)Tuple.Create(3L, 2L), (Tuple)Tuple.Create(3L, 0L), (Tuple)Tuple.Create(4L, 3L), (Tuple)Tuple.Create(4L, 0L), (Tuple)Tuple.Create(5L, 4L), (Tuple)Tuple.Create(5L, 0L), (Tuple)Tuple.Create(6L, 5L), (Tuple)Tuple.Create(6L, 0L)}))));\n Debug.Assert(GetRow((new List>()), (1L)).Equals((new List>())));\n Debug.Assert(GetRow((new List>(new List[]{(List)new List(new long[]{(long)1L})})), (2L)).Equals((new List>())));\n Debug.Assert(GetRow((new List>(new List[]{(List)new List(), (List)new List(new long[]{(long)1L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L})})), (3L)).Equals((new List>(new Tuple[]{(Tuple)Tuple.Create(2L, 2L)}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You're a hungry rabbit, and you already have eaten a certain number of carrots,\n // but now you need to eat more carrots to complete the day's meals.\n // you should return an array of [ total number of eaten carrots after your meals,\n // the number of carrots left after your meals ]\n // if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n // Example:\n // * eat(5, 6, 10) -> [11, 4]\n // * eat(4, 8, 9) -> [12, 1]\n // * eat(1, 10, 10) -> [11, 0]\n // * eat(2, 11, 5) -> [7, 0]\n // Variables:\n // @number : integer\n // the number of carrots that you have eaten.\n // @need : integer\n // the number of carrots that you need to eat.\n // @remaining : integer\n // the number of remaining carrots thet exist in stock\n // Constrain:\n // * 0 <= number <= 1000\n // * 0 <= need <= 1000\n // * 0 <= remaining <= 1000\n // Have fun :)\n public static List Eat(long number, long need, long remaining) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Eat((5L), (6L), (10L)).Equals((new List(new long[]{(long)11L, (long)4L}))));\n Debug.Assert(Eat((4L), (8L), (9L)).Equals((new List(new long[]{(long)12L, (long)1L}))));\n Debug.Assert(Eat((1L), (10L), (10L)).Equals((new List(new long[]{(long)11L, (long)0L}))));\n Debug.Assert(Eat((2L), (11L), (5L)).Equals((new List(new long[]{(long)7L, (long)0L}))));\n Debug.Assert(Eat((4L), (5L), (7L)).Equals((new List(new long[]{(long)9L, (long)2L}))));\n Debug.Assert(Eat((4L), (5L), (1L)).Equals((new List(new long[]{(long)5L, (long)0L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a positive integer N, return the total sum of its digits in binary.\n // Example\n // For N = 1000, the sum of digits will be 1 the output should be \"1\".\n // For N = 150, the sum of digits will be 6 the output should be \"110\".\n // For N = 147, the sum of digits will be 12 the output should be \"1100\".\n // Variables:\n // @N integer\n // Constraints: 0 \u2264 N \u2264 10000.\n // Output:\n // a string of binary number\n public static string Solve(long N) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Solve((1000L)).Equals((\"1\")));\n Debug.Assert(Solve((150L)).Equals((\"110\")));\n Debug.Assert(Solve((147L)).Equals((\"1100\")));\n Debug.Assert(Solve((333L)).Equals((\"1001\")));\n Debug.Assert(Solve((963L)).Equals((\"10010\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a list of integers.\n // You need to find the largest prime value and return the sum of its digits.\n // Examples:\n // For lst = [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] the output should be 10\n // For lst = [1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1] the output should be 25\n // For lst = [1,3,1,32,5107,34,83278,109,163,23,2323,32,30,1,9,3] the output should be 13\n // For lst = [0,724,32,71,99,32,6,0,5,91,83,0,5,6] the output should be 11\n // For lst = [0,81,12,3,1,21] the output should be 3\n // For lst = [0,8,1,2,1,7] the output should be 7\n public static long Skjkasdkd(List lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Skjkasdkd((new List(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, (long)3L}))) == (10L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)1L, (long)0L, (long)1L, (long)8L, (long)2L, (long)4597L, (long)2L, (long)1L, (long)3L, (long)40L, (long)1L, (long)2L, (long)1L, (long)2L, (long)4L, (long)2L, (long)5L, (long)1L}))) == (25L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)1L, (long)3L, (long)1L, (long)32L, (long)5107L, (long)34L, (long)83278L, (long)109L, (long)163L, (long)23L, (long)2323L, (long)32L, (long)30L, (long)1L, (long)9L, (long)3L}))) == (13L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)0L, (long)724L, (long)32L, (long)71L, (long)99L, (long)32L, (long)6L, (long)0L, (long)5L, (long)91L, (long)83L, (long)0L, (long)5L, (long)6L}))) == (11L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)0L, (long)81L, (long)12L, (long)3L, (long)1L, (long)21L}))) == (3L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)0L, (long)8L, (long)1L, (long)2L, (long)1L, (long)7L}))) == (7L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)8191L}))) == (19L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)8191L, (long)123456L, (long)127L, (long)7L}))) == (19L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)127L, (long)97L, (long)8192L}))) == (10L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given an array arr of integers, find the minimum number of elements that\n // need to be changed to make the array palindromic. A palindromic array is an array that\n // is read the same backwards and forwards. In one change, you can change one element to any other element.\n // For example:\n // smallest_change([1,2,3,5,4,7,9,6]) == 4\n // smallest_change([1, 2, 3, 4, 3, 2, 2]) == 1\n // smallest_change([1, 2, 3, 2, 1]) == 0\n public static long SmallestChange(List arr) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SmallestChange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)5L, (long)4L, (long)7L, (long)9L, (long)6L}))) == (4L));\n Debug.Assert(SmallestChange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)3L, (long)2L, (long)2L}))) == (1L));\n Debug.Assert(SmallestChange((new List(new long[]{(long)1L, (long)4L, (long)2L}))) == (1L));\n Debug.Assert(SmallestChange((new List(new long[]{(long)1L, (long)4L, (long)4L, (long)2L}))) == (1L));\n Debug.Assert(SmallestChange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)2L, (long)1L}))) == (0L));\n Debug.Assert(SmallestChange((new List(new long[]{(long)3L, (long)1L, (long)1L, (long)3L}))) == (0L));\n Debug.Assert(SmallestChange((new List(new long[]{(long)1L}))) == (0L));\n Debug.Assert(SmallestChange((new List(new long[]{(long)0L, (long)1L}))) == (1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // It is the last week of the semester and the teacher has to give the grades\n // to students. The teacher has been making her own algorithm for grading.\n // The only problem is, she has lost the code she used for grading.\n // She has given you a list of GPAs for some students and you have to write \n // a function that can output a list of letter grades using the following table:\n // GPA | Letter grade\n // 4.0 A+\n // > 3.7 A \n // > 3.3 A- \n // > 3.0 B+\n // > 2.7 B \n // > 2.3 B-\n // > 2.0 C+\n // > 1.7 C\n // > 1.3 C-\n // > 1.0 D+ \n // > 0.7 D \n // > 0.0 D-\n // 0.0 E\n // Example:\n // grade_equation([4.0, 3, 1.7, 2, 3.5]) ==> ['A+', 'B', 'C-', 'C', 'A-']\n public static List NumericalLetterGrade(List grades) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(NumericalLetterGrade((new List(new float[]{(float)4.0f, (float)3L, (float)1.7f, (float)2L, (float)3.5f}))).Equals((new List(new string[]{(string)\"A+\", (string)\"B\", (string)\"C-\", (string)\"C\", (string)\"A-\"}))));\n Debug.Assert(NumericalLetterGrade((new List(new float[]{(float)1.2f}))).Equals((new List(new string[]{(string)\"D+\"}))));\n Debug.Assert(NumericalLetterGrade((new List(new float[]{(float)0.5f}))).Equals((new List(new string[]{(string)\"D-\"}))));\n Debug.Assert(NumericalLetterGrade((new List(new float[]{(float)0.0f}))).Equals((new List(new string[]{(string)\"E\"}))));\n Debug.Assert(NumericalLetterGrade((new List(new float[]{(float)1.0f, (float)0.3f, (float)1.5f, (float)2.8f, (float)3.3f}))).Equals((new List(new string[]{(string)\"D\", (string)\"D-\", (string)\"C-\", (string)\"B\", (string)\"B+\"}))));\n Debug.Assert(NumericalLetterGrade((new List(new float[]{(float)0.0f, (float)0.7f}))).Equals((new List(new string[]{(string)\"E\", (string)\"D-\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given the lengths of the three sides of a triangle. Return the area of\n // the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n // Otherwise return -1\n // Three sides make a valid triangle when the sum of any two sides is greater \n // than the third side.\n // Example:\n // triangle_area(3, 4, 5) == 6.00\n // triangle_area(1, 2, 10) == -1\n public static float TriangleArea(long a, long b, long c) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(TriangleArea((3L), (4L), (5L)) == (6.0f));\n Debug.Assert(TriangleArea((1L), (2L), (10L)) == (float)-1L);\n Debug.Assert(TriangleArea((4L), (8L), (5L)) == (8.18f));\n Debug.Assert(TriangleArea((2L), (2L), (2L)) == (1.73f));\n Debug.Assert(TriangleArea((1L), (2L), (3L)) == (float)-1L);\n Debug.Assert(TriangleArea((10L), (5L), (7L)) == (16.25f));\n Debug.Assert(TriangleArea((2L), (6L), (3L)) == (float)-1L);\n Debug.Assert(TriangleArea((1L), (1L), (1L)) == (0.43f));\n Debug.Assert(TriangleArea((2L), (2L), (10L)) == (float)-1L);\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Check if two words have the same characters.\n // >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n // True\n // >>> same_chars('abcd', 'dddddddabc')\n // True\n // >>> same_chars('dddddddabc', 'abcd')\n // True\n // >>> same_chars('eabcd', 'dddddddabc')\n // False\n // >>> same_chars('abcd', 'dddddddabce')\n // False\n // >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc')\n // False\n public static bool SameChars(string s0, string s1) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddeddabc\")) == (true));\n Debug.Assert(SameChars((\"abcd\"), (\"dddddddabc\")) == (true));\n Debug.Assert(SameChars((\"dddddddabc\"), (\"abcd\")) == (true));\n Debug.Assert(SameChars((\"eabcd\"), (\"dddddddabc\")) == (false));\n Debug.Assert(SameChars((\"abcd\"), (\"dddddddabcf\")) == (false));\n Debug.Assert(SameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddddabc\")) == (false));\n Debug.Assert(SameChars((\"aabb\"), (\"aaccc\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given an array of integers nums, find the minimum sum of any non-empty sub-array\n // of nums.\n // Example\n // minSubArraySum([2, 3, 4, 1, 2, 4]) == 1\n // minSubArraySum([-1, -2, -3]) == -6\n public static long Minsubarraysum(List nums) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)2L, (long)3L, (long)4L, (long)1L, (long)2L, (long)4L}))) == (1L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)-1L, (long)-2L, (long)-3L}))) == (-6L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)-1L, (long)-2L, (long)-3L, (long)2L, (long)-10L}))) == (-14L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)-9999999999999999L}))) == (-9999999999999999L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)0L, (long)10L, (long)20L, (long)1000000L}))) == (0L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)-1L, (long)-2L, (long)-3L, (long)10L, (long)-5L}))) == (-6L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)100L, (long)-1L, (long)-2L, (long)-3L, (long)10L, (long)-5L}))) == (-6L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)10L, (long)11L, (long)13L, (long)8L, (long)3L, (long)4L}))) == (3L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)100L, (long)-33L, (long)32L, (long)-1L, (long)0L, (long)-2L}))) == (-33L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)-10L}))) == (-10L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)7L}))) == (7L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)1L, (long)-1L}))) == (-1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a string s and a natural number n, you have been tasked to implement \n // a function that returns a list of all words from string s that contain exactly \n // n consonants, in order these words appear in the string s.\n // If the string s is empty then the function should return an empty list.\n // Note: you may assume the input string contains only letters and spaces.\n // Examples:\n // select_words(\"Mary had a little lamb\", 4) ==> [\"little\"]\n // select_words(\"Mary had a little lamb\", 3) ==> [\"Mary\", \"lamb\"]\n // select_words(\"simple white space\", 2) ==> []\n // select_words(\"Hello world\", 4) ==> [\"world\"]\n // select_words(\"Uncle sam\", 3) ==> [\"Uncle\"]\n public static List SelectWords(string s, long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SelectWords((\"Mary had a little lamb\"), (4L)).Equals((new List(new string[]{(string)\"little\"}))));\n Debug.Assert(SelectWords((\"Mary had a little lamb\"), (3L)).Equals((new List(new string[]{(string)\"Mary\", (string)\"lamb\"}))));\n Debug.Assert(SelectWords((\"simple white space\"), (2L)).Equals((new List())));\n Debug.Assert(SelectWords((\"Hello world\"), (4L)).Equals((new List(new string[]{(string)\"world\"}))));\n Debug.Assert(SelectWords((\"Uncle sam\"), (3L)).Equals((new List(new string[]{(string)\"Uncle\"}))));\n Debug.Assert(SelectWords((\"\"), (4L)).Equals((new List())));\n Debug.Assert(SelectWords((\"a b c d e f\"), (1L)).Equals((new List(new string[]{(string)\"b\", (string)\"c\", (string)\"d\", (string)\"f\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return list of all prefixes from shortest to longest of the input string\n // >>> all_prefixes('abc')\n // ['a', 'ab', 'abc']\n public static List AllPrefixes(string str) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(AllPrefixes((\"\")).Equals((new List())));\n Debug.Assert(AllPrefixes((\"asdfgh\")).Equals((new List(new string[]{(string)\"a\", (string)\"as\", (string)\"asd\", (string)\"asdf\", (string)\"asdfg\", (string)\"asdfgh\"}))));\n Debug.Assert(AllPrefixes((\"WWW\")).Equals((new List(new string[]{(string)\"W\", (string)\"WW\", (string)\"WWW\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function that takes a value (string) representing a number\n // and returns the closest integer to it. If the number is equidistant\n // from two integers, round it away from zero.\n // Examples\n // >>> closest_integer(\"10\")\n // 10\n // >>> closest_integer(\"15.3\")\n // 15\n // Note:\n // Rounding away from zero means that if the given number is equidistant\n // from two integers, the one you should return is the one that is the\n // farthest from zero. For example closest_integer(\"14.5\") should\n // return 15 and closest_integer(\"-14.5\") should return -15.\n public static long ClosestInteger(string value) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ClosestInteger((\"10\")) == (10L));\n Debug.Assert(ClosestInteger((\"14.5\")) == (15L));\n Debug.Assert(ClosestInteger((\"-15.5\")) == (-16L));\n Debug.Assert(ClosestInteger((\"15.3\")) == (15L));\n Debug.Assert(ClosestInteger((\"0\")) == (0L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function which takes a string representing a file's name, and returns\n // 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n // A file's name is considered to be valid if and only if all the following conditions \n // are met:\n // - There should not be more than three digits ('0'-'9') in the file's name.\n // - The file's name contains exactly one dot '.'\n // - The substring before the dot should not be empty, and it starts with a letter from \n // the latin alphapet ('a'-'z' and 'A'-'Z').\n // - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n // Examples:\n // file_name_check(\"example.txt\") # => 'Yes'\n // file_name_check(\"1example.dll\") # => 'No' (the name should start with a latin alphapet letter)\n public static string FileNameCheck(string file_name) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FileNameCheck((\"example.txt\")).Equals((\"Yes\")));\n Debug.Assert(FileNameCheck((\"1example.dll\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"s1sdf3.asd\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"K.dll\")).Equals((\"Yes\")));\n Debug.Assert(FileNameCheck((\"MY16FILE3.exe\")).Equals((\"Yes\")));\n Debug.Assert(FileNameCheck((\"His12FILE94.exe\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"_Y.txt\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"?aREYA.exe\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"/this_is_valid.dll\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"this_is_valid.wow\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"this_is_valid.txt\")).Equals((\"Yes\")));\n Debug.Assert(FileNameCheck((\"this_is_valid.txtexe\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"#this2_i4s_5valid.ten\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"@this1_is6_valid.exe\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"this_is_12valid.6exe4.txt\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"all.exe.txt\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"I563_No.exe\")).Equals((\"Yes\")));\n Debug.Assert(FileNameCheck((\"Is3youfault.txt\")).Equals((\"Yes\")));\n Debug.Assert(FileNameCheck((\"no_one#knows.dll\")).Equals((\"Yes\")));\n Debug.Assert(FileNameCheck((\"1I563_Yes3.exe\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"I563_Yes3.txtt\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"final..txt\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"final132\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"_f4indsartal132.\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\".txt\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"s.\")).Equals((\"No\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given two intervals,\n // where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n // The given intervals are closed which means that the interval (start, end)\n // includes both start and end.\n // For each given interval, it is assumed that its start is less or equal its end.\n // Your task is to determine whether the length of intersection of these two \n // intervals is a prime number.\n // Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n // which its length is 1, which not a prime number.\n // If the length of the intersection is a prime number, return \"YES\",\n // otherwise, return \"NO\".\n // If the two intervals don't intersect, return \"NO\".\n // [input/output] samples:\n // intersection((1, 2), (2, 3)) ==> \"NO\"\n // intersection((-1, 1), (0, 4)) ==> \"NO\"\n // intersection((-3, -1), (-5, 5)) ==> \"YES\"\n public static string Intersection(Tuple interval1, Tuple interval2) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Intersection((Tuple.Create(1L, 2L)), (Tuple.Create(2L, 3L))).Equals((\"NO\")));\n Debug.Assert(Intersection((Tuple.Create(-1L, 1L)), (Tuple.Create(0L, 4L))).Equals((\"NO\")));\n Debug.Assert(Intersection((Tuple.Create(-3L, -1L)), (Tuple.Create(-5L, 5L))).Equals((\"YES\")));\n Debug.Assert(Intersection((Tuple.Create(-2L, 2L)), (Tuple.Create(-4L, 0L))).Equals((\"YES\")));\n Debug.Assert(Intersection((Tuple.Create(-11L, 2L)), (Tuple.Create(-1L, -1L))).Equals((\"NO\")));\n Debug.Assert(Intersection((Tuple.Create(1L, 2L)), (Tuple.Create(3L, 5L))).Equals((\"NO\")));\n Debug.Assert(Intersection((Tuple.Create(1L, 2L)), (Tuple.Create(1L, 2L))).Equals((\"NO\")));\n Debug.Assert(Intersection((Tuple.Create(-2L, -2L)), (Tuple.Create(-3L, -2L))).Equals((\"NO\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return the largest prime factor of n. Assume n > 1 and is not a prime.\n // >>> largest_prime_factor(13195)\n // 29\n // >>> largest_prime_factor(2048)\n // 2\n public static long LargestPrimeFactor(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(LargestPrimeFactor((15L)) == (5L));\n Debug.Assert(LargestPrimeFactor((27L)) == (3L));\n Debug.Assert(LargestPrimeFactor((63L)) == (7L));\n Debug.Assert(LargestPrimeFactor((330L)) == (11L));\n Debug.Assert(LargestPrimeFactor((13195L)) == (29L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a string, find out how many distinct characters (regardless of case) does it consist of\n // >>> count_distinct_characters('xyzXYZ')\n // 3\n // >>> count_distinct_characters('Jerry')\n // 4\n public static long CountDistinctCharacters(string str) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CountDistinctCharacters((\"\")) == (0L));\n Debug.Assert(CountDistinctCharacters((\"abcde\")) == (5L));\n Debug.Assert(CountDistinctCharacters((\"abcdecadeCADE\")) == (5L));\n Debug.Assert(CountDistinctCharacters((\"aaaaAAAAaaaa\")) == (1L));\n Debug.Assert(CountDistinctCharacters((\"Jerry jERRY JeRRRY\")) == (5L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You're given a list of deposit and withdrawal operations on a bank account that starts with\n // zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n // at that point function should return True. Otherwise it should return False.\n // >>> below_zero([1, 2, 3])\n // False\n // >>> below_zero([1, 2, -4, 5])\n // True\n public static bool BelowZero(List operations) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(BelowZero((new List())) == (false));\n Debug.Assert(BelowZero((new List(new long[]{(long)1L, (long)2L, (long)-3L, (long)1L, (long)2L, (long)-3L}))) == (false));\n Debug.Assert(BelowZero((new List(new long[]{(long)1L, (long)2L, (long)-4L, (long)5L, (long)6L}))) == (true));\n Debug.Assert(BelowZero((new List(new long[]{(long)1L, (long)-1L, (long)2L, (long)-2L, (long)5L, (long)-5L, (long)4L, (long)-4L}))) == (false));\n Debug.Assert(BelowZero((new List(new long[]{(long)1L, (long)-1L, (long)2L, (long)-2L, (long)5L, (long)-5L, (long)4L, (long)-5L}))) == (true));\n Debug.Assert(BelowZero((new List(new long[]{(long)1L, (long)-2L, (long)2L, (long)-2L, (long)5L, (long)-5L, (long)4L, (long)-4L}))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Find the shortest palindrome that begins with a supplied string.\n // Algorithm idea is simple:\n // - Find the longest postfix of supplied string that is a palindrome.\n // - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n // >>> make_palindrome('')\n // ''\n // >>> make_palindrome('cat')\n // 'catac'\n // >>> make_palindrome('cata')\n // 'catac'\n public static string MakePalindrome(string str) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(MakePalindrome((\"\")).Equals((\"\")));\n Debug.Assert(MakePalindrome((\"x\")).Equals((\"x\")));\n Debug.Assert(MakePalindrome((\"xyz\")).Equals((\"xyzyx\")));\n Debug.Assert(MakePalindrome((\"xyx\")).Equals((\"xyx\")));\n Debug.Assert(MakePalindrome((\"jerry\")).Equals((\"jerryrrej\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a positive integer, obtain its roman numeral equivalent as a string,\n // and return it in lowercase.\n // Restrictions: 1 <= num <= 1000\n // Examples:\n // >>> int_to_mini_roman(19) == 'xix'\n // >>> int_to_mini_roman(152) == 'clii'\n // >>> int_to_mini_roman(426) == 'cdxxvi'\n public static string IntToMiniRoman(long number) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IntToMiniRoman((19L)).Equals((\"xix\")));\n Debug.Assert(IntToMiniRoman((152L)).Equals((\"clii\")));\n Debug.Assert(IntToMiniRoman((251L)).Equals((\"ccli\")));\n Debug.Assert(IntToMiniRoman((426L)).Equals((\"cdxxvi\")));\n Debug.Assert(IntToMiniRoman((500L)).Equals((\"d\")));\n Debug.Assert(IntToMiniRoman((1L)).Equals((\"i\")));\n Debug.Assert(IntToMiniRoman((4L)).Equals((\"iv\")));\n Debug.Assert(IntToMiniRoman((43L)).Equals((\"xliii\")));\n Debug.Assert(IntToMiniRoman((90L)).Equals((\"xc\")));\n Debug.Assert(IntToMiniRoman((94L)).Equals((\"xciv\")));\n Debug.Assert(IntToMiniRoman((532L)).Equals((\"dxxxii\")));\n Debug.Assert(IntToMiniRoman((900L)).Equals((\"cm\")));\n Debug.Assert(IntToMiniRoman((994L)).Equals((\"cmxciv\")));\n Debug.Assert(IntToMiniRoman((1000L)).Equals((\"m\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - } -] \ No newline at end of file diff --git a/data/cs-remove.json b/data/cs-remove.json deleted file mode 100644 index 5bad4623aa1c16e7ef8951d0c8dcb3fdadaf9512..0000000000000000000000000000000000000000 --- a/data/cs-remove.json +++ /dev/null @@ -1,1862 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // For a given number n, find the largest number that divides n evenly, smaller than n\n public static long LargestDivisor(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(LargestDivisor((3L)) == (1L));\n Debug.Assert(LargestDivisor((7L)) == (1L));\n Debug.Assert(LargestDivisor((10L)) == (5L));\n Debug.Assert(LargestDivisor((100L)) == (50L));\n Debug.Assert(LargestDivisor((49L)) == (7L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_47_median", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return median of elements in the list l.\n public static float Median(List l) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Median((new List(new long[]{(long)3L, (long)1L, (long)2L, (long)4L, (long)5L}))) == (float)3L);\n Debug.Assert(Median((new List(new long[]{(long)-10L, (long)4L, (long)6L, (long)1000L, (long)10L, (long)20L}))) == (8.0f));\n Debug.Assert(Median((new List(new long[]{(long)5L}))) == (float)5L);\n Debug.Assert(Median((new List(new long[]{(long)6L, (long)5L}))) == (5.5f));\n Debug.Assert(Median((new List(new long[]{(long)8L, (long)1L, (long)3L, (long)9L, (long)9L, (long)2L, (long)7L}))) == (float)7L);\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return maximum element in the list.\n public static long MaxElement(List l) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(MaxElement((new List(new long[]{(long)1L, (long)2L, (long)3L}))) == (3L));\n Debug.Assert(MaxElement((new List(new long[]{(long)5L, (long)3L, (long)-5L, (long)2L, (long)-3L, (long)3L, (long)9L, (long)0L, (long)124L, (long)1L, (long)-10L}))) == (124L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function which returns the largest index of an element which\n // is not greater than or equal to the element immediately preceding it. If\n // no such element exists then return -1. The given array will not contain\n // duplicate values.\n // Examples:\n public static long CanArrange(List arr) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CanArrange((new List(new long[]{(long)1L, (long)2L, (long)4L, (long)3L, (long)5L}))) == (3L));\n Debug.Assert(CanArrange((new List(new long[]{(long)1L, (long)2L, (long)4L, (long)5L}))) == (-1L));\n Debug.Assert(CanArrange((new List(new long[]{(long)1L, (long)4L, (long)2L, (long)5L, (long)6L, (long)7L, (long)8L, (long)9L, (long)10L}))) == (2L));\n Debug.Assert(CanArrange((new List(new long[]{(long)4L, (long)8L, (long)5L, (long)7L, (long)3L}))) == (4L));\n Debug.Assert(CanArrange((new List())) == (-1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function that returns True if the last character\n // of a given string is an alphabetical character and is not\n // a part of a word, and False otherwise.\n // Note: \"word\" is a group of characters separated by space.\n // Examples:\n public static bool CheckIfLastCharIsALetter(string txt) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CheckIfLastCharIsALetter((\"apple\")) == (false));\n Debug.Assert(CheckIfLastCharIsALetter((\"apple pi e\")) == (true));\n Debug.Assert(CheckIfLastCharIsALetter((\"eeeee\")) == (false));\n Debug.Assert(CheckIfLastCharIsALetter((\"A\")) == (true));\n Debug.Assert(CheckIfLastCharIsALetter((\"Pumpkin pie \")) == (false));\n Debug.Assert(CheckIfLastCharIsALetter((\"Pumpkin pie 1\")) == (false));\n Debug.Assert(CheckIfLastCharIsALetter((\"\")) == (false));\n Debug.Assert(CheckIfLastCharIsALetter((\"eeeee e \")) == (false));\n Debug.Assert(CheckIfLastCharIsALetter((\"apple pie\")) == (false));\n Debug.Assert(CheckIfLastCharIsALetter((\"apple pi e \")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return true if a given number is prime, and false otherwise.\n public static bool IsPrime(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsPrime((6L)) == (false));\n Debug.Assert(IsPrime((101L)) == (true));\n Debug.Assert(IsPrime((11L)) == (true));\n Debug.Assert(IsPrime((13441L)) == (true));\n Debug.Assert(IsPrime((61L)) == (true));\n Debug.Assert(IsPrime((4L)) == (false));\n Debug.Assert(IsPrime((1L)) == (false));\n Debug.Assert(IsPrime((5L)) == (true));\n Debug.Assert(IsPrime((11L)) == (true));\n Debug.Assert(IsPrime((17L)) == (true));\n Debug.Assert(IsPrime((85L)) == (false));\n Debug.Assert(IsPrime((77L)) == (false));\n Debug.Assert(IsPrime((255379L)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a list of positive integers x. return a sorted list of all \n // elements that hasn't any even digit.\n // Note: Returned list should be sorted in increasing order.\n // For example:\n public static List UniqueDigits(List x) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(UniqueDigits((new List(new long[]{(long)15L, (long)33L, (long)1422L, (long)1L}))).Equals((new List(new long[]{(long)1L, (long)15L, (long)33L}))));\n Debug.Assert(UniqueDigits((new List(new long[]{(long)152L, (long)323L, (long)1422L, (long)10L}))).Equals((new List())));\n Debug.Assert(UniqueDigits((new List(new long[]{(long)12345L, (long)2033L, (long)111L, (long)151L}))).Equals((new List(new long[]{(long)111L, (long)151L}))));\n Debug.Assert(UniqueDigits((new List(new long[]{(long)135L, (long)103L, (long)31L}))).Equals((new List(new long[]{(long)31L, (long)135L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Input are two strings a and b consisting only of 1s and 0s.\n // Perform binary XOR on these inputs and return result also as a string.\n public static string StringXor(string a, string b) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(StringXor((\"111000\"), (\"101010\")).Equals((\"010010\")));\n Debug.Assert(StringXor((\"1\"), (\"1\")).Equals((\"0\")));\n Debug.Assert(StringXor((\"0101\"), (\"0000\")).Equals((\"0101\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // sum_to_n is a function that sums numbers from 1 to n.\n public static long SumToN(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SumToN((1L)) == (1L));\n Debug.Assert(SumToN((6L)) == (21L));\n Debug.Assert(SumToN((11L)) == (66L));\n Debug.Assert(SumToN((30L)) == (465L));\n Debug.Assert(SumToN((100L)) == (5050L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a list of numbers, return the sum of squares of the numbers\n // in the list that are odd. Ignore numbers that are negative or not integers.\n // If the input list is empty, return 0.\n public static long DoubleTheDifference(List lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(DoubleTheDifference((new List())) == (0L));\n Debug.Assert(DoubleTheDifference((new List(new float[]{(float)5.0f, (float)4.0f}))) == (25L));\n Debug.Assert(DoubleTheDifference((new List(new float[]{(float)0.1f, (float)0.2f, (float)0.3f}))) == (0L));\n Debug.Assert(DoubleTheDifference((new List(new float[]{(float)-10.0f, (float)-20.0f, (float)-30.0f}))) == (0L));\n Debug.Assert(DoubleTheDifference((new List(new float[]{(float)-1.0f, (float)-2.0f, (float)8.0f}))) == (0L));\n Debug.Assert(DoubleTheDifference((new List(new float[]{(float)0.2f, (float)3.0f, (float)5.0f}))) == (34L));\n Debug.Assert(DoubleTheDifference((new List(new float[]{(float)-9.0f, (float)-7.0f, (float)-5.0f, (float)-3.0f, (float)-1.0f, (float)1.0f, (float)3.0f, (float)5.0f, (float)7.0f, (float)9.0f}))) == (165L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return length of given string\n public static long Strlen(string str) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Strlen((\"\")) == (0L));\n Debug.Assert(Strlen((\"x\")) == (1L));\n Debug.Assert(Strlen((\"asdasnakj\")) == (9L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You'll be given a string of words, and your task is to count the number\n // of boredoms. A boredom is a sentence that starts with the word \"I\".\n // Sentences are delimited by '.', '?' or '!'.\n // For example:\n public static long IsBored(string S) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsBored((\"Hello world\")) == (0L));\n Debug.Assert(IsBored((\"Is the sky blue?\")) == (0L));\n Debug.Assert(IsBored((\"I love It !\")) == (1L));\n Debug.Assert(IsBored((\"bIt\")) == (0L));\n Debug.Assert(IsBored((\"I feel good today. I will be productive. will kill It\")) == (2L));\n Debug.Assert(IsBored((\"You and I are going for a walk\")) == (0L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function vowels_count which takes a string representing\n // a word as input and returns the number of vowels in the string.\n // Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n // vowel, but only when it is at the end of the given word.\n // Example:\n public static long VowelsCount(string s) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(VowelsCount((\"abcde\")) == (2L));\n Debug.Assert(VowelsCount((\"Alone\")) == (3L));\n Debug.Assert(VowelsCount((\"key\")) == (2L));\n Debug.Assert(VowelsCount((\"bye\")) == (1L));\n Debug.Assert(VowelsCount((\"keY\")) == (2L));\n Debug.Assert(VowelsCount((\"bYe\")) == (1L));\n Debug.Assert(VowelsCount((\"ACEDY\")) == (3L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return n-th Fibonacci number.\n public static long Fib(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Fib((10L)) == (55L));\n Debug.Assert(Fib((1L)) == (1L));\n Debug.Assert(Fib((8L)) == (21L));\n Debug.Assert(Fib((11L)) == (89L));\n Debug.Assert(Fib((12L)) == (144L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Your task is to implement a function that will simplify the expression\n // x * n. The function returns True if x * n evaluates to a whole number and False\n // otherwise. Both x and n, are string representation of a fraction, and have the following format,\n // / where both numerator and denominator are positive whole numbers.\n // You can assume that x, and n are valid fractions, and do not have zero as denominator.\n public static bool Simplify(string x, string n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Simplify((\"1/5\"), (\"5/1\")) == (true));\n Debug.Assert(Simplify((\"1/6\"), (\"2/1\")) == (false));\n Debug.Assert(Simplify((\"5/1\"), (\"3/1\")) == (true));\n Debug.Assert(Simplify((\"7/10\"), (\"10/2\")) == (false));\n Debug.Assert(Simplify((\"2/10\"), (\"50/10\")) == (true));\n Debug.Assert(Simplify((\"7/2\"), (\"4/2\")) == (true));\n Debug.Assert(Simplify((\"11/6\"), (\"6/1\")) == (true));\n Debug.Assert(Simplify((\"2/3\"), (\"5/2\")) == (false));\n Debug.Assert(Simplify((\"5/2\"), (\"3/5\")) == (false));\n Debug.Assert(Simplify((\"2/4\"), (\"8/4\")) == (true));\n Debug.Assert(Simplify((\"2/4\"), (\"4/2\")) == (true));\n Debug.Assert(Simplify((\"1/5\"), (\"5/1\")) == (true));\n Debug.Assert(Simplify((\"1/5\"), (\"1/5\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a string s, count the number of uppercase vowels in even indices.\n // For example:\n public static long CountUpper(string s) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CountUpper((\"aBCdEf\")) == (1L));\n Debug.Assert(CountUpper((\"abcdefg\")) == (0L));\n Debug.Assert(CountUpper((\"dBBE\")) == (0L));\n Debug.Assert(CountUpper((\"B\")) == (0L));\n Debug.Assert(CountUpper((\"U\")) == (1L));\n Debug.Assert(CountUpper((\"\")) == (0L));\n Debug.Assert(CountUpper((\"EEEE\")) == (2L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a rectangular grid of wells. Each row represents a single well,\n // and each 1 in a row represents a single unit of water.\n // Each well has a corresponding bucket that can be used to extract water from it, \n // and all buckets have the same capacity.\n // Your task is to use the buckets to empty the wells.\n // Output the number of times you need to lower the buckets.\n // Example 1:\n // Example 2:\n // Example 3:\n // Constraints:\n // * all wells have the same length\n // * 1 <= grid.length <= 10^2\n // * 1 <= grid[:,1].length <= 10^2\n // * grid[i][j] -> 0 | 1\n // * 1 <= capacity <= 10\n public static long MaxFill(List> grid, long capacity) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(MaxFill((new List>(new List[]{(List)new List(new long[]{(long)0L, (long)0L, (long)1L, (long)0L}), (List)new List(new long[]{(long)0L, (long)1L, (long)0L, (long)0L}), (List)new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L})})), (1L)) == (6L));\n Debug.Assert(MaxFill((new List>(new List[]{(List)new List(new long[]{(long)0L, (long)0L, (long)1L, (long)1L}), (List)new List(new long[]{(long)0L, (long)0L, (long)0L, (long)0L}), (List)new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L}), (List)new List(new long[]{(long)0L, (long)1L, (long)1L, (long)1L})})), (2L)) == (5L));\n Debug.Assert(MaxFill((new List>(new List[]{(List)new List(new long[]{(long)0L, (long)0L, (long)0L}), (List)new List(new long[]{(long)0L, (long)0L, (long)0L})})), (5L)) == (0L));\n Debug.Assert(MaxFill((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L}), (List)new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L})})), (2L)) == (4L));\n Debug.Assert(MaxFill((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L}), (List)new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L})})), (9L)) == (2L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given an array arr of integers and a positive integer k, return a sorted list \n // of length k with the maximum k numbers in arr.\n // Example 1:\n // Example 2:\n // Example 3:\n // Note:\n // 1. The length of the array will be in the range of [1, 1000].\n // 2. The elements in the array will be in the range of [-1000, 1000].\n // 3. 0 <= k <= len(arr)\n public static List Maximum(List arr, long k) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Maximum((new List(new long[]{(long)-3L, (long)-4L, (long)5L})), (3L)).Equals((new List(new long[]{(long)-4L, (long)-3L, (long)5L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)4L, (long)-4L, (long)4L})), (2L)).Equals((new List(new long[]{(long)4L, (long)4L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)-3L, (long)2L, (long)1L, (long)2L, (long)-1L, (long)-2L, (long)1L})), (1L)).Equals((new List(new long[]{(long)2L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)123L, (long)-123L, (long)20L, (long)0L, (long)1L, (long)2L, (long)-3L})), (3L)).Equals((new List(new long[]{(long)2L, (long)20L, (long)123L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)-123L, (long)20L, (long)0L, (long)1L, (long)2L, (long)-3L})), (4L)).Equals((new List(new long[]{(long)0L, (long)1L, (long)2L, (long)20L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)5L, (long)15L, (long)0L, (long)3L, (long)-13L, (long)-8L, (long)0L})), (7L)).Equals((new List(new long[]{(long)-13L, (long)-8L, (long)0L, (long)0L, (long)3L, (long)5L, (long)15L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)-1L, (long)0L, (long)2L, (long)5L, (long)3L, (long)-10L})), (2L)).Equals((new List(new long[]{(long)3L, (long)5L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)1L, (long)0L, (long)5L, (long)-7L})), (1L)).Equals((new List(new long[]{(long)5L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)4L, (long)-4L})), (2L)).Equals((new List(new long[]{(long)-4L, (long)4L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)-10L, (long)10L})), (2L)).Equals((new List(new long[]{(long)-10L, (long)10L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)-23L, (long)243L, (long)-400L, (long)0L})), (0L)).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that takes a message, and encodes in such a \n // way that it swaps case of all letters, replaces all vowels in \n // the message with the letter that appears 2 places ahead of that \n // vowel in the english alphabet. \n // Assume only letters. \n // Examples:\n public static string Encode(string message) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Encode((\"TEST\")).Equals((\"tgst\")));\n Debug.Assert(Encode((\"Mudasir\")).Equals((\"mWDCSKR\")));\n Debug.Assert(Encode((\"YES\")).Equals((\"ygs\")));\n Debug.Assert(Encode((\"This is a message\")).Equals((\"tHKS KS C MGSSCGG\")));\n Debug.Assert(Encode((\"I DoNt KnOw WhAt tO WrItE\")).Equals((\"k dQnT kNqW wHcT Tq wRkTg\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // remove_vowels is a function that takes string and returns string without vowels.\n public static string RemoveVowels(string text) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(RemoveVowels((\"\")).Equals((\"\")));\n Debug.Assert(RemoveVowels((\"abcdef\\nghijklm\")).Equals((\"bcdf\\nghjklm\")));\n Debug.Assert(RemoveVowels((\"fedcba\")).Equals((\"fdcb\")));\n Debug.Assert(RemoveVowels((\"eeeee\")).Equals((\"\")));\n Debug.Assert(RemoveVowels((\"acBAA\")).Equals((\"cB\")));\n Debug.Assert(RemoveVowels((\"EcBOO\")).Equals((\"cB\")));\n Debug.Assert(RemoveVowels((\"ybcd\")).Equals((\"ybcd\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return only positive numbers in the list.\n public static List GetPositive(List l) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(GetPositive((new List(new long[]{(long)-1L, (long)-2L, (long)4L, (long)5L, (long)6L}))).Equals((new List(new long[]{(long)4L, (long)5L, (long)6L}))));\n Debug.Assert(GetPositive((new List(new long[]{(long)5L, (long)3L, (long)-5L, (long)2L, (long)3L, (long)3L, (long)9L, (long)0L, (long)123L, (long)1L, (long)-10L}))).Equals((new List(new long[]{(long)5L, (long)3L, (long)2L, (long)3L, (long)3L, (long)9L, (long)123L, (long)1L}))));\n Debug.Assert(GetPositive((new List(new long[]{(long)-1L, (long)-2L}))).Equals((new List())));\n Debug.Assert(GetPositive((new List())).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n public static string StringSequence(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(StringSequence((0L)).Equals((\"0\")));\n Debug.Assert(StringSequence((3L)).Equals((\"0 1 2 3\")));\n Debug.Assert(StringSequence((10L)).Equals((\"0 1 2 3 4 5 6 7 8 9 10\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a positive integer n, you have to make a pile of n levels of stones.\n // The first level has n stones.\n // The number of stones in the next level is:\n // - the next odd number if n is odd.\n // - the next even number if n is even.\n // Return the number of stones in each level in a list, where element at index\n // i represents the number of stones in the level (i+1).\n // Examples:\n public static List MakeAPile(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(MakeAPile((3L)).Equals((new List(new long[]{(long)3L, (long)5L, (long)7L}))));\n Debug.Assert(MakeAPile((4L)).Equals((new List(new long[]{(long)4L, (long)6L, (long)8L, (long)10L}))));\n Debug.Assert(MakeAPile((5L)).Equals((new List(new long[]{(long)5L, (long)7L, (long)9L, (long)11L, (long)13L}))));\n Debug.Assert(MakeAPile((6L)).Equals((new List(new long[]{(long)6L, (long)8L, (long)10L, (long)12L, (long)14L, (long)16L}))));\n Debug.Assert(MakeAPile((8L)).Equals((new List(new long[]{(long)8L, (long)10L, (long)12L, (long)14L, (long)16L, (long)18L, (long)20L, (long)22L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Task\n // 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\n // then check if the result string is palindrome.\n // A string is called palindrome if it reads the same backward as forward.\n // You should return a tuple containing the result string and True/False for the check.\n // Example\n public static Tuple ReverseDelete(string s, string c) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ReverseDelete((\"abcde\"), (\"ae\")).Equals((Tuple.Create(\"bcd\", false))));\n Debug.Assert(ReverseDelete((\"abcdef\"), (\"b\")).Equals((Tuple.Create(\"acdef\", false))));\n Debug.Assert(ReverseDelete((\"abcdedcba\"), (\"ab\")).Equals((Tuple.Create(\"cdedc\", true))));\n Debug.Assert(ReverseDelete((\"dwik\"), (\"w\")).Equals((Tuple.Create(\"dik\", false))));\n Debug.Assert(ReverseDelete((\"a\"), (\"a\")).Equals((Tuple.Create(\"\", true))));\n Debug.Assert(ReverseDelete((\"abcdedcba\"), (\"\")).Equals((Tuple.Create(\"abcdedcba\", true))));\n Debug.Assert(ReverseDelete((\"abcdedcba\"), (\"v\")).Equals((Tuple.Create(\"abcdedcba\", true))));\n Debug.Assert(ReverseDelete((\"vabba\"), (\"v\")).Equals((Tuple.Create(\"abba\", true))));\n Debug.Assert(ReverseDelete((\"mamma\"), (\"mia\")).Equals((Tuple.Create(\"\", true))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n public static string FlipCase(string str) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FlipCase((\"\")).Equals((\"\")));\n Debug.Assert(FlipCase((\"Hello!\")).Equals((\"hELLO!\")));\n Debug.Assert(FlipCase((\"These violent delights have violent ends\")).Equals((\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a string s.\n // if s[i] is a letter, reverse its case from lower to upper or vise versa, \n // otherwise keep it as it is.\n // If the string contains no letters, reverse the string.\n // The function should return the resulted string.\n // Examples\n public static string Solve(string s) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Solve((\"AsDf\")).Equals((\"aSdF\")));\n Debug.Assert(Solve((\"1234\")).Equals((\"4321\")));\n Debug.Assert(Solve((\"ab\")).Equals((\"AB\")));\n Debug.Assert(Solve((\"#a@C\")).Equals((\"#A@c\")));\n Debug.Assert(Solve((\"#AsdfW^45\")).Equals((\"#aSDFw^45\")));\n Debug.Assert(Solve((\"#6@2\")).Equals((\"2@6#\")));\n Debug.Assert(Solve((\"#$a^D\")).Equals((\"#$A^d\")));\n Debug.Assert(Solve((\"#ccc\")).Equals((\"#CCC\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Filter an input list of strings only for ones that start with a given prefix.\n public static List FilterByPrefix(List strings, string prefix) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FilterByPrefix((new List()), (\"john\")).Equals((new List())));\n Debug.Assert(FilterByPrefix((new List(new string[]{(string)\"xxx\", (string)\"asd\", (string)\"xxy\", (string)\"john doe\", (string)\"xxxAAA\", (string)\"xxx\"})), (\"xxx\")).Equals((new List(new string[]{(string)\"xxx\", (string)\"xxxAAA\", (string)\"xxx\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // This function takes two positive numbers x and y and returns the\n // biggest even integer number that is in the range [x, y] inclusive. If \n // there's no such number, then the function should return -1.\n // For example:\n public static long ChooseNum(long x, long y) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ChooseNum((12L), (15L)) == (14L));\n Debug.Assert(ChooseNum((13L), (12L)) == (-1L));\n Debug.Assert(ChooseNum((33L), (12354L)) == (12354L));\n Debug.Assert(ChooseNum((5234L), (5233L)) == (-1L));\n Debug.Assert(ChooseNum((6L), (29L)) == (28L));\n Debug.Assert(ChooseNum((27L), (10L)) == (-1L));\n Debug.Assert(ChooseNum((7L), (7L)) == (-1L));\n Debug.Assert(ChooseNum((546L), (546L)) == (546L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a string representing a sentence,\n // the sentence contains some words separated by a space,\n // and you have to return a string that contains the words from the original sentence,\n // whose lengths are prime numbers,\n // the order of the words in the new string should be the same as the original one.\n // Example 1:\n // Example 2:\n // Constraints:\n // * 1 <= len(sentence) <= 100\n // * sentence contains only letters\n public static string WordsInSentence(string sentence) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(WordsInSentence((\"This is a test\")).Equals((\"is\")));\n Debug.Assert(WordsInSentence((\"lets go for swimming\")).Equals((\"go for\")));\n Debug.Assert(WordsInSentence((\"there is no place available here\")).Equals((\"there is no place\")));\n Debug.Assert(WordsInSentence((\"Hi I am Hussein\")).Equals((\"Hi am Hussein\")));\n Debug.Assert(WordsInSentence((\"go for it\")).Equals((\"go for it\")));\n Debug.Assert(WordsInSentence((\"here\")).Equals((\"\")));\n Debug.Assert(WordsInSentence((\"here is\")).Equals((\"is\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n public static List Intersperse(List numbers, long delimeter) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Intersperse((new List()), (7L)).Equals((new List())));\n Debug.Assert(Intersperse((new List(new long[]{(long)5L, (long)6L, (long)3L, (long)2L})), (8L)).Equals((new List(new long[]{(long)5L, (long)8L, (long)6L, (long)8L, (long)3L, (long)8L, (long)2L}))));\n Debug.Assert(Intersperse((new List(new long[]{(long)2L, (long)2L, (long)2L})), (2L)).Equals((new List(new long[]{(long)2L, (long)2L, (long)2L, (long)2L, (long)2L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Your task is to write a function that returns true if a number x is a simple\n // power of n and false in other cases.\n // x is a simple power of n if n**int=x\n // For example:\n public static bool IsSimplePower(long x, long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsSimplePower((16L), (2L)) == (true));\n Debug.Assert(IsSimplePower((143214L), (16L)) == (false));\n Debug.Assert(IsSimplePower((4L), (2L)) == (true));\n Debug.Assert(IsSimplePower((9L), (3L)) == (true));\n Debug.Assert(IsSimplePower((16L), (4L)) == (true));\n Debug.Assert(IsSimplePower((24L), (2L)) == (false));\n Debug.Assert(IsSimplePower((128L), (4L)) == (false));\n Debug.Assert(IsSimplePower((12L), (6L)) == (false));\n Debug.Assert(IsSimplePower((1L), (1L)) == (true));\n Debug.Assert(IsSimplePower((1L), (12L)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that returns true if the given number is the multiplication of 3 prime numbers\n // and false otherwise.\n // Knowing that (a) is less then 100. \n // Example:\n // 30 = 2 * 3 * 5\n public static bool IsMultiplyPrime(long a) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsMultiplyPrime((5L)) == (false));\n Debug.Assert(IsMultiplyPrime((30L)) == (true));\n Debug.Assert(IsMultiplyPrime((8L)) == (true));\n Debug.Assert(IsMultiplyPrime((10L)) == (false));\n Debug.Assert(IsMultiplyPrime((125L)) == (true));\n Debug.Assert(IsMultiplyPrime((105L)) == (true));\n Debug.Assert(IsMultiplyPrime((126L)) == (false));\n Debug.Assert(IsMultiplyPrime((729L)) == (false));\n Debug.Assert(IsMultiplyPrime((891L)) == (false));\n Debug.Assert(IsMultiplyPrime((1001L)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given the lengths of the three sides of a triangle. Return True if the three\n // sides form a right-angled triangle, False otherwise.\n // A right-angled triangle is a triangle in which one angle is right angle or \n // 90 degree.\n // Example:\n public static bool RightAngleTriangle(long a, long b, long c) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(RightAngleTriangle((3L), (4L), (5L)) == (true));\n Debug.Assert(RightAngleTriangle((1L), (2L), (3L)) == (false));\n Debug.Assert(RightAngleTriangle((10L), (6L), (8L)) == (true));\n Debug.Assert(RightAngleTriangle((2L), (2L), (2L)) == (false));\n Debug.Assert(RightAngleTriangle((7L), (24L), (25L)) == (true));\n Debug.Assert(RightAngleTriangle((10L), (5L), (7L)) == (false));\n Debug.Assert(RightAngleTriangle((5L), (12L), (13L)) == (true));\n Debug.Assert(RightAngleTriangle((15L), (8L), (17L)) == (true));\n Debug.Assert(RightAngleTriangle((48L), (55L), (73L)) == (true));\n Debug.Assert(RightAngleTriangle((1L), (1L), (1L)) == (false));\n Debug.Assert(RightAngleTriangle((2L), (2L), (10L)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function that takes 3 numbers.\n // Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n // Returns false in any other cases.\n // Examples\n public static bool AnyInt(float x, float y, float z) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(AnyInt((float)2L, (float)3L, (float)1L) == (true));\n Debug.Assert(AnyInt((2.5f), (float)2L, (float)3L) == (false));\n Debug.Assert(AnyInt((1.5f), (float)5L, (3.5f)) == (false));\n Debug.Assert(AnyInt((float)2L, (float)6L, (float)2L) == (false));\n Debug.Assert(AnyInt((float)4L, (float)2L, (float)2L) == (true));\n Debug.Assert(AnyInt((2.2f), (2.2f), (2.2f)) == (false));\n Debug.Assert(AnyInt((float)-4L, (float)6L, (float)2L) == (true));\n Debug.Assert(AnyInt((float)2L, (float)1L, (float)1L) == (true));\n Debug.Assert(AnyInt((float)3L, (float)4L, (float)7L) == (true));\n Debug.Assert(AnyInt((3.0f), (float)4L, (float)7L) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // This function takes a list l and returns a list l' such that\n // l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n // to the values of the corresponding indicies of l, but sorted.\n public static List SortThird(List l) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SortThird((new List(new long[]{(long)5L, (long)6L, (long)3L, (long)4L, (long)8L, (long)9L, (long)2L}))).Equals((new List(new long[]{(long)2L, (long)6L, (long)3L, (long)4L, (long)8L, (long)9L, (long)5L}))));\n Debug.Assert(SortThird((new List(new long[]{(long)5L, (long)8L, (long)3L, (long)4L, (long)6L, (long)9L, (long)2L}))).Equals((new List(new long[]{(long)2L, (long)8L, (long)3L, (long)4L, (long)6L, (long)9L, (long)5L}))));\n Debug.Assert(SortThird((new List(new long[]{(long)5L, (long)6L, (long)9L, (long)4L, (long)8L, (long)3L, (long)2L}))).Equals((new List(new long[]{(long)2L, (long)6L, (long)9L, (long)4L, (long)8L, (long)3L, (long)5L}))));\n Debug.Assert(SortThird((new List(new long[]{(long)5L, (long)6L, (long)3L, (long)4L, (long)8L, (long)9L, (long)2L, (long)1L}))).Equals((new List(new long[]{(long)2L, (long)6L, (long)3L, (long)4L, (long)8L, (long)9L, (long)5L, (long)1L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_53_add", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Add two numbers x and y\n public static long Add(long x, long y) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Add((0L), (1L)) == (1L));\n Debug.Assert(Add((1L), (0L)) == (1L));\n Debug.Assert(Add((2L), (3L)) == (5L));\n Debug.Assert(Add((5L), (7L)) == (12L));\n Debug.Assert(Add((7L), (5L)) == (12L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_69_search", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n // zero, and has a frequency greater than or equal to the value of the integer itself. \n // The frequency of an integer is the number of times it appears in the list.\n // If no such a value exist, return -1.\n // Examples:\n public static long Search(List lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Search((new List(new long[]{(long)5L, (long)5L, (long)5L, (long)5L, (long)1L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)4L, (long)1L, (long)4L, (long)1L, (long)4L, (long)4L}))) == (4L));\n Debug.Assert(Search((new List(new long[]{(long)3L, (long)3L}))) == (-1L));\n Debug.Assert(Search((new List(new long[]{(long)8L, (long)8L, (long)8L, (long)8L, (long)8L, (long)8L, (long)8L, (long)8L}))) == (8L));\n Debug.Assert(Search((new List(new long[]{(long)2L, (long)3L, (long)3L, (long)2L, (long)2L}))) == (2L));\n Debug.Assert(Search((new List(new long[]{(long)2L, (long)7L, (long)8L, (long)8L, (long)4L, (long)8L, (long)7L, (long)3L, (long)9L, (long)6L, (long)5L, (long)10L, (long)4L, (long)3L, (long)6L, (long)7L, (long)1L, (long)7L, (long)4L, (long)10L, (long)8L, (long)1L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)3L, (long)2L, (long)8L, (long)2L}))) == (2L));\n Debug.Assert(Search((new List(new long[]{(long)6L, (long)7L, (long)1L, (long)8L, (long)8L, (long)10L, (long)5L, (long)8L, (long)5L, (long)3L, (long)10L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)8L, (long)8L, (long)3L, (long)6L, (long)5L, (long)6L, (long)4L}))) == (-1L));\n Debug.Assert(Search((new List(new long[]{(long)6L, (long)9L, (long)6L, (long)7L, (long)1L, (long)4L, (long)7L, (long)1L, (long)8L, (long)8L, (long)9L, (long)8L, (long)10L, (long)10L, (long)8L, (long)4L, (long)10L, (long)4L, (long)10L, (long)1L, (long)2L, (long)9L, (long)5L, (long)7L, (long)9L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)1L, (long)9L, (long)10L, (long)1L, (long)3L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)6L, (long)9L, (long)7L, (long)5L, (long)8L, (long)7L, (long)5L, (long)3L, (long)7L, (long)5L, (long)10L, (long)10L, (long)3L, (long)6L, (long)10L, (long)2L, (long)8L, (long)6L, (long)5L, (long)4L, (long)9L, (long)5L, (long)3L, (long)10L}))) == (5L));\n Debug.Assert(Search((new List(new long[]{(long)1L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)8L, (long)8L, (long)10L, (long)6L, (long)4L, (long)3L, (long)5L, (long)8L, (long)2L, (long)4L, (long)2L, (long)8L, (long)4L, (long)6L, (long)10L, (long)4L, (long)2L, (long)1L, (long)10L, (long)2L, (long)1L, (long)1L, (long)5L}))) == (4L));\n Debug.Assert(Search((new List(new long[]{(long)2L, (long)10L, (long)4L, (long)8L, (long)2L, (long)10L, (long)5L, (long)1L, (long)2L, (long)9L, (long)5L, (long)5L, (long)6L, (long)3L, (long)8L, (long)6L, (long)4L, (long)10L}))) == (2L));\n Debug.Assert(Search((new List(new long[]{(long)1L, (long)6L, (long)10L, (long)1L, (long)6L, (long)9L, (long)10L, (long)8L, (long)6L, (long)8L, (long)7L, (long)3L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)9L, (long)2L, (long)4L, (long)1L, (long)5L, (long)1L, (long)5L, (long)2L, (long)5L, (long)7L, (long)7L, (long)7L, (long)3L, (long)10L, (long)1L, (long)5L, (long)4L, (long)2L, (long)8L, (long)4L, (long)1L, (long)9L, (long)10L, (long)7L, (long)10L, (long)2L, (long)8L, (long)10L, (long)9L, (long)4L}))) == (4L));\n Debug.Assert(Search((new List(new long[]{(long)2L, (long)6L, (long)4L, (long)2L, (long)8L, (long)7L, (long)5L, (long)6L, (long)4L, (long)10L, (long)4L, (long)6L, (long)3L, (long)7L, (long)8L, (long)8L, (long)3L, (long)1L, (long)4L, (long)2L, (long)2L, (long)10L, (long)7L}))) == (4L));\n Debug.Assert(Search((new List(new long[]{(long)9L, (long)8L, (long)6L, (long)10L, (long)2L, (long)6L, (long)10L, (long)2L, (long)7L, (long)8L, (long)10L, (long)3L, (long)8L, (long)2L, (long)6L, (long)2L, (long)3L, (long)1L}))) == (2L));\n Debug.Assert(Search((new List(new long[]{(long)5L, (long)5L, (long)3L, (long)9L, (long)5L, (long)6L, (long)3L, (long)2L, (long)8L, (long)5L, (long)6L, (long)10L, (long)10L, (long)6L, (long)8L, (long)4L, (long)10L, (long)7L, (long)7L, (long)10L, (long)8L}))) == (-1L));\n Debug.Assert(Search((new List(new long[]{(long)10L}))) == (-1L));\n Debug.Assert(Search((new List(new long[]{(long)9L, (long)7L, (long)7L, (long)2L, (long)4L, (long)7L, (long)2L, (long)10L, (long)9L, (long)7L, (long)5L, (long)7L, (long)2L}))) == (2L));\n Debug.Assert(Search((new List(new long[]{(long)5L, (long)4L, (long)10L, (long)2L, (long)1L, (long)1L, (long)10L, (long)3L, (long)6L, (long)1L, (long)8L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)7L, (long)9L, (long)9L, (long)9L, (long)3L, (long)4L, (long)1L, (long)5L, (long)9L, (long)1L, (long)2L, (long)1L, (long)1L, (long)10L, (long)7L, (long)5L, (long)6L, (long)7L, (long)6L, (long)7L, (long)7L, (long)6L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)3L, (long)10L, (long)10L, (long)9L, (long)2L}))) == (-1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that takes a string and returns True if the string\n // length is a prime number or False otherwise\n // Examples\n public static bool PrimeLength(string str) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(PrimeLength((\"Hello\")) == (true));\n Debug.Assert(PrimeLength((\"abcdcba\")) == (true));\n Debug.Assert(PrimeLength((\"kittens\")) == (true));\n Debug.Assert(PrimeLength((\"orange\")) == (false));\n Debug.Assert(PrimeLength((\"wow\")) == (true));\n Debug.Assert(PrimeLength((\"world\")) == (true));\n Debug.Assert(PrimeLength((\"MadaM\")) == (true));\n Debug.Assert(PrimeLength((\"Wow\")) == (true));\n Debug.Assert(PrimeLength((\"\")) == (false));\n Debug.Assert(PrimeLength((\"HI\")) == (true));\n Debug.Assert(PrimeLength((\"go\")) == (true));\n Debug.Assert(PrimeLength((\"gogo\")) == (false));\n Debug.Assert(PrimeLength((\"aaaaaaaaaaaaaaa\")) == (false));\n Debug.Assert(PrimeLength((\"Madam\")) == (true));\n Debug.Assert(PrimeLength((\"M\")) == (false));\n Debug.Assert(PrimeLength((\"0\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_58_common", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return sorted unique common elements for two lists.\n public static List Common(List l1, List l2) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Common((new List(new long[]{(long)1L, (long)4L, (long)3L, (long)34L, (long)653L, (long)2L, (long)5L})), (new List(new long[]{(long)5L, (long)7L, (long)1L, (long)5L, (long)9L, (long)653L, (long)121L}))).Equals((new List(new long[]{(long)1L, (long)5L, (long)653L}))));\n Debug.Assert(Common((new List(new long[]{(long)5L, (long)3L, (long)2L, (long)8L})), (new List(new long[]{(long)3L, (long)2L}))).Equals((new List(new long[]{(long)2L, (long)3L}))));\n Debug.Assert(Common((new List(new long[]{(long)4L, (long)3L, (long)2L, (long)8L})), (new List(new long[]{(long)3L, (long)2L, (long)4L}))).Equals((new List(new long[]{(long)2L, (long)3L, (long)4L}))));\n Debug.Assert(Common((new List(new long[]{(long)4L, (long)3L, (long)2L, (long)8L})), (new List())).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // The Brazilian factorial is defined as:\n // brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n // where n > 0\n // For example:\n // The function will receive an integer as input and should return the special\n // factorial of this integer.\n public static long SpecialFactorial(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SpecialFactorial((4L)) == (288L));\n Debug.Assert(SpecialFactorial((5L)) == (34560L));\n Debug.Assert(SpecialFactorial((7L)) == (125411328000L));\n Debug.Assert(SpecialFactorial((1L)) == (1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // In this problem, you will implement a function that takes two lists of numbers,\n // and determines whether it is possible to perform an exchange of elements\n // between them to make lst1 a list of only even numbers.\n // There is no limit on the number of exchanged elements between lst1 and lst2.\n // If it is possible to exchange elements between the lst1 and lst2 to make\n // all the elements of lst1 to be even, return \"YES\".\n // Otherwise, return \"NO\".\n // For example:\n // It is assumed that the input lists will be non-empty.\n public static string Exchange(List lst1, List lst2) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Exchange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L})), (new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))).Equals((\"YES\")));\n Debug.Assert(Exchange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L})), (new List(new long[]{(long)1L, (long)5L, (long)3L, (long)4L}))).Equals((\"NO\")));\n Debug.Assert(Exchange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L})), (new List(new long[]{(long)2L, (long)1L, (long)4L, (long)3L}))).Equals((\"YES\")));\n Debug.Assert(Exchange((new List(new long[]{(long)5L, (long)7L, (long)3L})), (new List(new long[]{(long)2L, (long)6L, (long)4L}))).Equals((\"YES\")));\n Debug.Assert(Exchange((new List(new long[]{(long)5L, (long)7L, (long)3L})), (new List(new long[]{(long)2L, (long)6L, (long)3L}))).Equals((\"NO\")));\n Debug.Assert(Exchange((new List(new long[]{(long)3L, (long)2L, (long)6L, (long)1L, (long)8L, (long)9L})), (new List(new long[]{(long)3L, (long)5L, (long)5L, (long)1L, (long)1L, (long)1L}))).Equals((\"NO\")));\n Debug.Assert(Exchange((new List(new long[]{(long)100L, (long)200L})), (new List(new long[]{(long)200L, (long)200L}))).Equals((\"YES\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a non-empty array of integers arr and an integer k, return\n // the sum of the elements with at most two digits from the first k elements of arr.\n // Example:\n // Constraints:\n // 1. 1 <= len(arr) <= 100\n // 2. 1 <= k <= len(arr)\n public static long AddElements(List arr, long k) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(AddElements((new List(new long[]{(long)1L, (long)-2L, (long)-3L, (long)41L, (long)57L, (long)76L, (long)87L, (long)88L, (long)99L})), (3L)) == (-4L));\n Debug.Assert(AddElements((new List(new long[]{(long)111L, (long)121L, (long)3L, (long)4000L, (long)5L, (long)6L})), (2L)) == (0L));\n Debug.Assert(AddElements((new List(new long[]{(long)11L, (long)21L, (long)3L, (long)90L, (long)5L, (long)6L, (long)7L, (long)8L, (long)9L})), (4L)) == (125L));\n Debug.Assert(AddElements((new List(new long[]{(long)111L, (long)21L, (long)3L, (long)4000L, (long)5L, (long)6L, (long)7L, (long)8L, (long)9L})), (4L)) == (24L));\n Debug.Assert(AddElements((new List(new long[]{(long)1L})), (1L)) == (1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // A simple program which should return the value of x if n is \n // a prime number and should return the value of y otherwise.\n // Examples:\n public static long XOrY(long n, long x, long y) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(XOrY((7L), (34L), (12L)) == (34L));\n Debug.Assert(XOrY((15L), (8L), (5L)) == (5L));\n Debug.Assert(XOrY((3L), (33L), (5212L)) == (33L));\n Debug.Assert(XOrY((1259L), (3L), (52L)) == (3L));\n Debug.Assert(XOrY((7919L), (-1L), (12L)) == (-1L));\n Debug.Assert(XOrY((3609L), (1245L), (583L)) == (583L));\n Debug.Assert(XOrY((91L), (56L), (129L)) == (129L));\n Debug.Assert(XOrY((6L), (34L), (1234L)) == (1234L));\n Debug.Assert(XOrY((1L), (2L), (0L)) == (0L));\n Debug.Assert(XOrY((2L), (2L), (0L)) == (2L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given length of a side and high return area for a triangle.\n public static float TriangleArea(long a, long h) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(TriangleArea((5L), (3L)) == (7.5f));\n Debug.Assert(TriangleArea((2L), (2L)) == (2.0f));\n Debug.Assert(TriangleArea((10L), (8L)) == (40.0f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n // the last couple centuries. However, what people don't know is Tribonacci sequence.\n // Tribonacci sequence is defined by the recurrence:\n // tri(1) = 3\n // tri(n) = 1 + n / 2, if n is even.\n // tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n // For example:\n // tri(2) = 1 + (2 / 2) = 2\n // tri(4) = 3\n // tri(3) = tri(2) + tri(1) + tri(4)\n // = 2 + 3 + 3 = 8 \n // You are given a non-negative integer number n, you have to a return a list of the \n // first n + 1 numbers of the Tribonacci sequence.\n // Examples:\n public static List Tri(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Tri((3L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L}))));\n Debug.Assert(Tri((4L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L, (long)3L}))));\n Debug.Assert(Tri((5L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L, (long)3L, (long)15L}))));\n Debug.Assert(Tri((6L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L, (long)3L, (long)15L, (long)4L}))));\n Debug.Assert(Tri((7L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L, (long)3L, (long)15L, (long)4L, (long)24L}))));\n Debug.Assert(Tri((8L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L, (long)3L, (long)15L, (long)4L, (long)24L, (long)5L}))));\n Debug.Assert(Tri((9L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L, (long)3L, (long)15L, (long)4L, (long)24L, (long)5L, (long)35L}))));\n Debug.Assert(Tri((20L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L, (long)3L, (long)15L, (long)4L, (long)24L, (long)5L, (long)35L, (long)6L, (long)48L, (long)7L, (long)63L, (long)8L, (long)80L, (long)9L, (long)99L, (long)10L, (long)120L, (long)11L}))));\n Debug.Assert(Tri((0L)).Equals((new List(new long[]{(long)1L}))));\n Debug.Assert(Tri((1L)).Equals((new List(new long[]{(long)1L, (long)3L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a list of two strings, both strings consist of open\n // parentheses '(' or close parentheses ')' only.\n // Your job is to check if it is possible to concatenate the two strings in\n // some order, that the resulting string will be good.\n // A string S is considered to be good if and only if all parentheses in S\n // are balanced. For example: the string '(())()' is good, while the string\n // '())' is not.\n // Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n // Examples:\n public static string MatchParens(List lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(MatchParens((new List(new string[]{(string)\"()(\", (string)\")\"}))).Equals((\"Yes\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\")\", (string)\")\"}))).Equals((\"No\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\"(()(())\", (string)\"())())\"}))).Equals((\"No\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\")())\", (string)\"(()()(\"}))).Equals((\"Yes\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\"(())))\", (string)\"(()())((\"}))).Equals((\"Yes\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\"()\", (string)\"())\"}))).Equals((\"No\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\"(()(\", (string)\"()))()\"}))).Equals((\"Yes\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\"((((\", (string)\"((())\"}))).Equals((\"No\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\")(()\", (string)\"(()(\"}))).Equals((\"No\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\")(\", (string)\")(\"}))).Equals((\"No\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\"(\", (string)\")\"}))).Equals((\"Yes\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\")\", (string)\"(\"}))).Equals((\"Yes\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // From a list of integers, remove all elements that occur more than once.\n // Keep order of elements left the same as in the input.\n public static List RemoveDuplicates(List numbers) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(RemoveDuplicates((new List())).Equals((new List())));\n Debug.Assert(RemoveDuplicates((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))).Equals((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))));\n Debug.Assert(RemoveDuplicates((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)2L, (long)4L, (long)3L, (long)5L}))).Equals((new List(new long[]{(long)1L, (long)4L, (long)5L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return a greatest common divisor of two integers a and b\n public static long GreatestCommonDivisor(long a, long b) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(GreatestCommonDivisor((3L), (7L)) == (1L));\n Debug.Assert(GreatestCommonDivisor((10L), (15L)) == (5L));\n Debug.Assert(GreatestCommonDivisor((49L), (14L)) == (7L));\n Debug.Assert(GreatestCommonDivisor((144L), (60L)) == (12L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Checks if given string is a palindrome\n public static bool IsPalindrome(string text) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsPalindrome((\"\")) == (true));\n Debug.Assert(IsPalindrome((\"aba\")) == (true));\n Debug.Assert(IsPalindrome((\"aaaaa\")) == (true));\n Debug.Assert(IsPalindrome((\"zbcd\")) == (false));\n Debug.Assert(IsPalindrome((\"xywyx\")) == (true));\n Debug.Assert(IsPalindrome((\"xywyz\")) == (false));\n Debug.Assert(IsPalindrome((\"xywzx\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // xs represent coefficients of a polynomial.\n // xs[0] + xs[1] * x + xs[2] * x^2 + ....\n // Return derivative of this polynomial in the same form.\n public static List Derivative(List xs) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Derivative((new List(new long[]{(long)3L, (long)1L, (long)2L, (long)4L, (long)5L}))).Equals((new List(new long[]{(long)1L, (long)4L, (long)12L, (long)20L}))));\n Debug.Assert(Derivative((new List(new long[]{(long)1L, (long)2L, (long)3L}))).Equals((new List(new long[]{(long)2L, (long)6L}))));\n Debug.Assert(Derivative((new List(new long[]{(long)3L, (long)2L, (long)1L}))).Equals((new List(new long[]{(long)2L, (long)2L}))));\n Debug.Assert(Derivative((new List(new long[]{(long)3L, (long)2L, (long)1L, (long)0L, (long)4L}))).Equals((new List(new long[]{(long)2L, (long)2L, (long)0L, (long)16L}))));\n Debug.Assert(Derivative((new List(new long[]{(long)1L}))).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // In this task, you will be given a string that represents a number of apples and oranges \n // that are distributed in a basket of fruit this basket contains \n // apples, oranges, and mango fruits. Given the string that represents the total number of \n // the oranges and apples and an integer that represent the total number of the fruits \n // in the basket return the number of the mango fruits in the basket.\n // for examble:\n public static long FruitDistribution(string s, long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FruitDistribution((\"5 apples and 6 oranges\"), (19L)) == (8L));\n Debug.Assert(FruitDistribution((\"5 apples and 6 oranges\"), (21L)) == (10L));\n Debug.Assert(FruitDistribution((\"0 apples and 1 oranges\"), (3L)) == (2L));\n Debug.Assert(FruitDistribution((\"1 apples and 0 oranges\"), (3L)) == (2L));\n Debug.Assert(FruitDistribution((\"2 apples and 3 oranges\"), (100L)) == (95L));\n Debug.Assert(FruitDistribution((\"2 apples and 3 oranges\"), (5L)) == (0L));\n Debug.Assert(FruitDistribution((\"1 apples and 100 oranges\"), (120L)) == (19L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that takes an integer a and returns True \n // if this ingeger is a cube of some integer number.\n // Note: you may assume the input is always valid.\n // Examples:\n public static bool Iscube(long a) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Iscube((1L)) == (true));\n Debug.Assert(Iscube((2L)) == (false));\n Debug.Assert(Iscube((-1L)) == (true));\n Debug.Assert(Iscube((64L)) == (true));\n Debug.Assert(Iscube((180L)) == (false));\n Debug.Assert(Iscube((1000L)) == (true));\n Debug.Assert(Iscube((0L)) == (true));\n Debug.Assert(Iscube((1729L)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // In this Kata, you have to sort an array of non-negative integers according to\n // number of ones in their binary representation in ascending order.\n // For similar number of ones, sort based on decimal value.\n // It must be implemented like this:\n public static List SortArray(List arr) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SortArray((new List(new long[]{(long)1L, (long)5L, (long)2L, (long)3L, (long)4L}))).Equals((new List(new long[]{(long)1L, (long)2L, (long)4L, (long)3L, (long)5L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)-2L, (long)-3L, (long)-4L, (long)-5L, (long)-6L}))).Equals((new List(new long[]{(long)-4L, (long)-2L, (long)-6L, (long)-5L, (long)-3L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)1L, (long)0L, (long)2L, (long)3L, (long)4L}))).Equals((new List(new long[]{(long)0L, (long)1L, (long)2L, (long)4L, (long)3L}))));\n Debug.Assert(SortArray((new List())).Equals((new List())));\n Debug.Assert(SortArray((new List(new long[]{(long)2L, (long)5L, (long)77L, (long)4L, (long)5L, (long)3L, (long)5L, (long)7L, (long)2L, (long)3L, (long)4L}))).Equals((new List(new long[]{(long)2L, (long)2L, (long)4L, (long)4L, (long)3L, (long)3L, (long)5L, (long)5L, (long)5L, (long)7L, (long)77L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)3L, (long)6L, (long)44L, (long)12L, (long)32L, (long)5L}))).Equals((new List(new long[]{(long)32L, (long)3L, (long)5L, (long)6L, (long)12L, (long)44L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)2L, (long)4L, (long)8L, (long)16L, (long)32L}))).Equals((new List(new long[]{(long)2L, (long)4L, (long)8L, (long)16L, (long)32L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)2L, (long)4L, (long)8L, (long)16L, (long)32L}))).Equals((new List(new long[]{(long)2L, (long)4L, (long)8L, (long)16L, (long)32L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a list of strings, where each string consists of only digits, return a list.\n // Each element i of the output should be \"the number of odd elements in the\n // string i of the input.\" where all the i's should be replaced by the number\n // of odd digits in the i'th string of the input.\n public static List OddCount(List lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(OddCount((new List(new string[]{(string)\"1234567\"}))).Equals((new List(new string[]{(string)\"the number of odd elements 4n the str4ng 4 of the 4nput.\"}))));\n Debug.Assert(OddCount((new List(new string[]{(string)\"3\", (string)\"11111111\"}))).Equals((new List(new string[]{(string)\"the number of odd elements 1n the str1ng 1 of the 1nput.\", (string)\"the number of odd elements 8n the str8ng 8 of the 8nput.\"}))));\n Debug.Assert(OddCount((new List(new string[]{(string)\"271\", (string)\"137\", (string)\"314\"}))).Equals((new List(new string[]{(string)\"the number of odd elements 2n the str2ng 2 of the 2nput.\", (string)\"the number of odd elements 3n the str3ng 3 of the 3nput.\", (string)\"the number of odd elements 2n the str2ng 2 of the 2nput.\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // brackets is a string of \"(\" and \")\".\n // return True if every opening bracket has a corresponding closing bracket.\n public static bool CorrectBracketing(string brackets) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CorrectBracketing((\"()\")) == (true));\n Debug.Assert(CorrectBracketing((\"(()())\")) == (true));\n Debug.Assert(CorrectBracketing((\"()()(()())()\")) == (true));\n Debug.Assert(CorrectBracketing((\"()()((()()())())(()()(()))\")) == (true));\n Debug.Assert(CorrectBracketing((\"((()())))\")) == (false));\n Debug.Assert(CorrectBracketing((\")(()\")) == (false));\n Debug.Assert(CorrectBracketing((\"(\")) == (false));\n Debug.Assert(CorrectBracketing((\"((((\")) == (false));\n Debug.Assert(CorrectBracketing((\")\")) == (false));\n Debug.Assert(CorrectBracketing((\"(()\")) == (false));\n Debug.Assert(CorrectBracketing((\"()()(()())())(()\")) == (false));\n Debug.Assert(CorrectBracketing((\"()()(()())()))()\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Task\n // Write a function that takes a string as input and returns the sum of the upper characters only'\n // ASCII codes.\n // Examples:\n public static long Digitsum(string s) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Digitsum((\"\")) == (0L));\n Debug.Assert(Digitsum((\"abAB\")) == (131L));\n Debug.Assert(Digitsum((\"abcCd\")) == (67L));\n Debug.Assert(Digitsum((\"helloE\")) == (69L));\n Debug.Assert(Digitsum((\"woArBld\")) == (131L));\n Debug.Assert(Digitsum((\"aAaaaXa\")) == (153L));\n Debug.Assert(Digitsum((\" How are yOu?\")) == (151L));\n Debug.Assert(Digitsum((\"You arE Very Smart\")) == (327L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that accepts a list of strings as a parameter,\n // deletes the strings that have odd lengths from it,\n // and returns the resulted list with a sorted order,\n // The list is always a list of strings and never an array of numbers,\n // and it may contain duplicates.\n // The order of the list should be ascending by length of each word, and you\n // should return the list sorted by that rule.\n // If two words have the same length, sort the list alphabetically.\n // The function should return a list of strings in sorted order.\n // You may assume that all words will have the same length.\n // For example:\n public static List SortedListSum(List lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SortedListSum((new List(new string[]{(string)\"aa\", (string)\"a\", (string)\"aaa\"}))).Equals((new List(new string[]{(string)\"aa\"}))));\n Debug.Assert(SortedListSum((new List(new string[]{(string)\"school\", (string)\"AI\", (string)\"asdf\", (string)\"b\"}))).Equals((new List(new string[]{(string)\"AI\", (string)\"asdf\", (string)\"school\"}))));\n Debug.Assert(SortedListSum((new List(new string[]{(string)\"d\", (string)\"b\", (string)\"c\", (string)\"a\"}))).Equals((new List())));\n Debug.Assert(SortedListSum((new List(new string[]{(string)\"d\", (string)\"dcba\", (string)\"abcd\", (string)\"a\"}))).Equals((new List(new string[]{(string)\"abcd\", (string)\"dcba\"}))));\n Debug.Assert(SortedListSum((new List(new string[]{(string)\"AI\", (string)\"ai\", (string)\"au\"}))).Equals((new List(new string[]{(string)\"AI\", (string)\"ai\", (string)\"au\"}))));\n Debug.Assert(SortedListSum((new List(new string[]{(string)\"a\", (string)\"b\", (string)\"b\", (string)\"c\", (string)\"c\", (string)\"a\"}))).Equals((new List())));\n Debug.Assert(SortedListSum((new List(new string[]{(string)\"aaaa\", (string)\"bbbb\", (string)\"dd\", (string)\"cc\"}))).Equals((new List(new string[]{(string)\"cc\", (string)\"dd\", (string)\"aaaa\", (string)\"bbbb\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given an array arr of integers and you need to return\n // sum of magnitudes of integers multiplied by product of all signs\n // of each number in the array, represented by 1, -1 or 0.\n // Note: return None for empty arr.\n // Example:\n public static Nullable ProdSigns(List arr) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ProdSigns((new List(new long[]{(long)1L, (long)2L, (long)2L, (long)-4L}))).Equals(-9L));\n Debug.Assert(ProdSigns((new List(new long[]{(long)0L, (long)1L}))).Equals(0L));\n Debug.Assert(ProdSigns((new List(new long[]{(long)1L, (long)1L, (long)1L, (long)2L, (long)3L, (long)-1L, (long)1L}))).Equals(-10L));\n Debug.Assert(ProdSigns((new List())).Equals(null));\n Debug.Assert(ProdSigns((new List(new long[]{(long)2L, (long)4L, (long)1L, (long)2L, (long)-1L, (long)-1L, (long)9L}))).Equals(20L));\n Debug.Assert(ProdSigns((new List(new long[]{(long)-1L, (long)1L, (long)-1L, (long)1L}))).Equals(4L));\n Debug.Assert(ProdSigns((new List(new long[]{(long)-1L, (long)1L, (long)1L, (long)1L}))).Equals(-4L));\n Debug.Assert(ProdSigns((new List(new long[]{(long)-1L, (long)1L, (long)1L, (long)0L}))).Equals(0L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return list with elements incremented by 1.\n public static List IncrList(List l) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IncrList((new List())).Equals((new List())));\n Debug.Assert(IncrList((new List(new long[]{(long)3L, (long)2L, (long)1L}))).Equals((new List(new long[]{(long)4L, (long)3L, (long)2L}))));\n Debug.Assert(IncrList((new List(new long[]{(long)5L, (long)2L, (long)5L, (long)2L, (long)3L, (long)3L, (long)9L, (long)0L, (long)123L}))).Equals((new List(new long[]{(long)6L, (long)3L, (long)6L, (long)3L, (long)4L, (long)4L, (long)10L, (long)1L, (long)124L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // From a given list of integers, generate a list of rolling maximum element found until given moment\n // in the sequence.\n public static List RollingMax(List numbers) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(RollingMax((new List())).Equals((new List())));\n Debug.Assert(RollingMax((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))).Equals((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))));\n Debug.Assert(RollingMax((new List(new long[]{(long)4L, (long)3L, (long)2L, (long)1L}))).Equals((new List(new long[]{(long)4L, (long)4L, (long)4L, (long)4L}))));\n Debug.Assert(RollingMax((new List(new long[]{(long)3L, (long)2L, (long)3L, (long)100L, (long)3L}))).Equals((new List(new long[]{(long)3L, (long)3L, (long)3L, (long)100L, (long)100L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n // separate those group into separate strings and return the list of those.\n // Separate groups are balanced (each open brace is properly closed) and not nested within each other\n // Ignore any spaces in the input string.\n public static List SeparateParenGroups(string paren_string) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SeparateParenGroups((\"(()()) ((())) () ((())()())\")).Equals((new List(new string[]{(string)\"(()())\", (string)\"((()))\", (string)\"()\", (string)\"((())()())\"}))));\n Debug.Assert(SeparateParenGroups((\"() (()) ((())) (((())))\")).Equals((new List(new string[]{(string)\"()\", (string)\"(())\", (string)\"((()))\", (string)\"(((())))\"}))));\n Debug.Assert(SeparateParenGroups((\"(()(())((())))\")).Equals((new List(new string[]{(string)\"(()(())((())))\"}))));\n Debug.Assert(SeparateParenGroups((\"( ) (( )) (( )( ))\")).Equals((new List(new string[]{(string)\"()\", (string)\"(())\", (string)\"(()())\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You will be given a string of words separated by commas or spaces. Your task is\n // to split the string into words and return an array of the words.\n // For example:\n public static List WordsString(string s) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(WordsString((\"Hi, my name is John\")).Equals((new List(new string[]{(string)\"Hi\", (string)\"my\", (string)\"name\", (string)\"is\", (string)\"John\"}))));\n Debug.Assert(WordsString((\"One, two, three, four, five, six\")).Equals((new List(new string[]{(string)\"One\", (string)\"two\", (string)\"three\", (string)\"four\", (string)\"five\", (string)\"six\"}))));\n Debug.Assert(WordsString((\"Hi, my name\")).Equals((new List(new string[]{(string)\"Hi\", (string)\"my\", (string)\"name\"}))));\n Debug.Assert(WordsString((\"One,, two, three, four, five, six,\")).Equals((new List(new string[]{(string)\"One\", (string)\"two\", (string)\"three\", (string)\"four\", (string)\"five\", (string)\"six\"}))));\n Debug.Assert(WordsString((\"\")).Equals((new List())));\n Debug.Assert(WordsString((\"ahmed , gamal\")).Equals((new List(new string[]{(string)\"ahmed\", (string)\"gamal\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Filter given list of any python values only for integers\n public static List FilterIntegers(List values) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FilterIntegers((new List())).Equals((new List())));\n Debug.Assert(FilterIntegers((new List(new object[]{4L, new List(), 23.2f, 9L, \"adasd\"}))).Equals((new List(new long[]{(long)4L, (long)9L}))));\n Debug.Assert(FilterIntegers((new List(new object[]{3L, \"c\", 3L, 3L, \"a\", \"b\"}))).Equals((new List(new long[]{(long)3L, (long)3L, (long)3L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // This function takes a list l and returns a list l' such that\n // l' is identical to l in the odd indicies, while its values at the even indicies are equal\n // to the values of the even indicies of l, but sorted.\n public static List SortEven(List l) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SortEven((new List(new long[]{(long)1L, (long)2L, (long)3L}))).Equals((new List(new long[]{(long)1L, (long)2L, (long)3L}))));\n Debug.Assert(SortEven((new List(new long[]{(long)5L, (long)3L, (long)-5L, (long)2L, (long)-3L, (long)3L, (long)9L, (long)0L, (long)123L, (long)1L, (long)-10L}))).Equals((new List(new long[]{(long)-10L, (long)3L, (long)-5L, (long)2L, (long)-3L, (long)3L, (long)5L, (long)0L, (long)9L, (long)1L, (long)123L}))));\n Debug.Assert(SortEven((new List(new long[]{(long)5L, (long)8L, (long)-12L, (long)4L, (long)23L, (long)2L, (long)3L, (long)11L, (long)12L, (long)-10L}))).Equals((new List(new long[]{(long)-12L, (long)8L, (long)3L, (long)4L, (long)5L, (long)2L, (long)12L, (long)11L, (long)23L, (long)-10L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // I think we all remember that feeling when the result of some long-awaited\n // event is finally known. The feelings and thoughts you have at that moment are\n // definitely worth noting down and comparing.\n // Your task is to determine if a person correctly guessed the results of a number of matches.\n // You are given two arrays of scores and guesses of equal length, where each index shows a match. \n // Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n // the value is 0, and if not, the value is the absolute difference between the guess and the score.\n // example:\n public static List Compare(List game, List guess) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Compare((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)1L})), (new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)2L, (long)-2L}))).Equals((new List(new long[]{(long)0L, (long)0L, (long)0L, (long)0L, (long)3L, (long)3L}))));\n Debug.Assert(Compare((new List(new long[]{(long)0L, (long)0L, (long)0L, (long)0L, (long)0L, (long)0L})), (new List(new long[]{(long)0L, (long)0L, (long)0L, (long)0L, (long)0L, (long)0L}))).Equals((new List(new long[]{(long)0L, (long)0L, (long)0L, (long)0L, (long)0L, (long)0L}))));\n Debug.Assert(Compare((new List(new long[]{(long)1L, (long)2L, (long)3L})), (new List(new long[]{(long)-1L, (long)-2L, (long)-3L}))).Equals((new List(new long[]{(long)2L, (long)4L, (long)6L}))));\n Debug.Assert(Compare((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)5L})), (new List(new long[]{(long)-1L, (long)2L, (long)3L, (long)4L}))).Equals((new List(new long[]{(long)2L, (long)0L, (long)0L, (long)1L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a positive integer n, return a tuple that has the number of even and odd\n // integer palindromes that fall within the range(1, n), inclusive.\n // Example 1:\n // Explanation:\n // Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n // Example 2:\n // Explanation:\n // Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n // Note:\n // 1. 1 <= n <= 10^3\n // 2. returned tuple has the number of even and odd integer palindromes respectively.\n public static Tuple EvenOddPalindrome(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(EvenOddPalindrome((123L)).Equals((Tuple.Create(8L, 13L))));\n Debug.Assert(EvenOddPalindrome((12L)).Equals((Tuple.Create(4L, 6L))));\n Debug.Assert(EvenOddPalindrome((3L)).Equals((Tuple.Create(1L, 2L))));\n Debug.Assert(EvenOddPalindrome((63L)).Equals((Tuple.Create(6L, 8L))));\n Debug.Assert(EvenOddPalindrome((25L)).Equals((Tuple.Create(5L, 6L))));\n Debug.Assert(EvenOddPalindrome((19L)).Equals((Tuple.Create(4L, 6L))));\n Debug.Assert(EvenOddPalindrome((9L)).Equals((Tuple.Create(4L, 5L))));\n Debug.Assert(EvenOddPalindrome((1L)).Equals((Tuple.Create(0L, 1L))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n // fib4(0) -> 0\n // fib4(1) -> 0\n // fib4(2) -> 2\n // fib4(3) -> 0\n // fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n // Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n public static long Fib4(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Fib4((5L)) == (4L));\n Debug.Assert(Fib4((8L)) == (28L));\n Debug.Assert(Fib4((10L)) == (104L));\n Debug.Assert(Fib4((12L)) == (386L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given two positive integers a and b, return the even digits between a\n // and b, in ascending order.\n // For example:\n public static List GenerateIntegers(long a, long b) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(GenerateIntegers((2L), (10L)).Equals((new List(new long[]{(long)2L, (long)4L, (long)6L, (long)8L}))));\n Debug.Assert(GenerateIntegers((10L), (2L)).Equals((new List(new long[]{(long)2L, (long)4L, (long)6L, (long)8L}))));\n Debug.Assert(GenerateIntegers((132L), (2L)).Equals((new List(new long[]{(long)2L, (long)4L, (long)6L, (long)8L}))));\n Debug.Assert(GenerateIntegers((17L), (89L)).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // For a given list of input numbers, calculate Mean Absolute Deviation\n // around the mean of this dataset.\n // Mean Absolute Deviation is the average absolute difference between each\n // element and a centerpoint (mean in this case):\n // MAD = average | x - x_mean |\n public static float MeanAbsoluteDeviation(List numbers) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(MeanAbsoluteDeviation((new List(new float[]{(float)1.0f, (float)2.0f}))) == (0.5f));\n Debug.Assert(MeanAbsoluteDeviation((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f}))) == (1.0f));\n Debug.Assert(MeanAbsoluteDeviation((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f}))) == (1.2f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function encrypt that takes a string as an argument and\n // returns a string encrypted with the alphabet being rotated. \n // The alphabet should be rotated in a manner such that the letters \n // shift down by two multiplied to two places.\n // For example:\n public static string Encrypt(string s) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Encrypt((\"hi\")).Equals((\"lm\")));\n Debug.Assert(Encrypt((\"asdfghjkl\")).Equals((\"ewhjklnop\")));\n Debug.Assert(Encrypt((\"gf\")).Equals((\"kj\")));\n Debug.Assert(Encrypt((\"et\")).Equals((\"ix\")));\n Debug.Assert(Encrypt((\"faewfawefaewg\")).Equals((\"jeiajeaijeiak\")));\n Debug.Assert(Encrypt((\"hellomyfriend\")).Equals((\"lippsqcjvmirh\")));\n Debug.Assert(Encrypt((\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\")).Equals((\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\")));\n Debug.Assert(Encrypt((\"a\")).Equals((\"e\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n // The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n // as follows: start with any positive integer n. Then each term is obtained from the \n // previous term as follows: if the previous term is even, the next term is one half of \n // the previous term. If the previous term is odd, the next term is 3 times the previous\n // term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n // Note: \n // 1. Collatz(1) is [1].\n // 2. returned list sorted in increasing order.\n // For example:\n // get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n public static List GetOddCollatz(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(GetOddCollatz((14L)).Equals((new List(new long[]{(long)1L, (long)5L, (long)7L, (long)11L, (long)13L, (long)17L}))));\n Debug.Assert(GetOddCollatz((5L)).Equals((new List(new long[]{(long)1L, (long)5L}))));\n Debug.Assert(GetOddCollatz((12L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)5L}))));\n Debug.Assert(GetOddCollatz((1L)).Equals((new List(new long[]{(long)1L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Find how many times a given substring can be found in the original string. Count overlaping cases.\n public static long HowManyTimes(string str, string substring) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(HowManyTimes((\"\"), (\"x\")) == (0L));\n Debug.Assert(HowManyTimes((\"xyxyxyx\"), (\"x\")) == (4L));\n Debug.Assert(HowManyTimes((\"cacacacac\"), (\"cac\")) == (4L));\n Debug.Assert(HowManyTimes((\"john doe\"), (\"john\")) == (1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n // numbers in the array will be randomly ordered. Your task is to determine if\n // it is possible to get an array sorted in non-decreasing order by performing \n // the following operation on the given array:\n // You are allowed to perform right shift operation any number of times.\n // One right shift operation means shifting all elements of the array by one\n // position in the right direction. The last element of the array will be moved to\n // the starting position in the array i.e. 0th index. \n // If it is possible to obtain the sorted array by performing the above operation\n // then return True else return False.\n // If the given array is empty then return True.\n // Note: The given list is guaranteed to have unique elements.\n // For Example:\n // Explanation: By performin 2 right shift operations, non-decreasing order can\n // be achieved for the given array.\n // Explanation:It is not possible to get non-decreasing order for the given\n // array by performing any number of right shift operations.\n public static bool MoveOneBall(List arr) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(MoveOneBall((new List(new long[]{(long)3L, (long)4L, (long)5L, (long)1L, (long)2L}))) == (true));\n Debug.Assert(MoveOneBall((new List(new long[]{(long)3L, (long)5L, (long)10L, (long)1L, (long)2L}))) == (true));\n Debug.Assert(MoveOneBall((new List(new long[]{(long)4L, (long)3L, (long)1L, (long)2L}))) == (false));\n Debug.Assert(MoveOneBall((new List(new long[]{(long)3L, (long)5L, (long)4L, (long)1L, (long)2L}))) == (false));\n Debug.Assert(MoveOneBall((new List())) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function which sorts the given list of integers\n // in ascending order according to the sum of their digits.\n // Note: if there are several items with similar sum of their digits,\n // order them based on their index in original list.\n // For example:\n public static List OrderByPoints(List nums) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(OrderByPoints((new List(new long[]{(long)1L, (long)11L, (long)-1L, (long)-11L, (long)-12L}))).Equals((new List(new long[]{(long)-1L, (long)-11L, (long)1L, (long)-12L, (long)11L}))));\n Debug.Assert(OrderByPoints((new List(new long[]{(long)1234L, (long)423L, (long)463L, (long)145L, (long)2L, (long)423L, (long)423L, (long)53L, (long)6L, (long)37L, (long)3457L, (long)3L, (long)56L, (long)0L, (long)46L}))).Equals((new List(new long[]{(long)0L, (long)2L, (long)3L, (long)6L, (long)53L, (long)423L, (long)423L, (long)423L, (long)1234L, (long)145L, (long)37L, (long)46L, (long)56L, (long)463L, (long)3457L}))));\n Debug.Assert(OrderByPoints((new List())).Equals((new List())));\n Debug.Assert(OrderByPoints((new List(new long[]{(long)1L, (long)-11L, (long)-32L, (long)43L, (long)54L, (long)-98L, (long)2L, (long)-3L}))).Equals((new List(new long[]{(long)-3L, (long)-32L, (long)-98L, (long)-11L, (long)1L, (long)2L, (long)43L, (long)54L}))));\n Debug.Assert(OrderByPoints((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L, (long)7L, (long)8L, (long)9L, (long)10L, (long)11L}))).Equals((new List(new long[]{(long)1L, (long)10L, (long)2L, (long)11L, (long)3L, (long)4L, (long)5L, (long)6L, (long)7L, (long)8L, (long)9L}))));\n Debug.Assert(OrderByPoints((new List(new long[]{(long)0L, (long)6L, (long)6L, (long)-76L, (long)-21L, (long)23L, (long)4L}))).Equals((new List(new long[]{(long)-76L, (long)-21L, (long)0L, (long)4L, (long)23L, (long)6L, (long)6L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return list of prime factors of given integer in the order from smallest to largest.\n // Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n // Input number should be equal to the product of all factors\n public static List Factorize(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Factorize((2L)).Equals((new List(new long[]{(long)2L}))));\n Debug.Assert(Factorize((4L)).Equals((new List(new long[]{(long)2L, (long)2L}))));\n Debug.Assert(Factorize((8L)).Equals((new List(new long[]{(long)2L, (long)2L, (long)2L}))));\n Debug.Assert(Factorize((57L)).Equals((new List(new long[]{(long)3L, (long)19L}))));\n Debug.Assert(Factorize((3249L)).Equals((new List(new long[]{(long)3L, (long)3L, (long)19L, (long)19L}))));\n Debug.Assert(Factorize((185193L)).Equals((new List(new long[]{(long)3L, (long)3L, (long)3L, (long)19L, (long)19L, (long)19L}))));\n Debug.Assert(Factorize((20577L)).Equals((new List(new long[]{(long)3L, (long)19L, (long)19L, (long)19L}))));\n Debug.Assert(Factorize((18L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)3L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return True if all numbers in the list l are below threshold t.\n public static bool BelowThreshold(List l, long t) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(BelowThreshold((new List(new long[]{(long)1L, (long)2L, (long)4L, (long)10L})), (100L)) == (true));\n Debug.Assert(BelowThreshold((new List(new long[]{(long)1L, (long)20L, (long)4L, (long)10L})), (5L)) == (false));\n Debug.Assert(BelowThreshold((new List(new long[]{(long)1L, (long)20L, (long)4L, (long)10L})), (21L)) == (true));\n Debug.Assert(BelowThreshold((new List(new long[]{(long)1L, (long)20L, (long)4L, (long)10L})), (22L)) == (true));\n Debug.Assert(BelowThreshold((new List(new long[]{(long)1L, (long)8L, (long)4L, (long)10L})), (11L)) == (true));\n Debug.Assert(BelowThreshold((new List(new long[]{(long)1L, (long)8L, (long)4L, (long)10L})), (10L)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n // For each of the group, output the deepest level of nesting of parentheses.\n // E.g. (()()) has maximum two levels of nesting while ((())) has three.\n public static List ParseNestedParens(string paren_string) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ParseNestedParens((\"(()()) ((())) () ((())()())\")).Equals((new List(new long[]{(long)2L, (long)3L, (long)1L, (long)3L}))));\n Debug.Assert(ParseNestedParens((\"() (()) ((())) (((())))\")).Equals((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))));\n Debug.Assert(ParseNestedParens((\"(()(())((())))\")).Equals((new List(new long[]{(long)4L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n // Examples\n public static long Solution(List lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Solution((new List(new long[]{(long)5L, (long)8L, (long)7L, (long)1L}))) == (12L));\n Debug.Assert(Solution((new List(new long[]{(long)3L, (long)3L, (long)3L, (long)3L, (long)3L}))) == (9L));\n Debug.Assert(Solution((new List(new long[]{(long)30L, (long)13L, (long)24L, (long)321L}))) == (0L));\n Debug.Assert(Solution((new List(new long[]{(long)5L, (long)9L}))) == (5L));\n Debug.Assert(Solution((new List(new long[]{(long)2L, (long)4L, (long)8L}))) == (0L));\n Debug.Assert(Solution((new List(new long[]{(long)30L, (long)13L, (long)23L, (long)32L}))) == (23L));\n Debug.Assert(Solution((new List(new long[]{(long)3L, (long)13L, (long)2L, (long)9L}))) == (3L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a positive integer n. You have to create an integer array a of length n.\n // For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n // Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n // and a[i] + a[j] + a[k] is a multiple of 3.\n // Example :\n // Explanation: \n // a = [1, 3, 7, 13, 21]\n // The only valid triple is (1, 7, 13).\n public static long GetMaxTriples(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(GetMaxTriples((5L)) == (1L));\n Debug.Assert(GetMaxTriples((6L)) == (4L));\n Debug.Assert(GetMaxTriples((10L)) == (36L));\n Debug.Assert(GetMaxTriples((100L)) == (53361L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // There are eight planets in our solar system: the closerst to the Sun \n // is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n // Uranus, Neptune.\n // Write a function that takes two planet names as strings planet1 and planet2. \n // The function should return a tuple containing all planets whose orbits are \n // located between the orbit of planet1 and the orbit of planet2, sorted by \n // the proximity to the sun. \n // The function should return an empty tuple if planet1 or planet2\n // are not correct planet names. \n // Examples\n public static List Bf(string planet1, string planet2) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Bf((\"Jupiter\"), (\"Neptune\")).Equals((new List(new string[]{(string)\"Saturn\", (string)\"Uranus\"}))));\n Debug.Assert(Bf((\"Earth\"), (\"Mercury\")).Equals((new List(new string[]{(string)\"Venus\"}))));\n Debug.Assert(Bf((\"Mercury\"), (\"Uranus\")).Equals((new List(new string[]{(string)\"Venus\", (string)\"Earth\", (string)\"Mars\", (string)\"Jupiter\", (string)\"Saturn\"}))));\n Debug.Assert(Bf((\"Neptune\"), (\"Venus\")).Equals((new List(new string[]{(string)\"Earth\", (string)\"Mars\", (string)\"Jupiter\", (string)\"Saturn\", (string)\"Uranus\"}))));\n Debug.Assert(Bf((\"Earth\"), (\"Earth\")).Equals((new List())));\n Debug.Assert(Bf((\"Mars\"), (\"Earth\")).Equals((new List())));\n Debug.Assert(Bf((\"Jupiter\"), (\"Makemake\")).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a list of integers.\n // Write a function next_smallest() that returns the 2nd smallest element of the list.\n // Return None if there is no such element.\n public static Nullable NextSmallest(List lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(NextSmallest((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L}))).Equals(2L));\n Debug.Assert(NextSmallest((new List(new long[]{(long)5L, (long)1L, (long)4L, (long)3L, (long)2L}))).Equals(2L));\n Debug.Assert(NextSmallest((new List())).Equals(null));\n Debug.Assert(NextSmallest((new List(new long[]{(long)1L, (long)1L}))).Equals(null));\n Debug.Assert(NextSmallest((new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L, (long)0L}))).Equals(1L));\n Debug.Assert(NextSmallest((new List(new long[]{(long)1L, (long)1L}))).Equals(null));\n Debug.Assert(NextSmallest((new List(new long[]{(long)-35L, (long)34L, (long)12L, (long)-45L}))).Equals(-35L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Input is a space-delimited string of numberals from 'zero' to 'nine'.\n // Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n // Return the string with numbers sorted from smallest to largest\n public static string SortNumbers(string numbers) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SortNumbers((\"\")).Equals((\"\")));\n Debug.Assert(SortNumbers((\"three\")).Equals((\"three\")));\n Debug.Assert(SortNumbers((\"three five nine\")).Equals((\"three five nine\")));\n Debug.Assert(SortNumbers((\"five zero four seven nine eight\")).Equals((\"zero four five seven eight nine\")));\n Debug.Assert(SortNumbers((\"six five four three two one zero\")).Equals((\"zero one two three four five six\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n public static bool CycpatternCheck(string a, string b) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CycpatternCheck((\"xyzw\"), (\"xyw\")) == (false));\n Debug.Assert(CycpatternCheck((\"yello\"), (\"ell\")) == (true));\n Debug.Assert(CycpatternCheck((\"whattup\"), (\"ptut\")) == (false));\n Debug.Assert(CycpatternCheck((\"efef\"), (\"fee\")) == (true));\n Debug.Assert(CycpatternCheck((\"abab\"), (\"aabb\")) == (false));\n Debug.Assert(CycpatternCheck((\"winemtt\"), (\"tinem\")) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You will be given a number in decimal form and your task is to convert it to\n // binary format. The function should return a string, with each character representing a binary\n // number. Each character in the string will be '0' or '1'.\n // There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n // The extra characters are there to help with the format.\n // Examples:\n public static string DecimalToBinary(long decimalNum) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(DecimalToBinary((0L)).Equals((\"db0db\")));\n Debug.Assert(DecimalToBinary((32L)).Equals((\"db100000db\")));\n Debug.Assert(DecimalToBinary((103L)).Equals((\"db1100111db\")));\n Debug.Assert(DecimalToBinary((15L)).Equals((\"db1111db\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Filter an input list of strings only for ones that contain given substring\n public static List FilterBySubstring(List strings, string substring) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FilterBySubstring((new List()), (\"john\")).Equals((new List())));\n Debug.Assert(FilterBySubstring((new List(new string[]{(string)\"xxx\", (string)\"asd\", (string)\"xxy\", (string)\"john doe\", (string)\"xxxAAA\", (string)\"xxx\"})), (\"xxx\")).Equals((new List(new string[]{(string)\"xxx\", (string)\"xxxAAA\", (string)\"xxx\"}))));\n Debug.Assert(FilterBySubstring((new List(new string[]{(string)\"xxx\", (string)\"asd\", (string)\"aaaxxy\", (string)\"john doe\", (string)\"xxxAAA\", (string)\"xxx\"})), (\"xx\")).Equals((new List(new string[]{(string)\"xxx\", (string)\"aaaxxy\", (string)\"xxxAAA\", (string)\"xxx\"}))));\n Debug.Assert(FilterBySubstring((new List(new string[]{(string)\"grunt\", (string)\"trumpet\", (string)\"prune\", (string)\"gruesome\"})), (\"run\")).Equals((new List(new string[]{(string)\"grunt\", (string)\"prune\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given an integer. return a tuple that has the number of even and odd digits respectively.\n // Example:\n public static Tuple EvenOddCount(long num) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(EvenOddCount((7L)).Equals((Tuple.Create(0L, 1L))));\n Debug.Assert(EvenOddCount((-78L)).Equals((Tuple.Create(1L, 1L))));\n Debug.Assert(EvenOddCount((3452L)).Equals((Tuple.Create(2L, 2L))));\n Debug.Assert(EvenOddCount((346211L)).Equals((Tuple.Create(3L, 3L))));\n Debug.Assert(EvenOddCount((-345821L)).Equals((Tuple.Create(3L, 3L))));\n Debug.Assert(EvenOddCount((-2L)).Equals((Tuple.Create(1L, 0L))));\n Debug.Assert(EvenOddCount((-45347L)).Equals((Tuple.Create(2L, 3L))));\n Debug.Assert(EvenOddCount((0L)).Equals((Tuple.Create(1L, 0L))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that accepts a list of strings.\n // The list contains different words. Return the word with maximum number\n // of unique characters. If multiple strings have maximum number of unique\n // characters, return the one which comes first in lexicographical order.\n public static string FindMax(List words) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FindMax((new List(new string[]{(string)\"name\", (string)\"of\", (string)\"string\"}))).Equals((\"string\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"name\", (string)\"enam\", (string)\"game\"}))).Equals((\"enam\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"aaaaaaa\", (string)\"bb\", (string)\"cc\"}))).Equals((\"aaaaaaa\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"abc\", (string)\"cba\"}))).Equals((\"abc\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"play\", (string)\"this\", (string)\"game\", (string)\"of\", (string)\"footbott\"}))).Equals((\"footbott\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"we\", (string)\"are\", (string)\"gonna\", (string)\"rock\"}))).Equals((\"gonna\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"we\", (string)\"are\", (string)\"a\", (string)\"mad\", (string)\"nation\"}))).Equals((\"nation\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"this\", (string)\"is\", (string)\"a\", (string)\"prrk\"}))).Equals((\"this\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"b\"}))).Equals((\"b\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"play\", (string)\"play\", (string)\"play\"}))).Equals((\"play\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function that returns a tuple (a, b), where 'a' is\n // the largest of negative integers, and 'b' is the smallest\n // of positive integers in a list.\n // If there is no negative or positive integers, return them as None.\n // Examples:\n public static Tuple, Nullable> LargestSmallestIntegers(List lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)2L, (long)4L, (long)1L, (long)3L, (long)5L, (long)7L}))).Equals(Tuple.Create((Nullable)null, 1L)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)2L, (long)4L, (long)1L, (long)3L, (long)5L, (long)7L, (long)0L}))).Equals(Tuple.Create((Nullable)null, 1L)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)4L, (long)5L, (long)6L, (long)-2L}))).Equals(Tuple.Create(-2L, 1L)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)4L, (long)5L, (long)3L, (long)6L, (long)2L, (long)7L, (long)-7L}))).Equals(Tuple.Create(-7L, 2L)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)7L, (long)3L, (long)8L, (long)4L, (long)9L, (long)2L, (long)5L, (long)-9L}))).Equals(Tuple.Create(-9L, 2L)));\n Debug.Assert(LargestSmallestIntegers((new List())).Equals(Tuple.Create((Nullable)null, (Nullable)null)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)0L}))).Equals(Tuple.Create((Nullable)null, (Nullable)null)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)-1L, (long)-3L, (long)-5L, (long)-6L}))).Equals(Tuple.Create(-1L, (Nullable)null)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)-1L, (long)-3L, (long)-5L, (long)-6L, (long)0L}))).Equals(Tuple.Create(-1L, (Nullable)null)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)-6L, (long)-4L, (long)-4L, (long)-3L, (long)1L}))).Equals(Tuple.Create(-3L, 1L)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)-6L, (long)-4L, (long)-4L, (long)-3L, (long)-100L, (long)1L}))).Equals(Tuple.Create(-3L, 1L)));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // \"Given an array representing a branch of a tree that has non-negative integer nodes\n // your task is to pluck one of the nodes and return it.\n // The plucked node should be the node with the smallest even value.\n // If multiple nodes with the same smallest even value are found return the node that has smallest index.\n // The plucked node should be returned in a list, [ smalest_value, its index ],\n // If there are no even values or the given array is empty, return [].\n // Example 1:\n // Explanation: 2 has the smallest even value, and 2 has the smallest index.\n // Example 2:\n // Explanation: 2 has the smallest even value, and 2 has the smallest index.\n // Example 3:\n // Example 4:\n // Explanation: 0 is the smallest value, but there are two zeros,\n // so we will choose the first zero, which has the smallest index.\n // Constraints:\n // * 1 <= nodes.length <= 10000\n // * 0 <= node.value\n public static List Pluck(List arr) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Pluck((new List(new long[]{(long)4L, (long)2L, (long)3L}))).Equals((new List(new long[]{(long)2L, (long)1L}))));\n Debug.Assert(Pluck((new List(new long[]{(long)1L, (long)2L, (long)3L}))).Equals((new List(new long[]{(long)2L, (long)1L}))));\n Debug.Assert(Pluck((new List())).Equals((new List())));\n Debug.Assert(Pluck((new List(new long[]{(long)5L, (long)0L, (long)3L, (long)0L, (long)4L, (long)2L}))).Equals((new List(new long[]{(long)0L, (long)1L}))));\n Debug.Assert(Pluck((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)0L, (long)5L, (long)3L}))).Equals((new List(new long[]{(long)0L, (long)3L}))));\n Debug.Assert(Pluck((new List(new long[]{(long)5L, (long)4L, (long)8L, (long)4L, (long)8L}))).Equals((new List(new long[]{(long)4L, (long)1L}))));\n Debug.Assert(Pluck((new List(new long[]{(long)7L, (long)6L, (long)7L, (long)1L}))).Equals((new List(new long[]{(long)6L, (long)1L}))));\n Debug.Assert(Pluck((new List(new long[]{(long)7L, (long)9L, (long)7L, (long)1L}))).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function count_nums which takes an array of integers and returns\n // the number of elements which has a sum of digits > 0.\n // If a number is negative, then its first signed digit will be negative:\n // e.g. -123 has signed digits -1, 2, and 3.\n public static long CountNums(List arr) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CountNums((new List())) == (0L));\n Debug.Assert(CountNums((new List(new long[]{(long)-1L, (long)-2L, (long)0L}))) == (0L));\n Debug.Assert(CountNums((new List(new long[]{(long)1L, (long)1L, (long)2L, (long)-2L, (long)3L, (long)4L, (long)5L}))) == (6L));\n Debug.Assert(CountNums((new List(new long[]{(long)1L, (long)6L, (long)9L, (long)-6L, (long)0L, (long)1L, (long)5L}))) == (5L));\n Debug.Assert(CountNums((new List(new long[]{(long)1L, (long)100L, (long)98L, (long)-7L, (long)1L, (long)-1L}))) == (4L));\n Debug.Assert(CountNums((new List(new long[]{(long)12L, (long)23L, (long)34L, (long)-45L, (long)-56L, (long)0L}))) == (5L));\n Debug.Assert(CountNums((new List(new long[]{(long)0L, (long)1L}))) == (1L));\n Debug.Assert(CountNums((new List(new long[]{(long)1L}))) == (1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n // each cell of the grid contains a value. Every integer in the range [1, N * N]\n // inclusive appears exactly once on the cells of the grid.\n // You have to find the minimum path of length k in the grid. You can start\n // from any cell, and in each step you can move to any of the neighbor cells,\n // in other words, you can go to cells which share an edge with you current\n // cell.\n // Please note that a path of length k means visiting exactly k cells (not\n // necessarily distinct).\n // You CANNOT go off the grid.\n // A path A (of length k) is considered less than a path B (of length k) if\n // after making the ordered lists of the values on the cells that A and B go\n // through (let's call them lst_A and lst_B), lst_A is lexicographically less\n // than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n // such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n // lst_A[j] = lst_B[j].\n // It is guaranteed that the answer is unique.\n // Return an ordered list of the values on the cells that the minimum path go through.\n // Examples:\n public static List Minpath(List> grid, long k) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)2L, (long)3L}), (List)new List(new long[]{(long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)7L, (long)8L, (long)9L})})), (3L)).Equals((new List(new long[]{(long)1L, (long)2L, (long)1L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)5L, (long)9L, (long)3L}), (List)new List(new long[]{(long)4L, (long)1L, (long)6L}), (List)new List(new long[]{(long)7L, (long)8L, (long)2L})})), (1L)).Equals((new List(new long[]{(long)1L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}), (List)new List(new long[]{(long)5L, (long)6L, (long)7L, (long)8L}), (List)new List(new long[]{(long)9L, (long)10L, (long)11L, (long)12L}), (List)new List(new long[]{(long)13L, (long)14L, (long)15L, (long)16L})})), (4L)).Equals((new List(new long[]{(long)1L, (long)2L, (long)1L, (long)2L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)6L, (long)4L, (long)13L, (long)10L}), (List)new List(new long[]{(long)5L, (long)7L, (long)12L, (long)1L}), (List)new List(new long[]{(long)3L, (long)16L, (long)11L, (long)15L}), (List)new List(new long[]{(long)8L, (long)14L, (long)9L, (long)2L})})), (7L)).Equals((new List(new long[]{(long)1L, (long)10L, (long)1L, (long)10L, (long)1L, (long)10L, (long)1L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)8L, (long)14L, (long)9L, (long)2L}), (List)new List(new long[]{(long)6L, (long)4L, (long)13L, (long)15L}), (List)new List(new long[]{(long)5L, (long)7L, (long)1L, (long)12L}), (List)new List(new long[]{(long)3L, (long)10L, (long)11L, (long)16L})})), (5L)).Equals((new List(new long[]{(long)1L, (long)7L, (long)1L, (long)7L, (long)1L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)11L, (long)8L, (long)7L, (long)2L}), (List)new List(new long[]{(long)5L, (long)16L, (long)14L, (long)4L}), (List)new List(new long[]{(long)9L, (long)3L, (long)15L, (long)6L}), (List)new List(new long[]{(long)12L, (long)13L, (long)10L, (long)1L})})), (9L)).Equals((new List(new long[]{(long)1L, (long)6L, (long)1L, (long)6L, (long)1L, (long)6L, (long)1L, (long)6L, (long)1L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)12L, (long)13L, (long)10L, (long)1L}), (List)new List(new long[]{(long)9L, (long)3L, (long)15L, (long)6L}), (List)new List(new long[]{(long)5L, (long)16L, (long)14L, (long)4L}), (List)new List(new long[]{(long)11L, (long)8L, (long)7L, (long)2L})})), (12L)).Equals((new List(new long[]{(long)1L, (long)6L, (long)1L, (long)6L, (long)1L, (long)6L, (long)1L, (long)6L, (long)1L, (long)6L, (long)1L, (long)6L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)2L, (long)7L, (long)4L}), (List)new List(new long[]{(long)3L, (long)1L, (long)5L}), (List)new List(new long[]{(long)6L, (long)8L, (long)9L})})), (8L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)1L, (long)3L, (long)1L, (long)3L, (long)1L, (long)3L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)6L, (long)1L, (long)5L}), (List)new List(new long[]{(long)3L, (long)8L, (long)9L}), (List)new List(new long[]{(long)2L, (long)7L, (long)4L})})), (8L)).Equals((new List(new long[]{(long)1L, (long)5L, (long)1L, (long)5L, (long)1L, (long)5L, (long)1L, (long)5L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)2L}), (List)new List(new long[]{(long)3L, (long)4L})})), (10L)).Equals((new List(new long[]{(long)1L, (long)2L, (long)1L, (long)2L, (long)1L, (long)2L, (long)1L, (long)2L, (long)1L, (long)2L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)3L}), (List)new List(new long[]{(long)3L, (long)2L})})), (10L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)1L, (long)3L, (long)1L, (long)3L, (long)1L, (long)3L, (long)1L, (long)3L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given list of integers, return list in strange order.\n // Strange sorting, is when you start with the minimum value,\n // then maximum of the remaining integers, then minimum and so on.\n // Examples:\n public static List StrangeSortList(List lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(StrangeSortList((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))).Equals((new List(new long[]{(long)1L, (long)4L, (long)2L, (long)3L}))));\n Debug.Assert(StrangeSortList((new List(new long[]{(long)5L, (long)6L, (long)7L, (long)8L, (long)9L}))).Equals((new List(new long[]{(long)5L, (long)9L, (long)6L, (long)8L, (long)7L}))));\n Debug.Assert(StrangeSortList((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L}))).Equals((new List(new long[]{(long)1L, (long)5L, (long)2L, (long)4L, (long)3L}))));\n Debug.Assert(StrangeSortList((new List(new long[]{(long)5L, (long)6L, (long)7L, (long)8L, (long)9L, (long)1L}))).Equals((new List(new long[]{(long)1L, (long)9L, (long)5L, (long)8L, (long)6L, (long)7L}))));\n Debug.Assert(StrangeSortList((new List(new long[]{(long)5L, (long)5L, (long)5L, (long)5L}))).Equals((new List(new long[]{(long)5L, (long)5L, (long)5L, (long)5L}))));\n Debug.Assert(StrangeSortList((new List())).Equals((new List())));\n Debug.Assert(StrangeSortList((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L, (long)7L, (long)8L}))).Equals((new List(new long[]{(long)1L, (long)8L, (long)2L, (long)7L, (long)3L, (long)6L, (long)4L, (long)5L}))));\n Debug.Assert(StrangeSortList((new List(new long[]{(long)0L, (long)2L, (long)2L, (long)2L, (long)5L, (long)5L, (long)-5L, (long)-5L}))).Equals((new List(new long[]{(long)-5L, (long)5L, (long)-5L, (long)5L, (long)0L, (long)2L, (long)2L, (long)2L}))));\n Debug.Assert(StrangeSortList((new List(new long[]{(long)111111L}))).Equals((new List(new long[]{(long)111111L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a string 'text', return its md5 hash equivalent string.\n // If 'text' is an empty string, return None.\n public static string StringToMd5(string text) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(StringToMd5((\"Hello world\")).Equals((\"3e25960a79dbc69b674cd4ec67a72c62\")));\n Debug.Assert(StringToMd5((\"\")).Equals(null));\n Debug.Assert(StringToMd5((\"A B C\")).Equals((\"0ef78513b0cb8cef12743f5aeb35f888\")));\n Debug.Assert(StringToMd5((\"password\")).Equals((\"5f4dcc3b5aa765d61d8327deb882cf99\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a word. Your task is to find the closest vowel that stands between \n // two consonants from the right side of the word (case sensitive).\n // Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n // find any vowel met the above condition. \n // You may assume that the given string contains English letter only.\n // Example:\n public static string GetClosestVowel(string word) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(GetClosestVowel((\"yogurt\")).Equals((\"u\")));\n Debug.Assert(GetClosestVowel((\"full\")).Equals((\"u\")));\n Debug.Assert(GetClosestVowel((\"easy\")).Equals((\"\")));\n Debug.Assert(GetClosestVowel((\"eAsy\")).Equals((\"\")));\n Debug.Assert(GetClosestVowel((\"ali\")).Equals((\"\")));\n Debug.Assert(GetClosestVowel((\"bad\")).Equals((\"a\")));\n Debug.Assert(GetClosestVowel((\"most\")).Equals((\"o\")));\n Debug.Assert(GetClosestVowel((\"ab\")).Equals((\"\")));\n Debug.Assert(GetClosestVowel((\"ba\")).Equals((\"\")));\n Debug.Assert(GetClosestVowel((\"quick\")).Equals((\"\")));\n Debug.Assert(GetClosestVowel((\"anime\")).Equals((\"i\")));\n Debug.Assert(GetClosestVowel((\"Asia\")).Equals((\"\")));\n Debug.Assert(GetClosestVowel((\"Above\")).Equals((\"o\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Change numerical base of input number x to base.\n // return string representation after the conversion.\n // base numbers are less than 10.\n public static string ChangeBase(long x, long numBase) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ChangeBase((8L), (3L)).Equals((\"22\")));\n Debug.Assert(ChangeBase((9L), (3L)).Equals((\"100\")));\n Debug.Assert(ChangeBase((234L), (2L)).Equals((\"11101010\")));\n Debug.Assert(ChangeBase((16L), (2L)).Equals((\"10000\")));\n Debug.Assert(ChangeBase((8L), (2L)).Equals((\"1000\")));\n Debug.Assert(ChangeBase((7L), (2L)).Equals((\"111\")));\n Debug.Assert(ChangeBase((2L), (3L)).Equals((\"2\")));\n Debug.Assert(ChangeBase((3L), (4L)).Equals((\"3\")));\n Debug.Assert(ChangeBase((4L), (5L)).Equals((\"4\")));\n Debug.Assert(ChangeBase((5L), (6L)).Equals((\"5\")));\n Debug.Assert(ChangeBase((6L), (7L)).Equals((\"6\")));\n Debug.Assert(ChangeBase((7L), (8L)).Equals((\"7\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Check if in given list of numbers, are any two numbers closer to each other than\n // given threshold.\n public static bool HasCloseElements(List numbers, float threshold) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(HasCloseElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.9f, (float)4.0f, (float)5.0f, (float)2.2f})), (0.3f)) == (true));\n Debug.Assert(HasCloseElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.9f, (float)4.0f, (float)5.0f, (float)2.2f})), (0.05f)) == (false));\n Debug.Assert(HasCloseElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)5.9f, (float)4.0f, (float)5.0f})), (0.95f)) == (true));\n Debug.Assert(HasCloseElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)5.9f, (float)4.0f, (float)5.0f})), (0.8f)) == (false));\n Debug.Assert(HasCloseElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.0f})), (0.1f)) == (true));\n Debug.Assert(HasCloseElements((new List(new float[]{(float)1.1f, (float)2.2f, (float)3.1f, (float)4.1f, (float)5.1f})), (1.0f)) == (true));\n Debug.Assert(HasCloseElements((new List(new float[]{(float)1.1f, (float)2.2f, (float)3.1f, (float)4.1f, (float)5.1f})), (0.5f)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function that takes a string as input which contains only square brackets.\n // The function should return True if and only if there is a valid subsequence of brackets \n // where at least one bracket in the subsequence is nested.\n public static bool IsNested(string str) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsNested((\"[[]]\")) == (true));\n Debug.Assert(IsNested((\"[]]]]]]][[[[[]\")) == (false));\n Debug.Assert(IsNested((\"[][]\")) == (false));\n Debug.Assert(IsNested((\"[]\")) == (false));\n Debug.Assert(IsNested((\"[[[[]]]]\")) == (true));\n Debug.Assert(IsNested((\"[]]]]]]]]]]\")) == (false));\n Debug.Assert(IsNested((\"[][][[]]\")) == (true));\n Debug.Assert(IsNested((\"[[]\")) == (false));\n Debug.Assert(IsNested((\"[]]\")) == (false));\n Debug.Assert(IsNested((\"[[]][[\")) == (true));\n Debug.Assert(IsNested((\"[[][]]\")) == (true));\n Debug.Assert(IsNested((\"\")) == (false));\n Debug.Assert(IsNested((\"[[[[[[[[\")) == (false));\n Debug.Assert(IsNested((\"]]]]]]]]\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Concatenate list of strings into a single string\n public static string Concatenate(List strings) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Concatenate((new List())).Equals((\"\")));\n Debug.Assert(Concatenate((new List(new string[]{(string)\"x\", (string)\"y\", (string)\"z\"}))).Equals((\"xyz\")));\n Debug.Assert(Concatenate((new List(new string[]{(string)\"x\", (string)\"y\", (string)\"z\", (string)\"w\", (string)\"k\"}))).Equals((\"xyzwk\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n public static long PrimeFib(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(PrimeFib((1L)) == (2L));\n Debug.Assert(PrimeFib((2L)) == (3L));\n Debug.Assert(PrimeFib((3L)) == (5L));\n Debug.Assert(PrimeFib((4L)) == (13L));\n Debug.Assert(PrimeFib((5L)) == (89L));\n Debug.Assert(PrimeFib((6L)) == (233L));\n Debug.Assert(PrimeFib((7L)) == (1597L));\n Debug.Assert(PrimeFib((8L)) == (28657L));\n Debug.Assert(PrimeFib((9L)) == (514229L));\n Debug.Assert(PrimeFib((10L)) == (433494437L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n // other and return them in order (smaller number, larger number).\n public static Tuple FindClosestElements(List numbers) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FindClosestElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.9f, (float)4.0f, (float)5.0f, (float)2.2f}))).Equals((Tuple.Create(3.9f, 4.0f))));\n Debug.Assert(FindClosestElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)5.9f, (float)4.0f, (float)5.0f}))).Equals((Tuple.Create(5.0f, 5.9f))));\n Debug.Assert(FindClosestElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.2f}))).Equals((Tuple.Create(2.0f, 2.2f))));\n Debug.Assert(FindClosestElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.0f}))).Equals((Tuple.Create(2.0f, 2.0f))));\n Debug.Assert(FindClosestElements((new List(new float[]{(float)1.1f, (float)2.2f, (float)3.1f, (float)4.1f, (float)5.1f}))).Equals((Tuple.Create(2.2f, 3.1f))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You have been tasked to write a function that receives \n // a hexadecimal number as a string and counts the number of hexadecimal \n // digits that are primes (prime number, or a prime, is a natural number \n // greater than 1 that is not a product of two smaller natural numbers).\n // Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n // Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n // So you have to determine a number of the following digits: 2, 3, 5, 7, \n // B (=decimal 11), D (=decimal 13).\n // Note: you may assume the input is always correct or empty string, \n // and symbols A,B,C,D,E,F are always uppercase.\n // Examples:\n public static long HexKey(string num) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(HexKey((\"AB\")) == (1L));\n Debug.Assert(HexKey((\"1077E\")) == (2L));\n Debug.Assert(HexKey((\"ABED1A33\")) == (4L));\n Debug.Assert(HexKey((\"2020\")) == (2L));\n Debug.Assert(HexKey((\"123456789ABCDEF0\")) == (6L));\n Debug.Assert(HexKey((\"112233445566778899AABBCCDDEEFF00\")) == (12L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Complete the function that takes two integers and returns \n // the product of their unit digits.\n // Assume the input is always valid.\n // Examples:\n public static long Multiply(long a, long b) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Multiply((148L), (412L)) == (16L));\n Debug.Assert(Multiply((19L), (28L)) == (72L));\n Debug.Assert(Multiply((2020L), (1851L)) == (0L));\n Debug.Assert(Multiply((14L), (-15L)) == (20L));\n Debug.Assert(Multiply((76L), (67L)) == (42L));\n Debug.Assert(Multiply((17L), (27L)) == (49L));\n Debug.Assert(Multiply((0L), (1L)) == (0L));\n Debug.Assert(Multiply((0L), (0L)) == (0L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given list of numbers (of at least two elements), apply a linear transform to that list,\n // such that the smallest number will become 0 and the largest will become 1\n public static List RescaleToUnit(List numbers) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(RescaleToUnit((new List(new float[]{(float)2.0f, (float)49.9f}))).Equals((new List(new float[]{(float)0.0f, (float)1.0f}))));\n Debug.Assert(RescaleToUnit((new List(new float[]{(float)100.0f, (float)49.9f}))).Equals((new List(new float[]{(float)1.0f, (float)0.0f}))));\n Debug.Assert(RescaleToUnit((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f}))).Equals((new List(new float[]{(float)0.0f, (float)0.25f, (float)0.5f, (float)0.75f, (float)1.0f}))));\n Debug.Assert(RescaleToUnit((new List(new float[]{(float)2.0f, (float)1.0f, (float)5.0f, (float)3.0f, (float)4.0f}))).Equals((new List(new float[]{(float)0.25f, (float)0.0f, (float)1.0f, (float)0.5f, (float)0.75f}))));\n Debug.Assert(RescaleToUnit((new List(new float[]{(float)12.0f, (float)11.0f, (float)15.0f, (float)13.0f, (float)14.0f}))).Equals((new List(new float[]{(float)0.25f, (float)0.0f, (float)1.0f, (float)0.5f, (float)0.75f}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a positive integer n, return the product of the odd digits.\n // Return 0 if all digits are even.\n // For example:\n public static long Digits(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Digits((5L)) == (5L));\n Debug.Assert(Digits((54L)) == (5L));\n Debug.Assert(Digits((120L)) == (1L));\n Debug.Assert(Digits((5014L)) == (5L));\n Debug.Assert(Digits((98765L)) == (315L));\n Debug.Assert(Digits((5576543L)) == (2625L));\n Debug.Assert(Digits((2468L)) == (0L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You will be given the name of a class (a string) and a list of extensions.\n // The extensions are to be used to load additional classes to the class. The\n // strength of the extension is as follows: Let CAP be the number of the uppercase\n // letters in the extension's name, and let SM be the number of lowercase letters \n // in the extension's name, the strength is given by the fraction CAP - SM. \n // You should find the strongest extension and return a string in this \n // format: ClassName.StrongestExtensionName.\n // If there are two or more extensions with the same strength, you should\n // choose the one that comes first in the list.\n // For example, if you are given \"Slices\" as the class and a list of the\n // extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n // return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n // (its strength is -1).\n // Example:\n public static string StrongestExtension(string class_name, List extensions) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(StrongestExtension((\"Watashi\"), (new List(new string[]{(string)\"tEN\", (string)\"niNE\", (string)\"eIGHt8OKe\"}))).Equals((\"Watashi.eIGHt8OKe\")));\n Debug.Assert(StrongestExtension((\"Boku123\"), (new List(new string[]{(string)\"nani\", (string)\"NazeDa\", (string)\"YEs.WeCaNe\", (string)\"32145tggg\"}))).Equals((\"Boku123.YEs.WeCaNe\")));\n Debug.Assert(StrongestExtension((\"__YESIMHERE\"), (new List(new string[]{(string)\"t\", (string)\"eMptY\", (string)\"nothing\", (string)\"zeR00\", (string)\"NuLl__\", (string)\"123NoooneB321\"}))).Equals((\"__YESIMHERE.NuLl__\")));\n Debug.Assert(StrongestExtension((\"K\"), (new List(new string[]{(string)\"Ta\", (string)\"TAR\", (string)\"t234An\", (string)\"cosSo\"}))).Equals((\"K.TAR\")));\n Debug.Assert(StrongestExtension((\"__HAHA\"), (new List(new string[]{(string)\"Tab\", (string)\"123\", (string)\"781345\", (string)\"-_-\"}))).Equals((\"__HAHA.123\")));\n Debug.Assert(StrongestExtension((\"YameRore\"), (new List(new string[]{(string)\"HhAas\", (string)\"okIWILL123\", (string)\"WorkOut\", (string)\"Fails\", (string)\"-_-\"}))).Equals((\"YameRore.okIWILL123\")));\n Debug.Assert(StrongestExtension((\"finNNalLLly\"), (new List(new string[]{(string)\"Die\", (string)\"NowW\", (string)\"Wow\", (string)\"WoW\"}))).Equals((\"finNNalLLly.WoW\")));\n Debug.Assert(StrongestExtension((\"_\"), (new List(new string[]{(string)\"Bb\", (string)\"91245\"}))).Equals((\"_.Bb\")));\n Debug.Assert(StrongestExtension((\"Sp\"), (new List(new string[]{(string)\"671235\", (string)\"Bb\"}))).Equals((\"Sp.671235\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a string representing a space separated lowercase letters, return a dictionary\n // of the letter with the most repetition and containing the corresponding count.\n // If several letters have the same occurrence, return all of them.\n // Example:\n public static Dictionary Histogram(string test) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Histogram((\"a b b a\")).Equals((new Dictionary(){{\"a\", 2L}, {\"b\", 2L}})));\n Debug.Assert(Histogram((\"a b c a b\")).Equals((new Dictionary(){{\"a\", 2L}, {\"b\", 2L}})));\n Debug.Assert(Histogram((\"a b c d g\")).Equals((new Dictionary(){{\"a\", 1L}, {\"b\", 1L}, {\"c\", 1L}, {\"d\", 1L}, {\"g\", 1L}})));\n Debug.Assert(Histogram((\"r t g\")).Equals((new Dictionary(){{\"r\", 1L}, {\"t\", 1L}, {\"g\", 1L}})));\n Debug.Assert(Histogram((\"b b b b a\")).Equals((new Dictionary(){{\"b\", 4L}})));\n Debug.Assert(Histogram((\"r t g\")).Equals((new Dictionary(){{\"r\", 1L}, {\"t\", 1L}, {\"g\", 1L}})));\n Debug.Assert(Histogram((\"\")).Equals((new Dictionary())));\n Debug.Assert(Histogram((\"a\")).Equals((new Dictionary(){{\"a\", 1L}})));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // pairs_sum_to_zero takes a list of integers as an input.\n // it returns True if there are two distinct elements in the list that\n // sum to zero, and False otherwise.\n public static bool PairsSumToZero(List l) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)1L, (long)3L, (long)5L, (long)0L}))) == (false));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)1L, (long)3L, (long)-2L, (long)1L}))) == (false));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)7L}))) == (false));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)2L, (long)4L, (long)-5L, (long)3L, (long)5L, (long)7L}))) == (true));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)1L}))) == (false));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)-3L, (long)9L, (long)-1L, (long)3L, (long)2L, (long)30L}))) == (true));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)-3L, (long)9L, (long)-1L, (long)3L, (long)2L, (long)31L}))) == (true));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)-3L, (long)9L, (long)-1L, (long)4L, (long)2L, (long)30L}))) == (false));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)-3L, (long)9L, (long)-1L, (long)4L, (long)2L, (long)31L}))) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that accepts two lists of strings and returns the list that has \n // total number of chars in the all strings of the list less than the other list.\n // if the two lists have the same number of chars, return the first list.\n // Examples\n public static List TotalMatch(List lst1, List lst2) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(TotalMatch((new List()), (new List())).Equals((new List())));\n Debug.Assert(TotalMatch((new List(new string[]{(string)\"hi\", (string)\"admin\"})), (new List(new string[]{(string)\"hi\", (string)\"hi\"}))).Equals((new List(new string[]{(string)\"hi\", (string)\"hi\"}))));\n Debug.Assert(TotalMatch((new List(new string[]{(string)\"hi\", (string)\"admin\"})), (new List(new string[]{(string)\"hi\", (string)\"hi\", (string)\"admin\", (string)\"project\"}))).Equals((new List(new string[]{(string)\"hi\", (string)\"admin\"}))));\n Debug.Assert(TotalMatch((new List(new string[]{(string)\"4\"})), (new List(new string[]{(string)\"1\", (string)\"2\", (string)\"3\", (string)\"4\", (string)\"5\"}))).Equals((new List(new string[]{(string)\"4\"}))));\n Debug.Assert(TotalMatch((new List(new string[]{(string)\"hi\", (string)\"admin\"})), (new List(new string[]{(string)\"hI\", (string)\"Hi\"}))).Equals((new List(new string[]{(string)\"hI\", (string)\"Hi\"}))));\n Debug.Assert(TotalMatch((new List(new string[]{(string)\"hi\", (string)\"admin\"})), (new List(new string[]{(string)\"hI\", (string)\"hi\", (string)\"hi\"}))).Equals((new List(new string[]{(string)\"hI\", (string)\"hi\", (string)\"hi\"}))));\n Debug.Assert(TotalMatch((new List(new string[]{(string)\"hi\", (string)\"admin\"})), (new List(new string[]{(string)\"hI\", (string)\"hi\", (string)\"hii\"}))).Equals((new List(new string[]{(string)\"hi\", (string)\"admin\"}))));\n Debug.Assert(TotalMatch((new List()), (new List(new string[]{(string)\"this\"}))).Equals((new List())));\n Debug.Assert(TotalMatch((new List(new string[]{(string)\"this\"})), (new List())).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Circular shift the digits of the integer x, shift the digits right by shift\n // and return the result as a string.\n // If shift > number of digits, return digits reversed.\n public static string CircularShift(long x, long shift) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CircularShift((100L), (2L)).Equals((\"001\")));\n Debug.Assert(CircularShift((12L), (2L)).Equals((\"12\")));\n Debug.Assert(CircularShift((97L), (8L)).Equals((\"79\")));\n Debug.Assert(CircularShift((12L), (1L)).Equals((\"21\")));\n Debug.Assert(CircularShift((11L), (101L)).Equals((\"11\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return True is list elements are monotonically increasing or decreasing.\n public static bool Monotonic(List l) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Monotonic((new List(new long[]{(long)1L, (long)2L, (long)4L, (long)10L}))) == (true));\n Debug.Assert(Monotonic((new List(new long[]{(long)1L, (long)2L, (long)4L, (long)20L}))) == (true));\n Debug.Assert(Monotonic((new List(new long[]{(long)1L, (long)20L, (long)4L, (long)10L}))) == (false));\n Debug.Assert(Monotonic((new List(new long[]{(long)4L, (long)1L, (long)0L, (long)-10L}))) == (true));\n Debug.Assert(Monotonic((new List(new long[]{(long)4L, (long)1L, (long)1L, (long)0L}))) == (true));\n Debug.Assert(Monotonic((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)2L, (long)5L, (long)60L}))) == (false));\n Debug.Assert(Monotonic((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)60L}))) == (true));\n Debug.Assert(Monotonic((new List(new long[]{(long)9L, (long)9L, (long)9L, (long)9L}))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n // Example\n public static bool IsEqualToSumEven(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsEqualToSumEven((4L)) == (false));\n Debug.Assert(IsEqualToSumEven((6L)) == (false));\n Debug.Assert(IsEqualToSumEven((8L)) == (true));\n Debug.Assert(IsEqualToSumEven((10L)) == (true));\n Debug.Assert(IsEqualToSumEven((11L)) == (false));\n Debug.Assert(IsEqualToSumEven((12L)) == (true));\n Debug.Assert(IsEqualToSumEven((13L)) == (false));\n Debug.Assert(IsEqualToSumEven((16L)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Input to this function is a string representing musical notes in a special ASCII format.\n // Your task is to parse this string and return list of integers corresponding to how many beats does each\n // not last.\n // Here is a legend:\n // 'o' - whole note, lasts four beats\n // 'o|' - half note, lasts two beats\n // '.|' - quater note, lasts one beat\n public static List ParseMusic(string music_string) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ParseMusic((\"\")).Equals((new List())));\n Debug.Assert(ParseMusic((\"o o o o\")).Equals((new List(new long[]{(long)4L, (long)4L, (long)4L, (long)4L}))));\n Debug.Assert(ParseMusic((\".| .| .| .|\")).Equals((new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L}))));\n Debug.Assert(ParseMusic((\"o| o| .| .| o o o o\")).Equals((new List(new long[]{(long)2L, (long)2L, (long)1L, (long)1L, (long)4L, (long)4L, (long)4L, (long)4L}))));\n Debug.Assert(ParseMusic((\"o| .| o| .| o o| o o|\")).Equals((new List(new long[]{(long)2L, (long)1L, (long)2L, (long)1L, (long)4L, (long)2L, (long)4L, (long)2L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // \"\n // This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n // multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n // change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n // Examples:\n public static long SumSquares(List lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SumSquares((new List(new long[]{(long)1L, (long)2L, (long)3L}))) == (6L));\n Debug.Assert(SumSquares((new List(new long[]{(long)1L, (long)4L, (long)9L}))) == (14L));\n Debug.Assert(SumSquares((new List())) == (0L));\n Debug.Assert(SumSquares((new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L, (long)1L, (long)1L, (long)1L, (long)1L, (long)1L}))) == (9L));\n Debug.Assert(SumSquares((new List(new long[]{(long)-1L, (long)-1L, (long)-1L, (long)-1L, (long)-1L, (long)-1L, (long)-1L, (long)-1L, (long)-1L}))) == (-3L));\n Debug.Assert(SumSquares((new List(new long[]{(long)0L}))) == (0L));\n Debug.Assert(SumSquares((new List(new long[]{(long)-1L, (long)-5L, (long)2L, (long)-1L, (long)-5L}))) == (-126L));\n Debug.Assert(SumSquares((new List(new long[]{(long)-56L, (long)-99L, (long)1L, (long)0L, (long)-2L}))) == (3030L));\n Debug.Assert(SumSquares((new List(new long[]{(long)-1L, (long)0L, (long)0L, (long)0L, (long)0L, (long)0L, (long)0L, (long)0L, (long)-1L}))) == (0L));\n Debug.Assert(SumSquares((new List(new long[]{(long)-16L, (long)-9L, (long)-2L, (long)36L, (long)36L, (long)26L, (long)-20L, (long)25L, (long)-40L, (long)20L, (long)-4L, (long)12L, (long)-26L, (long)35L, (long)37L}))) == (-14196L));\n Debug.Assert(SumSquares((new List(new long[]{(long)-1L, (long)-3L, (long)17L, (long)-1L, (long)-15L, (long)13L, (long)-1L, (long)14L, (long)-14L, (long)-12L, (long)-5L, (long)14L, (long)-14L, (long)6L, (long)13L, (long)11L, (long)16L, (long)16L, (long)4L, (long)10L}))) == (-1448L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // triples_sum_to_zero takes a list of integers as an input.\n // it returns True if there are three distinct elements in the list that\n // sum to zero, and False otherwise.\n public static bool TriplesSumToZero(List l) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)1L, (long)3L, (long)5L, (long)0L}))) == (false));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)1L, (long)3L, (long)5L, (long)-1L}))) == (false));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)1L, (long)3L, (long)-2L, (long)1L}))) == (true));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)7L}))) == (false));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)1L, (long)2L, (long)5L, (long)7L}))) == (false));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)2L, (long)4L, (long)-5L, (long)3L, (long)9L, (long)7L}))) == (true));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)1L}))) == (false));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)1L, (long)3L, (long)5L, (long)-100L}))) == (false));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)100L, (long)3L, (long)5L, (long)-100L}))) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // brackets is a string of \"<\" and \">\".\n // return True if every opening bracket has a corresponding closing bracket.\n public static bool CorrectBracketing(string brackets) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CorrectBracketing((\"<>\")) == (true));\n Debug.Assert(CorrectBracketing((\"<<><>>\")) == (true));\n Debug.Assert(CorrectBracketing((\"<><><<><>><>\")) == (true));\n Debug.Assert(CorrectBracketing((\"<><><<<><><>><>><<><><<>>>\")) == (true));\n Debug.Assert(CorrectBracketing((\"<<<><>>>>\")) == (false));\n Debug.Assert(CorrectBracketing((\"><<>\")) == (false));\n Debug.Assert(CorrectBracketing((\"<\")) == (false));\n Debug.Assert(CorrectBracketing((\"<<<<\")) == (false));\n Debug.Assert(CorrectBracketing((\">\")) == (false));\n Debug.Assert(CorrectBracketing((\"<<>\")) == (false));\n Debug.Assert(CorrectBracketing((\"<><><<><>><>><<>\")) == (false));\n Debug.Assert(CorrectBracketing((\"<><><<><>><>>><>\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that takes an array of numbers as input and returns \n // the number of elements in the array that are greater than 10 and both \n // first and last digits of a number are odd (1, 3, 5, 7, 9).\n // For example:\n public static long Specialfilter(List nums) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Specialfilter((new List(new long[]{(long)5L, (long)-2L, (long)1L, (long)-5L}))) == (0L));\n Debug.Assert(Specialfilter((new List(new long[]{(long)15L, (long)-73L, (long)14L, (long)-15L}))) == (1L));\n Debug.Assert(Specialfilter((new List(new long[]{(long)33L, (long)-2L, (long)-3L, (long)45L, (long)21L, (long)109L}))) == (2L));\n Debug.Assert(Specialfilter((new List(new long[]{(long)43L, (long)-12L, (long)93L, (long)125L, (long)121L, (long)109L}))) == (4L));\n Debug.Assert(Specialfilter((new List(new long[]{(long)71L, (long)-2L, (long)-33L, (long)75L, (long)21L, (long)19L}))) == (3L));\n Debug.Assert(Specialfilter((new List(new long[]{(long)1L}))) == (0L));\n Debug.Assert(Specialfilter((new List())) == (0L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a dictionary, return True if all keys are strings in lower \n // case or all keys are strings in upper case, else return False.\n // The function should return False is the given dictionary is empty.\n // Examples:\n public static bool CheckDictCase(Dictionary dict) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CheckDictCase((new Dictionary(){{\"p\", \"pineapple\"}, {\"b\", \"banana\"}})) == (true));\n Debug.Assert(CheckDictCase((new Dictionary(){{\"p\", \"pineapple\"}, {\"A\", \"banana\"}, {\"B\", \"banana\"}})) == (false));\n Debug.Assert(CheckDictCase((new Dictionary(){{\"p\", \"pineapple\"}, {\"5\", \"banana\"}, {\"a\", \"apple\"}})) == (false));\n Debug.Assert(CheckDictCase((new Dictionary(){{\"Name\", \"John\"}, {\"Age\", \"36\"}, {\"City\", \"Houston\"}})) == (false));\n Debug.Assert(CheckDictCase((new Dictionary(){{\"STATE\", \"NC\"}, {\"ZIP\", \"12345\"}})) == (true));\n Debug.Assert(CheckDictCase((new Dictionary(){{\"fruit\", \"Orange\"}, {\"taste\", \"Sweet\"}})) == (true));\n Debug.Assert(CheckDictCase((new Dictionary())) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n // fibfib(0) == 0\n // fibfib(1) == 0\n // fibfib(2) == 1\n // fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n // Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n public static long Fibfib(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Fibfib((2L)) == (1L));\n Debug.Assert(Fibfib((1L)) == (0L));\n Debug.Assert(Fibfib((5L)) == (4L));\n Debug.Assert(Fibfib((8L)) == (24L));\n Debug.Assert(Fibfib((10L)) == (81L));\n Debug.Assert(Fibfib((12L)) == (274L));\n Debug.Assert(Fibfib((14L)) == (927L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a list of numbers.\n // You need to return the sum of squared numbers in the given list,\n // round each element in the list to the upper int(Ceiling) first.\n // Examples:\n public static long SumSquares(List lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SumSquares((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f}))) == (14L));\n Debug.Assert(SumSquares((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f}))) == (14L));\n Debug.Assert(SumSquares((new List(new float[]{(float)1.0f, (float)3.0f, (float)5.0f, (float)7.0f}))) == (84L));\n Debug.Assert(SumSquares((new List(new float[]{(float)1.4f, (float)4.2f, (float)0.0f}))) == (29L));\n Debug.Assert(SumSquares((new List(new float[]{(float)-2.4f, (float)1.0f, (float)1.0f}))) == (6L));\n Debug.Assert(SumSquares((new List(new float[]{(float)100.0f, (float)1.0f, (float)15.0f, (float)2.0f}))) == (10230L));\n Debug.Assert(SumSquares((new List(new float[]{(float)10000.0f, (float)10000.0f}))) == (200000000L));\n Debug.Assert(SumSquares((new List(new float[]{(float)-1.4f, (float)4.6f, (float)6.3f}))) == (75L));\n Debug.Assert(SumSquares((new List(new float[]{(float)-1.4f, (float)17.9f, (float)18.9f, (float)19.9f}))) == (1086L));\n Debug.Assert(SumSquares((new List(new float[]{(float)0.0f}))) == (0L));\n Debug.Assert(SumSquares((new List(new float[]{(float)-1.0f}))) == (1L));\n Debug.Assert(SumSquares((new List(new float[]{(float)-1.0f, (float)1.0f, (float)0.0f}))) == (2L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_85_add", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a non-empty list of integers lst. add the even elements that are at odd indices..\n // Examples:\n public static long Add(List lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Add((new List(new long[]{(long)4L, (long)88L}))) == (88L));\n Debug.Assert(Add((new List(new long[]{(long)4L, (long)5L, (long)6L, (long)7L, (long)2L, (long)122L}))) == (122L));\n Debug.Assert(Add((new List(new long[]{(long)4L, (long)0L, (long)6L, (long)7L}))) == (0L));\n Debug.Assert(Add((new List(new long[]{(long)4L, (long)4L, (long)6L, (long)8L}))) == (12L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return sorted unique elements in a list\n public static List Unique(List l) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Unique((new List(new long[]{(long)5L, (long)3L, (long)5L, (long)2L, (long)3L, (long)3L, (long)9L, (long)0L, (long)123L}))).Equals((new List(new long[]{(long)0L, (long)2L, (long)3L, (long)5L, (long)9L, (long)123L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a string text, replace all spaces in it with underscores, \n // and if a string has more than 2 consecutive spaces, \n // then replace all consecutive spaces with -\n public static string FixSpaces(string text) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FixSpaces((\"Example\")).Equals((\"Example\")));\n Debug.Assert(FixSpaces((\"Mudasir Hanif \")).Equals((\"Mudasir_Hanif_\")));\n Debug.Assert(FixSpaces((\"Yellow Yellow Dirty Fellow\")).Equals((\"Yellow_Yellow__Dirty__Fellow\")));\n Debug.Assert(FixSpaces((\"Exa mple\")).Equals((\"Exa-mple\")));\n Debug.Assert(FixSpaces((\" Exa 1 2 2 mple\")).Equals((\"-Exa_1_2_2_mple\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return 2^n modulo p (be aware of numerics).\n public static long Modp(long n, long p) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Modp((3L), (5L)) == (3L));\n Debug.Assert(Modp((1101L), (101L)) == (2L));\n Debug.Assert(Modp((0L), (101L)) == (1L));\n Debug.Assert(Modp((3L), (11L)) == (8L));\n Debug.Assert(Modp((100L), (101L)) == (1L));\n Debug.Assert(Modp((30L), (5L)) == (4L));\n Debug.Assert(Modp((31L), (5L)) == (3L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You have to write a function which validates a given date string and\n // returns True if the date is valid otherwise False.\n // The date is valid if all of the following rules are satisfied:\n // 1. The date string is not empty.\n // 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n // 3. The months should not be less than 1 or higher than 12.\n // 4. The date should be in the format: mm-dd-yyyy\n public static bool ValidDate(string date) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ValidDate((\"03-11-2000\")) == (true));\n Debug.Assert(ValidDate((\"15-01-2012\")) == (false));\n Debug.Assert(ValidDate((\"04-0-2040\")) == (false));\n Debug.Assert(ValidDate((\"06-04-2020\")) == (true));\n Debug.Assert(ValidDate((\"01-01-2007\")) == (true));\n Debug.Assert(ValidDate((\"03-32-2011\")) == (false));\n Debug.Assert(ValidDate((\"\")) == (false));\n Debug.Assert(ValidDate((\"04-31-3000\")) == (false));\n Debug.Assert(ValidDate((\"06-06-2005\")) == (true));\n Debug.Assert(ValidDate((\"21-31-2000\")) == (false));\n Debug.Assert(ValidDate((\"04-12-2003\")) == (true));\n Debug.Assert(ValidDate((\"04122003\")) == (false));\n Debug.Assert(ValidDate((\"20030412\")) == (false));\n Debug.Assert(ValidDate((\"2003-04\")) == (false));\n Debug.Assert(ValidDate((\"2003-04-12\")) == (false));\n Debug.Assert(ValidDate((\"04-2003\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that takes a string and returns an ordered version of it.\n // Ordered version of string, is a string where all words (separated by space)\n // are replaced by a new word where all the characters arranged in\n // ascending order based on ascii value.\n // Note: You should keep the order of words and blank spaces in the sentence.\n // For example:\n public static string AntiShuffle(string s) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(AntiShuffle((\"Hi\")).Equals((\"Hi\")));\n Debug.Assert(AntiShuffle((\"hello\")).Equals((\"ehllo\")));\n Debug.Assert(AntiShuffle((\"number\")).Equals((\"bemnru\")));\n Debug.Assert(AntiShuffle((\"abcd\")).Equals((\"abcd\")));\n Debug.Assert(AntiShuffle((\"Hello World!!!\")).Equals((\"Hello !!!Wdlor\")));\n Debug.Assert(AntiShuffle((\"\")).Equals((\"\")));\n Debug.Assert(AntiShuffle((\"Hi. My name is Mister Robot. How are you?\")).Equals((\".Hi My aemn is Meirst .Rboot How aer ?ouy\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a list of numbers, return whether or not they are sorted\n // in ascending order. If list has more than 1 duplicate of the same\n // number, return False. Assume no negative numbers and only integers.\n // Examples\n public static bool IsSorted(List lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsSorted((new List(new long[]{(long)5L}))) == (true));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L}))) == (true));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)4L, (long)5L}))) == (false));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}))) == (true));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L, (long)7L}))) == (true));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)4L, (long)5L, (long)6L, (long)7L}))) == (false));\n Debug.Assert(IsSorted((new List())) == (true));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L}))) == (true));\n Debug.Assert(IsSorted((new List(new long[]{(long)3L, (long)2L, (long)1L}))) == (false));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)2L, (long)2L, (long)2L, (long)3L, (long)4L}))) == (false));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)3L, (long)3L, (long)4L}))) == (false));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)2L, (long)2L, (long)3L, (long)3L, (long)4L}))) == (true));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a string s.\n // Your task is to check if the string is happy or not.\n // A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n // For example:\n public static bool IsHappy(string s) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsHappy((\"a\")) == (false));\n Debug.Assert(IsHappy((\"aa\")) == (false));\n Debug.Assert(IsHappy((\"abcd\")) == (true));\n Debug.Assert(IsHappy((\"aabb\")) == (false));\n Debug.Assert(IsHappy((\"adb\")) == (true));\n Debug.Assert(IsHappy((\"xyy\")) == (false));\n Debug.Assert(IsHappy((\"iopaxpoi\")) == (true));\n Debug.Assert(IsHappy((\"iopaxioi\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that returns True if the object q will fly, and False otherwise.\n // The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n // Example:\n // # 1+2 is less than the maximum possible weight, but it's unbalanced.\n // # it's balanced, but 3+2+3 is more than the maximum possible weight.\n // # 3+2+3 is less than the maximum possible weight, and it's balanced.\n // # 3 is less than the maximum possible weight, and it's balanced.\n public static bool WillItFly(List q, long w) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(WillItFly((new List(new long[]{(long)3L, (long)2L, (long)3L})), (9L)) == (true));\n Debug.Assert(WillItFly((new List(new long[]{(long)1L, (long)2L})), (5L)) == (false));\n Debug.Assert(WillItFly((new List(new long[]{(long)3L})), (5L)) == (true));\n Debug.Assert(WillItFly((new List(new long[]{(long)3L, (long)2L, (long)3L})), (1L)) == (false));\n Debug.Assert(WillItFly((new List(new long[]{(long)1L, (long)2L, (long)3L})), (6L)) == (false));\n Debug.Assert(WillItFly((new List(new long[]{(long)5L})), (5L)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given an array of non-negative integers, return a copy of the given array after sorting,\n // you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n // or sort it in descending order if the sum( first index value, last index value) is even.\n // Note:\n // * don't change the given array.\n // Examples:\n public static List SortArray(List array) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SortArray((new List())).Equals((new List())));\n Debug.Assert(SortArray((new List(new long[]{(long)5L}))).Equals((new List(new long[]{(long)5L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)2L, (long)4L, (long)3L, (long)0L, (long)1L, (long)5L}))).Equals((new List(new long[]{(long)0L, (long)1L, (long)2L, (long)3L, (long)4L, (long)5L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)2L, (long)4L, (long)3L, (long)0L, (long)1L, (long)5L, (long)6L}))).Equals((new List(new long[]{(long)6L, (long)5L, (long)4L, (long)3L, (long)2L, (long)1L, (long)0L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)2L, (long)1L}))).Equals((new List(new long[]{(long)1L, (long)2L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)15L, (long)42L, (long)87L, (long)32L, (long)11L, (long)0L}))).Equals((new List(new long[]{(long)0L, (long)11L, (long)15L, (long)32L, (long)42L, (long)87L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)21L, (long)14L, (long)23L, (long)11L}))).Equals((new List(new long[]{(long)23L, (long)21L, (long)14L, (long)11L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Implement a function that takes an non-negative integer and returns an array of the first n\n // integers that are prime numbers and less than n.\n // for example:\n public static List CountUpTo(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CountUpTo((5L)).Equals((new List(new long[]{(long)2L, (long)3L}))));\n Debug.Assert(CountUpTo((6L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)5L}))));\n Debug.Assert(CountUpTo((7L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)5L}))));\n Debug.Assert(CountUpTo((10L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)5L, (long)7L}))));\n Debug.Assert(CountUpTo((0L)).Equals((new List())));\n Debug.Assert(CountUpTo((22L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)5L, (long)7L, (long)11L, (long)13L, (long)17L, (long)19L}))));\n Debug.Assert(CountUpTo((1L)).Equals((new List())));\n Debug.Assert(CountUpTo((18L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)5L, (long)7L, (long)11L, (long)13L, (long)17L}))));\n Debug.Assert(CountUpTo((47L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)5L, (long)7L, (long)11L, (long)13L, (long)17L, (long)19L, (long)23L, (long)29L, (long)31L, (long)37L, (long)41L, (long)43L}))));\n Debug.Assert(CountUpTo((101L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)5L, (long)7L, (long)11L, (long)13L, (long)17L, (long)19L, (long)23L, (long)29L, (long)31L, (long)37L, (long)41L, (long)43L, (long)47L, (long)53L, (long)59L, (long)61L, (long)67L, (long)71L, (long)73L, (long)79L, (long)83L, (long)89L, (long)97L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Out of list of strings, return the longest one. Return the first one in case of multiple\n // strings of the same length. Return None in case the input list is empty.\n public static string Longest(List strings) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Longest((new List())).Equals(null));\n Debug.Assert(Longest((new List(new string[]{(string)\"x\", (string)\"y\", (string)\"z\"}))).Equals((\"x\")));\n Debug.Assert(Longest((new List(new string[]{(string)\"x\", (string)\"yyy\", (string)\"zzzz\", (string)\"www\", (string)\"kkkk\", (string)\"abc\"}))).Equals((\"zzzz\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n // reverse the resulting array, and then replace each digit by its corresponding name from\n // \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n // For example:\n // If the array is empty, return an empty array:\n // If the array has any strange number ignore it:\n public static List ByLength(List arr) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ByLength((new List(new long[]{(long)2L, (long)1L, (long)1L, (long)4L, (long)5L, (long)8L, (long)2L, (long)3L}))).Equals((new List(new string[]{(string)\"Eight\", (string)\"Five\", (string)\"Four\", (string)\"Three\", (string)\"Two\", (string)\"Two\", (string)\"One\", (string)\"One\"}))));\n Debug.Assert(ByLength((new List())).Equals((new List())));\n Debug.Assert(ByLength((new List(new long[]{(long)1L, (long)-1L, (long)55L}))).Equals((new List(new string[]{(string)\"One\"}))));\n Debug.Assert(ByLength((new List(new long[]{(long)1L, (long)-1L, (long)3L, (long)2L}))).Equals((new List(new string[]{(string)\"Three\", (string)\"Two\", (string)\"One\"}))));\n Debug.Assert(ByLength((new List(new long[]{(long)9L, (long)4L, (long)8L}))).Equals((new List(new string[]{(string)\"Nine\", (string)\"Eight\", (string)\"Four\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_106_f", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Implement the function f that takes n as a parameter,\n // 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\n // or the sum of numbers from 1 to i otherwise.\n // i starts from 1.\n // the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n // Example:\n public static List F(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(F((5L)).Equals((new List(new long[]{(long)1L, (long)2L, (long)6L, (long)24L, (long)15L}))));\n Debug.Assert(F((7L)).Equals((new List(new long[]{(long)1L, (long)2L, (long)6L, (long)24L, (long)15L, (long)720L, (long)28L}))));\n Debug.Assert(F((1L)).Equals((new List(new long[]{(long)1L}))));\n Debug.Assert(F((3L)).Equals((new List(new long[]{(long)1L, (long)2L, (long)6L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n public static long FizzBuzz(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FizzBuzz((50L)) == (0L));\n Debug.Assert(FizzBuzz((78L)) == (2L));\n Debug.Assert(FizzBuzz((79L)) == (3L));\n Debug.Assert(FizzBuzz((100L)) == (3L));\n Debug.Assert(FizzBuzz((200L)) == (6L));\n Debug.Assert(FizzBuzz((4000L)) == (192L));\n Debug.Assert(FizzBuzz((10000L)) == (639L));\n Debug.Assert(FizzBuzz((100000L)) == (8026L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a positive floating point number, it can be decomposed into\n // and integer part (largest integer smaller than given number) and decimals\n // (leftover part always smaller than 1).\n // Return the decimal part of the number.\n public static float TruncateNumber(float number) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(TruncateNumber((3.5f)) == (0.5f));\n Debug.Assert(TruncateNumber((1.25f)) == (0.25f));\n Debug.Assert(TruncateNumber((123.0f)) == (0.0f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n // Empty sum should be equal to 0 and empty product should be equal to 1.\n public static Tuple SumProduct(List numbers) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SumProduct((new List())).Equals((Tuple.Create(0L, 1L))));\n Debug.Assert(SumProduct((new List(new long[]{(long)1L, (long)1L, (long)1L}))).Equals((Tuple.Create(3L, 1L))));\n Debug.Assert(SumProduct((new List(new long[]{(long)100L, (long)0L}))).Equals((Tuple.Create(100L, 0L))));\n Debug.Assert(SumProduct((new List(new long[]{(long)3L, (long)5L, (long)7L}))).Equals((Tuple.Create(15L, 105L))));\n Debug.Assert(SumProduct((new List(new long[]{(long)10L}))).Equals((Tuple.Create(10L, 10L))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a 2 dimensional data, as a nested lists,\n // which is similar to matrix, however, unlike matrices,\n // each row may contain a different number of columns.\n // Given lst, and integer x, find integers x in the list,\n // and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n // each tuple is a coordinate - (row, columns), starting with 0.\n // Sort coordinates initially by rows in ascending order.\n // Also, sort coordinates of the row by columns in descending order.\n // Examples:\n public static List> GetRow(List> lst, long x) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(GetRow((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)1L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)1L})})), (1L)).Equals((new List>(new Tuple[]{(Tuple)Tuple.Create(0L, 0L), (Tuple)Tuple.Create(1L, 4L), (Tuple)Tuple.Create(1L, 0L), (Tuple)Tuple.Create(2L, 5L), (Tuple)Tuple.Create(2L, 0L)}))));\n Debug.Assert(GetRow((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L})})), (2L)).Equals((new List>(new Tuple[]{(Tuple)Tuple.Create(0L, 1L), (Tuple)Tuple.Create(1L, 1L), (Tuple)Tuple.Create(2L, 1L), (Tuple)Tuple.Create(3L, 1L), (Tuple)Tuple.Create(4L, 1L), (Tuple)Tuple.Create(5L, 1L)}))));\n Debug.Assert(GetRow((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)1L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)1L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)1L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)1L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)1L})})), (1L)).Equals((new List>(new Tuple[]{(Tuple)Tuple.Create(0L, 0L), (Tuple)Tuple.Create(1L, 0L), (Tuple)Tuple.Create(2L, 1L), (Tuple)Tuple.Create(2L, 0L), (Tuple)Tuple.Create(3L, 2L), (Tuple)Tuple.Create(3L, 0L), (Tuple)Tuple.Create(4L, 3L), (Tuple)Tuple.Create(4L, 0L), (Tuple)Tuple.Create(5L, 4L), (Tuple)Tuple.Create(5L, 0L), (Tuple)Tuple.Create(6L, 5L), (Tuple)Tuple.Create(6L, 0L)}))));\n Debug.Assert(GetRow((new List>()), (1L)).Equals((new List>())));\n Debug.Assert(GetRow((new List>(new List[]{(List)new List(new long[]{(long)1L})})), (2L)).Equals((new List>())));\n Debug.Assert(GetRow((new List>(new List[]{(List)new List(), (List)new List(new long[]{(long)1L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L})})), (3L)).Equals((new List>(new Tuple[]{(Tuple)Tuple.Create(2L, 2L)}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You're a hungry rabbit, and you already have eaten a certain number of carrots,\n // but now you need to eat more carrots to complete the day's meals.\n // you should return an array of [ total number of eaten carrots after your meals,\n // the number of carrots left after your meals ]\n // if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n // Example:\n // Variables:\n // @number : integer\n // the number of carrots that you have eaten.\n // @need : integer\n // the number of carrots that you need to eat.\n // @remaining : integer\n // the number of remaining carrots thet exist in stock\n // Constrain:\n // * 0 <= number <= 1000\n // * 0 <= need <= 1000\n // * 0 <= remaining <= 1000\n // Have fun :)\n public static List Eat(long number, long need, long remaining) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Eat((5L), (6L), (10L)).Equals((new List(new long[]{(long)11L, (long)4L}))));\n Debug.Assert(Eat((4L), (8L), (9L)).Equals((new List(new long[]{(long)12L, (long)1L}))));\n Debug.Assert(Eat((1L), (10L), (10L)).Equals((new List(new long[]{(long)11L, (long)0L}))));\n Debug.Assert(Eat((2L), (11L), (5L)).Equals((new List(new long[]{(long)7L, (long)0L}))));\n Debug.Assert(Eat((4L), (5L), (7L)).Equals((new List(new long[]{(long)9L, (long)2L}))));\n Debug.Assert(Eat((4L), (5L), (1L)).Equals((new List(new long[]{(long)5L, (long)0L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a positive integer N, return the total sum of its digits in binary.\n // Example\n // Variables:\n // @N integer\n // Constraints: 0 \u2264 N \u2264 10000.\n // Output:\n // a string of binary number\n public static string Solve(long N) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Solve((1000L)).Equals((\"1\")));\n Debug.Assert(Solve((150L)).Equals((\"110\")));\n Debug.Assert(Solve((147L)).Equals((\"1100\")));\n Debug.Assert(Solve((333L)).Equals((\"1001\")));\n Debug.Assert(Solve((963L)).Equals((\"10010\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a list of integers.\n // You need to find the largest prime value and return the sum of its digits.\n // Examples:\n public static long Skjkasdkd(List lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Skjkasdkd((new List(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, (long)3L}))) == (10L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)1L, (long)0L, (long)1L, (long)8L, (long)2L, (long)4597L, (long)2L, (long)1L, (long)3L, (long)40L, (long)1L, (long)2L, (long)1L, (long)2L, (long)4L, (long)2L, (long)5L, (long)1L}))) == (25L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)1L, (long)3L, (long)1L, (long)32L, (long)5107L, (long)34L, (long)83278L, (long)109L, (long)163L, (long)23L, (long)2323L, (long)32L, (long)30L, (long)1L, (long)9L, (long)3L}))) == (13L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)0L, (long)724L, (long)32L, (long)71L, (long)99L, (long)32L, (long)6L, (long)0L, (long)5L, (long)91L, (long)83L, (long)0L, (long)5L, (long)6L}))) == (11L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)0L, (long)81L, (long)12L, (long)3L, (long)1L, (long)21L}))) == (3L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)0L, (long)8L, (long)1L, (long)2L, (long)1L, (long)7L}))) == (7L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)8191L}))) == (19L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)8191L, (long)123456L, (long)127L, (long)7L}))) == (19L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)127L, (long)97L, (long)8192L}))) == (10L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given an array arr of integers, find the minimum number of elements that\n // need to be changed to make the array palindromic. A palindromic array is an array that\n // is read the same backwards and forwards. In one change, you can change one element to any other element.\n // For example:\n public static long SmallestChange(List arr) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SmallestChange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)5L, (long)4L, (long)7L, (long)9L, (long)6L}))) == (4L));\n Debug.Assert(SmallestChange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)3L, (long)2L, (long)2L}))) == (1L));\n Debug.Assert(SmallestChange((new List(new long[]{(long)1L, (long)4L, (long)2L}))) == (1L));\n Debug.Assert(SmallestChange((new List(new long[]{(long)1L, (long)4L, (long)4L, (long)2L}))) == (1L));\n Debug.Assert(SmallestChange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)2L, (long)1L}))) == (0L));\n Debug.Assert(SmallestChange((new List(new long[]{(long)3L, (long)1L, (long)1L, (long)3L}))) == (0L));\n Debug.Assert(SmallestChange((new List(new long[]{(long)1L}))) == (0L));\n Debug.Assert(SmallestChange((new List(new long[]{(long)0L, (long)1L}))) == (1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // It is the last week of the semester and the teacher has to give the grades\n // to students. The teacher has been making her own algorithm for grading.\n // The only problem is, she has lost the code she used for grading.\n // She has given you a list of GPAs for some students and you have to write \n // a function that can output a list of letter grades using the following table:\n // GPA | Letter grade\n // 4.0 A+\n // > 3.7 A \n // > 3.3 A- \n // > 3.0 B+\n // > 2.7 B \n // > 2.3 B-\n // > 2.0 C+\n // > 1.7 C\n // > 1.3 C-\n // > 1.0 D+ \n // > 0.7 D \n // > 0.0 D-\n // 0.0 E\n // Example:\n public static List NumericalLetterGrade(List grades) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(NumericalLetterGrade((new List(new float[]{(float)4.0f, (float)3L, (float)1.7f, (float)2L, (float)3.5f}))).Equals((new List(new string[]{(string)\"A+\", (string)\"B\", (string)\"C-\", (string)\"C\", (string)\"A-\"}))));\n Debug.Assert(NumericalLetterGrade((new List(new float[]{(float)1.2f}))).Equals((new List(new string[]{(string)\"D+\"}))));\n Debug.Assert(NumericalLetterGrade((new List(new float[]{(float)0.5f}))).Equals((new List(new string[]{(string)\"D-\"}))));\n Debug.Assert(NumericalLetterGrade((new List(new float[]{(float)0.0f}))).Equals((new List(new string[]{(string)\"E\"}))));\n Debug.Assert(NumericalLetterGrade((new List(new float[]{(float)1.0f, (float)0.3f, (float)1.5f, (float)2.8f, (float)3.3f}))).Equals((new List(new string[]{(string)\"D\", (string)\"D-\", (string)\"C-\", (string)\"B\", (string)\"B+\"}))));\n Debug.Assert(NumericalLetterGrade((new List(new float[]{(float)0.0f, (float)0.7f}))).Equals((new List(new string[]{(string)\"E\", (string)\"D-\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given the lengths of the three sides of a triangle. Return the area of\n // the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n // Otherwise return -1\n // Three sides make a valid triangle when the sum of any two sides is greater \n // than the third side.\n // Example:\n public static float TriangleArea(long a, long b, long c) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(TriangleArea((3L), (4L), (5L)) == (6.0f));\n Debug.Assert(TriangleArea((1L), (2L), (10L)) == (float)-1L);\n Debug.Assert(TriangleArea((4L), (8L), (5L)) == (8.18f));\n Debug.Assert(TriangleArea((2L), (2L), (2L)) == (1.73f));\n Debug.Assert(TriangleArea((1L), (2L), (3L)) == (float)-1L);\n Debug.Assert(TriangleArea((10L), (5L), (7L)) == (16.25f));\n Debug.Assert(TriangleArea((2L), (6L), (3L)) == (float)-1L);\n Debug.Assert(TriangleArea((1L), (1L), (1L)) == (0.43f));\n Debug.Assert(TriangleArea((2L), (2L), (10L)) == (float)-1L);\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Check if two words have the same characters.\n public static bool SameChars(string s0, string s1) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddeddabc\")) == (true));\n Debug.Assert(SameChars((\"abcd\"), (\"dddddddabc\")) == (true));\n Debug.Assert(SameChars((\"dddddddabc\"), (\"abcd\")) == (true));\n Debug.Assert(SameChars((\"eabcd\"), (\"dddddddabc\")) == (false));\n Debug.Assert(SameChars((\"abcd\"), (\"dddddddabcf\")) == (false));\n Debug.Assert(SameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddddabc\")) == (false));\n Debug.Assert(SameChars((\"aabb\"), (\"aaccc\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given an array of integers nums, find the minimum sum of any non-empty sub-array\n // of nums.\n // Example\n public static long Minsubarraysum(List nums) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)2L, (long)3L, (long)4L, (long)1L, (long)2L, (long)4L}))) == (1L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)-1L, (long)-2L, (long)-3L}))) == (-6L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)-1L, (long)-2L, (long)-3L, (long)2L, (long)-10L}))) == (-14L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)-9999999999999999L}))) == (-9999999999999999L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)0L, (long)10L, (long)20L, (long)1000000L}))) == (0L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)-1L, (long)-2L, (long)-3L, (long)10L, (long)-5L}))) == (-6L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)100L, (long)-1L, (long)-2L, (long)-3L, (long)10L, (long)-5L}))) == (-6L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)10L, (long)11L, (long)13L, (long)8L, (long)3L, (long)4L}))) == (3L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)100L, (long)-33L, (long)32L, (long)-1L, (long)0L, (long)-2L}))) == (-33L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)-10L}))) == (-10L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)7L}))) == (7L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)1L, (long)-1L}))) == (-1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a string s and a natural number n, you have been tasked to implement \n // a function that returns a list of all words from string s that contain exactly \n // n consonants, in order these words appear in the string s.\n // If the string s is empty then the function should return an empty list.\n // Note: you may assume the input string contains only letters and spaces.\n // Examples:\n public static List SelectWords(string s, long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SelectWords((\"Mary had a little lamb\"), (4L)).Equals((new List(new string[]{(string)\"little\"}))));\n Debug.Assert(SelectWords((\"Mary had a little lamb\"), (3L)).Equals((new List(new string[]{(string)\"Mary\", (string)\"lamb\"}))));\n Debug.Assert(SelectWords((\"simple white space\"), (2L)).Equals((new List())));\n Debug.Assert(SelectWords((\"Hello world\"), (4L)).Equals((new List(new string[]{(string)\"world\"}))));\n Debug.Assert(SelectWords((\"Uncle sam\"), (3L)).Equals((new List(new string[]{(string)\"Uncle\"}))));\n Debug.Assert(SelectWords((\"\"), (4L)).Equals((new List())));\n Debug.Assert(SelectWords((\"a b c d e f\"), (1L)).Equals((new List(new string[]{(string)\"b\", (string)\"c\", (string)\"d\", (string)\"f\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return list of all prefixes from shortest to longest of the input string\n public static List AllPrefixes(string str) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(AllPrefixes((\"\")).Equals((new List())));\n Debug.Assert(AllPrefixes((\"asdfgh\")).Equals((new List(new string[]{(string)\"a\", (string)\"as\", (string)\"asd\", (string)\"asdf\", (string)\"asdfg\", (string)\"asdfgh\"}))));\n Debug.Assert(AllPrefixes((\"WWW\")).Equals((new List(new string[]{(string)\"W\", (string)\"WW\", (string)\"WWW\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function that takes a value (string) representing a number\n // and returns the closest integer to it. If the number is equidistant\n // from two integers, round it away from zero.\n // Examples\n // Note:\n // Rounding away from zero means that if the given number is equidistant\n // from two integers, the one you should return is the one that is the\n // farthest from zero. For example closest_integer(\"14.5\") should\n // return 15 and closest_integer(\"-14.5\") should return -15.\n public static long ClosestInteger(string value) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ClosestInteger((\"10\")) == (10L));\n Debug.Assert(ClosestInteger((\"14.5\")) == (15L));\n Debug.Assert(ClosestInteger((\"-15.5\")) == (-16L));\n Debug.Assert(ClosestInteger((\"15.3\")) == (15L));\n Debug.Assert(ClosestInteger((\"0\")) == (0L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function which takes a string representing a file's name, and returns\n // 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n // A file's name is considered to be valid if and only if all the following conditions \n // are met:\n // - There should not be more than three digits ('0'-'9') in the file's name.\n // - The file's name contains exactly one dot '.'\n // - The substring before the dot should not be empty, and it starts with a letter from \n // the latin alphapet ('a'-'z' and 'A'-'Z').\n // - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n // Examples:\n public static string FileNameCheck(string file_name) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FileNameCheck((\"example.txt\")).Equals((\"Yes\")));\n Debug.Assert(FileNameCheck((\"1example.dll\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"s1sdf3.asd\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"K.dll\")).Equals((\"Yes\")));\n Debug.Assert(FileNameCheck((\"MY16FILE3.exe\")).Equals((\"Yes\")));\n Debug.Assert(FileNameCheck((\"His12FILE94.exe\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"_Y.txt\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"?aREYA.exe\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"/this_is_valid.dll\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"this_is_valid.wow\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"this_is_valid.txt\")).Equals((\"Yes\")));\n Debug.Assert(FileNameCheck((\"this_is_valid.txtexe\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"#this2_i4s_5valid.ten\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"@this1_is6_valid.exe\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"this_is_12valid.6exe4.txt\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"all.exe.txt\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"I563_No.exe\")).Equals((\"Yes\")));\n Debug.Assert(FileNameCheck((\"Is3youfault.txt\")).Equals((\"Yes\")));\n Debug.Assert(FileNameCheck((\"no_one#knows.dll\")).Equals((\"Yes\")));\n Debug.Assert(FileNameCheck((\"1I563_Yes3.exe\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"I563_Yes3.txtt\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"final..txt\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"final132\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"_f4indsartal132.\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\".txt\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"s.\")).Equals((\"No\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given two intervals,\n // where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n // The given intervals are closed which means that the interval (start, end)\n // includes both start and end.\n // For each given interval, it is assumed that its start is less or equal its end.\n // Your task is to determine whether the length of intersection of these two \n // intervals is a prime number.\n // Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n // which its length is 1, which not a prime number.\n // If the length of the intersection is a prime number, return \"YES\",\n // otherwise, return \"NO\".\n // If the two intervals don't intersect, return \"NO\".\n // [input/output] samples:\n public static string Intersection(Tuple interval1, Tuple interval2) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Intersection((Tuple.Create(1L, 2L)), (Tuple.Create(2L, 3L))).Equals((\"NO\")));\n Debug.Assert(Intersection((Tuple.Create(-1L, 1L)), (Tuple.Create(0L, 4L))).Equals((\"NO\")));\n Debug.Assert(Intersection((Tuple.Create(-3L, -1L)), (Tuple.Create(-5L, 5L))).Equals((\"YES\")));\n Debug.Assert(Intersection((Tuple.Create(-2L, 2L)), (Tuple.Create(-4L, 0L))).Equals((\"YES\")));\n Debug.Assert(Intersection((Tuple.Create(-11L, 2L)), (Tuple.Create(-1L, -1L))).Equals((\"NO\")));\n Debug.Assert(Intersection((Tuple.Create(1L, 2L)), (Tuple.Create(3L, 5L))).Equals((\"NO\")));\n Debug.Assert(Intersection((Tuple.Create(1L, 2L)), (Tuple.Create(1L, 2L))).Equals((\"NO\")));\n Debug.Assert(Intersection((Tuple.Create(-2L, -2L)), (Tuple.Create(-3L, -2L))).Equals((\"NO\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return the largest prime factor of n. Assume n > 1 and is not a prime.\n public static long LargestPrimeFactor(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(LargestPrimeFactor((15L)) == (5L));\n Debug.Assert(LargestPrimeFactor((27L)) == (3L));\n Debug.Assert(LargestPrimeFactor((63L)) == (7L));\n Debug.Assert(LargestPrimeFactor((330L)) == (11L));\n Debug.Assert(LargestPrimeFactor((13195L)) == (29L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a string, find out how many distinct characters (regardless of case) does it consist of\n public static long CountDistinctCharacters(string str) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CountDistinctCharacters((\"\")) == (0L));\n Debug.Assert(CountDistinctCharacters((\"abcde\")) == (5L));\n Debug.Assert(CountDistinctCharacters((\"abcdecadeCADE\")) == (5L));\n Debug.Assert(CountDistinctCharacters((\"aaaaAAAAaaaa\")) == (1L));\n Debug.Assert(CountDistinctCharacters((\"Jerry jERRY JeRRRY\")) == (5L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You're given a list of deposit and withdrawal operations on a bank account that starts with\n // zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n // at that point function should return True. Otherwise it should return False.\n public static bool BelowZero(List operations) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(BelowZero((new List())) == (false));\n Debug.Assert(BelowZero((new List(new long[]{(long)1L, (long)2L, (long)-3L, (long)1L, (long)2L, (long)-3L}))) == (false));\n Debug.Assert(BelowZero((new List(new long[]{(long)1L, (long)2L, (long)-4L, (long)5L, (long)6L}))) == (true));\n Debug.Assert(BelowZero((new List(new long[]{(long)1L, (long)-1L, (long)2L, (long)-2L, (long)5L, (long)-5L, (long)4L, (long)-4L}))) == (false));\n Debug.Assert(BelowZero((new List(new long[]{(long)1L, (long)-1L, (long)2L, (long)-2L, (long)5L, (long)-5L, (long)4L, (long)-5L}))) == (true));\n Debug.Assert(BelowZero((new List(new long[]{(long)1L, (long)-2L, (long)2L, (long)-2L, (long)5L, (long)-5L, (long)4L, (long)-4L}))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Find the shortest palindrome that begins with a supplied string.\n // Algorithm idea is simple:\n // - Find the longest postfix of supplied string that is a palindrome.\n // - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n public static string MakePalindrome(string str) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(MakePalindrome((\"\")).Equals((\"\")));\n Debug.Assert(MakePalindrome((\"x\")).Equals((\"x\")));\n Debug.Assert(MakePalindrome((\"xyz\")).Equals((\"xyzyx\")));\n Debug.Assert(MakePalindrome((\"xyx\")).Equals((\"xyx\")));\n Debug.Assert(MakePalindrome((\"jerry\")).Equals((\"jerryrrej\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a positive integer, obtain its roman numeral equivalent as a string,\n // and return it in lowercase.\n // Restrictions: 1 <= num <= 1000\n // Examples:\n public static string IntToMiniRoman(long number) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IntToMiniRoman((19L)).Equals((\"xix\")));\n Debug.Assert(IntToMiniRoman((152L)).Equals((\"clii\")));\n Debug.Assert(IntToMiniRoman((251L)).Equals((\"ccli\")));\n Debug.Assert(IntToMiniRoman((426L)).Equals((\"cdxxvi\")));\n Debug.Assert(IntToMiniRoman((500L)).Equals((\"d\")));\n Debug.Assert(IntToMiniRoman((1L)).Equals((\"i\")));\n Debug.Assert(IntToMiniRoman((4L)).Equals((\"iv\")));\n Debug.Assert(IntToMiniRoman((43L)).Equals((\"xliii\")));\n Debug.Assert(IntToMiniRoman((90L)).Equals((\"xc\")));\n Debug.Assert(IntToMiniRoman((94L)).Equals((\"xciv\")));\n Debug.Assert(IntToMiniRoman((532L)).Equals((\"dxxxii\")));\n Debug.Assert(IntToMiniRoman((900L)).Equals((\"cm\")));\n Debug.Assert(IntToMiniRoman((994L)).Equals((\"cmxciv\")));\n Debug.Assert(IntToMiniRoman((1000L)).Equals((\"m\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - } -] \ No newline at end of file diff --git a/data/cs-reworded.json b/data/cs-reworded.json deleted file mode 100644 index 67a4379ad523ef65b43aa66e64b6b68377d6018f..0000000000000000000000000000000000000000 --- a/data/cs-reworded.json +++ /dev/null @@ -1,1898 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // For a given number n, find the largest number that divides n evenly, smaller than n\n // >>> LargestDivisor((15L))\n // (5L)\n public static long LargestDivisor(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(LargestDivisor((3L)) == (1L));\n Debug.Assert(LargestDivisor((7L)) == (1L));\n Debug.Assert(LargestDivisor((10L)) == (5L));\n Debug.Assert(LargestDivisor((100L)) == (50L));\n Debug.Assert(LargestDivisor((49L)) == (7L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_47_median", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return median of elements in the list l.\n // >>> Median((new List(new long[]{(long)3L, (long)1L, (long)2L, (long)4L, (long)5L})))\n // (float)3L\n // >>> Median((new List(new long[]{(long)-10L, (long)4L, (long)6L, (long)1000L, (long)10L, (long)20L})))\n // (15.0f)\n public static float Median(List l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Median((new List(new long[]{(long)3L, (long)1L, (long)2L, (long)4L, (long)5L}))) == (float)3L);\n Debug.Assert(Median((new List(new long[]{(long)-10L, (long)4L, (long)6L, (long)1000L, (long)10L, (long)20L}))) == (8.0f));\n Debug.Assert(Median((new List(new long[]{(long)5L}))) == (float)5L);\n Debug.Assert(Median((new List(new long[]{(long)6L, (long)5L}))) == (5.5f));\n Debug.Assert(Median((new List(new long[]{(long)8L, (long)1L, (long)3L, (long)9L, (long)9L, (long)2L, (long)7L}))) == (float)7L);\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given two lists operator, and operand. The first list has basic algebra operations, and \n // the second list is a list of integers. Use the two given lists to build the algebric \n // expression and return the evaluation of this expression.\n // The basic algebra operations:\n // Addition ( + ) \n // Subtraction ( - ) \n // Multiplication ( * ) \n // Floor division ( // ) \n // Exponentiation ( ** ) \n // Example:\n // operator['+', '*', '-']\n // list = [2, 3, 4, 5]\n // result = 2 + 3 * 4 - 5\n // => result = 9\n // Note:\n // The length of operator list is equal to the length of operand list minus one.\n // Operand is a list of of non-negative integers.\n // Operator list has at least one operator, and operand list has at least two operands.\n public static long DoAlgebra(List op, List operand) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(DoAlgebra((new List(new string[]{(string)\"**\", (string)\"*\", (string)\"+\"})), (new List(new long[]{(long)2L, (long)3L, (long)4L, (long)5L}))) == (37L));\n Debug.Assert(DoAlgebra((new List(new string[]{(string)\"+\", (string)\"*\", (string)\"-\"})), (new List(new long[]{(long)2L, (long)3L, (long)4L, (long)5L}))) == (9L));\n Debug.Assert(DoAlgebra((new List(new string[]{(string)\"//\", (string)\"*\"})), (new List(new long[]{(long)7L, (long)3L, (long)4L}))) == (8L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return maximum element in the list.\n // >>> MaxElement((new List(new long[]{(long)1L, (long)2L, (long)3L})))\n // (3L)\n // >>> MaxElement((new List(new long[]{(long)5L, (long)3L, (long)-5L, (long)2L, (long)-3L, (long)3L, (long)9L, (long)0L, (long)123L, (long)1L, (long)-10L})))\n // (123L)\n public static long MaxElement(List l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(MaxElement((new List(new long[]{(long)1L, (long)2L, (long)3L}))) == (3L));\n Debug.Assert(MaxElement((new List(new long[]{(long)5L, (long)3L, (long)-5L, (long)2L, (long)-3L, (long)3L, (long)9L, (long)0L, (long)124L, (long)1L, (long)-10L}))) == (124L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function which returns the largest index of an element which\n // is not greater than or equal to the element immediately preceding it. If\n // no such element exists then return -1. The given list will not contain\n // duplicate values.\n // Examples:\n // >>> CanArrange((new List(new long[]{(long)1L, (long)2L, (long)4L, (long)3L, (long)5L})))\n // (3L)\n // >>> CanArrange((new List(new long[]{(long)1L, (long)2L, (long)3L})))\n // (-1L)\n public static long CanArrange(List arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CanArrange((new List(new long[]{(long)1L, (long)2L, (long)4L, (long)3L, (long)5L}))) == (3L));\n Debug.Assert(CanArrange((new List(new long[]{(long)1L, (long)2L, (long)4L, (long)5L}))) == (-1L));\n Debug.Assert(CanArrange((new List(new long[]{(long)1L, (long)4L, (long)2L, (long)5L, (long)6L, (long)7L, (long)8L, (long)9L, (long)10L}))) == (2L));\n Debug.Assert(CanArrange((new List(new long[]{(long)4L, (long)8L, (long)5L, (long)7L, (long)3L}))) == (4L));\n Debug.Assert(CanArrange((new List())) == (-1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Imagine a road that's a perfectly straight infinitely long line.\n // n cars are driving left to right; simultaneously, a different set of n cars\n // are driving right to left. The two sets of cars start out being very far from\n // each other. All cars move in the same speed. Two cars are said to collide\n // when a car that's moving left to right hits a car that's moving right to left.\n // However, the cars are infinitely sturdy and strong; as a result, they continue moving\n // in their trajectory as if they did not collide.\n // This function outputs the number of such collisions.\n public static long CarRaceCollision(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CarRaceCollision((2L)) == (4L));\n Debug.Assert(CarRaceCollision((3L)) == (9L));\n Debug.Assert(CarRaceCollision((4L)) == (16L));\n Debug.Assert(CarRaceCollision((8L)) == (64L));\n Debug.Assert(CarRaceCollision((10L)) == (100L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function that returns true if the last character\n // of a given string is an alphabetical character and is not\n // a part of a word, and false otherwise.\n // Note: \"word\" is a group of characters separated by space.\n // Examples:\n // >>> CheckIfLastCharIsALetter((\"apple pie\"))\n // (false)\n // >>> CheckIfLastCharIsALetter((\"apple pi e\"))\n // (true)\n // >>> CheckIfLastCharIsALetter((\"apple pi e \"))\n // (false)\n // >>> CheckIfLastCharIsALetter((\"\"))\n // (false)\n public static bool CheckIfLastCharIsALetter(string txt) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CheckIfLastCharIsALetter((\"apple\")) == (false));\n Debug.Assert(CheckIfLastCharIsALetter((\"apple pi e\")) == (true));\n Debug.Assert(CheckIfLastCharIsALetter((\"eeeee\")) == (false));\n Debug.Assert(CheckIfLastCharIsALetter((\"A\")) == (true));\n Debug.Assert(CheckIfLastCharIsALetter((\"Pumpkin pie \")) == (false));\n Debug.Assert(CheckIfLastCharIsALetter((\"Pumpkin pie 1\")) == (false));\n Debug.Assert(CheckIfLastCharIsALetter((\"\")) == (false));\n Debug.Assert(CheckIfLastCharIsALetter((\"eeeee e \")) == (false));\n Debug.Assert(CheckIfLastCharIsALetter((\"apple pie\")) == (false));\n Debug.Assert(CheckIfLastCharIsALetter((\"apple pi e \")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return true if a given number is prime, and false otherwise.\n // >>> IsPrime((6L))\n // (false)\n // >>> IsPrime((101L))\n // (true)\n // >>> IsPrime((11L))\n // (true)\n // >>> IsPrime((13441L))\n // (true)\n // >>> IsPrime((61L))\n // (true)\n // >>> IsPrime((4L))\n // (false)\n // >>> IsPrime((1L))\n // (false)\n public static bool IsPrime(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsPrime((6L)) == (false));\n Debug.Assert(IsPrime((101L)) == (true));\n Debug.Assert(IsPrime((11L)) == (true));\n Debug.Assert(IsPrime((13441L)) == (true));\n Debug.Assert(IsPrime((61L)) == (true));\n Debug.Assert(IsPrime((4L)) == (false));\n Debug.Assert(IsPrime((1L)) == (false));\n Debug.Assert(IsPrime((5L)) == (true));\n Debug.Assert(IsPrime((11L)) == (true));\n Debug.Assert(IsPrime((17L)) == (true));\n Debug.Assert(IsPrime((85L)) == (false));\n Debug.Assert(IsPrime((77L)) == (false));\n Debug.Assert(IsPrime((255379L)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a list of positive integers x. return a sorted list of all \n // elements that hasn't any even digit.\n // Note: Returned list should be sorted in increasing order.\n // For example:\n // >>> UniqueDigits((new List(new long[]{(long)15L, (long)33L, (long)1422L, (long)1L})))\n // (new List(new long[]{(long)1L, (long)15L, (long)33L}))\n // >>> UniqueDigits((new List(new long[]{(long)152L, (long)323L, (long)1422L, (long)10L})))\n // (new List())\n public static List UniqueDigits(List x) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(UniqueDigits((new List(new long[]{(long)15L, (long)33L, (long)1422L, (long)1L}))).Equals((new List(new long[]{(long)1L, (long)15L, (long)33L}))));\n Debug.Assert(UniqueDigits((new List(new long[]{(long)152L, (long)323L, (long)1422L, (long)10L}))).Equals((new List())));\n Debug.Assert(UniqueDigits((new List(new long[]{(long)12345L, (long)2033L, (long)111L, (long)151L}))).Equals((new List(new long[]{(long)111L, (long)151L}))));\n Debug.Assert(UniqueDigits((new List(new long[]{(long)135L, (long)103L, (long)31L}))).Equals((new List(new long[]{(long)31L, (long)135L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Input are two strings a and b consisting only of 1s and 0s.\n // Perform binary XOR on these inputs and return result also as a string.\n // >>> StringXor((\"010\"), (\"110\"))\n // (\"100\")\n public static string StringXor(string a, string b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(StringXor((\"111000\"), (\"101010\")).Equals((\"010010\")));\n Debug.Assert(StringXor((\"1\"), (\"1\")).Equals((\"0\")));\n Debug.Assert(StringXor((\"0101\"), (\"0000\")).Equals((\"0101\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // sum_to_n is a function that sums numbers from 1 to n.\n // >>> SumToN((30L))\n // (465L)\n // >>> SumToN((100L))\n // (5050L)\n // >>> SumToN((5L))\n // (15L)\n // >>> SumToN((10L))\n // (55L)\n // >>> SumToN((1L))\n // (1L)\n public static long SumToN(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SumToN((1L)) == (1L));\n Debug.Assert(SumToN((6L)) == (21L));\n Debug.Assert(SumToN((11L)) == (66L));\n Debug.Assert(SumToN((30L)) == (465L));\n Debug.Assert(SumToN((100L)) == (5050L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a list of numbers, return the sum of squares of the numbers\n // in the list that are odd. Ignore numbers that are negative or not integers.\n // >>> DoubleTheDifference((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)0L})))\n // (10L)\n // >>> DoubleTheDifference((new List(new long[]{(long)-1L, (long)-2L, (long)0L})))\n // (0L)\n // >>> DoubleTheDifference((new List(new long[]{(long)9L, (long)-2L})))\n // (81L)\n // >>> DoubleTheDifference((new List(new long[]{(long)0L})))\n // (0L)\n // If the input list is empty, return 0.\n public static long DoubleTheDifference(List lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(DoubleTheDifference((new List())) == (0L));\n Debug.Assert(DoubleTheDifference((new List(new float[]{(float)5.0f, (float)4.0f}))) == (25L));\n Debug.Assert(DoubleTheDifference((new List(new float[]{(float)0.1f, (float)0.2f, (float)0.3f}))) == (0L));\n Debug.Assert(DoubleTheDifference((new List(new float[]{(float)-10.0f, (float)-20.0f, (float)-30.0f}))) == (0L));\n Debug.Assert(DoubleTheDifference((new List(new float[]{(float)-1.0f, (float)-2.0f, (float)8.0f}))) == (0L));\n Debug.Assert(DoubleTheDifference((new List(new float[]{(float)0.2f, (float)3.0f, (float)5.0f}))) == (34L));\n Debug.Assert(DoubleTheDifference((new List(new float[]{(float)-9.0f, (float)-7.0f, (float)-5.0f, (float)-3.0f, (float)-1.0f, (float)1.0f, (float)3.0f, (float)5.0f, (float)7.0f, (float)9.0f}))) == (165L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return length of given string\n // >>> StringLength((\"\"))\n // (0L)\n // >>> StringLength((\"abc\"))\n // (3L)\n public static long Strlen(string str) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Strlen((\"\")) == (0L));\n Debug.Assert(Strlen((\"x\")) == (1L));\n Debug.Assert(Strlen((\"asdasnakj\")) == (9L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You'll be given a string of words, and your task is to count the number\n // of boredoms. A boredom is a sentence that starts with the word \"I\".\n // Sentences are delimited by '.', '?' or '!'.\n // For example:\n // >>> IsBored((\"Hello world\"))\n // (0L)\n // >>> IsBored((\"The sky is blue. The sun is shining. I love this weather\"))\n // (1L)\n public static long IsBored(string S) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsBored((\"Hello world\")) == (0L));\n Debug.Assert(IsBored((\"Is the sky blue?\")) == (0L));\n Debug.Assert(IsBored((\"I love It !\")) == (1L));\n Debug.Assert(IsBored((\"bIt\")) == (0L));\n Debug.Assert(IsBored((\"I feel good today. I will be productive. will kill It\")) == (2L));\n Debug.Assert(IsBored((\"You and I are going for a walk\")) == (0L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function vowels_count which takes a string representing\n // a word as input and returns the number of vowels in the string.\n // Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n // vowel, but only when it is at the end of the given word.\n // Example:\n // >>> VowelsCount((\"abcde\"))\n // (2L)\n // >>> VowelsCount((\"ACEDY\"))\n // (3L)\n public static long VowelsCount(string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(VowelsCount((\"abcde\")) == (2L));\n Debug.Assert(VowelsCount((\"Alone\")) == (3L));\n Debug.Assert(VowelsCount((\"key\")) == (2L));\n Debug.Assert(VowelsCount((\"bye\")) == (1L));\n Debug.Assert(VowelsCount((\"keY\")) == (2L));\n Debug.Assert(VowelsCount((\"bYe\")) == (1L));\n Debug.Assert(VowelsCount((\"ACEDY\")) == (3L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return n-th Fibonacci number.\n // >>> Fib((10L))\n // (55L)\n // >>> Fib((1L))\n // (1L)\n // >>> Fib((8L))\n // (21L)\n public static long Fib(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Fib((10L)) == (55L));\n Debug.Assert(Fib((1L)) == (1L));\n Debug.Assert(Fib((8L)) == (21L));\n Debug.Assert(Fib((11L)) == (89L));\n Debug.Assert(Fib((12L)) == (144L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Your task is to implement a function that will simplify the expression\n // x * n. The function returns true if x * n evaluates to a whole number and false\n // otherwise. Both x and n, are string representation of a fraction, and have the following format,\n // / where both numerator and denominator are positive whole numbers.\n // You can assume that x, and n are valid fractions, and do not have zero as denominator.\n // >>> Simplify((\"1/5\"), (\"5/1\"))\n // (true)\n // >>> Simplify((\"1/6\"), (\"2/1\"))\n // (false)\n // >>> Simplify((\"7/10\"), (\"10/2\"))\n // (false)\n public static bool Simplify(string x, string n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Simplify((\"1/5\"), (\"5/1\")) == (true));\n Debug.Assert(Simplify((\"1/6\"), (\"2/1\")) == (false));\n Debug.Assert(Simplify((\"5/1\"), (\"3/1\")) == (true));\n Debug.Assert(Simplify((\"7/10\"), (\"10/2\")) == (false));\n Debug.Assert(Simplify((\"2/10\"), (\"50/10\")) == (true));\n Debug.Assert(Simplify((\"7/2\"), (\"4/2\")) == (true));\n Debug.Assert(Simplify((\"11/6\"), (\"6/1\")) == (true));\n Debug.Assert(Simplify((\"2/3\"), (\"5/2\")) == (false));\n Debug.Assert(Simplify((\"5/2\"), (\"3/5\")) == (false));\n Debug.Assert(Simplify((\"2/4\"), (\"8/4\")) == (true));\n Debug.Assert(Simplify((\"2/4\"), (\"4/2\")) == (true));\n Debug.Assert(Simplify((\"1/5\"), (\"5/1\")) == (true));\n Debug.Assert(Simplify((\"1/5\"), (\"1/5\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a string s, count the number of uppercase vowels in even indices.\n // For example:\n // >>> CountUpper((\"aBCdEf\"))\n // (1L)\n // >>> CountUpper((\"abcdefg\"))\n // (0L)\n // >>> CountUpper((\"dBBE\"))\n // (0L)\n public static long CountUpper(string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CountUpper((\"aBCdEf\")) == (1L));\n Debug.Assert(CountUpper((\"abcdefg\")) == (0L));\n Debug.Assert(CountUpper((\"dBBE\")) == (0L));\n Debug.Assert(CountUpper((\"B\")) == (0L));\n Debug.Assert(CountUpper((\"U\")) == (1L));\n Debug.Assert(CountUpper((\"\")) == (0L));\n Debug.Assert(CountUpper((\"EEEE\")) == (2L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a rectangular grid of wells. Each row represents a single well,\n // and each 1 in a row represents a single unit of water.\n // Each well has a corresponding bucket that can be used to extract water from it, \n // and all buckets have the same capacity.\n // Your task is to use the buckets to empty the wells.\n // Output the number of times you need to lower the buckets.\n // Example 1:\n // >>> MaxFill((new List>(new List[]{(List)new List(new long[]{(long)0L, (long)0L, (long)1L, (long)0L}), (List)new List(new long[]{(long)0L, (long)1L, (long)0L, (long)0L}), (List)new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L})})), (1L))\n // (6L)\n // Example 2:\n // >>> MaxFill((new List>(new List[]{(List)new List(new long[]{(long)0L, (long)0L, (long)1L, (long)1L}), (List)new List(new long[]{(long)0L, (long)0L, (long)0L, (long)0L}), (List)new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L}), (List)new List(new long[]{(long)0L, (long)1L, (long)1L, (long)1L})})), (2L))\n // (5L)\n // Example 3:\n // >>> MaxFill((new List>(new List[]{(List)new List(new long[]{(long)0L, (long)0L, (long)0L}), (List)new List(new long[]{(long)0L, (long)0L, (long)0L})})), (5L))\n // (0L)\n // Constraints:\n // * all wells have the same length\n // * 1 <= grid.length <= 10^2\n // * 1 <= grid[:,1].length <= 10^2\n // * grid[i][j] -> 0 | 1\n // * 1 <= capacity <= 10\n public static long MaxFill(List> grid, long capacity) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(MaxFill((new List>(new List[]{(List)new List(new long[]{(long)0L, (long)0L, (long)1L, (long)0L}), (List)new List(new long[]{(long)0L, (long)1L, (long)0L, (long)0L}), (List)new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L})})), (1L)) == (6L));\n Debug.Assert(MaxFill((new List>(new List[]{(List)new List(new long[]{(long)0L, (long)0L, (long)1L, (long)1L}), (List)new List(new long[]{(long)0L, (long)0L, (long)0L, (long)0L}), (List)new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L}), (List)new List(new long[]{(long)0L, (long)1L, (long)1L, (long)1L})})), (2L)) == (5L));\n Debug.Assert(MaxFill((new List>(new List[]{(List)new List(new long[]{(long)0L, (long)0L, (long)0L}), (List)new List(new long[]{(long)0L, (long)0L, (long)0L})})), (5L)) == (0L));\n Debug.Assert(MaxFill((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L}), (List)new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L})})), (2L)) == (4L));\n Debug.Assert(MaxFill((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L}), (List)new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L})})), (9L)) == (2L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a list arr of integers and a positive integer k, return a sorted list \n // of length k with the maximum k numbers in arr.\n // Example 1:\n // >>> Maximum((new List(new long[]{(long)-3L, (long)-4L, (long)5L})), (3L))\n // (new List(new long[]{(long)-4L, (long)-3L, (long)5L}))\n // Example 2:\n // >>> Maximum((new List(new long[]{(long)4L, (long)-4L, (long)4L})), (2L))\n // (new List(new long[]{(long)4L, (long)4L}))\n // Example 3:\n // >>> Maximum((new List(new long[]{(long)-3L, (long)2L, (long)1L, (long)2L, (long)-1L, (long)-2L, (long)1L})), (1L))\n // (new List(new long[]{(long)2L}))\n // Note:\n // 1. The length of the list will be in the range of [1, 1000].\n // 2. The elements in the list will be in the range of [-1000, 1000].\n // 3. 0 <= k <= len(arr)\n public static List Maximum(List arr, long k) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Maximum((new List(new long[]{(long)-3L, (long)-4L, (long)5L})), (3L)).Equals((new List(new long[]{(long)-4L, (long)-3L, (long)5L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)4L, (long)-4L, (long)4L})), (2L)).Equals((new List(new long[]{(long)4L, (long)4L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)-3L, (long)2L, (long)1L, (long)2L, (long)-1L, (long)-2L, (long)1L})), (1L)).Equals((new List(new long[]{(long)2L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)123L, (long)-123L, (long)20L, (long)0L, (long)1L, (long)2L, (long)-3L})), (3L)).Equals((new List(new long[]{(long)2L, (long)20L, (long)123L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)-123L, (long)20L, (long)0L, (long)1L, (long)2L, (long)-3L})), (4L)).Equals((new List(new long[]{(long)0L, (long)1L, (long)2L, (long)20L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)5L, (long)15L, (long)0L, (long)3L, (long)-13L, (long)-8L, (long)0L})), (7L)).Equals((new List(new long[]{(long)-13L, (long)-8L, (long)0L, (long)0L, (long)3L, (long)5L, (long)15L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)-1L, (long)0L, (long)2L, (long)5L, (long)3L, (long)-10L})), (2L)).Equals((new List(new long[]{(long)3L, (long)5L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)1L, (long)0L, (long)5L, (long)-7L})), (1L)).Equals((new List(new long[]{(long)5L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)4L, (long)-4L})), (2L)).Equals((new List(new long[]{(long)-4L, (long)4L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)-10L, (long)10L})), (2L)).Equals((new List(new long[]{(long)-10L, (long)10L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)-23L, (long)243L, (long)-400L, (long)0L})), (0L)).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that takes a message, and encodes in such a \n // way that it swaps case of all letters, replaces all vowels in \n // the message with the letter that appears 2 places ahead of that \n // vowel in the english alphabet. \n // Assume only letters. \n // Examples:\n // >>> Encode((\"test\"))\n // (\"TGST\")\n // >>> Encode((\"This is a message\"))\n // (\"tHKS KS C MGSSCGG\")\n public static string Encode(string message) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Encode((\"TEST\")).Equals((\"tgst\")));\n Debug.Assert(Encode((\"Mudasir\")).Equals((\"mWDCSKR\")));\n Debug.Assert(Encode((\"YES\")).Equals((\"ygs\")));\n Debug.Assert(Encode((\"This is a message\")).Equals((\"tHKS KS C MGSSCGG\")));\n Debug.Assert(Encode((\"I DoNt KnOw WhAt tO WrItE\")).Equals((\"k dQnT kNqW wHcT Tq wRkTg\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // remove_vowels is a function that takes string and returns string without vowels.\n // >>> RemoveVowels((\"\"))\n // (\"\")\n // >>> RemoveVowels((\"abcdef\"))\n // (\"bcdf\")\n // >>> RemoveVowels((\"aaaaa\"))\n // (\"\")\n // >>> RemoveVowels((\"aaBAA\"))\n // (\"B\")\n // >>> RemoveVowels((\"zbcd\"))\n // (\"zbcd\")\n public static string RemoveVowels(string text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(RemoveVowels((\"\")).Equals((\"\")));\n Debug.Assert(RemoveVowels((\"abcdef\\nghijklm\")).Equals((\"bcdf\\nghjklm\")));\n Debug.Assert(RemoveVowels((\"fedcba\")).Equals((\"fdcb\")));\n Debug.Assert(RemoveVowels((\"eeeee\")).Equals((\"\")));\n Debug.Assert(RemoveVowels((\"acBAA\")).Equals((\"cB\")));\n Debug.Assert(RemoveVowels((\"EcBOO\")).Equals((\"cB\")));\n Debug.Assert(RemoveVowels((\"ybcd\")).Equals((\"ybcd\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return only positive numbers in the list.\n // >>> GetPositive((new List(new long[]{(long)-1L, (long)2L, (long)-4L, (long)5L, (long)6L})))\n // (new List(new long[]{(long)2L, (long)5L, (long)6L}))\n // >>> GetPositive((new List(new long[]{(long)5L, (long)3L, (long)-5L, (long)2L, (long)-3L, (long)3L, (long)9L, (long)0L, (long)123L, (long)1L, (long)-10L})))\n // (new List(new long[]{(long)5L, (long)3L, (long)2L, (long)3L, (long)9L, (long)123L, (long)1L}))\n public static List GetPositive(List l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(GetPositive((new List(new long[]{(long)-1L, (long)-2L, (long)4L, (long)5L, (long)6L}))).Equals((new List(new long[]{(long)4L, (long)5L, (long)6L}))));\n Debug.Assert(GetPositive((new List(new long[]{(long)5L, (long)3L, (long)-5L, (long)2L, (long)3L, (long)3L, (long)9L, (long)0L, (long)123L, (long)1L, (long)-10L}))).Equals((new List(new long[]{(long)5L, (long)3L, (long)2L, (long)3L, (long)3L, (long)9L, (long)123L, (long)1L}))));\n Debug.Assert(GetPositive((new List(new long[]{(long)-1L, (long)-2L}))).Equals((new List())));\n Debug.Assert(GetPositive((new List())).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n // >>> StringSequence((0L))\n // (\"0\")\n // >>> StringSequence((5L))\n // (\"0 1 2 3 4 5\")\n public static string StringSequence(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(StringSequence((0L)).Equals((\"0\")));\n Debug.Assert(StringSequence((3L)).Equals((\"0 1 2 3\")));\n Debug.Assert(StringSequence((10L)).Equals((\"0 1 2 3 4 5 6 7 8 9 10\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a positive integer n, you have to make a pile of n levels of stones.\n // The first level has n stones.\n // The number of stones in the next level is:\n // - the next odd number if n is odd.\n // - the next even number if n is even.\n // Return the number of stones in each level in a list, where element at index\n // i represents the number of stones in the level (i+1).\n // Examples:\n // >>> MakeAPile((3L))\n // (new List(new long[]{(long)3L, (long)5L, (long)7L}))\n public static List MakeAPile(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(MakeAPile((3L)).Equals((new List(new long[]{(long)3L, (long)5L, (long)7L}))));\n Debug.Assert(MakeAPile((4L)).Equals((new List(new long[]{(long)4L, (long)6L, (long)8L, (long)10L}))));\n Debug.Assert(MakeAPile((5L)).Equals((new List(new long[]{(long)5L, (long)7L, (long)9L, (long)11L, (long)13L}))));\n Debug.Assert(MakeAPile((6L)).Equals((new List(new long[]{(long)6L, (long)8L, (long)10L, (long)12L, (long)14L, (long)16L}))));\n Debug.Assert(MakeAPile((8L)).Equals((new List(new long[]{(long)8L, (long)10L, (long)12L, (long)14L, (long)16L, (long)18L, (long)20L, (long)22L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Task\n // 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\n // then check if the result string is palindrome.\n // A string is called palindrome if it reads the same backward as forward.\n // You should return a tuple containing the result string and true/false for the check.\n // Example\n // >>> ReverseDelete((\"abcde\"), (\"ae\"))\n // (Tuple.Create(\"bcd\", false))\n // >>> ReverseDelete((\"abcdef\"), (\"b\"))\n // (Tuple.Create(\"acdef\", false))\n // >>> ReverseDelete((\"abcdedcba\"), (\"ab\"))\n // (Tuple.Create(\"cdedc\", true))\n public static Tuple ReverseDelete(string s, string c) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ReverseDelete((\"abcde\"), (\"ae\")).Equals((Tuple.Create(\"bcd\", false))));\n Debug.Assert(ReverseDelete((\"abcdef\"), (\"b\")).Equals((Tuple.Create(\"acdef\", false))));\n Debug.Assert(ReverseDelete((\"abcdedcba\"), (\"ab\")).Equals((Tuple.Create(\"cdedc\", true))));\n Debug.Assert(ReverseDelete((\"dwik\"), (\"w\")).Equals((Tuple.Create(\"dik\", false))));\n Debug.Assert(ReverseDelete((\"a\"), (\"a\")).Equals((Tuple.Create(\"\", true))));\n Debug.Assert(ReverseDelete((\"abcdedcba\"), (\"\")).Equals((Tuple.Create(\"abcdedcba\", true))));\n Debug.Assert(ReverseDelete((\"abcdedcba\"), (\"v\")).Equals((Tuple.Create(\"abcdedcba\", true))));\n Debug.Assert(ReverseDelete((\"vabba\"), (\"v\")).Equals((Tuple.Create(\"abba\", true))));\n Debug.Assert(ReverseDelete((\"mamma\"), (\"mia\")).Equals((Tuple.Create(\"\", true))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n // >>> FlipCase((\"Hello\"))\n // (\"hELLO\")\n public static string FlipCase(string str) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FlipCase((\"\")).Equals((\"\")));\n Debug.Assert(FlipCase((\"Hello!\")).Equals((\"hELLO!\")));\n Debug.Assert(FlipCase((\"These violent delights have violent ends\")).Equals((\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a string s.\n // if s[i] is a letter, reverse its case from lower to upper or vise versa, \n // otherwise keep it as it is.\n // If the string contains no letters, reverse the string.\n // The function should return the resulted string.\n // Examples\n // >>> Solve((\"1234\"))\n // (\"4321\")\n // >>> Solve((\"ab\"))\n // (\"AB\")\n // >>> Solve((\"#a@C\"))\n // (\"#A@c\")\n public static string Solve(string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Solve((\"AsDf\")).Equals((\"aSdF\")));\n Debug.Assert(Solve((\"1234\")).Equals((\"4321\")));\n Debug.Assert(Solve((\"ab\")).Equals((\"AB\")));\n Debug.Assert(Solve((\"#a@C\")).Equals((\"#A@c\")));\n Debug.Assert(Solve((\"#AsdfW^45\")).Equals((\"#aSDFw^45\")));\n Debug.Assert(Solve((\"#6@2\")).Equals((\"2@6#\")));\n Debug.Assert(Solve((\"#$a^D\")).Equals((\"#$A^d\")));\n Debug.Assert(Solve((\"#ccc\")).Equals((\"#CCC\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Filter an input list of strings only for ones that start with a given prefix.\n // >>> FilterByPrefix((new List()), (\"a\"))\n // (new List())\n // >>> FilterByPrefix((new List(new string[]{(string)\"abc\", (string)\"bcd\", (string)\"cde\", (string)\"array\"})), (\"a\"))\n // (new List(new string[]{(string)\"abc\", (string)\"array\"}))\n public static List FilterByPrefix(List strings, string prefix) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FilterByPrefix((new List()), (\"john\")).Equals((new List())));\n Debug.Assert(FilterByPrefix((new List(new string[]{(string)\"xxx\", (string)\"asd\", (string)\"xxy\", (string)\"john doe\", (string)\"xxxAAA\", (string)\"xxx\"})), (\"xxx\")).Equals((new List(new string[]{(string)\"xxx\", (string)\"xxxAAA\", (string)\"xxx\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // This function takes two positive numbers x and y and returns the\n // biggest even integer number that is in the range [x, y] inclusive. If \n // there's no such number, then the function should return -1.\n // For example:\n // >>> ChooseNum((12L), (15L))\n // (14L)\n // >>> ChooseNum((13L), (12L))\n // (-1L)\n public static long ChooseNum(long x, long y) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ChooseNum((12L), (15L)) == (14L));\n Debug.Assert(ChooseNum((13L), (12L)) == (-1L));\n Debug.Assert(ChooseNum((33L), (12354L)) == (12354L));\n Debug.Assert(ChooseNum((5234L), (5233L)) == (-1L));\n Debug.Assert(ChooseNum((6L), (29L)) == (28L));\n Debug.Assert(ChooseNum((27L), (10L)) == (-1L));\n Debug.Assert(ChooseNum((7L), (7L)) == (-1L));\n Debug.Assert(ChooseNum((546L), (546L)) == (546L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a string representing a sentence,\n // the sentence contains some words separated by a space,\n // and you have to return a string that contains the words from the original sentence,\n // whose lengths are prime numbers,\n // the order of the words in the new string should be the same as the original one.\n // Example 1:\n // >>> WordsInSentence((\"This is a test\"))\n // (\"is\")\n // Example 2:\n // >>> WordsInSentence((\"lets go for swimming\"))\n // (\"go for\")\n // Constraints:\n // * 1 <= len(sentence) <= 100\n // * sentence contains only letters\n public static string WordsInSentence(string sentence) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(WordsInSentence((\"This is a test\")).Equals((\"is\")));\n Debug.Assert(WordsInSentence((\"lets go for swimming\")).Equals((\"go for\")));\n Debug.Assert(WordsInSentence((\"there is no place available here\")).Equals((\"there is no place\")));\n Debug.Assert(WordsInSentence((\"Hi I am Hussein\")).Equals((\"Hi am Hussein\")));\n Debug.Assert(WordsInSentence((\"go for it\")).Equals((\"go for it\")));\n Debug.Assert(WordsInSentence((\"here\")).Equals((\"\")));\n Debug.Assert(WordsInSentence((\"here is\")).Equals((\"is\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n // >>> Intersperse((new List()), (4L))\n // (new List())\n // >>> Intersperse((new List(new long[]{(long)1L, (long)2L, (long)3L})), (4L))\n // (new List(new long[]{(long)1L, (long)4L, (long)2L, (long)4L, (long)3L}))\n public static List Intersperse(List numbers, long delimeter) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Intersperse((new List()), (7L)).Equals((new List())));\n Debug.Assert(Intersperse((new List(new long[]{(long)5L, (long)6L, (long)3L, (long)2L})), (8L)).Equals((new List(new long[]{(long)5L, (long)8L, (long)6L, (long)8L, (long)3L, (long)8L, (long)2L}))));\n Debug.Assert(Intersperse((new List(new long[]{(long)2L, (long)2L, (long)2L})), (2L)).Equals((new List(new long[]{(long)2L, (long)2L, (long)2L, (long)2L, (long)2L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Your task is to write a function that returns true if a number x is a simple\n // power of n and false in other cases.\n // x is a simple power of n if n**int=x\n // For example:\n // >>> IsSimplePower((1L), (4L))\n // (true)\n // >>> IsSimplePower((2L), (2L))\n // (true)\n // >>> IsSimplePower((8L), (2L))\n // (true)\n // >>> IsSimplePower((3L), (2L))\n // (false)\n // >>> IsSimplePower((3L), (1L))\n // (false)\n // >>> IsSimplePower((5L), (3L))\n // (false)\n public static bool IsSimplePower(long x, long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsSimplePower((16L), (2L)) == (true));\n Debug.Assert(IsSimplePower((143214L), (16L)) == (false));\n Debug.Assert(IsSimplePower((4L), (2L)) == (true));\n Debug.Assert(IsSimplePower((9L), (3L)) == (true));\n Debug.Assert(IsSimplePower((16L), (4L)) == (true));\n Debug.Assert(IsSimplePower((24L), (2L)) == (false));\n Debug.Assert(IsSimplePower((128L), (4L)) == (false));\n Debug.Assert(IsSimplePower((12L), (6L)) == (false));\n Debug.Assert(IsSimplePower((1L), (1L)) == (true));\n Debug.Assert(IsSimplePower((1L), (12L)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that returns true if the given number is the multiplication of 3 prime numbers\n // and false otherwise.\n // Knowing that (a) is less then 100. \n // Example:\n // >>> IsMultiplyPrime((30L))\n // (true)\n // 30 = 2 * 3 * 5\n public static bool IsMultiplyPrime(long a) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsMultiplyPrime((5L)) == (false));\n Debug.Assert(IsMultiplyPrime((30L)) == (true));\n Debug.Assert(IsMultiplyPrime((8L)) == (true));\n Debug.Assert(IsMultiplyPrime((10L)) == (false));\n Debug.Assert(IsMultiplyPrime((125L)) == (true));\n Debug.Assert(IsMultiplyPrime((105L)) == (true));\n Debug.Assert(IsMultiplyPrime((126L)) == (false));\n Debug.Assert(IsMultiplyPrime((729L)) == (false));\n Debug.Assert(IsMultiplyPrime((891L)) == (false));\n Debug.Assert(IsMultiplyPrime((1001L)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given the lengths of the three sides of a triangle. Return true if the three\n // sides form a right-angled triangle, false otherwise.\n // A right-angled triangle is a triangle in which one angle is right angle or \n // 90 degree.\n // Example:\n // >>> RightAngleTriangle((3L), (4L), (5L))\n // (true)\n // >>> RightAngleTriangle((1L), (2L), (3L))\n // (false)\n public static bool RightAngleTriangle(long a, long b, long c) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(RightAngleTriangle((3L), (4L), (5L)) == (true));\n Debug.Assert(RightAngleTriangle((1L), (2L), (3L)) == (false));\n Debug.Assert(RightAngleTriangle((10L), (6L), (8L)) == (true));\n Debug.Assert(RightAngleTriangle((2L), (2L), (2L)) == (false));\n Debug.Assert(RightAngleTriangle((7L), (24L), (25L)) == (true));\n Debug.Assert(RightAngleTriangle((10L), (5L), (7L)) == (false));\n Debug.Assert(RightAngleTriangle((5L), (12L), (13L)) == (true));\n Debug.Assert(RightAngleTriangle((15L), (8L), (17L)) == (true));\n Debug.Assert(RightAngleTriangle((48L), (55L), (73L)) == (true));\n Debug.Assert(RightAngleTriangle((1L), (1L), (1L)) == (false));\n Debug.Assert(RightAngleTriangle((2L), (2L), (10L)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function that takes 3 numbers.\n // Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n // Returns false in any other cases.\n // Examples\n // >>> AnyInt((float)5L, (float)2L, (float)7L)\n // (true)\n // >>> AnyInt((float)3L, (float)2L, (float)2L)\n // (false)\n // >>> AnyInt((float)3L, (float)-2L, (float)1L)\n // (true)\n // >>> AnyInt((3.6f), (-2.2f), (float)2L)\n // (false)\n public static bool AnyInt(float x, float y, float z) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(AnyInt((float)2L, (float)3L, (float)1L) == (true));\n Debug.Assert(AnyInt((2.5f), (float)2L, (float)3L) == (false));\n Debug.Assert(AnyInt((1.5f), (float)5L, (3.5f)) == (false));\n Debug.Assert(AnyInt((float)2L, (float)6L, (float)2L) == (false));\n Debug.Assert(AnyInt((float)4L, (float)2L, (float)2L) == (true));\n Debug.Assert(AnyInt((2.2f), (2.2f), (2.2f)) == (false));\n Debug.Assert(AnyInt((float)-4L, (float)6L, (float)2L) == (true));\n Debug.Assert(AnyInt((float)2L, (float)1L, (float)1L) == (true));\n Debug.Assert(AnyInt((float)3L, (float)4L, (float)7L) == (true));\n Debug.Assert(AnyInt((3.0f), (float)4L, (float)7L) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // This function takes a list l and returns a list l' such that\n // l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n // to the values of the corresponding indicies of l, but sorted.\n // >>> SortThird((new List(new long[]{(long)1L, (long)2L, (long)3L})))\n // (new List(new long[]{(long)1L, (long)2L, (long)3L}))\n // >>> SortThird((new List(new long[]{(long)5L, (long)6L, (long)3L, (long)4L, (long)8L, (long)9L, (long)2L})))\n // (new List(new long[]{(long)2L, (long)6L, (long)3L, (long)4L, (long)8L, (long)9L, (long)5L}))\n public static List SortThird(List l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SortThird((new List(new long[]{(long)5L, (long)6L, (long)3L, (long)4L, (long)8L, (long)9L, (long)2L}))).Equals((new List(new long[]{(long)2L, (long)6L, (long)3L, (long)4L, (long)8L, (long)9L, (long)5L}))));\n Debug.Assert(SortThird((new List(new long[]{(long)5L, (long)8L, (long)3L, (long)4L, (long)6L, (long)9L, (long)2L}))).Equals((new List(new long[]{(long)2L, (long)8L, (long)3L, (long)4L, (long)6L, (long)9L, (long)5L}))));\n Debug.Assert(SortThird((new List(new long[]{(long)5L, (long)6L, (long)9L, (long)4L, (long)8L, (long)3L, (long)2L}))).Equals((new List(new long[]{(long)2L, (long)6L, (long)9L, (long)4L, (long)8L, (long)3L, (long)5L}))));\n Debug.Assert(SortThird((new List(new long[]{(long)5L, (long)6L, (long)3L, (long)4L, (long)8L, (long)9L, (long)2L, (long)1L}))).Equals((new List(new long[]{(long)2L, (long)6L, (long)3L, (long)4L, (long)8L, (long)9L, (long)5L, (long)1L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_53_add", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Add two numbers x and y\n // >>> Add((2L), (3L))\n // (5L)\n // >>> Add((5L), (7L))\n // (12L)\n public static long Add(long x, long y) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Add((0L), (1L)) == (1L));\n Debug.Assert(Add((1L), (0L)) == (1L));\n Debug.Assert(Add((2L), (3L)) == (5L));\n Debug.Assert(Add((5L), (7L)) == (12L));\n Debug.Assert(Add((7L), (5L)) == (12L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_69_search", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n // zero, and has a frequency greater than or equal to the value of the integer itself. \n // The frequency of an integer is the number of times it appears in the list.\n // If no such a value exist, return -1.\n // Examples:\n // >>> Search((new List(new long[]{(long)4L, (long)1L, (long)2L, (long)2L, (long)3L, (long)1L})))\n // (2L)\n // >>> Search((new List(new long[]{(long)1L, (long)2L, (long)2L, (long)3L, (long)3L, (long)3L, (long)4L, (long)4L, (long)4L})))\n // (3L)\n // >>> Search((new List(new long[]{(long)5L, (long)5L, (long)4L, (long)4L, (long)4L})))\n // (-1L)\n public static long Search(List lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Search((new List(new long[]{(long)5L, (long)5L, (long)5L, (long)5L, (long)1L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)4L, (long)1L, (long)4L, (long)1L, (long)4L, (long)4L}))) == (4L));\n Debug.Assert(Search((new List(new long[]{(long)3L, (long)3L}))) == (-1L));\n Debug.Assert(Search((new List(new long[]{(long)8L, (long)8L, (long)8L, (long)8L, (long)8L, (long)8L, (long)8L, (long)8L}))) == (8L));\n Debug.Assert(Search((new List(new long[]{(long)2L, (long)3L, (long)3L, (long)2L, (long)2L}))) == (2L));\n Debug.Assert(Search((new List(new long[]{(long)2L, (long)7L, (long)8L, (long)8L, (long)4L, (long)8L, (long)7L, (long)3L, (long)9L, (long)6L, (long)5L, (long)10L, (long)4L, (long)3L, (long)6L, (long)7L, (long)1L, (long)7L, (long)4L, (long)10L, (long)8L, (long)1L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)3L, (long)2L, (long)8L, (long)2L}))) == (2L));\n Debug.Assert(Search((new List(new long[]{(long)6L, (long)7L, (long)1L, (long)8L, (long)8L, (long)10L, (long)5L, (long)8L, (long)5L, (long)3L, (long)10L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)8L, (long)8L, (long)3L, (long)6L, (long)5L, (long)6L, (long)4L}))) == (-1L));\n Debug.Assert(Search((new List(new long[]{(long)6L, (long)9L, (long)6L, (long)7L, (long)1L, (long)4L, (long)7L, (long)1L, (long)8L, (long)8L, (long)9L, (long)8L, (long)10L, (long)10L, (long)8L, (long)4L, (long)10L, (long)4L, (long)10L, (long)1L, (long)2L, (long)9L, (long)5L, (long)7L, (long)9L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)1L, (long)9L, (long)10L, (long)1L, (long)3L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)6L, (long)9L, (long)7L, (long)5L, (long)8L, (long)7L, (long)5L, (long)3L, (long)7L, (long)5L, (long)10L, (long)10L, (long)3L, (long)6L, (long)10L, (long)2L, (long)8L, (long)6L, (long)5L, (long)4L, (long)9L, (long)5L, (long)3L, (long)10L}))) == (5L));\n Debug.Assert(Search((new List(new long[]{(long)1L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)8L, (long)8L, (long)10L, (long)6L, (long)4L, (long)3L, (long)5L, (long)8L, (long)2L, (long)4L, (long)2L, (long)8L, (long)4L, (long)6L, (long)10L, (long)4L, (long)2L, (long)1L, (long)10L, (long)2L, (long)1L, (long)1L, (long)5L}))) == (4L));\n Debug.Assert(Search((new List(new long[]{(long)2L, (long)10L, (long)4L, (long)8L, (long)2L, (long)10L, (long)5L, (long)1L, (long)2L, (long)9L, (long)5L, (long)5L, (long)6L, (long)3L, (long)8L, (long)6L, (long)4L, (long)10L}))) == (2L));\n Debug.Assert(Search((new List(new long[]{(long)1L, (long)6L, (long)10L, (long)1L, (long)6L, (long)9L, (long)10L, (long)8L, (long)6L, (long)8L, (long)7L, (long)3L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)9L, (long)2L, (long)4L, (long)1L, (long)5L, (long)1L, (long)5L, (long)2L, (long)5L, (long)7L, (long)7L, (long)7L, (long)3L, (long)10L, (long)1L, (long)5L, (long)4L, (long)2L, (long)8L, (long)4L, (long)1L, (long)9L, (long)10L, (long)7L, (long)10L, (long)2L, (long)8L, (long)10L, (long)9L, (long)4L}))) == (4L));\n Debug.Assert(Search((new List(new long[]{(long)2L, (long)6L, (long)4L, (long)2L, (long)8L, (long)7L, (long)5L, (long)6L, (long)4L, (long)10L, (long)4L, (long)6L, (long)3L, (long)7L, (long)8L, (long)8L, (long)3L, (long)1L, (long)4L, (long)2L, (long)2L, (long)10L, (long)7L}))) == (4L));\n Debug.Assert(Search((new List(new long[]{(long)9L, (long)8L, (long)6L, (long)10L, (long)2L, (long)6L, (long)10L, (long)2L, (long)7L, (long)8L, (long)10L, (long)3L, (long)8L, (long)2L, (long)6L, (long)2L, (long)3L, (long)1L}))) == (2L));\n Debug.Assert(Search((new List(new long[]{(long)5L, (long)5L, (long)3L, (long)9L, (long)5L, (long)6L, (long)3L, (long)2L, (long)8L, (long)5L, (long)6L, (long)10L, (long)10L, (long)6L, (long)8L, (long)4L, (long)10L, (long)7L, (long)7L, (long)10L, (long)8L}))) == (-1L));\n Debug.Assert(Search((new List(new long[]{(long)10L}))) == (-1L));\n Debug.Assert(Search((new List(new long[]{(long)9L, (long)7L, (long)7L, (long)2L, (long)4L, (long)7L, (long)2L, (long)10L, (long)9L, (long)7L, (long)5L, (long)7L, (long)2L}))) == (2L));\n Debug.Assert(Search((new List(new long[]{(long)5L, (long)4L, (long)10L, (long)2L, (long)1L, (long)1L, (long)10L, (long)3L, (long)6L, (long)1L, (long)8L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)7L, (long)9L, (long)9L, (long)9L, (long)3L, (long)4L, (long)1L, (long)5L, (long)9L, (long)1L, (long)2L, (long)1L, (long)1L, (long)10L, (long)7L, (long)5L, (long)6L, (long)7L, (long)6L, (long)7L, (long)7L, (long)6L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)3L, (long)10L, (long)10L, (long)9L, (long)2L}))) == (-1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that takes a string and returns true if the string\n // length is a prime number or false otherwise\n // Examples\n // >>> PrimeLength((\"Hello\"))\n // (true)\n // >>> PrimeLength((\"abcdcba\"))\n // (true)\n // >>> PrimeLength((\"kittens\"))\n // (true)\n // >>> PrimeLength((\"orange\"))\n // (false)\n public static bool PrimeLength(string str) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(PrimeLength((\"Hello\")) == (true));\n Debug.Assert(PrimeLength((\"abcdcba\")) == (true));\n Debug.Assert(PrimeLength((\"kittens\")) == (true));\n Debug.Assert(PrimeLength((\"orange\")) == (false));\n Debug.Assert(PrimeLength((\"wow\")) == (true));\n Debug.Assert(PrimeLength((\"world\")) == (true));\n Debug.Assert(PrimeLength((\"MadaM\")) == (true));\n Debug.Assert(PrimeLength((\"Wow\")) == (true));\n Debug.Assert(PrimeLength((\"\")) == (false));\n Debug.Assert(PrimeLength((\"HI\")) == (true));\n Debug.Assert(PrimeLength((\"go\")) == (true));\n Debug.Assert(PrimeLength((\"gogo\")) == (false));\n Debug.Assert(PrimeLength((\"aaaaaaaaaaaaaaa\")) == (false));\n Debug.Assert(PrimeLength((\"Madam\")) == (true));\n Debug.Assert(PrimeLength((\"M\")) == (false));\n Debug.Assert(PrimeLength((\"0\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_58_common", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return sorted unique common elements for two lists.\n // >>> Common((new List(new long[]{(long)1L, (long)4L, (long)3L, (long)34L, (long)653L, (long)2L, (long)5L})), (new List(new long[]{(long)5L, (long)7L, (long)1L, (long)5L, (long)9L, (long)653L, (long)121L})))\n // (new List(new long[]{(long)1L, (long)5L, (long)653L}))\n // >>> Common((new List(new long[]{(long)5L, (long)3L, (long)2L, (long)8L})), (new List(new long[]{(long)3L, (long)2L})))\n // (new List(new long[]{(long)2L, (long)3L}))\n public static List Common(List l1, List l2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Common((new List(new long[]{(long)1L, (long)4L, (long)3L, (long)34L, (long)653L, (long)2L, (long)5L})), (new List(new long[]{(long)5L, (long)7L, (long)1L, (long)5L, (long)9L, (long)653L, (long)121L}))).Equals((new List(new long[]{(long)1L, (long)5L, (long)653L}))));\n Debug.Assert(Common((new List(new long[]{(long)5L, (long)3L, (long)2L, (long)8L})), (new List(new long[]{(long)3L, (long)2L}))).Equals((new List(new long[]{(long)2L, (long)3L}))));\n Debug.Assert(Common((new List(new long[]{(long)4L, (long)3L, (long)2L, (long)8L})), (new List(new long[]{(long)3L, (long)2L, (long)4L}))).Equals((new List(new long[]{(long)2L, (long)3L, (long)4L}))));\n Debug.Assert(Common((new List(new long[]{(long)4L, (long)3L, (long)2L, (long)8L})), (new List())).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // The Brazilian factorial is defined as:\n // brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n // where n > 0\n // For example:\n // >>> SpecialFactorial((4L))\n // (288L)\n // The function will receive an integer as input and should return the special\n // factorial of this integer.\n public static long SpecialFactorial(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SpecialFactorial((4L)) == (288L));\n Debug.Assert(SpecialFactorial((5L)) == (34560L));\n Debug.Assert(SpecialFactorial((7L)) == (125411328000L));\n Debug.Assert(SpecialFactorial((1L)) == (1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // In this problem, you will implement a function that takes two lists of numbers,\n // and determines whether it is possible to perform an exchange of elements\n // between them to make lst1 a list of only even numbers.\n // There is no limit on the number of exchanged elements between lst1 and lst2.\n // If it is possible to exchange elements between the lst1 and lst2 to make\n // all the elements of lst1 to be even, return \"YES\".\n // Otherwise, return \"NO\".\n // For example:\n // >>> Exchange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L})), (new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L})))\n // (\"YES\")\n // >>> Exchange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L})), (new List(new long[]{(long)1L, (long)5L, (long)3L, (long)4L})))\n // (\"NO\")\n // It is assumed that the input lists will be non-empty.\n public static string Exchange(List lst1, List lst2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Exchange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L})), (new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))).Equals((\"YES\")));\n Debug.Assert(Exchange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L})), (new List(new long[]{(long)1L, (long)5L, (long)3L, (long)4L}))).Equals((\"NO\")));\n Debug.Assert(Exchange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L})), (new List(new long[]{(long)2L, (long)1L, (long)4L, (long)3L}))).Equals((\"YES\")));\n Debug.Assert(Exchange((new List(new long[]{(long)5L, (long)7L, (long)3L})), (new List(new long[]{(long)2L, (long)6L, (long)4L}))).Equals((\"YES\")));\n Debug.Assert(Exchange((new List(new long[]{(long)5L, (long)7L, (long)3L})), (new List(new long[]{(long)2L, (long)6L, (long)3L}))).Equals((\"NO\")));\n Debug.Assert(Exchange((new List(new long[]{(long)3L, (long)2L, (long)6L, (long)1L, (long)8L, (long)9L})), (new List(new long[]{(long)3L, (long)5L, (long)5L, (long)1L, (long)1L, (long)1L}))).Equals((\"NO\")));\n Debug.Assert(Exchange((new List(new long[]{(long)100L, (long)200L})), (new List(new long[]{(long)200L, (long)200L}))).Equals((\"YES\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a non-empty list of integers arr and an integer k, return\n // the sum of the elements with at most two digits from the first k elements of arr.\n // Example:\n // >>> AddElements((new List(new long[]{(long)111L, (long)21L, (long)3L, (long)4000L, (long)5L, (long)6L, (long)7L, (long)8L, (long)9L})), (4L))\n // (24L)\n // Constraints:\n // 1. 1 <= len(arr) <= 100\n // 2. 1 <= k <= len(arr)\n public static long AddElements(List arr, long k) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(AddElements((new List(new long[]{(long)1L, (long)-2L, (long)-3L, (long)41L, (long)57L, (long)76L, (long)87L, (long)88L, (long)99L})), (3L)) == (-4L));\n Debug.Assert(AddElements((new List(new long[]{(long)111L, (long)121L, (long)3L, (long)4000L, (long)5L, (long)6L})), (2L)) == (0L));\n Debug.Assert(AddElements((new List(new long[]{(long)11L, (long)21L, (long)3L, (long)90L, (long)5L, (long)6L, (long)7L, (long)8L, (long)9L})), (4L)) == (125L));\n Debug.Assert(AddElements((new List(new long[]{(long)111L, (long)21L, (long)3L, (long)4000L, (long)5L, (long)6L, (long)7L, (long)8L, (long)9L})), (4L)) == (24L));\n Debug.Assert(AddElements((new List(new long[]{(long)1L})), (1L)) == (1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // A simple program which should return the value of x if n is \n // a prime number and should return the value of y otherwise.\n // Examples:\n // >>> XOrY((7L), (34L), (12L))\n // (34L)\n // >>> XOrY((15L), (8L), (5L))\n // (5L)\n public static long XOrY(long n, long x, long y) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(XOrY((7L), (34L), (12L)) == (34L));\n Debug.Assert(XOrY((15L), (8L), (5L)) == (5L));\n Debug.Assert(XOrY((3L), (33L), (5212L)) == (33L));\n Debug.Assert(XOrY((1259L), (3L), (52L)) == (3L));\n Debug.Assert(XOrY((7919L), (-1L), (12L)) == (-1L));\n Debug.Assert(XOrY((3609L), (1245L), (583L)) == (583L));\n Debug.Assert(XOrY((91L), (56L), (129L)) == (129L));\n Debug.Assert(XOrY((6L), (34L), (1234L)) == (1234L));\n Debug.Assert(XOrY((1L), (2L), (0L)) == (0L));\n Debug.Assert(XOrY((2L), (2L), (0L)) == (2L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given length of a side and high return area for a triangle.\n // >>> TriangleArea((5L), (3L))\n // (7.5f)\n public static float TriangleArea(long a, long h) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(TriangleArea((5L), (3L)) == (7.5f));\n Debug.Assert(TriangleArea((2L), (2L)) == (2.0f));\n Debug.Assert(TriangleArea((10L), (8L)) == (40.0f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n // the last couple centuries. However, what people don't know is Tribonacci sequence.\n // Tribonacci sequence is defined by the recurrence:\n // tri(1) = 3\n // tri(n) = 1 + n / 2, if n is even.\n // tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n // For example:\n // tri(2) = 1 + (2 / 2) = 2\n // tri(4) = 3\n // tri(3) = tri(2) + tri(1) + tri(4)\n // = 2 + 3 + 3 = 8 \n // You are given a non-negative integer number n, you have to a return a list of the \n // first n + 1 numbers of the Tribonacci sequence.\n // Examples:\n // >>> Tri((3L))\n // (new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L}))\n public static List Tri(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Tri((3L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L}))));\n Debug.Assert(Tri((4L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L, (long)3L}))));\n Debug.Assert(Tri((5L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L, (long)3L, (long)15L}))));\n Debug.Assert(Tri((6L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L, (long)3L, (long)15L, (long)4L}))));\n Debug.Assert(Tri((7L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L, (long)3L, (long)15L, (long)4L, (long)24L}))));\n Debug.Assert(Tri((8L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L, (long)3L, (long)15L, (long)4L, (long)24L, (long)5L}))));\n Debug.Assert(Tri((9L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L, (long)3L, (long)15L, (long)4L, (long)24L, (long)5L, (long)35L}))));\n Debug.Assert(Tri((20L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L, (long)3L, (long)15L, (long)4L, (long)24L, (long)5L, (long)35L, (long)6L, (long)48L, (long)7L, (long)63L, (long)8L, (long)80L, (long)9L, (long)99L, (long)10L, (long)120L, (long)11L}))));\n Debug.Assert(Tri((0L)).Equals((new List(new long[]{(long)1L}))));\n Debug.Assert(Tri((1L)).Equals((new List(new long[]{(long)1L, (long)3L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a list of two strings, both strings consist of open\n // parentheses '(' or close parentheses ')' only.\n // Your job is to check if it is possible to concatenate the two strings in\n // some order, that the resulting string will be good.\n // A string S is considered to be good if and only if all parentheses in S\n // are balanced. For example: the string '(())()' is good, while the string\n // '())' is not.\n // Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n // Examples:\n // >>> MatchParens((new List(new string[]{(string)\"()(\", (string)\")\"})))\n // (\"Yes\")\n // >>> MatchParens((new List(new string[]{(string)\")\", (string)\")\"})))\n // (\"No\")\n public static string MatchParens(List lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(MatchParens((new List(new string[]{(string)\"()(\", (string)\")\"}))).Equals((\"Yes\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\")\", (string)\")\"}))).Equals((\"No\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\"(()(())\", (string)\"())())\"}))).Equals((\"No\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\")())\", (string)\"(()()(\"}))).Equals((\"Yes\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\"(())))\", (string)\"(()())((\"}))).Equals((\"Yes\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\"()\", (string)\"())\"}))).Equals((\"No\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\"(()(\", (string)\"()))()\"}))).Equals((\"Yes\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\"((((\", (string)\"((())\"}))).Equals((\"No\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\")(()\", (string)\"(()(\"}))).Equals((\"No\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\")(\", (string)\")(\"}))).Equals((\"No\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\"(\", (string)\")\"}))).Equals((\"Yes\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\")\", (string)\"(\"}))).Equals((\"Yes\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // From a list of integers, remove all elements that occur more than once.\n // Keep order of elements left the same as in the input.\n // >>> RemoveDuplicates((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)2L, (long)4L})))\n // (new List(new long[]{(long)1L, (long)3L, (long)4L}))\n public static List RemoveDuplicates(List numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(RemoveDuplicates((new List())).Equals((new List())));\n Debug.Assert(RemoveDuplicates((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))).Equals((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))));\n Debug.Assert(RemoveDuplicates((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)2L, (long)4L, (long)3L, (long)5L}))).Equals((new List(new long[]{(long)1L, (long)4L, (long)5L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return a greatest common divisor of two integers a and b\n // >>> GreatestCommonDivisor((3L), (5L))\n // (1L)\n // >>> GreatestCommonDivisor((25L), (15L))\n // (5L)\n public static long GreatestCommonDivisor(long a, long b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(GreatestCommonDivisor((3L), (7L)) == (1L));\n Debug.Assert(GreatestCommonDivisor((10L), (15L)) == (5L));\n Debug.Assert(GreatestCommonDivisor((49L), (14L)) == (7L));\n Debug.Assert(GreatestCommonDivisor((144L), (60L)) == (12L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Checks if given string is a palindrome\n // >>> IsPalindrome((\"\"))\n // (true)\n // >>> IsPalindrome((\"aba\"))\n // (true)\n // >>> IsPalindrome((\"aaaaa\"))\n // (true)\n // >>> IsPalindrome((\"zbcd\"))\n // (false)\n public static bool IsPalindrome(string text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsPalindrome((\"\")) == (true));\n Debug.Assert(IsPalindrome((\"aba\")) == (true));\n Debug.Assert(IsPalindrome((\"aaaaa\")) == (true));\n Debug.Assert(IsPalindrome((\"zbcd\")) == (false));\n Debug.Assert(IsPalindrome((\"xywyx\")) == (true));\n Debug.Assert(IsPalindrome((\"xywyz\")) == (false));\n Debug.Assert(IsPalindrome((\"xywzx\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // xs represent coefficients of a polynomial.\n // xs[0] + xs[1] * x + xs[2] * x^2 + ....\n // Return derivative of this polynomial in the same form.\n // >>> Derivative((new List(new long[]{(long)3L, (long)1L, (long)2L, (long)4L, (long)5L})))\n // (new List(new long[]{(long)1L, (long)4L, (long)12L, (long)20L}))\n // >>> Derivative((new List(new long[]{(long)1L, (long)2L, (long)3L})))\n // (new List(new long[]{(long)2L, (long)6L}))\n public static List Derivative(List xs) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Derivative((new List(new long[]{(long)3L, (long)1L, (long)2L, (long)4L, (long)5L}))).Equals((new List(new long[]{(long)1L, (long)4L, (long)12L, (long)20L}))));\n Debug.Assert(Derivative((new List(new long[]{(long)1L, (long)2L, (long)3L}))).Equals((new List(new long[]{(long)2L, (long)6L}))));\n Debug.Assert(Derivative((new List(new long[]{(long)3L, (long)2L, (long)1L}))).Equals((new List(new long[]{(long)2L, (long)2L}))));\n Debug.Assert(Derivative((new List(new long[]{(long)3L, (long)2L, (long)1L, (long)0L, (long)4L}))).Equals((new List(new long[]{(long)2L, (long)2L, (long)0L, (long)16L}))));\n Debug.Assert(Derivative((new List(new long[]{(long)1L}))).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // In this task, you will be given a string that represents a number of apples and oranges \n // that are distributed in a basket of fruit this basket contains \n // apples, oranges, and mango fruits. Given the string that represents the total number of \n // the oranges and apples and an integer that represent the total number of the fruits \n // in the basket return the number of the mango fruits in the basket.\n // for examble:\n // >>> FruitDistribution((\"5 apples and 6 oranges\"), (19L))\n // (8L)\n // >>> FruitDistribution((\"0 apples and 1 oranges\"), (3L))\n // (2L)\n // >>> FruitDistribution((\"2 apples and 3 oranges\"), (100L))\n // (95L)\n // >>> FruitDistribution((\"100 apples and 1 oranges\"), (120L))\n // (19L)\n public static long FruitDistribution(string s, long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FruitDistribution((\"5 apples and 6 oranges\"), (19L)) == (8L));\n Debug.Assert(FruitDistribution((\"5 apples and 6 oranges\"), (21L)) == (10L));\n Debug.Assert(FruitDistribution((\"0 apples and 1 oranges\"), (3L)) == (2L));\n Debug.Assert(FruitDistribution((\"1 apples and 0 oranges\"), (3L)) == (2L));\n Debug.Assert(FruitDistribution((\"2 apples and 3 oranges\"), (100L)) == (95L));\n Debug.Assert(FruitDistribution((\"2 apples and 3 oranges\"), (5L)) == (0L));\n Debug.Assert(FruitDistribution((\"1 apples and 100 oranges\"), (120L)) == (19L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that takes an integer a and returns true \n // if this ingeger is a cube of some integer number.\n // Note: you may assume the input is always valid.\n // Examples:\n // >>> Iscube((1L))\n // (true)\n // >>> Iscube((2L))\n // (false)\n // >>> Iscube((-1L))\n // (true)\n // >>> Iscube((64L))\n // (true)\n // >>> Iscube((0L))\n // (true)\n // >>> Iscube((180L))\n // (false)\n public static bool Iscube(long a) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Iscube((1L)) == (true));\n Debug.Assert(Iscube((2L)) == (false));\n Debug.Assert(Iscube((-1L)) == (true));\n Debug.Assert(Iscube((64L)) == (true));\n Debug.Assert(Iscube((180L)) == (false));\n Debug.Assert(Iscube((1000L)) == (true));\n Debug.Assert(Iscube((0L)) == (true));\n Debug.Assert(Iscube((1729L)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // In this Kata, you have to sort a list of non-negative integers according to\n // number of ones in their binary representation in ascending order.\n // For similar number of ones, sort based on decimal value.\n // It must be implemented like this:\n // >>> SortArray((new List(new long[]{(long)1L, (long)5L, (long)2L, (long)3L, (long)4L})))\n // (new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L}))\n // >>> SortArray((new List(new long[]{(long)-2L, (long)-3L, (long)-4L, (long)-5L, (long)-6L})))\n // (new List(new long[]{(long)-6L, (long)-5L, (long)-4L, (long)-3L, (long)-2L}))\n // >>> SortArray((new List(new long[]{(long)1L, (long)0L, (long)2L, (long)3L, (long)4L})))\n // (new List(new long[]{(long)0L, (long)1L, (long)2L, (long)3L, (long)4L}))\n public static List SortArray(List arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SortArray((new List(new long[]{(long)1L, (long)5L, (long)2L, (long)3L, (long)4L}))).Equals((new List(new long[]{(long)1L, (long)2L, (long)4L, (long)3L, (long)5L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)-2L, (long)-3L, (long)-4L, (long)-5L, (long)-6L}))).Equals((new List(new long[]{(long)-4L, (long)-2L, (long)-6L, (long)-5L, (long)-3L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)1L, (long)0L, (long)2L, (long)3L, (long)4L}))).Equals((new List(new long[]{(long)0L, (long)1L, (long)2L, (long)4L, (long)3L}))));\n Debug.Assert(SortArray((new List())).Equals((new List())));\n Debug.Assert(SortArray((new List(new long[]{(long)2L, (long)5L, (long)77L, (long)4L, (long)5L, (long)3L, (long)5L, (long)7L, (long)2L, (long)3L, (long)4L}))).Equals((new List(new long[]{(long)2L, (long)2L, (long)4L, (long)4L, (long)3L, (long)3L, (long)5L, (long)5L, (long)5L, (long)7L, (long)77L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)3L, (long)6L, (long)44L, (long)12L, (long)32L, (long)5L}))).Equals((new List(new long[]{(long)32L, (long)3L, (long)5L, (long)6L, (long)12L, (long)44L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)2L, (long)4L, (long)8L, (long)16L, (long)32L}))).Equals((new List(new long[]{(long)2L, (long)4L, (long)8L, (long)16L, (long)32L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)2L, (long)4L, (long)8L, (long)16L, (long)32L}))).Equals((new List(new long[]{(long)2L, (long)4L, (long)8L, (long)16L, (long)32L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a list of strings, where each string consists of only digits, return a list.\n // Each element i of the output should be \"the number of odd elements in the\n // string i of the input.\" where all the i's should be replaced by the number\n // of odd digits in the i'th string of the input.\n // >>> OddCount((new List(new string[]{(string)\"1234567\"})))\n // (new List(new string[]{(string)\"the number of odd elements 4n the str4ng 4 of the 4nput.\"}))\n // >>> OddCount((new List(new string[]{(string)\"3\", (string)\"11111111\"})))\n // (new List(new string[]{(string)\"the number of odd elements 1n the str1ng 1 of the 1nput.\", (string)\"the number of odd elements 8n the str8ng 8 of the 8nput.\"}))\n public static List OddCount(List lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(OddCount((new List(new string[]{(string)\"1234567\"}))).Equals((new List(new string[]{(string)\"the number of odd elements 4n the str4ng 4 of the 4nput.\"}))));\n Debug.Assert(OddCount((new List(new string[]{(string)\"3\", (string)\"11111111\"}))).Equals((new List(new string[]{(string)\"the number of odd elements 1n the str1ng 1 of the 1nput.\", (string)\"the number of odd elements 8n the str8ng 8 of the 8nput.\"}))));\n Debug.Assert(OddCount((new List(new string[]{(string)\"271\", (string)\"137\", (string)\"314\"}))).Equals((new List(new string[]{(string)\"the number of odd elements 2n the str2ng 2 of the 2nput.\", (string)\"the number of odd elements 3n the str3ng 3 of the 3nput.\", (string)\"the number of odd elements 2n the str2ng 2 of the 2nput.\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // brackets is a string of \"(\" and \")\".\n // return true if every opening bracket has a corresponding closing bracket.\n // >>> CorrectBracketing((\"(\"))\n // (false)\n // >>> CorrectBracketing((\"()\"))\n // (true)\n // >>> CorrectBracketing((\"(()())\"))\n // (true)\n // >>> CorrectBracketing((\")(()\"))\n // (false)\n public static bool CorrectBracketing(string brackets) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CorrectBracketing((\"()\")) == (true));\n Debug.Assert(CorrectBracketing((\"(()())\")) == (true));\n Debug.Assert(CorrectBracketing((\"()()(()())()\")) == (true));\n Debug.Assert(CorrectBracketing((\"()()((()()())())(()()(()))\")) == (true));\n Debug.Assert(CorrectBracketing((\"((()())))\")) == (false));\n Debug.Assert(CorrectBracketing((\")(()\")) == (false));\n Debug.Assert(CorrectBracketing((\"(\")) == (false));\n Debug.Assert(CorrectBracketing((\"((((\")) == (false));\n Debug.Assert(CorrectBracketing((\")\")) == (false));\n Debug.Assert(CorrectBracketing((\"(()\")) == (false));\n Debug.Assert(CorrectBracketing((\"()()(()())())(()\")) == (false));\n Debug.Assert(CorrectBracketing((\"()()(()())()))()\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Task\n // Write a function that takes a string as input and returns the sum of the upper characters only'\n // ASCII codes.\n // Examples:\n // >>> Digitsum((\"\"))\n // (0L)\n // >>> Digitsum((\"abAB\"))\n // (131L)\n // >>> Digitsum((\"abcCd\"))\n // (67L)\n // >>> Digitsum((\"helloE\"))\n // (69L)\n // >>> Digitsum((\"woArBld\"))\n // (131L)\n // >>> Digitsum((\"aAaaaXa\"))\n // (153L)\n public static long Digitsum(string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Digitsum((\"\")) == (0L));\n Debug.Assert(Digitsum((\"abAB\")) == (131L));\n Debug.Assert(Digitsum((\"abcCd\")) == (67L));\n Debug.Assert(Digitsum((\"helloE\")) == (69L));\n Debug.Assert(Digitsum((\"woArBld\")) == (131L));\n Debug.Assert(Digitsum((\"aAaaaXa\")) == (153L));\n Debug.Assert(Digitsum((\" How are yOu?\")) == (151L));\n Debug.Assert(Digitsum((\"You arE Very Smart\")) == (327L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that accepts a list of strings as a parameter,\n // deletes the strings that have odd lengths from it,\n // and returns the resulted list with a sorted order,\n // The list is always a list of strings and never a list of numbers,\n // and it may contain duplicates.\n // The order of the list should be ascending by length of each word, and you\n // should return the list sorted by that rule.\n // If two words have the same length, sort the list alphabetically.\n // The function should return a list of strings in sorted order.\n // You may assume that all words will have the same length.\n // For example:\n // >>> ListSort((new List(new string[]{(string)\"aa\", (string)\"a\", (string)\"aaa\"})))\n // (new List(new string[]{(string)\"aa\"}))\n // >>> ListSort((new List(new string[]{(string)\"ab\", (string)\"a\", (string)\"aaa\", (string)\"cd\"})))\n // (new List(new string[]{(string)\"ab\", (string)\"cd\"}))\n public static List SortedListSum(List lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SortedListSum((new List(new string[]{(string)\"aa\", (string)\"a\", (string)\"aaa\"}))).Equals((new List(new string[]{(string)\"aa\"}))));\n Debug.Assert(SortedListSum((new List(new string[]{(string)\"school\", (string)\"AI\", (string)\"asdf\", (string)\"b\"}))).Equals((new List(new string[]{(string)\"AI\", (string)\"asdf\", (string)\"school\"}))));\n Debug.Assert(SortedListSum((new List(new string[]{(string)\"d\", (string)\"b\", (string)\"c\", (string)\"a\"}))).Equals((new List())));\n Debug.Assert(SortedListSum((new List(new string[]{(string)\"d\", (string)\"dcba\", (string)\"abcd\", (string)\"a\"}))).Equals((new List(new string[]{(string)\"abcd\", (string)\"dcba\"}))));\n Debug.Assert(SortedListSum((new List(new string[]{(string)\"AI\", (string)\"ai\", (string)\"au\"}))).Equals((new List(new string[]{(string)\"AI\", (string)\"ai\", (string)\"au\"}))));\n Debug.Assert(SortedListSum((new List(new string[]{(string)\"a\", (string)\"b\", (string)\"b\", (string)\"c\", (string)\"c\", (string)\"a\"}))).Equals((new List())));\n Debug.Assert(SortedListSum((new List(new string[]{(string)\"aaaa\", (string)\"bbbb\", (string)\"dd\", (string)\"cc\"}))).Equals((new List(new string[]{(string)\"cc\", (string)\"dd\", (string)\"aaaa\", (string)\"bbbb\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a list arr of integers and you need to return\n // sum of magnitudes of integers multiplied by product of all signs\n // of each number in the list, represented by 1, -1 or 0.\n // Note: return null for empty arr.\n // Example:\n // >>> ProdSigns((new List(new long[]{(long)1L, (long)2L, (long)2L, (long)-4L})))\n // 9L\n // >>> ProdSigns((new List(new long[]{(long)0L, (long)1L})))\n // 0L\n // >>> ProdSigns((new List()))\n // null\n public static Nullable ProdSigns(List arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ProdSigns((new List(new long[]{(long)1L, (long)2L, (long)2L, (long)-4L}))).Equals(-9L));\n Debug.Assert(ProdSigns((new List(new long[]{(long)0L, (long)1L}))).Equals(0L));\n Debug.Assert(ProdSigns((new List(new long[]{(long)1L, (long)1L, (long)1L, (long)2L, (long)3L, (long)-1L, (long)1L}))).Equals(-10L));\n Debug.Assert(ProdSigns((new List())).Equals(null));\n Debug.Assert(ProdSigns((new List(new long[]{(long)2L, (long)4L, (long)1L, (long)2L, (long)-1L, (long)-1L, (long)9L}))).Equals(20L));\n Debug.Assert(ProdSigns((new List(new long[]{(long)-1L, (long)1L, (long)-1L, (long)1L}))).Equals(4L));\n Debug.Assert(ProdSigns((new List(new long[]{(long)-1L, (long)1L, (long)1L, (long)1L}))).Equals(-4L));\n Debug.Assert(ProdSigns((new List(new long[]{(long)-1L, (long)1L, (long)1L, (long)0L}))).Equals(0L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return list with elements incremented by 1.\n // >>> IncrList((new List(new long[]{(long)1L, (long)2L, (long)3L})))\n // (new List(new long[]{(long)2L, (long)3L, (long)4L}))\n // >>> IncrList((new List(new long[]{(long)5L, (long)3L, (long)5L, (long)2L, (long)3L, (long)3L, (long)9L, (long)0L, (long)123L})))\n // (new List(new long[]{(long)6L, (long)4L, (long)6L, (long)3L, (long)4L, (long)4L, (long)10L, (long)1L, (long)124L}))\n public static List IncrList(List l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IncrList((new List())).Equals((new List())));\n Debug.Assert(IncrList((new List(new long[]{(long)3L, (long)2L, (long)1L}))).Equals((new List(new long[]{(long)4L, (long)3L, (long)2L}))));\n Debug.Assert(IncrList((new List(new long[]{(long)5L, (long)2L, (long)5L, (long)2L, (long)3L, (long)3L, (long)9L, (long)0L, (long)123L}))).Equals((new List(new long[]{(long)6L, (long)3L, (long)6L, (long)3L, (long)4L, (long)4L, (long)10L, (long)1L, (long)124L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // From a given list of integers, generate a list of rolling maximum element found until given moment\n // in the sequence.\n // >>> RollingMax((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)2L, (long)3L, (long)4L, (long)2L})))\n // (new List(new long[]{(long)1L, (long)2L, (long)3L, (long)3L, (long)3L, (long)4L, (long)4L}))\n public static List RollingMax(List numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(RollingMax((new List())).Equals((new List())));\n Debug.Assert(RollingMax((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))).Equals((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))));\n Debug.Assert(RollingMax((new List(new long[]{(long)4L, (long)3L, (long)2L, (long)1L}))).Equals((new List(new long[]{(long)4L, (long)4L, (long)4L, (long)4L}))));\n Debug.Assert(RollingMax((new List(new long[]{(long)3L, (long)2L, (long)3L, (long)100L, (long)3L}))).Equals((new List(new long[]{(long)3L, (long)3L, (long)3L, (long)100L, (long)100L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n // separate those group into separate strings and return the list of those.\n // Separate groups are balanced (each open brace is properly closed) and not nested within each other\n // Ignore any spaces in the input string.\n // >>> SeparateParenGroups((\"( ) (( )) (( )( ))\"))\n // (new List(new string[]{(string)\"()\", (string)\"(())\", (string)\"(()())\"}))\n public static List SeparateParenGroups(string paren_string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SeparateParenGroups((\"(()()) ((())) () ((())()())\")).Equals((new List(new string[]{(string)\"(()())\", (string)\"((()))\", (string)\"()\", (string)\"((())()())\"}))));\n Debug.Assert(SeparateParenGroups((\"() (()) ((())) (((())))\")).Equals((new List(new string[]{(string)\"()\", (string)\"(())\", (string)\"((()))\", (string)\"(((())))\"}))));\n Debug.Assert(SeparateParenGroups((\"(()(())((())))\")).Equals((new List(new string[]{(string)\"(()(())((())))\"}))));\n Debug.Assert(SeparateParenGroups((\"( ) (( )) (( )( ))\")).Equals((new List(new string[]{(string)\"()\", (string)\"(())\", (string)\"(()())\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You will be given a string of words separated by commas or spaces. Your task is\n // to split the string into words and return a list of the words.\n // For example:\n // >>> WordsString((\"Hi, my name is John\"))\n // (new List(new string[]{(string)\"Hi\", (string)\"my\", (string)\"name\", (string)\"is\", (string)\"John\"}))\n // >>> WordsString((\"One, two, three, four, five, six\"))\n // (new List(new string[]{(string)\"One\", (string)\"two\", (string)\"three\", (string)\"four\", (string)\"five\", (string)\"six\"}))\n public static List WordsString(string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(WordsString((\"Hi, my name is John\")).Equals((new List(new string[]{(string)\"Hi\", (string)\"my\", (string)\"name\", (string)\"is\", (string)\"John\"}))));\n Debug.Assert(WordsString((\"One, two, three, four, five, six\")).Equals((new List(new string[]{(string)\"One\", (string)\"two\", (string)\"three\", (string)\"four\", (string)\"five\", (string)\"six\"}))));\n Debug.Assert(WordsString((\"Hi, my name\")).Equals((new List(new string[]{(string)\"Hi\", (string)\"my\", (string)\"name\"}))));\n Debug.Assert(WordsString((\"One,, two, three, four, five, six,\")).Equals((new List(new string[]{(string)\"One\", (string)\"two\", (string)\"three\", (string)\"four\", (string)\"five\", (string)\"six\"}))));\n Debug.Assert(WordsString((\"\")).Equals((new List())));\n Debug.Assert(WordsString((\"ahmed , gamal\")).Equals((new List(new string[]{(string)\"ahmed\", (string)\"gamal\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Filter given list of any csthon values only for integers\n // >>> FilterIntegers((new List(new string[]{(string)\"a\", (string)3.14f, (string)5L})))\n // (new List(new long[]{(long)5L}))\n // >>> FilterIntegers((new List(new object[]{1L, 2L, 3L, \"abc\", new List()})))\n // (new List(new long[]{(long)1L, (long)2L, (long)3L}))\n public static List FilterIntegers(List values) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FilterIntegers((new List())).Equals((new List())));\n Debug.Assert(FilterIntegers((new List(new object[]{4L, new List(), 23.2f, 9L, \"adasd\"}))).Equals((new List(new long[]{(long)4L, (long)9L}))));\n Debug.Assert(FilterIntegers((new List(new object[]{3L, \"c\", 3L, 3L, \"a\", \"b\"}))).Equals((new List(new long[]{(long)3L, (long)3L, (long)3L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // This function takes a list l and returns a list l' such that\n // l' is identical to l in the odd indicies, while its values at the even indicies are equal\n // to the values of the even indicies of l, but sorted.\n // >>> SortEven((new List(new long[]{(long)1L, (long)2L, (long)3L})))\n // (new List(new long[]{(long)1L, (long)2L, (long)3L}))\n // >>> SortEven((new List(new long[]{(long)5L, (long)6L, (long)3L, (long)4L})))\n // (new List(new long[]{(long)3L, (long)6L, (long)5L, (long)4L}))\n public static List SortEven(List l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SortEven((new List(new long[]{(long)1L, (long)2L, (long)3L}))).Equals((new List(new long[]{(long)1L, (long)2L, (long)3L}))));\n Debug.Assert(SortEven((new List(new long[]{(long)5L, (long)3L, (long)-5L, (long)2L, (long)-3L, (long)3L, (long)9L, (long)0L, (long)123L, (long)1L, (long)-10L}))).Equals((new List(new long[]{(long)-10L, (long)3L, (long)-5L, (long)2L, (long)-3L, (long)3L, (long)5L, (long)0L, (long)9L, (long)1L, (long)123L}))));\n Debug.Assert(SortEven((new List(new long[]{(long)5L, (long)8L, (long)-12L, (long)4L, (long)23L, (long)2L, (long)3L, (long)11L, (long)12L, (long)-10L}))).Equals((new List(new long[]{(long)-12L, (long)8L, (long)3L, (long)4L, (long)5L, (long)2L, (long)12L, (long)11L, (long)23L, (long)-10L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // I think we all remember that feeling when the result of some long-awaited\n // event is finally known. The feelings and thoughts you have at that moment are\n // definitely worth noting down and comparing.\n // Your task is to determine if a person correctly guessed the results of a number of matches.\n // You are given two lists of scores and guesses of equal length, where each index shows a match. \n // Return a list of the same length denoting how far off each guess was. If they have guessed correctly,\n // the value is 0, and if not, the value is the absolute difference between the guess and the score.\n // example:\n // >>> Compare((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)1L})), (new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)2L, (long)-2L})))\n // (new List(new long[]{(long)0L, (long)0L, (long)0L, (long)0L, (long)3L, (long)3L}))\n // >>> Compare((new List(new long[]{(long)0L, (long)5L, (long)0L, (long)0L, (long)0L, (long)4L})), (new List(new long[]{(long)4L, (long)1L, (long)1L, (long)0L, (long)0L, (long)-2L})))\n // (new List(new long[]{(long)4L, (long)4L, (long)1L, (long)0L, (long)0L, (long)6L}))\n public static List Compare(List game, List guess) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Compare((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)1L})), (new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)2L, (long)-2L}))).Equals((new List(new long[]{(long)0L, (long)0L, (long)0L, (long)0L, (long)3L, (long)3L}))));\n Debug.Assert(Compare((new List(new long[]{(long)0L, (long)0L, (long)0L, (long)0L, (long)0L, (long)0L})), (new List(new long[]{(long)0L, (long)0L, (long)0L, (long)0L, (long)0L, (long)0L}))).Equals((new List(new long[]{(long)0L, (long)0L, (long)0L, (long)0L, (long)0L, (long)0L}))));\n Debug.Assert(Compare((new List(new long[]{(long)1L, (long)2L, (long)3L})), (new List(new long[]{(long)-1L, (long)-2L, (long)-3L}))).Equals((new List(new long[]{(long)2L, (long)4L, (long)6L}))));\n Debug.Assert(Compare((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)5L})), (new List(new long[]{(long)-1L, (long)2L, (long)3L, (long)4L}))).Equals((new List(new long[]{(long)2L, (long)0L, (long)0L, (long)1L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a positive integer n, return a tuple that has the number of even and odd\n // integer palindromes that fall within the range(1, n), inclusive.\n // Example 1:\n // >>> EvenOddPalindrome((3L))\n // (Tuple.Create(1L, 2L))\n // Explanation:\n // Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n // Example 2:\n // >>> EvenOddPalindrome((12L))\n // (Tuple.Create(4L, 6L))\n // Explanation:\n // Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n // Note:\n // 1. 1 <= n <= 10^3\n // 2. returned tuple has the number of even and odd integer palindromes respectively.\n public static Tuple EvenOddPalindrome(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(EvenOddPalindrome((123L)).Equals((Tuple.Create(8L, 13L))));\n Debug.Assert(EvenOddPalindrome((12L)).Equals((Tuple.Create(4L, 6L))));\n Debug.Assert(EvenOddPalindrome((3L)).Equals((Tuple.Create(1L, 2L))));\n Debug.Assert(EvenOddPalindrome((63L)).Equals((Tuple.Create(6L, 8L))));\n Debug.Assert(EvenOddPalindrome((25L)).Equals((Tuple.Create(5L, 6L))));\n Debug.Assert(EvenOddPalindrome((19L)).Equals((Tuple.Create(4L, 6L))));\n Debug.Assert(EvenOddPalindrome((9L)).Equals((Tuple.Create(4L, 5L))));\n Debug.Assert(EvenOddPalindrome((1L)).Equals((Tuple.Create(0L, 1L))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n // fib4(0) -> 0\n // fib4(1) -> 0\n // fib4(2) -> 2\n // fib4(3) -> 0\n // fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n // Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n // >>> Fib4((5L))\n // (4L)\n // >>> Fib4((6L))\n // (8L)\n // >>> Fib4((7L))\n // (14L)\n public static long Fib4(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Fib4((5L)) == (4L));\n Debug.Assert(Fib4((8L)) == (28L));\n Debug.Assert(Fib4((10L)) == (104L));\n Debug.Assert(Fib4((12L)) == (386L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given two positive integers a and b, return the even digits between a\n // and b, in ascending order.\n // For example:\n // >>> GenerateIntegers((2L), (8L))\n // (new List(new long[]{(long)2L, (long)4L, (long)6L, (long)8L}))\n // >>> GenerateIntegers((8L), (2L))\n // (new List(new long[]{(long)2L, (long)4L, (long)6L, (long)8L}))\n // >>> GenerateIntegers((10L), (14L))\n // (new List())\n public static List GenerateIntegers(long a, long b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(GenerateIntegers((2L), (10L)).Equals((new List(new long[]{(long)2L, (long)4L, (long)6L, (long)8L}))));\n Debug.Assert(GenerateIntegers((10L), (2L)).Equals((new List(new long[]{(long)2L, (long)4L, (long)6L, (long)8L}))));\n Debug.Assert(GenerateIntegers((132L), (2L)).Equals((new List(new long[]{(long)2L, (long)4L, (long)6L, (long)8L}))));\n Debug.Assert(GenerateIntegers((17L), (89L)).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // For a given list of input numbers, calculate Mean Absolute Deviation\n // around the mean of this dataset.\n // Mean Absolute Deviation is the average absolute difference between each\n // element and a centerpoint (mean in this case):\n // MAD = average | x - x_mean |\n // >>> MeanAbsoluteDeviation((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f})))\n // (1.0f)\n public static float MeanAbsoluteDeviation(List numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(MeanAbsoluteDeviation((new List(new float[]{(float)1.0f, (float)2.0f}))) == (0.5f));\n Debug.Assert(MeanAbsoluteDeviation((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f}))) == (1.0f));\n Debug.Assert(MeanAbsoluteDeviation((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f}))) == (1.2f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function encrypt that takes a string as an argument and\n // returns a string encrypted with the alphabet being rotated. \n // The alphabet should be rotated in a manner such that the letters \n // shift down by two multiplied to two places.\n // For example:\n // >>> Encrypt((\"hi\"))\n // (\"lm\")\n // >>> Encrypt((\"asdfghjkl\"))\n // (\"ewhjklnop\")\n // >>> Encrypt((\"gf\"))\n // (\"kj\")\n // >>> Encrypt((\"et\"))\n // (\"ix\")\n public static string Encrypt(string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Encrypt((\"hi\")).Equals((\"lm\")));\n Debug.Assert(Encrypt((\"asdfghjkl\")).Equals((\"ewhjklnop\")));\n Debug.Assert(Encrypt((\"gf\")).Equals((\"kj\")));\n Debug.Assert(Encrypt((\"et\")).Equals((\"ix\")));\n Debug.Assert(Encrypt((\"faewfawefaewg\")).Equals((\"jeiajeaijeiak\")));\n Debug.Assert(Encrypt((\"hellomyfriend\")).Equals((\"lippsqcjvmirh\")));\n Debug.Assert(Encrypt((\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\")).Equals((\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\")));\n Debug.Assert(Encrypt((\"a\")).Equals((\"e\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n // The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n // as follows: start with any positive integer n. Then each term is obtained from the \n // previous term as follows: if the previous term is even, the next term is one half of \n // the previous term. If the previous term is odd, the next term is 3 times the previous\n // term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n // Note: \n // 1. Collatz(1) is [1].\n // 2. returned list sorted in increasing order.\n // For example:\n // get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n // >>> GetOddCollatz((5L))\n // (new List(new long[]{(long)1L, (long)5L}))\n public static List GetOddCollatz(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(GetOddCollatz((14L)).Equals((new List(new long[]{(long)1L, (long)5L, (long)7L, (long)11L, (long)13L, (long)17L}))));\n Debug.Assert(GetOddCollatz((5L)).Equals((new List(new long[]{(long)1L, (long)5L}))));\n Debug.Assert(GetOddCollatz((12L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)5L}))));\n Debug.Assert(GetOddCollatz((1L)).Equals((new List(new long[]{(long)1L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Find how many times a given substring can be found in the original string. Count overlaping cases.\n // >>> HowManyTimes((\"\"), (\"a\"))\n // (0L)\n // >>> HowManyTimes((\"aaa\"), (\"a\"))\n // (3L)\n // >>> HowManyTimes((\"aaaa\"), (\"aa\"))\n // (3L)\n public static long HowManyTimes(string str, string substring) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(HowManyTimes((\"\"), (\"x\")) == (0L));\n Debug.Assert(HowManyTimes((\"xyxyxyx\"), (\"x\")) == (4L));\n Debug.Assert(HowManyTimes((\"cacacacac\"), (\"cac\")) == (4L));\n Debug.Assert(HowManyTimes((\"john doe\"), (\"john\")) == (1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // We have a list 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n // numbers in the list will be randomly ordered. Your task is to determine if\n // it is possible to get a list sorted in non-decreasing order by performing \n // the following operation on the given list:\n // You are allowed to perform right shift operation any number of times.\n // One right shift operation means shifting all elements of the list by one\n // position in the right direction. The last element of the list will be moved to\n // the starting position in the list i.e. 0th index. \n // If it is possible to obtain the sorted list by performing the above operation\n // then return true else return false.\n // If the given list is empty then return true.\n // Note: The given list is guaranteed to have unique elements.\n // For Example:\n // >>> MoveOneBall((new List(new long[]{(long)3L, (long)4L, (long)5L, (long)1L, (long)2L})))\n // (true)\n // Explanation: By performin 2 right shift operations, non-decreasing order can\n // be achieved for the given list.\n // >>> MoveOneBall((new List(new long[]{(long)3L, (long)5L, (long)4L, (long)1L, (long)2L})))\n // (false)\n // Explanation:It is not possible to get non-decreasing order for the given\n // list by performing any number of right shift operations.\n public static bool MoveOneBall(List arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(MoveOneBall((new List(new long[]{(long)3L, (long)4L, (long)5L, (long)1L, (long)2L}))) == (true));\n Debug.Assert(MoveOneBall((new List(new long[]{(long)3L, (long)5L, (long)10L, (long)1L, (long)2L}))) == (true));\n Debug.Assert(MoveOneBall((new List(new long[]{(long)4L, (long)3L, (long)1L, (long)2L}))) == (false));\n Debug.Assert(MoveOneBall((new List(new long[]{(long)3L, (long)5L, (long)4L, (long)1L, (long)2L}))) == (false));\n Debug.Assert(MoveOneBall((new List())) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function which sorts the given list of integers\n // in ascending order according to the sum of their digits.\n // Note: if there are several items with similar sum of their digits,\n // order them based on their index in original list.\n // For example:\n // >>> OrderByPoints((new List(new long[]{(long)1L, (long)11L, (long)-1L, (long)-11L, (long)-12L})))\n // (new List(new long[]{(long)-1L, (long)-11L, (long)1L, (long)-12L, (long)11L}))\n // >>> OrderByPoints((new List()))\n // (new List())\n public static List OrderByPoints(List nums) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(OrderByPoints((new List(new long[]{(long)1L, (long)11L, (long)-1L, (long)-11L, (long)-12L}))).Equals((new List(new long[]{(long)-1L, (long)-11L, (long)1L, (long)-12L, (long)11L}))));\n Debug.Assert(OrderByPoints((new List(new long[]{(long)1234L, (long)423L, (long)463L, (long)145L, (long)2L, (long)423L, (long)423L, (long)53L, (long)6L, (long)37L, (long)3457L, (long)3L, (long)56L, (long)0L, (long)46L}))).Equals((new List(new long[]{(long)0L, (long)2L, (long)3L, (long)6L, (long)53L, (long)423L, (long)423L, (long)423L, (long)1234L, (long)145L, (long)37L, (long)46L, (long)56L, (long)463L, (long)3457L}))));\n Debug.Assert(OrderByPoints((new List())).Equals((new List())));\n Debug.Assert(OrderByPoints((new List(new long[]{(long)1L, (long)-11L, (long)-32L, (long)43L, (long)54L, (long)-98L, (long)2L, (long)-3L}))).Equals((new List(new long[]{(long)-3L, (long)-32L, (long)-98L, (long)-11L, (long)1L, (long)2L, (long)43L, (long)54L}))));\n Debug.Assert(OrderByPoints((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L, (long)7L, (long)8L, (long)9L, (long)10L, (long)11L}))).Equals((new List(new long[]{(long)1L, (long)10L, (long)2L, (long)11L, (long)3L, (long)4L, (long)5L, (long)6L, (long)7L, (long)8L, (long)9L}))));\n Debug.Assert(OrderByPoints((new List(new long[]{(long)0L, (long)6L, (long)6L, (long)-76L, (long)-21L, (long)23L, (long)4L}))).Equals((new List(new long[]{(long)-76L, (long)-21L, (long)0L, (long)4L, (long)23L, (long)6L, (long)6L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return list of prime factors of given integer in the order from smallest to largest.\n // Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n // Input number should be equal to the product of all factors\n // >>> Factorize((8L))\n // (new List(new long[]{(long)2L, (long)2L, (long)2L}))\n // >>> Factorize((25L))\n // (new List(new long[]{(long)5L, (long)5L}))\n // >>> Factorize((70L))\n // (new List(new long[]{(long)2L, (long)5L, (long)7L}))\n public static List Factorize(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Factorize((2L)).Equals((new List(new long[]{(long)2L}))));\n Debug.Assert(Factorize((4L)).Equals((new List(new long[]{(long)2L, (long)2L}))));\n Debug.Assert(Factorize((8L)).Equals((new List(new long[]{(long)2L, (long)2L, (long)2L}))));\n Debug.Assert(Factorize((57L)).Equals((new List(new long[]{(long)3L, (long)19L}))));\n Debug.Assert(Factorize((3249L)).Equals((new List(new long[]{(long)3L, (long)3L, (long)19L, (long)19L}))));\n Debug.Assert(Factorize((185193L)).Equals((new List(new long[]{(long)3L, (long)3L, (long)3L, (long)19L, (long)19L, (long)19L}))));\n Debug.Assert(Factorize((20577L)).Equals((new List(new long[]{(long)3L, (long)19L, (long)19L, (long)19L}))));\n Debug.Assert(Factorize((18L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)3L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return true if all numbers in the list l are below threshold t.\n // >>> BelowThreshold((new List(new long[]{(long)1L, (long)2L, (long)4L, (long)10L})), (100L))\n // (true)\n // >>> BelowThreshold((new List(new long[]{(long)1L, (long)20L, (long)4L, (long)10L})), (5L))\n // (false)\n public static bool BelowThreshold(List l, long t) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(BelowThreshold((new List(new long[]{(long)1L, (long)2L, (long)4L, (long)10L})), (100L)) == (true));\n Debug.Assert(BelowThreshold((new List(new long[]{(long)1L, (long)20L, (long)4L, (long)10L})), (5L)) == (false));\n Debug.Assert(BelowThreshold((new List(new long[]{(long)1L, (long)20L, (long)4L, (long)10L})), (21L)) == (true));\n Debug.Assert(BelowThreshold((new List(new long[]{(long)1L, (long)20L, (long)4L, (long)10L})), (22L)) == (true));\n Debug.Assert(BelowThreshold((new List(new long[]{(long)1L, (long)8L, (long)4L, (long)10L})), (11L)) == (true));\n Debug.Assert(BelowThreshold((new List(new long[]{(long)1L, (long)8L, (long)4L, (long)10L})), (10L)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n // For each of the group, output the deepest level of nesting of parentheses.\n // E.g. (()()) has maximum two levels of nesting while ((())) has three.\n // >>> ParseNestedParens((\"(()()) ((())) () ((())()())\"))\n // (new List(new long[]{(long)2L, (long)3L, (long)1L, (long)3L}))\n public static List ParseNestedParens(string paren_string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ParseNestedParens((\"(()()) ((())) () ((())()())\")).Equals((new List(new long[]{(long)2L, (long)3L, (long)1L, (long)3L}))));\n Debug.Assert(ParseNestedParens((\"() (()) ((())) (((())))\")).Equals((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))));\n Debug.Assert(ParseNestedParens((\"(()(())((())))\")).Equals((new List(new long[]{(long)4L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n // Examples\n // >>> Solution((new List(new long[]{(long)5L, (long)8L, (long)7L, (long)1L})))\n // (12L)\n // >>> Solution((new List(new long[]{(long)3L, (long)3L, (long)3L, (long)3L, (long)3L})))\n // (9L)\n // >>> Solution((new List(new long[]{(long)30L, (long)13L, (long)24L, (long)321L})))\n // (0L)\n public static long Solution(List lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Solution((new List(new long[]{(long)5L, (long)8L, (long)7L, (long)1L}))) == (12L));\n Debug.Assert(Solution((new List(new long[]{(long)3L, (long)3L, (long)3L, (long)3L, (long)3L}))) == (9L));\n Debug.Assert(Solution((new List(new long[]{(long)30L, (long)13L, (long)24L, (long)321L}))) == (0L));\n Debug.Assert(Solution((new List(new long[]{(long)5L, (long)9L}))) == (5L));\n Debug.Assert(Solution((new List(new long[]{(long)2L, (long)4L, (long)8L}))) == (0L));\n Debug.Assert(Solution((new List(new long[]{(long)30L, (long)13L, (long)23L, (long)32L}))) == (23L));\n Debug.Assert(Solution((new List(new long[]{(long)3L, (long)13L, (long)2L, (long)9L}))) == (3L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a positive integer n. You have to create an integer list a of length n.\n // For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n // Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n // and a[i] + a[j] + a[k] is a multiple of 3.\n // Example :\n // >>> GetMaxTriples((5L))\n // (1L)\n // Explanation: \n // a = [1, 3, 7, 13, 21]\n // The only valid triple is (1, 7, 13).\n public static long GetMaxTriples(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(GetMaxTriples((5L)) == (1L));\n Debug.Assert(GetMaxTriples((6L)) == (4L));\n Debug.Assert(GetMaxTriples((10L)) == (36L));\n Debug.Assert(GetMaxTriples((100L)) == (53361L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // There are eight planets in our solar system: the closerst to the Sun \n // is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n // Uranus, Neptune.\n // Write a function that takes two planet names as strings planet1 and planet2. \n // The function should return a tuple containing all planets whose orbits are \n // located between the orbit of planet1 and the orbit of planet2, sorted by \n // the proximity to the sun. \n // The function should return an empty tuple if planet1 or planet2\n // are not correct planet names. \n // Examples\n // >>> Bf((\"Jupiter\"), (\"Neptune\"))\n // (new List(new string[]{(string)\"Saturn\", (string)\"Uranus\"}))\n // >>> Bf((\"Earth\"), (\"Mercury\"))\n // (List(\"Venus\"))\n // >>> Bf((\"Mercury\"), (\"Uranus\"))\n // (new List(new string[]{(string)\"Venus\", (string)\"Earth\", (string)\"Mars\", (string)\"Jupiter\", (string)\"Saturn\"}))\n public static List Bf(string planet1, string planet2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Bf((\"Jupiter\"), (\"Neptune\")).Equals((new List(new string[]{(string)\"Saturn\", (string)\"Uranus\"}))));\n Debug.Assert(Bf((\"Earth\"), (\"Mercury\")).Equals((new List(new string[]{(string)\"Venus\"}))));\n Debug.Assert(Bf((\"Mercury\"), (\"Uranus\")).Equals((new List(new string[]{(string)\"Venus\", (string)\"Earth\", (string)\"Mars\", (string)\"Jupiter\", (string)\"Saturn\"}))));\n Debug.Assert(Bf((\"Neptune\"), (\"Venus\")).Equals((new List(new string[]{(string)\"Earth\", (string)\"Mars\", (string)\"Jupiter\", (string)\"Saturn\", (string)\"Uranus\"}))));\n Debug.Assert(Bf((\"Earth\"), (\"Earth\")).Equals((new List())));\n Debug.Assert(Bf((\"Mars\"), (\"Earth\")).Equals((new List())));\n Debug.Assert(Bf((\"Jupiter\"), (\"Makemake\")).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a list of integers.\n // Write a function next_smallest() that returns the 2nd smallest element of the list.\n // Return null if there is no such element.\n // >>> NextSmallest((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L})))\n // 2L\n // >>> NextSmallest((new List(new long[]{(long)5L, (long)1L, (long)4L, (long)3L, (long)2L})))\n // 2L\n // >>> NextSmallest((new List()))\n // null\n // >>> NextSmallest((new List(new long[]{(long)1L, (long)1L})))\n // null\n public static Nullable NextSmallest(List lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(NextSmallest((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L}))).Equals(2L));\n Debug.Assert(NextSmallest((new List(new long[]{(long)5L, (long)1L, (long)4L, (long)3L, (long)2L}))).Equals(2L));\n Debug.Assert(NextSmallest((new List())).Equals(null));\n Debug.Assert(NextSmallest((new List(new long[]{(long)1L, (long)1L}))).Equals(null));\n Debug.Assert(NextSmallest((new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L, (long)0L}))).Equals(1L));\n Debug.Assert(NextSmallest((new List(new long[]{(long)1L, (long)1L}))).Equals(null));\n Debug.Assert(NextSmallest((new List(new long[]{(long)-35L, (long)34L, (long)12L, (long)-45L}))).Equals(-35L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Input is a space-delimited string of numberals from 'zero' to 'nine'.\n // Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n // Return the string with numbers sorted from smallest to largest\n // >>> SortNumbers((\"three one five\"))\n // (\"one three five\")\n public static string SortNumbers(string numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SortNumbers((\"\")).Equals((\"\")));\n Debug.Assert(SortNumbers((\"three\")).Equals((\"three\")));\n Debug.Assert(SortNumbers((\"three five nine\")).Equals((\"three five nine\")));\n Debug.Assert(SortNumbers((\"five zero four seven nine eight\")).Equals((\"zero four five seven eight nine\")));\n Debug.Assert(SortNumbers((\"six five four three two one zero\")).Equals((\"zero one two three four five six\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given 2 words. You need to return true if the second word or any of its rotations is a substring in the first word\n // >>> CycpatternCheck((\"abcd\"), (\"abd\"))\n // (false)\n // >>> CycpatternCheck((\"hello\"), (\"ell\"))\n // (true)\n // >>> CycpatternCheck((\"whassup\"), (\"psus\"))\n // (false)\n // >>> CycpatternCheck((\"abab\"), (\"baa\"))\n // (true)\n // >>> CycpatternCheck((\"efef\"), (\"eeff\"))\n // (false)\n // >>> CycpatternCheck((\"himenss\"), (\"simen\"))\n // (true)\n public static bool CycpatternCheck(string a, string b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CycpatternCheck((\"xyzw\"), (\"xyw\")) == (false));\n Debug.Assert(CycpatternCheck((\"yello\"), (\"ell\")) == (true));\n Debug.Assert(CycpatternCheck((\"whattup\"), (\"ptut\")) == (false));\n Debug.Assert(CycpatternCheck((\"efef\"), (\"fee\")) == (true));\n Debug.Assert(CycpatternCheck((\"abab\"), (\"aabb\")) == (false));\n Debug.Assert(CycpatternCheck((\"winemtt\"), (\"tinem\")) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You will be given a number in decimal form and your task is to convert it to\n // binary format. The function should return a string, with each character representing a binary\n // number. Each character in the string will be '0' or '1'.\n // There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n // The extra characters are there to help with the format.\n // Examples:\n // >>> DecimalToBinary((15L))\n // (\"db1111db\")\n // >>> DecimalToBinary((32L))\n // (\"db100000db\")\n public static string DecimalToBinary(long decimalNum) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(DecimalToBinary((0L)).Equals((\"db0db\")));\n Debug.Assert(DecimalToBinary((32L)).Equals((\"db100000db\")));\n Debug.Assert(DecimalToBinary((103L)).Equals((\"db1100111db\")));\n Debug.Assert(DecimalToBinary((15L)).Equals((\"db1111db\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Filter an input list of strings only for ones that contain given substring\n // >>> FilterBySubstring((new List()), (\"a\"))\n // (new List())\n // >>> FilterBySubstring((new List(new string[]{(string)\"abc\", (string)\"bacd\", (string)\"cde\", (string)\"array\"})), (\"a\"))\n // (new List(new string[]{(string)\"abc\", (string)\"bacd\", (string)\"array\"}))\n public static List FilterBySubstring(List strings, string substring) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FilterBySubstring((new List()), (\"john\")).Equals((new List())));\n Debug.Assert(FilterBySubstring((new List(new string[]{(string)\"xxx\", (string)\"asd\", (string)\"xxy\", (string)\"john doe\", (string)\"xxxAAA\", (string)\"xxx\"})), (\"xxx\")).Equals((new List(new string[]{(string)\"xxx\", (string)\"xxxAAA\", (string)\"xxx\"}))));\n Debug.Assert(FilterBySubstring((new List(new string[]{(string)\"xxx\", (string)\"asd\", (string)\"aaaxxy\", (string)\"john doe\", (string)\"xxxAAA\", (string)\"xxx\"})), (\"xx\")).Equals((new List(new string[]{(string)\"xxx\", (string)\"aaaxxy\", (string)\"xxxAAA\", (string)\"xxx\"}))));\n Debug.Assert(FilterBySubstring((new List(new string[]{(string)\"grunt\", (string)\"trumpet\", (string)\"prune\", (string)\"gruesome\"})), (\"run\")).Equals((new List(new string[]{(string)\"grunt\", (string)\"prune\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given an integer. return a tuple that has the number of even and odd digits respectively.\n // Example:\n // >>> EvenOddCount((-12L))\n // (Tuple.Create(1L, 1L))\n // >>> EvenOddCount((123L))\n // (Tuple.Create(1L, 2L))\n public static Tuple EvenOddCount(long num) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(EvenOddCount((7L)).Equals((Tuple.Create(0L, 1L))));\n Debug.Assert(EvenOddCount((-78L)).Equals((Tuple.Create(1L, 1L))));\n Debug.Assert(EvenOddCount((3452L)).Equals((Tuple.Create(2L, 2L))));\n Debug.Assert(EvenOddCount((346211L)).Equals((Tuple.Create(3L, 3L))));\n Debug.Assert(EvenOddCount((-345821L)).Equals((Tuple.Create(3L, 3L))));\n Debug.Assert(EvenOddCount((-2L)).Equals((Tuple.Create(1L, 0L))));\n Debug.Assert(EvenOddCount((-45347L)).Equals((Tuple.Create(2L, 3L))));\n Debug.Assert(EvenOddCount((0L)).Equals((Tuple.Create(1L, 0L))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that accepts a list of strings.\n // The list contains different words. Return the word with maximum number\n // of unique characters. If multiple strings have maximum number of unique\n // characters, return the one which comes first in lexicographical order.\n // >>> FindMax((new List(new string[]{(string)\"name\", (string)\"of\", (string)\"string\"})))\n // (\"string\")\n // >>> FindMax((new List(new string[]{(string)\"name\", (string)\"enam\", (string)\"game\"})))\n // (\"enam\")\n // >>> FindMax((new List(new string[]{(string)\"aaaaaaa\", (string)\"bb\", (string)\"cc\"})))\n // (\"aaaaaaa\")\n public static string FindMax(List words) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FindMax((new List(new string[]{(string)\"name\", (string)\"of\", (string)\"string\"}))).Equals((\"string\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"name\", (string)\"enam\", (string)\"game\"}))).Equals((\"enam\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"aaaaaaa\", (string)\"bb\", (string)\"cc\"}))).Equals((\"aaaaaaa\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"abc\", (string)\"cba\"}))).Equals((\"abc\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"play\", (string)\"this\", (string)\"game\", (string)\"of\", (string)\"footbott\"}))).Equals((\"footbott\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"we\", (string)\"are\", (string)\"gonna\", (string)\"rock\"}))).Equals((\"gonna\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"we\", (string)\"are\", (string)\"a\", (string)\"mad\", (string)\"nation\"}))).Equals((\"nation\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"this\", (string)\"is\", (string)\"a\", (string)\"prrk\"}))).Equals((\"this\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"b\"}))).Equals((\"b\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"play\", (string)\"play\", (string)\"play\"}))).Equals((\"play\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a positive integer n, return the count of the numbers of n-digit\n // positive integers that start or end with 1.\n public static long StartsOneEnds(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(StartsOneEnds((1L)) == (1L));\n Debug.Assert(StartsOneEnds((2L)) == (18L));\n Debug.Assert(StartsOneEnds((3L)) == (180L));\n Debug.Assert(StartsOneEnds((4L)) == (1800L));\n Debug.Assert(StartsOneEnds((5L)) == (18000L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function that returns a tuple (a, b), where 'a' is\n // the largest of negative integers, and 'b' is the smallest\n // of positive integers in a list.\n // If there is no negative or positive integers, return them as null.\n // Examples:\n // >>> LargestSmallestIntegers((new List(new long[]{(long)2L, (long)4L, (long)1L, (long)3L, (long)5L, (long)7L})))\n // Tuple.Create((Nullable)null, 1L)\n // >>> LargestSmallestIntegers((new List()))\n // Tuple.Create((Nullable)null, (Nullable)null)\n // >>> LargestSmallestIntegers((new List(new long[]{(long)0L})))\n // Tuple.Create((Nullable)null, (Nullable)null)\n public static Tuple, Nullable> LargestSmallestIntegers(List lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)2L, (long)4L, (long)1L, (long)3L, (long)5L, (long)7L}))).Equals(Tuple.Create((Nullable)null, 1L)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)2L, (long)4L, (long)1L, (long)3L, (long)5L, (long)7L, (long)0L}))).Equals(Tuple.Create((Nullable)null, 1L)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)4L, (long)5L, (long)6L, (long)-2L}))).Equals(Tuple.Create(-2L, 1L)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)4L, (long)5L, (long)3L, (long)6L, (long)2L, (long)7L, (long)-7L}))).Equals(Tuple.Create(-7L, 2L)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)7L, (long)3L, (long)8L, (long)4L, (long)9L, (long)2L, (long)5L, (long)-9L}))).Equals(Tuple.Create(-9L, 2L)));\n Debug.Assert(LargestSmallestIntegers((new List())).Equals(Tuple.Create((Nullable)null, (Nullable)null)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)0L}))).Equals(Tuple.Create((Nullable)null, (Nullable)null)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)-1L, (long)-3L, (long)-5L, (long)-6L}))).Equals(Tuple.Create(-1L, (Nullable)null)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)-1L, (long)-3L, (long)-5L, (long)-6L, (long)0L}))).Equals(Tuple.Create(-1L, (Nullable)null)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)-6L, (long)-4L, (long)-4L, (long)-3L, (long)1L}))).Equals(Tuple.Create(-3L, 1L)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)-6L, (long)-4L, (long)-4L, (long)-3L, (long)-100L, (long)1L}))).Equals(Tuple.Create(-3L, 1L)));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // \"Given a list representing a branch of a tree that has non-negative integer nodes\n // your task is to pluck one of the nodes and return it.\n // The plucked node should be the node with the smallest even value.\n // If multiple nodes with the same smallest even value are found return the node that has smallest index.\n // The plucked node should be returned in a list, [ smalest_value, its index ],\n // If there are no even values or the given list is empty, return [].\n // Example 1:\n // >>> Pluck((new List(new long[]{(long)4L, (long)2L, (long)3L})))\n // (new List(new long[]{(long)2L, (long)1L}))\n // Explanation: 2 has the smallest even value, and 2 has the smallest index.\n // Example 2:\n // >>> Pluck((new List(new long[]{(long)1L, (long)2L, (long)3L})))\n // (new List(new long[]{(long)2L, (long)1L}))\n // Explanation: 2 has the smallest even value, and 2 has the smallest index.\n // Example 3:\n // >>> Pluck((new List()))\n // (new List())\n // Example 4:\n // >>> Pluck((new List(new long[]{(long)5L, (long)0L, (long)3L, (long)0L, (long)4L, (long)2L})))\n // (new List(new long[]{(long)0L, (long)1L}))\n // Explanation: 0 is the smallest value, but there are two zeros,\n // so we will choose the first zero, which has the smallest index.\n // Constraints:\n // * 1 <= nodes.length <= 10000\n // * 0 <= node.value\n public static List Pluck(List arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Pluck((new List(new long[]{(long)4L, (long)2L, (long)3L}))).Equals((new List(new long[]{(long)2L, (long)1L}))));\n Debug.Assert(Pluck((new List(new long[]{(long)1L, (long)2L, (long)3L}))).Equals((new List(new long[]{(long)2L, (long)1L}))));\n Debug.Assert(Pluck((new List())).Equals((new List())));\n Debug.Assert(Pluck((new List(new long[]{(long)5L, (long)0L, (long)3L, (long)0L, (long)4L, (long)2L}))).Equals((new List(new long[]{(long)0L, (long)1L}))));\n Debug.Assert(Pluck((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)0L, (long)5L, (long)3L}))).Equals((new List(new long[]{(long)0L, (long)3L}))));\n Debug.Assert(Pluck((new List(new long[]{(long)5L, (long)4L, (long)8L, (long)4L, (long)8L}))).Equals((new List(new long[]{(long)4L, (long)1L}))));\n Debug.Assert(Pluck((new List(new long[]{(long)7L, (long)6L, (long)7L, (long)1L}))).Equals((new List(new long[]{(long)6L, (long)1L}))));\n Debug.Assert(Pluck((new List(new long[]{(long)7L, (long)9L, (long)7L, (long)1L}))).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function count_nums which takes a list of integers and returns\n // the number of elements which has a sum of digits > 0.\n // If a number is negative, then its first signed digit will be negative:\n // e.g. -123 has signed digits -1, 2, and 3.\n // >>> CountNums((new List()))\n // (0L)\n // >>> CountNums((new List(new long[]{(long)-1L, (long)11L, (long)-11L})))\n // (1L)\n // >>> CountNums((new List(new long[]{(long)1L, (long)1L, (long)2L})))\n // (3L)\n public static long CountNums(List arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CountNums((new List())) == (0L));\n Debug.Assert(CountNums((new List(new long[]{(long)-1L, (long)-2L, (long)0L}))) == (0L));\n Debug.Assert(CountNums((new List(new long[]{(long)1L, (long)1L, (long)2L, (long)-2L, (long)3L, (long)4L, (long)5L}))) == (6L));\n Debug.Assert(CountNums((new List(new long[]{(long)1L, (long)6L, (long)9L, (long)-6L, (long)0L, (long)1L, (long)5L}))) == (5L));\n Debug.Assert(CountNums((new List(new long[]{(long)1L, (long)100L, (long)98L, (long)-7L, (long)1L, (long)-1L}))) == (4L));\n Debug.Assert(CountNums((new List(new long[]{(long)12L, (long)23L, (long)34L, (long)-45L, (long)-56L, (long)0L}))) == (5L));\n Debug.Assert(CountNums((new List(new long[]{(long)0L, (long)1L}))) == (1L));\n Debug.Assert(CountNums((new List(new long[]{(long)1L}))) == (1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n // each cell of the grid contains a value. Every integer in the range [1, N * N]\n // inclusive appears exactly once on the cells of the grid.\n // You have to find the minimum path of length k in the grid. You can start\n // from any cell, and in each step you can move to any of the neighbor cells,\n // in other words, you can go to cells which share an edge with you current\n // cell.\n // Please note that a path of length k means visiting exactly k cells (not\n // necessarily distinct).\n // You CANNOT go off the grid.\n // A path A (of length k) is considered less than a path B (of length k) if\n // after making the ordered lists of the values on the cells that A and B go\n // through (let's call them lst_A and lst_B), lst_A is lexicographically less\n // than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n // such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n // lst_A[j] = lst_B[j].\n // It is guaranteed that the answer is unique.\n // Return an ordered list of the values on the cells that the minimum path go through.\n // Examples: \n // >>> Minpath((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)2L, (long)3L}), (List)new List(new long[]{(long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)7L, (long)8L, (long)9L})})), (3L))\n // (new List(new long[]{(long)1L, (long)2L, (long)1L}))\n // >>> Minpath((new List>(new List[]{(List)new List(new long[]{(long)5L, (long)9L, (long)3L}), (List)new List(new long[]{(long)4L, (long)1L, (long)6L}), (List)new List(new long[]{(long)7L, (long)8L, (long)2L})})), (1L))\n // (new List(new long[]{(long)1L}))\n public static List Minpath(List> grid, long k) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)2L, (long)3L}), (List)new List(new long[]{(long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)7L, (long)8L, (long)9L})})), (3L)).Equals((new List(new long[]{(long)1L, (long)2L, (long)1L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)5L, (long)9L, (long)3L}), (List)new List(new long[]{(long)4L, (long)1L, (long)6L}), (List)new List(new long[]{(long)7L, (long)8L, (long)2L})})), (1L)).Equals((new List(new long[]{(long)1L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}), (List)new List(new long[]{(long)5L, (long)6L, (long)7L, (long)8L}), (List)new List(new long[]{(long)9L, (long)10L, (long)11L, (long)12L}), (List)new List(new long[]{(long)13L, (long)14L, (long)15L, (long)16L})})), (4L)).Equals((new List(new long[]{(long)1L, (long)2L, (long)1L, (long)2L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)6L, (long)4L, (long)13L, (long)10L}), (List)new List(new long[]{(long)5L, (long)7L, (long)12L, (long)1L}), (List)new List(new long[]{(long)3L, (long)16L, (long)11L, (long)15L}), (List)new List(new long[]{(long)8L, (long)14L, (long)9L, (long)2L})})), (7L)).Equals((new List(new long[]{(long)1L, (long)10L, (long)1L, (long)10L, (long)1L, (long)10L, (long)1L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)8L, (long)14L, (long)9L, (long)2L}), (List)new List(new long[]{(long)6L, (long)4L, (long)13L, (long)15L}), (List)new List(new long[]{(long)5L, (long)7L, (long)1L, (long)12L}), (List)new List(new long[]{(long)3L, (long)10L, (long)11L, (long)16L})})), (5L)).Equals((new List(new long[]{(long)1L, (long)7L, (long)1L, (long)7L, (long)1L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)11L, (long)8L, (long)7L, (long)2L}), (List)new List(new long[]{(long)5L, (long)16L, (long)14L, (long)4L}), (List)new List(new long[]{(long)9L, (long)3L, (long)15L, (long)6L}), (List)new List(new long[]{(long)12L, (long)13L, (long)10L, (long)1L})})), (9L)).Equals((new List(new long[]{(long)1L, (long)6L, (long)1L, (long)6L, (long)1L, (long)6L, (long)1L, (long)6L, (long)1L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)12L, (long)13L, (long)10L, (long)1L}), (List)new List(new long[]{(long)9L, (long)3L, (long)15L, (long)6L}), (List)new List(new long[]{(long)5L, (long)16L, (long)14L, (long)4L}), (List)new List(new long[]{(long)11L, (long)8L, (long)7L, (long)2L})})), (12L)).Equals((new List(new long[]{(long)1L, (long)6L, (long)1L, (long)6L, (long)1L, (long)6L, (long)1L, (long)6L, (long)1L, (long)6L, (long)1L, (long)6L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)2L, (long)7L, (long)4L}), (List)new List(new long[]{(long)3L, (long)1L, (long)5L}), (List)new List(new long[]{(long)6L, (long)8L, (long)9L})})), (8L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)1L, (long)3L, (long)1L, (long)3L, (long)1L, (long)3L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)6L, (long)1L, (long)5L}), (List)new List(new long[]{(long)3L, (long)8L, (long)9L}), (List)new List(new long[]{(long)2L, (long)7L, (long)4L})})), (8L)).Equals((new List(new long[]{(long)1L, (long)5L, (long)1L, (long)5L, (long)1L, (long)5L, (long)1L, (long)5L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)2L}), (List)new List(new long[]{(long)3L, (long)4L})})), (10L)).Equals((new List(new long[]{(long)1L, (long)2L, (long)1L, (long)2L, (long)1L, (long)2L, (long)1L, (long)2L, (long)1L, (long)2L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)3L}), (List)new List(new long[]{(long)3L, (long)2L})})), (10L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)1L, (long)3L, (long)1L, (long)3L, (long)1L, (long)3L, (long)1L, (long)3L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given list of integers, return list in strange order.\n // Strange sorting, is when you start with the minimum value,\n // then maximum of the remaining integers, then minimum and so on.\n // Examples:\n // >>> StrangeSortList((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L})))\n // (new List(new long[]{(long)1L, (long)4L, (long)2L, (long)3L}))\n // >>> StrangeSortList((new List(new long[]{(long)5L, (long)5L, (long)5L, (long)5L})))\n // (new List(new long[]{(long)5L, (long)5L, (long)5L, (long)5L}))\n // >>> StrangeSortList((new List()))\n // (new List())\n public static List StrangeSortList(List lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(StrangeSortList((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))).Equals((new List(new long[]{(long)1L, (long)4L, (long)2L, (long)3L}))));\n Debug.Assert(StrangeSortList((new List(new long[]{(long)5L, (long)6L, (long)7L, (long)8L, (long)9L}))).Equals((new List(new long[]{(long)5L, (long)9L, (long)6L, (long)8L, (long)7L}))));\n Debug.Assert(StrangeSortList((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L}))).Equals((new List(new long[]{(long)1L, (long)5L, (long)2L, (long)4L, (long)3L}))));\n Debug.Assert(StrangeSortList((new List(new long[]{(long)5L, (long)6L, (long)7L, (long)8L, (long)9L, (long)1L}))).Equals((new List(new long[]{(long)1L, (long)9L, (long)5L, (long)8L, (long)6L, (long)7L}))));\n Debug.Assert(StrangeSortList((new List(new long[]{(long)5L, (long)5L, (long)5L, (long)5L}))).Equals((new List(new long[]{(long)5L, (long)5L, (long)5L, (long)5L}))));\n Debug.Assert(StrangeSortList((new List())).Equals((new List())));\n Debug.Assert(StrangeSortList((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L, (long)7L, (long)8L}))).Equals((new List(new long[]{(long)1L, (long)8L, (long)2L, (long)7L, (long)3L, (long)6L, (long)4L, (long)5L}))));\n Debug.Assert(StrangeSortList((new List(new long[]{(long)0L, (long)2L, (long)2L, (long)2L, (long)5L, (long)5L, (long)-5L, (long)-5L}))).Equals((new List(new long[]{(long)-5L, (long)5L, (long)-5L, (long)5L, (long)0L, (long)2L, (long)2L, (long)2L}))));\n Debug.Assert(StrangeSortList((new List(new long[]{(long)111111L}))).Equals((new List(new long[]{(long)111111L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a string 'text', return its md5 hash equivalent string.\n // If 'text' is an empty string, return null.\n // >>> StringToMd5((\"Hello world\"))\n // (\"3e25960a79dbc69b674cd4ec67a72c62\")\n public static string StringToMd5(string text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(StringToMd5((\"Hello world\")).Equals((\"3e25960a79dbc69b674cd4ec67a72c62\")));\n Debug.Assert(StringToMd5((\"\")).Equals(null));\n Debug.Assert(StringToMd5((\"A B C\")).Equals((\"0ef78513b0cb8cef12743f5aeb35f888\")));\n Debug.Assert(StringToMd5((\"password\")).Equals((\"5f4dcc3b5aa765d61d8327deb882cf99\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a word. Your task is to find the closest vowel that stands between \n // two consonants from the right side of the word (case sensitive).\n // Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n // find any vowel met the above condition. \n // You may assume that the given string contains English letter only.\n // Example:\n // >>> GetClosestVowel((\"yogurt\"))\n // (\"u\")\n // >>> GetClosestVowel((\"FULL\"))\n // (\"U\")\n // >>> GetClosestVowel((\"quick\"))\n // (\"\")\n // >>> GetClosestVowel((\"ab\"))\n // (\"\")\n public static string GetClosestVowel(string word) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(GetClosestVowel((\"yogurt\")).Equals((\"u\")));\n Debug.Assert(GetClosestVowel((\"full\")).Equals((\"u\")));\n Debug.Assert(GetClosestVowel((\"easy\")).Equals((\"\")));\n Debug.Assert(GetClosestVowel((\"eAsy\")).Equals((\"\")));\n Debug.Assert(GetClosestVowel((\"ali\")).Equals((\"\")));\n Debug.Assert(GetClosestVowel((\"bad\")).Equals((\"a\")));\n Debug.Assert(GetClosestVowel((\"most\")).Equals((\"o\")));\n Debug.Assert(GetClosestVowel((\"ab\")).Equals((\"\")));\n Debug.Assert(GetClosestVowel((\"ba\")).Equals((\"\")));\n Debug.Assert(GetClosestVowel((\"quick\")).Equals((\"\")));\n Debug.Assert(GetClosestVowel((\"anime\")).Equals((\"i\")));\n Debug.Assert(GetClosestVowel((\"Asia\")).Equals((\"\")));\n Debug.Assert(GetClosestVowel((\"Above\")).Equals((\"o\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Change numerical base of input number x to base.\n // return string representation after the conversion.\n // base numbers are less than 10.\n // >>> ChangeBase((8L), (3L))\n // (\"22\")\n // >>> ChangeBase((8L), (2L))\n // (\"1000\")\n // >>> ChangeBase((7L), (2L))\n // (\"111\")\n public static string ChangeBase(long x, long numBase) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ChangeBase((8L), (3L)).Equals((\"22\")));\n Debug.Assert(ChangeBase((9L), (3L)).Equals((\"100\")));\n Debug.Assert(ChangeBase((234L), (2L)).Equals((\"11101010\")));\n Debug.Assert(ChangeBase((16L), (2L)).Equals((\"10000\")));\n Debug.Assert(ChangeBase((8L), (2L)).Equals((\"1000\")));\n Debug.Assert(ChangeBase((7L), (2L)).Equals((\"111\")));\n Debug.Assert(ChangeBase((2L), (3L)).Equals((\"2\")));\n Debug.Assert(ChangeBase((3L), (4L)).Equals((\"3\")));\n Debug.Assert(ChangeBase((4L), (5L)).Equals((\"4\")));\n Debug.Assert(ChangeBase((5L), (6L)).Equals((\"5\")));\n Debug.Assert(ChangeBase((6L), (7L)).Equals((\"6\")));\n Debug.Assert(ChangeBase((7L), (8L)).Equals((\"7\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Check if in given list of numbers, are any two numbers closer to each other than\n // given threshold.\n // >>> HasCloseElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f})), (0.5f))\n // (false)\n // >>> HasCloseElements((new List(new float[]{(float)1.0f, (float)2.8f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.0f})), (0.3f))\n // (true)\n public static bool HasCloseElements(List numbers, float threshold) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(HasCloseElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.9f, (float)4.0f, (float)5.0f, (float)2.2f})), (0.3f)) == (true));\n Debug.Assert(HasCloseElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.9f, (float)4.0f, (float)5.0f, (float)2.2f})), (0.05f)) == (false));\n Debug.Assert(HasCloseElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)5.9f, (float)4.0f, (float)5.0f})), (0.95f)) == (true));\n Debug.Assert(HasCloseElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)5.9f, (float)4.0f, (float)5.0f})), (0.8f)) == (false));\n Debug.Assert(HasCloseElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.0f})), (0.1f)) == (true));\n Debug.Assert(HasCloseElements((new List(new float[]{(float)1.1f, (float)2.2f, (float)3.1f, (float)4.1f, (float)5.1f})), (1.0f)) == (true));\n Debug.Assert(HasCloseElements((new List(new float[]{(float)1.1f, (float)2.2f, (float)3.1f, (float)4.1f, (float)5.1f})), (0.5f)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function that takes a string as input which contains only square brackets.\n // The function should return true if and only if there is a valid subsequence of brackets \n // where at least one bracket in the subsequence is nested.\n // >>> IsNested((\"[[]]\"))\n // (true)\n // >>> IsNested((\"[]]]]]]][[[[[]\"))\n // (false)\n // >>> IsNested((\"[][]\"))\n // (false)\n // >>> IsNested((\"[]\"))\n // (false)\n // >>> IsNested((\"[[][]]\"))\n // (true)\n // >>> IsNested((\"[[]][[\"))\n // (true)\n public static bool IsNested(string str) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsNested((\"[[]]\")) == (true));\n Debug.Assert(IsNested((\"[]]]]]]][[[[[]\")) == (false));\n Debug.Assert(IsNested((\"[][]\")) == (false));\n Debug.Assert(IsNested((\"[]\")) == (false));\n Debug.Assert(IsNested((\"[[[[]]]]\")) == (true));\n Debug.Assert(IsNested((\"[]]]]]]]]]]\")) == (false));\n Debug.Assert(IsNested((\"[][][[]]\")) == (true));\n Debug.Assert(IsNested((\"[[]\")) == (false));\n Debug.Assert(IsNested((\"[]]\")) == (false));\n Debug.Assert(IsNested((\"[[]][[\")) == (true));\n Debug.Assert(IsNested((\"[[][]]\")) == (true));\n Debug.Assert(IsNested((\"\")) == (false));\n Debug.Assert(IsNested((\"[[[[[[[[\")) == (false));\n Debug.Assert(IsNested((\"]]]]]]]]\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Concatenate list of strings into a single string\n // >>> Concatenate((new List()))\n // (\"\")\n // >>> Concatenate((new List(new string[]{(string)\"a\", (string)\"b\", (string)\"c\"})))\n // (\"abc\")\n public static string Concatenate(List strings) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Concatenate((new List())).Equals((\"\")));\n Debug.Assert(Concatenate((new List(new string[]{(string)\"x\", (string)\"y\", (string)\"z\"}))).Equals((\"xyz\")));\n Debug.Assert(Concatenate((new List(new string[]{(string)\"x\", (string)\"y\", (string)\"z\", (string)\"w\", (string)\"k\"}))).Equals((\"xyzwk\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n // >>> PrimeFib((1L))\n // (2L)\n // >>> PrimeFib((2L))\n // (3L)\n // >>> PrimeFib((3L))\n // (5L)\n // >>> PrimeFib((4L))\n // (13L)\n // >>> PrimeFib((5L))\n // (89L)\n public static long PrimeFib(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(PrimeFib((1L)) == (2L));\n Debug.Assert(PrimeFib((2L)) == (3L));\n Debug.Assert(PrimeFib((3L)) == (5L));\n Debug.Assert(PrimeFib((4L)) == (13L));\n Debug.Assert(PrimeFib((5L)) == (89L));\n Debug.Assert(PrimeFib((6L)) == (233L));\n Debug.Assert(PrimeFib((7L)) == (1597L));\n Debug.Assert(PrimeFib((8L)) == (28657L));\n Debug.Assert(PrimeFib((9L)) == (514229L));\n Debug.Assert(PrimeFib((10L)) == (433494437L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n // other and return them in order (smaller number, larger number).\n // >>> FindClosestElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.2f})))\n // (Tuple.Create(2.0f, 2.2f))\n // >>> FindClosestElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.0f})))\n // (Tuple.Create(2.0f, 2.0f))\n public static Tuple FindClosestElements(List numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FindClosestElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.9f, (float)4.0f, (float)5.0f, (float)2.2f}))).Equals((Tuple.Create(3.9f, 4.0f))));\n Debug.Assert(FindClosestElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)5.9f, (float)4.0f, (float)5.0f}))).Equals((Tuple.Create(5.0f, 5.9f))));\n Debug.Assert(FindClosestElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.2f}))).Equals((Tuple.Create(2.0f, 2.2f))));\n Debug.Assert(FindClosestElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.0f}))).Equals((Tuple.Create(2.0f, 2.0f))));\n Debug.Assert(FindClosestElements((new List(new float[]{(float)1.1f, (float)2.2f, (float)3.1f, (float)4.1f, (float)5.1f}))).Equals((Tuple.Create(2.2f, 3.1f))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You have been tasked to write a function that receives \n // a hexadecimal number as a string and counts the number of hexadecimal \n // digits that are primes (prime number, or a prime, is a natural number \n // greater than 1 that is not a product of two smaller natural numbers).\n // Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n // Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n // So you have to determine a number of the following digits: 2, 3, 5, 7, \n // B (=decimal 11), D (=decimal 13).\n // Note: you may assume the input is always correct or empty string, \n // and symbols A,B,C,D,E,F are always uppercase.\n // Examples:\n // >>> HexKey((\"AB\"))\n // (1L)\n // >>> HexKey((\"1077E\"))\n // (2L)\n // >>> HexKey((\"ABED1A33\"))\n // (4L)\n // >>> HexKey((\"123456789ABCDEF0\"))\n // (6L)\n // >>> HexKey((\"2020\"))\n // (2L)\n public static long HexKey(string num) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(HexKey((\"AB\")) == (1L));\n Debug.Assert(HexKey((\"1077E\")) == (2L));\n Debug.Assert(HexKey((\"ABED1A33\")) == (4L));\n Debug.Assert(HexKey((\"2020\")) == (2L));\n Debug.Assert(HexKey((\"123456789ABCDEF0\")) == (6L));\n Debug.Assert(HexKey((\"112233445566778899AABBCCDDEEFF00\")) == (12L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Complete the function that takes two integers and returns \n // the product of their unit digits.\n // Assume the input is always valid.\n // Examples:\n // >>> Multiply((148L), (412L))\n // (16L)\n // >>> Multiply((19L), (28L))\n // (72L)\n // >>> Multiply((2020L), (1851L))\n // (0L)\n // >>> Multiply((14L), (-15L))\n // (20L)\n public static long Multiply(long a, long b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Multiply((148L), (412L)) == (16L));\n Debug.Assert(Multiply((19L), (28L)) == (72L));\n Debug.Assert(Multiply((2020L), (1851L)) == (0L));\n Debug.Assert(Multiply((14L), (-15L)) == (20L));\n Debug.Assert(Multiply((76L), (67L)) == (42L));\n Debug.Assert(Multiply((17L), (27L)) == (49L));\n Debug.Assert(Multiply((0L), (1L)) == (0L));\n Debug.Assert(Multiply((0L), (0L)) == (0L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given list of numbers (of at least two elements), apply a linear transform to that list,\n // such that the smallest number will become 0 and the largest will become 1\n // >>> RescaleToUnit((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f})))\n // (new List(new float[]{(float)0.0f, (float)0.25f, (float)0.5f, (float)0.75f, (float)1.0f}))\n public static List RescaleToUnit(List numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(RescaleToUnit((new List(new float[]{(float)2.0f, (float)49.9f}))).Equals((new List(new float[]{(float)0.0f, (float)1.0f}))));\n Debug.Assert(RescaleToUnit((new List(new float[]{(float)100.0f, (float)49.9f}))).Equals((new List(new float[]{(float)1.0f, (float)0.0f}))));\n Debug.Assert(RescaleToUnit((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f}))).Equals((new List(new float[]{(float)0.0f, (float)0.25f, (float)0.5f, (float)0.75f, (float)1.0f}))));\n Debug.Assert(RescaleToUnit((new List(new float[]{(float)2.0f, (float)1.0f, (float)5.0f, (float)3.0f, (float)4.0f}))).Equals((new List(new float[]{(float)0.25f, (float)0.0f, (float)1.0f, (float)0.5f, (float)0.75f}))));\n Debug.Assert(RescaleToUnit((new List(new float[]{(float)12.0f, (float)11.0f, (float)15.0f, (float)13.0f, (float)14.0f}))).Equals((new List(new float[]{(float)0.25f, (float)0.0f, (float)1.0f, (float)0.5f, (float)0.75f}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a positive integer n, return the product of the odd digits.\n // Return 0 if all digits are even.\n // For example:\n // >>> Digits((1L))\n // (1L)\n // >>> Digits((4L))\n // (0L)\n // >>> Digits((235L))\n // (15L)\n public static long Digits(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Digits((5L)) == (5L));\n Debug.Assert(Digits((54L)) == (5L));\n Debug.Assert(Digits((120L)) == (1L));\n Debug.Assert(Digits((5014L)) == (5L));\n Debug.Assert(Digits((98765L)) == (315L));\n Debug.Assert(Digits((5576543L)) == (2625L));\n Debug.Assert(Digits((2468L)) == (0L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You will be given the name of a class (a string) and a list of extensions.\n // The extensions are to be used to load additional classes to the class. The\n // strength of the extension is as follows: Let CAP be the number of the uppercase\n // letters in the extension's name, and let SM be the number of lowercase letters \n // in the extension's name, the strength is given by the fraction CAP - SM. \n // You should find the strongest extension and return a string in this \n // format: ClassName.StrongestExtensionName.\n // If there are two or more extensions with the same strength, you should\n // choose the one that comes first in the list.\n // For example, if you are given \"Slices\" as the class and a list of the\n // extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n // return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n // (its strength is -1).\n // Example:\n // >>> StrongestExtension((\"my_class\"), (new List(new string[]{(string)\"AA\", (string)\"Be\", (string)\"CC\"})))\n // (\"my_class.AA\")\n public static string StrongestExtension(string class_name, List extensions) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(StrongestExtension((\"Watashi\"), (new List(new string[]{(string)\"tEN\", (string)\"niNE\", (string)\"eIGHt8OKe\"}))).Equals((\"Watashi.eIGHt8OKe\")));\n Debug.Assert(StrongestExtension((\"Boku123\"), (new List(new string[]{(string)\"nani\", (string)\"NazeDa\", (string)\"YEs.WeCaNe\", (string)\"32145tggg\"}))).Equals((\"Boku123.YEs.WeCaNe\")));\n Debug.Assert(StrongestExtension((\"__YESIMHERE\"), (new List(new string[]{(string)\"t\", (string)\"eMptY\", (string)\"nothing\", (string)\"zeR00\", (string)\"NuLl__\", (string)\"123NoooneB321\"}))).Equals((\"__YESIMHERE.NuLl__\")));\n Debug.Assert(StrongestExtension((\"K\"), (new List(new string[]{(string)\"Ta\", (string)\"TAR\", (string)\"t234An\", (string)\"cosSo\"}))).Equals((\"K.TAR\")));\n Debug.Assert(StrongestExtension((\"__HAHA\"), (new List(new string[]{(string)\"Tab\", (string)\"123\", (string)\"781345\", (string)\"-_-\"}))).Equals((\"__HAHA.123\")));\n Debug.Assert(StrongestExtension((\"YameRore\"), (new List(new string[]{(string)\"HhAas\", (string)\"okIWILL123\", (string)\"WorkOut\", (string)\"Fails\", (string)\"-_-\"}))).Equals((\"YameRore.okIWILL123\")));\n Debug.Assert(StrongestExtension((\"finNNalLLly\"), (new List(new string[]{(string)\"Die\", (string)\"NowW\", (string)\"Wow\", (string)\"WoW\"}))).Equals((\"finNNalLLly.WoW\")));\n Debug.Assert(StrongestExtension((\"_\"), (new List(new string[]{(string)\"Bb\", (string)\"91245\"}))).Equals((\"_.Bb\")));\n Debug.Assert(StrongestExtension((\"Sp\"), (new List(new string[]{(string)\"671235\", (string)\"Bb\"}))).Equals((\"Sp.671235\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a string representing a space separated lowercase letters, return a dictionary\n // of the letter with the most repetition and containing the corresponding count.\n // If several letters have the same occurrence, return all of them.\n // Example:\n // >>> Histogram((\"a b c\"))\n // (new Dictionary(){{\"a\", 1L}, {\"b\", 1L}, {\"c\", 1L}})\n // >>> Histogram((\"a b b a\"))\n // (new Dictionary(){{\"a\", 2L}, {\"b\", 2L}})\n // >>> Histogram((\"a b c a b\"))\n // (new Dictionary(){{\"a\", 2L}, {\"b\", 2L}})\n // >>> Histogram((\"b b b b a\"))\n // (new Dictionary(){{\"b\", 4L}})\n // >>> Histogram((\"\"))\n // (new Dictionary())\n public static Dictionary Histogram(string test) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Histogram((\"a b b a\")).Equals((new Dictionary(){{\"a\", 2L}, {\"b\", 2L}})));\n Debug.Assert(Histogram((\"a b c a b\")).Equals((new Dictionary(){{\"a\", 2L}, {\"b\", 2L}})));\n Debug.Assert(Histogram((\"a b c d g\")).Equals((new Dictionary(){{\"a\", 1L}, {\"b\", 1L}, {\"c\", 1L}, {\"d\", 1L}, {\"g\", 1L}})));\n Debug.Assert(Histogram((\"r t g\")).Equals((new Dictionary(){{\"r\", 1L}, {\"t\", 1L}, {\"g\", 1L}})));\n Debug.Assert(Histogram((\"b b b b a\")).Equals((new Dictionary(){{\"b\", 4L}})));\n Debug.Assert(Histogram((\"r t g\")).Equals((new Dictionary(){{\"r\", 1L}, {\"t\", 1L}, {\"g\", 1L}})));\n Debug.Assert(Histogram((\"\")).Equals((new Dictionary())));\n Debug.Assert(Histogram((\"a\")).Equals((new Dictionary(){{\"a\", 1L}})));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // pairs_sum_to_zero takes a list of integers as an input.\n // it returns true if there are two distinct elements in the list that\n // sum to zero, and false otherwise.\n // >>> PairsSumToZero((new List(new long[]{(long)1L, (long)3L, (long)5L, (long)0L})))\n // (false)\n // >>> PairsSumToZero((new List(new long[]{(long)1L, (long)3L, (long)-2L, (long)1L})))\n // (false)\n // >>> PairsSumToZero((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)7L})))\n // (false)\n // >>> PairsSumToZero((new List(new long[]{(long)2L, (long)4L, (long)-5L, (long)3L, (long)5L, (long)7L})))\n // (true)\n // >>> PairsSumToZero((new List(new long[]{(long)1L})))\n // (false)\n public static bool PairsSumToZero(List l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)1L, (long)3L, (long)5L, (long)0L}))) == (false));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)1L, (long)3L, (long)-2L, (long)1L}))) == (false));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)7L}))) == (false));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)2L, (long)4L, (long)-5L, (long)3L, (long)5L, (long)7L}))) == (true));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)1L}))) == (false));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)-3L, (long)9L, (long)-1L, (long)3L, (long)2L, (long)30L}))) == (true));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)-3L, (long)9L, (long)-1L, (long)3L, (long)2L, (long)31L}))) == (true));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)-3L, (long)9L, (long)-1L, (long)4L, (long)2L, (long)30L}))) == (false));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)-3L, (long)9L, (long)-1L, (long)4L, (long)2L, (long)31L}))) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that accepts two lists of strings and returns the list that has \n // total number of chars in the all strings of the list less than the other list.\n // if the two lists have the same number of chars, return the first list.\n // Examples\n // >>> TotalMatch((new List()), (new List()))\n // (new List())\n // >>> TotalMatch((new List(new string[]{(string)\"hi\", (string)\"admin\"})), (new List(new string[]{(string)\"hI\", (string)\"Hi\"})))\n // (new List(new string[]{(string)\"hI\", (string)\"Hi\"}))\n // >>> TotalMatch((new List(new string[]{(string)\"hi\", (string)\"admin\"})), (new List(new string[]{(string)\"hi\", (string)\"hi\", (string)\"admin\", (string)\"project\"})))\n // (new List(new string[]{(string)\"hi\", (string)\"admin\"}))\n // >>> TotalMatch((new List(new string[]{(string)\"hi\", (string)\"admin\"})), (new List(new string[]{(string)\"hI\", (string)\"hi\", (string)\"hi\"})))\n // (new List(new string[]{(string)\"hI\", (string)\"hi\", (string)\"hi\"}))\n // >>> TotalMatch((new List(new string[]{(string)\"4\"})), (new List(new string[]{(string)\"1\", (string)\"2\", (string)\"3\", (string)\"4\", (string)\"5\"})))\n // (new List(new string[]{(string)\"4\"}))\n public static List TotalMatch(List lst1, List lst2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(TotalMatch((new List()), (new List())).Equals((new List())));\n Debug.Assert(TotalMatch((new List(new string[]{(string)\"hi\", (string)\"admin\"})), (new List(new string[]{(string)\"hi\", (string)\"hi\"}))).Equals((new List(new string[]{(string)\"hi\", (string)\"hi\"}))));\n Debug.Assert(TotalMatch((new List(new string[]{(string)\"hi\", (string)\"admin\"})), (new List(new string[]{(string)\"hi\", (string)\"hi\", (string)\"admin\", (string)\"project\"}))).Equals((new List(new string[]{(string)\"hi\", (string)\"admin\"}))));\n Debug.Assert(TotalMatch((new List(new string[]{(string)\"4\"})), (new List(new string[]{(string)\"1\", (string)\"2\", (string)\"3\", (string)\"4\", (string)\"5\"}))).Equals((new List(new string[]{(string)\"4\"}))));\n Debug.Assert(TotalMatch((new List(new string[]{(string)\"hi\", (string)\"admin\"})), (new List(new string[]{(string)\"hI\", (string)\"Hi\"}))).Equals((new List(new string[]{(string)\"hI\", (string)\"Hi\"}))));\n Debug.Assert(TotalMatch((new List(new string[]{(string)\"hi\", (string)\"admin\"})), (new List(new string[]{(string)\"hI\", (string)\"hi\", (string)\"hi\"}))).Equals((new List(new string[]{(string)\"hI\", (string)\"hi\", (string)\"hi\"}))));\n Debug.Assert(TotalMatch((new List(new string[]{(string)\"hi\", (string)\"admin\"})), (new List(new string[]{(string)\"hI\", (string)\"hi\", (string)\"hii\"}))).Equals((new List(new string[]{(string)\"hi\", (string)\"admin\"}))));\n Debug.Assert(TotalMatch((new List()), (new List(new string[]{(string)\"this\"}))).Equals((new List())));\n Debug.Assert(TotalMatch((new List(new string[]{(string)\"this\"})), (new List())).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Circular shift the digits of the integer x, shift the digits right by shift\n // and return the result as a string.\n // If shift > number of digits, return digits reversed.\n // >>> CircularShift((12L), (1L))\n // (\"21\")\n // >>> CircularShift((12L), (2L))\n // (\"12\")\n public static string CircularShift(long x, long shift) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CircularShift((100L), (2L)).Equals((\"001\")));\n Debug.Assert(CircularShift((12L), (2L)).Equals((\"12\")));\n Debug.Assert(CircularShift((97L), (8L)).Equals((\"79\")));\n Debug.Assert(CircularShift((12L), (1L)).Equals((\"21\")));\n Debug.Assert(CircularShift((11L), (101L)).Equals((\"11\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return true is list elements are monotonically increasing or decreasing.\n // >>> Monotonic((new List(new long[]{(long)1L, (long)2L, (long)4L, (long)20L})))\n // (true)\n // >>> Monotonic((new List(new long[]{(long)1L, (long)20L, (long)4L, (long)10L})))\n // (false)\n // >>> Monotonic((new List(new long[]{(long)4L, (long)1L, (long)0L, (long)-10L})))\n // (true)\n public static bool Monotonic(List l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Monotonic((new List(new long[]{(long)1L, (long)2L, (long)4L, (long)10L}))) == (true));\n Debug.Assert(Monotonic((new List(new long[]{(long)1L, (long)2L, (long)4L, (long)20L}))) == (true));\n Debug.Assert(Monotonic((new List(new long[]{(long)1L, (long)20L, (long)4L, (long)10L}))) == (false));\n Debug.Assert(Monotonic((new List(new long[]{(long)4L, (long)1L, (long)0L, (long)-10L}))) == (true));\n Debug.Assert(Monotonic((new List(new long[]{(long)4L, (long)1L, (long)1L, (long)0L}))) == (true));\n Debug.Assert(Monotonic((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)2L, (long)5L, (long)60L}))) == (false));\n Debug.Assert(Monotonic((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)60L}))) == (true));\n Debug.Assert(Monotonic((new List(new long[]{(long)9L, (long)9L, (long)9L, (long)9L}))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n // Example\n // >>> IsEqualToSumEven((4L))\n // (false)\n // >>> IsEqualToSumEven((6L))\n // (false)\n // >>> IsEqualToSumEven((8L))\n // (true)\n public static bool IsEqualToSumEven(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsEqualToSumEven((4L)) == (false));\n Debug.Assert(IsEqualToSumEven((6L)) == (false));\n Debug.Assert(IsEqualToSumEven((8L)) == (true));\n Debug.Assert(IsEqualToSumEven((10L)) == (true));\n Debug.Assert(IsEqualToSumEven((11L)) == (false));\n Debug.Assert(IsEqualToSumEven((12L)) == (true));\n Debug.Assert(IsEqualToSumEven((13L)) == (false));\n Debug.Assert(IsEqualToSumEven((16L)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Input to this function is a string representing musical notes in a special ASCII format.\n // Your task is to parse this string and return list of integers corresponding to how many beats does each\n // not last.\n // Here is a legend:\n // 'o' - whole note, lasts four beats\n // 'o|' - half note, lasts two beats\n // '.|' - quater note, lasts one beat\n // >>> ParseMusic((\"o o| .| o| o| .| .| .| .| o o\"))\n // (new List(new long[]{(long)4L, (long)2L, (long)1L, (long)2L, (long)2L, (long)1L, (long)1L, (long)1L, (long)1L, (long)4L, (long)4L}))\n public static List ParseMusic(string music_string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ParseMusic((\"\")).Equals((new List())));\n Debug.Assert(ParseMusic((\"o o o o\")).Equals((new List(new long[]{(long)4L, (long)4L, (long)4L, (long)4L}))));\n Debug.Assert(ParseMusic((\".| .| .| .|\")).Equals((new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L}))));\n Debug.Assert(ParseMusic((\"o| o| .| .| o o o o\")).Equals((new List(new long[]{(long)2L, (long)2L, (long)1L, (long)1L, (long)4L, (long)4L, (long)4L, (long)4L}))));\n Debug.Assert(ParseMusic((\"o| .| o| .| o o| o o|\")).Equals((new List(new long[]{(long)2L, (long)1L, (long)2L, (long)1L, (long)4L, (long)2L, (long)4L, (long)2L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // \"\n // This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n // multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n // change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n // Examples:\n // >>> lst\n // (long)new List(new long[]{(long)1L, (long)2L, (long)3L})\n // >>> lst\n // (long)new List()\n // >>> lst\n // (long)new List(new long[]{(long)-1L, (long)-5L, (long)2L, (long)-1L, (long)-5L})\n public static long SumSquares(List lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SumSquares((new List(new long[]{(long)1L, (long)2L, (long)3L}))) == (6L));\n Debug.Assert(SumSquares((new List(new long[]{(long)1L, (long)4L, (long)9L}))) == (14L));\n Debug.Assert(SumSquares((new List())) == (0L));\n Debug.Assert(SumSquares((new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L, (long)1L, (long)1L, (long)1L, (long)1L, (long)1L}))) == (9L));\n Debug.Assert(SumSquares((new List(new long[]{(long)-1L, (long)-1L, (long)-1L, (long)-1L, (long)-1L, (long)-1L, (long)-1L, (long)-1L, (long)-1L}))) == (-3L));\n Debug.Assert(SumSquares((new List(new long[]{(long)0L}))) == (0L));\n Debug.Assert(SumSquares((new List(new long[]{(long)-1L, (long)-5L, (long)2L, (long)-1L, (long)-5L}))) == (-126L));\n Debug.Assert(SumSquares((new List(new long[]{(long)-56L, (long)-99L, (long)1L, (long)0L, (long)-2L}))) == (3030L));\n Debug.Assert(SumSquares((new List(new long[]{(long)-1L, (long)0L, (long)0L, (long)0L, (long)0L, (long)0L, (long)0L, (long)0L, (long)-1L}))) == (0L));\n Debug.Assert(SumSquares((new List(new long[]{(long)-16L, (long)-9L, (long)-2L, (long)36L, (long)36L, (long)26L, (long)-20L, (long)25L, (long)-40L, (long)20L, (long)-4L, (long)12L, (long)-26L, (long)35L, (long)37L}))) == (-14196L));\n Debug.Assert(SumSquares((new List(new long[]{(long)-1L, (long)-3L, (long)17L, (long)-1L, (long)-15L, (long)13L, (long)-1L, (long)14L, (long)-14L, (long)-12L, (long)-5L, (long)14L, (long)-14L, (long)6L, (long)13L, (long)11L, (long)16L, (long)16L, (long)4L, (long)10L}))) == (-1448L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // triples_sum_to_zero takes a list of integers as an input.\n // it returns true if there are three distinct elements in the list that\n // sum to zero, and false otherwise.\n // >>> TriplesSumToZero((new List(new long[]{(long)1L, (long)3L, (long)5L, (long)0L})))\n // (false)\n // >>> TriplesSumToZero((new List(new long[]{(long)1L, (long)3L, (long)-2L, (long)1L})))\n // (true)\n // >>> TriplesSumToZero((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)7L})))\n // (false)\n // >>> TriplesSumToZero((new List(new long[]{(long)2L, (long)4L, (long)-5L, (long)3L, (long)9L, (long)7L})))\n // (true)\n // >>> TriplesSumToZero((new List(new long[]{(long)1L})))\n // (false)\n public static bool TriplesSumToZero(List l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)1L, (long)3L, (long)5L, (long)0L}))) == (false));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)1L, (long)3L, (long)5L, (long)-1L}))) == (false));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)1L, (long)3L, (long)-2L, (long)1L}))) == (true));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)7L}))) == (false));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)1L, (long)2L, (long)5L, (long)7L}))) == (false));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)2L, (long)4L, (long)-5L, (long)3L, (long)9L, (long)7L}))) == (true));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)1L}))) == (false));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)1L, (long)3L, (long)5L, (long)-100L}))) == (false));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)100L, (long)3L, (long)5L, (long)-100L}))) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // brackets is a string of \"<\" and \">\".\n // return true if every opening bracket has a corresponding closing bracket.\n // >>> CorrectBracketing((\"<\"))\n // (false)\n // >>> CorrectBracketing((\"<>\"))\n // (true)\n // >>> CorrectBracketing((\"<<><>>\"))\n // (true)\n // >>> CorrectBracketing((\"><<>\"))\n // (false)\n public static bool CorrectBracketing(string brackets) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CorrectBracketing((\"<>\")) == (true));\n Debug.Assert(CorrectBracketing((\"<<><>>\")) == (true));\n Debug.Assert(CorrectBracketing((\"<><><<><>><>\")) == (true));\n Debug.Assert(CorrectBracketing((\"<><><<<><><>><>><<><><<>>>\")) == (true));\n Debug.Assert(CorrectBracketing((\"<<<><>>>>\")) == (false));\n Debug.Assert(CorrectBracketing((\"><<>\")) == (false));\n Debug.Assert(CorrectBracketing((\"<\")) == (false));\n Debug.Assert(CorrectBracketing((\"<<<<\")) == (false));\n Debug.Assert(CorrectBracketing((\">\")) == (false));\n Debug.Assert(CorrectBracketing((\"<<>\")) == (false));\n Debug.Assert(CorrectBracketing((\"<><><<><>><>><<>\")) == (false));\n Debug.Assert(CorrectBracketing((\"<><><<><>><>>><>\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that takes a list of numbers as input and returns \n // the number of elements in the list that are greater than 10 and both \n // first and last digits of a number are odd (1, 3, 5, 7, 9).\n // For example:\n // >>> Specialfilter((new List(new long[]{(long)15L, (long)-73L, (long)14L, (long)-15L})))\n // (1L)\n // >>> Specialfilter((new List(new long[]{(long)33L, (long)-2L, (long)-3L, (long)45L, (long)21L, (long)109L})))\n // (2L)\n public static long Specialfilter(List nums) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Specialfilter((new List(new long[]{(long)5L, (long)-2L, (long)1L, (long)-5L}))) == (0L));\n Debug.Assert(Specialfilter((new List(new long[]{(long)15L, (long)-73L, (long)14L, (long)-15L}))) == (1L));\n Debug.Assert(Specialfilter((new List(new long[]{(long)33L, (long)-2L, (long)-3L, (long)45L, (long)21L, (long)109L}))) == (2L));\n Debug.Assert(Specialfilter((new List(new long[]{(long)43L, (long)-12L, (long)93L, (long)125L, (long)121L, (long)109L}))) == (4L));\n Debug.Assert(Specialfilter((new List(new long[]{(long)71L, (long)-2L, (long)-33L, (long)75L, (long)21L, (long)19L}))) == (3L));\n Debug.Assert(Specialfilter((new List(new long[]{(long)1L}))) == (0L));\n Debug.Assert(Specialfilter((new List())) == (0L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a dictionary, return true if all keys are strings in lower \n // case or all keys are strings in upper case, else return false.\n // The function should return false is the given dictionary is empty.\n // Examples:\n // >>> CheckDictCase((new Dictionary(){{\"a\", \"apple\"}, {\"b\", \"banana\"}}))\n // (true)\n // >>> CheckDictCase((new Dictionary(){{\"a\", \"apple\"}, {\"A\", \"banana\"}, {\"B\", \"banana\"}}))\n // (false)\n // >>> CheckDictCase((new Dictionary(){{\"a\", \"apple\"}, {8L, \"banana\"}, {\"a\", \"apple\"}}))\n // (false)\n // >>> CheckDictCase((new Dictionary(){{\"Name\", \"John\"}, {\"Age\", \"36\"}, {\"City\", \"Houston\"}}))\n // (false)\n // >>> CheckDictCase((new Dictionary(){{\"STATE\", \"NC\"}, {\"ZIP\", \"12345\"}}))\n // (true)\n public static bool CheckDictCase(Dictionary dict) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CheckDictCase((new Dictionary(){{\"p\", \"pineapple\"}, {\"b\", \"banana\"}})) == (true));\n Debug.Assert(CheckDictCase((new Dictionary(){{\"p\", \"pineapple\"}, {\"A\", \"banana\"}, {\"B\", \"banana\"}})) == (false));\n Debug.Assert(CheckDictCase((new Dictionary(){{\"p\", \"pineapple\"}, {\"5\", \"banana\"}, {\"a\", \"apple\"}})) == (false));\n Debug.Assert(CheckDictCase((new Dictionary(){{\"Name\", \"John\"}, {\"Age\", \"36\"}, {\"City\", \"Houston\"}})) == (false));\n Debug.Assert(CheckDictCase((new Dictionary(){{\"STATE\", \"NC\"}, {\"ZIP\", \"12345\"}})) == (true));\n Debug.Assert(CheckDictCase((new Dictionary(){{\"fruit\", \"Orange\"}, {\"taste\", \"Sweet\"}})) == (true));\n Debug.Assert(CheckDictCase((new Dictionary())) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n // fibfib(0) == 0\n // fibfib(1) == 0\n // fibfib(2) == 1\n // fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n // Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n // >>> Fibfib((1L))\n // (0L)\n // >>> Fibfib((5L))\n // (4L)\n // >>> Fibfib((8L))\n // (24L)\n public static long Fibfib(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Fibfib((2L)) == (1L));\n Debug.Assert(Fibfib((1L)) == (0L));\n Debug.Assert(Fibfib((5L)) == (4L));\n Debug.Assert(Fibfib((8L)) == (24L));\n Debug.Assert(Fibfib((10L)) == (81L));\n Debug.Assert(Fibfib((12L)) == (274L));\n Debug.Assert(Fibfib((14L)) == (927L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a list of numbers.\n // You need to return the sum of squared numbers in the given list,\n // round each element in the list to the upper int(Ceiling) first.\n // Examples:\n // >>> Lst((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f})))\n // (14L)\n // >>> Lst((new List(new float[]{(float)1.0f, (float)4.0f, (float)9.0f})))\n // (98L)\n // >>> Lst((new List(new float[]{(float)1.0f, (float)3.0f, (float)5.0f, (float)7.0f})))\n // (84L)\n // >>> Lst((new List(new float[]{(float)1.4f, (float)4.2f, (float)0.0f})))\n // (29L)\n // >>> Lst((new List(new float[]{(float)-2.4f, (float)1.0f, (float)1.0f})))\n // (6L)\n public static long SumSquares(List lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SumSquares((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f}))) == (14L));\n Debug.Assert(SumSquares((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f}))) == (14L));\n Debug.Assert(SumSquares((new List(new float[]{(float)1.0f, (float)3.0f, (float)5.0f, (float)7.0f}))) == (84L));\n Debug.Assert(SumSquares((new List(new float[]{(float)1.4f, (float)4.2f, (float)0.0f}))) == (29L));\n Debug.Assert(SumSquares((new List(new float[]{(float)-2.4f, (float)1.0f, (float)1.0f}))) == (6L));\n Debug.Assert(SumSquares((new List(new float[]{(float)100.0f, (float)1.0f, (float)15.0f, (float)2.0f}))) == (10230L));\n Debug.Assert(SumSquares((new List(new float[]{(float)10000.0f, (float)10000.0f}))) == (200000000L));\n Debug.Assert(SumSquares((new List(new float[]{(float)-1.4f, (float)4.6f, (float)6.3f}))) == (75L));\n Debug.Assert(SumSquares((new List(new float[]{(float)-1.4f, (float)17.9f, (float)18.9f, (float)19.9f}))) == (1086L));\n Debug.Assert(SumSquares((new List(new float[]{(float)0.0f}))) == (0L));\n Debug.Assert(SumSquares((new List(new float[]{(float)-1.0f}))) == (1L));\n Debug.Assert(SumSquares((new List(new float[]{(float)-1.0f, (float)1.0f, (float)0.0f}))) == (2L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_85_add", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a non-empty list of integers lst. add the even elements that are at odd indices..\n // Examples:\n // >>> Add((new List(new long[]{(long)4L, (long)2L, (long)6L, (long)7L})))\n // (2L)\n public static long Add(List lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Add((new List(new long[]{(long)4L, (long)88L}))) == (88L));\n Debug.Assert(Add((new List(new long[]{(long)4L, (long)5L, (long)6L, (long)7L, (long)2L, (long)122L}))) == (122L));\n Debug.Assert(Add((new List(new long[]{(long)4L, (long)0L, (long)6L, (long)7L}))) == (0L));\n Debug.Assert(Add((new List(new long[]{(long)4L, (long)4L, (long)6L, (long)8L}))) == (12L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return sorted unique elements in a list\n // >>> Unique((new List(new long[]{(long)5L, (long)3L, (long)5L, (long)2L, (long)3L, (long)3L, (long)9L, (long)0L, (long)123L})))\n // (new List(new long[]{(long)0L, (long)2L, (long)3L, (long)5L, (long)9L, (long)123L}))\n public static List Unique(List l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Unique((new List(new long[]{(long)5L, (long)3L, (long)5L, (long)2L, (long)3L, (long)3L, (long)9L, (long)0L, (long)123L}))).Equals((new List(new long[]{(long)0L, (long)2L, (long)3L, (long)5L, (long)9L, (long)123L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a string text, replace all spaces in it with underscores, \n // and if a string has more than 2 consecutive spaces, \n // then replace all consecutive spaces with - \n // >>> FixSpaces((\" Example\"))\n // (\"Example\")\n // >>> FixSpaces((\" Example 1\"))\n // (\"Example_1\")\n // >>> FixSpaces((\" Example 2\"))\n // (\"_Example_2\")\n // >>> FixSpaces((\" Example 3\"))\n // (\"_Example-3\")\n public static string FixSpaces(string text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FixSpaces((\"Example\")).Equals((\"Example\")));\n Debug.Assert(FixSpaces((\"Mudasir Hanif \")).Equals((\"Mudasir_Hanif_\")));\n Debug.Assert(FixSpaces((\"Yellow Yellow Dirty Fellow\")).Equals((\"Yellow_Yellow__Dirty__Fellow\")));\n Debug.Assert(FixSpaces((\"Exa mple\")).Equals((\"Exa-mple\")));\n Debug.Assert(FixSpaces((\" Exa 1 2 2 mple\")).Equals((\"-Exa_1_2_2_mple\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return 2^n modulo p (be aware of numerics).\n // >>> Modp((3L), (5L))\n // (3L)\n // >>> Modp((1101L), (101L))\n // (2L)\n // >>> Modp((0L), (101L))\n // (1L)\n // >>> Modp((3L), (11L))\n // (8L)\n // >>> Modp((100L), (101L))\n // (1L)\n public static long Modp(long n, long p) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Modp((3L), (5L)) == (3L));\n Debug.Assert(Modp((1101L), (101L)) == (2L));\n Debug.Assert(Modp((0L), (101L)) == (1L));\n Debug.Assert(Modp((3L), (11L)) == (8L));\n Debug.Assert(Modp((100L), (101L)) == (1L));\n Debug.Assert(Modp((30L), (5L)) == (4L));\n Debug.Assert(Modp((31L), (5L)) == (3L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You have to write a function which validates a given date string and\n // returns true if the date is valid otherwise false.\n // The date is valid if all of the following rules are satisfied:\n // 1. The date string is not empty.\n // 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n // 3. The months should not be less than 1 or higher than 12.\n // 4. The date should be in the format: mm-dd-yyyy\n // >>> ValidDate((\"03-11-2000\"))\n // (true)\n // >>> ValidDate((\"15-01-2012\"))\n // (false)\n // >>> ValidDate((\"04-0-2040\"))\n // (false)\n // >>> ValidDate((\"06-04-2020\"))\n // (true)\n // >>> ValidDate((\"06/04/2020\"))\n // (false)\n public static bool ValidDate(string date) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ValidDate((\"03-11-2000\")) == (true));\n Debug.Assert(ValidDate((\"15-01-2012\")) == (false));\n Debug.Assert(ValidDate((\"04-0-2040\")) == (false));\n Debug.Assert(ValidDate((\"06-04-2020\")) == (true));\n Debug.Assert(ValidDate((\"01-01-2007\")) == (true));\n Debug.Assert(ValidDate((\"03-32-2011\")) == (false));\n Debug.Assert(ValidDate((\"\")) == (false));\n Debug.Assert(ValidDate((\"04-31-3000\")) == (false));\n Debug.Assert(ValidDate((\"06-06-2005\")) == (true));\n Debug.Assert(ValidDate((\"21-31-2000\")) == (false));\n Debug.Assert(ValidDate((\"04-12-2003\")) == (true));\n Debug.Assert(ValidDate((\"04122003\")) == (false));\n Debug.Assert(ValidDate((\"20030412\")) == (false));\n Debug.Assert(ValidDate((\"2003-04\")) == (false));\n Debug.Assert(ValidDate((\"2003-04-12\")) == (false));\n Debug.Assert(ValidDate((\"04-2003\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that takes a string and returns an ordered version of it.\n // Ordered version of string, is a string where all words (separated by space)\n // are replaced by a new word where all the characters arranged in\n // ascending order based on ascii value.\n // Note: You should keep the order of words and blank spaces in the sentence.\n // For example:\n // >>> AntiShuffle((\"Hi\"))\n // (\"Hi\")\n // >>> AntiShuffle((\"hello\"))\n // (\"ehllo\")\n // >>> AntiShuffle((\"Hello World!!!\"))\n // (\"Hello !!!Wdlor\")\n public static string AntiShuffle(string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(AntiShuffle((\"Hi\")).Equals((\"Hi\")));\n Debug.Assert(AntiShuffle((\"hello\")).Equals((\"ehllo\")));\n Debug.Assert(AntiShuffle((\"number\")).Equals((\"bemnru\")));\n Debug.Assert(AntiShuffle((\"abcd\")).Equals((\"abcd\")));\n Debug.Assert(AntiShuffle((\"Hello World!!!\")).Equals((\"Hello !!!Wdlor\")));\n Debug.Assert(AntiShuffle((\"\")).Equals((\"\")));\n Debug.Assert(AntiShuffle((\"Hi. My name is Mister Robot. How are you?\")).Equals((\".Hi My aemn is Meirst .Rboot How aer ?ouy\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a list of numbers, return whether or not they are sorted\n // in ascending order. If list has more than 1 duplicate of the same\n // number, return false. Assume no negative numbers and only integers.\n // Examples\n // >>> IsSorted((new List(new long[]{(long)5L})))\n // (true)\n // >>> IsSorted((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L})))\n // (true)\n // >>> IsSorted((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)4L, (long)5L})))\n // (false)\n // >>> IsSorted((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L})))\n // (true)\n // >>> IsSorted((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L, (long)7L})))\n // (true)\n // >>> IsSorted((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)4L, (long)5L, (long)6L, (long)7L})))\n // (false)\n // >>> IsSorted((new List(new long[]{(long)1L, (long)2L, (long)2L, (long)3L, (long)3L, (long)4L})))\n // (true)\n // >>> IsSorted((new List(new long[]{(long)1L, (long)2L, (long)2L, (long)2L, (long)3L, (long)4L})))\n // (false)\n public static bool IsSorted(List lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsSorted((new List(new long[]{(long)5L}))) == (true));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L}))) == (true));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)4L, (long)5L}))) == (false));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}))) == (true));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L, (long)7L}))) == (true));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)4L, (long)5L, (long)6L, (long)7L}))) == (false));\n Debug.Assert(IsSorted((new List())) == (true));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L}))) == (true));\n Debug.Assert(IsSorted((new List(new long[]{(long)3L, (long)2L, (long)1L}))) == (false));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)2L, (long)2L, (long)2L, (long)3L, (long)4L}))) == (false));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)3L, (long)3L, (long)4L}))) == (false));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)2L, (long)2L, (long)3L, (long)3L, (long)4L}))) == (true));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a string s.\n // Your task is to check if the string is hapcs or not.\n // A string is hapcs if its length is at least 3 and every 3 consecutive letters are distinct\n // For example:\n // >>> IsHappy((\"a\"))\n // (false)\n // >>> IsHappy((\"aa\"))\n // (false)\n // >>> IsHappy((\"abcd\"))\n // (true)\n // >>> IsHappy((\"aabb\"))\n // (false)\n // >>> IsHappy((\"adb\"))\n // (true)\n // >>> IsHappy((\"xyy\"))\n // (false)\n public static bool IsHappy(string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsHappy((\"a\")) == (false));\n Debug.Assert(IsHappy((\"aa\")) == (false));\n Debug.Assert(IsHappy((\"abcd\")) == (true));\n Debug.Assert(IsHappy((\"aabb\")) == (false));\n Debug.Assert(IsHappy((\"adb\")) == (true));\n Debug.Assert(IsHappy((\"xyy\")) == (false));\n Debug.Assert(IsHappy((\"iopaxpoi\")) == (true));\n Debug.Assert(IsHappy((\"iopaxioi\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that returns true if the object q will fly, and false otherwise.\n // The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n // Example:\n // >>> WillItFly((new List(new long[]{(long)1L, (long)2L})), (5L))\n // (false)\n // # 1+2 is less than the maximum possible weight, but it's unbalanced.\n // >>> WillItFly((new List(new long[]{(long)3L, (long)2L, (long)3L})), (1L))\n // (false)\n // # it's balanced, but 3+2+3 is more than the maximum possible weight.\n // >>> WillItFly((new List(new long[]{(long)3L, (long)2L, (long)3L})), (9L))\n // (true)\n // # 3+2+3 is less than the maximum possible weight, and it's balanced.\n // >>> WillItFly((new List(new long[]{(long)3L})), (5L))\n // (true)\n // # 3 is less than the maximum possible weight, and it's balanced.\n public static bool WillItFly(List q, long w) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(WillItFly((new List(new long[]{(long)3L, (long)2L, (long)3L})), (9L)) == (true));\n Debug.Assert(WillItFly((new List(new long[]{(long)1L, (long)2L})), (5L)) == (false));\n Debug.Assert(WillItFly((new List(new long[]{(long)3L})), (5L)) == (true));\n Debug.Assert(WillItFly((new List(new long[]{(long)3L, (long)2L, (long)3L})), (1L)) == (false));\n Debug.Assert(WillItFly((new List(new long[]{(long)1L, (long)2L, (long)3L})), (6L)) == (false));\n Debug.Assert(WillItFly((new List(new long[]{(long)5L})), (5L)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a list of non-negative integers, return a cocs of the given list after sorting,\n // you will sort the given list in ascending order if the sum( first index value, last index value) is odd,\n // or sort it in descending order if the sum( first index value, last index value) is even.\n // Note:\n // * don't change the given list.\n // Examples:\n // >>> SortArray((new List()))\n // (new List())\n // >>> SortArray((new List(new long[]{(long)5L})))\n // (new List(new long[]{(long)5L}))\n // >>> SortArray((new List(new long[]{(long)2L, (long)4L, (long)3L, (long)0L, (long)1L, (long)5L})))\n // (new List(new long[]{(long)0L, (long)1L, (long)2L, (long)3L, (long)4L, (long)5L}))\n // >>> SortArray((new List(new long[]{(long)2L, (long)4L, (long)3L, (long)0L, (long)1L, (long)5L, (long)6L})))\n // (new List(new long[]{(long)6L, (long)5L, (long)4L, (long)3L, (long)2L, (long)1L, (long)0L}))\n public static List SortArray(List array) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SortArray((new List())).Equals((new List())));\n Debug.Assert(SortArray((new List(new long[]{(long)5L}))).Equals((new List(new long[]{(long)5L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)2L, (long)4L, (long)3L, (long)0L, (long)1L, (long)5L}))).Equals((new List(new long[]{(long)0L, (long)1L, (long)2L, (long)3L, (long)4L, (long)5L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)2L, (long)4L, (long)3L, (long)0L, (long)1L, (long)5L, (long)6L}))).Equals((new List(new long[]{(long)6L, (long)5L, (long)4L, (long)3L, (long)2L, (long)1L, (long)0L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)2L, (long)1L}))).Equals((new List(new long[]{(long)1L, (long)2L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)15L, (long)42L, (long)87L, (long)32L, (long)11L, (long)0L}))).Equals((new List(new long[]{(long)0L, (long)11L, (long)15L, (long)32L, (long)42L, (long)87L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)21L, (long)14L, (long)23L, (long)11L}))).Equals((new List(new long[]{(long)23L, (long)21L, (long)14L, (long)11L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Implement a function that takes an non-negative integer and returns a list of the first n\n // integers that are prime numbers and less than n.\n // for example:\n // >>> CountUpTo((5L))\n // (new List(new long[]{(long)2L, (long)3L}))\n // >>> CountUpTo((11L))\n // (new List(new long[]{(long)2L, (long)3L, (long)5L, (long)7L}))\n // >>> CountUpTo((0L))\n // (new List())\n // >>> CountUpTo((20L))\n // (new List(new long[]{(long)2L, (long)3L, (long)5L, (long)7L, (long)11L, (long)13L, (long)17L, (long)19L}))\n // >>> CountUpTo((1L))\n // (new List())\n // >>> CountUpTo((18L))\n // (new List(new long[]{(long)2L, (long)3L, (long)5L, (long)7L, (long)11L, (long)13L, (long)17L}))\n public static List CountUpTo(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CountUpTo((5L)).Equals((new List(new long[]{(long)2L, (long)3L}))));\n Debug.Assert(CountUpTo((6L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)5L}))));\n Debug.Assert(CountUpTo((7L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)5L}))));\n Debug.Assert(CountUpTo((10L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)5L, (long)7L}))));\n Debug.Assert(CountUpTo((0L)).Equals((new List())));\n Debug.Assert(CountUpTo((22L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)5L, (long)7L, (long)11L, (long)13L, (long)17L, (long)19L}))));\n Debug.Assert(CountUpTo((1L)).Equals((new List())));\n Debug.Assert(CountUpTo((18L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)5L, (long)7L, (long)11L, (long)13L, (long)17L}))));\n Debug.Assert(CountUpTo((47L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)5L, (long)7L, (long)11L, (long)13L, (long)17L, (long)19L, (long)23L, (long)29L, (long)31L, (long)37L, (long)41L, (long)43L}))));\n Debug.Assert(CountUpTo((101L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)5L, (long)7L, (long)11L, (long)13L, (long)17L, (long)19L, (long)23L, (long)29L, (long)31L, (long)37L, (long)41L, (long)43L, (long)47L, (long)53L, (long)59L, (long)61L, (long)67L, (long)71L, (long)73L, (long)79L, (long)83L, (long)89L, (long)97L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Out of list of strings, return the longest one. Return the first one in case of multiple\n // strings of the same length. Return null in case the input list is empty.\n // >>> Longest((new List()))\n // null\n // >>> Longest((new List(new string[]{(string)\"a\", (string)\"b\", (string)\"c\"})))\n // (\"a\")\n // >>> Longest((new List(new string[]{(string)\"a\", (string)\"bb\", (string)\"ccc\"})))\n // (\"ccc\")\n public static string Longest(List strings) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Longest((new List())).Equals(null));\n Debug.Assert(Longest((new List(new string[]{(string)\"x\", (string)\"y\", (string)\"z\"}))).Equals((\"x\")));\n Debug.Assert(Longest((new List(new string[]{(string)\"x\", (string)\"yyy\", (string)\"zzzz\", (string)\"www\", (string)\"kkkk\", (string)\"abc\"}))).Equals((\"zzzz\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a list of integers, sort the integers that are between 1 and 9 inclusive,\n // reverse the resulting list, and then replace each digit by its corresponding name from\n // \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n // For example:\n // >>> ByLength((new List(new long[]{(long)2L, (long)1L, (long)1L, (long)4L, (long)5L, (long)8L, (long)2L, (long)3L})))\n // (new List(new string[]{(string)\"Eight\", (string)\"Five\", (string)\"Four\", (string)\"Three\", (string)\"Two\", (string)\"Two\", (string)\"One\", (string)\"One\"}))\n // If the list is empty, return an empty list:\n // >>> ByLength((new List()))\n // (new List())\n // If the list has any strange number ignore it:\n // >>> ByLength((new List(new long[]{(long)1L, (long)-1L, (long)55L})))\n // (new List(new string[]{(string)\"One\"}))\n public static List ByLength(List arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ByLength((new List(new long[]{(long)2L, (long)1L, (long)1L, (long)4L, (long)5L, (long)8L, (long)2L, (long)3L}))).Equals((new List(new string[]{(string)\"Eight\", (string)\"Five\", (string)\"Four\", (string)\"Three\", (string)\"Two\", (string)\"Two\", (string)\"One\", (string)\"One\"}))));\n Debug.Assert(ByLength((new List())).Equals((new List())));\n Debug.Assert(ByLength((new List(new long[]{(long)1L, (long)-1L, (long)55L}))).Equals((new List(new string[]{(string)\"One\"}))));\n Debug.Assert(ByLength((new List(new long[]{(long)1L, (long)-1L, (long)3L, (long)2L}))).Equals((new List(new string[]{(string)\"Three\", (string)\"Two\", (string)\"One\"}))));\n Debug.Assert(ByLength((new List(new long[]{(long)9L, (long)4L, (long)8L}))).Equals((new List(new string[]{(string)\"Nine\", (string)\"Eight\", (string)\"Four\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_106_f", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Implement the function f that takes n as a parameter,\n // 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\n // or the sum of numbers from 1 to i otherwise.\n // i starts from 1.\n // the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n // Example:\n // >>> F((5L))\n // (new List(new long[]{(long)1L, (long)2L, (long)6L, (long)24L, (long)15L}))\n public static List F(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(F((5L)).Equals((new List(new long[]{(long)1L, (long)2L, (long)6L, (long)24L, (long)15L}))));\n Debug.Assert(F((7L)).Equals((new List(new long[]{(long)1L, (long)2L, (long)6L, (long)24L, (long)15L, (long)720L, (long)28L}))));\n Debug.Assert(F((1L)).Equals((new List(new long[]{(long)1L}))));\n Debug.Assert(F((3L)).Equals((new List(new long[]{(long)1L, (long)2L, (long)6L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n // >>> FizzBuzz((50L))\n // (0L)\n // >>> FizzBuzz((78L))\n // (2L)\n // >>> FizzBuzz((79L))\n // (3L)\n public static long FizzBuzz(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FizzBuzz((50L)) == (0L));\n Debug.Assert(FizzBuzz((78L)) == (2L));\n Debug.Assert(FizzBuzz((79L)) == (3L));\n Debug.Assert(FizzBuzz((100L)) == (3L));\n Debug.Assert(FizzBuzz((200L)) == (6L));\n Debug.Assert(FizzBuzz((4000L)) == (192L));\n Debug.Assert(FizzBuzz((10000L)) == (639L));\n Debug.Assert(FizzBuzz((100000L)) == (8026L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a positive floating point number, it can be decomposed into\n // and integer part (largest integer smaller than given number) and decimals\n // (leftover part always smaller than 1).\n // Return the decimal part of the number.\n // >>> TruncateNumber((3.5f))\n // (0.5f)\n public static float TruncateNumber(float number) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(TruncateNumber((3.5f)) == (0.5f));\n Debug.Assert(TruncateNumber((1.25f)) == (0.25f));\n Debug.Assert(TruncateNumber((123.0f)) == (0.0f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n // Empty sum should be equal to 0 and empty product should be equal to 1.\n // >>> SumProduct((new List()))\n // (Tuple.Create(0L, 1L))\n // >>> SumProduct((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L})))\n // (Tuple.Create(10L, 24L))\n public static Tuple SumProduct(List numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SumProduct((new List())).Equals((Tuple.Create(0L, 1L))));\n Debug.Assert(SumProduct((new List(new long[]{(long)1L, (long)1L, (long)1L}))).Equals((Tuple.Create(3L, 1L))));\n Debug.Assert(SumProduct((new List(new long[]{(long)100L, (long)0L}))).Equals((Tuple.Create(100L, 0L))));\n Debug.Assert(SumProduct((new List(new long[]{(long)3L, (long)5L, (long)7L}))).Equals((Tuple.Create(15L, 105L))));\n Debug.Assert(SumProduct((new List(new long[]{(long)10L}))).Equals((Tuple.Create(10L, 10L))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a 2 dimensional data, as a nested lists,\n // which is similar to matrix, however, unlike matrices,\n // each row may contain a different number of columns.\n // Given lst, and integer x, find integers x in the list,\n // and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n // each tuple is a coordinate - (row, columns), starting with 0.\n // Sort coordinates initially by rows in ascending order.\n // Also, sort coordinates of the row by columns in descending order.\n // Examples:\n // >>> GetRow((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)1L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)1L})})), (1L))\n // (new List>(new Tuple[]{(Tuple)Tuple.Create(0L, 0L), (Tuple)Tuple.Create(1L, 4L), (Tuple)Tuple.Create(1L, 0L), (Tuple)Tuple.Create(2L, 5L), (Tuple)Tuple.Create(2L, 0L)}))\n // >>> GetRow((new List>()), (1L))\n // (new List>())\n // >>> GetRow((new List>(new List[]{(List)new List(), (List)new List(new long[]{(long)1L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L})})), (3L))\n // (new List>(new Tuple[]{(Tuple)Tuple.Create(2L, 2L)}))\n public static List> GetRow(List> lst, long x) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(GetRow((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)1L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)1L})})), (1L)).Equals((new List>(new Tuple[]{(Tuple)Tuple.Create(0L, 0L), (Tuple)Tuple.Create(1L, 4L), (Tuple)Tuple.Create(1L, 0L), (Tuple)Tuple.Create(2L, 5L), (Tuple)Tuple.Create(2L, 0L)}))));\n Debug.Assert(GetRow((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L})})), (2L)).Equals((new List>(new Tuple[]{(Tuple)Tuple.Create(0L, 1L), (Tuple)Tuple.Create(1L, 1L), (Tuple)Tuple.Create(2L, 1L), (Tuple)Tuple.Create(3L, 1L), (Tuple)Tuple.Create(4L, 1L), (Tuple)Tuple.Create(5L, 1L)}))));\n Debug.Assert(GetRow((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)1L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)1L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)1L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)1L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)1L})})), (1L)).Equals((new List>(new Tuple[]{(Tuple)Tuple.Create(0L, 0L), (Tuple)Tuple.Create(1L, 0L), (Tuple)Tuple.Create(2L, 1L), (Tuple)Tuple.Create(2L, 0L), (Tuple)Tuple.Create(3L, 2L), (Tuple)Tuple.Create(3L, 0L), (Tuple)Tuple.Create(4L, 3L), (Tuple)Tuple.Create(4L, 0L), (Tuple)Tuple.Create(5L, 4L), (Tuple)Tuple.Create(5L, 0L), (Tuple)Tuple.Create(6L, 5L), (Tuple)Tuple.Create(6L, 0L)}))));\n Debug.Assert(GetRow((new List>()), (1L)).Equals((new List>())));\n Debug.Assert(GetRow((new List>(new List[]{(List)new List(new long[]{(long)1L})})), (2L)).Equals((new List>())));\n Debug.Assert(GetRow((new List>(new List[]{(List)new List(), (List)new List(new long[]{(long)1L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L})})), (3L)).Equals((new List>(new Tuple[]{(Tuple)Tuple.Create(2L, 2L)}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You're a hungry rabbit, and you already have eaten a certain number of carrots,\n // but now you need to eat more carrots to complete the day's meals.\n // you should return a list of [ total number of eaten carrots after your meals,\n // the number of carrots left after your meals ]\n // if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n // Example:\n // >>> Eat((5L), (6L), (10L))\n // (new List(new long[]{(long)11L, (long)4L}))\n // >>> Eat((4L), (8L), (9L))\n // (new List(new long[]{(long)12L, (long)1L}))\n // >>> Eat((1L), (10L), (10L))\n // (new List(new long[]{(long)11L, (long)0L}))\n // >>> Eat((2L), (11L), (5L))\n // (new List(new long[]{(long)7L, (long)0L}))\n // Variables:\n // @number : integer\n // the number of carrots that you have eaten.\n // @need : integer\n // the number of carrots that you need to eat.\n // @remaining : integer\n // the number of remaining carrots thet exist in stock\n // Constrain:\n // * 0 <= number <= 1000\n // * 0 <= need <= 1000\n // * 0 <= remaining <= 1000\n // Have fun :)\n public static List Eat(long number, long need, long remaining) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Eat((5L), (6L), (10L)).Equals((new List(new long[]{(long)11L, (long)4L}))));\n Debug.Assert(Eat((4L), (8L), (9L)).Equals((new List(new long[]{(long)12L, (long)1L}))));\n Debug.Assert(Eat((1L), (10L), (10L)).Equals((new List(new long[]{(long)11L, (long)0L}))));\n Debug.Assert(Eat((2L), (11L), (5L)).Equals((new List(new long[]{(long)7L, (long)0L}))));\n Debug.Assert(Eat((4L), (5L), (7L)).Equals((new List(new long[]{(long)9L, (long)2L}))));\n Debug.Assert(Eat((4L), (5L), (1L)).Equals((new List(new long[]{(long)5L, (long)0L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a positive integer N, return the total sum of its digits in binary.\n // Example\n // >>> Solve((1000L))\n // (\"1\")\n // >>> Solve((150L))\n // (\"110\")\n // >>> Solve((147L))\n // (\"1100\")\n // Variables:\n // @N integer\n // Constraints: 0 \u2264 N \u2264 10000.\n // Output:\n // a string of binary number\n public static string Solve(long N) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Solve((1000L)).Equals((\"1\")));\n Debug.Assert(Solve((150L)).Equals((\"110\")));\n Debug.Assert(Solve((147L)).Equals((\"1100\")));\n Debug.Assert(Solve((333L)).Equals((\"1001\")));\n Debug.Assert(Solve((963L)).Equals((\"10010\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a list of integers.\n // You need to find the largest prime value and return the sum of its digits.\n // Examples:\n // >>> Skjkasdkd((new List(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, (long)3L})))\n // (10L)\n // >>> Skjkasdkd((new List(new long[]{(long)1L, (long)0L, (long)1L, (long)8L, (long)2L, (long)4597L, (long)2L, (long)1L, (long)3L, (long)40L, (long)1L, (long)2L, (long)1L, (long)2L, (long)4L, (long)2L, (long)5L, (long)1L})))\n // (25L)\n // >>> Skjkasdkd((new List(new long[]{(long)1L, (long)3L, (long)1L, (long)32L, (long)5107L, (long)34L, (long)83278L, (long)109L, (long)163L, (long)23L, (long)2323L, (long)32L, (long)30L, (long)1L, (long)9L, (long)3L})))\n // (13L)\n // >>> Skjkasdkd((new List(new long[]{(long)0L, (long)724L, (long)32L, (long)71L, (long)99L, (long)32L, (long)6L, (long)0L, (long)5L, (long)91L, (long)83L, (long)0L, (long)5L, (long)6L})))\n // (11L)\n // >>> Skjkasdkd((new List(new long[]{(long)0L, (long)81L, (long)12L, (long)3L, (long)1L, (long)21L})))\n // (3L)\n // >>> Skjkasdkd((new List(new long[]{(long)0L, (long)8L, (long)1L, (long)2L, (long)1L, (long)7L})))\n // (7L)\n public static long Skjkasdkd(List lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Skjkasdkd((new List(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, (long)3L}))) == (10L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)1L, (long)0L, (long)1L, (long)8L, (long)2L, (long)4597L, (long)2L, (long)1L, (long)3L, (long)40L, (long)1L, (long)2L, (long)1L, (long)2L, (long)4L, (long)2L, (long)5L, (long)1L}))) == (25L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)1L, (long)3L, (long)1L, (long)32L, (long)5107L, (long)34L, (long)83278L, (long)109L, (long)163L, (long)23L, (long)2323L, (long)32L, (long)30L, (long)1L, (long)9L, (long)3L}))) == (13L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)0L, (long)724L, (long)32L, (long)71L, (long)99L, (long)32L, (long)6L, (long)0L, (long)5L, (long)91L, (long)83L, (long)0L, (long)5L, (long)6L}))) == (11L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)0L, (long)81L, (long)12L, (long)3L, (long)1L, (long)21L}))) == (3L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)0L, (long)8L, (long)1L, (long)2L, (long)1L, (long)7L}))) == (7L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)8191L}))) == (19L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)8191L, (long)123456L, (long)127L, (long)7L}))) == (19L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)127L, (long)97L, (long)8192L}))) == (10L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a list arr of integers, find the minimum number of elements that\n // need to be changed to make the list palindromic. A palindromic list is a list that\n // is read the same backwards and forwards. In one change, you can change one element to any other element.\n // For example:\n // >>> SmallestChange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)5L, (long)4L, (long)7L, (long)9L, (long)6L})))\n // (4L)\n // >>> SmallestChange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)3L, (long)2L, (long)2L})))\n // (1L)\n // >>> SmallestChange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)2L, (long)1L})))\n // (0L)\n public static long SmallestChange(List arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SmallestChange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)5L, (long)4L, (long)7L, (long)9L, (long)6L}))) == (4L));\n Debug.Assert(SmallestChange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)3L, (long)2L, (long)2L}))) == (1L));\n Debug.Assert(SmallestChange((new List(new long[]{(long)1L, (long)4L, (long)2L}))) == (1L));\n Debug.Assert(SmallestChange((new List(new long[]{(long)1L, (long)4L, (long)4L, (long)2L}))) == (1L));\n Debug.Assert(SmallestChange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)2L, (long)1L}))) == (0L));\n Debug.Assert(SmallestChange((new List(new long[]{(long)3L, (long)1L, (long)1L, (long)3L}))) == (0L));\n Debug.Assert(SmallestChange((new List(new long[]{(long)1L}))) == (0L));\n Debug.Assert(SmallestChange((new List(new long[]{(long)0L, (long)1L}))) == (1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // It is the last week of the semester and the teacher has to give the grades\n // to students. The teacher has been making her own algorithm for grading.\n // The only problem is, she has lost the code she used for grading.\n // She has given you a list of GPAs for some students and you have to write \n // a function that can output a list of letter grades using the following table:\n // GPA | Letter grade\n // 4.0 A+\n // > 3.7 A \n // > 3.3 A- \n // > 3.0 B+\n // > 2.7 B \n // > 2.3 B-\n // > 2.0 C+\n // > 1.7 C\n // > 1.3 C-\n // > 1.0 D+ \n // > 0.7 D \n // > 0.0 D-\n // 0.0 E\n // Example:\n // >>> GradeEquation((new List(new float[]{(float)4.0f, (float)3L, (float)1.7f, (float)2L, (float)3.5f})))\n // (new List(new string[]{(string)\"A+\", (string)\"B\", (string)\"C-\", (string)\"C\", (string)\"A-\"}))\n public static List NumericalLetterGrade(List grades) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(NumericalLetterGrade((new List(new float[]{(float)4.0f, (float)3L, (float)1.7f, (float)2L, (float)3.5f}))).Equals((new List(new string[]{(string)\"A+\", (string)\"B\", (string)\"C-\", (string)\"C\", (string)\"A-\"}))));\n Debug.Assert(NumericalLetterGrade((new List(new float[]{(float)1.2f}))).Equals((new List(new string[]{(string)\"D+\"}))));\n Debug.Assert(NumericalLetterGrade((new List(new float[]{(float)0.5f}))).Equals((new List(new string[]{(string)\"D-\"}))));\n Debug.Assert(NumericalLetterGrade((new List(new float[]{(float)0.0f}))).Equals((new List(new string[]{(string)\"E\"}))));\n Debug.Assert(NumericalLetterGrade((new List(new float[]{(float)1.0f, (float)0.3f, (float)1.5f, (float)2.8f, (float)3.3f}))).Equals((new List(new string[]{(string)\"D\", (string)\"D-\", (string)\"C-\", (string)\"B\", (string)\"B+\"}))));\n Debug.Assert(NumericalLetterGrade((new List(new float[]{(float)0.0f, (float)0.7f}))).Equals((new List(new string[]{(string)\"E\", (string)\"D-\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given the lengths of the three sides of a triangle. Return the area of\n // the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n // Otherwise return -1\n // Three sides make a valid triangle when the sum of any two sides is greater \n // than the third side.\n // Example:\n // >>> TriangleArea((3L), (4L), (5L))\n // (6.0f)\n // >>> TriangleArea((1L), (2L), (10L))\n // (float)-1L\n public static float TriangleArea(long a, long b, long c) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(TriangleArea((3L), (4L), (5L)) == (6.0f));\n Debug.Assert(TriangleArea((1L), (2L), (10L)) == (float)-1L);\n Debug.Assert(TriangleArea((4L), (8L), (5L)) == (8.18f));\n Debug.Assert(TriangleArea((2L), (2L), (2L)) == (1.73f));\n Debug.Assert(TriangleArea((1L), (2L), (3L)) == (float)-1L);\n Debug.Assert(TriangleArea((10L), (5L), (7L)) == (16.25f));\n Debug.Assert(TriangleArea((2L), (6L), (3L)) == (float)-1L);\n Debug.Assert(TriangleArea((1L), (1L), (1L)) == (0.43f));\n Debug.Assert(TriangleArea((2L), (2L), (10L)) == (float)-1L);\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Check if two words have the same characters.\n // >>> SameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddeddabc\"))\n // (true)\n // >>> SameChars((\"abcd\"), (\"dddddddabc\"))\n // (true)\n // >>> SameChars((\"dddddddabc\"), (\"abcd\"))\n // (true)\n // >>> SameChars((\"eabcd\"), (\"dddddddabc\"))\n // (false)\n // >>> SameChars((\"abcd\"), (\"dddddddabce\"))\n // (false)\n // >>> SameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddddabc\"))\n // (false)\n public static bool SameChars(string s0, string s1) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddeddabc\")) == (true));\n Debug.Assert(SameChars((\"abcd\"), (\"dddddddabc\")) == (true));\n Debug.Assert(SameChars((\"dddddddabc\"), (\"abcd\")) == (true));\n Debug.Assert(SameChars((\"eabcd\"), (\"dddddddabc\")) == (false));\n Debug.Assert(SameChars((\"abcd\"), (\"dddddddabcf\")) == (false));\n Debug.Assert(SameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddddabc\")) == (false));\n Debug.Assert(SameChars((\"aabb\"), (\"aaccc\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a list of integers nums, find the minimum sum of any non-empty sub-list\n // of nums.\n // Example\n // >>> Minsubarraysum((new List(new long[]{(long)2L, (long)3L, (long)4L, (long)1L, (long)2L, (long)4L})))\n // (1L)\n // >>> Minsubarraysum((new List(new long[]{(long)-1L, (long)-2L, (long)-3L})))\n // (-6L)\n public static long Minsubarraysum(List nums) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)2L, (long)3L, (long)4L, (long)1L, (long)2L, (long)4L}))) == (1L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)-1L, (long)-2L, (long)-3L}))) == (-6L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)-1L, (long)-2L, (long)-3L, (long)2L, (long)-10L}))) == (-14L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)-9999999999999999L}))) == (-9999999999999999L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)0L, (long)10L, (long)20L, (long)1000000L}))) == (0L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)-1L, (long)-2L, (long)-3L, (long)10L, (long)-5L}))) == (-6L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)100L, (long)-1L, (long)-2L, (long)-3L, (long)10L, (long)-5L}))) == (-6L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)10L, (long)11L, (long)13L, (long)8L, (long)3L, (long)4L}))) == (3L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)100L, (long)-33L, (long)32L, (long)-1L, (long)0L, (long)-2L}))) == (-33L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)-10L}))) == (-10L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)7L}))) == (7L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)1L, (long)-1L}))) == (-1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a string s and a natural number n, you have been tasked to implement \n // a function that returns a list of all words from string s that contain exactly \n // n consonants, in order these words appear in the string s.\n // If the string s is empty then the function should return an empty list.\n // Note: you may assume the input string contains only letters and spaces.\n // Examples:\n // >>> SelectWords((\"Mary had a little lamb\"), (4L))\n // (new List(new string[]{(string)\"little\"}))\n // >>> SelectWords((\"Mary had a little lamb\"), (3L))\n // (new List(new string[]{(string)\"Mary\", (string)\"lamb\"}))\n // >>> SelectWords((\"simple white space\"), (2L))\n // (new List())\n // >>> SelectWords((\"Hello world\"), (4L))\n // (new List(new string[]{(string)\"world\"}))\n // >>> SelectWords((\"Uncle sam\"), (3L))\n // (new List(new string[]{(string)\"Uncle\"}))\n public static List SelectWords(string s, long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SelectWords((\"Mary had a little lamb\"), (4L)).Equals((new List(new string[]{(string)\"little\"}))));\n Debug.Assert(SelectWords((\"Mary had a little lamb\"), (3L)).Equals((new List(new string[]{(string)\"Mary\", (string)\"lamb\"}))));\n Debug.Assert(SelectWords((\"simple white space\"), (2L)).Equals((new List())));\n Debug.Assert(SelectWords((\"Hello world\"), (4L)).Equals((new List(new string[]{(string)\"world\"}))));\n Debug.Assert(SelectWords((\"Uncle sam\"), (3L)).Equals((new List(new string[]{(string)\"Uncle\"}))));\n Debug.Assert(SelectWords((\"\"), (4L)).Equals((new List())));\n Debug.Assert(SelectWords((\"a b c d e f\"), (1L)).Equals((new List(new string[]{(string)\"b\", (string)\"c\", (string)\"d\", (string)\"f\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return list of all prefixes from shortest to longest of the input string\n // >>> AllPrefixes((\"abc\"))\n // (new List(new string[]{(string)\"a\", (string)\"ab\", (string)\"abc\"}))\n public static List AllPrefixes(string str) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(AllPrefixes((\"\")).Equals((new List())));\n Debug.Assert(AllPrefixes((\"asdfgh\")).Equals((new List(new string[]{(string)\"a\", (string)\"as\", (string)\"asd\", (string)\"asdf\", (string)\"asdfg\", (string)\"asdfgh\"}))));\n Debug.Assert(AllPrefixes((\"WWW\")).Equals((new List(new string[]{(string)\"W\", (string)\"WW\", (string)\"WWW\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function that takes a value (string) representing a number\n // and returns the closest integer to it. If the number is equidistant\n // from two integers, round it away from zero.\n // Examples\n // >>> ClosestInteger((\"10\"))\n // (10L)\n // >>> ClosestInteger((\"15.3\"))\n // (15L)\n // Note:\n // Rounding away from zero means that if the given number is equidistant\n // from two integers, the one you should return is the one that is the\n // farthest from zero. For example closest_integer(\"14.5\") should\n // return 15 and closest_integer(\"-14.5\") should return -15.\n public static long ClosestInteger(string value) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ClosestInteger((\"10\")) == (10L));\n Debug.Assert(ClosestInteger((\"14.5\")) == (15L));\n Debug.Assert(ClosestInteger((\"-15.5\")) == (-16L));\n Debug.Assert(ClosestInteger((\"15.3\")) == (15L));\n Debug.Assert(ClosestInteger((\"0\")) == (0L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function which takes a string representing a file's name, and returns\n // 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n // A file's name is considered to be valid if and only if all the following conditions \n // are met:\n // - There should not be more than three digits ('0'-'9') in the file's name.\n // - The file's name contains exactly one dot '.'\n // - The substring before the dot should not be empty, and it starts with a letter from \n // the latin alphapet ('a'-'z' and 'A'-'Z').\n // - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n // Examples:\n // >>> FileNameCheck((\"example.txt\"))\n // (\"Yes\")\n // >>> FileNameCheck((\"1example.dll\"))\n // (\"No\")\n public static string FileNameCheck(string file_name) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FileNameCheck((\"example.txt\")).Equals((\"Yes\")));\n Debug.Assert(FileNameCheck((\"1example.dll\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"s1sdf3.asd\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"K.dll\")).Equals((\"Yes\")));\n Debug.Assert(FileNameCheck((\"MY16FILE3.exe\")).Equals((\"Yes\")));\n Debug.Assert(FileNameCheck((\"His12FILE94.exe\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"_Y.txt\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"?aREYA.exe\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"/this_is_valid.dll\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"this_is_valid.wow\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"this_is_valid.txt\")).Equals((\"Yes\")));\n Debug.Assert(FileNameCheck((\"this_is_valid.txtexe\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"#this2_i4s_5valid.ten\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"@this1_is6_valid.exe\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"this_is_12valid.6exe4.txt\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"all.exe.txt\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"I563_No.exe\")).Equals((\"Yes\")));\n Debug.Assert(FileNameCheck((\"Is3youfault.txt\")).Equals((\"Yes\")));\n Debug.Assert(FileNameCheck((\"no_one#knows.dll\")).Equals((\"Yes\")));\n Debug.Assert(FileNameCheck((\"1I563_Yes3.exe\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"I563_Yes3.txtt\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"final..txt\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"final132\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"_f4indsartal132.\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\".txt\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"s.\")).Equals((\"No\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given two intervals,\n // where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n // The given intervals are closed which means that the interval (start, end)\n // includes both start and end.\n // For each given interval, it is assumed that its start is less or equal its end.\n // Your task is to determine whether the length of intersection of these two \n // intervals is a prime number.\n // Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n // which its length is 1, which not a prime number.\n // If the length of the intersection is a prime number, return \"YES\",\n // otherwise, return \"NO\".\n // If the two intervals don't intersect, return \"NO\".\n // [input/output] samples:\n // >>> Intersection((Tuple.Create(1L, 2L)), (Tuple.Create(2L, 3L)))\n // (\"NO\")\n // >>> Intersection((Tuple.Create(-1L, 1L)), (Tuple.Create(0L, 4L)))\n // (\"NO\")\n // >>> Intersection((Tuple.Create(-3L, -1L)), (Tuple.Create(-5L, 5L)))\n // (\"YES\")\n public static string Intersection(Tuple interval1, Tuple interval2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Intersection((Tuple.Create(1L, 2L)), (Tuple.Create(2L, 3L))).Equals((\"NO\")));\n Debug.Assert(Intersection((Tuple.Create(-1L, 1L)), (Tuple.Create(0L, 4L))).Equals((\"NO\")));\n Debug.Assert(Intersection((Tuple.Create(-3L, -1L)), (Tuple.Create(-5L, 5L))).Equals((\"YES\")));\n Debug.Assert(Intersection((Tuple.Create(-2L, 2L)), (Tuple.Create(-4L, 0L))).Equals((\"YES\")));\n Debug.Assert(Intersection((Tuple.Create(-11L, 2L)), (Tuple.Create(-1L, -1L))).Equals((\"NO\")));\n Debug.Assert(Intersection((Tuple.Create(1L, 2L)), (Tuple.Create(3L, 5L))).Equals((\"NO\")));\n Debug.Assert(Intersection((Tuple.Create(1L, 2L)), (Tuple.Create(1L, 2L))).Equals((\"NO\")));\n Debug.Assert(Intersection((Tuple.Create(-2L, -2L)), (Tuple.Create(-3L, -2L))).Equals((\"NO\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return the largest prime factor of n. Assume n > 1 and is not a prime.\n // >>> LargestPrimeFactor((13195L))\n // (29L)\n // >>> LargestPrimeFactor((2048L))\n // (2L)\n public static long LargestPrimeFactor(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(LargestPrimeFactor((15L)) == (5L));\n Debug.Assert(LargestPrimeFactor((27L)) == (3L));\n Debug.Assert(LargestPrimeFactor((63L)) == (7L));\n Debug.Assert(LargestPrimeFactor((330L)) == (11L));\n Debug.Assert(LargestPrimeFactor((13195L)) == (29L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a string, find out how many distinct characters (regardless of case) does it consist of\n // >>> CountDistinctCharacters((\"xyzXYZ\"))\n // (3L)\n // >>> CountDistinctCharacters((\"Jerry\"))\n // (4L)\n public static long CountDistinctCharacters(string str) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CountDistinctCharacters((\"\")) == (0L));\n Debug.Assert(CountDistinctCharacters((\"abcde\")) == (5L));\n Debug.Assert(CountDistinctCharacters((\"abcdecadeCADE\")) == (5L));\n Debug.Assert(CountDistinctCharacters((\"aaaaAAAAaaaa\")) == (1L));\n Debug.Assert(CountDistinctCharacters((\"Jerry jERRY JeRRRY\")) == (5L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You're given a list of deposit and withdrawal operations on a bank account that starts with\n // zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n // at that point function should return true. Otherwise it should return false.\n // >>> BelowZero((new List(new long[]{(long)1L, (long)2L, (long)3L})))\n // (false)\n // >>> BelowZero((new List(new long[]{(long)1L, (long)2L, (long)-4L, (long)5L})))\n // (true)\n public static bool BelowZero(List operations) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(BelowZero((new List())) == (false));\n Debug.Assert(BelowZero((new List(new long[]{(long)1L, (long)2L, (long)-3L, (long)1L, (long)2L, (long)-3L}))) == (false));\n Debug.Assert(BelowZero((new List(new long[]{(long)1L, (long)2L, (long)-4L, (long)5L, (long)6L}))) == (true));\n Debug.Assert(BelowZero((new List(new long[]{(long)1L, (long)-1L, (long)2L, (long)-2L, (long)5L, (long)-5L, (long)4L, (long)-4L}))) == (false));\n Debug.Assert(BelowZero((new List(new long[]{(long)1L, (long)-1L, (long)2L, (long)-2L, (long)5L, (long)-5L, (long)4L, (long)-5L}))) == (true));\n Debug.Assert(BelowZero((new List(new long[]{(long)1L, (long)-2L, (long)2L, (long)-2L, (long)5L, (long)-5L, (long)4L, (long)-4L}))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Find the shortest palindrome that begins with a supplied string.\n // Algorithm idea is simple:\n // - Find the longest postfix of supplied string that is a palindrome.\n // - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n // >>> MakePalindrome((\"\"))\n // (\"\")\n // >>> MakePalindrome((\"cat\"))\n // (\"catac\")\n // >>> MakePalindrome((\"cata\"))\n // (\"catac\")\n public static string MakePalindrome(string str) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(MakePalindrome((\"\")).Equals((\"\")));\n Debug.Assert(MakePalindrome((\"x\")).Equals((\"x\")));\n Debug.Assert(MakePalindrome((\"xyz\")).Equals((\"xyzyx\")));\n Debug.Assert(MakePalindrome((\"xyx\")).Equals((\"xyx\")));\n Debug.Assert(MakePalindrome((\"jerry\")).Equals((\"jerryrrej\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a positive integer, obtain its roman numeral equivalent as a string,\n // and return it in lowercase.\n // Restrictions: 1 <= num <= 1000\n // Examples:\n // >>> IntToMiniRoman((19L))\n // (\"xix\")\n // >>> IntToMiniRoman((152L))\n // (\"clii\")\n // >>> IntToMiniRoman((426L))\n // (\"cdxxvi\")\n public static string IntToMiniRoman(long number) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IntToMiniRoman((19L)).Equals((\"xix\")));\n Debug.Assert(IntToMiniRoman((152L)).Equals((\"clii\")));\n Debug.Assert(IntToMiniRoman((251L)).Equals((\"ccli\")));\n Debug.Assert(IntToMiniRoman((426L)).Equals((\"cdxxvi\")));\n Debug.Assert(IntToMiniRoman((500L)).Equals((\"d\")));\n Debug.Assert(IntToMiniRoman((1L)).Equals((\"i\")));\n Debug.Assert(IntToMiniRoman((4L)).Equals((\"iv\")));\n Debug.Assert(IntToMiniRoman((43L)).Equals((\"xliii\")));\n Debug.Assert(IntToMiniRoman((90L)).Equals((\"xc\")));\n Debug.Assert(IntToMiniRoman((94L)).Equals((\"xciv\")));\n Debug.Assert(IntToMiniRoman((532L)).Equals((\"dxxxii\")));\n Debug.Assert(IntToMiniRoman((900L)).Equals((\"cm\")));\n Debug.Assert(IntToMiniRoman((994L)).Equals((\"cmxciv\")));\n Debug.Assert(IntToMiniRoman((1000L)).Equals((\"m\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - } -] \ No newline at end of file diff --git a/data/cs-transform.json b/data/cs-transform.json deleted file mode 100644 index 11dbb53aefcffe498346bdb477ecf8edb35e1226..0000000000000000000000000000000000000000 --- a/data/cs-transform.json +++ /dev/null @@ -1,1898 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // For a given number n, find the largest number that divides n evenly, smaller than n\n // >>> LargestDivisor((15L))\n // (5L)\n public static long LargestDivisor(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(LargestDivisor((3L)) == (1L));\n Debug.Assert(LargestDivisor((7L)) == (1L));\n Debug.Assert(LargestDivisor((10L)) == (5L));\n Debug.Assert(LargestDivisor((100L)) == (50L));\n Debug.Assert(LargestDivisor((49L)) == (7L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_47_median", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return median of elements in the list l.\n // >>> Median((new List(new long[]{(long)3L, (long)1L, (long)2L, (long)4L, (long)5L})))\n // (float)3L\n // >>> Median((new List(new long[]{(long)-10L, (long)4L, (long)6L, (long)1000L, (long)10L, (long)20L})))\n // (15.0f)\n public static float Median(List l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Median((new List(new long[]{(long)3L, (long)1L, (long)2L, (long)4L, (long)5L}))) == (float)3L);\n Debug.Assert(Median((new List(new long[]{(long)-10L, (long)4L, (long)6L, (long)1000L, (long)10L, (long)20L}))) == (8.0f));\n Debug.Assert(Median((new List(new long[]{(long)5L}))) == (float)5L);\n Debug.Assert(Median((new List(new long[]{(long)6L, (long)5L}))) == (5.5f));\n Debug.Assert(Median((new List(new long[]{(long)8L, (long)1L, (long)3L, (long)9L, (long)9L, (long)2L, (long)7L}))) == (float)7L);\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given two lists operator, and operand. The first list has basic algebra operations, and \n // the second list is a list of integers. Use the two given lists to build the algebric \n // expression and return the evaluation of this expression.\n // The basic algebra operations:\n // Addition ( + ) \n // Subtraction ( - ) \n // Multiplication ( * ) \n // Floor division ( // ) \n // Exponentiation ( ** ) \n // Example:\n // operator['+', '*', '-']\n // array = [2, 3, 4, 5]\n // result = 2 + 3 * 4 - 5\n // => result = 9\n // Note:\n // The length of operator list is equal to the length of operand list minus one.\n // Operand is a list of of non-negative integers.\n // Operator list has at least one operator, and operand list has at least two operands.\n public static long DoAlgebra(List op, List operand) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(DoAlgebra((new List(new string[]{(string)\"**\", (string)\"*\", (string)\"+\"})), (new List(new long[]{(long)2L, (long)3L, (long)4L, (long)5L}))) == (37L));\n Debug.Assert(DoAlgebra((new List(new string[]{(string)\"+\", (string)\"*\", (string)\"-\"})), (new List(new long[]{(long)2L, (long)3L, (long)4L, (long)5L}))) == (9L));\n Debug.Assert(DoAlgebra((new List(new string[]{(string)\"//\", (string)\"*\"})), (new List(new long[]{(long)7L, (long)3L, (long)4L}))) == (8L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return maximum element in the list.\n // >>> MaxElement((new List(new long[]{(long)1L, (long)2L, (long)3L})))\n // (3L)\n // >>> MaxElement((new List(new long[]{(long)5L, (long)3L, (long)-5L, (long)2L, (long)-3L, (long)3L, (long)9L, (long)0L, (long)123L, (long)1L, (long)-10L})))\n // (123L)\n public static long MaxElement(List l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(MaxElement((new List(new long[]{(long)1L, (long)2L, (long)3L}))) == (3L));\n Debug.Assert(MaxElement((new List(new long[]{(long)5L, (long)3L, (long)-5L, (long)2L, (long)-3L, (long)3L, (long)9L, (long)0L, (long)124L, (long)1L, (long)-10L}))) == (124L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function which returns the largest index of an element which\n // is not greater than or equal to the element immediately preceding it. If\n // no such element exists then return -1. The given array will not contain\n // duplicate values.\n // Examples:\n // >>> CanArrange((new List(new long[]{(long)1L, (long)2L, (long)4L, (long)3L, (long)5L})))\n // (3L)\n // >>> CanArrange((new List(new long[]{(long)1L, (long)2L, (long)3L})))\n // (-1L)\n public static long CanArrange(List arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CanArrange((new List(new long[]{(long)1L, (long)2L, (long)4L, (long)3L, (long)5L}))) == (3L));\n Debug.Assert(CanArrange((new List(new long[]{(long)1L, (long)2L, (long)4L, (long)5L}))) == (-1L));\n Debug.Assert(CanArrange((new List(new long[]{(long)1L, (long)4L, (long)2L, (long)5L, (long)6L, (long)7L, (long)8L, (long)9L, (long)10L}))) == (2L));\n Debug.Assert(CanArrange((new List(new long[]{(long)4L, (long)8L, (long)5L, (long)7L, (long)3L}))) == (4L));\n Debug.Assert(CanArrange((new List())) == (-1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Imagine a road that's a perfectly straight infinitely long line.\n // n cars are driving left to right; simultaneously, a different set of n cars\n // are driving right to left. The two sets of cars start out being very far from\n // each other. All cars move in the same speed. Two cars are said to collide\n // when a car that's moving left to right hits a car that's moving right to left.\n // However, the cars are infinitely sturdy and strong; as a result, they continue moving\n // in their trajectory as if they did not collide.\n // This function outputs the number of such collisions.\n public static long CarRaceCollision(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CarRaceCollision((2L)) == (4L));\n Debug.Assert(CarRaceCollision((3L)) == (9L));\n Debug.Assert(CarRaceCollision((4L)) == (16L));\n Debug.Assert(CarRaceCollision((8L)) == (64L));\n Debug.Assert(CarRaceCollision((10L)) == (100L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function that returns True if the last character\n // of a given string is an alphabetical character and is not\n // a part of a word, and False otherwise.\n // Note: \"word\" is a group of characters separated by space.\n // Examples:\n // >>> CheckIfLastCharIsALetter((\"apple pie\"))\n // (false)\n // >>> CheckIfLastCharIsALetter((\"apple pi e\"))\n // (true)\n // >>> CheckIfLastCharIsALetter((\"apple pi e \"))\n // (false)\n // >>> CheckIfLastCharIsALetter((\"\"))\n // (false)\n public static bool CheckIfLastCharIsALetter(string txt) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CheckIfLastCharIsALetter((\"apple\")) == (false));\n Debug.Assert(CheckIfLastCharIsALetter((\"apple pi e\")) == (true));\n Debug.Assert(CheckIfLastCharIsALetter((\"eeeee\")) == (false));\n Debug.Assert(CheckIfLastCharIsALetter((\"A\")) == (true));\n Debug.Assert(CheckIfLastCharIsALetter((\"Pumpkin pie \")) == (false));\n Debug.Assert(CheckIfLastCharIsALetter((\"Pumpkin pie 1\")) == (false));\n Debug.Assert(CheckIfLastCharIsALetter((\"\")) == (false));\n Debug.Assert(CheckIfLastCharIsALetter((\"eeeee e \")) == (false));\n Debug.Assert(CheckIfLastCharIsALetter((\"apple pie\")) == (false));\n Debug.Assert(CheckIfLastCharIsALetter((\"apple pi e \")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return true if a given number is prime, and false otherwise.\n // >>> IsPrime((6L))\n // (false)\n // >>> IsPrime((101L))\n // (true)\n // >>> IsPrime((11L))\n // (true)\n // >>> IsPrime((13441L))\n // (true)\n // >>> IsPrime((61L))\n // (true)\n // >>> IsPrime((4L))\n // (false)\n // >>> IsPrime((1L))\n // (false)\n public static bool IsPrime(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsPrime((6L)) == (false));\n Debug.Assert(IsPrime((101L)) == (true));\n Debug.Assert(IsPrime((11L)) == (true));\n Debug.Assert(IsPrime((13441L)) == (true));\n Debug.Assert(IsPrime((61L)) == (true));\n Debug.Assert(IsPrime((4L)) == (false));\n Debug.Assert(IsPrime((1L)) == (false));\n Debug.Assert(IsPrime((5L)) == (true));\n Debug.Assert(IsPrime((11L)) == (true));\n Debug.Assert(IsPrime((17L)) == (true));\n Debug.Assert(IsPrime((85L)) == (false));\n Debug.Assert(IsPrime((77L)) == (false));\n Debug.Assert(IsPrime((255379L)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a list of positive integers x. return a sorted list of all \n // elements that hasn't any even digit.\n // Note: Returned list should be sorted in increasing order.\n // For example:\n // >>> UniqueDigits((new List(new long[]{(long)15L, (long)33L, (long)1422L, (long)1L})))\n // (new List(new long[]{(long)1L, (long)15L, (long)33L}))\n // >>> UniqueDigits((new List(new long[]{(long)152L, (long)323L, (long)1422L, (long)10L})))\n // (new List())\n public static List UniqueDigits(List x) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(UniqueDigits((new List(new long[]{(long)15L, (long)33L, (long)1422L, (long)1L}))).Equals((new List(new long[]{(long)1L, (long)15L, (long)33L}))));\n Debug.Assert(UniqueDigits((new List(new long[]{(long)152L, (long)323L, (long)1422L, (long)10L}))).Equals((new List())));\n Debug.Assert(UniqueDigits((new List(new long[]{(long)12345L, (long)2033L, (long)111L, (long)151L}))).Equals((new List(new long[]{(long)111L, (long)151L}))));\n Debug.Assert(UniqueDigits((new List(new long[]{(long)135L, (long)103L, (long)31L}))).Equals((new List(new long[]{(long)31L, (long)135L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Input are two strings a and b consisting only of 1s and 0s.\n // Perform binary XOR on these inputs and return result also as a string.\n // >>> StringXor((\"010\"), (\"110\"))\n // (\"100\")\n public static string StringXor(string a, string b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(StringXor((\"111000\"), (\"101010\")).Equals((\"010010\")));\n Debug.Assert(StringXor((\"1\"), (\"1\")).Equals((\"0\")));\n Debug.Assert(StringXor((\"0101\"), (\"0000\")).Equals((\"0101\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // sum_to_n is a function that sums numbers from 1 to n.\n // >>> SumToN((30L))\n // (465L)\n // >>> SumToN((100L))\n // (5050L)\n // >>> SumToN((5L))\n // (15L)\n // >>> SumToN((10L))\n // (55L)\n // >>> SumToN((1L))\n // (1L)\n public static long SumToN(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SumToN((1L)) == (1L));\n Debug.Assert(SumToN((6L)) == (21L));\n Debug.Assert(SumToN((11L)) == (66L));\n Debug.Assert(SumToN((30L)) == (465L));\n Debug.Assert(SumToN((100L)) == (5050L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a list of numbers, return the sum of squares of the numbers\n // in the list that are odd. Ignore numbers that are negative or not integers.\n // >>> DoubleTheDifference((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)0L})))\n // (10L)\n // >>> DoubleTheDifference((new List(new long[]{(long)-1L, (long)-2L, (long)0L})))\n // (0L)\n // >>> DoubleTheDifference((new List(new long[]{(long)9L, (long)-2L})))\n // (81L)\n // >>> DoubleTheDifference((new List(new long[]{(long)0L})))\n // (0L)\n // If the input list is empty, return 0.\n public static long DoubleTheDifference(List lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(DoubleTheDifference((new List())) == (0L));\n Debug.Assert(DoubleTheDifference((new List(new float[]{(float)5.0f, (float)4.0f}))) == (25L));\n Debug.Assert(DoubleTheDifference((new List(new float[]{(float)0.1f, (float)0.2f, (float)0.3f}))) == (0L));\n Debug.Assert(DoubleTheDifference((new List(new float[]{(float)-10.0f, (float)-20.0f, (float)-30.0f}))) == (0L));\n Debug.Assert(DoubleTheDifference((new List(new float[]{(float)-1.0f, (float)-2.0f, (float)8.0f}))) == (0L));\n Debug.Assert(DoubleTheDifference((new List(new float[]{(float)0.2f, (float)3.0f, (float)5.0f}))) == (34L));\n Debug.Assert(DoubleTheDifference((new List(new float[]{(float)-9.0f, (float)-7.0f, (float)-5.0f, (float)-3.0f, (float)-1.0f, (float)1.0f, (float)3.0f, (float)5.0f, (float)7.0f, (float)9.0f}))) == (165L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return length of given string\n // >>> StringLength((\"\"))\n // (0L)\n // >>> StringLength((\"abc\"))\n // (3L)\n public static long Strlen(string str) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Strlen((\"\")) == (0L));\n Debug.Assert(Strlen((\"x\")) == (1L));\n Debug.Assert(Strlen((\"asdasnakj\")) == (9L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You'll be given a string of words, and your task is to count the number\n // of boredoms. A boredom is a sentence that starts with the word \"I\".\n // Sentences are delimited by '.', '?' or '!'.\n // For example:\n // >>> IsBored((\"Hello world\"))\n // (0L)\n // >>> IsBored((\"The sky is blue. The sun is shining. I love this weather\"))\n // (1L)\n public static long IsBored(string S) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsBored((\"Hello world\")) == (0L));\n Debug.Assert(IsBored((\"Is the sky blue?\")) == (0L));\n Debug.Assert(IsBored((\"I love It !\")) == (1L));\n Debug.Assert(IsBored((\"bIt\")) == (0L));\n Debug.Assert(IsBored((\"I feel good today. I will be productive. will kill It\")) == (2L));\n Debug.Assert(IsBored((\"You and I are going for a walk\")) == (0L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function vowels_count which takes a string representing\n // a word as input and returns the number of vowels in the string.\n // Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n // vowel, but only when it is at the end of the given word.\n // Example:\n // >>> VowelsCount((\"abcde\"))\n // (2L)\n // >>> VowelsCount((\"ACEDY\"))\n // (3L)\n public static long VowelsCount(string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(VowelsCount((\"abcde\")) == (2L));\n Debug.Assert(VowelsCount((\"Alone\")) == (3L));\n Debug.Assert(VowelsCount((\"key\")) == (2L));\n Debug.Assert(VowelsCount((\"bye\")) == (1L));\n Debug.Assert(VowelsCount((\"keY\")) == (2L));\n Debug.Assert(VowelsCount((\"bYe\")) == (1L));\n Debug.Assert(VowelsCount((\"ACEDY\")) == (3L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return n-th Fibonacci number.\n // >>> Fib((10L))\n // (55L)\n // >>> Fib((1L))\n // (1L)\n // >>> Fib((8L))\n // (21L)\n public static long Fib(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Fib((10L)) == (55L));\n Debug.Assert(Fib((1L)) == (1L));\n Debug.Assert(Fib((8L)) == (21L));\n Debug.Assert(Fib((11L)) == (89L));\n Debug.Assert(Fib((12L)) == (144L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Your task is to implement a function that will simplify the expression\n // x * n. The function returns True if x * n evaluates to a whole number and False\n // otherwise. Both x and n, are string representation of a fraction, and have the following format,\n // / where both numerator and denominator are positive whole numbers.\n // You can assume that x, and n are valid fractions, and do not have zero as denominator.\n // >>> Simplify((\"1/5\"), (\"5/1\"))\n // (true)\n // >>> Simplify((\"1/6\"), (\"2/1\"))\n // (false)\n // >>> Simplify((\"7/10\"), (\"10/2\"))\n // (false)\n public static bool Simplify(string x, string n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Simplify((\"1/5\"), (\"5/1\")) == (true));\n Debug.Assert(Simplify((\"1/6\"), (\"2/1\")) == (false));\n Debug.Assert(Simplify((\"5/1\"), (\"3/1\")) == (true));\n Debug.Assert(Simplify((\"7/10\"), (\"10/2\")) == (false));\n Debug.Assert(Simplify((\"2/10\"), (\"50/10\")) == (true));\n Debug.Assert(Simplify((\"7/2\"), (\"4/2\")) == (true));\n Debug.Assert(Simplify((\"11/6\"), (\"6/1\")) == (true));\n Debug.Assert(Simplify((\"2/3\"), (\"5/2\")) == (false));\n Debug.Assert(Simplify((\"5/2\"), (\"3/5\")) == (false));\n Debug.Assert(Simplify((\"2/4\"), (\"8/4\")) == (true));\n Debug.Assert(Simplify((\"2/4\"), (\"4/2\")) == (true));\n Debug.Assert(Simplify((\"1/5\"), (\"5/1\")) == (true));\n Debug.Assert(Simplify((\"1/5\"), (\"1/5\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a string s, count the number of uppercase vowels in even indices.\n // For example:\n // >>> CountUpper((\"aBCdEf\"))\n // (1L)\n // >>> CountUpper((\"abcdefg\"))\n // (0L)\n // >>> CountUpper((\"dBBE\"))\n // (0L)\n public static long CountUpper(string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CountUpper((\"aBCdEf\")) == (1L));\n Debug.Assert(CountUpper((\"abcdefg\")) == (0L));\n Debug.Assert(CountUpper((\"dBBE\")) == (0L));\n Debug.Assert(CountUpper((\"B\")) == (0L));\n Debug.Assert(CountUpper((\"U\")) == (1L));\n Debug.Assert(CountUpper((\"\")) == (0L));\n Debug.Assert(CountUpper((\"EEEE\")) == (2L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a rectangular grid of wells. Each row represents a single well,\n // and each 1 in a row represents a single unit of water.\n // Each well has a corresponding bucket that can be used to extract water from it, \n // and all buckets have the same capacity.\n // Your task is to use the buckets to empty the wells.\n // Output the number of times you need to lower the buckets.\n // Example 1:\n // >>> MaxFill((new List>(new List[]{(List)new List(new long[]{(long)0L, (long)0L, (long)1L, (long)0L}), (List)new List(new long[]{(long)0L, (long)1L, (long)0L, (long)0L}), (List)new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L})})), (1L))\n // (6L)\n // Example 2:\n // >>> MaxFill((new List>(new List[]{(List)new List(new long[]{(long)0L, (long)0L, (long)1L, (long)1L}), (List)new List(new long[]{(long)0L, (long)0L, (long)0L, (long)0L}), (List)new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L}), (List)new List(new long[]{(long)0L, (long)1L, (long)1L, (long)1L})})), (2L))\n // (5L)\n // Example 3:\n // >>> MaxFill((new List>(new List[]{(List)new List(new long[]{(long)0L, (long)0L, (long)0L}), (List)new List(new long[]{(long)0L, (long)0L, (long)0L})})), (5L))\n // (0L)\n // Constraints:\n // * all wells have the same length\n // * 1 <= grid.length <= 10^2\n // * 1 <= grid[:,1].length <= 10^2\n // * grid[i][j] -> 0 | 1\n // * 1 <= capacity <= 10\n public static long MaxFill(List> grid, long capacity) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(MaxFill((new List>(new List[]{(List)new List(new long[]{(long)0L, (long)0L, (long)1L, (long)0L}), (List)new List(new long[]{(long)0L, (long)1L, (long)0L, (long)0L}), (List)new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L})})), (1L)) == (6L));\n Debug.Assert(MaxFill((new List>(new List[]{(List)new List(new long[]{(long)0L, (long)0L, (long)1L, (long)1L}), (List)new List(new long[]{(long)0L, (long)0L, (long)0L, (long)0L}), (List)new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L}), (List)new List(new long[]{(long)0L, (long)1L, (long)1L, (long)1L})})), (2L)) == (5L));\n Debug.Assert(MaxFill((new List>(new List[]{(List)new List(new long[]{(long)0L, (long)0L, (long)0L}), (List)new List(new long[]{(long)0L, (long)0L, (long)0L})})), (5L)) == (0L));\n Debug.Assert(MaxFill((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L}), (List)new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L})})), (2L)) == (4L));\n Debug.Assert(MaxFill((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L}), (List)new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L})})), (9L)) == (2L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given an array arr of integers and a positive integer k, return a sorted list \n // of length k with the maximum k numbers in arr.\n // Example 1:\n // >>> Maximum((new List(new long[]{(long)-3L, (long)-4L, (long)5L})), (3L))\n // (new List(new long[]{(long)-4L, (long)-3L, (long)5L}))\n // Example 2:\n // >>> Maximum((new List(new long[]{(long)4L, (long)-4L, (long)4L})), (2L))\n // (new List(new long[]{(long)4L, (long)4L}))\n // Example 3:\n // >>> Maximum((new List(new long[]{(long)-3L, (long)2L, (long)1L, (long)2L, (long)-1L, (long)-2L, (long)1L})), (1L))\n // (new List(new long[]{(long)2L}))\n // Note:\n // 1. The length of the array will be in the range of [1, 1000].\n // 2. The elements in the array will be in the range of [-1000, 1000].\n // 3. 0 <= k <= len(arr)\n public static List Maximum(List arr, long k) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Maximum((new List(new long[]{(long)-3L, (long)-4L, (long)5L})), (3L)).Equals((new List(new long[]{(long)-4L, (long)-3L, (long)5L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)4L, (long)-4L, (long)4L})), (2L)).Equals((new List(new long[]{(long)4L, (long)4L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)-3L, (long)2L, (long)1L, (long)2L, (long)-1L, (long)-2L, (long)1L})), (1L)).Equals((new List(new long[]{(long)2L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)123L, (long)-123L, (long)20L, (long)0L, (long)1L, (long)2L, (long)-3L})), (3L)).Equals((new List(new long[]{(long)2L, (long)20L, (long)123L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)-123L, (long)20L, (long)0L, (long)1L, (long)2L, (long)-3L})), (4L)).Equals((new List(new long[]{(long)0L, (long)1L, (long)2L, (long)20L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)5L, (long)15L, (long)0L, (long)3L, (long)-13L, (long)-8L, (long)0L})), (7L)).Equals((new List(new long[]{(long)-13L, (long)-8L, (long)0L, (long)0L, (long)3L, (long)5L, (long)15L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)-1L, (long)0L, (long)2L, (long)5L, (long)3L, (long)-10L})), (2L)).Equals((new List(new long[]{(long)3L, (long)5L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)1L, (long)0L, (long)5L, (long)-7L})), (1L)).Equals((new List(new long[]{(long)5L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)4L, (long)-4L})), (2L)).Equals((new List(new long[]{(long)-4L, (long)4L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)-10L, (long)10L})), (2L)).Equals((new List(new long[]{(long)-10L, (long)10L}))));\n Debug.Assert(Maximum((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)-23L, (long)243L, (long)-400L, (long)0L})), (0L)).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that takes a message, and encodes in such a \n // way that it swaps case of all letters, replaces all vowels in \n // the message with the letter that appears 2 places ahead of that \n // vowel in the english alphabet. \n // Assume only letters. \n // Examples:\n // >>> Encode((\"test\"))\n // (\"TGST\")\n // >>> Encode((\"This is a message\"))\n // (\"tHKS KS C MGSSCGG\")\n public static string Encode(string message) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Encode((\"TEST\")).Equals((\"tgst\")));\n Debug.Assert(Encode((\"Mudasir\")).Equals((\"mWDCSKR\")));\n Debug.Assert(Encode((\"YES\")).Equals((\"ygs\")));\n Debug.Assert(Encode((\"This is a message\")).Equals((\"tHKS KS C MGSSCGG\")));\n Debug.Assert(Encode((\"I DoNt KnOw WhAt tO WrItE\")).Equals((\"k dQnT kNqW wHcT Tq wRkTg\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // remove_vowels is a function that takes string and returns string without vowels.\n // >>> RemoveVowels((\"\"))\n // (\"\")\n // >>> RemoveVowels((\"abcdef\"))\n // (\"bcdf\")\n // >>> RemoveVowels((\"aaaaa\"))\n // (\"\")\n // >>> RemoveVowels((\"aaBAA\"))\n // (\"B\")\n // >>> RemoveVowels((\"zbcd\"))\n // (\"zbcd\")\n public static string RemoveVowels(string text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(RemoveVowels((\"\")).Equals((\"\")));\n Debug.Assert(RemoveVowels((\"abcdef\\nghijklm\")).Equals((\"bcdf\\nghjklm\")));\n Debug.Assert(RemoveVowels((\"fedcba\")).Equals((\"fdcb\")));\n Debug.Assert(RemoveVowels((\"eeeee\")).Equals((\"\")));\n Debug.Assert(RemoveVowels((\"acBAA\")).Equals((\"cB\")));\n Debug.Assert(RemoveVowels((\"EcBOO\")).Equals((\"cB\")));\n Debug.Assert(RemoveVowels((\"ybcd\")).Equals((\"ybcd\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return only positive numbers in the list.\n // >>> GetPositive((new List(new long[]{(long)-1L, (long)2L, (long)-4L, (long)5L, (long)6L})))\n // (new List(new long[]{(long)2L, (long)5L, (long)6L}))\n // >>> GetPositive((new List(new long[]{(long)5L, (long)3L, (long)-5L, (long)2L, (long)-3L, (long)3L, (long)9L, (long)0L, (long)123L, (long)1L, (long)-10L})))\n // (new List(new long[]{(long)5L, (long)3L, (long)2L, (long)3L, (long)9L, (long)123L, (long)1L}))\n public static List GetPositive(List l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(GetPositive((new List(new long[]{(long)-1L, (long)-2L, (long)4L, (long)5L, (long)6L}))).Equals((new List(new long[]{(long)4L, (long)5L, (long)6L}))));\n Debug.Assert(GetPositive((new List(new long[]{(long)5L, (long)3L, (long)-5L, (long)2L, (long)3L, (long)3L, (long)9L, (long)0L, (long)123L, (long)1L, (long)-10L}))).Equals((new List(new long[]{(long)5L, (long)3L, (long)2L, (long)3L, (long)3L, (long)9L, (long)123L, (long)1L}))));\n Debug.Assert(GetPositive((new List(new long[]{(long)-1L, (long)-2L}))).Equals((new List())));\n Debug.Assert(GetPositive((new List())).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n // >>> StringSequence((0L))\n // (\"0\")\n // >>> StringSequence((5L))\n // (\"0 1 2 3 4 5\")\n public static string StringSequence(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(StringSequence((0L)).Equals((\"0\")));\n Debug.Assert(StringSequence((3L)).Equals((\"0 1 2 3\")));\n Debug.Assert(StringSequence((10L)).Equals((\"0 1 2 3 4 5 6 7 8 9 10\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a positive integer n, you have to make a pile of n levels of stones.\n // The first level has n stones.\n // The number of stones in the next level is:\n // - the next odd number if n is odd.\n // - the next even number if n is even.\n // Return the number of stones in each level in a list, where element at index\n // i represents the number of stones in the level (i+1).\n // Examples:\n // >>> MakeAPile((3L))\n // (new List(new long[]{(long)3L, (long)5L, (long)7L}))\n public static List MakeAPile(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(MakeAPile((3L)).Equals((new List(new long[]{(long)3L, (long)5L, (long)7L}))));\n Debug.Assert(MakeAPile((4L)).Equals((new List(new long[]{(long)4L, (long)6L, (long)8L, (long)10L}))));\n Debug.Assert(MakeAPile((5L)).Equals((new List(new long[]{(long)5L, (long)7L, (long)9L, (long)11L, (long)13L}))));\n Debug.Assert(MakeAPile((6L)).Equals((new List(new long[]{(long)6L, (long)8L, (long)10L, (long)12L, (long)14L, (long)16L}))));\n Debug.Assert(MakeAPile((8L)).Equals((new List(new long[]{(long)8L, (long)10L, (long)12L, (long)14L, (long)16L, (long)18L, (long)20L, (long)22L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Task\n // 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\n // then check if the result string is palindrome.\n // A string is called palindrome if it reads the same backward as forward.\n // You should return a tuple containing the result string and True/False for the check.\n // Example\n // >>> ReverseDelete((\"abcde\"), (\"ae\"))\n // (Tuple.Create(\"bcd\", false))\n // >>> ReverseDelete((\"abcdef\"), (\"b\"))\n // (Tuple.Create(\"acdef\", false))\n // >>> ReverseDelete((\"abcdedcba\"), (\"ab\"))\n // (Tuple.Create(\"cdedc\", true))\n public static Tuple ReverseDelete(string s, string c) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ReverseDelete((\"abcde\"), (\"ae\")).Equals((Tuple.Create(\"bcd\", false))));\n Debug.Assert(ReverseDelete((\"abcdef\"), (\"b\")).Equals((Tuple.Create(\"acdef\", false))));\n Debug.Assert(ReverseDelete((\"abcdedcba\"), (\"ab\")).Equals((Tuple.Create(\"cdedc\", true))));\n Debug.Assert(ReverseDelete((\"dwik\"), (\"w\")).Equals((Tuple.Create(\"dik\", false))));\n Debug.Assert(ReverseDelete((\"a\"), (\"a\")).Equals((Tuple.Create(\"\", true))));\n Debug.Assert(ReverseDelete((\"abcdedcba\"), (\"\")).Equals((Tuple.Create(\"abcdedcba\", true))));\n Debug.Assert(ReverseDelete((\"abcdedcba\"), (\"v\")).Equals((Tuple.Create(\"abcdedcba\", true))));\n Debug.Assert(ReverseDelete((\"vabba\"), (\"v\")).Equals((Tuple.Create(\"abba\", true))));\n Debug.Assert(ReverseDelete((\"mamma\"), (\"mia\")).Equals((Tuple.Create(\"\", true))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n // >>> FlipCase((\"Hello\"))\n // (\"hELLO\")\n public static string FlipCase(string str) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FlipCase((\"\")).Equals((\"\")));\n Debug.Assert(FlipCase((\"Hello!\")).Equals((\"hELLO!\")));\n Debug.Assert(FlipCase((\"These violent delights have violent ends\")).Equals((\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a string s.\n // if s[i] is a letter, reverse its case from lower to upper or vise versa, \n // otherwise keep it as it is.\n // If the string contains no letters, reverse the string.\n // The function should return the resulted string.\n // Examples\n // >>> Solve((\"1234\"))\n // (\"4321\")\n // >>> Solve((\"ab\"))\n // (\"AB\")\n // >>> Solve((\"#a@C\"))\n // (\"#A@c\")\n public static string Solve(string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Solve((\"AsDf\")).Equals((\"aSdF\")));\n Debug.Assert(Solve((\"1234\")).Equals((\"4321\")));\n Debug.Assert(Solve((\"ab\")).Equals((\"AB\")));\n Debug.Assert(Solve((\"#a@C\")).Equals((\"#A@c\")));\n Debug.Assert(Solve((\"#AsdfW^45\")).Equals((\"#aSDFw^45\")));\n Debug.Assert(Solve((\"#6@2\")).Equals((\"2@6#\")));\n Debug.Assert(Solve((\"#$a^D\")).Equals((\"#$A^d\")));\n Debug.Assert(Solve((\"#ccc\")).Equals((\"#CCC\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Filter an input list of strings only for ones that start with a given prefix.\n // >>> FilterByPrefix((new List()), (\"a\"))\n // (new List())\n // >>> FilterByPrefix((new List(new string[]{(string)\"abc\", (string)\"bcd\", (string)\"cde\", (string)\"array\"})), (\"a\"))\n // (new List(new string[]{(string)\"abc\", (string)\"array\"}))\n public static List FilterByPrefix(List strings, string prefix) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FilterByPrefix((new List()), (\"john\")).Equals((new List())));\n Debug.Assert(FilterByPrefix((new List(new string[]{(string)\"xxx\", (string)\"asd\", (string)\"xxy\", (string)\"john doe\", (string)\"xxxAAA\", (string)\"xxx\"})), (\"xxx\")).Equals((new List(new string[]{(string)\"xxx\", (string)\"xxxAAA\", (string)\"xxx\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // This function takes two positive numbers x and y and returns the\n // biggest even integer number that is in the range [x, y] inclusive. If \n // there's no such number, then the function should return -1.\n // For example:\n // >>> ChooseNum((12L), (15L))\n // (14L)\n // >>> ChooseNum((13L), (12L))\n // (-1L)\n public static long ChooseNum(long x, long y) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ChooseNum((12L), (15L)) == (14L));\n Debug.Assert(ChooseNum((13L), (12L)) == (-1L));\n Debug.Assert(ChooseNum((33L), (12354L)) == (12354L));\n Debug.Assert(ChooseNum((5234L), (5233L)) == (-1L));\n Debug.Assert(ChooseNum((6L), (29L)) == (28L));\n Debug.Assert(ChooseNum((27L), (10L)) == (-1L));\n Debug.Assert(ChooseNum((7L), (7L)) == (-1L));\n Debug.Assert(ChooseNum((546L), (546L)) == (546L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a string representing a sentence,\n // the sentence contains some words separated by a space,\n // and you have to return a string that contains the words from the original sentence,\n // whose lengths are prime numbers,\n // the order of the words in the new string should be the same as the original one.\n // Example 1:\n // >>> WordsInSentence((\"This is a test\"))\n // (\"is\")\n // Example 2:\n // >>> WordsInSentence((\"lets go for swimming\"))\n // (\"go for\")\n // Constraints:\n // * 1 <= len(sentence) <= 100\n // * sentence contains only letters\n public static string WordsInSentence(string sentence) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(WordsInSentence((\"This is a test\")).Equals((\"is\")));\n Debug.Assert(WordsInSentence((\"lets go for swimming\")).Equals((\"go for\")));\n Debug.Assert(WordsInSentence((\"there is no place available here\")).Equals((\"there is no place\")));\n Debug.Assert(WordsInSentence((\"Hi I am Hussein\")).Equals((\"Hi am Hussein\")));\n Debug.Assert(WordsInSentence((\"go for it\")).Equals((\"go for it\")));\n Debug.Assert(WordsInSentence((\"here\")).Equals((\"\")));\n Debug.Assert(WordsInSentence((\"here is\")).Equals((\"is\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n // >>> Intersperse((new List()), (4L))\n // (new List())\n // >>> Intersperse((new List(new long[]{(long)1L, (long)2L, (long)3L})), (4L))\n // (new List(new long[]{(long)1L, (long)4L, (long)2L, (long)4L, (long)3L}))\n public static List Intersperse(List numbers, long delimeter) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Intersperse((new List()), (7L)).Equals((new List())));\n Debug.Assert(Intersperse((new List(new long[]{(long)5L, (long)6L, (long)3L, (long)2L})), (8L)).Equals((new List(new long[]{(long)5L, (long)8L, (long)6L, (long)8L, (long)3L, (long)8L, (long)2L}))));\n Debug.Assert(Intersperse((new List(new long[]{(long)2L, (long)2L, (long)2L})), (2L)).Equals((new List(new long[]{(long)2L, (long)2L, (long)2L, (long)2L, (long)2L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Your task is to write a function that returns true if a number x is a simple\n // power of n and false in other cases.\n // x is a simple power of n if n**int=x\n // For example:\n // >>> IsSimplePower((1L), (4L))\n // (true)\n // >>> IsSimplePower((2L), (2L))\n // (true)\n // >>> IsSimplePower((8L), (2L))\n // (true)\n // >>> IsSimplePower((3L), (2L))\n // (false)\n // >>> IsSimplePower((3L), (1L))\n // (false)\n // >>> IsSimplePower((5L), (3L))\n // (false)\n public static bool IsSimplePower(long x, long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsSimplePower((16L), (2L)) == (true));\n Debug.Assert(IsSimplePower((143214L), (16L)) == (false));\n Debug.Assert(IsSimplePower((4L), (2L)) == (true));\n Debug.Assert(IsSimplePower((9L), (3L)) == (true));\n Debug.Assert(IsSimplePower((16L), (4L)) == (true));\n Debug.Assert(IsSimplePower((24L), (2L)) == (false));\n Debug.Assert(IsSimplePower((128L), (4L)) == (false));\n Debug.Assert(IsSimplePower((12L), (6L)) == (false));\n Debug.Assert(IsSimplePower((1L), (1L)) == (true));\n Debug.Assert(IsSimplePower((1L), (12L)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that returns true if the given number is the multiplication of 3 prime numbers\n // and false otherwise.\n // Knowing that (a) is less then 100. \n // Example:\n // >>> IsMultiplyPrime((30L))\n // (true)\n // 30 = 2 * 3 * 5\n public static bool IsMultiplyPrime(long a) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsMultiplyPrime((5L)) == (false));\n Debug.Assert(IsMultiplyPrime((30L)) == (true));\n Debug.Assert(IsMultiplyPrime((8L)) == (true));\n Debug.Assert(IsMultiplyPrime((10L)) == (false));\n Debug.Assert(IsMultiplyPrime((125L)) == (true));\n Debug.Assert(IsMultiplyPrime((105L)) == (true));\n Debug.Assert(IsMultiplyPrime((126L)) == (false));\n Debug.Assert(IsMultiplyPrime((729L)) == (false));\n Debug.Assert(IsMultiplyPrime((891L)) == (false));\n Debug.Assert(IsMultiplyPrime((1001L)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given the lengths of the three sides of a triangle. Return True if the three\n // sides form a right-angled triangle, False otherwise.\n // A right-angled triangle is a triangle in which one angle is right angle or \n // 90 degree.\n // Example:\n // >>> RightAngleTriangle((3L), (4L), (5L))\n // (true)\n // >>> RightAngleTriangle((1L), (2L), (3L))\n // (false)\n public static bool RightAngleTriangle(long a, long b, long c) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(RightAngleTriangle((3L), (4L), (5L)) == (true));\n Debug.Assert(RightAngleTriangle((1L), (2L), (3L)) == (false));\n Debug.Assert(RightAngleTriangle((10L), (6L), (8L)) == (true));\n Debug.Assert(RightAngleTriangle((2L), (2L), (2L)) == (false));\n Debug.Assert(RightAngleTriangle((7L), (24L), (25L)) == (true));\n Debug.Assert(RightAngleTriangle((10L), (5L), (7L)) == (false));\n Debug.Assert(RightAngleTriangle((5L), (12L), (13L)) == (true));\n Debug.Assert(RightAngleTriangle((15L), (8L), (17L)) == (true));\n Debug.Assert(RightAngleTriangle((48L), (55L), (73L)) == (true));\n Debug.Assert(RightAngleTriangle((1L), (1L), (1L)) == (false));\n Debug.Assert(RightAngleTriangle((2L), (2L), (10L)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function that takes 3 numbers.\n // Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n // Returns false in any other cases.\n // Examples\n // >>> AnyInt((float)5L, (float)2L, (float)7L)\n // (true)\n // >>> AnyInt((float)3L, (float)2L, (float)2L)\n // (false)\n // >>> AnyInt((float)3L, (float)-2L, (float)1L)\n // (true)\n // >>> AnyInt((3.6f), (-2.2f), (float)2L)\n // (false)\n public static bool AnyInt(float x, float y, float z) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(AnyInt((float)2L, (float)3L, (float)1L) == (true));\n Debug.Assert(AnyInt((2.5f), (float)2L, (float)3L) == (false));\n Debug.Assert(AnyInt((1.5f), (float)5L, (3.5f)) == (false));\n Debug.Assert(AnyInt((float)2L, (float)6L, (float)2L) == (false));\n Debug.Assert(AnyInt((float)4L, (float)2L, (float)2L) == (true));\n Debug.Assert(AnyInt((2.2f), (2.2f), (2.2f)) == (false));\n Debug.Assert(AnyInt((float)-4L, (float)6L, (float)2L) == (true));\n Debug.Assert(AnyInt((float)2L, (float)1L, (float)1L) == (true));\n Debug.Assert(AnyInt((float)3L, (float)4L, (float)7L) == (true));\n Debug.Assert(AnyInt((3.0f), (float)4L, (float)7L) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // This function takes a list l and returns a list l' such that\n // l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n // to the values of the corresponding indicies of l, but sorted.\n // >>> SortThird((new List(new long[]{(long)1L, (long)2L, (long)3L})))\n // (new List(new long[]{(long)1L, (long)2L, (long)3L}))\n // >>> SortThird((new List(new long[]{(long)5L, (long)6L, (long)3L, (long)4L, (long)8L, (long)9L, (long)2L})))\n // (new List(new long[]{(long)2L, (long)6L, (long)3L, (long)4L, (long)8L, (long)9L, (long)5L}))\n public static List SortThird(List l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SortThird((new List(new long[]{(long)5L, (long)6L, (long)3L, (long)4L, (long)8L, (long)9L, (long)2L}))).Equals((new List(new long[]{(long)2L, (long)6L, (long)3L, (long)4L, (long)8L, (long)9L, (long)5L}))));\n Debug.Assert(SortThird((new List(new long[]{(long)5L, (long)8L, (long)3L, (long)4L, (long)6L, (long)9L, (long)2L}))).Equals((new List(new long[]{(long)2L, (long)8L, (long)3L, (long)4L, (long)6L, (long)9L, (long)5L}))));\n Debug.Assert(SortThird((new List(new long[]{(long)5L, (long)6L, (long)9L, (long)4L, (long)8L, (long)3L, (long)2L}))).Equals((new List(new long[]{(long)2L, (long)6L, (long)9L, (long)4L, (long)8L, (long)3L, (long)5L}))));\n Debug.Assert(SortThird((new List(new long[]{(long)5L, (long)6L, (long)3L, (long)4L, (long)8L, (long)9L, (long)2L, (long)1L}))).Equals((new List(new long[]{(long)2L, (long)6L, (long)3L, (long)4L, (long)8L, (long)9L, (long)5L, (long)1L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_53_add", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Add two numbers x and y\n // >>> Add((2L), (3L))\n // (5L)\n // >>> Add((5L), (7L))\n // (12L)\n public static long Add(long x, long y) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Add((0L), (1L)) == (1L));\n Debug.Assert(Add((1L), (0L)) == (1L));\n Debug.Assert(Add((2L), (3L)) == (5L));\n Debug.Assert(Add((5L), (7L)) == (12L));\n Debug.Assert(Add((7L), (5L)) == (12L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_69_search", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n // zero, and has a frequency greater than or equal to the value of the integer itself. \n // The frequency of an integer is the number of times it appears in the list.\n // If no such a value exist, return -1.\n // Examples:\n // >>> Search((new List(new long[]{(long)4L, (long)1L, (long)2L, (long)2L, (long)3L, (long)1L})))\n // (2L)\n // >>> Search((new List(new long[]{(long)1L, (long)2L, (long)2L, (long)3L, (long)3L, (long)3L, (long)4L, (long)4L, (long)4L})))\n // (3L)\n // >>> Search((new List(new long[]{(long)5L, (long)5L, (long)4L, (long)4L, (long)4L})))\n // (-1L)\n public static long Search(List lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Search((new List(new long[]{(long)5L, (long)5L, (long)5L, (long)5L, (long)1L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)4L, (long)1L, (long)4L, (long)1L, (long)4L, (long)4L}))) == (4L));\n Debug.Assert(Search((new List(new long[]{(long)3L, (long)3L}))) == (-1L));\n Debug.Assert(Search((new List(new long[]{(long)8L, (long)8L, (long)8L, (long)8L, (long)8L, (long)8L, (long)8L, (long)8L}))) == (8L));\n Debug.Assert(Search((new List(new long[]{(long)2L, (long)3L, (long)3L, (long)2L, (long)2L}))) == (2L));\n Debug.Assert(Search((new List(new long[]{(long)2L, (long)7L, (long)8L, (long)8L, (long)4L, (long)8L, (long)7L, (long)3L, (long)9L, (long)6L, (long)5L, (long)10L, (long)4L, (long)3L, (long)6L, (long)7L, (long)1L, (long)7L, (long)4L, (long)10L, (long)8L, (long)1L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)3L, (long)2L, (long)8L, (long)2L}))) == (2L));\n Debug.Assert(Search((new List(new long[]{(long)6L, (long)7L, (long)1L, (long)8L, (long)8L, (long)10L, (long)5L, (long)8L, (long)5L, (long)3L, (long)10L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)8L, (long)8L, (long)3L, (long)6L, (long)5L, (long)6L, (long)4L}))) == (-1L));\n Debug.Assert(Search((new List(new long[]{(long)6L, (long)9L, (long)6L, (long)7L, (long)1L, (long)4L, (long)7L, (long)1L, (long)8L, (long)8L, (long)9L, (long)8L, (long)10L, (long)10L, (long)8L, (long)4L, (long)10L, (long)4L, (long)10L, (long)1L, (long)2L, (long)9L, (long)5L, (long)7L, (long)9L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)1L, (long)9L, (long)10L, (long)1L, (long)3L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)6L, (long)9L, (long)7L, (long)5L, (long)8L, (long)7L, (long)5L, (long)3L, (long)7L, (long)5L, (long)10L, (long)10L, (long)3L, (long)6L, (long)10L, (long)2L, (long)8L, (long)6L, (long)5L, (long)4L, (long)9L, (long)5L, (long)3L, (long)10L}))) == (5L));\n Debug.Assert(Search((new List(new long[]{(long)1L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)8L, (long)8L, (long)10L, (long)6L, (long)4L, (long)3L, (long)5L, (long)8L, (long)2L, (long)4L, (long)2L, (long)8L, (long)4L, (long)6L, (long)10L, (long)4L, (long)2L, (long)1L, (long)10L, (long)2L, (long)1L, (long)1L, (long)5L}))) == (4L));\n Debug.Assert(Search((new List(new long[]{(long)2L, (long)10L, (long)4L, (long)8L, (long)2L, (long)10L, (long)5L, (long)1L, (long)2L, (long)9L, (long)5L, (long)5L, (long)6L, (long)3L, (long)8L, (long)6L, (long)4L, (long)10L}))) == (2L));\n Debug.Assert(Search((new List(new long[]{(long)1L, (long)6L, (long)10L, (long)1L, (long)6L, (long)9L, (long)10L, (long)8L, (long)6L, (long)8L, (long)7L, (long)3L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)9L, (long)2L, (long)4L, (long)1L, (long)5L, (long)1L, (long)5L, (long)2L, (long)5L, (long)7L, (long)7L, (long)7L, (long)3L, (long)10L, (long)1L, (long)5L, (long)4L, (long)2L, (long)8L, (long)4L, (long)1L, (long)9L, (long)10L, (long)7L, (long)10L, (long)2L, (long)8L, (long)10L, (long)9L, (long)4L}))) == (4L));\n Debug.Assert(Search((new List(new long[]{(long)2L, (long)6L, (long)4L, (long)2L, (long)8L, (long)7L, (long)5L, (long)6L, (long)4L, (long)10L, (long)4L, (long)6L, (long)3L, (long)7L, (long)8L, (long)8L, (long)3L, (long)1L, (long)4L, (long)2L, (long)2L, (long)10L, (long)7L}))) == (4L));\n Debug.Assert(Search((new List(new long[]{(long)9L, (long)8L, (long)6L, (long)10L, (long)2L, (long)6L, (long)10L, (long)2L, (long)7L, (long)8L, (long)10L, (long)3L, (long)8L, (long)2L, (long)6L, (long)2L, (long)3L, (long)1L}))) == (2L));\n Debug.Assert(Search((new List(new long[]{(long)5L, (long)5L, (long)3L, (long)9L, (long)5L, (long)6L, (long)3L, (long)2L, (long)8L, (long)5L, (long)6L, (long)10L, (long)10L, (long)6L, (long)8L, (long)4L, (long)10L, (long)7L, (long)7L, (long)10L, (long)8L}))) == (-1L));\n Debug.Assert(Search((new List(new long[]{(long)10L}))) == (-1L));\n Debug.Assert(Search((new List(new long[]{(long)9L, (long)7L, (long)7L, (long)2L, (long)4L, (long)7L, (long)2L, (long)10L, (long)9L, (long)7L, (long)5L, (long)7L, (long)2L}))) == (2L));\n Debug.Assert(Search((new List(new long[]{(long)5L, (long)4L, (long)10L, (long)2L, (long)1L, (long)1L, (long)10L, (long)3L, (long)6L, (long)1L, (long)8L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)7L, (long)9L, (long)9L, (long)9L, (long)3L, (long)4L, (long)1L, (long)5L, (long)9L, (long)1L, (long)2L, (long)1L, (long)1L, (long)10L, (long)7L, (long)5L, (long)6L, (long)7L, (long)6L, (long)7L, (long)7L, (long)6L}))) == (1L));\n Debug.Assert(Search((new List(new long[]{(long)3L, (long)10L, (long)10L, (long)9L, (long)2L}))) == (-1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that takes a string and returns True if the string\n // length is a prime number or False otherwise\n // Examples\n // >>> PrimeLength((\"Hello\"))\n // (true)\n // >>> PrimeLength((\"abcdcba\"))\n // (true)\n // >>> PrimeLength((\"kittens\"))\n // (true)\n // >>> PrimeLength((\"orange\"))\n // (false)\n public static bool PrimeLength(string str) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(PrimeLength((\"Hello\")) == (true));\n Debug.Assert(PrimeLength((\"abcdcba\")) == (true));\n Debug.Assert(PrimeLength((\"kittens\")) == (true));\n Debug.Assert(PrimeLength((\"orange\")) == (false));\n Debug.Assert(PrimeLength((\"wow\")) == (true));\n Debug.Assert(PrimeLength((\"world\")) == (true));\n Debug.Assert(PrimeLength((\"MadaM\")) == (true));\n Debug.Assert(PrimeLength((\"Wow\")) == (true));\n Debug.Assert(PrimeLength((\"\")) == (false));\n Debug.Assert(PrimeLength((\"HI\")) == (true));\n Debug.Assert(PrimeLength((\"go\")) == (true));\n Debug.Assert(PrimeLength((\"gogo\")) == (false));\n Debug.Assert(PrimeLength((\"aaaaaaaaaaaaaaa\")) == (false));\n Debug.Assert(PrimeLength((\"Madam\")) == (true));\n Debug.Assert(PrimeLength((\"M\")) == (false));\n Debug.Assert(PrimeLength((\"0\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_58_common", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return sorted unique common elements for two lists.\n // >>> Common((new List(new long[]{(long)1L, (long)4L, (long)3L, (long)34L, (long)653L, (long)2L, (long)5L})), (new List(new long[]{(long)5L, (long)7L, (long)1L, (long)5L, (long)9L, (long)653L, (long)121L})))\n // (new List(new long[]{(long)1L, (long)5L, (long)653L}))\n // >>> Common((new List(new long[]{(long)5L, (long)3L, (long)2L, (long)8L})), (new List(new long[]{(long)3L, (long)2L})))\n // (new List(new long[]{(long)2L, (long)3L}))\n public static List Common(List l1, List l2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Common((new List(new long[]{(long)1L, (long)4L, (long)3L, (long)34L, (long)653L, (long)2L, (long)5L})), (new List(new long[]{(long)5L, (long)7L, (long)1L, (long)5L, (long)9L, (long)653L, (long)121L}))).Equals((new List(new long[]{(long)1L, (long)5L, (long)653L}))));\n Debug.Assert(Common((new List(new long[]{(long)5L, (long)3L, (long)2L, (long)8L})), (new List(new long[]{(long)3L, (long)2L}))).Equals((new List(new long[]{(long)2L, (long)3L}))));\n Debug.Assert(Common((new List(new long[]{(long)4L, (long)3L, (long)2L, (long)8L})), (new List(new long[]{(long)3L, (long)2L, (long)4L}))).Equals((new List(new long[]{(long)2L, (long)3L, (long)4L}))));\n Debug.Assert(Common((new List(new long[]{(long)4L, (long)3L, (long)2L, (long)8L})), (new List())).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // The Brazilian factorial is defined as:\n // brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n // where n > 0\n // For example:\n // >>> SpecialFactorial((4L))\n // (288L)\n // The function will receive an integer as input and should return the special\n // factorial of this integer.\n public static long SpecialFactorial(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SpecialFactorial((4L)) == (288L));\n Debug.Assert(SpecialFactorial((5L)) == (34560L));\n Debug.Assert(SpecialFactorial((7L)) == (125411328000L));\n Debug.Assert(SpecialFactorial((1L)) == (1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // In this problem, you will implement a function that takes two lists of numbers,\n // and determines whether it is possible to perform an exchange of elements\n // between them to make lst1 a list of only even numbers.\n // There is no limit on the number of exchanged elements between lst1 and lst2.\n // If it is possible to exchange elements between the lst1 and lst2 to make\n // all the elements of lst1 to be even, return \"YES\".\n // Otherwise, return \"NO\".\n // For example:\n // >>> Exchange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L})), (new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L})))\n // (\"YES\")\n // >>> Exchange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L})), (new List(new long[]{(long)1L, (long)5L, (long)3L, (long)4L})))\n // (\"NO\")\n // It is assumed that the input lists will be non-empty.\n public static string Exchange(List lst1, List lst2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Exchange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L})), (new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))).Equals((\"YES\")));\n Debug.Assert(Exchange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L})), (new List(new long[]{(long)1L, (long)5L, (long)3L, (long)4L}))).Equals((\"NO\")));\n Debug.Assert(Exchange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L})), (new List(new long[]{(long)2L, (long)1L, (long)4L, (long)3L}))).Equals((\"YES\")));\n Debug.Assert(Exchange((new List(new long[]{(long)5L, (long)7L, (long)3L})), (new List(new long[]{(long)2L, (long)6L, (long)4L}))).Equals((\"YES\")));\n Debug.Assert(Exchange((new List(new long[]{(long)5L, (long)7L, (long)3L})), (new List(new long[]{(long)2L, (long)6L, (long)3L}))).Equals((\"NO\")));\n Debug.Assert(Exchange((new List(new long[]{(long)3L, (long)2L, (long)6L, (long)1L, (long)8L, (long)9L})), (new List(new long[]{(long)3L, (long)5L, (long)5L, (long)1L, (long)1L, (long)1L}))).Equals((\"NO\")));\n Debug.Assert(Exchange((new List(new long[]{(long)100L, (long)200L})), (new List(new long[]{(long)200L, (long)200L}))).Equals((\"YES\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a non-empty array of integers arr and an integer k, return\n // the sum of the elements with at most two digits from the first k elements of arr.\n // Example:\n // >>> AddElements((new List(new long[]{(long)111L, (long)21L, (long)3L, (long)4000L, (long)5L, (long)6L, (long)7L, (long)8L, (long)9L})), (4L))\n // (24L)\n // Constraints:\n // 1. 1 <= len(arr) <= 100\n // 2. 1 <= k <= len(arr)\n public static long AddElements(List arr, long k) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(AddElements((new List(new long[]{(long)1L, (long)-2L, (long)-3L, (long)41L, (long)57L, (long)76L, (long)87L, (long)88L, (long)99L})), (3L)) == (-4L));\n Debug.Assert(AddElements((new List(new long[]{(long)111L, (long)121L, (long)3L, (long)4000L, (long)5L, (long)6L})), (2L)) == (0L));\n Debug.Assert(AddElements((new List(new long[]{(long)11L, (long)21L, (long)3L, (long)90L, (long)5L, (long)6L, (long)7L, (long)8L, (long)9L})), (4L)) == (125L));\n Debug.Assert(AddElements((new List(new long[]{(long)111L, (long)21L, (long)3L, (long)4000L, (long)5L, (long)6L, (long)7L, (long)8L, (long)9L})), (4L)) == (24L));\n Debug.Assert(AddElements((new List(new long[]{(long)1L})), (1L)) == (1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // A simple program which should return the value of x if n is \n // a prime number and should return the value of y otherwise.\n // Examples:\n // >>> XOrY((7L), (34L), (12L))\n // (34L)\n // >>> XOrY((15L), (8L), (5L))\n // (5L)\n public static long XOrY(long n, long x, long y) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(XOrY((7L), (34L), (12L)) == (34L));\n Debug.Assert(XOrY((15L), (8L), (5L)) == (5L));\n Debug.Assert(XOrY((3L), (33L), (5212L)) == (33L));\n Debug.Assert(XOrY((1259L), (3L), (52L)) == (3L));\n Debug.Assert(XOrY((7919L), (-1L), (12L)) == (-1L));\n Debug.Assert(XOrY((3609L), (1245L), (583L)) == (583L));\n Debug.Assert(XOrY((91L), (56L), (129L)) == (129L));\n Debug.Assert(XOrY((6L), (34L), (1234L)) == (1234L));\n Debug.Assert(XOrY((1L), (2L), (0L)) == (0L));\n Debug.Assert(XOrY((2L), (2L), (0L)) == (2L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given length of a side and high return area for a triangle.\n // >>> TriangleArea((5L), (3L))\n // (7.5f)\n public static float TriangleArea(long a, long h) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(TriangleArea((5L), (3L)) == (7.5f));\n Debug.Assert(TriangleArea((2L), (2L)) == (2.0f));\n Debug.Assert(TriangleArea((10L), (8L)) == (40.0f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n // the last couple centuries. However, what people don't know is Tribonacci sequence.\n // Tribonacci sequence is defined by the recurrence:\n // tri(1) = 3\n // tri(n) = 1 + n / 2, if n is even.\n // tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n // For example:\n // tri(2) = 1 + (2 / 2) = 2\n // tri(4) = 3\n // tri(3) = tri(2) + tri(1) + tri(4)\n // = 2 + 3 + 3 = 8 \n // You are given a non-negative integer number n, you have to a return a list of the \n // first n + 1 numbers of the Tribonacci sequence.\n // Examples:\n // >>> Tri((3L))\n // (new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L}))\n public static List Tri(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Tri((3L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L}))));\n Debug.Assert(Tri((4L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L, (long)3L}))));\n Debug.Assert(Tri((5L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L, (long)3L, (long)15L}))));\n Debug.Assert(Tri((6L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L, (long)3L, (long)15L, (long)4L}))));\n Debug.Assert(Tri((7L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L, (long)3L, (long)15L, (long)4L, (long)24L}))));\n Debug.Assert(Tri((8L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L, (long)3L, (long)15L, (long)4L, (long)24L, (long)5L}))));\n Debug.Assert(Tri((9L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L, (long)3L, (long)15L, (long)4L, (long)24L, (long)5L, (long)35L}))));\n Debug.Assert(Tri((20L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)8L, (long)3L, (long)15L, (long)4L, (long)24L, (long)5L, (long)35L, (long)6L, (long)48L, (long)7L, (long)63L, (long)8L, (long)80L, (long)9L, (long)99L, (long)10L, (long)120L, (long)11L}))));\n Debug.Assert(Tri((0L)).Equals((new List(new long[]{(long)1L}))));\n Debug.Assert(Tri((1L)).Equals((new List(new long[]{(long)1L, (long)3L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a list of two strings, both strings consist of open\n // parentheses '(' or close parentheses ')' only.\n // Your job is to check if it is possible to concatenate the two strings in\n // some order, that the resulting string will be good.\n // A string S is considered to be good if and only if all parentheses in S\n // are balanced. For example: the string '(())()' is good, while the string\n // '())' is not.\n // Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n // Examples:\n // >>> MatchParens((new List(new string[]{(string)\"()(\", (string)\")\"})))\n // (\"Yes\")\n // >>> MatchParens((new List(new string[]{(string)\")\", (string)\")\"})))\n // (\"No\")\n public static string MatchParens(List lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(MatchParens((new List(new string[]{(string)\"()(\", (string)\")\"}))).Equals((\"Yes\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\")\", (string)\")\"}))).Equals((\"No\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\"(()(())\", (string)\"())())\"}))).Equals((\"No\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\")())\", (string)\"(()()(\"}))).Equals((\"Yes\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\"(())))\", (string)\"(()())((\"}))).Equals((\"Yes\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\"()\", (string)\"())\"}))).Equals((\"No\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\"(()(\", (string)\"()))()\"}))).Equals((\"Yes\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\"((((\", (string)\"((())\"}))).Equals((\"No\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\")(()\", (string)\"(()(\"}))).Equals((\"No\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\")(\", (string)\")(\"}))).Equals((\"No\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\"(\", (string)\")\"}))).Equals((\"Yes\")));\n Debug.Assert(MatchParens((new List(new string[]{(string)\")\", (string)\"(\"}))).Equals((\"Yes\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // From a list of integers, remove all elements that occur more than once.\n // Keep order of elements left the same as in the input.\n // >>> RemoveDuplicates((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)2L, (long)4L})))\n // (new List(new long[]{(long)1L, (long)3L, (long)4L}))\n public static List RemoveDuplicates(List numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(RemoveDuplicates((new List())).Equals((new List())));\n Debug.Assert(RemoveDuplicates((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))).Equals((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))));\n Debug.Assert(RemoveDuplicates((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)2L, (long)4L, (long)3L, (long)5L}))).Equals((new List(new long[]{(long)1L, (long)4L, (long)5L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return a greatest common divisor of two integers a and b\n // >>> GreatestCommonDivisor((3L), (5L))\n // (1L)\n // >>> GreatestCommonDivisor((25L), (15L))\n // (5L)\n public static long GreatestCommonDivisor(long a, long b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(GreatestCommonDivisor((3L), (7L)) == (1L));\n Debug.Assert(GreatestCommonDivisor((10L), (15L)) == (5L));\n Debug.Assert(GreatestCommonDivisor((49L), (14L)) == (7L));\n Debug.Assert(GreatestCommonDivisor((144L), (60L)) == (12L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Checks if given string is a palindrome\n // >>> IsPalindrome((\"\"))\n // (true)\n // >>> IsPalindrome((\"aba\"))\n // (true)\n // >>> IsPalindrome((\"aaaaa\"))\n // (true)\n // >>> IsPalindrome((\"zbcd\"))\n // (false)\n public static bool IsPalindrome(string text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsPalindrome((\"\")) == (true));\n Debug.Assert(IsPalindrome((\"aba\")) == (true));\n Debug.Assert(IsPalindrome((\"aaaaa\")) == (true));\n Debug.Assert(IsPalindrome((\"zbcd\")) == (false));\n Debug.Assert(IsPalindrome((\"xywyx\")) == (true));\n Debug.Assert(IsPalindrome((\"xywyz\")) == (false));\n Debug.Assert(IsPalindrome((\"xywzx\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // xs represent coefficients of a polynomial.\n // xs[0] + xs[1] * x + xs[2] * x^2 + ....\n // Return derivative of this polynomial in the same form.\n // >>> Derivative((new List(new long[]{(long)3L, (long)1L, (long)2L, (long)4L, (long)5L})))\n // (new List(new long[]{(long)1L, (long)4L, (long)12L, (long)20L}))\n // >>> Derivative((new List(new long[]{(long)1L, (long)2L, (long)3L})))\n // (new List(new long[]{(long)2L, (long)6L}))\n public static List Derivative(List xs) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Derivative((new List(new long[]{(long)3L, (long)1L, (long)2L, (long)4L, (long)5L}))).Equals((new List(new long[]{(long)1L, (long)4L, (long)12L, (long)20L}))));\n Debug.Assert(Derivative((new List(new long[]{(long)1L, (long)2L, (long)3L}))).Equals((new List(new long[]{(long)2L, (long)6L}))));\n Debug.Assert(Derivative((new List(new long[]{(long)3L, (long)2L, (long)1L}))).Equals((new List(new long[]{(long)2L, (long)2L}))));\n Debug.Assert(Derivative((new List(new long[]{(long)3L, (long)2L, (long)1L, (long)0L, (long)4L}))).Equals((new List(new long[]{(long)2L, (long)2L, (long)0L, (long)16L}))));\n Debug.Assert(Derivative((new List(new long[]{(long)1L}))).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // In this task, you will be given a string that represents a number of apples and oranges \n // that are distributed in a basket of fruit this basket contains \n // apples, oranges, and mango fruits. Given the string that represents the total number of \n // the oranges and apples and an integer that represent the total number of the fruits \n // in the basket return the number of the mango fruits in the basket.\n // for examble:\n // >>> FruitDistribution((\"5 apples and 6 oranges\"), (19L))\n // (8L)\n // >>> FruitDistribution((\"0 apples and 1 oranges\"), (3L))\n // (2L)\n // >>> FruitDistribution((\"2 apples and 3 oranges\"), (100L))\n // (95L)\n // >>> FruitDistribution((\"100 apples and 1 oranges\"), (120L))\n // (19L)\n public static long FruitDistribution(string s, long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FruitDistribution((\"5 apples and 6 oranges\"), (19L)) == (8L));\n Debug.Assert(FruitDistribution((\"5 apples and 6 oranges\"), (21L)) == (10L));\n Debug.Assert(FruitDistribution((\"0 apples and 1 oranges\"), (3L)) == (2L));\n Debug.Assert(FruitDistribution((\"1 apples and 0 oranges\"), (3L)) == (2L));\n Debug.Assert(FruitDistribution((\"2 apples and 3 oranges\"), (100L)) == (95L));\n Debug.Assert(FruitDistribution((\"2 apples and 3 oranges\"), (5L)) == (0L));\n Debug.Assert(FruitDistribution((\"1 apples and 100 oranges\"), (120L)) == (19L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that takes an integer a and returns True \n // if this ingeger is a cube of some integer number.\n // Note: you may assume the input is always valid.\n // Examples:\n // >>> Iscube((1L))\n // (true)\n // >>> Iscube((2L))\n // (false)\n // >>> Iscube((-1L))\n // (true)\n // >>> Iscube((64L))\n // (true)\n // >>> Iscube((0L))\n // (true)\n // >>> Iscube((180L))\n // (false)\n public static bool Iscube(long a) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Iscube((1L)) == (true));\n Debug.Assert(Iscube((2L)) == (false));\n Debug.Assert(Iscube((-1L)) == (true));\n Debug.Assert(Iscube((64L)) == (true));\n Debug.Assert(Iscube((180L)) == (false));\n Debug.Assert(Iscube((1000L)) == (true));\n Debug.Assert(Iscube((0L)) == (true));\n Debug.Assert(Iscube((1729L)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // In this Kata, you have to sort an array of non-negative integers according to\n // number of ones in their binary representation in ascending order.\n // For similar number of ones, sort based on decimal value.\n // It must be implemented like this:\n // >>> SortArray((new List(new long[]{(long)1L, (long)5L, (long)2L, (long)3L, (long)4L})))\n // (new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L}))\n // >>> SortArray((new List(new long[]{(long)-2L, (long)-3L, (long)-4L, (long)-5L, (long)-6L})))\n // (new List(new long[]{(long)-6L, (long)-5L, (long)-4L, (long)-3L, (long)-2L}))\n // >>> SortArray((new List(new long[]{(long)1L, (long)0L, (long)2L, (long)3L, (long)4L})))\n // (new List(new long[]{(long)0L, (long)1L, (long)2L, (long)3L, (long)4L}))\n public static List SortArray(List arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SortArray((new List(new long[]{(long)1L, (long)5L, (long)2L, (long)3L, (long)4L}))).Equals((new List(new long[]{(long)1L, (long)2L, (long)4L, (long)3L, (long)5L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)-2L, (long)-3L, (long)-4L, (long)-5L, (long)-6L}))).Equals((new List(new long[]{(long)-4L, (long)-2L, (long)-6L, (long)-5L, (long)-3L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)1L, (long)0L, (long)2L, (long)3L, (long)4L}))).Equals((new List(new long[]{(long)0L, (long)1L, (long)2L, (long)4L, (long)3L}))));\n Debug.Assert(SortArray((new List())).Equals((new List())));\n Debug.Assert(SortArray((new List(new long[]{(long)2L, (long)5L, (long)77L, (long)4L, (long)5L, (long)3L, (long)5L, (long)7L, (long)2L, (long)3L, (long)4L}))).Equals((new List(new long[]{(long)2L, (long)2L, (long)4L, (long)4L, (long)3L, (long)3L, (long)5L, (long)5L, (long)5L, (long)7L, (long)77L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)3L, (long)6L, (long)44L, (long)12L, (long)32L, (long)5L}))).Equals((new List(new long[]{(long)32L, (long)3L, (long)5L, (long)6L, (long)12L, (long)44L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)2L, (long)4L, (long)8L, (long)16L, (long)32L}))).Equals((new List(new long[]{(long)2L, (long)4L, (long)8L, (long)16L, (long)32L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)2L, (long)4L, (long)8L, (long)16L, (long)32L}))).Equals((new List(new long[]{(long)2L, (long)4L, (long)8L, (long)16L, (long)32L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a list of strings, where each string consists of only digits, return a list.\n // Each element i of the output should be \"the number of odd elements in the\n // string i of the input.\" where all the i's should be replaced by the number\n // of odd digits in the i'th string of the input.\n // >>> OddCount((new List(new string[]{(string)\"1234567\"})))\n // (new List(new string[]{(string)\"the number of odd elements 4n the str4ng 4 of the 4nput.\"}))\n // >>> OddCount((new List(new string[]{(string)\"3\", (string)\"11111111\"})))\n // (new List(new string[]{(string)\"the number of odd elements 1n the str1ng 1 of the 1nput.\", (string)\"the number of odd elements 8n the str8ng 8 of the 8nput.\"}))\n public static List OddCount(List lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(OddCount((new List(new string[]{(string)\"1234567\"}))).Equals((new List(new string[]{(string)\"the number of odd elements 4n the str4ng 4 of the 4nput.\"}))));\n Debug.Assert(OddCount((new List(new string[]{(string)\"3\", (string)\"11111111\"}))).Equals((new List(new string[]{(string)\"the number of odd elements 1n the str1ng 1 of the 1nput.\", (string)\"the number of odd elements 8n the str8ng 8 of the 8nput.\"}))));\n Debug.Assert(OddCount((new List(new string[]{(string)\"271\", (string)\"137\", (string)\"314\"}))).Equals((new List(new string[]{(string)\"the number of odd elements 2n the str2ng 2 of the 2nput.\", (string)\"the number of odd elements 3n the str3ng 3 of the 3nput.\", (string)\"the number of odd elements 2n the str2ng 2 of the 2nput.\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // brackets is a string of \"(\" and \")\".\n // return True if every opening bracket has a corresponding closing bracket.\n // >>> CorrectBracketing((\"(\"))\n // (false)\n // >>> CorrectBracketing((\"()\"))\n // (true)\n // >>> CorrectBracketing((\"(()())\"))\n // (true)\n // >>> CorrectBracketing((\")(()\"))\n // (false)\n public static bool CorrectBracketing(string brackets) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CorrectBracketing((\"()\")) == (true));\n Debug.Assert(CorrectBracketing((\"(()())\")) == (true));\n Debug.Assert(CorrectBracketing((\"()()(()())()\")) == (true));\n Debug.Assert(CorrectBracketing((\"()()((()()())())(()()(()))\")) == (true));\n Debug.Assert(CorrectBracketing((\"((()())))\")) == (false));\n Debug.Assert(CorrectBracketing((\")(()\")) == (false));\n Debug.Assert(CorrectBracketing((\"(\")) == (false));\n Debug.Assert(CorrectBracketing((\"((((\")) == (false));\n Debug.Assert(CorrectBracketing((\")\")) == (false));\n Debug.Assert(CorrectBracketing((\"(()\")) == (false));\n Debug.Assert(CorrectBracketing((\"()()(()())())(()\")) == (false));\n Debug.Assert(CorrectBracketing((\"()()(()())()))()\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Task\n // Write a function that takes a string as input and returns the sum of the upper characters only'\n // ASCII codes.\n // Examples:\n // >>> Digitsum((\"\"))\n // (0L)\n // >>> Digitsum((\"abAB\"))\n // (131L)\n // >>> Digitsum((\"abcCd\"))\n // (67L)\n // >>> Digitsum((\"helloE\"))\n // (69L)\n // >>> Digitsum((\"woArBld\"))\n // (131L)\n // >>> Digitsum((\"aAaaaXa\"))\n // (153L)\n public static long Digitsum(string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Digitsum((\"\")) == (0L));\n Debug.Assert(Digitsum((\"abAB\")) == (131L));\n Debug.Assert(Digitsum((\"abcCd\")) == (67L));\n Debug.Assert(Digitsum((\"helloE\")) == (69L));\n Debug.Assert(Digitsum((\"woArBld\")) == (131L));\n Debug.Assert(Digitsum((\"aAaaaXa\")) == (153L));\n Debug.Assert(Digitsum((\" How are yOu?\")) == (151L));\n Debug.Assert(Digitsum((\"You arE Very Smart\")) == (327L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that accepts a list of strings as a parameter,\n // deletes the strings that have odd lengths from it,\n // and returns the resulted list with a sorted order,\n // The list is always a list of strings and never an array of numbers,\n // and it may contain duplicates.\n // The order of the list should be ascending by length of each word, and you\n // should return the list sorted by that rule.\n // If two words have the same length, sort the list alphabetically.\n // The function should return a list of strings in sorted order.\n // You may assume that all words will have the same length.\n // For example:\n // >>> ListSort((new List(new string[]{(string)\"aa\", (string)\"a\", (string)\"aaa\"})))\n // (new List(new string[]{(string)\"aa\"}))\n // >>> ListSort((new List(new string[]{(string)\"ab\", (string)\"a\", (string)\"aaa\", (string)\"cd\"})))\n // (new List(new string[]{(string)\"ab\", (string)\"cd\"}))\n public static List SortedListSum(List lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SortedListSum((new List(new string[]{(string)\"aa\", (string)\"a\", (string)\"aaa\"}))).Equals((new List(new string[]{(string)\"aa\"}))));\n Debug.Assert(SortedListSum((new List(new string[]{(string)\"school\", (string)\"AI\", (string)\"asdf\", (string)\"b\"}))).Equals((new List(new string[]{(string)\"AI\", (string)\"asdf\", (string)\"school\"}))));\n Debug.Assert(SortedListSum((new List(new string[]{(string)\"d\", (string)\"b\", (string)\"c\", (string)\"a\"}))).Equals((new List())));\n Debug.Assert(SortedListSum((new List(new string[]{(string)\"d\", (string)\"dcba\", (string)\"abcd\", (string)\"a\"}))).Equals((new List(new string[]{(string)\"abcd\", (string)\"dcba\"}))));\n Debug.Assert(SortedListSum((new List(new string[]{(string)\"AI\", (string)\"ai\", (string)\"au\"}))).Equals((new List(new string[]{(string)\"AI\", (string)\"ai\", (string)\"au\"}))));\n Debug.Assert(SortedListSum((new List(new string[]{(string)\"a\", (string)\"b\", (string)\"b\", (string)\"c\", (string)\"c\", (string)\"a\"}))).Equals((new List())));\n Debug.Assert(SortedListSum((new List(new string[]{(string)\"aaaa\", (string)\"bbbb\", (string)\"dd\", (string)\"cc\"}))).Equals((new List(new string[]{(string)\"cc\", (string)\"dd\", (string)\"aaaa\", (string)\"bbbb\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given an array arr of integers and you need to return\n // sum of magnitudes of integers multiplied by product of all signs\n // of each number in the array, represented by 1, -1 or 0.\n // Note: return None for empty arr.\n // Example:\n // >>> ProdSigns((new List(new long[]{(long)1L, (long)2L, (long)2L, (long)-4L})))\n // 9L\n // >>> ProdSigns((new List(new long[]{(long)0L, (long)1L})))\n // 0L\n // >>> ProdSigns((new List()))\n // null\n public static Nullable ProdSigns(List arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ProdSigns((new List(new long[]{(long)1L, (long)2L, (long)2L, (long)-4L}))).Equals(-9L));\n Debug.Assert(ProdSigns((new List(new long[]{(long)0L, (long)1L}))).Equals(0L));\n Debug.Assert(ProdSigns((new List(new long[]{(long)1L, (long)1L, (long)1L, (long)2L, (long)3L, (long)-1L, (long)1L}))).Equals(-10L));\n Debug.Assert(ProdSigns((new List())).Equals(null));\n Debug.Assert(ProdSigns((new List(new long[]{(long)2L, (long)4L, (long)1L, (long)2L, (long)-1L, (long)-1L, (long)9L}))).Equals(20L));\n Debug.Assert(ProdSigns((new List(new long[]{(long)-1L, (long)1L, (long)-1L, (long)1L}))).Equals(4L));\n Debug.Assert(ProdSigns((new List(new long[]{(long)-1L, (long)1L, (long)1L, (long)1L}))).Equals(-4L));\n Debug.Assert(ProdSigns((new List(new long[]{(long)-1L, (long)1L, (long)1L, (long)0L}))).Equals(0L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return list with elements incremented by 1.\n // >>> IncrList((new List(new long[]{(long)1L, (long)2L, (long)3L})))\n // (new List(new long[]{(long)2L, (long)3L, (long)4L}))\n // >>> IncrList((new List(new long[]{(long)5L, (long)3L, (long)5L, (long)2L, (long)3L, (long)3L, (long)9L, (long)0L, (long)123L})))\n // (new List(new long[]{(long)6L, (long)4L, (long)6L, (long)3L, (long)4L, (long)4L, (long)10L, (long)1L, (long)124L}))\n public static List IncrList(List l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IncrList((new List())).Equals((new List())));\n Debug.Assert(IncrList((new List(new long[]{(long)3L, (long)2L, (long)1L}))).Equals((new List(new long[]{(long)4L, (long)3L, (long)2L}))));\n Debug.Assert(IncrList((new List(new long[]{(long)5L, (long)2L, (long)5L, (long)2L, (long)3L, (long)3L, (long)9L, (long)0L, (long)123L}))).Equals((new List(new long[]{(long)6L, (long)3L, (long)6L, (long)3L, (long)4L, (long)4L, (long)10L, (long)1L, (long)124L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // From a given list of integers, generate a list of rolling maximum element found until given moment\n // in the sequence.\n // >>> RollingMax((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)2L, (long)3L, (long)4L, (long)2L})))\n // (new List(new long[]{(long)1L, (long)2L, (long)3L, (long)3L, (long)3L, (long)4L, (long)4L}))\n public static List RollingMax(List numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(RollingMax((new List())).Equals((new List())));\n Debug.Assert(RollingMax((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))).Equals((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))));\n Debug.Assert(RollingMax((new List(new long[]{(long)4L, (long)3L, (long)2L, (long)1L}))).Equals((new List(new long[]{(long)4L, (long)4L, (long)4L, (long)4L}))));\n Debug.Assert(RollingMax((new List(new long[]{(long)3L, (long)2L, (long)3L, (long)100L, (long)3L}))).Equals((new List(new long[]{(long)3L, (long)3L, (long)3L, (long)100L, (long)100L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n // separate those group into separate strings and return the list of those.\n // Separate groups are balanced (each open brace is properly closed) and not nested within each other\n // Ignore any spaces in the input string.\n // >>> SeparateParenGroups((\"( ) (( )) (( )( ))\"))\n // (new List(new string[]{(string)\"()\", (string)\"(())\", (string)\"(()())\"}))\n public static List SeparateParenGroups(string paren_string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SeparateParenGroups((\"(()()) ((())) () ((())()())\")).Equals((new List(new string[]{(string)\"(()())\", (string)\"((()))\", (string)\"()\", (string)\"((())()())\"}))));\n Debug.Assert(SeparateParenGroups((\"() (()) ((())) (((())))\")).Equals((new List(new string[]{(string)\"()\", (string)\"(())\", (string)\"((()))\", (string)\"(((())))\"}))));\n Debug.Assert(SeparateParenGroups((\"(()(())((())))\")).Equals((new List(new string[]{(string)\"(()(())((())))\"}))));\n Debug.Assert(SeparateParenGroups((\"( ) (( )) (( )( ))\")).Equals((new List(new string[]{(string)\"()\", (string)\"(())\", (string)\"(()())\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You will be given a string of words separated by commas or spaces. Your task is\n // to split the string into words and return an array of the words.\n // For example:\n // >>> WordsString((\"Hi, my name is John\"))\n // (new List(new string[]{(string)\"Hi\", (string)\"my\", (string)\"name\", (string)\"is\", (string)\"John\"}))\n // >>> WordsString((\"One, two, three, four, five, six\"))\n // (new List(new string[]{(string)\"One\", (string)\"two\", (string)\"three\", (string)\"four\", (string)\"five\", (string)\"six\"}))\n public static List WordsString(string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(WordsString((\"Hi, my name is John\")).Equals((new List(new string[]{(string)\"Hi\", (string)\"my\", (string)\"name\", (string)\"is\", (string)\"John\"}))));\n Debug.Assert(WordsString((\"One, two, three, four, five, six\")).Equals((new List(new string[]{(string)\"One\", (string)\"two\", (string)\"three\", (string)\"four\", (string)\"five\", (string)\"six\"}))));\n Debug.Assert(WordsString((\"Hi, my name\")).Equals((new List(new string[]{(string)\"Hi\", (string)\"my\", (string)\"name\"}))));\n Debug.Assert(WordsString((\"One,, two, three, four, five, six,\")).Equals((new List(new string[]{(string)\"One\", (string)\"two\", (string)\"three\", (string)\"four\", (string)\"five\", (string)\"six\"}))));\n Debug.Assert(WordsString((\"\")).Equals((new List())));\n Debug.Assert(WordsString((\"ahmed , gamal\")).Equals((new List(new string[]{(string)\"ahmed\", (string)\"gamal\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Filter given list of any python values only for integers\n // >>> FilterIntegers((new List(new string[]{(string)\"a\", (string)3.14f, (string)5L})))\n // (new List(new long[]{(long)5L}))\n // >>> FilterIntegers((new List(new object[]{1L, 2L, 3L, \"abc\", new List()})))\n // (new List(new long[]{(long)1L, (long)2L, (long)3L}))\n public static List FilterIntegers(List values) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FilterIntegers((new List())).Equals((new List())));\n Debug.Assert(FilterIntegers((new List(new object[]{4L, new List(), 23.2f, 9L, \"adasd\"}))).Equals((new List(new long[]{(long)4L, (long)9L}))));\n Debug.Assert(FilterIntegers((new List(new object[]{3L, \"c\", 3L, 3L, \"a\", \"b\"}))).Equals((new List(new long[]{(long)3L, (long)3L, (long)3L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // This function takes a list l and returns a list l' such that\n // l' is identical to l in the odd indicies, while its values at the even indicies are equal\n // to the values of the even indicies of l, but sorted.\n // >>> SortEven((new List(new long[]{(long)1L, (long)2L, (long)3L})))\n // (new List(new long[]{(long)1L, (long)2L, (long)3L}))\n // >>> SortEven((new List(new long[]{(long)5L, (long)6L, (long)3L, (long)4L})))\n // (new List(new long[]{(long)3L, (long)6L, (long)5L, (long)4L}))\n public static List SortEven(List l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SortEven((new List(new long[]{(long)1L, (long)2L, (long)3L}))).Equals((new List(new long[]{(long)1L, (long)2L, (long)3L}))));\n Debug.Assert(SortEven((new List(new long[]{(long)5L, (long)3L, (long)-5L, (long)2L, (long)-3L, (long)3L, (long)9L, (long)0L, (long)123L, (long)1L, (long)-10L}))).Equals((new List(new long[]{(long)-10L, (long)3L, (long)-5L, (long)2L, (long)-3L, (long)3L, (long)5L, (long)0L, (long)9L, (long)1L, (long)123L}))));\n Debug.Assert(SortEven((new List(new long[]{(long)5L, (long)8L, (long)-12L, (long)4L, (long)23L, (long)2L, (long)3L, (long)11L, (long)12L, (long)-10L}))).Equals((new List(new long[]{(long)-12L, (long)8L, (long)3L, (long)4L, (long)5L, (long)2L, (long)12L, (long)11L, (long)23L, (long)-10L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // I think we all remember that feeling when the result of some long-awaited\n // event is finally known. The feelings and thoughts you have at that moment are\n // definitely worth noting down and comparing.\n // Your task is to determine if a person correctly guessed the results of a number of matches.\n // You are given two arrays of scores and guesses of equal length, where each index shows a match. \n // Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n // the value is 0, and if not, the value is the absolute difference between the guess and the score.\n // example:\n // >>> Compare((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)1L})), (new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)2L, (long)-2L})))\n // (new List(new long[]{(long)0L, (long)0L, (long)0L, (long)0L, (long)3L, (long)3L}))\n // >>> Compare((new List(new long[]{(long)0L, (long)5L, (long)0L, (long)0L, (long)0L, (long)4L})), (new List(new long[]{(long)4L, (long)1L, (long)1L, (long)0L, (long)0L, (long)-2L})))\n // (new List(new long[]{(long)4L, (long)4L, (long)1L, (long)0L, (long)0L, (long)6L}))\n public static List Compare(List game, List guess) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Compare((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)1L})), (new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)2L, (long)-2L}))).Equals((new List(new long[]{(long)0L, (long)0L, (long)0L, (long)0L, (long)3L, (long)3L}))));\n Debug.Assert(Compare((new List(new long[]{(long)0L, (long)0L, (long)0L, (long)0L, (long)0L, (long)0L})), (new List(new long[]{(long)0L, (long)0L, (long)0L, (long)0L, (long)0L, (long)0L}))).Equals((new List(new long[]{(long)0L, (long)0L, (long)0L, (long)0L, (long)0L, (long)0L}))));\n Debug.Assert(Compare((new List(new long[]{(long)1L, (long)2L, (long)3L})), (new List(new long[]{(long)-1L, (long)-2L, (long)-3L}))).Equals((new List(new long[]{(long)2L, (long)4L, (long)6L}))));\n Debug.Assert(Compare((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)5L})), (new List(new long[]{(long)-1L, (long)2L, (long)3L, (long)4L}))).Equals((new List(new long[]{(long)2L, (long)0L, (long)0L, (long)1L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a positive integer n, return a tuple that has the number of even and odd\n // integer palindromes that fall within the range(1, n), inclusive.\n // Example 1:\n // >>> EvenOddPalindrome((3L))\n // (Tuple.Create(1L, 2L))\n // Explanation:\n // Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n // Example 2:\n // >>> EvenOddPalindrome((12L))\n // (Tuple.Create(4L, 6L))\n // Explanation:\n // Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n // Note:\n // 1. 1 <= n <= 10^3\n // 2. returned tuple has the number of even and odd integer palindromes respectively.\n public static Tuple EvenOddPalindrome(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(EvenOddPalindrome((123L)).Equals((Tuple.Create(8L, 13L))));\n Debug.Assert(EvenOddPalindrome((12L)).Equals((Tuple.Create(4L, 6L))));\n Debug.Assert(EvenOddPalindrome((3L)).Equals((Tuple.Create(1L, 2L))));\n Debug.Assert(EvenOddPalindrome((63L)).Equals((Tuple.Create(6L, 8L))));\n Debug.Assert(EvenOddPalindrome((25L)).Equals((Tuple.Create(5L, 6L))));\n Debug.Assert(EvenOddPalindrome((19L)).Equals((Tuple.Create(4L, 6L))));\n Debug.Assert(EvenOddPalindrome((9L)).Equals((Tuple.Create(4L, 5L))));\n Debug.Assert(EvenOddPalindrome((1L)).Equals((Tuple.Create(0L, 1L))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n // fib4(0) -> 0\n // fib4(1) -> 0\n // fib4(2) -> 2\n // fib4(3) -> 0\n // fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n // Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n // >>> Fib4((5L))\n // (4L)\n // >>> Fib4((6L))\n // (8L)\n // >>> Fib4((7L))\n // (14L)\n public static long Fib4(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Fib4((5L)) == (4L));\n Debug.Assert(Fib4((8L)) == (28L));\n Debug.Assert(Fib4((10L)) == (104L));\n Debug.Assert(Fib4((12L)) == (386L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given two positive integers a and b, return the even digits between a\n // and b, in ascending order.\n // For example:\n // >>> GenerateIntegers((2L), (8L))\n // (new List(new long[]{(long)2L, (long)4L, (long)6L, (long)8L}))\n // >>> GenerateIntegers((8L), (2L))\n // (new List(new long[]{(long)2L, (long)4L, (long)6L, (long)8L}))\n // >>> GenerateIntegers((10L), (14L))\n // (new List())\n public static List GenerateIntegers(long a, long b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(GenerateIntegers((2L), (10L)).Equals((new List(new long[]{(long)2L, (long)4L, (long)6L, (long)8L}))));\n Debug.Assert(GenerateIntegers((10L), (2L)).Equals((new List(new long[]{(long)2L, (long)4L, (long)6L, (long)8L}))));\n Debug.Assert(GenerateIntegers((132L), (2L)).Equals((new List(new long[]{(long)2L, (long)4L, (long)6L, (long)8L}))));\n Debug.Assert(GenerateIntegers((17L), (89L)).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // For a given list of input numbers, calculate Mean Absolute Deviation\n // around the mean of this dataset.\n // Mean Absolute Deviation is the average absolute difference between each\n // element and a centerpoint (mean in this case):\n // MAD = average | x - x_mean |\n // >>> MeanAbsoluteDeviation((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f})))\n // (1.0f)\n public static float MeanAbsoluteDeviation(List numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(MeanAbsoluteDeviation((new List(new float[]{(float)1.0f, (float)2.0f}))) == (0.5f));\n Debug.Assert(MeanAbsoluteDeviation((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f}))) == (1.0f));\n Debug.Assert(MeanAbsoluteDeviation((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f}))) == (1.2f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function encrypt that takes a string as an argument and\n // returns a string encrypted with the alphabet being rotated. \n // The alphabet should be rotated in a manner such that the letters \n // shift down by two multiplied to two places.\n // For example:\n // >>> Encrypt((\"hi\"))\n // (\"lm\")\n // >>> Encrypt((\"asdfghjkl\"))\n // (\"ewhjklnop\")\n // >>> Encrypt((\"gf\"))\n // (\"kj\")\n // >>> Encrypt((\"et\"))\n // (\"ix\")\n public static string Encrypt(string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Encrypt((\"hi\")).Equals((\"lm\")));\n Debug.Assert(Encrypt((\"asdfghjkl\")).Equals((\"ewhjklnop\")));\n Debug.Assert(Encrypt((\"gf\")).Equals((\"kj\")));\n Debug.Assert(Encrypt((\"et\")).Equals((\"ix\")));\n Debug.Assert(Encrypt((\"faewfawefaewg\")).Equals((\"jeiajeaijeiak\")));\n Debug.Assert(Encrypt((\"hellomyfriend\")).Equals((\"lippsqcjvmirh\")));\n Debug.Assert(Encrypt((\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\")).Equals((\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\")));\n Debug.Assert(Encrypt((\"a\")).Equals((\"e\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n // The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n // as follows: start with any positive integer n. Then each term is obtained from the \n // previous term as follows: if the previous term is even, the next term is one half of \n // the previous term. If the previous term is odd, the next term is 3 times the previous\n // term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n // Note: \n // 1. Collatz(1) is [1].\n // 2. returned list sorted in increasing order.\n // For example:\n // get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n // >>> GetOddCollatz((5L))\n // (new List(new long[]{(long)1L, (long)5L}))\n public static List GetOddCollatz(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(GetOddCollatz((14L)).Equals((new List(new long[]{(long)1L, (long)5L, (long)7L, (long)11L, (long)13L, (long)17L}))));\n Debug.Assert(GetOddCollatz((5L)).Equals((new List(new long[]{(long)1L, (long)5L}))));\n Debug.Assert(GetOddCollatz((12L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)5L}))));\n Debug.Assert(GetOddCollatz((1L)).Equals((new List(new long[]{(long)1L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Find how many times a given substring can be found in the original string. Count overlaping cases.\n // >>> HowManyTimes((\"\"), (\"a\"))\n // (0L)\n // >>> HowManyTimes((\"aaa\"), (\"a\"))\n // (3L)\n // >>> HowManyTimes((\"aaaa\"), (\"aa\"))\n // (3L)\n public static long HowManyTimes(string str, string substring) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(HowManyTimes((\"\"), (\"x\")) == (0L));\n Debug.Assert(HowManyTimes((\"xyxyxyx\"), (\"x\")) == (4L));\n Debug.Assert(HowManyTimes((\"cacacacac\"), (\"cac\")) == (4L));\n Debug.Assert(HowManyTimes((\"john doe\"), (\"john\")) == (1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n // numbers in the array will be randomly ordered. Your task is to determine if\n // it is possible to get an array sorted in non-decreasing order by performing \n // the following operation on the given array:\n // You are allowed to perform right shift operation any number of times.\n // One right shift operation means shifting all elements of the array by one\n // position in the right direction. The last element of the array will be moved to\n // the starting position in the array i.e. 0th index. \n // If it is possible to obtain the sorted array by performing the above operation\n // then return True else return False.\n // If the given array is empty then return True.\n // Note: The given list is guaranteed to have unique elements.\n // For Example:\n // >>> MoveOneBall((new List(new long[]{(long)3L, (long)4L, (long)5L, (long)1L, (long)2L})))\n // (true)\n // Explanation: By performin 2 right shift operations, non-decreasing order can\n // be achieved for the given array.\n // >>> MoveOneBall((new List(new long[]{(long)3L, (long)5L, (long)4L, (long)1L, (long)2L})))\n // (false)\n // Explanation:It is not possible to get non-decreasing order for the given\n // array by performing any number of right shift operations.\n public static bool MoveOneBall(List arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(MoveOneBall((new List(new long[]{(long)3L, (long)4L, (long)5L, (long)1L, (long)2L}))) == (true));\n Debug.Assert(MoveOneBall((new List(new long[]{(long)3L, (long)5L, (long)10L, (long)1L, (long)2L}))) == (true));\n Debug.Assert(MoveOneBall((new List(new long[]{(long)4L, (long)3L, (long)1L, (long)2L}))) == (false));\n Debug.Assert(MoveOneBall((new List(new long[]{(long)3L, (long)5L, (long)4L, (long)1L, (long)2L}))) == (false));\n Debug.Assert(MoveOneBall((new List())) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function which sorts the given list of integers\n // in ascending order according to the sum of their digits.\n // Note: if there are several items with similar sum of their digits,\n // order them based on their index in original list.\n // For example:\n // >>> OrderByPoints((new List(new long[]{(long)1L, (long)11L, (long)-1L, (long)-11L, (long)-12L})))\n // (new List(new long[]{(long)-1L, (long)-11L, (long)1L, (long)-12L, (long)11L}))\n // >>> OrderByPoints((new List()))\n // (new List())\n public static List OrderByPoints(List nums) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(OrderByPoints((new List(new long[]{(long)1L, (long)11L, (long)-1L, (long)-11L, (long)-12L}))).Equals((new List(new long[]{(long)-1L, (long)-11L, (long)1L, (long)-12L, (long)11L}))));\n Debug.Assert(OrderByPoints((new List(new long[]{(long)1234L, (long)423L, (long)463L, (long)145L, (long)2L, (long)423L, (long)423L, (long)53L, (long)6L, (long)37L, (long)3457L, (long)3L, (long)56L, (long)0L, (long)46L}))).Equals((new List(new long[]{(long)0L, (long)2L, (long)3L, (long)6L, (long)53L, (long)423L, (long)423L, (long)423L, (long)1234L, (long)145L, (long)37L, (long)46L, (long)56L, (long)463L, (long)3457L}))));\n Debug.Assert(OrderByPoints((new List())).Equals((new List())));\n Debug.Assert(OrderByPoints((new List(new long[]{(long)1L, (long)-11L, (long)-32L, (long)43L, (long)54L, (long)-98L, (long)2L, (long)-3L}))).Equals((new List(new long[]{(long)-3L, (long)-32L, (long)-98L, (long)-11L, (long)1L, (long)2L, (long)43L, (long)54L}))));\n Debug.Assert(OrderByPoints((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L, (long)7L, (long)8L, (long)9L, (long)10L, (long)11L}))).Equals((new List(new long[]{(long)1L, (long)10L, (long)2L, (long)11L, (long)3L, (long)4L, (long)5L, (long)6L, (long)7L, (long)8L, (long)9L}))));\n Debug.Assert(OrderByPoints((new List(new long[]{(long)0L, (long)6L, (long)6L, (long)-76L, (long)-21L, (long)23L, (long)4L}))).Equals((new List(new long[]{(long)-76L, (long)-21L, (long)0L, (long)4L, (long)23L, (long)6L, (long)6L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return list of prime factors of given integer in the order from smallest to largest.\n // Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n // Input number should be equal to the product of all factors\n // >>> Factorize((8L))\n // (new List(new long[]{(long)2L, (long)2L, (long)2L}))\n // >>> Factorize((25L))\n // (new List(new long[]{(long)5L, (long)5L}))\n // >>> Factorize((70L))\n // (new List(new long[]{(long)2L, (long)5L, (long)7L}))\n public static List Factorize(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Factorize((2L)).Equals((new List(new long[]{(long)2L}))));\n Debug.Assert(Factorize((4L)).Equals((new List(new long[]{(long)2L, (long)2L}))));\n Debug.Assert(Factorize((8L)).Equals((new List(new long[]{(long)2L, (long)2L, (long)2L}))));\n Debug.Assert(Factorize((57L)).Equals((new List(new long[]{(long)3L, (long)19L}))));\n Debug.Assert(Factorize((3249L)).Equals((new List(new long[]{(long)3L, (long)3L, (long)19L, (long)19L}))));\n Debug.Assert(Factorize((185193L)).Equals((new List(new long[]{(long)3L, (long)3L, (long)3L, (long)19L, (long)19L, (long)19L}))));\n Debug.Assert(Factorize((20577L)).Equals((new List(new long[]{(long)3L, (long)19L, (long)19L, (long)19L}))));\n Debug.Assert(Factorize((18L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)3L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return True if all numbers in the list l are below threshold t.\n // >>> BelowThreshold((new List(new long[]{(long)1L, (long)2L, (long)4L, (long)10L})), (100L))\n // (true)\n // >>> BelowThreshold((new List(new long[]{(long)1L, (long)20L, (long)4L, (long)10L})), (5L))\n // (false)\n public static bool BelowThreshold(List l, long t) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(BelowThreshold((new List(new long[]{(long)1L, (long)2L, (long)4L, (long)10L})), (100L)) == (true));\n Debug.Assert(BelowThreshold((new List(new long[]{(long)1L, (long)20L, (long)4L, (long)10L})), (5L)) == (false));\n Debug.Assert(BelowThreshold((new List(new long[]{(long)1L, (long)20L, (long)4L, (long)10L})), (21L)) == (true));\n Debug.Assert(BelowThreshold((new List(new long[]{(long)1L, (long)20L, (long)4L, (long)10L})), (22L)) == (true));\n Debug.Assert(BelowThreshold((new List(new long[]{(long)1L, (long)8L, (long)4L, (long)10L})), (11L)) == (true));\n Debug.Assert(BelowThreshold((new List(new long[]{(long)1L, (long)8L, (long)4L, (long)10L})), (10L)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n // For each of the group, output the deepest level of nesting of parentheses.\n // E.g. (()()) has maximum two levels of nesting while ((())) has three.\n // >>> ParseNestedParens((\"(()()) ((())) () ((())()())\"))\n // (new List(new long[]{(long)2L, (long)3L, (long)1L, (long)3L}))\n public static List ParseNestedParens(string paren_string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ParseNestedParens((\"(()()) ((())) () ((())()())\")).Equals((new List(new long[]{(long)2L, (long)3L, (long)1L, (long)3L}))));\n Debug.Assert(ParseNestedParens((\"() (()) ((())) (((())))\")).Equals((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))));\n Debug.Assert(ParseNestedParens((\"(()(())((())))\")).Equals((new List(new long[]{(long)4L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n // Examples\n // >>> Solution((new List(new long[]{(long)5L, (long)8L, (long)7L, (long)1L})))\n // (12L)\n // >>> Solution((new List(new long[]{(long)3L, (long)3L, (long)3L, (long)3L, (long)3L})))\n // (9L)\n // >>> Solution((new List(new long[]{(long)30L, (long)13L, (long)24L, (long)321L})))\n // (0L)\n public static long Solution(List lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Solution((new List(new long[]{(long)5L, (long)8L, (long)7L, (long)1L}))) == (12L));\n Debug.Assert(Solution((new List(new long[]{(long)3L, (long)3L, (long)3L, (long)3L, (long)3L}))) == (9L));\n Debug.Assert(Solution((new List(new long[]{(long)30L, (long)13L, (long)24L, (long)321L}))) == (0L));\n Debug.Assert(Solution((new List(new long[]{(long)5L, (long)9L}))) == (5L));\n Debug.Assert(Solution((new List(new long[]{(long)2L, (long)4L, (long)8L}))) == (0L));\n Debug.Assert(Solution((new List(new long[]{(long)30L, (long)13L, (long)23L, (long)32L}))) == (23L));\n Debug.Assert(Solution((new List(new long[]{(long)3L, (long)13L, (long)2L, (long)9L}))) == (3L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a positive integer n. You have to create an integer array a of length n.\n // For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n // Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n // and a[i] + a[j] + a[k] is a multiple of 3.\n // Example :\n // >>> GetMaxTriples((5L))\n // (1L)\n // Explanation: \n // a = [1, 3, 7, 13, 21]\n // The only valid triple is (1, 7, 13).\n public static long GetMaxTriples(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(GetMaxTriples((5L)) == (1L));\n Debug.Assert(GetMaxTriples((6L)) == (4L));\n Debug.Assert(GetMaxTriples((10L)) == (36L));\n Debug.Assert(GetMaxTriples((100L)) == (53361L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // There are eight planets in our solar system: the closerst to the Sun \n // is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n // Uranus, Neptune.\n // Write a function that takes two planet names as strings planet1 and planet2. \n // The function should return a tuple containing all planets whose orbits are \n // located between the orbit of planet1 and the orbit of planet2, sorted by \n // the proximity to the sun. \n // The function should return an empty tuple if planet1 or planet2\n // are not correct planet names. \n // Examples\n // >>> Bf((\"Jupiter\"), (\"Neptune\"))\n // (new List(new string[]{(string)\"Saturn\", (string)\"Uranus\"}))\n // >>> Bf((\"Earth\"), (\"Mercury\"))\n // (List(\"Venus\"))\n // >>> Bf((\"Mercury\"), (\"Uranus\"))\n // (new List(new string[]{(string)\"Venus\", (string)\"Earth\", (string)\"Mars\", (string)\"Jupiter\", (string)\"Saturn\"}))\n public static List Bf(string planet1, string planet2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Bf((\"Jupiter\"), (\"Neptune\")).Equals((new List(new string[]{(string)\"Saturn\", (string)\"Uranus\"}))));\n Debug.Assert(Bf((\"Earth\"), (\"Mercury\")).Equals((new List(new string[]{(string)\"Venus\"}))));\n Debug.Assert(Bf((\"Mercury\"), (\"Uranus\")).Equals((new List(new string[]{(string)\"Venus\", (string)\"Earth\", (string)\"Mars\", (string)\"Jupiter\", (string)\"Saturn\"}))));\n Debug.Assert(Bf((\"Neptune\"), (\"Venus\")).Equals((new List(new string[]{(string)\"Earth\", (string)\"Mars\", (string)\"Jupiter\", (string)\"Saturn\", (string)\"Uranus\"}))));\n Debug.Assert(Bf((\"Earth\"), (\"Earth\")).Equals((new List())));\n Debug.Assert(Bf((\"Mars\"), (\"Earth\")).Equals((new List())));\n Debug.Assert(Bf((\"Jupiter\"), (\"Makemake\")).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a list of integers.\n // Write a function next_smallest() that returns the 2nd smallest element of the list.\n // Return None if there is no such element.\n // >>> NextSmallest((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L})))\n // 2L\n // >>> NextSmallest((new List(new long[]{(long)5L, (long)1L, (long)4L, (long)3L, (long)2L})))\n // 2L\n // >>> NextSmallest((new List()))\n // null\n // >>> NextSmallest((new List(new long[]{(long)1L, (long)1L})))\n // null\n public static Nullable NextSmallest(List lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(NextSmallest((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L}))).Equals(2L));\n Debug.Assert(NextSmallest((new List(new long[]{(long)5L, (long)1L, (long)4L, (long)3L, (long)2L}))).Equals(2L));\n Debug.Assert(NextSmallest((new List())).Equals(null));\n Debug.Assert(NextSmallest((new List(new long[]{(long)1L, (long)1L}))).Equals(null));\n Debug.Assert(NextSmallest((new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L, (long)0L}))).Equals(1L));\n Debug.Assert(NextSmallest((new List(new long[]{(long)1L, (long)1L}))).Equals(null));\n Debug.Assert(NextSmallest((new List(new long[]{(long)-35L, (long)34L, (long)12L, (long)-45L}))).Equals(-35L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Input is a space-delimited string of numberals from 'zero' to 'nine'.\n // Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n // Return the string with numbers sorted from smallest to largest\n // >>> SortNumbers((\"three one five\"))\n // (\"one three five\")\n public static string SortNumbers(string numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SortNumbers((\"\")).Equals((\"\")));\n Debug.Assert(SortNumbers((\"three\")).Equals((\"three\")));\n Debug.Assert(SortNumbers((\"three five nine\")).Equals((\"three five nine\")));\n Debug.Assert(SortNumbers((\"five zero four seven nine eight\")).Equals((\"zero four five seven eight nine\")));\n Debug.Assert(SortNumbers((\"six five four three two one zero\")).Equals((\"zero one two three four five six\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n // >>> CycpatternCheck((\"abcd\"), (\"abd\"))\n // (false)\n // >>> CycpatternCheck((\"hello\"), (\"ell\"))\n // (true)\n // >>> CycpatternCheck((\"whassup\"), (\"psus\"))\n // (false)\n // >>> CycpatternCheck((\"abab\"), (\"baa\"))\n // (true)\n // >>> CycpatternCheck((\"efef\"), (\"eeff\"))\n // (false)\n // >>> CycpatternCheck((\"himenss\"), (\"simen\"))\n // (true)\n public static bool CycpatternCheck(string a, string b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CycpatternCheck((\"xyzw\"), (\"xyw\")) == (false));\n Debug.Assert(CycpatternCheck((\"yello\"), (\"ell\")) == (true));\n Debug.Assert(CycpatternCheck((\"whattup\"), (\"ptut\")) == (false));\n Debug.Assert(CycpatternCheck((\"efef\"), (\"fee\")) == (true));\n Debug.Assert(CycpatternCheck((\"abab\"), (\"aabb\")) == (false));\n Debug.Assert(CycpatternCheck((\"winemtt\"), (\"tinem\")) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You will be given a number in decimal form and your task is to convert it to\n // binary format. The function should return a string, with each character representing a binary\n // number. Each character in the string will be '0' or '1'.\n // There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n // The extra characters are there to help with the format.\n // Examples:\n // >>> DecimalToBinary((15L))\n // (\"db1111db\")\n // >>> DecimalToBinary((32L))\n // (\"db100000db\")\n public static string DecimalToBinary(long decimalNum) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(DecimalToBinary((0L)).Equals((\"db0db\")));\n Debug.Assert(DecimalToBinary((32L)).Equals((\"db100000db\")));\n Debug.Assert(DecimalToBinary((103L)).Equals((\"db1100111db\")));\n Debug.Assert(DecimalToBinary((15L)).Equals((\"db1111db\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Filter an input list of strings only for ones that contain given substring\n // >>> FilterBySubstring((new List()), (\"a\"))\n // (new List())\n // >>> FilterBySubstring((new List(new string[]{(string)\"abc\", (string)\"bacd\", (string)\"cde\", (string)\"array\"})), (\"a\"))\n // (new List(new string[]{(string)\"abc\", (string)\"bacd\", (string)\"array\"}))\n public static List FilterBySubstring(List strings, string substring) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FilterBySubstring((new List()), (\"john\")).Equals((new List())));\n Debug.Assert(FilterBySubstring((new List(new string[]{(string)\"xxx\", (string)\"asd\", (string)\"xxy\", (string)\"john doe\", (string)\"xxxAAA\", (string)\"xxx\"})), (\"xxx\")).Equals((new List(new string[]{(string)\"xxx\", (string)\"xxxAAA\", (string)\"xxx\"}))));\n Debug.Assert(FilterBySubstring((new List(new string[]{(string)\"xxx\", (string)\"asd\", (string)\"aaaxxy\", (string)\"john doe\", (string)\"xxxAAA\", (string)\"xxx\"})), (\"xx\")).Equals((new List(new string[]{(string)\"xxx\", (string)\"aaaxxy\", (string)\"xxxAAA\", (string)\"xxx\"}))));\n Debug.Assert(FilterBySubstring((new List(new string[]{(string)\"grunt\", (string)\"trumpet\", (string)\"prune\", (string)\"gruesome\"})), (\"run\")).Equals((new List(new string[]{(string)\"grunt\", (string)\"prune\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given an integer. return a tuple that has the number of even and odd digits respectively.\n // Example:\n // >>> EvenOddCount((-12L))\n // (Tuple.Create(1L, 1L))\n // >>> EvenOddCount((123L))\n // (Tuple.Create(1L, 2L))\n public static Tuple EvenOddCount(long num) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(EvenOddCount((7L)).Equals((Tuple.Create(0L, 1L))));\n Debug.Assert(EvenOddCount((-78L)).Equals((Tuple.Create(1L, 1L))));\n Debug.Assert(EvenOddCount((3452L)).Equals((Tuple.Create(2L, 2L))));\n Debug.Assert(EvenOddCount((346211L)).Equals((Tuple.Create(3L, 3L))));\n Debug.Assert(EvenOddCount((-345821L)).Equals((Tuple.Create(3L, 3L))));\n Debug.Assert(EvenOddCount((-2L)).Equals((Tuple.Create(1L, 0L))));\n Debug.Assert(EvenOddCount((-45347L)).Equals((Tuple.Create(2L, 3L))));\n Debug.Assert(EvenOddCount((0L)).Equals((Tuple.Create(1L, 0L))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that accepts a list of strings.\n // The list contains different words. Return the word with maximum number\n // of unique characters. If multiple strings have maximum number of unique\n // characters, return the one which comes first in lexicographical order.\n // >>> FindMax((new List(new string[]{(string)\"name\", (string)\"of\", (string)\"string\"})))\n // (\"string\")\n // >>> FindMax((new List(new string[]{(string)\"name\", (string)\"enam\", (string)\"game\"})))\n // (\"enam\")\n // >>> FindMax((new List(new string[]{(string)\"aaaaaaa\", (string)\"bb\", (string)\"cc\"})))\n // (\"aaaaaaa\")\n public static string FindMax(List words) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FindMax((new List(new string[]{(string)\"name\", (string)\"of\", (string)\"string\"}))).Equals((\"string\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"name\", (string)\"enam\", (string)\"game\"}))).Equals((\"enam\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"aaaaaaa\", (string)\"bb\", (string)\"cc\"}))).Equals((\"aaaaaaa\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"abc\", (string)\"cba\"}))).Equals((\"abc\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"play\", (string)\"this\", (string)\"game\", (string)\"of\", (string)\"footbott\"}))).Equals((\"footbott\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"we\", (string)\"are\", (string)\"gonna\", (string)\"rock\"}))).Equals((\"gonna\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"we\", (string)\"are\", (string)\"a\", (string)\"mad\", (string)\"nation\"}))).Equals((\"nation\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"this\", (string)\"is\", (string)\"a\", (string)\"prrk\"}))).Equals((\"this\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"b\"}))).Equals((\"b\")));\n Debug.Assert(FindMax((new List(new string[]{(string)\"play\", (string)\"play\", (string)\"play\"}))).Equals((\"play\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a positive integer n, return the count of the numbers of n-digit\n // positive integers that start or end with 1.\n public static long StartsOneEnds(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(StartsOneEnds((1L)) == (1L));\n Debug.Assert(StartsOneEnds((2L)) == (18L));\n Debug.Assert(StartsOneEnds((3L)) == (180L));\n Debug.Assert(StartsOneEnds((4L)) == (1800L));\n Debug.Assert(StartsOneEnds((5L)) == (18000L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function that returns a tuple (a, b), where 'a' is\n // the largest of negative integers, and 'b' is the smallest\n // of positive integers in a list.\n // If there is no negative or positive integers, return them as None.\n // Examples:\n // >>> LargestSmallestIntegers((new List(new long[]{(long)2L, (long)4L, (long)1L, (long)3L, (long)5L, (long)7L})))\n // Tuple.Create((Nullable)null, 1L)\n // >>> LargestSmallestIntegers((new List()))\n // Tuple.Create((Nullable)null, (Nullable)null)\n // >>> LargestSmallestIntegers((new List(new long[]{(long)0L})))\n // Tuple.Create((Nullable)null, (Nullable)null)\n public static Tuple, Nullable> LargestSmallestIntegers(List lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)2L, (long)4L, (long)1L, (long)3L, (long)5L, (long)7L}))).Equals(Tuple.Create((Nullable)null, 1L)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)2L, (long)4L, (long)1L, (long)3L, (long)5L, (long)7L, (long)0L}))).Equals(Tuple.Create((Nullable)null, 1L)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)4L, (long)5L, (long)6L, (long)-2L}))).Equals(Tuple.Create(-2L, 1L)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)4L, (long)5L, (long)3L, (long)6L, (long)2L, (long)7L, (long)-7L}))).Equals(Tuple.Create(-7L, 2L)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)7L, (long)3L, (long)8L, (long)4L, (long)9L, (long)2L, (long)5L, (long)-9L}))).Equals(Tuple.Create(-9L, 2L)));\n Debug.Assert(LargestSmallestIntegers((new List())).Equals(Tuple.Create((Nullable)null, (Nullable)null)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)0L}))).Equals(Tuple.Create((Nullable)null, (Nullable)null)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)-1L, (long)-3L, (long)-5L, (long)-6L}))).Equals(Tuple.Create(-1L, (Nullable)null)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)-1L, (long)-3L, (long)-5L, (long)-6L, (long)0L}))).Equals(Tuple.Create(-1L, (Nullable)null)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)-6L, (long)-4L, (long)-4L, (long)-3L, (long)1L}))).Equals(Tuple.Create(-3L, 1L)));\n Debug.Assert(LargestSmallestIntegers((new List(new long[]{(long)-6L, (long)-4L, (long)-4L, (long)-3L, (long)-100L, (long)1L}))).Equals(Tuple.Create(-3L, 1L)));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // \"Given an array representing a branch of a tree that has non-negative integer nodes\n // your task is to pluck one of the nodes and return it.\n // The plucked node should be the node with the smallest even value.\n // If multiple nodes with the same smallest even value are found return the node that has smallest index.\n // The plucked node should be returned in a list, [ smalest_value, its index ],\n // If there are no even values or the given array is empty, return [].\n // Example 1:\n // >>> Pluck((new List(new long[]{(long)4L, (long)2L, (long)3L})))\n // (new List(new long[]{(long)2L, (long)1L}))\n // Explanation: 2 has the smallest even value, and 2 has the smallest index.\n // Example 2:\n // >>> Pluck((new List(new long[]{(long)1L, (long)2L, (long)3L})))\n // (new List(new long[]{(long)2L, (long)1L}))\n // Explanation: 2 has the smallest even value, and 2 has the smallest index.\n // Example 3:\n // >>> Pluck((new List()))\n // (new List())\n // Example 4:\n // >>> Pluck((new List(new long[]{(long)5L, (long)0L, (long)3L, (long)0L, (long)4L, (long)2L})))\n // (new List(new long[]{(long)0L, (long)1L}))\n // Explanation: 0 is the smallest value, but there are two zeros,\n // so we will choose the first zero, which has the smallest index.\n // Constraints:\n // * 1 <= nodes.length <= 10000\n // * 0 <= node.value\n public static List Pluck(List arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Pluck((new List(new long[]{(long)4L, (long)2L, (long)3L}))).Equals((new List(new long[]{(long)2L, (long)1L}))));\n Debug.Assert(Pluck((new List(new long[]{(long)1L, (long)2L, (long)3L}))).Equals((new List(new long[]{(long)2L, (long)1L}))));\n Debug.Assert(Pluck((new List())).Equals((new List())));\n Debug.Assert(Pluck((new List(new long[]{(long)5L, (long)0L, (long)3L, (long)0L, (long)4L, (long)2L}))).Equals((new List(new long[]{(long)0L, (long)1L}))));\n Debug.Assert(Pluck((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)0L, (long)5L, (long)3L}))).Equals((new List(new long[]{(long)0L, (long)3L}))));\n Debug.Assert(Pluck((new List(new long[]{(long)5L, (long)4L, (long)8L, (long)4L, (long)8L}))).Equals((new List(new long[]{(long)4L, (long)1L}))));\n Debug.Assert(Pluck((new List(new long[]{(long)7L, (long)6L, (long)7L, (long)1L}))).Equals((new List(new long[]{(long)6L, (long)1L}))));\n Debug.Assert(Pluck((new List(new long[]{(long)7L, (long)9L, (long)7L, (long)1L}))).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function count_nums which takes an array of integers and returns\n // the number of elements which has a sum of digits > 0.\n // If a number is negative, then its first signed digit will be negative:\n // e.g. -123 has signed digits -1, 2, and 3.\n // >>> CountNums((new List()))\n // (0L)\n // >>> CountNums((new List(new long[]{(long)-1L, (long)11L, (long)-11L})))\n // (1L)\n // >>> CountNums((new List(new long[]{(long)1L, (long)1L, (long)2L})))\n // (3L)\n public static long CountNums(List arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CountNums((new List())) == (0L));\n Debug.Assert(CountNums((new List(new long[]{(long)-1L, (long)-2L, (long)0L}))) == (0L));\n Debug.Assert(CountNums((new List(new long[]{(long)1L, (long)1L, (long)2L, (long)-2L, (long)3L, (long)4L, (long)5L}))) == (6L));\n Debug.Assert(CountNums((new List(new long[]{(long)1L, (long)6L, (long)9L, (long)-6L, (long)0L, (long)1L, (long)5L}))) == (5L));\n Debug.Assert(CountNums((new List(new long[]{(long)1L, (long)100L, (long)98L, (long)-7L, (long)1L, (long)-1L}))) == (4L));\n Debug.Assert(CountNums((new List(new long[]{(long)12L, (long)23L, (long)34L, (long)-45L, (long)-56L, (long)0L}))) == (5L));\n Debug.Assert(CountNums((new List(new long[]{(long)0L, (long)1L}))) == (1L));\n Debug.Assert(CountNums((new List(new long[]{(long)1L}))) == (1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n // each cell of the grid contains a value. Every integer in the range [1, N * N]\n // inclusive appears exactly once on the cells of the grid.\n // You have to find the minimum path of length k in the grid. You can start\n // from any cell, and in each step you can move to any of the neighbor cells,\n // in other words, you can go to cells which share an edge with you current\n // cell.\n // Please note that a path of length k means visiting exactly k cells (not\n // necessarily distinct).\n // You CANNOT go off the grid.\n // A path A (of length k) is considered less than a path B (of length k) if\n // after making the ordered lists of the values on the cells that A and B go\n // through (let's call them lst_A and lst_B), lst_A is lexicographically less\n // than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n // such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n // lst_A[j] = lst_B[j].\n // It is guaranteed that the answer is unique.\n // Return an ordered list of the values on the cells that the minimum path go through.\n // Examples: \n // >>> Minpath((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)2L, (long)3L}), (List)new List(new long[]{(long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)7L, (long)8L, (long)9L})})), (3L))\n // (new List(new long[]{(long)1L, (long)2L, (long)1L}))\n // >>> Minpath((new List>(new List[]{(List)new List(new long[]{(long)5L, (long)9L, (long)3L}), (List)new List(new long[]{(long)4L, (long)1L, (long)6L}), (List)new List(new long[]{(long)7L, (long)8L, (long)2L})})), (1L))\n // (new List(new long[]{(long)1L}))\n public static List Minpath(List> grid, long k) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)2L, (long)3L}), (List)new List(new long[]{(long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)7L, (long)8L, (long)9L})})), (3L)).Equals((new List(new long[]{(long)1L, (long)2L, (long)1L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)5L, (long)9L, (long)3L}), (List)new List(new long[]{(long)4L, (long)1L, (long)6L}), (List)new List(new long[]{(long)7L, (long)8L, (long)2L})})), (1L)).Equals((new List(new long[]{(long)1L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}), (List)new List(new long[]{(long)5L, (long)6L, (long)7L, (long)8L}), (List)new List(new long[]{(long)9L, (long)10L, (long)11L, (long)12L}), (List)new List(new long[]{(long)13L, (long)14L, (long)15L, (long)16L})})), (4L)).Equals((new List(new long[]{(long)1L, (long)2L, (long)1L, (long)2L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)6L, (long)4L, (long)13L, (long)10L}), (List)new List(new long[]{(long)5L, (long)7L, (long)12L, (long)1L}), (List)new List(new long[]{(long)3L, (long)16L, (long)11L, (long)15L}), (List)new List(new long[]{(long)8L, (long)14L, (long)9L, (long)2L})})), (7L)).Equals((new List(new long[]{(long)1L, (long)10L, (long)1L, (long)10L, (long)1L, (long)10L, (long)1L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)8L, (long)14L, (long)9L, (long)2L}), (List)new List(new long[]{(long)6L, (long)4L, (long)13L, (long)15L}), (List)new List(new long[]{(long)5L, (long)7L, (long)1L, (long)12L}), (List)new List(new long[]{(long)3L, (long)10L, (long)11L, (long)16L})})), (5L)).Equals((new List(new long[]{(long)1L, (long)7L, (long)1L, (long)7L, (long)1L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)11L, (long)8L, (long)7L, (long)2L}), (List)new List(new long[]{(long)5L, (long)16L, (long)14L, (long)4L}), (List)new List(new long[]{(long)9L, (long)3L, (long)15L, (long)6L}), (List)new List(new long[]{(long)12L, (long)13L, (long)10L, (long)1L})})), (9L)).Equals((new List(new long[]{(long)1L, (long)6L, (long)1L, (long)6L, (long)1L, (long)6L, (long)1L, (long)6L, (long)1L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)12L, (long)13L, (long)10L, (long)1L}), (List)new List(new long[]{(long)9L, (long)3L, (long)15L, (long)6L}), (List)new List(new long[]{(long)5L, (long)16L, (long)14L, (long)4L}), (List)new List(new long[]{(long)11L, (long)8L, (long)7L, (long)2L})})), (12L)).Equals((new List(new long[]{(long)1L, (long)6L, (long)1L, (long)6L, (long)1L, (long)6L, (long)1L, (long)6L, (long)1L, (long)6L, (long)1L, (long)6L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)2L, (long)7L, (long)4L}), (List)new List(new long[]{(long)3L, (long)1L, (long)5L}), (List)new List(new long[]{(long)6L, (long)8L, (long)9L})})), (8L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)1L, (long)3L, (long)1L, (long)3L, (long)1L, (long)3L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)6L, (long)1L, (long)5L}), (List)new List(new long[]{(long)3L, (long)8L, (long)9L}), (List)new List(new long[]{(long)2L, (long)7L, (long)4L})})), (8L)).Equals((new List(new long[]{(long)1L, (long)5L, (long)1L, (long)5L, (long)1L, (long)5L, (long)1L, (long)5L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)2L}), (List)new List(new long[]{(long)3L, (long)4L})})), (10L)).Equals((new List(new long[]{(long)1L, (long)2L, (long)1L, (long)2L, (long)1L, (long)2L, (long)1L, (long)2L, (long)1L, (long)2L}))));\n Debug.Assert(Minpath((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)3L}), (List)new List(new long[]{(long)3L, (long)2L})})), (10L)).Equals((new List(new long[]{(long)1L, (long)3L, (long)1L, (long)3L, (long)1L, (long)3L, (long)1L, (long)3L, (long)1L, (long)3L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given list of integers, return list in strange order.\n // Strange sorting, is when you start with the minimum value,\n // then maximum of the remaining integers, then minimum and so on.\n // Examples:\n // >>> StrangeSortList((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L})))\n // (new List(new long[]{(long)1L, (long)4L, (long)2L, (long)3L}))\n // >>> StrangeSortList((new List(new long[]{(long)5L, (long)5L, (long)5L, (long)5L})))\n // (new List(new long[]{(long)5L, (long)5L, (long)5L, (long)5L}))\n // >>> StrangeSortList((new List()))\n // (new List())\n public static List StrangeSortList(List lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(StrangeSortList((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))).Equals((new List(new long[]{(long)1L, (long)4L, (long)2L, (long)3L}))));\n Debug.Assert(StrangeSortList((new List(new long[]{(long)5L, (long)6L, (long)7L, (long)8L, (long)9L}))).Equals((new List(new long[]{(long)5L, (long)9L, (long)6L, (long)8L, (long)7L}))));\n Debug.Assert(StrangeSortList((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L}))).Equals((new List(new long[]{(long)1L, (long)5L, (long)2L, (long)4L, (long)3L}))));\n Debug.Assert(StrangeSortList((new List(new long[]{(long)5L, (long)6L, (long)7L, (long)8L, (long)9L, (long)1L}))).Equals((new List(new long[]{(long)1L, (long)9L, (long)5L, (long)8L, (long)6L, (long)7L}))));\n Debug.Assert(StrangeSortList((new List(new long[]{(long)5L, (long)5L, (long)5L, (long)5L}))).Equals((new List(new long[]{(long)5L, (long)5L, (long)5L, (long)5L}))));\n Debug.Assert(StrangeSortList((new List())).Equals((new List())));\n Debug.Assert(StrangeSortList((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L, (long)7L, (long)8L}))).Equals((new List(new long[]{(long)1L, (long)8L, (long)2L, (long)7L, (long)3L, (long)6L, (long)4L, (long)5L}))));\n Debug.Assert(StrangeSortList((new List(new long[]{(long)0L, (long)2L, (long)2L, (long)2L, (long)5L, (long)5L, (long)-5L, (long)-5L}))).Equals((new List(new long[]{(long)-5L, (long)5L, (long)-5L, (long)5L, (long)0L, (long)2L, (long)2L, (long)2L}))));\n Debug.Assert(StrangeSortList((new List(new long[]{(long)111111L}))).Equals((new List(new long[]{(long)111111L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a string 'text', return its md5 hash equivalent string.\n // If 'text' is an empty string, return None.\n // >>> StringToMd5((\"Hello world\"))\n // (\"3e25960a79dbc69b674cd4ec67a72c62\")\n public static string StringToMd5(string text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(StringToMd5((\"Hello world\")).Equals((\"3e25960a79dbc69b674cd4ec67a72c62\")));\n Debug.Assert(StringToMd5((\"\")).Equals(null));\n Debug.Assert(StringToMd5((\"A B C\")).Equals((\"0ef78513b0cb8cef12743f5aeb35f888\")));\n Debug.Assert(StringToMd5((\"password\")).Equals((\"5f4dcc3b5aa765d61d8327deb882cf99\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a word. Your task is to find the closest vowel that stands between \n // two consonants from the right side of the word (case sensitive).\n // Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n // find any vowel met the above condition. \n // You may assume that the given string contains English letter only.\n // Example:\n // >>> GetClosestVowel((\"yogurt\"))\n // (\"u\")\n // >>> GetClosestVowel((\"FULL\"))\n // (\"U\")\n // >>> GetClosestVowel((\"quick\"))\n // (\"\")\n // >>> GetClosestVowel((\"ab\"))\n // (\"\")\n public static string GetClosestVowel(string word) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(GetClosestVowel((\"yogurt\")).Equals((\"u\")));\n Debug.Assert(GetClosestVowel((\"full\")).Equals((\"u\")));\n Debug.Assert(GetClosestVowel((\"easy\")).Equals((\"\")));\n Debug.Assert(GetClosestVowel((\"eAsy\")).Equals((\"\")));\n Debug.Assert(GetClosestVowel((\"ali\")).Equals((\"\")));\n Debug.Assert(GetClosestVowel((\"bad\")).Equals((\"a\")));\n Debug.Assert(GetClosestVowel((\"most\")).Equals((\"o\")));\n Debug.Assert(GetClosestVowel((\"ab\")).Equals((\"\")));\n Debug.Assert(GetClosestVowel((\"ba\")).Equals((\"\")));\n Debug.Assert(GetClosestVowel((\"quick\")).Equals((\"\")));\n Debug.Assert(GetClosestVowel((\"anime\")).Equals((\"i\")));\n Debug.Assert(GetClosestVowel((\"Asia\")).Equals((\"\")));\n Debug.Assert(GetClosestVowel((\"Above\")).Equals((\"o\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Change numerical base of input number x to base.\n // return string representation after the conversion.\n // base numbers are less than 10.\n // >>> ChangeBase((8L), (3L))\n // (\"22\")\n // >>> ChangeBase((8L), (2L))\n // (\"1000\")\n // >>> ChangeBase((7L), (2L))\n // (\"111\")\n public static string ChangeBase(long x, long numBase) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ChangeBase((8L), (3L)).Equals((\"22\")));\n Debug.Assert(ChangeBase((9L), (3L)).Equals((\"100\")));\n Debug.Assert(ChangeBase((234L), (2L)).Equals((\"11101010\")));\n Debug.Assert(ChangeBase((16L), (2L)).Equals((\"10000\")));\n Debug.Assert(ChangeBase((8L), (2L)).Equals((\"1000\")));\n Debug.Assert(ChangeBase((7L), (2L)).Equals((\"111\")));\n Debug.Assert(ChangeBase((2L), (3L)).Equals((\"2\")));\n Debug.Assert(ChangeBase((3L), (4L)).Equals((\"3\")));\n Debug.Assert(ChangeBase((4L), (5L)).Equals((\"4\")));\n Debug.Assert(ChangeBase((5L), (6L)).Equals((\"5\")));\n Debug.Assert(ChangeBase((6L), (7L)).Equals((\"6\")));\n Debug.Assert(ChangeBase((7L), (8L)).Equals((\"7\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Check if in given list of numbers, are any two numbers closer to each other than\n // given threshold.\n // >>> HasCloseElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f})), (0.5f))\n // (false)\n // >>> HasCloseElements((new List(new float[]{(float)1.0f, (float)2.8f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.0f})), (0.3f))\n // (true)\n public static bool HasCloseElements(List numbers, float threshold) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(HasCloseElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.9f, (float)4.0f, (float)5.0f, (float)2.2f})), (0.3f)) == (true));\n Debug.Assert(HasCloseElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.9f, (float)4.0f, (float)5.0f, (float)2.2f})), (0.05f)) == (false));\n Debug.Assert(HasCloseElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)5.9f, (float)4.0f, (float)5.0f})), (0.95f)) == (true));\n Debug.Assert(HasCloseElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)5.9f, (float)4.0f, (float)5.0f})), (0.8f)) == (false));\n Debug.Assert(HasCloseElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.0f})), (0.1f)) == (true));\n Debug.Assert(HasCloseElements((new List(new float[]{(float)1.1f, (float)2.2f, (float)3.1f, (float)4.1f, (float)5.1f})), (1.0f)) == (true));\n Debug.Assert(HasCloseElements((new List(new float[]{(float)1.1f, (float)2.2f, (float)3.1f, (float)4.1f, (float)5.1f})), (0.5f)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function that takes a string as input which contains only square brackets.\n // The function should return True if and only if there is a valid subsequence of brackets \n // where at least one bracket in the subsequence is nested.\n // >>> IsNested((\"[[]]\"))\n // (true)\n // >>> IsNested((\"[]]]]]]][[[[[]\"))\n // (false)\n // >>> IsNested((\"[][]\"))\n // (false)\n // >>> IsNested((\"[]\"))\n // (false)\n // >>> IsNested((\"[[][]]\"))\n // (true)\n // >>> IsNested((\"[[]][[\"))\n // (true)\n public static bool IsNested(string str) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsNested((\"[[]]\")) == (true));\n Debug.Assert(IsNested((\"[]]]]]]][[[[[]\")) == (false));\n Debug.Assert(IsNested((\"[][]\")) == (false));\n Debug.Assert(IsNested((\"[]\")) == (false));\n Debug.Assert(IsNested((\"[[[[]]]]\")) == (true));\n Debug.Assert(IsNested((\"[]]]]]]]]]]\")) == (false));\n Debug.Assert(IsNested((\"[][][[]]\")) == (true));\n Debug.Assert(IsNested((\"[[]\")) == (false));\n Debug.Assert(IsNested((\"[]]\")) == (false));\n Debug.Assert(IsNested((\"[[]][[\")) == (true));\n Debug.Assert(IsNested((\"[[][]]\")) == (true));\n Debug.Assert(IsNested((\"\")) == (false));\n Debug.Assert(IsNested((\"[[[[[[[[\")) == (false));\n Debug.Assert(IsNested((\"]]]]]]]]\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Concatenate list of strings into a single string\n // >>> Concatenate((new List()))\n // (\"\")\n // >>> Concatenate((new List(new string[]{(string)\"a\", (string)\"b\", (string)\"c\"})))\n // (\"abc\")\n public static string Concatenate(List strings) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Concatenate((new List())).Equals((\"\")));\n Debug.Assert(Concatenate((new List(new string[]{(string)\"x\", (string)\"y\", (string)\"z\"}))).Equals((\"xyz\")));\n Debug.Assert(Concatenate((new List(new string[]{(string)\"x\", (string)\"y\", (string)\"z\", (string)\"w\", (string)\"k\"}))).Equals((\"xyzwk\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n // >>> PrimeFib((1L))\n // (2L)\n // >>> PrimeFib((2L))\n // (3L)\n // >>> PrimeFib((3L))\n // (5L)\n // >>> PrimeFib((4L))\n // (13L)\n // >>> PrimeFib((5L))\n // (89L)\n public static long PrimeFib(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(PrimeFib((1L)) == (2L));\n Debug.Assert(PrimeFib((2L)) == (3L));\n Debug.Assert(PrimeFib((3L)) == (5L));\n Debug.Assert(PrimeFib((4L)) == (13L));\n Debug.Assert(PrimeFib((5L)) == (89L));\n Debug.Assert(PrimeFib((6L)) == (233L));\n Debug.Assert(PrimeFib((7L)) == (1597L));\n Debug.Assert(PrimeFib((8L)) == (28657L));\n Debug.Assert(PrimeFib((9L)) == (514229L));\n Debug.Assert(PrimeFib((10L)) == (433494437L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n // other and return them in order (smaller number, larger number).\n // >>> FindClosestElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.2f})))\n // (Tuple.Create(2.0f, 2.2f))\n // >>> FindClosestElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.0f})))\n // (Tuple.Create(2.0f, 2.0f))\n public static Tuple FindClosestElements(List numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FindClosestElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.9f, (float)4.0f, (float)5.0f, (float)2.2f}))).Equals((Tuple.Create(3.9f, 4.0f))));\n Debug.Assert(FindClosestElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)5.9f, (float)4.0f, (float)5.0f}))).Equals((Tuple.Create(5.0f, 5.9f))));\n Debug.Assert(FindClosestElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.2f}))).Equals((Tuple.Create(2.0f, 2.2f))));\n Debug.Assert(FindClosestElements((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.0f}))).Equals((Tuple.Create(2.0f, 2.0f))));\n Debug.Assert(FindClosestElements((new List(new float[]{(float)1.1f, (float)2.2f, (float)3.1f, (float)4.1f, (float)5.1f}))).Equals((Tuple.Create(2.2f, 3.1f))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You have been tasked to write a function that receives \n // a hexadecimal number as a string and counts the number of hexadecimal \n // digits that are primes (prime number, or a prime, is a natural number \n // greater than 1 that is not a product of two smaller natural numbers).\n // Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n // Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n // So you have to determine a number of the following digits: 2, 3, 5, 7, \n // B (=decimal 11), D (=decimal 13).\n // Note: you may assume the input is always correct or empty string, \n // and symbols A,B,C,D,E,F are always uppercase.\n // Examples:\n // >>> HexKey((\"AB\"))\n // (1L)\n // >>> HexKey((\"1077E\"))\n // (2L)\n // >>> HexKey((\"ABED1A33\"))\n // (4L)\n // >>> HexKey((\"123456789ABCDEF0\"))\n // (6L)\n // >>> HexKey((\"2020\"))\n // (2L)\n public static long HexKey(string num) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(HexKey((\"AB\")) == (1L));\n Debug.Assert(HexKey((\"1077E\")) == (2L));\n Debug.Assert(HexKey((\"ABED1A33\")) == (4L));\n Debug.Assert(HexKey((\"2020\")) == (2L));\n Debug.Assert(HexKey((\"123456789ABCDEF0\")) == (6L));\n Debug.Assert(HexKey((\"112233445566778899AABBCCDDEEFF00\")) == (12L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Complete the function that takes two integers and returns \n // the product of their unit digits.\n // Assume the input is always valid.\n // Examples:\n // >>> Multiply((148L), (412L))\n // (16L)\n // >>> Multiply((19L), (28L))\n // (72L)\n // >>> Multiply((2020L), (1851L))\n // (0L)\n // >>> Multiply((14L), (-15L))\n // (20L)\n public static long Multiply(long a, long b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Multiply((148L), (412L)) == (16L));\n Debug.Assert(Multiply((19L), (28L)) == (72L));\n Debug.Assert(Multiply((2020L), (1851L)) == (0L));\n Debug.Assert(Multiply((14L), (-15L)) == (20L));\n Debug.Assert(Multiply((76L), (67L)) == (42L));\n Debug.Assert(Multiply((17L), (27L)) == (49L));\n Debug.Assert(Multiply((0L), (1L)) == (0L));\n Debug.Assert(Multiply((0L), (0L)) == (0L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given list of numbers (of at least two elements), apply a linear transform to that list,\n // such that the smallest number will become 0 and the largest will become 1\n // >>> RescaleToUnit((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f})))\n // (new List(new float[]{(float)0.0f, (float)0.25f, (float)0.5f, (float)0.75f, (float)1.0f}))\n public static List RescaleToUnit(List numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(RescaleToUnit((new List(new float[]{(float)2.0f, (float)49.9f}))).Equals((new List(new float[]{(float)0.0f, (float)1.0f}))));\n Debug.Assert(RescaleToUnit((new List(new float[]{(float)100.0f, (float)49.9f}))).Equals((new List(new float[]{(float)1.0f, (float)0.0f}))));\n Debug.Assert(RescaleToUnit((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f}))).Equals((new List(new float[]{(float)0.0f, (float)0.25f, (float)0.5f, (float)0.75f, (float)1.0f}))));\n Debug.Assert(RescaleToUnit((new List(new float[]{(float)2.0f, (float)1.0f, (float)5.0f, (float)3.0f, (float)4.0f}))).Equals((new List(new float[]{(float)0.25f, (float)0.0f, (float)1.0f, (float)0.5f, (float)0.75f}))));\n Debug.Assert(RescaleToUnit((new List(new float[]{(float)12.0f, (float)11.0f, (float)15.0f, (float)13.0f, (float)14.0f}))).Equals((new List(new float[]{(float)0.25f, (float)0.0f, (float)1.0f, (float)0.5f, (float)0.75f}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a positive integer n, return the product of the odd digits.\n // Return 0 if all digits are even.\n // For example:\n // >>> Digits((1L))\n // (1L)\n // >>> Digits((4L))\n // (0L)\n // >>> Digits((235L))\n // (15L)\n public static long Digits(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Digits((5L)) == (5L));\n Debug.Assert(Digits((54L)) == (5L));\n Debug.Assert(Digits((120L)) == (1L));\n Debug.Assert(Digits((5014L)) == (5L));\n Debug.Assert(Digits((98765L)) == (315L));\n Debug.Assert(Digits((5576543L)) == (2625L));\n Debug.Assert(Digits((2468L)) == (0L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You will be given the name of a class (a string) and a list of extensions.\n // The extensions are to be used to load additional classes to the class. The\n // strength of the extension is as follows: Let CAP be the number of the uppercase\n // letters in the extension's name, and let SM be the number of lowercase letters \n // in the extension's name, the strength is given by the fraction CAP - SM. \n // You should find the strongest extension and return a string in this \n // format: ClassName.StrongestExtensionName.\n // If there are two or more extensions with the same strength, you should\n // choose the one that comes first in the list.\n // For example, if you are given \"Slices\" as the class and a list of the\n // extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n // return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n // (its strength is -1).\n // Example:\n // >>> StrongestExtension((\"my_class\"), (new List(new string[]{(string)\"AA\", (string)\"Be\", (string)\"CC\"})))\n // (\"my_class.AA\")\n public static string StrongestExtension(string class_name, List extensions) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(StrongestExtension((\"Watashi\"), (new List(new string[]{(string)\"tEN\", (string)\"niNE\", (string)\"eIGHt8OKe\"}))).Equals((\"Watashi.eIGHt8OKe\")));\n Debug.Assert(StrongestExtension((\"Boku123\"), (new List(new string[]{(string)\"nani\", (string)\"NazeDa\", (string)\"YEs.WeCaNe\", (string)\"32145tggg\"}))).Equals((\"Boku123.YEs.WeCaNe\")));\n Debug.Assert(StrongestExtension((\"__YESIMHERE\"), (new List(new string[]{(string)\"t\", (string)\"eMptY\", (string)\"nothing\", (string)\"zeR00\", (string)\"NuLl__\", (string)\"123NoooneB321\"}))).Equals((\"__YESIMHERE.NuLl__\")));\n Debug.Assert(StrongestExtension((\"K\"), (new List(new string[]{(string)\"Ta\", (string)\"TAR\", (string)\"t234An\", (string)\"cosSo\"}))).Equals((\"K.TAR\")));\n Debug.Assert(StrongestExtension((\"__HAHA\"), (new List(new string[]{(string)\"Tab\", (string)\"123\", (string)\"781345\", (string)\"-_-\"}))).Equals((\"__HAHA.123\")));\n Debug.Assert(StrongestExtension((\"YameRore\"), (new List(new string[]{(string)\"HhAas\", (string)\"okIWILL123\", (string)\"WorkOut\", (string)\"Fails\", (string)\"-_-\"}))).Equals((\"YameRore.okIWILL123\")));\n Debug.Assert(StrongestExtension((\"finNNalLLly\"), (new List(new string[]{(string)\"Die\", (string)\"NowW\", (string)\"Wow\", (string)\"WoW\"}))).Equals((\"finNNalLLly.WoW\")));\n Debug.Assert(StrongestExtension((\"_\"), (new List(new string[]{(string)\"Bb\", (string)\"91245\"}))).Equals((\"_.Bb\")));\n Debug.Assert(StrongestExtension((\"Sp\"), (new List(new string[]{(string)\"671235\", (string)\"Bb\"}))).Equals((\"Sp.671235\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a string representing a space separated lowercase letters, return a dictionary\n // of the letter with the most repetition and containing the corresponding count.\n // If several letters have the same occurrence, return all of them.\n // Example:\n // >>> Histogram((\"a b c\"))\n // (new Dictionary(){{\"a\", 1L}, {\"b\", 1L}, {\"c\", 1L}})\n // >>> Histogram((\"a b b a\"))\n // (new Dictionary(){{\"a\", 2L}, {\"b\", 2L}})\n // >>> Histogram((\"a b c a b\"))\n // (new Dictionary(){{\"a\", 2L}, {\"b\", 2L}})\n // >>> Histogram((\"b b b b a\"))\n // (new Dictionary(){{\"b\", 4L}})\n // >>> Histogram((\"\"))\n // (new Dictionary())\n public static Dictionary Histogram(string test) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Histogram((\"a b b a\")).Equals((new Dictionary(){{\"a\", 2L}, {\"b\", 2L}})));\n Debug.Assert(Histogram((\"a b c a b\")).Equals((new Dictionary(){{\"a\", 2L}, {\"b\", 2L}})));\n Debug.Assert(Histogram((\"a b c d g\")).Equals((new Dictionary(){{\"a\", 1L}, {\"b\", 1L}, {\"c\", 1L}, {\"d\", 1L}, {\"g\", 1L}})));\n Debug.Assert(Histogram((\"r t g\")).Equals((new Dictionary(){{\"r\", 1L}, {\"t\", 1L}, {\"g\", 1L}})));\n Debug.Assert(Histogram((\"b b b b a\")).Equals((new Dictionary(){{\"b\", 4L}})));\n Debug.Assert(Histogram((\"r t g\")).Equals((new Dictionary(){{\"r\", 1L}, {\"t\", 1L}, {\"g\", 1L}})));\n Debug.Assert(Histogram((\"\")).Equals((new Dictionary())));\n Debug.Assert(Histogram((\"a\")).Equals((new Dictionary(){{\"a\", 1L}})));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // pairs_sum_to_zero takes a list of integers as an input.\n // it returns True if there are two distinct elements in the list that\n // sum to zero, and False otherwise.\n // >>> PairsSumToZero((new List(new long[]{(long)1L, (long)3L, (long)5L, (long)0L})))\n // (false)\n // >>> PairsSumToZero((new List(new long[]{(long)1L, (long)3L, (long)-2L, (long)1L})))\n // (false)\n // >>> PairsSumToZero((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)7L})))\n // (false)\n // >>> PairsSumToZero((new List(new long[]{(long)2L, (long)4L, (long)-5L, (long)3L, (long)5L, (long)7L})))\n // (true)\n // >>> PairsSumToZero((new List(new long[]{(long)1L})))\n // (false)\n public static bool PairsSumToZero(List l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)1L, (long)3L, (long)5L, (long)0L}))) == (false));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)1L, (long)3L, (long)-2L, (long)1L}))) == (false));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)7L}))) == (false));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)2L, (long)4L, (long)-5L, (long)3L, (long)5L, (long)7L}))) == (true));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)1L}))) == (false));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)-3L, (long)9L, (long)-1L, (long)3L, (long)2L, (long)30L}))) == (true));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)-3L, (long)9L, (long)-1L, (long)3L, (long)2L, (long)31L}))) == (true));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)-3L, (long)9L, (long)-1L, (long)4L, (long)2L, (long)30L}))) == (false));\n Debug.Assert(PairsSumToZero((new List(new long[]{(long)-3L, (long)9L, (long)-1L, (long)4L, (long)2L, (long)31L}))) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that accepts two lists of strings and returns the list that has \n // total number of chars in the all strings of the list less than the other list.\n // if the two lists have the same number of chars, return the first list.\n // Examples\n // >>> TotalMatch((new List()), (new List()))\n // (new List())\n // >>> TotalMatch((new List(new string[]{(string)\"hi\", (string)\"admin\"})), (new List(new string[]{(string)\"hI\", (string)\"Hi\"})))\n // (new List(new string[]{(string)\"hI\", (string)\"Hi\"}))\n // >>> TotalMatch((new List(new string[]{(string)\"hi\", (string)\"admin\"})), (new List(new string[]{(string)\"hi\", (string)\"hi\", (string)\"admin\", (string)\"project\"})))\n // (new List(new string[]{(string)\"hi\", (string)\"admin\"}))\n // >>> TotalMatch((new List(new string[]{(string)\"hi\", (string)\"admin\"})), (new List(new string[]{(string)\"hI\", (string)\"hi\", (string)\"hi\"})))\n // (new List(new string[]{(string)\"hI\", (string)\"hi\", (string)\"hi\"}))\n // >>> TotalMatch((new List(new string[]{(string)\"4\"})), (new List(new string[]{(string)\"1\", (string)\"2\", (string)\"3\", (string)\"4\", (string)\"5\"})))\n // (new List(new string[]{(string)\"4\"}))\n public static List TotalMatch(List lst1, List lst2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(TotalMatch((new List()), (new List())).Equals((new List())));\n Debug.Assert(TotalMatch((new List(new string[]{(string)\"hi\", (string)\"admin\"})), (new List(new string[]{(string)\"hi\", (string)\"hi\"}))).Equals((new List(new string[]{(string)\"hi\", (string)\"hi\"}))));\n Debug.Assert(TotalMatch((new List(new string[]{(string)\"hi\", (string)\"admin\"})), (new List(new string[]{(string)\"hi\", (string)\"hi\", (string)\"admin\", (string)\"project\"}))).Equals((new List(new string[]{(string)\"hi\", (string)\"admin\"}))));\n Debug.Assert(TotalMatch((new List(new string[]{(string)\"4\"})), (new List(new string[]{(string)\"1\", (string)\"2\", (string)\"3\", (string)\"4\", (string)\"5\"}))).Equals((new List(new string[]{(string)\"4\"}))));\n Debug.Assert(TotalMatch((new List(new string[]{(string)\"hi\", (string)\"admin\"})), (new List(new string[]{(string)\"hI\", (string)\"Hi\"}))).Equals((new List(new string[]{(string)\"hI\", (string)\"Hi\"}))));\n Debug.Assert(TotalMatch((new List(new string[]{(string)\"hi\", (string)\"admin\"})), (new List(new string[]{(string)\"hI\", (string)\"hi\", (string)\"hi\"}))).Equals((new List(new string[]{(string)\"hI\", (string)\"hi\", (string)\"hi\"}))));\n Debug.Assert(TotalMatch((new List(new string[]{(string)\"hi\", (string)\"admin\"})), (new List(new string[]{(string)\"hI\", (string)\"hi\", (string)\"hii\"}))).Equals((new List(new string[]{(string)\"hi\", (string)\"admin\"}))));\n Debug.Assert(TotalMatch((new List()), (new List(new string[]{(string)\"this\"}))).Equals((new List())));\n Debug.Assert(TotalMatch((new List(new string[]{(string)\"this\"})), (new List())).Equals((new List())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Circular shift the digits of the integer x, shift the digits right by shift\n // and return the result as a string.\n // If shift > number of digits, return digits reversed.\n // >>> CircularShift((12L), (1L))\n // (\"21\")\n // >>> CircularShift((12L), (2L))\n // (\"12\")\n public static string CircularShift(long x, long shift) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CircularShift((100L), (2L)).Equals((\"001\")));\n Debug.Assert(CircularShift((12L), (2L)).Equals((\"12\")));\n Debug.Assert(CircularShift((97L), (8L)).Equals((\"79\")));\n Debug.Assert(CircularShift((12L), (1L)).Equals((\"21\")));\n Debug.Assert(CircularShift((11L), (101L)).Equals((\"11\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return True is list elements are monotonically increasing or decreasing.\n // >>> Monotonic((new List(new long[]{(long)1L, (long)2L, (long)4L, (long)20L})))\n // (true)\n // >>> Monotonic((new List(new long[]{(long)1L, (long)20L, (long)4L, (long)10L})))\n // (false)\n // >>> Monotonic((new List(new long[]{(long)4L, (long)1L, (long)0L, (long)-10L})))\n // (true)\n public static bool Monotonic(List l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Monotonic((new List(new long[]{(long)1L, (long)2L, (long)4L, (long)10L}))) == (true));\n Debug.Assert(Monotonic((new List(new long[]{(long)1L, (long)2L, (long)4L, (long)20L}))) == (true));\n Debug.Assert(Monotonic((new List(new long[]{(long)1L, (long)20L, (long)4L, (long)10L}))) == (false));\n Debug.Assert(Monotonic((new List(new long[]{(long)4L, (long)1L, (long)0L, (long)-10L}))) == (true));\n Debug.Assert(Monotonic((new List(new long[]{(long)4L, (long)1L, (long)1L, (long)0L}))) == (true));\n Debug.Assert(Monotonic((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)2L, (long)5L, (long)60L}))) == (false));\n Debug.Assert(Monotonic((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)60L}))) == (true));\n Debug.Assert(Monotonic((new List(new long[]{(long)9L, (long)9L, (long)9L, (long)9L}))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n // Example\n // >>> IsEqualToSumEven((4L))\n // (false)\n // >>> IsEqualToSumEven((6L))\n // (false)\n // >>> IsEqualToSumEven((8L))\n // (true)\n public static bool IsEqualToSumEven(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsEqualToSumEven((4L)) == (false));\n Debug.Assert(IsEqualToSumEven((6L)) == (false));\n Debug.Assert(IsEqualToSumEven((8L)) == (true));\n Debug.Assert(IsEqualToSumEven((10L)) == (true));\n Debug.Assert(IsEqualToSumEven((11L)) == (false));\n Debug.Assert(IsEqualToSumEven((12L)) == (true));\n Debug.Assert(IsEqualToSumEven((13L)) == (false));\n Debug.Assert(IsEqualToSumEven((16L)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Input to this function is a string representing musical notes in a special ASCII format.\n // Your task is to parse this string and return list of integers corresponding to how many beats does each\n // not last.\n // Here is a legend:\n // 'o' - whole note, lasts four beats\n // 'o|' - half note, lasts two beats\n // '.|' - quater note, lasts one beat\n // >>> ParseMusic((\"o o| .| o| o| .| .| .| .| o o\"))\n // (new List(new long[]{(long)4L, (long)2L, (long)1L, (long)2L, (long)2L, (long)1L, (long)1L, (long)1L, (long)1L, (long)4L, (long)4L}))\n public static List ParseMusic(string music_string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ParseMusic((\"\")).Equals((new List())));\n Debug.Assert(ParseMusic((\"o o o o\")).Equals((new List(new long[]{(long)4L, (long)4L, (long)4L, (long)4L}))));\n Debug.Assert(ParseMusic((\".| .| .| .|\")).Equals((new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L}))));\n Debug.Assert(ParseMusic((\"o| o| .| .| o o o o\")).Equals((new List(new long[]{(long)2L, (long)2L, (long)1L, (long)1L, (long)4L, (long)4L, (long)4L, (long)4L}))));\n Debug.Assert(ParseMusic((\"o| .| o| .| o o| o o|\")).Equals((new List(new long[]{(long)2L, (long)1L, (long)2L, (long)1L, (long)4L, (long)2L, (long)4L, (long)2L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // \"\n // This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n // multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n // change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n // Examples:\n // >>> lst\n // (long)new List(new long[]{(long)1L, (long)2L, (long)3L})\n // >>> lst\n // (long)new List()\n // >>> lst\n // (long)new List(new long[]{(long)-1L, (long)-5L, (long)2L, (long)-1L, (long)-5L})\n public static long SumSquares(List lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SumSquares((new List(new long[]{(long)1L, (long)2L, (long)3L}))) == (6L));\n Debug.Assert(SumSquares((new List(new long[]{(long)1L, (long)4L, (long)9L}))) == (14L));\n Debug.Assert(SumSquares((new List())) == (0L));\n Debug.Assert(SumSquares((new List(new long[]{(long)1L, (long)1L, (long)1L, (long)1L, (long)1L, (long)1L, (long)1L, (long)1L, (long)1L}))) == (9L));\n Debug.Assert(SumSquares((new List(new long[]{(long)-1L, (long)-1L, (long)-1L, (long)-1L, (long)-1L, (long)-1L, (long)-1L, (long)-1L, (long)-1L}))) == (-3L));\n Debug.Assert(SumSquares((new List(new long[]{(long)0L}))) == (0L));\n Debug.Assert(SumSquares((new List(new long[]{(long)-1L, (long)-5L, (long)2L, (long)-1L, (long)-5L}))) == (-126L));\n Debug.Assert(SumSquares((new List(new long[]{(long)-56L, (long)-99L, (long)1L, (long)0L, (long)-2L}))) == (3030L));\n Debug.Assert(SumSquares((new List(new long[]{(long)-1L, (long)0L, (long)0L, (long)0L, (long)0L, (long)0L, (long)0L, (long)0L, (long)-1L}))) == (0L));\n Debug.Assert(SumSquares((new List(new long[]{(long)-16L, (long)-9L, (long)-2L, (long)36L, (long)36L, (long)26L, (long)-20L, (long)25L, (long)-40L, (long)20L, (long)-4L, (long)12L, (long)-26L, (long)35L, (long)37L}))) == (-14196L));\n Debug.Assert(SumSquares((new List(new long[]{(long)-1L, (long)-3L, (long)17L, (long)-1L, (long)-15L, (long)13L, (long)-1L, (long)14L, (long)-14L, (long)-12L, (long)-5L, (long)14L, (long)-14L, (long)6L, (long)13L, (long)11L, (long)16L, (long)16L, (long)4L, (long)10L}))) == (-1448L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // triples_sum_to_zero takes a list of integers as an input.\n // it returns True if there are three distinct elements in the list that\n // sum to zero, and False otherwise.\n // >>> TriplesSumToZero((new List(new long[]{(long)1L, (long)3L, (long)5L, (long)0L})))\n // (false)\n // >>> TriplesSumToZero((new List(new long[]{(long)1L, (long)3L, (long)-2L, (long)1L})))\n // (true)\n // >>> TriplesSumToZero((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)7L})))\n // (false)\n // >>> TriplesSumToZero((new List(new long[]{(long)2L, (long)4L, (long)-5L, (long)3L, (long)9L, (long)7L})))\n // (true)\n // >>> TriplesSumToZero((new List(new long[]{(long)1L})))\n // (false)\n public static bool TriplesSumToZero(List l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)1L, (long)3L, (long)5L, (long)0L}))) == (false));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)1L, (long)3L, (long)5L, (long)-1L}))) == (false));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)1L, (long)3L, (long)-2L, (long)1L}))) == (true));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)7L}))) == (false));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)1L, (long)2L, (long)5L, (long)7L}))) == (false));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)2L, (long)4L, (long)-5L, (long)3L, (long)9L, (long)7L}))) == (true));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)1L}))) == (false));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)1L, (long)3L, (long)5L, (long)-100L}))) == (false));\n Debug.Assert(TriplesSumToZero((new List(new long[]{(long)100L, (long)3L, (long)5L, (long)-100L}))) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // brackets is a string of \"<\" and \">\".\n // return True if every opening bracket has a corresponding closing bracket.\n // >>> CorrectBracketing((\"<\"))\n // (false)\n // >>> CorrectBracketing((\"<>\"))\n // (true)\n // >>> CorrectBracketing((\"<<><>>\"))\n // (true)\n // >>> CorrectBracketing((\"><<>\"))\n // (false)\n public static bool CorrectBracketing(string brackets) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CorrectBracketing((\"<>\")) == (true));\n Debug.Assert(CorrectBracketing((\"<<><>>\")) == (true));\n Debug.Assert(CorrectBracketing((\"<><><<><>><>\")) == (true));\n Debug.Assert(CorrectBracketing((\"<><><<<><><>><>><<><><<>>>\")) == (true));\n Debug.Assert(CorrectBracketing((\"<<<><>>>>\")) == (false));\n Debug.Assert(CorrectBracketing((\"><<>\")) == (false));\n Debug.Assert(CorrectBracketing((\"<\")) == (false));\n Debug.Assert(CorrectBracketing((\"<<<<\")) == (false));\n Debug.Assert(CorrectBracketing((\">\")) == (false));\n Debug.Assert(CorrectBracketing((\"<<>\")) == (false));\n Debug.Assert(CorrectBracketing((\"<><><<><>><>><<>\")) == (false));\n Debug.Assert(CorrectBracketing((\"<><><<><>><>>><>\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that takes an array of numbers as input and returns \n // the number of elements in the array that are greater than 10 and both \n // first and last digits of a number are odd (1, 3, 5, 7, 9).\n // For example:\n // >>> Specialfilter((new List(new long[]{(long)15L, (long)-73L, (long)14L, (long)-15L})))\n // (1L)\n // >>> Specialfilter((new List(new long[]{(long)33L, (long)-2L, (long)-3L, (long)45L, (long)21L, (long)109L})))\n // (2L)\n public static long Specialfilter(List nums) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Specialfilter((new List(new long[]{(long)5L, (long)-2L, (long)1L, (long)-5L}))) == (0L));\n Debug.Assert(Specialfilter((new List(new long[]{(long)15L, (long)-73L, (long)14L, (long)-15L}))) == (1L));\n Debug.Assert(Specialfilter((new List(new long[]{(long)33L, (long)-2L, (long)-3L, (long)45L, (long)21L, (long)109L}))) == (2L));\n Debug.Assert(Specialfilter((new List(new long[]{(long)43L, (long)-12L, (long)93L, (long)125L, (long)121L, (long)109L}))) == (4L));\n Debug.Assert(Specialfilter((new List(new long[]{(long)71L, (long)-2L, (long)-33L, (long)75L, (long)21L, (long)19L}))) == (3L));\n Debug.Assert(Specialfilter((new List(new long[]{(long)1L}))) == (0L));\n Debug.Assert(Specialfilter((new List())) == (0L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a dictionary, return True if all keys are strings in lower \n // case or all keys are strings in upper case, else return False.\n // The function should return False is the given dictionary is empty.\n // Examples:\n // >>> CheckDictCase((new Dictionary(){{\"a\", \"apple\"}, {\"b\", \"banana\"}}))\n // (true)\n // >>> CheckDictCase((new Dictionary(){{\"a\", \"apple\"}, {\"A\", \"banana\"}, {\"B\", \"banana\"}}))\n // (false)\n // >>> CheckDictCase((new Dictionary(){{\"a\", \"apple\"}, {8L, \"banana\"}, {\"a\", \"apple\"}}))\n // (false)\n // >>> CheckDictCase((new Dictionary(){{\"Name\", \"John\"}, {\"Age\", \"36\"}, {\"City\", \"Houston\"}}))\n // (false)\n // >>> CheckDictCase((new Dictionary(){{\"STATE\", \"NC\"}, {\"ZIP\", \"12345\"}}))\n // (true)\n public static bool CheckDictCase(Dictionary dict) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CheckDictCase((new Dictionary(){{\"p\", \"pineapple\"}, {\"b\", \"banana\"}})) == (true));\n Debug.Assert(CheckDictCase((new Dictionary(){{\"p\", \"pineapple\"}, {\"A\", \"banana\"}, {\"B\", \"banana\"}})) == (false));\n Debug.Assert(CheckDictCase((new Dictionary(){{\"p\", \"pineapple\"}, {\"5\", \"banana\"}, {\"a\", \"apple\"}})) == (false));\n Debug.Assert(CheckDictCase((new Dictionary(){{\"Name\", \"John\"}, {\"Age\", \"36\"}, {\"City\", \"Houston\"}})) == (false));\n Debug.Assert(CheckDictCase((new Dictionary(){{\"STATE\", \"NC\"}, {\"ZIP\", \"12345\"}})) == (true));\n Debug.Assert(CheckDictCase((new Dictionary(){{\"fruit\", \"Orange\"}, {\"taste\", \"Sweet\"}})) == (true));\n Debug.Assert(CheckDictCase((new Dictionary())) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n // fibfib(0) == 0\n // fibfib(1) == 0\n // fibfib(2) == 1\n // fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n // Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n // >>> Fibfib((1L))\n // (0L)\n // >>> Fibfib((5L))\n // (4L)\n // >>> Fibfib((8L))\n // (24L)\n public static long Fibfib(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Fibfib((2L)) == (1L));\n Debug.Assert(Fibfib((1L)) == (0L));\n Debug.Assert(Fibfib((5L)) == (4L));\n Debug.Assert(Fibfib((8L)) == (24L));\n Debug.Assert(Fibfib((10L)) == (81L));\n Debug.Assert(Fibfib((12L)) == (274L));\n Debug.Assert(Fibfib((14L)) == (927L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a list of numbers.\n // You need to return the sum of squared numbers in the given list,\n // round each element in the list to the upper int(Ceiling) first.\n // Examples:\n // >>> Lst((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f})))\n // (14L)\n // >>> Lst((new List(new float[]{(float)1.0f, (float)4.0f, (float)9.0f})))\n // (98L)\n // >>> Lst((new List(new float[]{(float)1.0f, (float)3.0f, (float)5.0f, (float)7.0f})))\n // (84L)\n // >>> Lst((new List(new float[]{(float)1.4f, (float)4.2f, (float)0.0f})))\n // (29L)\n // >>> Lst((new List(new float[]{(float)-2.4f, (float)1.0f, (float)1.0f})))\n // (6L)\n public static long SumSquares(List lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SumSquares((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f}))) == (14L));\n Debug.Assert(SumSquares((new List(new float[]{(float)1.0f, (float)2.0f, (float)3.0f}))) == (14L));\n Debug.Assert(SumSquares((new List(new float[]{(float)1.0f, (float)3.0f, (float)5.0f, (float)7.0f}))) == (84L));\n Debug.Assert(SumSquares((new List(new float[]{(float)1.4f, (float)4.2f, (float)0.0f}))) == (29L));\n Debug.Assert(SumSquares((new List(new float[]{(float)-2.4f, (float)1.0f, (float)1.0f}))) == (6L));\n Debug.Assert(SumSquares((new List(new float[]{(float)100.0f, (float)1.0f, (float)15.0f, (float)2.0f}))) == (10230L));\n Debug.Assert(SumSquares((new List(new float[]{(float)10000.0f, (float)10000.0f}))) == (200000000L));\n Debug.Assert(SumSquares((new List(new float[]{(float)-1.4f, (float)4.6f, (float)6.3f}))) == (75L));\n Debug.Assert(SumSquares((new List(new float[]{(float)-1.4f, (float)17.9f, (float)18.9f, (float)19.9f}))) == (1086L));\n Debug.Assert(SumSquares((new List(new float[]{(float)0.0f}))) == (0L));\n Debug.Assert(SumSquares((new List(new float[]{(float)-1.0f}))) == (1L));\n Debug.Assert(SumSquares((new List(new float[]{(float)-1.0f, (float)1.0f, (float)0.0f}))) == (2L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_85_add", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a non-empty list of integers lst. add the even elements that are at odd indices..\n // Examples:\n // >>> Add((new List(new long[]{(long)4L, (long)2L, (long)6L, (long)7L})))\n // (2L)\n public static long Add(List lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Add((new List(new long[]{(long)4L, (long)88L}))) == (88L));\n Debug.Assert(Add((new List(new long[]{(long)4L, (long)5L, (long)6L, (long)7L, (long)2L, (long)122L}))) == (122L));\n Debug.Assert(Add((new List(new long[]{(long)4L, (long)0L, (long)6L, (long)7L}))) == (0L));\n Debug.Assert(Add((new List(new long[]{(long)4L, (long)4L, (long)6L, (long)8L}))) == (12L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return sorted unique elements in a list\n // >>> Unique((new List(new long[]{(long)5L, (long)3L, (long)5L, (long)2L, (long)3L, (long)3L, (long)9L, (long)0L, (long)123L})))\n // (new List(new long[]{(long)0L, (long)2L, (long)3L, (long)5L, (long)9L, (long)123L}))\n public static List Unique(List l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Unique((new List(new long[]{(long)5L, (long)3L, (long)5L, (long)2L, (long)3L, (long)3L, (long)9L, (long)0L, (long)123L}))).Equals((new List(new long[]{(long)0L, (long)2L, (long)3L, (long)5L, (long)9L, (long)123L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a string text, replace all spaces in it with underscores, \n // and if a string has more than 2 consecutive spaces, \n // then replace all consecutive spaces with - \n // >>> FixSpaces((\" Example\"))\n // (\"Example\")\n // >>> FixSpaces((\" Example 1\"))\n // (\"Example_1\")\n // >>> FixSpaces((\" Example 2\"))\n // (\"_Example_2\")\n // >>> FixSpaces((\" Example 3\"))\n // (\"_Example-3\")\n public static string FixSpaces(string text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FixSpaces((\"Example\")).Equals((\"Example\")));\n Debug.Assert(FixSpaces((\"Mudasir Hanif \")).Equals((\"Mudasir_Hanif_\")));\n Debug.Assert(FixSpaces((\"Yellow Yellow Dirty Fellow\")).Equals((\"Yellow_Yellow__Dirty__Fellow\")));\n Debug.Assert(FixSpaces((\"Exa mple\")).Equals((\"Exa-mple\")));\n Debug.Assert(FixSpaces((\" Exa 1 2 2 mple\")).Equals((\"-Exa_1_2_2_mple\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return 2^n modulo p (be aware of numerics).\n // >>> Modp((3L), (5L))\n // (3L)\n // >>> Modp((1101L), (101L))\n // (2L)\n // >>> Modp((0L), (101L))\n // (1L)\n // >>> Modp((3L), (11L))\n // (8L)\n // >>> Modp((100L), (101L))\n // (1L)\n public static long Modp(long n, long p) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Modp((3L), (5L)) == (3L));\n Debug.Assert(Modp((1101L), (101L)) == (2L));\n Debug.Assert(Modp((0L), (101L)) == (1L));\n Debug.Assert(Modp((3L), (11L)) == (8L));\n Debug.Assert(Modp((100L), (101L)) == (1L));\n Debug.Assert(Modp((30L), (5L)) == (4L));\n Debug.Assert(Modp((31L), (5L)) == (3L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You have to write a function which validates a given date string and\n // returns True if the date is valid otherwise False.\n // The date is valid if all of the following rules are satisfied:\n // 1. The date string is not empty.\n // 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n // 3. The months should not be less than 1 or higher than 12.\n // 4. The date should be in the format: mm-dd-yyyy\n // >>> ValidDate((\"03-11-2000\"))\n // (true)\n // >>> ValidDate((\"15-01-2012\"))\n // (false)\n // >>> ValidDate((\"04-0-2040\"))\n // (false)\n // >>> ValidDate((\"06-04-2020\"))\n // (true)\n // >>> ValidDate((\"06/04/2020\"))\n // (false)\n public static bool ValidDate(string date) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ValidDate((\"03-11-2000\")) == (true));\n Debug.Assert(ValidDate((\"15-01-2012\")) == (false));\n Debug.Assert(ValidDate((\"04-0-2040\")) == (false));\n Debug.Assert(ValidDate((\"06-04-2020\")) == (true));\n Debug.Assert(ValidDate((\"01-01-2007\")) == (true));\n Debug.Assert(ValidDate((\"03-32-2011\")) == (false));\n Debug.Assert(ValidDate((\"\")) == (false));\n Debug.Assert(ValidDate((\"04-31-3000\")) == (false));\n Debug.Assert(ValidDate((\"06-06-2005\")) == (true));\n Debug.Assert(ValidDate((\"21-31-2000\")) == (false));\n Debug.Assert(ValidDate((\"04-12-2003\")) == (true));\n Debug.Assert(ValidDate((\"04122003\")) == (false));\n Debug.Assert(ValidDate((\"20030412\")) == (false));\n Debug.Assert(ValidDate((\"2003-04\")) == (false));\n Debug.Assert(ValidDate((\"2003-04-12\")) == (false));\n Debug.Assert(ValidDate((\"04-2003\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that takes a string and returns an ordered version of it.\n // Ordered version of string, is a string where all words (separated by space)\n // are replaced by a new word where all the characters arranged in\n // ascending order based on ascii value.\n // Note: You should keep the order of words and blank spaces in the sentence.\n // For example:\n // >>> AntiShuffle((\"Hi\"))\n // (\"Hi\")\n // >>> AntiShuffle((\"hello\"))\n // (\"ehllo\")\n // >>> AntiShuffle((\"Hello World!!!\"))\n // (\"Hello !!!Wdlor\")\n public static string AntiShuffle(string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(AntiShuffle((\"Hi\")).Equals((\"Hi\")));\n Debug.Assert(AntiShuffle((\"hello\")).Equals((\"ehllo\")));\n Debug.Assert(AntiShuffle((\"number\")).Equals((\"bemnru\")));\n Debug.Assert(AntiShuffle((\"abcd\")).Equals((\"abcd\")));\n Debug.Assert(AntiShuffle((\"Hello World!!!\")).Equals((\"Hello !!!Wdlor\")));\n Debug.Assert(AntiShuffle((\"\")).Equals((\"\")));\n Debug.Assert(AntiShuffle((\"Hi. My name is Mister Robot. How are you?\")).Equals((\".Hi My aemn is Meirst .Rboot How aer ?ouy\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a list of numbers, return whether or not they are sorted\n // in ascending order. If list has more than 1 duplicate of the same\n // number, return False. Assume no negative numbers and only integers.\n // Examples\n // >>> IsSorted((new List(new long[]{(long)5L})))\n // (true)\n // >>> IsSorted((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L})))\n // (true)\n // >>> IsSorted((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)4L, (long)5L})))\n // (false)\n // >>> IsSorted((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L})))\n // (true)\n // >>> IsSorted((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L, (long)7L})))\n // (true)\n // >>> IsSorted((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)4L, (long)5L, (long)6L, (long)7L})))\n // (false)\n // >>> IsSorted((new List(new long[]{(long)1L, (long)2L, (long)2L, (long)3L, (long)3L, (long)4L})))\n // (true)\n // >>> IsSorted((new List(new long[]{(long)1L, (long)2L, (long)2L, (long)2L, (long)3L, (long)4L})))\n // (false)\n public static bool IsSorted(List lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsSorted((new List(new long[]{(long)5L}))) == (true));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L}))) == (true));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)4L, (long)5L}))) == (false));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}))) == (true));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L, (long)7L}))) == (true));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)3L, (long)2L, (long)4L, (long)5L, (long)6L, (long)7L}))) == (false));\n Debug.Assert(IsSorted((new List())) == (true));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L}))) == (true));\n Debug.Assert(IsSorted((new List(new long[]{(long)3L, (long)2L, (long)1L}))) == (false));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)2L, (long)2L, (long)2L, (long)3L, (long)4L}))) == (false));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)3L, (long)3L, (long)4L}))) == (false));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)2L, (long)2L, (long)3L, (long)3L, (long)4L}))) == (true));\n Debug.Assert(IsSorted((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a string s.\n // Your task is to check if the string is happy or not.\n // A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n // For example:\n // >>> IsHappy((\"a\"))\n // (false)\n // >>> IsHappy((\"aa\"))\n // (false)\n // >>> IsHappy((\"abcd\"))\n // (true)\n // >>> IsHappy((\"aabb\"))\n // (false)\n // >>> IsHappy((\"adb\"))\n // (true)\n // >>> IsHappy((\"xyy\"))\n // (false)\n public static bool IsHappy(string s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IsHappy((\"a\")) == (false));\n Debug.Assert(IsHappy((\"aa\")) == (false));\n Debug.Assert(IsHappy((\"abcd\")) == (true));\n Debug.Assert(IsHappy((\"aabb\")) == (false));\n Debug.Assert(IsHappy((\"adb\")) == (true));\n Debug.Assert(IsHappy((\"xyy\")) == (false));\n Debug.Assert(IsHappy((\"iopaxpoi\")) == (true));\n Debug.Assert(IsHappy((\"iopaxioi\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Write a function that returns True if the object q will fly, and False otherwise.\n // The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n // Example:\n // >>> WillItFly((new List(new long[]{(long)1L, (long)2L})), (5L))\n // (false)\n // # 1+2 is less than the maximum possible weight, but it's unbalanced.\n // >>> WillItFly((new List(new long[]{(long)3L, (long)2L, (long)3L})), (1L))\n // (false)\n // # it's balanced, but 3+2+3 is more than the maximum possible weight.\n // >>> WillItFly((new List(new long[]{(long)3L, (long)2L, (long)3L})), (9L))\n // (true)\n // # 3+2+3 is less than the maximum possible weight, and it's balanced.\n // >>> WillItFly((new List(new long[]{(long)3L})), (5L))\n // (true)\n // # 3 is less than the maximum possible weight, and it's balanced.\n public static bool WillItFly(List q, long w) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(WillItFly((new List(new long[]{(long)3L, (long)2L, (long)3L})), (9L)) == (true));\n Debug.Assert(WillItFly((new List(new long[]{(long)1L, (long)2L})), (5L)) == (false));\n Debug.Assert(WillItFly((new List(new long[]{(long)3L})), (5L)) == (true));\n Debug.Assert(WillItFly((new List(new long[]{(long)3L, (long)2L, (long)3L})), (1L)) == (false));\n Debug.Assert(WillItFly((new List(new long[]{(long)1L, (long)2L, (long)3L})), (6L)) == (false));\n Debug.Assert(WillItFly((new List(new long[]{(long)5L})), (5L)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given an array of non-negative integers, return a copy of the given array after sorting,\n // you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n // or sort it in descending order if the sum( first index value, last index value) is even.\n // Note:\n // * don't change the given array.\n // Examples:\n // >>> SortArray((new List()))\n // (new List())\n // >>> SortArray((new List(new long[]{(long)5L})))\n // (new List(new long[]{(long)5L}))\n // >>> SortArray((new List(new long[]{(long)2L, (long)4L, (long)3L, (long)0L, (long)1L, (long)5L})))\n // (new List(new long[]{(long)0L, (long)1L, (long)2L, (long)3L, (long)4L, (long)5L}))\n // >>> SortArray((new List(new long[]{(long)2L, (long)4L, (long)3L, (long)0L, (long)1L, (long)5L, (long)6L})))\n // (new List(new long[]{(long)6L, (long)5L, (long)4L, (long)3L, (long)2L, (long)1L, (long)0L}))\n public static List SortArray(List array) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SortArray((new List())).Equals((new List())));\n Debug.Assert(SortArray((new List(new long[]{(long)5L}))).Equals((new List(new long[]{(long)5L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)2L, (long)4L, (long)3L, (long)0L, (long)1L, (long)5L}))).Equals((new List(new long[]{(long)0L, (long)1L, (long)2L, (long)3L, (long)4L, (long)5L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)2L, (long)4L, (long)3L, (long)0L, (long)1L, (long)5L, (long)6L}))).Equals((new List(new long[]{(long)6L, (long)5L, (long)4L, (long)3L, (long)2L, (long)1L, (long)0L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)2L, (long)1L}))).Equals((new List(new long[]{(long)1L, (long)2L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)15L, (long)42L, (long)87L, (long)32L, (long)11L, (long)0L}))).Equals((new List(new long[]{(long)0L, (long)11L, (long)15L, (long)32L, (long)42L, (long)87L}))));\n Debug.Assert(SortArray((new List(new long[]{(long)21L, (long)14L, (long)23L, (long)11L}))).Equals((new List(new long[]{(long)23L, (long)21L, (long)14L, (long)11L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Implement a function that takes an non-negative integer and returns an array of the first n\n // integers that are prime numbers and less than n.\n // for example:\n // >>> CountUpTo((5L))\n // (new List(new long[]{(long)2L, (long)3L}))\n // >>> CountUpTo((11L))\n // (new List(new long[]{(long)2L, (long)3L, (long)5L, (long)7L}))\n // >>> CountUpTo((0L))\n // (new List())\n // >>> CountUpTo((20L))\n // (new List(new long[]{(long)2L, (long)3L, (long)5L, (long)7L, (long)11L, (long)13L, (long)17L, (long)19L}))\n // >>> CountUpTo((1L))\n // (new List())\n // >>> CountUpTo((18L))\n // (new List(new long[]{(long)2L, (long)3L, (long)5L, (long)7L, (long)11L, (long)13L, (long)17L}))\n public static List CountUpTo(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CountUpTo((5L)).Equals((new List(new long[]{(long)2L, (long)3L}))));\n Debug.Assert(CountUpTo((6L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)5L}))));\n Debug.Assert(CountUpTo((7L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)5L}))));\n Debug.Assert(CountUpTo((10L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)5L, (long)7L}))));\n Debug.Assert(CountUpTo((0L)).Equals((new List())));\n Debug.Assert(CountUpTo((22L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)5L, (long)7L, (long)11L, (long)13L, (long)17L, (long)19L}))));\n Debug.Assert(CountUpTo((1L)).Equals((new List())));\n Debug.Assert(CountUpTo((18L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)5L, (long)7L, (long)11L, (long)13L, (long)17L}))));\n Debug.Assert(CountUpTo((47L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)5L, (long)7L, (long)11L, (long)13L, (long)17L, (long)19L, (long)23L, (long)29L, (long)31L, (long)37L, (long)41L, (long)43L}))));\n Debug.Assert(CountUpTo((101L)).Equals((new List(new long[]{(long)2L, (long)3L, (long)5L, (long)7L, (long)11L, (long)13L, (long)17L, (long)19L, (long)23L, (long)29L, (long)31L, (long)37L, (long)41L, (long)43L, (long)47L, (long)53L, (long)59L, (long)61L, (long)67L, (long)71L, (long)73L, (long)79L, (long)83L, (long)89L, (long)97L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Out of list of strings, return the longest one. Return the first one in case of multiple\n // strings of the same length. Return None in case the input list is empty.\n // >>> Longest((new List()))\n // null\n // >>> Longest((new List(new string[]{(string)\"a\", (string)\"b\", (string)\"c\"})))\n // (\"a\")\n // >>> Longest((new List(new string[]{(string)\"a\", (string)\"bb\", (string)\"ccc\"})))\n // (\"ccc\")\n public static string Longest(List strings) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Longest((new List())).Equals(null));\n Debug.Assert(Longest((new List(new string[]{(string)\"x\", (string)\"y\", (string)\"z\"}))).Equals((\"x\")));\n Debug.Assert(Longest((new List(new string[]{(string)\"x\", (string)\"yyy\", (string)\"zzzz\", (string)\"www\", (string)\"kkkk\", (string)\"abc\"}))).Equals((\"zzzz\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n // reverse the resulting array, and then replace each digit by its corresponding name from\n // \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n // For example:\n // >>> ByLength((new List(new long[]{(long)2L, (long)1L, (long)1L, (long)4L, (long)5L, (long)8L, (long)2L, (long)3L})))\n // (new List(new string[]{(string)\"Eight\", (string)\"Five\", (string)\"Four\", (string)\"Three\", (string)\"Two\", (string)\"Two\", (string)\"One\", (string)\"One\"}))\n // If the array is empty, return an empty array:\n // >>> ByLength((new List()))\n // (new List())\n // If the array has any strange number ignore it:\n // >>> ByLength((new List(new long[]{(long)1L, (long)-1L, (long)55L})))\n // (new List(new string[]{(string)\"One\"}))\n public static List ByLength(List arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ByLength((new List(new long[]{(long)2L, (long)1L, (long)1L, (long)4L, (long)5L, (long)8L, (long)2L, (long)3L}))).Equals((new List(new string[]{(string)\"Eight\", (string)\"Five\", (string)\"Four\", (string)\"Three\", (string)\"Two\", (string)\"Two\", (string)\"One\", (string)\"One\"}))));\n Debug.Assert(ByLength((new List())).Equals((new List())));\n Debug.Assert(ByLength((new List(new long[]{(long)1L, (long)-1L, (long)55L}))).Equals((new List(new string[]{(string)\"One\"}))));\n Debug.Assert(ByLength((new List(new long[]{(long)1L, (long)-1L, (long)3L, (long)2L}))).Equals((new List(new string[]{(string)\"Three\", (string)\"Two\", (string)\"One\"}))));\n Debug.Assert(ByLength((new List(new long[]{(long)9L, (long)4L, (long)8L}))).Equals((new List(new string[]{(string)\"Nine\", (string)\"Eight\", (string)\"Four\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_106_f", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Implement the function f that takes n as a parameter,\n // 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\n // or the sum of numbers from 1 to i otherwise.\n // i starts from 1.\n // the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n // Example:\n // >>> F((5L))\n // (new List(new long[]{(long)1L, (long)2L, (long)6L, (long)24L, (long)15L}))\n public static List F(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(F((5L)).Equals((new List(new long[]{(long)1L, (long)2L, (long)6L, (long)24L, (long)15L}))));\n Debug.Assert(F((7L)).Equals((new List(new long[]{(long)1L, (long)2L, (long)6L, (long)24L, (long)15L, (long)720L, (long)28L}))));\n Debug.Assert(F((1L)).Equals((new List(new long[]{(long)1L}))));\n Debug.Assert(F((3L)).Equals((new List(new long[]{(long)1L, (long)2L, (long)6L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n // >>> FizzBuzz((50L))\n // (0L)\n // >>> FizzBuzz((78L))\n // (2L)\n // >>> FizzBuzz((79L))\n // (3L)\n public static long FizzBuzz(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FizzBuzz((50L)) == (0L));\n Debug.Assert(FizzBuzz((78L)) == (2L));\n Debug.Assert(FizzBuzz((79L)) == (3L));\n Debug.Assert(FizzBuzz((100L)) == (3L));\n Debug.Assert(FizzBuzz((200L)) == (6L));\n Debug.Assert(FizzBuzz((4000L)) == (192L));\n Debug.Assert(FizzBuzz((10000L)) == (639L));\n Debug.Assert(FizzBuzz((100000L)) == (8026L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a positive floating point number, it can be decomposed into\n // and integer part (largest integer smaller than given number) and decimals\n // (leftover part always smaller than 1).\n // Return the decimal part of the number.\n // >>> TruncateNumber((3.5f))\n // (0.5f)\n public static float TruncateNumber(float number) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(TruncateNumber((3.5f)) == (0.5f));\n Debug.Assert(TruncateNumber((1.25f)) == (0.25f));\n Debug.Assert(TruncateNumber((123.0f)) == (0.0f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n // Empty sum should be equal to 0 and empty product should be equal to 1.\n // >>> SumProduct((new List()))\n // (Tuple.Create(0L, 1L))\n // >>> SumProduct((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L})))\n // (Tuple.Create(10L, 24L))\n public static Tuple SumProduct(List numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SumProduct((new List())).Equals((Tuple.Create(0L, 1L))));\n Debug.Assert(SumProduct((new List(new long[]{(long)1L, (long)1L, (long)1L}))).Equals((Tuple.Create(3L, 1L))));\n Debug.Assert(SumProduct((new List(new long[]{(long)100L, (long)0L}))).Equals((Tuple.Create(100L, 0L))));\n Debug.Assert(SumProduct((new List(new long[]{(long)3L, (long)5L, (long)7L}))).Equals((Tuple.Create(15L, 105L))));\n Debug.Assert(SumProduct((new List(new long[]{(long)10L}))).Equals((Tuple.Create(10L, 10L))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a 2 dimensional data, as a nested lists,\n // which is similar to matrix, however, unlike matrices,\n // each row may contain a different number of columns.\n // Given lst, and integer x, find integers x in the list,\n // and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n // each tuple is a coordinate - (row, columns), starting with 0.\n // Sort coordinates initially by rows in ascending order.\n // Also, sort coordinates of the row by columns in descending order.\n // Examples:\n // >>> GetRow((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)1L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)1L})})), (1L))\n // (new List>(new Tuple[]{(Tuple)Tuple.Create(0L, 0L), (Tuple)Tuple.Create(1L, 4L), (Tuple)Tuple.Create(1L, 0L), (Tuple)Tuple.Create(2L, 5L), (Tuple)Tuple.Create(2L, 0L)}))\n // >>> GetRow((new List>()), (1L))\n // (new List>())\n // >>> GetRow((new List>(new List[]{(List)new List(), (List)new List(new long[]{(long)1L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L})})), (3L))\n // (new List>(new Tuple[]{(Tuple)Tuple.Create(2L, 2L)}))\n public static List> GetRow(List> lst, long x) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(GetRow((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)1L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)1L})})), (1L)).Equals((new List>(new Tuple[]{(Tuple)Tuple.Create(0L, 0L), (Tuple)Tuple.Create(1L, 4L), (Tuple)Tuple.Create(1L, 0L), (Tuple)Tuple.Create(2L, 5L), (Tuple)Tuple.Create(2L, 0L)}))));\n Debug.Assert(GetRow((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L})})), (2L)).Equals((new List>(new Tuple[]{(Tuple)Tuple.Create(0L, 1L), (Tuple)Tuple.Create(1L, 1L), (Tuple)Tuple.Create(2L, 1L), (Tuple)Tuple.Create(3L, 1L), (Tuple)Tuple.Create(4L, 1L), (Tuple)Tuple.Create(5L, 1L)}))));\n Debug.Assert(GetRow((new List>(new List[]{(List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)1L, (long)3L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)1L, (long)4L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)1L, (long)5L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)1L, (long)6L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)1L})})), (1L)).Equals((new List>(new Tuple[]{(Tuple)Tuple.Create(0L, 0L), (Tuple)Tuple.Create(1L, 0L), (Tuple)Tuple.Create(2L, 1L), (Tuple)Tuple.Create(2L, 0L), (Tuple)Tuple.Create(3L, 2L), (Tuple)Tuple.Create(3L, 0L), (Tuple)Tuple.Create(4L, 3L), (Tuple)Tuple.Create(4L, 0L), (Tuple)Tuple.Create(5L, 4L), (Tuple)Tuple.Create(5L, 0L), (Tuple)Tuple.Create(6L, 5L), (Tuple)Tuple.Create(6L, 0L)}))));\n Debug.Assert(GetRow((new List>()), (1L)).Equals((new List>())));\n Debug.Assert(GetRow((new List>(new List[]{(List)new List(new long[]{(long)1L})})), (2L)).Equals((new List>())));\n Debug.Assert(GetRow((new List>(new List[]{(List)new List(), (List)new List(new long[]{(long)1L}), (List)new List(new long[]{(long)1L, (long)2L, (long)3L})})), (3L)).Equals((new List>(new Tuple[]{(Tuple)Tuple.Create(2L, 2L)}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You're a hungry rabbit, and you already have eaten a certain number of carrots,\n // but now you need to eat more carrots to complete the day's meals.\n // you should return an array of [ total number of eaten carrots after your meals,\n // the number of carrots left after your meals ]\n // if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n // Example:\n // >>> Eat((5L), (6L), (10L))\n // (new List(new long[]{(long)11L, (long)4L}))\n // >>> Eat((4L), (8L), (9L))\n // (new List(new long[]{(long)12L, (long)1L}))\n // >>> Eat((1L), (10L), (10L))\n // (new List(new long[]{(long)11L, (long)0L}))\n // >>> Eat((2L), (11L), (5L))\n // (new List(new long[]{(long)7L, (long)0L}))\n // Variables:\n // @number : integer\n // the number of carrots that you have eaten.\n // @need : integer\n // the number of carrots that you need to eat.\n // @remaining : integer\n // the number of remaining carrots thet exist in stock\n // Constrain:\n // * 0 <= number <= 1000\n // * 0 <= need <= 1000\n // * 0 <= remaining <= 1000\n // Have fun :)\n public static List Eat(long number, long need, long remaining) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Eat((5L), (6L), (10L)).Equals((new List(new long[]{(long)11L, (long)4L}))));\n Debug.Assert(Eat((4L), (8L), (9L)).Equals((new List(new long[]{(long)12L, (long)1L}))));\n Debug.Assert(Eat((1L), (10L), (10L)).Equals((new List(new long[]{(long)11L, (long)0L}))));\n Debug.Assert(Eat((2L), (11L), (5L)).Equals((new List(new long[]{(long)7L, (long)0L}))));\n Debug.Assert(Eat((4L), (5L), (7L)).Equals((new List(new long[]{(long)9L, (long)2L}))));\n Debug.Assert(Eat((4L), (5L), (1L)).Equals((new List(new long[]{(long)5L, (long)0L}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a positive integer N, return the total sum of its digits in binary.\n // Example\n // >>> Solve((1000L))\n // (\"1\")\n // >>> Solve((150L))\n // (\"110\")\n // >>> Solve((147L))\n // (\"1100\")\n // Variables:\n // @N integer\n // Constraints: 0 \u2264 N \u2264 10000.\n // Output:\n // a string of binary number\n public static string Solve(long N) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Solve((1000L)).Equals((\"1\")));\n Debug.Assert(Solve((150L)).Equals((\"110\")));\n Debug.Assert(Solve((147L)).Equals((\"1100\")));\n Debug.Assert(Solve((333L)).Equals((\"1001\")));\n Debug.Assert(Solve((963L)).Equals((\"10010\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given a list of integers.\n // You need to find the largest prime value and return the sum of its digits.\n // Examples:\n // >>> Skjkasdkd((new List(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, (long)3L})))\n // (10L)\n // >>> Skjkasdkd((new List(new long[]{(long)1L, (long)0L, (long)1L, (long)8L, (long)2L, (long)4597L, (long)2L, (long)1L, (long)3L, (long)40L, (long)1L, (long)2L, (long)1L, (long)2L, (long)4L, (long)2L, (long)5L, (long)1L})))\n // (25L)\n // >>> Skjkasdkd((new List(new long[]{(long)1L, (long)3L, (long)1L, (long)32L, (long)5107L, (long)34L, (long)83278L, (long)109L, (long)163L, (long)23L, (long)2323L, (long)32L, (long)30L, (long)1L, (long)9L, (long)3L})))\n // (13L)\n // >>> Skjkasdkd((new List(new long[]{(long)0L, (long)724L, (long)32L, (long)71L, (long)99L, (long)32L, (long)6L, (long)0L, (long)5L, (long)91L, (long)83L, (long)0L, (long)5L, (long)6L})))\n // (11L)\n // >>> Skjkasdkd((new List(new long[]{(long)0L, (long)81L, (long)12L, (long)3L, (long)1L, (long)21L})))\n // (3L)\n // >>> Skjkasdkd((new List(new long[]{(long)0L, (long)8L, (long)1L, (long)2L, (long)1L, (long)7L})))\n // (7L)\n public static long Skjkasdkd(List lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Skjkasdkd((new List(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, (long)3L}))) == (10L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)1L, (long)0L, (long)1L, (long)8L, (long)2L, (long)4597L, (long)2L, (long)1L, (long)3L, (long)40L, (long)1L, (long)2L, (long)1L, (long)2L, (long)4L, (long)2L, (long)5L, (long)1L}))) == (25L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)1L, (long)3L, (long)1L, (long)32L, (long)5107L, (long)34L, (long)83278L, (long)109L, (long)163L, (long)23L, (long)2323L, (long)32L, (long)30L, (long)1L, (long)9L, (long)3L}))) == (13L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)0L, (long)724L, (long)32L, (long)71L, (long)99L, (long)32L, (long)6L, (long)0L, (long)5L, (long)91L, (long)83L, (long)0L, (long)5L, (long)6L}))) == (11L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)0L, (long)81L, (long)12L, (long)3L, (long)1L, (long)21L}))) == (3L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)0L, (long)8L, (long)1L, (long)2L, (long)1L, (long)7L}))) == (7L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)8191L}))) == (19L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)8191L, (long)123456L, (long)127L, (long)7L}))) == (19L));\n Debug.Assert(Skjkasdkd((new List(new long[]{(long)127L, (long)97L, (long)8192L}))) == (10L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given an array arr of integers, find the minimum number of elements that\n // need to be changed to make the array palindromic. A palindromic array is an array that\n // is read the same backwards and forwards. In one change, you can change one element to any other element.\n // For example:\n // >>> SmallestChange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)5L, (long)4L, (long)7L, (long)9L, (long)6L})))\n // (4L)\n // >>> SmallestChange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)3L, (long)2L, (long)2L})))\n // (1L)\n // >>> SmallestChange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)2L, (long)1L})))\n // (0L)\n public static long SmallestChange(List arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SmallestChange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)5L, (long)4L, (long)7L, (long)9L, (long)6L}))) == (4L));\n Debug.Assert(SmallestChange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)3L, (long)2L, (long)2L}))) == (1L));\n Debug.Assert(SmallestChange((new List(new long[]{(long)1L, (long)4L, (long)2L}))) == (1L));\n Debug.Assert(SmallestChange((new List(new long[]{(long)1L, (long)4L, (long)4L, (long)2L}))) == (1L));\n Debug.Assert(SmallestChange((new List(new long[]{(long)1L, (long)2L, (long)3L, (long)2L, (long)1L}))) == (0L));\n Debug.Assert(SmallestChange((new List(new long[]{(long)3L, (long)1L, (long)1L, (long)3L}))) == (0L));\n Debug.Assert(SmallestChange((new List(new long[]{(long)1L}))) == (0L));\n Debug.Assert(SmallestChange((new List(new long[]{(long)0L, (long)1L}))) == (1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // It is the last week of the semester and the teacher has to give the grades\n // to students. The teacher has been making her own algorithm for grading.\n // The only problem is, she has lost the code she used for grading.\n // She has given you a list of GPAs for some students and you have to write \n // a function that can output a list of letter grades using the following table:\n // GPA | Letter grade\n // 4.0 A+\n // > 3.7 A \n // > 3.3 A- \n // > 3.0 B+\n // > 2.7 B \n // > 2.3 B-\n // > 2.0 C+\n // > 1.7 C\n // > 1.3 C-\n // > 1.0 D+ \n // > 0.7 D \n // > 0.0 D-\n // 0.0 E\n // Example:\n // >>> GradeEquation((new List(new float[]{(float)4.0f, (float)3L, (float)1.7f, (float)2L, (float)3.5f})))\n // (new List(new string[]{(string)\"A+\", (string)\"B\", (string)\"C-\", (string)\"C\", (string)\"A-\"}))\n public static List NumericalLetterGrade(List grades) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(NumericalLetterGrade((new List(new float[]{(float)4.0f, (float)3L, (float)1.7f, (float)2L, (float)3.5f}))).Equals((new List(new string[]{(string)\"A+\", (string)\"B\", (string)\"C-\", (string)\"C\", (string)\"A-\"}))));\n Debug.Assert(NumericalLetterGrade((new List(new float[]{(float)1.2f}))).Equals((new List(new string[]{(string)\"D+\"}))));\n Debug.Assert(NumericalLetterGrade((new List(new float[]{(float)0.5f}))).Equals((new List(new string[]{(string)\"D-\"}))));\n Debug.Assert(NumericalLetterGrade((new List(new float[]{(float)0.0f}))).Equals((new List(new string[]{(string)\"E\"}))));\n Debug.Assert(NumericalLetterGrade((new List(new float[]{(float)1.0f, (float)0.3f, (float)1.5f, (float)2.8f, (float)3.3f}))).Equals((new List(new string[]{(string)\"D\", (string)\"D-\", (string)\"C-\", (string)\"B\", (string)\"B+\"}))));\n Debug.Assert(NumericalLetterGrade((new List(new float[]{(float)0.0f, (float)0.7f}))).Equals((new List(new string[]{(string)\"E\", (string)\"D-\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given the lengths of the three sides of a triangle. Return the area of\n // the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n // Otherwise return -1\n // Three sides make a valid triangle when the sum of any two sides is greater \n // than the third side.\n // Example:\n // >>> TriangleArea((3L), (4L), (5L))\n // (6.0f)\n // >>> TriangleArea((1L), (2L), (10L))\n // (float)-1L\n public static float TriangleArea(long a, long b, long c) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(TriangleArea((3L), (4L), (5L)) == (6.0f));\n Debug.Assert(TriangleArea((1L), (2L), (10L)) == (float)-1L);\n Debug.Assert(TriangleArea((4L), (8L), (5L)) == (8.18f));\n Debug.Assert(TriangleArea((2L), (2L), (2L)) == (1.73f));\n Debug.Assert(TriangleArea((1L), (2L), (3L)) == (float)-1L);\n Debug.Assert(TriangleArea((10L), (5L), (7L)) == (16.25f));\n Debug.Assert(TriangleArea((2L), (6L), (3L)) == (float)-1L);\n Debug.Assert(TriangleArea((1L), (1L), (1L)) == (0.43f));\n Debug.Assert(TriangleArea((2L), (2L), (10L)) == (float)-1L);\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Check if two words have the same characters.\n // >>> SameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddeddabc\"))\n // (true)\n // >>> SameChars((\"abcd\"), (\"dddddddabc\"))\n // (true)\n // >>> SameChars((\"dddddddabc\"), (\"abcd\"))\n // (true)\n // >>> SameChars((\"eabcd\"), (\"dddddddabc\"))\n // (false)\n // >>> SameChars((\"abcd\"), (\"dddddddabce\"))\n // (false)\n // >>> SameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddddabc\"))\n // (false)\n public static bool SameChars(string s0, string s1) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddeddabc\")) == (true));\n Debug.Assert(SameChars((\"abcd\"), (\"dddddddabc\")) == (true));\n Debug.Assert(SameChars((\"dddddddabc\"), (\"abcd\")) == (true));\n Debug.Assert(SameChars((\"eabcd\"), (\"dddddddabc\")) == (false));\n Debug.Assert(SameChars((\"abcd\"), (\"dddddddabcf\")) == (false));\n Debug.Assert(SameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddddabc\")) == (false));\n Debug.Assert(SameChars((\"aabb\"), (\"aaccc\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given an array of integers nums, find the minimum sum of any non-empty sub-array\n // of nums.\n // Example\n // >>> Minsubarraysum((new List(new long[]{(long)2L, (long)3L, (long)4L, (long)1L, (long)2L, (long)4L})))\n // (1L)\n // >>> Minsubarraysum((new List(new long[]{(long)-1L, (long)-2L, (long)-3L})))\n // (-6L)\n public static long Minsubarraysum(List nums) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)2L, (long)3L, (long)4L, (long)1L, (long)2L, (long)4L}))) == (1L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)-1L, (long)-2L, (long)-3L}))) == (-6L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)-1L, (long)-2L, (long)-3L, (long)2L, (long)-10L}))) == (-14L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)-9999999999999999L}))) == (-9999999999999999L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)0L, (long)10L, (long)20L, (long)1000000L}))) == (0L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)-1L, (long)-2L, (long)-3L, (long)10L, (long)-5L}))) == (-6L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)100L, (long)-1L, (long)-2L, (long)-3L, (long)10L, (long)-5L}))) == (-6L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)10L, (long)11L, (long)13L, (long)8L, (long)3L, (long)4L}))) == (3L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)100L, (long)-33L, (long)32L, (long)-1L, (long)0L, (long)-2L}))) == (-33L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)-10L}))) == (-10L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)7L}))) == (7L));\n Debug.Assert(Minsubarraysum((new List(new long[]{(long)1L, (long)-1L}))) == (-1L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a string s and a natural number n, you have been tasked to implement \n // a function that returns a list of all words from string s that contain exactly \n // n consonants, in order these words appear in the string s.\n // If the string s is empty then the function should return an empty list.\n // Note: you may assume the input string contains only letters and spaces.\n // Examples:\n // >>> SelectWords((\"Mary had a little lamb\"), (4L))\n // (new List(new string[]{(string)\"little\"}))\n // >>> SelectWords((\"Mary had a little lamb\"), (3L))\n // (new List(new string[]{(string)\"Mary\", (string)\"lamb\"}))\n // >>> SelectWords((\"simple white space\"), (2L))\n // (new List())\n // >>> SelectWords((\"Hello world\"), (4L))\n // (new List(new string[]{(string)\"world\"}))\n // >>> SelectWords((\"Uncle sam\"), (3L))\n // (new List(new string[]{(string)\"Uncle\"}))\n public static List SelectWords(string s, long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(SelectWords((\"Mary had a little lamb\"), (4L)).Equals((new List(new string[]{(string)\"little\"}))));\n Debug.Assert(SelectWords((\"Mary had a little lamb\"), (3L)).Equals((new List(new string[]{(string)\"Mary\", (string)\"lamb\"}))));\n Debug.Assert(SelectWords((\"simple white space\"), (2L)).Equals((new List())));\n Debug.Assert(SelectWords((\"Hello world\"), (4L)).Equals((new List(new string[]{(string)\"world\"}))));\n Debug.Assert(SelectWords((\"Uncle sam\"), (3L)).Equals((new List(new string[]{(string)\"Uncle\"}))));\n Debug.Assert(SelectWords((\"\"), (4L)).Equals((new List())));\n Debug.Assert(SelectWords((\"a b c d e f\"), (1L)).Equals((new List(new string[]{(string)\"b\", (string)\"c\", (string)\"d\", (string)\"f\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return list of all prefixes from shortest to longest of the input string\n // >>> AllPrefixes((\"abc\"))\n // (new List(new string[]{(string)\"a\", (string)\"ab\", (string)\"abc\"}))\n public static List AllPrefixes(string str) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(AllPrefixes((\"\")).Equals((new List())));\n Debug.Assert(AllPrefixes((\"asdfgh\")).Equals((new List(new string[]{(string)\"a\", (string)\"as\", (string)\"asd\", (string)\"asdf\", (string)\"asdfg\", (string)\"asdfgh\"}))));\n Debug.Assert(AllPrefixes((\"WWW\")).Equals((new List(new string[]{(string)\"W\", (string)\"WW\", (string)\"WWW\"}))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function that takes a value (string) representing a number\n // and returns the closest integer to it. If the number is equidistant\n // from two integers, round it away from zero.\n // Examples\n // >>> ClosestInteger((\"10\"))\n // (10L)\n // >>> ClosestInteger((\"15.3\"))\n // (15L)\n // Note:\n // Rounding away from zero means that if the given number is equidistant\n // from two integers, the one you should return is the one that is the\n // farthest from zero. For example closest_integer(\"14.5\") should\n // return 15 and closest_integer(\"-14.5\") should return -15.\n public static long ClosestInteger(string value) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(ClosestInteger((\"10\")) == (10L));\n Debug.Assert(ClosestInteger((\"14.5\")) == (15L));\n Debug.Assert(ClosestInteger((\"-15.5\")) == (-16L));\n Debug.Assert(ClosestInteger((\"15.3\")) == (15L));\n Debug.Assert(ClosestInteger((\"0\")) == (0L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Create a function which takes a string representing a file's name, and returns\n // 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n // A file's name is considered to be valid if and only if all the following conditions \n // are met:\n // - There should not be more than three digits ('0'-'9') in the file's name.\n // - The file's name contains exactly one dot '.'\n // - The substring before the dot should not be empty, and it starts with a letter from \n // the latin alphapet ('a'-'z' and 'A'-'Z').\n // - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n // Examples:\n // >>> FileNameCheck((\"example.txt\"))\n // (\"Yes\")\n // >>> FileNameCheck((\"1example.dll\"))\n // (\"No\")\n public static string FileNameCheck(string file_name) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(FileNameCheck((\"example.txt\")).Equals((\"Yes\")));\n Debug.Assert(FileNameCheck((\"1example.dll\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"s1sdf3.asd\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"K.dll\")).Equals((\"Yes\")));\n Debug.Assert(FileNameCheck((\"MY16FILE3.exe\")).Equals((\"Yes\")));\n Debug.Assert(FileNameCheck((\"His12FILE94.exe\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"_Y.txt\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"?aREYA.exe\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"/this_is_valid.dll\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"this_is_valid.wow\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"this_is_valid.txt\")).Equals((\"Yes\")));\n Debug.Assert(FileNameCheck((\"this_is_valid.txtexe\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"#this2_i4s_5valid.ten\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"@this1_is6_valid.exe\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"this_is_12valid.6exe4.txt\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"all.exe.txt\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"I563_No.exe\")).Equals((\"Yes\")));\n Debug.Assert(FileNameCheck((\"Is3youfault.txt\")).Equals((\"Yes\")));\n Debug.Assert(FileNameCheck((\"no_one#knows.dll\")).Equals((\"Yes\")));\n Debug.Assert(FileNameCheck((\"1I563_Yes3.exe\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"I563_Yes3.txtt\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"final..txt\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"final132\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"_f4indsartal132.\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\".txt\")).Equals((\"No\")));\n Debug.Assert(FileNameCheck((\"s.\")).Equals((\"No\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You are given two intervals,\n // where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n // The given intervals are closed which means that the interval (start, end)\n // includes both start and end.\n // For each given interval, it is assumed that its start is less or equal its end.\n // Your task is to determine whether the length of intersection of these two \n // intervals is a prime number.\n // Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n // which its length is 1, which not a prime number.\n // If the length of the intersection is a prime number, return \"YES\",\n // otherwise, return \"NO\".\n // If the two intervals don't intersect, return \"NO\".\n // [input/output] samples:\n // >>> Intersection((Tuple.Create(1L, 2L)), (Tuple.Create(2L, 3L)))\n // (\"NO\")\n // >>> Intersection((Tuple.Create(-1L, 1L)), (Tuple.Create(0L, 4L)))\n // (\"NO\")\n // >>> Intersection((Tuple.Create(-3L, -1L)), (Tuple.Create(-5L, 5L)))\n // (\"YES\")\n public static string Intersection(Tuple interval1, Tuple interval2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(Intersection((Tuple.Create(1L, 2L)), (Tuple.Create(2L, 3L))).Equals((\"NO\")));\n Debug.Assert(Intersection((Tuple.Create(-1L, 1L)), (Tuple.Create(0L, 4L))).Equals((\"NO\")));\n Debug.Assert(Intersection((Tuple.Create(-3L, -1L)), (Tuple.Create(-5L, 5L))).Equals((\"YES\")));\n Debug.Assert(Intersection((Tuple.Create(-2L, 2L)), (Tuple.Create(-4L, 0L))).Equals((\"YES\")));\n Debug.Assert(Intersection((Tuple.Create(-11L, 2L)), (Tuple.Create(-1L, -1L))).Equals((\"NO\")));\n Debug.Assert(Intersection((Tuple.Create(1L, 2L)), (Tuple.Create(3L, 5L))).Equals((\"NO\")));\n Debug.Assert(Intersection((Tuple.Create(1L, 2L)), (Tuple.Create(1L, 2L))).Equals((\"NO\")));\n Debug.Assert(Intersection((Tuple.Create(-2L, -2L)), (Tuple.Create(-3L, -2L))).Equals((\"NO\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Return the largest prime factor of n. Assume n > 1 and is not a prime.\n // >>> LargestPrimeFactor((13195L))\n // (29L)\n // >>> LargestPrimeFactor((2048L))\n // (2L)\n public static long LargestPrimeFactor(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(LargestPrimeFactor((15L)) == (5L));\n Debug.Assert(LargestPrimeFactor((27L)) == (3L));\n Debug.Assert(LargestPrimeFactor((63L)) == (7L));\n Debug.Assert(LargestPrimeFactor((330L)) == (11L));\n Debug.Assert(LargestPrimeFactor((13195L)) == (29L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a string, find out how many distinct characters (regardless of case) does it consist of\n // >>> CountDistinctCharacters((\"xyzXYZ\"))\n // (3L)\n // >>> CountDistinctCharacters((\"Jerry\"))\n // (4L)\n public static long CountDistinctCharacters(string str) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(CountDistinctCharacters((\"\")) == (0L));\n Debug.Assert(CountDistinctCharacters((\"abcde\")) == (5L));\n Debug.Assert(CountDistinctCharacters((\"abcdecadeCADE\")) == (5L));\n Debug.Assert(CountDistinctCharacters((\"aaaaAAAAaaaa\")) == (1L));\n Debug.Assert(CountDistinctCharacters((\"Jerry jERRY JeRRRY\")) == (5L));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // You're given a list of deposit and withdrawal operations on a bank account that starts with\n // zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n // at that point function should return True. Otherwise it should return False.\n // >>> BelowZero((new List(new long[]{(long)1L, (long)2L, (long)3L})))\n // (false)\n // >>> BelowZero((new List(new long[]{(long)1L, (long)2L, (long)-4L, (long)5L})))\n // (true)\n public static bool BelowZero(List operations) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(BelowZero((new List())) == (false));\n Debug.Assert(BelowZero((new List(new long[]{(long)1L, (long)2L, (long)-3L, (long)1L, (long)2L, (long)-3L}))) == (false));\n Debug.Assert(BelowZero((new List(new long[]{(long)1L, (long)2L, (long)-4L, (long)5L, (long)6L}))) == (true));\n Debug.Assert(BelowZero((new List(new long[]{(long)1L, (long)-1L, (long)2L, (long)-2L, (long)5L, (long)-5L, (long)4L, (long)-4L}))) == (false));\n Debug.Assert(BelowZero((new List(new long[]{(long)1L, (long)-1L, (long)2L, (long)-2L, (long)5L, (long)-5L, (long)4L, (long)-5L}))) == (true));\n Debug.Assert(BelowZero((new List(new long[]{(long)1L, (long)-2L, (long)2L, (long)-2L, (long)5L, (long)-5L, (long)4L, (long)-4L}))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Find the shortest palindrome that begins with a supplied string.\n // Algorithm idea is simple:\n // - Find the longest postfix of supplied string that is a palindrome.\n // - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n // >>> MakePalindrome((\"\"))\n // (\"\")\n // >>> MakePalindrome((\"cat\"))\n // (\"catac\")\n // >>> MakePalindrome((\"cata\"))\n // (\"catac\")\n public static string MakePalindrome(string str) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(MakePalindrome((\"\")).Equals((\"\")));\n Debug.Assert(MakePalindrome((\"x\")).Equals((\"x\")));\n Debug.Assert(MakePalindrome((\"xyz\")).Equals((\"xyzyx\")));\n Debug.Assert(MakePalindrome((\"xyx\")).Equals((\"xyx\")));\n Debug.Assert(MakePalindrome((\"jerry\")).Equals((\"jerryrrej\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "cs", - "prompt": "using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nclass Problem {\n // Given a positive integer, obtain its roman numeral equivalent as a string,\n // and return it in lowercase.\n // Restrictions: 1 <= num <= 1000\n // Examples:\n // >>> IntToMiniRoman((19L))\n // (\"xix\")\n // >>> IntToMiniRoman((152L))\n // (\"clii\")\n // >>> IntToMiniRoman((426L))\n // (\"cdxxvi\")\n public static string IntToMiniRoman(long number) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void Main(string[] args) {\n Debug.Assert(IntToMiniRoman((19L)).Equals((\"xix\")));\n Debug.Assert(IntToMiniRoman((152L)).Equals((\"clii\")));\n Debug.Assert(IntToMiniRoman((251L)).Equals((\"ccli\")));\n Debug.Assert(IntToMiniRoman((426L)).Equals((\"cdxxvi\")));\n Debug.Assert(IntToMiniRoman((500L)).Equals((\"d\")));\n Debug.Assert(IntToMiniRoman((1L)).Equals((\"i\")));\n Debug.Assert(IntToMiniRoman((4L)).Equals((\"iv\")));\n Debug.Assert(IntToMiniRoman((43L)).Equals((\"xliii\")));\n Debug.Assert(IntToMiniRoman((90L)).Equals((\"xc\")));\n Debug.Assert(IntToMiniRoman((94L)).Equals((\"xciv\")));\n Debug.Assert(IntToMiniRoman((532L)).Equals((\"dxxxii\")));\n Debug.Assert(IntToMiniRoman((900L)).Equals((\"cm\")));\n Debug.Assert(IntToMiniRoman((994L)).Equals((\"cmxciv\")));\n Debug.Assert(IntToMiniRoman((1000L)).Equals((\"m\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - } -] \ No newline at end of file diff --git a/data/d-keep.json b/data/d-keep.json deleted file mode 100644 index b13970f4fea2ca42802dc1921a7a423b40379898..0000000000000000000000000000000000000000 --- a/data/d-keep.json +++ /dev/null @@ -1,2342 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "d", - "prompt": "import std.math;\n/*\n For a given number n, find the largest number that divides n evenly, smaller than n\n >>> largest_divisor(15)\n 5\n \n*/\nlong largest_divisor(long n) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = largest_divisor;\n\n assert(candidate(3L) == 1L);\n assert(candidate(7L) == 1L);\n assert(candidate(10L) == 5L);\n assert(candidate(100L) == 50L);\n assert(candidate(49L) == 7L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_47_median", - "language": "d", - "prompt": "import std.math;\n/*\nReturn median of elements in the list l.\n >>> median([3, 1, 2, 4, 5])\n 3\n >>> median([-10, 4, 6, 1000, 10, 20])\n 15.0\n \n*/\nfloat median(long[] l) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = median;\n\n assert(candidate([3L, 1L, 2L, 4L, 5L]) == 3L);\n assert(candidate([-10L, 4L, 6L, 1000L, 10L, 20L]) == 8.0);\n assert(candidate([5L]) == 5L);\n assert(candidate([6L, 5L]) == 5.5);\n assert(candidate([8L, 1L, 3L, 9L, 9L, 2L, 7L]) == 7L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "d", - "prompt": "import std.math;\n/*\n\n Given two lists operator, and operand. The first list has basic algebra operations, and \n the second list is a list of integers. Use the two given lists to build the algebric \n expression and return the evaluation of this expression.\n\n The basic algebra operations:\n Addition ( + ) \n Subtraction ( - ) \n Multiplication ( * ) \n Floor division ( // ) \n Exponentiation ( ** ) \n\n Example:\n operator['+', '*', '-']\n array = [2, 3, 4, 5]\n result = 2 + 3 * 4 - 5\n => result = 9\n\n Note:\n The length of operator list is equal to the length of operand list minus one.\n Operand is a list of of non-negative integers.\n Operator list has at least one operator, and operand list has at least two operands.\n\n \n*/\nlong do_algebra(string[] operator, long[] operand) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = do_algebra;\n\n assert(candidate([\"**\", \"*\", \"+\"], [2L, 3L, 4L, 5L]) == 37L);\n assert(candidate([\"+\", \"*\", \"-\"], [2L, 3L, 4L, 5L]) == 9L);\n assert(candidate([\"//\", \"*\"], [7L, 3L, 4L]) == 8L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "d", - "prompt": "import std.math;\n/*\nReturn maximum element in the list.\n >>> max_element([1, 2, 3])\n 3\n >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n 123\n \n*/\nlong max_element(long[] l) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = max_element;\n\n assert(candidate([1L, 2L, 3L]) == 3L);\n assert(candidate([5L, 3L, -5L, 2L, -3L, 3L, 9L, 0L, 124L, 1L, -10L]) == 124L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "d", - "prompt": "import std.math;\n/*\nCreate a function which returns the largest index of an element which\n is not greater than or equal to the element immediately preceding it. If\n no such element exists then return -1. The given array will not contain\n duplicate values.\n\n Examples:\n can_arrange([1,2,4,3,5]) = 3\n can_arrange([1,2,3]) = -1\n \n*/\nlong can_arrange(long[] arr) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = can_arrange;\n\n assert(candidate([1L, 2L, 4L, 3L, 5L]) == 3L);\n assert(candidate([1L, 2L, 4L, 5L]) == -1L);\n assert(candidate([1L, 4L, 2L, 5L, 6L, 7L, 8L, 9L, 10L]) == 2L);\n assert(candidate([4L, 8L, 5L, 7L, 3L]) == 4L);\n assert(candidate([]) == -1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "d", - "prompt": "import std.math;\n/*\n\n Imagine a road that's a perfectly straight infinitely long line.\n n cars are driving left to right; simultaneously, a different set of n cars\n are driving right to left. The two sets of cars start out being very far from\n each other. All cars move in the same speed. Two cars are said to collide\n when a car that's moving left to right hits a car that's moving right to left.\n However, the cars are infinitely sturdy and strong; as a result, they continue moving\n in their trajectory as if they did not collide.\n\n This function outputs the number of such collisions.\n \n*/\nlong car_race_collision(long n) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = car_race_collision;\n\n assert(candidate(2L) == 4L);\n assert(candidate(3L) == 9L);\n assert(candidate(4L) == 16L);\n assert(candidate(8L) == 64L);\n assert(candidate(10L) == 100L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "d", - "prompt": "import std.math;\n/*\n\n Create a function that returns True if the last character\n of a given string is an alphabetical character and is not\n a part of a word, and False otherwise.\n Note: \"word\" is a group of characters separated by space.\n\n Examples:\n check_if_last_char_is_a_letter(\"apple pie\") \u279e False\n check_if_last_char_is_a_letter(\"apple pi e\") \u279e True\n check_if_last_char_is_a_letter(\"apple pi e \") \u279e False\n check_if_last_char_is_a_letter(\"\") \u279e False \n \n*/\nbool check_if_last_char_is_a_letter(string txt) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = check_if_last_char_is_a_letter;\n\n assert(candidate(\"apple\") == false);\n assert(candidate(\"apple pi e\") == true);\n assert(candidate(\"eeeee\") == false);\n assert(candidate(\"A\") == true);\n assert(candidate(\"Pumpkin pie \") == false);\n assert(candidate(\"Pumpkin pie 1\") == false);\n assert(candidate(\"\") == false);\n assert(candidate(\"eeeee e \") == false);\n assert(candidate(\"apple pie\") == false);\n assert(candidate(\"apple pi e \") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "d", - "prompt": "import std.math;\n/*\nReturn true if a given number is prime, and false otherwise.\n >>> is_prime(6)\n False\n >>> is_prime(101)\n True\n >>> is_prime(11)\n True\n >>> is_prime(13441)\n True\n >>> is_prime(61)\n True\n >>> is_prime(4)\n False\n >>> is_prime(1)\n False\n \n*/\nbool is_prime(long n) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = is_prime;\n\n assert(candidate(6L) == false);\n assert(candidate(101L) == true);\n assert(candidate(11L) == true);\n assert(candidate(13441L) == true);\n assert(candidate(61L) == true);\n assert(candidate(4L) == false);\n assert(candidate(1L) == false);\n assert(candidate(5L) == true);\n assert(candidate(11L) == true);\n assert(candidate(17L) == true);\n assert(candidate(85L) == false);\n assert(candidate(77L) == false);\n assert(candidate(255379L) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "d", - "prompt": "import std.math;\n/*\nGiven a list of positive integers x. return a sorted list of all \n elements that hasn't any even digit.\n\n Note: Returned list should be sorted in increasing order.\n \n For example:\n >>> unique_digits([15, 33, 1422, 1])\n [1, 15, 33]\n >>> unique_digits([152, 323, 1422, 10])\n []\n \n*/\nlong[] unique_digits(long[] x) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = unique_digits;\n\n assert(candidate([15L, 33L, 1422L, 1L]) == [1L, 15L, 33L]);\n assert(candidate([152L, 323L, 1422L, 10L]) == []);\n assert(candidate([12345L, 2033L, 111L, 151L]) == [111L, 151L]);\n assert(candidate([135L, 103L, 31L]) == [31L, 135L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "d", - "prompt": "import std.math;\n/*\n Input are two strings a and b consisting only of 1s and 0s.\n Perform binary XOR on these inputs and return result also as a string.\n >>> string_xor('010', '110')\n '100'\n \n*/\nstring string_xor(string a, string b) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = string_xor;\n\n assert(candidate(\"111000\", \"101010\") == \"010010\");\n assert(candidate(\"1\", \"1\") == \"0\");\n assert(candidate(\"0101\", \"0000\") == \"0101\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "d", - "prompt": "import std.math;\n/*\nsum_to_n is a function that sums numbers from 1 to n.\n >>> sum_to_n(30)\n 465\n >>> sum_to_n(100)\n 5050\n >>> sum_to_n(5)\n 15\n >>> sum_to_n(10)\n 55\n >>> sum_to_n(1)\n 1\n \n*/\nlong sum_to_n(long n) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = sum_to_n;\n\n assert(candidate(1L) == 1L);\n assert(candidate(6L) == 21L);\n assert(candidate(11L) == 66L);\n assert(candidate(30L) == 465L);\n assert(candidate(100L) == 5050L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "d", - "prompt": "import std.math;\n/*\n\n Given a list of numbers, return the sum of squares of the numbers\n in the list that are odd. Ignore numbers that are negative or not integers.\n \n double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10\n double_the_difference([-1, -2, 0]) == 0\n double_the_difference([9, -2]) == 81\n double_the_difference([0]) == 0 \n \n If the input list is empty, return 0.\n \n*/\nlong double_the_difference(float[] lst) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = double_the_difference;\n\n assert(candidate([]) == 0L);\n assert(candidate([5.0, 4.0]) == 25L);\n assert(candidate([0.1, 0.2, 0.3]) == 0L);\n assert(candidate([-10.0, -20.0, -30.0]) == 0L);\n assert(candidate([-1.0, -2.0, 8.0]) == 0L);\n assert(candidate([0.2, 3.0, 5.0]) == 34L);\n assert(candidate([-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]) == 165L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "d", - "prompt": "import std.math;\n/*\n Return length of given string\n >>> strlen('')\n 0\n >>> strlen('abc')\n 3\n \n*/\nlong strlen(string string) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = strlen;\n\n assert(candidate(\"\") == 0L);\n assert(candidate(\"x\") == 1L);\n assert(candidate(\"asdasnakj\") == 9L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "d", - "prompt": "import std.math;\n/*\n\n You'll be given a string of words, and your task is to count the number\n of boredoms. A boredom is a sentence that starts with the word \"I\".\n Sentences are delimited by '.', '?' or '!'.\n \n For example:\n >>> is_bored(\"Hello world\")\n 0\n >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n 1\n \n*/\nlong is_bored(string S) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = is_bored;\n\n assert(candidate(\"Hello world\") == 0L);\n assert(candidate(\"Is the sky blue?\") == 0L);\n assert(candidate(\"I love It !\") == 1L);\n assert(candidate(\"bIt\") == 0L);\n assert(candidate(\"I feel good today. I will be productive. will kill It\") == 2L);\n assert(candidate(\"You and I are going for a walk\") == 0L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "d", - "prompt": "import std.math;\n/*\nWrite a function vowels_count which takes a string representing\n a word as input and returns the number of vowels in the string.\n Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n vowel, but only when it is at the end of the given word.\n\n Example:\n >>> vowels_count(\"abcde\")\n 2\n >>> vowels_count(\"ACEDY\")\n 3\n \n*/\nlong vowels_count(string s) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = vowels_count;\n\n assert(candidate(\"abcde\") == 2L);\n assert(candidate(\"Alone\") == 3L);\n assert(candidate(\"key\") == 2L);\n assert(candidate(\"bye\") == 1L);\n assert(candidate(\"keY\") == 2L);\n assert(candidate(\"bYe\") == 1L);\n assert(candidate(\"ACEDY\") == 3L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "d", - "prompt": "import std.math;\n/*\nReturn n-th Fibonacci number.\n >>> fib(10)\n 55\n >>> fib(1)\n 1\n >>> fib(8)\n 21\n \n*/\nlong fib(long n) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = fib;\n\n assert(candidate(10L) == 55L);\n assert(candidate(1L) == 1L);\n assert(candidate(8L) == 21L);\n assert(candidate(11L) == 89L);\n assert(candidate(12L) == 144L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "d", - "prompt": "import std.math;\n/*\nYour task is to implement a function that will simplify the expression\n x * n. The function returns True if x * n evaluates to a whole number and False\n otherwise. Both x and n, are string representation of a fraction, and have the following format,\n / where both numerator and denominator are positive whole numbers.\n\n You can assume that x, and n are valid fractions, and do not have zero as denominator.\n\n simplify(\"1/5\", \"5/1\") = True\n simplify(\"1/6\", \"2/1\") = False\n simplify(\"7/10\", \"10/2\") = False\n \n*/\nbool simplify(string x, string n) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = simplify;\n\n assert(candidate(\"1/5\", \"5/1\") == true);\n assert(candidate(\"1/6\", \"2/1\") == false);\n assert(candidate(\"5/1\", \"3/1\") == true);\n assert(candidate(\"7/10\", \"10/2\") == false);\n assert(candidate(\"2/10\", \"50/10\") == true);\n assert(candidate(\"7/2\", \"4/2\") == true);\n assert(candidate(\"11/6\", \"6/1\") == true);\n assert(candidate(\"2/3\", \"5/2\") == false);\n assert(candidate(\"5/2\", \"3/5\") == false);\n assert(candidate(\"2/4\", \"8/4\") == true);\n assert(candidate(\"2/4\", \"4/2\") == true);\n assert(candidate(\"1/5\", \"5/1\") == true);\n assert(candidate(\"1/5\", \"1/5\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "d", - "prompt": "import std.math;\n/*\n\n Given a string s, count the number of uppercase vowels in even indices.\n \n For example:\n count_upper('aBCdEf') returns 1\n count_upper('abcdefg') returns 0\n count_upper('dBBE') returns 0\n \n*/\nlong count_upper(string s) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = count_upper;\n\n assert(candidate(\"aBCdEf\") == 1L);\n assert(candidate(\"abcdefg\") == 0L);\n assert(candidate(\"dBBE\") == 0L);\n assert(candidate(\"B\") == 0L);\n assert(candidate(\"U\") == 1L);\n assert(candidate(\"\") == 0L);\n assert(candidate(\"EEEE\") == 2L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "d", - "prompt": "import std.math;\n/*\n\n You are given a rectangular grid of wells. Each row represents a single well,\n and each 1 in a row represents a single unit of water.\n Each well has a corresponding bucket that can be used to extract water from it, \n and all buckets have the same capacity.\n Your task is to use the buckets to empty the wells.\n Output the number of times you need to lower the buckets.\n\n Example 1:\n Input: \n grid : [[0,0,1,0], [0,1,0,0], [1,1,1,1]]\n bucket_capacity : 1\n Output: 6\n\n Example 2:\n Input: \n grid : [[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]]\n bucket_capacity : 2\n Output: 5\n \n Example 3:\n Input: \n grid : [[0,0,0], [0,0,0]]\n bucket_capacity : 5\n Output: 0\n\n Constraints:\n * all wells have the same length\n * 1 <= grid.length <= 10^2\n * 1 <= grid[:,1].length <= 10^2\n * grid[i][j] -> 0 | 1\n * 1 <= capacity <= 10\n \n*/\nlong max_fill(long[][] grid, long capacity) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = max_fill;\n\n assert(candidate([[0L, 0L, 1L, 0L], [0L, 1L, 0L, 0L], [1L, 1L, 1L, 1L]], 1L) == 6L);\n assert(candidate([[0L, 0L, 1L, 1L], [0L, 0L, 0L, 0L], [1L, 1L, 1L, 1L], [0L, 1L, 1L, 1L]], 2L) == 5L);\n assert(candidate([[0L, 0L, 0L], [0L, 0L, 0L]], 5L) == 0L);\n assert(candidate([[1L, 1L, 1L, 1L], [1L, 1L, 1L, 1L]], 2L) == 4L);\n assert(candidate([[1L, 1L, 1L, 1L], [1L, 1L, 1L, 1L]], 9L) == 2L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "d", - "prompt": "import std.math;\n/*\n\n Given an array arr of integers and a positive integer k, return a sorted list \n of length k with the maximum k numbers in arr.\n\n Example 1:\n\n Input: arr = [-3, -4, 5], k = 3\n Output: [-4, -3, 5]\n\n Example 2:\n\n Input: arr = [4, -4, 4], k = 2\n Output: [4, 4]\n\n Example 3:\n\n Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1\n Output: [2]\n\n Note:\n 1. The length of the array will be in the range of [1, 1000].\n 2. The elements in the array will be in the range of [-1000, 1000].\n 3. 0 <= k <= len(arr)\n \n*/\nlong[] maximum(long[] arr, long k) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = maximum;\n\n assert(candidate([-3L, -4L, 5L], 3L) == [-4L, -3L, 5L]);\n assert(candidate([4L, -4L, 4L], 2L) == [4L, 4L]);\n assert(candidate([-3L, 2L, 1L, 2L, -1L, -2L, 1L], 1L) == [2L]);\n assert(candidate([123L, -123L, 20L, 0L, 1L, 2L, -3L], 3L) == [2L, 20L, 123L]);\n assert(candidate([-123L, 20L, 0L, 1L, 2L, -3L], 4L) == [0L, 1L, 2L, 20L]);\n assert(candidate([5L, 15L, 0L, 3L, -13L, -8L, 0L], 7L) == [-13L, -8L, 0L, 0L, 3L, 5L, 15L]);\n assert(candidate([-1L, 0L, 2L, 5L, 3L, -10L], 2L) == [3L, 5L]);\n assert(candidate([1L, 0L, 5L, -7L], 1L) == [5L]);\n assert(candidate([4L, -4L], 2L) == [-4L, 4L]);\n assert(candidate([-10L, 10L], 2L) == [-10L, 10L]);\n assert(candidate([1L, 2L, 3L, -23L, 243L, -400L, 0L], 0L) == []);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "d", - "prompt": "import std.math;\n/*\n\n Write a function that takes a message, and encodes in such a \n way that it swaps case of all letters, replaces all vowels in \n the message with the letter that appears 2 places ahead of that \n vowel in the english alphabet. \n Assume only letters. \n \n Examples:\n >>> encode('test')\n 'TGST'\n >>> encode('This is a message')\n 'tHKS KS C MGSSCGG'\n \n*/\nstring encode(string message) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = encode;\n\n assert(candidate(\"TEST\") == \"tgst\");\n assert(candidate(\"Mudasir\") == \"mWDCSKR\");\n assert(candidate(\"YES\") == \"ygs\");\n assert(candidate(\"This is a message\") == \"tHKS KS C MGSSCGG\");\n assert(candidate(\"I DoNt KnOw WhAt tO WrItE\") == \"k dQnT kNqW wHcT Tq wRkTg\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "d", - "prompt": "import std.math;\n/*\n\n remove_vowels is a function that takes string and returns string without vowels.\n >>> remove_vowels('')\n ''\n >>> remove_vowels('abcdef')\n 'bcdf'\n >>> remove_vowels('aaaaa')\n ''\n >>> remove_vowels('aaBAA')\n 'B'\n >>> remove_vowels('zbcd')\n 'zbcd'\n \n*/\nstring remove_vowels(string text) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = remove_vowels;\n\n assert(candidate(\"\") == \"\");\n assert(candidate(\"abcdef\nghijklm\") == \"bcdf\nghjklm\");\n assert(candidate(\"fedcba\") == \"fdcb\");\n assert(candidate(\"eeeee\") == \"\");\n assert(candidate(\"acBAA\") == \"cB\");\n assert(candidate(\"EcBOO\") == \"cB\");\n assert(candidate(\"ybcd\") == \"ybcd\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "d", - "prompt": "import std.math;\n/*\nReturn only positive numbers in the list.\n >>> get_positive([-1, 2, -4, 5, 6])\n [2, 5, 6]\n >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n [5, 3, 2, 3, 9, 123, 1]\n \n*/\nlong[] get_positive(long[] l) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = get_positive;\n\n assert(candidate([-1L, -2L, 4L, 5L, 6L]) == [4L, 5L, 6L]);\n assert(candidate([5L, 3L, -5L, 2L, 3L, 3L, 9L, 0L, 123L, 1L, -10L]) == [5L, 3L, 2L, 3L, 3L, 9L, 123L, 1L]);\n assert(candidate([-1L, -2L]) == []);\n assert(candidate([]) == []);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "d", - "prompt": "import std.math;\n/*\n Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n >>> string_sequence(0)\n '0'\n >>> string_sequence(5)\n '0 1 2 3 4 5'\n \n*/\nstring string_sequence(long n) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = string_sequence;\n\n assert(candidate(0L) == \"0\");\n assert(candidate(3L) == \"0 1 2 3\");\n assert(candidate(10L) == \"0 1 2 3 4 5 6 7 8 9 10\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "d", - "prompt": "import std.math;\n/*\n\n Given a positive integer n, you have to make a pile of n levels of stones.\n The first level has n stones.\n The number of stones in the next level is:\n - the next odd number if n is odd.\n - the next even number if n is even.\n Return the number of stones in each level in a list, where element at index\n i represents the number of stones in the level (i+1).\n\n Examples:\n >>> make_a_pile(3)\n [3, 5, 7]\n \n*/\nlong[] make_a_pile(long n) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = make_a_pile;\n\n assert(candidate(3L) == [3L, 5L, 7L]);\n assert(candidate(4L) == [4L, 6L, 8L, 10L]);\n assert(candidate(5L) == [5L, 7L, 9L, 11L, 13L]);\n assert(candidate(6L) == [6L, 8L, 10L, 12L, 14L, 16L]);\n assert(candidate(8L) == [8L, 10L, 12L, 14L, 16L, 18L, 20L, 22L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nTask\n 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\n then check if the result string is palindrome.\n A string is called palindrome if it reads the same backward as forward.\n You should return a tuple containing the result string and True/False for the check.\n Example\n For s = \"abcde\", c = \"ae\", the result should be ('bcd',False)\n For s = \"abcdef\", c = \"b\" the result should be ('acdef',False)\n For s = \"abcdedcba\", c = \"ab\", the result should be ('cdedc',True)\n \n*/\nTuple!(string, bool) reverse_delete(string s, string c) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = reverse_delete;\n\n assert(candidate(\"abcde\", \"ae\") == tuple(\"bcd\", false));\n assert(candidate(\"abcdef\", \"b\") == tuple(\"acdef\", false));\n assert(candidate(\"abcdedcba\", \"ab\") == tuple(\"cdedc\", true));\n assert(candidate(\"dwik\", \"w\") == tuple(\"dik\", false));\n assert(candidate(\"a\", \"a\") == tuple(\"\", true));\n assert(candidate(\"abcdedcba\", \"\") == tuple(\"abcdedcba\", true));\n assert(candidate(\"abcdedcba\", \"v\") == tuple(\"abcdedcba\", true));\n assert(candidate(\"vabba\", \"v\") == tuple(\"abba\", true));\n assert(candidate(\"mamma\", \"mia\") == tuple(\"\", true));\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n >>> flip_case('Hello')\n 'hELLO'\n \n*/\nstring flip_case(string string) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = flip_case;\n\n assert(candidate(\"\") == \"\");\n assert(candidate(\"Hello!\") == \"hELLO!\");\n assert(candidate(\"These violent delights have violent ends\") == \"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou are given a string s.\n if s[i] is a letter, reverse its case from lower to upper or vise versa, \n otherwise keep it as it is.\n If the string contains no letters, reverse the string.\n The function should return the resulted string.\n Examples\n solve(\"1234\") = \"4321\"\n solve(\"ab\") = \"AB\"\n solve(\"#a@C\") = \"#A@c\"\n \n*/\nstring solve(string s) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = solve;\n\n assert(candidate(\"AsDf\") == \"aSdF\");\n assert(candidate(\"1234\") == \"4321\");\n assert(candidate(\"ab\") == \"AB\");\n assert(candidate(\"#a@C\") == \"#A@c\");\n assert(candidate(\"#AsdfW^45\") == \"#aSDFw^45\");\n assert(candidate(\"#6@2\") == \"2@6#\");\n assert(candidate(\"#$a^D\") == \"#$A^d\");\n assert(candidate(\"#ccc\") == \"#CCC\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Filter an input list of strings only for ones that start with a given prefix.\n >>> filter_by_prefix([], 'a')\n []\n >>> filter_by_prefix(['abc', 'bcd', 'cde', 'array'], 'a')\n ['abc', 'array']\n \n*/\nstring[] filter_by_prefix(string[] strings, string prefix) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = filter_by_prefix;\n\n assert(candidate([], \"john\") == []);\n assert(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\") == [\"xxx\", \"xxxAAA\", \"xxx\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nThis function takes two positive numbers x and y and returns the\n biggest even integer number that is in the range [x, y] inclusive. If \n there's no such number, then the function should return -1.\n\n For example:\n choose_num(12, 15) = 14\n choose_num(13, 12) = -1\n \n*/\nlong choose_num(long x, long y) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = choose_num;\n\n assert(candidate(12L, 15L) == 14L);\n assert(candidate(13L, 12L) == -1L);\n assert(candidate(33L, 12354L) == 12354L);\n assert(candidate(5234L, 5233L) == -1L);\n assert(candidate(6L, 29L) == 28L);\n assert(candidate(27L, 10L) == -1L);\n assert(candidate(7L, 7L) == -1L);\n assert(candidate(546L, 546L) == 546L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n You are given a string representing a sentence,\n the sentence contains some words separated by a space,\n and you have to return a string that contains the words from the original sentence,\n whose lengths are prime numbers,\n the order of the words in the new string should be the same as the original one.\n\n Example 1:\n Input: sentence = \"This is a test\"\n Output: \"is\"\n\n Example 2:\n Input: sentence = \"lets go for swimming\"\n Output: \"go for\"\n\n Constraints:\n * 1 <= len(sentence) <= 100\n * sentence contains only letters\n \n*/\nstring words_in_sentence(string sentence) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = words_in_sentence;\n\n assert(candidate(\"This is a test\") == \"is\");\n assert(candidate(\"lets go for swimming\") == \"go for\");\n assert(candidate(\"there is no place available here\") == \"there is no place\");\n assert(candidate(\"Hi I am Hussein\") == \"Hi am Hussein\");\n assert(candidate(\"go for it\") == \"go for it\");\n assert(candidate(\"here\") == \"\");\n assert(candidate(\"here is\") == \"is\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n >>> intersperse([], 4)\n []\n >>> intersperse([1, 2, 3], 4)\n [1, 4, 2, 4, 3]\n \n*/\nlong[] intersperse(long[] numbers, long delimeter) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = intersperse;\n\n assert(candidate([], 7L) == []);\n assert(candidate([5L, 6L, 3L, 2L], 8L) == [5L, 8L, 6L, 8L, 3L, 8L, 2L]);\n assert(candidate([2L, 2L, 2L], 2L) == [2L, 2L, 2L, 2L, 2L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYour task is to write a function that returns true if a number x is a simple\n power of n and false in other cases.\n x is a simple power of n if n**int=x\n For example:\n is_simple_power(1, 4) => true\n is_simple_power(2, 2) => true\n is_simple_power(8, 2) => true\n is_simple_power(3, 2) => false\n is_simple_power(3, 1) => false\n is_simple_power(5, 3) => false\n \n*/\nbool is_simple_power(long x, long n) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = is_simple_power;\n\n assert(candidate(16L, 2L) == true);\n assert(candidate(143214L, 16L) == false);\n assert(candidate(4L, 2L) == true);\n assert(candidate(9L, 3L) == true);\n assert(candidate(16L, 4L) == true);\n assert(candidate(24L, 2L) == false);\n assert(candidate(128L, 4L) == false);\n assert(candidate(12L, 6L) == false);\n assert(candidate(1L, 1L) == true);\n assert(candidate(1L, 12L) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nWrite a function that returns true if the given number is the multiplication of 3 prime numbers\n and false otherwise.\n Knowing that (a) is less then 100. \n Example:\n is_multiply_prime(30) == True\n 30 = 2 * 3 * 5\n \n*/\nbool is_multiply_prime(long a) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = is_multiply_prime;\n\n assert(candidate(5L) == false);\n assert(candidate(30L) == true);\n assert(candidate(8L) == true);\n assert(candidate(10L) == false);\n assert(candidate(125L) == true);\n assert(candidate(105L) == true);\n assert(candidate(126L) == false);\n assert(candidate(729L) == false);\n assert(candidate(891L) == false);\n assert(candidate(1001L) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given the lengths of the three sides of a triangle. Return True if the three\n sides form a right-angled triangle, False otherwise.\n A right-angled triangle is a triangle in which one angle is right angle or \n 90 degree.\n Example:\n right_angle_triangle(3, 4, 5) == True\n right_angle_triangle(1, 2, 3) == False\n \n*/\nbool right_angle_triangle(long a, long b, long c) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = right_angle_triangle;\n\n assert(candidate(3L, 4L, 5L) == true);\n assert(candidate(1L, 2L, 3L) == false);\n assert(candidate(10L, 6L, 8L) == true);\n assert(candidate(2L, 2L, 2L) == false);\n assert(candidate(7L, 24L, 25L) == true);\n assert(candidate(10L, 5L, 7L) == false);\n assert(candidate(5L, 12L, 13L) == true);\n assert(candidate(15L, 8L, 17L) == true);\n assert(candidate(48L, 55L, 73L) == true);\n assert(candidate(1L, 1L, 1L) == false);\n assert(candidate(2L, 2L, 10L) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Create a function that takes 3 numbers.\n Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n Returns false in any other cases.\n \n Examples\n any_int(5, 2, 7) \u279e True\n \n any_int(3, 2, 2) \u279e False\n\n any_int(3, -2, 1) \u279e True\n \n any_int(3.6, -2.2, 2) \u279e False\n \n\n \n \n*/\nbool any_int(float x, float y, float z) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = any_int;\n\n assert(candidate(2L, 3L, 1L) == true);\n assert(candidate(2.5, 2L, 3L) == false);\n assert(candidate(1.5, 5L, 3.5) == false);\n assert(candidate(2L, 6L, 2L) == false);\n assert(candidate(4L, 2L, 2L) == true);\n assert(candidate(2.2, 2.2, 2.2) == false);\n assert(candidate(-4L, 6L, 2L) == true);\n assert(candidate(2L, 1L, 1L) == true);\n assert(candidate(3L, 4L, 7L) == true);\n assert(candidate(3.0, 4L, 7L) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nThis function takes a list l and returns a list l' such that\n l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n to the values of the corresponding indicies of l, but sorted.\n >>> sort_third([1, 2, 3])\n [1, 2, 3]\n >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n [2, 6, 3, 4, 8, 9, 5]\n \n*/\nlong[] sort_third(long[] l) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = sort_third;\n\n assert(candidate([5L, 6L, 3L, 4L, 8L, 9L, 2L]) == [2L, 6L, 3L, 4L, 8L, 9L, 5L]);\n assert(candidate([5L, 8L, 3L, 4L, 6L, 9L, 2L]) == [2L, 8L, 3L, 4L, 6L, 9L, 5L]);\n assert(candidate([5L, 6L, 9L, 4L, 8L, 3L, 2L]) == [2L, 6L, 9L, 4L, 8L, 3L, 5L]);\n assert(candidate([5L, 6L, 3L, 4L, 8L, 9L, 2L, 1L]) == [2L, 6L, 3L, 4L, 8L, 9L, 5L, 1L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_53_add", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nAdd two numbers x and y\n >>> add(2, 3)\n 5\n >>> add(5, 7)\n 12\n \n*/\nlong add(long x, long y) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = add;\n\n assert(candidate(0L, 1L) == 1L);\n assert(candidate(1L, 0L) == 1L);\n assert(candidate(2L, 3L) == 5L);\n assert(candidate(5L, 7L) == 12L);\n assert(candidate(7L, 5L) == 12L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_69_search", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n zero, and has a frequency greater than or equal to the value of the integer itself. \n The frequency of an integer is the number of times it appears in the list.\n If no such a value exist, return -1.\n Examples:\n search([4, 1, 2, 2, 3, 1]) == 2\n search([1, 2, 2, 3, 3, 3, 4, 4, 4]) == 3\n search([5, 5, 4, 4, 4]) == -1\n \n*/\nlong search(long[] lst) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = search;\n\n assert(candidate([5L, 5L, 5L, 5L, 1L]) == 1L);\n assert(candidate([4L, 1L, 4L, 1L, 4L, 4L]) == 4L);\n assert(candidate([3L, 3L]) == -1L);\n assert(candidate([8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L]) == 8L);\n assert(candidate([2L, 3L, 3L, 2L, 2L]) == 2L);\n assert(candidate([2L, 7L, 8L, 8L, 4L, 8L, 7L, 3L, 9L, 6L, 5L, 10L, 4L, 3L, 6L, 7L, 1L, 7L, 4L, 10L, 8L, 1L]) == 1L);\n assert(candidate([3L, 2L, 8L, 2L]) == 2L);\n assert(candidate([6L, 7L, 1L, 8L, 8L, 10L, 5L, 8L, 5L, 3L, 10L]) == 1L);\n assert(candidate([8L, 8L, 3L, 6L, 5L, 6L, 4L]) == -1L);\n assert(candidate([6L, 9L, 6L, 7L, 1L, 4L, 7L, 1L, 8L, 8L, 9L, 8L, 10L, 10L, 8L, 4L, 10L, 4L, 10L, 1L, 2L, 9L, 5L, 7L, 9L]) == 1L);\n assert(candidate([1L, 9L, 10L, 1L, 3L]) == 1L);\n assert(candidate([6L, 9L, 7L, 5L, 8L, 7L, 5L, 3L, 7L, 5L, 10L, 10L, 3L, 6L, 10L, 2L, 8L, 6L, 5L, 4L, 9L, 5L, 3L, 10L]) == 5L);\n assert(candidate([1L]) == 1L);\n assert(candidate([8L, 8L, 10L, 6L, 4L, 3L, 5L, 8L, 2L, 4L, 2L, 8L, 4L, 6L, 10L, 4L, 2L, 1L, 10L, 2L, 1L, 1L, 5L]) == 4L);\n assert(candidate([2L, 10L, 4L, 8L, 2L, 10L, 5L, 1L, 2L, 9L, 5L, 5L, 6L, 3L, 8L, 6L, 4L, 10L]) == 2L);\n assert(candidate([1L, 6L, 10L, 1L, 6L, 9L, 10L, 8L, 6L, 8L, 7L, 3L]) == 1L);\n assert(candidate([9L, 2L, 4L, 1L, 5L, 1L, 5L, 2L, 5L, 7L, 7L, 7L, 3L, 10L, 1L, 5L, 4L, 2L, 8L, 4L, 1L, 9L, 10L, 7L, 10L, 2L, 8L, 10L, 9L, 4L]) == 4L);\n assert(candidate([2L, 6L, 4L, 2L, 8L, 7L, 5L, 6L, 4L, 10L, 4L, 6L, 3L, 7L, 8L, 8L, 3L, 1L, 4L, 2L, 2L, 10L, 7L]) == 4L);\n assert(candidate([9L, 8L, 6L, 10L, 2L, 6L, 10L, 2L, 7L, 8L, 10L, 3L, 8L, 2L, 6L, 2L, 3L, 1L]) == 2L);\n assert(candidate([5L, 5L, 3L, 9L, 5L, 6L, 3L, 2L, 8L, 5L, 6L, 10L, 10L, 6L, 8L, 4L, 10L, 7L, 7L, 10L, 8L]) == -1L);\n assert(candidate([10L]) == -1L);\n assert(candidate([9L, 7L, 7L, 2L, 4L, 7L, 2L, 10L, 9L, 7L, 5L, 7L, 2L]) == 2L);\n assert(candidate([5L, 4L, 10L, 2L, 1L, 1L, 10L, 3L, 6L, 1L, 8L]) == 1L);\n assert(candidate([7L, 9L, 9L, 9L, 3L, 4L, 1L, 5L, 9L, 1L, 2L, 1L, 1L, 10L, 7L, 5L, 6L, 7L, 6L, 7L, 7L, 6L]) == 1L);\n assert(candidate([3L, 10L, 10L, 9L, 2L]) == -1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nWrite a function that takes a string and returns True if the string\n length is a prime number or False otherwise\n Examples\n prime_length('Hello') == True\n prime_length('abcdcba') == True\n prime_length('kittens') == True\n prime_length('orange') == False\n \n*/\nbool prime_length(string string) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = prime_length;\n\n assert(candidate(\"Hello\") == true);\n assert(candidate(\"abcdcba\") == true);\n assert(candidate(\"kittens\") == true);\n assert(candidate(\"orange\") == false);\n assert(candidate(\"wow\") == true);\n assert(candidate(\"world\") == true);\n assert(candidate(\"MadaM\") == true);\n assert(candidate(\"Wow\") == true);\n assert(candidate(\"\") == false);\n assert(candidate(\"HI\") == true);\n assert(candidate(\"go\") == true);\n assert(candidate(\"gogo\") == false);\n assert(candidate(\"aaaaaaaaaaaaaaa\") == false);\n assert(candidate(\"Madam\") == true);\n assert(candidate(\"M\") == false);\n assert(candidate(\"0\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_58_common", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nReturn sorted unique common elements for two lists.\n >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n [1, 5, 653]\n >>> common([5, 3, 2, 8], [3, 2])\n [2, 3]\n\n \n*/\nlong[] common(long[] l1, long[] l2) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = common;\n\n assert(candidate([1L, 4L, 3L, 34L, 653L, 2L, 5L], [5L, 7L, 1L, 5L, 9L, 653L, 121L]) == [1L, 5L, 653L]);\n assert(candidate([5L, 3L, 2L, 8L], [3L, 2L]) == [2L, 3L]);\n assert(candidate([4L, 3L, 2L, 8L], [3L, 2L, 4L]) == [2L, 3L, 4L]);\n assert(candidate([4L, 3L, 2L, 8L], []) == []);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nThe Brazilian factorial is defined as:\n brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n where n > 0\n\n For example:\n >>> special_factorial(4)\n 288\n\n The function will receive an integer as input and should return the special\n factorial of this integer.\n \n*/\nlong special_factorial(long n) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = special_factorial;\n\n assert(candidate(4L) == 288L);\n assert(candidate(5L) == 34560L);\n assert(candidate(7L) == 125411328000L);\n assert(candidate(1L) == 1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nIn this problem, you will implement a function that takes two lists of numbers,\n and determines whether it is possible to perform an exchange of elements\n between them to make lst1 a list of only even numbers.\n There is no limit on the number of exchanged elements between lst1 and lst2.\n If it is possible to exchange elements between the lst1 and lst2 to make\n all the elements of lst1 to be even, return \"YES\".\n Otherwise, return \"NO\".\n For example:\n exchange([1, 2, 3, 4], [1, 2, 3, 4]) => \"YES\"\n exchange([1, 2, 3, 4], [1, 5, 3, 4]) => \"NO\"\n It is assumed that the input lists will be non-empty.\n \n*/\nstring exchange(long[] lst1, long[] lst2) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = exchange;\n\n assert(candidate([1L, 2L, 3L, 4L], [1L, 2L, 3L, 4L]) == \"YES\");\n assert(candidate([1L, 2L, 3L, 4L], [1L, 5L, 3L, 4L]) == \"NO\");\n assert(candidate([1L, 2L, 3L, 4L], [2L, 1L, 4L, 3L]) == \"YES\");\n assert(candidate([5L, 7L, 3L], [2L, 6L, 4L]) == \"YES\");\n assert(candidate([5L, 7L, 3L], [2L, 6L, 3L]) == \"NO\");\n assert(candidate([3L, 2L, 6L, 1L, 8L, 9L], [3L, 5L, 5L, 1L, 1L, 1L]) == \"NO\");\n assert(candidate([100L, 200L], [200L, 200L]) == \"YES\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given a non-empty array of integers arr and an integer k, return\n the sum of the elements with at most two digits from the first k elements of arr.\n\n Example:\n\n Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4\n Output: 24 # sum of 21 + 3\n\n Constraints:\n 1. 1 <= len(arr) <= 100\n 2. 1 <= k <= len(arr)\n \n*/\nlong add_elements(long[] arr, long k) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = add_elements;\n\n assert(candidate([1L, -2L, -3L, 41L, 57L, 76L, 87L, 88L, 99L], 3L) == -4L);\n assert(candidate([111L, 121L, 3L, 4000L, 5L, 6L], 2L) == 0L);\n assert(candidate([11L, 21L, 3L, 90L, 5L, 6L, 7L, 8L, 9L], 4L) == 125L);\n assert(candidate([111L, 21L, 3L, 4000L, 5L, 6L, 7L, 8L, 9L], 4L) == 24L);\n assert(candidate([1L], 1L) == 1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nA simple program which should return the value of x if n is \n a prime number and should return the value of y otherwise.\n\n Examples:\n for x_or_y(7, 34, 12) == 34\n for x_or_y(15, 8, 5) == 5\n \n \n*/\nlong x_or_y(long n, long x, long y) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = x_or_y;\n\n assert(candidate(7L, 34L, 12L) == 34L);\n assert(candidate(15L, 8L, 5L) == 5L);\n assert(candidate(3L, 33L, 5212L) == 33L);\n assert(candidate(1259L, 3L, 52L) == 3L);\n assert(candidate(7919L, -1L, 12L) == -1L);\n assert(candidate(3609L, 1245L, 583L) == 583L);\n assert(candidate(91L, 56L, 129L) == 129L);\n assert(candidate(6L, 34L, 1234L) == 1234L);\n assert(candidate(1L, 2L, 0L) == 0L);\n assert(candidate(2L, 2L, 0L) == 2L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nGiven length of a side and high return area for a triangle.\n >>> triangle_area(5, 3)\n 7.5\n \n*/\nfloat triangle_area(long a, long h) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = triangle_area;\n\n assert(candidate(5L, 3L) == 7.5);\n assert(candidate(2L, 2L) == 2.0);\n assert(candidate(10L, 8L) == 40.0);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nEveryone knows Fibonacci sequence, it was studied deeply by mathematicians in \n the last couple centuries. However, what people don't know is Tribonacci sequence.\n Tribonacci sequence is defined by the recurrence:\n tri(1) = 3\n tri(n) = 1 + n / 2, if n is even.\n tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n For example:\n tri(2) = 1 + (2 / 2) = 2\n tri(4) = 3\n tri(3) = tri(2) + tri(1) + tri(4)\n = 2 + 3 + 3 = 8 \n You are given a non-negative integer number n, you have to a return a list of the \n first n + 1 numbers of the Tribonacci sequence.\n Examples:\n tri(3) = [1, 3, 2, 8]\n \n*/\nlong[] tri(long n) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = tri;\n\n assert(candidate(3L) == [1L, 3L, 2L, 8L]);\n assert(candidate(4L) == [1L, 3L, 2L, 8L, 3L]);\n assert(candidate(5L) == [1L, 3L, 2L, 8L, 3L, 15L]);\n assert(candidate(6L) == [1L, 3L, 2L, 8L, 3L, 15L, 4L]);\n assert(candidate(7L) == [1L, 3L, 2L, 8L, 3L, 15L, 4L, 24L]);\n assert(candidate(8L) == [1L, 3L, 2L, 8L, 3L, 15L, 4L, 24L, 5L]);\n assert(candidate(9L) == [1L, 3L, 2L, 8L, 3L, 15L, 4L, 24L, 5L, 35L]);\n assert(candidate(20L) == [1L, 3L, 2L, 8L, 3L, 15L, 4L, 24L, 5L, 35L, 6L, 48L, 7L, 63L, 8L, 80L, 9L, 99L, 10L, 120L, 11L]);\n assert(candidate(0L) == [1L]);\n assert(candidate(1L) == [1L, 3L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n You are given a list of two strings, both strings consist of open\n parentheses '(' or close parentheses ')' only.\n Your job is to check if it is possible to concatenate the two strings in\n some order, that the resulting string will be good.\n A string S is considered to be good if and only if all parentheses in S\n are balanced. For example: the string '(())()' is good, while the string\n '())' is not.\n Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n\n Examples:\n match_parens(['()(', ')']) == 'Yes'\n match_parens([')', ')']) == 'No'\n \n*/\nstring match_parens(string[] lst) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = match_parens;\n\n assert(candidate([\"()(\", \")\"]) == \"Yes\");\n assert(candidate([\")\", \")\"]) == \"No\");\n assert(candidate([\"(()(())\", \"())())\"]) == \"No\");\n assert(candidate([\")())\", \"(()()(\"]) == \"Yes\");\n assert(candidate([\"(())))\", \"(()())((\"]) == \"Yes\");\n assert(candidate([\"()\", \"())\"]) == \"No\");\n assert(candidate([\"(()(\", \"()))()\"]) == \"Yes\");\n assert(candidate([\"((((\", \"((())\"]) == \"No\");\n assert(candidate([\")(()\", \"(()(\"]) == \"No\");\n assert(candidate([\")(\", \")(\"]) == \"No\");\n assert(candidate([\"(\", \")\"]) == \"Yes\");\n assert(candidate([\")\", \"(\"]) == \"Yes\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n From a list of integers, remove all elements that occur more than once.\n Keep order of elements left the same as in the input.\n >>> remove_duplicates([1, 2, 3, 2, 4])\n [1, 3, 4]\n \n*/\nlong[] remove_duplicates(long[] numbers) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = remove_duplicates;\n\n assert(candidate([]) == []);\n assert(candidate([1L, 2L, 3L, 4L]) == [1L, 2L, 3L, 4L]);\n assert(candidate([1L, 2L, 3L, 2L, 4L, 3L, 5L]) == [1L, 4L, 5L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Return a greatest common divisor of two integers a and b\n >>> greatest_common_divisor(3, 5)\n 1\n >>> greatest_common_divisor(25, 15)\n 5\n \n*/\nlong greatest_common_divisor(long a, long b) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = greatest_common_divisor;\n\n assert(candidate(3L, 7L) == 1L);\n assert(candidate(10L, 15L) == 5L);\n assert(candidate(49L, 14L) == 7L);\n assert(candidate(144L, 60L) == 12L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Checks if given string is a palindrome\n >>> is_palindrome('')\n True\n >>> is_palindrome('aba')\n True\n >>> is_palindrome('aaaaa')\n True\n >>> is_palindrome('zbcd')\n False\n \n*/\nbool is_palindrome(string text) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = is_palindrome;\n\n assert(candidate(\"\") == true);\n assert(candidate(\"aba\") == true);\n assert(candidate(\"aaaaa\") == true);\n assert(candidate(\"zbcd\") == false);\n assert(candidate(\"xywyx\") == true);\n assert(candidate(\"xywyz\") == false);\n assert(candidate(\"xywzx\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n xs represent coefficients of a polynomial.\n xs[0] + xs[1] * x + xs[2] * x^2 + ....\n Return derivative of this polynomial in the same form.\n >>> derivative([3, 1, 2, 4, 5])\n [1, 4, 12, 20]\n >>> derivative([1, 2, 3])\n [2, 6]\n \n*/\nlong[] derivative(long[] xs) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = derivative;\n\n assert(candidate([3L, 1L, 2L, 4L, 5L]) == [1L, 4L, 12L, 20L]);\n assert(candidate([1L, 2L, 3L]) == [2L, 6L]);\n assert(candidate([3L, 2L, 1L]) == [2L, 2L]);\n assert(candidate([3L, 2L, 1L, 0L, 4L]) == [2L, 2L, 0L, 16L]);\n assert(candidate([1L]) == []);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n In this task, you will be given a string that represents a number of apples and oranges \n that are distributed in a basket of fruit this basket contains \n apples, oranges, and mango fruits. Given the string that represents the total number of \n the oranges and apples and an integer that represent the total number of the fruits \n in the basket return the number of the mango fruits in the basket.\n for examble:\n fruit_distribution(\"5 apples and 6 oranges\", 19) ->19 - 5 - 6 = 8\n fruit_distribution(\"0 apples and 1 oranges\",3) -> 3 - 0 - 1 = 2\n fruit_distribution(\"2 apples and 3 oranges\", 100) -> 100 - 2 - 3 = 95\n fruit_distribution(\"100 apples and 1 oranges\",120) -> 120 - 100 - 1 = 19\n \n*/\nlong fruit_distribution(string s, long n) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = fruit_distribution;\n\n assert(candidate(\"5 apples and 6 oranges\", 19L) == 8L);\n assert(candidate(\"5 apples and 6 oranges\", 21L) == 10L);\n assert(candidate(\"0 apples and 1 oranges\", 3L) == 2L);\n assert(candidate(\"1 apples and 0 oranges\", 3L) == 2L);\n assert(candidate(\"2 apples and 3 oranges\", 100L) == 95L);\n assert(candidate(\"2 apples and 3 oranges\", 5L) == 0L);\n assert(candidate(\"1 apples and 100 oranges\", 120L) == 19L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Write a function that takes an integer a and returns True \n if this ingeger is a cube of some integer number.\n Note: you may assume the input is always valid.\n Examples:\n iscube(1) ==> True\n iscube(2) ==> False\n iscube(-1) ==> True\n iscube(64) ==> True\n iscube(0) ==> True\n iscube(180) ==> False\n \n*/\nbool iscube(long a) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = iscube;\n\n assert(candidate(1L) == true);\n assert(candidate(2L) == false);\n assert(candidate(-1L) == true);\n assert(candidate(64L) == true);\n assert(candidate(180L) == false);\n assert(candidate(1000L) == true);\n assert(candidate(0L) == true);\n assert(candidate(1729L) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n In this Kata, you have to sort an array of non-negative integers according to\n number of ones in their binary representation in ascending order.\n For similar number of ones, sort based on decimal value.\n\n It must be implemented like this:\n >>> sort_array([1, 5, 2, 3, 4]) == [1, 2, 3, 4, 5]\n >>> sort_array([-2, -3, -4, -5, -6]) == [-6, -5, -4, -3, -2]\n >>> sort_array([1, 0, 2, 3, 4]) [0, 1, 2, 3, 4]\n \n*/\nlong[] sort_array(long[] arr) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = sort_array;\n\n assert(candidate([1L, 5L, 2L, 3L, 4L]) == [1L, 2L, 4L, 3L, 5L]);\n assert(candidate([-2L, -3L, -4L, -5L, -6L]) == [-4L, -2L, -6L, -5L, -3L]);\n assert(candidate([1L, 0L, 2L, 3L, 4L]) == [0L, 1L, 2L, 4L, 3L]);\n assert(candidate([]) == []);\n assert(candidate([2L, 5L, 77L, 4L, 5L, 3L, 5L, 7L, 2L, 3L, 4L]) == [2L, 2L, 4L, 4L, 3L, 3L, 5L, 5L, 5L, 7L, 77L]);\n assert(candidate([3L, 6L, 44L, 12L, 32L, 5L]) == [32L, 3L, 5L, 6L, 12L, 44L]);\n assert(candidate([2L, 4L, 8L, 16L, 32L]) == [2L, 4L, 8L, 16L, 32L]);\n assert(candidate([2L, 4L, 8L, 16L, 32L]) == [2L, 4L, 8L, 16L, 32L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nGiven a list of strings, where each string consists of only digits, return a list.\n Each element i of the output should be \"the number of odd elements in the\n string i of the input.\" where all the i's should be replaced by the number\n of odd digits in the i'th string of the input.\n\n >>> odd_count(['1234567'])\n [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n >>> odd_count(['3',\"11111111\"])\n [\"the number of odd elements 1n the str1ng 1 of the 1nput.\",\n \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\n \n*/\nstring[] odd_count(string[] lst) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = odd_count;\n\n assert(candidate([\"1234567\"]) == [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]);\n 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.\"]);\n assert(candidate([\"271\", \"137\", \"314\"]) == [\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n brackets is a string of \"(\" and \")\".\n return True if every opening bracket has a corresponding closing bracket.\n\n >>> correct_bracketing(\"(\")\n False\n >>> correct_bracketing(\"()\")\n True\n >>> correct_bracketing(\"(()())\")\n True\n >>> correct_bracketing(\")(()\")\n False\n \n*/\nbool correct_bracketing(string brackets) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = correct_bracketing;\n\n assert(candidate(\"()\") == true);\n assert(candidate(\"(()())\") == true);\n assert(candidate(\"()()(()())()\") == true);\n assert(candidate(\"()()((()()())())(()()(()))\") == true);\n assert(candidate(\"((()())))\") == false);\n assert(candidate(\")(()\") == false);\n assert(candidate(\"(\") == false);\n assert(candidate(\"((((\") == false);\n assert(candidate(\")\") == false);\n assert(candidate(\"(()\") == false);\n assert(candidate(\"()()(()())())(()\") == false);\n assert(candidate(\"()()(()())()))()\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nTask\n Write a function that takes a string as input and returns the sum of the upper characters only'\n ASCII codes.\n\n Examples:\n digitSum(\"\") => 0\n digitSum(\"abAB\") => 131\n digitSum(\"abcCd\") => 67\n digitSum(\"helloE\") => 69\n digitSum(\"woArBld\") => 131\n digitSum(\"aAaaaXa\") => 153\n \n*/\nlong digitSum(string s) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = digitSum;\n\n assert(candidate(\"\") == 0L);\n assert(candidate(\"abAB\") == 131L);\n assert(candidate(\"abcCd\") == 67L);\n assert(candidate(\"helloE\") == 69L);\n assert(candidate(\"woArBld\") == 131L);\n assert(candidate(\"aAaaaXa\") == 153L);\n assert(candidate(\" How are yOu?\") == 151L);\n assert(candidate(\"You arE Very Smart\") == 327L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nWrite a function that accepts a list of strings as a parameter,\n deletes the strings that have odd lengths from it,\n and returns the resulted list with a sorted order,\n The list is always a list of strings and never an array of numbers,\n and it may contain duplicates.\n The order of the list should be ascending by length of each word, and you\n should return the list sorted by that rule.\n If two words have the same length, sort the list alphabetically.\n The function should return a list of strings in sorted order.\n You may assume that all words will have the same length.\n For example:\n assert list_sort([\"aa\", \"a\", \"aaa\"]) => [\"aa\"]\n assert list_sort([\"ab\", \"a\", \"aaa\", \"cd\"]) => [\"ab\", \"cd\"]\n \n*/\nstring[] sorted_list_sum(string[] lst) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = sorted_list_sum;\n\n assert(candidate([\"aa\", \"a\", \"aaa\"]) == [\"aa\"]);\n assert(candidate([\"school\", \"AI\", \"asdf\", \"b\"]) == [\"AI\", \"asdf\", \"school\"]);\n assert(candidate([\"d\", \"b\", \"c\", \"a\"]) == []);\n assert(candidate([\"d\", \"dcba\", \"abcd\", \"a\"]) == [\"abcd\", \"dcba\"]);\n assert(candidate([\"AI\", \"ai\", \"au\"]) == [\"AI\", \"ai\", \"au\"]);\n assert(candidate([\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"]) == []);\n assert(candidate([\"aaaa\", \"bbbb\", \"dd\", \"cc\"]) == [\"cc\", \"dd\", \"aaaa\", \"bbbb\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n You are given an array arr of integers and you need to return\n sum of magnitudes of integers multiplied by product of all signs\n of each number in the array, represented by 1, -1 or 0.\n Note: return None for empty arr.\n\n Example:\n >>> prod_signs([1, 2, 2, -4]) == -9\n >>> prod_signs([0, 1]) == 0\n >>> prod_signs([]) == None\n \n*/\nNullable!(long) prod_signs(long[] arr) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = prod_signs;\n\n{\n auto result = candidate([1L, 2L, 2L, -4L]);\n assert(!result.isNull && result.get == -9L);\n}\n\n{\n auto result = candidate([0L, 1L]);\n assert(!result.isNull && result.get == 0L);\n}\n\n{\n auto result = candidate([1L, 1L, 1L, 2L, 3L, -1L, 1L]);\n assert(!result.isNull && result.get == -10L);\n}\n\n{\n auto result = candidate([]);\n assert(result.isNull);\n}\n\n{\n auto result = candidate([2L, 4L, 1L, 2L, -1L, -1L, 9L]);\n assert(!result.isNull && result.get == 20L);\n}\n\n{\n auto result = candidate([-1L, 1L, -1L, 1L]);\n assert(!result.isNull && result.get == 4L);\n}\n\n{\n auto result = candidate([-1L, 1L, 1L, 1L]);\n assert(!result.isNull && result.get == -4L);\n}\n\n{\n auto result = candidate([-1L, 1L, 1L, 0L]);\n assert(!result.isNull && result.get == 0L);\n}\n\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nReturn list with elements incremented by 1.\n >>> incr_list([1, 2, 3])\n [2, 3, 4]\n >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123])\n [6, 4, 6, 3, 4, 4, 10, 1, 124]\n \n*/\nlong[] incr_list(long[] l) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = incr_list;\n\n assert(candidate([]) == []);\n assert(candidate([3L, 2L, 1L]) == [4L, 3L, 2L]);\n assert(candidate([5L, 2L, 5L, 2L, 3L, 3L, 9L, 0L, 123L]) == [6L, 3L, 6L, 3L, 4L, 4L, 10L, 1L, 124L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n From a given list of integers, generate a list of rolling maximum element found until given moment\n in the sequence.\n >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n [1, 2, 3, 3, 3, 4, 4]\n \n*/\nlong[] rolling_max(long[] numbers) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = rolling_max;\n\n assert(candidate([]) == []);\n assert(candidate([1L, 2L, 3L, 4L]) == [1L, 2L, 3L, 4L]);\n assert(candidate([4L, 3L, 2L, 1L]) == [4L, 4L, 4L, 4L]);\n assert(candidate([3L, 2L, 3L, 100L, 3L]) == [3L, 3L, 3L, 100L, 100L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n separate those group into separate strings and return the list of those.\n Separate groups are balanced (each open brace is properly closed) and not nested within each other\n Ignore any spaces in the input string.\n >>> separate_paren_groups('( ) (( )) (( )( ))')\n ['()', '(())', '(()())']\n \n*/\nstring[] separate_paren_groups(string paren_string) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = separate_paren_groups;\n\n assert(candidate(\"(()()) ((())) () ((())()())\") == [\"(()())\", \"((()))\", \"()\", \"((())()())\"]);\n assert(candidate(\"() (()) ((())) (((())))\") == [\"()\", \"(())\", \"((()))\", \"(((())))\"]);\n assert(candidate(\"(()(())((())))\") == [\"(()(())((())))\"]);\n assert(candidate(\"( ) (( )) (( )( ))\") == [\"()\", \"(())\", \"(()())\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n You will be given a string of words separated by commas or spaces. Your task is\n to split the string into words and return an array of the words.\n \n For example:\n words_string(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n words_string(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\n \n*/\nstring[] words_string(string s) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = words_string;\n\n assert(candidate(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]);\n assert(candidate(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]);\n assert(candidate(\"Hi, my name\") == [\"Hi\", \"my\", \"name\"]);\n assert(candidate(\"One,, two, three, four, five, six,\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]);\n assert(candidate(\"\") == []);\n assert(candidate(\"ahmed , gamal\") == [\"ahmed\", \"gamal\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nThis function takes a list l and returns a list l' such that\n l' is identical to l in the odd indicies, while its values at the even indicies are equal\n to the values of the even indicies of l, but sorted.\n >>> sort_even([1, 2, 3])\n [1, 2, 3]\n >>> sort_even([5, 6, 3, 4])\n [3, 6, 5, 4]\n \n*/\nlong[] sort_even(long[] l) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = sort_even;\n\n assert(candidate([1L, 2L, 3L]) == [1L, 2L, 3L]);\n assert(candidate([5L, 3L, -5L, 2L, -3L, 3L, 9L, 0L, 123L, 1L, -10L]) == [-10L, 3L, -5L, 2L, -3L, 3L, 5L, 0L, 9L, 1L, 123L]);\n assert(candidate([5L, 8L, -12L, 4L, 23L, 2L, 3L, 11L, 12L, -10L]) == [-12L, 8L, 3L, 4L, 5L, 2L, 12L, 11L, 23L, -10L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nI think we all remember that feeling when the result of some long-awaited\n event is finally known. The feelings and thoughts you have at that moment are\n definitely worth noting down and comparing.\n Your task is to determine if a person correctly guessed the results of a number of matches.\n You are given two arrays of scores and guesses of equal length, where each index shows a match. \n Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n the value is 0, and if not, the value is the absolute difference between the guess and the score.\n \n \n example:\n\n compare([1,2,3,4,5,1],[1,2,3,4,2,-2]) -> [0,0,0,0,3,3]\n compare([0,5,0,0,0,4],[4,1,1,0,0,-2]) -> [4,4,1,0,0,6]\n \n*/\nlong[] compare(long[] game, long[] guess) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = compare;\n\n assert(candidate([1L, 2L, 3L, 4L, 5L, 1L], [1L, 2L, 3L, 4L, 2L, -2L]) == [0L, 0L, 0L, 0L, 3L, 3L]);\n assert(candidate([0L, 0L, 0L, 0L, 0L, 0L], [0L, 0L, 0L, 0L, 0L, 0L]) == [0L, 0L, 0L, 0L, 0L, 0L]);\n assert(candidate([1L, 2L, 3L], [-1L, -2L, -3L]) == [2L, 4L, 6L]);\n assert(candidate([1L, 2L, 3L, 5L], [-1L, 2L, 3L, 4L]) == [2L, 0L, 0L, 1L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given a positive integer n, return a tuple that has the number of even and odd\n integer palindromes that fall within the range(1, n), inclusive.\n\n Example 1:\n\n Input: 3\n Output: (1, 2)\n Explanation:\n Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n\n Example 2:\n\n Input: 12\n Output: (4, 6)\n Explanation:\n Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n\n Note:\n 1. 1 <= n <= 10^3\n 2. returned tuple has the number of even and odd integer palindromes respectively.\n \n*/\nTuple!(long, long) even_odd_palindrome(long n) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = even_odd_palindrome;\n\n assert(candidate(123L) == tuple(8L, 13L));\n assert(candidate(12L) == tuple(4L, 6L));\n assert(candidate(3L) == tuple(1L, 2L));\n assert(candidate(63L) == tuple(6L, 8L));\n assert(candidate(25L) == tuple(5L, 6L));\n assert(candidate(19L) == tuple(4L, 6L));\n assert(candidate(9L) == tuple(4L, 5L));\n assert(candidate(1L) == tuple(0L, 1L));\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nThe Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fib4(0) -> 0\n fib4(1) -> 0\n fib4(2) -> 2\n fib4(3) -> 0\n fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n >>> fib4(5)\n 4\n >>> fib4(6)\n 8\n >>> fib4(7)\n 14\n \n*/\nlong fib4(long n) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = fib4;\n\n assert(candidate(5L) == 4L);\n assert(candidate(8L) == 28L);\n assert(candidate(10L) == 104L);\n assert(candidate(12L) == 386L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given two positive integers a and b, return the even digits between a\n and b, in ascending order.\n\n For example:\n generate_integers(2, 8) => [2, 4, 6, 8]\n generate_integers(8, 2) => [2, 4, 6, 8]\n generate_integers(10, 14) => []\n \n*/\nlong[] generate_integers(long a, long b) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = generate_integers;\n\n assert(candidate(2L, 10L) == [2L, 4L, 6L, 8L]);\n assert(candidate(10L, 2L) == [2L, 4L, 6L, 8L]);\n assert(candidate(132L, 2L) == [2L, 4L, 6L, 8L]);\n assert(candidate(17L, 89L) == []);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n For a given list of input numbers, calculate Mean Absolute Deviation\n around the mean of this dataset.\n Mean Absolute Deviation is the average absolute difference between each\n element and a centerpoint (mean in this case):\n MAD = average | x - x_mean |\n >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n 1.0\n \n*/\nfloat mean_absolute_deviation(float[] numbers) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = mean_absolute_deviation;\n\n assert(candidate([1.0, 2.0]) == 0.5);\n assert(candidate([1.0, 2.0, 3.0, 4.0]) == 1.0);\n assert(candidate([1.0, 2.0, 3.0, 4.0, 5.0]) == 1.2);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nCreate a function encrypt that takes a string as an argument and\n returns a string encrypted with the alphabet being rotated. \n The alphabet should be rotated in a manner such that the letters \n shift down by two multiplied to two places.\n For example:\n encrypt('hi') returns 'lm'\n encrypt('asdfghjkl') returns 'ewhjklnop'\n encrypt('gf') returns 'kj'\n encrypt('et') returns 'ix'\n \n*/\nstring encrypt(string s) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = encrypt;\n\n assert(candidate(\"hi\") == \"lm\");\n assert(candidate(\"asdfghjkl\") == \"ewhjklnop\");\n assert(candidate(\"gf\") == \"kj\");\n assert(candidate(\"et\") == \"ix\");\n assert(candidate(\"faewfawefaewg\") == \"jeiajeaijeiak\");\n assert(candidate(\"hellomyfriend\") == \"lippsqcjvmirh\");\n assert(candidate(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\") == \"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\");\n assert(candidate(\"a\") == \"e\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n\n The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n as follows: start with any positive integer n. Then each term is obtained from the \n previous term as follows: if the previous term is even, the next term is one half of \n the previous term. If the previous term is odd, the next term is 3 times the previous\n term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n\n Note: \n 1. Collatz(1) is [1].\n 2. returned list sorted in increasing order.\n\n For example:\n get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n \n*/\nlong[] get_odd_collatz(long n) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = get_odd_collatz;\n\n assert(candidate(14L) == [1L, 5L, 7L, 11L, 13L, 17L]);\n assert(candidate(5L) == [1L, 5L]);\n assert(candidate(12L) == [1L, 3L, 5L]);\n assert(candidate(1L) == [1L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Find how many times a given substring can be found in the original string. Count overlaping cases.\n >>> how_many_times('', 'a')\n 0\n >>> how_many_times('aaa', 'a')\n 3\n >>> how_many_times('aaaa', 'aa')\n 3\n \n*/\nlong how_many_times(string string, string substring) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = how_many_times;\n\n assert(candidate(\"\", \"x\") == 0L);\n assert(candidate(\"xyxyxyx\", \"x\") == 4L);\n assert(candidate(\"cacacacac\", \"cac\") == 4L);\n assert(candidate(\"john doe\", \"john\") == 1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nWe have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n numbers in the array will be randomly ordered. Your task is to determine if\n it is possible to get an array sorted in non-decreasing order by performing \n the following operation on the given array:\n You are allowed to perform right shift operation any number of times.\n \n One right shift operation means shifting all elements of the array by one\n position in the right direction. The last element of the array will be moved to\n the starting position in the array i.e. 0th index. \n\n If it is possible to obtain the sorted array by performing the above operation\n then return True else return False.\n If the given array is empty then return True.\n\n Note: The given list is guaranteed to have unique elements.\n\n For Example:\n \n move_one_ball([3, 4, 5, 1, 2])==>True\n Explanation: By performin 2 right shift operations, non-decreasing order can\n be achieved for the given array.\n move_one_ball([3, 5, 4, 1, 2])==>False\n Explanation:It is not possible to get non-decreasing order for the given\n array by performing any number of right shift operations.\n \n \n*/\nbool move_one_ball(long[] arr) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = move_one_ball;\n\n assert(candidate([3L, 4L, 5L, 1L, 2L]) == true);\n assert(candidate([3L, 5L, 10L, 1L, 2L]) == true);\n assert(candidate([4L, 3L, 1L, 2L]) == false);\n assert(candidate([3L, 5L, 4L, 1L, 2L]) == false);\n assert(candidate([]) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Write a function which sorts the given list of integers\n in ascending order according to the sum of their digits.\n Note: if there are several items with similar sum of their digits,\n order them based on their index in original list.\n\n For example:\n >>> order_by_points([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]\n >>> order_by_points([]) == []\n \n*/\nlong[] order_by_points(long[] nums) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = order_by_points;\n\n assert(candidate([1L, 11L, -1L, -11L, -12L]) == [-1L, -11L, 1L, -12L, 11L]);\n assert(candidate([1234L, 423L, 463L, 145L, 2L, 423L, 423L, 53L, 6L, 37L, 3457L, 3L, 56L, 0L, 46L]) == [0L, 2L, 3L, 6L, 53L, 423L, 423L, 423L, 1234L, 145L, 37L, 46L, 56L, 463L, 3457L]);\n assert(candidate([]) == []);\n assert(candidate([1L, -11L, -32L, 43L, 54L, -98L, 2L, -3L]) == [-3L, -32L, -98L, -11L, 1L, 2L, 43L, 54L]);\n assert(candidate([1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L]) == [1L, 10L, 2L, 11L, 3L, 4L, 5L, 6L, 7L, 8L, 9L]);\n assert(candidate([0L, 6L, 6L, -76L, -21L, 23L, 4L]) == [-76L, -21L, 0L, 4L, 23L, 6L, 6L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Return list of prime factors of given integer in the order from smallest to largest.\n Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n Input number should be equal to the product of all factors\n >>> factorize(8)\n [2, 2, 2]\n >>> factorize(25)\n [5, 5]\n >>> factorize(70)\n [2, 5, 7]\n \n*/\nlong[] factorize(long n) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = factorize;\n\n assert(candidate(2L) == [2L]);\n assert(candidate(4L) == [2L, 2L]);\n assert(candidate(8L) == [2L, 2L, 2L]);\n assert(candidate(57L) == [3L, 19L]);\n assert(candidate(3249L) == [3L, 3L, 19L, 19L]);\n assert(candidate(185193L) == [3L, 3L, 3L, 19L, 19L, 19L]);\n assert(candidate(20577L) == [3L, 19L, 19L, 19L]);\n assert(candidate(18L) == [2L, 3L, 3L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nReturn True if all numbers in the list l are below threshold t.\n >>> below_threshold([1, 2, 4, 10], 100)\n True\n >>> below_threshold([1, 20, 4, 10], 5)\n False\n \n*/\nbool below_threshold(long[] l, long t) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = below_threshold;\n\n assert(candidate([1L, 2L, 4L, 10L], 100L) == true);\n assert(candidate([1L, 20L, 4L, 10L], 5L) == false);\n assert(candidate([1L, 20L, 4L, 10L], 21L) == true);\n assert(candidate([1L, 20L, 4L, 10L], 22L) == true);\n assert(candidate([1L, 8L, 4L, 10L], 11L) == true);\n assert(candidate([1L, 8L, 4L, 10L], 10L) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n For each of the group, output the deepest level of nesting of parentheses.\n E.g. (()()) has maximum two levels of nesting while ((())) has three.\n\n >>> parse_nested_parens('(()()) ((())) () ((())()())')\n [2, 3, 1, 3]\n \n*/\nlong[] parse_nested_parens(string paren_string) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = parse_nested_parens;\n\n assert(candidate(\"(()()) ((())) () ((())()())\") == [2L, 3L, 1L, 3L]);\n assert(candidate(\"() (()) ((())) (((())))\") == [1L, 2L, 3L, 4L]);\n assert(candidate(\"(()(())((())))\") == [4L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nGiven a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n \n\n Examples\n solution([5, 8, 7, 1]) ==> 12\n solution([3, 3, 3, 3, 3]) ==> 9\n solution([30, 13, 24, 321]) ==>0\n \n*/\nlong solution(long[] lst) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = solution;\n\n assert(candidate([5L, 8L, 7L, 1L]) == 12L);\n assert(candidate([3L, 3L, 3L, 3L, 3L]) == 9L);\n assert(candidate([30L, 13L, 24L, 321L]) == 0L);\n assert(candidate([5L, 9L]) == 5L);\n assert(candidate([2L, 4L, 8L]) == 0L);\n assert(candidate([30L, 13L, 23L, 32L]) == 23L);\n assert(candidate([3L, 13L, 2L, 9L]) == 3L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n You are given a positive integer n. You have to create an integer array a of length n.\n For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n and a[i] + a[j] + a[k] is a multiple of 3.\n\n Example :\n Input: n = 5\n Output: 1\n Explanation: \n a = [1, 3, 7, 13, 21]\n The only valid triple is (1, 7, 13).\n \n*/\nlong get_max_triples(long n) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = get_max_triples;\n\n assert(candidate(5L) == 1L);\n assert(candidate(6L) == 4L);\n assert(candidate(10L) == 36L);\n assert(candidate(100L) == 53361L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n You are given a list of integers.\n Write a function next_smallest() that returns the 2nd smallest element of the list.\n Return None if there is no such element.\n \n next_smallest([1, 2, 3, 4, 5]) == 2\n next_smallest([5, 1, 4, 3, 2]) == 2\n next_smallest([]) == None\n next_smallest([1, 1]) == None\n \n*/\nNullable!(long) next_smallest(long[] lst) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = next_smallest;\n\n{\n auto result = candidate([1L, 2L, 3L, 4L, 5L]);\n assert(!result.isNull && result.get == 2L);\n}\n\n{\n auto result = candidate([5L, 1L, 4L, 3L, 2L]);\n assert(!result.isNull && result.get == 2L);\n}\n\n{\n auto result = candidate([]);\n assert(result.isNull);\n}\n\n{\n auto result = candidate([1L, 1L]);\n assert(result.isNull);\n}\n\n{\n auto result = candidate([1L, 1L, 1L, 1L, 0L]);\n assert(!result.isNull && result.get == 1L);\n}\n\n{\n auto result = candidate([1L, 1L]);\n assert(result.isNull);\n}\n\n{\n auto result = candidate([-35L, 34L, 12L, -45L]);\n assert(!result.isNull && result.get == -35L);\n}\n\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Input is a space-delimited string of numberals from 'zero' to 'nine'.\n Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n Return the string with numbers sorted from smallest to largest\n >>> sort_numbers('three one five')\n 'one three five'\n \n*/\nstring sort_numbers(string numbers) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = sort_numbers;\n\n assert(candidate(\"\") == \"\");\n assert(candidate(\"three\") == \"three\");\n assert(candidate(\"three five nine\") == \"three five nine\");\n assert(candidate(\"five zero four seven nine eight\") == \"zero four five seven eight nine\");\n assert(candidate(\"six five four three two one zero\") == \"zero one two three four five six\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n cycpattern_check(\"abcd\",\"abd\") => False\n cycpattern_check(\"hello\",\"ell\") => True\n cycpattern_check(\"whassup\",\"psus\") => False\n cycpattern_check(\"abab\",\"baa\") => True\n cycpattern_check(\"efef\",\"eeff\") => False\n cycpattern_check(\"himenss\",\"simen\") => True\n\n \n*/\nbool cycpattern_check(string a, string b) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = cycpattern_check;\n\n assert(candidate(\"xyzw\", \"xyw\") == false);\n assert(candidate(\"yello\", \"ell\") == true);\n assert(candidate(\"whattup\", \"ptut\") == false);\n assert(candidate(\"efef\", \"fee\") == true);\n assert(candidate(\"abab\", \"aabb\") == false);\n assert(candidate(\"winemtt\", \"tinem\") == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou will be given a number in decimal form and your task is to convert it to\n binary format. The function should return a string, with each character representing a binary\n number. Each character in the string will be '0' or '1'.\n\n There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n The extra characters are there to help with the format.\n\n Examples:\n decimal_to_binary(15) # returns \"db1111db\"\n decimal_to_binary(32) # returns \"db100000db\"\n \n*/\nstring decimal_to_binary(long decimal) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = decimal_to_binary;\n\n assert(candidate(0L) == \"db0db\");\n assert(candidate(32L) == \"db100000db\");\n assert(candidate(103L) == \"db1100111db\");\n assert(candidate(15L) == \"db1111db\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Filter an input list of strings only for ones that contain given substring\n >>> filter_by_substring([], 'a')\n []\n >>> filter_by_substring(['abc', 'bacd', 'cde', 'array'], 'a')\n ['abc', 'bacd', 'array']\n \n*/\nstring[] filter_by_substring(string[] strings, string substring) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = filter_by_substring;\n\n assert(candidate([], \"john\") == []);\n assert(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\") == [\"xxx\", \"xxxAAA\", \"xxx\"]);\n assert(candidate([\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xx\") == [\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"]);\n assert(candidate([\"grunt\", \"trumpet\", \"prune\", \"gruesome\"], \"run\") == [\"grunt\", \"prune\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nGiven an integer. return a tuple that has the number of even and odd digits respectively.\n\n Example:\n even_odd_count(-12) ==> (1, 1)\n even_odd_count(123) ==> (1, 2)\n \n*/\nTuple!(long, long) even_odd_count(long num) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = even_odd_count;\n\n assert(candidate(7L) == tuple(0L, 1L));\n assert(candidate(-78L) == tuple(1L, 1L));\n assert(candidate(3452L) == tuple(2L, 2L));\n assert(candidate(346211L) == tuple(3L, 3L));\n assert(candidate(-345821L) == tuple(3L, 3L));\n assert(candidate(-2L) == tuple(1L, 0L));\n assert(candidate(-45347L) == tuple(2L, 3L));\n assert(candidate(0L) == tuple(1L, 0L));\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nWrite a function that accepts a list of strings.\n The list contains different words. Return the word with maximum number\n of unique characters. If multiple strings have maximum number of unique\n characters, return the one which comes first in lexicographical order.\n\n find_max([\"name\", \"of\", \"string\"]) == \"string\"\n find_max([\"name\", \"enam\", \"game\"]) == \"enam\"\n find_max([\"aaaaaaa\", \"bb\" ,\"cc\"]) == \"\"aaaaaaa\"\n \n*/\nstring find_max(string[] words) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = find_max;\n\n assert(candidate([\"name\", \"of\", \"string\"]) == \"string\");\n assert(candidate([\"name\", \"enam\", \"game\"]) == \"enam\");\n assert(candidate([\"aaaaaaa\", \"bb\", \"cc\"]) == \"aaaaaaa\");\n assert(candidate([\"abc\", \"cba\"]) == \"abc\");\n assert(candidate([\"play\", \"this\", \"game\", \"of\", \"footbott\"]) == \"footbott\");\n assert(candidate([\"we\", \"are\", \"gonna\", \"rock\"]) == \"gonna\");\n assert(candidate([\"we\", \"are\", \"a\", \"mad\", \"nation\"]) == \"nation\");\n assert(candidate([\"this\", \"is\", \"a\", \"prrk\"]) == \"this\");\n assert(candidate([\"b\"]) == \"b\");\n assert(candidate([\"play\", \"play\", \"play\"]) == \"play\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given a positive integer n, return the count of the numbers of n-digit\n positive integers that start or end with 1.\n \n*/\nlong starts_one_ends(long n) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = starts_one_ends;\n\n assert(candidate(1L) == 1L);\n assert(candidate(2L) == 18L);\n assert(candidate(3L) == 180L);\n assert(candidate(4L) == 1800L);\n assert(candidate(5L) == 18000L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Create a function that returns a tuple (a, b), where 'a' is\n the largest of negative integers, and 'b' is the smallest\n of positive integers in a list.\n If there is no negative or positive integers, return them as None.\n\n Examples:\n largest_smallest_integers([2, 4, 1, 3, 5, 7]) == (None, 1)\n largest_smallest_integers([]) == (None, None)\n largest_smallest_integers([0]) == (None, None)\n \n*/\nTuple!(Nullable!(long), Nullable!(long)) largest_smallest_integers(long[] lst) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = largest_smallest_integers;\n\n{\n auto result = candidate([2L, 4L, 1L, 3L, 5L, 7L]);\n assert(result[0].isNull);\n assert(!result[1].isNull && result[1].get == 1L);\n}\n\n{\n auto result = candidate([2L, 4L, 1L, 3L, 5L, 7L, 0L]);\n assert(result[0].isNull);\n assert(!result[1].isNull && result[1].get == 1L);\n}\n\n{\n auto result = candidate([1L, 3L, 2L, 4L, 5L, 6L, -2L]);\n assert(!result[0].isNull && result[0].get == -2L);\n assert(!result[1].isNull && result[1].get == 1L);\n}\n\n{\n auto result = candidate([4L, 5L, 3L, 6L, 2L, 7L, -7L]);\n assert(!result[0].isNull && result[0].get == -7L);\n assert(!result[1].isNull && result[1].get == 2L);\n}\n\n{\n auto result = candidate([7L, 3L, 8L, 4L, 9L, 2L, 5L, -9L]);\n assert(!result[0].isNull && result[0].get == -9L);\n assert(!result[1].isNull && result[1].get == 2L);\n}\n\n{\n auto result = candidate([]);\n assert(result[0].isNull);\n assert(result[1].isNull);\n}\n\n{\n auto result = candidate([0L]);\n assert(result[0].isNull);\n assert(result[1].isNull);\n}\n\n{\n auto result = candidate([-1L, -3L, -5L, -6L]);\n assert(!result[0].isNull && result[0].get == -1L);\n assert(result[1].isNull);\n}\n\n{\n auto result = candidate([-1L, -3L, -5L, -6L, 0L]);\n assert(!result[0].isNull && result[0].get == -1L);\n assert(result[1].isNull);\n}\n\n{\n auto result = candidate([-6L, -4L, -4L, -3L, 1L]);\n assert(!result[0].isNull && result[0].get == -3L);\n assert(!result[1].isNull && result[1].get == 1L);\n}\n\n{\n auto result = candidate([-6L, -4L, -4L, -3L, -100L, 1L]);\n assert(!result[0].isNull && result[0].get == -3L);\n assert(!result[1].isNull && result[1].get == 1L);\n}\n\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n \"Given an array representing a branch of a tree that has non-negative integer nodes\n your task is to pluck one of the nodes and return it.\n The plucked node should be the node with the smallest even value.\n If multiple nodes with the same smallest even value are found return the node that has smallest index.\n\n The plucked node should be returned in a list, [ smalest_value, its index ],\n If there are no even values or the given array is empty, return [].\n\n Example 1:\n Input: [4,2,3]\n Output: [2, 1]\n Explanation: 2 has the smallest even value, and 2 has the smallest index.\n\n Example 2:\n Input: [1,2,3]\n Output: [2, 1]\n Explanation: 2 has the smallest even value, and 2 has the smallest index. \n\n Example 3:\n Input: []\n Output: []\n \n Example 4:\n Input: [5, 0, 3, 0, 4, 2]\n Output: [0, 1]\n Explanation: 0 is the smallest value, but there are two zeros,\n so we will choose the first zero, which has the smallest index.\n\n Constraints:\n * 1 <= nodes.length <= 10000\n * 0 <= node.value\n \n*/\nlong[] pluck(long[] arr) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = pluck;\n\n assert(candidate([4L, 2L, 3L]) == [2L, 1L]);\n assert(candidate([1L, 2L, 3L]) == [2L, 1L]);\n assert(candidate([]) == []);\n assert(candidate([5L, 0L, 3L, 0L, 4L, 2L]) == [0L, 1L]);\n assert(candidate([1L, 2L, 3L, 0L, 5L, 3L]) == [0L, 3L]);\n assert(candidate([5L, 4L, 8L, 4L, 8L]) == [4L, 1L]);\n assert(candidate([7L, 6L, 7L, 1L]) == [6L, 1L]);\n assert(candidate([7L, 9L, 7L, 1L]) == []);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Write a function count_nums which takes an array of integers and returns\n the number of elements which has a sum of digits > 0.\n If a number is negative, then its first signed digit will be negative:\n e.g. -123 has signed digits -1, 2, and 3.\n >>> count_nums([]) == 0\n >>> count_nums([-1, 11, -11]) == 1\n >>> count_nums([1, 1, 2]) == 3\n \n*/\nlong count_nums(long[] arr) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = count_nums;\n\n assert(candidate([]) == 0L);\n assert(candidate([-1L, -2L, 0L]) == 0L);\n assert(candidate([1L, 1L, 2L, -2L, 3L, 4L, 5L]) == 6L);\n assert(candidate([1L, 6L, 9L, -6L, 0L, 1L, 5L]) == 5L);\n assert(candidate([1L, 100L, 98L, -7L, 1L, -1L]) == 4L);\n assert(candidate([12L, 23L, 34L, -45L, -56L, 0L]) == 5L);\n assert(candidate([0L, 1L]) == 1L);\n assert(candidate([1L]) == 1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n each cell of the grid contains a value. Every integer in the range [1, N * N]\n inclusive appears exactly once on the cells of the grid.\n\n You have to find the minimum path of length k in the grid. You can start\n from any cell, and in each step you can move to any of the neighbor cells,\n in other words, you can go to cells which share an edge with you current\n cell.\n Please note that a path of length k means visiting exactly k cells (not\n necessarily distinct).\n You CANNOT go off the grid.\n A path A (of length k) is considered less than a path B (of length k) if\n after making the ordered lists of the values on the cells that A and B go\n through (let's call them lst_A and lst_B), lst_A is lexicographically less\n than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n lst_A[j] = lst_B[j].\n It is guaranteed that the answer is unique.\n Return an ordered list of the values on the cells that the minimum path go through.\n\n Examples:\n\n Input: grid = [ [1,2,3], [4,5,6], [7,8,9]], k = 3\n Output: [1, 2, 1]\n\n Input: grid = [ [5,9,3], [4,1,6], [7,8,2]], k = 1\n Output: [1]\n \n*/\nlong[] minPath(long[][] grid, long k) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = minPath;\n\n assert(candidate([[1L, 2L, 3L], [4L, 5L, 6L], [7L, 8L, 9L]], 3L) == [1L, 2L, 1L]);\n assert(candidate([[5L, 9L, 3L], [4L, 1L, 6L], [7L, 8L, 2L]], 1L) == [1L]);\n assert(candidate([[1L, 2L, 3L, 4L], [5L, 6L, 7L, 8L], [9L, 10L, 11L, 12L], [13L, 14L, 15L, 16L]], 4L) == [1L, 2L, 1L, 2L]);\n assert(candidate([[6L, 4L, 13L, 10L], [5L, 7L, 12L, 1L], [3L, 16L, 11L, 15L], [8L, 14L, 9L, 2L]], 7L) == [1L, 10L, 1L, 10L, 1L, 10L, 1L]);\n assert(candidate([[8L, 14L, 9L, 2L], [6L, 4L, 13L, 15L], [5L, 7L, 1L, 12L], [3L, 10L, 11L, 16L]], 5L) == [1L, 7L, 1L, 7L, 1L]);\n assert(candidate([[11L, 8L, 7L, 2L], [5L, 16L, 14L, 4L], [9L, 3L, 15L, 6L], [12L, 13L, 10L, 1L]], 9L) == [1L, 6L, 1L, 6L, 1L, 6L, 1L, 6L, 1L]);\n assert(candidate([[12L, 13L, 10L, 1L], [9L, 3L, 15L, 6L], [5L, 16L, 14L, 4L], [11L, 8L, 7L, 2L]], 12L) == [1L, 6L, 1L, 6L, 1L, 6L, 1L, 6L, 1L, 6L, 1L, 6L]);\n assert(candidate([[2L, 7L, 4L], [3L, 1L, 5L], [6L, 8L, 9L]], 8L) == [1L, 3L, 1L, 3L, 1L, 3L, 1L, 3L]);\n assert(candidate([[6L, 1L, 5L], [3L, 8L, 9L], [2L, 7L, 4L]], 8L) == [1L, 5L, 1L, 5L, 1L, 5L, 1L, 5L]);\n assert(candidate([[1L, 2L], [3L, 4L]], 10L) == [1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L]);\n assert(candidate([[1L, 3L], [3L, 2L]], 10L) == [1L, 3L, 1L, 3L, 1L, 3L, 1L, 3L, 1L, 3L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given list of integers, return list in strange order.\n Strange sorting, is when you start with the minimum value,\n then maximum of the remaining integers, then minimum and so on.\n\n Examples:\n strange_sort_list([1, 2, 3, 4]) == [1, 4, 2, 3]\n strange_sort_list([5, 5, 5, 5]) == [5, 5, 5, 5]\n strange_sort_list([]) == []\n \n*/\nlong[] strange_sort_list(long[] lst) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = strange_sort_list;\n\n assert(candidate([1L, 2L, 3L, 4L]) == [1L, 4L, 2L, 3L]);\n assert(candidate([5L, 6L, 7L, 8L, 9L]) == [5L, 9L, 6L, 8L, 7L]);\n assert(candidate([1L, 2L, 3L, 4L, 5L]) == [1L, 5L, 2L, 4L, 3L]);\n assert(candidate([5L, 6L, 7L, 8L, 9L, 1L]) == [1L, 9L, 5L, 8L, 6L, 7L]);\n assert(candidate([5L, 5L, 5L, 5L]) == [5L, 5L, 5L, 5L]);\n assert(candidate([]) == []);\n assert(candidate([1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L]) == [1L, 8L, 2L, 7L, 3L, 6L, 4L, 5L]);\n assert(candidate([0L, 2L, 2L, 2L, 5L, 5L, -5L, -5L]) == [-5L, 5L, -5L, 5L, 0L, 2L, 2L, 2L]);\n assert(candidate([111111L]) == [111111L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given a string 'text', return its md5 hash equivalent string.\n If 'text' is an empty string, return None.\n\n >>> string_to_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'\n \n*/\nNullable!(string) string_to_md5(string text) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = string_to_md5;\n\n{\n auto result = candidate(\"Hello world\");\n assert(!result.isNull && result.get == \"3e25960a79dbc69b674cd4ec67a72c62\");\n}\n\n{\n auto result = candidate(\"\");\n assert(result.isNull);\n}\n\n{\n auto result = candidate(\"A B C\");\n assert(!result.isNull && result.get == \"0ef78513b0cb8cef12743f5aeb35f888\");\n}\n\n{\n auto result = candidate(\"password\");\n assert(!result.isNull && result.get == \"5f4dcc3b5aa765d61d8327deb882cf99\");\n}\n\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou are given a word. Your task is to find the closest vowel that stands between \n two consonants from the right side of the word (case sensitive).\n \n Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n find any vowel met the above condition. \n\n You may assume that the given string contains English letter only.\n\n Example:\n get_closest_vowel(\"yogurt\") ==> \"u\"\n get_closest_vowel(\"FULL\") ==> \"U\"\n get_closest_vowel(\"quick\") ==> \"\"\n get_closest_vowel(\"ab\") ==> \"\"\n \n*/\nstring get_closest_vowel(string word) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = get_closest_vowel;\n\n assert(candidate(\"yogurt\") == \"u\");\n assert(candidate(\"full\") == \"u\");\n assert(candidate(\"easy\") == \"\");\n assert(candidate(\"eAsy\") == \"\");\n assert(candidate(\"ali\") == \"\");\n assert(candidate(\"bad\") == \"a\");\n assert(candidate(\"most\") == \"o\");\n assert(candidate(\"ab\") == \"\");\n assert(candidate(\"ba\") == \"\");\n assert(candidate(\"quick\") == \"\");\n assert(candidate(\"anime\") == \"i\");\n assert(candidate(\"Asia\") == \"\");\n assert(candidate(\"Above\") == \"o\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nChange numerical base of input number x to base.\n return string representation after the conversion.\n base numbers are less than 10.\n >>> change_base(8, 3)\n '22'\n >>> change_base(8, 2)\n '1000'\n >>> change_base(7, 2)\n '111'\n \n*/\nstring change_base(long x, long base) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = change_base;\n\n assert(candidate(8L, 3L) == \"22\");\n assert(candidate(9L, 3L) == \"100\");\n assert(candidate(234L, 2L) == \"11101010\");\n assert(candidate(16L, 2L) == \"10000\");\n assert(candidate(8L, 2L) == \"1000\");\n assert(candidate(7L, 2L) == \"111\");\n assert(candidate(2L, 3L) == \"2\");\n assert(candidate(3L, 4L) == \"3\");\n assert(candidate(4L, 5L) == \"4\");\n assert(candidate(5L, 6L) == \"5\");\n assert(candidate(6L, 7L) == \"6\");\n assert(candidate(7L, 8L) == \"7\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Check if in given list of numbers, are any two numbers closer to each other than\n given threshold.\n >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n False\n >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n True\n \n*/\nbool has_close_elements(float[] numbers, float threshold) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = has_close_elements;\n\n assert(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3) == true);\n assert(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05) == false);\n assert(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.95) == true);\n assert(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.8) == false);\n assert(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1) == true);\n assert(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 1.0) == true);\n assert(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 0.5) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Create a function that takes a string as input which contains only square brackets.\n The function should return True if and only if there is a valid subsequence of brackets \n where at least one bracket in the subsequence is nested.\n\n is_nested('[[]]') \u279e True\n is_nested('[]]]]]]][[[[[]') \u279e False\n is_nested('[][]') \u279e False\n is_nested('[]') \u279e False\n is_nested('[[][]]') \u279e True\n is_nested('[[]][[') \u279e True\n \n*/\nbool is_nested(string string) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = is_nested;\n\n assert(candidate(\"[[]]\") == true);\n assert(candidate(\"[]]]]]]][[[[[]\") == false);\n assert(candidate(\"[][]\") == false);\n assert(candidate(\"[]\") == false);\n assert(candidate(\"[[[[]]]]\") == true);\n assert(candidate(\"[]]]]]]]]]]\") == false);\n assert(candidate(\"[][][[]]\") == true);\n assert(candidate(\"[[]\") == false);\n assert(candidate(\"[]]\") == false);\n assert(candidate(\"[[]][[\") == true);\n assert(candidate(\"[[][]]\") == true);\n assert(candidate(\"\") == false);\n assert(candidate(\"[[[[[[[[\") == false);\n assert(candidate(\"]]]]]]]]\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Concatenate list of strings into a single string\n >>> concatenate([])\n ''\n >>> concatenate(['a', 'b', 'c'])\n 'abc'\n \n*/\nstring concatenate(string[] strings) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = concatenate;\n\n assert(candidate([]) == \"\");\n assert(candidate([\"x\", \"y\", \"z\"]) == \"xyz\");\n assert(candidate([\"x\", \"y\", \"z\", \"w\", \"k\"]) == \"xyzwk\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n >>> prime_fib(1)\n 2\n >>> prime_fib(2)\n 3\n >>> prime_fib(3)\n 5\n >>> prime_fib(4)\n 13\n >>> prime_fib(5)\n 89\n \n*/\nlong prime_fib(long n) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = prime_fib;\n\n assert(candidate(1L) == 2L);\n assert(candidate(2L) == 3L);\n assert(candidate(3L) == 5L);\n assert(candidate(4L) == 13L);\n assert(candidate(5L) == 89L);\n assert(candidate(6L) == 233L);\n assert(candidate(7L) == 1597L);\n assert(candidate(8L) == 28657L);\n assert(candidate(9L) == 514229L);\n assert(candidate(10L) == 433494437L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n other and return them in order (smaller number, larger number).\n >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n (2.0, 2.2)\n >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n (2.0, 2.0)\n \n*/\nTuple!(float, float) find_closest_elements(float[] numbers) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = find_closest_elements;\n\n assert(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2]) == tuple(3.9, 4.0));\n assert(candidate([1.0, 2.0, 5.9, 4.0, 5.0]) == tuple(5.0, 5.9));\n assert(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]) == tuple(2.0, 2.2));\n assert(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]) == tuple(2.0, 2.0));\n assert(candidate([1.1, 2.2, 3.1, 4.1, 5.1]) == tuple(2.2, 3.1));\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou have been tasked to write a function that receives \n a hexadecimal number as a string and counts the number of hexadecimal \n digits that are primes (prime number, or a prime, is a natural number \n greater than 1 that is not a product of two smaller natural numbers).\n Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n So you have to determine a number of the following digits: 2, 3, 5, 7, \n B (=decimal 11), D (=decimal 13).\n Note: you may assume the input is always correct or empty string, \n and symbols A,B,C,D,E,F are always uppercase.\n Examples:\n For num = \"AB\" the output should be 1.\n For num = \"1077E\" the output should be 2.\n For num = \"ABED1A33\" the output should be 4.\n For num = \"123456789ABCDEF0\" the output should be 6.\n For num = \"2020\" the output should be 2.\n \n*/\nlong hex_key(string num) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = hex_key;\n\n assert(candidate(\"AB\") == 1L);\n assert(candidate(\"1077E\") == 2L);\n assert(candidate(\"ABED1A33\") == 4L);\n assert(candidate(\"2020\") == 2L);\n assert(candidate(\"123456789ABCDEF0\") == 6L);\n assert(candidate(\"112233445566778899AABBCCDDEEFF00\") == 12L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nComplete the function that takes two integers and returns \n the product of their unit digits.\n Assume the input is always valid.\n Examples:\n multiply(148, 412) should return 16.\n multiply(19, 28) should return 72.\n multiply(2020, 1851) should return 0.\n multiply(14,-15) should return 20.\n \n*/\nlong multiply(long a, long b) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = multiply;\n\n assert(candidate(148L, 412L) == 16L);\n assert(candidate(19L, 28L) == 72L);\n assert(candidate(2020L, 1851L) == 0L);\n assert(candidate(14L, -15L) == 20L);\n assert(candidate(76L, 67L) == 42L);\n assert(candidate(17L, 27L) == 49L);\n assert(candidate(0L, 1L) == 0L);\n assert(candidate(0L, 0L) == 0L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Given list of numbers (of at least two elements), apply a linear transform to that list,\n such that the smallest number will become 0 and the largest will become 1\n >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n [0.0, 0.25, 0.5, 0.75, 1.0]\n \n*/\nfloat[] rescale_to_unit(float[] numbers) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = rescale_to_unit;\n\n assert(candidate([2.0, 49.9]) == [0.0, 1.0]);\n assert(candidate([100.0, 49.9]) == [1.0, 0.0]);\n assert(candidate([1.0, 2.0, 3.0, 4.0, 5.0]) == [0.0, 0.25, 0.5, 0.75, 1.0]);\n assert(candidate([2.0, 1.0, 5.0, 3.0, 4.0]) == [0.25, 0.0, 1.0, 0.5, 0.75]);\n assert(candidate([12.0, 11.0, 15.0, 13.0, 14.0]) == [0.25, 0.0, 1.0, 0.5, 0.75]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nGiven a positive integer n, return the product of the odd digits.\n Return 0 if all digits are even.\n For example:\n digits(1) == 1\n digits(4) == 0\n digits(235) == 15\n \n*/\nlong digits(long n) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = digits;\n\n assert(candidate(5L) == 5L);\n assert(candidate(54L) == 5L);\n assert(candidate(120L) == 1L);\n assert(candidate(5014L) == 5L);\n assert(candidate(98765L) == 315L);\n assert(candidate(5576543L) == 2625L);\n assert(candidate(2468L) == 0L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou will be given the name of a class (a string) and a list of extensions.\n The extensions are to be used to load additional classes to the class. The\n strength of the extension is as follows: Let CAP be the number of the uppercase\n letters in the extension's name, and let SM be the number of lowercase letters \n in the extension's name, the strength is given by the fraction CAP - SM. \n You should find the strongest extension and return a string in this \n format: ClassName.StrongestExtensionName.\n If there are two or more extensions with the same strength, you should\n choose the one that comes first in the list.\n For example, if you are given \"Slices\" as the class and a list of the\n extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n (its strength is -1).\n Example:\n for Strongest_Extension('my_class', ['AA', 'Be', 'CC']) == 'my_class.AA'\n \n*/\nstring Strongest_Extension(string class_name, string[] extensions) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = Strongest_Extension;\n\n assert(candidate(\"Watashi\", [\"tEN\", \"niNE\", \"eIGHt8OKe\"]) == \"Watashi.eIGHt8OKe\");\n assert(candidate(\"Boku123\", [\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"]) == \"Boku123.YEs.WeCaNe\");\n assert(candidate(\"__YESIMHERE\", [\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"]) == \"__YESIMHERE.NuLl__\");\n assert(candidate(\"K\", [\"Ta\", \"TAR\", \"t234An\", \"cosSo\"]) == \"K.TAR\");\n assert(candidate(\"__HAHA\", [\"Tab\", \"123\", \"781345\", \"-_-\"]) == \"__HAHA.123\");\n assert(candidate(\"YameRore\", [\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"]) == \"YameRore.okIWILL123\");\n assert(candidate(\"finNNalLLly\", [\"Die\", \"NowW\", \"Wow\", \"WoW\"]) == \"finNNalLLly.WoW\");\n assert(candidate(\"_\", [\"Bb\", \"91245\"]) == \"_.Bb\");\n assert(candidate(\"Sp\", [\"671235\", \"Bb\"]) == \"Sp.671235\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nGiven a string representing a space separated lowercase letters, return a dictionary\n of the letter with the most repetition and containing the corresponding count.\n If several letters have the same occurrence, return all of them.\n \n Example:\n histogram('a b c') == {'a': 1, 'b': 1, 'c': 1}\n histogram('a b b a') == {'a': 2, 'b': 2}\n histogram('a b c a b') == {'a': 2, 'b': 2}\n histogram('b b b b a') == {'b': 4}\n histogram('') == {}\n\n \n*/\nNullable!(long[string]) histogram(string test) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = histogram;\n\n{\n auto result = candidate(\"a b b a\");\n assert(!result.isNull && result.get == [\"a\": 2L, \"b\": 2L]);\n}\n\n{\n auto result = candidate(\"a b c a b\");\n assert(!result.isNull && result.get == [\"a\": 2L, \"b\": 2L]);\n}\n\n{\n auto result = candidate(\"a b c d g\");\n assert(!result.isNull && result.get == [\"a\": 1L, \"b\": 1L, \"c\": 1L, \"d\": 1L, \"g\": 1L]);\n}\n\n{\n auto result = candidate(\"r t g\");\n assert(!result.isNull && result.get == [\"r\": 1L, \"t\": 1L, \"g\": 1L]);\n}\n\n{\n auto result = candidate(\"b b b b a\");\n assert(!result.isNull && result.get == [\"b\": 4L]);\n}\n\n{\n auto result = candidate(\"r t g\");\n assert(!result.isNull && result.get == [\"r\": 1L, \"t\": 1L, \"g\": 1L]);\n}\n\n{\n auto result = candidate(\"\");\n assert(result.isNull);\n}\n\n{\n auto result = candidate(\"a\");\n assert(!result.isNull && result.get == [\"a\": 1L]);\n}\n\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n pairs_sum_to_zero takes a list of integers as an input.\n it returns True if there are two distinct elements in the list that\n sum to zero, and False otherwise.\n >>> pairs_sum_to_zero([1, 3, 5, 0])\n False\n >>> pairs_sum_to_zero([1, 3, -2, 1])\n False\n >>> pairs_sum_to_zero([1, 2, 3, 7])\n False\n >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7])\n True\n >>> pairs_sum_to_zero([1])\n False\n \n*/\nbool pairs_sum_to_zero(long[] l) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = pairs_sum_to_zero;\n\n assert(candidate([1L, 3L, 5L, 0L]) == false);\n assert(candidate([1L, 3L, -2L, 1L]) == false);\n assert(candidate([1L, 2L, 3L, 7L]) == false);\n assert(candidate([2L, 4L, -5L, 3L, 5L, 7L]) == true);\n assert(candidate([1L]) == false);\n assert(candidate([-3L, 9L, -1L, 3L, 2L, 30L]) == true);\n assert(candidate([-3L, 9L, -1L, 3L, 2L, 31L]) == true);\n assert(candidate([-3L, 9L, -1L, 4L, 2L, 30L]) == false);\n assert(candidate([-3L, 9L, -1L, 4L, 2L, 31L]) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Write a function that accepts two lists of strings and returns the list that has \n total number of chars in the all strings of the list less than the other list.\n\n if the two lists have the same number of chars, return the first list.\n\n Examples\n total_match([], []) \u279e []\n total_match(['hi', 'admin'], ['hI', 'Hi']) \u279e ['hI', 'Hi']\n total_match(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) \u279e ['hi', 'admin']\n total_match(['hi', 'admin'], ['hI', 'hi', 'hi']) \u279e ['hI', 'hi', 'hi']\n total_match(['4'], ['1', '2', '3', '4', '5']) \u279e ['4']\n \n*/\nstring[] total_match(string[] lst1, string[] lst2) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = total_match;\n\n assert(candidate([], []) == []);\n assert(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\"]) == [\"hi\", \"hi\"]);\n assert(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"]) == [\"hi\", \"admin\"]);\n assert(candidate([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"]) == [\"4\"]);\n assert(candidate([\"hi\", \"admin\"], [\"hI\", \"Hi\"]) == [\"hI\", \"Hi\"]);\n assert(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"]) == [\"hI\", \"hi\", \"hi\"]);\n assert(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hii\"]) == [\"hi\", \"admin\"]);\n assert(candidate([], [\"this\"]) == []);\n assert(candidate([\"this\"], []) == []);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nCircular shift the digits of the integer x, shift the digits right by shift\n and return the result as a string.\n If shift > number of digits, return digits reversed.\n >>> circular_shift(12, 1)\n \"21\"\n >>> circular_shift(12, 2)\n \"12\"\n \n*/\nstring circular_shift(long x, long shift) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = circular_shift;\n\n assert(candidate(100L, 2L) == \"001\");\n assert(candidate(12L, 2L) == \"12\");\n assert(candidate(97L, 8L) == \"79\");\n assert(candidate(12L, 1L) == \"21\");\n assert(candidate(11L, 101L) == \"11\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nReturn True is list elements are monotonically increasing or decreasing.\n >>> monotonic([1, 2, 4, 20])\n True\n >>> monotonic([1, 20, 4, 10])\n False\n >>> monotonic([4, 1, 0, -10])\n True\n \n*/\nbool monotonic(long[] l) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = monotonic;\n\n assert(candidate([1L, 2L, 4L, 10L]) == true);\n assert(candidate([1L, 2L, 4L, 20L]) == true);\n assert(candidate([1L, 20L, 4L, 10L]) == false);\n assert(candidate([4L, 1L, 0L, -10L]) == true);\n assert(candidate([4L, 1L, 1L, 0L]) == true);\n assert(candidate([1L, 2L, 3L, 2L, 5L, 60L]) == false);\n assert(candidate([1L, 2L, 3L, 4L, 5L, 60L]) == true);\n assert(candidate([9L, 9L, 9L, 9L]) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nEvaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n Example\n is_equal_to_sum_even(4) == False\n is_equal_to_sum_even(6) == False\n is_equal_to_sum_even(8) == True\n \n*/\nbool is_equal_to_sum_even(long n) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = is_equal_to_sum_even;\n\n assert(candidate(4L) == false);\n assert(candidate(6L) == false);\n assert(candidate(8L) == true);\n assert(candidate(10L) == true);\n assert(candidate(11L) == false);\n assert(candidate(12L) == true);\n assert(candidate(13L) == false);\n assert(candidate(16L) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Input to this function is a string representing musical notes in a special ASCII format.\n Your task is to parse this string and return list of integers corresponding to how many beats does each\n not last.\n\n Here is a legend:\n 'o' - whole note, lasts four beats\n 'o|' - half note, lasts two beats\n '.|' - quater note, lasts one beat\n\n >>> parse_music('o o| .| o| o| .| .| .| .| o o')\n [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\n \n*/\nlong[] parse_music(string music_string) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = parse_music;\n\n assert(candidate(\"\") == []);\n assert(candidate(\"o o o o\") == [4L, 4L, 4L, 4L]);\n assert(candidate(\".| .| .| .|\") == [1L, 1L, 1L, 1L]);\n assert(candidate(\"o| o| .| .| o o o o\") == [2L, 2L, 1L, 1L, 4L, 4L, 4L, 4L]);\n assert(candidate(\"o| .| o| .| o o| o o|\") == [2L, 1L, 2L, 1L, 4L, 2L, 4L, 2L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\"\n This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n \n Examples:\n For lst = [1,2,3] the output should be 6\n For lst = [] the output should be 0\n For lst = [-1,-5,2,-1,-5] the output should be -126\n \n*/\nlong sum_squares(long[] lst) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = sum_squares;\n\n assert(candidate([1L, 2L, 3L]) == 6L);\n assert(candidate([1L, 4L, 9L]) == 14L);\n assert(candidate([]) == 0L);\n assert(candidate([1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L]) == 9L);\n assert(candidate([-1L, -1L, -1L, -1L, -1L, -1L, -1L, -1L, -1L]) == -3L);\n assert(candidate([0L]) == 0L);\n assert(candidate([-1L, -5L, 2L, -1L, -5L]) == -126L);\n assert(candidate([-56L, -99L, 1L, 0L, -2L]) == 3030L);\n assert(candidate([-1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, -1L]) == 0L);\n assert(candidate([-16L, -9L, -2L, 36L, 36L, 26L, -20L, 25L, -40L, 20L, -4L, 12L, -26L, 35L, 37L]) == -14196L);\n assert(candidate([-1L, -3L, 17L, -1L, -15L, 13L, -1L, 14L, -14L, -12L, -5L, 14L, -14L, 6L, 13L, 11L, 16L, 16L, 4L, 10L]) == -1448L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n triples_sum_to_zero takes a list of integers as an input.\n it returns True if there are three distinct elements in the list that\n sum to zero, and False otherwise.\n\n >>> triples_sum_to_zero([1, 3, 5, 0])\n False\n >>> triples_sum_to_zero([1, 3, -2, 1])\n True\n >>> triples_sum_to_zero([1, 2, 3, 7])\n False\n >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n True\n >>> triples_sum_to_zero([1])\n False\n \n*/\nbool triples_sum_to_zero(long[] l) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = triples_sum_to_zero;\n\n assert(candidate([1L, 3L, 5L, 0L]) == false);\n assert(candidate([1L, 3L, 5L, -1L]) == false);\n assert(candidate([1L, 3L, -2L, 1L]) == true);\n assert(candidate([1L, 2L, 3L, 7L]) == false);\n assert(candidate([1L, 2L, 5L, 7L]) == false);\n assert(candidate([2L, 4L, -5L, 3L, 9L, 7L]) == true);\n assert(candidate([1L]) == false);\n assert(candidate([1L, 3L, 5L, -100L]) == false);\n assert(candidate([100L, 3L, 5L, -100L]) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n brackets is a string of \"<\" and \">\".\n return True if every opening bracket has a corresponding closing bracket.\n\n >>> correct_bracketing(\"<\")\n False\n >>> correct_bracketing(\"<>\")\n True\n >>> correct_bracketing(\"<<><>>\")\n True\n >>> correct_bracketing(\"><<>\")\n False\n \n*/\nbool correct_bracketing(string brackets) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = correct_bracketing;\n\n assert(candidate(\"<>\") == true);\n assert(candidate(\"<<><>>\") == true);\n assert(candidate(\"<><><<><>><>\") == true);\n assert(candidate(\"<><><<<><><>><>><<><><<>>>\") == true);\n assert(candidate(\"<<<><>>>>\") == false);\n assert(candidate(\"><<>\") == false);\n assert(candidate(\"<\") == false);\n assert(candidate(\"<<<<\") == false);\n assert(candidate(\">\") == false);\n assert(candidate(\"<<>\") == false);\n assert(candidate(\"<><><<><>><>><<>\") == false);\n assert(candidate(\"<><><<><>><>>><>\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nWrite a function that takes an array of numbers as input and returns \n the number of elements in the array that are greater than 10 and both \n first and last digits of a number are odd (1, 3, 5, 7, 9).\n For example:\n specialFilter([15, -73, 14, -15]) => 1 \n specialFilter([33, -2, -3, 45, 21, 109]) => 2\n \n*/\nlong specialFilter(long[] nums) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = specialFilter;\n\n assert(candidate([5L, -2L, 1L, -5L]) == 0L);\n assert(candidate([15L, -73L, 14L, -15L]) == 1L);\n assert(candidate([33L, -2L, -3L, 45L, 21L, 109L]) == 2L);\n assert(candidate([43L, -12L, 93L, 125L, 121L, 109L]) == 4L);\n assert(candidate([71L, -2L, -33L, 75L, 21L, 19L]) == 3L);\n assert(candidate([1L]) == 0L);\n assert(candidate([]) == 0L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given a dictionary, return True if all keys are strings in lower \n case or all keys are strings in upper case, else return False.\n The function should return False is the given dictionary is empty.\n Examples:\n check_dict_case({\"a\":\"apple\", \"b\":\"banana\"}) should return True.\n check_dict_case({\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}) should return False.\n check_dict_case({\"a\":\"apple\", \"8\":\"banana\", \"a\":\"apple\"}) should return False.\n check_dict_case({\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}) should return False.\n check_dict_case({\"STATE\":\"NC\", \"ZIP\":\"12345\" }) should return True.\n \n*/\nbool check_dict_case(Nullable!(string[string]) dict) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = check_dict_case;\n\n assert(candidate([\"p\": \"pineapple\", \"b\": \"banana\"].nullable) == true);\n assert(candidate([\"p\": \"pineapple\", \"A\": \"banana\", \"B\": \"banana\"].nullable) == false);\n assert(candidate([\"p\": \"pineapple\", \"5\": \"banana\", \"a\": \"apple\"].nullable) == false);\n assert(candidate([\"Name\": \"John\", \"Age\": \"36\", \"City\": \"Houston\"].nullable) == false);\n assert(candidate([\"STATE\": \"NC\", \"ZIP\": \"12345\"].nullable) == true);\n assert(candidate([\"fruit\": \"Orange\", \"taste\": \"Sweet\"].nullable) == true);\n assert(candidate(Nullable!(string[string]).init) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nThe FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fibfib(0) == 0\n fibfib(1) == 0\n fibfib(2) == 1\n fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n >>> fibfib(1)\n 0\n >>> fibfib(5)\n 4\n >>> fibfib(8)\n 24\n \n*/\nlong fibfib(long n) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = fibfib;\n\n assert(candidate(2L) == 1L);\n assert(candidate(1L) == 0L);\n assert(candidate(5L) == 4L);\n assert(candidate(8L) == 24L);\n assert(candidate(10L) == 81L);\n assert(candidate(12L) == 274L);\n assert(candidate(14L) == 927L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou are given a list of numbers.\n You need to return the sum of squared numbers in the given list,\n round each element in the list to the upper int(Ceiling) first.\n Examples:\n For lst = [1,2,3] the output should be 14\n For lst = [1,4,9] the output should be 98\n For lst = [1,3,5,7] the output should be 84\n For lst = [1.4,4.2,0] the output should be 29\n For lst = [-2.4,1,1] the output should be 6\n \n\n \n*/\nlong sum_squares(float[] lst) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = sum_squares;\n\n assert(candidate([1.0, 2.0, 3.0]) == 14L);\n assert(candidate([1.0, 2.0, 3.0]) == 14L);\n assert(candidate([1.0, 3.0, 5.0, 7.0]) == 84L);\n assert(candidate([1.4, 4.2, 0.0]) == 29L);\n assert(candidate([-2.4, 1.0, 1.0]) == 6L);\n assert(candidate([100.0, 1.0, 15.0, 2.0]) == 10230L);\n assert(candidate([10000.0, 10000.0]) == 200000000L);\n assert(candidate([-1.4, 4.6, 6.3]) == 75L);\n assert(candidate([-1.4, 17.9, 18.9, 19.9]) == 1086L);\n assert(candidate([0.0]) == 0L);\n assert(candidate([-1.0]) == 1L);\n assert(candidate([-1.0, 1.0, 0.0]) == 2L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_85_add", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nGiven a non-empty list of integers lst. add the even elements that are at odd indices..\n\n\n Examples:\n add([4, 2, 6, 7]) ==> 2 \n \n*/\nlong add(long[] lst) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = add;\n\n assert(candidate([4L, 88L]) == 88L);\n assert(candidate([4L, 5L, 6L, 7L, 2L, 122L]) == 122L);\n assert(candidate([4L, 0L, 6L, 7L]) == 0L);\n assert(candidate([4L, 4L, 6L, 8L]) == 12L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nReturn sorted unique elements in a list\n >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123])\n [0, 2, 3, 5, 9, 123]\n \n*/\nlong[] unique(long[] l) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = unique;\n\n assert(candidate([5L, 3L, 5L, 2L, 3L, 3L, 9L, 0L, 123L]) == [0L, 2L, 3L, 5L, 9L, 123L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given a string text, replace all spaces in it with underscores, \n and if a string has more than 2 consecutive spaces, \n then replace all consecutive spaces with - \n \n fix_spaces(\"Example\") == \"Example\"\n fix_spaces(\"Example 1\") == \"Example_1\"\n fix_spaces(\" Example 2\") == \"_Example_2\"\n fix_spaces(\" Example 3\") == \"_Example-3\"\n \n*/\nstring fix_spaces(string text) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = fix_spaces;\n\n assert(candidate(\"Example\") == \"Example\");\n assert(candidate(\"Mudasir Hanif \") == \"Mudasir_Hanif_\");\n assert(candidate(\"Yellow Yellow Dirty Fellow\") == \"Yellow_Yellow__Dirty__Fellow\");\n assert(candidate(\"Exa mple\") == \"Exa-mple\");\n assert(candidate(\" Exa 1 2 2 mple\") == \"-Exa_1_2_2_mple\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nReturn 2^n modulo p (be aware of numerics).\n >>> modp(3, 5)\n 3\n >>> modp(1101, 101)\n 2\n >>> modp(0, 101)\n 1\n >>> modp(3, 11)\n 8\n >>> modp(100, 101)\n 1\n \n*/\nlong modp(long n, long p) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = modp;\n\n assert(candidate(3L, 5L) == 3L);\n assert(candidate(1101L, 101L) == 2L);\n assert(candidate(0L, 101L) == 1L);\n assert(candidate(3L, 11L) == 8L);\n assert(candidate(100L, 101L) == 1L);\n assert(candidate(30L, 5L) == 4L);\n assert(candidate(31L, 5L) == 3L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou have to write a function which validates a given date string and\n returns True if the date is valid otherwise False.\n The date is valid if all of the following rules are satisfied:\n 1. The date string is not empty.\n 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n 3. The months should not be less than 1 or higher than 12.\n 4. The date should be in the format: mm-dd-yyyy\n\n for example: \n valid_date('03-11-2000') => True\n\n valid_date('15-01-2012') => False\n\n valid_date('04-0-2040') => False\n\n valid_date('06-04-2020') => True\n\n valid_date('06/04/2020') => False\n \n*/\nbool valid_date(string date) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = valid_date;\n\n assert(candidate(\"03-11-2000\") == true);\n assert(candidate(\"15-01-2012\") == false);\n assert(candidate(\"04-0-2040\") == false);\n assert(candidate(\"06-04-2020\") == true);\n assert(candidate(\"01-01-2007\") == true);\n assert(candidate(\"03-32-2011\") == false);\n assert(candidate(\"\") == false);\n assert(candidate(\"04-31-3000\") == false);\n assert(candidate(\"06-06-2005\") == true);\n assert(candidate(\"21-31-2000\") == false);\n assert(candidate(\"04-12-2003\") == true);\n assert(candidate(\"04122003\") == false);\n assert(candidate(\"20030412\") == false);\n assert(candidate(\"2003-04\") == false);\n assert(candidate(\"2003-04-12\") == false);\n assert(candidate(\"04-2003\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Write a function that takes a string and returns an ordered version of it.\n Ordered version of string, is a string where all words (separated by space)\n are replaced by a new word where all the characters arranged in\n ascending order based on ascii value.\n Note: You should keep the order of words and blank spaces in the sentence.\n\n For example:\n anti_shuffle('Hi') returns 'Hi'\n anti_shuffle('hello') returns 'ehllo'\n anti_shuffle('Hello World!!!') returns 'Hello !!!Wdlor'\n \n*/\nstring anti_shuffle(string s) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = anti_shuffle;\n\n assert(candidate(\"Hi\") == \"Hi\");\n assert(candidate(\"hello\") == \"ehllo\");\n assert(candidate(\"number\") == \"bemnru\");\n assert(candidate(\"abcd\") == \"abcd\");\n assert(candidate(\"Hello World!!!\") == \"Hello !!!Wdlor\");\n assert(candidate(\"\") == \"\");\n assert(candidate(\"Hi. My name is Mister Robot. How are you?\") == \".Hi My aemn is Meirst .Rboot How aer ?ouy\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given a list of numbers, return whether or not they are sorted\n in ascending order. If list has more than 1 duplicate of the same\n number, return False. Assume no negative numbers and only integers.\n\n Examples\n is_sorted([5]) \u279e True\n is_sorted([1, 2, 3, 4, 5]) \u279e True\n is_sorted([1, 3, 2, 4, 5]) \u279e False\n is_sorted([1, 2, 3, 4, 5, 6]) \u279e True\n is_sorted([1, 2, 3, 4, 5, 6, 7]) \u279e True\n is_sorted([1, 3, 2, 4, 5, 6, 7]) \u279e False\n is_sorted([1, 2, 2, 3, 3, 4]) \u279e True\n is_sorted([1, 2, 2, 2, 3, 4]) \u279e False\n \n*/\nbool is_sorted(long[] lst) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = is_sorted;\n\n assert(candidate([5L]) == true);\n assert(candidate([1L, 2L, 3L, 4L, 5L]) == true);\n assert(candidate([1L, 3L, 2L, 4L, 5L]) == false);\n assert(candidate([1L, 2L, 3L, 4L, 5L, 6L]) == true);\n assert(candidate([1L, 2L, 3L, 4L, 5L, 6L, 7L]) == true);\n assert(candidate([1L, 3L, 2L, 4L, 5L, 6L, 7L]) == false);\n assert(candidate([]) == true);\n assert(candidate([1L]) == true);\n assert(candidate([3L, 2L, 1L]) == false);\n assert(candidate([1L, 2L, 2L, 2L, 3L, 4L]) == false);\n assert(candidate([1L, 2L, 3L, 3L, 3L, 4L]) == false);\n assert(candidate([1L, 2L, 2L, 3L, 3L, 4L]) == true);\n assert(candidate([1L, 2L, 3L, 4L]) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou are given a string s.\n Your task is to check if the string is happy or not.\n A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n For example:\n is_happy(a) => False\n is_happy(aa) => False\n is_happy(abcd) => True\n is_happy(aabb) => False\n is_happy(adb) => True\n is_happy(xyy) => False\n \n*/\nbool is_happy(string s) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = is_happy;\n\n assert(candidate(\"a\") == false);\n assert(candidate(\"aa\") == false);\n assert(candidate(\"abcd\") == true);\n assert(candidate(\"aabb\") == false);\n assert(candidate(\"adb\") == true);\n assert(candidate(\"xyy\") == false);\n assert(candidate(\"iopaxpoi\") == true);\n assert(candidate(\"iopaxioi\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Write a function that returns True if the object q will fly, and False otherwise.\n The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n\n Example:\n will_it_fly([1, 2], 5) \u279e False \n # 1+2 is less than the maximum possible weight, but it's unbalanced.\n\n will_it_fly([3, 2, 3], 1) \u279e False\n # it's balanced, but 3+2+3 is more than the maximum possible weight.\n\n will_it_fly([3, 2, 3], 9) \u279e True\n # 3+2+3 is less than the maximum possible weight, and it's balanced.\n\n will_it_fly([3], 5) \u279e True\n # 3 is less than the maximum possible weight, and it's balanced.\n \n*/\nbool will_it_fly(long[] q, long w) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = will_it_fly;\n\n assert(candidate([3L, 2L, 3L], 9L) == true);\n assert(candidate([1L, 2L], 5L) == false);\n assert(candidate([3L], 5L) == true);\n assert(candidate([3L, 2L, 3L], 1L) == false);\n assert(candidate([1L, 2L, 3L], 6L) == false);\n assert(candidate([5L], 5L) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given an array of non-negative integers, return a copy of the given array after sorting,\n you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n or sort it in descending order if the sum( first index value, last index value) is even.\n\n Note:\n * don't change the given array.\n\n Examples:\n * sort_array([]) => []\n * sort_array([5]) => [5]\n * sort_array([2, 4, 3, 0, 1, 5]) => [0, 1, 2, 3, 4, 5]\n * sort_array([2, 4, 3, 0, 1, 5, 6]) => [6, 5, 4, 3, 2, 1, 0]\n \n*/\nlong[] sort_array(long[] array) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = sort_array;\n\n assert(candidate([]) == []);\n assert(candidate([5L]) == [5L]);\n assert(candidate([2L, 4L, 3L, 0L, 1L, 5L]) == [0L, 1L, 2L, 3L, 4L, 5L]);\n assert(candidate([2L, 4L, 3L, 0L, 1L, 5L, 6L]) == [6L, 5L, 4L, 3L, 2L, 1L, 0L]);\n assert(candidate([2L, 1L]) == [1L, 2L]);\n assert(candidate([15L, 42L, 87L, 32L, 11L, 0L]) == [0L, 11L, 15L, 32L, 42L, 87L]);\n assert(candidate([21L, 14L, 23L, 11L]) == [23L, 21L, 14L, 11L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nImplement a function that takes an non-negative integer and returns an array of the first n\n integers that are prime numbers and less than n.\n for example:\n count_up_to(5) => [2,3]\n count_up_to(11) => [2,3,5,7]\n count_up_to(0) => []\n count_up_to(20) => [2,3,5,7,11,13,17,19]\n count_up_to(1) => []\n count_up_to(18) => [2,3,5,7,11,13,17]\n \n*/\nlong[] count_up_to(long n) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = count_up_to;\n\n assert(candidate(5L) == [2L, 3L]);\n assert(candidate(6L) == [2L, 3L, 5L]);\n assert(candidate(7L) == [2L, 3L, 5L]);\n assert(candidate(10L) == [2L, 3L, 5L, 7L]);\n assert(candidate(0L) == []);\n assert(candidate(22L) == [2L, 3L, 5L, 7L, 11L, 13L, 17L, 19L]);\n assert(candidate(1L) == []);\n assert(candidate(18L) == [2L, 3L, 5L, 7L, 11L, 13L, 17L]);\n assert(candidate(47L) == [2L, 3L, 5L, 7L, 11L, 13L, 17L, 19L, 23L, 29L, 31L, 37L, 41L, 43L]);\n assert(candidate(101L) == [2L, 3L, 5L, 7L, 11L, 13L, 17L, 19L, 23L, 29L, 31L, 37L, 41L, 43L, 47L, 53L, 59L, 61L, 67L, 71L, 73L, 79L, 83L, 89L, 97L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Out of list of strings, return the longest one. Return the first one in case of multiple\n strings of the same length. Return None in case the input list is empty.\n >>> longest([])\n\n >>> longest(['a', 'b', 'c'])\n 'a'\n >>> longest(['a', 'bb', 'ccc'])\n 'ccc'\n \n*/\nNullable!(string) longest(string[] strings) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = longest;\n\n{\n auto result = candidate([]);\n assert(result.isNull);\n}\n\n{\n auto result = candidate([\"x\", \"y\", \"z\"]);\n assert(!result.isNull && result.get == \"x\");\n}\n\n{\n auto result = candidate([\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"]);\n assert(!result.isNull && result.get == \"zzzz\");\n}\n\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n reverse the resulting array, and then replace each digit by its corresponding name from\n \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n\n For example:\n arr = [2, 1, 1, 4, 5, 8, 2, 3] \n -> sort arr -> [1, 1, 2, 2, 3, 4, 5, 8] \n -> reverse arr -> [8, 5, 4, 3, 2, 2, 1, 1]\n return [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n \n If the array is empty, return an empty array:\n arr = []\n return []\n \n If the array has any strange number ignore it:\n arr = [1, -1 , 55] \n -> sort arr -> [-1, 1, 55]\n -> reverse arr -> [55, 1, -1]\n return = ['One']\n \n*/\nstring[] by_length(long[] arr) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = by_length;\n\n assert(candidate([2L, 1L, 1L, 4L, 5L, 8L, 2L, 3L]) == [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]);\n assert(candidate([]) == []);\n assert(candidate([1L, -1L, 55L]) == [\"One\"]);\n assert(candidate([1L, -1L, 3L, 2L]) == [\"Three\", \"Two\", \"One\"]);\n assert(candidate([9L, 4L, 8L]) == [\"Nine\", \"Eight\", \"Four\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_106_f", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Implement the function f that takes n as a parameter,\n 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\n or the sum of numbers from 1 to i otherwise.\n i starts from 1.\n the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n Example:\n f(5) == [1, 2, 6, 24, 15]\n \n*/\nlong[] f(long n) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = f;\n\n assert(candidate(5L) == [1L, 2L, 6L, 24L, 15L]);\n assert(candidate(7L) == [1L, 2L, 6L, 24L, 15L, 720L, 28L]);\n assert(candidate(1L) == [1L]);\n assert(candidate(3L) == [1L, 2L, 6L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nReturn the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n >>> fizz_buzz(50)\n 0\n >>> fizz_buzz(78)\n 2\n >>> fizz_buzz(79)\n 3\n \n*/\nlong fizz_buzz(long n) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = fizz_buzz;\n\n assert(candidate(50L) == 0L);\n assert(candidate(78L) == 2L);\n assert(candidate(79L) == 3L);\n assert(candidate(100L) == 3L);\n assert(candidate(200L) == 6L);\n assert(candidate(4000L) == 192L);\n assert(candidate(10000L) == 639L);\n assert(candidate(100000L) == 8026L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Given a positive floating point number, it can be decomposed into\n and integer part (largest integer smaller than given number) and decimals\n (leftover part always smaller than 1).\n\n Return the decimal part of the number.\n >>> truncate_number(3.5)\n 0.5\n \n*/\nfloat truncate_number(float number) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = truncate_number;\n\n assert(candidate(3.5) == 0.5);\n assert(candidate(1.25) == 0.25);\n assert(candidate(123.0) == 0.0);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n Empty sum should be equal to 0 and empty product should be equal to 1.\n >>> sum_product([])\n (0, 1)\n >>> sum_product([1, 2, 3, 4])\n (10, 24)\n \n*/\nTuple!(long, long) sum_product(long[] numbers) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = sum_product;\n\n assert(candidate([]) == tuple(0L, 1L));\n assert(candidate([1L, 1L, 1L]) == tuple(3L, 1L));\n assert(candidate([100L, 0L]) == tuple(100L, 0L));\n assert(candidate([3L, 5L, 7L]) == tuple(15L, 105L));\n assert(candidate([10L]) == tuple(10L, 10L));\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n You are given a 2 dimensional data, as a nested lists,\n which is similar to matrix, however, unlike matrices,\n each row may contain a different number of columns.\n Given lst, and integer x, find integers x in the list,\n and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n each tuple is a coordinate - (row, columns), starting with 0.\n Sort coordinates initially by rows in ascending order.\n Also, sort coordinates of the row by columns in descending order.\n \n Examples:\n get_row([\n [1,2,3,4,5,6],\n [1,2,3,4,1,6],\n [1,2,3,4,5,1]\n ], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n get_row([], 1) == []\n get_row([[], [1], [1, 2, 3]], 3) == [(2, 2)]\n \n*/\nTuple!(long, long)[] get_row(long[][] lst, long x) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = get_row;\n\n assert(candidate([[1L, 2L, 3L, 4L, 5L, 6L], [1L, 2L, 3L, 4L, 1L, 6L], [1L, 2L, 3L, 4L, 5L, 1L]], 1L) == [tuple(0L, 0L), tuple(1L, 4L), tuple(1L, 0L), tuple(2L, 5L), tuple(2L, 0L)]);\n assert(candidate([[1L, 2L, 3L, 4L, 5L, 6L], [1L, 2L, 3L, 4L, 5L, 6L], [1L, 2L, 3L, 4L, 5L, 6L], [1L, 2L, 3L, 4L, 5L, 6L], [1L, 2L, 3L, 4L, 5L, 6L], [1L, 2L, 3L, 4L, 5L, 6L]], 2L) == [tuple(0L, 1L), tuple(1L, 1L), tuple(2L, 1L), tuple(3L, 1L), tuple(4L, 1L), tuple(5L, 1L)]);\n assert(candidate([[1L, 2L, 3L, 4L, 5L, 6L], [1L, 2L, 3L, 4L, 5L, 6L], [1L, 1L, 3L, 4L, 5L, 6L], [1L, 2L, 1L, 4L, 5L, 6L], [1L, 2L, 3L, 1L, 5L, 6L], [1L, 2L, 3L, 4L, 1L, 6L], [1L, 2L, 3L, 4L, 5L, 1L]], 1L) == [tuple(0L, 0L), tuple(1L, 0L), tuple(2L, 1L), tuple(2L, 0L), tuple(3L, 2L), tuple(3L, 0L), tuple(4L, 3L), tuple(4L, 0L), tuple(5L, 4L), tuple(5L, 0L), tuple(6L, 5L), tuple(6L, 0L)]);\n assert(candidate([], 1L) == []);\n assert(candidate([[1L]], 2L) == []);\n assert(candidate([[], [1L], [1L, 2L, 3L]], 3L) == [tuple(2L, 2L)]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n You're a hungry rabbit, and you already have eaten a certain number of carrots,\n but now you need to eat more carrots to complete the day's meals.\n you should return an array of [ total number of eaten carrots after your meals,\n the number of carrots left after your meals ]\n if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n \n Example:\n * eat(5, 6, 10) -> [11, 4]\n * eat(4, 8, 9) -> [12, 1]\n * eat(1, 10, 10) -> [11, 0]\n * eat(2, 11, 5) -> [7, 0]\n \n Variables:\n @number : integer\n the number of carrots that you have eaten.\n @need : integer\n the number of carrots that you need to eat.\n @remaining : integer\n the number of remaining carrots thet exist in stock\n \n Constrain:\n * 0 <= number <= 1000\n * 0 <= need <= 1000\n * 0 <= remaining <= 1000\n\n Have fun :)\n \n*/\nlong[] eat(long number, long need, long remaining) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = eat;\n\n assert(candidate(5L, 6L, 10L) == [11L, 4L]);\n assert(candidate(4L, 8L, 9L) == [12L, 1L]);\n assert(candidate(1L, 10L, 10L) == [11L, 0L]);\n assert(candidate(2L, 11L, 5L) == [7L, 0L]);\n assert(candidate(4L, 5L, 7L) == [9L, 2L]);\n assert(candidate(4L, 5L, 1L) == [5L, 0L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nGiven a positive integer N, return the total sum of its digits in binary.\n \n Example\n For N = 1000, the sum of digits will be 1 the output should be \"1\".\n For N = 150, the sum of digits will be 6 the output should be \"110\".\n For N = 147, the sum of digits will be 12 the output should be \"1100\".\n \n Variables:\n @N integer\n Constraints: 0 \u2264 N \u2264 10000.\n Output:\n a string of binary number\n \n*/\nstring solve(long N) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = solve;\n\n assert(candidate(1000L) == \"1\");\n assert(candidate(150L) == \"110\");\n assert(candidate(147L) == \"1100\");\n assert(candidate(333L) == \"1001\");\n assert(candidate(963L) == \"10010\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou are given a list of integers.\n You need to find the largest prime value and return the sum of its digits.\n\n Examples:\n For lst = [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] the output should be 10\n For lst = [1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1] the output should be 25\n For lst = [1,3,1,32,5107,34,83278,109,163,23,2323,32,30,1,9,3] the output should be 13\n For lst = [0,724,32,71,99,32,6,0,5,91,83,0,5,6] the output should be 11\n For lst = [0,81,12,3,1,21] the output should be 3\n For lst = [0,8,1,2,1,7] the output should be 7\n \n*/\nlong skjkasdkd(long[] lst) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = skjkasdkd;\n\n assert(candidate([0L, 3L, 2L, 1L, 3L, 5L, 7L, 4L, 5L, 5L, 5L, 2L, 181L, 32L, 4L, 32L, 3L, 2L, 32L, 324L, 4L, 3L]) == 10L);\n assert(candidate([1L, 0L, 1L, 8L, 2L, 4597L, 2L, 1L, 3L, 40L, 1L, 2L, 1L, 2L, 4L, 2L, 5L, 1L]) == 25L);\n assert(candidate([1L, 3L, 1L, 32L, 5107L, 34L, 83278L, 109L, 163L, 23L, 2323L, 32L, 30L, 1L, 9L, 3L]) == 13L);\n assert(candidate([0L, 724L, 32L, 71L, 99L, 32L, 6L, 0L, 5L, 91L, 83L, 0L, 5L, 6L]) == 11L);\n assert(candidate([0L, 81L, 12L, 3L, 1L, 21L]) == 3L);\n assert(candidate([0L, 8L, 1L, 2L, 1L, 7L]) == 7L);\n assert(candidate([8191L]) == 19L);\n assert(candidate([8191L, 123456L, 127L, 7L]) == 19L);\n assert(candidate([127L, 97L, 8192L]) == 10L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given an array arr of integers, find the minimum number of elements that\n need to be changed to make the array palindromic. A palindromic array is an array that\n is read the same backwards and forwards. In one change, you can change one element to any other element.\n\n For example:\n smallest_change([1,2,3,5,4,7,9,6]) == 4\n smallest_change([1, 2, 3, 4, 3, 2, 2]) == 1\n smallest_change([1, 2, 3, 2, 1]) == 0\n \n*/\nlong smallest_change(long[] arr) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = smallest_change;\n\n assert(candidate([1L, 2L, 3L, 5L, 4L, 7L, 9L, 6L]) == 4L);\n assert(candidate([1L, 2L, 3L, 4L, 3L, 2L, 2L]) == 1L);\n assert(candidate([1L, 4L, 2L]) == 1L);\n assert(candidate([1L, 4L, 4L, 2L]) == 1L);\n assert(candidate([1L, 2L, 3L, 2L, 1L]) == 0L);\n assert(candidate([3L, 1L, 1L, 3L]) == 0L);\n assert(candidate([1L]) == 0L);\n assert(candidate([0L, 1L]) == 1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nIt is the last week of the semester and the teacher has to give the grades\n to students. The teacher has been making her own algorithm for grading.\n The only problem is, she has lost the code she used for grading.\n She has given you a list of GPAs for some students and you have to write \n a function that can output a list of letter grades using the following table:\n GPA | Letter grade\n 4.0 A+\n > 3.7 A \n > 3.3 A- \n > 3.0 B+\n > 2.7 B \n > 2.3 B-\n > 2.0 C+\n > 1.7 C\n > 1.3 C-\n > 1.0 D+ \n > 0.7 D \n > 0.0 D-\n 0.0 E\n \n\n Example:\n grade_equation([4.0, 3, 1.7, 2, 3.5]) ==> ['A+', 'B', 'C-', 'C', 'A-']\n \n*/\nstring[] numerical_letter_grade(float[] grades) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = numerical_letter_grade;\n\n assert(candidate([4.0, 3L, 1.7, 2L, 3.5]) == [\"A+\", \"B\", \"C-\", \"C\", \"A-\"]);\n assert(candidate([1.2]) == [\"D+\"]);\n assert(candidate([0.5]) == [\"D-\"]);\n assert(candidate([0.0]) == [\"E\"]);\n assert(candidate([1.0, 0.3, 1.5, 2.8, 3.3]) == [\"D\", \"D-\", \"C-\", \"B\", \"B+\"]);\n assert(candidate([0.0, 0.7]) == [\"E\", \"D-\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given the lengths of the three sides of a triangle. Return the area of\n the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n Otherwise return -1\n Three sides make a valid triangle when the sum of any two sides is greater \n than the third side.\n Example:\n triangle_area(3, 4, 5) == 6.00\n triangle_area(1, 2, 10) == -1\n \n*/\nfloat triangle_area(long a, long b, long c) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = triangle_area;\n\n assert(candidate(3L, 4L, 5L) == 6.0);\n assert(candidate(1L, 2L, 10L) == -1L);\n assert(candidate(4L, 8L, 5L) == 8.18);\n assert(candidate(2L, 2L, 2L) == 1.73);\n assert(candidate(1L, 2L, 3L) == -1L);\n assert(candidate(10L, 5L, 7L) == 16.25);\n assert(candidate(2L, 6L, 3L) == -1L);\n assert(candidate(1L, 1L, 1L) == 0.43);\n assert(candidate(2L, 2L, 10L) == -1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Check if two words have the same characters.\n >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n True\n >>> same_chars('abcd', 'dddddddabc')\n True\n >>> same_chars('dddddddabc', 'abcd')\n True\n >>> same_chars('eabcd', 'dddddddabc')\n False\n >>> same_chars('abcd', 'dddddddabce')\n False\n >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc')\n False\n \n*/\nbool same_chars(string s0, string s1) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = same_chars;\n\n assert(candidate(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\") == true);\n assert(candidate(\"abcd\", \"dddddddabc\") == true);\n assert(candidate(\"dddddddabc\", \"abcd\") == true);\n assert(candidate(\"eabcd\", \"dddddddabc\") == false);\n assert(candidate(\"abcd\", \"dddddddabcf\") == false);\n assert(candidate(\"eabcdzzzz\", \"dddzzzzzzzddddabc\") == false);\n assert(candidate(\"aabb\", \"aaccc\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given an array of integers nums, find the minimum sum of any non-empty sub-array\n of nums.\n Example\n minSubArraySum([2, 3, 4, 1, 2, 4]) == 1\n minSubArraySum([-1, -2, -3]) == -6\n \n*/\nlong minSubArraySum(long[] nums) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = minSubArraySum;\n\n assert(candidate([2L, 3L, 4L, 1L, 2L, 4L]) == 1L);\n assert(candidate([-1L, -2L, -3L]) == -6L);\n assert(candidate([-1L, -2L, -3L, 2L, -10L]) == -14L);\n assert(candidate([-9999999999999999L]) == -9999999999999999L);\n assert(candidate([0L, 10L, 20L, 1000000L]) == 0L);\n assert(candidate([-1L, -2L, -3L, 10L, -5L]) == -6L);\n assert(candidate([100L, -1L, -2L, -3L, 10L, -5L]) == -6L);\n assert(candidate([10L, 11L, 13L, 8L, 3L, 4L]) == 3L);\n assert(candidate([100L, -33L, 32L, -1L, 0L, -2L]) == -33L);\n assert(candidate([-10L]) == -10L);\n assert(candidate([7L]) == 7L);\n assert(candidate([1L, -1L]) == -1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nGiven a string s and a natural number n, you have been tasked to implement \n a function that returns a list of all words from string s that contain exactly \n n consonants, in order these words appear in the string s.\n If the string s is empty then the function should return an empty list.\n Note: you may assume the input string contains only letters and spaces.\n Examples:\n select_words(\"Mary had a little lamb\", 4) ==> [\"little\"]\n select_words(\"Mary had a little lamb\", 3) ==> [\"Mary\", \"lamb\"]\n select_words(\"simple white space\", 2) ==> []\n select_words(\"Hello world\", 4) ==> [\"world\"]\n select_words(\"Uncle sam\", 3) ==> [\"Uncle\"]\n \n*/\nstring[] select_words(string s, long n) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = select_words;\n\n assert(candidate(\"Mary had a little lamb\", 4L) == [\"little\"]);\n assert(candidate(\"Mary had a little lamb\", 3L) == [\"Mary\", \"lamb\"]);\n assert(candidate(\"simple white space\", 2L) == []);\n assert(candidate(\"Hello world\", 4L) == [\"world\"]);\n assert(candidate(\"Uncle sam\", 3L) == [\"Uncle\"]);\n assert(candidate(\"\", 4L) == []);\n assert(candidate(\"a b c d e f\", 1L) == [\"b\", \"c\", \"d\", \"f\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Return list of all prefixes from shortest to longest of the input string\n >>> all_prefixes('abc')\n ['a', 'ab', 'abc']\n \n*/\nstring[] all_prefixes(string string) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = all_prefixes;\n\n assert(candidate(\"\") == []);\n assert(candidate(\"asdfgh\") == [\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"]);\n assert(candidate(\"WWW\") == [\"W\", \"WW\", \"WWW\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Create a function that takes a value (string) representing a number\n and returns the closest integer to it. If the number is equidistant\n from two integers, round it away from zero.\n\n Examples\n >>> closest_integer(\"10\")\n 10\n >>> closest_integer(\"15.3\")\n 15\n\n Note:\n Rounding away from zero means that if the given number is equidistant\n from two integers, the one you should return is the one that is the\n farthest from zero. For example closest_integer(\"14.5\") should\n return 15 and closest_integer(\"-14.5\") should return -15.\n \n*/\nlong closest_integer(string value) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = closest_integer;\n\n assert(candidate(\"10\") == 10L);\n assert(candidate(\"14.5\") == 15L);\n assert(candidate(\"-15.5\") == -16L);\n assert(candidate(\"15.3\") == 15L);\n assert(candidate(\"0\") == 0L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nCreate a function which takes a string representing a file's name, and returns\n 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n A file's name is considered to be valid if and only if all the following conditions \n are met:\n - There should not be more than three digits ('0'-'9') in the file's name.\n - The file's name contains exactly one dot '.'\n - The substring before the dot should not be empty, and it starts with a letter from \n the latin alphapet ('a'-'z' and 'A'-'Z').\n - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n Examples:\n file_name_check(\"example.txt\") # => 'Yes'\n file_name_check(\"1example.dll\") # => 'No' (the name should start with a latin alphapet letter)\n \n*/\nstring file_name_check(string file_name) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = file_name_check;\n\n assert(candidate(\"example.txt\") == \"Yes\");\n assert(candidate(\"1example.dll\") == \"No\");\n assert(candidate(\"s1sdf3.asd\") == \"No\");\n assert(candidate(\"K.dll\") == \"Yes\");\n assert(candidate(\"MY16FILE3.exe\") == \"Yes\");\n assert(candidate(\"His12FILE94.exe\") == \"No\");\n assert(candidate(\"_Y.txt\") == \"No\");\n assert(candidate(\"?aREYA.exe\") == \"No\");\n assert(candidate(\"/this_is_valid.dll\") == \"No\");\n assert(candidate(\"this_is_valid.wow\") == \"No\");\n assert(candidate(\"this_is_valid.txt\") == \"Yes\");\n assert(candidate(\"this_is_valid.txtexe\") == \"No\");\n assert(candidate(\"#this2_i4s_5valid.ten\") == \"No\");\n assert(candidate(\"@this1_is6_valid.exe\") == \"No\");\n assert(candidate(\"this_is_12valid.6exe4.txt\") == \"No\");\n assert(candidate(\"all.exe.txt\") == \"No\");\n assert(candidate(\"I563_No.exe\") == \"Yes\");\n assert(candidate(\"Is3youfault.txt\") == \"Yes\");\n assert(candidate(\"no_one#knows.dll\") == \"Yes\");\n assert(candidate(\"1I563_Yes3.exe\") == \"No\");\n assert(candidate(\"I563_Yes3.txtt\") == \"No\");\n assert(candidate(\"final..txt\") == \"No\");\n assert(candidate(\"final132\") == \"No\");\n assert(candidate(\"_f4indsartal132.\") == \"No\");\n assert(candidate(\".txt\") == \"No\");\n assert(candidate(\"s.\") == \"No\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou are given two intervals,\n where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n The given intervals are closed which means that the interval (start, end)\n includes both start and end.\n For each given interval, it is assumed that its start is less or equal its end.\n Your task is to determine whether the length of intersection of these two \n intervals is a prime number.\n Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n which its length is 1, which not a prime number.\n If the length of the intersection is a prime number, return \"YES\",\n otherwise, return \"NO\".\n If the two intervals don't intersect, return \"NO\".\n\n\n [input/output] samples:\n intersection((1, 2), (2, 3)) ==> \"NO\"\n intersection((-1, 1), (0, 4)) ==> \"NO\"\n intersection((-3, -1), (-5, 5)) ==> \"YES\"\n \n*/\nstring intersection(Tuple!(long, long) interval1, Tuple!(long, long) interval2) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = intersection;\n\n assert(candidate(tuple(1L, 2L), tuple(2L, 3L)) == \"NO\");\n assert(candidate(tuple(-1L, 1L), tuple(0L, 4L)) == \"NO\");\n assert(candidate(tuple(-3L, -1L), tuple(-5L, 5L)) == \"YES\");\n assert(candidate(tuple(-2L, 2L), tuple(-4L, 0L)) == \"YES\");\n assert(candidate(tuple(-11L, 2L), tuple(-1L, -1L)) == \"NO\");\n assert(candidate(tuple(1L, 2L), tuple(3L, 5L)) == \"NO\");\n assert(candidate(tuple(1L, 2L), tuple(1L, 2L)) == \"NO\");\n assert(candidate(tuple(-2L, -2L), tuple(-3L, -2L)) == \"NO\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nReturn the largest prime factor of n. Assume n > 1 and is not a prime.\n >>> largest_prime_factor(13195)\n 29\n >>> largest_prime_factor(2048)\n 2\n \n*/\nlong largest_prime_factor(long n) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = largest_prime_factor;\n\n assert(candidate(15L) == 5L);\n assert(candidate(27L) == 3L);\n assert(candidate(63L) == 7L);\n assert(candidate(330L) == 11L);\n assert(candidate(13195L) == 29L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Given a string, find out how many distinct characters (regardless of case) does it consist of\n >>> count_distinct_characters('xyzXYZ')\n 3\n >>> count_distinct_characters('Jerry')\n 4\n \n*/\nlong count_distinct_characters(string string) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = count_distinct_characters;\n\n assert(candidate(\"\") == 0L);\n assert(candidate(\"abcde\") == 5L);\n assert(candidate(\"abcdecadeCADE\") == 5L);\n assert(candidate(\"aaaaAAAAaaaa\") == 1L);\n assert(candidate(\"Jerry jERRY JeRRRY\") == 5L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n You're given a list of deposit and withdrawal operations on a bank account that starts with\n zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n at that point function should return True. Otherwise it should return False.\n >>> below_zero([1, 2, 3])\n False\n >>> below_zero([1, 2, -4, 5])\n True\n \n*/\nbool below_zero(long[] operations) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = below_zero;\n\n assert(candidate([]) == false);\n assert(candidate([1L, 2L, -3L, 1L, 2L, -3L]) == false);\n assert(candidate([1L, 2L, -4L, 5L, 6L]) == true);\n assert(candidate([1L, -1L, 2L, -2L, 5L, -5L, 4L, -4L]) == false);\n assert(candidate([1L, -1L, 2L, -2L, 5L, -5L, 4L, -5L]) == true);\n assert(candidate([1L, -2L, 2L, -2L, 5L, -5L, 4L, -4L]) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Find the shortest palindrome that begins with a supplied string.\n Algorithm idea is simple:\n - Find the longest postfix of supplied string that is a palindrome.\n - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n >>> make_palindrome('')\n ''\n >>> make_palindrome('cat')\n 'catac'\n >>> make_palindrome('cata')\n 'catac'\n \n*/\nstring make_palindrome(string string) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = make_palindrome;\n\n assert(candidate(\"\") == \"\");\n assert(candidate(\"x\") == \"x\");\n assert(candidate(\"xyz\") == \"xyzyx\");\n assert(candidate(\"xyx\") == \"xyx\");\n assert(candidate(\"jerry\") == \"jerryrrej\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given a positive integer, obtain its roman numeral equivalent as a string,\n and return it in lowercase.\n Restrictions: 1 <= num <= 1000\n\n Examples:\n >>> int_to_mini_roman(19) == 'xix'\n >>> int_to_mini_roman(152) == 'clii'\n >>> int_to_mini_roman(426) == 'cdxxvi'\n \n*/\nstring int_to_mini_roman(long number) \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = int_to_mini_roman;\n\n assert(candidate(19L) == \"xix\");\n assert(candidate(152L) == \"clii\");\n assert(candidate(251L) == \"ccli\");\n assert(candidate(426L) == \"cdxxvi\");\n assert(candidate(500L) == \"d\");\n assert(candidate(1L) == \"i\");\n assert(candidate(4L) == \"iv\");\n assert(candidate(43L) == \"xliii\");\n assert(candidate(90L) == \"xc\");\n assert(candidate(94L) == \"xciv\");\n assert(candidate(532L) == \"dxxxii\");\n assert(candidate(900L) == \"cm\");\n assert(candidate(994L) == \"cmxciv\");\n assert(candidate(1000L) == \"m\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - } -] \ No newline at end of file diff --git a/data/d-remove.json b/data/d-remove.json deleted file mode 100644 index c8e9f979c58abea8ed11293a38c3b6f870b76f23..0000000000000000000000000000000000000000 --- a/data/d-remove.json +++ /dev/null @@ -1,2297 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "d", - "prompt": "import std.math;\n/*\n For a given number n, find the largest number that divides n evenly, smaller than n\n \n*/\nlong largest_divisor(long n) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = largest_divisor;\n\n assert(candidate(3L) == 1L);\n assert(candidate(7L) == 1L);\n assert(candidate(10L) == 5L);\n assert(candidate(100L) == 50L);\n assert(candidate(49L) == 7L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_47_median", - "language": "d", - "prompt": "import std.math;\n/*\nReturn median of elements in the list l.\n \n*/\nfloat median(long[] l) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = median;\n\n assert(candidate([3L, 1L, 2L, 4L, 5L]) == 3L);\n assert(candidate([-10L, 4L, 6L, 1000L, 10L, 20L]) == 8.0);\n assert(candidate([5L]) == 5L);\n assert(candidate([6L, 5L]) == 5.5);\n assert(candidate([8L, 1L, 3L, 9L, 9L, 2L, 7L]) == 7L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "d", - "prompt": "import std.math;\n/*\nReturn maximum element in the list.\n \n*/\nlong max_element(long[] l) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = max_element;\n\n assert(candidate([1L, 2L, 3L]) == 3L);\n assert(candidate([5L, 3L, -5L, 2L, -3L, 3L, 9L, 0L, 124L, 1L, -10L]) == 124L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "d", - "prompt": "import std.math;\n/*\nCreate a function which returns the largest index of an element which\n is not greater than or equal to the element immediately preceding it. If\n no such element exists then return -1. The given array will not contain\n duplicate values.\n\n Examples:\n \n*/\nlong can_arrange(long[] arr) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = can_arrange;\n\n assert(candidate([1L, 2L, 4L, 3L, 5L]) == 3L);\n assert(candidate([1L, 2L, 4L, 5L]) == -1L);\n assert(candidate([1L, 4L, 2L, 5L, 6L, 7L, 8L, 9L, 10L]) == 2L);\n assert(candidate([4L, 8L, 5L, 7L, 3L]) == 4L);\n assert(candidate([]) == -1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "d", - "prompt": "import std.math;\n/*\n\n Create a function that returns True if the last character\n of a given string is an alphabetical character and is not\n a part of a word, and False otherwise.\n Note: \"word\" is a group of characters separated by space.\n\n Examples:\n \n*/\nbool check_if_last_char_is_a_letter(string txt) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = check_if_last_char_is_a_letter;\n\n assert(candidate(\"apple\") == false);\n assert(candidate(\"apple pi e\") == true);\n assert(candidate(\"eeeee\") == false);\n assert(candidate(\"A\") == true);\n assert(candidate(\"Pumpkin pie \") == false);\n assert(candidate(\"Pumpkin pie 1\") == false);\n assert(candidate(\"\") == false);\n assert(candidate(\"eeeee e \") == false);\n assert(candidate(\"apple pie\") == false);\n assert(candidate(\"apple pi e \") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "d", - "prompt": "import std.math;\n/*\nReturn true if a given number is prime, and false otherwise.\n \n*/\nbool is_prime(long n) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = is_prime;\n\n assert(candidate(6L) == false);\n assert(candidate(101L) == true);\n assert(candidate(11L) == true);\n assert(candidate(13441L) == true);\n assert(candidate(61L) == true);\n assert(candidate(4L) == false);\n assert(candidate(1L) == false);\n assert(candidate(5L) == true);\n assert(candidate(11L) == true);\n assert(candidate(17L) == true);\n assert(candidate(85L) == false);\n assert(candidate(77L) == false);\n assert(candidate(255379L) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "d", - "prompt": "import std.math;\n/*\nGiven a list of positive integers x. return a sorted list of all \n elements that hasn't any even digit.\n\n Note: Returned list should be sorted in increasing order.\n \n For example:\n \n*/\nlong[] unique_digits(long[] x) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = unique_digits;\n\n assert(candidate([15L, 33L, 1422L, 1L]) == [1L, 15L, 33L]);\n assert(candidate([152L, 323L, 1422L, 10L]) == []);\n assert(candidate([12345L, 2033L, 111L, 151L]) == [111L, 151L]);\n assert(candidate([135L, 103L, 31L]) == [31L, 135L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "d", - "prompt": "import std.math;\n/*\n Input are two strings a and b consisting only of 1s and 0s.\n Perform binary XOR on these inputs and return result also as a string.\n \n*/\nstring string_xor(string a, string b) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = string_xor;\n\n assert(candidate(\"111000\", \"101010\") == \"010010\");\n assert(candidate(\"1\", \"1\") == \"0\");\n assert(candidate(\"0101\", \"0000\") == \"0101\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "d", - "prompt": "import std.math;\n/*\nsum_to_n is a function that sums numbers from 1 to n.\n \n*/\nlong sum_to_n(long n) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = sum_to_n;\n\n assert(candidate(1L) == 1L);\n assert(candidate(6L) == 21L);\n assert(candidate(11L) == 66L);\n assert(candidate(30L) == 465L);\n assert(candidate(100L) == 5050L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "d", - "prompt": "import std.math;\n/*\n\n Given a list of numbers, return the sum of squares of the numbers\n in the list that are odd. Ignore numbers that are negative or not integers.\n \n \n If the input list is empty, return 0.\n \n*/\nlong double_the_difference(float[] lst) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = double_the_difference;\n\n assert(candidate([]) == 0L);\n assert(candidate([5.0, 4.0]) == 25L);\n assert(candidate([0.1, 0.2, 0.3]) == 0L);\n assert(candidate([-10.0, -20.0, -30.0]) == 0L);\n assert(candidate([-1.0, -2.0, 8.0]) == 0L);\n assert(candidate([0.2, 3.0, 5.0]) == 34L);\n assert(candidate([-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]) == 165L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "d", - "prompt": "import std.math;\n/*\n Return length of given string\n \n*/\nlong strlen(string string) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = strlen;\n\n assert(candidate(\"\") == 0L);\n assert(candidate(\"x\") == 1L);\n assert(candidate(\"asdasnakj\") == 9L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "d", - "prompt": "import std.math;\n/*\n\n You'll be given a string of words, and your task is to count the number\n of boredoms. A boredom is a sentence that starts with the word \"I\".\n Sentences are delimited by '.', '?' or '!'.\n \n For example:\n \n*/\nlong is_bored(string S) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = is_bored;\n\n assert(candidate(\"Hello world\") == 0L);\n assert(candidate(\"Is the sky blue?\") == 0L);\n assert(candidate(\"I love It !\") == 1L);\n assert(candidate(\"bIt\") == 0L);\n assert(candidate(\"I feel good today. I will be productive. will kill It\") == 2L);\n assert(candidate(\"You and I are going for a walk\") == 0L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "d", - "prompt": "import std.math;\n/*\nWrite a function vowels_count which takes a string representing\n a word as input and returns the number of vowels in the string.\n Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n vowel, but only when it is at the end of the given word.\n\n Example:\n \n*/\nlong vowels_count(string s) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = vowels_count;\n\n assert(candidate(\"abcde\") == 2L);\n assert(candidate(\"Alone\") == 3L);\n assert(candidate(\"key\") == 2L);\n assert(candidate(\"bye\") == 1L);\n assert(candidate(\"keY\") == 2L);\n assert(candidate(\"bYe\") == 1L);\n assert(candidate(\"ACEDY\") == 3L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "d", - "prompt": "import std.math;\n/*\nReturn n-th Fibonacci number.\n \n*/\nlong fib(long n) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = fib;\n\n assert(candidate(10L) == 55L);\n assert(candidate(1L) == 1L);\n assert(candidate(8L) == 21L);\n assert(candidate(11L) == 89L);\n assert(candidate(12L) == 144L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "d", - "prompt": "import std.math;\n/*\nYour task is to implement a function that will simplify the expression\n x * n. The function returns True if x * n evaluates to a whole number and False\n otherwise. Both x and n, are string representation of a fraction, and have the following format,\n / where both numerator and denominator are positive whole numbers.\n\n You can assume that x, and n are valid fractions, and do not have zero as denominator.\n\n \n*/\nbool simplify(string x, string n) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = simplify;\n\n assert(candidate(\"1/5\", \"5/1\") == true);\n assert(candidate(\"1/6\", \"2/1\") == false);\n assert(candidate(\"5/1\", \"3/1\") == true);\n assert(candidate(\"7/10\", \"10/2\") == false);\n assert(candidate(\"2/10\", \"50/10\") == true);\n assert(candidate(\"7/2\", \"4/2\") == true);\n assert(candidate(\"11/6\", \"6/1\") == true);\n assert(candidate(\"2/3\", \"5/2\") == false);\n assert(candidate(\"5/2\", \"3/5\") == false);\n assert(candidate(\"2/4\", \"8/4\") == true);\n assert(candidate(\"2/4\", \"4/2\") == true);\n assert(candidate(\"1/5\", \"5/1\") == true);\n assert(candidate(\"1/5\", \"1/5\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "d", - "prompt": "import std.math;\n/*\n\n Given a string s, count the number of uppercase vowels in even indices.\n \n For example:\n \n*/\nlong count_upper(string s) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = count_upper;\n\n assert(candidate(\"aBCdEf\") == 1L);\n assert(candidate(\"abcdefg\") == 0L);\n assert(candidate(\"dBBE\") == 0L);\n assert(candidate(\"B\") == 0L);\n assert(candidate(\"U\") == 1L);\n assert(candidate(\"\") == 0L);\n assert(candidate(\"EEEE\") == 2L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "d", - "prompt": "import std.math;\n/*\n\n You are given a rectangular grid of wells. Each row represents a single well,\n and each 1 in a row represents a single unit of water.\n Each well has a corresponding bucket that can be used to extract water from it, \n and all buckets have the same capacity.\n Your task is to use the buckets to empty the wells.\n Output the number of times you need to lower the buckets.\n\n Example 1:\n \n Example 2:\n \n Example 3:\n \n Constraints:\n * all wells have the same length\n * 1 <= grid.length <= 10^2\n * 1 <= grid[:,1].length <= 10^2\n * grid[i][j] -> 0 | 1\n * 1 <= capacity <= 10\n \n*/\nlong max_fill(long[][] grid, long capacity) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = max_fill;\n\n assert(candidate([[0L, 0L, 1L, 0L], [0L, 1L, 0L, 0L], [1L, 1L, 1L, 1L]], 1L) == 6L);\n assert(candidate([[0L, 0L, 1L, 1L], [0L, 0L, 0L, 0L], [1L, 1L, 1L, 1L], [0L, 1L, 1L, 1L]], 2L) == 5L);\n assert(candidate([[0L, 0L, 0L], [0L, 0L, 0L]], 5L) == 0L);\n assert(candidate([[1L, 1L, 1L, 1L], [1L, 1L, 1L, 1L]], 2L) == 4L);\n assert(candidate([[1L, 1L, 1L, 1L], [1L, 1L, 1L, 1L]], 9L) == 2L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "d", - "prompt": "import std.math;\n/*\n\n Given an array arr of integers and a positive integer k, return a sorted list \n of length k with the maximum k numbers in arr.\n\n Example 1:\n\n \n Example 2:\n\n \n Example 3:\n\n \n Note:\n 1. The length of the array will be in the range of [1, 1000].\n 2. The elements in the array will be in the range of [-1000, 1000].\n 3. 0 <= k <= len(arr)\n \n*/\nlong[] maximum(long[] arr, long k) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = maximum;\n\n assert(candidate([-3L, -4L, 5L], 3L) == [-4L, -3L, 5L]);\n assert(candidate([4L, -4L, 4L], 2L) == [4L, 4L]);\n assert(candidate([-3L, 2L, 1L, 2L, -1L, -2L, 1L], 1L) == [2L]);\n assert(candidate([123L, -123L, 20L, 0L, 1L, 2L, -3L], 3L) == [2L, 20L, 123L]);\n assert(candidate([-123L, 20L, 0L, 1L, 2L, -3L], 4L) == [0L, 1L, 2L, 20L]);\n assert(candidate([5L, 15L, 0L, 3L, -13L, -8L, 0L], 7L) == [-13L, -8L, 0L, 0L, 3L, 5L, 15L]);\n assert(candidate([-1L, 0L, 2L, 5L, 3L, -10L], 2L) == [3L, 5L]);\n assert(candidate([1L, 0L, 5L, -7L], 1L) == [5L]);\n assert(candidate([4L, -4L], 2L) == [-4L, 4L]);\n assert(candidate([-10L, 10L], 2L) == [-10L, 10L]);\n assert(candidate([1L, 2L, 3L, -23L, 243L, -400L, 0L], 0L) == []);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "d", - "prompt": "import std.math;\n/*\n\n Write a function that takes a message, and encodes in such a \n way that it swaps case of all letters, replaces all vowels in \n the message with the letter that appears 2 places ahead of that \n vowel in the english alphabet. \n Assume only letters. \n \n Examples:\n \n*/\nstring encode(string message) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = encode;\n\n assert(candidate(\"TEST\") == \"tgst\");\n assert(candidate(\"Mudasir\") == \"mWDCSKR\");\n assert(candidate(\"YES\") == \"ygs\");\n assert(candidate(\"This is a message\") == \"tHKS KS C MGSSCGG\");\n assert(candidate(\"I DoNt KnOw WhAt tO WrItE\") == \"k dQnT kNqW wHcT Tq wRkTg\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "d", - "prompt": "import std.math;\n/*\n\n remove_vowels is a function that takes string and returns string without vowels.\n \n*/\nstring remove_vowels(string text) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = remove_vowels;\n\n assert(candidate(\"\") == \"\");\n assert(candidate(\"abcdef\nghijklm\") == \"bcdf\nghjklm\");\n assert(candidate(\"fedcba\") == \"fdcb\");\n assert(candidate(\"eeeee\") == \"\");\n assert(candidate(\"acBAA\") == \"cB\");\n assert(candidate(\"EcBOO\") == \"cB\");\n assert(candidate(\"ybcd\") == \"ybcd\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "d", - "prompt": "import std.math;\n/*\nReturn only positive numbers in the list.\n \n*/\nlong[] get_positive(long[] l) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = get_positive;\n\n assert(candidate([-1L, -2L, 4L, 5L, 6L]) == [4L, 5L, 6L]);\n assert(candidate([5L, 3L, -5L, 2L, 3L, 3L, 9L, 0L, 123L, 1L, -10L]) == [5L, 3L, 2L, 3L, 3L, 9L, 123L, 1L]);\n assert(candidate([-1L, -2L]) == []);\n assert(candidate([]) == []);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "d", - "prompt": "import std.math;\n/*\n Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n \n*/\nstring string_sequence(long n) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = string_sequence;\n\n assert(candidate(0L) == \"0\");\n assert(candidate(3L) == \"0 1 2 3\");\n assert(candidate(10L) == \"0 1 2 3 4 5 6 7 8 9 10\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "d", - "prompt": "import std.math;\n/*\n\n Given a positive integer n, you have to make a pile of n levels of stones.\n The first level has n stones.\n The number of stones in the next level is:\n - the next odd number if n is odd.\n - the next even number if n is even.\n Return the number of stones in each level in a list, where element at index\n i represents the number of stones in the level (i+1).\n\n Examples:\n \n*/\nlong[] make_a_pile(long n) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = make_a_pile;\n\n assert(candidate(3L) == [3L, 5L, 7L]);\n assert(candidate(4L) == [4L, 6L, 8L, 10L]);\n assert(candidate(5L) == [5L, 7L, 9L, 11L, 13L]);\n assert(candidate(6L) == [6L, 8L, 10L, 12L, 14L, 16L]);\n assert(candidate(8L) == [8L, 10L, 12L, 14L, 16L, 18L, 20L, 22L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nTask\n 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\n then check if the result string is palindrome.\n A string is called palindrome if it reads the same backward as forward.\n You should return a tuple containing the result string and True/False for the check.\n Example\n \n*/\nTuple!(string, bool) reverse_delete(string s, string c) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = reverse_delete;\n\n assert(candidate(\"abcde\", \"ae\") == tuple(\"bcd\", false));\n assert(candidate(\"abcdef\", \"b\") == tuple(\"acdef\", false));\n assert(candidate(\"abcdedcba\", \"ab\") == tuple(\"cdedc\", true));\n assert(candidate(\"dwik\", \"w\") == tuple(\"dik\", false));\n assert(candidate(\"a\", \"a\") == tuple(\"\", true));\n assert(candidate(\"abcdedcba\", \"\") == tuple(\"abcdedcba\", true));\n assert(candidate(\"abcdedcba\", \"v\") == tuple(\"abcdedcba\", true));\n assert(candidate(\"vabba\", \"v\") == tuple(\"abba\", true));\n assert(candidate(\"mamma\", \"mia\") == tuple(\"\", true));\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n \n*/\nstring flip_case(string string) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = flip_case;\n\n assert(candidate(\"\") == \"\");\n assert(candidate(\"Hello!\") == \"hELLO!\");\n assert(candidate(\"These violent delights have violent ends\") == \"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou are given a string s.\n if s[i] is a letter, reverse its case from lower to upper or vise versa, \n otherwise keep it as it is.\n If the string contains no letters, reverse the string.\n The function should return the resulted string.\n Examples\n \n*/\nstring solve(string s) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = solve;\n\n assert(candidate(\"AsDf\") == \"aSdF\");\n assert(candidate(\"1234\") == \"4321\");\n assert(candidate(\"ab\") == \"AB\");\n assert(candidate(\"#a@C\") == \"#A@c\");\n assert(candidate(\"#AsdfW^45\") == \"#aSDFw^45\");\n assert(candidate(\"#6@2\") == \"2@6#\");\n assert(candidate(\"#$a^D\") == \"#$A^d\");\n assert(candidate(\"#ccc\") == \"#CCC\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Filter an input list of strings only for ones that start with a given prefix.\n \n*/\nstring[] filter_by_prefix(string[] strings, string prefix) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = filter_by_prefix;\n\n assert(candidate([], \"john\") == []);\n assert(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\") == [\"xxx\", \"xxxAAA\", \"xxx\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nThis function takes two positive numbers x and y and returns the\n biggest even integer number that is in the range [x, y] inclusive. If \n there's no such number, then the function should return -1.\n\n For example:\n \n*/\nlong choose_num(long x, long y) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = choose_num;\n\n assert(candidate(12L, 15L) == 14L);\n assert(candidate(13L, 12L) == -1L);\n assert(candidate(33L, 12354L) == 12354L);\n assert(candidate(5234L, 5233L) == -1L);\n assert(candidate(6L, 29L) == 28L);\n assert(candidate(27L, 10L) == -1L);\n assert(candidate(7L, 7L) == -1L);\n assert(candidate(546L, 546L) == 546L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n You are given a string representing a sentence,\n the sentence contains some words separated by a space,\n and you have to return a string that contains the words from the original sentence,\n whose lengths are prime numbers,\n the order of the words in the new string should be the same as the original one.\n\n Example 1:\n \n Example 2:\n \n Constraints:\n * 1 <= len(sentence) <= 100\n * sentence contains only letters\n \n*/\nstring words_in_sentence(string sentence) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = words_in_sentence;\n\n assert(candidate(\"This is a test\") == \"is\");\n assert(candidate(\"lets go for swimming\") == \"go for\");\n assert(candidate(\"there is no place available here\") == \"there is no place\");\n assert(candidate(\"Hi I am Hussein\") == \"Hi am Hussein\");\n assert(candidate(\"go for it\") == \"go for it\");\n assert(candidate(\"here\") == \"\");\n assert(candidate(\"here is\") == \"is\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n \n*/\nlong[] intersperse(long[] numbers, long delimeter) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = intersperse;\n\n assert(candidate([], 7L) == []);\n assert(candidate([5L, 6L, 3L, 2L], 8L) == [5L, 8L, 6L, 8L, 3L, 8L, 2L]);\n assert(candidate([2L, 2L, 2L], 2L) == [2L, 2L, 2L, 2L, 2L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYour task is to write a function that returns true if a number x is a simple\n power of n and false in other cases.\n x is a simple power of n if n**int=x\n For example:\n \n*/\nbool is_simple_power(long x, long n) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = is_simple_power;\n\n assert(candidate(16L, 2L) == true);\n assert(candidate(143214L, 16L) == false);\n assert(candidate(4L, 2L) == true);\n assert(candidate(9L, 3L) == true);\n assert(candidate(16L, 4L) == true);\n assert(candidate(24L, 2L) == false);\n assert(candidate(128L, 4L) == false);\n assert(candidate(12L, 6L) == false);\n assert(candidate(1L, 1L) == true);\n assert(candidate(1L, 12L) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nWrite a function that returns true if the given number is the multiplication of 3 prime numbers\n and false otherwise.\n Knowing that (a) is less then 100. \n Example:\n 30 = 2 * 3 * 5\n \n*/\nbool is_multiply_prime(long a) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = is_multiply_prime;\n\n assert(candidate(5L) == false);\n assert(candidate(30L) == true);\n assert(candidate(8L) == true);\n assert(candidate(10L) == false);\n assert(candidate(125L) == true);\n assert(candidate(105L) == true);\n assert(candidate(126L) == false);\n assert(candidate(729L) == false);\n assert(candidate(891L) == false);\n assert(candidate(1001L) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given the lengths of the three sides of a triangle. Return True if the three\n sides form a right-angled triangle, False otherwise.\n A right-angled triangle is a triangle in which one angle is right angle or \n 90 degree.\n Example:\n \n*/\nbool right_angle_triangle(long a, long b, long c) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = right_angle_triangle;\n\n assert(candidate(3L, 4L, 5L) == true);\n assert(candidate(1L, 2L, 3L) == false);\n assert(candidate(10L, 6L, 8L) == true);\n assert(candidate(2L, 2L, 2L) == false);\n assert(candidate(7L, 24L, 25L) == true);\n assert(candidate(10L, 5L, 7L) == false);\n assert(candidate(5L, 12L, 13L) == true);\n assert(candidate(15L, 8L, 17L) == true);\n assert(candidate(48L, 55L, 73L) == true);\n assert(candidate(1L, 1L, 1L) == false);\n assert(candidate(2L, 2L, 10L) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Create a function that takes 3 numbers.\n Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n Returns false in any other cases.\n \n Examples\n \n \n \n \n\n \n \n*/\nbool any_int(float x, float y, float z) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = any_int;\n\n assert(candidate(2L, 3L, 1L) == true);\n assert(candidate(2.5, 2L, 3L) == false);\n assert(candidate(1.5, 5L, 3.5) == false);\n assert(candidate(2L, 6L, 2L) == false);\n assert(candidate(4L, 2L, 2L) == true);\n assert(candidate(2.2, 2.2, 2.2) == false);\n assert(candidate(-4L, 6L, 2L) == true);\n assert(candidate(2L, 1L, 1L) == true);\n assert(candidate(3L, 4L, 7L) == true);\n assert(candidate(3.0, 4L, 7L) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nThis function takes a list l and returns a list l' such that\n l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n to the values of the corresponding indicies of l, but sorted.\n \n*/\nlong[] sort_third(long[] l) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = sort_third;\n\n assert(candidate([5L, 6L, 3L, 4L, 8L, 9L, 2L]) == [2L, 6L, 3L, 4L, 8L, 9L, 5L]);\n assert(candidate([5L, 8L, 3L, 4L, 6L, 9L, 2L]) == [2L, 8L, 3L, 4L, 6L, 9L, 5L]);\n assert(candidate([5L, 6L, 9L, 4L, 8L, 3L, 2L]) == [2L, 6L, 9L, 4L, 8L, 3L, 5L]);\n assert(candidate([5L, 6L, 3L, 4L, 8L, 9L, 2L, 1L]) == [2L, 6L, 3L, 4L, 8L, 9L, 5L, 1L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_53_add", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nAdd two numbers x and y\n \n*/\nlong add(long x, long y) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = add;\n\n assert(candidate(0L, 1L) == 1L);\n assert(candidate(1L, 0L) == 1L);\n assert(candidate(2L, 3L) == 5L);\n assert(candidate(5L, 7L) == 12L);\n assert(candidate(7L, 5L) == 12L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_69_search", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n zero, and has a frequency greater than or equal to the value of the integer itself. \n The frequency of an integer is the number of times it appears in the list.\n If no such a value exist, return -1.\n Examples:\n \n*/\nlong search(long[] lst) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = search;\n\n assert(candidate([5L, 5L, 5L, 5L, 1L]) == 1L);\n assert(candidate([4L, 1L, 4L, 1L, 4L, 4L]) == 4L);\n assert(candidate([3L, 3L]) == -1L);\n assert(candidate([8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L]) == 8L);\n assert(candidate([2L, 3L, 3L, 2L, 2L]) == 2L);\n assert(candidate([2L, 7L, 8L, 8L, 4L, 8L, 7L, 3L, 9L, 6L, 5L, 10L, 4L, 3L, 6L, 7L, 1L, 7L, 4L, 10L, 8L, 1L]) == 1L);\n assert(candidate([3L, 2L, 8L, 2L]) == 2L);\n assert(candidate([6L, 7L, 1L, 8L, 8L, 10L, 5L, 8L, 5L, 3L, 10L]) == 1L);\n assert(candidate([8L, 8L, 3L, 6L, 5L, 6L, 4L]) == -1L);\n assert(candidate([6L, 9L, 6L, 7L, 1L, 4L, 7L, 1L, 8L, 8L, 9L, 8L, 10L, 10L, 8L, 4L, 10L, 4L, 10L, 1L, 2L, 9L, 5L, 7L, 9L]) == 1L);\n assert(candidate([1L, 9L, 10L, 1L, 3L]) == 1L);\n assert(candidate([6L, 9L, 7L, 5L, 8L, 7L, 5L, 3L, 7L, 5L, 10L, 10L, 3L, 6L, 10L, 2L, 8L, 6L, 5L, 4L, 9L, 5L, 3L, 10L]) == 5L);\n assert(candidate([1L]) == 1L);\n assert(candidate([8L, 8L, 10L, 6L, 4L, 3L, 5L, 8L, 2L, 4L, 2L, 8L, 4L, 6L, 10L, 4L, 2L, 1L, 10L, 2L, 1L, 1L, 5L]) == 4L);\n assert(candidate([2L, 10L, 4L, 8L, 2L, 10L, 5L, 1L, 2L, 9L, 5L, 5L, 6L, 3L, 8L, 6L, 4L, 10L]) == 2L);\n assert(candidate([1L, 6L, 10L, 1L, 6L, 9L, 10L, 8L, 6L, 8L, 7L, 3L]) == 1L);\n assert(candidate([9L, 2L, 4L, 1L, 5L, 1L, 5L, 2L, 5L, 7L, 7L, 7L, 3L, 10L, 1L, 5L, 4L, 2L, 8L, 4L, 1L, 9L, 10L, 7L, 10L, 2L, 8L, 10L, 9L, 4L]) == 4L);\n assert(candidate([2L, 6L, 4L, 2L, 8L, 7L, 5L, 6L, 4L, 10L, 4L, 6L, 3L, 7L, 8L, 8L, 3L, 1L, 4L, 2L, 2L, 10L, 7L]) == 4L);\n assert(candidate([9L, 8L, 6L, 10L, 2L, 6L, 10L, 2L, 7L, 8L, 10L, 3L, 8L, 2L, 6L, 2L, 3L, 1L]) == 2L);\n assert(candidate([5L, 5L, 3L, 9L, 5L, 6L, 3L, 2L, 8L, 5L, 6L, 10L, 10L, 6L, 8L, 4L, 10L, 7L, 7L, 10L, 8L]) == -1L);\n assert(candidate([10L]) == -1L);\n assert(candidate([9L, 7L, 7L, 2L, 4L, 7L, 2L, 10L, 9L, 7L, 5L, 7L, 2L]) == 2L);\n assert(candidate([5L, 4L, 10L, 2L, 1L, 1L, 10L, 3L, 6L, 1L, 8L]) == 1L);\n assert(candidate([7L, 9L, 9L, 9L, 3L, 4L, 1L, 5L, 9L, 1L, 2L, 1L, 1L, 10L, 7L, 5L, 6L, 7L, 6L, 7L, 7L, 6L]) == 1L);\n assert(candidate([3L, 10L, 10L, 9L, 2L]) == -1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nWrite a function that takes a string and returns True if the string\n length is a prime number or False otherwise\n Examples\n \n*/\nbool prime_length(string string) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = prime_length;\n\n assert(candidate(\"Hello\") == true);\n assert(candidate(\"abcdcba\") == true);\n assert(candidate(\"kittens\") == true);\n assert(candidate(\"orange\") == false);\n assert(candidate(\"wow\") == true);\n assert(candidate(\"world\") == true);\n assert(candidate(\"MadaM\") == true);\n assert(candidate(\"Wow\") == true);\n assert(candidate(\"\") == false);\n assert(candidate(\"HI\") == true);\n assert(candidate(\"go\") == true);\n assert(candidate(\"gogo\") == false);\n assert(candidate(\"aaaaaaaaaaaaaaa\") == false);\n assert(candidate(\"Madam\") == true);\n assert(candidate(\"M\") == false);\n assert(candidate(\"0\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_58_common", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nReturn sorted unique common elements for two lists.\n \n \n*/\nlong[] common(long[] l1, long[] l2) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = common;\n\n assert(candidate([1L, 4L, 3L, 34L, 653L, 2L, 5L], [5L, 7L, 1L, 5L, 9L, 653L, 121L]) == [1L, 5L, 653L]);\n assert(candidate([5L, 3L, 2L, 8L], [3L, 2L]) == [2L, 3L]);\n assert(candidate([4L, 3L, 2L, 8L], [3L, 2L, 4L]) == [2L, 3L, 4L]);\n assert(candidate([4L, 3L, 2L, 8L], []) == []);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nThe Brazilian factorial is defined as:\n brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n where n > 0\n\n For example:\n \n The function will receive an integer as input and should return the special\n factorial of this integer.\n \n*/\nlong special_factorial(long n) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = special_factorial;\n\n assert(candidate(4L) == 288L);\n assert(candidate(5L) == 34560L);\n assert(candidate(7L) == 125411328000L);\n assert(candidate(1L) == 1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nIn this problem, you will implement a function that takes two lists of numbers,\n and determines whether it is possible to perform an exchange of elements\n between them to make lst1 a list of only even numbers.\n There is no limit on the number of exchanged elements between lst1 and lst2.\n If it is possible to exchange elements between the lst1 and lst2 to make\n all the elements of lst1 to be even, return \"YES\".\n Otherwise, return \"NO\".\n For example:\n It is assumed that the input lists will be non-empty.\n \n*/\nstring exchange(long[] lst1, long[] lst2) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = exchange;\n\n assert(candidate([1L, 2L, 3L, 4L], [1L, 2L, 3L, 4L]) == \"YES\");\n assert(candidate([1L, 2L, 3L, 4L], [1L, 5L, 3L, 4L]) == \"NO\");\n assert(candidate([1L, 2L, 3L, 4L], [2L, 1L, 4L, 3L]) == \"YES\");\n assert(candidate([5L, 7L, 3L], [2L, 6L, 4L]) == \"YES\");\n assert(candidate([5L, 7L, 3L], [2L, 6L, 3L]) == \"NO\");\n assert(candidate([3L, 2L, 6L, 1L, 8L, 9L], [3L, 5L, 5L, 1L, 1L, 1L]) == \"NO\");\n assert(candidate([100L, 200L], [200L, 200L]) == \"YES\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given a non-empty array of integers arr and an integer k, return\n the sum of the elements with at most two digits from the first k elements of arr.\n\n Example:\n\n \n Constraints:\n 1. 1 <= len(arr) <= 100\n 2. 1 <= k <= len(arr)\n \n*/\nlong add_elements(long[] arr, long k) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = add_elements;\n\n assert(candidate([1L, -2L, -3L, 41L, 57L, 76L, 87L, 88L, 99L], 3L) == -4L);\n assert(candidate([111L, 121L, 3L, 4000L, 5L, 6L], 2L) == 0L);\n assert(candidate([11L, 21L, 3L, 90L, 5L, 6L, 7L, 8L, 9L], 4L) == 125L);\n assert(candidate([111L, 21L, 3L, 4000L, 5L, 6L, 7L, 8L, 9L], 4L) == 24L);\n assert(candidate([1L], 1L) == 1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nA simple program which should return the value of x if n is \n a prime number and should return the value of y otherwise.\n\n Examples:\n \n \n*/\nlong x_or_y(long n, long x, long y) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = x_or_y;\n\n assert(candidate(7L, 34L, 12L) == 34L);\n assert(candidate(15L, 8L, 5L) == 5L);\n assert(candidate(3L, 33L, 5212L) == 33L);\n assert(candidate(1259L, 3L, 52L) == 3L);\n assert(candidate(7919L, -1L, 12L) == -1L);\n assert(candidate(3609L, 1245L, 583L) == 583L);\n assert(candidate(91L, 56L, 129L) == 129L);\n assert(candidate(6L, 34L, 1234L) == 1234L);\n assert(candidate(1L, 2L, 0L) == 0L);\n assert(candidate(2L, 2L, 0L) == 2L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nGiven length of a side and high return area for a triangle.\n \n*/\nfloat triangle_area(long a, long h) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = triangle_area;\n\n assert(candidate(5L, 3L) == 7.5);\n assert(candidate(2L, 2L) == 2.0);\n assert(candidate(10L, 8L) == 40.0);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nEveryone knows Fibonacci sequence, it was studied deeply by mathematicians in \n the last couple centuries. However, what people don't know is Tribonacci sequence.\n Tribonacci sequence is defined by the recurrence:\n tri(1) = 3\n tri(n) = 1 + n / 2, if n is even.\n tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n For example:\n tri(2) = 1 + (2 / 2) = 2\n tri(4) = 3\n tri(3) = tri(2) + tri(1) + tri(4)\n = 2 + 3 + 3 = 8 \n You are given a non-negative integer number n, you have to a return a list of the \n first n + 1 numbers of the Tribonacci sequence.\n Examples:\n \n*/\nlong[] tri(long n) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = tri;\n\n assert(candidate(3L) == [1L, 3L, 2L, 8L]);\n assert(candidate(4L) == [1L, 3L, 2L, 8L, 3L]);\n assert(candidate(5L) == [1L, 3L, 2L, 8L, 3L, 15L]);\n assert(candidate(6L) == [1L, 3L, 2L, 8L, 3L, 15L, 4L]);\n assert(candidate(7L) == [1L, 3L, 2L, 8L, 3L, 15L, 4L, 24L]);\n assert(candidate(8L) == [1L, 3L, 2L, 8L, 3L, 15L, 4L, 24L, 5L]);\n assert(candidate(9L) == [1L, 3L, 2L, 8L, 3L, 15L, 4L, 24L, 5L, 35L]);\n assert(candidate(20L) == [1L, 3L, 2L, 8L, 3L, 15L, 4L, 24L, 5L, 35L, 6L, 48L, 7L, 63L, 8L, 80L, 9L, 99L, 10L, 120L, 11L]);\n assert(candidate(0L) == [1L]);\n assert(candidate(1L) == [1L, 3L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n You are given a list of two strings, both strings consist of open\n parentheses '(' or close parentheses ')' only.\n Your job is to check if it is possible to concatenate the two strings in\n some order, that the resulting string will be good.\n A string S is considered to be good if and only if all parentheses in S\n are balanced. For example: the string '(())()' is good, while the string\n '())' is not.\n Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n\n Examples:\n \n*/\nstring match_parens(string[] lst) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = match_parens;\n\n assert(candidate([\"()(\", \")\"]) == \"Yes\");\n assert(candidate([\")\", \")\"]) == \"No\");\n assert(candidate([\"(()(())\", \"())())\"]) == \"No\");\n assert(candidate([\")())\", \"(()()(\"]) == \"Yes\");\n assert(candidate([\"(())))\", \"(()())((\"]) == \"Yes\");\n assert(candidate([\"()\", \"())\"]) == \"No\");\n assert(candidate([\"(()(\", \"()))()\"]) == \"Yes\");\n assert(candidate([\"((((\", \"((())\"]) == \"No\");\n assert(candidate([\")(()\", \"(()(\"]) == \"No\");\n assert(candidate([\")(\", \")(\"]) == \"No\");\n assert(candidate([\"(\", \")\"]) == \"Yes\");\n assert(candidate([\")\", \"(\"]) == \"Yes\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n From a list of integers, remove all elements that occur more than once.\n Keep order of elements left the same as in the input.\n \n*/\nlong[] remove_duplicates(long[] numbers) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = remove_duplicates;\n\n assert(candidate([]) == []);\n assert(candidate([1L, 2L, 3L, 4L]) == [1L, 2L, 3L, 4L]);\n assert(candidate([1L, 2L, 3L, 2L, 4L, 3L, 5L]) == [1L, 4L, 5L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Return a greatest common divisor of two integers a and b\n \n*/\nlong greatest_common_divisor(long a, long b) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = greatest_common_divisor;\n\n assert(candidate(3L, 7L) == 1L);\n assert(candidate(10L, 15L) == 5L);\n assert(candidate(49L, 14L) == 7L);\n assert(candidate(144L, 60L) == 12L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Checks if given string is a palindrome\n \n*/\nbool is_palindrome(string text) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = is_palindrome;\n\n assert(candidate(\"\") == true);\n assert(candidate(\"aba\") == true);\n assert(candidate(\"aaaaa\") == true);\n assert(candidate(\"zbcd\") == false);\n assert(candidate(\"xywyx\") == true);\n assert(candidate(\"xywyz\") == false);\n assert(candidate(\"xywzx\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n xs represent coefficients of a polynomial.\n xs[0] + xs[1] * x + xs[2] * x^2 + ....\n Return derivative of this polynomial in the same form.\n \n*/\nlong[] derivative(long[] xs) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = derivative;\n\n assert(candidate([3L, 1L, 2L, 4L, 5L]) == [1L, 4L, 12L, 20L]);\n assert(candidate([1L, 2L, 3L]) == [2L, 6L]);\n assert(candidate([3L, 2L, 1L]) == [2L, 2L]);\n assert(candidate([3L, 2L, 1L, 0L, 4L]) == [2L, 2L, 0L, 16L]);\n assert(candidate([1L]) == []);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n In this task, you will be given a string that represents a number of apples and oranges \n that are distributed in a basket of fruit this basket contains \n apples, oranges, and mango fruits. Given the string that represents the total number of \n the oranges and apples and an integer that represent the total number of the fruits \n in the basket return the number of the mango fruits in the basket.\n for examble:\n \n*/\nlong fruit_distribution(string s, long n) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = fruit_distribution;\n\n assert(candidate(\"5 apples and 6 oranges\", 19L) == 8L);\n assert(candidate(\"5 apples and 6 oranges\", 21L) == 10L);\n assert(candidate(\"0 apples and 1 oranges\", 3L) == 2L);\n assert(candidate(\"1 apples and 0 oranges\", 3L) == 2L);\n assert(candidate(\"2 apples and 3 oranges\", 100L) == 95L);\n assert(candidate(\"2 apples and 3 oranges\", 5L) == 0L);\n assert(candidate(\"1 apples and 100 oranges\", 120L) == 19L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Write a function that takes an integer a and returns True \n if this ingeger is a cube of some integer number.\n Note: you may assume the input is always valid.\n Examples:\n \n*/\nbool iscube(long a) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = iscube;\n\n assert(candidate(1L) == true);\n assert(candidate(2L) == false);\n assert(candidate(-1L) == true);\n assert(candidate(64L) == true);\n assert(candidate(180L) == false);\n assert(candidate(1000L) == true);\n assert(candidate(0L) == true);\n assert(candidate(1729L) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n In this Kata, you have to sort an array of non-negative integers according to\n number of ones in their binary representation in ascending order.\n For similar number of ones, sort based on decimal value.\n\n It must be implemented like this:\n \n*/\nlong[] sort_array(long[] arr) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = sort_array;\n\n assert(candidate([1L, 5L, 2L, 3L, 4L]) == [1L, 2L, 4L, 3L, 5L]);\n assert(candidate([-2L, -3L, -4L, -5L, -6L]) == [-4L, -2L, -6L, -5L, -3L]);\n assert(candidate([1L, 0L, 2L, 3L, 4L]) == [0L, 1L, 2L, 4L, 3L]);\n assert(candidate([]) == []);\n assert(candidate([2L, 5L, 77L, 4L, 5L, 3L, 5L, 7L, 2L, 3L, 4L]) == [2L, 2L, 4L, 4L, 3L, 3L, 5L, 5L, 5L, 7L, 77L]);\n assert(candidate([3L, 6L, 44L, 12L, 32L, 5L]) == [32L, 3L, 5L, 6L, 12L, 44L]);\n assert(candidate([2L, 4L, 8L, 16L, 32L]) == [2L, 4L, 8L, 16L, 32L]);\n assert(candidate([2L, 4L, 8L, 16L, 32L]) == [2L, 4L, 8L, 16L, 32L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nGiven a list of strings, where each string consists of only digits, return a list.\n Each element i of the output should be \"the number of odd elements in the\n string i of the input.\" where all the i's should be replaced by the number\n of odd digits in the i'th string of the input.\n\n \n*/\nstring[] odd_count(string[] lst) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = odd_count;\n\n assert(candidate([\"1234567\"]) == [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]);\n 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.\"]);\n assert(candidate([\"271\", \"137\", \"314\"]) == [\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n brackets is a string of \"(\" and \")\".\n return True if every opening bracket has a corresponding closing bracket.\n\n \n*/\nbool correct_bracketing(string brackets) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = correct_bracketing;\n\n assert(candidate(\"()\") == true);\n assert(candidate(\"(()())\") == true);\n assert(candidate(\"()()(()())()\") == true);\n assert(candidate(\"()()((()()())())(()()(()))\") == true);\n assert(candidate(\"((()())))\") == false);\n assert(candidate(\")(()\") == false);\n assert(candidate(\"(\") == false);\n assert(candidate(\"((((\") == false);\n assert(candidate(\")\") == false);\n assert(candidate(\"(()\") == false);\n assert(candidate(\"()()(()())())(()\") == false);\n assert(candidate(\"()()(()())()))()\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nTask\n Write a function that takes a string as input and returns the sum of the upper characters only'\n ASCII codes.\n\n Examples:\n \n*/\nlong digitSum(string s) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = digitSum;\n\n assert(candidate(\"\") == 0L);\n assert(candidate(\"abAB\") == 131L);\n assert(candidate(\"abcCd\") == 67L);\n assert(candidate(\"helloE\") == 69L);\n assert(candidate(\"woArBld\") == 131L);\n assert(candidate(\"aAaaaXa\") == 153L);\n assert(candidate(\" How are yOu?\") == 151L);\n assert(candidate(\"You arE Very Smart\") == 327L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nWrite a function that accepts a list of strings as a parameter,\n deletes the strings that have odd lengths from it,\n and returns the resulted list with a sorted order,\n The list is always a list of strings and never an array of numbers,\n and it may contain duplicates.\n The order of the list should be ascending by length of each word, and you\n should return the list sorted by that rule.\n If two words have the same length, sort the list alphabetically.\n The function should return a list of strings in sorted order.\n You may assume that all words will have the same length.\n For example:\n \n*/\nstring[] sorted_list_sum(string[] lst) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = sorted_list_sum;\n\n assert(candidate([\"aa\", \"a\", \"aaa\"]) == [\"aa\"]);\n assert(candidate([\"school\", \"AI\", \"asdf\", \"b\"]) == [\"AI\", \"asdf\", \"school\"]);\n assert(candidate([\"d\", \"b\", \"c\", \"a\"]) == []);\n assert(candidate([\"d\", \"dcba\", \"abcd\", \"a\"]) == [\"abcd\", \"dcba\"]);\n assert(candidate([\"AI\", \"ai\", \"au\"]) == [\"AI\", \"ai\", \"au\"]);\n assert(candidate([\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"]) == []);\n assert(candidate([\"aaaa\", \"bbbb\", \"dd\", \"cc\"]) == [\"cc\", \"dd\", \"aaaa\", \"bbbb\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n You are given an array arr of integers and you need to return\n sum of magnitudes of integers multiplied by product of all signs\n of each number in the array, represented by 1, -1 or 0.\n Note: return None for empty arr.\n\n Example:\n \n*/\nNullable!(long) prod_signs(long[] arr) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = prod_signs;\n\n{\n auto result = candidate([1L, 2L, 2L, -4L]);\n assert(!result.isNull && result.get == -9L);\n}\n\n{\n auto result = candidate([0L, 1L]);\n assert(!result.isNull && result.get == 0L);\n}\n\n{\n auto result = candidate([1L, 1L, 1L, 2L, 3L, -1L, 1L]);\n assert(!result.isNull && result.get == -10L);\n}\n\n{\n auto result = candidate([]);\n assert(result.isNull);\n}\n\n{\n auto result = candidate([2L, 4L, 1L, 2L, -1L, -1L, 9L]);\n assert(!result.isNull && result.get == 20L);\n}\n\n{\n auto result = candidate([-1L, 1L, -1L, 1L]);\n assert(!result.isNull && result.get == 4L);\n}\n\n{\n auto result = candidate([-1L, 1L, 1L, 1L]);\n assert(!result.isNull && result.get == -4L);\n}\n\n{\n auto result = candidate([-1L, 1L, 1L, 0L]);\n assert(!result.isNull && result.get == 0L);\n}\n\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nReturn list with elements incremented by 1.\n \n*/\nlong[] incr_list(long[] l) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = incr_list;\n\n assert(candidate([]) == []);\n assert(candidate([3L, 2L, 1L]) == [4L, 3L, 2L]);\n assert(candidate([5L, 2L, 5L, 2L, 3L, 3L, 9L, 0L, 123L]) == [6L, 3L, 6L, 3L, 4L, 4L, 10L, 1L, 124L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n From a given list of integers, generate a list of rolling maximum element found until given moment\n in the sequence.\n \n*/\nlong[] rolling_max(long[] numbers) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = rolling_max;\n\n assert(candidate([]) == []);\n assert(candidate([1L, 2L, 3L, 4L]) == [1L, 2L, 3L, 4L]);\n assert(candidate([4L, 3L, 2L, 1L]) == [4L, 4L, 4L, 4L]);\n assert(candidate([3L, 2L, 3L, 100L, 3L]) == [3L, 3L, 3L, 100L, 100L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n separate those group into separate strings and return the list of those.\n Separate groups are balanced (each open brace is properly closed) and not nested within each other\n Ignore any spaces in the input string.\n \n*/\nstring[] separate_paren_groups(string paren_string) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = separate_paren_groups;\n\n assert(candidate(\"(()()) ((())) () ((())()())\") == [\"(()())\", \"((()))\", \"()\", \"((())()())\"]);\n assert(candidate(\"() (()) ((())) (((())))\") == [\"()\", \"(())\", \"((()))\", \"(((())))\"]);\n assert(candidate(\"(()(())((())))\") == [\"(()(())((())))\"]);\n assert(candidate(\"( ) (( )) (( )( ))\") == [\"()\", \"(())\", \"(()())\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n You will be given a string of words separated by commas or spaces. Your task is\n to split the string into words and return an array of the words.\n \n For example:\n \n*/\nstring[] words_string(string s) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = words_string;\n\n assert(candidate(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]);\n assert(candidate(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]);\n assert(candidate(\"Hi, my name\") == [\"Hi\", \"my\", \"name\"]);\n assert(candidate(\"One,, two, three, four, five, six,\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]);\n assert(candidate(\"\") == []);\n assert(candidate(\"ahmed , gamal\") == [\"ahmed\", \"gamal\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nThis function takes a list l and returns a list l' such that\n l' is identical to l in the odd indicies, while its values at the even indicies are equal\n to the values of the even indicies of l, but sorted.\n \n*/\nlong[] sort_even(long[] l) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = sort_even;\n\n assert(candidate([1L, 2L, 3L]) == [1L, 2L, 3L]);\n assert(candidate([5L, 3L, -5L, 2L, -3L, 3L, 9L, 0L, 123L, 1L, -10L]) == [-10L, 3L, -5L, 2L, -3L, 3L, 5L, 0L, 9L, 1L, 123L]);\n assert(candidate([5L, 8L, -12L, 4L, 23L, 2L, 3L, 11L, 12L, -10L]) == [-12L, 8L, 3L, 4L, 5L, 2L, 12L, 11L, 23L, -10L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nI think we all remember that feeling when the result of some long-awaited\n event is finally known. The feelings and thoughts you have at that moment are\n definitely worth noting down and comparing.\n Your task is to determine if a person correctly guessed the results of a number of matches.\n You are given two arrays of scores and guesses of equal length, where each index shows a match. \n Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n the value is 0, and if not, the value is the absolute difference between the guess and the score.\n \n \n example:\n\n \n*/\nlong[] compare(long[] game, long[] guess) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = compare;\n\n assert(candidate([1L, 2L, 3L, 4L, 5L, 1L], [1L, 2L, 3L, 4L, 2L, -2L]) == [0L, 0L, 0L, 0L, 3L, 3L]);\n assert(candidate([0L, 0L, 0L, 0L, 0L, 0L], [0L, 0L, 0L, 0L, 0L, 0L]) == [0L, 0L, 0L, 0L, 0L, 0L]);\n assert(candidate([1L, 2L, 3L], [-1L, -2L, -3L]) == [2L, 4L, 6L]);\n assert(candidate([1L, 2L, 3L, 5L], [-1L, 2L, 3L, 4L]) == [2L, 0L, 0L, 1L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given a positive integer n, return a tuple that has the number of even and odd\n integer palindromes that fall within the range(1, n), inclusive.\n\n Example 1:\n\n Explanation:\n Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n\n Example 2:\n\n Explanation:\n Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n\n Note:\n 1. 1 <= n <= 10^3\n 2. returned tuple has the number of even and odd integer palindromes respectively.\n \n*/\nTuple!(long, long) even_odd_palindrome(long n) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = even_odd_palindrome;\n\n assert(candidate(123L) == tuple(8L, 13L));\n assert(candidate(12L) == tuple(4L, 6L));\n assert(candidate(3L) == tuple(1L, 2L));\n assert(candidate(63L) == tuple(6L, 8L));\n assert(candidate(25L) == tuple(5L, 6L));\n assert(candidate(19L) == tuple(4L, 6L));\n assert(candidate(9L) == tuple(4L, 5L));\n assert(candidate(1L) == tuple(0L, 1L));\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nThe Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fib4(0) -> 0\n fib4(1) -> 0\n fib4(2) -> 2\n fib4(3) -> 0\n fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n \n*/\nlong fib4(long n) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = fib4;\n\n assert(candidate(5L) == 4L);\n assert(candidate(8L) == 28L);\n assert(candidate(10L) == 104L);\n assert(candidate(12L) == 386L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given two positive integers a and b, return the even digits between a\n and b, in ascending order.\n\n For example:\n \n*/\nlong[] generate_integers(long a, long b) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = generate_integers;\n\n assert(candidate(2L, 10L) == [2L, 4L, 6L, 8L]);\n assert(candidate(10L, 2L) == [2L, 4L, 6L, 8L]);\n assert(candidate(132L, 2L) == [2L, 4L, 6L, 8L]);\n assert(candidate(17L, 89L) == []);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n For a given list of input numbers, calculate Mean Absolute Deviation\n around the mean of this dataset.\n Mean Absolute Deviation is the average absolute difference between each\n element and a centerpoint (mean in this case):\n MAD = average | x - x_mean |\n \n*/\nfloat mean_absolute_deviation(float[] numbers) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = mean_absolute_deviation;\n\n assert(candidate([1.0, 2.0]) == 0.5);\n assert(candidate([1.0, 2.0, 3.0, 4.0]) == 1.0);\n assert(candidate([1.0, 2.0, 3.0, 4.0, 5.0]) == 1.2);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nCreate a function encrypt that takes a string as an argument and\n returns a string encrypted with the alphabet being rotated. \n The alphabet should be rotated in a manner such that the letters \n shift down by two multiplied to two places.\n For example:\n \n*/\nstring encrypt(string s) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = encrypt;\n\n assert(candidate(\"hi\") == \"lm\");\n assert(candidate(\"asdfghjkl\") == \"ewhjklnop\");\n assert(candidate(\"gf\") == \"kj\");\n assert(candidate(\"et\") == \"ix\");\n assert(candidate(\"faewfawefaewg\") == \"jeiajeaijeiak\");\n assert(candidate(\"hellomyfriend\") == \"lippsqcjvmirh\");\n assert(candidate(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\") == \"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\");\n assert(candidate(\"a\") == \"e\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n\n The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n as follows: start with any positive integer n. Then each term is obtained from the \n previous term as follows: if the previous term is even, the next term is one half of \n the previous term. If the previous term is odd, the next term is 3 times the previous\n term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n\n Note: \n 1. Collatz(1) is [1].\n 2. returned list sorted in increasing order.\n\n For example:\n get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n \n*/\nlong[] get_odd_collatz(long n) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = get_odd_collatz;\n\n assert(candidate(14L) == [1L, 5L, 7L, 11L, 13L, 17L]);\n assert(candidate(5L) == [1L, 5L]);\n assert(candidate(12L) == [1L, 3L, 5L]);\n assert(candidate(1L) == [1L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Find how many times a given substring can be found in the original string. Count overlaping cases.\n \n*/\nlong how_many_times(string string, string substring) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = how_many_times;\n\n assert(candidate(\"\", \"x\") == 0L);\n assert(candidate(\"xyxyxyx\", \"x\") == 4L);\n assert(candidate(\"cacacacac\", \"cac\") == 4L);\n assert(candidate(\"john doe\", \"john\") == 1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nWe have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n numbers in the array will be randomly ordered. Your task is to determine if\n it is possible to get an array sorted in non-decreasing order by performing \n the following operation on the given array:\n You are allowed to perform right shift operation any number of times.\n \n One right shift operation means shifting all elements of the array by one\n position in the right direction. The last element of the array will be moved to\n the starting position in the array i.e. 0th index. \n\n If it is possible to obtain the sorted array by performing the above operation\n then return True else return False.\n If the given array is empty then return True.\n\n Note: The given list is guaranteed to have unique elements.\n\n For Example:\n \n Explanation: By performin 2 right shift operations, non-decreasing order can\n be achieved for the given array.\n Explanation:It is not possible to get non-decreasing order for the given\n array by performing any number of right shift operations.\n \n \n*/\nbool move_one_ball(long[] arr) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = move_one_ball;\n\n assert(candidate([3L, 4L, 5L, 1L, 2L]) == true);\n assert(candidate([3L, 5L, 10L, 1L, 2L]) == true);\n assert(candidate([4L, 3L, 1L, 2L]) == false);\n assert(candidate([3L, 5L, 4L, 1L, 2L]) == false);\n assert(candidate([]) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Write a function which sorts the given list of integers\n in ascending order according to the sum of their digits.\n Note: if there are several items with similar sum of their digits,\n order them based on their index in original list.\n\n For example:\n \n*/\nlong[] order_by_points(long[] nums) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = order_by_points;\n\n assert(candidate([1L, 11L, -1L, -11L, -12L]) == [-1L, -11L, 1L, -12L, 11L]);\n assert(candidate([1234L, 423L, 463L, 145L, 2L, 423L, 423L, 53L, 6L, 37L, 3457L, 3L, 56L, 0L, 46L]) == [0L, 2L, 3L, 6L, 53L, 423L, 423L, 423L, 1234L, 145L, 37L, 46L, 56L, 463L, 3457L]);\n assert(candidate([]) == []);\n assert(candidate([1L, -11L, -32L, 43L, 54L, -98L, 2L, -3L]) == [-3L, -32L, -98L, -11L, 1L, 2L, 43L, 54L]);\n assert(candidate([1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L]) == [1L, 10L, 2L, 11L, 3L, 4L, 5L, 6L, 7L, 8L, 9L]);\n assert(candidate([0L, 6L, 6L, -76L, -21L, 23L, 4L]) == [-76L, -21L, 0L, 4L, 23L, 6L, 6L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Return list of prime factors of given integer in the order from smallest to largest.\n Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n Input number should be equal to the product of all factors\n \n*/\nlong[] factorize(long n) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = factorize;\n\n assert(candidate(2L) == [2L]);\n assert(candidate(4L) == [2L, 2L]);\n assert(candidate(8L) == [2L, 2L, 2L]);\n assert(candidate(57L) == [3L, 19L]);\n assert(candidate(3249L) == [3L, 3L, 19L, 19L]);\n assert(candidate(185193L) == [3L, 3L, 3L, 19L, 19L, 19L]);\n assert(candidate(20577L) == [3L, 19L, 19L, 19L]);\n assert(candidate(18L) == [2L, 3L, 3L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nReturn True if all numbers in the list l are below threshold t.\n \n*/\nbool below_threshold(long[] l, long t) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = below_threshold;\n\n assert(candidate([1L, 2L, 4L, 10L], 100L) == true);\n assert(candidate([1L, 20L, 4L, 10L], 5L) == false);\n assert(candidate([1L, 20L, 4L, 10L], 21L) == true);\n assert(candidate([1L, 20L, 4L, 10L], 22L) == true);\n assert(candidate([1L, 8L, 4L, 10L], 11L) == true);\n assert(candidate([1L, 8L, 4L, 10L], 10L) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n For each of the group, output the deepest level of nesting of parentheses.\n E.g. (()()) has maximum two levels of nesting while ((())) has three.\n\n \n*/\nlong[] parse_nested_parens(string paren_string) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = parse_nested_parens;\n\n assert(candidate(\"(()()) ((())) () ((())()())\") == [2L, 3L, 1L, 3L]);\n assert(candidate(\"() (()) ((())) (((())))\") == [1L, 2L, 3L, 4L]);\n assert(candidate(\"(()(())((())))\") == [4L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nGiven a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n \n\n Examples\n \n*/\nlong solution(long[] lst) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = solution;\n\n assert(candidate([5L, 8L, 7L, 1L]) == 12L);\n assert(candidate([3L, 3L, 3L, 3L, 3L]) == 9L);\n assert(candidate([30L, 13L, 24L, 321L]) == 0L);\n assert(candidate([5L, 9L]) == 5L);\n assert(candidate([2L, 4L, 8L]) == 0L);\n assert(candidate([30L, 13L, 23L, 32L]) == 23L);\n assert(candidate([3L, 13L, 2L, 9L]) == 3L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n You are given a positive integer n. You have to create an integer array a of length n.\n For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n and a[i] + a[j] + a[k] is a multiple of 3.\n\n Example :\n Explanation: \n a = [1, 3, 7, 13, 21]\n The only valid triple is (1, 7, 13).\n \n*/\nlong get_max_triples(long n) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = get_max_triples;\n\n assert(candidate(5L) == 1L);\n assert(candidate(6L) == 4L);\n assert(candidate(10L) == 36L);\n assert(candidate(100L) == 53361L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n You are given a list of integers.\n Write a function next_smallest() that returns the 2nd smallest element of the list.\n Return None if there is no such element.\n \n*/\nNullable!(long) next_smallest(long[] lst) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = next_smallest;\n\n{\n auto result = candidate([1L, 2L, 3L, 4L, 5L]);\n assert(!result.isNull && result.get == 2L);\n}\n\n{\n auto result = candidate([5L, 1L, 4L, 3L, 2L]);\n assert(!result.isNull && result.get == 2L);\n}\n\n{\n auto result = candidate([]);\n assert(result.isNull);\n}\n\n{\n auto result = candidate([1L, 1L]);\n assert(result.isNull);\n}\n\n{\n auto result = candidate([1L, 1L, 1L, 1L, 0L]);\n assert(!result.isNull && result.get == 1L);\n}\n\n{\n auto result = candidate([1L, 1L]);\n assert(result.isNull);\n}\n\n{\n auto result = candidate([-35L, 34L, 12L, -45L]);\n assert(!result.isNull && result.get == -35L);\n}\n\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Input is a space-delimited string of numberals from 'zero' to 'nine'.\n Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n Return the string with numbers sorted from smallest to largest\n \n*/\nstring sort_numbers(string numbers) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = sort_numbers;\n\n assert(candidate(\"\") == \"\");\n assert(candidate(\"three\") == \"three\");\n assert(candidate(\"three five nine\") == \"three five nine\");\n assert(candidate(\"five zero four seven nine eight\") == \"zero four five seven eight nine\");\n assert(candidate(\"six five four three two one zero\") == \"zero one two three four five six\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n \n \n*/\nbool cycpattern_check(string a, string b) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = cycpattern_check;\n\n assert(candidate(\"xyzw\", \"xyw\") == false);\n assert(candidate(\"yello\", \"ell\") == true);\n assert(candidate(\"whattup\", \"ptut\") == false);\n assert(candidate(\"efef\", \"fee\") == true);\n assert(candidate(\"abab\", \"aabb\") == false);\n assert(candidate(\"winemtt\", \"tinem\") == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou will be given a number in decimal form and your task is to convert it to\n binary format. The function should return a string, with each character representing a binary\n number. Each character in the string will be '0' or '1'.\n\n There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n The extra characters are there to help with the format.\n\n Examples:\n \n*/\nstring decimal_to_binary(long decimal) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = decimal_to_binary;\n\n assert(candidate(0L) == \"db0db\");\n assert(candidate(32L) == \"db100000db\");\n assert(candidate(103L) == \"db1100111db\");\n assert(candidate(15L) == \"db1111db\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Filter an input list of strings only for ones that contain given substring\n \n*/\nstring[] filter_by_substring(string[] strings, string substring) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = filter_by_substring;\n\n assert(candidate([], \"john\") == []);\n assert(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\") == [\"xxx\", \"xxxAAA\", \"xxx\"]);\n assert(candidate([\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xx\") == [\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"]);\n assert(candidate([\"grunt\", \"trumpet\", \"prune\", \"gruesome\"], \"run\") == [\"grunt\", \"prune\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nGiven an integer. return a tuple that has the number of even and odd digits respectively.\n\n Example:\n \n*/\nTuple!(long, long) even_odd_count(long num) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = even_odd_count;\n\n assert(candidate(7L) == tuple(0L, 1L));\n assert(candidate(-78L) == tuple(1L, 1L));\n assert(candidate(3452L) == tuple(2L, 2L));\n assert(candidate(346211L) == tuple(3L, 3L));\n assert(candidate(-345821L) == tuple(3L, 3L));\n assert(candidate(-2L) == tuple(1L, 0L));\n assert(candidate(-45347L) == tuple(2L, 3L));\n assert(candidate(0L) == tuple(1L, 0L));\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nWrite a function that accepts a list of strings.\n The list contains different words. Return the word with maximum number\n of unique characters. If multiple strings have maximum number of unique\n characters, return the one which comes first in lexicographical order.\n\n \n*/\nstring find_max(string[] words) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = find_max;\n\n assert(candidate([\"name\", \"of\", \"string\"]) == \"string\");\n assert(candidate([\"name\", \"enam\", \"game\"]) == \"enam\");\n assert(candidate([\"aaaaaaa\", \"bb\", \"cc\"]) == \"aaaaaaa\");\n assert(candidate([\"abc\", \"cba\"]) == \"abc\");\n assert(candidate([\"play\", \"this\", \"game\", \"of\", \"footbott\"]) == \"footbott\");\n assert(candidate([\"we\", \"are\", \"gonna\", \"rock\"]) == \"gonna\");\n assert(candidate([\"we\", \"are\", \"a\", \"mad\", \"nation\"]) == \"nation\");\n assert(candidate([\"this\", \"is\", \"a\", \"prrk\"]) == \"this\");\n assert(candidate([\"b\"]) == \"b\");\n assert(candidate([\"play\", \"play\", \"play\"]) == \"play\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Create a function that returns a tuple (a, b), where 'a' is\n the largest of negative integers, and 'b' is the smallest\n of positive integers in a list.\n If there is no negative or positive integers, return them as None.\n\n Examples:\n \n*/\nTuple!(Nullable!(long), Nullable!(long)) largest_smallest_integers(long[] lst) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = largest_smallest_integers;\n\n{\n auto result = candidate([2L, 4L, 1L, 3L, 5L, 7L]);\n assert(result[0].isNull);\n assert(!result[1].isNull && result[1].get == 1L);\n}\n\n{\n auto result = candidate([2L, 4L, 1L, 3L, 5L, 7L, 0L]);\n assert(result[0].isNull);\n assert(!result[1].isNull && result[1].get == 1L);\n}\n\n{\n auto result = candidate([1L, 3L, 2L, 4L, 5L, 6L, -2L]);\n assert(!result[0].isNull && result[0].get == -2L);\n assert(!result[1].isNull && result[1].get == 1L);\n}\n\n{\n auto result = candidate([4L, 5L, 3L, 6L, 2L, 7L, -7L]);\n assert(!result[0].isNull && result[0].get == -7L);\n assert(!result[1].isNull && result[1].get == 2L);\n}\n\n{\n auto result = candidate([7L, 3L, 8L, 4L, 9L, 2L, 5L, -9L]);\n assert(!result[0].isNull && result[0].get == -9L);\n assert(!result[1].isNull && result[1].get == 2L);\n}\n\n{\n auto result = candidate([]);\n assert(result[0].isNull);\n assert(result[1].isNull);\n}\n\n{\n auto result = candidate([0L]);\n assert(result[0].isNull);\n assert(result[1].isNull);\n}\n\n{\n auto result = candidate([-1L, -3L, -5L, -6L]);\n assert(!result[0].isNull && result[0].get == -1L);\n assert(result[1].isNull);\n}\n\n{\n auto result = candidate([-1L, -3L, -5L, -6L, 0L]);\n assert(!result[0].isNull && result[0].get == -1L);\n assert(result[1].isNull);\n}\n\n{\n auto result = candidate([-6L, -4L, -4L, -3L, 1L]);\n assert(!result[0].isNull && result[0].get == -3L);\n assert(!result[1].isNull && result[1].get == 1L);\n}\n\n{\n auto result = candidate([-6L, -4L, -4L, -3L, -100L, 1L]);\n assert(!result[0].isNull && result[0].get == -3L);\n assert(!result[1].isNull && result[1].get == 1L);\n}\n\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n \"Given an array representing a branch of a tree that has non-negative integer nodes\n your task is to pluck one of the nodes and return it.\n The plucked node should be the node with the smallest even value.\n If multiple nodes with the same smallest even value are found return the node that has smallest index.\n\n The plucked node should be returned in a list, [ smalest_value, its index ],\n If there are no even values or the given array is empty, return [].\n\n Example 1:\n Explanation: 2 has the smallest even value, and 2 has the smallest index.\n\n Example 2:\n Explanation: 2 has the smallest even value, and 2 has the smallest index.\n\n Example 3:\n \n Example 4:\n Explanation: 0 is the smallest value, but there are two zeros,\n so we will choose the first zero, which has the smallest index.\n\n Constraints:\n * 1 <= nodes.length <= 10000\n * 0 <= node.value\n \n*/\nlong[] pluck(long[] arr) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = pluck;\n\n assert(candidate([4L, 2L, 3L]) == [2L, 1L]);\n assert(candidate([1L, 2L, 3L]) == [2L, 1L]);\n assert(candidate([]) == []);\n assert(candidate([5L, 0L, 3L, 0L, 4L, 2L]) == [0L, 1L]);\n assert(candidate([1L, 2L, 3L, 0L, 5L, 3L]) == [0L, 3L]);\n assert(candidate([5L, 4L, 8L, 4L, 8L]) == [4L, 1L]);\n assert(candidate([7L, 6L, 7L, 1L]) == [6L, 1L]);\n assert(candidate([7L, 9L, 7L, 1L]) == []);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Write a function count_nums which takes an array of integers and returns\n the number of elements which has a sum of digits > 0.\n If a number is negative, then its first signed digit will be negative:\n e.g. -123 has signed digits -1, 2, and 3.\n \n*/\nlong count_nums(long[] arr) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = count_nums;\n\n assert(candidate([]) == 0L);\n assert(candidate([-1L, -2L, 0L]) == 0L);\n assert(candidate([1L, 1L, 2L, -2L, 3L, 4L, 5L]) == 6L);\n assert(candidate([1L, 6L, 9L, -6L, 0L, 1L, 5L]) == 5L);\n assert(candidate([1L, 100L, 98L, -7L, 1L, -1L]) == 4L);\n assert(candidate([12L, 23L, 34L, -45L, -56L, 0L]) == 5L);\n assert(candidate([0L, 1L]) == 1L);\n assert(candidate([1L]) == 1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n each cell of the grid contains a value. Every integer in the range [1, N * N]\n inclusive appears exactly once on the cells of the grid.\n\n You have to find the minimum path of length k in the grid. You can start\n from any cell, and in each step you can move to any of the neighbor cells,\n in other words, you can go to cells which share an edge with you current\n cell.\n Please note that a path of length k means visiting exactly k cells (not\n necessarily distinct).\n You CANNOT go off the grid.\n A path A (of length k) is considered less than a path B (of length k) if\n after making the ordered lists of the values on the cells that A and B go\n through (let's call them lst_A and lst_B), lst_A is lexicographically less\n than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n lst_A[j] = lst_B[j].\n It is guaranteed that the answer is unique.\n Return an ordered list of the values on the cells that the minimum path go through.\n\n Examples: \n \n \n*/\nlong[] minPath(long[][] grid, long k) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = minPath;\n\n assert(candidate([[1L, 2L, 3L], [4L, 5L, 6L], [7L, 8L, 9L]], 3L) == [1L, 2L, 1L]);\n assert(candidate([[5L, 9L, 3L], [4L, 1L, 6L], [7L, 8L, 2L]], 1L) == [1L]);\n assert(candidate([[1L, 2L, 3L, 4L], [5L, 6L, 7L, 8L], [9L, 10L, 11L, 12L], [13L, 14L, 15L, 16L]], 4L) == [1L, 2L, 1L, 2L]);\n assert(candidate([[6L, 4L, 13L, 10L], [5L, 7L, 12L, 1L], [3L, 16L, 11L, 15L], [8L, 14L, 9L, 2L]], 7L) == [1L, 10L, 1L, 10L, 1L, 10L, 1L]);\n assert(candidate([[8L, 14L, 9L, 2L], [6L, 4L, 13L, 15L], [5L, 7L, 1L, 12L], [3L, 10L, 11L, 16L]], 5L) == [1L, 7L, 1L, 7L, 1L]);\n assert(candidate([[11L, 8L, 7L, 2L], [5L, 16L, 14L, 4L], [9L, 3L, 15L, 6L], [12L, 13L, 10L, 1L]], 9L) == [1L, 6L, 1L, 6L, 1L, 6L, 1L, 6L, 1L]);\n assert(candidate([[12L, 13L, 10L, 1L], [9L, 3L, 15L, 6L], [5L, 16L, 14L, 4L], [11L, 8L, 7L, 2L]], 12L) == [1L, 6L, 1L, 6L, 1L, 6L, 1L, 6L, 1L, 6L, 1L, 6L]);\n assert(candidate([[2L, 7L, 4L], [3L, 1L, 5L], [6L, 8L, 9L]], 8L) == [1L, 3L, 1L, 3L, 1L, 3L, 1L, 3L]);\n assert(candidate([[6L, 1L, 5L], [3L, 8L, 9L], [2L, 7L, 4L]], 8L) == [1L, 5L, 1L, 5L, 1L, 5L, 1L, 5L]);\n assert(candidate([[1L, 2L], [3L, 4L]], 10L) == [1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L]);\n assert(candidate([[1L, 3L], [3L, 2L]], 10L) == [1L, 3L, 1L, 3L, 1L, 3L, 1L, 3L, 1L, 3L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given list of integers, return list in strange order.\n Strange sorting, is when you start with the minimum value,\n then maximum of the remaining integers, then minimum and so on.\n\n Examples:\n \n*/\nlong[] strange_sort_list(long[] lst) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = strange_sort_list;\n\n assert(candidate([1L, 2L, 3L, 4L]) == [1L, 4L, 2L, 3L]);\n assert(candidate([5L, 6L, 7L, 8L, 9L]) == [5L, 9L, 6L, 8L, 7L]);\n assert(candidate([1L, 2L, 3L, 4L, 5L]) == [1L, 5L, 2L, 4L, 3L]);\n assert(candidate([5L, 6L, 7L, 8L, 9L, 1L]) == [1L, 9L, 5L, 8L, 6L, 7L]);\n assert(candidate([5L, 5L, 5L, 5L]) == [5L, 5L, 5L, 5L]);\n assert(candidate([]) == []);\n assert(candidate([1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L]) == [1L, 8L, 2L, 7L, 3L, 6L, 4L, 5L]);\n assert(candidate([0L, 2L, 2L, 2L, 5L, 5L, -5L, -5L]) == [-5L, 5L, -5L, 5L, 0L, 2L, 2L, 2L]);\n assert(candidate([111111L]) == [111111L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given a string 'text', return its md5 hash equivalent string.\n If 'text' is an empty string, return None.\n\n \n*/\nNullable!(string) string_to_md5(string text) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = string_to_md5;\n\n{\n auto result = candidate(\"Hello world\");\n assert(!result.isNull && result.get == \"3e25960a79dbc69b674cd4ec67a72c62\");\n}\n\n{\n auto result = candidate(\"\");\n assert(result.isNull);\n}\n\n{\n auto result = candidate(\"A B C\");\n assert(!result.isNull && result.get == \"0ef78513b0cb8cef12743f5aeb35f888\");\n}\n\n{\n auto result = candidate(\"password\");\n assert(!result.isNull && result.get == \"5f4dcc3b5aa765d61d8327deb882cf99\");\n}\n\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou are given a word. Your task is to find the closest vowel that stands between \n two consonants from the right side of the word (case sensitive).\n \n Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n find any vowel met the above condition. \n\n You may assume that the given string contains English letter only.\n\n Example:\n \n*/\nstring get_closest_vowel(string word) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = get_closest_vowel;\n\n assert(candidate(\"yogurt\") == \"u\");\n assert(candidate(\"full\") == \"u\");\n assert(candidate(\"easy\") == \"\");\n assert(candidate(\"eAsy\") == \"\");\n assert(candidate(\"ali\") == \"\");\n assert(candidate(\"bad\") == \"a\");\n assert(candidate(\"most\") == \"o\");\n assert(candidate(\"ab\") == \"\");\n assert(candidate(\"ba\") == \"\");\n assert(candidate(\"quick\") == \"\");\n assert(candidate(\"anime\") == \"i\");\n assert(candidate(\"Asia\") == \"\");\n assert(candidate(\"Above\") == \"o\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nChange numerical base of input number x to base.\n return string representation after the conversion.\n base numbers are less than 10.\n \n*/\nstring change_base(long x, long base) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = change_base;\n\n assert(candidate(8L, 3L) == \"22\");\n assert(candidate(9L, 3L) == \"100\");\n assert(candidate(234L, 2L) == \"11101010\");\n assert(candidate(16L, 2L) == \"10000\");\n assert(candidate(8L, 2L) == \"1000\");\n assert(candidate(7L, 2L) == \"111\");\n assert(candidate(2L, 3L) == \"2\");\n assert(candidate(3L, 4L) == \"3\");\n assert(candidate(4L, 5L) == \"4\");\n assert(candidate(5L, 6L) == \"5\");\n assert(candidate(6L, 7L) == \"6\");\n assert(candidate(7L, 8L) == \"7\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Check if in given list of numbers, are any two numbers closer to each other than\n given threshold.\n \n*/\nbool has_close_elements(float[] numbers, float threshold) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = has_close_elements;\n\n assert(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3) == true);\n assert(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05) == false);\n assert(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.95) == true);\n assert(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.8) == false);\n assert(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1) == true);\n assert(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 1.0) == true);\n assert(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 0.5) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Create a function that takes a string as input which contains only square brackets.\n The function should return True if and only if there is a valid subsequence of brackets \n where at least one bracket in the subsequence is nested.\n\n \n*/\nbool is_nested(string string) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = is_nested;\n\n assert(candidate(\"[[]]\") == true);\n assert(candidate(\"[]]]]]]][[[[[]\") == false);\n assert(candidate(\"[][]\") == false);\n assert(candidate(\"[]\") == false);\n assert(candidate(\"[[[[]]]]\") == true);\n assert(candidate(\"[]]]]]]]]]]\") == false);\n assert(candidate(\"[][][[]]\") == true);\n assert(candidate(\"[[]\") == false);\n assert(candidate(\"[]]\") == false);\n assert(candidate(\"[[]][[\") == true);\n assert(candidate(\"[[][]]\") == true);\n assert(candidate(\"\") == false);\n assert(candidate(\"[[[[[[[[\") == false);\n assert(candidate(\"]]]]]]]]\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Concatenate list of strings into a single string\n \n*/\nstring concatenate(string[] strings) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = concatenate;\n\n assert(candidate([]) == \"\");\n assert(candidate([\"x\", \"y\", \"z\"]) == \"xyz\");\n assert(candidate([\"x\", \"y\", \"z\", \"w\", \"k\"]) == \"xyzwk\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n \n*/\nlong prime_fib(long n) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = prime_fib;\n\n assert(candidate(1L) == 2L);\n assert(candidate(2L) == 3L);\n assert(candidate(3L) == 5L);\n assert(candidate(4L) == 13L);\n assert(candidate(5L) == 89L);\n assert(candidate(6L) == 233L);\n assert(candidate(7L) == 1597L);\n assert(candidate(8L) == 28657L);\n assert(candidate(9L) == 514229L);\n assert(candidate(10L) == 433494437L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n other and return them in order (smaller number, larger number).\n \n*/\nTuple!(float, float) find_closest_elements(float[] numbers) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = find_closest_elements;\n\n assert(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2]) == tuple(3.9, 4.0));\n assert(candidate([1.0, 2.0, 5.9, 4.0, 5.0]) == tuple(5.0, 5.9));\n assert(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]) == tuple(2.0, 2.2));\n assert(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]) == tuple(2.0, 2.0));\n assert(candidate([1.1, 2.2, 3.1, 4.1, 5.1]) == tuple(2.2, 3.1));\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou have been tasked to write a function that receives \n a hexadecimal number as a string and counts the number of hexadecimal \n digits that are primes (prime number, or a prime, is a natural number \n greater than 1 that is not a product of two smaller natural numbers).\n Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n So you have to determine a number of the following digits: 2, 3, 5, 7, \n B (=decimal 11), D (=decimal 13).\n Note: you may assume the input is always correct or empty string, \n and symbols A,B,C,D,E,F are always uppercase.\n Examples:\n \n*/\nlong hex_key(string num) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = hex_key;\n\n assert(candidate(\"AB\") == 1L);\n assert(candidate(\"1077E\") == 2L);\n assert(candidate(\"ABED1A33\") == 4L);\n assert(candidate(\"2020\") == 2L);\n assert(candidate(\"123456789ABCDEF0\") == 6L);\n assert(candidate(\"112233445566778899AABBCCDDEEFF00\") == 12L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nComplete the function that takes two integers and returns \n the product of their unit digits.\n Assume the input is always valid.\n Examples:\n \n*/\nlong multiply(long a, long b) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = multiply;\n\n assert(candidate(148L, 412L) == 16L);\n assert(candidate(19L, 28L) == 72L);\n assert(candidate(2020L, 1851L) == 0L);\n assert(candidate(14L, -15L) == 20L);\n assert(candidate(76L, 67L) == 42L);\n assert(candidate(17L, 27L) == 49L);\n assert(candidate(0L, 1L) == 0L);\n assert(candidate(0L, 0L) == 0L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Given list of numbers (of at least two elements), apply a linear transform to that list,\n such that the smallest number will become 0 and the largest will become 1\n \n*/\nfloat[] rescale_to_unit(float[] numbers) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = rescale_to_unit;\n\n assert(candidate([2.0, 49.9]) == [0.0, 1.0]);\n assert(candidate([100.0, 49.9]) == [1.0, 0.0]);\n assert(candidate([1.0, 2.0, 3.0, 4.0, 5.0]) == [0.0, 0.25, 0.5, 0.75, 1.0]);\n assert(candidate([2.0, 1.0, 5.0, 3.0, 4.0]) == [0.25, 0.0, 1.0, 0.5, 0.75]);\n assert(candidate([12.0, 11.0, 15.0, 13.0, 14.0]) == [0.25, 0.0, 1.0, 0.5, 0.75]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nGiven a positive integer n, return the product of the odd digits.\n Return 0 if all digits are even.\n For example:\n \n*/\nlong digits(long n) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = digits;\n\n assert(candidate(5L) == 5L);\n assert(candidate(54L) == 5L);\n assert(candidate(120L) == 1L);\n assert(candidate(5014L) == 5L);\n assert(candidate(98765L) == 315L);\n assert(candidate(5576543L) == 2625L);\n assert(candidate(2468L) == 0L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou will be given the name of a class (a string) and a list of extensions.\n The extensions are to be used to load additional classes to the class. The\n strength of the extension is as follows: Let CAP be the number of the uppercase\n letters in the extension's name, and let SM be the number of lowercase letters \n in the extension's name, the strength is given by the fraction CAP - SM. \n You should find the strongest extension and return a string in this \n format: ClassName.StrongestExtensionName.\n If there are two or more extensions with the same strength, you should\n choose the one that comes first in the list.\n For example, if you are given \"Slices\" as the class and a list of the\n extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n (its strength is -1).\n Example:\n \n*/\nstring Strongest_Extension(string class_name, string[] extensions) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = Strongest_Extension;\n\n assert(candidate(\"Watashi\", [\"tEN\", \"niNE\", \"eIGHt8OKe\"]) == \"Watashi.eIGHt8OKe\");\n assert(candidate(\"Boku123\", [\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"]) == \"Boku123.YEs.WeCaNe\");\n assert(candidate(\"__YESIMHERE\", [\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"]) == \"__YESIMHERE.NuLl__\");\n assert(candidate(\"K\", [\"Ta\", \"TAR\", \"t234An\", \"cosSo\"]) == \"K.TAR\");\n assert(candidate(\"__HAHA\", [\"Tab\", \"123\", \"781345\", \"-_-\"]) == \"__HAHA.123\");\n assert(candidate(\"YameRore\", [\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"]) == \"YameRore.okIWILL123\");\n assert(candidate(\"finNNalLLly\", [\"Die\", \"NowW\", \"Wow\", \"WoW\"]) == \"finNNalLLly.WoW\");\n assert(candidate(\"_\", [\"Bb\", \"91245\"]) == \"_.Bb\");\n assert(candidate(\"Sp\", [\"671235\", \"Bb\"]) == \"Sp.671235\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nGiven a string representing a space separated lowercase letters, return a dictionary\n of the letter with the most repetition and containing the corresponding count.\n If several letters have the same occurrence, return all of them.\n \n Example:\n \n \n*/\nNullable!(long[string]) histogram(string test) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = histogram;\n\n{\n auto result = candidate(\"a b b a\");\n assert(!result.isNull && result.get == [\"a\": 2L, \"b\": 2L]);\n}\n\n{\n auto result = candidate(\"a b c a b\");\n assert(!result.isNull && result.get == [\"a\": 2L, \"b\": 2L]);\n}\n\n{\n auto result = candidate(\"a b c d g\");\n assert(!result.isNull && result.get == [\"a\": 1L, \"b\": 1L, \"c\": 1L, \"d\": 1L, \"g\": 1L]);\n}\n\n{\n auto result = candidate(\"r t g\");\n assert(!result.isNull && result.get == [\"r\": 1L, \"t\": 1L, \"g\": 1L]);\n}\n\n{\n auto result = candidate(\"b b b b a\");\n assert(!result.isNull && result.get == [\"b\": 4L]);\n}\n\n{\n auto result = candidate(\"r t g\");\n assert(!result.isNull && result.get == [\"r\": 1L, \"t\": 1L, \"g\": 1L]);\n}\n\n{\n auto result = candidate(\"\");\n assert(result.isNull);\n}\n\n{\n auto result = candidate(\"a\");\n assert(!result.isNull && result.get == [\"a\": 1L]);\n}\n\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n pairs_sum_to_zero takes a list of integers as an input.\n it returns True if there are two distinct elements in the list that\n sum to zero, and False otherwise.\n \n*/\nbool pairs_sum_to_zero(long[] l) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = pairs_sum_to_zero;\n\n assert(candidate([1L, 3L, 5L, 0L]) == false);\n assert(candidate([1L, 3L, -2L, 1L]) == false);\n assert(candidate([1L, 2L, 3L, 7L]) == false);\n assert(candidate([2L, 4L, -5L, 3L, 5L, 7L]) == true);\n assert(candidate([1L]) == false);\n assert(candidate([-3L, 9L, -1L, 3L, 2L, 30L]) == true);\n assert(candidate([-3L, 9L, -1L, 3L, 2L, 31L]) == true);\n assert(candidate([-3L, 9L, -1L, 4L, 2L, 30L]) == false);\n assert(candidate([-3L, 9L, -1L, 4L, 2L, 31L]) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Write a function that accepts two lists of strings and returns the list that has \n total number of chars in the all strings of the list less than the other list.\n\n if the two lists have the same number of chars, return the first list.\n\n Examples\n \n*/\nstring[] total_match(string[] lst1, string[] lst2) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = total_match;\n\n assert(candidate([], []) == []);\n assert(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\"]) == [\"hi\", \"hi\"]);\n assert(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"]) == [\"hi\", \"admin\"]);\n assert(candidate([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"]) == [\"4\"]);\n assert(candidate([\"hi\", \"admin\"], [\"hI\", \"Hi\"]) == [\"hI\", \"Hi\"]);\n assert(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"]) == [\"hI\", \"hi\", \"hi\"]);\n assert(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hii\"]) == [\"hi\", \"admin\"]);\n assert(candidate([], [\"this\"]) == []);\n assert(candidate([\"this\"], []) == []);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nCircular shift the digits of the integer x, shift the digits right by shift\n and return the result as a string.\n If shift > number of digits, return digits reversed.\n \n*/\nstring circular_shift(long x, long shift) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = circular_shift;\n\n assert(candidate(100L, 2L) == \"001\");\n assert(candidate(12L, 2L) == \"12\");\n assert(candidate(97L, 8L) == \"79\");\n assert(candidate(12L, 1L) == \"21\");\n assert(candidate(11L, 101L) == \"11\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nReturn True is list elements are monotonically increasing or decreasing.\n \n*/\nbool monotonic(long[] l) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = monotonic;\n\n assert(candidate([1L, 2L, 4L, 10L]) == true);\n assert(candidate([1L, 2L, 4L, 20L]) == true);\n assert(candidate([1L, 20L, 4L, 10L]) == false);\n assert(candidate([4L, 1L, 0L, -10L]) == true);\n assert(candidate([4L, 1L, 1L, 0L]) == true);\n assert(candidate([1L, 2L, 3L, 2L, 5L, 60L]) == false);\n assert(candidate([1L, 2L, 3L, 4L, 5L, 60L]) == true);\n assert(candidate([9L, 9L, 9L, 9L]) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nEvaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n Example\n \n*/\nbool is_equal_to_sum_even(long n) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = is_equal_to_sum_even;\n\n assert(candidate(4L) == false);\n assert(candidate(6L) == false);\n assert(candidate(8L) == true);\n assert(candidate(10L) == true);\n assert(candidate(11L) == false);\n assert(candidate(12L) == true);\n assert(candidate(13L) == false);\n assert(candidate(16L) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Input to this function is a string representing musical notes in a special ASCII format.\n Your task is to parse this string and return list of integers corresponding to how many beats does each\n not last.\n\n Here is a legend:\n 'o' - whole note, lasts four beats\n 'o|' - half note, lasts two beats\n '.|' - quater note, lasts one beat\n\n \n*/\nlong[] parse_music(string music_string) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = parse_music;\n\n assert(candidate(\"\") == []);\n assert(candidate(\"o o o o\") == [4L, 4L, 4L, 4L]);\n assert(candidate(\".| .| .| .|\") == [1L, 1L, 1L, 1L]);\n assert(candidate(\"o| o| .| .| o o o o\") == [2L, 2L, 1L, 1L, 4L, 4L, 4L, 4L]);\n assert(candidate(\"o| .| o| .| o o| o o|\") == [2L, 1L, 2L, 1L, 4L, 2L, 4L, 2L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\"\n This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n \n Examples:\n \n*/\nlong sum_squares(long[] lst) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = sum_squares;\n\n assert(candidate([1L, 2L, 3L]) == 6L);\n assert(candidate([1L, 4L, 9L]) == 14L);\n assert(candidate([]) == 0L);\n assert(candidate([1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L]) == 9L);\n assert(candidate([-1L, -1L, -1L, -1L, -1L, -1L, -1L, -1L, -1L]) == -3L);\n assert(candidate([0L]) == 0L);\n assert(candidate([-1L, -5L, 2L, -1L, -5L]) == -126L);\n assert(candidate([-56L, -99L, 1L, 0L, -2L]) == 3030L);\n assert(candidate([-1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, -1L]) == 0L);\n assert(candidate([-16L, -9L, -2L, 36L, 36L, 26L, -20L, 25L, -40L, 20L, -4L, 12L, -26L, 35L, 37L]) == -14196L);\n assert(candidate([-1L, -3L, 17L, -1L, -15L, 13L, -1L, 14L, -14L, -12L, -5L, 14L, -14L, 6L, 13L, 11L, 16L, 16L, 4L, 10L]) == -1448L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n triples_sum_to_zero takes a list of integers as an input.\n it returns True if there are three distinct elements in the list that\n sum to zero, and False otherwise.\n\n \n*/\nbool triples_sum_to_zero(long[] l) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = triples_sum_to_zero;\n\n assert(candidate([1L, 3L, 5L, 0L]) == false);\n assert(candidate([1L, 3L, 5L, -1L]) == false);\n assert(candidate([1L, 3L, -2L, 1L]) == true);\n assert(candidate([1L, 2L, 3L, 7L]) == false);\n assert(candidate([1L, 2L, 5L, 7L]) == false);\n assert(candidate([2L, 4L, -5L, 3L, 9L, 7L]) == true);\n assert(candidate([1L]) == false);\n assert(candidate([1L, 3L, 5L, -100L]) == false);\n assert(candidate([100L, 3L, 5L, -100L]) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n brackets is a string of \"<\" and \">\".\n return True if every opening bracket has a corresponding closing bracket.\n\n \n*/\nbool correct_bracketing(string brackets) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = correct_bracketing;\n\n assert(candidate(\"<>\") == true);\n assert(candidate(\"<<><>>\") == true);\n assert(candidate(\"<><><<><>><>\") == true);\n assert(candidate(\"<><><<<><><>><>><<><><<>>>\") == true);\n assert(candidate(\"<<<><>>>>\") == false);\n assert(candidate(\"><<>\") == false);\n assert(candidate(\"<\") == false);\n assert(candidate(\"<<<<\") == false);\n assert(candidate(\">\") == false);\n assert(candidate(\"<<>\") == false);\n assert(candidate(\"<><><<><>><>><<>\") == false);\n assert(candidate(\"<><><<><>><>>><>\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nWrite a function that takes an array of numbers as input and returns \n the number of elements in the array that are greater than 10 and both \n first and last digits of a number are odd (1, 3, 5, 7, 9).\n For example:\n \n*/\nlong specialFilter(long[] nums) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = specialFilter;\n\n assert(candidate([5L, -2L, 1L, -5L]) == 0L);\n assert(candidate([15L, -73L, 14L, -15L]) == 1L);\n assert(candidate([33L, -2L, -3L, 45L, 21L, 109L]) == 2L);\n assert(candidate([43L, -12L, 93L, 125L, 121L, 109L]) == 4L);\n assert(candidate([71L, -2L, -33L, 75L, 21L, 19L]) == 3L);\n assert(candidate([1L]) == 0L);\n assert(candidate([]) == 0L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given a dictionary, return True if all keys are strings in lower \n case or all keys are strings in upper case, else return False.\n The function should return False is the given dictionary is empty.\n Examples:\n \n*/\nbool check_dict_case(Nullable!(string[string]) dict) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = check_dict_case;\n\n assert(candidate([\"p\": \"pineapple\", \"b\": \"banana\"].nullable) == true);\n assert(candidate([\"p\": \"pineapple\", \"A\": \"banana\", \"B\": \"banana\"].nullable) == false);\n assert(candidate([\"p\": \"pineapple\", \"5\": \"banana\", \"a\": \"apple\"].nullable) == false);\n assert(candidate([\"Name\": \"John\", \"Age\": \"36\", \"City\": \"Houston\"].nullable) == false);\n assert(candidate([\"STATE\": \"NC\", \"ZIP\": \"12345\"].nullable) == true);\n assert(candidate([\"fruit\": \"Orange\", \"taste\": \"Sweet\"].nullable) == true);\n assert(candidate(Nullable!(string[string]).init) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nThe FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fibfib(0) == 0\n fibfib(1) == 0\n fibfib(2) == 1\n fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n \n*/\nlong fibfib(long n) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = fibfib;\n\n assert(candidate(2L) == 1L);\n assert(candidate(1L) == 0L);\n assert(candidate(5L) == 4L);\n assert(candidate(8L) == 24L);\n assert(candidate(10L) == 81L);\n assert(candidate(12L) == 274L);\n assert(candidate(14L) == 927L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou are given a list of numbers.\n You need to return the sum of squared numbers in the given list,\n round each element in the list to the upper int(Ceiling) first.\n Examples:\n \n\n \n*/\nlong sum_squares(float[] lst) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = sum_squares;\n\n assert(candidate([1.0, 2.0, 3.0]) == 14L);\n assert(candidate([1.0, 2.0, 3.0]) == 14L);\n assert(candidate([1.0, 3.0, 5.0, 7.0]) == 84L);\n assert(candidate([1.4, 4.2, 0.0]) == 29L);\n assert(candidate([-2.4, 1.0, 1.0]) == 6L);\n assert(candidate([100.0, 1.0, 15.0, 2.0]) == 10230L);\n assert(candidate([10000.0, 10000.0]) == 200000000L);\n assert(candidate([-1.4, 4.6, 6.3]) == 75L);\n assert(candidate([-1.4, 17.9, 18.9, 19.9]) == 1086L);\n assert(candidate([0.0]) == 0L);\n assert(candidate([-1.0]) == 1L);\n assert(candidate([-1.0, 1.0, 0.0]) == 2L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_85_add", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nGiven a non-empty list of integers lst. add the even elements that are at odd indices..\n\n\n Examples:\n \n*/\nlong add(long[] lst) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = add;\n\n assert(candidate([4L, 88L]) == 88L);\n assert(candidate([4L, 5L, 6L, 7L, 2L, 122L]) == 122L);\n assert(candidate([4L, 0L, 6L, 7L]) == 0L);\n assert(candidate([4L, 4L, 6L, 8L]) == 12L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nReturn sorted unique elements in a list\n \n*/\nlong[] unique(long[] l) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = unique;\n\n assert(candidate([5L, 3L, 5L, 2L, 3L, 3L, 9L, 0L, 123L]) == [0L, 2L, 3L, 5L, 9L, 123L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given a string text, replace all spaces in it with underscores, \n and if a string has more than 2 consecutive spaces, \n then replace all consecutive spaces with - \n \n \n*/\nstring fix_spaces(string text) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = fix_spaces;\n\n assert(candidate(\"Example\") == \"Example\");\n assert(candidate(\"Mudasir Hanif \") == \"Mudasir_Hanif_\");\n assert(candidate(\"Yellow Yellow Dirty Fellow\") == \"Yellow_Yellow__Dirty__Fellow\");\n assert(candidate(\"Exa mple\") == \"Exa-mple\");\n assert(candidate(\" Exa 1 2 2 mple\") == \"-Exa_1_2_2_mple\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nReturn 2^n modulo p (be aware of numerics).\n \n*/\nlong modp(long n, long p) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = modp;\n\n assert(candidate(3L, 5L) == 3L);\n assert(candidate(1101L, 101L) == 2L);\n assert(candidate(0L, 101L) == 1L);\n assert(candidate(3L, 11L) == 8L);\n assert(candidate(100L, 101L) == 1L);\n assert(candidate(30L, 5L) == 4L);\n assert(candidate(31L, 5L) == 3L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou have to write a function which validates a given date string and\n returns True if the date is valid otherwise False.\n The date is valid if all of the following rules are satisfied:\n 1. The date string is not empty.\n 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n 3. The months should not be less than 1 or higher than 12.\n 4. The date should be in the format: mm-dd-yyyy\n\n \n \n \n \n \n*/\nbool valid_date(string date) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = valid_date;\n\n assert(candidate(\"03-11-2000\") == true);\n assert(candidate(\"15-01-2012\") == false);\n assert(candidate(\"04-0-2040\") == false);\n assert(candidate(\"06-04-2020\") == true);\n assert(candidate(\"01-01-2007\") == true);\n assert(candidate(\"03-32-2011\") == false);\n assert(candidate(\"\") == false);\n assert(candidate(\"04-31-3000\") == false);\n assert(candidate(\"06-06-2005\") == true);\n assert(candidate(\"21-31-2000\") == false);\n assert(candidate(\"04-12-2003\") == true);\n assert(candidate(\"04122003\") == false);\n assert(candidate(\"20030412\") == false);\n assert(candidate(\"2003-04\") == false);\n assert(candidate(\"2003-04-12\") == false);\n assert(candidate(\"04-2003\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Write a function that takes a string and returns an ordered version of it.\n Ordered version of string, is a string where all words (separated by space)\n are replaced by a new word where all the characters arranged in\n ascending order based on ascii value.\n Note: You should keep the order of words and blank spaces in the sentence.\n\n For example:\n \n*/\nstring anti_shuffle(string s) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = anti_shuffle;\n\n assert(candidate(\"Hi\") == \"Hi\");\n assert(candidate(\"hello\") == \"ehllo\");\n assert(candidate(\"number\") == \"bemnru\");\n assert(candidate(\"abcd\") == \"abcd\");\n assert(candidate(\"Hello World!!!\") == \"Hello !!!Wdlor\");\n assert(candidate(\"\") == \"\");\n assert(candidate(\"Hi. My name is Mister Robot. How are you?\") == \".Hi My aemn is Meirst .Rboot How aer ?ouy\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given a list of numbers, return whether or not they are sorted\n in ascending order. If list has more than 1 duplicate of the same\n number, return False. Assume no negative numbers and only integers.\n\n Examples\n \n*/\nbool is_sorted(long[] lst) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = is_sorted;\n\n assert(candidate([5L]) == true);\n assert(candidate([1L, 2L, 3L, 4L, 5L]) == true);\n assert(candidate([1L, 3L, 2L, 4L, 5L]) == false);\n assert(candidate([1L, 2L, 3L, 4L, 5L, 6L]) == true);\n assert(candidate([1L, 2L, 3L, 4L, 5L, 6L, 7L]) == true);\n assert(candidate([1L, 3L, 2L, 4L, 5L, 6L, 7L]) == false);\n assert(candidate([]) == true);\n assert(candidate([1L]) == true);\n assert(candidate([3L, 2L, 1L]) == false);\n assert(candidate([1L, 2L, 2L, 2L, 3L, 4L]) == false);\n assert(candidate([1L, 2L, 3L, 3L, 3L, 4L]) == false);\n assert(candidate([1L, 2L, 2L, 3L, 3L, 4L]) == true);\n assert(candidate([1L, 2L, 3L, 4L]) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou are given a string s.\n Your task is to check if the string is happy or not.\n A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n For example:\n \n*/\nbool is_happy(string s) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = is_happy;\n\n assert(candidate(\"a\") == false);\n assert(candidate(\"aa\") == false);\n assert(candidate(\"abcd\") == true);\n assert(candidate(\"aabb\") == false);\n assert(candidate(\"adb\") == true);\n assert(candidate(\"xyy\") == false);\n assert(candidate(\"iopaxpoi\") == true);\n assert(candidate(\"iopaxioi\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Write a function that returns True if the object q will fly, and False otherwise.\n The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n\n Example:\n # 1+2 is less than the maximum possible weight, but it's unbalanced.\n\n # it's balanced, but 3+2+3 is more than the maximum possible weight.\n\n # 3+2+3 is less than the maximum possible weight, and it's balanced.\n\n # 3 is less than the maximum possible weight, and it's balanced.\n \n*/\nbool will_it_fly(long[] q, long w) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = will_it_fly;\n\n assert(candidate([3L, 2L, 3L], 9L) == true);\n assert(candidate([1L, 2L], 5L) == false);\n assert(candidate([3L], 5L) == true);\n assert(candidate([3L, 2L, 3L], 1L) == false);\n assert(candidate([1L, 2L, 3L], 6L) == false);\n assert(candidate([5L], 5L) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given an array of non-negative integers, return a copy of the given array after sorting,\n you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n or sort it in descending order if the sum( first index value, last index value) is even.\n\n Note:\n * don't change the given array.\n\n Examples:\n \n*/\nlong[] sort_array(long[] array) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = sort_array;\n\n assert(candidate([]) == []);\n assert(candidate([5L]) == [5L]);\n assert(candidate([2L, 4L, 3L, 0L, 1L, 5L]) == [0L, 1L, 2L, 3L, 4L, 5L]);\n assert(candidate([2L, 4L, 3L, 0L, 1L, 5L, 6L]) == [6L, 5L, 4L, 3L, 2L, 1L, 0L]);\n assert(candidate([2L, 1L]) == [1L, 2L]);\n assert(candidate([15L, 42L, 87L, 32L, 11L, 0L]) == [0L, 11L, 15L, 32L, 42L, 87L]);\n assert(candidate([21L, 14L, 23L, 11L]) == [23L, 21L, 14L, 11L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nImplement a function that takes an non-negative integer and returns an array of the first n\n integers that are prime numbers and less than n.\n for example:\n \n*/\nlong[] count_up_to(long n) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = count_up_to;\n\n assert(candidate(5L) == [2L, 3L]);\n assert(candidate(6L) == [2L, 3L, 5L]);\n assert(candidate(7L) == [2L, 3L, 5L]);\n assert(candidate(10L) == [2L, 3L, 5L, 7L]);\n assert(candidate(0L) == []);\n assert(candidate(22L) == [2L, 3L, 5L, 7L, 11L, 13L, 17L, 19L]);\n assert(candidate(1L) == []);\n assert(candidate(18L) == [2L, 3L, 5L, 7L, 11L, 13L, 17L]);\n assert(candidate(47L) == [2L, 3L, 5L, 7L, 11L, 13L, 17L, 19L, 23L, 29L, 31L, 37L, 41L, 43L]);\n assert(candidate(101L) == [2L, 3L, 5L, 7L, 11L, 13L, 17L, 19L, 23L, 29L, 31L, 37L, 41L, 43L, 47L, 53L, 59L, 61L, 67L, 71L, 73L, 79L, 83L, 89L, 97L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Out of list of strings, return the longest one. Return the first one in case of multiple\n strings of the same length. Return None in case the input list is empty.\n \n*/\nNullable!(string) longest(string[] strings) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = longest;\n\n{\n auto result = candidate([]);\n assert(result.isNull);\n}\n\n{\n auto result = candidate([\"x\", \"y\", \"z\"]);\n assert(!result.isNull && result.get == \"x\");\n}\n\n{\n auto result = candidate([\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"]);\n assert(!result.isNull && result.get == \"zzzz\");\n}\n\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n reverse the resulting array, and then replace each digit by its corresponding name from\n \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n\n For example:\n \n If the array is empty, return an empty array:\n \n If the array has any strange number ignore it:\n \n*/\nstring[] by_length(long[] arr) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = by_length;\n\n assert(candidate([2L, 1L, 1L, 4L, 5L, 8L, 2L, 3L]) == [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]);\n assert(candidate([]) == []);\n assert(candidate([1L, -1L, 55L]) == [\"One\"]);\n assert(candidate([1L, -1L, 3L, 2L]) == [\"Three\", \"Two\", \"One\"]);\n assert(candidate([9L, 4L, 8L]) == [\"Nine\", \"Eight\", \"Four\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_106_f", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Implement the function f that takes n as a parameter,\n 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\n or the sum of numbers from 1 to i otherwise.\n i starts from 1.\n the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n Example:\n \n*/\nlong[] f(long n) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = f;\n\n assert(candidate(5L) == [1L, 2L, 6L, 24L, 15L]);\n assert(candidate(7L) == [1L, 2L, 6L, 24L, 15L, 720L, 28L]);\n assert(candidate(1L) == [1L]);\n assert(candidate(3L) == [1L, 2L, 6L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nReturn the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n \n*/\nlong fizz_buzz(long n) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = fizz_buzz;\n\n assert(candidate(50L) == 0L);\n assert(candidate(78L) == 2L);\n assert(candidate(79L) == 3L);\n assert(candidate(100L) == 3L);\n assert(candidate(200L) == 6L);\n assert(candidate(4000L) == 192L);\n assert(candidate(10000L) == 639L);\n assert(candidate(100000L) == 8026L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Given a positive floating point number, it can be decomposed into\n and integer part (largest integer smaller than given number) and decimals\n (leftover part always smaller than 1).\n\n Return the decimal part of the number.\n \n*/\nfloat truncate_number(float number) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = truncate_number;\n\n assert(candidate(3.5) == 0.5);\n assert(candidate(1.25) == 0.25);\n assert(candidate(123.0) == 0.0);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n Empty sum should be equal to 0 and empty product should be equal to 1.\n \n*/\nTuple!(long, long) sum_product(long[] numbers) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = sum_product;\n\n assert(candidate([]) == tuple(0L, 1L));\n assert(candidate([1L, 1L, 1L]) == tuple(3L, 1L));\n assert(candidate([100L, 0L]) == tuple(100L, 0L));\n assert(candidate([3L, 5L, 7L]) == tuple(15L, 105L));\n assert(candidate([10L]) == tuple(10L, 10L));\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n You are given a 2 dimensional data, as a nested lists,\n which is similar to matrix, however, unlike matrices,\n each row may contain a different number of columns.\n Given lst, and integer x, find integers x in the list,\n and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n each tuple is a coordinate - (row, columns), starting with 0.\n Sort coordinates initially by rows in ascending order.\n Also, sort coordinates of the row by columns in descending order.\n \n Examples:\n \n*/\nTuple!(long, long)[] get_row(long[][] lst, long x) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = get_row;\n\n assert(candidate([[1L, 2L, 3L, 4L, 5L, 6L], [1L, 2L, 3L, 4L, 1L, 6L], [1L, 2L, 3L, 4L, 5L, 1L]], 1L) == [tuple(0L, 0L), tuple(1L, 4L), tuple(1L, 0L), tuple(2L, 5L), tuple(2L, 0L)]);\n assert(candidate([[1L, 2L, 3L, 4L, 5L, 6L], [1L, 2L, 3L, 4L, 5L, 6L], [1L, 2L, 3L, 4L, 5L, 6L], [1L, 2L, 3L, 4L, 5L, 6L], [1L, 2L, 3L, 4L, 5L, 6L], [1L, 2L, 3L, 4L, 5L, 6L]], 2L) == [tuple(0L, 1L), tuple(1L, 1L), tuple(2L, 1L), tuple(3L, 1L), tuple(4L, 1L), tuple(5L, 1L)]);\n assert(candidate([[1L, 2L, 3L, 4L, 5L, 6L], [1L, 2L, 3L, 4L, 5L, 6L], [1L, 1L, 3L, 4L, 5L, 6L], [1L, 2L, 1L, 4L, 5L, 6L], [1L, 2L, 3L, 1L, 5L, 6L], [1L, 2L, 3L, 4L, 1L, 6L], [1L, 2L, 3L, 4L, 5L, 1L]], 1L) == [tuple(0L, 0L), tuple(1L, 0L), tuple(2L, 1L), tuple(2L, 0L), tuple(3L, 2L), tuple(3L, 0L), tuple(4L, 3L), tuple(4L, 0L), tuple(5L, 4L), tuple(5L, 0L), tuple(6L, 5L), tuple(6L, 0L)]);\n assert(candidate([], 1L) == []);\n assert(candidate([[1L]], 2L) == []);\n assert(candidate([[], [1L], [1L, 2L, 3L]], 3L) == [tuple(2L, 2L)]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n You're a hungry rabbit, and you already have eaten a certain number of carrots,\n but now you need to eat more carrots to complete the day's meals.\n you should return an array of [ total number of eaten carrots after your meals,\n the number of carrots left after your meals ]\n if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n \n Example:\n \n Variables:\n @number : integer\n the number of carrots that you have eaten.\n @need : integer\n the number of carrots that you need to eat.\n @remaining : integer\n the number of remaining carrots thet exist in stock\n \n Constrain:\n * 0 <= number <= 1000\n * 0 <= need <= 1000\n * 0 <= remaining <= 1000\n\n Have fun :)\n \n*/\nlong[] eat(long number, long need, long remaining) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = eat;\n\n assert(candidate(5L, 6L, 10L) == [11L, 4L]);\n assert(candidate(4L, 8L, 9L) == [12L, 1L]);\n assert(candidate(1L, 10L, 10L) == [11L, 0L]);\n assert(candidate(2L, 11L, 5L) == [7L, 0L]);\n assert(candidate(4L, 5L, 7L) == [9L, 2L]);\n assert(candidate(4L, 5L, 1L) == [5L, 0L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nGiven a positive integer N, return the total sum of its digits in binary.\n \n Example\n \n Variables:\n @N integer\n Constraints: 0 \u2264 N \u2264 10000.\n Output:\n a string of binary number\n \n*/\nstring solve(long N) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = solve;\n\n assert(candidate(1000L) == \"1\");\n assert(candidate(150L) == \"110\");\n assert(candidate(147L) == \"1100\");\n assert(candidate(333L) == \"1001\");\n assert(candidate(963L) == \"10010\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou are given a list of integers.\n You need to find the largest prime value and return the sum of its digits.\n\n Examples:\n \n*/\nlong skjkasdkd(long[] lst) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = skjkasdkd;\n\n assert(candidate([0L, 3L, 2L, 1L, 3L, 5L, 7L, 4L, 5L, 5L, 5L, 2L, 181L, 32L, 4L, 32L, 3L, 2L, 32L, 324L, 4L, 3L]) == 10L);\n assert(candidate([1L, 0L, 1L, 8L, 2L, 4597L, 2L, 1L, 3L, 40L, 1L, 2L, 1L, 2L, 4L, 2L, 5L, 1L]) == 25L);\n assert(candidate([1L, 3L, 1L, 32L, 5107L, 34L, 83278L, 109L, 163L, 23L, 2323L, 32L, 30L, 1L, 9L, 3L]) == 13L);\n assert(candidate([0L, 724L, 32L, 71L, 99L, 32L, 6L, 0L, 5L, 91L, 83L, 0L, 5L, 6L]) == 11L);\n assert(candidate([0L, 81L, 12L, 3L, 1L, 21L]) == 3L);\n assert(candidate([0L, 8L, 1L, 2L, 1L, 7L]) == 7L);\n assert(candidate([8191L]) == 19L);\n assert(candidate([8191L, 123456L, 127L, 7L]) == 19L);\n assert(candidate([127L, 97L, 8192L]) == 10L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given an array arr of integers, find the minimum number of elements that\n need to be changed to make the array palindromic. A palindromic array is an array that\n is read the same backwards and forwards. In one change, you can change one element to any other element.\n\n For example:\n \n*/\nlong smallest_change(long[] arr) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = smallest_change;\n\n assert(candidate([1L, 2L, 3L, 5L, 4L, 7L, 9L, 6L]) == 4L);\n assert(candidate([1L, 2L, 3L, 4L, 3L, 2L, 2L]) == 1L);\n assert(candidate([1L, 4L, 2L]) == 1L);\n assert(candidate([1L, 4L, 4L, 2L]) == 1L);\n assert(candidate([1L, 2L, 3L, 2L, 1L]) == 0L);\n assert(candidate([3L, 1L, 1L, 3L]) == 0L);\n assert(candidate([1L]) == 0L);\n assert(candidate([0L, 1L]) == 1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nIt is the last week of the semester and the teacher has to give the grades\n to students. The teacher has been making her own algorithm for grading.\n The only problem is, she has lost the code she used for grading.\n She has given you a list of GPAs for some students and you have to write \n a function that can output a list of letter grades using the following table:\n GPA | Letter grade\n 4.0 A+\n > 3.7 A \n > 3.3 A- \n > 3.0 B+\n > 2.7 B \n > 2.3 B-\n > 2.0 C+\n > 1.7 C\n > 1.3 C-\n > 1.0 D+ \n > 0.7 D \n > 0.0 D-\n 0.0 E\n \n\n Example:\n \n*/\nstring[] numerical_letter_grade(float[] grades) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = numerical_letter_grade;\n\n assert(candidate([4.0, 3L, 1.7, 2L, 3.5]) == [\"A+\", \"B\", \"C-\", \"C\", \"A-\"]);\n assert(candidate([1.2]) == [\"D+\"]);\n assert(candidate([0.5]) == [\"D-\"]);\n assert(candidate([0.0]) == [\"E\"]);\n assert(candidate([1.0, 0.3, 1.5, 2.8, 3.3]) == [\"D\", \"D-\", \"C-\", \"B\", \"B+\"]);\n assert(candidate([0.0, 0.7]) == [\"E\", \"D-\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given the lengths of the three sides of a triangle. Return the area of\n the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n Otherwise return -1\n Three sides make a valid triangle when the sum of any two sides is greater \n than the third side.\n Example:\n \n*/\nfloat triangle_area(long a, long b, long c) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = triangle_area;\n\n assert(candidate(3L, 4L, 5L) == 6.0);\n assert(candidate(1L, 2L, 10L) == -1L);\n assert(candidate(4L, 8L, 5L) == 8.18);\n assert(candidate(2L, 2L, 2L) == 1.73);\n assert(candidate(1L, 2L, 3L) == -1L);\n assert(candidate(10L, 5L, 7L) == 16.25);\n assert(candidate(2L, 6L, 3L) == -1L);\n assert(candidate(1L, 1L, 1L) == 0.43);\n assert(candidate(2L, 2L, 10L) == -1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Check if two words have the same characters.\n \n*/\nbool same_chars(string s0, string s1) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = same_chars;\n\n assert(candidate(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\") == true);\n assert(candidate(\"abcd\", \"dddddddabc\") == true);\n assert(candidate(\"dddddddabc\", \"abcd\") == true);\n assert(candidate(\"eabcd\", \"dddddddabc\") == false);\n assert(candidate(\"abcd\", \"dddddddabcf\") == false);\n assert(candidate(\"eabcdzzzz\", \"dddzzzzzzzddddabc\") == false);\n assert(candidate(\"aabb\", \"aaccc\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given an array of integers nums, find the minimum sum of any non-empty sub-array\n of nums.\n Example\n \n*/\nlong minSubArraySum(long[] nums) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = minSubArraySum;\n\n assert(candidate([2L, 3L, 4L, 1L, 2L, 4L]) == 1L);\n assert(candidate([-1L, -2L, -3L]) == -6L);\n assert(candidate([-1L, -2L, -3L, 2L, -10L]) == -14L);\n assert(candidate([-9999999999999999L]) == -9999999999999999L);\n assert(candidate([0L, 10L, 20L, 1000000L]) == 0L);\n assert(candidate([-1L, -2L, -3L, 10L, -5L]) == -6L);\n assert(candidate([100L, -1L, -2L, -3L, 10L, -5L]) == -6L);\n assert(candidate([10L, 11L, 13L, 8L, 3L, 4L]) == 3L);\n assert(candidate([100L, -33L, 32L, -1L, 0L, -2L]) == -33L);\n assert(candidate([-10L]) == -10L);\n assert(candidate([7L]) == 7L);\n assert(candidate([1L, -1L]) == -1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nGiven a string s and a natural number n, you have been tasked to implement \n a function that returns a list of all words from string s that contain exactly \n n consonants, in order these words appear in the string s.\n If the string s is empty then the function should return an empty list.\n Note: you may assume the input string contains only letters and spaces.\n Examples:\n \n*/\nstring[] select_words(string s, long n) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = select_words;\n\n assert(candidate(\"Mary had a little lamb\", 4L) == [\"little\"]);\n assert(candidate(\"Mary had a little lamb\", 3L) == [\"Mary\", \"lamb\"]);\n assert(candidate(\"simple white space\", 2L) == []);\n assert(candidate(\"Hello world\", 4L) == [\"world\"]);\n assert(candidate(\"Uncle sam\", 3L) == [\"Uncle\"]);\n assert(candidate(\"\", 4L) == []);\n assert(candidate(\"a b c d e f\", 1L) == [\"b\", \"c\", \"d\", \"f\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Return list of all prefixes from shortest to longest of the input string\n \n*/\nstring[] all_prefixes(string string) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = all_prefixes;\n\n assert(candidate(\"\") == []);\n assert(candidate(\"asdfgh\") == [\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"]);\n assert(candidate(\"WWW\") == [\"W\", \"WW\", \"WWW\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Create a function that takes a value (string) representing a number\n and returns the closest integer to it. If the number is equidistant\n from two integers, round it away from zero.\n\n Examples\n \n Note:\n Rounding away from zero means that if the given number is equidistant\n from two integers, the one you should return is the one that is the\n farthest from zero. For example closest_integer(\"14.5\") should\n return 15 and closest_integer(\"-14.5\") should return -15.\n \n*/\nlong closest_integer(string value) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = closest_integer;\n\n assert(candidate(\"10\") == 10L);\n assert(candidate(\"14.5\") == 15L);\n assert(candidate(\"-15.5\") == -16L);\n assert(candidate(\"15.3\") == 15L);\n assert(candidate(\"0\") == 0L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nCreate a function which takes a string representing a file's name, and returns\n 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n A file's name is considered to be valid if and only if all the following conditions \n are met:\n - There should not be more than three digits ('0'-'9') in the file's name.\n - The file's name contains exactly one dot '.'\n - The substring before the dot should not be empty, and it starts with a letter from \n the latin alphapet ('a'-'z' and 'A'-'Z').\n - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n Examples:\n \n*/\nstring file_name_check(string file_name) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = file_name_check;\n\n assert(candidate(\"example.txt\") == \"Yes\");\n assert(candidate(\"1example.dll\") == \"No\");\n assert(candidate(\"s1sdf3.asd\") == \"No\");\n assert(candidate(\"K.dll\") == \"Yes\");\n assert(candidate(\"MY16FILE3.exe\") == \"Yes\");\n assert(candidate(\"His12FILE94.exe\") == \"No\");\n assert(candidate(\"_Y.txt\") == \"No\");\n assert(candidate(\"?aREYA.exe\") == \"No\");\n assert(candidate(\"/this_is_valid.dll\") == \"No\");\n assert(candidate(\"this_is_valid.wow\") == \"No\");\n assert(candidate(\"this_is_valid.txt\") == \"Yes\");\n assert(candidate(\"this_is_valid.txtexe\") == \"No\");\n assert(candidate(\"#this2_i4s_5valid.ten\") == \"No\");\n assert(candidate(\"@this1_is6_valid.exe\") == \"No\");\n assert(candidate(\"this_is_12valid.6exe4.txt\") == \"No\");\n assert(candidate(\"all.exe.txt\") == \"No\");\n assert(candidate(\"I563_No.exe\") == \"Yes\");\n assert(candidate(\"Is3youfault.txt\") == \"Yes\");\n assert(candidate(\"no_one#knows.dll\") == \"Yes\");\n assert(candidate(\"1I563_Yes3.exe\") == \"No\");\n assert(candidate(\"I563_Yes3.txtt\") == \"No\");\n assert(candidate(\"final..txt\") == \"No\");\n assert(candidate(\"final132\") == \"No\");\n assert(candidate(\"_f4indsartal132.\") == \"No\");\n assert(candidate(\".txt\") == \"No\");\n assert(candidate(\"s.\") == \"No\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou are given two intervals,\n where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n The given intervals are closed which means that the interval (start, end)\n includes both start and end.\n For each given interval, it is assumed that its start is less or equal its end.\n Your task is to determine whether the length of intersection of these two \n intervals is a prime number.\n Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n which its length is 1, which not a prime number.\n If the length of the intersection is a prime number, return \"YES\",\n otherwise, return \"NO\".\n If the two intervals don't intersect, return \"NO\".\n\n\n [input/output] samples:\n \n*/\nstring intersection(Tuple!(long, long) interval1, Tuple!(long, long) interval2) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = intersection;\n\n assert(candidate(tuple(1L, 2L), tuple(2L, 3L)) == \"NO\");\n assert(candidate(tuple(-1L, 1L), tuple(0L, 4L)) == \"NO\");\n assert(candidate(tuple(-3L, -1L), tuple(-5L, 5L)) == \"YES\");\n assert(candidate(tuple(-2L, 2L), tuple(-4L, 0L)) == \"YES\");\n assert(candidate(tuple(-11L, 2L), tuple(-1L, -1L)) == \"NO\");\n assert(candidate(tuple(1L, 2L), tuple(3L, 5L)) == \"NO\");\n assert(candidate(tuple(1L, 2L), tuple(1L, 2L)) == \"NO\");\n assert(candidate(tuple(-2L, -2L), tuple(-3L, -2L)) == \"NO\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nReturn the largest prime factor of n. Assume n > 1 and is not a prime.\n \n*/\nlong largest_prime_factor(long n) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = largest_prime_factor;\n\n assert(candidate(15L) == 5L);\n assert(candidate(27L) == 3L);\n assert(candidate(63L) == 7L);\n assert(candidate(330L) == 11L);\n assert(candidate(13195L) == 29L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Given a string, find out how many distinct characters (regardless of case) does it consist of\n \n*/\nlong count_distinct_characters(string string) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = count_distinct_characters;\n\n assert(candidate(\"\") == 0L);\n assert(candidate(\"abcde\") == 5L);\n assert(candidate(\"abcdecadeCADE\") == 5L);\n assert(candidate(\"aaaaAAAAaaaa\") == 1L);\n assert(candidate(\"Jerry jERRY JeRRRY\") == 5L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n You're given a list of deposit and withdrawal operations on a bank account that starts with\n zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n at that point function should return True. Otherwise it should return False.\n \n*/\nbool below_zero(long[] operations) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = below_zero;\n\n assert(candidate([]) == false);\n assert(candidate([1L, 2L, -3L, 1L, 2L, -3L]) == false);\n assert(candidate([1L, 2L, -4L, 5L, 6L]) == true);\n assert(candidate([1L, -1L, 2L, -2L, 5L, -5L, 4L, -4L]) == false);\n assert(candidate([1L, -1L, 2L, -2L, 5L, -5L, 4L, -5L]) == true);\n assert(candidate([1L, -2L, 2L, -2L, 5L, -5L, 4L, -4L]) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Find the shortest palindrome that begins with a supplied string.\n Algorithm idea is simple:\n - Find the longest postfix of supplied string that is a palindrome.\n - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n \n*/\nstring make_palindrome(string string) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = make_palindrome;\n\n assert(candidate(\"\") == \"\");\n assert(candidate(\"x\") == \"x\");\n assert(candidate(\"xyz\") == \"xyzyx\");\n assert(candidate(\"xyx\") == \"xyx\");\n assert(candidate(\"jerry\") == \"jerryrrej\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given a positive integer, obtain its roman numeral equivalent as a string,\n and return it in lowercase.\n Restrictions: 1 <= num <= 1000\n\n Examples:\n \n*/\nstring int_to_mini_roman(long number) \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = int_to_mini_roman;\n\n assert(candidate(19L) == \"xix\");\n assert(candidate(152L) == \"clii\");\n assert(candidate(251L) == \"ccli\");\n assert(candidate(426L) == \"cdxxvi\");\n assert(candidate(500L) == \"d\");\n assert(candidate(1L) == \"i\");\n assert(candidate(4L) == \"iv\");\n assert(candidate(43L) == \"xliii\");\n assert(candidate(90L) == \"xc\");\n assert(candidate(94L) == \"xciv\");\n assert(candidate(532L) == \"dxxxii\");\n assert(candidate(900L) == \"cm\");\n assert(candidate(994L) == \"cmxciv\");\n assert(candidate(1000L) == \"m\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - } -] \ No newline at end of file diff --git a/data/d-reworded.json b/data/d-reworded.json deleted file mode 100644 index c2468877092da1281ea13947c18981e91f9e7339..0000000000000000000000000000000000000000 --- a/data/d-reworded.json +++ /dev/null @@ -1,2342 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "d", - "prompt": "import std.math;\n/*\n For a given number n, find the largest number that divides n evenly, smaller than n\n >>> largest_divisor(15L)\n 5L\n \n*/\nlong largest_divisor(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = largest_divisor;\n\n assert(candidate(3L) == 1L);\n assert(candidate(7L) == 1L);\n assert(candidate(10L) == 5L);\n assert(candidate(100L) == 50L);\n assert(candidate(49L) == 7L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_47_median", - "language": "d", - "prompt": "import std.math;\n/*\nReturn median of elements in the array l.\n >>> median([3L, 1L, 2L, 4L, 5L])\n 3L\n >>> median([-10L, 4L, 6L, 1000L, 10L, 20L])\n 15.0\n \n*/\nfloat median(long[] l) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = median;\n\n assert(candidate([3L, 1L, 2L, 4L, 5L]) == 3L);\n assert(candidate([-10L, 4L, 6L, 1000L, 10L, 20L]) == 8.0);\n assert(candidate([5L]) == 5L);\n assert(candidate([6L, 5L]) == 5.5);\n assert(candidate([8L, 1L, 3L, 9L, 9L, 2L, 7L]) == 7L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "d", - "prompt": "import std.math;\n/*\n\n Given two arrays operator, and operand. The first array has basic algebra operations, and \n the second array is an array of integers. Use the two given arrays to build the algebric \n expression and return the evaluation of this expression.\n\n The basic algebra operations:\n Addition ( + ) \n Subtraction ( - ) \n Multiplication ( * ) \n Floor division ( // ) \n Exponentiation ( ** ) \n\n Example:\n operator['+', '*', '-']\n array = [2, 3, 4, 5]\n result = 2 + 3 * 4 - 5\n => result = 9\n\n Note:\n The length of operator array is equal to the length of operand array minus one.\n Operand is an array of of non-negative integers.\n Operator array has at least one operator, and operand array has at least two operands.\n\n \n*/\nlong do_algebra(string[] operator, long[] operand) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = do_algebra;\n\n assert(candidate([\"**\", \"*\", \"+\"], [2L, 3L, 4L, 5L]) == 37L);\n assert(candidate([\"+\", \"*\", \"-\"], [2L, 3L, 4L, 5L]) == 9L);\n assert(candidate([\"//\", \"*\"], [7L, 3L, 4L]) == 8L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "d", - "prompt": "import std.math;\n/*\nReturn maximum element in the array.\n >>> max_element([1L, 2L, 3L])\n 3L\n >>> max_element([5L, 3L, -5L, 2L, -3L, 3L, 9L, 0L, 123L, 1L, -10L])\n 123L\n \n*/\nlong max_element(long[] l) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = max_element;\n\n assert(candidate([1L, 2L, 3L]) == 3L);\n assert(candidate([5L, 3L, -5L, 2L, -3L, 3L, 9L, 0L, 124L, 1L, -10L]) == 124L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "d", - "prompt": "import std.math;\n/*\nCreate a function which returns the largest index of an element which\n is not greater than or equal to the element immediately preceding it. If\n no such element exists then return -1. The given array will not contain\n duplicate values.\n\n Examples:\n >>> can_arrange([1L, 2L, 4L, 3L, 5L])\n 3L\n >>> can_arrange([1L, 2L, 3L])\n -1L\n \n*/\nlong can_arrange(long[] arr) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = can_arrange;\n\n assert(candidate([1L, 2L, 4L, 3L, 5L]) == 3L);\n assert(candidate([1L, 2L, 4L, 5L]) == -1L);\n assert(candidate([1L, 4L, 2L, 5L, 6L, 7L, 8L, 9L, 10L]) == 2L);\n assert(candidate([4L, 8L, 5L, 7L, 3L]) == 4L);\n assert(candidate([]) == -1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "d", - "prompt": "import std.math;\n/*\n\n Imagine a road that's a perfectly straight infinitely long line.\n n cars are driving left to right; simultaneously, a different set of n cars\n are driving right to left. The two sets of cars start out being very far from\n each other. All cars move in the same speed. Two cars are said to collide\n when a car that's moving left to right hits a car that's moving right to left.\n However, the cars are infinitely sturdy and strong; as a result, they continue moving\n in their trajectory as if they did not collide.\n\n This function outputs the number of such collisions.\n \n*/\nlong car_race_collision(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = car_race_collision;\n\n assert(candidate(2L) == 4L);\n assert(candidate(3L) == 9L);\n assert(candidate(4L) == 16L);\n assert(candidate(8L) == 64L);\n assert(candidate(10L) == 100L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "d", - "prompt": "import std.math;\n/*\n\n Create a function that returns true if the last character\n of a given string is an alphabetical character and is not\n a part of a word, and false otherwise.\n Note: \"word\" is a group of characters separated by space.\n\n Examples:\n >>> check_if_last_char_is_a_letter(\"apple pie\")\n false\n >>> check_if_last_char_is_a_letter(\"apple pi e\")\n true\n >>> check_if_last_char_is_a_letter(\"apple pi e \")\n false\n >>> check_if_last_char_is_a_letter(\"\")\n false\n \n*/\nbool check_if_last_char_is_a_letter(string txt) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = check_if_last_char_is_a_letter;\n\n assert(candidate(\"apple\") == false);\n assert(candidate(\"apple pi e\") == true);\n assert(candidate(\"eeeee\") == false);\n assert(candidate(\"A\") == true);\n assert(candidate(\"Pumpkin pie \") == false);\n assert(candidate(\"Pumpkin pie 1\") == false);\n assert(candidate(\"\") == false);\n assert(candidate(\"eeeee e \") == false);\n assert(candidate(\"apple pie\") == false);\n assert(candidate(\"apple pi e \") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "d", - "prompt": "import std.math;\n/*\nReturn true if a given number is prime, and false otherwise.\n >>> is_prime(6L)\n false\n >>> is_prime(101L)\n true\n >>> is_prime(11L)\n true\n >>> is_prime(13441L)\n true\n >>> is_prime(61L)\n true\n >>> is_prime(4L)\n false\n >>> is_prime(1L)\n false\n \n*/\nbool is_prime(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = is_prime;\n\n assert(candidate(6L) == false);\n assert(candidate(101L) == true);\n assert(candidate(11L) == true);\n assert(candidate(13441L) == true);\n assert(candidate(61L) == true);\n assert(candidate(4L) == false);\n assert(candidate(1L) == false);\n assert(candidate(5L) == true);\n assert(candidate(11L) == true);\n assert(candidate(17L) == true);\n assert(candidate(85L) == false);\n assert(candidate(77L) == false);\n assert(candidate(255379L) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "d", - "prompt": "import std.math;\n/*\nGiven an array of positive integers x. return a sorted array of all \n elements that hasn't any even digit.\n\n Note: Returned array should be sorted in increasing order.\n \n For example:\n >>> unique_digits([15L, 33L, 1422L, 1L])\n [1L, 15L, 33L]\n >>> unique_digits([152L, 323L, 1422L, 10L])\n []\n \n*/\nlong[] unique_digits(long[] x) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = unique_digits;\n\n assert(candidate([15L, 33L, 1422L, 1L]) == [1L, 15L, 33L]);\n assert(candidate([152L, 323L, 1422L, 10L]) == []);\n assert(candidate([12345L, 2033L, 111L, 151L]) == [111L, 151L]);\n assert(candidate([135L, 103L, 31L]) == [31L, 135L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "d", - "prompt": "import std.math;\n/*\n Input are two strings a and b consisting only of 1s and 0s.\n Perform binary XOR on these inputs and return result also as a string.\n >>> string_xor(\"010\", \"110\")\n \"100\"\n \n*/\nstring string_xor(string a, string b) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = string_xor;\n\n assert(candidate(\"111000\", \"101010\") == \"010010\");\n assert(candidate(\"1\", \"1\") == \"0\");\n assert(candidate(\"0101\", \"0000\") == \"0101\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "d", - "prompt": "import std.math;\n/*\nsum_to_n is a function that sums numbers from 1 to n.\n >>> sum_to_n(30L)\n 465L\n >>> sum_to_n(100L)\n 5050L\n >>> sum_to_n(5L)\n 15L\n >>> sum_to_n(10L)\n 55L\n >>> sum_to_n(1L)\n 1L\n \n*/\nlong sum_to_n(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = sum_to_n;\n\n assert(candidate(1L) == 1L);\n assert(candidate(6L) == 21L);\n assert(candidate(11L) == 66L);\n assert(candidate(30L) == 465L);\n assert(candidate(100L) == 5050L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "d", - "prompt": "import std.math;\n/*\n\n Given an array of numbers, return the sum of squares of the numbers\n in the array that are odd. Ignore numbers that are negative or not integers.\n \n >>> double_the_difference([1L, 3L, 2L, 0L])\n 10L\n >>> double_the_difference([-1L, -2L, 0L])\n 0L\n >>> double_the_difference([9L, -2L])\n 81L\n >>> double_the_difference([0L])\n 0L\n \n If the input array is empty, return 0.\n \n*/\nlong double_the_difference(float[] lst) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = double_the_difference;\n\n assert(candidate([]) == 0L);\n assert(candidate([5.0, 4.0]) == 25L);\n assert(candidate([0.1, 0.2, 0.3]) == 0L);\n assert(candidate([-10.0, -20.0, -30.0]) == 0L);\n assert(candidate([-1.0, -2.0, 8.0]) == 0L);\n assert(candidate([0.2, 3.0, 5.0]) == 34L);\n assert(candidate([-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]) == 165L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "d", - "prompt": "import std.math;\n/*\n Return length of given string\n >>> strlen(\"\")\n 0L\n >>> strlen(\"abc\")\n 3L\n \n*/\nlong strlen(string string) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = strlen;\n\n assert(candidate(\"\") == 0L);\n assert(candidate(\"x\") == 1L);\n assert(candidate(\"asdasnakj\") == 9L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "d", - "prompt": "import std.math;\n/*\n\n You'll be given a string of words, and your task is to count the number\n of boredoms. A boredom is a sentence that starts with the word \"I\".\n Sentences are delimited by '.', '?' or '!'.\n \n For example:\n >>> is_bored(\"Hello world\")\n 0L\n >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n 1L\n \n*/\nlong is_bored(string S) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = is_bored;\n\n assert(candidate(\"Hello world\") == 0L);\n assert(candidate(\"Is the sky blue?\") == 0L);\n assert(candidate(\"I love It !\") == 1L);\n assert(candidate(\"bIt\") == 0L);\n assert(candidate(\"I feel good today. I will be productive. will kill It\") == 2L);\n assert(candidate(\"You and I are going for a walk\") == 0L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "d", - "prompt": "import std.math;\n/*\nWrite a function vowels_count which takes a string representing\n a word as input and returns the number of vowels in the string.\n Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n vowel, but only when it is at the end of the given word.\n\n Example:\n >>> vowels_count(\"abcde\")\n 2L\n >>> vowels_count(\"ACEDY\")\n 3L\n \n*/\nlong vowels_count(string s) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = vowels_count;\n\n assert(candidate(\"abcde\") == 2L);\n assert(candidate(\"Alone\") == 3L);\n assert(candidate(\"key\") == 2L);\n assert(candidate(\"bye\") == 1L);\n assert(candidate(\"keY\") == 2L);\n assert(candidate(\"bYe\") == 1L);\n assert(candidate(\"ACEDY\") == 3L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "d", - "prompt": "import std.math;\n/*\nReturn n-th Fibonacci number.\n >>> fib(10L)\n 55L\n >>> fib(1L)\n 1L\n >>> fib(8L)\n 21L\n \n*/\nlong fib(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = fib;\n\n assert(candidate(10L) == 55L);\n assert(candidate(1L) == 1L);\n assert(candidate(8L) == 21L);\n assert(candidate(11L) == 89L);\n assert(candidate(12L) == 144L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "d", - "prompt": "import std.math;\n/*\nYour task is to implement a function that will simplify the expression\n x * n. The function returns true if x * n evaluates to a whole number and false\n otherwise. Both x and n, are string representation of a fraction, and have the following format,\n / where both numerator and denominator are positive whole numbers.\n\n You can assume that x, and n are valid fractions, and do not have zero as denominator.\n\n >>> simplify(\"1/5\", \"5/1\")\n true\n >>> simplify(\"1/6\", \"2/1\")\n false\n >>> simplify(\"7/10\", \"10/2\")\n false\n \n*/\nbool simplify(string x, string n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = simplify;\n\n assert(candidate(\"1/5\", \"5/1\") == true);\n assert(candidate(\"1/6\", \"2/1\") == false);\n assert(candidate(\"5/1\", \"3/1\") == true);\n assert(candidate(\"7/10\", \"10/2\") == false);\n assert(candidate(\"2/10\", \"50/10\") == true);\n assert(candidate(\"7/2\", \"4/2\") == true);\n assert(candidate(\"11/6\", \"6/1\") == true);\n assert(candidate(\"2/3\", \"5/2\") == false);\n assert(candidate(\"5/2\", \"3/5\") == false);\n assert(candidate(\"2/4\", \"8/4\") == true);\n assert(candidate(\"2/4\", \"4/2\") == true);\n assert(candidate(\"1/5\", \"5/1\") == true);\n assert(candidate(\"1/5\", \"1/5\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "d", - "prompt": "import std.math;\n/*\n\n Given a string s, count the number of uppercase vowels in even indices.\n \n For example:\n >>> count_upper(\"aBCdEf\")\n 1L\n >>> count_upper(\"abcdefg\")\n 0L\n >>> count_upper(\"dBBE\")\n 0L\n \n*/\nlong count_upper(string s) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = count_upper;\n\n assert(candidate(\"aBCdEf\") == 1L);\n assert(candidate(\"abcdefg\") == 0L);\n assert(candidate(\"dBBE\") == 0L);\n assert(candidate(\"B\") == 0L);\n assert(candidate(\"U\") == 1L);\n assert(candidate(\"\") == 0L);\n assert(candidate(\"EEEE\") == 2L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "d", - "prompt": "import std.math;\n/*\n\n You are given a rectangular grid of wells. Each row represents a single well,\n and each 1 in a row represents a single unit of water.\n Each well has a corresponding bucket that can be used to extract water from it, \n and all buckets have the same capacity.\n Your task is to use the buckets to empty the wells.\n Output the number of times you need to lower the buckets.\n\n Example 1:\n >>> max_fill([[0L, 0L, 1L, 0L], [0L, 1L, 0L, 0L], [1L, 1L, 1L, 1L]], 1L)\n 6L\n\n Example 2:\n >>> max_fill([[0L, 0L, 1L, 1L], [0L, 0L, 0L, 0L], [1L, 1L, 1L, 1L], [0L, 1L, 1L, 1L]], 2L)\n 5L\n \n Example 3:\n >>> max_fill([[0L, 0L, 0L], [0L, 0L, 0L]], 5L)\n 0L\n\n Constraints:\n * all wells have the same length\n * 1 <= grid.length <= 10^2\n * 1 <= grid[:,1].length <= 10^2\n * grid[i][j] -> 0 | 1\n * 1 <= capacity <= 10\n \n*/\nlong max_fill(long[][] grid, long capacity) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = max_fill;\n\n assert(candidate([[0L, 0L, 1L, 0L], [0L, 1L, 0L, 0L], [1L, 1L, 1L, 1L]], 1L) == 6L);\n assert(candidate([[0L, 0L, 1L, 1L], [0L, 0L, 0L, 0L], [1L, 1L, 1L, 1L], [0L, 1L, 1L, 1L]], 2L) == 5L);\n assert(candidate([[0L, 0L, 0L], [0L, 0L, 0L]], 5L) == 0L);\n assert(candidate([[1L, 1L, 1L, 1L], [1L, 1L, 1L, 1L]], 2L) == 4L);\n assert(candidate([[1L, 1L, 1L, 1L], [1L, 1L, 1L, 1L]], 9L) == 2L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "d", - "prompt": "import std.math;\n/*\n\n Given an array arr of integers and a positive integer k, return a sorted array \n of length k with the maximum k numbers in arr.\n\n Example 1:\n\n >>> maximum([-3L, -4L, 5L], 3L)\n [-4L, -3L, 5L]\n\n Example 2:\n\n >>> maximum([4L, -4L, 4L], 2L)\n [4L, 4L]\n\n Example 3:\n\n >>> maximum([-3L, 2L, 1L, 2L, -1L, -2L, 1L], 1L)\n [2L]\n\n Note:\n 1. The length of the array will be in the range of [1, 1000].\n 2. The elements in the array will be in the range of [-1000, 1000].\n 3. 0 <= k <= len(arr)\n \n*/\nlong[] maximum(long[] arr, long k) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = maximum;\n\n assert(candidate([-3L, -4L, 5L], 3L) == [-4L, -3L, 5L]);\n assert(candidate([4L, -4L, 4L], 2L) == [4L, 4L]);\n assert(candidate([-3L, 2L, 1L, 2L, -1L, -2L, 1L], 1L) == [2L]);\n assert(candidate([123L, -123L, 20L, 0L, 1L, 2L, -3L], 3L) == [2L, 20L, 123L]);\n assert(candidate([-123L, 20L, 0L, 1L, 2L, -3L], 4L) == [0L, 1L, 2L, 20L]);\n assert(candidate([5L, 15L, 0L, 3L, -13L, -8L, 0L], 7L) == [-13L, -8L, 0L, 0L, 3L, 5L, 15L]);\n assert(candidate([-1L, 0L, 2L, 5L, 3L, -10L], 2L) == [3L, 5L]);\n assert(candidate([1L, 0L, 5L, -7L], 1L) == [5L]);\n assert(candidate([4L, -4L], 2L) == [-4L, 4L]);\n assert(candidate([-10L, 10L], 2L) == [-10L, 10L]);\n assert(candidate([1L, 2L, 3L, -23L, 243L, -400L, 0L], 0L) == []);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "d", - "prompt": "import std.math;\n/*\n\n Write a function that takes a message, and encodes in such a \n way that it swaps case of all letters, replaces all vowels in \n the message with the letter that appears 2 places ahead of that \n vowel in the english alphabet. \n Assume only letters. \n \n Examples:\n >>> encode(\"test\")\n \"TGST\"\n >>> encode(\"This is a message\")\n \"tHKS KS C MGSSCGG\"\n \n*/\nstring encode(string message) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = encode;\n\n assert(candidate(\"TEST\") == \"tgst\");\n assert(candidate(\"Mudasir\") == \"mWDCSKR\");\n assert(candidate(\"YES\") == \"ygs\");\n assert(candidate(\"This is a message\") == \"tHKS KS C MGSSCGG\");\n assert(candidate(\"I DoNt KnOw WhAt tO WrItE\") == \"k dQnT kNqW wHcT Tq wRkTg\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "d", - "prompt": "import std.math;\n/*\n\n remove_vowels is a function that takes string and returns string without vowels.\n >>> remove_vowels(\"\")\n \"\"\n >>> remove_vowels(\"abcdef\")\n \"bcdf\"\n >>> remove_vowels(\"aaaaa\")\n \"\"\n >>> remove_vowels(\"aaBAA\")\n \"B\"\n >>> remove_vowels(\"zbcd\")\n \"zbcd\"\n \n*/\nstring remove_vowels(string text) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = remove_vowels;\n\n assert(candidate(\"\") == \"\");\n assert(candidate(\"abcdef\nghijklm\") == \"bcdf\nghjklm\");\n assert(candidate(\"fedcba\") == \"fdcb\");\n assert(candidate(\"eeeee\") == \"\");\n assert(candidate(\"acBAA\") == \"cB\");\n assert(candidate(\"EcBOO\") == \"cB\");\n assert(candidate(\"ybcd\") == \"ybcd\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "d", - "prompt": "import std.math;\n/*\nReturn only positive numbers in the array.\n >>> get_positive([-1L, 2L, -4L, 5L, 6L])\n [2L, 5L, 6L]\n >>> get_positive([5L, 3L, -5L, 2L, -3L, 3L, 9L, 0L, 123L, 1L, -10L])\n [5L, 3L, 2L, 3L, 9L, 123L, 1L]\n \n*/\nlong[] get_positive(long[] l) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = get_positive;\n\n assert(candidate([-1L, -2L, 4L, 5L, 6L]) == [4L, 5L, 6L]);\n assert(candidate([5L, 3L, -5L, 2L, 3L, 3L, 9L, 0L, 123L, 1L, -10L]) == [5L, 3L, 2L, 3L, 3L, 9L, 123L, 1L]);\n assert(candidate([-1L, -2L]) == []);\n assert(candidate([]) == []);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "d", - "prompt": "import std.math;\n/*\n Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n >>> string_sequence(0L)\n \"0\"\n >>> string_sequence(5L)\n \"0 1 2 3 4 5\"\n \n*/\nstring string_sequence(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = string_sequence;\n\n assert(candidate(0L) == \"0\");\n assert(candidate(3L) == \"0 1 2 3\");\n assert(candidate(10L) == \"0 1 2 3 4 5 6 7 8 9 10\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "d", - "prompt": "import std.math;\n/*\n\n Given a positive integer n, you have to make a pile of n levels of stones.\n The first level has n stones.\n The number of stones in the next level is:\n - the next odd number if n is odd.\n - the next even number if n is even.\n Return the number of stones in each level in an array, where element at index\n i represents the number of stones in the level (i+1).\n\n Examples:\n >>> make_a_pile(3L)\n [3L, 5L, 7L]\n \n*/\nlong[] make_a_pile(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = make_a_pile;\n\n assert(candidate(3L) == [3L, 5L, 7L]);\n assert(candidate(4L) == [4L, 6L, 8L, 10L]);\n assert(candidate(5L) == [5L, 7L, 9L, 11L, 13L]);\n assert(candidate(6L) == [6L, 8L, 10L, 12L, 14L, 16L]);\n assert(candidate(8L) == [8L, 10L, 12L, 14L, 16L, 18L, 20L, 22L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nTask\n 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\n then check if the result string is palindrome.\n A string is called palindrome if it reads the same backward as forward.\n You should return a tuple containing the result string and true/false for the check.\n Example\n >>> reverse_delete(\"abcde\", \"ae\")\n tuple(\"bcd\", false)\n >>> reverse_delete(\"abcdef\", \"b\")\n tuple(\"acdef\", false)\n >>> reverse_delete(\"abcdedcba\", \"ab\")\n tuple(\"cdedc\", true)\n \n*/\nTuple!(string, bool) reverse_delete(string s, string c) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = reverse_delete;\n\n assert(candidate(\"abcde\", \"ae\") == tuple(\"bcd\", false));\n assert(candidate(\"abcdef\", \"b\") == tuple(\"acdef\", false));\n assert(candidate(\"abcdedcba\", \"ab\") == tuple(\"cdedc\", true));\n assert(candidate(\"dwik\", \"w\") == tuple(\"dik\", false));\n assert(candidate(\"a\", \"a\") == tuple(\"\", true));\n assert(candidate(\"abcdedcba\", \"\") == tuple(\"abcdedcba\", true));\n assert(candidate(\"abcdedcba\", \"v\") == tuple(\"abcdedcba\", true));\n assert(candidate(\"vabba\", \"v\") == tuple(\"abba\", true));\n assert(candidate(\"mamma\", \"mia\") == tuple(\"\", true));\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n >>> flip_case(\"Hello\")\n \"hELLO\"\n \n*/\nstring flip_case(string string) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = flip_case;\n\n assert(candidate(\"\") == \"\");\n assert(candidate(\"Hello!\") == \"hELLO!\");\n assert(candidate(\"These violent delights have violent ends\") == \"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou are given a string s.\n if s[i] is a letter, reverse its case from lower to upper or vise versa, \n otherwise keep it as it is.\n If the string contains no letters, reverse the string.\n The function should return the resulted string.\n Examples\n >>> solve(\"1234\")\n \"4321\"\n >>> solve(\"ab\")\n \"AB\"\n >>> solve(\"#a@C\")\n \"#A@c\"\n \n*/\nstring solve(string s) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = solve;\n\n assert(candidate(\"AsDf\") == \"aSdF\");\n assert(candidate(\"1234\") == \"4321\");\n assert(candidate(\"ab\") == \"AB\");\n assert(candidate(\"#a@C\") == \"#A@c\");\n assert(candidate(\"#AsdfW^45\") == \"#aSDFw^45\");\n assert(candidate(\"#6@2\") == \"2@6#\");\n assert(candidate(\"#$a^D\") == \"#$A^d\");\n assert(candidate(\"#ccc\") == \"#CCC\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Filter an input array of strings only for ones that start with a given prefix.\n >>> filter_by_prefix([], \"a\")\n []\n >>> filter_by_prefix([\"abc\", \"bcd\", \"cde\", \"array\"], \"a\")\n [\"abc\", \"array\"]\n \n*/\nstring[] filter_by_prefix(string[] strings, string prefix) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = filter_by_prefix;\n\n assert(candidate([], \"john\") == []);\n assert(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\") == [\"xxx\", \"xxxAAA\", \"xxx\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nThis function takes two positive numbers x and y and returns the\n biggest even integer number that is in the range [x, y] inclusive. If \n there's no such number, then the function should return -1.\n\n For example:\n >>> choose_num(12L, 15L)\n 14L\n >>> choose_num(13L, 12L)\n -1L\n \n*/\nlong choose_num(long x, long y) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = choose_num;\n\n assert(candidate(12L, 15L) == 14L);\n assert(candidate(13L, 12L) == -1L);\n assert(candidate(33L, 12354L) == 12354L);\n assert(candidate(5234L, 5233L) == -1L);\n assert(candidate(6L, 29L) == 28L);\n assert(candidate(27L, 10L) == -1L);\n assert(candidate(7L, 7L) == -1L);\n assert(candidate(546L, 546L) == 546L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n You are given a string representing a sentence,\n the sentence contains some words separated by a space,\n and you have to return a string that contains the words from the original sentence,\n whose lengths are prime numbers,\n the order of the words in the new string should be the same as the original one.\n\n Example 1:\n >>> words_in_sentence(\"This is a test\")\n \"is\"\n\n Example 2:\n >>> words_in_sentence(\"lets go for swimming\")\n \"go for\"\n \n Constraints:\n * 1 <= len(sentence) <= 100\n * sentence contains only letters\n \n*/\nstring words_in_sentence(string sentence) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = words_in_sentence;\n\n assert(candidate(\"This is a test\") == \"is\");\n assert(candidate(\"lets go for swimming\") == \"go for\");\n assert(candidate(\"there is no place available here\") == \"there is no place\");\n assert(candidate(\"Hi I am Hussein\") == \"Hi am Hussein\");\n assert(candidate(\"go for it\") == \"go for it\");\n assert(candidate(\"here\") == \"\");\n assert(candidate(\"here is\") == \"is\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Insert a number 'delimeter' between every two consecutive elements of input array `numbers'\n >>> intersperse([], 4L)\n []\n >>> intersperse([1L, 2L, 3L], 4L)\n [1L, 4L, 2L, 4L, 3L]\n \n*/\nlong[] intersperse(long[] numbers, long delimeter) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = intersperse;\n\n assert(candidate([], 7L) == []);\n assert(candidate([5L, 6L, 3L, 2L], 8L) == [5L, 8L, 6L, 8L, 3L, 8L, 2L]);\n assert(candidate([2L, 2L, 2L], 2L) == [2L, 2L, 2L, 2L, 2L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYour task is to write a function that returns true if a number x is a simple\n power of n and false in other cases.\n x is a simple power of n if n**int=x\n For example:\n >>> is_simple_power(1L, 4L)\n true\n >>> is_simple_power(2L, 2L)\n true\n >>> is_simple_power(8L, 2L)\n true\n >>> is_simple_power(3L, 2L)\n false\n >>> is_simple_power(3L, 1L)\n false\n >>> is_simple_power(5L, 3L)\n false\n \n*/\nbool is_simple_power(long x, long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = is_simple_power;\n\n assert(candidate(16L, 2L) == true);\n assert(candidate(143214L, 16L) == false);\n assert(candidate(4L, 2L) == true);\n assert(candidate(9L, 3L) == true);\n assert(candidate(16L, 4L) == true);\n assert(candidate(24L, 2L) == false);\n assert(candidate(128L, 4L) == false);\n assert(candidate(12L, 6L) == false);\n assert(candidate(1L, 1L) == true);\n assert(candidate(1L, 12L) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nWrite a function that returns true if the given number is the multiplication of 3 prime numbers\n and false otherwise.\n Knowing that (a) is less then 100. \n Example:\n >>> is_multiply_prime(30L)\n true\n 30 = 2 * 3 * 5\n \n*/\nbool is_multiply_prime(long a) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = is_multiply_prime;\n\n assert(candidate(5L) == false);\n assert(candidate(30L) == true);\n assert(candidate(8L) == true);\n assert(candidate(10L) == false);\n assert(candidate(125L) == true);\n assert(candidate(105L) == true);\n assert(candidate(126L) == false);\n assert(candidate(729L) == false);\n assert(candidate(891L) == false);\n assert(candidate(1001L) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given the lengths of the three sides of a triangle. Return true if the three\n sides form a right-angled triangle, false otherwise.\n A right-angled triangle is a triangle in which one angle is right angle or \n 90 degree.\n Example:\n >>> right_angle_triangle(3L, 4L, 5L)\n true\n >>> right_angle_triangle(1L, 2L, 3L)\n false\n \n*/\nbool right_angle_triangle(long a, long b, long c) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = right_angle_triangle;\n\n assert(candidate(3L, 4L, 5L) == true);\n assert(candidate(1L, 2L, 3L) == false);\n assert(candidate(10L, 6L, 8L) == true);\n assert(candidate(2L, 2L, 2L) == false);\n assert(candidate(7L, 24L, 25L) == true);\n assert(candidate(10L, 5L, 7L) == false);\n assert(candidate(5L, 12L, 13L) == true);\n assert(candidate(15L, 8L, 17L) == true);\n assert(candidate(48L, 55L, 73L) == true);\n assert(candidate(1L, 1L, 1L) == false);\n assert(candidate(2L, 2L, 10L) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Create a function that takes 3 numbers.\n Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n Returns false in any other cases.\n \n Examples\n >>> any_int(5L, 2L, 7L)\n true\n \n >>> any_int(3L, 2L, 2L)\n false\n\n >>> any_int(3L, -2L, 1L)\n true\n \n >>> any_int(3.6, -2.2, 2L)\n false\n \n\n \n \n*/\nbool any_int(float x, float y, float z) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = any_int;\n\n assert(candidate(2L, 3L, 1L) == true);\n assert(candidate(2.5, 2L, 3L) == false);\n assert(candidate(1.5, 5L, 3.5) == false);\n assert(candidate(2L, 6L, 2L) == false);\n assert(candidate(4L, 2L, 2L) == true);\n assert(candidate(2.2, 2.2, 2.2) == false);\n assert(candidate(-4L, 6L, 2L) == true);\n assert(candidate(2L, 1L, 1L) == true);\n assert(candidate(3L, 4L, 7L) == true);\n assert(candidate(3.0, 4L, 7L) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nThis function takes an array l and returns an array l' such that\n l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n to the values of the corresponding indicies of l, but sorted.\n >>> sort_third([1L, 2L, 3L])\n [1L, 2L, 3L]\n >>> sort_third([5L, 6L, 3L, 4L, 8L, 9L, 2L])\n [2L, 6L, 3L, 4L, 8L, 9L, 5L]\n \n*/\nlong[] sort_third(long[] l) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = sort_third;\n\n assert(candidate([5L, 6L, 3L, 4L, 8L, 9L, 2L]) == [2L, 6L, 3L, 4L, 8L, 9L, 5L]);\n assert(candidate([5L, 8L, 3L, 4L, 6L, 9L, 2L]) == [2L, 8L, 3L, 4L, 6L, 9L, 5L]);\n assert(candidate([5L, 6L, 9L, 4L, 8L, 3L, 2L]) == [2L, 6L, 9L, 4L, 8L, 3L, 5L]);\n assert(candidate([5L, 6L, 3L, 4L, 8L, 9L, 2L, 1L]) == [2L, 6L, 3L, 4L, 8L, 9L, 5L, 1L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_53_add", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nAdd two numbers x and y\n >>> add(2L, 3L)\n 5L\n >>> add(5L, 7L)\n 12L\n \n*/\nlong add(long x, long y) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = add;\n\n assert(candidate(0L, 1L) == 1L);\n assert(candidate(1L, 0L) == 1L);\n assert(candidate(2L, 3L) == 5L);\n assert(candidate(5L, 7L) == 12L);\n assert(candidate(7L, 5L) == 12L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_69_search", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n You are given a non-empty array of positive integers. Return the greatest integer that is greater than \n zero, and has a frequency greater than or equal to the value of the integer itself. \n The frequency of an integer is the number of times it appears in the array.\n If no such a value exist, return -1.\n Examples:\n >>> search([4L, 1L, 2L, 2L, 3L, 1L])\n 2L\n >>> search([1L, 2L, 2L, 3L, 3L, 3L, 4L, 4L, 4L])\n 3L\n >>> search([5L, 5L, 4L, 4L, 4L])\n -1L\n \n*/\nlong search(long[] lst) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = search;\n\n assert(candidate([5L, 5L, 5L, 5L, 1L]) == 1L);\n assert(candidate([4L, 1L, 4L, 1L, 4L, 4L]) == 4L);\n assert(candidate([3L, 3L]) == -1L);\n assert(candidate([8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L]) == 8L);\n assert(candidate([2L, 3L, 3L, 2L, 2L]) == 2L);\n assert(candidate([2L, 7L, 8L, 8L, 4L, 8L, 7L, 3L, 9L, 6L, 5L, 10L, 4L, 3L, 6L, 7L, 1L, 7L, 4L, 10L, 8L, 1L]) == 1L);\n assert(candidate([3L, 2L, 8L, 2L]) == 2L);\n assert(candidate([6L, 7L, 1L, 8L, 8L, 10L, 5L, 8L, 5L, 3L, 10L]) == 1L);\n assert(candidate([8L, 8L, 3L, 6L, 5L, 6L, 4L]) == -1L);\n assert(candidate([6L, 9L, 6L, 7L, 1L, 4L, 7L, 1L, 8L, 8L, 9L, 8L, 10L, 10L, 8L, 4L, 10L, 4L, 10L, 1L, 2L, 9L, 5L, 7L, 9L]) == 1L);\n assert(candidate([1L, 9L, 10L, 1L, 3L]) == 1L);\n assert(candidate([6L, 9L, 7L, 5L, 8L, 7L, 5L, 3L, 7L, 5L, 10L, 10L, 3L, 6L, 10L, 2L, 8L, 6L, 5L, 4L, 9L, 5L, 3L, 10L]) == 5L);\n assert(candidate([1L]) == 1L);\n assert(candidate([8L, 8L, 10L, 6L, 4L, 3L, 5L, 8L, 2L, 4L, 2L, 8L, 4L, 6L, 10L, 4L, 2L, 1L, 10L, 2L, 1L, 1L, 5L]) == 4L);\n assert(candidate([2L, 10L, 4L, 8L, 2L, 10L, 5L, 1L, 2L, 9L, 5L, 5L, 6L, 3L, 8L, 6L, 4L, 10L]) == 2L);\n assert(candidate([1L, 6L, 10L, 1L, 6L, 9L, 10L, 8L, 6L, 8L, 7L, 3L]) == 1L);\n assert(candidate([9L, 2L, 4L, 1L, 5L, 1L, 5L, 2L, 5L, 7L, 7L, 7L, 3L, 10L, 1L, 5L, 4L, 2L, 8L, 4L, 1L, 9L, 10L, 7L, 10L, 2L, 8L, 10L, 9L, 4L]) == 4L);\n assert(candidate([2L, 6L, 4L, 2L, 8L, 7L, 5L, 6L, 4L, 10L, 4L, 6L, 3L, 7L, 8L, 8L, 3L, 1L, 4L, 2L, 2L, 10L, 7L]) == 4L);\n assert(candidate([9L, 8L, 6L, 10L, 2L, 6L, 10L, 2L, 7L, 8L, 10L, 3L, 8L, 2L, 6L, 2L, 3L, 1L]) == 2L);\n assert(candidate([5L, 5L, 3L, 9L, 5L, 6L, 3L, 2L, 8L, 5L, 6L, 10L, 10L, 6L, 8L, 4L, 10L, 7L, 7L, 10L, 8L]) == -1L);\n assert(candidate([10L]) == -1L);\n assert(candidate([9L, 7L, 7L, 2L, 4L, 7L, 2L, 10L, 9L, 7L, 5L, 7L, 2L]) == 2L);\n assert(candidate([5L, 4L, 10L, 2L, 1L, 1L, 10L, 3L, 6L, 1L, 8L]) == 1L);\n assert(candidate([7L, 9L, 9L, 9L, 3L, 4L, 1L, 5L, 9L, 1L, 2L, 1L, 1L, 10L, 7L, 5L, 6L, 7L, 6L, 7L, 7L, 6L]) == 1L);\n assert(candidate([3L, 10L, 10L, 9L, 2L]) == -1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nWrite a function that takes a string and returns true if the string\n length is a prime number or false otherwise\n Examples\n >>> prime_length(\"Hello\")\n true\n >>> prime_length(\"abcdcba\")\n true\n >>> prime_length(\"kittens\")\n true\n >>> prime_length(\"orange\")\n false\n \n*/\nbool prime_length(string string) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = prime_length;\n\n assert(candidate(\"Hello\") == true);\n assert(candidate(\"abcdcba\") == true);\n assert(candidate(\"kittens\") == true);\n assert(candidate(\"orange\") == false);\n assert(candidate(\"wow\") == true);\n assert(candidate(\"world\") == true);\n assert(candidate(\"MadaM\") == true);\n assert(candidate(\"Wow\") == true);\n assert(candidate(\"\") == false);\n assert(candidate(\"HI\") == true);\n assert(candidate(\"go\") == true);\n assert(candidate(\"gogo\") == false);\n assert(candidate(\"aaaaaaaaaaaaaaa\") == false);\n assert(candidate(\"Madam\") == true);\n assert(candidate(\"M\") == false);\n assert(candidate(\"0\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_58_common", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nReturn sorted unique common elements for two arrays.\n >>> common([1L, 4L, 3L, 34L, 653L, 2L, 5L], [5L, 7L, 1L, 5L, 9L, 653L, 121L])\n [1L, 5L, 653L]\n >>> common([5L, 3L, 2L, 8L], [3L, 2L])\n [2L, 3L]\n\n \n*/\nlong[] common(long[] l1, long[] l2) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = common;\n\n assert(candidate([1L, 4L, 3L, 34L, 653L, 2L, 5L], [5L, 7L, 1L, 5L, 9L, 653L, 121L]) == [1L, 5L, 653L]);\n assert(candidate([5L, 3L, 2L, 8L], [3L, 2L]) == [2L, 3L]);\n assert(candidate([4L, 3L, 2L, 8L], [3L, 2L, 4L]) == [2L, 3L, 4L]);\n assert(candidate([4L, 3L, 2L, 8L], []) == []);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nThe Brazilian factorial is defined as:\n brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n where n > 0\n\n For example:\n >>> special_factorial(4L)\n 288L\n\n The function will receive an integer as input and should return the special\n factorial of this integer.\n \n*/\nlong special_factorial(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = special_factorial;\n\n assert(candidate(4L) == 288L);\n assert(candidate(5L) == 34560L);\n assert(candidate(7L) == 125411328000L);\n assert(candidate(1L) == 1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nIn this problem, you will implement a function that takes two arrays of numbers,\n and determines whether it is possible to perform an exchange of elements\n between them to make lst1 an array of only even numbers.\n There is no limit on the number of exchanged elements between lst1 and lst2.\n If it is possible to exchange elements between the lst1 and lst2 to make\n all the elements of lst1 to be even, return \"YES\".\n Otherwise, return \"NO\".\n For example:\n >>> exchange([1L, 2L, 3L, 4L], [1L, 2L, 3L, 4L])\n \"YES\"\n >>> exchange([1L, 2L, 3L, 4L], [1L, 5L, 3L, 4L])\n \"NO\"\n It is assumed that the input arrays will be non-empty.\n \n*/\nstring exchange(long[] lst1, long[] lst2) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = exchange;\n\n assert(candidate([1L, 2L, 3L, 4L], [1L, 2L, 3L, 4L]) == \"YES\");\n assert(candidate([1L, 2L, 3L, 4L], [1L, 5L, 3L, 4L]) == \"NO\");\n assert(candidate([1L, 2L, 3L, 4L], [2L, 1L, 4L, 3L]) == \"YES\");\n assert(candidate([5L, 7L, 3L], [2L, 6L, 4L]) == \"YES\");\n assert(candidate([5L, 7L, 3L], [2L, 6L, 3L]) == \"NO\");\n assert(candidate([3L, 2L, 6L, 1L, 8L, 9L], [3L, 5L, 5L, 1L, 1L, 1L]) == \"NO\");\n assert(candidate([100L, 200L], [200L, 200L]) == \"YES\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given a non-empty array of integers arr and an integer k, return\n the sum of the elements with at most two digits from the first k elements of arr.\n\n Example:\n\n >>> add_elements([111L, 21L, 3L, 4000L, 5L, 6L, 7L, 8L, 9L], 4L)\n 24L\n\n Constraints:\n 1. 1 <= len(arr) <= 100\n 2. 1 <= k <= len(arr)\n \n*/\nlong add_elements(long[] arr, long k) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = add_elements;\n\n assert(candidate([1L, -2L, -3L, 41L, 57L, 76L, 87L, 88L, 99L], 3L) == -4L);\n assert(candidate([111L, 121L, 3L, 4000L, 5L, 6L], 2L) == 0L);\n assert(candidate([11L, 21L, 3L, 90L, 5L, 6L, 7L, 8L, 9L], 4L) == 125L);\n assert(candidate([111L, 21L, 3L, 4000L, 5L, 6L, 7L, 8L, 9L], 4L) == 24L);\n assert(candidate([1L], 1L) == 1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nA simple program which should return the value of x if n is \n a prime number and should return the value of y otherwise.\n\n Examples:\n >>> x_or_y(7L, 34L, 12L)\n 34L\n >>> x_or_y(15L, 8L, 5L)\n 5L\n \n \n*/\nlong x_or_y(long n, long x, long y) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = x_or_y;\n\n assert(candidate(7L, 34L, 12L) == 34L);\n assert(candidate(15L, 8L, 5L) == 5L);\n assert(candidate(3L, 33L, 5212L) == 33L);\n assert(candidate(1259L, 3L, 52L) == 3L);\n assert(candidate(7919L, -1L, 12L) == -1L);\n assert(candidate(3609L, 1245L, 583L) == 583L);\n assert(candidate(91L, 56L, 129L) == 129L);\n assert(candidate(6L, 34L, 1234L) == 1234L);\n assert(candidate(1L, 2L, 0L) == 0L);\n assert(candidate(2L, 2L, 0L) == 2L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nGiven length of a side and high return area for a triangle.\n >>> triangle_area(5L, 3L)\n 7.5\n \n*/\nfloat triangle_area(long a, long h) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = triangle_area;\n\n assert(candidate(5L, 3L) == 7.5);\n assert(candidate(2L, 2L) == 2.0);\n assert(candidate(10L, 8L) == 40.0);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nEveryone knows Fibonacci sequence, it was studied deeply by mathematicians in \n the last couple centuries. However, what people don't know is Tribonacci sequence.\n Tribonacci sequence is defined by the recurrence:\n tri(1) = 3\n tri(n) = 1 + n / 2, if n is even.\n tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n For example:\n tri(2) = 1 + (2 / 2) = 2\n tri(4) = 3\n tri(3) = tri(2) + tri(1) + tri(4)\n = 2 + 3 + 3 = 8 \n You are given a non-negative integer number n, you have to a return an array of the \n first n + 1 numbers of the Tribonacci sequence.\n Examples:\n >>> tri(3L)\n [1L, 3L, 2L, 8L]\n \n*/\nlong[] tri(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = tri;\n\n assert(candidate(3L) == [1L, 3L, 2L, 8L]);\n assert(candidate(4L) == [1L, 3L, 2L, 8L, 3L]);\n assert(candidate(5L) == [1L, 3L, 2L, 8L, 3L, 15L]);\n assert(candidate(6L) == [1L, 3L, 2L, 8L, 3L, 15L, 4L]);\n assert(candidate(7L) == [1L, 3L, 2L, 8L, 3L, 15L, 4L, 24L]);\n assert(candidate(8L) == [1L, 3L, 2L, 8L, 3L, 15L, 4L, 24L, 5L]);\n assert(candidate(9L) == [1L, 3L, 2L, 8L, 3L, 15L, 4L, 24L, 5L, 35L]);\n assert(candidate(20L) == [1L, 3L, 2L, 8L, 3L, 15L, 4L, 24L, 5L, 35L, 6L, 48L, 7L, 63L, 8L, 80L, 9L, 99L, 10L, 120L, 11L]);\n assert(candidate(0L) == [1L]);\n assert(candidate(1L) == [1L, 3L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n You are given an array of two strings, both strings consist of open\n parentheses '(' or close parentheses ')' only.\n Your job is to check if it is possible to concatenate the two strings in\n some order, that the resulting string will be good.\n A string S is considered to be good if and only if all parentheses in S\n are balanced. For example: the string '(())()' is good, while the string\n '())' is not.\n Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n\n Examples:\n >>> match_parens([\"()(\", \")\"])\n \"Yes\"\n >>> match_parens([\")\", \")\"])\n \"No\"\n \n*/\nstring match_parens(string[] lst) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = match_parens;\n\n assert(candidate([\"()(\", \")\"]) == \"Yes\");\n assert(candidate([\")\", \")\"]) == \"No\");\n assert(candidate([\"(()(())\", \"())())\"]) == \"No\");\n assert(candidate([\")())\", \"(()()(\"]) == \"Yes\");\n assert(candidate([\"(())))\", \"(()())((\"]) == \"Yes\");\n assert(candidate([\"()\", \"())\"]) == \"No\");\n assert(candidate([\"(()(\", \"()))()\"]) == \"Yes\");\n assert(candidate([\"((((\", \"((())\"]) == \"No\");\n assert(candidate([\")(()\", \"(()(\"]) == \"No\");\n assert(candidate([\")(\", \")(\"]) == \"No\");\n assert(candidate([\"(\", \")\"]) == \"Yes\");\n assert(candidate([\")\", \"(\"]) == \"Yes\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n From an array of integers, remove all elements that occur more than once.\n Keep order of elements left the same as in the input.\n >>> remove_duplicates([1L, 2L, 3L, 2L, 4L])\n [1L, 3L, 4L]\n \n*/\nlong[] remove_duplicates(long[] numbers) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = remove_duplicates;\n\n assert(candidate([]) == []);\n assert(candidate([1L, 2L, 3L, 4L]) == [1L, 2L, 3L, 4L]);\n assert(candidate([1L, 2L, 3L, 2L, 4L, 3L, 5L]) == [1L, 4L, 5L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Return a greatest common divisor of two integers a and b\n >>> greatest_common_divisor(3L, 5L)\n 1L\n >>> greatest_common_divisor(25L, 15L)\n 5L\n \n*/\nlong greatest_common_divisor(long a, long b) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = greatest_common_divisor;\n\n assert(candidate(3L, 7L) == 1L);\n assert(candidate(10L, 15L) == 5L);\n assert(candidate(49L, 14L) == 7L);\n assert(candidate(144L, 60L) == 12L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Checks if given string is a palindrome\n >>> is_palindrome(\"\")\n true\n >>> is_palindrome(\"aba\")\n true\n >>> is_palindrome(\"aaaaa\")\n true\n >>> is_palindrome(\"zbcd\")\n false\n \n*/\nbool is_palindrome(string text) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = is_palindrome;\n\n assert(candidate(\"\") == true);\n assert(candidate(\"aba\") == true);\n assert(candidate(\"aaaaa\") == true);\n assert(candidate(\"zbcd\") == false);\n assert(candidate(\"xywyx\") == true);\n assert(candidate(\"xywyz\") == false);\n assert(candidate(\"xywzx\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n xs represent coefficients of a polynomial.\n xs[0] + xs[1] * x + xs[2] * x^2 + ....\n Return derivative of this polynomial in the same form.\n >>> derivative([3L, 1L, 2L, 4L, 5L])\n [1L, 4L, 12L, 20L]\n >>> derivative([1L, 2L, 3L])\n [2L, 6L]\n \n*/\nlong[] derivative(long[] xs) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = derivative;\n\n assert(candidate([3L, 1L, 2L, 4L, 5L]) == [1L, 4L, 12L, 20L]);\n assert(candidate([1L, 2L, 3L]) == [2L, 6L]);\n assert(candidate([3L, 2L, 1L]) == [2L, 2L]);\n assert(candidate([3L, 2L, 1L, 0L, 4L]) == [2L, 2L, 0L, 16L]);\n assert(candidate([1L]) == []);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n In this task, you will be given a string that represents a number of apples and oranges \n that are distributed in a basket of fruit this basket contains \n apples, oranges, and mango fruits. Given the string that represents the total number of \n the oranges and apples and an integer that represent the total number of the fruits \n in the basket return the number of the mango fruits in the basket.\n for examble:\n >>> fruit_distribution(\"5 apples and 6 oranges\", 19L)\n 8L\n >>> fruit_distribution(\"0 apples and 1 oranges\", 3L)\n 2L\n >>> fruit_distribution(\"2 apples and 3 oranges\", 100L)\n 95L\n >>> fruit_distribution(\"100 apples and 1 oranges\", 120L)\n 19L\n \n*/\nlong fruit_distribution(string s, long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = fruit_distribution;\n\n assert(candidate(\"5 apples and 6 oranges\", 19L) == 8L);\n assert(candidate(\"5 apples and 6 oranges\", 21L) == 10L);\n assert(candidate(\"0 apples and 1 oranges\", 3L) == 2L);\n assert(candidate(\"1 apples and 0 oranges\", 3L) == 2L);\n assert(candidate(\"2 apples and 3 oranges\", 100L) == 95L);\n assert(candidate(\"2 apples and 3 oranges\", 5L) == 0L);\n assert(candidate(\"1 apples and 100 oranges\", 120L) == 19L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Write a function that takes an integer a and returns true \n if this ingeger is a cube of some integer number.\n Note: you may assume the input is always valid.\n Examples:\n >>> iscube(1L)\n true\n >>> iscube(2L)\n false\n >>> iscube(-1L)\n true\n >>> iscube(64L)\n true\n >>> iscube(0L)\n true\n >>> iscube(180L)\n false\n \n*/\nbool iscube(long a) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = iscube;\n\n assert(candidate(1L) == true);\n assert(candidate(2L) == false);\n assert(candidate(-1L) == true);\n assert(candidate(64L) == true);\n assert(candidate(180L) == false);\n assert(candidate(1000L) == true);\n assert(candidate(0L) == true);\n assert(candidate(1729L) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n In this Kata, you have to sort an array of non-negative integers according to\n number of ones in their binary representation in ascending order.\n For similar number of ones, sort based on decimal value.\n\n It must be implemented like this:\n >>> sort_array([1L, 5L, 2L, 3L, 4L])\n [1L, 2L, 3L, 4L, 5L]\n >>> sort_array([-2L, -3L, -4L, -5L, -6L])\n [-6L, -5L, -4L, -3L, -2L]\n >>> sort_array([1L, 0L, 2L, 3L, 4L])\n [0L, 1L, 2L, 3L, 4L]\n \n*/\nlong[] sort_array(long[] arr) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = sort_array;\n\n assert(candidate([1L, 5L, 2L, 3L, 4L]) == [1L, 2L, 4L, 3L, 5L]);\n assert(candidate([-2L, -3L, -4L, -5L, -6L]) == [-4L, -2L, -6L, -5L, -3L]);\n assert(candidate([1L, 0L, 2L, 3L, 4L]) == [0L, 1L, 2L, 4L, 3L]);\n assert(candidate([]) == []);\n assert(candidate([2L, 5L, 77L, 4L, 5L, 3L, 5L, 7L, 2L, 3L, 4L]) == [2L, 2L, 4L, 4L, 3L, 3L, 5L, 5L, 5L, 7L, 77L]);\n assert(candidate([3L, 6L, 44L, 12L, 32L, 5L]) == [32L, 3L, 5L, 6L, 12L, 44L]);\n assert(candidate([2L, 4L, 8L, 16L, 32L]) == [2L, 4L, 8L, 16L, 32L]);\n assert(candidate([2L, 4L, 8L, 16L, 32L]) == [2L, 4L, 8L, 16L, 32L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nGiven an array of strings, where each string consists of only digits, return an array.\n Each element i of the output should be \"the number of odd elements in the\n string i of the input.\" where all the i's should be replaced by the number\n of odd digits in the i'th string of the input.\n\n >>> odd_count([\"1234567\"])\n [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n >>> odd_count([\"3\", \"11111111\"])\n [\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\n \n*/\nstring[] odd_count(string[] lst) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = odd_count;\n\n assert(candidate([\"1234567\"]) == [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]);\n 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.\"]);\n assert(candidate([\"271\", \"137\", \"314\"]) == [\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n brackets is a string of \"(\" and \")\".\n return true if every opening bracket has a corresponding closing bracket.\n\n >>> correct_bracketing(\"(\")\n false\n >>> correct_bracketing(\"()\")\n true\n >>> correct_bracketing(\"(()())\")\n true\n >>> correct_bracketing(\")(()\")\n false\n \n*/\nbool correct_bracketing(string brackets) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = correct_bracketing;\n\n assert(candidate(\"()\") == true);\n assert(candidate(\"(()())\") == true);\n assert(candidate(\"()()(()())()\") == true);\n assert(candidate(\"()()((()()())())(()()(()))\") == true);\n assert(candidate(\"((()())))\") == false);\n assert(candidate(\")(()\") == false);\n assert(candidate(\"(\") == false);\n assert(candidate(\"((((\") == false);\n assert(candidate(\")\") == false);\n assert(candidate(\"(()\") == false);\n assert(candidate(\"()()(()())())(()\") == false);\n assert(candidate(\"()()(()())()))()\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nTask\n Write a function that takes a string as input and returns the sum of the upper characters only'\n ASCII codes.\n\n Examples:\n >>> digitSum(\"\")\n 0L\n >>> digitSum(\"abAB\")\n 131L\n >>> digitSum(\"abcCd\")\n 67L\n >>> digitSum(\"helloE\")\n 69L\n >>> digitSum(\"woArBld\")\n 131L\n >>> digitSum(\"aAaaaXa\")\n 153L\n \n*/\nlong digitSum(string s) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = digitSum;\n\n assert(candidate(\"\") == 0L);\n assert(candidate(\"abAB\") == 131L);\n assert(candidate(\"abcCd\") == 67L);\n assert(candidate(\"helloE\") == 69L);\n assert(candidate(\"woArBld\") == 131L);\n assert(candidate(\"aAaaaXa\") == 153L);\n assert(candidate(\" How are yOu?\") == 151L);\n assert(candidate(\"You arE Very Smart\") == 327L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nWrite a function that accepts an array of strings as a parameter,\n deletes the strings that have odd lengths from it,\n and returns the resulted array with a sorted order,\n The array is always an array of strings and never an array of numbers,\n and it may contain duplicates.\n The order of the array should be ascending by length of each word, and you\n should return the array sorted by that rule.\n If two words have the same length, sort the array alphabetically.\n The function should return an array of strings in sorted order.\n You may assume that all words will have the same length.\n For example:\n >>> list_sort([\"aa\", \"a\", \"aaa\"])\n [\"aa\"]\n >>> list_sort([\"ab\", \"a\", \"aaa\", \"cd\"])\n [\"ab\", \"cd\"]\n \n*/\nstring[] sorted_list_sum(string[] lst) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = sorted_list_sum;\n\n assert(candidate([\"aa\", \"a\", \"aaa\"]) == [\"aa\"]);\n assert(candidate([\"school\", \"AI\", \"asdf\", \"b\"]) == [\"AI\", \"asdf\", \"school\"]);\n assert(candidate([\"d\", \"b\", \"c\", \"a\"]) == []);\n assert(candidate([\"d\", \"dcba\", \"abcd\", \"a\"]) == [\"abcd\", \"dcba\"]);\n assert(candidate([\"AI\", \"ai\", \"au\"]) == [\"AI\", \"ai\", \"au\"]);\n assert(candidate([\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"]) == []);\n assert(candidate([\"aaaa\", \"bbbb\", \"dd\", \"cc\"]) == [\"cc\", \"dd\", \"aaaa\", \"bbbb\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n You are given an array arr of integers and you need to return\n sum of magnitudes of integers multiplied by product of all signs\n of each number in the array, represented by 1, -1 or 0.\n Note: return null for empty arr.\n\n Example:\n >>> prod_signs([1L, 2L, 2L, -4L])\n 9L\n >>> prod_signs([0L, 1L])\n 0L\n >>> prod_signs([])\n None\n \n*/\nNullable!(long) prod_signs(long[] arr) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = prod_signs;\n\n{\n auto result = candidate([1L, 2L, 2L, -4L]);\n assert(!result.isNull && result.get == -9L);\n}\n\n{\n auto result = candidate([0L, 1L]);\n assert(!result.isNull && result.get == 0L);\n}\n\n{\n auto result = candidate([1L, 1L, 1L, 2L, 3L, -1L, 1L]);\n assert(!result.isNull && result.get == -10L);\n}\n\n{\n auto result = candidate([]);\n assert(result.isNull);\n}\n\n{\n auto result = candidate([2L, 4L, 1L, 2L, -1L, -1L, 9L]);\n assert(!result.isNull && result.get == 20L);\n}\n\n{\n auto result = candidate([-1L, 1L, -1L, 1L]);\n assert(!result.isNull && result.get == 4L);\n}\n\n{\n auto result = candidate([-1L, 1L, 1L, 1L]);\n assert(!result.isNull && result.get == -4L);\n}\n\n{\n auto result = candidate([-1L, 1L, 1L, 0L]);\n assert(!result.isNull && result.get == 0L);\n}\n\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nReturn array with elements incremented by 1.\n >>> incr_list([1L, 2L, 3L])\n [2L, 3L, 4L]\n >>> incr_list([5L, 3L, 5L, 2L, 3L, 3L, 9L, 0L, 123L])\n [6L, 4L, 6L, 3L, 4L, 4L, 10L, 1L, 124L]\n \n*/\nlong[] incr_list(long[] l) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = incr_list;\n\n assert(candidate([]) == []);\n assert(candidate([3L, 2L, 1L]) == [4L, 3L, 2L]);\n assert(candidate([5L, 2L, 5L, 2L, 3L, 3L, 9L, 0L, 123L]) == [6L, 3L, 6L, 3L, 4L, 4L, 10L, 1L, 124L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n From a given array of integers, generate an array of rolling maximum element found until given moment\n in the sequence.\n >>> rolling_max([1L, 2L, 3L, 2L, 3L, 4L, 2L])\n [1L, 2L, 3L, 3L, 3L, 4L, 4L]\n \n*/\nlong[] rolling_max(long[] numbers) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = rolling_max;\n\n assert(candidate([]) == []);\n assert(candidate([1L, 2L, 3L, 4L]) == [1L, 2L, 3L, 4L]);\n assert(candidate([4L, 3L, 2L, 1L]) == [4L, 4L, 4L, 4L]);\n assert(candidate([3L, 2L, 3L, 100L, 3L]) == [3L, 3L, 3L, 100L, 100L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n separate those group into separate strings and return the array of those.\n Separate groups are balanced (each open brace is properly closed) and not nested within each other\n Ignore any spaces in the input string.\n >>> separate_paren_groups(\"( ) (( )) (( )( ))\")\n [\"()\", \"(())\", \"(()())\"]\n \n*/\nstring[] separate_paren_groups(string paren_string) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = separate_paren_groups;\n\n assert(candidate(\"(()()) ((())) () ((())()())\") == [\"(()())\", \"((()))\", \"()\", \"((())()())\"]);\n assert(candidate(\"() (()) ((())) (((())))\") == [\"()\", \"(())\", \"((()))\", \"(((())))\"]);\n assert(candidate(\"(()(())((())))\") == [\"(()(())((())))\"]);\n assert(candidate(\"( ) (( )) (( )( ))\") == [\"()\", \"(())\", \"(()())\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n You will be given a string of words separated by commas or spaces. Your task is\n to split the string into words and return an array of the words.\n \n For example:\n >>> words_string(\"Hi, my name is John\")\n [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n >>> words_string(\"One, two, three, four, five, six\")\n [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\n \n*/\nstring[] words_string(string s) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = words_string;\n\n assert(candidate(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]);\n assert(candidate(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]);\n assert(candidate(\"Hi, my name\") == [\"Hi\", \"my\", \"name\"]);\n assert(candidate(\"One,, two, three, four, five, six,\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]);\n assert(candidate(\"\") == []);\n assert(candidate(\"ahmed , gamal\") == [\"ahmed\", \"gamal\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nThis function takes an array l and returns an array l' such that\n l' is identical to l in the odd indicies, while its values at the even indicies are equal\n to the values of the even indicies of l, but sorted.\n >>> sort_even([1L, 2L, 3L])\n [1L, 2L, 3L]\n >>> sort_even([5L, 6L, 3L, 4L])\n [3L, 6L, 5L, 4L]\n \n*/\nlong[] sort_even(long[] l) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = sort_even;\n\n assert(candidate([1L, 2L, 3L]) == [1L, 2L, 3L]);\n assert(candidate([5L, 3L, -5L, 2L, -3L, 3L, 9L, 0L, 123L, 1L, -10L]) == [-10L, 3L, -5L, 2L, -3L, 3L, 5L, 0L, 9L, 1L, 123L]);\n assert(candidate([5L, 8L, -12L, 4L, 23L, 2L, 3L, 11L, 12L, -10L]) == [-12L, 8L, 3L, 4L, 5L, 2L, 12L, 11L, 23L, -10L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nI think we all remember that feeling when the result of some long-awaited\n event is finally known. The feelings and thoughts you have at that moment are\n definitely worth noting down and comparing.\n Your task is to determine if a person correctly guessed the results of a number of matches.\n You are given two arrays of scores and guesses of equal length, where each index shows a match. \n Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n the value is 0, and if not, the value is the absolute difference between the guess and the score.\n \n \n example:\n\n >>> compare([1L, 2L, 3L, 4L, 5L, 1L], [1L, 2L, 3L, 4L, 2L, -2L])\n [0L, 0L, 0L, 0L, 3L, 3L]\n >>> compare([0L, 5L, 0L, 0L, 0L, 4L], [4L, 1L, 1L, 0L, 0L, -2L])\n [4L, 4L, 1L, 0L, 0L, 6L]\n \n*/\nlong[] compare(long[] game, long[] guess) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = compare;\n\n assert(candidate([1L, 2L, 3L, 4L, 5L, 1L], [1L, 2L, 3L, 4L, 2L, -2L]) == [0L, 0L, 0L, 0L, 3L, 3L]);\n assert(candidate([0L, 0L, 0L, 0L, 0L, 0L], [0L, 0L, 0L, 0L, 0L, 0L]) == [0L, 0L, 0L, 0L, 0L, 0L]);\n assert(candidate([1L, 2L, 3L], [-1L, -2L, -3L]) == [2L, 4L, 6L]);\n assert(candidate([1L, 2L, 3L, 5L], [-1L, 2L, 3L, 4L]) == [2L, 0L, 0L, 1L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given a positive integer n, return a tuple that has the number of even and odd\n integer palindromes that fall within the range(1, n), inclusive.\n\n Example 1:\n\n >>> even_odd_palindrome(3L)\n tuple(1L, 2L)\n Explanation:\n Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n\n Example 2:\n\n >>> even_odd_palindrome(12L)\n tuple(4L, 6L)\n Explanation:\n Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n\n Note:\n 1. 1 <= n <= 10^3\n 2. returned tuple has the number of even and odd integer palindromes respectively.\n \n*/\nTuple!(long, long) even_odd_palindrome(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = even_odd_palindrome;\n\n assert(candidate(123L) == tuple(8L, 13L));\n assert(candidate(12L) == tuple(4L, 6L));\n assert(candidate(3L) == tuple(1L, 2L));\n assert(candidate(63L) == tuple(6L, 8L));\n assert(candidate(25L) == tuple(5L, 6L));\n assert(candidate(19L) == tuple(4L, 6L));\n assert(candidate(9L) == tuple(4L, 5L));\n assert(candidate(1L) == tuple(0L, 1L));\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nThe Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fib4(0) -> 0\n fib4(1) -> 0\n fib4(2) -> 2\n fib4(3) -> 0\n fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n >>> fib4(5L)\n 4L\n >>> fib4(6L)\n 8L\n >>> fib4(7L)\n 14L\n \n*/\nlong fib4(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = fib4;\n\n assert(candidate(5L) == 4L);\n assert(candidate(8L) == 28L);\n assert(candidate(10L) == 104L);\n assert(candidate(12L) == 386L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given two positive integers a and b, return the even digits between a\n and b, in ascending order.\n\n For example:\n >>> generate_integers(2L, 8L)\n [2L, 4L, 6L, 8L]\n >>> generate_integers(8L, 2L)\n [2L, 4L, 6L, 8L]\n >>> generate_integers(10L, 14L)\n []\n \n*/\nlong[] generate_integers(long a, long b) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = generate_integers;\n\n assert(candidate(2L, 10L) == [2L, 4L, 6L, 8L]);\n assert(candidate(10L, 2L) == [2L, 4L, 6L, 8L]);\n assert(candidate(132L, 2L) == [2L, 4L, 6L, 8L]);\n assert(candidate(17L, 89L) == []);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n For a given array of input numbers, calculate Mean Absolute Deviation\n around the mean of this dataset.\n Mean Absolute Deviation is the average absolute difference between each\n element and a centerpoint (mean in this case):\n MAD = average | x - x_mean |\n >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n 1.0\n \n*/\nfloat mean_absolute_deviation(float[] numbers) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = mean_absolute_deviation;\n\n assert(candidate([1.0, 2.0]) == 0.5);\n assert(candidate([1.0, 2.0, 3.0, 4.0]) == 1.0);\n assert(candidate([1.0, 2.0, 3.0, 4.0, 5.0]) == 1.2);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nCreate a function encrypt that takes a string as an argument and\n returns a string encrypted with the alphabet being rotated. \n The alphabet should be rotated in a manner such that the letters \n shift down by two multiplied to two places.\n For example:\n >>> encrypt(\"hi\")\n \"lm\"\n >>> encrypt(\"asdfghjkl\")\n \"ewhjklnop\"\n >>> encrypt(\"gf\")\n \"kj\"\n >>> encrypt(\"et\")\n \"ix\"\n \n*/\nstring encrypt(string s) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = encrypt;\n\n assert(candidate(\"hi\") == \"lm\");\n assert(candidate(\"asdfghjkl\") == \"ewhjklnop\");\n assert(candidate(\"gf\") == \"kj\");\n assert(candidate(\"et\") == \"ix\");\n assert(candidate(\"faewfawefaewg\") == \"jeiajeaijeiak\");\n assert(candidate(\"hellomyfriend\") == \"lippsqcjvmirh\");\n assert(candidate(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\") == \"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\");\n assert(candidate(\"a\") == \"e\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given a positive integer n, return a sorted array that has the odd numbers in collatz sequence.\n\n The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n as follows: start with any positive integer n. Then each term is obtained from the \n previous term as follows: if the previous term is even, the next term is one half of \n the previous term. If the previous term is odd, the next term is 3 times the previous\n term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n\n Note: \n 1. Collatz(1) is [1].\n 2. returned array sorted in increasing order.\n\n For example:\n get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n >>> get_odd_collatz(5L)\n [1L, 5L]\n \n*/\nlong[] get_odd_collatz(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = get_odd_collatz;\n\n assert(candidate(14L) == [1L, 5L, 7L, 11L, 13L, 17L]);\n assert(candidate(5L) == [1L, 5L]);\n assert(candidate(12L) == [1L, 3L, 5L]);\n assert(candidate(1L) == [1L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Find how many times a given substring can be found in the original string. Count overlaping cases.\n >>> how_many_times(\"\", \"a\")\n 0L\n >>> how_many_times(\"aaa\", \"a\")\n 3L\n >>> how_many_times(\"aaaa\", \"aa\")\n 3L\n \n*/\nlong how_many_times(string string, string substring) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = how_many_times;\n\n assert(candidate(\"\", \"x\") == 0L);\n assert(candidate(\"xyxyxyx\", \"x\") == 4L);\n assert(candidate(\"cacacacac\", \"cac\") == 4L);\n assert(candidate(\"john doe\", \"john\") == 1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nWe have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n numbers in the array will be randomly ordered. Your task is to determine if\n it is possible to get an array sorted in non-decreasing order by performing \n the following operation on the given array:\n You are allowed to perform right shift operation any number of times.\n \n One right shift operation means shifting all elements of the array by one\n position in the right direction. The last element of the array will be moved to\n the starting position in the array i.e. 0th index. \n\n If it is possible to obtain the sorted array by performing the above operation\n then return true else return false.\n If the given array is empty then return true.\n\n Note: The given array is guaranteed to have unique elements.\n\n For Example:\n \n >>> move_one_ball([3L, 4L, 5L, 1L, 2L])\n true\n Explanation: By performin 2 right shift operations, non-decreasing order can\n be achieved for the given array.\n >>> move_one_ball([3L, 5L, 4L, 1L, 2L])\n false\n Explanation:It is not possible to get non-decreasing order for the given\n array by performing any number of right shift operations.\n \n \n*/\nbool move_one_ball(long[] arr) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = move_one_ball;\n\n assert(candidate([3L, 4L, 5L, 1L, 2L]) == true);\n assert(candidate([3L, 5L, 10L, 1L, 2L]) == true);\n assert(candidate([4L, 3L, 1L, 2L]) == false);\n assert(candidate([3L, 5L, 4L, 1L, 2L]) == false);\n assert(candidate([]) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Write a function which sorts the given array of integers\n in ascending order according to the sum of their digits.\n Note: if there are several items with similar sum of their digits,\n order them based on their index in original array.\n\n For example:\n >>> order_by_points([1L, 11L, -1L, -11L, -12L])\n [-1L, -11L, 1L, -12L, 11L]\n >>> order_by_points([])\n []\n \n*/\nlong[] order_by_points(long[] nums) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = order_by_points;\n\n assert(candidate([1L, 11L, -1L, -11L, -12L]) == [-1L, -11L, 1L, -12L, 11L]);\n assert(candidate([1234L, 423L, 463L, 145L, 2L, 423L, 423L, 53L, 6L, 37L, 3457L, 3L, 56L, 0L, 46L]) == [0L, 2L, 3L, 6L, 53L, 423L, 423L, 423L, 1234L, 145L, 37L, 46L, 56L, 463L, 3457L]);\n assert(candidate([]) == []);\n assert(candidate([1L, -11L, -32L, 43L, 54L, -98L, 2L, -3L]) == [-3L, -32L, -98L, -11L, 1L, 2L, 43L, 54L]);\n assert(candidate([1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L]) == [1L, 10L, 2L, 11L, 3L, 4L, 5L, 6L, 7L, 8L, 9L]);\n assert(candidate([0L, 6L, 6L, -76L, -21L, 23L, 4L]) == [-76L, -21L, 0L, 4L, 23L, 6L, 6L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Return array of prime factors of given integer in the order from smallest to largest.\n Each of the factors should be arrayed number of times corresponding to how many times it appeares in factorization.\n Input number should be equal to the product of all factors\n >>> factorize(8L)\n [2L, 2L, 2L]\n >>> factorize(25L)\n [5L, 5L]\n >>> factorize(70L)\n [2L, 5L, 7L]\n \n*/\nlong[] factorize(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = factorize;\n\n assert(candidate(2L) == [2L]);\n assert(candidate(4L) == [2L, 2L]);\n assert(candidate(8L) == [2L, 2L, 2L]);\n assert(candidate(57L) == [3L, 19L]);\n assert(candidate(3249L) == [3L, 3L, 19L, 19L]);\n assert(candidate(185193L) == [3L, 3L, 3L, 19L, 19L, 19L]);\n assert(candidate(20577L) == [3L, 19L, 19L, 19L]);\n assert(candidate(18L) == [2L, 3L, 3L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nReturn true if all numbers in the array l are below threshold t.\n >>> below_threshold([1L, 2L, 4L, 10L], 100L)\n true\n >>> below_threshold([1L, 20L, 4L, 10L], 5L)\n false\n \n*/\nbool below_threshold(long[] l, long t) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = below_threshold;\n\n assert(candidate([1L, 2L, 4L, 10L], 100L) == true);\n assert(candidate([1L, 20L, 4L, 10L], 5L) == false);\n assert(candidate([1L, 20L, 4L, 10L], 21L) == true);\n assert(candidate([1L, 20L, 4L, 10L], 22L) == true);\n assert(candidate([1L, 8L, 4L, 10L], 11L) == true);\n assert(candidate([1L, 8L, 4L, 10L], 10L) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n For each of the group, output the deepest level of nesting of parentheses.\n E.g. (()()) has maximum two levels of nesting while ((())) has three.\n\n >>> parse_nested_parens(\"(()()) ((())) () ((())()())\")\n [2L, 3L, 1L, 3L]\n \n*/\nlong[] parse_nested_parens(string paren_string) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = parse_nested_parens;\n\n assert(candidate(\"(()()) ((())) () ((())()())\") == [2L, 3L, 1L, 3L]);\n assert(candidate(\"() (()) ((())) (((())))\") == [1L, 2L, 3L, 4L]);\n assert(candidate(\"(()(())((())))\") == [4L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nGiven a non-empty array of integers, return the sum of all of the odd elements that are in even positions.\n \n\n Examples\n >>> solution([5L, 8L, 7L, 1L])\n 12L\n >>> solution([3L, 3L, 3L, 3L, 3L])\n 9L\n >>> solution([30L, 13L, 24L, 321L])\n 0L\n \n*/\nlong solution(long[] lst) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = solution;\n\n assert(candidate([5L, 8L, 7L, 1L]) == 12L);\n assert(candidate([3L, 3L, 3L, 3L, 3L]) == 9L);\n assert(candidate([30L, 13L, 24L, 321L]) == 0L);\n assert(candidate([5L, 9L]) == 5L);\n assert(candidate([2L, 4L, 8L]) == 0L);\n assert(candidate([30L, 13L, 23L, 32L]) == 23L);\n assert(candidate([3L, 13L, 2L, 9L]) == 3L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n You are given a positive integer n. You have to create an integer array a of length n.\n For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n and a[i] + a[j] + a[k] is a multiple of 3.\n\n Example :\n >>> get_max_triples(5L)\n 1L\n Explanation: \n a = [1, 3, 7, 13, 21]\n The only valid triple is (1, 7, 13).\n \n*/\nlong get_max_triples(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = get_max_triples;\n\n assert(candidate(5L) == 1L);\n assert(candidate(6L) == 4L);\n assert(candidate(10L) == 36L);\n assert(candidate(100L) == 53361L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n You are given an array of integers.\n Write a function next_smallest() that returns the 2nd smallest element of the array.\n Return null if there is no such element.\n >>> next_smallest([1L, 2L, 3L, 4L, 5L])\n 2L\n >>> next_smallest([5L, 1L, 4L, 3L, 2L])\n 2L\n >>> next_smallest([])\n None\n >>> next_smallest([1L, 1L])\n None\n \n*/\nNullable!(long) next_smallest(long[] lst) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = next_smallest;\n\n{\n auto result = candidate([1L, 2L, 3L, 4L, 5L]);\n assert(!result.isNull && result.get == 2L);\n}\n\n{\n auto result = candidate([5L, 1L, 4L, 3L, 2L]);\n assert(!result.isNull && result.get == 2L);\n}\n\n{\n auto result = candidate([]);\n assert(result.isNull);\n}\n\n{\n auto result = candidate([1L, 1L]);\n assert(result.isNull);\n}\n\n{\n auto result = candidate([1L, 1L, 1L, 1L, 0L]);\n assert(!result.isNull && result.get == 1L);\n}\n\n{\n auto result = candidate([1L, 1L]);\n assert(result.isNull);\n}\n\n{\n auto result = candidate([-35L, 34L, 12L, -45L]);\n assert(!result.isNull && result.get == -35L);\n}\n\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Input is a space-delimited string of numberals from 'zero' to 'nine'.\n Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n Return the string with numbers sorted from smallest to largest\n >>> sort_numbers(\"three one five\")\n \"one three five\"\n \n*/\nstring sort_numbers(string numbers) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = sort_numbers;\n\n assert(candidate(\"\") == \"\");\n assert(candidate(\"three\") == \"three\");\n assert(candidate(\"three five nine\") == \"three five nine\");\n assert(candidate(\"five zero four seven nine eight\") == \"zero four five seven eight nine\");\n assert(candidate(\"six five four three two one zero\") == \"zero one two three four five six\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou are given 2 words. You need to return true if the second word or any of its rotations is a substring in the first word\n >>> cycpattern_check(\"abcd\", \"abd\")\n false\n >>> cycpattern_check(\"hello\", \"ell\")\n true\n >>> cycpattern_check(\"whassup\", \"psus\")\n false\n >>> cycpattern_check(\"abab\", \"baa\")\n true\n >>> cycpattern_check(\"efef\", \"eeff\")\n false\n >>> cycpattern_check(\"himenss\", \"simen\")\n true\n\n \n*/\nbool cycpattern_check(string a, string b) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = cycpattern_check;\n\n assert(candidate(\"xyzw\", \"xyw\") == false);\n assert(candidate(\"yello\", \"ell\") == true);\n assert(candidate(\"whattup\", \"ptut\") == false);\n assert(candidate(\"efef\", \"fee\") == true);\n assert(candidate(\"abab\", \"aabb\") == false);\n assert(candidate(\"winemtt\", \"tinem\") == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou will be given a number in decimal form and your task is to convert it to\n binary format. The function should return a string, with each character representing a binary\n number. Each character in the string will be '0' or '1'.\n\n There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n The extra characters are there to help with the format.\n\n Examples:\n >>> decimal_to_binary(15L)\n \"db1111db\"\n >>> decimal_to_binary(32L)\n \"db100000db\"\n \n*/\nstring decimal_to_binary(long decimal) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = decimal_to_binary;\n\n assert(candidate(0L) == \"db0db\");\n assert(candidate(32L) == \"db100000db\");\n assert(candidate(103L) == \"db1100111db\");\n assert(candidate(15L) == \"db1111db\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Filter an input array of strings only for ones that contain given substring\n >>> filter_by_substring([], \"a\")\n []\n >>> filter_by_substring([\"abc\", \"bacd\", \"cde\", \"array\"], \"a\")\n [\"abc\", \"bacd\", \"array\"]\n \n*/\nstring[] filter_by_substring(string[] strings, string substring) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = filter_by_substring;\n\n assert(candidate([], \"john\") == []);\n assert(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\") == [\"xxx\", \"xxxAAA\", \"xxx\"]);\n assert(candidate([\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xx\") == [\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"]);\n assert(candidate([\"grunt\", \"trumpet\", \"prune\", \"gruesome\"], \"run\") == [\"grunt\", \"prune\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nGiven an integer. return a tuple that has the number of even and odd digits respectively.\n\n Example:\n >>> even_odd_count(-12L)\n tuple(1L, 1L)\n >>> even_odd_count(123L)\n tuple(1L, 2L)\n \n*/\nTuple!(long, long) even_odd_count(long num) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = even_odd_count;\n\n assert(candidate(7L) == tuple(0L, 1L));\n assert(candidate(-78L) == tuple(1L, 1L));\n assert(candidate(3452L) == tuple(2L, 2L));\n assert(candidate(346211L) == tuple(3L, 3L));\n assert(candidate(-345821L) == tuple(3L, 3L));\n assert(candidate(-2L) == tuple(1L, 0L));\n assert(candidate(-45347L) == tuple(2L, 3L));\n assert(candidate(0L) == tuple(1L, 0L));\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nWrite a function that accepts an array of strings.\n The array contains different words. Return the word with maximum number\n of unique characters. If multiple strings have maximum number of unique\n characters, return the one which comes first in lexicographical order.\n\n >>> find_max([\"name\", \"of\", \"string\"])\n \"string\"\n >>> find_max([\"name\", \"enam\", \"game\"])\n \"enam\"\n >>> find_max([\"aaaaaaa\", \"bb\", \"cc\"])\n \"aaaaaaa\"\n \n*/\nstring find_max(string[] words) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = find_max;\n\n assert(candidate([\"name\", \"of\", \"string\"]) == \"string\");\n assert(candidate([\"name\", \"enam\", \"game\"]) == \"enam\");\n assert(candidate([\"aaaaaaa\", \"bb\", \"cc\"]) == \"aaaaaaa\");\n assert(candidate([\"abc\", \"cba\"]) == \"abc\");\n assert(candidate([\"play\", \"this\", \"game\", \"of\", \"footbott\"]) == \"footbott\");\n assert(candidate([\"we\", \"are\", \"gonna\", \"rock\"]) == \"gonna\");\n assert(candidate([\"we\", \"are\", \"a\", \"mad\", \"nation\"]) == \"nation\");\n assert(candidate([\"this\", \"is\", \"a\", \"prrk\"]) == \"this\");\n assert(candidate([\"b\"]) == \"b\");\n assert(candidate([\"play\", \"play\", \"play\"]) == \"play\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given a positive integer n, return the count of the numbers of n-digit\n positive integers that start or end with 1.\n \n*/\nlong starts_one_ends(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = starts_one_ends;\n\n assert(candidate(1L) == 1L);\n assert(candidate(2L) == 18L);\n assert(candidate(3L) == 180L);\n assert(candidate(4L) == 1800L);\n assert(candidate(5L) == 18000L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Create a function that returns a tuple (a, b), where 'a' is\n the largest of negative integers, and 'b' is the smallest\n of positive integers in an array.\n If there is no negative or positive integers, return them as null.\n\n Examples:\n >>> largest_smallest_integers([2L, 4L, 1L, 3L, 5L, 7L])\n tuple(None, 1L)\n >>> largest_smallest_integers([])\n tuple(None, None)\n >>> largest_smallest_integers([0L])\n tuple(None, None)\n \n*/\nTuple!(Nullable!(long), Nullable!(long)) largest_smallest_integers(long[] lst) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = largest_smallest_integers;\n\n{\n auto result = candidate([2L, 4L, 1L, 3L, 5L, 7L]);\n assert(result[0].isNull);\n assert(!result[1].isNull && result[1].get == 1L);\n}\n\n{\n auto result = candidate([2L, 4L, 1L, 3L, 5L, 7L, 0L]);\n assert(result[0].isNull);\n assert(!result[1].isNull && result[1].get == 1L);\n}\n\n{\n auto result = candidate([1L, 3L, 2L, 4L, 5L, 6L, -2L]);\n assert(!result[0].isNull && result[0].get == -2L);\n assert(!result[1].isNull && result[1].get == 1L);\n}\n\n{\n auto result = candidate([4L, 5L, 3L, 6L, 2L, 7L, -7L]);\n assert(!result[0].isNull && result[0].get == -7L);\n assert(!result[1].isNull && result[1].get == 2L);\n}\n\n{\n auto result = candidate([7L, 3L, 8L, 4L, 9L, 2L, 5L, -9L]);\n assert(!result[0].isNull && result[0].get == -9L);\n assert(!result[1].isNull && result[1].get == 2L);\n}\n\n{\n auto result = candidate([]);\n assert(result[0].isNull);\n assert(result[1].isNull);\n}\n\n{\n auto result = candidate([0L]);\n assert(result[0].isNull);\n assert(result[1].isNull);\n}\n\n{\n auto result = candidate([-1L, -3L, -5L, -6L]);\n assert(!result[0].isNull && result[0].get == -1L);\n assert(result[1].isNull);\n}\n\n{\n auto result = candidate([-1L, -3L, -5L, -6L, 0L]);\n assert(!result[0].isNull && result[0].get == -1L);\n assert(result[1].isNull);\n}\n\n{\n auto result = candidate([-6L, -4L, -4L, -3L, 1L]);\n assert(!result[0].isNull && result[0].get == -3L);\n assert(!result[1].isNull && result[1].get == 1L);\n}\n\n{\n auto result = candidate([-6L, -4L, -4L, -3L, -100L, 1L]);\n assert(!result[0].isNull && result[0].get == -3L);\n assert(!result[1].isNull && result[1].get == 1L);\n}\n\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n \"Given an array representing a branch of a tree that has non-negative integer nodes\n your task is to pluck one of the nodes and return it.\n The plucked node should be the node with the smallest even value.\n If multiple nodes with the same smallest even value are found return the node that has smallest index.\n\n The plucked node should be returned in an array, [ smalest_value, its index ],\n If there are no even values or the given array is empty, return [].\n\n Example 1:\n >>> pluck([4L, 2L, 3L])\n [2L, 1L]\n Explanation: 2 has the smallest even value, and 2 has the smallest index.\n\n Example 2:\n >>> pluck([1L, 2L, 3L])\n [2L, 1L]\n Explanation: 2 has the smallest even value, and 2 has the smallest index.\n\n Example 3:\n >>> pluck([])\n []\n \n Example 4:\n >>> pluck([5L, 0L, 3L, 0L, 4L, 2L])\n [0L, 1L]\n Explanation: 0 is the smallest value, but there are two zeros,\n so we will choose the first zero, which has the smallest index.\n\n Constraints:\n * 1 <= nodes.length <= 10000\n * 0 <= node.value\n \n*/\nlong[] pluck(long[] arr) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = pluck;\n\n assert(candidate([4L, 2L, 3L]) == [2L, 1L]);\n assert(candidate([1L, 2L, 3L]) == [2L, 1L]);\n assert(candidate([]) == []);\n assert(candidate([5L, 0L, 3L, 0L, 4L, 2L]) == [0L, 1L]);\n assert(candidate([1L, 2L, 3L, 0L, 5L, 3L]) == [0L, 3L]);\n assert(candidate([5L, 4L, 8L, 4L, 8L]) == [4L, 1L]);\n assert(candidate([7L, 6L, 7L, 1L]) == [6L, 1L]);\n assert(candidate([7L, 9L, 7L, 1L]) == []);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Write a function count_nums which takes an array of integers and returns\n the number of elements which has a sum of digits > 0.\n If a number is negative, then its first signed digit will be negative:\n e.g. -123 has signed digits -1, 2, and 3.\n >>> count_nums([])\n 0L\n >>> count_nums([-1L, 11L, -11L])\n 1L\n >>> count_nums([1L, 1L, 2L])\n 3L\n \n*/\nlong count_nums(long[] arr) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = count_nums;\n\n assert(candidate([]) == 0L);\n assert(candidate([-1L, -2L, 0L]) == 0L);\n assert(candidate([1L, 1L, 2L, -2L, 3L, 4L, 5L]) == 6L);\n assert(candidate([1L, 6L, 9L, -6L, 0L, 1L, 5L]) == 5L);\n assert(candidate([1L, 100L, 98L, -7L, 1L, -1L]) == 4L);\n assert(candidate([12L, 23L, 34L, -45L, -56L, 0L]) == 5L);\n assert(candidate([0L, 1L]) == 1L);\n assert(candidate([1L]) == 1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n each cell of the grid contains a value. Every integer in the range [1, N * N]\n inclusive appears exactly once on the cells of the grid.\n\n You have to find the minimum path of length k in the grid. You can start\n from any cell, and in each step you can move to any of the neighbor cells,\n in other words, you can go to cells which share an edge with you current\n cell.\n Please note that a path of length k means visiting exactly k cells (not\n necessarily distinct).\n You CANNOT go off the grid.\n A path A (of length k) is considered less than a path B (of length k) if\n after making the ordered arrays of the values on the cells that A and B go\n through (let's call them lst_A and lst_B), lst_A is lexicographically less\n than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n lst_A[j] = lst_B[j].\n It is guaranteed that the answer is unique.\n Return an ordered array of the values on the cells that the minimum path go through.\n\n Examples: \n >>> minPath([[1L, 2L, 3L], [4L, 5L, 6L], [7L, 8L, 9L]], 3L)\n [1L, 2L, 1L]\n\n >>> minPath([[5L, 9L, 3L], [4L, 1L, 6L], [7L, 8L, 2L]], 1L)\n [1L]\n \n*/\nlong[] minPath(long[][] grid, long k) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = minPath;\n\n assert(candidate([[1L, 2L, 3L], [4L, 5L, 6L], [7L, 8L, 9L]], 3L) == [1L, 2L, 1L]);\n assert(candidate([[5L, 9L, 3L], [4L, 1L, 6L], [7L, 8L, 2L]], 1L) == [1L]);\n assert(candidate([[1L, 2L, 3L, 4L], [5L, 6L, 7L, 8L], [9L, 10L, 11L, 12L], [13L, 14L, 15L, 16L]], 4L) == [1L, 2L, 1L, 2L]);\n assert(candidate([[6L, 4L, 13L, 10L], [5L, 7L, 12L, 1L], [3L, 16L, 11L, 15L], [8L, 14L, 9L, 2L]], 7L) == [1L, 10L, 1L, 10L, 1L, 10L, 1L]);\n assert(candidate([[8L, 14L, 9L, 2L], [6L, 4L, 13L, 15L], [5L, 7L, 1L, 12L], [3L, 10L, 11L, 16L]], 5L) == [1L, 7L, 1L, 7L, 1L]);\n assert(candidate([[11L, 8L, 7L, 2L], [5L, 16L, 14L, 4L], [9L, 3L, 15L, 6L], [12L, 13L, 10L, 1L]], 9L) == [1L, 6L, 1L, 6L, 1L, 6L, 1L, 6L, 1L]);\n assert(candidate([[12L, 13L, 10L, 1L], [9L, 3L, 15L, 6L], [5L, 16L, 14L, 4L], [11L, 8L, 7L, 2L]], 12L) == [1L, 6L, 1L, 6L, 1L, 6L, 1L, 6L, 1L, 6L, 1L, 6L]);\n assert(candidate([[2L, 7L, 4L], [3L, 1L, 5L], [6L, 8L, 9L]], 8L) == [1L, 3L, 1L, 3L, 1L, 3L, 1L, 3L]);\n assert(candidate([[6L, 1L, 5L], [3L, 8L, 9L], [2L, 7L, 4L]], 8L) == [1L, 5L, 1L, 5L, 1L, 5L, 1L, 5L]);\n assert(candidate([[1L, 2L], [3L, 4L]], 10L) == [1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L]);\n assert(candidate([[1L, 3L], [3L, 2L]], 10L) == [1L, 3L, 1L, 3L, 1L, 3L, 1L, 3L, 1L, 3L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given array of integers, return array in strange order.\n Strange sorting, is when you start with the minimum value,\n then maximum of the remaining integers, then minimum and so on.\n\n Examples:\n >>> strange_sort_list([1L, 2L, 3L, 4L])\n [1L, 4L, 2L, 3L]\n >>> strange_sort_list([5L, 5L, 5L, 5L])\n [5L, 5L, 5L, 5L]\n >>> strange_sort_list([])\n []\n \n*/\nlong[] strange_sort_list(long[] lst) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = strange_sort_list;\n\n assert(candidate([1L, 2L, 3L, 4L]) == [1L, 4L, 2L, 3L]);\n assert(candidate([5L, 6L, 7L, 8L, 9L]) == [5L, 9L, 6L, 8L, 7L]);\n assert(candidate([1L, 2L, 3L, 4L, 5L]) == [1L, 5L, 2L, 4L, 3L]);\n assert(candidate([5L, 6L, 7L, 8L, 9L, 1L]) == [1L, 9L, 5L, 8L, 6L, 7L]);\n assert(candidate([5L, 5L, 5L, 5L]) == [5L, 5L, 5L, 5L]);\n assert(candidate([]) == []);\n assert(candidate([1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L]) == [1L, 8L, 2L, 7L, 3L, 6L, 4L, 5L]);\n assert(candidate([0L, 2L, 2L, 2L, 5L, 5L, -5L, -5L]) == [-5L, 5L, -5L, 5L, 0L, 2L, 2L, 2L]);\n assert(candidate([111111L]) == [111111L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given a string 'text', return its md5 hash equivalent string.\n If 'text' is an empty string, return null.\n\n >>> string_to_md5(\"Hello world\")\n \"3e25960a79dbc69b674cd4ec67a72c62\"\n \n*/\nNullable!(string) string_to_md5(string text) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = string_to_md5;\n\n{\n auto result = candidate(\"Hello world\");\n assert(!result.isNull && result.get == \"3e25960a79dbc69b674cd4ec67a72c62\");\n}\n\n{\n auto result = candidate(\"\");\n assert(result.isNull);\n}\n\n{\n auto result = candidate(\"A B C\");\n assert(!result.isNull && result.get == \"0ef78513b0cb8cef12743f5aeb35f888\");\n}\n\n{\n auto result = candidate(\"password\");\n assert(!result.isNull && result.get == \"5f4dcc3b5aa765d61d8327deb882cf99\");\n}\n\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou are given a word. Your task is to find the closest vowel that stands between \n two consonants from the right side of the word (case sensitive).\n \n Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n find any vowel met the above condition. \n\n You may assume that the given string contains English letter only.\n\n Example:\n >>> get_closest_vowel(\"yogurt\")\n \"u\"\n >>> get_closest_vowel(\"FULL\")\n \"U\"\n >>> get_closest_vowel(\"quick\")\n \"\"\n >>> get_closest_vowel(\"ab\")\n \"\"\n \n*/\nstring get_closest_vowel(string word) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = get_closest_vowel;\n\n assert(candidate(\"yogurt\") == \"u\");\n assert(candidate(\"full\") == \"u\");\n assert(candidate(\"easy\") == \"\");\n assert(candidate(\"eAsy\") == \"\");\n assert(candidate(\"ali\") == \"\");\n assert(candidate(\"bad\") == \"a\");\n assert(candidate(\"most\") == \"o\");\n assert(candidate(\"ab\") == \"\");\n assert(candidate(\"ba\") == \"\");\n assert(candidate(\"quick\") == \"\");\n assert(candidate(\"anime\") == \"i\");\n assert(candidate(\"Asia\") == \"\");\n assert(candidate(\"Above\") == \"o\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nChange numerical base of input number x to base.\n return string representation after the conversion.\n base numbers are less than 10.\n >>> change_base(8L, 3L)\n \"22\"\n >>> change_base(8L, 2L)\n \"1000\"\n >>> change_base(7L, 2L)\n \"111\"\n \n*/\nstring change_base(long x, long base) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = change_base;\n\n assert(candidate(8L, 3L) == \"22\");\n assert(candidate(9L, 3L) == \"100\");\n assert(candidate(234L, 2L) == \"11101010\");\n assert(candidate(16L, 2L) == \"10000\");\n assert(candidate(8L, 2L) == \"1000\");\n assert(candidate(7L, 2L) == \"111\");\n assert(candidate(2L, 3L) == \"2\");\n assert(candidate(3L, 4L) == \"3\");\n assert(candidate(4L, 5L) == \"4\");\n assert(candidate(5L, 6L) == \"5\");\n assert(candidate(6L, 7L) == \"6\");\n assert(candidate(7L, 8L) == \"7\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Check if in given array of numbers, are any two numbers closer to each other than\n given threshold.\n >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n false\n >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n true\n \n*/\nbool has_close_elements(float[] numbers, float threshold) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = has_close_elements;\n\n assert(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3) == true);\n assert(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05) == false);\n assert(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.95) == true);\n assert(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.8) == false);\n assert(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1) == true);\n assert(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 1.0) == true);\n assert(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 0.5) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Create a function that takes a string as input which contains only square brackets.\n The function should return true if and only if there is a valid subsequence of brackets \n where at least one bracket in the subsequence is nested.\n\n >>> is_nested(\"[[]]\")\n true\n >>> is_nested(\"[]]]]]]][[[[[]\")\n false\n >>> is_nested(\"[][]\")\n false\n >>> is_nested(\"[]\")\n false\n >>> is_nested(\"[[][]]\")\n true\n >>> is_nested(\"[[]][[\")\n true\n \n*/\nbool is_nested(string string) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = is_nested;\n\n assert(candidate(\"[[]]\") == true);\n assert(candidate(\"[]]]]]]][[[[[]\") == false);\n assert(candidate(\"[][]\") == false);\n assert(candidate(\"[]\") == false);\n assert(candidate(\"[[[[]]]]\") == true);\n assert(candidate(\"[]]]]]]]]]]\") == false);\n assert(candidate(\"[][][[]]\") == true);\n assert(candidate(\"[[]\") == false);\n assert(candidate(\"[]]\") == false);\n assert(candidate(\"[[]][[\") == true);\n assert(candidate(\"[[][]]\") == true);\n assert(candidate(\"\") == false);\n assert(candidate(\"[[[[[[[[\") == false);\n assert(candidate(\"]]]]]]]]\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Concatenate array of strings into a single string\n >>> concatenate([])\n \"\"\n >>> concatenate([\"a\", \"b\", \"c\"])\n \"abc\"\n \n*/\nstring concatenate(string[] strings) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = concatenate;\n\n assert(candidate([]) == \"\");\n assert(candidate([\"x\", \"y\", \"z\"]) == \"xyz\");\n assert(candidate([\"x\", \"y\", \"z\", \"w\", \"k\"]) == \"xyzwk\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n >>> prime_fib(1L)\n 2L\n >>> prime_fib(2L)\n 3L\n >>> prime_fib(3L)\n 5L\n >>> prime_fib(4L)\n 13L\n >>> prime_fib(5L)\n 89L\n \n*/\nlong prime_fib(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = prime_fib;\n\n assert(candidate(1L) == 2L);\n assert(candidate(2L) == 3L);\n assert(candidate(3L) == 5L);\n assert(candidate(4L) == 13L);\n assert(candidate(5L) == 89L);\n assert(candidate(6L) == 233L);\n assert(candidate(7L) == 1597L);\n assert(candidate(8L) == 28657L);\n assert(candidate(9L) == 514229L);\n assert(candidate(10L) == 433494437L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n From a supplied array of numbers (of length at least two) select and return two that are the closest to each\n other and return them in order (smaller number, larger number).\n >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n tuple(2.0, 2.2)\n >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n tuple(2.0, 2.0)\n \n*/\nTuple!(float, float) find_closest_elements(float[] numbers) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = find_closest_elements;\n\n assert(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2]) == tuple(3.9, 4.0));\n assert(candidate([1.0, 2.0, 5.9, 4.0, 5.0]) == tuple(5.0, 5.9));\n assert(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]) == tuple(2.0, 2.2));\n assert(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]) == tuple(2.0, 2.0));\n assert(candidate([1.1, 2.2, 3.1, 4.1, 5.1]) == tuple(2.2, 3.1));\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou have been tasked to write a function that receives \n a hexadecimal number as a string and counts the number of hexadecimal \n digits that are primes (prime number, or a prime, is a natural number \n greater than 1 that is not a product of two smaller natural numbers).\n Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n So you have to determine a number of the following digits: 2, 3, 5, 7, \n B (=decimal 11), D (=decimal 13).\n Note: you may assume the input is always correct or empty string, \n and symbols A,B,C,D,E,F are always uppercase.\n Examples:\n >>> hex_key(\"AB\")\n 1L\n >>> hex_key(\"1077E\")\n 2L\n >>> hex_key(\"ABED1A33\")\n 4L\n >>> hex_key(\"123456789ABCDEF0\")\n 6L\n >>> hex_key(\"2020\")\n 2L\n \n*/\nlong hex_key(string num) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = hex_key;\n\n assert(candidate(\"AB\") == 1L);\n assert(candidate(\"1077E\") == 2L);\n assert(candidate(\"ABED1A33\") == 4L);\n assert(candidate(\"2020\") == 2L);\n assert(candidate(\"123456789ABCDEF0\") == 6L);\n assert(candidate(\"112233445566778899AABBCCDDEEFF00\") == 12L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nComplete the function that takes two integers and returns \n the product of their unit digits.\n Assume the input is always valid.\n Examples:\n >>> multiply(148L, 412L)\n 16L\n >>> multiply(19L, 28L)\n 72L\n >>> multiply(2020L, 1851L)\n 0L\n >>> multiply(14L, -15L)\n 20L\n \n*/\nlong multiply(long a, long b) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = multiply;\n\n assert(candidate(148L, 412L) == 16L);\n assert(candidate(19L, 28L) == 72L);\n assert(candidate(2020L, 1851L) == 0L);\n assert(candidate(14L, -15L) == 20L);\n assert(candidate(76L, 67L) == 42L);\n assert(candidate(17L, 27L) == 49L);\n assert(candidate(0L, 1L) == 0L);\n assert(candidate(0L, 0L) == 0L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Given array of numbers (of at least two elements), apply a linear transform to that array,\n such that the smallest number will become 0 and the largest will become 1\n >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n [0.0, 0.25, 0.5, 0.75, 1.0]\n \n*/\nfloat[] rescale_to_unit(float[] numbers) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = rescale_to_unit;\n\n assert(candidate([2.0, 49.9]) == [0.0, 1.0]);\n assert(candidate([100.0, 49.9]) == [1.0, 0.0]);\n assert(candidate([1.0, 2.0, 3.0, 4.0, 5.0]) == [0.0, 0.25, 0.5, 0.75, 1.0]);\n assert(candidate([2.0, 1.0, 5.0, 3.0, 4.0]) == [0.25, 0.0, 1.0, 0.5, 0.75]);\n assert(candidate([12.0, 11.0, 15.0, 13.0, 14.0]) == [0.25, 0.0, 1.0, 0.5, 0.75]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nGiven a positive integer n, return the product of the odd digits.\n Return 0 if all digits are even.\n For example:\n >>> digits(1L)\n 1L\n >>> digits(4L)\n 0L\n >>> digits(235L)\n 15L\n \n*/\nlong digits(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = digits;\n\n assert(candidate(5L) == 5L);\n assert(candidate(54L) == 5L);\n assert(candidate(120L) == 1L);\n assert(candidate(5014L) == 5L);\n assert(candidate(98765L) == 315L);\n assert(candidate(5576543L) == 2625L);\n assert(candidate(2468L) == 0L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou will be given the name of a class (a string) and an array of extensions.\n The extensions are to be used to load additional classes to the class. The\n strength of the extension is as follows: Let CAP be the number of the uppercase\n letters in the extension's name, and let SM be the number of lowercase letters \n in the extension's name, the strength is given by the fraction CAP - SM. \n You should find the strongest extension and return a string in this \n format: ClassName.StrongestExtensionName.\n If there are two or more extensions with the same strength, you should\n choose the one that comes first in the array.\n For example, if you are given \"Slices\" as the class and an array of the\n extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n (its strength is -1).\n Example:\n >>> Strongest_Extension(\"my_class\", [\"AA\", \"Be\", \"CC\"])\n \"my_class.AA\"\n \n*/\nstring Strongest_Extension(string class_name, string[] extensions) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = Strongest_Extension;\n\n assert(candidate(\"Watashi\", [\"tEN\", \"niNE\", \"eIGHt8OKe\"]) == \"Watashi.eIGHt8OKe\");\n assert(candidate(\"Boku123\", [\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"]) == \"Boku123.YEs.WeCaNe\");\n assert(candidate(\"__YESIMHERE\", [\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"]) == \"__YESIMHERE.NuLl__\");\n assert(candidate(\"K\", [\"Ta\", \"TAR\", \"t234An\", \"cosSo\"]) == \"K.TAR\");\n assert(candidate(\"__HAHA\", [\"Tab\", \"123\", \"781345\", \"-_-\"]) == \"__HAHA.123\");\n assert(candidate(\"YameRore\", [\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"]) == \"YameRore.okIWILL123\");\n assert(candidate(\"finNNalLLly\", [\"Die\", \"NowW\", \"Wow\", \"WoW\"]) == \"finNNalLLly.WoW\");\n assert(candidate(\"_\", [\"Bb\", \"91245\"]) == \"_.Bb\");\n assert(candidate(\"Sp\", [\"671235\", \"Bb\"]) == \"Sp.671235\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nGiven a string representing a space separated lowercase letters, return an associative array\n of the letter with the most repetition and containing the corresponding count.\n If several letters have the same occurrence, return all of them.\n \n Example:\n >>> histogram(\"a b c\")\n [\"a\": 1L, \"b\": 1L, \"c\": 1L].nullable\n >>> histogram(\"a b b a\")\n [\"a\": 2L, \"b\": 2L].nullable\n >>> histogram(\"a b c a b\")\n [\"a\": 2L, \"b\": 2L].nullable\n >>> histogram(\"b b b b a\")\n [\"b\": 4L].nullable\n >>> histogram(\"\")\n ___null_dict___\n\n \n*/\nNullable!(long[string]) histogram(string test) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = histogram;\n\n{\n auto result = candidate(\"a b b a\");\n assert(!result.isNull && result.get == [\"a\": 2L, \"b\": 2L]);\n}\n\n{\n auto result = candidate(\"a b c a b\");\n assert(!result.isNull && result.get == [\"a\": 2L, \"b\": 2L]);\n}\n\n{\n auto result = candidate(\"a b c d g\");\n assert(!result.isNull && result.get == [\"a\": 1L, \"b\": 1L, \"c\": 1L, \"d\": 1L, \"g\": 1L]);\n}\n\n{\n auto result = candidate(\"r t g\");\n assert(!result.isNull && result.get == [\"r\": 1L, \"t\": 1L, \"g\": 1L]);\n}\n\n{\n auto result = candidate(\"b b b b a\");\n assert(!result.isNull && result.get == [\"b\": 4L]);\n}\n\n{\n auto result = candidate(\"r t g\");\n assert(!result.isNull && result.get == [\"r\": 1L, \"t\": 1L, \"g\": 1L]);\n}\n\n{\n auto result = candidate(\"\");\n assert(result.isNull);\n}\n\n{\n auto result = candidate(\"a\");\n assert(!result.isNull && result.get == [\"a\": 1L]);\n}\n\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n pairs_sum_to_zero takes an array of integers as an input.\n it returns true if there are two distinct elements in the array that\n sum to zero, and false otherwise.\n >>> pairs_sum_to_zero([1L, 3L, 5L, 0L])\n false\n >>> pairs_sum_to_zero([1L, 3L, -2L, 1L])\n false\n >>> pairs_sum_to_zero([1L, 2L, 3L, 7L])\n false\n >>> pairs_sum_to_zero([2L, 4L, -5L, 3L, 5L, 7L])\n true\n >>> pairs_sum_to_zero([1L])\n false\n \n*/\nbool pairs_sum_to_zero(long[] l) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = pairs_sum_to_zero;\n\n assert(candidate([1L, 3L, 5L, 0L]) == false);\n assert(candidate([1L, 3L, -2L, 1L]) == false);\n assert(candidate([1L, 2L, 3L, 7L]) == false);\n assert(candidate([2L, 4L, -5L, 3L, 5L, 7L]) == true);\n assert(candidate([1L]) == false);\n assert(candidate([-3L, 9L, -1L, 3L, 2L, 30L]) == true);\n assert(candidate([-3L, 9L, -1L, 3L, 2L, 31L]) == true);\n assert(candidate([-3L, 9L, -1L, 4L, 2L, 30L]) == false);\n assert(candidate([-3L, 9L, -1L, 4L, 2L, 31L]) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Write a function that accepts two arrays of strings and returns the array that has \n total number of chars in the all strings of the array less than the other array.\n\n if the two arrays have the same number of chars, return the first array.\n\n Examples\n >>> total_match([], [])\n []\n >>> total_match([\"hi\", \"admin\"], [\"hI\", \"Hi\"])\n [\"hI\", \"Hi\"]\n >>> total_match([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"])\n [\"hi\", \"admin\"]\n >>> total_match([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"])\n [\"hI\", \"hi\", \"hi\"]\n >>> total_match([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"])\n [\"4\"]\n \n*/\nstring[] total_match(string[] lst1, string[] lst2) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = total_match;\n\n assert(candidate([], []) == []);\n assert(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\"]) == [\"hi\", \"hi\"]);\n assert(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"]) == [\"hi\", \"admin\"]);\n assert(candidate([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"]) == [\"4\"]);\n assert(candidate([\"hi\", \"admin\"], [\"hI\", \"Hi\"]) == [\"hI\", \"Hi\"]);\n assert(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"]) == [\"hI\", \"hi\", \"hi\"]);\n assert(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hii\"]) == [\"hi\", \"admin\"]);\n assert(candidate([], [\"this\"]) == []);\n assert(candidate([\"this\"], []) == []);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nCircular shift the digits of the integer x, shift the digits right by shift\n and return the result as a string.\n If shift > number of digits, return digits reversed.\n >>> circular_shift(12L, 1L)\n \"21\"\n >>> circular_shift(12L, 2L)\n \"12\"\n \n*/\nstring circular_shift(long x, long shift) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = circular_shift;\n\n assert(candidate(100L, 2L) == \"001\");\n assert(candidate(12L, 2L) == \"12\");\n assert(candidate(97L, 8L) == \"79\");\n assert(candidate(12L, 1L) == \"21\");\n assert(candidate(11L, 101L) == \"11\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nReturn true is array elements are monotonically increasing or decreasing.\n >>> monotonic([1L, 2L, 4L, 20L])\n true\n >>> monotonic([1L, 20L, 4L, 10L])\n false\n >>> monotonic([4L, 1L, 0L, -10L])\n true\n \n*/\nbool monotonic(long[] l) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = monotonic;\n\n assert(candidate([1L, 2L, 4L, 10L]) == true);\n assert(candidate([1L, 2L, 4L, 20L]) == true);\n assert(candidate([1L, 20L, 4L, 10L]) == false);\n assert(candidate([4L, 1L, 0L, -10L]) == true);\n assert(candidate([4L, 1L, 1L, 0L]) == true);\n assert(candidate([1L, 2L, 3L, 2L, 5L, 60L]) == false);\n assert(candidate([1L, 2L, 3L, 4L, 5L, 60L]) == true);\n assert(candidate([9L, 9L, 9L, 9L]) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nEvaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n Example\n >>> is_equal_to_sum_even(4L)\n false\n >>> is_equal_to_sum_even(6L)\n false\n >>> is_equal_to_sum_even(8L)\n true\n \n*/\nbool is_equal_to_sum_even(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = is_equal_to_sum_even;\n\n assert(candidate(4L) == false);\n assert(candidate(6L) == false);\n assert(candidate(8L) == true);\n assert(candidate(10L) == true);\n assert(candidate(11L) == false);\n assert(candidate(12L) == true);\n assert(candidate(13L) == false);\n assert(candidate(16L) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Input to this function is a string representing musical notes in a special ASCII format.\n Your task is to parse this string and return array of integers corresponding to how many beats does each\n not last.\n\n Here is a legend:\n 'o' - whole note, lasts four beats\n 'o|' - half note, lasts two beats\n '.|' - quater note, lasts one beat\n\n >>> parse_music(\"o o| .| o| o| .| .| .| .| o o\")\n [4L, 2L, 1L, 2L, 2L, 1L, 1L, 1L, 1L, 4L, 4L]\n \n*/\nlong[] parse_music(string music_string) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = parse_music;\n\n assert(candidate(\"\") == []);\n assert(candidate(\"o o o o\") == [4L, 4L, 4L, 4L]);\n assert(candidate(\".| .| .| .|\") == [1L, 1L, 1L, 1L]);\n assert(candidate(\"o| o| .| .| o o o o\") == [2L, 2L, 1L, 1L, 4L, 4L, 4L, 4L]);\n assert(candidate(\"o| .| o| .| o o| o o|\") == [2L, 1L, 2L, 1L, 4L, 2L, 4L, 2L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\"\n This function will take an array of integers. For all entries in the array, the function shall square the integer entry if its index is a \n multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n change the entries in the array whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n \n Examples:\n >>> lst\n [1L, 2L, 3L]\n >>> lst\n []\n >>> lst\n [-1L, -5L, 2L, -1L, -5L]\n \n*/\nlong sum_squares(long[] lst) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = sum_squares;\n\n assert(candidate([1L, 2L, 3L]) == 6L);\n assert(candidate([1L, 4L, 9L]) == 14L);\n assert(candidate([]) == 0L);\n assert(candidate([1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L]) == 9L);\n assert(candidate([-1L, -1L, -1L, -1L, -1L, -1L, -1L, -1L, -1L]) == -3L);\n assert(candidate([0L]) == 0L);\n assert(candidate([-1L, -5L, 2L, -1L, -5L]) == -126L);\n assert(candidate([-56L, -99L, 1L, 0L, -2L]) == 3030L);\n assert(candidate([-1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, -1L]) == 0L);\n assert(candidate([-16L, -9L, -2L, 36L, 36L, 26L, -20L, 25L, -40L, 20L, -4L, 12L, -26L, 35L, 37L]) == -14196L);\n assert(candidate([-1L, -3L, 17L, -1L, -15L, 13L, -1L, 14L, -14L, -12L, -5L, 14L, -14L, 6L, 13L, 11L, 16L, 16L, 4L, 10L]) == -1448L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n triples_sum_to_zero takes an array of integers as an input.\n it returns true if there are three distinct elements in the array that\n sum to zero, and false otherwise.\n\n >>> triples_sum_to_zero([1L, 3L, 5L, 0L])\n false\n >>> triples_sum_to_zero([1L, 3L, -2L, 1L])\n true\n >>> triples_sum_to_zero([1L, 2L, 3L, 7L])\n false\n >>> triples_sum_to_zero([2L, 4L, -5L, 3L, 9L, 7L])\n true\n >>> triples_sum_to_zero([1L])\n false\n \n*/\nbool triples_sum_to_zero(long[] l) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = triples_sum_to_zero;\n\n assert(candidate([1L, 3L, 5L, 0L]) == false);\n assert(candidate([1L, 3L, 5L, -1L]) == false);\n assert(candidate([1L, 3L, -2L, 1L]) == true);\n assert(candidate([1L, 2L, 3L, 7L]) == false);\n assert(candidate([1L, 2L, 5L, 7L]) == false);\n assert(candidate([2L, 4L, -5L, 3L, 9L, 7L]) == true);\n assert(candidate([1L]) == false);\n assert(candidate([1L, 3L, 5L, -100L]) == false);\n assert(candidate([100L, 3L, 5L, -100L]) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n brackets is a string of \"<\" and \">\".\n return true if every opening bracket has a corresponding closing bracket.\n\n >>> correct_bracketing(\"<\")\n false\n >>> correct_bracketing(\"<>\")\n true\n >>> correct_bracketing(\"<<><>>\")\n true\n >>> correct_bracketing(\"><<>\")\n false\n \n*/\nbool correct_bracketing(string brackets) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = correct_bracketing;\n\n assert(candidate(\"<>\") == true);\n assert(candidate(\"<<><>>\") == true);\n assert(candidate(\"<><><<><>><>\") == true);\n assert(candidate(\"<><><<<><><>><>><<><><<>>>\") == true);\n assert(candidate(\"<<<><>>>>\") == false);\n assert(candidate(\"><<>\") == false);\n assert(candidate(\"<\") == false);\n assert(candidate(\"<<<<\") == false);\n assert(candidate(\">\") == false);\n assert(candidate(\"<<>\") == false);\n assert(candidate(\"<><><<><>><>><<>\") == false);\n assert(candidate(\"<><><<><>><>>><>\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nWrite a function that takes an array of numbers as input and returns \n the number of elements in the array that are greater than 10 and both \n first and last digits of a number are odd (1, 3, 5, 7, 9).\n For example:\n >>> specialFilter([15L, -73L, 14L, -15L])\n 1L\n >>> specialFilter([33L, -2L, -3L, 45L, 21L, 109L])\n 2L\n \n*/\nlong specialFilter(long[] nums) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = specialFilter;\n\n assert(candidate([5L, -2L, 1L, -5L]) == 0L);\n assert(candidate([15L, -73L, 14L, -15L]) == 1L);\n assert(candidate([33L, -2L, -3L, 45L, 21L, 109L]) == 2L);\n assert(candidate([43L, -12L, 93L, 125L, 121L, 109L]) == 4L);\n assert(candidate([71L, -2L, -33L, 75L, 21L, 19L]) == 3L);\n assert(candidate([1L]) == 0L);\n assert(candidate([]) == 0L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given an associative array, return true if all keys are strings in lower \n case or all keys are strings in upper case, else return false.\n The function should return false is the given associative array is empty.\n Examples:\n >>> check_dict_case([\"a\": \"apple\", \"b\": \"banana\"].nullable)\n true\n >>> check_dict_case([\"a\": \"apple\", \"A\": \"banana\", \"B\": \"banana\"].nullable)\n false\n >>> check_dict_case([\"a\": \"apple\", 8L: \"banana\", \"a\": \"apple\"].nullable)\n false\n >>> check_dict_case([\"Name\": \"John\", \"Age\": \"36\", \"City\": \"Houston\"].nullable)\n false\n >>> check_dict_case([\"STATE\": \"NC\", \"ZIP\": \"12345\"].nullable)\n true\n \n*/\nbool check_dict_case(Nullable!(string[string]) dict) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = check_dict_case;\n\n assert(candidate([\"p\": \"pineapple\", \"b\": \"banana\"].nullable) == true);\n assert(candidate([\"p\": \"pineapple\", \"A\": \"banana\", \"B\": \"banana\"].nullable) == false);\n assert(candidate([\"p\": \"pineapple\", \"5\": \"banana\", \"a\": \"apple\"].nullable) == false);\n assert(candidate([\"Name\": \"John\", \"Age\": \"36\", \"City\": \"Houston\"].nullable) == false);\n assert(candidate([\"STATE\": \"NC\", \"ZIP\": \"12345\"].nullable) == true);\n assert(candidate([\"fruit\": \"Orange\", \"taste\": \"Sweet\"].nullable) == true);\n assert(candidate(Nullable!(string[string]).init) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nThe FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fibfib(0) == 0\n fibfib(1) == 0\n fibfib(2) == 1\n fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n >>> fibfib(1L)\n 0L\n >>> fibfib(5L)\n 4L\n >>> fibfib(8L)\n 24L\n \n*/\nlong fibfib(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = fibfib;\n\n assert(candidate(2L) == 1L);\n assert(candidate(1L) == 0L);\n assert(candidate(5L) == 4L);\n assert(candidate(8L) == 24L);\n assert(candidate(10L) == 81L);\n assert(candidate(12L) == 274L);\n assert(candidate(14L) == 927L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou are given an array of numbers.\n You need to return the sum of squared numbers in the given array,\n round each element in the array to the upper int(Ceiling) first.\n Examples:\n >>> lst([1.0, 2.0, 3.0])\n 14L\n >>> lst([1.0, 4.0, 9.0])\n 98L\n >>> lst([1.0, 3.0, 5.0, 7.0])\n 84L\n >>> lst([1.4, 4.2, 0.0])\n 29L\n >>> lst([-2.4, 1.0, 1.0])\n 6L\n \n\n \n*/\nlong sum_squares(float[] lst) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = sum_squares;\n\n assert(candidate([1.0, 2.0, 3.0]) == 14L);\n assert(candidate([1.0, 2.0, 3.0]) == 14L);\n assert(candidate([1.0, 3.0, 5.0, 7.0]) == 84L);\n assert(candidate([1.4, 4.2, 0.0]) == 29L);\n assert(candidate([-2.4, 1.0, 1.0]) == 6L);\n assert(candidate([100.0, 1.0, 15.0, 2.0]) == 10230L);\n assert(candidate([10000.0, 10000.0]) == 200000000L);\n assert(candidate([-1.4, 4.6, 6.3]) == 75L);\n assert(candidate([-1.4, 17.9, 18.9, 19.9]) == 1086L);\n assert(candidate([0.0]) == 0L);\n assert(candidate([-1.0]) == 1L);\n assert(candidate([-1.0, 1.0, 0.0]) == 2L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_85_add", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nGiven a non-empty array of integers lst. add the even elements that are at odd indices..\n\n\n Examples:\n >>> add([4L, 2L, 6L, 7L])\n 2L\n \n*/\nlong add(long[] lst) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = add;\n\n assert(candidate([4L, 88L]) == 88L);\n assert(candidate([4L, 5L, 6L, 7L, 2L, 122L]) == 122L);\n assert(candidate([4L, 0L, 6L, 7L]) == 0L);\n assert(candidate([4L, 4L, 6L, 8L]) == 12L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nReturn sorted unique elements in an array\n >>> unique([5L, 3L, 5L, 2L, 3L, 3L, 9L, 0L, 123L])\n [0L, 2L, 3L, 5L, 9L, 123L]\n \n*/\nlong[] unique(long[] l) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = unique;\n\n assert(candidate([5L, 3L, 5L, 2L, 3L, 3L, 9L, 0L, 123L]) == [0L, 2L, 3L, 5L, 9L, 123L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given a string text, replace all spaces in it with underscores, \n and if a string has more than 2 consecutive spaces, \n then replace all consecutive spaces with - \n \n >>> fix_spaces(\" Example\")\n \"Example\"\n >>> fix_spaces(\" Example 1\")\n \"Example_1\"\n >>> fix_spaces(\" Example 2\")\n \"_Example_2\"\n >>> fix_spaces(\" Example 3\")\n \"_Example-3\"\n \n*/\nstring fix_spaces(string text) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = fix_spaces;\n\n assert(candidate(\"Example\") == \"Example\");\n assert(candidate(\"Mudasir Hanif \") == \"Mudasir_Hanif_\");\n assert(candidate(\"Yellow Yellow Dirty Fellow\") == \"Yellow_Yellow__Dirty__Fellow\");\n assert(candidate(\"Exa mple\") == \"Exa-mple\");\n assert(candidate(\" Exa 1 2 2 mple\") == \"-Exa_1_2_2_mple\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nReturn 2^n modulo p (be aware of numerics).\n >>> modp(3L, 5L)\n 3L\n >>> modp(1101L, 101L)\n 2L\n >>> modp(0L, 101L)\n 1L\n >>> modp(3L, 11L)\n 8L\n >>> modp(100L, 101L)\n 1L\n \n*/\nlong modp(long n, long p) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = modp;\n\n assert(candidate(3L, 5L) == 3L);\n assert(candidate(1101L, 101L) == 2L);\n assert(candidate(0L, 101L) == 1L);\n assert(candidate(3L, 11L) == 8L);\n assert(candidate(100L, 101L) == 1L);\n assert(candidate(30L, 5L) == 4L);\n assert(candidate(31L, 5L) == 3L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou have to write a function which validates a given date string and\n returns true if the date is valid otherwise false.\n The date is valid if all of the following rules are satisfied:\n 1. The date string is not empty.\n 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n 3. The months should not be less than 1 or higher than 12.\n 4. The date should be in the format: mm-dd-yyyy\n\n >>> valid_date(\"03-11-2000\")\n true\n\n >>> valid_date(\"15-01-2012\")\n false\n\n >>> valid_date(\"04-0-2040\")\n false\n\n >>> valid_date(\"06-04-2020\")\n true\n\n >>> valid_date(\"06/04/2020\")\n false\n \n*/\nbool valid_date(string date) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = valid_date;\n\n assert(candidate(\"03-11-2000\") == true);\n assert(candidate(\"15-01-2012\") == false);\n assert(candidate(\"04-0-2040\") == false);\n assert(candidate(\"06-04-2020\") == true);\n assert(candidate(\"01-01-2007\") == true);\n assert(candidate(\"03-32-2011\") == false);\n assert(candidate(\"\") == false);\n assert(candidate(\"04-31-3000\") == false);\n assert(candidate(\"06-06-2005\") == true);\n assert(candidate(\"21-31-2000\") == false);\n assert(candidate(\"04-12-2003\") == true);\n assert(candidate(\"04122003\") == false);\n assert(candidate(\"20030412\") == false);\n assert(candidate(\"2003-04\") == false);\n assert(candidate(\"2003-04-12\") == false);\n assert(candidate(\"04-2003\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Write a function that takes a string and returns an ordered version of it.\n Ordered version of string, is a string where all words (separated by space)\n are replaced by a new word where all the characters arranged in\n ascending order based on ascii value.\n Note: You should keep the order of words and blank spaces in the sentence.\n\n For example:\n >>> anti_shuffle(\"Hi\")\n \"Hi\"\n >>> anti_shuffle(\"hello\")\n \"ehllo\"\n >>> anti_shuffle(\"Hello World!!!\")\n \"Hello !!!Wdlor\"\n \n*/\nstring anti_shuffle(string s) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = anti_shuffle;\n\n assert(candidate(\"Hi\") == \"Hi\");\n assert(candidate(\"hello\") == \"ehllo\");\n assert(candidate(\"number\") == \"bemnru\");\n assert(candidate(\"abcd\") == \"abcd\");\n assert(candidate(\"Hello World!!!\") == \"Hello !!!Wdlor\");\n assert(candidate(\"\") == \"\");\n assert(candidate(\"Hi. My name is Mister Robot. How are you?\") == \".Hi My aemn is Meirst .Rboot How aer ?ouy\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given an array of numbers, return whether or not they are sorted\n in ascending order. If array has more than 1 duplicate of the same\n number, return false. Assume no negative numbers and only integers.\n\n Examples\n >>> is_sorted([5L])\n true\n >>> is_sorted([1L, 2L, 3L, 4L, 5L])\n true\n >>> is_sorted([1L, 3L, 2L, 4L, 5L])\n false\n >>> is_sorted([1L, 2L, 3L, 4L, 5L, 6L])\n true\n >>> is_sorted([1L, 2L, 3L, 4L, 5L, 6L, 7L])\n true\n >>> is_sorted([1L, 3L, 2L, 4L, 5L, 6L, 7L])\n false\n >>> is_sorted([1L, 2L, 2L, 3L, 3L, 4L])\n true\n >>> is_sorted([1L, 2L, 2L, 2L, 3L, 4L])\n false\n \n*/\nbool is_sorted(long[] lst) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = is_sorted;\n\n assert(candidate([5L]) == true);\n assert(candidate([1L, 2L, 3L, 4L, 5L]) == true);\n assert(candidate([1L, 3L, 2L, 4L, 5L]) == false);\n assert(candidate([1L, 2L, 3L, 4L, 5L, 6L]) == true);\n assert(candidate([1L, 2L, 3L, 4L, 5L, 6L, 7L]) == true);\n assert(candidate([1L, 3L, 2L, 4L, 5L, 6L, 7L]) == false);\n assert(candidate([]) == true);\n assert(candidate([1L]) == true);\n assert(candidate([3L, 2L, 1L]) == false);\n assert(candidate([1L, 2L, 2L, 2L, 3L, 4L]) == false);\n assert(candidate([1L, 2L, 3L, 3L, 3L, 4L]) == false);\n assert(candidate([1L, 2L, 2L, 3L, 3L, 4L]) == true);\n assert(candidate([1L, 2L, 3L, 4L]) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou are given a string s.\n Your task is to check if the string is hapd or not.\n A string is hapd if its length is at least 3 and every 3 consecutive letters are distinct\n For example:\n >>> is_happy(\"a\")\n false\n >>> is_happy(\"aa\")\n false\n >>> is_happy(\"abcd\")\n true\n >>> is_happy(\"aabb\")\n false\n >>> is_happy(\"adb\")\n true\n >>> is_happy(\"xyy\")\n false\n \n*/\nbool is_happy(string s) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = is_happy;\n\n assert(candidate(\"a\") == false);\n assert(candidate(\"aa\") == false);\n assert(candidate(\"abcd\") == true);\n assert(candidate(\"aabb\") == false);\n assert(candidate(\"adb\") == true);\n assert(candidate(\"xyy\") == false);\n assert(candidate(\"iopaxpoi\") == true);\n assert(candidate(\"iopaxioi\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Write a function that returns true if the object q will fly, and false otherwise.\n The object q will fly if it's balanced (it is a palindromic array) and the sum of its elements is less than or equal the maximum possible weight w.\n\n Example:\n >>> will_it_fly([1L, 2L], 5L)\n false\n # 1+2 is less than the maximum possible weight, but it's unbalanced.\n\n >>> will_it_fly([3L, 2L, 3L], 1L)\n false\n # it's balanced, but 3+2+3 is more than the maximum possible weight.\n\n >>> will_it_fly([3L, 2L, 3L], 9L)\n true\n # 3+2+3 is less than the maximum possible weight, and it's balanced.\n\n >>> will_it_fly([3L], 5L)\n true\n # 3 is less than the maximum possible weight, and it's balanced.\n \n*/\nbool will_it_fly(long[] q, long w) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = will_it_fly;\n\n assert(candidate([3L, 2L, 3L], 9L) == true);\n assert(candidate([1L, 2L], 5L) == false);\n assert(candidate([3L], 5L) == true);\n assert(candidate([3L, 2L, 3L], 1L) == false);\n assert(candidate([1L, 2L, 3L], 6L) == false);\n assert(candidate([5L], 5L) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given an array of non-negative integers, return a cod of the given array after sorting,\n you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n or sort it in descending order if the sum( first index value, last index value) is even.\n\n Note:\n * don't change the given array.\n\n Examples:\n >>> sort_array([])\n []\n >>> sort_array([5L])\n [5L]\n >>> sort_array([2L, 4L, 3L, 0L, 1L, 5L])\n [0L, 1L, 2L, 3L, 4L, 5L]\n >>> sort_array([2L, 4L, 3L, 0L, 1L, 5L, 6L])\n [6L, 5L, 4L, 3L, 2L, 1L, 0L]\n \n*/\nlong[] sort_array(long[] array) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = sort_array;\n\n assert(candidate([]) == []);\n assert(candidate([5L]) == [5L]);\n assert(candidate([2L, 4L, 3L, 0L, 1L, 5L]) == [0L, 1L, 2L, 3L, 4L, 5L]);\n assert(candidate([2L, 4L, 3L, 0L, 1L, 5L, 6L]) == [6L, 5L, 4L, 3L, 2L, 1L, 0L]);\n assert(candidate([2L, 1L]) == [1L, 2L]);\n assert(candidate([15L, 42L, 87L, 32L, 11L, 0L]) == [0L, 11L, 15L, 32L, 42L, 87L]);\n assert(candidate([21L, 14L, 23L, 11L]) == [23L, 21L, 14L, 11L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nImplement a function that takes an non-negative integer and returns an array of the first n\n integers that are prime numbers and less than n.\n for example:\n >>> count_up_to(5L)\n [2L, 3L]\n >>> count_up_to(11L)\n [2L, 3L, 5L, 7L]\n >>> count_up_to(0L)\n []\n >>> count_up_to(20L)\n [2L, 3L, 5L, 7L, 11L, 13L, 17L, 19L]\n >>> count_up_to(1L)\n []\n >>> count_up_to(18L)\n [2L, 3L, 5L, 7L, 11L, 13L, 17L]\n \n*/\nlong[] count_up_to(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = count_up_to;\n\n assert(candidate(5L) == [2L, 3L]);\n assert(candidate(6L) == [2L, 3L, 5L]);\n assert(candidate(7L) == [2L, 3L, 5L]);\n assert(candidate(10L) == [2L, 3L, 5L, 7L]);\n assert(candidate(0L) == []);\n assert(candidate(22L) == [2L, 3L, 5L, 7L, 11L, 13L, 17L, 19L]);\n assert(candidate(1L) == []);\n assert(candidate(18L) == [2L, 3L, 5L, 7L, 11L, 13L, 17L]);\n assert(candidate(47L) == [2L, 3L, 5L, 7L, 11L, 13L, 17L, 19L, 23L, 29L, 31L, 37L, 41L, 43L]);\n assert(candidate(101L) == [2L, 3L, 5L, 7L, 11L, 13L, 17L, 19L, 23L, 29L, 31L, 37L, 41L, 43L, 47L, 53L, 59L, 61L, 67L, 71L, 73L, 79L, 83L, 89L, 97L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Out of array of strings, return the longest one. Return the first one in case of multiple\n strings of the same length. Return null in case the input array is empty.\n >>> longest([])\n None\n >>> longest([\"a\", \"b\", \"c\"])\n \"a\"\n >>> longest([\"a\", \"bb\", \"ccc\"])\n \"ccc\"\n \n*/\nNullable!(string) longest(string[] strings) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = longest;\n\n{\n auto result = candidate([]);\n assert(result.isNull);\n}\n\n{\n auto result = candidate([\"x\", \"y\", \"z\"]);\n assert(!result.isNull && result.get == \"x\");\n}\n\n{\n auto result = candidate([\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"]);\n assert(!result.isNull && result.get == \"zzzz\");\n}\n\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n reverse the resulting array, and then replace each digit by its corresponding name from\n \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n\n For example:\n >>> by_length([2L, 1L, 1L, 4L, 5L, 8L, 2L, 3L])\n [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n \n If the array is empty, return an empty array:\n >>> by_length([])\n []\n \n If the array has any strange number ignore it:\n >>> by_length([1L, -1L, 55L])\n [\"One\"]\n \n*/\nstring[] by_length(long[] arr) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = by_length;\n\n assert(candidate([2L, 1L, 1L, 4L, 5L, 8L, 2L, 3L]) == [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]);\n assert(candidate([]) == []);\n assert(candidate([1L, -1L, 55L]) == [\"One\"]);\n assert(candidate([1L, -1L, 3L, 2L]) == [\"Three\", \"Two\", \"One\"]);\n assert(candidate([9L, 4L, 8L]) == [\"Nine\", \"Eight\", \"Four\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_106_f", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Implement the function f that takes n as a parameter,\n and returns an array of size n, such that the value of the element at index i is the factorial of i if i is even\n or the sum of numbers from 1 to i otherwise.\n i starts from 1.\n the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n Example:\n >>> f(5L)\n [1L, 2L, 6L, 24L, 15L]\n \n*/\nlong[] f(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = f;\n\n assert(candidate(5L) == [1L, 2L, 6L, 24L, 15L]);\n assert(candidate(7L) == [1L, 2L, 6L, 24L, 15L, 720L, 28L]);\n assert(candidate(1L) == [1L]);\n assert(candidate(3L) == [1L, 2L, 6L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nReturn the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n >>> fizz_buzz(50L)\n 0L\n >>> fizz_buzz(78L)\n 2L\n >>> fizz_buzz(79L)\n 3L\n \n*/\nlong fizz_buzz(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = fizz_buzz;\n\n assert(candidate(50L) == 0L);\n assert(candidate(78L) == 2L);\n assert(candidate(79L) == 3L);\n assert(candidate(100L) == 3L);\n assert(candidate(200L) == 6L);\n assert(candidate(4000L) == 192L);\n assert(candidate(10000L) == 639L);\n assert(candidate(100000L) == 8026L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Given a positive floating point number, it can be decomposed into\n and integer part (largest integer smaller than given number) and decimals\n (leftover part always smaller than 1).\n\n Return the decimal part of the number.\n >>> truncate_number(3.5)\n 0.5\n \n*/\nfloat truncate_number(float number) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = truncate_number;\n\n assert(candidate(3.5) == 0.5);\n assert(candidate(1.25) == 0.25);\n assert(candidate(123.0) == 0.0);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n For a given array of integers, return a tuple consisting of a sum and a product of all the integers in an array.\n Empty sum should be equal to 0 and empty product should be equal to 1.\n >>> sum_product([])\n tuple(0L, 1L)\n >>> sum_product([1L, 2L, 3L, 4L])\n tuple(10L, 24L)\n \n*/\nTuple!(long, long) sum_product(long[] numbers) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = sum_product;\n\n assert(candidate([]) == tuple(0L, 1L));\n assert(candidate([1L, 1L, 1L]) == tuple(3L, 1L));\n assert(candidate([100L, 0L]) == tuple(100L, 0L));\n assert(candidate([3L, 5L, 7L]) == tuple(15L, 105L));\n assert(candidate([10L]) == tuple(10L, 10L));\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n You are given a 2 dimensional data, as a nested arrays,\n which is similar to matrix, however, unlike matrices,\n each row may contain a different number of columns.\n Given lst, and integer x, find integers x in the array,\n and return array of tuples, [(x1, y1), (x2, y2) ...] such that\n each tuple is a coordinate - (row, columns), starting with 0.\n Sort coordinates initially by rows in ascending order.\n Also, sort coordinates of the row by columns in descending order.\n \n Examples:\n >>> get_row([[1L, 2L, 3L, 4L, 5L, 6L], [1L, 2L, 3L, 4L, 1L, 6L], [1L, 2L, 3L, 4L, 5L, 1L]], 1L)\n [tuple(0L, 0L), tuple(1L, 4L), tuple(1L, 0L), tuple(2L, 5L), tuple(2L, 0L)]\n >>> get_row([], 1L)\n []\n >>> get_row([[], [1L], [1L, 2L, 3L]], 3L)\n [tuple(2L, 2L)]\n \n*/\nTuple!(long, long)[] get_row(long[][] lst, long x) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = get_row;\n\n assert(candidate([[1L, 2L, 3L, 4L, 5L, 6L], [1L, 2L, 3L, 4L, 1L, 6L], [1L, 2L, 3L, 4L, 5L, 1L]], 1L) == [tuple(0L, 0L), tuple(1L, 4L), tuple(1L, 0L), tuple(2L, 5L), tuple(2L, 0L)]);\n assert(candidate([[1L, 2L, 3L, 4L, 5L, 6L], [1L, 2L, 3L, 4L, 5L, 6L], [1L, 2L, 3L, 4L, 5L, 6L], [1L, 2L, 3L, 4L, 5L, 6L], [1L, 2L, 3L, 4L, 5L, 6L], [1L, 2L, 3L, 4L, 5L, 6L]], 2L) == [tuple(0L, 1L), tuple(1L, 1L), tuple(2L, 1L), tuple(3L, 1L), tuple(4L, 1L), tuple(5L, 1L)]);\n assert(candidate([[1L, 2L, 3L, 4L, 5L, 6L], [1L, 2L, 3L, 4L, 5L, 6L], [1L, 1L, 3L, 4L, 5L, 6L], [1L, 2L, 1L, 4L, 5L, 6L], [1L, 2L, 3L, 1L, 5L, 6L], [1L, 2L, 3L, 4L, 1L, 6L], [1L, 2L, 3L, 4L, 5L, 1L]], 1L) == [tuple(0L, 0L), tuple(1L, 0L), tuple(2L, 1L), tuple(2L, 0L), tuple(3L, 2L), tuple(3L, 0L), tuple(4L, 3L), tuple(4L, 0L), tuple(5L, 4L), tuple(5L, 0L), tuple(6L, 5L), tuple(6L, 0L)]);\n assert(candidate([], 1L) == []);\n assert(candidate([[1L]], 2L) == []);\n assert(candidate([[], [1L], [1L, 2L, 3L]], 3L) == [tuple(2L, 2L)]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n You're a hungry rabbit, and you already have eaten a certain number of carrots,\n but now you need to eat more carrots to complete the day's meals.\n you should return an array of [ total number of eaten carrots after your meals,\n the number of carrots left after your meals ]\n if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n \n Example:\n >>> eat(5L, 6L, 10L)\n [11L, 4L]\n >>> eat(4L, 8L, 9L)\n [12L, 1L]\n >>> eat(1L, 10L, 10L)\n [11L, 0L]\n >>> eat(2L, 11L, 5L)\n [7L, 0L]\n \n Variables:\n @number : integer\n the number of carrots that you have eaten.\n @need : integer\n the number of carrots that you need to eat.\n @remaining : integer\n the number of remaining carrots thet exist in stock\n \n Constrain:\n * 0 <= number <= 1000\n * 0 <= need <= 1000\n * 0 <= remaining <= 1000\n\n Have fun :)\n \n*/\nlong[] eat(long number, long need, long remaining) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = eat;\n\n assert(candidate(5L, 6L, 10L) == [11L, 4L]);\n assert(candidate(4L, 8L, 9L) == [12L, 1L]);\n assert(candidate(1L, 10L, 10L) == [11L, 0L]);\n assert(candidate(2L, 11L, 5L) == [7L, 0L]);\n assert(candidate(4L, 5L, 7L) == [9L, 2L]);\n assert(candidate(4L, 5L, 1L) == [5L, 0L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nGiven a positive integer N, return the total sum of its digits in binary.\n \n Example\n >>> solve(1000L)\n \"1\"\n >>> solve(150L)\n \"110\"\n >>> solve(147L)\n \"1100\"\n \n Variables:\n @N integer\n Constraints: 0 \u2264 N \u2264 10000.\n Output:\n a string of binary number\n \n*/\nstring solve(long N) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = solve;\n\n assert(candidate(1000L) == \"1\");\n assert(candidate(150L) == \"110\");\n assert(candidate(147L) == \"1100\");\n assert(candidate(333L) == \"1001\");\n assert(candidate(963L) == \"10010\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou are given an array of integers.\n You need to find the largest prime value and return the sum of its digits.\n\n Examples:\n >>> skjkasdkd([0L, 3L, 2L, 1L, 3L, 5L, 7L, 4L, 5L, 5L, 5L, 2L, 181L, 32L, 4L, 32L, 3L, 2L, 32L, 324L, 4L, 3L])\n 10L\n >>> skjkasdkd([1L, 0L, 1L, 8L, 2L, 4597L, 2L, 1L, 3L, 40L, 1L, 2L, 1L, 2L, 4L, 2L, 5L, 1L])\n 25L\n >>> skjkasdkd([1L, 3L, 1L, 32L, 5107L, 34L, 83278L, 109L, 163L, 23L, 2323L, 32L, 30L, 1L, 9L, 3L])\n 13L\n >>> skjkasdkd([0L, 724L, 32L, 71L, 99L, 32L, 6L, 0L, 5L, 91L, 83L, 0L, 5L, 6L])\n 11L\n >>> skjkasdkd([0L, 81L, 12L, 3L, 1L, 21L])\n 3L\n >>> skjkasdkd([0L, 8L, 1L, 2L, 1L, 7L])\n 7L\n \n*/\nlong skjkasdkd(long[] lst) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = skjkasdkd;\n\n assert(candidate([0L, 3L, 2L, 1L, 3L, 5L, 7L, 4L, 5L, 5L, 5L, 2L, 181L, 32L, 4L, 32L, 3L, 2L, 32L, 324L, 4L, 3L]) == 10L);\n assert(candidate([1L, 0L, 1L, 8L, 2L, 4597L, 2L, 1L, 3L, 40L, 1L, 2L, 1L, 2L, 4L, 2L, 5L, 1L]) == 25L);\n assert(candidate([1L, 3L, 1L, 32L, 5107L, 34L, 83278L, 109L, 163L, 23L, 2323L, 32L, 30L, 1L, 9L, 3L]) == 13L);\n assert(candidate([0L, 724L, 32L, 71L, 99L, 32L, 6L, 0L, 5L, 91L, 83L, 0L, 5L, 6L]) == 11L);\n assert(candidate([0L, 81L, 12L, 3L, 1L, 21L]) == 3L);\n assert(candidate([0L, 8L, 1L, 2L, 1L, 7L]) == 7L);\n assert(candidate([8191L]) == 19L);\n assert(candidate([8191L, 123456L, 127L, 7L]) == 19L);\n assert(candidate([127L, 97L, 8192L]) == 10L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given an array arr of integers, find the minimum number of elements that\n need to be changed to make the array palindromic. A palindromic array is an array that\n is read the same backwards and forwards. In one change, you can change one element to any other element.\n\n For example:\n >>> smallest_change([1L, 2L, 3L, 5L, 4L, 7L, 9L, 6L])\n 4L\n >>> smallest_change([1L, 2L, 3L, 4L, 3L, 2L, 2L])\n 1L\n >>> smallest_change([1L, 2L, 3L, 2L, 1L])\n 0L\n \n*/\nlong smallest_change(long[] arr) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = smallest_change;\n\n assert(candidate([1L, 2L, 3L, 5L, 4L, 7L, 9L, 6L]) == 4L);\n assert(candidate([1L, 2L, 3L, 4L, 3L, 2L, 2L]) == 1L);\n assert(candidate([1L, 4L, 2L]) == 1L);\n assert(candidate([1L, 4L, 4L, 2L]) == 1L);\n assert(candidate([1L, 2L, 3L, 2L, 1L]) == 0L);\n assert(candidate([3L, 1L, 1L, 3L]) == 0L);\n assert(candidate([1L]) == 0L);\n assert(candidate([0L, 1L]) == 1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nIt is the last week of the semester and the teacher has to give the grades\n to students. The teacher has been making her own algorithm for grading.\n The only problem is, she has lost the code she used for grading.\n She has given you an array of GPAs for some students and you have to write \n a function that can output an array of letter grades using the following table:\n GPA | Letter grade\n 4.0 A+\n > 3.7 A \n > 3.3 A- \n > 3.0 B+\n > 2.7 B \n > 2.3 B-\n > 2.0 C+\n > 1.7 C\n > 1.3 C-\n > 1.0 D+ \n > 0.7 D \n > 0.0 D-\n 0.0 E\n \n\n Example:\n >>> grade_equation([4.0, 3L, 1.7, 2L, 3.5])\n [\"A+\", \"B\", \"C-\", \"C\", \"A-\"]\n \n*/\nstring[] numerical_letter_grade(float[] grades) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = numerical_letter_grade;\n\n assert(candidate([4.0, 3L, 1.7, 2L, 3.5]) == [\"A+\", \"B\", \"C-\", \"C\", \"A-\"]);\n assert(candidate([1.2]) == [\"D+\"]);\n assert(candidate([0.5]) == [\"D-\"]);\n assert(candidate([0.0]) == [\"E\"]);\n assert(candidate([1.0, 0.3, 1.5, 2.8, 3.3]) == [\"D\", \"D-\", \"C-\", \"B\", \"B+\"]);\n assert(candidate([0.0, 0.7]) == [\"E\", \"D-\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given the lengths of the three sides of a triangle. Return the area of\n the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n Otherwise return -1\n Three sides make a valid triangle when the sum of any two sides is greater \n than the third side.\n Example:\n >>> triangle_area(3L, 4L, 5L)\n 6.0\n >>> triangle_area(1L, 2L, 10L)\n -1L\n \n*/\nfloat triangle_area(long a, long b, long c) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = triangle_area;\n\n assert(candidate(3L, 4L, 5L) == 6.0);\n assert(candidate(1L, 2L, 10L) == -1L);\n assert(candidate(4L, 8L, 5L) == 8.18);\n assert(candidate(2L, 2L, 2L) == 1.73);\n assert(candidate(1L, 2L, 3L) == -1L);\n assert(candidate(10L, 5L, 7L) == 16.25);\n assert(candidate(2L, 6L, 3L) == -1L);\n assert(candidate(1L, 1L, 1L) == 0.43);\n assert(candidate(2L, 2L, 10L) == -1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Check if two words have the same characters.\n >>> same_chars(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\")\n true\n >>> same_chars(\"abcd\", \"dddddddabc\")\n true\n >>> same_chars(\"dddddddabc\", \"abcd\")\n true\n >>> same_chars(\"eabcd\", \"dddddddabc\")\n false\n >>> same_chars(\"abcd\", \"dddddddabce\")\n false\n >>> same_chars(\"eabcdzzzz\", \"dddzzzzzzzddddabc\")\n false\n \n*/\nbool same_chars(string s0, string s1) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = same_chars;\n\n assert(candidate(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\") == true);\n assert(candidate(\"abcd\", \"dddddddabc\") == true);\n assert(candidate(\"dddddddabc\", \"abcd\") == true);\n assert(candidate(\"eabcd\", \"dddddddabc\") == false);\n assert(candidate(\"abcd\", \"dddddddabcf\") == false);\n assert(candidate(\"eabcdzzzz\", \"dddzzzzzzzddddabc\") == false);\n assert(candidate(\"aabb\", \"aaccc\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given an array of integers nums, find the minimum sum of any non-empty sub-array\n of nums.\n Example\n >>> minSubArraySum([2L, 3L, 4L, 1L, 2L, 4L])\n 1L\n >>> minSubArraySum([-1L, -2L, -3L])\n -6L\n \n*/\nlong minSubArraySum(long[] nums) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = minSubArraySum;\n\n assert(candidate([2L, 3L, 4L, 1L, 2L, 4L]) == 1L);\n assert(candidate([-1L, -2L, -3L]) == -6L);\n assert(candidate([-1L, -2L, -3L, 2L, -10L]) == -14L);\n assert(candidate([-9999999999999999L]) == -9999999999999999L);\n assert(candidate([0L, 10L, 20L, 1000000L]) == 0L);\n assert(candidate([-1L, -2L, -3L, 10L, -5L]) == -6L);\n assert(candidate([100L, -1L, -2L, -3L, 10L, -5L]) == -6L);\n assert(candidate([10L, 11L, 13L, 8L, 3L, 4L]) == 3L);\n assert(candidate([100L, -33L, 32L, -1L, 0L, -2L]) == -33L);\n assert(candidate([-10L]) == -10L);\n assert(candidate([7L]) == 7L);\n assert(candidate([1L, -1L]) == -1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nGiven a string s and a natural number n, you have been tasked to implement \n a function that returns an array of all words from string s that contain exactly \n n consonants, in order these words appear in the string s.\n If the string s is empty then the function should return an empty array.\n Note: you may assume the input string contains only letters and spaces.\n Examples:\n >>> select_words(\"Mary had a little lamb\", 4L)\n [\"little\"]\n >>> select_words(\"Mary had a little lamb\", 3L)\n [\"Mary\", \"lamb\"]\n >>> select_words(\"simple white space\", 2L)\n []\n >>> select_words(\"Hello world\", 4L)\n [\"world\"]\n >>> select_words(\"Uncle sam\", 3L)\n [\"Uncle\"]\n \n*/\nstring[] select_words(string s, long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = select_words;\n\n assert(candidate(\"Mary had a little lamb\", 4L) == [\"little\"]);\n assert(candidate(\"Mary had a little lamb\", 3L) == [\"Mary\", \"lamb\"]);\n assert(candidate(\"simple white space\", 2L) == []);\n assert(candidate(\"Hello world\", 4L) == [\"world\"]);\n assert(candidate(\"Uncle sam\", 3L) == [\"Uncle\"]);\n assert(candidate(\"\", 4L) == []);\n assert(candidate(\"a b c d e f\", 1L) == [\"b\", \"c\", \"d\", \"f\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Return array of all prefixes from shortest to longest of the input string\n >>> all_prefixes(\"abc\")\n [\"a\", \"ab\", \"abc\"]\n \n*/\nstring[] all_prefixes(string string) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = all_prefixes;\n\n assert(candidate(\"\") == []);\n assert(candidate(\"asdfgh\") == [\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"]);\n assert(candidate(\"WWW\") == [\"W\", \"WW\", \"WWW\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Create a function that takes a value (string) representing a number\n and returns the closest integer to it. If the number is equidistant\n from two integers, round it away from zero.\n\n Examples\n >>> closest_integer(\"10\")\n 10L\n >>> closest_integer(\"15.3\")\n 15L\n\n Note:\n Rounding away from zero means that if the given number is equidistant\n from two integers, the one you should return is the one that is the\n farthest from zero. For example closest_integer(\"14.5\") should\n return 15 and closest_integer(\"-14.5\") should return -15.\n \n*/\nlong closest_integer(string value) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = closest_integer;\n\n assert(candidate(\"10\") == 10L);\n assert(candidate(\"14.5\") == 15L);\n assert(candidate(\"-15.5\") == -16L);\n assert(candidate(\"15.3\") == 15L);\n assert(candidate(\"0\") == 0L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nCreate a function which takes a string representing a file's name, and returns\n 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n A file's name is considered to be valid if and only if all the following conditions \n are met:\n - There should not be more than three digits ('0'-'9') in the file's name.\n - The file's name contains exactly one dot '.'\n - The substring before the dot should not be empty, and it starts with a letter from \n the latin alphapet ('a'-'z' and 'A'-'Z').\n - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n Examples:\n >>> file_name_check(\"example.txt\")\n \"Yes\"\n >>> file_name_check(\"1example.dll\")\n \"No\"\n \n*/\nstring file_name_check(string file_name) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = file_name_check;\n\n assert(candidate(\"example.txt\") == \"Yes\");\n assert(candidate(\"1example.dll\") == \"No\");\n assert(candidate(\"s1sdf3.asd\") == \"No\");\n assert(candidate(\"K.dll\") == \"Yes\");\n assert(candidate(\"MY16FILE3.exe\") == \"Yes\");\n assert(candidate(\"His12FILE94.exe\") == \"No\");\n assert(candidate(\"_Y.txt\") == \"No\");\n assert(candidate(\"?aREYA.exe\") == \"No\");\n assert(candidate(\"/this_is_valid.dll\") == \"No\");\n assert(candidate(\"this_is_valid.wow\") == \"No\");\n assert(candidate(\"this_is_valid.txt\") == \"Yes\");\n assert(candidate(\"this_is_valid.txtexe\") == \"No\");\n assert(candidate(\"#this2_i4s_5valid.ten\") == \"No\");\n assert(candidate(\"@this1_is6_valid.exe\") == \"No\");\n assert(candidate(\"this_is_12valid.6exe4.txt\") == \"No\");\n assert(candidate(\"all.exe.txt\") == \"No\");\n assert(candidate(\"I563_No.exe\") == \"Yes\");\n assert(candidate(\"Is3youfault.txt\") == \"Yes\");\n assert(candidate(\"no_one#knows.dll\") == \"Yes\");\n assert(candidate(\"1I563_Yes3.exe\") == \"No\");\n assert(candidate(\"I563_Yes3.txtt\") == \"No\");\n assert(candidate(\"final..txt\") == \"No\");\n assert(candidate(\"final132\") == \"No\");\n assert(candidate(\"_f4indsartal132.\") == \"No\");\n assert(candidate(\".txt\") == \"No\");\n assert(candidate(\"s.\") == \"No\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nYou are given two intervals,\n where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n The given intervals are closed which means that the interval (start, end)\n includes both start and end.\n For each given interval, it is assumed that its start is less or equal its end.\n Your task is to determine whether the length of intersection of these two \n intervals is a prime number.\n Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n which its length is 1, which not a prime number.\n If the length of the intersection is a prime number, return \"YES\",\n otherwise, return \"NO\".\n If the two intervals don't intersect, return \"NO\".\n\n\n [input/output] samples:\n >>> intersection(tuple(1L, 2L), tuple(2L, 3L))\n \"NO\"\n >>> intersection(tuple(-1L, 1L), tuple(0L, 4L))\n \"NO\"\n >>> intersection(tuple(-3L, -1L), tuple(-5L, 5L))\n \"YES\"\n \n*/\nstring intersection(Tuple!(long, long) interval1, Tuple!(long, long) interval2) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = intersection;\n\n assert(candidate(tuple(1L, 2L), tuple(2L, 3L)) == \"NO\");\n assert(candidate(tuple(-1L, 1L), tuple(0L, 4L)) == \"NO\");\n assert(candidate(tuple(-3L, -1L), tuple(-5L, 5L)) == \"YES\");\n assert(candidate(tuple(-2L, 2L), tuple(-4L, 0L)) == \"YES\");\n assert(candidate(tuple(-11L, 2L), tuple(-1L, -1L)) == \"NO\");\n assert(candidate(tuple(1L, 2L), tuple(3L, 5L)) == \"NO\");\n assert(candidate(tuple(1L, 2L), tuple(1L, 2L)) == \"NO\");\n assert(candidate(tuple(-2L, -2L), tuple(-3L, -2L)) == \"NO\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\nReturn the largest prime factor of n. Assume n > 1 and is not a prime.\n >>> largest_prime_factor(13195L)\n 29L\n >>> largest_prime_factor(2048L)\n 2L\n \n*/\nlong largest_prime_factor(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = largest_prime_factor;\n\n assert(candidate(15L) == 5L);\n assert(candidate(27L) == 3L);\n assert(candidate(63L) == 7L);\n assert(candidate(330L) == 11L);\n assert(candidate(13195L) == 29L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Given a string, find out how many distinct characters (regardless of case) does it consist of\n >>> count_distinct_characters(\"xyzXYZ\")\n 3L\n >>> count_distinct_characters(\"Jerry\")\n 4L\n \n*/\nlong count_distinct_characters(string string) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = count_distinct_characters;\n\n assert(candidate(\"\") == 0L);\n assert(candidate(\"abcde\") == 5L);\n assert(candidate(\"abcdecadeCADE\") == 5L);\n assert(candidate(\"aaaaAAAAaaaa\") == 1L);\n assert(candidate(\"Jerry jERRY JeRRRY\") == 5L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n You're given an array of deposit and withdrawal operations on a bank account that starts with\n zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n at that point function should return true. Otherwise it should return false.\n >>> below_zero([1L, 2L, 3L])\n false\n >>> below_zero([1L, 2L, -4L, 5L])\n true\n \n*/\nbool below_zero(long[] operations) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = below_zero;\n\n assert(candidate([]) == false);\n assert(candidate([1L, 2L, -3L, 1L, 2L, -3L]) == false);\n assert(candidate([1L, 2L, -4L, 5L, 6L]) == true);\n assert(candidate([1L, -1L, 2L, -2L, 5L, -5L, 4L, -4L]) == false);\n assert(candidate([1L, -1L, 2L, -2L, 5L, -5L, 4L, -5L]) == true);\n assert(candidate([1L, -2L, 2L, -2L, 5L, -5L, 4L, -4L]) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n Find the shortest palindrome that begins with a supplied string.\n Algorithm idea is simple:\n - Find the longest postfix of supplied string that is a palindrome.\n - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n >>> make_palindrome(\"\")\n \"\"\n >>> make_palindrome(\"cat\")\n \"catac\"\n >>> make_palindrome(\"cata\")\n \"catac\"\n \n*/\nstring make_palindrome(string string) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = make_palindrome;\n\n assert(candidate(\"\") == \"\");\n assert(candidate(\"x\") == \"x\");\n assert(candidate(\"xyz\") == \"xyzyx\");\n assert(candidate(\"xyx\") == \"xyx\");\n assert(candidate(\"jerry\") == \"jerryrrej\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "d", - "prompt": "import std.math;\nimport std.typecons;\n/*\n\n Given a positive integer, obtain its roman numeral equivalent as a string,\n and return it in lowercase.\n Restrictions: 1 <= num <= 1000\n\n Examples:\n >>> int_to_mini_roman(19L)\n \"xix\"\n >>> int_to_mini_roman(152L)\n \"clii\"\n >>> int_to_mini_roman(426L)\n \"cdxxvi\"\n \n*/\nstring int_to_mini_roman(long number) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "reworded", - "tests": "unittest\n{\n alias candidate = int_to_mini_roman;\n\n assert(candidate(19L) == \"xix\");\n assert(candidate(152L) == \"clii\");\n assert(candidate(251L) == \"ccli\");\n assert(candidate(426L) == \"cdxxvi\");\n assert(candidate(500L) == \"d\");\n assert(candidate(1L) == \"i\");\n assert(candidate(4L) == \"iv\");\n assert(candidate(43L) == \"xliii\");\n assert(candidate(90L) == \"xc\");\n assert(candidate(94L) == \"xciv\");\n assert(candidate(532L) == \"dxxxii\");\n assert(candidate(900L) == \"cm\");\n assert(candidate(994L) == \"cmxciv\");\n assert(candidate(1000L) == \"m\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - } -] \ No newline at end of file diff --git a/data/d-transform.json b/data/d-transform.json deleted file mode 100644 index 7cc5f2c7f663cf5be66de55045a2e690264805fa..0000000000000000000000000000000000000000 --- a/data/d-transform.json +++ /dev/null @@ -1,2342 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "d", - "prompt": "import std.math;\n/*\n For a given number n, find the largest number that divides n evenly, smaller than n\n >>> largest_divisor(15L)\n 5L\n \n*/\nlong largest_divisor(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = largest_divisor;\n\n assert(candidate(3L) == 1L);\n assert(candidate(7L) == 1L);\n assert(candidate(10L) == 5L);\n assert(candidate(100L) == 50L);\n assert(candidate(49L) == 7L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_47_median", - "language": "d", - "prompt": "import std.math;\n/*\nReturn median of elements in the list l.\n >>> median([3L, 1L, 2L, 4L, 5L])\n 3L\n >>> median([-10L, 4L, 6L, 1000L, 10L, 20L])\n 15.0\n \n*/\nfloat median(long[] l) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = median;\n\n assert(candidate([3L, 1L, 2L, 4L, 5L]) == 3L);\n assert(candidate([-10L, 4L, 6L, 1000L, 10L, 20L]) == 8.0);\n assert(candidate([5L]) == 5L);\n assert(candidate([6L, 5L]) == 5.5);\n assert(candidate([8L, 1L, 3L, 9L, 9L, 2L, 7L]) == 7L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "d", - "prompt": "import std.math;\n/*\n\n Given two lists operator, and operand. The first list has basic algebra operations, and \n the second list is a list of integers. Use the two given lists to build the algebric \n expression and return the evaluation of this expression.\n\n The basic algebra operations:\n Addition ( + ) \n Subtraction ( - ) \n Multiplication ( * ) \n Floor division ( // ) \n Exponentiation ( ** ) \n\n Example:\n operator['+', '*', '-']\n array = [2, 3, 4, 5]\n result = 2 + 3 * 4 - 5\n => result = 9\n\n Note:\n The length of operator list is equal to the length of operand list minus one.\n Operand is a list of of non-negative integers.\n Operator list has at least one operator, and operand list has at least two operands.\n\n \n*/\nlong do_algebra(string[] operator, long[] operand) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = do_algebra;\n\n assert(candidate([\"**\", \"*\", \"+\"], [2L, 3L, 4L, 5L]) == 37L);\n assert(candidate([\"+\", \"*\", \"-\"], [2L, 3L, 4L, 5L]) == 9L);\n assert(candidate([\"//\", \"*\"], [7L, 3L, 4L]) == 8L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "d", - "prompt": "import std.math;\n/*\nReturn maximum element in the list.\n >>> max_element([1L, 2L, 3L])\n 3L\n >>> max_element([5L, 3L, -5L, 2L, -3L, 3L, 9L, 0L, 123L, 1L, -10L])\n 123L\n \n*/\nlong max_element(long[] l) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = max_element;\n\n assert(candidate([1L, 2L, 3L]) == 3L);\n assert(candidate([5L, 3L, -5L, 2L, -3L, 3L, 9L, 0L, 124L, 1L, -10L]) == 124L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "d", - "prompt": "import std.math;\n/*\nCreate a function which returns the largest index of an element which\n is not greater than or equal to the element immediately preceding it. If\n no such element exists then return -1. The given array will not contain\n duplicate values.\n\n Examples:\n >>> can_arrange([1L, 2L, 4L, 3L, 5L])\n 3L\n >>> can_arrange([1L, 2L, 3L])\n -1L\n \n*/\nlong can_arrange(long[] arr) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = can_arrange;\n\n assert(candidate([1L, 2L, 4L, 3L, 5L]) == 3L);\n assert(candidate([1L, 2L, 4L, 5L]) == -1L);\n assert(candidate([1L, 4L, 2L, 5L, 6L, 7L, 8L, 9L, 10L]) == 2L);\n assert(candidate([4L, 8L, 5L, 7L, 3L]) == 4L);\n assert(candidate([]) == -1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "d", - "prompt": "import std.math;\n/*\n\n Imagine a road that's a perfectly straight infinitely long line.\n n cars are driving left to right; simultaneously, a different set of n cars\n are driving right to left. The two sets of cars start out being very far from\n each other. All cars move in the same speed. Two cars are said to collide\n when a car that's moving left to right hits a car that's moving right to left.\n However, the cars are infinitely sturdy and strong; as a result, they continue moving\n in their trajectory as if they did not collide.\n\n This function outputs the number of such collisions.\n \n*/\nlong car_race_collision(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = car_race_collision;\n\n assert(candidate(2L) == 4L);\n assert(candidate(3L) == 9L);\n assert(candidate(4L) == 16L);\n assert(candidate(8L) == 64L);\n assert(candidate(10L) == 100L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "d", - "prompt": "import std.math;\n/*\n\n Create a function that returns True if the last character\n of a given string is an alphabetical character and is not\n a part of a word, and False otherwise.\n Note: \"word\" is a group of characters separated by space.\n\n Examples:\n >>> check_if_last_char_is_a_letter(\"apple pie\")\n false\n >>> check_if_last_char_is_a_letter(\"apple pi e\")\n true\n >>> check_if_last_char_is_a_letter(\"apple pi e \")\n false\n >>> check_if_last_char_is_a_letter(\"\")\n false\n \n*/\nbool check_if_last_char_is_a_letter(string txt) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = check_if_last_char_is_a_letter;\n\n assert(candidate(\"apple\") == false);\n assert(candidate(\"apple pi e\") == true);\n assert(candidate(\"eeeee\") == false);\n assert(candidate(\"A\") == true);\n assert(candidate(\"Pumpkin pie \") == false);\n assert(candidate(\"Pumpkin pie 1\") == false);\n assert(candidate(\"\") == false);\n assert(candidate(\"eeeee e \") == false);\n assert(candidate(\"apple pie\") == false);\n assert(candidate(\"apple pi e \") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "d", - "prompt": "import std.math;\n/*\nReturn true if a given number is prime, and false otherwise.\n >>> is_prime(6L)\n false\n >>> is_prime(101L)\n true\n >>> is_prime(11L)\n true\n >>> is_prime(13441L)\n true\n >>> is_prime(61L)\n true\n >>> is_prime(4L)\n false\n >>> is_prime(1L)\n false\n \n*/\nbool is_prime(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = is_prime;\n\n assert(candidate(6L) == false);\n assert(candidate(101L) == true);\n assert(candidate(11L) == true);\n assert(candidate(13441L) == true);\n assert(candidate(61L) == true);\n assert(candidate(4L) == false);\n assert(candidate(1L) == false);\n assert(candidate(5L) == true);\n assert(candidate(11L) == true);\n assert(candidate(17L) == true);\n assert(candidate(85L) == false);\n assert(candidate(77L) == false);\n assert(candidate(255379L) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "d", - "prompt": "import std.math;\n/*\nGiven a list of positive integers x. return a sorted list of all \n elements that hasn't any even digit.\n\n Note: Returned list should be sorted in increasing order.\n \n For example:\n >>> unique_digits([15L, 33L, 1422L, 1L])\n [1L, 15L, 33L]\n >>> unique_digits([152L, 323L, 1422L, 10L])\n []\n \n*/\nlong[] unique_digits(long[] x) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = unique_digits;\n\n assert(candidate([15L, 33L, 1422L, 1L]) == [1L, 15L, 33L]);\n assert(candidate([152L, 323L, 1422L, 10L]) == []);\n assert(candidate([12345L, 2033L, 111L, 151L]) == [111L, 151L]);\n assert(candidate([135L, 103L, 31L]) == [31L, 135L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "d", - "prompt": "import std.math;\n/*\n Input are two strings a and b consisting only of 1s and 0s.\n Perform binary XOR on these inputs and return result also as a string.\n >>> string_xor(\"010\", \"110\")\n \"100\"\n \n*/\nstring string_xor(string a, string b) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = string_xor;\n\n assert(candidate(\"111000\", \"101010\") == \"010010\");\n assert(candidate(\"1\", \"1\") == \"0\");\n assert(candidate(\"0101\", \"0000\") == \"0101\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "d", - "prompt": "import std.math;\n/*\nsum_to_n is a function that sums numbers from 1 to n.\n >>> sum_to_n(30L)\n 465L\n >>> sum_to_n(100L)\n 5050L\n >>> sum_to_n(5L)\n 15L\n >>> sum_to_n(10L)\n 55L\n >>> sum_to_n(1L)\n 1L\n \n*/\nlong sum_to_n(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = sum_to_n;\n\n assert(candidate(1L) == 1L);\n assert(candidate(6L) == 21L);\n assert(candidate(11L) == 66L);\n assert(candidate(30L) == 465L);\n assert(candidate(100L) == 5050L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "d", - "prompt": "import std.math;\n/*\n\n Given a list of numbers, return the sum of squares of the numbers\n in the list that are odd. Ignore numbers that are negative or not integers.\n \n >>> double_the_difference([1L, 3L, 2L, 0L])\n 10L\n >>> double_the_difference([-1L, -2L, 0L])\n 0L\n >>> double_the_difference([9L, -2L])\n 81L\n >>> double_the_difference([0L])\n 0L\n \n If the input list is empty, return 0.\n \n*/\nlong double_the_difference(float[] lst) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = double_the_difference;\n\n assert(candidate([]) == 0L);\n assert(candidate([5.0, 4.0]) == 25L);\n assert(candidate([0.1, 0.2, 0.3]) == 0L);\n assert(candidate([-10.0, -20.0, -30.0]) == 0L);\n assert(candidate([-1.0, -2.0, 8.0]) == 0L);\n assert(candidate([0.2, 3.0, 5.0]) == 34L);\n assert(candidate([-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]) == 165L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "d", - "prompt": "import std.math;\n/*\n Return length of given string\n >>> strlen(\"\")\n 0L\n >>> strlen(\"abc\")\n 3L\n \n*/\nlong strlen(string string) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = strlen;\n\n assert(candidate(\"\") == 0L);\n assert(candidate(\"x\") == 1L);\n assert(candidate(\"asdasnakj\") == 9L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "d", - "prompt": "import std.math;\n/*\n\n You'll be given a string of words, and your task is to count the number\n of boredoms. A boredom is a sentence that starts with the word \"I\".\n Sentences are delimited by '.', '?' or '!'.\n \n For example:\n >>> is_bored(\"Hello world\")\n 0L\n >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n 1L\n \n*/\nlong is_bored(string S) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = is_bored;\n\n assert(candidate(\"Hello world\") == 0L);\n assert(candidate(\"Is the sky blue?\") == 0L);\n assert(candidate(\"I love It !\") == 1L);\n assert(candidate(\"bIt\") == 0L);\n assert(candidate(\"I feel good today. I will be productive. will kill It\") == 2L);\n assert(candidate(\"You and I are going for a walk\") == 0L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "d", - "prompt": "import std.math;\n/*\nWrite a function vowels_count which takes a string representing\n a word as input and returns the number of vowels in the string.\n Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n vowel, but only when it is at the end of the given word.\n\n Example:\n >>> vowels_count(\"abcde\")\n 2L\n >>> vowels_count(\"ACEDY\")\n 3L\n \n*/\nlong vowels_count(string s) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = vowels_count;\n\n assert(candidate(\"abcde\") == 2L);\n assert(candidate(\"Alone\") == 3L);\n assert(candidate(\"key\") == 2L);\n assert(candidate(\"bye\") == 1L);\n assert(candidate(\"keY\") == 2L);\n assert(candidate(\"bYe\") == 1L);\n assert(candidate(\"ACEDY\") == 3L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "d", - "prompt": "import std.math;\n/*\nReturn n-th Fibonacci number.\n >>> fib(10L)\n 55L\n >>> fib(1L)\n 1L\n >>> fib(8L)\n 21L\n \n*/\nlong fib(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = fib;\n\n assert(candidate(10L) == 55L);\n assert(candidate(1L) == 1L);\n assert(candidate(8L) == 21L);\n assert(candidate(11L) == 89L);\n assert(candidate(12L) == 144L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "d", - "prompt": "import std.math;\n/*\nYour task is to implement a function that will simplify the expression\n x * n. The function returns True if x * n evaluates to a whole number and False\n otherwise. Both x and n, are string representation of a fraction, and have the following format,\n / where both numerator and denominator are positive whole numbers.\n\n You can assume that x, and n are valid fractions, and do not have zero as denominator.\n\n >>> simplify(\"1/5\", \"5/1\")\n true\n >>> simplify(\"1/6\", \"2/1\")\n false\n >>> simplify(\"7/10\", \"10/2\")\n false\n \n*/\nbool simplify(string x, string n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = simplify;\n\n assert(candidate(\"1/5\", \"5/1\") == true);\n assert(candidate(\"1/6\", \"2/1\") == false);\n assert(candidate(\"5/1\", \"3/1\") == true);\n assert(candidate(\"7/10\", \"10/2\") == false);\n assert(candidate(\"2/10\", \"50/10\") == true);\n assert(candidate(\"7/2\", \"4/2\") == true);\n assert(candidate(\"11/6\", \"6/1\") == true);\n assert(candidate(\"2/3\", \"5/2\") == false);\n assert(candidate(\"5/2\", \"3/5\") == false);\n assert(candidate(\"2/4\", \"8/4\") == true);\n assert(candidate(\"2/4\", \"4/2\") == true);\n assert(candidate(\"1/5\", \"5/1\") == true);\n assert(candidate(\"1/5\", \"1/5\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "d", - "prompt": "import std.math;\n/*\n\n Given a string s, count the number of uppercase vowels in even indices.\n \n For example:\n >>> count_upper(\"aBCdEf\")\n 1L\n >>> count_upper(\"abcdefg\")\n 0L\n >>> count_upper(\"dBBE\")\n 0L\n \n*/\nlong count_upper(string s) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = count_upper;\n\n assert(candidate(\"aBCdEf\") == 1L);\n assert(candidate(\"abcdefg\") == 0L);\n assert(candidate(\"dBBE\") == 0L);\n assert(candidate(\"B\") == 0L);\n assert(candidate(\"U\") == 1L);\n assert(candidate(\"\") == 0L);\n assert(candidate(\"EEEE\") == 2L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "d", - "prompt": "import std.math;\n/*\n\n You are given a rectangular grid of wells. Each row represents a single well,\n and each 1 in a row represents a single unit of water.\n Each well has a corresponding bucket that can be used to extract water from it, \n and all buckets have the same capacity.\n Your task is to use the buckets to empty the wells.\n Output the number of times you need to lower the buckets.\n\n Example 1:\n >>> max_fill([[0L, 0L, 1L, 0L], [0L, 1L, 0L, 0L], [1L, 1L, 1L, 1L]], 1L)\n 6L\n\n Example 2:\n >>> max_fill([[0L, 0L, 1L, 1L], [0L, 0L, 0L, 0L], [1L, 1L, 1L, 1L], [0L, 1L, 1L, 1L]], 2L)\n 5L\n \n Example 3:\n >>> max_fill([[0L, 0L, 0L], [0L, 0L, 0L]], 5L)\n 0L\n\n Constraints:\n * all wells have the same length\n * 1 <= grid.length <= 10^2\n * 1 <= grid[:,1].length <= 10^2\n * grid[i][j] -> 0 | 1\n * 1 <= capacity <= 10\n \n*/\nlong max_fill(long[][] grid, long capacity) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = max_fill;\n\n assert(candidate([[0L, 0L, 1L, 0L], [0L, 1L, 0L, 0L], [1L, 1L, 1L, 1L]], 1L) == 6L);\n assert(candidate([[0L, 0L, 1L, 1L], [0L, 0L, 0L, 0L], [1L, 1L, 1L, 1L], [0L, 1L, 1L, 1L]], 2L) == 5L);\n assert(candidate([[0L, 0L, 0L], [0L, 0L, 0L]], 5L) == 0L);\n assert(candidate([[1L, 1L, 1L, 1L], [1L, 1L, 1L, 1L]], 2L) == 4L);\n assert(candidate([[1L, 1L, 1L, 1L], [1L, 1L, 1L, 1L]], 9L) == 2L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "d", - "prompt": "import std.math;\n/*\n\n Given an array arr of integers and a positive integer k, return a sorted list \n of length k with the maximum k numbers in arr.\n\n Example 1:\n\n >>> maximum([-3L, -4L, 5L], 3L)\n [-4L, -3L, 5L]\n\n Example 2:\n\n >>> maximum([4L, -4L, 4L], 2L)\n [4L, 4L]\n\n Example 3:\n\n >>> maximum([-3L, 2L, 1L, 2L, -1L, -2L, 1L], 1L)\n [2L]\n\n Note:\n 1. The length of the array will be in the range of [1, 1000].\n 2. The elements in the array will be in the range of [-1000, 1000].\n 3. 0 <= k <= len(arr)\n \n*/\nlong[] maximum(long[] arr, long k) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = maximum;\n\n assert(candidate([-3L, -4L, 5L], 3L) == [-4L, -3L, 5L]);\n assert(candidate([4L, -4L, 4L], 2L) == [4L, 4L]);\n assert(candidate([-3L, 2L, 1L, 2L, -1L, -2L, 1L], 1L) == [2L]);\n assert(candidate([123L, -123L, 20L, 0L, 1L, 2L, -3L], 3L) == [2L, 20L, 123L]);\n assert(candidate([-123L, 20L, 0L, 1L, 2L, -3L], 4L) == [0L, 1L, 2L, 20L]);\n assert(candidate([5L, 15L, 0L, 3L, -13L, -8L, 0L], 7L) == [-13L, -8L, 0L, 0L, 3L, 5L, 15L]);\n assert(candidate([-1L, 0L, 2L, 5L, 3L, -10L], 2L) == [3L, 5L]);\n assert(candidate([1L, 0L, 5L, -7L], 1L) == [5L]);\n assert(candidate([4L, -4L], 2L) == [-4L, 4L]);\n assert(candidate([-10L, 10L], 2L) == [-10L, 10L]);\n assert(candidate([1L, 2L, 3L, -23L, 243L, -400L, 0L], 0L) == []);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "d", - "prompt": "import std.math;\n/*\n\n Write a function that takes a message, and encodes in such a \n way that it swaps case of all letters, replaces all vowels in \n the message with the letter that appears 2 places ahead of that \n vowel in the english alphabet. \n Assume only letters. \n \n Examples:\n >>> encode(\"test\")\n \"TGST\"\n >>> encode(\"This is a message\")\n \"tHKS KS C MGSSCGG\"\n \n*/\nstring encode(string message) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = encode;\n\n assert(candidate(\"TEST\") == \"tgst\");\n assert(candidate(\"Mudasir\") == \"mWDCSKR\");\n assert(candidate(\"YES\") == \"ygs\");\n assert(candidate(\"This is a message\") == \"tHKS KS C MGSSCGG\");\n assert(candidate(\"I DoNt KnOw WhAt tO WrItE\") == \"k dQnT kNqW wHcT Tq wRkTg\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "d", - "prompt": "import std.math;\n/*\n\n remove_vowels is a function that takes string and returns string without vowels.\n >>> remove_vowels(\"\")\n \"\"\n >>> remove_vowels(\"abcdef\")\n \"bcdf\"\n >>> remove_vowels(\"aaaaa\")\n \"\"\n >>> remove_vowels(\"aaBAA\")\n \"B\"\n >>> remove_vowels(\"zbcd\")\n \"zbcd\"\n \n*/\nstring remove_vowels(string text) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = remove_vowels;\n\n assert(candidate(\"\") == \"\");\n assert(candidate(\"abcdef\nghijklm\") == \"bcdf\nghjklm\");\n assert(candidate(\"fedcba\") == \"fdcb\");\n assert(candidate(\"eeeee\") == \"\");\n assert(candidate(\"acBAA\") == \"cB\");\n assert(candidate(\"EcBOO\") == \"cB\");\n assert(candidate(\"ybcd\") == \"ybcd\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "d", - "prompt": "import std.math;\n/*\nReturn only positive numbers in the list.\n >>> get_positive([-1L, 2L, -4L, 5L, 6L])\n [2L, 5L, 6L]\n >>> get_positive([5L, 3L, -5L, 2L, -3L, 3L, 9L, 0L, 123L, 1L, -10L])\n [5L, 3L, 2L, 3L, 9L, 123L, 1L]\n \n*/\nlong[] get_positive(long[] l) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = get_positive;\n\n assert(candidate([-1L, -2L, 4L, 5L, 6L]) == [4L, 5L, 6L]);\n assert(candidate([5L, 3L, -5L, 2L, 3L, 3L, 9L, 0L, 123L, 1L, -10L]) == [5L, 3L, 2L, 3L, 3L, 9L, 123L, 1L]);\n assert(candidate([-1L, -2L]) == []);\n assert(candidate([]) == []);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "d", - "prompt": "import std.math;\n/*\n Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n >>> string_sequence(0L)\n \"0\"\n >>> string_sequence(5L)\n \"0 1 2 3 4 5\"\n \n*/\nstring string_sequence(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = string_sequence;\n\n assert(candidate(0L) == \"0\");\n assert(candidate(3L) == \"0 1 2 3\");\n assert(candidate(10L) == \"0 1 2 3 4 5 6 7 8 9 10\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "d", - "prompt": "import std.math;\n/*\n\n Given a positive integer n, you have to make a pile of n levels of stones.\n The first level has n stones.\n The number of stones in the next level is:\n - the next odd number if n is odd.\n - the next even number if n is even.\n Return the number of stones in each level in a list, where element at index\n i represents the number of stones in the level (i+1).\n\n Examples:\n >>> make_a_pile(3L)\n [3L, 5L, 7L]\n \n*/\nlong[] make_a_pile(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = make_a_pile;\n\n assert(candidate(3L) == [3L, 5L, 7L]);\n assert(candidate(4L) == [4L, 6L, 8L, 10L]);\n assert(candidate(5L) == [5L, 7L, 9L, 11L, 13L]);\n assert(candidate(6L) == [6L, 8L, 10L, 12L, 14L, 16L]);\n assert(candidate(8L) == [8L, 10L, 12L, 14L, 16L, 18L, 20L, 22L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nTask\n 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\n then check if the result string is palindrome.\n A string is called palindrome if it reads the same backward as forward.\n You should return a tuple containing the result string and True/False for the check.\n Example\n >>> reverse_delete(\"abcde\", \"ae\")\n tuple(\"bcd\", false)\n >>> reverse_delete(\"abcdef\", \"b\")\n tuple(\"acdef\", false)\n >>> reverse_delete(\"abcdedcba\", \"ab\")\n tuple(\"cdedc\", true)\n \n*/\nTuple!(string, bool) reverse_delete(string s, string c) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = reverse_delete;\n\n assert(candidate(\"abcde\", \"ae\") == tuple(\"bcd\", false));\n assert(candidate(\"abcdef\", \"b\") == tuple(\"acdef\", false));\n assert(candidate(\"abcdedcba\", \"ab\") == tuple(\"cdedc\", true));\n assert(candidate(\"dwik\", \"w\") == tuple(\"dik\", false));\n assert(candidate(\"a\", \"a\") == tuple(\"\", true));\n assert(candidate(\"abcdedcba\", \"\") == tuple(\"abcdedcba\", true));\n assert(candidate(\"abcdedcba\", \"v\") == tuple(\"abcdedcba\", true));\n assert(candidate(\"vabba\", \"v\") == tuple(\"abba\", true));\n assert(candidate(\"mamma\", \"mia\") == tuple(\"\", true));\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n >>> flip_case(\"Hello\")\n \"hELLO\"\n \n*/\nstring flip_case(string string) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = flip_case;\n\n assert(candidate(\"\") == \"\");\n assert(candidate(\"Hello!\") == \"hELLO!\");\n assert(candidate(\"These violent delights have violent ends\") == \"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nYou are given a string s.\n if s[i] is a letter, reverse its case from lower to upper or vise versa, \n otherwise keep it as it is.\n If the string contains no letters, reverse the string.\n The function should return the resulted string.\n Examples\n >>> solve(\"1234\")\n \"4321\"\n >>> solve(\"ab\")\n \"AB\"\n >>> solve(\"#a@C\")\n \"#A@c\"\n \n*/\nstring solve(string s) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = solve;\n\n assert(candidate(\"AsDf\") == \"aSdF\");\n assert(candidate(\"1234\") == \"4321\");\n assert(candidate(\"ab\") == \"AB\");\n assert(candidate(\"#a@C\") == \"#A@c\");\n assert(candidate(\"#AsdfW^45\") == \"#aSDFw^45\");\n assert(candidate(\"#6@2\") == \"2@6#\");\n assert(candidate(\"#$a^D\") == \"#$A^d\");\n assert(candidate(\"#ccc\") == \"#CCC\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n Filter an input list of strings only for ones that start with a given prefix.\n >>> filter_by_prefix([], \"a\")\n []\n >>> filter_by_prefix([\"abc\", \"bcd\", \"cde\", \"array\"], \"a\")\n [\"abc\", \"array\"]\n \n*/\nstring[] filter_by_prefix(string[] strings, string prefix) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = filter_by_prefix;\n\n assert(candidate([], \"john\") == []);\n assert(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\") == [\"xxx\", \"xxxAAA\", \"xxx\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nThis function takes two positive numbers x and y and returns the\n biggest even integer number that is in the range [x, y] inclusive. If \n there's no such number, then the function should return -1.\n\n For example:\n >>> choose_num(12L, 15L)\n 14L\n >>> choose_num(13L, 12L)\n -1L\n \n*/\nlong choose_num(long x, long y) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = choose_num;\n\n assert(candidate(12L, 15L) == 14L);\n assert(candidate(13L, 12L) == -1L);\n assert(candidate(33L, 12354L) == 12354L);\n assert(candidate(5234L, 5233L) == -1L);\n assert(candidate(6L, 29L) == 28L);\n assert(candidate(27L, 10L) == -1L);\n assert(candidate(7L, 7L) == -1L);\n assert(candidate(546L, 546L) == 546L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n You are given a string representing a sentence,\n the sentence contains some words separated by a space,\n and you have to return a string that contains the words from the original sentence,\n whose lengths are prime numbers,\n the order of the words in the new string should be the same as the original one.\n\n Example 1:\n >>> words_in_sentence(\"This is a test\")\n \"is\"\n\n Example 2:\n >>> words_in_sentence(\"lets go for swimming\")\n \"go for\"\n \n Constraints:\n * 1 <= len(sentence) <= 100\n * sentence contains only letters\n \n*/\nstring words_in_sentence(string sentence) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = words_in_sentence;\n\n assert(candidate(\"This is a test\") == \"is\");\n assert(candidate(\"lets go for swimming\") == \"go for\");\n assert(candidate(\"there is no place available here\") == \"there is no place\");\n assert(candidate(\"Hi I am Hussein\") == \"Hi am Hussein\");\n assert(candidate(\"go for it\") == \"go for it\");\n assert(candidate(\"here\") == \"\");\n assert(candidate(\"here is\") == \"is\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n >>> intersperse([], 4L)\n []\n >>> intersperse([1L, 2L, 3L], 4L)\n [1L, 4L, 2L, 4L, 3L]\n \n*/\nlong[] intersperse(long[] numbers, long delimeter) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = intersperse;\n\n assert(candidate([], 7L) == []);\n assert(candidate([5L, 6L, 3L, 2L], 8L) == [5L, 8L, 6L, 8L, 3L, 8L, 2L]);\n assert(candidate([2L, 2L, 2L], 2L) == [2L, 2L, 2L, 2L, 2L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nYour task is to write a function that returns true if a number x is a simple\n power of n and false in other cases.\n x is a simple power of n if n**int=x\n For example:\n >>> is_simple_power(1L, 4L)\n true\n >>> is_simple_power(2L, 2L)\n true\n >>> is_simple_power(8L, 2L)\n true\n >>> is_simple_power(3L, 2L)\n false\n >>> is_simple_power(3L, 1L)\n false\n >>> is_simple_power(5L, 3L)\n false\n \n*/\nbool is_simple_power(long x, long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = is_simple_power;\n\n assert(candidate(16L, 2L) == true);\n assert(candidate(143214L, 16L) == false);\n assert(candidate(4L, 2L) == true);\n assert(candidate(9L, 3L) == true);\n assert(candidate(16L, 4L) == true);\n assert(candidate(24L, 2L) == false);\n assert(candidate(128L, 4L) == false);\n assert(candidate(12L, 6L) == false);\n assert(candidate(1L, 1L) == true);\n assert(candidate(1L, 12L) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nWrite a function that returns true if the given number is the multiplication of 3 prime numbers\n and false otherwise.\n Knowing that (a) is less then 100. \n Example:\n >>> is_multiply_prime(30L)\n true\n 30 = 2 * 3 * 5\n \n*/\nbool is_multiply_prime(long a) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = is_multiply_prime;\n\n assert(candidate(5L) == false);\n assert(candidate(30L) == true);\n assert(candidate(8L) == true);\n assert(candidate(10L) == false);\n assert(candidate(125L) == true);\n assert(candidate(105L) == true);\n assert(candidate(126L) == false);\n assert(candidate(729L) == false);\n assert(candidate(891L) == false);\n assert(candidate(1001L) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n Given the lengths of the three sides of a triangle. Return True if the three\n sides form a right-angled triangle, False otherwise.\n A right-angled triangle is a triangle in which one angle is right angle or \n 90 degree.\n Example:\n >>> right_angle_triangle(3L, 4L, 5L)\n true\n >>> right_angle_triangle(1L, 2L, 3L)\n false\n \n*/\nbool right_angle_triangle(long a, long b, long c) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = right_angle_triangle;\n\n assert(candidate(3L, 4L, 5L) == true);\n assert(candidate(1L, 2L, 3L) == false);\n assert(candidate(10L, 6L, 8L) == true);\n assert(candidate(2L, 2L, 2L) == false);\n assert(candidate(7L, 24L, 25L) == true);\n assert(candidate(10L, 5L, 7L) == false);\n assert(candidate(5L, 12L, 13L) == true);\n assert(candidate(15L, 8L, 17L) == true);\n assert(candidate(48L, 55L, 73L) == true);\n assert(candidate(1L, 1L, 1L) == false);\n assert(candidate(2L, 2L, 10L) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n Create a function that takes 3 numbers.\n Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n Returns false in any other cases.\n \n Examples\n >>> any_int(5L, 2L, 7L)\n true\n \n >>> any_int(3L, 2L, 2L)\n false\n\n >>> any_int(3L, -2L, 1L)\n true\n \n >>> any_int(3.6, -2.2, 2L)\n false\n \n\n \n \n*/\nbool any_int(float x, float y, float z) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = any_int;\n\n assert(candidate(2L, 3L, 1L) == true);\n assert(candidate(2.5, 2L, 3L) == false);\n assert(candidate(1.5, 5L, 3.5) == false);\n assert(candidate(2L, 6L, 2L) == false);\n assert(candidate(4L, 2L, 2L) == true);\n assert(candidate(2.2, 2.2, 2.2) == false);\n assert(candidate(-4L, 6L, 2L) == true);\n assert(candidate(2L, 1L, 1L) == true);\n assert(candidate(3L, 4L, 7L) == true);\n assert(candidate(3.0, 4L, 7L) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nThis function takes a list l and returns a list l' such that\n l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n to the values of the corresponding indicies of l, but sorted.\n >>> sort_third([1L, 2L, 3L])\n [1L, 2L, 3L]\n >>> sort_third([5L, 6L, 3L, 4L, 8L, 9L, 2L])\n [2L, 6L, 3L, 4L, 8L, 9L, 5L]\n \n*/\nlong[] sort_third(long[] l) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = sort_third;\n\n assert(candidate([5L, 6L, 3L, 4L, 8L, 9L, 2L]) == [2L, 6L, 3L, 4L, 8L, 9L, 5L]);\n assert(candidate([5L, 8L, 3L, 4L, 6L, 9L, 2L]) == [2L, 8L, 3L, 4L, 6L, 9L, 5L]);\n assert(candidate([5L, 6L, 9L, 4L, 8L, 3L, 2L]) == [2L, 6L, 9L, 4L, 8L, 3L, 5L]);\n assert(candidate([5L, 6L, 3L, 4L, 8L, 9L, 2L, 1L]) == [2L, 6L, 3L, 4L, 8L, 9L, 5L, 1L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_53_add", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nAdd two numbers x and y\n >>> add(2L, 3L)\n 5L\n >>> add(5L, 7L)\n 12L\n \n*/\nlong add(long x, long y) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = add;\n\n assert(candidate(0L, 1L) == 1L);\n assert(candidate(1L, 0L) == 1L);\n assert(candidate(2L, 3L) == 5L);\n assert(candidate(5L, 7L) == 12L);\n assert(candidate(7L, 5L) == 12L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_69_search", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n zero, and has a frequency greater than or equal to the value of the integer itself. \n The frequency of an integer is the number of times it appears in the list.\n If no such a value exist, return -1.\n Examples:\n >>> search([4L, 1L, 2L, 2L, 3L, 1L])\n 2L\n >>> search([1L, 2L, 2L, 3L, 3L, 3L, 4L, 4L, 4L])\n 3L\n >>> search([5L, 5L, 4L, 4L, 4L])\n -1L\n \n*/\nlong search(long[] lst) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = search;\n\n assert(candidate([5L, 5L, 5L, 5L, 1L]) == 1L);\n assert(candidate([4L, 1L, 4L, 1L, 4L, 4L]) == 4L);\n assert(candidate([3L, 3L]) == -1L);\n assert(candidate([8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L]) == 8L);\n assert(candidate([2L, 3L, 3L, 2L, 2L]) == 2L);\n assert(candidate([2L, 7L, 8L, 8L, 4L, 8L, 7L, 3L, 9L, 6L, 5L, 10L, 4L, 3L, 6L, 7L, 1L, 7L, 4L, 10L, 8L, 1L]) == 1L);\n assert(candidate([3L, 2L, 8L, 2L]) == 2L);\n assert(candidate([6L, 7L, 1L, 8L, 8L, 10L, 5L, 8L, 5L, 3L, 10L]) == 1L);\n assert(candidate([8L, 8L, 3L, 6L, 5L, 6L, 4L]) == -1L);\n assert(candidate([6L, 9L, 6L, 7L, 1L, 4L, 7L, 1L, 8L, 8L, 9L, 8L, 10L, 10L, 8L, 4L, 10L, 4L, 10L, 1L, 2L, 9L, 5L, 7L, 9L]) == 1L);\n assert(candidate([1L, 9L, 10L, 1L, 3L]) == 1L);\n assert(candidate([6L, 9L, 7L, 5L, 8L, 7L, 5L, 3L, 7L, 5L, 10L, 10L, 3L, 6L, 10L, 2L, 8L, 6L, 5L, 4L, 9L, 5L, 3L, 10L]) == 5L);\n assert(candidate([1L]) == 1L);\n assert(candidate([8L, 8L, 10L, 6L, 4L, 3L, 5L, 8L, 2L, 4L, 2L, 8L, 4L, 6L, 10L, 4L, 2L, 1L, 10L, 2L, 1L, 1L, 5L]) == 4L);\n assert(candidate([2L, 10L, 4L, 8L, 2L, 10L, 5L, 1L, 2L, 9L, 5L, 5L, 6L, 3L, 8L, 6L, 4L, 10L]) == 2L);\n assert(candidate([1L, 6L, 10L, 1L, 6L, 9L, 10L, 8L, 6L, 8L, 7L, 3L]) == 1L);\n assert(candidate([9L, 2L, 4L, 1L, 5L, 1L, 5L, 2L, 5L, 7L, 7L, 7L, 3L, 10L, 1L, 5L, 4L, 2L, 8L, 4L, 1L, 9L, 10L, 7L, 10L, 2L, 8L, 10L, 9L, 4L]) == 4L);\n assert(candidate([2L, 6L, 4L, 2L, 8L, 7L, 5L, 6L, 4L, 10L, 4L, 6L, 3L, 7L, 8L, 8L, 3L, 1L, 4L, 2L, 2L, 10L, 7L]) == 4L);\n assert(candidate([9L, 8L, 6L, 10L, 2L, 6L, 10L, 2L, 7L, 8L, 10L, 3L, 8L, 2L, 6L, 2L, 3L, 1L]) == 2L);\n assert(candidate([5L, 5L, 3L, 9L, 5L, 6L, 3L, 2L, 8L, 5L, 6L, 10L, 10L, 6L, 8L, 4L, 10L, 7L, 7L, 10L, 8L]) == -1L);\n assert(candidate([10L]) == -1L);\n assert(candidate([9L, 7L, 7L, 2L, 4L, 7L, 2L, 10L, 9L, 7L, 5L, 7L, 2L]) == 2L);\n assert(candidate([5L, 4L, 10L, 2L, 1L, 1L, 10L, 3L, 6L, 1L, 8L]) == 1L);\n assert(candidate([7L, 9L, 9L, 9L, 3L, 4L, 1L, 5L, 9L, 1L, 2L, 1L, 1L, 10L, 7L, 5L, 6L, 7L, 6L, 7L, 7L, 6L]) == 1L);\n assert(candidate([3L, 10L, 10L, 9L, 2L]) == -1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nWrite a function that takes a string and returns True if the string\n length is a prime number or False otherwise\n Examples\n >>> prime_length(\"Hello\")\n true\n >>> prime_length(\"abcdcba\")\n true\n >>> prime_length(\"kittens\")\n true\n >>> prime_length(\"orange\")\n false\n \n*/\nbool prime_length(string string) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = prime_length;\n\n assert(candidate(\"Hello\") == true);\n assert(candidate(\"abcdcba\") == true);\n assert(candidate(\"kittens\") == true);\n assert(candidate(\"orange\") == false);\n assert(candidate(\"wow\") == true);\n assert(candidate(\"world\") == true);\n assert(candidate(\"MadaM\") == true);\n assert(candidate(\"Wow\") == true);\n assert(candidate(\"\") == false);\n assert(candidate(\"HI\") == true);\n assert(candidate(\"go\") == true);\n assert(candidate(\"gogo\") == false);\n assert(candidate(\"aaaaaaaaaaaaaaa\") == false);\n assert(candidate(\"Madam\") == true);\n assert(candidate(\"M\") == false);\n assert(candidate(\"0\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_58_common", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nReturn sorted unique common elements for two lists.\n >>> common([1L, 4L, 3L, 34L, 653L, 2L, 5L], [5L, 7L, 1L, 5L, 9L, 653L, 121L])\n [1L, 5L, 653L]\n >>> common([5L, 3L, 2L, 8L], [3L, 2L])\n [2L, 3L]\n\n \n*/\nlong[] common(long[] l1, long[] l2) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = common;\n\n assert(candidate([1L, 4L, 3L, 34L, 653L, 2L, 5L], [5L, 7L, 1L, 5L, 9L, 653L, 121L]) == [1L, 5L, 653L]);\n assert(candidate([5L, 3L, 2L, 8L], [3L, 2L]) == [2L, 3L]);\n assert(candidate([4L, 3L, 2L, 8L], [3L, 2L, 4L]) == [2L, 3L, 4L]);\n assert(candidate([4L, 3L, 2L, 8L], []) == []);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nThe Brazilian factorial is defined as:\n brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n where n > 0\n\n For example:\n >>> special_factorial(4L)\n 288L\n\n The function will receive an integer as input and should return the special\n factorial of this integer.\n \n*/\nlong special_factorial(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = special_factorial;\n\n assert(candidate(4L) == 288L);\n assert(candidate(5L) == 34560L);\n assert(candidate(7L) == 125411328000L);\n assert(candidate(1L) == 1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nIn this problem, you will implement a function that takes two lists of numbers,\n and determines whether it is possible to perform an exchange of elements\n between them to make lst1 a list of only even numbers.\n There is no limit on the number of exchanged elements between lst1 and lst2.\n If it is possible to exchange elements between the lst1 and lst2 to make\n all the elements of lst1 to be even, return \"YES\".\n Otherwise, return \"NO\".\n For example:\n >>> exchange([1L, 2L, 3L, 4L], [1L, 2L, 3L, 4L])\n \"YES\"\n >>> exchange([1L, 2L, 3L, 4L], [1L, 5L, 3L, 4L])\n \"NO\"\n It is assumed that the input lists will be non-empty.\n \n*/\nstring exchange(long[] lst1, long[] lst2) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = exchange;\n\n assert(candidate([1L, 2L, 3L, 4L], [1L, 2L, 3L, 4L]) == \"YES\");\n assert(candidate([1L, 2L, 3L, 4L], [1L, 5L, 3L, 4L]) == \"NO\");\n assert(candidate([1L, 2L, 3L, 4L], [2L, 1L, 4L, 3L]) == \"YES\");\n assert(candidate([5L, 7L, 3L], [2L, 6L, 4L]) == \"YES\");\n assert(candidate([5L, 7L, 3L], [2L, 6L, 3L]) == \"NO\");\n assert(candidate([3L, 2L, 6L, 1L, 8L, 9L], [3L, 5L, 5L, 1L, 1L, 1L]) == \"NO\");\n assert(candidate([100L, 200L], [200L, 200L]) == \"YES\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n Given a non-empty array of integers arr and an integer k, return\n the sum of the elements with at most two digits from the first k elements of arr.\n\n Example:\n\n >>> add_elements([111L, 21L, 3L, 4000L, 5L, 6L, 7L, 8L, 9L], 4L)\n 24L\n\n Constraints:\n 1. 1 <= len(arr) <= 100\n 2. 1 <= k <= len(arr)\n \n*/\nlong add_elements(long[] arr, long k) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = add_elements;\n\n assert(candidate([1L, -2L, -3L, 41L, 57L, 76L, 87L, 88L, 99L], 3L) == -4L);\n assert(candidate([111L, 121L, 3L, 4000L, 5L, 6L], 2L) == 0L);\n assert(candidate([11L, 21L, 3L, 90L, 5L, 6L, 7L, 8L, 9L], 4L) == 125L);\n assert(candidate([111L, 21L, 3L, 4000L, 5L, 6L, 7L, 8L, 9L], 4L) == 24L);\n assert(candidate([1L], 1L) == 1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nA simple program which should return the value of x if n is \n a prime number and should return the value of y otherwise.\n\n Examples:\n >>> x_or_y(7L, 34L, 12L)\n 34L\n >>> x_or_y(15L, 8L, 5L)\n 5L\n \n \n*/\nlong x_or_y(long n, long x, long y) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = x_or_y;\n\n assert(candidate(7L, 34L, 12L) == 34L);\n assert(candidate(15L, 8L, 5L) == 5L);\n assert(candidate(3L, 33L, 5212L) == 33L);\n assert(candidate(1259L, 3L, 52L) == 3L);\n assert(candidate(7919L, -1L, 12L) == -1L);\n assert(candidate(3609L, 1245L, 583L) == 583L);\n assert(candidate(91L, 56L, 129L) == 129L);\n assert(candidate(6L, 34L, 1234L) == 1234L);\n assert(candidate(1L, 2L, 0L) == 0L);\n assert(candidate(2L, 2L, 0L) == 2L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nGiven length of a side and high return area for a triangle.\n >>> triangle_area(5L, 3L)\n 7.5\n \n*/\nfloat triangle_area(long a, long h) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = triangle_area;\n\n assert(candidate(5L, 3L) == 7.5);\n assert(candidate(2L, 2L) == 2.0);\n assert(candidate(10L, 8L) == 40.0);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nEveryone knows Fibonacci sequence, it was studied deeply by mathematicians in \n the last couple centuries. However, what people don't know is Tribonacci sequence.\n Tribonacci sequence is defined by the recurrence:\n tri(1) = 3\n tri(n) = 1 + n / 2, if n is even.\n tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n For example:\n tri(2) = 1 + (2 / 2) = 2\n tri(4) = 3\n tri(3) = tri(2) + tri(1) + tri(4)\n = 2 + 3 + 3 = 8 \n You are given a non-negative integer number n, you have to a return a list of the \n first n + 1 numbers of the Tribonacci sequence.\n Examples:\n >>> tri(3L)\n [1L, 3L, 2L, 8L]\n \n*/\nlong[] tri(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = tri;\n\n assert(candidate(3L) == [1L, 3L, 2L, 8L]);\n assert(candidate(4L) == [1L, 3L, 2L, 8L, 3L]);\n assert(candidate(5L) == [1L, 3L, 2L, 8L, 3L, 15L]);\n assert(candidate(6L) == [1L, 3L, 2L, 8L, 3L, 15L, 4L]);\n assert(candidate(7L) == [1L, 3L, 2L, 8L, 3L, 15L, 4L, 24L]);\n assert(candidate(8L) == [1L, 3L, 2L, 8L, 3L, 15L, 4L, 24L, 5L]);\n assert(candidate(9L) == [1L, 3L, 2L, 8L, 3L, 15L, 4L, 24L, 5L, 35L]);\n assert(candidate(20L) == [1L, 3L, 2L, 8L, 3L, 15L, 4L, 24L, 5L, 35L, 6L, 48L, 7L, 63L, 8L, 80L, 9L, 99L, 10L, 120L, 11L]);\n assert(candidate(0L) == [1L]);\n assert(candidate(1L) == [1L, 3L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n You are given a list of two strings, both strings consist of open\n parentheses '(' or close parentheses ')' only.\n Your job is to check if it is possible to concatenate the two strings in\n some order, that the resulting string will be good.\n A string S is considered to be good if and only if all parentheses in S\n are balanced. For example: the string '(())()' is good, while the string\n '())' is not.\n Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n\n Examples:\n >>> match_parens([\"()(\", \")\"])\n \"Yes\"\n >>> match_parens([\")\", \")\"])\n \"No\"\n \n*/\nstring match_parens(string[] lst) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = match_parens;\n\n assert(candidate([\"()(\", \")\"]) == \"Yes\");\n assert(candidate([\")\", \")\"]) == \"No\");\n assert(candidate([\"(()(())\", \"())())\"]) == \"No\");\n assert(candidate([\")())\", \"(()()(\"]) == \"Yes\");\n assert(candidate([\"(())))\", \"(()())((\"]) == \"Yes\");\n assert(candidate([\"()\", \"())\"]) == \"No\");\n assert(candidate([\"(()(\", \"()))()\"]) == \"Yes\");\n assert(candidate([\"((((\", \"((())\"]) == \"No\");\n assert(candidate([\")(()\", \"(()(\"]) == \"No\");\n assert(candidate([\")(\", \")(\"]) == \"No\");\n assert(candidate([\"(\", \")\"]) == \"Yes\");\n assert(candidate([\")\", \"(\"]) == \"Yes\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n From a list of integers, remove all elements that occur more than once.\n Keep order of elements left the same as in the input.\n >>> remove_duplicates([1L, 2L, 3L, 2L, 4L])\n [1L, 3L, 4L]\n \n*/\nlong[] remove_duplicates(long[] numbers) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = remove_duplicates;\n\n assert(candidate([]) == []);\n assert(candidate([1L, 2L, 3L, 4L]) == [1L, 2L, 3L, 4L]);\n assert(candidate([1L, 2L, 3L, 2L, 4L, 3L, 5L]) == [1L, 4L, 5L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n Return a greatest common divisor of two integers a and b\n >>> greatest_common_divisor(3L, 5L)\n 1L\n >>> greatest_common_divisor(25L, 15L)\n 5L\n \n*/\nlong greatest_common_divisor(long a, long b) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = greatest_common_divisor;\n\n assert(candidate(3L, 7L) == 1L);\n assert(candidate(10L, 15L) == 5L);\n assert(candidate(49L, 14L) == 7L);\n assert(candidate(144L, 60L) == 12L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n Checks if given string is a palindrome\n >>> is_palindrome(\"\")\n true\n >>> is_palindrome(\"aba\")\n true\n >>> is_palindrome(\"aaaaa\")\n true\n >>> is_palindrome(\"zbcd\")\n false\n \n*/\nbool is_palindrome(string text) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = is_palindrome;\n\n assert(candidate(\"\") == true);\n assert(candidate(\"aba\") == true);\n assert(candidate(\"aaaaa\") == true);\n assert(candidate(\"zbcd\") == false);\n assert(candidate(\"xywyx\") == true);\n assert(candidate(\"xywyz\") == false);\n assert(candidate(\"xywzx\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n xs represent coefficients of a polynomial.\n xs[0] + xs[1] * x + xs[2] * x^2 + ....\n Return derivative of this polynomial in the same form.\n >>> derivative([3L, 1L, 2L, 4L, 5L])\n [1L, 4L, 12L, 20L]\n >>> derivative([1L, 2L, 3L])\n [2L, 6L]\n \n*/\nlong[] derivative(long[] xs) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = derivative;\n\n assert(candidate([3L, 1L, 2L, 4L, 5L]) == [1L, 4L, 12L, 20L]);\n assert(candidate([1L, 2L, 3L]) == [2L, 6L]);\n assert(candidate([3L, 2L, 1L]) == [2L, 2L]);\n assert(candidate([3L, 2L, 1L, 0L, 4L]) == [2L, 2L, 0L, 16L]);\n assert(candidate([1L]) == []);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n In this task, you will be given a string that represents a number of apples and oranges \n that are distributed in a basket of fruit this basket contains \n apples, oranges, and mango fruits. Given the string that represents the total number of \n the oranges and apples and an integer that represent the total number of the fruits \n in the basket return the number of the mango fruits in the basket.\n for examble:\n >>> fruit_distribution(\"5 apples and 6 oranges\", 19L)\n 8L\n >>> fruit_distribution(\"0 apples and 1 oranges\", 3L)\n 2L\n >>> fruit_distribution(\"2 apples and 3 oranges\", 100L)\n 95L\n >>> fruit_distribution(\"100 apples and 1 oranges\", 120L)\n 19L\n \n*/\nlong fruit_distribution(string s, long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = fruit_distribution;\n\n assert(candidate(\"5 apples and 6 oranges\", 19L) == 8L);\n assert(candidate(\"5 apples and 6 oranges\", 21L) == 10L);\n assert(candidate(\"0 apples and 1 oranges\", 3L) == 2L);\n assert(candidate(\"1 apples and 0 oranges\", 3L) == 2L);\n assert(candidate(\"2 apples and 3 oranges\", 100L) == 95L);\n assert(candidate(\"2 apples and 3 oranges\", 5L) == 0L);\n assert(candidate(\"1 apples and 100 oranges\", 120L) == 19L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n Write a function that takes an integer a and returns True \n if this ingeger is a cube of some integer number.\n Note: you may assume the input is always valid.\n Examples:\n >>> iscube(1L)\n true\n >>> iscube(2L)\n false\n >>> iscube(-1L)\n true\n >>> iscube(64L)\n true\n >>> iscube(0L)\n true\n >>> iscube(180L)\n false\n \n*/\nbool iscube(long a) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = iscube;\n\n assert(candidate(1L) == true);\n assert(candidate(2L) == false);\n assert(candidate(-1L) == true);\n assert(candidate(64L) == true);\n assert(candidate(180L) == false);\n assert(candidate(1000L) == true);\n assert(candidate(0L) == true);\n assert(candidate(1729L) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n In this Kata, you have to sort an array of non-negative integers according to\n number of ones in their binary representation in ascending order.\n For similar number of ones, sort based on decimal value.\n\n It must be implemented like this:\n >>> sort_array([1L, 5L, 2L, 3L, 4L])\n [1L, 2L, 3L, 4L, 5L]\n >>> sort_array([-2L, -3L, -4L, -5L, -6L])\n [-6L, -5L, -4L, -3L, -2L]\n >>> sort_array([1L, 0L, 2L, 3L, 4L])\n [0L, 1L, 2L, 3L, 4L]\n \n*/\nlong[] sort_array(long[] arr) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = sort_array;\n\n assert(candidate([1L, 5L, 2L, 3L, 4L]) == [1L, 2L, 4L, 3L, 5L]);\n assert(candidate([-2L, -3L, -4L, -5L, -6L]) == [-4L, -2L, -6L, -5L, -3L]);\n assert(candidate([1L, 0L, 2L, 3L, 4L]) == [0L, 1L, 2L, 4L, 3L]);\n assert(candidate([]) == []);\n assert(candidate([2L, 5L, 77L, 4L, 5L, 3L, 5L, 7L, 2L, 3L, 4L]) == [2L, 2L, 4L, 4L, 3L, 3L, 5L, 5L, 5L, 7L, 77L]);\n assert(candidate([3L, 6L, 44L, 12L, 32L, 5L]) == [32L, 3L, 5L, 6L, 12L, 44L]);\n assert(candidate([2L, 4L, 8L, 16L, 32L]) == [2L, 4L, 8L, 16L, 32L]);\n assert(candidate([2L, 4L, 8L, 16L, 32L]) == [2L, 4L, 8L, 16L, 32L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nGiven a list of strings, where each string consists of only digits, return a list.\n Each element i of the output should be \"the number of odd elements in the\n string i of the input.\" where all the i's should be replaced by the number\n of odd digits in the i'th string of the input.\n\n >>> odd_count([\"1234567\"])\n [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n >>> odd_count([\"3\", \"11111111\"])\n [\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\n \n*/\nstring[] odd_count(string[] lst) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = odd_count;\n\n assert(candidate([\"1234567\"]) == [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]);\n 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.\"]);\n assert(candidate([\"271\", \"137\", \"314\"]) == [\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n brackets is a string of \"(\" and \")\".\n return True if every opening bracket has a corresponding closing bracket.\n\n >>> correct_bracketing(\"(\")\n false\n >>> correct_bracketing(\"()\")\n true\n >>> correct_bracketing(\"(()())\")\n true\n >>> correct_bracketing(\")(()\")\n false\n \n*/\nbool correct_bracketing(string brackets) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = correct_bracketing;\n\n assert(candidate(\"()\") == true);\n assert(candidate(\"(()())\") == true);\n assert(candidate(\"()()(()())()\") == true);\n assert(candidate(\"()()((()()())())(()()(()))\") == true);\n assert(candidate(\"((()())))\") == false);\n assert(candidate(\")(()\") == false);\n assert(candidate(\"(\") == false);\n assert(candidate(\"((((\") == false);\n assert(candidate(\")\") == false);\n assert(candidate(\"(()\") == false);\n assert(candidate(\"()()(()())())(()\") == false);\n assert(candidate(\"()()(()())()))()\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nTask\n Write a function that takes a string as input and returns the sum of the upper characters only'\n ASCII codes.\n\n Examples:\n >>> digitSum(\"\")\n 0L\n >>> digitSum(\"abAB\")\n 131L\n >>> digitSum(\"abcCd\")\n 67L\n >>> digitSum(\"helloE\")\n 69L\n >>> digitSum(\"woArBld\")\n 131L\n >>> digitSum(\"aAaaaXa\")\n 153L\n \n*/\nlong digitSum(string s) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = digitSum;\n\n assert(candidate(\"\") == 0L);\n assert(candidate(\"abAB\") == 131L);\n assert(candidate(\"abcCd\") == 67L);\n assert(candidate(\"helloE\") == 69L);\n assert(candidate(\"woArBld\") == 131L);\n assert(candidate(\"aAaaaXa\") == 153L);\n assert(candidate(\" How are yOu?\") == 151L);\n assert(candidate(\"You arE Very Smart\") == 327L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nWrite a function that accepts a list of strings as a parameter,\n deletes the strings that have odd lengths from it,\n and returns the resulted list with a sorted order,\n The list is always a list of strings and never an array of numbers,\n and it may contain duplicates.\n The order of the list should be ascending by length of each word, and you\n should return the list sorted by that rule.\n If two words have the same length, sort the list alphabetically.\n The function should return a list of strings in sorted order.\n You may assume that all words will have the same length.\n For example:\n >>> list_sort([\"aa\", \"a\", \"aaa\"])\n [\"aa\"]\n >>> list_sort([\"ab\", \"a\", \"aaa\", \"cd\"])\n [\"ab\", \"cd\"]\n \n*/\nstring[] sorted_list_sum(string[] lst) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = sorted_list_sum;\n\n assert(candidate([\"aa\", \"a\", \"aaa\"]) == [\"aa\"]);\n assert(candidate([\"school\", \"AI\", \"asdf\", \"b\"]) == [\"AI\", \"asdf\", \"school\"]);\n assert(candidate([\"d\", \"b\", \"c\", \"a\"]) == []);\n assert(candidate([\"d\", \"dcba\", \"abcd\", \"a\"]) == [\"abcd\", \"dcba\"]);\n assert(candidate([\"AI\", \"ai\", \"au\"]) == [\"AI\", \"ai\", \"au\"]);\n assert(candidate([\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"]) == []);\n assert(candidate([\"aaaa\", \"bbbb\", \"dd\", \"cc\"]) == [\"cc\", \"dd\", \"aaaa\", \"bbbb\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n You are given an array arr of integers and you need to return\n sum of magnitudes of integers multiplied by product of all signs\n of each number in the array, represented by 1, -1 or 0.\n Note: return None for empty arr.\n\n Example:\n >>> prod_signs([1L, 2L, 2L, -4L])\n 9L\n >>> prod_signs([0L, 1L])\n 0L\n >>> prod_signs([])\n None\n \n*/\nNullable!(long) prod_signs(long[] arr) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = prod_signs;\n\n{\n auto result = candidate([1L, 2L, 2L, -4L]);\n assert(!result.isNull && result.get == -9L);\n}\n\n{\n auto result = candidate([0L, 1L]);\n assert(!result.isNull && result.get == 0L);\n}\n\n{\n auto result = candidate([1L, 1L, 1L, 2L, 3L, -1L, 1L]);\n assert(!result.isNull && result.get == -10L);\n}\n\n{\n auto result = candidate([]);\n assert(result.isNull);\n}\n\n{\n auto result = candidate([2L, 4L, 1L, 2L, -1L, -1L, 9L]);\n assert(!result.isNull && result.get == 20L);\n}\n\n{\n auto result = candidate([-1L, 1L, -1L, 1L]);\n assert(!result.isNull && result.get == 4L);\n}\n\n{\n auto result = candidate([-1L, 1L, 1L, 1L]);\n assert(!result.isNull && result.get == -4L);\n}\n\n{\n auto result = candidate([-1L, 1L, 1L, 0L]);\n assert(!result.isNull && result.get == 0L);\n}\n\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nReturn list with elements incremented by 1.\n >>> incr_list([1L, 2L, 3L])\n [2L, 3L, 4L]\n >>> incr_list([5L, 3L, 5L, 2L, 3L, 3L, 9L, 0L, 123L])\n [6L, 4L, 6L, 3L, 4L, 4L, 10L, 1L, 124L]\n \n*/\nlong[] incr_list(long[] l) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = incr_list;\n\n assert(candidate([]) == []);\n assert(candidate([3L, 2L, 1L]) == [4L, 3L, 2L]);\n assert(candidate([5L, 2L, 5L, 2L, 3L, 3L, 9L, 0L, 123L]) == [6L, 3L, 6L, 3L, 4L, 4L, 10L, 1L, 124L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n From a given list of integers, generate a list of rolling maximum element found until given moment\n in the sequence.\n >>> rolling_max([1L, 2L, 3L, 2L, 3L, 4L, 2L])\n [1L, 2L, 3L, 3L, 3L, 4L, 4L]\n \n*/\nlong[] rolling_max(long[] numbers) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = rolling_max;\n\n assert(candidate([]) == []);\n assert(candidate([1L, 2L, 3L, 4L]) == [1L, 2L, 3L, 4L]);\n assert(candidate([4L, 3L, 2L, 1L]) == [4L, 4L, 4L, 4L]);\n assert(candidate([3L, 2L, 3L, 100L, 3L]) == [3L, 3L, 3L, 100L, 100L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n separate those group into separate strings and return the list of those.\n Separate groups are balanced (each open brace is properly closed) and not nested within each other\n Ignore any spaces in the input string.\n >>> separate_paren_groups(\"( ) (( )) (( )( ))\")\n [\"()\", \"(())\", \"(()())\"]\n \n*/\nstring[] separate_paren_groups(string paren_string) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = separate_paren_groups;\n\n assert(candidate(\"(()()) ((())) () ((())()())\") == [\"(()())\", \"((()))\", \"()\", \"((())()())\"]);\n assert(candidate(\"() (()) ((())) (((())))\") == [\"()\", \"(())\", \"((()))\", \"(((())))\"]);\n assert(candidate(\"(()(())((())))\") == [\"(()(())((())))\"]);\n assert(candidate(\"( ) (( )) (( )( ))\") == [\"()\", \"(())\", \"(()())\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n You will be given a string of words separated by commas or spaces. Your task is\n to split the string into words and return an array of the words.\n \n For example:\n >>> words_string(\"Hi, my name is John\")\n [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n >>> words_string(\"One, two, three, four, five, six\")\n [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\n \n*/\nstring[] words_string(string s) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = words_string;\n\n assert(candidate(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]);\n assert(candidate(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]);\n assert(candidate(\"Hi, my name\") == [\"Hi\", \"my\", \"name\"]);\n assert(candidate(\"One,, two, three, four, five, six,\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]);\n assert(candidate(\"\") == []);\n assert(candidate(\"ahmed , gamal\") == [\"ahmed\", \"gamal\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nThis function takes a list l and returns a list l' such that\n l' is identical to l in the odd indicies, while its values at the even indicies are equal\n to the values of the even indicies of l, but sorted.\n >>> sort_even([1L, 2L, 3L])\n [1L, 2L, 3L]\n >>> sort_even([5L, 6L, 3L, 4L])\n [3L, 6L, 5L, 4L]\n \n*/\nlong[] sort_even(long[] l) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = sort_even;\n\n assert(candidate([1L, 2L, 3L]) == [1L, 2L, 3L]);\n assert(candidate([5L, 3L, -5L, 2L, -3L, 3L, 9L, 0L, 123L, 1L, -10L]) == [-10L, 3L, -5L, 2L, -3L, 3L, 5L, 0L, 9L, 1L, 123L]);\n assert(candidate([5L, 8L, -12L, 4L, 23L, 2L, 3L, 11L, 12L, -10L]) == [-12L, 8L, 3L, 4L, 5L, 2L, 12L, 11L, 23L, -10L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nI think we all remember that feeling when the result of some long-awaited\n event is finally known. The feelings and thoughts you have at that moment are\n definitely worth noting down and comparing.\n Your task is to determine if a person correctly guessed the results of a number of matches.\n You are given two arrays of scores and guesses of equal length, where each index shows a match. \n Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n the value is 0, and if not, the value is the absolute difference between the guess and the score.\n \n \n example:\n\n >>> compare([1L, 2L, 3L, 4L, 5L, 1L], [1L, 2L, 3L, 4L, 2L, -2L])\n [0L, 0L, 0L, 0L, 3L, 3L]\n >>> compare([0L, 5L, 0L, 0L, 0L, 4L], [4L, 1L, 1L, 0L, 0L, -2L])\n [4L, 4L, 1L, 0L, 0L, 6L]\n \n*/\nlong[] compare(long[] game, long[] guess) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = compare;\n\n assert(candidate([1L, 2L, 3L, 4L, 5L, 1L], [1L, 2L, 3L, 4L, 2L, -2L]) == [0L, 0L, 0L, 0L, 3L, 3L]);\n assert(candidate([0L, 0L, 0L, 0L, 0L, 0L], [0L, 0L, 0L, 0L, 0L, 0L]) == [0L, 0L, 0L, 0L, 0L, 0L]);\n assert(candidate([1L, 2L, 3L], [-1L, -2L, -3L]) == [2L, 4L, 6L]);\n assert(candidate([1L, 2L, 3L, 5L], [-1L, 2L, 3L, 4L]) == [2L, 0L, 0L, 1L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n Given a positive integer n, return a tuple that has the number of even and odd\n integer palindromes that fall within the range(1, n), inclusive.\n\n Example 1:\n\n >>> even_odd_palindrome(3L)\n tuple(1L, 2L)\n Explanation:\n Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n\n Example 2:\n\n >>> even_odd_palindrome(12L)\n tuple(4L, 6L)\n Explanation:\n Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n\n Note:\n 1. 1 <= n <= 10^3\n 2. returned tuple has the number of even and odd integer palindromes respectively.\n \n*/\nTuple!(long, long) even_odd_palindrome(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = even_odd_palindrome;\n\n assert(candidate(123L) == tuple(8L, 13L));\n assert(candidate(12L) == tuple(4L, 6L));\n assert(candidate(3L) == tuple(1L, 2L));\n assert(candidate(63L) == tuple(6L, 8L));\n assert(candidate(25L) == tuple(5L, 6L));\n assert(candidate(19L) == tuple(4L, 6L));\n assert(candidate(9L) == tuple(4L, 5L));\n assert(candidate(1L) == tuple(0L, 1L));\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nThe Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fib4(0) -> 0\n fib4(1) -> 0\n fib4(2) -> 2\n fib4(3) -> 0\n fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n >>> fib4(5L)\n 4L\n >>> fib4(6L)\n 8L\n >>> fib4(7L)\n 14L\n \n*/\nlong fib4(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = fib4;\n\n assert(candidate(5L) == 4L);\n assert(candidate(8L) == 28L);\n assert(candidate(10L) == 104L);\n assert(candidate(12L) == 386L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n Given two positive integers a and b, return the even digits between a\n and b, in ascending order.\n\n For example:\n >>> generate_integers(2L, 8L)\n [2L, 4L, 6L, 8L]\n >>> generate_integers(8L, 2L)\n [2L, 4L, 6L, 8L]\n >>> generate_integers(10L, 14L)\n []\n \n*/\nlong[] generate_integers(long a, long b) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = generate_integers;\n\n assert(candidate(2L, 10L) == [2L, 4L, 6L, 8L]);\n assert(candidate(10L, 2L) == [2L, 4L, 6L, 8L]);\n assert(candidate(132L, 2L) == [2L, 4L, 6L, 8L]);\n assert(candidate(17L, 89L) == []);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n For a given list of input numbers, calculate Mean Absolute Deviation\n around the mean of this dataset.\n Mean Absolute Deviation is the average absolute difference between each\n element and a centerpoint (mean in this case):\n MAD = average | x - x_mean |\n >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n 1.0\n \n*/\nfloat mean_absolute_deviation(float[] numbers) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = mean_absolute_deviation;\n\n assert(candidate([1.0, 2.0]) == 0.5);\n assert(candidate([1.0, 2.0, 3.0, 4.0]) == 1.0);\n assert(candidate([1.0, 2.0, 3.0, 4.0, 5.0]) == 1.2);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nCreate a function encrypt that takes a string as an argument and\n returns a string encrypted with the alphabet being rotated. \n The alphabet should be rotated in a manner such that the letters \n shift down by two multiplied to two places.\n For example:\n >>> encrypt(\"hi\")\n \"lm\"\n >>> encrypt(\"asdfghjkl\")\n \"ewhjklnop\"\n >>> encrypt(\"gf\")\n \"kj\"\n >>> encrypt(\"et\")\n \"ix\"\n \n*/\nstring encrypt(string s) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = encrypt;\n\n assert(candidate(\"hi\") == \"lm\");\n assert(candidate(\"asdfghjkl\") == \"ewhjklnop\");\n assert(candidate(\"gf\") == \"kj\");\n assert(candidate(\"et\") == \"ix\");\n assert(candidate(\"faewfawefaewg\") == \"jeiajeaijeiak\");\n assert(candidate(\"hellomyfriend\") == \"lippsqcjvmirh\");\n assert(candidate(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\") == \"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\");\n assert(candidate(\"a\") == \"e\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n\n The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n as follows: start with any positive integer n. Then each term is obtained from the \n previous term as follows: if the previous term is even, the next term is one half of \n the previous term. If the previous term is odd, the next term is 3 times the previous\n term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n\n Note: \n 1. Collatz(1) is [1].\n 2. returned list sorted in increasing order.\n\n For example:\n get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n >>> get_odd_collatz(5L)\n [1L, 5L]\n \n*/\nlong[] get_odd_collatz(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = get_odd_collatz;\n\n assert(candidate(14L) == [1L, 5L, 7L, 11L, 13L, 17L]);\n assert(candidate(5L) == [1L, 5L]);\n assert(candidate(12L) == [1L, 3L, 5L]);\n assert(candidate(1L) == [1L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n Find how many times a given substring can be found in the original string. Count overlaping cases.\n >>> how_many_times(\"\", \"a\")\n 0L\n >>> how_many_times(\"aaa\", \"a\")\n 3L\n >>> how_many_times(\"aaaa\", \"aa\")\n 3L\n \n*/\nlong how_many_times(string string, string substring) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = how_many_times;\n\n assert(candidate(\"\", \"x\") == 0L);\n assert(candidate(\"xyxyxyx\", \"x\") == 4L);\n assert(candidate(\"cacacacac\", \"cac\") == 4L);\n assert(candidate(\"john doe\", \"john\") == 1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nWe have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n numbers in the array will be randomly ordered. Your task is to determine if\n it is possible to get an array sorted in non-decreasing order by performing \n the following operation on the given array:\n You are allowed to perform right shift operation any number of times.\n \n One right shift operation means shifting all elements of the array by one\n position in the right direction. The last element of the array will be moved to\n the starting position in the array i.e. 0th index. \n\n If it is possible to obtain the sorted array by performing the above operation\n then return True else return False.\n If the given array is empty then return True.\n\n Note: The given list is guaranteed to have unique elements.\n\n For Example:\n \n >>> move_one_ball([3L, 4L, 5L, 1L, 2L])\n true\n Explanation: By performin 2 right shift operations, non-decreasing order can\n be achieved for the given array.\n >>> move_one_ball([3L, 5L, 4L, 1L, 2L])\n false\n Explanation:It is not possible to get non-decreasing order for the given\n array by performing any number of right shift operations.\n \n \n*/\nbool move_one_ball(long[] arr) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = move_one_ball;\n\n assert(candidate([3L, 4L, 5L, 1L, 2L]) == true);\n assert(candidate([3L, 5L, 10L, 1L, 2L]) == true);\n assert(candidate([4L, 3L, 1L, 2L]) == false);\n assert(candidate([3L, 5L, 4L, 1L, 2L]) == false);\n assert(candidate([]) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n Write a function which sorts the given list of integers\n in ascending order according to the sum of their digits.\n Note: if there are several items with similar sum of their digits,\n order them based on their index in original list.\n\n For example:\n >>> order_by_points([1L, 11L, -1L, -11L, -12L])\n [-1L, -11L, 1L, -12L, 11L]\n >>> order_by_points([])\n []\n \n*/\nlong[] order_by_points(long[] nums) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = order_by_points;\n\n assert(candidate([1L, 11L, -1L, -11L, -12L]) == [-1L, -11L, 1L, -12L, 11L]);\n assert(candidate([1234L, 423L, 463L, 145L, 2L, 423L, 423L, 53L, 6L, 37L, 3457L, 3L, 56L, 0L, 46L]) == [0L, 2L, 3L, 6L, 53L, 423L, 423L, 423L, 1234L, 145L, 37L, 46L, 56L, 463L, 3457L]);\n assert(candidate([]) == []);\n assert(candidate([1L, -11L, -32L, 43L, 54L, -98L, 2L, -3L]) == [-3L, -32L, -98L, -11L, 1L, 2L, 43L, 54L]);\n assert(candidate([1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L]) == [1L, 10L, 2L, 11L, 3L, 4L, 5L, 6L, 7L, 8L, 9L]);\n assert(candidate([0L, 6L, 6L, -76L, -21L, 23L, 4L]) == [-76L, -21L, 0L, 4L, 23L, 6L, 6L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n Return list of prime factors of given integer in the order from smallest to largest.\n Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n Input number should be equal to the product of all factors\n >>> factorize(8L)\n [2L, 2L, 2L]\n >>> factorize(25L)\n [5L, 5L]\n >>> factorize(70L)\n [2L, 5L, 7L]\n \n*/\nlong[] factorize(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = factorize;\n\n assert(candidate(2L) == [2L]);\n assert(candidate(4L) == [2L, 2L]);\n assert(candidate(8L) == [2L, 2L, 2L]);\n assert(candidate(57L) == [3L, 19L]);\n assert(candidate(3249L) == [3L, 3L, 19L, 19L]);\n assert(candidate(185193L) == [3L, 3L, 3L, 19L, 19L, 19L]);\n assert(candidate(20577L) == [3L, 19L, 19L, 19L]);\n assert(candidate(18L) == [2L, 3L, 3L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nReturn True if all numbers in the list l are below threshold t.\n >>> below_threshold([1L, 2L, 4L, 10L], 100L)\n true\n >>> below_threshold([1L, 20L, 4L, 10L], 5L)\n false\n \n*/\nbool below_threshold(long[] l, long t) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = below_threshold;\n\n assert(candidate([1L, 2L, 4L, 10L], 100L) == true);\n assert(candidate([1L, 20L, 4L, 10L], 5L) == false);\n assert(candidate([1L, 20L, 4L, 10L], 21L) == true);\n assert(candidate([1L, 20L, 4L, 10L], 22L) == true);\n assert(candidate([1L, 8L, 4L, 10L], 11L) == true);\n assert(candidate([1L, 8L, 4L, 10L], 10L) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n For each of the group, output the deepest level of nesting of parentheses.\n E.g. (()()) has maximum two levels of nesting while ((())) has three.\n\n >>> parse_nested_parens(\"(()()) ((())) () ((())()())\")\n [2L, 3L, 1L, 3L]\n \n*/\nlong[] parse_nested_parens(string paren_string) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = parse_nested_parens;\n\n assert(candidate(\"(()()) ((())) () ((())()())\") == [2L, 3L, 1L, 3L]);\n assert(candidate(\"() (()) ((())) (((())))\") == [1L, 2L, 3L, 4L]);\n assert(candidate(\"(()(())((())))\") == [4L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nGiven a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n \n\n Examples\n >>> solution([5L, 8L, 7L, 1L])\n 12L\n >>> solution([3L, 3L, 3L, 3L, 3L])\n 9L\n >>> solution([30L, 13L, 24L, 321L])\n 0L\n \n*/\nlong solution(long[] lst) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = solution;\n\n assert(candidate([5L, 8L, 7L, 1L]) == 12L);\n assert(candidate([3L, 3L, 3L, 3L, 3L]) == 9L);\n assert(candidate([30L, 13L, 24L, 321L]) == 0L);\n assert(candidate([5L, 9L]) == 5L);\n assert(candidate([2L, 4L, 8L]) == 0L);\n assert(candidate([30L, 13L, 23L, 32L]) == 23L);\n assert(candidate([3L, 13L, 2L, 9L]) == 3L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n You are given a positive integer n. You have to create an integer array a of length n.\n For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n and a[i] + a[j] + a[k] is a multiple of 3.\n\n Example :\n >>> get_max_triples(5L)\n 1L\n Explanation: \n a = [1, 3, 7, 13, 21]\n The only valid triple is (1, 7, 13).\n \n*/\nlong get_max_triples(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = get_max_triples;\n\n assert(candidate(5L) == 1L);\n assert(candidate(6L) == 4L);\n assert(candidate(10L) == 36L);\n assert(candidate(100L) == 53361L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n You are given a list of integers.\n Write a function next_smallest() that returns the 2nd smallest element of the list.\n Return None if there is no such element.\n >>> next_smallest([1L, 2L, 3L, 4L, 5L])\n 2L\n >>> next_smallest([5L, 1L, 4L, 3L, 2L])\n 2L\n >>> next_smallest([])\n None\n >>> next_smallest([1L, 1L])\n None\n \n*/\nNullable!(long) next_smallest(long[] lst) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = next_smallest;\n\n{\n auto result = candidate([1L, 2L, 3L, 4L, 5L]);\n assert(!result.isNull && result.get == 2L);\n}\n\n{\n auto result = candidate([5L, 1L, 4L, 3L, 2L]);\n assert(!result.isNull && result.get == 2L);\n}\n\n{\n auto result = candidate([]);\n assert(result.isNull);\n}\n\n{\n auto result = candidate([1L, 1L]);\n assert(result.isNull);\n}\n\n{\n auto result = candidate([1L, 1L, 1L, 1L, 0L]);\n assert(!result.isNull && result.get == 1L);\n}\n\n{\n auto result = candidate([1L, 1L]);\n assert(result.isNull);\n}\n\n{\n auto result = candidate([-35L, 34L, 12L, -45L]);\n assert(!result.isNull && result.get == -35L);\n}\n\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n Input is a space-delimited string of numberals from 'zero' to 'nine'.\n Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n Return the string with numbers sorted from smallest to largest\n >>> sort_numbers(\"three one five\")\n \"one three five\"\n \n*/\nstring sort_numbers(string numbers) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = sort_numbers;\n\n assert(candidate(\"\") == \"\");\n assert(candidate(\"three\") == \"three\");\n assert(candidate(\"three five nine\") == \"three five nine\");\n assert(candidate(\"five zero four seven nine eight\") == \"zero four five seven eight nine\");\n assert(candidate(\"six five four three two one zero\") == \"zero one two three four five six\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nYou are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n >>> cycpattern_check(\"abcd\", \"abd\")\n false\n >>> cycpattern_check(\"hello\", \"ell\")\n true\n >>> cycpattern_check(\"whassup\", \"psus\")\n false\n >>> cycpattern_check(\"abab\", \"baa\")\n true\n >>> cycpattern_check(\"efef\", \"eeff\")\n false\n >>> cycpattern_check(\"himenss\", \"simen\")\n true\n\n \n*/\nbool cycpattern_check(string a, string b) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = cycpattern_check;\n\n assert(candidate(\"xyzw\", \"xyw\") == false);\n assert(candidate(\"yello\", \"ell\") == true);\n assert(candidate(\"whattup\", \"ptut\") == false);\n assert(candidate(\"efef\", \"fee\") == true);\n assert(candidate(\"abab\", \"aabb\") == false);\n assert(candidate(\"winemtt\", \"tinem\") == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nYou will be given a number in decimal form and your task is to convert it to\n binary format. The function should return a string, with each character representing a binary\n number. Each character in the string will be '0' or '1'.\n\n There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n The extra characters are there to help with the format.\n\n Examples:\n >>> decimal_to_binary(15L)\n \"db1111db\"\n >>> decimal_to_binary(32L)\n \"db100000db\"\n \n*/\nstring decimal_to_binary(long decimal) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = decimal_to_binary;\n\n assert(candidate(0L) == \"db0db\");\n assert(candidate(32L) == \"db100000db\");\n assert(candidate(103L) == \"db1100111db\");\n assert(candidate(15L) == \"db1111db\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n Filter an input list of strings only for ones that contain given substring\n >>> filter_by_substring([], \"a\")\n []\n >>> filter_by_substring([\"abc\", \"bacd\", \"cde\", \"array\"], \"a\")\n [\"abc\", \"bacd\", \"array\"]\n \n*/\nstring[] filter_by_substring(string[] strings, string substring) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = filter_by_substring;\n\n assert(candidate([], \"john\") == []);\n assert(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\") == [\"xxx\", \"xxxAAA\", \"xxx\"]);\n assert(candidate([\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xx\") == [\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"]);\n assert(candidate([\"grunt\", \"trumpet\", \"prune\", \"gruesome\"], \"run\") == [\"grunt\", \"prune\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nGiven an integer. return a tuple that has the number of even and odd digits respectively.\n\n Example:\n >>> even_odd_count(-12L)\n tuple(1L, 1L)\n >>> even_odd_count(123L)\n tuple(1L, 2L)\n \n*/\nTuple!(long, long) even_odd_count(long num) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = even_odd_count;\n\n assert(candidate(7L) == tuple(0L, 1L));\n assert(candidate(-78L) == tuple(1L, 1L));\n assert(candidate(3452L) == tuple(2L, 2L));\n assert(candidate(346211L) == tuple(3L, 3L));\n assert(candidate(-345821L) == tuple(3L, 3L));\n assert(candidate(-2L) == tuple(1L, 0L));\n assert(candidate(-45347L) == tuple(2L, 3L));\n assert(candidate(0L) == tuple(1L, 0L));\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nWrite a function that accepts a list of strings.\n The list contains different words. Return the word with maximum number\n of unique characters. If multiple strings have maximum number of unique\n characters, return the one which comes first in lexicographical order.\n\n >>> find_max([\"name\", \"of\", \"string\"])\n \"string\"\n >>> find_max([\"name\", \"enam\", \"game\"])\n \"enam\"\n >>> find_max([\"aaaaaaa\", \"bb\", \"cc\"])\n \"aaaaaaa\"\n \n*/\nstring find_max(string[] words) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = find_max;\n\n assert(candidate([\"name\", \"of\", \"string\"]) == \"string\");\n assert(candidate([\"name\", \"enam\", \"game\"]) == \"enam\");\n assert(candidate([\"aaaaaaa\", \"bb\", \"cc\"]) == \"aaaaaaa\");\n assert(candidate([\"abc\", \"cba\"]) == \"abc\");\n assert(candidate([\"play\", \"this\", \"game\", \"of\", \"footbott\"]) == \"footbott\");\n assert(candidate([\"we\", \"are\", \"gonna\", \"rock\"]) == \"gonna\");\n assert(candidate([\"we\", \"are\", \"a\", \"mad\", \"nation\"]) == \"nation\");\n assert(candidate([\"this\", \"is\", \"a\", \"prrk\"]) == \"this\");\n assert(candidate([\"b\"]) == \"b\");\n assert(candidate([\"play\", \"play\", \"play\"]) == \"play\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n Given a positive integer n, return the count of the numbers of n-digit\n positive integers that start or end with 1.\n \n*/\nlong starts_one_ends(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = starts_one_ends;\n\n assert(candidate(1L) == 1L);\n assert(candidate(2L) == 18L);\n assert(candidate(3L) == 180L);\n assert(candidate(4L) == 1800L);\n assert(candidate(5L) == 18000L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n Create a function that returns a tuple (a, b), where 'a' is\n the largest of negative integers, and 'b' is the smallest\n of positive integers in a list.\n If there is no negative or positive integers, return them as None.\n\n Examples:\n >>> largest_smallest_integers([2L, 4L, 1L, 3L, 5L, 7L])\n tuple(None, 1L)\n >>> largest_smallest_integers([])\n tuple(None, None)\n >>> largest_smallest_integers([0L])\n tuple(None, None)\n \n*/\nTuple!(Nullable!(long), Nullable!(long)) largest_smallest_integers(long[] lst) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = largest_smallest_integers;\n\n{\n auto result = candidate([2L, 4L, 1L, 3L, 5L, 7L]);\n assert(result[0].isNull);\n assert(!result[1].isNull && result[1].get == 1L);\n}\n\n{\n auto result = candidate([2L, 4L, 1L, 3L, 5L, 7L, 0L]);\n assert(result[0].isNull);\n assert(!result[1].isNull && result[1].get == 1L);\n}\n\n{\n auto result = candidate([1L, 3L, 2L, 4L, 5L, 6L, -2L]);\n assert(!result[0].isNull && result[0].get == -2L);\n assert(!result[1].isNull && result[1].get == 1L);\n}\n\n{\n auto result = candidate([4L, 5L, 3L, 6L, 2L, 7L, -7L]);\n assert(!result[0].isNull && result[0].get == -7L);\n assert(!result[1].isNull && result[1].get == 2L);\n}\n\n{\n auto result = candidate([7L, 3L, 8L, 4L, 9L, 2L, 5L, -9L]);\n assert(!result[0].isNull && result[0].get == -9L);\n assert(!result[1].isNull && result[1].get == 2L);\n}\n\n{\n auto result = candidate([]);\n assert(result[0].isNull);\n assert(result[1].isNull);\n}\n\n{\n auto result = candidate([0L]);\n assert(result[0].isNull);\n assert(result[1].isNull);\n}\n\n{\n auto result = candidate([-1L, -3L, -5L, -6L]);\n assert(!result[0].isNull && result[0].get == -1L);\n assert(result[1].isNull);\n}\n\n{\n auto result = candidate([-1L, -3L, -5L, -6L, 0L]);\n assert(!result[0].isNull && result[0].get == -1L);\n assert(result[1].isNull);\n}\n\n{\n auto result = candidate([-6L, -4L, -4L, -3L, 1L]);\n assert(!result[0].isNull && result[0].get == -3L);\n assert(!result[1].isNull && result[1].get == 1L);\n}\n\n{\n auto result = candidate([-6L, -4L, -4L, -3L, -100L, 1L]);\n assert(!result[0].isNull && result[0].get == -3L);\n assert(!result[1].isNull && result[1].get == 1L);\n}\n\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n \"Given an array representing a branch of a tree that has non-negative integer nodes\n your task is to pluck one of the nodes and return it.\n The plucked node should be the node with the smallest even value.\n If multiple nodes with the same smallest even value are found return the node that has smallest index.\n\n The plucked node should be returned in a list, [ smalest_value, its index ],\n If there are no even values or the given array is empty, return [].\n\n Example 1:\n >>> pluck([4L, 2L, 3L])\n [2L, 1L]\n Explanation: 2 has the smallest even value, and 2 has the smallest index.\n\n Example 2:\n >>> pluck([1L, 2L, 3L])\n [2L, 1L]\n Explanation: 2 has the smallest even value, and 2 has the smallest index.\n\n Example 3:\n >>> pluck([])\n []\n \n Example 4:\n >>> pluck([5L, 0L, 3L, 0L, 4L, 2L])\n [0L, 1L]\n Explanation: 0 is the smallest value, but there are two zeros,\n so we will choose the first zero, which has the smallest index.\n\n Constraints:\n * 1 <= nodes.length <= 10000\n * 0 <= node.value\n \n*/\nlong[] pluck(long[] arr) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = pluck;\n\n assert(candidate([4L, 2L, 3L]) == [2L, 1L]);\n assert(candidate([1L, 2L, 3L]) == [2L, 1L]);\n assert(candidate([]) == []);\n assert(candidate([5L, 0L, 3L, 0L, 4L, 2L]) == [0L, 1L]);\n assert(candidate([1L, 2L, 3L, 0L, 5L, 3L]) == [0L, 3L]);\n assert(candidate([5L, 4L, 8L, 4L, 8L]) == [4L, 1L]);\n assert(candidate([7L, 6L, 7L, 1L]) == [6L, 1L]);\n assert(candidate([7L, 9L, 7L, 1L]) == []);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n Write a function count_nums which takes an array of integers and returns\n the number of elements which has a sum of digits > 0.\n If a number is negative, then its first signed digit will be negative:\n e.g. -123 has signed digits -1, 2, and 3.\n >>> count_nums([])\n 0L\n >>> count_nums([-1L, 11L, -11L])\n 1L\n >>> count_nums([1L, 1L, 2L])\n 3L\n \n*/\nlong count_nums(long[] arr) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = count_nums;\n\n assert(candidate([]) == 0L);\n assert(candidate([-1L, -2L, 0L]) == 0L);\n assert(candidate([1L, 1L, 2L, -2L, 3L, 4L, 5L]) == 6L);\n assert(candidate([1L, 6L, 9L, -6L, 0L, 1L, 5L]) == 5L);\n assert(candidate([1L, 100L, 98L, -7L, 1L, -1L]) == 4L);\n assert(candidate([12L, 23L, 34L, -45L, -56L, 0L]) == 5L);\n assert(candidate([0L, 1L]) == 1L);\n assert(candidate([1L]) == 1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n each cell of the grid contains a value. Every integer in the range [1, N * N]\n inclusive appears exactly once on the cells of the grid.\n\n You have to find the minimum path of length k in the grid. You can start\n from any cell, and in each step you can move to any of the neighbor cells,\n in other words, you can go to cells which share an edge with you current\n cell.\n Please note that a path of length k means visiting exactly k cells (not\n necessarily distinct).\n You CANNOT go off the grid.\n A path A (of length k) is considered less than a path B (of length k) if\n after making the ordered lists of the values on the cells that A and B go\n through (let's call them lst_A and lst_B), lst_A is lexicographically less\n than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n lst_A[j] = lst_B[j].\n It is guaranteed that the answer is unique.\n Return an ordered list of the values on the cells that the minimum path go through.\n\n Examples: \n >>> minPath([[1L, 2L, 3L], [4L, 5L, 6L], [7L, 8L, 9L]], 3L)\n [1L, 2L, 1L]\n\n >>> minPath([[5L, 9L, 3L], [4L, 1L, 6L], [7L, 8L, 2L]], 1L)\n [1L]\n \n*/\nlong[] minPath(long[][] grid, long k) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = minPath;\n\n assert(candidate([[1L, 2L, 3L], [4L, 5L, 6L], [7L, 8L, 9L]], 3L) == [1L, 2L, 1L]);\n assert(candidate([[5L, 9L, 3L], [4L, 1L, 6L], [7L, 8L, 2L]], 1L) == [1L]);\n assert(candidate([[1L, 2L, 3L, 4L], [5L, 6L, 7L, 8L], [9L, 10L, 11L, 12L], [13L, 14L, 15L, 16L]], 4L) == [1L, 2L, 1L, 2L]);\n assert(candidate([[6L, 4L, 13L, 10L], [5L, 7L, 12L, 1L], [3L, 16L, 11L, 15L], [8L, 14L, 9L, 2L]], 7L) == [1L, 10L, 1L, 10L, 1L, 10L, 1L]);\n assert(candidate([[8L, 14L, 9L, 2L], [6L, 4L, 13L, 15L], [5L, 7L, 1L, 12L], [3L, 10L, 11L, 16L]], 5L) == [1L, 7L, 1L, 7L, 1L]);\n assert(candidate([[11L, 8L, 7L, 2L], [5L, 16L, 14L, 4L], [9L, 3L, 15L, 6L], [12L, 13L, 10L, 1L]], 9L) == [1L, 6L, 1L, 6L, 1L, 6L, 1L, 6L, 1L]);\n assert(candidate([[12L, 13L, 10L, 1L], [9L, 3L, 15L, 6L], [5L, 16L, 14L, 4L], [11L, 8L, 7L, 2L]], 12L) == [1L, 6L, 1L, 6L, 1L, 6L, 1L, 6L, 1L, 6L, 1L, 6L]);\n assert(candidate([[2L, 7L, 4L], [3L, 1L, 5L], [6L, 8L, 9L]], 8L) == [1L, 3L, 1L, 3L, 1L, 3L, 1L, 3L]);\n assert(candidate([[6L, 1L, 5L], [3L, 8L, 9L], [2L, 7L, 4L]], 8L) == [1L, 5L, 1L, 5L, 1L, 5L, 1L, 5L]);\n assert(candidate([[1L, 2L], [3L, 4L]], 10L) == [1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L]);\n assert(candidate([[1L, 3L], [3L, 2L]], 10L) == [1L, 3L, 1L, 3L, 1L, 3L, 1L, 3L, 1L, 3L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n Given list of integers, return list in strange order.\n Strange sorting, is when you start with the minimum value,\n then maximum of the remaining integers, then minimum and so on.\n\n Examples:\n >>> strange_sort_list([1L, 2L, 3L, 4L])\n [1L, 4L, 2L, 3L]\n >>> strange_sort_list([5L, 5L, 5L, 5L])\n [5L, 5L, 5L, 5L]\n >>> strange_sort_list([])\n []\n \n*/\nlong[] strange_sort_list(long[] lst) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = strange_sort_list;\n\n assert(candidate([1L, 2L, 3L, 4L]) == [1L, 4L, 2L, 3L]);\n assert(candidate([5L, 6L, 7L, 8L, 9L]) == [5L, 9L, 6L, 8L, 7L]);\n assert(candidate([1L, 2L, 3L, 4L, 5L]) == [1L, 5L, 2L, 4L, 3L]);\n assert(candidate([5L, 6L, 7L, 8L, 9L, 1L]) == [1L, 9L, 5L, 8L, 6L, 7L]);\n assert(candidate([5L, 5L, 5L, 5L]) == [5L, 5L, 5L, 5L]);\n assert(candidate([]) == []);\n assert(candidate([1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L]) == [1L, 8L, 2L, 7L, 3L, 6L, 4L, 5L]);\n assert(candidate([0L, 2L, 2L, 2L, 5L, 5L, -5L, -5L]) == [-5L, 5L, -5L, 5L, 0L, 2L, 2L, 2L]);\n assert(candidate([111111L]) == [111111L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n Given a string 'text', return its md5 hash equivalent string.\n If 'text' is an empty string, return None.\n\n >>> string_to_md5(\"Hello world\")\n \"3e25960a79dbc69b674cd4ec67a72c62\"\n \n*/\nNullable!(string) string_to_md5(string text) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = string_to_md5;\n\n{\n auto result = candidate(\"Hello world\");\n assert(!result.isNull && result.get == \"3e25960a79dbc69b674cd4ec67a72c62\");\n}\n\n{\n auto result = candidate(\"\");\n assert(result.isNull);\n}\n\n{\n auto result = candidate(\"A B C\");\n assert(!result.isNull && result.get == \"0ef78513b0cb8cef12743f5aeb35f888\");\n}\n\n{\n auto result = candidate(\"password\");\n assert(!result.isNull && result.get == \"5f4dcc3b5aa765d61d8327deb882cf99\");\n}\n\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nYou are given a word. Your task is to find the closest vowel that stands between \n two consonants from the right side of the word (case sensitive).\n \n Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n find any vowel met the above condition. \n\n You may assume that the given string contains English letter only.\n\n Example:\n >>> get_closest_vowel(\"yogurt\")\n \"u\"\n >>> get_closest_vowel(\"FULL\")\n \"U\"\n >>> get_closest_vowel(\"quick\")\n \"\"\n >>> get_closest_vowel(\"ab\")\n \"\"\n \n*/\nstring get_closest_vowel(string word) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = get_closest_vowel;\n\n assert(candidate(\"yogurt\") == \"u\");\n assert(candidate(\"full\") == \"u\");\n assert(candidate(\"easy\") == \"\");\n assert(candidate(\"eAsy\") == \"\");\n assert(candidate(\"ali\") == \"\");\n assert(candidate(\"bad\") == \"a\");\n assert(candidate(\"most\") == \"o\");\n assert(candidate(\"ab\") == \"\");\n assert(candidate(\"ba\") == \"\");\n assert(candidate(\"quick\") == \"\");\n assert(candidate(\"anime\") == \"i\");\n assert(candidate(\"Asia\") == \"\");\n assert(candidate(\"Above\") == \"o\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nChange numerical base of input number x to base.\n return string representation after the conversion.\n base numbers are less than 10.\n >>> change_base(8L, 3L)\n \"22\"\n >>> change_base(8L, 2L)\n \"1000\"\n >>> change_base(7L, 2L)\n \"111\"\n \n*/\nstring change_base(long x, long base) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = change_base;\n\n assert(candidate(8L, 3L) == \"22\");\n assert(candidate(9L, 3L) == \"100\");\n assert(candidate(234L, 2L) == \"11101010\");\n assert(candidate(16L, 2L) == \"10000\");\n assert(candidate(8L, 2L) == \"1000\");\n assert(candidate(7L, 2L) == \"111\");\n assert(candidate(2L, 3L) == \"2\");\n assert(candidate(3L, 4L) == \"3\");\n assert(candidate(4L, 5L) == \"4\");\n assert(candidate(5L, 6L) == \"5\");\n assert(candidate(6L, 7L) == \"6\");\n assert(candidate(7L, 8L) == \"7\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n Check if in given list of numbers, are any two numbers closer to each other than\n given threshold.\n >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n false\n >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n true\n \n*/\nbool has_close_elements(float[] numbers, float threshold) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = has_close_elements;\n\n assert(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3) == true);\n assert(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05) == false);\n assert(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.95) == true);\n assert(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.8) == false);\n assert(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1) == true);\n assert(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 1.0) == true);\n assert(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 0.5) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n Create a function that takes a string as input which contains only square brackets.\n The function should return True if and only if there is a valid subsequence of brackets \n where at least one bracket in the subsequence is nested.\n\n >>> is_nested(\"[[]]\")\n true\n >>> is_nested(\"[]]]]]]][[[[[]\")\n false\n >>> is_nested(\"[][]\")\n false\n >>> is_nested(\"[]\")\n false\n >>> is_nested(\"[[][]]\")\n true\n >>> is_nested(\"[[]][[\")\n true\n \n*/\nbool is_nested(string string) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = is_nested;\n\n assert(candidate(\"[[]]\") == true);\n assert(candidate(\"[]]]]]]][[[[[]\") == false);\n assert(candidate(\"[][]\") == false);\n assert(candidate(\"[]\") == false);\n assert(candidate(\"[[[[]]]]\") == true);\n assert(candidate(\"[]]]]]]]]]]\") == false);\n assert(candidate(\"[][][[]]\") == true);\n assert(candidate(\"[[]\") == false);\n assert(candidate(\"[]]\") == false);\n assert(candidate(\"[[]][[\") == true);\n assert(candidate(\"[[][]]\") == true);\n assert(candidate(\"\") == false);\n assert(candidate(\"[[[[[[[[\") == false);\n assert(candidate(\"]]]]]]]]\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n Concatenate list of strings into a single string\n >>> concatenate([])\n \"\"\n >>> concatenate([\"a\", \"b\", \"c\"])\n \"abc\"\n \n*/\nstring concatenate(string[] strings) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = concatenate;\n\n assert(candidate([]) == \"\");\n assert(candidate([\"x\", \"y\", \"z\"]) == \"xyz\");\n assert(candidate([\"x\", \"y\", \"z\", \"w\", \"k\"]) == \"xyzwk\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n >>> prime_fib(1L)\n 2L\n >>> prime_fib(2L)\n 3L\n >>> prime_fib(3L)\n 5L\n >>> prime_fib(4L)\n 13L\n >>> prime_fib(5L)\n 89L\n \n*/\nlong prime_fib(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = prime_fib;\n\n assert(candidate(1L) == 2L);\n assert(candidate(2L) == 3L);\n assert(candidate(3L) == 5L);\n assert(candidate(4L) == 13L);\n assert(candidate(5L) == 89L);\n assert(candidate(6L) == 233L);\n assert(candidate(7L) == 1597L);\n assert(candidate(8L) == 28657L);\n assert(candidate(9L) == 514229L);\n assert(candidate(10L) == 433494437L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n other and return them in order (smaller number, larger number).\n >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n tuple(2.0, 2.2)\n >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n tuple(2.0, 2.0)\n \n*/\nTuple!(float, float) find_closest_elements(float[] numbers) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = find_closest_elements;\n\n assert(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2]) == tuple(3.9, 4.0));\n assert(candidate([1.0, 2.0, 5.9, 4.0, 5.0]) == tuple(5.0, 5.9));\n assert(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]) == tuple(2.0, 2.2));\n assert(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]) == tuple(2.0, 2.0));\n assert(candidate([1.1, 2.2, 3.1, 4.1, 5.1]) == tuple(2.2, 3.1));\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nYou have been tasked to write a function that receives \n a hexadecimal number as a string and counts the number of hexadecimal \n digits that are primes (prime number, or a prime, is a natural number \n greater than 1 that is not a product of two smaller natural numbers).\n Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n So you have to determine a number of the following digits: 2, 3, 5, 7, \n B (=decimal 11), D (=decimal 13).\n Note: you may assume the input is always correct or empty string, \n and symbols A,B,C,D,E,F are always uppercase.\n Examples:\n >>> hex_key(\"AB\")\n 1L\n >>> hex_key(\"1077E\")\n 2L\n >>> hex_key(\"ABED1A33\")\n 4L\n >>> hex_key(\"123456789ABCDEF0\")\n 6L\n >>> hex_key(\"2020\")\n 2L\n \n*/\nlong hex_key(string num) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = hex_key;\n\n assert(candidate(\"AB\") == 1L);\n assert(candidate(\"1077E\") == 2L);\n assert(candidate(\"ABED1A33\") == 4L);\n assert(candidate(\"2020\") == 2L);\n assert(candidate(\"123456789ABCDEF0\") == 6L);\n assert(candidate(\"112233445566778899AABBCCDDEEFF00\") == 12L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nComplete the function that takes two integers and returns \n the product of their unit digits.\n Assume the input is always valid.\n Examples:\n >>> multiply(148L, 412L)\n 16L\n >>> multiply(19L, 28L)\n 72L\n >>> multiply(2020L, 1851L)\n 0L\n >>> multiply(14L, -15L)\n 20L\n \n*/\nlong multiply(long a, long b) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = multiply;\n\n assert(candidate(148L, 412L) == 16L);\n assert(candidate(19L, 28L) == 72L);\n assert(candidate(2020L, 1851L) == 0L);\n assert(candidate(14L, -15L) == 20L);\n assert(candidate(76L, 67L) == 42L);\n assert(candidate(17L, 27L) == 49L);\n assert(candidate(0L, 1L) == 0L);\n assert(candidate(0L, 0L) == 0L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n Given list of numbers (of at least two elements), apply a linear transform to that list,\n such that the smallest number will become 0 and the largest will become 1\n >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n [0.0, 0.25, 0.5, 0.75, 1.0]\n \n*/\nfloat[] rescale_to_unit(float[] numbers) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = rescale_to_unit;\n\n assert(candidate([2.0, 49.9]) == [0.0, 1.0]);\n assert(candidate([100.0, 49.9]) == [1.0, 0.0]);\n assert(candidate([1.0, 2.0, 3.0, 4.0, 5.0]) == [0.0, 0.25, 0.5, 0.75, 1.0]);\n assert(candidate([2.0, 1.0, 5.0, 3.0, 4.0]) == [0.25, 0.0, 1.0, 0.5, 0.75]);\n assert(candidate([12.0, 11.0, 15.0, 13.0, 14.0]) == [0.25, 0.0, 1.0, 0.5, 0.75]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nGiven a positive integer n, return the product of the odd digits.\n Return 0 if all digits are even.\n For example:\n >>> digits(1L)\n 1L\n >>> digits(4L)\n 0L\n >>> digits(235L)\n 15L\n \n*/\nlong digits(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = digits;\n\n assert(candidate(5L) == 5L);\n assert(candidate(54L) == 5L);\n assert(candidate(120L) == 1L);\n assert(candidate(5014L) == 5L);\n assert(candidate(98765L) == 315L);\n assert(candidate(5576543L) == 2625L);\n assert(candidate(2468L) == 0L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nYou will be given the name of a class (a string) and a list of extensions.\n The extensions are to be used to load additional classes to the class. The\n strength of the extension is as follows: Let CAP be the number of the uppercase\n letters in the extension's name, and let SM be the number of lowercase letters \n in the extension's name, the strength is given by the fraction CAP - SM. \n You should find the strongest extension and return a string in this \n format: ClassName.StrongestExtensionName.\n If there are two or more extensions with the same strength, you should\n choose the one that comes first in the list.\n For example, if you are given \"Slices\" as the class and a list of the\n extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n (its strength is -1).\n Example:\n >>> Strongest_Extension(\"my_class\", [\"AA\", \"Be\", \"CC\"])\n \"my_class.AA\"\n \n*/\nstring Strongest_Extension(string class_name, string[] extensions) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = Strongest_Extension;\n\n assert(candidate(\"Watashi\", [\"tEN\", \"niNE\", \"eIGHt8OKe\"]) == \"Watashi.eIGHt8OKe\");\n assert(candidate(\"Boku123\", [\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"]) == \"Boku123.YEs.WeCaNe\");\n assert(candidate(\"__YESIMHERE\", [\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"]) == \"__YESIMHERE.NuLl__\");\n assert(candidate(\"K\", [\"Ta\", \"TAR\", \"t234An\", \"cosSo\"]) == \"K.TAR\");\n assert(candidate(\"__HAHA\", [\"Tab\", \"123\", \"781345\", \"-_-\"]) == \"__HAHA.123\");\n assert(candidate(\"YameRore\", [\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"]) == \"YameRore.okIWILL123\");\n assert(candidate(\"finNNalLLly\", [\"Die\", \"NowW\", \"Wow\", \"WoW\"]) == \"finNNalLLly.WoW\");\n assert(candidate(\"_\", [\"Bb\", \"91245\"]) == \"_.Bb\");\n assert(candidate(\"Sp\", [\"671235\", \"Bb\"]) == \"Sp.671235\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nGiven a string representing a space separated lowercase letters, return a dictionary\n of the letter with the most repetition and containing the corresponding count.\n If several letters have the same occurrence, return all of them.\n \n Example:\n >>> histogram(\"a b c\")\n [\"a\": 1L, \"b\": 1L, \"c\": 1L].nullable\n >>> histogram(\"a b b a\")\n [\"a\": 2L, \"b\": 2L].nullable\n >>> histogram(\"a b c a b\")\n [\"a\": 2L, \"b\": 2L].nullable\n >>> histogram(\"b b b b a\")\n [\"b\": 4L].nullable\n >>> histogram(\"\")\n ___null_dict___\n\n \n*/\nNullable!(long[string]) histogram(string test) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = histogram;\n\n{\n auto result = candidate(\"a b b a\");\n assert(!result.isNull && result.get == [\"a\": 2L, \"b\": 2L]);\n}\n\n{\n auto result = candidate(\"a b c a b\");\n assert(!result.isNull && result.get == [\"a\": 2L, \"b\": 2L]);\n}\n\n{\n auto result = candidate(\"a b c d g\");\n assert(!result.isNull && result.get == [\"a\": 1L, \"b\": 1L, \"c\": 1L, \"d\": 1L, \"g\": 1L]);\n}\n\n{\n auto result = candidate(\"r t g\");\n assert(!result.isNull && result.get == [\"r\": 1L, \"t\": 1L, \"g\": 1L]);\n}\n\n{\n auto result = candidate(\"b b b b a\");\n assert(!result.isNull && result.get == [\"b\": 4L]);\n}\n\n{\n auto result = candidate(\"r t g\");\n assert(!result.isNull && result.get == [\"r\": 1L, \"t\": 1L, \"g\": 1L]);\n}\n\n{\n auto result = candidate(\"\");\n assert(result.isNull);\n}\n\n{\n auto result = candidate(\"a\");\n assert(!result.isNull && result.get == [\"a\": 1L]);\n}\n\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n pairs_sum_to_zero takes a list of integers as an input.\n it returns True if there are two distinct elements in the list that\n sum to zero, and False otherwise.\n >>> pairs_sum_to_zero([1L, 3L, 5L, 0L])\n false\n >>> pairs_sum_to_zero([1L, 3L, -2L, 1L])\n false\n >>> pairs_sum_to_zero([1L, 2L, 3L, 7L])\n false\n >>> pairs_sum_to_zero([2L, 4L, -5L, 3L, 5L, 7L])\n true\n >>> pairs_sum_to_zero([1L])\n false\n \n*/\nbool pairs_sum_to_zero(long[] l) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = pairs_sum_to_zero;\n\n assert(candidate([1L, 3L, 5L, 0L]) == false);\n assert(candidate([1L, 3L, -2L, 1L]) == false);\n assert(candidate([1L, 2L, 3L, 7L]) == false);\n assert(candidate([2L, 4L, -5L, 3L, 5L, 7L]) == true);\n assert(candidate([1L]) == false);\n assert(candidate([-3L, 9L, -1L, 3L, 2L, 30L]) == true);\n assert(candidate([-3L, 9L, -1L, 3L, 2L, 31L]) == true);\n assert(candidate([-3L, 9L, -1L, 4L, 2L, 30L]) == false);\n assert(candidate([-3L, 9L, -1L, 4L, 2L, 31L]) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n Write a function that accepts two lists of strings and returns the list that has \n total number of chars in the all strings of the list less than the other list.\n\n if the two lists have the same number of chars, return the first list.\n\n Examples\n >>> total_match([], [])\n []\n >>> total_match([\"hi\", \"admin\"], [\"hI\", \"Hi\"])\n [\"hI\", \"Hi\"]\n >>> total_match([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"])\n [\"hi\", \"admin\"]\n >>> total_match([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"])\n [\"hI\", \"hi\", \"hi\"]\n >>> total_match([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"])\n [\"4\"]\n \n*/\nstring[] total_match(string[] lst1, string[] lst2) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = total_match;\n\n assert(candidate([], []) == []);\n assert(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\"]) == [\"hi\", \"hi\"]);\n assert(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"]) == [\"hi\", \"admin\"]);\n assert(candidate([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"]) == [\"4\"]);\n assert(candidate([\"hi\", \"admin\"], [\"hI\", \"Hi\"]) == [\"hI\", \"Hi\"]);\n assert(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"]) == [\"hI\", \"hi\", \"hi\"]);\n assert(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hii\"]) == [\"hi\", \"admin\"]);\n assert(candidate([], [\"this\"]) == []);\n assert(candidate([\"this\"], []) == []);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nCircular shift the digits of the integer x, shift the digits right by shift\n and return the result as a string.\n If shift > number of digits, return digits reversed.\n >>> circular_shift(12L, 1L)\n \"21\"\n >>> circular_shift(12L, 2L)\n \"12\"\n \n*/\nstring circular_shift(long x, long shift) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = circular_shift;\n\n assert(candidate(100L, 2L) == \"001\");\n assert(candidate(12L, 2L) == \"12\");\n assert(candidate(97L, 8L) == \"79\");\n assert(candidate(12L, 1L) == \"21\");\n assert(candidate(11L, 101L) == \"11\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nReturn True is list elements are monotonically increasing or decreasing.\n >>> monotonic([1L, 2L, 4L, 20L])\n true\n >>> monotonic([1L, 20L, 4L, 10L])\n false\n >>> monotonic([4L, 1L, 0L, -10L])\n true\n \n*/\nbool monotonic(long[] l) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = monotonic;\n\n assert(candidate([1L, 2L, 4L, 10L]) == true);\n assert(candidate([1L, 2L, 4L, 20L]) == true);\n assert(candidate([1L, 20L, 4L, 10L]) == false);\n assert(candidate([4L, 1L, 0L, -10L]) == true);\n assert(candidate([4L, 1L, 1L, 0L]) == true);\n assert(candidate([1L, 2L, 3L, 2L, 5L, 60L]) == false);\n assert(candidate([1L, 2L, 3L, 4L, 5L, 60L]) == true);\n assert(candidate([9L, 9L, 9L, 9L]) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nEvaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n Example\n >>> is_equal_to_sum_even(4L)\n false\n >>> is_equal_to_sum_even(6L)\n false\n >>> is_equal_to_sum_even(8L)\n true\n \n*/\nbool is_equal_to_sum_even(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = is_equal_to_sum_even;\n\n assert(candidate(4L) == false);\n assert(candidate(6L) == false);\n assert(candidate(8L) == true);\n assert(candidate(10L) == true);\n assert(candidate(11L) == false);\n assert(candidate(12L) == true);\n assert(candidate(13L) == false);\n assert(candidate(16L) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n Input to this function is a string representing musical notes in a special ASCII format.\n Your task is to parse this string and return list of integers corresponding to how many beats does each\n not last.\n\n Here is a legend:\n 'o' - whole note, lasts four beats\n 'o|' - half note, lasts two beats\n '.|' - quater note, lasts one beat\n\n >>> parse_music(\"o o| .| o| o| .| .| .| .| o o\")\n [4L, 2L, 1L, 2L, 2L, 1L, 1L, 1L, 1L, 4L, 4L]\n \n*/\nlong[] parse_music(string music_string) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = parse_music;\n\n assert(candidate(\"\") == []);\n assert(candidate(\"o o o o\") == [4L, 4L, 4L, 4L]);\n assert(candidate(\".| .| .| .|\") == [1L, 1L, 1L, 1L]);\n assert(candidate(\"o| o| .| .| o o o o\") == [2L, 2L, 1L, 1L, 4L, 4L, 4L, 4L]);\n assert(candidate(\"o| .| o| .| o o| o o|\") == [2L, 1L, 2L, 1L, 4L, 2L, 4L, 2L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\"\n This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n \n Examples:\n >>> lst\n [1L, 2L, 3L]\n >>> lst\n []\n >>> lst\n [-1L, -5L, 2L, -1L, -5L]\n \n*/\nlong sum_squares(long[] lst) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = sum_squares;\n\n assert(candidate([1L, 2L, 3L]) == 6L);\n assert(candidate([1L, 4L, 9L]) == 14L);\n assert(candidate([]) == 0L);\n assert(candidate([1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L]) == 9L);\n assert(candidate([-1L, -1L, -1L, -1L, -1L, -1L, -1L, -1L, -1L]) == -3L);\n assert(candidate([0L]) == 0L);\n assert(candidate([-1L, -5L, 2L, -1L, -5L]) == -126L);\n assert(candidate([-56L, -99L, 1L, 0L, -2L]) == 3030L);\n assert(candidate([-1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, -1L]) == 0L);\n assert(candidate([-16L, -9L, -2L, 36L, 36L, 26L, -20L, 25L, -40L, 20L, -4L, 12L, -26L, 35L, 37L]) == -14196L);\n assert(candidate([-1L, -3L, 17L, -1L, -15L, 13L, -1L, 14L, -14L, -12L, -5L, 14L, -14L, 6L, 13L, 11L, 16L, 16L, 4L, 10L]) == -1448L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n triples_sum_to_zero takes a list of integers as an input.\n it returns True if there are three distinct elements in the list that\n sum to zero, and False otherwise.\n\n >>> triples_sum_to_zero([1L, 3L, 5L, 0L])\n false\n >>> triples_sum_to_zero([1L, 3L, -2L, 1L])\n true\n >>> triples_sum_to_zero([1L, 2L, 3L, 7L])\n false\n >>> triples_sum_to_zero([2L, 4L, -5L, 3L, 9L, 7L])\n true\n >>> triples_sum_to_zero([1L])\n false\n \n*/\nbool triples_sum_to_zero(long[] l) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = triples_sum_to_zero;\n\n assert(candidate([1L, 3L, 5L, 0L]) == false);\n assert(candidate([1L, 3L, 5L, -1L]) == false);\n assert(candidate([1L, 3L, -2L, 1L]) == true);\n assert(candidate([1L, 2L, 3L, 7L]) == false);\n assert(candidate([1L, 2L, 5L, 7L]) == false);\n assert(candidate([2L, 4L, -5L, 3L, 9L, 7L]) == true);\n assert(candidate([1L]) == false);\n assert(candidate([1L, 3L, 5L, -100L]) == false);\n assert(candidate([100L, 3L, 5L, -100L]) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n brackets is a string of \"<\" and \">\".\n return True if every opening bracket has a corresponding closing bracket.\n\n >>> correct_bracketing(\"<\")\n false\n >>> correct_bracketing(\"<>\")\n true\n >>> correct_bracketing(\"<<><>>\")\n true\n >>> correct_bracketing(\"><<>\")\n false\n \n*/\nbool correct_bracketing(string brackets) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = correct_bracketing;\n\n assert(candidate(\"<>\") == true);\n assert(candidate(\"<<><>>\") == true);\n assert(candidate(\"<><><<><>><>\") == true);\n assert(candidate(\"<><><<<><><>><>><<><><<>>>\") == true);\n assert(candidate(\"<<<><>>>>\") == false);\n assert(candidate(\"><<>\") == false);\n assert(candidate(\"<\") == false);\n assert(candidate(\"<<<<\") == false);\n assert(candidate(\">\") == false);\n assert(candidate(\"<<>\") == false);\n assert(candidate(\"<><><<><>><>><<>\") == false);\n assert(candidate(\"<><><<><>><>>><>\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nWrite a function that takes an array of numbers as input and returns \n the number of elements in the array that are greater than 10 and both \n first and last digits of a number are odd (1, 3, 5, 7, 9).\n For example:\n >>> specialFilter([15L, -73L, 14L, -15L])\n 1L\n >>> specialFilter([33L, -2L, -3L, 45L, 21L, 109L])\n 2L\n \n*/\nlong specialFilter(long[] nums) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = specialFilter;\n\n assert(candidate([5L, -2L, 1L, -5L]) == 0L);\n assert(candidate([15L, -73L, 14L, -15L]) == 1L);\n assert(candidate([33L, -2L, -3L, 45L, 21L, 109L]) == 2L);\n assert(candidate([43L, -12L, 93L, 125L, 121L, 109L]) == 4L);\n assert(candidate([71L, -2L, -33L, 75L, 21L, 19L]) == 3L);\n assert(candidate([1L]) == 0L);\n assert(candidate([]) == 0L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n Given a dictionary, return True if all keys are strings in lower \n case or all keys are strings in upper case, else return False.\n The function should return False is the given dictionary is empty.\n Examples:\n >>> check_dict_case([\"a\": \"apple\", \"b\": \"banana\"].nullable)\n true\n >>> check_dict_case([\"a\": \"apple\", \"A\": \"banana\", \"B\": \"banana\"].nullable)\n false\n >>> check_dict_case([\"a\": \"apple\", 8L: \"banana\", \"a\": \"apple\"].nullable)\n false\n >>> check_dict_case([\"Name\": \"John\", \"Age\": \"36\", \"City\": \"Houston\"].nullable)\n false\n >>> check_dict_case([\"STATE\": \"NC\", \"ZIP\": \"12345\"].nullable)\n true\n \n*/\nbool check_dict_case(Nullable!(string[string]) dict) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = check_dict_case;\n\n assert(candidate([\"p\": \"pineapple\", \"b\": \"banana\"].nullable) == true);\n assert(candidate([\"p\": \"pineapple\", \"A\": \"banana\", \"B\": \"banana\"].nullable) == false);\n assert(candidate([\"p\": \"pineapple\", \"5\": \"banana\", \"a\": \"apple\"].nullable) == false);\n assert(candidate([\"Name\": \"John\", \"Age\": \"36\", \"City\": \"Houston\"].nullable) == false);\n assert(candidate([\"STATE\": \"NC\", \"ZIP\": \"12345\"].nullable) == true);\n assert(candidate([\"fruit\": \"Orange\", \"taste\": \"Sweet\"].nullable) == true);\n assert(candidate(Nullable!(string[string]).init) == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nThe FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fibfib(0) == 0\n fibfib(1) == 0\n fibfib(2) == 1\n fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n >>> fibfib(1L)\n 0L\n >>> fibfib(5L)\n 4L\n >>> fibfib(8L)\n 24L\n \n*/\nlong fibfib(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = fibfib;\n\n assert(candidate(2L) == 1L);\n assert(candidate(1L) == 0L);\n assert(candidate(5L) == 4L);\n assert(candidate(8L) == 24L);\n assert(candidate(10L) == 81L);\n assert(candidate(12L) == 274L);\n assert(candidate(14L) == 927L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nYou are given a list of numbers.\n You need to return the sum of squared numbers in the given list,\n round each element in the list to the upper int(Ceiling) first.\n Examples:\n >>> lst([1.0, 2.0, 3.0])\n 14L\n >>> lst([1.0, 4.0, 9.0])\n 98L\n >>> lst([1.0, 3.0, 5.0, 7.0])\n 84L\n >>> lst([1.4, 4.2, 0.0])\n 29L\n >>> lst([-2.4, 1.0, 1.0])\n 6L\n \n\n \n*/\nlong sum_squares(float[] lst) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = sum_squares;\n\n assert(candidate([1.0, 2.0, 3.0]) == 14L);\n assert(candidate([1.0, 2.0, 3.0]) == 14L);\n assert(candidate([1.0, 3.0, 5.0, 7.0]) == 84L);\n assert(candidate([1.4, 4.2, 0.0]) == 29L);\n assert(candidate([-2.4, 1.0, 1.0]) == 6L);\n assert(candidate([100.0, 1.0, 15.0, 2.0]) == 10230L);\n assert(candidate([10000.0, 10000.0]) == 200000000L);\n assert(candidate([-1.4, 4.6, 6.3]) == 75L);\n assert(candidate([-1.4, 17.9, 18.9, 19.9]) == 1086L);\n assert(candidate([0.0]) == 0L);\n assert(candidate([-1.0]) == 1L);\n assert(candidate([-1.0, 1.0, 0.0]) == 2L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_85_add", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nGiven a non-empty list of integers lst. add the even elements that are at odd indices..\n\n\n Examples:\n >>> add([4L, 2L, 6L, 7L])\n 2L\n \n*/\nlong add(long[] lst) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = add;\n\n assert(candidate([4L, 88L]) == 88L);\n assert(candidate([4L, 5L, 6L, 7L, 2L, 122L]) == 122L);\n assert(candidate([4L, 0L, 6L, 7L]) == 0L);\n assert(candidate([4L, 4L, 6L, 8L]) == 12L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nReturn sorted unique elements in a list\n >>> unique([5L, 3L, 5L, 2L, 3L, 3L, 9L, 0L, 123L])\n [0L, 2L, 3L, 5L, 9L, 123L]\n \n*/\nlong[] unique(long[] l) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = unique;\n\n assert(candidate([5L, 3L, 5L, 2L, 3L, 3L, 9L, 0L, 123L]) == [0L, 2L, 3L, 5L, 9L, 123L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n Given a string text, replace all spaces in it with underscores, \n and if a string has more than 2 consecutive spaces, \n then replace all consecutive spaces with - \n \n >>> fix_spaces(\" Example\")\n \"Example\"\n >>> fix_spaces(\" Example 1\")\n \"Example_1\"\n >>> fix_spaces(\" Example 2\")\n \"_Example_2\"\n >>> fix_spaces(\" Example 3\")\n \"_Example-3\"\n \n*/\nstring fix_spaces(string text) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = fix_spaces;\n\n assert(candidate(\"Example\") == \"Example\");\n assert(candidate(\"Mudasir Hanif \") == \"Mudasir_Hanif_\");\n assert(candidate(\"Yellow Yellow Dirty Fellow\") == \"Yellow_Yellow__Dirty__Fellow\");\n assert(candidate(\"Exa mple\") == \"Exa-mple\");\n assert(candidate(\" Exa 1 2 2 mple\") == \"-Exa_1_2_2_mple\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nReturn 2^n modulo p (be aware of numerics).\n >>> modp(3L, 5L)\n 3L\n >>> modp(1101L, 101L)\n 2L\n >>> modp(0L, 101L)\n 1L\n >>> modp(3L, 11L)\n 8L\n >>> modp(100L, 101L)\n 1L\n \n*/\nlong modp(long n, long p) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = modp;\n\n assert(candidate(3L, 5L) == 3L);\n assert(candidate(1101L, 101L) == 2L);\n assert(candidate(0L, 101L) == 1L);\n assert(candidate(3L, 11L) == 8L);\n assert(candidate(100L, 101L) == 1L);\n assert(candidate(30L, 5L) == 4L);\n assert(candidate(31L, 5L) == 3L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nYou have to write a function which validates a given date string and\n returns True if the date is valid otherwise False.\n The date is valid if all of the following rules are satisfied:\n 1. The date string is not empty.\n 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n 3. The months should not be less than 1 or higher than 12.\n 4. The date should be in the format: mm-dd-yyyy\n\n >>> valid_date(\"03-11-2000\")\n true\n\n >>> valid_date(\"15-01-2012\")\n false\n\n >>> valid_date(\"04-0-2040\")\n false\n\n >>> valid_date(\"06-04-2020\")\n true\n\n >>> valid_date(\"06/04/2020\")\n false\n \n*/\nbool valid_date(string date) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = valid_date;\n\n assert(candidate(\"03-11-2000\") == true);\n assert(candidate(\"15-01-2012\") == false);\n assert(candidate(\"04-0-2040\") == false);\n assert(candidate(\"06-04-2020\") == true);\n assert(candidate(\"01-01-2007\") == true);\n assert(candidate(\"03-32-2011\") == false);\n assert(candidate(\"\") == false);\n assert(candidate(\"04-31-3000\") == false);\n assert(candidate(\"06-06-2005\") == true);\n assert(candidate(\"21-31-2000\") == false);\n assert(candidate(\"04-12-2003\") == true);\n assert(candidate(\"04122003\") == false);\n assert(candidate(\"20030412\") == false);\n assert(candidate(\"2003-04\") == false);\n assert(candidate(\"2003-04-12\") == false);\n assert(candidate(\"04-2003\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n Write a function that takes a string and returns an ordered version of it.\n Ordered version of string, is a string where all words (separated by space)\n are replaced by a new word where all the characters arranged in\n ascending order based on ascii value.\n Note: You should keep the order of words and blank spaces in the sentence.\n\n For example:\n >>> anti_shuffle(\"Hi\")\n \"Hi\"\n >>> anti_shuffle(\"hello\")\n \"ehllo\"\n >>> anti_shuffle(\"Hello World!!!\")\n \"Hello !!!Wdlor\"\n \n*/\nstring anti_shuffle(string s) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = anti_shuffle;\n\n assert(candidate(\"Hi\") == \"Hi\");\n assert(candidate(\"hello\") == \"ehllo\");\n assert(candidate(\"number\") == \"bemnru\");\n assert(candidate(\"abcd\") == \"abcd\");\n assert(candidate(\"Hello World!!!\") == \"Hello !!!Wdlor\");\n assert(candidate(\"\") == \"\");\n assert(candidate(\"Hi. My name is Mister Robot. How are you?\") == \".Hi My aemn is Meirst .Rboot How aer ?ouy\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n Given a list of numbers, return whether or not they are sorted\n in ascending order. If list has more than 1 duplicate of the same\n number, return False. Assume no negative numbers and only integers.\n\n Examples\n >>> is_sorted([5L])\n true\n >>> is_sorted([1L, 2L, 3L, 4L, 5L])\n true\n >>> is_sorted([1L, 3L, 2L, 4L, 5L])\n false\n >>> is_sorted([1L, 2L, 3L, 4L, 5L, 6L])\n true\n >>> is_sorted([1L, 2L, 3L, 4L, 5L, 6L, 7L])\n true\n >>> is_sorted([1L, 3L, 2L, 4L, 5L, 6L, 7L])\n false\n >>> is_sorted([1L, 2L, 2L, 3L, 3L, 4L])\n true\n >>> is_sorted([1L, 2L, 2L, 2L, 3L, 4L])\n false\n \n*/\nbool is_sorted(long[] lst) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = is_sorted;\n\n assert(candidate([5L]) == true);\n assert(candidate([1L, 2L, 3L, 4L, 5L]) == true);\n assert(candidate([1L, 3L, 2L, 4L, 5L]) == false);\n assert(candidate([1L, 2L, 3L, 4L, 5L, 6L]) == true);\n assert(candidate([1L, 2L, 3L, 4L, 5L, 6L, 7L]) == true);\n assert(candidate([1L, 3L, 2L, 4L, 5L, 6L, 7L]) == false);\n assert(candidate([]) == true);\n assert(candidate([1L]) == true);\n assert(candidate([3L, 2L, 1L]) == false);\n assert(candidate([1L, 2L, 2L, 2L, 3L, 4L]) == false);\n assert(candidate([1L, 2L, 3L, 3L, 3L, 4L]) == false);\n assert(candidate([1L, 2L, 2L, 3L, 3L, 4L]) == true);\n assert(candidate([1L, 2L, 3L, 4L]) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nYou are given a string s.\n Your task is to check if the string is happy or not.\n A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n For example:\n >>> is_happy(\"a\")\n false\n >>> is_happy(\"aa\")\n false\n >>> is_happy(\"abcd\")\n true\n >>> is_happy(\"aabb\")\n false\n >>> is_happy(\"adb\")\n true\n >>> is_happy(\"xyy\")\n false\n \n*/\nbool is_happy(string s) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = is_happy;\n\n assert(candidate(\"a\") == false);\n assert(candidate(\"aa\") == false);\n assert(candidate(\"abcd\") == true);\n assert(candidate(\"aabb\") == false);\n assert(candidate(\"adb\") == true);\n assert(candidate(\"xyy\") == false);\n assert(candidate(\"iopaxpoi\") == true);\n assert(candidate(\"iopaxioi\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n Write a function that returns True if the object q will fly, and False otherwise.\n The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n\n Example:\n >>> will_it_fly([1L, 2L], 5L)\n false\n # 1+2 is less than the maximum possible weight, but it's unbalanced.\n\n >>> will_it_fly([3L, 2L, 3L], 1L)\n false\n # it's balanced, but 3+2+3 is more than the maximum possible weight.\n\n >>> will_it_fly([3L, 2L, 3L], 9L)\n true\n # 3+2+3 is less than the maximum possible weight, and it's balanced.\n\n >>> will_it_fly([3L], 5L)\n true\n # 3 is less than the maximum possible weight, and it's balanced.\n \n*/\nbool will_it_fly(long[] q, long w) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = will_it_fly;\n\n assert(candidate([3L, 2L, 3L], 9L) == true);\n assert(candidate([1L, 2L], 5L) == false);\n assert(candidate([3L], 5L) == true);\n assert(candidate([3L, 2L, 3L], 1L) == false);\n assert(candidate([1L, 2L, 3L], 6L) == false);\n assert(candidate([5L], 5L) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n Given an array of non-negative integers, return a copy of the given array after sorting,\n you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n or sort it in descending order if the sum( first index value, last index value) is even.\n\n Note:\n * don't change the given array.\n\n Examples:\n >>> sort_array([])\n []\n >>> sort_array([5L])\n [5L]\n >>> sort_array([2L, 4L, 3L, 0L, 1L, 5L])\n [0L, 1L, 2L, 3L, 4L, 5L]\n >>> sort_array([2L, 4L, 3L, 0L, 1L, 5L, 6L])\n [6L, 5L, 4L, 3L, 2L, 1L, 0L]\n \n*/\nlong[] sort_array(long[] array) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = sort_array;\n\n assert(candidate([]) == []);\n assert(candidate([5L]) == [5L]);\n assert(candidate([2L, 4L, 3L, 0L, 1L, 5L]) == [0L, 1L, 2L, 3L, 4L, 5L]);\n assert(candidate([2L, 4L, 3L, 0L, 1L, 5L, 6L]) == [6L, 5L, 4L, 3L, 2L, 1L, 0L]);\n assert(candidate([2L, 1L]) == [1L, 2L]);\n assert(candidate([15L, 42L, 87L, 32L, 11L, 0L]) == [0L, 11L, 15L, 32L, 42L, 87L]);\n assert(candidate([21L, 14L, 23L, 11L]) == [23L, 21L, 14L, 11L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nImplement a function that takes an non-negative integer and returns an array of the first n\n integers that are prime numbers and less than n.\n for example:\n >>> count_up_to(5L)\n [2L, 3L]\n >>> count_up_to(11L)\n [2L, 3L, 5L, 7L]\n >>> count_up_to(0L)\n []\n >>> count_up_to(20L)\n [2L, 3L, 5L, 7L, 11L, 13L, 17L, 19L]\n >>> count_up_to(1L)\n []\n >>> count_up_to(18L)\n [2L, 3L, 5L, 7L, 11L, 13L, 17L]\n \n*/\nlong[] count_up_to(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = count_up_to;\n\n assert(candidate(5L) == [2L, 3L]);\n assert(candidate(6L) == [2L, 3L, 5L]);\n assert(candidate(7L) == [2L, 3L, 5L]);\n assert(candidate(10L) == [2L, 3L, 5L, 7L]);\n assert(candidate(0L) == []);\n assert(candidate(22L) == [2L, 3L, 5L, 7L, 11L, 13L, 17L, 19L]);\n assert(candidate(1L) == []);\n assert(candidate(18L) == [2L, 3L, 5L, 7L, 11L, 13L, 17L]);\n assert(candidate(47L) == [2L, 3L, 5L, 7L, 11L, 13L, 17L, 19L, 23L, 29L, 31L, 37L, 41L, 43L]);\n assert(candidate(101L) == [2L, 3L, 5L, 7L, 11L, 13L, 17L, 19L, 23L, 29L, 31L, 37L, 41L, 43L, 47L, 53L, 59L, 61L, 67L, 71L, 73L, 79L, 83L, 89L, 97L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n Out of list of strings, return the longest one. Return the first one in case of multiple\n strings of the same length. Return None in case the input list is empty.\n >>> longest([])\n None\n >>> longest([\"a\", \"b\", \"c\"])\n \"a\"\n >>> longest([\"a\", \"bb\", \"ccc\"])\n \"ccc\"\n \n*/\nNullable!(string) longest(string[] strings) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = longest;\n\n{\n auto result = candidate([]);\n assert(result.isNull);\n}\n\n{\n auto result = candidate([\"x\", \"y\", \"z\"]);\n assert(!result.isNull && result.get == \"x\");\n}\n\n{\n auto result = candidate([\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"]);\n assert(!result.isNull && result.get == \"zzzz\");\n}\n\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n reverse the resulting array, and then replace each digit by its corresponding name from\n \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n\n For example:\n >>> by_length([2L, 1L, 1L, 4L, 5L, 8L, 2L, 3L])\n [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n \n If the array is empty, return an empty array:\n >>> by_length([])\n []\n \n If the array has any strange number ignore it:\n >>> by_length([1L, -1L, 55L])\n [\"One\"]\n \n*/\nstring[] by_length(long[] arr) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = by_length;\n\n assert(candidate([2L, 1L, 1L, 4L, 5L, 8L, 2L, 3L]) == [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]);\n assert(candidate([]) == []);\n assert(candidate([1L, -1L, 55L]) == [\"One\"]);\n assert(candidate([1L, -1L, 3L, 2L]) == [\"Three\", \"Two\", \"One\"]);\n assert(candidate([9L, 4L, 8L]) == [\"Nine\", \"Eight\", \"Four\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_106_f", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n Implement the function f that takes n as a parameter,\n 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\n or the sum of numbers from 1 to i otherwise.\n i starts from 1.\n the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n Example:\n >>> f(5L)\n [1L, 2L, 6L, 24L, 15L]\n \n*/\nlong[] f(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = f;\n\n assert(candidate(5L) == [1L, 2L, 6L, 24L, 15L]);\n assert(candidate(7L) == [1L, 2L, 6L, 24L, 15L, 720L, 28L]);\n assert(candidate(1L) == [1L]);\n assert(candidate(3L) == [1L, 2L, 6L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nReturn the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n >>> fizz_buzz(50L)\n 0L\n >>> fizz_buzz(78L)\n 2L\n >>> fizz_buzz(79L)\n 3L\n \n*/\nlong fizz_buzz(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = fizz_buzz;\n\n assert(candidate(50L) == 0L);\n assert(candidate(78L) == 2L);\n assert(candidate(79L) == 3L);\n assert(candidate(100L) == 3L);\n assert(candidate(200L) == 6L);\n assert(candidate(4000L) == 192L);\n assert(candidate(10000L) == 639L);\n assert(candidate(100000L) == 8026L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n Given a positive floating point number, it can be decomposed into\n and integer part (largest integer smaller than given number) and decimals\n (leftover part always smaller than 1).\n\n Return the decimal part of the number.\n >>> truncate_number(3.5)\n 0.5\n \n*/\nfloat truncate_number(float number) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = truncate_number;\n\n assert(candidate(3.5) == 0.5);\n assert(candidate(1.25) == 0.25);\n assert(candidate(123.0) == 0.0);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n Empty sum should be equal to 0 and empty product should be equal to 1.\n >>> sum_product([])\n tuple(0L, 1L)\n >>> sum_product([1L, 2L, 3L, 4L])\n tuple(10L, 24L)\n \n*/\nTuple!(long, long) sum_product(long[] numbers) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = sum_product;\n\n assert(candidate([]) == tuple(0L, 1L));\n assert(candidate([1L, 1L, 1L]) == tuple(3L, 1L));\n assert(candidate([100L, 0L]) == tuple(100L, 0L));\n assert(candidate([3L, 5L, 7L]) == tuple(15L, 105L));\n assert(candidate([10L]) == tuple(10L, 10L));\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n You are given a 2 dimensional data, as a nested lists,\n which is similar to matrix, however, unlike matrices,\n each row may contain a different number of columns.\n Given lst, and integer x, find integers x in the list,\n and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n each tuple is a coordinate - (row, columns), starting with 0.\n Sort coordinates initially by rows in ascending order.\n Also, sort coordinates of the row by columns in descending order.\n \n Examples:\n >>> get_row([[1L, 2L, 3L, 4L, 5L, 6L], [1L, 2L, 3L, 4L, 1L, 6L], [1L, 2L, 3L, 4L, 5L, 1L]], 1L)\n [tuple(0L, 0L), tuple(1L, 4L), tuple(1L, 0L), tuple(2L, 5L), tuple(2L, 0L)]\n >>> get_row([], 1L)\n []\n >>> get_row([[], [1L], [1L, 2L, 3L]], 3L)\n [tuple(2L, 2L)]\n \n*/\nTuple!(long, long)[] get_row(long[][] lst, long x) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = get_row;\n\n assert(candidate([[1L, 2L, 3L, 4L, 5L, 6L], [1L, 2L, 3L, 4L, 1L, 6L], [1L, 2L, 3L, 4L, 5L, 1L]], 1L) == [tuple(0L, 0L), tuple(1L, 4L), tuple(1L, 0L), tuple(2L, 5L), tuple(2L, 0L)]);\n assert(candidate([[1L, 2L, 3L, 4L, 5L, 6L], [1L, 2L, 3L, 4L, 5L, 6L], [1L, 2L, 3L, 4L, 5L, 6L], [1L, 2L, 3L, 4L, 5L, 6L], [1L, 2L, 3L, 4L, 5L, 6L], [1L, 2L, 3L, 4L, 5L, 6L]], 2L) == [tuple(0L, 1L), tuple(1L, 1L), tuple(2L, 1L), tuple(3L, 1L), tuple(4L, 1L), tuple(5L, 1L)]);\n assert(candidate([[1L, 2L, 3L, 4L, 5L, 6L], [1L, 2L, 3L, 4L, 5L, 6L], [1L, 1L, 3L, 4L, 5L, 6L], [1L, 2L, 1L, 4L, 5L, 6L], [1L, 2L, 3L, 1L, 5L, 6L], [1L, 2L, 3L, 4L, 1L, 6L], [1L, 2L, 3L, 4L, 5L, 1L]], 1L) == [tuple(0L, 0L), tuple(1L, 0L), tuple(2L, 1L), tuple(2L, 0L), tuple(3L, 2L), tuple(3L, 0L), tuple(4L, 3L), tuple(4L, 0L), tuple(5L, 4L), tuple(5L, 0L), tuple(6L, 5L), tuple(6L, 0L)]);\n assert(candidate([], 1L) == []);\n assert(candidate([[1L]], 2L) == []);\n assert(candidate([[], [1L], [1L, 2L, 3L]], 3L) == [tuple(2L, 2L)]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n You're a hungry rabbit, and you already have eaten a certain number of carrots,\n but now you need to eat more carrots to complete the day's meals.\n you should return an array of [ total number of eaten carrots after your meals,\n the number of carrots left after your meals ]\n if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n \n Example:\n >>> eat(5L, 6L, 10L)\n [11L, 4L]\n >>> eat(4L, 8L, 9L)\n [12L, 1L]\n >>> eat(1L, 10L, 10L)\n [11L, 0L]\n >>> eat(2L, 11L, 5L)\n [7L, 0L]\n \n Variables:\n @number : integer\n the number of carrots that you have eaten.\n @need : integer\n the number of carrots that you need to eat.\n @remaining : integer\n the number of remaining carrots thet exist in stock\n \n Constrain:\n * 0 <= number <= 1000\n * 0 <= need <= 1000\n * 0 <= remaining <= 1000\n\n Have fun :)\n \n*/\nlong[] eat(long number, long need, long remaining) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = eat;\n\n assert(candidate(5L, 6L, 10L) == [11L, 4L]);\n assert(candidate(4L, 8L, 9L) == [12L, 1L]);\n assert(candidate(1L, 10L, 10L) == [11L, 0L]);\n assert(candidate(2L, 11L, 5L) == [7L, 0L]);\n assert(candidate(4L, 5L, 7L) == [9L, 2L]);\n assert(candidate(4L, 5L, 1L) == [5L, 0L]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nGiven a positive integer N, return the total sum of its digits in binary.\n \n Example\n >>> solve(1000L)\n \"1\"\n >>> solve(150L)\n \"110\"\n >>> solve(147L)\n \"1100\"\n \n Variables:\n @N integer\n Constraints: 0 \u2264 N \u2264 10000.\n Output:\n a string of binary number\n \n*/\nstring solve(long N) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = solve;\n\n assert(candidate(1000L) == \"1\");\n assert(candidate(150L) == \"110\");\n assert(candidate(147L) == \"1100\");\n assert(candidate(333L) == \"1001\");\n assert(candidate(963L) == \"10010\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nYou are given a list of integers.\n You need to find the largest prime value and return the sum of its digits.\n\n Examples:\n >>> skjkasdkd([0L, 3L, 2L, 1L, 3L, 5L, 7L, 4L, 5L, 5L, 5L, 2L, 181L, 32L, 4L, 32L, 3L, 2L, 32L, 324L, 4L, 3L])\n 10L\n >>> skjkasdkd([1L, 0L, 1L, 8L, 2L, 4597L, 2L, 1L, 3L, 40L, 1L, 2L, 1L, 2L, 4L, 2L, 5L, 1L])\n 25L\n >>> skjkasdkd([1L, 3L, 1L, 32L, 5107L, 34L, 83278L, 109L, 163L, 23L, 2323L, 32L, 30L, 1L, 9L, 3L])\n 13L\n >>> skjkasdkd([0L, 724L, 32L, 71L, 99L, 32L, 6L, 0L, 5L, 91L, 83L, 0L, 5L, 6L])\n 11L\n >>> skjkasdkd([0L, 81L, 12L, 3L, 1L, 21L])\n 3L\n >>> skjkasdkd([0L, 8L, 1L, 2L, 1L, 7L])\n 7L\n \n*/\nlong skjkasdkd(long[] lst) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = skjkasdkd;\n\n assert(candidate([0L, 3L, 2L, 1L, 3L, 5L, 7L, 4L, 5L, 5L, 5L, 2L, 181L, 32L, 4L, 32L, 3L, 2L, 32L, 324L, 4L, 3L]) == 10L);\n assert(candidate([1L, 0L, 1L, 8L, 2L, 4597L, 2L, 1L, 3L, 40L, 1L, 2L, 1L, 2L, 4L, 2L, 5L, 1L]) == 25L);\n assert(candidate([1L, 3L, 1L, 32L, 5107L, 34L, 83278L, 109L, 163L, 23L, 2323L, 32L, 30L, 1L, 9L, 3L]) == 13L);\n assert(candidate([0L, 724L, 32L, 71L, 99L, 32L, 6L, 0L, 5L, 91L, 83L, 0L, 5L, 6L]) == 11L);\n assert(candidate([0L, 81L, 12L, 3L, 1L, 21L]) == 3L);\n assert(candidate([0L, 8L, 1L, 2L, 1L, 7L]) == 7L);\n assert(candidate([8191L]) == 19L);\n assert(candidate([8191L, 123456L, 127L, 7L]) == 19L);\n assert(candidate([127L, 97L, 8192L]) == 10L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n Given an array arr of integers, find the minimum number of elements that\n need to be changed to make the array palindromic. A palindromic array is an array that\n is read the same backwards and forwards. In one change, you can change one element to any other element.\n\n For example:\n >>> smallest_change([1L, 2L, 3L, 5L, 4L, 7L, 9L, 6L])\n 4L\n >>> smallest_change([1L, 2L, 3L, 4L, 3L, 2L, 2L])\n 1L\n >>> smallest_change([1L, 2L, 3L, 2L, 1L])\n 0L\n \n*/\nlong smallest_change(long[] arr) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = smallest_change;\n\n assert(candidate([1L, 2L, 3L, 5L, 4L, 7L, 9L, 6L]) == 4L);\n assert(candidate([1L, 2L, 3L, 4L, 3L, 2L, 2L]) == 1L);\n assert(candidate([1L, 4L, 2L]) == 1L);\n assert(candidate([1L, 4L, 4L, 2L]) == 1L);\n assert(candidate([1L, 2L, 3L, 2L, 1L]) == 0L);\n assert(candidate([3L, 1L, 1L, 3L]) == 0L);\n assert(candidate([1L]) == 0L);\n assert(candidate([0L, 1L]) == 1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nIt is the last week of the semester and the teacher has to give the grades\n to students. The teacher has been making her own algorithm for grading.\n The only problem is, she has lost the code she used for grading.\n She has given you a list of GPAs for some students and you have to write \n a function that can output a list of letter grades using the following table:\n GPA | Letter grade\n 4.0 A+\n > 3.7 A \n > 3.3 A- \n > 3.0 B+\n > 2.7 B \n > 2.3 B-\n > 2.0 C+\n > 1.7 C\n > 1.3 C-\n > 1.0 D+ \n > 0.7 D \n > 0.0 D-\n 0.0 E\n \n\n Example:\n >>> grade_equation([4.0, 3L, 1.7, 2L, 3.5])\n [\"A+\", \"B\", \"C-\", \"C\", \"A-\"]\n \n*/\nstring[] numerical_letter_grade(float[] grades) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = numerical_letter_grade;\n\n assert(candidate([4.0, 3L, 1.7, 2L, 3.5]) == [\"A+\", \"B\", \"C-\", \"C\", \"A-\"]);\n assert(candidate([1.2]) == [\"D+\"]);\n assert(candidate([0.5]) == [\"D-\"]);\n assert(candidate([0.0]) == [\"E\"]);\n assert(candidate([1.0, 0.3, 1.5, 2.8, 3.3]) == [\"D\", \"D-\", \"C-\", \"B\", \"B+\"]);\n assert(candidate([0.0, 0.7]) == [\"E\", \"D-\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n Given the lengths of the three sides of a triangle. Return the area of\n the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n Otherwise return -1\n Three sides make a valid triangle when the sum of any two sides is greater \n than the third side.\n Example:\n >>> triangle_area(3L, 4L, 5L)\n 6.0\n >>> triangle_area(1L, 2L, 10L)\n -1L\n \n*/\nfloat triangle_area(long a, long b, long c) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = triangle_area;\n\n assert(candidate(3L, 4L, 5L) == 6.0);\n assert(candidate(1L, 2L, 10L) == -1L);\n assert(candidate(4L, 8L, 5L) == 8.18);\n assert(candidate(2L, 2L, 2L) == 1.73);\n assert(candidate(1L, 2L, 3L) == -1L);\n assert(candidate(10L, 5L, 7L) == 16.25);\n assert(candidate(2L, 6L, 3L) == -1L);\n assert(candidate(1L, 1L, 1L) == 0.43);\n assert(candidate(2L, 2L, 10L) == -1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n Check if two words have the same characters.\n >>> same_chars(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\")\n true\n >>> same_chars(\"abcd\", \"dddddddabc\")\n true\n >>> same_chars(\"dddddddabc\", \"abcd\")\n true\n >>> same_chars(\"eabcd\", \"dddddddabc\")\n false\n >>> same_chars(\"abcd\", \"dddddddabce\")\n false\n >>> same_chars(\"eabcdzzzz\", \"dddzzzzzzzddddabc\")\n false\n \n*/\nbool same_chars(string s0, string s1) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = same_chars;\n\n assert(candidate(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\") == true);\n assert(candidate(\"abcd\", \"dddddddabc\") == true);\n assert(candidate(\"dddddddabc\", \"abcd\") == true);\n assert(candidate(\"eabcd\", \"dddddddabc\") == false);\n assert(candidate(\"abcd\", \"dddddddabcf\") == false);\n assert(candidate(\"eabcdzzzz\", \"dddzzzzzzzddddabc\") == false);\n assert(candidate(\"aabb\", \"aaccc\") == false);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n Given an array of integers nums, find the minimum sum of any non-empty sub-array\n of nums.\n Example\n >>> minSubArraySum([2L, 3L, 4L, 1L, 2L, 4L])\n 1L\n >>> minSubArraySum([-1L, -2L, -3L])\n -6L\n \n*/\nlong minSubArraySum(long[] nums) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = minSubArraySum;\n\n assert(candidate([2L, 3L, 4L, 1L, 2L, 4L]) == 1L);\n assert(candidate([-1L, -2L, -3L]) == -6L);\n assert(candidate([-1L, -2L, -3L, 2L, -10L]) == -14L);\n assert(candidate([-9999999999999999L]) == -9999999999999999L);\n assert(candidate([0L, 10L, 20L, 1000000L]) == 0L);\n assert(candidate([-1L, -2L, -3L, 10L, -5L]) == -6L);\n assert(candidate([100L, -1L, -2L, -3L, 10L, -5L]) == -6L);\n assert(candidate([10L, 11L, 13L, 8L, 3L, 4L]) == 3L);\n assert(candidate([100L, -33L, 32L, -1L, 0L, -2L]) == -33L);\n assert(candidate([-10L]) == -10L);\n assert(candidate([7L]) == 7L);\n assert(candidate([1L, -1L]) == -1L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nGiven a string s and a natural number n, you have been tasked to implement \n a function that returns a list of all words from string s that contain exactly \n n consonants, in order these words appear in the string s.\n If the string s is empty then the function should return an empty list.\n Note: you may assume the input string contains only letters and spaces.\n Examples:\n >>> select_words(\"Mary had a little lamb\", 4L)\n [\"little\"]\n >>> select_words(\"Mary had a little lamb\", 3L)\n [\"Mary\", \"lamb\"]\n >>> select_words(\"simple white space\", 2L)\n []\n >>> select_words(\"Hello world\", 4L)\n [\"world\"]\n >>> select_words(\"Uncle sam\", 3L)\n [\"Uncle\"]\n \n*/\nstring[] select_words(string s, long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = select_words;\n\n assert(candidate(\"Mary had a little lamb\", 4L) == [\"little\"]);\n assert(candidate(\"Mary had a little lamb\", 3L) == [\"Mary\", \"lamb\"]);\n assert(candidate(\"simple white space\", 2L) == []);\n assert(candidate(\"Hello world\", 4L) == [\"world\"]);\n assert(candidate(\"Uncle sam\", 3L) == [\"Uncle\"]);\n assert(candidate(\"\", 4L) == []);\n assert(candidate(\"a b c d e f\", 1L) == [\"b\", \"c\", \"d\", \"f\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n Return list of all prefixes from shortest to longest of the input string\n >>> all_prefixes(\"abc\")\n [\"a\", \"ab\", \"abc\"]\n \n*/\nstring[] all_prefixes(string string) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = all_prefixes;\n\n assert(candidate(\"\") == []);\n assert(candidate(\"asdfgh\") == [\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"]);\n assert(candidate(\"WWW\") == [\"W\", \"WW\", \"WWW\"]);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n Create a function that takes a value (string) representing a number\n and returns the closest integer to it. If the number is equidistant\n from two integers, round it away from zero.\n\n Examples\n >>> closest_integer(\"10\")\n 10L\n >>> closest_integer(\"15.3\")\n 15L\n\n Note:\n Rounding away from zero means that if the given number is equidistant\n from two integers, the one you should return is the one that is the\n farthest from zero. For example closest_integer(\"14.5\") should\n return 15 and closest_integer(\"-14.5\") should return -15.\n \n*/\nlong closest_integer(string value) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = closest_integer;\n\n assert(candidate(\"10\") == 10L);\n assert(candidate(\"14.5\") == 15L);\n assert(candidate(\"-15.5\") == -16L);\n assert(candidate(\"15.3\") == 15L);\n assert(candidate(\"0\") == 0L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nCreate a function which takes a string representing a file's name, and returns\n 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n A file's name is considered to be valid if and only if all the following conditions \n are met:\n - There should not be more than three digits ('0'-'9') in the file's name.\n - The file's name contains exactly one dot '.'\n - The substring before the dot should not be empty, and it starts with a letter from \n the latin alphapet ('a'-'z' and 'A'-'Z').\n - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n Examples:\n >>> file_name_check(\"example.txt\")\n \"Yes\"\n >>> file_name_check(\"1example.dll\")\n \"No\"\n \n*/\nstring file_name_check(string file_name) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = file_name_check;\n\n assert(candidate(\"example.txt\") == \"Yes\");\n assert(candidate(\"1example.dll\") == \"No\");\n assert(candidate(\"s1sdf3.asd\") == \"No\");\n assert(candidate(\"K.dll\") == \"Yes\");\n assert(candidate(\"MY16FILE3.exe\") == \"Yes\");\n assert(candidate(\"His12FILE94.exe\") == \"No\");\n assert(candidate(\"_Y.txt\") == \"No\");\n assert(candidate(\"?aREYA.exe\") == \"No\");\n assert(candidate(\"/this_is_valid.dll\") == \"No\");\n assert(candidate(\"this_is_valid.wow\") == \"No\");\n assert(candidate(\"this_is_valid.txt\") == \"Yes\");\n assert(candidate(\"this_is_valid.txtexe\") == \"No\");\n assert(candidate(\"#this2_i4s_5valid.ten\") == \"No\");\n assert(candidate(\"@this1_is6_valid.exe\") == \"No\");\n assert(candidate(\"this_is_12valid.6exe4.txt\") == \"No\");\n assert(candidate(\"all.exe.txt\") == \"No\");\n assert(candidate(\"I563_No.exe\") == \"Yes\");\n assert(candidate(\"Is3youfault.txt\") == \"Yes\");\n assert(candidate(\"no_one#knows.dll\") == \"Yes\");\n assert(candidate(\"1I563_Yes3.exe\") == \"No\");\n assert(candidate(\"I563_Yes3.txtt\") == \"No\");\n assert(candidate(\"final..txt\") == \"No\");\n assert(candidate(\"final132\") == \"No\");\n assert(candidate(\"_f4indsartal132.\") == \"No\");\n assert(candidate(\".txt\") == \"No\");\n assert(candidate(\"s.\") == \"No\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nYou are given two intervals,\n where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n The given intervals are closed which means that the interval (start, end)\n includes both start and end.\n For each given interval, it is assumed that its start is less or equal its end.\n Your task is to determine whether the length of intersection of these two \n intervals is a prime number.\n Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n which its length is 1, which not a prime number.\n If the length of the intersection is a prime number, return \"YES\",\n otherwise, return \"NO\".\n If the two intervals don't intersect, return \"NO\".\n\n\n [input/output] samples:\n >>> intersection(tuple(1L, 2L), tuple(2L, 3L))\n \"NO\"\n >>> intersection(tuple(-1L, 1L), tuple(0L, 4L))\n \"NO\"\n >>> intersection(tuple(-3L, -1L), tuple(-5L, 5L))\n \"YES\"\n \n*/\nstring intersection(Tuple!(long, long) interval1, Tuple!(long, long) interval2) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = intersection;\n\n assert(candidate(tuple(1L, 2L), tuple(2L, 3L)) == \"NO\");\n assert(candidate(tuple(-1L, 1L), tuple(0L, 4L)) == \"NO\");\n assert(candidate(tuple(-3L, -1L), tuple(-5L, 5L)) == \"YES\");\n assert(candidate(tuple(-2L, 2L), tuple(-4L, 0L)) == \"YES\");\n assert(candidate(tuple(-11L, 2L), tuple(-1L, -1L)) == \"NO\");\n assert(candidate(tuple(1L, 2L), tuple(3L, 5L)) == \"NO\");\n assert(candidate(tuple(1L, 2L), tuple(1L, 2L)) == \"NO\");\n assert(candidate(tuple(-2L, -2L), tuple(-3L, -2L)) == \"NO\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\nReturn the largest prime factor of n. Assume n > 1 and is not a prime.\n >>> largest_prime_factor(13195L)\n 29L\n >>> largest_prime_factor(2048L)\n 2L\n \n*/\nlong largest_prime_factor(long n) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = largest_prime_factor;\n\n assert(candidate(15L) == 5L);\n assert(candidate(27L) == 3L);\n assert(candidate(63L) == 7L);\n assert(candidate(330L) == 11L);\n assert(candidate(13195L) == 29L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n Given a string, find out how many distinct characters (regardless of case) does it consist of\n >>> count_distinct_characters(\"xyzXYZ\")\n 3L\n >>> count_distinct_characters(\"Jerry\")\n 4L\n \n*/\nlong count_distinct_characters(string string) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = count_distinct_characters;\n\n assert(candidate(\"\") == 0L);\n assert(candidate(\"abcde\") == 5L);\n assert(candidate(\"abcdecadeCADE\") == 5L);\n assert(candidate(\"aaaaAAAAaaaa\") == 1L);\n assert(candidate(\"Jerry jERRY JeRRRY\") == 5L);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n You're given a list of deposit and withdrawal operations on a bank account that starts with\n zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n at that point function should return True. Otherwise it should return False.\n >>> below_zero([1L, 2L, 3L])\n false\n >>> below_zero([1L, 2L, -4L, 5L])\n true\n \n*/\nbool below_zero(long[] operations) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = below_zero;\n\n assert(candidate([]) == false);\n assert(candidate([1L, 2L, -3L, 1L, 2L, -3L]) == false);\n assert(candidate([1L, 2L, -4L, 5L, 6L]) == true);\n assert(candidate([1L, -1L, 2L, -2L, 5L, -5L, 4L, -4L]) == false);\n assert(candidate([1L, -1L, 2L, -2L, 5L, -5L, 4L, -5L]) == true);\n assert(candidate([1L, -2L, 2L, -2L, 5L, -5L, 4L, -4L]) == true);\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n Find the shortest palindrome that begins with a supplied string.\n Algorithm idea is simple:\n - Find the longest postfix of supplied string that is a palindrome.\n - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n >>> make_palindrome(\"\")\n \"\"\n >>> make_palindrome(\"cat\")\n \"catac\"\n >>> make_palindrome(\"cata\")\n \"catac\"\n \n*/\nstring make_palindrome(string string) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = make_palindrome;\n\n assert(candidate(\"\") == \"\");\n assert(candidate(\"x\") == \"x\");\n assert(candidate(\"xyz\") == \"xyzyx\");\n assert(candidate(\"xyx\") == \"xyx\");\n assert(candidate(\"jerry\") == \"jerryrrej\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "d", - "prompt": "import std.typecons;\nimport std.math;\n/*\n\n Given a positive integer, obtain its roman numeral equivalent as a string,\n and return it in lowercase.\n Restrictions: 1 <= num <= 1000\n\n Examples:\n >>> int_to_mini_roman(19L)\n \"xix\"\n >>> int_to_mini_roman(152L)\n \"clii\"\n >>> int_to_mini_roman(426L)\n \"cdxxvi\"\n \n*/\nstring int_to_mini_roman(long number) \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "unittest\n{\n alias candidate = int_to_mini_roman;\n\n assert(candidate(19L) == \"xix\");\n assert(candidate(152L) == \"clii\");\n assert(candidate(251L) == \"ccli\");\n assert(candidate(426L) == \"cdxxvi\");\n assert(candidate(500L) == \"d\");\n assert(candidate(1L) == \"i\");\n assert(candidate(4L) == \"iv\");\n assert(candidate(43L) == \"xliii\");\n assert(candidate(90L) == \"xc\");\n assert(candidate(94L) == \"xciv\");\n assert(candidate(532L) == \"dxxxii\");\n assert(candidate(900L) == \"cm\");\n assert(candidate(994L) == \"cmxciv\");\n assert(candidate(1000L) == \"m\");\n}\nvoid main(){}", - "stop_tokens": [ - "\n\n", - "\nvoid", - "\nbool", - "\nint" - ] - } -] \ No newline at end of file diff --git a/data/go-keep.json b/data/go-keep.json deleted file mode 100644 index 5798fe05d845b4e0a6ddd8913555cb1d7a540074..0000000000000000000000000000000000000000 --- a/data/go-keep.json +++ /dev/null @@ -1,2158 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "go_test.go", - "prompt": "package largest_divisor_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// For a given number n, find the largest number that divides n evenly, smaller than n\n// >>> largest_divisor(15)\n// 5\nfunc largest_divisor(n int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "func TestLargest_Divisor(t *testing.T) {\n candidate := largest_divisor\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3), expected: 1 },\n { actual: candidate(7), expected: 1 },\n { actual: candidate(10), expected: 5 },\n { actual: candidate(100), expected: 50 },\n { actual: candidate(49), expected: 7 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_47_median", - "language": "go_test.go", - "prompt": "package median_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return median of elements in the list l.\n// >>> median([3, 1, 2, 4, 5])\n// 3\n// >>> median([-10, 4, 6, 1000, 10, 20])\n// 15.0\nfunc median(l []int) float64 {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "func TestMedian(t *testing.T) {\n candidate := median\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{3, 1, 2, 4, 5}), expected: 3 },\n { actual: candidate([]int{-10, 4, 6, 1000, 10, 20}), expected: 8.0 },\n { actual: candidate([]int{5}), expected: 5 },\n { actual: candidate([]int{6, 5}), expected: 5.5 },\n { actual: candidate([]int{8, 1, 3, 9, 9, 2, 7}), expected: 7 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "go_test.go", - "prompt": "package do_algebra_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given two lists operator, and operand. The first list has basic algebra operations, and \n// the second list is a list of integers. Use the two given lists to build the algebric \n// expression and return the evaluation of this expression.\n// The basic algebra operations:\n// Addition ( + ) \n// Subtraction ( - ) \n// Multiplication ( * ) \n// Floor division ( // ) \n// Exponentiation ( ** ) \n// Example:\n// operator['+', '*', '-']\n// array = [2, 3, 4, 5]\n// result = 2 + 3 * 4 - 5\n// => result = 9\n// Note:\n// The length of operator list is equal to the length of operand list minus one.\n// Operand is a list of of non-negative integers.\n// Operator list has at least one operator, and operand list has at least two operands.\nfunc do_algebra(operator []string, operand []int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "func TestDo_Algebra(t *testing.T) {\n candidate := do_algebra\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{\"**\", \"*\", \"+\"}, []int{2, 3, 4, 5}), expected: 37 },\n { actual: candidate([]string{\"+\", \"*\", \"-\"}, []int{2, 3, 4, 5}), expected: 9 },\n { actual: candidate([]string{\"//\", \"*\"}, []int{7, 3, 4}), expected: 8 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "go_test.go", - "prompt": "package max_element_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return maximum element in the list.\n// >>> max_element([1, 2, 3])\n// 3\n// >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n// 123\nfunc max_element(l []int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "func TestMax_Element(t *testing.T) {\n candidate := max_element\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 3}), expected: 3 },\n { actual: candidate([]int{5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10}), expected: 124 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "go_test.go", - "prompt": "package can_arrange_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function which returns the largest index of an element which\n// is not greater than or equal to the element immediately preceding it. If\n// no such element exists then return -1. The given array will not contain\n// duplicate values.\n// Examples:\n// can_arrange([1,2,4,3,5]) = 3\n// can_arrange([1,2,3]) = -1\nfunc can_arrange(arr []int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "func TestCan_Arrange(t *testing.T) {\n candidate := can_arrange\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 4, 3, 5}), expected: 3 },\n { actual: candidate([]int{1, 2, 4, 5}), expected: -1 },\n { actual: candidate([]int{1, 4, 2, 5, 6, 7, 8, 9, 10}), expected: 2 },\n { actual: candidate([]int{4, 8, 5, 7, 3}), expected: 4 },\n { actual: candidate([]int{}), expected: -1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "go_test.go", - "prompt": "package car_race_collision_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Imagine a road that's a perfectly straight infinitely long line.\n// n cars are driving left to right; simultaneously, a different set of n cars\n// are driving right to left. The two sets of cars start out being very far from\n// each other. All cars move in the same speed. Two cars are said to collide\n// when a car that's moving left to right hits a car that's moving right to left.\n// However, the cars are infinitely sturdy and strong; as a result, they continue moving\n// in their trajectory as if they did not collide.\n// This function outputs the number of such collisions.\nfunc car_race_collision(n int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": "func TestCar_Race_Collision(t *testing.T) {\n candidate := car_race_collision\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(2), expected: 4 },\n { actual: candidate(3), expected: 9 },\n { actual: candidate(4), expected: 16 },\n { actual: candidate(8), expected: 64 },\n { actual: candidate(10), expected: 100 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "go_test.go", - "prompt": "package check_if_last_char_is_a_letter_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function that returns True if the last character\n// of a given string is an alphabetical character and is not\n// a part of a word, and False otherwise.\n// Note: \"word\" is a group of characters separated by space.\n// Examples:\n// check_if_last_char_is_a_letter(\"apple pie\") \u279e False\n// check_if_last_char_is_a_letter(\"apple pi e\") \u279e True\n// check_if_last_char_is_a_letter(\"apple pi e \") \u279e False\n// check_if_last_char_is_a_letter(\"\") \u279e False\nfunc check_if_last_char_is_a_letter(txt string) bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "func TestCheck_If_Last_Char_Is_A_Letter(t *testing.T) {\n candidate := check_if_last_char_is_a_letter\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"apple\"), expected: false },\n { actual: candidate(\"apple pi e\"), expected: true },\n { actual: candidate(\"eeeee\"), expected: false },\n { actual: candidate(\"A\"), expected: true },\n { actual: candidate(\"Pumpkin pie \"), expected: false },\n { actual: candidate(\"Pumpkin pie 1\"), expected: false },\n { actual: candidate(\"\"), expected: false },\n { actual: candidate(\"eeeee e \"), expected: false },\n { actual: candidate(\"apple pie\"), expected: false },\n { actual: candidate(\"apple pi e \"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "go_test.go", - "prompt": "package is_prime_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return true if a given number is prime, and false otherwise.\n// >>> is_prime(6)\n// False\n// >>> is_prime(101)\n// True\n// >>> is_prime(11)\n// True\n// >>> is_prime(13441)\n// True\n// >>> is_prime(61)\n// True\n// >>> is_prime(4)\n// False\n// >>> is_prime(1)\n// False\nfunc is_prime(n int) bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "func TestIs_Prime(t *testing.T) {\n candidate := is_prime\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(6), expected: false },\n { actual: candidate(101), expected: true },\n { actual: candidate(11), expected: true },\n { actual: candidate(13441), expected: true },\n { actual: candidate(61), expected: true },\n { actual: candidate(4), expected: false },\n { actual: candidate(1), expected: false },\n { actual: candidate(5), expected: true },\n { actual: candidate(11), expected: true },\n { actual: candidate(17), expected: true },\n { actual: candidate(85), expected: false },\n { actual: candidate(77), expected: false },\n { actual: candidate(255379), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "go_test.go", - "prompt": "package unique_digits_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a list of positive integers x. return a sorted list of all \n// elements that hasn't any even digit.\n// Note: Returned list should be sorted in increasing order.\n// For example:\n// >>> unique_digits([15, 33, 1422, 1])\n// [1, 15, 33]\n// >>> unique_digits([152, 323, 1422, 10])\n// []\nfunc unique_digits(x []int) []int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "func TestUnique_Digits(t *testing.T) {\n candidate := unique_digits\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{15, 33, 1422, 1}), expected: []int{1, 15, 33} },\n { actual: candidate([]int{152, 323, 1422, 10}), expected: []int{} },\n { actual: candidate([]int{12345, 2033, 111, 151}), expected: []int{111, 151} },\n { actual: candidate([]int{135, 103, 31}), expected: []int{31, 135} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "go_test.go", - "prompt": "package string_xor_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Input are two strings a and b consisting only of 1s and 0s.\n// Perform binary XOR on these inputs and return result also as a string.\n// >>> string_xor('010', '110')\n// '100'\nfunc string_xor(a string, b string) string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "func TestString_Xor(t *testing.T) {\n candidate := string_xor\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"111000\", \"101010\"), expected: \"010010\" },\n { actual: candidate(\"1\", \"1\"), expected: \"0\" },\n { actual: candidate(\"0101\", \"0000\"), expected: \"0101\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "go_test.go", - "prompt": "package sum_to_n_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// sum_to_n is a function that sums numbers from 1 to n.\n// >>> sum_to_n(30)\n// 465\n// >>> sum_to_n(100)\n// 5050\n// >>> sum_to_n(5)\n// 15\n// >>> sum_to_n(10)\n// 55\n// >>> sum_to_n(1)\n// 1\nfunc sum_to_n(n int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "func TestSum_To_N(t *testing.T) {\n candidate := sum_to_n\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(1), expected: 1 },\n { actual: candidate(6), expected: 21 },\n { actual: candidate(11), expected: 66 },\n { actual: candidate(30), expected: 465 },\n { actual: candidate(100), expected: 5050 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "go_test.go", - "prompt": "package double_the_difference_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a list of numbers, return the sum of squares of the numbers\n// in the list that are odd. Ignore numbers that are negative or not integers.\n// double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10\n// double_the_difference([-1, -2, 0]) == 0\n// double_the_difference([9, -2]) == 81\n// double_the_difference([0]) == 0 \n// If the input list is empty, return 0.\nfunc double_the_difference(lst []float64) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "func TestDouble_The_Difference(t *testing.T) {\n candidate := double_the_difference\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]float64{}), expected: 0 },\n { actual: candidate([]float64{5.0, 4.0}), expected: 25 },\n { actual: candidate([]float64{0.1, 0.2, 0.3}), expected: 0 },\n { actual: candidate([]float64{-10.0, -20.0, -30.0}), expected: 0 },\n { actual: candidate([]float64{-1.0, -2.0, 8.0}), expected: 0 },\n { actual: candidate([]float64{0.2, 3.0, 5.0}), expected: 34 },\n { actual: candidate([]float64{-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0}), expected: 165 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "go_test.go", - "prompt": "package strlen_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return length of given string\n// >>> strlen('')\n// 0\n// >>> strlen('abc')\n// 3\nfunc strlen(myString string) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "func TestStrlen(t *testing.T) {\n candidate := strlen\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: 0 },\n { actual: candidate(\"x\"), expected: 1 },\n { actual: candidate(\"asdasnakj\"), expected: 9 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "go_test.go", - "prompt": "package is_bored_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You'll be given a string of words, and your task is to count the number\n// of boredoms. A boredom is a sentence that starts with the word \"I\".\n// Sentences are delimited by '.', '?' or '!'.\n// For example:\n// >>> is_bored(\"Hello world\")\n// 0\n// >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n// 1\nfunc is_bored(S string) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "func TestIs_Bored(t *testing.T) {\n candidate := is_bored\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Hello world\"), expected: 0 },\n { actual: candidate(\"Is the sky blue?\"), expected: 0 },\n { actual: candidate(\"I love It !\"), expected: 1 },\n { actual: candidate(\"bIt\"), expected: 0 },\n { actual: candidate(\"I feel good today. I will be productive. will kill It\"), expected: 2 },\n { actual: candidate(\"You and I are going for a walk\"), expected: 0 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "go_test.go", - "prompt": "package vowels_count_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function vowels_count which takes a string representing\n// a word as input and returns the number of vowels in the string.\n// Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n// vowel, but only when it is at the end of the given word.\n// Example:\n// >>> vowels_count(\"abcde\")\n// 2\n// >>> vowels_count(\"ACEDY\")\n// 3\nfunc vowels_count(s string) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "func TestVowels_Count(t *testing.T) {\n candidate := vowels_count\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"abcde\"), expected: 2 },\n { actual: candidate(\"Alone\"), expected: 3 },\n { actual: candidate(\"key\"), expected: 2 },\n { actual: candidate(\"bye\"), expected: 1 },\n { actual: candidate(\"keY\"), expected: 2 },\n { actual: candidate(\"bYe\"), expected: 1 },\n { actual: candidate(\"ACEDY\"), expected: 3 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_55_fib", - "language": "go_test.go", - "prompt": "package fib_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return n-th Fibonacci number.\n// >>> fib(10)\n// 55\n// >>> fib(1)\n// 1\n// >>> fib(8)\n// 21\nfunc fib(n int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "func TestFib(t *testing.T) {\n candidate := fib\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(10), expected: 55 },\n { actual: candidate(1), expected: 1 },\n { actual: candidate(8), expected: 21 },\n { actual: candidate(11), expected: 89 },\n { actual: candidate(12), expected: 144 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "go_test.go", - "prompt": "package simplify_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Your task is to implement a function that will simplify the expression\n// x * n. The function returns True if x * n evaluates to a whole number and False\n// otherwise. Both x and n, are string representation of a fraction, and have the following format,\n// / where both numerator and denominator are positive whole numbers.\n// You can assume that x, and n are valid fractions, and do not have zero as denominator.\n// simplify(\"1/5\", \"5/1\") = True\n// simplify(\"1/6\", \"2/1\") = False\n// simplify(\"7/10\", \"10/2\") = False\nfunc simplify(x string, n string) bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "func TestSimplify(t *testing.T) {\n candidate := simplify\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"1/5\", \"5/1\"), expected: true },\n { actual: candidate(\"1/6\", \"2/1\"), expected: false },\n { actual: candidate(\"5/1\", \"3/1\"), expected: true },\n { actual: candidate(\"7/10\", \"10/2\"), expected: false },\n { actual: candidate(\"2/10\", \"50/10\"), expected: true },\n { actual: candidate(\"7/2\", \"4/2\"), expected: true },\n { actual: candidate(\"11/6\", \"6/1\"), expected: true },\n { actual: candidate(\"2/3\", \"5/2\"), expected: false },\n { actual: candidate(\"5/2\", \"3/5\"), expected: false },\n { actual: candidate(\"2/4\", \"8/4\"), expected: true },\n { actual: candidate(\"2/4\", \"4/2\"), expected: true },\n { actual: candidate(\"1/5\", \"5/1\"), expected: true },\n { actual: candidate(\"1/5\", \"1/5\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "go_test.go", - "prompt": "package count_upper_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a string s, count the number of uppercase vowels in even indices.\n// For example:\n// count_upper('aBCdEf') returns 1\n// count_upper('abcdefg') returns 0\n// count_upper('dBBE') returns 0\nfunc count_upper(s string) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "func TestCount_Upper(t *testing.T) {\n candidate := count_upper\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"aBCdEf\"), expected: 1 },\n { actual: candidate(\"abcdefg\"), expected: 0 },\n { actual: candidate(\"dBBE\"), expected: 0 },\n { actual: candidate(\"B\"), expected: 0 },\n { actual: candidate(\"U\"), expected: 1 },\n { actual: candidate(\"\"), expected: 0 },\n { actual: candidate(\"EEEE\"), expected: 2 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "go_test.go", - "prompt": "package max_fill_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a rectangular grid of wells. Each row represents a single well,\n// and each 1 in a row represents a single unit of water.\n// Each well has a corresponding bucket that can be used to extract water from it, \n// and all buckets have the same capacity.\n// Your task is to use the buckets to empty the wells.\n// Output the number of times you need to lower the buckets.\n// Example 1:\n// Input: \n// grid : [[0,0,1,0], [0,1,0,0], [1,1,1,1]]\n// bucket_capacity : 1\n// Output: 6\n// Example 2:\n// Input: \n// grid : [[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]]\n// bucket_capacity : 2\n// Output: 5\n// Example 3:\n// Input: \n// grid : [[0,0,0], [0,0,0]]\n// bucket_capacity : 5\n// Output: 0\n// Constraints:\n// * all wells have the same length\n// * 1 <= grid.length <= 10^2\n// * 1 <= grid[:,1].length <= 10^2\n// * grid[i][j] -> 0 | 1\n// * 1 <= capacity <= 10\nfunc max_fill(grid [][]int, capacity int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "func TestMax_Fill(t *testing.T) {\n candidate := max_fill\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([][]int{[]int{0, 0, 1, 0}, []int{0, 1, 0, 0}, []int{1, 1, 1, 1}}, 1), expected: 6 },\n { actual: candidate([][]int{[]int{0, 0, 1, 1}, []int{0, 0, 0, 0}, []int{1, 1, 1, 1}, []int{0, 1, 1, 1}}, 2), expected: 5 },\n { actual: candidate([][]int{[]int{0, 0, 0}, []int{0, 0, 0}}, 5), expected: 0 },\n { actual: candidate([][]int{[]int{1, 1, 1, 1}, []int{1, 1, 1, 1}}, 2), expected: 4 },\n { actual: candidate([][]int{[]int{1, 1, 1, 1}, []int{1, 1, 1, 1}}, 9), expected: 2 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "go_test.go", - "prompt": "package maximum_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given an array arr of integers and a positive integer k, return a sorted list \n// of length k with the maximum k numbers in arr.\n// Example 1:\n// Input: arr = [-3, -4, 5], k = 3\n// Output: [-4, -3, 5]\n// Example 2:\n// Input: arr = [4, -4, 4], k = 2\n// Output: [4, 4]\n// Example 3:\n// Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1\n// Output: [2]\n// Note:\n// 1. The length of the array will be in the range of [1, 1000].\n// 2. The elements in the array will be in the range of [-1000, 1000].\n// 3. 0 <= k <= len(arr)\nfunc maximum(arr []int, k int) []int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "func TestMaximum(t *testing.T) {\n candidate := maximum\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{-3, -4, 5}, 3), expected: []int{-4, -3, 5} },\n { actual: candidate([]int{4, -4, 4}, 2), expected: []int{4, 4} },\n { actual: candidate([]int{-3, 2, 1, 2, -1, -2, 1}, 1), expected: []int{2} },\n { actual: candidate([]int{123, -123, 20, 0, 1, 2, -3}, 3), expected: []int{2, 20, 123} },\n { actual: candidate([]int{-123, 20, 0, 1, 2, -3}, 4), expected: []int{0, 1, 2, 20} },\n { actual: candidate([]int{5, 15, 0, 3, -13, -8, 0}, 7), expected: []int{-13, -8, 0, 0, 3, 5, 15} },\n { actual: candidate([]int{-1, 0, 2, 5, 3, -10}, 2), expected: []int{3, 5} },\n { actual: candidate([]int{1, 0, 5, -7}, 1), expected: []int{5} },\n { actual: candidate([]int{4, -4}, 2), expected: []int{-4, 4} },\n { actual: candidate([]int{-10, 10}, 2), expected: []int{-10, 10} },\n { actual: candidate([]int{1, 2, 3, -23, 243, -400, 0}, 0), expected: []int{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_93_encode", - "language": "go_test.go", - "prompt": "package encode_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that takes a message, and encodes in such a \n// way that it swaps case of all letters, replaces all vowels in \n// the message with the letter that appears 2 places ahead of that \n// vowel in the english alphabet. \n// Assume only letters. \n// Examples:\n// >>> encode('test')\n// 'TGST'\n// >>> encode('This is a message')\n// 'tHKS KS C MGSSCGG'\nfunc encode(message string) string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "func TestEncode(t *testing.T) {\n candidate := encode\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"TEST\"), expected: \"tgst\" },\n { actual: candidate(\"Mudasir\"), expected: \"mWDCSKR\" },\n { actual: candidate(\"YES\"), expected: \"ygs\" },\n { actual: candidate(\"This is a message\"), expected: \"tHKS KS C MGSSCGG\" },\n { actual: candidate(\"I DoNt KnOw WhAt tO WrItE\"), expected: \"k dQnT kNqW wHcT Tq wRkTg\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "go_test.go", - "prompt": "package remove_vowels_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// remove_vowels is a function that takes string and returns string without vowels.\n// >>> remove_vowels('')\n// ''\n// >>> remove_vowels('abcdef')\n// 'bcdf'\n// >>> remove_vowels('aaaaa')\n// ''\n// >>> remove_vowels('aaBAA')\n// 'B'\n// >>> remove_vowels('zbcd')\n// 'zbcd'\nfunc remove_vowels(text string) string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "func TestRemove_Vowels(t *testing.T) {\n candidate := remove_vowels\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: \"\" },\n { actual: candidate(\"abcdef\\nghijklm\"), expected: \"bcdf\\nghjklm\" },\n { actual: candidate(\"fedcba\"), expected: \"fdcb\" },\n { actual: candidate(\"eeeee\"), expected: \"\" },\n { actual: candidate(\"acBAA\"), expected: \"cB\" },\n { actual: candidate(\"EcBOO\"), expected: \"cB\" },\n { actual: candidate(\"ybcd\"), expected: \"ybcd\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "go_test.go", - "prompt": "package get_positive_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return only positive numbers in the list.\n// >>> get_positive([-1, 2, -4, 5, 6])\n// [2, 5, 6]\n// >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n// [5, 3, 2, 3, 9, 123, 1]\nfunc get_positive(l []int) []int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "func TestGet_Positive(t *testing.T) {\n candidate := get_positive\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{-1, -2, 4, 5, 6}), expected: []int{4, 5, 6} },\n { actual: candidate([]int{5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10}), expected: []int{5, 3, 2, 3, 3, 9, 123, 1} },\n { actual: candidate([]int{-1, -2}), expected: []int{} },\n { actual: candidate([]int{}), expected: []int{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "go_test.go", - "prompt": "package string_sequence_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n// >>> string_sequence(0)\n// '0'\n// >>> string_sequence(5)\n// '0 1 2 3 4 5'\nfunc string_sequence(n int) string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "func TestString_Sequence(t *testing.T) {\n candidate := string_sequence\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(0), expected: \"0\" },\n { actual: candidate(3), expected: \"0 1 2 3\" },\n { actual: candidate(10), expected: \"0 1 2 3 4 5 6 7 8 9 10\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "go_test.go", - "prompt": "package make_a_pile_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a positive integer n, you have to make a pile of n levels of stones.\n// The first level has n stones.\n// The number of stones in the next level is:\n// - the next odd number if n is odd.\n// - the next even number if n is even.\n// Return the number of stones in each level in a list, where element at index\n// i represents the number of stones in the level (i+1).\n// Examples:\n// >>> make_a_pile(3)\n// [3, 5, 7]\nfunc make_a_pile(n int) []int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "func TestMake_A_Pile(t *testing.T) {\n candidate := make_a_pile\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3), expected: []int{3, 5, 7} },\n { actual: candidate(4), expected: []int{4, 6, 8, 10} },\n { actual: candidate(5), expected: []int{5, 7, 9, 11, 13} },\n { actual: candidate(6), expected: []int{6, 8, 10, 12, 14, 16} },\n { actual: candidate(8), expected: []int{8, 10, 12, 14, 16, 18, 20, 22} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "go_test.go", - "prompt": "package reverse_delete_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Task\n// 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\n// then check if the result string is palindrome.\n// A string is called palindrome if it reads the same backward as forward.\n// You should return a tuple containing the result string and True/False for the check.\n// Example\n// For s = \"abcde\", c = \"ae\", the result should be ('bcd',False)\n// For s = \"abcdef\", c = \"b\" the result should be ('acdef',False)\n// For s = \"abcdedcba\", c = \"ab\", the result should be ('cdedc',True)\nfunc reverse_delete(s string, c string) []interface{} {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "func TestReverse_Delete(t *testing.T) {\n candidate := reverse_delete\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"abcde\", \"ae\"), expected: []interface{}{\"bcd\", false} },\n { actual: candidate(\"abcdef\", \"b\"), expected: []interface{}{\"acdef\", false} },\n { actual: candidate(\"abcdedcba\", \"ab\"), expected: []interface{}{\"cdedc\", true} },\n { actual: candidate(\"dwik\", \"w\"), expected: []interface{}{\"dik\", false} },\n { actual: candidate(\"a\", \"a\"), expected: []interface{}{\"\", true} },\n { actual: candidate(\"abcdedcba\", \"\"), expected: []interface{}{\"abcdedcba\", true} },\n { actual: candidate(\"abcdedcba\", \"v\"), expected: []interface{}{\"abcdedcba\", true} },\n { actual: candidate(\"vabba\", \"v\"), expected: []interface{}{\"abba\", true} },\n { actual: candidate(\"mamma\", \"mia\"), expected: []interface{}{\"\", true} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "go_test.go", - "prompt": "package flip_case_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n// >>> flip_case('Hello')\n// 'hELLO'\nfunc flip_case(myString string) string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "func TestFlip_Case(t *testing.T) {\n candidate := flip_case\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: \"\" },\n { actual: candidate(\"Hello!\"), expected: \"hELLO!\" },\n { actual: candidate(\"These violent delights have violent ends\"), expected: \"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_161_solve", - "language": "go_test.go", - "prompt": "package solve_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a string s.\n// if s[i] is a letter, reverse its case from lower to upper or vise versa, \n// otherwise keep it as it is.\n// If the string contains no letters, reverse the string.\n// The function should return the resulted string.\n// Examples\n// solve(\"1234\") = \"4321\"\n// solve(\"ab\") = \"AB\"\n// solve(\"#a@C\") = \"#A@c\"\nfunc solve(s string) string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "func TestSolve(t *testing.T) {\n candidate := solve\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"AsDf\"), expected: \"aSdF\" },\n { actual: candidate(\"1234\"), expected: \"4321\" },\n { actual: candidate(\"ab\"), expected: \"AB\" },\n { actual: candidate(\"#a@C\"), expected: \"#A@c\" },\n { actual: candidate(\"#AsdfW^45\"), expected: \"#aSDFw^45\" },\n { actual: candidate(\"#6@2\"), expected: \"2@6#\" },\n { actual: candidate(\"#$a^D\"), expected: \"#$A^d\" },\n { actual: candidate(\"#ccc\"), expected: \"#CCC\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "go_test.go", - "prompt": "package filter_by_prefix_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Filter an input list of strings only for ones that start with a given prefix.\n// >>> filter_by_prefix([], 'a')\n// []\n// >>> filter_by_prefix(['abc', 'bcd', 'cde', 'array'], 'a')\n// ['abc', 'array']\nfunc filter_by_prefix(strings []string, prefix string) []string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "func TestFilter_By_Prefix(t *testing.T) {\n candidate := filter_by_prefix\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{}, \"john\"), expected: []string{} },\n { actual: candidate([]string{\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"}, \"xxx\"), expected: []string{\"xxx\", \"xxxAAA\", \"xxx\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "go_test.go", - "prompt": "package choose_num_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// This function takes two positive numbers x and y and returns the\n// biggest even integer number that is in the range [x, y] inclusive. If \n// there's no such number, then the function should return -1.\n// For example:\n// choose_num(12, 15) = 14\n// choose_num(13, 12) = -1\nfunc choose_num(x int, y int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "func TestChoose_Num(t *testing.T) {\n candidate := choose_num\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(12, 15), expected: 14 },\n { actual: candidate(13, 12), expected: -1 },\n { actual: candidate(33, 12354), expected: 12354 },\n { actual: candidate(5234, 5233), expected: -1 },\n { actual: candidate(6, 29), expected: 28 },\n { actual: candidate(27, 10), expected: -1 },\n { actual: candidate(7, 7), expected: -1 },\n { actual: candidate(546, 546), expected: 546 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "go_test.go", - "prompt": "package words_in_sentence_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a string representing a sentence,\n// the sentence contains some words separated by a space,\n// and you have to return a string that contains the words from the original sentence,\n// whose lengths are prime numbers,\n// the order of the words in the new string should be the same as the original one.\n// Example 1:\n// Input: sentence = \"This is a test\"\n// Output: \"is\"\n// Example 2:\n// Input: sentence = \"lets go for swimming\"\n// Output: \"go for\"\n// Constraints:\n// * 1 <= len(sentence) <= 100\n// * sentence contains only letters\nfunc words_in_sentence(sentence string) string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "func TestWords_In_Sentence(t *testing.T) {\n candidate := words_in_sentence\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"This is a test\"), expected: \"is\" },\n { actual: candidate(\"lets go for swimming\"), expected: \"go for\" },\n { actual: candidate(\"there is no place available here\"), expected: \"there is no place\" },\n { actual: candidate(\"Hi I am Hussein\"), expected: \"Hi am Hussein\" },\n { actual: candidate(\"go for it\"), expected: \"go for it\" },\n { actual: candidate(\"here\"), expected: \"\" },\n { actual: candidate(\"here is\"), expected: \"is\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "go_test.go", - "prompt": "package intersperse_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n// >>> intersperse([], 4)\n// []\n// >>> intersperse([1, 2, 3], 4)\n// [1, 4, 2, 4, 3]\nfunc intersperse(numbers []int, delimeter int) []int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "func TestIntersperse(t *testing.T) {\n candidate := intersperse\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}, 7), expected: []int{} },\n { actual: candidate([]int{5, 6, 3, 2}, 8), expected: []int{5, 8, 6, 8, 3, 8, 2} },\n { actual: candidate([]int{2, 2, 2}, 2), expected: []int{2, 2, 2, 2, 2} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "go_test.go", - "prompt": "package is_simple_power_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Your task is to write a function that returns true if a number x is a simple\n// power of n and false in other cases.\n// x is a simple power of n if n**int=x\n// For example:\n// is_simple_power(1, 4) => true\n// is_simple_power(2, 2) => true\n// is_simple_power(8, 2) => true\n// is_simple_power(3, 2) => false\n// is_simple_power(3, 1) => false\n// is_simple_power(5, 3) => false\nfunc is_simple_power(x int, n int) bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "func TestIs_Simple_Power(t *testing.T) {\n candidate := is_simple_power\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(16, 2), expected: true },\n { actual: candidate(143214, 16), expected: false },\n { actual: candidate(4, 2), expected: true },\n { actual: candidate(9, 3), expected: true },\n { actual: candidate(16, 4), expected: true },\n { actual: candidate(24, 2), expected: false },\n { actual: candidate(128, 4), expected: false },\n { actual: candidate(12, 6), expected: false },\n { actual: candidate(1, 1), expected: true },\n { actual: candidate(1, 12), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "go_test.go", - "prompt": "package is_multiply_prime_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that returns true if the given number is the multiplication of 3 prime numbers\n// and false otherwise.\n// Knowing that (a) is less then 100. \n// Example:\n// is_multiply_prime(30) == True\n// 30 = 2 * 3 * 5\nfunc is_multiply_prime(a int) bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "func TestIs_Multiply_Prime(t *testing.T) {\n candidate := is_multiply_prime\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5), expected: false },\n { actual: candidate(30), expected: true },\n { actual: candidate(8), expected: true },\n { actual: candidate(10), expected: false },\n { actual: candidate(125), expected: true },\n { actual: candidate(105), expected: true },\n { actual: candidate(126), expected: false },\n { actual: candidate(729), expected: false },\n { actual: candidate(891), expected: false },\n { actual: candidate(1001), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "go_test.go", - "prompt": "package right_angle_triangle_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given the lengths of the three sides of a triangle. Return True if the three\n// sides form a right-angled triangle, False otherwise.\n// A right-angled triangle is a triangle in which one angle is right angle or \n// 90 degree.\n// Example:\n// right_angle_triangle(3, 4, 5) == True\n// right_angle_triangle(1, 2, 3) == False\nfunc right_angle_triangle(a int, b int, c int) bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "func TestRight_Angle_Triangle(t *testing.T) {\n candidate := right_angle_triangle\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3, 4, 5), expected: true },\n { actual: candidate(1, 2, 3), expected: false },\n { actual: candidate(10, 6, 8), expected: true },\n { actual: candidate(2, 2, 2), expected: false },\n { actual: candidate(7, 24, 25), expected: true },\n { actual: candidate(10, 5, 7), expected: false },\n { actual: candidate(5, 12, 13), expected: true },\n { actual: candidate(15, 8, 17), expected: true },\n { actual: candidate(48, 55, 73), expected: true },\n { actual: candidate(1, 1, 1), expected: false },\n { actual: candidate(2, 2, 10), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "go_test.go", - "prompt": "package any_int_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function that takes 3 numbers.\n// Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n// Returns false in any other cases.\n// Examples\n// any_int(5, 2, 7) \u279e True\n// any_int(3, 2, 2) \u279e False\n// any_int(3, -2, 1) \u279e True\n// any_int(3.6, -2.2, 2) \u279e False\nfunc any_int(x float64, y float64, z float64) bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "func TestAny_Int(t *testing.T) {\n candidate := any_int\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(2, 3, 1), expected: true },\n { actual: candidate(2.5, 2, 3), expected: false },\n { actual: candidate(1.5, 5, 3.5), expected: false },\n { actual: candidate(2, 6, 2), expected: false },\n { actual: candidate(4, 2, 2), expected: true },\n { actual: candidate(2.2, 2.2, 2.2), expected: false },\n { actual: candidate(-4, 6, 2), expected: true },\n { actual: candidate(2, 1, 1), expected: true },\n { actual: candidate(3, 4, 7), expected: true },\n { actual: candidate(3.0, 4, 7), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "go_test.go", - "prompt": "package sort_third_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// This function takes a list l and returns a list l' such that\n// l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n// to the values of the corresponding indicies of l, but sorted.\n// >>> sort_third([1, 2, 3])\n// [1, 2, 3]\n// >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n// [2, 6, 3, 4, 8, 9, 5]\nfunc sort_third(l []int) []int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "func TestSort_Third(t *testing.T) {\n candidate := sort_third\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{5, 6, 3, 4, 8, 9, 2}), expected: []int{2, 6, 3, 4, 8, 9, 5} },\n { actual: candidate([]int{5, 8, 3, 4, 6, 9, 2}), expected: []int{2, 8, 3, 4, 6, 9, 5} },\n { actual: candidate([]int{5, 6, 9, 4, 8, 3, 2}), expected: []int{2, 6, 9, 4, 8, 3, 5} },\n { actual: candidate([]int{5, 6, 3, 4, 8, 9, 2, 1}), expected: []int{2, 6, 3, 4, 8, 9, 5, 1} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_53_add", - "language": "go_test.go", - "prompt": "package add_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Add two numbers x and y\n// >>> add(2, 3)\n// 5\n// >>> add(5, 7)\n// 12\nfunc add(x int, y int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "func TestAdd(t *testing.T) {\n candidate := add\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(0, 1), expected: 1 },\n { actual: candidate(1, 0), expected: 1 },\n { actual: candidate(2, 3), expected: 5 },\n { actual: candidate(5, 7), expected: 12 },\n { actual: candidate(7, 5), expected: 12 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_69_search", - "language": "go_test.go", - "prompt": "package search_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n// zero, and has a frequency greater than or equal to the value of the integer itself. \n// The frequency of an integer is the number of times it appears in the list.\n// If no such a value exist, return -1.\n// Examples:\n// search([4, 1, 2, 2, 3, 1]) == 2\n// search([1, 2, 2, 3, 3, 3, 4, 4, 4]) == 3\n// search([5, 5, 4, 4, 4]) == -1\nfunc search(lst []int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "func TestSearch(t *testing.T) {\n candidate := search\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{5, 5, 5, 5, 1}), expected: 1 },\n { actual: candidate([]int{4, 1, 4, 1, 4, 4}), expected: 4 },\n { actual: candidate([]int{3, 3}), expected: -1 },\n { actual: candidate([]int{8, 8, 8, 8, 8, 8, 8, 8}), expected: 8 },\n { actual: candidate([]int{2, 3, 3, 2, 2}), expected: 2 },\n { actual: candidate([]int{2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1}), expected: 1 },\n { actual: candidate([]int{3, 2, 8, 2}), expected: 2 },\n { actual: candidate([]int{6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10}), expected: 1 },\n { actual: candidate([]int{8, 8, 3, 6, 5, 6, 4}), expected: -1 },\n { actual: candidate([]int{6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9}), expected: 1 },\n { actual: candidate([]int{1, 9, 10, 1, 3}), expected: 1 },\n { actual: candidate([]int{6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10}), expected: 5 },\n { actual: candidate([]int{1}), expected: 1 },\n { actual: candidate([]int{8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5}), expected: 4 },\n { actual: candidate([]int{2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10}), expected: 2 },\n { actual: candidate([]int{1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3}), expected: 1 },\n { actual: candidate([]int{9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4}), expected: 4 },\n { actual: candidate([]int{2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7}), expected: 4 },\n { actual: candidate([]int{9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1}), expected: 2 },\n { actual: candidate([]int{5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8}), expected: -1 },\n { actual: candidate([]int{10}), expected: -1 },\n { actual: candidate([]int{9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2}), expected: 2 },\n { actual: candidate([]int{5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8}), expected: 1 },\n { actual: candidate([]int{7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6}), expected: 1 },\n { actual: candidate([]int{3, 10, 10, 9, 2}), expected: -1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "go_test.go", - "prompt": "package prime_length_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that takes a string and returns True if the string\n// length is a prime number or False otherwise\n// Examples\n// prime_length('Hello') == True\n// prime_length('abcdcba') == True\n// prime_length('kittens') == True\n// prime_length('orange') == False\nfunc prime_length(myString string) bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "func TestPrime_Length(t *testing.T) {\n candidate := prime_length\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Hello\"), expected: true },\n { actual: candidate(\"abcdcba\"), expected: true },\n { actual: candidate(\"kittens\"), expected: true },\n { actual: candidate(\"orange\"), expected: false },\n { actual: candidate(\"wow\"), expected: true },\n { actual: candidate(\"world\"), expected: true },\n { actual: candidate(\"MadaM\"), expected: true },\n { actual: candidate(\"Wow\"), expected: true },\n { actual: candidate(\"\"), expected: false },\n { actual: candidate(\"HI\"), expected: true },\n { actual: candidate(\"go\"), expected: true },\n { actual: candidate(\"gogo\"), expected: false },\n { actual: candidate(\"aaaaaaaaaaaaaaa\"), expected: false },\n { actual: candidate(\"Madam\"), expected: true },\n { actual: candidate(\"M\"), expected: false },\n { actual: candidate(\"0\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_58_common", - "language": "go_test.go", - "prompt": "package common_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return sorted unique common elements for two lists.\n// >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n// [1, 5, 653]\n// >>> common([5, 3, 2, 8], [3, 2])\n// [2, 3]\nfunc common(l1 []int, l2 []int) []int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "func TestCommon(t *testing.T) {\n candidate := common\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 4, 3, 34, 653, 2, 5}, []int{5, 7, 1, 5, 9, 653, 121}), expected: []int{1, 5, 653} },\n { actual: candidate([]int{5, 3, 2, 8}, []int{3, 2}), expected: []int{2, 3} },\n { actual: candidate([]int{4, 3, 2, 8}, []int{3, 2, 4}), expected: []int{2, 3, 4} },\n { actual: candidate([]int{4, 3, 2, 8}, []int{}), expected: []int{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "go_test.go", - "prompt": "package special_factorial_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// The Brazilian factorial is defined as:\n// brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n// where n > 0\n// For example:\n// >>> special_factorial(4)\n// 288\n// The function will receive an integer as input and should return the special\n// factorial of this integer.\nfunc special_factorial(n int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "func TestSpecial_Factorial(t *testing.T) {\n candidate := special_factorial\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(4), expected: 288 },\n { actual: candidate(5), expected: 34560 },\n { actual: candidate(7), expected: 125411328000 },\n { actual: candidate(1), expected: 1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "go_test.go", - "prompt": "package exchange_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// In this problem, you will implement a function that takes two lists of numbers,\n// and determines whether it is possible to perform an exchange of elements\n// between them to make lst1 a list of only even numbers.\n// There is no limit on the number of exchanged elements between lst1 and lst2.\n// If it is possible to exchange elements between the lst1 and lst2 to make\n// all the elements of lst1 to be even, return \"YES\".\n// Otherwise, return \"NO\".\n// For example:\n// exchange([1, 2, 3, 4], [1, 2, 3, 4]) => \"YES\"\n// exchange([1, 2, 3, 4], [1, 5, 3, 4]) => \"NO\"\n// It is assumed that the input lists will be non-empty.\nfunc exchange(lst1 []int, lst2 []int) string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "func TestExchange(t *testing.T) {\n candidate := exchange\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 3, 4}, []int{1, 2, 3, 4}), expected: \"YES\" },\n { actual: candidate([]int{1, 2, 3, 4}, []int{1, 5, 3, 4}), expected: \"NO\" },\n { actual: candidate([]int{1, 2, 3, 4}, []int{2, 1, 4, 3}), expected: \"YES\" },\n { actual: candidate([]int{5, 7, 3}, []int{2, 6, 4}), expected: \"YES\" },\n { actual: candidate([]int{5, 7, 3}, []int{2, 6, 3}), expected: \"NO\" },\n { actual: candidate([]int{3, 2, 6, 1, 8, 9}, []int{3, 5, 5, 1, 1, 1}), expected: \"NO\" },\n { actual: candidate([]int{100, 200}, []int{200, 200}), expected: \"YES\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "go_test.go", - "prompt": "package add_elements_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a non-empty array of integers arr and an integer k, return\n// the sum of the elements with at most two digits from the first k elements of arr.\n// Example:\n// Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4\n// Output: 24 # sum of 21 + 3\n// Constraints:\n// 1. 1 <= len(arr) <= 100\n// 2. 1 <= k <= len(arr)\nfunc add_elements(arr []int, k int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "func TestAdd_Elements(t *testing.T) {\n candidate := add_elements\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, -2, -3, 41, 57, 76, 87, 88, 99}, 3), expected: -4 },\n { actual: candidate([]int{111, 121, 3, 4000, 5, 6}, 2), expected: 0 },\n { actual: candidate([]int{11, 21, 3, 90, 5, 6, 7, 8, 9}, 4), expected: 125 },\n { actual: candidate([]int{111, 21, 3, 4000, 5, 6, 7, 8, 9}, 4), expected: 24 },\n { actual: candidate([]int{1}, 1), expected: 1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "go_test.go", - "prompt": "package x_or_y_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// A simple program which should return the value of x if n is \n// a prime number and should return the value of y otherwise.\n// Examples:\n// for x_or_y(7, 34, 12) == 34\n// for x_or_y(15, 8, 5) == 5\nfunc x_or_y(n int, x int, y int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "func TestX_Or_Y(t *testing.T) {\n candidate := x_or_y\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(7, 34, 12), expected: 34 },\n { actual: candidate(15, 8, 5), expected: 5 },\n { actual: candidate(3, 33, 5212), expected: 33 },\n { actual: candidate(1259, 3, 52), expected: 3 },\n { actual: candidate(7919, -1, 12), expected: -1 },\n { actual: candidate(3609, 1245, 583), expected: 583 },\n { actual: candidate(91, 56, 129), expected: 129 },\n { actual: candidate(6, 34, 1234), expected: 1234 },\n { actual: candidate(1, 2, 0), expected: 0 },\n { actual: candidate(2, 2, 0), expected: 2 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "go_test.go", - "prompt": "package triangle_area_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given length of a side and high return area for a triangle.\n// >>> triangle_area(5, 3)\n// 7.5\nfunc triangle_area(a int, h int) float64 {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "func TestTriangle_Area(t *testing.T) {\n candidate := triangle_area\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5, 3), expected: 7.5 },\n { actual: candidate(2, 2), expected: 2.0 },\n { actual: candidate(10, 8), expected: 40.0 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_130_tri", - "language": "go_test.go", - "prompt": "package tri_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n// the last couple centuries. However, what people don't know is Tribonacci sequence.\n// Tribonacci sequence is defined by the recurrence:\n// tri(1) = 3\n// tri(n) = 1 + n / 2, if n is even.\n// tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n// For example:\n// tri(2) = 1 + (2 / 2) = 2\n// tri(4) = 3\n// tri(3) = tri(2) + tri(1) + tri(4)\n// = 2 + 3 + 3 = 8 \n// You are given a non-negative integer number n, you have to a return a list of the \n// first n + 1 numbers of the Tribonacci sequence.\n// Examples:\n// tri(3) = [1, 3, 2, 8]\nfunc tri(n int) []int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "func TestTri(t *testing.T) {\n candidate := tri\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3), expected: []int{1, 3, 2, 8} },\n { actual: candidate(4), expected: []int{1, 3, 2, 8, 3} },\n { actual: candidate(5), expected: []int{1, 3, 2, 8, 3, 15} },\n { actual: candidate(6), expected: []int{1, 3, 2, 8, 3, 15, 4} },\n { actual: candidate(7), expected: []int{1, 3, 2, 8, 3, 15, 4, 24} },\n { actual: candidate(8), expected: []int{1, 3, 2, 8, 3, 15, 4, 24, 5} },\n { actual: candidate(9), expected: []int{1, 3, 2, 8, 3, 15, 4, 24, 5, 35} },\n { actual: candidate(20), expected: []int{1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11} },\n { actual: candidate(0), expected: []int{1} },\n { actual: candidate(1), expected: []int{1, 3} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "go_test.go", - "prompt": "package match_parens_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a list of two strings, both strings consist of open\n// parentheses '(' or close parentheses ')' only.\n// Your job is to check if it is possible to concatenate the two strings in\n// some order, that the resulting string will be good.\n// A string S is considered to be good if and only if all parentheses in S\n// are balanced. For example: the string '(())()' is good, while the string\n// '())' is not.\n// Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n// Examples:\n// match_parens(['()(', ')']) == 'Yes'\n// match_parens([')', ')']) == 'No'\nfunc match_parens(lst []string) string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "func TestMatch_Parens(t *testing.T) {\n candidate := match_parens\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{\"()(\", \")\"}), expected: \"Yes\" },\n { actual: candidate([]string{\")\", \")\"}), expected: \"No\" },\n { actual: candidate([]string{\"(()(())\", \"())())\"}), expected: \"No\" },\n { actual: candidate([]string{\")())\", \"(()()(\"}), expected: \"Yes\" },\n { actual: candidate([]string{\"(())))\", \"(()())((\"}), expected: \"Yes\" },\n { actual: candidate([]string{\"()\", \"())\"}), expected: \"No\" },\n { actual: candidate([]string{\"(()(\", \"()))()\"}), expected: \"Yes\" },\n { actual: candidate([]string{\"((((\", \"((())\"}), expected: \"No\" },\n { actual: candidate([]string{\")(()\", \"(()(\"}), expected: \"No\" },\n { actual: candidate([]string{\")(\", \")(\"}), expected: \"No\" },\n { actual: candidate([]string{\"(\", \")\"}), expected: \"Yes\" },\n { actual: candidate([]string{\")\", \"(\"}), expected: \"Yes\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "go_test.go", - "prompt": "package remove_duplicates_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// From a list of integers, remove all elements that occur more than once.\n// Keep order of elements left the same as in the input.\n// >>> remove_duplicates([1, 2, 3, 2, 4])\n// [1, 3, 4]\nfunc remove_duplicates(numbers []int) []int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "func TestRemove_Duplicates(t *testing.T) {\n candidate := remove_duplicates\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{1, 2, 3, 4}), expected: []int{1, 2, 3, 4} },\n { actual: candidate([]int{1, 2, 3, 2, 4, 3, 5}), expected: []int{1, 4, 5} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "go_test.go", - "prompt": "package greatest_common_divisor_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return a greatest common divisor of two integers a and b\n// >>> greatest_common_divisor(3, 5)\n// 1\n// >>> greatest_common_divisor(25, 15)\n// 5\nfunc greatest_common_divisor(a int, b int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "func TestGreatest_Common_Divisor(t *testing.T) {\n candidate := greatest_common_divisor\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3, 7), expected: 1 },\n { actual: candidate(10, 15), expected: 5 },\n { actual: candidate(49, 14), expected: 7 },\n { actual: candidate(144, 60), expected: 12 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "go_test.go", - "prompt": "package is_palindrome_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Checks if given string is a palindrome\n// >>> is_palindrome('')\n// True\n// >>> is_palindrome('aba')\n// True\n// >>> is_palindrome('aaaaa')\n// True\n// >>> is_palindrome('zbcd')\n// False\nfunc is_palindrome(text string) bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "func TestIs_Palindrome(t *testing.T) {\n candidate := is_palindrome\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: true },\n { actual: candidate(\"aba\"), expected: true },\n { actual: candidate(\"aaaaa\"), expected: true },\n { actual: candidate(\"zbcd\"), expected: false },\n { actual: candidate(\"xywyx\"), expected: true },\n { actual: candidate(\"xywyz\"), expected: false },\n { actual: candidate(\"xywzx\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "go_test.go", - "prompt": "package derivative_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// xs represent coefficients of a polynomial.\n// xs[0] + xs[1] * x + xs[2] * x^2 + ....\n// Return derivative of this polynomial in the same form.\n// >>> derivative([3, 1, 2, 4, 5])\n// [1, 4, 12, 20]\n// >>> derivative([1, 2, 3])\n// [2, 6]\nfunc derivative(xs []int) []int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "func TestDerivative(t *testing.T) {\n candidate := derivative\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{3, 1, 2, 4, 5}), expected: []int{1, 4, 12, 20} },\n { actual: candidate([]int{1, 2, 3}), expected: []int{2, 6} },\n { actual: candidate([]int{3, 2, 1}), expected: []int{2, 2} },\n { actual: candidate([]int{3, 2, 1, 0, 4}), expected: []int{2, 2, 0, 16} },\n { actual: candidate([]int{1}), expected: []int{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "go_test.go", - "prompt": "package fruit_distribution_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// In this task, you will be given a string that represents a number of apples and oranges \n// that are distributed in a basket of fruit this basket contains \n// apples, oranges, and mango fruits. Given the string that represents the total number of \n// the oranges and apples and an integer that represent the total number of the fruits \n// in the basket return the number of the mango fruits in the basket.\n// for examble:\n// fruit_distribution(\"5 apples and 6 oranges\", 19) ->19 - 5 - 6 = 8\n// fruit_distribution(\"0 apples and 1 oranges\",3) -> 3 - 0 - 1 = 2\n// fruit_distribution(\"2 apples and 3 oranges\", 100) -> 100 - 2 - 3 = 95\n// fruit_distribution(\"100 apples and 1 oranges\",120) -> 120 - 100 - 1 = 19\nfunc fruit_distribution(s string, n int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "func TestFruit_Distribution(t *testing.T) {\n candidate := fruit_distribution\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"5 apples and 6 oranges\", 19), expected: 8 },\n { actual: candidate(\"5 apples and 6 oranges\", 21), expected: 10 },\n { actual: candidate(\"0 apples and 1 oranges\", 3), expected: 2 },\n { actual: candidate(\"1 apples and 0 oranges\", 3), expected: 2 },\n { actual: candidate(\"2 apples and 3 oranges\", 100), expected: 95 },\n { actual: candidate(\"2 apples and 3 oranges\", 5), expected: 0 },\n { actual: candidate(\"1 apples and 100 oranges\", 120), expected: 19 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "go_test.go", - "prompt": "package iscube_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that takes an integer a and returns True \n// if this ingeger is a cube of some integer number.\n// Note: you may assume the input is always valid.\n// Examples:\n// iscube(1) ==> True\n// iscube(2) ==> False\n// iscube(-1) ==> True\n// iscube(64) ==> True\n// iscube(0) ==> True\n// iscube(180) ==> False\nfunc iscube(a int) bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "func TestIscube(t *testing.T) {\n candidate := iscube\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(1), expected: true },\n { actual: candidate(2), expected: false },\n { actual: candidate(-1), expected: true },\n { actual: candidate(64), expected: true },\n { actual: candidate(180), expected: false },\n { actual: candidate(1000), expected: true },\n { actual: candidate(0), expected: true },\n { actual: candidate(1729), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "go_test.go", - "prompt": "package sort_array_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// In this Kata, you have to sort an array of non-negative integers according to\n// number of ones in their binary representation in ascending order.\n// For similar number of ones, sort based on decimal value.\n// It must be implemented like this:\n// >>> sort_array([1, 5, 2, 3, 4]) == [1, 2, 3, 4, 5]\n// >>> sort_array([-2, -3, -4, -5, -6]) == [-6, -5, -4, -3, -2]\n// >>> sort_array([1, 0, 2, 3, 4]) [0, 1, 2, 3, 4]\nfunc sort_array(arr []int) []int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "func TestSort_Array(t *testing.T) {\n candidate := sort_array\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 5, 2, 3, 4}), expected: []int{1, 2, 4, 3, 5} },\n { actual: candidate([]int{-2, -3, -4, -5, -6}), expected: []int{-4, -2, -6, -5, -3} },\n { actual: candidate([]int{1, 0, 2, 3, 4}), expected: []int{0, 1, 2, 4, 3} },\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4}), expected: []int{2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77} },\n { actual: candidate([]int{3, 6, 44, 12, 32, 5}), expected: []int{32, 3, 5, 6, 12, 44} },\n { actual: candidate([]int{2, 4, 8, 16, 32}), expected: []int{2, 4, 8, 16, 32} },\n { actual: candidate([]int{2, 4, 8, 16, 32}), expected: []int{2, 4, 8, 16, 32} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "go_test.go", - "prompt": "package odd_count_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a list of strings, where each string consists of only digits, return a list.\n// Each element i of the output should be \"the number of odd elements in the\n// string i of the input.\" where all the i's should be replaced by the number\n// of odd digits in the i'th string of the input.\n// >>> odd_count(['1234567'])\n// [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n// >>> odd_count(['3',\"11111111\"])\n// [\"the number of odd elements 1n the str1ng 1 of the 1nput.\",\n// \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\nfunc odd_count(lst []string) []string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "func TestOdd_Count(t *testing.T) {\n candidate := odd_count\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{\"1234567\"}), expected: []string{\"the number of odd elements 4n the str4ng 4 of the 4nput.\"} },\n { actual: candidate([]string{\"3\", \"11111111\"}), expected: []string{\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\"} },\n { actual: candidate([]string{\"271\", \"137\", \"314\"}), expected: []string{\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "go_test.go", - "prompt": "package correct_bracketing_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// brackets is a string of \"(\" and \")\".\n// return True if every opening bracket has a corresponding closing bracket.\n// >>> correct_bracketing(\"(\")\n// False\n// >>> correct_bracketing(\"()\")\n// True\n// >>> correct_bracketing(\"(()())\")\n// True\n// >>> correct_bracketing(\")(()\")\n// False\nfunc correct_bracketing(brackets string) bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "func TestCorrect_Bracketing(t *testing.T) {\n candidate := correct_bracketing\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"()\"), expected: true },\n { actual: candidate(\"(()())\"), expected: true },\n { actual: candidate(\"()()(()())()\"), expected: true },\n { actual: candidate(\"()()((()()())())(()()(()))\"), expected: true },\n { actual: candidate(\"((()())))\"), expected: false },\n { actual: candidate(\")(()\"), expected: false },\n { actual: candidate(\"(\"), expected: false },\n { actual: candidate(\"((((\"), expected: false },\n { actual: candidate(\")\"), expected: false },\n { actual: candidate(\"(()\"), expected: false },\n { actual: candidate(\"()()(()())())(()\"), expected: false },\n { actual: candidate(\"()()(()())()))()\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "go_test.go", - "prompt": "package digitSum_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Task\n// Write a function that takes a string as input and returns the sum of the upper characters only'\n// ASCII codes.\n// Examples:\n// digitSum(\"\") => 0\n// digitSum(\"abAB\") => 131\n// digitSum(\"abcCd\") => 67\n// digitSum(\"helloE\") => 69\n// digitSum(\"woArBld\") => 131\n// digitSum(\"aAaaaXa\") => 153\nfunc digitSum(s string) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "func TestDigitsum(t *testing.T) {\n candidate := digitSum\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: 0 },\n { actual: candidate(\"abAB\"), expected: 131 },\n { actual: candidate(\"abcCd\"), expected: 67 },\n { actual: candidate(\"helloE\"), expected: 69 },\n { actual: candidate(\"woArBld\"), expected: 131 },\n { actual: candidate(\"aAaaaXa\"), expected: 153 },\n { actual: candidate(\" How are yOu?\"), expected: 151 },\n { actual: candidate(\"You arE Very Smart\"), expected: 327 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "go_test.go", - "prompt": "package sorted_list_sum_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that accepts a list of strings as a parameter,\n// deletes the strings that have odd lengths from it,\n// and returns the resulted list with a sorted order,\n// The list is always a list of strings and never an array of numbers,\n// and it may contain duplicates.\n// The order of the list should be ascending by length of each word, and you\n// should return the list sorted by that rule.\n// If two words have the same length, sort the list alphabetically.\n// The function should return a list of strings in sorted order.\n// You may assume that all words will have the same length.\n// For example:\n// assert list_sort([\"aa\", \"a\", \"aaa\"]) => [\"aa\"]\n// assert list_sort([\"ab\", \"a\", \"aaa\", \"cd\"]) => [\"ab\", \"cd\"]\nfunc sorted_list_sum(lst []string) []string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "func TestSorted_List_Sum(t *testing.T) {\n candidate := sorted_list_sum\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{\"aa\", \"a\", \"aaa\"}), expected: []string{\"aa\"} },\n { actual: candidate([]string{\"school\", \"AI\", \"asdf\", \"b\"}), expected: []string{\"AI\", \"asdf\", \"school\"} },\n { actual: candidate([]string{\"d\", \"b\", \"c\", \"a\"}), expected: []string{} },\n { actual: candidate([]string{\"d\", \"dcba\", \"abcd\", \"a\"}), expected: []string{\"abcd\", \"dcba\"} },\n { actual: candidate([]string{\"AI\", \"ai\", \"au\"}), expected: []string{\"AI\", \"ai\", \"au\"} },\n { actual: candidate([]string{\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"}), expected: []string{} },\n { actual: candidate([]string{\"aaaa\", \"bbbb\", \"dd\", \"cc\"}), expected: []string{\"cc\", \"dd\", \"aaaa\", \"bbbb\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "go_test.go", - "prompt": "package incr_list_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return list with elements incremented by 1.\n// >>> incr_list([1, 2, 3])\n// [2, 3, 4]\n// >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123])\n// [6, 4, 6, 3, 4, 4, 10, 1, 124]\nfunc incr_list(l []int) []int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "func TestIncr_List(t *testing.T) {\n candidate := incr_list\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{3, 2, 1}), expected: []int{4, 3, 2} },\n { actual: candidate([]int{5, 2, 5, 2, 3, 3, 9, 0, 123}), expected: []int{6, 3, 6, 3, 4, 4, 10, 1, 124} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "go_test.go", - "prompt": "package rolling_max_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// From a given list of integers, generate a list of rolling maximum element found until given moment\n// in the sequence.\n// >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n// [1, 2, 3, 3, 3, 4, 4]\nfunc rolling_max(numbers []int) []int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "func TestRolling_Max(t *testing.T) {\n candidate := rolling_max\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{1, 2, 3, 4}), expected: []int{1, 2, 3, 4} },\n { actual: candidate([]int{4, 3, 2, 1}), expected: []int{4, 4, 4, 4} },\n { actual: candidate([]int{3, 2, 3, 100, 3}), expected: []int{3, 3, 3, 100, 100} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "go_test.go", - "prompt": "package separate_paren_groups_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n// separate those group into separate strings and return the list of those.\n// Separate groups are balanced (each open brace is properly closed) and not nested within each other\n// Ignore any spaces in the input string.\n// >>> separate_paren_groups('( ) (( )) (( )( ))')\n// ['()', '(())', '(()())']\nfunc separate_paren_groups(paren_string string) []string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "func TestSeparate_Paren_Groups(t *testing.T) {\n candidate := separate_paren_groups\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"(()()) ((())) () ((())()())\"), expected: []string{\"(()())\", \"((()))\", \"()\", \"((())()())\"} },\n { actual: candidate(\"() (()) ((())) (((())))\"), expected: []string{\"()\", \"(())\", \"((()))\", \"(((())))\"} },\n { actual: candidate(\"(()(())((())))\"), expected: []string{\"(()(())((())))\"} },\n { actual: candidate(\"( ) (( )) (( )( ))\"), expected: []string{\"()\", \"(())\", \"(()())\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "go_test.go", - "prompt": "package words_string_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You will be given a string of words separated by commas or spaces. Your task is\n// to split the string into words and return an array of the words.\n// For example:\n// words_string(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n// words_string(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\nfunc words_string(s string) []string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "func TestWords_String(t *testing.T) {\n candidate := words_string\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Hi, my name is John\"), expected: []string{\"Hi\", \"my\", \"name\", \"is\", \"John\"} },\n { actual: candidate(\"One, two, three, four, five, six\"), expected: []string{\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"} },\n { actual: candidate(\"Hi, my name\"), expected: []string{\"Hi\", \"my\", \"name\"} },\n { actual: candidate(\"One,, two, three, four, five, six,\"), expected: []string{\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"} },\n { actual: candidate(\"\"), expected: []string{} },\n { actual: candidate(\"ahmed , gamal\"), expected: []string{\"ahmed\", \"gamal\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "go_test.go", - "prompt": "package filter_integers_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Filter given list of any python values only for integers\n// >>> filter_integers(['a', 3.14, 5])\n// [5]\n// >>> filter_integers([1, 2, 3, 'abc', {}, []])\n// [1, 2, 3]\nfunc filter_integers(values []interface{}) []int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "func TestFilter_Integers(t *testing.T) {\n candidate := filter_integers\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]interface{}{}), expected: []int{} },\n { actual: candidate([]interface{}{4, map[interface{}]interface{}{}, []interface{}{}, 23.2, 9, \"adasd\"}), expected: []int{4, 9} },\n { actual: candidate([]interface{}{3, \"c\", 3, 3, \"a\", \"b\"}), expected: []int{3, 3, 3} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "go_test.go", - "prompt": "package sort_even_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// This function takes a list l and returns a list l' such that\n// l' is identical to l in the odd indicies, while its values at the even indicies are equal\n// to the values of the even indicies of l, but sorted.\n// >>> sort_even([1, 2, 3])\n// [1, 2, 3]\n// >>> sort_even([5, 6, 3, 4])\n// [3, 6, 5, 4]\nfunc sort_even(l []int) []int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "func TestSort_Even(t *testing.T) {\n candidate := sort_even\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 3}), expected: []int{1, 2, 3} },\n { actual: candidate([]int{5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10}), expected: []int{-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123} },\n { actual: candidate([]int{5, 8, -12, 4, 23, 2, 3, 11, 12, -10}), expected: []int{-12, 8, 3, 4, 5, 2, 12, 11, 23, -10} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_152_compare", - "language": "go_test.go", - "prompt": "package compare_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// I think we all remember that feeling when the result of some long-awaited\n// event is finally known. The feelings and thoughts you have at that moment are\n// definitely worth noting down and comparing.\n// Your task is to determine if a person correctly guessed the results of a number of matches.\n// You are given two arrays of scores and guesses of equal length, where each index shows a match. \n// Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n// the value is 0, and if not, the value is the absolute difference between the guess and the score.\n// example:\n// compare([1,2,3,4,5,1],[1,2,3,4,2,-2]) -> [0,0,0,0,3,3]\n// compare([0,5,0,0,0,4],[4,1,1,0,0,-2]) -> [4,4,1,0,0,6]\nfunc compare(game []int, guess []int) []int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "func TestCompare(t *testing.T) {\n candidate := compare\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 3, 4, 5, 1}, []int{1, 2, 3, 4, 2, -2}), expected: []int{0, 0, 0, 0, 3, 3} },\n { actual: candidate([]int{0, 0, 0, 0, 0, 0}, []int{0, 0, 0, 0, 0, 0}), expected: []int{0, 0, 0, 0, 0, 0} },\n { actual: candidate([]int{1, 2, 3}, []int{-1, -2, -3}), expected: []int{2, 4, 6} },\n { actual: candidate([]int{1, 2, 3, 5}, []int{-1, 2, 3, 4}), expected: []int{2, 0, 0, 1} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "go_test.go", - "prompt": "package even_odd_palindrome_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a positive integer n, return a tuple that has the number of even and odd\n// integer palindromes that fall within the range(1, n), inclusive.\n// Example 1:\n// Input: 3\n// Output: (1, 2)\n// Explanation:\n// Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n// Example 2:\n// Input: 12\n// Output: (4, 6)\n// Explanation:\n// Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n// Note:\n// 1. 1 <= n <= 10^3\n// 2. returned tuple has the number of even and odd integer palindromes respectively.\nfunc even_odd_palindrome(n int) []interface{} {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "func TestEven_Odd_Palindrome(t *testing.T) {\n candidate := even_odd_palindrome\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(123), expected: []interface{}{8, 13} },\n { actual: candidate(12), expected: []interface{}{4, 6} },\n { actual: candidate(3), expected: []interface{}{1, 2} },\n { actual: candidate(63), expected: []interface{}{6, 8} },\n { actual: candidate(25), expected: []interface{}{5, 6} },\n { actual: candidate(19), expected: []interface{}{4, 6} },\n { actual: candidate(9), expected: []interface{}{4, 5} },\n { actual: candidate(1), expected: []interface{}{0, 1} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "go_test.go", - "prompt": "package fib4_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fib4(0) -> 0\n// fib4(1) -> 0\n// fib4(2) -> 2\n// fib4(3) -> 0\n// fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n// Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n// >>> fib4(5)\n// 4\n// >>> fib4(6)\n// 8\n// >>> fib4(7)\n// 14\nfunc fib4(n int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "func TestFib4(t *testing.T) {\n candidate := fib4\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5), expected: 4 },\n { actual: candidate(8), expected: 28 },\n { actual: candidate(10), expected: 104 },\n { actual: candidate(12), expected: 386 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "go_test.go", - "prompt": "package generate_integers_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given two positive integers a and b, return the even digits between a\n// and b, in ascending order.\n// For example:\n// generate_integers(2, 8) => [2, 4, 6, 8]\n// generate_integers(8, 2) => [2, 4, 6, 8]\n// generate_integers(10, 14) => []\nfunc generate_integers(a int, b int) []int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "func TestGenerate_Integers(t *testing.T) {\n candidate := generate_integers\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(2, 10), expected: []int{2, 4, 6, 8} },\n { actual: candidate(10, 2), expected: []int{2, 4, 6, 8} },\n { actual: candidate(132, 2), expected: []int{2, 4, 6, 8} },\n { actual: candidate(17, 89), expected: []int{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "go_test.go", - "prompt": "package mean_absolute_deviation_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// For a given list of input numbers, calculate Mean Absolute Deviation\n// around the mean of this dataset.\n// Mean Absolute Deviation is the average absolute difference between each\n// element and a centerpoint (mean in this case):\n// MAD = average | x - x_mean |\n// >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n// 1.0\nfunc mean_absolute_deviation(numbers []float64) float64 {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "func TestMean_Absolute_Deviation(t *testing.T) {\n candidate := mean_absolute_deviation\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]float64{1.0, 2.0}), expected: 0.5 },\n { actual: candidate([]float64{1.0, 2.0, 3.0, 4.0}), expected: 1.0 },\n { actual: candidate([]float64{1.0, 2.0, 3.0, 4.0, 5.0}), expected: 1.2 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "go_test.go", - "prompt": "package encrypt_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function encrypt that takes a string as an argument and\n// returns a string encrypted with the alphabet being rotated. \n// The alphabet should be rotated in a manner such that the letters \n// shift down by two multiplied to two places.\n// For example:\n// encrypt('hi') returns 'lm'\n// encrypt('asdfghjkl') returns 'ewhjklnop'\n// encrypt('gf') returns 'kj'\n// encrypt('et') returns 'ix'\nfunc encrypt(s string) string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "func TestEncrypt(t *testing.T) {\n candidate := encrypt\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"hi\"), expected: \"lm\" },\n { actual: candidate(\"asdfghjkl\"), expected: \"ewhjklnop\" },\n { actual: candidate(\"gf\"), expected: \"kj\" },\n { actual: candidate(\"et\"), expected: \"ix\" },\n { actual: candidate(\"faewfawefaewg\"), expected: \"jeiajeaijeiak\" },\n { actual: candidate(\"hellomyfriend\"), expected: \"lippsqcjvmirh\" },\n { actual: candidate(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\"), expected: \"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\" },\n { actual: candidate(\"a\"), expected: \"e\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "go_test.go", - "prompt": "package get_odd_collatz_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n// The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n// as follows: start with any positive integer n. Then each term is obtained from the \n// previous term as follows: if the previous term is even, the next term is one half of \n// the previous term. If the previous term is odd, the next term is 3 times the previous\n// term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n// Note: \n// 1. Collatz(1) is [1].\n// 2. returned list sorted in increasing order.\n// For example:\n// get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\nfunc get_odd_collatz(n int) []int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "func TestGet_Odd_Collatz(t *testing.T) {\n candidate := get_odd_collatz\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(14), expected: []int{1, 5, 7, 11, 13, 17} },\n { actual: candidate(5), expected: []int{1, 5} },\n { actual: candidate(12), expected: []int{1, 3, 5} },\n { actual: candidate(1), expected: []int{1} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "go_test.go", - "prompt": "package how_many_times_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Find how many times a given substring can be found in the original string. Count overlaping cases.\n// >>> how_many_times('', 'a')\n// 0\n// >>> how_many_times('aaa', 'a')\n// 3\n// >>> how_many_times('aaaa', 'aa')\n// 3\nfunc how_many_times(myString string, substring string) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "func TestHow_Many_Times(t *testing.T) {\n candidate := how_many_times\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\", \"x\"), expected: 0 },\n { actual: candidate(\"xyxyxyx\", \"x\"), expected: 4 },\n { actual: candidate(\"cacacacac\", \"cac\"), expected: 4 },\n { actual: candidate(\"john doe\", \"john\"), expected: 1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "go_test.go", - "prompt": "package move_one_ball_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n// numbers in the array will be randomly ordered. Your task is to determine if\n// it is possible to get an array sorted in non-decreasing order by performing \n// the following operation on the given array:\n// You are allowed to perform right shift operation any number of times.\n// One right shift operation means shifting all elements of the array by one\n// position in the right direction. The last element of the array will be moved to\n// the starting position in the array i.e. 0th index. \n// If it is possible to obtain the sorted array by performing the above operation\n// then return True else return False.\n// If the given array is empty then return True.\n// Note: The given list is guaranteed to have unique elements.\n// For Example:\n// move_one_ball([3, 4, 5, 1, 2])==>True\n// Explanation: By performin 2 right shift operations, non-decreasing order can\n// be achieved for the given array.\n// move_one_ball([3, 5, 4, 1, 2])==>False\n// Explanation:It is not possible to get non-decreasing order for the given\n// array by performing any number of right shift operations.\nfunc move_one_ball(arr []int) bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "func TestMove_One_Ball(t *testing.T) {\n candidate := move_one_ball\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{3, 4, 5, 1, 2}), expected: true },\n { actual: candidate([]int{3, 5, 10, 1, 2}), expected: true },\n { actual: candidate([]int{4, 3, 1, 2}), expected: false },\n { actual: candidate([]int{3, 5, 4, 1, 2}), expected: false },\n { actual: candidate([]int{}), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "go_test.go", - "prompt": "package order_by_points_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function which sorts the given list of integers\n// in ascending order according to the sum of their digits.\n// Note: if there are several items with similar sum of their digits,\n// order them based on their index in original list.\n// For example:\n// >>> order_by_points([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]\n// >>> order_by_points([]) == []\nfunc order_by_points(nums []int) []int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "func TestOrder_By_Points(t *testing.T) {\n candidate := order_by_points\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 11, -1, -11, -12}), expected: []int{-1, -11, 1, -12, 11} },\n { actual: candidate([]int{1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46}), expected: []int{0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457} },\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{1, -11, -32, 43, 54, -98, 2, -3}), expected: []int{-3, -32, -98, -11, 1, 2, 43, 54} },\n { actual: candidate([]int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}), expected: []int{1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9} },\n { actual: candidate([]int{0, 6, 6, -76, -21, 23, 4}), expected: []int{-76, -21, 0, 4, 23, 6, 6} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "go_test.go", - "prompt": "package factorize_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return list of prime factors of given integer in the order from smallest to largest.\n// Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n// Input number should be equal to the product of all factors\n// >>> factorize(8)\n// [2, 2, 2]\n// >>> factorize(25)\n// [5, 5]\n// >>> factorize(70)\n// [2, 5, 7]\nfunc factorize(n int) []int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "func TestFactorize(t *testing.T) {\n candidate := factorize\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(2), expected: []int{2} },\n { actual: candidate(4), expected: []int{2, 2} },\n { actual: candidate(8), expected: []int{2, 2, 2} },\n { actual: candidate(57), expected: []int{3, 19} },\n { actual: candidate(3249), expected: []int{3, 3, 19, 19} },\n { actual: candidate(185193), expected: []int{3, 3, 3, 19, 19, 19} },\n { actual: candidate(20577), expected: []int{3, 19, 19, 19} },\n { actual: candidate(18), expected: []int{2, 3, 3} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "go_test.go", - "prompt": "package below_threshold_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return True if all numbers in the list l are below threshold t.\n// >>> below_threshold([1, 2, 4, 10], 100)\n// True\n// >>> below_threshold([1, 20, 4, 10], 5)\n// False\nfunc below_threshold(l []int, t int) bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "func TestBelow_Threshold(t *testing.T) {\n candidate := below_threshold\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 4, 10}, 100), expected: true },\n { actual: candidate([]int{1, 20, 4, 10}, 5), expected: false },\n { actual: candidate([]int{1, 20, 4, 10}, 21), expected: true },\n { actual: candidate([]int{1, 20, 4, 10}, 22), expected: true },\n { actual: candidate([]int{1, 8, 4, 10}, 11), expected: true },\n { actual: candidate([]int{1, 8, 4, 10}, 10), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "go_test.go", - "prompt": "package parse_nested_parens_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n// For each of the group, output the deepest level of nesting of parentheses.\n// E.g. (()()) has maximum two levels of nesting while ((())) has three.\n// >>> parse_nested_parens('(()()) ((())) () ((())()())')\n// [2, 3, 1, 3]\nfunc parse_nested_parens(paren_string string) []int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "func TestParse_Nested_Parens(t *testing.T) {\n candidate := parse_nested_parens\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"(()()) ((())) () ((())()())\"), expected: []int{2, 3, 1, 3} },\n { actual: candidate(\"() (()) ((())) (((())))\"), expected: []int{1, 2, 3, 4} },\n { actual: candidate(\"(()(())((())))\"), expected: []int{4} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_121_solution", - "language": "go_test.go", - "prompt": "package solution_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n// Examples\n// solution([5, 8, 7, 1]) ==> 12\n// solution([3, 3, 3, 3, 3]) ==> 9\n// solution([30, 13, 24, 321]) ==>0\nfunc solution(lst []int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "func TestSolution(t *testing.T) {\n candidate := solution\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{5, 8, 7, 1}), expected: 12 },\n { actual: candidate([]int{3, 3, 3, 3, 3}), expected: 9 },\n { actual: candidate([]int{30, 13, 24, 321}), expected: 0 },\n { actual: candidate([]int{5, 9}), expected: 5 },\n { actual: candidate([]int{2, 4, 8}), expected: 0 },\n { actual: candidate([]int{30, 13, 23, 32}), expected: 23 },\n { actual: candidate([]int{3, 13, 2, 9}), expected: 3 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "go_test.go", - "prompt": "package get_max_triples_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a positive integer n. You have to create an integer array a of length n.\n// For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n// Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n// and a[i] + a[j] + a[k] is a multiple of 3.\n// Example :\n// Input: n = 5\n// Output: 1\n// Explanation: \n// a = [1, 3, 7, 13, 21]\n// The only valid triple is (1, 7, 13).\nfunc get_max_triples(n int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "func TestGet_Max_Triples(t *testing.T) {\n candidate := get_max_triples\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5), expected: 1 },\n { actual: candidate(6), expected: 4 },\n { actual: candidate(10), expected: 36 },\n { actual: candidate(100), expected: 53361 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_148_bf", - "language": "go_test.go", - "prompt": "package bf_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// There are eight planets in our solar system: the closerst to the Sun \n// is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n// Uranus, Neptune.\n// Write a function that takes two planet names as strings planet1 and planet2. \n// The function should return a tuple containing all planets whose orbits are \n// located between the orbit of planet1 and the orbit of planet2, sorted by \n// the proximity to the sun. \n// The function should return an empty tuple if planet1 or planet2\n// are not correct planet names. \n// Examples\n// bf(\"Jupiter\", \"Neptune\") ==> (\"Saturn\", \"Uranus\")\n// bf(\"Earth\", \"Mercury\") ==> (\"Venus\")\n// bf(\"Mercury\", \"Uranus\") ==> (\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\")\nfunc bf(planet1 string, planet2 string) []interface{} {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "func TestBf(t *testing.T) {\n candidate := bf\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Jupiter\", \"Neptune\"), expected: []interface{}{\"Saturn\", \"Uranus\"} },\n { actual: candidate(\"Earth\", \"Mercury\"), expected: []interface{}{\"Venus\"} },\n { actual: candidate(\"Mercury\", \"Uranus\"), expected: []interface{}{\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"} },\n { actual: candidate(\"Neptune\", \"Venus\"), expected: []interface{}{\"Earth\", \"Mars\", \"Jupiter\", \"Saturn\", \"Uranus\"} },\n { actual: candidate(\"Earth\", \"Earth\"), expected: []interface{}{} },\n { actual: candidate(\"Mars\", \"Earth\"), expected: []interface{}{} },\n { actual: candidate(\"Jupiter\", \"Makemake\"), expected: []interface{}{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "go_test.go", - "prompt": "package sort_numbers_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Input is a space-delimited string of numberals from 'zero' to 'nine'.\n// Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n// Return the string with numbers sorted from smallest to largest\n// >>> sort_numbers('three one five')\n// 'one three five'\nfunc sort_numbers(numbers string) string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "func TestSort_Numbers(t *testing.T) {\n candidate := sort_numbers\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: \"\" },\n { actual: candidate(\"three\"), expected: \"three\" },\n { actual: candidate(\"three five nine\"), expected: \"three five nine\" },\n { actual: candidate(\"five zero four seven nine eight\"), expected: \"zero four five seven eight nine\" },\n { actual: candidate(\"six five four three two one zero\"), expected: \"zero one two three four five six\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "go_test.go", - "prompt": "package cycpattern_check_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n// cycpattern_check(\"abcd\",\"abd\") => False\n// cycpattern_check(\"hello\",\"ell\") => True\n// cycpattern_check(\"whassup\",\"psus\") => False\n// cycpattern_check(\"abab\",\"baa\") => True\n// cycpattern_check(\"efef\",\"eeff\") => False\n// cycpattern_check(\"himenss\",\"simen\") => True\nfunc cycpattern_check(a string, b string) bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "func TestCycpattern_Check(t *testing.T) {\n candidate := cycpattern_check\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"xyzw\", \"xyw\"), expected: false },\n { actual: candidate(\"yello\", \"ell\"), expected: true },\n { actual: candidate(\"whattup\", \"ptut\"), expected: false },\n { actual: candidate(\"efef\", \"fee\"), expected: true },\n { actual: candidate(\"abab\", \"aabb\"), expected: false },\n { actual: candidate(\"winemtt\", \"tinem\"), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "go_test.go", - "prompt": "package decimal_to_binary_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You will be given a number in decimal form and your task is to convert it to\n// binary format. The function should return a string, with each character representing a binary\n// number. Each character in the string will be '0' or '1'.\n// There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n// The extra characters are there to help with the format.\n// Examples:\n// decimal_to_binary(15) # returns \"db1111db\"\n// decimal_to_binary(32) # returns \"db100000db\"\nfunc decimal_to_binary(decimal int) string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "func TestDecimal_To_Binary(t *testing.T) {\n candidate := decimal_to_binary\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(0), expected: \"db0db\" },\n { actual: candidate(32), expected: \"db100000db\" },\n { actual: candidate(103), expected: \"db1100111db\" },\n { actual: candidate(15), expected: \"db1111db\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "go_test.go", - "prompt": "package filter_by_substring_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Filter an input list of strings only for ones that contain given substring\n// >>> filter_by_substring([], 'a')\n// []\n// >>> filter_by_substring(['abc', 'bacd', 'cde', 'array'], 'a')\n// ['abc', 'bacd', 'array']\nfunc filter_by_substring(strings []string, substring string) []string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "func TestFilter_By_Substring(t *testing.T) {\n candidate := filter_by_substring\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{}, \"john\"), expected: []string{} },\n { actual: candidate([]string{\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"}, \"xxx\"), expected: []string{\"xxx\", \"xxxAAA\", \"xxx\"} },\n { actual: candidate([]string{\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"}, \"xx\"), expected: []string{\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"} },\n { actual: candidate([]string{\"grunt\", \"trumpet\", \"prune\", \"gruesome\"}, \"run\"), expected: []string{\"grunt\", \"prune\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "go_test.go", - "prompt": "package even_odd_count_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given an integer. return a tuple that has the number of even and odd digits respectively.\n// Example:\n// even_odd_count(-12) ==> (1, 1)\n// even_odd_count(123) ==> (1, 2)\nfunc even_odd_count(num int) []interface{} {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "func TestEven_Odd_Count(t *testing.T) {\n candidate := even_odd_count\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(7), expected: []interface{}{0, 1} },\n { actual: candidate(-78), expected: []interface{}{1, 1} },\n { actual: candidate(3452), expected: []interface{}{2, 2} },\n { actual: candidate(346211), expected: []interface{}{3, 3} },\n { actual: candidate(-345821), expected: []interface{}{3, 3} },\n { actual: candidate(-2), expected: []interface{}{1, 0} },\n { actual: candidate(-45347), expected: []interface{}{2, 3} },\n { actual: candidate(0), expected: []interface{}{1, 0} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "go_test.go", - "prompt": "package find_max_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that accepts a list of strings.\n// The list contains different words. Return the word with maximum number\n// of unique characters. If multiple strings have maximum number of unique\n// characters, return the one which comes first in lexicographical order.\n// find_max([\"name\", \"of\", \"string\"]) == \"string\"\n// find_max([\"name\", \"enam\", \"game\"]) == \"enam\"\n// find_max([\"aaaaaaa\", \"bb\" ,\"cc\"]) == \"\"aaaaaaa\"\nfunc find_max(words []string) string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "func TestFind_Max(t *testing.T) {\n candidate := find_max\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{\"name\", \"of\", \"string\"}), expected: \"string\" },\n { actual: candidate([]string{\"name\", \"enam\", \"game\"}), expected: \"enam\" },\n { actual: candidate([]string{\"aaaaaaa\", \"bb\", \"cc\"}), expected: \"aaaaaaa\" },\n { actual: candidate([]string{\"abc\", \"cba\"}), expected: \"abc\" },\n { actual: candidate([]string{\"play\", \"this\", \"game\", \"of\", \"footbott\"}), expected: \"footbott\" },\n { actual: candidate([]string{\"we\", \"are\", \"gonna\", \"rock\"}), expected: \"gonna\" },\n { actual: candidate([]string{\"we\", \"are\", \"a\", \"mad\", \"nation\"}), expected: \"nation\" },\n { actual: candidate([]string{\"this\", \"is\", \"a\", \"prrk\"}), expected: \"this\" },\n { actual: candidate([]string{\"b\"}), expected: \"b\" },\n { actual: candidate([]string{\"play\", \"play\", \"play\"}), expected: \"play\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "go_test.go", - "prompt": "package starts_one_ends_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a positive integer n, return the count of the numbers of n-digit\n// positive integers that start or end with 1.\nfunc starts_one_ends(n int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": "func TestStarts_One_Ends(t *testing.T) {\n candidate := starts_one_ends\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(1), expected: 1 },\n { actual: candidate(2), expected: 18 },\n { actual: candidate(3), expected: 180 },\n { actual: candidate(4), expected: 1800 },\n { actual: candidate(5), expected: 18000 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "go_test.go", - "prompt": "package largest_smallest_integers_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function that returns a tuple (a, b), where 'a' is\n// the largest of negative integers, and 'b' is the smallest\n// of positive integers in a list.\n// If there is no negative or positive integers, return them as None.\n// Examples:\n// largest_smallest_integers([2, 4, 1, 3, 5, 7]) == (None, 1)\n// largest_smallest_integers([]) == (None, None)\n// largest_smallest_integers([0]) == (None, None)\nfunc largest_smallest_integers(lst []int) []interface{} {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "func TestLargest_Smallest_Integers(t *testing.T) {\n candidate := largest_smallest_integers\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{2, 4, 1, 3, 5, 7}), expected: []interface{}{nil, 1} },\n { actual: candidate([]int{2, 4, 1, 3, 5, 7, 0}), expected: []interface{}{nil, 1} },\n { actual: candidate([]int{1, 3, 2, 4, 5, 6, -2}), expected: []interface{}{-2, 1} },\n { actual: candidate([]int{4, 5, 3, 6, 2, 7, -7}), expected: []interface{}{-7, 2} },\n { actual: candidate([]int{7, 3, 8, 4, 9, 2, 5, -9}), expected: []interface{}{-9, 2} },\n { actual: candidate([]int{}), expected: []interface{}{nil, nil} },\n { actual: candidate([]int{0}), expected: []interface{}{nil, nil} },\n { actual: candidate([]int{-1, -3, -5, -6}), expected: []interface{}{-1, nil} },\n { actual: candidate([]int{-1, -3, -5, -6, 0}), expected: []interface{}{-1, nil} },\n { actual: candidate([]int{-6, -4, -4, -3, 1}), expected: []interface{}{-3, 1} },\n { actual: candidate([]int{-6, -4, -4, -3, -100, 1}), expected: []interface{}{-3, 1} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "go_test.go", - "prompt": "package pluck_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// \"Given an array representing a branch of a tree that has non-negative integer nodes\n// your task is to pluck one of the nodes and return it.\n// The plucked node should be the node with the smallest even value.\n// If multiple nodes with the same smallest even value are found return the node that has smallest index.\n// The plucked node should be returned in a list, [ smalest_value, its index ],\n// If there are no even values or the given array is empty, return [].\n// Example 1:\n// Input: [4,2,3]\n// Output: [2, 1]\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 2:\n// Input: [1,2,3]\n// Output: [2, 1]\n// Explanation: 2 has the smallest even value, and 2 has the smallest index. \n// Example 3:\n// Input: []\n// Output: []\n// Example 4:\n// Input: [5, 0, 3, 0, 4, 2]\n// Output: [0, 1]\n// Explanation: 0 is the smallest value, but there are two zeros,\n// so we will choose the first zero, which has the smallest index.\n// Constraints:\n// * 1 <= nodes.length <= 10000\n// * 0 <= node.value\nfunc pluck(arr []int) []int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "func TestPluck(t *testing.T) {\n candidate := pluck\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{4, 2, 3}), expected: []int{2, 1} },\n { actual: candidate([]int{1, 2, 3}), expected: []int{2, 1} },\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{5, 0, 3, 0, 4, 2}), expected: []int{0, 1} },\n { actual: candidate([]int{1, 2, 3, 0, 5, 3}), expected: []int{0, 3} },\n { actual: candidate([]int{5, 4, 8, 4, 8}), expected: []int{4, 1} },\n { actual: candidate([]int{7, 6, 7, 1}), expected: []int{6, 1} },\n { actual: candidate([]int{7, 9, 7, 1}), expected: []int{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "go_test.go", - "prompt": "package count_nums_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function count_nums which takes an array of integers and returns\n// the number of elements which has a sum of digits > 0.\n// If a number is negative, then its first signed digit will be negative:\n// e.g. -123 has signed digits -1, 2, and 3.\n// >>> count_nums([]) == 0\n// >>> count_nums([-1, 11, -11]) == 1\n// >>> count_nums([1, 1, 2]) == 3\nfunc count_nums(arr []int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "func TestCount_Nums(t *testing.T) {\n candidate := count_nums\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}), expected: 0 },\n { actual: candidate([]int{-1, -2, 0}), expected: 0 },\n { actual: candidate([]int{1, 1, 2, -2, 3, 4, 5}), expected: 6 },\n { actual: candidate([]int{1, 6, 9, -6, 0, 1, 5}), expected: 5 },\n { actual: candidate([]int{1, 100, 98, -7, 1, -1}), expected: 4 },\n { actual: candidate([]int{12, 23, 34, -45, -56, 0}), expected: 5 },\n { actual: candidate([]int{0, 1}), expected: 1 },\n { actual: candidate([]int{1}), expected: 1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "go_test.go", - "prompt": "package minPath_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n// each cell of the grid contains a value. Every integer in the range [1, N * N]\n// inclusive appears exactly once on the cells of the grid.\n// You have to find the minimum path of length k in the grid. You can start\n// from any cell, and in each step you can move to any of the neighbor cells,\n// in other words, you can go to cells which share an edge with you current\n// cell.\n// Please note that a path of length k means visiting exactly k cells (not\n// necessarily distinct).\n// You CANNOT go off the grid.\n// A path A (of length k) is considered less than a path B (of length k) if\n// after making the ordered lists of the values on the cells that A and B go\n// through (let's call them lst_A and lst_B), lst_A is lexicographically less\n// than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n// such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n// lst_A[j] = lst_B[j].\n// It is guaranteed that the answer is unique.\n// Return an ordered list of the values on the cells that the minimum path go through.\n// Examples:\n// Input: grid = [ [1,2,3], [4,5,6], [7,8,9]], k = 3\n// Output: [1, 2, 1]\n// Input: grid = [ [5,9,3], [4,1,6], [7,8,2]], k = 1\n// Output: [1]\nfunc minPath(grid [][]int, k int) []int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "func TestMinpath(t *testing.T) {\n candidate := minPath\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([][]int{[]int{1, 2, 3}, []int{4, 5, 6}, []int{7, 8, 9}}, 3), expected: []int{1, 2, 1} },\n { actual: candidate([][]int{[]int{5, 9, 3}, []int{4, 1, 6}, []int{7, 8, 2}}, 1), expected: []int{1} },\n { actual: candidate([][]int{[]int{1, 2, 3, 4}, []int{5, 6, 7, 8}, []int{9, 10, 11, 12}, []int{13, 14, 15, 16}}, 4), expected: []int{1, 2, 1, 2} },\n { actual: candidate([][]int{[]int{6, 4, 13, 10}, []int{5, 7, 12, 1}, []int{3, 16, 11, 15}, []int{8, 14, 9, 2}}, 7), expected: []int{1, 10, 1, 10, 1, 10, 1} },\n { actual: candidate([][]int{[]int{8, 14, 9, 2}, []int{6, 4, 13, 15}, []int{5, 7, 1, 12}, []int{3, 10, 11, 16}}, 5), expected: []int{1, 7, 1, 7, 1} },\n { actual: candidate([][]int{[]int{11, 8, 7, 2}, []int{5, 16, 14, 4}, []int{9, 3, 15, 6}, []int{12, 13, 10, 1}}, 9), expected: []int{1, 6, 1, 6, 1, 6, 1, 6, 1} },\n { actual: candidate([][]int{[]int{12, 13, 10, 1}, []int{9, 3, 15, 6}, []int{5, 16, 14, 4}, []int{11, 8, 7, 2}}, 12), expected: []int{1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6} },\n { actual: candidate([][]int{[]int{2, 7, 4}, []int{3, 1, 5}, []int{6, 8, 9}}, 8), expected: []int{1, 3, 1, 3, 1, 3, 1, 3} },\n { actual: candidate([][]int{[]int{6, 1, 5}, []int{3, 8, 9}, []int{2, 7, 4}}, 8), expected: []int{1, 5, 1, 5, 1, 5, 1, 5} },\n { actual: candidate([][]int{[]int{1, 2}, []int{3, 4}}, 10), expected: []int{1, 2, 1, 2, 1, 2, 1, 2, 1, 2} },\n { actual: candidate([][]int{[]int{1, 3}, []int{3, 2}}, 10), expected: []int{1, 3, 1, 3, 1, 3, 1, 3, 1, 3} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "go_test.go", - "prompt": "package strange_sort_list_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given list of integers, return list in strange order.\n// Strange sorting, is when you start with the minimum value,\n// then maximum of the remaining integers, then minimum and so on.\n// Examples:\n// strange_sort_list([1, 2, 3, 4]) == [1, 4, 2, 3]\n// strange_sort_list([5, 5, 5, 5]) == [5, 5, 5, 5]\n// strange_sort_list([]) == []\nfunc strange_sort_list(lst []int) []int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "func TestStrange_Sort_List(t *testing.T) {\n candidate := strange_sort_list\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 3, 4}), expected: []int{1, 4, 2, 3} },\n { actual: candidate([]int{5, 6, 7, 8, 9}), expected: []int{5, 9, 6, 8, 7} },\n { actual: candidate([]int{1, 2, 3, 4, 5}), expected: []int{1, 5, 2, 4, 3} },\n { actual: candidate([]int{5, 6, 7, 8, 9, 1}), expected: []int{1, 9, 5, 8, 6, 7} },\n { actual: candidate([]int{5, 5, 5, 5}), expected: []int{5, 5, 5, 5} },\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{1, 2, 3, 4, 5, 6, 7, 8}), expected: []int{1, 8, 2, 7, 3, 6, 4, 5} },\n { actual: candidate([]int{0, 2, 2, 2, 5, 5, -5, -5}), expected: []int{-5, 5, -5, 5, 0, 2, 2, 2} },\n { actual: candidate([]int{111111}), expected: []int{111111} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "go_test.go", - "prompt": "package get_closest_vowel_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a word. Your task is to find the closest vowel that stands between \n// two consonants from the right side of the word (case sensitive).\n// Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n// find any vowel met the above condition. \n// You may assume that the given string contains English letter only.\n// Example:\n// get_closest_vowel(\"yogurt\") ==> \"u\"\n// get_closest_vowel(\"FULL\") ==> \"U\"\n// get_closest_vowel(\"quick\") ==> \"\"\n// get_closest_vowel(\"ab\") ==> \"\"\nfunc get_closest_vowel(word string) string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "func TestGet_Closest_Vowel(t *testing.T) {\n candidate := get_closest_vowel\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"yogurt\"), expected: \"u\" },\n { actual: candidate(\"full\"), expected: \"u\" },\n { actual: candidate(\"easy\"), expected: \"\" },\n { actual: candidate(\"eAsy\"), expected: \"\" },\n { actual: candidate(\"ali\"), expected: \"\" },\n { actual: candidate(\"bad\"), expected: \"a\" },\n { actual: candidate(\"most\"), expected: \"o\" },\n { actual: candidate(\"ab\"), expected: \"\" },\n { actual: candidate(\"ba\"), expected: \"\" },\n { actual: candidate(\"quick\"), expected: \"\" },\n { actual: candidate(\"anime\"), expected: \"i\" },\n { actual: candidate(\"Asia\"), expected: \"\" },\n { actual: candidate(\"Above\"), expected: \"o\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "go_test.go", - "prompt": "package change_base_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Change numerical base of input number x to base.\n// return string representation after the conversion.\n// base numbers are less than 10.\n// >>> change_base(8, 3)\n// '22'\n// >>> change_base(8, 2)\n// '1000'\n// >>> change_base(7, 2)\n// '111'\nfunc change_base(x int, base int) string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "func TestChange_Base(t *testing.T) {\n candidate := change_base\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(8, 3), expected: \"22\" },\n { actual: candidate(9, 3), expected: \"100\" },\n { actual: candidate(234, 2), expected: \"11101010\" },\n { actual: candidate(16, 2), expected: \"10000\" },\n { actual: candidate(8, 2), expected: \"1000\" },\n { actual: candidate(7, 2), expected: \"111\" },\n { actual: candidate(2, 3), expected: \"2\" },\n { actual: candidate(3, 4), expected: \"3\" },\n { actual: candidate(4, 5), expected: \"4\" },\n { actual: candidate(5, 6), expected: \"5\" },\n { actual: candidate(6, 7), expected: \"6\" },\n { actual: candidate(7, 8), expected: \"7\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "go_test.go", - "prompt": "package has_close_elements_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Check if in given list of numbers, are any two numbers closer to each other than\n// given threshold.\n// >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n// False\n// >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n// True\nfunc has_close_elements(numbers []float64, threshold float64) bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "func TestHas_Close_Elements(t *testing.T) {\n candidate := has_close_elements\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]float64{1.0, 2.0, 3.9, 4.0, 5.0, 2.2}, 0.3), expected: true },\n { actual: candidate([]float64{1.0, 2.0, 3.9, 4.0, 5.0, 2.2}, 0.05), expected: false },\n { actual: candidate([]float64{1.0, 2.0, 5.9, 4.0, 5.0}, 0.95), expected: true },\n { actual: candidate([]float64{1.0, 2.0, 5.9, 4.0, 5.0}, 0.8), expected: false },\n { actual: candidate([]float64{1.0, 2.0, 3.0, 4.0, 5.0, 2.0}, 0.1), expected: true },\n { actual: candidate([]float64{1.1, 2.2, 3.1, 4.1, 5.1}, 1.0), expected: true },\n { actual: candidate([]float64{1.1, 2.2, 3.1, 4.1, 5.1}, 0.5), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "go_test.go", - "prompt": "package is_nested_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function that takes a string as input which contains only square brackets.\n// The function should return True if and only if there is a valid subsequence of brackets \n// where at least one bracket in the subsequence is nested.\n// is_nested('[[]]') \u279e True\n// is_nested('[]]]]]]][[[[[]') \u279e False\n// is_nested('[][]') \u279e False\n// is_nested('[]') \u279e False\n// is_nested('[[][]]') \u279e True\n// is_nested('[[]][[') \u279e True\nfunc is_nested(myString string) bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "func TestIs_Nested(t *testing.T) {\n candidate := is_nested\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"[[]]\"), expected: true },\n { actual: candidate(\"[]]]]]]][[[[[]\"), expected: false },\n { actual: candidate(\"[][]\"), expected: false },\n { actual: candidate(\"[]\"), expected: false },\n { actual: candidate(\"[[[[]]]]\"), expected: true },\n { actual: candidate(\"[]]]]]]]]]]\"), expected: false },\n { actual: candidate(\"[][][[]]\"), expected: true },\n { actual: candidate(\"[[]\"), expected: false },\n { actual: candidate(\"[]]\"), expected: false },\n { actual: candidate(\"[[]][[\"), expected: true },\n { actual: candidate(\"[[][]]\"), expected: true },\n { actual: candidate(\"\"), expected: false },\n { actual: candidate(\"[[[[[[[[\"), expected: false },\n { actual: candidate(\"]]]]]]]]\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "go_test.go", - "prompt": "package concatenate_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Concatenate list of strings into a single string\n// >>> concatenate([])\n// ''\n// >>> concatenate(['a', 'b', 'c'])\n// 'abc'\nfunc concatenate(strings []string) string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "func TestConcatenate(t *testing.T) {\n candidate := concatenate\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{}), expected: \"\" },\n { actual: candidate([]string{\"x\", \"y\", \"z\"}), expected: \"xyz\" },\n { actual: candidate([]string{\"x\", \"y\", \"z\", \"w\", \"k\"}), expected: \"xyzwk\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "go_test.go", - "prompt": "package prime_fib_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n// >>> prime_fib(1)\n// 2\n// >>> prime_fib(2)\n// 3\n// >>> prime_fib(3)\n// 5\n// >>> prime_fib(4)\n// 13\n// >>> prime_fib(5)\n// 89\nfunc prime_fib(n int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "func TestPrime_Fib(t *testing.T) {\n candidate := prime_fib\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(1), expected: 2 },\n { actual: candidate(2), expected: 3 },\n { actual: candidate(3), expected: 5 },\n { actual: candidate(4), expected: 13 },\n { actual: candidate(5), expected: 89 },\n { actual: candidate(6), expected: 233 },\n { actual: candidate(7), expected: 1597 },\n { actual: candidate(8), expected: 28657 },\n { actual: candidate(9), expected: 514229 },\n { actual: candidate(10), expected: 433494437 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "go_test.go", - "prompt": "package find_closest_elements_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n// other and return them in order (smaller number, larger number).\n// >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n// (2.0, 2.2)\n// >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n// (2.0, 2.0)\nfunc find_closest_elements(numbers []float64) []interface{} {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "func TestFind_Closest_Elements(t *testing.T) {\n candidate := find_closest_elements\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]float64{1.0, 2.0, 3.9, 4.0, 5.0, 2.2}), expected: []interface{}{3.9, 4.0} },\n { actual: candidate([]float64{1.0, 2.0, 5.9, 4.0, 5.0}), expected: []interface{}{5.0, 5.9} },\n { actual: candidate([]float64{1.0, 2.0, 3.0, 4.0, 5.0, 2.2}), expected: []interface{}{2.0, 2.2} },\n { actual: candidate([]float64{1.0, 2.0, 3.0, 4.0, 5.0, 2.0}), expected: []interface{}{2.0, 2.0} },\n { actual: candidate([]float64{1.1, 2.2, 3.1, 4.1, 5.1}), expected: []interface{}{2.2, 3.1} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "go_test.go", - "prompt": "package hex_key_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You have been tasked to write a function that receives \n// a hexadecimal number as a string and counts the number of hexadecimal \n// digits that are primes (prime number, or a prime, is a natural number \n// greater than 1 that is not a product of two smaller natural numbers).\n// Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n// Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n// So you have to determine a number of the following digits: 2, 3, 5, 7, \n// B (=decimal 11), D (=decimal 13).\n// Note: you may assume the input is always correct or empty string, \n// and symbols A,B,C,D,E,F are always uppercase.\n// Examples:\n// For num = \"AB\" the output should be 1.\n// For num = \"1077E\" the output should be 2.\n// For num = \"ABED1A33\" the output should be 4.\n// For num = \"123456789ABCDEF0\" the output should be 6.\n// For num = \"2020\" the output should be 2.\nfunc hex_key(num string) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "func TestHex_Key(t *testing.T) {\n candidate := hex_key\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"AB\"), expected: 1 },\n { actual: candidate(\"1077E\"), expected: 2 },\n { actual: candidate(\"ABED1A33\"), expected: 4 },\n { actual: candidate(\"2020\"), expected: 2 },\n { actual: candidate(\"123456789ABCDEF0\"), expected: 6 },\n { actual: candidate(\"112233445566778899AABBCCDDEEFF00\"), expected: 12 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "go_test.go", - "prompt": "package multiply_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Complete the function that takes two integers and returns \n// the product of their unit digits.\n// Assume the input is always valid.\n// Examples:\n// multiply(148, 412) should return 16.\n// multiply(19, 28) should return 72.\n// multiply(2020, 1851) should return 0.\n// multiply(14,-15) should return 20.\nfunc multiply(a int, b int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "func TestMultiply(t *testing.T) {\n candidate := multiply\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(148, 412), expected: 16 },\n { actual: candidate(19, 28), expected: 72 },\n { actual: candidate(2020, 1851), expected: 0 },\n { actual: candidate(14, -15), expected: 20 },\n { actual: candidate(76, 67), expected: 42 },\n { actual: candidate(17, 27), expected: 49 },\n { actual: candidate(0, 1), expected: 0 },\n { actual: candidate(0, 0), expected: 0 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "go_test.go", - "prompt": "package rescale_to_unit_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given list of numbers (of at least two elements), apply a linear transform to that list,\n// such that the smallest number will become 0 and the largest will become 1\n// >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n// [0.0, 0.25, 0.5, 0.75, 1.0]\nfunc rescale_to_unit(numbers []float64) []float64 {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "func TestRescale_To_Unit(t *testing.T) {\n candidate := rescale_to_unit\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]float64{2.0, 49.9}), expected: []float64{0.0, 1.0} },\n { actual: candidate([]float64{100.0, 49.9}), expected: []float64{1.0, 0.0} },\n { actual: candidate([]float64{1.0, 2.0, 3.0, 4.0, 5.0}), expected: []float64{0.0, 0.25, 0.5, 0.75, 1.0} },\n { actual: candidate([]float64{2.0, 1.0, 5.0, 3.0, 4.0}), expected: []float64{0.25, 0.0, 1.0, 0.5, 0.75} },\n { actual: candidate([]float64{12.0, 11.0, 15.0, 13.0, 14.0}), expected: []float64{0.25, 0.0, 1.0, 0.5, 0.75} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_131_digits", - "language": "go_test.go", - "prompt": "package digits_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a positive integer n, return the product of the odd digits.\n// Return 0 if all digits are even.\n// For example:\n// digits(1) == 1\n// digits(4) == 0\n// digits(235) == 15\nfunc digits(n int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "func TestDigits(t *testing.T) {\n candidate := digits\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5), expected: 5 },\n { actual: candidate(54), expected: 5 },\n { actual: candidate(120), expected: 1 },\n { actual: candidate(5014), expected: 5 },\n { actual: candidate(98765), expected: 315 },\n { actual: candidate(5576543), expected: 2625 },\n { actual: candidate(2468), expected: 0 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "go_test.go", - "prompt": "package Strongest_Extension_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You will be given the name of a class (a string) and a list of extensions.\n// The extensions are to be used to load additional classes to the class. The\n// strength of the extension is as follows: Let CAP be the number of the uppercase\n// letters in the extension's name, and let SM be the number of lowercase letters \n// in the extension's name, the strength is given by the fraction CAP - SM. \n// You should find the strongest extension and return a string in this \n// format: ClassName.StrongestExtensionName.\n// If there are two or more extensions with the same strength, you should\n// choose the one that comes first in the list.\n// For example, if you are given \"Slices\" as the class and a list of the\n// extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n// return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n// (its strength is -1).\n// Example:\n// for Strongest_Extension('my_class', ['AA', 'Be', 'CC']) == 'my_class.AA'\nfunc Strongest_Extension(class_name string, extensions []string) string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "func TestStrongest_Extension(t *testing.T) {\n candidate := Strongest_Extension\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Watashi\", []string{\"tEN\", \"niNE\", \"eIGHt8OKe\"}), expected: \"Watashi.eIGHt8OKe\" },\n { actual: candidate(\"Boku123\", []string{\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"}), expected: \"Boku123.YEs.WeCaNe\" },\n { actual: candidate(\"__YESIMHERE\", []string{\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"}), expected: \"__YESIMHERE.NuLl__\" },\n { actual: candidate(\"K\", []string{\"Ta\", \"TAR\", \"t234An\", \"cosSo\"}), expected: \"K.TAR\" },\n { actual: candidate(\"__HAHA\", []string{\"Tab\", \"123\", \"781345\", \"-_-\"}), expected: \"__HAHA.123\" },\n { actual: candidate(\"YameRore\", []string{\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"}), expected: \"YameRore.okIWILL123\" },\n { actual: candidate(\"finNNalLLly\", []string{\"Die\", \"NowW\", \"Wow\", \"WoW\"}), expected: \"finNNalLLly.WoW\" },\n { actual: candidate(\"_\", []string{\"Bb\", \"91245\"}), expected: \"_.Bb\" },\n { actual: candidate(\"Sp\", []string{\"671235\", \"Bb\"}), expected: \"Sp.671235\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "go_test.go", - "prompt": "package histogram_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a string representing a space separated lowercase letters, return a dictionary\n// of the letter with the most repetition and containing the corresponding count.\n// If several letters have the same occurrence, return all of them.\n// Example:\n// histogram('a b c') == {'a': 1, 'b': 1, 'c': 1}\n// histogram('a b b a') == {'a': 2, 'b': 2}\n// histogram('a b c a b') == {'a': 2, 'b': 2}\n// histogram('b b b b a') == {'b': 4}\n// histogram('') == {}\nfunc histogram(test string) map[string]int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "func TestHistogram(t *testing.T) {\n candidate := histogram\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"a b b a\"), expected: map[string]int{\"a\": 2, \"b\": 2} },\n { actual: candidate(\"a b c a b\"), expected: map[string]int{\"a\": 2, \"b\": 2} },\n { actual: candidate(\"a b c d g\"), expected: map[string]int{\"a\": 1, \"b\": 1, \"c\": 1, \"d\": 1, \"g\": 1} },\n { actual: candidate(\"r t g\"), expected: map[string]int{\"r\": 1, \"t\": 1, \"g\": 1} },\n { actual: candidate(\"b b b b a\"), expected: map[string]int{\"b\": 4} },\n { actual: candidate(\"r t g\"), expected: map[string]int{\"r\": 1, \"t\": 1, \"g\": 1} },\n { actual: candidate(\"\"), expected: map[string]int{} },\n { actual: candidate(\"a\"), expected: map[string]int{\"a\": 1} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "go_test.go", - "prompt": "package pairs_sum_to_zero_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// pairs_sum_to_zero takes a list of integers as an input.\n// it returns True if there are two distinct elements in the list that\n// sum to zero, and False otherwise.\n// >>> pairs_sum_to_zero([1, 3, 5, 0])\n// False\n// >>> pairs_sum_to_zero([1, 3, -2, 1])\n// False\n// >>> pairs_sum_to_zero([1, 2, 3, 7])\n// False\n// >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7])\n// True\n// >>> pairs_sum_to_zero([1])\n// False\nfunc pairs_sum_to_zero(l []int) bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "func TestPairs_Sum_To_Zero(t *testing.T) {\n candidate := pairs_sum_to_zero\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 3, 5, 0}), expected: false },\n { actual: candidate([]int{1, 3, -2, 1}), expected: false },\n { actual: candidate([]int{1, 2, 3, 7}), expected: false },\n { actual: candidate([]int{2, 4, -5, 3, 5, 7}), expected: true },\n { actual: candidate([]int{1}), expected: false },\n { actual: candidate([]int{-3, 9, -1, 3, 2, 30}), expected: true },\n { actual: candidate([]int{-3, 9, -1, 3, 2, 31}), expected: true },\n { actual: candidate([]int{-3, 9, -1, 4, 2, 30}), expected: false },\n { actual: candidate([]int{-3, 9, -1, 4, 2, 31}), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "go_test.go", - "prompt": "package total_match_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that accepts two lists of strings and returns the list that has \n// total number of chars in the all strings of the list less than the other list.\n// if the two lists have the same number of chars, return the first list.\n// Examples\n// total_match([], []) \u279e []\n// total_match(['hi', 'admin'], ['hI', 'Hi']) \u279e ['hI', 'Hi']\n// total_match(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) \u279e ['hi', 'admin']\n// total_match(['hi', 'admin'], ['hI', 'hi', 'hi']) \u279e ['hI', 'hi', 'hi']\n// total_match(['4'], ['1', '2', '3', '4', '5']) \u279e ['4']\nfunc total_match(lst1 []string, lst2 []string) []string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "func TestTotal_Match(t *testing.T) {\n candidate := total_match\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{}, []string{}), expected: []string{} },\n { actual: candidate([]string{\"hi\", \"admin\"}, []string{\"hi\", \"hi\"}), expected: []string{\"hi\", \"hi\"} },\n { actual: candidate([]string{\"hi\", \"admin\"}, []string{\"hi\", \"hi\", \"admin\", \"project\"}), expected: []string{\"hi\", \"admin\"} },\n { actual: candidate([]string{\"4\"}, []string{\"1\", \"2\", \"3\", \"4\", \"5\"}), expected: []string{\"4\"} },\n { actual: candidate([]string{\"hi\", \"admin\"}, []string{\"hI\", \"Hi\"}), expected: []string{\"hI\", \"Hi\"} },\n { actual: candidate([]string{\"hi\", \"admin\"}, []string{\"hI\", \"hi\", \"hi\"}), expected: []string{\"hI\", \"hi\", \"hi\"} },\n { actual: candidate([]string{\"hi\", \"admin\"}, []string{\"hI\", \"hi\", \"hii\"}), expected: []string{\"hi\", \"admin\"} },\n { actual: candidate([]string{}, []string{\"this\"}), expected: []string{} },\n { actual: candidate([]string{\"this\"}, []string{}), expected: []string{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "go_test.go", - "prompt": "package circular_shift_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Circular shift the digits of the integer x, shift the digits right by shift\n// and return the result as a string.\n// If shift > number of digits, return digits reversed.\n// >>> circular_shift(12, 1)\n// \"21\"\n// >>> circular_shift(12, 2)\n// \"12\"\nfunc circular_shift(x int, shift int) string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "func TestCircular_Shift(t *testing.T) {\n candidate := circular_shift\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(100, 2), expected: \"001\" },\n { actual: candidate(12, 2), expected: \"12\" },\n { actual: candidate(97, 8), expected: \"79\" },\n { actual: candidate(12, 1), expected: \"21\" },\n { actual: candidate(11, 101), expected: \"11\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "go_test.go", - "prompt": "package monotonic_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return True is list elements are monotonically increasing or decreasing.\n// >>> monotonic([1, 2, 4, 20])\n// True\n// >>> monotonic([1, 20, 4, 10])\n// False\n// >>> monotonic([4, 1, 0, -10])\n// True\nfunc monotonic(l []int) bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "func TestMonotonic(t *testing.T) {\n candidate := monotonic\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 4, 10}), expected: true },\n { actual: candidate([]int{1, 2, 4, 20}), expected: true },\n { actual: candidate([]int{1, 20, 4, 10}), expected: false },\n { actual: candidate([]int{4, 1, 0, -10}), expected: true },\n { actual: candidate([]int{4, 1, 1, 0}), expected: true },\n { actual: candidate([]int{1, 2, 3, 2, 5, 60}), expected: false },\n { actual: candidate([]int{1, 2, 3, 4, 5, 60}), expected: true },\n { actual: candidate([]int{9, 9, 9, 9}), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "go_test.go", - "prompt": "package is_equal_to_sum_even_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n// Example\n// is_equal_to_sum_even(4) == False\n// is_equal_to_sum_even(6) == False\n// is_equal_to_sum_even(8) == True\nfunc is_equal_to_sum_even(n int) bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "func TestIs_Equal_To_Sum_Even(t *testing.T) {\n candidate := is_equal_to_sum_even\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(4), expected: false },\n { actual: candidate(6), expected: false },\n { actual: candidate(8), expected: true },\n { actual: candidate(10), expected: true },\n { actual: candidate(11), expected: false },\n { actual: candidate(12), expected: true },\n { actual: candidate(13), expected: false },\n { actual: candidate(16), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "go_test.go", - "prompt": "package parse_music_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Input to this function is a string representing musical notes in a special ASCII format.\n// Your task is to parse this string and return list of integers corresponding to how many beats does each\n// not last.\n// Here is a legend:\n// 'o' - whole note, lasts four beats\n// 'o|' - half note, lasts two beats\n// '.|' - quater note, lasts one beat\n// >>> parse_music('o o| .| o| o| .| .| .| .| o o')\n// [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\nfunc parse_music(music_string string) []int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "func TestParse_Music(t *testing.T) {\n candidate := parse_music\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: []int{} },\n { actual: candidate(\"o o o o\"), expected: []int{4, 4, 4, 4} },\n { actual: candidate(\".| .| .| .|\"), expected: []int{1, 1, 1, 1} },\n { actual: candidate(\"o| o| .| .| o o o o\"), expected: []int{2, 2, 1, 1, 4, 4, 4, 4} },\n { actual: candidate(\"o| .| o| .| o o| o o|\"), expected: []int{2, 1, 2, 1, 4, 2, 4, 2} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "go_test.go", - "prompt": "package sum_squares_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// \"\n// This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n// multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n// change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n// Examples:\n// For lst = [1,2,3] the output should be 6\n// For lst = [] the output should be 0\n// For lst = [-1,-5,2,-1,-5] the output should be -126\nfunc sum_squares(lst []int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "func TestSum_Squares(t *testing.T) {\n candidate := sum_squares\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 3}), expected: 6 },\n { actual: candidate([]int{1, 4, 9}), expected: 14 },\n { actual: candidate([]int{}), expected: 0 },\n { actual: candidate([]int{1, 1, 1, 1, 1, 1, 1, 1, 1}), expected: 9 },\n { actual: candidate([]int{-1, -1, -1, -1, -1, -1, -1, -1, -1}), expected: -3 },\n { actual: candidate([]int{0}), expected: 0 },\n { actual: candidate([]int{-1, -5, 2, -1, -5}), expected: -126 },\n { actual: candidate([]int{-56, -99, 1, 0, -2}), expected: 3030 },\n { actual: candidate([]int{-1, 0, 0, 0, 0, 0, 0, 0, -1}), expected: 0 },\n { actual: candidate([]int{-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37}), expected: -14196 },\n { actual: candidate([]int{-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10}), expected: -1448 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "go_test.go", - "prompt": "package triples_sum_to_zero_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// triples_sum_to_zero takes a list of integers as an input.\n// it returns True if there are three distinct elements in the list that\n// sum to zero, and False otherwise.\n// >>> triples_sum_to_zero([1, 3, 5, 0])\n// False\n// >>> triples_sum_to_zero([1, 3, -2, 1])\n// True\n// >>> triples_sum_to_zero([1, 2, 3, 7])\n// False\n// >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n// True\n// >>> triples_sum_to_zero([1])\n// False\nfunc triples_sum_to_zero(l []int) bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "func TestTriples_Sum_To_Zero(t *testing.T) {\n candidate := triples_sum_to_zero\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 3, 5, 0}), expected: false },\n { actual: candidate([]int{1, 3, 5, -1}), expected: false },\n { actual: candidate([]int{1, 3, -2, 1}), expected: true },\n { actual: candidate([]int{1, 2, 3, 7}), expected: false },\n { actual: candidate([]int{1, 2, 5, 7}), expected: false },\n { actual: candidate([]int{2, 4, -5, 3, 9, 7}), expected: true },\n { actual: candidate([]int{1}), expected: false },\n { actual: candidate([]int{1, 3, 5, -100}), expected: false },\n { actual: candidate([]int{100, 3, 5, -100}), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "go_test.go", - "prompt": "package correct_bracketing_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// brackets is a string of \"<\" and \">\".\n// return True if every opening bracket has a corresponding closing bracket.\n// >>> correct_bracketing(\"<\")\n// False\n// >>> correct_bracketing(\"<>\")\n// True\n// >>> correct_bracketing(\"<<><>>\")\n// True\n// >>> correct_bracketing(\"><<>\")\n// False\nfunc correct_bracketing(brackets string) bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "func TestCorrect_Bracketing(t *testing.T) {\n candidate := correct_bracketing\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"<>\"), expected: true },\n { actual: candidate(\"<<><>>\"), expected: true },\n { actual: candidate(\"<><><<><>><>\"), expected: true },\n { actual: candidate(\"<><><<<><><>><>><<><><<>>>\"), expected: true },\n { actual: candidate(\"<<<><>>>>\"), expected: false },\n { actual: candidate(\"><<>\"), expected: false },\n { actual: candidate(\"<\"), expected: false },\n { actual: candidate(\"<<<<\"), expected: false },\n { actual: candidate(\">\"), expected: false },\n { actual: candidate(\"<<>\"), expected: false },\n { actual: candidate(\"<><><<><>><>><<>\"), expected: false },\n { actual: candidate(\"<><><<><>><>>><>\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "go_test.go", - "prompt": "package specialFilter_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that takes an array of numbers as input and returns \n// the number of elements in the array that are greater than 10 and both \n// first and last digits of a number are odd (1, 3, 5, 7, 9).\n// For example:\n// specialFilter([15, -73, 14, -15]) => 1 \n// specialFilter([33, -2, -3, 45, 21, 109]) => 2\nfunc specialFilter(nums []int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "func TestSpecialfilter(t *testing.T) {\n candidate := specialFilter\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{5, -2, 1, -5}), expected: 0 },\n { actual: candidate([]int{15, -73, 14, -15}), expected: 1 },\n { actual: candidate([]int{33, -2, -3, 45, 21, 109}), expected: 2 },\n { actual: candidate([]int{43, -12, 93, 125, 121, 109}), expected: 4 },\n { actual: candidate([]int{71, -2, -33, 75, 21, 19}), expected: 3 },\n { actual: candidate([]int{1}), expected: 0 },\n { actual: candidate([]int{}), expected: 0 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "go_test.go", - "prompt": "package check_dict_case_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a dictionary, return True if all keys are strings in lower \n// case or all keys are strings in upper case, else return False.\n// The function should return False is the given dictionary is empty.\n// Examples:\n// check_dict_case({\"a\":\"apple\", \"b\":\"banana\"}) should return True.\n// check_dict_case({\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}) should return False.\n// check_dict_case({\"a\":\"apple\", \"8\":\"banana\", \"a\":\"apple\"}) should return False.\n// check_dict_case({\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}) should return False.\n// check_dict_case({\"STATE\":\"NC\", \"ZIP\":\"12345\" }) should return True.\nfunc check_dict_case(dict map[string]string) bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "func TestCheck_Dict_Case(t *testing.T) {\n candidate := check_dict_case\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(map[string]string{\"p\": \"pineapple\", \"b\": \"banana\"}), expected: true },\n { actual: candidate(map[string]string{\"p\": \"pineapple\", \"A\": \"banana\", \"B\": \"banana\"}), expected: false },\n { actual: candidate(map[string]string{\"p\": \"pineapple\", \"5\": \"banana\", \"a\": \"apple\"}), expected: false },\n { actual: candidate(map[string]string{\"Name\": \"John\", \"Age\": \"36\", \"City\": \"Houston\"}), expected: false },\n { actual: candidate(map[string]string{\"STATE\": \"NC\", \"ZIP\": \"12345\"}), expected: true },\n { actual: candidate(map[string]string{\"fruit\": \"Orange\", \"taste\": \"Sweet\"}), expected: true },\n { actual: candidate(map[string]string{}), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "go_test.go", - "prompt": "package fibfib_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fibfib(0) == 0\n// fibfib(1) == 0\n// fibfib(2) == 1\n// fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n// Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n// >>> fibfib(1)\n// 0\n// >>> fibfib(5)\n// 4\n// >>> fibfib(8)\n// 24\nfunc fibfib(n int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "func TestFibfib(t *testing.T) {\n candidate := fibfib\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(2), expected: 1 },\n { actual: candidate(1), expected: 0 },\n { actual: candidate(5), expected: 4 },\n { actual: candidate(8), expected: 24 },\n { actual: candidate(10), expected: 81 },\n { actual: candidate(12), expected: 274 },\n { actual: candidate(14), expected: 927 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "go_test.go", - "prompt": "package sum_squares_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a list of numbers.\n// You need to return the sum of squared numbers in the given list,\n// round each element in the list to the upper int(Ceiling) first.\n// Examples:\n// For lst = [1,2,3] the output should be 14\n// For lst = [1,4,9] the output should be 98\n// For lst = [1,3,5,7] the output should be 84\n// For lst = [1.4,4.2,0] the output should be 29\n// For lst = [-2.4,1,1] the output should be 6\nfunc sum_squares(lst []float64) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "func TestSum_Squares(t *testing.T) {\n candidate := sum_squares\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]float64{1.0, 2.0, 3.0}), expected: 14 },\n { actual: candidate([]float64{1.0, 2.0, 3.0}), expected: 14 },\n { actual: candidate([]float64{1.0, 3.0, 5.0, 7.0}), expected: 84 },\n { actual: candidate([]float64{1.4, 4.2, 0.0}), expected: 29 },\n { actual: candidate([]float64{-2.4, 1.0, 1.0}), expected: 6 },\n { actual: candidate([]float64{100.0, 1.0, 15.0, 2.0}), expected: 10230 },\n { actual: candidate([]float64{10000.0, 10000.0}), expected: 200000000 },\n { actual: candidate([]float64{-1.4, 4.6, 6.3}), expected: 75 },\n { actual: candidate([]float64{-1.4, 17.9, 18.9, 19.9}), expected: 1086 },\n { actual: candidate([]float64{0.0}), expected: 0 },\n { actual: candidate([]float64{-1.0}), expected: 1 },\n { actual: candidate([]float64{-1.0, 1.0, 0.0}), expected: 2 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_85_add", - "language": "go_test.go", - "prompt": "package add_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a non-empty list of integers lst. add the even elements that are at odd indices..\n// Examples:\n// add([4, 2, 6, 7]) ==> 2\nfunc add(lst []int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "func TestAdd(t *testing.T) {\n candidate := add\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{4, 88}), expected: 88 },\n { actual: candidate([]int{4, 5, 6, 7, 2, 122}), expected: 122 },\n { actual: candidate([]int{4, 0, 6, 7}), expected: 0 },\n { actual: candidate([]int{4, 4, 6, 8}), expected: 12 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_34_unique", - "language": "go_test.go", - "prompt": "package unique_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return sorted unique elements in a list\n// >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123])\n// [0, 2, 3, 5, 9, 123]\nfunc unique(l []int) []int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "func TestUnique(t *testing.T) {\n candidate := unique\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{5, 3, 5, 2, 3, 3, 9, 0, 123}), expected: []int{0, 2, 3, 5, 9, 123} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "go_test.go", - "prompt": "package fix_spaces_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a string text, replace all spaces in it with underscores, \n// and if a string has more than 2 consecutive spaces, \n// then replace all consecutive spaces with - \n// fix_spaces(\"Example\") == \"Example\"\n// fix_spaces(\"Example 1\") == \"Example_1\"\n// fix_spaces(\" Example 2\") == \"_Example_2\"\n// fix_spaces(\" Example 3\") == \"_Example-3\"\nfunc fix_spaces(text string) string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "func TestFix_Spaces(t *testing.T) {\n candidate := fix_spaces\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Example\"), expected: \"Example\" },\n { actual: candidate(\"Mudasir Hanif \"), expected: \"Mudasir_Hanif_\" },\n { actual: candidate(\"Yellow Yellow Dirty Fellow\"), expected: \"Yellow_Yellow__Dirty__Fellow\" },\n { actual: candidate(\"Exa mple\"), expected: \"Exa-mple\" },\n { actual: candidate(\" Exa 1 2 2 mple\"), expected: \"-Exa_1_2_2_mple\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_49_modp", - "language": "go_test.go", - "prompt": "package modp_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return 2^n modulo p (be aware of numerics).\n// >>> modp(3, 5)\n// 3\n// >>> modp(1101, 101)\n// 2\n// >>> modp(0, 101)\n// 1\n// >>> modp(3, 11)\n// 8\n// >>> modp(100, 101)\n// 1\nfunc modp(n int, p int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "func TestModp(t *testing.T) {\n candidate := modp\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3, 5), expected: 3 },\n { actual: candidate(1101, 101), expected: 2 },\n { actual: candidate(0, 101), expected: 1 },\n { actual: candidate(3, 11), expected: 8 },\n { actual: candidate(100, 101), expected: 1 },\n { actual: candidate(30, 5), expected: 4 },\n { actual: candidate(31, 5), expected: 3 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "go_test.go", - "prompt": "package valid_date_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You have to write a function which validates a given date string and\n// returns True if the date is valid otherwise False.\n// The date is valid if all of the following rules are satisfied:\n// 1. The date string is not empty.\n// 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n// 3. The months should not be less than 1 or higher than 12.\n// 4. The date should be in the format: mm-dd-yyyy\n// for example: \n// valid_date('03-11-2000') => True\n// valid_date('15-01-2012') => False\n// valid_date('04-0-2040') => False\n// valid_date('06-04-2020') => True\n// valid_date('06/04/2020') => False\nfunc valid_date(date string) bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "func TestValid_Date(t *testing.T) {\n candidate := valid_date\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"03-11-2000\"), expected: true },\n { actual: candidate(\"15-01-2012\"), expected: false },\n { actual: candidate(\"04-0-2040\"), expected: false },\n { actual: candidate(\"06-04-2020\"), expected: true },\n { actual: candidate(\"01-01-2007\"), expected: true },\n { actual: candidate(\"03-32-2011\"), expected: false },\n { actual: candidate(\"\"), expected: false },\n { actual: candidate(\"04-31-3000\"), expected: false },\n { actual: candidate(\"06-06-2005\"), expected: true },\n { actual: candidate(\"21-31-2000\"), expected: false },\n { actual: candidate(\"04-12-2003\"), expected: true },\n { actual: candidate(\"04122003\"), expected: false },\n { actual: candidate(\"20030412\"), expected: false },\n { actual: candidate(\"2003-04\"), expected: false },\n { actual: candidate(\"2003-04-12\"), expected: false },\n { actual: candidate(\"04-2003\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "go_test.go", - "prompt": "package anti_shuffle_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that takes a string and returns an ordered version of it.\n// Ordered version of string, is a string where all words (separated by space)\n// are replaced by a new word where all the characters arranged in\n// ascending order based on ascii value.\n// Note: You should keep the order of words and blank spaces in the sentence.\n// For example:\n// anti_shuffle('Hi') returns 'Hi'\n// anti_shuffle('hello') returns 'ehllo'\n// anti_shuffle('Hello World!!!') returns 'Hello !!!Wdlor'\nfunc anti_shuffle(s string) string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "func TestAnti_Shuffle(t *testing.T) {\n candidate := anti_shuffle\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Hi\"), expected: \"Hi\" },\n { actual: candidate(\"hello\"), expected: \"ehllo\" },\n { actual: candidate(\"number\"), expected: \"bemnru\" },\n { actual: candidate(\"abcd\"), expected: \"abcd\" },\n { actual: candidate(\"Hello World!!!\"), expected: \"Hello !!!Wdlor\" },\n { actual: candidate(\"\"), expected: \"\" },\n { actual: candidate(\"Hi. My name is Mister Robot. How are you?\"), expected: \".Hi My aemn is Meirst .Rboot How aer ?ouy\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "go_test.go", - "prompt": "package is_sorted_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a list of numbers, return whether or not they are sorted\n// in ascending order. If list has more than 1 duplicate of the same\n// number, return False. Assume no negative numbers and only integers.\n// Examples\n// is_sorted([5]) \u279e True\n// is_sorted([1, 2, 3, 4, 5]) \u279e True\n// is_sorted([1, 3, 2, 4, 5]) \u279e False\n// is_sorted([1, 2, 3, 4, 5, 6]) \u279e True\n// is_sorted([1, 2, 3, 4, 5, 6, 7]) \u279e True\n// is_sorted([1, 3, 2, 4, 5, 6, 7]) \u279e False\n// is_sorted([1, 2, 2, 3, 3, 4]) \u279e True\n// is_sorted([1, 2, 2, 2, 3, 4]) \u279e False\nfunc is_sorted(lst []int) bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "func TestIs_Sorted(t *testing.T) {\n candidate := is_sorted\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{5}), expected: true },\n { actual: candidate([]int{1, 2, 3, 4, 5}), expected: true },\n { actual: candidate([]int{1, 3, 2, 4, 5}), expected: false },\n { actual: candidate([]int{1, 2, 3, 4, 5, 6}), expected: true },\n { actual: candidate([]int{1, 2, 3, 4, 5, 6, 7}), expected: true },\n { actual: candidate([]int{1, 3, 2, 4, 5, 6, 7}), expected: false },\n { actual: candidate([]int{}), expected: true },\n { actual: candidate([]int{1}), expected: true },\n { actual: candidate([]int{3, 2, 1}), expected: false },\n { actual: candidate([]int{1, 2, 2, 2, 3, 4}), expected: false },\n { actual: candidate([]int{1, 2, 3, 3, 3, 4}), expected: false },\n { actual: candidate([]int{1, 2, 2, 3, 3, 4}), expected: true },\n { actual: candidate([]int{1, 2, 3, 4}), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "go_test.go", - "prompt": "package is_happy_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a string s.\n// Your task is to check if the string is happy or not.\n// A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n// For example:\n// is_happy(a) => False\n// is_happy(aa) => False\n// is_happy(abcd) => True\n// is_happy(aabb) => False\n// is_happy(adb) => True\n// is_happy(xyy) => False\nfunc is_happy(s string) bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "func TestIs_Happy(t *testing.T) {\n candidate := is_happy\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"a\"), expected: false },\n { actual: candidate(\"aa\"), expected: false },\n { actual: candidate(\"abcd\"), expected: true },\n { actual: candidate(\"aabb\"), expected: false },\n { actual: candidate(\"adb\"), expected: true },\n { actual: candidate(\"xyy\"), expected: false },\n { actual: candidate(\"iopaxpoi\"), expected: true },\n { actual: candidate(\"iopaxioi\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "go_test.go", - "prompt": "package will_it_fly_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that returns True if the object q will fly, and False otherwise.\n// The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n// Example:\n// will_it_fly([1, 2], 5) \u279e False \n// # 1+2 is less than the maximum possible weight, but it's unbalanced.\n// will_it_fly([3, 2, 3], 1) \u279e False\n// # it's balanced, but 3+2+3 is more than the maximum possible weight.\n// will_it_fly([3, 2, 3], 9) \u279e True\n// # 3+2+3 is less than the maximum possible weight, and it's balanced.\n// will_it_fly([3], 5) \u279e True\n// # 3 is less than the maximum possible weight, and it's balanced.\nfunc will_it_fly(q []int, w int) bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "func TestWill_It_Fly(t *testing.T) {\n candidate := will_it_fly\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{3, 2, 3}, 9), expected: true },\n { actual: candidate([]int{1, 2}, 5), expected: false },\n { actual: candidate([]int{3}, 5), expected: true },\n { actual: candidate([]int{3, 2, 3}, 1), expected: false },\n { actual: candidate([]int{1, 2, 3}, 6), expected: false },\n { actual: candidate([]int{5}, 5), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "go_test.go", - "prompt": "package sort_array_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given an array of non-negative integers, return a copy of the given array after sorting,\n// you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n// or sort it in descending order if the sum( first index value, last index value) is even.\n// Note:\n// * don't change the given array.\n// Examples:\n// * sort_array([]) => []\n// * sort_array([5]) => [5]\n// * sort_array([2, 4, 3, 0, 1, 5]) => [0, 1, 2, 3, 4, 5]\n// * sort_array([2, 4, 3, 0, 1, 5, 6]) => [6, 5, 4, 3, 2, 1, 0]\nfunc sort_array(array []int) []int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "func TestSort_Array(t *testing.T) {\n candidate := sort_array\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{5}), expected: []int{5} },\n { actual: candidate([]int{2, 4, 3, 0, 1, 5}), expected: []int{0, 1, 2, 3, 4, 5} },\n { actual: candidate([]int{2, 4, 3, 0, 1, 5, 6}), expected: []int{6, 5, 4, 3, 2, 1, 0} },\n { actual: candidate([]int{2, 1}), expected: []int{1, 2} },\n { actual: candidate([]int{15, 42, 87, 32, 11, 0}), expected: []int{0, 11, 15, 32, 42, 87} },\n { actual: candidate([]int{21, 14, 23, 11}), expected: []int{23, 21, 14, 11} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "go_test.go", - "prompt": "package count_up_to_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Implement a function that takes an non-negative integer and returns an array of the first n\n// integers that are prime numbers and less than n.\n// for example:\n// count_up_to(5) => [2,3]\n// count_up_to(11) => [2,3,5,7]\n// count_up_to(0) => []\n// count_up_to(20) => [2,3,5,7,11,13,17,19]\n// count_up_to(1) => []\n// count_up_to(18) => [2,3,5,7,11,13,17]\nfunc count_up_to(n int) []int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "func TestCount_Up_To(t *testing.T) {\n candidate := count_up_to\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5), expected: []int{2, 3} },\n { actual: candidate(6), expected: []int{2, 3, 5} },\n { actual: candidate(7), expected: []int{2, 3, 5} },\n { actual: candidate(10), expected: []int{2, 3, 5, 7} },\n { actual: candidate(0), expected: []int{} },\n { actual: candidate(22), expected: []int{2, 3, 5, 7, 11, 13, 17, 19} },\n { actual: candidate(1), expected: []int{} },\n { actual: candidate(18), expected: []int{2, 3, 5, 7, 11, 13, 17} },\n { actual: candidate(47), expected: []int{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43} },\n { actual: candidate(101), expected: []int{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "go_test.go", - "prompt": "package by_length_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n// reverse the resulting array, and then replace each digit by its corresponding name from\n// \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n// For example:\n// arr = [2, 1, 1, 4, 5, 8, 2, 3] \n// -> sort arr -> [1, 1, 2, 2, 3, 4, 5, 8] \n// -> reverse arr -> [8, 5, 4, 3, 2, 2, 1, 1]\n// return [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n// If the array is empty, return an empty array:\n// arr = []\n// return []\n// If the array has any strange number ignore it:\n// arr = [1, -1 , 55] \n// -> sort arr -> [-1, 1, 55]\n// -> reverse arr -> [55, 1, -1]\n// return = ['One']\nfunc by_length(arr []int) []string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "func TestBy_Length(t *testing.T) {\n candidate := by_length\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{2, 1, 1, 4, 5, 8, 2, 3}), expected: []string{\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"} },\n { actual: candidate([]int{}), expected: []string{} },\n { actual: candidate([]int{1, -1, 55}), expected: []string{\"One\"} },\n { actual: candidate([]int{1, -1, 3, 2}), expected: []string{\"Three\", \"Two\", \"One\"} },\n { actual: candidate([]int{9, 4, 8}), expected: []string{\"Nine\", \"Eight\", \"Four\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_106_f", - "language": "go_test.go", - "prompt": "package f_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Implement the function f that takes n as a parameter,\n// 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\n// or the sum of numbers from 1 to i otherwise.\n// i starts from 1.\n// the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n// Example:\n// f(5) == [1, 2, 6, 24, 15]\nfunc f(n int) []int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "func TestF(t *testing.T) {\n candidate := f\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5), expected: []int{1, 2, 6, 24, 15} },\n { actual: candidate(7), expected: []int{1, 2, 6, 24, 15, 720, 28} },\n { actual: candidate(1), expected: []int{1} },\n { actual: candidate(3), expected: []int{1, 2, 6} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "go_test.go", - "prompt": "package fizz_buzz_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n// >>> fizz_buzz(50)\n// 0\n// >>> fizz_buzz(78)\n// 2\n// >>> fizz_buzz(79)\n// 3\nfunc fizz_buzz(n int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "func TestFizz_Buzz(t *testing.T) {\n candidate := fizz_buzz\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(50), expected: 0 },\n { actual: candidate(78), expected: 2 },\n { actual: candidate(79), expected: 3 },\n { actual: candidate(100), expected: 3 },\n { actual: candidate(200), expected: 6 },\n { actual: candidate(4000), expected: 192 },\n { actual: candidate(10000), expected: 639 },\n { actual: candidate(100000), expected: 8026 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "go_test.go", - "prompt": "package truncate_number_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a positive floating point number, it can be decomposed into\n// and integer part (largest integer smaller than given number) and decimals\n// (leftover part always smaller than 1).\n// Return the decimal part of the number.\n// >>> truncate_number(3.5)\n// 0.5\nfunc truncate_number(number float64) float64 {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "func TestTruncate_Number(t *testing.T) {\n candidate := truncate_number\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3.5), expected: 0.5 },\n { actual: candidate(1.25), expected: 0.25 },\n { actual: candidate(123.0), expected: 0.0 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "go_test.go", - "prompt": "package sum_product_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n// Empty sum should be equal to 0 and empty product should be equal to 1.\n// >>> sum_product([])\n// (0, 1)\n// >>> sum_product([1, 2, 3, 4])\n// (10, 24)\nfunc sum_product(numbers []int) []interface{} {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "func TestSum_Product(t *testing.T) {\n candidate := sum_product\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}), expected: []interface{}{0, 1} },\n { actual: candidate([]int{1, 1, 1}), expected: []interface{}{3, 1} },\n { actual: candidate([]int{100, 0}), expected: []interface{}{100, 0} },\n { actual: candidate([]int{3, 5, 7}), expected: []interface{}{15, 105} },\n { actual: candidate([]int{10}), expected: []interface{}{10, 10} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "go_test.go", - "prompt": "package get_row_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a 2 dimensional data, as a nested lists,\n// which is similar to matrix, however, unlike matrices,\n// each row may contain a different number of columns.\n// Given lst, and integer x, find integers x in the list,\n// and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n// each tuple is a coordinate - (row, columns), starting with 0.\n// Sort coordinates initially by rows in ascending order.\n// Also, sort coordinates of the row by columns in descending order.\n// Examples:\n// get_row([\n// [1,2,3,4,5,6],\n// [1,2,3,4,1,6],\n// [1,2,3,4,5,1]\n// ], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n// get_row([], 1) == []\n// get_row([[], [1], [1, 2, 3]], 3) == [(2, 2)]\nfunc get_row(lst [][]int, x int) [][]interface{} {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "func TestGet_Row(t *testing.T) {\n candidate := get_row\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([][]int{[]int{1, 2, 3, 4, 5, 6}, []int{1, 2, 3, 4, 1, 6}, []int{1, 2, 3, 4, 5, 1}}, 1), expected: [][]int{[]interface{}{0, 0}, []interface{}{1, 4}, []interface{}{1, 0}, []interface{}{2, 5}, []interface{}{2, 0}} },\n { actual: candidate([][]int{[]int{1, 2, 3, 4, 5, 6}, []int{1, 2, 3, 4, 5, 6}, []int{1, 2, 3, 4, 5, 6}, []int{1, 2, 3, 4, 5, 6}, []int{1, 2, 3, 4, 5, 6}, []int{1, 2, 3, 4, 5, 6}}, 2), expected: [][]int{[]interface{}{0, 1}, []interface{}{1, 1}, []interface{}{2, 1}, []interface{}{3, 1}, []interface{}{4, 1}, []interface{}{5, 1}} },\n { actual: candidate([][]int{[]int{1, 2, 3, 4, 5, 6}, []int{1, 2, 3, 4, 5, 6}, []int{1, 1, 3, 4, 5, 6}, []int{1, 2, 1, 4, 5, 6}, []int{1, 2, 3, 1, 5, 6}, []int{1, 2, 3, 4, 1, 6}, []int{1, 2, 3, 4, 5, 1}}, 1), expected: [][]int{[]interface{}{0, 0}, []interface{}{1, 0}, []interface{}{2, 1}, []interface{}{2, 0}, []interface{}{3, 2}, []interface{}{3, 0}, []interface{}{4, 3}, []interface{}{4, 0}, []interface{}{5, 4}, []interface{}{5, 0}, []interface{}{6, 5}, []interface{}{6, 0}} },\n { actual: candidate([][]int{}, 1), expected: [][]interface{}{} },\n { actual: candidate([][]int{[]int{1}}, 2), expected: [][]interface{}{} },\n { actual: candidate([]interface{}{[]interface{}{}, []int{1}, []int{1, 2, 3}}, 3), expected: [][]int{[]interface{}{2, 2}} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_159_eat", - "language": "go_test.go", - "prompt": "package eat_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You're a hungry rabbit, and you already have eaten a certain number of carrots,\n// but now you need to eat more carrots to complete the day's meals.\n// you should return an array of [ total number of eaten carrots after your meals,\n// the number of carrots left after your meals ]\n// if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n// Example:\n// * eat(5, 6, 10) -> [11, 4]\n// * eat(4, 8, 9) -> [12, 1]\n// * eat(1, 10, 10) -> [11, 0]\n// * eat(2, 11, 5) -> [7, 0]\n// Variables:\n// @number : integer\n// the number of carrots that you have eaten.\n// @need : integer\n// the number of carrots that you need to eat.\n// @remaining : integer\n// the number of remaining carrots thet exist in stock\n// Constrain:\n// * 0 <= number <= 1000\n// * 0 <= need <= 1000\n// * 0 <= remaining <= 1000\n// Have fun :)\nfunc eat(number int, need int, remaining int) []int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "func TestEat(t *testing.T) {\n candidate := eat\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5, 6, 10), expected: []int{11, 4} },\n { actual: candidate(4, 8, 9), expected: []int{12, 1} },\n { actual: candidate(1, 10, 10), expected: []int{11, 0} },\n { actual: candidate(2, 11, 5), expected: []int{7, 0} },\n { actual: candidate(4, 5, 7), expected: []int{9, 2} },\n { actual: candidate(4, 5, 1), expected: []int{5, 0} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_84_solve", - "language": "go_test.go", - "prompt": "package solve_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a positive integer N, return the total sum of its digits in binary.\n// Example\n// For N = 1000, the sum of digits will be 1 the output should be \"1\".\n// For N = 150, the sum of digits will be 6 the output should be \"110\".\n// For N = 147, the sum of digits will be 12 the output should be \"1100\".\n// Variables:\n// @N integer\n// Constraints: 0 \u2264 N \u2264 10000.\n// Output:\n// a string of binary number\nfunc solve(N int) string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "func TestSolve(t *testing.T) {\n candidate := solve\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(1000), expected: \"1\" },\n { actual: candidate(150), expected: \"110\" },\n { actual: candidate(147), expected: \"1100\" },\n { actual: candidate(333), expected: \"1001\" },\n { actual: candidate(963), expected: \"10010\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "go_test.go", - "prompt": "package skjkasdkd_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a list of integers.\n// You need to find the largest prime value and return the sum of its digits.\n// Examples:\n// For lst = [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] the output should be 10\n// For lst = [1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1] the output should be 25\n// For lst = [1,3,1,32,5107,34,83278,109,163,23,2323,32,30,1,9,3] the output should be 13\n// For lst = [0,724,32,71,99,32,6,0,5,91,83,0,5,6] the output should be 11\n// For lst = [0,81,12,3,1,21] the output should be 3\n// For lst = [0,8,1,2,1,7] the output should be 7\nfunc skjkasdkd(lst []int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "func TestSkjkasdkd(t *testing.T) {\n candidate := skjkasdkd\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3}), expected: 10 },\n { actual: candidate([]int{1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1}), expected: 25 },\n { actual: candidate([]int{1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3}), expected: 13 },\n { actual: candidate([]int{0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6}), expected: 11 },\n { actual: candidate([]int{0, 81, 12, 3, 1, 21}), expected: 3 },\n { actual: candidate([]int{0, 8, 1, 2, 1, 7}), expected: 7 },\n { actual: candidate([]int{8191}), expected: 19 },\n { actual: candidate([]int{8191, 123456, 127, 7}), expected: 19 },\n { actual: candidate([]int{127, 97, 8192}), expected: 10 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "go_test.go", - "prompt": "package smallest_change_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given an array arr of integers, find the minimum number of elements that\n// need to be changed to make the array palindromic. A palindromic array is an array that\n// is read the same backwards and forwards. In one change, you can change one element to any other element.\n// For example:\n// smallest_change([1,2,3,5,4,7,9,6]) == 4\n// smallest_change([1, 2, 3, 4, 3, 2, 2]) == 1\n// smallest_change([1, 2, 3, 2, 1]) == 0\nfunc smallest_change(arr []int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "func TestSmallest_Change(t *testing.T) {\n candidate := smallest_change\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 3, 5, 4, 7, 9, 6}), expected: 4 },\n { actual: candidate([]int{1, 2, 3, 4, 3, 2, 2}), expected: 1 },\n { actual: candidate([]int{1, 4, 2}), expected: 1 },\n { actual: candidate([]int{1, 4, 4, 2}), expected: 1 },\n { actual: candidate([]int{1, 2, 3, 2, 1}), expected: 0 },\n { actual: candidate([]int{3, 1, 1, 3}), expected: 0 },\n { actual: candidate([]int{1}), expected: 0 },\n { actual: candidate([]int{0, 1}), expected: 1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "go_test.go", - "prompt": "package numerical_letter_grade_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// It is the last week of the semester and the teacher has to give the grades\n// to students. The teacher has been making her own algorithm for grading.\n// The only problem is, she has lost the code she used for grading.\n// She has given you a list of GPAs for some students and you have to write \n// a function that can output a list of letter grades using the following table:\n// GPA | Letter grade\n// 4.0 A+\n// > 3.7 A \n// > 3.3 A- \n// > 3.0 B+\n// > 2.7 B \n// > 2.3 B-\n// > 2.0 C+\n// > 1.7 C\n// > 1.3 C-\n// > 1.0 D+ \n// > 0.7 D \n// > 0.0 D-\n// 0.0 E\n// Example:\n// grade_equation([4.0, 3, 1.7, 2, 3.5]) ==> ['A+', 'B', 'C-', 'C', 'A-']\nfunc numerical_letter_grade(grades []float64) []string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "func TestNumerical_Letter_Grade(t *testing.T) {\n candidate := numerical_letter_grade\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]float64{4.0, 3, 1.7, 2, 3.5}), expected: []string{\"A+\", \"B\", \"C-\", \"C\", \"A-\"} },\n { actual: candidate([]float64{1.2}), expected: []string{\"D+\"} },\n { actual: candidate([]float64{0.5}), expected: []string{\"D-\"} },\n { actual: candidate([]float64{0.0}), expected: []string{\"E\"} },\n { actual: candidate([]float64{1.0, 0.3, 1.5, 2.8, 3.3}), expected: []string{\"D\", \"D-\", \"C-\", \"B\", \"B+\"} },\n { actual: candidate([]float64{0.0, 0.7}), expected: []string{\"E\", \"D-\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "go_test.go", - "prompt": "package triangle_area_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given the lengths of the three sides of a triangle. Return the area of\n// the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n// Otherwise return -1\n// Three sides make a valid triangle when the sum of any two sides is greater \n// than the third side.\n// Example:\n// triangle_area(3, 4, 5) == 6.00\n// triangle_area(1, 2, 10) == -1\nfunc triangle_area(a int, b int, c int) float64 {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "func TestTriangle_Area(t *testing.T) {\n candidate := triangle_area\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3, 4, 5), expected: 6.0 },\n { actual: candidate(1, 2, 10), expected: -1 },\n { actual: candidate(4, 8, 5), expected: 8.18 },\n { actual: candidate(2, 2, 2), expected: 1.73 },\n { actual: candidate(1, 2, 3), expected: -1 },\n { actual: candidate(10, 5, 7), expected: 16.25 },\n { actual: candidate(2, 6, 3), expected: -1 },\n { actual: candidate(1, 1, 1), expected: 0.43 },\n { actual: candidate(2, 2, 10), expected: -1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "go_test.go", - "prompt": "package same_chars_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Check if two words have the same characters.\n// >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n// True\n// >>> same_chars('abcd', 'dddddddabc')\n// True\n// >>> same_chars('dddddddabc', 'abcd')\n// True\n// >>> same_chars('eabcd', 'dddddddabc')\n// False\n// >>> same_chars('abcd', 'dddddddabce')\n// False\n// >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc')\n// False\nfunc same_chars(s0 string, s1 string) bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "func TestSame_Chars(t *testing.T) {\n candidate := same_chars\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\"), expected: true },\n { actual: candidate(\"abcd\", \"dddddddabc\"), expected: true },\n { actual: candidate(\"dddddddabc\", \"abcd\"), expected: true },\n { actual: candidate(\"eabcd\", \"dddddddabc\"), expected: false },\n { actual: candidate(\"abcd\", \"dddddddabcf\"), expected: false },\n { actual: candidate(\"eabcdzzzz\", \"dddzzzzzzzddddabc\"), expected: false },\n { actual: candidate(\"aabb\", \"aaccc\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "go_test.go", - "prompt": "package minSubArraySum_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given an array of integers nums, find the minimum sum of any non-empty sub-array\n// of nums.\n// Example\n// minSubArraySum([2, 3, 4, 1, 2, 4]) == 1\n// minSubArraySum([-1, -2, -3]) == -6\nfunc minSubArraySum(nums []int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "func TestMinsubarraysum(t *testing.T) {\n candidate := minSubArraySum\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{2, 3, 4, 1, 2, 4}), expected: 1 },\n { actual: candidate([]int{-1, -2, -3}), expected: -6 },\n { actual: candidate([]int{-1, -2, -3, 2, -10}), expected: -14 },\n { actual: candidate([]int{-9999999999999999}), expected: -9999999999999999 },\n { actual: candidate([]int{0, 10, 20, 1000000}), expected: 0 },\n { actual: candidate([]int{-1, -2, -3, 10, -5}), expected: -6 },\n { actual: candidate([]int{100, -1, -2, -3, 10, -5}), expected: -6 },\n { actual: candidate([]int{10, 11, 13, 8, 3, 4}), expected: 3 },\n { actual: candidate([]int{100, -33, 32, -1, 0, -2}), expected: -33 },\n { actual: candidate([]int{-10}), expected: -10 },\n { actual: candidate([]int{7}), expected: 7 },\n { actual: candidate([]int{1, -1}), expected: -1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "go_test.go", - "prompt": "package select_words_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a string s and a natural number n, you have been tasked to implement \n// a function that returns a list of all words from string s that contain exactly \n// n consonants, in order these words appear in the string s.\n// If the string s is empty then the function should return an empty list.\n// Note: you may assume the input string contains only letters and spaces.\n// Examples:\n// select_words(\"Mary had a little lamb\", 4) ==> [\"little\"]\n// select_words(\"Mary had a little lamb\", 3) ==> [\"Mary\", \"lamb\"]\n// select_words(\"simple white space\", 2) ==> []\n// select_words(\"Hello world\", 4) ==> [\"world\"]\n// select_words(\"Uncle sam\", 3) ==> [\"Uncle\"]\nfunc select_words(s string, n int) []string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "func TestSelect_Words(t *testing.T) {\n candidate := select_words\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Mary had a little lamb\", 4), expected: []string{\"little\"} },\n { actual: candidate(\"Mary had a little lamb\", 3), expected: []string{\"Mary\", \"lamb\"} },\n { actual: candidate(\"simple white space\", 2), expected: []string{} },\n { actual: candidate(\"Hello world\", 4), expected: []string{\"world\"} },\n { actual: candidate(\"Uncle sam\", 3), expected: []string{\"Uncle\"} },\n { actual: candidate(\"\", 4), expected: []string{} },\n { actual: candidate(\"a b c d e f\", 1), expected: []string{\"b\", \"c\", \"d\", \"f\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "go_test.go", - "prompt": "package all_prefixes_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return list of all prefixes from shortest to longest of the input string\n// >>> all_prefixes('abc')\n// ['a', 'ab', 'abc']\nfunc all_prefixes(myString string) []string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "func TestAll_Prefixes(t *testing.T) {\n candidate := all_prefixes\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: []string{} },\n { actual: candidate(\"asdfgh\"), expected: []string{\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"} },\n { actual: candidate(\"WWW\"), expected: []string{\"W\", \"WW\", \"WWW\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "go_test.go", - "prompt": "package closest_integer_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function that takes a value (string) representing a number\n// and returns the closest integer to it. If the number is equidistant\n// from two integers, round it away from zero.\n// Examples\n// >>> closest_integer(\"10\")\n// 10\n// >>> closest_integer(\"15.3\")\n// 15\n// Note:\n// Rounding away from zero means that if the given number is equidistant\n// from two integers, the one you should return is the one that is the\n// farthest from zero. For example closest_integer(\"14.5\") should\n// return 15 and closest_integer(\"-14.5\") should return -15.\nfunc closest_integer(value string) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "func TestClosest_Integer(t *testing.T) {\n candidate := closest_integer\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"10\"), expected: 10 },\n { actual: candidate(\"14.5\"), expected: 15 },\n { actual: candidate(\"-15.5\"), expected: -16 },\n { actual: candidate(\"15.3\"), expected: 15 },\n { actual: candidate(\"0\"), expected: 0 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "go_test.go", - "prompt": "package file_name_check_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function which takes a string representing a file's name, and returns\n// 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n// A file's name is considered to be valid if and only if all the following conditions \n// are met:\n// - There should not be more than three digits ('0'-'9') in the file's name.\n// - The file's name contains exactly one dot '.'\n// - The substring before the dot should not be empty, and it starts with a letter from \n// the latin alphapet ('a'-'z' and 'A'-'Z').\n// - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n// Examples:\n// file_name_check(\"example.txt\") # => 'Yes'\n// file_name_check(\"1example.dll\") # => 'No' (the name should start with a latin alphapet letter)\nfunc file_name_check(file_name string) string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "func TestFile_Name_Check(t *testing.T) {\n candidate := file_name_check\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"example.txt\"), expected: \"Yes\" },\n { actual: candidate(\"1example.dll\"), expected: \"No\" },\n { actual: candidate(\"s1sdf3.asd\"), expected: \"No\" },\n { actual: candidate(\"K.dll\"), expected: \"Yes\" },\n { actual: candidate(\"MY16FILE3.exe\"), expected: \"Yes\" },\n { actual: candidate(\"His12FILE94.exe\"), expected: \"No\" },\n { actual: candidate(\"_Y.txt\"), expected: \"No\" },\n { actual: candidate(\"?aREYA.exe\"), expected: \"No\" },\n { actual: candidate(\"/this_is_valid.dll\"), expected: \"No\" },\n { actual: candidate(\"this_is_valid.wow\"), expected: \"No\" },\n { actual: candidate(\"this_is_valid.txt\"), expected: \"Yes\" },\n { actual: candidate(\"this_is_valid.txtexe\"), expected: \"No\" },\n { actual: candidate(\"#this2_i4s_5valid.ten\"), expected: \"No\" },\n { actual: candidate(\"@this1_is6_valid.exe\"), expected: \"No\" },\n { actual: candidate(\"this_is_12valid.6exe4.txt\"), expected: \"No\" },\n { actual: candidate(\"all.exe.txt\"), expected: \"No\" },\n { actual: candidate(\"I563_No.exe\"), expected: \"Yes\" },\n { actual: candidate(\"Is3youfault.txt\"), expected: \"Yes\" },\n { actual: candidate(\"no_one#knows.dll\"), expected: \"Yes\" },\n { actual: candidate(\"1I563_Yes3.exe\"), expected: \"No\" },\n { actual: candidate(\"I563_Yes3.txtt\"), expected: \"No\" },\n { actual: candidate(\"final..txt\"), expected: \"No\" },\n { actual: candidate(\"final132\"), expected: \"No\" },\n { actual: candidate(\"_f4indsartal132.\"), expected: \"No\" },\n { actual: candidate(\".txt\"), expected: \"No\" },\n { actual: candidate(\"s.\"), expected: \"No\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "go_test.go", - "prompt": "package intersection_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given two intervals,\n// where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n// The given intervals are closed which means that the interval (start, end)\n// includes both start and end.\n// For each given interval, it is assumed that its start is less or equal its end.\n// Your task is to determine whether the length of intersection of these two \n// intervals is a prime number.\n// Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n// which its length is 1, which not a prime number.\n// If the length of the intersection is a prime number, return \"YES\",\n// otherwise, return \"NO\".\n// If the two intervals don't intersect, return \"NO\".\n// [input/output] samples:\n// intersection((1, 2), (2, 3)) ==> \"NO\"\n// intersection((-1, 1), (0, 4)) ==> \"NO\"\n// intersection((-3, -1), (-5, 5)) ==> \"YES\"\nfunc intersection(interval1 []interface{}, interval2 []interface{}) string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "func TestIntersection(t *testing.T) {\n candidate := intersection\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]interface{}{1, 2}, []interface{}{2, 3}), expected: \"NO\" },\n { actual: candidate([]interface{}{-1, 1}, []interface{}{0, 4}), expected: \"NO\" },\n { actual: candidate([]interface{}{-3, -1}, []interface{}{-5, 5}), expected: \"YES\" },\n { actual: candidate([]interface{}{-2, 2}, []interface{}{-4, 0}), expected: \"YES\" },\n { actual: candidate([]interface{}{-11, 2}, []interface{}{-1, -1}), expected: \"NO\" },\n { actual: candidate([]interface{}{1, 2}, []interface{}{3, 5}), expected: \"NO\" },\n { actual: candidate([]interface{}{1, 2}, []interface{}{1, 2}), expected: \"NO\" },\n { actual: candidate([]interface{}{-2, -2}, []interface{}{-3, -2}), expected: \"NO\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "go_test.go", - "prompt": "package largest_prime_factor_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return the largest prime factor of n. Assume n > 1 and is not a prime.\n// >>> largest_prime_factor(13195)\n// 29\n// >>> largest_prime_factor(2048)\n// 2\nfunc largest_prime_factor(n int) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "func TestLargest_Prime_Factor(t *testing.T) {\n candidate := largest_prime_factor\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(15), expected: 5 },\n { actual: candidate(27), expected: 3 },\n { actual: candidate(63), expected: 7 },\n { actual: candidate(330), expected: 11 },\n { actual: candidate(13195), expected: 29 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "go_test.go", - "prompt": "package count_distinct_characters_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a string, find out how many distinct characters (regardless of case) does it consist of\n// >>> count_distinct_characters('xyzXYZ')\n// 3\n// >>> count_distinct_characters('Jerry')\n// 4\nfunc count_distinct_characters(myString string) int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "func TestCount_Distinct_Characters(t *testing.T) {\n candidate := count_distinct_characters\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: 0 },\n { actual: candidate(\"abcde\"), expected: 5 },\n { actual: candidate(\"abcdecadeCADE\"), expected: 5 },\n { actual: candidate(\"aaaaAAAAaaaa\"), expected: 1 },\n { actual: candidate(\"Jerry jERRY JeRRRY\"), expected: 5 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "go_test.go", - "prompt": "package below_zero_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You're given a list of deposit and withdrawal operations on a bank account that starts with\n// zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n// at that point function should return True. Otherwise it should return False.\n// >>> below_zero([1, 2, 3])\n// False\n// >>> below_zero([1, 2, -4, 5])\n// True\nfunc below_zero(operations []int) bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "func TestBelow_Zero(t *testing.T) {\n candidate := below_zero\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}), expected: false },\n { actual: candidate([]int{1, 2, -3, 1, 2, -3}), expected: false },\n { actual: candidate([]int{1, 2, -4, 5, 6}), expected: true },\n { actual: candidate([]int{1, -1, 2, -2, 5, -5, 4, -4}), expected: false },\n { actual: candidate([]int{1, -1, 2, -2, 5, -5, 4, -5}), expected: true },\n { actual: candidate([]int{1, -2, 2, -2, 5, -5, 4, -4}), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "go_test.go", - "prompt": "package make_palindrome_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Find the shortest palindrome that begins with a supplied string.\n// Algorithm idea is simple:\n// - Find the longest postfix of supplied string that is a palindrome.\n// - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n// >>> make_palindrome('')\n// ''\n// >>> make_palindrome('cat')\n// 'catac'\n// >>> make_palindrome('cata')\n// 'catac'\nfunc make_palindrome(myString string) string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "func TestMake_Palindrome(t *testing.T) {\n candidate := make_palindrome\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: \"\" },\n { actual: candidate(\"x\"), expected: \"x\" },\n { actual: candidate(\"xyz\"), expected: \"xyzyx\" },\n { actual: candidate(\"xyx\"), expected: \"xyx\" },\n { actual: candidate(\"jerry\"), expected: \"jerryrrej\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "go_test.go", - "prompt": "package int_to_mini_roman_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a positive integer, obtain its roman numeral equivalent as a string,\n// and return it in lowercase.\n// Restrictions: 1 <= num <= 1000\n// Examples:\n// >>> int_to_mini_roman(19) == 'xix'\n// >>> int_to_mini_roman(152) == 'clii'\n// >>> int_to_mini_roman(426) == 'cdxxvi'\nfunc int_to_mini_roman(number int) string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "func TestInt_To_Mini_Roman(t *testing.T) {\n candidate := int_to_mini_roman\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(19), expected: \"xix\" },\n { actual: candidate(152), expected: \"clii\" },\n { actual: candidate(251), expected: \"ccli\" },\n { actual: candidate(426), expected: \"cdxxvi\" },\n { actual: candidate(500), expected: \"d\" },\n { actual: candidate(1), expected: \"i\" },\n { actual: candidate(4), expected: \"iv\" },\n { actual: candidate(43), expected: \"xliii\" },\n { actual: candidate(90), expected: \"xc\" },\n { actual: candidate(94), expected: \"xciv\" },\n { actual: candidate(532), expected: \"dxxxii\" },\n { actual: candidate(900), expected: \"cm\" },\n { actual: candidate(994), expected: \"cmxciv\" },\n { actual: candidate(1000), expected: \"m\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - } -] \ No newline at end of file diff --git a/data/go-remove.json b/data/go-remove.json deleted file mode 100644 index f1ae1ca462e9cbc6fa0de989ebd93fbe2728ad56..0000000000000000000000000000000000000000 --- a/data/go-remove.json +++ /dev/null @@ -1,2116 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "go_test.go", - "prompt": "package largest_divisor_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// For a given number n, find the largest number that divides n evenly, smaller than n\nfunc largest_divisor(n int) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "func TestLargest_Divisor(t *testing.T) {\n candidate := largest_divisor\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3), expected: 1 },\n { actual: candidate(7), expected: 1 },\n { actual: candidate(10), expected: 5 },\n { actual: candidate(100), expected: 50 },\n { actual: candidate(49), expected: 7 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_47_median", - "language": "go_test.go", - "prompt": "package median_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return median of elements in the list l.\nfunc median(l []int) float64 {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "func TestMedian(t *testing.T) {\n candidate := median\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{3, 1, 2, 4, 5}), expected: 3 },\n { actual: candidate([]int{-10, 4, 6, 1000, 10, 20}), expected: 8.0 },\n { actual: candidate([]int{5}), expected: 5 },\n { actual: candidate([]int{6, 5}), expected: 5.5 },\n { actual: candidate([]int{8, 1, 3, 9, 9, 2, 7}), expected: 7 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "go_test.go", - "prompt": "package max_element_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return maximum element in the list.\nfunc max_element(l []int) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "func TestMax_Element(t *testing.T) {\n candidate := max_element\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 3}), expected: 3 },\n { actual: candidate([]int{5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10}), expected: 124 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "go_test.go", - "prompt": "package can_arrange_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function which returns the largest index of an element which\n// is not greater than or equal to the element immediately preceding it. If\n// no such element exists then return -1. The given array will not contain\n// duplicate values.\n// Examples:\nfunc can_arrange(arr []int) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "func TestCan_Arrange(t *testing.T) {\n candidate := can_arrange\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 4, 3, 5}), expected: 3 },\n { actual: candidate([]int{1, 2, 4, 5}), expected: -1 },\n { actual: candidate([]int{1, 4, 2, 5, 6, 7, 8, 9, 10}), expected: 2 },\n { actual: candidate([]int{4, 8, 5, 7, 3}), expected: 4 },\n { actual: candidate([]int{}), expected: -1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "go_test.go", - "prompt": "package check_if_last_char_is_a_letter_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function that returns True if the last character\n// of a given string is an alphabetical character and is not\n// a part of a word, and False otherwise.\n// Note: \"word\" is a group of characters separated by space.\n// Examples:\nfunc check_if_last_char_is_a_letter(txt string) bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "func TestCheck_If_Last_Char_Is_A_Letter(t *testing.T) {\n candidate := check_if_last_char_is_a_letter\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"apple\"), expected: false },\n { actual: candidate(\"apple pi e\"), expected: true },\n { actual: candidate(\"eeeee\"), expected: false },\n { actual: candidate(\"A\"), expected: true },\n { actual: candidate(\"Pumpkin pie \"), expected: false },\n { actual: candidate(\"Pumpkin pie 1\"), expected: false },\n { actual: candidate(\"\"), expected: false },\n { actual: candidate(\"eeeee e \"), expected: false },\n { actual: candidate(\"apple pie\"), expected: false },\n { actual: candidate(\"apple pi e \"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "go_test.go", - "prompt": "package is_prime_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return true if a given number is prime, and false otherwise.\nfunc is_prime(n int) bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "func TestIs_Prime(t *testing.T) {\n candidate := is_prime\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(6), expected: false },\n { actual: candidate(101), expected: true },\n { actual: candidate(11), expected: true },\n { actual: candidate(13441), expected: true },\n { actual: candidate(61), expected: true },\n { actual: candidate(4), expected: false },\n { actual: candidate(1), expected: false },\n { actual: candidate(5), expected: true },\n { actual: candidate(11), expected: true },\n { actual: candidate(17), expected: true },\n { actual: candidate(85), expected: false },\n { actual: candidate(77), expected: false },\n { actual: candidate(255379), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "go_test.go", - "prompt": "package unique_digits_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a list of positive integers x. return a sorted list of all \n// elements that hasn't any even digit.\n// Note: Returned list should be sorted in increasing order.\n// For example:\nfunc unique_digits(x []int) []int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "func TestUnique_Digits(t *testing.T) {\n candidate := unique_digits\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{15, 33, 1422, 1}), expected: []int{1, 15, 33} },\n { actual: candidate([]int{152, 323, 1422, 10}), expected: []int{} },\n { actual: candidate([]int{12345, 2033, 111, 151}), expected: []int{111, 151} },\n { actual: candidate([]int{135, 103, 31}), expected: []int{31, 135} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "go_test.go", - "prompt": "package string_xor_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Input are two strings a and b consisting only of 1s and 0s.\n// Perform binary XOR on these inputs and return result also as a string.\nfunc string_xor(a string, b string) string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "func TestString_Xor(t *testing.T) {\n candidate := string_xor\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"111000\", \"101010\"), expected: \"010010\" },\n { actual: candidate(\"1\", \"1\"), expected: \"0\" },\n { actual: candidate(\"0101\", \"0000\"), expected: \"0101\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "go_test.go", - "prompt": "package sum_to_n_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// sum_to_n is a function that sums numbers from 1 to n.\nfunc sum_to_n(n int) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "func TestSum_To_N(t *testing.T) {\n candidate := sum_to_n\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(1), expected: 1 },\n { actual: candidate(6), expected: 21 },\n { actual: candidate(11), expected: 66 },\n { actual: candidate(30), expected: 465 },\n { actual: candidate(100), expected: 5050 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "go_test.go", - "prompt": "package double_the_difference_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a list of numbers, return the sum of squares of the numbers\n// in the list that are odd. Ignore numbers that are negative or not integers.\n// If the input list is empty, return 0.\nfunc double_the_difference(lst []float64) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "func TestDouble_The_Difference(t *testing.T) {\n candidate := double_the_difference\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]float64{}), expected: 0 },\n { actual: candidate([]float64{5.0, 4.0}), expected: 25 },\n { actual: candidate([]float64{0.1, 0.2, 0.3}), expected: 0 },\n { actual: candidate([]float64{-10.0, -20.0, -30.0}), expected: 0 },\n { actual: candidate([]float64{-1.0, -2.0, 8.0}), expected: 0 },\n { actual: candidate([]float64{0.2, 3.0, 5.0}), expected: 34 },\n { actual: candidate([]float64{-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0}), expected: 165 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "go_test.go", - "prompt": "package strlen_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return length of given string\nfunc strlen(myString string) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "func TestStrlen(t *testing.T) {\n candidate := strlen\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: 0 },\n { actual: candidate(\"x\"), expected: 1 },\n { actual: candidate(\"asdasnakj\"), expected: 9 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "go_test.go", - "prompt": "package is_bored_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You'll be given a string of words, and your task is to count the number\n// of boredoms. A boredom is a sentence that starts with the word \"I\".\n// Sentences are delimited by '.', '?' or '!'.\n// For example:\nfunc is_bored(S string) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "func TestIs_Bored(t *testing.T) {\n candidate := is_bored\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Hello world\"), expected: 0 },\n { actual: candidate(\"Is the sky blue?\"), expected: 0 },\n { actual: candidate(\"I love It !\"), expected: 1 },\n { actual: candidate(\"bIt\"), expected: 0 },\n { actual: candidate(\"I feel good today. I will be productive. will kill It\"), expected: 2 },\n { actual: candidate(\"You and I are going for a walk\"), expected: 0 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "go_test.go", - "prompt": "package vowels_count_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function vowels_count which takes a string representing\n// a word as input and returns the number of vowels in the string.\n// Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n// vowel, but only when it is at the end of the given word.\n// Example:\nfunc vowels_count(s string) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "func TestVowels_Count(t *testing.T) {\n candidate := vowels_count\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"abcde\"), expected: 2 },\n { actual: candidate(\"Alone\"), expected: 3 },\n { actual: candidate(\"key\"), expected: 2 },\n { actual: candidate(\"bye\"), expected: 1 },\n { actual: candidate(\"keY\"), expected: 2 },\n { actual: candidate(\"bYe\"), expected: 1 },\n { actual: candidate(\"ACEDY\"), expected: 3 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_55_fib", - "language": "go_test.go", - "prompt": "package fib_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return n-th Fibonacci number.\nfunc fib(n int) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "func TestFib(t *testing.T) {\n candidate := fib\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(10), expected: 55 },\n { actual: candidate(1), expected: 1 },\n { actual: candidate(8), expected: 21 },\n { actual: candidate(11), expected: 89 },\n { actual: candidate(12), expected: 144 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "go_test.go", - "prompt": "package simplify_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Your task is to implement a function that will simplify the expression\n// x * n. The function returns True if x * n evaluates to a whole number and False\n// otherwise. Both x and n, are string representation of a fraction, and have the following format,\n// / where both numerator and denominator are positive whole numbers.\n// You can assume that x, and n are valid fractions, and do not have zero as denominator.\nfunc simplify(x string, n string) bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "func TestSimplify(t *testing.T) {\n candidate := simplify\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"1/5\", \"5/1\"), expected: true },\n { actual: candidate(\"1/6\", \"2/1\"), expected: false },\n { actual: candidate(\"5/1\", \"3/1\"), expected: true },\n { actual: candidate(\"7/10\", \"10/2\"), expected: false },\n { actual: candidate(\"2/10\", \"50/10\"), expected: true },\n { actual: candidate(\"7/2\", \"4/2\"), expected: true },\n { actual: candidate(\"11/6\", \"6/1\"), expected: true },\n { actual: candidate(\"2/3\", \"5/2\"), expected: false },\n { actual: candidate(\"5/2\", \"3/5\"), expected: false },\n { actual: candidate(\"2/4\", \"8/4\"), expected: true },\n { actual: candidate(\"2/4\", \"4/2\"), expected: true },\n { actual: candidate(\"1/5\", \"5/1\"), expected: true },\n { actual: candidate(\"1/5\", \"1/5\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "go_test.go", - "prompt": "package count_upper_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a string s, count the number of uppercase vowels in even indices.\n// For example:\nfunc count_upper(s string) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "func TestCount_Upper(t *testing.T) {\n candidate := count_upper\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"aBCdEf\"), expected: 1 },\n { actual: candidate(\"abcdefg\"), expected: 0 },\n { actual: candidate(\"dBBE\"), expected: 0 },\n { actual: candidate(\"B\"), expected: 0 },\n { actual: candidate(\"U\"), expected: 1 },\n { actual: candidate(\"\"), expected: 0 },\n { actual: candidate(\"EEEE\"), expected: 2 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "go_test.go", - "prompt": "package max_fill_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a rectangular grid of wells. Each row represents a single well,\n// and each 1 in a row represents a single unit of water.\n// Each well has a corresponding bucket that can be used to extract water from it, \n// and all buckets have the same capacity.\n// Your task is to use the buckets to empty the wells.\n// Output the number of times you need to lower the buckets.\n// Example 1:\n// Example 2:\n// Example 3:\n// Constraints:\n// * all wells have the same length\n// * 1 <= grid.length <= 10^2\n// * 1 <= grid[:,1].length <= 10^2\n// * grid[i][j] -> 0 | 1\n// * 1 <= capacity <= 10\nfunc max_fill(grid [][]int, capacity int) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "func TestMax_Fill(t *testing.T) {\n candidate := max_fill\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([][]int{[]int{0, 0, 1, 0}, []int{0, 1, 0, 0}, []int{1, 1, 1, 1}}, 1), expected: 6 },\n { actual: candidate([][]int{[]int{0, 0, 1, 1}, []int{0, 0, 0, 0}, []int{1, 1, 1, 1}, []int{0, 1, 1, 1}}, 2), expected: 5 },\n { actual: candidate([][]int{[]int{0, 0, 0}, []int{0, 0, 0}}, 5), expected: 0 },\n { actual: candidate([][]int{[]int{1, 1, 1, 1}, []int{1, 1, 1, 1}}, 2), expected: 4 },\n { actual: candidate([][]int{[]int{1, 1, 1, 1}, []int{1, 1, 1, 1}}, 9), expected: 2 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "go_test.go", - "prompt": "package maximum_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given an array arr of integers and a positive integer k, return a sorted list \n// of length k with the maximum k numbers in arr.\n// Example 1:\n// Example 2:\n// Example 3:\n// Note:\n// 1. The length of the array will be in the range of [1, 1000].\n// 2. The elements in the array will be in the range of [-1000, 1000].\n// 3. 0 <= k <= len(arr)\nfunc maximum(arr []int, k int) []int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "func TestMaximum(t *testing.T) {\n candidate := maximum\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{-3, -4, 5}, 3), expected: []int{-4, -3, 5} },\n { actual: candidate([]int{4, -4, 4}, 2), expected: []int{4, 4} },\n { actual: candidate([]int{-3, 2, 1, 2, -1, -2, 1}, 1), expected: []int{2} },\n { actual: candidate([]int{123, -123, 20, 0, 1, 2, -3}, 3), expected: []int{2, 20, 123} },\n { actual: candidate([]int{-123, 20, 0, 1, 2, -3}, 4), expected: []int{0, 1, 2, 20} },\n { actual: candidate([]int{5, 15, 0, 3, -13, -8, 0}, 7), expected: []int{-13, -8, 0, 0, 3, 5, 15} },\n { actual: candidate([]int{-1, 0, 2, 5, 3, -10}, 2), expected: []int{3, 5} },\n { actual: candidate([]int{1, 0, 5, -7}, 1), expected: []int{5} },\n { actual: candidate([]int{4, -4}, 2), expected: []int{-4, 4} },\n { actual: candidate([]int{-10, 10}, 2), expected: []int{-10, 10} },\n { actual: candidate([]int{1, 2, 3, -23, 243, -400, 0}, 0), expected: []int{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_93_encode", - "language": "go_test.go", - "prompt": "package encode_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that takes a message, and encodes in such a \n// way that it swaps case of all letters, replaces all vowels in \n// the message with the letter that appears 2 places ahead of that \n// vowel in the english alphabet. \n// Assume only letters. \n// Examples:\nfunc encode(message string) string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "func TestEncode(t *testing.T) {\n candidate := encode\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"TEST\"), expected: \"tgst\" },\n { actual: candidate(\"Mudasir\"), expected: \"mWDCSKR\" },\n { actual: candidate(\"YES\"), expected: \"ygs\" },\n { actual: candidate(\"This is a message\"), expected: \"tHKS KS C MGSSCGG\" },\n { actual: candidate(\"I DoNt KnOw WhAt tO WrItE\"), expected: \"k dQnT kNqW wHcT Tq wRkTg\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "go_test.go", - "prompt": "package remove_vowels_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// remove_vowels is a function that takes string and returns string without vowels.\nfunc remove_vowels(text string) string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "func TestRemove_Vowels(t *testing.T) {\n candidate := remove_vowels\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: \"\" },\n { actual: candidate(\"abcdef\\nghijklm\"), expected: \"bcdf\\nghjklm\" },\n { actual: candidate(\"fedcba\"), expected: \"fdcb\" },\n { actual: candidate(\"eeeee\"), expected: \"\" },\n { actual: candidate(\"acBAA\"), expected: \"cB\" },\n { actual: candidate(\"EcBOO\"), expected: \"cB\" },\n { actual: candidate(\"ybcd\"), expected: \"ybcd\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "go_test.go", - "prompt": "package get_positive_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return only positive numbers in the list.\nfunc get_positive(l []int) []int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "func TestGet_Positive(t *testing.T) {\n candidate := get_positive\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{-1, -2, 4, 5, 6}), expected: []int{4, 5, 6} },\n { actual: candidate([]int{5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10}), expected: []int{5, 3, 2, 3, 3, 9, 123, 1} },\n { actual: candidate([]int{-1, -2}), expected: []int{} },\n { actual: candidate([]int{}), expected: []int{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "go_test.go", - "prompt": "package string_sequence_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return a string containing space-delimited numbers starting from 0 upto n inclusive.\nfunc string_sequence(n int) string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "func TestString_Sequence(t *testing.T) {\n candidate := string_sequence\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(0), expected: \"0\" },\n { actual: candidate(3), expected: \"0 1 2 3\" },\n { actual: candidate(10), expected: \"0 1 2 3 4 5 6 7 8 9 10\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "go_test.go", - "prompt": "package make_a_pile_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a positive integer n, you have to make a pile of n levels of stones.\n// The first level has n stones.\n// The number of stones in the next level is:\n// - the next odd number if n is odd.\n// - the next even number if n is even.\n// Return the number of stones in each level in a list, where element at index\n// i represents the number of stones in the level (i+1).\n// Examples:\nfunc make_a_pile(n int) []int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "func TestMake_A_Pile(t *testing.T) {\n candidate := make_a_pile\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3), expected: []int{3, 5, 7} },\n { actual: candidate(4), expected: []int{4, 6, 8, 10} },\n { actual: candidate(5), expected: []int{5, 7, 9, 11, 13} },\n { actual: candidate(6), expected: []int{6, 8, 10, 12, 14, 16} },\n { actual: candidate(8), expected: []int{8, 10, 12, 14, 16, 18, 20, 22} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "go_test.go", - "prompt": "package reverse_delete_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Task\n// 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\n// then check if the result string is palindrome.\n// A string is called palindrome if it reads the same backward as forward.\n// You should return a tuple containing the result string and True/False for the check.\n// Example\nfunc reverse_delete(s string, c string) []interface{} {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "func TestReverse_Delete(t *testing.T) {\n candidate := reverse_delete\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"abcde\", \"ae\"), expected: []interface{}{\"bcd\", false} },\n { actual: candidate(\"abcdef\", \"b\"), expected: []interface{}{\"acdef\", false} },\n { actual: candidate(\"abcdedcba\", \"ab\"), expected: []interface{}{\"cdedc\", true} },\n { actual: candidate(\"dwik\", \"w\"), expected: []interface{}{\"dik\", false} },\n { actual: candidate(\"a\", \"a\"), expected: []interface{}{\"\", true} },\n { actual: candidate(\"abcdedcba\", \"\"), expected: []interface{}{\"abcdedcba\", true} },\n { actual: candidate(\"abcdedcba\", \"v\"), expected: []interface{}{\"abcdedcba\", true} },\n { actual: candidate(\"vabba\", \"v\"), expected: []interface{}{\"abba\", true} },\n { actual: candidate(\"mamma\", \"mia\"), expected: []interface{}{\"\", true} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "go_test.go", - "prompt": "package flip_case_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\nfunc flip_case(myString string) string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "func TestFlip_Case(t *testing.T) {\n candidate := flip_case\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: \"\" },\n { actual: candidate(\"Hello!\"), expected: \"hELLO!\" },\n { actual: candidate(\"These violent delights have violent ends\"), expected: \"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_161_solve", - "language": "go_test.go", - "prompt": "package solve_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a string s.\n// if s[i] is a letter, reverse its case from lower to upper or vise versa, \n// otherwise keep it as it is.\n// If the string contains no letters, reverse the string.\n// The function should return the resulted string.\n// Examples\nfunc solve(s string) string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "func TestSolve(t *testing.T) {\n candidate := solve\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"AsDf\"), expected: \"aSdF\" },\n { actual: candidate(\"1234\"), expected: \"4321\" },\n { actual: candidate(\"ab\"), expected: \"AB\" },\n { actual: candidate(\"#a@C\"), expected: \"#A@c\" },\n { actual: candidate(\"#AsdfW^45\"), expected: \"#aSDFw^45\" },\n { actual: candidate(\"#6@2\"), expected: \"2@6#\" },\n { actual: candidate(\"#$a^D\"), expected: \"#$A^d\" },\n { actual: candidate(\"#ccc\"), expected: \"#CCC\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "go_test.go", - "prompt": "package filter_by_prefix_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Filter an input list of strings only for ones that start with a given prefix.\nfunc filter_by_prefix(strings []string, prefix string) []string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "func TestFilter_By_Prefix(t *testing.T) {\n candidate := filter_by_prefix\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{}, \"john\"), expected: []string{} },\n { actual: candidate([]string{\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"}, \"xxx\"), expected: []string{\"xxx\", \"xxxAAA\", \"xxx\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "go_test.go", - "prompt": "package choose_num_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// This function takes two positive numbers x and y and returns the\n// biggest even integer number that is in the range [x, y] inclusive. If \n// there's no such number, then the function should return -1.\n// For example:\nfunc choose_num(x int, y int) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "func TestChoose_Num(t *testing.T) {\n candidate := choose_num\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(12, 15), expected: 14 },\n { actual: candidate(13, 12), expected: -1 },\n { actual: candidate(33, 12354), expected: 12354 },\n { actual: candidate(5234, 5233), expected: -1 },\n { actual: candidate(6, 29), expected: 28 },\n { actual: candidate(27, 10), expected: -1 },\n { actual: candidate(7, 7), expected: -1 },\n { actual: candidate(546, 546), expected: 546 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "go_test.go", - "prompt": "package words_in_sentence_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a string representing a sentence,\n// the sentence contains some words separated by a space,\n// and you have to return a string that contains the words from the original sentence,\n// whose lengths are prime numbers,\n// the order of the words in the new string should be the same as the original one.\n// Example 1:\n// Example 2:\n// Constraints:\n// * 1 <= len(sentence) <= 100\n// * sentence contains only letters\nfunc words_in_sentence(sentence string) string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "func TestWords_In_Sentence(t *testing.T) {\n candidate := words_in_sentence\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"This is a test\"), expected: \"is\" },\n { actual: candidate(\"lets go for swimming\"), expected: \"go for\" },\n { actual: candidate(\"there is no place available here\"), expected: \"there is no place\" },\n { actual: candidate(\"Hi I am Hussein\"), expected: \"Hi am Hussein\" },\n { actual: candidate(\"go for it\"), expected: \"go for it\" },\n { actual: candidate(\"here\"), expected: \"\" },\n { actual: candidate(\"here is\"), expected: \"is\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "go_test.go", - "prompt": "package intersperse_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\nfunc intersperse(numbers []int, delimeter int) []int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "func TestIntersperse(t *testing.T) {\n candidate := intersperse\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}, 7), expected: []int{} },\n { actual: candidate([]int{5, 6, 3, 2}, 8), expected: []int{5, 8, 6, 8, 3, 8, 2} },\n { actual: candidate([]int{2, 2, 2}, 2), expected: []int{2, 2, 2, 2, 2} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "go_test.go", - "prompt": "package is_simple_power_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Your task is to write a function that returns true if a number x is a simple\n// power of n and false in other cases.\n// x is a simple power of n if n**int=x\n// For example:\nfunc is_simple_power(x int, n int) bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "func TestIs_Simple_Power(t *testing.T) {\n candidate := is_simple_power\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(16, 2), expected: true },\n { actual: candidate(143214, 16), expected: false },\n { actual: candidate(4, 2), expected: true },\n { actual: candidate(9, 3), expected: true },\n { actual: candidate(16, 4), expected: true },\n { actual: candidate(24, 2), expected: false },\n { actual: candidate(128, 4), expected: false },\n { actual: candidate(12, 6), expected: false },\n { actual: candidate(1, 1), expected: true },\n { actual: candidate(1, 12), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "go_test.go", - "prompt": "package is_multiply_prime_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that returns true if the given number is the multiplication of 3 prime numbers\n// and false otherwise.\n// Knowing that (a) is less then 100. \n// Example:\n// 30 = 2 * 3 * 5\nfunc is_multiply_prime(a int) bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "func TestIs_Multiply_Prime(t *testing.T) {\n candidate := is_multiply_prime\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5), expected: false },\n { actual: candidate(30), expected: true },\n { actual: candidate(8), expected: true },\n { actual: candidate(10), expected: false },\n { actual: candidate(125), expected: true },\n { actual: candidate(105), expected: true },\n { actual: candidate(126), expected: false },\n { actual: candidate(729), expected: false },\n { actual: candidate(891), expected: false },\n { actual: candidate(1001), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "go_test.go", - "prompt": "package right_angle_triangle_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given the lengths of the three sides of a triangle. Return True if the three\n// sides form a right-angled triangle, False otherwise.\n// A right-angled triangle is a triangle in which one angle is right angle or \n// 90 degree.\n// Example:\nfunc right_angle_triangle(a int, b int, c int) bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "func TestRight_Angle_Triangle(t *testing.T) {\n candidate := right_angle_triangle\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3, 4, 5), expected: true },\n { actual: candidate(1, 2, 3), expected: false },\n { actual: candidate(10, 6, 8), expected: true },\n { actual: candidate(2, 2, 2), expected: false },\n { actual: candidate(7, 24, 25), expected: true },\n { actual: candidate(10, 5, 7), expected: false },\n { actual: candidate(5, 12, 13), expected: true },\n { actual: candidate(15, 8, 17), expected: true },\n { actual: candidate(48, 55, 73), expected: true },\n { actual: candidate(1, 1, 1), expected: false },\n { actual: candidate(2, 2, 10), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "go_test.go", - "prompt": "package any_int_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function that takes 3 numbers.\n// Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n// Returns false in any other cases.\n// Examples\nfunc any_int(x float64, y float64, z float64) bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "func TestAny_Int(t *testing.T) {\n candidate := any_int\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(2, 3, 1), expected: true },\n { actual: candidate(2.5, 2, 3), expected: false },\n { actual: candidate(1.5, 5, 3.5), expected: false },\n { actual: candidate(2, 6, 2), expected: false },\n { actual: candidate(4, 2, 2), expected: true },\n { actual: candidate(2.2, 2.2, 2.2), expected: false },\n { actual: candidate(-4, 6, 2), expected: true },\n { actual: candidate(2, 1, 1), expected: true },\n { actual: candidate(3, 4, 7), expected: true },\n { actual: candidate(3.0, 4, 7), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "go_test.go", - "prompt": "package sort_third_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// This function takes a list l and returns a list l' such that\n// l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n// to the values of the corresponding indicies of l, but sorted.\nfunc sort_third(l []int) []int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "func TestSort_Third(t *testing.T) {\n candidate := sort_third\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{5, 6, 3, 4, 8, 9, 2}), expected: []int{2, 6, 3, 4, 8, 9, 5} },\n { actual: candidate([]int{5, 8, 3, 4, 6, 9, 2}), expected: []int{2, 8, 3, 4, 6, 9, 5} },\n { actual: candidate([]int{5, 6, 9, 4, 8, 3, 2}), expected: []int{2, 6, 9, 4, 8, 3, 5} },\n { actual: candidate([]int{5, 6, 3, 4, 8, 9, 2, 1}), expected: []int{2, 6, 3, 4, 8, 9, 5, 1} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_53_add", - "language": "go_test.go", - "prompt": "package add_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Add two numbers x and y\nfunc add(x int, y int) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "func TestAdd(t *testing.T) {\n candidate := add\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(0, 1), expected: 1 },\n { actual: candidate(1, 0), expected: 1 },\n { actual: candidate(2, 3), expected: 5 },\n { actual: candidate(5, 7), expected: 12 },\n { actual: candidate(7, 5), expected: 12 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_69_search", - "language": "go_test.go", - "prompt": "package search_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n// zero, and has a frequency greater than or equal to the value of the integer itself. \n// The frequency of an integer is the number of times it appears in the list.\n// If no such a value exist, return -1.\n// Examples:\nfunc search(lst []int) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "func TestSearch(t *testing.T) {\n candidate := search\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{5, 5, 5, 5, 1}), expected: 1 },\n { actual: candidate([]int{4, 1, 4, 1, 4, 4}), expected: 4 },\n { actual: candidate([]int{3, 3}), expected: -1 },\n { actual: candidate([]int{8, 8, 8, 8, 8, 8, 8, 8}), expected: 8 },\n { actual: candidate([]int{2, 3, 3, 2, 2}), expected: 2 },\n { actual: candidate([]int{2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1}), expected: 1 },\n { actual: candidate([]int{3, 2, 8, 2}), expected: 2 },\n { actual: candidate([]int{6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10}), expected: 1 },\n { actual: candidate([]int{8, 8, 3, 6, 5, 6, 4}), expected: -1 },\n { actual: candidate([]int{6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9}), expected: 1 },\n { actual: candidate([]int{1, 9, 10, 1, 3}), expected: 1 },\n { actual: candidate([]int{6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10}), expected: 5 },\n { actual: candidate([]int{1}), expected: 1 },\n { actual: candidate([]int{8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5}), expected: 4 },\n { actual: candidate([]int{2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10}), expected: 2 },\n { actual: candidate([]int{1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3}), expected: 1 },\n { actual: candidate([]int{9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4}), expected: 4 },\n { actual: candidate([]int{2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7}), expected: 4 },\n { actual: candidate([]int{9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1}), expected: 2 },\n { actual: candidate([]int{5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8}), expected: -1 },\n { actual: candidate([]int{10}), expected: -1 },\n { actual: candidate([]int{9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2}), expected: 2 },\n { actual: candidate([]int{5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8}), expected: 1 },\n { actual: candidate([]int{7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6}), expected: 1 },\n { actual: candidate([]int{3, 10, 10, 9, 2}), expected: -1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "go_test.go", - "prompt": "package prime_length_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that takes a string and returns True if the string\n// length is a prime number or False otherwise\n// Examples\nfunc prime_length(myString string) bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "func TestPrime_Length(t *testing.T) {\n candidate := prime_length\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Hello\"), expected: true },\n { actual: candidate(\"abcdcba\"), expected: true },\n { actual: candidate(\"kittens\"), expected: true },\n { actual: candidate(\"orange\"), expected: false },\n { actual: candidate(\"wow\"), expected: true },\n { actual: candidate(\"world\"), expected: true },\n { actual: candidate(\"MadaM\"), expected: true },\n { actual: candidate(\"Wow\"), expected: true },\n { actual: candidate(\"\"), expected: false },\n { actual: candidate(\"HI\"), expected: true },\n { actual: candidate(\"go\"), expected: true },\n { actual: candidate(\"gogo\"), expected: false },\n { actual: candidate(\"aaaaaaaaaaaaaaa\"), expected: false },\n { actual: candidate(\"Madam\"), expected: true },\n { actual: candidate(\"M\"), expected: false },\n { actual: candidate(\"0\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_58_common", - "language": "go_test.go", - "prompt": "package common_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return sorted unique common elements for two lists.\nfunc common(l1 []int, l2 []int) []int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "func TestCommon(t *testing.T) {\n candidate := common\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 4, 3, 34, 653, 2, 5}, []int{5, 7, 1, 5, 9, 653, 121}), expected: []int{1, 5, 653} },\n { actual: candidate([]int{5, 3, 2, 8}, []int{3, 2}), expected: []int{2, 3} },\n { actual: candidate([]int{4, 3, 2, 8}, []int{3, 2, 4}), expected: []int{2, 3, 4} },\n { actual: candidate([]int{4, 3, 2, 8}, []int{}), expected: []int{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "go_test.go", - "prompt": "package special_factorial_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// The Brazilian factorial is defined as:\n// brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n// where n > 0\n// For example:\n// The function will receive an integer as input and should return the special\n// factorial of this integer.\nfunc special_factorial(n int) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "func TestSpecial_Factorial(t *testing.T) {\n candidate := special_factorial\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(4), expected: 288 },\n { actual: candidate(5), expected: 34560 },\n { actual: candidate(7), expected: 125411328000 },\n { actual: candidate(1), expected: 1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "go_test.go", - "prompt": "package exchange_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// In this problem, you will implement a function that takes two lists of numbers,\n// and determines whether it is possible to perform an exchange of elements\n// between them to make lst1 a list of only even numbers.\n// There is no limit on the number of exchanged elements between lst1 and lst2.\n// If it is possible to exchange elements between the lst1 and lst2 to make\n// all the elements of lst1 to be even, return \"YES\".\n// Otherwise, return \"NO\".\n// For example:\n// It is assumed that the input lists will be non-empty.\nfunc exchange(lst1 []int, lst2 []int) string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "func TestExchange(t *testing.T) {\n candidate := exchange\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 3, 4}, []int{1, 2, 3, 4}), expected: \"YES\" },\n { actual: candidate([]int{1, 2, 3, 4}, []int{1, 5, 3, 4}), expected: \"NO\" },\n { actual: candidate([]int{1, 2, 3, 4}, []int{2, 1, 4, 3}), expected: \"YES\" },\n { actual: candidate([]int{5, 7, 3}, []int{2, 6, 4}), expected: \"YES\" },\n { actual: candidate([]int{5, 7, 3}, []int{2, 6, 3}), expected: \"NO\" },\n { actual: candidate([]int{3, 2, 6, 1, 8, 9}, []int{3, 5, 5, 1, 1, 1}), expected: \"NO\" },\n { actual: candidate([]int{100, 200}, []int{200, 200}), expected: \"YES\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "go_test.go", - "prompt": "package add_elements_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a non-empty array of integers arr and an integer k, return\n// the sum of the elements with at most two digits from the first k elements of arr.\n// Example:\n// Constraints:\n// 1. 1 <= len(arr) <= 100\n// 2. 1 <= k <= len(arr)\nfunc add_elements(arr []int, k int) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "func TestAdd_Elements(t *testing.T) {\n candidate := add_elements\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, -2, -3, 41, 57, 76, 87, 88, 99}, 3), expected: -4 },\n { actual: candidate([]int{111, 121, 3, 4000, 5, 6}, 2), expected: 0 },\n { actual: candidate([]int{11, 21, 3, 90, 5, 6, 7, 8, 9}, 4), expected: 125 },\n { actual: candidate([]int{111, 21, 3, 4000, 5, 6, 7, 8, 9}, 4), expected: 24 },\n { actual: candidate([]int{1}, 1), expected: 1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "go_test.go", - "prompt": "package x_or_y_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// A simple program which should return the value of x if n is \n// a prime number and should return the value of y otherwise.\n// Examples:\nfunc x_or_y(n int, x int, y int) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "func TestX_Or_Y(t *testing.T) {\n candidate := x_or_y\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(7, 34, 12), expected: 34 },\n { actual: candidate(15, 8, 5), expected: 5 },\n { actual: candidate(3, 33, 5212), expected: 33 },\n { actual: candidate(1259, 3, 52), expected: 3 },\n { actual: candidate(7919, -1, 12), expected: -1 },\n { actual: candidate(3609, 1245, 583), expected: 583 },\n { actual: candidate(91, 56, 129), expected: 129 },\n { actual: candidate(6, 34, 1234), expected: 1234 },\n { actual: candidate(1, 2, 0), expected: 0 },\n { actual: candidate(2, 2, 0), expected: 2 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "go_test.go", - "prompt": "package triangle_area_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given length of a side and high return area for a triangle.\nfunc triangle_area(a int, h int) float64 {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "func TestTriangle_Area(t *testing.T) {\n candidate := triangle_area\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5, 3), expected: 7.5 },\n { actual: candidate(2, 2), expected: 2.0 },\n { actual: candidate(10, 8), expected: 40.0 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_130_tri", - "language": "go_test.go", - "prompt": "package tri_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n// the last couple centuries. However, what people don't know is Tribonacci sequence.\n// Tribonacci sequence is defined by the recurrence:\n// tri(1) = 3\n// tri(n) = 1 + n / 2, if n is even.\n// tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n// For example:\n// tri(2) = 1 + (2 / 2) = 2\n// tri(4) = 3\n// tri(3) = tri(2) + tri(1) + tri(4)\n// = 2 + 3 + 3 = 8 \n// You are given a non-negative integer number n, you have to a return a list of the \n// first n + 1 numbers of the Tribonacci sequence.\n// Examples:\nfunc tri(n int) []int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "func TestTri(t *testing.T) {\n candidate := tri\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3), expected: []int{1, 3, 2, 8} },\n { actual: candidate(4), expected: []int{1, 3, 2, 8, 3} },\n { actual: candidate(5), expected: []int{1, 3, 2, 8, 3, 15} },\n { actual: candidate(6), expected: []int{1, 3, 2, 8, 3, 15, 4} },\n { actual: candidate(7), expected: []int{1, 3, 2, 8, 3, 15, 4, 24} },\n { actual: candidate(8), expected: []int{1, 3, 2, 8, 3, 15, 4, 24, 5} },\n { actual: candidate(9), expected: []int{1, 3, 2, 8, 3, 15, 4, 24, 5, 35} },\n { actual: candidate(20), expected: []int{1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11} },\n { actual: candidate(0), expected: []int{1} },\n { actual: candidate(1), expected: []int{1, 3} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "go_test.go", - "prompt": "package match_parens_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a list of two strings, both strings consist of open\n// parentheses '(' or close parentheses ')' only.\n// Your job is to check if it is possible to concatenate the two strings in\n// some order, that the resulting string will be good.\n// A string S is considered to be good if and only if all parentheses in S\n// are balanced. For example: the string '(())()' is good, while the string\n// '())' is not.\n// Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n// Examples:\nfunc match_parens(lst []string) string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "func TestMatch_Parens(t *testing.T) {\n candidate := match_parens\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{\"()(\", \")\"}), expected: \"Yes\" },\n { actual: candidate([]string{\")\", \")\"}), expected: \"No\" },\n { actual: candidate([]string{\"(()(())\", \"())())\"}), expected: \"No\" },\n { actual: candidate([]string{\")())\", \"(()()(\"}), expected: \"Yes\" },\n { actual: candidate([]string{\"(())))\", \"(()())((\"}), expected: \"Yes\" },\n { actual: candidate([]string{\"()\", \"())\"}), expected: \"No\" },\n { actual: candidate([]string{\"(()(\", \"()))()\"}), expected: \"Yes\" },\n { actual: candidate([]string{\"((((\", \"((())\"}), expected: \"No\" },\n { actual: candidate([]string{\")(()\", \"(()(\"}), expected: \"No\" },\n { actual: candidate([]string{\")(\", \")(\"}), expected: \"No\" },\n { actual: candidate([]string{\"(\", \")\"}), expected: \"Yes\" },\n { actual: candidate([]string{\")\", \"(\"}), expected: \"Yes\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "go_test.go", - "prompt": "package remove_duplicates_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// From a list of integers, remove all elements that occur more than once.\n// Keep order of elements left the same as in the input.\nfunc remove_duplicates(numbers []int) []int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "func TestRemove_Duplicates(t *testing.T) {\n candidate := remove_duplicates\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{1, 2, 3, 4}), expected: []int{1, 2, 3, 4} },\n { actual: candidate([]int{1, 2, 3, 2, 4, 3, 5}), expected: []int{1, 4, 5} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "go_test.go", - "prompt": "package greatest_common_divisor_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return a greatest common divisor of two integers a and b\nfunc greatest_common_divisor(a int, b int) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "func TestGreatest_Common_Divisor(t *testing.T) {\n candidate := greatest_common_divisor\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3, 7), expected: 1 },\n { actual: candidate(10, 15), expected: 5 },\n { actual: candidate(49, 14), expected: 7 },\n { actual: candidate(144, 60), expected: 12 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "go_test.go", - "prompt": "package is_palindrome_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Checks if given string is a palindrome\nfunc is_palindrome(text string) bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "func TestIs_Palindrome(t *testing.T) {\n candidate := is_palindrome\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: true },\n { actual: candidate(\"aba\"), expected: true },\n { actual: candidate(\"aaaaa\"), expected: true },\n { actual: candidate(\"zbcd\"), expected: false },\n { actual: candidate(\"xywyx\"), expected: true },\n { actual: candidate(\"xywyz\"), expected: false },\n { actual: candidate(\"xywzx\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "go_test.go", - "prompt": "package derivative_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// xs represent coefficients of a polynomial.\n// xs[0] + xs[1] * x + xs[2] * x^2 + ....\n// Return derivative of this polynomial in the same form.\nfunc derivative(xs []int) []int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "func TestDerivative(t *testing.T) {\n candidate := derivative\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{3, 1, 2, 4, 5}), expected: []int{1, 4, 12, 20} },\n { actual: candidate([]int{1, 2, 3}), expected: []int{2, 6} },\n { actual: candidate([]int{3, 2, 1}), expected: []int{2, 2} },\n { actual: candidate([]int{3, 2, 1, 0, 4}), expected: []int{2, 2, 0, 16} },\n { actual: candidate([]int{1}), expected: []int{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "go_test.go", - "prompt": "package fruit_distribution_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// In this task, you will be given a string that represents a number of apples and oranges \n// that are distributed in a basket of fruit this basket contains \n// apples, oranges, and mango fruits. Given the string that represents the total number of \n// the oranges and apples and an integer that represent the total number of the fruits \n// in the basket return the number of the mango fruits in the basket.\n// for examble:\nfunc fruit_distribution(s string, n int) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "func TestFruit_Distribution(t *testing.T) {\n candidate := fruit_distribution\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"5 apples and 6 oranges\", 19), expected: 8 },\n { actual: candidate(\"5 apples and 6 oranges\", 21), expected: 10 },\n { actual: candidate(\"0 apples and 1 oranges\", 3), expected: 2 },\n { actual: candidate(\"1 apples and 0 oranges\", 3), expected: 2 },\n { actual: candidate(\"2 apples and 3 oranges\", 100), expected: 95 },\n { actual: candidate(\"2 apples and 3 oranges\", 5), expected: 0 },\n { actual: candidate(\"1 apples and 100 oranges\", 120), expected: 19 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "go_test.go", - "prompt": "package iscube_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that takes an integer a and returns True \n// if this ingeger is a cube of some integer number.\n// Note: you may assume the input is always valid.\n// Examples:\nfunc iscube(a int) bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "func TestIscube(t *testing.T) {\n candidate := iscube\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(1), expected: true },\n { actual: candidate(2), expected: false },\n { actual: candidate(-1), expected: true },\n { actual: candidate(64), expected: true },\n { actual: candidate(180), expected: false },\n { actual: candidate(1000), expected: true },\n { actual: candidate(0), expected: true },\n { actual: candidate(1729), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "go_test.go", - "prompt": "package sort_array_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// In this Kata, you have to sort an array of non-negative integers according to\n// number of ones in their binary representation in ascending order.\n// For similar number of ones, sort based on decimal value.\n// It must be implemented like this:\nfunc sort_array(arr []int) []int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "func TestSort_Array(t *testing.T) {\n candidate := sort_array\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 5, 2, 3, 4}), expected: []int{1, 2, 4, 3, 5} },\n { actual: candidate([]int{-2, -3, -4, -5, -6}), expected: []int{-4, -2, -6, -5, -3} },\n { actual: candidate([]int{1, 0, 2, 3, 4}), expected: []int{0, 1, 2, 4, 3} },\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4}), expected: []int{2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77} },\n { actual: candidate([]int{3, 6, 44, 12, 32, 5}), expected: []int{32, 3, 5, 6, 12, 44} },\n { actual: candidate([]int{2, 4, 8, 16, 32}), expected: []int{2, 4, 8, 16, 32} },\n { actual: candidate([]int{2, 4, 8, 16, 32}), expected: []int{2, 4, 8, 16, 32} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "go_test.go", - "prompt": "package odd_count_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a list of strings, where each string consists of only digits, return a list.\n// Each element i of the output should be \"the number of odd elements in the\n// string i of the input.\" where all the i's should be replaced by the number\n// of odd digits in the i'th string of the input.\nfunc odd_count(lst []string) []string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "func TestOdd_Count(t *testing.T) {\n candidate := odd_count\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{\"1234567\"}), expected: []string{\"the number of odd elements 4n the str4ng 4 of the 4nput.\"} },\n { actual: candidate([]string{\"3\", \"11111111\"}), expected: []string{\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\"} },\n { actual: candidate([]string{\"271\", \"137\", \"314\"}), expected: []string{\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "go_test.go", - "prompt": "package correct_bracketing_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// brackets is a string of \"(\" and \")\".\n// return True if every opening bracket has a corresponding closing bracket.\nfunc correct_bracketing(brackets string) bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "func TestCorrect_Bracketing(t *testing.T) {\n candidate := correct_bracketing\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"()\"), expected: true },\n { actual: candidate(\"(()())\"), expected: true },\n { actual: candidate(\"()()(()())()\"), expected: true },\n { actual: candidate(\"()()((()()())())(()()(()))\"), expected: true },\n { actual: candidate(\"((()())))\"), expected: false },\n { actual: candidate(\")(()\"), expected: false },\n { actual: candidate(\"(\"), expected: false },\n { actual: candidate(\"((((\"), expected: false },\n { actual: candidate(\")\"), expected: false },\n { actual: candidate(\"(()\"), expected: false },\n { actual: candidate(\"()()(()())())(()\"), expected: false },\n { actual: candidate(\"()()(()())()))()\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "go_test.go", - "prompt": "package digitSum_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Task\n// Write a function that takes a string as input and returns the sum of the upper characters only'\n// ASCII codes.\n// Examples:\nfunc digitSum(s string) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "func TestDigitsum(t *testing.T) {\n candidate := digitSum\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: 0 },\n { actual: candidate(\"abAB\"), expected: 131 },\n { actual: candidate(\"abcCd\"), expected: 67 },\n { actual: candidate(\"helloE\"), expected: 69 },\n { actual: candidate(\"woArBld\"), expected: 131 },\n { actual: candidate(\"aAaaaXa\"), expected: 153 },\n { actual: candidate(\" How are yOu?\"), expected: 151 },\n { actual: candidate(\"You arE Very Smart\"), expected: 327 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "go_test.go", - "prompt": "package sorted_list_sum_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that accepts a list of strings as a parameter,\n// deletes the strings that have odd lengths from it,\n// and returns the resulted list with a sorted order,\n// The list is always a list of strings and never an array of numbers,\n// and it may contain duplicates.\n// The order of the list should be ascending by length of each word, and you\n// should return the list sorted by that rule.\n// If two words have the same length, sort the list alphabetically.\n// The function should return a list of strings in sorted order.\n// You may assume that all words will have the same length.\n// For example:\nfunc sorted_list_sum(lst []string) []string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "func TestSorted_List_Sum(t *testing.T) {\n candidate := sorted_list_sum\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{\"aa\", \"a\", \"aaa\"}), expected: []string{\"aa\"} },\n { actual: candidate([]string{\"school\", \"AI\", \"asdf\", \"b\"}), expected: []string{\"AI\", \"asdf\", \"school\"} },\n { actual: candidate([]string{\"d\", \"b\", \"c\", \"a\"}), expected: []string{} },\n { actual: candidate([]string{\"d\", \"dcba\", \"abcd\", \"a\"}), expected: []string{\"abcd\", \"dcba\"} },\n { actual: candidate([]string{\"AI\", \"ai\", \"au\"}), expected: []string{\"AI\", \"ai\", \"au\"} },\n { actual: candidate([]string{\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"}), expected: []string{} },\n { actual: candidate([]string{\"aaaa\", \"bbbb\", \"dd\", \"cc\"}), expected: []string{\"cc\", \"dd\", \"aaaa\", \"bbbb\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "go_test.go", - "prompt": "package incr_list_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return list with elements incremented by 1.\nfunc incr_list(l []int) []int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "func TestIncr_List(t *testing.T) {\n candidate := incr_list\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{3, 2, 1}), expected: []int{4, 3, 2} },\n { actual: candidate([]int{5, 2, 5, 2, 3, 3, 9, 0, 123}), expected: []int{6, 3, 6, 3, 4, 4, 10, 1, 124} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "go_test.go", - "prompt": "package rolling_max_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// From a given list of integers, generate a list of rolling maximum element found until given moment\n// in the sequence.\nfunc rolling_max(numbers []int) []int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "func TestRolling_Max(t *testing.T) {\n candidate := rolling_max\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{1, 2, 3, 4}), expected: []int{1, 2, 3, 4} },\n { actual: candidate([]int{4, 3, 2, 1}), expected: []int{4, 4, 4, 4} },\n { actual: candidate([]int{3, 2, 3, 100, 3}), expected: []int{3, 3, 3, 100, 100} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "go_test.go", - "prompt": "package separate_paren_groups_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n// separate those group into separate strings and return the list of those.\n// Separate groups are balanced (each open brace is properly closed) and not nested within each other\n// Ignore any spaces in the input string.\nfunc separate_paren_groups(paren_string string) []string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "func TestSeparate_Paren_Groups(t *testing.T) {\n candidate := separate_paren_groups\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"(()()) ((())) () ((())()())\"), expected: []string{\"(()())\", \"((()))\", \"()\", \"((())()())\"} },\n { actual: candidate(\"() (()) ((())) (((())))\"), expected: []string{\"()\", \"(())\", \"((()))\", \"(((())))\"} },\n { actual: candidate(\"(()(())((())))\"), expected: []string{\"(()(())((())))\"} },\n { actual: candidate(\"( ) (( )) (( )( ))\"), expected: []string{\"()\", \"(())\", \"(()())\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "go_test.go", - "prompt": "package words_string_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You will be given a string of words separated by commas or spaces. Your task is\n// to split the string into words and return an array of the words.\n// For example:\nfunc words_string(s string) []string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "func TestWords_String(t *testing.T) {\n candidate := words_string\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Hi, my name is John\"), expected: []string{\"Hi\", \"my\", \"name\", \"is\", \"John\"} },\n { actual: candidate(\"One, two, three, four, five, six\"), expected: []string{\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"} },\n { actual: candidate(\"Hi, my name\"), expected: []string{\"Hi\", \"my\", \"name\"} },\n { actual: candidate(\"One,, two, three, four, five, six,\"), expected: []string{\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"} },\n { actual: candidate(\"\"), expected: []string{} },\n { actual: candidate(\"ahmed , gamal\"), expected: []string{\"ahmed\", \"gamal\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "go_test.go", - "prompt": "package filter_integers_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Filter given list of any python values only for integers\nfunc filter_integers(values []interface{}) []int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "func TestFilter_Integers(t *testing.T) {\n candidate := filter_integers\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]interface{}{}), expected: []int{} },\n { actual: candidate([]interface{}{4, map[interface{}]interface{}{}, []interface{}{}, 23.2, 9, \"adasd\"}), expected: []int{4, 9} },\n { actual: candidate([]interface{}{3, \"c\", 3, 3, \"a\", \"b\"}), expected: []int{3, 3, 3} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "go_test.go", - "prompt": "package sort_even_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// This function takes a list l and returns a list l' such that\n// l' is identical to l in the odd indicies, while its values at the even indicies are equal\n// to the values of the even indicies of l, but sorted.\nfunc sort_even(l []int) []int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "func TestSort_Even(t *testing.T) {\n candidate := sort_even\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 3}), expected: []int{1, 2, 3} },\n { actual: candidate([]int{5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10}), expected: []int{-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123} },\n { actual: candidate([]int{5, 8, -12, 4, 23, 2, 3, 11, 12, -10}), expected: []int{-12, 8, 3, 4, 5, 2, 12, 11, 23, -10} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_152_compare", - "language": "go_test.go", - "prompt": "package compare_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// I think we all remember that feeling when the result of some long-awaited\n// event is finally known. The feelings and thoughts you have at that moment are\n// definitely worth noting down and comparing.\n// Your task is to determine if a person correctly guessed the results of a number of matches.\n// You are given two arrays of scores and guesses of equal length, where each index shows a match. \n// Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n// the value is 0, and if not, the value is the absolute difference between the guess and the score.\n// example:\nfunc compare(game []int, guess []int) []int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "func TestCompare(t *testing.T) {\n candidate := compare\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 3, 4, 5, 1}, []int{1, 2, 3, 4, 2, -2}), expected: []int{0, 0, 0, 0, 3, 3} },\n { actual: candidate([]int{0, 0, 0, 0, 0, 0}, []int{0, 0, 0, 0, 0, 0}), expected: []int{0, 0, 0, 0, 0, 0} },\n { actual: candidate([]int{1, 2, 3}, []int{-1, -2, -3}), expected: []int{2, 4, 6} },\n { actual: candidate([]int{1, 2, 3, 5}, []int{-1, 2, 3, 4}), expected: []int{2, 0, 0, 1} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "go_test.go", - "prompt": "package even_odd_palindrome_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a positive integer n, return a tuple that has the number of even and odd\n// integer palindromes that fall within the range(1, n), inclusive.\n// Example 1:\n// Explanation:\n// Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n// Example 2:\n// Explanation:\n// Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n// Note:\n// 1. 1 <= n <= 10^3\n// 2. returned tuple has the number of even and odd integer palindromes respectively.\nfunc even_odd_palindrome(n int) []interface{} {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "func TestEven_Odd_Palindrome(t *testing.T) {\n candidate := even_odd_palindrome\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(123), expected: []interface{}{8, 13} },\n { actual: candidate(12), expected: []interface{}{4, 6} },\n { actual: candidate(3), expected: []interface{}{1, 2} },\n { actual: candidate(63), expected: []interface{}{6, 8} },\n { actual: candidate(25), expected: []interface{}{5, 6} },\n { actual: candidate(19), expected: []interface{}{4, 6} },\n { actual: candidate(9), expected: []interface{}{4, 5} },\n { actual: candidate(1), expected: []interface{}{0, 1} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "go_test.go", - "prompt": "package fib4_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fib4(0) -> 0\n// fib4(1) -> 0\n// fib4(2) -> 2\n// fib4(3) -> 0\n// fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n// Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\nfunc fib4(n int) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "func TestFib4(t *testing.T) {\n candidate := fib4\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5), expected: 4 },\n { actual: candidate(8), expected: 28 },\n { actual: candidate(10), expected: 104 },\n { actual: candidate(12), expected: 386 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "go_test.go", - "prompt": "package generate_integers_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given two positive integers a and b, return the even digits between a\n// and b, in ascending order.\n// For example:\nfunc generate_integers(a int, b int) []int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "func TestGenerate_Integers(t *testing.T) {\n candidate := generate_integers\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(2, 10), expected: []int{2, 4, 6, 8} },\n { actual: candidate(10, 2), expected: []int{2, 4, 6, 8} },\n { actual: candidate(132, 2), expected: []int{2, 4, 6, 8} },\n { actual: candidate(17, 89), expected: []int{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "go_test.go", - "prompt": "package mean_absolute_deviation_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// For a given list of input numbers, calculate Mean Absolute Deviation\n// around the mean of this dataset.\n// Mean Absolute Deviation is the average absolute difference between each\n// element and a centerpoint (mean in this case):\n// MAD = average | x - x_mean |\nfunc mean_absolute_deviation(numbers []float64) float64 {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "func TestMean_Absolute_Deviation(t *testing.T) {\n candidate := mean_absolute_deviation\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]float64{1.0, 2.0}), expected: 0.5 },\n { actual: candidate([]float64{1.0, 2.0, 3.0, 4.0}), expected: 1.0 },\n { actual: candidate([]float64{1.0, 2.0, 3.0, 4.0, 5.0}), expected: 1.2 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "go_test.go", - "prompt": "package encrypt_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function encrypt that takes a string as an argument and\n// returns a string encrypted with the alphabet being rotated. \n// The alphabet should be rotated in a manner such that the letters \n// shift down by two multiplied to two places.\n// For example:\nfunc encrypt(s string) string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "func TestEncrypt(t *testing.T) {\n candidate := encrypt\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"hi\"), expected: \"lm\" },\n { actual: candidate(\"asdfghjkl\"), expected: \"ewhjklnop\" },\n { actual: candidate(\"gf\"), expected: \"kj\" },\n { actual: candidate(\"et\"), expected: \"ix\" },\n { actual: candidate(\"faewfawefaewg\"), expected: \"jeiajeaijeiak\" },\n { actual: candidate(\"hellomyfriend\"), expected: \"lippsqcjvmirh\" },\n { actual: candidate(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\"), expected: \"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\" },\n { actual: candidate(\"a\"), expected: \"e\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "go_test.go", - "prompt": "package get_odd_collatz_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n// The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n// as follows: start with any positive integer n. Then each term is obtained from the \n// previous term as follows: if the previous term is even, the next term is one half of \n// the previous term. If the previous term is odd, the next term is 3 times the previous\n// term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n// Note: \n// 1. Collatz(1) is [1].\n// 2. returned list sorted in increasing order.\n// For example:\n// get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\nfunc get_odd_collatz(n int) []int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "func TestGet_Odd_Collatz(t *testing.T) {\n candidate := get_odd_collatz\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(14), expected: []int{1, 5, 7, 11, 13, 17} },\n { actual: candidate(5), expected: []int{1, 5} },\n { actual: candidate(12), expected: []int{1, 3, 5} },\n { actual: candidate(1), expected: []int{1} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "go_test.go", - "prompt": "package how_many_times_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Find how many times a given substring can be found in the original string. Count overlaping cases.\nfunc how_many_times(myString string, substring string) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "func TestHow_Many_Times(t *testing.T) {\n candidate := how_many_times\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\", \"x\"), expected: 0 },\n { actual: candidate(\"xyxyxyx\", \"x\"), expected: 4 },\n { actual: candidate(\"cacacacac\", \"cac\"), expected: 4 },\n { actual: candidate(\"john doe\", \"john\"), expected: 1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "go_test.go", - "prompt": "package move_one_ball_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n// numbers in the array will be randomly ordered. Your task is to determine if\n// it is possible to get an array sorted in non-decreasing order by performing \n// the following operation on the given array:\n// You are allowed to perform right shift operation any number of times.\n// One right shift operation means shifting all elements of the array by one\n// position in the right direction. The last element of the array will be moved to\n// the starting position in the array i.e. 0th index. \n// If it is possible to obtain the sorted array by performing the above operation\n// then return True else return False.\n// If the given array is empty then return True.\n// Note: The given list is guaranteed to have unique elements.\n// For Example:\n// Explanation: By performin 2 right shift operations, non-decreasing order can\n// be achieved for the given array.\n// Explanation:It is not possible to get non-decreasing order for the given\n// array by performing any number of right shift operations.\nfunc move_one_ball(arr []int) bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "func TestMove_One_Ball(t *testing.T) {\n candidate := move_one_ball\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{3, 4, 5, 1, 2}), expected: true },\n { actual: candidate([]int{3, 5, 10, 1, 2}), expected: true },\n { actual: candidate([]int{4, 3, 1, 2}), expected: false },\n { actual: candidate([]int{3, 5, 4, 1, 2}), expected: false },\n { actual: candidate([]int{}), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "go_test.go", - "prompt": "package order_by_points_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function which sorts the given list of integers\n// in ascending order according to the sum of their digits.\n// Note: if there are several items with similar sum of their digits,\n// order them based on their index in original list.\n// For example:\nfunc order_by_points(nums []int) []int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "func TestOrder_By_Points(t *testing.T) {\n candidate := order_by_points\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 11, -1, -11, -12}), expected: []int{-1, -11, 1, -12, 11} },\n { actual: candidate([]int{1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46}), expected: []int{0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457} },\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{1, -11, -32, 43, 54, -98, 2, -3}), expected: []int{-3, -32, -98, -11, 1, 2, 43, 54} },\n { actual: candidate([]int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}), expected: []int{1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9} },\n { actual: candidate([]int{0, 6, 6, -76, -21, 23, 4}), expected: []int{-76, -21, 0, 4, 23, 6, 6} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "go_test.go", - "prompt": "package factorize_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return list of prime factors of given integer in the order from smallest to largest.\n// Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n// Input number should be equal to the product of all factors\nfunc factorize(n int) []int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "func TestFactorize(t *testing.T) {\n candidate := factorize\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(2), expected: []int{2} },\n { actual: candidate(4), expected: []int{2, 2} },\n { actual: candidate(8), expected: []int{2, 2, 2} },\n { actual: candidate(57), expected: []int{3, 19} },\n { actual: candidate(3249), expected: []int{3, 3, 19, 19} },\n { actual: candidate(185193), expected: []int{3, 3, 3, 19, 19, 19} },\n { actual: candidate(20577), expected: []int{3, 19, 19, 19} },\n { actual: candidate(18), expected: []int{2, 3, 3} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "go_test.go", - "prompt": "package below_threshold_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return True if all numbers in the list l are below threshold t.\nfunc below_threshold(l []int, t int) bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "func TestBelow_Threshold(t *testing.T) {\n candidate := below_threshold\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 4, 10}, 100), expected: true },\n { actual: candidate([]int{1, 20, 4, 10}, 5), expected: false },\n { actual: candidate([]int{1, 20, 4, 10}, 21), expected: true },\n { actual: candidate([]int{1, 20, 4, 10}, 22), expected: true },\n { actual: candidate([]int{1, 8, 4, 10}, 11), expected: true },\n { actual: candidate([]int{1, 8, 4, 10}, 10), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "go_test.go", - "prompt": "package parse_nested_parens_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n// For each of the group, output the deepest level of nesting of parentheses.\n// E.g. (()()) has maximum two levels of nesting while ((())) has three.\nfunc parse_nested_parens(paren_string string) []int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "func TestParse_Nested_Parens(t *testing.T) {\n candidate := parse_nested_parens\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"(()()) ((())) () ((())()())\"), expected: []int{2, 3, 1, 3} },\n { actual: candidate(\"() (()) ((())) (((())))\"), expected: []int{1, 2, 3, 4} },\n { actual: candidate(\"(()(())((())))\"), expected: []int{4} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_121_solution", - "language": "go_test.go", - "prompt": "package solution_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n// Examples\nfunc solution(lst []int) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "func TestSolution(t *testing.T) {\n candidate := solution\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{5, 8, 7, 1}), expected: 12 },\n { actual: candidate([]int{3, 3, 3, 3, 3}), expected: 9 },\n { actual: candidate([]int{30, 13, 24, 321}), expected: 0 },\n { actual: candidate([]int{5, 9}), expected: 5 },\n { actual: candidate([]int{2, 4, 8}), expected: 0 },\n { actual: candidate([]int{30, 13, 23, 32}), expected: 23 },\n { actual: candidate([]int{3, 13, 2, 9}), expected: 3 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "go_test.go", - "prompt": "package get_max_triples_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a positive integer n. You have to create an integer array a of length n.\n// For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n// Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n// and a[i] + a[j] + a[k] is a multiple of 3.\n// Example :\n// Explanation: \n// a = [1, 3, 7, 13, 21]\n// The only valid triple is (1, 7, 13).\nfunc get_max_triples(n int) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "func TestGet_Max_Triples(t *testing.T) {\n candidate := get_max_triples\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5), expected: 1 },\n { actual: candidate(6), expected: 4 },\n { actual: candidate(10), expected: 36 },\n { actual: candidate(100), expected: 53361 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_148_bf", - "language": "go_test.go", - "prompt": "package bf_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// There are eight planets in our solar system: the closerst to the Sun \n// is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n// Uranus, Neptune.\n// Write a function that takes two planet names as strings planet1 and planet2. \n// The function should return a tuple containing all planets whose orbits are \n// located between the orbit of planet1 and the orbit of planet2, sorted by \n// the proximity to the sun. \n// The function should return an empty tuple if planet1 or planet2\n// are not correct planet names. \n// Examples\nfunc bf(planet1 string, planet2 string) []interface{} {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "func TestBf(t *testing.T) {\n candidate := bf\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Jupiter\", \"Neptune\"), expected: []interface{}{\"Saturn\", \"Uranus\"} },\n { actual: candidate(\"Earth\", \"Mercury\"), expected: []interface{}{\"Venus\"} },\n { actual: candidate(\"Mercury\", \"Uranus\"), expected: []interface{}{\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"} },\n { actual: candidate(\"Neptune\", \"Venus\"), expected: []interface{}{\"Earth\", \"Mars\", \"Jupiter\", \"Saturn\", \"Uranus\"} },\n { actual: candidate(\"Earth\", \"Earth\"), expected: []interface{}{} },\n { actual: candidate(\"Mars\", \"Earth\"), expected: []interface{}{} },\n { actual: candidate(\"Jupiter\", \"Makemake\"), expected: []interface{}{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "go_test.go", - "prompt": "package sort_numbers_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Input is a space-delimited string of numberals from 'zero' to 'nine'.\n// Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n// Return the string with numbers sorted from smallest to largest\nfunc sort_numbers(numbers string) string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "func TestSort_Numbers(t *testing.T) {\n candidate := sort_numbers\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: \"\" },\n { actual: candidate(\"three\"), expected: \"three\" },\n { actual: candidate(\"three five nine\"), expected: \"three five nine\" },\n { actual: candidate(\"five zero four seven nine eight\"), expected: \"zero four five seven eight nine\" },\n { actual: candidate(\"six five four three two one zero\"), expected: \"zero one two three four five six\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "go_test.go", - "prompt": "package cycpattern_check_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\nfunc cycpattern_check(a string, b string) bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "func TestCycpattern_Check(t *testing.T) {\n candidate := cycpattern_check\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"xyzw\", \"xyw\"), expected: false },\n { actual: candidate(\"yello\", \"ell\"), expected: true },\n { actual: candidate(\"whattup\", \"ptut\"), expected: false },\n { actual: candidate(\"efef\", \"fee\"), expected: true },\n { actual: candidate(\"abab\", \"aabb\"), expected: false },\n { actual: candidate(\"winemtt\", \"tinem\"), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "go_test.go", - "prompt": "package decimal_to_binary_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You will be given a number in decimal form and your task is to convert it to\n// binary format. The function should return a string, with each character representing a binary\n// number. Each character in the string will be '0' or '1'.\n// There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n// The extra characters are there to help with the format.\n// Examples:\nfunc decimal_to_binary(decimal int) string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "func TestDecimal_To_Binary(t *testing.T) {\n candidate := decimal_to_binary\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(0), expected: \"db0db\" },\n { actual: candidate(32), expected: \"db100000db\" },\n { actual: candidate(103), expected: \"db1100111db\" },\n { actual: candidate(15), expected: \"db1111db\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "go_test.go", - "prompt": "package filter_by_substring_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Filter an input list of strings only for ones that contain given substring\nfunc filter_by_substring(strings []string, substring string) []string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "func TestFilter_By_Substring(t *testing.T) {\n candidate := filter_by_substring\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{}, \"john\"), expected: []string{} },\n { actual: candidate([]string{\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"}, \"xxx\"), expected: []string{\"xxx\", \"xxxAAA\", \"xxx\"} },\n { actual: candidate([]string{\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"}, \"xx\"), expected: []string{\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"} },\n { actual: candidate([]string{\"grunt\", \"trumpet\", \"prune\", \"gruesome\"}, \"run\"), expected: []string{\"grunt\", \"prune\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "go_test.go", - "prompt": "package even_odd_count_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given an integer. return a tuple that has the number of even and odd digits respectively.\n// Example:\nfunc even_odd_count(num int) []interface{} {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "func TestEven_Odd_Count(t *testing.T) {\n candidate := even_odd_count\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(7), expected: []interface{}{0, 1} },\n { actual: candidate(-78), expected: []interface{}{1, 1} },\n { actual: candidate(3452), expected: []interface{}{2, 2} },\n { actual: candidate(346211), expected: []interface{}{3, 3} },\n { actual: candidate(-345821), expected: []interface{}{3, 3} },\n { actual: candidate(-2), expected: []interface{}{1, 0} },\n { actual: candidate(-45347), expected: []interface{}{2, 3} },\n { actual: candidate(0), expected: []interface{}{1, 0} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "go_test.go", - "prompt": "package find_max_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that accepts a list of strings.\n// The list contains different words. Return the word with maximum number\n// of unique characters. If multiple strings have maximum number of unique\n// characters, return the one which comes first in lexicographical order.\nfunc find_max(words []string) string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "func TestFind_Max(t *testing.T) {\n candidate := find_max\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{\"name\", \"of\", \"string\"}), expected: \"string\" },\n { actual: candidate([]string{\"name\", \"enam\", \"game\"}), expected: \"enam\" },\n { actual: candidate([]string{\"aaaaaaa\", \"bb\", \"cc\"}), expected: \"aaaaaaa\" },\n { actual: candidate([]string{\"abc\", \"cba\"}), expected: \"abc\" },\n { actual: candidate([]string{\"play\", \"this\", \"game\", \"of\", \"footbott\"}), expected: \"footbott\" },\n { actual: candidate([]string{\"we\", \"are\", \"gonna\", \"rock\"}), expected: \"gonna\" },\n { actual: candidate([]string{\"we\", \"are\", \"a\", \"mad\", \"nation\"}), expected: \"nation\" },\n { actual: candidate([]string{\"this\", \"is\", \"a\", \"prrk\"}), expected: \"this\" },\n { actual: candidate([]string{\"b\"}), expected: \"b\" },\n { actual: candidate([]string{\"play\", \"play\", \"play\"}), expected: \"play\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "go_test.go", - "prompt": "package largest_smallest_integers_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function that returns a tuple (a, b), where 'a' is\n// the largest of negative integers, and 'b' is the smallest\n// of positive integers in a list.\n// If there is no negative or positive integers, return them as None.\n// Examples:\nfunc largest_smallest_integers(lst []int) []interface{} {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "func TestLargest_Smallest_Integers(t *testing.T) {\n candidate := largest_smallest_integers\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{2, 4, 1, 3, 5, 7}), expected: []interface{}{nil, 1} },\n { actual: candidate([]int{2, 4, 1, 3, 5, 7, 0}), expected: []interface{}{nil, 1} },\n { actual: candidate([]int{1, 3, 2, 4, 5, 6, -2}), expected: []interface{}{-2, 1} },\n { actual: candidate([]int{4, 5, 3, 6, 2, 7, -7}), expected: []interface{}{-7, 2} },\n { actual: candidate([]int{7, 3, 8, 4, 9, 2, 5, -9}), expected: []interface{}{-9, 2} },\n { actual: candidate([]int{}), expected: []interface{}{nil, nil} },\n { actual: candidate([]int{0}), expected: []interface{}{nil, nil} },\n { actual: candidate([]int{-1, -3, -5, -6}), expected: []interface{}{-1, nil} },\n { actual: candidate([]int{-1, -3, -5, -6, 0}), expected: []interface{}{-1, nil} },\n { actual: candidate([]int{-6, -4, -4, -3, 1}), expected: []interface{}{-3, 1} },\n { actual: candidate([]int{-6, -4, -4, -3, -100, 1}), expected: []interface{}{-3, 1} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "go_test.go", - "prompt": "package pluck_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// \"Given an array representing a branch of a tree that has non-negative integer nodes\n// your task is to pluck one of the nodes and return it.\n// The plucked node should be the node with the smallest even value.\n// If multiple nodes with the same smallest even value are found return the node that has smallest index.\n// The plucked node should be returned in a list, [ smalest_value, its index ],\n// If there are no even values or the given array is empty, return [].\n// Example 1:\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 2:\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 3:\n// Example 4:\n// Explanation: 0 is the smallest value, but there are two zeros,\n// so we will choose the first zero, which has the smallest index.\n// Constraints:\n// * 1 <= nodes.length <= 10000\n// * 0 <= node.value\nfunc pluck(arr []int) []int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "func TestPluck(t *testing.T) {\n candidate := pluck\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{4, 2, 3}), expected: []int{2, 1} },\n { actual: candidate([]int{1, 2, 3}), expected: []int{2, 1} },\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{5, 0, 3, 0, 4, 2}), expected: []int{0, 1} },\n { actual: candidate([]int{1, 2, 3, 0, 5, 3}), expected: []int{0, 3} },\n { actual: candidate([]int{5, 4, 8, 4, 8}), expected: []int{4, 1} },\n { actual: candidate([]int{7, 6, 7, 1}), expected: []int{6, 1} },\n { actual: candidate([]int{7, 9, 7, 1}), expected: []int{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "go_test.go", - "prompt": "package count_nums_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function count_nums which takes an array of integers and returns\n// the number of elements which has a sum of digits > 0.\n// If a number is negative, then its first signed digit will be negative:\n// e.g. -123 has signed digits -1, 2, and 3.\nfunc count_nums(arr []int) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "func TestCount_Nums(t *testing.T) {\n candidate := count_nums\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}), expected: 0 },\n { actual: candidate([]int{-1, -2, 0}), expected: 0 },\n { actual: candidate([]int{1, 1, 2, -2, 3, 4, 5}), expected: 6 },\n { actual: candidate([]int{1, 6, 9, -6, 0, 1, 5}), expected: 5 },\n { actual: candidate([]int{1, 100, 98, -7, 1, -1}), expected: 4 },\n { actual: candidate([]int{12, 23, 34, -45, -56, 0}), expected: 5 },\n { actual: candidate([]int{0, 1}), expected: 1 },\n { actual: candidate([]int{1}), expected: 1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "go_test.go", - "prompt": "package minPath_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n// each cell of the grid contains a value. Every integer in the range [1, N * N]\n// inclusive appears exactly once on the cells of the grid.\n// You have to find the minimum path of length k in the grid. You can start\n// from any cell, and in each step you can move to any of the neighbor cells,\n// in other words, you can go to cells which share an edge with you current\n// cell.\n// Please note that a path of length k means visiting exactly k cells (not\n// necessarily distinct).\n// You CANNOT go off the grid.\n// A path A (of length k) is considered less than a path B (of length k) if\n// after making the ordered lists of the values on the cells that A and B go\n// through (let's call them lst_A and lst_B), lst_A is lexicographically less\n// than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n// such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n// lst_A[j] = lst_B[j].\n// It is guaranteed that the answer is unique.\n// Return an ordered list of the values on the cells that the minimum path go through.\n// Examples:\nfunc minPath(grid [][]int, k int) []int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "func TestMinpath(t *testing.T) {\n candidate := minPath\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([][]int{[]int{1, 2, 3}, []int{4, 5, 6}, []int{7, 8, 9}}, 3), expected: []int{1, 2, 1} },\n { actual: candidate([][]int{[]int{5, 9, 3}, []int{4, 1, 6}, []int{7, 8, 2}}, 1), expected: []int{1} },\n { actual: candidate([][]int{[]int{1, 2, 3, 4}, []int{5, 6, 7, 8}, []int{9, 10, 11, 12}, []int{13, 14, 15, 16}}, 4), expected: []int{1, 2, 1, 2} },\n { actual: candidate([][]int{[]int{6, 4, 13, 10}, []int{5, 7, 12, 1}, []int{3, 16, 11, 15}, []int{8, 14, 9, 2}}, 7), expected: []int{1, 10, 1, 10, 1, 10, 1} },\n { actual: candidate([][]int{[]int{8, 14, 9, 2}, []int{6, 4, 13, 15}, []int{5, 7, 1, 12}, []int{3, 10, 11, 16}}, 5), expected: []int{1, 7, 1, 7, 1} },\n { actual: candidate([][]int{[]int{11, 8, 7, 2}, []int{5, 16, 14, 4}, []int{9, 3, 15, 6}, []int{12, 13, 10, 1}}, 9), expected: []int{1, 6, 1, 6, 1, 6, 1, 6, 1} },\n { actual: candidate([][]int{[]int{12, 13, 10, 1}, []int{9, 3, 15, 6}, []int{5, 16, 14, 4}, []int{11, 8, 7, 2}}, 12), expected: []int{1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6} },\n { actual: candidate([][]int{[]int{2, 7, 4}, []int{3, 1, 5}, []int{6, 8, 9}}, 8), expected: []int{1, 3, 1, 3, 1, 3, 1, 3} },\n { actual: candidate([][]int{[]int{6, 1, 5}, []int{3, 8, 9}, []int{2, 7, 4}}, 8), expected: []int{1, 5, 1, 5, 1, 5, 1, 5} },\n { actual: candidate([][]int{[]int{1, 2}, []int{3, 4}}, 10), expected: []int{1, 2, 1, 2, 1, 2, 1, 2, 1, 2} },\n { actual: candidate([][]int{[]int{1, 3}, []int{3, 2}}, 10), expected: []int{1, 3, 1, 3, 1, 3, 1, 3, 1, 3} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "go_test.go", - "prompt": "package strange_sort_list_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given list of integers, return list in strange order.\n// Strange sorting, is when you start with the minimum value,\n// then maximum of the remaining integers, then minimum and so on.\n// Examples:\nfunc strange_sort_list(lst []int) []int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "func TestStrange_Sort_List(t *testing.T) {\n candidate := strange_sort_list\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 3, 4}), expected: []int{1, 4, 2, 3} },\n { actual: candidate([]int{5, 6, 7, 8, 9}), expected: []int{5, 9, 6, 8, 7} },\n { actual: candidate([]int{1, 2, 3, 4, 5}), expected: []int{1, 5, 2, 4, 3} },\n { actual: candidate([]int{5, 6, 7, 8, 9, 1}), expected: []int{1, 9, 5, 8, 6, 7} },\n { actual: candidate([]int{5, 5, 5, 5}), expected: []int{5, 5, 5, 5} },\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{1, 2, 3, 4, 5, 6, 7, 8}), expected: []int{1, 8, 2, 7, 3, 6, 4, 5} },\n { actual: candidate([]int{0, 2, 2, 2, 5, 5, -5, -5}), expected: []int{-5, 5, -5, 5, 0, 2, 2, 2} },\n { actual: candidate([]int{111111}), expected: []int{111111} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "go_test.go", - "prompt": "package get_closest_vowel_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a word. Your task is to find the closest vowel that stands between \n// two consonants from the right side of the word (case sensitive).\n// Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n// find any vowel met the above condition. \n// You may assume that the given string contains English letter only.\n// Example:\nfunc get_closest_vowel(word string) string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "func TestGet_Closest_Vowel(t *testing.T) {\n candidate := get_closest_vowel\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"yogurt\"), expected: \"u\" },\n { actual: candidate(\"full\"), expected: \"u\" },\n { actual: candidate(\"easy\"), expected: \"\" },\n { actual: candidate(\"eAsy\"), expected: \"\" },\n { actual: candidate(\"ali\"), expected: \"\" },\n { actual: candidate(\"bad\"), expected: \"a\" },\n { actual: candidate(\"most\"), expected: \"o\" },\n { actual: candidate(\"ab\"), expected: \"\" },\n { actual: candidate(\"ba\"), expected: \"\" },\n { actual: candidate(\"quick\"), expected: \"\" },\n { actual: candidate(\"anime\"), expected: \"i\" },\n { actual: candidate(\"Asia\"), expected: \"\" },\n { actual: candidate(\"Above\"), expected: \"o\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "go_test.go", - "prompt": "package change_base_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Change numerical base of input number x to base.\n// return string representation after the conversion.\n// base numbers are less than 10.\nfunc change_base(x int, base int) string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "func TestChange_Base(t *testing.T) {\n candidate := change_base\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(8, 3), expected: \"22\" },\n { actual: candidate(9, 3), expected: \"100\" },\n { actual: candidate(234, 2), expected: \"11101010\" },\n { actual: candidate(16, 2), expected: \"10000\" },\n { actual: candidate(8, 2), expected: \"1000\" },\n { actual: candidate(7, 2), expected: \"111\" },\n { actual: candidate(2, 3), expected: \"2\" },\n { actual: candidate(3, 4), expected: \"3\" },\n { actual: candidate(4, 5), expected: \"4\" },\n { actual: candidate(5, 6), expected: \"5\" },\n { actual: candidate(6, 7), expected: \"6\" },\n { actual: candidate(7, 8), expected: \"7\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "go_test.go", - "prompt": "package has_close_elements_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Check if in given list of numbers, are any two numbers closer to each other than\n// given threshold.\nfunc has_close_elements(numbers []float64, threshold float64) bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "func TestHas_Close_Elements(t *testing.T) {\n candidate := has_close_elements\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]float64{1.0, 2.0, 3.9, 4.0, 5.0, 2.2}, 0.3), expected: true },\n { actual: candidate([]float64{1.0, 2.0, 3.9, 4.0, 5.0, 2.2}, 0.05), expected: false },\n { actual: candidate([]float64{1.0, 2.0, 5.9, 4.0, 5.0}, 0.95), expected: true },\n { actual: candidate([]float64{1.0, 2.0, 5.9, 4.0, 5.0}, 0.8), expected: false },\n { actual: candidate([]float64{1.0, 2.0, 3.0, 4.0, 5.0, 2.0}, 0.1), expected: true },\n { actual: candidate([]float64{1.1, 2.2, 3.1, 4.1, 5.1}, 1.0), expected: true },\n { actual: candidate([]float64{1.1, 2.2, 3.1, 4.1, 5.1}, 0.5), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "go_test.go", - "prompt": "package is_nested_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function that takes a string as input which contains only square brackets.\n// The function should return True if and only if there is a valid subsequence of brackets \n// where at least one bracket in the subsequence is nested.\nfunc is_nested(myString string) bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "func TestIs_Nested(t *testing.T) {\n candidate := is_nested\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"[[]]\"), expected: true },\n { actual: candidate(\"[]]]]]]][[[[[]\"), expected: false },\n { actual: candidate(\"[][]\"), expected: false },\n { actual: candidate(\"[]\"), expected: false },\n { actual: candidate(\"[[[[]]]]\"), expected: true },\n { actual: candidate(\"[]]]]]]]]]]\"), expected: false },\n { actual: candidate(\"[][][[]]\"), expected: true },\n { actual: candidate(\"[[]\"), expected: false },\n { actual: candidate(\"[]]\"), expected: false },\n { actual: candidate(\"[[]][[\"), expected: true },\n { actual: candidate(\"[[][]]\"), expected: true },\n { actual: candidate(\"\"), expected: false },\n { actual: candidate(\"[[[[[[[[\"), expected: false },\n { actual: candidate(\"]]]]]]]]\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "go_test.go", - "prompt": "package concatenate_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Concatenate list of strings into a single string\nfunc concatenate(strings []string) string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "func TestConcatenate(t *testing.T) {\n candidate := concatenate\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{}), expected: \"\" },\n { actual: candidate([]string{\"x\", \"y\", \"z\"}), expected: \"xyz\" },\n { actual: candidate([]string{\"x\", \"y\", \"z\", \"w\", \"k\"}), expected: \"xyzwk\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "go_test.go", - "prompt": "package prime_fib_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// prime_fib returns n-th number that is a Fibonacci number and it's also prime.\nfunc prime_fib(n int) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "func TestPrime_Fib(t *testing.T) {\n candidate := prime_fib\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(1), expected: 2 },\n { actual: candidate(2), expected: 3 },\n { actual: candidate(3), expected: 5 },\n { actual: candidate(4), expected: 13 },\n { actual: candidate(5), expected: 89 },\n { actual: candidate(6), expected: 233 },\n { actual: candidate(7), expected: 1597 },\n { actual: candidate(8), expected: 28657 },\n { actual: candidate(9), expected: 514229 },\n { actual: candidate(10), expected: 433494437 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "go_test.go", - "prompt": "package find_closest_elements_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n// other and return them in order (smaller number, larger number).\nfunc find_closest_elements(numbers []float64) []interface{} {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "func TestFind_Closest_Elements(t *testing.T) {\n candidate := find_closest_elements\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]float64{1.0, 2.0, 3.9, 4.0, 5.0, 2.2}), expected: []interface{}{3.9, 4.0} },\n { actual: candidate([]float64{1.0, 2.0, 5.9, 4.0, 5.0}), expected: []interface{}{5.0, 5.9} },\n { actual: candidate([]float64{1.0, 2.0, 3.0, 4.0, 5.0, 2.2}), expected: []interface{}{2.0, 2.2} },\n { actual: candidate([]float64{1.0, 2.0, 3.0, 4.0, 5.0, 2.0}), expected: []interface{}{2.0, 2.0} },\n { actual: candidate([]float64{1.1, 2.2, 3.1, 4.1, 5.1}), expected: []interface{}{2.2, 3.1} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "go_test.go", - "prompt": "package hex_key_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You have been tasked to write a function that receives \n// a hexadecimal number as a string and counts the number of hexadecimal \n// digits that are primes (prime number, or a prime, is a natural number \n// greater than 1 that is not a product of two smaller natural numbers).\n// Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n// Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n// So you have to determine a number of the following digits: 2, 3, 5, 7, \n// B (=decimal 11), D (=decimal 13).\n// Note: you may assume the input is always correct or empty string, \n// and symbols A,B,C,D,E,F are always uppercase.\n// Examples:\nfunc hex_key(num string) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "func TestHex_Key(t *testing.T) {\n candidate := hex_key\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"AB\"), expected: 1 },\n { actual: candidate(\"1077E\"), expected: 2 },\n { actual: candidate(\"ABED1A33\"), expected: 4 },\n { actual: candidate(\"2020\"), expected: 2 },\n { actual: candidate(\"123456789ABCDEF0\"), expected: 6 },\n { actual: candidate(\"112233445566778899AABBCCDDEEFF00\"), expected: 12 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "go_test.go", - "prompt": "package multiply_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Complete the function that takes two integers and returns \n// the product of their unit digits.\n// Assume the input is always valid.\n// Examples:\nfunc multiply(a int, b int) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "func TestMultiply(t *testing.T) {\n candidate := multiply\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(148, 412), expected: 16 },\n { actual: candidate(19, 28), expected: 72 },\n { actual: candidate(2020, 1851), expected: 0 },\n { actual: candidate(14, -15), expected: 20 },\n { actual: candidate(76, 67), expected: 42 },\n { actual: candidate(17, 27), expected: 49 },\n { actual: candidate(0, 1), expected: 0 },\n { actual: candidate(0, 0), expected: 0 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "go_test.go", - "prompt": "package rescale_to_unit_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given list of numbers (of at least two elements), apply a linear transform to that list,\n// such that the smallest number will become 0 and the largest will become 1\nfunc rescale_to_unit(numbers []float64) []float64 {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "func TestRescale_To_Unit(t *testing.T) {\n candidate := rescale_to_unit\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]float64{2.0, 49.9}), expected: []float64{0.0, 1.0} },\n { actual: candidate([]float64{100.0, 49.9}), expected: []float64{1.0, 0.0} },\n { actual: candidate([]float64{1.0, 2.0, 3.0, 4.0, 5.0}), expected: []float64{0.0, 0.25, 0.5, 0.75, 1.0} },\n { actual: candidate([]float64{2.0, 1.0, 5.0, 3.0, 4.0}), expected: []float64{0.25, 0.0, 1.0, 0.5, 0.75} },\n { actual: candidate([]float64{12.0, 11.0, 15.0, 13.0, 14.0}), expected: []float64{0.25, 0.0, 1.0, 0.5, 0.75} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_131_digits", - "language": "go_test.go", - "prompt": "package digits_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a positive integer n, return the product of the odd digits.\n// Return 0 if all digits are even.\n// For example:\nfunc digits(n int) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "func TestDigits(t *testing.T) {\n candidate := digits\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5), expected: 5 },\n { actual: candidate(54), expected: 5 },\n { actual: candidate(120), expected: 1 },\n { actual: candidate(5014), expected: 5 },\n { actual: candidate(98765), expected: 315 },\n { actual: candidate(5576543), expected: 2625 },\n { actual: candidate(2468), expected: 0 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "go_test.go", - "prompt": "package Strongest_Extension_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You will be given the name of a class (a string) and a list of extensions.\n// The extensions are to be used to load additional classes to the class. The\n// strength of the extension is as follows: Let CAP be the number of the uppercase\n// letters in the extension's name, and let SM be the number of lowercase letters \n// in the extension's name, the strength is given by the fraction CAP - SM. \n// You should find the strongest extension and return a string in this \n// format: ClassName.StrongestExtensionName.\n// If there are two or more extensions with the same strength, you should\n// choose the one that comes first in the list.\n// For example, if you are given \"Slices\" as the class and a list of the\n// extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n// return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n// (its strength is -1).\n// Example:\nfunc Strongest_Extension(class_name string, extensions []string) string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "func TestStrongest_Extension(t *testing.T) {\n candidate := Strongest_Extension\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Watashi\", []string{\"tEN\", \"niNE\", \"eIGHt8OKe\"}), expected: \"Watashi.eIGHt8OKe\" },\n { actual: candidate(\"Boku123\", []string{\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"}), expected: \"Boku123.YEs.WeCaNe\" },\n { actual: candidate(\"__YESIMHERE\", []string{\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"}), expected: \"__YESIMHERE.NuLl__\" },\n { actual: candidate(\"K\", []string{\"Ta\", \"TAR\", \"t234An\", \"cosSo\"}), expected: \"K.TAR\" },\n { actual: candidate(\"__HAHA\", []string{\"Tab\", \"123\", \"781345\", \"-_-\"}), expected: \"__HAHA.123\" },\n { actual: candidate(\"YameRore\", []string{\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"}), expected: \"YameRore.okIWILL123\" },\n { actual: candidate(\"finNNalLLly\", []string{\"Die\", \"NowW\", \"Wow\", \"WoW\"}), expected: \"finNNalLLly.WoW\" },\n { actual: candidate(\"_\", []string{\"Bb\", \"91245\"}), expected: \"_.Bb\" },\n { actual: candidate(\"Sp\", []string{\"671235\", \"Bb\"}), expected: \"Sp.671235\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "go_test.go", - "prompt": "package histogram_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a string representing a space separated lowercase letters, return a dictionary\n// of the letter with the most repetition and containing the corresponding count.\n// If several letters have the same occurrence, return all of them.\n// Example:\nfunc histogram(test string) map[string]int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "func TestHistogram(t *testing.T) {\n candidate := histogram\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"a b b a\"), expected: map[string]int{\"a\": 2, \"b\": 2} },\n { actual: candidate(\"a b c a b\"), expected: map[string]int{\"a\": 2, \"b\": 2} },\n { actual: candidate(\"a b c d g\"), expected: map[string]int{\"a\": 1, \"b\": 1, \"c\": 1, \"d\": 1, \"g\": 1} },\n { actual: candidate(\"r t g\"), expected: map[string]int{\"r\": 1, \"t\": 1, \"g\": 1} },\n { actual: candidate(\"b b b b a\"), expected: map[string]int{\"b\": 4} },\n { actual: candidate(\"r t g\"), expected: map[string]int{\"r\": 1, \"t\": 1, \"g\": 1} },\n { actual: candidate(\"\"), expected: map[string]int{} },\n { actual: candidate(\"a\"), expected: map[string]int{\"a\": 1} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "go_test.go", - "prompt": "package pairs_sum_to_zero_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// pairs_sum_to_zero takes a list of integers as an input.\n// it returns True if there are two distinct elements in the list that\n// sum to zero, and False otherwise.\nfunc pairs_sum_to_zero(l []int) bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "func TestPairs_Sum_To_Zero(t *testing.T) {\n candidate := pairs_sum_to_zero\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 3, 5, 0}), expected: false },\n { actual: candidate([]int{1, 3, -2, 1}), expected: false },\n { actual: candidate([]int{1, 2, 3, 7}), expected: false },\n { actual: candidate([]int{2, 4, -5, 3, 5, 7}), expected: true },\n { actual: candidate([]int{1}), expected: false },\n { actual: candidate([]int{-3, 9, -1, 3, 2, 30}), expected: true },\n { actual: candidate([]int{-3, 9, -1, 3, 2, 31}), expected: true },\n { actual: candidate([]int{-3, 9, -1, 4, 2, 30}), expected: false },\n { actual: candidate([]int{-3, 9, -1, 4, 2, 31}), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "go_test.go", - "prompt": "package total_match_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that accepts two lists of strings and returns the list that has \n// total number of chars in the all strings of the list less than the other list.\n// if the two lists have the same number of chars, return the first list.\n// Examples\nfunc total_match(lst1 []string, lst2 []string) []string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "func TestTotal_Match(t *testing.T) {\n candidate := total_match\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{}, []string{}), expected: []string{} },\n { actual: candidate([]string{\"hi\", \"admin\"}, []string{\"hi\", \"hi\"}), expected: []string{\"hi\", \"hi\"} },\n { actual: candidate([]string{\"hi\", \"admin\"}, []string{\"hi\", \"hi\", \"admin\", \"project\"}), expected: []string{\"hi\", \"admin\"} },\n { actual: candidate([]string{\"4\"}, []string{\"1\", \"2\", \"3\", \"4\", \"5\"}), expected: []string{\"4\"} },\n { actual: candidate([]string{\"hi\", \"admin\"}, []string{\"hI\", \"Hi\"}), expected: []string{\"hI\", \"Hi\"} },\n { actual: candidate([]string{\"hi\", \"admin\"}, []string{\"hI\", \"hi\", \"hi\"}), expected: []string{\"hI\", \"hi\", \"hi\"} },\n { actual: candidate([]string{\"hi\", \"admin\"}, []string{\"hI\", \"hi\", \"hii\"}), expected: []string{\"hi\", \"admin\"} },\n { actual: candidate([]string{}, []string{\"this\"}), expected: []string{} },\n { actual: candidate([]string{\"this\"}, []string{}), expected: []string{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "go_test.go", - "prompt": "package circular_shift_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Circular shift the digits of the integer x, shift the digits right by shift\n// and return the result as a string.\n// If shift > number of digits, return digits reversed.\nfunc circular_shift(x int, shift int) string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "func TestCircular_Shift(t *testing.T) {\n candidate := circular_shift\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(100, 2), expected: \"001\" },\n { actual: candidate(12, 2), expected: \"12\" },\n { actual: candidate(97, 8), expected: \"79\" },\n { actual: candidate(12, 1), expected: \"21\" },\n { actual: candidate(11, 101), expected: \"11\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "go_test.go", - "prompt": "package monotonic_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return True is list elements are monotonically increasing or decreasing.\nfunc monotonic(l []int) bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "func TestMonotonic(t *testing.T) {\n candidate := monotonic\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 4, 10}), expected: true },\n { actual: candidate([]int{1, 2, 4, 20}), expected: true },\n { actual: candidate([]int{1, 20, 4, 10}), expected: false },\n { actual: candidate([]int{4, 1, 0, -10}), expected: true },\n { actual: candidate([]int{4, 1, 1, 0}), expected: true },\n { actual: candidate([]int{1, 2, 3, 2, 5, 60}), expected: false },\n { actual: candidate([]int{1, 2, 3, 4, 5, 60}), expected: true },\n { actual: candidate([]int{9, 9, 9, 9}), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "go_test.go", - "prompt": "package is_equal_to_sum_even_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n// Example\nfunc is_equal_to_sum_even(n int) bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "func TestIs_Equal_To_Sum_Even(t *testing.T) {\n candidate := is_equal_to_sum_even\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(4), expected: false },\n { actual: candidate(6), expected: false },\n { actual: candidate(8), expected: true },\n { actual: candidate(10), expected: true },\n { actual: candidate(11), expected: false },\n { actual: candidate(12), expected: true },\n { actual: candidate(13), expected: false },\n { actual: candidate(16), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "go_test.go", - "prompt": "package parse_music_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Input to this function is a string representing musical notes in a special ASCII format.\n// Your task is to parse this string and return list of integers corresponding to how many beats does each\n// not last.\n// Here is a legend:\n// 'o' - whole note, lasts four beats\n// 'o|' - half note, lasts two beats\n// '.|' - quater note, lasts one beat\nfunc parse_music(music_string string) []int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "func TestParse_Music(t *testing.T) {\n candidate := parse_music\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: []int{} },\n { actual: candidate(\"o o o o\"), expected: []int{4, 4, 4, 4} },\n { actual: candidate(\".| .| .| .|\"), expected: []int{1, 1, 1, 1} },\n { actual: candidate(\"o| o| .| .| o o o o\"), expected: []int{2, 2, 1, 1, 4, 4, 4, 4} },\n { actual: candidate(\"o| .| o| .| o o| o o|\"), expected: []int{2, 1, 2, 1, 4, 2, 4, 2} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "go_test.go", - "prompt": "package sum_squares_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// \"\n// This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n// multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n// change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n// Examples:\nfunc sum_squares(lst []int) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "func TestSum_Squares(t *testing.T) {\n candidate := sum_squares\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 3}), expected: 6 },\n { actual: candidate([]int{1, 4, 9}), expected: 14 },\n { actual: candidate([]int{}), expected: 0 },\n { actual: candidate([]int{1, 1, 1, 1, 1, 1, 1, 1, 1}), expected: 9 },\n { actual: candidate([]int{-1, -1, -1, -1, -1, -1, -1, -1, -1}), expected: -3 },\n { actual: candidate([]int{0}), expected: 0 },\n { actual: candidate([]int{-1, -5, 2, -1, -5}), expected: -126 },\n { actual: candidate([]int{-56, -99, 1, 0, -2}), expected: 3030 },\n { actual: candidate([]int{-1, 0, 0, 0, 0, 0, 0, 0, -1}), expected: 0 },\n { actual: candidate([]int{-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37}), expected: -14196 },\n { actual: candidate([]int{-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10}), expected: -1448 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "go_test.go", - "prompt": "package triples_sum_to_zero_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// triples_sum_to_zero takes a list of integers as an input.\n// it returns True if there are three distinct elements in the list that\n// sum to zero, and False otherwise.\nfunc triples_sum_to_zero(l []int) bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "func TestTriples_Sum_To_Zero(t *testing.T) {\n candidate := triples_sum_to_zero\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 3, 5, 0}), expected: false },\n { actual: candidate([]int{1, 3, 5, -1}), expected: false },\n { actual: candidate([]int{1, 3, -2, 1}), expected: true },\n { actual: candidate([]int{1, 2, 3, 7}), expected: false },\n { actual: candidate([]int{1, 2, 5, 7}), expected: false },\n { actual: candidate([]int{2, 4, -5, 3, 9, 7}), expected: true },\n { actual: candidate([]int{1}), expected: false },\n { actual: candidate([]int{1, 3, 5, -100}), expected: false },\n { actual: candidate([]int{100, 3, 5, -100}), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "go_test.go", - "prompt": "package correct_bracketing_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// brackets is a string of \"<\" and \">\".\n// return True if every opening bracket has a corresponding closing bracket.\nfunc correct_bracketing(brackets string) bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "func TestCorrect_Bracketing(t *testing.T) {\n candidate := correct_bracketing\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"<>\"), expected: true },\n { actual: candidate(\"<<><>>\"), expected: true },\n { actual: candidate(\"<><><<><>><>\"), expected: true },\n { actual: candidate(\"<><><<<><><>><>><<><><<>>>\"), expected: true },\n { actual: candidate(\"<<<><>>>>\"), expected: false },\n { actual: candidate(\"><<>\"), expected: false },\n { actual: candidate(\"<\"), expected: false },\n { actual: candidate(\"<<<<\"), expected: false },\n { actual: candidate(\">\"), expected: false },\n { actual: candidate(\"<<>\"), expected: false },\n { actual: candidate(\"<><><<><>><>><<>\"), expected: false },\n { actual: candidate(\"<><><<><>><>>><>\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "go_test.go", - "prompt": "package specialFilter_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that takes an array of numbers as input and returns \n// the number of elements in the array that are greater than 10 and both \n// first and last digits of a number are odd (1, 3, 5, 7, 9).\n// For example:\nfunc specialFilter(nums []int) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "func TestSpecialfilter(t *testing.T) {\n candidate := specialFilter\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{5, -2, 1, -5}), expected: 0 },\n { actual: candidate([]int{15, -73, 14, -15}), expected: 1 },\n { actual: candidate([]int{33, -2, -3, 45, 21, 109}), expected: 2 },\n { actual: candidate([]int{43, -12, 93, 125, 121, 109}), expected: 4 },\n { actual: candidate([]int{71, -2, -33, 75, 21, 19}), expected: 3 },\n { actual: candidate([]int{1}), expected: 0 },\n { actual: candidate([]int{}), expected: 0 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "go_test.go", - "prompt": "package check_dict_case_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a dictionary, return True if all keys are strings in lower \n// case or all keys are strings in upper case, else return False.\n// The function should return False is the given dictionary is empty.\n// Examples:\nfunc check_dict_case(dict map[string]string) bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "func TestCheck_Dict_Case(t *testing.T) {\n candidate := check_dict_case\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(map[string]string{\"p\": \"pineapple\", \"b\": \"banana\"}), expected: true },\n { actual: candidate(map[string]string{\"p\": \"pineapple\", \"A\": \"banana\", \"B\": \"banana\"}), expected: false },\n { actual: candidate(map[string]string{\"p\": \"pineapple\", \"5\": \"banana\", \"a\": \"apple\"}), expected: false },\n { actual: candidate(map[string]string{\"Name\": \"John\", \"Age\": \"36\", \"City\": \"Houston\"}), expected: false },\n { actual: candidate(map[string]string{\"STATE\": \"NC\", \"ZIP\": \"12345\"}), expected: true },\n { actual: candidate(map[string]string{\"fruit\": \"Orange\", \"taste\": \"Sweet\"}), expected: true },\n { actual: candidate(map[string]string{}), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "go_test.go", - "prompt": "package fibfib_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fibfib(0) == 0\n// fibfib(1) == 0\n// fibfib(2) == 1\n// fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n// Please write a function to efficiently compute the n-th element of the fibfib number sequence.\nfunc fibfib(n int) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "func TestFibfib(t *testing.T) {\n candidate := fibfib\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(2), expected: 1 },\n { actual: candidate(1), expected: 0 },\n { actual: candidate(5), expected: 4 },\n { actual: candidate(8), expected: 24 },\n { actual: candidate(10), expected: 81 },\n { actual: candidate(12), expected: 274 },\n { actual: candidate(14), expected: 927 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "go_test.go", - "prompt": "package sum_squares_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a list of numbers.\n// You need to return the sum of squared numbers in the given list,\n// round each element in the list to the upper int(Ceiling) first.\n// Examples:\nfunc sum_squares(lst []float64) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "func TestSum_Squares(t *testing.T) {\n candidate := sum_squares\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]float64{1.0, 2.0, 3.0}), expected: 14 },\n { actual: candidate([]float64{1.0, 2.0, 3.0}), expected: 14 },\n { actual: candidate([]float64{1.0, 3.0, 5.0, 7.0}), expected: 84 },\n { actual: candidate([]float64{1.4, 4.2, 0.0}), expected: 29 },\n { actual: candidate([]float64{-2.4, 1.0, 1.0}), expected: 6 },\n { actual: candidate([]float64{100.0, 1.0, 15.0, 2.0}), expected: 10230 },\n { actual: candidate([]float64{10000.0, 10000.0}), expected: 200000000 },\n { actual: candidate([]float64{-1.4, 4.6, 6.3}), expected: 75 },\n { actual: candidate([]float64{-1.4, 17.9, 18.9, 19.9}), expected: 1086 },\n { actual: candidate([]float64{0.0}), expected: 0 },\n { actual: candidate([]float64{-1.0}), expected: 1 },\n { actual: candidate([]float64{-1.0, 1.0, 0.0}), expected: 2 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_85_add", - "language": "go_test.go", - "prompt": "package add_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a non-empty list of integers lst. add the even elements that are at odd indices..\n// Examples:\nfunc add(lst []int) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "func TestAdd(t *testing.T) {\n candidate := add\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{4, 88}), expected: 88 },\n { actual: candidate([]int{4, 5, 6, 7, 2, 122}), expected: 122 },\n { actual: candidate([]int{4, 0, 6, 7}), expected: 0 },\n { actual: candidate([]int{4, 4, 6, 8}), expected: 12 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_34_unique", - "language": "go_test.go", - "prompt": "package unique_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return sorted unique elements in a list\nfunc unique(l []int) []int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "func TestUnique(t *testing.T) {\n candidate := unique\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{5, 3, 5, 2, 3, 3, 9, 0, 123}), expected: []int{0, 2, 3, 5, 9, 123} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "go_test.go", - "prompt": "package fix_spaces_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a string text, replace all spaces in it with underscores, \n// and if a string has more than 2 consecutive spaces, \n// then replace all consecutive spaces with -\nfunc fix_spaces(text string) string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "func TestFix_Spaces(t *testing.T) {\n candidate := fix_spaces\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Example\"), expected: \"Example\" },\n { actual: candidate(\"Mudasir Hanif \"), expected: \"Mudasir_Hanif_\" },\n { actual: candidate(\"Yellow Yellow Dirty Fellow\"), expected: \"Yellow_Yellow__Dirty__Fellow\" },\n { actual: candidate(\"Exa mple\"), expected: \"Exa-mple\" },\n { actual: candidate(\" Exa 1 2 2 mple\"), expected: \"-Exa_1_2_2_mple\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_49_modp", - "language": "go_test.go", - "prompt": "package modp_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return 2^n modulo p (be aware of numerics).\nfunc modp(n int, p int) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "func TestModp(t *testing.T) {\n candidate := modp\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3, 5), expected: 3 },\n { actual: candidate(1101, 101), expected: 2 },\n { actual: candidate(0, 101), expected: 1 },\n { actual: candidate(3, 11), expected: 8 },\n { actual: candidate(100, 101), expected: 1 },\n { actual: candidate(30, 5), expected: 4 },\n { actual: candidate(31, 5), expected: 3 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "go_test.go", - "prompt": "package valid_date_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You have to write a function which validates a given date string and\n// returns True if the date is valid otherwise False.\n// The date is valid if all of the following rules are satisfied:\n// 1. The date string is not empty.\n// 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n// 3. The months should not be less than 1 or higher than 12.\n// 4. The date should be in the format: mm-dd-yyyy\nfunc valid_date(date string) bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "func TestValid_Date(t *testing.T) {\n candidate := valid_date\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"03-11-2000\"), expected: true },\n { actual: candidate(\"15-01-2012\"), expected: false },\n { actual: candidate(\"04-0-2040\"), expected: false },\n { actual: candidate(\"06-04-2020\"), expected: true },\n { actual: candidate(\"01-01-2007\"), expected: true },\n { actual: candidate(\"03-32-2011\"), expected: false },\n { actual: candidate(\"\"), expected: false },\n { actual: candidate(\"04-31-3000\"), expected: false },\n { actual: candidate(\"06-06-2005\"), expected: true },\n { actual: candidate(\"21-31-2000\"), expected: false },\n { actual: candidate(\"04-12-2003\"), expected: true },\n { actual: candidate(\"04122003\"), expected: false },\n { actual: candidate(\"20030412\"), expected: false },\n { actual: candidate(\"2003-04\"), expected: false },\n { actual: candidate(\"2003-04-12\"), expected: false },\n { actual: candidate(\"04-2003\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "go_test.go", - "prompt": "package anti_shuffle_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that takes a string and returns an ordered version of it.\n// Ordered version of string, is a string where all words (separated by space)\n// are replaced by a new word where all the characters arranged in\n// ascending order based on ascii value.\n// Note: You should keep the order of words and blank spaces in the sentence.\n// For example:\nfunc anti_shuffle(s string) string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "func TestAnti_Shuffle(t *testing.T) {\n candidate := anti_shuffle\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Hi\"), expected: \"Hi\" },\n { actual: candidate(\"hello\"), expected: \"ehllo\" },\n { actual: candidate(\"number\"), expected: \"bemnru\" },\n { actual: candidate(\"abcd\"), expected: \"abcd\" },\n { actual: candidate(\"Hello World!!!\"), expected: \"Hello !!!Wdlor\" },\n { actual: candidate(\"\"), expected: \"\" },\n { actual: candidate(\"Hi. My name is Mister Robot. How are you?\"), expected: \".Hi My aemn is Meirst .Rboot How aer ?ouy\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "go_test.go", - "prompt": "package is_sorted_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a list of numbers, return whether or not they are sorted\n// in ascending order. If list has more than 1 duplicate of the same\n// number, return False. Assume no negative numbers and only integers.\n// Examples\nfunc is_sorted(lst []int) bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "func TestIs_Sorted(t *testing.T) {\n candidate := is_sorted\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{5}), expected: true },\n { actual: candidate([]int{1, 2, 3, 4, 5}), expected: true },\n { actual: candidate([]int{1, 3, 2, 4, 5}), expected: false },\n { actual: candidate([]int{1, 2, 3, 4, 5, 6}), expected: true },\n { actual: candidate([]int{1, 2, 3, 4, 5, 6, 7}), expected: true },\n { actual: candidate([]int{1, 3, 2, 4, 5, 6, 7}), expected: false },\n { actual: candidate([]int{}), expected: true },\n { actual: candidate([]int{1}), expected: true },\n { actual: candidate([]int{3, 2, 1}), expected: false },\n { actual: candidate([]int{1, 2, 2, 2, 3, 4}), expected: false },\n { actual: candidate([]int{1, 2, 3, 3, 3, 4}), expected: false },\n { actual: candidate([]int{1, 2, 2, 3, 3, 4}), expected: true },\n { actual: candidate([]int{1, 2, 3, 4}), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "go_test.go", - "prompt": "package is_happy_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a string s.\n// Your task is to check if the string is happy or not.\n// A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n// For example:\nfunc is_happy(s string) bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "func TestIs_Happy(t *testing.T) {\n candidate := is_happy\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"a\"), expected: false },\n { actual: candidate(\"aa\"), expected: false },\n { actual: candidate(\"abcd\"), expected: true },\n { actual: candidate(\"aabb\"), expected: false },\n { actual: candidate(\"adb\"), expected: true },\n { actual: candidate(\"xyy\"), expected: false },\n { actual: candidate(\"iopaxpoi\"), expected: true },\n { actual: candidate(\"iopaxioi\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "go_test.go", - "prompt": "package will_it_fly_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that returns True if the object q will fly, and False otherwise.\n// The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n// Example:\n// # 1+2 is less than the maximum possible weight, but it's unbalanced.\n// # it's balanced, but 3+2+3 is more than the maximum possible weight.\n// # 3+2+3 is less than the maximum possible weight, and it's balanced.\n// # 3 is less than the maximum possible weight, and it's balanced.\nfunc will_it_fly(q []int, w int) bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "func TestWill_It_Fly(t *testing.T) {\n candidate := will_it_fly\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{3, 2, 3}, 9), expected: true },\n { actual: candidate([]int{1, 2}, 5), expected: false },\n { actual: candidate([]int{3}, 5), expected: true },\n { actual: candidate([]int{3, 2, 3}, 1), expected: false },\n { actual: candidate([]int{1, 2, 3}, 6), expected: false },\n { actual: candidate([]int{5}, 5), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "go_test.go", - "prompt": "package sort_array_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given an array of non-negative integers, return a copy of the given array after sorting,\n// you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n// or sort it in descending order if the sum( first index value, last index value) is even.\n// Note:\n// * don't change the given array.\n// Examples:\nfunc sort_array(array []int) []int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "func TestSort_Array(t *testing.T) {\n candidate := sort_array\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{5}), expected: []int{5} },\n { actual: candidate([]int{2, 4, 3, 0, 1, 5}), expected: []int{0, 1, 2, 3, 4, 5} },\n { actual: candidate([]int{2, 4, 3, 0, 1, 5, 6}), expected: []int{6, 5, 4, 3, 2, 1, 0} },\n { actual: candidate([]int{2, 1}), expected: []int{1, 2} },\n { actual: candidate([]int{15, 42, 87, 32, 11, 0}), expected: []int{0, 11, 15, 32, 42, 87} },\n { actual: candidate([]int{21, 14, 23, 11}), expected: []int{23, 21, 14, 11} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "go_test.go", - "prompt": "package count_up_to_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Implement a function that takes an non-negative integer and returns an array of the first n\n// integers that are prime numbers and less than n.\n// for example:\nfunc count_up_to(n int) []int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "func TestCount_Up_To(t *testing.T) {\n candidate := count_up_to\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5), expected: []int{2, 3} },\n { actual: candidate(6), expected: []int{2, 3, 5} },\n { actual: candidate(7), expected: []int{2, 3, 5} },\n { actual: candidate(10), expected: []int{2, 3, 5, 7} },\n { actual: candidate(0), expected: []int{} },\n { actual: candidate(22), expected: []int{2, 3, 5, 7, 11, 13, 17, 19} },\n { actual: candidate(1), expected: []int{} },\n { actual: candidate(18), expected: []int{2, 3, 5, 7, 11, 13, 17} },\n { actual: candidate(47), expected: []int{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43} },\n { actual: candidate(101), expected: []int{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "go_test.go", - "prompt": "package by_length_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n// reverse the resulting array, and then replace each digit by its corresponding name from\n// \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n// For example:\n// If the array is empty, return an empty array:\n// If the array has any strange number ignore it:\nfunc by_length(arr []int) []string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "func TestBy_Length(t *testing.T) {\n candidate := by_length\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{2, 1, 1, 4, 5, 8, 2, 3}), expected: []string{\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"} },\n { actual: candidate([]int{}), expected: []string{} },\n { actual: candidate([]int{1, -1, 55}), expected: []string{\"One\"} },\n { actual: candidate([]int{1, -1, 3, 2}), expected: []string{\"Three\", \"Two\", \"One\"} },\n { actual: candidate([]int{9, 4, 8}), expected: []string{\"Nine\", \"Eight\", \"Four\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_106_f", - "language": "go_test.go", - "prompt": "package f_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Implement the function f that takes n as a parameter,\n// 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\n// or the sum of numbers from 1 to i otherwise.\n// i starts from 1.\n// the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n// Example:\nfunc f(n int) []int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "func TestF(t *testing.T) {\n candidate := f\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5), expected: []int{1, 2, 6, 24, 15} },\n { actual: candidate(7), expected: []int{1, 2, 6, 24, 15, 720, 28} },\n { actual: candidate(1), expected: []int{1} },\n { actual: candidate(3), expected: []int{1, 2, 6} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "go_test.go", - "prompt": "package fizz_buzz_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\nfunc fizz_buzz(n int) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "func TestFizz_Buzz(t *testing.T) {\n candidate := fizz_buzz\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(50), expected: 0 },\n { actual: candidate(78), expected: 2 },\n { actual: candidate(79), expected: 3 },\n { actual: candidate(100), expected: 3 },\n { actual: candidate(200), expected: 6 },\n { actual: candidate(4000), expected: 192 },\n { actual: candidate(10000), expected: 639 },\n { actual: candidate(100000), expected: 8026 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "go_test.go", - "prompt": "package truncate_number_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a positive floating point number, it can be decomposed into\n// and integer part (largest integer smaller than given number) and decimals\n// (leftover part always smaller than 1).\n// Return the decimal part of the number.\nfunc truncate_number(number float64) float64 {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "func TestTruncate_Number(t *testing.T) {\n candidate := truncate_number\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3.5), expected: 0.5 },\n { actual: candidate(1.25), expected: 0.25 },\n { actual: candidate(123.0), expected: 0.0 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "go_test.go", - "prompt": "package sum_product_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n// Empty sum should be equal to 0 and empty product should be equal to 1.\nfunc sum_product(numbers []int) []interface{} {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "func TestSum_Product(t *testing.T) {\n candidate := sum_product\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}), expected: []interface{}{0, 1} },\n { actual: candidate([]int{1, 1, 1}), expected: []interface{}{3, 1} },\n { actual: candidate([]int{100, 0}), expected: []interface{}{100, 0} },\n { actual: candidate([]int{3, 5, 7}), expected: []interface{}{15, 105} },\n { actual: candidate([]int{10}), expected: []interface{}{10, 10} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "go_test.go", - "prompt": "package get_row_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a 2 dimensional data, as a nested lists,\n// which is similar to matrix, however, unlike matrices,\n// each row may contain a different number of columns.\n// Given lst, and integer x, find integers x in the list,\n// and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n// each tuple is a coordinate - (row, columns), starting with 0.\n// Sort coordinates initially by rows in ascending order.\n// Also, sort coordinates of the row by columns in descending order.\n// Examples:\nfunc get_row(lst [][]int, x int) [][]interface{} {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "func TestGet_Row(t *testing.T) {\n candidate := get_row\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([][]int{[]int{1, 2, 3, 4, 5, 6}, []int{1, 2, 3, 4, 1, 6}, []int{1, 2, 3, 4, 5, 1}}, 1), expected: [][]int{[]interface{}{0, 0}, []interface{}{1, 4}, []interface{}{1, 0}, []interface{}{2, 5}, []interface{}{2, 0}} },\n { actual: candidate([][]int{[]int{1, 2, 3, 4, 5, 6}, []int{1, 2, 3, 4, 5, 6}, []int{1, 2, 3, 4, 5, 6}, []int{1, 2, 3, 4, 5, 6}, []int{1, 2, 3, 4, 5, 6}, []int{1, 2, 3, 4, 5, 6}}, 2), expected: [][]int{[]interface{}{0, 1}, []interface{}{1, 1}, []interface{}{2, 1}, []interface{}{3, 1}, []interface{}{4, 1}, []interface{}{5, 1}} },\n { actual: candidate([][]int{[]int{1, 2, 3, 4, 5, 6}, []int{1, 2, 3, 4, 5, 6}, []int{1, 1, 3, 4, 5, 6}, []int{1, 2, 1, 4, 5, 6}, []int{1, 2, 3, 1, 5, 6}, []int{1, 2, 3, 4, 1, 6}, []int{1, 2, 3, 4, 5, 1}}, 1), expected: [][]int{[]interface{}{0, 0}, []interface{}{1, 0}, []interface{}{2, 1}, []interface{}{2, 0}, []interface{}{3, 2}, []interface{}{3, 0}, []interface{}{4, 3}, []interface{}{4, 0}, []interface{}{5, 4}, []interface{}{5, 0}, []interface{}{6, 5}, []interface{}{6, 0}} },\n { actual: candidate([][]int{}, 1), expected: [][]interface{}{} },\n { actual: candidate([][]int{[]int{1}}, 2), expected: [][]interface{}{} },\n { actual: candidate([]interface{}{[]interface{}{}, []int{1}, []int{1, 2, 3}}, 3), expected: [][]int{[]interface{}{2, 2}} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_159_eat", - "language": "go_test.go", - "prompt": "package eat_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You're a hungry rabbit, and you already have eaten a certain number of carrots,\n// but now you need to eat more carrots to complete the day's meals.\n// you should return an array of [ total number of eaten carrots after your meals,\n// the number of carrots left after your meals ]\n// if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n// Example:\n// Variables:\n// @number : integer\n// the number of carrots that you have eaten.\n// @need : integer\n// the number of carrots that you need to eat.\n// @remaining : integer\n// the number of remaining carrots thet exist in stock\n// Constrain:\n// * 0 <= number <= 1000\n// * 0 <= need <= 1000\n// * 0 <= remaining <= 1000\n// Have fun :)\nfunc eat(number int, need int, remaining int) []int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "func TestEat(t *testing.T) {\n candidate := eat\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5, 6, 10), expected: []int{11, 4} },\n { actual: candidate(4, 8, 9), expected: []int{12, 1} },\n { actual: candidate(1, 10, 10), expected: []int{11, 0} },\n { actual: candidate(2, 11, 5), expected: []int{7, 0} },\n { actual: candidate(4, 5, 7), expected: []int{9, 2} },\n { actual: candidate(4, 5, 1), expected: []int{5, 0} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_84_solve", - "language": "go_test.go", - "prompt": "package solve_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a positive integer N, return the total sum of its digits in binary.\n// Example\n// Variables:\n// @N integer\n// Constraints: 0 \u2264 N \u2264 10000.\n// Output:\n// a string of binary number\nfunc solve(N int) string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "func TestSolve(t *testing.T) {\n candidate := solve\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(1000), expected: \"1\" },\n { actual: candidate(150), expected: \"110\" },\n { actual: candidate(147), expected: \"1100\" },\n { actual: candidate(333), expected: \"1001\" },\n { actual: candidate(963), expected: \"10010\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "go_test.go", - "prompt": "package skjkasdkd_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a list of integers.\n// You need to find the largest prime value and return the sum of its digits.\n// Examples:\nfunc skjkasdkd(lst []int) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "func TestSkjkasdkd(t *testing.T) {\n candidate := skjkasdkd\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3}), expected: 10 },\n { actual: candidate([]int{1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1}), expected: 25 },\n { actual: candidate([]int{1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3}), expected: 13 },\n { actual: candidate([]int{0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6}), expected: 11 },\n { actual: candidate([]int{0, 81, 12, 3, 1, 21}), expected: 3 },\n { actual: candidate([]int{0, 8, 1, 2, 1, 7}), expected: 7 },\n { actual: candidate([]int{8191}), expected: 19 },\n { actual: candidate([]int{8191, 123456, 127, 7}), expected: 19 },\n { actual: candidate([]int{127, 97, 8192}), expected: 10 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "go_test.go", - "prompt": "package smallest_change_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given an array arr of integers, find the minimum number of elements that\n// need to be changed to make the array palindromic. A palindromic array is an array that\n// is read the same backwards and forwards. In one change, you can change one element to any other element.\n// For example:\nfunc smallest_change(arr []int) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "func TestSmallest_Change(t *testing.T) {\n candidate := smallest_change\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 3, 5, 4, 7, 9, 6}), expected: 4 },\n { actual: candidate([]int{1, 2, 3, 4, 3, 2, 2}), expected: 1 },\n { actual: candidate([]int{1, 4, 2}), expected: 1 },\n { actual: candidate([]int{1, 4, 4, 2}), expected: 1 },\n { actual: candidate([]int{1, 2, 3, 2, 1}), expected: 0 },\n { actual: candidate([]int{3, 1, 1, 3}), expected: 0 },\n { actual: candidate([]int{1}), expected: 0 },\n { actual: candidate([]int{0, 1}), expected: 1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "go_test.go", - "prompt": "package numerical_letter_grade_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// It is the last week of the semester and the teacher has to give the grades\n// to students. The teacher has been making her own algorithm for grading.\n// The only problem is, she has lost the code she used for grading.\n// She has given you a list of GPAs for some students and you have to write \n// a function that can output a list of letter grades using the following table:\n// GPA | Letter grade\n// 4.0 A+\n// > 3.7 A \n// > 3.3 A- \n// > 3.0 B+\n// > 2.7 B \n// > 2.3 B-\n// > 2.0 C+\n// > 1.7 C\n// > 1.3 C-\n// > 1.0 D+ \n// > 0.7 D \n// > 0.0 D-\n// 0.0 E\n// Example:\nfunc numerical_letter_grade(grades []float64) []string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "func TestNumerical_Letter_Grade(t *testing.T) {\n candidate := numerical_letter_grade\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]float64{4.0, 3, 1.7, 2, 3.5}), expected: []string{\"A+\", \"B\", \"C-\", \"C\", \"A-\"} },\n { actual: candidate([]float64{1.2}), expected: []string{\"D+\"} },\n { actual: candidate([]float64{0.5}), expected: []string{\"D-\"} },\n { actual: candidate([]float64{0.0}), expected: []string{\"E\"} },\n { actual: candidate([]float64{1.0, 0.3, 1.5, 2.8, 3.3}), expected: []string{\"D\", \"D-\", \"C-\", \"B\", \"B+\"} },\n { actual: candidate([]float64{0.0, 0.7}), expected: []string{\"E\", \"D-\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "go_test.go", - "prompt": "package triangle_area_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given the lengths of the three sides of a triangle. Return the area of\n// the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n// Otherwise return -1\n// Three sides make a valid triangle when the sum of any two sides is greater \n// than the third side.\n// Example:\nfunc triangle_area(a int, b int, c int) float64 {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "func TestTriangle_Area(t *testing.T) {\n candidate := triangle_area\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3, 4, 5), expected: 6.0 },\n { actual: candidate(1, 2, 10), expected: -1 },\n { actual: candidate(4, 8, 5), expected: 8.18 },\n { actual: candidate(2, 2, 2), expected: 1.73 },\n { actual: candidate(1, 2, 3), expected: -1 },\n { actual: candidate(10, 5, 7), expected: 16.25 },\n { actual: candidate(2, 6, 3), expected: -1 },\n { actual: candidate(1, 1, 1), expected: 0.43 },\n { actual: candidate(2, 2, 10), expected: -1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "go_test.go", - "prompt": "package same_chars_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Check if two words have the same characters.\nfunc same_chars(s0 string, s1 string) bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "func TestSame_Chars(t *testing.T) {\n candidate := same_chars\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\"), expected: true },\n { actual: candidate(\"abcd\", \"dddddddabc\"), expected: true },\n { actual: candidate(\"dddddddabc\", \"abcd\"), expected: true },\n { actual: candidate(\"eabcd\", \"dddddddabc\"), expected: false },\n { actual: candidate(\"abcd\", \"dddddddabcf\"), expected: false },\n { actual: candidate(\"eabcdzzzz\", \"dddzzzzzzzddddabc\"), expected: false },\n { actual: candidate(\"aabb\", \"aaccc\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "go_test.go", - "prompt": "package minSubArraySum_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given an array of integers nums, find the minimum sum of any non-empty sub-array\n// of nums.\n// Example\nfunc minSubArraySum(nums []int) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "func TestMinsubarraysum(t *testing.T) {\n candidate := minSubArraySum\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{2, 3, 4, 1, 2, 4}), expected: 1 },\n { actual: candidate([]int{-1, -2, -3}), expected: -6 },\n { actual: candidate([]int{-1, -2, -3, 2, -10}), expected: -14 },\n { actual: candidate([]int{-9999999999999999}), expected: -9999999999999999 },\n { actual: candidate([]int{0, 10, 20, 1000000}), expected: 0 },\n { actual: candidate([]int{-1, -2, -3, 10, -5}), expected: -6 },\n { actual: candidate([]int{100, -1, -2, -3, 10, -5}), expected: -6 },\n { actual: candidate([]int{10, 11, 13, 8, 3, 4}), expected: 3 },\n { actual: candidate([]int{100, -33, 32, -1, 0, -2}), expected: -33 },\n { actual: candidate([]int{-10}), expected: -10 },\n { actual: candidate([]int{7}), expected: 7 },\n { actual: candidate([]int{1, -1}), expected: -1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "go_test.go", - "prompt": "package select_words_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a string s and a natural number n, you have been tasked to implement \n// a function that returns a list of all words from string s that contain exactly \n// n consonants, in order these words appear in the string s.\n// If the string s is empty then the function should return an empty list.\n// Note: you may assume the input string contains only letters and spaces.\n// Examples:\nfunc select_words(s string, n int) []string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "func TestSelect_Words(t *testing.T) {\n candidate := select_words\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Mary had a little lamb\", 4), expected: []string{\"little\"} },\n { actual: candidate(\"Mary had a little lamb\", 3), expected: []string{\"Mary\", \"lamb\"} },\n { actual: candidate(\"simple white space\", 2), expected: []string{} },\n { actual: candidate(\"Hello world\", 4), expected: []string{\"world\"} },\n { actual: candidate(\"Uncle sam\", 3), expected: []string{\"Uncle\"} },\n { actual: candidate(\"\", 4), expected: []string{} },\n { actual: candidate(\"a b c d e f\", 1), expected: []string{\"b\", \"c\", \"d\", \"f\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "go_test.go", - "prompt": "package all_prefixes_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return list of all prefixes from shortest to longest of the input string\nfunc all_prefixes(myString string) []string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "func TestAll_Prefixes(t *testing.T) {\n candidate := all_prefixes\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: []string{} },\n { actual: candidate(\"asdfgh\"), expected: []string{\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"} },\n { actual: candidate(\"WWW\"), expected: []string{\"W\", \"WW\", \"WWW\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "go_test.go", - "prompt": "package closest_integer_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function that takes a value (string) representing a number\n// and returns the closest integer to it. If the number is equidistant\n// from two integers, round it away from zero.\n// Examples\n// Note:\n// Rounding away from zero means that if the given number is equidistant\n// from two integers, the one you should return is the one that is the\n// farthest from zero. For example closest_integer(\"14.5\") should\n// return 15 and closest_integer(\"-14.5\") should return -15.\nfunc closest_integer(value string) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "func TestClosest_Integer(t *testing.T) {\n candidate := closest_integer\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"10\"), expected: 10 },\n { actual: candidate(\"14.5\"), expected: 15 },\n { actual: candidate(\"-15.5\"), expected: -16 },\n { actual: candidate(\"15.3\"), expected: 15 },\n { actual: candidate(\"0\"), expected: 0 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "go_test.go", - "prompt": "package file_name_check_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function which takes a string representing a file's name, and returns\n// 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n// A file's name is considered to be valid if and only if all the following conditions \n// are met:\n// - There should not be more than three digits ('0'-'9') in the file's name.\n// - The file's name contains exactly one dot '.'\n// - The substring before the dot should not be empty, and it starts with a letter from \n// the latin alphapet ('a'-'z' and 'A'-'Z').\n// - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n// Examples:\nfunc file_name_check(file_name string) string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "func TestFile_Name_Check(t *testing.T) {\n candidate := file_name_check\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"example.txt\"), expected: \"Yes\" },\n { actual: candidate(\"1example.dll\"), expected: \"No\" },\n { actual: candidate(\"s1sdf3.asd\"), expected: \"No\" },\n { actual: candidate(\"K.dll\"), expected: \"Yes\" },\n { actual: candidate(\"MY16FILE3.exe\"), expected: \"Yes\" },\n { actual: candidate(\"His12FILE94.exe\"), expected: \"No\" },\n { actual: candidate(\"_Y.txt\"), expected: \"No\" },\n { actual: candidate(\"?aREYA.exe\"), expected: \"No\" },\n { actual: candidate(\"/this_is_valid.dll\"), expected: \"No\" },\n { actual: candidate(\"this_is_valid.wow\"), expected: \"No\" },\n { actual: candidate(\"this_is_valid.txt\"), expected: \"Yes\" },\n { actual: candidate(\"this_is_valid.txtexe\"), expected: \"No\" },\n { actual: candidate(\"#this2_i4s_5valid.ten\"), expected: \"No\" },\n { actual: candidate(\"@this1_is6_valid.exe\"), expected: \"No\" },\n { actual: candidate(\"this_is_12valid.6exe4.txt\"), expected: \"No\" },\n { actual: candidate(\"all.exe.txt\"), expected: \"No\" },\n { actual: candidate(\"I563_No.exe\"), expected: \"Yes\" },\n { actual: candidate(\"Is3youfault.txt\"), expected: \"Yes\" },\n { actual: candidate(\"no_one#knows.dll\"), expected: \"Yes\" },\n { actual: candidate(\"1I563_Yes3.exe\"), expected: \"No\" },\n { actual: candidate(\"I563_Yes3.txtt\"), expected: \"No\" },\n { actual: candidate(\"final..txt\"), expected: \"No\" },\n { actual: candidate(\"final132\"), expected: \"No\" },\n { actual: candidate(\"_f4indsartal132.\"), expected: \"No\" },\n { actual: candidate(\".txt\"), expected: \"No\" },\n { actual: candidate(\"s.\"), expected: \"No\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "go_test.go", - "prompt": "package intersection_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given two intervals,\n// where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n// The given intervals are closed which means that the interval (start, end)\n// includes both start and end.\n// For each given interval, it is assumed that its start is less or equal its end.\n// Your task is to determine whether the length of intersection of these two \n// intervals is a prime number.\n// Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n// which its length is 1, which not a prime number.\n// If the length of the intersection is a prime number, return \"YES\",\n// otherwise, return \"NO\".\n// If the two intervals don't intersect, return \"NO\".\n// [input/output] samples:\nfunc intersection(interval1 []interface{}, interval2 []interface{}) string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "func TestIntersection(t *testing.T) {\n candidate := intersection\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]interface{}{1, 2}, []interface{}{2, 3}), expected: \"NO\" },\n { actual: candidate([]interface{}{-1, 1}, []interface{}{0, 4}), expected: \"NO\" },\n { actual: candidate([]interface{}{-3, -1}, []interface{}{-5, 5}), expected: \"YES\" },\n { actual: candidate([]interface{}{-2, 2}, []interface{}{-4, 0}), expected: \"YES\" },\n { actual: candidate([]interface{}{-11, 2}, []interface{}{-1, -1}), expected: \"NO\" },\n { actual: candidate([]interface{}{1, 2}, []interface{}{3, 5}), expected: \"NO\" },\n { actual: candidate([]interface{}{1, 2}, []interface{}{1, 2}), expected: \"NO\" },\n { actual: candidate([]interface{}{-2, -2}, []interface{}{-3, -2}), expected: \"NO\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "go_test.go", - "prompt": "package largest_prime_factor_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return the largest prime factor of n. Assume n > 1 and is not a prime.\nfunc largest_prime_factor(n int) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "func TestLargest_Prime_Factor(t *testing.T) {\n candidate := largest_prime_factor\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(15), expected: 5 },\n { actual: candidate(27), expected: 3 },\n { actual: candidate(63), expected: 7 },\n { actual: candidate(330), expected: 11 },\n { actual: candidate(13195), expected: 29 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "go_test.go", - "prompt": "package count_distinct_characters_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a string, find out how many distinct characters (regardless of case) does it consist of\nfunc count_distinct_characters(myString string) int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "func TestCount_Distinct_Characters(t *testing.T) {\n candidate := count_distinct_characters\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: 0 },\n { actual: candidate(\"abcde\"), expected: 5 },\n { actual: candidate(\"abcdecadeCADE\"), expected: 5 },\n { actual: candidate(\"aaaaAAAAaaaa\"), expected: 1 },\n { actual: candidate(\"Jerry jERRY JeRRRY\"), expected: 5 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "go_test.go", - "prompt": "package below_zero_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You're given a list of deposit and withdrawal operations on a bank account that starts with\n// zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n// at that point function should return True. Otherwise it should return False.\nfunc below_zero(operations []int) bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "func TestBelow_Zero(t *testing.T) {\n candidate := below_zero\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}), expected: false },\n { actual: candidate([]int{1, 2, -3, 1, 2, -3}), expected: false },\n { actual: candidate([]int{1, 2, -4, 5, 6}), expected: true },\n { actual: candidate([]int{1, -1, 2, -2, 5, -5, 4, -4}), expected: false },\n { actual: candidate([]int{1, -1, 2, -2, 5, -5, 4, -5}), expected: true },\n { actual: candidate([]int{1, -2, 2, -2, 5, -5, 4, -4}), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "go_test.go", - "prompt": "package make_palindrome_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Find the shortest palindrome that begins with a supplied string.\n// Algorithm idea is simple:\n// - Find the longest postfix of supplied string that is a palindrome.\n// - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\nfunc make_palindrome(myString string) string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "func TestMake_Palindrome(t *testing.T) {\n candidate := make_palindrome\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: \"\" },\n { actual: candidate(\"x\"), expected: \"x\" },\n { actual: candidate(\"xyz\"), expected: \"xyzyx\" },\n { actual: candidate(\"xyx\"), expected: \"xyx\" },\n { actual: candidate(\"jerry\"), expected: \"jerryrrej\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "go_test.go", - "prompt": "package int_to_mini_roman_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a positive integer, obtain its roman numeral equivalent as a string,\n// and return it in lowercase.\n// Restrictions: 1 <= num <= 1000\n// Examples:\nfunc int_to_mini_roman(number int) string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "func TestInt_To_Mini_Roman(t *testing.T) {\n candidate := int_to_mini_roman\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(19), expected: \"xix\" },\n { actual: candidate(152), expected: \"clii\" },\n { actual: candidate(251), expected: \"ccli\" },\n { actual: candidate(426), expected: \"cdxxvi\" },\n { actual: candidate(500), expected: \"d\" },\n { actual: candidate(1), expected: \"i\" },\n { actual: candidate(4), expected: \"iv\" },\n { actual: candidate(43), expected: \"xliii\" },\n { actual: candidate(90), expected: \"xc\" },\n { actual: candidate(94), expected: \"xciv\" },\n { actual: candidate(532), expected: \"dxxxii\" },\n { actual: candidate(900), expected: \"cm\" },\n { actual: candidate(994), expected: \"cmxciv\" },\n { actual: candidate(1000), expected: \"m\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - } -] \ No newline at end of file diff --git a/data/go-reworded.json b/data/go-reworded.json deleted file mode 100644 index 7e8166a920fe8c503100b59e826b6eb0ad175645..0000000000000000000000000000000000000000 --- a/data/go-reworded.json +++ /dev/null @@ -1,2158 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "go_test.go", - "prompt": "package largest_divisor_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// For a given number n, find the largest number that divides n evenly, smaller than n\n// >>> largest_divisor(15)\n// 5\nfunc largest_divisor(n int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "reworded", - "tests": "func TestLargest_Divisor(t *testing.T) {\n candidate := largest_divisor\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3), expected: 1 },\n { actual: candidate(7), expected: 1 },\n { actual: candidate(10), expected: 5 },\n { actual: candidate(100), expected: 50 },\n { actual: candidate(49), expected: 7 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_47_median", - "language": "go_test.go", - "prompt": "package median_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return median of elements in the list l.\n// >>> median([]int{3, 1, 2, 4, 5})\n// 3\n// >>> median([]int{-10, 4, 6, 1000, 10, 20})\n// 15.0\nfunc median(l []int) float64 {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "reworded", - "tests": "func TestMedian(t *testing.T) {\n candidate := median\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{3, 1, 2, 4, 5}), expected: 3 },\n { actual: candidate([]int{-10, 4, 6, 1000, 10, 20}), expected: 8.0 },\n { actual: candidate([]int{5}), expected: 5 },\n { actual: candidate([]int{6, 5}), expected: 5.5 },\n { actual: candidate([]int{8, 1, 3, 9, 9, 2, 7}), expected: 7 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "go_test.go", - "prompt": "package do_algebra_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given two lists operator, and operand. The first list has basic algebra operations, and \n// the second list is a list of integers. Use the two given lists to build the algebric \n// expression and return the evaluation of this expression.\n// The basic algebra operations:\n// Addition ( + ) \n// Subtraction ( - ) \n// Multiplication ( * ) \n// Floor division ( // ) \n// Exponentiation ( ** ) \n// Example:\n// operator['+', '*', '-']\n// list = [2, 3, 4, 5]\n// result = 2 + 3 * 4 - 5\n// => result = 9\n// Note:\n// The length of operator list is equal to the length of operand list minus one.\n// Operand is a list of of non-negative integers.\n// Operator list has at least one operator, and operand list has at least two operands.\nfunc do_algebra(operator []string, operand []int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "reworded", - "tests": "func TestDo_Algebra(t *testing.T) {\n candidate := do_algebra\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{\"**\", \"*\", \"+\"}, []int{2, 3, 4, 5}), expected: 37 },\n { actual: candidate([]string{\"+\", \"*\", \"-\"}, []int{2, 3, 4, 5}), expected: 9 },\n { actual: candidate([]string{\"//\", \"*\"}, []int{7, 3, 4}), expected: 8 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "go_test.go", - "prompt": "package max_element_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return maximum element in the list.\n// >>> max_element([]int{1, 2, 3})\n// 3\n// >>> max_element([]int{5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10})\n// 123\nfunc max_element(l []int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "reworded", - "tests": "func TestMax_Element(t *testing.T) {\n candidate := max_element\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 3}), expected: 3 },\n { actual: candidate([]int{5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10}), expected: 124 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "go_test.go", - "prompt": "package can_arrange_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function which returns the largest index of an element which\n// is not greater than or equal to the element immediately preceding it. If\n// no such element exists then return -1. The given list will not contain\n// duplicate values.\n// Examples:\n// >>> can_arrange([]int{1, 2, 4, 3, 5})\n// 3\n// >>> can_arrange([]int{1, 2, 3})\n// -1\nfunc can_arrange(arr []int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "reworded", - "tests": "func TestCan_Arrange(t *testing.T) {\n candidate := can_arrange\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 4, 3, 5}), expected: 3 },\n { actual: candidate([]int{1, 2, 4, 5}), expected: -1 },\n { actual: candidate([]int{1, 4, 2, 5, 6, 7, 8, 9, 10}), expected: 2 },\n { actual: candidate([]int{4, 8, 5, 7, 3}), expected: 4 },\n { actual: candidate([]int{}), expected: -1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "go_test.go", - "prompt": "package car_race_collision_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Imagine a road that's a perfectly straight infinitely long line.\n// n cars are driving left to right; simultaneously, a different set of n cars\n// are driving right to left. The two sets of cars start out being very far from\n// each other. All cars move in the same speed. Two cars are said to collide\n// when a car that's moving left to right hits a car that's moving right to left.\n// However, the cars are infinitely sturdy and strong; as a result, they continue moving\n// in their trajectory as if they did not collide.\n// This function outputs the number of such collisions.\nfunc car_race_collision(n int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "reworded", - "tests": "func TestCar_Race_Collision(t *testing.T) {\n candidate := car_race_collision\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(2), expected: 4 },\n { actual: candidate(3), expected: 9 },\n { actual: candidate(4), expected: 16 },\n { actual: candidate(8), expected: 64 },\n { actual: candidate(10), expected: 100 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "go_test.go", - "prompt": "package check_if_last_char_is_a_letter_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function that returns true if the last character\n// of a given string is an alphabetical character and is not\n// a part of a word, and false otherwise.\n// Note: \"word\" is a group of characters separated by space.\n// Examples:\n// >>> check_if_last_char_is_a_letter(\"apple pie\")\n// false\n// >>> check_if_last_char_is_a_letter(\"apple pi e\")\n// true\n// >>> check_if_last_char_is_a_letter(\"apple pi e \")\n// false\n// >>> check_if_last_char_is_a_letter(\"\")\n// false\nfunc check_if_last_char_is_a_letter(txt string) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "reworded", - "tests": "func TestCheck_If_Last_Char_Is_A_Letter(t *testing.T) {\n candidate := check_if_last_char_is_a_letter\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"apple\"), expected: false },\n { actual: candidate(\"apple pi e\"), expected: true },\n { actual: candidate(\"eeeee\"), expected: false },\n { actual: candidate(\"A\"), expected: true },\n { actual: candidate(\"Pumpkin pie \"), expected: false },\n { actual: candidate(\"Pumpkin pie 1\"), expected: false },\n { actual: candidate(\"\"), expected: false },\n { actual: candidate(\"eeeee e \"), expected: false },\n { actual: candidate(\"apple pie\"), expected: false },\n { actual: candidate(\"apple pi e \"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "go_test.go", - "prompt": "package is_prime_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return true if a given number is prime, and false otherwise.\n// >>> is_prime(6)\n// false\n// >>> is_prime(101)\n// true\n// >>> is_prime(11)\n// true\n// >>> is_prime(13441)\n// true\n// >>> is_prime(61)\n// true\n// >>> is_prime(4)\n// false\n// >>> is_prime(1)\n// false\nfunc is_prime(n int) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "reworded", - "tests": "func TestIs_Prime(t *testing.T) {\n candidate := is_prime\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(6), expected: false },\n { actual: candidate(101), expected: true },\n { actual: candidate(11), expected: true },\n { actual: candidate(13441), expected: true },\n { actual: candidate(61), expected: true },\n { actual: candidate(4), expected: false },\n { actual: candidate(1), expected: false },\n { actual: candidate(5), expected: true },\n { actual: candidate(11), expected: true },\n { actual: candidate(17), expected: true },\n { actual: candidate(85), expected: false },\n { actual: candidate(77), expected: false },\n { actual: candidate(255379), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "go_test.go", - "prompt": "package unique_digits_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a list of positive integers x. return a sorted list of all \n// elements that hasn't any even digit.\n// Note: Returned list should be sorted in increasing order.\n// For example:\n// >>> unique_digits([]int{15, 33, 1422, 1})\n// []int{1, 15, 33}\n// >>> unique_digits([]int{152, 323, 1422, 10})\n// []int{}\nfunc unique_digits(x []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "reworded", - "tests": "func TestUnique_Digits(t *testing.T) {\n candidate := unique_digits\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{15, 33, 1422, 1}), expected: []int{1, 15, 33} },\n { actual: candidate([]int{152, 323, 1422, 10}), expected: []int{} },\n { actual: candidate([]int{12345, 2033, 111, 151}), expected: []int{111, 151} },\n { actual: candidate([]int{135, 103, 31}), expected: []int{31, 135} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "go_test.go", - "prompt": "package string_xor_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Input are two strings a and b consisting only of 1s and 0s.\n// Perform binary XOR on these inputs and return result also as a string.\n// >>> string_xor(\"010\", \"110\")\n// \"100\"\nfunc string_xor(a string, b string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "reworded", - "tests": "func TestString_Xor(t *testing.T) {\n candidate := string_xor\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"111000\", \"101010\"), expected: \"010010\" },\n { actual: candidate(\"1\", \"1\"), expected: \"0\" },\n { actual: candidate(\"0101\", \"0000\"), expected: \"0101\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "go_test.go", - "prompt": "package sum_to_n_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// sum_to_n is a function that sums numbers from 1 to n.\n// >>> sum_to_n(30)\n// 465\n// >>> sum_to_n(100)\n// 5050\n// >>> sum_to_n(5)\n// 15\n// >>> sum_to_n(10)\n// 55\n// >>> sum_to_n(1)\n// 1\nfunc sum_to_n(n int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "reworded", - "tests": "func TestSum_To_N(t *testing.T) {\n candidate := sum_to_n\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(1), expected: 1 },\n { actual: candidate(6), expected: 21 },\n { actual: candidate(11), expected: 66 },\n { actual: candidate(30), expected: 465 },\n { actual: candidate(100), expected: 5050 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "go_test.go", - "prompt": "package double_the_difference_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a list of numbers, return the sum of squares of the numbers\n// in the list that are odd. Ignore numbers that are negative or not integers.\n// >>> double_the_difference([]int{1, 3, 2, 0})\n// 10\n// >>> double_the_difference([]int{-1, -2, 0})\n// 0\n// >>> double_the_difference([]int{9, -2})\n// 81\n// >>> double_the_difference([]int{0})\n// 0\n// If the input list is empty, return 0.\nfunc double_the_difference(lst []float64) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "reworded", - "tests": "func TestDouble_The_Difference(t *testing.T) {\n candidate := double_the_difference\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]float64{}), expected: 0 },\n { actual: candidate([]float64{5.0, 4.0}), expected: 25 },\n { actual: candidate([]float64{0.1, 0.2, 0.3}), expected: 0 },\n { actual: candidate([]float64{-10.0, -20.0, -30.0}), expected: 0 },\n { actual: candidate([]float64{-1.0, -2.0, 8.0}), expected: 0 },\n { actual: candidate([]float64{0.2, 3.0, 5.0}), expected: 34 },\n { actual: candidate([]float64{-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0}), expected: 165 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "go_test.go", - "prompt": "package strlen_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return length of given string\n// >>> strlen(\"\")\n// 0\n// >>> strlen(\"abc\")\n// 3\nfunc strlen(myString string) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "reworded", - "tests": "func TestStrlen(t *testing.T) {\n candidate := strlen\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: 0 },\n { actual: candidate(\"x\"), expected: 1 },\n { actual: candidate(\"asdasnakj\"), expected: 9 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "go_test.go", - "prompt": "package is_bored_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You'll be given a string of words, and your task is to count the number\n// of boredoms. A boredom is a sentence that starts with the word \"I\".\n// Sentences are delimited by '.', '?' or '!'.\n// For example:\n// >>> is_bored(\"Hello world\")\n// 0\n// >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n// 1\nfunc is_bored(S string) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "reworded", - "tests": "func TestIs_Bored(t *testing.T) {\n candidate := is_bored\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Hello world\"), expected: 0 },\n { actual: candidate(\"Is the sky blue?\"), expected: 0 },\n { actual: candidate(\"I love It !\"), expected: 1 },\n { actual: candidate(\"bIt\"), expected: 0 },\n { actual: candidate(\"I feel good today. I will be productive. will kill It\"), expected: 2 },\n { actual: candidate(\"You and I are going for a walk\"), expected: 0 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "go_test.go", - "prompt": "package vowels_count_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function vowels_count which takes a string representing\n// a word as input and returns the number of vowels in the string.\n// Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n// vowel, but only when it is at the end of the given word.\n// Example:\n// >>> vowels_count(\"abcde\")\n// 2\n// >>> vowels_count(\"ACEDY\")\n// 3\nfunc vowels_count(s string) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "reworded", - "tests": "func TestVowels_Count(t *testing.T) {\n candidate := vowels_count\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"abcde\"), expected: 2 },\n { actual: candidate(\"Alone\"), expected: 3 },\n { actual: candidate(\"key\"), expected: 2 },\n { actual: candidate(\"bye\"), expected: 1 },\n { actual: candidate(\"keY\"), expected: 2 },\n { actual: candidate(\"bYe\"), expected: 1 },\n { actual: candidate(\"ACEDY\"), expected: 3 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_55_fib", - "language": "go_test.go", - "prompt": "package fib_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return n-th Fibonacci number.\n// >>> fib(10)\n// 55\n// >>> fib(1)\n// 1\n// >>> fib(8)\n// 21\nfunc fib(n int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "reworded", - "tests": "func TestFib(t *testing.T) {\n candidate := fib\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(10), expected: 55 },\n { actual: candidate(1), expected: 1 },\n { actual: candidate(8), expected: 21 },\n { actual: candidate(11), expected: 89 },\n { actual: candidate(12), expected: 144 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "go_test.go", - "prompt": "package simplify_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Your task is to implement a function that will simplify the expression\n// x * n. The function returns true if x * n evaluates to a whole number and false\n// otherwise. Both x and n, are string representation of a fraction, and have the following format,\n// / where both numerator and denominator are positive whole numbers.\n// You can assume that x, and n are valid fractions, and do not have zero as denominator.\n// >>> simplify(\"1/5\", \"5/1\")\n// true\n// >>> simplify(\"1/6\", \"2/1\")\n// false\n// >>> simplify(\"7/10\", \"10/2\")\n// false\nfunc simplify(x string, n string) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "reworded", - "tests": "func TestSimplify(t *testing.T) {\n candidate := simplify\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"1/5\", \"5/1\"), expected: true },\n { actual: candidate(\"1/6\", \"2/1\"), expected: false },\n { actual: candidate(\"5/1\", \"3/1\"), expected: true },\n { actual: candidate(\"7/10\", \"10/2\"), expected: false },\n { actual: candidate(\"2/10\", \"50/10\"), expected: true },\n { actual: candidate(\"7/2\", \"4/2\"), expected: true },\n { actual: candidate(\"11/6\", \"6/1\"), expected: true },\n { actual: candidate(\"2/3\", \"5/2\"), expected: false },\n { actual: candidate(\"5/2\", \"3/5\"), expected: false },\n { actual: candidate(\"2/4\", \"8/4\"), expected: true },\n { actual: candidate(\"2/4\", \"4/2\"), expected: true },\n { actual: candidate(\"1/5\", \"5/1\"), expected: true },\n { actual: candidate(\"1/5\", \"1/5\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "go_test.go", - "prompt": "package count_upper_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a string s, count the number of uppercase vowels in even indices.\n// For example:\n// >>> count_upper(\"aBCdEf\")\n// 1\n// >>> count_upper(\"abcdefg\")\n// 0\n// >>> count_upper(\"dBBE\")\n// 0\nfunc count_upper(s string) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "reworded", - "tests": "func TestCount_Upper(t *testing.T) {\n candidate := count_upper\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"aBCdEf\"), expected: 1 },\n { actual: candidate(\"abcdefg\"), expected: 0 },\n { actual: candidate(\"dBBE\"), expected: 0 },\n { actual: candidate(\"B\"), expected: 0 },\n { actual: candidate(\"U\"), expected: 1 },\n { actual: candidate(\"\"), expected: 0 },\n { actual: candidate(\"EEEE\"), expected: 2 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "go_test.go", - "prompt": "package max_fill_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a rectangular grid of wells. Each row represents a single well,\n// and each 1 in a row represents a single unit of water.\n// Each well has a corresponding bucket that can be used to extract water from it, \n// and all buckets have the same capacity.\n// Your task is to use the buckets to empty the wells.\n// Output the number of times you need to lower the buckets.\n// Example 1:\n// >>> max_fill([][]int{[]int{0, 0, 1, 0}, []int{0, 1, 0, 0}, []int{1, 1, 1, 1}}, 1)\n// 6\n// Example 2:\n// >>> max_fill([][]int{[]int{0, 0, 1, 1}, []int{0, 0, 0, 0}, []int{1, 1, 1, 1}, []int{0, 1, 1, 1}}, 2)\n// 5\n// Example 3:\n// >>> max_fill([][]int{[]int{0, 0, 0}, []int{0, 0, 0}}, 5)\n// 0\n// Constraints:\n// * all wells have the same length\n// * 1 <= grid.length <= 10^2\n// * 1 <= grid[:,1].length <= 10^2\n// * grid[i][j] -> 0 | 1\n// * 1 <= capacity <= 10\nfunc max_fill(grid [][]int, capacity int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "reworded", - "tests": "func TestMax_Fill(t *testing.T) {\n candidate := max_fill\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([][]int{[]int{0, 0, 1, 0}, []int{0, 1, 0, 0}, []int{1, 1, 1, 1}}, 1), expected: 6 },\n { actual: candidate([][]int{[]int{0, 0, 1, 1}, []int{0, 0, 0, 0}, []int{1, 1, 1, 1}, []int{0, 1, 1, 1}}, 2), expected: 5 },\n { actual: candidate([][]int{[]int{0, 0, 0}, []int{0, 0, 0}}, 5), expected: 0 },\n { actual: candidate([][]int{[]int{1, 1, 1, 1}, []int{1, 1, 1, 1}}, 2), expected: 4 },\n { actual: candidate([][]int{[]int{1, 1, 1, 1}, []int{1, 1, 1, 1}}, 9), expected: 2 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "go_test.go", - "prompt": "package maximum_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a list arr of integers and a positive integer k, return a sorted list \n// of length k with the maximum k numbers in arr.\n// Example 1:\n// >>> maximum([]int{-3, -4, 5}, 3)\n// []int{-4, -3, 5}\n// Example 2:\n// >>> maximum([]int{4, -4, 4}, 2)\n// []int{4, 4}\n// Example 3:\n// >>> maximum([]int{-3, 2, 1, 2, -1, -2, 1}, 1)\n// []int{2}\n// Note:\n// 1. The length of the list will be in the range of [1, 1000].\n// 2. The elements in the list will be in the range of [-1000, 1000].\n// 3. 0 <= k <= len(arr)\nfunc maximum(arr []int, k int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "reworded", - "tests": "func TestMaximum(t *testing.T) {\n candidate := maximum\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{-3, -4, 5}, 3), expected: []int{-4, -3, 5} },\n { actual: candidate([]int{4, -4, 4}, 2), expected: []int{4, 4} },\n { actual: candidate([]int{-3, 2, 1, 2, -1, -2, 1}, 1), expected: []int{2} },\n { actual: candidate([]int{123, -123, 20, 0, 1, 2, -3}, 3), expected: []int{2, 20, 123} },\n { actual: candidate([]int{-123, 20, 0, 1, 2, -3}, 4), expected: []int{0, 1, 2, 20} },\n { actual: candidate([]int{5, 15, 0, 3, -13, -8, 0}, 7), expected: []int{-13, -8, 0, 0, 3, 5, 15} },\n { actual: candidate([]int{-1, 0, 2, 5, 3, -10}, 2), expected: []int{3, 5} },\n { actual: candidate([]int{1, 0, 5, -7}, 1), expected: []int{5} },\n { actual: candidate([]int{4, -4}, 2), expected: []int{-4, 4} },\n { actual: candidate([]int{-10, 10}, 2), expected: []int{-10, 10} },\n { actual: candidate([]int{1, 2, 3, -23, 243, -400, 0}, 0), expected: []int{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_93_encode", - "language": "go_test.go", - "prompt": "package encode_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that takes a message, and encodes in such a \n// way that it swaps case of all letters, replaces all vowels in \n// the message with the letter that appears 2 places ahead of that \n// vowel in the english alphabet. \n// Assume only letters. \n// Examples:\n// >>> encode(\"test\")\n// \"TGST\"\n// >>> encode(\"This is a message\")\n// \"tHKS KS C MGSSCGG\"\nfunc encode(message string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "reworded", - "tests": "func TestEncode(t *testing.T) {\n candidate := encode\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"TEST\"), expected: \"tgst\" },\n { actual: candidate(\"Mudasir\"), expected: \"mWDCSKR\" },\n { actual: candidate(\"YES\"), expected: \"ygs\" },\n { actual: candidate(\"This is a message\"), expected: \"tHKS KS C MGSSCGG\" },\n { actual: candidate(\"I DoNt KnOw WhAt tO WrItE\"), expected: \"k dQnT kNqW wHcT Tq wRkTg\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "go_test.go", - "prompt": "package remove_vowels_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// remove_vowels is a function that takes string and returns string without vowels.\n// >>> remove_vowels(\"\")\n// \"\"\n// >>> remove_vowels(\"abcdef\")\n// \"bcdf\"\n// >>> remove_vowels(\"aaaaa\")\n// \"\"\n// >>> remove_vowels(\"aaBAA\")\n// \"B\"\n// >>> remove_vowels(\"zbcd\")\n// \"zbcd\"\nfunc remove_vowels(text string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "reworded", - "tests": "func TestRemove_Vowels(t *testing.T) {\n candidate := remove_vowels\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: \"\" },\n { actual: candidate(\"abcdef\\nghijklm\"), expected: \"bcdf\\nghjklm\" },\n { actual: candidate(\"fedcba\"), expected: \"fdcb\" },\n { actual: candidate(\"eeeee\"), expected: \"\" },\n { actual: candidate(\"acBAA\"), expected: \"cB\" },\n { actual: candidate(\"EcBOO\"), expected: \"cB\" },\n { actual: candidate(\"ybcd\"), expected: \"ybcd\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "go_test.go", - "prompt": "package get_positive_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return only positive numbers in the list.\n// >>> get_positive([]int{-1, 2, -4, 5, 6})\n// []int{2, 5, 6}\n// >>> get_positive([]int{5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10})\n// []int{5, 3, 2, 3, 9, 123, 1}\nfunc get_positive(l []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "reworded", - "tests": "func TestGet_Positive(t *testing.T) {\n candidate := get_positive\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{-1, -2, 4, 5, 6}), expected: []int{4, 5, 6} },\n { actual: candidate([]int{5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10}), expected: []int{5, 3, 2, 3, 3, 9, 123, 1} },\n { actual: candidate([]int{-1, -2}), expected: []int{} },\n { actual: candidate([]int{}), expected: []int{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "go_test.go", - "prompt": "package string_sequence_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n// >>> string_sequence(0)\n// \"0\"\n// >>> string_sequence(5)\n// \"0 1 2 3 4 5\"\nfunc string_sequence(n int) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "reworded", - "tests": "func TestString_Sequence(t *testing.T) {\n candidate := string_sequence\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(0), expected: \"0\" },\n { actual: candidate(3), expected: \"0 1 2 3\" },\n { actual: candidate(10), expected: \"0 1 2 3 4 5 6 7 8 9 10\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "go_test.go", - "prompt": "package make_a_pile_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a positive integer n, you have to make a pile of n levels of stones.\n// The first level has n stones.\n// The number of stones in the next level is:\n// - the next odd number if n is odd.\n// - the next even number if n is even.\n// Return the number of stones in each level in a list, where element at index\n// i represents the number of stones in the level (i+1).\n// Examples:\n// >>> make_a_pile(3)\n// []int{3, 5, 7}\nfunc make_a_pile(n int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "reworded", - "tests": "func TestMake_A_Pile(t *testing.T) {\n candidate := make_a_pile\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3), expected: []int{3, 5, 7} },\n { actual: candidate(4), expected: []int{4, 6, 8, 10} },\n { actual: candidate(5), expected: []int{5, 7, 9, 11, 13} },\n { actual: candidate(6), expected: []int{6, 8, 10, 12, 14, 16} },\n { actual: candidate(8), expected: []int{8, 10, 12, 14, 16, 18, 20, 22} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "go_test.go", - "prompt": "package reverse_delete_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Task\n// 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\n// then check if the result string is palindrome.\n// A string is called palindrome if it reads the same backward as forward.\n// You should return a list containing the result string and true/false for the check.\n// Example\n// >>> reverse_delete(\"abcde\", \"ae\")\n// []interface{}{\"bcd\", false}\n// >>> reverse_delete(\"abcdef\", \"b\")\n// []interface{}{\"acdef\", false}\n// >>> reverse_delete(\"abcdedcba\", \"ab\")\n// []interface{}{\"cdedc\", true}\nfunc reverse_delete(s string, c string) []interface{} {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "reworded", - "tests": "func TestReverse_Delete(t *testing.T) {\n candidate := reverse_delete\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"abcde\", \"ae\"), expected: []interface{}{\"bcd\", false} },\n { actual: candidate(\"abcdef\", \"b\"), expected: []interface{}{\"acdef\", false} },\n { actual: candidate(\"abcdedcba\", \"ab\"), expected: []interface{}{\"cdedc\", true} },\n { actual: candidate(\"dwik\", \"w\"), expected: []interface{}{\"dik\", false} },\n { actual: candidate(\"a\", \"a\"), expected: []interface{}{\"\", true} },\n { actual: candidate(\"abcdedcba\", \"\"), expected: []interface{}{\"abcdedcba\", true} },\n { actual: candidate(\"abcdedcba\", \"v\"), expected: []interface{}{\"abcdedcba\", true} },\n { actual: candidate(\"vabba\", \"v\"), expected: []interface{}{\"abba\", true} },\n { actual: candidate(\"mamma\", \"mia\"), expected: []interface{}{\"\", true} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "go_test.go", - "prompt": "package flip_case_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n// >>> flip_case(\"Hello\")\n// \"hELLO\"\nfunc flip_case(myString string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "reworded", - "tests": "func TestFlip_Case(t *testing.T) {\n candidate := flip_case\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: \"\" },\n { actual: candidate(\"Hello!\"), expected: \"hELLO!\" },\n { actual: candidate(\"These violent delights have violent ends\"), expected: \"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_161_solve", - "language": "go_test.go", - "prompt": "package solve_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a string s.\n// if s[i] is a letter, reverse its case from lower to upper or vise versa, \n// otherwise keep it as it is.\n// If the string contains no letters, reverse the string.\n// The function should return the resulted string.\n// Examples\n// >>> solve(\"1234\")\n// \"4321\"\n// >>> solve(\"ab\")\n// \"AB\"\n// >>> solve(\"#a@C\")\n// \"#A@c\"\nfunc solve(s string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "reworded", - "tests": "func TestSolve(t *testing.T) {\n candidate := solve\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"AsDf\"), expected: \"aSdF\" },\n { actual: candidate(\"1234\"), expected: \"4321\" },\n { actual: candidate(\"ab\"), expected: \"AB\" },\n { actual: candidate(\"#a@C\"), expected: \"#A@c\" },\n { actual: candidate(\"#AsdfW^45\"), expected: \"#aSDFw^45\" },\n { actual: candidate(\"#6@2\"), expected: \"2@6#\" },\n { actual: candidate(\"#$a^D\"), expected: \"#$A^d\" },\n { actual: candidate(\"#ccc\"), expected: \"#CCC\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "go_test.go", - "prompt": "package filter_by_prefix_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Filter an input list of strings only for ones that start with a given prefix.\n// >>> filter_by_prefix([]string{}, \"a\")\n// []string{}\n// >>> filter_by_prefix([]string{\"abc\", \"bcd\", \"cde\", \"array\"}, \"a\")\n// []string{\"abc\", \"array\"}\nfunc filter_by_prefix(strings []string, prefix string) []string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "reworded", - "tests": "func TestFilter_By_Prefix(t *testing.T) {\n candidate := filter_by_prefix\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{}, \"john\"), expected: []string{} },\n { actual: candidate([]string{\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"}, \"xxx\"), expected: []string{\"xxx\", \"xxxAAA\", \"xxx\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "go_test.go", - "prompt": "package choose_num_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// This function takes two positive numbers x and y and returns the\n// biggest even integer number that is in the range [x, y] inclusive. If \n// there's no such number, then the function should return -1.\n// For example:\n// >>> choose_num(12, 15)\n// 14\n// >>> choose_num(13, 12)\n// -1\nfunc choose_num(x int, y int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "reworded", - "tests": "func TestChoose_Num(t *testing.T) {\n candidate := choose_num\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(12, 15), expected: 14 },\n { actual: candidate(13, 12), expected: -1 },\n { actual: candidate(33, 12354), expected: 12354 },\n { actual: candidate(5234, 5233), expected: -1 },\n { actual: candidate(6, 29), expected: 28 },\n { actual: candidate(27, 10), expected: -1 },\n { actual: candidate(7, 7), expected: -1 },\n { actual: candidate(546, 546), expected: 546 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "go_test.go", - "prompt": "package words_in_sentence_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a string representing a sentence,\n// the sentence contains some words separated by a space,\n// and you have to return a string that contains the words from the original sentence,\n// whose lengths are prime numbers,\n// the order of the words in the new string should be the same as the original one.\n// Example 1:\n// >>> words_in_sentence(\"This is a test\")\n// \"is\"\n// Example 2:\n// >>> words_in_sentence(\"lets go for swimming\")\n// \"go for\"\n// Constraints:\n// * 1 <= len(sentence) <= 100\n// * sentence contains only letters\nfunc words_in_sentence(sentence string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "reworded", - "tests": "func TestWords_In_Sentence(t *testing.T) {\n candidate := words_in_sentence\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"This is a test\"), expected: \"is\" },\n { actual: candidate(\"lets go for swimming\"), expected: \"go for\" },\n { actual: candidate(\"there is no place available here\"), expected: \"there is no place\" },\n { actual: candidate(\"Hi I am Hussein\"), expected: \"Hi am Hussein\" },\n { actual: candidate(\"go for it\"), expected: \"go for it\" },\n { actual: candidate(\"here\"), expected: \"\" },\n { actual: candidate(\"here is\"), expected: \"is\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "go_test.go", - "prompt": "package intersperse_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n// >>> intersperse([]int{}, 4)\n// []int{}\n// >>> intersperse([]int{1, 2, 3}, 4)\n// []int{1, 4, 2, 4, 3}\nfunc intersperse(numbers []int, delimeter int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "reworded", - "tests": "func TestIntersperse(t *testing.T) {\n candidate := intersperse\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}, 7), expected: []int{} },\n { actual: candidate([]int{5, 6, 3, 2}, 8), expected: []int{5, 8, 6, 8, 3, 8, 2} },\n { actual: candidate([]int{2, 2, 2}, 2), expected: []int{2, 2, 2, 2, 2} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "go_test.go", - "prompt": "package is_simple_power_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Your task is to write a function that returns true if a number x is a simple\n// power of n and false in other cases.\n// x is a simple power of n if n**int=x\n// For example:\n// >>> is_simple_power(1, 4)\n// true\n// >>> is_simple_power(2, 2)\n// true\n// >>> is_simple_power(8, 2)\n// true\n// >>> is_simple_power(3, 2)\n// false\n// >>> is_simple_power(3, 1)\n// false\n// >>> is_simple_power(5, 3)\n// false\nfunc is_simple_power(x int, n int) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "reworded", - "tests": "func TestIs_Simple_Power(t *testing.T) {\n candidate := is_simple_power\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(16, 2), expected: true },\n { actual: candidate(143214, 16), expected: false },\n { actual: candidate(4, 2), expected: true },\n { actual: candidate(9, 3), expected: true },\n { actual: candidate(16, 4), expected: true },\n { actual: candidate(24, 2), expected: false },\n { actual: candidate(128, 4), expected: false },\n { actual: candidate(12, 6), expected: false },\n { actual: candidate(1, 1), expected: true },\n { actual: candidate(1, 12), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "go_test.go", - "prompt": "package is_multiply_prime_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that returns true if the given number is the multiplication of 3 prime numbers\n// and false otherwise.\n// Knowing that (a) is less then 100. \n// Example:\n// >>> is_multiply_prime(30)\n// true\n// 30 = 2 * 3 * 5\nfunc is_multiply_prime(a int) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "reworded", - "tests": "func TestIs_Multiply_Prime(t *testing.T) {\n candidate := is_multiply_prime\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5), expected: false },\n { actual: candidate(30), expected: true },\n { actual: candidate(8), expected: true },\n { actual: candidate(10), expected: false },\n { actual: candidate(125), expected: true },\n { actual: candidate(105), expected: true },\n { actual: candidate(126), expected: false },\n { actual: candidate(729), expected: false },\n { actual: candidate(891), expected: false },\n { actual: candidate(1001), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "go_test.go", - "prompt": "package right_angle_triangle_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given the lengths of the three sides of a triangle. Return true if the three\n// sides form a right-angled triangle, false otherwise.\n// A right-angled triangle is a triangle in which one angle is right angle or \n// 90 degree.\n// Example:\n// >>> right_angle_triangle(3, 4, 5)\n// true\n// >>> right_angle_triangle(1, 2, 3)\n// false\nfunc right_angle_triangle(a int, b int, c int) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "reworded", - "tests": "func TestRight_Angle_Triangle(t *testing.T) {\n candidate := right_angle_triangle\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3, 4, 5), expected: true },\n { actual: candidate(1, 2, 3), expected: false },\n { actual: candidate(10, 6, 8), expected: true },\n { actual: candidate(2, 2, 2), expected: false },\n { actual: candidate(7, 24, 25), expected: true },\n { actual: candidate(10, 5, 7), expected: false },\n { actual: candidate(5, 12, 13), expected: true },\n { actual: candidate(15, 8, 17), expected: true },\n { actual: candidate(48, 55, 73), expected: true },\n { actual: candidate(1, 1, 1), expected: false },\n { actual: candidate(2, 2, 10), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "go_test.go", - "prompt": "package any_int_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function that takes 3 numbers.\n// Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n// Returns false in any other cases.\n// Examples\n// >>> any_int(5, 2, 7)\n// true\n// >>> any_int(3, 2, 2)\n// false\n// >>> any_int(3, -2, 1)\n// true\n// >>> any_int(3.6, -2.2, 2)\n// false\nfunc any_int(x float64, y float64, z float64) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "reworded", - "tests": "func TestAny_Int(t *testing.T) {\n candidate := any_int\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(2, 3, 1), expected: true },\n { actual: candidate(2.5, 2, 3), expected: false },\n { actual: candidate(1.5, 5, 3.5), expected: false },\n { actual: candidate(2, 6, 2), expected: false },\n { actual: candidate(4, 2, 2), expected: true },\n { actual: candidate(2.2, 2.2, 2.2), expected: false },\n { actual: candidate(-4, 6, 2), expected: true },\n { actual: candidate(2, 1, 1), expected: true },\n { actual: candidate(3, 4, 7), expected: true },\n { actual: candidate(3.0, 4, 7), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "go_test.go", - "prompt": "package sort_third_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// This function takes a list l and returns a list l' such that\n// l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n// to the values of the corresponding indicies of l, but sorted.\n// >>> sort_third([]int{1, 2, 3})\n// []int{1, 2, 3}\n// >>> sort_third([]int{5, 6, 3, 4, 8, 9, 2})\n// []int{2, 6, 3, 4, 8, 9, 5}\nfunc sort_third(l []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "reworded", - "tests": "func TestSort_Third(t *testing.T) {\n candidate := sort_third\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{5, 6, 3, 4, 8, 9, 2}), expected: []int{2, 6, 3, 4, 8, 9, 5} },\n { actual: candidate([]int{5, 8, 3, 4, 6, 9, 2}), expected: []int{2, 8, 3, 4, 6, 9, 5} },\n { actual: candidate([]int{5, 6, 9, 4, 8, 3, 2}), expected: []int{2, 6, 9, 4, 8, 3, 5} },\n { actual: candidate([]int{5, 6, 3, 4, 8, 9, 2, 1}), expected: []int{2, 6, 3, 4, 8, 9, 5, 1} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_53_add", - "language": "go_test.go", - "prompt": "package add_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Add two numbers x and y\n// >>> add(2, 3)\n// 5\n// >>> add(5, 7)\n// 12\nfunc add(x int, y int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "reworded", - "tests": "func TestAdd(t *testing.T) {\n candidate := add\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(0, 1), expected: 1 },\n { actual: candidate(1, 0), expected: 1 },\n { actual: candidate(2, 3), expected: 5 },\n { actual: candidate(5, 7), expected: 12 },\n { actual: candidate(7, 5), expected: 12 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_69_search", - "language": "go_test.go", - "prompt": "package search_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n// zero, and has a frequency greater than or equal to the value of the integer itself. \n// The frequency of an integer is the number of times it appears in the list.\n// If no such a value exist, return -1.\n// Examples:\n// >>> search([]int{4, 1, 2, 2, 3, 1})\n// 2\n// >>> search([]int{1, 2, 2, 3, 3, 3, 4, 4, 4})\n// 3\n// >>> search([]int{5, 5, 4, 4, 4})\n// -1\nfunc search(lst []int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "reworded", - "tests": "func TestSearch(t *testing.T) {\n candidate := search\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{5, 5, 5, 5, 1}), expected: 1 },\n { actual: candidate([]int{4, 1, 4, 1, 4, 4}), expected: 4 },\n { actual: candidate([]int{3, 3}), expected: -1 },\n { actual: candidate([]int{8, 8, 8, 8, 8, 8, 8, 8}), expected: 8 },\n { actual: candidate([]int{2, 3, 3, 2, 2}), expected: 2 },\n { actual: candidate([]int{2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1}), expected: 1 },\n { actual: candidate([]int{3, 2, 8, 2}), expected: 2 },\n { actual: candidate([]int{6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10}), expected: 1 },\n { actual: candidate([]int{8, 8, 3, 6, 5, 6, 4}), expected: -1 },\n { actual: candidate([]int{6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9}), expected: 1 },\n { actual: candidate([]int{1, 9, 10, 1, 3}), expected: 1 },\n { actual: candidate([]int{6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10}), expected: 5 },\n { actual: candidate([]int{1}), expected: 1 },\n { actual: candidate([]int{8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5}), expected: 4 },\n { actual: candidate([]int{2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10}), expected: 2 },\n { actual: candidate([]int{1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3}), expected: 1 },\n { actual: candidate([]int{9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4}), expected: 4 },\n { actual: candidate([]int{2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7}), expected: 4 },\n { actual: candidate([]int{9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1}), expected: 2 },\n { actual: candidate([]int{5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8}), expected: -1 },\n { actual: candidate([]int{10}), expected: -1 },\n { actual: candidate([]int{9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2}), expected: 2 },\n { actual: candidate([]int{5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8}), expected: 1 },\n { actual: candidate([]int{7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6}), expected: 1 },\n { actual: candidate([]int{3, 10, 10, 9, 2}), expected: -1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "go_test.go", - "prompt": "package prime_length_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that takes a string and returns true if the string\n// length is a prime number or false otherwise\n// Examples\n// >>> prime_length(\"Hello\")\n// true\n// >>> prime_length(\"abcdcba\")\n// true\n// >>> prime_length(\"kittens\")\n// true\n// >>> prime_length(\"orange\")\n// false\nfunc prime_length(myString string) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "reworded", - "tests": "func TestPrime_Length(t *testing.T) {\n candidate := prime_length\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Hello\"), expected: true },\n { actual: candidate(\"abcdcba\"), expected: true },\n { actual: candidate(\"kittens\"), expected: true },\n { actual: candidate(\"orange\"), expected: false },\n { actual: candidate(\"wow\"), expected: true },\n { actual: candidate(\"world\"), expected: true },\n { actual: candidate(\"MadaM\"), expected: true },\n { actual: candidate(\"Wow\"), expected: true },\n { actual: candidate(\"\"), expected: false },\n { actual: candidate(\"HI\"), expected: true },\n { actual: candidate(\"go\"), expected: true },\n { actual: candidate(\"gogo\"), expected: false },\n { actual: candidate(\"aaaaaaaaaaaaaaa\"), expected: false },\n { actual: candidate(\"Madam\"), expected: true },\n { actual: candidate(\"M\"), expected: false },\n { actual: candidate(\"0\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_58_common", - "language": "go_test.go", - "prompt": "package common_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return sorted unique common elements for two lists.\n// >>> common([]int{1, 4, 3, 34, 653, 2, 5}, []int{5, 7, 1, 5, 9, 653, 121})\n// []int{1, 5, 653}\n// >>> common([]int{5, 3, 2, 8}, []int{3, 2})\n// []int{2, 3}\nfunc common(l1 []int, l2 []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "reworded", - "tests": "func TestCommon(t *testing.T) {\n candidate := common\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 4, 3, 34, 653, 2, 5}, []int{5, 7, 1, 5, 9, 653, 121}), expected: []int{1, 5, 653} },\n { actual: candidate([]int{5, 3, 2, 8}, []int{3, 2}), expected: []int{2, 3} },\n { actual: candidate([]int{4, 3, 2, 8}, []int{3, 2, 4}), expected: []int{2, 3, 4} },\n { actual: candidate([]int{4, 3, 2, 8}, []int{}), expected: []int{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "go_test.go", - "prompt": "package special_factorial_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// The Brazilian factorial is defined as:\n// brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n// where n > 0\n// For example:\n// >>> special_factorial(4)\n// 288\n// The function will receive an integer as input and should return the special\n// factorial of this integer.\nfunc special_factorial(n int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "reworded", - "tests": "func TestSpecial_Factorial(t *testing.T) {\n candidate := special_factorial\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(4), expected: 288 },\n { actual: candidate(5), expected: 34560 },\n { actual: candidate(7), expected: 125411328000 },\n { actual: candidate(1), expected: 1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "go_test.go", - "prompt": "package exchange_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// In this problem, you will implement a function that takes two lists of numbers,\n// and determines whether it is possible to perform an exchange of elements\n// between them to make lst1 a list of only even numbers.\n// There is no limit on the number of exchanged elements between lst1 and lst2.\n// If it is possible to exchange elements between the lst1 and lst2 to make\n// all the elements of lst1 to be even, return \"YES\".\n// Otherwise, return \"NO\".\n// For example:\n// >>> exchange([]int{1, 2, 3, 4}, []int{1, 2, 3, 4})\n// \"YES\"\n// >>> exchange([]int{1, 2, 3, 4}, []int{1, 5, 3, 4})\n// \"NO\"\n// It is assumed that the input lists will be non-empty.\nfunc exchange(lst1 []int, lst2 []int) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "reworded", - "tests": "func TestExchange(t *testing.T) {\n candidate := exchange\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 3, 4}, []int{1, 2, 3, 4}), expected: \"YES\" },\n { actual: candidate([]int{1, 2, 3, 4}, []int{1, 5, 3, 4}), expected: \"NO\" },\n { actual: candidate([]int{1, 2, 3, 4}, []int{2, 1, 4, 3}), expected: \"YES\" },\n { actual: candidate([]int{5, 7, 3}, []int{2, 6, 4}), expected: \"YES\" },\n { actual: candidate([]int{5, 7, 3}, []int{2, 6, 3}), expected: \"NO\" },\n { actual: candidate([]int{3, 2, 6, 1, 8, 9}, []int{3, 5, 5, 1, 1, 1}), expected: \"NO\" },\n { actual: candidate([]int{100, 200}, []int{200, 200}), expected: \"YES\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "go_test.go", - "prompt": "package add_elements_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a non-empty list of integers arr and an integer k, return\n// the sum of the elements with at most two digits from the first k elements of arr.\n// Example:\n// >>> add_elements([]int{111, 21, 3, 4000, 5, 6, 7, 8, 9}, 4)\n// 24\n// Constraints:\n// 1. 1 <= len(arr) <= 100\n// 2. 1 <= k <= len(arr)\nfunc add_elements(arr []int, k int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "reworded", - "tests": "func TestAdd_Elements(t *testing.T) {\n candidate := add_elements\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, -2, -3, 41, 57, 76, 87, 88, 99}, 3), expected: -4 },\n { actual: candidate([]int{111, 121, 3, 4000, 5, 6}, 2), expected: 0 },\n { actual: candidate([]int{11, 21, 3, 90, 5, 6, 7, 8, 9}, 4), expected: 125 },\n { actual: candidate([]int{111, 21, 3, 4000, 5, 6, 7, 8, 9}, 4), expected: 24 },\n { actual: candidate([]int{1}, 1), expected: 1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "go_test.go", - "prompt": "package x_or_y_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// A simple program which should return the value of x if n is \n// a prime number and should return the value of y otherwise.\n// Examples:\n// >>> x_or_y(7, 34, 12)\n// 34\n// >>> x_or_y(15, 8, 5)\n// 5\nfunc x_or_y(n int, x int, y int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "reworded", - "tests": "func TestX_Or_Y(t *testing.T) {\n candidate := x_or_y\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(7, 34, 12), expected: 34 },\n { actual: candidate(15, 8, 5), expected: 5 },\n { actual: candidate(3, 33, 5212), expected: 33 },\n { actual: candidate(1259, 3, 52), expected: 3 },\n { actual: candidate(7919, -1, 12), expected: -1 },\n { actual: candidate(3609, 1245, 583), expected: 583 },\n { actual: candidate(91, 56, 129), expected: 129 },\n { actual: candidate(6, 34, 1234), expected: 1234 },\n { actual: candidate(1, 2, 0), expected: 0 },\n { actual: candidate(2, 2, 0), expected: 2 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "go_test.go", - "prompt": "package triangle_area_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given length of a side and high return area for a triangle.\n// >>> triangle_area(5, 3)\n// 7.5\nfunc triangle_area(a int, h int) float64 {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "func TestTriangle_Area(t *testing.T) {\n candidate := triangle_area\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5, 3), expected: 7.5 },\n { actual: candidate(2, 2), expected: 2.0 },\n { actual: candidate(10, 8), expected: 40.0 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_130_tri", - "language": "go_test.go", - "prompt": "package tri_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n// the last couple centuries. However, what people don't know is Tribonacci sequence.\n// Tribonacci sequence is defined by the recurrence:\n// tri(1) = 3\n// tri(n) = 1 + n / 2, if n is even.\n// tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n// For example:\n// tri(2) = 1 + (2 / 2) = 2\n// tri(4) = 3\n// tri(3) = tri(2) + tri(1) + tri(4)\n// = 2 + 3 + 3 = 8 \n// You are given a non-negative integer number n, you have to a return a list of the \n// first n + 1 numbers of the Tribonacci sequence.\n// Examples:\n// >>> tri(3)\n// []int{1, 3, 2, 8}\nfunc tri(n int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "reworded", - "tests": "func TestTri(t *testing.T) {\n candidate := tri\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3), expected: []int{1, 3, 2, 8} },\n { actual: candidate(4), expected: []int{1, 3, 2, 8, 3} },\n { actual: candidate(5), expected: []int{1, 3, 2, 8, 3, 15} },\n { actual: candidate(6), expected: []int{1, 3, 2, 8, 3, 15, 4} },\n { actual: candidate(7), expected: []int{1, 3, 2, 8, 3, 15, 4, 24} },\n { actual: candidate(8), expected: []int{1, 3, 2, 8, 3, 15, 4, 24, 5} },\n { actual: candidate(9), expected: []int{1, 3, 2, 8, 3, 15, 4, 24, 5, 35} },\n { actual: candidate(20), expected: []int{1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11} },\n { actual: candidate(0), expected: []int{1} },\n { actual: candidate(1), expected: []int{1, 3} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "go_test.go", - "prompt": "package match_parens_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a list of two strings, both strings consist of open\n// parentheses '(' or close parentheses ')' only.\n// Your job is to check if it is possible to concatenate the two strings in\n// some order, that the resulting string will be good.\n// A string S is considered to be good if and only if all parentheses in S\n// are balanced. For example: the string '(())()' is good, while the string\n// '())' is not.\n// Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n// Examples:\n// >>> match_parens([]string{\"()(\", \")\"})\n// \"Yes\"\n// >>> match_parens([]string{\")\", \")\"})\n// \"No\"\nfunc match_parens(lst []string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "reworded", - "tests": "func TestMatch_Parens(t *testing.T) {\n candidate := match_parens\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{\"()(\", \")\"}), expected: \"Yes\" },\n { actual: candidate([]string{\")\", \")\"}), expected: \"No\" },\n { actual: candidate([]string{\"(()(())\", \"())())\"}), expected: \"No\" },\n { actual: candidate([]string{\")())\", \"(()()(\"}), expected: \"Yes\" },\n { actual: candidate([]string{\"(())))\", \"(()())((\"}), expected: \"Yes\" },\n { actual: candidate([]string{\"()\", \"())\"}), expected: \"No\" },\n { actual: candidate([]string{\"(()(\", \"()))()\"}), expected: \"Yes\" },\n { actual: candidate([]string{\"((((\", \"((())\"}), expected: \"No\" },\n { actual: candidate([]string{\")(()\", \"(()(\"}), expected: \"No\" },\n { actual: candidate([]string{\")(\", \")(\"}), expected: \"No\" },\n { actual: candidate([]string{\"(\", \")\"}), expected: \"Yes\" },\n { actual: candidate([]string{\")\", \"(\"}), expected: \"Yes\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "go_test.go", - "prompt": "package remove_duplicates_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// From a list of integers, remove all elements that occur more than once.\n// Keep order of elements left the same as in the input.\n// >>> remove_duplicates([]int{1, 2, 3, 2, 4})\n// []int{1, 3, 4}\nfunc remove_duplicates(numbers []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "reworded", - "tests": "func TestRemove_Duplicates(t *testing.T) {\n candidate := remove_duplicates\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{1, 2, 3, 4}), expected: []int{1, 2, 3, 4} },\n { actual: candidate([]int{1, 2, 3, 2, 4, 3, 5}), expected: []int{1, 4, 5} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "go_test.go", - "prompt": "package greatest_common_divisor_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return a greatest common divisor of two integers a and b\n// >>> greatest_common_divisor(3, 5)\n// 1\n// >>> greatest_common_divisor(25, 15)\n// 5\nfunc greatest_common_divisor(a int, b int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "reworded", - "tests": "func TestGreatest_Common_Divisor(t *testing.T) {\n candidate := greatest_common_divisor\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3, 7), expected: 1 },\n { actual: candidate(10, 15), expected: 5 },\n { actual: candidate(49, 14), expected: 7 },\n { actual: candidate(144, 60), expected: 12 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "go_test.go", - "prompt": "package is_palindrome_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Checks if given string is a palindrome\n// >>> is_palindrome(\"\")\n// true\n// >>> is_palindrome(\"aba\")\n// true\n// >>> is_palindrome(\"aaaaa\")\n// true\n// >>> is_palindrome(\"zbcd\")\n// false\nfunc is_palindrome(text string) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "reworded", - "tests": "func TestIs_Palindrome(t *testing.T) {\n candidate := is_palindrome\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: true },\n { actual: candidate(\"aba\"), expected: true },\n { actual: candidate(\"aaaaa\"), expected: true },\n { actual: candidate(\"zbcd\"), expected: false },\n { actual: candidate(\"xywyx\"), expected: true },\n { actual: candidate(\"xywyz\"), expected: false },\n { actual: candidate(\"xywzx\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "go_test.go", - "prompt": "package derivative_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// xs represent coefficients of a polynomial.\n// xs[0] + xs[1] * x + xs[2] * x^2 + ....\n// Return derivative of this polynomial in the same form.\n// >>> derivative([]int{3, 1, 2, 4, 5})\n// []int{1, 4, 12, 20}\n// >>> derivative([]int{1, 2, 3})\n// []int{2, 6}\nfunc derivative(xs []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "reworded", - "tests": "func TestDerivative(t *testing.T) {\n candidate := derivative\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{3, 1, 2, 4, 5}), expected: []int{1, 4, 12, 20} },\n { actual: candidate([]int{1, 2, 3}), expected: []int{2, 6} },\n { actual: candidate([]int{3, 2, 1}), expected: []int{2, 2} },\n { actual: candidate([]int{3, 2, 1, 0, 4}), expected: []int{2, 2, 0, 16} },\n { actual: candidate([]int{1}), expected: []int{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "go_test.go", - "prompt": "package fruit_distribution_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// In this task, you will be given a string that represents a number of apples and oranges \n// that are distributed in a basket of fruit this basket contains \n// apples, oranges, and mango fruits. Given the string that represents the total number of \n// the oranges and apples and an integer that represent the total number of the fruits \n// in the basket return the number of the mango fruits in the basket.\n// for examble:\n// >>> fruit_distribution(\"5 apples and 6 oranges\", 19)\n// 8\n// >>> fruit_distribution(\"0 apples and 1 oranges\", 3)\n// 2\n// >>> fruit_distribution(\"2 apples and 3 oranges\", 100)\n// 95\n// >>> fruit_distribution(\"100 apples and 1 oranges\", 120)\n// 19\nfunc fruit_distribution(s string, n int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "reworded", - "tests": "func TestFruit_Distribution(t *testing.T) {\n candidate := fruit_distribution\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"5 apples and 6 oranges\", 19), expected: 8 },\n { actual: candidate(\"5 apples and 6 oranges\", 21), expected: 10 },\n { actual: candidate(\"0 apples and 1 oranges\", 3), expected: 2 },\n { actual: candidate(\"1 apples and 0 oranges\", 3), expected: 2 },\n { actual: candidate(\"2 apples and 3 oranges\", 100), expected: 95 },\n { actual: candidate(\"2 apples and 3 oranges\", 5), expected: 0 },\n { actual: candidate(\"1 apples and 100 oranges\", 120), expected: 19 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "go_test.go", - "prompt": "package iscube_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that takes an integer a and returns true \n// if this ingeger is a cube of some integer number.\n// Note: you may assume the input is always valid.\n// Examples:\n// >>> iscube(1)\n// true\n// >>> iscube(2)\n// false\n// >>> iscube(-1)\n// true\n// >>> iscube(64)\n// true\n// >>> iscube(0)\n// true\n// >>> iscube(180)\n// false\nfunc iscube(a int) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "reworded", - "tests": "func TestIscube(t *testing.T) {\n candidate := iscube\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(1), expected: true },\n { actual: candidate(2), expected: false },\n { actual: candidate(-1), expected: true },\n { actual: candidate(64), expected: true },\n { actual: candidate(180), expected: false },\n { actual: candidate(1000), expected: true },\n { actual: candidate(0), expected: true },\n { actual: candidate(1729), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "go_test.go", - "prompt": "package sort_array_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// In this Kata, you have to sort a list of non-negative integers according to\n// number of ones in their binary representation in ascending order.\n// For similar number of ones, sort based on decimal value.\n// It must be implemented like this:\n// >>> sort_array([]int{1, 5, 2, 3, 4})\n// []int{1, 2, 3, 4, 5}\n// >>> sort_array([]int{-2, -3, -4, -5, -6})\n// []int{-6, -5, -4, -3, -2}\n// >>> sort_array([]int{1, 0, 2, 3, 4})\n// []int{0, 1, 2, 3, 4}\nfunc sort_array(arr []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "reworded", - "tests": "func TestSort_Array(t *testing.T) {\n candidate := sort_array\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 5, 2, 3, 4}), expected: []int{1, 2, 4, 3, 5} },\n { actual: candidate([]int{-2, -3, -4, -5, -6}), expected: []int{-4, -2, -6, -5, -3} },\n { actual: candidate([]int{1, 0, 2, 3, 4}), expected: []int{0, 1, 2, 4, 3} },\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4}), expected: []int{2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77} },\n { actual: candidate([]int{3, 6, 44, 12, 32, 5}), expected: []int{32, 3, 5, 6, 12, 44} },\n { actual: candidate([]int{2, 4, 8, 16, 32}), expected: []int{2, 4, 8, 16, 32} },\n { actual: candidate([]int{2, 4, 8, 16, 32}), expected: []int{2, 4, 8, 16, 32} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "go_test.go", - "prompt": "package odd_count_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a list of strings, where each string consists of only digits, return a list.\n// Each element i of the output should be \"the number of odd elements in the\n// string i of the input.\" where all the i's should be replaced by the number\n// of odd digits in the i'th string of the input.\n// >>> odd_count([]string{\"1234567\"})\n// []string{\"the number of odd elements 4n the str4ng 4 of the 4nput.\"}\n// >>> odd_count([]string{\"3\", \"11111111\"})\n// []string{\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\"}\nfunc odd_count(lst []string) []string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "reworded", - "tests": "func TestOdd_Count(t *testing.T) {\n candidate := odd_count\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{\"1234567\"}), expected: []string{\"the number of odd elements 4n the str4ng 4 of the 4nput.\"} },\n { actual: candidate([]string{\"3\", \"11111111\"}), expected: []string{\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\"} },\n { actual: candidate([]string{\"271\", \"137\", \"314\"}), expected: []string{\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "go_test.go", - "prompt": "package correct_bracketing_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// brackets is a string of \"(\" and \")\".\n// return true if every opening bracket has a corresponding closing bracket.\n// >>> correct_bracketing(\"(\")\n// false\n// >>> correct_bracketing(\"()\")\n// true\n// >>> correct_bracketing(\"(()())\")\n// true\n// >>> correct_bracketing(\")(()\")\n// false\nfunc correct_bracketing(brackets string) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "func TestCorrect_Bracketing(t *testing.T) {\n candidate := correct_bracketing\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"()\"), expected: true },\n { actual: candidate(\"(()())\"), expected: true },\n { actual: candidate(\"()()(()())()\"), expected: true },\n { actual: candidate(\"()()((()()())())(()()(()))\"), expected: true },\n { actual: candidate(\"((()())))\"), expected: false },\n { actual: candidate(\")(()\"), expected: false },\n { actual: candidate(\"(\"), expected: false },\n { actual: candidate(\"((((\"), expected: false },\n { actual: candidate(\")\"), expected: false },\n { actual: candidate(\"(()\"), expected: false },\n { actual: candidate(\"()()(()())())(()\"), expected: false },\n { actual: candidate(\"()()(()())()))()\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "go_test.go", - "prompt": "package digitSum_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Task\n// Write a function that takes a string as input and returns the sum of the upper characters only'\n// ASCII codes.\n// Examples:\n// >>> digitSum(\"\")\n// 0\n// >>> digitSum(\"abAB\")\n// 131\n// >>> digitSum(\"abcCd\")\n// 67\n// >>> digitSum(\"helloE\")\n// 69\n// >>> digitSum(\"woArBld\")\n// 131\n// >>> digitSum(\"aAaaaXa\")\n// 153\nfunc digitSum(s string) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "reworded", - "tests": "func TestDigitsum(t *testing.T) {\n candidate := digitSum\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: 0 },\n { actual: candidate(\"abAB\"), expected: 131 },\n { actual: candidate(\"abcCd\"), expected: 67 },\n { actual: candidate(\"helloE\"), expected: 69 },\n { actual: candidate(\"woArBld\"), expected: 131 },\n { actual: candidate(\"aAaaaXa\"), expected: 153 },\n { actual: candidate(\" How are yOu?\"), expected: 151 },\n { actual: candidate(\"You arE Very Smart\"), expected: 327 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "go_test.go", - "prompt": "package sorted_list_sum_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that accepts a list of strings as a parameter,\n// deletes the strings that have odd lengths from it,\n// and returns the resulted list with a sorted order,\n// The list is always a list of strings and never a list of numbers,\n// and it may contain duplicates.\n// The order of the list should be ascending by length of each word, and you\n// should return the list sorted by that rule.\n// If two words have the same length, sort the list alphabetically.\n// The function should return a list of strings in sorted order.\n// You may assume that all words will have the same length.\n// For example:\n// >>> list_sort([]string{\"aa\", \"a\", \"aaa\"})\n// []string{\"aa\"}\n// >>> list_sort([]string{\"ab\", \"a\", \"aaa\", \"cd\"})\n// []string{\"ab\", \"cd\"}\nfunc sorted_list_sum(lst []string) []string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "reworded", - "tests": "func TestSorted_List_Sum(t *testing.T) {\n candidate := sorted_list_sum\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{\"aa\", \"a\", \"aaa\"}), expected: []string{\"aa\"} },\n { actual: candidate([]string{\"school\", \"AI\", \"asdf\", \"b\"}), expected: []string{\"AI\", \"asdf\", \"school\"} },\n { actual: candidate([]string{\"d\", \"b\", \"c\", \"a\"}), expected: []string{} },\n { actual: candidate([]string{\"d\", \"dcba\", \"abcd\", \"a\"}), expected: []string{\"abcd\", \"dcba\"} },\n { actual: candidate([]string{\"AI\", \"ai\", \"au\"}), expected: []string{\"AI\", \"ai\", \"au\"} },\n { actual: candidate([]string{\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"}), expected: []string{} },\n { actual: candidate([]string{\"aaaa\", \"bbbb\", \"dd\", \"cc\"}), expected: []string{\"cc\", \"dd\", \"aaaa\", \"bbbb\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "go_test.go", - "prompt": "package incr_list_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return list with elements incremented by 1.\n// >>> incr_list([]int{1, 2, 3})\n// []int{2, 3, 4}\n// >>> incr_list([]int{5, 3, 5, 2, 3, 3, 9, 0, 123})\n// []int{6, 4, 6, 3, 4, 4, 10, 1, 124}\nfunc incr_list(l []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "reworded", - "tests": "func TestIncr_List(t *testing.T) {\n candidate := incr_list\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{3, 2, 1}), expected: []int{4, 3, 2} },\n { actual: candidate([]int{5, 2, 5, 2, 3, 3, 9, 0, 123}), expected: []int{6, 3, 6, 3, 4, 4, 10, 1, 124} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "go_test.go", - "prompt": "package rolling_max_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// From a given list of integers, generate a list of rolling maximum element found until given moment\n// in the sequence.\n// >>> rolling_max([]int{1, 2, 3, 2, 3, 4, 2})\n// []int{1, 2, 3, 3, 3, 4, 4}\nfunc rolling_max(numbers []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "reworded", - "tests": "func TestRolling_Max(t *testing.T) {\n candidate := rolling_max\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{1, 2, 3, 4}), expected: []int{1, 2, 3, 4} },\n { actual: candidate([]int{4, 3, 2, 1}), expected: []int{4, 4, 4, 4} },\n { actual: candidate([]int{3, 2, 3, 100, 3}), expected: []int{3, 3, 3, 100, 100} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "go_test.go", - "prompt": "package separate_paren_groups_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n// separate those group into separate strings and return the list of those.\n// Separate groups are balanced (each open brace is properly closed) and not nested within each other\n// Ignore any spaces in the input string.\n// >>> separate_paren_groups(\"( ) (( )) (( )( ))\")\n// []string{\"()\", \"(())\", \"(()())\"}\nfunc separate_paren_groups(paren_string string) []string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "reworded", - "tests": "func TestSeparate_Paren_Groups(t *testing.T) {\n candidate := separate_paren_groups\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"(()()) ((())) () ((())()())\"), expected: []string{\"(()())\", \"((()))\", \"()\", \"((())()())\"} },\n { actual: candidate(\"() (()) ((())) (((())))\"), expected: []string{\"()\", \"(())\", \"((()))\", \"(((())))\"} },\n { actual: candidate(\"(()(())((())))\"), expected: []string{\"(()(())((())))\"} },\n { actual: candidate(\"( ) (( )) (( )( ))\"), expected: []string{\"()\", \"(())\", \"(()())\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "go_test.go", - "prompt": "package words_string_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You will be given a string of words separated by commas or spaces. Your task is\n// to split the string into words and return a list of the words.\n// For example:\n// >>> words_string(\"Hi, my name is John\")\n// []string{\"Hi\", \"my\", \"name\", \"is\", \"John\"}\n// >>> words_string(\"One, two, three, four, five, six\")\n// []string{\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"}\nfunc words_string(s string) []string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "reworded", - "tests": "func TestWords_String(t *testing.T) {\n candidate := words_string\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Hi, my name is John\"), expected: []string{\"Hi\", \"my\", \"name\", \"is\", \"John\"} },\n { actual: candidate(\"One, two, three, four, five, six\"), expected: []string{\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"} },\n { actual: candidate(\"Hi, my name\"), expected: []string{\"Hi\", \"my\", \"name\"} },\n { actual: candidate(\"One,, two, three, four, five, six,\"), expected: []string{\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"} },\n { actual: candidate(\"\"), expected: []string{} },\n { actual: candidate(\"ahmed , gamal\"), expected: []string{\"ahmed\", \"gamal\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "go_test.go", - "prompt": "package filter_integers_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Filter given list of any gothon values only for integers\n// >>> filter_integers([]float64{\"a\", 3.14, 5})\n// []int{5}\n// >>> filter_integers([]interface{}{1, 2, 3, \"abc\", map[interface{}]interface{}{}, []interface{}{}})\n// []int{1, 2, 3}\nfunc filter_integers(values []interface{}) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "reworded", - "tests": "func TestFilter_Integers(t *testing.T) {\n candidate := filter_integers\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]interface{}{}), expected: []int{} },\n { actual: candidate([]interface{}{4, map[interface{}]interface{}{}, []interface{}{}, 23.2, 9, \"adasd\"}), expected: []int{4, 9} },\n { actual: candidate([]interface{}{3, \"c\", 3, 3, \"a\", \"b\"}), expected: []int{3, 3, 3} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "go_test.go", - "prompt": "package sort_even_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// This function takes a list l and returns a list l' such that\n// l' is identical to l in the odd indicies, while its values at the even indicies are equal\n// to the values of the even indicies of l, but sorted.\n// >>> sort_even([]int{1, 2, 3})\n// []int{1, 2, 3}\n// >>> sort_even([]int{5, 6, 3, 4})\n// []int{3, 6, 5, 4}\nfunc sort_even(l []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "reworded", - "tests": "func TestSort_Even(t *testing.T) {\n candidate := sort_even\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 3}), expected: []int{1, 2, 3} },\n { actual: candidate([]int{5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10}), expected: []int{-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123} },\n { actual: candidate([]int{5, 8, -12, 4, 23, 2, 3, 11, 12, -10}), expected: []int{-12, 8, 3, 4, 5, 2, 12, 11, 23, -10} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_152_compare", - "language": "go_test.go", - "prompt": "package compare_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// I think we all remember that feeling when the result of some long-awaited\n// event is finally known. The feelings and thoughts you have at that moment are\n// definitely worth noting down and comparing.\n// Your task is to determine if a person correctly guessed the results of a number of matches.\n// You are given two lists of scores and guesses of equal length, where each index shows a match. \n// Return a list of the same length denoting how far off each guess was. If they have guessed correctly,\n// the value is 0, and if not, the value is the absolute difference between the guess and the score.\n// example:\n// >>> compare([]int{1, 2, 3, 4, 5, 1}, []int{1, 2, 3, 4, 2, -2})\n// []int{0, 0, 0, 0, 3, 3}\n// >>> compare([]int{0, 5, 0, 0, 0, 4}, []int{4, 1, 1, 0, 0, -2})\n// []int{4, 4, 1, 0, 0, 6}\nfunc compare(game []int, guess []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "reworded", - "tests": "func TestCompare(t *testing.T) {\n candidate := compare\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 3, 4, 5, 1}, []int{1, 2, 3, 4, 2, -2}), expected: []int{0, 0, 0, 0, 3, 3} },\n { actual: candidate([]int{0, 0, 0, 0, 0, 0}, []int{0, 0, 0, 0, 0, 0}), expected: []int{0, 0, 0, 0, 0, 0} },\n { actual: candidate([]int{1, 2, 3}, []int{-1, -2, -3}), expected: []int{2, 4, 6} },\n { actual: candidate([]int{1, 2, 3, 5}, []int{-1, 2, 3, 4}), expected: []int{2, 0, 0, 1} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "go_test.go", - "prompt": "package even_odd_palindrome_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a positive integer n, return a list that has the number of even and odd\n// integer palindromes that fall within the range(1, n), inclusive.\n// Example 1:\n// >>> even_odd_palindrome(3)\n// []interface{}{1, 2}\n// Explanation:\n// Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n// Example 2:\n// >>> even_odd_palindrome(12)\n// []interface{}{4, 6}\n// Explanation:\n// Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n// Note:\n// 1. 1 <= n <= 10^3\n// 2. returned list has the number of even and odd integer palindromes respectively.\nfunc even_odd_palindrome(n int) []interface{} {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "reworded", - "tests": "func TestEven_Odd_Palindrome(t *testing.T) {\n candidate := even_odd_palindrome\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(123), expected: []interface{}{8, 13} },\n { actual: candidate(12), expected: []interface{}{4, 6} },\n { actual: candidate(3), expected: []interface{}{1, 2} },\n { actual: candidate(63), expected: []interface{}{6, 8} },\n { actual: candidate(25), expected: []interface{}{5, 6} },\n { actual: candidate(19), expected: []interface{}{4, 6} },\n { actual: candidate(9), expected: []interface{}{4, 5} },\n { actual: candidate(1), expected: []interface{}{0, 1} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "go_test.go", - "prompt": "package fib4_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fib4(0) -> 0\n// fib4(1) -> 0\n// fib4(2) -> 2\n// fib4(3) -> 0\n// fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n// Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n// >>> fib4(5)\n// 4\n// >>> fib4(6)\n// 8\n// >>> fib4(7)\n// 14\nfunc fib4(n int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "reworded", - "tests": "func TestFib4(t *testing.T) {\n candidate := fib4\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5), expected: 4 },\n { actual: candidate(8), expected: 28 },\n { actual: candidate(10), expected: 104 },\n { actual: candidate(12), expected: 386 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "go_test.go", - "prompt": "package generate_integers_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given two positive integers a and b, return the even digits between a\n// and b, in ascending order.\n// For example:\n// >>> generate_integers(2, 8)\n// []int{2, 4, 6, 8}\n// >>> generate_integers(8, 2)\n// []int{2, 4, 6, 8}\n// >>> generate_integers(10, 14)\n// []int{}\nfunc generate_integers(a int, b int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "reworded", - "tests": "func TestGenerate_Integers(t *testing.T) {\n candidate := generate_integers\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(2, 10), expected: []int{2, 4, 6, 8} },\n { actual: candidate(10, 2), expected: []int{2, 4, 6, 8} },\n { actual: candidate(132, 2), expected: []int{2, 4, 6, 8} },\n { actual: candidate(17, 89), expected: []int{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "go_test.go", - "prompt": "package mean_absolute_deviation_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// For a given list of input numbers, calculate Mean Absolute Deviation\n// around the mean of this dataset.\n// Mean Absolute Deviation is the average absolute difference between each\n// element and a centerpoint (mean in this case):\n// MAD = average | x - x_mean |\n// >>> mean_absolute_deviation([]float64{1.0, 2.0, 3.0, 4.0})\n// 1.0\nfunc mean_absolute_deviation(numbers []float64) float64 {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "reworded", - "tests": "func TestMean_Absolute_Deviation(t *testing.T) {\n candidate := mean_absolute_deviation\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]float64{1.0, 2.0}), expected: 0.5 },\n { actual: candidate([]float64{1.0, 2.0, 3.0, 4.0}), expected: 1.0 },\n { actual: candidate([]float64{1.0, 2.0, 3.0, 4.0, 5.0}), expected: 1.2 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "go_test.go", - "prompt": "package encrypt_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function encrypt that takes a string as an argument and\n// returns a string encrypted with the alphabet being rotated. \n// The alphabet should be rotated in a manner such that the letters \n// shift down by two multiplied to two places.\n// For example:\n// >>> encrypt(\"hi\")\n// \"lm\"\n// >>> encrypt(\"asdfghjkl\")\n// \"ewhjklnop\"\n// >>> encrypt(\"gf\")\n// \"kj\"\n// >>> encrypt(\"et\")\n// \"ix\"\nfunc encrypt(s string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "reworded", - "tests": "func TestEncrypt(t *testing.T) {\n candidate := encrypt\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"hi\"), expected: \"lm\" },\n { actual: candidate(\"asdfghjkl\"), expected: \"ewhjklnop\" },\n { actual: candidate(\"gf\"), expected: \"kj\" },\n { actual: candidate(\"et\"), expected: \"ix\" },\n { actual: candidate(\"faewfawefaewg\"), expected: \"jeiajeaijeiak\" },\n { actual: candidate(\"hellomyfriend\"), expected: \"lippsqcjvmirh\" },\n { actual: candidate(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\"), expected: \"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\" },\n { actual: candidate(\"a\"), expected: \"e\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "go_test.go", - "prompt": "package get_odd_collatz_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n// The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n// as follows: start with any positive integer n. Then each term is obtained from the \n// previous term as follows: if the previous term is even, the next term is one half of \n// the previous term. If the previous term is odd, the next term is 3 times the previous\n// term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n// Note: \n// 1. Collatz(1) is [1].\n// 2. returned list sorted in increasing order.\n// For example:\n// get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n// >>> get_odd_collatz(5)\n// []int{1, 5}\nfunc get_odd_collatz(n int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "reworded", - "tests": "func TestGet_Odd_Collatz(t *testing.T) {\n candidate := get_odd_collatz\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(14), expected: []int{1, 5, 7, 11, 13, 17} },\n { actual: candidate(5), expected: []int{1, 5} },\n { actual: candidate(12), expected: []int{1, 3, 5} },\n { actual: candidate(1), expected: []int{1} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "go_test.go", - "prompt": "package how_many_times_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Find how many times a given substring can be found in the original string. Count overlaping cases.\n// >>> how_many_times(\"\", \"a\")\n// 0\n// >>> how_many_times(\"aaa\", \"a\")\n// 3\n// >>> how_many_times(\"aaaa\", \"aa\")\n// 3\nfunc how_many_times(myString string, substring string) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "reworded", - "tests": "func TestHow_Many_Times(t *testing.T) {\n candidate := how_many_times\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\", \"x\"), expected: 0 },\n { actual: candidate(\"xyxyxyx\", \"x\"), expected: 4 },\n { actual: candidate(\"cacacacac\", \"cac\"), expected: 4 },\n { actual: candidate(\"john doe\", \"john\"), expected: 1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "go_test.go", - "prompt": "package move_one_ball_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// We have a list 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n// numbers in the list will be randomly ordered. Your task is to determine if\n// it is possible to get a list sorted in non-decreasing order by performing \n// the following operation on the given list:\n// You are allowed to perform right shift operation any number of times.\n// One right shift operation means shifting all elements of the list by one\n// position in the right direction. The last element of the list will be moved to\n// the starting position in the list i.e. 0th index. \n// If it is possible to obtain the sorted list by performing the above operation\n// then return true else return false.\n// If the given list is empty then return true.\n// Note: The given list is guaranteed to have unique elements.\n// For Example:\n// >>> move_one_ball([]int{3, 4, 5, 1, 2})\n// true\n// Explanation: By performin 2 right shift operations, non-decreasing order can\n// be achieved for the given list.\n// >>> move_one_ball([]int{3, 5, 4, 1, 2})\n// false\n// Explanation:It is not possible to get non-decreasing order for the given\n// list by performing any number of right shift operations.\nfunc move_one_ball(arr []int) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "reworded", - "tests": "func TestMove_One_Ball(t *testing.T) {\n candidate := move_one_ball\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{3, 4, 5, 1, 2}), expected: true },\n { actual: candidate([]int{3, 5, 10, 1, 2}), expected: true },\n { actual: candidate([]int{4, 3, 1, 2}), expected: false },\n { actual: candidate([]int{3, 5, 4, 1, 2}), expected: false },\n { actual: candidate([]int{}), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "go_test.go", - "prompt": "package order_by_points_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function which sorts the given list of integers\n// in ascending order according to the sum of their digits.\n// Note: if there are several items with similar sum of their digits,\n// order them based on their index in original list.\n// For example:\n// >>> order_by_points([]int{1, 11, -1, -11, -12})\n// []int{-1, -11, 1, -12, 11}\n// >>> order_by_points([]int{})\n// []int{}\nfunc order_by_points(nums []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "reworded", - "tests": "func TestOrder_By_Points(t *testing.T) {\n candidate := order_by_points\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 11, -1, -11, -12}), expected: []int{-1, -11, 1, -12, 11} },\n { actual: candidate([]int{1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46}), expected: []int{0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457} },\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{1, -11, -32, 43, 54, -98, 2, -3}), expected: []int{-3, -32, -98, -11, 1, 2, 43, 54} },\n { actual: candidate([]int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}), expected: []int{1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9} },\n { actual: candidate([]int{0, 6, 6, -76, -21, 23, 4}), expected: []int{-76, -21, 0, 4, 23, 6, 6} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "go_test.go", - "prompt": "package factorize_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return list of prime factors of given integer in the order from smallest to largest.\n// Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n// Input number should be equal to the product of all factors\n// >>> factorize(8)\n// []int{2, 2, 2}\n// >>> factorize(25)\n// []int{5, 5}\n// >>> factorize(70)\n// []int{2, 5, 7}\nfunc factorize(n int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "reworded", - "tests": "func TestFactorize(t *testing.T) {\n candidate := factorize\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(2), expected: []int{2} },\n { actual: candidate(4), expected: []int{2, 2} },\n { actual: candidate(8), expected: []int{2, 2, 2} },\n { actual: candidate(57), expected: []int{3, 19} },\n { actual: candidate(3249), expected: []int{3, 3, 19, 19} },\n { actual: candidate(185193), expected: []int{3, 3, 3, 19, 19, 19} },\n { actual: candidate(20577), expected: []int{3, 19, 19, 19} },\n { actual: candidate(18), expected: []int{2, 3, 3} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "go_test.go", - "prompt": "package below_threshold_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return true if all numbers in the list l are below threshold t.\n// >>> below_threshold([]int{1, 2, 4, 10}, 100)\n// true\n// >>> below_threshold([]int{1, 20, 4, 10}, 5)\n// false\nfunc below_threshold(l []int, t int) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "reworded", - "tests": "func TestBelow_Threshold(t *testing.T) {\n candidate := below_threshold\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 4, 10}, 100), expected: true },\n { actual: candidate([]int{1, 20, 4, 10}, 5), expected: false },\n { actual: candidate([]int{1, 20, 4, 10}, 21), expected: true },\n { actual: candidate([]int{1, 20, 4, 10}, 22), expected: true },\n { actual: candidate([]int{1, 8, 4, 10}, 11), expected: true },\n { actual: candidate([]int{1, 8, 4, 10}, 10), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "go_test.go", - "prompt": "package parse_nested_parens_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n// For each of the group, output the deepest level of nesting of parentheses.\n// E.g. (()()) has maximum two levels of nesting while ((())) has three.\n// >>> parse_nested_parens(\"(()()) ((())) () ((())()())\")\n// []int{2, 3, 1, 3}\nfunc parse_nested_parens(paren_string string) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "reworded", - "tests": "func TestParse_Nested_Parens(t *testing.T) {\n candidate := parse_nested_parens\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"(()()) ((())) () ((())()())\"), expected: []int{2, 3, 1, 3} },\n { actual: candidate(\"() (()) ((())) (((())))\"), expected: []int{1, 2, 3, 4} },\n { actual: candidate(\"(()(())((())))\"), expected: []int{4} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_121_solution", - "language": "go_test.go", - "prompt": "package solution_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n// Examples\n// >>> solution([]int{5, 8, 7, 1})\n// 12\n// >>> solution([]int{3, 3, 3, 3, 3})\n// 9\n// >>> solution([]int{30, 13, 24, 321})\n// 0\nfunc solution(lst []int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "reworded", - "tests": "func TestSolution(t *testing.T) {\n candidate := solution\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{5, 8, 7, 1}), expected: 12 },\n { actual: candidate([]int{3, 3, 3, 3, 3}), expected: 9 },\n { actual: candidate([]int{30, 13, 24, 321}), expected: 0 },\n { actual: candidate([]int{5, 9}), expected: 5 },\n { actual: candidate([]int{2, 4, 8}), expected: 0 },\n { actual: candidate([]int{30, 13, 23, 32}), expected: 23 },\n { actual: candidate([]int{3, 13, 2, 9}), expected: 3 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "go_test.go", - "prompt": "package get_max_triples_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a positive integer n. You have to create an integer list a of length n.\n// For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n// Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n// and a[i] + a[j] + a[k] is a multiple of 3.\n// Example :\n// >>> get_max_triples(5)\n// 1\n// Explanation: \n// a = [1, 3, 7, 13, 21]\n// The only valid triple is (1, 7, 13).\nfunc get_max_triples(n int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "reworded", - "tests": "func TestGet_Max_Triples(t *testing.T) {\n candidate := get_max_triples\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5), expected: 1 },\n { actual: candidate(6), expected: 4 },\n { actual: candidate(10), expected: 36 },\n { actual: candidate(100), expected: 53361 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_148_bf", - "language": "go_test.go", - "prompt": "package bf_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// There are eight planets in our solar system: the closerst to the Sun \n// is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n// Uranus, Neptune.\n// Write a function that takes two planet names as strings planet1 and planet2. \n// The function should return a list containing all planets whose orbits are \n// located between the orbit of planet1 and the orbit of planet2, sorted by \n// the proximity to the sun. \n// The function should return an empty list if planet1 or planet2\n// are not correct planet names. \n// Examples\n// >>> bf(\"Jupiter\", \"Neptune\")\n// []interface{}{\"Saturn\", \"Uranus\"}\n// >>> bf(\"Earth\", \"Mercury\")\n// \"Venus\"\n// >>> bf(\"Mercury\", \"Uranus\")\n// []interface{}{\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"}\nfunc bf(planet1 string, planet2 string) []interface{} {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "reworded", - "tests": "func TestBf(t *testing.T) {\n candidate := bf\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Jupiter\", \"Neptune\"), expected: []interface{}{\"Saturn\", \"Uranus\"} },\n { actual: candidate(\"Earth\", \"Mercury\"), expected: []interface{}{\"Venus\"} },\n { actual: candidate(\"Mercury\", \"Uranus\"), expected: []interface{}{\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"} },\n { actual: candidate(\"Neptune\", \"Venus\"), expected: []interface{}{\"Earth\", \"Mars\", \"Jupiter\", \"Saturn\", \"Uranus\"} },\n { actual: candidate(\"Earth\", \"Earth\"), expected: []interface{}{} },\n { actual: candidate(\"Mars\", \"Earth\"), expected: []interface{}{} },\n { actual: candidate(\"Jupiter\", \"Makemake\"), expected: []interface{}{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "go_test.go", - "prompt": "package sort_numbers_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Input is a space-delimited string of numberals from 'zero' to 'nine'.\n// Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n// Return the string with numbers sorted from smallest to largest\n// >>> sort_numbers(\"three one five\")\n// \"one three five\"\nfunc sort_numbers(numbers string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "reworded", - "tests": "func TestSort_Numbers(t *testing.T) {\n candidate := sort_numbers\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: \"\" },\n { actual: candidate(\"three\"), expected: \"three\" },\n { actual: candidate(\"three five nine\"), expected: \"three five nine\" },\n { actual: candidate(\"five zero four seven nine eight\"), expected: \"zero four five seven eight nine\" },\n { actual: candidate(\"six five four three two one zero\"), expected: \"zero one two three four five six\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "go_test.go", - "prompt": "package cycpattern_check_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given 2 words. You need to return true if the second word or any of its rotations is a substring in the first word\n// >>> cycpattern_check(\"abcd\", \"abd\")\n// false\n// >>> cycpattern_check(\"hello\", \"ell\")\n// true\n// >>> cycpattern_check(\"whassup\", \"psus\")\n// false\n// >>> cycpattern_check(\"abab\", \"baa\")\n// true\n// >>> cycpattern_check(\"efef\", \"eeff\")\n// false\n// >>> cycpattern_check(\"himenss\", \"simen\")\n// true\nfunc cycpattern_check(a string, b string) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "reworded", - "tests": "func TestCycpattern_Check(t *testing.T) {\n candidate := cycpattern_check\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"xyzw\", \"xyw\"), expected: false },\n { actual: candidate(\"yello\", \"ell\"), expected: true },\n { actual: candidate(\"whattup\", \"ptut\"), expected: false },\n { actual: candidate(\"efef\", \"fee\"), expected: true },\n { actual: candidate(\"abab\", \"aabb\"), expected: false },\n { actual: candidate(\"winemtt\", \"tinem\"), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "go_test.go", - "prompt": "package decimal_to_binary_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You will be given a number in decimal form and your task is to convert it to\n// binary format. The function should return a string, with each character representing a binary\n// number. Each character in the string will be '0' or '1'.\n// There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n// The extra characters are there to help with the format.\n// Examples:\n// >>> decimal_to_binary(15)\n// \"db1111db\"\n// >>> decimal_to_binary(32)\n// \"db100000db\"\nfunc decimal_to_binary(decimal int) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "reworded", - "tests": "func TestDecimal_To_Binary(t *testing.T) {\n candidate := decimal_to_binary\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(0), expected: \"db0db\" },\n { actual: candidate(32), expected: \"db100000db\" },\n { actual: candidate(103), expected: \"db1100111db\" },\n { actual: candidate(15), expected: \"db1111db\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "go_test.go", - "prompt": "package filter_by_substring_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Filter an input list of strings only for ones that contain given substring\n// >>> filter_by_substring([]string{}, \"a\")\n// []string{}\n// >>> filter_by_substring([]string{\"abc\", \"bacd\", \"cde\", \"array\"}, \"a\")\n// []string{\"abc\", \"bacd\", \"array\"}\nfunc filter_by_substring(strings []string, substring string) []string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "reworded", - "tests": "func TestFilter_By_Substring(t *testing.T) {\n candidate := filter_by_substring\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{}, \"john\"), expected: []string{} },\n { actual: candidate([]string{\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"}, \"xxx\"), expected: []string{\"xxx\", \"xxxAAA\", \"xxx\"} },\n { actual: candidate([]string{\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"}, \"xx\"), expected: []string{\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"} },\n { actual: candidate([]string{\"grunt\", \"trumpet\", \"prune\", \"gruesome\"}, \"run\"), expected: []string{\"grunt\", \"prune\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "go_test.go", - "prompt": "package even_odd_count_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given an integer. return a list that has the number of even and odd digits respectively.\n// Example:\n// >>> even_odd_count(-12)\n// []interface{}{1, 1}\n// >>> even_odd_count(123)\n// []interface{}{1, 2}\nfunc even_odd_count(num int) []interface{} {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "reworded", - "tests": "func TestEven_Odd_Count(t *testing.T) {\n candidate := even_odd_count\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(7), expected: []interface{}{0, 1} },\n { actual: candidate(-78), expected: []interface{}{1, 1} },\n { actual: candidate(3452), expected: []interface{}{2, 2} },\n { actual: candidate(346211), expected: []interface{}{3, 3} },\n { actual: candidate(-345821), expected: []interface{}{3, 3} },\n { actual: candidate(-2), expected: []interface{}{1, 0} },\n { actual: candidate(-45347), expected: []interface{}{2, 3} },\n { actual: candidate(0), expected: []interface{}{1, 0} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "go_test.go", - "prompt": "package find_max_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that accepts a list of strings.\n// The list contains different words. Return the word with maximum number\n// of unique characters. If multiple strings have maximum number of unique\n// characters, return the one which comes first in lexicographical order.\n// >>> find_max([]string{\"name\", \"of\", \"string\"})\n// \"string\"\n// >>> find_max([]string{\"name\", \"enam\", \"game\"})\n// \"enam\"\n// >>> find_max([]string{\"aaaaaaa\", \"bb\", \"cc\"})\n// \"aaaaaaa\"\nfunc find_max(words []string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "reworded", - "tests": "func TestFind_Max(t *testing.T) {\n candidate := find_max\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{\"name\", \"of\", \"string\"}), expected: \"string\" },\n { actual: candidate([]string{\"name\", \"enam\", \"game\"}), expected: \"enam\" },\n { actual: candidate([]string{\"aaaaaaa\", \"bb\", \"cc\"}), expected: \"aaaaaaa\" },\n { actual: candidate([]string{\"abc\", \"cba\"}), expected: \"abc\" },\n { actual: candidate([]string{\"play\", \"this\", \"game\", \"of\", \"footbott\"}), expected: \"footbott\" },\n { actual: candidate([]string{\"we\", \"are\", \"gonna\", \"rock\"}), expected: \"gonna\" },\n { actual: candidate([]string{\"we\", \"are\", \"a\", \"mad\", \"nation\"}), expected: \"nation\" },\n { actual: candidate([]string{\"this\", \"is\", \"a\", \"prrk\"}), expected: \"this\" },\n { actual: candidate([]string{\"b\"}), expected: \"b\" },\n { actual: candidate([]string{\"play\", \"play\", \"play\"}), expected: \"play\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "go_test.go", - "prompt": "package starts_one_ends_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a positive integer n, return the count of the numbers of n-digit\n// positive integers that start or end with 1.\nfunc starts_one_ends(n int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "reworded", - "tests": "func TestStarts_One_Ends(t *testing.T) {\n candidate := starts_one_ends\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(1), expected: 1 },\n { actual: candidate(2), expected: 18 },\n { actual: candidate(3), expected: 180 },\n { actual: candidate(4), expected: 1800 },\n { actual: candidate(5), expected: 18000 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "go_test.go", - "prompt": "package largest_smallest_integers_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function that returns a list (a, b), where 'a' is\n// the largest of negative integers, and 'b' is the smallest\n// of positive integers in a list.\n// If there is no negative or positive integers, return them as nil.\n// Examples:\n// >>> largest_smallest_integers([]int{2, 4, 1, 3, 5, 7})\n// []interface{}{nil, 1}\n// >>> largest_smallest_integers([]int{})\n// []interface{}{nil, nil}\n// >>> largest_smallest_integers([]int{0})\n// []interface{}{nil, nil}\nfunc largest_smallest_integers(lst []int) []interface{} {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "reworded", - "tests": "func TestLargest_Smallest_Integers(t *testing.T) {\n candidate := largest_smallest_integers\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{2, 4, 1, 3, 5, 7}), expected: []interface{}{nil, 1} },\n { actual: candidate([]int{2, 4, 1, 3, 5, 7, 0}), expected: []interface{}{nil, 1} },\n { actual: candidate([]int{1, 3, 2, 4, 5, 6, -2}), expected: []interface{}{-2, 1} },\n { actual: candidate([]int{4, 5, 3, 6, 2, 7, -7}), expected: []interface{}{-7, 2} },\n { actual: candidate([]int{7, 3, 8, 4, 9, 2, 5, -9}), expected: []interface{}{-9, 2} },\n { actual: candidate([]int{}), expected: []interface{}{nil, nil} },\n { actual: candidate([]int{0}), expected: []interface{}{nil, nil} },\n { actual: candidate([]int{-1, -3, -5, -6}), expected: []interface{}{-1, nil} },\n { actual: candidate([]int{-1, -3, -5, -6, 0}), expected: []interface{}{-1, nil} },\n { actual: candidate([]int{-6, -4, -4, -3, 1}), expected: []interface{}{-3, 1} },\n { actual: candidate([]int{-6, -4, -4, -3, -100, 1}), expected: []interface{}{-3, 1} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "go_test.go", - "prompt": "package pluck_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// \"Given a list representing a branch of a tree that has non-negative integer nodes\n// your task is to pluck one of the nodes and return it.\n// The plucked node should be the node with the smallest even value.\n// If multiple nodes with the same smallest even value are found return the node that has smallest index.\n// The plucked node should be returned in a list, [ smalest_value, its index ],\n// If there are no even values or the given list is empty, return [].\n// Example 1:\n// >>> pluck([]int{4, 2, 3})\n// []int{2, 1}\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 2:\n// >>> pluck([]int{1, 2, 3})\n// []int{2, 1}\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 3:\n// >>> pluck([]int{})\n// []int{}\n// Example 4:\n// >>> pluck([]int{5, 0, 3, 0, 4, 2})\n// []int{0, 1}\n// Explanation: 0 is the smallest value, but there are two zeros,\n// so we will choose the first zero, which has the smallest index.\n// Constraints:\n// * 1 <= nodes.length <= 10000\n// * 0 <= node.value\nfunc pluck(arr []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "reworded", - "tests": "func TestPluck(t *testing.T) {\n candidate := pluck\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{4, 2, 3}), expected: []int{2, 1} },\n { actual: candidate([]int{1, 2, 3}), expected: []int{2, 1} },\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{5, 0, 3, 0, 4, 2}), expected: []int{0, 1} },\n { actual: candidate([]int{1, 2, 3, 0, 5, 3}), expected: []int{0, 3} },\n { actual: candidate([]int{5, 4, 8, 4, 8}), expected: []int{4, 1} },\n { actual: candidate([]int{7, 6, 7, 1}), expected: []int{6, 1} },\n { actual: candidate([]int{7, 9, 7, 1}), expected: []int{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "go_test.go", - "prompt": "package count_nums_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function count_nums which takes a list of integers and returns\n// the number of elements which has a sum of digits > 0.\n// If a number is negative, then its first signed digit will be negative:\n// e.g. -123 has signed digits -1, 2, and 3.\n// >>> count_nums([]int{})\n// 0\n// >>> count_nums([]int{-1, 11, -11})\n// 1\n// >>> count_nums([]int{1, 1, 2})\n// 3\nfunc count_nums(arr []int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "reworded", - "tests": "func TestCount_Nums(t *testing.T) {\n candidate := count_nums\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}), expected: 0 },\n { actual: candidate([]int{-1, -2, 0}), expected: 0 },\n { actual: candidate([]int{1, 1, 2, -2, 3, 4, 5}), expected: 6 },\n { actual: candidate([]int{1, 6, 9, -6, 0, 1, 5}), expected: 5 },\n { actual: candidate([]int{1, 100, 98, -7, 1, -1}), expected: 4 },\n { actual: candidate([]int{12, 23, 34, -45, -56, 0}), expected: 5 },\n { actual: candidate([]int{0, 1}), expected: 1 },\n { actual: candidate([]int{1}), expected: 1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "go_test.go", - "prompt": "package minPath_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n// each cell of the grid contains a value. Every integer in the range [1, N * N]\n// inclusive appears exactly once on the cells of the grid.\n// You have to find the minimum path of length k in the grid. You can start\n// from any cell, and in each step you can move to any of the neighbor cells,\n// in other words, you can go to cells which share an edge with you current\n// cell.\n// Please note that a path of length k means visiting exactly k cells (not\n// necessarily distinct).\n// You CANNOT go off the grid.\n// A path A (of length k) is considered less than a path B (of length k) if\n// after making the ordered lists of the values on the cells that A and B go\n// through (let's call them lst_A and lst_B), lst_A is lexicographically less\n// than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n// such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n// lst_A[j] = lst_B[j].\n// It is guaranteed that the answer is unique.\n// Return an ordered list of the values on the cells that the minimum path go through.\n// Examples: \n// >>> minPath([][]int{[]int{1, 2, 3}, []int{4, 5, 6}, []int{7, 8, 9}}, 3)\n// []int{1, 2, 1}\n// >>> minPath([][]int{[]int{5, 9, 3}, []int{4, 1, 6}, []int{7, 8, 2}}, 1)\n// []int{1}\nfunc minPath(grid [][]int, k int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "reworded", - "tests": "func TestMinpath(t *testing.T) {\n candidate := minPath\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([][]int{[]int{1, 2, 3}, []int{4, 5, 6}, []int{7, 8, 9}}, 3), expected: []int{1, 2, 1} },\n { actual: candidate([][]int{[]int{5, 9, 3}, []int{4, 1, 6}, []int{7, 8, 2}}, 1), expected: []int{1} },\n { actual: candidate([][]int{[]int{1, 2, 3, 4}, []int{5, 6, 7, 8}, []int{9, 10, 11, 12}, []int{13, 14, 15, 16}}, 4), expected: []int{1, 2, 1, 2} },\n { actual: candidate([][]int{[]int{6, 4, 13, 10}, []int{5, 7, 12, 1}, []int{3, 16, 11, 15}, []int{8, 14, 9, 2}}, 7), expected: []int{1, 10, 1, 10, 1, 10, 1} },\n { actual: candidate([][]int{[]int{8, 14, 9, 2}, []int{6, 4, 13, 15}, []int{5, 7, 1, 12}, []int{3, 10, 11, 16}}, 5), expected: []int{1, 7, 1, 7, 1} },\n { actual: candidate([][]int{[]int{11, 8, 7, 2}, []int{5, 16, 14, 4}, []int{9, 3, 15, 6}, []int{12, 13, 10, 1}}, 9), expected: []int{1, 6, 1, 6, 1, 6, 1, 6, 1} },\n { actual: candidate([][]int{[]int{12, 13, 10, 1}, []int{9, 3, 15, 6}, []int{5, 16, 14, 4}, []int{11, 8, 7, 2}}, 12), expected: []int{1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6} },\n { actual: candidate([][]int{[]int{2, 7, 4}, []int{3, 1, 5}, []int{6, 8, 9}}, 8), expected: []int{1, 3, 1, 3, 1, 3, 1, 3} },\n { actual: candidate([][]int{[]int{6, 1, 5}, []int{3, 8, 9}, []int{2, 7, 4}}, 8), expected: []int{1, 5, 1, 5, 1, 5, 1, 5} },\n { actual: candidate([][]int{[]int{1, 2}, []int{3, 4}}, 10), expected: []int{1, 2, 1, 2, 1, 2, 1, 2, 1, 2} },\n { actual: candidate([][]int{[]int{1, 3}, []int{3, 2}}, 10), expected: []int{1, 3, 1, 3, 1, 3, 1, 3, 1, 3} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "go_test.go", - "prompt": "package strange_sort_list_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given list of integers, return list in strange order.\n// Strange sorting, is when you start with the minimum value,\n// then maximum of the remaining integers, then minimum and so on.\n// Examples:\n// >>> strange_sort_list([]int{1, 2, 3, 4})\n// []int{1, 4, 2, 3}\n// >>> strange_sort_list([]int{5, 5, 5, 5})\n// []int{5, 5, 5, 5}\n// >>> strange_sort_list([]int{})\n// []int{}\nfunc strange_sort_list(lst []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "reworded", - "tests": "func TestStrange_Sort_List(t *testing.T) {\n candidate := strange_sort_list\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 3, 4}), expected: []int{1, 4, 2, 3} },\n { actual: candidate([]int{5, 6, 7, 8, 9}), expected: []int{5, 9, 6, 8, 7} },\n { actual: candidate([]int{1, 2, 3, 4, 5}), expected: []int{1, 5, 2, 4, 3} },\n { actual: candidate([]int{5, 6, 7, 8, 9, 1}), expected: []int{1, 9, 5, 8, 6, 7} },\n { actual: candidate([]int{5, 5, 5, 5}), expected: []int{5, 5, 5, 5} },\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{1, 2, 3, 4, 5, 6, 7, 8}), expected: []int{1, 8, 2, 7, 3, 6, 4, 5} },\n { actual: candidate([]int{0, 2, 2, 2, 5, 5, -5, -5}), expected: []int{-5, 5, -5, 5, 0, 2, 2, 2} },\n { actual: candidate([]int{111111}), expected: []int{111111} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "go_test.go", - "prompt": "package get_closest_vowel_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a word. Your task is to find the closest vowel that stands between \n// two consonants from the right side of the word (case sensitive).\n// Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n// find any vowel met the above condition. \n// You may assume that the given string contains English letter only.\n// Example:\n// >>> get_closest_vowel(\"yogurt\")\n// \"u\"\n// >>> get_closest_vowel(\"FULL\")\n// \"U\"\n// >>> get_closest_vowel(\"quick\")\n// \"\"\n// >>> get_closest_vowel(\"ab\")\n// \"\"\nfunc get_closest_vowel(word string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "reworded", - "tests": "func TestGet_Closest_Vowel(t *testing.T) {\n candidate := get_closest_vowel\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"yogurt\"), expected: \"u\" },\n { actual: candidate(\"full\"), expected: \"u\" },\n { actual: candidate(\"easy\"), expected: \"\" },\n { actual: candidate(\"eAsy\"), expected: \"\" },\n { actual: candidate(\"ali\"), expected: \"\" },\n { actual: candidate(\"bad\"), expected: \"a\" },\n { actual: candidate(\"most\"), expected: \"o\" },\n { actual: candidate(\"ab\"), expected: \"\" },\n { actual: candidate(\"ba\"), expected: \"\" },\n { actual: candidate(\"quick\"), expected: \"\" },\n { actual: candidate(\"anime\"), expected: \"i\" },\n { actual: candidate(\"Asia\"), expected: \"\" },\n { actual: candidate(\"Above\"), expected: \"o\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "go_test.go", - "prompt": "package change_base_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Change numerical base of input number x to base.\n// return string representation after the conversion.\n// base numbers are less than 10.\n// >>> change_base(8, 3)\n// \"22\"\n// >>> change_base(8, 2)\n// \"1000\"\n// >>> change_base(7, 2)\n// \"111\"\nfunc change_base(x int, base int) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "reworded", - "tests": "func TestChange_Base(t *testing.T) {\n candidate := change_base\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(8, 3), expected: \"22\" },\n { actual: candidate(9, 3), expected: \"100\" },\n { actual: candidate(234, 2), expected: \"11101010\" },\n { actual: candidate(16, 2), expected: \"10000\" },\n { actual: candidate(8, 2), expected: \"1000\" },\n { actual: candidate(7, 2), expected: \"111\" },\n { actual: candidate(2, 3), expected: \"2\" },\n { actual: candidate(3, 4), expected: \"3\" },\n { actual: candidate(4, 5), expected: \"4\" },\n { actual: candidate(5, 6), expected: \"5\" },\n { actual: candidate(6, 7), expected: \"6\" },\n { actual: candidate(7, 8), expected: \"7\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "go_test.go", - "prompt": "package has_close_elements_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Check if in given list of numbers, are any two numbers closer to each other than\n// given threshold.\n// >>> has_close_elements([]float64{1.0, 2.0, 3.0}, 0.5)\n// false\n// >>> has_close_elements([]float64{1.0, 2.8, 3.0, 4.0, 5.0, 2.0}, 0.3)\n// true\nfunc has_close_elements(numbers []float64, threshold float64) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "reworded", - "tests": "func TestHas_Close_Elements(t *testing.T) {\n candidate := has_close_elements\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]float64{1.0, 2.0, 3.9, 4.0, 5.0, 2.2}, 0.3), expected: true },\n { actual: candidate([]float64{1.0, 2.0, 3.9, 4.0, 5.0, 2.2}, 0.05), expected: false },\n { actual: candidate([]float64{1.0, 2.0, 5.9, 4.0, 5.0}, 0.95), expected: true },\n { actual: candidate([]float64{1.0, 2.0, 5.9, 4.0, 5.0}, 0.8), expected: false },\n { actual: candidate([]float64{1.0, 2.0, 3.0, 4.0, 5.0, 2.0}, 0.1), expected: true },\n { actual: candidate([]float64{1.1, 2.2, 3.1, 4.1, 5.1}, 1.0), expected: true },\n { actual: candidate([]float64{1.1, 2.2, 3.1, 4.1, 5.1}, 0.5), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "go_test.go", - "prompt": "package is_nested_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function that takes a string as input which contains only square brackets.\n// The function should return true if and only if there is a valid subsequence of brackets \n// where at least one bracket in the subsequence is nested.\n// >>> is_nested(\"[[]]\")\n// true\n// >>> is_nested(\"[]]]]]]][[[[[]\")\n// false\n// >>> is_nested(\"[][]\")\n// false\n// >>> is_nested(\"[]\")\n// false\n// >>> is_nested(\"[[][]]\")\n// true\n// >>> is_nested(\"[[]][[\")\n// true\nfunc is_nested(myString string) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "reworded", - "tests": "func TestIs_Nested(t *testing.T) {\n candidate := is_nested\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"[[]]\"), expected: true },\n { actual: candidate(\"[]]]]]]][[[[[]\"), expected: false },\n { actual: candidate(\"[][]\"), expected: false },\n { actual: candidate(\"[]\"), expected: false },\n { actual: candidate(\"[[[[]]]]\"), expected: true },\n { actual: candidate(\"[]]]]]]]]]]\"), expected: false },\n { actual: candidate(\"[][][[]]\"), expected: true },\n { actual: candidate(\"[[]\"), expected: false },\n { actual: candidate(\"[]]\"), expected: false },\n { actual: candidate(\"[[]][[\"), expected: true },\n { actual: candidate(\"[[][]]\"), expected: true },\n { actual: candidate(\"\"), expected: false },\n { actual: candidate(\"[[[[[[[[\"), expected: false },\n { actual: candidate(\"]]]]]]]]\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "go_test.go", - "prompt": "package concatenate_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Concatenate list of strings into a single string\n// >>> concatenate([]string{})\n// \"\"\n// >>> concatenate([]string{\"a\", \"b\", \"c\"})\n// \"abc\"\nfunc concatenate(strings []string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "reworded", - "tests": "func TestConcatenate(t *testing.T) {\n candidate := concatenate\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{}), expected: \"\" },\n { actual: candidate([]string{\"x\", \"y\", \"z\"}), expected: \"xyz\" },\n { actual: candidate([]string{\"x\", \"y\", \"z\", \"w\", \"k\"}), expected: \"xyzwk\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "go_test.go", - "prompt": "package prime_fib_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n// >>> prime_fib(1)\n// 2\n// >>> prime_fib(2)\n// 3\n// >>> prime_fib(3)\n// 5\n// >>> prime_fib(4)\n// 13\n// >>> prime_fib(5)\n// 89\nfunc prime_fib(n int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "reworded", - "tests": "func TestPrime_Fib(t *testing.T) {\n candidate := prime_fib\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(1), expected: 2 },\n { actual: candidate(2), expected: 3 },\n { actual: candidate(3), expected: 5 },\n { actual: candidate(4), expected: 13 },\n { actual: candidate(5), expected: 89 },\n { actual: candidate(6), expected: 233 },\n { actual: candidate(7), expected: 1597 },\n { actual: candidate(8), expected: 28657 },\n { actual: candidate(9), expected: 514229 },\n { actual: candidate(10), expected: 433494437 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "go_test.go", - "prompt": "package find_closest_elements_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n// other and return them in order (smaller number, larger number).\n// >>> find_closest_elements([]float64{1.0, 2.0, 3.0, 4.0, 5.0, 2.2})\n// []interface{}{2.0, 2.2}\n// >>> find_closest_elements([]float64{1.0, 2.0, 3.0, 4.0, 5.0, 2.0})\n// []interface{}{2.0, 2.0}\nfunc find_closest_elements(numbers []float64) []interface{} {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "reworded", - "tests": "func TestFind_Closest_Elements(t *testing.T) {\n candidate := find_closest_elements\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]float64{1.0, 2.0, 3.9, 4.0, 5.0, 2.2}), expected: []interface{}{3.9, 4.0} },\n { actual: candidate([]float64{1.0, 2.0, 5.9, 4.0, 5.0}), expected: []interface{}{5.0, 5.9} },\n { actual: candidate([]float64{1.0, 2.0, 3.0, 4.0, 5.0, 2.2}), expected: []interface{}{2.0, 2.2} },\n { actual: candidate([]float64{1.0, 2.0, 3.0, 4.0, 5.0, 2.0}), expected: []interface{}{2.0, 2.0} },\n { actual: candidate([]float64{1.1, 2.2, 3.1, 4.1, 5.1}), expected: []interface{}{2.2, 3.1} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "go_test.go", - "prompt": "package hex_key_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You have been tasked to write a function that receives \n// a hexadecimal number as a string and counts the number of hexadecimal \n// digits that are primes (prime number, or a prime, is a natural number \n// greater than 1 that is not a product of two smaller natural numbers).\n// Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n// Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n// So you have to determine a number of the following digits: 2, 3, 5, 7, \n// B (=decimal 11), D (=decimal 13).\n// Note: you may assume the input is always correct or empty string, \n// and symbols A,B,C,D,E,F are always uppercase.\n// Examples:\n// >>> hex_key(\"AB\")\n// 1\n// >>> hex_key(\"1077E\")\n// 2\n// >>> hex_key(\"ABED1A33\")\n// 4\n// >>> hex_key(\"123456789ABCDEF0\")\n// 6\n// >>> hex_key(\"2020\")\n// 2\nfunc hex_key(num string) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "reworded", - "tests": "func TestHex_Key(t *testing.T) {\n candidate := hex_key\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"AB\"), expected: 1 },\n { actual: candidate(\"1077E\"), expected: 2 },\n { actual: candidate(\"ABED1A33\"), expected: 4 },\n { actual: candidate(\"2020\"), expected: 2 },\n { actual: candidate(\"123456789ABCDEF0\"), expected: 6 },\n { actual: candidate(\"112233445566778899AABBCCDDEEFF00\"), expected: 12 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "go_test.go", - "prompt": "package multiply_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Complete the function that takes two integers and returns \n// the product of their unit digits.\n// Assume the input is always valid.\n// Examples:\n// >>> multiply(148, 412)\n// 16\n// >>> multiply(19, 28)\n// 72\n// >>> multiply(2020, 1851)\n// 0\n// >>> multiply(14, -15)\n// 20\nfunc multiply(a int, b int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "reworded", - "tests": "func TestMultiply(t *testing.T) {\n candidate := multiply\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(148, 412), expected: 16 },\n { actual: candidate(19, 28), expected: 72 },\n { actual: candidate(2020, 1851), expected: 0 },\n { actual: candidate(14, -15), expected: 20 },\n { actual: candidate(76, 67), expected: 42 },\n { actual: candidate(17, 27), expected: 49 },\n { actual: candidate(0, 1), expected: 0 },\n { actual: candidate(0, 0), expected: 0 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "go_test.go", - "prompt": "package rescale_to_unit_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given list of numbers (of at least two elements), apply a linear transform to that list,\n// such that the smallest number will become 0 and the largest will become 1\n// >>> rescale_to_unit([]float64{1.0, 2.0, 3.0, 4.0, 5.0})\n// []float64{0.0, 0.25, 0.5, 0.75, 1.0}\nfunc rescale_to_unit(numbers []float64) []float64 {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "reworded", - "tests": "func TestRescale_To_Unit(t *testing.T) {\n candidate := rescale_to_unit\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]float64{2.0, 49.9}), expected: []float64{0.0, 1.0} },\n { actual: candidate([]float64{100.0, 49.9}), expected: []float64{1.0, 0.0} },\n { actual: candidate([]float64{1.0, 2.0, 3.0, 4.0, 5.0}), expected: []float64{0.0, 0.25, 0.5, 0.75, 1.0} },\n { actual: candidate([]float64{2.0, 1.0, 5.0, 3.0, 4.0}), expected: []float64{0.25, 0.0, 1.0, 0.5, 0.75} },\n { actual: candidate([]float64{12.0, 11.0, 15.0, 13.0, 14.0}), expected: []float64{0.25, 0.0, 1.0, 0.5, 0.75} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_131_digits", - "language": "go_test.go", - "prompt": "package digits_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a positive integer n, return the product of the odd digits.\n// Return 0 if all digits are even.\n// For example:\n// >>> digits(1)\n// 1\n// >>> digits(4)\n// 0\n// >>> digits(235)\n// 15\nfunc digits(n int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "reworded", - "tests": "func TestDigits(t *testing.T) {\n candidate := digits\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5), expected: 5 },\n { actual: candidate(54), expected: 5 },\n { actual: candidate(120), expected: 1 },\n { actual: candidate(5014), expected: 5 },\n { actual: candidate(98765), expected: 315 },\n { actual: candidate(5576543), expected: 2625 },\n { actual: candidate(2468), expected: 0 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "go_test.go", - "prompt": "package Strongest_Extension_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You will be given the name of a class (a string) and a list of extensions.\n// The extensions are to be used to load additional classes to the class. The\n// strength of the extension is as follows: Let CAP be the number of the uppercase\n// letters in the extension's name, and let SM be the number of lowercase letters \n// in the extension's name, the strength is given by the fraction CAP - SM. \n// You should find the strongest extension and return a string in this \n// format: ClassName.StrongestExtensionName.\n// If there are two or more extensions with the same strength, you should\n// choose the one that comes first in the list.\n// For example, if you are given \"Slices\" as the class and a list of the\n// extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n// return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n// (its strength is -1).\n// Example:\n// >>> Strongest_Extension(\"my_class\", []string{\"AA\", \"Be\", \"CC\"})\n// \"my_class.AA\"\nfunc Strongest_Extension(class_name string, extensions []string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "reworded", - "tests": "func TestStrongest_Extension(t *testing.T) {\n candidate := Strongest_Extension\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Watashi\", []string{\"tEN\", \"niNE\", \"eIGHt8OKe\"}), expected: \"Watashi.eIGHt8OKe\" },\n { actual: candidate(\"Boku123\", []string{\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"}), expected: \"Boku123.YEs.WeCaNe\" },\n { actual: candidate(\"__YESIMHERE\", []string{\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"}), expected: \"__YESIMHERE.NuLl__\" },\n { actual: candidate(\"K\", []string{\"Ta\", \"TAR\", \"t234An\", \"cosSo\"}), expected: \"K.TAR\" },\n { actual: candidate(\"__HAHA\", []string{\"Tab\", \"123\", \"781345\", \"-_-\"}), expected: \"__HAHA.123\" },\n { actual: candidate(\"YameRore\", []string{\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"}), expected: \"YameRore.okIWILL123\" },\n { actual: candidate(\"finNNalLLly\", []string{\"Die\", \"NowW\", \"Wow\", \"WoW\"}), expected: \"finNNalLLly.WoW\" },\n { actual: candidate(\"_\", []string{\"Bb\", \"91245\"}), expected: \"_.Bb\" },\n { actual: candidate(\"Sp\", []string{\"671235\", \"Bb\"}), expected: \"Sp.671235\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "go_test.go", - "prompt": "package histogram_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a string representing a space separated lowercase letters, return a map\n// of the letter with the most repetition and containing the corresponding count.\n// If several letters have the same occurrence, return all of them.\n// Example:\n// >>> histogram(\"a b c\")\n// map[string]int{\"a\": 1, \"b\": 1, \"c\": 1}\n// >>> histogram(\"a b b a\")\n// map[string]int{\"a\": 2, \"b\": 2}\n// >>> histogram(\"a b c a b\")\n// map[string]int{\"a\": 2, \"b\": 2}\n// >>> histogram(\"b b b b a\")\n// map[string]int{\"b\": 4}\n// >>> histogram(\"\")\n// map[string]int{}\nfunc histogram(test string) map[string]int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "reworded", - "tests": "func TestHistogram(t *testing.T) {\n candidate := histogram\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"a b b a\"), expected: map[string]int{\"a\": 2, \"b\": 2} },\n { actual: candidate(\"a b c a b\"), expected: map[string]int{\"a\": 2, \"b\": 2} },\n { actual: candidate(\"a b c d g\"), expected: map[string]int{\"a\": 1, \"b\": 1, \"c\": 1, \"d\": 1, \"g\": 1} },\n { actual: candidate(\"r t g\"), expected: map[string]int{\"r\": 1, \"t\": 1, \"g\": 1} },\n { actual: candidate(\"b b b b a\"), expected: map[string]int{\"b\": 4} },\n { actual: candidate(\"r t g\"), expected: map[string]int{\"r\": 1, \"t\": 1, \"g\": 1} },\n { actual: candidate(\"\"), expected: map[string]int{} },\n { actual: candidate(\"a\"), expected: map[string]int{\"a\": 1} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "go_test.go", - "prompt": "package pairs_sum_to_zero_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// pairs_sum_to_zero takes a list of integers as an input.\n// it returns true if there are two distinct elements in the list that\n// sum to zero, and false otherwise.\n// >>> pairs_sum_to_zero([]int{1, 3, 5, 0})\n// false\n// >>> pairs_sum_to_zero([]int{1, 3, -2, 1})\n// false\n// >>> pairs_sum_to_zero([]int{1, 2, 3, 7})\n// false\n// >>> pairs_sum_to_zero([]int{2, 4, -5, 3, 5, 7})\n// true\n// >>> pairs_sum_to_zero([]int{1})\n// false\nfunc pairs_sum_to_zero(l []int) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "func TestPairs_Sum_To_Zero(t *testing.T) {\n candidate := pairs_sum_to_zero\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 3, 5, 0}), expected: false },\n { actual: candidate([]int{1, 3, -2, 1}), expected: false },\n { actual: candidate([]int{1, 2, 3, 7}), expected: false },\n { actual: candidate([]int{2, 4, -5, 3, 5, 7}), expected: true },\n { actual: candidate([]int{1}), expected: false },\n { actual: candidate([]int{-3, 9, -1, 3, 2, 30}), expected: true },\n { actual: candidate([]int{-3, 9, -1, 3, 2, 31}), expected: true },\n { actual: candidate([]int{-3, 9, -1, 4, 2, 30}), expected: false },\n { actual: candidate([]int{-3, 9, -1, 4, 2, 31}), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "go_test.go", - "prompt": "package total_match_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that accepts two lists of strings and returns the list that has \n// total number of chars in the all strings of the list less than the other list.\n// if the two lists have the same number of chars, return the first list.\n// Examples\n// >>> total_match([]string{}, []string{})\n// []string{}\n// >>> total_match([]string{\"hi\", \"admin\"}, []string{\"hI\", \"Hi\"})\n// []string{\"hI\", \"Hi\"}\n// >>> total_match([]string{\"hi\", \"admin\"}, []string{\"hi\", \"hi\", \"admin\", \"project\"})\n// []string{\"hi\", \"admin\"}\n// >>> total_match([]string{\"hi\", \"admin\"}, []string{\"hI\", \"hi\", \"hi\"})\n// []string{\"hI\", \"hi\", \"hi\"}\n// >>> total_match([]string{\"4\"}, []string{\"1\", \"2\", \"3\", \"4\", \"5\"})\n// []string{\"4\"}\nfunc total_match(lst1 []string, lst2 []string) []string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "reworded", - "tests": "func TestTotal_Match(t *testing.T) {\n candidate := total_match\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{}, []string{}), expected: []string{} },\n { actual: candidate([]string{\"hi\", \"admin\"}, []string{\"hi\", \"hi\"}), expected: []string{\"hi\", \"hi\"} },\n { actual: candidate([]string{\"hi\", \"admin\"}, []string{\"hi\", \"hi\", \"admin\", \"project\"}), expected: []string{\"hi\", \"admin\"} },\n { actual: candidate([]string{\"4\"}, []string{\"1\", \"2\", \"3\", \"4\", \"5\"}), expected: []string{\"4\"} },\n { actual: candidate([]string{\"hi\", \"admin\"}, []string{\"hI\", \"Hi\"}), expected: []string{\"hI\", \"Hi\"} },\n { actual: candidate([]string{\"hi\", \"admin\"}, []string{\"hI\", \"hi\", \"hi\"}), expected: []string{\"hI\", \"hi\", \"hi\"} },\n { actual: candidate([]string{\"hi\", \"admin\"}, []string{\"hI\", \"hi\", \"hii\"}), expected: []string{\"hi\", \"admin\"} },\n { actual: candidate([]string{}, []string{\"this\"}), expected: []string{} },\n { actual: candidate([]string{\"this\"}, []string{}), expected: []string{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "go_test.go", - "prompt": "package circular_shift_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Circular shift the digits of the integer x, shift the digits right by shift\n// and return the result as a string.\n// If shift > number of digits, return digits reversed.\n// >>> circular_shift(12, 1)\n// \"21\"\n// >>> circular_shift(12, 2)\n// \"12\"\nfunc circular_shift(x int, shift int) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "reworded", - "tests": "func TestCircular_Shift(t *testing.T) {\n candidate := circular_shift\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(100, 2), expected: \"001\" },\n { actual: candidate(12, 2), expected: \"12\" },\n { actual: candidate(97, 8), expected: \"79\" },\n { actual: candidate(12, 1), expected: \"21\" },\n { actual: candidate(11, 101), expected: \"11\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "go_test.go", - "prompt": "package monotonic_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return true is list elements are monotonically increasing or decreasing.\n// >>> monotonic([]int{1, 2, 4, 20})\n// true\n// >>> monotonic([]int{1, 20, 4, 10})\n// false\n// >>> monotonic([]int{4, 1, 0, -10})\n// true\nfunc monotonic(l []int) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "reworded", - "tests": "func TestMonotonic(t *testing.T) {\n candidate := monotonic\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 4, 10}), expected: true },\n { actual: candidate([]int{1, 2, 4, 20}), expected: true },\n { actual: candidate([]int{1, 20, 4, 10}), expected: false },\n { actual: candidate([]int{4, 1, 0, -10}), expected: true },\n { actual: candidate([]int{4, 1, 1, 0}), expected: true },\n { actual: candidate([]int{1, 2, 3, 2, 5, 60}), expected: false },\n { actual: candidate([]int{1, 2, 3, 4, 5, 60}), expected: true },\n { actual: candidate([]int{9, 9, 9, 9}), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "go_test.go", - "prompt": "package is_equal_to_sum_even_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n// Example\n// >>> is_equal_to_sum_even(4)\n// false\n// >>> is_equal_to_sum_even(6)\n// false\n// >>> is_equal_to_sum_even(8)\n// true\nfunc is_equal_to_sum_even(n int) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "reworded", - "tests": "func TestIs_Equal_To_Sum_Even(t *testing.T) {\n candidate := is_equal_to_sum_even\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(4), expected: false },\n { actual: candidate(6), expected: false },\n { actual: candidate(8), expected: true },\n { actual: candidate(10), expected: true },\n { actual: candidate(11), expected: false },\n { actual: candidate(12), expected: true },\n { actual: candidate(13), expected: false },\n { actual: candidate(16), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "go_test.go", - "prompt": "package parse_music_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Input to this function is a string representing musical notes in a special ASCII format.\n// Your task is to parse this string and return list of integers corresponding to how many beats does each\n// not last.\n// Here is a legend:\n// 'o' - whole note, lasts four beats\n// 'o|' - half note, lasts two beats\n// '.|' - quater note, lasts one beat\n// >>> parse_music(\"o o| .| o| o| .| .| .| .| o o\")\n// []int{4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4}\nfunc parse_music(music_string string) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "reworded", - "tests": "func TestParse_Music(t *testing.T) {\n candidate := parse_music\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: []int{} },\n { actual: candidate(\"o o o o\"), expected: []int{4, 4, 4, 4} },\n { actual: candidate(\".| .| .| .|\"), expected: []int{1, 1, 1, 1} },\n { actual: candidate(\"o| o| .| .| o o o o\"), expected: []int{2, 2, 1, 1, 4, 4, 4, 4} },\n { actual: candidate(\"o| .| o| .| o o| o o|\"), expected: []int{2, 1, 2, 1, 4, 2, 4, 2} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "go_test.go", - "prompt": "package sum_squares_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// \"\n// This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n// multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n// change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n// Examples:\n// >>> lst\n// []int{1, 2, 3}\n// >>> lst\n// int{}\n// >>> lst\n// []int{-1, -5, 2, -1, -5}\nfunc sum_squares(lst []int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "reworded", - "tests": "func TestSum_Squares(t *testing.T) {\n candidate := sum_squares\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 3}), expected: 6 },\n { actual: candidate([]int{1, 4, 9}), expected: 14 },\n { actual: candidate([]int{}), expected: 0 },\n { actual: candidate([]int{1, 1, 1, 1, 1, 1, 1, 1, 1}), expected: 9 },\n { actual: candidate([]int{-1, -1, -1, -1, -1, -1, -1, -1, -1}), expected: -3 },\n { actual: candidate([]int{0}), expected: 0 },\n { actual: candidate([]int{-1, -5, 2, -1, -5}), expected: -126 },\n { actual: candidate([]int{-56, -99, 1, 0, -2}), expected: 3030 },\n { actual: candidate([]int{-1, 0, 0, 0, 0, 0, 0, 0, -1}), expected: 0 },\n { actual: candidate([]int{-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37}), expected: -14196 },\n { actual: candidate([]int{-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10}), expected: -1448 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "go_test.go", - "prompt": "package triples_sum_to_zero_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// triples_sum_to_zero takes a list of integers as an input.\n// it returns true if there are three distinct elements in the list that\n// sum to zero, and false otherwise.\n// >>> triples_sum_to_zero([]int{1, 3, 5, 0})\n// false\n// >>> triples_sum_to_zero([]int{1, 3, -2, 1})\n// true\n// >>> triples_sum_to_zero([]int{1, 2, 3, 7})\n// false\n// >>> triples_sum_to_zero([]int{2, 4, -5, 3, 9, 7})\n// true\n// >>> triples_sum_to_zero([]int{1})\n// false\nfunc triples_sum_to_zero(l []int) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "func TestTriples_Sum_To_Zero(t *testing.T) {\n candidate := triples_sum_to_zero\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 3, 5, 0}), expected: false },\n { actual: candidate([]int{1, 3, 5, -1}), expected: false },\n { actual: candidate([]int{1, 3, -2, 1}), expected: true },\n { actual: candidate([]int{1, 2, 3, 7}), expected: false },\n { actual: candidate([]int{1, 2, 5, 7}), expected: false },\n { actual: candidate([]int{2, 4, -5, 3, 9, 7}), expected: true },\n { actual: candidate([]int{1}), expected: false },\n { actual: candidate([]int{1, 3, 5, -100}), expected: false },\n { actual: candidate([]int{100, 3, 5, -100}), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "go_test.go", - "prompt": "package correct_bracketing_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// brackets is a string of \"<\" and \">\".\n// return true if every opening bracket has a corresponding closing bracket.\n// >>> correct_bracketing(\"<\")\n// false\n// >>> correct_bracketing(\"<>\")\n// true\n// >>> correct_bracketing(\"<<><>>\")\n// true\n// >>> correct_bracketing(\"><<>\")\n// false\nfunc correct_bracketing(brackets string) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "func TestCorrect_Bracketing(t *testing.T) {\n candidate := correct_bracketing\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"<>\"), expected: true },\n { actual: candidate(\"<<><>>\"), expected: true },\n { actual: candidate(\"<><><<><>><>\"), expected: true },\n { actual: candidate(\"<><><<<><><>><>><<><><<>>>\"), expected: true },\n { actual: candidate(\"<<<><>>>>\"), expected: false },\n { actual: candidate(\"><<>\"), expected: false },\n { actual: candidate(\"<\"), expected: false },\n { actual: candidate(\"<<<<\"), expected: false },\n { actual: candidate(\">\"), expected: false },\n { actual: candidate(\"<<>\"), expected: false },\n { actual: candidate(\"<><><<><>><>><<>\"), expected: false },\n { actual: candidate(\"<><><<><>><>>><>\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "go_test.go", - "prompt": "package specialFilter_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that takes a list of numbers as input and returns \n// the number of elements in the list that are greater than 10 and both \n// first and last digits of a number are odd (1, 3, 5, 7, 9).\n// For example:\n// >>> specialFilter([]int{15, -73, 14, -15})\n// 1\n// >>> specialFilter([]int{33, -2, -3, 45, 21, 109})\n// 2\nfunc specialFilter(nums []int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "reworded", - "tests": "func TestSpecialfilter(t *testing.T) {\n candidate := specialFilter\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{5, -2, 1, -5}), expected: 0 },\n { actual: candidate([]int{15, -73, 14, -15}), expected: 1 },\n { actual: candidate([]int{33, -2, -3, 45, 21, 109}), expected: 2 },\n { actual: candidate([]int{43, -12, 93, 125, 121, 109}), expected: 4 },\n { actual: candidate([]int{71, -2, -33, 75, 21, 19}), expected: 3 },\n { actual: candidate([]int{1}), expected: 0 },\n { actual: candidate([]int{}), expected: 0 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "go_test.go", - "prompt": "package check_dict_case_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a map, return true if all keys are strings in lower \n// case or all keys are strings in upper case, else return false.\n// The function should return false is the given map is empty.\n// Examples:\n// >>> check_dict_case(map[string]string{\"a\": \"apple\", \"b\": \"banana\"})\n// true\n// >>> check_dict_case(map[string]string{\"a\": \"apple\", \"A\": \"banana\", \"B\": \"banana\"})\n// false\n// >>> check_dict_case(map[interface{}]string{\"a\": \"apple\", 8: \"banana\", \"a\": \"apple\"})\n// false\n// >>> check_dict_case(map[string]string{\"Name\": \"John\", \"Age\": \"36\", \"City\": \"Houston\"})\n// false\n// >>> check_dict_case(map[string]string{\"STATE\": \"NC\", \"ZIP\": \"12345\"})\n// true\nfunc check_dict_case(dict map[string]string) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "reworded", - "tests": "func TestCheck_Dict_Case(t *testing.T) {\n candidate := check_dict_case\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(map[string]string{\"p\": \"pineapple\", \"b\": \"banana\"}), expected: true },\n { actual: candidate(map[string]string{\"p\": \"pineapple\", \"A\": \"banana\", \"B\": \"banana\"}), expected: false },\n { actual: candidate(map[string]string{\"p\": \"pineapple\", \"5\": \"banana\", \"a\": \"apple\"}), expected: false },\n { actual: candidate(map[string]string{\"Name\": \"John\", \"Age\": \"36\", \"City\": \"Houston\"}), expected: false },\n { actual: candidate(map[string]string{\"STATE\": \"NC\", \"ZIP\": \"12345\"}), expected: true },\n { actual: candidate(map[string]string{\"fruit\": \"Orange\", \"taste\": \"Sweet\"}), expected: true },\n { actual: candidate(map[string]string{}), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "go_test.go", - "prompt": "package fibfib_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fibfib(0) == 0\n// fibfib(1) == 0\n// fibfib(2) == 1\n// fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n// Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n// >>> fibfib(1)\n// 0\n// >>> fibfib(5)\n// 4\n// >>> fibfib(8)\n// 24\nfunc fibfib(n int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "reworded", - "tests": "func TestFibfib(t *testing.T) {\n candidate := fibfib\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(2), expected: 1 },\n { actual: candidate(1), expected: 0 },\n { actual: candidate(5), expected: 4 },\n { actual: candidate(8), expected: 24 },\n { actual: candidate(10), expected: 81 },\n { actual: candidate(12), expected: 274 },\n { actual: candidate(14), expected: 927 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "go_test.go", - "prompt": "package sum_squares_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a list of numbers.\n// You need to return the sum of squared numbers in the given list,\n// round each element in the list to the upper int(Ceiling) first.\n// Examples:\n// >>> lst([]float64{1.0, 2.0, 3.0})\n// 14\n// >>> lst([]float64{1.0, 4.0, 9.0})\n// 98\n// >>> lst([]float64{1.0, 3.0, 5.0, 7.0})\n// 84\n// >>> lst([]float64{1.4, 4.2, 0.0})\n// 29\n// >>> lst([]float64{-2.4, 1.0, 1.0})\n// 6\nfunc sum_squares(lst []float64) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "reworded", - "tests": "func TestSum_Squares(t *testing.T) {\n candidate := sum_squares\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]float64{1.0, 2.0, 3.0}), expected: 14 },\n { actual: candidate([]float64{1.0, 2.0, 3.0}), expected: 14 },\n { actual: candidate([]float64{1.0, 3.0, 5.0, 7.0}), expected: 84 },\n { actual: candidate([]float64{1.4, 4.2, 0.0}), expected: 29 },\n { actual: candidate([]float64{-2.4, 1.0, 1.0}), expected: 6 },\n { actual: candidate([]float64{100.0, 1.0, 15.0, 2.0}), expected: 10230 },\n { actual: candidate([]float64{10000.0, 10000.0}), expected: 200000000 },\n { actual: candidate([]float64{-1.4, 4.6, 6.3}), expected: 75 },\n { actual: candidate([]float64{-1.4, 17.9, 18.9, 19.9}), expected: 1086 },\n { actual: candidate([]float64{0.0}), expected: 0 },\n { actual: candidate([]float64{-1.0}), expected: 1 },\n { actual: candidate([]float64{-1.0, 1.0, 0.0}), expected: 2 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_85_add", - "language": "go_test.go", - "prompt": "package add_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a non-empty list of integers lst. add the even elements that are at odd indices..\n// Examples:\n// >>> add([]int{4, 2, 6, 7})\n// 2\nfunc add(lst []int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "reworded", - "tests": "func TestAdd(t *testing.T) {\n candidate := add\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{4, 88}), expected: 88 },\n { actual: candidate([]int{4, 5, 6, 7, 2, 122}), expected: 122 },\n { actual: candidate([]int{4, 0, 6, 7}), expected: 0 },\n { actual: candidate([]int{4, 4, 6, 8}), expected: 12 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_34_unique", - "language": "go_test.go", - "prompt": "package unique_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return sorted unique elements in a list\n// >>> unique([]int{5, 3, 5, 2, 3, 3, 9, 0, 123})\n// []int{0, 2, 3, 5, 9, 123}\nfunc unique(l []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "reworded", - "tests": "func TestUnique(t *testing.T) {\n candidate := unique\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{5, 3, 5, 2, 3, 3, 9, 0, 123}), expected: []int{0, 2, 3, 5, 9, 123} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "go_test.go", - "prompt": "package fix_spaces_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a string text, replace all spaces in it with underscores, \n// and if a string has more than 2 consecutive spaces, \n// then replace all consecutive spaces with - \n// >>> fix_spaces(\" Example\")\n// \"Example\"\n// >>> fix_spaces(\" Example 1\")\n// \"Example_1\"\n// >>> fix_spaces(\" Example 2\")\n// \"_Example_2\"\n// >>> fix_spaces(\" Example 3\")\n// \"_Example-3\"\nfunc fix_spaces(text string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "reworded", - "tests": "func TestFix_Spaces(t *testing.T) {\n candidate := fix_spaces\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Example\"), expected: \"Example\" },\n { actual: candidate(\"Mudasir Hanif \"), expected: \"Mudasir_Hanif_\" },\n { actual: candidate(\"Yellow Yellow Dirty Fellow\"), expected: \"Yellow_Yellow__Dirty__Fellow\" },\n { actual: candidate(\"Exa mple\"), expected: \"Exa-mple\" },\n { actual: candidate(\" Exa 1 2 2 mple\"), expected: \"-Exa_1_2_2_mple\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_49_modp", - "language": "go_test.go", - "prompt": "package modp_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return 2^n modulo p (be aware of numerics).\n// >>> modp(3, 5)\n// 3\n// >>> modp(1101, 101)\n// 2\n// >>> modp(0, 101)\n// 1\n// >>> modp(3, 11)\n// 8\n// >>> modp(100, 101)\n// 1\nfunc modp(n int, p int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "reworded", - "tests": "func TestModp(t *testing.T) {\n candidate := modp\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3, 5), expected: 3 },\n { actual: candidate(1101, 101), expected: 2 },\n { actual: candidate(0, 101), expected: 1 },\n { actual: candidate(3, 11), expected: 8 },\n { actual: candidate(100, 101), expected: 1 },\n { actual: candidate(30, 5), expected: 4 },\n { actual: candidate(31, 5), expected: 3 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "go_test.go", - "prompt": "package valid_date_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You have to write a function which validates a given date string and\n// returns true if the date is valid otherwise false.\n// The date is valid if all of the following rules are satisfied:\n// 1. The date string is not empty.\n// 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n// 3. The months should not be less than 1 or higher than 12.\n// 4. The date should be in the format: mm-dd-yyyy\n// >>> valid_date(\"03-11-2000\")\n// true\n// >>> valid_date(\"15-01-2012\")\n// false\n// >>> valid_date(\"04-0-2040\")\n// false\n// >>> valid_date(\"06-04-2020\")\n// true\n// >>> valid_date(\"06/04/2020\")\n// false\nfunc valid_date(date string) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "reworded", - "tests": "func TestValid_Date(t *testing.T) {\n candidate := valid_date\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"03-11-2000\"), expected: true },\n { actual: candidate(\"15-01-2012\"), expected: false },\n { actual: candidate(\"04-0-2040\"), expected: false },\n { actual: candidate(\"06-04-2020\"), expected: true },\n { actual: candidate(\"01-01-2007\"), expected: true },\n { actual: candidate(\"03-32-2011\"), expected: false },\n { actual: candidate(\"\"), expected: false },\n { actual: candidate(\"04-31-3000\"), expected: false },\n { actual: candidate(\"06-06-2005\"), expected: true },\n { actual: candidate(\"21-31-2000\"), expected: false },\n { actual: candidate(\"04-12-2003\"), expected: true },\n { actual: candidate(\"04122003\"), expected: false },\n { actual: candidate(\"20030412\"), expected: false },\n { actual: candidate(\"2003-04\"), expected: false },\n { actual: candidate(\"2003-04-12\"), expected: false },\n { actual: candidate(\"04-2003\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "go_test.go", - "prompt": "package anti_shuffle_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that takes a string and returns an ordered version of it.\n// Ordered version of string, is a string where all words (separated by space)\n// are replaced by a new word where all the characters arranged in\n// ascending order based on ascii value.\n// Note: You should keep the order of words and blank spaces in the sentence.\n// For example:\n// >>> anti_shuffle(\"Hi\")\n// \"Hi\"\n// >>> anti_shuffle(\"hello\")\n// \"ehllo\"\n// >>> anti_shuffle(\"Hello World!!!\")\n// \"Hello !!!Wdlor\"\nfunc anti_shuffle(s string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "reworded", - "tests": "func TestAnti_Shuffle(t *testing.T) {\n candidate := anti_shuffle\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Hi\"), expected: \"Hi\" },\n { actual: candidate(\"hello\"), expected: \"ehllo\" },\n { actual: candidate(\"number\"), expected: \"bemnru\" },\n { actual: candidate(\"abcd\"), expected: \"abcd\" },\n { actual: candidate(\"Hello World!!!\"), expected: \"Hello !!!Wdlor\" },\n { actual: candidate(\"\"), expected: \"\" },\n { actual: candidate(\"Hi. My name is Mister Robot. How are you?\"), expected: \".Hi My aemn is Meirst .Rboot How aer ?ouy\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "go_test.go", - "prompt": "package is_sorted_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a list of numbers, return whether or not they are sorted\n// in ascending order. If list has more than 1 duplicate of the same\n// number, return false. Assume no negative numbers and only integers.\n// Examples\n// >>> is_sorted([]int{5})\n// true\n// >>> is_sorted([]int{1, 2, 3, 4, 5})\n// true\n// >>> is_sorted([]int{1, 3, 2, 4, 5})\n// false\n// >>> is_sorted([]int{1, 2, 3, 4, 5, 6})\n// true\n// >>> is_sorted([]int{1, 2, 3, 4, 5, 6, 7})\n// true\n// >>> is_sorted([]int{1, 3, 2, 4, 5, 6, 7})\n// false\n// >>> is_sorted([]int{1, 2, 2, 3, 3, 4})\n// true\n// >>> is_sorted([]int{1, 2, 2, 2, 3, 4})\n// false\nfunc is_sorted(lst []int) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "reworded", - "tests": "func TestIs_Sorted(t *testing.T) {\n candidate := is_sorted\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{5}), expected: true },\n { actual: candidate([]int{1, 2, 3, 4, 5}), expected: true },\n { actual: candidate([]int{1, 3, 2, 4, 5}), expected: false },\n { actual: candidate([]int{1, 2, 3, 4, 5, 6}), expected: true },\n { actual: candidate([]int{1, 2, 3, 4, 5, 6, 7}), expected: true },\n { actual: candidate([]int{1, 3, 2, 4, 5, 6, 7}), expected: false },\n { actual: candidate([]int{}), expected: true },\n { actual: candidate([]int{1}), expected: true },\n { actual: candidate([]int{3, 2, 1}), expected: false },\n { actual: candidate([]int{1, 2, 2, 2, 3, 4}), expected: false },\n { actual: candidate([]int{1, 2, 3, 3, 3, 4}), expected: false },\n { actual: candidate([]int{1, 2, 2, 3, 3, 4}), expected: true },\n { actual: candidate([]int{1, 2, 3, 4}), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "go_test.go", - "prompt": "package is_happy_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a string s.\n// Your task is to check if the string is hapgo or not.\n// A string is hapgo if its length is at least 3 and every 3 consecutive letters are distinct\n// For example:\n// >>> is_happy(\"a\")\n// false\n// >>> is_happy(\"aa\")\n// false\n// >>> is_happy(\"abcd\")\n// true\n// >>> is_happy(\"aabb\")\n// false\n// >>> is_happy(\"adb\")\n// true\n// >>> is_happy(\"xyy\")\n// false\nfunc is_happy(s string) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "reworded", - "tests": "func TestIs_Happy(t *testing.T) {\n candidate := is_happy\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"a\"), expected: false },\n { actual: candidate(\"aa\"), expected: false },\n { actual: candidate(\"abcd\"), expected: true },\n { actual: candidate(\"aabb\"), expected: false },\n { actual: candidate(\"adb\"), expected: true },\n { actual: candidate(\"xyy\"), expected: false },\n { actual: candidate(\"iopaxpoi\"), expected: true },\n { actual: candidate(\"iopaxioi\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "go_test.go", - "prompt": "package will_it_fly_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that returns true if the object q will fly, and false otherwise.\n// The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n// Example:\n// >>> will_it_fly([]int{1, 2}, 5)\n// false\n// # 1+2 is less than the maximum possible weight, but it's unbalanced.\n// >>> will_it_fly([]int{3, 2, 3}, 1)\n// false\n// # it's balanced, but 3+2+3 is more than the maximum possible weight.\n// >>> will_it_fly([]int{3, 2, 3}, 9)\n// true\n// # 3+2+3 is less than the maximum possible weight, and it's balanced.\n// >>> will_it_fly([]int{3}, 5)\n// true\n// # 3 is less than the maximum possible weight, and it's balanced.\nfunc will_it_fly(q []int, w int) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "reworded", - "tests": "func TestWill_It_Fly(t *testing.T) {\n candidate := will_it_fly\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{3, 2, 3}, 9), expected: true },\n { actual: candidate([]int{1, 2}, 5), expected: false },\n { actual: candidate([]int{3}, 5), expected: true },\n { actual: candidate([]int{3, 2, 3}, 1), expected: false },\n { actual: candidate([]int{1, 2, 3}, 6), expected: false },\n { actual: candidate([]int{5}, 5), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "go_test.go", - "prompt": "package sort_array_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a list of non-negative integers, return a cogo of the given list after sorting,\n// you will sort the given list in ascending order if the sum( first index value, last index value) is odd,\n// or sort it in descending order if the sum( first index value, last index value) is even.\n// Note:\n// * don't change the given list.\n// Examples:\n// >>> sort_array([]int{})\n// []int{}\n// >>> sort_array([]int{5})\n// []int{5}\n// >>> sort_array([]int{2, 4, 3, 0, 1, 5})\n// []int{0, 1, 2, 3, 4, 5}\n// >>> sort_array([]int{2, 4, 3, 0, 1, 5, 6})\n// []int{6, 5, 4, 3, 2, 1, 0}\nfunc sort_array(array []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "reworded", - "tests": "func TestSort_Array(t *testing.T) {\n candidate := sort_array\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{5}), expected: []int{5} },\n { actual: candidate([]int{2, 4, 3, 0, 1, 5}), expected: []int{0, 1, 2, 3, 4, 5} },\n { actual: candidate([]int{2, 4, 3, 0, 1, 5, 6}), expected: []int{6, 5, 4, 3, 2, 1, 0} },\n { actual: candidate([]int{2, 1}), expected: []int{1, 2} },\n { actual: candidate([]int{15, 42, 87, 32, 11, 0}), expected: []int{0, 11, 15, 32, 42, 87} },\n { actual: candidate([]int{21, 14, 23, 11}), expected: []int{23, 21, 14, 11} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "go_test.go", - "prompt": "package count_up_to_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Implement a function that takes an non-negative integer and returns a list of the first n\n// integers that are prime numbers and less than n.\n// for example:\n// >>> count_up_to(5)\n// []int{2, 3}\n// >>> count_up_to(11)\n// []int{2, 3, 5, 7}\n// >>> count_up_to(0)\n// []int{}\n// >>> count_up_to(20)\n// []int{2, 3, 5, 7, 11, 13, 17, 19}\n// >>> count_up_to(1)\n// []int{}\n// >>> count_up_to(18)\n// []int{2, 3, 5, 7, 11, 13, 17}\nfunc count_up_to(n int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "reworded", - "tests": "func TestCount_Up_To(t *testing.T) {\n candidate := count_up_to\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5), expected: []int{2, 3} },\n { actual: candidate(6), expected: []int{2, 3, 5} },\n { actual: candidate(7), expected: []int{2, 3, 5} },\n { actual: candidate(10), expected: []int{2, 3, 5, 7} },\n { actual: candidate(0), expected: []int{} },\n { actual: candidate(22), expected: []int{2, 3, 5, 7, 11, 13, 17, 19} },\n { actual: candidate(1), expected: []int{} },\n { actual: candidate(18), expected: []int{2, 3, 5, 7, 11, 13, 17} },\n { actual: candidate(47), expected: []int{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43} },\n { actual: candidate(101), expected: []int{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "go_test.go", - "prompt": "package by_length_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a list of integers, sort the integers that are between 1 and 9 inclusive,\n// reverse the resulting list, and then replace each digit by its corresponding name from\n// \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n// For example:\n// >>> by_length([]int{2, 1, 1, 4, 5, 8, 2, 3})\n// []string{\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"}\n// If the list is empty, return an empty list:\n// >>> by_length([]int{})\n// []string{}\n// If the list has any strange number ignore it:\n// >>> by_length([]int{1, -1, 55})\n// []string{\"One\"}\nfunc by_length(arr []int) []string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "reworded", - "tests": "func TestBy_Length(t *testing.T) {\n candidate := by_length\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{2, 1, 1, 4, 5, 8, 2, 3}), expected: []string{\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"} },\n { actual: candidate([]int{}), expected: []string{} },\n { actual: candidate([]int{1, -1, 55}), expected: []string{\"One\"} },\n { actual: candidate([]int{1, -1, 3, 2}), expected: []string{\"Three\", \"Two\", \"One\"} },\n { actual: candidate([]int{9, 4, 8}), expected: []string{\"Nine\", \"Eight\", \"Four\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_106_f", - "language": "go_test.go", - "prompt": "package f_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Implement the function f that takes n as a parameter,\n// 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\n// or the sum of numbers from 1 to i otherwise.\n// i starts from 1.\n// the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n// Example:\n// >>> f(5)\n// []int{1, 2, 6, 24, 15}\nfunc f(n int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "reworded", - "tests": "func TestF(t *testing.T) {\n candidate := f\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5), expected: []int{1, 2, 6, 24, 15} },\n { actual: candidate(7), expected: []int{1, 2, 6, 24, 15, 720, 28} },\n { actual: candidate(1), expected: []int{1} },\n { actual: candidate(3), expected: []int{1, 2, 6} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "go_test.go", - "prompt": "package fizz_buzz_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n// >>> fizz_buzz(50)\n// 0\n// >>> fizz_buzz(78)\n// 2\n// >>> fizz_buzz(79)\n// 3\nfunc fizz_buzz(n int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "reworded", - "tests": "func TestFizz_Buzz(t *testing.T) {\n candidate := fizz_buzz\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(50), expected: 0 },\n { actual: candidate(78), expected: 2 },\n { actual: candidate(79), expected: 3 },\n { actual: candidate(100), expected: 3 },\n { actual: candidate(200), expected: 6 },\n { actual: candidate(4000), expected: 192 },\n { actual: candidate(10000), expected: 639 },\n { actual: candidate(100000), expected: 8026 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "go_test.go", - "prompt": "package truncate_number_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a positive floating point number, it can be decomposed into\n// and integer part (largest integer smaller than given number) and decimals\n// (leftover part always smaller than 1).\n// Return the decimal part of the number.\n// >>> truncate_number(3.5)\n// 0.5\nfunc truncate_number(number float64) float64 {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "reworded", - "tests": "func TestTruncate_Number(t *testing.T) {\n candidate := truncate_number\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3.5), expected: 0.5 },\n { actual: candidate(1.25), expected: 0.25 },\n { actual: candidate(123.0), expected: 0.0 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "go_test.go", - "prompt": "package sum_product_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// For a given list of integers, return a list consisting of a sum and a product of all the integers in a list.\n// Empty sum should be equal to 0 and empty product should be equal to 1.\n// >>> sum_product([]int{})\n// []interface{}{0, 1}\n// >>> sum_product([]int{1, 2, 3, 4})\n// []interface{}{10, 24}\nfunc sum_product(numbers []int) []interface{} {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "reworded", - "tests": "func TestSum_Product(t *testing.T) {\n candidate := sum_product\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}), expected: []interface{}{0, 1} },\n { actual: candidate([]int{1, 1, 1}), expected: []interface{}{3, 1} },\n { actual: candidate([]int{100, 0}), expected: []interface{}{100, 0} },\n { actual: candidate([]int{3, 5, 7}), expected: []interface{}{15, 105} },\n { actual: candidate([]int{10}), expected: []interface{}{10, 10} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "go_test.go", - "prompt": "package get_row_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a 2 dimensional data, as a nested lists,\n// which is similar to matrix, however, unlike matrices,\n// each row may contain a different number of columns.\n// Given lst, and integer x, find integers x in the list,\n// and return list of lists, [(x1, y1), (x2, y2) ...] such that\n// each list is a coordinate - (row, columns), starting with 0.\n// Sort coordinates initially by rows in ascending order.\n// Also, sort coordinates of the row by columns in descending order.\n// Examples:\n// >>> get_row([][]int{[]int{1, 2, 3, 4, 5, 6}, []int{1, 2, 3, 4, 1, 6}, []int{1, 2, 3, 4, 5, 1}}, 1)\n// [][]int{[]interface{}{0, 0}, []interface{}{1, 4}, []interface{}{1, 0}, []interface{}{2, 5}, []interface{}{2, 0}}\n// >>> get_row([][]int{}, 1)\n// [][]interface{}{}\n// >>> get_row([]interface{}{[]interface{}{}, []int{1}, []int{1, 2, 3}}, 3)\n// [][]int{[]interface{}{2, 2}}\nfunc get_row(lst [][]int, x int) [][]interface{} {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "reworded", - "tests": "func TestGet_Row(t *testing.T) {\n candidate := get_row\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([][]int{[]int{1, 2, 3, 4, 5, 6}, []int{1, 2, 3, 4, 1, 6}, []int{1, 2, 3, 4, 5, 1}}, 1), expected: [][]int{[]interface{}{0, 0}, []interface{}{1, 4}, []interface{}{1, 0}, []interface{}{2, 5}, []interface{}{2, 0}} },\n { actual: candidate([][]int{[]int{1, 2, 3, 4, 5, 6}, []int{1, 2, 3, 4, 5, 6}, []int{1, 2, 3, 4, 5, 6}, []int{1, 2, 3, 4, 5, 6}, []int{1, 2, 3, 4, 5, 6}, []int{1, 2, 3, 4, 5, 6}}, 2), expected: [][]int{[]interface{}{0, 1}, []interface{}{1, 1}, []interface{}{2, 1}, []interface{}{3, 1}, []interface{}{4, 1}, []interface{}{5, 1}} },\n { actual: candidate([][]int{[]int{1, 2, 3, 4, 5, 6}, []int{1, 2, 3, 4, 5, 6}, []int{1, 1, 3, 4, 5, 6}, []int{1, 2, 1, 4, 5, 6}, []int{1, 2, 3, 1, 5, 6}, []int{1, 2, 3, 4, 1, 6}, []int{1, 2, 3, 4, 5, 1}}, 1), expected: [][]int{[]interface{}{0, 0}, []interface{}{1, 0}, []interface{}{2, 1}, []interface{}{2, 0}, []interface{}{3, 2}, []interface{}{3, 0}, []interface{}{4, 3}, []interface{}{4, 0}, []interface{}{5, 4}, []interface{}{5, 0}, []interface{}{6, 5}, []interface{}{6, 0}} },\n { actual: candidate([][]int{}, 1), expected: [][]interface{}{} },\n { actual: candidate([][]int{[]int{1}}, 2), expected: [][]interface{}{} },\n { actual: candidate([]interface{}{[]interface{}{}, []int{1}, []int{1, 2, 3}}, 3), expected: [][]int{[]interface{}{2, 2}} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_159_eat", - "language": "go_test.go", - "prompt": "package eat_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You're a hungry rabbit, and you already have eaten a certain number of carrots,\n// but now you need to eat more carrots to complete the day's meals.\n// you should return a list of [ total number of eaten carrots after your meals,\n// the number of carrots left after your meals ]\n// if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n// Example:\n// >>> eat(5, 6, 10)\n// []int{11, 4}\n// >>> eat(4, 8, 9)\n// []int{12, 1}\n// >>> eat(1, 10, 10)\n// []int{11, 0}\n// >>> eat(2, 11, 5)\n// []int{7, 0}\n// Variables:\n// @number : integer\n// the number of carrots that you have eaten.\n// @need : integer\n// the number of carrots that you need to eat.\n// @remaining : integer\n// the number of remaining carrots thet exist in stock\n// Constrain:\n// * 0 <= number <= 1000\n// * 0 <= need <= 1000\n// * 0 <= remaining <= 1000\n// Have fun :)\nfunc eat(number int, need int, remaining int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "reworded", - "tests": "func TestEat(t *testing.T) {\n candidate := eat\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5, 6, 10), expected: []int{11, 4} },\n { actual: candidate(4, 8, 9), expected: []int{12, 1} },\n { actual: candidate(1, 10, 10), expected: []int{11, 0} },\n { actual: candidate(2, 11, 5), expected: []int{7, 0} },\n { actual: candidate(4, 5, 7), expected: []int{9, 2} },\n { actual: candidate(4, 5, 1), expected: []int{5, 0} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_84_solve", - "language": "go_test.go", - "prompt": "package solve_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a positive integer N, return the total sum of its digits in binary.\n// Example\n// >>> solve(1000)\n// \"1\"\n// >>> solve(150)\n// \"110\"\n// >>> solve(147)\n// \"1100\"\n// Variables:\n// @N integer\n// Constraints: 0 \u2264 N \u2264 10000.\n// Output:\n// a string of binary number\nfunc solve(N int) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "reworded", - "tests": "func TestSolve(t *testing.T) {\n candidate := solve\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(1000), expected: \"1\" },\n { actual: candidate(150), expected: \"110\" },\n { actual: candidate(147), expected: \"1100\" },\n { actual: candidate(333), expected: \"1001\" },\n { actual: candidate(963), expected: \"10010\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "go_test.go", - "prompt": "package skjkasdkd_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a list of integers.\n// You need to find the largest prime value and return the sum of its digits.\n// Examples:\n// >>> skjkasdkd([]int{0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3})\n// 10\n// >>> skjkasdkd([]int{1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1})\n// 25\n// >>> skjkasdkd([]int{1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3})\n// 13\n// >>> skjkasdkd([]int{0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6})\n// 11\n// >>> skjkasdkd([]int{0, 81, 12, 3, 1, 21})\n// 3\n// >>> skjkasdkd([]int{0, 8, 1, 2, 1, 7})\n// 7\nfunc skjkasdkd(lst []int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "reworded", - "tests": "func TestSkjkasdkd(t *testing.T) {\n candidate := skjkasdkd\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3}), expected: 10 },\n { actual: candidate([]int{1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1}), expected: 25 },\n { actual: candidate([]int{1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3}), expected: 13 },\n { actual: candidate([]int{0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6}), expected: 11 },\n { actual: candidate([]int{0, 81, 12, 3, 1, 21}), expected: 3 },\n { actual: candidate([]int{0, 8, 1, 2, 1, 7}), expected: 7 },\n { actual: candidate([]int{8191}), expected: 19 },\n { actual: candidate([]int{8191, 123456, 127, 7}), expected: 19 },\n { actual: candidate([]int{127, 97, 8192}), expected: 10 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "go_test.go", - "prompt": "package smallest_change_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a list arr of integers, find the minimum number of elements that\n// need to be changed to make the list palindromic. A palindromic list is a list that\n// is read the same backwards and forwards. In one change, you can change one element to any other element.\n// For example:\n// >>> smallest_change([]int{1, 2, 3, 5, 4, 7, 9, 6})\n// 4\n// >>> smallest_change([]int{1, 2, 3, 4, 3, 2, 2})\n// 1\n// >>> smallest_change([]int{1, 2, 3, 2, 1})\n// 0\nfunc smallest_change(arr []int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "reworded", - "tests": "func TestSmallest_Change(t *testing.T) {\n candidate := smallest_change\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 3, 5, 4, 7, 9, 6}), expected: 4 },\n { actual: candidate([]int{1, 2, 3, 4, 3, 2, 2}), expected: 1 },\n { actual: candidate([]int{1, 4, 2}), expected: 1 },\n { actual: candidate([]int{1, 4, 4, 2}), expected: 1 },\n { actual: candidate([]int{1, 2, 3, 2, 1}), expected: 0 },\n { actual: candidate([]int{3, 1, 1, 3}), expected: 0 },\n { actual: candidate([]int{1}), expected: 0 },\n { actual: candidate([]int{0, 1}), expected: 1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "go_test.go", - "prompt": "package numerical_letter_grade_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// It is the last week of the semester and the teacher has to give the grades\n// to students. The teacher has been making her own algorithm for grading.\n// The only problem is, she has lost the code she used for grading.\n// She has given you a list of GPAs for some students and you have to write \n// a function that can output a list of letter grades using the following table:\n// GPA | Letter grade\n// 4.0 A+\n// > 3.7 A \n// > 3.3 A- \n// > 3.0 B+\n// > 2.7 B \n// > 2.3 B-\n// > 2.0 C+\n// > 1.7 C\n// > 1.3 C-\n// > 1.0 D+ \n// > 0.7 D \n// > 0.0 D-\n// 0.0 E\n// Example:\n// >>> grade_equation([]float64{4.0, 3, 1.7, 2, 3.5})\n// []string{\"A+\", \"B\", \"C-\", \"C\", \"A-\"}\nfunc numerical_letter_grade(grades []float64) []string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "reworded", - "tests": "func TestNumerical_Letter_Grade(t *testing.T) {\n candidate := numerical_letter_grade\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]float64{4.0, 3, 1.7, 2, 3.5}), expected: []string{\"A+\", \"B\", \"C-\", \"C\", \"A-\"} },\n { actual: candidate([]float64{1.2}), expected: []string{\"D+\"} },\n { actual: candidate([]float64{0.5}), expected: []string{\"D-\"} },\n { actual: candidate([]float64{0.0}), expected: []string{\"E\"} },\n { actual: candidate([]float64{1.0, 0.3, 1.5, 2.8, 3.3}), expected: []string{\"D\", \"D-\", \"C-\", \"B\", \"B+\"} },\n { actual: candidate([]float64{0.0, 0.7}), expected: []string{\"E\", \"D-\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "go_test.go", - "prompt": "package triangle_area_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given the lengths of the three sides of a triangle. Return the area of\n// the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n// Otherwise return -1\n// Three sides make a valid triangle when the sum of any two sides is greater \n// than the third side.\n// Example:\n// >>> triangle_area(3, 4, 5)\n// 6.0\n// >>> triangle_area(1, 2, 10)\n// -1\nfunc triangle_area(a int, b int, c int) float64 {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "func TestTriangle_Area(t *testing.T) {\n candidate := triangle_area\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3, 4, 5), expected: 6.0 },\n { actual: candidate(1, 2, 10), expected: -1 },\n { actual: candidate(4, 8, 5), expected: 8.18 },\n { actual: candidate(2, 2, 2), expected: 1.73 },\n { actual: candidate(1, 2, 3), expected: -1 },\n { actual: candidate(10, 5, 7), expected: 16.25 },\n { actual: candidate(2, 6, 3), expected: -1 },\n { actual: candidate(1, 1, 1), expected: 0.43 },\n { actual: candidate(2, 2, 10), expected: -1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "go_test.go", - "prompt": "package same_chars_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Check if two words have the same characters.\n// >>> same_chars(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\")\n// true\n// >>> same_chars(\"abcd\", \"dddddddabc\")\n// true\n// >>> same_chars(\"dddddddabc\", \"abcd\")\n// true\n// >>> same_chars(\"eabcd\", \"dddddddabc\")\n// false\n// >>> same_chars(\"abcd\", \"dddddddabce\")\n// false\n// >>> same_chars(\"eabcdzzzz\", \"dddzzzzzzzddddabc\")\n// false\nfunc same_chars(s0 string, s1 string) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "reworded", - "tests": "func TestSame_Chars(t *testing.T) {\n candidate := same_chars\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\"), expected: true },\n { actual: candidate(\"abcd\", \"dddddddabc\"), expected: true },\n { actual: candidate(\"dddddddabc\", \"abcd\"), expected: true },\n { actual: candidate(\"eabcd\", \"dddddddabc\"), expected: false },\n { actual: candidate(\"abcd\", \"dddddddabcf\"), expected: false },\n { actual: candidate(\"eabcdzzzz\", \"dddzzzzzzzddddabc\"), expected: false },\n { actual: candidate(\"aabb\", \"aaccc\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "go_test.go", - "prompt": "package minSubArraySum_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a list of integers nums, find the minimum sum of any non-empty sub-list\n// of nums.\n// Example\n// >>> minSubArraySum([]int{2, 3, 4, 1, 2, 4})\n// 1\n// >>> minSubArraySum([]int{-1, -2, -3})\n// -6\nfunc minSubArraySum(nums []int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "reworded", - "tests": "func TestMinsubarraysum(t *testing.T) {\n candidate := minSubArraySum\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{2, 3, 4, 1, 2, 4}), expected: 1 },\n { actual: candidate([]int{-1, -2, -3}), expected: -6 },\n { actual: candidate([]int{-1, -2, -3, 2, -10}), expected: -14 },\n { actual: candidate([]int{-9999999999999999}), expected: -9999999999999999 },\n { actual: candidate([]int{0, 10, 20, 1000000}), expected: 0 },\n { actual: candidate([]int{-1, -2, -3, 10, -5}), expected: -6 },\n { actual: candidate([]int{100, -1, -2, -3, 10, -5}), expected: -6 },\n { actual: candidate([]int{10, 11, 13, 8, 3, 4}), expected: 3 },\n { actual: candidate([]int{100, -33, 32, -1, 0, -2}), expected: -33 },\n { actual: candidate([]int{-10}), expected: -10 },\n { actual: candidate([]int{7}), expected: 7 },\n { actual: candidate([]int{1, -1}), expected: -1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "go_test.go", - "prompt": "package select_words_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a string s and a natural number n, you have been tasked to implement \n// a function that returns a list of all words from string s that contain exactly \n// n consonants, in order these words appear in the string s.\n// If the string s is empty then the function should return an empty list.\n// Note: you may assume the input string contains only letters and spaces.\n// Examples:\n// >>> select_words(\"Mary had a little lamb\", 4)\n// []string{\"little\"}\n// >>> select_words(\"Mary had a little lamb\", 3)\n// []string{\"Mary\", \"lamb\"}\n// >>> select_words(\"simple white space\", 2)\n// []string{}\n// >>> select_words(\"Hello world\", 4)\n// []string{\"world\"}\n// >>> select_words(\"Uncle sam\", 3)\n// []string{\"Uncle\"}\nfunc select_words(s string, n int) []string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "reworded", - "tests": "func TestSelect_Words(t *testing.T) {\n candidate := select_words\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Mary had a little lamb\", 4), expected: []string{\"little\"} },\n { actual: candidate(\"Mary had a little lamb\", 3), expected: []string{\"Mary\", \"lamb\"} },\n { actual: candidate(\"simple white space\", 2), expected: []string{} },\n { actual: candidate(\"Hello world\", 4), expected: []string{\"world\"} },\n { actual: candidate(\"Uncle sam\", 3), expected: []string{\"Uncle\"} },\n { actual: candidate(\"\", 4), expected: []string{} },\n { actual: candidate(\"a b c d e f\", 1), expected: []string{\"b\", \"c\", \"d\", \"f\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "go_test.go", - "prompt": "package all_prefixes_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return list of all prefixes from shortest to longest of the input string\n// >>> all_prefixes(\"abc\")\n// []string{\"a\", \"ab\", \"abc\"}\nfunc all_prefixes(myString string) []string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "reworded", - "tests": "func TestAll_Prefixes(t *testing.T) {\n candidate := all_prefixes\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: []string{} },\n { actual: candidate(\"asdfgh\"), expected: []string{\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"} },\n { actual: candidate(\"WWW\"), expected: []string{\"W\", \"WW\", \"WWW\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "go_test.go", - "prompt": "package closest_integer_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function that takes a value (string) representing a number\n// and returns the closest integer to it. If the number is equidistant\n// from two integers, round it away from zero.\n// Examples\n// >>> closest_integer(\"10\")\n// 10\n// >>> closest_integer(\"15.3\")\n// 15\n// Note:\n// Rounding away from zero means that if the given number is equidistant\n// from two integers, the one you should return is the one that is the\n// farthest from zero. For example closest_integer(\"14.5\") should\n// return 15 and closest_integer(\"-14.5\") should return -15.\nfunc closest_integer(value string) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "reworded", - "tests": "func TestClosest_Integer(t *testing.T) {\n candidate := closest_integer\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"10\"), expected: 10 },\n { actual: candidate(\"14.5\"), expected: 15 },\n { actual: candidate(\"-15.5\"), expected: -16 },\n { actual: candidate(\"15.3\"), expected: 15 },\n { actual: candidate(\"0\"), expected: 0 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "go_test.go", - "prompt": "package file_name_check_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function which takes a string representing a file's name, and returns\n// 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n// A file's name is considered to be valid if and only if all the following conditions \n// are met:\n// - There should not be more than three digits ('0'-'9') in the file's name.\n// - The file's name contains exactly one dot '.'\n// - The substring before the dot should not be empty, and it starts with a letter from \n// the latin alphapet ('a'-'z' and 'A'-'Z').\n// - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n// Examples:\n// >>> file_name_check(\"example.txt\")\n// \"Yes\"\n// >>> file_name_check(\"1example.dll\")\n// \"No\"\nfunc file_name_check(file_name string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "reworded", - "tests": "func TestFile_Name_Check(t *testing.T) {\n candidate := file_name_check\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"example.txt\"), expected: \"Yes\" },\n { actual: candidate(\"1example.dll\"), expected: \"No\" },\n { actual: candidate(\"s1sdf3.asd\"), expected: \"No\" },\n { actual: candidate(\"K.dll\"), expected: \"Yes\" },\n { actual: candidate(\"MY16FILE3.exe\"), expected: \"Yes\" },\n { actual: candidate(\"His12FILE94.exe\"), expected: \"No\" },\n { actual: candidate(\"_Y.txt\"), expected: \"No\" },\n { actual: candidate(\"?aREYA.exe\"), expected: \"No\" },\n { actual: candidate(\"/this_is_valid.dll\"), expected: \"No\" },\n { actual: candidate(\"this_is_valid.wow\"), expected: \"No\" },\n { actual: candidate(\"this_is_valid.txt\"), expected: \"Yes\" },\n { actual: candidate(\"this_is_valid.txtexe\"), expected: \"No\" },\n { actual: candidate(\"#this2_i4s_5valid.ten\"), expected: \"No\" },\n { actual: candidate(\"@this1_is6_valid.exe\"), expected: \"No\" },\n { actual: candidate(\"this_is_12valid.6exe4.txt\"), expected: \"No\" },\n { actual: candidate(\"all.exe.txt\"), expected: \"No\" },\n { actual: candidate(\"I563_No.exe\"), expected: \"Yes\" },\n { actual: candidate(\"Is3youfault.txt\"), expected: \"Yes\" },\n { actual: candidate(\"no_one#knows.dll\"), expected: \"Yes\" },\n { actual: candidate(\"1I563_Yes3.exe\"), expected: \"No\" },\n { actual: candidate(\"I563_Yes3.txtt\"), expected: \"No\" },\n { actual: candidate(\"final..txt\"), expected: \"No\" },\n { actual: candidate(\"final132\"), expected: \"No\" },\n { actual: candidate(\"_f4indsartal132.\"), expected: \"No\" },\n { actual: candidate(\".txt\"), expected: \"No\" },\n { actual: candidate(\"s.\"), expected: \"No\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "go_test.go", - "prompt": "package intersection_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given two intervals,\n// where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n// The given intervals are closed which means that the interval (start, end)\n// includes both start and end.\n// For each given interval, it is assumed that its start is less or equal its end.\n// Your task is to determine whether the length of intersection of these two \n// intervals is a prime number.\n// Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n// which its length is 1, which not a prime number.\n// If the length of the intersection is a prime number, return \"YES\",\n// otherwise, return \"NO\".\n// If the two intervals don't intersect, return \"NO\".\n// [input/output] samples:\n// >>> intersection([]interface{}{1, 2}, []interface{}{2, 3})\n// \"NO\"\n// >>> intersection([]interface{}{-1, 1}, []interface{}{0, 4})\n// \"NO\"\n// >>> intersection([]interface{}{-3, -1}, []interface{}{-5, 5})\n// \"YES\"\nfunc intersection(interval1 []interface{}, interval2 []interface{}) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "reworded", - "tests": "func TestIntersection(t *testing.T) {\n candidate := intersection\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]interface{}{1, 2}, []interface{}{2, 3}), expected: \"NO\" },\n { actual: candidate([]interface{}{-1, 1}, []interface{}{0, 4}), expected: \"NO\" },\n { actual: candidate([]interface{}{-3, -1}, []interface{}{-5, 5}), expected: \"YES\" },\n { actual: candidate([]interface{}{-2, 2}, []interface{}{-4, 0}), expected: \"YES\" },\n { actual: candidate([]interface{}{-11, 2}, []interface{}{-1, -1}), expected: \"NO\" },\n { actual: candidate([]interface{}{1, 2}, []interface{}{3, 5}), expected: \"NO\" },\n { actual: candidate([]interface{}{1, 2}, []interface{}{1, 2}), expected: \"NO\" },\n { actual: candidate([]interface{}{-2, -2}, []interface{}{-3, -2}), expected: \"NO\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "go_test.go", - "prompt": "package largest_prime_factor_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return the largest prime factor of n. Assume n > 1 and is not a prime.\n// >>> largest_prime_factor(13195)\n// 29\n// >>> largest_prime_factor(2048)\n// 2\nfunc largest_prime_factor(n int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "reworded", - "tests": "func TestLargest_Prime_Factor(t *testing.T) {\n candidate := largest_prime_factor\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(15), expected: 5 },\n { actual: candidate(27), expected: 3 },\n { actual: candidate(63), expected: 7 },\n { actual: candidate(330), expected: 11 },\n { actual: candidate(13195), expected: 29 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "go_test.go", - "prompt": "package count_distinct_characters_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a string, find out how many distinct characters (regardless of case) does it consist of\n// >>> count_distinct_characters(\"xyzXYZ\")\n// 3\n// >>> count_distinct_characters(\"Jerry\")\n// 4\nfunc count_distinct_characters(myString string) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "reworded", - "tests": "func TestCount_Distinct_Characters(t *testing.T) {\n candidate := count_distinct_characters\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: 0 },\n { actual: candidate(\"abcde\"), expected: 5 },\n { actual: candidate(\"abcdecadeCADE\"), expected: 5 },\n { actual: candidate(\"aaaaAAAAaaaa\"), expected: 1 },\n { actual: candidate(\"Jerry jERRY JeRRRY\"), expected: 5 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "go_test.go", - "prompt": "package below_zero_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You're given a list of deposit and withdrawal operations on a bank account that starts with\n// zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n// at that point function should return true. Otherwise it should return false.\n// >>> below_zero([]int{1, 2, 3})\n// false\n// >>> below_zero([]int{1, 2, -4, 5})\n// true\nfunc below_zero(operations []int) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "reworded", - "tests": "func TestBelow_Zero(t *testing.T) {\n candidate := below_zero\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}), expected: false },\n { actual: candidate([]int{1, 2, -3, 1, 2, -3}), expected: false },\n { actual: candidate([]int{1, 2, -4, 5, 6}), expected: true },\n { actual: candidate([]int{1, -1, 2, -2, 5, -5, 4, -4}), expected: false },\n { actual: candidate([]int{1, -1, 2, -2, 5, -5, 4, -5}), expected: true },\n { actual: candidate([]int{1, -2, 2, -2, 5, -5, 4, -4}), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "go_test.go", - "prompt": "package make_palindrome_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Find the shortest palindrome that begins with a supplied string.\n// Algorithm idea is simple:\n// - Find the longest postfix of supplied string that is a palindrome.\n// - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n// >>> make_palindrome(\"\")\n// \"\"\n// >>> make_palindrome(\"cat\")\n// \"catac\"\n// >>> make_palindrome(\"cata\")\n// \"catac\"\nfunc make_palindrome(myString string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "reworded", - "tests": "func TestMake_Palindrome(t *testing.T) {\n candidate := make_palindrome\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: \"\" },\n { actual: candidate(\"x\"), expected: \"x\" },\n { actual: candidate(\"xyz\"), expected: \"xyzyx\" },\n { actual: candidate(\"xyx\"), expected: \"xyx\" },\n { actual: candidate(\"jerry\"), expected: \"jerryrrej\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "go_test.go", - "prompt": "package int_to_mini_roman_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a positive integer, obtain its roman numeral equivalent as a string,\n// and return it in lowercase.\n// Restrictions: 1 <= num <= 1000\n// Examples:\n// >>> int_to_mini_roman(19)\n// \"xix\"\n// >>> int_to_mini_roman(152)\n// \"clii\"\n// >>> int_to_mini_roman(426)\n// \"cdxxvi\"\nfunc int_to_mini_roman(number int) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "reworded", - "tests": "func TestInt_To_Mini_Roman(t *testing.T) {\n candidate := int_to_mini_roman\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(19), expected: \"xix\" },\n { actual: candidate(152), expected: \"clii\" },\n { actual: candidate(251), expected: \"ccli\" },\n { actual: candidate(426), expected: \"cdxxvi\" },\n { actual: candidate(500), expected: \"d\" },\n { actual: candidate(1), expected: \"i\" },\n { actual: candidate(4), expected: \"iv\" },\n { actual: candidate(43), expected: \"xliii\" },\n { actual: candidate(90), expected: \"xc\" },\n { actual: candidate(94), expected: \"xciv\" },\n { actual: candidate(532), expected: \"dxxxii\" },\n { actual: candidate(900), expected: \"cm\" },\n { actual: candidate(994), expected: \"cmxciv\" },\n { actual: candidate(1000), expected: \"m\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - } -] \ No newline at end of file diff --git a/data/go-transform.json b/data/go-transform.json deleted file mode 100644 index a42beda12e476083661a1a9f8e6d4a7e41eb08e6..0000000000000000000000000000000000000000 --- a/data/go-transform.json +++ /dev/null @@ -1,2158 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "go_test.go", - "prompt": "package largest_divisor_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// For a given number n, find the largest number that divides n evenly, smaller than n\n// >>> largest_divisor(15)\n// 5\nfunc largest_divisor(n int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "func TestLargest_Divisor(t *testing.T) {\n candidate := largest_divisor\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3), expected: 1 },\n { actual: candidate(7), expected: 1 },\n { actual: candidate(10), expected: 5 },\n { actual: candidate(100), expected: 50 },\n { actual: candidate(49), expected: 7 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_47_median", - "language": "go_test.go", - "prompt": "package median_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return median of elements in the list l.\n// >>> median([]int{3, 1, 2, 4, 5})\n// 3\n// >>> median([]int{-10, 4, 6, 1000, 10, 20})\n// 15.0\nfunc median(l []int) float64 {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "func TestMedian(t *testing.T) {\n candidate := median\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{3, 1, 2, 4, 5}), expected: 3 },\n { actual: candidate([]int{-10, 4, 6, 1000, 10, 20}), expected: 8.0 },\n { actual: candidate([]int{5}), expected: 5 },\n { actual: candidate([]int{6, 5}), expected: 5.5 },\n { actual: candidate([]int{8, 1, 3, 9, 9, 2, 7}), expected: 7 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "go_test.go", - "prompt": "package do_algebra_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given two lists operator, and operand. The first list has basic algebra operations, and \n// the second list is a list of integers. Use the two given lists to build the algebric \n// expression and return the evaluation of this expression.\n// The basic algebra operations:\n// Addition ( + ) \n// Subtraction ( - ) \n// Multiplication ( * ) \n// Floor division ( // ) \n// Exponentiation ( ** ) \n// Example:\n// operator['+', '*', '-']\n// array = [2, 3, 4, 5]\n// result = 2 + 3 * 4 - 5\n// => result = 9\n// Note:\n// The length of operator list is equal to the length of operand list minus one.\n// Operand is a list of of non-negative integers.\n// Operator list has at least one operator, and operand list has at least two operands.\nfunc do_algebra(operator []string, operand []int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "func TestDo_Algebra(t *testing.T) {\n candidate := do_algebra\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{\"**\", \"*\", \"+\"}, []int{2, 3, 4, 5}), expected: 37 },\n { actual: candidate([]string{\"+\", \"*\", \"-\"}, []int{2, 3, 4, 5}), expected: 9 },\n { actual: candidate([]string{\"//\", \"*\"}, []int{7, 3, 4}), expected: 8 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "go_test.go", - "prompt": "package max_element_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return maximum element in the list.\n// >>> max_element([]int{1, 2, 3})\n// 3\n// >>> max_element([]int{5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10})\n// 123\nfunc max_element(l []int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "func TestMax_Element(t *testing.T) {\n candidate := max_element\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 3}), expected: 3 },\n { actual: candidate([]int{5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10}), expected: 124 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "go_test.go", - "prompt": "package can_arrange_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function which returns the largest index of an element which\n// is not greater than or equal to the element immediately preceding it. If\n// no such element exists then return -1. The given array will not contain\n// duplicate values.\n// Examples:\n// >>> can_arrange([]int{1, 2, 4, 3, 5})\n// 3\n// >>> can_arrange([]int{1, 2, 3})\n// -1\nfunc can_arrange(arr []int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "func TestCan_Arrange(t *testing.T) {\n candidate := can_arrange\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 4, 3, 5}), expected: 3 },\n { actual: candidate([]int{1, 2, 4, 5}), expected: -1 },\n { actual: candidate([]int{1, 4, 2, 5, 6, 7, 8, 9, 10}), expected: 2 },\n { actual: candidate([]int{4, 8, 5, 7, 3}), expected: 4 },\n { actual: candidate([]int{}), expected: -1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "go_test.go", - "prompt": "package car_race_collision_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Imagine a road that's a perfectly straight infinitely long line.\n// n cars are driving left to right; simultaneously, a different set of n cars\n// are driving right to left. The two sets of cars start out being very far from\n// each other. All cars move in the same speed. Two cars are said to collide\n// when a car that's moving left to right hits a car that's moving right to left.\n// However, the cars are infinitely sturdy and strong; as a result, they continue moving\n// in their trajectory as if they did not collide.\n// This function outputs the number of such collisions.\nfunc car_race_collision(n int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": "func TestCar_Race_Collision(t *testing.T) {\n candidate := car_race_collision\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(2), expected: 4 },\n { actual: candidate(3), expected: 9 },\n { actual: candidate(4), expected: 16 },\n { actual: candidate(8), expected: 64 },\n { actual: candidate(10), expected: 100 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "go_test.go", - "prompt": "package check_if_last_char_is_a_letter_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function that returns True if the last character\n// of a given string is an alphabetical character and is not\n// a part of a word, and False otherwise.\n// Note: \"word\" is a group of characters separated by space.\n// Examples:\n// >>> check_if_last_char_is_a_letter(\"apple pie\")\n// false\n// >>> check_if_last_char_is_a_letter(\"apple pi e\")\n// true\n// >>> check_if_last_char_is_a_letter(\"apple pi e \")\n// false\n// >>> check_if_last_char_is_a_letter(\"\")\n// false\nfunc check_if_last_char_is_a_letter(txt string) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "func TestCheck_If_Last_Char_Is_A_Letter(t *testing.T) {\n candidate := check_if_last_char_is_a_letter\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"apple\"), expected: false },\n { actual: candidate(\"apple pi e\"), expected: true },\n { actual: candidate(\"eeeee\"), expected: false },\n { actual: candidate(\"A\"), expected: true },\n { actual: candidate(\"Pumpkin pie \"), expected: false },\n { actual: candidate(\"Pumpkin pie 1\"), expected: false },\n { actual: candidate(\"\"), expected: false },\n { actual: candidate(\"eeeee e \"), expected: false },\n { actual: candidate(\"apple pie\"), expected: false },\n { actual: candidate(\"apple pi e \"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "go_test.go", - "prompt": "package is_prime_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return true if a given number is prime, and false otherwise.\n// >>> is_prime(6)\n// false\n// >>> is_prime(101)\n// true\n// >>> is_prime(11)\n// true\n// >>> is_prime(13441)\n// true\n// >>> is_prime(61)\n// true\n// >>> is_prime(4)\n// false\n// >>> is_prime(1)\n// false\nfunc is_prime(n int) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "func TestIs_Prime(t *testing.T) {\n candidate := is_prime\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(6), expected: false },\n { actual: candidate(101), expected: true },\n { actual: candidate(11), expected: true },\n { actual: candidate(13441), expected: true },\n { actual: candidate(61), expected: true },\n { actual: candidate(4), expected: false },\n { actual: candidate(1), expected: false },\n { actual: candidate(5), expected: true },\n { actual: candidate(11), expected: true },\n { actual: candidate(17), expected: true },\n { actual: candidate(85), expected: false },\n { actual: candidate(77), expected: false },\n { actual: candidate(255379), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "go_test.go", - "prompt": "package unique_digits_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a list of positive integers x. return a sorted list of all \n// elements that hasn't any even digit.\n// Note: Returned list should be sorted in increasing order.\n// For example:\n// >>> unique_digits([]int{15, 33, 1422, 1})\n// []int{1, 15, 33}\n// >>> unique_digits([]int{152, 323, 1422, 10})\n// []int{}\nfunc unique_digits(x []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "func TestUnique_Digits(t *testing.T) {\n candidate := unique_digits\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{15, 33, 1422, 1}), expected: []int{1, 15, 33} },\n { actual: candidate([]int{152, 323, 1422, 10}), expected: []int{} },\n { actual: candidate([]int{12345, 2033, 111, 151}), expected: []int{111, 151} },\n { actual: candidate([]int{135, 103, 31}), expected: []int{31, 135} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "go_test.go", - "prompt": "package string_xor_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Input are two strings a and b consisting only of 1s and 0s.\n// Perform binary XOR on these inputs and return result also as a string.\n// >>> string_xor(\"010\", \"110\")\n// \"100\"\nfunc string_xor(a string, b string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "func TestString_Xor(t *testing.T) {\n candidate := string_xor\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"111000\", \"101010\"), expected: \"010010\" },\n { actual: candidate(\"1\", \"1\"), expected: \"0\" },\n { actual: candidate(\"0101\", \"0000\"), expected: \"0101\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "go_test.go", - "prompt": "package sum_to_n_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// sum_to_n is a function that sums numbers from 1 to n.\n// >>> sum_to_n(30)\n// 465\n// >>> sum_to_n(100)\n// 5050\n// >>> sum_to_n(5)\n// 15\n// >>> sum_to_n(10)\n// 55\n// >>> sum_to_n(1)\n// 1\nfunc sum_to_n(n int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "func TestSum_To_N(t *testing.T) {\n candidate := sum_to_n\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(1), expected: 1 },\n { actual: candidate(6), expected: 21 },\n { actual: candidate(11), expected: 66 },\n { actual: candidate(30), expected: 465 },\n { actual: candidate(100), expected: 5050 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "go_test.go", - "prompt": "package double_the_difference_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a list of numbers, return the sum of squares of the numbers\n// in the list that are odd. Ignore numbers that are negative or not integers.\n// >>> double_the_difference([]int{1, 3, 2, 0})\n// 10\n// >>> double_the_difference([]int{-1, -2, 0})\n// 0\n// >>> double_the_difference([]int{9, -2})\n// 81\n// >>> double_the_difference([]int{0})\n// 0\n// If the input list is empty, return 0.\nfunc double_the_difference(lst []float64) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "func TestDouble_The_Difference(t *testing.T) {\n candidate := double_the_difference\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]float64{}), expected: 0 },\n { actual: candidate([]float64{5.0, 4.0}), expected: 25 },\n { actual: candidate([]float64{0.1, 0.2, 0.3}), expected: 0 },\n { actual: candidate([]float64{-10.0, -20.0, -30.0}), expected: 0 },\n { actual: candidate([]float64{-1.0, -2.0, 8.0}), expected: 0 },\n { actual: candidate([]float64{0.2, 3.0, 5.0}), expected: 34 },\n { actual: candidate([]float64{-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0}), expected: 165 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "go_test.go", - "prompt": "package strlen_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return length of given string\n// >>> strlen(\"\")\n// 0\n// >>> strlen(\"abc\")\n// 3\nfunc strlen(myString string) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "func TestStrlen(t *testing.T) {\n candidate := strlen\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: 0 },\n { actual: candidate(\"x\"), expected: 1 },\n { actual: candidate(\"asdasnakj\"), expected: 9 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "go_test.go", - "prompt": "package is_bored_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You'll be given a string of words, and your task is to count the number\n// of boredoms. A boredom is a sentence that starts with the word \"I\".\n// Sentences are delimited by '.', '?' or '!'.\n// For example:\n// >>> is_bored(\"Hello world\")\n// 0\n// >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n// 1\nfunc is_bored(S string) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "func TestIs_Bored(t *testing.T) {\n candidate := is_bored\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Hello world\"), expected: 0 },\n { actual: candidate(\"Is the sky blue?\"), expected: 0 },\n { actual: candidate(\"I love It !\"), expected: 1 },\n { actual: candidate(\"bIt\"), expected: 0 },\n { actual: candidate(\"I feel good today. I will be productive. will kill It\"), expected: 2 },\n { actual: candidate(\"You and I are going for a walk\"), expected: 0 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "go_test.go", - "prompt": "package vowels_count_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function vowels_count which takes a string representing\n// a word as input and returns the number of vowels in the string.\n// Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n// vowel, but only when it is at the end of the given word.\n// Example:\n// >>> vowels_count(\"abcde\")\n// 2\n// >>> vowels_count(\"ACEDY\")\n// 3\nfunc vowels_count(s string) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "func TestVowels_Count(t *testing.T) {\n candidate := vowels_count\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"abcde\"), expected: 2 },\n { actual: candidate(\"Alone\"), expected: 3 },\n { actual: candidate(\"key\"), expected: 2 },\n { actual: candidate(\"bye\"), expected: 1 },\n { actual: candidate(\"keY\"), expected: 2 },\n { actual: candidate(\"bYe\"), expected: 1 },\n { actual: candidate(\"ACEDY\"), expected: 3 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_55_fib", - "language": "go_test.go", - "prompt": "package fib_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return n-th Fibonacci number.\n// >>> fib(10)\n// 55\n// >>> fib(1)\n// 1\n// >>> fib(8)\n// 21\nfunc fib(n int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "func TestFib(t *testing.T) {\n candidate := fib\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(10), expected: 55 },\n { actual: candidate(1), expected: 1 },\n { actual: candidate(8), expected: 21 },\n { actual: candidate(11), expected: 89 },\n { actual: candidate(12), expected: 144 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "go_test.go", - "prompt": "package simplify_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Your task is to implement a function that will simplify the expression\n// x * n. The function returns True if x * n evaluates to a whole number and False\n// otherwise. Both x and n, are string representation of a fraction, and have the following format,\n// / where both numerator and denominator are positive whole numbers.\n// You can assume that x, and n are valid fractions, and do not have zero as denominator.\n// >>> simplify(\"1/5\", \"5/1\")\n// true\n// >>> simplify(\"1/6\", \"2/1\")\n// false\n// >>> simplify(\"7/10\", \"10/2\")\n// false\nfunc simplify(x string, n string) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "func TestSimplify(t *testing.T) {\n candidate := simplify\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"1/5\", \"5/1\"), expected: true },\n { actual: candidate(\"1/6\", \"2/1\"), expected: false },\n { actual: candidate(\"5/1\", \"3/1\"), expected: true },\n { actual: candidate(\"7/10\", \"10/2\"), expected: false },\n { actual: candidate(\"2/10\", \"50/10\"), expected: true },\n { actual: candidate(\"7/2\", \"4/2\"), expected: true },\n { actual: candidate(\"11/6\", \"6/1\"), expected: true },\n { actual: candidate(\"2/3\", \"5/2\"), expected: false },\n { actual: candidate(\"5/2\", \"3/5\"), expected: false },\n { actual: candidate(\"2/4\", \"8/4\"), expected: true },\n { actual: candidate(\"2/4\", \"4/2\"), expected: true },\n { actual: candidate(\"1/5\", \"5/1\"), expected: true },\n { actual: candidate(\"1/5\", \"1/5\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "go_test.go", - "prompt": "package count_upper_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a string s, count the number of uppercase vowels in even indices.\n// For example:\n// >>> count_upper(\"aBCdEf\")\n// 1\n// >>> count_upper(\"abcdefg\")\n// 0\n// >>> count_upper(\"dBBE\")\n// 0\nfunc count_upper(s string) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "func TestCount_Upper(t *testing.T) {\n candidate := count_upper\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"aBCdEf\"), expected: 1 },\n { actual: candidate(\"abcdefg\"), expected: 0 },\n { actual: candidate(\"dBBE\"), expected: 0 },\n { actual: candidate(\"B\"), expected: 0 },\n { actual: candidate(\"U\"), expected: 1 },\n { actual: candidate(\"\"), expected: 0 },\n { actual: candidate(\"EEEE\"), expected: 2 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "go_test.go", - "prompt": "package max_fill_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a rectangular grid of wells. Each row represents a single well,\n// and each 1 in a row represents a single unit of water.\n// Each well has a corresponding bucket that can be used to extract water from it, \n// and all buckets have the same capacity.\n// Your task is to use the buckets to empty the wells.\n// Output the number of times you need to lower the buckets.\n// Example 1:\n// >>> max_fill([][]int{[]int{0, 0, 1, 0}, []int{0, 1, 0, 0}, []int{1, 1, 1, 1}}, 1)\n// 6\n// Example 2:\n// >>> max_fill([][]int{[]int{0, 0, 1, 1}, []int{0, 0, 0, 0}, []int{1, 1, 1, 1}, []int{0, 1, 1, 1}}, 2)\n// 5\n// Example 3:\n// >>> max_fill([][]int{[]int{0, 0, 0}, []int{0, 0, 0}}, 5)\n// 0\n// Constraints:\n// * all wells have the same length\n// * 1 <= grid.length <= 10^2\n// * 1 <= grid[:,1].length <= 10^2\n// * grid[i][j] -> 0 | 1\n// * 1 <= capacity <= 10\nfunc max_fill(grid [][]int, capacity int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "func TestMax_Fill(t *testing.T) {\n candidate := max_fill\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([][]int{[]int{0, 0, 1, 0}, []int{0, 1, 0, 0}, []int{1, 1, 1, 1}}, 1), expected: 6 },\n { actual: candidate([][]int{[]int{0, 0, 1, 1}, []int{0, 0, 0, 0}, []int{1, 1, 1, 1}, []int{0, 1, 1, 1}}, 2), expected: 5 },\n { actual: candidate([][]int{[]int{0, 0, 0}, []int{0, 0, 0}}, 5), expected: 0 },\n { actual: candidate([][]int{[]int{1, 1, 1, 1}, []int{1, 1, 1, 1}}, 2), expected: 4 },\n { actual: candidate([][]int{[]int{1, 1, 1, 1}, []int{1, 1, 1, 1}}, 9), expected: 2 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "go_test.go", - "prompt": "package maximum_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given an array arr of integers and a positive integer k, return a sorted list \n// of length k with the maximum k numbers in arr.\n// Example 1:\n// >>> maximum([]int{-3, -4, 5}, 3)\n// []int{-4, -3, 5}\n// Example 2:\n// >>> maximum([]int{4, -4, 4}, 2)\n// []int{4, 4}\n// Example 3:\n// >>> maximum([]int{-3, 2, 1, 2, -1, -2, 1}, 1)\n// []int{2}\n// Note:\n// 1. The length of the array will be in the range of [1, 1000].\n// 2. The elements in the array will be in the range of [-1000, 1000].\n// 3. 0 <= k <= len(arr)\nfunc maximum(arr []int, k int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "func TestMaximum(t *testing.T) {\n candidate := maximum\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{-3, -4, 5}, 3), expected: []int{-4, -3, 5} },\n { actual: candidate([]int{4, -4, 4}, 2), expected: []int{4, 4} },\n { actual: candidate([]int{-3, 2, 1, 2, -1, -2, 1}, 1), expected: []int{2} },\n { actual: candidate([]int{123, -123, 20, 0, 1, 2, -3}, 3), expected: []int{2, 20, 123} },\n { actual: candidate([]int{-123, 20, 0, 1, 2, -3}, 4), expected: []int{0, 1, 2, 20} },\n { actual: candidate([]int{5, 15, 0, 3, -13, -8, 0}, 7), expected: []int{-13, -8, 0, 0, 3, 5, 15} },\n { actual: candidate([]int{-1, 0, 2, 5, 3, -10}, 2), expected: []int{3, 5} },\n { actual: candidate([]int{1, 0, 5, -7}, 1), expected: []int{5} },\n { actual: candidate([]int{4, -4}, 2), expected: []int{-4, 4} },\n { actual: candidate([]int{-10, 10}, 2), expected: []int{-10, 10} },\n { actual: candidate([]int{1, 2, 3, -23, 243, -400, 0}, 0), expected: []int{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_93_encode", - "language": "go_test.go", - "prompt": "package encode_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that takes a message, and encodes in such a \n// way that it swaps case of all letters, replaces all vowels in \n// the message with the letter that appears 2 places ahead of that \n// vowel in the english alphabet. \n// Assume only letters. \n// Examples:\n// >>> encode(\"test\")\n// \"TGST\"\n// >>> encode(\"This is a message\")\n// \"tHKS KS C MGSSCGG\"\nfunc encode(message string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "func TestEncode(t *testing.T) {\n candidate := encode\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"TEST\"), expected: \"tgst\" },\n { actual: candidate(\"Mudasir\"), expected: \"mWDCSKR\" },\n { actual: candidate(\"YES\"), expected: \"ygs\" },\n { actual: candidate(\"This is a message\"), expected: \"tHKS KS C MGSSCGG\" },\n { actual: candidate(\"I DoNt KnOw WhAt tO WrItE\"), expected: \"k dQnT kNqW wHcT Tq wRkTg\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "go_test.go", - "prompt": "package remove_vowels_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// remove_vowels is a function that takes string and returns string without vowels.\n// >>> remove_vowels(\"\")\n// \"\"\n// >>> remove_vowels(\"abcdef\")\n// \"bcdf\"\n// >>> remove_vowels(\"aaaaa\")\n// \"\"\n// >>> remove_vowels(\"aaBAA\")\n// \"B\"\n// >>> remove_vowels(\"zbcd\")\n// \"zbcd\"\nfunc remove_vowels(text string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "func TestRemove_Vowels(t *testing.T) {\n candidate := remove_vowels\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: \"\" },\n { actual: candidate(\"abcdef\\nghijklm\"), expected: \"bcdf\\nghjklm\" },\n { actual: candidate(\"fedcba\"), expected: \"fdcb\" },\n { actual: candidate(\"eeeee\"), expected: \"\" },\n { actual: candidate(\"acBAA\"), expected: \"cB\" },\n { actual: candidate(\"EcBOO\"), expected: \"cB\" },\n { actual: candidate(\"ybcd\"), expected: \"ybcd\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "go_test.go", - "prompt": "package get_positive_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return only positive numbers in the list.\n// >>> get_positive([]int{-1, 2, -4, 5, 6})\n// []int{2, 5, 6}\n// >>> get_positive([]int{5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10})\n// []int{5, 3, 2, 3, 9, 123, 1}\nfunc get_positive(l []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "func TestGet_Positive(t *testing.T) {\n candidate := get_positive\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{-1, -2, 4, 5, 6}), expected: []int{4, 5, 6} },\n { actual: candidate([]int{5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10}), expected: []int{5, 3, 2, 3, 3, 9, 123, 1} },\n { actual: candidate([]int{-1, -2}), expected: []int{} },\n { actual: candidate([]int{}), expected: []int{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "go_test.go", - "prompt": "package string_sequence_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n// >>> string_sequence(0)\n// \"0\"\n// >>> string_sequence(5)\n// \"0 1 2 3 4 5\"\nfunc string_sequence(n int) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "func TestString_Sequence(t *testing.T) {\n candidate := string_sequence\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(0), expected: \"0\" },\n { actual: candidate(3), expected: \"0 1 2 3\" },\n { actual: candidate(10), expected: \"0 1 2 3 4 5 6 7 8 9 10\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "go_test.go", - "prompt": "package make_a_pile_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a positive integer n, you have to make a pile of n levels of stones.\n// The first level has n stones.\n// The number of stones in the next level is:\n// - the next odd number if n is odd.\n// - the next even number if n is even.\n// Return the number of stones in each level in a list, where element at index\n// i represents the number of stones in the level (i+1).\n// Examples:\n// >>> make_a_pile(3)\n// []int{3, 5, 7}\nfunc make_a_pile(n int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "func TestMake_A_Pile(t *testing.T) {\n candidate := make_a_pile\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3), expected: []int{3, 5, 7} },\n { actual: candidate(4), expected: []int{4, 6, 8, 10} },\n { actual: candidate(5), expected: []int{5, 7, 9, 11, 13} },\n { actual: candidate(6), expected: []int{6, 8, 10, 12, 14, 16} },\n { actual: candidate(8), expected: []int{8, 10, 12, 14, 16, 18, 20, 22} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "go_test.go", - "prompt": "package reverse_delete_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Task\n// 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\n// then check if the result string is palindrome.\n// A string is called palindrome if it reads the same backward as forward.\n// You should return a tuple containing the result string and True/False for the check.\n// Example\n// >>> reverse_delete(\"abcde\", \"ae\")\n// []interface{}{\"bcd\", false}\n// >>> reverse_delete(\"abcdef\", \"b\")\n// []interface{}{\"acdef\", false}\n// >>> reverse_delete(\"abcdedcba\", \"ab\")\n// []interface{}{\"cdedc\", true}\nfunc reverse_delete(s string, c string) []interface{} {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "func TestReverse_Delete(t *testing.T) {\n candidate := reverse_delete\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"abcde\", \"ae\"), expected: []interface{}{\"bcd\", false} },\n { actual: candidate(\"abcdef\", \"b\"), expected: []interface{}{\"acdef\", false} },\n { actual: candidate(\"abcdedcba\", \"ab\"), expected: []interface{}{\"cdedc\", true} },\n { actual: candidate(\"dwik\", \"w\"), expected: []interface{}{\"dik\", false} },\n { actual: candidate(\"a\", \"a\"), expected: []interface{}{\"\", true} },\n { actual: candidate(\"abcdedcba\", \"\"), expected: []interface{}{\"abcdedcba\", true} },\n { actual: candidate(\"abcdedcba\", \"v\"), expected: []interface{}{\"abcdedcba\", true} },\n { actual: candidate(\"vabba\", \"v\"), expected: []interface{}{\"abba\", true} },\n { actual: candidate(\"mamma\", \"mia\"), expected: []interface{}{\"\", true} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "go_test.go", - "prompt": "package flip_case_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n// >>> flip_case(\"Hello\")\n// \"hELLO\"\nfunc flip_case(myString string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "func TestFlip_Case(t *testing.T) {\n candidate := flip_case\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: \"\" },\n { actual: candidate(\"Hello!\"), expected: \"hELLO!\" },\n { actual: candidate(\"These violent delights have violent ends\"), expected: \"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_161_solve", - "language": "go_test.go", - "prompt": "package solve_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a string s.\n// if s[i] is a letter, reverse its case from lower to upper or vise versa, \n// otherwise keep it as it is.\n// If the string contains no letters, reverse the string.\n// The function should return the resulted string.\n// Examples\n// >>> solve(\"1234\")\n// \"4321\"\n// >>> solve(\"ab\")\n// \"AB\"\n// >>> solve(\"#a@C\")\n// \"#A@c\"\nfunc solve(s string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "func TestSolve(t *testing.T) {\n candidate := solve\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"AsDf\"), expected: \"aSdF\" },\n { actual: candidate(\"1234\"), expected: \"4321\" },\n { actual: candidate(\"ab\"), expected: \"AB\" },\n { actual: candidate(\"#a@C\"), expected: \"#A@c\" },\n { actual: candidate(\"#AsdfW^45\"), expected: \"#aSDFw^45\" },\n { actual: candidate(\"#6@2\"), expected: \"2@6#\" },\n { actual: candidate(\"#$a^D\"), expected: \"#$A^d\" },\n { actual: candidate(\"#ccc\"), expected: \"#CCC\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "go_test.go", - "prompt": "package filter_by_prefix_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Filter an input list of strings only for ones that start with a given prefix.\n// >>> filter_by_prefix([]string{}, \"a\")\n// []string{}\n// >>> filter_by_prefix([]string{\"abc\", \"bcd\", \"cde\", \"array\"}, \"a\")\n// []string{\"abc\", \"array\"}\nfunc filter_by_prefix(strings []string, prefix string) []string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "func TestFilter_By_Prefix(t *testing.T) {\n candidate := filter_by_prefix\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{}, \"john\"), expected: []string{} },\n { actual: candidate([]string{\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"}, \"xxx\"), expected: []string{\"xxx\", \"xxxAAA\", \"xxx\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "go_test.go", - "prompt": "package choose_num_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// This function takes two positive numbers x and y and returns the\n// biggest even integer number that is in the range [x, y] inclusive. If \n// there's no such number, then the function should return -1.\n// For example:\n// >>> choose_num(12, 15)\n// 14\n// >>> choose_num(13, 12)\n// -1\nfunc choose_num(x int, y int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "func TestChoose_Num(t *testing.T) {\n candidate := choose_num\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(12, 15), expected: 14 },\n { actual: candidate(13, 12), expected: -1 },\n { actual: candidate(33, 12354), expected: 12354 },\n { actual: candidate(5234, 5233), expected: -1 },\n { actual: candidate(6, 29), expected: 28 },\n { actual: candidate(27, 10), expected: -1 },\n { actual: candidate(7, 7), expected: -1 },\n { actual: candidate(546, 546), expected: 546 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "go_test.go", - "prompt": "package words_in_sentence_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a string representing a sentence,\n// the sentence contains some words separated by a space,\n// and you have to return a string that contains the words from the original sentence,\n// whose lengths are prime numbers,\n// the order of the words in the new string should be the same as the original one.\n// Example 1:\n// >>> words_in_sentence(\"This is a test\")\n// \"is\"\n// Example 2:\n// >>> words_in_sentence(\"lets go for swimming\")\n// \"go for\"\n// Constraints:\n// * 1 <= len(sentence) <= 100\n// * sentence contains only letters\nfunc words_in_sentence(sentence string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "func TestWords_In_Sentence(t *testing.T) {\n candidate := words_in_sentence\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"This is a test\"), expected: \"is\" },\n { actual: candidate(\"lets go for swimming\"), expected: \"go for\" },\n { actual: candidate(\"there is no place available here\"), expected: \"there is no place\" },\n { actual: candidate(\"Hi I am Hussein\"), expected: \"Hi am Hussein\" },\n { actual: candidate(\"go for it\"), expected: \"go for it\" },\n { actual: candidate(\"here\"), expected: \"\" },\n { actual: candidate(\"here is\"), expected: \"is\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "go_test.go", - "prompt": "package intersperse_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n// >>> intersperse([]int{}, 4)\n// []int{}\n// >>> intersperse([]int{1, 2, 3}, 4)\n// []int{1, 4, 2, 4, 3}\nfunc intersperse(numbers []int, delimeter int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "func TestIntersperse(t *testing.T) {\n candidate := intersperse\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}, 7), expected: []int{} },\n { actual: candidate([]int{5, 6, 3, 2}, 8), expected: []int{5, 8, 6, 8, 3, 8, 2} },\n { actual: candidate([]int{2, 2, 2}, 2), expected: []int{2, 2, 2, 2, 2} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "go_test.go", - "prompt": "package is_simple_power_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Your task is to write a function that returns true if a number x is a simple\n// power of n and false in other cases.\n// x is a simple power of n if n**int=x\n// For example:\n// >>> is_simple_power(1, 4)\n// true\n// >>> is_simple_power(2, 2)\n// true\n// >>> is_simple_power(8, 2)\n// true\n// >>> is_simple_power(3, 2)\n// false\n// >>> is_simple_power(3, 1)\n// false\n// >>> is_simple_power(5, 3)\n// false\nfunc is_simple_power(x int, n int) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "func TestIs_Simple_Power(t *testing.T) {\n candidate := is_simple_power\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(16, 2), expected: true },\n { actual: candidate(143214, 16), expected: false },\n { actual: candidate(4, 2), expected: true },\n { actual: candidate(9, 3), expected: true },\n { actual: candidate(16, 4), expected: true },\n { actual: candidate(24, 2), expected: false },\n { actual: candidate(128, 4), expected: false },\n { actual: candidate(12, 6), expected: false },\n { actual: candidate(1, 1), expected: true },\n { actual: candidate(1, 12), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "go_test.go", - "prompt": "package is_multiply_prime_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that returns true if the given number is the multiplication of 3 prime numbers\n// and false otherwise.\n// Knowing that (a) is less then 100. \n// Example:\n// >>> is_multiply_prime(30)\n// true\n// 30 = 2 * 3 * 5\nfunc is_multiply_prime(a int) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "func TestIs_Multiply_Prime(t *testing.T) {\n candidate := is_multiply_prime\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5), expected: false },\n { actual: candidate(30), expected: true },\n { actual: candidate(8), expected: true },\n { actual: candidate(10), expected: false },\n { actual: candidate(125), expected: true },\n { actual: candidate(105), expected: true },\n { actual: candidate(126), expected: false },\n { actual: candidate(729), expected: false },\n { actual: candidate(891), expected: false },\n { actual: candidate(1001), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "go_test.go", - "prompt": "package right_angle_triangle_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given the lengths of the three sides of a triangle. Return True if the three\n// sides form a right-angled triangle, False otherwise.\n// A right-angled triangle is a triangle in which one angle is right angle or \n// 90 degree.\n// Example:\n// >>> right_angle_triangle(3, 4, 5)\n// true\n// >>> right_angle_triangle(1, 2, 3)\n// false\nfunc right_angle_triangle(a int, b int, c int) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "func TestRight_Angle_Triangle(t *testing.T) {\n candidate := right_angle_triangle\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3, 4, 5), expected: true },\n { actual: candidate(1, 2, 3), expected: false },\n { actual: candidate(10, 6, 8), expected: true },\n { actual: candidate(2, 2, 2), expected: false },\n { actual: candidate(7, 24, 25), expected: true },\n { actual: candidate(10, 5, 7), expected: false },\n { actual: candidate(5, 12, 13), expected: true },\n { actual: candidate(15, 8, 17), expected: true },\n { actual: candidate(48, 55, 73), expected: true },\n { actual: candidate(1, 1, 1), expected: false },\n { actual: candidate(2, 2, 10), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "go_test.go", - "prompt": "package any_int_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function that takes 3 numbers.\n// Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n// Returns false in any other cases.\n// Examples\n// >>> any_int(5, 2, 7)\n// true\n// >>> any_int(3, 2, 2)\n// false\n// >>> any_int(3, -2, 1)\n// true\n// >>> any_int(3.6, -2.2, 2)\n// false\nfunc any_int(x float64, y float64, z float64) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "func TestAny_Int(t *testing.T) {\n candidate := any_int\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(2, 3, 1), expected: true },\n { actual: candidate(2.5, 2, 3), expected: false },\n { actual: candidate(1.5, 5, 3.5), expected: false },\n { actual: candidate(2, 6, 2), expected: false },\n { actual: candidate(4, 2, 2), expected: true },\n { actual: candidate(2.2, 2.2, 2.2), expected: false },\n { actual: candidate(-4, 6, 2), expected: true },\n { actual: candidate(2, 1, 1), expected: true },\n { actual: candidate(3, 4, 7), expected: true },\n { actual: candidate(3.0, 4, 7), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "go_test.go", - "prompt": "package sort_third_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// This function takes a list l and returns a list l' such that\n// l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n// to the values of the corresponding indicies of l, but sorted.\n// >>> sort_third([]int{1, 2, 3})\n// []int{1, 2, 3}\n// >>> sort_third([]int{5, 6, 3, 4, 8, 9, 2})\n// []int{2, 6, 3, 4, 8, 9, 5}\nfunc sort_third(l []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "func TestSort_Third(t *testing.T) {\n candidate := sort_third\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{5, 6, 3, 4, 8, 9, 2}), expected: []int{2, 6, 3, 4, 8, 9, 5} },\n { actual: candidate([]int{5, 8, 3, 4, 6, 9, 2}), expected: []int{2, 8, 3, 4, 6, 9, 5} },\n { actual: candidate([]int{5, 6, 9, 4, 8, 3, 2}), expected: []int{2, 6, 9, 4, 8, 3, 5} },\n { actual: candidate([]int{5, 6, 3, 4, 8, 9, 2, 1}), expected: []int{2, 6, 3, 4, 8, 9, 5, 1} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_53_add", - "language": "go_test.go", - "prompt": "package add_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Add two numbers x and y\n// >>> add(2, 3)\n// 5\n// >>> add(5, 7)\n// 12\nfunc add(x int, y int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "func TestAdd(t *testing.T) {\n candidate := add\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(0, 1), expected: 1 },\n { actual: candidate(1, 0), expected: 1 },\n { actual: candidate(2, 3), expected: 5 },\n { actual: candidate(5, 7), expected: 12 },\n { actual: candidate(7, 5), expected: 12 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_69_search", - "language": "go_test.go", - "prompt": "package search_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n// zero, and has a frequency greater than or equal to the value of the integer itself. \n// The frequency of an integer is the number of times it appears in the list.\n// If no such a value exist, return -1.\n// Examples:\n// >>> search([]int{4, 1, 2, 2, 3, 1})\n// 2\n// >>> search([]int{1, 2, 2, 3, 3, 3, 4, 4, 4})\n// 3\n// >>> search([]int{5, 5, 4, 4, 4})\n// -1\nfunc search(lst []int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "func TestSearch(t *testing.T) {\n candidate := search\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{5, 5, 5, 5, 1}), expected: 1 },\n { actual: candidate([]int{4, 1, 4, 1, 4, 4}), expected: 4 },\n { actual: candidate([]int{3, 3}), expected: -1 },\n { actual: candidate([]int{8, 8, 8, 8, 8, 8, 8, 8}), expected: 8 },\n { actual: candidate([]int{2, 3, 3, 2, 2}), expected: 2 },\n { actual: candidate([]int{2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1}), expected: 1 },\n { actual: candidate([]int{3, 2, 8, 2}), expected: 2 },\n { actual: candidate([]int{6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10}), expected: 1 },\n { actual: candidate([]int{8, 8, 3, 6, 5, 6, 4}), expected: -1 },\n { actual: candidate([]int{6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9}), expected: 1 },\n { actual: candidate([]int{1, 9, 10, 1, 3}), expected: 1 },\n { actual: candidate([]int{6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10}), expected: 5 },\n { actual: candidate([]int{1}), expected: 1 },\n { actual: candidate([]int{8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5}), expected: 4 },\n { actual: candidate([]int{2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10}), expected: 2 },\n { actual: candidate([]int{1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3}), expected: 1 },\n { actual: candidate([]int{9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4}), expected: 4 },\n { actual: candidate([]int{2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7}), expected: 4 },\n { actual: candidate([]int{9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1}), expected: 2 },\n { actual: candidate([]int{5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8}), expected: -1 },\n { actual: candidate([]int{10}), expected: -1 },\n { actual: candidate([]int{9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2}), expected: 2 },\n { actual: candidate([]int{5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8}), expected: 1 },\n { actual: candidate([]int{7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6}), expected: 1 },\n { actual: candidate([]int{3, 10, 10, 9, 2}), expected: -1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "go_test.go", - "prompt": "package prime_length_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that takes a string and returns True if the string\n// length is a prime number or False otherwise\n// Examples\n// >>> prime_length(\"Hello\")\n// true\n// >>> prime_length(\"abcdcba\")\n// true\n// >>> prime_length(\"kittens\")\n// true\n// >>> prime_length(\"orange\")\n// false\nfunc prime_length(myString string) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "func TestPrime_Length(t *testing.T) {\n candidate := prime_length\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Hello\"), expected: true },\n { actual: candidate(\"abcdcba\"), expected: true },\n { actual: candidate(\"kittens\"), expected: true },\n { actual: candidate(\"orange\"), expected: false },\n { actual: candidate(\"wow\"), expected: true },\n { actual: candidate(\"world\"), expected: true },\n { actual: candidate(\"MadaM\"), expected: true },\n { actual: candidate(\"Wow\"), expected: true },\n { actual: candidate(\"\"), expected: false },\n { actual: candidate(\"HI\"), expected: true },\n { actual: candidate(\"go\"), expected: true },\n { actual: candidate(\"gogo\"), expected: false },\n { actual: candidate(\"aaaaaaaaaaaaaaa\"), expected: false },\n { actual: candidate(\"Madam\"), expected: true },\n { actual: candidate(\"M\"), expected: false },\n { actual: candidate(\"0\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_58_common", - "language": "go_test.go", - "prompt": "package common_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return sorted unique common elements for two lists.\n// >>> common([]int{1, 4, 3, 34, 653, 2, 5}, []int{5, 7, 1, 5, 9, 653, 121})\n// []int{1, 5, 653}\n// >>> common([]int{5, 3, 2, 8}, []int{3, 2})\n// []int{2, 3}\nfunc common(l1 []int, l2 []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "func TestCommon(t *testing.T) {\n candidate := common\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 4, 3, 34, 653, 2, 5}, []int{5, 7, 1, 5, 9, 653, 121}), expected: []int{1, 5, 653} },\n { actual: candidate([]int{5, 3, 2, 8}, []int{3, 2}), expected: []int{2, 3} },\n { actual: candidate([]int{4, 3, 2, 8}, []int{3, 2, 4}), expected: []int{2, 3, 4} },\n { actual: candidate([]int{4, 3, 2, 8}, []int{}), expected: []int{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "go_test.go", - "prompt": "package special_factorial_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// The Brazilian factorial is defined as:\n// brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n// where n > 0\n// For example:\n// >>> special_factorial(4)\n// 288\n// The function will receive an integer as input and should return the special\n// factorial of this integer.\nfunc special_factorial(n int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "func TestSpecial_Factorial(t *testing.T) {\n candidate := special_factorial\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(4), expected: 288 },\n { actual: candidate(5), expected: 34560 },\n { actual: candidate(7), expected: 125411328000 },\n { actual: candidate(1), expected: 1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "go_test.go", - "prompt": "package exchange_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// In this problem, you will implement a function that takes two lists of numbers,\n// and determines whether it is possible to perform an exchange of elements\n// between them to make lst1 a list of only even numbers.\n// There is no limit on the number of exchanged elements between lst1 and lst2.\n// If it is possible to exchange elements between the lst1 and lst2 to make\n// all the elements of lst1 to be even, return \"YES\".\n// Otherwise, return \"NO\".\n// For example:\n// >>> exchange([]int{1, 2, 3, 4}, []int{1, 2, 3, 4})\n// \"YES\"\n// >>> exchange([]int{1, 2, 3, 4}, []int{1, 5, 3, 4})\n// \"NO\"\n// It is assumed that the input lists will be non-empty.\nfunc exchange(lst1 []int, lst2 []int) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "func TestExchange(t *testing.T) {\n candidate := exchange\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 3, 4}, []int{1, 2, 3, 4}), expected: \"YES\" },\n { actual: candidate([]int{1, 2, 3, 4}, []int{1, 5, 3, 4}), expected: \"NO\" },\n { actual: candidate([]int{1, 2, 3, 4}, []int{2, 1, 4, 3}), expected: \"YES\" },\n { actual: candidate([]int{5, 7, 3}, []int{2, 6, 4}), expected: \"YES\" },\n { actual: candidate([]int{5, 7, 3}, []int{2, 6, 3}), expected: \"NO\" },\n { actual: candidate([]int{3, 2, 6, 1, 8, 9}, []int{3, 5, 5, 1, 1, 1}), expected: \"NO\" },\n { actual: candidate([]int{100, 200}, []int{200, 200}), expected: \"YES\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "go_test.go", - "prompt": "package add_elements_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a non-empty array of integers arr and an integer k, return\n// the sum of the elements with at most two digits from the first k elements of arr.\n// Example:\n// >>> add_elements([]int{111, 21, 3, 4000, 5, 6, 7, 8, 9}, 4)\n// 24\n// Constraints:\n// 1. 1 <= len(arr) <= 100\n// 2. 1 <= k <= len(arr)\nfunc add_elements(arr []int, k int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "func TestAdd_Elements(t *testing.T) {\n candidate := add_elements\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, -2, -3, 41, 57, 76, 87, 88, 99}, 3), expected: -4 },\n { actual: candidate([]int{111, 121, 3, 4000, 5, 6}, 2), expected: 0 },\n { actual: candidate([]int{11, 21, 3, 90, 5, 6, 7, 8, 9}, 4), expected: 125 },\n { actual: candidate([]int{111, 21, 3, 4000, 5, 6, 7, 8, 9}, 4), expected: 24 },\n { actual: candidate([]int{1}, 1), expected: 1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "go_test.go", - "prompt": "package x_or_y_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// A simple program which should return the value of x if n is \n// a prime number and should return the value of y otherwise.\n// Examples:\n// >>> x_or_y(7, 34, 12)\n// 34\n// >>> x_or_y(15, 8, 5)\n// 5\nfunc x_or_y(n int, x int, y int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "func TestX_Or_Y(t *testing.T) {\n candidate := x_or_y\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(7, 34, 12), expected: 34 },\n { actual: candidate(15, 8, 5), expected: 5 },\n { actual: candidate(3, 33, 5212), expected: 33 },\n { actual: candidate(1259, 3, 52), expected: 3 },\n { actual: candidate(7919, -1, 12), expected: -1 },\n { actual: candidate(3609, 1245, 583), expected: 583 },\n { actual: candidate(91, 56, 129), expected: 129 },\n { actual: candidate(6, 34, 1234), expected: 1234 },\n { actual: candidate(1, 2, 0), expected: 0 },\n { actual: candidate(2, 2, 0), expected: 2 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "go_test.go", - "prompt": "package triangle_area_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given length of a side and high return area for a triangle.\n// >>> triangle_area(5, 3)\n// 7.5\nfunc triangle_area(a int, h int) float64 {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "func TestTriangle_Area(t *testing.T) {\n candidate := triangle_area\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5, 3), expected: 7.5 },\n { actual: candidate(2, 2), expected: 2.0 },\n { actual: candidate(10, 8), expected: 40.0 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_130_tri", - "language": "go_test.go", - "prompt": "package tri_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n// the last couple centuries. However, what people don't know is Tribonacci sequence.\n// Tribonacci sequence is defined by the recurrence:\n// tri(1) = 3\n// tri(n) = 1 + n / 2, if n is even.\n// tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n// For example:\n// tri(2) = 1 + (2 / 2) = 2\n// tri(4) = 3\n// tri(3) = tri(2) + tri(1) + tri(4)\n// = 2 + 3 + 3 = 8 \n// You are given a non-negative integer number n, you have to a return a list of the \n// first n + 1 numbers of the Tribonacci sequence.\n// Examples:\n// >>> tri(3)\n// []int{1, 3, 2, 8}\nfunc tri(n int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "func TestTri(t *testing.T) {\n candidate := tri\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3), expected: []int{1, 3, 2, 8} },\n { actual: candidate(4), expected: []int{1, 3, 2, 8, 3} },\n { actual: candidate(5), expected: []int{1, 3, 2, 8, 3, 15} },\n { actual: candidate(6), expected: []int{1, 3, 2, 8, 3, 15, 4} },\n { actual: candidate(7), expected: []int{1, 3, 2, 8, 3, 15, 4, 24} },\n { actual: candidate(8), expected: []int{1, 3, 2, 8, 3, 15, 4, 24, 5} },\n { actual: candidate(9), expected: []int{1, 3, 2, 8, 3, 15, 4, 24, 5, 35} },\n { actual: candidate(20), expected: []int{1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11} },\n { actual: candidate(0), expected: []int{1} },\n { actual: candidate(1), expected: []int{1, 3} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "go_test.go", - "prompt": "package match_parens_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a list of two strings, both strings consist of open\n// parentheses '(' or close parentheses ')' only.\n// Your job is to check if it is possible to concatenate the two strings in\n// some order, that the resulting string will be good.\n// A string S is considered to be good if and only if all parentheses in S\n// are balanced. For example: the string '(())()' is good, while the string\n// '())' is not.\n// Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n// Examples:\n// >>> match_parens([]string{\"()(\", \")\"})\n// \"Yes\"\n// >>> match_parens([]string{\")\", \")\"})\n// \"No\"\nfunc match_parens(lst []string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "func TestMatch_Parens(t *testing.T) {\n candidate := match_parens\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{\"()(\", \")\"}), expected: \"Yes\" },\n { actual: candidate([]string{\")\", \")\"}), expected: \"No\" },\n { actual: candidate([]string{\"(()(())\", \"())())\"}), expected: \"No\" },\n { actual: candidate([]string{\")())\", \"(()()(\"}), expected: \"Yes\" },\n { actual: candidate([]string{\"(())))\", \"(()())((\"}), expected: \"Yes\" },\n { actual: candidate([]string{\"()\", \"())\"}), expected: \"No\" },\n { actual: candidate([]string{\"(()(\", \"()))()\"}), expected: \"Yes\" },\n { actual: candidate([]string{\"((((\", \"((())\"}), expected: \"No\" },\n { actual: candidate([]string{\")(()\", \"(()(\"}), expected: \"No\" },\n { actual: candidate([]string{\")(\", \")(\"}), expected: \"No\" },\n { actual: candidate([]string{\"(\", \")\"}), expected: \"Yes\" },\n { actual: candidate([]string{\")\", \"(\"}), expected: \"Yes\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "go_test.go", - "prompt": "package remove_duplicates_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// From a list of integers, remove all elements that occur more than once.\n// Keep order of elements left the same as in the input.\n// >>> remove_duplicates([]int{1, 2, 3, 2, 4})\n// []int{1, 3, 4}\nfunc remove_duplicates(numbers []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "func TestRemove_Duplicates(t *testing.T) {\n candidate := remove_duplicates\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{1, 2, 3, 4}), expected: []int{1, 2, 3, 4} },\n { actual: candidate([]int{1, 2, 3, 2, 4, 3, 5}), expected: []int{1, 4, 5} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "go_test.go", - "prompt": "package greatest_common_divisor_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return a greatest common divisor of two integers a and b\n// >>> greatest_common_divisor(3, 5)\n// 1\n// >>> greatest_common_divisor(25, 15)\n// 5\nfunc greatest_common_divisor(a int, b int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "func TestGreatest_Common_Divisor(t *testing.T) {\n candidate := greatest_common_divisor\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3, 7), expected: 1 },\n { actual: candidate(10, 15), expected: 5 },\n { actual: candidate(49, 14), expected: 7 },\n { actual: candidate(144, 60), expected: 12 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "go_test.go", - "prompt": "package is_palindrome_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Checks if given string is a palindrome\n// >>> is_palindrome(\"\")\n// true\n// >>> is_palindrome(\"aba\")\n// true\n// >>> is_palindrome(\"aaaaa\")\n// true\n// >>> is_palindrome(\"zbcd\")\n// false\nfunc is_palindrome(text string) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "func TestIs_Palindrome(t *testing.T) {\n candidate := is_palindrome\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: true },\n { actual: candidate(\"aba\"), expected: true },\n { actual: candidate(\"aaaaa\"), expected: true },\n { actual: candidate(\"zbcd\"), expected: false },\n { actual: candidate(\"xywyx\"), expected: true },\n { actual: candidate(\"xywyz\"), expected: false },\n { actual: candidate(\"xywzx\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "go_test.go", - "prompt": "package derivative_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// xs represent coefficients of a polynomial.\n// xs[0] + xs[1] * x + xs[2] * x^2 + ....\n// Return derivative of this polynomial in the same form.\n// >>> derivative([]int{3, 1, 2, 4, 5})\n// []int{1, 4, 12, 20}\n// >>> derivative([]int{1, 2, 3})\n// []int{2, 6}\nfunc derivative(xs []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "func TestDerivative(t *testing.T) {\n candidate := derivative\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{3, 1, 2, 4, 5}), expected: []int{1, 4, 12, 20} },\n { actual: candidate([]int{1, 2, 3}), expected: []int{2, 6} },\n { actual: candidate([]int{3, 2, 1}), expected: []int{2, 2} },\n { actual: candidate([]int{3, 2, 1, 0, 4}), expected: []int{2, 2, 0, 16} },\n { actual: candidate([]int{1}), expected: []int{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "go_test.go", - "prompt": "package fruit_distribution_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// In this task, you will be given a string that represents a number of apples and oranges \n// that are distributed in a basket of fruit this basket contains \n// apples, oranges, and mango fruits. Given the string that represents the total number of \n// the oranges and apples and an integer that represent the total number of the fruits \n// in the basket return the number of the mango fruits in the basket.\n// for examble:\n// >>> fruit_distribution(\"5 apples and 6 oranges\", 19)\n// 8\n// >>> fruit_distribution(\"0 apples and 1 oranges\", 3)\n// 2\n// >>> fruit_distribution(\"2 apples and 3 oranges\", 100)\n// 95\n// >>> fruit_distribution(\"100 apples and 1 oranges\", 120)\n// 19\nfunc fruit_distribution(s string, n int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "func TestFruit_Distribution(t *testing.T) {\n candidate := fruit_distribution\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"5 apples and 6 oranges\", 19), expected: 8 },\n { actual: candidate(\"5 apples and 6 oranges\", 21), expected: 10 },\n { actual: candidate(\"0 apples and 1 oranges\", 3), expected: 2 },\n { actual: candidate(\"1 apples and 0 oranges\", 3), expected: 2 },\n { actual: candidate(\"2 apples and 3 oranges\", 100), expected: 95 },\n { actual: candidate(\"2 apples and 3 oranges\", 5), expected: 0 },\n { actual: candidate(\"1 apples and 100 oranges\", 120), expected: 19 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "go_test.go", - "prompt": "package iscube_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that takes an integer a and returns True \n// if this ingeger is a cube of some integer number.\n// Note: you may assume the input is always valid.\n// Examples:\n// >>> iscube(1)\n// true\n// >>> iscube(2)\n// false\n// >>> iscube(-1)\n// true\n// >>> iscube(64)\n// true\n// >>> iscube(0)\n// true\n// >>> iscube(180)\n// false\nfunc iscube(a int) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "func TestIscube(t *testing.T) {\n candidate := iscube\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(1), expected: true },\n { actual: candidate(2), expected: false },\n { actual: candidate(-1), expected: true },\n { actual: candidate(64), expected: true },\n { actual: candidate(180), expected: false },\n { actual: candidate(1000), expected: true },\n { actual: candidate(0), expected: true },\n { actual: candidate(1729), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "go_test.go", - "prompt": "package sort_array_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// In this Kata, you have to sort an array of non-negative integers according to\n// number of ones in their binary representation in ascending order.\n// For similar number of ones, sort based on decimal value.\n// It must be implemented like this:\n// >>> sort_array([]int{1, 5, 2, 3, 4})\n// []int{1, 2, 3, 4, 5}\n// >>> sort_array([]int{-2, -3, -4, -5, -6})\n// []int{-6, -5, -4, -3, -2}\n// >>> sort_array([]int{1, 0, 2, 3, 4})\n// []int{0, 1, 2, 3, 4}\nfunc sort_array(arr []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "func TestSort_Array(t *testing.T) {\n candidate := sort_array\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 5, 2, 3, 4}), expected: []int{1, 2, 4, 3, 5} },\n { actual: candidate([]int{-2, -3, -4, -5, -6}), expected: []int{-4, -2, -6, -5, -3} },\n { actual: candidate([]int{1, 0, 2, 3, 4}), expected: []int{0, 1, 2, 4, 3} },\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4}), expected: []int{2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77} },\n { actual: candidate([]int{3, 6, 44, 12, 32, 5}), expected: []int{32, 3, 5, 6, 12, 44} },\n { actual: candidate([]int{2, 4, 8, 16, 32}), expected: []int{2, 4, 8, 16, 32} },\n { actual: candidate([]int{2, 4, 8, 16, 32}), expected: []int{2, 4, 8, 16, 32} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "go_test.go", - "prompt": "package odd_count_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a list of strings, where each string consists of only digits, return a list.\n// Each element i of the output should be \"the number of odd elements in the\n// string i of the input.\" where all the i's should be replaced by the number\n// of odd digits in the i'th string of the input.\n// >>> odd_count([]string{\"1234567\"})\n// []string{\"the number of odd elements 4n the str4ng 4 of the 4nput.\"}\n// >>> odd_count([]string{\"3\", \"11111111\"})\n// []string{\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\"}\nfunc odd_count(lst []string) []string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "func TestOdd_Count(t *testing.T) {\n candidate := odd_count\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{\"1234567\"}), expected: []string{\"the number of odd elements 4n the str4ng 4 of the 4nput.\"} },\n { actual: candidate([]string{\"3\", \"11111111\"}), expected: []string{\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\"} },\n { actual: candidate([]string{\"271\", \"137\", \"314\"}), expected: []string{\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "go_test.go", - "prompt": "package correct_bracketing_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// brackets is a string of \"(\" and \")\".\n// return True if every opening bracket has a corresponding closing bracket.\n// >>> correct_bracketing(\"(\")\n// false\n// >>> correct_bracketing(\"()\")\n// true\n// >>> correct_bracketing(\"(()())\")\n// true\n// >>> correct_bracketing(\")(()\")\n// false\nfunc correct_bracketing(brackets string) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "func TestCorrect_Bracketing(t *testing.T) {\n candidate := correct_bracketing\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"()\"), expected: true },\n { actual: candidate(\"(()())\"), expected: true },\n { actual: candidate(\"()()(()())()\"), expected: true },\n { actual: candidate(\"()()((()()())())(()()(()))\"), expected: true },\n { actual: candidate(\"((()())))\"), expected: false },\n { actual: candidate(\")(()\"), expected: false },\n { actual: candidate(\"(\"), expected: false },\n { actual: candidate(\"((((\"), expected: false },\n { actual: candidate(\")\"), expected: false },\n { actual: candidate(\"(()\"), expected: false },\n { actual: candidate(\"()()(()())())(()\"), expected: false },\n { actual: candidate(\"()()(()())()))()\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "go_test.go", - "prompt": "package digitSum_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Task\n// Write a function that takes a string as input and returns the sum of the upper characters only'\n// ASCII codes.\n// Examples:\n// >>> digitSum(\"\")\n// 0\n// >>> digitSum(\"abAB\")\n// 131\n// >>> digitSum(\"abcCd\")\n// 67\n// >>> digitSum(\"helloE\")\n// 69\n// >>> digitSum(\"woArBld\")\n// 131\n// >>> digitSum(\"aAaaaXa\")\n// 153\nfunc digitSum(s string) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "func TestDigitsum(t *testing.T) {\n candidate := digitSum\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: 0 },\n { actual: candidate(\"abAB\"), expected: 131 },\n { actual: candidate(\"abcCd\"), expected: 67 },\n { actual: candidate(\"helloE\"), expected: 69 },\n { actual: candidate(\"woArBld\"), expected: 131 },\n { actual: candidate(\"aAaaaXa\"), expected: 153 },\n { actual: candidate(\" How are yOu?\"), expected: 151 },\n { actual: candidate(\"You arE Very Smart\"), expected: 327 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "go_test.go", - "prompt": "package sorted_list_sum_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that accepts a list of strings as a parameter,\n// deletes the strings that have odd lengths from it,\n// and returns the resulted list with a sorted order,\n// The list is always a list of strings and never an array of numbers,\n// and it may contain duplicates.\n// The order of the list should be ascending by length of each word, and you\n// should return the list sorted by that rule.\n// If two words have the same length, sort the list alphabetically.\n// The function should return a list of strings in sorted order.\n// You may assume that all words will have the same length.\n// For example:\n// >>> list_sort([]string{\"aa\", \"a\", \"aaa\"})\n// []string{\"aa\"}\n// >>> list_sort([]string{\"ab\", \"a\", \"aaa\", \"cd\"})\n// []string{\"ab\", \"cd\"}\nfunc sorted_list_sum(lst []string) []string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "func TestSorted_List_Sum(t *testing.T) {\n candidate := sorted_list_sum\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{\"aa\", \"a\", \"aaa\"}), expected: []string{\"aa\"} },\n { actual: candidate([]string{\"school\", \"AI\", \"asdf\", \"b\"}), expected: []string{\"AI\", \"asdf\", \"school\"} },\n { actual: candidate([]string{\"d\", \"b\", \"c\", \"a\"}), expected: []string{} },\n { actual: candidate([]string{\"d\", \"dcba\", \"abcd\", \"a\"}), expected: []string{\"abcd\", \"dcba\"} },\n { actual: candidate([]string{\"AI\", \"ai\", \"au\"}), expected: []string{\"AI\", \"ai\", \"au\"} },\n { actual: candidate([]string{\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"}), expected: []string{} },\n { actual: candidate([]string{\"aaaa\", \"bbbb\", \"dd\", \"cc\"}), expected: []string{\"cc\", \"dd\", \"aaaa\", \"bbbb\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "go_test.go", - "prompt": "package incr_list_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return list with elements incremented by 1.\n// >>> incr_list([]int{1, 2, 3})\n// []int{2, 3, 4}\n// >>> incr_list([]int{5, 3, 5, 2, 3, 3, 9, 0, 123})\n// []int{6, 4, 6, 3, 4, 4, 10, 1, 124}\nfunc incr_list(l []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "func TestIncr_List(t *testing.T) {\n candidate := incr_list\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{3, 2, 1}), expected: []int{4, 3, 2} },\n { actual: candidate([]int{5, 2, 5, 2, 3, 3, 9, 0, 123}), expected: []int{6, 3, 6, 3, 4, 4, 10, 1, 124} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "go_test.go", - "prompt": "package rolling_max_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// From a given list of integers, generate a list of rolling maximum element found until given moment\n// in the sequence.\n// >>> rolling_max([]int{1, 2, 3, 2, 3, 4, 2})\n// []int{1, 2, 3, 3, 3, 4, 4}\nfunc rolling_max(numbers []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "func TestRolling_Max(t *testing.T) {\n candidate := rolling_max\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{1, 2, 3, 4}), expected: []int{1, 2, 3, 4} },\n { actual: candidate([]int{4, 3, 2, 1}), expected: []int{4, 4, 4, 4} },\n { actual: candidate([]int{3, 2, 3, 100, 3}), expected: []int{3, 3, 3, 100, 100} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "go_test.go", - "prompt": "package separate_paren_groups_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n// separate those group into separate strings and return the list of those.\n// Separate groups are balanced (each open brace is properly closed) and not nested within each other\n// Ignore any spaces in the input string.\n// >>> separate_paren_groups(\"( ) (( )) (( )( ))\")\n// []string{\"()\", \"(())\", \"(()())\"}\nfunc separate_paren_groups(paren_string string) []string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "func TestSeparate_Paren_Groups(t *testing.T) {\n candidate := separate_paren_groups\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"(()()) ((())) () ((())()())\"), expected: []string{\"(()())\", \"((()))\", \"()\", \"((())()())\"} },\n { actual: candidate(\"() (()) ((())) (((())))\"), expected: []string{\"()\", \"(())\", \"((()))\", \"(((())))\"} },\n { actual: candidate(\"(()(())((())))\"), expected: []string{\"(()(())((())))\"} },\n { actual: candidate(\"( ) (( )) (( )( ))\"), expected: []string{\"()\", \"(())\", \"(()())\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "go_test.go", - "prompt": "package words_string_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You will be given a string of words separated by commas or spaces. Your task is\n// to split the string into words and return an array of the words.\n// For example:\n// >>> words_string(\"Hi, my name is John\")\n// []string{\"Hi\", \"my\", \"name\", \"is\", \"John\"}\n// >>> words_string(\"One, two, three, four, five, six\")\n// []string{\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"}\nfunc words_string(s string) []string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "func TestWords_String(t *testing.T) {\n candidate := words_string\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Hi, my name is John\"), expected: []string{\"Hi\", \"my\", \"name\", \"is\", \"John\"} },\n { actual: candidate(\"One, two, three, four, five, six\"), expected: []string{\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"} },\n { actual: candidate(\"Hi, my name\"), expected: []string{\"Hi\", \"my\", \"name\"} },\n { actual: candidate(\"One,, two, three, four, five, six,\"), expected: []string{\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"} },\n { actual: candidate(\"\"), expected: []string{} },\n { actual: candidate(\"ahmed , gamal\"), expected: []string{\"ahmed\", \"gamal\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "go_test.go", - "prompt": "package filter_integers_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Filter given list of any python values only for integers\n// >>> filter_integers([]float64{\"a\", 3.14, 5})\n// []int{5}\n// >>> filter_integers([]interface{}{1, 2, 3, \"abc\", map[interface{}]interface{}{}, []interface{}{}})\n// []int{1, 2, 3}\nfunc filter_integers(values []interface{}) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "func TestFilter_Integers(t *testing.T) {\n candidate := filter_integers\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]interface{}{}), expected: []int{} },\n { actual: candidate([]interface{}{4, map[interface{}]interface{}{}, []interface{}{}, 23.2, 9, \"adasd\"}), expected: []int{4, 9} },\n { actual: candidate([]interface{}{3, \"c\", 3, 3, \"a\", \"b\"}), expected: []int{3, 3, 3} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "go_test.go", - "prompt": "package sort_even_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// This function takes a list l and returns a list l' such that\n// l' is identical to l in the odd indicies, while its values at the even indicies are equal\n// to the values of the even indicies of l, but sorted.\n// >>> sort_even([]int{1, 2, 3})\n// []int{1, 2, 3}\n// >>> sort_even([]int{5, 6, 3, 4})\n// []int{3, 6, 5, 4}\nfunc sort_even(l []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "func TestSort_Even(t *testing.T) {\n candidate := sort_even\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 3}), expected: []int{1, 2, 3} },\n { actual: candidate([]int{5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10}), expected: []int{-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123} },\n { actual: candidate([]int{5, 8, -12, 4, 23, 2, 3, 11, 12, -10}), expected: []int{-12, 8, 3, 4, 5, 2, 12, 11, 23, -10} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_152_compare", - "language": "go_test.go", - "prompt": "package compare_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// I think we all remember that feeling when the result of some long-awaited\n// event is finally known. The feelings and thoughts you have at that moment are\n// definitely worth noting down and comparing.\n// Your task is to determine if a person correctly guessed the results of a number of matches.\n// You are given two arrays of scores and guesses of equal length, where each index shows a match. \n// Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n// the value is 0, and if not, the value is the absolute difference between the guess and the score.\n// example:\n// >>> compare([]int{1, 2, 3, 4, 5, 1}, []int{1, 2, 3, 4, 2, -2})\n// []int{0, 0, 0, 0, 3, 3}\n// >>> compare([]int{0, 5, 0, 0, 0, 4}, []int{4, 1, 1, 0, 0, -2})\n// []int{4, 4, 1, 0, 0, 6}\nfunc compare(game []int, guess []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "func TestCompare(t *testing.T) {\n candidate := compare\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 3, 4, 5, 1}, []int{1, 2, 3, 4, 2, -2}), expected: []int{0, 0, 0, 0, 3, 3} },\n { actual: candidate([]int{0, 0, 0, 0, 0, 0}, []int{0, 0, 0, 0, 0, 0}), expected: []int{0, 0, 0, 0, 0, 0} },\n { actual: candidate([]int{1, 2, 3}, []int{-1, -2, -3}), expected: []int{2, 4, 6} },\n { actual: candidate([]int{1, 2, 3, 5}, []int{-1, 2, 3, 4}), expected: []int{2, 0, 0, 1} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "go_test.go", - "prompt": "package even_odd_palindrome_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a positive integer n, return a tuple that has the number of even and odd\n// integer palindromes that fall within the range(1, n), inclusive.\n// Example 1:\n// >>> even_odd_palindrome(3)\n// []interface{}{1, 2}\n// Explanation:\n// Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n// Example 2:\n// >>> even_odd_palindrome(12)\n// []interface{}{4, 6}\n// Explanation:\n// Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n// Note:\n// 1. 1 <= n <= 10^3\n// 2. returned tuple has the number of even and odd integer palindromes respectively.\nfunc even_odd_palindrome(n int) []interface{} {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "func TestEven_Odd_Palindrome(t *testing.T) {\n candidate := even_odd_palindrome\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(123), expected: []interface{}{8, 13} },\n { actual: candidate(12), expected: []interface{}{4, 6} },\n { actual: candidate(3), expected: []interface{}{1, 2} },\n { actual: candidate(63), expected: []interface{}{6, 8} },\n { actual: candidate(25), expected: []interface{}{5, 6} },\n { actual: candidate(19), expected: []interface{}{4, 6} },\n { actual: candidate(9), expected: []interface{}{4, 5} },\n { actual: candidate(1), expected: []interface{}{0, 1} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "go_test.go", - "prompt": "package fib4_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fib4(0) -> 0\n// fib4(1) -> 0\n// fib4(2) -> 2\n// fib4(3) -> 0\n// fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n// Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n// >>> fib4(5)\n// 4\n// >>> fib4(6)\n// 8\n// >>> fib4(7)\n// 14\nfunc fib4(n int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "func TestFib4(t *testing.T) {\n candidate := fib4\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5), expected: 4 },\n { actual: candidate(8), expected: 28 },\n { actual: candidate(10), expected: 104 },\n { actual: candidate(12), expected: 386 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "go_test.go", - "prompt": "package generate_integers_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given two positive integers a and b, return the even digits between a\n// and b, in ascending order.\n// For example:\n// >>> generate_integers(2, 8)\n// []int{2, 4, 6, 8}\n// >>> generate_integers(8, 2)\n// []int{2, 4, 6, 8}\n// >>> generate_integers(10, 14)\n// []int{}\nfunc generate_integers(a int, b int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "func TestGenerate_Integers(t *testing.T) {\n candidate := generate_integers\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(2, 10), expected: []int{2, 4, 6, 8} },\n { actual: candidate(10, 2), expected: []int{2, 4, 6, 8} },\n { actual: candidate(132, 2), expected: []int{2, 4, 6, 8} },\n { actual: candidate(17, 89), expected: []int{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "go_test.go", - "prompt": "package mean_absolute_deviation_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// For a given list of input numbers, calculate Mean Absolute Deviation\n// around the mean of this dataset.\n// Mean Absolute Deviation is the average absolute difference between each\n// element and a centerpoint (mean in this case):\n// MAD = average | x - x_mean |\n// >>> mean_absolute_deviation([]float64{1.0, 2.0, 3.0, 4.0})\n// 1.0\nfunc mean_absolute_deviation(numbers []float64) float64 {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "func TestMean_Absolute_Deviation(t *testing.T) {\n candidate := mean_absolute_deviation\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]float64{1.0, 2.0}), expected: 0.5 },\n { actual: candidate([]float64{1.0, 2.0, 3.0, 4.0}), expected: 1.0 },\n { actual: candidate([]float64{1.0, 2.0, 3.0, 4.0, 5.0}), expected: 1.2 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "go_test.go", - "prompt": "package encrypt_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function encrypt that takes a string as an argument and\n// returns a string encrypted with the alphabet being rotated. \n// The alphabet should be rotated in a manner such that the letters \n// shift down by two multiplied to two places.\n// For example:\n// >>> encrypt(\"hi\")\n// \"lm\"\n// >>> encrypt(\"asdfghjkl\")\n// \"ewhjklnop\"\n// >>> encrypt(\"gf\")\n// \"kj\"\n// >>> encrypt(\"et\")\n// \"ix\"\nfunc encrypt(s string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "func TestEncrypt(t *testing.T) {\n candidate := encrypt\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"hi\"), expected: \"lm\" },\n { actual: candidate(\"asdfghjkl\"), expected: \"ewhjklnop\" },\n { actual: candidate(\"gf\"), expected: \"kj\" },\n { actual: candidate(\"et\"), expected: \"ix\" },\n { actual: candidate(\"faewfawefaewg\"), expected: \"jeiajeaijeiak\" },\n { actual: candidate(\"hellomyfriend\"), expected: \"lippsqcjvmirh\" },\n { actual: candidate(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\"), expected: \"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\" },\n { actual: candidate(\"a\"), expected: \"e\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "go_test.go", - "prompt": "package get_odd_collatz_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n// The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n// as follows: start with any positive integer n. Then each term is obtained from the \n// previous term as follows: if the previous term is even, the next term is one half of \n// the previous term. If the previous term is odd, the next term is 3 times the previous\n// term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n// Note: \n// 1. Collatz(1) is [1].\n// 2. returned list sorted in increasing order.\n// For example:\n// get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n// >>> get_odd_collatz(5)\n// []int{1, 5}\nfunc get_odd_collatz(n int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "func TestGet_Odd_Collatz(t *testing.T) {\n candidate := get_odd_collatz\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(14), expected: []int{1, 5, 7, 11, 13, 17} },\n { actual: candidate(5), expected: []int{1, 5} },\n { actual: candidate(12), expected: []int{1, 3, 5} },\n { actual: candidate(1), expected: []int{1} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "go_test.go", - "prompt": "package how_many_times_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Find how many times a given substring can be found in the original string. Count overlaping cases.\n// >>> how_many_times(\"\", \"a\")\n// 0\n// >>> how_many_times(\"aaa\", \"a\")\n// 3\n// >>> how_many_times(\"aaaa\", \"aa\")\n// 3\nfunc how_many_times(myString string, substring string) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "func TestHow_Many_Times(t *testing.T) {\n candidate := how_many_times\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\", \"x\"), expected: 0 },\n { actual: candidate(\"xyxyxyx\", \"x\"), expected: 4 },\n { actual: candidate(\"cacacacac\", \"cac\"), expected: 4 },\n { actual: candidate(\"john doe\", \"john\"), expected: 1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "go_test.go", - "prompt": "package move_one_ball_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n// numbers in the array will be randomly ordered. Your task is to determine if\n// it is possible to get an array sorted in non-decreasing order by performing \n// the following operation on the given array:\n// You are allowed to perform right shift operation any number of times.\n// One right shift operation means shifting all elements of the array by one\n// position in the right direction. The last element of the array will be moved to\n// the starting position in the array i.e. 0th index. \n// If it is possible to obtain the sorted array by performing the above operation\n// then return True else return False.\n// If the given array is empty then return True.\n// Note: The given list is guaranteed to have unique elements.\n// For Example:\n// >>> move_one_ball([]int{3, 4, 5, 1, 2})\n// true\n// Explanation: By performin 2 right shift operations, non-decreasing order can\n// be achieved for the given array.\n// >>> move_one_ball([]int{3, 5, 4, 1, 2})\n// false\n// Explanation:It is not possible to get non-decreasing order for the given\n// array by performing any number of right shift operations.\nfunc move_one_ball(arr []int) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "func TestMove_One_Ball(t *testing.T) {\n candidate := move_one_ball\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{3, 4, 5, 1, 2}), expected: true },\n { actual: candidate([]int{3, 5, 10, 1, 2}), expected: true },\n { actual: candidate([]int{4, 3, 1, 2}), expected: false },\n { actual: candidate([]int{3, 5, 4, 1, 2}), expected: false },\n { actual: candidate([]int{}), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "go_test.go", - "prompt": "package order_by_points_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function which sorts the given list of integers\n// in ascending order according to the sum of their digits.\n// Note: if there are several items with similar sum of their digits,\n// order them based on their index in original list.\n// For example:\n// >>> order_by_points([]int{1, 11, -1, -11, -12})\n// []int{-1, -11, 1, -12, 11}\n// >>> order_by_points([]int{})\n// []int{}\nfunc order_by_points(nums []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "func TestOrder_By_Points(t *testing.T) {\n candidate := order_by_points\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 11, -1, -11, -12}), expected: []int{-1, -11, 1, -12, 11} },\n { actual: candidate([]int{1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46}), expected: []int{0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457} },\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{1, -11, -32, 43, 54, -98, 2, -3}), expected: []int{-3, -32, -98, -11, 1, 2, 43, 54} },\n { actual: candidate([]int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}), expected: []int{1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9} },\n { actual: candidate([]int{0, 6, 6, -76, -21, 23, 4}), expected: []int{-76, -21, 0, 4, 23, 6, 6} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "go_test.go", - "prompt": "package factorize_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return list of prime factors of given integer in the order from smallest to largest.\n// Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n// Input number should be equal to the product of all factors\n// >>> factorize(8)\n// []int{2, 2, 2}\n// >>> factorize(25)\n// []int{5, 5}\n// >>> factorize(70)\n// []int{2, 5, 7}\nfunc factorize(n int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "func TestFactorize(t *testing.T) {\n candidate := factorize\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(2), expected: []int{2} },\n { actual: candidate(4), expected: []int{2, 2} },\n { actual: candidate(8), expected: []int{2, 2, 2} },\n { actual: candidate(57), expected: []int{3, 19} },\n { actual: candidate(3249), expected: []int{3, 3, 19, 19} },\n { actual: candidate(185193), expected: []int{3, 3, 3, 19, 19, 19} },\n { actual: candidate(20577), expected: []int{3, 19, 19, 19} },\n { actual: candidate(18), expected: []int{2, 3, 3} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "go_test.go", - "prompt": "package below_threshold_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return True if all numbers in the list l are below threshold t.\n// >>> below_threshold([]int{1, 2, 4, 10}, 100)\n// true\n// >>> below_threshold([]int{1, 20, 4, 10}, 5)\n// false\nfunc below_threshold(l []int, t int) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "func TestBelow_Threshold(t *testing.T) {\n candidate := below_threshold\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 4, 10}, 100), expected: true },\n { actual: candidate([]int{1, 20, 4, 10}, 5), expected: false },\n { actual: candidate([]int{1, 20, 4, 10}, 21), expected: true },\n { actual: candidate([]int{1, 20, 4, 10}, 22), expected: true },\n { actual: candidate([]int{1, 8, 4, 10}, 11), expected: true },\n { actual: candidate([]int{1, 8, 4, 10}, 10), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "go_test.go", - "prompt": "package parse_nested_parens_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n// For each of the group, output the deepest level of nesting of parentheses.\n// E.g. (()()) has maximum two levels of nesting while ((())) has three.\n// >>> parse_nested_parens(\"(()()) ((())) () ((())()())\")\n// []int{2, 3, 1, 3}\nfunc parse_nested_parens(paren_string string) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "func TestParse_Nested_Parens(t *testing.T) {\n candidate := parse_nested_parens\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"(()()) ((())) () ((())()())\"), expected: []int{2, 3, 1, 3} },\n { actual: candidate(\"() (()) ((())) (((())))\"), expected: []int{1, 2, 3, 4} },\n { actual: candidate(\"(()(())((())))\"), expected: []int{4} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_121_solution", - "language": "go_test.go", - "prompt": "package solution_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n// Examples\n// >>> solution([]int{5, 8, 7, 1})\n// 12\n// >>> solution([]int{3, 3, 3, 3, 3})\n// 9\n// >>> solution([]int{30, 13, 24, 321})\n// 0\nfunc solution(lst []int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "func TestSolution(t *testing.T) {\n candidate := solution\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{5, 8, 7, 1}), expected: 12 },\n { actual: candidate([]int{3, 3, 3, 3, 3}), expected: 9 },\n { actual: candidate([]int{30, 13, 24, 321}), expected: 0 },\n { actual: candidate([]int{5, 9}), expected: 5 },\n { actual: candidate([]int{2, 4, 8}), expected: 0 },\n { actual: candidate([]int{30, 13, 23, 32}), expected: 23 },\n { actual: candidate([]int{3, 13, 2, 9}), expected: 3 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "go_test.go", - "prompt": "package get_max_triples_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a positive integer n. You have to create an integer array a of length n.\n// For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n// Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n// and a[i] + a[j] + a[k] is a multiple of 3.\n// Example :\n// >>> get_max_triples(5)\n// 1\n// Explanation: \n// a = [1, 3, 7, 13, 21]\n// The only valid triple is (1, 7, 13).\nfunc get_max_triples(n int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "func TestGet_Max_Triples(t *testing.T) {\n candidate := get_max_triples\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5), expected: 1 },\n { actual: candidate(6), expected: 4 },\n { actual: candidate(10), expected: 36 },\n { actual: candidate(100), expected: 53361 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_148_bf", - "language": "go_test.go", - "prompt": "package bf_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// There are eight planets in our solar system: the closerst to the Sun \n// is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n// Uranus, Neptune.\n// Write a function that takes two planet names as strings planet1 and planet2. \n// The function should return a tuple containing all planets whose orbits are \n// located between the orbit of planet1 and the orbit of planet2, sorted by \n// the proximity to the sun. \n// The function should return an empty tuple if planet1 or planet2\n// are not correct planet names. \n// Examples\n// >>> bf(\"Jupiter\", \"Neptune\")\n// []interface{}{\"Saturn\", \"Uranus\"}\n// >>> bf(\"Earth\", \"Mercury\")\n// \"Venus\"\n// >>> bf(\"Mercury\", \"Uranus\")\n// []interface{}{\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"}\nfunc bf(planet1 string, planet2 string) []interface{} {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "func TestBf(t *testing.T) {\n candidate := bf\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Jupiter\", \"Neptune\"), expected: []interface{}{\"Saturn\", \"Uranus\"} },\n { actual: candidate(\"Earth\", \"Mercury\"), expected: []interface{}{\"Venus\"} },\n { actual: candidate(\"Mercury\", \"Uranus\"), expected: []interface{}{\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"} },\n { actual: candidate(\"Neptune\", \"Venus\"), expected: []interface{}{\"Earth\", \"Mars\", \"Jupiter\", \"Saturn\", \"Uranus\"} },\n { actual: candidate(\"Earth\", \"Earth\"), expected: []interface{}{} },\n { actual: candidate(\"Mars\", \"Earth\"), expected: []interface{}{} },\n { actual: candidate(\"Jupiter\", \"Makemake\"), expected: []interface{}{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "go_test.go", - "prompt": "package sort_numbers_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Input is a space-delimited string of numberals from 'zero' to 'nine'.\n// Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n// Return the string with numbers sorted from smallest to largest\n// >>> sort_numbers(\"three one five\")\n// \"one three five\"\nfunc sort_numbers(numbers string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "func TestSort_Numbers(t *testing.T) {\n candidate := sort_numbers\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: \"\" },\n { actual: candidate(\"three\"), expected: \"three\" },\n { actual: candidate(\"three five nine\"), expected: \"three five nine\" },\n { actual: candidate(\"five zero four seven nine eight\"), expected: \"zero four five seven eight nine\" },\n { actual: candidate(\"six five four three two one zero\"), expected: \"zero one two three four five six\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "go_test.go", - "prompt": "package cycpattern_check_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n// >>> cycpattern_check(\"abcd\", \"abd\")\n// false\n// >>> cycpattern_check(\"hello\", \"ell\")\n// true\n// >>> cycpattern_check(\"whassup\", \"psus\")\n// false\n// >>> cycpattern_check(\"abab\", \"baa\")\n// true\n// >>> cycpattern_check(\"efef\", \"eeff\")\n// false\n// >>> cycpattern_check(\"himenss\", \"simen\")\n// true\nfunc cycpattern_check(a string, b string) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "func TestCycpattern_Check(t *testing.T) {\n candidate := cycpattern_check\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"xyzw\", \"xyw\"), expected: false },\n { actual: candidate(\"yello\", \"ell\"), expected: true },\n { actual: candidate(\"whattup\", \"ptut\"), expected: false },\n { actual: candidate(\"efef\", \"fee\"), expected: true },\n { actual: candidate(\"abab\", \"aabb\"), expected: false },\n { actual: candidate(\"winemtt\", \"tinem\"), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "go_test.go", - "prompt": "package decimal_to_binary_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You will be given a number in decimal form and your task is to convert it to\n// binary format. The function should return a string, with each character representing a binary\n// number. Each character in the string will be '0' or '1'.\n// There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n// The extra characters are there to help with the format.\n// Examples:\n// >>> decimal_to_binary(15)\n// \"db1111db\"\n// >>> decimal_to_binary(32)\n// \"db100000db\"\nfunc decimal_to_binary(decimal int) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "func TestDecimal_To_Binary(t *testing.T) {\n candidate := decimal_to_binary\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(0), expected: \"db0db\" },\n { actual: candidate(32), expected: \"db100000db\" },\n { actual: candidate(103), expected: \"db1100111db\" },\n { actual: candidate(15), expected: \"db1111db\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "go_test.go", - "prompt": "package filter_by_substring_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Filter an input list of strings only for ones that contain given substring\n// >>> filter_by_substring([]string{}, \"a\")\n// []string{}\n// >>> filter_by_substring([]string{\"abc\", \"bacd\", \"cde\", \"array\"}, \"a\")\n// []string{\"abc\", \"bacd\", \"array\"}\nfunc filter_by_substring(strings []string, substring string) []string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "func TestFilter_By_Substring(t *testing.T) {\n candidate := filter_by_substring\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{}, \"john\"), expected: []string{} },\n { actual: candidate([]string{\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"}, \"xxx\"), expected: []string{\"xxx\", \"xxxAAA\", \"xxx\"} },\n { actual: candidate([]string{\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"}, \"xx\"), expected: []string{\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"} },\n { actual: candidate([]string{\"grunt\", \"trumpet\", \"prune\", \"gruesome\"}, \"run\"), expected: []string{\"grunt\", \"prune\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "go_test.go", - "prompt": "package even_odd_count_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given an integer. return a tuple that has the number of even and odd digits respectively.\n// Example:\n// >>> even_odd_count(-12)\n// []interface{}{1, 1}\n// >>> even_odd_count(123)\n// []interface{}{1, 2}\nfunc even_odd_count(num int) []interface{} {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "func TestEven_Odd_Count(t *testing.T) {\n candidate := even_odd_count\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(7), expected: []interface{}{0, 1} },\n { actual: candidate(-78), expected: []interface{}{1, 1} },\n { actual: candidate(3452), expected: []interface{}{2, 2} },\n { actual: candidate(346211), expected: []interface{}{3, 3} },\n { actual: candidate(-345821), expected: []interface{}{3, 3} },\n { actual: candidate(-2), expected: []interface{}{1, 0} },\n { actual: candidate(-45347), expected: []interface{}{2, 3} },\n { actual: candidate(0), expected: []interface{}{1, 0} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "go_test.go", - "prompt": "package find_max_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that accepts a list of strings.\n// The list contains different words. Return the word with maximum number\n// of unique characters. If multiple strings have maximum number of unique\n// characters, return the one which comes first in lexicographical order.\n// >>> find_max([]string{\"name\", \"of\", \"string\"})\n// \"string\"\n// >>> find_max([]string{\"name\", \"enam\", \"game\"})\n// \"enam\"\n// >>> find_max([]string{\"aaaaaaa\", \"bb\", \"cc\"})\n// \"aaaaaaa\"\nfunc find_max(words []string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "func TestFind_Max(t *testing.T) {\n candidate := find_max\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{\"name\", \"of\", \"string\"}), expected: \"string\" },\n { actual: candidate([]string{\"name\", \"enam\", \"game\"}), expected: \"enam\" },\n { actual: candidate([]string{\"aaaaaaa\", \"bb\", \"cc\"}), expected: \"aaaaaaa\" },\n { actual: candidate([]string{\"abc\", \"cba\"}), expected: \"abc\" },\n { actual: candidate([]string{\"play\", \"this\", \"game\", \"of\", \"footbott\"}), expected: \"footbott\" },\n { actual: candidate([]string{\"we\", \"are\", \"gonna\", \"rock\"}), expected: \"gonna\" },\n { actual: candidate([]string{\"we\", \"are\", \"a\", \"mad\", \"nation\"}), expected: \"nation\" },\n { actual: candidate([]string{\"this\", \"is\", \"a\", \"prrk\"}), expected: \"this\" },\n { actual: candidate([]string{\"b\"}), expected: \"b\" },\n { actual: candidate([]string{\"play\", \"play\", \"play\"}), expected: \"play\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "go_test.go", - "prompt": "package starts_one_ends_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a positive integer n, return the count of the numbers of n-digit\n// positive integers that start or end with 1.\nfunc starts_one_ends(n int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": "func TestStarts_One_Ends(t *testing.T) {\n candidate := starts_one_ends\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(1), expected: 1 },\n { actual: candidate(2), expected: 18 },\n { actual: candidate(3), expected: 180 },\n { actual: candidate(4), expected: 1800 },\n { actual: candidate(5), expected: 18000 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "go_test.go", - "prompt": "package largest_smallest_integers_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function that returns a tuple (a, b), where 'a' is\n// the largest of negative integers, and 'b' is the smallest\n// of positive integers in a list.\n// If there is no negative or positive integers, return them as None.\n// Examples:\n// >>> largest_smallest_integers([]int{2, 4, 1, 3, 5, 7})\n// []interface{}{nil, 1}\n// >>> largest_smallest_integers([]int{})\n// []interface{}{nil, nil}\n// >>> largest_smallest_integers([]int{0})\n// []interface{}{nil, nil}\nfunc largest_smallest_integers(lst []int) []interface{} {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "func TestLargest_Smallest_Integers(t *testing.T) {\n candidate := largest_smallest_integers\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{2, 4, 1, 3, 5, 7}), expected: []interface{}{nil, 1} },\n { actual: candidate([]int{2, 4, 1, 3, 5, 7, 0}), expected: []interface{}{nil, 1} },\n { actual: candidate([]int{1, 3, 2, 4, 5, 6, -2}), expected: []interface{}{-2, 1} },\n { actual: candidate([]int{4, 5, 3, 6, 2, 7, -7}), expected: []interface{}{-7, 2} },\n { actual: candidate([]int{7, 3, 8, 4, 9, 2, 5, -9}), expected: []interface{}{-9, 2} },\n { actual: candidate([]int{}), expected: []interface{}{nil, nil} },\n { actual: candidate([]int{0}), expected: []interface{}{nil, nil} },\n { actual: candidate([]int{-1, -3, -5, -6}), expected: []interface{}{-1, nil} },\n { actual: candidate([]int{-1, -3, -5, -6, 0}), expected: []interface{}{-1, nil} },\n { actual: candidate([]int{-6, -4, -4, -3, 1}), expected: []interface{}{-3, 1} },\n { actual: candidate([]int{-6, -4, -4, -3, -100, 1}), expected: []interface{}{-3, 1} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "go_test.go", - "prompt": "package pluck_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// \"Given an array representing a branch of a tree that has non-negative integer nodes\n// your task is to pluck one of the nodes and return it.\n// The plucked node should be the node with the smallest even value.\n// If multiple nodes with the same smallest even value are found return the node that has smallest index.\n// The plucked node should be returned in a list, [ smalest_value, its index ],\n// If there are no even values or the given array is empty, return [].\n// Example 1:\n// >>> pluck([]int{4, 2, 3})\n// []int{2, 1}\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 2:\n// >>> pluck([]int{1, 2, 3})\n// []int{2, 1}\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 3:\n// >>> pluck([]int{})\n// []int{}\n// Example 4:\n// >>> pluck([]int{5, 0, 3, 0, 4, 2})\n// []int{0, 1}\n// Explanation: 0 is the smallest value, but there are two zeros,\n// so we will choose the first zero, which has the smallest index.\n// Constraints:\n// * 1 <= nodes.length <= 10000\n// * 0 <= node.value\nfunc pluck(arr []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "func TestPluck(t *testing.T) {\n candidate := pluck\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{4, 2, 3}), expected: []int{2, 1} },\n { actual: candidate([]int{1, 2, 3}), expected: []int{2, 1} },\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{5, 0, 3, 0, 4, 2}), expected: []int{0, 1} },\n { actual: candidate([]int{1, 2, 3, 0, 5, 3}), expected: []int{0, 3} },\n { actual: candidate([]int{5, 4, 8, 4, 8}), expected: []int{4, 1} },\n { actual: candidate([]int{7, 6, 7, 1}), expected: []int{6, 1} },\n { actual: candidate([]int{7, 9, 7, 1}), expected: []int{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "go_test.go", - "prompt": "package count_nums_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function count_nums which takes an array of integers and returns\n// the number of elements which has a sum of digits > 0.\n// If a number is negative, then its first signed digit will be negative:\n// e.g. -123 has signed digits -1, 2, and 3.\n// >>> count_nums([]int{})\n// 0\n// >>> count_nums([]int{-1, 11, -11})\n// 1\n// >>> count_nums([]int{1, 1, 2})\n// 3\nfunc count_nums(arr []int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "func TestCount_Nums(t *testing.T) {\n candidate := count_nums\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}), expected: 0 },\n { actual: candidate([]int{-1, -2, 0}), expected: 0 },\n { actual: candidate([]int{1, 1, 2, -2, 3, 4, 5}), expected: 6 },\n { actual: candidate([]int{1, 6, 9, -6, 0, 1, 5}), expected: 5 },\n { actual: candidate([]int{1, 100, 98, -7, 1, -1}), expected: 4 },\n { actual: candidate([]int{12, 23, 34, -45, -56, 0}), expected: 5 },\n { actual: candidate([]int{0, 1}), expected: 1 },\n { actual: candidate([]int{1}), expected: 1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "go_test.go", - "prompt": "package minPath_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n// each cell of the grid contains a value. Every integer in the range [1, N * N]\n// inclusive appears exactly once on the cells of the grid.\n// You have to find the minimum path of length k in the grid. You can start\n// from any cell, and in each step you can move to any of the neighbor cells,\n// in other words, you can go to cells which share an edge with you current\n// cell.\n// Please note that a path of length k means visiting exactly k cells (not\n// necessarily distinct).\n// You CANNOT go off the grid.\n// A path A (of length k) is considered less than a path B (of length k) if\n// after making the ordered lists of the values on the cells that A and B go\n// through (let's call them lst_A and lst_B), lst_A is lexicographically less\n// than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n// such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n// lst_A[j] = lst_B[j].\n// It is guaranteed that the answer is unique.\n// Return an ordered list of the values on the cells that the minimum path go through.\n// Examples: \n// >>> minPath([][]int{[]int{1, 2, 3}, []int{4, 5, 6}, []int{7, 8, 9}}, 3)\n// []int{1, 2, 1}\n// >>> minPath([][]int{[]int{5, 9, 3}, []int{4, 1, 6}, []int{7, 8, 2}}, 1)\n// []int{1}\nfunc minPath(grid [][]int, k int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "func TestMinpath(t *testing.T) {\n candidate := minPath\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([][]int{[]int{1, 2, 3}, []int{4, 5, 6}, []int{7, 8, 9}}, 3), expected: []int{1, 2, 1} },\n { actual: candidate([][]int{[]int{5, 9, 3}, []int{4, 1, 6}, []int{7, 8, 2}}, 1), expected: []int{1} },\n { actual: candidate([][]int{[]int{1, 2, 3, 4}, []int{5, 6, 7, 8}, []int{9, 10, 11, 12}, []int{13, 14, 15, 16}}, 4), expected: []int{1, 2, 1, 2} },\n { actual: candidate([][]int{[]int{6, 4, 13, 10}, []int{5, 7, 12, 1}, []int{3, 16, 11, 15}, []int{8, 14, 9, 2}}, 7), expected: []int{1, 10, 1, 10, 1, 10, 1} },\n { actual: candidate([][]int{[]int{8, 14, 9, 2}, []int{6, 4, 13, 15}, []int{5, 7, 1, 12}, []int{3, 10, 11, 16}}, 5), expected: []int{1, 7, 1, 7, 1} },\n { actual: candidate([][]int{[]int{11, 8, 7, 2}, []int{5, 16, 14, 4}, []int{9, 3, 15, 6}, []int{12, 13, 10, 1}}, 9), expected: []int{1, 6, 1, 6, 1, 6, 1, 6, 1} },\n { actual: candidate([][]int{[]int{12, 13, 10, 1}, []int{9, 3, 15, 6}, []int{5, 16, 14, 4}, []int{11, 8, 7, 2}}, 12), expected: []int{1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6} },\n { actual: candidate([][]int{[]int{2, 7, 4}, []int{3, 1, 5}, []int{6, 8, 9}}, 8), expected: []int{1, 3, 1, 3, 1, 3, 1, 3} },\n { actual: candidate([][]int{[]int{6, 1, 5}, []int{3, 8, 9}, []int{2, 7, 4}}, 8), expected: []int{1, 5, 1, 5, 1, 5, 1, 5} },\n { actual: candidate([][]int{[]int{1, 2}, []int{3, 4}}, 10), expected: []int{1, 2, 1, 2, 1, 2, 1, 2, 1, 2} },\n { actual: candidate([][]int{[]int{1, 3}, []int{3, 2}}, 10), expected: []int{1, 3, 1, 3, 1, 3, 1, 3, 1, 3} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "go_test.go", - "prompt": "package strange_sort_list_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given list of integers, return list in strange order.\n// Strange sorting, is when you start with the minimum value,\n// then maximum of the remaining integers, then minimum and so on.\n// Examples:\n// >>> strange_sort_list([]int{1, 2, 3, 4})\n// []int{1, 4, 2, 3}\n// >>> strange_sort_list([]int{5, 5, 5, 5})\n// []int{5, 5, 5, 5}\n// >>> strange_sort_list([]int{})\n// []int{}\nfunc strange_sort_list(lst []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "func TestStrange_Sort_List(t *testing.T) {\n candidate := strange_sort_list\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 3, 4}), expected: []int{1, 4, 2, 3} },\n { actual: candidate([]int{5, 6, 7, 8, 9}), expected: []int{5, 9, 6, 8, 7} },\n { actual: candidate([]int{1, 2, 3, 4, 5}), expected: []int{1, 5, 2, 4, 3} },\n { actual: candidate([]int{5, 6, 7, 8, 9, 1}), expected: []int{1, 9, 5, 8, 6, 7} },\n { actual: candidate([]int{5, 5, 5, 5}), expected: []int{5, 5, 5, 5} },\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{1, 2, 3, 4, 5, 6, 7, 8}), expected: []int{1, 8, 2, 7, 3, 6, 4, 5} },\n { actual: candidate([]int{0, 2, 2, 2, 5, 5, -5, -5}), expected: []int{-5, 5, -5, 5, 0, 2, 2, 2} },\n { actual: candidate([]int{111111}), expected: []int{111111} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "go_test.go", - "prompt": "package get_closest_vowel_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a word. Your task is to find the closest vowel that stands between \n// two consonants from the right side of the word (case sensitive).\n// Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n// find any vowel met the above condition. \n// You may assume that the given string contains English letter only.\n// Example:\n// >>> get_closest_vowel(\"yogurt\")\n// \"u\"\n// >>> get_closest_vowel(\"FULL\")\n// \"U\"\n// >>> get_closest_vowel(\"quick\")\n// \"\"\n// >>> get_closest_vowel(\"ab\")\n// \"\"\nfunc get_closest_vowel(word string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "func TestGet_Closest_Vowel(t *testing.T) {\n candidate := get_closest_vowel\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"yogurt\"), expected: \"u\" },\n { actual: candidate(\"full\"), expected: \"u\" },\n { actual: candidate(\"easy\"), expected: \"\" },\n { actual: candidate(\"eAsy\"), expected: \"\" },\n { actual: candidate(\"ali\"), expected: \"\" },\n { actual: candidate(\"bad\"), expected: \"a\" },\n { actual: candidate(\"most\"), expected: \"o\" },\n { actual: candidate(\"ab\"), expected: \"\" },\n { actual: candidate(\"ba\"), expected: \"\" },\n { actual: candidate(\"quick\"), expected: \"\" },\n { actual: candidate(\"anime\"), expected: \"i\" },\n { actual: candidate(\"Asia\"), expected: \"\" },\n { actual: candidate(\"Above\"), expected: \"o\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "go_test.go", - "prompt": "package change_base_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Change numerical base of input number x to base.\n// return string representation after the conversion.\n// base numbers are less than 10.\n// >>> change_base(8, 3)\n// \"22\"\n// >>> change_base(8, 2)\n// \"1000\"\n// >>> change_base(7, 2)\n// \"111\"\nfunc change_base(x int, base int) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "func TestChange_Base(t *testing.T) {\n candidate := change_base\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(8, 3), expected: \"22\" },\n { actual: candidate(9, 3), expected: \"100\" },\n { actual: candidate(234, 2), expected: \"11101010\" },\n { actual: candidate(16, 2), expected: \"10000\" },\n { actual: candidate(8, 2), expected: \"1000\" },\n { actual: candidate(7, 2), expected: \"111\" },\n { actual: candidate(2, 3), expected: \"2\" },\n { actual: candidate(3, 4), expected: \"3\" },\n { actual: candidate(4, 5), expected: \"4\" },\n { actual: candidate(5, 6), expected: \"5\" },\n { actual: candidate(6, 7), expected: \"6\" },\n { actual: candidate(7, 8), expected: \"7\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "go_test.go", - "prompt": "package has_close_elements_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Check if in given list of numbers, are any two numbers closer to each other than\n// given threshold.\n// >>> has_close_elements([]float64{1.0, 2.0, 3.0}, 0.5)\n// false\n// >>> has_close_elements([]float64{1.0, 2.8, 3.0, 4.0, 5.0, 2.0}, 0.3)\n// true\nfunc has_close_elements(numbers []float64, threshold float64) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "func TestHas_Close_Elements(t *testing.T) {\n candidate := has_close_elements\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]float64{1.0, 2.0, 3.9, 4.0, 5.0, 2.2}, 0.3), expected: true },\n { actual: candidate([]float64{1.0, 2.0, 3.9, 4.0, 5.0, 2.2}, 0.05), expected: false },\n { actual: candidate([]float64{1.0, 2.0, 5.9, 4.0, 5.0}, 0.95), expected: true },\n { actual: candidate([]float64{1.0, 2.0, 5.9, 4.0, 5.0}, 0.8), expected: false },\n { actual: candidate([]float64{1.0, 2.0, 3.0, 4.0, 5.0, 2.0}, 0.1), expected: true },\n { actual: candidate([]float64{1.1, 2.2, 3.1, 4.1, 5.1}, 1.0), expected: true },\n { actual: candidate([]float64{1.1, 2.2, 3.1, 4.1, 5.1}, 0.5), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "go_test.go", - "prompt": "package is_nested_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function that takes a string as input which contains only square brackets.\n// The function should return True if and only if there is a valid subsequence of brackets \n// where at least one bracket in the subsequence is nested.\n// >>> is_nested(\"[[]]\")\n// true\n// >>> is_nested(\"[]]]]]]][[[[[]\")\n// false\n// >>> is_nested(\"[][]\")\n// false\n// >>> is_nested(\"[]\")\n// false\n// >>> is_nested(\"[[][]]\")\n// true\n// >>> is_nested(\"[[]][[\")\n// true\nfunc is_nested(myString string) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "func TestIs_Nested(t *testing.T) {\n candidate := is_nested\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"[[]]\"), expected: true },\n { actual: candidate(\"[]]]]]]][[[[[]\"), expected: false },\n { actual: candidate(\"[][]\"), expected: false },\n { actual: candidate(\"[]\"), expected: false },\n { actual: candidate(\"[[[[]]]]\"), expected: true },\n { actual: candidate(\"[]]]]]]]]]]\"), expected: false },\n { actual: candidate(\"[][][[]]\"), expected: true },\n { actual: candidate(\"[[]\"), expected: false },\n { actual: candidate(\"[]]\"), expected: false },\n { actual: candidate(\"[[]][[\"), expected: true },\n { actual: candidate(\"[[][]]\"), expected: true },\n { actual: candidate(\"\"), expected: false },\n { actual: candidate(\"[[[[[[[[\"), expected: false },\n { actual: candidate(\"]]]]]]]]\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "go_test.go", - "prompt": "package concatenate_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Concatenate list of strings into a single string\n// >>> concatenate([]string{})\n// \"\"\n// >>> concatenate([]string{\"a\", \"b\", \"c\"})\n// \"abc\"\nfunc concatenate(strings []string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "func TestConcatenate(t *testing.T) {\n candidate := concatenate\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{}), expected: \"\" },\n { actual: candidate([]string{\"x\", \"y\", \"z\"}), expected: \"xyz\" },\n { actual: candidate([]string{\"x\", \"y\", \"z\", \"w\", \"k\"}), expected: \"xyzwk\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "go_test.go", - "prompt": "package prime_fib_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n// >>> prime_fib(1)\n// 2\n// >>> prime_fib(2)\n// 3\n// >>> prime_fib(3)\n// 5\n// >>> prime_fib(4)\n// 13\n// >>> prime_fib(5)\n// 89\nfunc prime_fib(n int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "func TestPrime_Fib(t *testing.T) {\n candidate := prime_fib\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(1), expected: 2 },\n { actual: candidate(2), expected: 3 },\n { actual: candidate(3), expected: 5 },\n { actual: candidate(4), expected: 13 },\n { actual: candidate(5), expected: 89 },\n { actual: candidate(6), expected: 233 },\n { actual: candidate(7), expected: 1597 },\n { actual: candidate(8), expected: 28657 },\n { actual: candidate(9), expected: 514229 },\n { actual: candidate(10), expected: 433494437 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "go_test.go", - "prompt": "package find_closest_elements_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n// other and return them in order (smaller number, larger number).\n// >>> find_closest_elements([]float64{1.0, 2.0, 3.0, 4.0, 5.0, 2.2})\n// []interface{}{2.0, 2.2}\n// >>> find_closest_elements([]float64{1.0, 2.0, 3.0, 4.0, 5.0, 2.0})\n// []interface{}{2.0, 2.0}\nfunc find_closest_elements(numbers []float64) []interface{} {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "func TestFind_Closest_Elements(t *testing.T) {\n candidate := find_closest_elements\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]float64{1.0, 2.0, 3.9, 4.0, 5.0, 2.2}), expected: []interface{}{3.9, 4.0} },\n { actual: candidate([]float64{1.0, 2.0, 5.9, 4.0, 5.0}), expected: []interface{}{5.0, 5.9} },\n { actual: candidate([]float64{1.0, 2.0, 3.0, 4.0, 5.0, 2.2}), expected: []interface{}{2.0, 2.2} },\n { actual: candidate([]float64{1.0, 2.0, 3.0, 4.0, 5.0, 2.0}), expected: []interface{}{2.0, 2.0} },\n { actual: candidate([]float64{1.1, 2.2, 3.1, 4.1, 5.1}), expected: []interface{}{2.2, 3.1} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "go_test.go", - "prompt": "package hex_key_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You have been tasked to write a function that receives \n// a hexadecimal number as a string and counts the number of hexadecimal \n// digits that are primes (prime number, or a prime, is a natural number \n// greater than 1 that is not a product of two smaller natural numbers).\n// Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n// Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n// So you have to determine a number of the following digits: 2, 3, 5, 7, \n// B (=decimal 11), D (=decimal 13).\n// Note: you may assume the input is always correct or empty string, \n// and symbols A,B,C,D,E,F are always uppercase.\n// Examples:\n// >>> hex_key(\"AB\")\n// 1\n// >>> hex_key(\"1077E\")\n// 2\n// >>> hex_key(\"ABED1A33\")\n// 4\n// >>> hex_key(\"123456789ABCDEF0\")\n// 6\n// >>> hex_key(\"2020\")\n// 2\nfunc hex_key(num string) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "func TestHex_Key(t *testing.T) {\n candidate := hex_key\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"AB\"), expected: 1 },\n { actual: candidate(\"1077E\"), expected: 2 },\n { actual: candidate(\"ABED1A33\"), expected: 4 },\n { actual: candidate(\"2020\"), expected: 2 },\n { actual: candidate(\"123456789ABCDEF0\"), expected: 6 },\n { actual: candidate(\"112233445566778899AABBCCDDEEFF00\"), expected: 12 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "go_test.go", - "prompt": "package multiply_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Complete the function that takes two integers and returns \n// the product of their unit digits.\n// Assume the input is always valid.\n// Examples:\n// >>> multiply(148, 412)\n// 16\n// >>> multiply(19, 28)\n// 72\n// >>> multiply(2020, 1851)\n// 0\n// >>> multiply(14, -15)\n// 20\nfunc multiply(a int, b int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "func TestMultiply(t *testing.T) {\n candidate := multiply\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(148, 412), expected: 16 },\n { actual: candidate(19, 28), expected: 72 },\n { actual: candidate(2020, 1851), expected: 0 },\n { actual: candidate(14, -15), expected: 20 },\n { actual: candidate(76, 67), expected: 42 },\n { actual: candidate(17, 27), expected: 49 },\n { actual: candidate(0, 1), expected: 0 },\n { actual: candidate(0, 0), expected: 0 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "go_test.go", - "prompt": "package rescale_to_unit_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given list of numbers (of at least two elements), apply a linear transform to that list,\n// such that the smallest number will become 0 and the largest will become 1\n// >>> rescale_to_unit([]float64{1.0, 2.0, 3.0, 4.0, 5.0})\n// []float64{0.0, 0.25, 0.5, 0.75, 1.0}\nfunc rescale_to_unit(numbers []float64) []float64 {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "func TestRescale_To_Unit(t *testing.T) {\n candidate := rescale_to_unit\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]float64{2.0, 49.9}), expected: []float64{0.0, 1.0} },\n { actual: candidate([]float64{100.0, 49.9}), expected: []float64{1.0, 0.0} },\n { actual: candidate([]float64{1.0, 2.0, 3.0, 4.0, 5.0}), expected: []float64{0.0, 0.25, 0.5, 0.75, 1.0} },\n { actual: candidate([]float64{2.0, 1.0, 5.0, 3.0, 4.0}), expected: []float64{0.25, 0.0, 1.0, 0.5, 0.75} },\n { actual: candidate([]float64{12.0, 11.0, 15.0, 13.0, 14.0}), expected: []float64{0.25, 0.0, 1.0, 0.5, 0.75} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_131_digits", - "language": "go_test.go", - "prompt": "package digits_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a positive integer n, return the product of the odd digits.\n// Return 0 if all digits are even.\n// For example:\n// >>> digits(1)\n// 1\n// >>> digits(4)\n// 0\n// >>> digits(235)\n// 15\nfunc digits(n int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "func TestDigits(t *testing.T) {\n candidate := digits\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5), expected: 5 },\n { actual: candidate(54), expected: 5 },\n { actual: candidate(120), expected: 1 },\n { actual: candidate(5014), expected: 5 },\n { actual: candidate(98765), expected: 315 },\n { actual: candidate(5576543), expected: 2625 },\n { actual: candidate(2468), expected: 0 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "go_test.go", - "prompt": "package Strongest_Extension_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You will be given the name of a class (a string) and a list of extensions.\n// The extensions are to be used to load additional classes to the class. The\n// strength of the extension is as follows: Let CAP be the number of the uppercase\n// letters in the extension's name, and let SM be the number of lowercase letters \n// in the extension's name, the strength is given by the fraction CAP - SM. \n// You should find the strongest extension and return a string in this \n// format: ClassName.StrongestExtensionName.\n// If there are two or more extensions with the same strength, you should\n// choose the one that comes first in the list.\n// For example, if you are given \"Slices\" as the class and a list of the\n// extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n// return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n// (its strength is -1).\n// Example:\n// >>> Strongest_Extension(\"my_class\", []string{\"AA\", \"Be\", \"CC\"})\n// \"my_class.AA\"\nfunc Strongest_Extension(class_name string, extensions []string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "func TestStrongest_Extension(t *testing.T) {\n candidate := Strongest_Extension\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Watashi\", []string{\"tEN\", \"niNE\", \"eIGHt8OKe\"}), expected: \"Watashi.eIGHt8OKe\" },\n { actual: candidate(\"Boku123\", []string{\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"}), expected: \"Boku123.YEs.WeCaNe\" },\n { actual: candidate(\"__YESIMHERE\", []string{\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"}), expected: \"__YESIMHERE.NuLl__\" },\n { actual: candidate(\"K\", []string{\"Ta\", \"TAR\", \"t234An\", \"cosSo\"}), expected: \"K.TAR\" },\n { actual: candidate(\"__HAHA\", []string{\"Tab\", \"123\", \"781345\", \"-_-\"}), expected: \"__HAHA.123\" },\n { actual: candidate(\"YameRore\", []string{\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"}), expected: \"YameRore.okIWILL123\" },\n { actual: candidate(\"finNNalLLly\", []string{\"Die\", \"NowW\", \"Wow\", \"WoW\"}), expected: \"finNNalLLly.WoW\" },\n { actual: candidate(\"_\", []string{\"Bb\", \"91245\"}), expected: \"_.Bb\" },\n { actual: candidate(\"Sp\", []string{\"671235\", \"Bb\"}), expected: \"Sp.671235\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "go_test.go", - "prompt": "package histogram_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a string representing a space separated lowercase letters, return a dictionary\n// of the letter with the most repetition and containing the corresponding count.\n// If several letters have the same occurrence, return all of them.\n// Example:\n// >>> histogram(\"a b c\")\n// map[string]int{\"a\": 1, \"b\": 1, \"c\": 1}\n// >>> histogram(\"a b b a\")\n// map[string]int{\"a\": 2, \"b\": 2}\n// >>> histogram(\"a b c a b\")\n// map[string]int{\"a\": 2, \"b\": 2}\n// >>> histogram(\"b b b b a\")\n// map[string]int{\"b\": 4}\n// >>> histogram(\"\")\n// map[string]int{}\nfunc histogram(test string) map[string]int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "func TestHistogram(t *testing.T) {\n candidate := histogram\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"a b b a\"), expected: map[string]int{\"a\": 2, \"b\": 2} },\n { actual: candidate(\"a b c a b\"), expected: map[string]int{\"a\": 2, \"b\": 2} },\n { actual: candidate(\"a b c d g\"), expected: map[string]int{\"a\": 1, \"b\": 1, \"c\": 1, \"d\": 1, \"g\": 1} },\n { actual: candidate(\"r t g\"), expected: map[string]int{\"r\": 1, \"t\": 1, \"g\": 1} },\n { actual: candidate(\"b b b b a\"), expected: map[string]int{\"b\": 4} },\n { actual: candidate(\"r t g\"), expected: map[string]int{\"r\": 1, \"t\": 1, \"g\": 1} },\n { actual: candidate(\"\"), expected: map[string]int{} },\n { actual: candidate(\"a\"), expected: map[string]int{\"a\": 1} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "go_test.go", - "prompt": "package pairs_sum_to_zero_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// pairs_sum_to_zero takes a list of integers as an input.\n// it returns True if there are two distinct elements in the list that\n// sum to zero, and False otherwise.\n// >>> pairs_sum_to_zero([]int{1, 3, 5, 0})\n// false\n// >>> pairs_sum_to_zero([]int{1, 3, -2, 1})\n// false\n// >>> pairs_sum_to_zero([]int{1, 2, 3, 7})\n// false\n// >>> pairs_sum_to_zero([]int{2, 4, -5, 3, 5, 7})\n// true\n// >>> pairs_sum_to_zero([]int{1})\n// false\nfunc pairs_sum_to_zero(l []int) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "func TestPairs_Sum_To_Zero(t *testing.T) {\n candidate := pairs_sum_to_zero\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 3, 5, 0}), expected: false },\n { actual: candidate([]int{1, 3, -2, 1}), expected: false },\n { actual: candidate([]int{1, 2, 3, 7}), expected: false },\n { actual: candidate([]int{2, 4, -5, 3, 5, 7}), expected: true },\n { actual: candidate([]int{1}), expected: false },\n { actual: candidate([]int{-3, 9, -1, 3, 2, 30}), expected: true },\n { actual: candidate([]int{-3, 9, -1, 3, 2, 31}), expected: true },\n { actual: candidate([]int{-3, 9, -1, 4, 2, 30}), expected: false },\n { actual: candidate([]int{-3, 9, -1, 4, 2, 31}), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "go_test.go", - "prompt": "package total_match_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that accepts two lists of strings and returns the list that has \n// total number of chars in the all strings of the list less than the other list.\n// if the two lists have the same number of chars, return the first list.\n// Examples\n// >>> total_match([]string{}, []string{})\n// []string{}\n// >>> total_match([]string{\"hi\", \"admin\"}, []string{\"hI\", \"Hi\"})\n// []string{\"hI\", \"Hi\"}\n// >>> total_match([]string{\"hi\", \"admin\"}, []string{\"hi\", \"hi\", \"admin\", \"project\"})\n// []string{\"hi\", \"admin\"}\n// >>> total_match([]string{\"hi\", \"admin\"}, []string{\"hI\", \"hi\", \"hi\"})\n// []string{\"hI\", \"hi\", \"hi\"}\n// >>> total_match([]string{\"4\"}, []string{\"1\", \"2\", \"3\", \"4\", \"5\"})\n// []string{\"4\"}\nfunc total_match(lst1 []string, lst2 []string) []string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "func TestTotal_Match(t *testing.T) {\n candidate := total_match\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]string{}, []string{}), expected: []string{} },\n { actual: candidate([]string{\"hi\", \"admin\"}, []string{\"hi\", \"hi\"}), expected: []string{\"hi\", \"hi\"} },\n { actual: candidate([]string{\"hi\", \"admin\"}, []string{\"hi\", \"hi\", \"admin\", \"project\"}), expected: []string{\"hi\", \"admin\"} },\n { actual: candidate([]string{\"4\"}, []string{\"1\", \"2\", \"3\", \"4\", \"5\"}), expected: []string{\"4\"} },\n { actual: candidate([]string{\"hi\", \"admin\"}, []string{\"hI\", \"Hi\"}), expected: []string{\"hI\", \"Hi\"} },\n { actual: candidate([]string{\"hi\", \"admin\"}, []string{\"hI\", \"hi\", \"hi\"}), expected: []string{\"hI\", \"hi\", \"hi\"} },\n { actual: candidate([]string{\"hi\", \"admin\"}, []string{\"hI\", \"hi\", \"hii\"}), expected: []string{\"hi\", \"admin\"} },\n { actual: candidate([]string{}, []string{\"this\"}), expected: []string{} },\n { actual: candidate([]string{\"this\"}, []string{}), expected: []string{} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "go_test.go", - "prompt": "package circular_shift_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Circular shift the digits of the integer x, shift the digits right by shift\n// and return the result as a string.\n// If shift > number of digits, return digits reversed.\n// >>> circular_shift(12, 1)\n// \"21\"\n// >>> circular_shift(12, 2)\n// \"12\"\nfunc circular_shift(x int, shift int) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "func TestCircular_Shift(t *testing.T) {\n candidate := circular_shift\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(100, 2), expected: \"001\" },\n { actual: candidate(12, 2), expected: \"12\" },\n { actual: candidate(97, 8), expected: \"79\" },\n { actual: candidate(12, 1), expected: \"21\" },\n { actual: candidate(11, 101), expected: \"11\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "go_test.go", - "prompt": "package monotonic_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return True is list elements are monotonically increasing or decreasing.\n// >>> monotonic([]int{1, 2, 4, 20})\n// true\n// >>> monotonic([]int{1, 20, 4, 10})\n// false\n// >>> monotonic([]int{4, 1, 0, -10})\n// true\nfunc monotonic(l []int) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "func TestMonotonic(t *testing.T) {\n candidate := monotonic\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 4, 10}), expected: true },\n { actual: candidate([]int{1, 2, 4, 20}), expected: true },\n { actual: candidate([]int{1, 20, 4, 10}), expected: false },\n { actual: candidate([]int{4, 1, 0, -10}), expected: true },\n { actual: candidate([]int{4, 1, 1, 0}), expected: true },\n { actual: candidate([]int{1, 2, 3, 2, 5, 60}), expected: false },\n { actual: candidate([]int{1, 2, 3, 4, 5, 60}), expected: true },\n { actual: candidate([]int{9, 9, 9, 9}), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "go_test.go", - "prompt": "package is_equal_to_sum_even_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n// Example\n// >>> is_equal_to_sum_even(4)\n// false\n// >>> is_equal_to_sum_even(6)\n// false\n// >>> is_equal_to_sum_even(8)\n// true\nfunc is_equal_to_sum_even(n int) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "func TestIs_Equal_To_Sum_Even(t *testing.T) {\n candidate := is_equal_to_sum_even\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(4), expected: false },\n { actual: candidate(6), expected: false },\n { actual: candidate(8), expected: true },\n { actual: candidate(10), expected: true },\n { actual: candidate(11), expected: false },\n { actual: candidate(12), expected: true },\n { actual: candidate(13), expected: false },\n { actual: candidate(16), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "go_test.go", - "prompt": "package parse_music_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Input to this function is a string representing musical notes in a special ASCII format.\n// Your task is to parse this string and return list of integers corresponding to how many beats does each\n// not last.\n// Here is a legend:\n// 'o' - whole note, lasts four beats\n// 'o|' - half note, lasts two beats\n// '.|' - quater note, lasts one beat\n// >>> parse_music(\"o o| .| o| o| .| .| .| .| o o\")\n// []int{4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4}\nfunc parse_music(music_string string) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "func TestParse_Music(t *testing.T) {\n candidate := parse_music\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: []int{} },\n { actual: candidate(\"o o o o\"), expected: []int{4, 4, 4, 4} },\n { actual: candidate(\".| .| .| .|\"), expected: []int{1, 1, 1, 1} },\n { actual: candidate(\"o| o| .| .| o o o o\"), expected: []int{2, 2, 1, 1, 4, 4, 4, 4} },\n { actual: candidate(\"o| .| o| .| o o| o o|\"), expected: []int{2, 1, 2, 1, 4, 2, 4, 2} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "go_test.go", - "prompt": "package sum_squares_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// \"\n// This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n// multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n// change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n// Examples:\n// >>> lst\n// []int{1, 2, 3}\n// >>> lst\n// int{}\n// >>> lst\n// []int{-1, -5, 2, -1, -5}\nfunc sum_squares(lst []int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "func TestSum_Squares(t *testing.T) {\n candidate := sum_squares\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 3}), expected: 6 },\n { actual: candidate([]int{1, 4, 9}), expected: 14 },\n { actual: candidate([]int{}), expected: 0 },\n { actual: candidate([]int{1, 1, 1, 1, 1, 1, 1, 1, 1}), expected: 9 },\n { actual: candidate([]int{-1, -1, -1, -1, -1, -1, -1, -1, -1}), expected: -3 },\n { actual: candidate([]int{0}), expected: 0 },\n { actual: candidate([]int{-1, -5, 2, -1, -5}), expected: -126 },\n { actual: candidate([]int{-56, -99, 1, 0, -2}), expected: 3030 },\n { actual: candidate([]int{-1, 0, 0, 0, 0, 0, 0, 0, -1}), expected: 0 },\n { actual: candidate([]int{-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37}), expected: -14196 },\n { actual: candidate([]int{-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10}), expected: -1448 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "go_test.go", - "prompt": "package triples_sum_to_zero_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// triples_sum_to_zero takes a list of integers as an input.\n// it returns True if there are three distinct elements in the list that\n// sum to zero, and False otherwise.\n// >>> triples_sum_to_zero([]int{1, 3, 5, 0})\n// false\n// >>> triples_sum_to_zero([]int{1, 3, -2, 1})\n// true\n// >>> triples_sum_to_zero([]int{1, 2, 3, 7})\n// false\n// >>> triples_sum_to_zero([]int{2, 4, -5, 3, 9, 7})\n// true\n// >>> triples_sum_to_zero([]int{1})\n// false\nfunc triples_sum_to_zero(l []int) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "func TestTriples_Sum_To_Zero(t *testing.T) {\n candidate := triples_sum_to_zero\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 3, 5, 0}), expected: false },\n { actual: candidate([]int{1, 3, 5, -1}), expected: false },\n { actual: candidate([]int{1, 3, -2, 1}), expected: true },\n { actual: candidate([]int{1, 2, 3, 7}), expected: false },\n { actual: candidate([]int{1, 2, 5, 7}), expected: false },\n { actual: candidate([]int{2, 4, -5, 3, 9, 7}), expected: true },\n { actual: candidate([]int{1}), expected: false },\n { actual: candidate([]int{1, 3, 5, -100}), expected: false },\n { actual: candidate([]int{100, 3, 5, -100}), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "go_test.go", - "prompt": "package correct_bracketing_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// brackets is a string of \"<\" and \">\".\n// return True if every opening bracket has a corresponding closing bracket.\n// >>> correct_bracketing(\"<\")\n// false\n// >>> correct_bracketing(\"<>\")\n// true\n// >>> correct_bracketing(\"<<><>>\")\n// true\n// >>> correct_bracketing(\"><<>\")\n// false\nfunc correct_bracketing(brackets string) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "func TestCorrect_Bracketing(t *testing.T) {\n candidate := correct_bracketing\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"<>\"), expected: true },\n { actual: candidate(\"<<><>>\"), expected: true },\n { actual: candidate(\"<><><<><>><>\"), expected: true },\n { actual: candidate(\"<><><<<><><>><>><<><><<>>>\"), expected: true },\n { actual: candidate(\"<<<><>>>>\"), expected: false },\n { actual: candidate(\"><<>\"), expected: false },\n { actual: candidate(\"<\"), expected: false },\n { actual: candidate(\"<<<<\"), expected: false },\n { actual: candidate(\">\"), expected: false },\n { actual: candidate(\"<<>\"), expected: false },\n { actual: candidate(\"<><><<><>><>><<>\"), expected: false },\n { actual: candidate(\"<><><<><>><>>><>\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "go_test.go", - "prompt": "package specialFilter_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that takes an array of numbers as input and returns \n// the number of elements in the array that are greater than 10 and both \n// first and last digits of a number are odd (1, 3, 5, 7, 9).\n// For example:\n// >>> specialFilter([]int{15, -73, 14, -15})\n// 1\n// >>> specialFilter([]int{33, -2, -3, 45, 21, 109})\n// 2\nfunc specialFilter(nums []int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "func TestSpecialfilter(t *testing.T) {\n candidate := specialFilter\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{5, -2, 1, -5}), expected: 0 },\n { actual: candidate([]int{15, -73, 14, -15}), expected: 1 },\n { actual: candidate([]int{33, -2, -3, 45, 21, 109}), expected: 2 },\n { actual: candidate([]int{43, -12, 93, 125, 121, 109}), expected: 4 },\n { actual: candidate([]int{71, -2, -33, 75, 21, 19}), expected: 3 },\n { actual: candidate([]int{1}), expected: 0 },\n { actual: candidate([]int{}), expected: 0 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "go_test.go", - "prompt": "package check_dict_case_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a dictionary, return True if all keys are strings in lower \n// case or all keys are strings in upper case, else return False.\n// The function should return False is the given dictionary is empty.\n// Examples:\n// >>> check_dict_case(map[string]string{\"a\": \"apple\", \"b\": \"banana\"})\n// true\n// >>> check_dict_case(map[string]string{\"a\": \"apple\", \"A\": \"banana\", \"B\": \"banana\"})\n// false\n// >>> check_dict_case(map[interface{}]string{\"a\": \"apple\", 8: \"banana\", \"a\": \"apple\"})\n// false\n// >>> check_dict_case(map[string]string{\"Name\": \"John\", \"Age\": \"36\", \"City\": \"Houston\"})\n// false\n// >>> check_dict_case(map[string]string{\"STATE\": \"NC\", \"ZIP\": \"12345\"})\n// true\nfunc check_dict_case(dict map[string]string) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "func TestCheck_Dict_Case(t *testing.T) {\n candidate := check_dict_case\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(map[string]string{\"p\": \"pineapple\", \"b\": \"banana\"}), expected: true },\n { actual: candidate(map[string]string{\"p\": \"pineapple\", \"A\": \"banana\", \"B\": \"banana\"}), expected: false },\n { actual: candidate(map[string]string{\"p\": \"pineapple\", \"5\": \"banana\", \"a\": \"apple\"}), expected: false },\n { actual: candidate(map[string]string{\"Name\": \"John\", \"Age\": \"36\", \"City\": \"Houston\"}), expected: false },\n { actual: candidate(map[string]string{\"STATE\": \"NC\", \"ZIP\": \"12345\"}), expected: true },\n { actual: candidate(map[string]string{\"fruit\": \"Orange\", \"taste\": \"Sweet\"}), expected: true },\n { actual: candidate(map[string]string{}), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "go_test.go", - "prompt": "package fibfib_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fibfib(0) == 0\n// fibfib(1) == 0\n// fibfib(2) == 1\n// fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n// Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n// >>> fibfib(1)\n// 0\n// >>> fibfib(5)\n// 4\n// >>> fibfib(8)\n// 24\nfunc fibfib(n int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "func TestFibfib(t *testing.T) {\n candidate := fibfib\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(2), expected: 1 },\n { actual: candidate(1), expected: 0 },\n { actual: candidate(5), expected: 4 },\n { actual: candidate(8), expected: 24 },\n { actual: candidate(10), expected: 81 },\n { actual: candidate(12), expected: 274 },\n { actual: candidate(14), expected: 927 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "go_test.go", - "prompt": "package sum_squares_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a list of numbers.\n// You need to return the sum of squared numbers in the given list,\n// round each element in the list to the upper int(Ceiling) first.\n// Examples:\n// >>> lst([]float64{1.0, 2.0, 3.0})\n// 14\n// >>> lst([]float64{1.0, 4.0, 9.0})\n// 98\n// >>> lst([]float64{1.0, 3.0, 5.0, 7.0})\n// 84\n// >>> lst([]float64{1.4, 4.2, 0.0})\n// 29\n// >>> lst([]float64{-2.4, 1.0, 1.0})\n// 6\nfunc sum_squares(lst []float64) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "func TestSum_Squares(t *testing.T) {\n candidate := sum_squares\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]float64{1.0, 2.0, 3.0}), expected: 14 },\n { actual: candidate([]float64{1.0, 2.0, 3.0}), expected: 14 },\n { actual: candidate([]float64{1.0, 3.0, 5.0, 7.0}), expected: 84 },\n { actual: candidate([]float64{1.4, 4.2, 0.0}), expected: 29 },\n { actual: candidate([]float64{-2.4, 1.0, 1.0}), expected: 6 },\n { actual: candidate([]float64{100.0, 1.0, 15.0, 2.0}), expected: 10230 },\n { actual: candidate([]float64{10000.0, 10000.0}), expected: 200000000 },\n { actual: candidate([]float64{-1.4, 4.6, 6.3}), expected: 75 },\n { actual: candidate([]float64{-1.4, 17.9, 18.9, 19.9}), expected: 1086 },\n { actual: candidate([]float64{0.0}), expected: 0 },\n { actual: candidate([]float64{-1.0}), expected: 1 },\n { actual: candidate([]float64{-1.0, 1.0, 0.0}), expected: 2 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_85_add", - "language": "go_test.go", - "prompt": "package add_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a non-empty list of integers lst. add the even elements that are at odd indices..\n// Examples:\n// >>> add([]int{4, 2, 6, 7})\n// 2\nfunc add(lst []int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "func TestAdd(t *testing.T) {\n candidate := add\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{4, 88}), expected: 88 },\n { actual: candidate([]int{4, 5, 6, 7, 2, 122}), expected: 122 },\n { actual: candidate([]int{4, 0, 6, 7}), expected: 0 },\n { actual: candidate([]int{4, 4, 6, 8}), expected: 12 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_34_unique", - "language": "go_test.go", - "prompt": "package unique_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return sorted unique elements in a list\n// >>> unique([]int{5, 3, 5, 2, 3, 3, 9, 0, 123})\n// []int{0, 2, 3, 5, 9, 123}\nfunc unique(l []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "func TestUnique(t *testing.T) {\n candidate := unique\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{5, 3, 5, 2, 3, 3, 9, 0, 123}), expected: []int{0, 2, 3, 5, 9, 123} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "go_test.go", - "prompt": "package fix_spaces_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a string text, replace all spaces in it with underscores, \n// and if a string has more than 2 consecutive spaces, \n// then replace all consecutive spaces with - \n// >>> fix_spaces(\" Example\")\n// \"Example\"\n// >>> fix_spaces(\" Example 1\")\n// \"Example_1\"\n// >>> fix_spaces(\" Example 2\")\n// \"_Example_2\"\n// >>> fix_spaces(\" Example 3\")\n// \"_Example-3\"\nfunc fix_spaces(text string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "func TestFix_Spaces(t *testing.T) {\n candidate := fix_spaces\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Example\"), expected: \"Example\" },\n { actual: candidate(\"Mudasir Hanif \"), expected: \"Mudasir_Hanif_\" },\n { actual: candidate(\"Yellow Yellow Dirty Fellow\"), expected: \"Yellow_Yellow__Dirty__Fellow\" },\n { actual: candidate(\"Exa mple\"), expected: \"Exa-mple\" },\n { actual: candidate(\" Exa 1 2 2 mple\"), expected: \"-Exa_1_2_2_mple\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_49_modp", - "language": "go_test.go", - "prompt": "package modp_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return 2^n modulo p (be aware of numerics).\n// >>> modp(3, 5)\n// 3\n// >>> modp(1101, 101)\n// 2\n// >>> modp(0, 101)\n// 1\n// >>> modp(3, 11)\n// 8\n// >>> modp(100, 101)\n// 1\nfunc modp(n int, p int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "func TestModp(t *testing.T) {\n candidate := modp\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3, 5), expected: 3 },\n { actual: candidate(1101, 101), expected: 2 },\n { actual: candidate(0, 101), expected: 1 },\n { actual: candidate(3, 11), expected: 8 },\n { actual: candidate(100, 101), expected: 1 },\n { actual: candidate(30, 5), expected: 4 },\n { actual: candidate(31, 5), expected: 3 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "go_test.go", - "prompt": "package valid_date_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You have to write a function which validates a given date string and\n// returns True if the date is valid otherwise False.\n// The date is valid if all of the following rules are satisfied:\n// 1. The date string is not empty.\n// 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n// 3. The months should not be less than 1 or higher than 12.\n// 4. The date should be in the format: mm-dd-yyyy\n// >>> valid_date(\"03-11-2000\")\n// true\n// >>> valid_date(\"15-01-2012\")\n// false\n// >>> valid_date(\"04-0-2040\")\n// false\n// >>> valid_date(\"06-04-2020\")\n// true\n// >>> valid_date(\"06/04/2020\")\n// false\nfunc valid_date(date string) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "func TestValid_Date(t *testing.T) {\n candidate := valid_date\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"03-11-2000\"), expected: true },\n { actual: candidate(\"15-01-2012\"), expected: false },\n { actual: candidate(\"04-0-2040\"), expected: false },\n { actual: candidate(\"06-04-2020\"), expected: true },\n { actual: candidate(\"01-01-2007\"), expected: true },\n { actual: candidate(\"03-32-2011\"), expected: false },\n { actual: candidate(\"\"), expected: false },\n { actual: candidate(\"04-31-3000\"), expected: false },\n { actual: candidate(\"06-06-2005\"), expected: true },\n { actual: candidate(\"21-31-2000\"), expected: false },\n { actual: candidate(\"04-12-2003\"), expected: true },\n { actual: candidate(\"04122003\"), expected: false },\n { actual: candidate(\"20030412\"), expected: false },\n { actual: candidate(\"2003-04\"), expected: false },\n { actual: candidate(\"2003-04-12\"), expected: false },\n { actual: candidate(\"04-2003\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "go_test.go", - "prompt": "package anti_shuffle_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that takes a string and returns an ordered version of it.\n// Ordered version of string, is a string where all words (separated by space)\n// are replaced by a new word where all the characters arranged in\n// ascending order based on ascii value.\n// Note: You should keep the order of words and blank spaces in the sentence.\n// For example:\n// >>> anti_shuffle(\"Hi\")\n// \"Hi\"\n// >>> anti_shuffle(\"hello\")\n// \"ehllo\"\n// >>> anti_shuffle(\"Hello World!!!\")\n// \"Hello !!!Wdlor\"\nfunc anti_shuffle(s string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "func TestAnti_Shuffle(t *testing.T) {\n candidate := anti_shuffle\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Hi\"), expected: \"Hi\" },\n { actual: candidate(\"hello\"), expected: \"ehllo\" },\n { actual: candidate(\"number\"), expected: \"bemnru\" },\n { actual: candidate(\"abcd\"), expected: \"abcd\" },\n { actual: candidate(\"Hello World!!!\"), expected: \"Hello !!!Wdlor\" },\n { actual: candidate(\"\"), expected: \"\" },\n { actual: candidate(\"Hi. My name is Mister Robot. How are you?\"), expected: \".Hi My aemn is Meirst .Rboot How aer ?ouy\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "go_test.go", - "prompt": "package is_sorted_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a list of numbers, return whether or not they are sorted\n// in ascending order. If list has more than 1 duplicate of the same\n// number, return False. Assume no negative numbers and only integers.\n// Examples\n// >>> is_sorted([]int{5})\n// true\n// >>> is_sorted([]int{1, 2, 3, 4, 5})\n// true\n// >>> is_sorted([]int{1, 3, 2, 4, 5})\n// false\n// >>> is_sorted([]int{1, 2, 3, 4, 5, 6})\n// true\n// >>> is_sorted([]int{1, 2, 3, 4, 5, 6, 7})\n// true\n// >>> is_sorted([]int{1, 3, 2, 4, 5, 6, 7})\n// false\n// >>> is_sorted([]int{1, 2, 2, 3, 3, 4})\n// true\n// >>> is_sorted([]int{1, 2, 2, 2, 3, 4})\n// false\nfunc is_sorted(lst []int) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "func TestIs_Sorted(t *testing.T) {\n candidate := is_sorted\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{5}), expected: true },\n { actual: candidate([]int{1, 2, 3, 4, 5}), expected: true },\n { actual: candidate([]int{1, 3, 2, 4, 5}), expected: false },\n { actual: candidate([]int{1, 2, 3, 4, 5, 6}), expected: true },\n { actual: candidate([]int{1, 2, 3, 4, 5, 6, 7}), expected: true },\n { actual: candidate([]int{1, 3, 2, 4, 5, 6, 7}), expected: false },\n { actual: candidate([]int{}), expected: true },\n { actual: candidate([]int{1}), expected: true },\n { actual: candidate([]int{3, 2, 1}), expected: false },\n { actual: candidate([]int{1, 2, 2, 2, 3, 4}), expected: false },\n { actual: candidate([]int{1, 2, 3, 3, 3, 4}), expected: false },\n { actual: candidate([]int{1, 2, 2, 3, 3, 4}), expected: true },\n { actual: candidate([]int{1, 2, 3, 4}), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "go_test.go", - "prompt": "package is_happy_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a string s.\n// Your task is to check if the string is happy or not.\n// A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n// For example:\n// >>> is_happy(\"a\")\n// false\n// >>> is_happy(\"aa\")\n// false\n// >>> is_happy(\"abcd\")\n// true\n// >>> is_happy(\"aabb\")\n// false\n// >>> is_happy(\"adb\")\n// true\n// >>> is_happy(\"xyy\")\n// false\nfunc is_happy(s string) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "func TestIs_Happy(t *testing.T) {\n candidate := is_happy\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"a\"), expected: false },\n { actual: candidate(\"aa\"), expected: false },\n { actual: candidate(\"abcd\"), expected: true },\n { actual: candidate(\"aabb\"), expected: false },\n { actual: candidate(\"adb\"), expected: true },\n { actual: candidate(\"xyy\"), expected: false },\n { actual: candidate(\"iopaxpoi\"), expected: true },\n { actual: candidate(\"iopaxioi\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "go_test.go", - "prompt": "package will_it_fly_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Write a function that returns True if the object q will fly, and False otherwise.\n// The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n// Example:\n// >>> will_it_fly([]int{1, 2}, 5)\n// false\n// # 1+2 is less than the maximum possible weight, but it's unbalanced.\n// >>> will_it_fly([]int{3, 2, 3}, 1)\n// false\n// # it's balanced, but 3+2+3 is more than the maximum possible weight.\n// >>> will_it_fly([]int{3, 2, 3}, 9)\n// true\n// # 3+2+3 is less than the maximum possible weight, and it's balanced.\n// >>> will_it_fly([]int{3}, 5)\n// true\n// # 3 is less than the maximum possible weight, and it's balanced.\nfunc will_it_fly(q []int, w int) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "func TestWill_It_Fly(t *testing.T) {\n candidate := will_it_fly\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{3, 2, 3}, 9), expected: true },\n { actual: candidate([]int{1, 2}, 5), expected: false },\n { actual: candidate([]int{3}, 5), expected: true },\n { actual: candidate([]int{3, 2, 3}, 1), expected: false },\n { actual: candidate([]int{1, 2, 3}, 6), expected: false },\n { actual: candidate([]int{5}, 5), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "go_test.go", - "prompt": "package sort_array_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given an array of non-negative integers, return a copy of the given array after sorting,\n// you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n// or sort it in descending order if the sum( first index value, last index value) is even.\n// Note:\n// * don't change the given array.\n// Examples:\n// >>> sort_array([]int{})\n// []int{}\n// >>> sort_array([]int{5})\n// []int{5}\n// >>> sort_array([]int{2, 4, 3, 0, 1, 5})\n// []int{0, 1, 2, 3, 4, 5}\n// >>> sort_array([]int{2, 4, 3, 0, 1, 5, 6})\n// []int{6, 5, 4, 3, 2, 1, 0}\nfunc sort_array(array []int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "func TestSort_Array(t *testing.T) {\n candidate := sort_array\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}), expected: []int{} },\n { actual: candidate([]int{5}), expected: []int{5} },\n { actual: candidate([]int{2, 4, 3, 0, 1, 5}), expected: []int{0, 1, 2, 3, 4, 5} },\n { actual: candidate([]int{2, 4, 3, 0, 1, 5, 6}), expected: []int{6, 5, 4, 3, 2, 1, 0} },\n { actual: candidate([]int{2, 1}), expected: []int{1, 2} },\n { actual: candidate([]int{15, 42, 87, 32, 11, 0}), expected: []int{0, 11, 15, 32, 42, 87} },\n { actual: candidate([]int{21, 14, 23, 11}), expected: []int{23, 21, 14, 11} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "go_test.go", - "prompt": "package count_up_to_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Implement a function that takes an non-negative integer and returns an array of the first n\n// integers that are prime numbers and less than n.\n// for example:\n// >>> count_up_to(5)\n// []int{2, 3}\n// >>> count_up_to(11)\n// []int{2, 3, 5, 7}\n// >>> count_up_to(0)\n// []int{}\n// >>> count_up_to(20)\n// []int{2, 3, 5, 7, 11, 13, 17, 19}\n// >>> count_up_to(1)\n// []int{}\n// >>> count_up_to(18)\n// []int{2, 3, 5, 7, 11, 13, 17}\nfunc count_up_to(n int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "func TestCount_Up_To(t *testing.T) {\n candidate := count_up_to\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5), expected: []int{2, 3} },\n { actual: candidate(6), expected: []int{2, 3, 5} },\n { actual: candidate(7), expected: []int{2, 3, 5} },\n { actual: candidate(10), expected: []int{2, 3, 5, 7} },\n { actual: candidate(0), expected: []int{} },\n { actual: candidate(22), expected: []int{2, 3, 5, 7, 11, 13, 17, 19} },\n { actual: candidate(1), expected: []int{} },\n { actual: candidate(18), expected: []int{2, 3, 5, 7, 11, 13, 17} },\n { actual: candidate(47), expected: []int{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43} },\n { actual: candidate(101), expected: []int{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "go_test.go", - "prompt": "package by_length_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n// reverse the resulting array, and then replace each digit by its corresponding name from\n// \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n// For example:\n// >>> by_length([]int{2, 1, 1, 4, 5, 8, 2, 3})\n// []string{\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"}\n// If the array is empty, return an empty array:\n// >>> by_length([]int{})\n// []string{}\n// If the array has any strange number ignore it:\n// >>> by_length([]int{1, -1, 55})\n// []string{\"One\"}\nfunc by_length(arr []int) []string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "func TestBy_Length(t *testing.T) {\n candidate := by_length\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{2, 1, 1, 4, 5, 8, 2, 3}), expected: []string{\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"} },\n { actual: candidate([]int{}), expected: []string{} },\n { actual: candidate([]int{1, -1, 55}), expected: []string{\"One\"} },\n { actual: candidate([]int{1, -1, 3, 2}), expected: []string{\"Three\", \"Two\", \"One\"} },\n { actual: candidate([]int{9, 4, 8}), expected: []string{\"Nine\", \"Eight\", \"Four\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_106_f", - "language": "go_test.go", - "prompt": "package f_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Implement the function f that takes n as a parameter,\n// 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\n// or the sum of numbers from 1 to i otherwise.\n// i starts from 1.\n// the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n// Example:\n// >>> f(5)\n// []int{1, 2, 6, 24, 15}\nfunc f(n int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "func TestF(t *testing.T) {\n candidate := f\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5), expected: []int{1, 2, 6, 24, 15} },\n { actual: candidate(7), expected: []int{1, 2, 6, 24, 15, 720, 28} },\n { actual: candidate(1), expected: []int{1} },\n { actual: candidate(3), expected: []int{1, 2, 6} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "go_test.go", - "prompt": "package fizz_buzz_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n// >>> fizz_buzz(50)\n// 0\n// >>> fizz_buzz(78)\n// 2\n// >>> fizz_buzz(79)\n// 3\nfunc fizz_buzz(n int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "func TestFizz_Buzz(t *testing.T) {\n candidate := fizz_buzz\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(50), expected: 0 },\n { actual: candidate(78), expected: 2 },\n { actual: candidate(79), expected: 3 },\n { actual: candidate(100), expected: 3 },\n { actual: candidate(200), expected: 6 },\n { actual: candidate(4000), expected: 192 },\n { actual: candidate(10000), expected: 639 },\n { actual: candidate(100000), expected: 8026 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "go_test.go", - "prompt": "package truncate_number_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a positive floating point number, it can be decomposed into\n// and integer part (largest integer smaller than given number) and decimals\n// (leftover part always smaller than 1).\n// Return the decimal part of the number.\n// >>> truncate_number(3.5)\n// 0.5\nfunc truncate_number(number float64) float64 {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "func TestTruncate_Number(t *testing.T) {\n candidate := truncate_number\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3.5), expected: 0.5 },\n { actual: candidate(1.25), expected: 0.25 },\n { actual: candidate(123.0), expected: 0.0 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "go_test.go", - "prompt": "package sum_product_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n// Empty sum should be equal to 0 and empty product should be equal to 1.\n// >>> sum_product([]int{})\n// []interface{}{0, 1}\n// >>> sum_product([]int{1, 2, 3, 4})\n// []interface{}{10, 24}\nfunc sum_product(numbers []int) []interface{} {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "func TestSum_Product(t *testing.T) {\n candidate := sum_product\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}), expected: []interface{}{0, 1} },\n { actual: candidate([]int{1, 1, 1}), expected: []interface{}{3, 1} },\n { actual: candidate([]int{100, 0}), expected: []interface{}{100, 0} },\n { actual: candidate([]int{3, 5, 7}), expected: []interface{}{15, 105} },\n { actual: candidate([]int{10}), expected: []interface{}{10, 10} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "go_test.go", - "prompt": "package get_row_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a 2 dimensional data, as a nested lists,\n// which is similar to matrix, however, unlike matrices,\n// each row may contain a different number of columns.\n// Given lst, and integer x, find integers x in the list,\n// and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n// each tuple is a coordinate - (row, columns), starting with 0.\n// Sort coordinates initially by rows in ascending order.\n// Also, sort coordinates of the row by columns in descending order.\n// Examples:\n// >>> get_row([][]int{[]int{1, 2, 3, 4, 5, 6}, []int{1, 2, 3, 4, 1, 6}, []int{1, 2, 3, 4, 5, 1}}, 1)\n// [][]int{[]interface{}{0, 0}, []interface{}{1, 4}, []interface{}{1, 0}, []interface{}{2, 5}, []interface{}{2, 0}}\n// >>> get_row([][]int{}, 1)\n// [][]interface{}{}\n// >>> get_row([]interface{}{[]interface{}{}, []int{1}, []int{1, 2, 3}}, 3)\n// [][]int{[]interface{}{2, 2}}\nfunc get_row(lst [][]int, x int) [][]interface{} {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "func TestGet_Row(t *testing.T) {\n candidate := get_row\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([][]int{[]int{1, 2, 3, 4, 5, 6}, []int{1, 2, 3, 4, 1, 6}, []int{1, 2, 3, 4, 5, 1}}, 1), expected: [][]int{[]interface{}{0, 0}, []interface{}{1, 4}, []interface{}{1, 0}, []interface{}{2, 5}, []interface{}{2, 0}} },\n { actual: candidate([][]int{[]int{1, 2, 3, 4, 5, 6}, []int{1, 2, 3, 4, 5, 6}, []int{1, 2, 3, 4, 5, 6}, []int{1, 2, 3, 4, 5, 6}, []int{1, 2, 3, 4, 5, 6}, []int{1, 2, 3, 4, 5, 6}}, 2), expected: [][]int{[]interface{}{0, 1}, []interface{}{1, 1}, []interface{}{2, 1}, []interface{}{3, 1}, []interface{}{4, 1}, []interface{}{5, 1}} },\n { actual: candidate([][]int{[]int{1, 2, 3, 4, 5, 6}, []int{1, 2, 3, 4, 5, 6}, []int{1, 1, 3, 4, 5, 6}, []int{1, 2, 1, 4, 5, 6}, []int{1, 2, 3, 1, 5, 6}, []int{1, 2, 3, 4, 1, 6}, []int{1, 2, 3, 4, 5, 1}}, 1), expected: [][]int{[]interface{}{0, 0}, []interface{}{1, 0}, []interface{}{2, 1}, []interface{}{2, 0}, []interface{}{3, 2}, []interface{}{3, 0}, []interface{}{4, 3}, []interface{}{4, 0}, []interface{}{5, 4}, []interface{}{5, 0}, []interface{}{6, 5}, []interface{}{6, 0}} },\n { actual: candidate([][]int{}, 1), expected: [][]interface{}{} },\n { actual: candidate([][]int{[]int{1}}, 2), expected: [][]interface{}{} },\n { actual: candidate([]interface{}{[]interface{}{}, []int{1}, []int{1, 2, 3}}, 3), expected: [][]int{[]interface{}{2, 2}} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_159_eat", - "language": "go_test.go", - "prompt": "package eat_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You're a hungry rabbit, and you already have eaten a certain number of carrots,\n// but now you need to eat more carrots to complete the day's meals.\n// you should return an array of [ total number of eaten carrots after your meals,\n// the number of carrots left after your meals ]\n// if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n// Example:\n// >>> eat(5, 6, 10)\n// []int{11, 4}\n// >>> eat(4, 8, 9)\n// []int{12, 1}\n// >>> eat(1, 10, 10)\n// []int{11, 0}\n// >>> eat(2, 11, 5)\n// []int{7, 0}\n// Variables:\n// @number : integer\n// the number of carrots that you have eaten.\n// @need : integer\n// the number of carrots that you need to eat.\n// @remaining : integer\n// the number of remaining carrots thet exist in stock\n// Constrain:\n// * 0 <= number <= 1000\n// * 0 <= need <= 1000\n// * 0 <= remaining <= 1000\n// Have fun :)\nfunc eat(number int, need int, remaining int) []int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "func TestEat(t *testing.T) {\n candidate := eat\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(5, 6, 10), expected: []int{11, 4} },\n { actual: candidate(4, 8, 9), expected: []int{12, 1} },\n { actual: candidate(1, 10, 10), expected: []int{11, 0} },\n { actual: candidate(2, 11, 5), expected: []int{7, 0} },\n { actual: candidate(4, 5, 7), expected: []int{9, 2} },\n { actual: candidate(4, 5, 1), expected: []int{5, 0} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_84_solve", - "language": "go_test.go", - "prompt": "package solve_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a positive integer N, return the total sum of its digits in binary.\n// Example\n// >>> solve(1000)\n// \"1\"\n// >>> solve(150)\n// \"110\"\n// >>> solve(147)\n// \"1100\"\n// Variables:\n// @N integer\n// Constraints: 0 \u2264 N \u2264 10000.\n// Output:\n// a string of binary number\nfunc solve(N int) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "func TestSolve(t *testing.T) {\n candidate := solve\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(1000), expected: \"1\" },\n { actual: candidate(150), expected: \"110\" },\n { actual: candidate(147), expected: \"1100\" },\n { actual: candidate(333), expected: \"1001\" },\n { actual: candidate(963), expected: \"10010\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "go_test.go", - "prompt": "package skjkasdkd_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given a list of integers.\n// You need to find the largest prime value and return the sum of its digits.\n// Examples:\n// >>> skjkasdkd([]int{0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3})\n// 10\n// >>> skjkasdkd([]int{1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1})\n// 25\n// >>> skjkasdkd([]int{1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3})\n// 13\n// >>> skjkasdkd([]int{0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6})\n// 11\n// >>> skjkasdkd([]int{0, 81, 12, 3, 1, 21})\n// 3\n// >>> skjkasdkd([]int{0, 8, 1, 2, 1, 7})\n// 7\nfunc skjkasdkd(lst []int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "func TestSkjkasdkd(t *testing.T) {\n candidate := skjkasdkd\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3}), expected: 10 },\n { actual: candidate([]int{1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1}), expected: 25 },\n { actual: candidate([]int{1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3}), expected: 13 },\n { actual: candidate([]int{0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6}), expected: 11 },\n { actual: candidate([]int{0, 81, 12, 3, 1, 21}), expected: 3 },\n { actual: candidate([]int{0, 8, 1, 2, 1, 7}), expected: 7 },\n { actual: candidate([]int{8191}), expected: 19 },\n { actual: candidate([]int{8191, 123456, 127, 7}), expected: 19 },\n { actual: candidate([]int{127, 97, 8192}), expected: 10 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "go_test.go", - "prompt": "package smallest_change_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given an array arr of integers, find the minimum number of elements that\n// need to be changed to make the array palindromic. A palindromic array is an array that\n// is read the same backwards and forwards. In one change, you can change one element to any other element.\n// For example:\n// >>> smallest_change([]int{1, 2, 3, 5, 4, 7, 9, 6})\n// 4\n// >>> smallest_change([]int{1, 2, 3, 4, 3, 2, 2})\n// 1\n// >>> smallest_change([]int{1, 2, 3, 2, 1})\n// 0\nfunc smallest_change(arr []int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "func TestSmallest_Change(t *testing.T) {\n candidate := smallest_change\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{1, 2, 3, 5, 4, 7, 9, 6}), expected: 4 },\n { actual: candidate([]int{1, 2, 3, 4, 3, 2, 2}), expected: 1 },\n { actual: candidate([]int{1, 4, 2}), expected: 1 },\n { actual: candidate([]int{1, 4, 4, 2}), expected: 1 },\n { actual: candidate([]int{1, 2, 3, 2, 1}), expected: 0 },\n { actual: candidate([]int{3, 1, 1, 3}), expected: 0 },\n { actual: candidate([]int{1}), expected: 0 },\n { actual: candidate([]int{0, 1}), expected: 1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "go_test.go", - "prompt": "package numerical_letter_grade_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// It is the last week of the semester and the teacher has to give the grades\n// to students. The teacher has been making her own algorithm for grading.\n// The only problem is, she has lost the code she used for grading.\n// She has given you a list of GPAs for some students and you have to write \n// a function that can output a list of letter grades using the following table:\n// GPA | Letter grade\n// 4.0 A+\n// > 3.7 A \n// > 3.3 A- \n// > 3.0 B+\n// > 2.7 B \n// > 2.3 B-\n// > 2.0 C+\n// > 1.7 C\n// > 1.3 C-\n// > 1.0 D+ \n// > 0.7 D \n// > 0.0 D-\n// 0.0 E\n// Example:\n// >>> grade_equation([]float64{4.0, 3, 1.7, 2, 3.5})\n// []string{\"A+\", \"B\", \"C-\", \"C\", \"A-\"}\nfunc numerical_letter_grade(grades []float64) []string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "func TestNumerical_Letter_Grade(t *testing.T) {\n candidate := numerical_letter_grade\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]float64{4.0, 3, 1.7, 2, 3.5}), expected: []string{\"A+\", \"B\", \"C-\", \"C\", \"A-\"} },\n { actual: candidate([]float64{1.2}), expected: []string{\"D+\"} },\n { actual: candidate([]float64{0.5}), expected: []string{\"D-\"} },\n { actual: candidate([]float64{0.0}), expected: []string{\"E\"} },\n { actual: candidate([]float64{1.0, 0.3, 1.5, 2.8, 3.3}), expected: []string{\"D\", \"D-\", \"C-\", \"B\", \"B+\"} },\n { actual: candidate([]float64{0.0, 0.7}), expected: []string{\"E\", \"D-\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "go_test.go", - "prompt": "package triangle_area_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given the lengths of the three sides of a triangle. Return the area of\n// the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n// Otherwise return -1\n// Three sides make a valid triangle when the sum of any two sides is greater \n// than the third side.\n// Example:\n// >>> triangle_area(3, 4, 5)\n// 6.0\n// >>> triangle_area(1, 2, 10)\n// -1\nfunc triangle_area(a int, b int, c int) float64 {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "func TestTriangle_Area(t *testing.T) {\n candidate := triangle_area\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(3, 4, 5), expected: 6.0 },\n { actual: candidate(1, 2, 10), expected: -1 },\n { actual: candidate(4, 8, 5), expected: 8.18 },\n { actual: candidate(2, 2, 2), expected: 1.73 },\n { actual: candidate(1, 2, 3), expected: -1 },\n { actual: candidate(10, 5, 7), expected: 16.25 },\n { actual: candidate(2, 6, 3), expected: -1 },\n { actual: candidate(1, 1, 1), expected: 0.43 },\n { actual: candidate(2, 2, 10), expected: -1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "go_test.go", - "prompt": "package same_chars_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Check if two words have the same characters.\n// >>> same_chars(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\")\n// true\n// >>> same_chars(\"abcd\", \"dddddddabc\")\n// true\n// >>> same_chars(\"dddddddabc\", \"abcd\")\n// true\n// >>> same_chars(\"eabcd\", \"dddddddabc\")\n// false\n// >>> same_chars(\"abcd\", \"dddddddabce\")\n// false\n// >>> same_chars(\"eabcdzzzz\", \"dddzzzzzzzddddabc\")\n// false\nfunc same_chars(s0 string, s1 string) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "func TestSame_Chars(t *testing.T) {\n candidate := same_chars\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\"), expected: true },\n { actual: candidate(\"abcd\", \"dddddddabc\"), expected: true },\n { actual: candidate(\"dddddddabc\", \"abcd\"), expected: true },\n { actual: candidate(\"eabcd\", \"dddddddabc\"), expected: false },\n { actual: candidate(\"abcd\", \"dddddddabcf\"), expected: false },\n { actual: candidate(\"eabcdzzzz\", \"dddzzzzzzzddddabc\"), expected: false },\n { actual: candidate(\"aabb\", \"aaccc\"), expected: false },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "go_test.go", - "prompt": "package minSubArraySum_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given an array of integers nums, find the minimum sum of any non-empty sub-array\n// of nums.\n// Example\n// >>> minSubArraySum([]int{2, 3, 4, 1, 2, 4})\n// 1\n// >>> minSubArraySum([]int{-1, -2, -3})\n// -6\nfunc minSubArraySum(nums []int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "func TestMinsubarraysum(t *testing.T) {\n candidate := minSubArraySum\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{2, 3, 4, 1, 2, 4}), expected: 1 },\n { actual: candidate([]int{-1, -2, -3}), expected: -6 },\n { actual: candidate([]int{-1, -2, -3, 2, -10}), expected: -14 },\n { actual: candidate([]int{-9999999999999999}), expected: -9999999999999999 },\n { actual: candidate([]int{0, 10, 20, 1000000}), expected: 0 },\n { actual: candidate([]int{-1, -2, -3, 10, -5}), expected: -6 },\n { actual: candidate([]int{100, -1, -2, -3, 10, -5}), expected: -6 },\n { actual: candidate([]int{10, 11, 13, 8, 3, 4}), expected: 3 },\n { actual: candidate([]int{100, -33, 32, -1, 0, -2}), expected: -33 },\n { actual: candidate([]int{-10}), expected: -10 },\n { actual: candidate([]int{7}), expected: 7 },\n { actual: candidate([]int{1, -1}), expected: -1 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "go_test.go", - "prompt": "package select_words_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a string s and a natural number n, you have been tasked to implement \n// a function that returns a list of all words from string s that contain exactly \n// n consonants, in order these words appear in the string s.\n// If the string s is empty then the function should return an empty list.\n// Note: you may assume the input string contains only letters and spaces.\n// Examples:\n// >>> select_words(\"Mary had a little lamb\", 4)\n// []string{\"little\"}\n// >>> select_words(\"Mary had a little lamb\", 3)\n// []string{\"Mary\", \"lamb\"}\n// >>> select_words(\"simple white space\", 2)\n// []string{}\n// >>> select_words(\"Hello world\", 4)\n// []string{\"world\"}\n// >>> select_words(\"Uncle sam\", 3)\n// []string{\"Uncle\"}\nfunc select_words(s string, n int) []string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "func TestSelect_Words(t *testing.T) {\n candidate := select_words\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"Mary had a little lamb\", 4), expected: []string{\"little\"} },\n { actual: candidate(\"Mary had a little lamb\", 3), expected: []string{\"Mary\", \"lamb\"} },\n { actual: candidate(\"simple white space\", 2), expected: []string{} },\n { actual: candidate(\"Hello world\", 4), expected: []string{\"world\"} },\n { actual: candidate(\"Uncle sam\", 3), expected: []string{\"Uncle\"} },\n { actual: candidate(\"\", 4), expected: []string{} },\n { actual: candidate(\"a b c d e f\", 1), expected: []string{\"b\", \"c\", \"d\", \"f\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "go_test.go", - "prompt": "package all_prefixes_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return list of all prefixes from shortest to longest of the input string\n// >>> all_prefixes(\"abc\")\n// []string{\"a\", \"ab\", \"abc\"}\nfunc all_prefixes(myString string) []string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "func TestAll_Prefixes(t *testing.T) {\n candidate := all_prefixes\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: []string{} },\n { actual: candidate(\"asdfgh\"), expected: []string{\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"} },\n { actual: candidate(\"WWW\"), expected: []string{\"W\", \"WW\", \"WWW\"} },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "go_test.go", - "prompt": "package closest_integer_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function that takes a value (string) representing a number\n// and returns the closest integer to it. If the number is equidistant\n// from two integers, round it away from zero.\n// Examples\n// >>> closest_integer(\"10\")\n// 10\n// >>> closest_integer(\"15.3\")\n// 15\n// Note:\n// Rounding away from zero means that if the given number is equidistant\n// from two integers, the one you should return is the one that is the\n// farthest from zero. For example closest_integer(\"14.5\") should\n// return 15 and closest_integer(\"-14.5\") should return -15.\nfunc closest_integer(value string) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "func TestClosest_Integer(t *testing.T) {\n candidate := closest_integer\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"10\"), expected: 10 },\n { actual: candidate(\"14.5\"), expected: 15 },\n { actual: candidate(\"-15.5\"), expected: -16 },\n { actual: candidate(\"15.3\"), expected: 15 },\n { actual: candidate(\"0\"), expected: 0 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "go_test.go", - "prompt": "package file_name_check_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Create a function which takes a string representing a file's name, and returns\n// 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n// A file's name is considered to be valid if and only if all the following conditions \n// are met:\n// - There should not be more than three digits ('0'-'9') in the file's name.\n// - The file's name contains exactly one dot '.'\n// - The substring before the dot should not be empty, and it starts with a letter from \n// the latin alphapet ('a'-'z' and 'A'-'Z').\n// - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n// Examples:\n// >>> file_name_check(\"example.txt\")\n// \"Yes\"\n// >>> file_name_check(\"1example.dll\")\n// \"No\"\nfunc file_name_check(file_name string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "func TestFile_Name_Check(t *testing.T) {\n candidate := file_name_check\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"example.txt\"), expected: \"Yes\" },\n { actual: candidate(\"1example.dll\"), expected: \"No\" },\n { actual: candidate(\"s1sdf3.asd\"), expected: \"No\" },\n { actual: candidate(\"K.dll\"), expected: \"Yes\" },\n { actual: candidate(\"MY16FILE3.exe\"), expected: \"Yes\" },\n { actual: candidate(\"His12FILE94.exe\"), expected: \"No\" },\n { actual: candidate(\"_Y.txt\"), expected: \"No\" },\n { actual: candidate(\"?aREYA.exe\"), expected: \"No\" },\n { actual: candidate(\"/this_is_valid.dll\"), expected: \"No\" },\n { actual: candidate(\"this_is_valid.wow\"), expected: \"No\" },\n { actual: candidate(\"this_is_valid.txt\"), expected: \"Yes\" },\n { actual: candidate(\"this_is_valid.txtexe\"), expected: \"No\" },\n { actual: candidate(\"#this2_i4s_5valid.ten\"), expected: \"No\" },\n { actual: candidate(\"@this1_is6_valid.exe\"), expected: \"No\" },\n { actual: candidate(\"this_is_12valid.6exe4.txt\"), expected: \"No\" },\n { actual: candidate(\"all.exe.txt\"), expected: \"No\" },\n { actual: candidate(\"I563_No.exe\"), expected: \"Yes\" },\n { actual: candidate(\"Is3youfault.txt\"), expected: \"Yes\" },\n { actual: candidate(\"no_one#knows.dll\"), expected: \"Yes\" },\n { actual: candidate(\"1I563_Yes3.exe\"), expected: \"No\" },\n { actual: candidate(\"I563_Yes3.txtt\"), expected: \"No\" },\n { actual: candidate(\"final..txt\"), expected: \"No\" },\n { actual: candidate(\"final132\"), expected: \"No\" },\n { actual: candidate(\"_f4indsartal132.\"), expected: \"No\" },\n { actual: candidate(\".txt\"), expected: \"No\" },\n { actual: candidate(\"s.\"), expected: \"No\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "go_test.go", - "prompt": "package intersection_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You are given two intervals,\n// where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n// The given intervals are closed which means that the interval (start, end)\n// includes both start and end.\n// For each given interval, it is assumed that its start is less or equal its end.\n// Your task is to determine whether the length of intersection of these two \n// intervals is a prime number.\n// Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n// which its length is 1, which not a prime number.\n// If the length of the intersection is a prime number, return \"YES\",\n// otherwise, return \"NO\".\n// If the two intervals don't intersect, return \"NO\".\n// [input/output] samples:\n// >>> intersection([]interface{}{1, 2}, []interface{}{2, 3})\n// \"NO\"\n// >>> intersection([]interface{}{-1, 1}, []interface{}{0, 4})\n// \"NO\"\n// >>> intersection([]interface{}{-3, -1}, []interface{}{-5, 5})\n// \"YES\"\nfunc intersection(interval1 []interface{}, interval2 []interface{}) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "func TestIntersection(t *testing.T) {\n candidate := intersection\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]interface{}{1, 2}, []interface{}{2, 3}), expected: \"NO\" },\n { actual: candidate([]interface{}{-1, 1}, []interface{}{0, 4}), expected: \"NO\" },\n { actual: candidate([]interface{}{-3, -1}, []interface{}{-5, 5}), expected: \"YES\" },\n { actual: candidate([]interface{}{-2, 2}, []interface{}{-4, 0}), expected: \"YES\" },\n { actual: candidate([]interface{}{-11, 2}, []interface{}{-1, -1}), expected: \"NO\" },\n { actual: candidate([]interface{}{1, 2}, []interface{}{3, 5}), expected: \"NO\" },\n { actual: candidate([]interface{}{1, 2}, []interface{}{1, 2}), expected: \"NO\" },\n { actual: candidate([]interface{}{-2, -2}, []interface{}{-3, -2}), expected: \"NO\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "go_test.go", - "prompt": "package largest_prime_factor_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Return the largest prime factor of n. Assume n > 1 and is not a prime.\n// >>> largest_prime_factor(13195)\n// 29\n// >>> largest_prime_factor(2048)\n// 2\nfunc largest_prime_factor(n int) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "func TestLargest_Prime_Factor(t *testing.T) {\n candidate := largest_prime_factor\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(15), expected: 5 },\n { actual: candidate(27), expected: 3 },\n { actual: candidate(63), expected: 7 },\n { actual: candidate(330), expected: 11 },\n { actual: candidate(13195), expected: 29 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "go_test.go", - "prompt": "package count_distinct_characters_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a string, find out how many distinct characters (regardless of case) does it consist of\n// >>> count_distinct_characters(\"xyzXYZ\")\n// 3\n// >>> count_distinct_characters(\"Jerry\")\n// 4\nfunc count_distinct_characters(myString string) int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "func TestCount_Distinct_Characters(t *testing.T) {\n candidate := count_distinct_characters\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: 0 },\n { actual: candidate(\"abcde\"), expected: 5 },\n { actual: candidate(\"abcdecadeCADE\"), expected: 5 },\n { actual: candidate(\"aaaaAAAAaaaa\"), expected: 1 },\n { actual: candidate(\"Jerry jERRY JeRRRY\"), expected: 5 },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "go_test.go", - "prompt": "package below_zero_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// You're given a list of deposit and withdrawal operations on a bank account that starts with\n// zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n// at that point function should return True. Otherwise it should return False.\n// >>> below_zero([]int{1, 2, 3})\n// false\n// >>> below_zero([]int{1, 2, -4, 5})\n// true\nfunc below_zero(operations []int) bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "func TestBelow_Zero(t *testing.T) {\n candidate := below_zero\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate([]int{}), expected: false },\n { actual: candidate([]int{1, 2, -3, 1, 2, -3}), expected: false },\n { actual: candidate([]int{1, 2, -4, 5, 6}), expected: true },\n { actual: candidate([]int{1, -1, 2, -2, 5, -5, 4, -4}), expected: false },\n { actual: candidate([]int{1, -1, 2, -2, 5, -5, 4, -5}), expected: true },\n { actual: candidate([]int{1, -2, 2, -2, 5, -5, 4, -4}), expected: true },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "go_test.go", - "prompt": "package make_palindrome_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Find the shortest palindrome that begins with a supplied string.\n// Algorithm idea is simple:\n// - Find the longest postfix of supplied string that is a palindrome.\n// - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n// >>> make_palindrome(\"\")\n// \"\"\n// >>> make_palindrome(\"cat\")\n// \"catac\"\n// >>> make_palindrome(\"cata\")\n// \"catac\"\nfunc make_palindrome(myString string) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "func TestMake_Palindrome(t *testing.T) {\n candidate := make_palindrome\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(\"\"), expected: \"\" },\n { actual: candidate(\"x\"), expected: \"x\" },\n { actual: candidate(\"xyz\"), expected: \"xyzyx\" },\n { actual: candidate(\"xyx\"), expected: \"xyx\" },\n { actual: candidate(\"jerry\"), expected: \"jerryrrej\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "go_test.go", - "prompt": "package int_to_mini_roman_test\n\nimport (\n \"testing\"\n \"fmt\"\n)\n\n// Given a positive integer, obtain its roman numeral equivalent as a string,\n// and return it in lowercase.\n// Restrictions: 1 <= num <= 1000\n// Examples:\n// >>> int_to_mini_roman(19)\n// \"xix\"\n// >>> int_to_mini_roman(152)\n// \"clii\"\n// >>> int_to_mini_roman(426)\n// \"cdxxvi\"\nfunc int_to_mini_roman(number int) string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "func TestInt_To_Mini_Roman(t *testing.T) {\n candidate := int_to_mini_roman\n\ttype test struct {\n\t\tactual interface{}\n\t\texpected interface{}\n\t}\n tests := []test{\n { actual: candidate(19), expected: \"xix\" },\n { actual: candidate(152), expected: \"clii\" },\n { actual: candidate(251), expected: \"ccli\" },\n { actual: candidate(426), expected: \"cdxxvi\" },\n { actual: candidate(500), expected: \"d\" },\n { actual: candidate(1), expected: \"i\" },\n { actual: candidate(4), expected: \"iv\" },\n { actual: candidate(43), expected: \"xliii\" },\n { actual: candidate(90), expected: \"xc\" },\n { actual: candidate(94), expected: \"xciv\" },\n { actual: candidate(532), expected: \"dxxxii\" },\n { actual: candidate(900), expected: \"cm\" },\n { actual: candidate(994), expected: \"cmxciv\" },\n { actual: candidate(1000), expected: \"m\" },\n }\n\n\tfor i, tc := range tests {\n\t\tt.Run(fmt.Sprintf(\"test num % d\", i), func(t *testing.T) {\n\t\t\tif fmt.Sprintf(\"%v\", tc.actual) != fmt.Sprintf(\"%v\", tc.expected) {\n\t\t\t\tt.Errorf(\"expected '%s', got '%s'\", tc.expected, tc.actual)\n\t\t\t}\n\t\t})\n\t}\n}\n", - "stop_tokens": [ - "\nfunc", - "struct", - "\n// " - ] - } -] \ No newline at end of file diff --git a/data/java-keep.json b/data/java-keep.json deleted file mode 100644 index 80dff9b4042bf323c55fd0872b04070ef081c92a..0000000000000000000000000000000000000000 --- a/data/java-keep.json +++ /dev/null @@ -1,1898 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // For a given number n, find the largest number that divides n evenly, smaller than n\n // >>> largest_divisor(15)\n // 5\n public static long largestDivisor(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(largestDivisor((3l)) == (1l));\n assert(largestDivisor((7l)) == (1l));\n assert(largestDivisor((10l)) == (5l));\n assert(largestDivisor((100l)) == (50l));\n assert(largestDivisor((49l)) == (7l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_47_median", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return median of elements in the list l.\n // >>> median([3, 1, 2, 4, 5])\n // 3\n // >>> median([-10, 4, 6, 1000, 10, 20])\n // 15.0\n public static float median(ArrayList l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(median((new ArrayList(Arrays.asList((long)3l, (long)1l, (long)2l, (long)4l, (long)5l)))) == (float)3l);\n assert(median((new ArrayList(Arrays.asList((long)-10l, (long)4l, (long)6l, (long)1000l, (long)10l, (long)20l)))) == (8.0f));\n assert(median((new ArrayList(Arrays.asList((long)5l)))) == (float)5l);\n assert(median((new ArrayList(Arrays.asList((long)6l, (long)5l)))) == (5.5f));\n assert(median((new ArrayList(Arrays.asList((long)8l, (long)1l, (long)3l, (long)9l, (long)9l, (long)2l, (long)7l)))) == (float)7l);\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given two lists operator, and operand. The first list has basic algebra operations, and \n // the second list is a list of integers. Use the two given lists to build the algebric \n // expression and return the evaluation of this expression.\n // The basic algebra operations:\n // Addition ( + ) \n // Subtraction ( - ) \n // Multiplication ( * ) \n // Floor division ( // ) \n // Exponentiation ( ** ) \n // Example:\n // operator['+', '*', '-']\n // array = [2, 3, 4, 5]\n // result = 2 + 3 * 4 - 5\n // => result = 9\n // Note:\n // The length of operator list is equal to the length of operand list minus one.\n // Operand is a list of of non-negative integers.\n // Operator list has at least one operator, and operand list has at least two operands.\n public static long doAlgebra(ArrayList op, ArrayList operand) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(doAlgebra((new ArrayList(Arrays.asList((String)\"**\", (String)\"*\", (String)\"+\"))), (new ArrayList(Arrays.asList((long)2l, (long)3l, (long)4l, (long)5l)))) == (37l));\n assert(doAlgebra((new ArrayList(Arrays.asList((String)\"+\", (String)\"*\", (String)\"-\"))), (new ArrayList(Arrays.asList((long)2l, (long)3l, (long)4l, (long)5l)))) == (9l));\n assert(doAlgebra((new ArrayList(Arrays.asList((String)\"//\", (String)\"*\"))), (new ArrayList(Arrays.asList((long)7l, (long)3l, (long)4l)))) == (8l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return maximum element in the list.\n // >>> max_element([1, 2, 3])\n // 3\n // >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n // 123\n public static long maxElement(ArrayList l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(maxElement((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)))) == (3l));\n assert(maxElement((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)-5l, (long)2l, (long)-3l, (long)3l, (long)9l, (long)0l, (long)124l, (long)1l, (long)-10l)))) == (124l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function which returns the largest index of an element which\n // is not greater than or equal to the element immediately preceding it. If\n // no such element exists then return -1. The given array will not contain\n // duplicate values.\n // Examples:\n // can_arrange([1,2,4,3,5]) = 3\n // can_arrange([1,2,3]) = -1\n public static long canArrange(ArrayList arr) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(canArrange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)4l, (long)3l, (long)5l)))) == (3l));\n assert(canArrange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)4l, (long)5l)))) == (-1l));\n assert(canArrange((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)2l, (long)5l, (long)6l, (long)7l, (long)8l, (long)9l, (long)10l)))) == (2l));\n assert(canArrange((new ArrayList(Arrays.asList((long)4l, (long)8l, (long)5l, (long)7l, (long)3l)))) == (4l));\n assert(canArrange((new ArrayList(Arrays.asList()))) == (-1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Imagine a road that's a perfectly straight infinitely long line.\n // n cars are driving left to right; simultaneously, a different set of n cars\n // are driving right to left. The two sets of cars start out being very far from\n // each other. All cars move in the same speed. Two cars are said to collide\n // when a car that's moving left to right hits a car that's moving right to left.\n // However, the cars are infinitely sturdy and strong; as a result, they continue moving\n // in their trajectory as if they did not collide.\n // This function outputs the number of such collisions.\n public static long carRaceCollision(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(carRaceCollision((2l)) == (4l));\n assert(carRaceCollision((3l)) == (9l));\n assert(carRaceCollision((4l)) == (16l));\n assert(carRaceCollision((8l)) == (64l));\n assert(carRaceCollision((10l)) == (100l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function that returns True if the last character\n // of a given string is an alphabetical character and is not\n // a part of a word, and False otherwise.\n // Note: \"word\" is a group of characters separated by space.\n // Examples:\n // check_if_last_char_is_a_letter(\"apple pie\") \u279e False\n // check_if_last_char_is_a_letter(\"apple pi e\") \u279e True\n // check_if_last_char_is_a_letter(\"apple pi e \") \u279e False\n // check_if_last_char_is_a_letter(\"\") \u279e False\n public static boolean checkIfLastCharIsALetter(String txt) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(checkIfLastCharIsALetter((\"apple\")) == (false));\n assert(checkIfLastCharIsALetter((\"apple pi e\")) == (true));\n assert(checkIfLastCharIsALetter((\"eeeee\")) == (false));\n assert(checkIfLastCharIsALetter((\"A\")) == (true));\n assert(checkIfLastCharIsALetter((\"Pumpkin pie \")) == (false));\n assert(checkIfLastCharIsALetter((\"Pumpkin pie 1\")) == (false));\n assert(checkIfLastCharIsALetter((\"\")) == (false));\n assert(checkIfLastCharIsALetter((\"eeeee e \")) == (false));\n assert(checkIfLastCharIsALetter((\"apple pie\")) == (false));\n assert(checkIfLastCharIsALetter((\"apple pi e \")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return true if a given number is prime, and false otherwise.\n // >>> is_prime(6)\n // False\n // >>> is_prime(101)\n // True\n // >>> is_prime(11)\n // True\n // >>> is_prime(13441)\n // True\n // >>> is_prime(61)\n // True\n // >>> is_prime(4)\n // False\n // >>> is_prime(1)\n // False\n public static boolean isPrime(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(isPrime((6l)) == (false));\n assert(isPrime((101l)) == (true));\n assert(isPrime((11l)) == (true));\n assert(isPrime((13441l)) == (true));\n assert(isPrime((61l)) == (true));\n assert(isPrime((4l)) == (false));\n assert(isPrime((1l)) == (false));\n assert(isPrime((5l)) == (true));\n assert(isPrime((11l)) == (true));\n assert(isPrime((17l)) == (true));\n assert(isPrime((85l)) == (false));\n assert(isPrime((77l)) == (false));\n assert(isPrime((255379l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a list of positive integers x. return a sorted list of all \n // elements that hasn't any even digit.\n // Note: Returned list should be sorted in increasing order.\n // For example:\n // >>> unique_digits([15, 33, 1422, 1])\n // [1, 15, 33]\n // >>> unique_digits([152, 323, 1422, 10])\n // []\n public static ArrayList uniqueDigits(ArrayList x) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(uniqueDigits((new ArrayList(Arrays.asList((long)15l, (long)33l, (long)1422l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)15l, (long)33l)))));\n assert(uniqueDigits((new ArrayList(Arrays.asList((long)152l, (long)323l, (long)1422l, (long)10l)))).equals((new ArrayList(Arrays.asList()))));\n assert(uniqueDigits((new ArrayList(Arrays.asList((long)12345l, (long)2033l, (long)111l, (long)151l)))).equals((new ArrayList(Arrays.asList((long)111l, (long)151l)))));\n assert(uniqueDigits((new ArrayList(Arrays.asList((long)135l, (long)103l, (long)31l)))).equals((new ArrayList(Arrays.asList((long)31l, (long)135l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Input are two strings a and b consisting only of 1s and 0s.\n // Perform binary XOR on these inputs and return result also as a string.\n // >>> string_xor('010', '110')\n // '100'\n public static String stringXor(String a, String b) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(stringXor((\"111000\"), (\"101010\")).equals((\"010010\")));\n assert(stringXor((\"1\"), (\"1\")).equals((\"0\")));\n assert(stringXor((\"0101\"), (\"0000\")).equals((\"0101\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // sum_to_n is a function that sums numbers from 1 to n.\n // >>> sum_to_n(30)\n // 465\n // >>> sum_to_n(100)\n // 5050\n // >>> sum_to_n(5)\n // 15\n // >>> sum_to_n(10)\n // 55\n // >>> sum_to_n(1)\n // 1\n public static long sumToN(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sumToN((1l)) == (1l));\n assert(sumToN((6l)) == (21l));\n assert(sumToN((11l)) == (66l));\n assert(sumToN((30l)) == (465l));\n assert(sumToN((100l)) == (5050l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a list of numbers, return the sum of squares of the numbers\n // in the list that are odd. Ignore numbers that are negative or not integers.\n // double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10\n // double_the_difference([-1, -2, 0]) == 0\n // double_the_difference([9, -2]) == 81\n // double_the_difference([0]) == 0 \n // If the input list is empty, return 0.\n public static long doubleTheDifference(ArrayList lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(doubleTheDifference((new ArrayList(Arrays.asList()))) == (0l));\n assert(doubleTheDifference((new ArrayList(Arrays.asList((float)5.0f, (float)4.0f)))) == (25l));\n assert(doubleTheDifference((new ArrayList(Arrays.asList((float)0.1f, (float)0.2f, (float)0.3f)))) == (0l));\n assert(doubleTheDifference((new ArrayList(Arrays.asList((float)-10.0f, (float)-20.0f, (float)-30.0f)))) == (0l));\n assert(doubleTheDifference((new ArrayList(Arrays.asList((float)-1.0f, (float)-2.0f, (float)8.0f)))) == (0l));\n assert(doubleTheDifference((new ArrayList(Arrays.asList((float)0.2f, (float)3.0f, (float)5.0f)))) == (34l));\n assert(doubleTheDifference((new ArrayList(Arrays.asList((float)-9.0f, (float)-7.0f, (float)-5.0f, (float)-3.0f, (float)-1.0f, (float)1.0f, (float)3.0f, (float)5.0f, (float)7.0f, (float)9.0f)))) == (165l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return length of given string\n // >>> strlen('')\n // 0\n // >>> strlen('abc')\n // 3\n public static long strlen(String string) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(strlen((\"\")) == (0l));\n assert(strlen((\"x\")) == (1l));\n assert(strlen((\"asdasnakj\")) == (9l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You'll be given a string of words, and your task is to count the number\n // of boredoms. A boredom is a sentence that starts with the word \"I\".\n // Sentences are delimited by '.', '?' or '!'.\n // For example:\n // >>> is_bored(\"Hello world\")\n // 0\n // >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n // 1\n public static long isBored(String S) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(isBored((\"Hello world\")) == (0l));\n assert(isBored((\"Is the sky blue?\")) == (0l));\n assert(isBored((\"I love It !\")) == (1l));\n assert(isBored((\"bIt\")) == (0l));\n assert(isBored((\"I feel good today. I will be productive. will kill It\")) == (2l));\n assert(isBored((\"You and I are going for a walk\")) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function vowels_count which takes a string representing\n // a word as input and returns the number of vowels in the string.\n // Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n // vowel, but only when it is at the end of the given word.\n // Example:\n // >>> vowels_count(\"abcde\")\n // 2\n // >>> vowels_count(\"ACEDY\")\n // 3\n public static long vowelsCount(String s) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(vowelsCount((\"abcde\")) == (2l));\n assert(vowelsCount((\"Alone\")) == (3l));\n assert(vowelsCount((\"key\")) == (2l));\n assert(vowelsCount((\"bye\")) == (1l));\n assert(vowelsCount((\"keY\")) == (2l));\n assert(vowelsCount((\"bYe\")) == (1l));\n assert(vowelsCount((\"ACEDY\")) == (3l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return n-th Fibonacci number.\n // >>> fib(10)\n // 55\n // >>> fib(1)\n // 1\n // >>> fib(8)\n // 21\n public static long fib(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(fib((10l)) == (55l));\n assert(fib((1l)) == (1l));\n assert(fib((8l)) == (21l));\n assert(fib((11l)) == (89l));\n assert(fib((12l)) == (144l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Your task is to implement a function that will simplify the expression\n // x * n. The function returns True if x * n evaluates to a whole number and False\n // otherwise. Both x and n, are string representation of a fraction, and have the following format,\n // / where both numerator and denominator are positive whole numbers.\n // You can assume that x, and n are valid fractions, and do not have zero as denominator.\n // simplify(\"1/5\", \"5/1\") = True\n // simplify(\"1/6\", \"2/1\") = False\n // simplify(\"7/10\", \"10/2\") = False\n public static boolean simplify(String x, String n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(simplify((\"1/5\"), (\"5/1\")) == (true));\n assert(simplify((\"1/6\"), (\"2/1\")) == (false));\n assert(simplify((\"5/1\"), (\"3/1\")) == (true));\n assert(simplify((\"7/10\"), (\"10/2\")) == (false));\n assert(simplify((\"2/10\"), (\"50/10\")) == (true));\n assert(simplify((\"7/2\"), (\"4/2\")) == (true));\n assert(simplify((\"11/6\"), (\"6/1\")) == (true));\n assert(simplify((\"2/3\"), (\"5/2\")) == (false));\n assert(simplify((\"5/2\"), (\"3/5\")) == (false));\n assert(simplify((\"2/4\"), (\"8/4\")) == (true));\n assert(simplify((\"2/4\"), (\"4/2\")) == (true));\n assert(simplify((\"1/5\"), (\"5/1\")) == (true));\n assert(simplify((\"1/5\"), (\"1/5\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a string s, count the number of uppercase vowels in even indices.\n // For example:\n // count_upper('aBCdEf') returns 1\n // count_upper('abcdefg') returns 0\n // count_upper('dBBE') returns 0\n public static long countUpper(String s) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(countUpper((\"aBCdEf\")) == (1l));\n assert(countUpper((\"abcdefg\")) == (0l));\n assert(countUpper((\"dBBE\")) == (0l));\n assert(countUpper((\"B\")) == (0l));\n assert(countUpper((\"U\")) == (1l));\n assert(countUpper((\"\")) == (0l));\n assert(countUpper((\"EEEE\")) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a rectangular grid of wells. Each row represents a single well,\n // and each 1 in a row represents a single unit of water.\n // Each well has a corresponding bucket that can be used to extract water from it, \n // and all buckets have the same capacity.\n // Your task is to use the buckets to empty the wells.\n // Output the number of times you need to lower the buckets.\n // Example 1:\n // Input: \n // grid : [[0,0,1,0], [0,1,0,0], [1,1,1,1]]\n // bucket_capacity : 1\n // Output: 6\n // Example 2:\n // Input: \n // grid : [[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]]\n // bucket_capacity : 2\n // Output: 5\n // Example 3:\n // Input: \n // grid : [[0,0,0], [0,0,0]]\n // bucket_capacity : 5\n // Output: 0\n // Constraints:\n // * all wells have the same length\n // * 1 <= grid.length <= 10^2\n // * 1 <= grid[:,1].length <= 10^2\n // * grid[i][j] -> 0 | 1\n // * 1 <= capacity <= 10\n public static long maxFill(ArrayList> grid, long capacity) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(maxFill((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)0l, (long)0l, (long)1l, (long)0l)), (ArrayList)new ArrayList(Arrays.asList((long)0l, (long)1l, (long)0l, (long)0l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l))))), (1l)) == (6l));\n assert(maxFill((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)0l, (long)0l, (long)1l, (long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l, (long)0l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)0l, (long)1l, (long)1l, (long)1l))))), (2l)) == (5l));\n assert(maxFill((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l)), (ArrayList)new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l))))), (5l)) == (0l));\n assert(maxFill((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l))))), (2l)) == (4l));\n assert(maxFill((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l))))), (9l)) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given an array arr of integers and a positive integer k, return a sorted list \n // of length k with the maximum k numbers in arr.\n // Example 1:\n // Input: arr = [-3, -4, 5], k = 3\n // Output: [-4, -3, 5]\n // Example 2:\n // Input: arr = [4, -4, 4], k = 2\n // Output: [4, 4]\n // Example 3:\n // Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1\n // Output: [2]\n // Note:\n // 1. The length of the array will be in the range of [1, 1000].\n // 2. The elements in the array will be in the range of [-1000, 1000].\n // 3. 0 <= k <= len(arr)\n public static ArrayList maximum(ArrayList arr, long k) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(maximum((new ArrayList(Arrays.asList((long)-3l, (long)-4l, (long)5l))), (3l)).equals((new ArrayList(Arrays.asList((long)-4l, (long)-3l, (long)5l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)4l, (long)-4l, (long)4l))), (2l)).equals((new ArrayList(Arrays.asList((long)4l, (long)4l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)-3l, (long)2l, (long)1l, (long)2l, (long)-1l, (long)-2l, (long)1l))), (1l)).equals((new ArrayList(Arrays.asList((long)2l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)123l, (long)-123l, (long)20l, (long)0l, (long)1l, (long)2l, (long)-3l))), (3l)).equals((new ArrayList(Arrays.asList((long)2l, (long)20l, (long)123l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)-123l, (long)20l, (long)0l, (long)1l, (long)2l, (long)-3l))), (4l)).equals((new ArrayList(Arrays.asList((long)0l, (long)1l, (long)2l, (long)20l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)5l, (long)15l, (long)0l, (long)3l, (long)-13l, (long)-8l, (long)0l))), (7l)).equals((new ArrayList(Arrays.asList((long)-13l, (long)-8l, (long)0l, (long)0l, (long)3l, (long)5l, (long)15l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)-1l, (long)0l, (long)2l, (long)5l, (long)3l, (long)-10l))), (2l)).equals((new ArrayList(Arrays.asList((long)3l, (long)5l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)1l, (long)0l, (long)5l, (long)-7l))), (1l)).equals((new ArrayList(Arrays.asList((long)5l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)4l, (long)-4l))), (2l)).equals((new ArrayList(Arrays.asList((long)-4l, (long)4l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)-10l, (long)10l))), (2l)).equals((new ArrayList(Arrays.asList((long)-10l, (long)10l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)-23l, (long)243l, (long)-400l, (long)0l))), (0l)).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that takes a message, and encodes in such a \n // way that it swaps case of all letters, replaces all vowels in \n // the message with the letter that appears 2 places ahead of that \n // vowel in the english alphabet. \n // Assume only letters. \n // Examples:\n // >>> encode('test')\n // 'TGST'\n // >>> encode('This is a message')\n // 'tHKS KS C MGSSCGG'\n public static String encode(String message) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(encode((\"TEST\")).equals((\"tgst\")));\n assert(encode((\"Mudasir\")).equals((\"mWDCSKR\")));\n assert(encode((\"YES\")).equals((\"ygs\")));\n assert(encode((\"This is a message\")).equals((\"tHKS KS C MGSSCGG\")));\n assert(encode((\"I DoNt KnOw WhAt tO WrItE\")).equals((\"k dQnT kNqW wHcT Tq wRkTg\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // remove_vowels is a function that takes string and returns string without vowels.\n // >>> remove_vowels('')\n // ''\n // >>> remove_vowels('abcdef')\n // 'bcdf'\n // >>> remove_vowels('aaaaa')\n // ''\n // >>> remove_vowels('aaBAA')\n // 'B'\n // >>> remove_vowels('zbcd')\n // 'zbcd'\n public static String removeVowels(String text) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(removeVowels((\"\")).equals((\"\")));\n assert(removeVowels((\"abcdef\\nghijklm\")).equals((\"bcdf\\nghjklm\")));\n assert(removeVowels((\"fedcba\")).equals((\"fdcb\")));\n assert(removeVowels((\"eeeee\")).equals((\"\")));\n assert(removeVowels((\"acBAA\")).equals((\"cB\")));\n assert(removeVowels((\"EcBOO\")).equals((\"cB\")));\n assert(removeVowels((\"ybcd\")).equals((\"ybcd\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return only positive numbers in the list.\n // >>> get_positive([-1, 2, -4, 5, 6])\n // [2, 5, 6]\n // >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n // [5, 3, 2, 3, 9, 123, 1]\n public static ArrayList getPositive(ArrayList l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(getPositive((new ArrayList(Arrays.asList((long)-1l, (long)-2l, (long)4l, (long)5l, (long)6l)))).equals((new ArrayList(Arrays.asList((long)4l, (long)5l, (long)6l)))));\n assert(getPositive((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)-5l, (long)2l, (long)3l, (long)3l, (long)9l, (long)0l, (long)123l, (long)1l, (long)-10l)))).equals((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)2l, (long)3l, (long)3l, (long)9l, (long)123l, (long)1l)))));\n assert(getPositive((new ArrayList(Arrays.asList((long)-1l, (long)-2l)))).equals((new ArrayList(Arrays.asList()))));\n assert(getPositive((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n // >>> string_sequence(0)\n // '0'\n // >>> string_sequence(5)\n // '0 1 2 3 4 5'\n public static String stringSequence(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(stringSequence((0l)).equals((\"0\")));\n assert(stringSequence((3l)).equals((\"0 1 2 3\")));\n assert(stringSequence((10l)).equals((\"0 1 2 3 4 5 6 7 8 9 10\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a positive integer n, you have to make a pile of n levels of stones.\n // The first level has n stones.\n // The number of stones in the next level is:\n // - the next odd number if n is odd.\n // - the next even number if n is even.\n // Return the number of stones in each level in a list, where element at index\n // i represents the number of stones in the level (i+1).\n // Examples:\n // >>> make_a_pile(3)\n // [3, 5, 7]\n public static ArrayList makeAPile(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(makeAPile((3l)).equals((new ArrayList(Arrays.asList((long)3l, (long)5l, (long)7l)))));\n assert(makeAPile((4l)).equals((new ArrayList(Arrays.asList((long)4l, (long)6l, (long)8l, (long)10l)))));\n assert(makeAPile((5l)).equals((new ArrayList(Arrays.asList((long)5l, (long)7l, (long)9l, (long)11l, (long)13l)))));\n assert(makeAPile((6l)).equals((new ArrayList(Arrays.asList((long)6l, (long)8l, (long)10l, (long)12l, (long)14l, (long)16l)))));\n assert(makeAPile((8l)).equals((new ArrayList(Arrays.asList((long)8l, (long)10l, (long)12l, (long)14l, (long)16l, (long)18l, (long)20l, (long)22l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Task\n // 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\n // then check if the result string is palindrome.\n // A string is called palindrome if it reads the same backward as forward.\n // You should return a tuple containing the result string and True/False for the check.\n // Example\n // For s = \"abcde\", c = \"ae\", the result should be ('bcd',False)\n // For s = \"abcdef\", c = \"b\" the result should be ('acdef',False)\n // For s = \"abcdedcba\", c = \"ab\", the result should be ('cdedc',True)\n public static Pair reverseDelete(String s, String c) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(reverseDelete((\"abcde\"), (\"ae\")).equals((Pair.with(\"bcd\", false))));\n assert(reverseDelete((\"abcdef\"), (\"b\")).equals((Pair.with(\"acdef\", false))));\n assert(reverseDelete((\"abcdedcba\"), (\"ab\")).equals((Pair.with(\"cdedc\", true))));\n assert(reverseDelete((\"dwik\"), (\"w\")).equals((Pair.with(\"dik\", false))));\n assert(reverseDelete((\"a\"), (\"a\")).equals((Pair.with(\"\", true))));\n assert(reverseDelete((\"abcdedcba\"), (\"\")).equals((Pair.with(\"abcdedcba\", true))));\n assert(reverseDelete((\"abcdedcba\"), (\"v\")).equals((Pair.with(\"abcdedcba\", true))));\n assert(reverseDelete((\"vabba\"), (\"v\")).equals((Pair.with(\"abba\", true))));\n assert(reverseDelete((\"mamma\"), (\"mia\")).equals((Pair.with(\"\", true))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n // >>> flip_case('Hello')\n // 'hELLO'\n public static String flipCase(String string) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(flipCase((\"\")).equals((\"\")));\n assert(flipCase((\"Hello!\")).equals((\"hELLO!\")));\n assert(flipCase((\"These violent delights have violent ends\")).equals((\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a string s.\n // if s[i] is a letter, reverse its case from lower to upper or vise versa, \n // otherwise keep it as it is.\n // If the string contains no letters, reverse the string.\n // The function should return the resulted string.\n // Examples\n // solve(\"1234\") = \"4321\"\n // solve(\"ab\") = \"AB\"\n // solve(\"#a@C\") = \"#A@c\"\n public static String solve(String s) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(solve((\"AsDf\")).equals((\"aSdF\")));\n assert(solve((\"1234\")).equals((\"4321\")));\n assert(solve((\"ab\")).equals((\"AB\")));\n assert(solve((\"#a@C\")).equals((\"#A@c\")));\n assert(solve((\"#AsdfW^45\")).equals((\"#aSDFw^45\")));\n assert(solve((\"#6@2\")).equals((\"2@6#\")));\n assert(solve((\"#$a^D\")).equals((\"#$A^d\")));\n assert(solve((\"#ccc\")).equals((\"#CCC\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Filter an input list of strings only for ones that start with a given prefix.\n // >>> filter_by_prefix([], 'a')\n // []\n // >>> filter_by_prefix(['abc', 'bcd', 'cde', 'array'], 'a')\n // ['abc', 'array']\n public static ArrayList filterByPrefix(ArrayList strings, String prefix) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(filterByPrefix((new ArrayList(Arrays.asList())), (\"john\")).equals((new ArrayList(Arrays.asList()))));\n assert(filterByPrefix((new ArrayList(Arrays.asList((String)\"xxx\", (String)\"asd\", (String)\"xxy\", (String)\"john doe\", (String)\"xxxAAA\", (String)\"xxx\"))), (\"xxx\")).equals((new ArrayList(Arrays.asList((String)\"xxx\", (String)\"xxxAAA\", (String)\"xxx\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // This function takes two positive numbers x and y and returns the\n // biggest even integer number that is in the range [x, y] inclusive. If \n // there's no such number, then the function should return -1.\n // For example:\n // choose_num(12, 15) = 14\n // choose_num(13, 12) = -1\n public static long chooseNum(long x, long y) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(chooseNum((12l), (15l)) == (14l));\n assert(chooseNum((13l), (12l)) == (-1l));\n assert(chooseNum((33l), (12354l)) == (12354l));\n assert(chooseNum((5234l), (5233l)) == (-1l));\n assert(chooseNum((6l), (29l)) == (28l));\n assert(chooseNum((27l), (10l)) == (-1l));\n assert(chooseNum((7l), (7l)) == (-1l));\n assert(chooseNum((546l), (546l)) == (546l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a string representing a sentence,\n // the sentence contains some words separated by a space,\n // and you have to return a string that contains the words from the original sentence,\n // whose lengths are prime numbers,\n // the order of the words in the new string should be the same as the original one.\n // Example 1:\n // Input: sentence = \"This is a test\"\n // Output: \"is\"\n // Example 2:\n // Input: sentence = \"lets go for swimming\"\n // Output: \"go for\"\n // Constraints:\n // * 1 <= len(sentence) <= 100\n // * sentence contains only letters\n public static String wordsInSentence(String sentence) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(wordsInSentence((\"This is a test\")).equals((\"is\")));\n assert(wordsInSentence((\"lets go for swimming\")).equals((\"go for\")));\n assert(wordsInSentence((\"there is no place available here\")).equals((\"there is no place\")));\n assert(wordsInSentence((\"Hi I am Hussein\")).equals((\"Hi am Hussein\")));\n assert(wordsInSentence((\"go for it\")).equals((\"go for it\")));\n assert(wordsInSentence((\"here\")).equals((\"\")));\n assert(wordsInSentence((\"here is\")).equals((\"is\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n // >>> intersperse([], 4)\n // []\n // >>> intersperse([1, 2, 3], 4)\n // [1, 4, 2, 4, 3]\n public static ArrayList intersperse(ArrayList numbers, long delimeter) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(intersperse((new ArrayList(Arrays.asList())), (7l)).equals((new ArrayList(Arrays.asList()))));\n assert(intersperse((new ArrayList(Arrays.asList((long)5l, (long)6l, (long)3l, (long)2l))), (8l)).equals((new ArrayList(Arrays.asList((long)5l, (long)8l, (long)6l, (long)8l, (long)3l, (long)8l, (long)2l)))));\n assert(intersperse((new ArrayList(Arrays.asList((long)2l, (long)2l, (long)2l))), (2l)).equals((new ArrayList(Arrays.asList((long)2l, (long)2l, (long)2l, (long)2l, (long)2l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Your task is to write a function that returns true if a number x is a simple\n // power of n and false in other cases.\n // x is a simple power of n if n**int=x\n // For example:\n // is_simple_power(1, 4) => true\n // is_simple_power(2, 2) => true\n // is_simple_power(8, 2) => true\n // is_simple_power(3, 2) => false\n // is_simple_power(3, 1) => false\n // is_simple_power(5, 3) => false\n public static boolean isSimplePower(long x, long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(isSimplePower((16l), (2l)) == (true));\n assert(isSimplePower((143214l), (16l)) == (false));\n assert(isSimplePower((4l), (2l)) == (true));\n assert(isSimplePower((9l), (3l)) == (true));\n assert(isSimplePower((16l), (4l)) == (true));\n assert(isSimplePower((24l), (2l)) == (false));\n assert(isSimplePower((128l), (4l)) == (false));\n assert(isSimplePower((12l), (6l)) == (false));\n assert(isSimplePower((1l), (1l)) == (true));\n assert(isSimplePower((1l), (12l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that returns true if the given number is the multiplication of 3 prime numbers\n // and false otherwise.\n // Knowing that (a) is less then 100. \n // Example:\n // is_multiply_prime(30) == True\n // 30 = 2 * 3 * 5\n public static boolean isMultiplyPrime(long a) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(isMultiplyPrime((5l)) == (false));\n assert(isMultiplyPrime((30l)) == (true));\n assert(isMultiplyPrime((8l)) == (true));\n assert(isMultiplyPrime((10l)) == (false));\n assert(isMultiplyPrime((125l)) == (true));\n assert(isMultiplyPrime((105l)) == (true));\n assert(isMultiplyPrime((126l)) == (false));\n assert(isMultiplyPrime((729l)) == (false));\n assert(isMultiplyPrime((891l)) == (false));\n assert(isMultiplyPrime((1001l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given the lengths of the three sides of a triangle. Return True if the three\n // sides form a right-angled triangle, False otherwise.\n // A right-angled triangle is a triangle in which one angle is right angle or \n // 90 degree.\n // Example:\n // right_angle_triangle(3, 4, 5) == True\n // right_angle_triangle(1, 2, 3) == False\n public static boolean rightAngleTriangle(long a, long b, long c) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(rightAngleTriangle((3l), (4l), (5l)) == (true));\n assert(rightAngleTriangle((1l), (2l), (3l)) == (false));\n assert(rightAngleTriangle((10l), (6l), (8l)) == (true));\n assert(rightAngleTriangle((2l), (2l), (2l)) == (false));\n assert(rightAngleTriangle((7l), (24l), (25l)) == (true));\n assert(rightAngleTriangle((10l), (5l), (7l)) == (false));\n assert(rightAngleTriangle((5l), (12l), (13l)) == (true));\n assert(rightAngleTriangle((15l), (8l), (17l)) == (true));\n assert(rightAngleTriangle((48l), (55l), (73l)) == (true));\n assert(rightAngleTriangle((1l), (1l), (1l)) == (false));\n assert(rightAngleTriangle((2l), (2l), (10l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function that takes 3 numbers.\n // Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n // Returns false in any other cases.\n // Examples\n // any_int(5, 2, 7) \u279e True\n // any_int(3, 2, 2) \u279e False\n // any_int(3, -2, 1) \u279e True\n // any_int(3.6, -2.2, 2) \u279e False\n public static boolean anyInt(float x, float y, float z) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(anyInt((float)2l, (float)3l, (float)1l) == (true));\n assert(anyInt((2.5f), (float)2l, (float)3l) == (false));\n assert(anyInt((1.5f), (float)5l, (3.5f)) == (false));\n assert(anyInt((float)2l, (float)6l, (float)2l) == (false));\n assert(anyInt((float)4l, (float)2l, (float)2l) == (true));\n assert(anyInt((2.2f), (2.2f), (2.2f)) == (false));\n assert(anyInt((float)-4l, (float)6l, (float)2l) == (true));\n assert(anyInt((float)2l, (float)1l, (float)1l) == (true));\n assert(anyInt((float)3l, (float)4l, (float)7l) == (true));\n assert(anyInt((3.0f), (float)4l, (float)7l) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // This function takes a list l and returns a list l' such that\n // l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n // to the values of the corresponding indicies of l, but sorted.\n // >>> sort_third([1, 2, 3])\n // [1, 2, 3]\n // >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n // [2, 6, 3, 4, 8, 9, 5]\n public static ArrayList sortThird(ArrayList l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sortThird((new ArrayList(Arrays.asList((long)5l, (long)6l, (long)3l, (long)4l, (long)8l, (long)9l, (long)2l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)6l, (long)3l, (long)4l, (long)8l, (long)9l, (long)5l)))));\n assert(sortThird((new ArrayList(Arrays.asList((long)5l, (long)8l, (long)3l, (long)4l, (long)6l, (long)9l, (long)2l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)8l, (long)3l, (long)4l, (long)6l, (long)9l, (long)5l)))));\n assert(sortThird((new ArrayList(Arrays.asList((long)5l, (long)6l, (long)9l, (long)4l, (long)8l, (long)3l, (long)2l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)6l, (long)9l, (long)4l, (long)8l, (long)3l, (long)5l)))));\n assert(sortThird((new ArrayList(Arrays.asList((long)5l, (long)6l, (long)3l, (long)4l, (long)8l, (long)9l, (long)2l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)6l, (long)3l, (long)4l, (long)8l, (long)9l, (long)5l, (long)1l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_53_add", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Add two numbers x and y\n // >>> add(2, 3)\n // 5\n // >>> add(5, 7)\n // 12\n public static long add(long x, long y) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(add((0l), (1l)) == (1l));\n assert(add((1l), (0l)) == (1l));\n assert(add((2l), (3l)) == (5l));\n assert(add((5l), (7l)) == (12l));\n assert(add((7l), (5l)) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_69_search", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n // zero, and has a frequency greater than or equal to the value of the integer itself. \n // The frequency of an integer is the number of times it appears in the list.\n // If no such a value exist, return -1.\n // Examples:\n // search([4, 1, 2, 2, 3, 1]) == 2\n // search([1, 2, 2, 3, 3, 3, 4, 4, 4]) == 3\n // search([5, 5, 4, 4, 4]) == -1\n public static long search(ArrayList lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(search((new ArrayList(Arrays.asList((long)5l, (long)5l, (long)5l, (long)5l, (long)1l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)4l, (long)1l, (long)4l, (long)1l, (long)4l, (long)4l)))) == (4l));\n assert(search((new ArrayList(Arrays.asList((long)3l, (long)3l)))) == (-1l));\n assert(search((new ArrayList(Arrays.asList((long)8l, (long)8l, (long)8l, (long)8l, (long)8l, (long)8l, (long)8l, (long)8l)))) == (8l));\n assert(search((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)3l, (long)2l, (long)2l)))) == (2l));\n assert(search((new ArrayList(Arrays.asList((long)2l, (long)7l, (long)8l, (long)8l, (long)4l, (long)8l, (long)7l, (long)3l, (long)9l, (long)6l, (long)5l, (long)10l, (long)4l, (long)3l, (long)6l, (long)7l, (long)1l, (long)7l, (long)4l, (long)10l, (long)8l, (long)1l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)8l, (long)2l)))) == (2l));\n assert(search((new ArrayList(Arrays.asList((long)6l, (long)7l, (long)1l, (long)8l, (long)8l, (long)10l, (long)5l, (long)8l, (long)5l, (long)3l, (long)10l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)8l, (long)8l, (long)3l, (long)6l, (long)5l, (long)6l, (long)4l)))) == (-1l));\n assert(search((new ArrayList(Arrays.asList((long)6l, (long)9l, (long)6l, (long)7l, (long)1l, (long)4l, (long)7l, (long)1l, (long)8l, (long)8l, (long)9l, (long)8l, (long)10l, (long)10l, (long)8l, (long)4l, (long)10l, (long)4l, (long)10l, (long)1l, (long)2l, (long)9l, (long)5l, (long)7l, (long)9l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)1l, (long)9l, (long)10l, (long)1l, (long)3l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)6l, (long)9l, (long)7l, (long)5l, (long)8l, (long)7l, (long)5l, (long)3l, (long)7l, (long)5l, (long)10l, (long)10l, (long)3l, (long)6l, (long)10l, (long)2l, (long)8l, (long)6l, (long)5l, (long)4l, (long)9l, (long)5l, (long)3l, (long)10l)))) == (5l));\n assert(search((new ArrayList(Arrays.asList((long)1l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)8l, (long)8l, (long)10l, (long)6l, (long)4l, (long)3l, (long)5l, (long)8l, (long)2l, (long)4l, (long)2l, (long)8l, (long)4l, (long)6l, (long)10l, (long)4l, (long)2l, (long)1l, (long)10l, (long)2l, (long)1l, (long)1l, (long)5l)))) == (4l));\n assert(search((new ArrayList(Arrays.asList((long)2l, (long)10l, (long)4l, (long)8l, (long)2l, (long)10l, (long)5l, (long)1l, (long)2l, (long)9l, (long)5l, (long)5l, (long)6l, (long)3l, (long)8l, (long)6l, (long)4l, (long)10l)))) == (2l));\n assert(search((new ArrayList(Arrays.asList((long)1l, (long)6l, (long)10l, (long)1l, (long)6l, (long)9l, (long)10l, (long)8l, (long)6l, (long)8l, (long)7l, (long)3l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)9l, (long)2l, (long)4l, (long)1l, (long)5l, (long)1l, (long)5l, (long)2l, (long)5l, (long)7l, (long)7l, (long)7l, (long)3l, (long)10l, (long)1l, (long)5l, (long)4l, (long)2l, (long)8l, (long)4l, (long)1l, (long)9l, (long)10l, (long)7l, (long)10l, (long)2l, (long)8l, (long)10l, (long)9l, (long)4l)))) == (4l));\n assert(search((new ArrayList(Arrays.asList((long)2l, (long)6l, (long)4l, (long)2l, (long)8l, (long)7l, (long)5l, (long)6l, (long)4l, (long)10l, (long)4l, (long)6l, (long)3l, (long)7l, (long)8l, (long)8l, (long)3l, (long)1l, (long)4l, (long)2l, (long)2l, (long)10l, (long)7l)))) == (4l));\n assert(search((new ArrayList(Arrays.asList((long)9l, (long)8l, (long)6l, (long)10l, (long)2l, (long)6l, (long)10l, (long)2l, (long)7l, (long)8l, (long)10l, (long)3l, (long)8l, (long)2l, (long)6l, (long)2l, (long)3l, (long)1l)))) == (2l));\n assert(search((new ArrayList(Arrays.asList((long)5l, (long)5l, (long)3l, (long)9l, (long)5l, (long)6l, (long)3l, (long)2l, (long)8l, (long)5l, (long)6l, (long)10l, (long)10l, (long)6l, (long)8l, (long)4l, (long)10l, (long)7l, (long)7l, (long)10l, (long)8l)))) == (-1l));\n assert(search((new ArrayList(Arrays.asList((long)10l)))) == (-1l));\n assert(search((new ArrayList(Arrays.asList((long)9l, (long)7l, (long)7l, (long)2l, (long)4l, (long)7l, (long)2l, (long)10l, (long)9l, (long)7l, (long)5l, (long)7l, (long)2l)))) == (2l));\n assert(search((new ArrayList(Arrays.asList((long)5l, (long)4l, (long)10l, (long)2l, (long)1l, (long)1l, (long)10l, (long)3l, (long)6l, (long)1l, (long)8l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)7l, (long)9l, (long)9l, (long)9l, (long)3l, (long)4l, (long)1l, (long)5l, (long)9l, (long)1l, (long)2l, (long)1l, (long)1l, (long)10l, (long)7l, (long)5l, (long)6l, (long)7l, (long)6l, (long)7l, (long)7l, (long)6l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)3l, (long)10l, (long)10l, (long)9l, (long)2l)))) == (-1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that takes a string and returns True if the string\n // length is a prime number or False otherwise\n // Examples\n // prime_length('Hello') == True\n // prime_length('abcdcba') == True\n // prime_length('kittens') == True\n // prime_length('orange') == False\n public static boolean primeLength(String string) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(primeLength((\"Hello\")) == (true));\n assert(primeLength((\"abcdcba\")) == (true));\n assert(primeLength((\"kittens\")) == (true));\n assert(primeLength((\"orange\")) == (false));\n assert(primeLength((\"wow\")) == (true));\n assert(primeLength((\"world\")) == (true));\n assert(primeLength((\"MadaM\")) == (true));\n assert(primeLength((\"Wow\")) == (true));\n assert(primeLength((\"\")) == (false));\n assert(primeLength((\"HI\")) == (true));\n assert(primeLength((\"go\")) == (true));\n assert(primeLength((\"gogo\")) == (false));\n assert(primeLength((\"aaaaaaaaaaaaaaa\")) == (false));\n assert(primeLength((\"Madam\")) == (true));\n assert(primeLength((\"M\")) == (false));\n assert(primeLength((\"0\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_58_common", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return sorted unique common elements for two lists.\n // >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n // [1, 5, 653]\n // >>> common([5, 3, 2, 8], [3, 2])\n // [2, 3]\n public static ArrayList common(ArrayList l1, ArrayList l2) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(common((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)3l, (long)34l, (long)653l, (long)2l, (long)5l))), (new ArrayList(Arrays.asList((long)5l, (long)7l, (long)1l, (long)5l, (long)9l, (long)653l, (long)121l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)5l, (long)653l)))));\n assert(common((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)2l, (long)8l))), (new ArrayList(Arrays.asList((long)3l, (long)2l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)3l)))));\n assert(common((new ArrayList(Arrays.asList((long)4l, (long)3l, (long)2l, (long)8l))), (new ArrayList(Arrays.asList((long)3l, (long)2l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)4l)))));\n assert(common((new ArrayList(Arrays.asList((long)4l, (long)3l, (long)2l, (long)8l))), (new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // The Brazilian factorial is defined as:\n // brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n // where n > 0\n // For example:\n // >>> special_factorial(4)\n // 288\n // The function will receive an integer as input and should return the special\n // factorial of this integer.\n public static long specialFactorial(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(specialFactorial((4l)) == (288l));\n assert(specialFactorial((5l)) == (34560l));\n assert(specialFactorial((7l)) == (125411328000l));\n assert(specialFactorial((1l)) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // In this problem, you will implement a function that takes two lists of numbers,\n // and determines whether it is possible to perform an exchange of elements\n // between them to make lst1 a list of only even numbers.\n // There is no limit on the number of exchanged elements between lst1 and lst2.\n // If it is possible to exchange elements between the lst1 and lst2 to make\n // all the elements of lst1 to be even, return \"YES\".\n // Otherwise, return \"NO\".\n // For example:\n // exchange([1, 2, 3, 4], [1, 2, 3, 4]) => \"YES\"\n // exchange([1, 2, 3, 4], [1, 5, 3, 4]) => \"NO\"\n // It is assumed that the input lists will be non-empty.\n public static String exchange(ArrayList lst1, ArrayList lst2) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(exchange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l))), (new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))).equals((\"YES\")));\n assert(exchange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l))), (new ArrayList(Arrays.asList((long)1l, (long)5l, (long)3l, (long)4l)))).equals((\"NO\")));\n assert(exchange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l))), (new ArrayList(Arrays.asList((long)2l, (long)1l, (long)4l, (long)3l)))).equals((\"YES\")));\n assert(exchange((new ArrayList(Arrays.asList((long)5l, (long)7l, (long)3l))), (new ArrayList(Arrays.asList((long)2l, (long)6l, (long)4l)))).equals((\"YES\")));\n assert(exchange((new ArrayList(Arrays.asList((long)5l, (long)7l, (long)3l))), (new ArrayList(Arrays.asList((long)2l, (long)6l, (long)3l)))).equals((\"NO\")));\n assert(exchange((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)6l, (long)1l, (long)8l, (long)9l))), (new ArrayList(Arrays.asList((long)3l, (long)5l, (long)5l, (long)1l, (long)1l, (long)1l)))).equals((\"NO\")));\n assert(exchange((new ArrayList(Arrays.asList((long)100l, (long)200l))), (new ArrayList(Arrays.asList((long)200l, (long)200l)))).equals((\"YES\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a non-empty array of integers arr and an integer k, return\n // the sum of the elements with at most two digits from the first k elements of arr.\n // Example:\n // Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4\n // Output: 24 # sum of 21 + 3\n // Constraints:\n // 1. 1 <= len(arr) <= 100\n // 2. 1 <= k <= len(arr)\n public static long addElements(ArrayList arr, long k) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(addElements((new ArrayList(Arrays.asList((long)1l, (long)-2l, (long)-3l, (long)41l, (long)57l, (long)76l, (long)87l, (long)88l, (long)99l))), (3l)) == (-4l));\n assert(addElements((new ArrayList(Arrays.asList((long)111l, (long)121l, (long)3l, (long)4000l, (long)5l, (long)6l))), (2l)) == (0l));\n assert(addElements((new ArrayList(Arrays.asList((long)11l, (long)21l, (long)3l, (long)90l, (long)5l, (long)6l, (long)7l, (long)8l, (long)9l))), (4l)) == (125l));\n assert(addElements((new ArrayList(Arrays.asList((long)111l, (long)21l, (long)3l, (long)4000l, (long)5l, (long)6l, (long)7l, (long)8l, (long)9l))), (4l)) == (24l));\n assert(addElements((new ArrayList(Arrays.asList((long)1l))), (1l)) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // A simple program which should return the value of x if n is \n // a prime number and should return the value of y otherwise.\n // Examples:\n // for x_or_y(7, 34, 12) == 34\n // for x_or_y(15, 8, 5) == 5\n public static long xOrY(long n, long x, long y) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(xOrY((7l), (34l), (12l)) == (34l));\n assert(xOrY((15l), (8l), (5l)) == (5l));\n assert(xOrY((3l), (33l), (5212l)) == (33l));\n assert(xOrY((1259l), (3l), (52l)) == (3l));\n assert(xOrY((7919l), (-1l), (12l)) == (-1l));\n assert(xOrY((3609l), (1245l), (583l)) == (583l));\n assert(xOrY((91l), (56l), (129l)) == (129l));\n assert(xOrY((6l), (34l), (1234l)) == (1234l));\n assert(xOrY((1l), (2l), (0l)) == (0l));\n assert(xOrY((2l), (2l), (0l)) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given length of a side and high return area for a triangle.\n // >>> triangle_area(5, 3)\n // 7.5\n public static float triangleArea(long a, long h) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(triangleArea((5l), (3l)) == (7.5f));\n assert(triangleArea((2l), (2l)) == (2.0f));\n assert(triangleArea((10l), (8l)) == (40.0f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n // the last couple centuries. However, what people don't know is Tribonacci sequence.\n // Tribonacci sequence is defined by the recurrence:\n // tri(1) = 3\n // tri(n) = 1 + n / 2, if n is even.\n // tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n // For example:\n // tri(2) = 1 + (2 / 2) = 2\n // tri(4) = 3\n // tri(3) = tri(2) + tri(1) + tri(4)\n // = 2 + 3 + 3 = 8 \n // You are given a non-negative integer number n, you have to a return a list of the \n // first n + 1 numbers of the Tribonacci sequence.\n // Examples:\n // tri(3) = [1, 3, 2, 8]\n public static ArrayList tri(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(tri((3l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l)))));\n assert(tri((4l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l, (long)3l)))));\n assert(tri((5l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l, (long)3l, (long)15l)))));\n assert(tri((6l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l, (long)3l, (long)15l, (long)4l)))));\n assert(tri((7l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l, (long)3l, (long)15l, (long)4l, (long)24l)))));\n assert(tri((8l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l, (long)3l, (long)15l, (long)4l, (long)24l, (long)5l)))));\n assert(tri((9l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l, (long)3l, (long)15l, (long)4l, (long)24l, (long)5l, (long)35l)))));\n assert(tri((20l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l, (long)3l, (long)15l, (long)4l, (long)24l, (long)5l, (long)35l, (long)6l, (long)48l, (long)7l, (long)63l, (long)8l, (long)80l, (long)9l, (long)99l, (long)10l, (long)120l, (long)11l)))));\n assert(tri((0l)).equals((new ArrayList(Arrays.asList((long)1l)))));\n assert(tri((1l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a list of two strings, both strings consist of open\n // parentheses '(' or close parentheses ')' only.\n // Your job is to check if it is possible to concatenate the two strings in\n // some order, that the resulting string will be good.\n // A string S is considered to be good if and only if all parentheses in S\n // are balanced. For example: the string '(())()' is good, while the string\n // '())' is not.\n // Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n // Examples:\n // match_parens(['()(', ')']) == 'Yes'\n // match_parens([')', ')']) == 'No'\n public static String matchParens(ArrayList lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(matchParens((new ArrayList(Arrays.asList((String)\"()(\", (String)\")\")))).equals((\"Yes\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\")\", (String)\")\")))).equals((\"No\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\"(()(())\", (String)\"())())\")))).equals((\"No\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\")())\", (String)\"(()()(\")))).equals((\"Yes\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\"(())))\", (String)\"(()())((\")))).equals((\"Yes\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\"()\", (String)\"())\")))).equals((\"No\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\"(()(\", (String)\"()))()\")))).equals((\"Yes\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\"((((\", (String)\"((())\")))).equals((\"No\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\")(()\", (String)\"(()(\")))).equals((\"No\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\")(\", (String)\")(\")))).equals((\"No\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\"(\", (String)\")\")))).equals((\"Yes\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\")\", (String)\"(\")))).equals((\"Yes\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // From a list of integers, remove all elements that occur more than once.\n // Keep order of elements left the same as in the input.\n // >>> remove_duplicates([1, 2, 3, 2, 4])\n // [1, 3, 4]\n public static ArrayList removeDuplicates(ArrayList numbers) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(removeDuplicates((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(removeDuplicates((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))));\n assert(removeDuplicates((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)2l, (long)4l, (long)3l, (long)5l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)5l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return a greatest common divisor of two integers a and b\n // >>> greatest_common_divisor(3, 5)\n // 1\n // >>> greatest_common_divisor(25, 15)\n // 5\n public static long greatestCommonDivisor(long a, long b) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(greatestCommonDivisor((3l), (7l)) == (1l));\n assert(greatestCommonDivisor((10l), (15l)) == (5l));\n assert(greatestCommonDivisor((49l), (14l)) == (7l));\n assert(greatestCommonDivisor((144l), (60l)) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Checks if given string is a palindrome\n // >>> is_palindrome('')\n // True\n // >>> is_palindrome('aba')\n // True\n // >>> is_palindrome('aaaaa')\n // True\n // >>> is_palindrome('zbcd')\n // False\n public static boolean isPalindrome(String text) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(isPalindrome((\"\")) == (true));\n assert(isPalindrome((\"aba\")) == (true));\n assert(isPalindrome((\"aaaaa\")) == (true));\n assert(isPalindrome((\"zbcd\")) == (false));\n assert(isPalindrome((\"xywyx\")) == (true));\n assert(isPalindrome((\"xywyz\")) == (false));\n assert(isPalindrome((\"xywzx\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // xs represent coefficients of a polynomial.\n // xs[0] + xs[1] * x + xs[2] * x^2 + ....\n // Return derivative of this polynomial in the same form.\n // >>> derivative([3, 1, 2, 4, 5])\n // [1, 4, 12, 20]\n // >>> derivative([1, 2, 3])\n // [2, 6]\n public static ArrayList derivative(ArrayList xs) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(derivative((new ArrayList(Arrays.asList((long)3l, (long)1l, (long)2l, (long)4l, (long)5l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)12l, (long)20l)))));\n assert(derivative((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)6l)))));\n assert(derivative((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)2l)))));\n assert(derivative((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)1l, (long)0l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)2l, (long)0l, (long)16l)))));\n assert(derivative((new ArrayList(Arrays.asList((long)1l)))).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // In this task, you will be given a string that represents a number of apples and oranges \n // that are distributed in a basket of fruit this basket contains \n // apples, oranges, and mango fruits. Given the string that represents the total number of \n // the oranges and apples and an integer that represent the total number of the fruits \n // in the basket return the number of the mango fruits in the basket.\n // for examble:\n // fruit_distribution(\"5 apples and 6 oranges\", 19) ->19 - 5 - 6 = 8\n // fruit_distribution(\"0 apples and 1 oranges\",3) -> 3 - 0 - 1 = 2\n // fruit_distribution(\"2 apples and 3 oranges\", 100) -> 100 - 2 - 3 = 95\n // fruit_distribution(\"100 apples and 1 oranges\",120) -> 120 - 100 - 1 = 19\n public static long fruitDistribution(String s, long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(fruitDistribution((\"5 apples and 6 oranges\"), (19l)) == (8l));\n assert(fruitDistribution((\"5 apples and 6 oranges\"), (21l)) == (10l));\n assert(fruitDistribution((\"0 apples and 1 oranges\"), (3l)) == (2l));\n assert(fruitDistribution((\"1 apples and 0 oranges\"), (3l)) == (2l));\n assert(fruitDistribution((\"2 apples and 3 oranges\"), (100l)) == (95l));\n assert(fruitDistribution((\"2 apples and 3 oranges\"), (5l)) == (0l));\n assert(fruitDistribution((\"1 apples and 100 oranges\"), (120l)) == (19l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that takes an integer a and returns True \n // if this ingeger is a cube of some integer number.\n // Note: you may assume the input is always valid.\n // Examples:\n // iscube(1) ==> True\n // iscube(2) ==> False\n // iscube(-1) ==> True\n // iscube(64) ==> True\n // iscube(0) ==> True\n // iscube(180) ==> False\n public static boolean iscube(long a) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(iscube((1l)) == (true));\n assert(iscube((2l)) == (false));\n assert(iscube((-1l)) == (true));\n assert(iscube((64l)) == (true));\n assert(iscube((180l)) == (false));\n assert(iscube((1000l)) == (true));\n assert(iscube((0l)) == (true));\n assert(iscube((1729l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // In this Kata, you have to sort an array of non-negative integers according to\n // number of ones in their binary representation in ascending order.\n // For similar number of ones, sort based on decimal value.\n // It must be implemented like this:\n // >>> sort_array([1, 5, 2, 3, 4]) == [1, 2, 3, 4, 5]\n // >>> sort_array([-2, -3, -4, -5, -6]) == [-6, -5, -4, -3, -2]\n // >>> sort_array([1, 0, 2, 3, 4]) [0, 1, 2, 3, 4]\n public static ArrayList sortArray(ArrayList arr) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sortArray((new ArrayList(Arrays.asList((long)1l, (long)5l, (long)2l, (long)3l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)4l, (long)3l, (long)5l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)-2l, (long)-3l, (long)-4l, (long)-5l, (long)-6l)))).equals((new ArrayList(Arrays.asList((long)-4l, (long)-2l, (long)-6l, (long)-5l, (long)-3l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)1l, (long)0l, (long)2l, (long)3l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)1l, (long)2l, (long)4l, (long)3l)))));\n assert(sortArray((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(sortArray((new ArrayList(Arrays.asList((long)2l, (long)5l, (long)77l, (long)4l, (long)5l, (long)3l, (long)5l, (long)7l, (long)2l, (long)3l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)2l, (long)4l, (long)4l, (long)3l, (long)3l, (long)5l, (long)5l, (long)5l, (long)7l, (long)77l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)3l, (long)6l, (long)44l, (long)12l, (long)32l, (long)5l)))).equals((new ArrayList(Arrays.asList((long)32l, (long)3l, (long)5l, (long)6l, (long)12l, (long)44l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)8l, (long)16l, (long)32l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)8l, (long)16l, (long)32l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)8l, (long)16l, (long)32l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)8l, (long)16l, (long)32l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a list of strings, where each string consists of only digits, return a list.\n // Each element i of the output should be \"the number of odd elements in the\n // string i of the input.\" where all the i's should be replaced by the number\n // of odd digits in the i'th string of the input.\n // >>> odd_count(['1234567'])\n // [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n // >>> odd_count(['3',\"11111111\"])\n // [\"the number of odd elements 1n the str1ng 1 of the 1nput.\",\n // \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\n public static ArrayList oddCount(ArrayList lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(oddCount((new ArrayList(Arrays.asList((String)\"1234567\")))).equals((new ArrayList(Arrays.asList((String)\"the number of odd elements 4n the str4ng 4 of the 4nput.\")))));\n assert(oddCount((new ArrayList(Arrays.asList((String)\"3\", (String)\"11111111\")))).equals((new ArrayList(Arrays.asList((String)\"the number of odd elements 1n the str1ng 1 of the 1nput.\", (String)\"the number of odd elements 8n the str8ng 8 of the 8nput.\")))));\n assert(oddCount((new ArrayList(Arrays.asList((String)\"271\", (String)\"137\", (String)\"314\")))).equals((new ArrayList(Arrays.asList((String)\"the number of odd elements 2n the str2ng 2 of the 2nput.\", (String)\"the number of odd elements 3n the str3ng 3 of the 3nput.\", (String)\"the number of odd elements 2n the str2ng 2 of the 2nput.\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // brackets is a string of \"(\" and \")\".\n // return True if every opening bracket has a corresponding closing bracket.\n // >>> correct_bracketing(\"(\")\n // False\n // >>> correct_bracketing(\"()\")\n // True\n // >>> correct_bracketing(\"(()())\")\n // True\n // >>> correct_bracketing(\")(()\")\n // False\n public static boolean correctBracketing(String brackets) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(correctBracketing((\"()\")) == (true));\n assert(correctBracketing((\"(()())\")) == (true));\n assert(correctBracketing((\"()()(()())()\")) == (true));\n assert(correctBracketing((\"()()((()()())())(()()(()))\")) == (true));\n assert(correctBracketing((\"((()())))\")) == (false));\n assert(correctBracketing((\")(()\")) == (false));\n assert(correctBracketing((\"(\")) == (false));\n assert(correctBracketing((\"((((\")) == (false));\n assert(correctBracketing((\")\")) == (false));\n assert(correctBracketing((\"(()\")) == (false));\n assert(correctBracketing((\"()()(()())())(()\")) == (false));\n assert(correctBracketing((\"()()(()())()))()\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Task\n // Write a function that takes a string as input and returns the sum of the upper characters only'\n // ASCII codes.\n // Examples:\n // digitSum(\"\") => 0\n // digitSum(\"abAB\") => 131\n // digitSum(\"abcCd\") => 67\n // digitSum(\"helloE\") => 69\n // digitSum(\"woArBld\") => 131\n // digitSum(\"aAaaaXa\") => 153\n public static long digitSum(String s) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(digitSum((\"\")) == (0l));\n assert(digitSum((\"abAB\")) == (131l));\n assert(digitSum((\"abcCd\")) == (67l));\n assert(digitSum((\"helloE\")) == (69l));\n assert(digitSum((\"woArBld\")) == (131l));\n assert(digitSum((\"aAaaaXa\")) == (153l));\n assert(digitSum((\" How are yOu?\")) == (151l));\n assert(digitSum((\"You arE Very Smart\")) == (327l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that accepts a list of strings as a parameter,\n // deletes the strings that have odd lengths from it,\n // and returns the resulted list with a sorted order,\n // The list is always a list of strings and never an array of numbers,\n // and it may contain duplicates.\n // The order of the list should be ascending by length of each word, and you\n // should return the list sorted by that rule.\n // If two words have the same length, sort the list alphabetically.\n // The function should return a list of strings in sorted order.\n // You may assume that all words will have the same length.\n // For example:\n // assert list_sort([\"aa\", \"a\", \"aaa\"]) => [\"aa\"]\n // assert list_sort([\"ab\", \"a\", \"aaa\", \"cd\"]) => [\"ab\", \"cd\"]\n public static ArrayList sortedListSum(ArrayList lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sortedListSum((new ArrayList(Arrays.asList((String)\"aa\", (String)\"a\", (String)\"aaa\")))).equals((new ArrayList(Arrays.asList((String)\"aa\")))));\n assert(sortedListSum((new ArrayList(Arrays.asList((String)\"school\", (String)\"AI\", (String)\"asdf\", (String)\"b\")))).equals((new ArrayList(Arrays.asList((String)\"AI\", (String)\"asdf\", (String)\"school\")))));\n assert(sortedListSum((new ArrayList(Arrays.asList((String)\"d\", (String)\"b\", (String)\"c\", (String)\"a\")))).equals((new ArrayList(Arrays.asList()))));\n assert(sortedListSum((new ArrayList(Arrays.asList((String)\"d\", (String)\"dcba\", (String)\"abcd\", (String)\"a\")))).equals((new ArrayList(Arrays.asList((String)\"abcd\", (String)\"dcba\")))));\n assert(sortedListSum((new ArrayList(Arrays.asList((String)\"AI\", (String)\"ai\", (String)\"au\")))).equals((new ArrayList(Arrays.asList((String)\"AI\", (String)\"ai\", (String)\"au\")))));\n assert(sortedListSum((new ArrayList(Arrays.asList((String)\"a\", (String)\"b\", (String)\"b\", (String)\"c\", (String)\"c\", (String)\"a\")))).equals((new ArrayList(Arrays.asList()))));\n assert(sortedListSum((new ArrayList(Arrays.asList((String)\"aaaa\", (String)\"bbbb\", (String)\"dd\", (String)\"cc\")))).equals((new ArrayList(Arrays.asList((String)\"cc\", (String)\"dd\", (String)\"aaaa\", (String)\"bbbb\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given an array arr of integers and you need to return\n // sum of magnitudes of integers multiplied by product of all signs\n // of each number in the array, represented by 1, -1 or 0.\n // Note: return None for empty arr.\n // Example:\n // >>> prod_signs([1, 2, 2, -4]) == -9\n // >>> prod_signs([0, 1]) == 0\n // >>> prod_signs([]) == None\n public static Optional prodSigns(ArrayList arr) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(prodSigns((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)2l, (long)-4l)))).equals(-9l));\n assert(prodSigns((new ArrayList(Arrays.asList((long)0l, (long)1l)))).equals(0l));\n assert(prodSigns((new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)2l, (long)3l, (long)-1l, (long)1l)))).equals(-10l));\n assert(prodSigns((new ArrayList(Arrays.asList()))).equals(Optional.empty()));\n assert(prodSigns((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)1l, (long)2l, (long)-1l, (long)-1l, (long)9l)))).equals(20l));\n assert(prodSigns((new ArrayList(Arrays.asList((long)-1l, (long)1l, (long)-1l, (long)1l)))).equals(4l));\n assert(prodSigns((new ArrayList(Arrays.asList((long)-1l, (long)1l, (long)1l, (long)1l)))).equals(-4l));\n assert(prodSigns((new ArrayList(Arrays.asList((long)-1l, (long)1l, (long)1l, (long)0l)))).equals(0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return list with elements incremented by 1.\n // >>> incr_list([1, 2, 3])\n // [2, 3, 4]\n // >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123])\n // [6, 4, 6, 3, 4, 4, 10, 1, 124]\n public static ArrayList incrList(ArrayList l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(incrList((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(incrList((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)4l, (long)3l, (long)2l)))));\n assert(incrList((new ArrayList(Arrays.asList((long)5l, (long)2l, (long)5l, (long)2l, (long)3l, (long)3l, (long)9l, (long)0l, (long)123l)))).equals((new ArrayList(Arrays.asList((long)6l, (long)3l, (long)6l, (long)3l, (long)4l, (long)4l, (long)10l, (long)1l, (long)124l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // From a given list of integers, generate a list of rolling maximum element found until given moment\n // in the sequence.\n // >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n // [1, 2, 3, 3, 3, 4, 4]\n public static ArrayList rollingMax(ArrayList numbers) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(rollingMax((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(rollingMax((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))));\n assert(rollingMax((new ArrayList(Arrays.asList((long)4l, (long)3l, (long)2l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)4l, (long)4l, (long)4l, (long)4l)))));\n assert(rollingMax((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)3l, (long)100l, (long)3l)))).equals((new ArrayList(Arrays.asList((long)3l, (long)3l, (long)3l, (long)100l, (long)100l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n // separate those group into separate strings and return the list of those.\n // Separate groups are balanced (each open brace is properly closed) and not nested within each other\n // Ignore any spaces in the input string.\n // >>> separate_paren_groups('( ) (( )) (( )( ))')\n // ['()', '(())', '(()())']\n public static ArrayList separateParenGroups(String paren_string) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(separateParenGroups((\"(()()) ((())) () ((())()())\")).equals((new ArrayList(Arrays.asList((String)\"(()())\", (String)\"((()))\", (String)\"()\", (String)\"((())()())\")))));\n assert(separateParenGroups((\"() (()) ((())) (((())))\")).equals((new ArrayList(Arrays.asList((String)\"()\", (String)\"(())\", (String)\"((()))\", (String)\"(((())))\")))));\n assert(separateParenGroups((\"(()(())((())))\")).equals((new ArrayList(Arrays.asList((String)\"(()(())((())))\")))));\n assert(separateParenGroups((\"( ) (( )) (( )( ))\")).equals((new ArrayList(Arrays.asList((String)\"()\", (String)\"(())\", (String)\"(()())\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You will be given a string of words separated by commas or spaces. Your task is\n // to split the string into words and return an array of the words.\n // For example:\n // words_string(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n // words_string(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\n public static ArrayList wordsString(String s) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(wordsString((\"Hi, my name is John\")).equals((new ArrayList(Arrays.asList((String)\"Hi\", (String)\"my\", (String)\"name\", (String)\"is\", (String)\"John\")))));\n assert(wordsString((\"One, two, three, four, five, six\")).equals((new ArrayList(Arrays.asList((String)\"One\", (String)\"two\", (String)\"three\", (String)\"four\", (String)\"five\", (String)\"six\")))));\n assert(wordsString((\"Hi, my name\")).equals((new ArrayList(Arrays.asList((String)\"Hi\", (String)\"my\", (String)\"name\")))));\n assert(wordsString((\"One,, two, three, four, five, six,\")).equals((new ArrayList(Arrays.asList((String)\"One\", (String)\"two\", (String)\"three\", (String)\"four\", (String)\"five\", (String)\"six\")))));\n assert(wordsString((\"\")).equals((new ArrayList(Arrays.asList()))));\n assert(wordsString((\"ahmed , gamal\")).equals((new ArrayList(Arrays.asList((String)\"ahmed\", (String)\"gamal\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Filter given list of any python values only for integers\n // >>> filter_integers(['a', 3.14, 5])\n // [5]\n // >>> filter_integers([1, 2, 3, 'abc', {}, []])\n // [1, 2, 3]\n public static ArrayList filterIntegers(ArrayList values) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(filterIntegers((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(filterIntegers((new ArrayList(Arrays.asList(4l, new HashMap(Map.of()), new ArrayList(Arrays.asList()), 23.2f, 9l, \"adasd\")))).equals((new ArrayList(Arrays.asList((long)4l, (long)9l)))));\n assert(filterIntegers((new ArrayList(Arrays.asList(3l, \"c\", 3l, 3l, \"a\", \"b\")))).equals((new ArrayList(Arrays.asList((long)3l, (long)3l, (long)3l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // This function takes a list l and returns a list l' such that\n // l' is identical to l in the odd indicies, while its values at the even indicies are equal\n // to the values of the even indicies of l, but sorted.\n // >>> sort_even([1, 2, 3])\n // [1, 2, 3]\n // >>> sort_even([5, 6, 3, 4])\n // [3, 6, 5, 4]\n public static ArrayList sortEven(ArrayList l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sortEven((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)))));\n assert(sortEven((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)-5l, (long)2l, (long)-3l, (long)3l, (long)9l, (long)0l, (long)123l, (long)1l, (long)-10l)))).equals((new ArrayList(Arrays.asList((long)-10l, (long)3l, (long)-5l, (long)2l, (long)-3l, (long)3l, (long)5l, (long)0l, (long)9l, (long)1l, (long)123l)))));\n assert(sortEven((new ArrayList(Arrays.asList((long)5l, (long)8l, (long)-12l, (long)4l, (long)23l, (long)2l, (long)3l, (long)11l, (long)12l, (long)-10l)))).equals((new ArrayList(Arrays.asList((long)-12l, (long)8l, (long)3l, (long)4l, (long)5l, (long)2l, (long)12l, (long)11l, (long)23l, (long)-10l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // I think we all remember that feeling when the result of some long-awaited\n // event is finally known. The feelings and thoughts you have at that moment are\n // definitely worth noting down and comparing.\n // Your task is to determine if a person correctly guessed the results of a number of matches.\n // You are given two arrays of scores and guesses of equal length, where each index shows a match. \n // Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n // the value is 0, and if not, the value is the absolute difference between the guess and the score.\n // example:\n // compare([1,2,3,4,5,1],[1,2,3,4,2,-2]) -> [0,0,0,0,3,3]\n // compare([0,5,0,0,0,4],[4,1,1,0,0,-2]) -> [4,4,1,0,0,6]\n public static ArrayList compare(ArrayList game, ArrayList guess) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(compare((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)1l))), (new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)2l, (long)-2l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l, (long)0l, (long)3l, (long)3l)))));\n assert(compare((new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l, (long)0l, (long)0l, (long)0l))), (new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l, (long)0l, (long)0l, (long)0l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l, (long)0l, (long)0l, (long)0l)))));\n assert(compare((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))), (new ArrayList(Arrays.asList((long)-1l, (long)-2l, (long)-3l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)6l)))));\n assert(compare((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)5l))), (new ArrayList(Arrays.asList((long)-1l, (long)2l, (long)3l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)0l, (long)0l, (long)1l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a positive integer n, return a tuple that has the number of even and odd\n // integer palindromes that fall within the range(1, n), inclusive.\n // Example 1:\n // Input: 3\n // Output: (1, 2)\n // Explanation:\n // Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n // Example 2:\n // Input: 12\n // Output: (4, 6)\n // Explanation:\n // Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n // Note:\n // 1. 1 <= n <= 10^3\n // 2. returned tuple has the number of even and odd integer palindromes respectively.\n public static Pair evenOddPalindrome(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(evenOddPalindrome((123l)).equals((Pair.with(8l, 13l))));\n assert(evenOddPalindrome((12l)).equals((Pair.with(4l, 6l))));\n assert(evenOddPalindrome((3l)).equals((Pair.with(1l, 2l))));\n assert(evenOddPalindrome((63l)).equals((Pair.with(6l, 8l))));\n assert(evenOddPalindrome((25l)).equals((Pair.with(5l, 6l))));\n assert(evenOddPalindrome((19l)).equals((Pair.with(4l, 6l))));\n assert(evenOddPalindrome((9l)).equals((Pair.with(4l, 5l))));\n assert(evenOddPalindrome((1l)).equals((Pair.with(0l, 1l))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n // fib4(0) -> 0\n // fib4(1) -> 0\n // fib4(2) -> 2\n // fib4(3) -> 0\n // fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n // Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n // >>> fib4(5)\n // 4\n // >>> fib4(6)\n // 8\n // >>> fib4(7)\n // 14\n public static long fib4(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(fib4((5l)) == (4l));\n assert(fib4((8l)) == (28l));\n assert(fib4((10l)) == (104l));\n assert(fib4((12l)) == (386l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given two positive integers a and b, return the even digits between a\n // and b, in ascending order.\n // For example:\n // generate_integers(2, 8) => [2, 4, 6, 8]\n // generate_integers(8, 2) => [2, 4, 6, 8]\n // generate_integers(10, 14) => []\n public static ArrayList generateIntegers(long a, long b) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(generateIntegers((2l), (10l)).equals((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)6l, (long)8l)))));\n assert(generateIntegers((10l), (2l)).equals((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)6l, (long)8l)))));\n assert(generateIntegers((132l), (2l)).equals((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)6l, (long)8l)))));\n assert(generateIntegers((17l), (89l)).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // For a given list of input numbers, calculate Mean Absolute Deviation\n // around the mean of this dataset.\n // Mean Absolute Deviation is the average absolute difference between each\n // element and a centerpoint (mean in this case):\n // MAD = average | x - x_mean |\n // >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n // 1.0\n public static float meanAbsoluteDeviation(ArrayList numbers) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(meanAbsoluteDeviation((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f)))) == (0.5f));\n assert(meanAbsoluteDeviation((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f)))) == (1.0f));\n assert(meanAbsoluteDeviation((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f)))) == (1.2f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function encrypt that takes a string as an argument and\n // returns a string encrypted with the alphabet being rotated. \n // The alphabet should be rotated in a manner such that the letters \n // shift down by two multiplied to two places.\n // For example:\n // encrypt('hi') returns 'lm'\n // encrypt('asdfghjkl') returns 'ewhjklnop'\n // encrypt('gf') returns 'kj'\n // encrypt('et') returns 'ix'\n public static String encrypt(String s) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(encrypt((\"hi\")).equals((\"lm\")));\n assert(encrypt((\"asdfghjkl\")).equals((\"ewhjklnop\")));\n assert(encrypt((\"gf\")).equals((\"kj\")));\n assert(encrypt((\"et\")).equals((\"ix\")));\n assert(encrypt((\"faewfawefaewg\")).equals((\"jeiajeaijeiak\")));\n assert(encrypt((\"hellomyfriend\")).equals((\"lippsqcjvmirh\")));\n assert(encrypt((\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\")).equals((\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\")));\n assert(encrypt((\"a\")).equals((\"e\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n // The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n // as follows: start with any positive integer n. Then each term is obtained from the \n // previous term as follows: if the previous term is even, the next term is one half of \n // the previous term. If the previous term is odd, the next term is 3 times the previous\n // term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n // Note: \n // 1. Collatz(1) is [1].\n // 2. returned list sorted in increasing order.\n // For example:\n // get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n public static ArrayList getOddCollatz(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(getOddCollatz((14l)).equals((new ArrayList(Arrays.asList((long)1l, (long)5l, (long)7l, (long)11l, (long)13l, (long)17l)))));\n assert(getOddCollatz((5l)).equals((new ArrayList(Arrays.asList((long)1l, (long)5l)))));\n assert(getOddCollatz((12l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)5l)))));\n assert(getOddCollatz((1l)).equals((new ArrayList(Arrays.asList((long)1l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Find how many times a given substring can be found in the original string. Count overlaping cases.\n // >>> how_many_times('', 'a')\n // 0\n // >>> how_many_times('aaa', 'a')\n // 3\n // >>> how_many_times('aaaa', 'aa')\n // 3\n public static long howManyTimes(String string, String substring) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(howManyTimes((\"\"), (\"x\")) == (0l));\n assert(howManyTimes((\"xyxyxyx\"), (\"x\")) == (4l));\n assert(howManyTimes((\"cacacacac\"), (\"cac\")) == (4l));\n assert(howManyTimes((\"john doe\"), (\"john\")) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n // numbers in the array will be randomly ordered. Your task is to determine if\n // it is possible to get an array sorted in non-decreasing order by performing \n // the following operation on the given array:\n // You are allowed to perform right shift operation any number of times.\n // One right shift operation means shifting all elements of the array by one\n // position in the right direction. The last element of the array will be moved to\n // the starting position in the array i.e. 0th index. \n // If it is possible to obtain the sorted array by performing the above operation\n // then return True else return False.\n // If the given array is empty then return True.\n // Note: The given list is guaranteed to have unique elements.\n // For Example:\n // move_one_ball([3, 4, 5, 1, 2])==>True\n // Explanation: By performin 2 right shift operations, non-decreasing order can\n // be achieved for the given array.\n // move_one_ball([3, 5, 4, 1, 2])==>False\n // Explanation:It is not possible to get non-decreasing order for the given\n // array by performing any number of right shift operations.\n public static boolean moveOneBall(ArrayList arr) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(moveOneBall((new ArrayList(Arrays.asList((long)3l, (long)4l, (long)5l, (long)1l, (long)2l)))) == (true));\n assert(moveOneBall((new ArrayList(Arrays.asList((long)3l, (long)5l, (long)10l, (long)1l, (long)2l)))) == (true));\n assert(moveOneBall((new ArrayList(Arrays.asList((long)4l, (long)3l, (long)1l, (long)2l)))) == (false));\n assert(moveOneBall((new ArrayList(Arrays.asList((long)3l, (long)5l, (long)4l, (long)1l, (long)2l)))) == (false));\n assert(moveOneBall((new ArrayList(Arrays.asList()))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function which sorts the given list of integers\n // in ascending order according to the sum of their digits.\n // Note: if there are several items with similar sum of their digits,\n // order them based on their index in original list.\n // For example:\n // >>> order_by_points([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]\n // >>> order_by_points([]) == []\n public static ArrayList orderByPoints(ArrayList nums) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(orderByPoints((new ArrayList(Arrays.asList((long)1l, (long)11l, (long)-1l, (long)-11l, (long)-12l)))).equals((new ArrayList(Arrays.asList((long)-1l, (long)-11l, (long)1l, (long)-12l, (long)11l)))));\n assert(orderByPoints((new ArrayList(Arrays.asList((long)1234l, (long)423l, (long)463l, (long)145l, (long)2l, (long)423l, (long)423l, (long)53l, (long)6l, (long)37l, (long)3457l, (long)3l, (long)56l, (long)0l, (long)46l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)2l, (long)3l, (long)6l, (long)53l, (long)423l, (long)423l, (long)423l, (long)1234l, (long)145l, (long)37l, (long)46l, (long)56l, (long)463l, (long)3457l)))));\n assert(orderByPoints((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(orderByPoints((new ArrayList(Arrays.asList((long)1l, (long)-11l, (long)-32l, (long)43l, (long)54l, (long)-98l, (long)2l, (long)-3l)))).equals((new ArrayList(Arrays.asList((long)-3l, (long)-32l, (long)-98l, (long)-11l, (long)1l, (long)2l, (long)43l, (long)54l)))));\n assert(orderByPoints((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l, (long)7l, (long)8l, (long)9l, (long)10l, (long)11l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)10l, (long)2l, (long)11l, (long)3l, (long)4l, (long)5l, (long)6l, (long)7l, (long)8l, (long)9l)))));\n assert(orderByPoints((new ArrayList(Arrays.asList((long)0l, (long)6l, (long)6l, (long)-76l, (long)-21l, (long)23l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)-76l, (long)-21l, (long)0l, (long)4l, (long)23l, (long)6l, (long)6l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return list of prime factors of given integer in the order from smallest to largest.\n // Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n // Input number should be equal to the product of all factors\n // >>> factorize(8)\n // [2, 2, 2]\n // >>> factorize(25)\n // [5, 5]\n // >>> factorize(70)\n // [2, 5, 7]\n public static ArrayList factorize(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(factorize((2l)).equals((new ArrayList(Arrays.asList((long)2l)))));\n assert(factorize((4l)).equals((new ArrayList(Arrays.asList((long)2l, (long)2l)))));\n assert(factorize((8l)).equals((new ArrayList(Arrays.asList((long)2l, (long)2l, (long)2l)))));\n assert(factorize((57l)).equals((new ArrayList(Arrays.asList((long)3l, (long)19l)))));\n assert(factorize((3249l)).equals((new ArrayList(Arrays.asList((long)3l, (long)3l, (long)19l, (long)19l)))));\n assert(factorize((185193l)).equals((new ArrayList(Arrays.asList((long)3l, (long)3l, (long)3l, (long)19l, (long)19l, (long)19l)))));\n assert(factorize((20577l)).equals((new ArrayList(Arrays.asList((long)3l, (long)19l, (long)19l, (long)19l)))));\n assert(factorize((18l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)3l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return True if all numbers in the list l are below threshold t.\n // >>> below_threshold([1, 2, 4, 10], 100)\n // True\n // >>> below_threshold([1, 20, 4, 10], 5)\n // False\n public static boolean belowThreshold(ArrayList l, long t) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(belowThreshold((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)4l, (long)10l))), (100l)) == (true));\n assert(belowThreshold((new ArrayList(Arrays.asList((long)1l, (long)20l, (long)4l, (long)10l))), (5l)) == (false));\n assert(belowThreshold((new ArrayList(Arrays.asList((long)1l, (long)20l, (long)4l, (long)10l))), (21l)) == (true));\n assert(belowThreshold((new ArrayList(Arrays.asList((long)1l, (long)20l, (long)4l, (long)10l))), (22l)) == (true));\n assert(belowThreshold((new ArrayList(Arrays.asList((long)1l, (long)8l, (long)4l, (long)10l))), (11l)) == (true));\n assert(belowThreshold((new ArrayList(Arrays.asList((long)1l, (long)8l, (long)4l, (long)10l))), (10l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n // For each of the group, output the deepest level of nesting of parentheses.\n // E.g. (()()) has maximum two levels of nesting while ((())) has three.\n // >>> parse_nested_parens('(()()) ((())) () ((())()())')\n // [2, 3, 1, 3]\n public static ArrayList parseNestedParens(String paren_string) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(parseNestedParens((\"(()()) ((())) () ((())()())\")).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)1l, (long)3l)))));\n assert(parseNestedParens((\"() (()) ((())) (((())))\")).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))));\n assert(parseNestedParens((\"(()(())((())))\")).equals((new ArrayList(Arrays.asList((long)4l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n // Examples\n // solution([5, 8, 7, 1]) ==> 12\n // solution([3, 3, 3, 3, 3]) ==> 9\n // solution([30, 13, 24, 321]) ==>0\n public static long solution(ArrayList lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(solution((new ArrayList(Arrays.asList((long)5l, (long)8l, (long)7l, (long)1l)))) == (12l));\n assert(solution((new ArrayList(Arrays.asList((long)3l, (long)3l, (long)3l, (long)3l, (long)3l)))) == (9l));\n assert(solution((new ArrayList(Arrays.asList((long)30l, (long)13l, (long)24l, (long)321l)))) == (0l));\n assert(solution((new ArrayList(Arrays.asList((long)5l, (long)9l)))) == (5l));\n assert(solution((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)8l)))) == (0l));\n assert(solution((new ArrayList(Arrays.asList((long)30l, (long)13l, (long)23l, (long)32l)))) == (23l));\n assert(solution((new ArrayList(Arrays.asList((long)3l, (long)13l, (long)2l, (long)9l)))) == (3l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a positive integer n. You have to create an integer array a of length n.\n // For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n // Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n // and a[i] + a[j] + a[k] is a multiple of 3.\n // Example :\n // Input: n = 5\n // Output: 1\n // Explanation: \n // a = [1, 3, 7, 13, 21]\n // The only valid triple is (1, 7, 13).\n public static long getMaxTriples(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(getMaxTriples((5l)) == (1l));\n assert(getMaxTriples((6l)) == (4l));\n assert(getMaxTriples((10l)) == (36l));\n assert(getMaxTriples((100l)) == (53361l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // There are eight planets in our solar system: the closerst to the Sun \n // is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n // Uranus, Neptune.\n // Write a function that takes two planet names as strings planet1 and planet2. \n // The function should return a tuple containing all planets whose orbits are \n // located between the orbit of planet1 and the orbit of planet2, sorted by \n // the proximity to the sun. \n // The function should return an empty tuple if planet1 or planet2\n // are not correct planet names. \n // Examples\n // bf(\"Jupiter\", \"Neptune\") ==> (\"Saturn\", \"Uranus\")\n // bf(\"Earth\", \"Mercury\") ==> (\"Venus\")\n // bf(\"Mercury\", \"Uranus\") ==> (\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\")\n public static ArrayList bf(String planet1, String planet2) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(bf((\"Jupiter\"), (\"Neptune\")).equals((new ArrayList(Arrays.asList((String)\"Saturn\", (String)\"Uranus\")))));\n assert(bf((\"Earth\"), (\"Mercury\")).equals((new ArrayList(Arrays.asList((String)\"Venus\")))));\n assert(bf((\"Mercury\"), (\"Uranus\")).equals((new ArrayList(Arrays.asList((String)\"Venus\", (String)\"Earth\", (String)\"Mars\", (String)\"Jupiter\", (String)\"Saturn\")))));\n assert(bf((\"Neptune\"), (\"Venus\")).equals((new ArrayList(Arrays.asList((String)\"Earth\", (String)\"Mars\", (String)\"Jupiter\", (String)\"Saturn\", (String)\"Uranus\")))));\n assert(bf((\"Earth\"), (\"Earth\")).equals((new ArrayList(Arrays.asList()))));\n assert(bf((\"Mars\"), (\"Earth\")).equals((new ArrayList(Arrays.asList()))));\n assert(bf((\"Jupiter\"), (\"Makemake\")).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a list of integers.\n // Write a function next_smallest() that returns the 2nd smallest element of the list.\n // Return None if there is no such element.\n // next_smallest([1, 2, 3, 4, 5]) == 2\n // next_smallest([5, 1, 4, 3, 2]) == 2\n // next_smallest([]) == None\n // next_smallest([1, 1]) == None\n public static Optional nextSmallest(ArrayList lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(nextSmallest((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l)))).equals(2l));\n assert(nextSmallest((new ArrayList(Arrays.asList((long)5l, (long)1l, (long)4l, (long)3l, (long)2l)))).equals(2l));\n assert(nextSmallest((new ArrayList(Arrays.asList()))).equals(Optional.empty()));\n assert(nextSmallest((new ArrayList(Arrays.asList((long)1l, (long)1l)))).equals(Optional.empty()));\n assert(nextSmallest((new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l, (long)0l)))).equals(1l));\n assert(nextSmallest((new ArrayList(Arrays.asList((long)1l, (long)1l)))).equals(Optional.empty()));\n assert(nextSmallest((new ArrayList(Arrays.asList((long)-35l, (long)34l, (long)12l, (long)-45l)))).equals(-35l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Input is a space-delimited string of numberals from 'zero' to 'nine'.\n // Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n // Return the string with numbers sorted from smallest to largest\n // >>> sort_numbers('three one five')\n // 'one three five'\n public static String sortNumbers(String numbers) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sortNumbers((\"\")).equals((\"\")));\n assert(sortNumbers((\"three\")).equals((\"three\")));\n assert(sortNumbers((\"three five nine\")).equals((\"three five nine\")));\n assert(sortNumbers((\"five zero four seven nine eight\")).equals((\"zero four five seven eight nine\")));\n assert(sortNumbers((\"six five four three two one zero\")).equals((\"zero one two three four five six\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n // cycpattern_check(\"abcd\",\"abd\") => False\n // cycpattern_check(\"hello\",\"ell\") => True\n // cycpattern_check(\"whassup\",\"psus\") => False\n // cycpattern_check(\"abab\",\"baa\") => True\n // cycpattern_check(\"efef\",\"eeff\") => False\n // cycpattern_check(\"himenss\",\"simen\") => True\n public static boolean cycpatternCheck(String a, String b) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(cycpatternCheck((\"xyzw\"), (\"xyw\")) == (false));\n assert(cycpatternCheck((\"yello\"), (\"ell\")) == (true));\n assert(cycpatternCheck((\"whattup\"), (\"ptut\")) == (false));\n assert(cycpatternCheck((\"efef\"), (\"fee\")) == (true));\n assert(cycpatternCheck((\"abab\"), (\"aabb\")) == (false));\n assert(cycpatternCheck((\"winemtt\"), (\"tinem\")) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You will be given a number in decimal form and your task is to convert it to\n // binary format. The function should return a string, with each character representing a binary\n // number. Each character in the string will be '0' or '1'.\n // There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n // The extra characters are there to help with the format.\n // Examples:\n // decimal_to_binary(15) # returns \"db1111db\"\n // decimal_to_binary(32) # returns \"db100000db\"\n public static String decimalToBinary(long decimal) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(decimalToBinary((0l)).equals((\"db0db\")));\n assert(decimalToBinary((32l)).equals((\"db100000db\")));\n assert(decimalToBinary((103l)).equals((\"db1100111db\")));\n assert(decimalToBinary((15l)).equals((\"db1111db\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Filter an input list of strings only for ones that contain given substring\n // >>> filter_by_substring([], 'a')\n // []\n // >>> filter_by_substring(['abc', 'bacd', 'cde', 'array'], 'a')\n // ['abc', 'bacd', 'array']\n public static ArrayList filterBySubstring(ArrayList strings, String substring) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(filterBySubstring((new ArrayList(Arrays.asList())), (\"john\")).equals((new ArrayList(Arrays.asList()))));\n assert(filterBySubstring((new ArrayList(Arrays.asList((String)\"xxx\", (String)\"asd\", (String)\"xxy\", (String)\"john doe\", (String)\"xxxAAA\", (String)\"xxx\"))), (\"xxx\")).equals((new ArrayList(Arrays.asList((String)\"xxx\", (String)\"xxxAAA\", (String)\"xxx\")))));\n assert(filterBySubstring((new ArrayList(Arrays.asList((String)\"xxx\", (String)\"asd\", (String)\"aaaxxy\", (String)\"john doe\", (String)\"xxxAAA\", (String)\"xxx\"))), (\"xx\")).equals((new ArrayList(Arrays.asList((String)\"xxx\", (String)\"aaaxxy\", (String)\"xxxAAA\", (String)\"xxx\")))));\n assert(filterBySubstring((new ArrayList(Arrays.asList((String)\"grunt\", (String)\"trumpet\", (String)\"prune\", (String)\"gruesome\"))), (\"run\")).equals((new ArrayList(Arrays.asList((String)\"grunt\", (String)\"prune\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given an integer. return a tuple that has the number of even and odd digits respectively.\n // Example:\n // even_odd_count(-12) ==> (1, 1)\n // even_odd_count(123) ==> (1, 2)\n public static Pair evenOddCount(long num) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(evenOddCount((7l)).equals((Pair.with(0l, 1l))));\n assert(evenOddCount((-78l)).equals((Pair.with(1l, 1l))));\n assert(evenOddCount((3452l)).equals((Pair.with(2l, 2l))));\n assert(evenOddCount((346211l)).equals((Pair.with(3l, 3l))));\n assert(evenOddCount((-345821l)).equals((Pair.with(3l, 3l))));\n assert(evenOddCount((-2l)).equals((Pair.with(1l, 0l))));\n assert(evenOddCount((-45347l)).equals((Pair.with(2l, 3l))));\n assert(evenOddCount((0l)).equals((Pair.with(1l, 0l))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that accepts a list of strings.\n // The list contains different words. Return the word with maximum number\n // of unique characters. If multiple strings have maximum number of unique\n // characters, return the one which comes first in lexicographical order.\n // find_max([\"name\", \"of\", \"string\"]) == \"string\"\n // find_max([\"name\", \"enam\", \"game\"]) == \"enam\"\n // find_max([\"aaaaaaa\", \"bb\" ,\"cc\"]) == \"\"aaaaaaa\"\n public static String findMax(ArrayList words) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(findMax((new ArrayList(Arrays.asList((String)\"name\", (String)\"of\", (String)\"string\")))).equals((\"string\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"name\", (String)\"enam\", (String)\"game\")))).equals((\"enam\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"aaaaaaa\", (String)\"bb\", (String)\"cc\")))).equals((\"aaaaaaa\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"abc\", (String)\"cba\")))).equals((\"abc\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"play\", (String)\"this\", (String)\"game\", (String)\"of\", (String)\"footbott\")))).equals((\"footbott\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"we\", (String)\"are\", (String)\"gonna\", (String)\"rock\")))).equals((\"gonna\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"we\", (String)\"are\", (String)\"a\", (String)\"mad\", (String)\"nation\")))).equals((\"nation\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"this\", (String)\"is\", (String)\"a\", (String)\"prrk\")))).equals((\"this\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"b\")))).equals((\"b\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"play\", (String)\"play\", (String)\"play\")))).equals((\"play\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a positive integer n, return the count of the numbers of n-digit\n // positive integers that start or end with 1.\n public static long startsOneEnds(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(startsOneEnds((1l)) == (1l));\n assert(startsOneEnds((2l)) == (18l));\n assert(startsOneEnds((3l)) == (180l));\n assert(startsOneEnds((4l)) == (1800l));\n assert(startsOneEnds((5l)) == (18000l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function that returns a tuple (a, b), where 'a' is\n // the largest of negative integers, and 'b' is the smallest\n // of positive integers in a list.\n // If there is no negative or positive integers, return them as None.\n // Examples:\n // largest_smallest_integers([2, 4, 1, 3, 5, 7]) == (None, 1)\n // largest_smallest_integers([]) == (None, None)\n // largest_smallest_integers([0]) == (None, None)\n public static Pair, Optional> largestSmallestIntegers(ArrayList lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)1l, (long)3l, (long)5l, (long)7l)))).equals(Pair.with(Optional.of(Optional.empty()), Optional.of(1l))));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)1l, (long)3l, (long)5l, (long)7l, (long)0l)))).equals(Pair.with(Optional.of(Optional.empty()), Optional.of(1l))));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)4l, (long)5l, (long)6l, (long)-2l)))).equals(Pair.with(-2l, 1l)));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)4l, (long)5l, (long)3l, (long)6l, (long)2l, (long)7l, (long)-7l)))).equals(Pair.with(-7l, 2l)));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)7l, (long)3l, (long)8l, (long)4l, (long)9l, (long)2l, (long)5l, (long)-9l)))).equals(Pair.with(-9l, 2l)));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList()))).equals(Pair.with(Optional.of(Optional.empty()), Optional.of(Optional.empty()))));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)0l)))).equals(Pair.with(Optional.of(Optional.empty()), Optional.of(Optional.empty()))));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)-1l, (long)-3l, (long)-5l, (long)-6l)))).equals(Pair.with(Optional.of(-1l), Optional.of(Optional.empty()))));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)-1l, (long)-3l, (long)-5l, (long)-6l, (long)0l)))).equals(Pair.with(Optional.of(-1l), Optional.of(Optional.empty()))));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)-6l, (long)-4l, (long)-4l, (long)-3l, (long)1l)))).equals(Pair.with(-3l, 1l)));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)-6l, (long)-4l, (long)-4l, (long)-3l, (long)-100l, (long)1l)))).equals(Pair.with(-3l, 1l)));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // \"Given an array representing a branch of a tree that has non-negative integer nodes\n // your task is to pluck one of the nodes and return it.\n // The plucked node should be the node with the smallest even value.\n // If multiple nodes with the same smallest even value are found return the node that has smallest index.\n // The plucked node should be returned in a list, [ smalest_value, its index ],\n // If there are no even values or the given array is empty, return [].\n // Example 1:\n // Input: [4,2,3]\n // Output: [2, 1]\n // Explanation: 2 has the smallest even value, and 2 has the smallest index.\n // Example 2:\n // Input: [1,2,3]\n // Output: [2, 1]\n // Explanation: 2 has the smallest even value, and 2 has the smallest index. \n // Example 3:\n // Input: []\n // Output: []\n // Example 4:\n // Input: [5, 0, 3, 0, 4, 2]\n // Output: [0, 1]\n // Explanation: 0 is the smallest value, but there are two zeros,\n // so we will choose the first zero, which has the smallest index.\n // Constraints:\n // * 1 <= nodes.length <= 10000\n // * 0 <= node.value\n public static ArrayList pluck(ArrayList arr) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(pluck((new ArrayList(Arrays.asList((long)4l, (long)2l, (long)3l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)1l)))));\n assert(pluck((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)1l)))));\n assert(pluck((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(pluck((new ArrayList(Arrays.asList((long)5l, (long)0l, (long)3l, (long)0l, (long)4l, (long)2l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)1l)))));\n assert(pluck((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)0l, (long)5l, (long)3l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)3l)))));\n assert(pluck((new ArrayList(Arrays.asList((long)5l, (long)4l, (long)8l, (long)4l, (long)8l)))).equals((new ArrayList(Arrays.asList((long)4l, (long)1l)))));\n assert(pluck((new ArrayList(Arrays.asList((long)7l, (long)6l, (long)7l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)6l, (long)1l)))));\n assert(pluck((new ArrayList(Arrays.asList((long)7l, (long)9l, (long)7l, (long)1l)))).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function count_nums which takes an array of integers and returns\n // the number of elements which has a sum of digits > 0.\n // If a number is negative, then its first signed digit will be negative:\n // e.g. -123 has signed digits -1, 2, and 3.\n // >>> count_nums([]) == 0\n // >>> count_nums([-1, 11, -11]) == 1\n // >>> count_nums([1, 1, 2]) == 3\n public static long countNums(ArrayList arr) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(countNums((new ArrayList(Arrays.asList()))) == (0l));\n assert(countNums((new ArrayList(Arrays.asList((long)-1l, (long)-2l, (long)0l)))) == (0l));\n assert(countNums((new ArrayList(Arrays.asList((long)1l, (long)1l, (long)2l, (long)-2l, (long)3l, (long)4l, (long)5l)))) == (6l));\n assert(countNums((new ArrayList(Arrays.asList((long)1l, (long)6l, (long)9l, (long)-6l, (long)0l, (long)1l, (long)5l)))) == (5l));\n assert(countNums((new ArrayList(Arrays.asList((long)1l, (long)100l, (long)98l, (long)-7l, (long)1l, (long)-1l)))) == (4l));\n assert(countNums((new ArrayList(Arrays.asList((long)12l, (long)23l, (long)34l, (long)-45l, (long)-56l, (long)0l)))) == (5l));\n assert(countNums((new ArrayList(Arrays.asList((long)0l, (long)1l)))) == (1l));\n assert(countNums((new ArrayList(Arrays.asList((long)1l)))) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n // each cell of the grid contains a value. Every integer in the range [1, N * N]\n // inclusive appears exactly once on the cells of the grid.\n // You have to find the minimum path of length k in the grid. You can start\n // from any cell, and in each step you can move to any of the neighbor cells,\n // in other words, you can go to cells which share an edge with you current\n // cell.\n // Please note that a path of length k means visiting exactly k cells (not\n // necessarily distinct).\n // You CANNOT go off the grid.\n // A path A (of length k) is considered less than a path B (of length k) if\n // after making the ordered lists of the values on the cells that A and B go\n // through (let's call them lst_A and lst_B), lst_A is lexicographically less\n // than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n // such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n // lst_A[j] = lst_B[j].\n // It is guaranteed that the answer is unique.\n // Return an ordered list of the values on the cells that the minimum path go through.\n // Examples:\n // Input: grid = [ [1,2,3], [4,5,6], [7,8,9]], k = 3\n // Output: [1, 2, 1]\n // Input: grid = [ [5,9,3], [4,1,6], [7,8,2]], k = 1\n // Output: [1]\n public static ArrayList minPath(ArrayList> grid, long k) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)), (ArrayList)new ArrayList(Arrays.asList((long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)7l, (long)8l, (long)9l))))), (3l)).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)1l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)5l, (long)9l, (long)3l)), (ArrayList)new ArrayList(Arrays.asList((long)4l, (long)1l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)7l, (long)8l, (long)2l))))), (1l)).equals((new ArrayList(Arrays.asList((long)1l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)), (ArrayList)new ArrayList(Arrays.asList((long)5l, (long)6l, (long)7l, (long)8l)), (ArrayList)new ArrayList(Arrays.asList((long)9l, (long)10l, (long)11l, (long)12l)), (ArrayList)new ArrayList(Arrays.asList((long)13l, (long)14l, (long)15l, (long)16l))))), (4l)).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)1l, (long)2l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)6l, (long)4l, (long)13l, (long)10l)), (ArrayList)new ArrayList(Arrays.asList((long)5l, (long)7l, (long)12l, (long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)3l, (long)16l, (long)11l, (long)15l)), (ArrayList)new ArrayList(Arrays.asList((long)8l, (long)14l, (long)9l, (long)2l))))), (7l)).equals((new ArrayList(Arrays.asList((long)1l, (long)10l, (long)1l, (long)10l, (long)1l, (long)10l, (long)1l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)8l, (long)14l, (long)9l, (long)2l)), (ArrayList)new ArrayList(Arrays.asList((long)6l, (long)4l, (long)13l, (long)15l)), (ArrayList)new ArrayList(Arrays.asList((long)5l, (long)7l, (long)1l, (long)12l)), (ArrayList)new ArrayList(Arrays.asList((long)3l, (long)10l, (long)11l, (long)16l))))), (5l)).equals((new ArrayList(Arrays.asList((long)1l, (long)7l, (long)1l, (long)7l, (long)1l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)11l, (long)8l, (long)7l, (long)2l)), (ArrayList)new ArrayList(Arrays.asList((long)5l, (long)16l, (long)14l, (long)4l)), (ArrayList)new ArrayList(Arrays.asList((long)9l, (long)3l, (long)15l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)12l, (long)13l, (long)10l, (long)1l))))), (9l)).equals((new ArrayList(Arrays.asList((long)1l, (long)6l, (long)1l, (long)6l, (long)1l, (long)6l, (long)1l, (long)6l, (long)1l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)12l, (long)13l, (long)10l, (long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)9l, (long)3l, (long)15l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)5l, (long)16l, (long)14l, (long)4l)), (ArrayList)new ArrayList(Arrays.asList((long)11l, (long)8l, (long)7l, (long)2l))))), (12l)).equals((new ArrayList(Arrays.asList((long)1l, (long)6l, (long)1l, (long)6l, (long)1l, (long)6l, (long)1l, (long)6l, (long)1l, (long)6l, (long)1l, (long)6l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)2l, (long)7l, (long)4l)), (ArrayList)new ArrayList(Arrays.asList((long)3l, (long)1l, (long)5l)), (ArrayList)new ArrayList(Arrays.asList((long)6l, (long)8l, (long)9l))))), (8l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)1l, (long)3l, (long)1l, (long)3l, (long)1l, (long)3l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)6l, (long)1l, (long)5l)), (ArrayList)new ArrayList(Arrays.asList((long)3l, (long)8l, (long)9l)), (ArrayList)new ArrayList(Arrays.asList((long)2l, (long)7l, (long)4l))))), (8l)).equals((new ArrayList(Arrays.asList((long)1l, (long)5l, (long)1l, (long)5l, (long)1l, (long)5l, (long)1l, (long)5l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l)), (ArrayList)new ArrayList(Arrays.asList((long)3l, (long)4l))))), (10l)).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)1l, (long)2l, (long)1l, (long)2l, (long)1l, (long)2l, (long)1l, (long)2l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)3l)), (ArrayList)new ArrayList(Arrays.asList((long)3l, (long)2l))))), (10l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)1l, (long)3l, (long)1l, (long)3l, (long)1l, (long)3l, (long)1l, (long)3l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given list of integers, return list in strange order.\n // Strange sorting, is when you start with the minimum value,\n // then maximum of the remaining integers, then minimum and so on.\n // Examples:\n // strange_sort_list([1, 2, 3, 4]) == [1, 4, 2, 3]\n // strange_sort_list([5, 5, 5, 5]) == [5, 5, 5, 5]\n // strange_sort_list([]) == []\n public static ArrayList strangeSortList(ArrayList lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(strangeSortList((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)2l, (long)3l)))));\n assert(strangeSortList((new ArrayList(Arrays.asList((long)5l, (long)6l, (long)7l, (long)8l, (long)9l)))).equals((new ArrayList(Arrays.asList((long)5l, (long)9l, (long)6l, (long)8l, (long)7l)))));\n assert(strangeSortList((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)5l, (long)2l, (long)4l, (long)3l)))));\n assert(strangeSortList((new ArrayList(Arrays.asList((long)5l, (long)6l, (long)7l, (long)8l, (long)9l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)9l, (long)5l, (long)8l, (long)6l, (long)7l)))));\n assert(strangeSortList((new ArrayList(Arrays.asList((long)5l, (long)5l, (long)5l, (long)5l)))).equals((new ArrayList(Arrays.asList((long)5l, (long)5l, (long)5l, (long)5l)))));\n assert(strangeSortList((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(strangeSortList((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l, (long)7l, (long)8l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)8l, (long)2l, (long)7l, (long)3l, (long)6l, (long)4l, (long)5l)))));\n assert(strangeSortList((new ArrayList(Arrays.asList((long)0l, (long)2l, (long)2l, (long)2l, (long)5l, (long)5l, (long)-5l, (long)-5l)))).equals((new ArrayList(Arrays.asList((long)-5l, (long)5l, (long)-5l, (long)5l, (long)0l, (long)2l, (long)2l, (long)2l)))));\n assert(strangeSortList((new ArrayList(Arrays.asList((long)111111l)))).equals((new ArrayList(Arrays.asList((long)111111l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a string 'text', return its md5 hash equivalent string.\n // If 'text' is an empty string, return None.\n // >>> string_to_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'\n public static Optional stringToMd5(String text) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(stringToMd5((\"Hello world\")).equals(\"3e25960a79dbc69b674cd4ec67a72c62\"));\n assert(stringToMd5((\"\")).equals(Optional.empty()));\n assert(stringToMd5((\"A B C\")).equals(\"0ef78513b0cb8cef12743f5aeb35f888\"));\n assert(stringToMd5((\"password\")).equals(\"5f4dcc3b5aa765d61d8327deb882cf99\"));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a word. Your task is to find the closest vowel that stands between \n // two consonants from the right side of the word (case sensitive).\n // Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n // find any vowel met the above condition. \n // You may assume that the given string contains English letter only.\n // Example:\n // get_closest_vowel(\"yogurt\") ==> \"u\"\n // get_closest_vowel(\"FULL\") ==> \"U\"\n // get_closest_vowel(\"quick\") ==> \"\"\n // get_closest_vowel(\"ab\") ==> \"\"\n public static String getClosestVowel(String word) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(getClosestVowel((\"yogurt\")).equals((\"u\")));\n assert(getClosestVowel((\"full\")).equals((\"u\")));\n assert(getClosestVowel((\"easy\")).equals((\"\")));\n assert(getClosestVowel((\"eAsy\")).equals((\"\")));\n assert(getClosestVowel((\"ali\")).equals((\"\")));\n assert(getClosestVowel((\"bad\")).equals((\"a\")));\n assert(getClosestVowel((\"most\")).equals((\"o\")));\n assert(getClosestVowel((\"ab\")).equals((\"\")));\n assert(getClosestVowel((\"ba\")).equals((\"\")));\n assert(getClosestVowel((\"quick\")).equals((\"\")));\n assert(getClosestVowel((\"anime\")).equals((\"i\")));\n assert(getClosestVowel((\"Asia\")).equals((\"\")));\n assert(getClosestVowel((\"Above\")).equals((\"o\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Change numerical base of input number x to base.\n // return string representation after the conversion.\n // base numbers are less than 10.\n // >>> change_base(8, 3)\n // '22'\n // >>> change_base(8, 2)\n // '1000'\n // >>> change_base(7, 2)\n // '111'\n public static String changeBase(long x, long base) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(changeBase((8l), (3l)).equals((\"22\")));\n assert(changeBase((9l), (3l)).equals((\"100\")));\n assert(changeBase((234l), (2l)).equals((\"11101010\")));\n assert(changeBase((16l), (2l)).equals((\"10000\")));\n assert(changeBase((8l), (2l)).equals((\"1000\")));\n assert(changeBase((7l), (2l)).equals((\"111\")));\n assert(changeBase((2l), (3l)).equals((\"2\")));\n assert(changeBase((3l), (4l)).equals((\"3\")));\n assert(changeBase((4l), (5l)).equals((\"4\")));\n assert(changeBase((5l), (6l)).equals((\"5\")));\n assert(changeBase((6l), (7l)).equals((\"6\")));\n assert(changeBase((7l), (8l)).equals((\"7\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Check if in given list of numbers, are any two numbers closer to each other than\n // given threshold.\n // >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n // False\n // >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n // True\n public static boolean hasCloseElements(ArrayList numbers, float threshold) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(hasCloseElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.9f, (float)4.0f, (float)5.0f, (float)2.2f))), (0.3f)) == (true));\n assert(hasCloseElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.9f, (float)4.0f, (float)5.0f, (float)2.2f))), (0.05f)) == (false));\n assert(hasCloseElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)5.9f, (float)4.0f, (float)5.0f))), (0.95f)) == (true));\n assert(hasCloseElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)5.9f, (float)4.0f, (float)5.0f))), (0.8f)) == (false));\n assert(hasCloseElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.0f))), (0.1f)) == (true));\n assert(hasCloseElements((new ArrayList(Arrays.asList((float)1.1f, (float)2.2f, (float)3.1f, (float)4.1f, (float)5.1f))), (1.0f)) == (true));\n assert(hasCloseElements((new ArrayList(Arrays.asList((float)1.1f, (float)2.2f, (float)3.1f, (float)4.1f, (float)5.1f))), (0.5f)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function that takes a string as input which contains only square brackets.\n // The function should return True if and only if there is a valid subsequence of brackets \n // where at least one bracket in the subsequence is nested.\n // is_nested('[[]]') \u279e True\n // is_nested('[]]]]]]][[[[[]') \u279e False\n // is_nested('[][]') \u279e False\n // is_nested('[]') \u279e False\n // is_nested('[[][]]') \u279e True\n // is_nested('[[]][[') \u279e True\n public static boolean isNested(String string) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(isNested((\"[[]]\")) == (true));\n assert(isNested((\"[]]]]]]][[[[[]\")) == (false));\n assert(isNested((\"[][]\")) == (false));\n assert(isNested((\"[]\")) == (false));\n assert(isNested((\"[[[[]]]]\")) == (true));\n assert(isNested((\"[]]]]]]]]]]\")) == (false));\n assert(isNested((\"[][][[]]\")) == (true));\n assert(isNested((\"[[]\")) == (false));\n assert(isNested((\"[]]\")) == (false));\n assert(isNested((\"[[]][[\")) == (true));\n assert(isNested((\"[[][]]\")) == (true));\n assert(isNested((\"\")) == (false));\n assert(isNested((\"[[[[[[[[\")) == (false));\n assert(isNested((\"]]]]]]]]\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Concatenate list of strings into a single string\n // >>> concatenate([])\n // ''\n // >>> concatenate(['a', 'b', 'c'])\n // 'abc'\n public static String concatenate(ArrayList strings) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(concatenate((new ArrayList(Arrays.asList()))).equals((\"\")));\n assert(concatenate((new ArrayList(Arrays.asList((String)\"x\", (String)\"y\", (String)\"z\")))).equals((\"xyz\")));\n assert(concatenate((new ArrayList(Arrays.asList((String)\"x\", (String)\"y\", (String)\"z\", (String)\"w\", (String)\"k\")))).equals((\"xyzwk\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n // >>> prime_fib(1)\n // 2\n // >>> prime_fib(2)\n // 3\n // >>> prime_fib(3)\n // 5\n // >>> prime_fib(4)\n // 13\n // >>> prime_fib(5)\n // 89\n public static long primeFib(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(primeFib((1l)) == (2l));\n assert(primeFib((2l)) == (3l));\n assert(primeFib((3l)) == (5l));\n assert(primeFib((4l)) == (13l));\n assert(primeFib((5l)) == (89l));\n assert(primeFib((6l)) == (233l));\n assert(primeFib((7l)) == (1597l));\n assert(primeFib((8l)) == (28657l));\n assert(primeFib((9l)) == (514229l));\n assert(primeFib((10l)) == (433494437l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n // other and return them in order (smaller number, larger number).\n // >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n // (2.0, 2.2)\n // >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n // (2.0, 2.0)\n public static Pair findClosestElements(ArrayList numbers) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(findClosestElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.9f, (float)4.0f, (float)5.0f, (float)2.2f)))).equals((Pair.with(3.9f, 4.0f))));\n assert(findClosestElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)5.9f, (float)4.0f, (float)5.0f)))).equals((Pair.with(5.0f, 5.9f))));\n assert(findClosestElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.2f)))).equals((Pair.with(2.0f, 2.2f))));\n assert(findClosestElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.0f)))).equals((Pair.with(2.0f, 2.0f))));\n assert(findClosestElements((new ArrayList(Arrays.asList((float)1.1f, (float)2.2f, (float)3.1f, (float)4.1f, (float)5.1f)))).equals((Pair.with(2.2f, 3.1f))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You have been tasked to write a function that receives \n // a hexadecimal number as a string and counts the number of hexadecimal \n // digits that are primes (prime number, or a prime, is a natural number \n // greater than 1 that is not a product of two smaller natural numbers).\n // Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n // Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n // So you have to determine a number of the following digits: 2, 3, 5, 7, \n // B (=decimal 11), D (=decimal 13).\n // Note: you may assume the input is always correct or empty string, \n // and symbols A,B,C,D,E,F are always uppercase.\n // Examples:\n // For num = \"AB\" the output should be 1.\n // For num = \"1077E\" the output should be 2.\n // For num = \"ABED1A33\" the output should be 4.\n // For num = \"123456789ABCDEF0\" the output should be 6.\n // For num = \"2020\" the output should be 2.\n public static long hexKey(String num) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(hexKey((\"AB\")) == (1l));\n assert(hexKey((\"1077E\")) == (2l));\n assert(hexKey((\"ABED1A33\")) == (4l));\n assert(hexKey((\"2020\")) == (2l));\n assert(hexKey((\"123456789ABCDEF0\")) == (6l));\n assert(hexKey((\"112233445566778899AABBCCDDEEFF00\")) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Complete the function that takes two integers and returns \n // the product of their unit digits.\n // Assume the input is always valid.\n // Examples:\n // multiply(148, 412) should return 16.\n // multiply(19, 28) should return 72.\n // multiply(2020, 1851) should return 0.\n // multiply(14,-15) should return 20.\n public static long multiply(long a, long b) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(multiply((148l), (412l)) == (16l));\n assert(multiply((19l), (28l)) == (72l));\n assert(multiply((2020l), (1851l)) == (0l));\n assert(multiply((14l), (-15l)) == (20l));\n assert(multiply((76l), (67l)) == (42l));\n assert(multiply((17l), (27l)) == (49l));\n assert(multiply((0l), (1l)) == (0l));\n assert(multiply((0l), (0l)) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given list of numbers (of at least two elements), apply a linear transform to that list,\n // such that the smallest number will become 0 and the largest will become 1\n // >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n // [0.0, 0.25, 0.5, 0.75, 1.0]\n public static ArrayList rescaleToUnit(ArrayList numbers) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(rescaleToUnit((new ArrayList(Arrays.asList((float)2.0f, (float)49.9f)))).equals((new ArrayList(Arrays.asList((float)0.0f, (float)1.0f)))));\n assert(rescaleToUnit((new ArrayList(Arrays.asList((float)100.0f, (float)49.9f)))).equals((new ArrayList(Arrays.asList((float)1.0f, (float)0.0f)))));\n assert(rescaleToUnit((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f)))).equals((new ArrayList(Arrays.asList((float)0.0f, (float)0.25f, (float)0.5f, (float)0.75f, (float)1.0f)))));\n assert(rescaleToUnit((new ArrayList(Arrays.asList((float)2.0f, (float)1.0f, (float)5.0f, (float)3.0f, (float)4.0f)))).equals((new ArrayList(Arrays.asList((float)0.25f, (float)0.0f, (float)1.0f, (float)0.5f, (float)0.75f)))));\n assert(rescaleToUnit((new ArrayList(Arrays.asList((float)12.0f, (float)11.0f, (float)15.0f, (float)13.0f, (float)14.0f)))).equals((new ArrayList(Arrays.asList((float)0.25f, (float)0.0f, (float)1.0f, (float)0.5f, (float)0.75f)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a positive integer n, return the product of the odd digits.\n // Return 0 if all digits are even.\n // For example:\n // digits(1) == 1\n // digits(4) == 0\n // digits(235) == 15\n public static long digits(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(digits((5l)) == (5l));\n assert(digits((54l)) == (5l));\n assert(digits((120l)) == (1l));\n assert(digits((5014l)) == (5l));\n assert(digits((98765l)) == (315l));\n assert(digits((5576543l)) == (2625l));\n assert(digits((2468l)) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You will be given the name of a class (a string) and a list of extensions.\n // The extensions are to be used to load additional classes to the class. The\n // strength of the extension is as follows: Let CAP be the number of the uppercase\n // letters in the extension's name, and let SM be the number of lowercase letters \n // in the extension's name, the strength is given by the fraction CAP - SM. \n // You should find the strongest extension and return a string in this \n // format: ClassName.StrongestExtensionName.\n // If there are two or more extensions with the same strength, you should\n // choose the one that comes first in the list.\n // For example, if you are given \"Slices\" as the class and a list of the\n // extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n // return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n // (its strength is -1).\n // Example:\n // for Strongest_Extension('my_class', ['AA', 'Be', 'CC']) == 'my_class.AA'\n public static String StrongestExtension(String class_name, ArrayList extensions) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(StrongestExtension((\"Watashi\"), (new ArrayList(Arrays.asList((String)\"tEN\", (String)\"niNE\", (String)\"eIGHt8OKe\")))).equals((\"Watashi.eIGHt8OKe\")));\n assert(StrongestExtension((\"Boku123\"), (new ArrayList(Arrays.asList((String)\"nani\", (String)\"NazeDa\", (String)\"YEs.WeCaNe\", (String)\"32145tggg\")))).equals((\"Boku123.YEs.WeCaNe\")));\n assert(StrongestExtension((\"__YESIMHERE\"), (new ArrayList(Arrays.asList((String)\"t\", (String)\"eMptY\", (String)\"nothing\", (String)\"zeR00\", (String)\"NuLl__\", (String)\"123NoooneB321\")))).equals((\"__YESIMHERE.NuLl__\")));\n assert(StrongestExtension((\"K\"), (new ArrayList(Arrays.asList((String)\"Ta\", (String)\"TAR\", (String)\"t234An\", (String)\"cosSo\")))).equals((\"K.TAR\")));\n assert(StrongestExtension((\"__HAHA\"), (new ArrayList(Arrays.asList((String)\"Tab\", (String)\"123\", (String)\"781345\", (String)\"-_-\")))).equals((\"__HAHA.123\")));\n assert(StrongestExtension((\"YameRore\"), (new ArrayList(Arrays.asList((String)\"HhAas\", (String)\"okIWILL123\", (String)\"WorkOut\", (String)\"Fails\", (String)\"-_-\")))).equals((\"YameRore.okIWILL123\")));\n assert(StrongestExtension((\"finNNalLLly\"), (new ArrayList(Arrays.asList((String)\"Die\", (String)\"NowW\", (String)\"Wow\", (String)\"WoW\")))).equals((\"finNNalLLly.WoW\")));\n assert(StrongestExtension((\"_\"), (new ArrayList(Arrays.asList((String)\"Bb\", (String)\"91245\")))).equals((\"_.Bb\")));\n assert(StrongestExtension((\"Sp\"), (new ArrayList(Arrays.asList((String)\"671235\", (String)\"Bb\")))).equals((\"Sp.671235\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a string representing a space separated lowercase letters, return a dictionary\n // of the letter with the most repetition and containing the corresponding count.\n // If several letters have the same occurrence, return all of them.\n // Example:\n // histogram('a b c') == {'a': 1, 'b': 1, 'c': 1}\n // histogram('a b b a') == {'a': 2, 'b': 2}\n // histogram('a b c a b') == {'a': 2, 'b': 2}\n // histogram('b b b b a') == {'b': 4}\n // histogram('') == {}\n public static HashMap histogram(String test) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(histogram((\"a b b a\")).equals((new HashMap(Map.of(\"a\", 2l, \"b\", 2l)))));\n assert(histogram((\"a b c a b\")).equals((new HashMap(Map.of(\"a\", 2l, \"b\", 2l)))));\n assert(histogram((\"a b c d g\")).equals((new HashMap(Map.of(\"a\", 1l, \"b\", 1l, \"c\", 1l, \"d\", 1l, \"g\", 1l)))));\n assert(histogram((\"r t g\")).equals((new HashMap(Map.of(\"r\", 1l, \"t\", 1l, \"g\", 1l)))));\n assert(histogram((\"b b b b a\")).equals((new HashMap(Map.of(\"b\", 4l)))));\n assert(histogram((\"r t g\")).equals((new HashMap(Map.of(\"r\", 1l, \"t\", 1l, \"g\", 1l)))));\n assert(histogram((\"\")).equals((new HashMap())));\n assert(histogram((\"a\")).equals((new HashMap(Map.of(\"a\", 1l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // pairs_sum_to_zero takes a list of integers as an input.\n // it returns True if there are two distinct elements in the list that\n // sum to zero, and False otherwise.\n // >>> pairs_sum_to_zero([1, 3, 5, 0])\n // False\n // >>> pairs_sum_to_zero([1, 3, -2, 1])\n // False\n // >>> pairs_sum_to_zero([1, 2, 3, 7])\n // False\n // >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7])\n // True\n // >>> pairs_sum_to_zero([1])\n // False\n public static boolean pairsSumToZero(ArrayList l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)5l, (long)0l)))) == (false));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)-2l, (long)1l)))) == (false));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)7l)))) == (false));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)-5l, (long)3l, (long)5l, (long)7l)))) == (true));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)1l)))) == (false));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)-3l, (long)9l, (long)-1l, (long)3l, (long)2l, (long)30l)))) == (true));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)-3l, (long)9l, (long)-1l, (long)3l, (long)2l, (long)31l)))) == (true));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)-3l, (long)9l, (long)-1l, (long)4l, (long)2l, (long)30l)))) == (false));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)-3l, (long)9l, (long)-1l, (long)4l, (long)2l, (long)31l)))) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that accepts two lists of strings and returns the list that has \n // total number of chars in the all strings of the list less than the other list.\n // if the two lists have the same number of chars, return the first list.\n // Examples\n // total_match([], []) \u279e []\n // total_match(['hi', 'admin'], ['hI', 'Hi']) \u279e ['hI', 'Hi']\n // total_match(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) \u279e ['hi', 'admin']\n // total_match(['hi', 'admin'], ['hI', 'hi', 'hi']) \u279e ['hI', 'hi', 'hi']\n // total_match(['4'], ['1', '2', '3', '4', '5']) \u279e ['4']\n public static ArrayList totalMatch(ArrayList lst1, ArrayList lst2) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(totalMatch((new ArrayList(Arrays.asList())), (new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(totalMatch((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\"))), (new ArrayList(Arrays.asList((String)\"hi\", (String)\"hi\")))).equals((new ArrayList(Arrays.asList((String)\"hi\", (String)\"hi\")))));\n assert(totalMatch((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\"))), (new ArrayList(Arrays.asList((String)\"hi\", (String)\"hi\", (String)\"admin\", (String)\"project\")))).equals((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\")))));\n assert(totalMatch((new ArrayList(Arrays.asList((String)\"4\"))), (new ArrayList(Arrays.asList((String)\"1\", (String)\"2\", (String)\"3\", (String)\"4\", (String)\"5\")))).equals((new ArrayList(Arrays.asList((String)\"4\")))));\n assert(totalMatch((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\"))), (new ArrayList(Arrays.asList((String)\"hI\", (String)\"Hi\")))).equals((new ArrayList(Arrays.asList((String)\"hI\", (String)\"Hi\")))));\n assert(totalMatch((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\"))), (new ArrayList(Arrays.asList((String)\"hI\", (String)\"hi\", (String)\"hi\")))).equals((new ArrayList(Arrays.asList((String)\"hI\", (String)\"hi\", (String)\"hi\")))));\n assert(totalMatch((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\"))), (new ArrayList(Arrays.asList((String)\"hI\", (String)\"hi\", (String)\"hii\")))).equals((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\")))));\n assert(totalMatch((new ArrayList(Arrays.asList())), (new ArrayList(Arrays.asList((String)\"this\")))).equals((new ArrayList(Arrays.asList()))));\n assert(totalMatch((new ArrayList(Arrays.asList((String)\"this\"))), (new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Circular shift the digits of the integer x, shift the digits right by shift\n // and return the result as a string.\n // If shift > number of digits, return digits reversed.\n // >>> circular_shift(12, 1)\n // \"21\"\n // >>> circular_shift(12, 2)\n // \"12\"\n public static String circularShift(long x, long shift) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(circularShift((100l), (2l)).equals((\"001\")));\n assert(circularShift((12l), (2l)).equals((\"12\")));\n assert(circularShift((97l), (8l)).equals((\"79\")));\n assert(circularShift((12l), (1l)).equals((\"21\")));\n assert(circularShift((11l), (101l)).equals((\"11\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return True is list elements are monotonically increasing or decreasing.\n // >>> monotonic([1, 2, 4, 20])\n // True\n // >>> monotonic([1, 20, 4, 10])\n // False\n // >>> monotonic([4, 1, 0, -10])\n // True\n public static boolean monotonic(ArrayList l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(monotonic((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)4l, (long)10l)))) == (true));\n assert(monotonic((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)4l, (long)20l)))) == (true));\n assert(monotonic((new ArrayList(Arrays.asList((long)1l, (long)20l, (long)4l, (long)10l)))) == (false));\n assert(monotonic((new ArrayList(Arrays.asList((long)4l, (long)1l, (long)0l, (long)-10l)))) == (true));\n assert(monotonic((new ArrayList(Arrays.asList((long)4l, (long)1l, (long)1l, (long)0l)))) == (true));\n assert(monotonic((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)2l, (long)5l, (long)60l)))) == (false));\n assert(monotonic((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)60l)))) == (true));\n assert(monotonic((new ArrayList(Arrays.asList((long)9l, (long)9l, (long)9l, (long)9l)))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n // Example\n // is_equal_to_sum_even(4) == False\n // is_equal_to_sum_even(6) == False\n // is_equal_to_sum_even(8) == True\n public static boolean isEqualToSumEven(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(isEqualToSumEven((4l)) == (false));\n assert(isEqualToSumEven((6l)) == (false));\n assert(isEqualToSumEven((8l)) == (true));\n assert(isEqualToSumEven((10l)) == (true));\n assert(isEqualToSumEven((11l)) == (false));\n assert(isEqualToSumEven((12l)) == (true));\n assert(isEqualToSumEven((13l)) == (false));\n assert(isEqualToSumEven((16l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Input to this function is a string representing musical notes in a special ASCII format.\n // Your task is to parse this string and return list of integers corresponding to how many beats does each\n // not last.\n // Here is a legend:\n // 'o' - whole note, lasts four beats\n // 'o|' - half note, lasts two beats\n // '.|' - quater note, lasts one beat\n // >>> parse_music('o o| .| o| o| .| .| .| .| o o')\n // [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\n public static ArrayList parseMusic(String music_string) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(parseMusic((\"\")).equals((new ArrayList(Arrays.asList()))));\n assert(parseMusic((\"o o o o\")).equals((new ArrayList(Arrays.asList((long)4l, (long)4l, (long)4l, (long)4l)))));\n assert(parseMusic((\".| .| .| .|\")).equals((new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l)))));\n assert(parseMusic((\"o| o| .| .| o o o o\")).equals((new ArrayList(Arrays.asList((long)2l, (long)2l, (long)1l, (long)1l, (long)4l, (long)4l, (long)4l, (long)4l)))));\n assert(parseMusic((\"o| .| o| .| o o| o o|\")).equals((new ArrayList(Arrays.asList((long)2l, (long)1l, (long)2l, (long)1l, (long)4l, (long)2l, (long)4l, (long)2l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // \"\n // This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n // multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n // change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n // Examples:\n // For lst = [1,2,3] the output should be 6\n // For lst = [] the output should be 0\n // For lst = [-1,-5,2,-1,-5] the output should be -126\n public static long sumSquares(ArrayList lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sumSquares((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)))) == (6l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)9l)))) == (14l));\n assert(sumSquares((new ArrayList(Arrays.asList()))) == (0l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l, (long)1l, (long)1l, (long)1l, (long)1l, (long)1l)))) == (9l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)-1l, (long)-1l, (long)-1l, (long)-1l, (long)-1l, (long)-1l, (long)-1l, (long)-1l, (long)-1l)))) == (-3l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)0l)))) == (0l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)-1l, (long)-5l, (long)2l, (long)-1l, (long)-5l)))) == (-126l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)-56l, (long)-99l, (long)1l, (long)0l, (long)-2l)))) == (3030l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)-1l, (long)0l, (long)0l, (long)0l, (long)0l, (long)0l, (long)0l, (long)0l, (long)-1l)))) == (0l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)-16l, (long)-9l, (long)-2l, (long)36l, (long)36l, (long)26l, (long)-20l, (long)25l, (long)-40l, (long)20l, (long)-4l, (long)12l, (long)-26l, (long)35l, (long)37l)))) == (-14196l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)-1l, (long)-3l, (long)17l, (long)-1l, (long)-15l, (long)13l, (long)-1l, (long)14l, (long)-14l, (long)-12l, (long)-5l, (long)14l, (long)-14l, (long)6l, (long)13l, (long)11l, (long)16l, (long)16l, (long)4l, (long)10l)))) == (-1448l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // triples_sum_to_zero takes a list of integers as an input.\n // it returns True if there are three distinct elements in the list that\n // sum to zero, and False otherwise.\n // >>> triples_sum_to_zero([1, 3, 5, 0])\n // False\n // >>> triples_sum_to_zero([1, 3, -2, 1])\n // True\n // >>> triples_sum_to_zero([1, 2, 3, 7])\n // False\n // >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n // True\n // >>> triples_sum_to_zero([1])\n // False\n public static boolean triplesSumToZero(ArrayList l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)5l, (long)0l)))) == (false));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)5l, (long)-1l)))) == (false));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)-2l, (long)1l)))) == (true));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)7l)))) == (false));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)5l, (long)7l)))) == (false));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)-5l, (long)3l, (long)9l, (long)7l)))) == (true));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)1l)))) == (false));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)5l, (long)-100l)))) == (false));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)100l, (long)3l, (long)5l, (long)-100l)))) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // brackets is a string of \"<\" and \">\".\n // return True if every opening bracket has a corresponding closing bracket.\n // >>> correct_bracketing(\"<\")\n // False\n // >>> correct_bracketing(\"<>\")\n // True\n // >>> correct_bracketing(\"<<><>>\")\n // True\n // >>> correct_bracketing(\"><<>\")\n // False\n public static boolean correctBracketing(String brackets) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(correctBracketing((\"<>\")) == (true));\n assert(correctBracketing((\"<<><>>\")) == (true));\n assert(correctBracketing((\"<><><<><>><>\")) == (true));\n assert(correctBracketing((\"<><><<<><><>><>><<><><<>>>\")) == (true));\n assert(correctBracketing((\"<<<><>>>>\")) == (false));\n assert(correctBracketing((\"><<>\")) == (false));\n assert(correctBracketing((\"<\")) == (false));\n assert(correctBracketing((\"<<<<\")) == (false));\n assert(correctBracketing((\">\")) == (false));\n assert(correctBracketing((\"<<>\")) == (false));\n assert(correctBracketing((\"<><><<><>><>><<>\")) == (false));\n assert(correctBracketing((\"<><><<><>><>>><>\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that takes an array of numbers as input and returns \n // the number of elements in the array that are greater than 10 and both \n // first and last digits of a number are odd (1, 3, 5, 7, 9).\n // For example:\n // specialFilter([15, -73, 14, -15]) => 1 \n // specialFilter([33, -2, -3, 45, 21, 109]) => 2\n public static long specialFilter(ArrayList nums) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(specialFilter((new ArrayList(Arrays.asList((long)5l, (long)-2l, (long)1l, (long)-5l)))) == (0l));\n assert(specialFilter((new ArrayList(Arrays.asList((long)15l, (long)-73l, (long)14l, (long)-15l)))) == (1l));\n assert(specialFilter((new ArrayList(Arrays.asList((long)33l, (long)-2l, (long)-3l, (long)45l, (long)21l, (long)109l)))) == (2l));\n assert(specialFilter((new ArrayList(Arrays.asList((long)43l, (long)-12l, (long)93l, (long)125l, (long)121l, (long)109l)))) == (4l));\n assert(specialFilter((new ArrayList(Arrays.asList((long)71l, (long)-2l, (long)-33l, (long)75l, (long)21l, (long)19l)))) == (3l));\n assert(specialFilter((new ArrayList(Arrays.asList((long)1l)))) == (0l));\n assert(specialFilter((new ArrayList(Arrays.asList()))) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a dictionary, return True if all keys are strings in lower \n // case or all keys are strings in upper case, else return False.\n // The function should return False is the given dictionary is empty.\n // Examples:\n // check_dict_case({\"a\":\"apple\", \"b\":\"banana\"}) should return True.\n // check_dict_case({\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}) should return False.\n // check_dict_case({\"a\":\"apple\", \"8\":\"banana\", \"a\":\"apple\"}) should return False.\n // check_dict_case({\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}) should return False.\n // check_dict_case({\"STATE\":\"NC\", \"ZIP\":\"12345\" }) should return True.\n public static boolean checkDictCase(HashMap dict) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(checkDictCase((new HashMap(Map.of(\"p\", \"pineapple\", \"b\", \"banana\")))) == (true));\n assert(checkDictCase((new HashMap(Map.of(\"p\", \"pineapple\", \"A\", \"banana\", \"B\", \"banana\")))) == (false));\n assert(checkDictCase((new HashMap(Map.of(\"p\", \"pineapple\", \"5\", \"banana\", \"a\", \"apple\")))) == (false));\n assert(checkDictCase((new HashMap(Map.of(\"Name\", \"John\", \"Age\", \"36\", \"City\", \"Houston\")))) == (false));\n assert(checkDictCase((new HashMap(Map.of(\"STATE\", \"NC\", \"ZIP\", \"12345\")))) == (true));\n assert(checkDictCase((new HashMap(Map.of(\"fruit\", \"Orange\", \"taste\", \"Sweet\")))) == (true));\n assert(checkDictCase((new HashMap())) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n // fibfib(0) == 0\n // fibfib(1) == 0\n // fibfib(2) == 1\n // fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n // Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n // >>> fibfib(1)\n // 0\n // >>> fibfib(5)\n // 4\n // >>> fibfib(8)\n // 24\n public static long fibfib(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(fibfib((2l)) == (1l));\n assert(fibfib((1l)) == (0l));\n assert(fibfib((5l)) == (4l));\n assert(fibfib((8l)) == (24l));\n assert(fibfib((10l)) == (81l));\n assert(fibfib((12l)) == (274l));\n assert(fibfib((14l)) == (927l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a list of numbers.\n // You need to return the sum of squared numbers in the given list,\n // round each element in the list to the upper int(Ceiling) first.\n // Examples:\n // For lst = [1,2,3] the output should be 14\n // For lst = [1,4,9] the output should be 98\n // For lst = [1,3,5,7] the output should be 84\n // For lst = [1.4,4.2,0] the output should be 29\n // For lst = [-2.4,1,1] the output should be 6\n public static long sumSquares(ArrayList lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sumSquares((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f)))) == (14l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f)))) == (14l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)1.0f, (float)3.0f, (float)5.0f, (float)7.0f)))) == (84l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)1.4f, (float)4.2f, (float)0.0f)))) == (29l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)-2.4f, (float)1.0f, (float)1.0f)))) == (6l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)100.0f, (float)1.0f, (float)15.0f, (float)2.0f)))) == (10230l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)10000.0f, (float)10000.0f)))) == (200000000l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)-1.4f, (float)4.6f, (float)6.3f)))) == (75l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)-1.4f, (float)17.9f, (float)18.9f, (float)19.9f)))) == (1086l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)0.0f)))) == (0l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)-1.0f)))) == (1l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)-1.0f, (float)1.0f, (float)0.0f)))) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_85_add", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a non-empty list of integers lst. add the even elements that are at odd indices..\n // Examples:\n // add([4, 2, 6, 7]) ==> 2\n public static long add(ArrayList lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(add((new ArrayList(Arrays.asList((long)4l, (long)88l)))) == (88l));\n assert(add((new ArrayList(Arrays.asList((long)4l, (long)5l, (long)6l, (long)7l, (long)2l, (long)122l)))) == (122l));\n assert(add((new ArrayList(Arrays.asList((long)4l, (long)0l, (long)6l, (long)7l)))) == (0l));\n assert(add((new ArrayList(Arrays.asList((long)4l, (long)4l, (long)6l, (long)8l)))) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return sorted unique elements in a list\n // >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123])\n // [0, 2, 3, 5, 9, 123]\n public static ArrayList unique(ArrayList l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(unique((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)5l, (long)2l, (long)3l, (long)3l, (long)9l, (long)0l, (long)123l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)2l, (long)3l, (long)5l, (long)9l, (long)123l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a string text, replace all spaces in it with underscores, \n // and if a string has more than 2 consecutive spaces, \n // then replace all consecutive spaces with - \n // fix_spaces(\"Example\") == \"Example\"\n // fix_spaces(\"Example 1\") == \"Example_1\"\n // fix_spaces(\" Example 2\") == \"_Example_2\"\n // fix_spaces(\" Example 3\") == \"_Example-3\"\n public static String fixSpaces(String text) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(fixSpaces((\"Example\")).equals((\"Example\")));\n assert(fixSpaces((\"Mudasir Hanif \")).equals((\"Mudasir_Hanif_\")));\n assert(fixSpaces((\"Yellow Yellow Dirty Fellow\")).equals((\"Yellow_Yellow__Dirty__Fellow\")));\n assert(fixSpaces((\"Exa mple\")).equals((\"Exa-mple\")));\n assert(fixSpaces((\" Exa 1 2 2 mple\")).equals((\"-Exa_1_2_2_mple\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return 2^n modulo p (be aware of numerics).\n // >>> modp(3, 5)\n // 3\n // >>> modp(1101, 101)\n // 2\n // >>> modp(0, 101)\n // 1\n // >>> modp(3, 11)\n // 8\n // >>> modp(100, 101)\n // 1\n public static long modp(long n, long p) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(modp((3l), (5l)) == (3l));\n assert(modp((1101l), (101l)) == (2l));\n assert(modp((0l), (101l)) == (1l));\n assert(modp((3l), (11l)) == (8l));\n assert(modp((100l), (101l)) == (1l));\n assert(modp((30l), (5l)) == (4l));\n assert(modp((31l), (5l)) == (3l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You have to write a function which validates a given date string and\n // returns True if the date is valid otherwise False.\n // The date is valid if all of the following rules are satisfied:\n // 1. The date string is not empty.\n // 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n // 3. The months should not be less than 1 or higher than 12.\n // 4. The date should be in the format: mm-dd-yyyy\n // for example: \n // valid_date('03-11-2000') => True\n // valid_date('15-01-2012') => False\n // valid_date('04-0-2040') => False\n // valid_date('06-04-2020') => True\n // valid_date('06/04/2020') => False\n public static boolean validDate(String date) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(validDate((\"03-11-2000\")) == (true));\n assert(validDate((\"15-01-2012\")) == (false));\n assert(validDate((\"04-0-2040\")) == (false));\n assert(validDate((\"06-04-2020\")) == (true));\n assert(validDate((\"01-01-2007\")) == (true));\n assert(validDate((\"03-32-2011\")) == (false));\n assert(validDate((\"\")) == (false));\n assert(validDate((\"04-31-3000\")) == (false));\n assert(validDate((\"06-06-2005\")) == (true));\n assert(validDate((\"21-31-2000\")) == (false));\n assert(validDate((\"04-12-2003\")) == (true));\n assert(validDate((\"04122003\")) == (false));\n assert(validDate((\"20030412\")) == (false));\n assert(validDate((\"2003-04\")) == (false));\n assert(validDate((\"2003-04-12\")) == (false));\n assert(validDate((\"04-2003\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that takes a string and returns an ordered version of it.\n // Ordered version of string, is a string where all words (separated by space)\n // are replaced by a new word where all the characters arranged in\n // ascending order based on ascii value.\n // Note: You should keep the order of words and blank spaces in the sentence.\n // For example:\n // anti_shuffle('Hi') returns 'Hi'\n // anti_shuffle('hello') returns 'ehllo'\n // anti_shuffle('Hello World!!!') returns 'Hello !!!Wdlor'\n public static String antiShuffle(String s) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(antiShuffle((\"Hi\")).equals((\"Hi\")));\n assert(antiShuffle((\"hello\")).equals((\"ehllo\")));\n assert(antiShuffle((\"number\")).equals((\"bemnru\")));\n assert(antiShuffle((\"abcd\")).equals((\"abcd\")));\n assert(antiShuffle((\"Hello World!!!\")).equals((\"Hello !!!Wdlor\")));\n assert(antiShuffle((\"\")).equals((\"\")));\n assert(antiShuffle((\"Hi. My name is Mister Robot. How are you?\")).equals((\".Hi My aemn is Meirst .Rboot How aer ?ouy\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a list of numbers, return whether or not they are sorted\n // in ascending order. If list has more than 1 duplicate of the same\n // number, return False. Assume no negative numbers and only integers.\n // Examples\n // is_sorted([5]) \u279e True\n // is_sorted([1, 2, 3, 4, 5]) \u279e True\n // is_sorted([1, 3, 2, 4, 5]) \u279e False\n // is_sorted([1, 2, 3, 4, 5, 6]) \u279e True\n // is_sorted([1, 2, 3, 4, 5, 6, 7]) \u279e True\n // is_sorted([1, 3, 2, 4, 5, 6, 7]) \u279e False\n // is_sorted([1, 2, 2, 3, 3, 4]) \u279e True\n // is_sorted([1, 2, 2, 2, 3, 4]) \u279e False\n public static boolean isSorted(ArrayList lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(isSorted((new ArrayList(Arrays.asList((long)5l)))) == (true));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l)))) == (true));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)4l, (long)5l)))) == (false));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)))) == (true));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l, (long)7l)))) == (true));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)4l, (long)5l, (long)6l, (long)7l)))) == (false));\n assert(isSorted((new ArrayList(Arrays.asList()))) == (true));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l)))) == (true));\n assert(isSorted((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)1l)))) == (false));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)2l, (long)2l, (long)3l, (long)4l)))) == (false));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)3l, (long)3l, (long)4l)))) == (false));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)2l, (long)3l, (long)3l, (long)4l)))) == (true));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a string s.\n // Your task is to check if the string is happy or not.\n // A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n // For example:\n // is_happy(a) => False\n // is_happy(aa) => False\n // is_happy(abcd) => True\n // is_happy(aabb) => False\n // is_happy(adb) => True\n // is_happy(xyy) => False\n public static boolean isHappy(String s) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(isHappy((\"a\")) == (false));\n assert(isHappy((\"aa\")) == (false));\n assert(isHappy((\"abcd\")) == (true));\n assert(isHappy((\"aabb\")) == (false));\n assert(isHappy((\"adb\")) == (true));\n assert(isHappy((\"xyy\")) == (false));\n assert(isHappy((\"iopaxpoi\")) == (true));\n assert(isHappy((\"iopaxioi\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that returns True if the object q will fly, and False otherwise.\n // The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n // Example:\n // will_it_fly([1, 2], 5) \u279e False \n // # 1+2 is less than the maximum possible weight, but it's unbalanced.\n // will_it_fly([3, 2, 3], 1) \u279e False\n // # it's balanced, but 3+2+3 is more than the maximum possible weight.\n // will_it_fly([3, 2, 3], 9) \u279e True\n // # 3+2+3 is less than the maximum possible weight, and it's balanced.\n // will_it_fly([3], 5) \u279e True\n // # 3 is less than the maximum possible weight, and it's balanced.\n public static boolean willItFly(ArrayList q, long w) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(willItFly((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)3l))), (9l)) == (true));\n assert(willItFly((new ArrayList(Arrays.asList((long)1l, (long)2l))), (5l)) == (false));\n assert(willItFly((new ArrayList(Arrays.asList((long)3l))), (5l)) == (true));\n assert(willItFly((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)3l))), (1l)) == (false));\n assert(willItFly((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))), (6l)) == (false));\n assert(willItFly((new ArrayList(Arrays.asList((long)5l))), (5l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given an array of non-negative integers, return a copy of the given array after sorting,\n // you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n // or sort it in descending order if the sum( first index value, last index value) is even.\n // Note:\n // * don't change the given array.\n // Examples:\n // * sort_array([]) => []\n // * sort_array([5]) => [5]\n // * sort_array([2, 4, 3, 0, 1, 5]) => [0, 1, 2, 3, 4, 5]\n // * sort_array([2, 4, 3, 0, 1, 5, 6]) => [6, 5, 4, 3, 2, 1, 0]\n public static ArrayList sortArray(ArrayList array) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sortArray((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(sortArray((new ArrayList(Arrays.asList((long)5l)))).equals((new ArrayList(Arrays.asList((long)5l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)3l, (long)0l, (long)1l, (long)5l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)1l, (long)2l, (long)3l, (long)4l, (long)5l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)3l, (long)0l, (long)1l, (long)5l, (long)6l)))).equals((new ArrayList(Arrays.asList((long)6l, (long)5l, (long)4l, (long)3l, (long)2l, (long)1l, (long)0l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)2l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)2l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)15l, (long)42l, (long)87l, (long)32l, (long)11l, (long)0l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)11l, (long)15l, (long)32l, (long)42l, (long)87l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)21l, (long)14l, (long)23l, (long)11l)))).equals((new ArrayList(Arrays.asList((long)23l, (long)21l, (long)14l, (long)11l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Implement a function that takes an non-negative integer and returns an array of the first n\n // integers that are prime numbers and less than n.\n // for example:\n // count_up_to(5) => [2,3]\n // count_up_to(11) => [2,3,5,7]\n // count_up_to(0) => []\n // count_up_to(20) => [2,3,5,7,11,13,17,19]\n // count_up_to(1) => []\n // count_up_to(18) => [2,3,5,7,11,13,17]\n public static ArrayList countUpTo(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(countUpTo((5l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l)))));\n assert(countUpTo((6l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l)))));\n assert(countUpTo((7l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l)))));\n assert(countUpTo((10l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l, (long)7l)))));\n assert(countUpTo((0l)).equals((new ArrayList(Arrays.asList()))));\n assert(countUpTo((22l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l, (long)7l, (long)11l, (long)13l, (long)17l, (long)19l)))));\n assert(countUpTo((1l)).equals((new ArrayList(Arrays.asList()))));\n assert(countUpTo((18l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l, (long)7l, (long)11l, (long)13l, (long)17l)))));\n assert(countUpTo((47l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l, (long)7l, (long)11l, (long)13l, (long)17l, (long)19l, (long)23l, (long)29l, (long)31l, (long)37l, (long)41l, (long)43l)))));\n assert(countUpTo((101l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l, (long)7l, (long)11l, (long)13l, (long)17l, (long)19l, (long)23l, (long)29l, (long)31l, (long)37l, (long)41l, (long)43l, (long)47l, (long)53l, (long)59l, (long)61l, (long)67l, (long)71l, (long)73l, (long)79l, (long)83l, (long)89l, (long)97l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Out of list of strings, return the longest one. Return the first one in case of multiple\n // strings of the same length. Return None in case the input list is empty.\n // >>> longest([])\n // >>> longest(['a', 'b', 'c'])\n // 'a'\n // >>> longest(['a', 'bb', 'ccc'])\n // 'ccc'\n public static Optional longest(ArrayList strings) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(longest((new ArrayList(Arrays.asList()))).equals(Optional.empty()));\n assert(longest((new ArrayList(Arrays.asList((String)\"x\", (String)\"y\", (String)\"z\")))).equals(\"x\"));\n assert(longest((new ArrayList(Arrays.asList((String)\"x\", (String)\"yyy\", (String)\"zzzz\", (String)\"www\", (String)\"kkkk\", (String)\"abc\")))).equals(\"zzzz\"));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n // reverse the resulting array, and then replace each digit by its corresponding name from\n // \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n // For example:\n // arr = [2, 1, 1, 4, 5, 8, 2, 3] \n // -> sort arr -> [1, 1, 2, 2, 3, 4, 5, 8] \n // -> reverse arr -> [8, 5, 4, 3, 2, 2, 1, 1]\n // return [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n // If the array is empty, return an empty array:\n // arr = []\n // return []\n // If the array has any strange number ignore it:\n // arr = [1, -1 , 55] \n // -> sort arr -> [-1, 1, 55]\n // -> reverse arr -> [55, 1, -1]\n // return = ['One']\n public static ArrayList byLength(ArrayList arr) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(byLength((new ArrayList(Arrays.asList((long)2l, (long)1l, (long)1l, (long)4l, (long)5l, (long)8l, (long)2l, (long)3l)))).equals((new ArrayList(Arrays.asList((String)\"Eight\", (String)\"Five\", (String)\"Four\", (String)\"Three\", (String)\"Two\", (String)\"Two\", (String)\"One\", (String)\"One\")))));\n assert(byLength((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(byLength((new ArrayList(Arrays.asList((long)1l, (long)-1l, (long)55l)))).equals((new ArrayList(Arrays.asList((String)\"One\")))));\n assert(byLength((new ArrayList(Arrays.asList((long)1l, (long)-1l, (long)3l, (long)2l)))).equals((new ArrayList(Arrays.asList((String)\"Three\", (String)\"Two\", (String)\"One\")))));\n assert(byLength((new ArrayList(Arrays.asList((long)9l, (long)4l, (long)8l)))).equals((new ArrayList(Arrays.asList((String)\"Nine\", (String)\"Eight\", (String)\"Four\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_106_f", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Implement the function f that takes n as a parameter,\n // 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\n // or the sum of numbers from 1 to i otherwise.\n // i starts from 1.\n // the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n // Example:\n // f(5) == [1, 2, 6, 24, 15]\n public static ArrayList f(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(f((5l)).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)6l, (long)24l, (long)15l)))));\n assert(f((7l)).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)6l, (long)24l, (long)15l, (long)720l, (long)28l)))));\n assert(f((1l)).equals((new ArrayList(Arrays.asList((long)1l)))));\n assert(f((3l)).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)6l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n // >>> fizz_buzz(50)\n // 0\n // >>> fizz_buzz(78)\n // 2\n // >>> fizz_buzz(79)\n // 3\n public static long fizzBuzz(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(fizzBuzz((50l)) == (0l));\n assert(fizzBuzz((78l)) == (2l));\n assert(fizzBuzz((79l)) == (3l));\n assert(fizzBuzz((100l)) == (3l));\n assert(fizzBuzz((200l)) == (6l));\n assert(fizzBuzz((4000l)) == (192l));\n assert(fizzBuzz((10000l)) == (639l));\n assert(fizzBuzz((100000l)) == (8026l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a positive floating point number, it can be decomposed into\n // and integer part (largest integer smaller than given number) and decimals\n // (leftover part always smaller than 1).\n // Return the decimal part of the number.\n // >>> truncate_number(3.5)\n // 0.5\n public static float truncateNumber(float number) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(truncateNumber((3.5f)) == (0.5f));\n assert(truncateNumber((1.25f)) == (0.25f));\n assert(truncateNumber((123.0f)) == (0.0f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n // Empty sum should be equal to 0 and empty product should be equal to 1.\n // >>> sum_product([])\n // (0, 1)\n // >>> sum_product([1, 2, 3, 4])\n // (10, 24)\n public static Pair sumProduct(ArrayList numbers) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sumProduct((new ArrayList(Arrays.asList()))).equals((Pair.with(0l, 1l))));\n assert(sumProduct((new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l)))).equals((Pair.with(3l, 1l))));\n assert(sumProduct((new ArrayList(Arrays.asList((long)100l, (long)0l)))).equals((Pair.with(100l, 0l))));\n assert(sumProduct((new ArrayList(Arrays.asList((long)3l, (long)5l, (long)7l)))).equals((Pair.with(15l, 105l))));\n assert(sumProduct((new ArrayList(Arrays.asList((long)10l)))).equals((Pair.with(10l, 10l))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a 2 dimensional data, as a nested lists,\n // which is similar to matrix, however, unlike matrices,\n // each row may contain a different number of columns.\n // Given lst, and integer x, find integers x in the list,\n // and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n // each tuple is a coordinate - (row, columns), starting with 0.\n // Sort coordinates initially by rows in ascending order.\n // Also, sort coordinates of the row by columns in descending order.\n // Examples:\n // get_row([\n // [1,2,3,4,5,6],\n // [1,2,3,4,1,6],\n // [1,2,3,4,5,1]\n // ], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n // get_row([], 1) == []\n // get_row([[], [1], [1, 2, 3]], 3) == [(2, 2)]\n public static ArrayList> getRow(ArrayList> lst, long x) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(getRow((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)1l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)1l))))), (1l)).equals((new ArrayList>(Arrays.asList((Pair)Pair.with(0l, 0l), (Pair)Pair.with(1l, 4l), (Pair)Pair.with(1l, 0l), (Pair)Pair.with(2l, 5l), (Pair)Pair.with(2l, 0l))))));\n assert(getRow((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l))))), (2l)).equals((new ArrayList>(Arrays.asList((Pair)Pair.with(0l, 1l), (Pair)Pair.with(1l, 1l), (Pair)Pair.with(2l, 1l), (Pair)Pair.with(3l, 1l), (Pair)Pair.with(4l, 1l), (Pair)Pair.with(5l, 1l))))));\n assert(getRow((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)1l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)1l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)1l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)1l))))), (1l)).equals((new ArrayList>(Arrays.asList((Pair)Pair.with(0l, 0l), (Pair)Pair.with(1l, 0l), (Pair)Pair.with(2l, 1l), (Pair)Pair.with(2l, 0l), (Pair)Pair.with(3l, 2l), (Pair)Pair.with(3l, 0l), (Pair)Pair.with(4l, 3l), (Pair)Pair.with(4l, 0l), (Pair)Pair.with(5l, 4l), (Pair)Pair.with(5l, 0l), (Pair)Pair.with(6l, 5l), (Pair)Pair.with(6l, 0l))))));\n assert(getRow((new ArrayList>(Arrays.asList())), (1l)).equals((new ArrayList>(Arrays.asList()))));\n assert(getRow((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l))))), (2l)).equals((new ArrayList>(Arrays.asList()))));\n assert(getRow((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList()), (ArrayList)new ArrayList(Arrays.asList((long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))))), (3l)).equals((new ArrayList>(Arrays.asList((Pair)Pair.with(2l, 2l))))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You're a hungry rabbit, and you already have eaten a certain number of carrots,\n // but now you need to eat more carrots to complete the day's meals.\n // you should return an array of [ total number of eaten carrots after your meals,\n // the number of carrots left after your meals ]\n // if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n // Example:\n // * eat(5, 6, 10) -> [11, 4]\n // * eat(4, 8, 9) -> [12, 1]\n // * eat(1, 10, 10) -> [11, 0]\n // * eat(2, 11, 5) -> [7, 0]\n // Variables:\n // @number : integer\n // the number of carrots that you have eaten.\n // @need : integer\n // the number of carrots that you need to eat.\n // @remaining : integer\n // the number of remaining carrots thet exist in stock\n // Constrain:\n // * 0 <= number <= 1000\n // * 0 <= need <= 1000\n // * 0 <= remaining <= 1000\n // Have fun :)\n public static ArrayList eat(long number, long need, long remaining) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(eat((5l), (6l), (10l)).equals((new ArrayList(Arrays.asList((long)11l, (long)4l)))));\n assert(eat((4l), (8l), (9l)).equals((new ArrayList(Arrays.asList((long)12l, (long)1l)))));\n assert(eat((1l), (10l), (10l)).equals((new ArrayList(Arrays.asList((long)11l, (long)0l)))));\n assert(eat((2l), (11l), (5l)).equals((new ArrayList(Arrays.asList((long)7l, (long)0l)))));\n assert(eat((4l), (5l), (7l)).equals((new ArrayList(Arrays.asList((long)9l, (long)2l)))));\n assert(eat((4l), (5l), (1l)).equals((new ArrayList(Arrays.asList((long)5l, (long)0l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a positive integer N, return the total sum of its digits in binary.\n // Example\n // For N = 1000, the sum of digits will be 1 the output should be \"1\".\n // For N = 150, the sum of digits will be 6 the output should be \"110\".\n // For N = 147, the sum of digits will be 12 the output should be \"1100\".\n // Variables:\n // @N integer\n // Constraints: 0 \u2264 N \u2264 10000.\n // Output:\n // a string of binary number\n public static String solve(long N) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(solve((1000l)).equals((\"1\")));\n assert(solve((150l)).equals((\"110\")));\n assert(solve((147l)).equals((\"1100\")));\n assert(solve((333l)).equals((\"1001\")));\n assert(solve((963l)).equals((\"10010\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a list of integers.\n // You need to find the largest prime value and return the sum of its digits.\n // Examples:\n // For lst = [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] the output should be 10\n // For lst = [1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1] the output should be 25\n // For lst = [1,3,1,32,5107,34,83278,109,163,23,2323,32,30,1,9,3] the output should be 13\n // For lst = [0,724,32,71,99,32,6,0,5,91,83,0,5,6] the output should be 11\n // For lst = [0,81,12,3,1,21] the output should be 3\n // For lst = [0,8,1,2,1,7] the output should be 7\n public static long skjkasdkd(ArrayList lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(skjkasdkd((new ArrayList(Arrays.asList((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, (long)3l)))) == (10l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)1l, (long)0l, (long)1l, (long)8l, (long)2l, (long)4597l, (long)2l, (long)1l, (long)3l, (long)40l, (long)1l, (long)2l, (long)1l, (long)2l, (long)4l, (long)2l, (long)5l, (long)1l)))) == (25l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)1l, (long)32l, (long)5107l, (long)34l, (long)83278l, (long)109l, (long)163l, (long)23l, (long)2323l, (long)32l, (long)30l, (long)1l, (long)9l, (long)3l)))) == (13l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)0l, (long)724l, (long)32l, (long)71l, (long)99l, (long)32l, (long)6l, (long)0l, (long)5l, (long)91l, (long)83l, (long)0l, (long)5l, (long)6l)))) == (11l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)0l, (long)81l, (long)12l, (long)3l, (long)1l, (long)21l)))) == (3l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)0l, (long)8l, (long)1l, (long)2l, (long)1l, (long)7l)))) == (7l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)8191l)))) == (19l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)8191l, (long)123456l, (long)127l, (long)7l)))) == (19l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)127l, (long)97l, (long)8192l)))) == (10l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given an array arr of integers, find the minimum number of elements that\n // need to be changed to make the array palindromic. A palindromic array is an array that\n // is read the same backwards and forwards. In one change, you can change one element to any other element.\n // For example:\n // smallest_change([1,2,3,5,4,7,9,6]) == 4\n // smallest_change([1, 2, 3, 4, 3, 2, 2]) == 1\n // smallest_change([1, 2, 3, 2, 1]) == 0\n public static long smallestChange(ArrayList arr) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(smallestChange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)5l, (long)4l, (long)7l, (long)9l, (long)6l)))) == (4l));\n assert(smallestChange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)3l, (long)2l, (long)2l)))) == (1l));\n assert(smallestChange((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)2l)))) == (1l));\n assert(smallestChange((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)4l, (long)2l)))) == (1l));\n assert(smallestChange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)2l, (long)1l)))) == (0l));\n assert(smallestChange((new ArrayList(Arrays.asList((long)3l, (long)1l, (long)1l, (long)3l)))) == (0l));\n assert(smallestChange((new ArrayList(Arrays.asList((long)1l)))) == (0l));\n assert(smallestChange((new ArrayList(Arrays.asList((long)0l, (long)1l)))) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // It is the last week of the semester and the teacher has to give the grades\n // to students. The teacher has been making her own algorithm for grading.\n // The only problem is, she has lost the code she used for grading.\n // She has given you a list of GPAs for some students and you have to write \n // a function that can output a list of letter grades using the following table:\n // GPA | Letter grade\n // 4.0 A+\n // > 3.7 A \n // > 3.3 A- \n // > 3.0 B+\n // > 2.7 B \n // > 2.3 B-\n // > 2.0 C+\n // > 1.7 C\n // > 1.3 C-\n // > 1.0 D+ \n // > 0.7 D \n // > 0.0 D-\n // 0.0 E\n // Example:\n // grade_equation([4.0, 3, 1.7, 2, 3.5]) ==> ['A+', 'B', 'C-', 'C', 'A-']\n public static ArrayList numericalLetterGrade(ArrayList grades) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(numericalLetterGrade((new ArrayList(Arrays.asList((float)4.0f, (float)3l, (float)1.7f, (float)2l, (float)3.5f)))).equals((new ArrayList(Arrays.asList((String)\"A+\", (String)\"B\", (String)\"C-\", (String)\"C\", (String)\"A-\")))));\n assert(numericalLetterGrade((new ArrayList(Arrays.asList((float)1.2f)))).equals((new ArrayList(Arrays.asList((String)\"D+\")))));\n assert(numericalLetterGrade((new ArrayList(Arrays.asList((float)0.5f)))).equals((new ArrayList(Arrays.asList((String)\"D-\")))));\n assert(numericalLetterGrade((new ArrayList(Arrays.asList((float)0.0f)))).equals((new ArrayList(Arrays.asList((String)\"E\")))));\n assert(numericalLetterGrade((new ArrayList(Arrays.asList((float)1.0f, (float)0.3f, (float)1.5f, (float)2.8f, (float)3.3f)))).equals((new ArrayList(Arrays.asList((String)\"D\", (String)\"D-\", (String)\"C-\", (String)\"B\", (String)\"B+\")))));\n assert(numericalLetterGrade((new ArrayList(Arrays.asList((float)0.0f, (float)0.7f)))).equals((new ArrayList(Arrays.asList((String)\"E\", (String)\"D-\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given the lengths of the three sides of a triangle. Return the area of\n // the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n // Otherwise return -1\n // Three sides make a valid triangle when the sum of any two sides is greater \n // than the third side.\n // Example:\n // triangle_area(3, 4, 5) == 6.00\n // triangle_area(1, 2, 10) == -1\n public static float triangleArea(long a, long b, long c) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(triangleArea((3l), (4l), (5l)) == (6.0f));\n assert(triangleArea((1l), (2l), (10l)) == (float)-1l);\n assert(triangleArea((4l), (8l), (5l)) == (8.18f));\n assert(triangleArea((2l), (2l), (2l)) == (1.73f));\n assert(triangleArea((1l), (2l), (3l)) == (float)-1l);\n assert(triangleArea((10l), (5l), (7l)) == (16.25f));\n assert(triangleArea((2l), (6l), (3l)) == (float)-1l);\n assert(triangleArea((1l), (1l), (1l)) == (0.43f));\n assert(triangleArea((2l), (2l), (10l)) == (float)-1l);\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Check if two words have the same characters.\n // >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n // True\n // >>> same_chars('abcd', 'dddddddabc')\n // True\n // >>> same_chars('dddddddabc', 'abcd')\n // True\n // >>> same_chars('eabcd', 'dddddddabc')\n // False\n // >>> same_chars('abcd', 'dddddddabce')\n // False\n // >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc')\n // False\n public static boolean sameChars(String s0, String s1) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddeddabc\")) == (true));\n assert(sameChars((\"abcd\"), (\"dddddddabc\")) == (true));\n assert(sameChars((\"dddddddabc\"), (\"abcd\")) == (true));\n assert(sameChars((\"eabcd\"), (\"dddddddabc\")) == (false));\n assert(sameChars((\"abcd\"), (\"dddddddabcf\")) == (false));\n assert(sameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddddabc\")) == (false));\n assert(sameChars((\"aabb\"), (\"aaccc\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given an array of integers nums, find the minimum sum of any non-empty sub-array\n // of nums.\n // Example\n // minSubArraySum([2, 3, 4, 1, 2, 4]) == 1\n // minSubArraySum([-1, -2, -3]) == -6\n public static long minSubArraySum(ArrayList nums) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)4l, (long)1l, (long)2l, (long)4l)))) == (1l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)-1l, (long)-2l, (long)-3l)))) == (-6l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)-1l, (long)-2l, (long)-3l, (long)2l, (long)-10l)))) == (-14l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)-9999999999999999l)))) == (-9999999999999999l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)0l, (long)10l, (long)20l, (long)1000000l)))) == (0l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)-1l, (long)-2l, (long)-3l, (long)10l, (long)-5l)))) == (-6l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)100l, (long)-1l, (long)-2l, (long)-3l, (long)10l, (long)-5l)))) == (-6l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)10l, (long)11l, (long)13l, (long)8l, (long)3l, (long)4l)))) == (3l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)100l, (long)-33l, (long)32l, (long)-1l, (long)0l, (long)-2l)))) == (-33l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)-10l)))) == (-10l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)7l)))) == (7l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)1l, (long)-1l)))) == (-1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a string s and a natural number n, you have been tasked to implement \n // a function that returns a list of all words from string s that contain exactly \n // n consonants, in order these words appear in the string s.\n // If the string s is empty then the function should return an empty list.\n // Note: you may assume the input string contains only letters and spaces.\n // Examples:\n // select_words(\"Mary had a little lamb\", 4) ==> [\"little\"]\n // select_words(\"Mary had a little lamb\", 3) ==> [\"Mary\", \"lamb\"]\n // select_words(\"simple white space\", 2) ==> []\n // select_words(\"Hello world\", 4) ==> [\"world\"]\n // select_words(\"Uncle sam\", 3) ==> [\"Uncle\"]\n public static ArrayList selectWords(String s, long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(selectWords((\"Mary had a little lamb\"), (4l)).equals((new ArrayList(Arrays.asList((String)\"little\")))));\n assert(selectWords((\"Mary had a little lamb\"), (3l)).equals((new ArrayList(Arrays.asList((String)\"Mary\", (String)\"lamb\")))));\n assert(selectWords((\"simple white space\"), (2l)).equals((new ArrayList(Arrays.asList()))));\n assert(selectWords((\"Hello world\"), (4l)).equals((new ArrayList(Arrays.asList((String)\"world\")))));\n assert(selectWords((\"Uncle sam\"), (3l)).equals((new ArrayList(Arrays.asList((String)\"Uncle\")))));\n assert(selectWords((\"\"), (4l)).equals((new ArrayList(Arrays.asList()))));\n assert(selectWords((\"a b c d e f\"), (1l)).equals((new ArrayList(Arrays.asList((String)\"b\", (String)\"c\", (String)\"d\", (String)\"f\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return list of all prefixes from shortest to longest of the input string\n // >>> all_prefixes('abc')\n // ['a', 'ab', 'abc']\n public static ArrayList allPrefixes(String string) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(allPrefixes((\"\")).equals((new ArrayList(Arrays.asList()))));\n assert(allPrefixes((\"asdfgh\")).equals((new ArrayList(Arrays.asList((String)\"a\", (String)\"as\", (String)\"asd\", (String)\"asdf\", (String)\"asdfg\", (String)\"asdfgh\")))));\n assert(allPrefixes((\"WWW\")).equals((new ArrayList(Arrays.asList((String)\"W\", (String)\"WW\", (String)\"WWW\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function that takes a value (string) representing a number\n // and returns the closest integer to it. If the number is equidistant\n // from two integers, round it away from zero.\n // Examples\n // >>> closest_integer(\"10\")\n // 10\n // >>> closest_integer(\"15.3\")\n // 15\n // Note:\n // Rounding away from zero means that if the given number is equidistant\n // from two integers, the one you should return is the one that is the\n // farthest from zero. For example closest_integer(\"14.5\") should\n // return 15 and closest_integer(\"-14.5\") should return -15.\n public static long closestInteger(String value) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(closestInteger((\"10\")) == (10l));\n assert(closestInteger((\"14.5\")) == (15l));\n assert(closestInteger((\"-15.5\")) == (-16l));\n assert(closestInteger((\"15.3\")) == (15l));\n assert(closestInteger((\"0\")) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function which takes a string representing a file's name, and returns\n // 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n // A file's name is considered to be valid if and only if all the following conditions \n // are met:\n // - There should not be more than three digits ('0'-'9') in the file's name.\n // - The file's name contains exactly one dot '.'\n // - The substring before the dot should not be empty, and it starts with a letter from \n // the latin alphapet ('a'-'z' and 'A'-'Z').\n // - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n // Examples:\n // file_name_check(\"example.txt\") # => 'Yes'\n // file_name_check(\"1example.dll\") # => 'No' (the name should start with a latin alphapet letter)\n public static String fileNameCheck(String file_name) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(fileNameCheck((\"example.txt\")).equals((\"Yes\")));\n assert(fileNameCheck((\"1example.dll\")).equals((\"No\")));\n assert(fileNameCheck((\"s1sdf3.asd\")).equals((\"No\")));\n assert(fileNameCheck((\"K.dll\")).equals((\"Yes\")));\n assert(fileNameCheck((\"MY16FILE3.exe\")).equals((\"Yes\")));\n assert(fileNameCheck((\"His12FILE94.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"_Y.txt\")).equals((\"No\")));\n assert(fileNameCheck((\"?aREYA.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"/this_is_valid.dll\")).equals((\"No\")));\n assert(fileNameCheck((\"this_is_valid.wow\")).equals((\"No\")));\n assert(fileNameCheck((\"this_is_valid.txt\")).equals((\"Yes\")));\n assert(fileNameCheck((\"this_is_valid.txtexe\")).equals((\"No\")));\n assert(fileNameCheck((\"#this2_i4s_5valid.ten\")).equals((\"No\")));\n assert(fileNameCheck((\"@this1_is6_valid.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"this_is_12valid.6exe4.txt\")).equals((\"No\")));\n assert(fileNameCheck((\"all.exe.txt\")).equals((\"No\")));\n assert(fileNameCheck((\"I563_No.exe\")).equals((\"Yes\")));\n assert(fileNameCheck((\"Is3youfault.txt\")).equals((\"Yes\")));\n assert(fileNameCheck((\"no_one#knows.dll\")).equals((\"Yes\")));\n assert(fileNameCheck((\"1I563_Yes3.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"I563_Yes3.txtt\")).equals((\"No\")));\n assert(fileNameCheck((\"final..txt\")).equals((\"No\")));\n assert(fileNameCheck((\"final132\")).equals((\"No\")));\n assert(fileNameCheck((\"_f4indsartal132.\")).equals((\"No\")));\n assert(fileNameCheck((\".txt\")).equals((\"No\")));\n assert(fileNameCheck((\"s.\")).equals((\"No\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given two intervals,\n // where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n // The given intervals are closed which means that the interval (start, end)\n // includes both start and end.\n // For each given interval, it is assumed that its start is less or equal its end.\n // Your task is to determine whether the length of intersection of these two \n // intervals is a prime number.\n // Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n // which its length is 1, which not a prime number.\n // If the length of the intersection is a prime number, return \"YES\",\n // otherwise, return \"NO\".\n // If the two intervals don't intersect, return \"NO\".\n // [input/output] samples:\n // intersection((1, 2), (2, 3)) ==> \"NO\"\n // intersection((-1, 1), (0, 4)) ==> \"NO\"\n // intersection((-3, -1), (-5, 5)) ==> \"YES\"\n public static String intersection(Pair interval1, Pair interval2) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(intersection((Pair.with(1l, 2l)), (Pair.with(2l, 3l))).equals((\"NO\")));\n assert(intersection((Pair.with(-1l, 1l)), (Pair.with(0l, 4l))).equals((\"NO\")));\n assert(intersection((Pair.with(-3l, -1l)), (Pair.with(-5l, 5l))).equals((\"YES\")));\n assert(intersection((Pair.with(-2l, 2l)), (Pair.with(-4l, 0l))).equals((\"YES\")));\n assert(intersection((Pair.with(-11l, 2l)), (Pair.with(-1l, -1l))).equals((\"NO\")));\n assert(intersection((Pair.with(1l, 2l)), (Pair.with(3l, 5l))).equals((\"NO\")));\n assert(intersection((Pair.with(1l, 2l)), (Pair.with(1l, 2l))).equals((\"NO\")));\n assert(intersection((Pair.with(-2l, -2l)), (Pair.with(-3l, -2l))).equals((\"NO\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return the largest prime factor of n. Assume n > 1 and is not a prime.\n // >>> largest_prime_factor(13195)\n // 29\n // >>> largest_prime_factor(2048)\n // 2\n public static long largestPrimeFactor(long n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(largestPrimeFactor((15l)) == (5l));\n assert(largestPrimeFactor((27l)) == (3l));\n assert(largestPrimeFactor((63l)) == (7l));\n assert(largestPrimeFactor((330l)) == (11l));\n assert(largestPrimeFactor((13195l)) == (29l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a string, find out how many distinct characters (regardless of case) does it consist of\n // >>> count_distinct_characters('xyzXYZ')\n // 3\n // >>> count_distinct_characters('Jerry')\n // 4\n public static long countDistinctCharacters(String string) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(countDistinctCharacters((\"\")) == (0l));\n assert(countDistinctCharacters((\"abcde\")) == (5l));\n assert(countDistinctCharacters((\"abcdecadeCADE\")) == (5l));\n assert(countDistinctCharacters((\"aaaaAAAAaaaa\")) == (1l));\n assert(countDistinctCharacters((\"Jerry jERRY JeRRRY\")) == (5l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You're given a list of deposit and withdrawal operations on a bank account that starts with\n // zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n // at that point function should return True. Otherwise it should return False.\n // >>> below_zero([1, 2, 3])\n // False\n // >>> below_zero([1, 2, -4, 5])\n // True\n public static boolean belowZero(ArrayList operations) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(belowZero((new ArrayList(Arrays.asList()))) == (false));\n assert(belowZero((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)-3l, (long)1l, (long)2l, (long)-3l)))) == (false));\n assert(belowZero((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)-4l, (long)5l, (long)6l)))) == (true));\n assert(belowZero((new ArrayList(Arrays.asList((long)1l, (long)-1l, (long)2l, (long)-2l, (long)5l, (long)-5l, (long)4l, (long)-4l)))) == (false));\n assert(belowZero((new ArrayList(Arrays.asList((long)1l, (long)-1l, (long)2l, (long)-2l, (long)5l, (long)-5l, (long)4l, (long)-5l)))) == (true));\n assert(belowZero((new ArrayList(Arrays.asList((long)1l, (long)-2l, (long)2l, (long)-2l, (long)5l, (long)-5l, (long)4l, (long)-4l)))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Find the shortest palindrome that begins with a supplied string.\n // Algorithm idea is simple:\n // - Find the longest postfix of supplied string that is a palindrome.\n // - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n // >>> make_palindrome('')\n // ''\n // >>> make_palindrome('cat')\n // 'catac'\n // >>> make_palindrome('cata')\n // 'catac'\n public static String makePalindrome(String string) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(makePalindrome((\"\")).equals((\"\")));\n assert(makePalindrome((\"x\")).equals((\"x\")));\n assert(makePalindrome((\"xyz\")).equals((\"xyzyx\")));\n assert(makePalindrome((\"xyx\")).equals((\"xyx\")));\n assert(makePalindrome((\"jerry\")).equals((\"jerryrrej\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a positive integer, obtain its roman numeral equivalent as a string,\n // and return it in lowercase.\n // Restrictions: 1 <= num <= 1000\n // Examples:\n // >>> int_to_mini_roman(19) == 'xix'\n // >>> int_to_mini_roman(152) == 'clii'\n // >>> int_to_mini_roman(426) == 'cdxxvi'\n public static String intToMiniRoman(long number) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(intToMiniRoman((19l)).equals((\"xix\")));\n assert(intToMiniRoman((152l)).equals((\"clii\")));\n assert(intToMiniRoman((251l)).equals((\"ccli\")));\n assert(intToMiniRoman((426l)).equals((\"cdxxvi\")));\n assert(intToMiniRoman((500l)).equals((\"d\")));\n assert(intToMiniRoman((1l)).equals((\"i\")));\n assert(intToMiniRoman((4l)).equals((\"iv\")));\n assert(intToMiniRoman((43l)).equals((\"xliii\")));\n assert(intToMiniRoman((90l)).equals((\"xc\")));\n assert(intToMiniRoman((94l)).equals((\"xciv\")));\n assert(intToMiniRoman((532l)).equals((\"dxxxii\")));\n assert(intToMiniRoman((900l)).equals((\"cm\")));\n assert(intToMiniRoman((994l)).equals((\"cmxciv\")));\n assert(intToMiniRoman((1000l)).equals((\"m\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - } -] \ No newline at end of file diff --git a/data/java-remove.json b/data/java-remove.json deleted file mode 100644 index 544398fffbbb3027f20b32a2445187f6292f3303..0000000000000000000000000000000000000000 --- a/data/java-remove.json +++ /dev/null @@ -1,1862 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // For a given number n, find the largest number that divides n evenly, smaller than n\n public static long largestDivisor(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(largestDivisor((3l)) == (1l));\n assert(largestDivisor((7l)) == (1l));\n assert(largestDivisor((10l)) == (5l));\n assert(largestDivisor((100l)) == (50l));\n assert(largestDivisor((49l)) == (7l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_47_median", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return median of elements in the list l.\n public static float median(ArrayList l) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(median((new ArrayList(Arrays.asList((long)3l, (long)1l, (long)2l, (long)4l, (long)5l)))) == (float)3l);\n assert(median((new ArrayList(Arrays.asList((long)-10l, (long)4l, (long)6l, (long)1000l, (long)10l, (long)20l)))) == (8.0f));\n assert(median((new ArrayList(Arrays.asList((long)5l)))) == (float)5l);\n assert(median((new ArrayList(Arrays.asList((long)6l, (long)5l)))) == (5.5f));\n assert(median((new ArrayList(Arrays.asList((long)8l, (long)1l, (long)3l, (long)9l, (long)9l, (long)2l, (long)7l)))) == (float)7l);\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return maximum element in the list.\n public static long maxElement(ArrayList l) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(maxElement((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)))) == (3l));\n assert(maxElement((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)-5l, (long)2l, (long)-3l, (long)3l, (long)9l, (long)0l, (long)124l, (long)1l, (long)-10l)))) == (124l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function which returns the largest index of an element which\n // is not greater than or equal to the element immediately preceding it. If\n // no such element exists then return -1. The given array will not contain\n // duplicate values.\n // Examples:\n public static long canArrange(ArrayList arr) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(canArrange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)4l, (long)3l, (long)5l)))) == (3l));\n assert(canArrange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)4l, (long)5l)))) == (-1l));\n assert(canArrange((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)2l, (long)5l, (long)6l, (long)7l, (long)8l, (long)9l, (long)10l)))) == (2l));\n assert(canArrange((new ArrayList(Arrays.asList((long)4l, (long)8l, (long)5l, (long)7l, (long)3l)))) == (4l));\n assert(canArrange((new ArrayList(Arrays.asList()))) == (-1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function that returns True if the last character\n // of a given string is an alphabetical character and is not\n // a part of a word, and False otherwise.\n // Note: \"word\" is a group of characters separated by space.\n // Examples:\n public static boolean checkIfLastCharIsALetter(String txt) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(checkIfLastCharIsALetter((\"apple\")) == (false));\n assert(checkIfLastCharIsALetter((\"apple pi e\")) == (true));\n assert(checkIfLastCharIsALetter((\"eeeee\")) == (false));\n assert(checkIfLastCharIsALetter((\"A\")) == (true));\n assert(checkIfLastCharIsALetter((\"Pumpkin pie \")) == (false));\n assert(checkIfLastCharIsALetter((\"Pumpkin pie 1\")) == (false));\n assert(checkIfLastCharIsALetter((\"\")) == (false));\n assert(checkIfLastCharIsALetter((\"eeeee e \")) == (false));\n assert(checkIfLastCharIsALetter((\"apple pie\")) == (false));\n assert(checkIfLastCharIsALetter((\"apple pi e \")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return true if a given number is prime, and false otherwise.\n public static boolean isPrime(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(isPrime((6l)) == (false));\n assert(isPrime((101l)) == (true));\n assert(isPrime((11l)) == (true));\n assert(isPrime((13441l)) == (true));\n assert(isPrime((61l)) == (true));\n assert(isPrime((4l)) == (false));\n assert(isPrime((1l)) == (false));\n assert(isPrime((5l)) == (true));\n assert(isPrime((11l)) == (true));\n assert(isPrime((17l)) == (true));\n assert(isPrime((85l)) == (false));\n assert(isPrime((77l)) == (false));\n assert(isPrime((255379l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a list of positive integers x. return a sorted list of all \n // elements that hasn't any even digit.\n // Note: Returned list should be sorted in increasing order.\n // For example:\n public static ArrayList uniqueDigits(ArrayList x) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(uniqueDigits((new ArrayList(Arrays.asList((long)15l, (long)33l, (long)1422l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)15l, (long)33l)))));\n assert(uniqueDigits((new ArrayList(Arrays.asList((long)152l, (long)323l, (long)1422l, (long)10l)))).equals((new ArrayList(Arrays.asList()))));\n assert(uniqueDigits((new ArrayList(Arrays.asList((long)12345l, (long)2033l, (long)111l, (long)151l)))).equals((new ArrayList(Arrays.asList((long)111l, (long)151l)))));\n assert(uniqueDigits((new ArrayList(Arrays.asList((long)135l, (long)103l, (long)31l)))).equals((new ArrayList(Arrays.asList((long)31l, (long)135l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Input are two strings a and b consisting only of 1s and 0s.\n // Perform binary XOR on these inputs and return result also as a string.\n public static String stringXor(String a, String b) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(stringXor((\"111000\"), (\"101010\")).equals((\"010010\")));\n assert(stringXor((\"1\"), (\"1\")).equals((\"0\")));\n assert(stringXor((\"0101\"), (\"0000\")).equals((\"0101\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // sum_to_n is a function that sums numbers from 1 to n.\n public static long sumToN(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sumToN((1l)) == (1l));\n assert(sumToN((6l)) == (21l));\n assert(sumToN((11l)) == (66l));\n assert(sumToN((30l)) == (465l));\n assert(sumToN((100l)) == (5050l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a list of numbers, return the sum of squares of the numbers\n // in the list that are odd. Ignore numbers that are negative or not integers.\n // If the input list is empty, return 0.\n public static long doubleTheDifference(ArrayList lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(doubleTheDifference((new ArrayList(Arrays.asList()))) == (0l));\n assert(doubleTheDifference((new ArrayList(Arrays.asList((float)5.0f, (float)4.0f)))) == (25l));\n assert(doubleTheDifference((new ArrayList(Arrays.asList((float)0.1f, (float)0.2f, (float)0.3f)))) == (0l));\n assert(doubleTheDifference((new ArrayList(Arrays.asList((float)-10.0f, (float)-20.0f, (float)-30.0f)))) == (0l));\n assert(doubleTheDifference((new ArrayList(Arrays.asList((float)-1.0f, (float)-2.0f, (float)8.0f)))) == (0l));\n assert(doubleTheDifference((new ArrayList(Arrays.asList((float)0.2f, (float)3.0f, (float)5.0f)))) == (34l));\n assert(doubleTheDifference((new ArrayList(Arrays.asList((float)-9.0f, (float)-7.0f, (float)-5.0f, (float)-3.0f, (float)-1.0f, (float)1.0f, (float)3.0f, (float)5.0f, (float)7.0f, (float)9.0f)))) == (165l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return length of given string\n public static long strlen(String string) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(strlen((\"\")) == (0l));\n assert(strlen((\"x\")) == (1l));\n assert(strlen((\"asdasnakj\")) == (9l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You'll be given a string of words, and your task is to count the number\n // of boredoms. A boredom is a sentence that starts with the word \"I\".\n // Sentences are delimited by '.', '?' or '!'.\n // For example:\n public static long isBored(String S) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(isBored((\"Hello world\")) == (0l));\n assert(isBored((\"Is the sky blue?\")) == (0l));\n assert(isBored((\"I love It !\")) == (1l));\n assert(isBored((\"bIt\")) == (0l));\n assert(isBored((\"I feel good today. I will be productive. will kill It\")) == (2l));\n assert(isBored((\"You and I are going for a walk\")) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function vowels_count which takes a string representing\n // a word as input and returns the number of vowels in the string.\n // Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n // vowel, but only when it is at the end of the given word.\n // Example:\n public static long vowelsCount(String s) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(vowelsCount((\"abcde\")) == (2l));\n assert(vowelsCount((\"Alone\")) == (3l));\n assert(vowelsCount((\"key\")) == (2l));\n assert(vowelsCount((\"bye\")) == (1l));\n assert(vowelsCount((\"keY\")) == (2l));\n assert(vowelsCount((\"bYe\")) == (1l));\n assert(vowelsCount((\"ACEDY\")) == (3l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return n-th Fibonacci number.\n public static long fib(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(fib((10l)) == (55l));\n assert(fib((1l)) == (1l));\n assert(fib((8l)) == (21l));\n assert(fib((11l)) == (89l));\n assert(fib((12l)) == (144l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Your task is to implement a function that will simplify the expression\n // x * n. The function returns True if x * n evaluates to a whole number and False\n // otherwise. Both x and n, are string representation of a fraction, and have the following format,\n // / where both numerator and denominator are positive whole numbers.\n // You can assume that x, and n are valid fractions, and do not have zero as denominator.\n public static boolean simplify(String x, String n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(simplify((\"1/5\"), (\"5/1\")) == (true));\n assert(simplify((\"1/6\"), (\"2/1\")) == (false));\n assert(simplify((\"5/1\"), (\"3/1\")) == (true));\n assert(simplify((\"7/10\"), (\"10/2\")) == (false));\n assert(simplify((\"2/10\"), (\"50/10\")) == (true));\n assert(simplify((\"7/2\"), (\"4/2\")) == (true));\n assert(simplify((\"11/6\"), (\"6/1\")) == (true));\n assert(simplify((\"2/3\"), (\"5/2\")) == (false));\n assert(simplify((\"5/2\"), (\"3/5\")) == (false));\n assert(simplify((\"2/4\"), (\"8/4\")) == (true));\n assert(simplify((\"2/4\"), (\"4/2\")) == (true));\n assert(simplify((\"1/5\"), (\"5/1\")) == (true));\n assert(simplify((\"1/5\"), (\"1/5\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a string s, count the number of uppercase vowels in even indices.\n // For example:\n public static long countUpper(String s) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(countUpper((\"aBCdEf\")) == (1l));\n assert(countUpper((\"abcdefg\")) == (0l));\n assert(countUpper((\"dBBE\")) == (0l));\n assert(countUpper((\"B\")) == (0l));\n assert(countUpper((\"U\")) == (1l));\n assert(countUpper((\"\")) == (0l));\n assert(countUpper((\"EEEE\")) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a rectangular grid of wells. Each row represents a single well,\n // and each 1 in a row represents a single unit of water.\n // Each well has a corresponding bucket that can be used to extract water from it, \n // and all buckets have the same capacity.\n // Your task is to use the buckets to empty the wells.\n // Output the number of times you need to lower the buckets.\n // Example 1:\n // Example 2:\n // Example 3:\n // Constraints:\n // * all wells have the same length\n // * 1 <= grid.length <= 10^2\n // * 1 <= grid[:,1].length <= 10^2\n // * grid[i][j] -> 0 | 1\n // * 1 <= capacity <= 10\n public static long maxFill(ArrayList> grid, long capacity) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(maxFill((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)0l, (long)0l, (long)1l, (long)0l)), (ArrayList)new ArrayList(Arrays.asList((long)0l, (long)1l, (long)0l, (long)0l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l))))), (1l)) == (6l));\n assert(maxFill((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)0l, (long)0l, (long)1l, (long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l, (long)0l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)0l, (long)1l, (long)1l, (long)1l))))), (2l)) == (5l));\n assert(maxFill((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l)), (ArrayList)new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l))))), (5l)) == (0l));\n assert(maxFill((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l))))), (2l)) == (4l));\n assert(maxFill((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l))))), (9l)) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given an array arr of integers and a positive integer k, return a sorted list \n // of length k with the maximum k numbers in arr.\n // Example 1:\n // Example 2:\n // Example 3:\n // Note:\n // 1. The length of the array will be in the range of [1, 1000].\n // 2. The elements in the array will be in the range of [-1000, 1000].\n // 3. 0 <= k <= len(arr)\n public static ArrayList maximum(ArrayList arr, long k) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(maximum((new ArrayList(Arrays.asList((long)-3l, (long)-4l, (long)5l))), (3l)).equals((new ArrayList(Arrays.asList((long)-4l, (long)-3l, (long)5l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)4l, (long)-4l, (long)4l))), (2l)).equals((new ArrayList(Arrays.asList((long)4l, (long)4l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)-3l, (long)2l, (long)1l, (long)2l, (long)-1l, (long)-2l, (long)1l))), (1l)).equals((new ArrayList(Arrays.asList((long)2l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)123l, (long)-123l, (long)20l, (long)0l, (long)1l, (long)2l, (long)-3l))), (3l)).equals((new ArrayList(Arrays.asList((long)2l, (long)20l, (long)123l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)-123l, (long)20l, (long)0l, (long)1l, (long)2l, (long)-3l))), (4l)).equals((new ArrayList(Arrays.asList((long)0l, (long)1l, (long)2l, (long)20l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)5l, (long)15l, (long)0l, (long)3l, (long)-13l, (long)-8l, (long)0l))), (7l)).equals((new ArrayList(Arrays.asList((long)-13l, (long)-8l, (long)0l, (long)0l, (long)3l, (long)5l, (long)15l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)-1l, (long)0l, (long)2l, (long)5l, (long)3l, (long)-10l))), (2l)).equals((new ArrayList(Arrays.asList((long)3l, (long)5l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)1l, (long)0l, (long)5l, (long)-7l))), (1l)).equals((new ArrayList(Arrays.asList((long)5l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)4l, (long)-4l))), (2l)).equals((new ArrayList(Arrays.asList((long)-4l, (long)4l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)-10l, (long)10l))), (2l)).equals((new ArrayList(Arrays.asList((long)-10l, (long)10l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)-23l, (long)243l, (long)-400l, (long)0l))), (0l)).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that takes a message, and encodes in such a \n // way that it swaps case of all letters, replaces all vowels in \n // the message with the letter that appears 2 places ahead of that \n // vowel in the english alphabet. \n // Assume only letters. \n // Examples:\n public static String encode(String message) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(encode((\"TEST\")).equals((\"tgst\")));\n assert(encode((\"Mudasir\")).equals((\"mWDCSKR\")));\n assert(encode((\"YES\")).equals((\"ygs\")));\n assert(encode((\"This is a message\")).equals((\"tHKS KS C MGSSCGG\")));\n assert(encode((\"I DoNt KnOw WhAt tO WrItE\")).equals((\"k dQnT kNqW wHcT Tq wRkTg\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // remove_vowels is a function that takes string and returns string without vowels.\n public static String removeVowels(String text) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(removeVowels((\"\")).equals((\"\")));\n assert(removeVowels((\"abcdef\\nghijklm\")).equals((\"bcdf\\nghjklm\")));\n assert(removeVowels((\"fedcba\")).equals((\"fdcb\")));\n assert(removeVowels((\"eeeee\")).equals((\"\")));\n assert(removeVowels((\"acBAA\")).equals((\"cB\")));\n assert(removeVowels((\"EcBOO\")).equals((\"cB\")));\n assert(removeVowels((\"ybcd\")).equals((\"ybcd\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return only positive numbers in the list.\n public static ArrayList getPositive(ArrayList l) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(getPositive((new ArrayList(Arrays.asList((long)-1l, (long)-2l, (long)4l, (long)5l, (long)6l)))).equals((new ArrayList(Arrays.asList((long)4l, (long)5l, (long)6l)))));\n assert(getPositive((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)-5l, (long)2l, (long)3l, (long)3l, (long)9l, (long)0l, (long)123l, (long)1l, (long)-10l)))).equals((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)2l, (long)3l, (long)3l, (long)9l, (long)123l, (long)1l)))));\n assert(getPositive((new ArrayList(Arrays.asList((long)-1l, (long)-2l)))).equals((new ArrayList(Arrays.asList()))));\n assert(getPositive((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n public static String stringSequence(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(stringSequence((0l)).equals((\"0\")));\n assert(stringSequence((3l)).equals((\"0 1 2 3\")));\n assert(stringSequence((10l)).equals((\"0 1 2 3 4 5 6 7 8 9 10\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a positive integer n, you have to make a pile of n levels of stones.\n // The first level has n stones.\n // The number of stones in the next level is:\n // - the next odd number if n is odd.\n // - the next even number if n is even.\n // Return the number of stones in each level in a list, where element at index\n // i represents the number of stones in the level (i+1).\n // Examples:\n public static ArrayList makeAPile(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(makeAPile((3l)).equals((new ArrayList(Arrays.asList((long)3l, (long)5l, (long)7l)))));\n assert(makeAPile((4l)).equals((new ArrayList(Arrays.asList((long)4l, (long)6l, (long)8l, (long)10l)))));\n assert(makeAPile((5l)).equals((new ArrayList(Arrays.asList((long)5l, (long)7l, (long)9l, (long)11l, (long)13l)))));\n assert(makeAPile((6l)).equals((new ArrayList(Arrays.asList((long)6l, (long)8l, (long)10l, (long)12l, (long)14l, (long)16l)))));\n assert(makeAPile((8l)).equals((new ArrayList(Arrays.asList((long)8l, (long)10l, (long)12l, (long)14l, (long)16l, (long)18l, (long)20l, (long)22l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Task\n // 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\n // then check if the result string is palindrome.\n // A string is called palindrome if it reads the same backward as forward.\n // You should return a tuple containing the result string and True/False for the check.\n // Example\n public static Pair reverseDelete(String s, String c) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(reverseDelete((\"abcde\"), (\"ae\")).equals((Pair.with(\"bcd\", false))));\n assert(reverseDelete((\"abcdef\"), (\"b\")).equals((Pair.with(\"acdef\", false))));\n assert(reverseDelete((\"abcdedcba\"), (\"ab\")).equals((Pair.with(\"cdedc\", true))));\n assert(reverseDelete((\"dwik\"), (\"w\")).equals((Pair.with(\"dik\", false))));\n assert(reverseDelete((\"a\"), (\"a\")).equals((Pair.with(\"\", true))));\n assert(reverseDelete((\"abcdedcba\"), (\"\")).equals((Pair.with(\"abcdedcba\", true))));\n assert(reverseDelete((\"abcdedcba\"), (\"v\")).equals((Pair.with(\"abcdedcba\", true))));\n assert(reverseDelete((\"vabba\"), (\"v\")).equals((Pair.with(\"abba\", true))));\n assert(reverseDelete((\"mamma\"), (\"mia\")).equals((Pair.with(\"\", true))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n public static String flipCase(String string) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(flipCase((\"\")).equals((\"\")));\n assert(flipCase((\"Hello!\")).equals((\"hELLO!\")));\n assert(flipCase((\"These violent delights have violent ends\")).equals((\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a string s.\n // if s[i] is a letter, reverse its case from lower to upper or vise versa, \n // otherwise keep it as it is.\n // If the string contains no letters, reverse the string.\n // The function should return the resulted string.\n // Examples\n public static String solve(String s) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(solve((\"AsDf\")).equals((\"aSdF\")));\n assert(solve((\"1234\")).equals((\"4321\")));\n assert(solve((\"ab\")).equals((\"AB\")));\n assert(solve((\"#a@C\")).equals((\"#A@c\")));\n assert(solve((\"#AsdfW^45\")).equals((\"#aSDFw^45\")));\n assert(solve((\"#6@2\")).equals((\"2@6#\")));\n assert(solve((\"#$a^D\")).equals((\"#$A^d\")));\n assert(solve((\"#ccc\")).equals((\"#CCC\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Filter an input list of strings only for ones that start with a given prefix.\n public static ArrayList filterByPrefix(ArrayList strings, String prefix) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(filterByPrefix((new ArrayList(Arrays.asList())), (\"john\")).equals((new ArrayList(Arrays.asList()))));\n assert(filterByPrefix((new ArrayList(Arrays.asList((String)\"xxx\", (String)\"asd\", (String)\"xxy\", (String)\"john doe\", (String)\"xxxAAA\", (String)\"xxx\"))), (\"xxx\")).equals((new ArrayList(Arrays.asList((String)\"xxx\", (String)\"xxxAAA\", (String)\"xxx\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // This function takes two positive numbers x and y and returns the\n // biggest even integer number that is in the range [x, y] inclusive. If \n // there's no such number, then the function should return -1.\n // For example:\n public static long chooseNum(long x, long y) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(chooseNum((12l), (15l)) == (14l));\n assert(chooseNum((13l), (12l)) == (-1l));\n assert(chooseNum((33l), (12354l)) == (12354l));\n assert(chooseNum((5234l), (5233l)) == (-1l));\n assert(chooseNum((6l), (29l)) == (28l));\n assert(chooseNum((27l), (10l)) == (-1l));\n assert(chooseNum((7l), (7l)) == (-1l));\n assert(chooseNum((546l), (546l)) == (546l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a string representing a sentence,\n // the sentence contains some words separated by a space,\n // and you have to return a string that contains the words from the original sentence,\n // whose lengths are prime numbers,\n // the order of the words in the new string should be the same as the original one.\n // Example 1:\n // Example 2:\n // Constraints:\n // * 1 <= len(sentence) <= 100\n // * sentence contains only letters\n public static String wordsInSentence(String sentence) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(wordsInSentence((\"This is a test\")).equals((\"is\")));\n assert(wordsInSentence((\"lets go for swimming\")).equals((\"go for\")));\n assert(wordsInSentence((\"there is no place available here\")).equals((\"there is no place\")));\n assert(wordsInSentence((\"Hi I am Hussein\")).equals((\"Hi am Hussein\")));\n assert(wordsInSentence((\"go for it\")).equals((\"go for it\")));\n assert(wordsInSentence((\"here\")).equals((\"\")));\n assert(wordsInSentence((\"here is\")).equals((\"is\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n public static ArrayList intersperse(ArrayList numbers, long delimeter) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(intersperse((new ArrayList(Arrays.asList())), (7l)).equals((new ArrayList(Arrays.asList()))));\n assert(intersperse((new ArrayList(Arrays.asList((long)5l, (long)6l, (long)3l, (long)2l))), (8l)).equals((new ArrayList(Arrays.asList((long)5l, (long)8l, (long)6l, (long)8l, (long)3l, (long)8l, (long)2l)))));\n assert(intersperse((new ArrayList(Arrays.asList((long)2l, (long)2l, (long)2l))), (2l)).equals((new ArrayList(Arrays.asList((long)2l, (long)2l, (long)2l, (long)2l, (long)2l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Your task is to write a function that returns true if a number x is a simple\n // power of n and false in other cases.\n // x is a simple power of n if n**int=x\n // For example:\n public static boolean isSimplePower(long x, long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(isSimplePower((16l), (2l)) == (true));\n assert(isSimplePower((143214l), (16l)) == (false));\n assert(isSimplePower((4l), (2l)) == (true));\n assert(isSimplePower((9l), (3l)) == (true));\n assert(isSimplePower((16l), (4l)) == (true));\n assert(isSimplePower((24l), (2l)) == (false));\n assert(isSimplePower((128l), (4l)) == (false));\n assert(isSimplePower((12l), (6l)) == (false));\n assert(isSimplePower((1l), (1l)) == (true));\n assert(isSimplePower((1l), (12l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that returns true if the given number is the multiplication of 3 prime numbers\n // and false otherwise.\n // Knowing that (a) is less then 100. \n // Example:\n // 30 = 2 * 3 * 5\n public static boolean isMultiplyPrime(long a) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(isMultiplyPrime((5l)) == (false));\n assert(isMultiplyPrime((30l)) == (true));\n assert(isMultiplyPrime((8l)) == (true));\n assert(isMultiplyPrime((10l)) == (false));\n assert(isMultiplyPrime((125l)) == (true));\n assert(isMultiplyPrime((105l)) == (true));\n assert(isMultiplyPrime((126l)) == (false));\n assert(isMultiplyPrime((729l)) == (false));\n assert(isMultiplyPrime((891l)) == (false));\n assert(isMultiplyPrime((1001l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given the lengths of the three sides of a triangle. Return True if the three\n // sides form a right-angled triangle, False otherwise.\n // A right-angled triangle is a triangle in which one angle is right angle or \n // 90 degree.\n // Example:\n public static boolean rightAngleTriangle(long a, long b, long c) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(rightAngleTriangle((3l), (4l), (5l)) == (true));\n assert(rightAngleTriangle((1l), (2l), (3l)) == (false));\n assert(rightAngleTriangle((10l), (6l), (8l)) == (true));\n assert(rightAngleTriangle((2l), (2l), (2l)) == (false));\n assert(rightAngleTriangle((7l), (24l), (25l)) == (true));\n assert(rightAngleTriangle((10l), (5l), (7l)) == (false));\n assert(rightAngleTriangle((5l), (12l), (13l)) == (true));\n assert(rightAngleTriangle((15l), (8l), (17l)) == (true));\n assert(rightAngleTriangle((48l), (55l), (73l)) == (true));\n assert(rightAngleTriangle((1l), (1l), (1l)) == (false));\n assert(rightAngleTriangle((2l), (2l), (10l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function that takes 3 numbers.\n // Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n // Returns false in any other cases.\n // Examples\n public static boolean anyInt(float x, float y, float z) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(anyInt((float)2l, (float)3l, (float)1l) == (true));\n assert(anyInt((2.5f), (float)2l, (float)3l) == (false));\n assert(anyInt((1.5f), (float)5l, (3.5f)) == (false));\n assert(anyInt((float)2l, (float)6l, (float)2l) == (false));\n assert(anyInt((float)4l, (float)2l, (float)2l) == (true));\n assert(anyInt((2.2f), (2.2f), (2.2f)) == (false));\n assert(anyInt((float)-4l, (float)6l, (float)2l) == (true));\n assert(anyInt((float)2l, (float)1l, (float)1l) == (true));\n assert(anyInt((float)3l, (float)4l, (float)7l) == (true));\n assert(anyInt((3.0f), (float)4l, (float)7l) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // This function takes a list l and returns a list l' such that\n // l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n // to the values of the corresponding indicies of l, but sorted.\n public static ArrayList sortThird(ArrayList l) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sortThird((new ArrayList(Arrays.asList((long)5l, (long)6l, (long)3l, (long)4l, (long)8l, (long)9l, (long)2l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)6l, (long)3l, (long)4l, (long)8l, (long)9l, (long)5l)))));\n assert(sortThird((new ArrayList(Arrays.asList((long)5l, (long)8l, (long)3l, (long)4l, (long)6l, (long)9l, (long)2l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)8l, (long)3l, (long)4l, (long)6l, (long)9l, (long)5l)))));\n assert(sortThird((new ArrayList(Arrays.asList((long)5l, (long)6l, (long)9l, (long)4l, (long)8l, (long)3l, (long)2l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)6l, (long)9l, (long)4l, (long)8l, (long)3l, (long)5l)))));\n assert(sortThird((new ArrayList(Arrays.asList((long)5l, (long)6l, (long)3l, (long)4l, (long)8l, (long)9l, (long)2l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)6l, (long)3l, (long)4l, (long)8l, (long)9l, (long)5l, (long)1l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_53_add", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Add two numbers x and y\n public static long add(long x, long y) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(add((0l), (1l)) == (1l));\n assert(add((1l), (0l)) == (1l));\n assert(add((2l), (3l)) == (5l));\n assert(add((5l), (7l)) == (12l));\n assert(add((7l), (5l)) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_69_search", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n // zero, and has a frequency greater than or equal to the value of the integer itself. \n // The frequency of an integer is the number of times it appears in the list.\n // If no such a value exist, return -1.\n // Examples:\n public static long search(ArrayList lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(search((new ArrayList(Arrays.asList((long)5l, (long)5l, (long)5l, (long)5l, (long)1l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)4l, (long)1l, (long)4l, (long)1l, (long)4l, (long)4l)))) == (4l));\n assert(search((new ArrayList(Arrays.asList((long)3l, (long)3l)))) == (-1l));\n assert(search((new ArrayList(Arrays.asList((long)8l, (long)8l, (long)8l, (long)8l, (long)8l, (long)8l, (long)8l, (long)8l)))) == (8l));\n assert(search((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)3l, (long)2l, (long)2l)))) == (2l));\n assert(search((new ArrayList(Arrays.asList((long)2l, (long)7l, (long)8l, (long)8l, (long)4l, (long)8l, (long)7l, (long)3l, (long)9l, (long)6l, (long)5l, (long)10l, (long)4l, (long)3l, (long)6l, (long)7l, (long)1l, (long)7l, (long)4l, (long)10l, (long)8l, (long)1l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)8l, (long)2l)))) == (2l));\n assert(search((new ArrayList(Arrays.asList((long)6l, (long)7l, (long)1l, (long)8l, (long)8l, (long)10l, (long)5l, (long)8l, (long)5l, (long)3l, (long)10l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)8l, (long)8l, (long)3l, (long)6l, (long)5l, (long)6l, (long)4l)))) == (-1l));\n assert(search((new ArrayList(Arrays.asList((long)6l, (long)9l, (long)6l, (long)7l, (long)1l, (long)4l, (long)7l, (long)1l, (long)8l, (long)8l, (long)9l, (long)8l, (long)10l, (long)10l, (long)8l, (long)4l, (long)10l, (long)4l, (long)10l, (long)1l, (long)2l, (long)9l, (long)5l, (long)7l, (long)9l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)1l, (long)9l, (long)10l, (long)1l, (long)3l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)6l, (long)9l, (long)7l, (long)5l, (long)8l, (long)7l, (long)5l, (long)3l, (long)7l, (long)5l, (long)10l, (long)10l, (long)3l, (long)6l, (long)10l, (long)2l, (long)8l, (long)6l, (long)5l, (long)4l, (long)9l, (long)5l, (long)3l, (long)10l)))) == (5l));\n assert(search((new ArrayList(Arrays.asList((long)1l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)8l, (long)8l, (long)10l, (long)6l, (long)4l, (long)3l, (long)5l, (long)8l, (long)2l, (long)4l, (long)2l, (long)8l, (long)4l, (long)6l, (long)10l, (long)4l, (long)2l, (long)1l, (long)10l, (long)2l, (long)1l, (long)1l, (long)5l)))) == (4l));\n assert(search((new ArrayList(Arrays.asList((long)2l, (long)10l, (long)4l, (long)8l, (long)2l, (long)10l, (long)5l, (long)1l, (long)2l, (long)9l, (long)5l, (long)5l, (long)6l, (long)3l, (long)8l, (long)6l, (long)4l, (long)10l)))) == (2l));\n assert(search((new ArrayList(Arrays.asList((long)1l, (long)6l, (long)10l, (long)1l, (long)6l, (long)9l, (long)10l, (long)8l, (long)6l, (long)8l, (long)7l, (long)3l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)9l, (long)2l, (long)4l, (long)1l, (long)5l, (long)1l, (long)5l, (long)2l, (long)5l, (long)7l, (long)7l, (long)7l, (long)3l, (long)10l, (long)1l, (long)5l, (long)4l, (long)2l, (long)8l, (long)4l, (long)1l, (long)9l, (long)10l, (long)7l, (long)10l, (long)2l, (long)8l, (long)10l, (long)9l, (long)4l)))) == (4l));\n assert(search((new ArrayList(Arrays.asList((long)2l, (long)6l, (long)4l, (long)2l, (long)8l, (long)7l, (long)5l, (long)6l, (long)4l, (long)10l, (long)4l, (long)6l, (long)3l, (long)7l, (long)8l, (long)8l, (long)3l, (long)1l, (long)4l, (long)2l, (long)2l, (long)10l, (long)7l)))) == (4l));\n assert(search((new ArrayList(Arrays.asList((long)9l, (long)8l, (long)6l, (long)10l, (long)2l, (long)6l, (long)10l, (long)2l, (long)7l, (long)8l, (long)10l, (long)3l, (long)8l, (long)2l, (long)6l, (long)2l, (long)3l, (long)1l)))) == (2l));\n assert(search((new ArrayList(Arrays.asList((long)5l, (long)5l, (long)3l, (long)9l, (long)5l, (long)6l, (long)3l, (long)2l, (long)8l, (long)5l, (long)6l, (long)10l, (long)10l, (long)6l, (long)8l, (long)4l, (long)10l, (long)7l, (long)7l, (long)10l, (long)8l)))) == (-1l));\n assert(search((new ArrayList(Arrays.asList((long)10l)))) == (-1l));\n assert(search((new ArrayList(Arrays.asList((long)9l, (long)7l, (long)7l, (long)2l, (long)4l, (long)7l, (long)2l, (long)10l, (long)9l, (long)7l, (long)5l, (long)7l, (long)2l)))) == (2l));\n assert(search((new ArrayList(Arrays.asList((long)5l, (long)4l, (long)10l, (long)2l, (long)1l, (long)1l, (long)10l, (long)3l, (long)6l, (long)1l, (long)8l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)7l, (long)9l, (long)9l, (long)9l, (long)3l, (long)4l, (long)1l, (long)5l, (long)9l, (long)1l, (long)2l, (long)1l, (long)1l, (long)10l, (long)7l, (long)5l, (long)6l, (long)7l, (long)6l, (long)7l, (long)7l, (long)6l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)3l, (long)10l, (long)10l, (long)9l, (long)2l)))) == (-1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that takes a string and returns True if the string\n // length is a prime number or False otherwise\n // Examples\n public static boolean primeLength(String string) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(primeLength((\"Hello\")) == (true));\n assert(primeLength((\"abcdcba\")) == (true));\n assert(primeLength((\"kittens\")) == (true));\n assert(primeLength((\"orange\")) == (false));\n assert(primeLength((\"wow\")) == (true));\n assert(primeLength((\"world\")) == (true));\n assert(primeLength((\"MadaM\")) == (true));\n assert(primeLength((\"Wow\")) == (true));\n assert(primeLength((\"\")) == (false));\n assert(primeLength((\"HI\")) == (true));\n assert(primeLength((\"go\")) == (true));\n assert(primeLength((\"gogo\")) == (false));\n assert(primeLength((\"aaaaaaaaaaaaaaa\")) == (false));\n assert(primeLength((\"Madam\")) == (true));\n assert(primeLength((\"M\")) == (false));\n assert(primeLength((\"0\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_58_common", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return sorted unique common elements for two lists.\n public static ArrayList common(ArrayList l1, ArrayList l2) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(common((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)3l, (long)34l, (long)653l, (long)2l, (long)5l))), (new ArrayList(Arrays.asList((long)5l, (long)7l, (long)1l, (long)5l, (long)9l, (long)653l, (long)121l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)5l, (long)653l)))));\n assert(common((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)2l, (long)8l))), (new ArrayList(Arrays.asList((long)3l, (long)2l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)3l)))));\n assert(common((new ArrayList(Arrays.asList((long)4l, (long)3l, (long)2l, (long)8l))), (new ArrayList(Arrays.asList((long)3l, (long)2l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)4l)))));\n assert(common((new ArrayList(Arrays.asList((long)4l, (long)3l, (long)2l, (long)8l))), (new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // The Brazilian factorial is defined as:\n // brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n // where n > 0\n // For example:\n // The function will receive an integer as input and should return the special\n // factorial of this integer.\n public static long specialFactorial(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(specialFactorial((4l)) == (288l));\n assert(specialFactorial((5l)) == (34560l));\n assert(specialFactorial((7l)) == (125411328000l));\n assert(specialFactorial((1l)) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // In this problem, you will implement a function that takes two lists of numbers,\n // and determines whether it is possible to perform an exchange of elements\n // between them to make lst1 a list of only even numbers.\n // There is no limit on the number of exchanged elements between lst1 and lst2.\n // If it is possible to exchange elements between the lst1 and lst2 to make\n // all the elements of lst1 to be even, return \"YES\".\n // Otherwise, return \"NO\".\n // For example:\n // It is assumed that the input lists will be non-empty.\n public static String exchange(ArrayList lst1, ArrayList lst2) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(exchange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l))), (new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))).equals((\"YES\")));\n assert(exchange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l))), (new ArrayList(Arrays.asList((long)1l, (long)5l, (long)3l, (long)4l)))).equals((\"NO\")));\n assert(exchange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l))), (new ArrayList(Arrays.asList((long)2l, (long)1l, (long)4l, (long)3l)))).equals((\"YES\")));\n assert(exchange((new ArrayList(Arrays.asList((long)5l, (long)7l, (long)3l))), (new ArrayList(Arrays.asList((long)2l, (long)6l, (long)4l)))).equals((\"YES\")));\n assert(exchange((new ArrayList(Arrays.asList((long)5l, (long)7l, (long)3l))), (new ArrayList(Arrays.asList((long)2l, (long)6l, (long)3l)))).equals((\"NO\")));\n assert(exchange((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)6l, (long)1l, (long)8l, (long)9l))), (new ArrayList(Arrays.asList((long)3l, (long)5l, (long)5l, (long)1l, (long)1l, (long)1l)))).equals((\"NO\")));\n assert(exchange((new ArrayList(Arrays.asList((long)100l, (long)200l))), (new ArrayList(Arrays.asList((long)200l, (long)200l)))).equals((\"YES\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a non-empty array of integers arr and an integer k, return\n // the sum of the elements with at most two digits from the first k elements of arr.\n // Example:\n // Constraints:\n // 1. 1 <= len(arr) <= 100\n // 2. 1 <= k <= len(arr)\n public static long addElements(ArrayList arr, long k) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(addElements((new ArrayList(Arrays.asList((long)1l, (long)-2l, (long)-3l, (long)41l, (long)57l, (long)76l, (long)87l, (long)88l, (long)99l))), (3l)) == (-4l));\n assert(addElements((new ArrayList(Arrays.asList((long)111l, (long)121l, (long)3l, (long)4000l, (long)5l, (long)6l))), (2l)) == (0l));\n assert(addElements((new ArrayList(Arrays.asList((long)11l, (long)21l, (long)3l, (long)90l, (long)5l, (long)6l, (long)7l, (long)8l, (long)9l))), (4l)) == (125l));\n assert(addElements((new ArrayList(Arrays.asList((long)111l, (long)21l, (long)3l, (long)4000l, (long)5l, (long)6l, (long)7l, (long)8l, (long)9l))), (4l)) == (24l));\n assert(addElements((new ArrayList(Arrays.asList((long)1l))), (1l)) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // A simple program which should return the value of x if n is \n // a prime number and should return the value of y otherwise.\n // Examples:\n public static long xOrY(long n, long x, long y) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(xOrY((7l), (34l), (12l)) == (34l));\n assert(xOrY((15l), (8l), (5l)) == (5l));\n assert(xOrY((3l), (33l), (5212l)) == (33l));\n assert(xOrY((1259l), (3l), (52l)) == (3l));\n assert(xOrY((7919l), (-1l), (12l)) == (-1l));\n assert(xOrY((3609l), (1245l), (583l)) == (583l));\n assert(xOrY((91l), (56l), (129l)) == (129l));\n assert(xOrY((6l), (34l), (1234l)) == (1234l));\n assert(xOrY((1l), (2l), (0l)) == (0l));\n assert(xOrY((2l), (2l), (0l)) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given length of a side and high return area for a triangle.\n public static float triangleArea(long a, long h) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(triangleArea((5l), (3l)) == (7.5f));\n assert(triangleArea((2l), (2l)) == (2.0f));\n assert(triangleArea((10l), (8l)) == (40.0f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n // the last couple centuries. However, what people don't know is Tribonacci sequence.\n // Tribonacci sequence is defined by the recurrence:\n // tri(1) = 3\n // tri(n) = 1 + n / 2, if n is even.\n // tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n // For example:\n // tri(2) = 1 + (2 / 2) = 2\n // tri(4) = 3\n // tri(3) = tri(2) + tri(1) + tri(4)\n // = 2 + 3 + 3 = 8 \n // You are given a non-negative integer number n, you have to a return a list of the \n // first n + 1 numbers of the Tribonacci sequence.\n // Examples:\n public static ArrayList tri(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(tri((3l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l)))));\n assert(tri((4l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l, (long)3l)))));\n assert(tri((5l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l, (long)3l, (long)15l)))));\n assert(tri((6l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l, (long)3l, (long)15l, (long)4l)))));\n assert(tri((7l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l, (long)3l, (long)15l, (long)4l, (long)24l)))));\n assert(tri((8l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l, (long)3l, (long)15l, (long)4l, (long)24l, (long)5l)))));\n assert(tri((9l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l, (long)3l, (long)15l, (long)4l, (long)24l, (long)5l, (long)35l)))));\n assert(tri((20l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l, (long)3l, (long)15l, (long)4l, (long)24l, (long)5l, (long)35l, (long)6l, (long)48l, (long)7l, (long)63l, (long)8l, (long)80l, (long)9l, (long)99l, (long)10l, (long)120l, (long)11l)))));\n assert(tri((0l)).equals((new ArrayList(Arrays.asList((long)1l)))));\n assert(tri((1l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a list of two strings, both strings consist of open\n // parentheses '(' or close parentheses ')' only.\n // Your job is to check if it is possible to concatenate the two strings in\n // some order, that the resulting string will be good.\n // A string S is considered to be good if and only if all parentheses in S\n // are balanced. For example: the string '(())()' is good, while the string\n // '())' is not.\n // Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n // Examples:\n public static String matchParens(ArrayList lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(matchParens((new ArrayList(Arrays.asList((String)\"()(\", (String)\")\")))).equals((\"Yes\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\")\", (String)\")\")))).equals((\"No\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\"(()(())\", (String)\"())())\")))).equals((\"No\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\")())\", (String)\"(()()(\")))).equals((\"Yes\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\"(())))\", (String)\"(()())((\")))).equals((\"Yes\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\"()\", (String)\"())\")))).equals((\"No\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\"(()(\", (String)\"()))()\")))).equals((\"Yes\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\"((((\", (String)\"((())\")))).equals((\"No\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\")(()\", (String)\"(()(\")))).equals((\"No\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\")(\", (String)\")(\")))).equals((\"No\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\"(\", (String)\")\")))).equals((\"Yes\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\")\", (String)\"(\")))).equals((\"Yes\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // From a list of integers, remove all elements that occur more than once.\n // Keep order of elements left the same as in the input.\n public static ArrayList removeDuplicates(ArrayList numbers) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(removeDuplicates((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(removeDuplicates((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))));\n assert(removeDuplicates((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)2l, (long)4l, (long)3l, (long)5l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)5l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return a greatest common divisor of two integers a and b\n public static long greatestCommonDivisor(long a, long b) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(greatestCommonDivisor((3l), (7l)) == (1l));\n assert(greatestCommonDivisor((10l), (15l)) == (5l));\n assert(greatestCommonDivisor((49l), (14l)) == (7l));\n assert(greatestCommonDivisor((144l), (60l)) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Checks if given string is a palindrome\n public static boolean isPalindrome(String text) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(isPalindrome((\"\")) == (true));\n assert(isPalindrome((\"aba\")) == (true));\n assert(isPalindrome((\"aaaaa\")) == (true));\n assert(isPalindrome((\"zbcd\")) == (false));\n assert(isPalindrome((\"xywyx\")) == (true));\n assert(isPalindrome((\"xywyz\")) == (false));\n assert(isPalindrome((\"xywzx\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // xs represent coefficients of a polynomial.\n // xs[0] + xs[1] * x + xs[2] * x^2 + ....\n // Return derivative of this polynomial in the same form.\n public static ArrayList derivative(ArrayList xs) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(derivative((new ArrayList(Arrays.asList((long)3l, (long)1l, (long)2l, (long)4l, (long)5l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)12l, (long)20l)))));\n assert(derivative((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)6l)))));\n assert(derivative((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)2l)))));\n assert(derivative((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)1l, (long)0l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)2l, (long)0l, (long)16l)))));\n assert(derivative((new ArrayList(Arrays.asList((long)1l)))).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // In this task, you will be given a string that represents a number of apples and oranges \n // that are distributed in a basket of fruit this basket contains \n // apples, oranges, and mango fruits. Given the string that represents the total number of \n // the oranges and apples and an integer that represent the total number of the fruits \n // in the basket return the number of the mango fruits in the basket.\n // for examble:\n public static long fruitDistribution(String s, long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(fruitDistribution((\"5 apples and 6 oranges\"), (19l)) == (8l));\n assert(fruitDistribution((\"5 apples and 6 oranges\"), (21l)) == (10l));\n assert(fruitDistribution((\"0 apples and 1 oranges\"), (3l)) == (2l));\n assert(fruitDistribution((\"1 apples and 0 oranges\"), (3l)) == (2l));\n assert(fruitDistribution((\"2 apples and 3 oranges\"), (100l)) == (95l));\n assert(fruitDistribution((\"2 apples and 3 oranges\"), (5l)) == (0l));\n assert(fruitDistribution((\"1 apples and 100 oranges\"), (120l)) == (19l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that takes an integer a and returns True \n // if this ingeger is a cube of some integer number.\n // Note: you may assume the input is always valid.\n // Examples:\n public static boolean iscube(long a) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(iscube((1l)) == (true));\n assert(iscube((2l)) == (false));\n assert(iscube((-1l)) == (true));\n assert(iscube((64l)) == (true));\n assert(iscube((180l)) == (false));\n assert(iscube((1000l)) == (true));\n assert(iscube((0l)) == (true));\n assert(iscube((1729l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // In this Kata, you have to sort an array of non-negative integers according to\n // number of ones in their binary representation in ascending order.\n // For similar number of ones, sort based on decimal value.\n // It must be implemented like this:\n public static ArrayList sortArray(ArrayList arr) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sortArray((new ArrayList(Arrays.asList((long)1l, (long)5l, (long)2l, (long)3l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)4l, (long)3l, (long)5l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)-2l, (long)-3l, (long)-4l, (long)-5l, (long)-6l)))).equals((new ArrayList(Arrays.asList((long)-4l, (long)-2l, (long)-6l, (long)-5l, (long)-3l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)1l, (long)0l, (long)2l, (long)3l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)1l, (long)2l, (long)4l, (long)3l)))));\n assert(sortArray((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(sortArray((new ArrayList(Arrays.asList((long)2l, (long)5l, (long)77l, (long)4l, (long)5l, (long)3l, (long)5l, (long)7l, (long)2l, (long)3l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)2l, (long)4l, (long)4l, (long)3l, (long)3l, (long)5l, (long)5l, (long)5l, (long)7l, (long)77l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)3l, (long)6l, (long)44l, (long)12l, (long)32l, (long)5l)))).equals((new ArrayList(Arrays.asList((long)32l, (long)3l, (long)5l, (long)6l, (long)12l, (long)44l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)8l, (long)16l, (long)32l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)8l, (long)16l, (long)32l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)8l, (long)16l, (long)32l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)8l, (long)16l, (long)32l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a list of strings, where each string consists of only digits, return a list.\n // Each element i of the output should be \"the number of odd elements in the\n // string i of the input.\" where all the i's should be replaced by the number\n // of odd digits in the i'th string of the input.\n public static ArrayList oddCount(ArrayList lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(oddCount((new ArrayList(Arrays.asList((String)\"1234567\")))).equals((new ArrayList(Arrays.asList((String)\"the number of odd elements 4n the str4ng 4 of the 4nput.\")))));\n assert(oddCount((new ArrayList(Arrays.asList((String)\"3\", (String)\"11111111\")))).equals((new ArrayList(Arrays.asList((String)\"the number of odd elements 1n the str1ng 1 of the 1nput.\", (String)\"the number of odd elements 8n the str8ng 8 of the 8nput.\")))));\n assert(oddCount((new ArrayList(Arrays.asList((String)\"271\", (String)\"137\", (String)\"314\")))).equals((new ArrayList(Arrays.asList((String)\"the number of odd elements 2n the str2ng 2 of the 2nput.\", (String)\"the number of odd elements 3n the str3ng 3 of the 3nput.\", (String)\"the number of odd elements 2n the str2ng 2 of the 2nput.\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // brackets is a string of \"(\" and \")\".\n // return True if every opening bracket has a corresponding closing bracket.\n public static boolean correctBracketing(String brackets) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(correctBracketing((\"()\")) == (true));\n assert(correctBracketing((\"(()())\")) == (true));\n assert(correctBracketing((\"()()(()())()\")) == (true));\n assert(correctBracketing((\"()()((()()())())(()()(()))\")) == (true));\n assert(correctBracketing((\"((()())))\")) == (false));\n assert(correctBracketing((\")(()\")) == (false));\n assert(correctBracketing((\"(\")) == (false));\n assert(correctBracketing((\"((((\")) == (false));\n assert(correctBracketing((\")\")) == (false));\n assert(correctBracketing((\"(()\")) == (false));\n assert(correctBracketing((\"()()(()())())(()\")) == (false));\n assert(correctBracketing((\"()()(()())()))()\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Task\n // Write a function that takes a string as input and returns the sum of the upper characters only'\n // ASCII codes.\n // Examples:\n public static long digitSum(String s) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(digitSum((\"\")) == (0l));\n assert(digitSum((\"abAB\")) == (131l));\n assert(digitSum((\"abcCd\")) == (67l));\n assert(digitSum((\"helloE\")) == (69l));\n assert(digitSum((\"woArBld\")) == (131l));\n assert(digitSum((\"aAaaaXa\")) == (153l));\n assert(digitSum((\" How are yOu?\")) == (151l));\n assert(digitSum((\"You arE Very Smart\")) == (327l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that accepts a list of strings as a parameter,\n // deletes the strings that have odd lengths from it,\n // and returns the resulted list with a sorted order,\n // The list is always a list of strings and never an array of numbers,\n // and it may contain duplicates.\n // The order of the list should be ascending by length of each word, and you\n // should return the list sorted by that rule.\n // If two words have the same length, sort the list alphabetically.\n // The function should return a list of strings in sorted order.\n // You may assume that all words will have the same length.\n // For example:\n public static ArrayList sortedListSum(ArrayList lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sortedListSum((new ArrayList(Arrays.asList((String)\"aa\", (String)\"a\", (String)\"aaa\")))).equals((new ArrayList(Arrays.asList((String)\"aa\")))));\n assert(sortedListSum((new ArrayList(Arrays.asList((String)\"school\", (String)\"AI\", (String)\"asdf\", (String)\"b\")))).equals((new ArrayList(Arrays.asList((String)\"AI\", (String)\"asdf\", (String)\"school\")))));\n assert(sortedListSum((new ArrayList(Arrays.asList((String)\"d\", (String)\"b\", (String)\"c\", (String)\"a\")))).equals((new ArrayList(Arrays.asList()))));\n assert(sortedListSum((new ArrayList(Arrays.asList((String)\"d\", (String)\"dcba\", (String)\"abcd\", (String)\"a\")))).equals((new ArrayList(Arrays.asList((String)\"abcd\", (String)\"dcba\")))));\n assert(sortedListSum((new ArrayList(Arrays.asList((String)\"AI\", (String)\"ai\", (String)\"au\")))).equals((new ArrayList(Arrays.asList((String)\"AI\", (String)\"ai\", (String)\"au\")))));\n assert(sortedListSum((new ArrayList(Arrays.asList((String)\"a\", (String)\"b\", (String)\"b\", (String)\"c\", (String)\"c\", (String)\"a\")))).equals((new ArrayList(Arrays.asList()))));\n assert(sortedListSum((new ArrayList(Arrays.asList((String)\"aaaa\", (String)\"bbbb\", (String)\"dd\", (String)\"cc\")))).equals((new ArrayList(Arrays.asList((String)\"cc\", (String)\"dd\", (String)\"aaaa\", (String)\"bbbb\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given an array arr of integers and you need to return\n // sum of magnitudes of integers multiplied by product of all signs\n // of each number in the array, represented by 1, -1 or 0.\n // Note: return None for empty arr.\n // Example:\n public static Optional prodSigns(ArrayList arr) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(prodSigns((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)2l, (long)-4l)))).equals(-9l));\n assert(prodSigns((new ArrayList(Arrays.asList((long)0l, (long)1l)))).equals(0l));\n assert(prodSigns((new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)2l, (long)3l, (long)-1l, (long)1l)))).equals(-10l));\n assert(prodSigns((new ArrayList(Arrays.asList()))).equals(Optional.empty()));\n assert(prodSigns((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)1l, (long)2l, (long)-1l, (long)-1l, (long)9l)))).equals(20l));\n assert(prodSigns((new ArrayList(Arrays.asList((long)-1l, (long)1l, (long)-1l, (long)1l)))).equals(4l));\n assert(prodSigns((new ArrayList(Arrays.asList((long)-1l, (long)1l, (long)1l, (long)1l)))).equals(-4l));\n assert(prodSigns((new ArrayList(Arrays.asList((long)-1l, (long)1l, (long)1l, (long)0l)))).equals(0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return list with elements incremented by 1.\n public static ArrayList incrList(ArrayList l) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(incrList((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(incrList((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)4l, (long)3l, (long)2l)))));\n assert(incrList((new ArrayList(Arrays.asList((long)5l, (long)2l, (long)5l, (long)2l, (long)3l, (long)3l, (long)9l, (long)0l, (long)123l)))).equals((new ArrayList(Arrays.asList((long)6l, (long)3l, (long)6l, (long)3l, (long)4l, (long)4l, (long)10l, (long)1l, (long)124l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // From a given list of integers, generate a list of rolling maximum element found until given moment\n // in the sequence.\n public static ArrayList rollingMax(ArrayList numbers) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(rollingMax((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(rollingMax((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))));\n assert(rollingMax((new ArrayList(Arrays.asList((long)4l, (long)3l, (long)2l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)4l, (long)4l, (long)4l, (long)4l)))));\n assert(rollingMax((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)3l, (long)100l, (long)3l)))).equals((new ArrayList(Arrays.asList((long)3l, (long)3l, (long)3l, (long)100l, (long)100l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n // separate those group into separate strings and return the list of those.\n // Separate groups are balanced (each open brace is properly closed) and not nested within each other\n // Ignore any spaces in the input string.\n public static ArrayList separateParenGroups(String paren_string) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(separateParenGroups((\"(()()) ((())) () ((())()())\")).equals((new ArrayList(Arrays.asList((String)\"(()())\", (String)\"((()))\", (String)\"()\", (String)\"((())()())\")))));\n assert(separateParenGroups((\"() (()) ((())) (((())))\")).equals((new ArrayList(Arrays.asList((String)\"()\", (String)\"(())\", (String)\"((()))\", (String)\"(((())))\")))));\n assert(separateParenGroups((\"(()(())((())))\")).equals((new ArrayList(Arrays.asList((String)\"(()(())((())))\")))));\n assert(separateParenGroups((\"( ) (( )) (( )( ))\")).equals((new ArrayList(Arrays.asList((String)\"()\", (String)\"(())\", (String)\"(()())\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You will be given a string of words separated by commas or spaces. Your task is\n // to split the string into words and return an array of the words.\n // For example:\n public static ArrayList wordsString(String s) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(wordsString((\"Hi, my name is John\")).equals((new ArrayList(Arrays.asList((String)\"Hi\", (String)\"my\", (String)\"name\", (String)\"is\", (String)\"John\")))));\n assert(wordsString((\"One, two, three, four, five, six\")).equals((new ArrayList(Arrays.asList((String)\"One\", (String)\"two\", (String)\"three\", (String)\"four\", (String)\"five\", (String)\"six\")))));\n assert(wordsString((\"Hi, my name\")).equals((new ArrayList(Arrays.asList((String)\"Hi\", (String)\"my\", (String)\"name\")))));\n assert(wordsString((\"One,, two, three, four, five, six,\")).equals((new ArrayList(Arrays.asList((String)\"One\", (String)\"two\", (String)\"three\", (String)\"four\", (String)\"five\", (String)\"six\")))));\n assert(wordsString((\"\")).equals((new ArrayList(Arrays.asList()))));\n assert(wordsString((\"ahmed , gamal\")).equals((new ArrayList(Arrays.asList((String)\"ahmed\", (String)\"gamal\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Filter given list of any python values only for integers\n public static ArrayList filterIntegers(ArrayList values) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(filterIntegers((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(filterIntegers((new ArrayList(Arrays.asList(4l, new HashMap(Map.of()), new ArrayList(Arrays.asList()), 23.2f, 9l, \"adasd\")))).equals((new ArrayList(Arrays.asList((long)4l, (long)9l)))));\n assert(filterIntegers((new ArrayList(Arrays.asList(3l, \"c\", 3l, 3l, \"a\", \"b\")))).equals((new ArrayList(Arrays.asList((long)3l, (long)3l, (long)3l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // This function takes a list l and returns a list l' such that\n // l' is identical to l in the odd indicies, while its values at the even indicies are equal\n // to the values of the even indicies of l, but sorted.\n public static ArrayList sortEven(ArrayList l) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sortEven((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)))));\n assert(sortEven((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)-5l, (long)2l, (long)-3l, (long)3l, (long)9l, (long)0l, (long)123l, (long)1l, (long)-10l)))).equals((new ArrayList(Arrays.asList((long)-10l, (long)3l, (long)-5l, (long)2l, (long)-3l, (long)3l, (long)5l, (long)0l, (long)9l, (long)1l, (long)123l)))));\n assert(sortEven((new ArrayList(Arrays.asList((long)5l, (long)8l, (long)-12l, (long)4l, (long)23l, (long)2l, (long)3l, (long)11l, (long)12l, (long)-10l)))).equals((new ArrayList(Arrays.asList((long)-12l, (long)8l, (long)3l, (long)4l, (long)5l, (long)2l, (long)12l, (long)11l, (long)23l, (long)-10l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // I think we all remember that feeling when the result of some long-awaited\n // event is finally known. The feelings and thoughts you have at that moment are\n // definitely worth noting down and comparing.\n // Your task is to determine if a person correctly guessed the results of a number of matches.\n // You are given two arrays of scores and guesses of equal length, where each index shows a match. \n // Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n // the value is 0, and if not, the value is the absolute difference between the guess and the score.\n // example:\n public static ArrayList compare(ArrayList game, ArrayList guess) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(compare((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)1l))), (new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)2l, (long)-2l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l, (long)0l, (long)3l, (long)3l)))));\n assert(compare((new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l, (long)0l, (long)0l, (long)0l))), (new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l, (long)0l, (long)0l, (long)0l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l, (long)0l, (long)0l, (long)0l)))));\n assert(compare((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))), (new ArrayList(Arrays.asList((long)-1l, (long)-2l, (long)-3l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)6l)))));\n assert(compare((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)5l))), (new ArrayList(Arrays.asList((long)-1l, (long)2l, (long)3l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)0l, (long)0l, (long)1l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a positive integer n, return a tuple that has the number of even and odd\n // integer palindromes that fall within the range(1, n), inclusive.\n // Example 1:\n // Explanation:\n // Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n // Example 2:\n // Explanation:\n // Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n // Note:\n // 1. 1 <= n <= 10^3\n // 2. returned tuple has the number of even and odd integer palindromes respectively.\n public static Pair evenOddPalindrome(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(evenOddPalindrome((123l)).equals((Pair.with(8l, 13l))));\n assert(evenOddPalindrome((12l)).equals((Pair.with(4l, 6l))));\n assert(evenOddPalindrome((3l)).equals((Pair.with(1l, 2l))));\n assert(evenOddPalindrome((63l)).equals((Pair.with(6l, 8l))));\n assert(evenOddPalindrome((25l)).equals((Pair.with(5l, 6l))));\n assert(evenOddPalindrome((19l)).equals((Pair.with(4l, 6l))));\n assert(evenOddPalindrome((9l)).equals((Pair.with(4l, 5l))));\n assert(evenOddPalindrome((1l)).equals((Pair.with(0l, 1l))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n // fib4(0) -> 0\n // fib4(1) -> 0\n // fib4(2) -> 2\n // fib4(3) -> 0\n // fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n // Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n public static long fib4(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(fib4((5l)) == (4l));\n assert(fib4((8l)) == (28l));\n assert(fib4((10l)) == (104l));\n assert(fib4((12l)) == (386l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given two positive integers a and b, return the even digits between a\n // and b, in ascending order.\n // For example:\n public static ArrayList generateIntegers(long a, long b) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(generateIntegers((2l), (10l)).equals((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)6l, (long)8l)))));\n assert(generateIntegers((10l), (2l)).equals((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)6l, (long)8l)))));\n assert(generateIntegers((132l), (2l)).equals((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)6l, (long)8l)))));\n assert(generateIntegers((17l), (89l)).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // For a given list of input numbers, calculate Mean Absolute Deviation\n // around the mean of this dataset.\n // Mean Absolute Deviation is the average absolute difference between each\n // element and a centerpoint (mean in this case):\n // MAD = average | x - x_mean |\n public static float meanAbsoluteDeviation(ArrayList numbers) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(meanAbsoluteDeviation((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f)))) == (0.5f));\n assert(meanAbsoluteDeviation((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f)))) == (1.0f));\n assert(meanAbsoluteDeviation((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f)))) == (1.2f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function encrypt that takes a string as an argument and\n // returns a string encrypted with the alphabet being rotated. \n // The alphabet should be rotated in a manner such that the letters \n // shift down by two multiplied to two places.\n // For example:\n public static String encrypt(String s) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(encrypt((\"hi\")).equals((\"lm\")));\n assert(encrypt((\"asdfghjkl\")).equals((\"ewhjklnop\")));\n assert(encrypt((\"gf\")).equals((\"kj\")));\n assert(encrypt((\"et\")).equals((\"ix\")));\n assert(encrypt((\"faewfawefaewg\")).equals((\"jeiajeaijeiak\")));\n assert(encrypt((\"hellomyfriend\")).equals((\"lippsqcjvmirh\")));\n assert(encrypt((\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\")).equals((\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\")));\n assert(encrypt((\"a\")).equals((\"e\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n // The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n // as follows: start with any positive integer n. Then each term is obtained from the \n // previous term as follows: if the previous term is even, the next term is one half of \n // the previous term. If the previous term is odd, the next term is 3 times the previous\n // term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n // Note: \n // 1. Collatz(1) is [1].\n // 2. returned list sorted in increasing order.\n // For example:\n // get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n public static ArrayList getOddCollatz(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(getOddCollatz((14l)).equals((new ArrayList(Arrays.asList((long)1l, (long)5l, (long)7l, (long)11l, (long)13l, (long)17l)))));\n assert(getOddCollatz((5l)).equals((new ArrayList(Arrays.asList((long)1l, (long)5l)))));\n assert(getOddCollatz((12l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)5l)))));\n assert(getOddCollatz((1l)).equals((new ArrayList(Arrays.asList((long)1l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Find how many times a given substring can be found in the original string. Count overlaping cases.\n public static long howManyTimes(String string, String substring) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(howManyTimes((\"\"), (\"x\")) == (0l));\n assert(howManyTimes((\"xyxyxyx\"), (\"x\")) == (4l));\n assert(howManyTimes((\"cacacacac\"), (\"cac\")) == (4l));\n assert(howManyTimes((\"john doe\"), (\"john\")) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n // numbers in the array will be randomly ordered. Your task is to determine if\n // it is possible to get an array sorted in non-decreasing order by performing \n // the following operation on the given array:\n // You are allowed to perform right shift operation any number of times.\n // One right shift operation means shifting all elements of the array by one\n // position in the right direction. The last element of the array will be moved to\n // the starting position in the array i.e. 0th index. \n // If it is possible to obtain the sorted array by performing the above operation\n // then return True else return False.\n // If the given array is empty then return True.\n // Note: The given list is guaranteed to have unique elements.\n // For Example:\n // Explanation: By performin 2 right shift operations, non-decreasing order can\n // be achieved for the given array.\n // Explanation:It is not possible to get non-decreasing order for the given\n // array by performing any number of right shift operations.\n public static boolean moveOneBall(ArrayList arr) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(moveOneBall((new ArrayList(Arrays.asList((long)3l, (long)4l, (long)5l, (long)1l, (long)2l)))) == (true));\n assert(moveOneBall((new ArrayList(Arrays.asList((long)3l, (long)5l, (long)10l, (long)1l, (long)2l)))) == (true));\n assert(moveOneBall((new ArrayList(Arrays.asList((long)4l, (long)3l, (long)1l, (long)2l)))) == (false));\n assert(moveOneBall((new ArrayList(Arrays.asList((long)3l, (long)5l, (long)4l, (long)1l, (long)2l)))) == (false));\n assert(moveOneBall((new ArrayList(Arrays.asList()))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function which sorts the given list of integers\n // in ascending order according to the sum of their digits.\n // Note: if there are several items with similar sum of their digits,\n // order them based on their index in original list.\n // For example:\n public static ArrayList orderByPoints(ArrayList nums) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(orderByPoints((new ArrayList(Arrays.asList((long)1l, (long)11l, (long)-1l, (long)-11l, (long)-12l)))).equals((new ArrayList(Arrays.asList((long)-1l, (long)-11l, (long)1l, (long)-12l, (long)11l)))));\n assert(orderByPoints((new ArrayList(Arrays.asList((long)1234l, (long)423l, (long)463l, (long)145l, (long)2l, (long)423l, (long)423l, (long)53l, (long)6l, (long)37l, (long)3457l, (long)3l, (long)56l, (long)0l, (long)46l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)2l, (long)3l, (long)6l, (long)53l, (long)423l, (long)423l, (long)423l, (long)1234l, (long)145l, (long)37l, (long)46l, (long)56l, (long)463l, (long)3457l)))));\n assert(orderByPoints((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(orderByPoints((new ArrayList(Arrays.asList((long)1l, (long)-11l, (long)-32l, (long)43l, (long)54l, (long)-98l, (long)2l, (long)-3l)))).equals((new ArrayList(Arrays.asList((long)-3l, (long)-32l, (long)-98l, (long)-11l, (long)1l, (long)2l, (long)43l, (long)54l)))));\n assert(orderByPoints((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l, (long)7l, (long)8l, (long)9l, (long)10l, (long)11l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)10l, (long)2l, (long)11l, (long)3l, (long)4l, (long)5l, (long)6l, (long)7l, (long)8l, (long)9l)))));\n assert(orderByPoints((new ArrayList(Arrays.asList((long)0l, (long)6l, (long)6l, (long)-76l, (long)-21l, (long)23l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)-76l, (long)-21l, (long)0l, (long)4l, (long)23l, (long)6l, (long)6l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return list of prime factors of given integer in the order from smallest to largest.\n // Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n // Input number should be equal to the product of all factors\n public static ArrayList factorize(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(factorize((2l)).equals((new ArrayList(Arrays.asList((long)2l)))));\n assert(factorize((4l)).equals((new ArrayList(Arrays.asList((long)2l, (long)2l)))));\n assert(factorize((8l)).equals((new ArrayList(Arrays.asList((long)2l, (long)2l, (long)2l)))));\n assert(factorize((57l)).equals((new ArrayList(Arrays.asList((long)3l, (long)19l)))));\n assert(factorize((3249l)).equals((new ArrayList(Arrays.asList((long)3l, (long)3l, (long)19l, (long)19l)))));\n assert(factorize((185193l)).equals((new ArrayList(Arrays.asList((long)3l, (long)3l, (long)3l, (long)19l, (long)19l, (long)19l)))));\n assert(factorize((20577l)).equals((new ArrayList(Arrays.asList((long)3l, (long)19l, (long)19l, (long)19l)))));\n assert(factorize((18l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)3l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return True if all numbers in the list l are below threshold t.\n public static boolean belowThreshold(ArrayList l, long t) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(belowThreshold((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)4l, (long)10l))), (100l)) == (true));\n assert(belowThreshold((new ArrayList(Arrays.asList((long)1l, (long)20l, (long)4l, (long)10l))), (5l)) == (false));\n assert(belowThreshold((new ArrayList(Arrays.asList((long)1l, (long)20l, (long)4l, (long)10l))), (21l)) == (true));\n assert(belowThreshold((new ArrayList(Arrays.asList((long)1l, (long)20l, (long)4l, (long)10l))), (22l)) == (true));\n assert(belowThreshold((new ArrayList(Arrays.asList((long)1l, (long)8l, (long)4l, (long)10l))), (11l)) == (true));\n assert(belowThreshold((new ArrayList(Arrays.asList((long)1l, (long)8l, (long)4l, (long)10l))), (10l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n // For each of the group, output the deepest level of nesting of parentheses.\n // E.g. (()()) has maximum two levels of nesting while ((())) has three.\n public static ArrayList parseNestedParens(String paren_string) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(parseNestedParens((\"(()()) ((())) () ((())()())\")).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)1l, (long)3l)))));\n assert(parseNestedParens((\"() (()) ((())) (((())))\")).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))));\n assert(parseNestedParens((\"(()(())((())))\")).equals((new ArrayList(Arrays.asList((long)4l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n // Examples\n public static long solution(ArrayList lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(solution((new ArrayList(Arrays.asList((long)5l, (long)8l, (long)7l, (long)1l)))) == (12l));\n assert(solution((new ArrayList(Arrays.asList((long)3l, (long)3l, (long)3l, (long)3l, (long)3l)))) == (9l));\n assert(solution((new ArrayList(Arrays.asList((long)30l, (long)13l, (long)24l, (long)321l)))) == (0l));\n assert(solution((new ArrayList(Arrays.asList((long)5l, (long)9l)))) == (5l));\n assert(solution((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)8l)))) == (0l));\n assert(solution((new ArrayList(Arrays.asList((long)30l, (long)13l, (long)23l, (long)32l)))) == (23l));\n assert(solution((new ArrayList(Arrays.asList((long)3l, (long)13l, (long)2l, (long)9l)))) == (3l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a positive integer n. You have to create an integer array a of length n.\n // For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n // Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n // and a[i] + a[j] + a[k] is a multiple of 3.\n // Example :\n // Explanation: \n // a = [1, 3, 7, 13, 21]\n // The only valid triple is (1, 7, 13).\n public static long getMaxTriples(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(getMaxTriples((5l)) == (1l));\n assert(getMaxTriples((6l)) == (4l));\n assert(getMaxTriples((10l)) == (36l));\n assert(getMaxTriples((100l)) == (53361l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // There are eight planets in our solar system: the closerst to the Sun \n // is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n // Uranus, Neptune.\n // Write a function that takes two planet names as strings planet1 and planet2. \n // The function should return a tuple containing all planets whose orbits are \n // located between the orbit of planet1 and the orbit of planet2, sorted by \n // the proximity to the sun. \n // The function should return an empty tuple if planet1 or planet2\n // are not correct planet names. \n // Examples\n public static ArrayList bf(String planet1, String planet2) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(bf((\"Jupiter\"), (\"Neptune\")).equals((new ArrayList(Arrays.asList((String)\"Saturn\", (String)\"Uranus\")))));\n assert(bf((\"Earth\"), (\"Mercury\")).equals((new ArrayList(Arrays.asList((String)\"Venus\")))));\n assert(bf((\"Mercury\"), (\"Uranus\")).equals((new ArrayList(Arrays.asList((String)\"Venus\", (String)\"Earth\", (String)\"Mars\", (String)\"Jupiter\", (String)\"Saturn\")))));\n assert(bf((\"Neptune\"), (\"Venus\")).equals((new ArrayList(Arrays.asList((String)\"Earth\", (String)\"Mars\", (String)\"Jupiter\", (String)\"Saturn\", (String)\"Uranus\")))));\n assert(bf((\"Earth\"), (\"Earth\")).equals((new ArrayList(Arrays.asList()))));\n assert(bf((\"Mars\"), (\"Earth\")).equals((new ArrayList(Arrays.asList()))));\n assert(bf((\"Jupiter\"), (\"Makemake\")).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a list of integers.\n // Write a function next_smallest() that returns the 2nd smallest element of the list.\n // Return None if there is no such element.\n public static Optional nextSmallest(ArrayList lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(nextSmallest((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l)))).equals(2l));\n assert(nextSmallest((new ArrayList(Arrays.asList((long)5l, (long)1l, (long)4l, (long)3l, (long)2l)))).equals(2l));\n assert(nextSmallest((new ArrayList(Arrays.asList()))).equals(Optional.empty()));\n assert(nextSmallest((new ArrayList(Arrays.asList((long)1l, (long)1l)))).equals(Optional.empty()));\n assert(nextSmallest((new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l, (long)0l)))).equals(1l));\n assert(nextSmallest((new ArrayList(Arrays.asList((long)1l, (long)1l)))).equals(Optional.empty()));\n assert(nextSmallest((new ArrayList(Arrays.asList((long)-35l, (long)34l, (long)12l, (long)-45l)))).equals(-35l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Input is a space-delimited string of numberals from 'zero' to 'nine'.\n // Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n // Return the string with numbers sorted from smallest to largest\n public static String sortNumbers(String numbers) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sortNumbers((\"\")).equals((\"\")));\n assert(sortNumbers((\"three\")).equals((\"three\")));\n assert(sortNumbers((\"three five nine\")).equals((\"three five nine\")));\n assert(sortNumbers((\"five zero four seven nine eight\")).equals((\"zero four five seven eight nine\")));\n assert(sortNumbers((\"six five four three two one zero\")).equals((\"zero one two three four five six\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n public static boolean cycpatternCheck(String a, String b) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(cycpatternCheck((\"xyzw\"), (\"xyw\")) == (false));\n assert(cycpatternCheck((\"yello\"), (\"ell\")) == (true));\n assert(cycpatternCheck((\"whattup\"), (\"ptut\")) == (false));\n assert(cycpatternCheck((\"efef\"), (\"fee\")) == (true));\n assert(cycpatternCheck((\"abab\"), (\"aabb\")) == (false));\n assert(cycpatternCheck((\"winemtt\"), (\"tinem\")) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You will be given a number in decimal form and your task is to convert it to\n // binary format. The function should return a string, with each character representing a binary\n // number. Each character in the string will be '0' or '1'.\n // There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n // The extra characters are there to help with the format.\n // Examples:\n public static String decimalToBinary(long decimal) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(decimalToBinary((0l)).equals((\"db0db\")));\n assert(decimalToBinary((32l)).equals((\"db100000db\")));\n assert(decimalToBinary((103l)).equals((\"db1100111db\")));\n assert(decimalToBinary((15l)).equals((\"db1111db\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Filter an input list of strings only for ones that contain given substring\n public static ArrayList filterBySubstring(ArrayList strings, String substring) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(filterBySubstring((new ArrayList(Arrays.asList())), (\"john\")).equals((new ArrayList(Arrays.asList()))));\n assert(filterBySubstring((new ArrayList(Arrays.asList((String)\"xxx\", (String)\"asd\", (String)\"xxy\", (String)\"john doe\", (String)\"xxxAAA\", (String)\"xxx\"))), (\"xxx\")).equals((new ArrayList(Arrays.asList((String)\"xxx\", (String)\"xxxAAA\", (String)\"xxx\")))));\n assert(filterBySubstring((new ArrayList(Arrays.asList((String)\"xxx\", (String)\"asd\", (String)\"aaaxxy\", (String)\"john doe\", (String)\"xxxAAA\", (String)\"xxx\"))), (\"xx\")).equals((new ArrayList(Arrays.asList((String)\"xxx\", (String)\"aaaxxy\", (String)\"xxxAAA\", (String)\"xxx\")))));\n assert(filterBySubstring((new ArrayList(Arrays.asList((String)\"grunt\", (String)\"trumpet\", (String)\"prune\", (String)\"gruesome\"))), (\"run\")).equals((new ArrayList(Arrays.asList((String)\"grunt\", (String)\"prune\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given an integer. return a tuple that has the number of even and odd digits respectively.\n // Example:\n public static Pair evenOddCount(long num) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(evenOddCount((7l)).equals((Pair.with(0l, 1l))));\n assert(evenOddCount((-78l)).equals((Pair.with(1l, 1l))));\n assert(evenOddCount((3452l)).equals((Pair.with(2l, 2l))));\n assert(evenOddCount((346211l)).equals((Pair.with(3l, 3l))));\n assert(evenOddCount((-345821l)).equals((Pair.with(3l, 3l))));\n assert(evenOddCount((-2l)).equals((Pair.with(1l, 0l))));\n assert(evenOddCount((-45347l)).equals((Pair.with(2l, 3l))));\n assert(evenOddCount((0l)).equals((Pair.with(1l, 0l))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that accepts a list of strings.\n // The list contains different words. Return the word with maximum number\n // of unique characters. If multiple strings have maximum number of unique\n // characters, return the one which comes first in lexicographical order.\n public static String findMax(ArrayList words) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(findMax((new ArrayList(Arrays.asList((String)\"name\", (String)\"of\", (String)\"string\")))).equals((\"string\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"name\", (String)\"enam\", (String)\"game\")))).equals((\"enam\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"aaaaaaa\", (String)\"bb\", (String)\"cc\")))).equals((\"aaaaaaa\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"abc\", (String)\"cba\")))).equals((\"abc\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"play\", (String)\"this\", (String)\"game\", (String)\"of\", (String)\"footbott\")))).equals((\"footbott\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"we\", (String)\"are\", (String)\"gonna\", (String)\"rock\")))).equals((\"gonna\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"we\", (String)\"are\", (String)\"a\", (String)\"mad\", (String)\"nation\")))).equals((\"nation\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"this\", (String)\"is\", (String)\"a\", (String)\"prrk\")))).equals((\"this\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"b\")))).equals((\"b\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"play\", (String)\"play\", (String)\"play\")))).equals((\"play\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function that returns a tuple (a, b), where 'a' is\n // the largest of negative integers, and 'b' is the smallest\n // of positive integers in a list.\n // If there is no negative or positive integers, return them as None.\n // Examples:\n public static Pair, Optional> largestSmallestIntegers(ArrayList lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)1l, (long)3l, (long)5l, (long)7l)))).equals(Pair.with(Optional.of(Optional.empty()), Optional.of(1l))));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)1l, (long)3l, (long)5l, (long)7l, (long)0l)))).equals(Pair.with(Optional.of(Optional.empty()), Optional.of(1l))));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)4l, (long)5l, (long)6l, (long)-2l)))).equals(Pair.with(-2l, 1l)));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)4l, (long)5l, (long)3l, (long)6l, (long)2l, (long)7l, (long)-7l)))).equals(Pair.with(-7l, 2l)));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)7l, (long)3l, (long)8l, (long)4l, (long)9l, (long)2l, (long)5l, (long)-9l)))).equals(Pair.with(-9l, 2l)));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList()))).equals(Pair.with(Optional.of(Optional.empty()), Optional.of(Optional.empty()))));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)0l)))).equals(Pair.with(Optional.of(Optional.empty()), Optional.of(Optional.empty()))));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)-1l, (long)-3l, (long)-5l, (long)-6l)))).equals(Pair.with(Optional.of(-1l), Optional.of(Optional.empty()))));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)-1l, (long)-3l, (long)-5l, (long)-6l, (long)0l)))).equals(Pair.with(Optional.of(-1l), Optional.of(Optional.empty()))));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)-6l, (long)-4l, (long)-4l, (long)-3l, (long)1l)))).equals(Pair.with(-3l, 1l)));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)-6l, (long)-4l, (long)-4l, (long)-3l, (long)-100l, (long)1l)))).equals(Pair.with(-3l, 1l)));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // \"Given an array representing a branch of a tree that has non-negative integer nodes\n // your task is to pluck one of the nodes and return it.\n // The plucked node should be the node with the smallest even value.\n // If multiple nodes with the same smallest even value are found return the node that has smallest index.\n // The plucked node should be returned in a list, [ smalest_value, its index ],\n // If there are no even values or the given array is empty, return [].\n // Example 1:\n // Explanation: 2 has the smallest even value, and 2 has the smallest index.\n // Example 2:\n // Explanation: 2 has the smallest even value, and 2 has the smallest index.\n // Example 3:\n // Example 4:\n // Explanation: 0 is the smallest value, but there are two zeros,\n // so we will choose the first zero, which has the smallest index.\n // Constraints:\n // * 1 <= nodes.length <= 10000\n // * 0 <= node.value\n public static ArrayList pluck(ArrayList arr) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(pluck((new ArrayList(Arrays.asList((long)4l, (long)2l, (long)3l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)1l)))));\n assert(pluck((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)1l)))));\n assert(pluck((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(pluck((new ArrayList(Arrays.asList((long)5l, (long)0l, (long)3l, (long)0l, (long)4l, (long)2l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)1l)))));\n assert(pluck((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)0l, (long)5l, (long)3l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)3l)))));\n assert(pluck((new ArrayList(Arrays.asList((long)5l, (long)4l, (long)8l, (long)4l, (long)8l)))).equals((new ArrayList(Arrays.asList((long)4l, (long)1l)))));\n assert(pluck((new ArrayList(Arrays.asList((long)7l, (long)6l, (long)7l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)6l, (long)1l)))));\n assert(pluck((new ArrayList(Arrays.asList((long)7l, (long)9l, (long)7l, (long)1l)))).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function count_nums which takes an array of integers and returns\n // the number of elements which has a sum of digits > 0.\n // If a number is negative, then its first signed digit will be negative:\n // e.g. -123 has signed digits -1, 2, and 3.\n public static long countNums(ArrayList arr) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(countNums((new ArrayList(Arrays.asList()))) == (0l));\n assert(countNums((new ArrayList(Arrays.asList((long)-1l, (long)-2l, (long)0l)))) == (0l));\n assert(countNums((new ArrayList(Arrays.asList((long)1l, (long)1l, (long)2l, (long)-2l, (long)3l, (long)4l, (long)5l)))) == (6l));\n assert(countNums((new ArrayList(Arrays.asList((long)1l, (long)6l, (long)9l, (long)-6l, (long)0l, (long)1l, (long)5l)))) == (5l));\n assert(countNums((new ArrayList(Arrays.asList((long)1l, (long)100l, (long)98l, (long)-7l, (long)1l, (long)-1l)))) == (4l));\n assert(countNums((new ArrayList(Arrays.asList((long)12l, (long)23l, (long)34l, (long)-45l, (long)-56l, (long)0l)))) == (5l));\n assert(countNums((new ArrayList(Arrays.asList((long)0l, (long)1l)))) == (1l));\n assert(countNums((new ArrayList(Arrays.asList((long)1l)))) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n // each cell of the grid contains a value. Every integer in the range [1, N * N]\n // inclusive appears exactly once on the cells of the grid.\n // You have to find the minimum path of length k in the grid. You can start\n // from any cell, and in each step you can move to any of the neighbor cells,\n // in other words, you can go to cells which share an edge with you current\n // cell.\n // Please note that a path of length k means visiting exactly k cells (not\n // necessarily distinct).\n // You CANNOT go off the grid.\n // A path A (of length k) is considered less than a path B (of length k) if\n // after making the ordered lists of the values on the cells that A and B go\n // through (let's call them lst_A and lst_B), lst_A is lexicographically less\n // than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n // such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n // lst_A[j] = lst_B[j].\n // It is guaranteed that the answer is unique.\n // Return an ordered list of the values on the cells that the minimum path go through.\n // Examples:\n public static ArrayList minPath(ArrayList> grid, long k) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)), (ArrayList)new ArrayList(Arrays.asList((long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)7l, (long)8l, (long)9l))))), (3l)).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)1l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)5l, (long)9l, (long)3l)), (ArrayList)new ArrayList(Arrays.asList((long)4l, (long)1l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)7l, (long)8l, (long)2l))))), (1l)).equals((new ArrayList(Arrays.asList((long)1l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)), (ArrayList)new ArrayList(Arrays.asList((long)5l, (long)6l, (long)7l, (long)8l)), (ArrayList)new ArrayList(Arrays.asList((long)9l, (long)10l, (long)11l, (long)12l)), (ArrayList)new ArrayList(Arrays.asList((long)13l, (long)14l, (long)15l, (long)16l))))), (4l)).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)1l, (long)2l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)6l, (long)4l, (long)13l, (long)10l)), (ArrayList)new ArrayList(Arrays.asList((long)5l, (long)7l, (long)12l, (long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)3l, (long)16l, (long)11l, (long)15l)), (ArrayList)new ArrayList(Arrays.asList((long)8l, (long)14l, (long)9l, (long)2l))))), (7l)).equals((new ArrayList(Arrays.asList((long)1l, (long)10l, (long)1l, (long)10l, (long)1l, (long)10l, (long)1l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)8l, (long)14l, (long)9l, (long)2l)), (ArrayList)new ArrayList(Arrays.asList((long)6l, (long)4l, (long)13l, (long)15l)), (ArrayList)new ArrayList(Arrays.asList((long)5l, (long)7l, (long)1l, (long)12l)), (ArrayList)new ArrayList(Arrays.asList((long)3l, (long)10l, (long)11l, (long)16l))))), (5l)).equals((new ArrayList(Arrays.asList((long)1l, (long)7l, (long)1l, (long)7l, (long)1l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)11l, (long)8l, (long)7l, (long)2l)), (ArrayList)new ArrayList(Arrays.asList((long)5l, (long)16l, (long)14l, (long)4l)), (ArrayList)new ArrayList(Arrays.asList((long)9l, (long)3l, (long)15l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)12l, (long)13l, (long)10l, (long)1l))))), (9l)).equals((new ArrayList(Arrays.asList((long)1l, (long)6l, (long)1l, (long)6l, (long)1l, (long)6l, (long)1l, (long)6l, (long)1l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)12l, (long)13l, (long)10l, (long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)9l, (long)3l, (long)15l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)5l, (long)16l, (long)14l, (long)4l)), (ArrayList)new ArrayList(Arrays.asList((long)11l, (long)8l, (long)7l, (long)2l))))), (12l)).equals((new ArrayList(Arrays.asList((long)1l, (long)6l, (long)1l, (long)6l, (long)1l, (long)6l, (long)1l, (long)6l, (long)1l, (long)6l, (long)1l, (long)6l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)2l, (long)7l, (long)4l)), (ArrayList)new ArrayList(Arrays.asList((long)3l, (long)1l, (long)5l)), (ArrayList)new ArrayList(Arrays.asList((long)6l, (long)8l, (long)9l))))), (8l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)1l, (long)3l, (long)1l, (long)3l, (long)1l, (long)3l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)6l, (long)1l, (long)5l)), (ArrayList)new ArrayList(Arrays.asList((long)3l, (long)8l, (long)9l)), (ArrayList)new ArrayList(Arrays.asList((long)2l, (long)7l, (long)4l))))), (8l)).equals((new ArrayList(Arrays.asList((long)1l, (long)5l, (long)1l, (long)5l, (long)1l, (long)5l, (long)1l, (long)5l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l)), (ArrayList)new ArrayList(Arrays.asList((long)3l, (long)4l))))), (10l)).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)1l, (long)2l, (long)1l, (long)2l, (long)1l, (long)2l, (long)1l, (long)2l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)3l)), (ArrayList)new ArrayList(Arrays.asList((long)3l, (long)2l))))), (10l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)1l, (long)3l, (long)1l, (long)3l, (long)1l, (long)3l, (long)1l, (long)3l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given list of integers, return list in strange order.\n // Strange sorting, is when you start with the minimum value,\n // then maximum of the remaining integers, then minimum and so on.\n // Examples:\n public static ArrayList strangeSortList(ArrayList lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(strangeSortList((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)2l, (long)3l)))));\n assert(strangeSortList((new ArrayList(Arrays.asList((long)5l, (long)6l, (long)7l, (long)8l, (long)9l)))).equals((new ArrayList(Arrays.asList((long)5l, (long)9l, (long)6l, (long)8l, (long)7l)))));\n assert(strangeSortList((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)5l, (long)2l, (long)4l, (long)3l)))));\n assert(strangeSortList((new ArrayList(Arrays.asList((long)5l, (long)6l, (long)7l, (long)8l, (long)9l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)9l, (long)5l, (long)8l, (long)6l, (long)7l)))));\n assert(strangeSortList((new ArrayList(Arrays.asList((long)5l, (long)5l, (long)5l, (long)5l)))).equals((new ArrayList(Arrays.asList((long)5l, (long)5l, (long)5l, (long)5l)))));\n assert(strangeSortList((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(strangeSortList((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l, (long)7l, (long)8l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)8l, (long)2l, (long)7l, (long)3l, (long)6l, (long)4l, (long)5l)))));\n assert(strangeSortList((new ArrayList(Arrays.asList((long)0l, (long)2l, (long)2l, (long)2l, (long)5l, (long)5l, (long)-5l, (long)-5l)))).equals((new ArrayList(Arrays.asList((long)-5l, (long)5l, (long)-5l, (long)5l, (long)0l, (long)2l, (long)2l, (long)2l)))));\n assert(strangeSortList((new ArrayList(Arrays.asList((long)111111l)))).equals((new ArrayList(Arrays.asList((long)111111l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a string 'text', return its md5 hash equivalent string.\n // If 'text' is an empty string, return None.\n public static Optional stringToMd5(String text) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(stringToMd5((\"Hello world\")).equals(\"3e25960a79dbc69b674cd4ec67a72c62\"));\n assert(stringToMd5((\"\")).equals(Optional.empty()));\n assert(stringToMd5((\"A B C\")).equals(\"0ef78513b0cb8cef12743f5aeb35f888\"));\n assert(stringToMd5((\"password\")).equals(\"5f4dcc3b5aa765d61d8327deb882cf99\"));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a word. Your task is to find the closest vowel that stands between \n // two consonants from the right side of the word (case sensitive).\n // Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n // find any vowel met the above condition. \n // You may assume that the given string contains English letter only.\n // Example:\n public static String getClosestVowel(String word) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(getClosestVowel((\"yogurt\")).equals((\"u\")));\n assert(getClosestVowel((\"full\")).equals((\"u\")));\n assert(getClosestVowel((\"easy\")).equals((\"\")));\n assert(getClosestVowel((\"eAsy\")).equals((\"\")));\n assert(getClosestVowel((\"ali\")).equals((\"\")));\n assert(getClosestVowel((\"bad\")).equals((\"a\")));\n assert(getClosestVowel((\"most\")).equals((\"o\")));\n assert(getClosestVowel((\"ab\")).equals((\"\")));\n assert(getClosestVowel((\"ba\")).equals((\"\")));\n assert(getClosestVowel((\"quick\")).equals((\"\")));\n assert(getClosestVowel((\"anime\")).equals((\"i\")));\n assert(getClosestVowel((\"Asia\")).equals((\"\")));\n assert(getClosestVowel((\"Above\")).equals((\"o\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Change numerical base of input number x to base.\n // return string representation after the conversion.\n // base numbers are less than 10.\n public static String changeBase(long x, long base) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(changeBase((8l), (3l)).equals((\"22\")));\n assert(changeBase((9l), (3l)).equals((\"100\")));\n assert(changeBase((234l), (2l)).equals((\"11101010\")));\n assert(changeBase((16l), (2l)).equals((\"10000\")));\n assert(changeBase((8l), (2l)).equals((\"1000\")));\n assert(changeBase((7l), (2l)).equals((\"111\")));\n assert(changeBase((2l), (3l)).equals((\"2\")));\n assert(changeBase((3l), (4l)).equals((\"3\")));\n assert(changeBase((4l), (5l)).equals((\"4\")));\n assert(changeBase((5l), (6l)).equals((\"5\")));\n assert(changeBase((6l), (7l)).equals((\"6\")));\n assert(changeBase((7l), (8l)).equals((\"7\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Check if in given list of numbers, are any two numbers closer to each other than\n // given threshold.\n public static boolean hasCloseElements(ArrayList numbers, float threshold) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(hasCloseElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.9f, (float)4.0f, (float)5.0f, (float)2.2f))), (0.3f)) == (true));\n assert(hasCloseElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.9f, (float)4.0f, (float)5.0f, (float)2.2f))), (0.05f)) == (false));\n assert(hasCloseElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)5.9f, (float)4.0f, (float)5.0f))), (0.95f)) == (true));\n assert(hasCloseElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)5.9f, (float)4.0f, (float)5.0f))), (0.8f)) == (false));\n assert(hasCloseElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.0f))), (0.1f)) == (true));\n assert(hasCloseElements((new ArrayList(Arrays.asList((float)1.1f, (float)2.2f, (float)3.1f, (float)4.1f, (float)5.1f))), (1.0f)) == (true));\n assert(hasCloseElements((new ArrayList(Arrays.asList((float)1.1f, (float)2.2f, (float)3.1f, (float)4.1f, (float)5.1f))), (0.5f)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function that takes a string as input which contains only square brackets.\n // The function should return True if and only if there is a valid subsequence of brackets \n // where at least one bracket in the subsequence is nested.\n public static boolean isNested(String string) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(isNested((\"[[]]\")) == (true));\n assert(isNested((\"[]]]]]]][[[[[]\")) == (false));\n assert(isNested((\"[][]\")) == (false));\n assert(isNested((\"[]\")) == (false));\n assert(isNested((\"[[[[]]]]\")) == (true));\n assert(isNested((\"[]]]]]]]]]]\")) == (false));\n assert(isNested((\"[][][[]]\")) == (true));\n assert(isNested((\"[[]\")) == (false));\n assert(isNested((\"[]]\")) == (false));\n assert(isNested((\"[[]][[\")) == (true));\n assert(isNested((\"[[][]]\")) == (true));\n assert(isNested((\"\")) == (false));\n assert(isNested((\"[[[[[[[[\")) == (false));\n assert(isNested((\"]]]]]]]]\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Concatenate list of strings into a single string\n public static String concatenate(ArrayList strings) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(concatenate((new ArrayList(Arrays.asList()))).equals((\"\")));\n assert(concatenate((new ArrayList(Arrays.asList((String)\"x\", (String)\"y\", (String)\"z\")))).equals((\"xyz\")));\n assert(concatenate((new ArrayList(Arrays.asList((String)\"x\", (String)\"y\", (String)\"z\", (String)\"w\", (String)\"k\")))).equals((\"xyzwk\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n public static long primeFib(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(primeFib((1l)) == (2l));\n assert(primeFib((2l)) == (3l));\n assert(primeFib((3l)) == (5l));\n assert(primeFib((4l)) == (13l));\n assert(primeFib((5l)) == (89l));\n assert(primeFib((6l)) == (233l));\n assert(primeFib((7l)) == (1597l));\n assert(primeFib((8l)) == (28657l));\n assert(primeFib((9l)) == (514229l));\n assert(primeFib((10l)) == (433494437l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n // other and return them in order (smaller number, larger number).\n public static Pair findClosestElements(ArrayList numbers) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(findClosestElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.9f, (float)4.0f, (float)5.0f, (float)2.2f)))).equals((Pair.with(3.9f, 4.0f))));\n assert(findClosestElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)5.9f, (float)4.0f, (float)5.0f)))).equals((Pair.with(5.0f, 5.9f))));\n assert(findClosestElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.2f)))).equals((Pair.with(2.0f, 2.2f))));\n assert(findClosestElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.0f)))).equals((Pair.with(2.0f, 2.0f))));\n assert(findClosestElements((new ArrayList(Arrays.asList((float)1.1f, (float)2.2f, (float)3.1f, (float)4.1f, (float)5.1f)))).equals((Pair.with(2.2f, 3.1f))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You have been tasked to write a function that receives \n // a hexadecimal number as a string and counts the number of hexadecimal \n // digits that are primes (prime number, or a prime, is a natural number \n // greater than 1 that is not a product of two smaller natural numbers).\n // Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n // Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n // So you have to determine a number of the following digits: 2, 3, 5, 7, \n // B (=decimal 11), D (=decimal 13).\n // Note: you may assume the input is always correct or empty string, \n // and symbols A,B,C,D,E,F are always uppercase.\n // Examples:\n public static long hexKey(String num) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(hexKey((\"AB\")) == (1l));\n assert(hexKey((\"1077E\")) == (2l));\n assert(hexKey((\"ABED1A33\")) == (4l));\n assert(hexKey((\"2020\")) == (2l));\n assert(hexKey((\"123456789ABCDEF0\")) == (6l));\n assert(hexKey((\"112233445566778899AABBCCDDEEFF00\")) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Complete the function that takes two integers and returns \n // the product of their unit digits.\n // Assume the input is always valid.\n // Examples:\n public static long multiply(long a, long b) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(multiply((148l), (412l)) == (16l));\n assert(multiply((19l), (28l)) == (72l));\n assert(multiply((2020l), (1851l)) == (0l));\n assert(multiply((14l), (-15l)) == (20l));\n assert(multiply((76l), (67l)) == (42l));\n assert(multiply((17l), (27l)) == (49l));\n assert(multiply((0l), (1l)) == (0l));\n assert(multiply((0l), (0l)) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given list of numbers (of at least two elements), apply a linear transform to that list,\n // such that the smallest number will become 0 and the largest will become 1\n public static ArrayList rescaleToUnit(ArrayList numbers) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(rescaleToUnit((new ArrayList(Arrays.asList((float)2.0f, (float)49.9f)))).equals((new ArrayList(Arrays.asList((float)0.0f, (float)1.0f)))));\n assert(rescaleToUnit((new ArrayList(Arrays.asList((float)100.0f, (float)49.9f)))).equals((new ArrayList(Arrays.asList((float)1.0f, (float)0.0f)))));\n assert(rescaleToUnit((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f)))).equals((new ArrayList(Arrays.asList((float)0.0f, (float)0.25f, (float)0.5f, (float)0.75f, (float)1.0f)))));\n assert(rescaleToUnit((new ArrayList(Arrays.asList((float)2.0f, (float)1.0f, (float)5.0f, (float)3.0f, (float)4.0f)))).equals((new ArrayList(Arrays.asList((float)0.25f, (float)0.0f, (float)1.0f, (float)0.5f, (float)0.75f)))));\n assert(rescaleToUnit((new ArrayList(Arrays.asList((float)12.0f, (float)11.0f, (float)15.0f, (float)13.0f, (float)14.0f)))).equals((new ArrayList(Arrays.asList((float)0.25f, (float)0.0f, (float)1.0f, (float)0.5f, (float)0.75f)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a positive integer n, return the product of the odd digits.\n // Return 0 if all digits are even.\n // For example:\n public static long digits(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(digits((5l)) == (5l));\n assert(digits((54l)) == (5l));\n assert(digits((120l)) == (1l));\n assert(digits((5014l)) == (5l));\n assert(digits((98765l)) == (315l));\n assert(digits((5576543l)) == (2625l));\n assert(digits((2468l)) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You will be given the name of a class (a string) and a list of extensions.\n // The extensions are to be used to load additional classes to the class. The\n // strength of the extension is as follows: Let CAP be the number of the uppercase\n // letters in the extension's name, and let SM be the number of lowercase letters \n // in the extension's name, the strength is given by the fraction CAP - SM. \n // You should find the strongest extension and return a string in this \n // format: ClassName.StrongestExtensionName.\n // If there are two or more extensions with the same strength, you should\n // choose the one that comes first in the list.\n // For example, if you are given \"Slices\" as the class and a list of the\n // extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n // return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n // (its strength is -1).\n // Example:\n public static String StrongestExtension(String class_name, ArrayList extensions) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(StrongestExtension((\"Watashi\"), (new ArrayList(Arrays.asList((String)\"tEN\", (String)\"niNE\", (String)\"eIGHt8OKe\")))).equals((\"Watashi.eIGHt8OKe\")));\n assert(StrongestExtension((\"Boku123\"), (new ArrayList(Arrays.asList((String)\"nani\", (String)\"NazeDa\", (String)\"YEs.WeCaNe\", (String)\"32145tggg\")))).equals((\"Boku123.YEs.WeCaNe\")));\n assert(StrongestExtension((\"__YESIMHERE\"), (new ArrayList(Arrays.asList((String)\"t\", (String)\"eMptY\", (String)\"nothing\", (String)\"zeR00\", (String)\"NuLl__\", (String)\"123NoooneB321\")))).equals((\"__YESIMHERE.NuLl__\")));\n assert(StrongestExtension((\"K\"), (new ArrayList(Arrays.asList((String)\"Ta\", (String)\"TAR\", (String)\"t234An\", (String)\"cosSo\")))).equals((\"K.TAR\")));\n assert(StrongestExtension((\"__HAHA\"), (new ArrayList(Arrays.asList((String)\"Tab\", (String)\"123\", (String)\"781345\", (String)\"-_-\")))).equals((\"__HAHA.123\")));\n assert(StrongestExtension((\"YameRore\"), (new ArrayList(Arrays.asList((String)\"HhAas\", (String)\"okIWILL123\", (String)\"WorkOut\", (String)\"Fails\", (String)\"-_-\")))).equals((\"YameRore.okIWILL123\")));\n assert(StrongestExtension((\"finNNalLLly\"), (new ArrayList(Arrays.asList((String)\"Die\", (String)\"NowW\", (String)\"Wow\", (String)\"WoW\")))).equals((\"finNNalLLly.WoW\")));\n assert(StrongestExtension((\"_\"), (new ArrayList(Arrays.asList((String)\"Bb\", (String)\"91245\")))).equals((\"_.Bb\")));\n assert(StrongestExtension((\"Sp\"), (new ArrayList(Arrays.asList((String)\"671235\", (String)\"Bb\")))).equals((\"Sp.671235\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a string representing a space separated lowercase letters, return a dictionary\n // of the letter with the most repetition and containing the corresponding count.\n // If several letters have the same occurrence, return all of them.\n // Example:\n public static HashMap histogram(String test) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(histogram((\"a b b a\")).equals((new HashMap(Map.of(\"a\", 2l, \"b\", 2l)))));\n assert(histogram((\"a b c a b\")).equals((new HashMap(Map.of(\"a\", 2l, \"b\", 2l)))));\n assert(histogram((\"a b c d g\")).equals((new HashMap(Map.of(\"a\", 1l, \"b\", 1l, \"c\", 1l, \"d\", 1l, \"g\", 1l)))));\n assert(histogram((\"r t g\")).equals((new HashMap(Map.of(\"r\", 1l, \"t\", 1l, \"g\", 1l)))));\n assert(histogram((\"b b b b a\")).equals((new HashMap(Map.of(\"b\", 4l)))));\n assert(histogram((\"r t g\")).equals((new HashMap(Map.of(\"r\", 1l, \"t\", 1l, \"g\", 1l)))));\n assert(histogram((\"\")).equals((new HashMap())));\n assert(histogram((\"a\")).equals((new HashMap(Map.of(\"a\", 1l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // pairs_sum_to_zero takes a list of integers as an input.\n // it returns True if there are two distinct elements in the list that\n // sum to zero, and False otherwise.\n public static boolean pairsSumToZero(ArrayList l) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)5l, (long)0l)))) == (false));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)-2l, (long)1l)))) == (false));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)7l)))) == (false));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)-5l, (long)3l, (long)5l, (long)7l)))) == (true));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)1l)))) == (false));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)-3l, (long)9l, (long)-1l, (long)3l, (long)2l, (long)30l)))) == (true));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)-3l, (long)9l, (long)-1l, (long)3l, (long)2l, (long)31l)))) == (true));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)-3l, (long)9l, (long)-1l, (long)4l, (long)2l, (long)30l)))) == (false));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)-3l, (long)9l, (long)-1l, (long)4l, (long)2l, (long)31l)))) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that accepts two lists of strings and returns the list that has \n // total number of chars in the all strings of the list less than the other list.\n // if the two lists have the same number of chars, return the first list.\n // Examples\n public static ArrayList totalMatch(ArrayList lst1, ArrayList lst2) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(totalMatch((new ArrayList(Arrays.asList())), (new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(totalMatch((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\"))), (new ArrayList(Arrays.asList((String)\"hi\", (String)\"hi\")))).equals((new ArrayList(Arrays.asList((String)\"hi\", (String)\"hi\")))));\n assert(totalMatch((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\"))), (new ArrayList(Arrays.asList((String)\"hi\", (String)\"hi\", (String)\"admin\", (String)\"project\")))).equals((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\")))));\n assert(totalMatch((new ArrayList(Arrays.asList((String)\"4\"))), (new ArrayList(Arrays.asList((String)\"1\", (String)\"2\", (String)\"3\", (String)\"4\", (String)\"5\")))).equals((new ArrayList(Arrays.asList((String)\"4\")))));\n assert(totalMatch((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\"))), (new ArrayList(Arrays.asList((String)\"hI\", (String)\"Hi\")))).equals((new ArrayList(Arrays.asList((String)\"hI\", (String)\"Hi\")))));\n assert(totalMatch((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\"))), (new ArrayList(Arrays.asList((String)\"hI\", (String)\"hi\", (String)\"hi\")))).equals((new ArrayList(Arrays.asList((String)\"hI\", (String)\"hi\", (String)\"hi\")))));\n assert(totalMatch((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\"))), (new ArrayList(Arrays.asList((String)\"hI\", (String)\"hi\", (String)\"hii\")))).equals((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\")))));\n assert(totalMatch((new ArrayList(Arrays.asList())), (new ArrayList(Arrays.asList((String)\"this\")))).equals((new ArrayList(Arrays.asList()))));\n assert(totalMatch((new ArrayList(Arrays.asList((String)\"this\"))), (new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Circular shift the digits of the integer x, shift the digits right by shift\n // and return the result as a string.\n // If shift > number of digits, return digits reversed.\n public static String circularShift(long x, long shift) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(circularShift((100l), (2l)).equals((\"001\")));\n assert(circularShift((12l), (2l)).equals((\"12\")));\n assert(circularShift((97l), (8l)).equals((\"79\")));\n assert(circularShift((12l), (1l)).equals((\"21\")));\n assert(circularShift((11l), (101l)).equals((\"11\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return True is list elements are monotonically increasing or decreasing.\n public static boolean monotonic(ArrayList l) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(monotonic((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)4l, (long)10l)))) == (true));\n assert(monotonic((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)4l, (long)20l)))) == (true));\n assert(monotonic((new ArrayList(Arrays.asList((long)1l, (long)20l, (long)4l, (long)10l)))) == (false));\n assert(monotonic((new ArrayList(Arrays.asList((long)4l, (long)1l, (long)0l, (long)-10l)))) == (true));\n assert(monotonic((new ArrayList(Arrays.asList((long)4l, (long)1l, (long)1l, (long)0l)))) == (true));\n assert(monotonic((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)2l, (long)5l, (long)60l)))) == (false));\n assert(monotonic((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)60l)))) == (true));\n assert(monotonic((new ArrayList(Arrays.asList((long)9l, (long)9l, (long)9l, (long)9l)))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n // Example\n public static boolean isEqualToSumEven(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(isEqualToSumEven((4l)) == (false));\n assert(isEqualToSumEven((6l)) == (false));\n assert(isEqualToSumEven((8l)) == (true));\n assert(isEqualToSumEven((10l)) == (true));\n assert(isEqualToSumEven((11l)) == (false));\n assert(isEqualToSumEven((12l)) == (true));\n assert(isEqualToSumEven((13l)) == (false));\n assert(isEqualToSumEven((16l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Input to this function is a string representing musical notes in a special ASCII format.\n // Your task is to parse this string and return list of integers corresponding to how many beats does each\n // not last.\n // Here is a legend:\n // 'o' - whole note, lasts four beats\n // 'o|' - half note, lasts two beats\n // '.|' - quater note, lasts one beat\n public static ArrayList parseMusic(String music_string) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(parseMusic((\"\")).equals((new ArrayList(Arrays.asList()))));\n assert(parseMusic((\"o o o o\")).equals((new ArrayList(Arrays.asList((long)4l, (long)4l, (long)4l, (long)4l)))));\n assert(parseMusic((\".| .| .| .|\")).equals((new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l)))));\n assert(parseMusic((\"o| o| .| .| o o o o\")).equals((new ArrayList(Arrays.asList((long)2l, (long)2l, (long)1l, (long)1l, (long)4l, (long)4l, (long)4l, (long)4l)))));\n assert(parseMusic((\"o| .| o| .| o o| o o|\")).equals((new ArrayList(Arrays.asList((long)2l, (long)1l, (long)2l, (long)1l, (long)4l, (long)2l, (long)4l, (long)2l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // \"\n // This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n // multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n // change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n // Examples:\n public static long sumSquares(ArrayList lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sumSquares((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)))) == (6l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)9l)))) == (14l));\n assert(sumSquares((new ArrayList(Arrays.asList()))) == (0l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l, (long)1l, (long)1l, (long)1l, (long)1l, (long)1l)))) == (9l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)-1l, (long)-1l, (long)-1l, (long)-1l, (long)-1l, (long)-1l, (long)-1l, (long)-1l, (long)-1l)))) == (-3l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)0l)))) == (0l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)-1l, (long)-5l, (long)2l, (long)-1l, (long)-5l)))) == (-126l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)-56l, (long)-99l, (long)1l, (long)0l, (long)-2l)))) == (3030l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)-1l, (long)0l, (long)0l, (long)0l, (long)0l, (long)0l, (long)0l, (long)0l, (long)-1l)))) == (0l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)-16l, (long)-9l, (long)-2l, (long)36l, (long)36l, (long)26l, (long)-20l, (long)25l, (long)-40l, (long)20l, (long)-4l, (long)12l, (long)-26l, (long)35l, (long)37l)))) == (-14196l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)-1l, (long)-3l, (long)17l, (long)-1l, (long)-15l, (long)13l, (long)-1l, (long)14l, (long)-14l, (long)-12l, (long)-5l, (long)14l, (long)-14l, (long)6l, (long)13l, (long)11l, (long)16l, (long)16l, (long)4l, (long)10l)))) == (-1448l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // triples_sum_to_zero takes a list of integers as an input.\n // it returns True if there are three distinct elements in the list that\n // sum to zero, and False otherwise.\n public static boolean triplesSumToZero(ArrayList l) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)5l, (long)0l)))) == (false));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)5l, (long)-1l)))) == (false));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)-2l, (long)1l)))) == (true));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)7l)))) == (false));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)5l, (long)7l)))) == (false));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)-5l, (long)3l, (long)9l, (long)7l)))) == (true));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)1l)))) == (false));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)5l, (long)-100l)))) == (false));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)100l, (long)3l, (long)5l, (long)-100l)))) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // brackets is a string of \"<\" and \">\".\n // return True if every opening bracket has a corresponding closing bracket.\n public static boolean correctBracketing(String brackets) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(correctBracketing((\"<>\")) == (true));\n assert(correctBracketing((\"<<><>>\")) == (true));\n assert(correctBracketing((\"<><><<><>><>\")) == (true));\n assert(correctBracketing((\"<><><<<><><>><>><<><><<>>>\")) == (true));\n assert(correctBracketing((\"<<<><>>>>\")) == (false));\n assert(correctBracketing((\"><<>\")) == (false));\n assert(correctBracketing((\"<\")) == (false));\n assert(correctBracketing((\"<<<<\")) == (false));\n assert(correctBracketing((\">\")) == (false));\n assert(correctBracketing((\"<<>\")) == (false));\n assert(correctBracketing((\"<><><<><>><>><<>\")) == (false));\n assert(correctBracketing((\"<><><<><>><>>><>\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that takes an array of numbers as input and returns \n // the number of elements in the array that are greater than 10 and both \n // first and last digits of a number are odd (1, 3, 5, 7, 9).\n // For example:\n public static long specialFilter(ArrayList nums) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(specialFilter((new ArrayList(Arrays.asList((long)5l, (long)-2l, (long)1l, (long)-5l)))) == (0l));\n assert(specialFilter((new ArrayList(Arrays.asList((long)15l, (long)-73l, (long)14l, (long)-15l)))) == (1l));\n assert(specialFilter((new ArrayList(Arrays.asList((long)33l, (long)-2l, (long)-3l, (long)45l, (long)21l, (long)109l)))) == (2l));\n assert(specialFilter((new ArrayList(Arrays.asList((long)43l, (long)-12l, (long)93l, (long)125l, (long)121l, (long)109l)))) == (4l));\n assert(specialFilter((new ArrayList(Arrays.asList((long)71l, (long)-2l, (long)-33l, (long)75l, (long)21l, (long)19l)))) == (3l));\n assert(specialFilter((new ArrayList(Arrays.asList((long)1l)))) == (0l));\n assert(specialFilter((new ArrayList(Arrays.asList()))) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a dictionary, return True if all keys are strings in lower \n // case or all keys are strings in upper case, else return False.\n // The function should return False is the given dictionary is empty.\n // Examples:\n public static boolean checkDictCase(HashMap dict) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(checkDictCase((new HashMap(Map.of(\"p\", \"pineapple\", \"b\", \"banana\")))) == (true));\n assert(checkDictCase((new HashMap(Map.of(\"p\", \"pineapple\", \"A\", \"banana\", \"B\", \"banana\")))) == (false));\n assert(checkDictCase((new HashMap(Map.of(\"p\", \"pineapple\", \"5\", \"banana\", \"a\", \"apple\")))) == (false));\n assert(checkDictCase((new HashMap(Map.of(\"Name\", \"John\", \"Age\", \"36\", \"City\", \"Houston\")))) == (false));\n assert(checkDictCase((new HashMap(Map.of(\"STATE\", \"NC\", \"ZIP\", \"12345\")))) == (true));\n assert(checkDictCase((new HashMap(Map.of(\"fruit\", \"Orange\", \"taste\", \"Sweet\")))) == (true));\n assert(checkDictCase((new HashMap())) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n // fibfib(0) == 0\n // fibfib(1) == 0\n // fibfib(2) == 1\n // fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n // Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n public static long fibfib(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(fibfib((2l)) == (1l));\n assert(fibfib((1l)) == (0l));\n assert(fibfib((5l)) == (4l));\n assert(fibfib((8l)) == (24l));\n assert(fibfib((10l)) == (81l));\n assert(fibfib((12l)) == (274l));\n assert(fibfib((14l)) == (927l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a list of numbers.\n // You need to return the sum of squared numbers in the given list,\n // round each element in the list to the upper int(Ceiling) first.\n // Examples:\n public static long sumSquares(ArrayList lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sumSquares((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f)))) == (14l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f)))) == (14l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)1.0f, (float)3.0f, (float)5.0f, (float)7.0f)))) == (84l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)1.4f, (float)4.2f, (float)0.0f)))) == (29l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)-2.4f, (float)1.0f, (float)1.0f)))) == (6l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)100.0f, (float)1.0f, (float)15.0f, (float)2.0f)))) == (10230l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)10000.0f, (float)10000.0f)))) == (200000000l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)-1.4f, (float)4.6f, (float)6.3f)))) == (75l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)-1.4f, (float)17.9f, (float)18.9f, (float)19.9f)))) == (1086l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)0.0f)))) == (0l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)-1.0f)))) == (1l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)-1.0f, (float)1.0f, (float)0.0f)))) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_85_add", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a non-empty list of integers lst. add the even elements that are at odd indices..\n // Examples:\n public static long add(ArrayList lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(add((new ArrayList(Arrays.asList((long)4l, (long)88l)))) == (88l));\n assert(add((new ArrayList(Arrays.asList((long)4l, (long)5l, (long)6l, (long)7l, (long)2l, (long)122l)))) == (122l));\n assert(add((new ArrayList(Arrays.asList((long)4l, (long)0l, (long)6l, (long)7l)))) == (0l));\n assert(add((new ArrayList(Arrays.asList((long)4l, (long)4l, (long)6l, (long)8l)))) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return sorted unique elements in a list\n public static ArrayList unique(ArrayList l) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(unique((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)5l, (long)2l, (long)3l, (long)3l, (long)9l, (long)0l, (long)123l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)2l, (long)3l, (long)5l, (long)9l, (long)123l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a string text, replace all spaces in it with underscores, \n // and if a string has more than 2 consecutive spaces, \n // then replace all consecutive spaces with -\n public static String fixSpaces(String text) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(fixSpaces((\"Example\")).equals((\"Example\")));\n assert(fixSpaces((\"Mudasir Hanif \")).equals((\"Mudasir_Hanif_\")));\n assert(fixSpaces((\"Yellow Yellow Dirty Fellow\")).equals((\"Yellow_Yellow__Dirty__Fellow\")));\n assert(fixSpaces((\"Exa mple\")).equals((\"Exa-mple\")));\n assert(fixSpaces((\" Exa 1 2 2 mple\")).equals((\"-Exa_1_2_2_mple\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return 2^n modulo p (be aware of numerics).\n public static long modp(long n, long p) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(modp((3l), (5l)) == (3l));\n assert(modp((1101l), (101l)) == (2l));\n assert(modp((0l), (101l)) == (1l));\n assert(modp((3l), (11l)) == (8l));\n assert(modp((100l), (101l)) == (1l));\n assert(modp((30l), (5l)) == (4l));\n assert(modp((31l), (5l)) == (3l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You have to write a function which validates a given date string and\n // returns True if the date is valid otherwise False.\n // The date is valid if all of the following rules are satisfied:\n // 1. The date string is not empty.\n // 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n // 3. The months should not be less than 1 or higher than 12.\n // 4. The date should be in the format: mm-dd-yyyy\n public static boolean validDate(String date) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(validDate((\"03-11-2000\")) == (true));\n assert(validDate((\"15-01-2012\")) == (false));\n assert(validDate((\"04-0-2040\")) == (false));\n assert(validDate((\"06-04-2020\")) == (true));\n assert(validDate((\"01-01-2007\")) == (true));\n assert(validDate((\"03-32-2011\")) == (false));\n assert(validDate((\"\")) == (false));\n assert(validDate((\"04-31-3000\")) == (false));\n assert(validDate((\"06-06-2005\")) == (true));\n assert(validDate((\"21-31-2000\")) == (false));\n assert(validDate((\"04-12-2003\")) == (true));\n assert(validDate((\"04122003\")) == (false));\n assert(validDate((\"20030412\")) == (false));\n assert(validDate((\"2003-04\")) == (false));\n assert(validDate((\"2003-04-12\")) == (false));\n assert(validDate((\"04-2003\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that takes a string and returns an ordered version of it.\n // Ordered version of string, is a string where all words (separated by space)\n // are replaced by a new word where all the characters arranged in\n // ascending order based on ascii value.\n // Note: You should keep the order of words and blank spaces in the sentence.\n // For example:\n public static String antiShuffle(String s) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(antiShuffle((\"Hi\")).equals((\"Hi\")));\n assert(antiShuffle((\"hello\")).equals((\"ehllo\")));\n assert(antiShuffle((\"number\")).equals((\"bemnru\")));\n assert(antiShuffle((\"abcd\")).equals((\"abcd\")));\n assert(antiShuffle((\"Hello World!!!\")).equals((\"Hello !!!Wdlor\")));\n assert(antiShuffle((\"\")).equals((\"\")));\n assert(antiShuffle((\"Hi. My name is Mister Robot. How are you?\")).equals((\".Hi My aemn is Meirst .Rboot How aer ?ouy\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a list of numbers, return whether or not they are sorted\n // in ascending order. If list has more than 1 duplicate of the same\n // number, return False. Assume no negative numbers and only integers.\n // Examples\n public static boolean isSorted(ArrayList lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(isSorted((new ArrayList(Arrays.asList((long)5l)))) == (true));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l)))) == (true));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)4l, (long)5l)))) == (false));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)))) == (true));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l, (long)7l)))) == (true));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)4l, (long)5l, (long)6l, (long)7l)))) == (false));\n assert(isSorted((new ArrayList(Arrays.asList()))) == (true));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l)))) == (true));\n assert(isSorted((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)1l)))) == (false));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)2l, (long)2l, (long)3l, (long)4l)))) == (false));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)3l, (long)3l, (long)4l)))) == (false));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)2l, (long)3l, (long)3l, (long)4l)))) == (true));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a string s.\n // Your task is to check if the string is happy or not.\n // A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n // For example:\n public static boolean isHappy(String s) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(isHappy((\"a\")) == (false));\n assert(isHappy((\"aa\")) == (false));\n assert(isHappy((\"abcd\")) == (true));\n assert(isHappy((\"aabb\")) == (false));\n assert(isHappy((\"adb\")) == (true));\n assert(isHappy((\"xyy\")) == (false));\n assert(isHappy((\"iopaxpoi\")) == (true));\n assert(isHappy((\"iopaxioi\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that returns True if the object q will fly, and False otherwise.\n // The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n // Example:\n // # 1+2 is less than the maximum possible weight, but it's unbalanced.\n // # it's balanced, but 3+2+3 is more than the maximum possible weight.\n // # 3+2+3 is less than the maximum possible weight, and it's balanced.\n // # 3 is less than the maximum possible weight, and it's balanced.\n public static boolean willItFly(ArrayList q, long w) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(willItFly((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)3l))), (9l)) == (true));\n assert(willItFly((new ArrayList(Arrays.asList((long)1l, (long)2l))), (5l)) == (false));\n assert(willItFly((new ArrayList(Arrays.asList((long)3l))), (5l)) == (true));\n assert(willItFly((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)3l))), (1l)) == (false));\n assert(willItFly((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))), (6l)) == (false));\n assert(willItFly((new ArrayList(Arrays.asList((long)5l))), (5l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given an array of non-negative integers, return a copy of the given array after sorting,\n // you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n // or sort it in descending order if the sum( first index value, last index value) is even.\n // Note:\n // * don't change the given array.\n // Examples:\n public static ArrayList sortArray(ArrayList array) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sortArray((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(sortArray((new ArrayList(Arrays.asList((long)5l)))).equals((new ArrayList(Arrays.asList((long)5l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)3l, (long)0l, (long)1l, (long)5l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)1l, (long)2l, (long)3l, (long)4l, (long)5l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)3l, (long)0l, (long)1l, (long)5l, (long)6l)))).equals((new ArrayList(Arrays.asList((long)6l, (long)5l, (long)4l, (long)3l, (long)2l, (long)1l, (long)0l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)2l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)2l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)15l, (long)42l, (long)87l, (long)32l, (long)11l, (long)0l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)11l, (long)15l, (long)32l, (long)42l, (long)87l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)21l, (long)14l, (long)23l, (long)11l)))).equals((new ArrayList(Arrays.asList((long)23l, (long)21l, (long)14l, (long)11l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Implement a function that takes an non-negative integer and returns an array of the first n\n // integers that are prime numbers and less than n.\n // for example:\n public static ArrayList countUpTo(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(countUpTo((5l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l)))));\n assert(countUpTo((6l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l)))));\n assert(countUpTo((7l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l)))));\n assert(countUpTo((10l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l, (long)7l)))));\n assert(countUpTo((0l)).equals((new ArrayList(Arrays.asList()))));\n assert(countUpTo((22l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l, (long)7l, (long)11l, (long)13l, (long)17l, (long)19l)))));\n assert(countUpTo((1l)).equals((new ArrayList(Arrays.asList()))));\n assert(countUpTo((18l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l, (long)7l, (long)11l, (long)13l, (long)17l)))));\n assert(countUpTo((47l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l, (long)7l, (long)11l, (long)13l, (long)17l, (long)19l, (long)23l, (long)29l, (long)31l, (long)37l, (long)41l, (long)43l)))));\n assert(countUpTo((101l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l, (long)7l, (long)11l, (long)13l, (long)17l, (long)19l, (long)23l, (long)29l, (long)31l, (long)37l, (long)41l, (long)43l, (long)47l, (long)53l, (long)59l, (long)61l, (long)67l, (long)71l, (long)73l, (long)79l, (long)83l, (long)89l, (long)97l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Out of list of strings, return the longest one. Return the first one in case of multiple\n // strings of the same length. Return None in case the input list is empty.\n public static Optional longest(ArrayList strings) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(longest((new ArrayList(Arrays.asList()))).equals(Optional.empty()));\n assert(longest((new ArrayList(Arrays.asList((String)\"x\", (String)\"y\", (String)\"z\")))).equals(\"x\"));\n assert(longest((new ArrayList(Arrays.asList((String)\"x\", (String)\"yyy\", (String)\"zzzz\", (String)\"www\", (String)\"kkkk\", (String)\"abc\")))).equals(\"zzzz\"));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n // reverse the resulting array, and then replace each digit by its corresponding name from\n // \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n // For example:\n // If the array is empty, return an empty array:\n // If the array has any strange number ignore it:\n public static ArrayList byLength(ArrayList arr) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(byLength((new ArrayList(Arrays.asList((long)2l, (long)1l, (long)1l, (long)4l, (long)5l, (long)8l, (long)2l, (long)3l)))).equals((new ArrayList(Arrays.asList((String)\"Eight\", (String)\"Five\", (String)\"Four\", (String)\"Three\", (String)\"Two\", (String)\"Two\", (String)\"One\", (String)\"One\")))));\n assert(byLength((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(byLength((new ArrayList(Arrays.asList((long)1l, (long)-1l, (long)55l)))).equals((new ArrayList(Arrays.asList((String)\"One\")))));\n assert(byLength((new ArrayList(Arrays.asList((long)1l, (long)-1l, (long)3l, (long)2l)))).equals((new ArrayList(Arrays.asList((String)\"Three\", (String)\"Two\", (String)\"One\")))));\n assert(byLength((new ArrayList(Arrays.asList((long)9l, (long)4l, (long)8l)))).equals((new ArrayList(Arrays.asList((String)\"Nine\", (String)\"Eight\", (String)\"Four\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_106_f", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Implement the function f that takes n as a parameter,\n // 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\n // or the sum of numbers from 1 to i otherwise.\n // i starts from 1.\n // the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n // Example:\n public static ArrayList f(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(f((5l)).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)6l, (long)24l, (long)15l)))));\n assert(f((7l)).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)6l, (long)24l, (long)15l, (long)720l, (long)28l)))));\n assert(f((1l)).equals((new ArrayList(Arrays.asList((long)1l)))));\n assert(f((3l)).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)6l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n public static long fizzBuzz(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(fizzBuzz((50l)) == (0l));\n assert(fizzBuzz((78l)) == (2l));\n assert(fizzBuzz((79l)) == (3l));\n assert(fizzBuzz((100l)) == (3l));\n assert(fizzBuzz((200l)) == (6l));\n assert(fizzBuzz((4000l)) == (192l));\n assert(fizzBuzz((10000l)) == (639l));\n assert(fizzBuzz((100000l)) == (8026l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a positive floating point number, it can be decomposed into\n // and integer part (largest integer smaller than given number) and decimals\n // (leftover part always smaller than 1).\n // Return the decimal part of the number.\n public static float truncateNumber(float number) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(truncateNumber((3.5f)) == (0.5f));\n assert(truncateNumber((1.25f)) == (0.25f));\n assert(truncateNumber((123.0f)) == (0.0f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n // Empty sum should be equal to 0 and empty product should be equal to 1.\n public static Pair sumProduct(ArrayList numbers) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sumProduct((new ArrayList(Arrays.asList()))).equals((Pair.with(0l, 1l))));\n assert(sumProduct((new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l)))).equals((Pair.with(3l, 1l))));\n assert(sumProduct((new ArrayList(Arrays.asList((long)100l, (long)0l)))).equals((Pair.with(100l, 0l))));\n assert(sumProduct((new ArrayList(Arrays.asList((long)3l, (long)5l, (long)7l)))).equals((Pair.with(15l, 105l))));\n assert(sumProduct((new ArrayList(Arrays.asList((long)10l)))).equals((Pair.with(10l, 10l))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a 2 dimensional data, as a nested lists,\n // which is similar to matrix, however, unlike matrices,\n // each row may contain a different number of columns.\n // Given lst, and integer x, find integers x in the list,\n // and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n // each tuple is a coordinate - (row, columns), starting with 0.\n // Sort coordinates initially by rows in ascending order.\n // Also, sort coordinates of the row by columns in descending order.\n // Examples:\n public static ArrayList> getRow(ArrayList> lst, long x) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(getRow((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)1l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)1l))))), (1l)).equals((new ArrayList>(Arrays.asList((Pair)Pair.with(0l, 0l), (Pair)Pair.with(1l, 4l), (Pair)Pair.with(1l, 0l), (Pair)Pair.with(2l, 5l), (Pair)Pair.with(2l, 0l))))));\n assert(getRow((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l))))), (2l)).equals((new ArrayList>(Arrays.asList((Pair)Pair.with(0l, 1l), (Pair)Pair.with(1l, 1l), (Pair)Pair.with(2l, 1l), (Pair)Pair.with(3l, 1l), (Pair)Pair.with(4l, 1l), (Pair)Pair.with(5l, 1l))))));\n assert(getRow((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)1l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)1l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)1l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)1l))))), (1l)).equals((new ArrayList>(Arrays.asList((Pair)Pair.with(0l, 0l), (Pair)Pair.with(1l, 0l), (Pair)Pair.with(2l, 1l), (Pair)Pair.with(2l, 0l), (Pair)Pair.with(3l, 2l), (Pair)Pair.with(3l, 0l), (Pair)Pair.with(4l, 3l), (Pair)Pair.with(4l, 0l), (Pair)Pair.with(5l, 4l), (Pair)Pair.with(5l, 0l), (Pair)Pair.with(6l, 5l), (Pair)Pair.with(6l, 0l))))));\n assert(getRow((new ArrayList>(Arrays.asList())), (1l)).equals((new ArrayList>(Arrays.asList()))));\n assert(getRow((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l))))), (2l)).equals((new ArrayList>(Arrays.asList()))));\n assert(getRow((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList()), (ArrayList)new ArrayList(Arrays.asList((long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))))), (3l)).equals((new ArrayList>(Arrays.asList((Pair)Pair.with(2l, 2l))))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You're a hungry rabbit, and you already have eaten a certain number of carrots,\n // but now you need to eat more carrots to complete the day's meals.\n // you should return an array of [ total number of eaten carrots after your meals,\n // the number of carrots left after your meals ]\n // if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n // Example:\n // Variables:\n // @number : integer\n // the number of carrots that you have eaten.\n // @need : integer\n // the number of carrots that you need to eat.\n // @remaining : integer\n // the number of remaining carrots thet exist in stock\n // Constrain:\n // * 0 <= number <= 1000\n // * 0 <= need <= 1000\n // * 0 <= remaining <= 1000\n // Have fun :)\n public static ArrayList eat(long number, long need, long remaining) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(eat((5l), (6l), (10l)).equals((new ArrayList(Arrays.asList((long)11l, (long)4l)))));\n assert(eat((4l), (8l), (9l)).equals((new ArrayList(Arrays.asList((long)12l, (long)1l)))));\n assert(eat((1l), (10l), (10l)).equals((new ArrayList(Arrays.asList((long)11l, (long)0l)))));\n assert(eat((2l), (11l), (5l)).equals((new ArrayList(Arrays.asList((long)7l, (long)0l)))));\n assert(eat((4l), (5l), (7l)).equals((new ArrayList(Arrays.asList((long)9l, (long)2l)))));\n assert(eat((4l), (5l), (1l)).equals((new ArrayList(Arrays.asList((long)5l, (long)0l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a positive integer N, return the total sum of its digits in binary.\n // Example\n // Variables:\n // @N integer\n // Constraints: 0 \u2264 N \u2264 10000.\n // Output:\n // a string of binary number\n public static String solve(long N) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(solve((1000l)).equals((\"1\")));\n assert(solve((150l)).equals((\"110\")));\n assert(solve((147l)).equals((\"1100\")));\n assert(solve((333l)).equals((\"1001\")));\n assert(solve((963l)).equals((\"10010\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a list of integers.\n // You need to find the largest prime value and return the sum of its digits.\n // Examples:\n public static long skjkasdkd(ArrayList lst) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(skjkasdkd((new ArrayList(Arrays.asList((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, (long)3l)))) == (10l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)1l, (long)0l, (long)1l, (long)8l, (long)2l, (long)4597l, (long)2l, (long)1l, (long)3l, (long)40l, (long)1l, (long)2l, (long)1l, (long)2l, (long)4l, (long)2l, (long)5l, (long)1l)))) == (25l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)1l, (long)32l, (long)5107l, (long)34l, (long)83278l, (long)109l, (long)163l, (long)23l, (long)2323l, (long)32l, (long)30l, (long)1l, (long)9l, (long)3l)))) == (13l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)0l, (long)724l, (long)32l, (long)71l, (long)99l, (long)32l, (long)6l, (long)0l, (long)5l, (long)91l, (long)83l, (long)0l, (long)5l, (long)6l)))) == (11l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)0l, (long)81l, (long)12l, (long)3l, (long)1l, (long)21l)))) == (3l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)0l, (long)8l, (long)1l, (long)2l, (long)1l, (long)7l)))) == (7l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)8191l)))) == (19l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)8191l, (long)123456l, (long)127l, (long)7l)))) == (19l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)127l, (long)97l, (long)8192l)))) == (10l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given an array arr of integers, find the minimum number of elements that\n // need to be changed to make the array palindromic. A palindromic array is an array that\n // is read the same backwards and forwards. In one change, you can change one element to any other element.\n // For example:\n public static long smallestChange(ArrayList arr) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(smallestChange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)5l, (long)4l, (long)7l, (long)9l, (long)6l)))) == (4l));\n assert(smallestChange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)3l, (long)2l, (long)2l)))) == (1l));\n assert(smallestChange((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)2l)))) == (1l));\n assert(smallestChange((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)4l, (long)2l)))) == (1l));\n assert(smallestChange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)2l, (long)1l)))) == (0l));\n assert(smallestChange((new ArrayList(Arrays.asList((long)3l, (long)1l, (long)1l, (long)3l)))) == (0l));\n assert(smallestChange((new ArrayList(Arrays.asList((long)1l)))) == (0l));\n assert(smallestChange((new ArrayList(Arrays.asList((long)0l, (long)1l)))) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // It is the last week of the semester and the teacher has to give the grades\n // to students. The teacher has been making her own algorithm for grading.\n // The only problem is, she has lost the code she used for grading.\n // She has given you a list of GPAs for some students and you have to write \n // a function that can output a list of letter grades using the following table:\n // GPA | Letter grade\n // 4.0 A+\n // > 3.7 A \n // > 3.3 A- \n // > 3.0 B+\n // > 2.7 B \n // > 2.3 B-\n // > 2.0 C+\n // > 1.7 C\n // > 1.3 C-\n // > 1.0 D+ \n // > 0.7 D \n // > 0.0 D-\n // 0.0 E\n // Example:\n public static ArrayList numericalLetterGrade(ArrayList grades) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(numericalLetterGrade((new ArrayList(Arrays.asList((float)4.0f, (float)3l, (float)1.7f, (float)2l, (float)3.5f)))).equals((new ArrayList(Arrays.asList((String)\"A+\", (String)\"B\", (String)\"C-\", (String)\"C\", (String)\"A-\")))));\n assert(numericalLetterGrade((new ArrayList(Arrays.asList((float)1.2f)))).equals((new ArrayList(Arrays.asList((String)\"D+\")))));\n assert(numericalLetterGrade((new ArrayList(Arrays.asList((float)0.5f)))).equals((new ArrayList(Arrays.asList((String)\"D-\")))));\n assert(numericalLetterGrade((new ArrayList(Arrays.asList((float)0.0f)))).equals((new ArrayList(Arrays.asList((String)\"E\")))));\n assert(numericalLetterGrade((new ArrayList(Arrays.asList((float)1.0f, (float)0.3f, (float)1.5f, (float)2.8f, (float)3.3f)))).equals((new ArrayList(Arrays.asList((String)\"D\", (String)\"D-\", (String)\"C-\", (String)\"B\", (String)\"B+\")))));\n assert(numericalLetterGrade((new ArrayList(Arrays.asList((float)0.0f, (float)0.7f)))).equals((new ArrayList(Arrays.asList((String)\"E\", (String)\"D-\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given the lengths of the three sides of a triangle. Return the area of\n // the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n // Otherwise return -1\n // Three sides make a valid triangle when the sum of any two sides is greater \n // than the third side.\n // Example:\n public static float triangleArea(long a, long b, long c) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(triangleArea((3l), (4l), (5l)) == (6.0f));\n assert(triangleArea((1l), (2l), (10l)) == (float)-1l);\n assert(triangleArea((4l), (8l), (5l)) == (8.18f));\n assert(triangleArea((2l), (2l), (2l)) == (1.73f));\n assert(triangleArea((1l), (2l), (3l)) == (float)-1l);\n assert(triangleArea((10l), (5l), (7l)) == (16.25f));\n assert(triangleArea((2l), (6l), (3l)) == (float)-1l);\n assert(triangleArea((1l), (1l), (1l)) == (0.43f));\n assert(triangleArea((2l), (2l), (10l)) == (float)-1l);\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Check if two words have the same characters.\n public static boolean sameChars(String s0, String s1) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddeddabc\")) == (true));\n assert(sameChars((\"abcd\"), (\"dddddddabc\")) == (true));\n assert(sameChars((\"dddddddabc\"), (\"abcd\")) == (true));\n assert(sameChars((\"eabcd\"), (\"dddddddabc\")) == (false));\n assert(sameChars((\"abcd\"), (\"dddddddabcf\")) == (false));\n assert(sameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddddabc\")) == (false));\n assert(sameChars((\"aabb\"), (\"aaccc\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given an array of integers nums, find the minimum sum of any non-empty sub-array\n // of nums.\n // Example\n public static long minSubArraySum(ArrayList nums) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)4l, (long)1l, (long)2l, (long)4l)))) == (1l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)-1l, (long)-2l, (long)-3l)))) == (-6l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)-1l, (long)-2l, (long)-3l, (long)2l, (long)-10l)))) == (-14l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)-9999999999999999l)))) == (-9999999999999999l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)0l, (long)10l, (long)20l, (long)1000000l)))) == (0l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)-1l, (long)-2l, (long)-3l, (long)10l, (long)-5l)))) == (-6l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)100l, (long)-1l, (long)-2l, (long)-3l, (long)10l, (long)-5l)))) == (-6l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)10l, (long)11l, (long)13l, (long)8l, (long)3l, (long)4l)))) == (3l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)100l, (long)-33l, (long)32l, (long)-1l, (long)0l, (long)-2l)))) == (-33l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)-10l)))) == (-10l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)7l)))) == (7l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)1l, (long)-1l)))) == (-1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a string s and a natural number n, you have been tasked to implement \n // a function that returns a list of all words from string s that contain exactly \n // n consonants, in order these words appear in the string s.\n // If the string s is empty then the function should return an empty list.\n // Note: you may assume the input string contains only letters and spaces.\n // Examples:\n public static ArrayList selectWords(String s, long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(selectWords((\"Mary had a little lamb\"), (4l)).equals((new ArrayList(Arrays.asList((String)\"little\")))));\n assert(selectWords((\"Mary had a little lamb\"), (3l)).equals((new ArrayList(Arrays.asList((String)\"Mary\", (String)\"lamb\")))));\n assert(selectWords((\"simple white space\"), (2l)).equals((new ArrayList(Arrays.asList()))));\n assert(selectWords((\"Hello world\"), (4l)).equals((new ArrayList(Arrays.asList((String)\"world\")))));\n assert(selectWords((\"Uncle sam\"), (3l)).equals((new ArrayList(Arrays.asList((String)\"Uncle\")))));\n assert(selectWords((\"\"), (4l)).equals((new ArrayList(Arrays.asList()))));\n assert(selectWords((\"a b c d e f\"), (1l)).equals((new ArrayList(Arrays.asList((String)\"b\", (String)\"c\", (String)\"d\", (String)\"f\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return list of all prefixes from shortest to longest of the input string\n public static ArrayList allPrefixes(String string) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(allPrefixes((\"\")).equals((new ArrayList(Arrays.asList()))));\n assert(allPrefixes((\"asdfgh\")).equals((new ArrayList(Arrays.asList((String)\"a\", (String)\"as\", (String)\"asd\", (String)\"asdf\", (String)\"asdfg\", (String)\"asdfgh\")))));\n assert(allPrefixes((\"WWW\")).equals((new ArrayList(Arrays.asList((String)\"W\", (String)\"WW\", (String)\"WWW\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function that takes a value (string) representing a number\n // and returns the closest integer to it. If the number is equidistant\n // from two integers, round it away from zero.\n // Examples\n // Note:\n // Rounding away from zero means that if the given number is equidistant\n // from two integers, the one you should return is the one that is the\n // farthest from zero. For example closest_integer(\"14.5\") should\n // return 15 and closest_integer(\"-14.5\") should return -15.\n public static long closestInteger(String value) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(closestInteger((\"10\")) == (10l));\n assert(closestInteger((\"14.5\")) == (15l));\n assert(closestInteger((\"-15.5\")) == (-16l));\n assert(closestInteger((\"15.3\")) == (15l));\n assert(closestInteger((\"0\")) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function which takes a string representing a file's name, and returns\n // 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n // A file's name is considered to be valid if and only if all the following conditions \n // are met:\n // - There should not be more than three digits ('0'-'9') in the file's name.\n // - The file's name contains exactly one dot '.'\n // - The substring before the dot should not be empty, and it starts with a letter from \n // the latin alphapet ('a'-'z' and 'A'-'Z').\n // - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n // Examples:\n public static String fileNameCheck(String file_name) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(fileNameCheck((\"example.txt\")).equals((\"Yes\")));\n assert(fileNameCheck((\"1example.dll\")).equals((\"No\")));\n assert(fileNameCheck((\"s1sdf3.asd\")).equals((\"No\")));\n assert(fileNameCheck((\"K.dll\")).equals((\"Yes\")));\n assert(fileNameCheck((\"MY16FILE3.exe\")).equals((\"Yes\")));\n assert(fileNameCheck((\"His12FILE94.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"_Y.txt\")).equals((\"No\")));\n assert(fileNameCheck((\"?aREYA.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"/this_is_valid.dll\")).equals((\"No\")));\n assert(fileNameCheck((\"this_is_valid.wow\")).equals((\"No\")));\n assert(fileNameCheck((\"this_is_valid.txt\")).equals((\"Yes\")));\n assert(fileNameCheck((\"this_is_valid.txtexe\")).equals((\"No\")));\n assert(fileNameCheck((\"#this2_i4s_5valid.ten\")).equals((\"No\")));\n assert(fileNameCheck((\"@this1_is6_valid.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"this_is_12valid.6exe4.txt\")).equals((\"No\")));\n assert(fileNameCheck((\"all.exe.txt\")).equals((\"No\")));\n assert(fileNameCheck((\"I563_No.exe\")).equals((\"Yes\")));\n assert(fileNameCheck((\"Is3youfault.txt\")).equals((\"Yes\")));\n assert(fileNameCheck((\"no_one#knows.dll\")).equals((\"Yes\")));\n assert(fileNameCheck((\"1I563_Yes3.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"I563_Yes3.txtt\")).equals((\"No\")));\n assert(fileNameCheck((\"final..txt\")).equals((\"No\")));\n assert(fileNameCheck((\"final132\")).equals((\"No\")));\n assert(fileNameCheck((\"_f4indsartal132.\")).equals((\"No\")));\n assert(fileNameCheck((\".txt\")).equals((\"No\")));\n assert(fileNameCheck((\"s.\")).equals((\"No\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given two intervals,\n // where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n // The given intervals are closed which means that the interval (start, end)\n // includes both start and end.\n // For each given interval, it is assumed that its start is less or equal its end.\n // Your task is to determine whether the length of intersection of these two \n // intervals is a prime number.\n // Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n // which its length is 1, which not a prime number.\n // If the length of the intersection is a prime number, return \"YES\",\n // otherwise, return \"NO\".\n // If the two intervals don't intersect, return \"NO\".\n // [input/output] samples:\n public static String intersection(Pair interval1, Pair interval2) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(intersection((Pair.with(1l, 2l)), (Pair.with(2l, 3l))).equals((\"NO\")));\n assert(intersection((Pair.with(-1l, 1l)), (Pair.with(0l, 4l))).equals((\"NO\")));\n assert(intersection((Pair.with(-3l, -1l)), (Pair.with(-5l, 5l))).equals((\"YES\")));\n assert(intersection((Pair.with(-2l, 2l)), (Pair.with(-4l, 0l))).equals((\"YES\")));\n assert(intersection((Pair.with(-11l, 2l)), (Pair.with(-1l, -1l))).equals((\"NO\")));\n assert(intersection((Pair.with(1l, 2l)), (Pair.with(3l, 5l))).equals((\"NO\")));\n assert(intersection((Pair.with(1l, 2l)), (Pair.with(1l, 2l))).equals((\"NO\")));\n assert(intersection((Pair.with(-2l, -2l)), (Pair.with(-3l, -2l))).equals((\"NO\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return the largest prime factor of n. Assume n > 1 and is not a prime.\n public static long largestPrimeFactor(long n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(largestPrimeFactor((15l)) == (5l));\n assert(largestPrimeFactor((27l)) == (3l));\n assert(largestPrimeFactor((63l)) == (7l));\n assert(largestPrimeFactor((330l)) == (11l));\n assert(largestPrimeFactor((13195l)) == (29l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a string, find out how many distinct characters (regardless of case) does it consist of\n public static long countDistinctCharacters(String string) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(countDistinctCharacters((\"\")) == (0l));\n assert(countDistinctCharacters((\"abcde\")) == (5l));\n assert(countDistinctCharacters((\"abcdecadeCADE\")) == (5l));\n assert(countDistinctCharacters((\"aaaaAAAAaaaa\")) == (1l));\n assert(countDistinctCharacters((\"Jerry jERRY JeRRRY\")) == (5l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You're given a list of deposit and withdrawal operations on a bank account that starts with\n // zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n // at that point function should return True. Otherwise it should return False.\n public static boolean belowZero(ArrayList operations) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(belowZero((new ArrayList(Arrays.asList()))) == (false));\n assert(belowZero((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)-3l, (long)1l, (long)2l, (long)-3l)))) == (false));\n assert(belowZero((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)-4l, (long)5l, (long)6l)))) == (true));\n assert(belowZero((new ArrayList(Arrays.asList((long)1l, (long)-1l, (long)2l, (long)-2l, (long)5l, (long)-5l, (long)4l, (long)-4l)))) == (false));\n assert(belowZero((new ArrayList(Arrays.asList((long)1l, (long)-1l, (long)2l, (long)-2l, (long)5l, (long)-5l, (long)4l, (long)-5l)))) == (true));\n assert(belowZero((new ArrayList(Arrays.asList((long)1l, (long)-2l, (long)2l, (long)-2l, (long)5l, (long)-5l, (long)4l, (long)-4l)))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Find the shortest palindrome that begins with a supplied string.\n // Algorithm idea is simple:\n // - Find the longest postfix of supplied string that is a palindrome.\n // - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n public static String makePalindrome(String string) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(makePalindrome((\"\")).equals((\"\")));\n assert(makePalindrome((\"x\")).equals((\"x\")));\n assert(makePalindrome((\"xyz\")).equals((\"xyzyx\")));\n assert(makePalindrome((\"xyx\")).equals((\"xyx\")));\n assert(makePalindrome((\"jerry\")).equals((\"jerryrrej\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a positive integer, obtain its roman numeral equivalent as a string,\n // and return it in lowercase.\n // Restrictions: 1 <= num <= 1000\n // Examples:\n public static String intToMiniRoman(long number) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(intToMiniRoman((19l)).equals((\"xix\")));\n assert(intToMiniRoman((152l)).equals((\"clii\")));\n assert(intToMiniRoman((251l)).equals((\"ccli\")));\n assert(intToMiniRoman((426l)).equals((\"cdxxvi\")));\n assert(intToMiniRoman((500l)).equals((\"d\")));\n assert(intToMiniRoman((1l)).equals((\"i\")));\n assert(intToMiniRoman((4l)).equals((\"iv\")));\n assert(intToMiniRoman((43l)).equals((\"xliii\")));\n assert(intToMiniRoman((90l)).equals((\"xc\")));\n assert(intToMiniRoman((94l)).equals((\"xciv\")));\n assert(intToMiniRoman((532l)).equals((\"dxxxii\")));\n assert(intToMiniRoman((900l)).equals((\"cm\")));\n assert(intToMiniRoman((994l)).equals((\"cmxciv\")));\n assert(intToMiniRoman((1000l)).equals((\"m\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - } -] \ No newline at end of file diff --git a/data/java-reworded.json b/data/java-reworded.json deleted file mode 100644 index b2509cf198feef212ead500ca85e83dbd143fa86..0000000000000000000000000000000000000000 --- a/data/java-reworded.json +++ /dev/null @@ -1,1898 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // For a given number n, find the largest number that divides n evenly, smaller than n\n // >>> largestDivisor((15l))\n // (5l)\n public static long largestDivisor(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(largestDivisor((3l)) == (1l));\n assert(largestDivisor((7l)) == (1l));\n assert(largestDivisor((10l)) == (5l));\n assert(largestDivisor((100l)) == (50l));\n assert(largestDivisor((49l)) == (7l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_47_median", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return median of elements in the array list l.\n // >>> median((new ArrayList(Arrays.asList((long)3l, (long)1l, (long)2l, (long)4l, (long)5l))))\n // (float)3l\n // >>> median((new ArrayList(Arrays.asList((long)-10l, (long)4l, (long)6l, (long)1000l, (long)10l, (long)20l))))\n // (15.0f)\n public static float median(ArrayList l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(median((new ArrayList(Arrays.asList((long)3l, (long)1l, (long)2l, (long)4l, (long)5l)))) == (float)3l);\n assert(median((new ArrayList(Arrays.asList((long)-10l, (long)4l, (long)6l, (long)1000l, (long)10l, (long)20l)))) == (8.0f));\n assert(median((new ArrayList(Arrays.asList((long)5l)))) == (float)5l);\n assert(median((new ArrayList(Arrays.asList((long)6l, (long)5l)))) == (5.5f));\n assert(median((new ArrayList(Arrays.asList((long)8l, (long)1l, (long)3l, (long)9l, (long)9l, (long)2l, (long)7l)))) == (float)7l);\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given two array lists operator, and operand. The first array list has basic algebra operations, and \n // the second array list is an array array list of integers. Use the two given array lists to build the algebric \n // expression and return the evaluation of this expression.\n // The basic algebra operations:\n // Addition ( + ) \n // Subtraction ( - ) \n // Multiplication ( * ) \n // Floor division ( // ) \n // Exponentiation ( ** ) \n // Example:\n // operator['+', '*', '-']\n // array array list = [2, 3, 4, 5]\n // result = 2 + 3 * 4 - 5\n // => result = 9\n // Note:\n // The length of operator array list is equal to the length of operand array list minus one.\n // Operand is an array array list of of non-negative integers.\n // Operator array list has at least one operator, and operand array list has at least two operands.\n public static long doAlgebra(ArrayList op, ArrayList operand) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(doAlgebra((new ArrayList(Arrays.asList((String)\"**\", (String)\"*\", (String)\"+\"))), (new ArrayList(Arrays.asList((long)2l, (long)3l, (long)4l, (long)5l)))) == (37l));\n assert(doAlgebra((new ArrayList(Arrays.asList((String)\"+\", (String)\"*\", (String)\"-\"))), (new ArrayList(Arrays.asList((long)2l, (long)3l, (long)4l, (long)5l)))) == (9l));\n assert(doAlgebra((new ArrayList(Arrays.asList((String)\"//\", (String)\"*\"))), (new ArrayList(Arrays.asList((long)7l, (long)3l, (long)4l)))) == (8l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return maximum element in the array list.\n // >>> maxElement((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))))\n // (3l)\n // >>> maxElement((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)-5l, (long)2l, (long)-3l, (long)3l, (long)9l, (long)0l, (long)123l, (long)1l, (long)-10l))))\n // (123l)\n public static long maxElement(ArrayList l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(maxElement((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)))) == (3l));\n assert(maxElement((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)-5l, (long)2l, (long)-3l, (long)3l, (long)9l, (long)0l, (long)124l, (long)1l, (long)-10l)))) == (124l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function which returns the largest index of an element which\n // is not greater than or equal to the element immediately preceding it. If\n // no such element exists then return -1. The given array array list will not contain\n // duplicate values.\n // Examples:\n // >>> canArrange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)4l, (long)3l, (long)5l))))\n // (3l)\n // >>> canArrange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))))\n // (-1l)\n public static long canArrange(ArrayList arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(canArrange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)4l, (long)3l, (long)5l)))) == (3l));\n assert(canArrange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)4l, (long)5l)))) == (-1l));\n assert(canArrange((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)2l, (long)5l, (long)6l, (long)7l, (long)8l, (long)9l, (long)10l)))) == (2l));\n assert(canArrange((new ArrayList(Arrays.asList((long)4l, (long)8l, (long)5l, (long)7l, (long)3l)))) == (4l));\n assert(canArrange((new ArrayList(Arrays.asList()))) == (-1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Imagine a road that's a perfectly straight infinitely long line.\n // n cars are driving left to right; simultaneously, a different set of n cars\n // are driving right to left. The two sets of cars start out being very far from\n // each other. All cars move in the same speed. Two cars are said to collide\n // when a car that's moving left to right hits a car that's moving right to left.\n // However, the cars are infinitely sturdy and strong; as a result, they continue moving\n // in their trajectory as if they did not collide.\n // This function outputs the number of such collisions.\n public static long carRaceCollision(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(carRaceCollision((2l)) == (4l));\n assert(carRaceCollision((3l)) == (9l));\n assert(carRaceCollision((4l)) == (16l));\n assert(carRaceCollision((8l)) == (64l));\n assert(carRaceCollision((10l)) == (100l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function that returns true if the last character\n // of a given string is an alphabetical character and is not\n // a part of a word, and false otherwise.\n // Note: \"word\" is a group of characters separated by space.\n // Examples:\n // >>> checkIfLastCharIsALetter((\"apple pie\"))\n // (false)\n // >>> checkIfLastCharIsALetter((\"apple pi e\"))\n // (true)\n // >>> checkIfLastCharIsALetter((\"apple pi e \"))\n // (false)\n // >>> checkIfLastCharIsALetter((\"\"))\n // (false)\n public static boolean checkIfLastCharIsALetter(String txt) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(checkIfLastCharIsALetter((\"apple\")) == (false));\n assert(checkIfLastCharIsALetter((\"apple pi e\")) == (true));\n assert(checkIfLastCharIsALetter((\"eeeee\")) == (false));\n assert(checkIfLastCharIsALetter((\"A\")) == (true));\n assert(checkIfLastCharIsALetter((\"Pumpkin pie \")) == (false));\n assert(checkIfLastCharIsALetter((\"Pumpkin pie 1\")) == (false));\n assert(checkIfLastCharIsALetter((\"\")) == (false));\n assert(checkIfLastCharIsALetter((\"eeeee e \")) == (false));\n assert(checkIfLastCharIsALetter((\"apple pie\")) == (false));\n assert(checkIfLastCharIsALetter((\"apple pi e \")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return true if a given number is prime, and false otherwise.\n // >>> isPrime((6l))\n // (false)\n // >>> isPrime((101l))\n // (true)\n // >>> isPrime((11l))\n // (true)\n // >>> isPrime((13441l))\n // (true)\n // >>> isPrime((61l))\n // (true)\n // >>> isPrime((4l))\n // (false)\n // >>> isPrime((1l))\n // (false)\n public static boolean isPrime(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(isPrime((6l)) == (false));\n assert(isPrime((101l)) == (true));\n assert(isPrime((11l)) == (true));\n assert(isPrime((13441l)) == (true));\n assert(isPrime((61l)) == (true));\n assert(isPrime((4l)) == (false));\n assert(isPrime((1l)) == (false));\n assert(isPrime((5l)) == (true));\n assert(isPrime((11l)) == (true));\n assert(isPrime((17l)) == (true));\n assert(isPrime((85l)) == (false));\n assert(isPrime((77l)) == (false));\n assert(isPrime((255379l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given an array array list of positive integers x. return a sorted array list of all \n // elements that hasn't any even digit.\n // Note: Returned array list should be sorted in increasing order.\n // For example:\n // >>> uniqueDigits((new ArrayList(Arrays.asList((long)15l, (long)33l, (long)1422l, (long)1l))))\n // (new ArrayList(Arrays.asList((long)1l, (long)15l, (long)33l)))\n // >>> uniqueDigits((new ArrayList(Arrays.asList((long)152l, (long)323l, (long)1422l, (long)10l))))\n // (new ArrayList(Arrays.asList()))\n public static ArrayList uniqueDigits(ArrayList x) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(uniqueDigits((new ArrayList(Arrays.asList((long)15l, (long)33l, (long)1422l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)15l, (long)33l)))));\n assert(uniqueDigits((new ArrayList(Arrays.asList((long)152l, (long)323l, (long)1422l, (long)10l)))).equals((new ArrayList(Arrays.asList()))));\n assert(uniqueDigits((new ArrayList(Arrays.asList((long)12345l, (long)2033l, (long)111l, (long)151l)))).equals((new ArrayList(Arrays.asList((long)111l, (long)151l)))));\n assert(uniqueDigits((new ArrayList(Arrays.asList((long)135l, (long)103l, (long)31l)))).equals((new ArrayList(Arrays.asList((long)31l, (long)135l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Input are two strings a and b consisting only of 1s and 0s.\n // Perform binary XOR on these inputs and return result also as a string.\n // >>> stringXor((\"010\"), (\"110\"))\n // (\"100\")\n public static String stringXor(String a, String b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(stringXor((\"111000\"), (\"101010\")).equals((\"010010\")));\n assert(stringXor((\"1\"), (\"1\")).equals((\"0\")));\n assert(stringXor((\"0101\"), (\"0000\")).equals((\"0101\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // sum_to_n is a function that sums numbers from 1 to n.\n // >>> sumToN((30l))\n // (465l)\n // >>> sumToN((100l))\n // (5050l)\n // >>> sumToN((5l))\n // (15l)\n // >>> sumToN((10l))\n // (55l)\n // >>> sumToN((1l))\n // (1l)\n public static long sumToN(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(sumToN((1l)) == (1l));\n assert(sumToN((6l)) == (21l));\n assert(sumToN((11l)) == (66l));\n assert(sumToN((30l)) == (465l));\n assert(sumToN((100l)) == (5050l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given an array array list of numbers, return the sum of squares of the numbers\n // in the array list that are odd. Ignore numbers that are negative or not integers.\n // >>> doubleTheDifference((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)0l))))\n // (10l)\n // >>> doubleTheDifference((new ArrayList(Arrays.asList((long)-1l, (long)-2l, (long)0l))))\n // (0l)\n // >>> doubleTheDifference((new ArrayList(Arrays.asList((long)9l, (long)-2l))))\n // (81l)\n // >>> doubleTheDifference((new ArrayList(Arrays.asList((long)0l))))\n // (0l)\n // If the input array list is empty, return 0.\n public static long doubleTheDifference(ArrayList lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(doubleTheDifference((new ArrayList(Arrays.asList()))) == (0l));\n assert(doubleTheDifference((new ArrayList(Arrays.asList((float)5.0f, (float)4.0f)))) == (25l));\n assert(doubleTheDifference((new ArrayList(Arrays.asList((float)0.1f, (float)0.2f, (float)0.3f)))) == (0l));\n assert(doubleTheDifference((new ArrayList(Arrays.asList((float)-10.0f, (float)-20.0f, (float)-30.0f)))) == (0l));\n assert(doubleTheDifference((new ArrayList(Arrays.asList((float)-1.0f, (float)-2.0f, (float)8.0f)))) == (0l));\n assert(doubleTheDifference((new ArrayList(Arrays.asList((float)0.2f, (float)3.0f, (float)5.0f)))) == (34l));\n assert(doubleTheDifference((new ArrayList(Arrays.asList((float)-9.0f, (float)-7.0f, (float)-5.0f, (float)-3.0f, (float)-1.0f, (float)1.0f, (float)3.0f, (float)5.0f, (float)7.0f, (float)9.0f)))) == (165l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return length of given string\n // >>> stringLength((\"\"))\n // (0l)\n // >>> stringLength((\"abc\"))\n // (3l)\n public static long strlen(String string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(strlen((\"\")) == (0l));\n assert(strlen((\"x\")) == (1l));\n assert(strlen((\"asdasnakj\")) == (9l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You'll be given a string of words, and your task is to count the number\n // of boredoms. A boredom is a sentence that starts with the word \"I\".\n // Sentences are delimited by '.', '?' or '!'.\n // For example:\n // >>> isBored((\"Hello world\"))\n // (0l)\n // >>> isBored((\"The sky is blue. The sun is shining. I love this weather\"))\n // (1l)\n public static long isBored(String S) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(isBored((\"Hello world\")) == (0l));\n assert(isBored((\"Is the sky blue?\")) == (0l));\n assert(isBored((\"I love It !\")) == (1l));\n assert(isBored((\"bIt\")) == (0l));\n assert(isBored((\"I feel good today. I will be productive. will kill It\")) == (2l));\n assert(isBored((\"You and I are going for a walk\")) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function vowels_count which takes a string representing\n // a word as input and returns the number of vowels in the string.\n // Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n // vowel, but only when it is at the end of the given word.\n // Example:\n // >>> vowelsCount((\"abcde\"))\n // (2l)\n // >>> vowelsCount((\"ACEDY\"))\n // (3l)\n public static long vowelsCount(String s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(vowelsCount((\"abcde\")) == (2l));\n assert(vowelsCount((\"Alone\")) == (3l));\n assert(vowelsCount((\"key\")) == (2l));\n assert(vowelsCount((\"bye\")) == (1l));\n assert(vowelsCount((\"keY\")) == (2l));\n assert(vowelsCount((\"bYe\")) == (1l));\n assert(vowelsCount((\"ACEDY\")) == (3l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return n-th Fibonacci number.\n // >>> fib((10l))\n // (55l)\n // >>> fib((1l))\n // (1l)\n // >>> fib((8l))\n // (21l)\n public static long fib(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(fib((10l)) == (55l));\n assert(fib((1l)) == (1l));\n assert(fib((8l)) == (21l));\n assert(fib((11l)) == (89l));\n assert(fib((12l)) == (144l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Your task is to implement a function that will simplify the expression\n // x * n. The function returns true if x * n evaluates to a whole number and false\n // otherwise. Both x and n, are string representation of a fraction, and have the following format,\n // / where both numerator and denominator are positive whole numbers.\n // You can assume that x, and n are valid fractions, and do not have zero as denominator.\n // >>> simplify((\"1/5\"), (\"5/1\"))\n // (true)\n // >>> simplify((\"1/6\"), (\"2/1\"))\n // (false)\n // >>> simplify((\"7/10\"), (\"10/2\"))\n // (false)\n public static boolean simplify(String x, String n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(simplify((\"1/5\"), (\"5/1\")) == (true));\n assert(simplify((\"1/6\"), (\"2/1\")) == (false));\n assert(simplify((\"5/1\"), (\"3/1\")) == (true));\n assert(simplify((\"7/10\"), (\"10/2\")) == (false));\n assert(simplify((\"2/10\"), (\"50/10\")) == (true));\n assert(simplify((\"7/2\"), (\"4/2\")) == (true));\n assert(simplify((\"11/6\"), (\"6/1\")) == (true));\n assert(simplify((\"2/3\"), (\"5/2\")) == (false));\n assert(simplify((\"5/2\"), (\"3/5\")) == (false));\n assert(simplify((\"2/4\"), (\"8/4\")) == (true));\n assert(simplify((\"2/4\"), (\"4/2\")) == (true));\n assert(simplify((\"1/5\"), (\"5/1\")) == (true));\n assert(simplify((\"1/5\"), (\"1/5\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a string s, count the number of uppercase vowels in even indices.\n // For example:\n // >>> countUpper((\"aBCdEf\"))\n // (1l)\n // >>> countUpper((\"abcdefg\"))\n // (0l)\n // >>> countUpper((\"dBBE\"))\n // (0l)\n public static long countUpper(String s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(countUpper((\"aBCdEf\")) == (1l));\n assert(countUpper((\"abcdefg\")) == (0l));\n assert(countUpper((\"dBBE\")) == (0l));\n assert(countUpper((\"B\")) == (0l));\n assert(countUpper((\"U\")) == (1l));\n assert(countUpper((\"\")) == (0l));\n assert(countUpper((\"EEEE\")) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a rectangular grid of wells. Each row represents a single well,\n // and each 1 in a row represents a single unit of water.\n // Each well has a corresponding bucket that can be used to extract water from it, \n // and all buckets have the same capacity.\n // Your task is to use the buckets to empty the wells.\n // Output the number of times you need to lower the buckets.\n // Example 1:\n // >>> maxFill((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)0l, (long)0l, (long)1l, (long)0l)), (ArrayList)new ArrayList(Arrays.asList((long)0l, (long)1l, (long)0l, (long)0l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l))))), (1l))\n // (6l)\n // Example 2:\n // >>> maxFill((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)0l, (long)0l, (long)1l, (long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l, (long)0l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)0l, (long)1l, (long)1l, (long)1l))))), (2l))\n // (5l)\n // Example 3:\n // >>> maxFill((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l)), (ArrayList)new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l))))), (5l))\n // (0l)\n // Constraints:\n // * all wells have the same length\n // * 1 <= grid.length <= 10^2\n // * 1 <= grid[:,1].length <= 10^2\n // * grid[i][j] -> 0 | 1\n // * 1 <= capacity <= 10\n public static long maxFill(ArrayList> grid, long capacity) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(maxFill((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)0l, (long)0l, (long)1l, (long)0l)), (ArrayList)new ArrayList(Arrays.asList((long)0l, (long)1l, (long)0l, (long)0l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l))))), (1l)) == (6l));\n assert(maxFill((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)0l, (long)0l, (long)1l, (long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l, (long)0l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)0l, (long)1l, (long)1l, (long)1l))))), (2l)) == (5l));\n assert(maxFill((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l)), (ArrayList)new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l))))), (5l)) == (0l));\n assert(maxFill((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l))))), (2l)) == (4l));\n assert(maxFill((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l))))), (9l)) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given an array array list arr of integers and a positive integer k, return a sorted array list \n // of length k with the maximum k numbers in arr.\n // Example 1:\n // >>> maximum((new ArrayList(Arrays.asList((long)-3l, (long)-4l, (long)5l))), (3l))\n // (new ArrayList(Arrays.asList((long)-4l, (long)-3l, (long)5l)))\n // Example 2:\n // >>> maximum((new ArrayList(Arrays.asList((long)4l, (long)-4l, (long)4l))), (2l))\n // (new ArrayList(Arrays.asList((long)4l, (long)4l)))\n // Example 3:\n // >>> maximum((new ArrayList(Arrays.asList((long)-3l, (long)2l, (long)1l, (long)2l, (long)-1l, (long)-2l, (long)1l))), (1l))\n // (new ArrayList(Arrays.asList((long)2l)))\n // Note:\n // 1. The length of the array array list will be in the range of [1, 1000].\n // 2. The elements in the array array list will be in the range of [-1000, 1000].\n // 3. 0 <= k <= len(arr)\n public static ArrayList maximum(ArrayList arr, long k) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(maximum((new ArrayList(Arrays.asList((long)-3l, (long)-4l, (long)5l))), (3l)).equals((new ArrayList(Arrays.asList((long)-4l, (long)-3l, (long)5l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)4l, (long)-4l, (long)4l))), (2l)).equals((new ArrayList(Arrays.asList((long)4l, (long)4l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)-3l, (long)2l, (long)1l, (long)2l, (long)-1l, (long)-2l, (long)1l))), (1l)).equals((new ArrayList(Arrays.asList((long)2l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)123l, (long)-123l, (long)20l, (long)0l, (long)1l, (long)2l, (long)-3l))), (3l)).equals((new ArrayList(Arrays.asList((long)2l, (long)20l, (long)123l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)-123l, (long)20l, (long)0l, (long)1l, (long)2l, (long)-3l))), (4l)).equals((new ArrayList(Arrays.asList((long)0l, (long)1l, (long)2l, (long)20l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)5l, (long)15l, (long)0l, (long)3l, (long)-13l, (long)-8l, (long)0l))), (7l)).equals((new ArrayList(Arrays.asList((long)-13l, (long)-8l, (long)0l, (long)0l, (long)3l, (long)5l, (long)15l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)-1l, (long)0l, (long)2l, (long)5l, (long)3l, (long)-10l))), (2l)).equals((new ArrayList(Arrays.asList((long)3l, (long)5l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)1l, (long)0l, (long)5l, (long)-7l))), (1l)).equals((new ArrayList(Arrays.asList((long)5l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)4l, (long)-4l))), (2l)).equals((new ArrayList(Arrays.asList((long)-4l, (long)4l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)-10l, (long)10l))), (2l)).equals((new ArrayList(Arrays.asList((long)-10l, (long)10l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)-23l, (long)243l, (long)-400l, (long)0l))), (0l)).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that takes a message, and encodes in such a \n // way that it swaps case of all letters, replaces all vowels in \n // the message with the letter that appears 2 places ahead of that \n // vowel in the english alphabet. \n // Assume only letters. \n // Examples:\n // >>> encode((\"test\"))\n // (\"TGST\")\n // >>> encode((\"This is a message\"))\n // (\"tHKS KS C MGSSCGG\")\n public static String encode(String message) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(encode((\"TEST\")).equals((\"tgst\")));\n assert(encode((\"Mudasir\")).equals((\"mWDCSKR\")));\n assert(encode((\"YES\")).equals((\"ygs\")));\n assert(encode((\"This is a message\")).equals((\"tHKS KS C MGSSCGG\")));\n assert(encode((\"I DoNt KnOw WhAt tO WrItE\")).equals((\"k dQnT kNqW wHcT Tq wRkTg\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // remove_vowels is a function that takes string and returns string without vowels.\n // >>> removeVowels((\"\"))\n // (\"\")\n // >>> removeVowels((\"abcdef\"))\n // (\"bcdf\")\n // >>> removeVowels((\"aaaaa\"))\n // (\"\")\n // >>> removeVowels((\"aaBAA\"))\n // (\"B\")\n // >>> removeVowels((\"zbcd\"))\n // (\"zbcd\")\n public static String removeVowels(String text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(removeVowels((\"\")).equals((\"\")));\n assert(removeVowels((\"abcdef\\nghijklm\")).equals((\"bcdf\\nghjklm\")));\n assert(removeVowels((\"fedcba\")).equals((\"fdcb\")));\n assert(removeVowels((\"eeeee\")).equals((\"\")));\n assert(removeVowels((\"acBAA\")).equals((\"cB\")));\n assert(removeVowels((\"EcBOO\")).equals((\"cB\")));\n assert(removeVowels((\"ybcd\")).equals((\"ybcd\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return only positive numbers in the array list.\n // >>> getPositive((new ArrayList(Arrays.asList((long)-1l, (long)2l, (long)-4l, (long)5l, (long)6l))))\n // (new ArrayList(Arrays.asList((long)2l, (long)5l, (long)6l)))\n // >>> getPositive((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)-5l, (long)2l, (long)-3l, (long)3l, (long)9l, (long)0l, (long)123l, (long)1l, (long)-10l))))\n // (new ArrayList(Arrays.asList((long)5l, (long)3l, (long)2l, (long)3l, (long)9l, (long)123l, (long)1l)))\n public static ArrayList getPositive(ArrayList l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(getPositive((new ArrayList(Arrays.asList((long)-1l, (long)-2l, (long)4l, (long)5l, (long)6l)))).equals((new ArrayList(Arrays.asList((long)4l, (long)5l, (long)6l)))));\n assert(getPositive((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)-5l, (long)2l, (long)3l, (long)3l, (long)9l, (long)0l, (long)123l, (long)1l, (long)-10l)))).equals((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)2l, (long)3l, (long)3l, (long)9l, (long)123l, (long)1l)))));\n assert(getPositive((new ArrayList(Arrays.asList((long)-1l, (long)-2l)))).equals((new ArrayList(Arrays.asList()))));\n assert(getPositive((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n // >>> stringSequence((0l))\n // (\"0\")\n // >>> stringSequence((5l))\n // (\"0 1 2 3 4 5\")\n public static String stringSequence(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(stringSequence((0l)).equals((\"0\")));\n assert(stringSequence((3l)).equals((\"0 1 2 3\")));\n assert(stringSequence((10l)).equals((\"0 1 2 3 4 5 6 7 8 9 10\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a positive integer n, you have to make a pile of n levels of stones.\n // The first level has n stones.\n // The number of stones in the next level is:\n // - the next odd number if n is odd.\n // - the next even number if n is even.\n // Return the number of stones in each level in an array array list, where element at index\n // i represents the number of stones in the level (i+1).\n // Examples:\n // >>> makeAPile((3l))\n // (new ArrayList(Arrays.asList((long)3l, (long)5l, (long)7l)))\n public static ArrayList makeAPile(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(makeAPile((3l)).equals((new ArrayList(Arrays.asList((long)3l, (long)5l, (long)7l)))));\n assert(makeAPile((4l)).equals((new ArrayList(Arrays.asList((long)4l, (long)6l, (long)8l, (long)10l)))));\n assert(makeAPile((5l)).equals((new ArrayList(Arrays.asList((long)5l, (long)7l, (long)9l, (long)11l, (long)13l)))));\n assert(makeAPile((6l)).equals((new ArrayList(Arrays.asList((long)6l, (long)8l, (long)10l, (long)12l, (long)14l, (long)16l)))));\n assert(makeAPile((8l)).equals((new ArrayList(Arrays.asList((long)8l, (long)10l, (long)12l, (long)14l, (long)16l, (long)18l, (long)20l, (long)22l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Task\n // 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\n // then check if the result string is palindrome.\n // A string is called palindrome if it reads the same backward as forward.\n // You should return a pair containing the result string and true/false for the check.\n // Example\n // >>> reverseDelete((\"abcde\"), (\"ae\"))\n // (Pair.with(\"bcd\", false))\n // >>> reverseDelete((\"abcdef\"), (\"b\"))\n // (Pair.with(\"acdef\", false))\n // >>> reverseDelete((\"abcdedcba\"), (\"ab\"))\n // (Pair.with(\"cdedc\", true))\n public static Pair reverseDelete(String s, String c) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(reverseDelete((\"abcde\"), (\"ae\")).equals((Pair.with(\"bcd\", false))));\n assert(reverseDelete((\"abcdef\"), (\"b\")).equals((Pair.with(\"acdef\", false))));\n assert(reverseDelete((\"abcdedcba\"), (\"ab\")).equals((Pair.with(\"cdedc\", true))));\n assert(reverseDelete((\"dwik\"), (\"w\")).equals((Pair.with(\"dik\", false))));\n assert(reverseDelete((\"a\"), (\"a\")).equals((Pair.with(\"\", true))));\n assert(reverseDelete((\"abcdedcba\"), (\"\")).equals((Pair.with(\"abcdedcba\", true))));\n assert(reverseDelete((\"abcdedcba\"), (\"v\")).equals((Pair.with(\"abcdedcba\", true))));\n assert(reverseDelete((\"vabba\"), (\"v\")).equals((Pair.with(\"abba\", true))));\n assert(reverseDelete((\"mamma\"), (\"mia\")).equals((Pair.with(\"\", true))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n // >>> flipCase((\"Hello\"))\n // (\"hELLO\")\n public static String flipCase(String string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(flipCase((\"\")).equals((\"\")));\n assert(flipCase((\"Hello!\")).equals((\"hELLO!\")));\n assert(flipCase((\"These violent delights have violent ends\")).equals((\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a string s.\n // if s[i] is a letter, reverse its case from lower to upper or vise versa, \n // otherwise keep it as it is.\n // If the string contains no letters, reverse the string.\n // The function should return the resulted string.\n // Examples\n // >>> solve((\"1234\"))\n // (\"4321\")\n // >>> solve((\"ab\"))\n // (\"AB\")\n // >>> solve((\"#a@C\"))\n // (\"#A@c\")\n public static String solve(String s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(solve((\"AsDf\")).equals((\"aSdF\")));\n assert(solve((\"1234\")).equals((\"4321\")));\n assert(solve((\"ab\")).equals((\"AB\")));\n assert(solve((\"#a@C\")).equals((\"#A@c\")));\n assert(solve((\"#AsdfW^45\")).equals((\"#aSDFw^45\")));\n assert(solve((\"#6@2\")).equals((\"2@6#\")));\n assert(solve((\"#$a^D\")).equals((\"#$A^d\")));\n assert(solve((\"#ccc\")).equals((\"#CCC\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Filter an input array list of strings only for ones that start with a given prefix.\n // >>> filterByPrefix((new ArrayList(Arrays.asList())), (\"a\"))\n // (new ArrayList(Arrays.asList()))\n // >>> filterByPrefix((new ArrayList(Arrays.asList((String)\"abc\", (String)\"bcd\", (String)\"cde\", (String)\"array\"))), (\"a\"))\n // (new ArrayList(Arrays.asList((String)\"abc\", (String)\"array\")))\n public static ArrayList filterByPrefix(ArrayList strings, String prefix) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(filterByPrefix((new ArrayList(Arrays.asList())), (\"john\")).equals((new ArrayList(Arrays.asList()))));\n assert(filterByPrefix((new ArrayList(Arrays.asList((String)\"xxx\", (String)\"asd\", (String)\"xxy\", (String)\"john doe\", (String)\"xxxAAA\", (String)\"xxx\"))), (\"xxx\")).equals((new ArrayList(Arrays.asList((String)\"xxx\", (String)\"xxxAAA\", (String)\"xxx\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // This function takes two positive numbers x and y and returns the\n // biggest even integer number that is in the range [x, y] inclusive. If \n // there's no such number, then the function should return -1.\n // For example:\n // >>> chooseNum((12l), (15l))\n // (14l)\n // >>> chooseNum((13l), (12l))\n // (-1l)\n public static long chooseNum(long x, long y) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(chooseNum((12l), (15l)) == (14l));\n assert(chooseNum((13l), (12l)) == (-1l));\n assert(chooseNum((33l), (12354l)) == (12354l));\n assert(chooseNum((5234l), (5233l)) == (-1l));\n assert(chooseNum((6l), (29l)) == (28l));\n assert(chooseNum((27l), (10l)) == (-1l));\n assert(chooseNum((7l), (7l)) == (-1l));\n assert(chooseNum((546l), (546l)) == (546l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a string representing a sentence,\n // the sentence contains some words separated by a space,\n // and you have to return a string that contains the words from the original sentence,\n // whose lengths are prime numbers,\n // the order of the words in the new string should be the same as the original one.\n // Example 1:\n // >>> wordsInSentence((\"This is a test\"))\n // (\"is\")\n // Example 2:\n // >>> wordsInSentence((\"lets go for swimming\"))\n // (\"go for\")\n // Constraints:\n // * 1 <= len(sentence) <= 100\n // * sentence contains only letters\n public static String wordsInSentence(String sentence) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(wordsInSentence((\"This is a test\")).equals((\"is\")));\n assert(wordsInSentence((\"lets go for swimming\")).equals((\"go for\")));\n assert(wordsInSentence((\"there is no place available here\")).equals((\"there is no place\")));\n assert(wordsInSentence((\"Hi I am Hussein\")).equals((\"Hi am Hussein\")));\n assert(wordsInSentence((\"go for it\")).equals((\"go for it\")));\n assert(wordsInSentence((\"here\")).equals((\"\")));\n assert(wordsInSentence((\"here is\")).equals((\"is\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Insert a number 'delimeter' between every two consecutive elements of input array list `numbers'\n // >>> intersperse((new ArrayList(Arrays.asList())), (4l))\n // (new ArrayList(Arrays.asList()))\n // >>> intersperse((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))), (4l))\n // (new ArrayList(Arrays.asList((long)1l, (long)4l, (long)2l, (long)4l, (long)3l)))\n public static ArrayList intersperse(ArrayList numbers, long delimeter) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(intersperse((new ArrayList(Arrays.asList())), (7l)).equals((new ArrayList(Arrays.asList()))));\n assert(intersperse((new ArrayList(Arrays.asList((long)5l, (long)6l, (long)3l, (long)2l))), (8l)).equals((new ArrayList(Arrays.asList((long)5l, (long)8l, (long)6l, (long)8l, (long)3l, (long)8l, (long)2l)))));\n assert(intersperse((new ArrayList(Arrays.asList((long)2l, (long)2l, (long)2l))), (2l)).equals((new ArrayList(Arrays.asList((long)2l, (long)2l, (long)2l, (long)2l, (long)2l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Your task is to write a function that returns true if a number x is a simple\n // power of n and false in other cases.\n // x is a simple power of n if n**int=x\n // For example:\n // >>> isSimplePower((1l), (4l))\n // (true)\n // >>> isSimplePower((2l), (2l))\n // (true)\n // >>> isSimplePower((8l), (2l))\n // (true)\n // >>> isSimplePower((3l), (2l))\n // (false)\n // >>> isSimplePower((3l), (1l))\n // (false)\n // >>> isSimplePower((5l), (3l))\n // (false)\n public static boolean isSimplePower(long x, long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(isSimplePower((16l), (2l)) == (true));\n assert(isSimplePower((143214l), (16l)) == (false));\n assert(isSimplePower((4l), (2l)) == (true));\n assert(isSimplePower((9l), (3l)) == (true));\n assert(isSimplePower((16l), (4l)) == (true));\n assert(isSimplePower((24l), (2l)) == (false));\n assert(isSimplePower((128l), (4l)) == (false));\n assert(isSimplePower((12l), (6l)) == (false));\n assert(isSimplePower((1l), (1l)) == (true));\n assert(isSimplePower((1l), (12l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that returns true if the given number is the multiplication of 3 prime numbers\n // and false otherwise.\n // Knowing that (a) is less then 100. \n // Example:\n // >>> isMultiplyPrime((30l))\n // (true)\n // 30 = 2 * 3 * 5\n public static boolean isMultiplyPrime(long a) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(isMultiplyPrime((5l)) == (false));\n assert(isMultiplyPrime((30l)) == (true));\n assert(isMultiplyPrime((8l)) == (true));\n assert(isMultiplyPrime((10l)) == (false));\n assert(isMultiplyPrime((125l)) == (true));\n assert(isMultiplyPrime((105l)) == (true));\n assert(isMultiplyPrime((126l)) == (false));\n assert(isMultiplyPrime((729l)) == (false));\n assert(isMultiplyPrime((891l)) == (false));\n assert(isMultiplyPrime((1001l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given the lengths of the three sides of a triangle. Return true if the three\n // sides form a right-angled triangle, false otherwise.\n // A right-angled triangle is a triangle in which one angle is right angle or \n // 90 degree.\n // Example:\n // >>> rightAngleTriangle((3l), (4l), (5l))\n // (true)\n // >>> rightAngleTriangle((1l), (2l), (3l))\n // (false)\n public static boolean rightAngleTriangle(long a, long b, long c) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(rightAngleTriangle((3l), (4l), (5l)) == (true));\n assert(rightAngleTriangle((1l), (2l), (3l)) == (false));\n assert(rightAngleTriangle((10l), (6l), (8l)) == (true));\n assert(rightAngleTriangle((2l), (2l), (2l)) == (false));\n assert(rightAngleTriangle((7l), (24l), (25l)) == (true));\n assert(rightAngleTriangle((10l), (5l), (7l)) == (false));\n assert(rightAngleTriangle((5l), (12l), (13l)) == (true));\n assert(rightAngleTriangle((15l), (8l), (17l)) == (true));\n assert(rightAngleTriangle((48l), (55l), (73l)) == (true));\n assert(rightAngleTriangle((1l), (1l), (1l)) == (false));\n assert(rightAngleTriangle((2l), (2l), (10l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function that takes 3 numbers.\n // Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n // Returns false in any other cases.\n // Examples\n // >>> anyInt((float)5l, (float)2l, (float)7l)\n // (true)\n // >>> anyInt((float)3l, (float)2l, (float)2l)\n // (false)\n // >>> anyInt((float)3l, (float)-2l, (float)1l)\n // (true)\n // >>> anyInt((3.6f), (-2.2f), (float)2l)\n // (false)\n public static boolean anyInt(float x, float y, float z) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(anyInt((float)2l, (float)3l, (float)1l) == (true));\n assert(anyInt((2.5f), (float)2l, (float)3l) == (false));\n assert(anyInt((1.5f), (float)5l, (3.5f)) == (false));\n assert(anyInt((float)2l, (float)6l, (float)2l) == (false));\n assert(anyInt((float)4l, (float)2l, (float)2l) == (true));\n assert(anyInt((2.2f), (2.2f), (2.2f)) == (false));\n assert(anyInt((float)-4l, (float)6l, (float)2l) == (true));\n assert(anyInt((float)2l, (float)1l, (float)1l) == (true));\n assert(anyInt((float)3l, (float)4l, (float)7l) == (true));\n assert(anyInt((3.0f), (float)4l, (float)7l) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // This function takes an array array list l and returns an array array list l' such that\n // l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n // to the values of the corresponding indicies of l, but sorted.\n // >>> sortThird((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))))\n // (new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)))\n // >>> sortThird((new ArrayList(Arrays.asList((long)5l, (long)6l, (long)3l, (long)4l, (long)8l, (long)9l, (long)2l))))\n // (new ArrayList(Arrays.asList((long)2l, (long)6l, (long)3l, (long)4l, (long)8l, (long)9l, (long)5l)))\n public static ArrayList sortThird(ArrayList l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(sortThird((new ArrayList(Arrays.asList((long)5l, (long)6l, (long)3l, (long)4l, (long)8l, (long)9l, (long)2l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)6l, (long)3l, (long)4l, (long)8l, (long)9l, (long)5l)))));\n assert(sortThird((new ArrayList(Arrays.asList((long)5l, (long)8l, (long)3l, (long)4l, (long)6l, (long)9l, (long)2l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)8l, (long)3l, (long)4l, (long)6l, (long)9l, (long)5l)))));\n assert(sortThird((new ArrayList(Arrays.asList((long)5l, (long)6l, (long)9l, (long)4l, (long)8l, (long)3l, (long)2l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)6l, (long)9l, (long)4l, (long)8l, (long)3l, (long)5l)))));\n assert(sortThird((new ArrayList(Arrays.asList((long)5l, (long)6l, (long)3l, (long)4l, (long)8l, (long)9l, (long)2l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)6l, (long)3l, (long)4l, (long)8l, (long)9l, (long)5l, (long)1l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_53_add", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Add two numbers x and y\n // >>> add((2l), (3l))\n // (5l)\n // >>> add((5l), (7l))\n // (12l)\n public static long add(long x, long y) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(add((0l), (1l)) == (1l));\n assert(add((1l), (0l)) == (1l));\n assert(add((2l), (3l)) == (5l));\n assert(add((5l), (7l)) == (12l));\n assert(add((7l), (5l)) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_69_search", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a non-empty array list of positive integers. Return the greatest integer that is greater than \n // zero, and has a frequency greater than or equal to the value of the integer itself. \n // The frequency of an integer is the number of times it appears in the array list.\n // If no such a value exist, return -1.\n // Examples:\n // >>> search((new ArrayList(Arrays.asList((long)4l, (long)1l, (long)2l, (long)2l, (long)3l, (long)1l))))\n // (2l)\n // >>> search((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)2l, (long)3l, (long)3l, (long)3l, (long)4l, (long)4l, (long)4l))))\n // (3l)\n // >>> search((new ArrayList(Arrays.asList((long)5l, (long)5l, (long)4l, (long)4l, (long)4l))))\n // (-1l)\n public static long search(ArrayList lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(search((new ArrayList(Arrays.asList((long)5l, (long)5l, (long)5l, (long)5l, (long)1l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)4l, (long)1l, (long)4l, (long)1l, (long)4l, (long)4l)))) == (4l));\n assert(search((new ArrayList(Arrays.asList((long)3l, (long)3l)))) == (-1l));\n assert(search((new ArrayList(Arrays.asList((long)8l, (long)8l, (long)8l, (long)8l, (long)8l, (long)8l, (long)8l, (long)8l)))) == (8l));\n assert(search((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)3l, (long)2l, (long)2l)))) == (2l));\n assert(search((new ArrayList(Arrays.asList((long)2l, (long)7l, (long)8l, (long)8l, (long)4l, (long)8l, (long)7l, (long)3l, (long)9l, (long)6l, (long)5l, (long)10l, (long)4l, (long)3l, (long)6l, (long)7l, (long)1l, (long)7l, (long)4l, (long)10l, (long)8l, (long)1l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)8l, (long)2l)))) == (2l));\n assert(search((new ArrayList(Arrays.asList((long)6l, (long)7l, (long)1l, (long)8l, (long)8l, (long)10l, (long)5l, (long)8l, (long)5l, (long)3l, (long)10l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)8l, (long)8l, (long)3l, (long)6l, (long)5l, (long)6l, (long)4l)))) == (-1l));\n assert(search((new ArrayList(Arrays.asList((long)6l, (long)9l, (long)6l, (long)7l, (long)1l, (long)4l, (long)7l, (long)1l, (long)8l, (long)8l, (long)9l, (long)8l, (long)10l, (long)10l, (long)8l, (long)4l, (long)10l, (long)4l, (long)10l, (long)1l, (long)2l, (long)9l, (long)5l, (long)7l, (long)9l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)1l, (long)9l, (long)10l, (long)1l, (long)3l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)6l, (long)9l, (long)7l, (long)5l, (long)8l, (long)7l, (long)5l, (long)3l, (long)7l, (long)5l, (long)10l, (long)10l, (long)3l, (long)6l, (long)10l, (long)2l, (long)8l, (long)6l, (long)5l, (long)4l, (long)9l, (long)5l, (long)3l, (long)10l)))) == (5l));\n assert(search((new ArrayList(Arrays.asList((long)1l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)8l, (long)8l, (long)10l, (long)6l, (long)4l, (long)3l, (long)5l, (long)8l, (long)2l, (long)4l, (long)2l, (long)8l, (long)4l, (long)6l, (long)10l, (long)4l, (long)2l, (long)1l, (long)10l, (long)2l, (long)1l, (long)1l, (long)5l)))) == (4l));\n assert(search((new ArrayList(Arrays.asList((long)2l, (long)10l, (long)4l, (long)8l, (long)2l, (long)10l, (long)5l, (long)1l, (long)2l, (long)9l, (long)5l, (long)5l, (long)6l, (long)3l, (long)8l, (long)6l, (long)4l, (long)10l)))) == (2l));\n assert(search((new ArrayList(Arrays.asList((long)1l, (long)6l, (long)10l, (long)1l, (long)6l, (long)9l, (long)10l, (long)8l, (long)6l, (long)8l, (long)7l, (long)3l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)9l, (long)2l, (long)4l, (long)1l, (long)5l, (long)1l, (long)5l, (long)2l, (long)5l, (long)7l, (long)7l, (long)7l, (long)3l, (long)10l, (long)1l, (long)5l, (long)4l, (long)2l, (long)8l, (long)4l, (long)1l, (long)9l, (long)10l, (long)7l, (long)10l, (long)2l, (long)8l, (long)10l, (long)9l, (long)4l)))) == (4l));\n assert(search((new ArrayList(Arrays.asList((long)2l, (long)6l, (long)4l, (long)2l, (long)8l, (long)7l, (long)5l, (long)6l, (long)4l, (long)10l, (long)4l, (long)6l, (long)3l, (long)7l, (long)8l, (long)8l, (long)3l, (long)1l, (long)4l, (long)2l, (long)2l, (long)10l, (long)7l)))) == (4l));\n assert(search((new ArrayList(Arrays.asList((long)9l, (long)8l, (long)6l, (long)10l, (long)2l, (long)6l, (long)10l, (long)2l, (long)7l, (long)8l, (long)10l, (long)3l, (long)8l, (long)2l, (long)6l, (long)2l, (long)3l, (long)1l)))) == (2l));\n assert(search((new ArrayList(Arrays.asList((long)5l, (long)5l, (long)3l, (long)9l, (long)5l, (long)6l, (long)3l, (long)2l, (long)8l, (long)5l, (long)6l, (long)10l, (long)10l, (long)6l, (long)8l, (long)4l, (long)10l, (long)7l, (long)7l, (long)10l, (long)8l)))) == (-1l));\n assert(search((new ArrayList(Arrays.asList((long)10l)))) == (-1l));\n assert(search((new ArrayList(Arrays.asList((long)9l, (long)7l, (long)7l, (long)2l, (long)4l, (long)7l, (long)2l, (long)10l, (long)9l, (long)7l, (long)5l, (long)7l, (long)2l)))) == (2l));\n assert(search((new ArrayList(Arrays.asList((long)5l, (long)4l, (long)10l, (long)2l, (long)1l, (long)1l, (long)10l, (long)3l, (long)6l, (long)1l, (long)8l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)7l, (long)9l, (long)9l, (long)9l, (long)3l, (long)4l, (long)1l, (long)5l, (long)9l, (long)1l, (long)2l, (long)1l, (long)1l, (long)10l, (long)7l, (long)5l, (long)6l, (long)7l, (long)6l, (long)7l, (long)7l, (long)6l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)3l, (long)10l, (long)10l, (long)9l, (long)2l)))) == (-1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that takes a string and returns true if the string\n // length is a prime number or false otherwise\n // Examples\n // >>> primeLength((\"Hello\"))\n // (true)\n // >>> primeLength((\"abcdcba\"))\n // (true)\n // >>> primeLength((\"kittens\"))\n // (true)\n // >>> primeLength((\"orange\"))\n // (false)\n public static boolean primeLength(String string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(primeLength((\"Hello\")) == (true));\n assert(primeLength((\"abcdcba\")) == (true));\n assert(primeLength((\"kittens\")) == (true));\n assert(primeLength((\"orange\")) == (false));\n assert(primeLength((\"wow\")) == (true));\n assert(primeLength((\"world\")) == (true));\n assert(primeLength((\"MadaM\")) == (true));\n assert(primeLength((\"Wow\")) == (true));\n assert(primeLength((\"\")) == (false));\n assert(primeLength((\"HI\")) == (true));\n assert(primeLength((\"go\")) == (true));\n assert(primeLength((\"gogo\")) == (false));\n assert(primeLength((\"aaaaaaaaaaaaaaa\")) == (false));\n assert(primeLength((\"Madam\")) == (true));\n assert(primeLength((\"M\")) == (false));\n assert(primeLength((\"0\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_58_common", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return sorted unique common elements for two array lists.\n // >>> common((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)3l, (long)34l, (long)653l, (long)2l, (long)5l))), (new ArrayList(Arrays.asList((long)5l, (long)7l, (long)1l, (long)5l, (long)9l, (long)653l, (long)121l))))\n // (new ArrayList(Arrays.asList((long)1l, (long)5l, (long)653l)))\n // >>> common((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)2l, (long)8l))), (new ArrayList(Arrays.asList((long)3l, (long)2l))))\n // (new ArrayList(Arrays.asList((long)2l, (long)3l)))\n public static ArrayList common(ArrayList l1, ArrayList l2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(common((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)3l, (long)34l, (long)653l, (long)2l, (long)5l))), (new ArrayList(Arrays.asList((long)5l, (long)7l, (long)1l, (long)5l, (long)9l, (long)653l, (long)121l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)5l, (long)653l)))));\n assert(common((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)2l, (long)8l))), (new ArrayList(Arrays.asList((long)3l, (long)2l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)3l)))));\n assert(common((new ArrayList(Arrays.asList((long)4l, (long)3l, (long)2l, (long)8l))), (new ArrayList(Arrays.asList((long)3l, (long)2l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)4l)))));\n assert(common((new ArrayList(Arrays.asList((long)4l, (long)3l, (long)2l, (long)8l))), (new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // The Brazilian factorial is defined as:\n // brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n // where n > 0\n // For example:\n // >>> specialFactorial((4l))\n // (288l)\n // The function will receive an integer as input and should return the special\n // factorial of this integer.\n public static long specialFactorial(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(specialFactorial((4l)) == (288l));\n assert(specialFactorial((5l)) == (34560l));\n assert(specialFactorial((7l)) == (125411328000l));\n assert(specialFactorial((1l)) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // In this problem, you will implement a function that takes two array lists of numbers,\n // and determines whether it is possible to perform an exchange of elements\n // between them to make lst1 an array array list of only even numbers.\n // There is no limit on the number of exchanged elements between lst1 and lst2.\n // If it is possible to exchange elements between the lst1 and lst2 to make\n // all the elements of lst1 to be even, return \"YES\".\n // Otherwise, return \"NO\".\n // For example:\n // >>> exchange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l))), (new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l))))\n // (\"YES\")\n // >>> exchange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l))), (new ArrayList(Arrays.asList((long)1l, (long)5l, (long)3l, (long)4l))))\n // (\"NO\")\n // It is assumed that the input array lists will be non-empty.\n public static String exchange(ArrayList lst1, ArrayList lst2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(exchange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l))), (new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))).equals((\"YES\")));\n assert(exchange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l))), (new ArrayList(Arrays.asList((long)1l, (long)5l, (long)3l, (long)4l)))).equals((\"NO\")));\n assert(exchange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l))), (new ArrayList(Arrays.asList((long)2l, (long)1l, (long)4l, (long)3l)))).equals((\"YES\")));\n assert(exchange((new ArrayList(Arrays.asList((long)5l, (long)7l, (long)3l))), (new ArrayList(Arrays.asList((long)2l, (long)6l, (long)4l)))).equals((\"YES\")));\n assert(exchange((new ArrayList(Arrays.asList((long)5l, (long)7l, (long)3l))), (new ArrayList(Arrays.asList((long)2l, (long)6l, (long)3l)))).equals((\"NO\")));\n assert(exchange((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)6l, (long)1l, (long)8l, (long)9l))), (new ArrayList(Arrays.asList((long)3l, (long)5l, (long)5l, (long)1l, (long)1l, (long)1l)))).equals((\"NO\")));\n assert(exchange((new ArrayList(Arrays.asList((long)100l, (long)200l))), (new ArrayList(Arrays.asList((long)200l, (long)200l)))).equals((\"YES\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a non-empty array array list of integers arr and an integer k, return\n // the sum of the elements with at most two digits from the first k elements of arr.\n // Example:\n // >>> addElements((new ArrayList(Arrays.asList((long)111l, (long)21l, (long)3l, (long)4000l, (long)5l, (long)6l, (long)7l, (long)8l, (long)9l))), (4l))\n // (24l)\n // Constraints:\n // 1. 1 <= len(arr) <= 100\n // 2. 1 <= k <= len(arr)\n public static long addElements(ArrayList arr, long k) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(addElements((new ArrayList(Arrays.asList((long)1l, (long)-2l, (long)-3l, (long)41l, (long)57l, (long)76l, (long)87l, (long)88l, (long)99l))), (3l)) == (-4l));\n assert(addElements((new ArrayList(Arrays.asList((long)111l, (long)121l, (long)3l, (long)4000l, (long)5l, (long)6l))), (2l)) == (0l));\n assert(addElements((new ArrayList(Arrays.asList((long)11l, (long)21l, (long)3l, (long)90l, (long)5l, (long)6l, (long)7l, (long)8l, (long)9l))), (4l)) == (125l));\n assert(addElements((new ArrayList(Arrays.asList((long)111l, (long)21l, (long)3l, (long)4000l, (long)5l, (long)6l, (long)7l, (long)8l, (long)9l))), (4l)) == (24l));\n assert(addElements((new ArrayList(Arrays.asList((long)1l))), (1l)) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // A simple program which should return the value of x if n is \n // a prime number and should return the value of y otherwise.\n // Examples:\n // >>> xOrY((7l), (34l), (12l))\n // (34l)\n // >>> xOrY((15l), (8l), (5l))\n // (5l)\n public static long xOrY(long n, long x, long y) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(xOrY((7l), (34l), (12l)) == (34l));\n assert(xOrY((15l), (8l), (5l)) == (5l));\n assert(xOrY((3l), (33l), (5212l)) == (33l));\n assert(xOrY((1259l), (3l), (52l)) == (3l));\n assert(xOrY((7919l), (-1l), (12l)) == (-1l));\n assert(xOrY((3609l), (1245l), (583l)) == (583l));\n assert(xOrY((91l), (56l), (129l)) == (129l));\n assert(xOrY((6l), (34l), (1234l)) == (1234l));\n assert(xOrY((1l), (2l), (0l)) == (0l));\n assert(xOrY((2l), (2l), (0l)) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given length of a side and high return area for a triangle.\n // >>> triangleArea((5l), (3l))\n // (7.5f)\n public static float triangleArea(long a, long h) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(triangleArea((5l), (3l)) == (7.5f));\n assert(triangleArea((2l), (2l)) == (2.0f));\n assert(triangleArea((10l), (8l)) == (40.0f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n // the last couple centuries. However, what people don't know is Tribonacci sequence.\n // Tribonacci sequence is defined by the recurrence:\n // tri(1) = 3\n // tri(n) = 1 + n / 2, if n is even.\n // tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n // For example:\n // tri(2) = 1 + (2 / 2) = 2\n // tri(4) = 3\n // tri(3) = tri(2) + tri(1) + tri(4)\n // = 2 + 3 + 3 = 8 \n // You are given a non-negative integer number n, you have to a return an array array list of the \n // first n + 1 numbers of the Tribonacci sequence.\n // Examples:\n // >>> tri((3l))\n // (new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l)))\n public static ArrayList tri(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(tri((3l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l)))));\n assert(tri((4l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l, (long)3l)))));\n assert(tri((5l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l, (long)3l, (long)15l)))));\n assert(tri((6l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l, (long)3l, (long)15l, (long)4l)))));\n assert(tri((7l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l, (long)3l, (long)15l, (long)4l, (long)24l)))));\n assert(tri((8l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l, (long)3l, (long)15l, (long)4l, (long)24l, (long)5l)))));\n assert(tri((9l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l, (long)3l, (long)15l, (long)4l, (long)24l, (long)5l, (long)35l)))));\n assert(tri((20l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l, (long)3l, (long)15l, (long)4l, (long)24l, (long)5l, (long)35l, (long)6l, (long)48l, (long)7l, (long)63l, (long)8l, (long)80l, (long)9l, (long)99l, (long)10l, (long)120l, (long)11l)))));\n assert(tri((0l)).equals((new ArrayList(Arrays.asList((long)1l)))));\n assert(tri((1l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given an array array list of two strings, both strings consist of open\n // parentheses '(' or close parentheses ')' only.\n // Your job is to check if it is possible to concatenate the two strings in\n // some order, that the resulting string will be good.\n // A string S is considered to be good if and only if all parentheses in S\n // are balanced. For example: the string '(())()' is good, while the string\n // '())' is not.\n // Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n // Examples:\n // >>> matchParens((new ArrayList(Arrays.asList((String)\"()(\", (String)\")\"))))\n // (\"Yes\")\n // >>> matchParens((new ArrayList(Arrays.asList((String)\")\", (String)\")\"))))\n // (\"No\")\n public static String matchParens(ArrayList lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(matchParens((new ArrayList(Arrays.asList((String)\"()(\", (String)\")\")))).equals((\"Yes\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\")\", (String)\")\")))).equals((\"No\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\"(()(())\", (String)\"())())\")))).equals((\"No\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\")())\", (String)\"(()()(\")))).equals((\"Yes\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\"(())))\", (String)\"(()())((\")))).equals((\"Yes\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\"()\", (String)\"())\")))).equals((\"No\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\"(()(\", (String)\"()))()\")))).equals((\"Yes\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\"((((\", (String)\"((())\")))).equals((\"No\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\")(()\", (String)\"(()(\")))).equals((\"No\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\")(\", (String)\")(\")))).equals((\"No\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\"(\", (String)\")\")))).equals((\"Yes\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\")\", (String)\"(\")))).equals((\"Yes\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // From an array array list of integers, remove all elements that occur more than once.\n // Keep order of elements left the same as in the input.\n // >>> removeDuplicates((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)2l, (long)4l))))\n // (new ArrayList(Arrays.asList((long)1l, (long)3l, (long)4l)))\n public static ArrayList removeDuplicates(ArrayList numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(removeDuplicates((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(removeDuplicates((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))));\n assert(removeDuplicates((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)2l, (long)4l, (long)3l, (long)5l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)5l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return a greatest common divisor of two integers a and b\n // >>> greatestCommonDivisor((3l), (5l))\n // (1l)\n // >>> greatestCommonDivisor((25l), (15l))\n // (5l)\n public static long greatestCommonDivisor(long a, long b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(greatestCommonDivisor((3l), (7l)) == (1l));\n assert(greatestCommonDivisor((10l), (15l)) == (5l));\n assert(greatestCommonDivisor((49l), (14l)) == (7l));\n assert(greatestCommonDivisor((144l), (60l)) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Checks if given string is a palindrome\n // >>> isPalindrome((\"\"))\n // (true)\n // >>> isPalindrome((\"aba\"))\n // (true)\n // >>> isPalindrome((\"aaaaa\"))\n // (true)\n // >>> isPalindrome((\"zbcd\"))\n // (false)\n public static boolean isPalindrome(String text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(isPalindrome((\"\")) == (true));\n assert(isPalindrome((\"aba\")) == (true));\n assert(isPalindrome((\"aaaaa\")) == (true));\n assert(isPalindrome((\"zbcd\")) == (false));\n assert(isPalindrome((\"xywyx\")) == (true));\n assert(isPalindrome((\"xywyz\")) == (false));\n assert(isPalindrome((\"xywzx\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // xs represent coefficients of a polynomial.\n // xs[0] + xs[1] * x + xs[2] * x^2 + ....\n // Return derivative of this polynomial in the same form.\n // >>> derivative((new ArrayList(Arrays.asList((long)3l, (long)1l, (long)2l, (long)4l, (long)5l))))\n // (new ArrayList(Arrays.asList((long)1l, (long)4l, (long)12l, (long)20l)))\n // >>> derivative((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))))\n // (new ArrayList(Arrays.asList((long)2l, (long)6l)))\n public static ArrayList derivative(ArrayList xs) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(derivative((new ArrayList(Arrays.asList((long)3l, (long)1l, (long)2l, (long)4l, (long)5l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)12l, (long)20l)))));\n assert(derivative((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)6l)))));\n assert(derivative((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)2l)))));\n assert(derivative((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)1l, (long)0l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)2l, (long)0l, (long)16l)))));\n assert(derivative((new ArrayList(Arrays.asList((long)1l)))).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // In this task, you will be given a string that represents a number of apples and oranges \n // that are distributed in a basket of fruit this basket contains \n // apples, oranges, and mango fruits. Given the string that represents the total number of \n // the oranges and apples and an integer that represent the total number of the fruits \n // in the basket return the number of the mango fruits in the basket.\n // for examble:\n // >>> fruitDistribution((\"5 apples and 6 oranges\"), (19l))\n // (8l)\n // >>> fruitDistribution((\"0 apples and 1 oranges\"), (3l))\n // (2l)\n // >>> fruitDistribution((\"2 apples and 3 oranges\"), (100l))\n // (95l)\n // >>> fruitDistribution((\"100 apples and 1 oranges\"), (120l))\n // (19l)\n public static long fruitDistribution(String s, long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(fruitDistribution((\"5 apples and 6 oranges\"), (19l)) == (8l));\n assert(fruitDistribution((\"5 apples and 6 oranges\"), (21l)) == (10l));\n assert(fruitDistribution((\"0 apples and 1 oranges\"), (3l)) == (2l));\n assert(fruitDistribution((\"1 apples and 0 oranges\"), (3l)) == (2l));\n assert(fruitDistribution((\"2 apples and 3 oranges\"), (100l)) == (95l));\n assert(fruitDistribution((\"2 apples and 3 oranges\"), (5l)) == (0l));\n assert(fruitDistribution((\"1 apples and 100 oranges\"), (120l)) == (19l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that takes an integer a and returns true \n // if this ingeger is a cube of some integer number.\n // Note: you may assume the input is always valid.\n // Examples:\n // >>> iscube((1l))\n // (true)\n // >>> iscube((2l))\n // (false)\n // >>> iscube((-1l))\n // (true)\n // >>> iscube((64l))\n // (true)\n // >>> iscube((0l))\n // (true)\n // >>> iscube((180l))\n // (false)\n public static boolean iscube(long a) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(iscube((1l)) == (true));\n assert(iscube((2l)) == (false));\n assert(iscube((-1l)) == (true));\n assert(iscube((64l)) == (true));\n assert(iscube((180l)) == (false));\n assert(iscube((1000l)) == (true));\n assert(iscube((0l)) == (true));\n assert(iscube((1729l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // In this Kata, you have to sort an array array list of non-negative integers according to\n // number of ones in their binary representation in ascending order.\n // For similar number of ones, sort based on decimal value.\n // It must be implemented like this:\n // >>> sortArray((new ArrayList(Arrays.asList((long)1l, (long)5l, (long)2l, (long)3l, (long)4l))))\n // (new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l)))\n // >>> sortArray((new ArrayList(Arrays.asList((long)-2l, (long)-3l, (long)-4l, (long)-5l, (long)-6l))))\n // (new ArrayList(Arrays.asList((long)-6l, (long)-5l, (long)-4l, (long)-3l, (long)-2l)))\n // >>> sortArray((new ArrayList(Arrays.asList((long)1l, (long)0l, (long)2l, (long)3l, (long)4l))))\n // (new ArrayList(Arrays.asList((long)0l, (long)1l, (long)2l, (long)3l, (long)4l)))\n public static ArrayList sortArray(ArrayList arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(sortArray((new ArrayList(Arrays.asList((long)1l, (long)5l, (long)2l, (long)3l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)4l, (long)3l, (long)5l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)-2l, (long)-3l, (long)-4l, (long)-5l, (long)-6l)))).equals((new ArrayList(Arrays.asList((long)-4l, (long)-2l, (long)-6l, (long)-5l, (long)-3l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)1l, (long)0l, (long)2l, (long)3l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)1l, (long)2l, (long)4l, (long)3l)))));\n assert(sortArray((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(sortArray((new ArrayList(Arrays.asList((long)2l, (long)5l, (long)77l, (long)4l, (long)5l, (long)3l, (long)5l, (long)7l, (long)2l, (long)3l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)2l, (long)4l, (long)4l, (long)3l, (long)3l, (long)5l, (long)5l, (long)5l, (long)7l, (long)77l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)3l, (long)6l, (long)44l, (long)12l, (long)32l, (long)5l)))).equals((new ArrayList(Arrays.asList((long)32l, (long)3l, (long)5l, (long)6l, (long)12l, (long)44l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)8l, (long)16l, (long)32l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)8l, (long)16l, (long)32l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)8l, (long)16l, (long)32l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)8l, (long)16l, (long)32l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given an array array list of strings, where each string consists of only digits, return an array array list.\n // Each element i of the output should be \"the number of odd elements in the\n // string i of the input.\" where all the i's should be replaced by the number\n // of odd digits in the i'th string of the input.\n // >>> oddCount((new ArrayList(Arrays.asList((String)\"1234567\"))))\n // (new ArrayList(Arrays.asList((String)\"the number of odd elements 4n the str4ng 4 of the 4nput.\")))\n // >>> oddCount((new ArrayList(Arrays.asList((String)\"3\", (String)\"11111111\"))))\n // (new ArrayList(Arrays.asList((String)\"the number of odd elements 1n the str1ng 1 of the 1nput.\", (String)\"the number of odd elements 8n the str8ng 8 of the 8nput.\")))\n public static ArrayList oddCount(ArrayList lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(oddCount((new ArrayList(Arrays.asList((String)\"1234567\")))).equals((new ArrayList(Arrays.asList((String)\"the number of odd elements 4n the str4ng 4 of the 4nput.\")))));\n assert(oddCount((new ArrayList(Arrays.asList((String)\"3\", (String)\"11111111\")))).equals((new ArrayList(Arrays.asList((String)\"the number of odd elements 1n the str1ng 1 of the 1nput.\", (String)\"the number of odd elements 8n the str8ng 8 of the 8nput.\")))));\n assert(oddCount((new ArrayList(Arrays.asList((String)\"271\", (String)\"137\", (String)\"314\")))).equals((new ArrayList(Arrays.asList((String)\"the number of odd elements 2n the str2ng 2 of the 2nput.\", (String)\"the number of odd elements 3n the str3ng 3 of the 3nput.\", (String)\"the number of odd elements 2n the str2ng 2 of the 2nput.\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // brackets is a string of \"(\" and \")\".\n // return true if every opening bracket has a corresponding closing bracket.\n // >>> correctBracketing((\"(\"))\n // (false)\n // >>> correctBracketing((\"()\"))\n // (true)\n // >>> correctBracketing((\"(()())\"))\n // (true)\n // >>> correctBracketing((\")(()\"))\n // (false)\n public static boolean correctBracketing(String brackets) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(correctBracketing((\"()\")) == (true));\n assert(correctBracketing((\"(()())\")) == (true));\n assert(correctBracketing((\"()()(()())()\")) == (true));\n assert(correctBracketing((\"()()((()()())())(()()(()))\")) == (true));\n assert(correctBracketing((\"((()())))\")) == (false));\n assert(correctBracketing((\")(()\")) == (false));\n assert(correctBracketing((\"(\")) == (false));\n assert(correctBracketing((\"((((\")) == (false));\n assert(correctBracketing((\")\")) == (false));\n assert(correctBracketing((\"(()\")) == (false));\n assert(correctBracketing((\"()()(()())())(()\")) == (false));\n assert(correctBracketing((\"()()(()())()))()\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Task\n // Write a function that takes a string as input and returns the sum of the upper characters only'\n // ASCII codes.\n // Examples:\n // >>> digitSum((\"\"))\n // (0l)\n // >>> digitSum((\"abAB\"))\n // (131l)\n // >>> digitSum((\"abcCd\"))\n // (67l)\n // >>> digitSum((\"helloE\"))\n // (69l)\n // >>> digitSum((\"woArBld\"))\n // (131l)\n // >>> digitSum((\"aAaaaXa\"))\n // (153l)\n public static long digitSum(String s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(digitSum((\"\")) == (0l));\n assert(digitSum((\"abAB\")) == (131l));\n assert(digitSum((\"abcCd\")) == (67l));\n assert(digitSum((\"helloE\")) == (69l));\n assert(digitSum((\"woArBld\")) == (131l));\n assert(digitSum((\"aAaaaXa\")) == (153l));\n assert(digitSum((\" How are yOu?\")) == (151l));\n assert(digitSum((\"You arE Very Smart\")) == (327l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that accepts an array array list of strings as a parameter,\n // deletes the strings that have odd lengths from it,\n // and returns the resulted array list with a sorted order,\n // The array list is always an array array list of strings and never an array array list of numbers,\n // and it may contain duplicates.\n // The order of the array list should be ascending by length of each word, and you\n // should return the array list sorted by that rule.\n // If two words have the same length, sort the array list alphabetically.\n // The function should return an array array list of strings in sorted order.\n // You may assume that all words will have the same length.\n // For example:\n // >>> listSort((new ArrayList(Arrays.asList((String)\"aa\", (String)\"a\", (String)\"aaa\"))))\n // (new ArrayList(Arrays.asList((String)\"aa\")))\n // >>> listSort((new ArrayList(Arrays.asList((String)\"ab\", (String)\"a\", (String)\"aaa\", (String)\"cd\"))))\n // (new ArrayList(Arrays.asList((String)\"ab\", (String)\"cd\")))\n public static ArrayList sortedListSum(ArrayList lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(sortedListSum((new ArrayList(Arrays.asList((String)\"aa\", (String)\"a\", (String)\"aaa\")))).equals((new ArrayList(Arrays.asList((String)\"aa\")))));\n assert(sortedListSum((new ArrayList(Arrays.asList((String)\"school\", (String)\"AI\", (String)\"asdf\", (String)\"b\")))).equals((new ArrayList(Arrays.asList((String)\"AI\", (String)\"asdf\", (String)\"school\")))));\n assert(sortedListSum((new ArrayList(Arrays.asList((String)\"d\", (String)\"b\", (String)\"c\", (String)\"a\")))).equals((new ArrayList(Arrays.asList()))));\n assert(sortedListSum((new ArrayList(Arrays.asList((String)\"d\", (String)\"dcba\", (String)\"abcd\", (String)\"a\")))).equals((new ArrayList(Arrays.asList((String)\"abcd\", (String)\"dcba\")))));\n assert(sortedListSum((new ArrayList(Arrays.asList((String)\"AI\", (String)\"ai\", (String)\"au\")))).equals((new ArrayList(Arrays.asList((String)\"AI\", (String)\"ai\", (String)\"au\")))));\n assert(sortedListSum((new ArrayList(Arrays.asList((String)\"a\", (String)\"b\", (String)\"b\", (String)\"c\", (String)\"c\", (String)\"a\")))).equals((new ArrayList(Arrays.asList()))));\n assert(sortedListSum((new ArrayList(Arrays.asList((String)\"aaaa\", (String)\"bbbb\", (String)\"dd\", (String)\"cc\")))).equals((new ArrayList(Arrays.asList((String)\"cc\", (String)\"dd\", (String)\"aaaa\", (String)\"bbbb\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given an array array list arr of integers and you need to return\n // sum of magnitudes of integers multiplied by product of all signs\n // of each number in the array array list, represented by 1, -1 or 0.\n // Note: return null for empty arr.\n // Example:\n // >>> prodSigns((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)2l, (long)-4l))))\n // 9l\n // >>> prodSigns((new ArrayList(Arrays.asList((long)0l, (long)1l))))\n // 0l\n // >>> prodSigns((new ArrayList(Arrays.asList())))\n // Optional.empty()\n public static Optional prodSigns(ArrayList arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(prodSigns((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)2l, (long)-4l)))).equals(-9l));\n assert(prodSigns((new ArrayList(Arrays.asList((long)0l, (long)1l)))).equals(0l));\n assert(prodSigns((new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)2l, (long)3l, (long)-1l, (long)1l)))).equals(-10l));\n assert(prodSigns((new ArrayList(Arrays.asList()))).equals(Optional.empty()));\n assert(prodSigns((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)1l, (long)2l, (long)-1l, (long)-1l, (long)9l)))).equals(20l));\n assert(prodSigns((new ArrayList(Arrays.asList((long)-1l, (long)1l, (long)-1l, (long)1l)))).equals(4l));\n assert(prodSigns((new ArrayList(Arrays.asList((long)-1l, (long)1l, (long)1l, (long)1l)))).equals(-4l));\n assert(prodSigns((new ArrayList(Arrays.asList((long)-1l, (long)1l, (long)1l, (long)0l)))).equals(0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return array list with elements incremented by 1.\n // >>> incrList((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))))\n // (new ArrayList(Arrays.asList((long)2l, (long)3l, (long)4l)))\n // >>> incrList((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)5l, (long)2l, (long)3l, (long)3l, (long)9l, (long)0l, (long)123l))))\n // (new ArrayList(Arrays.asList((long)6l, (long)4l, (long)6l, (long)3l, (long)4l, (long)4l, (long)10l, (long)1l, (long)124l)))\n public static ArrayList incrList(ArrayList l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(incrList((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(incrList((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)4l, (long)3l, (long)2l)))));\n assert(incrList((new ArrayList(Arrays.asList((long)5l, (long)2l, (long)5l, (long)2l, (long)3l, (long)3l, (long)9l, (long)0l, (long)123l)))).equals((new ArrayList(Arrays.asList((long)6l, (long)3l, (long)6l, (long)3l, (long)4l, (long)4l, (long)10l, (long)1l, (long)124l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // From a given array list of integers, generate an array array list of rolling maximum element found until given moment\n // in the sequence.\n // >>> rollingMax((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)2l, (long)3l, (long)4l, (long)2l))))\n // (new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)3l, (long)3l, (long)4l, (long)4l)))\n public static ArrayList rollingMax(ArrayList numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(rollingMax((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(rollingMax((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))));\n assert(rollingMax((new ArrayList(Arrays.asList((long)4l, (long)3l, (long)2l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)4l, (long)4l, (long)4l, (long)4l)))));\n assert(rollingMax((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)3l, (long)100l, (long)3l)))).equals((new ArrayList(Arrays.asList((long)3l, (long)3l, (long)3l, (long)100l, (long)100l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n // separate those group into separate strings and return the array list of those.\n // Separate groups are balanced (each open brace is properly closed) and not nested within each other\n // Ignore any spaces in the input string.\n // >>> separateParenGroups((\"( ) (( )) (( )( ))\"))\n // (new ArrayList(Arrays.asList((String)\"()\", (String)\"(())\", (String)\"(()())\")))\n public static ArrayList separateParenGroups(String paren_string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(separateParenGroups((\"(()()) ((())) () ((())()())\")).equals((new ArrayList(Arrays.asList((String)\"(()())\", (String)\"((()))\", (String)\"()\", (String)\"((())()())\")))));\n assert(separateParenGroups((\"() (()) ((())) (((())))\")).equals((new ArrayList(Arrays.asList((String)\"()\", (String)\"(())\", (String)\"((()))\", (String)\"(((())))\")))));\n assert(separateParenGroups((\"(()(())((())))\")).equals((new ArrayList(Arrays.asList((String)\"(()(())((())))\")))));\n assert(separateParenGroups((\"( ) (( )) (( )( ))\")).equals((new ArrayList(Arrays.asList((String)\"()\", (String)\"(())\", (String)\"(()())\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You will be given a string of words separated by commas or spaces. Your task is\n // to split the string into words and return an array array list of the words.\n // For example:\n // >>> wordsString((\"Hi, my name is John\"))\n // (new ArrayList(Arrays.asList((String)\"Hi\", (String)\"my\", (String)\"name\", (String)\"is\", (String)\"John\")))\n // >>> wordsString((\"One, two, three, four, five, six\"))\n // (new ArrayList(Arrays.asList((String)\"One\", (String)\"two\", (String)\"three\", (String)\"four\", (String)\"five\", (String)\"six\")))\n public static ArrayList wordsString(String s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(wordsString((\"Hi, my name is John\")).equals((new ArrayList(Arrays.asList((String)\"Hi\", (String)\"my\", (String)\"name\", (String)\"is\", (String)\"John\")))));\n assert(wordsString((\"One, two, three, four, five, six\")).equals((new ArrayList(Arrays.asList((String)\"One\", (String)\"two\", (String)\"three\", (String)\"four\", (String)\"five\", (String)\"six\")))));\n assert(wordsString((\"Hi, my name\")).equals((new ArrayList(Arrays.asList((String)\"Hi\", (String)\"my\", (String)\"name\")))));\n assert(wordsString((\"One,, two, three, four, five, six,\")).equals((new ArrayList(Arrays.asList((String)\"One\", (String)\"two\", (String)\"three\", (String)\"four\", (String)\"five\", (String)\"six\")))));\n assert(wordsString((\"\")).equals((new ArrayList(Arrays.asList()))));\n assert(wordsString((\"ahmed , gamal\")).equals((new ArrayList(Arrays.asList((String)\"ahmed\", (String)\"gamal\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Filter given array list of any javathon values only for integers\n // >>> filterIntegers((new ArrayList(Arrays.asList((String)\"a\", (String)3.14f, (String)5l))))\n // (new ArrayList(Arrays.asList((long)5l)))\n // >>> filterIntegers((new ArrayList(Arrays.asList(1l, 2l, 3l, \"abc\", new HashMap(Map.of()), new ArrayList(Arrays.asList())))))\n // (new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)))\n public static ArrayList filterIntegers(ArrayList values) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(filterIntegers((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(filterIntegers((new ArrayList(Arrays.asList(4l, new HashMap(Map.of()), new ArrayList(Arrays.asList()), 23.2f, 9l, \"adasd\")))).equals((new ArrayList(Arrays.asList((long)4l, (long)9l)))));\n assert(filterIntegers((new ArrayList(Arrays.asList(3l, \"c\", 3l, 3l, \"a\", \"b\")))).equals((new ArrayList(Arrays.asList((long)3l, (long)3l, (long)3l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // This function takes an array array list l and returns an array array list l' such that\n // l' is identical to l in the odd indicies, while its values at the even indicies are equal\n // to the values of the even indicies of l, but sorted.\n // >>> sortEven((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))))\n // (new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)))\n // >>> sortEven((new ArrayList(Arrays.asList((long)5l, (long)6l, (long)3l, (long)4l))))\n // (new ArrayList(Arrays.asList((long)3l, (long)6l, (long)5l, (long)4l)))\n public static ArrayList sortEven(ArrayList l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(sortEven((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)))));\n assert(sortEven((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)-5l, (long)2l, (long)-3l, (long)3l, (long)9l, (long)0l, (long)123l, (long)1l, (long)-10l)))).equals((new ArrayList(Arrays.asList((long)-10l, (long)3l, (long)-5l, (long)2l, (long)-3l, (long)3l, (long)5l, (long)0l, (long)9l, (long)1l, (long)123l)))));\n assert(sortEven((new ArrayList(Arrays.asList((long)5l, (long)8l, (long)-12l, (long)4l, (long)23l, (long)2l, (long)3l, (long)11l, (long)12l, (long)-10l)))).equals((new ArrayList(Arrays.asList((long)-12l, (long)8l, (long)3l, (long)4l, (long)5l, (long)2l, (long)12l, (long)11l, (long)23l, (long)-10l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // I think we all remember that feeling when the result of some long-awaited\n // event is finally known. The feelings and thoughts you have at that moment are\n // definitely worth noting down and comparing.\n // Your task is to determine if a person correctly guessed the results of a number of matches.\n // You are given two array array lists of scores and guesses of equal length, where each index shows a match. \n // Return an array array list of the same length denoting how far off each guess was. If they have guessed correctly,\n // the value is 0, and if not, the value is the absolute difference between the guess and the score.\n // example:\n // >>> compare((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)1l))), (new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)2l, (long)-2l))))\n // (new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l, (long)0l, (long)3l, (long)3l)))\n // >>> compare((new ArrayList(Arrays.asList((long)0l, (long)5l, (long)0l, (long)0l, (long)0l, (long)4l))), (new ArrayList(Arrays.asList((long)4l, (long)1l, (long)1l, (long)0l, (long)0l, (long)-2l))))\n // (new ArrayList(Arrays.asList((long)4l, (long)4l, (long)1l, (long)0l, (long)0l, (long)6l)))\n public static ArrayList compare(ArrayList game, ArrayList guess) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(compare((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)1l))), (new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)2l, (long)-2l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l, (long)0l, (long)3l, (long)3l)))));\n assert(compare((new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l, (long)0l, (long)0l, (long)0l))), (new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l, (long)0l, (long)0l, (long)0l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l, (long)0l, (long)0l, (long)0l)))));\n assert(compare((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))), (new ArrayList(Arrays.asList((long)-1l, (long)-2l, (long)-3l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)6l)))));\n assert(compare((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)5l))), (new ArrayList(Arrays.asList((long)-1l, (long)2l, (long)3l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)0l, (long)0l, (long)1l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a positive integer n, return a pair that has the number of even and odd\n // integer palindromes that fall within the range(1, n), inclusive.\n // Example 1:\n // >>> evenOddPalindrome((3l))\n // (Pair.with(1l, 2l))\n // Explanation:\n // Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n // Example 2:\n // >>> evenOddPalindrome((12l))\n // (Pair.with(4l, 6l))\n // Explanation:\n // Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n // Note:\n // 1. 1 <= n <= 10^3\n // 2. returned pair has the number of even and odd integer palindromes respectively.\n public static Pair evenOddPalindrome(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(evenOddPalindrome((123l)).equals((Pair.with(8l, 13l))));\n assert(evenOddPalindrome((12l)).equals((Pair.with(4l, 6l))));\n assert(evenOddPalindrome((3l)).equals((Pair.with(1l, 2l))));\n assert(evenOddPalindrome((63l)).equals((Pair.with(6l, 8l))));\n assert(evenOddPalindrome((25l)).equals((Pair.with(5l, 6l))));\n assert(evenOddPalindrome((19l)).equals((Pair.with(4l, 6l))));\n assert(evenOddPalindrome((9l)).equals((Pair.with(4l, 5l))));\n assert(evenOddPalindrome((1l)).equals((Pair.with(0l, 1l))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n // fib4(0) -> 0\n // fib4(1) -> 0\n // fib4(2) -> 2\n // fib4(3) -> 0\n // fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n // Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n // >>> fib4((5l))\n // (4l)\n // >>> fib4((6l))\n // (8l)\n // >>> fib4((7l))\n // (14l)\n public static long fib4(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(fib4((5l)) == (4l));\n assert(fib4((8l)) == (28l));\n assert(fib4((10l)) == (104l));\n assert(fib4((12l)) == (386l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given two positive integers a and b, return the even digits between a\n // and b, in ascending order.\n // For example:\n // >>> generateIntegers((2l), (8l))\n // (new ArrayList(Arrays.asList((long)2l, (long)4l, (long)6l, (long)8l)))\n // >>> generateIntegers((8l), (2l))\n // (new ArrayList(Arrays.asList((long)2l, (long)4l, (long)6l, (long)8l)))\n // >>> generateIntegers((10l), (14l))\n // (new ArrayList(Arrays.asList()))\n public static ArrayList generateIntegers(long a, long b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(generateIntegers((2l), (10l)).equals((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)6l, (long)8l)))));\n assert(generateIntegers((10l), (2l)).equals((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)6l, (long)8l)))));\n assert(generateIntegers((132l), (2l)).equals((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)6l, (long)8l)))));\n assert(generateIntegers((17l), (89l)).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // For a given array list of input numbers, calculate Mean Absolute Deviation\n // around the mean of this dataset.\n // Mean Absolute Deviation is the average absolute difference between each\n // element and a centerpoint (mean in this case):\n // MAD = average | x - x_mean |\n // >>> meanAbsoluteDeviation((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f))))\n // (1.0f)\n public static float meanAbsoluteDeviation(ArrayList numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(meanAbsoluteDeviation((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f)))) == (0.5f));\n assert(meanAbsoluteDeviation((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f)))) == (1.0f));\n assert(meanAbsoluteDeviation((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f)))) == (1.2f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function encrypt that takes a string as an argument and\n // returns a string encrypted with the alphabet being rotated. \n // The alphabet should be rotated in a manner such that the letters \n // shift down by two multiplied to two places.\n // For example:\n // >>> encrypt((\"hi\"))\n // (\"lm\")\n // >>> encrypt((\"asdfghjkl\"))\n // (\"ewhjklnop\")\n // >>> encrypt((\"gf\"))\n // (\"kj\")\n // >>> encrypt((\"et\"))\n // (\"ix\")\n public static String encrypt(String s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(encrypt((\"hi\")).equals((\"lm\")));\n assert(encrypt((\"asdfghjkl\")).equals((\"ewhjklnop\")));\n assert(encrypt((\"gf\")).equals((\"kj\")));\n assert(encrypt((\"et\")).equals((\"ix\")));\n assert(encrypt((\"faewfawefaewg\")).equals((\"jeiajeaijeiak\")));\n assert(encrypt((\"hellomyfriend\")).equals((\"lippsqcjvmirh\")));\n assert(encrypt((\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\")).equals((\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\")));\n assert(encrypt((\"a\")).equals((\"e\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a positive integer n, return a sorted array list that has the odd numbers in collatz sequence.\n // The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n // as follows: start with any positive integer n. Then each term is obtained from the \n // previous term as follows: if the previous term is even, the next term is one half of \n // the previous term. If the previous term is odd, the next term is 3 times the previous\n // term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n // Note: \n // 1. Collatz(1) is [1].\n // 2. returned array list sorted in increasing order.\n // For example:\n // get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n // >>> getOddCollatz((5l))\n // (new ArrayList(Arrays.asList((long)1l, (long)5l)))\n public static ArrayList getOddCollatz(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(getOddCollatz((14l)).equals((new ArrayList(Arrays.asList((long)1l, (long)5l, (long)7l, (long)11l, (long)13l, (long)17l)))));\n assert(getOddCollatz((5l)).equals((new ArrayList(Arrays.asList((long)1l, (long)5l)))));\n assert(getOddCollatz((12l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)5l)))));\n assert(getOddCollatz((1l)).equals((new ArrayList(Arrays.asList((long)1l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Find how many times a given substring can be found in the original string. Count overlaping cases.\n // >>> howManyTimes((\"\"), (\"a\"))\n // (0l)\n // >>> howManyTimes((\"aaa\"), (\"a\"))\n // (3l)\n // >>> howManyTimes((\"aaaa\"), (\"aa\"))\n // (3l)\n public static long howManyTimes(String string, String substring) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(howManyTimes((\"\"), (\"x\")) == (0l));\n assert(howManyTimes((\"xyxyxyx\"), (\"x\")) == (4l));\n assert(howManyTimes((\"cacacacac\"), (\"cac\")) == (4l));\n assert(howManyTimes((\"john doe\"), (\"john\")) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // We have an array array list 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n // numbers in the array array list will be randomly ordered. Your task is to determine if\n // it is possible to get an array array list sorted in non-decreasing order by performing \n // the following operation on the given array array list:\n // You are allowed to perform right shift operation any number of times.\n // One right shift operation means shifting all elements of the array array list by one\n // position in the right direction. The last element of the array array list will be moved to\n // the starting position in the array array list i.e. 0th index. \n // If it is possible to obtain the sorted array array list by performing the above operation\n // then return true else return false.\n // If the given array array list is empty then return true.\n // Note: The given array list is guaranteed to have unique elements.\n // For Example:\n // >>> moveOneBall((new ArrayList(Arrays.asList((long)3l, (long)4l, (long)5l, (long)1l, (long)2l))))\n // (true)\n // Explanation: By performin 2 right shift operations, non-decreasing order can\n // be achieved for the given array array list.\n // >>> moveOneBall((new ArrayList(Arrays.asList((long)3l, (long)5l, (long)4l, (long)1l, (long)2l))))\n // (false)\n // Explanation:It is not possible to get non-decreasing order for the given\n // array array list by performing any number of right shift operations.\n public static boolean moveOneBall(ArrayList arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(moveOneBall((new ArrayList(Arrays.asList((long)3l, (long)4l, (long)5l, (long)1l, (long)2l)))) == (true));\n assert(moveOneBall((new ArrayList(Arrays.asList((long)3l, (long)5l, (long)10l, (long)1l, (long)2l)))) == (true));\n assert(moveOneBall((new ArrayList(Arrays.asList((long)4l, (long)3l, (long)1l, (long)2l)))) == (false));\n assert(moveOneBall((new ArrayList(Arrays.asList((long)3l, (long)5l, (long)4l, (long)1l, (long)2l)))) == (false));\n assert(moveOneBall((new ArrayList(Arrays.asList()))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function which sorts the given array list of integers\n // in ascending order according to the sum of their digits.\n // Note: if there are several items with similar sum of their digits,\n // order them based on their index in original array list.\n // For example:\n // >>> orderByPoints((new ArrayList(Arrays.asList((long)1l, (long)11l, (long)-1l, (long)-11l, (long)-12l))))\n // (new ArrayList(Arrays.asList((long)-1l, (long)-11l, (long)1l, (long)-12l, (long)11l)))\n // >>> orderByPoints((new ArrayList(Arrays.asList())))\n // (new ArrayList(Arrays.asList()))\n public static ArrayList orderByPoints(ArrayList nums) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(orderByPoints((new ArrayList(Arrays.asList((long)1l, (long)11l, (long)-1l, (long)-11l, (long)-12l)))).equals((new ArrayList(Arrays.asList((long)-1l, (long)-11l, (long)1l, (long)-12l, (long)11l)))));\n assert(orderByPoints((new ArrayList(Arrays.asList((long)1234l, (long)423l, (long)463l, (long)145l, (long)2l, (long)423l, (long)423l, (long)53l, (long)6l, (long)37l, (long)3457l, (long)3l, (long)56l, (long)0l, (long)46l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)2l, (long)3l, (long)6l, (long)53l, (long)423l, (long)423l, (long)423l, (long)1234l, (long)145l, (long)37l, (long)46l, (long)56l, (long)463l, (long)3457l)))));\n assert(orderByPoints((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(orderByPoints((new ArrayList(Arrays.asList((long)1l, (long)-11l, (long)-32l, (long)43l, (long)54l, (long)-98l, (long)2l, (long)-3l)))).equals((new ArrayList(Arrays.asList((long)-3l, (long)-32l, (long)-98l, (long)-11l, (long)1l, (long)2l, (long)43l, (long)54l)))));\n assert(orderByPoints((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l, (long)7l, (long)8l, (long)9l, (long)10l, (long)11l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)10l, (long)2l, (long)11l, (long)3l, (long)4l, (long)5l, (long)6l, (long)7l, (long)8l, (long)9l)))));\n assert(orderByPoints((new ArrayList(Arrays.asList((long)0l, (long)6l, (long)6l, (long)-76l, (long)-21l, (long)23l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)-76l, (long)-21l, (long)0l, (long)4l, (long)23l, (long)6l, (long)6l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return array list of prime factors of given integer in the order from smallest to largest.\n // Each of the factors should be array listed number of times corresponding to how many times it appeares in factorization.\n // Input number should be equal to the product of all factors\n // >>> factorize((8l))\n // (new ArrayList(Arrays.asList((long)2l, (long)2l, (long)2l)))\n // >>> factorize((25l))\n // (new ArrayList(Arrays.asList((long)5l, (long)5l)))\n // >>> factorize((70l))\n // (new ArrayList(Arrays.asList((long)2l, (long)5l, (long)7l)))\n public static ArrayList factorize(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(factorize((2l)).equals((new ArrayList(Arrays.asList((long)2l)))));\n assert(factorize((4l)).equals((new ArrayList(Arrays.asList((long)2l, (long)2l)))));\n assert(factorize((8l)).equals((new ArrayList(Arrays.asList((long)2l, (long)2l, (long)2l)))));\n assert(factorize((57l)).equals((new ArrayList(Arrays.asList((long)3l, (long)19l)))));\n assert(factorize((3249l)).equals((new ArrayList(Arrays.asList((long)3l, (long)3l, (long)19l, (long)19l)))));\n assert(factorize((185193l)).equals((new ArrayList(Arrays.asList((long)3l, (long)3l, (long)3l, (long)19l, (long)19l, (long)19l)))));\n assert(factorize((20577l)).equals((new ArrayList(Arrays.asList((long)3l, (long)19l, (long)19l, (long)19l)))));\n assert(factorize((18l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)3l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return true if all numbers in the array list l are below threshold t.\n // >>> belowThreshold((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)4l, (long)10l))), (100l))\n // (true)\n // >>> belowThreshold((new ArrayList(Arrays.asList((long)1l, (long)20l, (long)4l, (long)10l))), (5l))\n // (false)\n public static boolean belowThreshold(ArrayList l, long t) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(belowThreshold((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)4l, (long)10l))), (100l)) == (true));\n assert(belowThreshold((new ArrayList(Arrays.asList((long)1l, (long)20l, (long)4l, (long)10l))), (5l)) == (false));\n assert(belowThreshold((new ArrayList(Arrays.asList((long)1l, (long)20l, (long)4l, (long)10l))), (21l)) == (true));\n assert(belowThreshold((new ArrayList(Arrays.asList((long)1l, (long)20l, (long)4l, (long)10l))), (22l)) == (true));\n assert(belowThreshold((new ArrayList(Arrays.asList((long)1l, (long)8l, (long)4l, (long)10l))), (11l)) == (true));\n assert(belowThreshold((new ArrayList(Arrays.asList((long)1l, (long)8l, (long)4l, (long)10l))), (10l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n // For each of the group, output the deepest level of nesting of parentheses.\n // E.g. (()()) has maximum two levels of nesting while ((())) has three.\n // >>> parseNestedParens((\"(()()) ((())) () ((())()())\"))\n // (new ArrayList(Arrays.asList((long)2l, (long)3l, (long)1l, (long)3l)))\n public static ArrayList parseNestedParens(String paren_string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(parseNestedParens((\"(()()) ((())) () ((())()())\")).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)1l, (long)3l)))));\n assert(parseNestedParens((\"() (()) ((())) (((())))\")).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))));\n assert(parseNestedParens((\"(()(())((())))\")).equals((new ArrayList(Arrays.asList((long)4l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a non-empty array list of integers, return the sum of all of the odd elements that are in even positions.\n // Examples\n // >>> solution((new ArrayList(Arrays.asList((long)5l, (long)8l, (long)7l, (long)1l))))\n // (12l)\n // >>> solution((new ArrayList(Arrays.asList((long)3l, (long)3l, (long)3l, (long)3l, (long)3l))))\n // (9l)\n // >>> solution((new ArrayList(Arrays.asList((long)30l, (long)13l, (long)24l, (long)321l))))\n // (0l)\n public static long solution(ArrayList lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(solution((new ArrayList(Arrays.asList((long)5l, (long)8l, (long)7l, (long)1l)))) == (12l));\n assert(solution((new ArrayList(Arrays.asList((long)3l, (long)3l, (long)3l, (long)3l, (long)3l)))) == (9l));\n assert(solution((new ArrayList(Arrays.asList((long)30l, (long)13l, (long)24l, (long)321l)))) == (0l));\n assert(solution((new ArrayList(Arrays.asList((long)5l, (long)9l)))) == (5l));\n assert(solution((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)8l)))) == (0l));\n assert(solution((new ArrayList(Arrays.asList((long)30l, (long)13l, (long)23l, (long)32l)))) == (23l));\n assert(solution((new ArrayList(Arrays.asList((long)3l, (long)13l, (long)2l, (long)9l)))) == (3l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a positive integer n. You have to create an integer array array list a of length n.\n // For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n // Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n // and a[i] + a[j] + a[k] is a multiple of 3.\n // Example :\n // >>> getMaxTriples((5l))\n // (1l)\n // Explanation: \n // a = [1, 3, 7, 13, 21]\n // The only valid triple is (1, 7, 13).\n public static long getMaxTriples(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(getMaxTriples((5l)) == (1l));\n assert(getMaxTriples((6l)) == (4l));\n assert(getMaxTriples((10l)) == (36l));\n assert(getMaxTriples((100l)) == (53361l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // There are eight planets in our solar system: the closerst to the Sun \n // is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n // Uranus, Neptune.\n // Write a function that takes two planet names as strings planet1 and planet2. \n // The function should return a pair containing all planets whose orbits are \n // located between the orbit of planet1 and the orbit of planet2, sorted by \n // the proximity to the sun. \n // The function should return an empty pair if planet1 or planet2\n // are not correct planet names. \n // Examples\n // >>> bf((\"Jupiter\"), (\"Neptune\"))\n // (new ArrayList(Arrays.asList((String)\"Saturn\", (String)\"Uranus\")))\n // >>> bf((\"Earth\"), (\"Mercury\"))\n // (ArrayList(\"Venus\"))\n // >>> bf((\"Mercury\"), (\"Uranus\"))\n // (new ArrayList(Arrays.asList((String)\"Venus\", (String)\"Earth\", (String)\"Mars\", (String)\"Jupiter\", (String)\"Saturn\")))\n public static ArrayList bf(String planet1, String planet2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(bf((\"Jupiter\"), (\"Neptune\")).equals((new ArrayList(Arrays.asList((String)\"Saturn\", (String)\"Uranus\")))));\n assert(bf((\"Earth\"), (\"Mercury\")).equals((new ArrayList(Arrays.asList((String)\"Venus\")))));\n assert(bf((\"Mercury\"), (\"Uranus\")).equals((new ArrayList(Arrays.asList((String)\"Venus\", (String)\"Earth\", (String)\"Mars\", (String)\"Jupiter\", (String)\"Saturn\")))));\n assert(bf((\"Neptune\"), (\"Venus\")).equals((new ArrayList(Arrays.asList((String)\"Earth\", (String)\"Mars\", (String)\"Jupiter\", (String)\"Saturn\", (String)\"Uranus\")))));\n assert(bf((\"Earth\"), (\"Earth\")).equals((new ArrayList(Arrays.asList()))));\n assert(bf((\"Mars\"), (\"Earth\")).equals((new ArrayList(Arrays.asList()))));\n assert(bf((\"Jupiter\"), (\"Makemake\")).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given an array array list of integers.\n // Write a function next_smallest() that returns the 2nd smallest element of the array list.\n // Return null if there is no such element.\n // >>> nextSmallest((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l))))\n // 2l\n // >>> nextSmallest((new ArrayList(Arrays.asList((long)5l, (long)1l, (long)4l, (long)3l, (long)2l))))\n // 2l\n // >>> nextSmallest((new ArrayList(Arrays.asList())))\n // Optional.empty()\n // >>> nextSmallest((new ArrayList(Arrays.asList((long)1l, (long)1l))))\n // Optional.empty()\n public static Optional nextSmallest(ArrayList lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(nextSmallest((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l)))).equals(2l));\n assert(nextSmallest((new ArrayList(Arrays.asList((long)5l, (long)1l, (long)4l, (long)3l, (long)2l)))).equals(2l));\n assert(nextSmallest((new ArrayList(Arrays.asList()))).equals(Optional.empty()));\n assert(nextSmallest((new ArrayList(Arrays.asList((long)1l, (long)1l)))).equals(Optional.empty()));\n assert(nextSmallest((new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l, (long)0l)))).equals(1l));\n assert(nextSmallest((new ArrayList(Arrays.asList((long)1l, (long)1l)))).equals(Optional.empty()));\n assert(nextSmallest((new ArrayList(Arrays.asList((long)-35l, (long)34l, (long)12l, (long)-45l)))).equals(-35l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Input is a space-delimited string of numberals from 'zero' to 'nine'.\n // Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n // Return the string with numbers sorted from smallest to largest\n // >>> sortNumbers((\"three one five\"))\n // (\"one three five\")\n public static String sortNumbers(String numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(sortNumbers((\"\")).equals((\"\")));\n assert(sortNumbers((\"three\")).equals((\"three\")));\n assert(sortNumbers((\"three five nine\")).equals((\"three five nine\")));\n assert(sortNumbers((\"five zero four seven nine eight\")).equals((\"zero four five seven eight nine\")));\n assert(sortNumbers((\"six five four three two one zero\")).equals((\"zero one two three four five six\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given 2 words. You need to return true if the second word or any of its rotations is a substring in the first word\n // >>> cycpatternCheck((\"abcd\"), (\"abd\"))\n // (false)\n // >>> cycpatternCheck((\"hello\"), (\"ell\"))\n // (true)\n // >>> cycpatternCheck((\"whassup\"), (\"psus\"))\n // (false)\n // >>> cycpatternCheck((\"abab\"), (\"baa\"))\n // (true)\n // >>> cycpatternCheck((\"efef\"), (\"eeff\"))\n // (false)\n // >>> cycpatternCheck((\"himenss\"), (\"simen\"))\n // (true)\n public static boolean cycpatternCheck(String a, String b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(cycpatternCheck((\"xyzw\"), (\"xyw\")) == (false));\n assert(cycpatternCheck((\"yello\"), (\"ell\")) == (true));\n assert(cycpatternCheck((\"whattup\"), (\"ptut\")) == (false));\n assert(cycpatternCheck((\"efef\"), (\"fee\")) == (true));\n assert(cycpatternCheck((\"abab\"), (\"aabb\")) == (false));\n assert(cycpatternCheck((\"winemtt\"), (\"tinem\")) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You will be given a number in decimal form and your task is to convert it to\n // binary format. The function should return a string, with each character representing a binary\n // number. Each character in the string will be '0' or '1'.\n // There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n // The extra characters are there to help with the format.\n // Examples:\n // >>> decimalToBinary((15l))\n // (\"db1111db\")\n // >>> decimalToBinary((32l))\n // (\"db100000db\")\n public static String decimalToBinary(long decimal) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(decimalToBinary((0l)).equals((\"db0db\")));\n assert(decimalToBinary((32l)).equals((\"db100000db\")));\n assert(decimalToBinary((103l)).equals((\"db1100111db\")));\n assert(decimalToBinary((15l)).equals((\"db1111db\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Filter an input array list of strings only for ones that contain given substring\n // >>> filterBySubstring((new ArrayList(Arrays.asList())), (\"a\"))\n // (new ArrayList(Arrays.asList()))\n // >>> filterBySubstring((new ArrayList(Arrays.asList((String)\"abc\", (String)\"bacd\", (String)\"cde\", (String)\"array\"))), (\"a\"))\n // (new ArrayList(Arrays.asList((String)\"abc\", (String)\"bacd\", (String)\"array\")))\n public static ArrayList filterBySubstring(ArrayList strings, String substring) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(filterBySubstring((new ArrayList(Arrays.asList())), (\"john\")).equals((new ArrayList(Arrays.asList()))));\n assert(filterBySubstring((new ArrayList(Arrays.asList((String)\"xxx\", (String)\"asd\", (String)\"xxy\", (String)\"john doe\", (String)\"xxxAAA\", (String)\"xxx\"))), (\"xxx\")).equals((new ArrayList(Arrays.asList((String)\"xxx\", (String)\"xxxAAA\", (String)\"xxx\")))));\n assert(filterBySubstring((new ArrayList(Arrays.asList((String)\"xxx\", (String)\"asd\", (String)\"aaaxxy\", (String)\"john doe\", (String)\"xxxAAA\", (String)\"xxx\"))), (\"xx\")).equals((new ArrayList(Arrays.asList((String)\"xxx\", (String)\"aaaxxy\", (String)\"xxxAAA\", (String)\"xxx\")))));\n assert(filterBySubstring((new ArrayList(Arrays.asList((String)\"grunt\", (String)\"trumpet\", (String)\"prune\", (String)\"gruesome\"))), (\"run\")).equals((new ArrayList(Arrays.asList((String)\"grunt\", (String)\"prune\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given an integer. return a pair that has the number of even and odd digits respectively.\n // Example:\n // >>> evenOddCount((-12l))\n // (Pair.with(1l, 1l))\n // >>> evenOddCount((123l))\n // (Pair.with(1l, 2l))\n public static Pair evenOddCount(long num) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(evenOddCount((7l)).equals((Pair.with(0l, 1l))));\n assert(evenOddCount((-78l)).equals((Pair.with(1l, 1l))));\n assert(evenOddCount((3452l)).equals((Pair.with(2l, 2l))));\n assert(evenOddCount((346211l)).equals((Pair.with(3l, 3l))));\n assert(evenOddCount((-345821l)).equals((Pair.with(3l, 3l))));\n assert(evenOddCount((-2l)).equals((Pair.with(1l, 0l))));\n assert(evenOddCount((-45347l)).equals((Pair.with(2l, 3l))));\n assert(evenOddCount((0l)).equals((Pair.with(1l, 0l))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that accepts an array array list of strings.\n // The array list contains different words. Return the word with maximum number\n // of unique characters. If multiple strings have maximum number of unique\n // characters, return the one which comes first in lexicographical order.\n // >>> findMax((new ArrayList(Arrays.asList((String)\"name\", (String)\"of\", (String)\"string\"))))\n // (\"string\")\n // >>> findMax((new ArrayList(Arrays.asList((String)\"name\", (String)\"enam\", (String)\"game\"))))\n // (\"enam\")\n // >>> findMax((new ArrayList(Arrays.asList((String)\"aaaaaaa\", (String)\"bb\", (String)\"cc\"))))\n // (\"aaaaaaa\")\n public static String findMax(ArrayList words) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(findMax((new ArrayList(Arrays.asList((String)\"name\", (String)\"of\", (String)\"string\")))).equals((\"string\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"name\", (String)\"enam\", (String)\"game\")))).equals((\"enam\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"aaaaaaa\", (String)\"bb\", (String)\"cc\")))).equals((\"aaaaaaa\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"abc\", (String)\"cba\")))).equals((\"abc\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"play\", (String)\"this\", (String)\"game\", (String)\"of\", (String)\"footbott\")))).equals((\"footbott\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"we\", (String)\"are\", (String)\"gonna\", (String)\"rock\")))).equals((\"gonna\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"we\", (String)\"are\", (String)\"a\", (String)\"mad\", (String)\"nation\")))).equals((\"nation\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"this\", (String)\"is\", (String)\"a\", (String)\"prrk\")))).equals((\"this\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"b\")))).equals((\"b\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"play\", (String)\"play\", (String)\"play\")))).equals((\"play\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a positive integer n, return the count of the numbers of n-digit\n // positive integers that start or end with 1.\n public static long startsOneEnds(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(startsOneEnds((1l)) == (1l));\n assert(startsOneEnds((2l)) == (18l));\n assert(startsOneEnds((3l)) == (180l));\n assert(startsOneEnds((4l)) == (1800l));\n assert(startsOneEnds((5l)) == (18000l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function that returns a pair (a, b), where 'a' is\n // the largest of negative integers, and 'b' is the smallest\n // of positive integers in an array array list.\n // If there is no negative or positive integers, return them as null.\n // Examples:\n // >>> largestSmallestIntegers((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)1l, (long)3l, (long)5l, (long)7l))))\n // Pair.with(Optional.of(Optional.empty()), Optional.of(1l))\n // >>> largestSmallestIntegers((new ArrayList(Arrays.asList())))\n // Pair.with(Optional.of(Optional.empty()), Optional.of(Optional.empty()))\n // >>> largestSmallestIntegers((new ArrayList(Arrays.asList((long)0l))))\n // Pair.with(Optional.of(Optional.empty()), Optional.of(Optional.empty()))\n public static Pair, Optional> largestSmallestIntegers(ArrayList lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)1l, (long)3l, (long)5l, (long)7l)))).equals(Pair.with(Optional.of(Optional.empty()), Optional.of(1l))));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)1l, (long)3l, (long)5l, (long)7l, (long)0l)))).equals(Pair.with(Optional.of(Optional.empty()), Optional.of(1l))));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)4l, (long)5l, (long)6l, (long)-2l)))).equals(Pair.with(-2l, 1l)));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)4l, (long)5l, (long)3l, (long)6l, (long)2l, (long)7l, (long)-7l)))).equals(Pair.with(-7l, 2l)));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)7l, (long)3l, (long)8l, (long)4l, (long)9l, (long)2l, (long)5l, (long)-9l)))).equals(Pair.with(-9l, 2l)));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList()))).equals(Pair.with(Optional.of(Optional.empty()), Optional.of(Optional.empty()))));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)0l)))).equals(Pair.with(Optional.of(Optional.empty()), Optional.of(Optional.empty()))));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)-1l, (long)-3l, (long)-5l, (long)-6l)))).equals(Pair.with(Optional.of(-1l), Optional.of(Optional.empty()))));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)-1l, (long)-3l, (long)-5l, (long)-6l, (long)0l)))).equals(Pair.with(Optional.of(-1l), Optional.of(Optional.empty()))));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)-6l, (long)-4l, (long)-4l, (long)-3l, (long)1l)))).equals(Pair.with(-3l, 1l)));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)-6l, (long)-4l, (long)-4l, (long)-3l, (long)-100l, (long)1l)))).equals(Pair.with(-3l, 1l)));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // \"Given an array array list representing a branch of a tree that has non-negative integer nodes\n // your task is to pluck one of the nodes and return it.\n // The plucked node should be the node with the smallest even value.\n // If multiple nodes with the same smallest even value are found return the node that has smallest index.\n // The plucked node should be returned in an array array list, [ smalest_value, its index ],\n // If there are no even values or the given array array list is empty, return [].\n // Example 1:\n // >>> pluck((new ArrayList(Arrays.asList((long)4l, (long)2l, (long)3l))))\n // (new ArrayList(Arrays.asList((long)2l, (long)1l)))\n // Explanation: 2 has the smallest even value, and 2 has the smallest index.\n // Example 2:\n // >>> pluck((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))))\n // (new ArrayList(Arrays.asList((long)2l, (long)1l)))\n // Explanation: 2 has the smallest even value, and 2 has the smallest index.\n // Example 3:\n // >>> pluck((new ArrayList(Arrays.asList())))\n // (new ArrayList(Arrays.asList()))\n // Example 4:\n // >>> pluck((new ArrayList(Arrays.asList((long)5l, (long)0l, (long)3l, (long)0l, (long)4l, (long)2l))))\n // (new ArrayList(Arrays.asList((long)0l, (long)1l)))\n // Explanation: 0 is the smallest value, but there are two zeros,\n // so we will choose the first zero, which has the smallest index.\n // Constraints:\n // * 1 <= nodes.length <= 10000\n // * 0 <= node.value\n public static ArrayList pluck(ArrayList arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(pluck((new ArrayList(Arrays.asList((long)4l, (long)2l, (long)3l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)1l)))));\n assert(pluck((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)1l)))));\n assert(pluck((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(pluck((new ArrayList(Arrays.asList((long)5l, (long)0l, (long)3l, (long)0l, (long)4l, (long)2l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)1l)))));\n assert(pluck((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)0l, (long)5l, (long)3l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)3l)))));\n assert(pluck((new ArrayList(Arrays.asList((long)5l, (long)4l, (long)8l, (long)4l, (long)8l)))).equals((new ArrayList(Arrays.asList((long)4l, (long)1l)))));\n assert(pluck((new ArrayList(Arrays.asList((long)7l, (long)6l, (long)7l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)6l, (long)1l)))));\n assert(pluck((new ArrayList(Arrays.asList((long)7l, (long)9l, (long)7l, (long)1l)))).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function count_nums which takes an array array list of integers and returns\n // the number of elements which has a sum of digits > 0.\n // If a number is negative, then its first signed digit will be negative:\n // e.g. -123 has signed digits -1, 2, and 3.\n // >>> countNums((new ArrayList(Arrays.asList())))\n // (0l)\n // >>> countNums((new ArrayList(Arrays.asList((long)-1l, (long)11l, (long)-11l))))\n // (1l)\n // >>> countNums((new ArrayList(Arrays.asList((long)1l, (long)1l, (long)2l))))\n // (3l)\n public static long countNums(ArrayList arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(countNums((new ArrayList(Arrays.asList()))) == (0l));\n assert(countNums((new ArrayList(Arrays.asList((long)-1l, (long)-2l, (long)0l)))) == (0l));\n assert(countNums((new ArrayList(Arrays.asList((long)1l, (long)1l, (long)2l, (long)-2l, (long)3l, (long)4l, (long)5l)))) == (6l));\n assert(countNums((new ArrayList(Arrays.asList((long)1l, (long)6l, (long)9l, (long)-6l, (long)0l, (long)1l, (long)5l)))) == (5l));\n assert(countNums((new ArrayList(Arrays.asList((long)1l, (long)100l, (long)98l, (long)-7l, (long)1l, (long)-1l)))) == (4l));\n assert(countNums((new ArrayList(Arrays.asList((long)12l, (long)23l, (long)34l, (long)-45l, (long)-56l, (long)0l)))) == (5l));\n assert(countNums((new ArrayList(Arrays.asList((long)0l, (long)1l)))) == (1l));\n assert(countNums((new ArrayList(Arrays.asList((long)1l)))) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n // each cell of the grid contains a value. Every integer in the range [1, N * N]\n // inclusive appears exactly once on the cells of the grid.\n // You have to find the minimum path of length k in the grid. You can start\n // from any cell, and in each step you can move to any of the neighbor cells,\n // in other words, you can go to cells which share an edge with you current\n // cell.\n // Please note that a path of length k means visiting exactly k cells (not\n // necessarily distinct).\n // You CANNOT go off the grid.\n // A path A (of length k) is considered less than a path B (of length k) if\n // after making the ordered array lists of the values on the cells that A and B go\n // through (let's call them lst_A and lst_B), lst_A is lexicographically less\n // than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n // such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n // lst_A[j] = lst_B[j].\n // It is guaranteed that the answer is unique.\n // Return an ordered array list of the values on the cells that the minimum path go through.\n // Examples: \n // >>> minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)), (ArrayList)new ArrayList(Arrays.asList((long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)7l, (long)8l, (long)9l))))), (3l))\n // (new ArrayList(Arrays.asList((long)1l, (long)2l, (long)1l)))\n // >>> minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)5l, (long)9l, (long)3l)), (ArrayList)new ArrayList(Arrays.asList((long)4l, (long)1l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)7l, (long)8l, (long)2l))))), (1l))\n // (new ArrayList(Arrays.asList((long)1l)))\n public static ArrayList minPath(ArrayList> grid, long k) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)), (ArrayList)new ArrayList(Arrays.asList((long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)7l, (long)8l, (long)9l))))), (3l)).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)1l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)5l, (long)9l, (long)3l)), (ArrayList)new ArrayList(Arrays.asList((long)4l, (long)1l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)7l, (long)8l, (long)2l))))), (1l)).equals((new ArrayList(Arrays.asList((long)1l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)), (ArrayList)new ArrayList(Arrays.asList((long)5l, (long)6l, (long)7l, (long)8l)), (ArrayList)new ArrayList(Arrays.asList((long)9l, (long)10l, (long)11l, (long)12l)), (ArrayList)new ArrayList(Arrays.asList((long)13l, (long)14l, (long)15l, (long)16l))))), (4l)).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)1l, (long)2l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)6l, (long)4l, (long)13l, (long)10l)), (ArrayList)new ArrayList(Arrays.asList((long)5l, (long)7l, (long)12l, (long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)3l, (long)16l, (long)11l, (long)15l)), (ArrayList)new ArrayList(Arrays.asList((long)8l, (long)14l, (long)9l, (long)2l))))), (7l)).equals((new ArrayList(Arrays.asList((long)1l, (long)10l, (long)1l, (long)10l, (long)1l, (long)10l, (long)1l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)8l, (long)14l, (long)9l, (long)2l)), (ArrayList)new ArrayList(Arrays.asList((long)6l, (long)4l, (long)13l, (long)15l)), (ArrayList)new ArrayList(Arrays.asList((long)5l, (long)7l, (long)1l, (long)12l)), (ArrayList)new ArrayList(Arrays.asList((long)3l, (long)10l, (long)11l, (long)16l))))), (5l)).equals((new ArrayList(Arrays.asList((long)1l, (long)7l, (long)1l, (long)7l, (long)1l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)11l, (long)8l, (long)7l, (long)2l)), (ArrayList)new ArrayList(Arrays.asList((long)5l, (long)16l, (long)14l, (long)4l)), (ArrayList)new ArrayList(Arrays.asList((long)9l, (long)3l, (long)15l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)12l, (long)13l, (long)10l, (long)1l))))), (9l)).equals((new ArrayList(Arrays.asList((long)1l, (long)6l, (long)1l, (long)6l, (long)1l, (long)6l, (long)1l, (long)6l, (long)1l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)12l, (long)13l, (long)10l, (long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)9l, (long)3l, (long)15l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)5l, (long)16l, (long)14l, (long)4l)), (ArrayList)new ArrayList(Arrays.asList((long)11l, (long)8l, (long)7l, (long)2l))))), (12l)).equals((new ArrayList(Arrays.asList((long)1l, (long)6l, (long)1l, (long)6l, (long)1l, (long)6l, (long)1l, (long)6l, (long)1l, (long)6l, (long)1l, (long)6l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)2l, (long)7l, (long)4l)), (ArrayList)new ArrayList(Arrays.asList((long)3l, (long)1l, (long)5l)), (ArrayList)new ArrayList(Arrays.asList((long)6l, (long)8l, (long)9l))))), (8l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)1l, (long)3l, (long)1l, (long)3l, (long)1l, (long)3l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)6l, (long)1l, (long)5l)), (ArrayList)new ArrayList(Arrays.asList((long)3l, (long)8l, (long)9l)), (ArrayList)new ArrayList(Arrays.asList((long)2l, (long)7l, (long)4l))))), (8l)).equals((new ArrayList(Arrays.asList((long)1l, (long)5l, (long)1l, (long)5l, (long)1l, (long)5l, (long)1l, (long)5l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l)), (ArrayList)new ArrayList(Arrays.asList((long)3l, (long)4l))))), (10l)).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)1l, (long)2l, (long)1l, (long)2l, (long)1l, (long)2l, (long)1l, (long)2l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)3l)), (ArrayList)new ArrayList(Arrays.asList((long)3l, (long)2l))))), (10l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)1l, (long)3l, (long)1l, (long)3l, (long)1l, (long)3l, (long)1l, (long)3l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given array list of integers, return array list in strange order.\n // Strange sorting, is when you start with the minimum value,\n // then maximum of the remaining integers, then minimum and so on.\n // Examples:\n // >>> strangeSortList((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l))))\n // (new ArrayList(Arrays.asList((long)1l, (long)4l, (long)2l, (long)3l)))\n // >>> strangeSortList((new ArrayList(Arrays.asList((long)5l, (long)5l, (long)5l, (long)5l))))\n // (new ArrayList(Arrays.asList((long)5l, (long)5l, (long)5l, (long)5l)))\n // >>> strangeSortList((new ArrayList(Arrays.asList())))\n // (new ArrayList(Arrays.asList()))\n public static ArrayList strangeSortList(ArrayList lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(strangeSortList((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)2l, (long)3l)))));\n assert(strangeSortList((new ArrayList(Arrays.asList((long)5l, (long)6l, (long)7l, (long)8l, (long)9l)))).equals((new ArrayList(Arrays.asList((long)5l, (long)9l, (long)6l, (long)8l, (long)7l)))));\n assert(strangeSortList((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)5l, (long)2l, (long)4l, (long)3l)))));\n assert(strangeSortList((new ArrayList(Arrays.asList((long)5l, (long)6l, (long)7l, (long)8l, (long)9l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)9l, (long)5l, (long)8l, (long)6l, (long)7l)))));\n assert(strangeSortList((new ArrayList(Arrays.asList((long)5l, (long)5l, (long)5l, (long)5l)))).equals((new ArrayList(Arrays.asList((long)5l, (long)5l, (long)5l, (long)5l)))));\n assert(strangeSortList((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(strangeSortList((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l, (long)7l, (long)8l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)8l, (long)2l, (long)7l, (long)3l, (long)6l, (long)4l, (long)5l)))));\n assert(strangeSortList((new ArrayList(Arrays.asList((long)0l, (long)2l, (long)2l, (long)2l, (long)5l, (long)5l, (long)-5l, (long)-5l)))).equals((new ArrayList(Arrays.asList((long)-5l, (long)5l, (long)-5l, (long)5l, (long)0l, (long)2l, (long)2l, (long)2l)))));\n assert(strangeSortList((new ArrayList(Arrays.asList((long)111111l)))).equals((new ArrayList(Arrays.asList((long)111111l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a string 'text', return its md5 hash equivalent string.\n // If 'text' is an empty string, return null.\n // >>> stringToMd5((\"Hello world\"))\n // \"3e25960a79dbc69b674cd4ec67a72c62\"\n public static Optional stringToMd5(String text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(stringToMd5((\"Hello world\")).equals(\"3e25960a79dbc69b674cd4ec67a72c62\"));\n assert(stringToMd5((\"\")).equals(Optional.empty()));\n assert(stringToMd5((\"A B C\")).equals(\"0ef78513b0cb8cef12743f5aeb35f888\"));\n assert(stringToMd5((\"password\")).equals(\"5f4dcc3b5aa765d61d8327deb882cf99\"));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a word. Your task is to find the closest vowel that stands between \n // two consonants from the right side of the word (case sensitive).\n // Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n // find any vowel met the above condition. \n // You may assume that the given string contains English letter only.\n // Example:\n // >>> getClosestVowel((\"yogurt\"))\n // (\"u\")\n // >>> getClosestVowel((\"FULL\"))\n // (\"U\")\n // >>> getClosestVowel((\"quick\"))\n // (\"\")\n // >>> getClosestVowel((\"ab\"))\n // (\"\")\n public static String getClosestVowel(String word) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(getClosestVowel((\"yogurt\")).equals((\"u\")));\n assert(getClosestVowel((\"full\")).equals((\"u\")));\n assert(getClosestVowel((\"easy\")).equals((\"\")));\n assert(getClosestVowel((\"eAsy\")).equals((\"\")));\n assert(getClosestVowel((\"ali\")).equals((\"\")));\n assert(getClosestVowel((\"bad\")).equals((\"a\")));\n assert(getClosestVowel((\"most\")).equals((\"o\")));\n assert(getClosestVowel((\"ab\")).equals((\"\")));\n assert(getClosestVowel((\"ba\")).equals((\"\")));\n assert(getClosestVowel((\"quick\")).equals((\"\")));\n assert(getClosestVowel((\"anime\")).equals((\"i\")));\n assert(getClosestVowel((\"Asia\")).equals((\"\")));\n assert(getClosestVowel((\"Above\")).equals((\"o\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Change numerical base of input number x to base.\n // return string representation after the conversion.\n // base numbers are less than 10.\n // >>> changeBase((8l), (3l))\n // (\"22\")\n // >>> changeBase((8l), (2l))\n // (\"1000\")\n // >>> changeBase((7l), (2l))\n // (\"111\")\n public static String changeBase(long x, long base) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(changeBase((8l), (3l)).equals((\"22\")));\n assert(changeBase((9l), (3l)).equals((\"100\")));\n assert(changeBase((234l), (2l)).equals((\"11101010\")));\n assert(changeBase((16l), (2l)).equals((\"10000\")));\n assert(changeBase((8l), (2l)).equals((\"1000\")));\n assert(changeBase((7l), (2l)).equals((\"111\")));\n assert(changeBase((2l), (3l)).equals((\"2\")));\n assert(changeBase((3l), (4l)).equals((\"3\")));\n assert(changeBase((4l), (5l)).equals((\"4\")));\n assert(changeBase((5l), (6l)).equals((\"5\")));\n assert(changeBase((6l), (7l)).equals((\"6\")));\n assert(changeBase((7l), (8l)).equals((\"7\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Check if in given array list of numbers, are any two numbers closer to each other than\n // given threshold.\n // >>> hasCloseElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f))), (0.5f))\n // (false)\n // >>> hasCloseElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.8f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.0f))), (0.3f))\n // (true)\n public static boolean hasCloseElements(ArrayList numbers, float threshold) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(hasCloseElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.9f, (float)4.0f, (float)5.0f, (float)2.2f))), (0.3f)) == (true));\n assert(hasCloseElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.9f, (float)4.0f, (float)5.0f, (float)2.2f))), (0.05f)) == (false));\n assert(hasCloseElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)5.9f, (float)4.0f, (float)5.0f))), (0.95f)) == (true));\n assert(hasCloseElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)5.9f, (float)4.0f, (float)5.0f))), (0.8f)) == (false));\n assert(hasCloseElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.0f))), (0.1f)) == (true));\n assert(hasCloseElements((new ArrayList(Arrays.asList((float)1.1f, (float)2.2f, (float)3.1f, (float)4.1f, (float)5.1f))), (1.0f)) == (true));\n assert(hasCloseElements((new ArrayList(Arrays.asList((float)1.1f, (float)2.2f, (float)3.1f, (float)4.1f, (float)5.1f))), (0.5f)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function that takes a string as input which contains only square brackets.\n // The function should return true if and only if there is a valid subsequence of brackets \n // where at least one bracket in the subsequence is nested.\n // >>> isNested((\"[[]]\"))\n // (true)\n // >>> isNested((\"[]]]]]]][[[[[]\"))\n // (false)\n // >>> isNested((\"[][]\"))\n // (false)\n // >>> isNested((\"[]\"))\n // (false)\n // >>> isNested((\"[[][]]\"))\n // (true)\n // >>> isNested((\"[[]][[\"))\n // (true)\n public static boolean isNested(String string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(isNested((\"[[]]\")) == (true));\n assert(isNested((\"[]]]]]]][[[[[]\")) == (false));\n assert(isNested((\"[][]\")) == (false));\n assert(isNested((\"[]\")) == (false));\n assert(isNested((\"[[[[]]]]\")) == (true));\n assert(isNested((\"[]]]]]]]]]]\")) == (false));\n assert(isNested((\"[][][[]]\")) == (true));\n assert(isNested((\"[[]\")) == (false));\n assert(isNested((\"[]]\")) == (false));\n assert(isNested((\"[[]][[\")) == (true));\n assert(isNested((\"[[][]]\")) == (true));\n assert(isNested((\"\")) == (false));\n assert(isNested((\"[[[[[[[[\")) == (false));\n assert(isNested((\"]]]]]]]]\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Concatenate array list of strings into a single string\n // >>> concatenate((new ArrayList(Arrays.asList())))\n // (\"\")\n // >>> concatenate((new ArrayList(Arrays.asList((String)\"a\", (String)\"b\", (String)\"c\"))))\n // (\"abc\")\n public static String concatenate(ArrayList strings) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(concatenate((new ArrayList(Arrays.asList()))).equals((\"\")));\n assert(concatenate((new ArrayList(Arrays.asList((String)\"x\", (String)\"y\", (String)\"z\")))).equals((\"xyz\")));\n assert(concatenate((new ArrayList(Arrays.asList((String)\"x\", (String)\"y\", (String)\"z\", (String)\"w\", (String)\"k\")))).equals((\"xyzwk\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n // >>> primeFib((1l))\n // (2l)\n // >>> primeFib((2l))\n // (3l)\n // >>> primeFib((3l))\n // (5l)\n // >>> primeFib((4l))\n // (13l)\n // >>> primeFib((5l))\n // (89l)\n public static long primeFib(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(primeFib((1l)) == (2l));\n assert(primeFib((2l)) == (3l));\n assert(primeFib((3l)) == (5l));\n assert(primeFib((4l)) == (13l));\n assert(primeFib((5l)) == (89l));\n assert(primeFib((6l)) == (233l));\n assert(primeFib((7l)) == (1597l));\n assert(primeFib((8l)) == (28657l));\n assert(primeFib((9l)) == (514229l));\n assert(primeFib((10l)) == (433494437l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // From a supplied array list of numbers (of length at least two) select and return two that are the closest to each\n // other and return them in order (smaller number, larger number).\n // >>> findClosestElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.2f))))\n // (Pair.with(2.0f, 2.2f))\n // >>> findClosestElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.0f))))\n // (Pair.with(2.0f, 2.0f))\n public static Pair findClosestElements(ArrayList numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(findClosestElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.9f, (float)4.0f, (float)5.0f, (float)2.2f)))).equals((Pair.with(3.9f, 4.0f))));\n assert(findClosestElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)5.9f, (float)4.0f, (float)5.0f)))).equals((Pair.with(5.0f, 5.9f))));\n assert(findClosestElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.2f)))).equals((Pair.with(2.0f, 2.2f))));\n assert(findClosestElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.0f)))).equals((Pair.with(2.0f, 2.0f))));\n assert(findClosestElements((new ArrayList(Arrays.asList((float)1.1f, (float)2.2f, (float)3.1f, (float)4.1f, (float)5.1f)))).equals((Pair.with(2.2f, 3.1f))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You have been tasked to write a function that receives \n // a hexadecimal number as a string and counts the number of hexadecimal \n // digits that are primes (prime number, or a prime, is a natural number \n // greater than 1 that is not a product of two smaller natural numbers).\n // Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n // Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n // So you have to determine a number of the following digits: 2, 3, 5, 7, \n // B (=decimal 11), D (=decimal 13).\n // Note: you may assume the input is always correct or empty string, \n // and symbols A,B,C,D,E,F are always uppercase.\n // Examples:\n // >>> hexKey((\"AB\"))\n // (1l)\n // >>> hexKey((\"1077E\"))\n // (2l)\n // >>> hexKey((\"ABED1A33\"))\n // (4l)\n // >>> hexKey((\"123456789ABCDEF0\"))\n // (6l)\n // >>> hexKey((\"2020\"))\n // (2l)\n public static long hexKey(String num) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(hexKey((\"AB\")) == (1l));\n assert(hexKey((\"1077E\")) == (2l));\n assert(hexKey((\"ABED1A33\")) == (4l));\n assert(hexKey((\"2020\")) == (2l));\n assert(hexKey((\"123456789ABCDEF0\")) == (6l));\n assert(hexKey((\"112233445566778899AABBCCDDEEFF00\")) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Complete the function that takes two integers and returns \n // the product of their unit digits.\n // Assume the input is always valid.\n // Examples:\n // >>> multiply((148l), (412l))\n // (16l)\n // >>> multiply((19l), (28l))\n // (72l)\n // >>> multiply((2020l), (1851l))\n // (0l)\n // >>> multiply((14l), (-15l))\n // (20l)\n public static long multiply(long a, long b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(multiply((148l), (412l)) == (16l));\n assert(multiply((19l), (28l)) == (72l));\n assert(multiply((2020l), (1851l)) == (0l));\n assert(multiply((14l), (-15l)) == (20l));\n assert(multiply((76l), (67l)) == (42l));\n assert(multiply((17l), (27l)) == (49l));\n assert(multiply((0l), (1l)) == (0l));\n assert(multiply((0l), (0l)) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given array list of numbers (of at least two elements), apply a linear transform to that array list,\n // such that the smallest number will become 0 and the largest will become 1\n // >>> rescaleToUnit((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f))))\n // (new ArrayList(Arrays.asList((float)0.0f, (float)0.25f, (float)0.5f, (float)0.75f, (float)1.0f)))\n public static ArrayList rescaleToUnit(ArrayList numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(rescaleToUnit((new ArrayList(Arrays.asList((float)2.0f, (float)49.9f)))).equals((new ArrayList(Arrays.asList((float)0.0f, (float)1.0f)))));\n assert(rescaleToUnit((new ArrayList(Arrays.asList((float)100.0f, (float)49.9f)))).equals((new ArrayList(Arrays.asList((float)1.0f, (float)0.0f)))));\n assert(rescaleToUnit((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f)))).equals((new ArrayList(Arrays.asList((float)0.0f, (float)0.25f, (float)0.5f, (float)0.75f, (float)1.0f)))));\n assert(rescaleToUnit((new ArrayList(Arrays.asList((float)2.0f, (float)1.0f, (float)5.0f, (float)3.0f, (float)4.0f)))).equals((new ArrayList(Arrays.asList((float)0.25f, (float)0.0f, (float)1.0f, (float)0.5f, (float)0.75f)))));\n assert(rescaleToUnit((new ArrayList(Arrays.asList((float)12.0f, (float)11.0f, (float)15.0f, (float)13.0f, (float)14.0f)))).equals((new ArrayList(Arrays.asList((float)0.25f, (float)0.0f, (float)1.0f, (float)0.5f, (float)0.75f)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a positive integer n, return the product of the odd digits.\n // Return 0 if all digits are even.\n // For example:\n // >>> digits((1l))\n // (1l)\n // >>> digits((4l))\n // (0l)\n // >>> digits((235l))\n // (15l)\n public static long digits(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(digits((5l)) == (5l));\n assert(digits((54l)) == (5l));\n assert(digits((120l)) == (1l));\n assert(digits((5014l)) == (5l));\n assert(digits((98765l)) == (315l));\n assert(digits((5576543l)) == (2625l));\n assert(digits((2468l)) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You will be given the name of a class (a string) and an array array list of extensions.\n // The extensions are to be used to load additional classes to the class. The\n // strength of the extension is as follows: Let CAP be the number of the uppercase\n // letters in the extension's name, and let SM be the number of lowercase letters \n // in the extension's name, the strength is given by the fraction CAP - SM. \n // You should find the strongest extension and return a string in this \n // format: ClassName.StrongestExtensionName.\n // If there are two or more extensions with the same strength, you should\n // choose the one that comes first in the array list.\n // For example, if you are given \"Slices\" as the class and an array array list of the\n // extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n // return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n // (its strength is -1).\n // Example:\n // >>> StrongestExtension((\"my_class\"), (new ArrayList(Arrays.asList((String)\"AA\", (String)\"Be\", (String)\"CC\"))))\n // (\"my_class.AA\")\n public static String StrongestExtension(String class_name, ArrayList extensions) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(StrongestExtension((\"Watashi\"), (new ArrayList(Arrays.asList((String)\"tEN\", (String)\"niNE\", (String)\"eIGHt8OKe\")))).equals((\"Watashi.eIGHt8OKe\")));\n assert(StrongestExtension((\"Boku123\"), (new ArrayList(Arrays.asList((String)\"nani\", (String)\"NazeDa\", (String)\"YEs.WeCaNe\", (String)\"32145tggg\")))).equals((\"Boku123.YEs.WeCaNe\")));\n assert(StrongestExtension((\"__YESIMHERE\"), (new ArrayList(Arrays.asList((String)\"t\", (String)\"eMptY\", (String)\"nothing\", (String)\"zeR00\", (String)\"NuLl__\", (String)\"123NoooneB321\")))).equals((\"__YESIMHERE.NuLl__\")));\n assert(StrongestExtension((\"K\"), (new ArrayList(Arrays.asList((String)\"Ta\", (String)\"TAR\", (String)\"t234An\", (String)\"cosSo\")))).equals((\"K.TAR\")));\n assert(StrongestExtension((\"__HAHA\"), (new ArrayList(Arrays.asList((String)\"Tab\", (String)\"123\", (String)\"781345\", (String)\"-_-\")))).equals((\"__HAHA.123\")));\n assert(StrongestExtension((\"YameRore\"), (new ArrayList(Arrays.asList((String)\"HhAas\", (String)\"okIWILL123\", (String)\"WorkOut\", (String)\"Fails\", (String)\"-_-\")))).equals((\"YameRore.okIWILL123\")));\n assert(StrongestExtension((\"finNNalLLly\"), (new ArrayList(Arrays.asList((String)\"Die\", (String)\"NowW\", (String)\"Wow\", (String)\"WoW\")))).equals((\"finNNalLLly.WoW\")));\n assert(StrongestExtension((\"_\"), (new ArrayList(Arrays.asList((String)\"Bb\", (String)\"91245\")))).equals((\"_.Bb\")));\n assert(StrongestExtension((\"Sp\"), (new ArrayList(Arrays.asList((String)\"671235\", (String)\"Bb\")))).equals((\"Sp.671235\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a string representing a space separated lowercase letters, return a hash map\n // of the letter with the most repetition and containing the corresponding count.\n // If several letters have the same occurrence, return all of them.\n // Example:\n // >>> histogram((\"a b c\"))\n // (new HashMap(Map.of(\"a\", 1l, \"b\", 1l, \"c\", 1l)))\n // >>> histogram((\"a b b a\"))\n // (new HashMap(Map.of(\"a\", 2l, \"b\", 2l)))\n // >>> histogram((\"a b c a b\"))\n // (new HashMap(Map.of(\"a\", 2l, \"b\", 2l)))\n // >>> histogram((\"b b b b a\"))\n // (new HashMap(Map.of(\"b\", 4l)))\n // >>> histogram((\"\"))\n // (new HashMap())\n public static HashMap histogram(String test) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(histogram((\"a b b a\")).equals((new HashMap(Map.of(\"a\", 2l, \"b\", 2l)))));\n assert(histogram((\"a b c a b\")).equals((new HashMap(Map.of(\"a\", 2l, \"b\", 2l)))));\n assert(histogram((\"a b c d g\")).equals((new HashMap(Map.of(\"a\", 1l, \"b\", 1l, \"c\", 1l, \"d\", 1l, \"g\", 1l)))));\n assert(histogram((\"r t g\")).equals((new HashMap(Map.of(\"r\", 1l, \"t\", 1l, \"g\", 1l)))));\n assert(histogram((\"b b b b a\")).equals((new HashMap(Map.of(\"b\", 4l)))));\n assert(histogram((\"r t g\")).equals((new HashMap(Map.of(\"r\", 1l, \"t\", 1l, \"g\", 1l)))));\n assert(histogram((\"\")).equals((new HashMap())));\n assert(histogram((\"a\")).equals((new HashMap(Map.of(\"a\", 1l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // pairs_sum_to_zero takes an array array list of integers as an input.\n // it returns true if there are two distinct elements in the array list that\n // sum to zero, and false otherwise.\n // >>> pairsSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)5l, (long)0l))))\n // (false)\n // >>> pairsSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)-2l, (long)1l))))\n // (false)\n // >>> pairsSumToZero((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)7l))))\n // (false)\n // >>> pairsSumToZero((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)-5l, (long)3l, (long)5l, (long)7l))))\n // (true)\n // >>> pairsSumToZero((new ArrayList(Arrays.asList((long)1l))))\n // (false)\n public static boolean pairsSumToZero(ArrayList l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)5l, (long)0l)))) == (false));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)-2l, (long)1l)))) == (false));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)7l)))) == (false));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)-5l, (long)3l, (long)5l, (long)7l)))) == (true));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)1l)))) == (false));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)-3l, (long)9l, (long)-1l, (long)3l, (long)2l, (long)30l)))) == (true));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)-3l, (long)9l, (long)-1l, (long)3l, (long)2l, (long)31l)))) == (true));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)-3l, (long)9l, (long)-1l, (long)4l, (long)2l, (long)30l)))) == (false));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)-3l, (long)9l, (long)-1l, (long)4l, (long)2l, (long)31l)))) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that accepts two array lists of strings and returns the array list that has \n // total number of chars in the all strings of the array list less than the other array list.\n // if the two array lists have the same number of chars, return the first array list.\n // Examples\n // >>> totalMatch((new ArrayList(Arrays.asList())), (new ArrayList(Arrays.asList())))\n // (new ArrayList(Arrays.asList()))\n // >>> totalMatch((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\"))), (new ArrayList(Arrays.asList((String)\"hI\", (String)\"Hi\"))))\n // (new ArrayList(Arrays.asList((String)\"hI\", (String)\"Hi\")))\n // >>> totalMatch((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\"))), (new ArrayList(Arrays.asList((String)\"hi\", (String)\"hi\", (String)\"admin\", (String)\"project\"))))\n // (new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\")))\n // >>> totalMatch((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\"))), (new ArrayList(Arrays.asList((String)\"hI\", (String)\"hi\", (String)\"hi\"))))\n // (new ArrayList(Arrays.asList((String)\"hI\", (String)\"hi\", (String)\"hi\")))\n // >>> totalMatch((new ArrayList(Arrays.asList((String)\"4\"))), (new ArrayList(Arrays.asList((String)\"1\", (String)\"2\", (String)\"3\", (String)\"4\", (String)\"5\"))))\n // (new ArrayList(Arrays.asList((String)\"4\")))\n public static ArrayList totalMatch(ArrayList lst1, ArrayList lst2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(totalMatch((new ArrayList(Arrays.asList())), (new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(totalMatch((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\"))), (new ArrayList(Arrays.asList((String)\"hi\", (String)\"hi\")))).equals((new ArrayList(Arrays.asList((String)\"hi\", (String)\"hi\")))));\n assert(totalMatch((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\"))), (new ArrayList(Arrays.asList((String)\"hi\", (String)\"hi\", (String)\"admin\", (String)\"project\")))).equals((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\")))));\n assert(totalMatch((new ArrayList(Arrays.asList((String)\"4\"))), (new ArrayList(Arrays.asList((String)\"1\", (String)\"2\", (String)\"3\", (String)\"4\", (String)\"5\")))).equals((new ArrayList(Arrays.asList((String)\"4\")))));\n assert(totalMatch((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\"))), (new ArrayList(Arrays.asList((String)\"hI\", (String)\"Hi\")))).equals((new ArrayList(Arrays.asList((String)\"hI\", (String)\"Hi\")))));\n assert(totalMatch((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\"))), (new ArrayList(Arrays.asList((String)\"hI\", (String)\"hi\", (String)\"hi\")))).equals((new ArrayList(Arrays.asList((String)\"hI\", (String)\"hi\", (String)\"hi\")))));\n assert(totalMatch((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\"))), (new ArrayList(Arrays.asList((String)\"hI\", (String)\"hi\", (String)\"hii\")))).equals((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\")))));\n assert(totalMatch((new ArrayList(Arrays.asList())), (new ArrayList(Arrays.asList((String)\"this\")))).equals((new ArrayList(Arrays.asList()))));\n assert(totalMatch((new ArrayList(Arrays.asList((String)\"this\"))), (new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Circular shift the digits of the integer x, shift the digits right by shift\n // and return the result as a string.\n // If shift > number of digits, return digits reversed.\n // >>> circularShift((12l), (1l))\n // (\"21\")\n // >>> circularShift((12l), (2l))\n // (\"12\")\n public static String circularShift(long x, long shift) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(circularShift((100l), (2l)).equals((\"001\")));\n assert(circularShift((12l), (2l)).equals((\"12\")));\n assert(circularShift((97l), (8l)).equals((\"79\")));\n assert(circularShift((12l), (1l)).equals((\"21\")));\n assert(circularShift((11l), (101l)).equals((\"11\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return true is array list elements are monotonically increasing or decreasing.\n // >>> monotonic((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)4l, (long)20l))))\n // (true)\n // >>> monotonic((new ArrayList(Arrays.asList((long)1l, (long)20l, (long)4l, (long)10l))))\n // (false)\n // >>> monotonic((new ArrayList(Arrays.asList((long)4l, (long)1l, (long)0l, (long)-10l))))\n // (true)\n public static boolean monotonic(ArrayList l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(monotonic((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)4l, (long)10l)))) == (true));\n assert(monotonic((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)4l, (long)20l)))) == (true));\n assert(monotonic((new ArrayList(Arrays.asList((long)1l, (long)20l, (long)4l, (long)10l)))) == (false));\n assert(monotonic((new ArrayList(Arrays.asList((long)4l, (long)1l, (long)0l, (long)-10l)))) == (true));\n assert(monotonic((new ArrayList(Arrays.asList((long)4l, (long)1l, (long)1l, (long)0l)))) == (true));\n assert(monotonic((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)2l, (long)5l, (long)60l)))) == (false));\n assert(monotonic((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)60l)))) == (true));\n assert(monotonic((new ArrayList(Arrays.asList((long)9l, (long)9l, (long)9l, (long)9l)))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n // Example\n // >>> isEqualToSumEven((4l))\n // (false)\n // >>> isEqualToSumEven((6l))\n // (false)\n // >>> isEqualToSumEven((8l))\n // (true)\n public static boolean isEqualToSumEven(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(isEqualToSumEven((4l)) == (false));\n assert(isEqualToSumEven((6l)) == (false));\n assert(isEqualToSumEven((8l)) == (true));\n assert(isEqualToSumEven((10l)) == (true));\n assert(isEqualToSumEven((11l)) == (false));\n assert(isEqualToSumEven((12l)) == (true));\n assert(isEqualToSumEven((13l)) == (false));\n assert(isEqualToSumEven((16l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Input to this function is a string representing musical notes in a special ASCII format.\n // Your task is to parse this string and return array list of integers corresponding to how many beats does each\n // not last.\n // Here is a legend:\n // 'o' - whole note, lasts four beats\n // 'o|' - half note, lasts two beats\n // '.|' - quater note, lasts one beat\n // >>> parseMusic((\"o o| .| o| o| .| .| .| .| o o\"))\n // (new ArrayList(Arrays.asList((long)4l, (long)2l, (long)1l, (long)2l, (long)2l, (long)1l, (long)1l, (long)1l, (long)1l, (long)4l, (long)4l)))\n public static ArrayList parseMusic(String music_string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(parseMusic((\"\")).equals((new ArrayList(Arrays.asList()))));\n assert(parseMusic((\"o o o o\")).equals((new ArrayList(Arrays.asList((long)4l, (long)4l, (long)4l, (long)4l)))));\n assert(parseMusic((\".| .| .| .|\")).equals((new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l)))));\n assert(parseMusic((\"o| o| .| .| o o o o\")).equals((new ArrayList(Arrays.asList((long)2l, (long)2l, (long)1l, (long)1l, (long)4l, (long)4l, (long)4l, (long)4l)))));\n assert(parseMusic((\"o| .| o| .| o o| o o|\")).equals((new ArrayList(Arrays.asList((long)2l, (long)1l, (long)2l, (long)1l, (long)4l, (long)2l, (long)4l, (long)2l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // \"\n // This function will take an array array list of integers. For all entries in the array list, the function shall square the integer entry if its index is a \n // multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n // change the entries in the array list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n // Examples:\n // >>> lst\n // (long)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))\n // >>> lst\n // (long)new ArrayList(Arrays.asList())\n // >>> lst\n // (long)new ArrayList(Arrays.asList((long)-1l, (long)-5l, (long)2l, (long)-1l, (long)-5l))\n public static long sumSquares(ArrayList lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(sumSquares((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)))) == (6l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)9l)))) == (14l));\n assert(sumSquares((new ArrayList(Arrays.asList()))) == (0l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l, (long)1l, (long)1l, (long)1l, (long)1l, (long)1l)))) == (9l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)-1l, (long)-1l, (long)-1l, (long)-1l, (long)-1l, (long)-1l, (long)-1l, (long)-1l, (long)-1l)))) == (-3l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)0l)))) == (0l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)-1l, (long)-5l, (long)2l, (long)-1l, (long)-5l)))) == (-126l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)-56l, (long)-99l, (long)1l, (long)0l, (long)-2l)))) == (3030l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)-1l, (long)0l, (long)0l, (long)0l, (long)0l, (long)0l, (long)0l, (long)0l, (long)-1l)))) == (0l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)-16l, (long)-9l, (long)-2l, (long)36l, (long)36l, (long)26l, (long)-20l, (long)25l, (long)-40l, (long)20l, (long)-4l, (long)12l, (long)-26l, (long)35l, (long)37l)))) == (-14196l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)-1l, (long)-3l, (long)17l, (long)-1l, (long)-15l, (long)13l, (long)-1l, (long)14l, (long)-14l, (long)-12l, (long)-5l, (long)14l, (long)-14l, (long)6l, (long)13l, (long)11l, (long)16l, (long)16l, (long)4l, (long)10l)))) == (-1448l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // triples_sum_to_zero takes an array array list of integers as an input.\n // it returns true if there are three distinct elements in the array list that\n // sum to zero, and false otherwise.\n // >>> triplesSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)5l, (long)0l))))\n // (false)\n // >>> triplesSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)-2l, (long)1l))))\n // (true)\n // >>> triplesSumToZero((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)7l))))\n // (false)\n // >>> triplesSumToZero((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)-5l, (long)3l, (long)9l, (long)7l))))\n // (true)\n // >>> triplesSumToZero((new ArrayList(Arrays.asList((long)1l))))\n // (false)\n public static boolean triplesSumToZero(ArrayList l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)5l, (long)0l)))) == (false));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)5l, (long)-1l)))) == (false));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)-2l, (long)1l)))) == (true));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)7l)))) == (false));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)5l, (long)7l)))) == (false));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)-5l, (long)3l, (long)9l, (long)7l)))) == (true));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)1l)))) == (false));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)5l, (long)-100l)))) == (false));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)100l, (long)3l, (long)5l, (long)-100l)))) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // brackets is a string of \"<\" and \">\".\n // return true if every opening bracket has a corresponding closing bracket.\n // >>> correctBracketing((\"<\"))\n // (false)\n // >>> correctBracketing((\"<>\"))\n // (true)\n // >>> correctBracketing((\"<<><>>\"))\n // (true)\n // >>> correctBracketing((\"><<>\"))\n // (false)\n public static boolean correctBracketing(String brackets) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(correctBracketing((\"<>\")) == (true));\n assert(correctBracketing((\"<<><>>\")) == (true));\n assert(correctBracketing((\"<><><<><>><>\")) == (true));\n assert(correctBracketing((\"<><><<<><><>><>><<><><<>>>\")) == (true));\n assert(correctBracketing((\"<<<><>>>>\")) == (false));\n assert(correctBracketing((\"><<>\")) == (false));\n assert(correctBracketing((\"<\")) == (false));\n assert(correctBracketing((\"<<<<\")) == (false));\n assert(correctBracketing((\">\")) == (false));\n assert(correctBracketing((\"<<>\")) == (false));\n assert(correctBracketing((\"<><><<><>><>><<>\")) == (false));\n assert(correctBracketing((\"<><><<><>><>>><>\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that takes an array array list of numbers as input and returns \n // the number of elements in the array array list that are greater than 10 and both \n // first and last digits of a number are odd (1, 3, 5, 7, 9).\n // For example:\n // >>> specialFilter((new ArrayList(Arrays.asList((long)15l, (long)-73l, (long)14l, (long)-15l))))\n // (1l)\n // >>> specialFilter((new ArrayList(Arrays.asList((long)33l, (long)-2l, (long)-3l, (long)45l, (long)21l, (long)109l))))\n // (2l)\n public static long specialFilter(ArrayList nums) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(specialFilter((new ArrayList(Arrays.asList((long)5l, (long)-2l, (long)1l, (long)-5l)))) == (0l));\n assert(specialFilter((new ArrayList(Arrays.asList((long)15l, (long)-73l, (long)14l, (long)-15l)))) == (1l));\n assert(specialFilter((new ArrayList(Arrays.asList((long)33l, (long)-2l, (long)-3l, (long)45l, (long)21l, (long)109l)))) == (2l));\n assert(specialFilter((new ArrayList(Arrays.asList((long)43l, (long)-12l, (long)93l, (long)125l, (long)121l, (long)109l)))) == (4l));\n assert(specialFilter((new ArrayList(Arrays.asList((long)71l, (long)-2l, (long)-33l, (long)75l, (long)21l, (long)19l)))) == (3l));\n assert(specialFilter((new ArrayList(Arrays.asList((long)1l)))) == (0l));\n assert(specialFilter((new ArrayList(Arrays.asList()))) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a hash map, return true if all keys are strings in lower \n // case or all keys are strings in upper case, else return false.\n // The function should return false is the given hash map is empty.\n // Examples:\n // >>> checkDictCase((new HashMap(Map.of(\"a\", \"apple\", \"b\", \"banana\"))))\n // (true)\n // >>> checkDictCase((new HashMap(Map.of(\"a\", \"apple\", \"A\", \"banana\", \"B\", \"banana\"))))\n // (false)\n // >>> checkDictCase((new HashMap(Map.of(\"a\", \"apple\", 8l, \"banana\", \"a\", \"apple\"))))\n // (false)\n // >>> checkDictCase((new HashMap(Map.of(\"Name\", \"John\", \"Age\", \"36\", \"City\", \"Houston\"))))\n // (false)\n // >>> checkDictCase((new HashMap(Map.of(\"STATE\", \"NC\", \"ZIP\", \"12345\"))))\n // (true)\n public static boolean checkDictCase(HashMap dict) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(checkDictCase((new HashMap(Map.of(\"p\", \"pineapple\", \"b\", \"banana\")))) == (true));\n assert(checkDictCase((new HashMap(Map.of(\"p\", \"pineapple\", \"A\", \"banana\", \"B\", \"banana\")))) == (false));\n assert(checkDictCase((new HashMap(Map.of(\"p\", \"pineapple\", \"5\", \"banana\", \"a\", \"apple\")))) == (false));\n assert(checkDictCase((new HashMap(Map.of(\"Name\", \"John\", \"Age\", \"36\", \"City\", \"Houston\")))) == (false));\n assert(checkDictCase((new HashMap(Map.of(\"STATE\", \"NC\", \"ZIP\", \"12345\")))) == (true));\n assert(checkDictCase((new HashMap(Map.of(\"fruit\", \"Orange\", \"taste\", \"Sweet\")))) == (true));\n assert(checkDictCase((new HashMap())) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n // fibfib(0) == 0\n // fibfib(1) == 0\n // fibfib(2) == 1\n // fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n // Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n // >>> fibfib((1l))\n // (0l)\n // >>> fibfib((5l))\n // (4l)\n // >>> fibfib((8l))\n // (24l)\n public static long fibfib(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(fibfib((2l)) == (1l));\n assert(fibfib((1l)) == (0l));\n assert(fibfib((5l)) == (4l));\n assert(fibfib((8l)) == (24l));\n assert(fibfib((10l)) == (81l));\n assert(fibfib((12l)) == (274l));\n assert(fibfib((14l)) == (927l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given an array array list of numbers.\n // You need to return the sum of squared numbers in the given array list,\n // round each element in the array list to the upper int(Ceiling) first.\n // Examples:\n // >>> lst((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f))))\n // (14l)\n // >>> lst((new ArrayList(Arrays.asList((float)1.0f, (float)4.0f, (float)9.0f))))\n // (98l)\n // >>> lst((new ArrayList(Arrays.asList((float)1.0f, (float)3.0f, (float)5.0f, (float)7.0f))))\n // (84l)\n // >>> lst((new ArrayList(Arrays.asList((float)1.4f, (float)4.2f, (float)0.0f))))\n // (29l)\n // >>> lst((new ArrayList(Arrays.asList((float)-2.4f, (float)1.0f, (float)1.0f))))\n // (6l)\n public static long sumSquares(ArrayList lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(sumSquares((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f)))) == (14l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f)))) == (14l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)1.0f, (float)3.0f, (float)5.0f, (float)7.0f)))) == (84l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)1.4f, (float)4.2f, (float)0.0f)))) == (29l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)-2.4f, (float)1.0f, (float)1.0f)))) == (6l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)100.0f, (float)1.0f, (float)15.0f, (float)2.0f)))) == (10230l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)10000.0f, (float)10000.0f)))) == (200000000l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)-1.4f, (float)4.6f, (float)6.3f)))) == (75l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)-1.4f, (float)17.9f, (float)18.9f, (float)19.9f)))) == (1086l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)0.0f)))) == (0l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)-1.0f)))) == (1l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)-1.0f, (float)1.0f, (float)0.0f)))) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_85_add", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a non-empty array list of integers lst. add the even elements that are at odd indices..\n // Examples:\n // >>> add((new ArrayList(Arrays.asList((long)4l, (long)2l, (long)6l, (long)7l))))\n // (2l)\n public static long add(ArrayList lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(add((new ArrayList(Arrays.asList((long)4l, (long)88l)))) == (88l));\n assert(add((new ArrayList(Arrays.asList((long)4l, (long)5l, (long)6l, (long)7l, (long)2l, (long)122l)))) == (122l));\n assert(add((new ArrayList(Arrays.asList((long)4l, (long)0l, (long)6l, (long)7l)))) == (0l));\n assert(add((new ArrayList(Arrays.asList((long)4l, (long)4l, (long)6l, (long)8l)))) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return sorted unique elements in an array array list\n // >>> unique((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)5l, (long)2l, (long)3l, (long)3l, (long)9l, (long)0l, (long)123l))))\n // (new ArrayList(Arrays.asList((long)0l, (long)2l, (long)3l, (long)5l, (long)9l, (long)123l)))\n public static ArrayList unique(ArrayList l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(unique((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)5l, (long)2l, (long)3l, (long)3l, (long)9l, (long)0l, (long)123l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)2l, (long)3l, (long)5l, (long)9l, (long)123l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a string text, replace all spaces in it with underscores, \n // and if a string has more than 2 consecutive spaces, \n // then replace all consecutive spaces with - \n // >>> fixSpaces((\" Example\"))\n // (\"Example\")\n // >>> fixSpaces((\" Example 1\"))\n // (\"Example_1\")\n // >>> fixSpaces((\" Example 2\"))\n // (\"_Example_2\")\n // >>> fixSpaces((\" Example 3\"))\n // (\"_Example-3\")\n public static String fixSpaces(String text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(fixSpaces((\"Example\")).equals((\"Example\")));\n assert(fixSpaces((\"Mudasir Hanif \")).equals((\"Mudasir_Hanif_\")));\n assert(fixSpaces((\"Yellow Yellow Dirty Fellow\")).equals((\"Yellow_Yellow__Dirty__Fellow\")));\n assert(fixSpaces((\"Exa mple\")).equals((\"Exa-mple\")));\n assert(fixSpaces((\" Exa 1 2 2 mple\")).equals((\"-Exa_1_2_2_mple\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return 2^n modulo p (be aware of numerics).\n // >>> modp((3l), (5l))\n // (3l)\n // >>> modp((1101l), (101l))\n // (2l)\n // >>> modp((0l), (101l))\n // (1l)\n // >>> modp((3l), (11l))\n // (8l)\n // >>> modp((100l), (101l))\n // (1l)\n public static long modp(long n, long p) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(modp((3l), (5l)) == (3l));\n assert(modp((1101l), (101l)) == (2l));\n assert(modp((0l), (101l)) == (1l));\n assert(modp((3l), (11l)) == (8l));\n assert(modp((100l), (101l)) == (1l));\n assert(modp((30l), (5l)) == (4l));\n assert(modp((31l), (5l)) == (3l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You have to write a function which validates a given date string and\n // returns true if the date is valid otherwise false.\n // The date is valid if all of the following rules are satisfied:\n // 1. The date string is not empty.\n // 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n // 3. The months should not be less than 1 or higher than 12.\n // 4. The date should be in the format: mm-dd-yyyy\n // >>> validDate((\"03-11-2000\"))\n // (true)\n // >>> validDate((\"15-01-2012\"))\n // (false)\n // >>> validDate((\"04-0-2040\"))\n // (false)\n // >>> validDate((\"06-04-2020\"))\n // (true)\n // >>> validDate((\"06/04/2020\"))\n // (false)\n public static boolean validDate(String date) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(validDate((\"03-11-2000\")) == (true));\n assert(validDate((\"15-01-2012\")) == (false));\n assert(validDate((\"04-0-2040\")) == (false));\n assert(validDate((\"06-04-2020\")) == (true));\n assert(validDate((\"01-01-2007\")) == (true));\n assert(validDate((\"03-32-2011\")) == (false));\n assert(validDate((\"\")) == (false));\n assert(validDate((\"04-31-3000\")) == (false));\n assert(validDate((\"06-06-2005\")) == (true));\n assert(validDate((\"21-31-2000\")) == (false));\n assert(validDate((\"04-12-2003\")) == (true));\n assert(validDate((\"04122003\")) == (false));\n assert(validDate((\"20030412\")) == (false));\n assert(validDate((\"2003-04\")) == (false));\n assert(validDate((\"2003-04-12\")) == (false));\n assert(validDate((\"04-2003\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that takes a string and returns an ordered version of it.\n // Ordered version of string, is a string where all words (separated by space)\n // are replaced by a new word where all the characters arranged in\n // ascending order based on ascii value.\n // Note: You should keep the order of words and blank spaces in the sentence.\n // For example:\n // >>> antiShuffle((\"Hi\"))\n // (\"Hi\")\n // >>> antiShuffle((\"hello\"))\n // (\"ehllo\")\n // >>> antiShuffle((\"Hello World!!!\"))\n // (\"Hello !!!Wdlor\")\n public static String antiShuffle(String s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(antiShuffle((\"Hi\")).equals((\"Hi\")));\n assert(antiShuffle((\"hello\")).equals((\"ehllo\")));\n assert(antiShuffle((\"number\")).equals((\"bemnru\")));\n assert(antiShuffle((\"abcd\")).equals((\"abcd\")));\n assert(antiShuffle((\"Hello World!!!\")).equals((\"Hello !!!Wdlor\")));\n assert(antiShuffle((\"\")).equals((\"\")));\n assert(antiShuffle((\"Hi. My name is Mister Robot. How are you?\")).equals((\".Hi My aemn is Meirst .Rboot How aer ?ouy\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given an array array list of numbers, return whether or not they are sorted\n // in ascending order. If array list has more than 1 duplicate of the same\n // number, return false. Assume no negative numbers and only integers.\n // Examples\n // >>> isSorted((new ArrayList(Arrays.asList((long)5l))))\n // (true)\n // >>> isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l))))\n // (true)\n // >>> isSorted((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)4l, (long)5l))))\n // (false)\n // >>> isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l))))\n // (true)\n // >>> isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l, (long)7l))))\n // (true)\n // >>> isSorted((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)4l, (long)5l, (long)6l, (long)7l))))\n // (false)\n // >>> isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)2l, (long)3l, (long)3l, (long)4l))))\n // (true)\n // >>> isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)2l, (long)2l, (long)3l, (long)4l))))\n // (false)\n public static boolean isSorted(ArrayList lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(isSorted((new ArrayList(Arrays.asList((long)5l)))) == (true));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l)))) == (true));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)4l, (long)5l)))) == (false));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)))) == (true));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l, (long)7l)))) == (true));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)4l, (long)5l, (long)6l, (long)7l)))) == (false));\n assert(isSorted((new ArrayList(Arrays.asList()))) == (true));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l)))) == (true));\n assert(isSorted((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)1l)))) == (false));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)2l, (long)2l, (long)3l, (long)4l)))) == (false));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)3l, (long)3l, (long)4l)))) == (false));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)2l, (long)3l, (long)3l, (long)4l)))) == (true));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a string s.\n // Your task is to check if the string is hapjava or not.\n // A string is hapjava if its length is at least 3 and every 3 consecutive letters are distinct\n // For example:\n // >>> isHappy((\"a\"))\n // (false)\n // >>> isHappy((\"aa\"))\n // (false)\n // >>> isHappy((\"abcd\"))\n // (true)\n // >>> isHappy((\"aabb\"))\n // (false)\n // >>> isHappy((\"adb\"))\n // (true)\n // >>> isHappy((\"xyy\"))\n // (false)\n public static boolean isHappy(String s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(isHappy((\"a\")) == (false));\n assert(isHappy((\"aa\")) == (false));\n assert(isHappy((\"abcd\")) == (true));\n assert(isHappy((\"aabb\")) == (false));\n assert(isHappy((\"adb\")) == (true));\n assert(isHappy((\"xyy\")) == (false));\n assert(isHappy((\"iopaxpoi\")) == (true));\n assert(isHappy((\"iopaxioi\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that returns true if the object q will fly, and false otherwise.\n // The object q will fly if it's balanced (it is a palindromic array list) and the sum of its elements is less than or equal the maximum possible weight w.\n // Example:\n // >>> willItFly((new ArrayList(Arrays.asList((long)1l, (long)2l))), (5l))\n // (false)\n // # 1+2 is less than the maximum possible weight, but it's unbalanced.\n // >>> willItFly((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)3l))), (1l))\n // (false)\n // # it's balanced, but 3+2+3 is more than the maximum possible weight.\n // >>> willItFly((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)3l))), (9l))\n // (true)\n // # 3+2+3 is less than the maximum possible weight, and it's balanced.\n // >>> willItFly((new ArrayList(Arrays.asList((long)3l))), (5l))\n // (true)\n // # 3 is less than the maximum possible weight, and it's balanced.\n public static boolean willItFly(ArrayList q, long w) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(willItFly((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)3l))), (9l)) == (true));\n assert(willItFly((new ArrayList(Arrays.asList((long)1l, (long)2l))), (5l)) == (false));\n assert(willItFly((new ArrayList(Arrays.asList((long)3l))), (5l)) == (true));\n assert(willItFly((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)3l))), (1l)) == (false));\n assert(willItFly((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))), (6l)) == (false));\n assert(willItFly((new ArrayList(Arrays.asList((long)5l))), (5l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given an array array list of non-negative integers, return a cojava of the given array array list after sorting,\n // you will sort the given array array list in ascending order if the sum( first index value, last index value) is odd,\n // or sort it in descending order if the sum( first index value, last index value) is even.\n // Note:\n // * don't change the given array array list.\n // Examples:\n // >>> sortArray((new ArrayList(Arrays.asList())))\n // (new ArrayList(Arrays.asList()))\n // >>> sortArray((new ArrayList(Arrays.asList((long)5l))))\n // (new ArrayList(Arrays.asList((long)5l)))\n // >>> sortArray((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)3l, (long)0l, (long)1l, (long)5l))))\n // (new ArrayList(Arrays.asList((long)0l, (long)1l, (long)2l, (long)3l, (long)4l, (long)5l)))\n // >>> sortArray((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)3l, (long)0l, (long)1l, (long)5l, (long)6l))))\n // (new ArrayList(Arrays.asList((long)6l, (long)5l, (long)4l, (long)3l, (long)2l, (long)1l, (long)0l)))\n public static ArrayList sortArray(ArrayList array) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(sortArray((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(sortArray((new ArrayList(Arrays.asList((long)5l)))).equals((new ArrayList(Arrays.asList((long)5l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)3l, (long)0l, (long)1l, (long)5l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)1l, (long)2l, (long)3l, (long)4l, (long)5l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)3l, (long)0l, (long)1l, (long)5l, (long)6l)))).equals((new ArrayList(Arrays.asList((long)6l, (long)5l, (long)4l, (long)3l, (long)2l, (long)1l, (long)0l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)2l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)2l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)15l, (long)42l, (long)87l, (long)32l, (long)11l, (long)0l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)11l, (long)15l, (long)32l, (long)42l, (long)87l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)21l, (long)14l, (long)23l, (long)11l)))).equals((new ArrayList(Arrays.asList((long)23l, (long)21l, (long)14l, (long)11l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Implement a function that takes an non-negative integer and returns an array array list of the first n\n // integers that are prime numbers and less than n.\n // for example:\n // >>> countUpTo((5l))\n // (new ArrayList(Arrays.asList((long)2l, (long)3l)))\n // >>> countUpTo((11l))\n // (new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l, (long)7l)))\n // >>> countUpTo((0l))\n // (new ArrayList(Arrays.asList()))\n // >>> countUpTo((20l))\n // (new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l, (long)7l, (long)11l, (long)13l, (long)17l, (long)19l)))\n // >>> countUpTo((1l))\n // (new ArrayList(Arrays.asList()))\n // >>> countUpTo((18l))\n // (new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l, (long)7l, (long)11l, (long)13l, (long)17l)))\n public static ArrayList countUpTo(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(countUpTo((5l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l)))));\n assert(countUpTo((6l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l)))));\n assert(countUpTo((7l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l)))));\n assert(countUpTo((10l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l, (long)7l)))));\n assert(countUpTo((0l)).equals((new ArrayList(Arrays.asList()))));\n assert(countUpTo((22l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l, (long)7l, (long)11l, (long)13l, (long)17l, (long)19l)))));\n assert(countUpTo((1l)).equals((new ArrayList(Arrays.asList()))));\n assert(countUpTo((18l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l, (long)7l, (long)11l, (long)13l, (long)17l)))));\n assert(countUpTo((47l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l, (long)7l, (long)11l, (long)13l, (long)17l, (long)19l, (long)23l, (long)29l, (long)31l, (long)37l, (long)41l, (long)43l)))));\n assert(countUpTo((101l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l, (long)7l, (long)11l, (long)13l, (long)17l, (long)19l, (long)23l, (long)29l, (long)31l, (long)37l, (long)41l, (long)43l, (long)47l, (long)53l, (long)59l, (long)61l, (long)67l, (long)71l, (long)73l, (long)79l, (long)83l, (long)89l, (long)97l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Out of array list of strings, return the longest one. Return the first one in case of multiple\n // strings of the same length. Return null in case the input array list is empty.\n // >>> longest((new ArrayList(Arrays.asList())))\n // Optional.empty()\n // >>> longest((new ArrayList(Arrays.asList((String)\"a\", (String)\"b\", (String)\"c\"))))\n // \"a\"\n // >>> longest((new ArrayList(Arrays.asList((String)\"a\", (String)\"bb\", (String)\"ccc\"))))\n // \"ccc\"\n public static Optional longest(ArrayList strings) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(longest((new ArrayList(Arrays.asList()))).equals(Optional.empty()));\n assert(longest((new ArrayList(Arrays.asList((String)\"x\", (String)\"y\", (String)\"z\")))).equals(\"x\"));\n assert(longest((new ArrayList(Arrays.asList((String)\"x\", (String)\"yyy\", (String)\"zzzz\", (String)\"www\", (String)\"kkkk\", (String)\"abc\")))).equals(\"zzzz\"));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given an array array list of integers, sort the integers that are between 1 and 9 inclusive,\n // reverse the resulting array array list, and then replace each digit by its corresponding name from\n // \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n // For example:\n // >>> byLength((new ArrayList(Arrays.asList((long)2l, (long)1l, (long)1l, (long)4l, (long)5l, (long)8l, (long)2l, (long)3l))))\n // (new ArrayList(Arrays.asList((String)\"Eight\", (String)\"Five\", (String)\"Four\", (String)\"Three\", (String)\"Two\", (String)\"Two\", (String)\"One\", (String)\"One\")))\n // If the array array list is empty, return an empty array array list:\n // >>> byLength((new ArrayList(Arrays.asList())))\n // (new ArrayList(Arrays.asList()))\n // If the array array list has any strange number ignore it:\n // >>> byLength((new ArrayList(Arrays.asList((long)1l, (long)-1l, (long)55l))))\n // (new ArrayList(Arrays.asList((String)\"One\")))\n public static ArrayList byLength(ArrayList arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(byLength((new ArrayList(Arrays.asList((long)2l, (long)1l, (long)1l, (long)4l, (long)5l, (long)8l, (long)2l, (long)3l)))).equals((new ArrayList(Arrays.asList((String)\"Eight\", (String)\"Five\", (String)\"Four\", (String)\"Three\", (String)\"Two\", (String)\"Two\", (String)\"One\", (String)\"One\")))));\n assert(byLength((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(byLength((new ArrayList(Arrays.asList((long)1l, (long)-1l, (long)55l)))).equals((new ArrayList(Arrays.asList((String)\"One\")))));\n assert(byLength((new ArrayList(Arrays.asList((long)1l, (long)-1l, (long)3l, (long)2l)))).equals((new ArrayList(Arrays.asList((String)\"Three\", (String)\"Two\", (String)\"One\")))));\n assert(byLength((new ArrayList(Arrays.asList((long)9l, (long)4l, (long)8l)))).equals((new ArrayList(Arrays.asList((String)\"Nine\", (String)\"Eight\", (String)\"Four\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_106_f", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Implement the function f that takes n as a parameter,\n // and returns an array array list of size n, such that the value of the element at index i is the factorial of i if i is even\n // or the sum of numbers from 1 to i otherwise.\n // i starts from 1.\n // the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n // Example:\n // >>> f((5l))\n // (new ArrayList(Arrays.asList((long)1l, (long)2l, (long)6l, (long)24l, (long)15l)))\n public static ArrayList f(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(f((5l)).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)6l, (long)24l, (long)15l)))));\n assert(f((7l)).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)6l, (long)24l, (long)15l, (long)720l, (long)28l)))));\n assert(f((1l)).equals((new ArrayList(Arrays.asList((long)1l)))));\n assert(f((3l)).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)6l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n // >>> fizzBuzz((50l))\n // (0l)\n // >>> fizzBuzz((78l))\n // (2l)\n // >>> fizzBuzz((79l))\n // (3l)\n public static long fizzBuzz(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(fizzBuzz((50l)) == (0l));\n assert(fizzBuzz((78l)) == (2l));\n assert(fizzBuzz((79l)) == (3l));\n assert(fizzBuzz((100l)) == (3l));\n assert(fizzBuzz((200l)) == (6l));\n assert(fizzBuzz((4000l)) == (192l));\n assert(fizzBuzz((10000l)) == (639l));\n assert(fizzBuzz((100000l)) == (8026l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a positive floating point number, it can be decomposed into\n // and integer part (largest integer smaller than given number) and decimals\n // (leftover part always smaller than 1).\n // Return the decimal part of the number.\n // >>> truncateNumber((3.5f))\n // (0.5f)\n public static float truncateNumber(float number) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(truncateNumber((3.5f)) == (0.5f));\n assert(truncateNumber((1.25f)) == (0.25f));\n assert(truncateNumber((123.0f)) == (0.0f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // For a given array list of integers, return a pair consisting of a sum and a product of all the integers in an array array list.\n // Empty sum should be equal to 0 and empty product should be equal to 1.\n // >>> sumProduct((new ArrayList(Arrays.asList())))\n // (Pair.with(0l, 1l))\n // >>> sumProduct((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l))))\n // (Pair.with(10l, 24l))\n public static Pair sumProduct(ArrayList numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(sumProduct((new ArrayList(Arrays.asList()))).equals((Pair.with(0l, 1l))));\n assert(sumProduct((new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l)))).equals((Pair.with(3l, 1l))));\n assert(sumProduct((new ArrayList(Arrays.asList((long)100l, (long)0l)))).equals((Pair.with(100l, 0l))));\n assert(sumProduct((new ArrayList(Arrays.asList((long)3l, (long)5l, (long)7l)))).equals((Pair.with(15l, 105l))));\n assert(sumProduct((new ArrayList(Arrays.asList((long)10l)))).equals((Pair.with(10l, 10l))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a 2 dimensional data, as a nested array lists,\n // which is similar to matrix, however, unlike matrices,\n // each row may contain a different number of columns.\n // Given lst, and integer x, find integers x in the array list,\n // and return array list of pairs, [(x1, y1), (x2, y2) ...] such that\n // each pair is a coordinate - (row, columns), starting with 0.\n // Sort coordinates initially by rows in ascending order.\n // Also, sort coordinates of the row by columns in descending order.\n // Examples:\n // >>> getRow((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)1l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)1l))))), (1l))\n // (new ArrayList>(Arrays.asList((Pair)Pair.with(0l, 0l), (Pair)Pair.with(1l, 4l), (Pair)Pair.with(1l, 0l), (Pair)Pair.with(2l, 5l), (Pair)Pair.with(2l, 0l))))\n // >>> getRow((new ArrayList>(Arrays.asList())), (1l))\n // (new ArrayList>(Arrays.asList()))\n // >>> getRow((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList()), (ArrayList)new ArrayList(Arrays.asList((long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))))), (3l))\n // (new ArrayList>(Arrays.asList((Pair)Pair.with(2l, 2l))))\n public static ArrayList> getRow(ArrayList> lst, long x) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(getRow((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)1l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)1l))))), (1l)).equals((new ArrayList>(Arrays.asList((Pair)Pair.with(0l, 0l), (Pair)Pair.with(1l, 4l), (Pair)Pair.with(1l, 0l), (Pair)Pair.with(2l, 5l), (Pair)Pair.with(2l, 0l))))));\n assert(getRow((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l))))), (2l)).equals((new ArrayList>(Arrays.asList((Pair)Pair.with(0l, 1l), (Pair)Pair.with(1l, 1l), (Pair)Pair.with(2l, 1l), (Pair)Pair.with(3l, 1l), (Pair)Pair.with(4l, 1l), (Pair)Pair.with(5l, 1l))))));\n assert(getRow((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)1l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)1l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)1l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)1l))))), (1l)).equals((new ArrayList>(Arrays.asList((Pair)Pair.with(0l, 0l), (Pair)Pair.with(1l, 0l), (Pair)Pair.with(2l, 1l), (Pair)Pair.with(2l, 0l), (Pair)Pair.with(3l, 2l), (Pair)Pair.with(3l, 0l), (Pair)Pair.with(4l, 3l), (Pair)Pair.with(4l, 0l), (Pair)Pair.with(5l, 4l), (Pair)Pair.with(5l, 0l), (Pair)Pair.with(6l, 5l), (Pair)Pair.with(6l, 0l))))));\n assert(getRow((new ArrayList>(Arrays.asList())), (1l)).equals((new ArrayList>(Arrays.asList()))));\n assert(getRow((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l))))), (2l)).equals((new ArrayList>(Arrays.asList()))));\n assert(getRow((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList()), (ArrayList)new ArrayList(Arrays.asList((long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))))), (3l)).equals((new ArrayList>(Arrays.asList((Pair)Pair.with(2l, 2l))))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You're a hungry rabbit, and you already have eaten a certain number of carrots,\n // but now you need to eat more carrots to complete the day's meals.\n // you should return an array array list of [ total number of eaten carrots after your meals,\n // the number of carrots left after your meals ]\n // if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n // Example:\n // >>> eat((5l), (6l), (10l))\n // (new ArrayList(Arrays.asList((long)11l, (long)4l)))\n // >>> eat((4l), (8l), (9l))\n // (new ArrayList(Arrays.asList((long)12l, (long)1l)))\n // >>> eat((1l), (10l), (10l))\n // (new ArrayList(Arrays.asList((long)11l, (long)0l)))\n // >>> eat((2l), (11l), (5l))\n // (new ArrayList(Arrays.asList((long)7l, (long)0l)))\n // Variables:\n // @number : integer\n // the number of carrots that you have eaten.\n // @need : integer\n // the number of carrots that you need to eat.\n // @remaining : integer\n // the number of remaining carrots thet exist in stock\n // Constrain:\n // * 0 <= number <= 1000\n // * 0 <= need <= 1000\n // * 0 <= remaining <= 1000\n // Have fun :)\n public static ArrayList eat(long number, long need, long remaining) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(eat((5l), (6l), (10l)).equals((new ArrayList(Arrays.asList((long)11l, (long)4l)))));\n assert(eat((4l), (8l), (9l)).equals((new ArrayList(Arrays.asList((long)12l, (long)1l)))));\n assert(eat((1l), (10l), (10l)).equals((new ArrayList(Arrays.asList((long)11l, (long)0l)))));\n assert(eat((2l), (11l), (5l)).equals((new ArrayList(Arrays.asList((long)7l, (long)0l)))));\n assert(eat((4l), (5l), (7l)).equals((new ArrayList(Arrays.asList((long)9l, (long)2l)))));\n assert(eat((4l), (5l), (1l)).equals((new ArrayList(Arrays.asList((long)5l, (long)0l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a positive integer N, return the total sum of its digits in binary.\n // Example\n // >>> solve((1000l))\n // (\"1\")\n // >>> solve((150l))\n // (\"110\")\n // >>> solve((147l))\n // (\"1100\")\n // Variables:\n // @N integer\n // Constraints: 0 \u2264 N \u2264 10000.\n // Output:\n // a string of binary number\n public static String solve(long N) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(solve((1000l)).equals((\"1\")));\n assert(solve((150l)).equals((\"110\")));\n assert(solve((147l)).equals((\"1100\")));\n assert(solve((333l)).equals((\"1001\")));\n assert(solve((963l)).equals((\"10010\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given an array array list of integers.\n // You need to find the largest prime value and return the sum of its digits.\n // Examples:\n // >>> skjkasdkd((new ArrayList(Arrays.asList((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, (long)3l))))\n // (10l)\n // >>> skjkasdkd((new ArrayList(Arrays.asList((long)1l, (long)0l, (long)1l, (long)8l, (long)2l, (long)4597l, (long)2l, (long)1l, (long)3l, (long)40l, (long)1l, (long)2l, (long)1l, (long)2l, (long)4l, (long)2l, (long)5l, (long)1l))))\n // (25l)\n // >>> skjkasdkd((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)1l, (long)32l, (long)5107l, (long)34l, (long)83278l, (long)109l, (long)163l, (long)23l, (long)2323l, (long)32l, (long)30l, (long)1l, (long)9l, (long)3l))))\n // (13l)\n // >>> skjkasdkd((new ArrayList(Arrays.asList((long)0l, (long)724l, (long)32l, (long)71l, (long)99l, (long)32l, (long)6l, (long)0l, (long)5l, (long)91l, (long)83l, (long)0l, (long)5l, (long)6l))))\n // (11l)\n // >>> skjkasdkd((new ArrayList(Arrays.asList((long)0l, (long)81l, (long)12l, (long)3l, (long)1l, (long)21l))))\n // (3l)\n // >>> skjkasdkd((new ArrayList(Arrays.asList((long)0l, (long)8l, (long)1l, (long)2l, (long)1l, (long)7l))))\n // (7l)\n public static long skjkasdkd(ArrayList lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(skjkasdkd((new ArrayList(Arrays.asList((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, (long)3l)))) == (10l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)1l, (long)0l, (long)1l, (long)8l, (long)2l, (long)4597l, (long)2l, (long)1l, (long)3l, (long)40l, (long)1l, (long)2l, (long)1l, (long)2l, (long)4l, (long)2l, (long)5l, (long)1l)))) == (25l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)1l, (long)32l, (long)5107l, (long)34l, (long)83278l, (long)109l, (long)163l, (long)23l, (long)2323l, (long)32l, (long)30l, (long)1l, (long)9l, (long)3l)))) == (13l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)0l, (long)724l, (long)32l, (long)71l, (long)99l, (long)32l, (long)6l, (long)0l, (long)5l, (long)91l, (long)83l, (long)0l, (long)5l, (long)6l)))) == (11l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)0l, (long)81l, (long)12l, (long)3l, (long)1l, (long)21l)))) == (3l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)0l, (long)8l, (long)1l, (long)2l, (long)1l, (long)7l)))) == (7l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)8191l)))) == (19l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)8191l, (long)123456l, (long)127l, (long)7l)))) == (19l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)127l, (long)97l, (long)8192l)))) == (10l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given an array array list arr of integers, find the minimum number of elements that\n // need to be changed to make the array array list palindromic. A palindromic array array list is an array array list that\n // is read the same backwards and forwards. In one change, you can change one element to any other element.\n // For example:\n // >>> smallestChange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)5l, (long)4l, (long)7l, (long)9l, (long)6l))))\n // (4l)\n // >>> smallestChange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)3l, (long)2l, (long)2l))))\n // (1l)\n // >>> smallestChange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)2l, (long)1l))))\n // (0l)\n public static long smallestChange(ArrayList arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(smallestChange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)5l, (long)4l, (long)7l, (long)9l, (long)6l)))) == (4l));\n assert(smallestChange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)3l, (long)2l, (long)2l)))) == (1l));\n assert(smallestChange((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)2l)))) == (1l));\n assert(smallestChange((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)4l, (long)2l)))) == (1l));\n assert(smallestChange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)2l, (long)1l)))) == (0l));\n assert(smallestChange((new ArrayList(Arrays.asList((long)3l, (long)1l, (long)1l, (long)3l)))) == (0l));\n assert(smallestChange((new ArrayList(Arrays.asList((long)1l)))) == (0l));\n assert(smallestChange((new ArrayList(Arrays.asList((long)0l, (long)1l)))) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // It is the last week of the semester and the teacher has to give the grades\n // to students. The teacher has been making her own algorithm for grading.\n // The only problem is, she has lost the code she used for grading.\n // She has given you an array array list of GPAs for some students and you have to write \n // a function that can output an array array list of letter grades using the following table:\n // GPA | Letter grade\n // 4.0 A+\n // > 3.7 A \n // > 3.3 A- \n // > 3.0 B+\n // > 2.7 B \n // > 2.3 B-\n // > 2.0 C+\n // > 1.7 C\n // > 1.3 C-\n // > 1.0 D+ \n // > 0.7 D \n // > 0.0 D-\n // 0.0 E\n // Example:\n // >>> gradeEquation((new ArrayList(Arrays.asList((float)4.0f, (float)3l, (float)1.7f, (float)2l, (float)3.5f))))\n // (new ArrayList(Arrays.asList((String)\"A+\", (String)\"B\", (String)\"C-\", (String)\"C\", (String)\"A-\")))\n public static ArrayList numericalLetterGrade(ArrayList grades) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(numericalLetterGrade((new ArrayList(Arrays.asList((float)4.0f, (float)3l, (float)1.7f, (float)2l, (float)3.5f)))).equals((new ArrayList(Arrays.asList((String)\"A+\", (String)\"B\", (String)\"C-\", (String)\"C\", (String)\"A-\")))));\n assert(numericalLetterGrade((new ArrayList(Arrays.asList((float)1.2f)))).equals((new ArrayList(Arrays.asList((String)\"D+\")))));\n assert(numericalLetterGrade((new ArrayList(Arrays.asList((float)0.5f)))).equals((new ArrayList(Arrays.asList((String)\"D-\")))));\n assert(numericalLetterGrade((new ArrayList(Arrays.asList((float)0.0f)))).equals((new ArrayList(Arrays.asList((String)\"E\")))));\n assert(numericalLetterGrade((new ArrayList(Arrays.asList((float)1.0f, (float)0.3f, (float)1.5f, (float)2.8f, (float)3.3f)))).equals((new ArrayList(Arrays.asList((String)\"D\", (String)\"D-\", (String)\"C-\", (String)\"B\", (String)\"B+\")))));\n assert(numericalLetterGrade((new ArrayList(Arrays.asList((float)0.0f, (float)0.7f)))).equals((new ArrayList(Arrays.asList((String)\"E\", (String)\"D-\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given the lengths of the three sides of a triangle. Return the area of\n // the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n // Otherwise return -1\n // Three sides make a valid triangle when the sum of any two sides is greater \n // than the third side.\n // Example:\n // >>> triangleArea((3l), (4l), (5l))\n // (6.0f)\n // >>> triangleArea((1l), (2l), (10l))\n // (float)-1l\n public static float triangleArea(long a, long b, long c) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(triangleArea((3l), (4l), (5l)) == (6.0f));\n assert(triangleArea((1l), (2l), (10l)) == (float)-1l);\n assert(triangleArea((4l), (8l), (5l)) == (8.18f));\n assert(triangleArea((2l), (2l), (2l)) == (1.73f));\n assert(triangleArea((1l), (2l), (3l)) == (float)-1l);\n assert(triangleArea((10l), (5l), (7l)) == (16.25f));\n assert(triangleArea((2l), (6l), (3l)) == (float)-1l);\n assert(triangleArea((1l), (1l), (1l)) == (0.43f));\n assert(triangleArea((2l), (2l), (10l)) == (float)-1l);\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Check if two words have the same characters.\n // >>> sameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddeddabc\"))\n // (true)\n // >>> sameChars((\"abcd\"), (\"dddddddabc\"))\n // (true)\n // >>> sameChars((\"dddddddabc\"), (\"abcd\"))\n // (true)\n // >>> sameChars((\"eabcd\"), (\"dddddddabc\"))\n // (false)\n // >>> sameChars((\"abcd\"), (\"dddddddabce\"))\n // (false)\n // >>> sameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddddabc\"))\n // (false)\n public static boolean sameChars(String s0, String s1) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(sameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddeddabc\")) == (true));\n assert(sameChars((\"abcd\"), (\"dddddddabc\")) == (true));\n assert(sameChars((\"dddddddabc\"), (\"abcd\")) == (true));\n assert(sameChars((\"eabcd\"), (\"dddddddabc\")) == (false));\n assert(sameChars((\"abcd\"), (\"dddddddabcf\")) == (false));\n assert(sameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddddabc\")) == (false));\n assert(sameChars((\"aabb\"), (\"aaccc\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given an array array list of integers nums, find the minimum sum of any non-empty sub-array array list\n // of nums.\n // Example\n // >>> minSubArraySum((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)4l, (long)1l, (long)2l, (long)4l))))\n // (1l)\n // >>> minSubArraySum((new ArrayList(Arrays.asList((long)-1l, (long)-2l, (long)-3l))))\n // (-6l)\n public static long minSubArraySum(ArrayList nums) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)4l, (long)1l, (long)2l, (long)4l)))) == (1l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)-1l, (long)-2l, (long)-3l)))) == (-6l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)-1l, (long)-2l, (long)-3l, (long)2l, (long)-10l)))) == (-14l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)-9999999999999999l)))) == (-9999999999999999l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)0l, (long)10l, (long)20l, (long)1000000l)))) == (0l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)-1l, (long)-2l, (long)-3l, (long)10l, (long)-5l)))) == (-6l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)100l, (long)-1l, (long)-2l, (long)-3l, (long)10l, (long)-5l)))) == (-6l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)10l, (long)11l, (long)13l, (long)8l, (long)3l, (long)4l)))) == (3l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)100l, (long)-33l, (long)32l, (long)-1l, (long)0l, (long)-2l)))) == (-33l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)-10l)))) == (-10l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)7l)))) == (7l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)1l, (long)-1l)))) == (-1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a string s and a natural number n, you have been tasked to implement \n // a function that returns an array array list of all words from string s that contain exactly \n // n consonants, in order these words appear in the string s.\n // If the string s is empty then the function should return an empty array list.\n // Note: you may assume the input string contains only letters and spaces.\n // Examples:\n // >>> selectWords((\"Mary had a little lamb\"), (4l))\n // (new ArrayList(Arrays.asList((String)\"little\")))\n // >>> selectWords((\"Mary had a little lamb\"), (3l))\n // (new ArrayList(Arrays.asList((String)\"Mary\", (String)\"lamb\")))\n // >>> selectWords((\"simple white space\"), (2l))\n // (new ArrayList(Arrays.asList()))\n // >>> selectWords((\"Hello world\"), (4l))\n // (new ArrayList(Arrays.asList((String)\"world\")))\n // >>> selectWords((\"Uncle sam\"), (3l))\n // (new ArrayList(Arrays.asList((String)\"Uncle\")))\n public static ArrayList selectWords(String s, long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(selectWords((\"Mary had a little lamb\"), (4l)).equals((new ArrayList(Arrays.asList((String)\"little\")))));\n assert(selectWords((\"Mary had a little lamb\"), (3l)).equals((new ArrayList(Arrays.asList((String)\"Mary\", (String)\"lamb\")))));\n assert(selectWords((\"simple white space\"), (2l)).equals((new ArrayList(Arrays.asList()))));\n assert(selectWords((\"Hello world\"), (4l)).equals((new ArrayList(Arrays.asList((String)\"world\")))));\n assert(selectWords((\"Uncle sam\"), (3l)).equals((new ArrayList(Arrays.asList((String)\"Uncle\")))));\n assert(selectWords((\"\"), (4l)).equals((new ArrayList(Arrays.asList()))));\n assert(selectWords((\"a b c d e f\"), (1l)).equals((new ArrayList(Arrays.asList((String)\"b\", (String)\"c\", (String)\"d\", (String)\"f\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return array list of all prefixes from shortest to longest of the input string\n // >>> allPrefixes((\"abc\"))\n // (new ArrayList(Arrays.asList((String)\"a\", (String)\"ab\", (String)\"abc\")))\n public static ArrayList allPrefixes(String string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(allPrefixes((\"\")).equals((new ArrayList(Arrays.asList()))));\n assert(allPrefixes((\"asdfgh\")).equals((new ArrayList(Arrays.asList((String)\"a\", (String)\"as\", (String)\"asd\", (String)\"asdf\", (String)\"asdfg\", (String)\"asdfgh\")))));\n assert(allPrefixes((\"WWW\")).equals((new ArrayList(Arrays.asList((String)\"W\", (String)\"WW\", (String)\"WWW\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function that takes a value (string) representing a number\n // and returns the closest integer to it. If the number is equidistant\n // from two integers, round it away from zero.\n // Examples\n // >>> closestInteger((\"10\"))\n // (10l)\n // >>> closestInteger((\"15.3\"))\n // (15l)\n // Note:\n // Rounding away from zero means that if the given number is equidistant\n // from two integers, the one you should return is the one that is the\n // farthest from zero. For example closest_integer(\"14.5\") should\n // return 15 and closest_integer(\"-14.5\") should return -15.\n public static long closestInteger(String value) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(closestInteger((\"10\")) == (10l));\n assert(closestInteger((\"14.5\")) == (15l));\n assert(closestInteger((\"-15.5\")) == (-16l));\n assert(closestInteger((\"15.3\")) == (15l));\n assert(closestInteger((\"0\")) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function which takes a string representing a file's name, and returns\n // 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n // A file's name is considered to be valid if and only if all the following conditions \n // are met:\n // - There should not be more than three digits ('0'-'9') in the file's name.\n // - The file's name contains exactly one dot '.'\n // - The substring before the dot should not be empty, and it starts with a letter from \n // the latin alphapet ('a'-'z' and 'A'-'Z').\n // - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n // Examples:\n // >>> fileNameCheck((\"example.txt\"))\n // (\"Yes\")\n // >>> fileNameCheck((\"1example.dll\"))\n // (\"No\")\n public static String fileNameCheck(String file_name) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(fileNameCheck((\"example.txt\")).equals((\"Yes\")));\n assert(fileNameCheck((\"1example.dll\")).equals((\"No\")));\n assert(fileNameCheck((\"s1sdf3.asd\")).equals((\"No\")));\n assert(fileNameCheck((\"K.dll\")).equals((\"Yes\")));\n assert(fileNameCheck((\"MY16FILE3.exe\")).equals((\"Yes\")));\n assert(fileNameCheck((\"His12FILE94.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"_Y.txt\")).equals((\"No\")));\n assert(fileNameCheck((\"?aREYA.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"/this_is_valid.dll\")).equals((\"No\")));\n assert(fileNameCheck((\"this_is_valid.wow\")).equals((\"No\")));\n assert(fileNameCheck((\"this_is_valid.txt\")).equals((\"Yes\")));\n assert(fileNameCheck((\"this_is_valid.txtexe\")).equals((\"No\")));\n assert(fileNameCheck((\"#this2_i4s_5valid.ten\")).equals((\"No\")));\n assert(fileNameCheck((\"@this1_is6_valid.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"this_is_12valid.6exe4.txt\")).equals((\"No\")));\n assert(fileNameCheck((\"all.exe.txt\")).equals((\"No\")));\n assert(fileNameCheck((\"I563_No.exe\")).equals((\"Yes\")));\n assert(fileNameCheck((\"Is3youfault.txt\")).equals((\"Yes\")));\n assert(fileNameCheck((\"no_one#knows.dll\")).equals((\"Yes\")));\n assert(fileNameCheck((\"1I563_Yes3.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"I563_Yes3.txtt\")).equals((\"No\")));\n assert(fileNameCheck((\"final..txt\")).equals((\"No\")));\n assert(fileNameCheck((\"final132\")).equals((\"No\")));\n assert(fileNameCheck((\"_f4indsartal132.\")).equals((\"No\")));\n assert(fileNameCheck((\".txt\")).equals((\"No\")));\n assert(fileNameCheck((\"s.\")).equals((\"No\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given two intervals,\n // where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n // The given intervals are closed which means that the interval (start, end)\n // includes both start and end.\n // For each given interval, it is assumed that its start is less or equal its end.\n // Your task is to determine whether the length of intersection of these two \n // intervals is a prime number.\n // Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n // which its length is 1, which not a prime number.\n // If the length of the intersection is a prime number, return \"YES\",\n // otherwise, return \"NO\".\n // If the two intervals don't intersect, return \"NO\".\n // [input/output] samples:\n // >>> intersection((Pair.with(1l, 2l)), (Pair.with(2l, 3l)))\n // (\"NO\")\n // >>> intersection((Pair.with(-1l, 1l)), (Pair.with(0l, 4l)))\n // (\"NO\")\n // >>> intersection((Pair.with(-3l, -1l)), (Pair.with(-5l, 5l)))\n // (\"YES\")\n public static String intersection(Pair interval1, Pair interval2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(intersection((Pair.with(1l, 2l)), (Pair.with(2l, 3l))).equals((\"NO\")));\n assert(intersection((Pair.with(-1l, 1l)), (Pair.with(0l, 4l))).equals((\"NO\")));\n assert(intersection((Pair.with(-3l, -1l)), (Pair.with(-5l, 5l))).equals((\"YES\")));\n assert(intersection((Pair.with(-2l, 2l)), (Pair.with(-4l, 0l))).equals((\"YES\")));\n assert(intersection((Pair.with(-11l, 2l)), (Pair.with(-1l, -1l))).equals((\"NO\")));\n assert(intersection((Pair.with(1l, 2l)), (Pair.with(3l, 5l))).equals((\"NO\")));\n assert(intersection((Pair.with(1l, 2l)), (Pair.with(1l, 2l))).equals((\"NO\")));\n assert(intersection((Pair.with(-2l, -2l)), (Pair.with(-3l, -2l))).equals((\"NO\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return the largest prime factor of n. Assume n > 1 and is not a prime.\n // >>> largestPrimeFactor((13195l))\n // (29l)\n // >>> largestPrimeFactor((2048l))\n // (2l)\n public static long largestPrimeFactor(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(largestPrimeFactor((15l)) == (5l));\n assert(largestPrimeFactor((27l)) == (3l));\n assert(largestPrimeFactor((63l)) == (7l));\n assert(largestPrimeFactor((330l)) == (11l));\n assert(largestPrimeFactor((13195l)) == (29l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a string, find out how many distinct characters (regardless of case) does it consist of\n // >>> countDistinctCharacters((\"xyzXYZ\"))\n // (3l)\n // >>> countDistinctCharacters((\"Jerry\"))\n // (4l)\n public static long countDistinctCharacters(String string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(countDistinctCharacters((\"\")) == (0l));\n assert(countDistinctCharacters((\"abcde\")) == (5l));\n assert(countDistinctCharacters((\"abcdecadeCADE\")) == (5l));\n assert(countDistinctCharacters((\"aaaaAAAAaaaa\")) == (1l));\n assert(countDistinctCharacters((\"Jerry jERRY JeRRRY\")) == (5l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You're given an array array list of deposit and withdrawal operations on a bank account that starts with\n // zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n // at that point function should return true. Otherwise it should return false.\n // >>> belowZero((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))))\n // (false)\n // >>> belowZero((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)-4l, (long)5l))))\n // (true)\n public static boolean belowZero(ArrayList operations) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(belowZero((new ArrayList(Arrays.asList()))) == (false));\n assert(belowZero((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)-3l, (long)1l, (long)2l, (long)-3l)))) == (false));\n assert(belowZero((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)-4l, (long)5l, (long)6l)))) == (true));\n assert(belowZero((new ArrayList(Arrays.asList((long)1l, (long)-1l, (long)2l, (long)-2l, (long)5l, (long)-5l, (long)4l, (long)-4l)))) == (false));\n assert(belowZero((new ArrayList(Arrays.asList((long)1l, (long)-1l, (long)2l, (long)-2l, (long)5l, (long)-5l, (long)4l, (long)-5l)))) == (true));\n assert(belowZero((new ArrayList(Arrays.asList((long)1l, (long)-2l, (long)2l, (long)-2l, (long)5l, (long)-5l, (long)4l, (long)-4l)))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Find the shortest palindrome that begins with a supplied string.\n // Algorithm idea is simple:\n // - Find the longest postfix of supplied string that is a palindrome.\n // - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n // >>> makePalindrome((\"\"))\n // (\"\")\n // >>> makePalindrome((\"cat\"))\n // (\"catac\")\n // >>> makePalindrome((\"cata\"))\n // (\"catac\")\n public static String makePalindrome(String string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(makePalindrome((\"\")).equals((\"\")));\n assert(makePalindrome((\"x\")).equals((\"x\")));\n assert(makePalindrome((\"xyz\")).equals((\"xyzyx\")));\n assert(makePalindrome((\"xyx\")).equals((\"xyx\")));\n assert(makePalindrome((\"jerry\")).equals((\"jerryrrej\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a positive integer, obtain its roman numeral equivalent as a string,\n // and return it in lowercase.\n // Restrictions: 1 <= num <= 1000\n // Examples:\n // >>> intToMiniRoman((19l))\n // (\"xix\")\n // >>> intToMiniRoman((152l))\n // (\"clii\")\n // >>> intToMiniRoman((426l))\n // (\"cdxxvi\")\n public static String intToMiniRoman(long number) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "reworded", - "tests": " }\n public static void main(String[] args) {\n assert(intToMiniRoman((19l)).equals((\"xix\")));\n assert(intToMiniRoman((152l)).equals((\"clii\")));\n assert(intToMiniRoman((251l)).equals((\"ccli\")));\n assert(intToMiniRoman((426l)).equals((\"cdxxvi\")));\n assert(intToMiniRoman((500l)).equals((\"d\")));\n assert(intToMiniRoman((1l)).equals((\"i\")));\n assert(intToMiniRoman((4l)).equals((\"iv\")));\n assert(intToMiniRoman((43l)).equals((\"xliii\")));\n assert(intToMiniRoman((90l)).equals((\"xc\")));\n assert(intToMiniRoman((94l)).equals((\"xciv\")));\n assert(intToMiniRoman((532l)).equals((\"dxxxii\")));\n assert(intToMiniRoman((900l)).equals((\"cm\")));\n assert(intToMiniRoman((994l)).equals((\"cmxciv\")));\n assert(intToMiniRoman((1000l)).equals((\"m\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - } -] \ No newline at end of file diff --git a/data/java-transform.json b/data/java-transform.json deleted file mode 100644 index a806ec154dda5ebddb5a287566fa98fbab0757ae..0000000000000000000000000000000000000000 --- a/data/java-transform.json +++ /dev/null @@ -1,1898 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // For a given number n, find the largest number that divides n evenly, smaller than n\n // >>> largestDivisor((15l))\n // (5l)\n public static long largestDivisor(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(largestDivisor((3l)) == (1l));\n assert(largestDivisor((7l)) == (1l));\n assert(largestDivisor((10l)) == (5l));\n assert(largestDivisor((100l)) == (50l));\n assert(largestDivisor((49l)) == (7l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_47_median", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return median of elements in the list l.\n // >>> median((new ArrayList(Arrays.asList((long)3l, (long)1l, (long)2l, (long)4l, (long)5l))))\n // (float)3l\n // >>> median((new ArrayList(Arrays.asList((long)-10l, (long)4l, (long)6l, (long)1000l, (long)10l, (long)20l))))\n // (15.0f)\n public static float median(ArrayList l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(median((new ArrayList(Arrays.asList((long)3l, (long)1l, (long)2l, (long)4l, (long)5l)))) == (float)3l);\n assert(median((new ArrayList(Arrays.asList((long)-10l, (long)4l, (long)6l, (long)1000l, (long)10l, (long)20l)))) == (8.0f));\n assert(median((new ArrayList(Arrays.asList((long)5l)))) == (float)5l);\n assert(median((new ArrayList(Arrays.asList((long)6l, (long)5l)))) == (5.5f));\n assert(median((new ArrayList(Arrays.asList((long)8l, (long)1l, (long)3l, (long)9l, (long)9l, (long)2l, (long)7l)))) == (float)7l);\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given two lists operator, and operand. The first list has basic algebra operations, and \n // the second list is a list of integers. Use the two given lists to build the algebric \n // expression and return the evaluation of this expression.\n // The basic algebra operations:\n // Addition ( + ) \n // Subtraction ( - ) \n // Multiplication ( * ) \n // Floor division ( // ) \n // Exponentiation ( ** ) \n // Example:\n // operator['+', '*', '-']\n // array = [2, 3, 4, 5]\n // result = 2 + 3 * 4 - 5\n // => result = 9\n // Note:\n // The length of operator list is equal to the length of operand list minus one.\n // Operand is a list of of non-negative integers.\n // Operator list has at least one operator, and operand list has at least two operands.\n public static long doAlgebra(ArrayList op, ArrayList operand) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(doAlgebra((new ArrayList(Arrays.asList((String)\"**\", (String)\"*\", (String)\"+\"))), (new ArrayList(Arrays.asList((long)2l, (long)3l, (long)4l, (long)5l)))) == (37l));\n assert(doAlgebra((new ArrayList(Arrays.asList((String)\"+\", (String)\"*\", (String)\"-\"))), (new ArrayList(Arrays.asList((long)2l, (long)3l, (long)4l, (long)5l)))) == (9l));\n assert(doAlgebra((new ArrayList(Arrays.asList((String)\"//\", (String)\"*\"))), (new ArrayList(Arrays.asList((long)7l, (long)3l, (long)4l)))) == (8l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return maximum element in the list.\n // >>> maxElement((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))))\n // (3l)\n // >>> maxElement((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)-5l, (long)2l, (long)-3l, (long)3l, (long)9l, (long)0l, (long)123l, (long)1l, (long)-10l))))\n // (123l)\n public static long maxElement(ArrayList l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(maxElement((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)))) == (3l));\n assert(maxElement((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)-5l, (long)2l, (long)-3l, (long)3l, (long)9l, (long)0l, (long)124l, (long)1l, (long)-10l)))) == (124l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function which returns the largest index of an element which\n // is not greater than or equal to the element immediately preceding it. If\n // no such element exists then return -1. The given array will not contain\n // duplicate values.\n // Examples:\n // >>> canArrange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)4l, (long)3l, (long)5l))))\n // (3l)\n // >>> canArrange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))))\n // (-1l)\n public static long canArrange(ArrayList arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(canArrange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)4l, (long)3l, (long)5l)))) == (3l));\n assert(canArrange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)4l, (long)5l)))) == (-1l));\n assert(canArrange((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)2l, (long)5l, (long)6l, (long)7l, (long)8l, (long)9l, (long)10l)))) == (2l));\n assert(canArrange((new ArrayList(Arrays.asList((long)4l, (long)8l, (long)5l, (long)7l, (long)3l)))) == (4l));\n assert(canArrange((new ArrayList(Arrays.asList()))) == (-1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Imagine a road that's a perfectly straight infinitely long line.\n // n cars are driving left to right; simultaneously, a different set of n cars\n // are driving right to left. The two sets of cars start out being very far from\n // each other. All cars move in the same speed. Two cars are said to collide\n // when a car that's moving left to right hits a car that's moving right to left.\n // However, the cars are infinitely sturdy and strong; as a result, they continue moving\n // in their trajectory as if they did not collide.\n // This function outputs the number of such collisions.\n public static long carRaceCollision(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(carRaceCollision((2l)) == (4l));\n assert(carRaceCollision((3l)) == (9l));\n assert(carRaceCollision((4l)) == (16l));\n assert(carRaceCollision((8l)) == (64l));\n assert(carRaceCollision((10l)) == (100l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function that returns True if the last character\n // of a given string is an alphabetical character and is not\n // a part of a word, and False otherwise.\n // Note: \"word\" is a group of characters separated by space.\n // Examples:\n // >>> checkIfLastCharIsALetter((\"apple pie\"))\n // (false)\n // >>> checkIfLastCharIsALetter((\"apple pi e\"))\n // (true)\n // >>> checkIfLastCharIsALetter((\"apple pi e \"))\n // (false)\n // >>> checkIfLastCharIsALetter((\"\"))\n // (false)\n public static boolean checkIfLastCharIsALetter(String txt) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(checkIfLastCharIsALetter((\"apple\")) == (false));\n assert(checkIfLastCharIsALetter((\"apple pi e\")) == (true));\n assert(checkIfLastCharIsALetter((\"eeeee\")) == (false));\n assert(checkIfLastCharIsALetter((\"A\")) == (true));\n assert(checkIfLastCharIsALetter((\"Pumpkin pie \")) == (false));\n assert(checkIfLastCharIsALetter((\"Pumpkin pie 1\")) == (false));\n assert(checkIfLastCharIsALetter((\"\")) == (false));\n assert(checkIfLastCharIsALetter((\"eeeee e \")) == (false));\n assert(checkIfLastCharIsALetter((\"apple pie\")) == (false));\n assert(checkIfLastCharIsALetter((\"apple pi e \")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return true if a given number is prime, and false otherwise.\n // >>> isPrime((6l))\n // (false)\n // >>> isPrime((101l))\n // (true)\n // >>> isPrime((11l))\n // (true)\n // >>> isPrime((13441l))\n // (true)\n // >>> isPrime((61l))\n // (true)\n // >>> isPrime((4l))\n // (false)\n // >>> isPrime((1l))\n // (false)\n public static boolean isPrime(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(isPrime((6l)) == (false));\n assert(isPrime((101l)) == (true));\n assert(isPrime((11l)) == (true));\n assert(isPrime((13441l)) == (true));\n assert(isPrime((61l)) == (true));\n assert(isPrime((4l)) == (false));\n assert(isPrime((1l)) == (false));\n assert(isPrime((5l)) == (true));\n assert(isPrime((11l)) == (true));\n assert(isPrime((17l)) == (true));\n assert(isPrime((85l)) == (false));\n assert(isPrime((77l)) == (false));\n assert(isPrime((255379l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a list of positive integers x. return a sorted list of all \n // elements that hasn't any even digit.\n // Note: Returned list should be sorted in increasing order.\n // For example:\n // >>> uniqueDigits((new ArrayList(Arrays.asList((long)15l, (long)33l, (long)1422l, (long)1l))))\n // (new ArrayList(Arrays.asList((long)1l, (long)15l, (long)33l)))\n // >>> uniqueDigits((new ArrayList(Arrays.asList((long)152l, (long)323l, (long)1422l, (long)10l))))\n // (new ArrayList(Arrays.asList()))\n public static ArrayList uniqueDigits(ArrayList x) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(uniqueDigits((new ArrayList(Arrays.asList((long)15l, (long)33l, (long)1422l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)15l, (long)33l)))));\n assert(uniqueDigits((new ArrayList(Arrays.asList((long)152l, (long)323l, (long)1422l, (long)10l)))).equals((new ArrayList(Arrays.asList()))));\n assert(uniqueDigits((new ArrayList(Arrays.asList((long)12345l, (long)2033l, (long)111l, (long)151l)))).equals((new ArrayList(Arrays.asList((long)111l, (long)151l)))));\n assert(uniqueDigits((new ArrayList(Arrays.asList((long)135l, (long)103l, (long)31l)))).equals((new ArrayList(Arrays.asList((long)31l, (long)135l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Input are two strings a and b consisting only of 1s and 0s.\n // Perform binary XOR on these inputs and return result also as a string.\n // >>> stringXor((\"010\"), (\"110\"))\n // (\"100\")\n public static String stringXor(String a, String b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(stringXor((\"111000\"), (\"101010\")).equals((\"010010\")));\n assert(stringXor((\"1\"), (\"1\")).equals((\"0\")));\n assert(stringXor((\"0101\"), (\"0000\")).equals((\"0101\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // sum_to_n is a function that sums numbers from 1 to n.\n // >>> sumToN((30l))\n // (465l)\n // >>> sumToN((100l))\n // (5050l)\n // >>> sumToN((5l))\n // (15l)\n // >>> sumToN((10l))\n // (55l)\n // >>> sumToN((1l))\n // (1l)\n public static long sumToN(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sumToN((1l)) == (1l));\n assert(sumToN((6l)) == (21l));\n assert(sumToN((11l)) == (66l));\n assert(sumToN((30l)) == (465l));\n assert(sumToN((100l)) == (5050l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a list of numbers, return the sum of squares of the numbers\n // in the list that are odd. Ignore numbers that are negative or not integers.\n // >>> doubleTheDifference((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)0l))))\n // (10l)\n // >>> doubleTheDifference((new ArrayList(Arrays.asList((long)-1l, (long)-2l, (long)0l))))\n // (0l)\n // >>> doubleTheDifference((new ArrayList(Arrays.asList((long)9l, (long)-2l))))\n // (81l)\n // >>> doubleTheDifference((new ArrayList(Arrays.asList((long)0l))))\n // (0l)\n // If the input list is empty, return 0.\n public static long doubleTheDifference(ArrayList lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(doubleTheDifference((new ArrayList(Arrays.asList()))) == (0l));\n assert(doubleTheDifference((new ArrayList(Arrays.asList((float)5.0f, (float)4.0f)))) == (25l));\n assert(doubleTheDifference((new ArrayList(Arrays.asList((float)0.1f, (float)0.2f, (float)0.3f)))) == (0l));\n assert(doubleTheDifference((new ArrayList(Arrays.asList((float)-10.0f, (float)-20.0f, (float)-30.0f)))) == (0l));\n assert(doubleTheDifference((new ArrayList(Arrays.asList((float)-1.0f, (float)-2.0f, (float)8.0f)))) == (0l));\n assert(doubleTheDifference((new ArrayList(Arrays.asList((float)0.2f, (float)3.0f, (float)5.0f)))) == (34l));\n assert(doubleTheDifference((new ArrayList(Arrays.asList((float)-9.0f, (float)-7.0f, (float)-5.0f, (float)-3.0f, (float)-1.0f, (float)1.0f, (float)3.0f, (float)5.0f, (float)7.0f, (float)9.0f)))) == (165l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return length of given string\n // >>> stringLength((\"\"))\n // (0l)\n // >>> stringLength((\"abc\"))\n // (3l)\n public static long strlen(String string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(strlen((\"\")) == (0l));\n assert(strlen((\"x\")) == (1l));\n assert(strlen((\"asdasnakj\")) == (9l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You'll be given a string of words, and your task is to count the number\n // of boredoms. A boredom is a sentence that starts with the word \"I\".\n // Sentences are delimited by '.', '?' or '!'.\n // For example:\n // >>> isBored((\"Hello world\"))\n // (0l)\n // >>> isBored((\"The sky is blue. The sun is shining. I love this weather\"))\n // (1l)\n public static long isBored(String S) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(isBored((\"Hello world\")) == (0l));\n assert(isBored((\"Is the sky blue?\")) == (0l));\n assert(isBored((\"I love It !\")) == (1l));\n assert(isBored((\"bIt\")) == (0l));\n assert(isBored((\"I feel good today. I will be productive. will kill It\")) == (2l));\n assert(isBored((\"You and I are going for a walk\")) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function vowels_count which takes a string representing\n // a word as input and returns the number of vowels in the string.\n // Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n // vowel, but only when it is at the end of the given word.\n // Example:\n // >>> vowelsCount((\"abcde\"))\n // (2l)\n // >>> vowelsCount((\"ACEDY\"))\n // (3l)\n public static long vowelsCount(String s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(vowelsCount((\"abcde\")) == (2l));\n assert(vowelsCount((\"Alone\")) == (3l));\n assert(vowelsCount((\"key\")) == (2l));\n assert(vowelsCount((\"bye\")) == (1l));\n assert(vowelsCount((\"keY\")) == (2l));\n assert(vowelsCount((\"bYe\")) == (1l));\n assert(vowelsCount((\"ACEDY\")) == (3l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return n-th Fibonacci number.\n // >>> fib((10l))\n // (55l)\n // >>> fib((1l))\n // (1l)\n // >>> fib((8l))\n // (21l)\n public static long fib(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(fib((10l)) == (55l));\n assert(fib((1l)) == (1l));\n assert(fib((8l)) == (21l));\n assert(fib((11l)) == (89l));\n assert(fib((12l)) == (144l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Your task is to implement a function that will simplify the expression\n // x * n. The function returns True if x * n evaluates to a whole number and False\n // otherwise. Both x and n, are string representation of a fraction, and have the following format,\n // / where both numerator and denominator are positive whole numbers.\n // You can assume that x, and n are valid fractions, and do not have zero as denominator.\n // >>> simplify((\"1/5\"), (\"5/1\"))\n // (true)\n // >>> simplify((\"1/6\"), (\"2/1\"))\n // (false)\n // >>> simplify((\"7/10\"), (\"10/2\"))\n // (false)\n public static boolean simplify(String x, String n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(simplify((\"1/5\"), (\"5/1\")) == (true));\n assert(simplify((\"1/6\"), (\"2/1\")) == (false));\n assert(simplify((\"5/1\"), (\"3/1\")) == (true));\n assert(simplify((\"7/10\"), (\"10/2\")) == (false));\n assert(simplify((\"2/10\"), (\"50/10\")) == (true));\n assert(simplify((\"7/2\"), (\"4/2\")) == (true));\n assert(simplify((\"11/6\"), (\"6/1\")) == (true));\n assert(simplify((\"2/3\"), (\"5/2\")) == (false));\n assert(simplify((\"5/2\"), (\"3/5\")) == (false));\n assert(simplify((\"2/4\"), (\"8/4\")) == (true));\n assert(simplify((\"2/4\"), (\"4/2\")) == (true));\n assert(simplify((\"1/5\"), (\"5/1\")) == (true));\n assert(simplify((\"1/5\"), (\"1/5\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a string s, count the number of uppercase vowels in even indices.\n // For example:\n // >>> countUpper((\"aBCdEf\"))\n // (1l)\n // >>> countUpper((\"abcdefg\"))\n // (0l)\n // >>> countUpper((\"dBBE\"))\n // (0l)\n public static long countUpper(String s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(countUpper((\"aBCdEf\")) == (1l));\n assert(countUpper((\"abcdefg\")) == (0l));\n assert(countUpper((\"dBBE\")) == (0l));\n assert(countUpper((\"B\")) == (0l));\n assert(countUpper((\"U\")) == (1l));\n assert(countUpper((\"\")) == (0l));\n assert(countUpper((\"EEEE\")) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a rectangular grid of wells. Each row represents a single well,\n // and each 1 in a row represents a single unit of water.\n // Each well has a corresponding bucket that can be used to extract water from it, \n // and all buckets have the same capacity.\n // Your task is to use the buckets to empty the wells.\n // Output the number of times you need to lower the buckets.\n // Example 1:\n // >>> maxFill((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)0l, (long)0l, (long)1l, (long)0l)), (ArrayList)new ArrayList(Arrays.asList((long)0l, (long)1l, (long)0l, (long)0l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l))))), (1l))\n // (6l)\n // Example 2:\n // >>> maxFill((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)0l, (long)0l, (long)1l, (long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l, (long)0l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)0l, (long)1l, (long)1l, (long)1l))))), (2l))\n // (5l)\n // Example 3:\n // >>> maxFill((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l)), (ArrayList)new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l))))), (5l))\n // (0l)\n // Constraints:\n // * all wells have the same length\n // * 1 <= grid.length <= 10^2\n // * 1 <= grid[:,1].length <= 10^2\n // * grid[i][j] -> 0 | 1\n // * 1 <= capacity <= 10\n public static long maxFill(ArrayList> grid, long capacity) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(maxFill((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)0l, (long)0l, (long)1l, (long)0l)), (ArrayList)new ArrayList(Arrays.asList((long)0l, (long)1l, (long)0l, (long)0l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l))))), (1l)) == (6l));\n assert(maxFill((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)0l, (long)0l, (long)1l, (long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l, (long)0l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)0l, (long)1l, (long)1l, (long)1l))))), (2l)) == (5l));\n assert(maxFill((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l)), (ArrayList)new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l))))), (5l)) == (0l));\n assert(maxFill((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l))))), (2l)) == (4l));\n assert(maxFill((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l))))), (9l)) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given an array arr of integers and a positive integer k, return a sorted list \n // of length k with the maximum k numbers in arr.\n // Example 1:\n // >>> maximum((new ArrayList(Arrays.asList((long)-3l, (long)-4l, (long)5l))), (3l))\n // (new ArrayList(Arrays.asList((long)-4l, (long)-3l, (long)5l)))\n // Example 2:\n // >>> maximum((new ArrayList(Arrays.asList((long)4l, (long)-4l, (long)4l))), (2l))\n // (new ArrayList(Arrays.asList((long)4l, (long)4l)))\n // Example 3:\n // >>> maximum((new ArrayList(Arrays.asList((long)-3l, (long)2l, (long)1l, (long)2l, (long)-1l, (long)-2l, (long)1l))), (1l))\n // (new ArrayList(Arrays.asList((long)2l)))\n // Note:\n // 1. The length of the array will be in the range of [1, 1000].\n // 2. The elements in the array will be in the range of [-1000, 1000].\n // 3. 0 <= k <= len(arr)\n public static ArrayList maximum(ArrayList arr, long k) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(maximum((new ArrayList(Arrays.asList((long)-3l, (long)-4l, (long)5l))), (3l)).equals((new ArrayList(Arrays.asList((long)-4l, (long)-3l, (long)5l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)4l, (long)-4l, (long)4l))), (2l)).equals((new ArrayList(Arrays.asList((long)4l, (long)4l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)-3l, (long)2l, (long)1l, (long)2l, (long)-1l, (long)-2l, (long)1l))), (1l)).equals((new ArrayList(Arrays.asList((long)2l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)123l, (long)-123l, (long)20l, (long)0l, (long)1l, (long)2l, (long)-3l))), (3l)).equals((new ArrayList(Arrays.asList((long)2l, (long)20l, (long)123l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)-123l, (long)20l, (long)0l, (long)1l, (long)2l, (long)-3l))), (4l)).equals((new ArrayList(Arrays.asList((long)0l, (long)1l, (long)2l, (long)20l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)5l, (long)15l, (long)0l, (long)3l, (long)-13l, (long)-8l, (long)0l))), (7l)).equals((new ArrayList(Arrays.asList((long)-13l, (long)-8l, (long)0l, (long)0l, (long)3l, (long)5l, (long)15l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)-1l, (long)0l, (long)2l, (long)5l, (long)3l, (long)-10l))), (2l)).equals((new ArrayList(Arrays.asList((long)3l, (long)5l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)1l, (long)0l, (long)5l, (long)-7l))), (1l)).equals((new ArrayList(Arrays.asList((long)5l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)4l, (long)-4l))), (2l)).equals((new ArrayList(Arrays.asList((long)-4l, (long)4l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)-10l, (long)10l))), (2l)).equals((new ArrayList(Arrays.asList((long)-10l, (long)10l)))));\n assert(maximum((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)-23l, (long)243l, (long)-400l, (long)0l))), (0l)).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that takes a message, and encodes in such a \n // way that it swaps case of all letters, replaces all vowels in \n // the message with the letter that appears 2 places ahead of that \n // vowel in the english alphabet. \n // Assume only letters. \n // Examples:\n // >>> encode((\"test\"))\n // (\"TGST\")\n // >>> encode((\"This is a message\"))\n // (\"tHKS KS C MGSSCGG\")\n public static String encode(String message) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(encode((\"TEST\")).equals((\"tgst\")));\n assert(encode((\"Mudasir\")).equals((\"mWDCSKR\")));\n assert(encode((\"YES\")).equals((\"ygs\")));\n assert(encode((\"This is a message\")).equals((\"tHKS KS C MGSSCGG\")));\n assert(encode((\"I DoNt KnOw WhAt tO WrItE\")).equals((\"k dQnT kNqW wHcT Tq wRkTg\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // remove_vowels is a function that takes string and returns string without vowels.\n // >>> removeVowels((\"\"))\n // (\"\")\n // >>> removeVowels((\"abcdef\"))\n // (\"bcdf\")\n // >>> removeVowels((\"aaaaa\"))\n // (\"\")\n // >>> removeVowels((\"aaBAA\"))\n // (\"B\")\n // >>> removeVowels((\"zbcd\"))\n // (\"zbcd\")\n public static String removeVowels(String text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(removeVowels((\"\")).equals((\"\")));\n assert(removeVowels((\"abcdef\\nghijklm\")).equals((\"bcdf\\nghjklm\")));\n assert(removeVowels((\"fedcba\")).equals((\"fdcb\")));\n assert(removeVowels((\"eeeee\")).equals((\"\")));\n assert(removeVowels((\"acBAA\")).equals((\"cB\")));\n assert(removeVowels((\"EcBOO\")).equals((\"cB\")));\n assert(removeVowels((\"ybcd\")).equals((\"ybcd\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return only positive numbers in the list.\n // >>> getPositive((new ArrayList(Arrays.asList((long)-1l, (long)2l, (long)-4l, (long)5l, (long)6l))))\n // (new ArrayList(Arrays.asList((long)2l, (long)5l, (long)6l)))\n // >>> getPositive((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)-5l, (long)2l, (long)-3l, (long)3l, (long)9l, (long)0l, (long)123l, (long)1l, (long)-10l))))\n // (new ArrayList(Arrays.asList((long)5l, (long)3l, (long)2l, (long)3l, (long)9l, (long)123l, (long)1l)))\n public static ArrayList getPositive(ArrayList l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(getPositive((new ArrayList(Arrays.asList((long)-1l, (long)-2l, (long)4l, (long)5l, (long)6l)))).equals((new ArrayList(Arrays.asList((long)4l, (long)5l, (long)6l)))));\n assert(getPositive((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)-5l, (long)2l, (long)3l, (long)3l, (long)9l, (long)0l, (long)123l, (long)1l, (long)-10l)))).equals((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)2l, (long)3l, (long)3l, (long)9l, (long)123l, (long)1l)))));\n assert(getPositive((new ArrayList(Arrays.asList((long)-1l, (long)-2l)))).equals((new ArrayList(Arrays.asList()))));\n assert(getPositive((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n // >>> stringSequence((0l))\n // (\"0\")\n // >>> stringSequence((5l))\n // (\"0 1 2 3 4 5\")\n public static String stringSequence(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(stringSequence((0l)).equals((\"0\")));\n assert(stringSequence((3l)).equals((\"0 1 2 3\")));\n assert(stringSequence((10l)).equals((\"0 1 2 3 4 5 6 7 8 9 10\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a positive integer n, you have to make a pile of n levels of stones.\n // The first level has n stones.\n // The number of stones in the next level is:\n // - the next odd number if n is odd.\n // - the next even number if n is even.\n // Return the number of stones in each level in a list, where element at index\n // i represents the number of stones in the level (i+1).\n // Examples:\n // >>> makeAPile((3l))\n // (new ArrayList(Arrays.asList((long)3l, (long)5l, (long)7l)))\n public static ArrayList makeAPile(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(makeAPile((3l)).equals((new ArrayList(Arrays.asList((long)3l, (long)5l, (long)7l)))));\n assert(makeAPile((4l)).equals((new ArrayList(Arrays.asList((long)4l, (long)6l, (long)8l, (long)10l)))));\n assert(makeAPile((5l)).equals((new ArrayList(Arrays.asList((long)5l, (long)7l, (long)9l, (long)11l, (long)13l)))));\n assert(makeAPile((6l)).equals((new ArrayList(Arrays.asList((long)6l, (long)8l, (long)10l, (long)12l, (long)14l, (long)16l)))));\n assert(makeAPile((8l)).equals((new ArrayList(Arrays.asList((long)8l, (long)10l, (long)12l, (long)14l, (long)16l, (long)18l, (long)20l, (long)22l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Task\n // 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\n // then check if the result string is palindrome.\n // A string is called palindrome if it reads the same backward as forward.\n // You should return a tuple containing the result string and True/False for the check.\n // Example\n // >>> reverseDelete((\"abcde\"), (\"ae\"))\n // (Pair.with(\"bcd\", false))\n // >>> reverseDelete((\"abcdef\"), (\"b\"))\n // (Pair.with(\"acdef\", false))\n // >>> reverseDelete((\"abcdedcba\"), (\"ab\"))\n // (Pair.with(\"cdedc\", true))\n public static Pair reverseDelete(String s, String c) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(reverseDelete((\"abcde\"), (\"ae\")).equals((Pair.with(\"bcd\", false))));\n assert(reverseDelete((\"abcdef\"), (\"b\")).equals((Pair.with(\"acdef\", false))));\n assert(reverseDelete((\"abcdedcba\"), (\"ab\")).equals((Pair.with(\"cdedc\", true))));\n assert(reverseDelete((\"dwik\"), (\"w\")).equals((Pair.with(\"dik\", false))));\n assert(reverseDelete((\"a\"), (\"a\")).equals((Pair.with(\"\", true))));\n assert(reverseDelete((\"abcdedcba\"), (\"\")).equals((Pair.with(\"abcdedcba\", true))));\n assert(reverseDelete((\"abcdedcba\"), (\"v\")).equals((Pair.with(\"abcdedcba\", true))));\n assert(reverseDelete((\"vabba\"), (\"v\")).equals((Pair.with(\"abba\", true))));\n assert(reverseDelete((\"mamma\"), (\"mia\")).equals((Pair.with(\"\", true))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n // >>> flipCase((\"Hello\"))\n // (\"hELLO\")\n public static String flipCase(String string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(flipCase((\"\")).equals((\"\")));\n assert(flipCase((\"Hello!\")).equals((\"hELLO!\")));\n assert(flipCase((\"These violent delights have violent ends\")).equals((\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a string s.\n // if s[i] is a letter, reverse its case from lower to upper or vise versa, \n // otherwise keep it as it is.\n // If the string contains no letters, reverse the string.\n // The function should return the resulted string.\n // Examples\n // >>> solve((\"1234\"))\n // (\"4321\")\n // >>> solve((\"ab\"))\n // (\"AB\")\n // >>> solve((\"#a@C\"))\n // (\"#A@c\")\n public static String solve(String s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(solve((\"AsDf\")).equals((\"aSdF\")));\n assert(solve((\"1234\")).equals((\"4321\")));\n assert(solve((\"ab\")).equals((\"AB\")));\n assert(solve((\"#a@C\")).equals((\"#A@c\")));\n assert(solve((\"#AsdfW^45\")).equals((\"#aSDFw^45\")));\n assert(solve((\"#6@2\")).equals((\"2@6#\")));\n assert(solve((\"#$a^D\")).equals((\"#$A^d\")));\n assert(solve((\"#ccc\")).equals((\"#CCC\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Filter an input list of strings only for ones that start with a given prefix.\n // >>> filterByPrefix((new ArrayList(Arrays.asList())), (\"a\"))\n // (new ArrayList(Arrays.asList()))\n // >>> filterByPrefix((new ArrayList(Arrays.asList((String)\"abc\", (String)\"bcd\", (String)\"cde\", (String)\"array\"))), (\"a\"))\n // (new ArrayList(Arrays.asList((String)\"abc\", (String)\"array\")))\n public static ArrayList filterByPrefix(ArrayList strings, String prefix) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(filterByPrefix((new ArrayList(Arrays.asList())), (\"john\")).equals((new ArrayList(Arrays.asList()))));\n assert(filterByPrefix((new ArrayList(Arrays.asList((String)\"xxx\", (String)\"asd\", (String)\"xxy\", (String)\"john doe\", (String)\"xxxAAA\", (String)\"xxx\"))), (\"xxx\")).equals((new ArrayList(Arrays.asList((String)\"xxx\", (String)\"xxxAAA\", (String)\"xxx\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // This function takes two positive numbers x and y and returns the\n // biggest even integer number that is in the range [x, y] inclusive. If \n // there's no such number, then the function should return -1.\n // For example:\n // >>> chooseNum((12l), (15l))\n // (14l)\n // >>> chooseNum((13l), (12l))\n // (-1l)\n public static long chooseNum(long x, long y) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(chooseNum((12l), (15l)) == (14l));\n assert(chooseNum((13l), (12l)) == (-1l));\n assert(chooseNum((33l), (12354l)) == (12354l));\n assert(chooseNum((5234l), (5233l)) == (-1l));\n assert(chooseNum((6l), (29l)) == (28l));\n assert(chooseNum((27l), (10l)) == (-1l));\n assert(chooseNum((7l), (7l)) == (-1l));\n assert(chooseNum((546l), (546l)) == (546l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a string representing a sentence,\n // the sentence contains some words separated by a space,\n // and you have to return a string that contains the words from the original sentence,\n // whose lengths are prime numbers,\n // the order of the words in the new string should be the same as the original one.\n // Example 1:\n // >>> wordsInSentence((\"This is a test\"))\n // (\"is\")\n // Example 2:\n // >>> wordsInSentence((\"lets go for swimming\"))\n // (\"go for\")\n // Constraints:\n // * 1 <= len(sentence) <= 100\n // * sentence contains only letters\n public static String wordsInSentence(String sentence) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(wordsInSentence((\"This is a test\")).equals((\"is\")));\n assert(wordsInSentence((\"lets go for swimming\")).equals((\"go for\")));\n assert(wordsInSentence((\"there is no place available here\")).equals((\"there is no place\")));\n assert(wordsInSentence((\"Hi I am Hussein\")).equals((\"Hi am Hussein\")));\n assert(wordsInSentence((\"go for it\")).equals((\"go for it\")));\n assert(wordsInSentence((\"here\")).equals((\"\")));\n assert(wordsInSentence((\"here is\")).equals((\"is\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n // >>> intersperse((new ArrayList(Arrays.asList())), (4l))\n // (new ArrayList(Arrays.asList()))\n // >>> intersperse((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))), (4l))\n // (new ArrayList(Arrays.asList((long)1l, (long)4l, (long)2l, (long)4l, (long)3l)))\n public static ArrayList intersperse(ArrayList numbers, long delimeter) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(intersperse((new ArrayList(Arrays.asList())), (7l)).equals((new ArrayList(Arrays.asList()))));\n assert(intersperse((new ArrayList(Arrays.asList((long)5l, (long)6l, (long)3l, (long)2l))), (8l)).equals((new ArrayList(Arrays.asList((long)5l, (long)8l, (long)6l, (long)8l, (long)3l, (long)8l, (long)2l)))));\n assert(intersperse((new ArrayList(Arrays.asList((long)2l, (long)2l, (long)2l))), (2l)).equals((new ArrayList(Arrays.asList((long)2l, (long)2l, (long)2l, (long)2l, (long)2l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Your task is to write a function that returns true if a number x is a simple\n // power of n and false in other cases.\n // x is a simple power of n if n**int=x\n // For example:\n // >>> isSimplePower((1l), (4l))\n // (true)\n // >>> isSimplePower((2l), (2l))\n // (true)\n // >>> isSimplePower((8l), (2l))\n // (true)\n // >>> isSimplePower((3l), (2l))\n // (false)\n // >>> isSimplePower((3l), (1l))\n // (false)\n // >>> isSimplePower((5l), (3l))\n // (false)\n public static boolean isSimplePower(long x, long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(isSimplePower((16l), (2l)) == (true));\n assert(isSimplePower((143214l), (16l)) == (false));\n assert(isSimplePower((4l), (2l)) == (true));\n assert(isSimplePower((9l), (3l)) == (true));\n assert(isSimplePower((16l), (4l)) == (true));\n assert(isSimplePower((24l), (2l)) == (false));\n assert(isSimplePower((128l), (4l)) == (false));\n assert(isSimplePower((12l), (6l)) == (false));\n assert(isSimplePower((1l), (1l)) == (true));\n assert(isSimplePower((1l), (12l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that returns true if the given number is the multiplication of 3 prime numbers\n // and false otherwise.\n // Knowing that (a) is less then 100. \n // Example:\n // >>> isMultiplyPrime((30l))\n // (true)\n // 30 = 2 * 3 * 5\n public static boolean isMultiplyPrime(long a) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(isMultiplyPrime((5l)) == (false));\n assert(isMultiplyPrime((30l)) == (true));\n assert(isMultiplyPrime((8l)) == (true));\n assert(isMultiplyPrime((10l)) == (false));\n assert(isMultiplyPrime((125l)) == (true));\n assert(isMultiplyPrime((105l)) == (true));\n assert(isMultiplyPrime((126l)) == (false));\n assert(isMultiplyPrime((729l)) == (false));\n assert(isMultiplyPrime((891l)) == (false));\n assert(isMultiplyPrime((1001l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given the lengths of the three sides of a triangle. Return True if the three\n // sides form a right-angled triangle, False otherwise.\n // A right-angled triangle is a triangle in which one angle is right angle or \n // 90 degree.\n // Example:\n // >>> rightAngleTriangle((3l), (4l), (5l))\n // (true)\n // >>> rightAngleTriangle((1l), (2l), (3l))\n // (false)\n public static boolean rightAngleTriangle(long a, long b, long c) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(rightAngleTriangle((3l), (4l), (5l)) == (true));\n assert(rightAngleTriangle((1l), (2l), (3l)) == (false));\n assert(rightAngleTriangle((10l), (6l), (8l)) == (true));\n assert(rightAngleTriangle((2l), (2l), (2l)) == (false));\n assert(rightAngleTriangle((7l), (24l), (25l)) == (true));\n assert(rightAngleTriangle((10l), (5l), (7l)) == (false));\n assert(rightAngleTriangle((5l), (12l), (13l)) == (true));\n assert(rightAngleTriangle((15l), (8l), (17l)) == (true));\n assert(rightAngleTriangle((48l), (55l), (73l)) == (true));\n assert(rightAngleTriangle((1l), (1l), (1l)) == (false));\n assert(rightAngleTriangle((2l), (2l), (10l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function that takes 3 numbers.\n // Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n // Returns false in any other cases.\n // Examples\n // >>> anyInt((float)5l, (float)2l, (float)7l)\n // (true)\n // >>> anyInt((float)3l, (float)2l, (float)2l)\n // (false)\n // >>> anyInt((float)3l, (float)-2l, (float)1l)\n // (true)\n // >>> anyInt((3.6f), (-2.2f), (float)2l)\n // (false)\n public static boolean anyInt(float x, float y, float z) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(anyInt((float)2l, (float)3l, (float)1l) == (true));\n assert(anyInt((2.5f), (float)2l, (float)3l) == (false));\n assert(anyInt((1.5f), (float)5l, (3.5f)) == (false));\n assert(anyInt((float)2l, (float)6l, (float)2l) == (false));\n assert(anyInt((float)4l, (float)2l, (float)2l) == (true));\n assert(anyInt((2.2f), (2.2f), (2.2f)) == (false));\n assert(anyInt((float)-4l, (float)6l, (float)2l) == (true));\n assert(anyInt((float)2l, (float)1l, (float)1l) == (true));\n assert(anyInt((float)3l, (float)4l, (float)7l) == (true));\n assert(anyInt((3.0f), (float)4l, (float)7l) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // This function takes a list l and returns a list l' such that\n // l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n // to the values of the corresponding indicies of l, but sorted.\n // >>> sortThird((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))))\n // (new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)))\n // >>> sortThird((new ArrayList(Arrays.asList((long)5l, (long)6l, (long)3l, (long)4l, (long)8l, (long)9l, (long)2l))))\n // (new ArrayList(Arrays.asList((long)2l, (long)6l, (long)3l, (long)4l, (long)8l, (long)9l, (long)5l)))\n public static ArrayList sortThird(ArrayList l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sortThird((new ArrayList(Arrays.asList((long)5l, (long)6l, (long)3l, (long)4l, (long)8l, (long)9l, (long)2l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)6l, (long)3l, (long)4l, (long)8l, (long)9l, (long)5l)))));\n assert(sortThird((new ArrayList(Arrays.asList((long)5l, (long)8l, (long)3l, (long)4l, (long)6l, (long)9l, (long)2l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)8l, (long)3l, (long)4l, (long)6l, (long)9l, (long)5l)))));\n assert(sortThird((new ArrayList(Arrays.asList((long)5l, (long)6l, (long)9l, (long)4l, (long)8l, (long)3l, (long)2l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)6l, (long)9l, (long)4l, (long)8l, (long)3l, (long)5l)))));\n assert(sortThird((new ArrayList(Arrays.asList((long)5l, (long)6l, (long)3l, (long)4l, (long)8l, (long)9l, (long)2l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)6l, (long)3l, (long)4l, (long)8l, (long)9l, (long)5l, (long)1l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_53_add", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Add two numbers x and y\n // >>> add((2l), (3l))\n // (5l)\n // >>> add((5l), (7l))\n // (12l)\n public static long add(long x, long y) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(add((0l), (1l)) == (1l));\n assert(add((1l), (0l)) == (1l));\n assert(add((2l), (3l)) == (5l));\n assert(add((5l), (7l)) == (12l));\n assert(add((7l), (5l)) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_69_search", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n // zero, and has a frequency greater than or equal to the value of the integer itself. \n // The frequency of an integer is the number of times it appears in the list.\n // If no such a value exist, return -1.\n // Examples:\n // >>> search((new ArrayList(Arrays.asList((long)4l, (long)1l, (long)2l, (long)2l, (long)3l, (long)1l))))\n // (2l)\n // >>> search((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)2l, (long)3l, (long)3l, (long)3l, (long)4l, (long)4l, (long)4l))))\n // (3l)\n // >>> search((new ArrayList(Arrays.asList((long)5l, (long)5l, (long)4l, (long)4l, (long)4l))))\n // (-1l)\n public static long search(ArrayList lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(search((new ArrayList(Arrays.asList((long)5l, (long)5l, (long)5l, (long)5l, (long)1l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)4l, (long)1l, (long)4l, (long)1l, (long)4l, (long)4l)))) == (4l));\n assert(search((new ArrayList(Arrays.asList((long)3l, (long)3l)))) == (-1l));\n assert(search((new ArrayList(Arrays.asList((long)8l, (long)8l, (long)8l, (long)8l, (long)8l, (long)8l, (long)8l, (long)8l)))) == (8l));\n assert(search((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)3l, (long)2l, (long)2l)))) == (2l));\n assert(search((new ArrayList(Arrays.asList((long)2l, (long)7l, (long)8l, (long)8l, (long)4l, (long)8l, (long)7l, (long)3l, (long)9l, (long)6l, (long)5l, (long)10l, (long)4l, (long)3l, (long)6l, (long)7l, (long)1l, (long)7l, (long)4l, (long)10l, (long)8l, (long)1l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)8l, (long)2l)))) == (2l));\n assert(search((new ArrayList(Arrays.asList((long)6l, (long)7l, (long)1l, (long)8l, (long)8l, (long)10l, (long)5l, (long)8l, (long)5l, (long)3l, (long)10l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)8l, (long)8l, (long)3l, (long)6l, (long)5l, (long)6l, (long)4l)))) == (-1l));\n assert(search((new ArrayList(Arrays.asList((long)6l, (long)9l, (long)6l, (long)7l, (long)1l, (long)4l, (long)7l, (long)1l, (long)8l, (long)8l, (long)9l, (long)8l, (long)10l, (long)10l, (long)8l, (long)4l, (long)10l, (long)4l, (long)10l, (long)1l, (long)2l, (long)9l, (long)5l, (long)7l, (long)9l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)1l, (long)9l, (long)10l, (long)1l, (long)3l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)6l, (long)9l, (long)7l, (long)5l, (long)8l, (long)7l, (long)5l, (long)3l, (long)7l, (long)5l, (long)10l, (long)10l, (long)3l, (long)6l, (long)10l, (long)2l, (long)8l, (long)6l, (long)5l, (long)4l, (long)9l, (long)5l, (long)3l, (long)10l)))) == (5l));\n assert(search((new ArrayList(Arrays.asList((long)1l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)8l, (long)8l, (long)10l, (long)6l, (long)4l, (long)3l, (long)5l, (long)8l, (long)2l, (long)4l, (long)2l, (long)8l, (long)4l, (long)6l, (long)10l, (long)4l, (long)2l, (long)1l, (long)10l, (long)2l, (long)1l, (long)1l, (long)5l)))) == (4l));\n assert(search((new ArrayList(Arrays.asList((long)2l, (long)10l, (long)4l, (long)8l, (long)2l, (long)10l, (long)5l, (long)1l, (long)2l, (long)9l, (long)5l, (long)5l, (long)6l, (long)3l, (long)8l, (long)6l, (long)4l, (long)10l)))) == (2l));\n assert(search((new ArrayList(Arrays.asList((long)1l, (long)6l, (long)10l, (long)1l, (long)6l, (long)9l, (long)10l, (long)8l, (long)6l, (long)8l, (long)7l, (long)3l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)9l, (long)2l, (long)4l, (long)1l, (long)5l, (long)1l, (long)5l, (long)2l, (long)5l, (long)7l, (long)7l, (long)7l, (long)3l, (long)10l, (long)1l, (long)5l, (long)4l, (long)2l, (long)8l, (long)4l, (long)1l, (long)9l, (long)10l, (long)7l, (long)10l, (long)2l, (long)8l, (long)10l, (long)9l, (long)4l)))) == (4l));\n assert(search((new ArrayList(Arrays.asList((long)2l, (long)6l, (long)4l, (long)2l, (long)8l, (long)7l, (long)5l, (long)6l, (long)4l, (long)10l, (long)4l, (long)6l, (long)3l, (long)7l, (long)8l, (long)8l, (long)3l, (long)1l, (long)4l, (long)2l, (long)2l, (long)10l, (long)7l)))) == (4l));\n assert(search((new ArrayList(Arrays.asList((long)9l, (long)8l, (long)6l, (long)10l, (long)2l, (long)6l, (long)10l, (long)2l, (long)7l, (long)8l, (long)10l, (long)3l, (long)8l, (long)2l, (long)6l, (long)2l, (long)3l, (long)1l)))) == (2l));\n assert(search((new ArrayList(Arrays.asList((long)5l, (long)5l, (long)3l, (long)9l, (long)5l, (long)6l, (long)3l, (long)2l, (long)8l, (long)5l, (long)6l, (long)10l, (long)10l, (long)6l, (long)8l, (long)4l, (long)10l, (long)7l, (long)7l, (long)10l, (long)8l)))) == (-1l));\n assert(search((new ArrayList(Arrays.asList((long)10l)))) == (-1l));\n assert(search((new ArrayList(Arrays.asList((long)9l, (long)7l, (long)7l, (long)2l, (long)4l, (long)7l, (long)2l, (long)10l, (long)9l, (long)7l, (long)5l, (long)7l, (long)2l)))) == (2l));\n assert(search((new ArrayList(Arrays.asList((long)5l, (long)4l, (long)10l, (long)2l, (long)1l, (long)1l, (long)10l, (long)3l, (long)6l, (long)1l, (long)8l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)7l, (long)9l, (long)9l, (long)9l, (long)3l, (long)4l, (long)1l, (long)5l, (long)9l, (long)1l, (long)2l, (long)1l, (long)1l, (long)10l, (long)7l, (long)5l, (long)6l, (long)7l, (long)6l, (long)7l, (long)7l, (long)6l)))) == (1l));\n assert(search((new ArrayList(Arrays.asList((long)3l, (long)10l, (long)10l, (long)9l, (long)2l)))) == (-1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that takes a string and returns True if the string\n // length is a prime number or False otherwise\n // Examples\n // >>> primeLength((\"Hello\"))\n // (true)\n // >>> primeLength((\"abcdcba\"))\n // (true)\n // >>> primeLength((\"kittens\"))\n // (true)\n // >>> primeLength((\"orange\"))\n // (false)\n public static boolean primeLength(String string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(primeLength((\"Hello\")) == (true));\n assert(primeLength((\"abcdcba\")) == (true));\n assert(primeLength((\"kittens\")) == (true));\n assert(primeLength((\"orange\")) == (false));\n assert(primeLength((\"wow\")) == (true));\n assert(primeLength((\"world\")) == (true));\n assert(primeLength((\"MadaM\")) == (true));\n assert(primeLength((\"Wow\")) == (true));\n assert(primeLength((\"\")) == (false));\n assert(primeLength((\"HI\")) == (true));\n assert(primeLength((\"go\")) == (true));\n assert(primeLength((\"gogo\")) == (false));\n assert(primeLength((\"aaaaaaaaaaaaaaa\")) == (false));\n assert(primeLength((\"Madam\")) == (true));\n assert(primeLength((\"M\")) == (false));\n assert(primeLength((\"0\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_58_common", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return sorted unique common elements for two lists.\n // >>> common((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)3l, (long)34l, (long)653l, (long)2l, (long)5l))), (new ArrayList(Arrays.asList((long)5l, (long)7l, (long)1l, (long)5l, (long)9l, (long)653l, (long)121l))))\n // (new ArrayList(Arrays.asList((long)1l, (long)5l, (long)653l)))\n // >>> common((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)2l, (long)8l))), (new ArrayList(Arrays.asList((long)3l, (long)2l))))\n // (new ArrayList(Arrays.asList((long)2l, (long)3l)))\n public static ArrayList common(ArrayList l1, ArrayList l2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(common((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)3l, (long)34l, (long)653l, (long)2l, (long)5l))), (new ArrayList(Arrays.asList((long)5l, (long)7l, (long)1l, (long)5l, (long)9l, (long)653l, (long)121l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)5l, (long)653l)))));\n assert(common((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)2l, (long)8l))), (new ArrayList(Arrays.asList((long)3l, (long)2l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)3l)))));\n assert(common((new ArrayList(Arrays.asList((long)4l, (long)3l, (long)2l, (long)8l))), (new ArrayList(Arrays.asList((long)3l, (long)2l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)4l)))));\n assert(common((new ArrayList(Arrays.asList((long)4l, (long)3l, (long)2l, (long)8l))), (new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // The Brazilian factorial is defined as:\n // brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n // where n > 0\n // For example:\n // >>> specialFactorial((4l))\n // (288l)\n // The function will receive an integer as input and should return the special\n // factorial of this integer.\n public static long specialFactorial(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(specialFactorial((4l)) == (288l));\n assert(specialFactorial((5l)) == (34560l));\n assert(specialFactorial((7l)) == (125411328000l));\n assert(specialFactorial((1l)) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // In this problem, you will implement a function that takes two lists of numbers,\n // and determines whether it is possible to perform an exchange of elements\n // between them to make lst1 a list of only even numbers.\n // There is no limit on the number of exchanged elements between lst1 and lst2.\n // If it is possible to exchange elements between the lst1 and lst2 to make\n // all the elements of lst1 to be even, return \"YES\".\n // Otherwise, return \"NO\".\n // For example:\n // >>> exchange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l))), (new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l))))\n // (\"YES\")\n // >>> exchange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l))), (new ArrayList(Arrays.asList((long)1l, (long)5l, (long)3l, (long)4l))))\n // (\"NO\")\n // It is assumed that the input lists will be non-empty.\n public static String exchange(ArrayList lst1, ArrayList lst2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(exchange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l))), (new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))).equals((\"YES\")));\n assert(exchange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l))), (new ArrayList(Arrays.asList((long)1l, (long)5l, (long)3l, (long)4l)))).equals((\"NO\")));\n assert(exchange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l))), (new ArrayList(Arrays.asList((long)2l, (long)1l, (long)4l, (long)3l)))).equals((\"YES\")));\n assert(exchange((new ArrayList(Arrays.asList((long)5l, (long)7l, (long)3l))), (new ArrayList(Arrays.asList((long)2l, (long)6l, (long)4l)))).equals((\"YES\")));\n assert(exchange((new ArrayList(Arrays.asList((long)5l, (long)7l, (long)3l))), (new ArrayList(Arrays.asList((long)2l, (long)6l, (long)3l)))).equals((\"NO\")));\n assert(exchange((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)6l, (long)1l, (long)8l, (long)9l))), (new ArrayList(Arrays.asList((long)3l, (long)5l, (long)5l, (long)1l, (long)1l, (long)1l)))).equals((\"NO\")));\n assert(exchange((new ArrayList(Arrays.asList((long)100l, (long)200l))), (new ArrayList(Arrays.asList((long)200l, (long)200l)))).equals((\"YES\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a non-empty array of integers arr and an integer k, return\n // the sum of the elements with at most two digits from the first k elements of arr.\n // Example:\n // >>> addElements((new ArrayList(Arrays.asList((long)111l, (long)21l, (long)3l, (long)4000l, (long)5l, (long)6l, (long)7l, (long)8l, (long)9l))), (4l))\n // (24l)\n // Constraints:\n // 1. 1 <= len(arr) <= 100\n // 2. 1 <= k <= len(arr)\n public static long addElements(ArrayList arr, long k) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(addElements((new ArrayList(Arrays.asList((long)1l, (long)-2l, (long)-3l, (long)41l, (long)57l, (long)76l, (long)87l, (long)88l, (long)99l))), (3l)) == (-4l));\n assert(addElements((new ArrayList(Arrays.asList((long)111l, (long)121l, (long)3l, (long)4000l, (long)5l, (long)6l))), (2l)) == (0l));\n assert(addElements((new ArrayList(Arrays.asList((long)11l, (long)21l, (long)3l, (long)90l, (long)5l, (long)6l, (long)7l, (long)8l, (long)9l))), (4l)) == (125l));\n assert(addElements((new ArrayList(Arrays.asList((long)111l, (long)21l, (long)3l, (long)4000l, (long)5l, (long)6l, (long)7l, (long)8l, (long)9l))), (4l)) == (24l));\n assert(addElements((new ArrayList(Arrays.asList((long)1l))), (1l)) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // A simple program which should return the value of x if n is \n // a prime number and should return the value of y otherwise.\n // Examples:\n // >>> xOrY((7l), (34l), (12l))\n // (34l)\n // >>> xOrY((15l), (8l), (5l))\n // (5l)\n public static long xOrY(long n, long x, long y) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(xOrY((7l), (34l), (12l)) == (34l));\n assert(xOrY((15l), (8l), (5l)) == (5l));\n assert(xOrY((3l), (33l), (5212l)) == (33l));\n assert(xOrY((1259l), (3l), (52l)) == (3l));\n assert(xOrY((7919l), (-1l), (12l)) == (-1l));\n assert(xOrY((3609l), (1245l), (583l)) == (583l));\n assert(xOrY((91l), (56l), (129l)) == (129l));\n assert(xOrY((6l), (34l), (1234l)) == (1234l));\n assert(xOrY((1l), (2l), (0l)) == (0l));\n assert(xOrY((2l), (2l), (0l)) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given length of a side and high return area for a triangle.\n // >>> triangleArea((5l), (3l))\n // (7.5f)\n public static float triangleArea(long a, long h) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(triangleArea((5l), (3l)) == (7.5f));\n assert(triangleArea((2l), (2l)) == (2.0f));\n assert(triangleArea((10l), (8l)) == (40.0f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n // the last couple centuries. However, what people don't know is Tribonacci sequence.\n // Tribonacci sequence is defined by the recurrence:\n // tri(1) = 3\n // tri(n) = 1 + n / 2, if n is even.\n // tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n // For example:\n // tri(2) = 1 + (2 / 2) = 2\n // tri(4) = 3\n // tri(3) = tri(2) + tri(1) + tri(4)\n // = 2 + 3 + 3 = 8 \n // You are given a non-negative integer number n, you have to a return a list of the \n // first n + 1 numbers of the Tribonacci sequence.\n // Examples:\n // >>> tri((3l))\n // (new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l)))\n public static ArrayList tri(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(tri((3l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l)))));\n assert(tri((4l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l, (long)3l)))));\n assert(tri((5l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l, (long)3l, (long)15l)))));\n assert(tri((6l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l, (long)3l, (long)15l, (long)4l)))));\n assert(tri((7l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l, (long)3l, (long)15l, (long)4l, (long)24l)))));\n assert(tri((8l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l, (long)3l, (long)15l, (long)4l, (long)24l, (long)5l)))));\n assert(tri((9l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l, (long)3l, (long)15l, (long)4l, (long)24l, (long)5l, (long)35l)))));\n assert(tri((20l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)8l, (long)3l, (long)15l, (long)4l, (long)24l, (long)5l, (long)35l, (long)6l, (long)48l, (long)7l, (long)63l, (long)8l, (long)80l, (long)9l, (long)99l, (long)10l, (long)120l, (long)11l)))));\n assert(tri((0l)).equals((new ArrayList(Arrays.asList((long)1l)))));\n assert(tri((1l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a list of two strings, both strings consist of open\n // parentheses '(' or close parentheses ')' only.\n // Your job is to check if it is possible to concatenate the two strings in\n // some order, that the resulting string will be good.\n // A string S is considered to be good if and only if all parentheses in S\n // are balanced. For example: the string '(())()' is good, while the string\n // '())' is not.\n // Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n // Examples:\n // >>> matchParens((new ArrayList(Arrays.asList((String)\"()(\", (String)\")\"))))\n // (\"Yes\")\n // >>> matchParens((new ArrayList(Arrays.asList((String)\")\", (String)\")\"))))\n // (\"No\")\n public static String matchParens(ArrayList lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(matchParens((new ArrayList(Arrays.asList((String)\"()(\", (String)\")\")))).equals((\"Yes\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\")\", (String)\")\")))).equals((\"No\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\"(()(())\", (String)\"())())\")))).equals((\"No\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\")())\", (String)\"(()()(\")))).equals((\"Yes\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\"(())))\", (String)\"(()())((\")))).equals((\"Yes\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\"()\", (String)\"())\")))).equals((\"No\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\"(()(\", (String)\"()))()\")))).equals((\"Yes\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\"((((\", (String)\"((())\")))).equals((\"No\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\")(()\", (String)\"(()(\")))).equals((\"No\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\")(\", (String)\")(\")))).equals((\"No\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\"(\", (String)\")\")))).equals((\"Yes\")));\n assert(matchParens((new ArrayList(Arrays.asList((String)\")\", (String)\"(\")))).equals((\"Yes\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // From a list of integers, remove all elements that occur more than once.\n // Keep order of elements left the same as in the input.\n // >>> removeDuplicates((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)2l, (long)4l))))\n // (new ArrayList(Arrays.asList((long)1l, (long)3l, (long)4l)))\n public static ArrayList removeDuplicates(ArrayList numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(removeDuplicates((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(removeDuplicates((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))));\n assert(removeDuplicates((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)2l, (long)4l, (long)3l, (long)5l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)5l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return a greatest common divisor of two integers a and b\n // >>> greatestCommonDivisor((3l), (5l))\n // (1l)\n // >>> greatestCommonDivisor((25l), (15l))\n // (5l)\n public static long greatestCommonDivisor(long a, long b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(greatestCommonDivisor((3l), (7l)) == (1l));\n assert(greatestCommonDivisor((10l), (15l)) == (5l));\n assert(greatestCommonDivisor((49l), (14l)) == (7l));\n assert(greatestCommonDivisor((144l), (60l)) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Checks if given string is a palindrome\n // >>> isPalindrome((\"\"))\n // (true)\n // >>> isPalindrome((\"aba\"))\n // (true)\n // >>> isPalindrome((\"aaaaa\"))\n // (true)\n // >>> isPalindrome((\"zbcd\"))\n // (false)\n public static boolean isPalindrome(String text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(isPalindrome((\"\")) == (true));\n assert(isPalindrome((\"aba\")) == (true));\n assert(isPalindrome((\"aaaaa\")) == (true));\n assert(isPalindrome((\"zbcd\")) == (false));\n assert(isPalindrome((\"xywyx\")) == (true));\n assert(isPalindrome((\"xywyz\")) == (false));\n assert(isPalindrome((\"xywzx\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // xs represent coefficients of a polynomial.\n // xs[0] + xs[1] * x + xs[2] * x^2 + ....\n // Return derivative of this polynomial in the same form.\n // >>> derivative((new ArrayList(Arrays.asList((long)3l, (long)1l, (long)2l, (long)4l, (long)5l))))\n // (new ArrayList(Arrays.asList((long)1l, (long)4l, (long)12l, (long)20l)))\n // >>> derivative((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))))\n // (new ArrayList(Arrays.asList((long)2l, (long)6l)))\n public static ArrayList derivative(ArrayList xs) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(derivative((new ArrayList(Arrays.asList((long)3l, (long)1l, (long)2l, (long)4l, (long)5l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)12l, (long)20l)))));\n assert(derivative((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)6l)))));\n assert(derivative((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)2l)))));\n assert(derivative((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)1l, (long)0l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)2l, (long)0l, (long)16l)))));\n assert(derivative((new ArrayList(Arrays.asList((long)1l)))).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // In this task, you will be given a string that represents a number of apples and oranges \n // that are distributed in a basket of fruit this basket contains \n // apples, oranges, and mango fruits. Given the string that represents the total number of \n // the oranges and apples and an integer that represent the total number of the fruits \n // in the basket return the number of the mango fruits in the basket.\n // for examble:\n // >>> fruitDistribution((\"5 apples and 6 oranges\"), (19l))\n // (8l)\n // >>> fruitDistribution((\"0 apples and 1 oranges\"), (3l))\n // (2l)\n // >>> fruitDistribution((\"2 apples and 3 oranges\"), (100l))\n // (95l)\n // >>> fruitDistribution((\"100 apples and 1 oranges\"), (120l))\n // (19l)\n public static long fruitDistribution(String s, long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(fruitDistribution((\"5 apples and 6 oranges\"), (19l)) == (8l));\n assert(fruitDistribution((\"5 apples and 6 oranges\"), (21l)) == (10l));\n assert(fruitDistribution((\"0 apples and 1 oranges\"), (3l)) == (2l));\n assert(fruitDistribution((\"1 apples and 0 oranges\"), (3l)) == (2l));\n assert(fruitDistribution((\"2 apples and 3 oranges\"), (100l)) == (95l));\n assert(fruitDistribution((\"2 apples and 3 oranges\"), (5l)) == (0l));\n assert(fruitDistribution((\"1 apples and 100 oranges\"), (120l)) == (19l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that takes an integer a and returns True \n // if this ingeger is a cube of some integer number.\n // Note: you may assume the input is always valid.\n // Examples:\n // >>> iscube((1l))\n // (true)\n // >>> iscube((2l))\n // (false)\n // >>> iscube((-1l))\n // (true)\n // >>> iscube((64l))\n // (true)\n // >>> iscube((0l))\n // (true)\n // >>> iscube((180l))\n // (false)\n public static boolean iscube(long a) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(iscube((1l)) == (true));\n assert(iscube((2l)) == (false));\n assert(iscube((-1l)) == (true));\n assert(iscube((64l)) == (true));\n assert(iscube((180l)) == (false));\n assert(iscube((1000l)) == (true));\n assert(iscube((0l)) == (true));\n assert(iscube((1729l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // In this Kata, you have to sort an array of non-negative integers according to\n // number of ones in their binary representation in ascending order.\n // For similar number of ones, sort based on decimal value.\n // It must be implemented like this:\n // >>> sortArray((new ArrayList(Arrays.asList((long)1l, (long)5l, (long)2l, (long)3l, (long)4l))))\n // (new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l)))\n // >>> sortArray((new ArrayList(Arrays.asList((long)-2l, (long)-3l, (long)-4l, (long)-5l, (long)-6l))))\n // (new ArrayList(Arrays.asList((long)-6l, (long)-5l, (long)-4l, (long)-3l, (long)-2l)))\n // >>> sortArray((new ArrayList(Arrays.asList((long)1l, (long)0l, (long)2l, (long)3l, (long)4l))))\n // (new ArrayList(Arrays.asList((long)0l, (long)1l, (long)2l, (long)3l, (long)4l)))\n public static ArrayList sortArray(ArrayList arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sortArray((new ArrayList(Arrays.asList((long)1l, (long)5l, (long)2l, (long)3l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)4l, (long)3l, (long)5l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)-2l, (long)-3l, (long)-4l, (long)-5l, (long)-6l)))).equals((new ArrayList(Arrays.asList((long)-4l, (long)-2l, (long)-6l, (long)-5l, (long)-3l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)1l, (long)0l, (long)2l, (long)3l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)1l, (long)2l, (long)4l, (long)3l)))));\n assert(sortArray((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(sortArray((new ArrayList(Arrays.asList((long)2l, (long)5l, (long)77l, (long)4l, (long)5l, (long)3l, (long)5l, (long)7l, (long)2l, (long)3l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)2l, (long)4l, (long)4l, (long)3l, (long)3l, (long)5l, (long)5l, (long)5l, (long)7l, (long)77l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)3l, (long)6l, (long)44l, (long)12l, (long)32l, (long)5l)))).equals((new ArrayList(Arrays.asList((long)32l, (long)3l, (long)5l, (long)6l, (long)12l, (long)44l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)8l, (long)16l, (long)32l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)8l, (long)16l, (long)32l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)8l, (long)16l, (long)32l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)8l, (long)16l, (long)32l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a list of strings, where each string consists of only digits, return a list.\n // Each element i of the output should be \"the number of odd elements in the\n // string i of the input.\" where all the i's should be replaced by the number\n // of odd digits in the i'th string of the input.\n // >>> oddCount((new ArrayList(Arrays.asList((String)\"1234567\"))))\n // (new ArrayList(Arrays.asList((String)\"the number of odd elements 4n the str4ng 4 of the 4nput.\")))\n // >>> oddCount((new ArrayList(Arrays.asList((String)\"3\", (String)\"11111111\"))))\n // (new ArrayList(Arrays.asList((String)\"the number of odd elements 1n the str1ng 1 of the 1nput.\", (String)\"the number of odd elements 8n the str8ng 8 of the 8nput.\")))\n public static ArrayList oddCount(ArrayList lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(oddCount((new ArrayList(Arrays.asList((String)\"1234567\")))).equals((new ArrayList(Arrays.asList((String)\"the number of odd elements 4n the str4ng 4 of the 4nput.\")))));\n assert(oddCount((new ArrayList(Arrays.asList((String)\"3\", (String)\"11111111\")))).equals((new ArrayList(Arrays.asList((String)\"the number of odd elements 1n the str1ng 1 of the 1nput.\", (String)\"the number of odd elements 8n the str8ng 8 of the 8nput.\")))));\n assert(oddCount((new ArrayList(Arrays.asList((String)\"271\", (String)\"137\", (String)\"314\")))).equals((new ArrayList(Arrays.asList((String)\"the number of odd elements 2n the str2ng 2 of the 2nput.\", (String)\"the number of odd elements 3n the str3ng 3 of the 3nput.\", (String)\"the number of odd elements 2n the str2ng 2 of the 2nput.\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // brackets is a string of \"(\" and \")\".\n // return True if every opening bracket has a corresponding closing bracket.\n // >>> correctBracketing((\"(\"))\n // (false)\n // >>> correctBracketing((\"()\"))\n // (true)\n // >>> correctBracketing((\"(()())\"))\n // (true)\n // >>> correctBracketing((\")(()\"))\n // (false)\n public static boolean correctBracketing(String brackets) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(correctBracketing((\"()\")) == (true));\n assert(correctBracketing((\"(()())\")) == (true));\n assert(correctBracketing((\"()()(()())()\")) == (true));\n assert(correctBracketing((\"()()((()()())())(()()(()))\")) == (true));\n assert(correctBracketing((\"((()())))\")) == (false));\n assert(correctBracketing((\")(()\")) == (false));\n assert(correctBracketing((\"(\")) == (false));\n assert(correctBracketing((\"((((\")) == (false));\n assert(correctBracketing((\")\")) == (false));\n assert(correctBracketing((\"(()\")) == (false));\n assert(correctBracketing((\"()()(()())())(()\")) == (false));\n assert(correctBracketing((\"()()(()())()))()\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Task\n // Write a function that takes a string as input and returns the sum of the upper characters only'\n // ASCII codes.\n // Examples:\n // >>> digitSum((\"\"))\n // (0l)\n // >>> digitSum((\"abAB\"))\n // (131l)\n // >>> digitSum((\"abcCd\"))\n // (67l)\n // >>> digitSum((\"helloE\"))\n // (69l)\n // >>> digitSum((\"woArBld\"))\n // (131l)\n // >>> digitSum((\"aAaaaXa\"))\n // (153l)\n public static long digitSum(String s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(digitSum((\"\")) == (0l));\n assert(digitSum((\"abAB\")) == (131l));\n assert(digitSum((\"abcCd\")) == (67l));\n assert(digitSum((\"helloE\")) == (69l));\n assert(digitSum((\"woArBld\")) == (131l));\n assert(digitSum((\"aAaaaXa\")) == (153l));\n assert(digitSum((\" How are yOu?\")) == (151l));\n assert(digitSum((\"You arE Very Smart\")) == (327l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that accepts a list of strings as a parameter,\n // deletes the strings that have odd lengths from it,\n // and returns the resulted list with a sorted order,\n // The list is always a list of strings and never an array of numbers,\n // and it may contain duplicates.\n // The order of the list should be ascending by length of each word, and you\n // should return the list sorted by that rule.\n // If two words have the same length, sort the list alphabetically.\n // The function should return a list of strings in sorted order.\n // You may assume that all words will have the same length.\n // For example:\n // >>> listSort((new ArrayList(Arrays.asList((String)\"aa\", (String)\"a\", (String)\"aaa\"))))\n // (new ArrayList(Arrays.asList((String)\"aa\")))\n // >>> listSort((new ArrayList(Arrays.asList((String)\"ab\", (String)\"a\", (String)\"aaa\", (String)\"cd\"))))\n // (new ArrayList(Arrays.asList((String)\"ab\", (String)\"cd\")))\n public static ArrayList sortedListSum(ArrayList lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sortedListSum((new ArrayList(Arrays.asList((String)\"aa\", (String)\"a\", (String)\"aaa\")))).equals((new ArrayList(Arrays.asList((String)\"aa\")))));\n assert(sortedListSum((new ArrayList(Arrays.asList((String)\"school\", (String)\"AI\", (String)\"asdf\", (String)\"b\")))).equals((new ArrayList(Arrays.asList((String)\"AI\", (String)\"asdf\", (String)\"school\")))));\n assert(sortedListSum((new ArrayList(Arrays.asList((String)\"d\", (String)\"b\", (String)\"c\", (String)\"a\")))).equals((new ArrayList(Arrays.asList()))));\n assert(sortedListSum((new ArrayList(Arrays.asList((String)\"d\", (String)\"dcba\", (String)\"abcd\", (String)\"a\")))).equals((new ArrayList(Arrays.asList((String)\"abcd\", (String)\"dcba\")))));\n assert(sortedListSum((new ArrayList(Arrays.asList((String)\"AI\", (String)\"ai\", (String)\"au\")))).equals((new ArrayList(Arrays.asList((String)\"AI\", (String)\"ai\", (String)\"au\")))));\n assert(sortedListSum((new ArrayList(Arrays.asList((String)\"a\", (String)\"b\", (String)\"b\", (String)\"c\", (String)\"c\", (String)\"a\")))).equals((new ArrayList(Arrays.asList()))));\n assert(sortedListSum((new ArrayList(Arrays.asList((String)\"aaaa\", (String)\"bbbb\", (String)\"dd\", (String)\"cc\")))).equals((new ArrayList(Arrays.asList((String)\"cc\", (String)\"dd\", (String)\"aaaa\", (String)\"bbbb\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given an array arr of integers and you need to return\n // sum of magnitudes of integers multiplied by product of all signs\n // of each number in the array, represented by 1, -1 or 0.\n // Note: return None for empty arr.\n // Example:\n // >>> prodSigns((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)2l, (long)-4l))))\n // 9l\n // >>> prodSigns((new ArrayList(Arrays.asList((long)0l, (long)1l))))\n // 0l\n // >>> prodSigns((new ArrayList(Arrays.asList())))\n // Optional.empty()\n public static Optional prodSigns(ArrayList arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(prodSigns((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)2l, (long)-4l)))).equals(-9l));\n assert(prodSigns((new ArrayList(Arrays.asList((long)0l, (long)1l)))).equals(0l));\n assert(prodSigns((new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)2l, (long)3l, (long)-1l, (long)1l)))).equals(-10l));\n assert(prodSigns((new ArrayList(Arrays.asList()))).equals(Optional.empty()));\n assert(prodSigns((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)1l, (long)2l, (long)-1l, (long)-1l, (long)9l)))).equals(20l));\n assert(prodSigns((new ArrayList(Arrays.asList((long)-1l, (long)1l, (long)-1l, (long)1l)))).equals(4l));\n assert(prodSigns((new ArrayList(Arrays.asList((long)-1l, (long)1l, (long)1l, (long)1l)))).equals(-4l));\n assert(prodSigns((new ArrayList(Arrays.asList((long)-1l, (long)1l, (long)1l, (long)0l)))).equals(0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return list with elements incremented by 1.\n // >>> incrList((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))))\n // (new ArrayList(Arrays.asList((long)2l, (long)3l, (long)4l)))\n // >>> incrList((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)5l, (long)2l, (long)3l, (long)3l, (long)9l, (long)0l, (long)123l))))\n // (new ArrayList(Arrays.asList((long)6l, (long)4l, (long)6l, (long)3l, (long)4l, (long)4l, (long)10l, (long)1l, (long)124l)))\n public static ArrayList incrList(ArrayList l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(incrList((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(incrList((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)4l, (long)3l, (long)2l)))));\n assert(incrList((new ArrayList(Arrays.asList((long)5l, (long)2l, (long)5l, (long)2l, (long)3l, (long)3l, (long)9l, (long)0l, (long)123l)))).equals((new ArrayList(Arrays.asList((long)6l, (long)3l, (long)6l, (long)3l, (long)4l, (long)4l, (long)10l, (long)1l, (long)124l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // From a given list of integers, generate a list of rolling maximum element found until given moment\n // in the sequence.\n // >>> rollingMax((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)2l, (long)3l, (long)4l, (long)2l))))\n // (new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)3l, (long)3l, (long)4l, (long)4l)))\n public static ArrayList rollingMax(ArrayList numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(rollingMax((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(rollingMax((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))));\n assert(rollingMax((new ArrayList(Arrays.asList((long)4l, (long)3l, (long)2l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)4l, (long)4l, (long)4l, (long)4l)))));\n assert(rollingMax((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)3l, (long)100l, (long)3l)))).equals((new ArrayList(Arrays.asList((long)3l, (long)3l, (long)3l, (long)100l, (long)100l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n // separate those group into separate strings and return the list of those.\n // Separate groups are balanced (each open brace is properly closed) and not nested within each other\n // Ignore any spaces in the input string.\n // >>> separateParenGroups((\"( ) (( )) (( )( ))\"))\n // (new ArrayList(Arrays.asList((String)\"()\", (String)\"(())\", (String)\"(()())\")))\n public static ArrayList separateParenGroups(String paren_string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(separateParenGroups((\"(()()) ((())) () ((())()())\")).equals((new ArrayList(Arrays.asList((String)\"(()())\", (String)\"((()))\", (String)\"()\", (String)\"((())()())\")))));\n assert(separateParenGroups((\"() (()) ((())) (((())))\")).equals((new ArrayList(Arrays.asList((String)\"()\", (String)\"(())\", (String)\"((()))\", (String)\"(((())))\")))));\n assert(separateParenGroups((\"(()(())((())))\")).equals((new ArrayList(Arrays.asList((String)\"(()(())((())))\")))));\n assert(separateParenGroups((\"( ) (( )) (( )( ))\")).equals((new ArrayList(Arrays.asList((String)\"()\", (String)\"(())\", (String)\"(()())\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You will be given a string of words separated by commas or spaces. Your task is\n // to split the string into words and return an array of the words.\n // For example:\n // >>> wordsString((\"Hi, my name is John\"))\n // (new ArrayList(Arrays.asList((String)\"Hi\", (String)\"my\", (String)\"name\", (String)\"is\", (String)\"John\")))\n // >>> wordsString((\"One, two, three, four, five, six\"))\n // (new ArrayList(Arrays.asList((String)\"One\", (String)\"two\", (String)\"three\", (String)\"four\", (String)\"five\", (String)\"six\")))\n public static ArrayList wordsString(String s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(wordsString((\"Hi, my name is John\")).equals((new ArrayList(Arrays.asList((String)\"Hi\", (String)\"my\", (String)\"name\", (String)\"is\", (String)\"John\")))));\n assert(wordsString((\"One, two, three, four, five, six\")).equals((new ArrayList(Arrays.asList((String)\"One\", (String)\"two\", (String)\"three\", (String)\"four\", (String)\"five\", (String)\"six\")))));\n assert(wordsString((\"Hi, my name\")).equals((new ArrayList(Arrays.asList((String)\"Hi\", (String)\"my\", (String)\"name\")))));\n assert(wordsString((\"One,, two, three, four, five, six,\")).equals((new ArrayList(Arrays.asList((String)\"One\", (String)\"two\", (String)\"three\", (String)\"four\", (String)\"five\", (String)\"six\")))));\n assert(wordsString((\"\")).equals((new ArrayList(Arrays.asList()))));\n assert(wordsString((\"ahmed , gamal\")).equals((new ArrayList(Arrays.asList((String)\"ahmed\", (String)\"gamal\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Filter given list of any python values only for integers\n // >>> filterIntegers((new ArrayList(Arrays.asList((String)\"a\", (String)3.14f, (String)5l))))\n // (new ArrayList(Arrays.asList((long)5l)))\n // >>> filterIntegers((new ArrayList(Arrays.asList(1l, 2l, 3l, \"abc\", new HashMap(Map.of()), new ArrayList(Arrays.asList())))))\n // (new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)))\n public static ArrayList filterIntegers(ArrayList values) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(filterIntegers((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(filterIntegers((new ArrayList(Arrays.asList(4l, new HashMap(Map.of()), new ArrayList(Arrays.asList()), 23.2f, 9l, \"adasd\")))).equals((new ArrayList(Arrays.asList((long)4l, (long)9l)))));\n assert(filterIntegers((new ArrayList(Arrays.asList(3l, \"c\", 3l, 3l, \"a\", \"b\")))).equals((new ArrayList(Arrays.asList((long)3l, (long)3l, (long)3l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // This function takes a list l and returns a list l' such that\n // l' is identical to l in the odd indicies, while its values at the even indicies are equal\n // to the values of the even indicies of l, but sorted.\n // >>> sortEven((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))))\n // (new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)))\n // >>> sortEven((new ArrayList(Arrays.asList((long)5l, (long)6l, (long)3l, (long)4l))))\n // (new ArrayList(Arrays.asList((long)3l, (long)6l, (long)5l, (long)4l)))\n public static ArrayList sortEven(ArrayList l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sortEven((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)))));\n assert(sortEven((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)-5l, (long)2l, (long)-3l, (long)3l, (long)9l, (long)0l, (long)123l, (long)1l, (long)-10l)))).equals((new ArrayList(Arrays.asList((long)-10l, (long)3l, (long)-5l, (long)2l, (long)-3l, (long)3l, (long)5l, (long)0l, (long)9l, (long)1l, (long)123l)))));\n assert(sortEven((new ArrayList(Arrays.asList((long)5l, (long)8l, (long)-12l, (long)4l, (long)23l, (long)2l, (long)3l, (long)11l, (long)12l, (long)-10l)))).equals((new ArrayList(Arrays.asList((long)-12l, (long)8l, (long)3l, (long)4l, (long)5l, (long)2l, (long)12l, (long)11l, (long)23l, (long)-10l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // I think we all remember that feeling when the result of some long-awaited\n // event is finally known. The feelings and thoughts you have at that moment are\n // definitely worth noting down and comparing.\n // Your task is to determine if a person correctly guessed the results of a number of matches.\n // You are given two arrays of scores and guesses of equal length, where each index shows a match. \n // Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n // the value is 0, and if not, the value is the absolute difference between the guess and the score.\n // example:\n // >>> compare((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)1l))), (new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)2l, (long)-2l))))\n // (new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l, (long)0l, (long)3l, (long)3l)))\n // >>> compare((new ArrayList(Arrays.asList((long)0l, (long)5l, (long)0l, (long)0l, (long)0l, (long)4l))), (new ArrayList(Arrays.asList((long)4l, (long)1l, (long)1l, (long)0l, (long)0l, (long)-2l))))\n // (new ArrayList(Arrays.asList((long)4l, (long)4l, (long)1l, (long)0l, (long)0l, (long)6l)))\n public static ArrayList compare(ArrayList game, ArrayList guess) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(compare((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)1l))), (new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)2l, (long)-2l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l, (long)0l, (long)3l, (long)3l)))));\n assert(compare((new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l, (long)0l, (long)0l, (long)0l))), (new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l, (long)0l, (long)0l, (long)0l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)0l, (long)0l, (long)0l, (long)0l, (long)0l)))));\n assert(compare((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))), (new ArrayList(Arrays.asList((long)-1l, (long)-2l, (long)-3l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)6l)))));\n assert(compare((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)5l))), (new ArrayList(Arrays.asList((long)-1l, (long)2l, (long)3l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)0l, (long)0l, (long)1l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a positive integer n, return a tuple that has the number of even and odd\n // integer palindromes that fall within the range(1, n), inclusive.\n // Example 1:\n // >>> evenOddPalindrome((3l))\n // (Pair.with(1l, 2l))\n // Explanation:\n // Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n // Example 2:\n // >>> evenOddPalindrome((12l))\n // (Pair.with(4l, 6l))\n // Explanation:\n // Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n // Note:\n // 1. 1 <= n <= 10^3\n // 2. returned tuple has the number of even and odd integer palindromes respectively.\n public static Pair evenOddPalindrome(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(evenOddPalindrome((123l)).equals((Pair.with(8l, 13l))));\n assert(evenOddPalindrome((12l)).equals((Pair.with(4l, 6l))));\n assert(evenOddPalindrome((3l)).equals((Pair.with(1l, 2l))));\n assert(evenOddPalindrome((63l)).equals((Pair.with(6l, 8l))));\n assert(evenOddPalindrome((25l)).equals((Pair.with(5l, 6l))));\n assert(evenOddPalindrome((19l)).equals((Pair.with(4l, 6l))));\n assert(evenOddPalindrome((9l)).equals((Pair.with(4l, 5l))));\n assert(evenOddPalindrome((1l)).equals((Pair.with(0l, 1l))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n // fib4(0) -> 0\n // fib4(1) -> 0\n // fib4(2) -> 2\n // fib4(3) -> 0\n // fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n // Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n // >>> fib4((5l))\n // (4l)\n // >>> fib4((6l))\n // (8l)\n // >>> fib4((7l))\n // (14l)\n public static long fib4(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(fib4((5l)) == (4l));\n assert(fib4((8l)) == (28l));\n assert(fib4((10l)) == (104l));\n assert(fib4((12l)) == (386l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given two positive integers a and b, return the even digits between a\n // and b, in ascending order.\n // For example:\n // >>> generateIntegers((2l), (8l))\n // (new ArrayList(Arrays.asList((long)2l, (long)4l, (long)6l, (long)8l)))\n // >>> generateIntegers((8l), (2l))\n // (new ArrayList(Arrays.asList((long)2l, (long)4l, (long)6l, (long)8l)))\n // >>> generateIntegers((10l), (14l))\n // (new ArrayList(Arrays.asList()))\n public static ArrayList generateIntegers(long a, long b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(generateIntegers((2l), (10l)).equals((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)6l, (long)8l)))));\n assert(generateIntegers((10l), (2l)).equals((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)6l, (long)8l)))));\n assert(generateIntegers((132l), (2l)).equals((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)6l, (long)8l)))));\n assert(generateIntegers((17l), (89l)).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // For a given list of input numbers, calculate Mean Absolute Deviation\n // around the mean of this dataset.\n // Mean Absolute Deviation is the average absolute difference between each\n // element and a centerpoint (mean in this case):\n // MAD = average | x - x_mean |\n // >>> meanAbsoluteDeviation((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f))))\n // (1.0f)\n public static float meanAbsoluteDeviation(ArrayList numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(meanAbsoluteDeviation((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f)))) == (0.5f));\n assert(meanAbsoluteDeviation((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f)))) == (1.0f));\n assert(meanAbsoluteDeviation((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f)))) == (1.2f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function encrypt that takes a string as an argument and\n // returns a string encrypted with the alphabet being rotated. \n // The alphabet should be rotated in a manner such that the letters \n // shift down by two multiplied to two places.\n // For example:\n // >>> encrypt((\"hi\"))\n // (\"lm\")\n // >>> encrypt((\"asdfghjkl\"))\n // (\"ewhjklnop\")\n // >>> encrypt((\"gf\"))\n // (\"kj\")\n // >>> encrypt((\"et\"))\n // (\"ix\")\n public static String encrypt(String s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(encrypt((\"hi\")).equals((\"lm\")));\n assert(encrypt((\"asdfghjkl\")).equals((\"ewhjklnop\")));\n assert(encrypt((\"gf\")).equals((\"kj\")));\n assert(encrypt((\"et\")).equals((\"ix\")));\n assert(encrypt((\"faewfawefaewg\")).equals((\"jeiajeaijeiak\")));\n assert(encrypt((\"hellomyfriend\")).equals((\"lippsqcjvmirh\")));\n assert(encrypt((\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\")).equals((\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\")));\n assert(encrypt((\"a\")).equals((\"e\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n // The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n // as follows: start with any positive integer n. Then each term is obtained from the \n // previous term as follows: if the previous term is even, the next term is one half of \n // the previous term. If the previous term is odd, the next term is 3 times the previous\n // term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n // Note: \n // 1. Collatz(1) is [1].\n // 2. returned list sorted in increasing order.\n // For example:\n // get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n // >>> getOddCollatz((5l))\n // (new ArrayList(Arrays.asList((long)1l, (long)5l)))\n public static ArrayList getOddCollatz(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(getOddCollatz((14l)).equals((new ArrayList(Arrays.asList((long)1l, (long)5l, (long)7l, (long)11l, (long)13l, (long)17l)))));\n assert(getOddCollatz((5l)).equals((new ArrayList(Arrays.asList((long)1l, (long)5l)))));\n assert(getOddCollatz((12l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)5l)))));\n assert(getOddCollatz((1l)).equals((new ArrayList(Arrays.asList((long)1l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Find how many times a given substring can be found in the original string. Count overlaping cases.\n // >>> howManyTimes((\"\"), (\"a\"))\n // (0l)\n // >>> howManyTimes((\"aaa\"), (\"a\"))\n // (3l)\n // >>> howManyTimes((\"aaaa\"), (\"aa\"))\n // (3l)\n public static long howManyTimes(String string, String substring) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(howManyTimes((\"\"), (\"x\")) == (0l));\n assert(howManyTimes((\"xyxyxyx\"), (\"x\")) == (4l));\n assert(howManyTimes((\"cacacacac\"), (\"cac\")) == (4l));\n assert(howManyTimes((\"john doe\"), (\"john\")) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n // numbers in the array will be randomly ordered. Your task is to determine if\n // it is possible to get an array sorted in non-decreasing order by performing \n // the following operation on the given array:\n // You are allowed to perform right shift operation any number of times.\n // One right shift operation means shifting all elements of the array by one\n // position in the right direction. The last element of the array will be moved to\n // the starting position in the array i.e. 0th index. \n // If it is possible to obtain the sorted array by performing the above operation\n // then return True else return False.\n // If the given array is empty then return True.\n // Note: The given list is guaranteed to have unique elements.\n // For Example:\n // >>> moveOneBall((new ArrayList(Arrays.asList((long)3l, (long)4l, (long)5l, (long)1l, (long)2l))))\n // (true)\n // Explanation: By performin 2 right shift operations, non-decreasing order can\n // be achieved for the given array.\n // >>> moveOneBall((new ArrayList(Arrays.asList((long)3l, (long)5l, (long)4l, (long)1l, (long)2l))))\n // (false)\n // Explanation:It is not possible to get non-decreasing order for the given\n // array by performing any number of right shift operations.\n public static boolean moveOneBall(ArrayList arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(moveOneBall((new ArrayList(Arrays.asList((long)3l, (long)4l, (long)5l, (long)1l, (long)2l)))) == (true));\n assert(moveOneBall((new ArrayList(Arrays.asList((long)3l, (long)5l, (long)10l, (long)1l, (long)2l)))) == (true));\n assert(moveOneBall((new ArrayList(Arrays.asList((long)4l, (long)3l, (long)1l, (long)2l)))) == (false));\n assert(moveOneBall((new ArrayList(Arrays.asList((long)3l, (long)5l, (long)4l, (long)1l, (long)2l)))) == (false));\n assert(moveOneBall((new ArrayList(Arrays.asList()))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function which sorts the given list of integers\n // in ascending order according to the sum of their digits.\n // Note: if there are several items with similar sum of their digits,\n // order them based on their index in original list.\n // For example:\n // >>> orderByPoints((new ArrayList(Arrays.asList((long)1l, (long)11l, (long)-1l, (long)-11l, (long)-12l))))\n // (new ArrayList(Arrays.asList((long)-1l, (long)-11l, (long)1l, (long)-12l, (long)11l)))\n // >>> orderByPoints((new ArrayList(Arrays.asList())))\n // (new ArrayList(Arrays.asList()))\n public static ArrayList orderByPoints(ArrayList nums) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(orderByPoints((new ArrayList(Arrays.asList((long)1l, (long)11l, (long)-1l, (long)-11l, (long)-12l)))).equals((new ArrayList(Arrays.asList((long)-1l, (long)-11l, (long)1l, (long)-12l, (long)11l)))));\n assert(orderByPoints((new ArrayList(Arrays.asList((long)1234l, (long)423l, (long)463l, (long)145l, (long)2l, (long)423l, (long)423l, (long)53l, (long)6l, (long)37l, (long)3457l, (long)3l, (long)56l, (long)0l, (long)46l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)2l, (long)3l, (long)6l, (long)53l, (long)423l, (long)423l, (long)423l, (long)1234l, (long)145l, (long)37l, (long)46l, (long)56l, (long)463l, (long)3457l)))));\n assert(orderByPoints((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(orderByPoints((new ArrayList(Arrays.asList((long)1l, (long)-11l, (long)-32l, (long)43l, (long)54l, (long)-98l, (long)2l, (long)-3l)))).equals((new ArrayList(Arrays.asList((long)-3l, (long)-32l, (long)-98l, (long)-11l, (long)1l, (long)2l, (long)43l, (long)54l)))));\n assert(orderByPoints((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l, (long)7l, (long)8l, (long)9l, (long)10l, (long)11l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)10l, (long)2l, (long)11l, (long)3l, (long)4l, (long)5l, (long)6l, (long)7l, (long)8l, (long)9l)))));\n assert(orderByPoints((new ArrayList(Arrays.asList((long)0l, (long)6l, (long)6l, (long)-76l, (long)-21l, (long)23l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)-76l, (long)-21l, (long)0l, (long)4l, (long)23l, (long)6l, (long)6l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return list of prime factors of given integer in the order from smallest to largest.\n // Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n // Input number should be equal to the product of all factors\n // >>> factorize((8l))\n // (new ArrayList(Arrays.asList((long)2l, (long)2l, (long)2l)))\n // >>> factorize((25l))\n // (new ArrayList(Arrays.asList((long)5l, (long)5l)))\n // >>> factorize((70l))\n // (new ArrayList(Arrays.asList((long)2l, (long)5l, (long)7l)))\n public static ArrayList factorize(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(factorize((2l)).equals((new ArrayList(Arrays.asList((long)2l)))));\n assert(factorize((4l)).equals((new ArrayList(Arrays.asList((long)2l, (long)2l)))));\n assert(factorize((8l)).equals((new ArrayList(Arrays.asList((long)2l, (long)2l, (long)2l)))));\n assert(factorize((57l)).equals((new ArrayList(Arrays.asList((long)3l, (long)19l)))));\n assert(factorize((3249l)).equals((new ArrayList(Arrays.asList((long)3l, (long)3l, (long)19l, (long)19l)))));\n assert(factorize((185193l)).equals((new ArrayList(Arrays.asList((long)3l, (long)3l, (long)3l, (long)19l, (long)19l, (long)19l)))));\n assert(factorize((20577l)).equals((new ArrayList(Arrays.asList((long)3l, (long)19l, (long)19l, (long)19l)))));\n assert(factorize((18l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)3l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return True if all numbers in the list l are below threshold t.\n // >>> belowThreshold((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)4l, (long)10l))), (100l))\n // (true)\n // >>> belowThreshold((new ArrayList(Arrays.asList((long)1l, (long)20l, (long)4l, (long)10l))), (5l))\n // (false)\n public static boolean belowThreshold(ArrayList l, long t) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(belowThreshold((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)4l, (long)10l))), (100l)) == (true));\n assert(belowThreshold((new ArrayList(Arrays.asList((long)1l, (long)20l, (long)4l, (long)10l))), (5l)) == (false));\n assert(belowThreshold((new ArrayList(Arrays.asList((long)1l, (long)20l, (long)4l, (long)10l))), (21l)) == (true));\n assert(belowThreshold((new ArrayList(Arrays.asList((long)1l, (long)20l, (long)4l, (long)10l))), (22l)) == (true));\n assert(belowThreshold((new ArrayList(Arrays.asList((long)1l, (long)8l, (long)4l, (long)10l))), (11l)) == (true));\n assert(belowThreshold((new ArrayList(Arrays.asList((long)1l, (long)8l, (long)4l, (long)10l))), (10l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n // For each of the group, output the deepest level of nesting of parentheses.\n // E.g. (()()) has maximum two levels of nesting while ((())) has three.\n // >>> parseNestedParens((\"(()()) ((())) () ((())()())\"))\n // (new ArrayList(Arrays.asList((long)2l, (long)3l, (long)1l, (long)3l)))\n public static ArrayList parseNestedParens(String paren_string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(parseNestedParens((\"(()()) ((())) () ((())()())\")).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)1l, (long)3l)))));\n assert(parseNestedParens((\"() (()) ((())) (((())))\")).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))));\n assert(parseNestedParens((\"(()(())((())))\")).equals((new ArrayList(Arrays.asList((long)4l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n // Examples\n // >>> solution((new ArrayList(Arrays.asList((long)5l, (long)8l, (long)7l, (long)1l))))\n // (12l)\n // >>> solution((new ArrayList(Arrays.asList((long)3l, (long)3l, (long)3l, (long)3l, (long)3l))))\n // (9l)\n // >>> solution((new ArrayList(Arrays.asList((long)30l, (long)13l, (long)24l, (long)321l))))\n // (0l)\n public static long solution(ArrayList lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(solution((new ArrayList(Arrays.asList((long)5l, (long)8l, (long)7l, (long)1l)))) == (12l));\n assert(solution((new ArrayList(Arrays.asList((long)3l, (long)3l, (long)3l, (long)3l, (long)3l)))) == (9l));\n assert(solution((new ArrayList(Arrays.asList((long)30l, (long)13l, (long)24l, (long)321l)))) == (0l));\n assert(solution((new ArrayList(Arrays.asList((long)5l, (long)9l)))) == (5l));\n assert(solution((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)8l)))) == (0l));\n assert(solution((new ArrayList(Arrays.asList((long)30l, (long)13l, (long)23l, (long)32l)))) == (23l));\n assert(solution((new ArrayList(Arrays.asList((long)3l, (long)13l, (long)2l, (long)9l)))) == (3l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a positive integer n. You have to create an integer array a of length n.\n // For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n // Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n // and a[i] + a[j] + a[k] is a multiple of 3.\n // Example :\n // >>> getMaxTriples((5l))\n // (1l)\n // Explanation: \n // a = [1, 3, 7, 13, 21]\n // The only valid triple is (1, 7, 13).\n public static long getMaxTriples(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(getMaxTriples((5l)) == (1l));\n assert(getMaxTriples((6l)) == (4l));\n assert(getMaxTriples((10l)) == (36l));\n assert(getMaxTriples((100l)) == (53361l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // There are eight planets in our solar system: the closerst to the Sun \n // is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n // Uranus, Neptune.\n // Write a function that takes two planet names as strings planet1 and planet2. \n // The function should return a tuple containing all planets whose orbits are \n // located between the orbit of planet1 and the orbit of planet2, sorted by \n // the proximity to the sun. \n // The function should return an empty tuple if planet1 or planet2\n // are not correct planet names. \n // Examples\n // >>> bf((\"Jupiter\"), (\"Neptune\"))\n // (new ArrayList(Arrays.asList((String)\"Saturn\", (String)\"Uranus\")))\n // >>> bf((\"Earth\"), (\"Mercury\"))\n // (ArrayList(\"Venus\"))\n // >>> bf((\"Mercury\"), (\"Uranus\"))\n // (new ArrayList(Arrays.asList((String)\"Venus\", (String)\"Earth\", (String)\"Mars\", (String)\"Jupiter\", (String)\"Saturn\")))\n public static ArrayList bf(String planet1, String planet2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(bf((\"Jupiter\"), (\"Neptune\")).equals((new ArrayList(Arrays.asList((String)\"Saturn\", (String)\"Uranus\")))));\n assert(bf((\"Earth\"), (\"Mercury\")).equals((new ArrayList(Arrays.asList((String)\"Venus\")))));\n assert(bf((\"Mercury\"), (\"Uranus\")).equals((new ArrayList(Arrays.asList((String)\"Venus\", (String)\"Earth\", (String)\"Mars\", (String)\"Jupiter\", (String)\"Saturn\")))));\n assert(bf((\"Neptune\"), (\"Venus\")).equals((new ArrayList(Arrays.asList((String)\"Earth\", (String)\"Mars\", (String)\"Jupiter\", (String)\"Saturn\", (String)\"Uranus\")))));\n assert(bf((\"Earth\"), (\"Earth\")).equals((new ArrayList(Arrays.asList()))));\n assert(bf((\"Mars\"), (\"Earth\")).equals((new ArrayList(Arrays.asList()))));\n assert(bf((\"Jupiter\"), (\"Makemake\")).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a list of integers.\n // Write a function next_smallest() that returns the 2nd smallest element of the list.\n // Return None if there is no such element.\n // >>> nextSmallest((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l))))\n // 2l\n // >>> nextSmallest((new ArrayList(Arrays.asList((long)5l, (long)1l, (long)4l, (long)3l, (long)2l))))\n // 2l\n // >>> nextSmallest((new ArrayList(Arrays.asList())))\n // Optional.empty()\n // >>> nextSmallest((new ArrayList(Arrays.asList((long)1l, (long)1l))))\n // Optional.empty()\n public static Optional nextSmallest(ArrayList lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(nextSmallest((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l)))).equals(2l));\n assert(nextSmallest((new ArrayList(Arrays.asList((long)5l, (long)1l, (long)4l, (long)3l, (long)2l)))).equals(2l));\n assert(nextSmallest((new ArrayList(Arrays.asList()))).equals(Optional.empty()));\n assert(nextSmallest((new ArrayList(Arrays.asList((long)1l, (long)1l)))).equals(Optional.empty()));\n assert(nextSmallest((new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l, (long)0l)))).equals(1l));\n assert(nextSmallest((new ArrayList(Arrays.asList((long)1l, (long)1l)))).equals(Optional.empty()));\n assert(nextSmallest((new ArrayList(Arrays.asList((long)-35l, (long)34l, (long)12l, (long)-45l)))).equals(-35l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Input is a space-delimited string of numberals from 'zero' to 'nine'.\n // Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n // Return the string with numbers sorted from smallest to largest\n // >>> sortNumbers((\"three one five\"))\n // (\"one three five\")\n public static String sortNumbers(String numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sortNumbers((\"\")).equals((\"\")));\n assert(sortNumbers((\"three\")).equals((\"three\")));\n assert(sortNumbers((\"three five nine\")).equals((\"three five nine\")));\n assert(sortNumbers((\"five zero four seven nine eight\")).equals((\"zero four five seven eight nine\")));\n assert(sortNumbers((\"six five four three two one zero\")).equals((\"zero one two three four five six\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n // >>> cycpatternCheck((\"abcd\"), (\"abd\"))\n // (false)\n // >>> cycpatternCheck((\"hello\"), (\"ell\"))\n // (true)\n // >>> cycpatternCheck((\"whassup\"), (\"psus\"))\n // (false)\n // >>> cycpatternCheck((\"abab\"), (\"baa\"))\n // (true)\n // >>> cycpatternCheck((\"efef\"), (\"eeff\"))\n // (false)\n // >>> cycpatternCheck((\"himenss\"), (\"simen\"))\n // (true)\n public static boolean cycpatternCheck(String a, String b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(cycpatternCheck((\"xyzw\"), (\"xyw\")) == (false));\n assert(cycpatternCheck((\"yello\"), (\"ell\")) == (true));\n assert(cycpatternCheck((\"whattup\"), (\"ptut\")) == (false));\n assert(cycpatternCheck((\"efef\"), (\"fee\")) == (true));\n assert(cycpatternCheck((\"abab\"), (\"aabb\")) == (false));\n assert(cycpatternCheck((\"winemtt\"), (\"tinem\")) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You will be given a number in decimal form and your task is to convert it to\n // binary format. The function should return a string, with each character representing a binary\n // number. Each character in the string will be '0' or '1'.\n // There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n // The extra characters are there to help with the format.\n // Examples:\n // >>> decimalToBinary((15l))\n // (\"db1111db\")\n // >>> decimalToBinary((32l))\n // (\"db100000db\")\n public static String decimalToBinary(long decimal) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(decimalToBinary((0l)).equals((\"db0db\")));\n assert(decimalToBinary((32l)).equals((\"db100000db\")));\n assert(decimalToBinary((103l)).equals((\"db1100111db\")));\n assert(decimalToBinary((15l)).equals((\"db1111db\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Filter an input list of strings only for ones that contain given substring\n // >>> filterBySubstring((new ArrayList(Arrays.asList())), (\"a\"))\n // (new ArrayList(Arrays.asList()))\n // >>> filterBySubstring((new ArrayList(Arrays.asList((String)\"abc\", (String)\"bacd\", (String)\"cde\", (String)\"array\"))), (\"a\"))\n // (new ArrayList(Arrays.asList((String)\"abc\", (String)\"bacd\", (String)\"array\")))\n public static ArrayList filterBySubstring(ArrayList strings, String substring) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(filterBySubstring((new ArrayList(Arrays.asList())), (\"john\")).equals((new ArrayList(Arrays.asList()))));\n assert(filterBySubstring((new ArrayList(Arrays.asList((String)\"xxx\", (String)\"asd\", (String)\"xxy\", (String)\"john doe\", (String)\"xxxAAA\", (String)\"xxx\"))), (\"xxx\")).equals((new ArrayList(Arrays.asList((String)\"xxx\", (String)\"xxxAAA\", (String)\"xxx\")))));\n assert(filterBySubstring((new ArrayList(Arrays.asList((String)\"xxx\", (String)\"asd\", (String)\"aaaxxy\", (String)\"john doe\", (String)\"xxxAAA\", (String)\"xxx\"))), (\"xx\")).equals((new ArrayList(Arrays.asList((String)\"xxx\", (String)\"aaaxxy\", (String)\"xxxAAA\", (String)\"xxx\")))));\n assert(filterBySubstring((new ArrayList(Arrays.asList((String)\"grunt\", (String)\"trumpet\", (String)\"prune\", (String)\"gruesome\"))), (\"run\")).equals((new ArrayList(Arrays.asList((String)\"grunt\", (String)\"prune\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given an integer. return a tuple that has the number of even and odd digits respectively.\n // Example:\n // >>> evenOddCount((-12l))\n // (Pair.with(1l, 1l))\n // >>> evenOddCount((123l))\n // (Pair.with(1l, 2l))\n public static Pair evenOddCount(long num) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(evenOddCount((7l)).equals((Pair.with(0l, 1l))));\n assert(evenOddCount((-78l)).equals((Pair.with(1l, 1l))));\n assert(evenOddCount((3452l)).equals((Pair.with(2l, 2l))));\n assert(evenOddCount((346211l)).equals((Pair.with(3l, 3l))));\n assert(evenOddCount((-345821l)).equals((Pair.with(3l, 3l))));\n assert(evenOddCount((-2l)).equals((Pair.with(1l, 0l))));\n assert(evenOddCount((-45347l)).equals((Pair.with(2l, 3l))));\n assert(evenOddCount((0l)).equals((Pair.with(1l, 0l))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that accepts a list of strings.\n // The list contains different words. Return the word with maximum number\n // of unique characters. If multiple strings have maximum number of unique\n // characters, return the one which comes first in lexicographical order.\n // >>> findMax((new ArrayList(Arrays.asList((String)\"name\", (String)\"of\", (String)\"string\"))))\n // (\"string\")\n // >>> findMax((new ArrayList(Arrays.asList((String)\"name\", (String)\"enam\", (String)\"game\"))))\n // (\"enam\")\n // >>> findMax((new ArrayList(Arrays.asList((String)\"aaaaaaa\", (String)\"bb\", (String)\"cc\"))))\n // (\"aaaaaaa\")\n public static String findMax(ArrayList words) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(findMax((new ArrayList(Arrays.asList((String)\"name\", (String)\"of\", (String)\"string\")))).equals((\"string\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"name\", (String)\"enam\", (String)\"game\")))).equals((\"enam\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"aaaaaaa\", (String)\"bb\", (String)\"cc\")))).equals((\"aaaaaaa\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"abc\", (String)\"cba\")))).equals((\"abc\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"play\", (String)\"this\", (String)\"game\", (String)\"of\", (String)\"footbott\")))).equals((\"footbott\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"we\", (String)\"are\", (String)\"gonna\", (String)\"rock\")))).equals((\"gonna\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"we\", (String)\"are\", (String)\"a\", (String)\"mad\", (String)\"nation\")))).equals((\"nation\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"this\", (String)\"is\", (String)\"a\", (String)\"prrk\")))).equals((\"this\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"b\")))).equals((\"b\")));\n assert(findMax((new ArrayList(Arrays.asList((String)\"play\", (String)\"play\", (String)\"play\")))).equals((\"play\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a positive integer n, return the count of the numbers of n-digit\n // positive integers that start or end with 1.\n public static long startsOneEnds(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(startsOneEnds((1l)) == (1l));\n assert(startsOneEnds((2l)) == (18l));\n assert(startsOneEnds((3l)) == (180l));\n assert(startsOneEnds((4l)) == (1800l));\n assert(startsOneEnds((5l)) == (18000l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function that returns a tuple (a, b), where 'a' is\n // the largest of negative integers, and 'b' is the smallest\n // of positive integers in a list.\n // If there is no negative or positive integers, return them as None.\n // Examples:\n // >>> largestSmallestIntegers((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)1l, (long)3l, (long)5l, (long)7l))))\n // Pair.with(Optional.of(Optional.empty()), Optional.of(1l))\n // >>> largestSmallestIntegers((new ArrayList(Arrays.asList())))\n // Pair.with(Optional.of(Optional.empty()), Optional.of(Optional.empty()))\n // >>> largestSmallestIntegers((new ArrayList(Arrays.asList((long)0l))))\n // Pair.with(Optional.of(Optional.empty()), Optional.of(Optional.empty()))\n public static Pair, Optional> largestSmallestIntegers(ArrayList lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)1l, (long)3l, (long)5l, (long)7l)))).equals(Pair.with(Optional.of(Optional.empty()), Optional.of(1l))));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)1l, (long)3l, (long)5l, (long)7l, (long)0l)))).equals(Pair.with(Optional.of(Optional.empty()), Optional.of(1l))));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)4l, (long)5l, (long)6l, (long)-2l)))).equals(Pair.with(-2l, 1l)));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)4l, (long)5l, (long)3l, (long)6l, (long)2l, (long)7l, (long)-7l)))).equals(Pair.with(-7l, 2l)));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)7l, (long)3l, (long)8l, (long)4l, (long)9l, (long)2l, (long)5l, (long)-9l)))).equals(Pair.with(-9l, 2l)));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList()))).equals(Pair.with(Optional.of(Optional.empty()), Optional.of(Optional.empty()))));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)0l)))).equals(Pair.with(Optional.of(Optional.empty()), Optional.of(Optional.empty()))));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)-1l, (long)-3l, (long)-5l, (long)-6l)))).equals(Pair.with(Optional.of(-1l), Optional.of(Optional.empty()))));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)-1l, (long)-3l, (long)-5l, (long)-6l, (long)0l)))).equals(Pair.with(Optional.of(-1l), Optional.of(Optional.empty()))));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)-6l, (long)-4l, (long)-4l, (long)-3l, (long)1l)))).equals(Pair.with(-3l, 1l)));\n assert(largestSmallestIntegers((new ArrayList(Arrays.asList((long)-6l, (long)-4l, (long)-4l, (long)-3l, (long)-100l, (long)1l)))).equals(Pair.with(-3l, 1l)));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // \"Given an array representing a branch of a tree that has non-negative integer nodes\n // your task is to pluck one of the nodes and return it.\n // The plucked node should be the node with the smallest even value.\n // If multiple nodes with the same smallest even value are found return the node that has smallest index.\n // The plucked node should be returned in a list, [ smalest_value, its index ],\n // If there are no even values or the given array is empty, return [].\n // Example 1:\n // >>> pluck((new ArrayList(Arrays.asList((long)4l, (long)2l, (long)3l))))\n // (new ArrayList(Arrays.asList((long)2l, (long)1l)))\n // Explanation: 2 has the smallest even value, and 2 has the smallest index.\n // Example 2:\n // >>> pluck((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))))\n // (new ArrayList(Arrays.asList((long)2l, (long)1l)))\n // Explanation: 2 has the smallest even value, and 2 has the smallest index.\n // Example 3:\n // >>> pluck((new ArrayList(Arrays.asList())))\n // (new ArrayList(Arrays.asList()))\n // Example 4:\n // >>> pluck((new ArrayList(Arrays.asList((long)5l, (long)0l, (long)3l, (long)0l, (long)4l, (long)2l))))\n // (new ArrayList(Arrays.asList((long)0l, (long)1l)))\n // Explanation: 0 is the smallest value, but there are two zeros,\n // so we will choose the first zero, which has the smallest index.\n // Constraints:\n // * 1 <= nodes.length <= 10000\n // * 0 <= node.value\n public static ArrayList pluck(ArrayList arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(pluck((new ArrayList(Arrays.asList((long)4l, (long)2l, (long)3l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)1l)))));\n assert(pluck((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)))).equals((new ArrayList(Arrays.asList((long)2l, (long)1l)))));\n assert(pluck((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(pluck((new ArrayList(Arrays.asList((long)5l, (long)0l, (long)3l, (long)0l, (long)4l, (long)2l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)1l)))));\n assert(pluck((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)0l, (long)5l, (long)3l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)3l)))));\n assert(pluck((new ArrayList(Arrays.asList((long)5l, (long)4l, (long)8l, (long)4l, (long)8l)))).equals((new ArrayList(Arrays.asList((long)4l, (long)1l)))));\n assert(pluck((new ArrayList(Arrays.asList((long)7l, (long)6l, (long)7l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)6l, (long)1l)))));\n assert(pluck((new ArrayList(Arrays.asList((long)7l, (long)9l, (long)7l, (long)1l)))).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function count_nums which takes an array of integers and returns\n // the number of elements which has a sum of digits > 0.\n // If a number is negative, then its first signed digit will be negative:\n // e.g. -123 has signed digits -1, 2, and 3.\n // >>> countNums((new ArrayList(Arrays.asList())))\n // (0l)\n // >>> countNums((new ArrayList(Arrays.asList((long)-1l, (long)11l, (long)-11l))))\n // (1l)\n // >>> countNums((new ArrayList(Arrays.asList((long)1l, (long)1l, (long)2l))))\n // (3l)\n public static long countNums(ArrayList arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(countNums((new ArrayList(Arrays.asList()))) == (0l));\n assert(countNums((new ArrayList(Arrays.asList((long)-1l, (long)-2l, (long)0l)))) == (0l));\n assert(countNums((new ArrayList(Arrays.asList((long)1l, (long)1l, (long)2l, (long)-2l, (long)3l, (long)4l, (long)5l)))) == (6l));\n assert(countNums((new ArrayList(Arrays.asList((long)1l, (long)6l, (long)9l, (long)-6l, (long)0l, (long)1l, (long)5l)))) == (5l));\n assert(countNums((new ArrayList(Arrays.asList((long)1l, (long)100l, (long)98l, (long)-7l, (long)1l, (long)-1l)))) == (4l));\n assert(countNums((new ArrayList(Arrays.asList((long)12l, (long)23l, (long)34l, (long)-45l, (long)-56l, (long)0l)))) == (5l));\n assert(countNums((new ArrayList(Arrays.asList((long)0l, (long)1l)))) == (1l));\n assert(countNums((new ArrayList(Arrays.asList((long)1l)))) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n // each cell of the grid contains a value. Every integer in the range [1, N * N]\n // inclusive appears exactly once on the cells of the grid.\n // You have to find the minimum path of length k in the grid. You can start\n // from any cell, and in each step you can move to any of the neighbor cells,\n // in other words, you can go to cells which share an edge with you current\n // cell.\n // Please note that a path of length k means visiting exactly k cells (not\n // necessarily distinct).\n // You CANNOT go off the grid.\n // A path A (of length k) is considered less than a path B (of length k) if\n // after making the ordered lists of the values on the cells that A and B go\n // through (let's call them lst_A and lst_B), lst_A is lexicographically less\n // than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n // such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n // lst_A[j] = lst_B[j].\n // It is guaranteed that the answer is unique.\n // Return an ordered list of the values on the cells that the minimum path go through.\n // Examples: \n // >>> minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)), (ArrayList)new ArrayList(Arrays.asList((long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)7l, (long)8l, (long)9l))))), (3l))\n // (new ArrayList(Arrays.asList((long)1l, (long)2l, (long)1l)))\n // >>> minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)5l, (long)9l, (long)3l)), (ArrayList)new ArrayList(Arrays.asList((long)4l, (long)1l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)7l, (long)8l, (long)2l))))), (1l))\n // (new ArrayList(Arrays.asList((long)1l)))\n public static ArrayList minPath(ArrayList> grid, long k) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)), (ArrayList)new ArrayList(Arrays.asList((long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)7l, (long)8l, (long)9l))))), (3l)).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)1l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)5l, (long)9l, (long)3l)), (ArrayList)new ArrayList(Arrays.asList((long)4l, (long)1l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)7l, (long)8l, (long)2l))))), (1l)).equals((new ArrayList(Arrays.asList((long)1l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)), (ArrayList)new ArrayList(Arrays.asList((long)5l, (long)6l, (long)7l, (long)8l)), (ArrayList)new ArrayList(Arrays.asList((long)9l, (long)10l, (long)11l, (long)12l)), (ArrayList)new ArrayList(Arrays.asList((long)13l, (long)14l, (long)15l, (long)16l))))), (4l)).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)1l, (long)2l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)6l, (long)4l, (long)13l, (long)10l)), (ArrayList)new ArrayList(Arrays.asList((long)5l, (long)7l, (long)12l, (long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)3l, (long)16l, (long)11l, (long)15l)), (ArrayList)new ArrayList(Arrays.asList((long)8l, (long)14l, (long)9l, (long)2l))))), (7l)).equals((new ArrayList(Arrays.asList((long)1l, (long)10l, (long)1l, (long)10l, (long)1l, (long)10l, (long)1l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)8l, (long)14l, (long)9l, (long)2l)), (ArrayList)new ArrayList(Arrays.asList((long)6l, (long)4l, (long)13l, (long)15l)), (ArrayList)new ArrayList(Arrays.asList((long)5l, (long)7l, (long)1l, (long)12l)), (ArrayList)new ArrayList(Arrays.asList((long)3l, (long)10l, (long)11l, (long)16l))))), (5l)).equals((new ArrayList(Arrays.asList((long)1l, (long)7l, (long)1l, (long)7l, (long)1l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)11l, (long)8l, (long)7l, (long)2l)), (ArrayList)new ArrayList(Arrays.asList((long)5l, (long)16l, (long)14l, (long)4l)), (ArrayList)new ArrayList(Arrays.asList((long)9l, (long)3l, (long)15l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)12l, (long)13l, (long)10l, (long)1l))))), (9l)).equals((new ArrayList(Arrays.asList((long)1l, (long)6l, (long)1l, (long)6l, (long)1l, (long)6l, (long)1l, (long)6l, (long)1l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)12l, (long)13l, (long)10l, (long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)9l, (long)3l, (long)15l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)5l, (long)16l, (long)14l, (long)4l)), (ArrayList)new ArrayList(Arrays.asList((long)11l, (long)8l, (long)7l, (long)2l))))), (12l)).equals((new ArrayList(Arrays.asList((long)1l, (long)6l, (long)1l, (long)6l, (long)1l, (long)6l, (long)1l, (long)6l, (long)1l, (long)6l, (long)1l, (long)6l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)2l, (long)7l, (long)4l)), (ArrayList)new ArrayList(Arrays.asList((long)3l, (long)1l, (long)5l)), (ArrayList)new ArrayList(Arrays.asList((long)6l, (long)8l, (long)9l))))), (8l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)1l, (long)3l, (long)1l, (long)3l, (long)1l, (long)3l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)6l, (long)1l, (long)5l)), (ArrayList)new ArrayList(Arrays.asList((long)3l, (long)8l, (long)9l)), (ArrayList)new ArrayList(Arrays.asList((long)2l, (long)7l, (long)4l))))), (8l)).equals((new ArrayList(Arrays.asList((long)1l, (long)5l, (long)1l, (long)5l, (long)1l, (long)5l, (long)1l, (long)5l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l)), (ArrayList)new ArrayList(Arrays.asList((long)3l, (long)4l))))), (10l)).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)1l, (long)2l, (long)1l, (long)2l, (long)1l, (long)2l, (long)1l, (long)2l)))));\n assert(minPath((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)3l)), (ArrayList)new ArrayList(Arrays.asList((long)3l, (long)2l))))), (10l)).equals((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)1l, (long)3l, (long)1l, (long)3l, (long)1l, (long)3l, (long)1l, (long)3l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given list of integers, return list in strange order.\n // Strange sorting, is when you start with the minimum value,\n // then maximum of the remaining integers, then minimum and so on.\n // Examples:\n // >>> strangeSortList((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l))))\n // (new ArrayList(Arrays.asList((long)1l, (long)4l, (long)2l, (long)3l)))\n // >>> strangeSortList((new ArrayList(Arrays.asList((long)5l, (long)5l, (long)5l, (long)5l))))\n // (new ArrayList(Arrays.asList((long)5l, (long)5l, (long)5l, (long)5l)))\n // >>> strangeSortList((new ArrayList(Arrays.asList())))\n // (new ArrayList(Arrays.asList()))\n public static ArrayList strangeSortList(ArrayList lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(strangeSortList((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)2l, (long)3l)))));\n assert(strangeSortList((new ArrayList(Arrays.asList((long)5l, (long)6l, (long)7l, (long)8l, (long)9l)))).equals((new ArrayList(Arrays.asList((long)5l, (long)9l, (long)6l, (long)8l, (long)7l)))));\n assert(strangeSortList((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)5l, (long)2l, (long)4l, (long)3l)))));\n assert(strangeSortList((new ArrayList(Arrays.asList((long)5l, (long)6l, (long)7l, (long)8l, (long)9l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)9l, (long)5l, (long)8l, (long)6l, (long)7l)))));\n assert(strangeSortList((new ArrayList(Arrays.asList((long)5l, (long)5l, (long)5l, (long)5l)))).equals((new ArrayList(Arrays.asList((long)5l, (long)5l, (long)5l, (long)5l)))));\n assert(strangeSortList((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(strangeSortList((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l, (long)7l, (long)8l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)8l, (long)2l, (long)7l, (long)3l, (long)6l, (long)4l, (long)5l)))));\n assert(strangeSortList((new ArrayList(Arrays.asList((long)0l, (long)2l, (long)2l, (long)2l, (long)5l, (long)5l, (long)-5l, (long)-5l)))).equals((new ArrayList(Arrays.asList((long)-5l, (long)5l, (long)-5l, (long)5l, (long)0l, (long)2l, (long)2l, (long)2l)))));\n assert(strangeSortList((new ArrayList(Arrays.asList((long)111111l)))).equals((new ArrayList(Arrays.asList((long)111111l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a string 'text', return its md5 hash equivalent string.\n // If 'text' is an empty string, return None.\n // >>> stringToMd5((\"Hello world\"))\n // \"3e25960a79dbc69b674cd4ec67a72c62\"\n public static Optional stringToMd5(String text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(stringToMd5((\"Hello world\")).equals(\"3e25960a79dbc69b674cd4ec67a72c62\"));\n assert(stringToMd5((\"\")).equals(Optional.empty()));\n assert(stringToMd5((\"A B C\")).equals(\"0ef78513b0cb8cef12743f5aeb35f888\"));\n assert(stringToMd5((\"password\")).equals(\"5f4dcc3b5aa765d61d8327deb882cf99\"));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a word. Your task is to find the closest vowel that stands between \n // two consonants from the right side of the word (case sensitive).\n // Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n // find any vowel met the above condition. \n // You may assume that the given string contains English letter only.\n // Example:\n // >>> getClosestVowel((\"yogurt\"))\n // (\"u\")\n // >>> getClosestVowel((\"FULL\"))\n // (\"U\")\n // >>> getClosestVowel((\"quick\"))\n // (\"\")\n // >>> getClosestVowel((\"ab\"))\n // (\"\")\n public static String getClosestVowel(String word) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(getClosestVowel((\"yogurt\")).equals((\"u\")));\n assert(getClosestVowel((\"full\")).equals((\"u\")));\n assert(getClosestVowel((\"easy\")).equals((\"\")));\n assert(getClosestVowel((\"eAsy\")).equals((\"\")));\n assert(getClosestVowel((\"ali\")).equals((\"\")));\n assert(getClosestVowel((\"bad\")).equals((\"a\")));\n assert(getClosestVowel((\"most\")).equals((\"o\")));\n assert(getClosestVowel((\"ab\")).equals((\"\")));\n assert(getClosestVowel((\"ba\")).equals((\"\")));\n assert(getClosestVowel((\"quick\")).equals((\"\")));\n assert(getClosestVowel((\"anime\")).equals((\"i\")));\n assert(getClosestVowel((\"Asia\")).equals((\"\")));\n assert(getClosestVowel((\"Above\")).equals((\"o\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Change numerical base of input number x to base.\n // return string representation after the conversion.\n // base numbers are less than 10.\n // >>> changeBase((8l), (3l))\n // (\"22\")\n // >>> changeBase((8l), (2l))\n // (\"1000\")\n // >>> changeBase((7l), (2l))\n // (\"111\")\n public static String changeBase(long x, long base) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(changeBase((8l), (3l)).equals((\"22\")));\n assert(changeBase((9l), (3l)).equals((\"100\")));\n assert(changeBase((234l), (2l)).equals((\"11101010\")));\n assert(changeBase((16l), (2l)).equals((\"10000\")));\n assert(changeBase((8l), (2l)).equals((\"1000\")));\n assert(changeBase((7l), (2l)).equals((\"111\")));\n assert(changeBase((2l), (3l)).equals((\"2\")));\n assert(changeBase((3l), (4l)).equals((\"3\")));\n assert(changeBase((4l), (5l)).equals((\"4\")));\n assert(changeBase((5l), (6l)).equals((\"5\")));\n assert(changeBase((6l), (7l)).equals((\"6\")));\n assert(changeBase((7l), (8l)).equals((\"7\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Check if in given list of numbers, are any two numbers closer to each other than\n // given threshold.\n // >>> hasCloseElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f))), (0.5f))\n // (false)\n // >>> hasCloseElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.8f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.0f))), (0.3f))\n // (true)\n public static boolean hasCloseElements(ArrayList numbers, float threshold) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(hasCloseElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.9f, (float)4.0f, (float)5.0f, (float)2.2f))), (0.3f)) == (true));\n assert(hasCloseElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.9f, (float)4.0f, (float)5.0f, (float)2.2f))), (0.05f)) == (false));\n assert(hasCloseElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)5.9f, (float)4.0f, (float)5.0f))), (0.95f)) == (true));\n assert(hasCloseElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)5.9f, (float)4.0f, (float)5.0f))), (0.8f)) == (false));\n assert(hasCloseElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.0f))), (0.1f)) == (true));\n assert(hasCloseElements((new ArrayList(Arrays.asList((float)1.1f, (float)2.2f, (float)3.1f, (float)4.1f, (float)5.1f))), (1.0f)) == (true));\n assert(hasCloseElements((new ArrayList(Arrays.asList((float)1.1f, (float)2.2f, (float)3.1f, (float)4.1f, (float)5.1f))), (0.5f)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function that takes a string as input which contains only square brackets.\n // The function should return True if and only if there is a valid subsequence of brackets \n // where at least one bracket in the subsequence is nested.\n // >>> isNested((\"[[]]\"))\n // (true)\n // >>> isNested((\"[]]]]]]][[[[[]\"))\n // (false)\n // >>> isNested((\"[][]\"))\n // (false)\n // >>> isNested((\"[]\"))\n // (false)\n // >>> isNested((\"[[][]]\"))\n // (true)\n // >>> isNested((\"[[]][[\"))\n // (true)\n public static boolean isNested(String string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(isNested((\"[[]]\")) == (true));\n assert(isNested((\"[]]]]]]][[[[[]\")) == (false));\n assert(isNested((\"[][]\")) == (false));\n assert(isNested((\"[]\")) == (false));\n assert(isNested((\"[[[[]]]]\")) == (true));\n assert(isNested((\"[]]]]]]]]]]\")) == (false));\n assert(isNested((\"[][][[]]\")) == (true));\n assert(isNested((\"[[]\")) == (false));\n assert(isNested((\"[]]\")) == (false));\n assert(isNested((\"[[]][[\")) == (true));\n assert(isNested((\"[[][]]\")) == (true));\n assert(isNested((\"\")) == (false));\n assert(isNested((\"[[[[[[[[\")) == (false));\n assert(isNested((\"]]]]]]]]\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Concatenate list of strings into a single string\n // >>> concatenate((new ArrayList(Arrays.asList())))\n // (\"\")\n // >>> concatenate((new ArrayList(Arrays.asList((String)\"a\", (String)\"b\", (String)\"c\"))))\n // (\"abc\")\n public static String concatenate(ArrayList strings) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(concatenate((new ArrayList(Arrays.asList()))).equals((\"\")));\n assert(concatenate((new ArrayList(Arrays.asList((String)\"x\", (String)\"y\", (String)\"z\")))).equals((\"xyz\")));\n assert(concatenate((new ArrayList(Arrays.asList((String)\"x\", (String)\"y\", (String)\"z\", (String)\"w\", (String)\"k\")))).equals((\"xyzwk\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n // >>> primeFib((1l))\n // (2l)\n // >>> primeFib((2l))\n // (3l)\n // >>> primeFib((3l))\n // (5l)\n // >>> primeFib((4l))\n // (13l)\n // >>> primeFib((5l))\n // (89l)\n public static long primeFib(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(primeFib((1l)) == (2l));\n assert(primeFib((2l)) == (3l));\n assert(primeFib((3l)) == (5l));\n assert(primeFib((4l)) == (13l));\n assert(primeFib((5l)) == (89l));\n assert(primeFib((6l)) == (233l));\n assert(primeFib((7l)) == (1597l));\n assert(primeFib((8l)) == (28657l));\n assert(primeFib((9l)) == (514229l));\n assert(primeFib((10l)) == (433494437l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n // other and return them in order (smaller number, larger number).\n // >>> findClosestElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.2f))))\n // (Pair.with(2.0f, 2.2f))\n // >>> findClosestElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.0f))))\n // (Pair.with(2.0f, 2.0f))\n public static Pair findClosestElements(ArrayList numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(findClosestElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.9f, (float)4.0f, (float)5.0f, (float)2.2f)))).equals((Pair.with(3.9f, 4.0f))));\n assert(findClosestElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)5.9f, (float)4.0f, (float)5.0f)))).equals((Pair.with(5.0f, 5.9f))));\n assert(findClosestElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.2f)))).equals((Pair.with(2.0f, 2.2f))));\n assert(findClosestElements((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.0f)))).equals((Pair.with(2.0f, 2.0f))));\n assert(findClosestElements((new ArrayList(Arrays.asList((float)1.1f, (float)2.2f, (float)3.1f, (float)4.1f, (float)5.1f)))).equals((Pair.with(2.2f, 3.1f))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You have been tasked to write a function that receives \n // a hexadecimal number as a string and counts the number of hexadecimal \n // digits that are primes (prime number, or a prime, is a natural number \n // greater than 1 that is not a product of two smaller natural numbers).\n // Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n // Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n // So you have to determine a number of the following digits: 2, 3, 5, 7, \n // B (=decimal 11), D (=decimal 13).\n // Note: you may assume the input is always correct or empty string, \n // and symbols A,B,C,D,E,F are always uppercase.\n // Examples:\n // >>> hexKey((\"AB\"))\n // (1l)\n // >>> hexKey((\"1077E\"))\n // (2l)\n // >>> hexKey((\"ABED1A33\"))\n // (4l)\n // >>> hexKey((\"123456789ABCDEF0\"))\n // (6l)\n // >>> hexKey((\"2020\"))\n // (2l)\n public static long hexKey(String num) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(hexKey((\"AB\")) == (1l));\n assert(hexKey((\"1077E\")) == (2l));\n assert(hexKey((\"ABED1A33\")) == (4l));\n assert(hexKey((\"2020\")) == (2l));\n assert(hexKey((\"123456789ABCDEF0\")) == (6l));\n assert(hexKey((\"112233445566778899AABBCCDDEEFF00\")) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Complete the function that takes two integers and returns \n // the product of their unit digits.\n // Assume the input is always valid.\n // Examples:\n // >>> multiply((148l), (412l))\n // (16l)\n // >>> multiply((19l), (28l))\n // (72l)\n // >>> multiply((2020l), (1851l))\n // (0l)\n // >>> multiply((14l), (-15l))\n // (20l)\n public static long multiply(long a, long b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(multiply((148l), (412l)) == (16l));\n assert(multiply((19l), (28l)) == (72l));\n assert(multiply((2020l), (1851l)) == (0l));\n assert(multiply((14l), (-15l)) == (20l));\n assert(multiply((76l), (67l)) == (42l));\n assert(multiply((17l), (27l)) == (49l));\n assert(multiply((0l), (1l)) == (0l));\n assert(multiply((0l), (0l)) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given list of numbers (of at least two elements), apply a linear transform to that list,\n // such that the smallest number will become 0 and the largest will become 1\n // >>> rescaleToUnit((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f))))\n // (new ArrayList(Arrays.asList((float)0.0f, (float)0.25f, (float)0.5f, (float)0.75f, (float)1.0f)))\n public static ArrayList rescaleToUnit(ArrayList numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(rescaleToUnit((new ArrayList(Arrays.asList((float)2.0f, (float)49.9f)))).equals((new ArrayList(Arrays.asList((float)0.0f, (float)1.0f)))));\n assert(rescaleToUnit((new ArrayList(Arrays.asList((float)100.0f, (float)49.9f)))).equals((new ArrayList(Arrays.asList((float)1.0f, (float)0.0f)))));\n assert(rescaleToUnit((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f)))).equals((new ArrayList(Arrays.asList((float)0.0f, (float)0.25f, (float)0.5f, (float)0.75f, (float)1.0f)))));\n assert(rescaleToUnit((new ArrayList(Arrays.asList((float)2.0f, (float)1.0f, (float)5.0f, (float)3.0f, (float)4.0f)))).equals((new ArrayList(Arrays.asList((float)0.25f, (float)0.0f, (float)1.0f, (float)0.5f, (float)0.75f)))));\n assert(rescaleToUnit((new ArrayList(Arrays.asList((float)12.0f, (float)11.0f, (float)15.0f, (float)13.0f, (float)14.0f)))).equals((new ArrayList(Arrays.asList((float)0.25f, (float)0.0f, (float)1.0f, (float)0.5f, (float)0.75f)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a positive integer n, return the product of the odd digits.\n // Return 0 if all digits are even.\n // For example:\n // >>> digits((1l))\n // (1l)\n // >>> digits((4l))\n // (0l)\n // >>> digits((235l))\n // (15l)\n public static long digits(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(digits((5l)) == (5l));\n assert(digits((54l)) == (5l));\n assert(digits((120l)) == (1l));\n assert(digits((5014l)) == (5l));\n assert(digits((98765l)) == (315l));\n assert(digits((5576543l)) == (2625l));\n assert(digits((2468l)) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You will be given the name of a class (a string) and a list of extensions.\n // The extensions are to be used to load additional classes to the class. The\n // strength of the extension is as follows: Let CAP be the number of the uppercase\n // letters in the extension's name, and let SM be the number of lowercase letters \n // in the extension's name, the strength is given by the fraction CAP - SM. \n // You should find the strongest extension and return a string in this \n // format: ClassName.StrongestExtensionName.\n // If there are two or more extensions with the same strength, you should\n // choose the one that comes first in the list.\n // For example, if you are given \"Slices\" as the class and a list of the\n // extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n // return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n // (its strength is -1).\n // Example:\n // >>> StrongestExtension((\"my_class\"), (new ArrayList(Arrays.asList((String)\"AA\", (String)\"Be\", (String)\"CC\"))))\n // (\"my_class.AA\")\n public static String StrongestExtension(String class_name, ArrayList extensions) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(StrongestExtension((\"Watashi\"), (new ArrayList(Arrays.asList((String)\"tEN\", (String)\"niNE\", (String)\"eIGHt8OKe\")))).equals((\"Watashi.eIGHt8OKe\")));\n assert(StrongestExtension((\"Boku123\"), (new ArrayList(Arrays.asList((String)\"nani\", (String)\"NazeDa\", (String)\"YEs.WeCaNe\", (String)\"32145tggg\")))).equals((\"Boku123.YEs.WeCaNe\")));\n assert(StrongestExtension((\"__YESIMHERE\"), (new ArrayList(Arrays.asList((String)\"t\", (String)\"eMptY\", (String)\"nothing\", (String)\"zeR00\", (String)\"NuLl__\", (String)\"123NoooneB321\")))).equals((\"__YESIMHERE.NuLl__\")));\n assert(StrongestExtension((\"K\"), (new ArrayList(Arrays.asList((String)\"Ta\", (String)\"TAR\", (String)\"t234An\", (String)\"cosSo\")))).equals((\"K.TAR\")));\n assert(StrongestExtension((\"__HAHA\"), (new ArrayList(Arrays.asList((String)\"Tab\", (String)\"123\", (String)\"781345\", (String)\"-_-\")))).equals((\"__HAHA.123\")));\n assert(StrongestExtension((\"YameRore\"), (new ArrayList(Arrays.asList((String)\"HhAas\", (String)\"okIWILL123\", (String)\"WorkOut\", (String)\"Fails\", (String)\"-_-\")))).equals((\"YameRore.okIWILL123\")));\n assert(StrongestExtension((\"finNNalLLly\"), (new ArrayList(Arrays.asList((String)\"Die\", (String)\"NowW\", (String)\"Wow\", (String)\"WoW\")))).equals((\"finNNalLLly.WoW\")));\n assert(StrongestExtension((\"_\"), (new ArrayList(Arrays.asList((String)\"Bb\", (String)\"91245\")))).equals((\"_.Bb\")));\n assert(StrongestExtension((\"Sp\"), (new ArrayList(Arrays.asList((String)\"671235\", (String)\"Bb\")))).equals((\"Sp.671235\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a string representing a space separated lowercase letters, return a dictionary\n // of the letter with the most repetition and containing the corresponding count.\n // If several letters have the same occurrence, return all of them.\n // Example:\n // >>> histogram((\"a b c\"))\n // (new HashMap(Map.of(\"a\", 1l, \"b\", 1l, \"c\", 1l)))\n // >>> histogram((\"a b b a\"))\n // (new HashMap(Map.of(\"a\", 2l, \"b\", 2l)))\n // >>> histogram((\"a b c a b\"))\n // (new HashMap(Map.of(\"a\", 2l, \"b\", 2l)))\n // >>> histogram((\"b b b b a\"))\n // (new HashMap(Map.of(\"b\", 4l)))\n // >>> histogram((\"\"))\n // (new HashMap())\n public static HashMap histogram(String test) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(histogram((\"a b b a\")).equals((new HashMap(Map.of(\"a\", 2l, \"b\", 2l)))));\n assert(histogram((\"a b c a b\")).equals((new HashMap(Map.of(\"a\", 2l, \"b\", 2l)))));\n assert(histogram((\"a b c d g\")).equals((new HashMap(Map.of(\"a\", 1l, \"b\", 1l, \"c\", 1l, \"d\", 1l, \"g\", 1l)))));\n assert(histogram((\"r t g\")).equals((new HashMap(Map.of(\"r\", 1l, \"t\", 1l, \"g\", 1l)))));\n assert(histogram((\"b b b b a\")).equals((new HashMap(Map.of(\"b\", 4l)))));\n assert(histogram((\"r t g\")).equals((new HashMap(Map.of(\"r\", 1l, \"t\", 1l, \"g\", 1l)))));\n assert(histogram((\"\")).equals((new HashMap())));\n assert(histogram((\"a\")).equals((new HashMap(Map.of(\"a\", 1l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // pairs_sum_to_zero takes a list of integers as an input.\n // it returns True if there are two distinct elements in the list that\n // sum to zero, and False otherwise.\n // >>> pairsSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)5l, (long)0l))))\n // (false)\n // >>> pairsSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)-2l, (long)1l))))\n // (false)\n // >>> pairsSumToZero((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)7l))))\n // (false)\n // >>> pairsSumToZero((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)-5l, (long)3l, (long)5l, (long)7l))))\n // (true)\n // >>> pairsSumToZero((new ArrayList(Arrays.asList((long)1l))))\n // (false)\n public static boolean pairsSumToZero(ArrayList l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)5l, (long)0l)))) == (false));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)-2l, (long)1l)))) == (false));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)7l)))) == (false));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)-5l, (long)3l, (long)5l, (long)7l)))) == (true));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)1l)))) == (false));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)-3l, (long)9l, (long)-1l, (long)3l, (long)2l, (long)30l)))) == (true));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)-3l, (long)9l, (long)-1l, (long)3l, (long)2l, (long)31l)))) == (true));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)-3l, (long)9l, (long)-1l, (long)4l, (long)2l, (long)30l)))) == (false));\n assert(pairsSumToZero((new ArrayList(Arrays.asList((long)-3l, (long)9l, (long)-1l, (long)4l, (long)2l, (long)31l)))) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that accepts two lists of strings and returns the list that has \n // total number of chars in the all strings of the list less than the other list.\n // if the two lists have the same number of chars, return the first list.\n // Examples\n // >>> totalMatch((new ArrayList(Arrays.asList())), (new ArrayList(Arrays.asList())))\n // (new ArrayList(Arrays.asList()))\n // >>> totalMatch((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\"))), (new ArrayList(Arrays.asList((String)\"hI\", (String)\"Hi\"))))\n // (new ArrayList(Arrays.asList((String)\"hI\", (String)\"Hi\")))\n // >>> totalMatch((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\"))), (new ArrayList(Arrays.asList((String)\"hi\", (String)\"hi\", (String)\"admin\", (String)\"project\"))))\n // (new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\")))\n // >>> totalMatch((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\"))), (new ArrayList(Arrays.asList((String)\"hI\", (String)\"hi\", (String)\"hi\"))))\n // (new ArrayList(Arrays.asList((String)\"hI\", (String)\"hi\", (String)\"hi\")))\n // >>> totalMatch((new ArrayList(Arrays.asList((String)\"4\"))), (new ArrayList(Arrays.asList((String)\"1\", (String)\"2\", (String)\"3\", (String)\"4\", (String)\"5\"))))\n // (new ArrayList(Arrays.asList((String)\"4\")))\n public static ArrayList totalMatch(ArrayList lst1, ArrayList lst2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(totalMatch((new ArrayList(Arrays.asList())), (new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(totalMatch((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\"))), (new ArrayList(Arrays.asList((String)\"hi\", (String)\"hi\")))).equals((new ArrayList(Arrays.asList((String)\"hi\", (String)\"hi\")))));\n assert(totalMatch((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\"))), (new ArrayList(Arrays.asList((String)\"hi\", (String)\"hi\", (String)\"admin\", (String)\"project\")))).equals((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\")))));\n assert(totalMatch((new ArrayList(Arrays.asList((String)\"4\"))), (new ArrayList(Arrays.asList((String)\"1\", (String)\"2\", (String)\"3\", (String)\"4\", (String)\"5\")))).equals((new ArrayList(Arrays.asList((String)\"4\")))));\n assert(totalMatch((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\"))), (new ArrayList(Arrays.asList((String)\"hI\", (String)\"Hi\")))).equals((new ArrayList(Arrays.asList((String)\"hI\", (String)\"Hi\")))));\n assert(totalMatch((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\"))), (new ArrayList(Arrays.asList((String)\"hI\", (String)\"hi\", (String)\"hi\")))).equals((new ArrayList(Arrays.asList((String)\"hI\", (String)\"hi\", (String)\"hi\")))));\n assert(totalMatch((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\"))), (new ArrayList(Arrays.asList((String)\"hI\", (String)\"hi\", (String)\"hii\")))).equals((new ArrayList(Arrays.asList((String)\"hi\", (String)\"admin\")))));\n assert(totalMatch((new ArrayList(Arrays.asList())), (new ArrayList(Arrays.asList((String)\"this\")))).equals((new ArrayList(Arrays.asList()))));\n assert(totalMatch((new ArrayList(Arrays.asList((String)\"this\"))), (new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Circular shift the digits of the integer x, shift the digits right by shift\n // and return the result as a string.\n // If shift > number of digits, return digits reversed.\n // >>> circularShift((12l), (1l))\n // (\"21\")\n // >>> circularShift((12l), (2l))\n // (\"12\")\n public static String circularShift(long x, long shift) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(circularShift((100l), (2l)).equals((\"001\")));\n assert(circularShift((12l), (2l)).equals((\"12\")));\n assert(circularShift((97l), (8l)).equals((\"79\")));\n assert(circularShift((12l), (1l)).equals((\"21\")));\n assert(circularShift((11l), (101l)).equals((\"11\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return True is list elements are monotonically increasing or decreasing.\n // >>> monotonic((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)4l, (long)20l))))\n // (true)\n // >>> monotonic((new ArrayList(Arrays.asList((long)1l, (long)20l, (long)4l, (long)10l))))\n // (false)\n // >>> monotonic((new ArrayList(Arrays.asList((long)4l, (long)1l, (long)0l, (long)-10l))))\n // (true)\n public static boolean monotonic(ArrayList l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(monotonic((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)4l, (long)10l)))) == (true));\n assert(monotonic((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)4l, (long)20l)))) == (true));\n assert(monotonic((new ArrayList(Arrays.asList((long)1l, (long)20l, (long)4l, (long)10l)))) == (false));\n assert(monotonic((new ArrayList(Arrays.asList((long)4l, (long)1l, (long)0l, (long)-10l)))) == (true));\n assert(monotonic((new ArrayList(Arrays.asList((long)4l, (long)1l, (long)1l, (long)0l)))) == (true));\n assert(monotonic((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)2l, (long)5l, (long)60l)))) == (false));\n assert(monotonic((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)60l)))) == (true));\n assert(monotonic((new ArrayList(Arrays.asList((long)9l, (long)9l, (long)9l, (long)9l)))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n // Example\n // >>> isEqualToSumEven((4l))\n // (false)\n // >>> isEqualToSumEven((6l))\n // (false)\n // >>> isEqualToSumEven((8l))\n // (true)\n public static boolean isEqualToSumEven(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(isEqualToSumEven((4l)) == (false));\n assert(isEqualToSumEven((6l)) == (false));\n assert(isEqualToSumEven((8l)) == (true));\n assert(isEqualToSumEven((10l)) == (true));\n assert(isEqualToSumEven((11l)) == (false));\n assert(isEqualToSumEven((12l)) == (true));\n assert(isEqualToSumEven((13l)) == (false));\n assert(isEqualToSumEven((16l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Input to this function is a string representing musical notes in a special ASCII format.\n // Your task is to parse this string and return list of integers corresponding to how many beats does each\n // not last.\n // Here is a legend:\n // 'o' - whole note, lasts four beats\n // 'o|' - half note, lasts two beats\n // '.|' - quater note, lasts one beat\n // >>> parseMusic((\"o o| .| o| o| .| .| .| .| o o\"))\n // (new ArrayList(Arrays.asList((long)4l, (long)2l, (long)1l, (long)2l, (long)2l, (long)1l, (long)1l, (long)1l, (long)1l, (long)4l, (long)4l)))\n public static ArrayList parseMusic(String music_string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(parseMusic((\"\")).equals((new ArrayList(Arrays.asList()))));\n assert(parseMusic((\"o o o o\")).equals((new ArrayList(Arrays.asList((long)4l, (long)4l, (long)4l, (long)4l)))));\n assert(parseMusic((\".| .| .| .|\")).equals((new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l)))));\n assert(parseMusic((\"o| o| .| .| o o o o\")).equals((new ArrayList(Arrays.asList((long)2l, (long)2l, (long)1l, (long)1l, (long)4l, (long)4l, (long)4l, (long)4l)))));\n assert(parseMusic((\"o| .| o| .| o o| o o|\")).equals((new ArrayList(Arrays.asList((long)2l, (long)1l, (long)2l, (long)1l, (long)4l, (long)2l, (long)4l, (long)2l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // \"\n // This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n // multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n // change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n // Examples:\n // >>> lst\n // (long)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))\n // >>> lst\n // (long)new ArrayList(Arrays.asList())\n // >>> lst\n // (long)new ArrayList(Arrays.asList((long)-1l, (long)-5l, (long)2l, (long)-1l, (long)-5l))\n public static long sumSquares(ArrayList lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sumSquares((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l)))) == (6l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)9l)))) == (14l));\n assert(sumSquares((new ArrayList(Arrays.asList()))) == (0l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l, (long)1l, (long)1l, (long)1l, (long)1l, (long)1l, (long)1l)))) == (9l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)-1l, (long)-1l, (long)-1l, (long)-1l, (long)-1l, (long)-1l, (long)-1l, (long)-1l, (long)-1l)))) == (-3l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)0l)))) == (0l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)-1l, (long)-5l, (long)2l, (long)-1l, (long)-5l)))) == (-126l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)-56l, (long)-99l, (long)1l, (long)0l, (long)-2l)))) == (3030l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)-1l, (long)0l, (long)0l, (long)0l, (long)0l, (long)0l, (long)0l, (long)0l, (long)-1l)))) == (0l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)-16l, (long)-9l, (long)-2l, (long)36l, (long)36l, (long)26l, (long)-20l, (long)25l, (long)-40l, (long)20l, (long)-4l, (long)12l, (long)-26l, (long)35l, (long)37l)))) == (-14196l));\n assert(sumSquares((new ArrayList(Arrays.asList((long)-1l, (long)-3l, (long)17l, (long)-1l, (long)-15l, (long)13l, (long)-1l, (long)14l, (long)-14l, (long)-12l, (long)-5l, (long)14l, (long)-14l, (long)6l, (long)13l, (long)11l, (long)16l, (long)16l, (long)4l, (long)10l)))) == (-1448l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // triples_sum_to_zero takes a list of integers as an input.\n // it returns True if there are three distinct elements in the list that\n // sum to zero, and False otherwise.\n // >>> triplesSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)5l, (long)0l))))\n // (false)\n // >>> triplesSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)-2l, (long)1l))))\n // (true)\n // >>> triplesSumToZero((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)7l))))\n // (false)\n // >>> triplesSumToZero((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)-5l, (long)3l, (long)9l, (long)7l))))\n // (true)\n // >>> triplesSumToZero((new ArrayList(Arrays.asList((long)1l))))\n // (false)\n public static boolean triplesSumToZero(ArrayList l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)5l, (long)0l)))) == (false));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)5l, (long)-1l)))) == (false));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)-2l, (long)1l)))) == (true));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)7l)))) == (false));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)5l, (long)7l)))) == (false));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)-5l, (long)3l, (long)9l, (long)7l)))) == (true));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)1l)))) == (false));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)5l, (long)-100l)))) == (false));\n assert(triplesSumToZero((new ArrayList(Arrays.asList((long)100l, (long)3l, (long)5l, (long)-100l)))) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // brackets is a string of \"<\" and \">\".\n // return True if every opening bracket has a corresponding closing bracket.\n // >>> correctBracketing((\"<\"))\n // (false)\n // >>> correctBracketing((\"<>\"))\n // (true)\n // >>> correctBracketing((\"<<><>>\"))\n // (true)\n // >>> correctBracketing((\"><<>\"))\n // (false)\n public static boolean correctBracketing(String brackets) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(correctBracketing((\"<>\")) == (true));\n assert(correctBracketing((\"<<><>>\")) == (true));\n assert(correctBracketing((\"<><><<><>><>\")) == (true));\n assert(correctBracketing((\"<><><<<><><>><>><<><><<>>>\")) == (true));\n assert(correctBracketing((\"<<<><>>>>\")) == (false));\n assert(correctBracketing((\"><<>\")) == (false));\n assert(correctBracketing((\"<\")) == (false));\n assert(correctBracketing((\"<<<<\")) == (false));\n assert(correctBracketing((\">\")) == (false));\n assert(correctBracketing((\"<<>\")) == (false));\n assert(correctBracketing((\"<><><<><>><>><<>\")) == (false));\n assert(correctBracketing((\"<><><<><>><>>><>\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that takes an array of numbers as input and returns \n // the number of elements in the array that are greater than 10 and both \n // first and last digits of a number are odd (1, 3, 5, 7, 9).\n // For example:\n // >>> specialFilter((new ArrayList(Arrays.asList((long)15l, (long)-73l, (long)14l, (long)-15l))))\n // (1l)\n // >>> specialFilter((new ArrayList(Arrays.asList((long)33l, (long)-2l, (long)-3l, (long)45l, (long)21l, (long)109l))))\n // (2l)\n public static long specialFilter(ArrayList nums) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(specialFilter((new ArrayList(Arrays.asList((long)5l, (long)-2l, (long)1l, (long)-5l)))) == (0l));\n assert(specialFilter((new ArrayList(Arrays.asList((long)15l, (long)-73l, (long)14l, (long)-15l)))) == (1l));\n assert(specialFilter((new ArrayList(Arrays.asList((long)33l, (long)-2l, (long)-3l, (long)45l, (long)21l, (long)109l)))) == (2l));\n assert(specialFilter((new ArrayList(Arrays.asList((long)43l, (long)-12l, (long)93l, (long)125l, (long)121l, (long)109l)))) == (4l));\n assert(specialFilter((new ArrayList(Arrays.asList((long)71l, (long)-2l, (long)-33l, (long)75l, (long)21l, (long)19l)))) == (3l));\n assert(specialFilter((new ArrayList(Arrays.asList((long)1l)))) == (0l));\n assert(specialFilter((new ArrayList(Arrays.asList()))) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a dictionary, return True if all keys are strings in lower \n // case or all keys are strings in upper case, else return False.\n // The function should return False is the given dictionary is empty.\n // Examples:\n // >>> checkDictCase((new HashMap(Map.of(\"a\", \"apple\", \"b\", \"banana\"))))\n // (true)\n // >>> checkDictCase((new HashMap(Map.of(\"a\", \"apple\", \"A\", \"banana\", \"B\", \"banana\"))))\n // (false)\n // >>> checkDictCase((new HashMap(Map.of(\"a\", \"apple\", 8l, \"banana\", \"a\", \"apple\"))))\n // (false)\n // >>> checkDictCase((new HashMap(Map.of(\"Name\", \"John\", \"Age\", \"36\", \"City\", \"Houston\"))))\n // (false)\n // >>> checkDictCase((new HashMap(Map.of(\"STATE\", \"NC\", \"ZIP\", \"12345\"))))\n // (true)\n public static boolean checkDictCase(HashMap dict) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(checkDictCase((new HashMap(Map.of(\"p\", \"pineapple\", \"b\", \"banana\")))) == (true));\n assert(checkDictCase((new HashMap(Map.of(\"p\", \"pineapple\", \"A\", \"banana\", \"B\", \"banana\")))) == (false));\n assert(checkDictCase((new HashMap(Map.of(\"p\", \"pineapple\", \"5\", \"banana\", \"a\", \"apple\")))) == (false));\n assert(checkDictCase((new HashMap(Map.of(\"Name\", \"John\", \"Age\", \"36\", \"City\", \"Houston\")))) == (false));\n assert(checkDictCase((new HashMap(Map.of(\"STATE\", \"NC\", \"ZIP\", \"12345\")))) == (true));\n assert(checkDictCase((new HashMap(Map.of(\"fruit\", \"Orange\", \"taste\", \"Sweet\")))) == (true));\n assert(checkDictCase((new HashMap())) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n // fibfib(0) == 0\n // fibfib(1) == 0\n // fibfib(2) == 1\n // fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n // Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n // >>> fibfib((1l))\n // (0l)\n // >>> fibfib((5l))\n // (4l)\n // >>> fibfib((8l))\n // (24l)\n public static long fibfib(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(fibfib((2l)) == (1l));\n assert(fibfib((1l)) == (0l));\n assert(fibfib((5l)) == (4l));\n assert(fibfib((8l)) == (24l));\n assert(fibfib((10l)) == (81l));\n assert(fibfib((12l)) == (274l));\n assert(fibfib((14l)) == (927l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a list of numbers.\n // You need to return the sum of squared numbers in the given list,\n // round each element in the list to the upper int(Ceiling) first.\n // Examples:\n // >>> lst((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f))))\n // (14l)\n // >>> lst((new ArrayList(Arrays.asList((float)1.0f, (float)4.0f, (float)9.0f))))\n // (98l)\n // >>> lst((new ArrayList(Arrays.asList((float)1.0f, (float)3.0f, (float)5.0f, (float)7.0f))))\n // (84l)\n // >>> lst((new ArrayList(Arrays.asList((float)1.4f, (float)4.2f, (float)0.0f))))\n // (29l)\n // >>> lst((new ArrayList(Arrays.asList((float)-2.4f, (float)1.0f, (float)1.0f))))\n // (6l)\n public static long sumSquares(ArrayList lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sumSquares((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f)))) == (14l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)1.0f, (float)2.0f, (float)3.0f)))) == (14l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)1.0f, (float)3.0f, (float)5.0f, (float)7.0f)))) == (84l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)1.4f, (float)4.2f, (float)0.0f)))) == (29l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)-2.4f, (float)1.0f, (float)1.0f)))) == (6l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)100.0f, (float)1.0f, (float)15.0f, (float)2.0f)))) == (10230l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)10000.0f, (float)10000.0f)))) == (200000000l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)-1.4f, (float)4.6f, (float)6.3f)))) == (75l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)-1.4f, (float)17.9f, (float)18.9f, (float)19.9f)))) == (1086l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)0.0f)))) == (0l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)-1.0f)))) == (1l));\n assert(sumSquares((new ArrayList(Arrays.asList((float)-1.0f, (float)1.0f, (float)0.0f)))) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_85_add", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a non-empty list of integers lst. add the even elements that are at odd indices..\n // Examples:\n // >>> add((new ArrayList(Arrays.asList((long)4l, (long)2l, (long)6l, (long)7l))))\n // (2l)\n public static long add(ArrayList lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(add((new ArrayList(Arrays.asList((long)4l, (long)88l)))) == (88l));\n assert(add((new ArrayList(Arrays.asList((long)4l, (long)5l, (long)6l, (long)7l, (long)2l, (long)122l)))) == (122l));\n assert(add((new ArrayList(Arrays.asList((long)4l, (long)0l, (long)6l, (long)7l)))) == (0l));\n assert(add((new ArrayList(Arrays.asList((long)4l, (long)4l, (long)6l, (long)8l)))) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return sorted unique elements in a list\n // >>> unique((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)5l, (long)2l, (long)3l, (long)3l, (long)9l, (long)0l, (long)123l))))\n // (new ArrayList(Arrays.asList((long)0l, (long)2l, (long)3l, (long)5l, (long)9l, (long)123l)))\n public static ArrayList unique(ArrayList l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(unique((new ArrayList(Arrays.asList((long)5l, (long)3l, (long)5l, (long)2l, (long)3l, (long)3l, (long)9l, (long)0l, (long)123l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)2l, (long)3l, (long)5l, (long)9l, (long)123l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a string text, replace all spaces in it with underscores, \n // and if a string has more than 2 consecutive spaces, \n // then replace all consecutive spaces with - \n // >>> fixSpaces((\" Example\"))\n // (\"Example\")\n // >>> fixSpaces((\" Example 1\"))\n // (\"Example_1\")\n // >>> fixSpaces((\" Example 2\"))\n // (\"_Example_2\")\n // >>> fixSpaces((\" Example 3\"))\n // (\"_Example-3\")\n public static String fixSpaces(String text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(fixSpaces((\"Example\")).equals((\"Example\")));\n assert(fixSpaces((\"Mudasir Hanif \")).equals((\"Mudasir_Hanif_\")));\n assert(fixSpaces((\"Yellow Yellow Dirty Fellow\")).equals((\"Yellow_Yellow__Dirty__Fellow\")));\n assert(fixSpaces((\"Exa mple\")).equals((\"Exa-mple\")));\n assert(fixSpaces((\" Exa 1 2 2 mple\")).equals((\"-Exa_1_2_2_mple\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return 2^n modulo p (be aware of numerics).\n // >>> modp((3l), (5l))\n // (3l)\n // >>> modp((1101l), (101l))\n // (2l)\n // >>> modp((0l), (101l))\n // (1l)\n // >>> modp((3l), (11l))\n // (8l)\n // >>> modp((100l), (101l))\n // (1l)\n public static long modp(long n, long p) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(modp((3l), (5l)) == (3l));\n assert(modp((1101l), (101l)) == (2l));\n assert(modp((0l), (101l)) == (1l));\n assert(modp((3l), (11l)) == (8l));\n assert(modp((100l), (101l)) == (1l));\n assert(modp((30l), (5l)) == (4l));\n assert(modp((31l), (5l)) == (3l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You have to write a function which validates a given date string and\n // returns True if the date is valid otherwise False.\n // The date is valid if all of the following rules are satisfied:\n // 1. The date string is not empty.\n // 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n // 3. The months should not be less than 1 or higher than 12.\n // 4. The date should be in the format: mm-dd-yyyy\n // >>> validDate((\"03-11-2000\"))\n // (true)\n // >>> validDate((\"15-01-2012\"))\n // (false)\n // >>> validDate((\"04-0-2040\"))\n // (false)\n // >>> validDate((\"06-04-2020\"))\n // (true)\n // >>> validDate((\"06/04/2020\"))\n // (false)\n public static boolean validDate(String date) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(validDate((\"03-11-2000\")) == (true));\n assert(validDate((\"15-01-2012\")) == (false));\n assert(validDate((\"04-0-2040\")) == (false));\n assert(validDate((\"06-04-2020\")) == (true));\n assert(validDate((\"01-01-2007\")) == (true));\n assert(validDate((\"03-32-2011\")) == (false));\n assert(validDate((\"\")) == (false));\n assert(validDate((\"04-31-3000\")) == (false));\n assert(validDate((\"06-06-2005\")) == (true));\n assert(validDate((\"21-31-2000\")) == (false));\n assert(validDate((\"04-12-2003\")) == (true));\n assert(validDate((\"04122003\")) == (false));\n assert(validDate((\"20030412\")) == (false));\n assert(validDate((\"2003-04\")) == (false));\n assert(validDate((\"2003-04-12\")) == (false));\n assert(validDate((\"04-2003\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that takes a string and returns an ordered version of it.\n // Ordered version of string, is a string where all words (separated by space)\n // are replaced by a new word where all the characters arranged in\n // ascending order based on ascii value.\n // Note: You should keep the order of words and blank spaces in the sentence.\n // For example:\n // >>> antiShuffle((\"Hi\"))\n // (\"Hi\")\n // >>> antiShuffle((\"hello\"))\n // (\"ehllo\")\n // >>> antiShuffle((\"Hello World!!!\"))\n // (\"Hello !!!Wdlor\")\n public static String antiShuffle(String s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(antiShuffle((\"Hi\")).equals((\"Hi\")));\n assert(antiShuffle((\"hello\")).equals((\"ehllo\")));\n assert(antiShuffle((\"number\")).equals((\"bemnru\")));\n assert(antiShuffle((\"abcd\")).equals((\"abcd\")));\n assert(antiShuffle((\"Hello World!!!\")).equals((\"Hello !!!Wdlor\")));\n assert(antiShuffle((\"\")).equals((\"\")));\n assert(antiShuffle((\"Hi. My name is Mister Robot. How are you?\")).equals((\".Hi My aemn is Meirst .Rboot How aer ?ouy\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a list of numbers, return whether or not they are sorted\n // in ascending order. If list has more than 1 duplicate of the same\n // number, return False. Assume no negative numbers and only integers.\n // Examples\n // >>> isSorted((new ArrayList(Arrays.asList((long)5l))))\n // (true)\n // >>> isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l))))\n // (true)\n // >>> isSorted((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)4l, (long)5l))))\n // (false)\n // >>> isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l))))\n // (true)\n // >>> isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l, (long)7l))))\n // (true)\n // >>> isSorted((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)4l, (long)5l, (long)6l, (long)7l))))\n // (false)\n // >>> isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)2l, (long)3l, (long)3l, (long)4l))))\n // (true)\n // >>> isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)2l, (long)2l, (long)3l, (long)4l))))\n // (false)\n public static boolean isSorted(ArrayList lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(isSorted((new ArrayList(Arrays.asList((long)5l)))) == (true));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l)))) == (true));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)4l, (long)5l)))) == (false));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)))) == (true));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l, (long)7l)))) == (true));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)2l, (long)4l, (long)5l, (long)6l, (long)7l)))) == (false));\n assert(isSorted((new ArrayList(Arrays.asList()))) == (true));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l)))) == (true));\n assert(isSorted((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)1l)))) == (false));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)2l, (long)2l, (long)3l, (long)4l)))) == (false));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)3l, (long)3l, (long)4l)))) == (false));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)2l, (long)3l, (long)3l, (long)4l)))) == (true));\n assert(isSorted((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l)))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a string s.\n // Your task is to check if the string is happy or not.\n // A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n // For example:\n // >>> isHappy((\"a\"))\n // (false)\n // >>> isHappy((\"aa\"))\n // (false)\n // >>> isHappy((\"abcd\"))\n // (true)\n // >>> isHappy((\"aabb\"))\n // (false)\n // >>> isHappy((\"adb\"))\n // (true)\n // >>> isHappy((\"xyy\"))\n // (false)\n public static boolean isHappy(String s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(isHappy((\"a\")) == (false));\n assert(isHappy((\"aa\")) == (false));\n assert(isHappy((\"abcd\")) == (true));\n assert(isHappy((\"aabb\")) == (false));\n assert(isHappy((\"adb\")) == (true));\n assert(isHappy((\"xyy\")) == (false));\n assert(isHappy((\"iopaxpoi\")) == (true));\n assert(isHappy((\"iopaxioi\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Write a function that returns True if the object q will fly, and False otherwise.\n // The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n // Example:\n // >>> willItFly((new ArrayList(Arrays.asList((long)1l, (long)2l))), (5l))\n // (false)\n // # 1+2 is less than the maximum possible weight, but it's unbalanced.\n // >>> willItFly((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)3l))), (1l))\n // (false)\n // # it's balanced, but 3+2+3 is more than the maximum possible weight.\n // >>> willItFly((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)3l))), (9l))\n // (true)\n // # 3+2+3 is less than the maximum possible weight, and it's balanced.\n // >>> willItFly((new ArrayList(Arrays.asList((long)3l))), (5l))\n // (true)\n // # 3 is less than the maximum possible weight, and it's balanced.\n public static boolean willItFly(ArrayList q, long w) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(willItFly((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)3l))), (9l)) == (true));\n assert(willItFly((new ArrayList(Arrays.asList((long)1l, (long)2l))), (5l)) == (false));\n assert(willItFly((new ArrayList(Arrays.asList((long)3l))), (5l)) == (true));\n assert(willItFly((new ArrayList(Arrays.asList((long)3l, (long)2l, (long)3l))), (1l)) == (false));\n assert(willItFly((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))), (6l)) == (false));\n assert(willItFly((new ArrayList(Arrays.asList((long)5l))), (5l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given an array of non-negative integers, return a copy of the given array after sorting,\n // you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n // or sort it in descending order if the sum( first index value, last index value) is even.\n // Note:\n // * don't change the given array.\n // Examples:\n // >>> sortArray((new ArrayList(Arrays.asList())))\n // (new ArrayList(Arrays.asList()))\n // >>> sortArray((new ArrayList(Arrays.asList((long)5l))))\n // (new ArrayList(Arrays.asList((long)5l)))\n // >>> sortArray((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)3l, (long)0l, (long)1l, (long)5l))))\n // (new ArrayList(Arrays.asList((long)0l, (long)1l, (long)2l, (long)3l, (long)4l, (long)5l)))\n // >>> sortArray((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)3l, (long)0l, (long)1l, (long)5l, (long)6l))))\n // (new ArrayList(Arrays.asList((long)6l, (long)5l, (long)4l, (long)3l, (long)2l, (long)1l, (long)0l)))\n public static ArrayList sortArray(ArrayList array) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sortArray((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(sortArray((new ArrayList(Arrays.asList((long)5l)))).equals((new ArrayList(Arrays.asList((long)5l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)3l, (long)0l, (long)1l, (long)5l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)1l, (long)2l, (long)3l, (long)4l, (long)5l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)2l, (long)4l, (long)3l, (long)0l, (long)1l, (long)5l, (long)6l)))).equals((new ArrayList(Arrays.asList((long)6l, (long)5l, (long)4l, (long)3l, (long)2l, (long)1l, (long)0l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)2l, (long)1l)))).equals((new ArrayList(Arrays.asList((long)1l, (long)2l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)15l, (long)42l, (long)87l, (long)32l, (long)11l, (long)0l)))).equals((new ArrayList(Arrays.asList((long)0l, (long)11l, (long)15l, (long)32l, (long)42l, (long)87l)))));\n assert(sortArray((new ArrayList(Arrays.asList((long)21l, (long)14l, (long)23l, (long)11l)))).equals((new ArrayList(Arrays.asList((long)23l, (long)21l, (long)14l, (long)11l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Implement a function that takes an non-negative integer and returns an array of the first n\n // integers that are prime numbers and less than n.\n // for example:\n // >>> countUpTo((5l))\n // (new ArrayList(Arrays.asList((long)2l, (long)3l)))\n // >>> countUpTo((11l))\n // (new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l, (long)7l)))\n // >>> countUpTo((0l))\n // (new ArrayList(Arrays.asList()))\n // >>> countUpTo((20l))\n // (new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l, (long)7l, (long)11l, (long)13l, (long)17l, (long)19l)))\n // >>> countUpTo((1l))\n // (new ArrayList(Arrays.asList()))\n // >>> countUpTo((18l))\n // (new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l, (long)7l, (long)11l, (long)13l, (long)17l)))\n public static ArrayList countUpTo(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(countUpTo((5l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l)))));\n assert(countUpTo((6l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l)))));\n assert(countUpTo((7l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l)))));\n assert(countUpTo((10l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l, (long)7l)))));\n assert(countUpTo((0l)).equals((new ArrayList(Arrays.asList()))));\n assert(countUpTo((22l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l, (long)7l, (long)11l, (long)13l, (long)17l, (long)19l)))));\n assert(countUpTo((1l)).equals((new ArrayList(Arrays.asList()))));\n assert(countUpTo((18l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l, (long)7l, (long)11l, (long)13l, (long)17l)))));\n assert(countUpTo((47l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l, (long)7l, (long)11l, (long)13l, (long)17l, (long)19l, (long)23l, (long)29l, (long)31l, (long)37l, (long)41l, (long)43l)))));\n assert(countUpTo((101l)).equals((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)5l, (long)7l, (long)11l, (long)13l, (long)17l, (long)19l, (long)23l, (long)29l, (long)31l, (long)37l, (long)41l, (long)43l, (long)47l, (long)53l, (long)59l, (long)61l, (long)67l, (long)71l, (long)73l, (long)79l, (long)83l, (long)89l, (long)97l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Out of list of strings, return the longest one. Return the first one in case of multiple\n // strings of the same length. Return None in case the input list is empty.\n // >>> longest((new ArrayList(Arrays.asList())))\n // Optional.empty()\n // >>> longest((new ArrayList(Arrays.asList((String)\"a\", (String)\"b\", (String)\"c\"))))\n // \"a\"\n // >>> longest((new ArrayList(Arrays.asList((String)\"a\", (String)\"bb\", (String)\"ccc\"))))\n // \"ccc\"\n public static Optional longest(ArrayList strings) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(longest((new ArrayList(Arrays.asList()))).equals(Optional.empty()));\n assert(longest((new ArrayList(Arrays.asList((String)\"x\", (String)\"y\", (String)\"z\")))).equals(\"x\"));\n assert(longest((new ArrayList(Arrays.asList((String)\"x\", (String)\"yyy\", (String)\"zzzz\", (String)\"www\", (String)\"kkkk\", (String)\"abc\")))).equals(\"zzzz\"));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n // reverse the resulting array, and then replace each digit by its corresponding name from\n // \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n // For example:\n // >>> byLength((new ArrayList(Arrays.asList((long)2l, (long)1l, (long)1l, (long)4l, (long)5l, (long)8l, (long)2l, (long)3l))))\n // (new ArrayList(Arrays.asList((String)\"Eight\", (String)\"Five\", (String)\"Four\", (String)\"Three\", (String)\"Two\", (String)\"Two\", (String)\"One\", (String)\"One\")))\n // If the array is empty, return an empty array:\n // >>> byLength((new ArrayList(Arrays.asList())))\n // (new ArrayList(Arrays.asList()))\n // If the array has any strange number ignore it:\n // >>> byLength((new ArrayList(Arrays.asList((long)1l, (long)-1l, (long)55l))))\n // (new ArrayList(Arrays.asList((String)\"One\")))\n public static ArrayList byLength(ArrayList arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(byLength((new ArrayList(Arrays.asList((long)2l, (long)1l, (long)1l, (long)4l, (long)5l, (long)8l, (long)2l, (long)3l)))).equals((new ArrayList(Arrays.asList((String)\"Eight\", (String)\"Five\", (String)\"Four\", (String)\"Three\", (String)\"Two\", (String)\"Two\", (String)\"One\", (String)\"One\")))));\n assert(byLength((new ArrayList(Arrays.asList()))).equals((new ArrayList(Arrays.asList()))));\n assert(byLength((new ArrayList(Arrays.asList((long)1l, (long)-1l, (long)55l)))).equals((new ArrayList(Arrays.asList((String)\"One\")))));\n assert(byLength((new ArrayList(Arrays.asList((long)1l, (long)-1l, (long)3l, (long)2l)))).equals((new ArrayList(Arrays.asList((String)\"Three\", (String)\"Two\", (String)\"One\")))));\n assert(byLength((new ArrayList(Arrays.asList((long)9l, (long)4l, (long)8l)))).equals((new ArrayList(Arrays.asList((String)\"Nine\", (String)\"Eight\", (String)\"Four\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_106_f", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Implement the function f that takes n as a parameter,\n // 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\n // or the sum of numbers from 1 to i otherwise.\n // i starts from 1.\n // the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n // Example:\n // >>> f((5l))\n // (new ArrayList(Arrays.asList((long)1l, (long)2l, (long)6l, (long)24l, (long)15l)))\n public static ArrayList f(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(f((5l)).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)6l, (long)24l, (long)15l)))));\n assert(f((7l)).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)6l, (long)24l, (long)15l, (long)720l, (long)28l)))));\n assert(f((1l)).equals((new ArrayList(Arrays.asList((long)1l)))));\n assert(f((3l)).equals((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)6l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n // >>> fizzBuzz((50l))\n // (0l)\n // >>> fizzBuzz((78l))\n // (2l)\n // >>> fizzBuzz((79l))\n // (3l)\n public static long fizzBuzz(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(fizzBuzz((50l)) == (0l));\n assert(fizzBuzz((78l)) == (2l));\n assert(fizzBuzz((79l)) == (3l));\n assert(fizzBuzz((100l)) == (3l));\n assert(fizzBuzz((200l)) == (6l));\n assert(fizzBuzz((4000l)) == (192l));\n assert(fizzBuzz((10000l)) == (639l));\n assert(fizzBuzz((100000l)) == (8026l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a positive floating point number, it can be decomposed into\n // and integer part (largest integer smaller than given number) and decimals\n // (leftover part always smaller than 1).\n // Return the decimal part of the number.\n // >>> truncateNumber((3.5f))\n // (0.5f)\n public static float truncateNumber(float number) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(truncateNumber((3.5f)) == (0.5f));\n assert(truncateNumber((1.25f)) == (0.25f));\n assert(truncateNumber((123.0f)) == (0.0f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n // Empty sum should be equal to 0 and empty product should be equal to 1.\n // >>> sumProduct((new ArrayList(Arrays.asList())))\n // (Pair.with(0l, 1l))\n // >>> sumProduct((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l))))\n // (Pair.with(10l, 24l))\n public static Pair sumProduct(ArrayList numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sumProduct((new ArrayList(Arrays.asList()))).equals((Pair.with(0l, 1l))));\n assert(sumProduct((new ArrayList(Arrays.asList((long)1l, (long)1l, (long)1l)))).equals((Pair.with(3l, 1l))));\n assert(sumProduct((new ArrayList(Arrays.asList((long)100l, (long)0l)))).equals((Pair.with(100l, 0l))));\n assert(sumProduct((new ArrayList(Arrays.asList((long)3l, (long)5l, (long)7l)))).equals((Pair.with(15l, 105l))));\n assert(sumProduct((new ArrayList(Arrays.asList((long)10l)))).equals((Pair.with(10l, 10l))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a 2 dimensional data, as a nested lists,\n // which is similar to matrix, however, unlike matrices,\n // each row may contain a different number of columns.\n // Given lst, and integer x, find integers x in the list,\n // and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n // each tuple is a coordinate - (row, columns), starting with 0.\n // Sort coordinates initially by rows in ascending order.\n // Also, sort coordinates of the row by columns in descending order.\n // Examples:\n // >>> getRow((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)1l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)1l))))), (1l))\n // (new ArrayList>(Arrays.asList((Pair)Pair.with(0l, 0l), (Pair)Pair.with(1l, 4l), (Pair)Pair.with(1l, 0l), (Pair)Pair.with(2l, 5l), (Pair)Pair.with(2l, 0l))))\n // >>> getRow((new ArrayList>(Arrays.asList())), (1l))\n // (new ArrayList>(Arrays.asList()))\n // >>> getRow((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList()), (ArrayList)new ArrayList(Arrays.asList((long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))))), (3l))\n // (new ArrayList>(Arrays.asList((Pair)Pair.with(2l, 2l))))\n public static ArrayList> getRow(ArrayList> lst, long x) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(getRow((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)1l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)1l))))), (1l)).equals((new ArrayList>(Arrays.asList((Pair)Pair.with(0l, 0l), (Pair)Pair.with(1l, 4l), (Pair)Pair.with(1l, 0l), (Pair)Pair.with(2l, 5l), (Pair)Pair.with(2l, 0l))))));\n assert(getRow((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l))))), (2l)).equals((new ArrayList>(Arrays.asList((Pair)Pair.with(0l, 1l), (Pair)Pair.with(1l, 1l), (Pair)Pair.with(2l, 1l), (Pair)Pair.with(3l, 1l), (Pair)Pair.with(4l, 1l), (Pair)Pair.with(5l, 1l))))));\n assert(getRow((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)1l, (long)3l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)1l, (long)4l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)1l, (long)5l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)1l, (long)6l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)5l, (long)1l))))), (1l)).equals((new ArrayList>(Arrays.asList((Pair)Pair.with(0l, 0l), (Pair)Pair.with(1l, 0l), (Pair)Pair.with(2l, 1l), (Pair)Pair.with(2l, 0l), (Pair)Pair.with(3l, 2l), (Pair)Pair.with(3l, 0l), (Pair)Pair.with(4l, 3l), (Pair)Pair.with(4l, 0l), (Pair)Pair.with(5l, 4l), (Pair)Pair.with(5l, 0l), (Pair)Pair.with(6l, 5l), (Pair)Pair.with(6l, 0l))))));\n assert(getRow((new ArrayList>(Arrays.asList())), (1l)).equals((new ArrayList>(Arrays.asList()))));\n assert(getRow((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList((long)1l))))), (2l)).equals((new ArrayList>(Arrays.asList()))));\n assert(getRow((new ArrayList>(Arrays.asList((ArrayList)new ArrayList(Arrays.asList()), (ArrayList)new ArrayList(Arrays.asList((long)1l)), (ArrayList)new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))))), (3l)).equals((new ArrayList>(Arrays.asList((Pair)Pair.with(2l, 2l))))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You're a hungry rabbit, and you already have eaten a certain number of carrots,\n // but now you need to eat more carrots to complete the day's meals.\n // you should return an array of [ total number of eaten carrots after your meals,\n // the number of carrots left after your meals ]\n // if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n // Example:\n // >>> eat((5l), (6l), (10l))\n // (new ArrayList(Arrays.asList((long)11l, (long)4l)))\n // >>> eat((4l), (8l), (9l))\n // (new ArrayList(Arrays.asList((long)12l, (long)1l)))\n // >>> eat((1l), (10l), (10l))\n // (new ArrayList(Arrays.asList((long)11l, (long)0l)))\n // >>> eat((2l), (11l), (5l))\n // (new ArrayList(Arrays.asList((long)7l, (long)0l)))\n // Variables:\n // @number : integer\n // the number of carrots that you have eaten.\n // @need : integer\n // the number of carrots that you need to eat.\n // @remaining : integer\n // the number of remaining carrots thet exist in stock\n // Constrain:\n // * 0 <= number <= 1000\n // * 0 <= need <= 1000\n // * 0 <= remaining <= 1000\n // Have fun :)\n public static ArrayList eat(long number, long need, long remaining) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(eat((5l), (6l), (10l)).equals((new ArrayList(Arrays.asList((long)11l, (long)4l)))));\n assert(eat((4l), (8l), (9l)).equals((new ArrayList(Arrays.asList((long)12l, (long)1l)))));\n assert(eat((1l), (10l), (10l)).equals((new ArrayList(Arrays.asList((long)11l, (long)0l)))));\n assert(eat((2l), (11l), (5l)).equals((new ArrayList(Arrays.asList((long)7l, (long)0l)))));\n assert(eat((4l), (5l), (7l)).equals((new ArrayList(Arrays.asList((long)9l, (long)2l)))));\n assert(eat((4l), (5l), (1l)).equals((new ArrayList(Arrays.asList((long)5l, (long)0l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a positive integer N, return the total sum of its digits in binary.\n // Example\n // >>> solve((1000l))\n // (\"1\")\n // >>> solve((150l))\n // (\"110\")\n // >>> solve((147l))\n // (\"1100\")\n // Variables:\n // @N integer\n // Constraints: 0 \u2264 N \u2264 10000.\n // Output:\n // a string of binary number\n public static String solve(long N) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(solve((1000l)).equals((\"1\")));\n assert(solve((150l)).equals((\"110\")));\n assert(solve((147l)).equals((\"1100\")));\n assert(solve((333l)).equals((\"1001\")));\n assert(solve((963l)).equals((\"10010\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given a list of integers.\n // You need to find the largest prime value and return the sum of its digits.\n // Examples:\n // >>> skjkasdkd((new ArrayList(Arrays.asList((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, (long)3l))))\n // (10l)\n // >>> skjkasdkd((new ArrayList(Arrays.asList((long)1l, (long)0l, (long)1l, (long)8l, (long)2l, (long)4597l, (long)2l, (long)1l, (long)3l, (long)40l, (long)1l, (long)2l, (long)1l, (long)2l, (long)4l, (long)2l, (long)5l, (long)1l))))\n // (25l)\n // >>> skjkasdkd((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)1l, (long)32l, (long)5107l, (long)34l, (long)83278l, (long)109l, (long)163l, (long)23l, (long)2323l, (long)32l, (long)30l, (long)1l, (long)9l, (long)3l))))\n // (13l)\n // >>> skjkasdkd((new ArrayList(Arrays.asList((long)0l, (long)724l, (long)32l, (long)71l, (long)99l, (long)32l, (long)6l, (long)0l, (long)5l, (long)91l, (long)83l, (long)0l, (long)5l, (long)6l))))\n // (11l)\n // >>> skjkasdkd((new ArrayList(Arrays.asList((long)0l, (long)81l, (long)12l, (long)3l, (long)1l, (long)21l))))\n // (3l)\n // >>> skjkasdkd((new ArrayList(Arrays.asList((long)0l, (long)8l, (long)1l, (long)2l, (long)1l, (long)7l))))\n // (7l)\n public static long skjkasdkd(ArrayList lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(skjkasdkd((new ArrayList(Arrays.asList((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, (long)3l)))) == (10l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)1l, (long)0l, (long)1l, (long)8l, (long)2l, (long)4597l, (long)2l, (long)1l, (long)3l, (long)40l, (long)1l, (long)2l, (long)1l, (long)2l, (long)4l, (long)2l, (long)5l, (long)1l)))) == (25l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)1l, (long)3l, (long)1l, (long)32l, (long)5107l, (long)34l, (long)83278l, (long)109l, (long)163l, (long)23l, (long)2323l, (long)32l, (long)30l, (long)1l, (long)9l, (long)3l)))) == (13l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)0l, (long)724l, (long)32l, (long)71l, (long)99l, (long)32l, (long)6l, (long)0l, (long)5l, (long)91l, (long)83l, (long)0l, (long)5l, (long)6l)))) == (11l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)0l, (long)81l, (long)12l, (long)3l, (long)1l, (long)21l)))) == (3l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)0l, (long)8l, (long)1l, (long)2l, (long)1l, (long)7l)))) == (7l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)8191l)))) == (19l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)8191l, (long)123456l, (long)127l, (long)7l)))) == (19l));\n assert(skjkasdkd((new ArrayList(Arrays.asList((long)127l, (long)97l, (long)8192l)))) == (10l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given an array arr of integers, find the minimum number of elements that\n // need to be changed to make the array palindromic. A palindromic array is an array that\n // is read the same backwards and forwards. In one change, you can change one element to any other element.\n // For example:\n // >>> smallestChange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)5l, (long)4l, (long)7l, (long)9l, (long)6l))))\n // (4l)\n // >>> smallestChange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)3l, (long)2l, (long)2l))))\n // (1l)\n // >>> smallestChange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)2l, (long)1l))))\n // (0l)\n public static long smallestChange(ArrayList arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(smallestChange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)5l, (long)4l, (long)7l, (long)9l, (long)6l)))) == (4l));\n assert(smallestChange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)4l, (long)3l, (long)2l, (long)2l)))) == (1l));\n assert(smallestChange((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)2l)))) == (1l));\n assert(smallestChange((new ArrayList(Arrays.asList((long)1l, (long)4l, (long)4l, (long)2l)))) == (1l));\n assert(smallestChange((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l, (long)2l, (long)1l)))) == (0l));\n assert(smallestChange((new ArrayList(Arrays.asList((long)3l, (long)1l, (long)1l, (long)3l)))) == (0l));\n assert(smallestChange((new ArrayList(Arrays.asList((long)1l)))) == (0l));\n assert(smallestChange((new ArrayList(Arrays.asList((long)0l, (long)1l)))) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // It is the last week of the semester and the teacher has to give the grades\n // to students. The teacher has been making her own algorithm for grading.\n // The only problem is, she has lost the code she used for grading.\n // She has given you a list of GPAs for some students and you have to write \n // a function that can output a list of letter grades using the following table:\n // GPA | Letter grade\n // 4.0 A+\n // > 3.7 A \n // > 3.3 A- \n // > 3.0 B+\n // > 2.7 B \n // > 2.3 B-\n // > 2.0 C+\n // > 1.7 C\n // > 1.3 C-\n // > 1.0 D+ \n // > 0.7 D \n // > 0.0 D-\n // 0.0 E\n // Example:\n // >>> gradeEquation((new ArrayList(Arrays.asList((float)4.0f, (float)3l, (float)1.7f, (float)2l, (float)3.5f))))\n // (new ArrayList(Arrays.asList((String)\"A+\", (String)\"B\", (String)\"C-\", (String)\"C\", (String)\"A-\")))\n public static ArrayList numericalLetterGrade(ArrayList grades) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(numericalLetterGrade((new ArrayList(Arrays.asList((float)4.0f, (float)3l, (float)1.7f, (float)2l, (float)3.5f)))).equals((new ArrayList(Arrays.asList((String)\"A+\", (String)\"B\", (String)\"C-\", (String)\"C\", (String)\"A-\")))));\n assert(numericalLetterGrade((new ArrayList(Arrays.asList((float)1.2f)))).equals((new ArrayList(Arrays.asList((String)\"D+\")))));\n assert(numericalLetterGrade((new ArrayList(Arrays.asList((float)0.5f)))).equals((new ArrayList(Arrays.asList((String)\"D-\")))));\n assert(numericalLetterGrade((new ArrayList(Arrays.asList((float)0.0f)))).equals((new ArrayList(Arrays.asList((String)\"E\")))));\n assert(numericalLetterGrade((new ArrayList(Arrays.asList((float)1.0f, (float)0.3f, (float)1.5f, (float)2.8f, (float)3.3f)))).equals((new ArrayList(Arrays.asList((String)\"D\", (String)\"D-\", (String)\"C-\", (String)\"B\", (String)\"B+\")))));\n assert(numericalLetterGrade((new ArrayList(Arrays.asList((float)0.0f, (float)0.7f)))).equals((new ArrayList(Arrays.asList((String)\"E\", (String)\"D-\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given the lengths of the three sides of a triangle. Return the area of\n // the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n // Otherwise return -1\n // Three sides make a valid triangle when the sum of any two sides is greater \n // than the third side.\n // Example:\n // >>> triangleArea((3l), (4l), (5l))\n // (6.0f)\n // >>> triangleArea((1l), (2l), (10l))\n // (float)-1l\n public static float triangleArea(long a, long b, long c) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(triangleArea((3l), (4l), (5l)) == (6.0f));\n assert(triangleArea((1l), (2l), (10l)) == (float)-1l);\n assert(triangleArea((4l), (8l), (5l)) == (8.18f));\n assert(triangleArea((2l), (2l), (2l)) == (1.73f));\n assert(triangleArea((1l), (2l), (3l)) == (float)-1l);\n assert(triangleArea((10l), (5l), (7l)) == (16.25f));\n assert(triangleArea((2l), (6l), (3l)) == (float)-1l);\n assert(triangleArea((1l), (1l), (1l)) == (0.43f));\n assert(triangleArea((2l), (2l), (10l)) == (float)-1l);\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Check if two words have the same characters.\n // >>> sameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddeddabc\"))\n // (true)\n // >>> sameChars((\"abcd\"), (\"dddddddabc\"))\n // (true)\n // >>> sameChars((\"dddddddabc\"), (\"abcd\"))\n // (true)\n // >>> sameChars((\"eabcd\"), (\"dddddddabc\"))\n // (false)\n // >>> sameChars((\"abcd\"), (\"dddddddabce\"))\n // (false)\n // >>> sameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddddabc\"))\n // (false)\n public static boolean sameChars(String s0, String s1) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(sameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddeddabc\")) == (true));\n assert(sameChars((\"abcd\"), (\"dddddddabc\")) == (true));\n assert(sameChars((\"dddddddabc\"), (\"abcd\")) == (true));\n assert(sameChars((\"eabcd\"), (\"dddddddabc\")) == (false));\n assert(sameChars((\"abcd\"), (\"dddddddabcf\")) == (false));\n assert(sameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddddabc\")) == (false));\n assert(sameChars((\"aabb\"), (\"aaccc\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given an array of integers nums, find the minimum sum of any non-empty sub-array\n // of nums.\n // Example\n // >>> minSubArraySum((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)4l, (long)1l, (long)2l, (long)4l))))\n // (1l)\n // >>> minSubArraySum((new ArrayList(Arrays.asList((long)-1l, (long)-2l, (long)-3l))))\n // (-6l)\n public static long minSubArraySum(ArrayList nums) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)2l, (long)3l, (long)4l, (long)1l, (long)2l, (long)4l)))) == (1l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)-1l, (long)-2l, (long)-3l)))) == (-6l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)-1l, (long)-2l, (long)-3l, (long)2l, (long)-10l)))) == (-14l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)-9999999999999999l)))) == (-9999999999999999l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)0l, (long)10l, (long)20l, (long)1000000l)))) == (0l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)-1l, (long)-2l, (long)-3l, (long)10l, (long)-5l)))) == (-6l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)100l, (long)-1l, (long)-2l, (long)-3l, (long)10l, (long)-5l)))) == (-6l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)10l, (long)11l, (long)13l, (long)8l, (long)3l, (long)4l)))) == (3l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)100l, (long)-33l, (long)32l, (long)-1l, (long)0l, (long)-2l)))) == (-33l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)-10l)))) == (-10l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)7l)))) == (7l));\n assert(minSubArraySum((new ArrayList(Arrays.asList((long)1l, (long)-1l)))) == (-1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a string s and a natural number n, you have been tasked to implement \n // a function that returns a list of all words from string s that contain exactly \n // n consonants, in order these words appear in the string s.\n // If the string s is empty then the function should return an empty list.\n // Note: you may assume the input string contains only letters and spaces.\n // Examples:\n // >>> selectWords((\"Mary had a little lamb\"), (4l))\n // (new ArrayList(Arrays.asList((String)\"little\")))\n // >>> selectWords((\"Mary had a little lamb\"), (3l))\n // (new ArrayList(Arrays.asList((String)\"Mary\", (String)\"lamb\")))\n // >>> selectWords((\"simple white space\"), (2l))\n // (new ArrayList(Arrays.asList()))\n // >>> selectWords((\"Hello world\"), (4l))\n // (new ArrayList(Arrays.asList((String)\"world\")))\n // >>> selectWords((\"Uncle sam\"), (3l))\n // (new ArrayList(Arrays.asList((String)\"Uncle\")))\n public static ArrayList selectWords(String s, long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(selectWords((\"Mary had a little lamb\"), (4l)).equals((new ArrayList(Arrays.asList((String)\"little\")))));\n assert(selectWords((\"Mary had a little lamb\"), (3l)).equals((new ArrayList(Arrays.asList((String)\"Mary\", (String)\"lamb\")))));\n assert(selectWords((\"simple white space\"), (2l)).equals((new ArrayList(Arrays.asList()))));\n assert(selectWords((\"Hello world\"), (4l)).equals((new ArrayList(Arrays.asList((String)\"world\")))));\n assert(selectWords((\"Uncle sam\"), (3l)).equals((new ArrayList(Arrays.asList((String)\"Uncle\")))));\n assert(selectWords((\"\"), (4l)).equals((new ArrayList(Arrays.asList()))));\n assert(selectWords((\"a b c d e f\"), (1l)).equals((new ArrayList(Arrays.asList((String)\"b\", (String)\"c\", (String)\"d\", (String)\"f\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return list of all prefixes from shortest to longest of the input string\n // >>> allPrefixes((\"abc\"))\n // (new ArrayList(Arrays.asList((String)\"a\", (String)\"ab\", (String)\"abc\")))\n public static ArrayList allPrefixes(String string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(allPrefixes((\"\")).equals((new ArrayList(Arrays.asList()))));\n assert(allPrefixes((\"asdfgh\")).equals((new ArrayList(Arrays.asList((String)\"a\", (String)\"as\", (String)\"asd\", (String)\"asdf\", (String)\"asdfg\", (String)\"asdfgh\")))));\n assert(allPrefixes((\"WWW\")).equals((new ArrayList(Arrays.asList((String)\"W\", (String)\"WW\", (String)\"WWW\")))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function that takes a value (string) representing a number\n // and returns the closest integer to it. If the number is equidistant\n // from two integers, round it away from zero.\n // Examples\n // >>> closestInteger((\"10\"))\n // (10l)\n // >>> closestInteger((\"15.3\"))\n // (15l)\n // Note:\n // Rounding away from zero means that if the given number is equidistant\n // from two integers, the one you should return is the one that is the\n // farthest from zero. For example closest_integer(\"14.5\") should\n // return 15 and closest_integer(\"-14.5\") should return -15.\n public static long closestInteger(String value) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(closestInteger((\"10\")) == (10l));\n assert(closestInteger((\"14.5\")) == (15l));\n assert(closestInteger((\"-15.5\")) == (-16l));\n assert(closestInteger((\"15.3\")) == (15l));\n assert(closestInteger((\"0\")) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Create a function which takes a string representing a file's name, and returns\n // 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n // A file's name is considered to be valid if and only if all the following conditions \n // are met:\n // - There should not be more than three digits ('0'-'9') in the file's name.\n // - The file's name contains exactly one dot '.'\n // - The substring before the dot should not be empty, and it starts with a letter from \n // the latin alphapet ('a'-'z' and 'A'-'Z').\n // - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n // Examples:\n // >>> fileNameCheck((\"example.txt\"))\n // (\"Yes\")\n // >>> fileNameCheck((\"1example.dll\"))\n // (\"No\")\n public static String fileNameCheck(String file_name) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(fileNameCheck((\"example.txt\")).equals((\"Yes\")));\n assert(fileNameCheck((\"1example.dll\")).equals((\"No\")));\n assert(fileNameCheck((\"s1sdf3.asd\")).equals((\"No\")));\n assert(fileNameCheck((\"K.dll\")).equals((\"Yes\")));\n assert(fileNameCheck((\"MY16FILE3.exe\")).equals((\"Yes\")));\n assert(fileNameCheck((\"His12FILE94.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"_Y.txt\")).equals((\"No\")));\n assert(fileNameCheck((\"?aREYA.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"/this_is_valid.dll\")).equals((\"No\")));\n assert(fileNameCheck((\"this_is_valid.wow\")).equals((\"No\")));\n assert(fileNameCheck((\"this_is_valid.txt\")).equals((\"Yes\")));\n assert(fileNameCheck((\"this_is_valid.txtexe\")).equals((\"No\")));\n assert(fileNameCheck((\"#this2_i4s_5valid.ten\")).equals((\"No\")));\n assert(fileNameCheck((\"@this1_is6_valid.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"this_is_12valid.6exe4.txt\")).equals((\"No\")));\n assert(fileNameCheck((\"all.exe.txt\")).equals((\"No\")));\n assert(fileNameCheck((\"I563_No.exe\")).equals((\"Yes\")));\n assert(fileNameCheck((\"Is3youfault.txt\")).equals((\"Yes\")));\n assert(fileNameCheck((\"no_one#knows.dll\")).equals((\"Yes\")));\n assert(fileNameCheck((\"1I563_Yes3.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"I563_Yes3.txtt\")).equals((\"No\")));\n assert(fileNameCheck((\"final..txt\")).equals((\"No\")));\n assert(fileNameCheck((\"final132\")).equals((\"No\")));\n assert(fileNameCheck((\"_f4indsartal132.\")).equals((\"No\")));\n assert(fileNameCheck((\".txt\")).equals((\"No\")));\n assert(fileNameCheck((\"s.\")).equals((\"No\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You are given two intervals,\n // where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n // The given intervals are closed which means that the interval (start, end)\n // includes both start and end.\n // For each given interval, it is assumed that its start is less or equal its end.\n // Your task is to determine whether the length of intersection of these two \n // intervals is a prime number.\n // Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n // which its length is 1, which not a prime number.\n // If the length of the intersection is a prime number, return \"YES\",\n // otherwise, return \"NO\".\n // If the two intervals don't intersect, return \"NO\".\n // [input/output] samples:\n // >>> intersection((Pair.with(1l, 2l)), (Pair.with(2l, 3l)))\n // (\"NO\")\n // >>> intersection((Pair.with(-1l, 1l)), (Pair.with(0l, 4l)))\n // (\"NO\")\n // >>> intersection((Pair.with(-3l, -1l)), (Pair.with(-5l, 5l)))\n // (\"YES\")\n public static String intersection(Pair interval1, Pair interval2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(intersection((Pair.with(1l, 2l)), (Pair.with(2l, 3l))).equals((\"NO\")));\n assert(intersection((Pair.with(-1l, 1l)), (Pair.with(0l, 4l))).equals((\"NO\")));\n assert(intersection((Pair.with(-3l, -1l)), (Pair.with(-5l, 5l))).equals((\"YES\")));\n assert(intersection((Pair.with(-2l, 2l)), (Pair.with(-4l, 0l))).equals((\"YES\")));\n assert(intersection((Pair.with(-11l, 2l)), (Pair.with(-1l, -1l))).equals((\"NO\")));\n assert(intersection((Pair.with(1l, 2l)), (Pair.with(3l, 5l))).equals((\"NO\")));\n assert(intersection((Pair.with(1l, 2l)), (Pair.with(1l, 2l))).equals((\"NO\")));\n assert(intersection((Pair.with(-2l, -2l)), (Pair.with(-3l, -2l))).equals((\"NO\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Return the largest prime factor of n. Assume n > 1 and is not a prime.\n // >>> largestPrimeFactor((13195l))\n // (29l)\n // >>> largestPrimeFactor((2048l))\n // (2l)\n public static long largestPrimeFactor(long n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(largestPrimeFactor((15l)) == (5l));\n assert(largestPrimeFactor((27l)) == (3l));\n assert(largestPrimeFactor((63l)) == (7l));\n assert(largestPrimeFactor((330l)) == (11l));\n assert(largestPrimeFactor((13195l)) == (29l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a string, find out how many distinct characters (regardless of case) does it consist of\n // >>> countDistinctCharacters((\"xyzXYZ\"))\n // (3l)\n // >>> countDistinctCharacters((\"Jerry\"))\n // (4l)\n public static long countDistinctCharacters(String string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(countDistinctCharacters((\"\")) == (0l));\n assert(countDistinctCharacters((\"abcde\")) == (5l));\n assert(countDistinctCharacters((\"abcdecadeCADE\")) == (5l));\n assert(countDistinctCharacters((\"aaaaAAAAaaaa\")) == (1l));\n assert(countDistinctCharacters((\"Jerry jERRY JeRRRY\")) == (5l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // You're given a list of deposit and withdrawal operations on a bank account that starts with\n // zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n // at that point function should return True. Otherwise it should return False.\n // >>> belowZero((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)3l))))\n // (false)\n // >>> belowZero((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)-4l, (long)5l))))\n // (true)\n public static boolean belowZero(ArrayList operations) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(belowZero((new ArrayList(Arrays.asList()))) == (false));\n assert(belowZero((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)-3l, (long)1l, (long)2l, (long)-3l)))) == (false));\n assert(belowZero((new ArrayList(Arrays.asList((long)1l, (long)2l, (long)-4l, (long)5l, (long)6l)))) == (true));\n assert(belowZero((new ArrayList(Arrays.asList((long)1l, (long)-1l, (long)2l, (long)-2l, (long)5l, (long)-5l, (long)4l, (long)-4l)))) == (false));\n assert(belowZero((new ArrayList(Arrays.asList((long)1l, (long)-1l, (long)2l, (long)-2l, (long)5l, (long)-5l, (long)4l, (long)-5l)))) == (true));\n assert(belowZero((new ArrayList(Arrays.asList((long)1l, (long)-2l, (long)2l, (long)-2l, (long)5l, (long)-5l, (long)4l, (long)-4l)))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Find the shortest palindrome that begins with a supplied string.\n // Algorithm idea is simple:\n // - Find the longest postfix of supplied string that is a palindrome.\n // - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n // >>> makePalindrome((\"\"))\n // (\"\")\n // >>> makePalindrome((\"cat\"))\n // (\"catac\")\n // >>> makePalindrome((\"cata\"))\n // (\"catac\")\n public static String makePalindrome(String string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(makePalindrome((\"\")).equals((\"\")));\n assert(makePalindrome((\"x\")).equals((\"x\")));\n assert(makePalindrome((\"xyz\")).equals((\"xyzyx\")));\n assert(makePalindrome((\"xyx\")).equals((\"xyx\")));\n assert(makePalindrome((\"jerry\")).equals((\"jerryrrej\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "java", - "prompt": "import java.util.*;\nimport java.lang.reflect.*;\nimport org.javatuples.*;\nimport java.security.*;\nimport java.math.*;\nimport java.io.*;\nimport java.util.stream.*;\nclass Problem {\n // Given a positive integer, obtain its roman numeral equivalent as a string,\n // and return it in lowercase.\n // Restrictions: 1 <= num <= 1000\n // Examples:\n // >>> intToMiniRoman((19l))\n // (\"xix\")\n // >>> intToMiniRoman((152l))\n // (\"clii\")\n // >>> intToMiniRoman((426l))\n // (\"cdxxvi\")\n public static String intToMiniRoman(long number) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": " }\n public static void main(String[] args) {\n assert(intToMiniRoman((19l)).equals((\"xix\")));\n assert(intToMiniRoman((152l)).equals((\"clii\")));\n assert(intToMiniRoman((251l)).equals((\"ccli\")));\n assert(intToMiniRoman((426l)).equals((\"cdxxvi\")));\n assert(intToMiniRoman((500l)).equals((\"d\")));\n assert(intToMiniRoman((1l)).equals((\"i\")));\n assert(intToMiniRoman((4l)).equals((\"iv\")));\n assert(intToMiniRoman((43l)).equals((\"xliii\")));\n assert(intToMiniRoman((90l)).equals((\"xc\")));\n assert(intToMiniRoman((94l)).equals((\"xciv\")));\n assert(intToMiniRoman((532l)).equals((\"dxxxii\")));\n assert(intToMiniRoman((900l)).equals((\"cm\")));\n assert(intToMiniRoman((994l)).equals((\"cmxciv\")));\n assert(intToMiniRoman((1000l)).equals((\"m\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - } -] \ No newline at end of file diff --git a/data/jl-keep.json b/data/jl-keep.json deleted file mode 100644 index 2d8620953b7633fcfac7c245253ac401bda9dae0..0000000000000000000000000000000000000000 --- a/data/jl-keep.json +++ /dev/null @@ -1,2228 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "jl", - "prompt": "\"\"\" For a given number n, find the largest number that divides n evenly, smaller than n\n >>> largest_divisor(15)\n 5\n \"\"\"\nfunction largest_divisor(n::Int64)::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = largest_divisor;\n\t@test(candidate(3) == 1)\n\t@test(candidate(7) == 1)\n\t@test(candidate(10) == 5)\n\t@test(candidate(100) == 50)\n\t@test(candidate(49) == 7)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_47_median", - "language": "jl", - "prompt": "\"\"\"Return median of elements in the list l.\n >>> median([3, 1, 2, 4, 5])\n 3\n >>> median([-10, 4, 6, 1000, 10, 20])\n 15.0\n \"\"\"\nfunction median(l::Vector{Int64})::Float64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = median;\n\t@test(candidate([3, 1, 2, 4, 5]) == 3)\n\t@test(candidate([-10, 4, 6, 1000, 10, 20]) == 8.0)\n\t@test(candidate([5]) == 5)\n\t@test(candidate([6, 5]) == 5.5)\n\t@test(candidate([8, 1, 3, 9, 9, 2, 7]) == 7)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "jl", - "prompt": "\"\"\"\n Given two lists operator, and operand. The first list has basic algebra operations, and \n the second list is a list of integers. Use the two given lists to build the algebric \n expression and return the evaluation of this expression.\n\n The basic algebra operations:\n Addition ( + ) \n Subtraction ( - ) \n Multiplication ( * ) \n Floor division ( // ) \n Exponentiation ( ** ) \n\n Example:\n operator['+', '*', '-']\n array = [2, 3, 4, 5]\n result = 2 + 3 * 4 - 5\n => result = 9\n\n Note:\n The length of operator list is equal to the length of operand list minus one.\n Operand is a list of of non-negative integers.\n Operator list has at least one operator, and operand list has at least two operands.\n\n \"\"\"\nfunction do_algebra(operator::Vector{String}, operand::Vector{Int64})::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = do_algebra;\n\t@test(candidate([\"**\", \"*\", \"+\"], [2, 3, 4, 5]) == 37)\n\t@test(candidate([\"+\", \"*\", \"-\"], [2, 3, 4, 5]) == 9)\n\t@test(candidate([\"//\", \"*\"], [7, 3, 4]) == 8)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "jl", - "prompt": "\"\"\"Return maximum element in the list.\n >>> max_element([1, 2, 3])\n 3\n >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n 123\n \"\"\"\nfunction max_element(l::Vector{Int64})::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = max_element;\n\t@test(candidate([1, 2, 3]) == 3)\n\t@test(candidate([5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]) == 124)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "jl", - "prompt": "\"\"\"Create a function which returns the largest index of an element which\n is not greater than or equal to the element immediately preceding it. If\n no such element exists then return -1. The given array will not contain\n duplicate values.\n\n Examples:\n can_arrange([1,2,4,3,5]) = 3\n can_arrange([1,2,3]) = -1\n \"\"\"\nfunction can_arrange(arr::Vector{Int64})::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = can_arrange;\n\t@test(candidate([1, 2, 4, 3, 5]) == 3)\n\t@test(candidate([1, 2, 4, 5]) == -1)\n\t@test(candidate([1, 4, 2, 5, 6, 7, 8, 9, 10]) == 2)\n\t@test(candidate([4, 8, 5, 7, 3]) == 4)\n\t@test(candidate(Vector{Int64}([])) == -1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "jl", - "prompt": "\"\"\"\n Imagine a road that's a perfectly straight infinitely long line.\n n cars are driving left to right; simultaneously, a different set of n cars\n are driving right to left. The two sets of cars start out being very far from\n each other. All cars move in the same speed. Two cars are said to collide\n when a car that's moving left to right hits a car that's moving right to left.\n However, the cars are infinitely sturdy and strong; as a result, they continue moving\n in their trajectory as if they did not collide.\n\n This function outputs the number of such collisions.\n \"\"\"\nfunction car_race_collision(n::Int64)::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = car_race_collision;\n\t@test(candidate(2) == 4)\n\t@test(candidate(3) == 9)\n\t@test(candidate(4) == 16)\n\t@test(candidate(8) == 64)\n\t@test(candidate(10) == 100)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "jl", - "prompt": "\"\"\"\n Create a function that returns True if the last character\n of a given string is an alphabetical character and is not\n a part of a word, and False otherwise.\n Note: \"word\" is a group of characters separated by space.\n\n Examples:\n check_if_last_char_is_a_letter(\"apple pie\") \u279e False\n check_if_last_char_is_a_letter(\"apple pi e\") \u279e True\n check_if_last_char_is_a_letter(\"apple pi e \") \u279e False\n check_if_last_char_is_a_letter(\"\") \u279e False \n \"\"\"\nfunction check_if_last_char_is_a_letter(txt::String)::Bool \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = check_if_last_char_is_a_letter;\n\t@test(candidate(\"apple\") == false)\n\t@test(candidate(\"apple pi e\") == true)\n\t@test(candidate(\"eeeee\") == false)\n\t@test(candidate(\"A\") == true)\n\t@test(candidate(\"Pumpkin pie \") == false)\n\t@test(candidate(\"Pumpkin pie 1\") == false)\n\t@test(candidate(\"\") == false)\n\t@test(candidate(\"eeeee e \") == false)\n\t@test(candidate(\"apple pie\") == false)\n\t@test(candidate(\"apple pi e \") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "jl", - "prompt": "\"\"\"Return true if a given number is prime, and false otherwise.\n >>> is_prime(6)\n False\n >>> is_prime(101)\n True\n >>> is_prime(11)\n True\n >>> is_prime(13441)\n True\n >>> is_prime(61)\n True\n >>> is_prime(4)\n False\n >>> is_prime(1)\n False\n \"\"\"\nfunction is_prime(n::Int64)::Bool \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_prime;\n\t@test(candidate(6) == false)\n\t@test(candidate(101) == true)\n\t@test(candidate(11) == true)\n\t@test(candidate(13441) == true)\n\t@test(candidate(61) == true)\n\t@test(candidate(4) == false)\n\t@test(candidate(1) == false)\n\t@test(candidate(5) == true)\n\t@test(candidate(11) == true)\n\t@test(candidate(17) == true)\n\t@test(candidate(85) == false)\n\t@test(candidate(77) == false)\n\t@test(candidate(255379) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "jl", - "prompt": "\"\"\"Given a list of positive integers x. return a sorted list of all \n elements that hasn't any even digit.\n\n Note: Returned list should be sorted in increasing order.\n \n For example:\n >>> unique_digits([15, 33, 1422, 1])\n [1, 15, 33]\n >>> unique_digits([152, 323, 1422, 10])\n []\n \"\"\"\nfunction unique_digits(x::Vector{Int64})::Vector{Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = unique_digits;\n\t@test(candidate([15, 33, 1422, 1]) == [1, 15, 33])\n\t@test(candidate([152, 323, 1422, 10]) == Vector{Int64}([]))\n\t@test(candidate([12345, 2033, 111, 151]) == [111, 151])\n\t@test(candidate([135, 103, 31]) == [31, 135])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "jl", - "prompt": "\"\"\" Input are two strings a and b consisting only of 1s and 0s.\n Perform binary XOR on these inputs and return result also as a string.\n >>> string_xor('010', '110')\n '100'\n \"\"\"\nfunction string_xor(a::String, b::String)::String \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = string_xor;\n\t@test(candidate(\"111000\", \"101010\") == \"010010\")\n\t@test(candidate(\"1\", \"1\") == \"0\")\n\t@test(candidate(\"0101\", \"0000\") == \"0101\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "jl", - "prompt": "\"\"\"sum_to_n is a function that sums numbers from 1 to n.\n >>> sum_to_n(30)\n 465\n >>> sum_to_n(100)\n 5050\n >>> sum_to_n(5)\n 15\n >>> sum_to_n(10)\n 55\n >>> sum_to_n(1)\n 1\n \"\"\"\nfunction sum_to_n(n::Int64)::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = sum_to_n;\n\t@test(candidate(1) == 1)\n\t@test(candidate(6) == 21)\n\t@test(candidate(11) == 66)\n\t@test(candidate(30) == 465)\n\t@test(candidate(100) == 5050)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "jl", - "prompt": "\"\"\"\n Given a list of numbers, return the sum of squares of the numbers\n in the list that are odd. Ignore numbers that are negative or not integers.\n \n double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10\n double_the_difference([-1, -2, 0]) == 0\n double_the_difference([9, -2]) == 81\n double_the_difference([0]) == 0 \n \n If the input list is empty, return 0.\n \"\"\"\nfunction double_the_difference(lst::Vector{Float64})::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = double_the_difference;\n\t@test(candidate(Vector{Float64}([])) == 0)\n\t@test(candidate([5.0, 4.0]) == 25)\n\t@test(candidate([0.1, 0.2, 0.3]) == 0)\n\t@test(candidate([-10.0, -20.0, -30.0]) == 0)\n\t@test(candidate([-1.0, -2.0, 8.0]) == 0)\n\t@test(candidate([0.2, 3.0, 5.0]) == 34)\n\t@test(candidate([-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]) == 165)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "jl", - "prompt": "\"\"\" Return length of given string\n >>> strlen('')\n 0\n >>> strlen('abc')\n 3\n \"\"\"\nfunction strlen(string::String)::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = strlen;\n\t@test(candidate(\"\") == 0)\n\t@test(candidate(\"x\") == 1)\n\t@test(candidate(\"asdasnakj\") == 9)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "jl", - "prompt": "\"\"\"\n You'll be given a string of words, and your task is to count the number\n of boredoms. A boredom is a sentence that starts with the word \"I\".\n Sentences are delimited by '.', '?' or '!'.\n \n For example:\n >>> is_bored(\"Hello world\")\n 0\n >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n 1\n \"\"\"\nfunction is_bored(S::String)::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_bored;\n\t@test(candidate(\"Hello world\") == 0)\n\t@test(candidate(\"Is the sky blue?\") == 0)\n\t@test(candidate(\"I love It !\") == 1)\n\t@test(candidate(\"bIt\") == 0)\n\t@test(candidate(\"I feel good today. I will be productive. will kill It\") == 2)\n\t@test(candidate(\"You and I are going for a walk\") == 0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "jl", - "prompt": "\"\"\"Write a function vowels_count which takes a string representing\n a word as input and returns the number of vowels in the string.\n Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n vowel, but only when it is at the end of the given word.\n\n Example:\n >>> vowels_count(\"abcde\")\n 2\n >>> vowels_count(\"ACEDY\")\n 3\n \"\"\"\nfunction vowels_count(s::String)::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = vowels_count;\n\t@test(candidate(\"abcde\") == 2)\n\t@test(candidate(\"Alone\") == 3)\n\t@test(candidate(\"key\") == 2)\n\t@test(candidate(\"bye\") == 1)\n\t@test(candidate(\"keY\") == 2)\n\t@test(candidate(\"bYe\") == 1)\n\t@test(candidate(\"ACEDY\") == 3)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "jl", - "prompt": "\"\"\"Return n-th Fibonacci number.\n >>> fib(10)\n 55\n >>> fib(1)\n 1\n >>> fib(8)\n 21\n \"\"\"\nfunction fib(n::Int64)::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = fib;\n\t@test(candidate(10) == 55)\n\t@test(candidate(1) == 1)\n\t@test(candidate(8) == 21)\n\t@test(candidate(11) == 89)\n\t@test(candidate(12) == 144)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "jl", - "prompt": "\"\"\"Your task is to implement a function that will simplify the expression\n x * n. The function returns True if x * n evaluates to a whole number and False\n otherwise. Both x and n, are string representation of a fraction, and have the following format,\n / where both numerator and denominator are positive whole numbers.\n\n You can assume that x, and n are valid fractions, and do not have zero as denominator.\n\n simplify(\"1/5\", \"5/1\") = True\n simplify(\"1/6\", \"2/1\") = False\n simplify(\"7/10\", \"10/2\") = False\n \"\"\"\nfunction simplify(x::String, n::String)::Bool \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = simplify;\n\t@test(candidate(\"1/5\", \"5/1\") == true)\n\t@test(candidate(\"1/6\", \"2/1\") == false)\n\t@test(candidate(\"5/1\", \"3/1\") == true)\n\t@test(candidate(\"7/10\", \"10/2\") == false)\n\t@test(candidate(\"2/10\", \"50/10\") == true)\n\t@test(candidate(\"7/2\", \"4/2\") == true)\n\t@test(candidate(\"11/6\", \"6/1\") == true)\n\t@test(candidate(\"2/3\", \"5/2\") == false)\n\t@test(candidate(\"5/2\", \"3/5\") == false)\n\t@test(candidate(\"2/4\", \"8/4\") == true)\n\t@test(candidate(\"2/4\", \"4/2\") == true)\n\t@test(candidate(\"1/5\", \"5/1\") == true)\n\t@test(candidate(\"1/5\", \"1/5\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "jl", - "prompt": "\"\"\"\n Given a string s, count the number of uppercase vowels in even indices.\n \n For example:\n count_upper('aBCdEf') returns 1\n count_upper('abcdefg') returns 0\n count_upper('dBBE') returns 0\n \"\"\"\nfunction count_upper(s::String)::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = count_upper;\n\t@test(candidate(\"aBCdEf\") == 1)\n\t@test(candidate(\"abcdefg\") == 0)\n\t@test(candidate(\"dBBE\") == 0)\n\t@test(candidate(\"B\") == 0)\n\t@test(candidate(\"U\") == 1)\n\t@test(candidate(\"\") == 0)\n\t@test(candidate(\"EEEE\") == 2)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "jl", - "prompt": "\"\"\"\n You are given a rectangular grid of wells. Each row represents a single well,\n and each 1 in a row represents a single unit of water.\n Each well has a corresponding bucket that can be used to extract water from it, \n and all buckets have the same capacity.\n Your task is to use the buckets to empty the wells.\n Output the number of times you need to lower the buckets.\n\n Example 1:\n Input: \n grid : [[0,0,1,0], [0,1,0,0], [1,1,1,1]]\n bucket_capacity : 1\n Output: 6\n\n Example 2:\n Input: \n grid : [[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]]\n bucket_capacity : 2\n Output: 5\n \n Example 3:\n Input: \n grid : [[0,0,0], [0,0,0]]\n bucket_capacity : 5\n Output: 0\n\n Constraints:\n * all wells have the same length\n * 1 <= grid.length <= 10^2\n * 1 <= grid[:,1].length <= 10^2\n * grid[i][j] -> 0 | 1\n * 1 <= capacity <= 10\n \"\"\"\nfunction max_fill(grid::Vector{Vector{Int64}}, capacity::Int64)::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = max_fill;\n\t@test(candidate([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1) == 6)\n\t@test(candidate([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2) == 5)\n\t@test(candidate([[0, 0, 0], [0, 0, 0]], 5) == 0)\n\t@test(candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 2) == 4)\n\t@test(candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 9) == 2)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "jl", - "prompt": "\"\"\"\n Given an array arr of integers and a positive integer k, return a sorted list \n of length k with the maximum k numbers in arr.\n\n Example 1:\n\n Input: arr = [-3, -4, 5], k = 3\n Output: [-4, -3, 5]\n\n Example 2:\n\n Input: arr = [4, -4, 4], k = 2\n Output: [4, 4]\n\n Example 3:\n\n Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1\n Output: [2]\n\n Note:\n 1. The length of the array will be in the range of [1, 1000].\n 2. The elements in the array will be in the range of [-1000, 1000].\n 3. 0 <= k <= len(arr)\n \"\"\"\nfunction maximum(arr::Vector{Int64}, k::Int64)::Vector{Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = maximum;\n\t@test(candidate([-3, -4, 5], 3) == [-4, -3, 5])\n\t@test(candidate([4, -4, 4], 2) == [4, 4])\n\t@test(candidate([-3, 2, 1, 2, -1, -2, 1], 1) == [2])\n\t@test(candidate([123, -123, 20, 0, 1, 2, -3], 3) == [2, 20, 123])\n\t@test(candidate([-123, 20, 0, 1, 2, -3], 4) == [0, 1, 2, 20])\n\t@test(candidate([5, 15, 0, 3, -13, -8, 0], 7) == [-13, -8, 0, 0, 3, 5, 15])\n\t@test(candidate([-1, 0, 2, 5, 3, -10], 2) == [3, 5])\n\t@test(candidate([1, 0, 5, -7], 1) == [5])\n\t@test(candidate([4, -4], 2) == [-4, 4])\n\t@test(candidate([-10, 10], 2) == [-10, 10])\n\t@test(candidate([1, 2, 3, -23, 243, -400, 0], 0) == Vector{Int64}([]))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "jl", - "prompt": "\"\"\"\n Write a function that takes a message, and encodes in such a \n way that it swaps case of all letters, replaces all vowels in \n the message with the letter that appears 2 places ahead of that \n vowel in the english alphabet. \n Assume only letters. \n \n Examples:\n >>> encode('test')\n 'TGST'\n >>> encode('This is a message')\n 'tHKS KS C MGSSCGG'\n \"\"\"\nfunction encode(message::String)::String \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = encode;\n\t@test(candidate(\"TEST\") == \"tgst\")\n\t@test(candidate(\"Mudasir\") == \"mWDCSKR\")\n\t@test(candidate(\"YES\") == \"ygs\")\n\t@test(candidate(\"This is a message\") == \"tHKS KS C MGSSCGG\")\n\t@test(candidate(\"I DoNt KnOw WhAt tO WrItE\") == \"k dQnT kNqW wHcT Tq wRkTg\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "jl", - "prompt": "\"\"\"\n remove_vowels is a function that takes string and returns string without vowels.\n >>> remove_vowels('')\n ''\n >>> remove_vowels('abcdef')\n 'bcdf'\n >>> remove_vowels('aaaaa')\n ''\n >>> remove_vowels('aaBAA')\n 'B'\n >>> remove_vowels('zbcd')\n 'zbcd'\n \"\"\"\nfunction remove_vowels(text::String)::String \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = remove_vowels;\n\t@test(candidate(\"\") == \"\")\n\t@test(candidate(\"abcdef\nghijklm\") == \"bcdf\nghjklm\")\n\t@test(candidate(\"fedcba\") == \"fdcb\")\n\t@test(candidate(\"eeeee\") == \"\")\n\t@test(candidate(\"acBAA\") == \"cB\")\n\t@test(candidate(\"EcBOO\") == \"cB\")\n\t@test(candidate(\"ybcd\") == \"ybcd\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "jl", - "prompt": "\"\"\"Return only positive numbers in the list.\n >>> get_positive([-1, 2, -4, 5, 6])\n [2, 5, 6]\n >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n [5, 3, 2, 3, 9, 123, 1]\n \"\"\"\nfunction get_positive(l::Vector{Int64})::Vector{Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = get_positive;\n\t@test(candidate([-1, -2, 4, 5, 6]) == [4, 5, 6])\n\t@test(candidate([5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]) == [5, 3, 2, 3, 3, 9, 123, 1])\n\t@test(candidate([-1, -2]) == Vector{Int64}([]))\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "jl", - "prompt": "\"\"\" Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n >>> string_sequence(0)\n '0'\n >>> string_sequence(5)\n '0 1 2 3 4 5'\n \"\"\"\nfunction string_sequence(n::Int64)::String \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = string_sequence;\n\t@test(candidate(0) == \"0\")\n\t@test(candidate(3) == \"0 1 2 3\")\n\t@test(candidate(10) == \"0 1 2 3 4 5 6 7 8 9 10\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "jl", - "prompt": "\"\"\"\n Given a positive integer n, you have to make a pile of n levels of stones.\n The first level has n stones.\n The number of stones in the next level is:\n - the next odd number if n is odd.\n - the next even number if n is even.\n Return the number of stones in each level in a list, where element at index\n i represents the number of stones in the level (i+1).\n\n Examples:\n >>> make_a_pile(3)\n [3, 5, 7]\n \"\"\"\nfunction make_a_pile(n::Int64)::Vector{Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = make_a_pile;\n\t@test(candidate(3) == [3, 5, 7])\n\t@test(candidate(4) == [4, 6, 8, 10])\n\t@test(candidate(5) == [5, 7, 9, 11, 13])\n\t@test(candidate(6) == [6, 8, 10, 12, 14, 16])\n\t@test(candidate(8) == [8, 10, 12, 14, 16, 18, 20, 22])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "jl", - "prompt": "\"\"\"Task\n 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\n then check if the result string is palindrome.\n A string is called palindrome if it reads the same backward as forward.\n You should return a tuple containing the result string and True/False for the check.\n Example\n For s = \"abcde\", c = \"ae\", the result should be ('bcd',False)\n For s = \"abcdef\", c = \"b\" the result should be ('acdef',False)\n For s = \"abcdedcba\", c = \"ab\", the result should be ('cdedc',True)\n \"\"\"\nfunction reverse_delete(s::String, c::String)::Tuple{String, Bool} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = reverse_delete;\n\t@test(candidate(\"abcde\", \"ae\") == (\"bcd\", false))\n\t@test(candidate(\"abcdef\", \"b\") == (\"acdef\", false))\n\t@test(candidate(\"abcdedcba\", \"ab\") == (\"cdedc\", true))\n\t@test(candidate(\"dwik\", \"w\") == (\"dik\", false))\n\t@test(candidate(\"a\", \"a\") == (\"\", true))\n\t@test(candidate(\"abcdedcba\", \"\") == (\"abcdedcba\", true))\n\t@test(candidate(\"abcdedcba\", \"v\") == (\"abcdedcba\", true))\n\t@test(candidate(\"vabba\", \"v\") == (\"abba\", true))\n\t@test(candidate(\"mamma\", \"mia\") == (\"\", true))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "jl", - "prompt": "\"\"\" For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n >>> flip_case('Hello')\n 'hELLO'\n \"\"\"\nfunction flip_case(string::String)::String \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = flip_case;\n\t@test(candidate(\"\") == \"\")\n\t@test(candidate(\"Hello!\") == \"hELLO!\")\n\t@test(candidate(\"These violent delights have violent ends\") == \"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "jl", - "prompt": "\"\"\"You are given a string s.\n if s[i] is a letter, reverse its case from lower to upper or vise versa, \n otherwise keep it as it is.\n If the string contains no letters, reverse the string.\n The function should return the resulted string.\n Examples\n solve(\"1234\") = \"4321\"\n solve(\"ab\") = \"AB\"\n solve(\"#a@C\") = \"#A@c\"\n \"\"\"\nfunction solve(s::String)::String \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = solve;\n\t@test(candidate(\"AsDf\") == \"aSdF\")\n\t@test(candidate(\"1234\") == \"4321\")\n\t@test(candidate(\"ab\") == \"AB\")\n\t@test(candidate(\"#a@C\") == \"#A@c\")\n\t@test(candidate(\"#AsdfW^45\") == \"#aSDFw^45\")\n\t@test(candidate(\"#6@2\") == \"2@6#\")\n\t@test(candidate(\"#$a^D\") == \"#$A^d\")\n\t@test(candidate(\"#ccc\") == \"#CCC\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "jl", - "prompt": "\"\"\" Filter an input list of strings only for ones that start with a given prefix.\n >>> filter_by_prefix([], 'a')\n []\n >>> filter_by_prefix(['abc', 'bcd', 'cde', 'array'], 'a')\n ['abc', 'array']\n \"\"\"\nfunction filter_by_prefix(strings::Vector{String}, prefix::String)::Vector{String} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = filter_by_prefix;\n\t@test(candidate(Vector{String}([]), \"john\") == Vector{String}([]))\n\t@test(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\") == [\"xxx\", \"xxxAAA\", \"xxx\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "jl", - "prompt": "\"\"\"This function takes two positive numbers x and y and returns the\n biggest even integer number that is in the range [x, y] inclusive. If \n there's no such number, then the function should return -1.\n\n For example:\n choose_num(12, 15) = 14\n choose_num(13, 12) = -1\n \"\"\"\nfunction choose_num(x::Int64, y::Int64)::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = choose_num;\n\t@test(candidate(12, 15) == 14)\n\t@test(candidate(13, 12) == -1)\n\t@test(candidate(33, 12354) == 12354)\n\t@test(candidate(5234, 5233) == -1)\n\t@test(candidate(6, 29) == 28)\n\t@test(candidate(27, 10) == -1)\n\t@test(candidate(7, 7) == -1)\n\t@test(candidate(546, 546) == 546)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "jl", - "prompt": "\"\"\"\n You are given a string representing a sentence,\n the sentence contains some words separated by a space,\n and you have to return a string that contains the words from the original sentence,\n whose lengths are prime numbers,\n the order of the words in the new string should be the same as the original one.\n\n Example 1:\n Input: sentence = \"This is a test\"\n Output: \"is\"\n\n Example 2:\n Input: sentence = \"lets go for swimming\"\n Output: \"go for\"\n\n Constraints:\n * 1 <= len(sentence) <= 100\n * sentence contains only letters\n \"\"\"\nfunction words_in_sentence(sentence::String)::String \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = words_in_sentence;\n\t@test(candidate(\"This is a test\") == \"is\")\n\t@test(candidate(\"lets go for swimming\") == \"go for\")\n\t@test(candidate(\"there is no place available here\") == \"there is no place\")\n\t@test(candidate(\"Hi I am Hussein\") == \"Hi am Hussein\")\n\t@test(candidate(\"go for it\") == \"go for it\")\n\t@test(candidate(\"here\") == \"\")\n\t@test(candidate(\"here is\") == \"is\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "jl", - "prompt": "\"\"\" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n >>> intersperse([], 4)\n []\n >>> intersperse([1, 2, 3], 4)\n [1, 4, 2, 4, 3]\n \"\"\"\nfunction intersperse(numbers::Vector{Int64}, delimeter::Int64)::Vector{Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = intersperse;\n\t@test(candidate(Vector{Int64}([]), 7) == Vector{Int64}([]))\n\t@test(candidate([5, 6, 3, 2], 8) == [5, 8, 6, 8, 3, 8, 2])\n\t@test(candidate([2, 2, 2], 2) == [2, 2, 2, 2, 2])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "jl", - "prompt": "\"\"\"Your task is to write a function that returns true if a number x is a simple\n power of n and false in other cases.\n x is a simple power of n if n**int=x\n For example:\n is_simple_power(1, 4) => true\n is_simple_power(2, 2) => true\n is_simple_power(8, 2) => true\n is_simple_power(3, 2) => false\n is_simple_power(3, 1) => false\n is_simple_power(5, 3) => false\n \"\"\"\nfunction is_simple_power(x::Int64, n::Int64)::Bool \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_simple_power;\n\t@test(candidate(16, 2) == true)\n\t@test(candidate(143214, 16) == false)\n\t@test(candidate(4, 2) == true)\n\t@test(candidate(9, 3) == true)\n\t@test(candidate(16, 4) == true)\n\t@test(candidate(24, 2) == false)\n\t@test(candidate(128, 4) == false)\n\t@test(candidate(12, 6) == false)\n\t@test(candidate(1, 1) == true)\n\t@test(candidate(1, 12) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "jl", - "prompt": "\"\"\"Write a function that returns true if the given number is the multiplication of 3 prime numbers\n and false otherwise.\n Knowing that (a) is less then 100. \n Example:\n is_multiply_prime(30) == True\n 30 = 2 * 3 * 5\n \"\"\"\nfunction is_multiply_prime(a::Int64)::Bool \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_multiply_prime;\n\t@test(candidate(5) == false)\n\t@test(candidate(30) == true)\n\t@test(candidate(8) == true)\n\t@test(candidate(10) == false)\n\t@test(candidate(125) == true)\n\t@test(candidate(105) == true)\n\t@test(candidate(126) == false)\n\t@test(candidate(729) == false)\n\t@test(candidate(891) == false)\n\t@test(candidate(1001) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "jl", - "prompt": "\"\"\"\n Given the lengths of the three sides of a triangle. Return True if the three\n sides form a right-angled triangle, False otherwise.\n A right-angled triangle is a triangle in which one angle is right angle or \n 90 degree.\n Example:\n right_angle_triangle(3, 4, 5) == True\n right_angle_triangle(1, 2, 3) == False\n \"\"\"\nfunction right_angle_triangle(a::Int64, b::Int64, c::Int64)::Bool \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = right_angle_triangle;\n\t@test(candidate(3, 4, 5) == true)\n\t@test(candidate(1, 2, 3) == false)\n\t@test(candidate(10, 6, 8) == true)\n\t@test(candidate(2, 2, 2) == false)\n\t@test(candidate(7, 24, 25) == true)\n\t@test(candidate(10, 5, 7) == false)\n\t@test(candidate(5, 12, 13) == true)\n\t@test(candidate(15, 8, 17) == true)\n\t@test(candidate(48, 55, 73) == true)\n\t@test(candidate(1, 1, 1) == false)\n\t@test(candidate(2, 2, 10) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "jl", - "prompt": "\"\"\"\n Create a function that takes 3 numbers.\n Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n Returns false in any other cases.\n \n Examples\n any_int(5, 2, 7) \u279e True\n \n any_int(3, 2, 2) \u279e False\n\n any_int(3, -2, 1) \u279e True\n \n any_int(3.6, -2.2, 2) \u279e False\n \n\n \n \"\"\"\nfunction any_int(x::Float64, y::Float64, z::Float64)::Bool \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = any_int;\n\t@test(candidate(2, 3, 1) == true)\n\t@test(candidate(2.5, 2, 3) == false)\n\t@test(candidate(1.5, 5, 3.5) == false)\n\t@test(candidate(2, 6, 2) == false)\n\t@test(candidate(4, 2, 2) == true)\n\t@test(candidate(2.2, 2.2, 2.2) == false)\n\t@test(candidate(-4, 6, 2) == true)\n\t@test(candidate(2, 1, 1) == true)\n\t@test(candidate(3, 4, 7) == true)\n\t@test(candidate(3.0, 4, 7) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "jl", - "prompt": "\"\"\"This function takes a list l and returns a list l' such that\n l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n to the values of the corresponding indicies of l, but sorted.\n >>> sort_third([1, 2, 3])\n [1, 2, 3]\n >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n [2, 6, 3, 4, 8, 9, 5]\n \"\"\"\nfunction sort_third(l::Vector{Int64})::Vector{Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = sort_third;\n\t@test(candidate([5, 6, 3, 4, 8, 9, 2]) == [2, 6, 3, 4, 8, 9, 5])\n\t@test(candidate([5, 8, 3, 4, 6, 9, 2]) == [2, 8, 3, 4, 6, 9, 5])\n\t@test(candidate([5, 6, 9, 4, 8, 3, 2]) == [2, 6, 9, 4, 8, 3, 5])\n\t@test(candidate([5, 6, 3, 4, 8, 9, 2, 1]) == [2, 6, 3, 4, 8, 9, 5, 1])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_53_add", - "language": "jl", - "prompt": "\"\"\"Add two numbers x and y\n >>> add(2, 3)\n 5\n >>> add(5, 7)\n 12\n \"\"\"\nfunction add(x::Int64, y::Int64)::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = add;\n\t@test(candidate(0, 1) == 1)\n\t@test(candidate(1, 0) == 1)\n\t@test(candidate(2, 3) == 5)\n\t@test(candidate(5, 7) == 12)\n\t@test(candidate(7, 5) == 12)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_69_search", - "language": "jl", - "prompt": "\"\"\"\n You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n zero, and has a frequency greater than or equal to the value of the integer itself. \n The frequency of an integer is the number of times it appears in the list.\n If no such a value exist, return -1.\n Examples:\n search([4, 1, 2, 2, 3, 1]) == 2\n search([1, 2, 2, 3, 3, 3, 4, 4, 4]) == 3\n search([5, 5, 4, 4, 4]) == -1\n \"\"\"\nfunction search(lst::Vector{Int64})::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = search;\n\t@test(candidate([5, 5, 5, 5, 1]) == 1)\n\t@test(candidate([4, 1, 4, 1, 4, 4]) == 4)\n\t@test(candidate([3, 3]) == -1)\n\t@test(candidate([8, 8, 8, 8, 8, 8, 8, 8]) == 8)\n\t@test(candidate([2, 3, 3, 2, 2]) == 2)\n\t@test(candidate([2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]) == 1)\n\t@test(candidate([3, 2, 8, 2]) == 2)\n\t@test(candidate([6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]) == 1)\n\t@test(candidate([8, 8, 3, 6, 5, 6, 4]) == -1)\n\t@test(candidate([6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]) == 1)\n\t@test(candidate([1, 9, 10, 1, 3]) == 1)\n\t@test(candidate([6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]) == 5)\n\t@test(candidate([1]) == 1)\n\t@test(candidate([8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]) == 4)\n\t@test(candidate([2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]) == 2)\n\t@test(candidate([1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]) == 1)\n\t@test(candidate([9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]) == 4)\n\t@test(candidate([2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]) == 4)\n\t@test(candidate([9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]) == 2)\n\t@test(candidate([5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]) == -1)\n\t@test(candidate([10]) == -1)\n\t@test(candidate([9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]) == 2)\n\t@test(candidate([5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]) == 1)\n\t@test(candidate([7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]) == 1)\n\t@test(candidate([3, 10, 10, 9, 2]) == -1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "jl", - "prompt": "\"\"\"Write a function that takes a string and returns True if the string\n length is a prime number or False otherwise\n Examples\n prime_length('Hello') == True\n prime_length('abcdcba') == True\n prime_length('kittens') == True\n prime_length('orange') == False\n \"\"\"\nfunction prime_length(string::String)::Bool \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = prime_length;\n\t@test(candidate(\"Hello\") == true)\n\t@test(candidate(\"abcdcba\") == true)\n\t@test(candidate(\"kittens\") == true)\n\t@test(candidate(\"orange\") == false)\n\t@test(candidate(\"wow\") == true)\n\t@test(candidate(\"world\") == true)\n\t@test(candidate(\"MadaM\") == true)\n\t@test(candidate(\"Wow\") == true)\n\t@test(candidate(\"\") == false)\n\t@test(candidate(\"HI\") == true)\n\t@test(candidate(\"go\") == true)\n\t@test(candidate(\"gogo\") == false)\n\t@test(candidate(\"aaaaaaaaaaaaaaa\") == false)\n\t@test(candidate(\"Madam\") == true)\n\t@test(candidate(\"M\") == false)\n\t@test(candidate(\"0\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_58_common", - "language": "jl", - "prompt": "\"\"\"Return sorted unique common elements for two lists.\n >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n [1, 5, 653]\n >>> common([5, 3, 2, 8], [3, 2])\n [2, 3]\n\n \"\"\"\nfunction common(l1::Vector{Int64}, l2::Vector{Int64})::Vector{Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = common;\n\t@test(candidate([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]) == [1, 5, 653])\n\t@test(candidate([5, 3, 2, 8], [3, 2]) == [2, 3])\n\t@test(candidate([4, 3, 2, 8], [3, 2, 4]) == [2, 3, 4])\n\t@test(candidate([4, 3, 2, 8], Vector{Int64}([])) == Vector{Int64}([]))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "jl", - "prompt": "\"\"\"The Brazilian factorial is defined as:\n brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n where n > 0\n\n For example:\n >>> special_factorial(4)\n 288\n\n The function will receive an integer as input and should return the special\n factorial of this integer.\n \"\"\"\nfunction special_factorial(n::Int64)::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = special_factorial;\n\t@test(candidate(4) == 288)\n\t@test(candidate(5) == 34560)\n\t@test(candidate(7) == 125411328000)\n\t@test(candidate(1) == 1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "jl", - "prompt": "\"\"\"In this problem, you will implement a function that takes two lists of numbers,\n and determines whether it is possible to perform an exchange of elements\n between them to make lst1 a list of only even numbers.\n There is no limit on the number of exchanged elements between lst1 and lst2.\n If it is possible to exchange elements between the lst1 and lst2 to make\n all the elements of lst1 to be even, return \"YES\".\n Otherwise, return \"NO\".\n For example:\n exchange([1, 2, 3, 4], [1, 2, 3, 4]) => \"YES\"\n exchange([1, 2, 3, 4], [1, 5, 3, 4]) => \"NO\"\n It is assumed that the input lists will be non-empty.\n \"\"\"\nfunction exchange(lst1::Vector{Int64}, lst2::Vector{Int64})::String \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = exchange;\n\t@test(candidate([1, 2, 3, 4], [1, 2, 3, 4]) == \"YES\")\n\t@test(candidate([1, 2, 3, 4], [1, 5, 3, 4]) == \"NO\")\n\t@test(candidate([1, 2, 3, 4], [2, 1, 4, 3]) == \"YES\")\n\t@test(candidate([5, 7, 3], [2, 6, 4]) == \"YES\")\n\t@test(candidate([5, 7, 3], [2, 6, 3]) == \"NO\")\n\t@test(candidate([3, 2, 6, 1, 8, 9], [3, 5, 5, 1, 1, 1]) == \"NO\")\n\t@test(candidate([100, 200], [200, 200]) == \"YES\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "jl", - "prompt": "\"\"\"\n Given a non-empty array of integers arr and an integer k, return\n the sum of the elements with at most two digits from the first k elements of arr.\n\n Example:\n\n Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4\n Output: 24 # sum of 21 + 3\n\n Constraints:\n 1. 1 <= len(arr) <= 100\n 2. 1 <= k <= len(arr)\n \"\"\"\nfunction add_elements(arr::Vector{Int64}, k::Int64)::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = add_elements;\n\t@test(candidate([1, -2, -3, 41, 57, 76, 87, 88, 99], 3) == -4)\n\t@test(candidate([111, 121, 3, 4000, 5, 6], 2) == 0)\n\t@test(candidate([11, 21, 3, 90, 5, 6, 7, 8, 9], 4) == 125)\n\t@test(candidate([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4) == 24)\n\t@test(candidate([1], 1) == 1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "jl", - "prompt": "\"\"\"A simple program which should return the value of x if n is \n a prime number and should return the value of y otherwise.\n\n Examples:\n for x_or_y(7, 34, 12) == 34\n for x_or_y(15, 8, 5) == 5\n \n \"\"\"\nfunction x_or_y(n::Int64, x::Int64, y::Int64)::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = x_or_y;\n\t@test(candidate(7, 34, 12) == 34)\n\t@test(candidate(15, 8, 5) == 5)\n\t@test(candidate(3, 33, 5212) == 33)\n\t@test(candidate(1259, 3, 52) == 3)\n\t@test(candidate(7919, -1, 12) == -1)\n\t@test(candidate(3609, 1245, 583) == 583)\n\t@test(candidate(91, 56, 129) == 129)\n\t@test(candidate(6, 34, 1234) == 1234)\n\t@test(candidate(1, 2, 0) == 0)\n\t@test(candidate(2, 2, 0) == 2)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "jl", - "prompt": "\"\"\"Given length of a side and high return area for a triangle.\n >>> triangle_area(5, 3)\n 7.5\n \"\"\"\nfunction triangle_area(a::Int64, h::Int64)::Float64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = triangle_area;\n\t@test(candidate(5, 3) == 7.5)\n\t@test(candidate(2, 2) == 2.0)\n\t@test(candidate(10, 8) == 40.0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "jl", - "prompt": "\"\"\"Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n the last couple centuries. However, what people don't know is Tribonacci sequence.\n Tribonacci sequence is defined by the recurrence:\n tri(1) = 3\n tri(n) = 1 + n / 2, if n is even.\n tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n For example:\n tri(2) = 1 + (2 / 2) = 2\n tri(4) = 3\n tri(3) = tri(2) + tri(1) + tri(4)\n = 2 + 3 + 3 = 8 \n You are given a non-negative integer number n, you have to a return a list of the \n first n + 1 numbers of the Tribonacci sequence.\n Examples:\n tri(3) = [1, 3, 2, 8]\n \"\"\"\nfunction tri(n::Int64)::Vector{Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = tri;\n\t@test(candidate(3) == [1, 3, 2, 8])\n\t@test(candidate(4) == [1, 3, 2, 8, 3])\n\t@test(candidate(5) == [1, 3, 2, 8, 3, 15])\n\t@test(candidate(6) == [1, 3, 2, 8, 3, 15, 4])\n\t@test(candidate(7) == [1, 3, 2, 8, 3, 15, 4, 24])\n\t@test(candidate(8) == [1, 3, 2, 8, 3, 15, 4, 24, 5])\n\t@test(candidate(9) == [1, 3, 2, 8, 3, 15, 4, 24, 5, 35])\n\t@test(candidate(20) == [1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11])\n\t@test(candidate(0) == [1])\n\t@test(candidate(1) == [1, 3])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "jl", - "prompt": "\"\"\"\n You are given a list of two strings, both strings consist of open\n parentheses '(' or close parentheses ')' only.\n Your job is to check if it is possible to concatenate the two strings in\n some order, that the resulting string will be good.\n A string S is considered to be good if and only if all parentheses in S\n are balanced. For example: the string '(())()' is good, while the string\n '())' is not.\n Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n\n Examples:\n match_parens(['()(', ')']) == 'Yes'\n match_parens([')', ')']) == 'No'\n \"\"\"\nfunction match_parens(lst::Vector{String})::String \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = match_parens;\n\t@test(candidate([\"()(\", \")\"]) == \"Yes\")\n\t@test(candidate([\")\", \")\"]) == \"No\")\n\t@test(candidate([\"(()(())\", \"())())\"]) == \"No\")\n\t@test(candidate([\")())\", \"(()()(\"]) == \"Yes\")\n\t@test(candidate([\"(())))\", \"(()())((\"]) == \"Yes\")\n\t@test(candidate([\"()\", \"())\"]) == \"No\")\n\t@test(candidate([\"(()(\", \"()))()\"]) == \"Yes\")\n\t@test(candidate([\"((((\", \"((())\"]) == \"No\")\n\t@test(candidate([\")(()\", \"(()(\"]) == \"No\")\n\t@test(candidate([\")(\", \")(\"]) == \"No\")\n\t@test(candidate([\"(\", \")\"]) == \"Yes\")\n\t@test(candidate([\")\", \"(\"]) == \"Yes\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "jl", - "prompt": "\"\"\" From a list of integers, remove all elements that occur more than once.\n Keep order of elements left the same as in the input.\n >>> remove_duplicates([1, 2, 3, 2, 4])\n [1, 3, 4]\n \"\"\"\nfunction remove_duplicates(numbers::Vector{Int64})::Vector{Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = remove_duplicates;\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([1, 2, 3, 4]) == [1, 2, 3, 4])\n\t@test(candidate([1, 2, 3, 2, 4, 3, 5]) == [1, 4, 5])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "jl", - "prompt": "\"\"\" Return a greatest common divisor of two integers a and b\n >>> greatest_common_divisor(3, 5)\n 1\n >>> greatest_common_divisor(25, 15)\n 5\n \"\"\"\nfunction greatest_common_divisor(a::Int64, b::Int64)::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = greatest_common_divisor;\n\t@test(candidate(3, 7) == 1)\n\t@test(candidate(10, 15) == 5)\n\t@test(candidate(49, 14) == 7)\n\t@test(candidate(144, 60) == 12)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "jl", - "prompt": "\"\"\"\n Checks if given string is a palindrome\n >>> is_palindrome('')\n True\n >>> is_palindrome('aba')\n True\n >>> is_palindrome('aaaaa')\n True\n >>> is_palindrome('zbcd')\n False\n \"\"\"\nfunction is_palindrome(text::String)::Bool \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_palindrome;\n\t@test(candidate(\"\") == true)\n\t@test(candidate(\"aba\") == true)\n\t@test(candidate(\"aaaaa\") == true)\n\t@test(candidate(\"zbcd\") == false)\n\t@test(candidate(\"xywyx\") == true)\n\t@test(candidate(\"xywyz\") == false)\n\t@test(candidate(\"xywzx\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "jl", - "prompt": "\"\"\" xs represent coefficients of a polynomial.\n xs[0] + xs[1] * x + xs[2] * x^2 + ....\n Return derivative of this polynomial in the same form.\n >>> derivative([3, 1, 2, 4, 5])\n [1, 4, 12, 20]\n >>> derivative([1, 2, 3])\n [2, 6]\n \"\"\"\nfunction derivative(xs::Vector{Int64})::Vector{Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = derivative;\n\t@test(candidate([3, 1, 2, 4, 5]) == [1, 4, 12, 20])\n\t@test(candidate([1, 2, 3]) == [2, 6])\n\t@test(candidate([3, 2, 1]) == [2, 2])\n\t@test(candidate([3, 2, 1, 0, 4]) == [2, 2, 0, 16])\n\t@test(candidate([1]) == Vector{Int64}([]))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "jl", - "prompt": "\"\"\"\n In this task, you will be given a string that represents a number of apples and oranges \n that are distributed in a basket of fruit this basket contains \n apples, oranges, and mango fruits. Given the string that represents the total number of \n the oranges and apples and an integer that represent the total number of the fruits \n in the basket return the number of the mango fruits in the basket.\n for examble:\n fruit_distribution(\"5 apples and 6 oranges\", 19) ->19 - 5 - 6 = 8\n fruit_distribution(\"0 apples and 1 oranges\",3) -> 3 - 0 - 1 = 2\n fruit_distribution(\"2 apples and 3 oranges\", 100) -> 100 - 2 - 3 = 95\n fruit_distribution(\"100 apples and 1 oranges\",120) -> 120 - 100 - 1 = 19\n \"\"\"\nfunction fruit_distribution(s::String, n::Int64)::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = fruit_distribution;\n\t@test(candidate(\"5 apples and 6 oranges\", 19) == 8)\n\t@test(candidate(\"5 apples and 6 oranges\", 21) == 10)\n\t@test(candidate(\"0 apples and 1 oranges\", 3) == 2)\n\t@test(candidate(\"1 apples and 0 oranges\", 3) == 2)\n\t@test(candidate(\"2 apples and 3 oranges\", 100) == 95)\n\t@test(candidate(\"2 apples and 3 oranges\", 5) == 0)\n\t@test(candidate(\"1 apples and 100 oranges\", 120) == 19)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "jl", - "prompt": "\"\"\"\n Write a function that takes an integer a and returns True \n if this ingeger is a cube of some integer number.\n Note: you may assume the input is always valid.\n Examples:\n iscube(1) ==> True\n iscube(2) ==> False\n iscube(-1) ==> True\n iscube(64) ==> True\n iscube(0) ==> True\n iscube(180) ==> False\n \"\"\"\nfunction iscube(a::Int64)::Bool \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = iscube;\n\t@test(candidate(1) == true)\n\t@test(candidate(2) == false)\n\t@test(candidate(-1) == true)\n\t@test(candidate(64) == true)\n\t@test(candidate(180) == false)\n\t@test(candidate(1000) == true)\n\t@test(candidate(0) == true)\n\t@test(candidate(1729) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "jl", - "prompt": "\"\"\"\n In this Kata, you have to sort an array of non-negative integers according to\n number of ones in their binary representation in ascending order.\n For similar number of ones, sort based on decimal value.\n\n It must be implemented like this:\n >>> sort_array([1, 5, 2, 3, 4]) == [1, 2, 3, 4, 5]\n >>> sort_array([-2, -3, -4, -5, -6]) == [-6, -5, -4, -3, -2]\n >>> sort_array([1, 0, 2, 3, 4]) [0, 1, 2, 3, 4]\n \"\"\"\nfunction sort_array(arr::Vector{Int64})::Vector{Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = sort_array;\n\t@test(candidate([1, 5, 2, 3, 4]) == [1, 2, 4, 3, 5])\n\t@test(candidate([-2, -3, -4, -5, -6]) == [-4, -2, -6, -5, -3])\n\t@test(candidate([1, 0, 2, 3, 4]) == [0, 1, 2, 4, 3])\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]) == [2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77])\n\t@test(candidate([3, 6, 44, 12, 32, 5]) == [32, 3, 5, 6, 12, 44])\n\t@test(candidate([2, 4, 8, 16, 32]) == [2, 4, 8, 16, 32])\n\t@test(candidate([2, 4, 8, 16, 32]) == [2, 4, 8, 16, 32])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "jl", - "prompt": "\"\"\"Given a list of strings, where each string consists of only digits, return a list.\n Each element i of the output should be \"the number of odd elements in the\n string i of the input.\" where all the i's should be replaced by the number\n of odd digits in the i'th string of the input.\n\n >>> odd_count(['1234567'])\n [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n >>> odd_count(['3',\"11111111\"])\n [\"the number of odd elements 1n the str1ng 1 of the 1nput.\",\n \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\n \"\"\"\nfunction odd_count(lst::Vector{String})::Vector{String} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = odd_count;\n\t@test(candidate([\"1234567\"]) == [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"])\n\t@test(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.\"])\n\t@test(candidate([\"271\", \"137\", \"314\"]) == [\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "jl", - "prompt": "\"\"\" brackets is a string of \"(\" and \")\".\n return True if every opening bracket has a corresponding closing bracket.\n\n >>> correct_bracketing(\"(\")\n False\n >>> correct_bracketing(\"()\")\n True\n >>> correct_bracketing(\"(()())\")\n True\n >>> correct_bracketing(\")(()\")\n False\n \"\"\"\nfunction correct_bracketing(brackets::String)::Bool \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = correct_bracketing;\n\t@test(candidate(\"()\") == true)\n\t@test(candidate(\"(()())\") == true)\n\t@test(candidate(\"()()(()())()\") == true)\n\t@test(candidate(\"()()((()()())())(()()(()))\") == true)\n\t@test(candidate(\"((()())))\") == false)\n\t@test(candidate(\")(()\") == false)\n\t@test(candidate(\"(\") == false)\n\t@test(candidate(\"((((\") == false)\n\t@test(candidate(\")\") == false)\n\t@test(candidate(\"(()\") == false)\n\t@test(candidate(\"()()(()())())(()\") == false)\n\t@test(candidate(\"()()(()())()))()\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "jl", - "prompt": "\"\"\"Task\n Write a function that takes a string as input and returns the sum of the upper characters only'\n ASCII codes.\n\n Examples:\n digitSum(\"\") => 0\n digitSum(\"abAB\") => 131\n digitSum(\"abcCd\") => 67\n digitSum(\"helloE\") => 69\n digitSum(\"woArBld\") => 131\n digitSum(\"aAaaaXa\") => 153\n \"\"\"\nfunction digitSum(s::String)::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = digitSum;\n\t@test(candidate(\"\") == 0)\n\t@test(candidate(\"abAB\") == 131)\n\t@test(candidate(\"abcCd\") == 67)\n\t@test(candidate(\"helloE\") == 69)\n\t@test(candidate(\"woArBld\") == 131)\n\t@test(candidate(\"aAaaaXa\") == 153)\n\t@test(candidate(\" How are yOu?\") == 151)\n\t@test(candidate(\"You arE Very Smart\") == 327)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "jl", - "prompt": "\"\"\"Write a function that accepts a list of strings as a parameter,\n deletes the strings that have odd lengths from it,\n and returns the resulted list with a sorted order,\n The list is always a list of strings and never an array of numbers,\n and it may contain duplicates.\n The order of the list should be ascending by length of each word, and you\n should return the list sorted by that rule.\n If two words have the same length, sort the list alphabetically.\n The function should return a list of strings in sorted order.\n You may assume that all words will have the same length.\n For example:\n assert list_sort([\"aa\", \"a\", \"aaa\"]) => [\"aa\"]\n assert list_sort([\"ab\", \"a\", \"aaa\", \"cd\"]) => [\"ab\", \"cd\"]\n \"\"\"\nfunction sorted_list_sum(lst::Vector{String})::Vector{String} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = sorted_list_sum;\n\t@test(candidate([\"aa\", \"a\", \"aaa\"]) == [\"aa\"])\n\t@test(candidate([\"school\", \"AI\", \"asdf\", \"b\"]) == [\"AI\", \"asdf\", \"school\"])\n\t@test(candidate([\"d\", \"b\", \"c\", \"a\"]) == Vector{String}([]))\n\t@test(candidate([\"d\", \"dcba\", \"abcd\", \"a\"]) == [\"abcd\", \"dcba\"])\n\t@test(candidate([\"AI\", \"ai\", \"au\"]) == [\"AI\", \"ai\", \"au\"])\n\t@test(candidate([\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"]) == Vector{String}([]))\n\t@test(candidate([\"aaaa\", \"bbbb\", \"dd\", \"cc\"]) == [\"cc\", \"dd\", \"aaaa\", \"bbbb\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "jl", - "prompt": "\"\"\"\n You are given an array arr of integers and you need to return\n sum of magnitudes of integers multiplied by product of all signs\n of each number in the array, represented by 1, -1 or 0.\n Note: return None for empty arr.\n\n Example:\n >>> prod_signs([1, 2, 2, -4]) == -9\n >>> prod_signs([0, 1]) == 0\n >>> prod_signs([]) == None\n \"\"\"\nfunction prod_signs(arr::Vector{Int64})::Union{Int64, Nothing} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = prod_signs;\n\t@test(candidate([1, 2, 2, -4]) == -9)\n\t@test(candidate([0, 1]) == 0)\n\t@test(candidate([1, 1, 1, 2, 3, -1, 1]) == -10)\n\t@test(candidate(Vector{Int64}([])) == nothing)\n\t@test(candidate([2, 4, 1, 2, -1, -1, 9]) == 20)\n\t@test(candidate([-1, 1, -1, 1]) == 4)\n\t@test(candidate([-1, 1, 1, 1]) == -4)\n\t@test(candidate([-1, 1, 1, 0]) == 0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "jl", - "prompt": "\"\"\"Return list with elements incremented by 1.\n >>> incr_list([1, 2, 3])\n [2, 3, 4]\n >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123])\n [6, 4, 6, 3, 4, 4, 10, 1, 124]\n \"\"\"\nfunction incr_list(l::Vector{Int64})::Vector{Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = incr_list;\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([3, 2, 1]) == [4, 3, 2])\n\t@test(candidate([5, 2, 5, 2, 3, 3, 9, 0, 123]) == [6, 3, 6, 3, 4, 4, 10, 1, 124])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "jl", - "prompt": "\"\"\" From a given list of integers, generate a list of rolling maximum element found until given moment\n in the sequence.\n >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n [1, 2, 3, 3, 3, 4, 4]\n \"\"\"\nfunction rolling_max(numbers::Vector{Int64})::Vector{Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = rolling_max;\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([1, 2, 3, 4]) == [1, 2, 3, 4])\n\t@test(candidate([4, 3, 2, 1]) == [4, 4, 4, 4])\n\t@test(candidate([3, 2, 3, 100, 3]) == [3, 3, 3, 100, 100])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "jl", - "prompt": "\"\"\" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n separate those group into separate strings and return the list of those.\n Separate groups are balanced (each open brace is properly closed) and not nested within each other\n Ignore any spaces in the input string.\n >>> separate_paren_groups('( ) (( )) (( )( ))')\n ['()', '(())', '(()())']\n \"\"\"\nfunction separate_paren_groups(paren_string::String)::Vector{String} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = separate_paren_groups;\n\t@test(candidate(\"(()()) ((())) () ((())()())\") == [\"(()())\", \"((()))\", \"()\", \"((())()())\"])\n\t@test(candidate(\"() (()) ((())) (((())))\") == [\"()\", \"(())\", \"((()))\", \"(((())))\"])\n\t@test(candidate(\"(()(())((())))\") == [\"(()(())((())))\"])\n\t@test(candidate(\"( ) (( )) (( )( ))\") == [\"()\", \"(())\", \"(()())\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "jl", - "prompt": "\"\"\"\n You will be given a string of words separated by commas or spaces. Your task is\n to split the string into words and return an array of the words.\n \n For example:\n words_string(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n words_string(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\n \"\"\"\nfunction words_string(s::String)::Vector{String} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = words_string;\n\t@test(candidate(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"])\n\t@test(candidate(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"])\n\t@test(candidate(\"Hi, my name\") == [\"Hi\", \"my\", \"name\"])\n\t@test(candidate(\"One,, two, three, four, five, six,\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"])\n\t@test(candidate(\"\") == Vector{String}([]))\n\t@test(candidate(\"ahmed , gamal\") == [\"ahmed\", \"gamal\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "jl", - "prompt": "\"\"\" Filter given list of any python values only for integers\n >>> filter_integers(['a', 3.14, 5])\n [5]\n >>> filter_integers([1, 2, 3, 'abc', {}, []])\n [1, 2, 3]\n \"\"\"\nfunction filter_integers(values::Vector{Any})::Vector{Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = filter_integers;\n\t@test(candidate(Vector{Any}([])) == Vector{Int64}([]))\n\t@test(candidate([4, Dict(), [], 23.2, 9, \"adasd\"]) == [4, 9])\n\t@test(candidate([3, \"c\", 3, 3, \"a\", \"b\"]) == [3, 3, 3])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "jl", - "prompt": "\"\"\"This function takes a list l and returns a list l' such that\n l' is identical to l in the odd indicies, while its values at the even indicies are equal\n to the values of the even indicies of l, but sorted.\n >>> sort_even([1, 2, 3])\n [1, 2, 3]\n >>> sort_even([5, 6, 3, 4])\n [3, 6, 5, 4]\n \"\"\"\nfunction sort_even(l::Vector{Int64})::Vector{Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = sort_even;\n\t@test(candidate([1, 2, 3]) == [1, 2, 3])\n\t@test(candidate([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]) == [-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123])\n\t@test(candidate([5, 8, -12, 4, 23, 2, 3, 11, 12, -10]) == [-12, 8, 3, 4, 5, 2, 12, 11, 23, -10])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "jl", - "prompt": "\"\"\"I think we all remember that feeling when the result of some long-awaited\n event is finally known. The feelings and thoughts you have at that moment are\n definitely worth noting down and comparing.\n Your task is to determine if a person correctly guessed the results of a number of matches.\n You are given two arrays of scores and guesses of equal length, where each index shows a match. \n Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n the value is 0, and if not, the value is the absolute difference between the guess and the score.\n \n \n example:\n\n compare([1,2,3,4,5,1],[1,2,3,4,2,-2]) -> [0,0,0,0,3,3]\n compare([0,5,0,0,0,4],[4,1,1,0,0,-2]) -> [4,4,1,0,0,6]\n \"\"\"\nfunction compare(game::Vector{Int64}, guess::Vector{Int64})::Vector{Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = compare;\n\t@test(candidate([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2]) == [0, 0, 0, 0, 3, 3])\n\t@test(candidate([0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]) == [0, 0, 0, 0, 0, 0])\n\t@test(candidate([1, 2, 3], [-1, -2, -3]) == [2, 4, 6])\n\t@test(candidate([1, 2, 3, 5], [-1, 2, 3, 4]) == [2, 0, 0, 1])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "jl", - "prompt": "\"\"\"\n Given a positive integer n, return a tuple that has the number of even and odd\n integer palindromes that fall within the range(1, n), inclusive.\n\n Example 1:\n\n Input: 3\n Output: (1, 2)\n Explanation:\n Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n\n Example 2:\n\n Input: 12\n Output: (4, 6)\n Explanation:\n Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n\n Note:\n 1. 1 <= n <= 10^3\n 2. returned tuple has the number of even and odd integer palindromes respectively.\n \"\"\"\nfunction even_odd_palindrome(n::Int64)::Tuple{Int64, Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = even_odd_palindrome;\n\t@test(candidate(123) == (8, 13))\n\t@test(candidate(12) == (4, 6))\n\t@test(candidate(3) == (1, 2))\n\t@test(candidate(63) == (6, 8))\n\t@test(candidate(25) == (5, 6))\n\t@test(candidate(19) == (4, 6))\n\t@test(candidate(9) == (4, 5))\n\t@test(candidate(1) == (0, 1))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "jl", - "prompt": "\"\"\"The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fib4(0) -> 0\n fib4(1) -> 0\n fib4(2) -> 2\n fib4(3) -> 0\n fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n >>> fib4(5)\n 4\n >>> fib4(6)\n 8\n >>> fib4(7)\n 14\n \"\"\"\nfunction fib4(n::Int64)::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = fib4;\n\t@test(candidate(5) == 4)\n\t@test(candidate(8) == 28)\n\t@test(candidate(10) == 104)\n\t@test(candidate(12) == 386)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "jl", - "prompt": "\"\"\"\n Given two positive integers a and b, return the even digits between a\n and b, in ascending order.\n\n For example:\n generate_integers(2, 8) => [2, 4, 6, 8]\n generate_integers(8, 2) => [2, 4, 6, 8]\n generate_integers(10, 14) => []\n \"\"\"\nfunction generate_integers(a::Int64, b::Int64)::Vector{Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = generate_integers;\n\t@test(candidate(2, 10) == [2, 4, 6, 8])\n\t@test(candidate(10, 2) == [2, 4, 6, 8])\n\t@test(candidate(132, 2) == [2, 4, 6, 8])\n\t@test(candidate(17, 89) == Vector{Int64}([]))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "jl", - "prompt": "\"\"\" For a given list of input numbers, calculate Mean Absolute Deviation\n around the mean of this dataset.\n Mean Absolute Deviation is the average absolute difference between each\n element and a centerpoint (mean in this case):\n MAD = average | x - x_mean |\n >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n 1.0\n \"\"\"\nfunction mean_absolute_deviation(numbers::Vector{Float64})::Float64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = mean_absolute_deviation;\n\t@test(candidate([1.0, 2.0]) == 0.5)\n\t@test(candidate([1.0, 2.0, 3.0, 4.0]) == 1.0)\n\t@test(candidate([1.0, 2.0, 3.0, 4.0, 5.0]) == 1.2)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "jl", - "prompt": "\"\"\"Create a function encrypt that takes a string as an argument and\n returns a string encrypted with the alphabet being rotated. \n The alphabet should be rotated in a manner such that the letters \n shift down by two multiplied to two places.\n For example:\n encrypt('hi') returns 'lm'\n encrypt('asdfghjkl') returns 'ewhjklnop'\n encrypt('gf') returns 'kj'\n encrypt('et') returns 'ix'\n \"\"\"\nfunction encrypt(s::String)::String \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = encrypt;\n\t@test(candidate(\"hi\") == \"lm\")\n\t@test(candidate(\"asdfghjkl\") == \"ewhjklnop\")\n\t@test(candidate(\"gf\") == \"kj\")\n\t@test(candidate(\"et\") == \"ix\")\n\t@test(candidate(\"faewfawefaewg\") == \"jeiajeaijeiak\")\n\t@test(candidate(\"hellomyfriend\") == \"lippsqcjvmirh\")\n\t@test(candidate(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\") == \"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\")\n\t@test(candidate(\"a\") == \"e\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "jl", - "prompt": "\"\"\"\n Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n\n The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n as follows: start with any positive integer n. Then each term is obtained from the \n previous term as follows: if the previous term is even, the next term is one half of \n the previous term. If the previous term is odd, the next term is 3 times the previous\n term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n\n Note: \n 1. Collatz(1) is [1].\n 2. returned list sorted in increasing order.\n\n For example:\n get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n \"\"\"\nfunction get_odd_collatz(n::Int64)::Vector{Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = get_odd_collatz;\n\t@test(candidate(14) == [1, 5, 7, 11, 13, 17])\n\t@test(candidate(5) == [1, 5])\n\t@test(candidate(12) == [1, 3, 5])\n\t@test(candidate(1) == [1])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "jl", - "prompt": "\"\"\" Find how many times a given substring can be found in the original string. Count overlaping cases.\n >>> how_many_times('', 'a')\n 0\n >>> how_many_times('aaa', 'a')\n 3\n >>> how_many_times('aaaa', 'aa')\n 3\n \"\"\"\nfunction how_many_times(string::String, substring::String)::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = how_many_times;\n\t@test(candidate(\"\", \"x\") == 0)\n\t@test(candidate(\"xyxyxyx\", \"x\") == 4)\n\t@test(candidate(\"cacacacac\", \"cac\") == 4)\n\t@test(candidate(\"john doe\", \"john\") == 1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "jl", - "prompt": "\"\"\"We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n numbers in the array will be randomly ordered. Your task is to determine if\n it is possible to get an array sorted in non-decreasing order by performing \n the following operation on the given array:\n You are allowed to perform right shift operation any number of times.\n \n One right shift operation means shifting all elements of the array by one\n position in the right direction. The last element of the array will be moved to\n the starting position in the array i.e. 0th index. \n\n If it is possible to obtain the sorted array by performing the above operation\n then return True else return False.\n If the given array is empty then return True.\n\n Note: The given list is guaranteed to have unique elements.\n\n For Example:\n \n move_one_ball([3, 4, 5, 1, 2])==>True\n Explanation: By performin 2 right shift operations, non-decreasing order can\n be achieved for the given array.\n move_one_ball([3, 5, 4, 1, 2])==>False\n Explanation:It is not possible to get non-decreasing order for the given\n array by performing any number of right shift operations.\n \n \"\"\"\nfunction move_one_ball(arr::Vector{Int64})::Bool \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = move_one_ball;\n\t@test(candidate([3, 4, 5, 1, 2]) == true)\n\t@test(candidate([3, 5, 10, 1, 2]) == true)\n\t@test(candidate([4, 3, 1, 2]) == false)\n\t@test(candidate([3, 5, 4, 1, 2]) == false)\n\t@test(candidate(Vector{Int64}([])) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "jl", - "prompt": "\"\"\"\n Write a function which sorts the given list of integers\n in ascending order according to the sum of their digits.\n Note: if there are several items with similar sum of their digits,\n order them based on their index in original list.\n\n For example:\n >>> order_by_points([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]\n >>> order_by_points([]) == []\n \"\"\"\nfunction order_by_points(nums::Vector{Int64})::Vector{Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = order_by_points;\n\t@test(candidate([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11])\n\t@test(candidate([1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]) == [0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457])\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([1, -11, -32, 43, 54, -98, 2, -3]) == [-3, -32, -98, -11, 1, 2, 43, 54])\n\t@test(candidate([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) == [1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9])\n\t@test(candidate([0, 6, 6, -76, -21, 23, 4]) == [-76, -21, 0, 4, 23, 6, 6])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "jl", - "prompt": "\"\"\" Return list of prime factors of given integer in the order from smallest to largest.\n Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n Input number should be equal to the product of all factors\n >>> factorize(8)\n [2, 2, 2]\n >>> factorize(25)\n [5, 5]\n >>> factorize(70)\n [2, 5, 7]\n \"\"\"\nfunction factorize(n::Int64)::Vector{Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = factorize;\n\t@test(candidate(2) == [2])\n\t@test(candidate(4) == [2, 2])\n\t@test(candidate(8) == [2, 2, 2])\n\t@test(candidate(57) == [3, 19])\n\t@test(candidate(3249) == [3, 3, 19, 19])\n\t@test(candidate(185193) == [3, 3, 3, 19, 19, 19])\n\t@test(candidate(20577) == [3, 19, 19, 19])\n\t@test(candidate(18) == [2, 3, 3])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "jl", - "prompt": "\"\"\"Return True if all numbers in the list l are below threshold t.\n >>> below_threshold([1, 2, 4, 10], 100)\n True\n >>> below_threshold([1, 20, 4, 10], 5)\n False\n \"\"\"\nfunction below_threshold(l::Vector{Int64}, t::Int64)::Bool \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = below_threshold;\n\t@test(candidate([1, 2, 4, 10], 100) == true)\n\t@test(candidate([1, 20, 4, 10], 5) == false)\n\t@test(candidate([1, 20, 4, 10], 21) == true)\n\t@test(candidate([1, 20, 4, 10], 22) == true)\n\t@test(candidate([1, 8, 4, 10], 11) == true)\n\t@test(candidate([1, 8, 4, 10], 10) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "jl", - "prompt": "\"\"\"You are given two positive integers n and m, and your task is to compute the\n average of the integers from n through m (including n and m). \n Round the answer to the nearest integer and convert that to binary.\n If n is greater than m, return -1.\n Example:\n rounded_avg(1, 5) => \"0b11\"\n rounded_avg(7, 5) => -1\n rounded_avg(10, 20) => \"0b1111\"\n rounded_avg(20, 33) => \"0b11010\"\n \"\"\"\nfunction rounded_avg(n::Int64, m::Int64)::Union{String, Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = rounded_avg;\n\t@test(candidate(1, 5) == \"0b11\")\n\t@test(candidate(7, 13) == \"0b1010\")\n\t@test(candidate(964, 977) == \"0b1111001010\")\n\t@test(candidate(996, 997) == \"0b1111100100\")\n\t@test(candidate(560, 851) == \"0b1011000010\")\n\t@test(candidate(185, 546) == \"0b101101110\")\n\t@test(candidate(362, 496) == \"0b110101101\")\n\t@test(candidate(350, 902) == \"0b1001110010\")\n\t@test(candidate(197, 233) == \"0b11010111\")\n\t@test(candidate(7, 5) == -1)\n\t@test(candidate(5, 1) == -1)\n\t@test(candidate(5, 5) == \"0b101\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "jl", - "prompt": "\"\"\" Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n For each of the group, output the deepest level of nesting of parentheses.\n E.g. (()()) has maximum two levels of nesting while ((())) has three.\n\n >>> parse_nested_parens('(()()) ((())) () ((())()())')\n [2, 3, 1, 3]\n \"\"\"\nfunction parse_nested_parens(paren_string::String)::Vector{Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = parse_nested_parens;\n\t@test(candidate(\"(()()) ((())) () ((())()())\") == [2, 3, 1, 3])\n\t@test(candidate(\"() (()) ((())) (((())))\") == [1, 2, 3, 4])\n\t@test(candidate(\"(()(())((())))\") == [4])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "jl", - "prompt": "\"\"\"Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n \n\n Examples\n solution([5, 8, 7, 1]) ==> 12\n solution([3, 3, 3, 3, 3]) ==> 9\n solution([30, 13, 24, 321]) ==>0\n \"\"\"\nfunction solution(lst::Vector{Int64})::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = solution;\n\t@test(candidate([5, 8, 7, 1]) == 12)\n\t@test(candidate([3, 3, 3, 3, 3]) == 9)\n\t@test(candidate([30, 13, 24, 321]) == 0)\n\t@test(candidate([5, 9]) == 5)\n\t@test(candidate([2, 4, 8]) == 0)\n\t@test(candidate([30, 13, 23, 32]) == 23)\n\t@test(candidate([3, 13, 2, 9]) == 3)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "jl", - "prompt": "\"\"\"\n You are given a positive integer n. You have to create an integer array a of length n.\n For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n and a[i] + a[j] + a[k] is a multiple of 3.\n\n Example :\n Input: n = 5\n Output: 1\n Explanation: \n a = [1, 3, 7, 13, 21]\n The only valid triple is (1, 7, 13).\n \"\"\"\nfunction get_max_triples(n::Int64)::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = get_max_triples;\n\t@test(candidate(5) == 1)\n\t@test(candidate(6) == 4)\n\t@test(candidate(10) == 36)\n\t@test(candidate(100) == 53361)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "jl", - "prompt": "\"\"\"\n You are given a list of integers.\n Write a function next_smallest() that returns the 2nd smallest element of the list.\n Return None if there is no such element.\n \n next_smallest([1, 2, 3, 4, 5]) == 2\n next_smallest([5, 1, 4, 3, 2]) == 2\n next_smallest([]) == None\n next_smallest([1, 1]) == None\n \"\"\"\nfunction next_smallest(lst::Vector{Int64})::Union{Int64, Nothing} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = next_smallest;\n\t@test(candidate([1, 2, 3, 4, 5]) == 2)\n\t@test(candidate([5, 1, 4, 3, 2]) == 2)\n\t@test(candidate(Vector{Int64}([])) == nothing)\n\t@test(candidate([1, 1]) == nothing)\n\t@test(candidate([1, 1, 1, 1, 0]) == 1)\n\t@test(candidate([1, 1]) == nothing)\n\t@test(candidate([-35, 34, 12, -45]) == -35)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "jl", - "prompt": "\"\"\" Input is a space-delimited string of numberals from 'zero' to 'nine'.\n Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n Return the string with numbers sorted from smallest to largest\n >>> sort_numbers('three one five')\n 'one three five'\n \"\"\"\nfunction sort_numbers(numbers::String)::String \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = sort_numbers;\n\t@test(candidate(\"\") == \"\")\n\t@test(candidate(\"three\") == \"three\")\n\t@test(candidate(\"three five nine\") == \"three five nine\")\n\t@test(candidate(\"five zero four seven nine eight\") == \"zero four five seven eight nine\")\n\t@test(candidate(\"six five four three two one zero\") == \"zero one two three four five six\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "jl", - "prompt": "\"\"\"You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n cycpattern_check(\"abcd\",\"abd\") => False\n cycpattern_check(\"hello\",\"ell\") => True\n cycpattern_check(\"whassup\",\"psus\") => False\n cycpattern_check(\"abab\",\"baa\") => True\n cycpattern_check(\"efef\",\"eeff\") => False\n cycpattern_check(\"himenss\",\"simen\") => True\n\n \"\"\"\nfunction cycpattern_check(a::String, b::String)::Bool \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = cycpattern_check;\n\t@test(candidate(\"xyzw\", \"xyw\") == false)\n\t@test(candidate(\"yello\", \"ell\") == true)\n\t@test(candidate(\"whattup\", \"ptut\") == false)\n\t@test(candidate(\"efef\", \"fee\") == true)\n\t@test(candidate(\"abab\", \"aabb\") == false)\n\t@test(candidate(\"winemtt\", \"tinem\") == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "jl", - "prompt": "\"\"\"You will be given a number in decimal form and your task is to convert it to\n binary format. The function should return a string, with each character representing a binary\n number. Each character in the string will be '0' or '1'.\n\n There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n The extra characters are there to help with the format.\n\n Examples:\n decimal_to_binary(15) # returns \"db1111db\"\n decimal_to_binary(32) # returns \"db100000db\"\n \"\"\"\nfunction decimal_to_binary(decimal::Int64)::String \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = decimal_to_binary;\n\t@test(candidate(0) == \"db0db\")\n\t@test(candidate(32) == \"db100000db\")\n\t@test(candidate(103) == \"db1100111db\")\n\t@test(candidate(15) == \"db1111db\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "jl", - "prompt": "\"\"\" Filter an input list of strings only for ones that contain given substring\n >>> filter_by_substring([], 'a')\n []\n >>> filter_by_substring(['abc', 'bacd', 'cde', 'array'], 'a')\n ['abc', 'bacd', 'array']\n \"\"\"\nfunction filter_by_substring(strings::Vector{String}, substring::String)::Vector{String} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = filter_by_substring;\n\t@test(candidate(Vector{String}([]), \"john\") == Vector{String}([]))\n\t@test(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\") == [\"xxx\", \"xxxAAA\", \"xxx\"])\n\t@test(candidate([\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xx\") == [\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"])\n\t@test(candidate([\"grunt\", \"trumpet\", \"prune\", \"gruesome\"], \"run\") == [\"grunt\", \"prune\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "jl", - "prompt": "\"\"\"Given an integer. return a tuple that has the number of even and odd digits respectively.\n\n Example:\n even_odd_count(-12) ==> (1, 1)\n even_odd_count(123) ==> (1, 2)\n \"\"\"\nfunction even_odd_count(num::Int64)::Tuple{Int64, Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = even_odd_count;\n\t@test(candidate(7) == (0, 1))\n\t@test(candidate(-78) == (1, 1))\n\t@test(candidate(3452) == (2, 2))\n\t@test(candidate(346211) == (3, 3))\n\t@test(candidate(-345821) == (3, 3))\n\t@test(candidate(-2) == (1, 0))\n\t@test(candidate(-45347) == (2, 3))\n\t@test(candidate(0) == (1, 0))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "jl", - "prompt": "\"\"\"Write a function that accepts a list of strings.\n The list contains different words. Return the word with maximum number\n of unique characters. If multiple strings have maximum number of unique\n characters, return the one which comes first in lexicographical order.\n\n find_max([\"name\", \"of\", \"string\"]) == \"string\"\n find_max([\"name\", \"enam\", \"game\"]) == \"enam\"\n find_max([\"aaaaaaa\", \"bb\" ,\"cc\"]) == \"\"aaaaaaa\"\n \"\"\"\nfunction find_max(words::Vector{String})::String \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = find_max;\n\t@test(candidate([\"name\", \"of\", \"string\"]) == \"string\")\n\t@test(candidate([\"name\", \"enam\", \"game\"]) == \"enam\")\n\t@test(candidate([\"aaaaaaa\", \"bb\", \"cc\"]) == \"aaaaaaa\")\n\t@test(candidate([\"abc\", \"cba\"]) == \"abc\")\n\t@test(candidate([\"play\", \"this\", \"game\", \"of\", \"footbott\"]) == \"footbott\")\n\t@test(candidate([\"we\", \"are\", \"gonna\", \"rock\"]) == \"gonna\")\n\t@test(candidate([\"we\", \"are\", \"a\", \"mad\", \"nation\"]) == \"nation\")\n\t@test(candidate([\"this\", \"is\", \"a\", \"prrk\"]) == \"this\")\n\t@test(candidate([\"b\"]) == \"b\")\n\t@test(candidate([\"play\", \"play\", \"play\"]) == \"play\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "jl", - "prompt": "\"\"\"\n Given a positive integer n, return the count of the numbers of n-digit\n positive integers that start or end with 1.\n \"\"\"\nfunction starts_one_ends(n::Int64)::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = starts_one_ends;\n\t@test(candidate(1) == 1)\n\t@test(candidate(2) == 18)\n\t@test(candidate(3) == 180)\n\t@test(candidate(4) == 1800)\n\t@test(candidate(5) == 18000)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "jl", - "prompt": "\"\"\"\n Create a function that returns a tuple (a, b), where 'a' is\n the largest of negative integers, and 'b' is the smallest\n of positive integers in a list.\n If there is no negative or positive integers, return them as None.\n\n Examples:\n largest_smallest_integers([2, 4, 1, 3, 5, 7]) == (None, 1)\n largest_smallest_integers([]) == (None, None)\n largest_smallest_integers([0]) == (None, None)\n \"\"\"\nfunction largest_smallest_integers(lst::Vector{Int64})::Tuple{Union{Int64, Nothing}, Union{Int64, Nothing}} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = largest_smallest_integers;\n\t@test(candidate([2, 4, 1, 3, 5, 7]) == (nothing, 1))\n\t@test(candidate([2, 4, 1, 3, 5, 7, 0]) == (nothing, 1))\n\t@test(candidate([1, 3, 2, 4, 5, 6, -2]) == (-2, 1))\n\t@test(candidate([4, 5, 3, 6, 2, 7, -7]) == (-7, 2))\n\t@test(candidate([7, 3, 8, 4, 9, 2, 5, -9]) == (-9, 2))\n\t@test(candidate(Vector{Int64}([])) == (nothing, nothing))\n\t@test(candidate([0]) == (nothing, nothing))\n\t@test(candidate([-1, -3, -5, -6]) == (-1, nothing))\n\t@test(candidate([-1, -3, -5, -6, 0]) == (-1, nothing))\n\t@test(candidate([-6, -4, -4, -3, 1]) == (-3, 1))\n\t@test(candidate([-6, -4, -4, -3, -100, 1]) == (-3, 1))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "jl", - "prompt": "\"\"\"\n \"Given an array representing a branch of a tree that has non-negative integer nodes\n your task is to pluck one of the nodes and return it.\n The plucked node should be the node with the smallest even value.\n If multiple nodes with the same smallest even value are found return the node that has smallest index.\n\n The plucked node should be returned in a list, [ smalest_value, its index ],\n If there are no even values or the given array is empty, return [].\n\n Example 1:\n Input: [4,2,3]\n Output: [2, 1]\n Explanation: 2 has the smallest even value, and 2 has the smallest index.\n\n Example 2:\n Input: [1,2,3]\n Output: [2, 1]\n Explanation: 2 has the smallest even value, and 2 has the smallest index. \n\n Example 3:\n Input: []\n Output: []\n \n Example 4:\n Input: [5, 0, 3, 0, 4, 2]\n Output: [0, 1]\n Explanation: 0 is the smallest value, but there are two zeros,\n so we will choose the first zero, which has the smallest index.\n\n Constraints:\n * 1 <= nodes.length <= 10000\n * 0 <= node.value\n \"\"\"\nfunction pluck(arr::Vector{Int64})::Vector{Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = pluck;\n\t@test(candidate([4, 2, 3]) == [2, 1])\n\t@test(candidate([1, 2, 3]) == [2, 1])\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([5, 0, 3, 0, 4, 2]) == [0, 1])\n\t@test(candidate([1, 2, 3, 0, 5, 3]) == [0, 3])\n\t@test(candidate([5, 4, 8, 4, 8]) == [4, 1])\n\t@test(candidate([7, 6, 7, 1]) == [6, 1])\n\t@test(candidate([7, 9, 7, 1]) == Vector{Int64}([]))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "jl", - "prompt": "\"\"\"\n Write a function count_nums which takes an array of integers and returns\n the number of elements which has a sum of digits > 0.\n If a number is negative, then its first signed digit will be negative:\n e.g. -123 has signed digits -1, 2, and 3.\n >>> count_nums([]) == 0\n >>> count_nums([-1, 11, -11]) == 1\n >>> count_nums([1, 1, 2]) == 3\n \"\"\"\nfunction count_nums(arr::Vector{Int64})::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = count_nums;\n\t@test(candidate(Vector{Int64}([])) == 0)\n\t@test(candidate([-1, -2, 0]) == 0)\n\t@test(candidate([1, 1, 2, -2, 3, 4, 5]) == 6)\n\t@test(candidate([1, 6, 9, -6, 0, 1, 5]) == 5)\n\t@test(candidate([1, 100, 98, -7, 1, -1]) == 4)\n\t@test(candidate([12, 23, 34, -45, -56, 0]) == 5)\n\t@test(candidate([0, 1]) == 1)\n\t@test(candidate([1]) == 1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "jl", - "prompt": "\"\"\"\n Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n each cell of the grid contains a value. Every integer in the range [1, N * N]\n inclusive appears exactly once on the cells of the grid.\n\n You have to find the minimum path of length k in the grid. You can start\n from any cell, and in each step you can move to any of the neighbor cells,\n in other words, you can go to cells which share an edge with you current\n cell.\n Please note that a path of length k means visiting exactly k cells (not\n necessarily distinct).\n You CANNOT go off the grid.\n A path A (of length k) is considered less than a path B (of length k) if\n after making the ordered lists of the values on the cells that A and B go\n through (let's call them lst_A and lst_B), lst_A is lexicographically less\n than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n lst_A[j] = lst_B[j].\n It is guaranteed that the answer is unique.\n Return an ordered list of the values on the cells that the minimum path go through.\n\n Examples:\n\n Input: grid = [ [1,2,3], [4,5,6], [7,8,9]], k = 3\n Output: [1, 2, 1]\n\n Input: grid = [ [5,9,3], [4,1,6], [7,8,2]], k = 1\n Output: [1]\n \"\"\"\nfunction minPath(grid::Vector{Vector{Int64}}, k::Int64)::Vector{Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = minPath;\n\t@test(candidate([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3) == [1, 2, 1])\n\t@test(candidate([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1) == [1])\n\t@test(candidate([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], 4) == [1, 2, 1, 2])\n\t@test(candidate([[6, 4, 13, 10], [5, 7, 12, 1], [3, 16, 11, 15], [8, 14, 9, 2]], 7) == [1, 10, 1, 10, 1, 10, 1])\n\t@test(candidate([[8, 14, 9, 2], [6, 4, 13, 15], [5, 7, 1, 12], [3, 10, 11, 16]], 5) == [1, 7, 1, 7, 1])\n\t@test(candidate([[11, 8, 7, 2], [5, 16, 14, 4], [9, 3, 15, 6], [12, 13, 10, 1]], 9) == [1, 6, 1, 6, 1, 6, 1, 6, 1])\n\t@test(candidate([[12, 13, 10, 1], [9, 3, 15, 6], [5, 16, 14, 4], [11, 8, 7, 2]], 12) == [1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6])\n\t@test(candidate([[2, 7, 4], [3, 1, 5], [6, 8, 9]], 8) == [1, 3, 1, 3, 1, 3, 1, 3])\n\t@test(candidate([[6, 1, 5], [3, 8, 9], [2, 7, 4]], 8) == [1, 5, 1, 5, 1, 5, 1, 5])\n\t@test(candidate([[1, 2], [3, 4]], 10) == [1, 2, 1, 2, 1, 2, 1, 2, 1, 2])\n\t@test(candidate([[1, 3], [3, 2]], 10) == [1, 3, 1, 3, 1, 3, 1, 3, 1, 3])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "jl", - "prompt": "\"\"\"\n Given list of integers, return list in strange order.\n Strange sorting, is when you start with the minimum value,\n then maximum of the remaining integers, then minimum and so on.\n\n Examples:\n strange_sort_list([1, 2, 3, 4]) == [1, 4, 2, 3]\n strange_sort_list([5, 5, 5, 5]) == [5, 5, 5, 5]\n strange_sort_list([]) == []\n \"\"\"\nfunction strange_sort_list(lst::Vector{Int64})::Vector{Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = strange_sort_list;\n\t@test(candidate([1, 2, 3, 4]) == [1, 4, 2, 3])\n\t@test(candidate([5, 6, 7, 8, 9]) == [5, 9, 6, 8, 7])\n\t@test(candidate([1, 2, 3, 4, 5]) == [1, 5, 2, 4, 3])\n\t@test(candidate([5, 6, 7, 8, 9, 1]) == [1, 9, 5, 8, 6, 7])\n\t@test(candidate([5, 5, 5, 5]) == [5, 5, 5, 5])\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([1, 2, 3, 4, 5, 6, 7, 8]) == [1, 8, 2, 7, 3, 6, 4, 5])\n\t@test(candidate([0, 2, 2, 2, 5, 5, -5, -5]) == [-5, 5, -5, 5, 0, 2, 2, 2])\n\t@test(candidate([111111]) == [111111])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "jl", - "prompt": "\"\"\"\n Given a string 'text', return its md5 hash equivalent string.\n If 'text' is an empty string, return None.\n\n >>> string_to_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'\n \"\"\"\nfunction string_to_md5(text::String)::Union{String, Nothing} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = string_to_md5;\n\t@test(candidate(\"Hello world\") == \"3e25960a79dbc69b674cd4ec67a72c62\")\n\t@test(candidate(\"\") == nothing)\n\t@test(candidate(\"A B C\") == \"0ef78513b0cb8cef12743f5aeb35f888\")\n\t@test(candidate(\"password\") == \"5f4dcc3b5aa765d61d8327deb882cf99\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "jl", - "prompt": "\"\"\"You are given a word. Your task is to find the closest vowel that stands between \n two consonants from the right side of the word (case sensitive).\n \n Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n find any vowel met the above condition. \n\n You may assume that the given string contains English letter only.\n\n Example:\n get_closest_vowel(\"yogurt\") ==> \"u\"\n get_closest_vowel(\"FULL\") ==> \"U\"\n get_closest_vowel(\"quick\") ==> \"\"\n get_closest_vowel(\"ab\") ==> \"\"\n \"\"\"\nfunction get_closest_vowel(word::String)::String \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = get_closest_vowel;\n\t@test(candidate(\"yogurt\") == \"u\")\n\t@test(candidate(\"full\") == \"u\")\n\t@test(candidate(\"easy\") == \"\")\n\t@test(candidate(\"eAsy\") == \"\")\n\t@test(candidate(\"ali\") == \"\")\n\t@test(candidate(\"bad\") == \"a\")\n\t@test(candidate(\"most\") == \"o\")\n\t@test(candidate(\"ab\") == \"\")\n\t@test(candidate(\"ba\") == \"\")\n\t@test(candidate(\"quick\") == \"\")\n\t@test(candidate(\"anime\") == \"i\")\n\t@test(candidate(\"Asia\") == \"\")\n\t@test(candidate(\"Above\") == \"o\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "jl", - "prompt": "\"\"\"Change numerical base of input number x to base.\n return string representation after the conversion.\n base numbers are less than 10.\n >>> change_base(8, 3)\n '22'\n >>> change_base(8, 2)\n '1000'\n >>> change_base(7, 2)\n '111'\n \"\"\"\nfunction change_base(x::Int64, base::Int64)::String \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = change_base;\n\t@test(candidate(8, 3) == \"22\")\n\t@test(candidate(9, 3) == \"100\")\n\t@test(candidate(234, 2) == \"11101010\")\n\t@test(candidate(16, 2) == \"10000\")\n\t@test(candidate(8, 2) == \"1000\")\n\t@test(candidate(7, 2) == \"111\")\n\t@test(candidate(2, 3) == \"2\")\n\t@test(candidate(3, 4) == \"3\")\n\t@test(candidate(4, 5) == \"4\")\n\t@test(candidate(5, 6) == \"5\")\n\t@test(candidate(6, 7) == \"6\")\n\t@test(candidate(7, 8) == \"7\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "jl", - "prompt": "\"\"\" Check if in given list of numbers, are any two numbers closer to each other than\n given threshold.\n >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n False\n >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n True\n \"\"\"\nfunction has_close_elements(numbers::Vector{Float64}, threshold::Float64)::Bool \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = has_close_elements;\n\t@test(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3) == true)\n\t@test(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05) == false)\n\t@test(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.95) == true)\n\t@test(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.8) == false)\n\t@test(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1) == true)\n\t@test(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 1.0) == true)\n\t@test(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 0.5) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "jl", - "prompt": "\"\"\"\n Create a function that takes a string as input which contains only square brackets.\n The function should return True if and only if there is a valid subsequence of brackets \n where at least one bracket in the subsequence is nested.\n\n is_nested('[[]]') \u279e True\n is_nested('[]]]]]]][[[[[]') \u279e False\n is_nested('[][]') \u279e False\n is_nested('[]') \u279e False\n is_nested('[[][]]') \u279e True\n is_nested('[[]][[') \u279e True\n \"\"\"\nfunction is_nested(string::String)::Bool \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_nested;\n\t@test(candidate(\"[[]]\") == true)\n\t@test(candidate(\"[]]]]]]][[[[[]\") == false)\n\t@test(candidate(\"[][]\") == false)\n\t@test(candidate(\"[]\") == false)\n\t@test(candidate(\"[[[[]]]]\") == true)\n\t@test(candidate(\"[]]]]]]]]]]\") == false)\n\t@test(candidate(\"[][][[]]\") == true)\n\t@test(candidate(\"[[]\") == false)\n\t@test(candidate(\"[]]\") == false)\n\t@test(candidate(\"[[]][[\") == true)\n\t@test(candidate(\"[[][]]\") == true)\n\t@test(candidate(\"\") == false)\n\t@test(candidate(\"[[[[[[[[\") == false)\n\t@test(candidate(\"]]]]]]]]\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "jl", - "prompt": "\"\"\" Concatenate list of strings into a single string\n >>> concatenate([])\n ''\n >>> concatenate(['a', 'b', 'c'])\n 'abc'\n \"\"\"\nfunction concatenate(strings::Vector{String})::String \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = concatenate;\n\t@test(candidate(Vector{String}([])) == \"\")\n\t@test(candidate([\"x\", \"y\", \"z\"]) == \"xyz\")\n\t@test(candidate([\"x\", \"y\", \"z\", \"w\", \"k\"]) == \"xyzwk\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "jl", - "prompt": "\"\"\"\n prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n >>> prime_fib(1)\n 2\n >>> prime_fib(2)\n 3\n >>> prime_fib(3)\n 5\n >>> prime_fib(4)\n 13\n >>> prime_fib(5)\n 89\n \"\"\"\nfunction prime_fib(n::Int64)::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = prime_fib;\n\t@test(candidate(1) == 2)\n\t@test(candidate(2) == 3)\n\t@test(candidate(3) == 5)\n\t@test(candidate(4) == 13)\n\t@test(candidate(5) == 89)\n\t@test(candidate(6) == 233)\n\t@test(candidate(7) == 1597)\n\t@test(candidate(8) == 28657)\n\t@test(candidate(9) == 514229)\n\t@test(candidate(10) == 433494437)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "jl", - "prompt": "\"\"\" From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n other and return them in order (smaller number, larger number).\n >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n (2.0, 2.2)\n >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n (2.0, 2.0)\n \"\"\"\nfunction find_closest_elements(numbers::Vector{Float64})::Tuple{Float64, Float64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = find_closest_elements;\n\t@test(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2]) == (3.9, 4.0))\n\t@test(candidate([1.0, 2.0, 5.9, 4.0, 5.0]) == (5.0, 5.9))\n\t@test(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]) == (2.0, 2.2))\n\t@test(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]) == (2.0, 2.0))\n\t@test(candidate([1.1, 2.2, 3.1, 4.1, 5.1]) == (2.2, 3.1))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "jl", - "prompt": "\"\"\"You have been tasked to write a function that receives \n a hexadecimal number as a string and counts the number of hexadecimal \n digits that are primes (prime number, or a prime, is a natural number \n greater than 1 that is not a product of two smaller natural numbers).\n Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n So you have to determine a number of the following digits: 2, 3, 5, 7, \n B (=decimal 11), D (=decimal 13).\n Note: you may assume the input is always correct or empty string, \n and symbols A,B,C,D,E,F are always uppercase.\n Examples:\n For num = \"AB\" the output should be 1.\n For num = \"1077E\" the output should be 2.\n For num = \"ABED1A33\" the output should be 4.\n For num = \"123456789ABCDEF0\" the output should be 6.\n For num = \"2020\" the output should be 2.\n \"\"\"\nfunction hex_key(num::String)::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = hex_key;\n\t@test(candidate(\"AB\") == 1)\n\t@test(candidate(\"1077E\") == 2)\n\t@test(candidate(\"ABED1A33\") == 4)\n\t@test(candidate(\"2020\") == 2)\n\t@test(candidate(\"123456789ABCDEF0\") == 6)\n\t@test(candidate(\"112233445566778899AABBCCDDEEFF00\") == 12)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "jl", - "prompt": "\"\"\"Complete the function that takes two integers and returns \n the product of their unit digits.\n Assume the input is always valid.\n Examples:\n multiply(148, 412) should return 16.\n multiply(19, 28) should return 72.\n multiply(2020, 1851) should return 0.\n multiply(14,-15) should return 20.\n \"\"\"\nfunction multiply(a::Int64, b::Int64)::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = multiply;\n\t@test(candidate(148, 412) == 16)\n\t@test(candidate(19, 28) == 72)\n\t@test(candidate(2020, 1851) == 0)\n\t@test(candidate(14, -15) == 20)\n\t@test(candidate(76, 67) == 42)\n\t@test(candidate(17, 27) == 49)\n\t@test(candidate(0, 1) == 0)\n\t@test(candidate(0, 0) == 0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "jl", - "prompt": "\"\"\" Given list of numbers (of at least two elements), apply a linear transform to that list,\n such that the smallest number will become 0 and the largest will become 1\n >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n [0.0, 0.25, 0.5, 0.75, 1.0]\n \"\"\"\nfunction rescale_to_unit(numbers::Vector{Float64})::Vector{Float64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = rescale_to_unit;\n\t@test(candidate([2.0, 49.9]) == [0.0, 1.0])\n\t@test(candidate([100.0, 49.9]) == [1.0, 0.0])\n\t@test(candidate([1.0, 2.0, 3.0, 4.0, 5.0]) == [0.0, 0.25, 0.5, 0.75, 1.0])\n\t@test(candidate([2.0, 1.0, 5.0, 3.0, 4.0]) == [0.25, 0.0, 1.0, 0.5, 0.75])\n\t@test(candidate([12.0, 11.0, 15.0, 13.0, 14.0]) == [0.25, 0.0, 1.0, 0.5, 0.75])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "jl", - "prompt": "\"\"\"Given a positive integer n, return the product of the odd digits.\n Return 0 if all digits are even.\n For example:\n digits(1) == 1\n digits(4) == 0\n digits(235) == 15\n \"\"\"\nfunction digits(n::Int64)::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = digits;\n\t@test(candidate(5) == 5)\n\t@test(candidate(54) == 5)\n\t@test(candidate(120) == 1)\n\t@test(candidate(5014) == 5)\n\t@test(candidate(98765) == 315)\n\t@test(candidate(5576543) == 2625)\n\t@test(candidate(2468) == 0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "jl", - "prompt": "\"\"\"You will be given the name of a class (a string) and a list of extensions.\n The extensions are to be used to load additional classes to the class. The\n strength of the extension is as follows: Let CAP be the number of the uppercase\n letters in the extension's name, and let SM be the number of lowercase letters \n in the extension's name, the strength is given by the fraction CAP - SM. \n You should find the strongest extension and return a string in this \n format: ClassName.StrongestExtensionName.\n If there are two or more extensions with the same strength, you should\n choose the one that comes first in the list.\n For example, if you are given \"Slices\" as the class and a list of the\n extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n (its strength is -1).\n Example:\n for Strongest_Extension('my_class', ['AA', 'Be', 'CC']) == 'my_class.AA'\n \"\"\"\nfunction Strongest_Extension(class_name::String, extensions::Vector{String})::String \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = Strongest_Extension;\n\t@test(candidate(\"Watashi\", [\"tEN\", \"niNE\", \"eIGHt8OKe\"]) == \"Watashi.eIGHt8OKe\")\n\t@test(candidate(\"Boku123\", [\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"]) == \"Boku123.YEs.WeCaNe\")\n\t@test(candidate(\"__YESIMHERE\", [\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"]) == \"__YESIMHERE.NuLl__\")\n\t@test(candidate(\"K\", [\"Ta\", \"TAR\", \"t234An\", \"cosSo\"]) == \"K.TAR\")\n\t@test(candidate(\"__HAHA\", [\"Tab\", \"123\", \"781345\", \"-_-\"]) == \"__HAHA.123\")\n\t@test(candidate(\"YameRore\", [\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"]) == \"YameRore.okIWILL123\")\n\t@test(candidate(\"finNNalLLly\", [\"Die\", \"NowW\", \"Wow\", \"WoW\"]) == \"finNNalLLly.WoW\")\n\t@test(candidate(\"_\", [\"Bb\", \"91245\"]) == \"_.Bb\")\n\t@test(candidate(\"Sp\", [\"671235\", \"Bb\"]) == \"Sp.671235\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "jl", - "prompt": "\"\"\"Given a string representing a space separated lowercase letters, return a dictionary\n of the letter with the most repetition and containing the corresponding count.\n If several letters have the same occurrence, return all of them.\n \n Example:\n histogram('a b c') == {'a': 1, 'b': 1, 'c': 1}\n histogram('a b b a') == {'a': 2, 'b': 2}\n histogram('a b c a b') == {'a': 2, 'b': 2}\n histogram('b b b b a') == {'b': 4}\n histogram('') == {}\n\n \"\"\"\nfunction histogram(test::String)::Dict{String, Int64}> \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = histogram;\n\t@test(candidate(\"a b b a\") == Dict(\"a\" => 2, \"b\" => 2))\n\t@test(candidate(\"a b c a b\") == Dict(\"a\" => 2, \"b\" => 2))\n\t@test(candidate(\"a b c d g\") == Dict(\"a\" => 1, \"b\" => 1, \"c\" => 1, \"d\" => 1, \"g\" => 1))\n\t@test(candidate(\"r t g\") == Dict(\"r\" => 1, \"t\" => 1, \"g\" => 1))\n\t@test(candidate(\"b b b b a\") == Dict(\"b\" => 4))\n\t@test(candidate(\"r t g\") == Dict(\"r\" => 1, \"t\" => 1, \"g\" => 1))\n\t@test(candidate(\"\") == Dict())\n\t@test(candidate(\"a\") == Dict(\"a\" => 1))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "jl", - "prompt": "\"\"\"\n pairs_sum_to_zero takes a list of integers as an input.\n it returns True if there are two distinct elements in the list that\n sum to zero, and False otherwise.\n >>> pairs_sum_to_zero([1, 3, 5, 0])\n False\n >>> pairs_sum_to_zero([1, 3, -2, 1])\n False\n >>> pairs_sum_to_zero([1, 2, 3, 7])\n False\n >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7])\n True\n >>> pairs_sum_to_zero([1])\n False\n \"\"\"\nfunction pairs_sum_to_zero(l::Vector{Int64})::Bool \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = pairs_sum_to_zero;\n\t@test(candidate([1, 3, 5, 0]) == false)\n\t@test(candidate([1, 3, -2, 1]) == false)\n\t@test(candidate([1, 2, 3, 7]) == false)\n\t@test(candidate([2, 4, -5, 3, 5, 7]) == true)\n\t@test(candidate([1]) == false)\n\t@test(candidate([-3, 9, -1, 3, 2, 30]) == true)\n\t@test(candidate([-3, 9, -1, 3, 2, 31]) == true)\n\t@test(candidate([-3, 9, -1, 4, 2, 30]) == false)\n\t@test(candidate([-3, 9, -1, 4, 2, 31]) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "jl", - "prompt": "\"\"\"\n Write a function that accepts two lists of strings and returns the list that has \n total number of chars in the all strings of the list less than the other list.\n\n if the two lists have the same number of chars, return the first list.\n\n Examples\n total_match([], []) \u279e []\n total_match(['hi', 'admin'], ['hI', 'Hi']) \u279e ['hI', 'Hi']\n total_match(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) \u279e ['hi', 'admin']\n total_match(['hi', 'admin'], ['hI', 'hi', 'hi']) \u279e ['hI', 'hi', 'hi']\n total_match(['4'], ['1', '2', '3', '4', '5']) \u279e ['4']\n \"\"\"\nfunction total_match(lst1::Vector{String}, lst2::Vector{String})::Vector{String} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = total_match;\n\t@test(candidate(Vector{String}([]), Vector{String}([])) == Vector{String}([]))\n\t@test(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\"]) == [\"hi\", \"hi\"])\n\t@test(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"]) == [\"hi\", \"admin\"])\n\t@test(candidate([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"]) == [\"4\"])\n\t@test(candidate([\"hi\", \"admin\"], [\"hI\", \"Hi\"]) == [\"hI\", \"Hi\"])\n\t@test(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"]) == [\"hI\", \"hi\", \"hi\"])\n\t@test(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hii\"]) == [\"hi\", \"admin\"])\n\t@test(candidate(Vector{String}([]), [\"this\"]) == Vector{String}([]))\n\t@test(candidate([\"this\"], Vector{String}([])) == Vector{String}([]))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "jl", - "prompt": "\"\"\"Circular shift the digits of the integer x, shift the digits right by shift\n and return the result as a string.\n If shift > number of digits, return digits reversed.\n >>> circular_shift(12, 1)\n \"21\"\n >>> circular_shift(12, 2)\n \"12\"\n \"\"\"\nfunction circular_shift(x::Int64, shift::Int64)::String \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = circular_shift;\n\t@test(candidate(100, 2) == \"001\")\n\t@test(candidate(12, 2) == \"12\")\n\t@test(candidate(97, 8) == \"79\")\n\t@test(candidate(12, 1) == \"21\")\n\t@test(candidate(11, 101) == \"11\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "jl", - "prompt": "\"\"\"Return True is list elements are monotonically increasing or decreasing.\n >>> monotonic([1, 2, 4, 20])\n True\n >>> monotonic([1, 20, 4, 10])\n False\n >>> monotonic([4, 1, 0, -10])\n True\n \"\"\"\nfunction monotonic(l::Vector{Int64})::Bool \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = monotonic;\n\t@test(candidate([1, 2, 4, 10]) == true)\n\t@test(candidate([1, 2, 4, 20]) == true)\n\t@test(candidate([1, 20, 4, 10]) == false)\n\t@test(candidate([4, 1, 0, -10]) == true)\n\t@test(candidate([4, 1, 1, 0]) == true)\n\t@test(candidate([1, 2, 3, 2, 5, 60]) == false)\n\t@test(candidate([1, 2, 3, 4, 5, 60]) == true)\n\t@test(candidate([9, 9, 9, 9]) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "jl", - "prompt": "\"\"\"Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n Example\n is_equal_to_sum_even(4) == False\n is_equal_to_sum_even(6) == False\n is_equal_to_sum_even(8) == True\n \"\"\"\nfunction is_equal_to_sum_even(n::Int64)::Bool \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_equal_to_sum_even;\n\t@test(candidate(4) == false)\n\t@test(candidate(6) == false)\n\t@test(candidate(8) == true)\n\t@test(candidate(10) == true)\n\t@test(candidate(11) == false)\n\t@test(candidate(12) == true)\n\t@test(candidate(13) == false)\n\t@test(candidate(16) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "jl", - "prompt": "\"\"\" Input to this function is a string representing musical notes in a special ASCII format.\n Your task is to parse this string and return list of integers corresponding to how many beats does each\n not last.\n\n Here is a legend:\n 'o' - whole note, lasts four beats\n 'o|' - half note, lasts two beats\n '.|' - quater note, lasts one beat\n\n >>> parse_music('o o| .| o| o| .| .| .| .| o o')\n [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\n \"\"\"\nfunction parse_music(music_string::String)::Vector{Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = parse_music;\n\t@test(candidate(\"\") == Vector{Int64}([]))\n\t@test(candidate(\"o o o o\") == [4, 4, 4, 4])\n\t@test(candidate(\".| .| .| .|\") == [1, 1, 1, 1])\n\t@test(candidate(\"o| o| .| .| o o o o\") == [2, 2, 1, 1, 4, 4, 4, 4])\n\t@test(candidate(\"o| .| o| .| o o| o o|\") == [2, 1, 2, 1, 4, 2, 4, 2])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "jl", - "prompt": "\"\"\"\"\n This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n \n Examples:\n For lst = [1,2,3] the output should be 6\n For lst = [] the output should be 0\n For lst = [-1,-5,2,-1,-5] the output should be -126\n \"\"\"\nfunction sum_squares(lst::Vector{Int64})::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = sum_squares;\n\t@test(candidate([1, 2, 3]) == 6)\n\t@test(candidate([1, 4, 9]) == 14)\n\t@test(candidate(Vector{Int64}([])) == 0)\n\t@test(candidate([1, 1, 1, 1, 1, 1, 1, 1, 1]) == 9)\n\t@test(candidate([-1, -1, -1, -1, -1, -1, -1, -1, -1]) == -3)\n\t@test(candidate([0]) == 0)\n\t@test(candidate([-1, -5, 2, -1, -5]) == -126)\n\t@test(candidate([-56, -99, 1, 0, -2]) == 3030)\n\t@test(candidate([-1, 0, 0, 0, 0, 0, 0, 0, -1]) == 0)\n\t@test(candidate([-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37]) == -14196)\n\t@test(candidate([-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10]) == -1448)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "jl", - "prompt": "\"\"\"\n triples_sum_to_zero takes a list of integers as an input.\n it returns True if there are three distinct elements in the list that\n sum to zero, and False otherwise.\n\n >>> triples_sum_to_zero([1, 3, 5, 0])\n False\n >>> triples_sum_to_zero([1, 3, -2, 1])\n True\n >>> triples_sum_to_zero([1, 2, 3, 7])\n False\n >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n True\n >>> triples_sum_to_zero([1])\n False\n \"\"\"\nfunction triples_sum_to_zero(l::Vector{Int64})::Bool \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = triples_sum_to_zero;\n\t@test(candidate([1, 3, 5, 0]) == false)\n\t@test(candidate([1, 3, 5, -1]) == false)\n\t@test(candidate([1, 3, -2, 1]) == true)\n\t@test(candidate([1, 2, 3, 7]) == false)\n\t@test(candidate([1, 2, 5, 7]) == false)\n\t@test(candidate([2, 4, -5, 3, 9, 7]) == true)\n\t@test(candidate([1]) == false)\n\t@test(candidate([1, 3, 5, -100]) == false)\n\t@test(candidate([100, 3, 5, -100]) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "jl", - "prompt": "\"\"\" brackets is a string of \"<\" and \">\".\n return True if every opening bracket has a corresponding closing bracket.\n\n >>> correct_bracketing(\"<\")\n False\n >>> correct_bracketing(\"<>\")\n True\n >>> correct_bracketing(\"<<><>>\")\n True\n >>> correct_bracketing(\"><<>\")\n False\n \"\"\"\nfunction correct_bracketing(brackets::String)::Bool \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = correct_bracketing;\n\t@test(candidate(\"<>\") == true)\n\t@test(candidate(\"<<><>>\") == true)\n\t@test(candidate(\"<><><<><>><>\") == true)\n\t@test(candidate(\"<><><<<><><>><>><<><><<>>>\") == true)\n\t@test(candidate(\"<<<><>>>>\") == false)\n\t@test(candidate(\"><<>\") == false)\n\t@test(candidate(\"<\") == false)\n\t@test(candidate(\"<<<<\") == false)\n\t@test(candidate(\">\") == false)\n\t@test(candidate(\"<<>\") == false)\n\t@test(candidate(\"<><><<><>><>><<>\") == false)\n\t@test(candidate(\"<><><<><>><>>><>\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "jl", - "prompt": "\"\"\"Write a function that takes an array of numbers as input and returns \n the number of elements in the array that are greater than 10 and both \n first and last digits of a number are odd (1, 3, 5, 7, 9).\n For example:\n specialFilter([15, -73, 14, -15]) => 1 \n specialFilter([33, -2, -3, 45, 21, 109]) => 2\n \"\"\"\nfunction specialFilter(nums::Vector{Int64})::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = specialFilter;\n\t@test(candidate([5, -2, 1, -5]) == 0)\n\t@test(candidate([15, -73, 14, -15]) == 1)\n\t@test(candidate([33, -2, -3, 45, 21, 109]) == 2)\n\t@test(candidate([43, -12, 93, 125, 121, 109]) == 4)\n\t@test(candidate([71, -2, -33, 75, 21, 19]) == 3)\n\t@test(candidate([1]) == 0)\n\t@test(candidate(Vector{Int64}([])) == 0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "jl", - "prompt": "\"\"\"\n Given a dictionary, return True if all keys are strings in lower \n case or all keys are strings in upper case, else return False.\n The function should return False is the given dictionary is empty.\n Examples:\n check_dict_case({\"a\":\"apple\", \"b\":\"banana\"}) should return True.\n check_dict_case({\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}) should return False.\n check_dict_case({\"a\":\"apple\", \"8\":\"banana\", \"a\":\"apple\"}) should return False.\n check_dict_case({\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}) should return False.\n check_dict_case({\"STATE\":\"NC\", \"ZIP\":\"12345\" }) should return True.\n \"\"\"\nfunction check_dict_case(dict::Dict{String, String}>)::Bool \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = check_dict_case;\n\t@test(candidate(Dict(\"p\" => \"pineapple\", \"b\" => \"banana\")) == true)\n\t@test(candidate(Dict(\"p\" => \"pineapple\", \"A\" => \"banana\", \"B\" => \"banana\")) == false)\n\t@test(candidate(Dict(\"p\" => \"pineapple\", \"5\" => \"banana\", \"a\" => \"apple\")) == false)\n\t@test(candidate(Dict(\"Name\" => \"John\", \"Age\" => \"36\", \"City\" => \"Houston\")) == false)\n\t@test(candidate(Dict(\"STATE\" => \"NC\", \"ZIP\" => \"12345\")) == true)\n\t@test(candidate(Dict(\"fruit\" => \"Orange\", \"taste\" => \"Sweet\")) == true)\n\t@test(candidate(Dict()) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "jl", - "prompt": "\"\"\"\n Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n Examples\n split_words(\"Hello world!\") \u279e [\"Hello\", \"world!\"]\n split_words(\"Hello,world!\") \u279e [\"Hello\", \"world!\"]\n split_words(\"abcdef\") == 3 \n \"\"\"\nfunction split_words(txt::String)::Union{Vector{String}, Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = split_words;\n\t@test(candidate(\"Hello world!\") == [\"Hello\", \"world!\"])\n\t@test(candidate(\"Hello,world!\") == [\"Hello\", \"world!\"])\n\t@test(candidate(\"Hello world,!\") == [\"Hello\", \"world,!\"])\n\t@test(candidate(\"Hello,Hello,world !\") == [\"Hello,Hello,world\", \"!\"])\n\t@test(candidate(\"abcdef\") == 3)\n\t@test(candidate(\"aaabb\") == 2)\n\t@test(candidate(\"aaaBb\") == 1)\n\t@test(candidate(\"\") == 0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "jl", - "prompt": "\"\"\"The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fibfib(0) == 0\n fibfib(1) == 0\n fibfib(2) == 1\n fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n >>> fibfib(1)\n 0\n >>> fibfib(5)\n 4\n >>> fibfib(8)\n 24\n \"\"\"\nfunction fibfib(n::Int64)::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = fibfib;\n\t@test(candidate(2) == 1)\n\t@test(candidate(1) == 0)\n\t@test(candidate(5) == 4)\n\t@test(candidate(8) == 24)\n\t@test(candidate(10) == 81)\n\t@test(candidate(12) == 274)\n\t@test(candidate(14) == 927)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "jl", - "prompt": "\"\"\"You are given a list of numbers.\n You need to return the sum of squared numbers in the given list,\n round each element in the list to the upper int(Ceiling) first.\n Examples:\n For lst = [1,2,3] the output should be 14\n For lst = [1,4,9] the output should be 98\n For lst = [1,3,5,7] the output should be 84\n For lst = [1.4,4.2,0] the output should be 29\n For lst = [-2.4,1,1] the output should be 6\n \n\n \"\"\"\nfunction sum_squares(lst::Vector{Float64})::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = sum_squares;\n\t@test(candidate([1.0, 2.0, 3.0]) == 14)\n\t@test(candidate([1.0, 2.0, 3.0]) == 14)\n\t@test(candidate([1.0, 3.0, 5.0, 7.0]) == 84)\n\t@test(candidate([1.4, 4.2, 0.0]) == 29)\n\t@test(candidate([-2.4, 1.0, 1.0]) == 6)\n\t@test(candidate([100.0, 1.0, 15.0, 2.0]) == 10230)\n\t@test(candidate([10000.0, 10000.0]) == 200000000)\n\t@test(candidate([-1.4, 4.6, 6.3]) == 75)\n\t@test(candidate([-1.4, 17.9, 18.9, 19.9]) == 1086)\n\t@test(candidate([0.0]) == 0)\n\t@test(candidate([-1.0]) == 1)\n\t@test(candidate([-1.0, 1.0, 0.0]) == 2)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_85_add", - "language": "jl", - "prompt": "\"\"\"Given a non-empty list of integers lst. add the even elements that are at odd indices..\n\n\n Examples:\n add([4, 2, 6, 7]) ==> 2 \n \"\"\"\nfunction add(lst::Vector{Int64})::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = add;\n\t@test(candidate([4, 88]) == 88)\n\t@test(candidate([4, 5, 6, 7, 2, 122]) == 122)\n\t@test(candidate([4, 0, 6, 7]) == 0)\n\t@test(candidate([4, 4, 6, 8]) == 12)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "jl", - "prompt": "\"\"\"Return sorted unique elements in a list\n >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123])\n [0, 2, 3, 5, 9, 123]\n \"\"\"\nfunction unique(l::Vector{Int64})::Vector{Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = unique;\n\t@test(candidate([5, 3, 5, 2, 3, 3, 9, 0, 123]) == [0, 2, 3, 5, 9, 123])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "jl", - "prompt": "\"\"\"\n Given a string text, replace all spaces in it with underscores, \n and if a string has more than 2 consecutive spaces, \n then replace all consecutive spaces with - \n \n fix_spaces(\"Example\") == \"Example\"\n fix_spaces(\"Example 1\") == \"Example_1\"\n fix_spaces(\" Example 2\") == \"_Example_2\"\n fix_spaces(\" Example 3\") == \"_Example-3\"\n \"\"\"\nfunction fix_spaces(text::String)::String \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = fix_spaces;\n\t@test(candidate(\"Example\") == \"Example\")\n\t@test(candidate(\"Mudasir Hanif \") == \"Mudasir_Hanif_\")\n\t@test(candidate(\"Yellow Yellow Dirty Fellow\") == \"Yellow_Yellow__Dirty__Fellow\")\n\t@test(candidate(\"Exa mple\") == \"Exa-mple\")\n\t@test(candidate(\" Exa 1 2 2 mple\") == \"-Exa_1_2_2_mple\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "jl", - "prompt": "\"\"\"Return 2^n modulo p (be aware of numerics).\n >>> modp(3, 5)\n 3\n >>> modp(1101, 101)\n 2\n >>> modp(0, 101)\n 1\n >>> modp(3, 11)\n 8\n >>> modp(100, 101)\n 1\n \"\"\"\nfunction modp(n::Int64, p::Int64)::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = modp;\n\t@test(candidate(3, 5) == 3)\n\t@test(candidate(1101, 101) == 2)\n\t@test(candidate(0, 101) == 1)\n\t@test(candidate(3, 11) == 8)\n\t@test(candidate(100, 101) == 1)\n\t@test(candidate(30, 5) == 4)\n\t@test(candidate(31, 5) == 3)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "jl", - "prompt": "\"\"\"You have to write a function which validates a given date string and\n returns True if the date is valid otherwise False.\n The date is valid if all of the following rules are satisfied:\n 1. The date string is not empty.\n 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n 3. The months should not be less than 1 or higher than 12.\n 4. The date should be in the format: mm-dd-yyyy\n\n for example: \n valid_date('03-11-2000') => True\n\n valid_date('15-01-2012') => False\n\n valid_date('04-0-2040') => False\n\n valid_date('06-04-2020') => True\n\n valid_date('06/04/2020') => False\n \"\"\"\nfunction valid_date(date::String)::Bool \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = valid_date;\n\t@test(candidate(\"03-11-2000\") == true)\n\t@test(candidate(\"15-01-2012\") == false)\n\t@test(candidate(\"04-0-2040\") == false)\n\t@test(candidate(\"06-04-2020\") == true)\n\t@test(candidate(\"01-01-2007\") == true)\n\t@test(candidate(\"03-32-2011\") == false)\n\t@test(candidate(\"\") == false)\n\t@test(candidate(\"04-31-3000\") == false)\n\t@test(candidate(\"06-06-2005\") == true)\n\t@test(candidate(\"21-31-2000\") == false)\n\t@test(candidate(\"04-12-2003\") == true)\n\t@test(candidate(\"04122003\") == false)\n\t@test(candidate(\"20030412\") == false)\n\t@test(candidate(\"2003-04\") == false)\n\t@test(candidate(\"2003-04-12\") == false)\n\t@test(candidate(\"04-2003\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "jl", - "prompt": "\"\"\"\n Write a function that takes a string and returns an ordered version of it.\n Ordered version of string, is a string where all words (separated by space)\n are replaced by a new word where all the characters arranged in\n ascending order based on ascii value.\n Note: You should keep the order of words and blank spaces in the sentence.\n\n For example:\n anti_shuffle('Hi') returns 'Hi'\n anti_shuffle('hello') returns 'ehllo'\n anti_shuffle('Hello World!!!') returns 'Hello !!!Wdlor'\n \"\"\"\nfunction anti_shuffle(s::String)::String \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = anti_shuffle;\n\t@test(candidate(\"Hi\") == \"Hi\")\n\t@test(candidate(\"hello\") == \"ehllo\")\n\t@test(candidate(\"number\") == \"bemnru\")\n\t@test(candidate(\"abcd\") == \"abcd\")\n\t@test(candidate(\"Hello World!!!\") == \"Hello !!!Wdlor\")\n\t@test(candidate(\"\") == \"\")\n\t@test(candidate(\"Hi. My name is Mister Robot. How are you?\") == \".Hi My aemn is Meirst .Rboot How aer ?ouy\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "jl", - "prompt": "\"\"\"\n Given a list of numbers, return whether or not they are sorted\n in ascending order. If list has more than 1 duplicate of the same\n number, return False. Assume no negative numbers and only integers.\n\n Examples\n is_sorted([5]) \u279e True\n is_sorted([1, 2, 3, 4, 5]) \u279e True\n is_sorted([1, 3, 2, 4, 5]) \u279e False\n is_sorted([1, 2, 3, 4, 5, 6]) \u279e True\n is_sorted([1, 2, 3, 4, 5, 6, 7]) \u279e True\n is_sorted([1, 3, 2, 4, 5, 6, 7]) \u279e False\n is_sorted([1, 2, 2, 3, 3, 4]) \u279e True\n is_sorted([1, 2, 2, 2, 3, 4]) \u279e False\n \"\"\"\nfunction is_sorted(lst::Vector{Int64})::Bool \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_sorted;\n\t@test(candidate([5]) == true)\n\t@test(candidate([1, 2, 3, 4, 5]) == true)\n\t@test(candidate([1, 3, 2, 4, 5]) == false)\n\t@test(candidate([1, 2, 3, 4, 5, 6]) == true)\n\t@test(candidate([1, 2, 3, 4, 5, 6, 7]) == true)\n\t@test(candidate([1, 3, 2, 4, 5, 6, 7]) == false)\n\t@test(candidate(Vector{Int64}([])) == true)\n\t@test(candidate([1]) == true)\n\t@test(candidate([3, 2, 1]) == false)\n\t@test(candidate([1, 2, 2, 2, 3, 4]) == false)\n\t@test(candidate([1, 2, 3, 3, 3, 4]) == false)\n\t@test(candidate([1, 2, 2, 3, 3, 4]) == true)\n\t@test(candidate([1, 2, 3, 4]) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "jl", - "prompt": "\"\"\"You are given a string s.\n Your task is to check if the string is happy or not.\n A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n For example:\n is_happy(a) => False\n is_happy(aa) => False\n is_happy(abcd) => True\n is_happy(aabb) => False\n is_happy(adb) => True\n is_happy(xyy) => False\n \"\"\"\nfunction is_happy(s::String)::Bool \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_happy;\n\t@test(candidate(\"a\") == false)\n\t@test(candidate(\"aa\") == false)\n\t@test(candidate(\"abcd\") == true)\n\t@test(candidate(\"aabb\") == false)\n\t@test(candidate(\"adb\") == true)\n\t@test(candidate(\"xyy\") == false)\n\t@test(candidate(\"iopaxpoi\") == true)\n\t@test(candidate(\"iopaxioi\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "jl", - "prompt": "\"\"\"\n Write a function that returns True if the object q will fly, and False otherwise.\n The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n\n Example:\n will_it_fly([1, 2], 5) \u279e False \n # 1+2 is less than the maximum possible weight, but it's unbalanced.\n\n will_it_fly([3, 2, 3], 1) \u279e False\n # it's balanced, but 3+2+3 is more than the maximum possible weight.\n\n will_it_fly([3, 2, 3], 9) \u279e True\n # 3+2+3 is less than the maximum possible weight, and it's balanced.\n\n will_it_fly([3], 5) \u279e True\n # 3 is less than the maximum possible weight, and it's balanced.\n \"\"\"\nfunction will_it_fly(q::Vector{Int64}, w::Int64)::Bool \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = will_it_fly;\n\t@test(candidate([3, 2, 3], 9) == true)\n\t@test(candidate([1, 2], 5) == false)\n\t@test(candidate([3], 5) == true)\n\t@test(candidate([3, 2, 3], 1) == false)\n\t@test(candidate([1, 2, 3], 6) == false)\n\t@test(candidate([5], 5) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "jl", - "prompt": "\"\"\"\n Given an array of non-negative integers, return a copy of the given array after sorting,\n you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n or sort it in descending order if the sum( first index value, last index value) is even.\n\n Note:\n * don't change the given array.\n\n Examples:\n * sort_array([]) => []\n * sort_array([5]) => [5]\n * sort_array([2, 4, 3, 0, 1, 5]) => [0, 1, 2, 3, 4, 5]\n * sort_array([2, 4, 3, 0, 1, 5, 6]) => [6, 5, 4, 3, 2, 1, 0]\n \"\"\"\nfunction sort_array(array::Vector{Int64})::Vector{Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = sort_array;\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([5]) == [5])\n\t@test(candidate([2, 4, 3, 0, 1, 5]) == [0, 1, 2, 3, 4, 5])\n\t@test(candidate([2, 4, 3, 0, 1, 5, 6]) == [6, 5, 4, 3, 2, 1, 0])\n\t@test(candidate([2, 1]) == [1, 2])\n\t@test(candidate([15, 42, 87, 32, 11, 0]) == [0, 11, 15, 32, 42, 87])\n\t@test(candidate([21, 14, 23, 11]) == [23, 21, 14, 11])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "jl", - "prompt": "\"\"\"Implement a function that takes an non-negative integer and returns an array of the first n\n integers that are prime numbers and less than n.\n for example:\n count_up_to(5) => [2,3]\n count_up_to(11) => [2,3,5,7]\n count_up_to(0) => []\n count_up_to(20) => [2,3,5,7,11,13,17,19]\n count_up_to(1) => []\n count_up_to(18) => [2,3,5,7,11,13,17]\n \"\"\"\nfunction count_up_to(n::Int64)::Vector{Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = count_up_to;\n\t@test(candidate(5) == [2, 3])\n\t@test(candidate(6) == [2, 3, 5])\n\t@test(candidate(7) == [2, 3, 5])\n\t@test(candidate(10) == [2, 3, 5, 7])\n\t@test(candidate(0) == Vector{Int64}([]))\n\t@test(candidate(22) == [2, 3, 5, 7, 11, 13, 17, 19])\n\t@test(candidate(1) == Vector{Int64}([]))\n\t@test(candidate(18) == [2, 3, 5, 7, 11, 13, 17])\n\t@test(candidate(47) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43])\n\t@test(candidate(101) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "jl", - "prompt": "\"\"\" Out of list of strings, return the longest one. Return the first one in case of multiple\n strings of the same length. Return None in case the input list is empty.\n >>> longest([])\n\n >>> longest(['a', 'b', 'c'])\n 'a'\n >>> longest(['a', 'bb', 'ccc'])\n 'ccc'\n \"\"\"\nfunction longest(strings::Vector{String})::Union{String, Nothing} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = longest;\n\t@test(candidate(Vector{String}([])) == nothing)\n\t@test(candidate([\"x\", \"y\", \"z\"]) == \"x\")\n\t@test(candidate([\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"]) == \"zzzz\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "jl", - "prompt": "\"\"\"\n Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n reverse the resulting array, and then replace each digit by its corresponding name from\n \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n\n For example:\n arr = [2, 1, 1, 4, 5, 8, 2, 3] \n -> sort arr -> [1, 1, 2, 2, 3, 4, 5, 8] \n -> reverse arr -> [8, 5, 4, 3, 2, 2, 1, 1]\n return [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n \n If the array is empty, return an empty array:\n arr = []\n return []\n \n If the array has any strange number ignore it:\n arr = [1, -1 , 55] \n -> sort arr -> [-1, 1, 55]\n -> reverse arr -> [55, 1, -1]\n return = ['One']\n \"\"\"\nfunction by_length(arr::Vector{Int64})::Vector{String} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = by_length;\n\t@test(candidate([2, 1, 1, 4, 5, 8, 2, 3]) == [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"])\n\t@test(candidate(Vector{Int64}([])) == Vector{String}([]))\n\t@test(candidate([1, -1, 55]) == [\"One\"])\n\t@test(candidate([1, -1, 3, 2]) == [\"Three\", \"Two\", \"One\"])\n\t@test(candidate([9, 4, 8]) == [\"Nine\", \"Eight\", \"Four\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_106_f", - "language": "jl", - "prompt": "\"\"\" Implement the function f that takes n as a parameter,\n 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\n or the sum of numbers from 1 to i otherwise.\n i starts from 1.\n the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n Example:\n f(5) == [1, 2, 6, 24, 15]\n \"\"\"\nfunction f(n::Int64)::Vector{Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = f;\n\t@test(candidate(5) == [1, 2, 6, 24, 15])\n\t@test(candidate(7) == [1, 2, 6, 24, 15, 720, 28])\n\t@test(candidate(1) == [1])\n\t@test(candidate(3) == [1, 2, 6])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "jl", - "prompt": "\"\"\"Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n >>> fizz_buzz(50)\n 0\n >>> fizz_buzz(78)\n 2\n >>> fizz_buzz(79)\n 3\n \"\"\"\nfunction fizz_buzz(n::Int64)::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = fizz_buzz;\n\t@test(candidate(50) == 0)\n\t@test(candidate(78) == 2)\n\t@test(candidate(79) == 3)\n\t@test(candidate(100) == 3)\n\t@test(candidate(200) == 6)\n\t@test(candidate(4000) == 192)\n\t@test(candidate(10000) == 639)\n\t@test(candidate(100000) == 8026)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "jl", - "prompt": "\"\"\" Given a positive floating point number, it can be decomposed into\n and integer part (largest integer smaller than given number) and decimals\n (leftover part always smaller than 1).\n\n Return the decimal part of the number.\n >>> truncate_number(3.5)\n 0.5\n \"\"\"\nfunction truncate_number(number::Float64)::Float64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = truncate_number;\n\t@test(candidate(3.5) == 0.5)\n\t@test(candidate(1.25) == 0.25)\n\t@test(candidate(123.0) == 0.0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "jl", - "prompt": "\"\"\" For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n Empty sum should be equal to 0 and empty product should be equal to 1.\n >>> sum_product([])\n (0, 1)\n >>> sum_product([1, 2, 3, 4])\n (10, 24)\n \"\"\"\nfunction sum_product(numbers::Vector{Int64})::Tuple{Int64, Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = sum_product;\n\t@test(candidate(Vector{Int64}([])) == (0, 1))\n\t@test(candidate([1, 1, 1]) == (3, 1))\n\t@test(candidate([100, 0]) == (100, 0))\n\t@test(candidate([3, 5, 7]) == (15, 105))\n\t@test(candidate([10]) == (10, 10))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "jl", - "prompt": "\"\"\"\n You are given a 2 dimensional data, as a nested lists,\n which is similar to matrix, however, unlike matrices,\n each row may contain a different number of columns.\n Given lst, and integer x, find integers x in the list,\n and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n each tuple is a coordinate - (row, columns), starting with 0.\n Sort coordinates initially by rows in ascending order.\n Also, sort coordinates of the row by columns in descending order.\n \n Examples:\n get_row([\n [1,2,3,4,5,6],\n [1,2,3,4,1,6],\n [1,2,3,4,5,1]\n ], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n get_row([], 1) == []\n get_row([[], [1], [1, 2, 3]], 3) == [(2, 2)]\n \"\"\"\nfunction get_row(lst::Vector{Vector{Int64}}, x::Int64)::Vector{Tuple{Int64, Int64}} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = get_row;\n\t@test(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)])\n\t@test(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6]], 2) == [(0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1)])\n\t@test(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 1, 3, 4, 5, 6], [1, 2, 1, 4, 5, 6], [1, 2, 3, 1, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1) == [(0, 0), (1, 0), (2, 1), (2, 0), (3, 2), (3, 0), (4, 3), (4, 0), (5, 4), (5, 0), (6, 5), (6, 0)])\n\t@test(candidate(Vector{Vector{Int64}}([]), 1) == Vector{Tuple{Int64, Int64}}([]))\n\t@test(candidate([[1]], 2) == Vector{Tuple{Int64, Int64}}([]))\n\t@test(candidate([[], [1], [1, 2, 3]], 3) == [(2, 2)])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "jl", - "prompt": "\"\"\"\n You're a hungry rabbit, and you already have eaten a certain number of carrots,\n but now you need to eat more carrots to complete the day's meals.\n you should return an array of [ total number of eaten carrots after your meals,\n the number of carrots left after your meals ]\n if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n \n Example:\n * eat(5, 6, 10) -> [11, 4]\n * eat(4, 8, 9) -> [12, 1]\n * eat(1, 10, 10) -> [11, 0]\n * eat(2, 11, 5) -> [7, 0]\n \n Variables:\n @number : integer\n the number of carrots that you have eaten.\n @need : integer\n the number of carrots that you need to eat.\n @remaining : integer\n the number of remaining carrots thet exist in stock\n \n Constrain:\n * 0 <= number <= 1000\n * 0 <= need <= 1000\n * 0 <= remaining <= 1000\n\n Have fun :)\n \"\"\"\nfunction eat(number::Int64, need::Int64, remaining::Int64)::Vector{Int64} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = eat;\n\t@test(candidate(5, 6, 10) == [11, 4])\n\t@test(candidate(4, 8, 9) == [12, 1])\n\t@test(candidate(1, 10, 10) == [11, 0])\n\t@test(candidate(2, 11, 5) == [7, 0])\n\t@test(candidate(4, 5, 7) == [9, 2])\n\t@test(candidate(4, 5, 1) == [5, 0])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "jl", - "prompt": "\"\"\"Given a positive integer N, return the total sum of its digits in binary.\n \n Example\n For N = 1000, the sum of digits will be 1 the output should be \"1\".\n For N = 150, the sum of digits will be 6 the output should be \"110\".\n For N = 147, the sum of digits will be 12 the output should be \"1100\".\n \n Variables:\n @N integer\n Constraints: 0 \u2264 N \u2264 10000.\n Output:\n a string of binary number\n \"\"\"\nfunction solve(N::Int64)::String \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = solve;\n\t@test(candidate(1000) == \"1\")\n\t@test(candidate(150) == \"110\")\n\t@test(candidate(147) == \"1100\")\n\t@test(candidate(333) == \"1001\")\n\t@test(candidate(963) == \"10010\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "jl", - "prompt": "\"\"\"You are given a list of integers.\n You need to find the largest prime value and return the sum of its digits.\n\n Examples:\n For lst = [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] the output should be 10\n For lst = [1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1] the output should be 25\n For lst = [1,3,1,32,5107,34,83278,109,163,23,2323,32,30,1,9,3] the output should be 13\n For lst = [0,724,32,71,99,32,6,0,5,91,83,0,5,6] the output should be 11\n For lst = [0,81,12,3,1,21] the output should be 3\n For lst = [0,8,1,2,1,7] the output should be 7\n \"\"\"\nfunction skjkasdkd(lst::Vector{Int64})::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = skjkasdkd;\n\t@test(candidate([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]) == 10)\n\t@test(candidate([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]) == 25)\n\t@test(candidate([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]) == 13)\n\t@test(candidate([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]) == 11)\n\t@test(candidate([0, 81, 12, 3, 1, 21]) == 3)\n\t@test(candidate([0, 8, 1, 2, 1, 7]) == 7)\n\t@test(candidate([8191]) == 19)\n\t@test(candidate([8191, 123456, 127, 7]) == 19)\n\t@test(candidate([127, 97, 8192]) == 10)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "jl", - "prompt": "\"\"\"\n Given an array arr of integers, find the minimum number of elements that\n need to be changed to make the array palindromic. A palindromic array is an array that\n is read the same backwards and forwards. In one change, you can change one element to any other element.\n\n For example:\n smallest_change([1,2,3,5,4,7,9,6]) == 4\n smallest_change([1, 2, 3, 4, 3, 2, 2]) == 1\n smallest_change([1, 2, 3, 2, 1]) == 0\n \"\"\"\nfunction smallest_change(arr::Vector{Int64})::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = smallest_change;\n\t@test(candidate([1, 2, 3, 5, 4, 7, 9, 6]) == 4)\n\t@test(candidate([1, 2, 3, 4, 3, 2, 2]) == 1)\n\t@test(candidate([1, 4, 2]) == 1)\n\t@test(candidate([1, 4, 4, 2]) == 1)\n\t@test(candidate([1, 2, 3, 2, 1]) == 0)\n\t@test(candidate([3, 1, 1, 3]) == 0)\n\t@test(candidate([1]) == 0)\n\t@test(candidate([0, 1]) == 1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "jl", - "prompt": "\"\"\"It is the last week of the semester and the teacher has to give the grades\n to students. The teacher has been making her own algorithm for grading.\n The only problem is, she has lost the code she used for grading.\n She has given you a list of GPAs for some students and you have to write \n a function that can output a list of letter grades using the following table:\n GPA | Letter grade\n 4.0 A+\n > 3.7 A \n > 3.3 A- \n > 3.0 B+\n > 2.7 B \n > 2.3 B-\n > 2.0 C+\n > 1.7 C\n > 1.3 C-\n > 1.0 D+ \n > 0.7 D \n > 0.0 D-\n 0.0 E\n \n\n Example:\n grade_equation([4.0, 3, 1.7, 2, 3.5]) ==> ['A+', 'B', 'C-', 'C', 'A-']\n \"\"\"\nfunction numerical_letter_grade(grades::Vector{Float64})::Vector{String} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = numerical_letter_grade;\n\t@test(candidate([4.0, 3, 1.7, 2, 3.5]) == [\"A+\", \"B\", \"C-\", \"C\", \"A-\"])\n\t@test(candidate([1.2]) == [\"D+\"])\n\t@test(candidate([0.5]) == [\"D-\"])\n\t@test(candidate([0.0]) == [\"E\"])\n\t@test(candidate([1.0, 0.3, 1.5, 2.8, 3.3]) == [\"D\", \"D-\", \"C-\", \"B\", \"B+\"])\n\t@test(candidate([0.0, 0.7]) == [\"E\", \"D-\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "jl", - "prompt": "\"\"\"\n Given the lengths of the three sides of a triangle. Return the area of\n the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n Otherwise return -1\n Three sides make a valid triangle when the sum of any two sides is greater \n than the third side.\n Example:\n triangle_area(3, 4, 5) == 6.00\n triangle_area(1, 2, 10) == -1\n \"\"\"\nfunction triangle_area(a::Int64, b::Int64, c::Int64)::Float64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = triangle_area;\n\t@test(candidate(3, 4, 5) == 6.0)\n\t@test(candidate(1, 2, 10) == -1)\n\t@test(candidate(4, 8, 5) == 8.18)\n\t@test(candidate(2, 2, 2) == 1.73)\n\t@test(candidate(1, 2, 3) == -1)\n\t@test(candidate(10, 5, 7) == 16.25)\n\t@test(candidate(2, 6, 3) == -1)\n\t@test(candidate(1, 1, 1) == 0.43)\n\t@test(candidate(2, 2, 10) == -1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "jl", - "prompt": "\"\"\"\n Check if two words have the same characters.\n >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n True\n >>> same_chars('abcd', 'dddddddabc')\n True\n >>> same_chars('dddddddabc', 'abcd')\n True\n >>> same_chars('eabcd', 'dddddddabc')\n False\n >>> same_chars('abcd', 'dddddddabce')\n False\n >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc')\n False\n \"\"\"\nfunction same_chars(s0::String, s1::String)::Bool \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = same_chars;\n\t@test(candidate(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\") == true)\n\t@test(candidate(\"abcd\", \"dddddddabc\") == true)\n\t@test(candidate(\"dddddddabc\", \"abcd\") == true)\n\t@test(candidate(\"eabcd\", \"dddddddabc\") == false)\n\t@test(candidate(\"abcd\", \"dddddddabcf\") == false)\n\t@test(candidate(\"eabcdzzzz\", \"dddzzzzzzzddddabc\") == false)\n\t@test(candidate(\"aabb\", \"aaccc\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "jl", - "prompt": "\"\"\"\n Given an array of integers nums, find the minimum sum of any non-empty sub-array\n of nums.\n Example\n minSubArraySum([2, 3, 4, 1, 2, 4]) == 1\n minSubArraySum([-1, -2, -3]) == -6\n \"\"\"\nfunction minSubArraySum(nums::Vector{Int64})::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = minSubArraySum;\n\t@test(candidate([2, 3, 4, 1, 2, 4]) == 1)\n\t@test(candidate([-1, -2, -3]) == -6)\n\t@test(candidate([-1, -2, -3, 2, -10]) == -14)\n\t@test(candidate([-9999999999999999]) == -9999999999999999)\n\t@test(candidate([0, 10, 20, 1000000]) == 0)\n\t@test(candidate([-1, -2, -3, 10, -5]) == -6)\n\t@test(candidate([100, -1, -2, -3, 10, -5]) == -6)\n\t@test(candidate([10, 11, 13, 8, 3, 4]) == 3)\n\t@test(candidate([100, -33, 32, -1, 0, -2]) == -33)\n\t@test(candidate([-10]) == -10)\n\t@test(candidate([7]) == 7)\n\t@test(candidate([1, -1]) == -1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "jl", - "prompt": "\"\"\"Given a string s and a natural number n, you have been tasked to implement \n a function that returns a list of all words from string s that contain exactly \n n consonants, in order these words appear in the string s.\n If the string s is empty then the function should return an empty list.\n Note: you may assume the input string contains only letters and spaces.\n Examples:\n select_words(\"Mary had a little lamb\", 4) ==> [\"little\"]\n select_words(\"Mary had a little lamb\", 3) ==> [\"Mary\", \"lamb\"]\n select_words(\"simple white space\", 2) ==> []\n select_words(\"Hello world\", 4) ==> [\"world\"]\n select_words(\"Uncle sam\", 3) ==> [\"Uncle\"]\n \"\"\"\nfunction select_words(s::String, n::Int64)::Vector{String} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = select_words;\n\t@test(candidate(\"Mary had a little lamb\", 4) == [\"little\"])\n\t@test(candidate(\"Mary had a little lamb\", 3) == [\"Mary\", \"lamb\"])\n\t@test(candidate(\"simple white space\", 2) == Vector{String}([]))\n\t@test(candidate(\"Hello world\", 4) == [\"world\"])\n\t@test(candidate(\"Uncle sam\", 3) == [\"Uncle\"])\n\t@test(candidate(\"\", 4) == Vector{String}([]))\n\t@test(candidate(\"a b c d e f\", 1) == [\"b\", \"c\", \"d\", \"f\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "jl", - "prompt": "\"\"\" Return list of all prefixes from shortest to longest of the input string\n >>> all_prefixes('abc')\n ['a', 'ab', 'abc']\n \"\"\"\nfunction all_prefixes(string::String)::Vector{String} \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = all_prefixes;\n\t@test(candidate(\"\") == Vector{String}([]))\n\t@test(candidate(\"asdfgh\") == [\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"])\n\t@test(candidate(\"WWW\") == [\"W\", \"WW\", \"WWW\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "jl", - "prompt": "\"\"\"\n Create a function that takes a value (string) representing a number\n and returns the closest integer to it. If the number is equidistant\n from two integers, round it away from zero.\n\n Examples\n >>> closest_integer(\"10\")\n 10\n >>> closest_integer(\"15.3\")\n 15\n\n Note:\n Rounding away from zero means that if the given number is equidistant\n from two integers, the one you should return is the one that is the\n farthest from zero. For example closest_integer(\"14.5\") should\n return 15 and closest_integer(\"-14.5\") should return -15.\n \"\"\"\nfunction closest_integer(value::String)::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = closest_integer;\n\t@test(candidate(\"10\") == 10)\n\t@test(candidate(\"14.5\") == 15)\n\t@test(candidate(\"-15.5\") == -16)\n\t@test(candidate(\"15.3\") == 15)\n\t@test(candidate(\"0\") == 0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "jl", - "prompt": "\"\"\"Create a function which takes a string representing a file's name, and returns\n 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n A file's name is considered to be valid if and only if all the following conditions \n are met:\n - There should not be more than three digits ('0'-'9') in the file's name.\n - The file's name contains exactly one dot '.'\n - The substring before the dot should not be empty, and it starts with a letter from \n the latin alphapet ('a'-'z' and 'A'-'Z').\n - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n Examples:\n file_name_check(\"example.txt\") # => 'Yes'\n file_name_check(\"1example.dll\") # => 'No' (the name should start with a latin alphapet letter)\n \"\"\"\nfunction file_name_check(file_name::String)::String \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = file_name_check;\n\t@test(candidate(\"example.txt\") == \"Yes\")\n\t@test(candidate(\"1example.dll\") == \"No\")\n\t@test(candidate(\"s1sdf3.asd\") == \"No\")\n\t@test(candidate(\"K.dll\") == \"Yes\")\n\t@test(candidate(\"MY16FILE3.exe\") == \"Yes\")\n\t@test(candidate(\"His12FILE94.exe\") == \"No\")\n\t@test(candidate(\"_Y.txt\") == \"No\")\n\t@test(candidate(\"?aREYA.exe\") == \"No\")\n\t@test(candidate(\"/this_is_valid.dll\") == \"No\")\n\t@test(candidate(\"this_is_valid.wow\") == \"No\")\n\t@test(candidate(\"this_is_valid.txt\") == \"Yes\")\n\t@test(candidate(\"this_is_valid.txtexe\") == \"No\")\n\t@test(candidate(\"#this2_i4s_5valid.ten\") == \"No\")\n\t@test(candidate(\"@this1_is6_valid.exe\") == \"No\")\n\t@test(candidate(\"this_is_12valid.6exe4.txt\") == \"No\")\n\t@test(candidate(\"all.exe.txt\") == \"No\")\n\t@test(candidate(\"I563_No.exe\") == \"Yes\")\n\t@test(candidate(\"Is3youfault.txt\") == \"Yes\")\n\t@test(candidate(\"no_one#knows.dll\") == \"Yes\")\n\t@test(candidate(\"1I563_Yes3.exe\") == \"No\")\n\t@test(candidate(\"I563_Yes3.txtt\") == \"No\")\n\t@test(candidate(\"final..txt\") == \"No\")\n\t@test(candidate(\"final132\") == \"No\")\n\t@test(candidate(\"_f4indsartal132.\") == \"No\")\n\t@test(candidate(\".txt\") == \"No\")\n\t@test(candidate(\"s.\") == \"No\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "jl", - "prompt": "\"\"\"You are given two intervals,\n where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n The given intervals are closed which means that the interval (start, end)\n includes both start and end.\n For each given interval, it is assumed that its start is less or equal its end.\n Your task is to determine whether the length of intersection of these two \n intervals is a prime number.\n Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n which its length is 1, which not a prime number.\n If the length of the intersection is a prime number, return \"YES\",\n otherwise, return \"NO\".\n If the two intervals don't intersect, return \"NO\".\n\n\n [input/output] samples:\n intersection((1, 2), (2, 3)) ==> \"NO\"\n intersection((-1, 1), (0, 4)) ==> \"NO\"\n intersection((-3, -1), (-5, 5)) ==> \"YES\"\n \"\"\"\nfunction intersection(interval1::Tuple{Int64, Int64}, interval2::Tuple{Int64, Int64})::String \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = intersection;\n\t@test(candidate((1, 2), (2, 3)) == \"NO\")\n\t@test(candidate((-1, 1), (0, 4)) == \"NO\")\n\t@test(candidate((-3, -1), (-5, 5)) == \"YES\")\n\t@test(candidate((-2, 2), (-4, 0)) == \"YES\")\n\t@test(candidate((-11, 2), (-1, -1)) == \"NO\")\n\t@test(candidate((1, 2), (3, 5)) == \"NO\")\n\t@test(candidate((1, 2), (1, 2)) == \"NO\")\n\t@test(candidate((-2, -2), (-3, -2)) == \"NO\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "jl", - "prompt": "\"\"\"Return the largest prime factor of n. Assume n > 1 and is not a prime.\n >>> largest_prime_factor(13195)\n 29\n >>> largest_prime_factor(2048)\n 2\n \"\"\"\nfunction largest_prime_factor(n::Int64)::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = largest_prime_factor;\n\t@test(candidate(15) == 5)\n\t@test(candidate(27) == 3)\n\t@test(candidate(63) == 7)\n\t@test(candidate(330) == 11)\n\t@test(candidate(13195) == 29)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "jl", - "prompt": "\"\"\" Given a string, find out how many distinct characters (regardless of case) does it consist of\n >>> count_distinct_characters('xyzXYZ')\n 3\n >>> count_distinct_characters('Jerry')\n 4\n \"\"\"\nfunction count_distinct_characters(string::String)::Int64 \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = count_distinct_characters;\n\t@test(candidate(\"\") == 0)\n\t@test(candidate(\"abcde\") == 5)\n\t@test(candidate(\"abcdecadeCADE\") == 5)\n\t@test(candidate(\"aaaaAAAAaaaa\") == 1)\n\t@test(candidate(\"Jerry jERRY JeRRRY\") == 5)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "jl", - "prompt": "\"\"\" You're given a list of deposit and withdrawal operations on a bank account that starts with\n zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n at that point function should return True. Otherwise it should return False.\n >>> below_zero([1, 2, 3])\n False\n >>> below_zero([1, 2, -4, 5])\n True\n \"\"\"\nfunction below_zero(operations::Vector{Int64})::Bool \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = below_zero;\n\t@test(candidate(Vector{Int64}([])) == false)\n\t@test(candidate([1, 2, -3, 1, 2, -3]) == false)\n\t@test(candidate([1, 2, -4, 5, 6]) == true)\n\t@test(candidate([1, -1, 2, -2, 5, -5, 4, -4]) == false)\n\t@test(candidate([1, -1, 2, -2, 5, -5, 4, -5]) == true)\n\t@test(candidate([1, -2, 2, -2, 5, -5, 4, -4]) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "jl", - "prompt": "\"\"\" Find the shortest palindrome that begins with a supplied string.\n Algorithm idea is simple:\n - Find the longest postfix of supplied string that is a palindrome.\n - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n >>> make_palindrome('')\n ''\n >>> make_palindrome('cat')\n 'catac'\n >>> make_palindrome('cata')\n 'catac'\n \"\"\"\nfunction make_palindrome(string::String)::String \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = make_palindrome;\n\t@test(candidate(\"\") == \"\")\n\t@test(candidate(\"x\") == \"x\")\n\t@test(candidate(\"xyz\") == \"xyzyx\")\n\t@test(candidate(\"xyx\") == \"xyx\")\n\t@test(candidate(\"jerry\") == \"jerryrrej\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "jl", - "prompt": "\"\"\"\n Given a positive integer, obtain its roman numeral equivalent as a string,\n and return it in lowercase.\n Restrictions: 1 <= num <= 1000\n\n Examples:\n >>> int_to_mini_roman(19) == 'xix'\n >>> int_to_mini_roman(152) == 'clii'\n >>> int_to_mini_roman(426) == 'cdxxvi'\n \"\"\"\nfunction int_to_mini_roman(number::Int64)::String \n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = int_to_mini_roman;\n\t@test(candidate(19) == \"xix\")\n\t@test(candidate(152) == \"clii\")\n\t@test(candidate(251) == \"ccli\")\n\t@test(candidate(426) == \"cdxxvi\")\n\t@test(candidate(500) == \"d\")\n\t@test(candidate(1) == \"i\")\n\t@test(candidate(4) == \"iv\")\n\t@test(candidate(43) == \"xliii\")\n\t@test(candidate(90) == \"xc\")\n\t@test(candidate(94) == \"xciv\")\n\t@test(candidate(532) == \"dxxxii\")\n\t@test(candidate(900) == \"cm\")\n\t@test(candidate(994) == \"cmxciv\")\n\t@test(candidate(1000) == \"m\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - } -] \ No newline at end of file diff --git a/data/jl-remove.json b/data/jl-remove.json deleted file mode 100644 index 006ad7a4c37c480891abd4ccfda7712100b1151a..0000000000000000000000000000000000000000 --- a/data/jl-remove.json +++ /dev/null @@ -1,2186 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "jl", - "prompt": "\"\"\" For a given number n, find the largest number that divides n evenly, smaller than n\n \"\"\"\nfunction largest_divisor(n::Int64)::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = largest_divisor;\n\t@test(candidate(3) == 1)\n\t@test(candidate(7) == 1)\n\t@test(candidate(10) == 5)\n\t@test(candidate(100) == 50)\n\t@test(candidate(49) == 7)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_47_median", - "language": "jl", - "prompt": "\"\"\"Return median of elements in the list l.\n \"\"\"\nfunction median(l::Vector{Int64})::Float64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = median;\n\t@test(candidate([3, 1, 2, 4, 5]) == 3)\n\t@test(candidate([-10, 4, 6, 1000, 10, 20]) == 8.0)\n\t@test(candidate([5]) == 5)\n\t@test(candidate([6, 5]) == 5.5)\n\t@test(candidate([8, 1, 3, 9, 9, 2, 7]) == 7)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "jl", - "prompt": "\"\"\"Return maximum element in the list.\n \"\"\"\nfunction max_element(l::Vector{Int64})::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = max_element;\n\t@test(candidate([1, 2, 3]) == 3)\n\t@test(candidate([5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]) == 124)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "jl", - "prompt": "\"\"\"Create a function which returns the largest index of an element which\n is not greater than or equal to the element immediately preceding it. If\n no such element exists then return -1. The given array will not contain\n duplicate values.\n\n Examples:\n \"\"\"\nfunction can_arrange(arr::Vector{Int64})::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = can_arrange;\n\t@test(candidate([1, 2, 4, 3, 5]) == 3)\n\t@test(candidate([1, 2, 4, 5]) == -1)\n\t@test(candidate([1, 4, 2, 5, 6, 7, 8, 9, 10]) == 2)\n\t@test(candidate([4, 8, 5, 7, 3]) == 4)\n\t@test(candidate(Vector{Int64}([])) == -1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "jl", - "prompt": "\"\"\"\n Create a function that returns True if the last character\n of a given string is an alphabetical character and is not\n a part of a word, and False otherwise.\n Note: \"word\" is a group of characters separated by space.\n\n Examples:\n \"\"\"\nfunction check_if_last_char_is_a_letter(txt::String)::Bool \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = check_if_last_char_is_a_letter;\n\t@test(candidate(\"apple\") == false)\n\t@test(candidate(\"apple pi e\") == true)\n\t@test(candidate(\"eeeee\") == false)\n\t@test(candidate(\"A\") == true)\n\t@test(candidate(\"Pumpkin pie \") == false)\n\t@test(candidate(\"Pumpkin pie 1\") == false)\n\t@test(candidate(\"\") == false)\n\t@test(candidate(\"eeeee e \") == false)\n\t@test(candidate(\"apple pie\") == false)\n\t@test(candidate(\"apple pi e \") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "jl", - "prompt": "\"\"\"Return true if a given number is prime, and false otherwise.\n \"\"\"\nfunction is_prime(n::Int64)::Bool \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_prime;\n\t@test(candidate(6) == false)\n\t@test(candidate(101) == true)\n\t@test(candidate(11) == true)\n\t@test(candidate(13441) == true)\n\t@test(candidate(61) == true)\n\t@test(candidate(4) == false)\n\t@test(candidate(1) == false)\n\t@test(candidate(5) == true)\n\t@test(candidate(11) == true)\n\t@test(candidate(17) == true)\n\t@test(candidate(85) == false)\n\t@test(candidate(77) == false)\n\t@test(candidate(255379) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "jl", - "prompt": "\"\"\"Given a list of positive integers x. return a sorted list of all \n elements that hasn't any even digit.\n\n Note: Returned list should be sorted in increasing order.\n \n For example:\n \"\"\"\nfunction unique_digits(x::Vector{Int64})::Vector{Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = unique_digits;\n\t@test(candidate([15, 33, 1422, 1]) == [1, 15, 33])\n\t@test(candidate([152, 323, 1422, 10]) == Vector{Int64}([]))\n\t@test(candidate([12345, 2033, 111, 151]) == [111, 151])\n\t@test(candidate([135, 103, 31]) == [31, 135])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "jl", - "prompt": "\"\"\" Input are two strings a and b consisting only of 1s and 0s.\n Perform binary XOR on these inputs and return result also as a string.\n \"\"\"\nfunction string_xor(a::String, b::String)::String \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = string_xor;\n\t@test(candidate(\"111000\", \"101010\") == \"010010\")\n\t@test(candidate(\"1\", \"1\") == \"0\")\n\t@test(candidate(\"0101\", \"0000\") == \"0101\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "jl", - "prompt": "\"\"\"sum_to_n is a function that sums numbers from 1 to n.\n \"\"\"\nfunction sum_to_n(n::Int64)::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = sum_to_n;\n\t@test(candidate(1) == 1)\n\t@test(candidate(6) == 21)\n\t@test(candidate(11) == 66)\n\t@test(candidate(30) == 465)\n\t@test(candidate(100) == 5050)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "jl", - "prompt": "\"\"\"\n Given a list of numbers, return the sum of squares of the numbers\n in the list that are odd. Ignore numbers that are negative or not integers.\n \n \n If the input list is empty, return 0.\n \"\"\"\nfunction double_the_difference(lst::Vector{Float64})::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = double_the_difference;\n\t@test(candidate(Vector{Float64}([])) == 0)\n\t@test(candidate([5.0, 4.0]) == 25)\n\t@test(candidate([0.1, 0.2, 0.3]) == 0)\n\t@test(candidate([-10.0, -20.0, -30.0]) == 0)\n\t@test(candidate([-1.0, -2.0, 8.0]) == 0)\n\t@test(candidate([0.2, 3.0, 5.0]) == 34)\n\t@test(candidate([-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]) == 165)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "jl", - "prompt": "\"\"\" Return length of given string\n \"\"\"\nfunction strlen(string::String)::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = strlen;\n\t@test(candidate(\"\") == 0)\n\t@test(candidate(\"x\") == 1)\n\t@test(candidate(\"asdasnakj\") == 9)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "jl", - "prompt": "\"\"\"\n You'll be given a string of words, and your task is to count the number\n of boredoms. A boredom is a sentence that starts with the word \"I\".\n Sentences are delimited by '.', '?' or '!'.\n \n For example:\n \"\"\"\nfunction is_bored(S::String)::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_bored;\n\t@test(candidate(\"Hello world\") == 0)\n\t@test(candidate(\"Is the sky blue?\") == 0)\n\t@test(candidate(\"I love It !\") == 1)\n\t@test(candidate(\"bIt\") == 0)\n\t@test(candidate(\"I feel good today. I will be productive. will kill It\") == 2)\n\t@test(candidate(\"You and I are going for a walk\") == 0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "jl", - "prompt": "\"\"\"Write a function vowels_count which takes a string representing\n a word as input and returns the number of vowels in the string.\n Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n vowel, but only when it is at the end of the given word.\n\n Example:\n \"\"\"\nfunction vowels_count(s::String)::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = vowels_count;\n\t@test(candidate(\"abcde\") == 2)\n\t@test(candidate(\"Alone\") == 3)\n\t@test(candidate(\"key\") == 2)\n\t@test(candidate(\"bye\") == 1)\n\t@test(candidate(\"keY\") == 2)\n\t@test(candidate(\"bYe\") == 1)\n\t@test(candidate(\"ACEDY\") == 3)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "jl", - "prompt": "\"\"\"Return n-th Fibonacci number.\n \"\"\"\nfunction fib(n::Int64)::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = fib;\n\t@test(candidate(10) == 55)\n\t@test(candidate(1) == 1)\n\t@test(candidate(8) == 21)\n\t@test(candidate(11) == 89)\n\t@test(candidate(12) == 144)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "jl", - "prompt": "\"\"\"Your task is to implement a function that will simplify the expression\n x * n. The function returns True if x * n evaluates to a whole number and False\n otherwise. Both x and n, are string representation of a fraction, and have the following format,\n / where both numerator and denominator are positive whole numbers.\n\n You can assume that x, and n are valid fractions, and do not have zero as denominator.\n\n \"\"\"\nfunction simplify(x::String, n::String)::Bool \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = simplify;\n\t@test(candidate(\"1/5\", \"5/1\") == true)\n\t@test(candidate(\"1/6\", \"2/1\") == false)\n\t@test(candidate(\"5/1\", \"3/1\") == true)\n\t@test(candidate(\"7/10\", \"10/2\") == false)\n\t@test(candidate(\"2/10\", \"50/10\") == true)\n\t@test(candidate(\"7/2\", \"4/2\") == true)\n\t@test(candidate(\"11/6\", \"6/1\") == true)\n\t@test(candidate(\"2/3\", \"5/2\") == false)\n\t@test(candidate(\"5/2\", \"3/5\") == false)\n\t@test(candidate(\"2/4\", \"8/4\") == true)\n\t@test(candidate(\"2/4\", \"4/2\") == true)\n\t@test(candidate(\"1/5\", \"5/1\") == true)\n\t@test(candidate(\"1/5\", \"1/5\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "jl", - "prompt": "\"\"\"\n Given a string s, count the number of uppercase vowels in even indices.\n \n For example:\n \"\"\"\nfunction count_upper(s::String)::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = count_upper;\n\t@test(candidate(\"aBCdEf\") == 1)\n\t@test(candidate(\"abcdefg\") == 0)\n\t@test(candidate(\"dBBE\") == 0)\n\t@test(candidate(\"B\") == 0)\n\t@test(candidate(\"U\") == 1)\n\t@test(candidate(\"\") == 0)\n\t@test(candidate(\"EEEE\") == 2)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "jl", - "prompt": "\"\"\"\n You are given a rectangular grid of wells. Each row represents a single well,\n and each 1 in a row represents a single unit of water.\n Each well has a corresponding bucket that can be used to extract water from it, \n and all buckets have the same capacity.\n Your task is to use the buckets to empty the wells.\n Output the number of times you need to lower the buckets.\n\n Example 1:\n \n Example 2:\n \n Example 3:\n \n Constraints:\n * all wells have the same length\n * 1 <= grid.length <= 10^2\n * 1 <= grid[:,1].length <= 10^2\n * grid[i][j] -> 0 | 1\n * 1 <= capacity <= 10\n \"\"\"\nfunction max_fill(grid::Vector{Vector{Int64}}, capacity::Int64)::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = max_fill;\n\t@test(candidate([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1) == 6)\n\t@test(candidate([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2) == 5)\n\t@test(candidate([[0, 0, 0], [0, 0, 0]], 5) == 0)\n\t@test(candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 2) == 4)\n\t@test(candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 9) == 2)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "jl", - "prompt": "\"\"\"\n Given an array arr of integers and a positive integer k, return a sorted list \n of length k with the maximum k numbers in arr.\n\n Example 1:\n\n \n Example 2:\n\n \n Example 3:\n\n \n Note:\n 1. The length of the array will be in the range of [1, 1000].\n 2. The elements in the array will be in the range of [-1000, 1000].\n 3. 0 <= k <= len(arr)\n \"\"\"\nfunction maximum(arr::Vector{Int64}, k::Int64)::Vector{Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = maximum;\n\t@test(candidate([-3, -4, 5], 3) == [-4, -3, 5])\n\t@test(candidate([4, -4, 4], 2) == [4, 4])\n\t@test(candidate([-3, 2, 1, 2, -1, -2, 1], 1) == [2])\n\t@test(candidate([123, -123, 20, 0, 1, 2, -3], 3) == [2, 20, 123])\n\t@test(candidate([-123, 20, 0, 1, 2, -3], 4) == [0, 1, 2, 20])\n\t@test(candidate([5, 15, 0, 3, -13, -8, 0], 7) == [-13, -8, 0, 0, 3, 5, 15])\n\t@test(candidate([-1, 0, 2, 5, 3, -10], 2) == [3, 5])\n\t@test(candidate([1, 0, 5, -7], 1) == [5])\n\t@test(candidate([4, -4], 2) == [-4, 4])\n\t@test(candidate([-10, 10], 2) == [-10, 10])\n\t@test(candidate([1, 2, 3, -23, 243, -400, 0], 0) == Vector{Int64}([]))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "jl", - "prompt": "\"\"\"\n Write a function that takes a message, and encodes in such a \n way that it swaps case of all letters, replaces all vowels in \n the message with the letter that appears 2 places ahead of that \n vowel in the english alphabet. \n Assume only letters. \n \n Examples:\n \"\"\"\nfunction encode(message::String)::String \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = encode;\n\t@test(candidate(\"TEST\") == \"tgst\")\n\t@test(candidate(\"Mudasir\") == \"mWDCSKR\")\n\t@test(candidate(\"YES\") == \"ygs\")\n\t@test(candidate(\"This is a message\") == \"tHKS KS C MGSSCGG\")\n\t@test(candidate(\"I DoNt KnOw WhAt tO WrItE\") == \"k dQnT kNqW wHcT Tq wRkTg\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "jl", - "prompt": "\"\"\"\n remove_vowels is a function that takes string and returns string without vowels.\n \"\"\"\nfunction remove_vowels(text::String)::String \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = remove_vowels;\n\t@test(candidate(\"\") == \"\")\n\t@test(candidate(\"abcdef\nghijklm\") == \"bcdf\nghjklm\")\n\t@test(candidate(\"fedcba\") == \"fdcb\")\n\t@test(candidate(\"eeeee\") == \"\")\n\t@test(candidate(\"acBAA\") == \"cB\")\n\t@test(candidate(\"EcBOO\") == \"cB\")\n\t@test(candidate(\"ybcd\") == \"ybcd\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "jl", - "prompt": "\"\"\"Return only positive numbers in the list.\n \"\"\"\nfunction get_positive(l::Vector{Int64})::Vector{Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = get_positive;\n\t@test(candidate([-1, -2, 4, 5, 6]) == [4, 5, 6])\n\t@test(candidate([5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]) == [5, 3, 2, 3, 3, 9, 123, 1])\n\t@test(candidate([-1, -2]) == Vector{Int64}([]))\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "jl", - "prompt": "\"\"\" Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n \"\"\"\nfunction string_sequence(n::Int64)::String \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = string_sequence;\n\t@test(candidate(0) == \"0\")\n\t@test(candidate(3) == \"0 1 2 3\")\n\t@test(candidate(10) == \"0 1 2 3 4 5 6 7 8 9 10\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "jl", - "prompt": "\"\"\"\n Given a positive integer n, you have to make a pile of n levels of stones.\n The first level has n stones.\n The number of stones in the next level is:\n - the next odd number if n is odd.\n - the next even number if n is even.\n Return the number of stones in each level in a list, where element at index\n i represents the number of stones in the level (i+1).\n\n Examples:\n \"\"\"\nfunction make_a_pile(n::Int64)::Vector{Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = make_a_pile;\n\t@test(candidate(3) == [3, 5, 7])\n\t@test(candidate(4) == [4, 6, 8, 10])\n\t@test(candidate(5) == [5, 7, 9, 11, 13])\n\t@test(candidate(6) == [6, 8, 10, 12, 14, 16])\n\t@test(candidate(8) == [8, 10, 12, 14, 16, 18, 20, 22])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "jl", - "prompt": "\"\"\"Task\n 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\n then check if the result string is palindrome.\n A string is called palindrome if it reads the same backward as forward.\n You should return a tuple containing the result string and True/False for the check.\n Example\n \"\"\"\nfunction reverse_delete(s::String, c::String)::Tuple{String, Bool} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = reverse_delete;\n\t@test(candidate(\"abcde\", \"ae\") == (\"bcd\", false))\n\t@test(candidate(\"abcdef\", \"b\") == (\"acdef\", false))\n\t@test(candidate(\"abcdedcba\", \"ab\") == (\"cdedc\", true))\n\t@test(candidate(\"dwik\", \"w\") == (\"dik\", false))\n\t@test(candidate(\"a\", \"a\") == (\"\", true))\n\t@test(candidate(\"abcdedcba\", \"\") == (\"abcdedcba\", true))\n\t@test(candidate(\"abcdedcba\", \"v\") == (\"abcdedcba\", true))\n\t@test(candidate(\"vabba\", \"v\") == (\"abba\", true))\n\t@test(candidate(\"mamma\", \"mia\") == (\"\", true))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "jl", - "prompt": "\"\"\" For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n \"\"\"\nfunction flip_case(string::String)::String \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = flip_case;\n\t@test(candidate(\"\") == \"\")\n\t@test(candidate(\"Hello!\") == \"hELLO!\")\n\t@test(candidate(\"These violent delights have violent ends\") == \"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "jl", - "prompt": "\"\"\"You are given a string s.\n if s[i] is a letter, reverse its case from lower to upper or vise versa, \n otherwise keep it as it is.\n If the string contains no letters, reverse the string.\n The function should return the resulted string.\n Examples\n \"\"\"\nfunction solve(s::String)::String \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = solve;\n\t@test(candidate(\"AsDf\") == \"aSdF\")\n\t@test(candidate(\"1234\") == \"4321\")\n\t@test(candidate(\"ab\") == \"AB\")\n\t@test(candidate(\"#a@C\") == \"#A@c\")\n\t@test(candidate(\"#AsdfW^45\") == \"#aSDFw^45\")\n\t@test(candidate(\"#6@2\") == \"2@6#\")\n\t@test(candidate(\"#$a^D\") == \"#$A^d\")\n\t@test(candidate(\"#ccc\") == \"#CCC\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "jl", - "prompt": "\"\"\" Filter an input list of strings only for ones that start with a given prefix.\n \"\"\"\nfunction filter_by_prefix(strings::Vector{String}, prefix::String)::Vector{String} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = filter_by_prefix;\n\t@test(candidate(Vector{String}([]), \"john\") == Vector{String}([]))\n\t@test(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\") == [\"xxx\", \"xxxAAA\", \"xxx\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "jl", - "prompt": "\"\"\"This function takes two positive numbers x and y and returns the\n biggest even integer number that is in the range [x, y] inclusive. If \n there's no such number, then the function should return -1.\n\n For example:\n \"\"\"\nfunction choose_num(x::Int64, y::Int64)::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = choose_num;\n\t@test(candidate(12, 15) == 14)\n\t@test(candidate(13, 12) == -1)\n\t@test(candidate(33, 12354) == 12354)\n\t@test(candidate(5234, 5233) == -1)\n\t@test(candidate(6, 29) == 28)\n\t@test(candidate(27, 10) == -1)\n\t@test(candidate(7, 7) == -1)\n\t@test(candidate(546, 546) == 546)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "jl", - "prompt": "\"\"\"\n You are given a string representing a sentence,\n the sentence contains some words separated by a space,\n and you have to return a string that contains the words from the original sentence,\n whose lengths are prime numbers,\n the order of the words in the new string should be the same as the original one.\n\n Example 1:\n \n Example 2:\n \n Constraints:\n * 1 <= len(sentence) <= 100\n * sentence contains only letters\n \"\"\"\nfunction words_in_sentence(sentence::String)::String \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = words_in_sentence;\n\t@test(candidate(\"This is a test\") == \"is\")\n\t@test(candidate(\"lets go for swimming\") == \"go for\")\n\t@test(candidate(\"there is no place available here\") == \"there is no place\")\n\t@test(candidate(\"Hi I am Hussein\") == \"Hi am Hussein\")\n\t@test(candidate(\"go for it\") == \"go for it\")\n\t@test(candidate(\"here\") == \"\")\n\t@test(candidate(\"here is\") == \"is\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "jl", - "prompt": "\"\"\" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n \"\"\"\nfunction intersperse(numbers::Vector{Int64}, delimeter::Int64)::Vector{Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = intersperse;\n\t@test(candidate(Vector{Int64}([]), 7) == Vector{Int64}([]))\n\t@test(candidate([5, 6, 3, 2], 8) == [5, 8, 6, 8, 3, 8, 2])\n\t@test(candidate([2, 2, 2], 2) == [2, 2, 2, 2, 2])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "jl", - "prompt": "\"\"\"Your task is to write a function that returns true if a number x is a simple\n power of n and false in other cases.\n x is a simple power of n if n**int=x\n For example:\n \"\"\"\nfunction is_simple_power(x::Int64, n::Int64)::Bool \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_simple_power;\n\t@test(candidate(16, 2) == true)\n\t@test(candidate(143214, 16) == false)\n\t@test(candidate(4, 2) == true)\n\t@test(candidate(9, 3) == true)\n\t@test(candidate(16, 4) == true)\n\t@test(candidate(24, 2) == false)\n\t@test(candidate(128, 4) == false)\n\t@test(candidate(12, 6) == false)\n\t@test(candidate(1, 1) == true)\n\t@test(candidate(1, 12) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "jl", - "prompt": "\"\"\"Write a function that returns true if the given number is the multiplication of 3 prime numbers\n and false otherwise.\n Knowing that (a) is less then 100. \n Example:\n 30 = 2 * 3 * 5\n \"\"\"\nfunction is_multiply_prime(a::Int64)::Bool \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_multiply_prime;\n\t@test(candidate(5) == false)\n\t@test(candidate(30) == true)\n\t@test(candidate(8) == true)\n\t@test(candidate(10) == false)\n\t@test(candidate(125) == true)\n\t@test(candidate(105) == true)\n\t@test(candidate(126) == false)\n\t@test(candidate(729) == false)\n\t@test(candidate(891) == false)\n\t@test(candidate(1001) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "jl", - "prompt": "\"\"\"\n Given the lengths of the three sides of a triangle. Return True if the three\n sides form a right-angled triangle, False otherwise.\n A right-angled triangle is a triangle in which one angle is right angle or \n 90 degree.\n Example:\n \"\"\"\nfunction right_angle_triangle(a::Int64, b::Int64, c::Int64)::Bool \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = right_angle_triangle;\n\t@test(candidate(3, 4, 5) == true)\n\t@test(candidate(1, 2, 3) == false)\n\t@test(candidate(10, 6, 8) == true)\n\t@test(candidate(2, 2, 2) == false)\n\t@test(candidate(7, 24, 25) == true)\n\t@test(candidate(10, 5, 7) == false)\n\t@test(candidate(5, 12, 13) == true)\n\t@test(candidate(15, 8, 17) == true)\n\t@test(candidate(48, 55, 73) == true)\n\t@test(candidate(1, 1, 1) == false)\n\t@test(candidate(2, 2, 10) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "jl", - "prompt": "\"\"\"\n Create a function that takes 3 numbers.\n Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n Returns false in any other cases.\n \n Examples\n \n \n \n \n\n \n \"\"\"\nfunction any_int(x::Float64, y::Float64, z::Float64)::Bool \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = any_int;\n\t@test(candidate(2, 3, 1) == true)\n\t@test(candidate(2.5, 2, 3) == false)\n\t@test(candidate(1.5, 5, 3.5) == false)\n\t@test(candidate(2, 6, 2) == false)\n\t@test(candidate(4, 2, 2) == true)\n\t@test(candidate(2.2, 2.2, 2.2) == false)\n\t@test(candidate(-4, 6, 2) == true)\n\t@test(candidate(2, 1, 1) == true)\n\t@test(candidate(3, 4, 7) == true)\n\t@test(candidate(3.0, 4, 7) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "jl", - "prompt": "\"\"\"This function takes a list l and returns a list l' such that\n l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n to the values of the corresponding indicies of l, but sorted.\n \"\"\"\nfunction sort_third(l::Vector{Int64})::Vector{Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = sort_third;\n\t@test(candidate([5, 6, 3, 4, 8, 9, 2]) == [2, 6, 3, 4, 8, 9, 5])\n\t@test(candidate([5, 8, 3, 4, 6, 9, 2]) == [2, 8, 3, 4, 6, 9, 5])\n\t@test(candidate([5, 6, 9, 4, 8, 3, 2]) == [2, 6, 9, 4, 8, 3, 5])\n\t@test(candidate([5, 6, 3, 4, 8, 9, 2, 1]) == [2, 6, 3, 4, 8, 9, 5, 1])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_53_add", - "language": "jl", - "prompt": "\"\"\"Add two numbers x and y\n \"\"\"\nfunction add(x::Int64, y::Int64)::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = add;\n\t@test(candidate(0, 1) == 1)\n\t@test(candidate(1, 0) == 1)\n\t@test(candidate(2, 3) == 5)\n\t@test(candidate(5, 7) == 12)\n\t@test(candidate(7, 5) == 12)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_69_search", - "language": "jl", - "prompt": "\"\"\"\n You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n zero, and has a frequency greater than or equal to the value of the integer itself. \n The frequency of an integer is the number of times it appears in the list.\n If no such a value exist, return -1.\n Examples:\n \"\"\"\nfunction search(lst::Vector{Int64})::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = search;\n\t@test(candidate([5, 5, 5, 5, 1]) == 1)\n\t@test(candidate([4, 1, 4, 1, 4, 4]) == 4)\n\t@test(candidate([3, 3]) == -1)\n\t@test(candidate([8, 8, 8, 8, 8, 8, 8, 8]) == 8)\n\t@test(candidate([2, 3, 3, 2, 2]) == 2)\n\t@test(candidate([2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]) == 1)\n\t@test(candidate([3, 2, 8, 2]) == 2)\n\t@test(candidate([6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]) == 1)\n\t@test(candidate([8, 8, 3, 6, 5, 6, 4]) == -1)\n\t@test(candidate([6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]) == 1)\n\t@test(candidate([1, 9, 10, 1, 3]) == 1)\n\t@test(candidate([6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]) == 5)\n\t@test(candidate([1]) == 1)\n\t@test(candidate([8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]) == 4)\n\t@test(candidate([2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]) == 2)\n\t@test(candidate([1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]) == 1)\n\t@test(candidate([9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]) == 4)\n\t@test(candidate([2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]) == 4)\n\t@test(candidate([9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]) == 2)\n\t@test(candidate([5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]) == -1)\n\t@test(candidate([10]) == -1)\n\t@test(candidate([9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]) == 2)\n\t@test(candidate([5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]) == 1)\n\t@test(candidate([7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]) == 1)\n\t@test(candidate([3, 10, 10, 9, 2]) == -1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "jl", - "prompt": "\"\"\"Write a function that takes a string and returns True if the string\n length is a prime number or False otherwise\n Examples\n \"\"\"\nfunction prime_length(string::String)::Bool \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = prime_length;\n\t@test(candidate(\"Hello\") == true)\n\t@test(candidate(\"abcdcba\") == true)\n\t@test(candidate(\"kittens\") == true)\n\t@test(candidate(\"orange\") == false)\n\t@test(candidate(\"wow\") == true)\n\t@test(candidate(\"world\") == true)\n\t@test(candidate(\"MadaM\") == true)\n\t@test(candidate(\"Wow\") == true)\n\t@test(candidate(\"\") == false)\n\t@test(candidate(\"HI\") == true)\n\t@test(candidate(\"go\") == true)\n\t@test(candidate(\"gogo\") == false)\n\t@test(candidate(\"aaaaaaaaaaaaaaa\") == false)\n\t@test(candidate(\"Madam\") == true)\n\t@test(candidate(\"M\") == false)\n\t@test(candidate(\"0\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_58_common", - "language": "jl", - "prompt": "\"\"\"Return sorted unique common elements for two lists.\n \n \"\"\"\nfunction common(l1::Vector{Int64}, l2::Vector{Int64})::Vector{Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = common;\n\t@test(candidate([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]) == [1, 5, 653])\n\t@test(candidate([5, 3, 2, 8], [3, 2]) == [2, 3])\n\t@test(candidate([4, 3, 2, 8], [3, 2, 4]) == [2, 3, 4])\n\t@test(candidate([4, 3, 2, 8], Vector{Int64}([])) == Vector{Int64}([]))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "jl", - "prompt": "\"\"\"The Brazilian factorial is defined as:\n brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n where n > 0\n\n For example:\n \n The function will receive an integer as input and should return the special\n factorial of this integer.\n \"\"\"\nfunction special_factorial(n::Int64)::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = special_factorial;\n\t@test(candidate(4) == 288)\n\t@test(candidate(5) == 34560)\n\t@test(candidate(7) == 125411328000)\n\t@test(candidate(1) == 1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "jl", - "prompt": "\"\"\"In this problem, you will implement a function that takes two lists of numbers,\n and determines whether it is possible to perform an exchange of elements\n between them to make lst1 a list of only even numbers.\n There is no limit on the number of exchanged elements between lst1 and lst2.\n If it is possible to exchange elements between the lst1 and lst2 to make\n all the elements of lst1 to be even, return \"YES\".\n Otherwise, return \"NO\".\n For example:\n It is assumed that the input lists will be non-empty.\n \"\"\"\nfunction exchange(lst1::Vector{Int64}, lst2::Vector{Int64})::String \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = exchange;\n\t@test(candidate([1, 2, 3, 4], [1, 2, 3, 4]) == \"YES\")\n\t@test(candidate([1, 2, 3, 4], [1, 5, 3, 4]) == \"NO\")\n\t@test(candidate([1, 2, 3, 4], [2, 1, 4, 3]) == \"YES\")\n\t@test(candidate([5, 7, 3], [2, 6, 4]) == \"YES\")\n\t@test(candidate([5, 7, 3], [2, 6, 3]) == \"NO\")\n\t@test(candidate([3, 2, 6, 1, 8, 9], [3, 5, 5, 1, 1, 1]) == \"NO\")\n\t@test(candidate([100, 200], [200, 200]) == \"YES\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "jl", - "prompt": "\"\"\"\n Given a non-empty array of integers arr and an integer k, return\n the sum of the elements with at most two digits from the first k elements of arr.\n\n Example:\n\n \n Constraints:\n 1. 1 <= len(arr) <= 100\n 2. 1 <= k <= len(arr)\n \"\"\"\nfunction add_elements(arr::Vector{Int64}, k::Int64)::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = add_elements;\n\t@test(candidate([1, -2, -3, 41, 57, 76, 87, 88, 99], 3) == -4)\n\t@test(candidate([111, 121, 3, 4000, 5, 6], 2) == 0)\n\t@test(candidate([11, 21, 3, 90, 5, 6, 7, 8, 9], 4) == 125)\n\t@test(candidate([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4) == 24)\n\t@test(candidate([1], 1) == 1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "jl", - "prompt": "\"\"\"A simple program which should return the value of x if n is \n a prime number and should return the value of y otherwise.\n\n Examples:\n \n \"\"\"\nfunction x_or_y(n::Int64, x::Int64, y::Int64)::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = x_or_y;\n\t@test(candidate(7, 34, 12) == 34)\n\t@test(candidate(15, 8, 5) == 5)\n\t@test(candidate(3, 33, 5212) == 33)\n\t@test(candidate(1259, 3, 52) == 3)\n\t@test(candidate(7919, -1, 12) == -1)\n\t@test(candidate(3609, 1245, 583) == 583)\n\t@test(candidate(91, 56, 129) == 129)\n\t@test(candidate(6, 34, 1234) == 1234)\n\t@test(candidate(1, 2, 0) == 0)\n\t@test(candidate(2, 2, 0) == 2)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "jl", - "prompt": "\"\"\"Given length of a side and high return area for a triangle.\n \"\"\"\nfunction triangle_area(a::Int64, h::Int64)::Float64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = triangle_area;\n\t@test(candidate(5, 3) == 7.5)\n\t@test(candidate(2, 2) == 2.0)\n\t@test(candidate(10, 8) == 40.0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "jl", - "prompt": "\"\"\"Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n the last couple centuries. However, what people don't know is Tribonacci sequence.\n Tribonacci sequence is defined by the recurrence:\n tri(1) = 3\n tri(n) = 1 + n / 2, if n is even.\n tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n For example:\n tri(2) = 1 + (2 / 2) = 2\n tri(4) = 3\n tri(3) = tri(2) + tri(1) + tri(4)\n = 2 + 3 + 3 = 8 \n You are given a non-negative integer number n, you have to a return a list of the \n first n + 1 numbers of the Tribonacci sequence.\n Examples:\n \"\"\"\nfunction tri(n::Int64)::Vector{Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = tri;\n\t@test(candidate(3) == [1, 3, 2, 8])\n\t@test(candidate(4) == [1, 3, 2, 8, 3])\n\t@test(candidate(5) == [1, 3, 2, 8, 3, 15])\n\t@test(candidate(6) == [1, 3, 2, 8, 3, 15, 4])\n\t@test(candidate(7) == [1, 3, 2, 8, 3, 15, 4, 24])\n\t@test(candidate(8) == [1, 3, 2, 8, 3, 15, 4, 24, 5])\n\t@test(candidate(9) == [1, 3, 2, 8, 3, 15, 4, 24, 5, 35])\n\t@test(candidate(20) == [1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11])\n\t@test(candidate(0) == [1])\n\t@test(candidate(1) == [1, 3])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "jl", - "prompt": "\"\"\"\n You are given a list of two strings, both strings consist of open\n parentheses '(' or close parentheses ')' only.\n Your job is to check if it is possible to concatenate the two strings in\n some order, that the resulting string will be good.\n A string S is considered to be good if and only if all parentheses in S\n are balanced. For example: the string '(())()' is good, while the string\n '())' is not.\n Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n\n Examples:\n \"\"\"\nfunction match_parens(lst::Vector{String})::String \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = match_parens;\n\t@test(candidate([\"()(\", \")\"]) == \"Yes\")\n\t@test(candidate([\")\", \")\"]) == \"No\")\n\t@test(candidate([\"(()(())\", \"())())\"]) == \"No\")\n\t@test(candidate([\")())\", \"(()()(\"]) == \"Yes\")\n\t@test(candidate([\"(())))\", \"(()())((\"]) == \"Yes\")\n\t@test(candidate([\"()\", \"())\"]) == \"No\")\n\t@test(candidate([\"(()(\", \"()))()\"]) == \"Yes\")\n\t@test(candidate([\"((((\", \"((())\"]) == \"No\")\n\t@test(candidate([\")(()\", \"(()(\"]) == \"No\")\n\t@test(candidate([\")(\", \")(\"]) == \"No\")\n\t@test(candidate([\"(\", \")\"]) == \"Yes\")\n\t@test(candidate([\")\", \"(\"]) == \"Yes\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "jl", - "prompt": "\"\"\" From a list of integers, remove all elements that occur more than once.\n Keep order of elements left the same as in the input.\n \"\"\"\nfunction remove_duplicates(numbers::Vector{Int64})::Vector{Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = remove_duplicates;\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([1, 2, 3, 4]) == [1, 2, 3, 4])\n\t@test(candidate([1, 2, 3, 2, 4, 3, 5]) == [1, 4, 5])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "jl", - "prompt": "\"\"\" Return a greatest common divisor of two integers a and b\n \"\"\"\nfunction greatest_common_divisor(a::Int64, b::Int64)::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = greatest_common_divisor;\n\t@test(candidate(3, 7) == 1)\n\t@test(candidate(10, 15) == 5)\n\t@test(candidate(49, 14) == 7)\n\t@test(candidate(144, 60) == 12)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "jl", - "prompt": "\"\"\"\n Checks if given string is a palindrome\n \"\"\"\nfunction is_palindrome(text::String)::Bool \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_palindrome;\n\t@test(candidate(\"\") == true)\n\t@test(candidate(\"aba\") == true)\n\t@test(candidate(\"aaaaa\") == true)\n\t@test(candidate(\"zbcd\") == false)\n\t@test(candidate(\"xywyx\") == true)\n\t@test(candidate(\"xywyz\") == false)\n\t@test(candidate(\"xywzx\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "jl", - "prompt": "\"\"\" xs represent coefficients of a polynomial.\n xs[0] + xs[1] * x + xs[2] * x^2 + ....\n Return derivative of this polynomial in the same form.\n \"\"\"\nfunction derivative(xs::Vector{Int64})::Vector{Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = derivative;\n\t@test(candidate([3, 1, 2, 4, 5]) == [1, 4, 12, 20])\n\t@test(candidate([1, 2, 3]) == [2, 6])\n\t@test(candidate([3, 2, 1]) == [2, 2])\n\t@test(candidate([3, 2, 1, 0, 4]) == [2, 2, 0, 16])\n\t@test(candidate([1]) == Vector{Int64}([]))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "jl", - "prompt": "\"\"\"\n In this task, you will be given a string that represents a number of apples and oranges \n that are distributed in a basket of fruit this basket contains \n apples, oranges, and mango fruits. Given the string that represents the total number of \n the oranges and apples and an integer that represent the total number of the fruits \n in the basket return the number of the mango fruits in the basket.\n for examble:\n \"\"\"\nfunction fruit_distribution(s::String, n::Int64)::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = fruit_distribution;\n\t@test(candidate(\"5 apples and 6 oranges\", 19) == 8)\n\t@test(candidate(\"5 apples and 6 oranges\", 21) == 10)\n\t@test(candidate(\"0 apples and 1 oranges\", 3) == 2)\n\t@test(candidate(\"1 apples and 0 oranges\", 3) == 2)\n\t@test(candidate(\"2 apples and 3 oranges\", 100) == 95)\n\t@test(candidate(\"2 apples and 3 oranges\", 5) == 0)\n\t@test(candidate(\"1 apples and 100 oranges\", 120) == 19)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "jl", - "prompt": "\"\"\"\n Write a function that takes an integer a and returns True \n if this ingeger is a cube of some integer number.\n Note: you may assume the input is always valid.\n Examples:\n \"\"\"\nfunction iscube(a::Int64)::Bool \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = iscube;\n\t@test(candidate(1) == true)\n\t@test(candidate(2) == false)\n\t@test(candidate(-1) == true)\n\t@test(candidate(64) == true)\n\t@test(candidate(180) == false)\n\t@test(candidate(1000) == true)\n\t@test(candidate(0) == true)\n\t@test(candidate(1729) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "jl", - "prompt": "\"\"\"\n In this Kata, you have to sort an array of non-negative integers according to\n number of ones in their binary representation in ascending order.\n For similar number of ones, sort based on decimal value.\n\n It must be implemented like this:\n \"\"\"\nfunction sort_array(arr::Vector{Int64})::Vector{Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = sort_array;\n\t@test(candidate([1, 5, 2, 3, 4]) == [1, 2, 4, 3, 5])\n\t@test(candidate([-2, -3, -4, -5, -6]) == [-4, -2, -6, -5, -3])\n\t@test(candidate([1, 0, 2, 3, 4]) == [0, 1, 2, 4, 3])\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]) == [2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77])\n\t@test(candidate([3, 6, 44, 12, 32, 5]) == [32, 3, 5, 6, 12, 44])\n\t@test(candidate([2, 4, 8, 16, 32]) == [2, 4, 8, 16, 32])\n\t@test(candidate([2, 4, 8, 16, 32]) == [2, 4, 8, 16, 32])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "jl", - "prompt": "\"\"\"Given a list of strings, where each string consists of only digits, return a list.\n Each element i of the output should be \"the number of odd elements in the\n string i of the input.\" where all the i's should be replaced by the number\n of odd digits in the i'th string of the input.\n\n \"\"\"\nfunction odd_count(lst::Vector{String})::Vector{String} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = odd_count;\n\t@test(candidate([\"1234567\"]) == [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"])\n\t@test(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.\"])\n\t@test(candidate([\"271\", \"137\", \"314\"]) == [\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "jl", - "prompt": "\"\"\" brackets is a string of \"(\" and \")\".\n return True if every opening bracket has a corresponding closing bracket.\n\n \"\"\"\nfunction correct_bracketing(brackets::String)::Bool \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = correct_bracketing;\n\t@test(candidate(\"()\") == true)\n\t@test(candidate(\"(()())\") == true)\n\t@test(candidate(\"()()(()())()\") == true)\n\t@test(candidate(\"()()((()()())())(()()(()))\") == true)\n\t@test(candidate(\"((()())))\") == false)\n\t@test(candidate(\")(()\") == false)\n\t@test(candidate(\"(\") == false)\n\t@test(candidate(\"((((\") == false)\n\t@test(candidate(\")\") == false)\n\t@test(candidate(\"(()\") == false)\n\t@test(candidate(\"()()(()())())(()\") == false)\n\t@test(candidate(\"()()(()())()))()\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "jl", - "prompt": "\"\"\"Task\n Write a function that takes a string as input and returns the sum of the upper characters only'\n ASCII codes.\n\n Examples:\n \"\"\"\nfunction digitSum(s::String)::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = digitSum;\n\t@test(candidate(\"\") == 0)\n\t@test(candidate(\"abAB\") == 131)\n\t@test(candidate(\"abcCd\") == 67)\n\t@test(candidate(\"helloE\") == 69)\n\t@test(candidate(\"woArBld\") == 131)\n\t@test(candidate(\"aAaaaXa\") == 153)\n\t@test(candidate(\" How are yOu?\") == 151)\n\t@test(candidate(\"You arE Very Smart\") == 327)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "jl", - "prompt": "\"\"\"Write a function that accepts a list of strings as a parameter,\n deletes the strings that have odd lengths from it,\n and returns the resulted list with a sorted order,\n The list is always a list of strings and never an array of numbers,\n and it may contain duplicates.\n The order of the list should be ascending by length of each word, and you\n should return the list sorted by that rule.\n If two words have the same length, sort the list alphabetically.\n The function should return a list of strings in sorted order.\n You may assume that all words will have the same length.\n For example:\n \"\"\"\nfunction sorted_list_sum(lst::Vector{String})::Vector{String} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = sorted_list_sum;\n\t@test(candidate([\"aa\", \"a\", \"aaa\"]) == [\"aa\"])\n\t@test(candidate([\"school\", \"AI\", \"asdf\", \"b\"]) == [\"AI\", \"asdf\", \"school\"])\n\t@test(candidate([\"d\", \"b\", \"c\", \"a\"]) == Vector{String}([]))\n\t@test(candidate([\"d\", \"dcba\", \"abcd\", \"a\"]) == [\"abcd\", \"dcba\"])\n\t@test(candidate([\"AI\", \"ai\", \"au\"]) == [\"AI\", \"ai\", \"au\"])\n\t@test(candidate([\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"]) == Vector{String}([]))\n\t@test(candidate([\"aaaa\", \"bbbb\", \"dd\", \"cc\"]) == [\"cc\", \"dd\", \"aaaa\", \"bbbb\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "jl", - "prompt": "\"\"\"\n You are given an array arr of integers and you need to return\n sum of magnitudes of integers multiplied by product of all signs\n of each number in the array, represented by 1, -1 or 0.\n Note: return None for empty arr.\n\n Example:\n \"\"\"\nfunction prod_signs(arr::Vector{Int64})::Union{Int64, Nothing} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = prod_signs;\n\t@test(candidate([1, 2, 2, -4]) == -9)\n\t@test(candidate([0, 1]) == 0)\n\t@test(candidate([1, 1, 1, 2, 3, -1, 1]) == -10)\n\t@test(candidate(Vector{Int64}([])) == nothing)\n\t@test(candidate([2, 4, 1, 2, -1, -1, 9]) == 20)\n\t@test(candidate([-1, 1, -1, 1]) == 4)\n\t@test(candidate([-1, 1, 1, 1]) == -4)\n\t@test(candidate([-1, 1, 1, 0]) == 0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "jl", - "prompt": "\"\"\"Return list with elements incremented by 1.\n \"\"\"\nfunction incr_list(l::Vector{Int64})::Vector{Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = incr_list;\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([3, 2, 1]) == [4, 3, 2])\n\t@test(candidate([5, 2, 5, 2, 3, 3, 9, 0, 123]) == [6, 3, 6, 3, 4, 4, 10, 1, 124])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "jl", - "prompt": "\"\"\" From a given list of integers, generate a list of rolling maximum element found until given moment\n in the sequence.\n \"\"\"\nfunction rolling_max(numbers::Vector{Int64})::Vector{Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = rolling_max;\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([1, 2, 3, 4]) == [1, 2, 3, 4])\n\t@test(candidate([4, 3, 2, 1]) == [4, 4, 4, 4])\n\t@test(candidate([3, 2, 3, 100, 3]) == [3, 3, 3, 100, 100])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "jl", - "prompt": "\"\"\" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n separate those group into separate strings and return the list of those.\n Separate groups are balanced (each open brace is properly closed) and not nested within each other\n Ignore any spaces in the input string.\n \"\"\"\nfunction separate_paren_groups(paren_string::String)::Vector{String} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = separate_paren_groups;\n\t@test(candidate(\"(()()) ((())) () ((())()())\") == [\"(()())\", \"((()))\", \"()\", \"((())()())\"])\n\t@test(candidate(\"() (()) ((())) (((())))\") == [\"()\", \"(())\", \"((()))\", \"(((())))\"])\n\t@test(candidate(\"(()(())((())))\") == [\"(()(())((())))\"])\n\t@test(candidate(\"( ) (( )) (( )( ))\") == [\"()\", \"(())\", \"(()())\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "jl", - "prompt": "\"\"\"\n You will be given a string of words separated by commas or spaces. Your task is\n to split the string into words and return an array of the words.\n \n For example:\n \"\"\"\nfunction words_string(s::String)::Vector{String} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = words_string;\n\t@test(candidate(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"])\n\t@test(candidate(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"])\n\t@test(candidate(\"Hi, my name\") == [\"Hi\", \"my\", \"name\"])\n\t@test(candidate(\"One,, two, three, four, five, six,\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"])\n\t@test(candidate(\"\") == Vector{String}([]))\n\t@test(candidate(\"ahmed , gamal\") == [\"ahmed\", \"gamal\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "jl", - "prompt": "\"\"\" Filter given list of any python values only for integers\n \"\"\"\nfunction filter_integers(values::Vector{Any})::Vector{Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = filter_integers;\n\t@test(candidate(Vector{Any}([])) == Vector{Int64}([]))\n\t@test(candidate([4, Dict(), [], 23.2, 9, \"adasd\"]) == [4, 9])\n\t@test(candidate([3, \"c\", 3, 3, \"a\", \"b\"]) == [3, 3, 3])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "jl", - "prompt": "\"\"\"This function takes a list l and returns a list l' such that\n l' is identical to l in the odd indicies, while its values at the even indicies are equal\n to the values of the even indicies of l, but sorted.\n \"\"\"\nfunction sort_even(l::Vector{Int64})::Vector{Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = sort_even;\n\t@test(candidate([1, 2, 3]) == [1, 2, 3])\n\t@test(candidate([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]) == [-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123])\n\t@test(candidate([5, 8, -12, 4, 23, 2, 3, 11, 12, -10]) == [-12, 8, 3, 4, 5, 2, 12, 11, 23, -10])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "jl", - "prompt": "\"\"\"I think we all remember that feeling when the result of some long-awaited\n event is finally known. The feelings and thoughts you have at that moment are\n definitely worth noting down and comparing.\n Your task is to determine if a person correctly guessed the results of a number of matches.\n You are given two arrays of scores and guesses of equal length, where each index shows a match. \n Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n the value is 0, and if not, the value is the absolute difference between the guess and the score.\n \n \n example:\n\n \"\"\"\nfunction compare(game::Vector{Int64}, guess::Vector{Int64})::Vector{Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = compare;\n\t@test(candidate([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2]) == [0, 0, 0, 0, 3, 3])\n\t@test(candidate([0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]) == [0, 0, 0, 0, 0, 0])\n\t@test(candidate([1, 2, 3], [-1, -2, -3]) == [2, 4, 6])\n\t@test(candidate([1, 2, 3, 5], [-1, 2, 3, 4]) == [2, 0, 0, 1])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "jl", - "prompt": "\"\"\"\n Given a positive integer n, return a tuple that has the number of even and odd\n integer palindromes that fall within the range(1, n), inclusive.\n\n Example 1:\n\n Explanation:\n Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n\n Example 2:\n\n Explanation:\n Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n\n Note:\n 1. 1 <= n <= 10^3\n 2. returned tuple has the number of even and odd integer palindromes respectively.\n \"\"\"\nfunction even_odd_palindrome(n::Int64)::Tuple{Int64, Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = even_odd_palindrome;\n\t@test(candidate(123) == (8, 13))\n\t@test(candidate(12) == (4, 6))\n\t@test(candidate(3) == (1, 2))\n\t@test(candidate(63) == (6, 8))\n\t@test(candidate(25) == (5, 6))\n\t@test(candidate(19) == (4, 6))\n\t@test(candidate(9) == (4, 5))\n\t@test(candidate(1) == (0, 1))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "jl", - "prompt": "\"\"\"The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fib4(0) -> 0\n fib4(1) -> 0\n fib4(2) -> 2\n fib4(3) -> 0\n fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n \"\"\"\nfunction fib4(n::Int64)::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = fib4;\n\t@test(candidate(5) == 4)\n\t@test(candidate(8) == 28)\n\t@test(candidate(10) == 104)\n\t@test(candidate(12) == 386)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "jl", - "prompt": "\"\"\"\n Given two positive integers a and b, return the even digits between a\n and b, in ascending order.\n\n For example:\n \"\"\"\nfunction generate_integers(a::Int64, b::Int64)::Vector{Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = generate_integers;\n\t@test(candidate(2, 10) == [2, 4, 6, 8])\n\t@test(candidate(10, 2) == [2, 4, 6, 8])\n\t@test(candidate(132, 2) == [2, 4, 6, 8])\n\t@test(candidate(17, 89) == Vector{Int64}([]))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "jl", - "prompt": "\"\"\" For a given list of input numbers, calculate Mean Absolute Deviation\n around the mean of this dataset.\n Mean Absolute Deviation is the average absolute difference between each\n element and a centerpoint (mean in this case):\n MAD = average | x - x_mean |\n \"\"\"\nfunction mean_absolute_deviation(numbers::Vector{Float64})::Float64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = mean_absolute_deviation;\n\t@test(candidate([1.0, 2.0]) == 0.5)\n\t@test(candidate([1.0, 2.0, 3.0, 4.0]) == 1.0)\n\t@test(candidate([1.0, 2.0, 3.0, 4.0, 5.0]) == 1.2)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "jl", - "prompt": "\"\"\"Create a function encrypt that takes a string as an argument and\n returns a string encrypted with the alphabet being rotated. \n The alphabet should be rotated in a manner such that the letters \n shift down by two multiplied to two places.\n For example:\n \"\"\"\nfunction encrypt(s::String)::String \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = encrypt;\n\t@test(candidate(\"hi\") == \"lm\")\n\t@test(candidate(\"asdfghjkl\") == \"ewhjklnop\")\n\t@test(candidate(\"gf\") == \"kj\")\n\t@test(candidate(\"et\") == \"ix\")\n\t@test(candidate(\"faewfawefaewg\") == \"jeiajeaijeiak\")\n\t@test(candidate(\"hellomyfriend\") == \"lippsqcjvmirh\")\n\t@test(candidate(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\") == \"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\")\n\t@test(candidate(\"a\") == \"e\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "jl", - "prompt": "\"\"\"\n Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n\n The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n as follows: start with any positive integer n. Then each term is obtained from the \n previous term as follows: if the previous term is even, the next term is one half of \n the previous term. If the previous term is odd, the next term is 3 times the previous\n term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n\n Note: \n 1. Collatz(1) is [1].\n 2. returned list sorted in increasing order.\n\n For example:\n get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n \"\"\"\nfunction get_odd_collatz(n::Int64)::Vector{Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = get_odd_collatz;\n\t@test(candidate(14) == [1, 5, 7, 11, 13, 17])\n\t@test(candidate(5) == [1, 5])\n\t@test(candidate(12) == [1, 3, 5])\n\t@test(candidate(1) == [1])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "jl", - "prompt": "\"\"\" Find how many times a given substring can be found in the original string. Count overlaping cases.\n \"\"\"\nfunction how_many_times(string::String, substring::String)::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = how_many_times;\n\t@test(candidate(\"\", \"x\") == 0)\n\t@test(candidate(\"xyxyxyx\", \"x\") == 4)\n\t@test(candidate(\"cacacacac\", \"cac\") == 4)\n\t@test(candidate(\"john doe\", \"john\") == 1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "jl", - "prompt": "\"\"\"We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n numbers in the array will be randomly ordered. Your task is to determine if\n it is possible to get an array sorted in non-decreasing order by performing \n the following operation on the given array:\n You are allowed to perform right shift operation any number of times.\n \n One right shift operation means shifting all elements of the array by one\n position in the right direction. The last element of the array will be moved to\n the starting position in the array i.e. 0th index. \n\n If it is possible to obtain the sorted array by performing the above operation\n then return True else return False.\n If the given array is empty then return True.\n\n Note: The given list is guaranteed to have unique elements.\n\n For Example:\n \n Explanation: By performin 2 right shift operations, non-decreasing order can\n be achieved for the given array.\n Explanation:It is not possible to get non-decreasing order for the given\n array by performing any number of right shift operations.\n \n \"\"\"\nfunction move_one_ball(arr::Vector{Int64})::Bool \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = move_one_ball;\n\t@test(candidate([3, 4, 5, 1, 2]) == true)\n\t@test(candidate([3, 5, 10, 1, 2]) == true)\n\t@test(candidate([4, 3, 1, 2]) == false)\n\t@test(candidate([3, 5, 4, 1, 2]) == false)\n\t@test(candidate(Vector{Int64}([])) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "jl", - "prompt": "\"\"\"\n Write a function which sorts the given list of integers\n in ascending order according to the sum of their digits.\n Note: if there are several items with similar sum of their digits,\n order them based on their index in original list.\n\n For example:\n \"\"\"\nfunction order_by_points(nums::Vector{Int64})::Vector{Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = order_by_points;\n\t@test(candidate([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11])\n\t@test(candidate([1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]) == [0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457])\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([1, -11, -32, 43, 54, -98, 2, -3]) == [-3, -32, -98, -11, 1, 2, 43, 54])\n\t@test(candidate([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) == [1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9])\n\t@test(candidate([0, 6, 6, -76, -21, 23, 4]) == [-76, -21, 0, 4, 23, 6, 6])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "jl", - "prompt": "\"\"\" Return list of prime factors of given integer in the order from smallest to largest.\n Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n Input number should be equal to the product of all factors\n \"\"\"\nfunction factorize(n::Int64)::Vector{Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = factorize;\n\t@test(candidate(2) == [2])\n\t@test(candidate(4) == [2, 2])\n\t@test(candidate(8) == [2, 2, 2])\n\t@test(candidate(57) == [3, 19])\n\t@test(candidate(3249) == [3, 3, 19, 19])\n\t@test(candidate(185193) == [3, 3, 3, 19, 19, 19])\n\t@test(candidate(20577) == [3, 19, 19, 19])\n\t@test(candidate(18) == [2, 3, 3])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "jl", - "prompt": "\"\"\"Return True if all numbers in the list l are below threshold t.\n \"\"\"\nfunction below_threshold(l::Vector{Int64}, t::Int64)::Bool \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = below_threshold;\n\t@test(candidate([1, 2, 4, 10], 100) == true)\n\t@test(candidate([1, 20, 4, 10], 5) == false)\n\t@test(candidate([1, 20, 4, 10], 21) == true)\n\t@test(candidate([1, 20, 4, 10], 22) == true)\n\t@test(candidate([1, 8, 4, 10], 11) == true)\n\t@test(candidate([1, 8, 4, 10], 10) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "jl", - "prompt": "\"\"\"You are given two positive integers n and m, and your task is to compute the\n average of the integers from n through m (including n and m). \n Round the answer to the nearest integer and convert that to binary.\n If n is greater than m, return -1.\n Example:\n \"\"\"\nfunction rounded_avg(n::Int64, m::Int64)::Union{String, Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = rounded_avg;\n\t@test(candidate(1, 5) == \"0b11\")\n\t@test(candidate(7, 13) == \"0b1010\")\n\t@test(candidate(964, 977) == \"0b1111001010\")\n\t@test(candidate(996, 997) == \"0b1111100100\")\n\t@test(candidate(560, 851) == \"0b1011000010\")\n\t@test(candidate(185, 546) == \"0b101101110\")\n\t@test(candidate(362, 496) == \"0b110101101\")\n\t@test(candidate(350, 902) == \"0b1001110010\")\n\t@test(candidate(197, 233) == \"0b11010111\")\n\t@test(candidate(7, 5) == -1)\n\t@test(candidate(5, 1) == -1)\n\t@test(candidate(5, 5) == \"0b101\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "jl", - "prompt": "\"\"\" Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n For each of the group, output the deepest level of nesting of parentheses.\n E.g. (()()) has maximum two levels of nesting while ((())) has three.\n\n \"\"\"\nfunction parse_nested_parens(paren_string::String)::Vector{Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = parse_nested_parens;\n\t@test(candidate(\"(()()) ((())) () ((())()())\") == [2, 3, 1, 3])\n\t@test(candidate(\"() (()) ((())) (((())))\") == [1, 2, 3, 4])\n\t@test(candidate(\"(()(())((())))\") == [4])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "jl", - "prompt": "\"\"\"Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n \n\n Examples\n \"\"\"\nfunction solution(lst::Vector{Int64})::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = solution;\n\t@test(candidate([5, 8, 7, 1]) == 12)\n\t@test(candidate([3, 3, 3, 3, 3]) == 9)\n\t@test(candidate([30, 13, 24, 321]) == 0)\n\t@test(candidate([5, 9]) == 5)\n\t@test(candidate([2, 4, 8]) == 0)\n\t@test(candidate([30, 13, 23, 32]) == 23)\n\t@test(candidate([3, 13, 2, 9]) == 3)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "jl", - "prompt": "\"\"\"\n You are given a positive integer n. You have to create an integer array a of length n.\n For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n and a[i] + a[j] + a[k] is a multiple of 3.\n\n Example :\n Explanation: \n a = [1, 3, 7, 13, 21]\n The only valid triple is (1, 7, 13).\n \"\"\"\nfunction get_max_triples(n::Int64)::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = get_max_triples;\n\t@test(candidate(5) == 1)\n\t@test(candidate(6) == 4)\n\t@test(candidate(10) == 36)\n\t@test(candidate(100) == 53361)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "jl", - "prompt": "\"\"\"\n You are given a list of integers.\n Write a function next_smallest() that returns the 2nd smallest element of the list.\n Return None if there is no such element.\n \"\"\"\nfunction next_smallest(lst::Vector{Int64})::Union{Int64, Nothing} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = next_smallest;\n\t@test(candidate([1, 2, 3, 4, 5]) == 2)\n\t@test(candidate([5, 1, 4, 3, 2]) == 2)\n\t@test(candidate(Vector{Int64}([])) == nothing)\n\t@test(candidate([1, 1]) == nothing)\n\t@test(candidate([1, 1, 1, 1, 0]) == 1)\n\t@test(candidate([1, 1]) == nothing)\n\t@test(candidate([-35, 34, 12, -45]) == -35)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "jl", - "prompt": "\"\"\" Input is a space-delimited string of numberals from 'zero' to 'nine'.\n Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n Return the string with numbers sorted from smallest to largest\n \"\"\"\nfunction sort_numbers(numbers::String)::String \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = sort_numbers;\n\t@test(candidate(\"\") == \"\")\n\t@test(candidate(\"three\") == \"three\")\n\t@test(candidate(\"three five nine\") == \"three five nine\")\n\t@test(candidate(\"five zero four seven nine eight\") == \"zero four five seven eight nine\")\n\t@test(candidate(\"six five four three two one zero\") == \"zero one two three four five six\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "jl", - "prompt": "\"\"\"You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n \n \"\"\"\nfunction cycpattern_check(a::String, b::String)::Bool \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = cycpattern_check;\n\t@test(candidate(\"xyzw\", \"xyw\") == false)\n\t@test(candidate(\"yello\", \"ell\") == true)\n\t@test(candidate(\"whattup\", \"ptut\") == false)\n\t@test(candidate(\"efef\", \"fee\") == true)\n\t@test(candidate(\"abab\", \"aabb\") == false)\n\t@test(candidate(\"winemtt\", \"tinem\") == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "jl", - "prompt": "\"\"\"You will be given a number in decimal form and your task is to convert it to\n binary format. The function should return a string, with each character representing a binary\n number. Each character in the string will be '0' or '1'.\n\n There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n The extra characters are there to help with the format.\n\n Examples:\n \"\"\"\nfunction decimal_to_binary(decimal::Int64)::String \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = decimal_to_binary;\n\t@test(candidate(0) == \"db0db\")\n\t@test(candidate(32) == \"db100000db\")\n\t@test(candidate(103) == \"db1100111db\")\n\t@test(candidate(15) == \"db1111db\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "jl", - "prompt": "\"\"\" Filter an input list of strings only for ones that contain given substring\n \"\"\"\nfunction filter_by_substring(strings::Vector{String}, substring::String)::Vector{String} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = filter_by_substring;\n\t@test(candidate(Vector{String}([]), \"john\") == Vector{String}([]))\n\t@test(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\") == [\"xxx\", \"xxxAAA\", \"xxx\"])\n\t@test(candidate([\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xx\") == [\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"])\n\t@test(candidate([\"grunt\", \"trumpet\", \"prune\", \"gruesome\"], \"run\") == [\"grunt\", \"prune\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "jl", - "prompt": "\"\"\"Given an integer. return a tuple that has the number of even and odd digits respectively.\n\n Example:\n \"\"\"\nfunction even_odd_count(num::Int64)::Tuple{Int64, Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = even_odd_count;\n\t@test(candidate(7) == (0, 1))\n\t@test(candidate(-78) == (1, 1))\n\t@test(candidate(3452) == (2, 2))\n\t@test(candidate(346211) == (3, 3))\n\t@test(candidate(-345821) == (3, 3))\n\t@test(candidate(-2) == (1, 0))\n\t@test(candidate(-45347) == (2, 3))\n\t@test(candidate(0) == (1, 0))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "jl", - "prompt": "\"\"\"Write a function that accepts a list of strings.\n The list contains different words. Return the word with maximum number\n of unique characters. If multiple strings have maximum number of unique\n characters, return the one which comes first in lexicographical order.\n\n \"\"\"\nfunction find_max(words::Vector{String})::String \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = find_max;\n\t@test(candidate([\"name\", \"of\", \"string\"]) == \"string\")\n\t@test(candidate([\"name\", \"enam\", \"game\"]) == \"enam\")\n\t@test(candidate([\"aaaaaaa\", \"bb\", \"cc\"]) == \"aaaaaaa\")\n\t@test(candidate([\"abc\", \"cba\"]) == \"abc\")\n\t@test(candidate([\"play\", \"this\", \"game\", \"of\", \"footbott\"]) == \"footbott\")\n\t@test(candidate([\"we\", \"are\", \"gonna\", \"rock\"]) == \"gonna\")\n\t@test(candidate([\"we\", \"are\", \"a\", \"mad\", \"nation\"]) == \"nation\")\n\t@test(candidate([\"this\", \"is\", \"a\", \"prrk\"]) == \"this\")\n\t@test(candidate([\"b\"]) == \"b\")\n\t@test(candidate([\"play\", \"play\", \"play\"]) == \"play\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "jl", - "prompt": "\"\"\"\n Create a function that returns a tuple (a, b), where 'a' is\n the largest of negative integers, and 'b' is the smallest\n of positive integers in a list.\n If there is no negative or positive integers, return them as None.\n\n Examples:\n \"\"\"\nfunction largest_smallest_integers(lst::Vector{Int64})::Tuple{Union{Int64, Nothing}, Union{Int64, Nothing}} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = largest_smallest_integers;\n\t@test(candidate([2, 4, 1, 3, 5, 7]) == (nothing, 1))\n\t@test(candidate([2, 4, 1, 3, 5, 7, 0]) == (nothing, 1))\n\t@test(candidate([1, 3, 2, 4, 5, 6, -2]) == (-2, 1))\n\t@test(candidate([4, 5, 3, 6, 2, 7, -7]) == (-7, 2))\n\t@test(candidate([7, 3, 8, 4, 9, 2, 5, -9]) == (-9, 2))\n\t@test(candidate(Vector{Int64}([])) == (nothing, nothing))\n\t@test(candidate([0]) == (nothing, nothing))\n\t@test(candidate([-1, -3, -5, -6]) == (-1, nothing))\n\t@test(candidate([-1, -3, -5, -6, 0]) == (-1, nothing))\n\t@test(candidate([-6, -4, -4, -3, 1]) == (-3, 1))\n\t@test(candidate([-6, -4, -4, -3, -100, 1]) == (-3, 1))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "jl", - "prompt": "\"\"\"\n \"Given an array representing a branch of a tree that has non-negative integer nodes\n your task is to pluck one of the nodes and return it.\n The plucked node should be the node with the smallest even value.\n If multiple nodes with the same smallest even value are found return the node that has smallest index.\n\n The plucked node should be returned in a list, [ smalest_value, its index ],\n If there are no even values or the given array is empty, return [].\n\n Example 1:\n Explanation: 2 has the smallest even value, and 2 has the smallest index.\n\n Example 2:\n Explanation: 2 has the smallest even value, and 2 has the smallest index.\n\n Example 3:\n \n Example 4:\n Explanation: 0 is the smallest value, but there are two zeros,\n so we will choose the first zero, which has the smallest index.\n\n Constraints:\n * 1 <= nodes.length <= 10000\n * 0 <= node.value\n \"\"\"\nfunction pluck(arr::Vector{Int64})::Vector{Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = pluck;\n\t@test(candidate([4, 2, 3]) == [2, 1])\n\t@test(candidate([1, 2, 3]) == [2, 1])\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([5, 0, 3, 0, 4, 2]) == [0, 1])\n\t@test(candidate([1, 2, 3, 0, 5, 3]) == [0, 3])\n\t@test(candidate([5, 4, 8, 4, 8]) == [4, 1])\n\t@test(candidate([7, 6, 7, 1]) == [6, 1])\n\t@test(candidate([7, 9, 7, 1]) == Vector{Int64}([]))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "jl", - "prompt": "\"\"\"\n Write a function count_nums which takes an array of integers and returns\n the number of elements which has a sum of digits > 0.\n If a number is negative, then its first signed digit will be negative:\n e.g. -123 has signed digits -1, 2, and 3.\n \"\"\"\nfunction count_nums(arr::Vector{Int64})::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = count_nums;\n\t@test(candidate(Vector{Int64}([])) == 0)\n\t@test(candidate([-1, -2, 0]) == 0)\n\t@test(candidate([1, 1, 2, -2, 3, 4, 5]) == 6)\n\t@test(candidate([1, 6, 9, -6, 0, 1, 5]) == 5)\n\t@test(candidate([1, 100, 98, -7, 1, -1]) == 4)\n\t@test(candidate([12, 23, 34, -45, -56, 0]) == 5)\n\t@test(candidate([0, 1]) == 1)\n\t@test(candidate([1]) == 1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "jl", - "prompt": "\"\"\"\n Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n each cell of the grid contains a value. Every integer in the range [1, N * N]\n inclusive appears exactly once on the cells of the grid.\n\n You have to find the minimum path of length k in the grid. You can start\n from any cell, and in each step you can move to any of the neighbor cells,\n in other words, you can go to cells which share an edge with you current\n cell.\n Please note that a path of length k means visiting exactly k cells (not\n necessarily distinct).\n You CANNOT go off the grid.\n A path A (of length k) is considered less than a path B (of length k) if\n after making the ordered lists of the values on the cells that A and B go\n through (let's call them lst_A and lst_B), lst_A is lexicographically less\n than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n lst_A[j] = lst_B[j].\n It is guaranteed that the answer is unique.\n Return an ordered list of the values on the cells that the minimum path go through.\n\n Examples: \n \n \"\"\"\nfunction minPath(grid::Vector{Vector{Int64}}, k::Int64)::Vector{Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = minPath;\n\t@test(candidate([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3) == [1, 2, 1])\n\t@test(candidate([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1) == [1])\n\t@test(candidate([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], 4) == [1, 2, 1, 2])\n\t@test(candidate([[6, 4, 13, 10], [5, 7, 12, 1], [3, 16, 11, 15], [8, 14, 9, 2]], 7) == [1, 10, 1, 10, 1, 10, 1])\n\t@test(candidate([[8, 14, 9, 2], [6, 4, 13, 15], [5, 7, 1, 12], [3, 10, 11, 16]], 5) == [1, 7, 1, 7, 1])\n\t@test(candidate([[11, 8, 7, 2], [5, 16, 14, 4], [9, 3, 15, 6], [12, 13, 10, 1]], 9) == [1, 6, 1, 6, 1, 6, 1, 6, 1])\n\t@test(candidate([[12, 13, 10, 1], [9, 3, 15, 6], [5, 16, 14, 4], [11, 8, 7, 2]], 12) == [1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6])\n\t@test(candidate([[2, 7, 4], [3, 1, 5], [6, 8, 9]], 8) == [1, 3, 1, 3, 1, 3, 1, 3])\n\t@test(candidate([[6, 1, 5], [3, 8, 9], [2, 7, 4]], 8) == [1, 5, 1, 5, 1, 5, 1, 5])\n\t@test(candidate([[1, 2], [3, 4]], 10) == [1, 2, 1, 2, 1, 2, 1, 2, 1, 2])\n\t@test(candidate([[1, 3], [3, 2]], 10) == [1, 3, 1, 3, 1, 3, 1, 3, 1, 3])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "jl", - "prompt": "\"\"\"\n Given list of integers, return list in strange order.\n Strange sorting, is when you start with the minimum value,\n then maximum of the remaining integers, then minimum and so on.\n\n Examples:\n \"\"\"\nfunction strange_sort_list(lst::Vector{Int64})::Vector{Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = strange_sort_list;\n\t@test(candidate([1, 2, 3, 4]) == [1, 4, 2, 3])\n\t@test(candidate([5, 6, 7, 8, 9]) == [5, 9, 6, 8, 7])\n\t@test(candidate([1, 2, 3, 4, 5]) == [1, 5, 2, 4, 3])\n\t@test(candidate([5, 6, 7, 8, 9, 1]) == [1, 9, 5, 8, 6, 7])\n\t@test(candidate([5, 5, 5, 5]) == [5, 5, 5, 5])\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([1, 2, 3, 4, 5, 6, 7, 8]) == [1, 8, 2, 7, 3, 6, 4, 5])\n\t@test(candidate([0, 2, 2, 2, 5, 5, -5, -5]) == [-5, 5, -5, 5, 0, 2, 2, 2])\n\t@test(candidate([111111]) == [111111])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "jl", - "prompt": "\"\"\"\n Given a string 'text', return its md5 hash equivalent string.\n If 'text' is an empty string, return None.\n\n \"\"\"\nfunction string_to_md5(text::String)::Union{String, Nothing} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = string_to_md5;\n\t@test(candidate(\"Hello world\") == \"3e25960a79dbc69b674cd4ec67a72c62\")\n\t@test(candidate(\"\") == nothing)\n\t@test(candidate(\"A B C\") == \"0ef78513b0cb8cef12743f5aeb35f888\")\n\t@test(candidate(\"password\") == \"5f4dcc3b5aa765d61d8327deb882cf99\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "jl", - "prompt": "\"\"\"You are given a word. Your task is to find the closest vowel that stands between \n two consonants from the right side of the word (case sensitive).\n \n Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n find any vowel met the above condition. \n\n You may assume that the given string contains English letter only.\n\n Example:\n \"\"\"\nfunction get_closest_vowel(word::String)::String \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = get_closest_vowel;\n\t@test(candidate(\"yogurt\") == \"u\")\n\t@test(candidate(\"full\") == \"u\")\n\t@test(candidate(\"easy\") == \"\")\n\t@test(candidate(\"eAsy\") == \"\")\n\t@test(candidate(\"ali\") == \"\")\n\t@test(candidate(\"bad\") == \"a\")\n\t@test(candidate(\"most\") == \"o\")\n\t@test(candidate(\"ab\") == \"\")\n\t@test(candidate(\"ba\") == \"\")\n\t@test(candidate(\"quick\") == \"\")\n\t@test(candidate(\"anime\") == \"i\")\n\t@test(candidate(\"Asia\") == \"\")\n\t@test(candidate(\"Above\") == \"o\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "jl", - "prompt": "\"\"\"Change numerical base of input number x to base.\n return string representation after the conversion.\n base numbers are less than 10.\n \"\"\"\nfunction change_base(x::Int64, base::Int64)::String \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = change_base;\n\t@test(candidate(8, 3) == \"22\")\n\t@test(candidate(9, 3) == \"100\")\n\t@test(candidate(234, 2) == \"11101010\")\n\t@test(candidate(16, 2) == \"10000\")\n\t@test(candidate(8, 2) == \"1000\")\n\t@test(candidate(7, 2) == \"111\")\n\t@test(candidate(2, 3) == \"2\")\n\t@test(candidate(3, 4) == \"3\")\n\t@test(candidate(4, 5) == \"4\")\n\t@test(candidate(5, 6) == \"5\")\n\t@test(candidate(6, 7) == \"6\")\n\t@test(candidate(7, 8) == \"7\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "jl", - "prompt": "\"\"\" Check if in given list of numbers, are any two numbers closer to each other than\n given threshold.\n \"\"\"\nfunction has_close_elements(numbers::Vector{Float64}, threshold::Float64)::Bool \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = has_close_elements;\n\t@test(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3) == true)\n\t@test(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05) == false)\n\t@test(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.95) == true)\n\t@test(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.8) == false)\n\t@test(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1) == true)\n\t@test(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 1.0) == true)\n\t@test(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 0.5) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "jl", - "prompt": "\"\"\"\n Create a function that takes a string as input which contains only square brackets.\n The function should return True if and only if there is a valid subsequence of brackets \n where at least one bracket in the subsequence is nested.\n\n \"\"\"\nfunction is_nested(string::String)::Bool \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_nested;\n\t@test(candidate(\"[[]]\") == true)\n\t@test(candidate(\"[]]]]]]][[[[[]\") == false)\n\t@test(candidate(\"[][]\") == false)\n\t@test(candidate(\"[]\") == false)\n\t@test(candidate(\"[[[[]]]]\") == true)\n\t@test(candidate(\"[]]]]]]]]]]\") == false)\n\t@test(candidate(\"[][][[]]\") == true)\n\t@test(candidate(\"[[]\") == false)\n\t@test(candidate(\"[]]\") == false)\n\t@test(candidate(\"[[]][[\") == true)\n\t@test(candidate(\"[[][]]\") == true)\n\t@test(candidate(\"\") == false)\n\t@test(candidate(\"[[[[[[[[\") == false)\n\t@test(candidate(\"]]]]]]]]\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "jl", - "prompt": "\"\"\" Concatenate list of strings into a single string\n \"\"\"\nfunction concatenate(strings::Vector{String})::String \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = concatenate;\n\t@test(candidate(Vector{String}([])) == \"\")\n\t@test(candidate([\"x\", \"y\", \"z\"]) == \"xyz\")\n\t@test(candidate([\"x\", \"y\", \"z\", \"w\", \"k\"]) == \"xyzwk\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "jl", - "prompt": "\"\"\"\n prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n \"\"\"\nfunction prime_fib(n::Int64)::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = prime_fib;\n\t@test(candidate(1) == 2)\n\t@test(candidate(2) == 3)\n\t@test(candidate(3) == 5)\n\t@test(candidate(4) == 13)\n\t@test(candidate(5) == 89)\n\t@test(candidate(6) == 233)\n\t@test(candidate(7) == 1597)\n\t@test(candidate(8) == 28657)\n\t@test(candidate(9) == 514229)\n\t@test(candidate(10) == 433494437)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "jl", - "prompt": "\"\"\" From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n other and return them in order (smaller number, larger number).\n \"\"\"\nfunction find_closest_elements(numbers::Vector{Float64})::Tuple{Float64, Float64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = find_closest_elements;\n\t@test(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2]) == (3.9, 4.0))\n\t@test(candidate([1.0, 2.0, 5.9, 4.0, 5.0]) == (5.0, 5.9))\n\t@test(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]) == (2.0, 2.2))\n\t@test(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]) == (2.0, 2.0))\n\t@test(candidate([1.1, 2.2, 3.1, 4.1, 5.1]) == (2.2, 3.1))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "jl", - "prompt": "\"\"\"You have been tasked to write a function that receives \n a hexadecimal number as a string and counts the number of hexadecimal \n digits that are primes (prime number, or a prime, is a natural number \n greater than 1 that is not a product of two smaller natural numbers).\n Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n So you have to determine a number of the following digits: 2, 3, 5, 7, \n B (=decimal 11), D (=decimal 13).\n Note: you may assume the input is always correct or empty string, \n and symbols A,B,C,D,E,F are always uppercase.\n Examples:\n \"\"\"\nfunction hex_key(num::String)::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = hex_key;\n\t@test(candidate(\"AB\") == 1)\n\t@test(candidate(\"1077E\") == 2)\n\t@test(candidate(\"ABED1A33\") == 4)\n\t@test(candidate(\"2020\") == 2)\n\t@test(candidate(\"123456789ABCDEF0\") == 6)\n\t@test(candidate(\"112233445566778899AABBCCDDEEFF00\") == 12)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "jl", - "prompt": "\"\"\"Complete the function that takes two integers and returns \n the product of their unit digits.\n Assume the input is always valid.\n Examples:\n \"\"\"\nfunction multiply(a::Int64, b::Int64)::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = multiply;\n\t@test(candidate(148, 412) == 16)\n\t@test(candidate(19, 28) == 72)\n\t@test(candidate(2020, 1851) == 0)\n\t@test(candidate(14, -15) == 20)\n\t@test(candidate(76, 67) == 42)\n\t@test(candidate(17, 27) == 49)\n\t@test(candidate(0, 1) == 0)\n\t@test(candidate(0, 0) == 0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "jl", - "prompt": "\"\"\" Given list of numbers (of at least two elements), apply a linear transform to that list,\n such that the smallest number will become 0 and the largest will become 1\n \"\"\"\nfunction rescale_to_unit(numbers::Vector{Float64})::Vector{Float64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = rescale_to_unit;\n\t@test(candidate([2.0, 49.9]) == [0.0, 1.0])\n\t@test(candidate([100.0, 49.9]) == [1.0, 0.0])\n\t@test(candidate([1.0, 2.0, 3.0, 4.0, 5.0]) == [0.0, 0.25, 0.5, 0.75, 1.0])\n\t@test(candidate([2.0, 1.0, 5.0, 3.0, 4.0]) == [0.25, 0.0, 1.0, 0.5, 0.75])\n\t@test(candidate([12.0, 11.0, 15.0, 13.0, 14.0]) == [0.25, 0.0, 1.0, 0.5, 0.75])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "jl", - "prompt": "\"\"\"Given a positive integer n, return the product of the odd digits.\n Return 0 if all digits are even.\n For example:\n \"\"\"\nfunction digits(n::Int64)::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = digits;\n\t@test(candidate(5) == 5)\n\t@test(candidate(54) == 5)\n\t@test(candidate(120) == 1)\n\t@test(candidate(5014) == 5)\n\t@test(candidate(98765) == 315)\n\t@test(candidate(5576543) == 2625)\n\t@test(candidate(2468) == 0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "jl", - "prompt": "\"\"\"You will be given the name of a class (a string) and a list of extensions.\n The extensions are to be used to load additional classes to the class. The\n strength of the extension is as follows: Let CAP be the number of the uppercase\n letters in the extension's name, and let SM be the number of lowercase letters \n in the extension's name, the strength is given by the fraction CAP - SM. \n You should find the strongest extension and return a string in this \n format: ClassName.StrongestExtensionName.\n If there are two or more extensions with the same strength, you should\n choose the one that comes first in the list.\n For example, if you are given \"Slices\" as the class and a list of the\n extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n (its strength is -1).\n Example:\n \"\"\"\nfunction Strongest_Extension(class_name::String, extensions::Vector{String})::String \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = Strongest_Extension;\n\t@test(candidate(\"Watashi\", [\"tEN\", \"niNE\", \"eIGHt8OKe\"]) == \"Watashi.eIGHt8OKe\")\n\t@test(candidate(\"Boku123\", [\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"]) == \"Boku123.YEs.WeCaNe\")\n\t@test(candidate(\"__YESIMHERE\", [\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"]) == \"__YESIMHERE.NuLl__\")\n\t@test(candidate(\"K\", [\"Ta\", \"TAR\", \"t234An\", \"cosSo\"]) == \"K.TAR\")\n\t@test(candidate(\"__HAHA\", [\"Tab\", \"123\", \"781345\", \"-_-\"]) == \"__HAHA.123\")\n\t@test(candidate(\"YameRore\", [\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"]) == \"YameRore.okIWILL123\")\n\t@test(candidate(\"finNNalLLly\", [\"Die\", \"NowW\", \"Wow\", \"WoW\"]) == \"finNNalLLly.WoW\")\n\t@test(candidate(\"_\", [\"Bb\", \"91245\"]) == \"_.Bb\")\n\t@test(candidate(\"Sp\", [\"671235\", \"Bb\"]) == \"Sp.671235\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "jl", - "prompt": "\"\"\"Given a string representing a space separated lowercase letters, return a dictionary\n of the letter with the most repetition and containing the corresponding count.\n If several letters have the same occurrence, return all of them.\n \n Example:\n \n \"\"\"\nfunction histogram(test::String)::Dict{String, Int64}> \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = histogram;\n\t@test(candidate(\"a b b a\") == Dict(\"a\" => 2, \"b\" => 2))\n\t@test(candidate(\"a b c a b\") == Dict(\"a\" => 2, \"b\" => 2))\n\t@test(candidate(\"a b c d g\") == Dict(\"a\" => 1, \"b\" => 1, \"c\" => 1, \"d\" => 1, \"g\" => 1))\n\t@test(candidate(\"r t g\") == Dict(\"r\" => 1, \"t\" => 1, \"g\" => 1))\n\t@test(candidate(\"b b b b a\") == Dict(\"b\" => 4))\n\t@test(candidate(\"r t g\") == Dict(\"r\" => 1, \"t\" => 1, \"g\" => 1))\n\t@test(candidate(\"\") == Dict())\n\t@test(candidate(\"a\") == Dict(\"a\" => 1))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "jl", - "prompt": "\"\"\"\n pairs_sum_to_zero takes a list of integers as an input.\n it returns True if there are two distinct elements in the list that\n sum to zero, and False otherwise.\n \"\"\"\nfunction pairs_sum_to_zero(l::Vector{Int64})::Bool \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = pairs_sum_to_zero;\n\t@test(candidate([1, 3, 5, 0]) == false)\n\t@test(candidate([1, 3, -2, 1]) == false)\n\t@test(candidate([1, 2, 3, 7]) == false)\n\t@test(candidate([2, 4, -5, 3, 5, 7]) == true)\n\t@test(candidate([1]) == false)\n\t@test(candidate([-3, 9, -1, 3, 2, 30]) == true)\n\t@test(candidate([-3, 9, -1, 3, 2, 31]) == true)\n\t@test(candidate([-3, 9, -1, 4, 2, 30]) == false)\n\t@test(candidate([-3, 9, -1, 4, 2, 31]) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "jl", - "prompt": "\"\"\"\n Write a function that accepts two lists of strings and returns the list that has \n total number of chars in the all strings of the list less than the other list.\n\n if the two lists have the same number of chars, return the first list.\n\n Examples\n \"\"\"\nfunction total_match(lst1::Vector{String}, lst2::Vector{String})::Vector{String} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = total_match;\n\t@test(candidate(Vector{String}([]), Vector{String}([])) == Vector{String}([]))\n\t@test(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\"]) == [\"hi\", \"hi\"])\n\t@test(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"]) == [\"hi\", \"admin\"])\n\t@test(candidate([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"]) == [\"4\"])\n\t@test(candidate([\"hi\", \"admin\"], [\"hI\", \"Hi\"]) == [\"hI\", \"Hi\"])\n\t@test(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"]) == [\"hI\", \"hi\", \"hi\"])\n\t@test(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hii\"]) == [\"hi\", \"admin\"])\n\t@test(candidate(Vector{String}([]), [\"this\"]) == Vector{String}([]))\n\t@test(candidate([\"this\"], Vector{String}([])) == Vector{String}([]))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "jl", - "prompt": "\"\"\"Circular shift the digits of the integer x, shift the digits right by shift\n and return the result as a string.\n If shift > number of digits, return digits reversed.\n \"\"\"\nfunction circular_shift(x::Int64, shift::Int64)::String \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = circular_shift;\n\t@test(candidate(100, 2) == \"001\")\n\t@test(candidate(12, 2) == \"12\")\n\t@test(candidate(97, 8) == \"79\")\n\t@test(candidate(12, 1) == \"21\")\n\t@test(candidate(11, 101) == \"11\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "jl", - "prompt": "\"\"\"Return True is list elements are monotonically increasing or decreasing.\n \"\"\"\nfunction monotonic(l::Vector{Int64})::Bool \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = monotonic;\n\t@test(candidate([1, 2, 4, 10]) == true)\n\t@test(candidate([1, 2, 4, 20]) == true)\n\t@test(candidate([1, 20, 4, 10]) == false)\n\t@test(candidate([4, 1, 0, -10]) == true)\n\t@test(candidate([4, 1, 1, 0]) == true)\n\t@test(candidate([1, 2, 3, 2, 5, 60]) == false)\n\t@test(candidate([1, 2, 3, 4, 5, 60]) == true)\n\t@test(candidate([9, 9, 9, 9]) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "jl", - "prompt": "\"\"\"Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n Example\n \"\"\"\nfunction is_equal_to_sum_even(n::Int64)::Bool \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_equal_to_sum_even;\n\t@test(candidate(4) == false)\n\t@test(candidate(6) == false)\n\t@test(candidate(8) == true)\n\t@test(candidate(10) == true)\n\t@test(candidate(11) == false)\n\t@test(candidate(12) == true)\n\t@test(candidate(13) == false)\n\t@test(candidate(16) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "jl", - "prompt": "\"\"\" Input to this function is a string representing musical notes in a special ASCII format.\n Your task is to parse this string and return list of integers corresponding to how many beats does each\n not last.\n\n Here is a legend:\n 'o' - whole note, lasts four beats\n 'o|' - half note, lasts two beats\n '.|' - quater note, lasts one beat\n\n \"\"\"\nfunction parse_music(music_string::String)::Vector{Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = parse_music;\n\t@test(candidate(\"\") == Vector{Int64}([]))\n\t@test(candidate(\"o o o o\") == [4, 4, 4, 4])\n\t@test(candidate(\".| .| .| .|\") == [1, 1, 1, 1])\n\t@test(candidate(\"o| o| .| .| o o o o\") == [2, 2, 1, 1, 4, 4, 4, 4])\n\t@test(candidate(\"o| .| o| .| o o| o o|\") == [2, 1, 2, 1, 4, 2, 4, 2])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "jl", - "prompt": "\"\"\"\"\n This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n \n Examples:\n \"\"\"\nfunction sum_squares(lst::Vector{Int64})::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = sum_squares;\n\t@test(candidate([1, 2, 3]) == 6)\n\t@test(candidate([1, 4, 9]) == 14)\n\t@test(candidate(Vector{Int64}([])) == 0)\n\t@test(candidate([1, 1, 1, 1, 1, 1, 1, 1, 1]) == 9)\n\t@test(candidate([-1, -1, -1, -1, -1, -1, -1, -1, -1]) == -3)\n\t@test(candidate([0]) == 0)\n\t@test(candidate([-1, -5, 2, -1, -5]) == -126)\n\t@test(candidate([-56, -99, 1, 0, -2]) == 3030)\n\t@test(candidate([-1, 0, 0, 0, 0, 0, 0, 0, -1]) == 0)\n\t@test(candidate([-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37]) == -14196)\n\t@test(candidate([-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10]) == -1448)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "jl", - "prompt": "\"\"\"\n triples_sum_to_zero takes a list of integers as an input.\n it returns True if there are three distinct elements in the list that\n sum to zero, and False otherwise.\n\n \"\"\"\nfunction triples_sum_to_zero(l::Vector{Int64})::Bool \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = triples_sum_to_zero;\n\t@test(candidate([1, 3, 5, 0]) == false)\n\t@test(candidate([1, 3, 5, -1]) == false)\n\t@test(candidate([1, 3, -2, 1]) == true)\n\t@test(candidate([1, 2, 3, 7]) == false)\n\t@test(candidate([1, 2, 5, 7]) == false)\n\t@test(candidate([2, 4, -5, 3, 9, 7]) == true)\n\t@test(candidate([1]) == false)\n\t@test(candidate([1, 3, 5, -100]) == false)\n\t@test(candidate([100, 3, 5, -100]) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "jl", - "prompt": "\"\"\" brackets is a string of \"<\" and \">\".\n return True if every opening bracket has a corresponding closing bracket.\n\n \"\"\"\nfunction correct_bracketing(brackets::String)::Bool \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = correct_bracketing;\n\t@test(candidate(\"<>\") == true)\n\t@test(candidate(\"<<><>>\") == true)\n\t@test(candidate(\"<><><<><>><>\") == true)\n\t@test(candidate(\"<><><<<><><>><>><<><><<>>>\") == true)\n\t@test(candidate(\"<<<><>>>>\") == false)\n\t@test(candidate(\"><<>\") == false)\n\t@test(candidate(\"<\") == false)\n\t@test(candidate(\"<<<<\") == false)\n\t@test(candidate(\">\") == false)\n\t@test(candidate(\"<<>\") == false)\n\t@test(candidate(\"<><><<><>><>><<>\") == false)\n\t@test(candidate(\"<><><<><>><>>><>\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "jl", - "prompt": "\"\"\"Write a function that takes an array of numbers as input and returns \n the number of elements in the array that are greater than 10 and both \n first and last digits of a number are odd (1, 3, 5, 7, 9).\n For example:\n \"\"\"\nfunction specialFilter(nums::Vector{Int64})::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = specialFilter;\n\t@test(candidate([5, -2, 1, -5]) == 0)\n\t@test(candidate([15, -73, 14, -15]) == 1)\n\t@test(candidate([33, -2, -3, 45, 21, 109]) == 2)\n\t@test(candidate([43, -12, 93, 125, 121, 109]) == 4)\n\t@test(candidate([71, -2, -33, 75, 21, 19]) == 3)\n\t@test(candidate([1]) == 0)\n\t@test(candidate(Vector{Int64}([])) == 0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "jl", - "prompt": "\"\"\"\n Given a dictionary, return True if all keys are strings in lower \n case or all keys are strings in upper case, else return False.\n The function should return False is the given dictionary is empty.\n Examples:\n \"\"\"\nfunction check_dict_case(dict::Dict{String, String}>)::Bool \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = check_dict_case;\n\t@test(candidate(Dict(\"p\" => \"pineapple\", \"b\" => \"banana\")) == true)\n\t@test(candidate(Dict(\"p\" => \"pineapple\", \"A\" => \"banana\", \"B\" => \"banana\")) == false)\n\t@test(candidate(Dict(\"p\" => \"pineapple\", \"5\" => \"banana\", \"a\" => \"apple\")) == false)\n\t@test(candidate(Dict(\"Name\" => \"John\", \"Age\" => \"36\", \"City\" => \"Houston\")) == false)\n\t@test(candidate(Dict(\"STATE\" => \"NC\", \"ZIP\" => \"12345\")) == true)\n\t@test(candidate(Dict(\"fruit\" => \"Orange\", \"taste\" => \"Sweet\")) == true)\n\t@test(candidate(Dict()) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "jl", - "prompt": "\"\"\"\n Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n Examples\n \"\"\"\nfunction split_words(txt::String)::Union{Vector{String}, Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = split_words;\n\t@test(candidate(\"Hello world!\") == [\"Hello\", \"world!\"])\n\t@test(candidate(\"Hello,world!\") == [\"Hello\", \"world!\"])\n\t@test(candidate(\"Hello world,!\") == [\"Hello\", \"world,!\"])\n\t@test(candidate(\"Hello,Hello,world !\") == [\"Hello,Hello,world\", \"!\"])\n\t@test(candidate(\"abcdef\") == 3)\n\t@test(candidate(\"aaabb\") == 2)\n\t@test(candidate(\"aaaBb\") == 1)\n\t@test(candidate(\"\") == 0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "jl", - "prompt": "\"\"\"The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fibfib(0) == 0\n fibfib(1) == 0\n fibfib(2) == 1\n fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n \"\"\"\nfunction fibfib(n::Int64)::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = fibfib;\n\t@test(candidate(2) == 1)\n\t@test(candidate(1) == 0)\n\t@test(candidate(5) == 4)\n\t@test(candidate(8) == 24)\n\t@test(candidate(10) == 81)\n\t@test(candidate(12) == 274)\n\t@test(candidate(14) == 927)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "jl", - "prompt": "\"\"\"You are given a list of numbers.\n You need to return the sum of squared numbers in the given list,\n round each element in the list to the upper int(Ceiling) first.\n Examples:\n \n\n \"\"\"\nfunction sum_squares(lst::Vector{Float64})::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = sum_squares;\n\t@test(candidate([1.0, 2.0, 3.0]) == 14)\n\t@test(candidate([1.0, 2.0, 3.0]) == 14)\n\t@test(candidate([1.0, 3.0, 5.0, 7.0]) == 84)\n\t@test(candidate([1.4, 4.2, 0.0]) == 29)\n\t@test(candidate([-2.4, 1.0, 1.0]) == 6)\n\t@test(candidate([100.0, 1.0, 15.0, 2.0]) == 10230)\n\t@test(candidate([10000.0, 10000.0]) == 200000000)\n\t@test(candidate([-1.4, 4.6, 6.3]) == 75)\n\t@test(candidate([-1.4, 17.9, 18.9, 19.9]) == 1086)\n\t@test(candidate([0.0]) == 0)\n\t@test(candidate([-1.0]) == 1)\n\t@test(candidate([-1.0, 1.0, 0.0]) == 2)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_85_add", - "language": "jl", - "prompt": "\"\"\"Given a non-empty list of integers lst. add the even elements that are at odd indices..\n\n\n Examples:\n \"\"\"\nfunction add(lst::Vector{Int64})::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = add;\n\t@test(candidate([4, 88]) == 88)\n\t@test(candidate([4, 5, 6, 7, 2, 122]) == 122)\n\t@test(candidate([4, 0, 6, 7]) == 0)\n\t@test(candidate([4, 4, 6, 8]) == 12)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "jl", - "prompt": "\"\"\"Return sorted unique elements in a list\n \"\"\"\nfunction unique(l::Vector{Int64})::Vector{Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = unique;\n\t@test(candidate([5, 3, 5, 2, 3, 3, 9, 0, 123]) == [0, 2, 3, 5, 9, 123])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "jl", - "prompt": "\"\"\"\n Given a string text, replace all spaces in it with underscores, \n and if a string has more than 2 consecutive spaces, \n then replace all consecutive spaces with - \n \n \"\"\"\nfunction fix_spaces(text::String)::String \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = fix_spaces;\n\t@test(candidate(\"Example\") == \"Example\")\n\t@test(candidate(\"Mudasir Hanif \") == \"Mudasir_Hanif_\")\n\t@test(candidate(\"Yellow Yellow Dirty Fellow\") == \"Yellow_Yellow__Dirty__Fellow\")\n\t@test(candidate(\"Exa mple\") == \"Exa-mple\")\n\t@test(candidate(\" Exa 1 2 2 mple\") == \"-Exa_1_2_2_mple\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "jl", - "prompt": "\"\"\"Return 2^n modulo p (be aware of numerics).\n \"\"\"\nfunction modp(n::Int64, p::Int64)::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = modp;\n\t@test(candidate(3, 5) == 3)\n\t@test(candidate(1101, 101) == 2)\n\t@test(candidate(0, 101) == 1)\n\t@test(candidate(3, 11) == 8)\n\t@test(candidate(100, 101) == 1)\n\t@test(candidate(30, 5) == 4)\n\t@test(candidate(31, 5) == 3)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "jl", - "prompt": "\"\"\"You have to write a function which validates a given date string and\n returns True if the date is valid otherwise False.\n The date is valid if all of the following rules are satisfied:\n 1. The date string is not empty.\n 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n 3. The months should not be less than 1 or higher than 12.\n 4. The date should be in the format: mm-dd-yyyy\n\n \n \n \n \n \"\"\"\nfunction valid_date(date::String)::Bool \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = valid_date;\n\t@test(candidate(\"03-11-2000\") == true)\n\t@test(candidate(\"15-01-2012\") == false)\n\t@test(candidate(\"04-0-2040\") == false)\n\t@test(candidate(\"06-04-2020\") == true)\n\t@test(candidate(\"01-01-2007\") == true)\n\t@test(candidate(\"03-32-2011\") == false)\n\t@test(candidate(\"\") == false)\n\t@test(candidate(\"04-31-3000\") == false)\n\t@test(candidate(\"06-06-2005\") == true)\n\t@test(candidate(\"21-31-2000\") == false)\n\t@test(candidate(\"04-12-2003\") == true)\n\t@test(candidate(\"04122003\") == false)\n\t@test(candidate(\"20030412\") == false)\n\t@test(candidate(\"2003-04\") == false)\n\t@test(candidate(\"2003-04-12\") == false)\n\t@test(candidate(\"04-2003\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "jl", - "prompt": "\"\"\"\n Write a function that takes a string and returns an ordered version of it.\n Ordered version of string, is a string where all words (separated by space)\n are replaced by a new word where all the characters arranged in\n ascending order based on ascii value.\n Note: You should keep the order of words and blank spaces in the sentence.\n\n For example:\n \"\"\"\nfunction anti_shuffle(s::String)::String \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = anti_shuffle;\n\t@test(candidate(\"Hi\") == \"Hi\")\n\t@test(candidate(\"hello\") == \"ehllo\")\n\t@test(candidate(\"number\") == \"bemnru\")\n\t@test(candidate(\"abcd\") == \"abcd\")\n\t@test(candidate(\"Hello World!!!\") == \"Hello !!!Wdlor\")\n\t@test(candidate(\"\") == \"\")\n\t@test(candidate(\"Hi. My name is Mister Robot. How are you?\") == \".Hi My aemn is Meirst .Rboot How aer ?ouy\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "jl", - "prompt": "\"\"\"\n Given a list of numbers, return whether or not they are sorted\n in ascending order. If list has more than 1 duplicate of the same\n number, return False. Assume no negative numbers and only integers.\n\n Examples\n \"\"\"\nfunction is_sorted(lst::Vector{Int64})::Bool \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_sorted;\n\t@test(candidate([5]) == true)\n\t@test(candidate([1, 2, 3, 4, 5]) == true)\n\t@test(candidate([1, 3, 2, 4, 5]) == false)\n\t@test(candidate([1, 2, 3, 4, 5, 6]) == true)\n\t@test(candidate([1, 2, 3, 4, 5, 6, 7]) == true)\n\t@test(candidate([1, 3, 2, 4, 5, 6, 7]) == false)\n\t@test(candidate(Vector{Int64}([])) == true)\n\t@test(candidate([1]) == true)\n\t@test(candidate([3, 2, 1]) == false)\n\t@test(candidate([1, 2, 2, 2, 3, 4]) == false)\n\t@test(candidate([1, 2, 3, 3, 3, 4]) == false)\n\t@test(candidate([1, 2, 2, 3, 3, 4]) == true)\n\t@test(candidate([1, 2, 3, 4]) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "jl", - "prompt": "\"\"\"You are given a string s.\n Your task is to check if the string is happy or not.\n A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n For example:\n \"\"\"\nfunction is_happy(s::String)::Bool \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_happy;\n\t@test(candidate(\"a\") == false)\n\t@test(candidate(\"aa\") == false)\n\t@test(candidate(\"abcd\") == true)\n\t@test(candidate(\"aabb\") == false)\n\t@test(candidate(\"adb\") == true)\n\t@test(candidate(\"xyy\") == false)\n\t@test(candidate(\"iopaxpoi\") == true)\n\t@test(candidate(\"iopaxioi\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "jl", - "prompt": "\"\"\"\n Write a function that returns True if the object q will fly, and False otherwise.\n The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n\n Example:\n # 1+2 is less than the maximum possible weight, but it's unbalanced.\n\n # it's balanced, but 3+2+3 is more than the maximum possible weight.\n\n # 3+2+3 is less than the maximum possible weight, and it's balanced.\n\n # 3 is less than the maximum possible weight, and it's balanced.\n \"\"\"\nfunction will_it_fly(q::Vector{Int64}, w::Int64)::Bool \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = will_it_fly;\n\t@test(candidate([3, 2, 3], 9) == true)\n\t@test(candidate([1, 2], 5) == false)\n\t@test(candidate([3], 5) == true)\n\t@test(candidate([3, 2, 3], 1) == false)\n\t@test(candidate([1, 2, 3], 6) == false)\n\t@test(candidate([5], 5) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "jl", - "prompt": "\"\"\"\n Given an array of non-negative integers, return a copy of the given array after sorting,\n you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n or sort it in descending order if the sum( first index value, last index value) is even.\n\n Note:\n * don't change the given array.\n\n Examples:\n \"\"\"\nfunction sort_array(array::Vector{Int64})::Vector{Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = sort_array;\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([5]) == [5])\n\t@test(candidate([2, 4, 3, 0, 1, 5]) == [0, 1, 2, 3, 4, 5])\n\t@test(candidate([2, 4, 3, 0, 1, 5, 6]) == [6, 5, 4, 3, 2, 1, 0])\n\t@test(candidate([2, 1]) == [1, 2])\n\t@test(candidate([15, 42, 87, 32, 11, 0]) == [0, 11, 15, 32, 42, 87])\n\t@test(candidate([21, 14, 23, 11]) == [23, 21, 14, 11])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "jl", - "prompt": "\"\"\"Implement a function that takes an non-negative integer and returns an array of the first n\n integers that are prime numbers and less than n.\n for example:\n \"\"\"\nfunction count_up_to(n::Int64)::Vector{Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = count_up_to;\n\t@test(candidate(5) == [2, 3])\n\t@test(candidate(6) == [2, 3, 5])\n\t@test(candidate(7) == [2, 3, 5])\n\t@test(candidate(10) == [2, 3, 5, 7])\n\t@test(candidate(0) == Vector{Int64}([]))\n\t@test(candidate(22) == [2, 3, 5, 7, 11, 13, 17, 19])\n\t@test(candidate(1) == Vector{Int64}([]))\n\t@test(candidate(18) == [2, 3, 5, 7, 11, 13, 17])\n\t@test(candidate(47) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43])\n\t@test(candidate(101) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "jl", - "prompt": "\"\"\" Out of list of strings, return the longest one. Return the first one in case of multiple\n strings of the same length. Return None in case the input list is empty.\n \"\"\"\nfunction longest(strings::Vector{String})::Union{String, Nothing} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = longest;\n\t@test(candidate(Vector{String}([])) == nothing)\n\t@test(candidate([\"x\", \"y\", \"z\"]) == \"x\")\n\t@test(candidate([\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"]) == \"zzzz\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "jl", - "prompt": "\"\"\"\n Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n reverse the resulting array, and then replace each digit by its corresponding name from\n \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n\n For example:\n \n If the array is empty, return an empty array:\n \n If the array has any strange number ignore it:\n \"\"\"\nfunction by_length(arr::Vector{Int64})::Vector{String} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = by_length;\n\t@test(candidate([2, 1, 1, 4, 5, 8, 2, 3]) == [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"])\n\t@test(candidate(Vector{Int64}([])) == Vector{String}([]))\n\t@test(candidate([1, -1, 55]) == [\"One\"])\n\t@test(candidate([1, -1, 3, 2]) == [\"Three\", \"Two\", \"One\"])\n\t@test(candidate([9, 4, 8]) == [\"Nine\", \"Eight\", \"Four\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_106_f", - "language": "jl", - "prompt": "\"\"\" Implement the function f that takes n as a parameter,\n 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\n or the sum of numbers from 1 to i otherwise.\n i starts from 1.\n the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n Example:\n \"\"\"\nfunction f(n::Int64)::Vector{Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = f;\n\t@test(candidate(5) == [1, 2, 6, 24, 15])\n\t@test(candidate(7) == [1, 2, 6, 24, 15, 720, 28])\n\t@test(candidate(1) == [1])\n\t@test(candidate(3) == [1, 2, 6])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "jl", - "prompt": "\"\"\"Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n \"\"\"\nfunction fizz_buzz(n::Int64)::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = fizz_buzz;\n\t@test(candidate(50) == 0)\n\t@test(candidate(78) == 2)\n\t@test(candidate(79) == 3)\n\t@test(candidate(100) == 3)\n\t@test(candidate(200) == 6)\n\t@test(candidate(4000) == 192)\n\t@test(candidate(10000) == 639)\n\t@test(candidate(100000) == 8026)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "jl", - "prompt": "\"\"\" Given a positive floating point number, it can be decomposed into\n and integer part (largest integer smaller than given number) and decimals\n (leftover part always smaller than 1).\n\n Return the decimal part of the number.\n \"\"\"\nfunction truncate_number(number::Float64)::Float64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = truncate_number;\n\t@test(candidate(3.5) == 0.5)\n\t@test(candidate(1.25) == 0.25)\n\t@test(candidate(123.0) == 0.0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "jl", - "prompt": "\"\"\" For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n Empty sum should be equal to 0 and empty product should be equal to 1.\n \"\"\"\nfunction sum_product(numbers::Vector{Int64})::Tuple{Int64, Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = sum_product;\n\t@test(candidate(Vector{Int64}([])) == (0, 1))\n\t@test(candidate([1, 1, 1]) == (3, 1))\n\t@test(candidate([100, 0]) == (100, 0))\n\t@test(candidate([3, 5, 7]) == (15, 105))\n\t@test(candidate([10]) == (10, 10))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "jl", - "prompt": "\"\"\"\n You are given a 2 dimensional data, as a nested lists,\n which is similar to matrix, however, unlike matrices,\n each row may contain a different number of columns.\n Given lst, and integer x, find integers x in the list,\n and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n each tuple is a coordinate - (row, columns), starting with 0.\n Sort coordinates initially by rows in ascending order.\n Also, sort coordinates of the row by columns in descending order.\n \n Examples:\n \"\"\"\nfunction get_row(lst::Vector{Vector{Int64}}, x::Int64)::Vector{Tuple{Int64, Int64}} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = get_row;\n\t@test(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)])\n\t@test(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6]], 2) == [(0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1)])\n\t@test(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 1, 3, 4, 5, 6], [1, 2, 1, 4, 5, 6], [1, 2, 3, 1, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1) == [(0, 0), (1, 0), (2, 1), (2, 0), (3, 2), (3, 0), (4, 3), (4, 0), (5, 4), (5, 0), (6, 5), (6, 0)])\n\t@test(candidate(Vector{Vector{Int64}}([]), 1) == Vector{Tuple{Int64, Int64}}([]))\n\t@test(candidate([[1]], 2) == Vector{Tuple{Int64, Int64}}([]))\n\t@test(candidate([[], [1], [1, 2, 3]], 3) == [(2, 2)])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "jl", - "prompt": "\"\"\"\n You're a hungry rabbit, and you already have eaten a certain number of carrots,\n but now you need to eat more carrots to complete the day's meals.\n you should return an array of [ total number of eaten carrots after your meals,\n the number of carrots left after your meals ]\n if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n \n Example:\n \n Variables:\n @number : integer\n the number of carrots that you have eaten.\n @need : integer\n the number of carrots that you need to eat.\n @remaining : integer\n the number of remaining carrots thet exist in stock\n \n Constrain:\n * 0 <= number <= 1000\n * 0 <= need <= 1000\n * 0 <= remaining <= 1000\n\n Have fun :)\n \"\"\"\nfunction eat(number::Int64, need::Int64, remaining::Int64)::Vector{Int64} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = eat;\n\t@test(candidate(5, 6, 10) == [11, 4])\n\t@test(candidate(4, 8, 9) == [12, 1])\n\t@test(candidate(1, 10, 10) == [11, 0])\n\t@test(candidate(2, 11, 5) == [7, 0])\n\t@test(candidate(4, 5, 7) == [9, 2])\n\t@test(candidate(4, 5, 1) == [5, 0])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "jl", - "prompt": "\"\"\"Given a positive integer N, return the total sum of its digits in binary.\n \n Example\n \n Variables:\n @N integer\n Constraints: 0 \u2264 N \u2264 10000.\n Output:\n a string of binary number\n \"\"\"\nfunction solve(N::Int64)::String \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = solve;\n\t@test(candidate(1000) == \"1\")\n\t@test(candidate(150) == \"110\")\n\t@test(candidate(147) == \"1100\")\n\t@test(candidate(333) == \"1001\")\n\t@test(candidate(963) == \"10010\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "jl", - "prompt": "\"\"\"You are given a list of integers.\n You need to find the largest prime value and return the sum of its digits.\n\n Examples:\n \"\"\"\nfunction skjkasdkd(lst::Vector{Int64})::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = skjkasdkd;\n\t@test(candidate([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]) == 10)\n\t@test(candidate([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]) == 25)\n\t@test(candidate([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]) == 13)\n\t@test(candidate([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]) == 11)\n\t@test(candidate([0, 81, 12, 3, 1, 21]) == 3)\n\t@test(candidate([0, 8, 1, 2, 1, 7]) == 7)\n\t@test(candidate([8191]) == 19)\n\t@test(candidate([8191, 123456, 127, 7]) == 19)\n\t@test(candidate([127, 97, 8192]) == 10)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "jl", - "prompt": "\"\"\"\n Given an array arr of integers, find the minimum number of elements that\n need to be changed to make the array palindromic. A palindromic array is an array that\n is read the same backwards and forwards. In one change, you can change one element to any other element.\n\n For example:\n \"\"\"\nfunction smallest_change(arr::Vector{Int64})::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = smallest_change;\n\t@test(candidate([1, 2, 3, 5, 4, 7, 9, 6]) == 4)\n\t@test(candidate([1, 2, 3, 4, 3, 2, 2]) == 1)\n\t@test(candidate([1, 4, 2]) == 1)\n\t@test(candidate([1, 4, 4, 2]) == 1)\n\t@test(candidate([1, 2, 3, 2, 1]) == 0)\n\t@test(candidate([3, 1, 1, 3]) == 0)\n\t@test(candidate([1]) == 0)\n\t@test(candidate([0, 1]) == 1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "jl", - "prompt": "\"\"\"It is the last week of the semester and the teacher has to give the grades\n to students. The teacher has been making her own algorithm for grading.\n The only problem is, she has lost the code she used for grading.\n She has given you a list of GPAs for some students and you have to write \n a function that can output a list of letter grades using the following table:\n GPA | Letter grade\n 4.0 A+\n > 3.7 A \n > 3.3 A- \n > 3.0 B+\n > 2.7 B \n > 2.3 B-\n > 2.0 C+\n > 1.7 C\n > 1.3 C-\n > 1.0 D+ \n > 0.7 D \n > 0.0 D-\n 0.0 E\n \n\n Example:\n \"\"\"\nfunction numerical_letter_grade(grades::Vector{Float64})::Vector{String} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = numerical_letter_grade;\n\t@test(candidate([4.0, 3, 1.7, 2, 3.5]) == [\"A+\", \"B\", \"C-\", \"C\", \"A-\"])\n\t@test(candidate([1.2]) == [\"D+\"])\n\t@test(candidate([0.5]) == [\"D-\"])\n\t@test(candidate([0.0]) == [\"E\"])\n\t@test(candidate([1.0, 0.3, 1.5, 2.8, 3.3]) == [\"D\", \"D-\", \"C-\", \"B\", \"B+\"])\n\t@test(candidate([0.0, 0.7]) == [\"E\", \"D-\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "jl", - "prompt": "\"\"\"\n Given the lengths of the three sides of a triangle. Return the area of\n the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n Otherwise return -1\n Three sides make a valid triangle when the sum of any two sides is greater \n than the third side.\n Example:\n \"\"\"\nfunction triangle_area(a::Int64, b::Int64, c::Int64)::Float64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = triangle_area;\n\t@test(candidate(3, 4, 5) == 6.0)\n\t@test(candidate(1, 2, 10) == -1)\n\t@test(candidate(4, 8, 5) == 8.18)\n\t@test(candidate(2, 2, 2) == 1.73)\n\t@test(candidate(1, 2, 3) == -1)\n\t@test(candidate(10, 5, 7) == 16.25)\n\t@test(candidate(2, 6, 3) == -1)\n\t@test(candidate(1, 1, 1) == 0.43)\n\t@test(candidate(2, 2, 10) == -1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "jl", - "prompt": "\"\"\"\n Check if two words have the same characters.\n \"\"\"\nfunction same_chars(s0::String, s1::String)::Bool \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = same_chars;\n\t@test(candidate(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\") == true)\n\t@test(candidate(\"abcd\", \"dddddddabc\") == true)\n\t@test(candidate(\"dddddddabc\", \"abcd\") == true)\n\t@test(candidate(\"eabcd\", \"dddddddabc\") == false)\n\t@test(candidate(\"abcd\", \"dddddddabcf\") == false)\n\t@test(candidate(\"eabcdzzzz\", \"dddzzzzzzzddddabc\") == false)\n\t@test(candidate(\"aabb\", \"aaccc\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "jl", - "prompt": "\"\"\"\n Given an array of integers nums, find the minimum sum of any non-empty sub-array\n of nums.\n Example\n \"\"\"\nfunction minSubArraySum(nums::Vector{Int64})::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = minSubArraySum;\n\t@test(candidate([2, 3, 4, 1, 2, 4]) == 1)\n\t@test(candidate([-1, -2, -3]) == -6)\n\t@test(candidate([-1, -2, -3, 2, -10]) == -14)\n\t@test(candidate([-9999999999999999]) == -9999999999999999)\n\t@test(candidate([0, 10, 20, 1000000]) == 0)\n\t@test(candidate([-1, -2, -3, 10, -5]) == -6)\n\t@test(candidate([100, -1, -2, -3, 10, -5]) == -6)\n\t@test(candidate([10, 11, 13, 8, 3, 4]) == 3)\n\t@test(candidate([100, -33, 32, -1, 0, -2]) == -33)\n\t@test(candidate([-10]) == -10)\n\t@test(candidate([7]) == 7)\n\t@test(candidate([1, -1]) == -1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "jl", - "prompt": "\"\"\"Given a string s and a natural number n, you have been tasked to implement \n a function that returns a list of all words from string s that contain exactly \n n consonants, in order these words appear in the string s.\n If the string s is empty then the function should return an empty list.\n Note: you may assume the input string contains only letters and spaces.\n Examples:\n \"\"\"\nfunction select_words(s::String, n::Int64)::Vector{String} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = select_words;\n\t@test(candidate(\"Mary had a little lamb\", 4) == [\"little\"])\n\t@test(candidate(\"Mary had a little lamb\", 3) == [\"Mary\", \"lamb\"])\n\t@test(candidate(\"simple white space\", 2) == Vector{String}([]))\n\t@test(candidate(\"Hello world\", 4) == [\"world\"])\n\t@test(candidate(\"Uncle sam\", 3) == [\"Uncle\"])\n\t@test(candidate(\"\", 4) == Vector{String}([]))\n\t@test(candidate(\"a b c d e f\", 1) == [\"b\", \"c\", \"d\", \"f\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "jl", - "prompt": "\"\"\" Return list of all prefixes from shortest to longest of the input string\n \"\"\"\nfunction all_prefixes(string::String)::Vector{String} \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = all_prefixes;\n\t@test(candidate(\"\") == Vector{String}([]))\n\t@test(candidate(\"asdfgh\") == [\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"])\n\t@test(candidate(\"WWW\") == [\"W\", \"WW\", \"WWW\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "jl", - "prompt": "\"\"\"\n Create a function that takes a value (string) representing a number\n and returns the closest integer to it. If the number is equidistant\n from two integers, round it away from zero.\n\n Examples\n \n Note:\n Rounding away from zero means that if the given number is equidistant\n from two integers, the one you should return is the one that is the\n farthest from zero. For example closest_integer(\"14.5\") should\n return 15 and closest_integer(\"-14.5\") should return -15.\n \"\"\"\nfunction closest_integer(value::String)::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = closest_integer;\n\t@test(candidate(\"10\") == 10)\n\t@test(candidate(\"14.5\") == 15)\n\t@test(candidate(\"-15.5\") == -16)\n\t@test(candidate(\"15.3\") == 15)\n\t@test(candidate(\"0\") == 0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "jl", - "prompt": "\"\"\"Create a function which takes a string representing a file's name, and returns\n 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n A file's name is considered to be valid if and only if all the following conditions \n are met:\n - There should not be more than three digits ('0'-'9') in the file's name.\n - The file's name contains exactly one dot '.'\n - The substring before the dot should not be empty, and it starts with a letter from \n the latin alphapet ('a'-'z' and 'A'-'Z').\n - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n Examples:\n \"\"\"\nfunction file_name_check(file_name::String)::String \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = file_name_check;\n\t@test(candidate(\"example.txt\") == \"Yes\")\n\t@test(candidate(\"1example.dll\") == \"No\")\n\t@test(candidate(\"s1sdf3.asd\") == \"No\")\n\t@test(candidate(\"K.dll\") == \"Yes\")\n\t@test(candidate(\"MY16FILE3.exe\") == \"Yes\")\n\t@test(candidate(\"His12FILE94.exe\") == \"No\")\n\t@test(candidate(\"_Y.txt\") == \"No\")\n\t@test(candidate(\"?aREYA.exe\") == \"No\")\n\t@test(candidate(\"/this_is_valid.dll\") == \"No\")\n\t@test(candidate(\"this_is_valid.wow\") == \"No\")\n\t@test(candidate(\"this_is_valid.txt\") == \"Yes\")\n\t@test(candidate(\"this_is_valid.txtexe\") == \"No\")\n\t@test(candidate(\"#this2_i4s_5valid.ten\") == \"No\")\n\t@test(candidate(\"@this1_is6_valid.exe\") == \"No\")\n\t@test(candidate(\"this_is_12valid.6exe4.txt\") == \"No\")\n\t@test(candidate(\"all.exe.txt\") == \"No\")\n\t@test(candidate(\"I563_No.exe\") == \"Yes\")\n\t@test(candidate(\"Is3youfault.txt\") == \"Yes\")\n\t@test(candidate(\"no_one#knows.dll\") == \"Yes\")\n\t@test(candidate(\"1I563_Yes3.exe\") == \"No\")\n\t@test(candidate(\"I563_Yes3.txtt\") == \"No\")\n\t@test(candidate(\"final..txt\") == \"No\")\n\t@test(candidate(\"final132\") == \"No\")\n\t@test(candidate(\"_f4indsartal132.\") == \"No\")\n\t@test(candidate(\".txt\") == \"No\")\n\t@test(candidate(\"s.\") == \"No\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "jl", - "prompt": "\"\"\"You are given two intervals,\n where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n The given intervals are closed which means that the interval (start, end)\n includes both start and end.\n For each given interval, it is assumed that its start is less or equal its end.\n Your task is to determine whether the length of intersection of these two \n intervals is a prime number.\n Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n which its length is 1, which not a prime number.\n If the length of the intersection is a prime number, return \"YES\",\n otherwise, return \"NO\".\n If the two intervals don't intersect, return \"NO\".\n\n\n [input/output] samples:\n \"\"\"\nfunction intersection(interval1::Tuple{Int64, Int64}, interval2::Tuple{Int64, Int64})::String \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = intersection;\n\t@test(candidate((1, 2), (2, 3)) == \"NO\")\n\t@test(candidate((-1, 1), (0, 4)) == \"NO\")\n\t@test(candidate((-3, -1), (-5, 5)) == \"YES\")\n\t@test(candidate((-2, 2), (-4, 0)) == \"YES\")\n\t@test(candidate((-11, 2), (-1, -1)) == \"NO\")\n\t@test(candidate((1, 2), (3, 5)) == \"NO\")\n\t@test(candidate((1, 2), (1, 2)) == \"NO\")\n\t@test(candidate((-2, -2), (-3, -2)) == \"NO\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "jl", - "prompt": "\"\"\"Return the largest prime factor of n. Assume n > 1 and is not a prime.\n \"\"\"\nfunction largest_prime_factor(n::Int64)::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = largest_prime_factor;\n\t@test(candidate(15) == 5)\n\t@test(candidate(27) == 3)\n\t@test(candidate(63) == 7)\n\t@test(candidate(330) == 11)\n\t@test(candidate(13195) == 29)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "jl", - "prompt": "\"\"\" Given a string, find out how many distinct characters (regardless of case) does it consist of\n \"\"\"\nfunction count_distinct_characters(string::String)::Int64 \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = count_distinct_characters;\n\t@test(candidate(\"\") == 0)\n\t@test(candidate(\"abcde\") == 5)\n\t@test(candidate(\"abcdecadeCADE\") == 5)\n\t@test(candidate(\"aaaaAAAAaaaa\") == 1)\n\t@test(candidate(\"Jerry jERRY JeRRRY\") == 5)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "jl", - "prompt": "\"\"\" You're given a list of deposit and withdrawal operations on a bank account that starts with\n zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n at that point function should return True. Otherwise it should return False.\n \"\"\"\nfunction below_zero(operations::Vector{Int64})::Bool \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = below_zero;\n\t@test(candidate(Vector{Int64}([])) == false)\n\t@test(candidate([1, 2, -3, 1, 2, -3]) == false)\n\t@test(candidate([1, 2, -4, 5, 6]) == true)\n\t@test(candidate([1, -1, 2, -2, 5, -5, 4, -4]) == false)\n\t@test(candidate([1, -1, 2, -2, 5, -5, 4, -5]) == true)\n\t@test(candidate([1, -2, 2, -2, 5, -5, 4, -4]) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "jl", - "prompt": "\"\"\" Find the shortest palindrome that begins with a supplied string.\n Algorithm idea is simple:\n - Find the longest postfix of supplied string that is a palindrome.\n - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n \"\"\"\nfunction make_palindrome(string::String)::String \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = make_palindrome;\n\t@test(candidate(\"\") == \"\")\n\t@test(candidate(\"x\") == \"x\")\n\t@test(candidate(\"xyz\") == \"xyzyx\")\n\t@test(candidate(\"xyx\") == \"xyx\")\n\t@test(candidate(\"jerry\") == \"jerryrrej\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "jl", - "prompt": "\"\"\"\n Given a positive integer, obtain its roman numeral equivalent as a string,\n and return it in lowercase.\n Restrictions: 1 <= num <= 1000\n\n Examples:\n \"\"\"\nfunction int_to_mini_roman(number::Int64)::String \n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = int_to_mini_roman;\n\t@test(candidate(19) == \"xix\")\n\t@test(candidate(152) == \"clii\")\n\t@test(candidate(251) == \"ccli\")\n\t@test(candidate(426) == \"cdxxvi\")\n\t@test(candidate(500) == \"d\")\n\t@test(candidate(1) == \"i\")\n\t@test(candidate(4) == \"iv\")\n\t@test(candidate(43) == \"xliii\")\n\t@test(candidate(90) == \"xc\")\n\t@test(candidate(94) == \"xciv\")\n\t@test(candidate(532) == \"dxxxii\")\n\t@test(candidate(900) == \"cm\")\n\t@test(candidate(994) == \"cmxciv\")\n\t@test(candidate(1000) == \"m\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - } -] \ No newline at end of file diff --git a/data/jl-reworded.json b/data/jl-reworded.json deleted file mode 100644 index be38805c6cab4cd1aa02b840cf1ec3583a46d147..0000000000000000000000000000000000000000 --- a/data/jl-reworded.json +++ /dev/null @@ -1,2228 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "jl", - "prompt": "\"\"\" For a given number n, find the largest number that divides n evenly, smaller than n\n >>> largest_divisor(15)\n 5\n \"\"\"\nfunction largest_divisor(n::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = largest_divisor;\n\t@test(candidate(3) == 1)\n\t@test(candidate(7) == 1)\n\t@test(candidate(10) == 5)\n\t@test(candidate(100) == 50)\n\t@test(candidate(49) == 7)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_47_median", - "language": "jl", - "prompt": "\"\"\"Return median of elements in the vector l.\n >>> median([3, 1, 2, 4, 5])\n 3\n >>> median([-10, 4, 6, 1000, 10, 20])\n 15.0\n \"\"\"\nfunction median(l::Vector{Int64})::Float64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = median;\n\t@test(candidate([3, 1, 2, 4, 5]) == 3)\n\t@test(candidate([-10, 4, 6, 1000, 10, 20]) == 8.0)\n\t@test(candidate([5]) == 5)\n\t@test(candidate([6, 5]) == 5.5)\n\t@test(candidate([8, 1, 3, 9, 9, 2, 7]) == 7)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "jl", - "prompt": "\"\"\"\n Given two vectors operator, and operand. The first vector has basic algebra operations, and \n the second vector is a vector of integers. Use the two given vectors to build the algebric \n expression and return the evaluation of this expression.\n\n The basic algebra operations:\n Addition ( + ) \n Subtraction ( - ) \n Multiplication ( * ) \n Floor division ( // ) \n Exponentiation ( ** ) \n\n Example:\n operator['+', '*', '-']\n vector = [2, 3, 4, 5]\n result = 2 + 3 * 4 - 5\n => result = 9\n\n Note:\n The length of operator vector is equal to the length of operand vector minus one.\n Operand is a vector of of non-negative integers.\n Operator vector has at least one operator, and operand vector has at least two operands.\n\n \"\"\"\nfunction do_algebra(operator::Vector{String}, operand::Vector{Int64})::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = do_algebra;\n\t@test(candidate([\"**\", \"*\", \"+\"], [2, 3, 4, 5]) == 37)\n\t@test(candidate([\"+\", \"*\", \"-\"], [2, 3, 4, 5]) == 9)\n\t@test(candidate([\"//\", \"*\"], [7, 3, 4]) == 8)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "jl", - "prompt": "\"\"\"Return maximum element in the vector.\n >>> max_element([1, 2, 3])\n 3\n >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n 123\n \"\"\"\nfunction max_element(l::Vector{Int64})::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = max_element;\n\t@test(candidate([1, 2, 3]) == 3)\n\t@test(candidate([5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]) == 124)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "jl", - "prompt": "\"\"\"Create a function which returns the largest index of an element which\n is not greater than or equal to the element immediately preceding it. If\n no such element exists then return -1. The given vector will not contain\n duplicate values.\n\n Examples:\n >>> can_arrange([1, 2, 4, 3, 5])\n 3\n >>> can_arrange([1, 2, 3])\n -1\n \"\"\"\nfunction can_arrange(arr::Vector{Int64})::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = can_arrange;\n\t@test(candidate([1, 2, 4, 3, 5]) == 3)\n\t@test(candidate([1, 2, 4, 5]) == -1)\n\t@test(candidate([1, 4, 2, 5, 6, 7, 8, 9, 10]) == 2)\n\t@test(candidate([4, 8, 5, 7, 3]) == 4)\n\t@test(candidate(Vector{Int64}([])) == -1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "jl", - "prompt": "\"\"\"\n Imagine a road that's a perfectly straight infinitely long line.\n n cars are driving left to right; simultaneously, a different set of n cars\n are driving right to left. The two sets of cars start out being very far from\n each other. All cars move in the same speed. Two cars are said to collide\n when a car that's moving left to right hits a car that's moving right to left.\n However, the cars are infinitely sturdy and strong; as a result, they continue moving\n in their trajectory as if they did not collide.\n\n This function outputs the number of such collisions.\n \"\"\"\nfunction car_race_collision(n::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = car_race_collision;\n\t@test(candidate(2) == 4)\n\t@test(candidate(3) == 9)\n\t@test(candidate(4) == 16)\n\t@test(candidate(8) == 64)\n\t@test(candidate(10) == 100)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "jl", - "prompt": "\"\"\"\n Create a function that returns true if the last character\n of a given string is an alphabetical character and is not\n a part of a word, and false otherwise.\n Note: \"word\" is a group of characters separated by space.\n\n Examples:\n >>> check_if_last_char_is_a_letter(\"apple pie\")\n false\n >>> check_if_last_char_is_a_letter(\"apple pi e\")\n true\n >>> check_if_last_char_is_a_letter(\"apple pi e \")\n false\n >>> check_if_last_char_is_a_letter(\"\")\n false\n \"\"\"\nfunction check_if_last_char_is_a_letter(txt::String)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = check_if_last_char_is_a_letter;\n\t@test(candidate(\"apple\") == false)\n\t@test(candidate(\"apple pi e\") == true)\n\t@test(candidate(\"eeeee\") == false)\n\t@test(candidate(\"A\") == true)\n\t@test(candidate(\"Pumpkin pie \") == false)\n\t@test(candidate(\"Pumpkin pie 1\") == false)\n\t@test(candidate(\"\") == false)\n\t@test(candidate(\"eeeee e \") == false)\n\t@test(candidate(\"apple pie\") == false)\n\t@test(candidate(\"apple pi e \") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "jl", - "prompt": "\"\"\"Return true if a given number is prime, and false otherwise.\n >>> is_prime(6)\n false\n >>> is_prime(101)\n true\n >>> is_prime(11)\n true\n >>> is_prime(13441)\n true\n >>> is_prime(61)\n true\n >>> is_prime(4)\n false\n >>> is_prime(1)\n false\n \"\"\"\nfunction is_prime(n::Int64)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_prime;\n\t@test(candidate(6) == false)\n\t@test(candidate(101) == true)\n\t@test(candidate(11) == true)\n\t@test(candidate(13441) == true)\n\t@test(candidate(61) == true)\n\t@test(candidate(4) == false)\n\t@test(candidate(1) == false)\n\t@test(candidate(5) == true)\n\t@test(candidate(11) == true)\n\t@test(candidate(17) == true)\n\t@test(candidate(85) == false)\n\t@test(candidate(77) == false)\n\t@test(candidate(255379) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "jl", - "prompt": "\"\"\"Given a vector of positive integers x. return a sorted vector of all \n elements that hasn't any even digit.\n\n Note: Returned vector should be sorted in increasing order.\n \n For example:\n >>> unique_digits([15, 33, 1422, 1])\n [1, 15, 33]\n >>> unique_digits([152, 323, 1422, 10])\n []\n \"\"\"\nfunction unique_digits(x::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = unique_digits;\n\t@test(candidate([15, 33, 1422, 1]) == [1, 15, 33])\n\t@test(candidate([152, 323, 1422, 10]) == Vector{Int64}([]))\n\t@test(candidate([12345, 2033, 111, 151]) == [111, 151])\n\t@test(candidate([135, 103, 31]) == [31, 135])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "jl", - "prompt": "\"\"\" Input are two strings a and b consisting only of 1s and 0s.\n Perform binary XOR on these inputs and return result also as a string.\n >>> string_xor(\"010\", \"110\")\n \"100\"\n \"\"\"\nfunction string_xor(a::String, b::String)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = string_xor;\n\t@test(candidate(\"111000\", \"101010\") == \"010010\")\n\t@test(candidate(\"1\", \"1\") == \"0\")\n\t@test(candidate(\"0101\", \"0000\") == \"0101\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "jl", - "prompt": "\"\"\"sum_to_n is a function that sums numbers from 1 to n.\n >>> sum_to_n(30)\n 465\n >>> sum_to_n(100)\n 5050\n >>> sum_to_n(5)\n 15\n >>> sum_to_n(10)\n 55\n >>> sum_to_n(1)\n 1\n \"\"\"\nfunction sum_to_n(n::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = sum_to_n;\n\t@test(candidate(1) == 1)\n\t@test(candidate(6) == 21)\n\t@test(candidate(11) == 66)\n\t@test(candidate(30) == 465)\n\t@test(candidate(100) == 5050)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "jl", - "prompt": "\"\"\"\n Given a vector of numbers, return the sum of squares of the numbers\n in the vector that are odd. Ignore numbers that are negative or not integers.\n \n >>> double_the_difference([1, 3, 2, 0])\n 10\n >>> double_the_difference([-1, -2, 0])\n 0\n >>> double_the_difference([9, -2])\n 81\n >>> double_the_difference([0])\n 0\n \n If the input vector is empty, return 0.\n \"\"\"\nfunction double_the_difference(lst::Vector{Float64})::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = double_the_difference;\n\t@test(candidate(Vector{Float64}([])) == 0)\n\t@test(candidate([5.0, 4.0]) == 25)\n\t@test(candidate([0.1, 0.2, 0.3]) == 0)\n\t@test(candidate([-10.0, -20.0, -30.0]) == 0)\n\t@test(candidate([-1.0, -2.0, 8.0]) == 0)\n\t@test(candidate([0.2, 3.0, 5.0]) == 34)\n\t@test(candidate([-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]) == 165)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "jl", - "prompt": "\"\"\" Return length of given string\n >>> strlen(\"\")\n 0\n >>> strlen(\"abc\")\n 3\n \"\"\"\nfunction strlen(string::String)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = strlen;\n\t@test(candidate(\"\") == 0)\n\t@test(candidate(\"x\") == 1)\n\t@test(candidate(\"asdasnakj\") == 9)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "jl", - "prompt": "\"\"\"\n You'll be given a string of words, and your task is to count the number\n of boredoms. A boredom is a sentence that starts with the word \"I\".\n Sentences are delimited by '.', '?' or '!'.\n \n For example:\n >>> is_bored(\"Hello world\")\n 0\n >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n 1\n \"\"\"\nfunction is_bored(S::String)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_bored;\n\t@test(candidate(\"Hello world\") == 0)\n\t@test(candidate(\"Is the sky blue?\") == 0)\n\t@test(candidate(\"I love It !\") == 1)\n\t@test(candidate(\"bIt\") == 0)\n\t@test(candidate(\"I feel good today. I will be productive. will kill It\") == 2)\n\t@test(candidate(\"You and I are going for a walk\") == 0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "jl", - "prompt": "\"\"\"Write a function vowels_count which takes a string representing\n a word as input and returns the number of vowels in the string.\n Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n vowel, but only when it is at the end of the given word.\n\n Example:\n >>> vowels_count(\"abcde\")\n 2\n >>> vowels_count(\"ACEDY\")\n 3\n \"\"\"\nfunction vowels_count(s::String)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = vowels_count;\n\t@test(candidate(\"abcde\") == 2)\n\t@test(candidate(\"Alone\") == 3)\n\t@test(candidate(\"key\") == 2)\n\t@test(candidate(\"bye\") == 1)\n\t@test(candidate(\"keY\") == 2)\n\t@test(candidate(\"bYe\") == 1)\n\t@test(candidate(\"ACEDY\") == 3)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "jl", - "prompt": "\"\"\"Return n-th Fibonacci number.\n >>> fib(10)\n 55\n >>> fib(1)\n 1\n >>> fib(8)\n 21\n \"\"\"\nfunction fib(n::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = fib;\n\t@test(candidate(10) == 55)\n\t@test(candidate(1) == 1)\n\t@test(candidate(8) == 21)\n\t@test(candidate(11) == 89)\n\t@test(candidate(12) == 144)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "jl", - "prompt": "\"\"\"Your task is to implement a function that will simplify the expression\n x * n. The function returns true if x * n evaluates to a whole number and false\n otherwise. Both x and n, are string representation of a fraction, and have the following format,\n / where both numerator and denominator are positive whole numbers.\n\n You can assume that x, and n are valid fractions, and do not have zero as denominator.\n\n >>> simplify(\"1/5\", \"5/1\")\n true\n >>> simplify(\"1/6\", \"2/1\")\n false\n >>> simplify(\"7/10\", \"10/2\")\n false\n \"\"\"\nfunction simplify(x::String, n::String)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = simplify;\n\t@test(candidate(\"1/5\", \"5/1\") == true)\n\t@test(candidate(\"1/6\", \"2/1\") == false)\n\t@test(candidate(\"5/1\", \"3/1\") == true)\n\t@test(candidate(\"7/10\", \"10/2\") == false)\n\t@test(candidate(\"2/10\", \"50/10\") == true)\n\t@test(candidate(\"7/2\", \"4/2\") == true)\n\t@test(candidate(\"11/6\", \"6/1\") == true)\n\t@test(candidate(\"2/3\", \"5/2\") == false)\n\t@test(candidate(\"5/2\", \"3/5\") == false)\n\t@test(candidate(\"2/4\", \"8/4\") == true)\n\t@test(candidate(\"2/4\", \"4/2\") == true)\n\t@test(candidate(\"1/5\", \"5/1\") == true)\n\t@test(candidate(\"1/5\", \"1/5\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "jl", - "prompt": "\"\"\"\n Given a string s, count the number of uppercase vowels in even indices.\n \n For example:\n >>> count_upper(\"aBCdEf\")\n 1\n >>> count_upper(\"abcdefg\")\n 0\n >>> count_upper(\"dBBE\")\n 0\n \"\"\"\nfunction count_upper(s::String)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = count_upper;\n\t@test(candidate(\"aBCdEf\") == 1)\n\t@test(candidate(\"abcdefg\") == 0)\n\t@test(candidate(\"dBBE\") == 0)\n\t@test(candidate(\"B\") == 0)\n\t@test(candidate(\"U\") == 1)\n\t@test(candidate(\"\") == 0)\n\t@test(candidate(\"EEEE\") == 2)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "jl", - "prompt": "\"\"\"\n You are given a rectangular grid of wells. Each row represents a single well,\n and each 1 in a row represents a single unit of water.\n Each well has a corresponding bucket that can be used to extract water from it, \n and all buckets have the same capacity.\n Your task is to use the buckets to empty the wells.\n Output the number of times you need to lower the buckets.\n\n Example 1:\n >>> max_fill([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1)\n 6\n\n Example 2:\n >>> max_fill([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2)\n 5\n \n Example 3:\n >>> max_fill([[0, 0, 0], [0, 0, 0]], 5)\n 0\n\n Constraints:\n * all wells have the same length\n * 1 <= grid.length <= 10^2\n * 1 <= grid[:,1].length <= 10^2\n * grid[i][j] -> 0 | 1\n * 1 <= capacity <= 10\n \"\"\"\nfunction max_fill(grid::Vector{Vector{Int64}}, capacity::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = max_fill;\n\t@test(candidate([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1) == 6)\n\t@test(candidate([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2) == 5)\n\t@test(candidate([[0, 0, 0], [0, 0, 0]], 5) == 0)\n\t@test(candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 2) == 4)\n\t@test(candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 9) == 2)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "jl", - "prompt": "\"\"\"\n Given a vector arr of integers and a positive integer k, return a sorted vector \n of length k with the maximum k numbers in arr.\n\n Example 1:\n\n >>> maximum([-3, -4, 5], 3)\n [-4, -3, 5]\n\n Example 2:\n\n >>> maximum([4, -4, 4], 2)\n [4, 4]\n\n Example 3:\n\n >>> maximum([-3, 2, 1, 2, -1, -2, 1], 1)\n [2]\n\n Note:\n 1. The length of the vector will be in the range of [1, 1000].\n 2. The elements in the vector will be in the range of [-1000, 1000].\n 3. 0 <= k <= len(arr)\n \"\"\"\nfunction maximum(arr::Vector{Int64}, k::Int64)::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = maximum;\n\t@test(candidate([-3, -4, 5], 3) == [-4, -3, 5])\n\t@test(candidate([4, -4, 4], 2) == [4, 4])\n\t@test(candidate([-3, 2, 1, 2, -1, -2, 1], 1) == [2])\n\t@test(candidate([123, -123, 20, 0, 1, 2, -3], 3) == [2, 20, 123])\n\t@test(candidate([-123, 20, 0, 1, 2, -3], 4) == [0, 1, 2, 20])\n\t@test(candidate([5, 15, 0, 3, -13, -8, 0], 7) == [-13, -8, 0, 0, 3, 5, 15])\n\t@test(candidate([-1, 0, 2, 5, 3, -10], 2) == [3, 5])\n\t@test(candidate([1, 0, 5, -7], 1) == [5])\n\t@test(candidate([4, -4], 2) == [-4, 4])\n\t@test(candidate([-10, 10], 2) == [-10, 10])\n\t@test(candidate([1, 2, 3, -23, 243, -400, 0], 0) == Vector{Int64}([]))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "jl", - "prompt": "\"\"\"\n Write a function that takes a message, and encodes in such a \n way that it swaps case of all letters, replaces all vowels in \n the message with the letter that appears 2 places ahead of that \n vowel in the english alphabet. \n Assume only letters. \n \n Examples:\n >>> encode(\"test\")\n \"TGST\"\n >>> encode(\"This is a message\")\n \"tHKS KS C MGSSCGG\"\n \"\"\"\nfunction encode(message::String)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = encode;\n\t@test(candidate(\"TEST\") == \"tgst\")\n\t@test(candidate(\"Mudasir\") == \"mWDCSKR\")\n\t@test(candidate(\"YES\") == \"ygs\")\n\t@test(candidate(\"This is a message\") == \"tHKS KS C MGSSCGG\")\n\t@test(candidate(\"I DoNt KnOw WhAt tO WrItE\") == \"k dQnT kNqW wHcT Tq wRkTg\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "jl", - "prompt": "\"\"\"\n remove_vowels is a function that takes string and returns string without vowels.\n >>> remove_vowels(\"\")\n \"\"\n >>> remove_vowels(\"abcdef\")\n \"bcdf\"\n >>> remove_vowels(\"aaaaa\")\n \"\"\n >>> remove_vowels(\"aaBAA\")\n \"B\"\n >>> remove_vowels(\"zbcd\")\n \"zbcd\"\n \"\"\"\nfunction remove_vowels(text::String)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = remove_vowels;\n\t@test(candidate(\"\") == \"\")\n\t@test(candidate(\"abcdef\nghijklm\") == \"bcdf\nghjklm\")\n\t@test(candidate(\"fedcba\") == \"fdcb\")\n\t@test(candidate(\"eeeee\") == \"\")\n\t@test(candidate(\"acBAA\") == \"cB\")\n\t@test(candidate(\"EcBOO\") == \"cB\")\n\t@test(candidate(\"ybcd\") == \"ybcd\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "jl", - "prompt": "\"\"\"Return only positive numbers in the vector.\n >>> get_positive([-1, 2, -4, 5, 6])\n [2, 5, 6]\n >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n [5, 3, 2, 3, 9, 123, 1]\n \"\"\"\nfunction get_positive(l::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = get_positive;\n\t@test(candidate([-1, -2, 4, 5, 6]) == [4, 5, 6])\n\t@test(candidate([5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]) == [5, 3, 2, 3, 3, 9, 123, 1])\n\t@test(candidate([-1, -2]) == Vector{Int64}([]))\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "jl", - "prompt": "\"\"\" Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n >>> string_sequence(0)\n \"0\"\n >>> string_sequence(5)\n \"0 1 2 3 4 5\"\n \"\"\"\nfunction string_sequence(n::Int64)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = string_sequence;\n\t@test(candidate(0) == \"0\")\n\t@test(candidate(3) == \"0 1 2 3\")\n\t@test(candidate(10) == \"0 1 2 3 4 5 6 7 8 9 10\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "jl", - "prompt": "\"\"\"\n Given a positive integer n, you have to make a pile of n levels of stones.\n The first level has n stones.\n The number of stones in the next level is:\n - the next odd number if n is odd.\n - the next even number if n is even.\n Return the number of stones in each level in a vector, where element at index\n i represents the number of stones in the level (i+1).\n\n Examples:\n >>> make_a_pile(3)\n [3, 5, 7]\n \"\"\"\nfunction make_a_pile(n::Int64)::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = make_a_pile;\n\t@test(candidate(3) == [3, 5, 7])\n\t@test(candidate(4) == [4, 6, 8, 10])\n\t@test(candidate(5) == [5, 7, 9, 11, 13])\n\t@test(candidate(6) == [6, 8, 10, 12, 14, 16])\n\t@test(candidate(8) == [8, 10, 12, 14, 16, 18, 20, 22])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "jl", - "prompt": "\"\"\"Task\n 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\n then check if the result string is palindrome.\n A string is called palindrome if it reads the same backward as forward.\n You should return a tuple containing the result string and true/false for the check.\n Example\n >>> reverse_delete(\"abcde\", \"ae\")\n (\"bcd\", false)\n >>> reverse_delete(\"abcdef\", \"b\")\n (\"acdef\", false)\n >>> reverse_delete(\"abcdedcba\", \"ab\")\n (\"cdedc\", true)\n \"\"\"\nfunction reverse_delete(s::String, c::String)::Tuple{String, Bool} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = reverse_delete;\n\t@test(candidate(\"abcde\", \"ae\") == (\"bcd\", false))\n\t@test(candidate(\"abcdef\", \"b\") == (\"acdef\", false))\n\t@test(candidate(\"abcdedcba\", \"ab\") == (\"cdedc\", true))\n\t@test(candidate(\"dwik\", \"w\") == (\"dik\", false))\n\t@test(candidate(\"a\", \"a\") == (\"\", true))\n\t@test(candidate(\"abcdedcba\", \"\") == (\"abcdedcba\", true))\n\t@test(candidate(\"abcdedcba\", \"v\") == (\"abcdedcba\", true))\n\t@test(candidate(\"vabba\", \"v\") == (\"abba\", true))\n\t@test(candidate(\"mamma\", \"mia\") == (\"\", true))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "jl", - "prompt": "\"\"\" For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n >>> flip_case(\"Hello\")\n \"hELLO\"\n \"\"\"\nfunction flip_case(string::String)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = flip_case;\n\t@test(candidate(\"\") == \"\")\n\t@test(candidate(\"Hello!\") == \"hELLO!\")\n\t@test(candidate(\"These violent delights have violent ends\") == \"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "jl", - "prompt": "\"\"\"You are given a string s.\n if s[i] is a letter, reverse its case from lower to upper or vise versa, \n otherwise keep it as it is.\n If the string contains no letters, reverse the string.\n The function should return the resulted string.\n Examples\n >>> solve(\"1234\")\n \"4321\"\n >>> solve(\"ab\")\n \"AB\"\n >>> solve(\"#a@C\")\n \"#A@c\"\n \"\"\"\nfunction solve(s::String)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = solve;\n\t@test(candidate(\"AsDf\") == \"aSdF\")\n\t@test(candidate(\"1234\") == \"4321\")\n\t@test(candidate(\"ab\") == \"AB\")\n\t@test(candidate(\"#a@C\") == \"#A@c\")\n\t@test(candidate(\"#AsdfW^45\") == \"#aSDFw^45\")\n\t@test(candidate(\"#6@2\") == \"2@6#\")\n\t@test(candidate(\"#$a^D\") == \"#$A^d\")\n\t@test(candidate(\"#ccc\") == \"#CCC\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "jl", - "prompt": "\"\"\" Filter an input vector of strings only for ones that start with a given prefix.\n >>> filter_by_prefix([], \"a\")\n []\n >>> filter_by_prefix([\"abc\", \"bcd\", \"cde\", \"array\"], \"a\")\n [\"abc\", \"array\"]\n \"\"\"\nfunction filter_by_prefix(strings::Vector{String}, prefix::String)::Vector{String} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = filter_by_prefix;\n\t@test(candidate(Vector{String}([]), \"john\") == Vector{String}([]))\n\t@test(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\") == [\"xxx\", \"xxxAAA\", \"xxx\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "jl", - "prompt": "\"\"\"This function takes two positive numbers x and y and returns the\n biggest even integer number that is in the range [x, y] inclusive. If \n there's no such number, then the function should return -1.\n\n For example:\n >>> choose_num(12, 15)\n 14\n >>> choose_num(13, 12)\n -1\n \"\"\"\nfunction choose_num(x::Int64, y::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = choose_num;\n\t@test(candidate(12, 15) == 14)\n\t@test(candidate(13, 12) == -1)\n\t@test(candidate(33, 12354) == 12354)\n\t@test(candidate(5234, 5233) == -1)\n\t@test(candidate(6, 29) == 28)\n\t@test(candidate(27, 10) == -1)\n\t@test(candidate(7, 7) == -1)\n\t@test(candidate(546, 546) == 546)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "jl", - "prompt": "\"\"\"\n You are given a string representing a sentence,\n the sentence contains some words separated by a space,\n and you have to return a string that contains the words from the original sentence,\n whose lengths are prime numbers,\n the order of the words in the new string should be the same as the original one.\n\n Example 1:\n >>> words_in_sentence(\"This is a test\")\n \"is\"\n\n Example 2:\n >>> words_in_sentence(\"lets go for swimming\")\n \"go for\"\n \n Constraints:\n * 1 <= len(sentence) <= 100\n * sentence contains only letters\n \"\"\"\nfunction words_in_sentence(sentence::String)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = words_in_sentence;\n\t@test(candidate(\"This is a test\") == \"is\")\n\t@test(candidate(\"lets go for swimming\") == \"go for\")\n\t@test(candidate(\"there is no place available here\") == \"there is no place\")\n\t@test(candidate(\"Hi I am Hussein\") == \"Hi am Hussein\")\n\t@test(candidate(\"go for it\") == \"go for it\")\n\t@test(candidate(\"here\") == \"\")\n\t@test(candidate(\"here is\") == \"is\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "jl", - "prompt": "\"\"\" Insert a number 'delimeter' between every two consecutive elements of input vector `numbers'\n >>> intersperse([], 4)\n []\n >>> intersperse([1, 2, 3], 4)\n [1, 4, 2, 4, 3]\n \"\"\"\nfunction intersperse(numbers::Vector{Int64}, delimeter::Int64)::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = intersperse;\n\t@test(candidate(Vector{Int64}([]), 7) == Vector{Int64}([]))\n\t@test(candidate([5, 6, 3, 2], 8) == [5, 8, 6, 8, 3, 8, 2])\n\t@test(candidate([2, 2, 2], 2) == [2, 2, 2, 2, 2])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "jl", - "prompt": "\"\"\"Your task is to write a function that returns true if a number x is a simple\n power of n and false in other cases.\n x is a simple power of n if n**int=x\n For example:\n >>> is_simple_power(1, 4)\n true\n >>> is_simple_power(2, 2)\n true\n >>> is_simple_power(8, 2)\n true\n >>> is_simple_power(3, 2)\n false\n >>> is_simple_power(3, 1)\n false\n >>> is_simple_power(5, 3)\n false\n \"\"\"\nfunction is_simple_power(x::Int64, n::Int64)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_simple_power;\n\t@test(candidate(16, 2) == true)\n\t@test(candidate(143214, 16) == false)\n\t@test(candidate(4, 2) == true)\n\t@test(candidate(9, 3) == true)\n\t@test(candidate(16, 4) == true)\n\t@test(candidate(24, 2) == false)\n\t@test(candidate(128, 4) == false)\n\t@test(candidate(12, 6) == false)\n\t@test(candidate(1, 1) == true)\n\t@test(candidate(1, 12) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "jl", - "prompt": "\"\"\"Write a function that returns true if the given number is the multiplication of 3 prime numbers\n and false otherwise.\n Knowing that (a) is less then 100. \n Example:\n >>> is_multiply_prime(30)\n true\n 30 = 2 * 3 * 5\n \"\"\"\nfunction is_multiply_prime(a::Int64)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_multiply_prime;\n\t@test(candidate(5) == false)\n\t@test(candidate(30) == true)\n\t@test(candidate(8) == true)\n\t@test(candidate(10) == false)\n\t@test(candidate(125) == true)\n\t@test(candidate(105) == true)\n\t@test(candidate(126) == false)\n\t@test(candidate(729) == false)\n\t@test(candidate(891) == false)\n\t@test(candidate(1001) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "jl", - "prompt": "\"\"\"\n Given the lengths of the three sides of a triangle. Return true if the three\n sides form a right-angled triangle, false otherwise.\n A right-angled triangle is a triangle in which one angle is right angle or \n 90 degree.\n Example:\n >>> right_angle_triangle(3, 4, 5)\n true\n >>> right_angle_triangle(1, 2, 3)\n false\n \"\"\"\nfunction right_angle_triangle(a::Int64, b::Int64, c::Int64)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = right_angle_triangle;\n\t@test(candidate(3, 4, 5) == true)\n\t@test(candidate(1, 2, 3) == false)\n\t@test(candidate(10, 6, 8) == true)\n\t@test(candidate(2, 2, 2) == false)\n\t@test(candidate(7, 24, 25) == true)\n\t@test(candidate(10, 5, 7) == false)\n\t@test(candidate(5, 12, 13) == true)\n\t@test(candidate(15, 8, 17) == true)\n\t@test(candidate(48, 55, 73) == true)\n\t@test(candidate(1, 1, 1) == false)\n\t@test(candidate(2, 2, 10) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "jl", - "prompt": "\"\"\"\n Create a function that takes 3 numbers.\n Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n Returns false in any other cases.\n \n Examples\n >>> any_int(5, 2, 7)\n true\n \n >>> any_int(3, 2, 2)\n false\n\n >>> any_int(3, -2, 1)\n true\n \n >>> any_int(3.6, -2.2, 2)\n false\n \n\n \n \"\"\"\nfunction any_int(x::Float64, y::Float64, z::Float64)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = any_int;\n\t@test(candidate(2, 3, 1) == true)\n\t@test(candidate(2.5, 2, 3) == false)\n\t@test(candidate(1.5, 5, 3.5) == false)\n\t@test(candidate(2, 6, 2) == false)\n\t@test(candidate(4, 2, 2) == true)\n\t@test(candidate(2.2, 2.2, 2.2) == false)\n\t@test(candidate(-4, 6, 2) == true)\n\t@test(candidate(2, 1, 1) == true)\n\t@test(candidate(3, 4, 7) == true)\n\t@test(candidate(3.0, 4, 7) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "jl", - "prompt": "\"\"\"This function takes a vector l and returns a vector l' such that\n l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n to the values of the corresponding indicies of l, but sorted.\n >>> sort_third([1, 2, 3])\n [1, 2, 3]\n >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n [2, 6, 3, 4, 8, 9, 5]\n \"\"\"\nfunction sort_third(l::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = sort_third;\n\t@test(candidate([5, 6, 3, 4, 8, 9, 2]) == [2, 6, 3, 4, 8, 9, 5])\n\t@test(candidate([5, 8, 3, 4, 6, 9, 2]) == [2, 8, 3, 4, 6, 9, 5])\n\t@test(candidate([5, 6, 9, 4, 8, 3, 2]) == [2, 6, 9, 4, 8, 3, 5])\n\t@test(candidate([5, 6, 3, 4, 8, 9, 2, 1]) == [2, 6, 3, 4, 8, 9, 5, 1])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_53_add", - "language": "jl", - "prompt": "\"\"\"Add two numbers x and y\n >>> add(2, 3)\n 5\n >>> add(5, 7)\n 12\n \"\"\"\nfunction add(x::Int64, y::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = add;\n\t@test(candidate(0, 1) == 1)\n\t@test(candidate(1, 0) == 1)\n\t@test(candidate(2, 3) == 5)\n\t@test(candidate(5, 7) == 12)\n\t@test(candidate(7, 5) == 12)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_69_search", - "language": "jl", - "prompt": "\"\"\"\n You are given a non-empty vector of positive integers. Return the greatest integer that is greater than \n zero, and has a frequency greater than or equal to the value of the integer itself. \n The frequency of an integer is the number of times it appears in the vector.\n If no such a value exist, return -1.\n Examples:\n >>> search([4, 1, 2, 2, 3, 1])\n 2\n >>> search([1, 2, 2, 3, 3, 3, 4, 4, 4])\n 3\n >>> search([5, 5, 4, 4, 4])\n -1\n \"\"\"\nfunction search(lst::Vector{Int64})::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = search;\n\t@test(candidate([5, 5, 5, 5, 1]) == 1)\n\t@test(candidate([4, 1, 4, 1, 4, 4]) == 4)\n\t@test(candidate([3, 3]) == -1)\n\t@test(candidate([8, 8, 8, 8, 8, 8, 8, 8]) == 8)\n\t@test(candidate([2, 3, 3, 2, 2]) == 2)\n\t@test(candidate([2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]) == 1)\n\t@test(candidate([3, 2, 8, 2]) == 2)\n\t@test(candidate([6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]) == 1)\n\t@test(candidate([8, 8, 3, 6, 5, 6, 4]) == -1)\n\t@test(candidate([6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]) == 1)\n\t@test(candidate([1, 9, 10, 1, 3]) == 1)\n\t@test(candidate([6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]) == 5)\n\t@test(candidate([1]) == 1)\n\t@test(candidate([8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]) == 4)\n\t@test(candidate([2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]) == 2)\n\t@test(candidate([1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]) == 1)\n\t@test(candidate([9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]) == 4)\n\t@test(candidate([2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]) == 4)\n\t@test(candidate([9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]) == 2)\n\t@test(candidate([5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]) == -1)\n\t@test(candidate([10]) == -1)\n\t@test(candidate([9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]) == 2)\n\t@test(candidate([5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]) == 1)\n\t@test(candidate([7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]) == 1)\n\t@test(candidate([3, 10, 10, 9, 2]) == -1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "jl", - "prompt": "\"\"\"Write a function that takes a string and returns true if the string\n length is a prime number or false otherwise\n Examples\n >>> prime_length(\"Hello\")\n true\n >>> prime_length(\"abcdcba\")\n true\n >>> prime_length(\"kittens\")\n true\n >>> prime_length(\"orange\")\n false\n \"\"\"\nfunction prime_length(string::String)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = prime_length;\n\t@test(candidate(\"Hello\") == true)\n\t@test(candidate(\"abcdcba\") == true)\n\t@test(candidate(\"kittens\") == true)\n\t@test(candidate(\"orange\") == false)\n\t@test(candidate(\"wow\") == true)\n\t@test(candidate(\"world\") == true)\n\t@test(candidate(\"MadaM\") == true)\n\t@test(candidate(\"Wow\") == true)\n\t@test(candidate(\"\") == false)\n\t@test(candidate(\"HI\") == true)\n\t@test(candidate(\"go\") == true)\n\t@test(candidate(\"gogo\") == false)\n\t@test(candidate(\"aaaaaaaaaaaaaaa\") == false)\n\t@test(candidate(\"Madam\") == true)\n\t@test(candidate(\"M\") == false)\n\t@test(candidate(\"0\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_58_common", - "language": "jl", - "prompt": "\"\"\"Return sorted unique common elements for two vectors.\n >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n [1, 5, 653]\n >>> common([5, 3, 2, 8], [3, 2])\n [2, 3]\n\n \"\"\"\nfunction common(l1::Vector{Int64}, l2::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = common;\n\t@test(candidate([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]) == [1, 5, 653])\n\t@test(candidate([5, 3, 2, 8], [3, 2]) == [2, 3])\n\t@test(candidate([4, 3, 2, 8], [3, 2, 4]) == [2, 3, 4])\n\t@test(candidate([4, 3, 2, 8], Vector{Int64}([])) == Vector{Int64}([]))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "jl", - "prompt": "\"\"\"The Brazilian factorial is defined as:\n brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n where n > 0\n\n For example:\n >>> special_factorial(4)\n 288\n\n The function will receive an integer as input and should return the special\n factorial of this integer.\n \"\"\"\nfunction special_factorial(n::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = special_factorial;\n\t@test(candidate(4) == 288)\n\t@test(candidate(5) == 34560)\n\t@test(candidate(7) == 125411328000)\n\t@test(candidate(1) == 1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "jl", - "prompt": "\"\"\"In this problem, you will implement a function that takes two vectors of numbers,\n and determines whether it is possible to perform an exchange of elements\n between them to make lst1 a vector of only even numbers.\n There is no limit on the number of exchanged elements between lst1 and lst2.\n If it is possible to exchange elements between the lst1 and lst2 to make\n all the elements of lst1 to be even, return \"YES\".\n Otherwise, return \"NO\".\n For example:\n >>> exchange([1, 2, 3, 4], [1, 2, 3, 4])\n \"YES\"\n >>> exchange([1, 2, 3, 4], [1, 5, 3, 4])\n \"NO\"\n It is assumed that the input vectors will be non-empty.\n \"\"\"\nfunction exchange(lst1::Vector{Int64}, lst2::Vector{Int64})::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = exchange;\n\t@test(candidate([1, 2, 3, 4], [1, 2, 3, 4]) == \"YES\")\n\t@test(candidate([1, 2, 3, 4], [1, 5, 3, 4]) == \"NO\")\n\t@test(candidate([1, 2, 3, 4], [2, 1, 4, 3]) == \"YES\")\n\t@test(candidate([5, 7, 3], [2, 6, 4]) == \"YES\")\n\t@test(candidate([5, 7, 3], [2, 6, 3]) == \"NO\")\n\t@test(candidate([3, 2, 6, 1, 8, 9], [3, 5, 5, 1, 1, 1]) == \"NO\")\n\t@test(candidate([100, 200], [200, 200]) == \"YES\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "jl", - "prompt": "\"\"\"\n Given a non-empty vector of integers arr and an integer k, return\n the sum of the elements with at most two digits from the first k elements of arr.\n\n Example:\n\n >>> add_elements([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4)\n 24\n\n Constraints:\n 1. 1 <= len(arr) <= 100\n 2. 1 <= k <= len(arr)\n \"\"\"\nfunction add_elements(arr::Vector{Int64}, k::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = add_elements;\n\t@test(candidate([1, -2, -3, 41, 57, 76, 87, 88, 99], 3) == -4)\n\t@test(candidate([111, 121, 3, 4000, 5, 6], 2) == 0)\n\t@test(candidate([11, 21, 3, 90, 5, 6, 7, 8, 9], 4) == 125)\n\t@test(candidate([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4) == 24)\n\t@test(candidate([1], 1) == 1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "jl", - "prompt": "\"\"\"A simple program which should return the value of x if n is \n a prime number and should return the value of y otherwise.\n\n Examples:\n >>> x_or_y(7, 34, 12)\n 34\n >>> x_or_y(15, 8, 5)\n 5\n \n \"\"\"\nfunction x_or_y(n::Int64, x::Int64, y::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = x_or_y;\n\t@test(candidate(7, 34, 12) == 34)\n\t@test(candidate(15, 8, 5) == 5)\n\t@test(candidate(3, 33, 5212) == 33)\n\t@test(candidate(1259, 3, 52) == 3)\n\t@test(candidate(7919, -1, 12) == -1)\n\t@test(candidate(3609, 1245, 583) == 583)\n\t@test(candidate(91, 56, 129) == 129)\n\t@test(candidate(6, 34, 1234) == 1234)\n\t@test(candidate(1, 2, 0) == 0)\n\t@test(candidate(2, 2, 0) == 2)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "jl", - "prompt": "\"\"\"Given length of a side and high return area for a triangle.\n >>> triangle_area(5, 3)\n 7.5\n \"\"\"\nfunction triangle_area(a::Int64, h::Int64)::Float64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = triangle_area;\n\t@test(candidate(5, 3) == 7.5)\n\t@test(candidate(2, 2) == 2.0)\n\t@test(candidate(10, 8) == 40.0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "jl", - "prompt": "\"\"\"Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n the last couple centuries. However, what people don't know is Tribonacci sequence.\n Tribonacci sequence is defined by the recurrence:\n tri(1) = 3\n tri(n) = 1 + n / 2, if n is even.\n tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n For example:\n tri(2) = 1 + (2 / 2) = 2\n tri(4) = 3\n tri(3) = tri(2) + tri(1) + tri(4)\n = 2 + 3 + 3 = 8 \n You are given a non-negative integer number n, you have to a return a vector of the \n first n + 1 numbers of the Tribonacci sequence.\n Examples:\n >>> tri(3)\n [1, 3, 2, 8]\n \"\"\"\nfunction tri(n::Int64)::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = tri;\n\t@test(candidate(3) == [1, 3, 2, 8])\n\t@test(candidate(4) == [1, 3, 2, 8, 3])\n\t@test(candidate(5) == [1, 3, 2, 8, 3, 15])\n\t@test(candidate(6) == [1, 3, 2, 8, 3, 15, 4])\n\t@test(candidate(7) == [1, 3, 2, 8, 3, 15, 4, 24])\n\t@test(candidate(8) == [1, 3, 2, 8, 3, 15, 4, 24, 5])\n\t@test(candidate(9) == [1, 3, 2, 8, 3, 15, 4, 24, 5, 35])\n\t@test(candidate(20) == [1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11])\n\t@test(candidate(0) == [1])\n\t@test(candidate(1) == [1, 3])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "jl", - "prompt": "\"\"\"\n You are given a vector of two strings, both strings consist of open\n parentheses '(' or close parentheses ')' only.\n Your job is to check if it is possible to concatenate the two strings in\n some order, that the resulting string will be good.\n A string S is considered to be good if and only if all parentheses in S\n are balanced. For example: the string '(())()' is good, while the string\n '())' is not.\n Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n\n Examples:\n >>> match_parens([\"()(\", \")\"])\n \"Yes\"\n >>> match_parens([\")\", \")\"])\n \"No\"\n \"\"\"\nfunction match_parens(lst::Vector{String})::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = match_parens;\n\t@test(candidate([\"()(\", \")\"]) == \"Yes\")\n\t@test(candidate([\")\", \")\"]) == \"No\")\n\t@test(candidate([\"(()(())\", \"())())\"]) == \"No\")\n\t@test(candidate([\")())\", \"(()()(\"]) == \"Yes\")\n\t@test(candidate([\"(())))\", \"(()())((\"]) == \"Yes\")\n\t@test(candidate([\"()\", \"())\"]) == \"No\")\n\t@test(candidate([\"(()(\", \"()))()\"]) == \"Yes\")\n\t@test(candidate([\"((((\", \"((())\"]) == \"No\")\n\t@test(candidate([\")(()\", \"(()(\"]) == \"No\")\n\t@test(candidate([\")(\", \")(\"]) == \"No\")\n\t@test(candidate([\"(\", \")\"]) == \"Yes\")\n\t@test(candidate([\")\", \"(\"]) == \"Yes\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "jl", - "prompt": "\"\"\" From a vector of integers, remove all elements that occur more than once.\n Keep order of elements left the same as in the input.\n >>> remove_duplicates([1, 2, 3, 2, 4])\n [1, 3, 4]\n \"\"\"\nfunction remove_duplicates(numbers::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = remove_duplicates;\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([1, 2, 3, 4]) == [1, 2, 3, 4])\n\t@test(candidate([1, 2, 3, 2, 4, 3, 5]) == [1, 4, 5])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "jl", - "prompt": "\"\"\" Return a greatest common divisor of two integers a and b\n >>> greatest_common_divisor(3, 5)\n 1\n >>> greatest_common_divisor(25, 15)\n 5\n \"\"\"\nfunction greatest_common_divisor(a::Int64, b::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = greatest_common_divisor;\n\t@test(candidate(3, 7) == 1)\n\t@test(candidate(10, 15) == 5)\n\t@test(candidate(49, 14) == 7)\n\t@test(candidate(144, 60) == 12)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "jl", - "prompt": "\"\"\"\n Checks if given string is a palindrome\n >>> is_palindrome(\"\")\n true\n >>> is_palindrome(\"aba\")\n true\n >>> is_palindrome(\"aaaaa\")\n true\n >>> is_palindrome(\"zbcd\")\n false\n \"\"\"\nfunction is_palindrome(text::String)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_palindrome;\n\t@test(candidate(\"\") == true)\n\t@test(candidate(\"aba\") == true)\n\t@test(candidate(\"aaaaa\") == true)\n\t@test(candidate(\"zbcd\") == false)\n\t@test(candidate(\"xywyx\") == true)\n\t@test(candidate(\"xywyz\") == false)\n\t@test(candidate(\"xywzx\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "jl", - "prompt": "\"\"\" xs represent coefficients of a polynomial.\n xs[0] + xs[1] * x + xs[2] * x^2 + ....\n Return derivative of this polynomial in the same form.\n >>> derivative([3, 1, 2, 4, 5])\n [1, 4, 12, 20]\n >>> derivative([1, 2, 3])\n [2, 6]\n \"\"\"\nfunction derivative(xs::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = derivative;\n\t@test(candidate([3, 1, 2, 4, 5]) == [1, 4, 12, 20])\n\t@test(candidate([1, 2, 3]) == [2, 6])\n\t@test(candidate([3, 2, 1]) == [2, 2])\n\t@test(candidate([3, 2, 1, 0, 4]) == [2, 2, 0, 16])\n\t@test(candidate([1]) == Vector{Int64}([]))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "jl", - "prompt": "\"\"\"\n In this task, you will be given a string that represents a number of apples and oranges \n that are distributed in a basket of fruit this basket contains \n apples, oranges, and mango fruits. Given the string that represents the total number of \n the oranges and apples and an integer that represent the total number of the fruits \n in the basket return the number of the mango fruits in the basket.\n for examble:\n >>> fruit_distribution(\"5 apples and 6 oranges\", 19)\n 8\n >>> fruit_distribution(\"0 apples and 1 oranges\", 3)\n 2\n >>> fruit_distribution(\"2 apples and 3 oranges\", 100)\n 95\n >>> fruit_distribution(\"100 apples and 1 oranges\", 120)\n 19\n \"\"\"\nfunction fruit_distribution(s::String, n::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = fruit_distribution;\n\t@test(candidate(\"5 apples and 6 oranges\", 19) == 8)\n\t@test(candidate(\"5 apples and 6 oranges\", 21) == 10)\n\t@test(candidate(\"0 apples and 1 oranges\", 3) == 2)\n\t@test(candidate(\"1 apples and 0 oranges\", 3) == 2)\n\t@test(candidate(\"2 apples and 3 oranges\", 100) == 95)\n\t@test(candidate(\"2 apples and 3 oranges\", 5) == 0)\n\t@test(candidate(\"1 apples and 100 oranges\", 120) == 19)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "jl", - "prompt": "\"\"\"\n Write a function that takes an integer a and returns true \n if this ingeger is a cube of some integer number.\n Note: you may assume the input is always valid.\n Examples:\n >>> iscube(1)\n true\n >>> iscube(2)\n false\n >>> iscube(-1)\n true\n >>> iscube(64)\n true\n >>> iscube(0)\n true\n >>> iscube(180)\n false\n \"\"\"\nfunction iscube(a::Int64)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = iscube;\n\t@test(candidate(1) == true)\n\t@test(candidate(2) == false)\n\t@test(candidate(-1) == true)\n\t@test(candidate(64) == true)\n\t@test(candidate(180) == false)\n\t@test(candidate(1000) == true)\n\t@test(candidate(0) == true)\n\t@test(candidate(1729) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "jl", - "prompt": "\"\"\"\n In this Kata, you have to sort a vector of non-negative integers according to\n number of ones in their binary representation in ascending order.\n For similar number of ones, sort based on decimal value.\n\n It must be implemented like this:\n >>> sort_array([1, 5, 2, 3, 4])\n [1, 2, 3, 4, 5]\n >>> sort_array([-2, -3, -4, -5, -6])\n [-6, -5, -4, -3, -2]\n >>> sort_array([1, 0, 2, 3, 4])\n [0, 1, 2, 3, 4]\n \"\"\"\nfunction sort_array(arr::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = sort_array;\n\t@test(candidate([1, 5, 2, 3, 4]) == [1, 2, 4, 3, 5])\n\t@test(candidate([-2, -3, -4, -5, -6]) == [-4, -2, -6, -5, -3])\n\t@test(candidate([1, 0, 2, 3, 4]) == [0, 1, 2, 4, 3])\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]) == [2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77])\n\t@test(candidate([3, 6, 44, 12, 32, 5]) == [32, 3, 5, 6, 12, 44])\n\t@test(candidate([2, 4, 8, 16, 32]) == [2, 4, 8, 16, 32])\n\t@test(candidate([2, 4, 8, 16, 32]) == [2, 4, 8, 16, 32])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "jl", - "prompt": "\"\"\"Given a vector of strings, where each string consists of only digits, return a vector.\n Each element i of the output should be \"the number of odd elements in the\n string i of the input.\" where all the i's should be replaced by the number\n of odd digits in the i'th string of the input.\n\n >>> odd_count([\"1234567\"])\n [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n >>> odd_count([\"3\", \"11111111\"])\n [\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\n \"\"\"\nfunction odd_count(lst::Vector{String})::Vector{String} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = odd_count;\n\t@test(candidate([\"1234567\"]) == [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"])\n\t@test(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.\"])\n\t@test(candidate([\"271\", \"137\", \"314\"]) == [\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "jl", - "prompt": "\"\"\" brackets is a string of \"(\" and \")\".\n return true if every opening bracket has a corresponding closing bracket.\n\n >>> correct_bracketing(\"(\")\n false\n >>> correct_bracketing(\"()\")\n true\n >>> correct_bracketing(\"(()())\")\n true\n >>> correct_bracketing(\")(()\")\n false\n \"\"\"\nfunction correct_bracketing(brackets::String)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = correct_bracketing;\n\t@test(candidate(\"()\") == true)\n\t@test(candidate(\"(()())\") == true)\n\t@test(candidate(\"()()(()())()\") == true)\n\t@test(candidate(\"()()((()()())())(()()(()))\") == true)\n\t@test(candidate(\"((()())))\") == false)\n\t@test(candidate(\")(()\") == false)\n\t@test(candidate(\"(\") == false)\n\t@test(candidate(\"((((\") == false)\n\t@test(candidate(\")\") == false)\n\t@test(candidate(\"(()\") == false)\n\t@test(candidate(\"()()(()())())(()\") == false)\n\t@test(candidate(\"()()(()())()))()\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "jl", - "prompt": "\"\"\"Task\n Write a function that takes a string as input and returns the sum of the upper characters only'\n ASCII codes.\n\n Examples:\n >>> digitSum(\"\")\n 0\n >>> digitSum(\"abAB\")\n 131\n >>> digitSum(\"abcCd\")\n 67\n >>> digitSum(\"helloE\")\n 69\n >>> digitSum(\"woArBld\")\n 131\n >>> digitSum(\"aAaaaXa\")\n 153\n \"\"\"\nfunction digitSum(s::String)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = digitSum;\n\t@test(candidate(\"\") == 0)\n\t@test(candidate(\"abAB\") == 131)\n\t@test(candidate(\"abcCd\") == 67)\n\t@test(candidate(\"helloE\") == 69)\n\t@test(candidate(\"woArBld\") == 131)\n\t@test(candidate(\"aAaaaXa\") == 153)\n\t@test(candidate(\" How are yOu?\") == 151)\n\t@test(candidate(\"You arE Very Smart\") == 327)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "jl", - "prompt": "\"\"\"Write a function that accepts a vector of strings as a parameter,\n deletes the strings that have odd lengths from it,\n and returns the resulted vector with a sorted order,\n The vector is always a vector of strings and never a vector of numbers,\n and it may contain duplicates.\n The order of the vector should be ascending by length of each word, and you\n should return the vector sorted by that rule.\n If two words have the same length, sort the vector alphabetically.\n The function should return a vector of strings in sorted order.\n You may assume that all words will have the same length.\n For example:\n >>> list_sort([\"aa\", \"a\", \"aaa\"])\n [\"aa\"]\n >>> list_sort([\"ab\", \"a\", \"aaa\", \"cd\"])\n [\"ab\", \"cd\"]\n \"\"\"\nfunction sorted_list_sum(lst::Vector{String})::Vector{String} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = sorted_list_sum;\n\t@test(candidate([\"aa\", \"a\", \"aaa\"]) == [\"aa\"])\n\t@test(candidate([\"school\", \"AI\", \"asdf\", \"b\"]) == [\"AI\", \"asdf\", \"school\"])\n\t@test(candidate([\"d\", \"b\", \"c\", \"a\"]) == Vector{String}([]))\n\t@test(candidate([\"d\", \"dcba\", \"abcd\", \"a\"]) == [\"abcd\", \"dcba\"])\n\t@test(candidate([\"AI\", \"ai\", \"au\"]) == [\"AI\", \"ai\", \"au\"])\n\t@test(candidate([\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"]) == Vector{String}([]))\n\t@test(candidate([\"aaaa\", \"bbbb\", \"dd\", \"cc\"]) == [\"cc\", \"dd\", \"aaaa\", \"bbbb\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "jl", - "prompt": "\"\"\"\n You are given a vector arr of integers and you need to return\n sum of magnitudes of integers multiplied by product of all signs\n of each number in the vector, represented by 1, -1 or 0.\n Note: return nothing for empty arr.\n\n Example:\n >>> prod_signs([1, 2, 2, -4])\n 9\n >>> prod_signs([0, 1])\n 0\n >>> prod_signs([])\n nothing\n \"\"\"\nfunction prod_signs(arr::Vector{Int64})::Union{Int64, Nothing} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = prod_signs;\n\t@test(candidate([1, 2, 2, -4]) == -9)\n\t@test(candidate([0, 1]) == 0)\n\t@test(candidate([1, 1, 1, 2, 3, -1, 1]) == -10)\n\t@test(candidate(Vector{Int64}([])) == nothing)\n\t@test(candidate([2, 4, 1, 2, -1, -1, 9]) == 20)\n\t@test(candidate([-1, 1, -1, 1]) == 4)\n\t@test(candidate([-1, 1, 1, 1]) == -4)\n\t@test(candidate([-1, 1, 1, 0]) == 0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "jl", - "prompt": "\"\"\"Return vector with elements incremented by 1.\n >>> incr_list([1, 2, 3])\n [2, 3, 4]\n >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123])\n [6, 4, 6, 3, 4, 4, 10, 1, 124]\n \"\"\"\nfunction incr_list(l::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = incr_list;\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([3, 2, 1]) == [4, 3, 2])\n\t@test(candidate([5, 2, 5, 2, 3, 3, 9, 0, 123]) == [6, 3, 6, 3, 4, 4, 10, 1, 124])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "jl", - "prompt": "\"\"\" From a given vector of integers, generate a vector of rolling maximum element found until given moment\n in the sequence.\n >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n [1, 2, 3, 3, 3, 4, 4]\n \"\"\"\nfunction rolling_max(numbers::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = rolling_max;\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([1, 2, 3, 4]) == [1, 2, 3, 4])\n\t@test(candidate([4, 3, 2, 1]) == [4, 4, 4, 4])\n\t@test(candidate([3, 2, 3, 100, 3]) == [3, 3, 3, 100, 100])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "jl", - "prompt": "\"\"\" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n separate those group into separate strings and return the vector of those.\n Separate groups are balanced (each open brace is properly closed) and not nested within each other\n Ignore any spaces in the input string.\n >>> separate_paren_groups(\"( ) (( )) (( )( ))\")\n [\"()\", \"(())\", \"(()())\"]\n \"\"\"\nfunction separate_paren_groups(paren_string::String)::Vector{String} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = separate_paren_groups;\n\t@test(candidate(\"(()()) ((())) () ((())()())\") == [\"(()())\", \"((()))\", \"()\", \"((())()())\"])\n\t@test(candidate(\"() (()) ((())) (((())))\") == [\"()\", \"(())\", \"((()))\", \"(((())))\"])\n\t@test(candidate(\"(()(())((())))\") == [\"(()(())((())))\"])\n\t@test(candidate(\"( ) (( )) (( )( ))\") == [\"()\", \"(())\", \"(()())\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "jl", - "prompt": "\"\"\"\n You will be given a string of words separated by commas or spaces. Your task is\n to split the string into words and return a vector of the words.\n \n For example:\n >>> words_string(\"Hi, my name is John\")\n [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n >>> words_string(\"One, two, three, four, five, six\")\n [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\n \"\"\"\nfunction words_string(s::String)::Vector{String} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = words_string;\n\t@test(candidate(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"])\n\t@test(candidate(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"])\n\t@test(candidate(\"Hi, my name\") == [\"Hi\", \"my\", \"name\"])\n\t@test(candidate(\"One,, two, three, four, five, six,\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"])\n\t@test(candidate(\"\") == Vector{String}([]))\n\t@test(candidate(\"ahmed , gamal\") == [\"ahmed\", \"gamal\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "jl", - "prompt": "\"\"\" Filter given vector of any jlthon values only for integers\n >>> filter_integers([\"a\", 3.14, 5])\n [5]\n >>> filter_integers([1, 2, 3, \"abc\", Dict(), []])\n [1, 2, 3]\n \"\"\"\nfunction filter_integers(values::Vector{Any})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = filter_integers;\n\t@test(candidate(Vector{Any}([])) == Vector{Int64}([]))\n\t@test(candidate([4, Dict(), [], 23.2, 9, \"adasd\"]) == [4, 9])\n\t@test(candidate([3, \"c\", 3, 3, \"a\", \"b\"]) == [3, 3, 3])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "jl", - "prompt": "\"\"\"This function takes a vector l and returns a vector l' such that\n l' is identical to l in the odd indicies, while its values at the even indicies are equal\n to the values of the even indicies of l, but sorted.\n >>> sort_even([1, 2, 3])\n [1, 2, 3]\n >>> sort_even([5, 6, 3, 4])\n [3, 6, 5, 4]\n \"\"\"\nfunction sort_even(l::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = sort_even;\n\t@test(candidate([1, 2, 3]) == [1, 2, 3])\n\t@test(candidate([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]) == [-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123])\n\t@test(candidate([5, 8, -12, 4, 23, 2, 3, 11, 12, -10]) == [-12, 8, 3, 4, 5, 2, 12, 11, 23, -10])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "jl", - "prompt": "\"\"\"I think we all remember that feeling when the result of some long-awaited\n event is finally known. The feelings and thoughts you have at that moment are\n definitely worth noting down and comparing.\n Your task is to determine if a person correctly guessed the results of a number of matches.\n You are given two vectors of scores and guesses of equal length, where each index shows a match. \n Return a vector of the same length denoting how far off each guess was. If they have guessed correctly,\n the value is 0, and if not, the value is the absolute difference between the guess and the score.\n \n \n example:\n\n >>> compare([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2])\n [0, 0, 0, 0, 3, 3]\n >>> compare([0, 5, 0, 0, 0, 4], [4, 1, 1, 0, 0, -2])\n [4, 4, 1, 0, 0, 6]\n \"\"\"\nfunction compare(game::Vector{Int64}, guess::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = compare;\n\t@test(candidate([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2]) == [0, 0, 0, 0, 3, 3])\n\t@test(candidate([0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]) == [0, 0, 0, 0, 0, 0])\n\t@test(candidate([1, 2, 3], [-1, -2, -3]) == [2, 4, 6])\n\t@test(candidate([1, 2, 3, 5], [-1, 2, 3, 4]) == [2, 0, 0, 1])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "jl", - "prompt": "\"\"\"\n Given a positive integer n, return a tuple that has the number of even and odd\n integer palindromes that fall within the range(1, n), inclusive.\n\n Example 1:\n\n >>> even_odd_palindrome(3)\n (1, 2)\n Explanation:\n Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n\n Example 2:\n\n >>> even_odd_palindrome(12)\n (4, 6)\n Explanation:\n Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n\n Note:\n 1. 1 <= n <= 10^3\n 2. returned tuple has the number of even and odd integer palindromes respectively.\n \"\"\"\nfunction even_odd_palindrome(n::Int64)::Tuple{Int64, Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = even_odd_palindrome;\n\t@test(candidate(123) == (8, 13))\n\t@test(candidate(12) == (4, 6))\n\t@test(candidate(3) == (1, 2))\n\t@test(candidate(63) == (6, 8))\n\t@test(candidate(25) == (5, 6))\n\t@test(candidate(19) == (4, 6))\n\t@test(candidate(9) == (4, 5))\n\t@test(candidate(1) == (0, 1))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "jl", - "prompt": "\"\"\"The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fib4(0) -> 0\n fib4(1) -> 0\n fib4(2) -> 2\n fib4(3) -> 0\n fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n >>> fib4(5)\n 4\n >>> fib4(6)\n 8\n >>> fib4(7)\n 14\n \"\"\"\nfunction fib4(n::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = fib4;\n\t@test(candidate(5) == 4)\n\t@test(candidate(8) == 28)\n\t@test(candidate(10) == 104)\n\t@test(candidate(12) == 386)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "jl", - "prompt": "\"\"\"\n Given two positive integers a and b, return the even digits between a\n and b, in ascending order.\n\n For example:\n >>> generate_integers(2, 8)\n [2, 4, 6, 8]\n >>> generate_integers(8, 2)\n [2, 4, 6, 8]\n >>> generate_integers(10, 14)\n []\n \"\"\"\nfunction generate_integers(a::Int64, b::Int64)::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = generate_integers;\n\t@test(candidate(2, 10) == [2, 4, 6, 8])\n\t@test(candidate(10, 2) == [2, 4, 6, 8])\n\t@test(candidate(132, 2) == [2, 4, 6, 8])\n\t@test(candidate(17, 89) == Vector{Int64}([]))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "jl", - "prompt": "\"\"\" For a given vector of input numbers, calculate Mean Absolute Deviation\n around the mean of this dataset.\n Mean Absolute Deviation is the average absolute difference between each\n element and a centerpoint (mean in this case):\n MAD = average | x - x_mean |\n >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n 1.0\n \"\"\"\nfunction mean_absolute_deviation(numbers::Vector{Float64})::Float64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = mean_absolute_deviation;\n\t@test(candidate([1.0, 2.0]) == 0.5)\n\t@test(candidate([1.0, 2.0, 3.0, 4.0]) == 1.0)\n\t@test(candidate([1.0, 2.0, 3.0, 4.0, 5.0]) == 1.2)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "jl", - "prompt": "\"\"\"Create a function encrypt that takes a string as an argument and\n returns a string encrypted with the alphabet being rotated. \n The alphabet should be rotated in a manner such that the letters \n shift down by two multiplied to two places.\n For example:\n >>> encrypt(\"hi\")\n \"lm\"\n >>> encrypt(\"asdfghjkl\")\n \"ewhjklnop\"\n >>> encrypt(\"gf\")\n \"kj\"\n >>> encrypt(\"et\")\n \"ix\"\n \"\"\"\nfunction encrypt(s::String)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = encrypt;\n\t@test(candidate(\"hi\") == \"lm\")\n\t@test(candidate(\"asdfghjkl\") == \"ewhjklnop\")\n\t@test(candidate(\"gf\") == \"kj\")\n\t@test(candidate(\"et\") == \"ix\")\n\t@test(candidate(\"faewfawefaewg\") == \"jeiajeaijeiak\")\n\t@test(candidate(\"hellomyfriend\") == \"lippsqcjvmirh\")\n\t@test(candidate(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\") == \"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\")\n\t@test(candidate(\"a\") == \"e\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "jl", - "prompt": "\"\"\"\n Given a positive integer n, return a sorted vector that has the odd numbers in collatz sequence.\n\n The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n as follows: start with any positive integer n. Then each term is obtained from the \n previous term as follows: if the previous term is even, the next term is one half of \n the previous term. If the previous term is odd, the next term is 3 times the previous\n term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n\n Note: \n 1. Collatz(1) is [1].\n 2. returned vector sorted in increasing order.\n\n For example:\n get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n >>> get_odd_collatz(5)\n [1, 5]\n \"\"\"\nfunction get_odd_collatz(n::Int64)::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = get_odd_collatz;\n\t@test(candidate(14) == [1, 5, 7, 11, 13, 17])\n\t@test(candidate(5) == [1, 5])\n\t@test(candidate(12) == [1, 3, 5])\n\t@test(candidate(1) == [1])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "jl", - "prompt": "\"\"\" Find how many times a given substring can be found in the original string. Count overlaping cases.\n >>> how_many_times(\"\", \"a\")\n 0\n >>> how_many_times(\"aaa\", \"a\")\n 3\n >>> how_many_times(\"aaaa\", \"aa\")\n 3\n \"\"\"\nfunction how_many_times(string::String, substring::String)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = how_many_times;\n\t@test(candidate(\"\", \"x\") == 0)\n\t@test(candidate(\"xyxyxyx\", \"x\") == 4)\n\t@test(candidate(\"cacacacac\", \"cac\") == 4)\n\t@test(candidate(\"john doe\", \"john\") == 1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "jl", - "prompt": "\"\"\"We have a vector 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n numbers in the vector will be randomly ordered. Your task is to determine if\n it is possible to get a vector sorted in non-decreasing order by performing \n the following operation on the given vector:\n You are allowed to perform right shift operation any number of times.\n \n One right shift operation means shifting all elements of the vector by one\n position in the right direction. The last element of the vector will be moved to\n the starting position in the vector i.e. 0th index. \n\n If it is possible to obtain the sorted vector by performing the above operation\n then return true else return false.\n If the given vector is empty then return true.\n\n Note: The given vector is guaranteed to have unique elements.\n\n For Example:\n \n >>> move_one_ball([3, 4, 5, 1, 2])\n true\n Explanation: By performin 2 right shift operations, non-decreasing order can\n be achieved for the given vector.\n >>> move_one_ball([3, 5, 4, 1, 2])\n false\n Explanation:It is not possible to get non-decreasing order for the given\n vector by performing any number of right shift operations.\n \n \"\"\"\nfunction move_one_ball(arr::Vector{Int64})::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = move_one_ball;\n\t@test(candidate([3, 4, 5, 1, 2]) == true)\n\t@test(candidate([3, 5, 10, 1, 2]) == true)\n\t@test(candidate([4, 3, 1, 2]) == false)\n\t@test(candidate([3, 5, 4, 1, 2]) == false)\n\t@test(candidate(Vector{Int64}([])) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "jl", - "prompt": "\"\"\"\n Write a function which sorts the given vector of integers\n in ascending order according to the sum of their digits.\n Note: if there are several items with similar sum of their digits,\n order them based on their index in original vector.\n\n For example:\n >>> order_by_points([1, 11, -1, -11, -12])\n [-1, -11, 1, -12, 11]\n >>> order_by_points([])\n []\n \"\"\"\nfunction order_by_points(nums::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = order_by_points;\n\t@test(candidate([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11])\n\t@test(candidate([1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]) == [0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457])\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([1, -11, -32, 43, 54, -98, 2, -3]) == [-3, -32, -98, -11, 1, 2, 43, 54])\n\t@test(candidate([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) == [1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9])\n\t@test(candidate([0, 6, 6, -76, -21, 23, 4]) == [-76, -21, 0, 4, 23, 6, 6])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "jl", - "prompt": "\"\"\" Return vector of prime factors of given integer in the order from smallest to largest.\n Each of the factors should be vectored number of times corresponding to how many times it appeares in factorization.\n Input number should be equal to the product of all factors\n >>> factorize(8)\n [2, 2, 2]\n >>> factorize(25)\n [5, 5]\n >>> factorize(70)\n [2, 5, 7]\n \"\"\"\nfunction factorize(n::Int64)::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = factorize;\n\t@test(candidate(2) == [2])\n\t@test(candidate(4) == [2, 2])\n\t@test(candidate(8) == [2, 2, 2])\n\t@test(candidate(57) == [3, 19])\n\t@test(candidate(3249) == [3, 3, 19, 19])\n\t@test(candidate(185193) == [3, 3, 3, 19, 19, 19])\n\t@test(candidate(20577) == [3, 19, 19, 19])\n\t@test(candidate(18) == [2, 3, 3])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "jl", - "prompt": "\"\"\"Return true if all numbers in the vector l are below threshold t.\n >>> below_threshold([1, 2, 4, 10], 100)\n true\n >>> below_threshold([1, 20, 4, 10], 5)\n false\n \"\"\"\nfunction below_threshold(l::Vector{Int64}, t::Int64)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = below_threshold;\n\t@test(candidate([1, 2, 4, 10], 100) == true)\n\t@test(candidate([1, 20, 4, 10], 5) == false)\n\t@test(candidate([1, 20, 4, 10], 21) == true)\n\t@test(candidate([1, 20, 4, 10], 22) == true)\n\t@test(candidate([1, 8, 4, 10], 11) == true)\n\t@test(candidate([1, 8, 4, 10], 10) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "jl", - "prompt": "\"\"\"You are given two positive integers n and m, and your task is to compute the\n average of the integers from n through m (including n and m). \n Round the answer to the nearest integer and convert that to binary.\n If n is greater than m, return -1.\n Example:\n >>> rounded_avg(1, 5)\n \"0b11\"\n >>> rounded_avg(7, 5)\n -1\n >>> rounded_avg(10, 20)\n \"0b1111\"\n >>> rounded_avg(20, 33)\n \"0b11010\"\n \"\"\"\nfunction rounded_avg(n::Int64, m::Int64)::Union{String, Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = rounded_avg;\n\t@test(candidate(1, 5) == \"0b11\")\n\t@test(candidate(7, 13) == \"0b1010\")\n\t@test(candidate(964, 977) == \"0b1111001010\")\n\t@test(candidate(996, 997) == \"0b1111100100\")\n\t@test(candidate(560, 851) == \"0b1011000010\")\n\t@test(candidate(185, 546) == \"0b101101110\")\n\t@test(candidate(362, 496) == \"0b110101101\")\n\t@test(candidate(350, 902) == \"0b1001110010\")\n\t@test(candidate(197, 233) == \"0b11010111\")\n\t@test(candidate(7, 5) == -1)\n\t@test(candidate(5, 1) == -1)\n\t@test(candidate(5, 5) == \"0b101\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "jl", - "prompt": "\"\"\" Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n For each of the group, output the deepest level of nesting of parentheses.\n E.g. (()()) has maximum two levels of nesting while ((())) has three.\n\n >>> parse_nested_parens(\"(()()) ((())) () ((())()())\")\n [2, 3, 1, 3]\n \"\"\"\nfunction parse_nested_parens(paren_string::String)::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = parse_nested_parens;\n\t@test(candidate(\"(()()) ((())) () ((())()())\") == [2, 3, 1, 3])\n\t@test(candidate(\"() (()) ((())) (((())))\") == [1, 2, 3, 4])\n\t@test(candidate(\"(()(())((())))\") == [4])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "jl", - "prompt": "\"\"\"Given a non-empty vector of integers, return the sum of all of the odd elements that are in even positions.\n \n\n Examples\n >>> solution([5, 8, 7, 1])\n 12\n >>> solution([3, 3, 3, 3, 3])\n 9\n >>> solution([30, 13, 24, 321])\n 0\n \"\"\"\nfunction solution(lst::Vector{Int64})::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = solution;\n\t@test(candidate([5, 8, 7, 1]) == 12)\n\t@test(candidate([3, 3, 3, 3, 3]) == 9)\n\t@test(candidate([30, 13, 24, 321]) == 0)\n\t@test(candidate([5, 9]) == 5)\n\t@test(candidate([2, 4, 8]) == 0)\n\t@test(candidate([30, 13, 23, 32]) == 23)\n\t@test(candidate([3, 13, 2, 9]) == 3)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "jl", - "prompt": "\"\"\"\n You are given a positive integer n. You have to create an integer vector a of length n.\n For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n and a[i] + a[j] + a[k] is a multiple of 3.\n\n Example :\n >>> get_max_triples(5)\n 1\n Explanation: \n a = [1, 3, 7, 13, 21]\n The only valid triple is (1, 7, 13).\n \"\"\"\nfunction get_max_triples(n::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = get_max_triples;\n\t@test(candidate(5) == 1)\n\t@test(candidate(6) == 4)\n\t@test(candidate(10) == 36)\n\t@test(candidate(100) == 53361)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "jl", - "prompt": "\"\"\"\n You are given a vector of integers.\n Write a function next_smallest() that returns the 2nd smallest element of the vector.\n Return nothing if there is no such element.\n >>> next_smallest([1, 2, 3, 4, 5])\n 2\n >>> next_smallest([5, 1, 4, 3, 2])\n 2\n >>> next_smallest([])\n nothing\n >>> next_smallest([1, 1])\n nothing\n \"\"\"\nfunction next_smallest(lst::Vector{Int64})::Union{Int64, Nothing} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = next_smallest;\n\t@test(candidate([1, 2, 3, 4, 5]) == 2)\n\t@test(candidate([5, 1, 4, 3, 2]) == 2)\n\t@test(candidate(Vector{Int64}([])) == nothing)\n\t@test(candidate([1, 1]) == nothing)\n\t@test(candidate([1, 1, 1, 1, 0]) == 1)\n\t@test(candidate([1, 1]) == nothing)\n\t@test(candidate([-35, 34, 12, -45]) == -35)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "jl", - "prompt": "\"\"\" Input is a space-delimited string of numberals from 'zero' to 'nine'.\n Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n Return the string with numbers sorted from smallest to largest\n >>> sort_numbers(\"three one five\")\n \"one three five\"\n \"\"\"\nfunction sort_numbers(numbers::String)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = sort_numbers;\n\t@test(candidate(\"\") == \"\")\n\t@test(candidate(\"three\") == \"three\")\n\t@test(candidate(\"three five nine\") == \"three five nine\")\n\t@test(candidate(\"five zero four seven nine eight\") == \"zero four five seven eight nine\")\n\t@test(candidate(\"six five four three two one zero\") == \"zero one two three four five six\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "jl", - "prompt": "\"\"\"You are given 2 words. You need to return true if the second word or any of its rotations is a substring in the first word\n >>> cycpattern_check(\"abcd\", \"abd\")\n false\n >>> cycpattern_check(\"hello\", \"ell\")\n true\n >>> cycpattern_check(\"whassup\", \"psus\")\n false\n >>> cycpattern_check(\"abab\", \"baa\")\n true\n >>> cycpattern_check(\"efef\", \"eeff\")\n false\n >>> cycpattern_check(\"himenss\", \"simen\")\n true\n\n \"\"\"\nfunction cycpattern_check(a::String, b::String)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = cycpattern_check;\n\t@test(candidate(\"xyzw\", \"xyw\") == false)\n\t@test(candidate(\"yello\", \"ell\") == true)\n\t@test(candidate(\"whattup\", \"ptut\") == false)\n\t@test(candidate(\"efef\", \"fee\") == true)\n\t@test(candidate(\"abab\", \"aabb\") == false)\n\t@test(candidate(\"winemtt\", \"tinem\") == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "jl", - "prompt": "\"\"\"You will be given a number in decimal form and your task is to convert it to\n binary format. The function should return a string, with each character representing a binary\n number. Each character in the string will be '0' or '1'.\n\n There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n The extra characters are there to help with the format.\n\n Examples:\n >>> decimal_to_binary(15)\n \"db1111db\"\n >>> decimal_to_binary(32)\n \"db100000db\"\n \"\"\"\nfunction decimal_to_binary(decimal::Int64)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = decimal_to_binary;\n\t@test(candidate(0) == \"db0db\")\n\t@test(candidate(32) == \"db100000db\")\n\t@test(candidate(103) == \"db1100111db\")\n\t@test(candidate(15) == \"db1111db\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "jl", - "prompt": "\"\"\" Filter an input vector of strings only for ones that contain given substring\n >>> filter_by_substring([], \"a\")\n []\n >>> filter_by_substring([\"abc\", \"bacd\", \"cde\", \"array\"], \"a\")\n [\"abc\", \"bacd\", \"array\"]\n \"\"\"\nfunction filter_by_substring(strings::Vector{String}, substring::String)::Vector{String} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = filter_by_substring;\n\t@test(candidate(Vector{String}([]), \"john\") == Vector{String}([]))\n\t@test(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\") == [\"xxx\", \"xxxAAA\", \"xxx\"])\n\t@test(candidate([\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xx\") == [\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"])\n\t@test(candidate([\"grunt\", \"trumpet\", \"prune\", \"gruesome\"], \"run\") == [\"grunt\", \"prune\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "jl", - "prompt": "\"\"\"Given an integer. return a tuple that has the number of even and odd digits respectively.\n\n Example:\n >>> even_odd_count(-12)\n (1, 1)\n >>> even_odd_count(123)\n (1, 2)\n \"\"\"\nfunction even_odd_count(num::Int64)::Tuple{Int64, Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = even_odd_count;\n\t@test(candidate(7) == (0, 1))\n\t@test(candidate(-78) == (1, 1))\n\t@test(candidate(3452) == (2, 2))\n\t@test(candidate(346211) == (3, 3))\n\t@test(candidate(-345821) == (3, 3))\n\t@test(candidate(-2) == (1, 0))\n\t@test(candidate(-45347) == (2, 3))\n\t@test(candidate(0) == (1, 0))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "jl", - "prompt": "\"\"\"Write a function that accepts a vector of strings.\n The vector contains different words. Return the word with maximum number\n of unique characters. If multiple strings have maximum number of unique\n characters, return the one which comes first in lexicographical order.\n\n >>> find_max([\"name\", \"of\", \"string\"])\n \"string\"\n >>> find_max([\"name\", \"enam\", \"game\"])\n \"enam\"\n >>> find_max([\"aaaaaaa\", \"bb\", \"cc\"])\n \"aaaaaaa\"\n \"\"\"\nfunction find_max(words::Vector{String})::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = find_max;\n\t@test(candidate([\"name\", \"of\", \"string\"]) == \"string\")\n\t@test(candidate([\"name\", \"enam\", \"game\"]) == \"enam\")\n\t@test(candidate([\"aaaaaaa\", \"bb\", \"cc\"]) == \"aaaaaaa\")\n\t@test(candidate([\"abc\", \"cba\"]) == \"abc\")\n\t@test(candidate([\"play\", \"this\", \"game\", \"of\", \"footbott\"]) == \"footbott\")\n\t@test(candidate([\"we\", \"are\", \"gonna\", \"rock\"]) == \"gonna\")\n\t@test(candidate([\"we\", \"are\", \"a\", \"mad\", \"nation\"]) == \"nation\")\n\t@test(candidate([\"this\", \"is\", \"a\", \"prrk\"]) == \"this\")\n\t@test(candidate([\"b\"]) == \"b\")\n\t@test(candidate([\"play\", \"play\", \"play\"]) == \"play\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "jl", - "prompt": "\"\"\"\n Given a positive integer n, return the count of the numbers of n-digit\n positive integers that start or end with 1.\n \"\"\"\nfunction starts_one_ends(n::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = starts_one_ends;\n\t@test(candidate(1) == 1)\n\t@test(candidate(2) == 18)\n\t@test(candidate(3) == 180)\n\t@test(candidate(4) == 1800)\n\t@test(candidate(5) == 18000)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "jl", - "prompt": "\"\"\"\n Create a function that returns a tuple (a, b), where 'a' is\n the largest of negative integers, and 'b' is the smallest\n of positive integers in a vector.\n If there is no negative or positive integers, return them as nothing.\n\n Examples:\n >>> largest_smallest_integers([2, 4, 1, 3, 5, 7])\n (nothing, 1)\n >>> largest_smallest_integers([])\n (nothing, nothing)\n >>> largest_smallest_integers([0])\n (nothing, nothing)\n \"\"\"\nfunction largest_smallest_integers(lst::Vector{Int64})::Tuple{Union{Int64, Nothing}, Union{Int64, Nothing}} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = largest_smallest_integers;\n\t@test(candidate([2, 4, 1, 3, 5, 7]) == (nothing, 1))\n\t@test(candidate([2, 4, 1, 3, 5, 7, 0]) == (nothing, 1))\n\t@test(candidate([1, 3, 2, 4, 5, 6, -2]) == (-2, 1))\n\t@test(candidate([4, 5, 3, 6, 2, 7, -7]) == (-7, 2))\n\t@test(candidate([7, 3, 8, 4, 9, 2, 5, -9]) == (-9, 2))\n\t@test(candidate(Vector{Int64}([])) == (nothing, nothing))\n\t@test(candidate([0]) == (nothing, nothing))\n\t@test(candidate([-1, -3, -5, -6]) == (-1, nothing))\n\t@test(candidate([-1, -3, -5, -6, 0]) == (-1, nothing))\n\t@test(candidate([-6, -4, -4, -3, 1]) == (-3, 1))\n\t@test(candidate([-6, -4, -4, -3, -100, 1]) == (-3, 1))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "jl", - "prompt": "\"\"\"\n \"Given a vector representing a branch of a tree that has non-negative integer nodes\n your task is to pluck one of the nodes and return it.\n The plucked node should be the node with the smallest even value.\n If multiple nodes with the same smallest even value are found return the node that has smallest index.\n\n The plucked node should be returned in a vector, [ smalest_value, its index ],\n If there are no even values or the given vector is empty, return [].\n\n Example 1:\n >>> pluck([4, 2, 3])\n [2, 1]\n Explanation: 2 has the smallest even value, and 2 has the smallest index.\n\n Example 2:\n >>> pluck([1, 2, 3])\n [2, 1]\n Explanation: 2 has the smallest even value, and 2 has the smallest index.\n\n Example 3:\n >>> pluck([])\n []\n \n Example 4:\n >>> pluck([5, 0, 3, 0, 4, 2])\n [0, 1]\n Explanation: 0 is the smallest value, but there are two zeros,\n so we will choose the first zero, which has the smallest index.\n\n Constraints:\n * 1 <= nodes.length <= 10000\n * 0 <= node.value\n \"\"\"\nfunction pluck(arr::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = pluck;\n\t@test(candidate([4, 2, 3]) == [2, 1])\n\t@test(candidate([1, 2, 3]) == [2, 1])\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([5, 0, 3, 0, 4, 2]) == [0, 1])\n\t@test(candidate([1, 2, 3, 0, 5, 3]) == [0, 3])\n\t@test(candidate([5, 4, 8, 4, 8]) == [4, 1])\n\t@test(candidate([7, 6, 7, 1]) == [6, 1])\n\t@test(candidate([7, 9, 7, 1]) == Vector{Int64}([]))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "jl", - "prompt": "\"\"\"\n Write a function count_nums which takes a vector of integers and returns\n the number of elements which has a sum of digits > 0.\n If a number is negative, then its first signed digit will be negative:\n e.g. -123 has signed digits -1, 2, and 3.\n >>> count_nums([])\n 0\n >>> count_nums([-1, 11, -11])\n 1\n >>> count_nums([1, 1, 2])\n 3\n \"\"\"\nfunction count_nums(arr::Vector{Int64})::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = count_nums;\n\t@test(candidate(Vector{Int64}([])) == 0)\n\t@test(candidate([-1, -2, 0]) == 0)\n\t@test(candidate([1, 1, 2, -2, 3, 4, 5]) == 6)\n\t@test(candidate([1, 6, 9, -6, 0, 1, 5]) == 5)\n\t@test(candidate([1, 100, 98, -7, 1, -1]) == 4)\n\t@test(candidate([12, 23, 34, -45, -56, 0]) == 5)\n\t@test(candidate([0, 1]) == 1)\n\t@test(candidate([1]) == 1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "jl", - "prompt": "\"\"\"\n Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n each cell of the grid contains a value. Every integer in the range [1, N * N]\n inclusive appears exactly once on the cells of the grid.\n\n You have to find the minimum path of length k in the grid. You can start\n from any cell, and in each step you can move to any of the neighbor cells,\n in other words, you can go to cells which share an edge with you current\n cell.\n Please note that a path of length k means visiting exactly k cells (not\n necessarily distinct).\n You CANNOT go off the grid.\n A path A (of length k) is considered less than a path B (of length k) if\n after making the ordered vectors of the values on the cells that A and B go\n through (let's call them lst_A and lst_B), lst_A is lexicographically less\n than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n lst_A[j] = lst_B[j].\n It is guaranteed that the answer is unique.\n Return an ordered vector of the values on the cells that the minimum path go through.\n\n Examples: \n >>> minPath([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3)\n [1, 2, 1]\n\n >>> minPath([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1)\n [1]\n \"\"\"\nfunction minPath(grid::Vector{Vector{Int64}}, k::Int64)::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = minPath;\n\t@test(candidate([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3) == [1, 2, 1])\n\t@test(candidate([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1) == [1])\n\t@test(candidate([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], 4) == [1, 2, 1, 2])\n\t@test(candidate([[6, 4, 13, 10], [5, 7, 12, 1], [3, 16, 11, 15], [8, 14, 9, 2]], 7) == [1, 10, 1, 10, 1, 10, 1])\n\t@test(candidate([[8, 14, 9, 2], [6, 4, 13, 15], [5, 7, 1, 12], [3, 10, 11, 16]], 5) == [1, 7, 1, 7, 1])\n\t@test(candidate([[11, 8, 7, 2], [5, 16, 14, 4], [9, 3, 15, 6], [12, 13, 10, 1]], 9) == [1, 6, 1, 6, 1, 6, 1, 6, 1])\n\t@test(candidate([[12, 13, 10, 1], [9, 3, 15, 6], [5, 16, 14, 4], [11, 8, 7, 2]], 12) == [1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6])\n\t@test(candidate([[2, 7, 4], [3, 1, 5], [6, 8, 9]], 8) == [1, 3, 1, 3, 1, 3, 1, 3])\n\t@test(candidate([[6, 1, 5], [3, 8, 9], [2, 7, 4]], 8) == [1, 5, 1, 5, 1, 5, 1, 5])\n\t@test(candidate([[1, 2], [3, 4]], 10) == [1, 2, 1, 2, 1, 2, 1, 2, 1, 2])\n\t@test(candidate([[1, 3], [3, 2]], 10) == [1, 3, 1, 3, 1, 3, 1, 3, 1, 3])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "jl", - "prompt": "\"\"\"\n Given vector of integers, return vector in strange order.\n Strange sorting, is when you start with the minimum value,\n then maximum of the remaining integers, then minimum and so on.\n\n Examples:\n >>> strange_sort_list([1, 2, 3, 4])\n [1, 4, 2, 3]\n >>> strange_sort_list([5, 5, 5, 5])\n [5, 5, 5, 5]\n >>> strange_sort_list([])\n []\n \"\"\"\nfunction strange_sort_list(lst::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = strange_sort_list;\n\t@test(candidate([1, 2, 3, 4]) == [1, 4, 2, 3])\n\t@test(candidate([5, 6, 7, 8, 9]) == [5, 9, 6, 8, 7])\n\t@test(candidate([1, 2, 3, 4, 5]) == [1, 5, 2, 4, 3])\n\t@test(candidate([5, 6, 7, 8, 9, 1]) == [1, 9, 5, 8, 6, 7])\n\t@test(candidate([5, 5, 5, 5]) == [5, 5, 5, 5])\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([1, 2, 3, 4, 5, 6, 7, 8]) == [1, 8, 2, 7, 3, 6, 4, 5])\n\t@test(candidate([0, 2, 2, 2, 5, 5, -5, -5]) == [-5, 5, -5, 5, 0, 2, 2, 2])\n\t@test(candidate([111111]) == [111111])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "jl", - "prompt": "\"\"\"\n Given a string 'text', return its md5 hash equivalent string.\n If 'text' is an empty string, return nothing.\n\n >>> string_to_md5(\"Hello world\")\n \"3e25960a79dbc69b674cd4ec67a72c62\"\n \"\"\"\nfunction string_to_md5(text::String)::Union{String, Nothing} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = string_to_md5;\n\t@test(candidate(\"Hello world\") == \"3e25960a79dbc69b674cd4ec67a72c62\")\n\t@test(candidate(\"\") == nothing)\n\t@test(candidate(\"A B C\") == \"0ef78513b0cb8cef12743f5aeb35f888\")\n\t@test(candidate(\"password\") == \"5f4dcc3b5aa765d61d8327deb882cf99\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "jl", - "prompt": "\"\"\"You are given a word. Your task is to find the closest vowel that stands between \n two consonants from the right side of the word (case sensitive).\n \n Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n find any vowel met the above condition. \n\n You may assume that the given string contains English letter only.\n\n Example:\n >>> get_closest_vowel(\"yogurt\")\n \"u\"\n >>> get_closest_vowel(\"FULL\")\n \"U\"\n >>> get_closest_vowel(\"quick\")\n \"\"\n >>> get_closest_vowel(\"ab\")\n \"\"\n \"\"\"\nfunction get_closest_vowel(word::String)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = get_closest_vowel;\n\t@test(candidate(\"yogurt\") == \"u\")\n\t@test(candidate(\"full\") == \"u\")\n\t@test(candidate(\"easy\") == \"\")\n\t@test(candidate(\"eAsy\") == \"\")\n\t@test(candidate(\"ali\") == \"\")\n\t@test(candidate(\"bad\") == \"a\")\n\t@test(candidate(\"most\") == \"o\")\n\t@test(candidate(\"ab\") == \"\")\n\t@test(candidate(\"ba\") == \"\")\n\t@test(candidate(\"quick\") == \"\")\n\t@test(candidate(\"anime\") == \"i\")\n\t@test(candidate(\"Asia\") == \"\")\n\t@test(candidate(\"Above\") == \"o\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "jl", - "prompt": "\"\"\"Change numerical base of input number x to base.\n return string representation after the conversion.\n base numbers are less than 10.\n >>> change_base(8, 3)\n \"22\"\n >>> change_base(8, 2)\n \"1000\"\n >>> change_base(7, 2)\n \"111\"\n \"\"\"\nfunction change_base(x::Int64, base::Int64)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = change_base;\n\t@test(candidate(8, 3) == \"22\")\n\t@test(candidate(9, 3) == \"100\")\n\t@test(candidate(234, 2) == \"11101010\")\n\t@test(candidate(16, 2) == \"10000\")\n\t@test(candidate(8, 2) == \"1000\")\n\t@test(candidate(7, 2) == \"111\")\n\t@test(candidate(2, 3) == \"2\")\n\t@test(candidate(3, 4) == \"3\")\n\t@test(candidate(4, 5) == \"4\")\n\t@test(candidate(5, 6) == \"5\")\n\t@test(candidate(6, 7) == \"6\")\n\t@test(candidate(7, 8) == \"7\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "jl", - "prompt": "\"\"\" Check if in given vector of numbers, are any two numbers closer to each other than\n given threshold.\n >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n false\n >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n true\n \"\"\"\nfunction has_close_elements(numbers::Vector{Float64}, threshold::Float64)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = has_close_elements;\n\t@test(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3) == true)\n\t@test(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05) == false)\n\t@test(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.95) == true)\n\t@test(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.8) == false)\n\t@test(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1) == true)\n\t@test(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 1.0) == true)\n\t@test(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 0.5) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "jl", - "prompt": "\"\"\"\n Create a function that takes a string as input which contains only square brackets.\n The function should return true if and only if there is a valid subsequence of brackets \n where at least one bracket in the subsequence is nested.\n\n >>> is_nested(\"[[]]\")\n true\n >>> is_nested(\"[]]]]]]][[[[[]\")\n false\n >>> is_nested(\"[][]\")\n false\n >>> is_nested(\"[]\")\n false\n >>> is_nested(\"[[][]]\")\n true\n >>> is_nested(\"[[]][[\")\n true\n \"\"\"\nfunction is_nested(string::String)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_nested;\n\t@test(candidate(\"[[]]\") == true)\n\t@test(candidate(\"[]]]]]]][[[[[]\") == false)\n\t@test(candidate(\"[][]\") == false)\n\t@test(candidate(\"[]\") == false)\n\t@test(candidate(\"[[[[]]]]\") == true)\n\t@test(candidate(\"[]]]]]]]]]]\") == false)\n\t@test(candidate(\"[][][[]]\") == true)\n\t@test(candidate(\"[[]\") == false)\n\t@test(candidate(\"[]]\") == false)\n\t@test(candidate(\"[[]][[\") == true)\n\t@test(candidate(\"[[][]]\") == true)\n\t@test(candidate(\"\") == false)\n\t@test(candidate(\"[[[[[[[[\") == false)\n\t@test(candidate(\"]]]]]]]]\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "jl", - "prompt": "\"\"\" Concatenate vector of strings into a single string\n >>> concatenate([])\n \"\"\n >>> concatenate([\"a\", \"b\", \"c\"])\n \"abc\"\n \"\"\"\nfunction concatenate(strings::Vector{String})::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = concatenate;\n\t@test(candidate(Vector{String}([])) == \"\")\n\t@test(candidate([\"x\", \"y\", \"z\"]) == \"xyz\")\n\t@test(candidate([\"x\", \"y\", \"z\", \"w\", \"k\"]) == \"xyzwk\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "jl", - "prompt": "\"\"\"\n prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n >>> prime_fib(1)\n 2\n >>> prime_fib(2)\n 3\n >>> prime_fib(3)\n 5\n >>> prime_fib(4)\n 13\n >>> prime_fib(5)\n 89\n \"\"\"\nfunction prime_fib(n::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = prime_fib;\n\t@test(candidate(1) == 2)\n\t@test(candidate(2) == 3)\n\t@test(candidate(3) == 5)\n\t@test(candidate(4) == 13)\n\t@test(candidate(5) == 89)\n\t@test(candidate(6) == 233)\n\t@test(candidate(7) == 1597)\n\t@test(candidate(8) == 28657)\n\t@test(candidate(9) == 514229)\n\t@test(candidate(10) == 433494437)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "jl", - "prompt": "\"\"\" From a supplied vector of numbers (of length at least two) select and return two that are the closest to each\n other and return them in order (smaller number, larger number).\n >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n (2.0, 2.2)\n >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n (2.0, 2.0)\n \"\"\"\nfunction find_closest_elements(numbers::Vector{Float64})::Tuple{Float64, Float64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = find_closest_elements;\n\t@test(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2]) == (3.9, 4.0))\n\t@test(candidate([1.0, 2.0, 5.9, 4.0, 5.0]) == (5.0, 5.9))\n\t@test(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]) == (2.0, 2.2))\n\t@test(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]) == (2.0, 2.0))\n\t@test(candidate([1.1, 2.2, 3.1, 4.1, 5.1]) == (2.2, 3.1))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "jl", - "prompt": "\"\"\"You have been tasked to write a function that receives \n a hexadecimal number as a string and counts the number of hexadecimal \n digits that are primes (prime number, or a prime, is a natural number \n greater than 1 that is not a product of two smaller natural numbers).\n Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n So you have to determine a number of the following digits: 2, 3, 5, 7, \n B (=decimal 11), D (=decimal 13).\n Note: you may assume the input is always correct or empty string, \n and symbols A,B,C,D,E,F are always uppercase.\n Examples:\n >>> hex_key(\"AB\")\n 1\n >>> hex_key(\"1077E\")\n 2\n >>> hex_key(\"ABED1A33\")\n 4\n >>> hex_key(\"123456789ABCDEF0\")\n 6\n >>> hex_key(\"2020\")\n 2\n \"\"\"\nfunction hex_key(num::String)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = hex_key;\n\t@test(candidate(\"AB\") == 1)\n\t@test(candidate(\"1077E\") == 2)\n\t@test(candidate(\"ABED1A33\") == 4)\n\t@test(candidate(\"2020\") == 2)\n\t@test(candidate(\"123456789ABCDEF0\") == 6)\n\t@test(candidate(\"112233445566778899AABBCCDDEEFF00\") == 12)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "jl", - "prompt": "\"\"\"Complete the function that takes two integers and returns \n the product of their unit digits.\n Assume the input is always valid.\n Examples:\n >>> multiply(148, 412)\n 16\n >>> multiply(19, 28)\n 72\n >>> multiply(2020, 1851)\n 0\n >>> multiply(14, -15)\n 20\n \"\"\"\nfunction multiply(a::Int64, b::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = multiply;\n\t@test(candidate(148, 412) == 16)\n\t@test(candidate(19, 28) == 72)\n\t@test(candidate(2020, 1851) == 0)\n\t@test(candidate(14, -15) == 20)\n\t@test(candidate(76, 67) == 42)\n\t@test(candidate(17, 27) == 49)\n\t@test(candidate(0, 1) == 0)\n\t@test(candidate(0, 0) == 0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "jl", - "prompt": "\"\"\" Given vector of numbers (of at least two elements), apply a linear transform to that vector,\n such that the smallest number will become 0 and the largest will become 1\n >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n [0.0, 0.25, 0.5, 0.75, 1.0]\n \"\"\"\nfunction rescale_to_unit(numbers::Vector{Float64})::Vector{Float64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = rescale_to_unit;\n\t@test(candidate([2.0, 49.9]) == [0.0, 1.0])\n\t@test(candidate([100.0, 49.9]) == [1.0, 0.0])\n\t@test(candidate([1.0, 2.0, 3.0, 4.0, 5.0]) == [0.0, 0.25, 0.5, 0.75, 1.0])\n\t@test(candidate([2.0, 1.0, 5.0, 3.0, 4.0]) == [0.25, 0.0, 1.0, 0.5, 0.75])\n\t@test(candidate([12.0, 11.0, 15.0, 13.0, 14.0]) == [0.25, 0.0, 1.0, 0.5, 0.75])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "jl", - "prompt": "\"\"\"Given a positive integer n, return the product of the odd digits.\n Return 0 if all digits are even.\n For example:\n >>> digits(1)\n 1\n >>> digits(4)\n 0\n >>> digits(235)\n 15\n \"\"\"\nfunction digits(n::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = digits;\n\t@test(candidate(5) == 5)\n\t@test(candidate(54) == 5)\n\t@test(candidate(120) == 1)\n\t@test(candidate(5014) == 5)\n\t@test(candidate(98765) == 315)\n\t@test(candidate(5576543) == 2625)\n\t@test(candidate(2468) == 0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "jl", - "prompt": "\"\"\"You will be given the name of a class (a string) and a vector of extensions.\n The extensions are to be used to load additional classes to the class. The\n strength of the extension is as follows: Let CAP be the number of the uppercase\n letters in the extension's name, and let SM be the number of lowercase letters \n in the extension's name, the strength is given by the fraction CAP - SM. \n You should find the strongest extension and return a string in this \n format: ClassName.StrongestExtensionName.\n If there are two or more extensions with the same strength, you should\n choose the one that comes first in the vector.\n For example, if you are given \"Slices\" as the class and a vector of the\n extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n (its strength is -1).\n Example:\n >>> Strongest_Extension(\"my_class\", [\"AA\", \"Be\", \"CC\"])\n \"my_class.AA\"\n \"\"\"\nfunction Strongest_Extension(class_name::String, extensions::Vector{String})::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = Strongest_Extension;\n\t@test(candidate(\"Watashi\", [\"tEN\", \"niNE\", \"eIGHt8OKe\"]) == \"Watashi.eIGHt8OKe\")\n\t@test(candidate(\"Boku123\", [\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"]) == \"Boku123.YEs.WeCaNe\")\n\t@test(candidate(\"__YESIMHERE\", [\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"]) == \"__YESIMHERE.NuLl__\")\n\t@test(candidate(\"K\", [\"Ta\", \"TAR\", \"t234An\", \"cosSo\"]) == \"K.TAR\")\n\t@test(candidate(\"__HAHA\", [\"Tab\", \"123\", \"781345\", \"-_-\"]) == \"__HAHA.123\")\n\t@test(candidate(\"YameRore\", [\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"]) == \"YameRore.okIWILL123\")\n\t@test(candidate(\"finNNalLLly\", [\"Die\", \"NowW\", \"Wow\", \"WoW\"]) == \"finNNalLLly.WoW\")\n\t@test(candidate(\"_\", [\"Bb\", \"91245\"]) == \"_.Bb\")\n\t@test(candidate(\"Sp\", [\"671235\", \"Bb\"]) == \"Sp.671235\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "jl", - "prompt": "\"\"\"Given a string representing a space separated lowercase letters, return a dictionary\n of the letter with the most repetition and containing the corresponding count.\n If several letters have the same occurrence, return all of them.\n \n Example:\n >>> histogram(\"a b c\")\n Dict(\"a\" => 1, \"b\" => 1, \"c\" => 1)\n >>> histogram(\"a b b a\")\n Dict(\"a\" => 2, \"b\" => 2)\n >>> histogram(\"a b c a b\")\n Dict(\"a\" => 2, \"b\" => 2)\n >>> histogram(\"b b b b a\")\n Dict(\"b\" => 4)\n >>> histogram(\"\")\n Dict()\n\n \"\"\"\nfunction histogram(test::String)::Dict{String, Int64}> \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = histogram;\n\t@test(candidate(\"a b b a\") == Dict(\"a\" => 2, \"b\" => 2))\n\t@test(candidate(\"a b c a b\") == Dict(\"a\" => 2, \"b\" => 2))\n\t@test(candidate(\"a b c d g\") == Dict(\"a\" => 1, \"b\" => 1, \"c\" => 1, \"d\" => 1, \"g\" => 1))\n\t@test(candidate(\"r t g\") == Dict(\"r\" => 1, \"t\" => 1, \"g\" => 1))\n\t@test(candidate(\"b b b b a\") == Dict(\"b\" => 4))\n\t@test(candidate(\"r t g\") == Dict(\"r\" => 1, \"t\" => 1, \"g\" => 1))\n\t@test(candidate(\"\") == Dict())\n\t@test(candidate(\"a\") == Dict(\"a\" => 1))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "jl", - "prompt": "\"\"\"\n pairs_sum_to_zero takes a vector of integers as an input.\n it returns true if there are two distinct elements in the vector that\n sum to zero, and false otherwise.\n >>> pairs_sum_to_zero([1, 3, 5, 0])\n false\n >>> pairs_sum_to_zero([1, 3, -2, 1])\n false\n >>> pairs_sum_to_zero([1, 2, 3, 7])\n false\n >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7])\n true\n >>> pairs_sum_to_zero([1])\n false\n \"\"\"\nfunction pairs_sum_to_zero(l::Vector{Int64})::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = pairs_sum_to_zero;\n\t@test(candidate([1, 3, 5, 0]) == false)\n\t@test(candidate([1, 3, -2, 1]) == false)\n\t@test(candidate([1, 2, 3, 7]) == false)\n\t@test(candidate([2, 4, -5, 3, 5, 7]) == true)\n\t@test(candidate([1]) == false)\n\t@test(candidate([-3, 9, -1, 3, 2, 30]) == true)\n\t@test(candidate([-3, 9, -1, 3, 2, 31]) == true)\n\t@test(candidate([-3, 9, -1, 4, 2, 30]) == false)\n\t@test(candidate([-3, 9, -1, 4, 2, 31]) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "jl", - "prompt": "\"\"\"\n Write a function that accepts two vectors of strings and returns the vector that has \n total number of chars in the all strings of the vector less than the other vector.\n\n if the two vectors have the same number of chars, return the first vector.\n\n Examples\n >>> total_match([], [])\n []\n >>> total_match([\"hi\", \"admin\"], [\"hI\", \"Hi\"])\n [\"hI\", \"Hi\"]\n >>> total_match([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"])\n [\"hi\", \"admin\"]\n >>> total_match([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"])\n [\"hI\", \"hi\", \"hi\"]\n >>> total_match([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"])\n [\"4\"]\n \"\"\"\nfunction total_match(lst1::Vector{String}, lst2::Vector{String})::Vector{String} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = total_match;\n\t@test(candidate(Vector{String}([]), Vector{String}([])) == Vector{String}([]))\n\t@test(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\"]) == [\"hi\", \"hi\"])\n\t@test(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"]) == [\"hi\", \"admin\"])\n\t@test(candidate([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"]) == [\"4\"])\n\t@test(candidate([\"hi\", \"admin\"], [\"hI\", \"Hi\"]) == [\"hI\", \"Hi\"])\n\t@test(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"]) == [\"hI\", \"hi\", \"hi\"])\n\t@test(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hii\"]) == [\"hi\", \"admin\"])\n\t@test(candidate(Vector{String}([]), [\"this\"]) == Vector{String}([]))\n\t@test(candidate([\"this\"], Vector{String}([])) == Vector{String}([]))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "jl", - "prompt": "\"\"\"Circular shift the digits of the integer x, shift the digits right by shift\n and return the result as a string.\n If shift > number of digits, return digits reversed.\n >>> circular_shift(12, 1)\n \"21\"\n >>> circular_shift(12, 2)\n \"12\"\n \"\"\"\nfunction circular_shift(x::Int64, shift::Int64)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = circular_shift;\n\t@test(candidate(100, 2) == \"001\")\n\t@test(candidate(12, 2) == \"12\")\n\t@test(candidate(97, 8) == \"79\")\n\t@test(candidate(12, 1) == \"21\")\n\t@test(candidate(11, 101) == \"11\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "jl", - "prompt": "\"\"\"Return true is vector elements are monotonically increasing or decreasing.\n >>> monotonic([1, 2, 4, 20])\n true\n >>> monotonic([1, 20, 4, 10])\n false\n >>> monotonic([4, 1, 0, -10])\n true\n \"\"\"\nfunction monotonic(l::Vector{Int64})::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = monotonic;\n\t@test(candidate([1, 2, 4, 10]) == true)\n\t@test(candidate([1, 2, 4, 20]) == true)\n\t@test(candidate([1, 20, 4, 10]) == false)\n\t@test(candidate([4, 1, 0, -10]) == true)\n\t@test(candidate([4, 1, 1, 0]) == true)\n\t@test(candidate([1, 2, 3, 2, 5, 60]) == false)\n\t@test(candidate([1, 2, 3, 4, 5, 60]) == true)\n\t@test(candidate([9, 9, 9, 9]) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "jl", - "prompt": "\"\"\"Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n Example\n >>> is_equal_to_sum_even(4)\n false\n >>> is_equal_to_sum_even(6)\n false\n >>> is_equal_to_sum_even(8)\n true\n \"\"\"\nfunction is_equal_to_sum_even(n::Int64)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_equal_to_sum_even;\n\t@test(candidate(4) == false)\n\t@test(candidate(6) == false)\n\t@test(candidate(8) == true)\n\t@test(candidate(10) == true)\n\t@test(candidate(11) == false)\n\t@test(candidate(12) == true)\n\t@test(candidate(13) == false)\n\t@test(candidate(16) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "jl", - "prompt": "\"\"\" Input to this function is a string representing musical notes in a special ASCII format.\n Your task is to parse this string and return vector of integers corresponding to how many beats does each\n not last.\n\n Here is a legend:\n 'o' - whole note, lasts four beats\n 'o|' - half note, lasts two beats\n '.|' - quater note, lasts one beat\n\n >>> parse_music(\"o o| .| o| o| .| .| .| .| o o\")\n [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\n \"\"\"\nfunction parse_music(music_string::String)::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = parse_music;\n\t@test(candidate(\"\") == Vector{Int64}([]))\n\t@test(candidate(\"o o o o\") == [4, 4, 4, 4])\n\t@test(candidate(\".| .| .| .|\") == [1, 1, 1, 1])\n\t@test(candidate(\"o| o| .| .| o o o o\") == [2, 2, 1, 1, 4, 4, 4, 4])\n\t@test(candidate(\"o| .| o| .| o o| o o|\") == [2, 1, 2, 1, 4, 2, 4, 2])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "jl", - "prompt": "\"\"\"\"\n This function will take a vector of integers. For all entries in the vector, the function shall square the integer entry if its index is a \n multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n change the entries in the vector whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n \n Examples:\n >>> lst\n [1, 2, 3]\n >>> lst\n []\n >>> lst\n [-1, -5, 2, -1, -5]\n \"\"\"\nfunction sum_squares(lst::Vector{Int64})::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = sum_squares;\n\t@test(candidate([1, 2, 3]) == 6)\n\t@test(candidate([1, 4, 9]) == 14)\n\t@test(candidate(Vector{Int64}([])) == 0)\n\t@test(candidate([1, 1, 1, 1, 1, 1, 1, 1, 1]) == 9)\n\t@test(candidate([-1, -1, -1, -1, -1, -1, -1, -1, -1]) == -3)\n\t@test(candidate([0]) == 0)\n\t@test(candidate([-1, -5, 2, -1, -5]) == -126)\n\t@test(candidate([-56, -99, 1, 0, -2]) == 3030)\n\t@test(candidate([-1, 0, 0, 0, 0, 0, 0, 0, -1]) == 0)\n\t@test(candidate([-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37]) == -14196)\n\t@test(candidate([-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10]) == -1448)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "jl", - "prompt": "\"\"\"\n triples_sum_to_zero takes a vector of integers as an input.\n it returns true if there are three distinct elements in the vector that\n sum to zero, and false otherwise.\n\n >>> triples_sum_to_zero([1, 3, 5, 0])\n false\n >>> triples_sum_to_zero([1, 3, -2, 1])\n true\n >>> triples_sum_to_zero([1, 2, 3, 7])\n false\n >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n true\n >>> triples_sum_to_zero([1])\n false\n \"\"\"\nfunction triples_sum_to_zero(l::Vector{Int64})::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = triples_sum_to_zero;\n\t@test(candidate([1, 3, 5, 0]) == false)\n\t@test(candidate([1, 3, 5, -1]) == false)\n\t@test(candidate([1, 3, -2, 1]) == true)\n\t@test(candidate([1, 2, 3, 7]) == false)\n\t@test(candidate([1, 2, 5, 7]) == false)\n\t@test(candidate([2, 4, -5, 3, 9, 7]) == true)\n\t@test(candidate([1]) == false)\n\t@test(candidate([1, 3, 5, -100]) == false)\n\t@test(candidate([100, 3, 5, -100]) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "jl", - "prompt": "\"\"\" brackets is a string of \"<\" and \">\".\n return true if every opening bracket has a corresponding closing bracket.\n\n >>> correct_bracketing(\"<\")\n false\n >>> correct_bracketing(\"<>\")\n true\n >>> correct_bracketing(\"<<><>>\")\n true\n >>> correct_bracketing(\"><<>\")\n false\n \"\"\"\nfunction correct_bracketing(brackets::String)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = correct_bracketing;\n\t@test(candidate(\"<>\") == true)\n\t@test(candidate(\"<<><>>\") == true)\n\t@test(candidate(\"<><><<><>><>\") == true)\n\t@test(candidate(\"<><><<<><><>><>><<><><<>>>\") == true)\n\t@test(candidate(\"<<<><>>>>\") == false)\n\t@test(candidate(\"><<>\") == false)\n\t@test(candidate(\"<\") == false)\n\t@test(candidate(\"<<<<\") == false)\n\t@test(candidate(\">\") == false)\n\t@test(candidate(\"<<>\") == false)\n\t@test(candidate(\"<><><<><>><>><<>\") == false)\n\t@test(candidate(\"<><><<><>><>>><>\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "jl", - "prompt": "\"\"\"Write a function that takes a vector of numbers as input and returns \n the number of elements in the vector that are greater than 10 and both \n first and last digits of a number are odd (1, 3, 5, 7, 9).\n For example:\n >>> specialFilter([15, -73, 14, -15])\n 1\n >>> specialFilter([33, -2, -3, 45, 21, 109])\n 2\n \"\"\"\nfunction specialFilter(nums::Vector{Int64})::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = specialFilter;\n\t@test(candidate([5, -2, 1, -5]) == 0)\n\t@test(candidate([15, -73, 14, -15]) == 1)\n\t@test(candidate([33, -2, -3, 45, 21, 109]) == 2)\n\t@test(candidate([43, -12, 93, 125, 121, 109]) == 4)\n\t@test(candidate([71, -2, -33, 75, 21, 19]) == 3)\n\t@test(candidate([1]) == 0)\n\t@test(candidate(Vector{Int64}([])) == 0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "jl", - "prompt": "\"\"\"\n Given a dictionary, return true if all keys are strings in lower \n case or all keys are strings in upper case, else return false.\n The function should return false is the given dictionary is empty.\n Examples:\n >>> check_dict_case(Dict(\"a\" => \"apple\", \"b\" => \"banana\"))\n true\n >>> check_dict_case(Dict(\"a\" => \"apple\", \"A\" => \"banana\", \"B\" => \"banana\"))\n false\n >>> check_dict_case(Dict(\"a\" => \"apple\", 8 => \"banana\", \"a\" => \"apple\"))\n false\n >>> check_dict_case(Dict(\"Name\" => \"John\", \"Age\" => \"36\", \"City\" => \"Houston\"))\n false\n >>> check_dict_case(Dict(\"STATE\" => \"NC\", \"ZIP\" => \"12345\"))\n true\n \"\"\"\nfunction check_dict_case(dict::Dict{String, String}>)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = check_dict_case;\n\t@test(candidate(Dict(\"p\" => \"pineapple\", \"b\" => \"banana\")) == true)\n\t@test(candidate(Dict(\"p\" => \"pineapple\", \"A\" => \"banana\", \"B\" => \"banana\")) == false)\n\t@test(candidate(Dict(\"p\" => \"pineapple\", \"5\" => \"banana\", \"a\" => \"apple\")) == false)\n\t@test(candidate(Dict(\"Name\" => \"John\", \"Age\" => \"36\", \"City\" => \"Houston\")) == false)\n\t@test(candidate(Dict(\"STATE\" => \"NC\", \"ZIP\" => \"12345\")) == true)\n\t@test(candidate(Dict(\"fruit\" => \"Orange\", \"taste\" => \"Sweet\")) == true)\n\t@test(candidate(Dict()) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "jl", - "prompt": "\"\"\"\n Given a string of words, return a vector of words split on whitespace, if no whitespaces exists in the text you\n should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n Examples\n >>> split_words(\"Hello world!\")\n [\"Hello\", \"world!\"]\n >>> split_words(\"Hello,world!\")\n [\"Hello\", \"world!\"]\n >>> split_words(\"abcdef\")\n 3\n \"\"\"\nfunction split_words(txt::String)::Union{Vector{String}, Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = split_words;\n\t@test(candidate(\"Hello world!\") == [\"Hello\", \"world!\"])\n\t@test(candidate(\"Hello,world!\") == [\"Hello\", \"world!\"])\n\t@test(candidate(\"Hello world,!\") == [\"Hello\", \"world,!\"])\n\t@test(candidate(\"Hello,Hello,world !\") == [\"Hello,Hello,world\", \"!\"])\n\t@test(candidate(\"abcdef\") == 3)\n\t@test(candidate(\"aaabb\") == 2)\n\t@test(candidate(\"aaaBb\") == 1)\n\t@test(candidate(\"\") == 0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "jl", - "prompt": "\"\"\"The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fibfib(0) == 0\n fibfib(1) == 0\n fibfib(2) == 1\n fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n >>> fibfib(1)\n 0\n >>> fibfib(5)\n 4\n >>> fibfib(8)\n 24\n \"\"\"\nfunction fibfib(n::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = fibfib;\n\t@test(candidate(2) == 1)\n\t@test(candidate(1) == 0)\n\t@test(candidate(5) == 4)\n\t@test(candidate(8) == 24)\n\t@test(candidate(10) == 81)\n\t@test(candidate(12) == 274)\n\t@test(candidate(14) == 927)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "jl", - "prompt": "\"\"\"You are given a vector of numbers.\n You need to return the sum of squared numbers in the given vector,\n round each element in the vector to the upper int(Ceiling) first.\n Examples:\n >>> lst([1.0, 2.0, 3.0])\n 14\n >>> lst([1.0, 4.0, 9.0])\n 98\n >>> lst([1.0, 3.0, 5.0, 7.0])\n 84\n >>> lst([1.4, 4.2, 0.0])\n 29\n >>> lst([-2.4, 1.0, 1.0])\n 6\n \n\n \"\"\"\nfunction sum_squares(lst::Vector{Float64})::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = sum_squares;\n\t@test(candidate([1.0, 2.0, 3.0]) == 14)\n\t@test(candidate([1.0, 2.0, 3.0]) == 14)\n\t@test(candidate([1.0, 3.0, 5.0, 7.0]) == 84)\n\t@test(candidate([1.4, 4.2, 0.0]) == 29)\n\t@test(candidate([-2.4, 1.0, 1.0]) == 6)\n\t@test(candidate([100.0, 1.0, 15.0, 2.0]) == 10230)\n\t@test(candidate([10000.0, 10000.0]) == 200000000)\n\t@test(candidate([-1.4, 4.6, 6.3]) == 75)\n\t@test(candidate([-1.4, 17.9, 18.9, 19.9]) == 1086)\n\t@test(candidate([0.0]) == 0)\n\t@test(candidate([-1.0]) == 1)\n\t@test(candidate([-1.0, 1.0, 0.0]) == 2)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_85_add", - "language": "jl", - "prompt": "\"\"\"Given a non-empty vector of integers lst. add the even elements that are at odd indices..\n\n\n Examples:\n >>> add([4, 2, 6, 7])\n 2\n \"\"\"\nfunction add(lst::Vector{Int64})::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = add;\n\t@test(candidate([4, 88]) == 88)\n\t@test(candidate([4, 5, 6, 7, 2, 122]) == 122)\n\t@test(candidate([4, 0, 6, 7]) == 0)\n\t@test(candidate([4, 4, 6, 8]) == 12)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "jl", - "prompt": "\"\"\"Return sorted unique elements in a vector\n >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123])\n [0, 2, 3, 5, 9, 123]\n \"\"\"\nfunction unique(l::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = unique;\n\t@test(candidate([5, 3, 5, 2, 3, 3, 9, 0, 123]) == [0, 2, 3, 5, 9, 123])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "jl", - "prompt": "\"\"\"\n Given a string text, replace all spaces in it with underscores, \n and if a string has more than 2 consecutive spaces, \n then replace all consecutive spaces with - \n \n >>> fix_spaces(\" Example\")\n \"Example\"\n >>> fix_spaces(\" Example 1\")\n \"Example_1\"\n >>> fix_spaces(\" Example 2\")\n \"_Example_2\"\n >>> fix_spaces(\" Example 3\")\n \"_Example-3\"\n \"\"\"\nfunction fix_spaces(text::String)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = fix_spaces;\n\t@test(candidate(\"Example\") == \"Example\")\n\t@test(candidate(\"Mudasir Hanif \") == \"Mudasir_Hanif_\")\n\t@test(candidate(\"Yellow Yellow Dirty Fellow\") == \"Yellow_Yellow__Dirty__Fellow\")\n\t@test(candidate(\"Exa mple\") == \"Exa-mple\")\n\t@test(candidate(\" Exa 1 2 2 mple\") == \"-Exa_1_2_2_mple\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "jl", - "prompt": "\"\"\"Return 2^n modulo p (be aware of numerics).\n >>> modp(3, 5)\n 3\n >>> modp(1101, 101)\n 2\n >>> modp(0, 101)\n 1\n >>> modp(3, 11)\n 8\n >>> modp(100, 101)\n 1\n \"\"\"\nfunction modp(n::Int64, p::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = modp;\n\t@test(candidate(3, 5) == 3)\n\t@test(candidate(1101, 101) == 2)\n\t@test(candidate(0, 101) == 1)\n\t@test(candidate(3, 11) == 8)\n\t@test(candidate(100, 101) == 1)\n\t@test(candidate(30, 5) == 4)\n\t@test(candidate(31, 5) == 3)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "jl", - "prompt": "\"\"\"You have to write a function which validates a given date string and\n returns true if the date is valid otherwise false.\n The date is valid if all of the following rules are satisfied:\n 1. The date string is not empty.\n 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n 3. The months should not be less than 1 or higher than 12.\n 4. The date should be in the format: mm-dd-yyyy\n\n >>> valid_date(\"03-11-2000\")\n true\n\n >>> valid_date(\"15-01-2012\")\n false\n\n >>> valid_date(\"04-0-2040\")\n false\n\n >>> valid_date(\"06-04-2020\")\n true\n\n >>> valid_date(\"06/04/2020\")\n false\n \"\"\"\nfunction valid_date(date::String)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = valid_date;\n\t@test(candidate(\"03-11-2000\") == true)\n\t@test(candidate(\"15-01-2012\") == false)\n\t@test(candidate(\"04-0-2040\") == false)\n\t@test(candidate(\"06-04-2020\") == true)\n\t@test(candidate(\"01-01-2007\") == true)\n\t@test(candidate(\"03-32-2011\") == false)\n\t@test(candidate(\"\") == false)\n\t@test(candidate(\"04-31-3000\") == false)\n\t@test(candidate(\"06-06-2005\") == true)\n\t@test(candidate(\"21-31-2000\") == false)\n\t@test(candidate(\"04-12-2003\") == true)\n\t@test(candidate(\"04122003\") == false)\n\t@test(candidate(\"20030412\") == false)\n\t@test(candidate(\"2003-04\") == false)\n\t@test(candidate(\"2003-04-12\") == false)\n\t@test(candidate(\"04-2003\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "jl", - "prompt": "\"\"\"\n Write a function that takes a string and returns an ordered version of it.\n Ordered version of string, is a string where all words (separated by space)\n are replaced by a new word where all the characters arranged in\n ascending order based on ascii value.\n Note: You should keep the order of words and blank spaces in the sentence.\n\n For example:\n >>> anti_shuffle(\"Hi\")\n \"Hi\"\n >>> anti_shuffle(\"hello\")\n \"ehllo\"\n >>> anti_shuffle(\"Hello World!!!\")\n \"Hello !!!Wdlor\"\n \"\"\"\nfunction anti_shuffle(s::String)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = anti_shuffle;\n\t@test(candidate(\"Hi\") == \"Hi\")\n\t@test(candidate(\"hello\") == \"ehllo\")\n\t@test(candidate(\"number\") == \"bemnru\")\n\t@test(candidate(\"abcd\") == \"abcd\")\n\t@test(candidate(\"Hello World!!!\") == \"Hello !!!Wdlor\")\n\t@test(candidate(\"\") == \"\")\n\t@test(candidate(\"Hi. My name is Mister Robot. How are you?\") == \".Hi My aemn is Meirst .Rboot How aer ?ouy\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "jl", - "prompt": "\"\"\"\n Given a vector of numbers, return whether or not they are sorted\n in ascending order. If vector has more than 1 duplicate of the same\n number, return false. Assume no negative numbers and only integers.\n\n Examples\n >>> is_sorted([5])\n true\n >>> is_sorted([1, 2, 3, 4, 5])\n true\n >>> is_sorted([1, 3, 2, 4, 5])\n false\n >>> is_sorted([1, 2, 3, 4, 5, 6])\n true\n >>> is_sorted([1, 2, 3, 4, 5, 6, 7])\n true\n >>> is_sorted([1, 3, 2, 4, 5, 6, 7])\n false\n >>> is_sorted([1, 2, 2, 3, 3, 4])\n true\n >>> is_sorted([1, 2, 2, 2, 3, 4])\n false\n \"\"\"\nfunction is_sorted(lst::Vector{Int64})::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_sorted;\n\t@test(candidate([5]) == true)\n\t@test(candidate([1, 2, 3, 4, 5]) == true)\n\t@test(candidate([1, 3, 2, 4, 5]) == false)\n\t@test(candidate([1, 2, 3, 4, 5, 6]) == true)\n\t@test(candidate([1, 2, 3, 4, 5, 6, 7]) == true)\n\t@test(candidate([1, 3, 2, 4, 5, 6, 7]) == false)\n\t@test(candidate(Vector{Int64}([])) == true)\n\t@test(candidate([1]) == true)\n\t@test(candidate([3, 2, 1]) == false)\n\t@test(candidate([1, 2, 2, 2, 3, 4]) == false)\n\t@test(candidate([1, 2, 3, 3, 3, 4]) == false)\n\t@test(candidate([1, 2, 2, 3, 3, 4]) == true)\n\t@test(candidate([1, 2, 3, 4]) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "jl", - "prompt": "\"\"\"You are given a string s.\n Your task is to check if the string is hapjl or not.\n A string is hapjl if its length is at least 3 and every 3 consecutive letters are distinct\n For example:\n >>> is_happy(\"a\")\n false\n >>> is_happy(\"aa\")\n false\n >>> is_happy(\"abcd\")\n true\n >>> is_happy(\"aabb\")\n false\n >>> is_happy(\"adb\")\n true\n >>> is_happy(\"xyy\")\n false\n \"\"\"\nfunction is_happy(s::String)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_happy;\n\t@test(candidate(\"a\") == false)\n\t@test(candidate(\"aa\") == false)\n\t@test(candidate(\"abcd\") == true)\n\t@test(candidate(\"aabb\") == false)\n\t@test(candidate(\"adb\") == true)\n\t@test(candidate(\"xyy\") == false)\n\t@test(candidate(\"iopaxpoi\") == true)\n\t@test(candidate(\"iopaxioi\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "jl", - "prompt": "\"\"\"\n Write a function that returns true if the object q will fly, and false otherwise.\n The object q will fly if it's balanced (it is a palindromic vector) and the sum of its elements is less than or equal the maximum possible weight w.\n\n Example:\n >>> will_it_fly([1, 2], 5)\n false\n # 1+2 is less than the maximum possible weight, but it's unbalanced.\n\n >>> will_it_fly([3, 2, 3], 1)\n false\n # it's balanced, but 3+2+3 is more than the maximum possible weight.\n\n >>> will_it_fly([3, 2, 3], 9)\n true\n # 3+2+3 is less than the maximum possible weight, and it's balanced.\n\n >>> will_it_fly([3], 5)\n true\n # 3 is less than the maximum possible weight, and it's balanced.\n \"\"\"\nfunction will_it_fly(q::Vector{Int64}, w::Int64)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = will_it_fly;\n\t@test(candidate([3, 2, 3], 9) == true)\n\t@test(candidate([1, 2], 5) == false)\n\t@test(candidate([3], 5) == true)\n\t@test(candidate([3, 2, 3], 1) == false)\n\t@test(candidate([1, 2, 3], 6) == false)\n\t@test(candidate([5], 5) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "jl", - "prompt": "\"\"\"\n Given a vector of non-negative integers, return a cojl of the given vector after sorting,\n you will sort the given vector in ascending order if the sum( first index value, last index value) is odd,\n or sort it in descending order if the sum( first index value, last index value) is even.\n\n Note:\n * don't change the given vector.\n\n Examples:\n >>> sort_array([])\n []\n >>> sort_array([5])\n [5]\n >>> sort_array([2, 4, 3, 0, 1, 5])\n [0, 1, 2, 3, 4, 5]\n >>> sort_array([2, 4, 3, 0, 1, 5, 6])\n [6, 5, 4, 3, 2, 1, 0]\n \"\"\"\nfunction sort_array(array::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = sort_array;\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([5]) == [5])\n\t@test(candidate([2, 4, 3, 0, 1, 5]) == [0, 1, 2, 3, 4, 5])\n\t@test(candidate([2, 4, 3, 0, 1, 5, 6]) == [6, 5, 4, 3, 2, 1, 0])\n\t@test(candidate([2, 1]) == [1, 2])\n\t@test(candidate([15, 42, 87, 32, 11, 0]) == [0, 11, 15, 32, 42, 87])\n\t@test(candidate([21, 14, 23, 11]) == [23, 21, 14, 11])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "jl", - "prompt": "\"\"\"Implement a function that takes an non-negative integer and returns a vector of the first n\n integers that are prime numbers and less than n.\n for example:\n >>> count_up_to(5)\n [2, 3]\n >>> count_up_to(11)\n [2, 3, 5, 7]\n >>> count_up_to(0)\n []\n >>> count_up_to(20)\n [2, 3, 5, 7, 11, 13, 17, 19]\n >>> count_up_to(1)\n []\n >>> count_up_to(18)\n [2, 3, 5, 7, 11, 13, 17]\n \"\"\"\nfunction count_up_to(n::Int64)::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = count_up_to;\n\t@test(candidate(5) == [2, 3])\n\t@test(candidate(6) == [2, 3, 5])\n\t@test(candidate(7) == [2, 3, 5])\n\t@test(candidate(10) == [2, 3, 5, 7])\n\t@test(candidate(0) == Vector{Int64}([]))\n\t@test(candidate(22) == [2, 3, 5, 7, 11, 13, 17, 19])\n\t@test(candidate(1) == Vector{Int64}([]))\n\t@test(candidate(18) == [2, 3, 5, 7, 11, 13, 17])\n\t@test(candidate(47) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43])\n\t@test(candidate(101) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "jl", - "prompt": "\"\"\" Out of vector of strings, return the longest one. Return the first one in case of multiple\n strings of the same length. Return nothing in case the input vector is empty.\n >>> longest([])\n nothing\n >>> longest([\"a\", \"b\", \"c\"])\n \"a\"\n >>> longest([\"a\", \"bb\", \"ccc\"])\n \"ccc\"\n \"\"\"\nfunction longest(strings::Vector{String})::Union{String, Nothing} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = longest;\n\t@test(candidate(Vector{String}([])) == nothing)\n\t@test(candidate([\"x\", \"y\", \"z\"]) == \"x\")\n\t@test(candidate([\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"]) == \"zzzz\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "jl", - "prompt": "\"\"\"\n Given a vector of integers, sort the integers that are between 1 and 9 inclusive,\n reverse the resulting vector, and then replace each digit by its corresponding name from\n \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n\n For example:\n >>> by_length([2, 1, 1, 4, 5, 8, 2, 3])\n [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n \n If the vector is empty, return an empty vector:\n >>> by_length([])\n []\n \n If the vector has any strange number ignore it:\n >>> by_length([1, -1, 55])\n [\"One\"]\n \"\"\"\nfunction by_length(arr::Vector{Int64})::Vector{String} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = by_length;\n\t@test(candidate([2, 1, 1, 4, 5, 8, 2, 3]) == [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"])\n\t@test(candidate(Vector{Int64}([])) == Vector{String}([]))\n\t@test(candidate([1, -1, 55]) == [\"One\"])\n\t@test(candidate([1, -1, 3, 2]) == [\"Three\", \"Two\", \"One\"])\n\t@test(candidate([9, 4, 8]) == [\"Nine\", \"Eight\", \"Four\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_106_f", - "language": "jl", - "prompt": "\"\"\" Implement the function f that takes n as a parameter,\n and returns a vector of size n, such that the value of the element at index i is the factorial of i if i is even\n or the sum of numbers from 1 to i otherwise.\n i starts from 1.\n the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n Example:\n >>> f(5)\n [1, 2, 6, 24, 15]\n \"\"\"\nfunction f(n::Int64)::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = f;\n\t@test(candidate(5) == [1, 2, 6, 24, 15])\n\t@test(candidate(7) == [1, 2, 6, 24, 15, 720, 28])\n\t@test(candidate(1) == [1])\n\t@test(candidate(3) == [1, 2, 6])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "jl", - "prompt": "\"\"\"Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n >>> fizz_buzz(50)\n 0\n >>> fizz_buzz(78)\n 2\n >>> fizz_buzz(79)\n 3\n \"\"\"\nfunction fizz_buzz(n::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = fizz_buzz;\n\t@test(candidate(50) == 0)\n\t@test(candidate(78) == 2)\n\t@test(candidate(79) == 3)\n\t@test(candidate(100) == 3)\n\t@test(candidate(200) == 6)\n\t@test(candidate(4000) == 192)\n\t@test(candidate(10000) == 639)\n\t@test(candidate(100000) == 8026)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "jl", - "prompt": "\"\"\" Given a positive floating point number, it can be decomposed into\n and integer part (largest integer smaller than given number) and decimals\n (leftover part always smaller than 1).\n\n Return the decimal part of the number.\n >>> truncate_number(3.5)\n 0.5\n \"\"\"\nfunction truncate_number(number::Float64)::Float64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = truncate_number;\n\t@test(candidate(3.5) == 0.5)\n\t@test(candidate(1.25) == 0.25)\n\t@test(candidate(123.0) == 0.0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "jl", - "prompt": "\"\"\" For a given vector of integers, return a tuple consisting of a sum and a product of all the integers in a vector.\n Empty sum should be equal to 0 and empty product should be equal to 1.\n >>> sum_product([])\n (0, 1)\n >>> sum_product([1, 2, 3, 4])\n (10, 24)\n \"\"\"\nfunction sum_product(numbers::Vector{Int64})::Tuple{Int64, Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = sum_product;\n\t@test(candidate(Vector{Int64}([])) == (0, 1))\n\t@test(candidate([1, 1, 1]) == (3, 1))\n\t@test(candidate([100, 0]) == (100, 0))\n\t@test(candidate([3, 5, 7]) == (15, 105))\n\t@test(candidate([10]) == (10, 10))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "jl", - "prompt": "\"\"\"\n You are given a 2 dimensional data, as a nested vectors,\n which is similar to matrix, however, unlike matrices,\n each row may contain a different number of columns.\n Given lst, and integer x, find integers x in the vector,\n and return vector of tuples, [(x1, y1), (x2, y2) ...] such that\n each tuple is a coordinate - (row, columns), starting with 0.\n Sort coordinates initially by rows in ascending order.\n Also, sort coordinates of the row by columns in descending order.\n \n Examples:\n >>> get_row([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1)\n [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n >>> get_row([], 1)\n []\n >>> get_row([[], [1], [1, 2, 3]], 3)\n [(2, 2)]\n \"\"\"\nfunction get_row(lst::Vector{Vector{Int64}}, x::Int64)::Vector{Tuple{Int64, Int64}} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = get_row;\n\t@test(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)])\n\t@test(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6]], 2) == [(0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1)])\n\t@test(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 1, 3, 4, 5, 6], [1, 2, 1, 4, 5, 6], [1, 2, 3, 1, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1) == [(0, 0), (1, 0), (2, 1), (2, 0), (3, 2), (3, 0), (4, 3), (4, 0), (5, 4), (5, 0), (6, 5), (6, 0)])\n\t@test(candidate(Vector{Vector{Int64}}([]), 1) == Vector{Tuple{Int64, Int64}}([]))\n\t@test(candidate([[1]], 2) == Vector{Tuple{Int64, Int64}}([]))\n\t@test(candidate([[], [1], [1, 2, 3]], 3) == [(2, 2)])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "jl", - "prompt": "\"\"\"\n You're a hungry rabbit, and you already have eaten a certain number of carrots,\n but now you need to eat more carrots to complete the day's meals.\n you should return a vector of [ total number of eaten carrots after your meals,\n the number of carrots left after your meals ]\n if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n \n Example:\n >>> eat(5, 6, 10)\n [11, 4]\n >>> eat(4, 8, 9)\n [12, 1]\n >>> eat(1, 10, 10)\n [11, 0]\n >>> eat(2, 11, 5)\n [7, 0]\n \n Variables:\n @number : integer\n the number of carrots that you have eaten.\n @need : integer\n the number of carrots that you need to eat.\n @remaining : integer\n the number of remaining carrots thet exist in stock\n \n Constrain:\n * 0 <= number <= 1000\n * 0 <= need <= 1000\n * 0 <= remaining <= 1000\n\n Have fun :)\n \"\"\"\nfunction eat(number::Int64, need::Int64, remaining::Int64)::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = eat;\n\t@test(candidate(5, 6, 10) == [11, 4])\n\t@test(candidate(4, 8, 9) == [12, 1])\n\t@test(candidate(1, 10, 10) == [11, 0])\n\t@test(candidate(2, 11, 5) == [7, 0])\n\t@test(candidate(4, 5, 7) == [9, 2])\n\t@test(candidate(4, 5, 1) == [5, 0])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "jl", - "prompt": "\"\"\"Given a positive integer N, return the total sum of its digits in binary.\n \n Example\n >>> solve(1000)\n \"1\"\n >>> solve(150)\n \"110\"\n >>> solve(147)\n \"1100\"\n \n Variables:\n @N integer\n Constraints: 0 \u2264 N \u2264 10000.\n Output:\n a string of binary number\n \"\"\"\nfunction solve(N::Int64)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = solve;\n\t@test(candidate(1000) == \"1\")\n\t@test(candidate(150) == \"110\")\n\t@test(candidate(147) == \"1100\")\n\t@test(candidate(333) == \"1001\")\n\t@test(candidate(963) == \"10010\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "jl", - "prompt": "\"\"\"You are given a vector of integers.\n You need to find the largest prime value and return the sum of its digits.\n\n Examples:\n >>> skjkasdkd([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3])\n 10\n >>> skjkasdkd([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1])\n 25\n >>> skjkasdkd([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3])\n 13\n >>> skjkasdkd([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6])\n 11\n >>> skjkasdkd([0, 81, 12, 3, 1, 21])\n 3\n >>> skjkasdkd([0, 8, 1, 2, 1, 7])\n 7\n \"\"\"\nfunction skjkasdkd(lst::Vector{Int64})::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = skjkasdkd;\n\t@test(candidate([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]) == 10)\n\t@test(candidate([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]) == 25)\n\t@test(candidate([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]) == 13)\n\t@test(candidate([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]) == 11)\n\t@test(candidate([0, 81, 12, 3, 1, 21]) == 3)\n\t@test(candidate([0, 8, 1, 2, 1, 7]) == 7)\n\t@test(candidate([8191]) == 19)\n\t@test(candidate([8191, 123456, 127, 7]) == 19)\n\t@test(candidate([127, 97, 8192]) == 10)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "jl", - "prompt": "\"\"\"\n Given a vector arr of integers, find the minimum number of elements that\n need to be changed to make the vector palindromic. A palindromic vector is a vector that\n is read the same backwards and forwards. In one change, you can change one element to any other element.\n\n For example:\n >>> smallest_change([1, 2, 3, 5, 4, 7, 9, 6])\n 4\n >>> smallest_change([1, 2, 3, 4, 3, 2, 2])\n 1\n >>> smallest_change([1, 2, 3, 2, 1])\n 0\n \"\"\"\nfunction smallest_change(arr::Vector{Int64})::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = smallest_change;\n\t@test(candidate([1, 2, 3, 5, 4, 7, 9, 6]) == 4)\n\t@test(candidate([1, 2, 3, 4, 3, 2, 2]) == 1)\n\t@test(candidate([1, 4, 2]) == 1)\n\t@test(candidate([1, 4, 4, 2]) == 1)\n\t@test(candidate([1, 2, 3, 2, 1]) == 0)\n\t@test(candidate([3, 1, 1, 3]) == 0)\n\t@test(candidate([1]) == 0)\n\t@test(candidate([0, 1]) == 1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "jl", - "prompt": "\"\"\"It is the last week of the semester and the teacher has to give the grades\n to students. The teacher has been making her own algorithm for grading.\n The only problem is, she has lost the code she used for grading.\n She has given you a vector of GPAs for some students and you have to write \n a function that can output a vector of letter grades using the following table:\n GPA | Letter grade\n 4.0 A+\n > 3.7 A \n > 3.3 A- \n > 3.0 B+\n > 2.7 B \n > 2.3 B-\n > 2.0 C+\n > 1.7 C\n > 1.3 C-\n > 1.0 D+ \n > 0.7 D \n > 0.0 D-\n 0.0 E\n \n\n Example:\n >>> grade_equation([4.0, 3, 1.7, 2, 3.5])\n [\"A+\", \"B\", \"C-\", \"C\", \"A-\"]\n \"\"\"\nfunction numerical_letter_grade(grades::Vector{Float64})::Vector{String} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = numerical_letter_grade;\n\t@test(candidate([4.0, 3, 1.7, 2, 3.5]) == [\"A+\", \"B\", \"C-\", \"C\", \"A-\"])\n\t@test(candidate([1.2]) == [\"D+\"])\n\t@test(candidate([0.5]) == [\"D-\"])\n\t@test(candidate([0.0]) == [\"E\"])\n\t@test(candidate([1.0, 0.3, 1.5, 2.8, 3.3]) == [\"D\", \"D-\", \"C-\", \"B\", \"B+\"])\n\t@test(candidate([0.0, 0.7]) == [\"E\", \"D-\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "jl", - "prompt": "\"\"\"\n Given the lengths of the three sides of a triangle. Return the area of\n the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n Otherwise return -1\n Three sides make a valid triangle when the sum of any two sides is greater \n than the third side.\n Example:\n >>> triangle_area(3, 4, 5)\n 6.0\n >>> triangle_area(1, 2, 10)\n -1\n \"\"\"\nfunction triangle_area(a::Int64, b::Int64, c::Int64)::Float64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = triangle_area;\n\t@test(candidate(3, 4, 5) == 6.0)\n\t@test(candidate(1, 2, 10) == -1)\n\t@test(candidate(4, 8, 5) == 8.18)\n\t@test(candidate(2, 2, 2) == 1.73)\n\t@test(candidate(1, 2, 3) == -1)\n\t@test(candidate(10, 5, 7) == 16.25)\n\t@test(candidate(2, 6, 3) == -1)\n\t@test(candidate(1, 1, 1) == 0.43)\n\t@test(candidate(2, 2, 10) == -1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "jl", - "prompt": "\"\"\"\n Check if two words have the same characters.\n >>> same_chars(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\")\n true\n >>> same_chars(\"abcd\", \"dddddddabc\")\n true\n >>> same_chars(\"dddddddabc\", \"abcd\")\n true\n >>> same_chars(\"eabcd\", \"dddddddabc\")\n false\n >>> same_chars(\"abcd\", \"dddddddabce\")\n false\n >>> same_chars(\"eabcdzzzz\", \"dddzzzzzzzddddabc\")\n false\n \"\"\"\nfunction same_chars(s0::String, s1::String)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = same_chars;\n\t@test(candidate(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\") == true)\n\t@test(candidate(\"abcd\", \"dddddddabc\") == true)\n\t@test(candidate(\"dddddddabc\", \"abcd\") == true)\n\t@test(candidate(\"eabcd\", \"dddddddabc\") == false)\n\t@test(candidate(\"abcd\", \"dddddddabcf\") == false)\n\t@test(candidate(\"eabcdzzzz\", \"dddzzzzzzzddddabc\") == false)\n\t@test(candidate(\"aabb\", \"aaccc\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "jl", - "prompt": "\"\"\"\n Given a vector of integers nums, find the minimum sum of any non-empty sub-vector\n of nums.\n Example\n >>> minSubArraySum([2, 3, 4, 1, 2, 4])\n 1\n >>> minSubArraySum([-1, -2, -3])\n -6\n \"\"\"\nfunction minSubArraySum(nums::Vector{Int64})::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = minSubArraySum;\n\t@test(candidate([2, 3, 4, 1, 2, 4]) == 1)\n\t@test(candidate([-1, -2, -3]) == -6)\n\t@test(candidate([-1, -2, -3, 2, -10]) == -14)\n\t@test(candidate([-9999999999999999]) == -9999999999999999)\n\t@test(candidate([0, 10, 20, 1000000]) == 0)\n\t@test(candidate([-1, -2, -3, 10, -5]) == -6)\n\t@test(candidate([100, -1, -2, -3, 10, -5]) == -6)\n\t@test(candidate([10, 11, 13, 8, 3, 4]) == 3)\n\t@test(candidate([100, -33, 32, -1, 0, -2]) == -33)\n\t@test(candidate([-10]) == -10)\n\t@test(candidate([7]) == 7)\n\t@test(candidate([1, -1]) == -1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "jl", - "prompt": "\"\"\"Given a string s and a natural number n, you have been tasked to implement \n a function that returns a vector of all words from string s that contain exactly \n n consonants, in order these words appear in the string s.\n If the string s is empty then the function should return an empty vector.\n Note: you may assume the input string contains only letters and spaces.\n Examples:\n >>> select_words(\"Mary had a little lamb\", 4)\n [\"little\"]\n >>> select_words(\"Mary had a little lamb\", 3)\n [\"Mary\", \"lamb\"]\n >>> select_words(\"simple white space\", 2)\n []\n >>> select_words(\"Hello world\", 4)\n [\"world\"]\n >>> select_words(\"Uncle sam\", 3)\n [\"Uncle\"]\n \"\"\"\nfunction select_words(s::String, n::Int64)::Vector{String} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = select_words;\n\t@test(candidate(\"Mary had a little lamb\", 4) == [\"little\"])\n\t@test(candidate(\"Mary had a little lamb\", 3) == [\"Mary\", \"lamb\"])\n\t@test(candidate(\"simple white space\", 2) == Vector{String}([]))\n\t@test(candidate(\"Hello world\", 4) == [\"world\"])\n\t@test(candidate(\"Uncle sam\", 3) == [\"Uncle\"])\n\t@test(candidate(\"\", 4) == Vector{String}([]))\n\t@test(candidate(\"a b c d e f\", 1) == [\"b\", \"c\", \"d\", \"f\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "jl", - "prompt": "\"\"\" Return vector of all prefixes from shortest to longest of the input string\n >>> all_prefixes(\"abc\")\n [\"a\", \"ab\", \"abc\"]\n \"\"\"\nfunction all_prefixes(string::String)::Vector{String} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = all_prefixes;\n\t@test(candidate(\"\") == Vector{String}([]))\n\t@test(candidate(\"asdfgh\") == [\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"])\n\t@test(candidate(\"WWW\") == [\"W\", \"WW\", \"WWW\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "jl", - "prompt": "\"\"\"\n Create a function that takes a value (string) representing a number\n and returns the closest integer to it. If the number is equidistant\n from two integers, round it away from zero.\n\n Examples\n >>> closest_integer(\"10\")\n 10\n >>> closest_integer(\"15.3\")\n 15\n\n Note:\n Rounding away from zero means that if the given number is equidistant\n from two integers, the one you should return is the one that is the\n farthest from zero. For example closest_integer(\"14.5\") should\n return 15 and closest_integer(\"-14.5\") should return -15.\n \"\"\"\nfunction closest_integer(value::String)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = closest_integer;\n\t@test(candidate(\"10\") == 10)\n\t@test(candidate(\"14.5\") == 15)\n\t@test(candidate(\"-15.5\") == -16)\n\t@test(candidate(\"15.3\") == 15)\n\t@test(candidate(\"0\") == 0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "jl", - "prompt": "\"\"\"Create a function which takes a string representing a file's name, and returns\n 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n A file's name is considered to be valid if and only if all the following conditions \n are met:\n - There should not be more than three digits ('0'-'9') in the file's name.\n - The file's name contains exactly one dot '.'\n - The substring before the dot should not be empty, and it starts with a letter from \n the latin alphapet ('a'-'z' and 'A'-'Z').\n - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n Examples:\n >>> file_name_check(\"example.txt\")\n \"Yes\"\n >>> file_name_check(\"1example.dll\")\n \"No\"\n \"\"\"\nfunction file_name_check(file_name::String)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = file_name_check;\n\t@test(candidate(\"example.txt\") == \"Yes\")\n\t@test(candidate(\"1example.dll\") == \"No\")\n\t@test(candidate(\"s1sdf3.asd\") == \"No\")\n\t@test(candidate(\"K.dll\") == \"Yes\")\n\t@test(candidate(\"MY16FILE3.exe\") == \"Yes\")\n\t@test(candidate(\"His12FILE94.exe\") == \"No\")\n\t@test(candidate(\"_Y.txt\") == \"No\")\n\t@test(candidate(\"?aREYA.exe\") == \"No\")\n\t@test(candidate(\"/this_is_valid.dll\") == \"No\")\n\t@test(candidate(\"this_is_valid.wow\") == \"No\")\n\t@test(candidate(\"this_is_valid.txt\") == \"Yes\")\n\t@test(candidate(\"this_is_valid.txtexe\") == \"No\")\n\t@test(candidate(\"#this2_i4s_5valid.ten\") == \"No\")\n\t@test(candidate(\"@this1_is6_valid.exe\") == \"No\")\n\t@test(candidate(\"this_is_12valid.6exe4.txt\") == \"No\")\n\t@test(candidate(\"all.exe.txt\") == \"No\")\n\t@test(candidate(\"I563_No.exe\") == \"Yes\")\n\t@test(candidate(\"Is3youfault.txt\") == \"Yes\")\n\t@test(candidate(\"no_one#knows.dll\") == \"Yes\")\n\t@test(candidate(\"1I563_Yes3.exe\") == \"No\")\n\t@test(candidate(\"I563_Yes3.txtt\") == \"No\")\n\t@test(candidate(\"final..txt\") == \"No\")\n\t@test(candidate(\"final132\") == \"No\")\n\t@test(candidate(\"_f4indsartal132.\") == \"No\")\n\t@test(candidate(\".txt\") == \"No\")\n\t@test(candidate(\"s.\") == \"No\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "jl", - "prompt": "\"\"\"You are given two intervals,\n where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n The given intervals are closed which means that the interval (start, end)\n includes both start and end.\n For each given interval, it is assumed that its start is less or equal its end.\n Your task is to determine whether the length of intersection of these two \n intervals is a prime number.\n Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n which its length is 1, which not a prime number.\n If the length of the intersection is a prime number, return \"YES\",\n otherwise, return \"NO\".\n If the two intervals don't intersect, return \"NO\".\n\n\n [input/output] samples:\n >>> intersection((1, 2), (2, 3))\n \"NO\"\n >>> intersection((-1, 1), (0, 4))\n \"NO\"\n >>> intersection((-3, -1), (-5, 5))\n \"YES\"\n \"\"\"\nfunction intersection(interval1::Tuple{Int64, Int64}, interval2::Tuple{Int64, Int64})::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = intersection;\n\t@test(candidate((1, 2), (2, 3)) == \"NO\")\n\t@test(candidate((-1, 1), (0, 4)) == \"NO\")\n\t@test(candidate((-3, -1), (-5, 5)) == \"YES\")\n\t@test(candidate((-2, 2), (-4, 0)) == \"YES\")\n\t@test(candidate((-11, 2), (-1, -1)) == \"NO\")\n\t@test(candidate((1, 2), (3, 5)) == \"NO\")\n\t@test(candidate((1, 2), (1, 2)) == \"NO\")\n\t@test(candidate((-2, -2), (-3, -2)) == \"NO\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "jl", - "prompt": "\"\"\"Return the largest prime factor of n. Assume n > 1 and is not a prime.\n >>> largest_prime_factor(13195)\n 29\n >>> largest_prime_factor(2048)\n 2\n \"\"\"\nfunction largest_prime_factor(n::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = largest_prime_factor;\n\t@test(candidate(15) == 5)\n\t@test(candidate(27) == 3)\n\t@test(candidate(63) == 7)\n\t@test(candidate(330) == 11)\n\t@test(candidate(13195) == 29)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "jl", - "prompt": "\"\"\" Given a string, find out how many distinct characters (regardless of case) does it consist of\n >>> count_distinct_characters(\"xyzXYZ\")\n 3\n >>> count_distinct_characters(\"Jerry\")\n 4\n \"\"\"\nfunction count_distinct_characters(string::String)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = count_distinct_characters;\n\t@test(candidate(\"\") == 0)\n\t@test(candidate(\"abcde\") == 5)\n\t@test(candidate(\"abcdecadeCADE\") == 5)\n\t@test(candidate(\"aaaaAAAAaaaa\") == 1)\n\t@test(candidate(\"Jerry jERRY JeRRRY\") == 5)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "jl", - "prompt": "\"\"\" You're given a vector of deposit and withdrawal operations on a bank account that starts with\n zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n at that point function should return true. Otherwise it should return false.\n >>> below_zero([1, 2, 3])\n false\n >>> below_zero([1, 2, -4, 5])\n true\n \"\"\"\nfunction below_zero(operations::Vector{Int64})::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = below_zero;\n\t@test(candidate(Vector{Int64}([])) == false)\n\t@test(candidate([1, 2, -3, 1, 2, -3]) == false)\n\t@test(candidate([1, 2, -4, 5, 6]) == true)\n\t@test(candidate([1, -1, 2, -2, 5, -5, 4, -4]) == false)\n\t@test(candidate([1, -1, 2, -2, 5, -5, 4, -5]) == true)\n\t@test(candidate([1, -2, 2, -2, 5, -5, 4, -4]) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "jl", - "prompt": "\"\"\" Find the shortest palindrome that begins with a supplied string.\n Algorithm idea is simple:\n - Find the longest postfix of supplied string that is a palindrome.\n - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n >>> make_palindrome(\"\")\n \"\"\n >>> make_palindrome(\"cat\")\n \"catac\"\n >>> make_palindrome(\"cata\")\n \"catac\"\n \"\"\"\nfunction make_palindrome(string::String)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = make_palindrome;\n\t@test(candidate(\"\") == \"\")\n\t@test(candidate(\"x\") == \"x\")\n\t@test(candidate(\"xyz\") == \"xyzyx\")\n\t@test(candidate(\"xyx\") == \"xyx\")\n\t@test(candidate(\"jerry\") == \"jerryrrej\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "jl", - "prompt": "\"\"\"\n Given a positive integer, obtain its roman numeral equivalent as a string,\n and return it in lowercase.\n Restrictions: 1 <= num <= 1000\n\n Examples:\n >>> int_to_mini_roman(19)\n \"xix\"\n >>> int_to_mini_roman(152)\n \"clii\"\n >>> int_to_mini_roman(426)\n \"cdxxvi\"\n \"\"\"\nfunction int_to_mini_roman(number::Int64)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "reworded", - "tests": "using Test\n\n@testset begin\n\ncandidate = int_to_mini_roman;\n\t@test(candidate(19) == \"xix\")\n\t@test(candidate(152) == \"clii\")\n\t@test(candidate(251) == \"ccli\")\n\t@test(candidate(426) == \"cdxxvi\")\n\t@test(candidate(500) == \"d\")\n\t@test(candidate(1) == \"i\")\n\t@test(candidate(4) == \"iv\")\n\t@test(candidate(43) == \"xliii\")\n\t@test(candidate(90) == \"xc\")\n\t@test(candidate(94) == \"xciv\")\n\t@test(candidate(532) == \"dxxxii\")\n\t@test(candidate(900) == \"cm\")\n\t@test(candidate(994) == \"cmxciv\")\n\t@test(candidate(1000) == \"m\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - } -] \ No newline at end of file diff --git a/data/jl-transform.json b/data/jl-transform.json deleted file mode 100644 index 777dd1aaf308d1a3a01bd5621eebb0bed57fd460..0000000000000000000000000000000000000000 --- a/data/jl-transform.json +++ /dev/null @@ -1,2228 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "jl", - "prompt": "\"\"\" For a given number n, find the largest number that divides n evenly, smaller than n\n >>> largest_divisor(15)\n 5\n \"\"\"\nfunction largest_divisor(n::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = largest_divisor;\n\t@test(candidate(3) == 1)\n\t@test(candidate(7) == 1)\n\t@test(candidate(10) == 5)\n\t@test(candidate(100) == 50)\n\t@test(candidate(49) == 7)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_47_median", - "language": "jl", - "prompt": "\"\"\"Return median of elements in the list l.\n >>> median([3, 1, 2, 4, 5])\n 3\n >>> median([-10, 4, 6, 1000, 10, 20])\n 15.0\n \"\"\"\nfunction median(l::Vector{Int64})::Float64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = median;\n\t@test(candidate([3, 1, 2, 4, 5]) == 3)\n\t@test(candidate([-10, 4, 6, 1000, 10, 20]) == 8.0)\n\t@test(candidate([5]) == 5)\n\t@test(candidate([6, 5]) == 5.5)\n\t@test(candidate([8, 1, 3, 9, 9, 2, 7]) == 7)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "jl", - "prompt": "\"\"\"\n Given two lists operator, and operand. The first list has basic algebra operations, and \n the second list is a list of integers. Use the two given lists to build the algebric \n expression and return the evaluation of this expression.\n\n The basic algebra operations:\n Addition ( + ) \n Subtraction ( - ) \n Multiplication ( * ) \n Floor division ( // ) \n Exponentiation ( ** ) \n\n Example:\n operator['+', '*', '-']\n array = [2, 3, 4, 5]\n result = 2 + 3 * 4 - 5\n => result = 9\n\n Note:\n The length of operator list is equal to the length of operand list minus one.\n Operand is a list of of non-negative integers.\n Operator list has at least one operator, and operand list has at least two operands.\n\n \"\"\"\nfunction do_algebra(operator::Vector{String}, operand::Vector{Int64})::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = do_algebra;\n\t@test(candidate([\"**\", \"*\", \"+\"], [2, 3, 4, 5]) == 37)\n\t@test(candidate([\"+\", \"*\", \"-\"], [2, 3, 4, 5]) == 9)\n\t@test(candidate([\"//\", \"*\"], [7, 3, 4]) == 8)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "jl", - "prompt": "\"\"\"Return maximum element in the list.\n >>> max_element([1, 2, 3])\n 3\n >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n 123\n \"\"\"\nfunction max_element(l::Vector{Int64})::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = max_element;\n\t@test(candidate([1, 2, 3]) == 3)\n\t@test(candidate([5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]) == 124)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "jl", - "prompt": "\"\"\"Create a function which returns the largest index of an element which\n is not greater than or equal to the element immediately preceding it. If\n no such element exists then return -1. The given array will not contain\n duplicate values.\n\n Examples:\n >>> can_arrange([1, 2, 4, 3, 5])\n 3\n >>> can_arrange([1, 2, 3])\n -1\n \"\"\"\nfunction can_arrange(arr::Vector{Int64})::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = can_arrange;\n\t@test(candidate([1, 2, 4, 3, 5]) == 3)\n\t@test(candidate([1, 2, 4, 5]) == -1)\n\t@test(candidate([1, 4, 2, 5, 6, 7, 8, 9, 10]) == 2)\n\t@test(candidate([4, 8, 5, 7, 3]) == 4)\n\t@test(candidate(Vector{Int64}([])) == -1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "jl", - "prompt": "\"\"\"\n Imagine a road that's a perfectly straight infinitely long line.\n n cars are driving left to right; simultaneously, a different set of n cars\n are driving right to left. The two sets of cars start out being very far from\n each other. All cars move in the same speed. Two cars are said to collide\n when a car that's moving left to right hits a car that's moving right to left.\n However, the cars are infinitely sturdy and strong; as a result, they continue moving\n in their trajectory as if they did not collide.\n\n This function outputs the number of such collisions.\n \"\"\"\nfunction car_race_collision(n::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = car_race_collision;\n\t@test(candidate(2) == 4)\n\t@test(candidate(3) == 9)\n\t@test(candidate(4) == 16)\n\t@test(candidate(8) == 64)\n\t@test(candidate(10) == 100)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "jl", - "prompt": "\"\"\"\n Create a function that returns True if the last character\n of a given string is an alphabetical character and is not\n a part of a word, and False otherwise.\n Note: \"word\" is a group of characters separated by space.\n\n Examples:\n >>> check_if_last_char_is_a_letter(\"apple pie\")\n false\n >>> check_if_last_char_is_a_letter(\"apple pi e\")\n true\n >>> check_if_last_char_is_a_letter(\"apple pi e \")\n false\n >>> check_if_last_char_is_a_letter(\"\")\n false\n \"\"\"\nfunction check_if_last_char_is_a_letter(txt::String)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = check_if_last_char_is_a_letter;\n\t@test(candidate(\"apple\") == false)\n\t@test(candidate(\"apple pi e\") == true)\n\t@test(candidate(\"eeeee\") == false)\n\t@test(candidate(\"A\") == true)\n\t@test(candidate(\"Pumpkin pie \") == false)\n\t@test(candidate(\"Pumpkin pie 1\") == false)\n\t@test(candidate(\"\") == false)\n\t@test(candidate(\"eeeee e \") == false)\n\t@test(candidate(\"apple pie\") == false)\n\t@test(candidate(\"apple pi e \") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "jl", - "prompt": "\"\"\"Return true if a given number is prime, and false otherwise.\n >>> is_prime(6)\n false\n >>> is_prime(101)\n true\n >>> is_prime(11)\n true\n >>> is_prime(13441)\n true\n >>> is_prime(61)\n true\n >>> is_prime(4)\n false\n >>> is_prime(1)\n false\n \"\"\"\nfunction is_prime(n::Int64)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_prime;\n\t@test(candidate(6) == false)\n\t@test(candidate(101) == true)\n\t@test(candidate(11) == true)\n\t@test(candidate(13441) == true)\n\t@test(candidate(61) == true)\n\t@test(candidate(4) == false)\n\t@test(candidate(1) == false)\n\t@test(candidate(5) == true)\n\t@test(candidate(11) == true)\n\t@test(candidate(17) == true)\n\t@test(candidate(85) == false)\n\t@test(candidate(77) == false)\n\t@test(candidate(255379) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "jl", - "prompt": "\"\"\"Given a list of positive integers x. return a sorted list of all \n elements that hasn't any even digit.\n\n Note: Returned list should be sorted in increasing order.\n \n For example:\n >>> unique_digits([15, 33, 1422, 1])\n [1, 15, 33]\n >>> unique_digits([152, 323, 1422, 10])\n []\n \"\"\"\nfunction unique_digits(x::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = unique_digits;\n\t@test(candidate([15, 33, 1422, 1]) == [1, 15, 33])\n\t@test(candidate([152, 323, 1422, 10]) == Vector{Int64}([]))\n\t@test(candidate([12345, 2033, 111, 151]) == [111, 151])\n\t@test(candidate([135, 103, 31]) == [31, 135])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "jl", - "prompt": "\"\"\" Input are two strings a and b consisting only of 1s and 0s.\n Perform binary XOR on these inputs and return result also as a string.\n >>> string_xor(\"010\", \"110\")\n \"100\"\n \"\"\"\nfunction string_xor(a::String, b::String)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = string_xor;\n\t@test(candidate(\"111000\", \"101010\") == \"010010\")\n\t@test(candidate(\"1\", \"1\") == \"0\")\n\t@test(candidate(\"0101\", \"0000\") == \"0101\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "jl", - "prompt": "\"\"\"sum_to_n is a function that sums numbers from 1 to n.\n >>> sum_to_n(30)\n 465\n >>> sum_to_n(100)\n 5050\n >>> sum_to_n(5)\n 15\n >>> sum_to_n(10)\n 55\n >>> sum_to_n(1)\n 1\n \"\"\"\nfunction sum_to_n(n::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = sum_to_n;\n\t@test(candidate(1) == 1)\n\t@test(candidate(6) == 21)\n\t@test(candidate(11) == 66)\n\t@test(candidate(30) == 465)\n\t@test(candidate(100) == 5050)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "jl", - "prompt": "\"\"\"\n Given a list of numbers, return the sum of squares of the numbers\n in the list that are odd. Ignore numbers that are negative or not integers.\n \n >>> double_the_difference([1, 3, 2, 0])\n 10\n >>> double_the_difference([-1, -2, 0])\n 0\n >>> double_the_difference([9, -2])\n 81\n >>> double_the_difference([0])\n 0\n \n If the input list is empty, return 0.\n \"\"\"\nfunction double_the_difference(lst::Vector{Float64})::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = double_the_difference;\n\t@test(candidate(Vector{Float64}([])) == 0)\n\t@test(candidate([5.0, 4.0]) == 25)\n\t@test(candidate([0.1, 0.2, 0.3]) == 0)\n\t@test(candidate([-10.0, -20.0, -30.0]) == 0)\n\t@test(candidate([-1.0, -2.0, 8.0]) == 0)\n\t@test(candidate([0.2, 3.0, 5.0]) == 34)\n\t@test(candidate([-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]) == 165)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "jl", - "prompt": "\"\"\" Return length of given string\n >>> strlen(\"\")\n 0\n >>> strlen(\"abc\")\n 3\n \"\"\"\nfunction strlen(string::String)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = strlen;\n\t@test(candidate(\"\") == 0)\n\t@test(candidate(\"x\") == 1)\n\t@test(candidate(\"asdasnakj\") == 9)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "jl", - "prompt": "\"\"\"\n You'll be given a string of words, and your task is to count the number\n of boredoms. A boredom is a sentence that starts with the word \"I\".\n Sentences are delimited by '.', '?' or '!'.\n \n For example:\n >>> is_bored(\"Hello world\")\n 0\n >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n 1\n \"\"\"\nfunction is_bored(S::String)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_bored;\n\t@test(candidate(\"Hello world\") == 0)\n\t@test(candidate(\"Is the sky blue?\") == 0)\n\t@test(candidate(\"I love It !\") == 1)\n\t@test(candidate(\"bIt\") == 0)\n\t@test(candidate(\"I feel good today. I will be productive. will kill It\") == 2)\n\t@test(candidate(\"You and I are going for a walk\") == 0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "jl", - "prompt": "\"\"\"Write a function vowels_count which takes a string representing\n a word as input and returns the number of vowels in the string.\n Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n vowel, but only when it is at the end of the given word.\n\n Example:\n >>> vowels_count(\"abcde\")\n 2\n >>> vowels_count(\"ACEDY\")\n 3\n \"\"\"\nfunction vowels_count(s::String)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = vowels_count;\n\t@test(candidate(\"abcde\") == 2)\n\t@test(candidate(\"Alone\") == 3)\n\t@test(candidate(\"key\") == 2)\n\t@test(candidate(\"bye\") == 1)\n\t@test(candidate(\"keY\") == 2)\n\t@test(candidate(\"bYe\") == 1)\n\t@test(candidate(\"ACEDY\") == 3)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "jl", - "prompt": "\"\"\"Return n-th Fibonacci number.\n >>> fib(10)\n 55\n >>> fib(1)\n 1\n >>> fib(8)\n 21\n \"\"\"\nfunction fib(n::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = fib;\n\t@test(candidate(10) == 55)\n\t@test(candidate(1) == 1)\n\t@test(candidate(8) == 21)\n\t@test(candidate(11) == 89)\n\t@test(candidate(12) == 144)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "jl", - "prompt": "\"\"\"Your task is to implement a function that will simplify the expression\n x * n. The function returns True if x * n evaluates to a whole number and False\n otherwise. Both x and n, are string representation of a fraction, and have the following format,\n / where both numerator and denominator are positive whole numbers.\n\n You can assume that x, and n are valid fractions, and do not have zero as denominator.\n\n >>> simplify(\"1/5\", \"5/1\")\n true\n >>> simplify(\"1/6\", \"2/1\")\n false\n >>> simplify(\"7/10\", \"10/2\")\n false\n \"\"\"\nfunction simplify(x::String, n::String)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = simplify;\n\t@test(candidate(\"1/5\", \"5/1\") == true)\n\t@test(candidate(\"1/6\", \"2/1\") == false)\n\t@test(candidate(\"5/1\", \"3/1\") == true)\n\t@test(candidate(\"7/10\", \"10/2\") == false)\n\t@test(candidate(\"2/10\", \"50/10\") == true)\n\t@test(candidate(\"7/2\", \"4/2\") == true)\n\t@test(candidate(\"11/6\", \"6/1\") == true)\n\t@test(candidate(\"2/3\", \"5/2\") == false)\n\t@test(candidate(\"5/2\", \"3/5\") == false)\n\t@test(candidate(\"2/4\", \"8/4\") == true)\n\t@test(candidate(\"2/4\", \"4/2\") == true)\n\t@test(candidate(\"1/5\", \"5/1\") == true)\n\t@test(candidate(\"1/5\", \"1/5\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "jl", - "prompt": "\"\"\"\n Given a string s, count the number of uppercase vowels in even indices.\n \n For example:\n >>> count_upper(\"aBCdEf\")\n 1\n >>> count_upper(\"abcdefg\")\n 0\n >>> count_upper(\"dBBE\")\n 0\n \"\"\"\nfunction count_upper(s::String)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = count_upper;\n\t@test(candidate(\"aBCdEf\") == 1)\n\t@test(candidate(\"abcdefg\") == 0)\n\t@test(candidate(\"dBBE\") == 0)\n\t@test(candidate(\"B\") == 0)\n\t@test(candidate(\"U\") == 1)\n\t@test(candidate(\"\") == 0)\n\t@test(candidate(\"EEEE\") == 2)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "jl", - "prompt": "\"\"\"\n You are given a rectangular grid of wells. Each row represents a single well,\n and each 1 in a row represents a single unit of water.\n Each well has a corresponding bucket that can be used to extract water from it, \n and all buckets have the same capacity.\n Your task is to use the buckets to empty the wells.\n Output the number of times you need to lower the buckets.\n\n Example 1:\n >>> max_fill([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1)\n 6\n\n Example 2:\n >>> max_fill([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2)\n 5\n \n Example 3:\n >>> max_fill([[0, 0, 0], [0, 0, 0]], 5)\n 0\n\n Constraints:\n * all wells have the same length\n * 1 <= grid.length <= 10^2\n * 1 <= grid[:,1].length <= 10^2\n * grid[i][j] -> 0 | 1\n * 1 <= capacity <= 10\n \"\"\"\nfunction max_fill(grid::Vector{Vector{Int64}}, capacity::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = max_fill;\n\t@test(candidate([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1) == 6)\n\t@test(candidate([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2) == 5)\n\t@test(candidate([[0, 0, 0], [0, 0, 0]], 5) == 0)\n\t@test(candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 2) == 4)\n\t@test(candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 9) == 2)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "jl", - "prompt": "\"\"\"\n Given an array arr of integers and a positive integer k, return a sorted list \n of length k with the maximum k numbers in arr.\n\n Example 1:\n\n >>> maximum([-3, -4, 5], 3)\n [-4, -3, 5]\n\n Example 2:\n\n >>> maximum([4, -4, 4], 2)\n [4, 4]\n\n Example 3:\n\n >>> maximum([-3, 2, 1, 2, -1, -2, 1], 1)\n [2]\n\n Note:\n 1. The length of the array will be in the range of [1, 1000].\n 2. The elements in the array will be in the range of [-1000, 1000].\n 3. 0 <= k <= len(arr)\n \"\"\"\nfunction maximum(arr::Vector{Int64}, k::Int64)::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = maximum;\n\t@test(candidate([-3, -4, 5], 3) == [-4, -3, 5])\n\t@test(candidate([4, -4, 4], 2) == [4, 4])\n\t@test(candidate([-3, 2, 1, 2, -1, -2, 1], 1) == [2])\n\t@test(candidate([123, -123, 20, 0, 1, 2, -3], 3) == [2, 20, 123])\n\t@test(candidate([-123, 20, 0, 1, 2, -3], 4) == [0, 1, 2, 20])\n\t@test(candidate([5, 15, 0, 3, -13, -8, 0], 7) == [-13, -8, 0, 0, 3, 5, 15])\n\t@test(candidate([-1, 0, 2, 5, 3, -10], 2) == [3, 5])\n\t@test(candidate([1, 0, 5, -7], 1) == [5])\n\t@test(candidate([4, -4], 2) == [-4, 4])\n\t@test(candidate([-10, 10], 2) == [-10, 10])\n\t@test(candidate([1, 2, 3, -23, 243, -400, 0], 0) == Vector{Int64}([]))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "jl", - "prompt": "\"\"\"\n Write a function that takes a message, and encodes in such a \n way that it swaps case of all letters, replaces all vowels in \n the message with the letter that appears 2 places ahead of that \n vowel in the english alphabet. \n Assume only letters. \n \n Examples:\n >>> encode(\"test\")\n \"TGST\"\n >>> encode(\"This is a message\")\n \"tHKS KS C MGSSCGG\"\n \"\"\"\nfunction encode(message::String)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = encode;\n\t@test(candidate(\"TEST\") == \"tgst\")\n\t@test(candidate(\"Mudasir\") == \"mWDCSKR\")\n\t@test(candidate(\"YES\") == \"ygs\")\n\t@test(candidate(\"This is a message\") == \"tHKS KS C MGSSCGG\")\n\t@test(candidate(\"I DoNt KnOw WhAt tO WrItE\") == \"k dQnT kNqW wHcT Tq wRkTg\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "jl", - "prompt": "\"\"\"\n remove_vowels is a function that takes string and returns string without vowels.\n >>> remove_vowels(\"\")\n \"\"\n >>> remove_vowels(\"abcdef\")\n \"bcdf\"\n >>> remove_vowels(\"aaaaa\")\n \"\"\n >>> remove_vowels(\"aaBAA\")\n \"B\"\n >>> remove_vowels(\"zbcd\")\n \"zbcd\"\n \"\"\"\nfunction remove_vowels(text::String)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = remove_vowels;\n\t@test(candidate(\"\") == \"\")\n\t@test(candidate(\"abcdef\nghijklm\") == \"bcdf\nghjklm\")\n\t@test(candidate(\"fedcba\") == \"fdcb\")\n\t@test(candidate(\"eeeee\") == \"\")\n\t@test(candidate(\"acBAA\") == \"cB\")\n\t@test(candidate(\"EcBOO\") == \"cB\")\n\t@test(candidate(\"ybcd\") == \"ybcd\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "jl", - "prompt": "\"\"\"Return only positive numbers in the list.\n >>> get_positive([-1, 2, -4, 5, 6])\n [2, 5, 6]\n >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n [5, 3, 2, 3, 9, 123, 1]\n \"\"\"\nfunction get_positive(l::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = get_positive;\n\t@test(candidate([-1, -2, 4, 5, 6]) == [4, 5, 6])\n\t@test(candidate([5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]) == [5, 3, 2, 3, 3, 9, 123, 1])\n\t@test(candidate([-1, -2]) == Vector{Int64}([]))\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "jl", - "prompt": "\"\"\" Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n >>> string_sequence(0)\n \"0\"\n >>> string_sequence(5)\n \"0 1 2 3 4 5\"\n \"\"\"\nfunction string_sequence(n::Int64)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = string_sequence;\n\t@test(candidate(0) == \"0\")\n\t@test(candidate(3) == \"0 1 2 3\")\n\t@test(candidate(10) == \"0 1 2 3 4 5 6 7 8 9 10\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "jl", - "prompt": "\"\"\"\n Given a positive integer n, you have to make a pile of n levels of stones.\n The first level has n stones.\n The number of stones in the next level is:\n - the next odd number if n is odd.\n - the next even number if n is even.\n Return the number of stones in each level in a list, where element at index\n i represents the number of stones in the level (i+1).\n\n Examples:\n >>> make_a_pile(3)\n [3, 5, 7]\n \"\"\"\nfunction make_a_pile(n::Int64)::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = make_a_pile;\n\t@test(candidate(3) == [3, 5, 7])\n\t@test(candidate(4) == [4, 6, 8, 10])\n\t@test(candidate(5) == [5, 7, 9, 11, 13])\n\t@test(candidate(6) == [6, 8, 10, 12, 14, 16])\n\t@test(candidate(8) == [8, 10, 12, 14, 16, 18, 20, 22])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "jl", - "prompt": "\"\"\"Task\n 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\n then check if the result string is palindrome.\n A string is called palindrome if it reads the same backward as forward.\n You should return a tuple containing the result string and True/False for the check.\n Example\n >>> reverse_delete(\"abcde\", \"ae\")\n (\"bcd\", false)\n >>> reverse_delete(\"abcdef\", \"b\")\n (\"acdef\", false)\n >>> reverse_delete(\"abcdedcba\", \"ab\")\n (\"cdedc\", true)\n \"\"\"\nfunction reverse_delete(s::String, c::String)::Tuple{String, Bool} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = reverse_delete;\n\t@test(candidate(\"abcde\", \"ae\") == (\"bcd\", false))\n\t@test(candidate(\"abcdef\", \"b\") == (\"acdef\", false))\n\t@test(candidate(\"abcdedcba\", \"ab\") == (\"cdedc\", true))\n\t@test(candidate(\"dwik\", \"w\") == (\"dik\", false))\n\t@test(candidate(\"a\", \"a\") == (\"\", true))\n\t@test(candidate(\"abcdedcba\", \"\") == (\"abcdedcba\", true))\n\t@test(candidate(\"abcdedcba\", \"v\") == (\"abcdedcba\", true))\n\t@test(candidate(\"vabba\", \"v\") == (\"abba\", true))\n\t@test(candidate(\"mamma\", \"mia\") == (\"\", true))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "jl", - "prompt": "\"\"\" For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n >>> flip_case(\"Hello\")\n \"hELLO\"\n \"\"\"\nfunction flip_case(string::String)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = flip_case;\n\t@test(candidate(\"\") == \"\")\n\t@test(candidate(\"Hello!\") == \"hELLO!\")\n\t@test(candidate(\"These violent delights have violent ends\") == \"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "jl", - "prompt": "\"\"\"You are given a string s.\n if s[i] is a letter, reverse its case from lower to upper or vise versa, \n otherwise keep it as it is.\n If the string contains no letters, reverse the string.\n The function should return the resulted string.\n Examples\n >>> solve(\"1234\")\n \"4321\"\n >>> solve(\"ab\")\n \"AB\"\n >>> solve(\"#a@C\")\n \"#A@c\"\n \"\"\"\nfunction solve(s::String)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = solve;\n\t@test(candidate(\"AsDf\") == \"aSdF\")\n\t@test(candidate(\"1234\") == \"4321\")\n\t@test(candidate(\"ab\") == \"AB\")\n\t@test(candidate(\"#a@C\") == \"#A@c\")\n\t@test(candidate(\"#AsdfW^45\") == \"#aSDFw^45\")\n\t@test(candidate(\"#6@2\") == \"2@6#\")\n\t@test(candidate(\"#$a^D\") == \"#$A^d\")\n\t@test(candidate(\"#ccc\") == \"#CCC\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "jl", - "prompt": "\"\"\" Filter an input list of strings only for ones that start with a given prefix.\n >>> filter_by_prefix([], \"a\")\n []\n >>> filter_by_prefix([\"abc\", \"bcd\", \"cde\", \"array\"], \"a\")\n [\"abc\", \"array\"]\n \"\"\"\nfunction filter_by_prefix(strings::Vector{String}, prefix::String)::Vector{String} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = filter_by_prefix;\n\t@test(candidate(Vector{String}([]), \"john\") == Vector{String}([]))\n\t@test(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\") == [\"xxx\", \"xxxAAA\", \"xxx\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "jl", - "prompt": "\"\"\"This function takes two positive numbers x and y and returns the\n biggest even integer number that is in the range [x, y] inclusive. If \n there's no such number, then the function should return -1.\n\n For example:\n >>> choose_num(12, 15)\n 14\n >>> choose_num(13, 12)\n -1\n \"\"\"\nfunction choose_num(x::Int64, y::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = choose_num;\n\t@test(candidate(12, 15) == 14)\n\t@test(candidate(13, 12) == -1)\n\t@test(candidate(33, 12354) == 12354)\n\t@test(candidate(5234, 5233) == -1)\n\t@test(candidate(6, 29) == 28)\n\t@test(candidate(27, 10) == -1)\n\t@test(candidate(7, 7) == -1)\n\t@test(candidate(546, 546) == 546)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "jl", - "prompt": "\"\"\"\n You are given a string representing a sentence,\n the sentence contains some words separated by a space,\n and you have to return a string that contains the words from the original sentence,\n whose lengths are prime numbers,\n the order of the words in the new string should be the same as the original one.\n\n Example 1:\n >>> words_in_sentence(\"This is a test\")\n \"is\"\n\n Example 2:\n >>> words_in_sentence(\"lets go for swimming\")\n \"go for\"\n \n Constraints:\n * 1 <= len(sentence) <= 100\n * sentence contains only letters\n \"\"\"\nfunction words_in_sentence(sentence::String)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = words_in_sentence;\n\t@test(candidate(\"This is a test\") == \"is\")\n\t@test(candidate(\"lets go for swimming\") == \"go for\")\n\t@test(candidate(\"there is no place available here\") == \"there is no place\")\n\t@test(candidate(\"Hi I am Hussein\") == \"Hi am Hussein\")\n\t@test(candidate(\"go for it\") == \"go for it\")\n\t@test(candidate(\"here\") == \"\")\n\t@test(candidate(\"here is\") == \"is\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "jl", - "prompt": "\"\"\" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n >>> intersperse([], 4)\n []\n >>> intersperse([1, 2, 3], 4)\n [1, 4, 2, 4, 3]\n \"\"\"\nfunction intersperse(numbers::Vector{Int64}, delimeter::Int64)::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = intersperse;\n\t@test(candidate(Vector{Int64}([]), 7) == Vector{Int64}([]))\n\t@test(candidate([5, 6, 3, 2], 8) == [5, 8, 6, 8, 3, 8, 2])\n\t@test(candidate([2, 2, 2], 2) == [2, 2, 2, 2, 2])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "jl", - "prompt": "\"\"\"Your task is to write a function that returns true if a number x is a simple\n power of n and false in other cases.\n x is a simple power of n if n**int=x\n For example:\n >>> is_simple_power(1, 4)\n true\n >>> is_simple_power(2, 2)\n true\n >>> is_simple_power(8, 2)\n true\n >>> is_simple_power(3, 2)\n false\n >>> is_simple_power(3, 1)\n false\n >>> is_simple_power(5, 3)\n false\n \"\"\"\nfunction is_simple_power(x::Int64, n::Int64)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_simple_power;\n\t@test(candidate(16, 2) == true)\n\t@test(candidate(143214, 16) == false)\n\t@test(candidate(4, 2) == true)\n\t@test(candidate(9, 3) == true)\n\t@test(candidate(16, 4) == true)\n\t@test(candidate(24, 2) == false)\n\t@test(candidate(128, 4) == false)\n\t@test(candidate(12, 6) == false)\n\t@test(candidate(1, 1) == true)\n\t@test(candidate(1, 12) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "jl", - "prompt": "\"\"\"Write a function that returns true if the given number is the multiplication of 3 prime numbers\n and false otherwise.\n Knowing that (a) is less then 100. \n Example:\n >>> is_multiply_prime(30)\n true\n 30 = 2 * 3 * 5\n \"\"\"\nfunction is_multiply_prime(a::Int64)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_multiply_prime;\n\t@test(candidate(5) == false)\n\t@test(candidate(30) == true)\n\t@test(candidate(8) == true)\n\t@test(candidate(10) == false)\n\t@test(candidate(125) == true)\n\t@test(candidate(105) == true)\n\t@test(candidate(126) == false)\n\t@test(candidate(729) == false)\n\t@test(candidate(891) == false)\n\t@test(candidate(1001) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "jl", - "prompt": "\"\"\"\n Given the lengths of the three sides of a triangle. Return True if the three\n sides form a right-angled triangle, False otherwise.\n A right-angled triangle is a triangle in which one angle is right angle or \n 90 degree.\n Example:\n >>> right_angle_triangle(3, 4, 5)\n true\n >>> right_angle_triangle(1, 2, 3)\n false\n \"\"\"\nfunction right_angle_triangle(a::Int64, b::Int64, c::Int64)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = right_angle_triangle;\n\t@test(candidate(3, 4, 5) == true)\n\t@test(candidate(1, 2, 3) == false)\n\t@test(candidate(10, 6, 8) == true)\n\t@test(candidate(2, 2, 2) == false)\n\t@test(candidate(7, 24, 25) == true)\n\t@test(candidate(10, 5, 7) == false)\n\t@test(candidate(5, 12, 13) == true)\n\t@test(candidate(15, 8, 17) == true)\n\t@test(candidate(48, 55, 73) == true)\n\t@test(candidate(1, 1, 1) == false)\n\t@test(candidate(2, 2, 10) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "jl", - "prompt": "\"\"\"\n Create a function that takes 3 numbers.\n Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n Returns false in any other cases.\n \n Examples\n >>> any_int(5, 2, 7)\n true\n \n >>> any_int(3, 2, 2)\n false\n\n >>> any_int(3, -2, 1)\n true\n \n >>> any_int(3.6, -2.2, 2)\n false\n \n\n \n \"\"\"\nfunction any_int(x::Float64, y::Float64, z::Float64)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = any_int;\n\t@test(candidate(2, 3, 1) == true)\n\t@test(candidate(2.5, 2, 3) == false)\n\t@test(candidate(1.5, 5, 3.5) == false)\n\t@test(candidate(2, 6, 2) == false)\n\t@test(candidate(4, 2, 2) == true)\n\t@test(candidate(2.2, 2.2, 2.2) == false)\n\t@test(candidate(-4, 6, 2) == true)\n\t@test(candidate(2, 1, 1) == true)\n\t@test(candidate(3, 4, 7) == true)\n\t@test(candidate(3.0, 4, 7) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "jl", - "prompt": "\"\"\"This function takes a list l and returns a list l' such that\n l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n to the values of the corresponding indicies of l, but sorted.\n >>> sort_third([1, 2, 3])\n [1, 2, 3]\n >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n [2, 6, 3, 4, 8, 9, 5]\n \"\"\"\nfunction sort_third(l::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = sort_third;\n\t@test(candidate([5, 6, 3, 4, 8, 9, 2]) == [2, 6, 3, 4, 8, 9, 5])\n\t@test(candidate([5, 8, 3, 4, 6, 9, 2]) == [2, 8, 3, 4, 6, 9, 5])\n\t@test(candidate([5, 6, 9, 4, 8, 3, 2]) == [2, 6, 9, 4, 8, 3, 5])\n\t@test(candidate([5, 6, 3, 4, 8, 9, 2, 1]) == [2, 6, 3, 4, 8, 9, 5, 1])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_53_add", - "language": "jl", - "prompt": "\"\"\"Add two numbers x and y\n >>> add(2, 3)\n 5\n >>> add(5, 7)\n 12\n \"\"\"\nfunction add(x::Int64, y::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = add;\n\t@test(candidate(0, 1) == 1)\n\t@test(candidate(1, 0) == 1)\n\t@test(candidate(2, 3) == 5)\n\t@test(candidate(5, 7) == 12)\n\t@test(candidate(7, 5) == 12)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_69_search", - "language": "jl", - "prompt": "\"\"\"\n You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n zero, and has a frequency greater than or equal to the value of the integer itself. \n The frequency of an integer is the number of times it appears in the list.\n If no such a value exist, return -1.\n Examples:\n >>> search([4, 1, 2, 2, 3, 1])\n 2\n >>> search([1, 2, 2, 3, 3, 3, 4, 4, 4])\n 3\n >>> search([5, 5, 4, 4, 4])\n -1\n \"\"\"\nfunction search(lst::Vector{Int64})::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = search;\n\t@test(candidate([5, 5, 5, 5, 1]) == 1)\n\t@test(candidate([4, 1, 4, 1, 4, 4]) == 4)\n\t@test(candidate([3, 3]) == -1)\n\t@test(candidate([8, 8, 8, 8, 8, 8, 8, 8]) == 8)\n\t@test(candidate([2, 3, 3, 2, 2]) == 2)\n\t@test(candidate([2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]) == 1)\n\t@test(candidate([3, 2, 8, 2]) == 2)\n\t@test(candidate([6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]) == 1)\n\t@test(candidate([8, 8, 3, 6, 5, 6, 4]) == -1)\n\t@test(candidate([6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]) == 1)\n\t@test(candidate([1, 9, 10, 1, 3]) == 1)\n\t@test(candidate([6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]) == 5)\n\t@test(candidate([1]) == 1)\n\t@test(candidate([8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]) == 4)\n\t@test(candidate([2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]) == 2)\n\t@test(candidate([1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]) == 1)\n\t@test(candidate([9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]) == 4)\n\t@test(candidate([2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]) == 4)\n\t@test(candidate([9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]) == 2)\n\t@test(candidate([5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]) == -1)\n\t@test(candidate([10]) == -1)\n\t@test(candidate([9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]) == 2)\n\t@test(candidate([5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]) == 1)\n\t@test(candidate([7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]) == 1)\n\t@test(candidate([3, 10, 10, 9, 2]) == -1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "jl", - "prompt": "\"\"\"Write a function that takes a string and returns True if the string\n length is a prime number or False otherwise\n Examples\n >>> prime_length(\"Hello\")\n true\n >>> prime_length(\"abcdcba\")\n true\n >>> prime_length(\"kittens\")\n true\n >>> prime_length(\"orange\")\n false\n \"\"\"\nfunction prime_length(string::String)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = prime_length;\n\t@test(candidate(\"Hello\") == true)\n\t@test(candidate(\"abcdcba\") == true)\n\t@test(candidate(\"kittens\") == true)\n\t@test(candidate(\"orange\") == false)\n\t@test(candidate(\"wow\") == true)\n\t@test(candidate(\"world\") == true)\n\t@test(candidate(\"MadaM\") == true)\n\t@test(candidate(\"Wow\") == true)\n\t@test(candidate(\"\") == false)\n\t@test(candidate(\"HI\") == true)\n\t@test(candidate(\"go\") == true)\n\t@test(candidate(\"gogo\") == false)\n\t@test(candidate(\"aaaaaaaaaaaaaaa\") == false)\n\t@test(candidate(\"Madam\") == true)\n\t@test(candidate(\"M\") == false)\n\t@test(candidate(\"0\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_58_common", - "language": "jl", - "prompt": "\"\"\"Return sorted unique common elements for two lists.\n >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n [1, 5, 653]\n >>> common([5, 3, 2, 8], [3, 2])\n [2, 3]\n\n \"\"\"\nfunction common(l1::Vector{Int64}, l2::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = common;\n\t@test(candidate([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]) == [1, 5, 653])\n\t@test(candidate([5, 3, 2, 8], [3, 2]) == [2, 3])\n\t@test(candidate([4, 3, 2, 8], [3, 2, 4]) == [2, 3, 4])\n\t@test(candidate([4, 3, 2, 8], Vector{Int64}([])) == Vector{Int64}([]))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "jl", - "prompt": "\"\"\"The Brazilian factorial is defined as:\n brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n where n > 0\n\n For example:\n >>> special_factorial(4)\n 288\n\n The function will receive an integer as input and should return the special\n factorial of this integer.\n \"\"\"\nfunction special_factorial(n::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = special_factorial;\n\t@test(candidate(4) == 288)\n\t@test(candidate(5) == 34560)\n\t@test(candidate(7) == 125411328000)\n\t@test(candidate(1) == 1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "jl", - "prompt": "\"\"\"In this problem, you will implement a function that takes two lists of numbers,\n and determines whether it is possible to perform an exchange of elements\n between them to make lst1 a list of only even numbers.\n There is no limit on the number of exchanged elements between lst1 and lst2.\n If it is possible to exchange elements between the lst1 and lst2 to make\n all the elements of lst1 to be even, return \"YES\".\n Otherwise, return \"NO\".\n For example:\n >>> exchange([1, 2, 3, 4], [1, 2, 3, 4])\n \"YES\"\n >>> exchange([1, 2, 3, 4], [1, 5, 3, 4])\n \"NO\"\n It is assumed that the input lists will be non-empty.\n \"\"\"\nfunction exchange(lst1::Vector{Int64}, lst2::Vector{Int64})::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = exchange;\n\t@test(candidate([1, 2, 3, 4], [1, 2, 3, 4]) == \"YES\")\n\t@test(candidate([1, 2, 3, 4], [1, 5, 3, 4]) == \"NO\")\n\t@test(candidate([1, 2, 3, 4], [2, 1, 4, 3]) == \"YES\")\n\t@test(candidate([5, 7, 3], [2, 6, 4]) == \"YES\")\n\t@test(candidate([5, 7, 3], [2, 6, 3]) == \"NO\")\n\t@test(candidate([3, 2, 6, 1, 8, 9], [3, 5, 5, 1, 1, 1]) == \"NO\")\n\t@test(candidate([100, 200], [200, 200]) == \"YES\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "jl", - "prompt": "\"\"\"\n Given a non-empty array of integers arr and an integer k, return\n the sum of the elements with at most two digits from the first k elements of arr.\n\n Example:\n\n >>> add_elements([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4)\n 24\n\n Constraints:\n 1. 1 <= len(arr) <= 100\n 2. 1 <= k <= len(arr)\n \"\"\"\nfunction add_elements(arr::Vector{Int64}, k::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = add_elements;\n\t@test(candidate([1, -2, -3, 41, 57, 76, 87, 88, 99], 3) == -4)\n\t@test(candidate([111, 121, 3, 4000, 5, 6], 2) == 0)\n\t@test(candidate([11, 21, 3, 90, 5, 6, 7, 8, 9], 4) == 125)\n\t@test(candidate([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4) == 24)\n\t@test(candidate([1], 1) == 1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "jl", - "prompt": "\"\"\"A simple program which should return the value of x if n is \n a prime number and should return the value of y otherwise.\n\n Examples:\n >>> x_or_y(7, 34, 12)\n 34\n >>> x_or_y(15, 8, 5)\n 5\n \n \"\"\"\nfunction x_or_y(n::Int64, x::Int64, y::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = x_or_y;\n\t@test(candidate(7, 34, 12) == 34)\n\t@test(candidate(15, 8, 5) == 5)\n\t@test(candidate(3, 33, 5212) == 33)\n\t@test(candidate(1259, 3, 52) == 3)\n\t@test(candidate(7919, -1, 12) == -1)\n\t@test(candidate(3609, 1245, 583) == 583)\n\t@test(candidate(91, 56, 129) == 129)\n\t@test(candidate(6, 34, 1234) == 1234)\n\t@test(candidate(1, 2, 0) == 0)\n\t@test(candidate(2, 2, 0) == 2)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "jl", - "prompt": "\"\"\"Given length of a side and high return area for a triangle.\n >>> triangle_area(5, 3)\n 7.5\n \"\"\"\nfunction triangle_area(a::Int64, h::Int64)::Float64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = triangle_area;\n\t@test(candidate(5, 3) == 7.5)\n\t@test(candidate(2, 2) == 2.0)\n\t@test(candidate(10, 8) == 40.0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "jl", - "prompt": "\"\"\"Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n the last couple centuries. However, what people don't know is Tribonacci sequence.\n Tribonacci sequence is defined by the recurrence:\n tri(1) = 3\n tri(n) = 1 + n / 2, if n is even.\n tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n For example:\n tri(2) = 1 + (2 / 2) = 2\n tri(4) = 3\n tri(3) = tri(2) + tri(1) + tri(4)\n = 2 + 3 + 3 = 8 \n You are given a non-negative integer number n, you have to a return a list of the \n first n + 1 numbers of the Tribonacci sequence.\n Examples:\n >>> tri(3)\n [1, 3, 2, 8]\n \"\"\"\nfunction tri(n::Int64)::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = tri;\n\t@test(candidate(3) == [1, 3, 2, 8])\n\t@test(candidate(4) == [1, 3, 2, 8, 3])\n\t@test(candidate(5) == [1, 3, 2, 8, 3, 15])\n\t@test(candidate(6) == [1, 3, 2, 8, 3, 15, 4])\n\t@test(candidate(7) == [1, 3, 2, 8, 3, 15, 4, 24])\n\t@test(candidate(8) == [1, 3, 2, 8, 3, 15, 4, 24, 5])\n\t@test(candidate(9) == [1, 3, 2, 8, 3, 15, 4, 24, 5, 35])\n\t@test(candidate(20) == [1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11])\n\t@test(candidate(0) == [1])\n\t@test(candidate(1) == [1, 3])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "jl", - "prompt": "\"\"\"\n You are given a list of two strings, both strings consist of open\n parentheses '(' or close parentheses ')' only.\n Your job is to check if it is possible to concatenate the two strings in\n some order, that the resulting string will be good.\n A string S is considered to be good if and only if all parentheses in S\n are balanced. For example: the string '(())()' is good, while the string\n '())' is not.\n Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n\n Examples:\n >>> match_parens([\"()(\", \")\"])\n \"Yes\"\n >>> match_parens([\")\", \")\"])\n \"No\"\n \"\"\"\nfunction match_parens(lst::Vector{String})::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = match_parens;\n\t@test(candidate([\"()(\", \")\"]) == \"Yes\")\n\t@test(candidate([\")\", \")\"]) == \"No\")\n\t@test(candidate([\"(()(())\", \"())())\"]) == \"No\")\n\t@test(candidate([\")())\", \"(()()(\"]) == \"Yes\")\n\t@test(candidate([\"(())))\", \"(()())((\"]) == \"Yes\")\n\t@test(candidate([\"()\", \"())\"]) == \"No\")\n\t@test(candidate([\"(()(\", \"()))()\"]) == \"Yes\")\n\t@test(candidate([\"((((\", \"((())\"]) == \"No\")\n\t@test(candidate([\")(()\", \"(()(\"]) == \"No\")\n\t@test(candidate([\")(\", \")(\"]) == \"No\")\n\t@test(candidate([\"(\", \")\"]) == \"Yes\")\n\t@test(candidate([\")\", \"(\"]) == \"Yes\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "jl", - "prompt": "\"\"\" From a list of integers, remove all elements that occur more than once.\n Keep order of elements left the same as in the input.\n >>> remove_duplicates([1, 2, 3, 2, 4])\n [1, 3, 4]\n \"\"\"\nfunction remove_duplicates(numbers::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = remove_duplicates;\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([1, 2, 3, 4]) == [1, 2, 3, 4])\n\t@test(candidate([1, 2, 3, 2, 4, 3, 5]) == [1, 4, 5])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "jl", - "prompt": "\"\"\" Return a greatest common divisor of two integers a and b\n >>> greatest_common_divisor(3, 5)\n 1\n >>> greatest_common_divisor(25, 15)\n 5\n \"\"\"\nfunction greatest_common_divisor(a::Int64, b::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = greatest_common_divisor;\n\t@test(candidate(3, 7) == 1)\n\t@test(candidate(10, 15) == 5)\n\t@test(candidate(49, 14) == 7)\n\t@test(candidate(144, 60) == 12)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "jl", - "prompt": "\"\"\"\n Checks if given string is a palindrome\n >>> is_palindrome(\"\")\n true\n >>> is_palindrome(\"aba\")\n true\n >>> is_palindrome(\"aaaaa\")\n true\n >>> is_palindrome(\"zbcd\")\n false\n \"\"\"\nfunction is_palindrome(text::String)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_palindrome;\n\t@test(candidate(\"\") == true)\n\t@test(candidate(\"aba\") == true)\n\t@test(candidate(\"aaaaa\") == true)\n\t@test(candidate(\"zbcd\") == false)\n\t@test(candidate(\"xywyx\") == true)\n\t@test(candidate(\"xywyz\") == false)\n\t@test(candidate(\"xywzx\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "jl", - "prompt": "\"\"\" xs represent coefficients of a polynomial.\n xs[0] + xs[1] * x + xs[2] * x^2 + ....\n Return derivative of this polynomial in the same form.\n >>> derivative([3, 1, 2, 4, 5])\n [1, 4, 12, 20]\n >>> derivative([1, 2, 3])\n [2, 6]\n \"\"\"\nfunction derivative(xs::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = derivative;\n\t@test(candidate([3, 1, 2, 4, 5]) == [1, 4, 12, 20])\n\t@test(candidate([1, 2, 3]) == [2, 6])\n\t@test(candidate([3, 2, 1]) == [2, 2])\n\t@test(candidate([3, 2, 1, 0, 4]) == [2, 2, 0, 16])\n\t@test(candidate([1]) == Vector{Int64}([]))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "jl", - "prompt": "\"\"\"\n In this task, you will be given a string that represents a number of apples and oranges \n that are distributed in a basket of fruit this basket contains \n apples, oranges, and mango fruits. Given the string that represents the total number of \n the oranges and apples and an integer that represent the total number of the fruits \n in the basket return the number of the mango fruits in the basket.\n for examble:\n >>> fruit_distribution(\"5 apples and 6 oranges\", 19)\n 8\n >>> fruit_distribution(\"0 apples and 1 oranges\", 3)\n 2\n >>> fruit_distribution(\"2 apples and 3 oranges\", 100)\n 95\n >>> fruit_distribution(\"100 apples and 1 oranges\", 120)\n 19\n \"\"\"\nfunction fruit_distribution(s::String, n::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = fruit_distribution;\n\t@test(candidate(\"5 apples and 6 oranges\", 19) == 8)\n\t@test(candidate(\"5 apples and 6 oranges\", 21) == 10)\n\t@test(candidate(\"0 apples and 1 oranges\", 3) == 2)\n\t@test(candidate(\"1 apples and 0 oranges\", 3) == 2)\n\t@test(candidate(\"2 apples and 3 oranges\", 100) == 95)\n\t@test(candidate(\"2 apples and 3 oranges\", 5) == 0)\n\t@test(candidate(\"1 apples and 100 oranges\", 120) == 19)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "jl", - "prompt": "\"\"\"\n Write a function that takes an integer a and returns True \n if this ingeger is a cube of some integer number.\n Note: you may assume the input is always valid.\n Examples:\n >>> iscube(1)\n true\n >>> iscube(2)\n false\n >>> iscube(-1)\n true\n >>> iscube(64)\n true\n >>> iscube(0)\n true\n >>> iscube(180)\n false\n \"\"\"\nfunction iscube(a::Int64)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = iscube;\n\t@test(candidate(1) == true)\n\t@test(candidate(2) == false)\n\t@test(candidate(-1) == true)\n\t@test(candidate(64) == true)\n\t@test(candidate(180) == false)\n\t@test(candidate(1000) == true)\n\t@test(candidate(0) == true)\n\t@test(candidate(1729) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "jl", - "prompt": "\"\"\"\n In this Kata, you have to sort an array of non-negative integers according to\n number of ones in their binary representation in ascending order.\n For similar number of ones, sort based on decimal value.\n\n It must be implemented like this:\n >>> sort_array([1, 5, 2, 3, 4])\n [1, 2, 3, 4, 5]\n >>> sort_array([-2, -3, -4, -5, -6])\n [-6, -5, -4, -3, -2]\n >>> sort_array([1, 0, 2, 3, 4])\n [0, 1, 2, 3, 4]\n \"\"\"\nfunction sort_array(arr::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = sort_array;\n\t@test(candidate([1, 5, 2, 3, 4]) == [1, 2, 4, 3, 5])\n\t@test(candidate([-2, -3, -4, -5, -6]) == [-4, -2, -6, -5, -3])\n\t@test(candidate([1, 0, 2, 3, 4]) == [0, 1, 2, 4, 3])\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]) == [2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77])\n\t@test(candidate([3, 6, 44, 12, 32, 5]) == [32, 3, 5, 6, 12, 44])\n\t@test(candidate([2, 4, 8, 16, 32]) == [2, 4, 8, 16, 32])\n\t@test(candidate([2, 4, 8, 16, 32]) == [2, 4, 8, 16, 32])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "jl", - "prompt": "\"\"\"Given a list of strings, where each string consists of only digits, return a list.\n Each element i of the output should be \"the number of odd elements in the\n string i of the input.\" where all the i's should be replaced by the number\n of odd digits in the i'th string of the input.\n\n >>> odd_count([\"1234567\"])\n [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n >>> odd_count([\"3\", \"11111111\"])\n [\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\n \"\"\"\nfunction odd_count(lst::Vector{String})::Vector{String} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = odd_count;\n\t@test(candidate([\"1234567\"]) == [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"])\n\t@test(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.\"])\n\t@test(candidate([\"271\", \"137\", \"314\"]) == [\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "jl", - "prompt": "\"\"\" brackets is a string of \"(\" and \")\".\n return True if every opening bracket has a corresponding closing bracket.\n\n >>> correct_bracketing(\"(\")\n false\n >>> correct_bracketing(\"()\")\n true\n >>> correct_bracketing(\"(()())\")\n true\n >>> correct_bracketing(\")(()\")\n false\n \"\"\"\nfunction correct_bracketing(brackets::String)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = correct_bracketing;\n\t@test(candidate(\"()\") == true)\n\t@test(candidate(\"(()())\") == true)\n\t@test(candidate(\"()()(()())()\") == true)\n\t@test(candidate(\"()()((()()())())(()()(()))\") == true)\n\t@test(candidate(\"((()())))\") == false)\n\t@test(candidate(\")(()\") == false)\n\t@test(candidate(\"(\") == false)\n\t@test(candidate(\"((((\") == false)\n\t@test(candidate(\")\") == false)\n\t@test(candidate(\"(()\") == false)\n\t@test(candidate(\"()()(()())())(()\") == false)\n\t@test(candidate(\"()()(()())()))()\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "jl", - "prompt": "\"\"\"Task\n Write a function that takes a string as input and returns the sum of the upper characters only'\n ASCII codes.\n\n Examples:\n >>> digitSum(\"\")\n 0\n >>> digitSum(\"abAB\")\n 131\n >>> digitSum(\"abcCd\")\n 67\n >>> digitSum(\"helloE\")\n 69\n >>> digitSum(\"woArBld\")\n 131\n >>> digitSum(\"aAaaaXa\")\n 153\n \"\"\"\nfunction digitSum(s::String)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = digitSum;\n\t@test(candidate(\"\") == 0)\n\t@test(candidate(\"abAB\") == 131)\n\t@test(candidate(\"abcCd\") == 67)\n\t@test(candidate(\"helloE\") == 69)\n\t@test(candidate(\"woArBld\") == 131)\n\t@test(candidate(\"aAaaaXa\") == 153)\n\t@test(candidate(\" How are yOu?\") == 151)\n\t@test(candidate(\"You arE Very Smart\") == 327)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "jl", - "prompt": "\"\"\"Write a function that accepts a list of strings as a parameter,\n deletes the strings that have odd lengths from it,\n and returns the resulted list with a sorted order,\n The list is always a list of strings and never an array of numbers,\n and it may contain duplicates.\n The order of the list should be ascending by length of each word, and you\n should return the list sorted by that rule.\n If two words have the same length, sort the list alphabetically.\n The function should return a list of strings in sorted order.\n You may assume that all words will have the same length.\n For example:\n >>> list_sort([\"aa\", \"a\", \"aaa\"])\n [\"aa\"]\n >>> list_sort([\"ab\", \"a\", \"aaa\", \"cd\"])\n [\"ab\", \"cd\"]\n \"\"\"\nfunction sorted_list_sum(lst::Vector{String})::Vector{String} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = sorted_list_sum;\n\t@test(candidate([\"aa\", \"a\", \"aaa\"]) == [\"aa\"])\n\t@test(candidate([\"school\", \"AI\", \"asdf\", \"b\"]) == [\"AI\", \"asdf\", \"school\"])\n\t@test(candidate([\"d\", \"b\", \"c\", \"a\"]) == Vector{String}([]))\n\t@test(candidate([\"d\", \"dcba\", \"abcd\", \"a\"]) == [\"abcd\", \"dcba\"])\n\t@test(candidate([\"AI\", \"ai\", \"au\"]) == [\"AI\", \"ai\", \"au\"])\n\t@test(candidate([\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"]) == Vector{String}([]))\n\t@test(candidate([\"aaaa\", \"bbbb\", \"dd\", \"cc\"]) == [\"cc\", \"dd\", \"aaaa\", \"bbbb\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "jl", - "prompt": "\"\"\"\n You are given an array arr of integers and you need to return\n sum of magnitudes of integers multiplied by product of all signs\n of each number in the array, represented by 1, -1 or 0.\n Note: return None for empty arr.\n\n Example:\n >>> prod_signs([1, 2, 2, -4])\n 9\n >>> prod_signs([0, 1])\n 0\n >>> prod_signs([])\n nothing\n \"\"\"\nfunction prod_signs(arr::Vector{Int64})::Union{Int64, Nothing} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = prod_signs;\n\t@test(candidate([1, 2, 2, -4]) == -9)\n\t@test(candidate([0, 1]) == 0)\n\t@test(candidate([1, 1, 1, 2, 3, -1, 1]) == -10)\n\t@test(candidate(Vector{Int64}([])) == nothing)\n\t@test(candidate([2, 4, 1, 2, -1, -1, 9]) == 20)\n\t@test(candidate([-1, 1, -1, 1]) == 4)\n\t@test(candidate([-1, 1, 1, 1]) == -4)\n\t@test(candidate([-1, 1, 1, 0]) == 0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "jl", - "prompt": "\"\"\"Return list with elements incremented by 1.\n >>> incr_list([1, 2, 3])\n [2, 3, 4]\n >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123])\n [6, 4, 6, 3, 4, 4, 10, 1, 124]\n \"\"\"\nfunction incr_list(l::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = incr_list;\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([3, 2, 1]) == [4, 3, 2])\n\t@test(candidate([5, 2, 5, 2, 3, 3, 9, 0, 123]) == [6, 3, 6, 3, 4, 4, 10, 1, 124])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "jl", - "prompt": "\"\"\" From a given list of integers, generate a list of rolling maximum element found until given moment\n in the sequence.\n >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n [1, 2, 3, 3, 3, 4, 4]\n \"\"\"\nfunction rolling_max(numbers::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = rolling_max;\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([1, 2, 3, 4]) == [1, 2, 3, 4])\n\t@test(candidate([4, 3, 2, 1]) == [4, 4, 4, 4])\n\t@test(candidate([3, 2, 3, 100, 3]) == [3, 3, 3, 100, 100])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "jl", - "prompt": "\"\"\" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n separate those group into separate strings and return the list of those.\n Separate groups are balanced (each open brace is properly closed) and not nested within each other\n Ignore any spaces in the input string.\n >>> separate_paren_groups(\"( ) (( )) (( )( ))\")\n [\"()\", \"(())\", \"(()())\"]\n \"\"\"\nfunction separate_paren_groups(paren_string::String)::Vector{String} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = separate_paren_groups;\n\t@test(candidate(\"(()()) ((())) () ((())()())\") == [\"(()())\", \"((()))\", \"()\", \"((())()())\"])\n\t@test(candidate(\"() (()) ((())) (((())))\") == [\"()\", \"(())\", \"((()))\", \"(((())))\"])\n\t@test(candidate(\"(()(())((())))\") == [\"(()(())((())))\"])\n\t@test(candidate(\"( ) (( )) (( )( ))\") == [\"()\", \"(())\", \"(()())\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "jl", - "prompt": "\"\"\"\n You will be given a string of words separated by commas or spaces. Your task is\n to split the string into words and return an array of the words.\n \n For example:\n >>> words_string(\"Hi, my name is John\")\n [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n >>> words_string(\"One, two, three, four, five, six\")\n [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\n \"\"\"\nfunction words_string(s::String)::Vector{String} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = words_string;\n\t@test(candidate(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"])\n\t@test(candidate(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"])\n\t@test(candidate(\"Hi, my name\") == [\"Hi\", \"my\", \"name\"])\n\t@test(candidate(\"One,, two, three, four, five, six,\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"])\n\t@test(candidate(\"\") == Vector{String}([]))\n\t@test(candidate(\"ahmed , gamal\") == [\"ahmed\", \"gamal\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "jl", - "prompt": "\"\"\" Filter given list of any python values only for integers\n >>> filter_integers([\"a\", 3.14, 5])\n [5]\n >>> filter_integers([1, 2, 3, \"abc\", Dict(), []])\n [1, 2, 3]\n \"\"\"\nfunction filter_integers(values::Vector{Any})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = filter_integers;\n\t@test(candidate(Vector{Any}([])) == Vector{Int64}([]))\n\t@test(candidate([4, Dict(), [], 23.2, 9, \"adasd\"]) == [4, 9])\n\t@test(candidate([3, \"c\", 3, 3, \"a\", \"b\"]) == [3, 3, 3])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "jl", - "prompt": "\"\"\"This function takes a list l and returns a list l' such that\n l' is identical to l in the odd indicies, while its values at the even indicies are equal\n to the values of the even indicies of l, but sorted.\n >>> sort_even([1, 2, 3])\n [1, 2, 3]\n >>> sort_even([5, 6, 3, 4])\n [3, 6, 5, 4]\n \"\"\"\nfunction sort_even(l::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = sort_even;\n\t@test(candidate([1, 2, 3]) == [1, 2, 3])\n\t@test(candidate([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]) == [-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123])\n\t@test(candidate([5, 8, -12, 4, 23, 2, 3, 11, 12, -10]) == [-12, 8, 3, 4, 5, 2, 12, 11, 23, -10])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "jl", - "prompt": "\"\"\"I think we all remember that feeling when the result of some long-awaited\n event is finally known. The feelings and thoughts you have at that moment are\n definitely worth noting down and comparing.\n Your task is to determine if a person correctly guessed the results of a number of matches.\n You are given two arrays of scores and guesses of equal length, where each index shows a match. \n Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n the value is 0, and if not, the value is the absolute difference between the guess and the score.\n \n \n example:\n\n >>> compare([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2])\n [0, 0, 0, 0, 3, 3]\n >>> compare([0, 5, 0, 0, 0, 4], [4, 1, 1, 0, 0, -2])\n [4, 4, 1, 0, 0, 6]\n \"\"\"\nfunction compare(game::Vector{Int64}, guess::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = compare;\n\t@test(candidate([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2]) == [0, 0, 0, 0, 3, 3])\n\t@test(candidate([0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]) == [0, 0, 0, 0, 0, 0])\n\t@test(candidate([1, 2, 3], [-1, -2, -3]) == [2, 4, 6])\n\t@test(candidate([1, 2, 3, 5], [-1, 2, 3, 4]) == [2, 0, 0, 1])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "jl", - "prompt": "\"\"\"\n Given a positive integer n, return a tuple that has the number of even and odd\n integer palindromes that fall within the range(1, n), inclusive.\n\n Example 1:\n\n >>> even_odd_palindrome(3)\n (1, 2)\n Explanation:\n Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n\n Example 2:\n\n >>> even_odd_palindrome(12)\n (4, 6)\n Explanation:\n Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n\n Note:\n 1. 1 <= n <= 10^3\n 2. returned tuple has the number of even and odd integer palindromes respectively.\n \"\"\"\nfunction even_odd_palindrome(n::Int64)::Tuple{Int64, Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = even_odd_palindrome;\n\t@test(candidate(123) == (8, 13))\n\t@test(candidate(12) == (4, 6))\n\t@test(candidate(3) == (1, 2))\n\t@test(candidate(63) == (6, 8))\n\t@test(candidate(25) == (5, 6))\n\t@test(candidate(19) == (4, 6))\n\t@test(candidate(9) == (4, 5))\n\t@test(candidate(1) == (0, 1))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "jl", - "prompt": "\"\"\"The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fib4(0) -> 0\n fib4(1) -> 0\n fib4(2) -> 2\n fib4(3) -> 0\n fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n >>> fib4(5)\n 4\n >>> fib4(6)\n 8\n >>> fib4(7)\n 14\n \"\"\"\nfunction fib4(n::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = fib4;\n\t@test(candidate(5) == 4)\n\t@test(candidate(8) == 28)\n\t@test(candidate(10) == 104)\n\t@test(candidate(12) == 386)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "jl", - "prompt": "\"\"\"\n Given two positive integers a and b, return the even digits between a\n and b, in ascending order.\n\n For example:\n >>> generate_integers(2, 8)\n [2, 4, 6, 8]\n >>> generate_integers(8, 2)\n [2, 4, 6, 8]\n >>> generate_integers(10, 14)\n []\n \"\"\"\nfunction generate_integers(a::Int64, b::Int64)::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = generate_integers;\n\t@test(candidate(2, 10) == [2, 4, 6, 8])\n\t@test(candidate(10, 2) == [2, 4, 6, 8])\n\t@test(candidate(132, 2) == [2, 4, 6, 8])\n\t@test(candidate(17, 89) == Vector{Int64}([]))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "jl", - "prompt": "\"\"\" For a given list of input numbers, calculate Mean Absolute Deviation\n around the mean of this dataset.\n Mean Absolute Deviation is the average absolute difference between each\n element and a centerpoint (mean in this case):\n MAD = average | x - x_mean |\n >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n 1.0\n \"\"\"\nfunction mean_absolute_deviation(numbers::Vector{Float64})::Float64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = mean_absolute_deviation;\n\t@test(candidate([1.0, 2.0]) == 0.5)\n\t@test(candidate([1.0, 2.0, 3.0, 4.0]) == 1.0)\n\t@test(candidate([1.0, 2.0, 3.0, 4.0, 5.0]) == 1.2)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "jl", - "prompt": "\"\"\"Create a function encrypt that takes a string as an argument and\n returns a string encrypted with the alphabet being rotated. \n The alphabet should be rotated in a manner such that the letters \n shift down by two multiplied to two places.\n For example:\n >>> encrypt(\"hi\")\n \"lm\"\n >>> encrypt(\"asdfghjkl\")\n \"ewhjklnop\"\n >>> encrypt(\"gf\")\n \"kj\"\n >>> encrypt(\"et\")\n \"ix\"\n \"\"\"\nfunction encrypt(s::String)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = encrypt;\n\t@test(candidate(\"hi\") == \"lm\")\n\t@test(candidate(\"asdfghjkl\") == \"ewhjklnop\")\n\t@test(candidate(\"gf\") == \"kj\")\n\t@test(candidate(\"et\") == \"ix\")\n\t@test(candidate(\"faewfawefaewg\") == \"jeiajeaijeiak\")\n\t@test(candidate(\"hellomyfriend\") == \"lippsqcjvmirh\")\n\t@test(candidate(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\") == \"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\")\n\t@test(candidate(\"a\") == \"e\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "jl", - "prompt": "\"\"\"\n Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n\n The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n as follows: start with any positive integer n. Then each term is obtained from the \n previous term as follows: if the previous term is even, the next term is one half of \n the previous term. If the previous term is odd, the next term is 3 times the previous\n term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n\n Note: \n 1. Collatz(1) is [1].\n 2. returned list sorted in increasing order.\n\n For example:\n get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n >>> get_odd_collatz(5)\n [1, 5]\n \"\"\"\nfunction get_odd_collatz(n::Int64)::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = get_odd_collatz;\n\t@test(candidate(14) == [1, 5, 7, 11, 13, 17])\n\t@test(candidate(5) == [1, 5])\n\t@test(candidate(12) == [1, 3, 5])\n\t@test(candidate(1) == [1])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "jl", - "prompt": "\"\"\" Find how many times a given substring can be found in the original string. Count overlaping cases.\n >>> how_many_times(\"\", \"a\")\n 0\n >>> how_many_times(\"aaa\", \"a\")\n 3\n >>> how_many_times(\"aaaa\", \"aa\")\n 3\n \"\"\"\nfunction how_many_times(string::String, substring::String)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = how_many_times;\n\t@test(candidate(\"\", \"x\") == 0)\n\t@test(candidate(\"xyxyxyx\", \"x\") == 4)\n\t@test(candidate(\"cacacacac\", \"cac\") == 4)\n\t@test(candidate(\"john doe\", \"john\") == 1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "jl", - "prompt": "\"\"\"We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n numbers in the array will be randomly ordered. Your task is to determine if\n it is possible to get an array sorted in non-decreasing order by performing \n the following operation on the given array:\n You are allowed to perform right shift operation any number of times.\n \n One right shift operation means shifting all elements of the array by one\n position in the right direction. The last element of the array will be moved to\n the starting position in the array i.e. 0th index. \n\n If it is possible to obtain the sorted array by performing the above operation\n then return True else return False.\n If the given array is empty then return True.\n\n Note: The given list is guaranteed to have unique elements.\n\n For Example:\n \n >>> move_one_ball([3, 4, 5, 1, 2])\n true\n Explanation: By performin 2 right shift operations, non-decreasing order can\n be achieved for the given array.\n >>> move_one_ball([3, 5, 4, 1, 2])\n false\n Explanation:It is not possible to get non-decreasing order for the given\n array by performing any number of right shift operations.\n \n \"\"\"\nfunction move_one_ball(arr::Vector{Int64})::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = move_one_ball;\n\t@test(candidate([3, 4, 5, 1, 2]) == true)\n\t@test(candidate([3, 5, 10, 1, 2]) == true)\n\t@test(candidate([4, 3, 1, 2]) == false)\n\t@test(candidate([3, 5, 4, 1, 2]) == false)\n\t@test(candidate(Vector{Int64}([])) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "jl", - "prompt": "\"\"\"\n Write a function which sorts the given list of integers\n in ascending order according to the sum of their digits.\n Note: if there are several items with similar sum of their digits,\n order them based on their index in original list.\n\n For example:\n >>> order_by_points([1, 11, -1, -11, -12])\n [-1, -11, 1, -12, 11]\n >>> order_by_points([])\n []\n \"\"\"\nfunction order_by_points(nums::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = order_by_points;\n\t@test(candidate([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11])\n\t@test(candidate([1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]) == [0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457])\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([1, -11, -32, 43, 54, -98, 2, -3]) == [-3, -32, -98, -11, 1, 2, 43, 54])\n\t@test(candidate([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) == [1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9])\n\t@test(candidate([0, 6, 6, -76, -21, 23, 4]) == [-76, -21, 0, 4, 23, 6, 6])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "jl", - "prompt": "\"\"\" Return list of prime factors of given integer in the order from smallest to largest.\n Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n Input number should be equal to the product of all factors\n >>> factorize(8)\n [2, 2, 2]\n >>> factorize(25)\n [5, 5]\n >>> factorize(70)\n [2, 5, 7]\n \"\"\"\nfunction factorize(n::Int64)::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = factorize;\n\t@test(candidate(2) == [2])\n\t@test(candidate(4) == [2, 2])\n\t@test(candidate(8) == [2, 2, 2])\n\t@test(candidate(57) == [3, 19])\n\t@test(candidate(3249) == [3, 3, 19, 19])\n\t@test(candidate(185193) == [3, 3, 3, 19, 19, 19])\n\t@test(candidate(20577) == [3, 19, 19, 19])\n\t@test(candidate(18) == [2, 3, 3])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "jl", - "prompt": "\"\"\"Return True if all numbers in the list l are below threshold t.\n >>> below_threshold([1, 2, 4, 10], 100)\n true\n >>> below_threshold([1, 20, 4, 10], 5)\n false\n \"\"\"\nfunction below_threshold(l::Vector{Int64}, t::Int64)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = below_threshold;\n\t@test(candidate([1, 2, 4, 10], 100) == true)\n\t@test(candidate([1, 20, 4, 10], 5) == false)\n\t@test(candidate([1, 20, 4, 10], 21) == true)\n\t@test(candidate([1, 20, 4, 10], 22) == true)\n\t@test(candidate([1, 8, 4, 10], 11) == true)\n\t@test(candidate([1, 8, 4, 10], 10) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "jl", - "prompt": "\"\"\"You are given two positive integers n and m, and your task is to compute the\n average of the integers from n through m (including n and m). \n Round the answer to the nearest integer and convert that to binary.\n If n is greater than m, return -1.\n Example:\n >>> rounded_avg(1, 5)\n \"0b11\"\n >>> rounded_avg(7, 5)\n -1\n >>> rounded_avg(10, 20)\n \"0b1111\"\n >>> rounded_avg(20, 33)\n \"0b11010\"\n \"\"\"\nfunction rounded_avg(n::Int64, m::Int64)::Union{String, Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = rounded_avg;\n\t@test(candidate(1, 5) == \"0b11\")\n\t@test(candidate(7, 13) == \"0b1010\")\n\t@test(candidate(964, 977) == \"0b1111001010\")\n\t@test(candidate(996, 997) == \"0b1111100100\")\n\t@test(candidate(560, 851) == \"0b1011000010\")\n\t@test(candidate(185, 546) == \"0b101101110\")\n\t@test(candidate(362, 496) == \"0b110101101\")\n\t@test(candidate(350, 902) == \"0b1001110010\")\n\t@test(candidate(197, 233) == \"0b11010111\")\n\t@test(candidate(7, 5) == -1)\n\t@test(candidate(5, 1) == -1)\n\t@test(candidate(5, 5) == \"0b101\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "jl", - "prompt": "\"\"\" Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n For each of the group, output the deepest level of nesting of parentheses.\n E.g. (()()) has maximum two levels of nesting while ((())) has three.\n\n >>> parse_nested_parens(\"(()()) ((())) () ((())()())\")\n [2, 3, 1, 3]\n \"\"\"\nfunction parse_nested_parens(paren_string::String)::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = parse_nested_parens;\n\t@test(candidate(\"(()()) ((())) () ((())()())\") == [2, 3, 1, 3])\n\t@test(candidate(\"() (()) ((())) (((())))\") == [1, 2, 3, 4])\n\t@test(candidate(\"(()(())((())))\") == [4])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "jl", - "prompt": "\"\"\"Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n \n\n Examples\n >>> solution([5, 8, 7, 1])\n 12\n >>> solution([3, 3, 3, 3, 3])\n 9\n >>> solution([30, 13, 24, 321])\n 0\n \"\"\"\nfunction solution(lst::Vector{Int64})::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = solution;\n\t@test(candidate([5, 8, 7, 1]) == 12)\n\t@test(candidate([3, 3, 3, 3, 3]) == 9)\n\t@test(candidate([30, 13, 24, 321]) == 0)\n\t@test(candidate([5, 9]) == 5)\n\t@test(candidate([2, 4, 8]) == 0)\n\t@test(candidate([30, 13, 23, 32]) == 23)\n\t@test(candidate([3, 13, 2, 9]) == 3)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "jl", - "prompt": "\"\"\"\n You are given a positive integer n. You have to create an integer array a of length n.\n For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n and a[i] + a[j] + a[k] is a multiple of 3.\n\n Example :\n >>> get_max_triples(5)\n 1\n Explanation: \n a = [1, 3, 7, 13, 21]\n The only valid triple is (1, 7, 13).\n \"\"\"\nfunction get_max_triples(n::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = get_max_triples;\n\t@test(candidate(5) == 1)\n\t@test(candidate(6) == 4)\n\t@test(candidate(10) == 36)\n\t@test(candidate(100) == 53361)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "jl", - "prompt": "\"\"\"\n You are given a list of integers.\n Write a function next_smallest() that returns the 2nd smallest element of the list.\n Return None if there is no such element.\n >>> next_smallest([1, 2, 3, 4, 5])\n 2\n >>> next_smallest([5, 1, 4, 3, 2])\n 2\n >>> next_smallest([])\n nothing\n >>> next_smallest([1, 1])\n nothing\n \"\"\"\nfunction next_smallest(lst::Vector{Int64})::Union{Int64, Nothing} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = next_smallest;\n\t@test(candidate([1, 2, 3, 4, 5]) == 2)\n\t@test(candidate([5, 1, 4, 3, 2]) == 2)\n\t@test(candidate(Vector{Int64}([])) == nothing)\n\t@test(candidate([1, 1]) == nothing)\n\t@test(candidate([1, 1, 1, 1, 0]) == 1)\n\t@test(candidate([1, 1]) == nothing)\n\t@test(candidate([-35, 34, 12, -45]) == -35)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "jl", - "prompt": "\"\"\" Input is a space-delimited string of numberals from 'zero' to 'nine'.\n Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n Return the string with numbers sorted from smallest to largest\n >>> sort_numbers(\"three one five\")\n \"one three five\"\n \"\"\"\nfunction sort_numbers(numbers::String)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = sort_numbers;\n\t@test(candidate(\"\") == \"\")\n\t@test(candidate(\"three\") == \"three\")\n\t@test(candidate(\"three five nine\") == \"three five nine\")\n\t@test(candidate(\"five zero four seven nine eight\") == \"zero four five seven eight nine\")\n\t@test(candidate(\"six five four three two one zero\") == \"zero one two three four five six\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "jl", - "prompt": "\"\"\"You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n >>> cycpattern_check(\"abcd\", \"abd\")\n false\n >>> cycpattern_check(\"hello\", \"ell\")\n true\n >>> cycpattern_check(\"whassup\", \"psus\")\n false\n >>> cycpattern_check(\"abab\", \"baa\")\n true\n >>> cycpattern_check(\"efef\", \"eeff\")\n false\n >>> cycpattern_check(\"himenss\", \"simen\")\n true\n\n \"\"\"\nfunction cycpattern_check(a::String, b::String)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = cycpattern_check;\n\t@test(candidate(\"xyzw\", \"xyw\") == false)\n\t@test(candidate(\"yello\", \"ell\") == true)\n\t@test(candidate(\"whattup\", \"ptut\") == false)\n\t@test(candidate(\"efef\", \"fee\") == true)\n\t@test(candidate(\"abab\", \"aabb\") == false)\n\t@test(candidate(\"winemtt\", \"tinem\") == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "jl", - "prompt": "\"\"\"You will be given a number in decimal form and your task is to convert it to\n binary format. The function should return a string, with each character representing a binary\n number. Each character in the string will be '0' or '1'.\n\n There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n The extra characters are there to help with the format.\n\n Examples:\n >>> decimal_to_binary(15)\n \"db1111db\"\n >>> decimal_to_binary(32)\n \"db100000db\"\n \"\"\"\nfunction decimal_to_binary(decimal::Int64)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = decimal_to_binary;\n\t@test(candidate(0) == \"db0db\")\n\t@test(candidate(32) == \"db100000db\")\n\t@test(candidate(103) == \"db1100111db\")\n\t@test(candidate(15) == \"db1111db\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "jl", - "prompt": "\"\"\" Filter an input list of strings only for ones that contain given substring\n >>> filter_by_substring([], \"a\")\n []\n >>> filter_by_substring([\"abc\", \"bacd\", \"cde\", \"array\"], \"a\")\n [\"abc\", \"bacd\", \"array\"]\n \"\"\"\nfunction filter_by_substring(strings::Vector{String}, substring::String)::Vector{String} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = filter_by_substring;\n\t@test(candidate(Vector{String}([]), \"john\") == Vector{String}([]))\n\t@test(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\") == [\"xxx\", \"xxxAAA\", \"xxx\"])\n\t@test(candidate([\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xx\") == [\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"])\n\t@test(candidate([\"grunt\", \"trumpet\", \"prune\", \"gruesome\"], \"run\") == [\"grunt\", \"prune\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "jl", - "prompt": "\"\"\"Given an integer. return a tuple that has the number of even and odd digits respectively.\n\n Example:\n >>> even_odd_count(-12)\n (1, 1)\n >>> even_odd_count(123)\n (1, 2)\n \"\"\"\nfunction even_odd_count(num::Int64)::Tuple{Int64, Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = even_odd_count;\n\t@test(candidate(7) == (0, 1))\n\t@test(candidate(-78) == (1, 1))\n\t@test(candidate(3452) == (2, 2))\n\t@test(candidate(346211) == (3, 3))\n\t@test(candidate(-345821) == (3, 3))\n\t@test(candidate(-2) == (1, 0))\n\t@test(candidate(-45347) == (2, 3))\n\t@test(candidate(0) == (1, 0))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "jl", - "prompt": "\"\"\"Write a function that accepts a list of strings.\n The list contains different words. Return the word with maximum number\n of unique characters. If multiple strings have maximum number of unique\n characters, return the one which comes first in lexicographical order.\n\n >>> find_max([\"name\", \"of\", \"string\"])\n \"string\"\n >>> find_max([\"name\", \"enam\", \"game\"])\n \"enam\"\n >>> find_max([\"aaaaaaa\", \"bb\", \"cc\"])\n \"aaaaaaa\"\n \"\"\"\nfunction find_max(words::Vector{String})::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = find_max;\n\t@test(candidate([\"name\", \"of\", \"string\"]) == \"string\")\n\t@test(candidate([\"name\", \"enam\", \"game\"]) == \"enam\")\n\t@test(candidate([\"aaaaaaa\", \"bb\", \"cc\"]) == \"aaaaaaa\")\n\t@test(candidate([\"abc\", \"cba\"]) == \"abc\")\n\t@test(candidate([\"play\", \"this\", \"game\", \"of\", \"footbott\"]) == \"footbott\")\n\t@test(candidate([\"we\", \"are\", \"gonna\", \"rock\"]) == \"gonna\")\n\t@test(candidate([\"we\", \"are\", \"a\", \"mad\", \"nation\"]) == \"nation\")\n\t@test(candidate([\"this\", \"is\", \"a\", \"prrk\"]) == \"this\")\n\t@test(candidate([\"b\"]) == \"b\")\n\t@test(candidate([\"play\", \"play\", \"play\"]) == \"play\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "jl", - "prompt": "\"\"\"\n Given a positive integer n, return the count of the numbers of n-digit\n positive integers that start or end with 1.\n \"\"\"\nfunction starts_one_ends(n::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = starts_one_ends;\n\t@test(candidate(1) == 1)\n\t@test(candidate(2) == 18)\n\t@test(candidate(3) == 180)\n\t@test(candidate(4) == 1800)\n\t@test(candidate(5) == 18000)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "jl", - "prompt": "\"\"\"\n Create a function that returns a tuple (a, b), where 'a' is\n the largest of negative integers, and 'b' is the smallest\n of positive integers in a list.\n If there is no negative or positive integers, return them as None.\n\n Examples:\n >>> largest_smallest_integers([2, 4, 1, 3, 5, 7])\n (nothing, 1)\n >>> largest_smallest_integers([])\n (nothing, nothing)\n >>> largest_smallest_integers([0])\n (nothing, nothing)\n \"\"\"\nfunction largest_smallest_integers(lst::Vector{Int64})::Tuple{Union{Int64, Nothing}, Union{Int64, Nothing}} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = largest_smallest_integers;\n\t@test(candidate([2, 4, 1, 3, 5, 7]) == (nothing, 1))\n\t@test(candidate([2, 4, 1, 3, 5, 7, 0]) == (nothing, 1))\n\t@test(candidate([1, 3, 2, 4, 5, 6, -2]) == (-2, 1))\n\t@test(candidate([4, 5, 3, 6, 2, 7, -7]) == (-7, 2))\n\t@test(candidate([7, 3, 8, 4, 9, 2, 5, -9]) == (-9, 2))\n\t@test(candidate(Vector{Int64}([])) == (nothing, nothing))\n\t@test(candidate([0]) == (nothing, nothing))\n\t@test(candidate([-1, -3, -5, -6]) == (-1, nothing))\n\t@test(candidate([-1, -3, -5, -6, 0]) == (-1, nothing))\n\t@test(candidate([-6, -4, -4, -3, 1]) == (-3, 1))\n\t@test(candidate([-6, -4, -4, -3, -100, 1]) == (-3, 1))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "jl", - "prompt": "\"\"\"\n \"Given an array representing a branch of a tree that has non-negative integer nodes\n your task is to pluck one of the nodes and return it.\n The plucked node should be the node with the smallest even value.\n If multiple nodes with the same smallest even value are found return the node that has smallest index.\n\n The plucked node should be returned in a list, [ smalest_value, its index ],\n If there are no even values or the given array is empty, return [].\n\n Example 1:\n >>> pluck([4, 2, 3])\n [2, 1]\n Explanation: 2 has the smallest even value, and 2 has the smallest index.\n\n Example 2:\n >>> pluck([1, 2, 3])\n [2, 1]\n Explanation: 2 has the smallest even value, and 2 has the smallest index.\n\n Example 3:\n >>> pluck([])\n []\n \n Example 4:\n >>> pluck([5, 0, 3, 0, 4, 2])\n [0, 1]\n Explanation: 0 is the smallest value, but there are two zeros,\n so we will choose the first zero, which has the smallest index.\n\n Constraints:\n * 1 <= nodes.length <= 10000\n * 0 <= node.value\n \"\"\"\nfunction pluck(arr::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = pluck;\n\t@test(candidate([4, 2, 3]) == [2, 1])\n\t@test(candidate([1, 2, 3]) == [2, 1])\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([5, 0, 3, 0, 4, 2]) == [0, 1])\n\t@test(candidate([1, 2, 3, 0, 5, 3]) == [0, 3])\n\t@test(candidate([5, 4, 8, 4, 8]) == [4, 1])\n\t@test(candidate([7, 6, 7, 1]) == [6, 1])\n\t@test(candidate([7, 9, 7, 1]) == Vector{Int64}([]))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "jl", - "prompt": "\"\"\"\n Write a function count_nums which takes an array of integers and returns\n the number of elements which has a sum of digits > 0.\n If a number is negative, then its first signed digit will be negative:\n e.g. -123 has signed digits -1, 2, and 3.\n >>> count_nums([])\n 0\n >>> count_nums([-1, 11, -11])\n 1\n >>> count_nums([1, 1, 2])\n 3\n \"\"\"\nfunction count_nums(arr::Vector{Int64})::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = count_nums;\n\t@test(candidate(Vector{Int64}([])) == 0)\n\t@test(candidate([-1, -2, 0]) == 0)\n\t@test(candidate([1, 1, 2, -2, 3, 4, 5]) == 6)\n\t@test(candidate([1, 6, 9, -6, 0, 1, 5]) == 5)\n\t@test(candidate([1, 100, 98, -7, 1, -1]) == 4)\n\t@test(candidate([12, 23, 34, -45, -56, 0]) == 5)\n\t@test(candidate([0, 1]) == 1)\n\t@test(candidate([1]) == 1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "jl", - "prompt": "\"\"\"\n Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n each cell of the grid contains a value. Every integer in the range [1, N * N]\n inclusive appears exactly once on the cells of the grid.\n\n You have to find the minimum path of length k in the grid. You can start\n from any cell, and in each step you can move to any of the neighbor cells,\n in other words, you can go to cells which share an edge with you current\n cell.\n Please note that a path of length k means visiting exactly k cells (not\n necessarily distinct).\n You CANNOT go off the grid.\n A path A (of length k) is considered less than a path B (of length k) if\n after making the ordered lists of the values on the cells that A and B go\n through (let's call them lst_A and lst_B), lst_A is lexicographically less\n than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n lst_A[j] = lst_B[j].\n It is guaranteed that the answer is unique.\n Return an ordered list of the values on the cells that the minimum path go through.\n\n Examples: \n >>> minPath([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3)\n [1, 2, 1]\n\n >>> minPath([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1)\n [1]\n \"\"\"\nfunction minPath(grid::Vector{Vector{Int64}}, k::Int64)::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = minPath;\n\t@test(candidate([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3) == [1, 2, 1])\n\t@test(candidate([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1) == [1])\n\t@test(candidate([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], 4) == [1, 2, 1, 2])\n\t@test(candidate([[6, 4, 13, 10], [5, 7, 12, 1], [3, 16, 11, 15], [8, 14, 9, 2]], 7) == [1, 10, 1, 10, 1, 10, 1])\n\t@test(candidate([[8, 14, 9, 2], [6, 4, 13, 15], [5, 7, 1, 12], [3, 10, 11, 16]], 5) == [1, 7, 1, 7, 1])\n\t@test(candidate([[11, 8, 7, 2], [5, 16, 14, 4], [9, 3, 15, 6], [12, 13, 10, 1]], 9) == [1, 6, 1, 6, 1, 6, 1, 6, 1])\n\t@test(candidate([[12, 13, 10, 1], [9, 3, 15, 6], [5, 16, 14, 4], [11, 8, 7, 2]], 12) == [1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6])\n\t@test(candidate([[2, 7, 4], [3, 1, 5], [6, 8, 9]], 8) == [1, 3, 1, 3, 1, 3, 1, 3])\n\t@test(candidate([[6, 1, 5], [3, 8, 9], [2, 7, 4]], 8) == [1, 5, 1, 5, 1, 5, 1, 5])\n\t@test(candidate([[1, 2], [3, 4]], 10) == [1, 2, 1, 2, 1, 2, 1, 2, 1, 2])\n\t@test(candidate([[1, 3], [3, 2]], 10) == [1, 3, 1, 3, 1, 3, 1, 3, 1, 3])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "jl", - "prompt": "\"\"\"\n Given list of integers, return list in strange order.\n Strange sorting, is when you start with the minimum value,\n then maximum of the remaining integers, then minimum and so on.\n\n Examples:\n >>> strange_sort_list([1, 2, 3, 4])\n [1, 4, 2, 3]\n >>> strange_sort_list([5, 5, 5, 5])\n [5, 5, 5, 5]\n >>> strange_sort_list([])\n []\n \"\"\"\nfunction strange_sort_list(lst::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = strange_sort_list;\n\t@test(candidate([1, 2, 3, 4]) == [1, 4, 2, 3])\n\t@test(candidate([5, 6, 7, 8, 9]) == [5, 9, 6, 8, 7])\n\t@test(candidate([1, 2, 3, 4, 5]) == [1, 5, 2, 4, 3])\n\t@test(candidate([5, 6, 7, 8, 9, 1]) == [1, 9, 5, 8, 6, 7])\n\t@test(candidate([5, 5, 5, 5]) == [5, 5, 5, 5])\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([1, 2, 3, 4, 5, 6, 7, 8]) == [1, 8, 2, 7, 3, 6, 4, 5])\n\t@test(candidate([0, 2, 2, 2, 5, 5, -5, -5]) == [-5, 5, -5, 5, 0, 2, 2, 2])\n\t@test(candidate([111111]) == [111111])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "jl", - "prompt": "\"\"\"\n Given a string 'text', return its md5 hash equivalent string.\n If 'text' is an empty string, return None.\n\n >>> string_to_md5(\"Hello world\")\n \"3e25960a79dbc69b674cd4ec67a72c62\"\n \"\"\"\nfunction string_to_md5(text::String)::Union{String, Nothing} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = string_to_md5;\n\t@test(candidate(\"Hello world\") == \"3e25960a79dbc69b674cd4ec67a72c62\")\n\t@test(candidate(\"\") == nothing)\n\t@test(candidate(\"A B C\") == \"0ef78513b0cb8cef12743f5aeb35f888\")\n\t@test(candidate(\"password\") == \"5f4dcc3b5aa765d61d8327deb882cf99\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "jl", - "prompt": "\"\"\"You are given a word. Your task is to find the closest vowel that stands between \n two consonants from the right side of the word (case sensitive).\n \n Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n find any vowel met the above condition. \n\n You may assume that the given string contains English letter only.\n\n Example:\n >>> get_closest_vowel(\"yogurt\")\n \"u\"\n >>> get_closest_vowel(\"FULL\")\n \"U\"\n >>> get_closest_vowel(\"quick\")\n \"\"\n >>> get_closest_vowel(\"ab\")\n \"\"\n \"\"\"\nfunction get_closest_vowel(word::String)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = get_closest_vowel;\n\t@test(candidate(\"yogurt\") == \"u\")\n\t@test(candidate(\"full\") == \"u\")\n\t@test(candidate(\"easy\") == \"\")\n\t@test(candidate(\"eAsy\") == \"\")\n\t@test(candidate(\"ali\") == \"\")\n\t@test(candidate(\"bad\") == \"a\")\n\t@test(candidate(\"most\") == \"o\")\n\t@test(candidate(\"ab\") == \"\")\n\t@test(candidate(\"ba\") == \"\")\n\t@test(candidate(\"quick\") == \"\")\n\t@test(candidate(\"anime\") == \"i\")\n\t@test(candidate(\"Asia\") == \"\")\n\t@test(candidate(\"Above\") == \"o\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "jl", - "prompt": "\"\"\"Change numerical base of input number x to base.\n return string representation after the conversion.\n base numbers are less than 10.\n >>> change_base(8, 3)\n \"22\"\n >>> change_base(8, 2)\n \"1000\"\n >>> change_base(7, 2)\n \"111\"\n \"\"\"\nfunction change_base(x::Int64, base::Int64)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = change_base;\n\t@test(candidate(8, 3) == \"22\")\n\t@test(candidate(9, 3) == \"100\")\n\t@test(candidate(234, 2) == \"11101010\")\n\t@test(candidate(16, 2) == \"10000\")\n\t@test(candidate(8, 2) == \"1000\")\n\t@test(candidate(7, 2) == \"111\")\n\t@test(candidate(2, 3) == \"2\")\n\t@test(candidate(3, 4) == \"3\")\n\t@test(candidate(4, 5) == \"4\")\n\t@test(candidate(5, 6) == \"5\")\n\t@test(candidate(6, 7) == \"6\")\n\t@test(candidate(7, 8) == \"7\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "jl", - "prompt": "\"\"\" Check if in given list of numbers, are any two numbers closer to each other than\n given threshold.\n >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n false\n >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n true\n \"\"\"\nfunction has_close_elements(numbers::Vector{Float64}, threshold::Float64)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = has_close_elements;\n\t@test(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3) == true)\n\t@test(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05) == false)\n\t@test(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.95) == true)\n\t@test(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.8) == false)\n\t@test(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1) == true)\n\t@test(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 1.0) == true)\n\t@test(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 0.5) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "jl", - "prompt": "\"\"\"\n Create a function that takes a string as input which contains only square brackets.\n The function should return True if and only if there is a valid subsequence of brackets \n where at least one bracket in the subsequence is nested.\n\n >>> is_nested(\"[[]]\")\n true\n >>> is_nested(\"[]]]]]]][[[[[]\")\n false\n >>> is_nested(\"[][]\")\n false\n >>> is_nested(\"[]\")\n false\n >>> is_nested(\"[[][]]\")\n true\n >>> is_nested(\"[[]][[\")\n true\n \"\"\"\nfunction is_nested(string::String)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_nested;\n\t@test(candidate(\"[[]]\") == true)\n\t@test(candidate(\"[]]]]]]][[[[[]\") == false)\n\t@test(candidate(\"[][]\") == false)\n\t@test(candidate(\"[]\") == false)\n\t@test(candidate(\"[[[[]]]]\") == true)\n\t@test(candidate(\"[]]]]]]]]]]\") == false)\n\t@test(candidate(\"[][][[]]\") == true)\n\t@test(candidate(\"[[]\") == false)\n\t@test(candidate(\"[]]\") == false)\n\t@test(candidate(\"[[]][[\") == true)\n\t@test(candidate(\"[[][]]\") == true)\n\t@test(candidate(\"\") == false)\n\t@test(candidate(\"[[[[[[[[\") == false)\n\t@test(candidate(\"]]]]]]]]\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "jl", - "prompt": "\"\"\" Concatenate list of strings into a single string\n >>> concatenate([])\n \"\"\n >>> concatenate([\"a\", \"b\", \"c\"])\n \"abc\"\n \"\"\"\nfunction concatenate(strings::Vector{String})::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = concatenate;\n\t@test(candidate(Vector{String}([])) == \"\")\n\t@test(candidate([\"x\", \"y\", \"z\"]) == \"xyz\")\n\t@test(candidate([\"x\", \"y\", \"z\", \"w\", \"k\"]) == \"xyzwk\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "jl", - "prompt": "\"\"\"\n prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n >>> prime_fib(1)\n 2\n >>> prime_fib(2)\n 3\n >>> prime_fib(3)\n 5\n >>> prime_fib(4)\n 13\n >>> prime_fib(5)\n 89\n \"\"\"\nfunction prime_fib(n::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = prime_fib;\n\t@test(candidate(1) == 2)\n\t@test(candidate(2) == 3)\n\t@test(candidate(3) == 5)\n\t@test(candidate(4) == 13)\n\t@test(candidate(5) == 89)\n\t@test(candidate(6) == 233)\n\t@test(candidate(7) == 1597)\n\t@test(candidate(8) == 28657)\n\t@test(candidate(9) == 514229)\n\t@test(candidate(10) == 433494437)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "jl", - "prompt": "\"\"\" From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n other and return them in order (smaller number, larger number).\n >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n (2.0, 2.2)\n >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n (2.0, 2.0)\n \"\"\"\nfunction find_closest_elements(numbers::Vector{Float64})::Tuple{Float64, Float64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = find_closest_elements;\n\t@test(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2]) == (3.9, 4.0))\n\t@test(candidate([1.0, 2.0, 5.9, 4.0, 5.0]) == (5.0, 5.9))\n\t@test(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]) == (2.0, 2.2))\n\t@test(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]) == (2.0, 2.0))\n\t@test(candidate([1.1, 2.2, 3.1, 4.1, 5.1]) == (2.2, 3.1))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "jl", - "prompt": "\"\"\"You have been tasked to write a function that receives \n a hexadecimal number as a string and counts the number of hexadecimal \n digits that are primes (prime number, or a prime, is a natural number \n greater than 1 that is not a product of two smaller natural numbers).\n Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n So you have to determine a number of the following digits: 2, 3, 5, 7, \n B (=decimal 11), D (=decimal 13).\n Note: you may assume the input is always correct or empty string, \n and symbols A,B,C,D,E,F are always uppercase.\n Examples:\n >>> hex_key(\"AB\")\n 1\n >>> hex_key(\"1077E\")\n 2\n >>> hex_key(\"ABED1A33\")\n 4\n >>> hex_key(\"123456789ABCDEF0\")\n 6\n >>> hex_key(\"2020\")\n 2\n \"\"\"\nfunction hex_key(num::String)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = hex_key;\n\t@test(candidate(\"AB\") == 1)\n\t@test(candidate(\"1077E\") == 2)\n\t@test(candidate(\"ABED1A33\") == 4)\n\t@test(candidate(\"2020\") == 2)\n\t@test(candidate(\"123456789ABCDEF0\") == 6)\n\t@test(candidate(\"112233445566778899AABBCCDDEEFF00\") == 12)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "jl", - "prompt": "\"\"\"Complete the function that takes two integers and returns \n the product of their unit digits.\n Assume the input is always valid.\n Examples:\n >>> multiply(148, 412)\n 16\n >>> multiply(19, 28)\n 72\n >>> multiply(2020, 1851)\n 0\n >>> multiply(14, -15)\n 20\n \"\"\"\nfunction multiply(a::Int64, b::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = multiply;\n\t@test(candidate(148, 412) == 16)\n\t@test(candidate(19, 28) == 72)\n\t@test(candidate(2020, 1851) == 0)\n\t@test(candidate(14, -15) == 20)\n\t@test(candidate(76, 67) == 42)\n\t@test(candidate(17, 27) == 49)\n\t@test(candidate(0, 1) == 0)\n\t@test(candidate(0, 0) == 0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "jl", - "prompt": "\"\"\" Given list of numbers (of at least two elements), apply a linear transform to that list,\n such that the smallest number will become 0 and the largest will become 1\n >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n [0.0, 0.25, 0.5, 0.75, 1.0]\n \"\"\"\nfunction rescale_to_unit(numbers::Vector{Float64})::Vector{Float64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = rescale_to_unit;\n\t@test(candidate([2.0, 49.9]) == [0.0, 1.0])\n\t@test(candidate([100.0, 49.9]) == [1.0, 0.0])\n\t@test(candidate([1.0, 2.0, 3.0, 4.0, 5.0]) == [0.0, 0.25, 0.5, 0.75, 1.0])\n\t@test(candidate([2.0, 1.0, 5.0, 3.0, 4.0]) == [0.25, 0.0, 1.0, 0.5, 0.75])\n\t@test(candidate([12.0, 11.0, 15.0, 13.0, 14.0]) == [0.25, 0.0, 1.0, 0.5, 0.75])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "jl", - "prompt": "\"\"\"Given a positive integer n, return the product of the odd digits.\n Return 0 if all digits are even.\n For example:\n >>> digits(1)\n 1\n >>> digits(4)\n 0\n >>> digits(235)\n 15\n \"\"\"\nfunction digits(n::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = digits;\n\t@test(candidate(5) == 5)\n\t@test(candidate(54) == 5)\n\t@test(candidate(120) == 1)\n\t@test(candidate(5014) == 5)\n\t@test(candidate(98765) == 315)\n\t@test(candidate(5576543) == 2625)\n\t@test(candidate(2468) == 0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "jl", - "prompt": "\"\"\"You will be given the name of a class (a string) and a list of extensions.\n The extensions are to be used to load additional classes to the class. The\n strength of the extension is as follows: Let CAP be the number of the uppercase\n letters in the extension's name, and let SM be the number of lowercase letters \n in the extension's name, the strength is given by the fraction CAP - SM. \n You should find the strongest extension and return a string in this \n format: ClassName.StrongestExtensionName.\n If there are two or more extensions with the same strength, you should\n choose the one that comes first in the list.\n For example, if you are given \"Slices\" as the class and a list of the\n extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n (its strength is -1).\n Example:\n >>> Strongest_Extension(\"my_class\", [\"AA\", \"Be\", \"CC\"])\n \"my_class.AA\"\n \"\"\"\nfunction Strongest_Extension(class_name::String, extensions::Vector{String})::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = Strongest_Extension;\n\t@test(candidate(\"Watashi\", [\"tEN\", \"niNE\", \"eIGHt8OKe\"]) == \"Watashi.eIGHt8OKe\")\n\t@test(candidate(\"Boku123\", [\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"]) == \"Boku123.YEs.WeCaNe\")\n\t@test(candidate(\"__YESIMHERE\", [\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"]) == \"__YESIMHERE.NuLl__\")\n\t@test(candidate(\"K\", [\"Ta\", \"TAR\", \"t234An\", \"cosSo\"]) == \"K.TAR\")\n\t@test(candidate(\"__HAHA\", [\"Tab\", \"123\", \"781345\", \"-_-\"]) == \"__HAHA.123\")\n\t@test(candidate(\"YameRore\", [\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"]) == \"YameRore.okIWILL123\")\n\t@test(candidate(\"finNNalLLly\", [\"Die\", \"NowW\", \"Wow\", \"WoW\"]) == \"finNNalLLly.WoW\")\n\t@test(candidate(\"_\", [\"Bb\", \"91245\"]) == \"_.Bb\")\n\t@test(candidate(\"Sp\", [\"671235\", \"Bb\"]) == \"Sp.671235\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "jl", - "prompt": "\"\"\"Given a string representing a space separated lowercase letters, return a dictionary\n of the letter with the most repetition and containing the corresponding count.\n If several letters have the same occurrence, return all of them.\n \n Example:\n >>> histogram(\"a b c\")\n Dict(\"a\" => 1, \"b\" => 1, \"c\" => 1)\n >>> histogram(\"a b b a\")\n Dict(\"a\" => 2, \"b\" => 2)\n >>> histogram(\"a b c a b\")\n Dict(\"a\" => 2, \"b\" => 2)\n >>> histogram(\"b b b b a\")\n Dict(\"b\" => 4)\n >>> histogram(\"\")\n Dict()\n\n \"\"\"\nfunction histogram(test::String)::Dict{String, Int64}> \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = histogram;\n\t@test(candidate(\"a b b a\") == Dict(\"a\" => 2, \"b\" => 2))\n\t@test(candidate(\"a b c a b\") == Dict(\"a\" => 2, \"b\" => 2))\n\t@test(candidate(\"a b c d g\") == Dict(\"a\" => 1, \"b\" => 1, \"c\" => 1, \"d\" => 1, \"g\" => 1))\n\t@test(candidate(\"r t g\") == Dict(\"r\" => 1, \"t\" => 1, \"g\" => 1))\n\t@test(candidate(\"b b b b a\") == Dict(\"b\" => 4))\n\t@test(candidate(\"r t g\") == Dict(\"r\" => 1, \"t\" => 1, \"g\" => 1))\n\t@test(candidate(\"\") == Dict())\n\t@test(candidate(\"a\") == Dict(\"a\" => 1))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "jl", - "prompt": "\"\"\"\n pairs_sum_to_zero takes a list of integers as an input.\n it returns True if there are two distinct elements in the list that\n sum to zero, and False otherwise.\n >>> pairs_sum_to_zero([1, 3, 5, 0])\n false\n >>> pairs_sum_to_zero([1, 3, -2, 1])\n false\n >>> pairs_sum_to_zero([1, 2, 3, 7])\n false\n >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7])\n true\n >>> pairs_sum_to_zero([1])\n false\n \"\"\"\nfunction pairs_sum_to_zero(l::Vector{Int64})::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = pairs_sum_to_zero;\n\t@test(candidate([1, 3, 5, 0]) == false)\n\t@test(candidate([1, 3, -2, 1]) == false)\n\t@test(candidate([1, 2, 3, 7]) == false)\n\t@test(candidate([2, 4, -5, 3, 5, 7]) == true)\n\t@test(candidate([1]) == false)\n\t@test(candidate([-3, 9, -1, 3, 2, 30]) == true)\n\t@test(candidate([-3, 9, -1, 3, 2, 31]) == true)\n\t@test(candidate([-3, 9, -1, 4, 2, 30]) == false)\n\t@test(candidate([-3, 9, -1, 4, 2, 31]) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "jl", - "prompt": "\"\"\"\n Write a function that accepts two lists of strings and returns the list that has \n total number of chars in the all strings of the list less than the other list.\n\n if the two lists have the same number of chars, return the first list.\n\n Examples\n >>> total_match([], [])\n []\n >>> total_match([\"hi\", \"admin\"], [\"hI\", \"Hi\"])\n [\"hI\", \"Hi\"]\n >>> total_match([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"])\n [\"hi\", \"admin\"]\n >>> total_match([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"])\n [\"hI\", \"hi\", \"hi\"]\n >>> total_match([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"])\n [\"4\"]\n \"\"\"\nfunction total_match(lst1::Vector{String}, lst2::Vector{String})::Vector{String} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = total_match;\n\t@test(candidate(Vector{String}([]), Vector{String}([])) == Vector{String}([]))\n\t@test(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\"]) == [\"hi\", \"hi\"])\n\t@test(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"]) == [\"hi\", \"admin\"])\n\t@test(candidate([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"]) == [\"4\"])\n\t@test(candidate([\"hi\", \"admin\"], [\"hI\", \"Hi\"]) == [\"hI\", \"Hi\"])\n\t@test(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"]) == [\"hI\", \"hi\", \"hi\"])\n\t@test(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hii\"]) == [\"hi\", \"admin\"])\n\t@test(candidate(Vector{String}([]), [\"this\"]) == Vector{String}([]))\n\t@test(candidate([\"this\"], Vector{String}([])) == Vector{String}([]))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "jl", - "prompt": "\"\"\"Circular shift the digits of the integer x, shift the digits right by shift\n and return the result as a string.\n If shift > number of digits, return digits reversed.\n >>> circular_shift(12, 1)\n \"21\"\n >>> circular_shift(12, 2)\n \"12\"\n \"\"\"\nfunction circular_shift(x::Int64, shift::Int64)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = circular_shift;\n\t@test(candidate(100, 2) == \"001\")\n\t@test(candidate(12, 2) == \"12\")\n\t@test(candidate(97, 8) == \"79\")\n\t@test(candidate(12, 1) == \"21\")\n\t@test(candidate(11, 101) == \"11\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "jl", - "prompt": "\"\"\"Return True is list elements are monotonically increasing or decreasing.\n >>> monotonic([1, 2, 4, 20])\n true\n >>> monotonic([1, 20, 4, 10])\n false\n >>> monotonic([4, 1, 0, -10])\n true\n \"\"\"\nfunction monotonic(l::Vector{Int64})::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = monotonic;\n\t@test(candidate([1, 2, 4, 10]) == true)\n\t@test(candidate([1, 2, 4, 20]) == true)\n\t@test(candidate([1, 20, 4, 10]) == false)\n\t@test(candidate([4, 1, 0, -10]) == true)\n\t@test(candidate([4, 1, 1, 0]) == true)\n\t@test(candidate([1, 2, 3, 2, 5, 60]) == false)\n\t@test(candidate([1, 2, 3, 4, 5, 60]) == true)\n\t@test(candidate([9, 9, 9, 9]) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "jl", - "prompt": "\"\"\"Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n Example\n >>> is_equal_to_sum_even(4)\n false\n >>> is_equal_to_sum_even(6)\n false\n >>> is_equal_to_sum_even(8)\n true\n \"\"\"\nfunction is_equal_to_sum_even(n::Int64)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_equal_to_sum_even;\n\t@test(candidate(4) == false)\n\t@test(candidate(6) == false)\n\t@test(candidate(8) == true)\n\t@test(candidate(10) == true)\n\t@test(candidate(11) == false)\n\t@test(candidate(12) == true)\n\t@test(candidate(13) == false)\n\t@test(candidate(16) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "jl", - "prompt": "\"\"\" Input to this function is a string representing musical notes in a special ASCII format.\n Your task is to parse this string and return list of integers corresponding to how many beats does each\n not last.\n\n Here is a legend:\n 'o' - whole note, lasts four beats\n 'o|' - half note, lasts two beats\n '.|' - quater note, lasts one beat\n\n >>> parse_music(\"o o| .| o| o| .| .| .| .| o o\")\n [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\n \"\"\"\nfunction parse_music(music_string::String)::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = parse_music;\n\t@test(candidate(\"\") == Vector{Int64}([]))\n\t@test(candidate(\"o o o o\") == [4, 4, 4, 4])\n\t@test(candidate(\".| .| .| .|\") == [1, 1, 1, 1])\n\t@test(candidate(\"o| o| .| .| o o o o\") == [2, 2, 1, 1, 4, 4, 4, 4])\n\t@test(candidate(\"o| .| o| .| o o| o o|\") == [2, 1, 2, 1, 4, 2, 4, 2])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "jl", - "prompt": "\"\"\"\"\n This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n \n Examples:\n >>> lst\n [1, 2, 3]\n >>> lst\n []\n >>> lst\n [-1, -5, 2, -1, -5]\n \"\"\"\nfunction sum_squares(lst::Vector{Int64})::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = sum_squares;\n\t@test(candidate([1, 2, 3]) == 6)\n\t@test(candidate([1, 4, 9]) == 14)\n\t@test(candidate(Vector{Int64}([])) == 0)\n\t@test(candidate([1, 1, 1, 1, 1, 1, 1, 1, 1]) == 9)\n\t@test(candidate([-1, -1, -1, -1, -1, -1, -1, -1, -1]) == -3)\n\t@test(candidate([0]) == 0)\n\t@test(candidate([-1, -5, 2, -1, -5]) == -126)\n\t@test(candidate([-56, -99, 1, 0, -2]) == 3030)\n\t@test(candidate([-1, 0, 0, 0, 0, 0, 0, 0, -1]) == 0)\n\t@test(candidate([-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37]) == -14196)\n\t@test(candidate([-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10]) == -1448)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "jl", - "prompt": "\"\"\"\n triples_sum_to_zero takes a list of integers as an input.\n it returns True if there are three distinct elements in the list that\n sum to zero, and False otherwise.\n\n >>> triples_sum_to_zero([1, 3, 5, 0])\n false\n >>> triples_sum_to_zero([1, 3, -2, 1])\n true\n >>> triples_sum_to_zero([1, 2, 3, 7])\n false\n >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n true\n >>> triples_sum_to_zero([1])\n false\n \"\"\"\nfunction triples_sum_to_zero(l::Vector{Int64})::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = triples_sum_to_zero;\n\t@test(candidate([1, 3, 5, 0]) == false)\n\t@test(candidate([1, 3, 5, -1]) == false)\n\t@test(candidate([1, 3, -2, 1]) == true)\n\t@test(candidate([1, 2, 3, 7]) == false)\n\t@test(candidate([1, 2, 5, 7]) == false)\n\t@test(candidate([2, 4, -5, 3, 9, 7]) == true)\n\t@test(candidate([1]) == false)\n\t@test(candidate([1, 3, 5, -100]) == false)\n\t@test(candidate([100, 3, 5, -100]) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "jl", - "prompt": "\"\"\" brackets is a string of \"<\" and \">\".\n return True if every opening bracket has a corresponding closing bracket.\n\n >>> correct_bracketing(\"<\")\n false\n >>> correct_bracketing(\"<>\")\n true\n >>> correct_bracketing(\"<<><>>\")\n true\n >>> correct_bracketing(\"><<>\")\n false\n \"\"\"\nfunction correct_bracketing(brackets::String)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = correct_bracketing;\n\t@test(candidate(\"<>\") == true)\n\t@test(candidate(\"<<><>>\") == true)\n\t@test(candidate(\"<><><<><>><>\") == true)\n\t@test(candidate(\"<><><<<><><>><>><<><><<>>>\") == true)\n\t@test(candidate(\"<<<><>>>>\") == false)\n\t@test(candidate(\"><<>\") == false)\n\t@test(candidate(\"<\") == false)\n\t@test(candidate(\"<<<<\") == false)\n\t@test(candidate(\">\") == false)\n\t@test(candidate(\"<<>\") == false)\n\t@test(candidate(\"<><><<><>><>><<>\") == false)\n\t@test(candidate(\"<><><<><>><>>><>\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "jl", - "prompt": "\"\"\"Write a function that takes an array of numbers as input and returns \n the number of elements in the array that are greater than 10 and both \n first and last digits of a number are odd (1, 3, 5, 7, 9).\n For example:\n >>> specialFilter([15, -73, 14, -15])\n 1\n >>> specialFilter([33, -2, -3, 45, 21, 109])\n 2\n \"\"\"\nfunction specialFilter(nums::Vector{Int64})::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = specialFilter;\n\t@test(candidate([5, -2, 1, -5]) == 0)\n\t@test(candidate([15, -73, 14, -15]) == 1)\n\t@test(candidate([33, -2, -3, 45, 21, 109]) == 2)\n\t@test(candidate([43, -12, 93, 125, 121, 109]) == 4)\n\t@test(candidate([71, -2, -33, 75, 21, 19]) == 3)\n\t@test(candidate([1]) == 0)\n\t@test(candidate(Vector{Int64}([])) == 0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "jl", - "prompt": "\"\"\"\n Given a dictionary, return True if all keys are strings in lower \n case or all keys are strings in upper case, else return False.\n The function should return False is the given dictionary is empty.\n Examples:\n >>> check_dict_case(Dict(\"a\" => \"apple\", \"b\" => \"banana\"))\n true\n >>> check_dict_case(Dict(\"a\" => \"apple\", \"A\" => \"banana\", \"B\" => \"banana\"))\n false\n >>> check_dict_case(Dict(\"a\" => \"apple\", 8 => \"banana\", \"a\" => \"apple\"))\n false\n >>> check_dict_case(Dict(\"Name\" => \"John\", \"Age\" => \"36\", \"City\" => \"Houston\"))\n false\n >>> check_dict_case(Dict(\"STATE\" => \"NC\", \"ZIP\" => \"12345\"))\n true\n \"\"\"\nfunction check_dict_case(dict::Dict{String, String}>)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = check_dict_case;\n\t@test(candidate(Dict(\"p\" => \"pineapple\", \"b\" => \"banana\")) == true)\n\t@test(candidate(Dict(\"p\" => \"pineapple\", \"A\" => \"banana\", \"B\" => \"banana\")) == false)\n\t@test(candidate(Dict(\"p\" => \"pineapple\", \"5\" => \"banana\", \"a\" => \"apple\")) == false)\n\t@test(candidate(Dict(\"Name\" => \"John\", \"Age\" => \"36\", \"City\" => \"Houston\")) == false)\n\t@test(candidate(Dict(\"STATE\" => \"NC\", \"ZIP\" => \"12345\")) == true)\n\t@test(candidate(Dict(\"fruit\" => \"Orange\", \"taste\" => \"Sweet\")) == true)\n\t@test(candidate(Dict()) == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "jl", - "prompt": "\"\"\"\n Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n Examples\n >>> split_words(\"Hello world!\")\n [\"Hello\", \"world!\"]\n >>> split_words(\"Hello,world!\")\n [\"Hello\", \"world!\"]\n >>> split_words(\"abcdef\")\n 3\n \"\"\"\nfunction split_words(txt::String)::Union{Vector{String}, Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = split_words;\n\t@test(candidate(\"Hello world!\") == [\"Hello\", \"world!\"])\n\t@test(candidate(\"Hello,world!\") == [\"Hello\", \"world!\"])\n\t@test(candidate(\"Hello world,!\") == [\"Hello\", \"world,!\"])\n\t@test(candidate(\"Hello,Hello,world !\") == [\"Hello,Hello,world\", \"!\"])\n\t@test(candidate(\"abcdef\") == 3)\n\t@test(candidate(\"aaabb\") == 2)\n\t@test(candidate(\"aaaBb\") == 1)\n\t@test(candidate(\"\") == 0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "jl", - "prompt": "\"\"\"The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fibfib(0) == 0\n fibfib(1) == 0\n fibfib(2) == 1\n fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n >>> fibfib(1)\n 0\n >>> fibfib(5)\n 4\n >>> fibfib(8)\n 24\n \"\"\"\nfunction fibfib(n::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = fibfib;\n\t@test(candidate(2) == 1)\n\t@test(candidate(1) == 0)\n\t@test(candidate(5) == 4)\n\t@test(candidate(8) == 24)\n\t@test(candidate(10) == 81)\n\t@test(candidate(12) == 274)\n\t@test(candidate(14) == 927)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "jl", - "prompt": "\"\"\"You are given a list of numbers.\n You need to return the sum of squared numbers in the given list,\n round each element in the list to the upper int(Ceiling) first.\n Examples:\n >>> lst([1.0, 2.0, 3.0])\n 14\n >>> lst([1.0, 4.0, 9.0])\n 98\n >>> lst([1.0, 3.0, 5.0, 7.0])\n 84\n >>> lst([1.4, 4.2, 0.0])\n 29\n >>> lst([-2.4, 1.0, 1.0])\n 6\n \n\n \"\"\"\nfunction sum_squares(lst::Vector{Float64})::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = sum_squares;\n\t@test(candidate([1.0, 2.0, 3.0]) == 14)\n\t@test(candidate([1.0, 2.0, 3.0]) == 14)\n\t@test(candidate([1.0, 3.0, 5.0, 7.0]) == 84)\n\t@test(candidate([1.4, 4.2, 0.0]) == 29)\n\t@test(candidate([-2.4, 1.0, 1.0]) == 6)\n\t@test(candidate([100.0, 1.0, 15.0, 2.0]) == 10230)\n\t@test(candidate([10000.0, 10000.0]) == 200000000)\n\t@test(candidate([-1.4, 4.6, 6.3]) == 75)\n\t@test(candidate([-1.4, 17.9, 18.9, 19.9]) == 1086)\n\t@test(candidate([0.0]) == 0)\n\t@test(candidate([-1.0]) == 1)\n\t@test(candidate([-1.0, 1.0, 0.0]) == 2)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_85_add", - "language": "jl", - "prompt": "\"\"\"Given a non-empty list of integers lst. add the even elements that are at odd indices..\n\n\n Examples:\n >>> add([4, 2, 6, 7])\n 2\n \"\"\"\nfunction add(lst::Vector{Int64})::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = add;\n\t@test(candidate([4, 88]) == 88)\n\t@test(candidate([4, 5, 6, 7, 2, 122]) == 122)\n\t@test(candidate([4, 0, 6, 7]) == 0)\n\t@test(candidate([4, 4, 6, 8]) == 12)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "jl", - "prompt": "\"\"\"Return sorted unique elements in a list\n >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123])\n [0, 2, 3, 5, 9, 123]\n \"\"\"\nfunction unique(l::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = unique;\n\t@test(candidate([5, 3, 5, 2, 3, 3, 9, 0, 123]) == [0, 2, 3, 5, 9, 123])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "jl", - "prompt": "\"\"\"\n Given a string text, replace all spaces in it with underscores, \n and if a string has more than 2 consecutive spaces, \n then replace all consecutive spaces with - \n \n >>> fix_spaces(\" Example\")\n \"Example\"\n >>> fix_spaces(\" Example 1\")\n \"Example_1\"\n >>> fix_spaces(\" Example 2\")\n \"_Example_2\"\n >>> fix_spaces(\" Example 3\")\n \"_Example-3\"\n \"\"\"\nfunction fix_spaces(text::String)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = fix_spaces;\n\t@test(candidate(\"Example\") == \"Example\")\n\t@test(candidate(\"Mudasir Hanif \") == \"Mudasir_Hanif_\")\n\t@test(candidate(\"Yellow Yellow Dirty Fellow\") == \"Yellow_Yellow__Dirty__Fellow\")\n\t@test(candidate(\"Exa mple\") == \"Exa-mple\")\n\t@test(candidate(\" Exa 1 2 2 mple\") == \"-Exa_1_2_2_mple\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "jl", - "prompt": "\"\"\"Return 2^n modulo p (be aware of numerics).\n >>> modp(3, 5)\n 3\n >>> modp(1101, 101)\n 2\n >>> modp(0, 101)\n 1\n >>> modp(3, 11)\n 8\n >>> modp(100, 101)\n 1\n \"\"\"\nfunction modp(n::Int64, p::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = modp;\n\t@test(candidate(3, 5) == 3)\n\t@test(candidate(1101, 101) == 2)\n\t@test(candidate(0, 101) == 1)\n\t@test(candidate(3, 11) == 8)\n\t@test(candidate(100, 101) == 1)\n\t@test(candidate(30, 5) == 4)\n\t@test(candidate(31, 5) == 3)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "jl", - "prompt": "\"\"\"You have to write a function which validates a given date string and\n returns True if the date is valid otherwise False.\n The date is valid if all of the following rules are satisfied:\n 1. The date string is not empty.\n 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n 3. The months should not be less than 1 or higher than 12.\n 4. The date should be in the format: mm-dd-yyyy\n\n >>> valid_date(\"03-11-2000\")\n true\n\n >>> valid_date(\"15-01-2012\")\n false\n\n >>> valid_date(\"04-0-2040\")\n false\n\n >>> valid_date(\"06-04-2020\")\n true\n\n >>> valid_date(\"06/04/2020\")\n false\n \"\"\"\nfunction valid_date(date::String)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = valid_date;\n\t@test(candidate(\"03-11-2000\") == true)\n\t@test(candidate(\"15-01-2012\") == false)\n\t@test(candidate(\"04-0-2040\") == false)\n\t@test(candidate(\"06-04-2020\") == true)\n\t@test(candidate(\"01-01-2007\") == true)\n\t@test(candidate(\"03-32-2011\") == false)\n\t@test(candidate(\"\") == false)\n\t@test(candidate(\"04-31-3000\") == false)\n\t@test(candidate(\"06-06-2005\") == true)\n\t@test(candidate(\"21-31-2000\") == false)\n\t@test(candidate(\"04-12-2003\") == true)\n\t@test(candidate(\"04122003\") == false)\n\t@test(candidate(\"20030412\") == false)\n\t@test(candidate(\"2003-04\") == false)\n\t@test(candidate(\"2003-04-12\") == false)\n\t@test(candidate(\"04-2003\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "jl", - "prompt": "\"\"\"\n Write a function that takes a string and returns an ordered version of it.\n Ordered version of string, is a string where all words (separated by space)\n are replaced by a new word where all the characters arranged in\n ascending order based on ascii value.\n Note: You should keep the order of words and blank spaces in the sentence.\n\n For example:\n >>> anti_shuffle(\"Hi\")\n \"Hi\"\n >>> anti_shuffle(\"hello\")\n \"ehllo\"\n >>> anti_shuffle(\"Hello World!!!\")\n \"Hello !!!Wdlor\"\n \"\"\"\nfunction anti_shuffle(s::String)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = anti_shuffle;\n\t@test(candidate(\"Hi\") == \"Hi\")\n\t@test(candidate(\"hello\") == \"ehllo\")\n\t@test(candidate(\"number\") == \"bemnru\")\n\t@test(candidate(\"abcd\") == \"abcd\")\n\t@test(candidate(\"Hello World!!!\") == \"Hello !!!Wdlor\")\n\t@test(candidate(\"\") == \"\")\n\t@test(candidate(\"Hi. My name is Mister Robot. How are you?\") == \".Hi My aemn is Meirst .Rboot How aer ?ouy\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "jl", - "prompt": "\"\"\"\n Given a list of numbers, return whether or not they are sorted\n in ascending order. If list has more than 1 duplicate of the same\n number, return False. Assume no negative numbers and only integers.\n\n Examples\n >>> is_sorted([5])\n true\n >>> is_sorted([1, 2, 3, 4, 5])\n true\n >>> is_sorted([1, 3, 2, 4, 5])\n false\n >>> is_sorted([1, 2, 3, 4, 5, 6])\n true\n >>> is_sorted([1, 2, 3, 4, 5, 6, 7])\n true\n >>> is_sorted([1, 3, 2, 4, 5, 6, 7])\n false\n >>> is_sorted([1, 2, 2, 3, 3, 4])\n true\n >>> is_sorted([1, 2, 2, 2, 3, 4])\n false\n \"\"\"\nfunction is_sorted(lst::Vector{Int64})::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_sorted;\n\t@test(candidate([5]) == true)\n\t@test(candidate([1, 2, 3, 4, 5]) == true)\n\t@test(candidate([1, 3, 2, 4, 5]) == false)\n\t@test(candidate([1, 2, 3, 4, 5, 6]) == true)\n\t@test(candidate([1, 2, 3, 4, 5, 6, 7]) == true)\n\t@test(candidate([1, 3, 2, 4, 5, 6, 7]) == false)\n\t@test(candidate(Vector{Int64}([])) == true)\n\t@test(candidate([1]) == true)\n\t@test(candidate([3, 2, 1]) == false)\n\t@test(candidate([1, 2, 2, 2, 3, 4]) == false)\n\t@test(candidate([1, 2, 3, 3, 3, 4]) == false)\n\t@test(candidate([1, 2, 2, 3, 3, 4]) == true)\n\t@test(candidate([1, 2, 3, 4]) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "jl", - "prompt": "\"\"\"You are given a string s.\n Your task is to check if the string is happy or not.\n A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n For example:\n >>> is_happy(\"a\")\n false\n >>> is_happy(\"aa\")\n false\n >>> is_happy(\"abcd\")\n true\n >>> is_happy(\"aabb\")\n false\n >>> is_happy(\"adb\")\n true\n >>> is_happy(\"xyy\")\n false\n \"\"\"\nfunction is_happy(s::String)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = is_happy;\n\t@test(candidate(\"a\") == false)\n\t@test(candidate(\"aa\") == false)\n\t@test(candidate(\"abcd\") == true)\n\t@test(candidate(\"aabb\") == false)\n\t@test(candidate(\"adb\") == true)\n\t@test(candidate(\"xyy\") == false)\n\t@test(candidate(\"iopaxpoi\") == true)\n\t@test(candidate(\"iopaxioi\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "jl", - "prompt": "\"\"\"\n Write a function that returns True if the object q will fly, and False otherwise.\n The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n\n Example:\n >>> will_it_fly([1, 2], 5)\n false\n # 1+2 is less than the maximum possible weight, but it's unbalanced.\n\n >>> will_it_fly([3, 2, 3], 1)\n false\n # it's balanced, but 3+2+3 is more than the maximum possible weight.\n\n >>> will_it_fly([3, 2, 3], 9)\n true\n # 3+2+3 is less than the maximum possible weight, and it's balanced.\n\n >>> will_it_fly([3], 5)\n true\n # 3 is less than the maximum possible weight, and it's balanced.\n \"\"\"\nfunction will_it_fly(q::Vector{Int64}, w::Int64)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = will_it_fly;\n\t@test(candidate([3, 2, 3], 9) == true)\n\t@test(candidate([1, 2], 5) == false)\n\t@test(candidate([3], 5) == true)\n\t@test(candidate([3, 2, 3], 1) == false)\n\t@test(candidate([1, 2, 3], 6) == false)\n\t@test(candidate([5], 5) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "jl", - "prompt": "\"\"\"\n Given an array of non-negative integers, return a copy of the given array after sorting,\n you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n or sort it in descending order if the sum( first index value, last index value) is even.\n\n Note:\n * don't change the given array.\n\n Examples:\n >>> sort_array([])\n []\n >>> sort_array([5])\n [5]\n >>> sort_array([2, 4, 3, 0, 1, 5])\n [0, 1, 2, 3, 4, 5]\n >>> sort_array([2, 4, 3, 0, 1, 5, 6])\n [6, 5, 4, 3, 2, 1, 0]\n \"\"\"\nfunction sort_array(array::Vector{Int64})::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = sort_array;\n\t@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))\n\t@test(candidate([5]) == [5])\n\t@test(candidate([2, 4, 3, 0, 1, 5]) == [0, 1, 2, 3, 4, 5])\n\t@test(candidate([2, 4, 3, 0, 1, 5, 6]) == [6, 5, 4, 3, 2, 1, 0])\n\t@test(candidate([2, 1]) == [1, 2])\n\t@test(candidate([15, 42, 87, 32, 11, 0]) == [0, 11, 15, 32, 42, 87])\n\t@test(candidate([21, 14, 23, 11]) == [23, 21, 14, 11])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "jl", - "prompt": "\"\"\"Implement a function that takes an non-negative integer and returns an array of the first n\n integers that are prime numbers and less than n.\n for example:\n >>> count_up_to(5)\n [2, 3]\n >>> count_up_to(11)\n [2, 3, 5, 7]\n >>> count_up_to(0)\n []\n >>> count_up_to(20)\n [2, 3, 5, 7, 11, 13, 17, 19]\n >>> count_up_to(1)\n []\n >>> count_up_to(18)\n [2, 3, 5, 7, 11, 13, 17]\n \"\"\"\nfunction count_up_to(n::Int64)::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = count_up_to;\n\t@test(candidate(5) == [2, 3])\n\t@test(candidate(6) == [2, 3, 5])\n\t@test(candidate(7) == [2, 3, 5])\n\t@test(candidate(10) == [2, 3, 5, 7])\n\t@test(candidate(0) == Vector{Int64}([]))\n\t@test(candidate(22) == [2, 3, 5, 7, 11, 13, 17, 19])\n\t@test(candidate(1) == Vector{Int64}([]))\n\t@test(candidate(18) == [2, 3, 5, 7, 11, 13, 17])\n\t@test(candidate(47) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43])\n\t@test(candidate(101) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "jl", - "prompt": "\"\"\" Out of list of strings, return the longest one. Return the first one in case of multiple\n strings of the same length. Return None in case the input list is empty.\n >>> longest([])\n nothing\n >>> longest([\"a\", \"b\", \"c\"])\n \"a\"\n >>> longest([\"a\", \"bb\", \"ccc\"])\n \"ccc\"\n \"\"\"\nfunction longest(strings::Vector{String})::Union{String, Nothing} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = longest;\n\t@test(candidate(Vector{String}([])) == nothing)\n\t@test(candidate([\"x\", \"y\", \"z\"]) == \"x\")\n\t@test(candidate([\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"]) == \"zzzz\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "jl", - "prompt": "\"\"\"\n Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n reverse the resulting array, and then replace each digit by its corresponding name from\n \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n\n For example:\n >>> by_length([2, 1, 1, 4, 5, 8, 2, 3])\n [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n \n If the array is empty, return an empty array:\n >>> by_length([])\n []\n \n If the array has any strange number ignore it:\n >>> by_length([1, -1, 55])\n [\"One\"]\n \"\"\"\nfunction by_length(arr::Vector{Int64})::Vector{String} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = by_length;\n\t@test(candidate([2, 1, 1, 4, 5, 8, 2, 3]) == [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"])\n\t@test(candidate(Vector{Int64}([])) == Vector{String}([]))\n\t@test(candidate([1, -1, 55]) == [\"One\"])\n\t@test(candidate([1, -1, 3, 2]) == [\"Three\", \"Two\", \"One\"])\n\t@test(candidate([9, 4, 8]) == [\"Nine\", \"Eight\", \"Four\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_106_f", - "language": "jl", - "prompt": "\"\"\" Implement the function f that takes n as a parameter,\n 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\n or the sum of numbers from 1 to i otherwise.\n i starts from 1.\n the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n Example:\n >>> f(5)\n [1, 2, 6, 24, 15]\n \"\"\"\nfunction f(n::Int64)::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = f;\n\t@test(candidate(5) == [1, 2, 6, 24, 15])\n\t@test(candidate(7) == [1, 2, 6, 24, 15, 720, 28])\n\t@test(candidate(1) == [1])\n\t@test(candidate(3) == [1, 2, 6])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "jl", - "prompt": "\"\"\"Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n >>> fizz_buzz(50)\n 0\n >>> fizz_buzz(78)\n 2\n >>> fizz_buzz(79)\n 3\n \"\"\"\nfunction fizz_buzz(n::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = fizz_buzz;\n\t@test(candidate(50) == 0)\n\t@test(candidate(78) == 2)\n\t@test(candidate(79) == 3)\n\t@test(candidate(100) == 3)\n\t@test(candidate(200) == 6)\n\t@test(candidate(4000) == 192)\n\t@test(candidate(10000) == 639)\n\t@test(candidate(100000) == 8026)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "jl", - "prompt": "\"\"\" Given a positive floating point number, it can be decomposed into\n and integer part (largest integer smaller than given number) and decimals\n (leftover part always smaller than 1).\n\n Return the decimal part of the number.\n >>> truncate_number(3.5)\n 0.5\n \"\"\"\nfunction truncate_number(number::Float64)::Float64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = truncate_number;\n\t@test(candidate(3.5) == 0.5)\n\t@test(candidate(1.25) == 0.25)\n\t@test(candidate(123.0) == 0.0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "jl", - "prompt": "\"\"\" For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n Empty sum should be equal to 0 and empty product should be equal to 1.\n >>> sum_product([])\n (0, 1)\n >>> sum_product([1, 2, 3, 4])\n (10, 24)\n \"\"\"\nfunction sum_product(numbers::Vector{Int64})::Tuple{Int64, Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = sum_product;\n\t@test(candidate(Vector{Int64}([])) == (0, 1))\n\t@test(candidate([1, 1, 1]) == (3, 1))\n\t@test(candidate([100, 0]) == (100, 0))\n\t@test(candidate([3, 5, 7]) == (15, 105))\n\t@test(candidate([10]) == (10, 10))\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "jl", - "prompt": "\"\"\"\n You are given a 2 dimensional data, as a nested lists,\n which is similar to matrix, however, unlike matrices,\n each row may contain a different number of columns.\n Given lst, and integer x, find integers x in the list,\n and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n each tuple is a coordinate - (row, columns), starting with 0.\n Sort coordinates initially by rows in ascending order.\n Also, sort coordinates of the row by columns in descending order.\n \n Examples:\n >>> get_row([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1)\n [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n >>> get_row([], 1)\n []\n >>> get_row([[], [1], [1, 2, 3]], 3)\n [(2, 2)]\n \"\"\"\nfunction get_row(lst::Vector{Vector{Int64}}, x::Int64)::Vector{Tuple{Int64, Int64}} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = get_row;\n\t@test(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)])\n\t@test(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6]], 2) == [(0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1)])\n\t@test(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 1, 3, 4, 5, 6], [1, 2, 1, 4, 5, 6], [1, 2, 3, 1, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1) == [(0, 0), (1, 0), (2, 1), (2, 0), (3, 2), (3, 0), (4, 3), (4, 0), (5, 4), (5, 0), (6, 5), (6, 0)])\n\t@test(candidate(Vector{Vector{Int64}}([]), 1) == Vector{Tuple{Int64, Int64}}([]))\n\t@test(candidate([[1]], 2) == Vector{Tuple{Int64, Int64}}([]))\n\t@test(candidate([[], [1], [1, 2, 3]], 3) == [(2, 2)])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "jl", - "prompt": "\"\"\"\n You're a hungry rabbit, and you already have eaten a certain number of carrots,\n but now you need to eat more carrots to complete the day's meals.\n you should return an array of [ total number of eaten carrots after your meals,\n the number of carrots left after your meals ]\n if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n \n Example:\n >>> eat(5, 6, 10)\n [11, 4]\n >>> eat(4, 8, 9)\n [12, 1]\n >>> eat(1, 10, 10)\n [11, 0]\n >>> eat(2, 11, 5)\n [7, 0]\n \n Variables:\n @number : integer\n the number of carrots that you have eaten.\n @need : integer\n the number of carrots that you need to eat.\n @remaining : integer\n the number of remaining carrots thet exist in stock\n \n Constrain:\n * 0 <= number <= 1000\n * 0 <= need <= 1000\n * 0 <= remaining <= 1000\n\n Have fun :)\n \"\"\"\nfunction eat(number::Int64, need::Int64, remaining::Int64)::Vector{Int64} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = eat;\n\t@test(candidate(5, 6, 10) == [11, 4])\n\t@test(candidate(4, 8, 9) == [12, 1])\n\t@test(candidate(1, 10, 10) == [11, 0])\n\t@test(candidate(2, 11, 5) == [7, 0])\n\t@test(candidate(4, 5, 7) == [9, 2])\n\t@test(candidate(4, 5, 1) == [5, 0])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "jl", - "prompt": "\"\"\"Given a positive integer N, return the total sum of its digits in binary.\n \n Example\n >>> solve(1000)\n \"1\"\n >>> solve(150)\n \"110\"\n >>> solve(147)\n \"1100\"\n \n Variables:\n @N integer\n Constraints: 0 \u2264 N \u2264 10000.\n Output:\n a string of binary number\n \"\"\"\nfunction solve(N::Int64)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = solve;\n\t@test(candidate(1000) == \"1\")\n\t@test(candidate(150) == \"110\")\n\t@test(candidate(147) == \"1100\")\n\t@test(candidate(333) == \"1001\")\n\t@test(candidate(963) == \"10010\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "jl", - "prompt": "\"\"\"You are given a list of integers.\n You need to find the largest prime value and return the sum of its digits.\n\n Examples:\n >>> skjkasdkd([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3])\n 10\n >>> skjkasdkd([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1])\n 25\n >>> skjkasdkd([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3])\n 13\n >>> skjkasdkd([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6])\n 11\n >>> skjkasdkd([0, 81, 12, 3, 1, 21])\n 3\n >>> skjkasdkd([0, 8, 1, 2, 1, 7])\n 7\n \"\"\"\nfunction skjkasdkd(lst::Vector{Int64})::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = skjkasdkd;\n\t@test(candidate([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]) == 10)\n\t@test(candidate([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]) == 25)\n\t@test(candidate([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]) == 13)\n\t@test(candidate([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]) == 11)\n\t@test(candidate([0, 81, 12, 3, 1, 21]) == 3)\n\t@test(candidate([0, 8, 1, 2, 1, 7]) == 7)\n\t@test(candidate([8191]) == 19)\n\t@test(candidate([8191, 123456, 127, 7]) == 19)\n\t@test(candidate([127, 97, 8192]) == 10)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "jl", - "prompt": "\"\"\"\n Given an array arr of integers, find the minimum number of elements that\n need to be changed to make the array palindromic. A palindromic array is an array that\n is read the same backwards and forwards. In one change, you can change one element to any other element.\n\n For example:\n >>> smallest_change([1, 2, 3, 5, 4, 7, 9, 6])\n 4\n >>> smallest_change([1, 2, 3, 4, 3, 2, 2])\n 1\n >>> smallest_change([1, 2, 3, 2, 1])\n 0\n \"\"\"\nfunction smallest_change(arr::Vector{Int64})::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = smallest_change;\n\t@test(candidate([1, 2, 3, 5, 4, 7, 9, 6]) == 4)\n\t@test(candidate([1, 2, 3, 4, 3, 2, 2]) == 1)\n\t@test(candidate([1, 4, 2]) == 1)\n\t@test(candidate([1, 4, 4, 2]) == 1)\n\t@test(candidate([1, 2, 3, 2, 1]) == 0)\n\t@test(candidate([3, 1, 1, 3]) == 0)\n\t@test(candidate([1]) == 0)\n\t@test(candidate([0, 1]) == 1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "jl", - "prompt": "\"\"\"It is the last week of the semester and the teacher has to give the grades\n to students. The teacher has been making her own algorithm for grading.\n The only problem is, she has lost the code she used for grading.\n She has given you a list of GPAs for some students and you have to write \n a function that can output a list of letter grades using the following table:\n GPA | Letter grade\n 4.0 A+\n > 3.7 A \n > 3.3 A- \n > 3.0 B+\n > 2.7 B \n > 2.3 B-\n > 2.0 C+\n > 1.7 C\n > 1.3 C-\n > 1.0 D+ \n > 0.7 D \n > 0.0 D-\n 0.0 E\n \n\n Example:\n >>> grade_equation([4.0, 3, 1.7, 2, 3.5])\n [\"A+\", \"B\", \"C-\", \"C\", \"A-\"]\n \"\"\"\nfunction numerical_letter_grade(grades::Vector{Float64})::Vector{String} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = numerical_letter_grade;\n\t@test(candidate([4.0, 3, 1.7, 2, 3.5]) == [\"A+\", \"B\", \"C-\", \"C\", \"A-\"])\n\t@test(candidate([1.2]) == [\"D+\"])\n\t@test(candidate([0.5]) == [\"D-\"])\n\t@test(candidate([0.0]) == [\"E\"])\n\t@test(candidate([1.0, 0.3, 1.5, 2.8, 3.3]) == [\"D\", \"D-\", \"C-\", \"B\", \"B+\"])\n\t@test(candidate([0.0, 0.7]) == [\"E\", \"D-\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "jl", - "prompt": "\"\"\"\n Given the lengths of the three sides of a triangle. Return the area of\n the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n Otherwise return -1\n Three sides make a valid triangle when the sum of any two sides is greater \n than the third side.\n Example:\n >>> triangle_area(3, 4, 5)\n 6.0\n >>> triangle_area(1, 2, 10)\n -1\n \"\"\"\nfunction triangle_area(a::Int64, b::Int64, c::Int64)::Float64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = triangle_area;\n\t@test(candidate(3, 4, 5) == 6.0)\n\t@test(candidate(1, 2, 10) == -1)\n\t@test(candidate(4, 8, 5) == 8.18)\n\t@test(candidate(2, 2, 2) == 1.73)\n\t@test(candidate(1, 2, 3) == -1)\n\t@test(candidate(10, 5, 7) == 16.25)\n\t@test(candidate(2, 6, 3) == -1)\n\t@test(candidate(1, 1, 1) == 0.43)\n\t@test(candidate(2, 2, 10) == -1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "jl", - "prompt": "\"\"\"\n Check if two words have the same characters.\n >>> same_chars(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\")\n true\n >>> same_chars(\"abcd\", \"dddddddabc\")\n true\n >>> same_chars(\"dddddddabc\", \"abcd\")\n true\n >>> same_chars(\"eabcd\", \"dddddddabc\")\n false\n >>> same_chars(\"abcd\", \"dddddddabce\")\n false\n >>> same_chars(\"eabcdzzzz\", \"dddzzzzzzzddddabc\")\n false\n \"\"\"\nfunction same_chars(s0::String, s1::String)::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = same_chars;\n\t@test(candidate(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\") == true)\n\t@test(candidate(\"abcd\", \"dddddddabc\") == true)\n\t@test(candidate(\"dddddddabc\", \"abcd\") == true)\n\t@test(candidate(\"eabcd\", \"dddddddabc\") == false)\n\t@test(candidate(\"abcd\", \"dddddddabcf\") == false)\n\t@test(candidate(\"eabcdzzzz\", \"dddzzzzzzzddddabc\") == false)\n\t@test(candidate(\"aabb\", \"aaccc\") == false)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "jl", - "prompt": "\"\"\"\n Given an array of integers nums, find the minimum sum of any non-empty sub-array\n of nums.\n Example\n >>> minSubArraySum([2, 3, 4, 1, 2, 4])\n 1\n >>> minSubArraySum([-1, -2, -3])\n -6\n \"\"\"\nfunction minSubArraySum(nums::Vector{Int64})::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = minSubArraySum;\n\t@test(candidate([2, 3, 4, 1, 2, 4]) == 1)\n\t@test(candidate([-1, -2, -3]) == -6)\n\t@test(candidate([-1, -2, -3, 2, -10]) == -14)\n\t@test(candidate([-9999999999999999]) == -9999999999999999)\n\t@test(candidate([0, 10, 20, 1000000]) == 0)\n\t@test(candidate([-1, -2, -3, 10, -5]) == -6)\n\t@test(candidate([100, -1, -2, -3, 10, -5]) == -6)\n\t@test(candidate([10, 11, 13, 8, 3, 4]) == 3)\n\t@test(candidate([100, -33, 32, -1, 0, -2]) == -33)\n\t@test(candidate([-10]) == -10)\n\t@test(candidate([7]) == 7)\n\t@test(candidate([1, -1]) == -1)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "jl", - "prompt": "\"\"\"Given a string s and a natural number n, you have been tasked to implement \n a function that returns a list of all words from string s that contain exactly \n n consonants, in order these words appear in the string s.\n If the string s is empty then the function should return an empty list.\n Note: you may assume the input string contains only letters and spaces.\n Examples:\n >>> select_words(\"Mary had a little lamb\", 4)\n [\"little\"]\n >>> select_words(\"Mary had a little lamb\", 3)\n [\"Mary\", \"lamb\"]\n >>> select_words(\"simple white space\", 2)\n []\n >>> select_words(\"Hello world\", 4)\n [\"world\"]\n >>> select_words(\"Uncle sam\", 3)\n [\"Uncle\"]\n \"\"\"\nfunction select_words(s::String, n::Int64)::Vector{String} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = select_words;\n\t@test(candidate(\"Mary had a little lamb\", 4) == [\"little\"])\n\t@test(candidate(\"Mary had a little lamb\", 3) == [\"Mary\", \"lamb\"])\n\t@test(candidate(\"simple white space\", 2) == Vector{String}([]))\n\t@test(candidate(\"Hello world\", 4) == [\"world\"])\n\t@test(candidate(\"Uncle sam\", 3) == [\"Uncle\"])\n\t@test(candidate(\"\", 4) == Vector{String}([]))\n\t@test(candidate(\"a b c d e f\", 1) == [\"b\", \"c\", \"d\", \"f\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "jl", - "prompt": "\"\"\" Return list of all prefixes from shortest to longest of the input string\n >>> all_prefixes(\"abc\")\n [\"a\", \"ab\", \"abc\"]\n \"\"\"\nfunction all_prefixes(string::String)::Vector{String} \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = all_prefixes;\n\t@test(candidate(\"\") == Vector{String}([]))\n\t@test(candidate(\"asdfgh\") == [\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"])\n\t@test(candidate(\"WWW\") == [\"W\", \"WW\", \"WWW\"])\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "jl", - "prompt": "\"\"\"\n Create a function that takes a value (string) representing a number\n and returns the closest integer to it. If the number is equidistant\n from two integers, round it away from zero.\n\n Examples\n >>> closest_integer(\"10\")\n 10\n >>> closest_integer(\"15.3\")\n 15\n\n Note:\n Rounding away from zero means that if the given number is equidistant\n from two integers, the one you should return is the one that is the\n farthest from zero. For example closest_integer(\"14.5\") should\n return 15 and closest_integer(\"-14.5\") should return -15.\n \"\"\"\nfunction closest_integer(value::String)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = closest_integer;\n\t@test(candidate(\"10\") == 10)\n\t@test(candidate(\"14.5\") == 15)\n\t@test(candidate(\"-15.5\") == -16)\n\t@test(candidate(\"15.3\") == 15)\n\t@test(candidate(\"0\") == 0)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "jl", - "prompt": "\"\"\"Create a function which takes a string representing a file's name, and returns\n 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n A file's name is considered to be valid if and only if all the following conditions \n are met:\n - There should not be more than three digits ('0'-'9') in the file's name.\n - The file's name contains exactly one dot '.'\n - The substring before the dot should not be empty, and it starts with a letter from \n the latin alphapet ('a'-'z' and 'A'-'Z').\n - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n Examples:\n >>> file_name_check(\"example.txt\")\n \"Yes\"\n >>> file_name_check(\"1example.dll\")\n \"No\"\n \"\"\"\nfunction file_name_check(file_name::String)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = file_name_check;\n\t@test(candidate(\"example.txt\") == \"Yes\")\n\t@test(candidate(\"1example.dll\") == \"No\")\n\t@test(candidate(\"s1sdf3.asd\") == \"No\")\n\t@test(candidate(\"K.dll\") == \"Yes\")\n\t@test(candidate(\"MY16FILE3.exe\") == \"Yes\")\n\t@test(candidate(\"His12FILE94.exe\") == \"No\")\n\t@test(candidate(\"_Y.txt\") == \"No\")\n\t@test(candidate(\"?aREYA.exe\") == \"No\")\n\t@test(candidate(\"/this_is_valid.dll\") == \"No\")\n\t@test(candidate(\"this_is_valid.wow\") == \"No\")\n\t@test(candidate(\"this_is_valid.txt\") == \"Yes\")\n\t@test(candidate(\"this_is_valid.txtexe\") == \"No\")\n\t@test(candidate(\"#this2_i4s_5valid.ten\") == \"No\")\n\t@test(candidate(\"@this1_is6_valid.exe\") == \"No\")\n\t@test(candidate(\"this_is_12valid.6exe4.txt\") == \"No\")\n\t@test(candidate(\"all.exe.txt\") == \"No\")\n\t@test(candidate(\"I563_No.exe\") == \"Yes\")\n\t@test(candidate(\"Is3youfault.txt\") == \"Yes\")\n\t@test(candidate(\"no_one#knows.dll\") == \"Yes\")\n\t@test(candidate(\"1I563_Yes3.exe\") == \"No\")\n\t@test(candidate(\"I563_Yes3.txtt\") == \"No\")\n\t@test(candidate(\"final..txt\") == \"No\")\n\t@test(candidate(\"final132\") == \"No\")\n\t@test(candidate(\"_f4indsartal132.\") == \"No\")\n\t@test(candidate(\".txt\") == \"No\")\n\t@test(candidate(\"s.\") == \"No\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "jl", - "prompt": "\"\"\"You are given two intervals,\n where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n The given intervals are closed which means that the interval (start, end)\n includes both start and end.\n For each given interval, it is assumed that its start is less or equal its end.\n Your task is to determine whether the length of intersection of these two \n intervals is a prime number.\n Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n which its length is 1, which not a prime number.\n If the length of the intersection is a prime number, return \"YES\",\n otherwise, return \"NO\".\n If the two intervals don't intersect, return \"NO\".\n\n\n [input/output] samples:\n >>> intersection((1, 2), (2, 3))\n \"NO\"\n >>> intersection((-1, 1), (0, 4))\n \"NO\"\n >>> intersection((-3, -1), (-5, 5))\n \"YES\"\n \"\"\"\nfunction intersection(interval1::Tuple{Int64, Int64}, interval2::Tuple{Int64, Int64})::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = intersection;\n\t@test(candidate((1, 2), (2, 3)) == \"NO\")\n\t@test(candidate((-1, 1), (0, 4)) == \"NO\")\n\t@test(candidate((-3, -1), (-5, 5)) == \"YES\")\n\t@test(candidate((-2, 2), (-4, 0)) == \"YES\")\n\t@test(candidate((-11, 2), (-1, -1)) == \"NO\")\n\t@test(candidate((1, 2), (3, 5)) == \"NO\")\n\t@test(candidate((1, 2), (1, 2)) == \"NO\")\n\t@test(candidate((-2, -2), (-3, -2)) == \"NO\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "jl", - "prompt": "\"\"\"Return the largest prime factor of n. Assume n > 1 and is not a prime.\n >>> largest_prime_factor(13195)\n 29\n >>> largest_prime_factor(2048)\n 2\n \"\"\"\nfunction largest_prime_factor(n::Int64)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = largest_prime_factor;\n\t@test(candidate(15) == 5)\n\t@test(candidate(27) == 3)\n\t@test(candidate(63) == 7)\n\t@test(candidate(330) == 11)\n\t@test(candidate(13195) == 29)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "jl", - "prompt": "\"\"\" Given a string, find out how many distinct characters (regardless of case) does it consist of\n >>> count_distinct_characters(\"xyzXYZ\")\n 3\n >>> count_distinct_characters(\"Jerry\")\n 4\n \"\"\"\nfunction count_distinct_characters(string::String)::Int64 \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = count_distinct_characters;\n\t@test(candidate(\"\") == 0)\n\t@test(candidate(\"abcde\") == 5)\n\t@test(candidate(\"abcdecadeCADE\") == 5)\n\t@test(candidate(\"aaaaAAAAaaaa\") == 1)\n\t@test(candidate(\"Jerry jERRY JeRRRY\") == 5)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "jl", - "prompt": "\"\"\" You're given a list of deposit and withdrawal operations on a bank account that starts with\n zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n at that point function should return True. Otherwise it should return False.\n >>> below_zero([1, 2, 3])\n false\n >>> below_zero([1, 2, -4, 5])\n true\n \"\"\"\nfunction below_zero(operations::Vector{Int64})::Bool \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = below_zero;\n\t@test(candidate(Vector{Int64}([])) == false)\n\t@test(candidate([1, 2, -3, 1, 2, -3]) == false)\n\t@test(candidate([1, 2, -4, 5, 6]) == true)\n\t@test(candidate([1, -1, 2, -2, 5, -5, 4, -4]) == false)\n\t@test(candidate([1, -1, 2, -2, 5, -5, 4, -5]) == true)\n\t@test(candidate([1, -2, 2, -2, 5, -5, 4, -4]) == true)\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "jl", - "prompt": "\"\"\" Find the shortest palindrome that begins with a supplied string.\n Algorithm idea is simple:\n - Find the longest postfix of supplied string that is a palindrome.\n - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n >>> make_palindrome(\"\")\n \"\"\n >>> make_palindrome(\"cat\")\n \"catac\"\n >>> make_palindrome(\"cata\")\n \"catac\"\n \"\"\"\nfunction make_palindrome(string::String)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = make_palindrome;\n\t@test(candidate(\"\") == \"\")\n\t@test(candidate(\"x\") == \"x\")\n\t@test(candidate(\"xyz\") == \"xyzyx\")\n\t@test(candidate(\"xyx\") == \"xyx\")\n\t@test(candidate(\"jerry\") == \"jerryrrej\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "jl", - "prompt": "\"\"\"\n Given a positive integer, obtain its roman numeral equivalent as a string,\n and return it in lowercase.\n Restrictions: 1 <= num <= 1000\n\n Examples:\n >>> int_to_mini_roman(19)\n \"xix\"\n >>> int_to_mini_roman(152)\n \"clii\"\n >>> int_to_mini_roman(426)\n \"cdxxvi\"\n \"\"\"\nfunction int_to_mini_roman(number::Int64)::String \n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "using Test\n\n@testset begin\n\ncandidate = int_to_mini_roman;\n\t@test(candidate(19) == \"xix\")\n\t@test(candidate(152) == \"clii\")\n\t@test(candidate(251) == \"ccli\")\n\t@test(candidate(426) == \"cdxxvi\")\n\t@test(candidate(500) == \"d\")\n\t@test(candidate(1) == \"i\")\n\t@test(candidate(4) == \"iv\")\n\t@test(candidate(43) == \"xliii\")\n\t@test(candidate(90) == \"xc\")\n\t@test(candidate(94) == \"xciv\")\n\t@test(candidate(532) == \"dxxxii\")\n\t@test(candidate(900) == \"cm\")\n\t@test(candidate(994) == \"cmxciv\")\n\t@test(candidate(1000) == \"m\")\nend\n", - "stop_tokens": [ - "\nfunction", - "\nmacro", - "\n\n" - ] - } -] \ No newline at end of file diff --git a/data/js-keep.json b/data/js-keep.json deleted file mode 100644 index 8da65200b666e049d42709e07c86f0a5145184c0..0000000000000000000000000000000000000000 --- a/data/js-keep.json +++ /dev/null @@ -1,2417 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "js", - "prompt": "//For a given number n, find the largest number that divides n evenly, smaller than n\n// >>> largest_divisor(15)\n// 5\nfunction largest_divisor(n){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = largest_divisor;\n assert.deepEqual(candidate(3),1);\n assert.deepEqual(candidate(7),1);\n assert.deepEqual(candidate(10),5);\n assert.deepEqual(candidate(100),50);\n assert.deepEqual(candidate(49),7);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_47_median", - "language": "js", - "prompt": "//Return median of elements in the list l.\n// >>> median([3, 1, 2, 4, 5])\n// 3\n// >>> median([-10, 4, 6, 1000, 10, 20])\n// 15.0\nfunction median(l){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = median;\n assert.deepEqual(candidate([3, 1, 2, 4, 5]),3);\n assert.deepEqual(candidate([-10, 4, 6, 1000, 10, 20]),8.0);\n assert.deepEqual(candidate([5]),5);\n assert.deepEqual(candidate([6, 5]),5.5);\n assert.deepEqual(candidate([8, 1, 3, 9, 9, 2, 7]),7);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "js", - "prompt": "//Given two lists operator, and operand. The first list has basic algebra operations, and \n// the second list is a list of integers. Use the two given lists to build the algebric \n// expression and return the evaluation of this expression.\n// The basic algebra operations:\n// Addition ( + ) \n// Subtraction ( - ) \n// Multiplication ( * ) \n// Floor division ( // ) \n// Exponentiation ( ** ) \n// Example:\n// operator['+', '*', '-']\n// array = [2, 3, 4, 5]\n// result = 2 + 3 * 4 - 5\n// => result = 9\n// Note:\n// The length of operator list is equal to the length of operand list minus one.\n// Operand is a list of of non-negative integers.\n// Operator list has at least one operator, and operand list has at least two operands.\nfunction do_algebra(operator, operand){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = do_algebra;\n assert.deepEqual(candidate([\"**\", \"*\", \"+\"], [2, 3, 4, 5]),37);\n assert.deepEqual(candidate([\"+\", \"*\", \"-\"], [2, 3, 4, 5]),9);\n assert.deepEqual(candidate([\"//\", \"*\"], [7, 3, 4]),8);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "js", - "prompt": "//Return maximum element in the list.\n// >>> max_element([1, 2, 3])\n// 3\n// >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n// 123\nfunction max_element(l){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = max_element;\n assert.deepEqual(candidate([1, 2, 3]),3);\n assert.deepEqual(candidate([5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]),124);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "js", - "prompt": "//Create a function which returns the largest index of an element which\n// is not greater than or equal to the element immediately preceding it. If\n// no such element exists then return -1. The given array will not contain\n// duplicate values.\n// Examples:\n// can_arrange([1,2,4,3,5]) = 3\n// can_arrange([1,2,3]) = -1\nfunction can_arrange(arr){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = can_arrange;\n assert.deepEqual(candidate([1, 2, 4, 3, 5]),3);\n assert.deepEqual(candidate([1, 2, 4, 5]),-1);\n assert.deepEqual(candidate([1, 4, 2, 5, 6, 7, 8, 9, 10]),2);\n assert.deepEqual(candidate([4, 8, 5, 7, 3]),4);\n assert.deepEqual(candidate([]),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "js", - "prompt": "//Imagine a road that's a perfectly straight infinitely long line.\n// n cars are driving left to right; simultaneously, a different set of n cars\n// are driving right to left. The two sets of cars start out being very far from\n// each other. All cars move in the same speed. Two cars are said to collide\n// when a car that's moving left to right hits a car that's moving right to left.\n// However, the cars are infinitely sturdy and strong; as a result, they continue moving\n// in their trajectory as if they did not collide.\n// This function outputs the number of such collisions.\nfunction car_race_collision(n){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = car_race_collision;\n assert.deepEqual(candidate(2),4);\n assert.deepEqual(candidate(3),9);\n assert.deepEqual(candidate(4),16);\n assert.deepEqual(candidate(8),64);\n assert.deepEqual(candidate(10),100);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "js", - "prompt": "//Create a function that returns True if the last character\n// of a given string is an alphabetical character and is not\n// a part of a word, and False otherwise.\n// Note: \"word\" is a group of characters separated by space.\n// Examples:\n// check_if_last_char_is_a_letter(\"apple pie\") \u279e False\n// check_if_last_char_is_a_letter(\"apple pi e\") \u279e True\n// check_if_last_char_is_a_letter(\"apple pi e \") \u279e False\n// check_if_last_char_is_a_letter(\"\") \u279e False\nfunction check_if_last_char_is_a_letter(txt){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = check_if_last_char_is_a_letter;\n assert.deepEqual(candidate(\"apple\"),false);\n assert.deepEqual(candidate(\"apple pi e\"),true);\n assert.deepEqual(candidate(\"eeeee\"),false);\n assert.deepEqual(candidate(\"A\"),true);\n assert.deepEqual(candidate(\"Pumpkin pie \"),false);\n assert.deepEqual(candidate(\"Pumpkin pie 1\"),false);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"eeeee e \"),false);\n assert.deepEqual(candidate(\"apple pie\"),false);\n assert.deepEqual(candidate(\"apple pi e \"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "js", - "prompt": "//Return true if a given number is prime, and false otherwise.\n// >>> is_prime(6)\n// False\n// >>> is_prime(101)\n// True\n// >>> is_prime(11)\n// True\n// >>> is_prime(13441)\n// True\n// >>> is_prime(61)\n// True\n// >>> is_prime(4)\n// False\n// >>> is_prime(1)\n// False\nfunction is_prime(n){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_prime;\n assert.deepEqual(candidate(6),false);\n assert.deepEqual(candidate(101),true);\n assert.deepEqual(candidate(11),true);\n assert.deepEqual(candidate(13441),true);\n assert.deepEqual(candidate(61),true);\n assert.deepEqual(candidate(4),false);\n assert.deepEqual(candidate(1),false);\n assert.deepEqual(candidate(5),true);\n assert.deepEqual(candidate(11),true);\n assert.deepEqual(candidate(17),true);\n assert.deepEqual(candidate(85),false);\n assert.deepEqual(candidate(77),false);\n assert.deepEqual(candidate(255379),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "js", - "prompt": "//Given a list of positive integers x. return a sorted list of all \n// elements that hasn't any even digit.\n// Note: Returned list should be sorted in increasing order.\n// For example:\n// >>> unique_digits([15, 33, 1422, 1])\n// [1, 15, 33]\n// >>> unique_digits([152, 323, 1422, 10])\n// []\nfunction unique_digits(x){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = unique_digits;\n assert.deepEqual(candidate([15, 33, 1422, 1]),[1, 15, 33]);\n assert.deepEqual(candidate([152, 323, 1422, 10]),[]);\n assert.deepEqual(candidate([12345, 2033, 111, 151]),[111, 151]);\n assert.deepEqual(candidate([135, 103, 31]),[31, 135]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "js", - "prompt": "//Input are two strings a and b consisting only of 1s and 0s.\n// Perform binary XOR on these inputs and return result also as a string.\n// >>> string_xor('010', '110')\n// '100'\nfunction string_xor(a, b){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = string_xor;\n assert.deepEqual(candidate(\"111000\", \"101010\"),\"010010\");\n assert.deepEqual(candidate(\"1\", \"1\"),\"0\");\n assert.deepEqual(candidate(\"0101\", \"0000\"),\"0101\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "js", - "prompt": "//sum_to_n is a function that sums numbers from 1 to n.\n// >>> sum_to_n(30)\n// 465\n// >>> sum_to_n(100)\n// 5050\n// >>> sum_to_n(5)\n// 15\n// >>> sum_to_n(10)\n// 55\n// >>> sum_to_n(1)\n// 1\nfunction sum_to_n(n){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_to_n;\n assert.deepEqual(candidate(1),1);\n assert.deepEqual(candidate(6),21);\n assert.deepEqual(candidate(11),66);\n assert.deepEqual(candidate(30),465);\n assert.deepEqual(candidate(100),5050);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "js", - "prompt": "//Given a list of numbers, return the sum of squares of the numbers\n// in the list that are odd. Ignore numbers that are negative or not integers.\n// double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10\n// double_the_difference([-1, -2, 0]) == 0\n// double_the_difference([9, -2]) == 81\n// double_the_difference([0]) == 0 \n// If the input list is empty, return 0.\nfunction double_the_difference(lst){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = double_the_difference;\n assert.deepEqual(candidate([]),0);\n assert.deepEqual(candidate([5.0, 4.0]),25);\n assert.deepEqual(candidate([0.1, 0.2, 0.3]),0);\n assert.deepEqual(candidate([-10.0, -20.0, -30.0]),0);\n assert.deepEqual(candidate([-1.0, -2.0, 8.0]),0);\n assert.deepEqual(candidate([0.2, 3.0, 5.0]),34);\n assert.deepEqual(candidate([-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]),165);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "js", - "prompt": "//Return length of given string\n// >>> strlen('')\n// 0\n// >>> strlen('abc')\n// 3\nfunction strlen(string){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = strlen;\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"x\"),1);\n assert.deepEqual(candidate(\"asdasnakj\"),9);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "js", - "prompt": "//You'll be given a string of words, and your task is to count the number\n// of boredoms. A boredom is a sentence that starts with the word \"I\".\n// Sentences are delimited by '.', '?' or '!'.\n// For example:\n// >>> is_bored(\"Hello world\")\n// 0\n// >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n// 1\nfunction is_bored(S){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_bored;\n assert.deepEqual(candidate(\"Hello world\"),0);\n assert.deepEqual(candidate(\"Is the sky blue?\"),0);\n assert.deepEqual(candidate(\"I love It !\"),1);\n assert.deepEqual(candidate(\"bIt\"),0);\n assert.deepEqual(candidate(\"I feel good today. I will be productive. will kill It\"),2);\n assert.deepEqual(candidate(\"You and I are going for a walk\"),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "js", - "prompt": "//Write a function vowels_count which takes a string representing\n// a word as input and returns the number of vowels in the string.\n// Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n// vowel, but only when it is at the end of the given word.\n// Example:\n// >>> vowels_count(\"abcde\")\n// 2\n// >>> vowels_count(\"ACEDY\")\n// 3\nfunction vowels_count(s){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = vowels_count;\n assert.deepEqual(candidate(\"abcde\"),2);\n assert.deepEqual(candidate(\"Alone\"),3);\n assert.deepEqual(candidate(\"key\"),2);\n assert.deepEqual(candidate(\"bye\"),1);\n assert.deepEqual(candidate(\"keY\"),2);\n assert.deepEqual(candidate(\"bYe\"),1);\n assert.deepEqual(candidate(\"ACEDY\"),3);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "js", - "prompt": "//Return n-th Fibonacci number.\n// >>> fib(10)\n// 55\n// >>> fib(1)\n// 1\n// >>> fib(8)\n// 21\nfunction fib(n){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fib;\n assert.deepEqual(candidate(10),55);\n assert.deepEqual(candidate(1),1);\n assert.deepEqual(candidate(8),21);\n assert.deepEqual(candidate(11),89);\n assert.deepEqual(candidate(12),144);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "js", - "prompt": "//Your task is to implement a function that will simplify the expression\n// x * n. The function returns True if x * n evaluates to a whole number and False\n// otherwise. Both x and n, are string representation of a fraction, and have the following format,\n// / where both numerator and denominator are positive whole numbers.\n// You can assume that x, and n are valid fractions, and do not have zero as denominator.\n// simplify(\"1/5\", \"5/1\") = True\n// simplify(\"1/6\", \"2/1\") = False\n// simplify(\"7/10\", \"10/2\") = False\nfunction simplify(x, n){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = simplify;\n assert.deepEqual(candidate(\"1/5\", \"5/1\"),true);\n assert.deepEqual(candidate(\"1/6\", \"2/1\"),false);\n assert.deepEqual(candidate(\"5/1\", \"3/1\"),true);\n assert.deepEqual(candidate(\"7/10\", \"10/2\"),false);\n assert.deepEqual(candidate(\"2/10\", \"50/10\"),true);\n assert.deepEqual(candidate(\"7/2\", \"4/2\"),true);\n assert.deepEqual(candidate(\"11/6\", \"6/1\"),true);\n assert.deepEqual(candidate(\"2/3\", \"5/2\"),false);\n assert.deepEqual(candidate(\"5/2\", \"3/5\"),false);\n assert.deepEqual(candidate(\"2/4\", \"8/4\"),true);\n assert.deepEqual(candidate(\"2/4\", \"4/2\"),true);\n assert.deepEqual(candidate(\"1/5\", \"5/1\"),true);\n assert.deepEqual(candidate(\"1/5\", \"1/5\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "js", - "prompt": "//Given a string s, count the number of uppercase vowels in even indices.\n// For example:\n// count_upper('aBCdEf') returns 1\n// count_upper('abcdefg') returns 0\n// count_upper('dBBE') returns 0\nfunction count_upper(s){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_upper;\n assert.deepEqual(candidate(\"aBCdEf\"),1);\n assert.deepEqual(candidate(\"abcdefg\"),0);\n assert.deepEqual(candidate(\"dBBE\"),0);\n assert.deepEqual(candidate(\"B\"),0);\n assert.deepEqual(candidate(\"U\"),1);\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"EEEE\"),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "js", - "prompt": "//You are given a rectangular grid of wells. Each row represents a single well,\n// and each 1 in a row represents a single unit of water.\n// Each well has a corresponding bucket that can be used to extract water from it, \n// and all buckets have the same capacity.\n// Your task is to use the buckets to empty the wells.\n// Output the number of times you need to lower the buckets.\n// Example 1:\n// Input: \n// grid : [[0,0,1,0], [0,1,0,0], [1,1,1,1]]\n// bucket_capacity : 1\n// Output: 6\n// Example 2:\n// Input: \n// grid : [[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]]\n// bucket_capacity : 2\n// Output: 5\n// Example 3:\n// Input: \n// grid : [[0,0,0], [0,0,0]]\n// bucket_capacity : 5\n// Output: 0\n// Constraints:\n// * all wells have the same length\n// * 1 <= grid.length <= 10^2\n// * 1 <= grid[:,1].length <= 10^2\n// * grid[i][j] -> 0 | 1\n// * 1 <= capacity <= 10\nfunction max_fill(grid, capacity){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = max_fill;\n assert.deepEqual(candidate([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1),6);\n assert.deepEqual(candidate([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2),5);\n assert.deepEqual(candidate([[0, 0, 0], [0, 0, 0]], 5),0);\n assert.deepEqual(candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 2),4);\n assert.deepEqual(candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 9),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "js", - "prompt": "//Given an array arr of integers and a positive integer k, return a sorted list \n// of length k with the maximum k numbers in arr.\n// Example 1:\n// Input: arr = [-3, -4, 5], k = 3\n// Output: [-4, -3, 5]\n// Example 2:\n// Input: arr = [4, -4, 4], k = 2\n// Output: [4, 4]\n// Example 3:\n// Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1\n// Output: [2]\n// Note:\n// 1. The length of the array will be in the range of [1, 1000].\n// 2. The elements in the array will be in the range of [-1000, 1000].\n// 3. 0 <= k <= len(arr)\nfunction maximum(arr, k){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = maximum;\n assert.deepEqual(candidate([-3, -4, 5], 3),[-4, -3, 5]);\n assert.deepEqual(candidate([4, -4, 4], 2),[4, 4]);\n assert.deepEqual(candidate([-3, 2, 1, 2, -1, -2, 1], 1),[2]);\n assert.deepEqual(candidate([123, -123, 20, 0, 1, 2, -3], 3),[2, 20, 123]);\n assert.deepEqual(candidate([-123, 20, 0, 1, 2, -3], 4),[0, 1, 2, 20]);\n assert.deepEqual(candidate([5, 15, 0, 3, -13, -8, 0], 7),[-13, -8, 0, 0, 3, 5, 15]);\n assert.deepEqual(candidate([-1, 0, 2, 5, 3, -10], 2),[3, 5]);\n assert.deepEqual(candidate([1, 0, 5, -7], 1),[5]);\n assert.deepEqual(candidate([4, -4], 2),[-4, 4]);\n assert.deepEqual(candidate([-10, 10], 2),[-10, 10]);\n assert.deepEqual(candidate([1, 2, 3, -23, 243, -400, 0], 0),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "js", - "prompt": "//Write a function that takes a message, and encodes in such a \n// way that it swaps case of all letters, replaces all vowels in \n// the message with the letter that appears 2 places ahead of that \n// vowel in the english alphabet. \n// Assume only letters. \n// Examples:\n// >>> encode('test')\n// 'TGST'\n// >>> encode('This is a message')\n// 'tHKS KS C MGSSCGG'\nfunction encode(message){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = encode;\n assert.deepEqual(candidate(\"TEST\"),\"tgst\");\n assert.deepEqual(candidate(\"Mudasir\"),\"mWDCSKR\");\n assert.deepEqual(candidate(\"YES\"),\"ygs\");\n assert.deepEqual(candidate(\"This is a message\"),\"tHKS KS C MGSSCGG\");\n assert.deepEqual(candidate(\"I DoNt KnOw WhAt tO WrItE\"),\"k dQnT kNqW wHcT Tq wRkTg\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "js", - "prompt": "//remove_vowels is a function that takes string and returns string without vowels.\n// >>> remove_vowels('')\n// ''\n// >>> remove_vowels('abcdef')\n// 'bcdf'\n// >>> remove_vowels('aaaaa')\n// ''\n// >>> remove_vowels('aaBAA')\n// 'B'\n// >>> remove_vowels('zbcd')\n// 'zbcd'\nfunction remove_vowels(text){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = remove_vowels;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"abcdef\nghijklm\"),\"bcdf\nghjklm\");\n assert.deepEqual(candidate(\"fedcba\"),\"fdcb\");\n assert.deepEqual(candidate(\"eeeee\"),\"\");\n assert.deepEqual(candidate(\"acBAA\"),\"cB\");\n assert.deepEqual(candidate(\"EcBOO\"),\"cB\");\n assert.deepEqual(candidate(\"ybcd\"),\"ybcd\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "js", - "prompt": "//Return only positive numbers in the list.\n// >>> get_positive([-1, 2, -4, 5, 6])\n// [2, 5, 6]\n// >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n// [5, 3, 2, 3, 9, 123, 1]\nfunction get_positive(l){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_positive;\n assert.deepEqual(candidate([-1, -2, 4, 5, 6]),[4, 5, 6]);\n assert.deepEqual(candidate([5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]),[5, 3, 2, 3, 3, 9, 123, 1]);\n assert.deepEqual(candidate([-1, -2]),[]);\n assert.deepEqual(candidate([]),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "js", - "prompt": "//Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n// >>> string_sequence(0)\n// '0'\n// >>> string_sequence(5)\n// '0 1 2 3 4 5'\nfunction string_sequence(n){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = string_sequence;\n assert.deepEqual(candidate(0),\"0\");\n assert.deepEqual(candidate(3),\"0 1 2 3\");\n assert.deepEqual(candidate(10),\"0 1 2 3 4 5 6 7 8 9 10\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "js", - "prompt": "//Given a positive integer n, you have to make a pile of n levels of stones.\n// The first level has n stones.\n// The number of stones in the next level is:\n// - the next odd number if n is odd.\n// - the next even number if n is even.\n// Return the number of stones in each level in a list, where element at index\n// i represents the number of stones in the level (i+1).\n// Examples:\n// >>> make_a_pile(3)\n// [3, 5, 7]\nfunction make_a_pile(n){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = make_a_pile;\n assert.deepEqual(candidate(3),[3, 5, 7]);\n assert.deepEqual(candidate(4),[4, 6, 8, 10]);\n assert.deepEqual(candidate(5),[5, 7, 9, 11, 13]);\n assert.deepEqual(candidate(6),[6, 8, 10, 12, 14, 16]);\n assert.deepEqual(candidate(8),[8, 10, 12, 14, 16, 18, 20, 22]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "js", - "prompt": "//Task\n// 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\n// then check if the result string is palindrome.\n// A string is called palindrome if it reads the same backward as forward.\n// You should return a tuple containing the result string and True/False for the check.\n// Example\n// For s = \"abcde\", c = \"ae\", the result should be ('bcd',False)\n// For s = \"abcdef\", c = \"b\" the result should be ('acdef',False)\n// For s = \"abcdedcba\", c = \"ab\", the result should be ('cdedc',True)\nfunction reverse_delete(s, c){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = reverse_delete;\n assert.deepEqual(candidate(\"abcde\", \"ae\"),[\"bcd\", false]);\n assert.deepEqual(candidate(\"abcdef\", \"b\"),[\"acdef\", false]);\n assert.deepEqual(candidate(\"abcdedcba\", \"ab\"),[\"cdedc\", true]);\n assert.deepEqual(candidate(\"dwik\", \"w\"),[\"dik\", false]);\n assert.deepEqual(candidate(\"a\", \"a\"),[\"\", true]);\n assert.deepEqual(candidate(\"abcdedcba\", \"\"),[\"abcdedcba\", true]);\n assert.deepEqual(candidate(\"abcdedcba\", \"v\"),[\"abcdedcba\", true]);\n assert.deepEqual(candidate(\"vabba\", \"v\"),[\"abba\", true]);\n assert.deepEqual(candidate(\"mamma\", \"mia\"),[\"\", true]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "js", - "prompt": "//For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n// >>> flip_case('Hello')\n// 'hELLO'\nfunction flip_case(string){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = flip_case;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"Hello!\"),\"hELLO!\");\n assert.deepEqual(candidate(\"These violent delights have violent ends\"),\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "js", - "prompt": "//You are given a string s.\n// if s[i] is a letter, reverse its case from lower to upper or vise versa, \n// otherwise keep it as it is.\n// If the string contains no letters, reverse the string.\n// The function should return the resulted string.\n// Examples\n// solve(\"1234\") = \"4321\"\n// solve(\"ab\") = \"AB\"\n// solve(\"#a@C\") = \"#A@c\"\nfunction solve(s){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = solve;\n assert.deepEqual(candidate(\"AsDf\"),\"aSdF\");\n assert.deepEqual(candidate(\"1234\"),\"4321\");\n assert.deepEqual(candidate(\"ab\"),\"AB\");\n assert.deepEqual(candidate(\"#a@C\"),\"#A@c\");\n assert.deepEqual(candidate(\"#AsdfW^45\"),\"#aSDFw^45\");\n assert.deepEqual(candidate(\"#6@2\"),\"2@6#\");\n assert.deepEqual(candidate(\"#$a^D\"),\"#$A^d\");\n assert.deepEqual(candidate(\"#ccc\"),\"#CCC\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "js", - "prompt": "//Filter an input list of strings only for ones that start with a given prefix.\n// >>> filter_by_prefix([], 'a')\n// []\n// >>> filter_by_prefix(['abc', 'bcd', 'cde', 'array'], 'a')\n// ['abc', 'array']\nfunction filter_by_prefix(strings, prefix){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = filter_by_prefix;\n assert.deepEqual(candidate([], \"john\"),[]);\n assert.deepEqual(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"),[\"xxx\", \"xxxAAA\", \"xxx\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "js", - "prompt": "//This function takes two positive numbers x and y and returns the\n// biggest even integer number that is in the range [x, y] inclusive. If \n// there's no such number, then the function should return -1.\n// For example:\n// choose_num(12, 15) = 14\n// choose_num(13, 12) = -1\nfunction choose_num(x, y){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = choose_num;\n assert.deepEqual(candidate(12, 15),14);\n assert.deepEqual(candidate(13, 12),-1);\n assert.deepEqual(candidate(33, 12354),12354);\n assert.deepEqual(candidate(5234, 5233),-1);\n assert.deepEqual(candidate(6, 29),28);\n assert.deepEqual(candidate(27, 10),-1);\n assert.deepEqual(candidate(7, 7),-1);\n assert.deepEqual(candidate(546, 546),546);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "js", - "prompt": "//You are given a string representing a sentence,\n// the sentence contains some words separated by a space,\n// and you have to return a string that contains the words from the original sentence,\n// whose lengths are prime numbers,\n// the order of the words in the new string should be the same as the original one.\n// Example 1:\n// Input: sentence = \"This is a test\"\n// Output: \"is\"\n// Example 2:\n// Input: sentence = \"lets go for swimming\"\n// Output: \"go for\"\n// Constraints:\n// * 1 <= len(sentence) <= 100\n// * sentence contains only letters\nfunction words_in_sentence(sentence){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = words_in_sentence;\n assert.deepEqual(candidate(\"This is a test\"),\"is\");\n assert.deepEqual(candidate(\"lets go for swimming\"),\"go for\");\n assert.deepEqual(candidate(\"there is no place available here\"),\"there is no place\");\n assert.deepEqual(candidate(\"Hi I am Hussein\"),\"Hi am Hussein\");\n assert.deepEqual(candidate(\"go for it\"),\"go for it\");\n assert.deepEqual(candidate(\"here\"),\"\");\n assert.deepEqual(candidate(\"here is\"),\"is\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "js", - "prompt": "//Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n// >>> intersperse([], 4)\n// []\n// >>> intersperse([1, 2, 3], 4)\n// [1, 4, 2, 4, 3]\nfunction intersperse(numbers, delimeter){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = intersperse;\n assert.deepEqual(candidate([], 7),[]);\n assert.deepEqual(candidate([5, 6, 3, 2], 8),[5, 8, 6, 8, 3, 8, 2]);\n assert.deepEqual(candidate([2, 2, 2], 2),[2, 2, 2, 2, 2]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "js", - "prompt": "//Your task is to write a function that returns true if a number x is a simple\n// power of n and false in other cases.\n// x is a simple power of n if n**int=x\n// For example:\n// is_simple_power(1, 4) => true\n// is_simple_power(2, 2) => true\n// is_simple_power(8, 2) => true\n// is_simple_power(3, 2) => false\n// is_simple_power(3, 1) => false\n// is_simple_power(5, 3) => false\nfunction is_simple_power(x, n){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_simple_power;\n assert.deepEqual(candidate(16, 2),true);\n assert.deepEqual(candidate(143214, 16),false);\n assert.deepEqual(candidate(4, 2),true);\n assert.deepEqual(candidate(9, 3),true);\n assert.deepEqual(candidate(16, 4),true);\n assert.deepEqual(candidate(24, 2),false);\n assert.deepEqual(candidate(128, 4),false);\n assert.deepEqual(candidate(12, 6),false);\n assert.deepEqual(candidate(1, 1),true);\n assert.deepEqual(candidate(1, 12),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "js", - "prompt": "//Write a function that returns true if the given number is the multiplication of 3 prime numbers\n// and false otherwise.\n// Knowing that (a) is less then 100. \n// Example:\n// is_multiply_prime(30) == True\n// 30 = 2 * 3 * 5\nfunction is_multiply_prime(a){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_multiply_prime;\n assert.deepEqual(candidate(5),false);\n assert.deepEqual(candidate(30),true);\n assert.deepEqual(candidate(8),true);\n assert.deepEqual(candidate(10),false);\n assert.deepEqual(candidate(125),true);\n assert.deepEqual(candidate(105),true);\n assert.deepEqual(candidate(126),false);\n assert.deepEqual(candidate(729),false);\n assert.deepEqual(candidate(891),false);\n assert.deepEqual(candidate(1001),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "js", - "prompt": "//Given the lengths of the three sides of a triangle. Return True if the three\n// sides form a right-angled triangle, False otherwise.\n// A right-angled triangle is a triangle in which one angle is right angle or \n// 90 degree.\n// Example:\n// right_angle_triangle(3, 4, 5) == True\n// right_angle_triangle(1, 2, 3) == False\nfunction right_angle_triangle(a, b, c){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = right_angle_triangle;\n assert.deepEqual(candidate(3, 4, 5),true);\n assert.deepEqual(candidate(1, 2, 3),false);\n assert.deepEqual(candidate(10, 6, 8),true);\n assert.deepEqual(candidate(2, 2, 2),false);\n assert.deepEqual(candidate(7, 24, 25),true);\n assert.deepEqual(candidate(10, 5, 7),false);\n assert.deepEqual(candidate(5, 12, 13),true);\n assert.deepEqual(candidate(15, 8, 17),true);\n assert.deepEqual(candidate(48, 55, 73),true);\n assert.deepEqual(candidate(1, 1, 1),false);\n assert.deepEqual(candidate(2, 2, 10),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "js", - "prompt": "//Create a function that takes 3 numbers.\n// Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n// Returns false in any other cases.\n// Examples\n// any_int(5, 2, 7) \u279e True\n// any_int(3, 2, 2) \u279e False\n// any_int(3, -2, 1) \u279e True\n// any_int(3.6, -2.2, 2) \u279e False\nfunction any_int(x, y, z){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = any_int;\n assert.deepEqual(candidate(2, 3, 1),true);\n assert.deepEqual(candidate(2.5, 2, 3),false);\n assert.deepEqual(candidate(1.5, 5, 3.5),false);\n assert.deepEqual(candidate(2, 6, 2),false);\n assert.deepEqual(candidate(4, 2, 2),true);\n assert.deepEqual(candidate(2.2, 2.2, 2.2),false);\n assert.deepEqual(candidate(-4, 6, 2),true);\n assert.deepEqual(candidate(2, 1, 1),true);\n assert.deepEqual(candidate(3, 4, 7),true);\n assert.deepEqual(candidate(3.0, 4, 7),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "js", - "prompt": "//This function takes a list l and returns a list l' such that\n// l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n// to the values of the corresponding indicies of l, but sorted.\n// >>> sort_third([1, 2, 3])\n// [1, 2, 3]\n// >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n// [2, 6, 3, 4, 8, 9, 5]\nfunction sort_third(l){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_third;\n assert.deepEqual(candidate([5, 6, 3, 4, 8, 9, 2]),[2, 6, 3, 4, 8, 9, 5]);\n assert.deepEqual(candidate([5, 8, 3, 4, 6, 9, 2]),[2, 8, 3, 4, 6, 9, 5]);\n assert.deepEqual(candidate([5, 6, 9, 4, 8, 3, 2]),[2, 6, 9, 4, 8, 3, 5]);\n assert.deepEqual(candidate([5, 6, 3, 4, 8, 9, 2, 1]),[2, 6, 3, 4, 8, 9, 5, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_53_add", - "language": "js", - "prompt": "//Add two numbers x and y\n// >>> add(2, 3)\n// 5\n// >>> add(5, 7)\n// 12\nfunction add(x, y){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = add;\n assert.deepEqual(candidate(0, 1),1);\n assert.deepEqual(candidate(1, 0),1);\n assert.deepEqual(candidate(2, 3),5);\n assert.deepEqual(candidate(5, 7),12);\n assert.deepEqual(candidate(7, 5),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_69_search", - "language": "js", - "prompt": "//You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n// zero, and has a frequency greater than or equal to the value of the integer itself. \n// The frequency of an integer is the number of times it appears in the list.\n// If no such a value exist, return -1.\n// Examples:\n// search([4, 1, 2, 2, 3, 1]) == 2\n// search([1, 2, 2, 3, 3, 3, 4, 4, 4]) == 3\n// search([5, 5, 4, 4, 4]) == -1\nfunction search(lst){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = search;\n assert.deepEqual(candidate([5, 5, 5, 5, 1]),1);\n assert.deepEqual(candidate([4, 1, 4, 1, 4, 4]),4);\n assert.deepEqual(candidate([3, 3]),-1);\n assert.deepEqual(candidate([8, 8, 8, 8, 8, 8, 8, 8]),8);\n assert.deepEqual(candidate([2, 3, 3, 2, 2]),2);\n assert.deepEqual(candidate([2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]),1);\n assert.deepEqual(candidate([3, 2, 8, 2]),2);\n assert.deepEqual(candidate([6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]),1);\n assert.deepEqual(candidate([8, 8, 3, 6, 5, 6, 4]),-1);\n assert.deepEqual(candidate([6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]),1);\n assert.deepEqual(candidate([1, 9, 10, 1, 3]),1);\n assert.deepEqual(candidate([6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]),5);\n assert.deepEqual(candidate([1]),1);\n assert.deepEqual(candidate([8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]),4);\n assert.deepEqual(candidate([2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]),2);\n assert.deepEqual(candidate([1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]),1);\n assert.deepEqual(candidate([9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]),4);\n assert.deepEqual(candidate([2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]),4);\n assert.deepEqual(candidate([9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]),2);\n assert.deepEqual(candidate([5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]),-1);\n assert.deepEqual(candidate([10]),-1);\n assert.deepEqual(candidate([9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]),2);\n assert.deepEqual(candidate([5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]),1);\n assert.deepEqual(candidate([7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]),1);\n assert.deepEqual(candidate([3, 10, 10, 9, 2]),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "js", - "prompt": "//Write a function that takes a string and returns True if the string\n// length is a prime number or False otherwise\n// Examples\n// prime_length('Hello') == True\n// prime_length('abcdcba') == True\n// prime_length('kittens') == True\n// prime_length('orange') == False\nfunction prime_length(string){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = prime_length;\n assert.deepEqual(candidate(\"Hello\"),true);\n assert.deepEqual(candidate(\"abcdcba\"),true);\n assert.deepEqual(candidate(\"kittens\"),true);\n assert.deepEqual(candidate(\"orange\"),false);\n assert.deepEqual(candidate(\"wow\"),true);\n assert.deepEqual(candidate(\"world\"),true);\n assert.deepEqual(candidate(\"MadaM\"),true);\n assert.deepEqual(candidate(\"Wow\"),true);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"HI\"),true);\n assert.deepEqual(candidate(\"go\"),true);\n assert.deepEqual(candidate(\"gogo\"),false);\n assert.deepEqual(candidate(\"aaaaaaaaaaaaaaa\"),false);\n assert.deepEqual(candidate(\"Madam\"),true);\n assert.deepEqual(candidate(\"M\"),false);\n assert.deepEqual(candidate(\"0\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_58_common", - "language": "js", - "prompt": "//Return sorted unique common elements for two lists.\n// >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n// [1, 5, 653]\n// >>> common([5, 3, 2, 8], [3, 2])\n// [2, 3]\nfunction common(l1, l2){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = common;\n assert.deepEqual(candidate([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]),[1, 5, 653]);\n assert.deepEqual(candidate([5, 3, 2, 8], [3, 2]),[2, 3]);\n assert.deepEqual(candidate([4, 3, 2, 8], [3, 2, 4]),[2, 3, 4]);\n assert.deepEqual(candidate([4, 3, 2, 8], []),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "js", - "prompt": "//The Brazilian factorial is defined as:\n// brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n// where n > 0\n// For example:\n// >>> special_factorial(4)\n// 288\n// The function will receive an integer as input and should return the special\n// factorial of this integer.\nfunction special_factorial(n){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = special_factorial;\n assert.deepEqual(candidate(4),288);\n assert.deepEqual(candidate(5),34560);\n assert.deepEqual(candidate(7),125411328000);\n assert.deepEqual(candidate(1),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "js", - "prompt": "//In this problem, you will implement a function that takes two lists of numbers,\n// and determines whether it is possible to perform an exchange of elements\n// between them to make lst1 a list of only even numbers.\n// There is no limit on the number of exchanged elements between lst1 and lst2.\n// If it is possible to exchange elements between the lst1 and lst2 to make\n// all the elements of lst1 to be even, return \"YES\".\n// Otherwise, return \"NO\".\n// For example:\n// exchange([1, 2, 3, 4], [1, 2, 3, 4]) => \"YES\"\n// exchange([1, 2, 3, 4], [1, 5, 3, 4]) => \"NO\"\n// It is assumed that the input lists will be non-empty.\nfunction exchange(lst1, lst2){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = exchange;\n assert.deepEqual(candidate([1, 2, 3, 4], [1, 2, 3, 4]),\"YES\");\n assert.deepEqual(candidate([1, 2, 3, 4], [1, 5, 3, 4]),\"NO\");\n assert.deepEqual(candidate([1, 2, 3, 4], [2, 1, 4, 3]),\"YES\");\n assert.deepEqual(candidate([5, 7, 3], [2, 6, 4]),\"YES\");\n assert.deepEqual(candidate([5, 7, 3], [2, 6, 3]),\"NO\");\n assert.deepEqual(candidate([3, 2, 6, 1, 8, 9], [3, 5, 5, 1, 1, 1]),\"NO\");\n assert.deepEqual(candidate([100, 200], [200, 200]),\"YES\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "js", - "prompt": "//Given a non-empty array of integers arr and an integer k, return\n// the sum of the elements with at most two digits from the first k elements of arr.\n// Example:\n// Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4\n// Output: 24 # sum of 21 + 3\n// Constraints:\n// 1. 1 <= len(arr) <= 100\n// 2. 1 <= k <= len(arr)\nfunction add_elements(arr, k){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = add_elements;\n assert.deepEqual(candidate([1, -2, -3, 41, 57, 76, 87, 88, 99], 3),-4);\n assert.deepEqual(candidate([111, 121, 3, 4000, 5, 6], 2),0);\n assert.deepEqual(candidate([11, 21, 3, 90, 5, 6, 7, 8, 9], 4),125);\n assert.deepEqual(candidate([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4),24);\n assert.deepEqual(candidate([1], 1),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "js", - "prompt": "//A simple program which should return the value of x if n is \n// a prime number and should return the value of y otherwise.\n// Examples:\n// for x_or_y(7, 34, 12) == 34\n// for x_or_y(15, 8, 5) == 5\nfunction x_or_y(n, x, y){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = x_or_y;\n assert.deepEqual(candidate(7, 34, 12),34);\n assert.deepEqual(candidate(15, 8, 5),5);\n assert.deepEqual(candidate(3, 33, 5212),33);\n assert.deepEqual(candidate(1259, 3, 52),3);\n assert.deepEqual(candidate(7919, -1, 12),-1);\n assert.deepEqual(candidate(3609, 1245, 583),583);\n assert.deepEqual(candidate(91, 56, 129),129);\n assert.deepEqual(candidate(6, 34, 1234),1234);\n assert.deepEqual(candidate(1, 2, 0),0);\n assert.deepEqual(candidate(2, 2, 0),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "js", - "prompt": "//Given length of a side and high return area for a triangle.\n// >>> triangle_area(5, 3)\n// 7.5\nfunction triangle_area(a, h){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = triangle_area;\n assert.deepEqual(candidate(5, 3),7.5);\n assert.deepEqual(candidate(2, 2),2.0);\n assert.deepEqual(candidate(10, 8),40.0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "js", - "prompt": "//Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n// the last couple centuries. However, what people don't know is Tribonacci sequence.\n// Tribonacci sequence is defined by the recurrence:\n// tri(1) = 3\n// tri(n) = 1 + n / 2, if n is even.\n// tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n// For example:\n// tri(2) = 1 + (2 / 2) = 2\n// tri(4) = 3\n// tri(3) = tri(2) + tri(1) + tri(4)\n// = 2 + 3 + 3 = 8 \n// You are given a non-negative integer number n, you have to a return a list of the \n// first n + 1 numbers of the Tribonacci sequence.\n// Examples:\n// tri(3) = [1, 3, 2, 8]\nfunction tri(n){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = tri;\n assert.deepEqual(candidate(3),[1, 3, 2, 8]);\n assert.deepEqual(candidate(4),[1, 3, 2, 8, 3]);\n assert.deepEqual(candidate(5),[1, 3, 2, 8, 3, 15]);\n assert.deepEqual(candidate(6),[1, 3, 2, 8, 3, 15, 4]);\n assert.deepEqual(candidate(7),[1, 3, 2, 8, 3, 15, 4, 24]);\n assert.deepEqual(candidate(8),[1, 3, 2, 8, 3, 15, 4, 24, 5]);\n assert.deepEqual(candidate(9),[1, 3, 2, 8, 3, 15, 4, 24, 5, 35]);\n assert.deepEqual(candidate(20),[1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11]);\n assert.deepEqual(candidate(0),[1]);\n assert.deepEqual(candidate(1),[1, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "js", - "prompt": "//You are given a list of two strings, both strings consist of open\n// parentheses '(' or close parentheses ')' only.\n// Your job is to check if it is possible to concatenate the two strings in\n// some order, that the resulting string will be good.\n// A string S is considered to be good if and only if all parentheses in S\n// are balanced. For example: the string '(())()' is good, while the string\n// '())' is not.\n// Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n// Examples:\n// match_parens(['()(', ')']) == 'Yes'\n// match_parens([')', ')']) == 'No'\nfunction match_parens(lst){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = match_parens;\n assert.deepEqual(candidate([\"()(\", \")\"]),\"Yes\");\n assert.deepEqual(candidate([\")\", \")\"]),\"No\");\n assert.deepEqual(candidate([\"(()(())\", \"())())\"]),\"No\");\n assert.deepEqual(candidate([\")())\", \"(()()(\"]),\"Yes\");\n assert.deepEqual(candidate([\"(())))\", \"(()())((\"]),\"Yes\");\n assert.deepEqual(candidate([\"()\", \"())\"]),\"No\");\n assert.deepEqual(candidate([\"(()(\", \"()))()\"]),\"Yes\");\n assert.deepEqual(candidate([\"((((\", \"((())\"]),\"No\");\n assert.deepEqual(candidate([\")(()\", \"(()(\"]),\"No\");\n assert.deepEqual(candidate([\")(\", \")(\"]),\"No\");\n assert.deepEqual(candidate([\"(\", \")\"]),\"Yes\");\n assert.deepEqual(candidate([\")\", \"(\"]),\"Yes\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "js", - "prompt": "//From a list of integers, remove all elements that occur more than once.\n// Keep order of elements left the same as in the input.\n// >>> remove_duplicates([1, 2, 3, 2, 4])\n// [1, 3, 4]\nfunction remove_duplicates(numbers){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = remove_duplicates;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, 2, 3, 4]),[1, 2, 3, 4]);\n assert.deepEqual(candidate([1, 2, 3, 2, 4, 3, 5]),[1, 4, 5]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "js", - "prompt": "//Return a greatest common divisor of two integers a and b\n// >>> greatest_common_divisor(3, 5)\n// 1\n// >>> greatest_common_divisor(25, 15)\n// 5\nfunction greatest_common_divisor(a, b){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = greatest_common_divisor;\n assert.deepEqual(candidate(3, 7),1);\n assert.deepEqual(candidate(10, 15),5);\n assert.deepEqual(candidate(49, 14),7);\n assert.deepEqual(candidate(144, 60),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "js", - "prompt": "//Checks if given string is a palindrome\n// >>> is_palindrome('')\n// True\n// >>> is_palindrome('aba')\n// True\n// >>> is_palindrome('aaaaa')\n// True\n// >>> is_palindrome('zbcd')\n// False\nfunction is_palindrome(text){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_palindrome;\n assert.deepEqual(candidate(\"\"),true);\n assert.deepEqual(candidate(\"aba\"),true);\n assert.deepEqual(candidate(\"aaaaa\"),true);\n assert.deepEqual(candidate(\"zbcd\"),false);\n assert.deepEqual(candidate(\"xywyx\"),true);\n assert.deepEqual(candidate(\"xywyz\"),false);\n assert.deepEqual(candidate(\"xywzx\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "js", - "prompt": "//xs represent coefficients of a polynomial.\n// xs[0] + xs[1] * x + xs[2] * x^2 + ....\n// Return derivative of this polynomial in the same form.\n// >>> derivative([3, 1, 2, 4, 5])\n// [1, 4, 12, 20]\n// >>> derivative([1, 2, 3])\n// [2, 6]\nfunction derivative(xs){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = derivative;\n assert.deepEqual(candidate([3, 1, 2, 4, 5]),[1, 4, 12, 20]);\n assert.deepEqual(candidate([1, 2, 3]),[2, 6]);\n assert.deepEqual(candidate([3, 2, 1]),[2, 2]);\n assert.deepEqual(candidate([3, 2, 1, 0, 4]),[2, 2, 0, 16]);\n assert.deepEqual(candidate([1]),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "js", - "prompt": "//In this task, you will be given a string that represents a number of apples and oranges \n// that are distributed in a basket of fruit this basket contains \n// apples, oranges, and mango fruits. Given the string that represents the total number of \n// the oranges and apples and an integer that represent the total number of the fruits \n// in the basket return the number of the mango fruits in the basket.\n// for examble:\n// fruit_distribution(\"5 apples and 6 oranges\", 19) ->19 - 5 - 6 = 8\n// fruit_distribution(\"0 apples and 1 oranges\",3) -> 3 - 0 - 1 = 2\n// fruit_distribution(\"2 apples and 3 oranges\", 100) -> 100 - 2 - 3 = 95\n// fruit_distribution(\"100 apples and 1 oranges\",120) -> 120 - 100 - 1 = 19\nfunction fruit_distribution(s, n){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fruit_distribution;\n assert.deepEqual(candidate(\"5 apples and 6 oranges\", 19),8);\n assert.deepEqual(candidate(\"5 apples and 6 oranges\", 21),10);\n assert.deepEqual(candidate(\"0 apples and 1 oranges\", 3),2);\n assert.deepEqual(candidate(\"1 apples and 0 oranges\", 3),2);\n assert.deepEqual(candidate(\"2 apples and 3 oranges\", 100),95);\n assert.deepEqual(candidate(\"2 apples and 3 oranges\", 5),0);\n assert.deepEqual(candidate(\"1 apples and 100 oranges\", 120),19);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "js", - "prompt": "//Write a function that takes an integer a and returns True \n// if this ingeger is a cube of some integer number.\n// Note: you may assume the input is always valid.\n// Examples:\n// iscube(1) ==> True\n// iscube(2) ==> False\n// iscube(-1) ==> True\n// iscube(64) ==> True\n// iscube(0) ==> True\n// iscube(180) ==> False\nfunction iscube(a){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = iscube;\n assert.deepEqual(candidate(1),true);\n assert.deepEqual(candidate(2),false);\n assert.deepEqual(candidate(-1),true);\n assert.deepEqual(candidate(64),true);\n assert.deepEqual(candidate(180),false);\n assert.deepEqual(candidate(1000),true);\n assert.deepEqual(candidate(0),true);\n assert.deepEqual(candidate(1729),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "js", - "prompt": "//In this Kata, you have to sort an array of non-negative integers according to\n// number of ones in their binary representation in ascending order.\n// For similar number of ones, sort based on decimal value.\n// It must be implemented like this:\n// >>> sort_array([1, 5, 2, 3, 4]) == [1, 2, 3, 4, 5]\n// >>> sort_array([-2, -3, -4, -5, -6]) == [-6, -5, -4, -3, -2]\n// >>> sort_array([1, 0, 2, 3, 4]) [0, 1, 2, 3, 4]\nfunction sort_array(arr){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_array;\n assert.deepEqual(candidate([1, 5, 2, 3, 4]),[1, 2, 4, 3, 5]);\n assert.deepEqual(candidate([-2, -3, -4, -5, -6]),[-4, -2, -6, -5, -3]);\n assert.deepEqual(candidate([1, 0, 2, 3, 4]),[0, 1, 2, 4, 3]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]),[2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77]);\n assert.deepEqual(candidate([3, 6, 44, 12, 32, 5]),[32, 3, 5, 6, 12, 44]);\n assert.deepEqual(candidate([2, 4, 8, 16, 32]),[2, 4, 8, 16, 32]);\n assert.deepEqual(candidate([2, 4, 8, 16, 32]),[2, 4, 8, 16, 32]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "js", - "prompt": "//Given a list of strings, where each string consists of only digits, return a list.\n// Each element i of the output should be \"the number of odd elements in the\n// string i of the input.\" where all the i's should be replaced by the number\n// of odd digits in the i'th string of the input.\n// >>> odd_count(['1234567'])\n// [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n// >>> odd_count(['3',\"11111111\"])\n// [\"the number of odd elements 1n the str1ng 1 of the 1nput.\",\n// \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\nfunction odd_count(lst){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = odd_count;\n assert.deepEqual(candidate([\"1234567\"]),[\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]);\n assert.deepEqual(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.\"]);\n assert.deepEqual(candidate([\"271\", \"137\", \"314\"]),[\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "js", - "prompt": "//brackets is a string of \"(\" and \")\".\n// return True if every opening bracket has a corresponding closing bracket.\n// >>> correct_bracketing(\"(\")\n// False\n// >>> correct_bracketing(\"()\")\n// True\n// >>> correct_bracketing(\"(()())\")\n// True\n// >>> correct_bracketing(\")(()\")\n// False\nfunction correct_bracketing(brackets){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = correct_bracketing;\n assert.deepEqual(candidate(\"()\"),true);\n assert.deepEqual(candidate(\"(()())\"),true);\n assert.deepEqual(candidate(\"()()(()())()\"),true);\n assert.deepEqual(candidate(\"()()((()()())())(()()(()))\"),true);\n assert.deepEqual(candidate(\"((()())))\"),false);\n assert.deepEqual(candidate(\")(()\"),false);\n assert.deepEqual(candidate(\"(\"),false);\n assert.deepEqual(candidate(\"((((\"),false);\n assert.deepEqual(candidate(\")\"),false);\n assert.deepEqual(candidate(\"(()\"),false);\n assert.deepEqual(candidate(\"()()(()())())(()\"),false);\n assert.deepEqual(candidate(\"()()(()())()))()\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "js", - "prompt": "//Task\n// Write a function that takes a string as input and returns the sum of the upper characters only'\n// ASCII codes.\n// Examples:\n// digitSum(\"\") => 0\n// digitSum(\"abAB\") => 131\n// digitSum(\"abcCd\") => 67\n// digitSum(\"helloE\") => 69\n// digitSum(\"woArBld\") => 131\n// digitSum(\"aAaaaXa\") => 153\nfunction digitSum(s){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = digitSum;\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"abAB\"),131);\n assert.deepEqual(candidate(\"abcCd\"),67);\n assert.deepEqual(candidate(\"helloE\"),69);\n assert.deepEqual(candidate(\"woArBld\"),131);\n assert.deepEqual(candidate(\"aAaaaXa\"),153);\n assert.deepEqual(candidate(\" How are yOu?\"),151);\n assert.deepEqual(candidate(\"You arE Very Smart\"),327);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "js", - "prompt": "//Write a function that accepts a list of strings as a parameter,\n// deletes the strings that have odd lengths from it,\n// and returns the resulted list with a sorted order,\n// The list is always a list of strings and never an array of numbers,\n// and it may contain duplicates.\n// The order of the list should be ascending by length of each word, and you\n// should return the list sorted by that rule.\n// If two words have the same length, sort the list alphabetically.\n// The function should return a list of strings in sorted order.\n// You may assume that all words will have the same length.\n// For example:\n// assert list_sort([\"aa\", \"a\", \"aaa\"]) => [\"aa\"]\n// assert list_sort([\"ab\", \"a\", \"aaa\", \"cd\"]) => [\"ab\", \"cd\"]\nfunction sorted_list_sum(lst){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sorted_list_sum;\n assert.deepEqual(candidate([\"aa\", \"a\", \"aaa\"]),[\"aa\"]);\n assert.deepEqual(candidate([\"school\", \"AI\", \"asdf\", \"b\"]),[\"AI\", \"asdf\", \"school\"]);\n assert.deepEqual(candidate([\"d\", \"b\", \"c\", \"a\"]),[]);\n assert.deepEqual(candidate([\"d\", \"dcba\", \"abcd\", \"a\"]),[\"abcd\", \"dcba\"]);\n assert.deepEqual(candidate([\"AI\", \"ai\", \"au\"]),[\"AI\", \"ai\", \"au\"]);\n assert.deepEqual(candidate([\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"]),[]);\n assert.deepEqual(candidate([\"aaaa\", \"bbbb\", \"dd\", \"cc\"]),[\"cc\", \"dd\", \"aaaa\", \"bbbb\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "js", - "prompt": "//You are given an array arr of integers and you need to return\n// sum of magnitudes of integers multiplied by product of all signs\n// of each number in the array, represented by 1, -1 or 0.\n// Note: return None for empty arr.\n// Example:\n// >>> prod_signs([1, 2, 2, -4]) == -9\n// >>> prod_signs([0, 1]) == 0\n// >>> prod_signs([]) == None\nfunction prod_signs(arr){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = prod_signs;\n assert.deepEqual(candidate([1, 2, 2, -4]),-9);\n assert.deepEqual(candidate([0, 1]),0);\n assert.deepEqual(candidate([1, 1, 1, 2, 3, -1, 1]),-10);\n assert.deepEqual(candidate([]),undefined);\n assert.deepEqual(candidate([2, 4, 1, 2, -1, -1, 9]),20);\n assert.deepEqual(candidate([-1, 1, -1, 1]),4);\n assert.deepEqual(candidate([-1, 1, 1, 1]),-4);\n assert.deepEqual(candidate([-1, 1, 1, 0]),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "js", - "prompt": "//Return list with elements incremented by 1.\n// >>> incr_list([1, 2, 3])\n// [2, 3, 4]\n// >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123])\n// [6, 4, 6, 3, 4, 4, 10, 1, 124]\nfunction incr_list(l){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = incr_list;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([3, 2, 1]),[4, 3, 2]);\n assert.deepEqual(candidate([5, 2, 5, 2, 3, 3, 9, 0, 123]),[6, 3, 6, 3, 4, 4, 10, 1, 124]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "js", - "prompt": "//From a given list of integers, generate a list of rolling maximum element found until given moment\n// in the sequence.\n// >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n// [1, 2, 3, 3, 3, 4, 4]\nfunction rolling_max(numbers){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = rolling_max;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, 2, 3, 4]),[1, 2, 3, 4]);\n assert.deepEqual(candidate([4, 3, 2, 1]),[4, 4, 4, 4]);\n assert.deepEqual(candidate([3, 2, 3, 100, 3]),[3, 3, 3, 100, 100]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "js", - "prompt": "//Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n// separate those group into separate strings and return the list of those.\n// Separate groups are balanced (each open brace is properly closed) and not nested within each other\n// Ignore any spaces in the input string.\n// >>> separate_paren_groups('( ) (( )) (( )( ))')\n// ['()', '(())', '(()())']\nfunction separate_paren_groups(paren_string){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = separate_paren_groups;\n assert.deepEqual(candidate(\"(()()) ((())) () ((())()())\"),[\"(()())\", \"((()))\", \"()\", \"((())()())\"]);\n assert.deepEqual(candidate(\"() (()) ((())) (((())))\"),[\"()\", \"(())\", \"((()))\", \"(((())))\"]);\n assert.deepEqual(candidate(\"(()(())((())))\"),[\"(()(())((())))\"]);\n assert.deepEqual(candidate(\"( ) (( )) (( )( ))\"),[\"()\", \"(())\", \"(()())\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "js", - "prompt": "//You will be given a string of words separated by commas or spaces. Your task is\n// to split the string into words and return an array of the words.\n// For example:\n// words_string(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n// words_string(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\nfunction words_string(s){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = words_string;\n assert.deepEqual(candidate(\"Hi, my name is John\"),[\"Hi\", \"my\", \"name\", \"is\", \"John\"]);\n assert.deepEqual(candidate(\"One, two, three, four, five, six\"),[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]);\n assert.deepEqual(candidate(\"Hi, my name\"),[\"Hi\", \"my\", \"name\"]);\n assert.deepEqual(candidate(\"One,, two, three, four, five, six,\"),[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]);\n assert.deepEqual(candidate(\"\"),[]);\n assert.deepEqual(candidate(\"ahmed , gamal\"),[\"ahmed\", \"gamal\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "js", - "prompt": "//Create a function that takes integers, floats, or strings representing\n// real numbers, and returns the larger variable in its given variable type.\n// Return None if the values are equal.\n// Note: If a real number is represented as a string, the floating point might be . or ,\n// compare_one(1, 2.5) \u279e 2.5\n// compare_one(1, \"2,3\") \u279e \"2,3\"\n// compare_one(\"5,1\", \"6\") \u279e \"6\"\n// compare_one(\"1\", 1) \u279e None\nfunction compare_one(a, b){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_137_compare_one.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = compare_one;\n assert.deepEqual(candidate(1, 2),2);\n assert.deepEqual(candidate(1, 2.5),2.5);\n assert.deepEqual(candidate(2, 3),3);\n assert.deepEqual(candidate(5, 6),6);\n assert.deepEqual(candidate(1, \"2,3\"),\"2,3\");\n assert.deepEqual(candidate(\"5,1\", \"6\"),\"6\");\n assert.deepEqual(candidate(\"1\", \"2\"),\"2\");\n assert.deepEqual(candidate(\"1\", 1),undefined);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "js", - "prompt": "//Filter given list of any python values only for integers\n// >>> filter_integers(['a', 3.14, 5])\n// [5]\n// >>> filter_integers([1, 2, 3, 'abc', {}, []])\n// [1, 2, 3]\nfunction filter_integers(values){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = filter_integers;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([4, {}, [], 23.2, 9, \"adasd\"]),[4, 9]);\n assert.deepEqual(candidate([3, \"c\", 3, 3, \"a\", \"b\"]),[3, 3, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "js", - "prompt": "//This function takes a list l and returns a list l' such that\n// l' is identical to l in the odd indicies, while its values at the even indicies are equal\n// to the values of the even indicies of l, but sorted.\n// >>> sort_even([1, 2, 3])\n// [1, 2, 3]\n// >>> sort_even([5, 6, 3, 4])\n// [3, 6, 5, 4]\nfunction sort_even(l){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_even;\n assert.deepEqual(candidate([1, 2, 3]),[1, 2, 3]);\n assert.deepEqual(candidate([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]),[-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123]);\n assert.deepEqual(candidate([5, 8, -12, 4, 23, 2, 3, 11, 12, -10]),[-12, 8, 3, 4, 5, 2, 12, 11, 23, -10]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "js", - "prompt": "//I think we all remember that feeling when the result of some long-awaited\n// event is finally known. The feelings and thoughts you have at that moment are\n// definitely worth noting down and comparing.\n// Your task is to determine if a person correctly guessed the results of a number of matches.\n// You are given two arrays of scores and guesses of equal length, where each index shows a match. \n// Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n// the value is 0, and if not, the value is the absolute difference between the guess and the score.\n// example:\n// compare([1,2,3,4,5,1],[1,2,3,4,2,-2]) -> [0,0,0,0,3,3]\n// compare([0,5,0,0,0,4],[4,1,1,0,0,-2]) -> [4,4,1,0,0,6]\nfunction compare(game, guess){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = compare;\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2]),[0, 0, 0, 0, 3, 3]);\n assert.deepEqual(candidate([0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]),[0, 0, 0, 0, 0, 0]);\n assert.deepEqual(candidate([1, 2, 3], [-1, -2, -3]),[2, 4, 6]);\n assert.deepEqual(candidate([1, 2, 3, 5], [-1, 2, 3, 4]),[2, 0, 0, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "js", - "prompt": "//Given a positive integer n, return a tuple that has the number of even and odd\n// integer palindromes that fall within the range(1, n), inclusive.\n// Example 1:\n// Input: 3\n// Output: (1, 2)\n// Explanation:\n// Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n// Example 2:\n// Input: 12\n// Output: (4, 6)\n// Explanation:\n// Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n// Note:\n// 1. 1 <= n <= 10^3\n// 2. returned tuple has the number of even and odd integer palindromes respectively.\nfunction even_odd_palindrome(n){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = even_odd_palindrome;\n assert.deepEqual(candidate(123),[8, 13]);\n assert.deepEqual(candidate(12),[4, 6]);\n assert.deepEqual(candidate(3),[1, 2]);\n assert.deepEqual(candidate(63),[6, 8]);\n assert.deepEqual(candidate(25),[5, 6]);\n assert.deepEqual(candidate(19),[4, 6]);\n assert.deepEqual(candidate(9),[4, 5]);\n assert.deepEqual(candidate(1),[0, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "js", - "prompt": "//The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fib4(0) -> 0\n// fib4(1) -> 0\n// fib4(2) -> 2\n// fib4(3) -> 0\n// fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n// Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n// >>> fib4(5)\n// 4\n// >>> fib4(6)\n// 8\n// >>> fib4(7)\n// 14\nfunction fib4(n){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fib4;\n assert.deepEqual(candidate(5),4);\n assert.deepEqual(candidate(8),28);\n assert.deepEqual(candidate(10),104);\n assert.deepEqual(candidate(12),386);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "js", - "prompt": "//Given two positive integers a and b, return the even digits between a\n// and b, in ascending order.\n// For example:\n// generate_integers(2, 8) => [2, 4, 6, 8]\n// generate_integers(8, 2) => [2, 4, 6, 8]\n// generate_integers(10, 14) => []\nfunction generate_integers(a, b){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = generate_integers;\n assert.deepEqual(candidate(2, 10),[2, 4, 6, 8]);\n assert.deepEqual(candidate(10, 2),[2, 4, 6, 8]);\n assert.deepEqual(candidate(132, 2),[2, 4, 6, 8]);\n assert.deepEqual(candidate(17, 89),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "js", - "prompt": "//For a given list of input numbers, calculate Mean Absolute Deviation\n// around the mean of this dataset.\n// Mean Absolute Deviation is the average absolute difference between each\n// element and a centerpoint (mean in this case):\n// MAD = average | x - x_mean |\n// >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n// 1.0\nfunction mean_absolute_deviation(numbers){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = mean_absolute_deviation;\n assert.deepEqual(candidate([1.0, 2.0]),0.5);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0]),1.0);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0]),1.2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "js", - "prompt": "//Create a function encrypt that takes a string as an argument and\n// returns a string encrypted with the alphabet being rotated. \n// The alphabet should be rotated in a manner such that the letters \n// shift down by two multiplied to two places.\n// For example:\n// encrypt('hi') returns 'lm'\n// encrypt('asdfghjkl') returns 'ewhjklnop'\n// encrypt('gf') returns 'kj'\n// encrypt('et') returns 'ix'\nfunction encrypt(s){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = encrypt;\n assert.deepEqual(candidate(\"hi\"),\"lm\");\n assert.deepEqual(candidate(\"asdfghjkl\"),\"ewhjklnop\");\n assert.deepEqual(candidate(\"gf\"),\"kj\");\n assert.deepEqual(candidate(\"et\"),\"ix\");\n assert.deepEqual(candidate(\"faewfawefaewg\"),\"jeiajeaijeiak\");\n assert.deepEqual(candidate(\"hellomyfriend\"),\"lippsqcjvmirh\");\n assert.deepEqual(candidate(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\"),\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\");\n assert.deepEqual(candidate(\"a\"),\"e\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "js", - "prompt": "//Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n// The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n// as follows: start with any positive integer n. Then each term is obtained from the \n// previous term as follows: if the previous term is even, the next term is one half of \n// the previous term. If the previous term is odd, the next term is 3 times the previous\n// term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n// Note: \n// 1. Collatz(1) is [1].\n// 2. returned list sorted in increasing order.\n// For example:\n// get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\nfunction get_odd_collatz(n){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_odd_collatz;\n assert.deepEqual(candidate(14),[1, 5, 7, 11, 13, 17]);\n assert.deepEqual(candidate(5),[1, 5]);\n assert.deepEqual(candidate(12),[1, 3, 5]);\n assert.deepEqual(candidate(1),[1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "js", - "prompt": "//Find how many times a given substring can be found in the original string. Count overlaping cases.\n// >>> how_many_times('', 'a')\n// 0\n// >>> how_many_times('aaa', 'a')\n// 3\n// >>> how_many_times('aaaa', 'aa')\n// 3\nfunction how_many_times(string, substring){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = how_many_times;\n assert.deepEqual(candidate(\"\", \"x\"),0);\n assert.deepEqual(candidate(\"xyxyxyx\", \"x\"),4);\n assert.deepEqual(candidate(\"cacacacac\", \"cac\"),4);\n assert.deepEqual(candidate(\"john doe\", \"john\"),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "js", - "prompt": "//We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n// numbers in the array will be randomly ordered. Your task is to determine if\n// it is possible to get an array sorted in non-decreasing order by performing \n// the following operation on the given array:\n// You are allowed to perform right shift operation any number of times.\n// One right shift operation means shifting all elements of the array by one\n// position in the right direction. The last element of the array will be moved to\n// the starting position in the array i.e. 0th index. \n// If it is possible to obtain the sorted array by performing the above operation\n// then return True else return False.\n// If the given array is empty then return True.\n// Note: The given list is guaranteed to have unique elements.\n// For Example:\n// move_one_ball([3, 4, 5, 1, 2])==>True\n// Explanation: By performin 2 right shift operations, non-decreasing order can\n// be achieved for the given array.\n// move_one_ball([3, 5, 4, 1, 2])==>False\n// Explanation:It is not possible to get non-decreasing order for the given\n// array by performing any number of right shift operations.\nfunction move_one_ball(arr){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = move_one_ball;\n assert.deepEqual(candidate([3, 4, 5, 1, 2]),true);\n assert.deepEqual(candidate([3, 5, 10, 1, 2]),true);\n assert.deepEqual(candidate([4, 3, 1, 2]),false);\n assert.deepEqual(candidate([3, 5, 4, 1, 2]),false);\n assert.deepEqual(candidate([]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "js", - "prompt": "//Write a function which sorts the given list of integers\n// in ascending order according to the sum of their digits.\n// Note: if there are several items with similar sum of their digits,\n// order them based on their index in original list.\n// For example:\n// >>> order_by_points([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]\n// >>> order_by_points([]) == []\nfunction order_by_points(nums){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = order_by_points;\n assert.deepEqual(candidate([1, 11, -1, -11, -12]),[-1, -11, 1, -12, 11]);\n assert.deepEqual(candidate([1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]),[0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, -11, -32, 43, 54, -98, 2, -3]),[-3, -32, -98, -11, 1, 2, 43, 54]);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]),[1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9]);\n assert.deepEqual(candidate([0, 6, 6, -76, -21, 23, 4]),[-76, -21, 0, 4, 23, 6, 6]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "js", - "prompt": "//Return list of prime factors of given integer in the order from smallest to largest.\n// Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n// Input number should be equal to the product of all factors\n// >>> factorize(8)\n// [2, 2, 2]\n// >>> factorize(25)\n// [5, 5]\n// >>> factorize(70)\n// [2, 5, 7]\nfunction factorize(n){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = factorize;\n assert.deepEqual(candidate(2),[2]);\n assert.deepEqual(candidate(4),[2, 2]);\n assert.deepEqual(candidate(8),[2, 2, 2]);\n assert.deepEqual(candidate(57),[3, 19]);\n assert.deepEqual(candidate(3249),[3, 3, 19, 19]);\n assert.deepEqual(candidate(185193),[3, 3, 3, 19, 19, 19]);\n assert.deepEqual(candidate(20577),[3, 19, 19, 19]);\n assert.deepEqual(candidate(18),[2, 3, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "js", - "prompt": "//Return True if all numbers in the list l are below threshold t.\n// >>> below_threshold([1, 2, 4, 10], 100)\n// True\n// >>> below_threshold([1, 20, 4, 10], 5)\n// False\nfunction below_threshold(l, t){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = below_threshold;\n assert.deepEqual(candidate([1, 2, 4, 10], 100),true);\n assert.deepEqual(candidate([1, 20, 4, 10], 5),false);\n assert.deepEqual(candidate([1, 20, 4, 10], 21),true);\n assert.deepEqual(candidate([1, 20, 4, 10], 22),true);\n assert.deepEqual(candidate([1, 8, 4, 10], 11),true);\n assert.deepEqual(candidate([1, 8, 4, 10], 10),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "js", - "prompt": "//You are given two positive integers n and m, and your task is to compute the\n// average of the integers from n through m (including n and m). \n// Round the answer to the nearest integer and convert that to binary.\n// If n is greater than m, return -1.\n// Example:\n// rounded_avg(1, 5) => \"0b11\"\n// rounded_avg(7, 5) => -1\n// rounded_avg(10, 20) => \"0b1111\"\n// rounded_avg(20, 33) => \"0b11010\"\nfunction rounded_avg(n, m){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = rounded_avg;\n assert.deepEqual(candidate(1, 5),\"0b11\");\n assert.deepEqual(candidate(7, 13),\"0b1010\");\n assert.deepEqual(candidate(964, 977),\"0b1111001010\");\n assert.deepEqual(candidate(996, 997),\"0b1111100100\");\n assert.deepEqual(candidate(560, 851),\"0b1011000010\");\n assert.deepEqual(candidate(185, 546),\"0b101101110\");\n assert.deepEqual(candidate(362, 496),\"0b110101101\");\n assert.deepEqual(candidate(350, 902),\"0b1001110010\");\n assert.deepEqual(candidate(197, 233),\"0b11010111\");\n assert.deepEqual(candidate(7, 5),-1);\n assert.deepEqual(candidate(5, 1),-1);\n assert.deepEqual(candidate(5, 5),\"0b101\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "js", - "prompt": "//Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n// For each of the group, output the deepest level of nesting of parentheses.\n// E.g. (()()) has maximum two levels of nesting while ((())) has three.\n// >>> parse_nested_parens('(()()) ((())) () ((())()())')\n// [2, 3, 1, 3]\nfunction parse_nested_parens(paren_string){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = parse_nested_parens;\n assert.deepEqual(candidate(\"(()()) ((())) () ((())()())\"),[2, 3, 1, 3]);\n assert.deepEqual(candidate(\"() (()) ((())) (((())))\"),[1, 2, 3, 4]);\n assert.deepEqual(candidate(\"(()(())((())))\"),[4]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "js", - "prompt": "//Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n// Examples\n// solution([5, 8, 7, 1]) ==> 12\n// solution([3, 3, 3, 3, 3]) ==> 9\n// solution([30, 13, 24, 321]) ==>0\nfunction solution(lst){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = solution;\n assert.deepEqual(candidate([5, 8, 7, 1]),12);\n assert.deepEqual(candidate([3, 3, 3, 3, 3]),9);\n assert.deepEqual(candidate([30, 13, 24, 321]),0);\n assert.deepEqual(candidate([5, 9]),5);\n assert.deepEqual(candidate([2, 4, 8]),0);\n assert.deepEqual(candidate([30, 13, 23, 32]),23);\n assert.deepEqual(candidate([3, 13, 2, 9]),3);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "js", - "prompt": "//You are given a positive integer n. You have to create an integer array a of length n.\n// For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n// Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n// and a[i] + a[j] + a[k] is a multiple of 3.\n// Example :\n// Input: n = 5\n// Output: 1\n// Explanation: \n// a = [1, 3, 7, 13, 21]\n// The only valid triple is (1, 7, 13).\nfunction get_max_triples(n){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_max_triples;\n assert.deepEqual(candidate(5),1);\n assert.deepEqual(candidate(6),4);\n assert.deepEqual(candidate(10),36);\n assert.deepEqual(candidate(100),53361);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "js", - "prompt": "//There are eight planets in our solar system: the closerst to the Sun \n// is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n// Uranus, Neptune.\n// Write a function that takes two planet names as strings planet1 and planet2. \n// The function should return a tuple containing all planets whose orbits are \n// located between the orbit of planet1 and the orbit of planet2, sorted by \n// the proximity to the sun. \n// The function should return an empty tuple if planet1 or planet2\n// are not correct planet names. \n// Examples\n// bf(\"Jupiter\", \"Neptune\") ==> (\"Saturn\", \"Uranus\")\n// bf(\"Earth\", \"Mercury\") ==> (\"Venus\")\n// bf(\"Mercury\", \"Uranus\") ==> (\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\")\nfunction bf(planet1, planet2){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = bf;\n assert.deepEqual(candidate(\"Jupiter\", \"Neptune\"),[\"Saturn\", \"Uranus\"]);\n assert.deepEqual(candidate(\"Earth\", \"Mercury\"),[\"Venus\"]);\n assert.deepEqual(candidate(\"Mercury\", \"Uranus\"),[\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"]);\n assert.deepEqual(candidate(\"Neptune\", \"Venus\"),[\"Earth\", \"Mars\", \"Jupiter\", \"Saturn\", \"Uranus\"]);\n assert.deepEqual(candidate(\"Earth\", \"Earth\"),[]);\n assert.deepEqual(candidate(\"Mars\", \"Earth\"),[]);\n assert.deepEqual(candidate(\"Jupiter\", \"Makemake\"),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "js", - "prompt": "//You are given a list of integers.\n// Write a function next_smallest() that returns the 2nd smallest element of the list.\n// Return None if there is no such element.\n// next_smallest([1, 2, 3, 4, 5]) == 2\n// next_smallest([5, 1, 4, 3, 2]) == 2\n// next_smallest([]) == None\n// next_smallest([1, 1]) == None\nfunction next_smallest(lst){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = next_smallest;\n assert.deepEqual(candidate([1, 2, 3, 4, 5]),2);\n assert.deepEqual(candidate([5, 1, 4, 3, 2]),2);\n assert.deepEqual(candidate([]),undefined);\n assert.deepEqual(candidate([1, 1]),undefined);\n assert.deepEqual(candidate([1, 1, 1, 1, 0]),1);\n assert.deepEqual(candidate([1, 1]),undefined);\n assert.deepEqual(candidate([-35, 34, 12, -45]),-35);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "js", - "prompt": "//Input is a space-delimited string of numberals from 'zero' to 'nine'.\n// Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n// Return the string with numbers sorted from smallest to largest\n// >>> sort_numbers('three one five')\n// 'one three five'\nfunction sort_numbers(numbers){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_numbers;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"three\"),\"three\");\n assert.deepEqual(candidate(\"three five nine\"),\"three five nine\");\n assert.deepEqual(candidate(\"five zero four seven nine eight\"),\"zero four five seven eight nine\");\n assert.deepEqual(candidate(\"six five four three two one zero\"),\"zero one two three four five six\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "js", - "prompt": "//You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n// cycpattern_check(\"abcd\",\"abd\") => False\n// cycpattern_check(\"hello\",\"ell\") => True\n// cycpattern_check(\"whassup\",\"psus\") => False\n// cycpattern_check(\"abab\",\"baa\") => True\n// cycpattern_check(\"efef\",\"eeff\") => False\n// cycpattern_check(\"himenss\",\"simen\") => True\nfunction cycpattern_check(a, b){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = cycpattern_check;\n assert.deepEqual(candidate(\"xyzw\", \"xyw\"),false);\n assert.deepEqual(candidate(\"yello\", \"ell\"),true);\n assert.deepEqual(candidate(\"whattup\", \"ptut\"),false);\n assert.deepEqual(candidate(\"efef\", \"fee\"),true);\n assert.deepEqual(candidate(\"abab\", \"aabb\"),false);\n assert.deepEqual(candidate(\"winemtt\", \"tinem\"),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "js", - "prompt": "//You will be given a number in decimal form and your task is to convert it to\n// binary format. The function should return a string, with each character representing a binary\n// number. Each character in the string will be '0' or '1'.\n// There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n// The extra characters are there to help with the format.\n// Examples:\n// decimal_to_binary(15) # returns \"db1111db\"\n// decimal_to_binary(32) # returns \"db100000db\"\nfunction decimal_to_binary(decimal){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = decimal_to_binary;\n assert.deepEqual(candidate(0),\"db0db\");\n assert.deepEqual(candidate(32),\"db100000db\");\n assert.deepEqual(candidate(103),\"db1100111db\");\n assert.deepEqual(candidate(15),\"db1111db\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "js", - "prompt": "//Filter an input list of strings only for ones that contain given substring\n// >>> filter_by_substring([], 'a')\n// []\n// >>> filter_by_substring(['abc', 'bacd', 'cde', 'array'], 'a')\n// ['abc', 'bacd', 'array']\nfunction filter_by_substring(strings, substring){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = filter_by_substring;\n assert.deepEqual(candidate([], \"john\"),[]);\n assert.deepEqual(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"),[\"xxx\", \"xxxAAA\", \"xxx\"]);\n assert.deepEqual(candidate([\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xx\"),[\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"]);\n assert.deepEqual(candidate([\"grunt\", \"trumpet\", \"prune\", \"gruesome\"], \"run\"),[\"grunt\", \"prune\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "js", - "prompt": "//Given an integer. return a tuple that has the number of even and odd digits respectively.\n// Example:\n// even_odd_count(-12) ==> (1, 1)\n// even_odd_count(123) ==> (1, 2)\nfunction even_odd_count(num){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = even_odd_count;\n assert.deepEqual(candidate(7),[0, 1]);\n assert.deepEqual(candidate(-78),[1, 1]);\n assert.deepEqual(candidate(3452),[2, 2]);\n assert.deepEqual(candidate(346211),[3, 3]);\n assert.deepEqual(candidate(-345821),[3, 3]);\n assert.deepEqual(candidate(-2),[1, 0]);\n assert.deepEqual(candidate(-45347),[2, 3]);\n assert.deepEqual(candidate(0),[1, 0]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "js", - "prompt": "//Write a function that accepts a list of strings.\n// The list contains different words. Return the word with maximum number\n// of unique characters. If multiple strings have maximum number of unique\n// characters, return the one which comes first in lexicographical order.\n// find_max([\"name\", \"of\", \"string\"]) == \"string\"\n// find_max([\"name\", \"enam\", \"game\"]) == \"enam\"\n// find_max([\"aaaaaaa\", \"bb\" ,\"cc\"]) == \"\"aaaaaaa\"\nfunction find_max(words){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = find_max;\n assert.deepEqual(candidate([\"name\", \"of\", \"string\"]),\"string\");\n assert.deepEqual(candidate([\"name\", \"enam\", \"game\"]),\"enam\");\n assert.deepEqual(candidate([\"aaaaaaa\", \"bb\", \"cc\"]),\"aaaaaaa\");\n assert.deepEqual(candidate([\"abc\", \"cba\"]),\"abc\");\n assert.deepEqual(candidate([\"play\", \"this\", \"game\", \"of\", \"footbott\"]),\"footbott\");\n assert.deepEqual(candidate([\"we\", \"are\", \"gonna\", \"rock\"]),\"gonna\");\n assert.deepEqual(candidate([\"we\", \"are\", \"a\", \"mad\", \"nation\"]),\"nation\");\n assert.deepEqual(candidate([\"this\", \"is\", \"a\", \"prrk\"]),\"this\");\n assert.deepEqual(candidate([\"b\"]),\"b\");\n assert.deepEqual(candidate([\"play\", \"play\", \"play\"]),\"play\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "js", - "prompt": "//Given a positive integer n, return the count of the numbers of n-digit\n// positive integers that start or end with 1.\nfunction starts_one_ends(n){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = starts_one_ends;\n assert.deepEqual(candidate(1),1);\n assert.deepEqual(candidate(2),18);\n assert.deepEqual(candidate(3),180);\n assert.deepEqual(candidate(4),1800);\n assert.deepEqual(candidate(5),18000);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "js", - "prompt": "//Create a function that returns a tuple (a, b), where 'a' is\n// the largest of negative integers, and 'b' is the smallest\n// of positive integers in a list.\n// If there is no negative or positive integers, return them as None.\n// Examples:\n// largest_smallest_integers([2, 4, 1, 3, 5, 7]) == (None, 1)\n// largest_smallest_integers([]) == (None, None)\n// largest_smallest_integers([0]) == (None, None)\nfunction largest_smallest_integers(lst){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = largest_smallest_integers;\n assert.deepEqual(candidate([2, 4, 1, 3, 5, 7]),[undefined, 1]);\n assert.deepEqual(candidate([2, 4, 1, 3, 5, 7, 0]),[undefined, 1]);\n assert.deepEqual(candidate([1, 3, 2, 4, 5, 6, -2]),[-2, 1]);\n assert.deepEqual(candidate([4, 5, 3, 6, 2, 7, -7]),[-7, 2]);\n assert.deepEqual(candidate([7, 3, 8, 4, 9, 2, 5, -9]),[-9, 2]);\n assert.deepEqual(candidate([]),[undefined, undefined]);\n assert.deepEqual(candidate([0]),[undefined, undefined]);\n assert.deepEqual(candidate([-1, -3, -5, -6]),[-1, undefined]);\n assert.deepEqual(candidate([-1, -3, -5, -6, 0]),[-1, undefined]);\n assert.deepEqual(candidate([-6, -4, -4, -3, 1]),[-3, 1]);\n assert.deepEqual(candidate([-6, -4, -4, -3, -100, 1]),[-3, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "js", - "prompt": "//\"Given an array representing a branch of a tree that has non-negative integer nodes\n// your task is to pluck one of the nodes and return it.\n// The plucked node should be the node with the smallest even value.\n// If multiple nodes with the same smallest even value are found return the node that has smallest index.\n// The plucked node should be returned in a list, [ smalest_value, its index ],\n// If there are no even values or the given array is empty, return [].\n// Example 1:\n// Input: [4,2,3]\n// Output: [2, 1]\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 2:\n// Input: [1,2,3]\n// Output: [2, 1]\n// Explanation: 2 has the smallest even value, and 2 has the smallest index. \n// Example 3:\n// Input: []\n// Output: []\n// Example 4:\n// Input: [5, 0, 3, 0, 4, 2]\n// Output: [0, 1]\n// Explanation: 0 is the smallest value, but there are two zeros,\n// so we will choose the first zero, which has the smallest index.\n// Constraints:\n// * 1 <= nodes.length <= 10000\n// * 0 <= node.value\nfunction pluck(arr){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = pluck;\n assert.deepEqual(candidate([4, 2, 3]),[2, 1]);\n assert.deepEqual(candidate([1, 2, 3]),[2, 1]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([5, 0, 3, 0, 4, 2]),[0, 1]);\n assert.deepEqual(candidate([1, 2, 3, 0, 5, 3]),[0, 3]);\n assert.deepEqual(candidate([5, 4, 8, 4, 8]),[4, 1]);\n assert.deepEqual(candidate([7, 6, 7, 1]),[6, 1]);\n assert.deepEqual(candidate([7, 9, 7, 1]),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "js", - "prompt": "//Write a function count_nums which takes an array of integers and returns\n// the number of elements which has a sum of digits > 0.\n// If a number is negative, then its first signed digit will be negative:\n// e.g. -123 has signed digits -1, 2, and 3.\n// >>> count_nums([]) == 0\n// >>> count_nums([-1, 11, -11]) == 1\n// >>> count_nums([1, 1, 2]) == 3\nfunction count_nums(arr){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_nums;\n assert.deepEqual(candidate([]),0);\n assert.deepEqual(candidate([-1, -2, 0]),0);\n assert.deepEqual(candidate([1, 1, 2, -2, 3, 4, 5]),6);\n assert.deepEqual(candidate([1, 6, 9, -6, 0, 1, 5]),5);\n assert.deepEqual(candidate([1, 100, 98, -7, 1, -1]),4);\n assert.deepEqual(candidate([12, 23, 34, -45, -56, 0]),5);\n assert.deepEqual(candidate([0, 1]),1);\n assert.deepEqual(candidate([1]),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "js", - "prompt": "//Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n// each cell of the grid contains a value. Every integer in the range [1, N * N]\n// inclusive appears exactly once on the cells of the grid.\n// You have to find the minimum path of length k in the grid. You can start\n// from any cell, and in each step you can move to any of the neighbor cells,\n// in other words, you can go to cells which share an edge with you current\n// cell.\n// Please note that a path of length k means visiting exactly k cells (not\n// necessarily distinct).\n// You CANNOT go off the grid.\n// A path A (of length k) is considered less than a path B (of length k) if\n// after making the ordered lists of the values on the cells that A and B go\n// through (let's call them lst_A and lst_B), lst_A is lexicographically less\n// than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n// such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n// lst_A[j] = lst_B[j].\n// It is guaranteed that the answer is unique.\n// Return an ordered list of the values on the cells that the minimum path go through.\n// Examples:\n// Input: grid = [ [1,2,3], [4,5,6], [7,8,9]], k = 3\n// Output: [1, 2, 1]\n// Input: grid = [ [5,9,3], [4,1,6], [7,8,2]], k = 1\n// Output: [1]\nfunction minPath(grid, k){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = minPath;\n assert.deepEqual(candidate([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3),[1, 2, 1]);\n assert.deepEqual(candidate([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1),[1]);\n assert.deepEqual(candidate([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], 4),[1, 2, 1, 2]);\n assert.deepEqual(candidate([[6, 4, 13, 10], [5, 7, 12, 1], [3, 16, 11, 15], [8, 14, 9, 2]], 7),[1, 10, 1, 10, 1, 10, 1]);\n assert.deepEqual(candidate([[8, 14, 9, 2], [6, 4, 13, 15], [5, 7, 1, 12], [3, 10, 11, 16]], 5),[1, 7, 1, 7, 1]);\n assert.deepEqual(candidate([[11, 8, 7, 2], [5, 16, 14, 4], [9, 3, 15, 6], [12, 13, 10, 1]], 9),[1, 6, 1, 6, 1, 6, 1, 6, 1]);\n assert.deepEqual(candidate([[12, 13, 10, 1], [9, 3, 15, 6], [5, 16, 14, 4], [11, 8, 7, 2]], 12),[1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6]);\n assert.deepEqual(candidate([[2, 7, 4], [3, 1, 5], [6, 8, 9]], 8),[1, 3, 1, 3, 1, 3, 1, 3]);\n assert.deepEqual(candidate([[6, 1, 5], [3, 8, 9], [2, 7, 4]], 8),[1, 5, 1, 5, 1, 5, 1, 5]);\n assert.deepEqual(candidate([[1, 2], [3, 4]], 10),[1, 2, 1, 2, 1, 2, 1, 2, 1, 2]);\n assert.deepEqual(candidate([[1, 3], [3, 2]], 10),[1, 3, 1, 3, 1, 3, 1, 3, 1, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "js", - "prompt": "//Given list of integers, return list in strange order.\n// Strange sorting, is when you start with the minimum value,\n// then maximum of the remaining integers, then minimum and so on.\n// Examples:\n// strange_sort_list([1, 2, 3, 4]) == [1, 4, 2, 3]\n// strange_sort_list([5, 5, 5, 5]) == [5, 5, 5, 5]\n// strange_sort_list([]) == []\nfunction strange_sort_list(lst){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = strange_sort_list;\n assert.deepEqual(candidate([1, 2, 3, 4]),[1, 4, 2, 3]);\n assert.deepEqual(candidate([5, 6, 7, 8, 9]),[5, 9, 6, 8, 7]);\n assert.deepEqual(candidate([1, 2, 3, 4, 5]),[1, 5, 2, 4, 3]);\n assert.deepEqual(candidate([5, 6, 7, 8, 9, 1]),[1, 9, 5, 8, 6, 7]);\n assert.deepEqual(candidate([5, 5, 5, 5]),[5, 5, 5, 5]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6, 7, 8]),[1, 8, 2, 7, 3, 6, 4, 5]);\n assert.deepEqual(candidate([0, 2, 2, 2, 5, 5, -5, -5]),[-5, 5, -5, 5, 0, 2, 2, 2]);\n assert.deepEqual(candidate([111111]),[111111]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "js", - "prompt": "//Given a string 'text', return its md5 hash equivalent string.\n// If 'text' is an empty string, return None.\n// >>> string_to_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'\nfunction string_to_md5(text){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = string_to_md5;\n assert.deepEqual(candidate(\"Hello world\"),\"3e25960a79dbc69b674cd4ec67a72c62\");\n assert.deepEqual(candidate(\"\"),undefined);\n assert.deepEqual(candidate(\"A B C\"),\"0ef78513b0cb8cef12743f5aeb35f888\");\n assert.deepEqual(candidate(\"password\"),\"5f4dcc3b5aa765d61d8327deb882cf99\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "js", - "prompt": "//You are given a word. Your task is to find the closest vowel that stands between \n// two consonants from the right side of the word (case sensitive).\n// Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n// find any vowel met the above condition. \n// You may assume that the given string contains English letter only.\n// Example:\n// get_closest_vowel(\"yogurt\") ==> \"u\"\n// get_closest_vowel(\"FULL\") ==> \"U\"\n// get_closest_vowel(\"quick\") ==> \"\"\n// get_closest_vowel(\"ab\") ==> \"\"\nfunction get_closest_vowel(word){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_closest_vowel;\n assert.deepEqual(candidate(\"yogurt\"),\"u\");\n assert.deepEqual(candidate(\"full\"),\"u\");\n assert.deepEqual(candidate(\"easy\"),\"\");\n assert.deepEqual(candidate(\"eAsy\"),\"\");\n assert.deepEqual(candidate(\"ali\"),\"\");\n assert.deepEqual(candidate(\"bad\"),\"a\");\n assert.deepEqual(candidate(\"most\"),\"o\");\n assert.deepEqual(candidate(\"ab\"),\"\");\n assert.deepEqual(candidate(\"ba\"),\"\");\n assert.deepEqual(candidate(\"quick\"),\"\");\n assert.deepEqual(candidate(\"anime\"),\"i\");\n assert.deepEqual(candidate(\"Asia\"),\"\");\n assert.deepEqual(candidate(\"Above\"),\"o\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "js", - "prompt": "//Change numerical base of input number x to base.\n// return string representation after the conversion.\n// base numbers are less than 10.\n// >>> change_base(8, 3)\n// '22'\n// >>> change_base(8, 2)\n// '1000'\n// >>> change_base(7, 2)\n// '111'\nfunction change_base(x, base){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = change_base;\n assert.deepEqual(candidate(8, 3),\"22\");\n assert.deepEqual(candidate(9, 3),\"100\");\n assert.deepEqual(candidate(234, 2),\"11101010\");\n assert.deepEqual(candidate(16, 2),\"10000\");\n assert.deepEqual(candidate(8, 2),\"1000\");\n assert.deepEqual(candidate(7, 2),\"111\");\n assert.deepEqual(candidate(2, 3),\"2\");\n assert.deepEqual(candidate(3, 4),\"3\");\n assert.deepEqual(candidate(4, 5),\"4\");\n assert.deepEqual(candidate(5, 6),\"5\");\n assert.deepEqual(candidate(6, 7),\"6\");\n assert.deepEqual(candidate(7, 8),\"7\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "js", - "prompt": "//Check if in given list of numbers, are any two numbers closer to each other than\n// given threshold.\n// >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n// False\n// >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n// True\nfunction has_close_elements(numbers, threshold){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = has_close_elements;\n assert.deepEqual(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3),true);\n assert.deepEqual(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05),false);\n assert.deepEqual(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.95),true);\n assert.deepEqual(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.8),false);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1),true);\n assert.deepEqual(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 1.0),true);\n assert.deepEqual(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 0.5),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "js", - "prompt": "//Create a function that takes a string as input which contains only square brackets.\n// The function should return True if and only if there is a valid subsequence of brackets \n// where at least one bracket in the subsequence is nested.\n// is_nested('[[]]') \u279e True\n// is_nested('[]]]]]]][[[[[]') \u279e False\n// is_nested('[][]') \u279e False\n// is_nested('[]') \u279e False\n// is_nested('[[][]]') \u279e True\n// is_nested('[[]][[') \u279e True\nfunction is_nested(string){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_nested;\n assert.deepEqual(candidate(\"[[]]\"),true);\n assert.deepEqual(candidate(\"[]]]]]]][[[[[]\"),false);\n assert.deepEqual(candidate(\"[][]\"),false);\n assert.deepEqual(candidate(\"[]\"),false);\n assert.deepEqual(candidate(\"[[[[]]]]\"),true);\n assert.deepEqual(candidate(\"[]]]]]]]]]]\"),false);\n assert.deepEqual(candidate(\"[][][[]]\"),true);\n assert.deepEqual(candidate(\"[[]\"),false);\n assert.deepEqual(candidate(\"[]]\"),false);\n assert.deepEqual(candidate(\"[[]][[\"),true);\n assert.deepEqual(candidate(\"[[][]]\"),true);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"[[[[[[[[\"),false);\n assert.deepEqual(candidate(\"]]]]]]]]\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "js", - "prompt": "//Concatenate list of strings into a single string\n// >>> concatenate([])\n// ''\n// >>> concatenate(['a', 'b', 'c'])\n// 'abc'\nfunction concatenate(strings){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = concatenate;\n assert.deepEqual(candidate([]),\"\");\n assert.deepEqual(candidate([\"x\", \"y\", \"z\"]),\"xyz\");\n assert.deepEqual(candidate([\"x\", \"y\", \"z\", \"w\", \"k\"]),\"xyzwk\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "js", - "prompt": "//prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n// >>> prime_fib(1)\n// 2\n// >>> prime_fib(2)\n// 3\n// >>> prime_fib(3)\n// 5\n// >>> prime_fib(4)\n// 13\n// >>> prime_fib(5)\n// 89\nfunction prime_fib(n){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = prime_fib;\n assert.deepEqual(candidate(1),2);\n assert.deepEqual(candidate(2),3);\n assert.deepEqual(candidate(3),5);\n assert.deepEqual(candidate(4),13);\n assert.deepEqual(candidate(5),89);\n assert.deepEqual(candidate(6),233);\n assert.deepEqual(candidate(7),1597);\n assert.deepEqual(candidate(8),28657);\n assert.deepEqual(candidate(9),514229);\n assert.deepEqual(candidate(10),433494437);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "js", - "prompt": "//From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n// other and return them in order (smaller number, larger number).\n// >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n// (2.0, 2.2)\n// >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n// (2.0, 2.0)\nfunction find_closest_elements(numbers){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = find_closest_elements;\n assert.deepEqual(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2]),[3.9, 4.0]);\n assert.deepEqual(candidate([1.0, 2.0, 5.9, 4.0, 5.0]),[5.0, 5.9]);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]),[2.0, 2.2]);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]),[2.0, 2.0]);\n assert.deepEqual(candidate([1.1, 2.2, 3.1, 4.1, 5.1]),[2.2, 3.1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "js", - "prompt": "//You have been tasked to write a function that receives \n// a hexadecimal number as a string and counts the number of hexadecimal \n// digits that are primes (prime number, or a prime, is a natural number \n// greater than 1 that is not a product of two smaller natural numbers).\n// Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n// Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n// So you have to determine a number of the following digits: 2, 3, 5, 7, \n// B (=decimal 11), D (=decimal 13).\n// Note: you may assume the input is always correct or empty string, \n// and symbols A,B,C,D,E,F are always uppercase.\n// Examples:\n// For num = \"AB\" the output should be 1.\n// For num = \"1077E\" the output should be 2.\n// For num = \"ABED1A33\" the output should be 4.\n// For num = \"123456789ABCDEF0\" the output should be 6.\n// For num = \"2020\" the output should be 2.\nfunction hex_key(num){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = hex_key;\n assert.deepEqual(candidate(\"AB\"),1);\n assert.deepEqual(candidate(\"1077E\"),2);\n assert.deepEqual(candidate(\"ABED1A33\"),4);\n assert.deepEqual(candidate(\"2020\"),2);\n assert.deepEqual(candidate(\"123456789ABCDEF0\"),6);\n assert.deepEqual(candidate(\"112233445566778899AABBCCDDEEFF00\"),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "js", - "prompt": "//Complete the function that takes two integers and returns \n// the product of their unit digits.\n// Assume the input is always valid.\n// Examples:\n// multiply(148, 412) should return 16.\n// multiply(19, 28) should return 72.\n// multiply(2020, 1851) should return 0.\n// multiply(14,-15) should return 20.\nfunction multiply(a, b){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = multiply;\n assert.deepEqual(candidate(148, 412),16);\n assert.deepEqual(candidate(19, 28),72);\n assert.deepEqual(candidate(2020, 1851),0);\n assert.deepEqual(candidate(14, -15),20);\n assert.deepEqual(candidate(76, 67),42);\n assert.deepEqual(candidate(17, 27),49);\n assert.deepEqual(candidate(0, 1),0);\n assert.deepEqual(candidate(0, 0),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "js", - "prompt": "//Given list of numbers (of at least two elements), apply a linear transform to that list,\n// such that the smallest number will become 0 and the largest will become 1\n// >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n// [0.0, 0.25, 0.5, 0.75, 1.0]\nfunction rescale_to_unit(numbers){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = rescale_to_unit;\n assert.deepEqual(candidate([2.0, 49.9]),[0.0, 1.0]);\n assert.deepEqual(candidate([100.0, 49.9]),[1.0, 0.0]);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0]),[0.0, 0.25, 0.5, 0.75, 1.0]);\n assert.deepEqual(candidate([2.0, 1.0, 5.0, 3.0, 4.0]),[0.25, 0.0, 1.0, 0.5, 0.75]);\n assert.deepEqual(candidate([12.0, 11.0, 15.0, 13.0, 14.0]),[0.25, 0.0, 1.0, 0.5, 0.75]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "js", - "prompt": "//Given a positive integer n, return the product of the odd digits.\n// Return 0 if all digits are even.\n// For example:\n// digits(1) == 1\n// digits(4) == 0\n// digits(235) == 15\nfunction digits(n){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = digits;\n assert.deepEqual(candidate(5),5);\n assert.deepEqual(candidate(54),5);\n assert.deepEqual(candidate(120),1);\n assert.deepEqual(candidate(5014),5);\n assert.deepEqual(candidate(98765),315);\n assert.deepEqual(candidate(5576543),2625);\n assert.deepEqual(candidate(2468),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "js", - "prompt": "//You will be given the name of a class (a string) and a list of extensions.\n// The extensions are to be used to load additional classes to the class. The\n// strength of the extension is as follows: Let CAP be the number of the uppercase\n// letters in the extension's name, and let SM be the number of lowercase letters \n// in the extension's name, the strength is given by the fraction CAP - SM. \n// You should find the strongest extension and return a string in this \n// format: ClassName.StrongestExtensionName.\n// If there are two or more extensions with the same strength, you should\n// choose the one that comes first in the list.\n// For example, if you are given \"Slices\" as the class and a list of the\n// extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n// return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n// (its strength is -1).\n// Example:\n// for Strongest_Extension('my_class', ['AA', 'Be', 'CC']) == 'my_class.AA'\nfunction Strongest_Extension(class_name, extensions){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = Strongest_Extension;\n assert.deepEqual(candidate(\"Watashi\", [\"tEN\", \"niNE\", \"eIGHt8OKe\"]),\"Watashi.eIGHt8OKe\");\n assert.deepEqual(candidate(\"Boku123\", [\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"]),\"Boku123.YEs.WeCaNe\");\n assert.deepEqual(candidate(\"__YESIMHERE\", [\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"]),\"__YESIMHERE.NuLl__\");\n assert.deepEqual(candidate(\"K\", [\"Ta\", \"TAR\", \"t234An\", \"cosSo\"]),\"K.TAR\");\n assert.deepEqual(candidate(\"__HAHA\", [\"Tab\", \"123\", \"781345\", \"-_-\"]),\"__HAHA.123\");\n assert.deepEqual(candidate(\"YameRore\", [\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"]),\"YameRore.okIWILL123\");\n assert.deepEqual(candidate(\"finNNalLLly\", [\"Die\", \"NowW\", \"Wow\", \"WoW\"]),\"finNNalLLly.WoW\");\n assert.deepEqual(candidate(\"_\", [\"Bb\", \"91245\"]),\"_.Bb\");\n assert.deepEqual(candidate(\"Sp\", [\"671235\", \"Bb\"]),\"Sp.671235\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "js", - "prompt": "//Given a string representing a space separated lowercase letters, return a dictionary\n// of the letter with the most repetition and containing the corresponding count.\n// If several letters have the same occurrence, return all of them.\n// Example:\n// histogram('a b c') == {'a': 1, 'b': 1, 'c': 1}\n// histogram('a b b a') == {'a': 2, 'b': 2}\n// histogram('a b c a b') == {'a': 2, 'b': 2}\n// histogram('b b b b a') == {'b': 4}\n// histogram('') == {}\nfunction histogram(test){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = histogram;\n assert.deepEqual(candidate(\"a b b a\"),{\"a\": 2, \"b\": 2});\n assert.deepEqual(candidate(\"a b c a b\"),{\"a\": 2, \"b\": 2});\n assert.deepEqual(candidate(\"a b c d g\"),{\"a\": 1, \"b\": 1, \"c\": 1, \"d\": 1, \"g\": 1});\n assert.deepEqual(candidate(\"r t g\"),{\"r\": 1, \"t\": 1, \"g\": 1});\n assert.deepEqual(candidate(\"b b b b a\"),{\"b\": 4});\n assert.deepEqual(candidate(\"r t g\"),{\"r\": 1, \"t\": 1, \"g\": 1});\n assert.deepEqual(candidate(\"\"),{});\n assert.deepEqual(candidate(\"a\"),{\"a\": 1});\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "js", - "prompt": "//pairs_sum_to_zero takes a list of integers as an input.\n// it returns True if there are two distinct elements in the list that\n// sum to zero, and False otherwise.\n// >>> pairs_sum_to_zero([1, 3, 5, 0])\n// False\n// >>> pairs_sum_to_zero([1, 3, -2, 1])\n// False\n// >>> pairs_sum_to_zero([1, 2, 3, 7])\n// False\n// >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7])\n// True\n// >>> pairs_sum_to_zero([1])\n// False\nfunction pairs_sum_to_zero(l){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = pairs_sum_to_zero;\n assert.deepEqual(candidate([1, 3, 5, 0]),false);\n assert.deepEqual(candidate([1, 3, -2, 1]),false);\n assert.deepEqual(candidate([1, 2, 3, 7]),false);\n assert.deepEqual(candidate([2, 4, -5, 3, 5, 7]),true);\n assert.deepEqual(candidate([1]),false);\n assert.deepEqual(candidate([-3, 9, -1, 3, 2, 30]),true);\n assert.deepEqual(candidate([-3, 9, -1, 3, 2, 31]),true);\n assert.deepEqual(candidate([-3, 9, -1, 4, 2, 30]),false);\n assert.deepEqual(candidate([-3, 9, -1, 4, 2, 31]),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "js", - "prompt": "//Write a function that accepts two lists of strings and returns the list that has \n// total number of chars in the all strings of the list less than the other list.\n// if the two lists have the same number of chars, return the first list.\n// Examples\n// total_match([], []) \u279e []\n// total_match(['hi', 'admin'], ['hI', 'Hi']) \u279e ['hI', 'Hi']\n// total_match(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) \u279e ['hi', 'admin']\n// total_match(['hi', 'admin'], ['hI', 'hi', 'hi']) \u279e ['hI', 'hi', 'hi']\n// total_match(['4'], ['1', '2', '3', '4', '5']) \u279e ['4']\nfunction total_match(lst1, lst2){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = total_match;\n assert.deepEqual(candidate([], []),[]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\"]),[\"hi\", \"hi\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"]),[\"hi\", \"admin\"]);\n assert.deepEqual(candidate([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"]),[\"4\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hI\", \"Hi\"]),[\"hI\", \"Hi\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"]),[\"hI\", \"hi\", \"hi\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hii\"]),[\"hi\", \"admin\"]);\n assert.deepEqual(candidate([], [\"this\"]),[]);\n assert.deepEqual(candidate([\"this\"], []),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "js", - "prompt": "//Circular shift the digits of the integer x, shift the digits right by shift\n// and return the result as a string.\n// If shift > number of digits, return digits reversed.\n// >>> circular_shift(12, 1)\n// \"21\"\n// >>> circular_shift(12, 2)\n// \"12\"\nfunction circular_shift(x, shift){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = circular_shift;\n assert.deepEqual(candidate(100, 2),\"001\");\n assert.deepEqual(candidate(12, 2),\"12\");\n assert.deepEqual(candidate(97, 8),\"79\");\n assert.deepEqual(candidate(12, 1),\"21\");\n assert.deepEqual(candidate(11, 101),\"11\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "js", - "prompt": "//Return True is list elements are monotonically increasing or decreasing.\n// >>> monotonic([1, 2, 4, 20])\n// True\n// >>> monotonic([1, 20, 4, 10])\n// False\n// >>> monotonic([4, 1, 0, -10])\n// True\nfunction monotonic(l){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = monotonic;\n assert.deepEqual(candidate([1, 2, 4, 10]),true);\n assert.deepEqual(candidate([1, 2, 4, 20]),true);\n assert.deepEqual(candidate([1, 20, 4, 10]),false);\n assert.deepEqual(candidate([4, 1, 0, -10]),true);\n assert.deepEqual(candidate([4, 1, 1, 0]),true);\n assert.deepEqual(candidate([1, 2, 3, 2, 5, 60]),false);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 60]),true);\n assert.deepEqual(candidate([9, 9, 9, 9]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "js", - "prompt": "//Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n// Example\n// is_equal_to_sum_even(4) == False\n// is_equal_to_sum_even(6) == False\n// is_equal_to_sum_even(8) == True\nfunction is_equal_to_sum_even(n){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_equal_to_sum_even;\n assert.deepEqual(candidate(4),false);\n assert.deepEqual(candidate(6),false);\n assert.deepEqual(candidate(8),true);\n assert.deepEqual(candidate(10),true);\n assert.deepEqual(candidate(11),false);\n assert.deepEqual(candidate(12),true);\n assert.deepEqual(candidate(13),false);\n assert.deepEqual(candidate(16),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "js", - "prompt": "//Input to this function is a string representing musical notes in a special ASCII format.\n// Your task is to parse this string and return list of integers corresponding to how many beats does each\n// not last.\n// Here is a legend:\n// 'o' - whole note, lasts four beats\n// 'o|' - half note, lasts two beats\n// '.|' - quater note, lasts one beat\n// >>> parse_music('o o| .| o| o| .| .| .| .| o o')\n// [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\nfunction parse_music(music_string){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = parse_music;\n assert.deepEqual(candidate(\"\"),[]);\n assert.deepEqual(candidate(\"o o o o\"),[4, 4, 4, 4]);\n assert.deepEqual(candidate(\".| .| .| .|\"),[1, 1, 1, 1]);\n assert.deepEqual(candidate(\"o| o| .| .| o o o o\"),[2, 2, 1, 1, 4, 4, 4, 4]);\n assert.deepEqual(candidate(\"o| .| o| .| o o| o o|\"),[2, 1, 2, 1, 4, 2, 4, 2]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "js", - "prompt": "//\"\n// This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n// multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n// change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n// Examples:\n// For lst = [1,2,3] the output should be 6\n// For lst = [] the output should be 0\n// For lst = [-1,-5,2,-1,-5] the output should be -126\nfunction sum_squares(lst){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_squares;\n assert.deepEqual(candidate([1, 2, 3]),6);\n assert.deepEqual(candidate([1, 4, 9]),14);\n assert.deepEqual(candidate([]),0);\n assert.deepEqual(candidate([1, 1, 1, 1, 1, 1, 1, 1, 1]),9);\n assert.deepEqual(candidate([-1, -1, -1, -1, -1, -1, -1, -1, -1]),-3);\n assert.deepEqual(candidate([0]),0);\n assert.deepEqual(candidate([-1, -5, 2, -1, -5]),-126);\n assert.deepEqual(candidate([-56, -99, 1, 0, -2]),3030);\n assert.deepEqual(candidate([-1, 0, 0, 0, 0, 0, 0, 0, -1]),0);\n assert.deepEqual(candidate([-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37]),-14196);\n assert.deepEqual(candidate([-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10]),-1448);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "js", - "prompt": "//triples_sum_to_zero takes a list of integers as an input.\n// it returns True if there are three distinct elements in the list that\n// sum to zero, and False otherwise.\n// >>> triples_sum_to_zero([1, 3, 5, 0])\n// False\n// >>> triples_sum_to_zero([1, 3, -2, 1])\n// True\n// >>> triples_sum_to_zero([1, 2, 3, 7])\n// False\n// >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n// True\n// >>> triples_sum_to_zero([1])\n// False\nfunction triples_sum_to_zero(l){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = triples_sum_to_zero;\n assert.deepEqual(candidate([1, 3, 5, 0]),false);\n assert.deepEqual(candidate([1, 3, 5, -1]),false);\n assert.deepEqual(candidate([1, 3, -2, 1]),true);\n assert.deepEqual(candidate([1, 2, 3, 7]),false);\n assert.deepEqual(candidate([1, 2, 5, 7]),false);\n assert.deepEqual(candidate([2, 4, -5, 3, 9, 7]),true);\n assert.deepEqual(candidate([1]),false);\n assert.deepEqual(candidate([1, 3, 5, -100]),false);\n assert.deepEqual(candidate([100, 3, 5, -100]),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "js", - "prompt": "//brackets is a string of \"<\" and \">\".\n// return True if every opening bracket has a corresponding closing bracket.\n// >>> correct_bracketing(\"<\")\n// False\n// >>> correct_bracketing(\"<>\")\n// True\n// >>> correct_bracketing(\"<<><>>\")\n// True\n// >>> correct_bracketing(\"><<>\")\n// False\nfunction correct_bracketing(brackets){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = correct_bracketing;\n assert.deepEqual(candidate(\"<>\"),true);\n assert.deepEqual(candidate(\"<<><>>\"),true);\n assert.deepEqual(candidate(\"<><><<><>><>\"),true);\n assert.deepEqual(candidate(\"<><><<<><><>><>><<><><<>>>\"),true);\n assert.deepEqual(candidate(\"<<<><>>>>\"),false);\n assert.deepEqual(candidate(\"><<>\"),false);\n assert.deepEqual(candidate(\"<\"),false);\n assert.deepEqual(candidate(\"<<<<\"),false);\n assert.deepEqual(candidate(\">\"),false);\n assert.deepEqual(candidate(\"<<>\"),false);\n assert.deepEqual(candidate(\"<><><<><>><>><<>\"),false);\n assert.deepEqual(candidate(\"<><><<><>><>>><>\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "js", - "prompt": "//Write a function that takes an array of numbers as input and returns \n// the number of elements in the array that are greater than 10 and both \n// first and last digits of a number are odd (1, 3, 5, 7, 9).\n// For example:\n// specialFilter([15, -73, 14, -15]) => 1 \n// specialFilter([33, -2, -3, 45, 21, 109]) => 2\nfunction specialFilter(nums){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = specialFilter;\n assert.deepEqual(candidate([5, -2, 1, -5]),0);\n assert.deepEqual(candidate([15, -73, 14, -15]),1);\n assert.deepEqual(candidate([33, -2, -3, 45, 21, 109]),2);\n assert.deepEqual(candidate([43, -12, 93, 125, 121, 109]),4);\n assert.deepEqual(candidate([71, -2, -33, 75, 21, 19]),3);\n assert.deepEqual(candidate([1]),0);\n assert.deepEqual(candidate([]),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "js", - "prompt": "//Given a dictionary, return True if all keys are strings in lower \n// case or all keys are strings in upper case, else return False.\n// The function should return False is the given dictionary is empty.\n// Examples:\n// check_dict_case({\"a\":\"apple\", \"b\":\"banana\"}) should return True.\n// check_dict_case({\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}) should return False.\n// check_dict_case({\"a\":\"apple\", \"8\":\"banana\", \"a\":\"apple\"}) should return False.\n// check_dict_case({\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}) should return False.\n// check_dict_case({\"STATE\":\"NC\", \"ZIP\":\"12345\" }) should return True.\nfunction check_dict_case(dict){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = check_dict_case;\n assert.deepEqual(candidate({\"p\": \"pineapple\", \"b\": \"banana\"}),true);\n assert.deepEqual(candidate({\"p\": \"pineapple\", \"A\": \"banana\", \"B\": \"banana\"}),false);\n assert.deepEqual(candidate({\"p\": \"pineapple\", \"5\": \"banana\", \"a\": \"apple\"}),false);\n assert.deepEqual(candidate({\"Name\": \"John\", \"Age\": \"36\", \"City\": \"Houston\"}),false);\n assert.deepEqual(candidate({\"STATE\": \"NC\", \"ZIP\": \"12345\"}),true);\n assert.deepEqual(candidate({\"fruit\": \"Orange\", \"taste\": \"Sweet\"}),true);\n assert.deepEqual(candidate({}),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "js", - "prompt": "//Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n// should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n// alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n// Examples\n// split_words(\"Hello world!\") \u279e [\"Hello\", \"world!\"]\n// split_words(\"Hello,world!\") \u279e [\"Hello\", \"world!\"]\n// split_words(\"abcdef\") == 3\nfunction split_words(txt){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = split_words;\n assert.deepEqual(candidate(\"Hello world!\"),[\"Hello\", \"world!\"]);\n assert.deepEqual(candidate(\"Hello,world!\"),[\"Hello\", \"world!\"]);\n assert.deepEqual(candidate(\"Hello world,!\"),[\"Hello\", \"world,!\"]);\n assert.deepEqual(candidate(\"Hello,Hello,world !\"),[\"Hello,Hello,world\", \"!\"]);\n assert.deepEqual(candidate(\"abcdef\"),3);\n assert.deepEqual(candidate(\"aaabb\"),2);\n assert.deepEqual(candidate(\"aaaBb\"),1);\n assert.deepEqual(candidate(\"\"),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "js", - "prompt": "//The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fibfib(0) == 0\n// fibfib(1) == 0\n// fibfib(2) == 1\n// fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n// Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n// >>> fibfib(1)\n// 0\n// >>> fibfib(5)\n// 4\n// >>> fibfib(8)\n// 24\nfunction fibfib(n){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fibfib;\n assert.deepEqual(candidate(2),1);\n assert.deepEqual(candidate(1),0);\n assert.deepEqual(candidate(5),4);\n assert.deepEqual(candidate(8),24);\n assert.deepEqual(candidate(10),81);\n assert.deepEqual(candidate(12),274);\n assert.deepEqual(candidate(14),927);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "js", - "prompt": "//You are given a list of numbers.\n// You need to return the sum of squared numbers in the given list,\n// round each element in the list to the upper int(Ceiling) first.\n// Examples:\n// For lst = [1,2,3] the output should be 14\n// For lst = [1,4,9] the output should be 98\n// For lst = [1,3,5,7] the output should be 84\n// For lst = [1.4,4.2,0] the output should be 29\n// For lst = [-2.4,1,1] the output should be 6\nfunction sum_squares(lst){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_squares;\n assert.deepEqual(candidate([1.0, 2.0, 3.0]),14);\n assert.deepEqual(candidate([1.0, 2.0, 3.0]),14);\n assert.deepEqual(candidate([1.0, 3.0, 5.0, 7.0]),84);\n assert.deepEqual(candidate([1.4, 4.2, 0.0]),29);\n assert.deepEqual(candidate([-2.4, 1.0, 1.0]),6);\n assert.deepEqual(candidate([100.0, 1.0, 15.0, 2.0]),10230);\n assert.deepEqual(candidate([10000.0, 10000.0]),200000000);\n assert.deepEqual(candidate([-1.4, 4.6, 6.3]),75);\n assert.deepEqual(candidate([-1.4, 17.9, 18.9, 19.9]),1086);\n assert.deepEqual(candidate([0.0]),0);\n assert.deepEqual(candidate([-1.0]),1);\n assert.deepEqual(candidate([-1.0, 1.0, 0.0]),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_85_add", - "language": "js", - "prompt": "//Given a non-empty list of integers lst. add the even elements that are at odd indices..\n// Examples:\n// add([4, 2, 6, 7]) ==> 2\nfunction add(lst){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = add;\n assert.deepEqual(candidate([4, 88]),88);\n assert.deepEqual(candidate([4, 5, 6, 7, 2, 122]),122);\n assert.deepEqual(candidate([4, 0, 6, 7]),0);\n assert.deepEqual(candidate([4, 4, 6, 8]),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "js", - "prompt": "//Return sorted unique elements in a list\n// >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123])\n// [0, 2, 3, 5, 9, 123]\nfunction unique(l){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = unique;\n assert.deepEqual(candidate([5, 3, 5, 2, 3, 3, 9, 0, 123]),[0, 2, 3, 5, 9, 123]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "js", - "prompt": "//Given a string text, replace all spaces in it with underscores, \n// and if a string has more than 2 consecutive spaces, \n// then replace all consecutive spaces with - \n// fix_spaces(\"Example\") == \"Example\"\n// fix_spaces(\"Example 1\") == \"Example_1\"\n// fix_spaces(\" Example 2\") == \"_Example_2\"\n// fix_spaces(\" Example 3\") == \"_Example-3\"\nfunction fix_spaces(text){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fix_spaces;\n assert.deepEqual(candidate(\"Example\"),\"Example\");\n assert.deepEqual(candidate(\"Mudasir Hanif \"),\"Mudasir_Hanif_\");\n assert.deepEqual(candidate(\"Yellow Yellow Dirty Fellow\"),\"Yellow_Yellow__Dirty__Fellow\");\n assert.deepEqual(candidate(\"Exa mple\"),\"Exa-mple\");\n assert.deepEqual(candidate(\" Exa 1 2 2 mple\"),\"-Exa_1_2_2_mple\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "js", - "prompt": "//Return 2^n modulo p (be aware of numerics).\n// >>> modp(3, 5)\n// 3\n// >>> modp(1101, 101)\n// 2\n// >>> modp(0, 101)\n// 1\n// >>> modp(3, 11)\n// 8\n// >>> modp(100, 101)\n// 1\nfunction modp(n, p){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = modp;\n assert.deepEqual(candidate(3, 5),3);\n assert.deepEqual(candidate(1101, 101),2);\n assert.deepEqual(candidate(0, 101),1);\n assert.deepEqual(candidate(3, 11),8);\n assert.deepEqual(candidate(100, 101),1);\n assert.deepEqual(candidate(30, 5),4);\n assert.deepEqual(candidate(31, 5),3);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "js", - "prompt": "//You have to write a function which validates a given date string and\n// returns True if the date is valid otherwise False.\n// The date is valid if all of the following rules are satisfied:\n// 1. The date string is not empty.\n// 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n// 3. The months should not be less than 1 or higher than 12.\n// 4. The date should be in the format: mm-dd-yyyy\n// for example: \n// valid_date('03-11-2000') => True\n// valid_date('15-01-2012') => False\n// valid_date('04-0-2040') => False\n// valid_date('06-04-2020') => True\n// valid_date('06/04/2020') => False\nfunction valid_date(date){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = valid_date;\n assert.deepEqual(candidate(\"03-11-2000\"),true);\n assert.deepEqual(candidate(\"15-01-2012\"),false);\n assert.deepEqual(candidate(\"04-0-2040\"),false);\n assert.deepEqual(candidate(\"06-04-2020\"),true);\n assert.deepEqual(candidate(\"01-01-2007\"),true);\n assert.deepEqual(candidate(\"03-32-2011\"),false);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"04-31-3000\"),false);\n assert.deepEqual(candidate(\"06-06-2005\"),true);\n assert.deepEqual(candidate(\"21-31-2000\"),false);\n assert.deepEqual(candidate(\"04-12-2003\"),true);\n assert.deepEqual(candidate(\"04122003\"),false);\n assert.deepEqual(candidate(\"20030412\"),false);\n assert.deepEqual(candidate(\"2003-04\"),false);\n assert.deepEqual(candidate(\"2003-04-12\"),false);\n assert.deepEqual(candidate(\"04-2003\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "js", - "prompt": "//Write a function that takes a string and returns an ordered version of it.\n// Ordered version of string, is a string where all words (separated by space)\n// are replaced by a new word where all the characters arranged in\n// ascending order based on ascii value.\n// Note: You should keep the order of words and blank spaces in the sentence.\n// For example:\n// anti_shuffle('Hi') returns 'Hi'\n// anti_shuffle('hello') returns 'ehllo'\n// anti_shuffle('Hello World!!!') returns 'Hello !!!Wdlor'\nfunction anti_shuffle(s){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = anti_shuffle;\n assert.deepEqual(candidate(\"Hi\"),\"Hi\");\n assert.deepEqual(candidate(\"hello\"),\"ehllo\");\n assert.deepEqual(candidate(\"number\"),\"bemnru\");\n assert.deepEqual(candidate(\"abcd\"),\"abcd\");\n assert.deepEqual(candidate(\"Hello World!!!\"),\"Hello !!!Wdlor\");\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"Hi. My name is Mister Robot. How are you?\"),\".Hi My aemn is Meirst .Rboot How aer ?ouy\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "js", - "prompt": "//Given a list of numbers, return whether or not they are sorted\n// in ascending order. If list has more than 1 duplicate of the same\n// number, return False. Assume no negative numbers and only integers.\n// Examples\n// is_sorted([5]) \u279e True\n// is_sorted([1, 2, 3, 4, 5]) \u279e True\n// is_sorted([1, 3, 2, 4, 5]) \u279e False\n// is_sorted([1, 2, 3, 4, 5, 6]) \u279e True\n// is_sorted([1, 2, 3, 4, 5, 6, 7]) \u279e True\n// is_sorted([1, 3, 2, 4, 5, 6, 7]) \u279e False\n// is_sorted([1, 2, 2, 3, 3, 4]) \u279e True\n// is_sorted([1, 2, 2, 2, 3, 4]) \u279e False\nfunction is_sorted(lst){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_sorted;\n assert.deepEqual(candidate([5]),true);\n assert.deepEqual(candidate([1, 2, 3, 4, 5]),true);\n assert.deepEqual(candidate([1, 3, 2, 4, 5]),false);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6]),true);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6, 7]),true);\n assert.deepEqual(candidate([1, 3, 2, 4, 5, 6, 7]),false);\n assert.deepEqual(candidate([]),true);\n assert.deepEqual(candidate([1]),true);\n assert.deepEqual(candidate([3, 2, 1]),false);\n assert.deepEqual(candidate([1, 2, 2, 2, 3, 4]),false);\n assert.deepEqual(candidate([1, 2, 3, 3, 3, 4]),false);\n assert.deepEqual(candidate([1, 2, 2, 3, 3, 4]),true);\n assert.deepEqual(candidate([1, 2, 3, 4]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "js", - "prompt": "//You are given a string s.\n// Your task is to check if the string is happy or not.\n// A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n// For example:\n// is_happy(a) => False\n// is_happy(aa) => False\n// is_happy(abcd) => True\n// is_happy(aabb) => False\n// is_happy(adb) => True\n// is_happy(xyy) => False\nfunction is_happy(s){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_happy;\n assert.deepEqual(candidate(\"a\"),false);\n assert.deepEqual(candidate(\"aa\"),false);\n assert.deepEqual(candidate(\"abcd\"),true);\n assert.deepEqual(candidate(\"aabb\"),false);\n assert.deepEqual(candidate(\"adb\"),true);\n assert.deepEqual(candidate(\"xyy\"),false);\n assert.deepEqual(candidate(\"iopaxpoi\"),true);\n assert.deepEqual(candidate(\"iopaxioi\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "js", - "prompt": "//Write a function that returns True if the object q will fly, and False otherwise.\n// The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n// Example:\n// will_it_fly([1, 2], 5) \u279e False \n// # 1+2 is less than the maximum possible weight, but it's unbalanced.\n// will_it_fly([3, 2, 3], 1) \u279e False\n// # it's balanced, but 3+2+3 is more than the maximum possible weight.\n// will_it_fly([3, 2, 3], 9) \u279e True\n// # 3+2+3 is less than the maximum possible weight, and it's balanced.\n// will_it_fly([3], 5) \u279e True\n// # 3 is less than the maximum possible weight, and it's balanced.\nfunction will_it_fly(q, w){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = will_it_fly;\n assert.deepEqual(candidate([3, 2, 3], 9),true);\n assert.deepEqual(candidate([1, 2], 5),false);\n assert.deepEqual(candidate([3], 5),true);\n assert.deepEqual(candidate([3, 2, 3], 1),false);\n assert.deepEqual(candidate([1, 2, 3], 6),false);\n assert.deepEqual(candidate([5], 5),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "js", - "prompt": "//Given an array of non-negative integers, return a copy of the given array after sorting,\n// you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n// or sort it in descending order if the sum( first index value, last index value) is even.\n// Note:\n// * don't change the given array.\n// Examples:\n// * sort_array([]) => []\n// * sort_array([5]) => [5]\n// * sort_array([2, 4, 3, 0, 1, 5]) => [0, 1, 2, 3, 4, 5]\n// * sort_array([2, 4, 3, 0, 1, 5, 6]) => [6, 5, 4, 3, 2, 1, 0]\nfunction sort_array(array){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_array;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([5]),[5]);\n assert.deepEqual(candidate([2, 4, 3, 0, 1, 5]),[0, 1, 2, 3, 4, 5]);\n assert.deepEqual(candidate([2, 4, 3, 0, 1, 5, 6]),[6, 5, 4, 3, 2, 1, 0]);\n assert.deepEqual(candidate([2, 1]),[1, 2]);\n assert.deepEqual(candidate([15, 42, 87, 32, 11, 0]),[0, 11, 15, 32, 42, 87]);\n assert.deepEqual(candidate([21, 14, 23, 11]),[23, 21, 14, 11]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "js", - "prompt": "//Implement a function that takes an non-negative integer and returns an array of the first n\n// integers that are prime numbers and less than n.\n// for example:\n// count_up_to(5) => [2,3]\n// count_up_to(11) => [2,3,5,7]\n// count_up_to(0) => []\n// count_up_to(20) => [2,3,5,7,11,13,17,19]\n// count_up_to(1) => []\n// count_up_to(18) => [2,3,5,7,11,13,17]\nfunction count_up_to(n){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_up_to;\n assert.deepEqual(candidate(5),[2, 3]);\n assert.deepEqual(candidate(6),[2, 3, 5]);\n assert.deepEqual(candidate(7),[2, 3, 5]);\n assert.deepEqual(candidate(10),[2, 3, 5, 7]);\n assert.deepEqual(candidate(0),[]);\n assert.deepEqual(candidate(22),[2, 3, 5, 7, 11, 13, 17, 19]);\n assert.deepEqual(candidate(1),[]);\n assert.deepEqual(candidate(18),[2, 3, 5, 7, 11, 13, 17]);\n assert.deepEqual(candidate(47),[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43]);\n assert.deepEqual(candidate(101),[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "js", - "prompt": "//Out of list of strings, return the longest one. Return the first one in case of multiple\n// strings of the same length. Return None in case the input list is empty.\n// >>> longest([])\n// >>> longest(['a', 'b', 'c'])\n// 'a'\n// >>> longest(['a', 'bb', 'ccc'])\n// 'ccc'\nfunction longest(strings){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = longest;\n assert.deepEqual(candidate([]),undefined);\n assert.deepEqual(candidate([\"x\", \"y\", \"z\"]),\"x\");\n assert.deepEqual(candidate([\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"]),\"zzzz\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "js", - "prompt": "//Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n// reverse the resulting array, and then replace each digit by its corresponding name from\n// \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n// For example:\n// arr = [2, 1, 1, 4, 5, 8, 2, 3] \n// -> sort arr -> [1, 1, 2, 2, 3, 4, 5, 8] \n// -> reverse arr -> [8, 5, 4, 3, 2, 2, 1, 1]\n// return [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n// If the array is empty, return an empty array:\n// arr = []\n// return []\n// If the array has any strange number ignore it:\n// arr = [1, -1 , 55] \n// -> sort arr -> [-1, 1, 55]\n// -> reverse arr -> [55, 1, -1]\n// return = ['One']\nfunction by_length(arr){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = by_length;\n assert.deepEqual(candidate([2, 1, 1, 4, 5, 8, 2, 3]),[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, -1, 55]),[\"One\"]);\n assert.deepEqual(candidate([1, -1, 3, 2]),[\"Three\", \"Two\", \"One\"]);\n assert.deepEqual(candidate([9, 4, 8]),[\"Nine\", \"Eight\", \"Four\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_106_f", - "language": "js", - "prompt": "//Implement the function f that takes n as a parameter,\n// 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\n// or the sum of numbers from 1 to i otherwise.\n// i starts from 1.\n// the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n// Example:\n// f(5) == [1, 2, 6, 24, 15]\nfunction f(n){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = f;\n assert.deepEqual(candidate(5),[1, 2, 6, 24, 15]);\n assert.deepEqual(candidate(7),[1, 2, 6, 24, 15, 720, 28]);\n assert.deepEqual(candidate(1),[1]);\n assert.deepEqual(candidate(3),[1, 2, 6]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "js", - "prompt": "//Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n// >>> fizz_buzz(50)\n// 0\n// >>> fizz_buzz(78)\n// 2\n// >>> fizz_buzz(79)\n// 3\nfunction fizz_buzz(n){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fizz_buzz;\n assert.deepEqual(candidate(50),0);\n assert.deepEqual(candidate(78),2);\n assert.deepEqual(candidate(79),3);\n assert.deepEqual(candidate(100),3);\n assert.deepEqual(candidate(200),6);\n assert.deepEqual(candidate(4000),192);\n assert.deepEqual(candidate(10000),639);\n assert.deepEqual(candidate(100000),8026);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "js", - "prompt": "//Given a positive floating point number, it can be decomposed into\n// and integer part (largest integer smaller than given number) and decimals\n// (leftover part always smaller than 1).\n// Return the decimal part of the number.\n// >>> truncate_number(3.5)\n// 0.5\nfunction truncate_number(number){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = truncate_number;\n assert.deepEqual(candidate(3.5),0.5);\n assert.deepEqual(candidate(1.25),0.25);\n assert.deepEqual(candidate(123.0),0.0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "js", - "prompt": "//For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n// Empty sum should be equal to 0 and empty product should be equal to 1.\n// >>> sum_product([])\n// (0, 1)\n// >>> sum_product([1, 2, 3, 4])\n// (10, 24)\nfunction sum_product(numbers){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_product;\n assert.deepEqual(candidate([]),[0, 1]);\n assert.deepEqual(candidate([1, 1, 1]),[3, 1]);\n assert.deepEqual(candidate([100, 0]),[100, 0]);\n assert.deepEqual(candidate([3, 5, 7]),[15, 105]);\n assert.deepEqual(candidate([10]),[10, 10]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "js", - "prompt": "//You are given a 2 dimensional data, as a nested lists,\n// which is similar to matrix, however, unlike matrices,\n// each row may contain a different number of columns.\n// Given lst, and integer x, find integers x in the list,\n// and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n// each tuple is a coordinate - (row, columns), starting with 0.\n// Sort coordinates initially by rows in ascending order.\n// Also, sort coordinates of the row by columns in descending order.\n// Examples:\n// get_row([\n// [1,2,3,4,5,6],\n// [1,2,3,4,1,6],\n// [1,2,3,4,5,1]\n// ], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n// get_row([], 1) == []\n// get_row([[], [1], [1, 2, 3]], 3) == [(2, 2)]\nfunction get_row(lst, x){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_row;\n assert.deepEqual(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1),[[0, 0], [1, 4], [1, 0], [2, 5], [2, 0]]);\n assert.deepEqual(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6]], 2),[[0, 1], [1, 1], [2, 1], [3, 1], [4, 1], [5, 1]]);\n assert.deepEqual(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 1, 3, 4, 5, 6], [1, 2, 1, 4, 5, 6], [1, 2, 3, 1, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1),[[0, 0], [1, 0], [2, 1], [2, 0], [3, 2], [3, 0], [4, 3], [4, 0], [5, 4], [5, 0], [6, 5], [6, 0]]);\n assert.deepEqual(candidate([], 1),[]);\n assert.deepEqual(candidate([[1]], 2),[]);\n assert.deepEqual(candidate([[], [1], [1, 2, 3]], 3),[[2, 2]]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "js", - "prompt": "//You're a hungry rabbit, and you already have eaten a certain number of carrots,\n// but now you need to eat more carrots to complete the day's meals.\n// you should return an array of [ total number of eaten carrots after your meals,\n// the number of carrots left after your meals ]\n// if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n// Example:\n// * eat(5, 6, 10) -> [11, 4]\n// * eat(4, 8, 9) -> [12, 1]\n// * eat(1, 10, 10) -> [11, 0]\n// * eat(2, 11, 5) -> [7, 0]\n// Variables:\n// @number : integer\n// the number of carrots that you have eaten.\n// @need : integer\n// the number of carrots that you need to eat.\n// @remaining : integer\n// the number of remaining carrots thet exist in stock\n// Constrain:\n// * 0 <= number <= 1000\n// * 0 <= need <= 1000\n// * 0 <= remaining <= 1000\n// Have fun :)\nfunction eat(number, need, remaining){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = eat;\n assert.deepEqual(candidate(5, 6, 10),[11, 4]);\n assert.deepEqual(candidate(4, 8, 9),[12, 1]);\n assert.deepEqual(candidate(1, 10, 10),[11, 0]);\n assert.deepEqual(candidate(2, 11, 5),[7, 0]);\n assert.deepEqual(candidate(4, 5, 7),[9, 2]);\n assert.deepEqual(candidate(4, 5, 1),[5, 0]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "js", - "prompt": "//Given a positive integer N, return the total sum of its digits in binary.\n// Example\n// For N = 1000, the sum of digits will be 1 the output should be \"1\".\n// For N = 150, the sum of digits will be 6 the output should be \"110\".\n// For N = 147, the sum of digits will be 12 the output should be \"1100\".\n// Variables:\n// @N integer\n// Constraints: 0 \u2264 N \u2264 10000.\n// Output:\n// a string of binary number\nfunction solve(N){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = solve;\n assert.deepEqual(candidate(1000),\"1\");\n assert.deepEqual(candidate(150),\"110\");\n assert.deepEqual(candidate(147),\"1100\");\n assert.deepEqual(candidate(333),\"1001\");\n assert.deepEqual(candidate(963),\"10010\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "js", - "prompt": "//You are given a list of integers.\n// You need to find the largest prime value and return the sum of its digits.\n// Examples:\n// For lst = [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] the output should be 10\n// For lst = [1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1] the output should be 25\n// For lst = [1,3,1,32,5107,34,83278,109,163,23,2323,32,30,1,9,3] the output should be 13\n// For lst = [0,724,32,71,99,32,6,0,5,91,83,0,5,6] the output should be 11\n// For lst = [0,81,12,3,1,21] the output should be 3\n// For lst = [0,8,1,2,1,7] the output should be 7\nfunction skjkasdkd(lst){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = skjkasdkd;\n assert.deepEqual(candidate([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]),10);\n assert.deepEqual(candidate([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]),25);\n assert.deepEqual(candidate([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]),13);\n assert.deepEqual(candidate([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]),11);\n assert.deepEqual(candidate([0, 81, 12, 3, 1, 21]),3);\n assert.deepEqual(candidate([0, 8, 1, 2, 1, 7]),7);\n assert.deepEqual(candidate([8191]),19);\n assert.deepEqual(candidate([8191, 123456, 127, 7]),19);\n assert.deepEqual(candidate([127, 97, 8192]),10);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "js", - "prompt": "//Given an array arr of integers, find the minimum number of elements that\n// need to be changed to make the array palindromic. A palindromic array is an array that\n// is read the same backwards and forwards. In one change, you can change one element to any other element.\n// For example:\n// smallest_change([1,2,3,5,4,7,9,6]) == 4\n// smallest_change([1, 2, 3, 4, 3, 2, 2]) == 1\n// smallest_change([1, 2, 3, 2, 1]) == 0\nfunction smallest_change(arr){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = smallest_change;\n assert.deepEqual(candidate([1, 2, 3, 5, 4, 7, 9, 6]),4);\n assert.deepEqual(candidate([1, 2, 3, 4, 3, 2, 2]),1);\n assert.deepEqual(candidate([1, 4, 2]),1);\n assert.deepEqual(candidate([1, 4, 4, 2]),1);\n assert.deepEqual(candidate([1, 2, 3, 2, 1]),0);\n assert.deepEqual(candidate([3, 1, 1, 3]),0);\n assert.deepEqual(candidate([1]),0);\n assert.deepEqual(candidate([0, 1]),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "js", - "prompt": "//It is the last week of the semester and the teacher has to give the grades\n// to students. The teacher has been making her own algorithm for grading.\n// The only problem is, she has lost the code she used for grading.\n// She has given you a list of GPAs for some students and you have to write \n// a function that can output a list of letter grades using the following table:\n// GPA | Letter grade\n// 4.0 A+\n// > 3.7 A \n// > 3.3 A- \n// > 3.0 B+\n// > 2.7 B \n// > 2.3 B-\n// > 2.0 C+\n// > 1.7 C\n// > 1.3 C-\n// > 1.0 D+ \n// > 0.7 D \n// > 0.0 D-\n// 0.0 E\n// Example:\n// grade_equation([4.0, 3, 1.7, 2, 3.5]) ==> ['A+', 'B', 'C-', 'C', 'A-']\nfunction numerical_letter_grade(grades){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = numerical_letter_grade;\n assert.deepEqual(candidate([4.0, 3, 1.7, 2, 3.5]),[\"A+\", \"B\", \"C-\", \"C\", \"A-\"]);\n assert.deepEqual(candidate([1.2]),[\"D+\"]);\n assert.deepEqual(candidate([0.5]),[\"D-\"]);\n assert.deepEqual(candidate([0.0]),[\"E\"]);\n assert.deepEqual(candidate([1.0, 0.3, 1.5, 2.8, 3.3]),[\"D\", \"D-\", \"C-\", \"B\", \"B+\"]);\n assert.deepEqual(candidate([0.0, 0.7]),[\"E\", \"D-\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "js", - "prompt": "//Given the lengths of the three sides of a triangle. Return the area of\n// the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n// Otherwise return -1\n// Three sides make a valid triangle when the sum of any two sides is greater \n// than the third side.\n// Example:\n// triangle_area(3, 4, 5) == 6.00\n// triangle_area(1, 2, 10) == -1\nfunction triangle_area(a, b, c){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = triangle_area;\n assert.deepEqual(candidate(3, 4, 5),6.0);\n assert.deepEqual(candidate(1, 2, 10),-1);\n assert.deepEqual(candidate(4, 8, 5),8.18);\n assert.deepEqual(candidate(2, 2, 2),1.73);\n assert.deepEqual(candidate(1, 2, 3),-1);\n assert.deepEqual(candidate(10, 5, 7),16.25);\n assert.deepEqual(candidate(2, 6, 3),-1);\n assert.deepEqual(candidate(1, 1, 1),0.43);\n assert.deepEqual(candidate(2, 2, 10),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "js", - "prompt": "//Check if two words have the same characters.\n// >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n// True\n// >>> same_chars('abcd', 'dddddddabc')\n// True\n// >>> same_chars('dddddddabc', 'abcd')\n// True\n// >>> same_chars('eabcd', 'dddddddabc')\n// False\n// >>> same_chars('abcd', 'dddddddabce')\n// False\n// >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc')\n// False\nfunction same_chars(s0, s1){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = same_chars;\n assert.deepEqual(candidate(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\"),true);\n assert.deepEqual(candidate(\"abcd\", \"dddddddabc\"),true);\n assert.deepEqual(candidate(\"dddddddabc\", \"abcd\"),true);\n assert.deepEqual(candidate(\"eabcd\", \"dddddddabc\"),false);\n assert.deepEqual(candidate(\"abcd\", \"dddddddabcf\"),false);\n assert.deepEqual(candidate(\"eabcdzzzz\", \"dddzzzzzzzddddabc\"),false);\n assert.deepEqual(candidate(\"aabb\", \"aaccc\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "js", - "prompt": "//Given an array of integers nums, find the minimum sum of any non-empty sub-array\n// of nums.\n// Example\n// minSubArraySum([2, 3, 4, 1, 2, 4]) == 1\n// minSubArraySum([-1, -2, -3]) == -6\nfunction minSubArraySum(nums){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = minSubArraySum;\n assert.deepEqual(candidate([2, 3, 4, 1, 2, 4]),1);\n assert.deepEqual(candidate([-1, -2, -3]),-6);\n assert.deepEqual(candidate([-1, -2, -3, 2, -10]),-14);\n assert.deepEqual(candidate([-9999999999999999]),-9999999999999999);\n assert.deepEqual(candidate([0, 10, 20, 1000000]),0);\n assert.deepEqual(candidate([-1, -2, -3, 10, -5]),-6);\n assert.deepEqual(candidate([100, -1, -2, -3, 10, -5]),-6);\n assert.deepEqual(candidate([10, 11, 13, 8, 3, 4]),3);\n assert.deepEqual(candidate([100, -33, 32, -1, 0, -2]),-33);\n assert.deepEqual(candidate([-10]),-10);\n assert.deepEqual(candidate([7]),7);\n assert.deepEqual(candidate([1, -1]),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "js", - "prompt": "//Given a string s and a natural number n, you have been tasked to implement \n// a function that returns a list of all words from string s that contain exactly \n// n consonants, in order these words appear in the string s.\n// If the string s is empty then the function should return an empty list.\n// Note: you may assume the input string contains only letters and spaces.\n// Examples:\n// select_words(\"Mary had a little lamb\", 4) ==> [\"little\"]\n// select_words(\"Mary had a little lamb\", 3) ==> [\"Mary\", \"lamb\"]\n// select_words(\"simple white space\", 2) ==> []\n// select_words(\"Hello world\", 4) ==> [\"world\"]\n// select_words(\"Uncle sam\", 3) ==> [\"Uncle\"]\nfunction select_words(s, n){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = select_words;\n assert.deepEqual(candidate(\"Mary had a little lamb\", 4),[\"little\"]);\n assert.deepEqual(candidate(\"Mary had a little lamb\", 3),[\"Mary\", \"lamb\"]);\n assert.deepEqual(candidate(\"simple white space\", 2),[]);\n assert.deepEqual(candidate(\"Hello world\", 4),[\"world\"]);\n assert.deepEqual(candidate(\"Uncle sam\", 3),[\"Uncle\"]);\n assert.deepEqual(candidate(\"\", 4),[]);\n assert.deepEqual(candidate(\"a b c d e f\", 1),[\"b\", \"c\", \"d\", \"f\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "js", - "prompt": "//Return list of all prefixes from shortest to longest of the input string\n// >>> all_prefixes('abc')\n// ['a', 'ab', 'abc']\nfunction all_prefixes(string){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = all_prefixes;\n assert.deepEqual(candidate(\"\"),[]);\n assert.deepEqual(candidate(\"asdfgh\"),[\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"]);\n assert.deepEqual(candidate(\"WWW\"),[\"W\", \"WW\", \"WWW\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "js", - "prompt": "//Create a function that takes a value (string) representing a number\n// and returns the closest integer to it. If the number is equidistant\n// from two integers, round it away from zero.\n// Examples\n// >>> closest_integer(\"10\")\n// 10\n// >>> closest_integer(\"15.3\")\n// 15\n// Note:\n// Rounding away from zero means that if the given number is equidistant\n// from two integers, the one you should return is the one that is the\n// farthest from zero. For example closest_integer(\"14.5\") should\n// return 15 and closest_integer(\"-14.5\") should return -15.\nfunction closest_integer(value){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = closest_integer;\n assert.deepEqual(candidate(\"10\"),10);\n assert.deepEqual(candidate(\"14.5\"),15);\n assert.deepEqual(candidate(\"-15.5\"),-16);\n assert.deepEqual(candidate(\"15.3\"),15);\n assert.deepEqual(candidate(\"0\"),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "js", - "prompt": "//Create a function which takes a string representing a file's name, and returns\n// 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n// A file's name is considered to be valid if and only if all the following conditions \n// are met:\n// - There should not be more than three digits ('0'-'9') in the file's name.\n// - The file's name contains exactly one dot '.'\n// - The substring before the dot should not be empty, and it starts with a letter from \n// the latin alphapet ('a'-'z' and 'A'-'Z').\n// - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n// Examples:\n// file_name_check(\"example.txt\") # => 'Yes'\n// file_name_check(\"1example.dll\") # => 'No' (the name should start with a latin alphapet letter)\nfunction file_name_check(file_name){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = file_name_check;\n assert.deepEqual(candidate(\"example.txt\"),\"Yes\");\n assert.deepEqual(candidate(\"1example.dll\"),\"No\");\n assert.deepEqual(candidate(\"s1sdf3.asd\"),\"No\");\n assert.deepEqual(candidate(\"K.dll\"),\"Yes\");\n assert.deepEqual(candidate(\"MY16FILE3.exe\"),\"Yes\");\n assert.deepEqual(candidate(\"His12FILE94.exe\"),\"No\");\n assert.deepEqual(candidate(\"_Y.txt\"),\"No\");\n assert.deepEqual(candidate(\"?aREYA.exe\"),\"No\");\n assert.deepEqual(candidate(\"/this_is_valid.dll\"),\"No\");\n assert.deepEqual(candidate(\"this_is_valid.wow\"),\"No\");\n assert.deepEqual(candidate(\"this_is_valid.txt\"),\"Yes\");\n assert.deepEqual(candidate(\"this_is_valid.txtexe\"),\"No\");\n assert.deepEqual(candidate(\"#this2_i4s_5valid.ten\"),\"No\");\n assert.deepEqual(candidate(\"@this1_is6_valid.exe\"),\"No\");\n assert.deepEqual(candidate(\"this_is_12valid.6exe4.txt\"),\"No\");\n assert.deepEqual(candidate(\"all.exe.txt\"),\"No\");\n assert.deepEqual(candidate(\"I563_No.exe\"),\"Yes\");\n assert.deepEqual(candidate(\"Is3youfault.txt\"),\"Yes\");\n assert.deepEqual(candidate(\"no_one#knows.dll\"),\"Yes\");\n assert.deepEqual(candidate(\"1I563_Yes3.exe\"),\"No\");\n assert.deepEqual(candidate(\"I563_Yes3.txtt\"),\"No\");\n assert.deepEqual(candidate(\"final..txt\"),\"No\");\n assert.deepEqual(candidate(\"final132\"),\"No\");\n assert.deepEqual(candidate(\"_f4indsartal132.\"),\"No\");\n assert.deepEqual(candidate(\".txt\"),\"No\");\n assert.deepEqual(candidate(\"s.\"),\"No\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "js", - "prompt": "//You are given two intervals,\n// where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n// The given intervals are closed which means that the interval (start, end)\n// includes both start and end.\n// For each given interval, it is assumed that its start is less or equal its end.\n// Your task is to determine whether the length of intersection of these two \n// intervals is a prime number.\n// Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n// which its length is 1, which not a prime number.\n// If the length of the intersection is a prime number, return \"YES\",\n// otherwise, return \"NO\".\n// If the two intervals don't intersect, return \"NO\".\n// [input/output] samples:\n// intersection((1, 2), (2, 3)) ==> \"NO\"\n// intersection((-1, 1), (0, 4)) ==> \"NO\"\n// intersection((-3, -1), (-5, 5)) ==> \"YES\"\nfunction intersection(interval1, interval2){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = intersection;\n assert.deepEqual(candidate([1, 2], [2, 3]),\"NO\");\n assert.deepEqual(candidate([-1, 1], [0, 4]),\"NO\");\n assert.deepEqual(candidate([-3, -1], [-5, 5]),\"YES\");\n assert.deepEqual(candidate([-2, 2], [-4, 0]),\"YES\");\n assert.deepEqual(candidate([-11, 2], [-1, -1]),\"NO\");\n assert.deepEqual(candidate([1, 2], [3, 5]),\"NO\");\n assert.deepEqual(candidate([1, 2], [1, 2]),\"NO\");\n assert.deepEqual(candidate([-2, -2], [-3, -2]),\"NO\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "js", - "prompt": "//Return the largest prime factor of n. Assume n > 1 and is not a prime.\n// >>> largest_prime_factor(13195)\n// 29\n// >>> largest_prime_factor(2048)\n// 2\nfunction largest_prime_factor(n){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = largest_prime_factor;\n assert.deepEqual(candidate(15),5);\n assert.deepEqual(candidate(27),3);\n assert.deepEqual(candidate(63),7);\n assert.deepEqual(candidate(330),11);\n assert.deepEqual(candidate(13195),29);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "js", - "prompt": "//Given a string, find out how many distinct characters (regardless of case) does it consist of\n// >>> count_distinct_characters('xyzXYZ')\n// 3\n// >>> count_distinct_characters('Jerry')\n// 4\nfunction count_distinct_characters(string){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_distinct_characters;\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"abcde\"),5);\n assert.deepEqual(candidate(\"abcdecadeCADE\"),5);\n assert.deepEqual(candidate(\"aaaaAAAAaaaa\"),1);\n assert.deepEqual(candidate(\"Jerry jERRY JeRRRY\"),5);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "js", - "prompt": "//You're given a list of deposit and withdrawal operations on a bank account that starts with\n// zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n// at that point function should return True. Otherwise it should return False.\n// >>> below_zero([1, 2, 3])\n// False\n// >>> below_zero([1, 2, -4, 5])\n// True\nfunction below_zero(operations){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = below_zero;\n assert.deepEqual(candidate([]),false);\n assert.deepEqual(candidate([1, 2, -3, 1, 2, -3]),false);\n assert.deepEqual(candidate([1, 2, -4, 5, 6]),true);\n assert.deepEqual(candidate([1, -1, 2, -2, 5, -5, 4, -4]),false);\n assert.deepEqual(candidate([1, -1, 2, -2, 5, -5, 4, -5]),true);\n assert.deepEqual(candidate([1, -2, 2, -2, 5, -5, 4, -4]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "js", - "prompt": "//Find the shortest palindrome that begins with a supplied string.\n// Algorithm idea is simple:\n// - Find the longest postfix of supplied string that is a palindrome.\n// - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n// >>> make_palindrome('')\n// ''\n// >>> make_palindrome('cat')\n// 'catac'\n// >>> make_palindrome('cata')\n// 'catac'\nfunction make_palindrome(string){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = make_palindrome;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"x\"),\"x\");\n assert.deepEqual(candidate(\"xyz\"),\"xyzyx\");\n assert.deepEqual(candidate(\"xyx\"),\"xyx\");\n assert.deepEqual(candidate(\"jerry\"),\"jerryrrej\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "js", - "prompt": "//Given a positive integer, obtain its roman numeral equivalent as a string,\n// and return it in lowercase.\n// Restrictions: 1 <= num <= 1000\n// Examples:\n// >>> int_to_mini_roman(19) == 'xix'\n// >>> int_to_mini_roman(152) == 'clii'\n// >>> int_to_mini_roman(426) == 'cdxxvi'\nfunction int_to_mini_roman(number){\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = int_to_mini_roman;\n assert.deepEqual(candidate(19),\"xix\");\n assert.deepEqual(candidate(152),\"clii\");\n assert.deepEqual(candidate(251),\"ccli\");\n assert.deepEqual(candidate(426),\"cdxxvi\");\n assert.deepEqual(candidate(500),\"d\");\n assert.deepEqual(candidate(1),\"i\");\n assert.deepEqual(candidate(4),\"iv\");\n assert.deepEqual(candidate(43),\"xliii\");\n assert.deepEqual(candidate(90),\"xc\");\n assert.deepEqual(candidate(94),\"xciv\");\n assert.deepEqual(candidate(532),\"dxxxii\");\n assert.deepEqual(candidate(900),\"cm\");\n assert.deepEqual(candidate(994),\"cmxciv\");\n assert.deepEqual(candidate(1000),\"m\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - } -] \ No newline at end of file diff --git a/data/js-remove.json b/data/js-remove.json deleted file mode 100644 index 8c69fe48202caaadf96f2e44db550b00331e0819..0000000000000000000000000000000000000000 --- a/data/js-remove.json +++ /dev/null @@ -1,2372 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "js", - "prompt": "//For a given number n, find the largest number that divides n evenly, smaller than n\nfunction largest_divisor(n){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = largest_divisor;\n assert.deepEqual(candidate(3),1);\n assert.deepEqual(candidate(7),1);\n assert.deepEqual(candidate(10),5);\n assert.deepEqual(candidate(100),50);\n assert.deepEqual(candidate(49),7);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_47_median", - "language": "js", - "prompt": "//Return median of elements in the list l.\nfunction median(l){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = median;\n assert.deepEqual(candidate([3, 1, 2, 4, 5]),3);\n assert.deepEqual(candidate([-10, 4, 6, 1000, 10, 20]),8.0);\n assert.deepEqual(candidate([5]),5);\n assert.deepEqual(candidate([6, 5]),5.5);\n assert.deepEqual(candidate([8, 1, 3, 9, 9, 2, 7]),7);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "js", - "prompt": "//Return maximum element in the list.\nfunction max_element(l){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = max_element;\n assert.deepEqual(candidate([1, 2, 3]),3);\n assert.deepEqual(candidate([5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]),124);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "js", - "prompt": "//Create a function which returns the largest index of an element which\n// is not greater than or equal to the element immediately preceding it. If\n// no such element exists then return -1. The given array will not contain\n// duplicate values.\n// Examples:\nfunction can_arrange(arr){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = can_arrange;\n assert.deepEqual(candidate([1, 2, 4, 3, 5]),3);\n assert.deepEqual(candidate([1, 2, 4, 5]),-1);\n assert.deepEqual(candidate([1, 4, 2, 5, 6, 7, 8, 9, 10]),2);\n assert.deepEqual(candidate([4, 8, 5, 7, 3]),4);\n assert.deepEqual(candidate([]),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "js", - "prompt": "//Create a function that returns True if the last character\n// of a given string is an alphabetical character and is not\n// a part of a word, and False otherwise.\n// Note: \"word\" is a group of characters separated by space.\n// Examples:\nfunction check_if_last_char_is_a_letter(txt){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = check_if_last_char_is_a_letter;\n assert.deepEqual(candidate(\"apple\"),false);\n assert.deepEqual(candidate(\"apple pi e\"),true);\n assert.deepEqual(candidate(\"eeeee\"),false);\n assert.deepEqual(candidate(\"A\"),true);\n assert.deepEqual(candidate(\"Pumpkin pie \"),false);\n assert.deepEqual(candidate(\"Pumpkin pie 1\"),false);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"eeeee e \"),false);\n assert.deepEqual(candidate(\"apple pie\"),false);\n assert.deepEqual(candidate(\"apple pi e \"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "js", - "prompt": "//Return true if a given number is prime, and false otherwise.\nfunction is_prime(n){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_prime;\n assert.deepEqual(candidate(6),false);\n assert.deepEqual(candidate(101),true);\n assert.deepEqual(candidate(11),true);\n assert.deepEqual(candidate(13441),true);\n assert.deepEqual(candidate(61),true);\n assert.deepEqual(candidate(4),false);\n assert.deepEqual(candidate(1),false);\n assert.deepEqual(candidate(5),true);\n assert.deepEqual(candidate(11),true);\n assert.deepEqual(candidate(17),true);\n assert.deepEqual(candidate(85),false);\n assert.deepEqual(candidate(77),false);\n assert.deepEqual(candidate(255379),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "js", - "prompt": "//Given a list of positive integers x. return a sorted list of all \n// elements that hasn't any even digit.\n// Note: Returned list should be sorted in increasing order.\n// For example:\nfunction unique_digits(x){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = unique_digits;\n assert.deepEqual(candidate([15, 33, 1422, 1]),[1, 15, 33]);\n assert.deepEqual(candidate([152, 323, 1422, 10]),[]);\n assert.deepEqual(candidate([12345, 2033, 111, 151]),[111, 151]);\n assert.deepEqual(candidate([135, 103, 31]),[31, 135]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "js", - "prompt": "//Input are two strings a and b consisting only of 1s and 0s.\n// Perform binary XOR on these inputs and return result also as a string.\nfunction string_xor(a, b){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = string_xor;\n assert.deepEqual(candidate(\"111000\", \"101010\"),\"010010\");\n assert.deepEqual(candidate(\"1\", \"1\"),\"0\");\n assert.deepEqual(candidate(\"0101\", \"0000\"),\"0101\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "js", - "prompt": "//sum_to_n is a function that sums numbers from 1 to n.\nfunction sum_to_n(n){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_to_n;\n assert.deepEqual(candidate(1),1);\n assert.deepEqual(candidate(6),21);\n assert.deepEqual(candidate(11),66);\n assert.deepEqual(candidate(30),465);\n assert.deepEqual(candidate(100),5050);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "js", - "prompt": "//Given a list of numbers, return the sum of squares of the numbers\n// in the list that are odd. Ignore numbers that are negative or not integers.\n// If the input list is empty, return 0.\nfunction double_the_difference(lst){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = double_the_difference;\n assert.deepEqual(candidate([]),0);\n assert.deepEqual(candidate([5.0, 4.0]),25);\n assert.deepEqual(candidate([0.1, 0.2, 0.3]),0);\n assert.deepEqual(candidate([-10.0, -20.0, -30.0]),0);\n assert.deepEqual(candidate([-1.0, -2.0, 8.0]),0);\n assert.deepEqual(candidate([0.2, 3.0, 5.0]),34);\n assert.deepEqual(candidate([-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]),165);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "js", - "prompt": "//Return length of given string\nfunction strlen(string){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = strlen;\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"x\"),1);\n assert.deepEqual(candidate(\"asdasnakj\"),9);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "js", - "prompt": "//You'll be given a string of words, and your task is to count the number\n// of boredoms. A boredom is a sentence that starts with the word \"I\".\n// Sentences are delimited by '.', '?' or '!'.\n// For example:\nfunction is_bored(S){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_bored;\n assert.deepEqual(candidate(\"Hello world\"),0);\n assert.deepEqual(candidate(\"Is the sky blue?\"),0);\n assert.deepEqual(candidate(\"I love It !\"),1);\n assert.deepEqual(candidate(\"bIt\"),0);\n assert.deepEqual(candidate(\"I feel good today. I will be productive. will kill It\"),2);\n assert.deepEqual(candidate(\"You and I are going for a walk\"),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "js", - "prompt": "//Write a function vowels_count which takes a string representing\n// a word as input and returns the number of vowels in the string.\n// Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n// vowel, but only when it is at the end of the given word.\n// Example:\nfunction vowels_count(s){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = vowels_count;\n assert.deepEqual(candidate(\"abcde\"),2);\n assert.deepEqual(candidate(\"Alone\"),3);\n assert.deepEqual(candidate(\"key\"),2);\n assert.deepEqual(candidate(\"bye\"),1);\n assert.deepEqual(candidate(\"keY\"),2);\n assert.deepEqual(candidate(\"bYe\"),1);\n assert.deepEqual(candidate(\"ACEDY\"),3);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "js", - "prompt": "//Return n-th Fibonacci number.\nfunction fib(n){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fib;\n assert.deepEqual(candidate(10),55);\n assert.deepEqual(candidate(1),1);\n assert.deepEqual(candidate(8),21);\n assert.deepEqual(candidate(11),89);\n assert.deepEqual(candidate(12),144);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "js", - "prompt": "//Your task is to implement a function that will simplify the expression\n// x * n. The function returns True if x * n evaluates to a whole number and False\n// otherwise. Both x and n, are string representation of a fraction, and have the following format,\n// / where both numerator and denominator are positive whole numbers.\n// You can assume that x, and n are valid fractions, and do not have zero as denominator.\nfunction simplify(x, n){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = simplify;\n assert.deepEqual(candidate(\"1/5\", \"5/1\"),true);\n assert.deepEqual(candidate(\"1/6\", \"2/1\"),false);\n assert.deepEqual(candidate(\"5/1\", \"3/1\"),true);\n assert.deepEqual(candidate(\"7/10\", \"10/2\"),false);\n assert.deepEqual(candidate(\"2/10\", \"50/10\"),true);\n assert.deepEqual(candidate(\"7/2\", \"4/2\"),true);\n assert.deepEqual(candidate(\"11/6\", \"6/1\"),true);\n assert.deepEqual(candidate(\"2/3\", \"5/2\"),false);\n assert.deepEqual(candidate(\"5/2\", \"3/5\"),false);\n assert.deepEqual(candidate(\"2/4\", \"8/4\"),true);\n assert.deepEqual(candidate(\"2/4\", \"4/2\"),true);\n assert.deepEqual(candidate(\"1/5\", \"5/1\"),true);\n assert.deepEqual(candidate(\"1/5\", \"1/5\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "js", - "prompt": "//Given a string s, count the number of uppercase vowels in even indices.\n// For example:\nfunction count_upper(s){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_upper;\n assert.deepEqual(candidate(\"aBCdEf\"),1);\n assert.deepEqual(candidate(\"abcdefg\"),0);\n assert.deepEqual(candidate(\"dBBE\"),0);\n assert.deepEqual(candidate(\"B\"),0);\n assert.deepEqual(candidate(\"U\"),1);\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"EEEE\"),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "js", - "prompt": "//You are given a rectangular grid of wells. Each row represents a single well,\n// and each 1 in a row represents a single unit of water.\n// Each well has a corresponding bucket that can be used to extract water from it, \n// and all buckets have the same capacity.\n// Your task is to use the buckets to empty the wells.\n// Output the number of times you need to lower the buckets.\n// Example 1:\n// Example 2:\n// Example 3:\n// Constraints:\n// * all wells have the same length\n// * 1 <= grid.length <= 10^2\n// * 1 <= grid[:,1].length <= 10^2\n// * grid[i][j] -> 0 | 1\n// * 1 <= capacity <= 10\nfunction max_fill(grid, capacity){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = max_fill;\n assert.deepEqual(candidate([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1),6);\n assert.deepEqual(candidate([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2),5);\n assert.deepEqual(candidate([[0, 0, 0], [0, 0, 0]], 5),0);\n assert.deepEqual(candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 2),4);\n assert.deepEqual(candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 9),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "js", - "prompt": "//Given an array arr of integers and a positive integer k, return a sorted list \n// of length k with the maximum k numbers in arr.\n// Example 1:\n// Example 2:\n// Example 3:\n// Note:\n// 1. The length of the array will be in the range of [1, 1000].\n// 2. The elements in the array will be in the range of [-1000, 1000].\n// 3. 0 <= k <= len(arr)\nfunction maximum(arr, k){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = maximum;\n assert.deepEqual(candidate([-3, -4, 5], 3),[-4, -3, 5]);\n assert.deepEqual(candidate([4, -4, 4], 2),[4, 4]);\n assert.deepEqual(candidate([-3, 2, 1, 2, -1, -2, 1], 1),[2]);\n assert.deepEqual(candidate([123, -123, 20, 0, 1, 2, -3], 3),[2, 20, 123]);\n assert.deepEqual(candidate([-123, 20, 0, 1, 2, -3], 4),[0, 1, 2, 20]);\n assert.deepEqual(candidate([5, 15, 0, 3, -13, -8, 0], 7),[-13, -8, 0, 0, 3, 5, 15]);\n assert.deepEqual(candidate([-1, 0, 2, 5, 3, -10], 2),[3, 5]);\n assert.deepEqual(candidate([1, 0, 5, -7], 1),[5]);\n assert.deepEqual(candidate([4, -4], 2),[-4, 4]);\n assert.deepEqual(candidate([-10, 10], 2),[-10, 10]);\n assert.deepEqual(candidate([1, 2, 3, -23, 243, -400, 0], 0),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "js", - "prompt": "//Write a function that takes a message, and encodes in such a \n// way that it swaps case of all letters, replaces all vowels in \n// the message with the letter that appears 2 places ahead of that \n// vowel in the english alphabet. \n// Assume only letters. \n// Examples:\nfunction encode(message){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = encode;\n assert.deepEqual(candidate(\"TEST\"),\"tgst\");\n assert.deepEqual(candidate(\"Mudasir\"),\"mWDCSKR\");\n assert.deepEqual(candidate(\"YES\"),\"ygs\");\n assert.deepEqual(candidate(\"This is a message\"),\"tHKS KS C MGSSCGG\");\n assert.deepEqual(candidate(\"I DoNt KnOw WhAt tO WrItE\"),\"k dQnT kNqW wHcT Tq wRkTg\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "js", - "prompt": "//remove_vowels is a function that takes string and returns string without vowels.\nfunction remove_vowels(text){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = remove_vowels;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"abcdef\nghijklm\"),\"bcdf\nghjklm\");\n assert.deepEqual(candidate(\"fedcba\"),\"fdcb\");\n assert.deepEqual(candidate(\"eeeee\"),\"\");\n assert.deepEqual(candidate(\"acBAA\"),\"cB\");\n assert.deepEqual(candidate(\"EcBOO\"),\"cB\");\n assert.deepEqual(candidate(\"ybcd\"),\"ybcd\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "js", - "prompt": "//Return only positive numbers in the list.\nfunction get_positive(l){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_positive;\n assert.deepEqual(candidate([-1, -2, 4, 5, 6]),[4, 5, 6]);\n assert.deepEqual(candidate([5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]),[5, 3, 2, 3, 3, 9, 123, 1]);\n assert.deepEqual(candidate([-1, -2]),[]);\n assert.deepEqual(candidate([]),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "js", - "prompt": "//Return a string containing space-delimited numbers starting from 0 upto n inclusive.\nfunction string_sequence(n){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = string_sequence;\n assert.deepEqual(candidate(0),\"0\");\n assert.deepEqual(candidate(3),\"0 1 2 3\");\n assert.deepEqual(candidate(10),\"0 1 2 3 4 5 6 7 8 9 10\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "js", - "prompt": "//Given a positive integer n, you have to make a pile of n levels of stones.\n// The first level has n stones.\n// The number of stones in the next level is:\n// - the next odd number if n is odd.\n// - the next even number if n is even.\n// Return the number of stones in each level in a list, where element at index\n// i represents the number of stones in the level (i+1).\n// Examples:\nfunction make_a_pile(n){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = make_a_pile;\n assert.deepEqual(candidate(3),[3, 5, 7]);\n assert.deepEqual(candidate(4),[4, 6, 8, 10]);\n assert.deepEqual(candidate(5),[5, 7, 9, 11, 13]);\n assert.deepEqual(candidate(6),[6, 8, 10, 12, 14, 16]);\n assert.deepEqual(candidate(8),[8, 10, 12, 14, 16, 18, 20, 22]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "js", - "prompt": "//Task\n// 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\n// then check if the result string is palindrome.\n// A string is called palindrome if it reads the same backward as forward.\n// You should return a tuple containing the result string and True/False for the check.\n// Example\nfunction reverse_delete(s, c){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = reverse_delete;\n assert.deepEqual(candidate(\"abcde\", \"ae\"),[\"bcd\", false]);\n assert.deepEqual(candidate(\"abcdef\", \"b\"),[\"acdef\", false]);\n assert.deepEqual(candidate(\"abcdedcba\", \"ab\"),[\"cdedc\", true]);\n assert.deepEqual(candidate(\"dwik\", \"w\"),[\"dik\", false]);\n assert.deepEqual(candidate(\"a\", \"a\"),[\"\", true]);\n assert.deepEqual(candidate(\"abcdedcba\", \"\"),[\"abcdedcba\", true]);\n assert.deepEqual(candidate(\"abcdedcba\", \"v\"),[\"abcdedcba\", true]);\n assert.deepEqual(candidate(\"vabba\", \"v\"),[\"abba\", true]);\n assert.deepEqual(candidate(\"mamma\", \"mia\"),[\"\", true]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "js", - "prompt": "//For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\nfunction flip_case(string){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = flip_case;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"Hello!\"),\"hELLO!\");\n assert.deepEqual(candidate(\"These violent delights have violent ends\"),\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "js", - "prompt": "//You are given a string s.\n// if s[i] is a letter, reverse its case from lower to upper or vise versa, \n// otherwise keep it as it is.\n// If the string contains no letters, reverse the string.\n// The function should return the resulted string.\n// Examples\nfunction solve(s){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = solve;\n assert.deepEqual(candidate(\"AsDf\"),\"aSdF\");\n assert.deepEqual(candidate(\"1234\"),\"4321\");\n assert.deepEqual(candidate(\"ab\"),\"AB\");\n assert.deepEqual(candidate(\"#a@C\"),\"#A@c\");\n assert.deepEqual(candidate(\"#AsdfW^45\"),\"#aSDFw^45\");\n assert.deepEqual(candidate(\"#6@2\"),\"2@6#\");\n assert.deepEqual(candidate(\"#$a^D\"),\"#$A^d\");\n assert.deepEqual(candidate(\"#ccc\"),\"#CCC\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "js", - "prompt": "//Filter an input list of strings only for ones that start with a given prefix.\nfunction filter_by_prefix(strings, prefix){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = filter_by_prefix;\n assert.deepEqual(candidate([], \"john\"),[]);\n assert.deepEqual(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"),[\"xxx\", \"xxxAAA\", \"xxx\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "js", - "prompt": "//This function takes two positive numbers x and y and returns the\n// biggest even integer number that is in the range [x, y] inclusive. If \n// there's no such number, then the function should return -1.\n// For example:\nfunction choose_num(x, y){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = choose_num;\n assert.deepEqual(candidate(12, 15),14);\n assert.deepEqual(candidate(13, 12),-1);\n assert.deepEqual(candidate(33, 12354),12354);\n assert.deepEqual(candidate(5234, 5233),-1);\n assert.deepEqual(candidate(6, 29),28);\n assert.deepEqual(candidate(27, 10),-1);\n assert.deepEqual(candidate(7, 7),-1);\n assert.deepEqual(candidate(546, 546),546);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "js", - "prompt": "//You are given a string representing a sentence,\n// the sentence contains some words separated by a space,\n// and you have to return a string that contains the words from the original sentence,\n// whose lengths are prime numbers,\n// the order of the words in the new string should be the same as the original one.\n// Example 1:\n// Example 2:\n// Constraints:\n// * 1 <= len(sentence) <= 100\n// * sentence contains only letters\nfunction words_in_sentence(sentence){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = words_in_sentence;\n assert.deepEqual(candidate(\"This is a test\"),\"is\");\n assert.deepEqual(candidate(\"lets go for swimming\"),\"go for\");\n assert.deepEqual(candidate(\"there is no place available here\"),\"there is no place\");\n assert.deepEqual(candidate(\"Hi I am Hussein\"),\"Hi am Hussein\");\n assert.deepEqual(candidate(\"go for it\"),\"go for it\");\n assert.deepEqual(candidate(\"here\"),\"\");\n assert.deepEqual(candidate(\"here is\"),\"is\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "js", - "prompt": "//Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\nfunction intersperse(numbers, delimeter){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = intersperse;\n assert.deepEqual(candidate([], 7),[]);\n assert.deepEqual(candidate([5, 6, 3, 2], 8),[5, 8, 6, 8, 3, 8, 2]);\n assert.deepEqual(candidate([2, 2, 2], 2),[2, 2, 2, 2, 2]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "js", - "prompt": "//Your task is to write a function that returns true if a number x is a simple\n// power of n and false in other cases.\n// x is a simple power of n if n**int=x\n// For example:\nfunction is_simple_power(x, n){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_simple_power;\n assert.deepEqual(candidate(16, 2),true);\n assert.deepEqual(candidate(143214, 16),false);\n assert.deepEqual(candidate(4, 2),true);\n assert.deepEqual(candidate(9, 3),true);\n assert.deepEqual(candidate(16, 4),true);\n assert.deepEqual(candidate(24, 2),false);\n assert.deepEqual(candidate(128, 4),false);\n assert.deepEqual(candidate(12, 6),false);\n assert.deepEqual(candidate(1, 1),true);\n assert.deepEqual(candidate(1, 12),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "js", - "prompt": "//Write a function that returns true if the given number is the multiplication of 3 prime numbers\n// and false otherwise.\n// Knowing that (a) is less then 100. \n// Example:\n// 30 = 2 * 3 * 5\nfunction is_multiply_prime(a){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_multiply_prime;\n assert.deepEqual(candidate(5),false);\n assert.deepEqual(candidate(30),true);\n assert.deepEqual(candidate(8),true);\n assert.deepEqual(candidate(10),false);\n assert.deepEqual(candidate(125),true);\n assert.deepEqual(candidate(105),true);\n assert.deepEqual(candidate(126),false);\n assert.deepEqual(candidate(729),false);\n assert.deepEqual(candidate(891),false);\n assert.deepEqual(candidate(1001),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "js", - "prompt": "//Given the lengths of the three sides of a triangle. Return True if the three\n// sides form a right-angled triangle, False otherwise.\n// A right-angled triangle is a triangle in which one angle is right angle or \n// 90 degree.\n// Example:\nfunction right_angle_triangle(a, b, c){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = right_angle_triangle;\n assert.deepEqual(candidate(3, 4, 5),true);\n assert.deepEqual(candidate(1, 2, 3),false);\n assert.deepEqual(candidate(10, 6, 8),true);\n assert.deepEqual(candidate(2, 2, 2),false);\n assert.deepEqual(candidate(7, 24, 25),true);\n assert.deepEqual(candidate(10, 5, 7),false);\n assert.deepEqual(candidate(5, 12, 13),true);\n assert.deepEqual(candidate(15, 8, 17),true);\n assert.deepEqual(candidate(48, 55, 73),true);\n assert.deepEqual(candidate(1, 1, 1),false);\n assert.deepEqual(candidate(2, 2, 10),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "js", - "prompt": "//Create a function that takes 3 numbers.\n// Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n// Returns false in any other cases.\n// Examples\nfunction any_int(x, y, z){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = any_int;\n assert.deepEqual(candidate(2, 3, 1),true);\n assert.deepEqual(candidate(2.5, 2, 3),false);\n assert.deepEqual(candidate(1.5, 5, 3.5),false);\n assert.deepEqual(candidate(2, 6, 2),false);\n assert.deepEqual(candidate(4, 2, 2),true);\n assert.deepEqual(candidate(2.2, 2.2, 2.2),false);\n assert.deepEqual(candidate(-4, 6, 2),true);\n assert.deepEqual(candidate(2, 1, 1),true);\n assert.deepEqual(candidate(3, 4, 7),true);\n assert.deepEqual(candidate(3.0, 4, 7),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "js", - "prompt": "//This function takes a list l and returns a list l' such that\n// l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n// to the values of the corresponding indicies of l, but sorted.\nfunction sort_third(l){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_third;\n assert.deepEqual(candidate([5, 6, 3, 4, 8, 9, 2]),[2, 6, 3, 4, 8, 9, 5]);\n assert.deepEqual(candidate([5, 8, 3, 4, 6, 9, 2]),[2, 8, 3, 4, 6, 9, 5]);\n assert.deepEqual(candidate([5, 6, 9, 4, 8, 3, 2]),[2, 6, 9, 4, 8, 3, 5]);\n assert.deepEqual(candidate([5, 6, 3, 4, 8, 9, 2, 1]),[2, 6, 3, 4, 8, 9, 5, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_53_add", - "language": "js", - "prompt": "//Add two numbers x and y\nfunction add(x, y){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = add;\n assert.deepEqual(candidate(0, 1),1);\n assert.deepEqual(candidate(1, 0),1);\n assert.deepEqual(candidate(2, 3),5);\n assert.deepEqual(candidate(5, 7),12);\n assert.deepEqual(candidate(7, 5),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_69_search", - "language": "js", - "prompt": "//You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n// zero, and has a frequency greater than or equal to the value of the integer itself. \n// The frequency of an integer is the number of times it appears in the list.\n// If no such a value exist, return -1.\n// Examples:\nfunction search(lst){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = search;\n assert.deepEqual(candidate([5, 5, 5, 5, 1]),1);\n assert.deepEqual(candidate([4, 1, 4, 1, 4, 4]),4);\n assert.deepEqual(candidate([3, 3]),-1);\n assert.deepEqual(candidate([8, 8, 8, 8, 8, 8, 8, 8]),8);\n assert.deepEqual(candidate([2, 3, 3, 2, 2]),2);\n assert.deepEqual(candidate([2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]),1);\n assert.deepEqual(candidate([3, 2, 8, 2]),2);\n assert.deepEqual(candidate([6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]),1);\n assert.deepEqual(candidate([8, 8, 3, 6, 5, 6, 4]),-1);\n assert.deepEqual(candidate([6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]),1);\n assert.deepEqual(candidate([1, 9, 10, 1, 3]),1);\n assert.deepEqual(candidate([6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]),5);\n assert.deepEqual(candidate([1]),1);\n assert.deepEqual(candidate([8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]),4);\n assert.deepEqual(candidate([2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]),2);\n assert.deepEqual(candidate([1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]),1);\n assert.deepEqual(candidate([9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]),4);\n assert.deepEqual(candidate([2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]),4);\n assert.deepEqual(candidate([9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]),2);\n assert.deepEqual(candidate([5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]),-1);\n assert.deepEqual(candidate([10]),-1);\n assert.deepEqual(candidate([9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]),2);\n assert.deepEqual(candidate([5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]),1);\n assert.deepEqual(candidate([7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]),1);\n assert.deepEqual(candidate([3, 10, 10, 9, 2]),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "js", - "prompt": "//Write a function that takes a string and returns True if the string\n// length is a prime number or False otherwise\n// Examples\nfunction prime_length(string){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = prime_length;\n assert.deepEqual(candidate(\"Hello\"),true);\n assert.deepEqual(candidate(\"abcdcba\"),true);\n assert.deepEqual(candidate(\"kittens\"),true);\n assert.deepEqual(candidate(\"orange\"),false);\n assert.deepEqual(candidate(\"wow\"),true);\n assert.deepEqual(candidate(\"world\"),true);\n assert.deepEqual(candidate(\"MadaM\"),true);\n assert.deepEqual(candidate(\"Wow\"),true);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"HI\"),true);\n assert.deepEqual(candidate(\"go\"),true);\n assert.deepEqual(candidate(\"gogo\"),false);\n assert.deepEqual(candidate(\"aaaaaaaaaaaaaaa\"),false);\n assert.deepEqual(candidate(\"Madam\"),true);\n assert.deepEqual(candidate(\"M\"),false);\n assert.deepEqual(candidate(\"0\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_58_common", - "language": "js", - "prompt": "//Return sorted unique common elements for two lists.\nfunction common(l1, l2){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = common;\n assert.deepEqual(candidate([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]),[1, 5, 653]);\n assert.deepEqual(candidate([5, 3, 2, 8], [3, 2]),[2, 3]);\n assert.deepEqual(candidate([4, 3, 2, 8], [3, 2, 4]),[2, 3, 4]);\n assert.deepEqual(candidate([4, 3, 2, 8], []),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "js", - "prompt": "//The Brazilian factorial is defined as:\n// brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n// where n > 0\n// For example:\n// The function will receive an integer as input and should return the special\n// factorial of this integer.\nfunction special_factorial(n){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = special_factorial;\n assert.deepEqual(candidate(4),288);\n assert.deepEqual(candidate(5),34560);\n assert.deepEqual(candidate(7),125411328000);\n assert.deepEqual(candidate(1),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "js", - "prompt": "//In this problem, you will implement a function that takes two lists of numbers,\n// and determines whether it is possible to perform an exchange of elements\n// between them to make lst1 a list of only even numbers.\n// There is no limit on the number of exchanged elements between lst1 and lst2.\n// If it is possible to exchange elements between the lst1 and lst2 to make\n// all the elements of lst1 to be even, return \"YES\".\n// Otherwise, return \"NO\".\n// For example:\n// It is assumed that the input lists will be non-empty.\nfunction exchange(lst1, lst2){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = exchange;\n assert.deepEqual(candidate([1, 2, 3, 4], [1, 2, 3, 4]),\"YES\");\n assert.deepEqual(candidate([1, 2, 3, 4], [1, 5, 3, 4]),\"NO\");\n assert.deepEqual(candidate([1, 2, 3, 4], [2, 1, 4, 3]),\"YES\");\n assert.deepEqual(candidate([5, 7, 3], [2, 6, 4]),\"YES\");\n assert.deepEqual(candidate([5, 7, 3], [2, 6, 3]),\"NO\");\n assert.deepEqual(candidate([3, 2, 6, 1, 8, 9], [3, 5, 5, 1, 1, 1]),\"NO\");\n assert.deepEqual(candidate([100, 200], [200, 200]),\"YES\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "js", - "prompt": "//Given a non-empty array of integers arr and an integer k, return\n// the sum of the elements with at most two digits from the first k elements of arr.\n// Example:\n// Constraints:\n// 1. 1 <= len(arr) <= 100\n// 2. 1 <= k <= len(arr)\nfunction add_elements(arr, k){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = add_elements;\n assert.deepEqual(candidate([1, -2, -3, 41, 57, 76, 87, 88, 99], 3),-4);\n assert.deepEqual(candidate([111, 121, 3, 4000, 5, 6], 2),0);\n assert.deepEqual(candidate([11, 21, 3, 90, 5, 6, 7, 8, 9], 4),125);\n assert.deepEqual(candidate([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4),24);\n assert.deepEqual(candidate([1], 1),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "js", - "prompt": "//A simple program which should return the value of x if n is \n// a prime number and should return the value of y otherwise.\n// Examples:\nfunction x_or_y(n, x, y){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = x_or_y;\n assert.deepEqual(candidate(7, 34, 12),34);\n assert.deepEqual(candidate(15, 8, 5),5);\n assert.deepEqual(candidate(3, 33, 5212),33);\n assert.deepEqual(candidate(1259, 3, 52),3);\n assert.deepEqual(candidate(7919, -1, 12),-1);\n assert.deepEqual(candidate(3609, 1245, 583),583);\n assert.deepEqual(candidate(91, 56, 129),129);\n assert.deepEqual(candidate(6, 34, 1234),1234);\n assert.deepEqual(candidate(1, 2, 0),0);\n assert.deepEqual(candidate(2, 2, 0),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "js", - "prompt": "//Given length of a side and high return area for a triangle.\nfunction triangle_area(a, h){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = triangle_area;\n assert.deepEqual(candidate(5, 3),7.5);\n assert.deepEqual(candidate(2, 2),2.0);\n assert.deepEqual(candidate(10, 8),40.0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "js", - "prompt": "//Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n// the last couple centuries. However, what people don't know is Tribonacci sequence.\n// Tribonacci sequence is defined by the recurrence:\n// tri(1) = 3\n// tri(n) = 1 + n / 2, if n is even.\n// tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n// For example:\n// tri(2) = 1 + (2 / 2) = 2\n// tri(4) = 3\n// tri(3) = tri(2) + tri(1) + tri(4)\n// = 2 + 3 + 3 = 8 \n// You are given a non-negative integer number n, you have to a return a list of the \n// first n + 1 numbers of the Tribonacci sequence.\n// Examples:\nfunction tri(n){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = tri;\n assert.deepEqual(candidate(3),[1, 3, 2, 8]);\n assert.deepEqual(candidate(4),[1, 3, 2, 8, 3]);\n assert.deepEqual(candidate(5),[1, 3, 2, 8, 3, 15]);\n assert.deepEqual(candidate(6),[1, 3, 2, 8, 3, 15, 4]);\n assert.deepEqual(candidate(7),[1, 3, 2, 8, 3, 15, 4, 24]);\n assert.deepEqual(candidate(8),[1, 3, 2, 8, 3, 15, 4, 24, 5]);\n assert.deepEqual(candidate(9),[1, 3, 2, 8, 3, 15, 4, 24, 5, 35]);\n assert.deepEqual(candidate(20),[1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11]);\n assert.deepEqual(candidate(0),[1]);\n assert.deepEqual(candidate(1),[1, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "js", - "prompt": "//You are given a list of two strings, both strings consist of open\n// parentheses '(' or close parentheses ')' only.\n// Your job is to check if it is possible to concatenate the two strings in\n// some order, that the resulting string will be good.\n// A string S is considered to be good if and only if all parentheses in S\n// are balanced. For example: the string '(())()' is good, while the string\n// '())' is not.\n// Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n// Examples:\nfunction match_parens(lst){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = match_parens;\n assert.deepEqual(candidate([\"()(\", \")\"]),\"Yes\");\n assert.deepEqual(candidate([\")\", \")\"]),\"No\");\n assert.deepEqual(candidate([\"(()(())\", \"())())\"]),\"No\");\n assert.deepEqual(candidate([\")())\", \"(()()(\"]),\"Yes\");\n assert.deepEqual(candidate([\"(())))\", \"(()())((\"]),\"Yes\");\n assert.deepEqual(candidate([\"()\", \"())\"]),\"No\");\n assert.deepEqual(candidate([\"(()(\", \"()))()\"]),\"Yes\");\n assert.deepEqual(candidate([\"((((\", \"((())\"]),\"No\");\n assert.deepEqual(candidate([\")(()\", \"(()(\"]),\"No\");\n assert.deepEqual(candidate([\")(\", \")(\"]),\"No\");\n assert.deepEqual(candidate([\"(\", \")\"]),\"Yes\");\n assert.deepEqual(candidate([\")\", \"(\"]),\"Yes\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "js", - "prompt": "//From a list of integers, remove all elements that occur more than once.\n// Keep order of elements left the same as in the input.\nfunction remove_duplicates(numbers){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = remove_duplicates;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, 2, 3, 4]),[1, 2, 3, 4]);\n assert.deepEqual(candidate([1, 2, 3, 2, 4, 3, 5]),[1, 4, 5]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "js", - "prompt": "//Return a greatest common divisor of two integers a and b\nfunction greatest_common_divisor(a, b){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = greatest_common_divisor;\n assert.deepEqual(candidate(3, 7),1);\n assert.deepEqual(candidate(10, 15),5);\n assert.deepEqual(candidate(49, 14),7);\n assert.deepEqual(candidate(144, 60),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "js", - "prompt": "//Checks if given string is a palindrome\nfunction is_palindrome(text){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_palindrome;\n assert.deepEqual(candidate(\"\"),true);\n assert.deepEqual(candidate(\"aba\"),true);\n assert.deepEqual(candidate(\"aaaaa\"),true);\n assert.deepEqual(candidate(\"zbcd\"),false);\n assert.deepEqual(candidate(\"xywyx\"),true);\n assert.deepEqual(candidate(\"xywyz\"),false);\n assert.deepEqual(candidate(\"xywzx\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "js", - "prompt": "//xs represent coefficients of a polynomial.\n// xs[0] + xs[1] * x + xs[2] * x^2 + ....\n// Return derivative of this polynomial in the same form.\nfunction derivative(xs){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = derivative;\n assert.deepEqual(candidate([3, 1, 2, 4, 5]),[1, 4, 12, 20]);\n assert.deepEqual(candidate([1, 2, 3]),[2, 6]);\n assert.deepEqual(candidate([3, 2, 1]),[2, 2]);\n assert.deepEqual(candidate([3, 2, 1, 0, 4]),[2, 2, 0, 16]);\n assert.deepEqual(candidate([1]),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "js", - "prompt": "//In this task, you will be given a string that represents a number of apples and oranges \n// that are distributed in a basket of fruit this basket contains \n// apples, oranges, and mango fruits. Given the string that represents the total number of \n// the oranges and apples and an integer that represent the total number of the fruits \n// in the basket return the number of the mango fruits in the basket.\n// for examble:\nfunction fruit_distribution(s, n){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fruit_distribution;\n assert.deepEqual(candidate(\"5 apples and 6 oranges\", 19),8);\n assert.deepEqual(candidate(\"5 apples and 6 oranges\", 21),10);\n assert.deepEqual(candidate(\"0 apples and 1 oranges\", 3),2);\n assert.deepEqual(candidate(\"1 apples and 0 oranges\", 3),2);\n assert.deepEqual(candidate(\"2 apples and 3 oranges\", 100),95);\n assert.deepEqual(candidate(\"2 apples and 3 oranges\", 5),0);\n assert.deepEqual(candidate(\"1 apples and 100 oranges\", 120),19);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "js", - "prompt": "//Write a function that takes an integer a and returns True \n// if this ingeger is a cube of some integer number.\n// Note: you may assume the input is always valid.\n// Examples:\nfunction iscube(a){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = iscube;\n assert.deepEqual(candidate(1),true);\n assert.deepEqual(candidate(2),false);\n assert.deepEqual(candidate(-1),true);\n assert.deepEqual(candidate(64),true);\n assert.deepEqual(candidate(180),false);\n assert.deepEqual(candidate(1000),true);\n assert.deepEqual(candidate(0),true);\n assert.deepEqual(candidate(1729),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "js", - "prompt": "//In this Kata, you have to sort an array of non-negative integers according to\n// number of ones in their binary representation in ascending order.\n// For similar number of ones, sort based on decimal value.\n// It must be implemented like this:\nfunction sort_array(arr){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_array;\n assert.deepEqual(candidate([1, 5, 2, 3, 4]),[1, 2, 4, 3, 5]);\n assert.deepEqual(candidate([-2, -3, -4, -5, -6]),[-4, -2, -6, -5, -3]);\n assert.deepEqual(candidate([1, 0, 2, 3, 4]),[0, 1, 2, 4, 3]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]),[2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77]);\n assert.deepEqual(candidate([3, 6, 44, 12, 32, 5]),[32, 3, 5, 6, 12, 44]);\n assert.deepEqual(candidate([2, 4, 8, 16, 32]),[2, 4, 8, 16, 32]);\n assert.deepEqual(candidate([2, 4, 8, 16, 32]),[2, 4, 8, 16, 32]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "js", - "prompt": "//Given a list of strings, where each string consists of only digits, return a list.\n// Each element i of the output should be \"the number of odd elements in the\n// string i of the input.\" where all the i's should be replaced by the number\n// of odd digits in the i'th string of the input.\nfunction odd_count(lst){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = odd_count;\n assert.deepEqual(candidate([\"1234567\"]),[\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]);\n assert.deepEqual(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.\"]);\n assert.deepEqual(candidate([\"271\", \"137\", \"314\"]),[\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "js", - "prompt": "//brackets is a string of \"(\" and \")\".\n// return True if every opening bracket has a corresponding closing bracket.\nfunction correct_bracketing(brackets){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = correct_bracketing;\n assert.deepEqual(candidate(\"()\"),true);\n assert.deepEqual(candidate(\"(()())\"),true);\n assert.deepEqual(candidate(\"()()(()())()\"),true);\n assert.deepEqual(candidate(\"()()((()()())())(()()(()))\"),true);\n assert.deepEqual(candidate(\"((()())))\"),false);\n assert.deepEqual(candidate(\")(()\"),false);\n assert.deepEqual(candidate(\"(\"),false);\n assert.deepEqual(candidate(\"((((\"),false);\n assert.deepEqual(candidate(\")\"),false);\n assert.deepEqual(candidate(\"(()\"),false);\n assert.deepEqual(candidate(\"()()(()())())(()\"),false);\n assert.deepEqual(candidate(\"()()(()())()))()\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "js", - "prompt": "//Task\n// Write a function that takes a string as input and returns the sum of the upper characters only'\n// ASCII codes.\n// Examples:\nfunction digitSum(s){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = digitSum;\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"abAB\"),131);\n assert.deepEqual(candidate(\"abcCd\"),67);\n assert.deepEqual(candidate(\"helloE\"),69);\n assert.deepEqual(candidate(\"woArBld\"),131);\n assert.deepEqual(candidate(\"aAaaaXa\"),153);\n assert.deepEqual(candidate(\" How are yOu?\"),151);\n assert.deepEqual(candidate(\"You arE Very Smart\"),327);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "js", - "prompt": "//Write a function that accepts a list of strings as a parameter,\n// deletes the strings that have odd lengths from it,\n// and returns the resulted list with a sorted order,\n// The list is always a list of strings and never an array of numbers,\n// and it may contain duplicates.\n// The order of the list should be ascending by length of each word, and you\n// should return the list sorted by that rule.\n// If two words have the same length, sort the list alphabetically.\n// The function should return a list of strings in sorted order.\n// You may assume that all words will have the same length.\n// For example:\nfunction sorted_list_sum(lst){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sorted_list_sum;\n assert.deepEqual(candidate([\"aa\", \"a\", \"aaa\"]),[\"aa\"]);\n assert.deepEqual(candidate([\"school\", \"AI\", \"asdf\", \"b\"]),[\"AI\", \"asdf\", \"school\"]);\n assert.deepEqual(candidate([\"d\", \"b\", \"c\", \"a\"]),[]);\n assert.deepEqual(candidate([\"d\", \"dcba\", \"abcd\", \"a\"]),[\"abcd\", \"dcba\"]);\n assert.deepEqual(candidate([\"AI\", \"ai\", \"au\"]),[\"AI\", \"ai\", \"au\"]);\n assert.deepEqual(candidate([\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"]),[]);\n assert.deepEqual(candidate([\"aaaa\", \"bbbb\", \"dd\", \"cc\"]),[\"cc\", \"dd\", \"aaaa\", \"bbbb\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "js", - "prompt": "//You are given an array arr of integers and you need to return\n// sum of magnitudes of integers multiplied by product of all signs\n// of each number in the array, represented by 1, -1 or 0.\n// Note: return None for empty arr.\n// Example:\nfunction prod_signs(arr){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = prod_signs;\n assert.deepEqual(candidate([1, 2, 2, -4]),-9);\n assert.deepEqual(candidate([0, 1]),0);\n assert.deepEqual(candidate([1, 1, 1, 2, 3, -1, 1]),-10);\n assert.deepEqual(candidate([]),undefined);\n assert.deepEqual(candidate([2, 4, 1, 2, -1, -1, 9]),20);\n assert.deepEqual(candidate([-1, 1, -1, 1]),4);\n assert.deepEqual(candidate([-1, 1, 1, 1]),-4);\n assert.deepEqual(candidate([-1, 1, 1, 0]),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "js", - "prompt": "//Return list with elements incremented by 1.\nfunction incr_list(l){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = incr_list;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([3, 2, 1]),[4, 3, 2]);\n assert.deepEqual(candidate([5, 2, 5, 2, 3, 3, 9, 0, 123]),[6, 3, 6, 3, 4, 4, 10, 1, 124]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "js", - "prompt": "//From a given list of integers, generate a list of rolling maximum element found until given moment\n// in the sequence.\nfunction rolling_max(numbers){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = rolling_max;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, 2, 3, 4]),[1, 2, 3, 4]);\n assert.deepEqual(candidate([4, 3, 2, 1]),[4, 4, 4, 4]);\n assert.deepEqual(candidate([3, 2, 3, 100, 3]),[3, 3, 3, 100, 100]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "js", - "prompt": "//Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n// separate those group into separate strings and return the list of those.\n// Separate groups are balanced (each open brace is properly closed) and not nested within each other\n// Ignore any spaces in the input string.\nfunction separate_paren_groups(paren_string){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = separate_paren_groups;\n assert.deepEqual(candidate(\"(()()) ((())) () ((())()())\"),[\"(()())\", \"((()))\", \"()\", \"((())()())\"]);\n assert.deepEqual(candidate(\"() (()) ((())) (((())))\"),[\"()\", \"(())\", \"((()))\", \"(((())))\"]);\n assert.deepEqual(candidate(\"(()(())((())))\"),[\"(()(())((())))\"]);\n assert.deepEqual(candidate(\"( ) (( )) (( )( ))\"),[\"()\", \"(())\", \"(()())\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "js", - "prompt": "//You will be given a string of words separated by commas or spaces. Your task is\n// to split the string into words and return an array of the words.\n// For example:\nfunction words_string(s){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = words_string;\n assert.deepEqual(candidate(\"Hi, my name is John\"),[\"Hi\", \"my\", \"name\", \"is\", \"John\"]);\n assert.deepEqual(candidate(\"One, two, three, four, five, six\"),[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]);\n assert.deepEqual(candidate(\"Hi, my name\"),[\"Hi\", \"my\", \"name\"]);\n assert.deepEqual(candidate(\"One,, two, three, four, five, six,\"),[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]);\n assert.deepEqual(candidate(\"\"),[]);\n assert.deepEqual(candidate(\"ahmed , gamal\"),[\"ahmed\", \"gamal\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "js", - "prompt": "//Create a function that takes integers, floats, or strings representing\n// real numbers, and returns the larger variable in its given variable type.\n// Return None if the values are equal.\n// Note: If a real number is represented as a string, the floating point might be . or ,\nfunction compare_one(a, b){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = compare_one;\n assert.deepEqual(candidate(1, 2),2);\n assert.deepEqual(candidate(1, 2.5),2.5);\n assert.deepEqual(candidate(2, 3),3);\n assert.deepEqual(candidate(5, 6),6);\n assert.deepEqual(candidate(1, \"2,3\"),\"2,3\");\n assert.deepEqual(candidate(\"5,1\", \"6\"),\"6\");\n assert.deepEqual(candidate(\"1\", \"2\"),\"2\");\n assert.deepEqual(candidate(\"1\", 1),undefined);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "js", - "prompt": "//Filter given list of any python values only for integers\nfunction filter_integers(values){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = filter_integers;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([4, {}, [], 23.2, 9, \"adasd\"]),[4, 9]);\n assert.deepEqual(candidate([3, \"c\", 3, 3, \"a\", \"b\"]),[3, 3, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "js", - "prompt": "//This function takes a list l and returns a list l' such that\n// l' is identical to l in the odd indicies, while its values at the even indicies are equal\n// to the values of the even indicies of l, but sorted.\nfunction sort_even(l){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_even;\n assert.deepEqual(candidate([1, 2, 3]),[1, 2, 3]);\n assert.deepEqual(candidate([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]),[-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123]);\n assert.deepEqual(candidate([5, 8, -12, 4, 23, 2, 3, 11, 12, -10]),[-12, 8, 3, 4, 5, 2, 12, 11, 23, -10]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "js", - "prompt": "//I think we all remember that feeling when the result of some long-awaited\n// event is finally known. The feelings and thoughts you have at that moment are\n// definitely worth noting down and comparing.\n// Your task is to determine if a person correctly guessed the results of a number of matches.\n// You are given two arrays of scores and guesses of equal length, where each index shows a match. \n// Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n// the value is 0, and if not, the value is the absolute difference between the guess and the score.\n// example:\nfunction compare(game, guess){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = compare;\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2]),[0, 0, 0, 0, 3, 3]);\n assert.deepEqual(candidate([0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]),[0, 0, 0, 0, 0, 0]);\n assert.deepEqual(candidate([1, 2, 3], [-1, -2, -3]),[2, 4, 6]);\n assert.deepEqual(candidate([1, 2, 3, 5], [-1, 2, 3, 4]),[2, 0, 0, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "js", - "prompt": "//Given a positive integer n, return a tuple that has the number of even and odd\n// integer palindromes that fall within the range(1, n), inclusive.\n// Example 1:\n// Explanation:\n// Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n// Example 2:\n// Explanation:\n// Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n// Note:\n// 1. 1 <= n <= 10^3\n// 2. returned tuple has the number of even and odd integer palindromes respectively.\nfunction even_odd_palindrome(n){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = even_odd_palindrome;\n assert.deepEqual(candidate(123),[8, 13]);\n assert.deepEqual(candidate(12),[4, 6]);\n assert.deepEqual(candidate(3),[1, 2]);\n assert.deepEqual(candidate(63),[6, 8]);\n assert.deepEqual(candidate(25),[5, 6]);\n assert.deepEqual(candidate(19),[4, 6]);\n assert.deepEqual(candidate(9),[4, 5]);\n assert.deepEqual(candidate(1),[0, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "js", - "prompt": "//The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fib4(0) -> 0\n// fib4(1) -> 0\n// fib4(2) -> 2\n// fib4(3) -> 0\n// fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n// Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\nfunction fib4(n){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fib4;\n assert.deepEqual(candidate(5),4);\n assert.deepEqual(candidate(8),28);\n assert.deepEqual(candidate(10),104);\n assert.deepEqual(candidate(12),386);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "js", - "prompt": "//Given two positive integers a and b, return the even digits between a\n// and b, in ascending order.\n// For example:\nfunction generate_integers(a, b){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = generate_integers;\n assert.deepEqual(candidate(2, 10),[2, 4, 6, 8]);\n assert.deepEqual(candidate(10, 2),[2, 4, 6, 8]);\n assert.deepEqual(candidate(132, 2),[2, 4, 6, 8]);\n assert.deepEqual(candidate(17, 89),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "js", - "prompt": "//For a given list of input numbers, calculate Mean Absolute Deviation\n// around the mean of this dataset.\n// Mean Absolute Deviation is the average absolute difference between each\n// element and a centerpoint (mean in this case):\n// MAD = average | x - x_mean |\nfunction mean_absolute_deviation(numbers){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = mean_absolute_deviation;\n assert.deepEqual(candidate([1.0, 2.0]),0.5);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0]),1.0);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0]),1.2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "js", - "prompt": "//Create a function encrypt that takes a string as an argument and\n// returns a string encrypted with the alphabet being rotated. \n// The alphabet should be rotated in a manner such that the letters \n// shift down by two multiplied to two places.\n// For example:\nfunction encrypt(s){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = encrypt;\n assert.deepEqual(candidate(\"hi\"),\"lm\");\n assert.deepEqual(candidate(\"asdfghjkl\"),\"ewhjklnop\");\n assert.deepEqual(candidate(\"gf\"),\"kj\");\n assert.deepEqual(candidate(\"et\"),\"ix\");\n assert.deepEqual(candidate(\"faewfawefaewg\"),\"jeiajeaijeiak\");\n assert.deepEqual(candidate(\"hellomyfriend\"),\"lippsqcjvmirh\");\n assert.deepEqual(candidate(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\"),\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\");\n assert.deepEqual(candidate(\"a\"),\"e\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "js", - "prompt": "//Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n// The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n// as follows: start with any positive integer n. Then each term is obtained from the \n// previous term as follows: if the previous term is even, the next term is one half of \n// the previous term. If the previous term is odd, the next term is 3 times the previous\n// term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n// Note: \n// 1. Collatz(1) is [1].\n// 2. returned list sorted in increasing order.\n// For example:\n// get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\nfunction get_odd_collatz(n){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_odd_collatz;\n assert.deepEqual(candidate(14),[1, 5, 7, 11, 13, 17]);\n assert.deepEqual(candidate(5),[1, 5]);\n assert.deepEqual(candidate(12),[1, 3, 5]);\n assert.deepEqual(candidate(1),[1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "js", - "prompt": "//Find how many times a given substring can be found in the original string. Count overlaping cases.\nfunction how_many_times(string, substring){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = how_many_times;\n assert.deepEqual(candidate(\"\", \"x\"),0);\n assert.deepEqual(candidate(\"xyxyxyx\", \"x\"),4);\n assert.deepEqual(candidate(\"cacacacac\", \"cac\"),4);\n assert.deepEqual(candidate(\"john doe\", \"john\"),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "js", - "prompt": "//We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n// numbers in the array will be randomly ordered. Your task is to determine if\n// it is possible to get an array sorted in non-decreasing order by performing \n// the following operation on the given array:\n// You are allowed to perform right shift operation any number of times.\n// One right shift operation means shifting all elements of the array by one\n// position in the right direction. The last element of the array will be moved to\n// the starting position in the array i.e. 0th index. \n// If it is possible to obtain the sorted array by performing the above operation\n// then return True else return False.\n// If the given array is empty then return True.\n// Note: The given list is guaranteed to have unique elements.\n// For Example:\n// Explanation: By performin 2 right shift operations, non-decreasing order can\n// be achieved for the given array.\n// Explanation:It is not possible to get non-decreasing order for the given\n// array by performing any number of right shift operations.\nfunction move_one_ball(arr){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = move_one_ball;\n assert.deepEqual(candidate([3, 4, 5, 1, 2]),true);\n assert.deepEqual(candidate([3, 5, 10, 1, 2]),true);\n assert.deepEqual(candidate([4, 3, 1, 2]),false);\n assert.deepEqual(candidate([3, 5, 4, 1, 2]),false);\n assert.deepEqual(candidate([]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "js", - "prompt": "//Write a function which sorts the given list of integers\n// in ascending order according to the sum of their digits.\n// Note: if there are several items with similar sum of their digits,\n// order them based on their index in original list.\n// For example:\nfunction order_by_points(nums){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = order_by_points;\n assert.deepEqual(candidate([1, 11, -1, -11, -12]),[-1, -11, 1, -12, 11]);\n assert.deepEqual(candidate([1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]),[0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, -11, -32, 43, 54, -98, 2, -3]),[-3, -32, -98, -11, 1, 2, 43, 54]);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]),[1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9]);\n assert.deepEqual(candidate([0, 6, 6, -76, -21, 23, 4]),[-76, -21, 0, 4, 23, 6, 6]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "js", - "prompt": "//Return list of prime factors of given integer in the order from smallest to largest.\n// Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n// Input number should be equal to the product of all factors\nfunction factorize(n){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = factorize;\n assert.deepEqual(candidate(2),[2]);\n assert.deepEqual(candidate(4),[2, 2]);\n assert.deepEqual(candidate(8),[2, 2, 2]);\n assert.deepEqual(candidate(57),[3, 19]);\n assert.deepEqual(candidate(3249),[3, 3, 19, 19]);\n assert.deepEqual(candidate(185193),[3, 3, 3, 19, 19, 19]);\n assert.deepEqual(candidate(20577),[3, 19, 19, 19]);\n assert.deepEqual(candidate(18),[2, 3, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "js", - "prompt": "//Return True if all numbers in the list l are below threshold t.\nfunction below_threshold(l, t){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = below_threshold;\n assert.deepEqual(candidate([1, 2, 4, 10], 100),true);\n assert.deepEqual(candidate([1, 20, 4, 10], 5),false);\n assert.deepEqual(candidate([1, 20, 4, 10], 21),true);\n assert.deepEqual(candidate([1, 20, 4, 10], 22),true);\n assert.deepEqual(candidate([1, 8, 4, 10], 11),true);\n assert.deepEqual(candidate([1, 8, 4, 10], 10),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "js", - "prompt": "//You are given two positive integers n and m, and your task is to compute the\n// average of the integers from n through m (including n and m). \n// Round the answer to the nearest integer and convert that to binary.\n// If n is greater than m, return -1.\n// Example:\nfunction rounded_avg(n, m){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = rounded_avg;\n assert.deepEqual(candidate(1, 5),\"0b11\");\n assert.deepEqual(candidate(7, 13),\"0b1010\");\n assert.deepEqual(candidate(964, 977),\"0b1111001010\");\n assert.deepEqual(candidate(996, 997),\"0b1111100100\");\n assert.deepEqual(candidate(560, 851),\"0b1011000010\");\n assert.deepEqual(candidate(185, 546),\"0b101101110\");\n assert.deepEqual(candidate(362, 496),\"0b110101101\");\n assert.deepEqual(candidate(350, 902),\"0b1001110010\");\n assert.deepEqual(candidate(197, 233),\"0b11010111\");\n assert.deepEqual(candidate(7, 5),-1);\n assert.deepEqual(candidate(5, 1),-1);\n assert.deepEqual(candidate(5, 5),\"0b101\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "js", - "prompt": "//Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n// For each of the group, output the deepest level of nesting of parentheses.\n// E.g. (()()) has maximum two levels of nesting while ((())) has three.\nfunction parse_nested_parens(paren_string){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = parse_nested_parens;\n assert.deepEqual(candidate(\"(()()) ((())) () ((())()())\"),[2, 3, 1, 3]);\n assert.deepEqual(candidate(\"() (()) ((())) (((())))\"),[1, 2, 3, 4]);\n assert.deepEqual(candidate(\"(()(())((())))\"),[4]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "js", - "prompt": "//Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n// Examples\nfunction solution(lst){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = solution;\n assert.deepEqual(candidate([5, 8, 7, 1]),12);\n assert.deepEqual(candidate([3, 3, 3, 3, 3]),9);\n assert.deepEqual(candidate([30, 13, 24, 321]),0);\n assert.deepEqual(candidate([5, 9]),5);\n assert.deepEqual(candidate([2, 4, 8]),0);\n assert.deepEqual(candidate([30, 13, 23, 32]),23);\n assert.deepEqual(candidate([3, 13, 2, 9]),3);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "js", - "prompt": "//You are given a positive integer n. You have to create an integer array a of length n.\n// For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n// Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n// and a[i] + a[j] + a[k] is a multiple of 3.\n// Example :\n// Explanation: \n// a = [1, 3, 7, 13, 21]\n// The only valid triple is (1, 7, 13).\nfunction get_max_triples(n){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_max_triples;\n assert.deepEqual(candidate(5),1);\n assert.deepEqual(candidate(6),4);\n assert.deepEqual(candidate(10),36);\n assert.deepEqual(candidate(100),53361);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "js", - "prompt": "//There are eight planets in our solar system: the closerst to the Sun \n// is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n// Uranus, Neptune.\n// Write a function that takes two planet names as strings planet1 and planet2. \n// The function should return a tuple containing all planets whose orbits are \n// located between the orbit of planet1 and the orbit of planet2, sorted by \n// the proximity to the sun. \n// The function should return an empty tuple if planet1 or planet2\n// are not correct planet names. \n// Examples\nfunction bf(planet1, planet2){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = bf;\n assert.deepEqual(candidate(\"Jupiter\", \"Neptune\"),[\"Saturn\", \"Uranus\"]);\n assert.deepEqual(candidate(\"Earth\", \"Mercury\"),[\"Venus\"]);\n assert.deepEqual(candidate(\"Mercury\", \"Uranus\"),[\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"]);\n assert.deepEqual(candidate(\"Neptune\", \"Venus\"),[\"Earth\", \"Mars\", \"Jupiter\", \"Saturn\", \"Uranus\"]);\n assert.deepEqual(candidate(\"Earth\", \"Earth\"),[]);\n assert.deepEqual(candidate(\"Mars\", \"Earth\"),[]);\n assert.deepEqual(candidate(\"Jupiter\", \"Makemake\"),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "js", - "prompt": "//You are given a list of integers.\n// Write a function next_smallest() that returns the 2nd smallest element of the list.\n// Return None if there is no such element.\nfunction next_smallest(lst){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = next_smallest;\n assert.deepEqual(candidate([1, 2, 3, 4, 5]),2);\n assert.deepEqual(candidate([5, 1, 4, 3, 2]),2);\n assert.deepEqual(candidate([]),undefined);\n assert.deepEqual(candidate([1, 1]),undefined);\n assert.deepEqual(candidate([1, 1, 1, 1, 0]),1);\n assert.deepEqual(candidate([1, 1]),undefined);\n assert.deepEqual(candidate([-35, 34, 12, -45]),-35);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "js", - "prompt": "//Input is a space-delimited string of numberals from 'zero' to 'nine'.\n// Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n// Return the string with numbers sorted from smallest to largest\nfunction sort_numbers(numbers){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_numbers;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"three\"),\"three\");\n assert.deepEqual(candidate(\"three five nine\"),\"three five nine\");\n assert.deepEqual(candidate(\"five zero four seven nine eight\"),\"zero four five seven eight nine\");\n assert.deepEqual(candidate(\"six five four three two one zero\"),\"zero one two three four five six\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "js", - "prompt": "//You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\nfunction cycpattern_check(a, b){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = cycpattern_check;\n assert.deepEqual(candidate(\"xyzw\", \"xyw\"),false);\n assert.deepEqual(candidate(\"yello\", \"ell\"),true);\n assert.deepEqual(candidate(\"whattup\", \"ptut\"),false);\n assert.deepEqual(candidate(\"efef\", \"fee\"),true);\n assert.deepEqual(candidate(\"abab\", \"aabb\"),false);\n assert.deepEqual(candidate(\"winemtt\", \"tinem\"),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "js", - "prompt": "//You will be given a number in decimal form and your task is to convert it to\n// binary format. The function should return a string, with each character representing a binary\n// number. Each character in the string will be '0' or '1'.\n// There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n// The extra characters are there to help with the format.\n// Examples:\nfunction decimal_to_binary(decimal){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = decimal_to_binary;\n assert.deepEqual(candidate(0),\"db0db\");\n assert.deepEqual(candidate(32),\"db100000db\");\n assert.deepEqual(candidate(103),\"db1100111db\");\n assert.deepEqual(candidate(15),\"db1111db\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "js", - "prompt": "//Filter an input list of strings only for ones that contain given substring\nfunction filter_by_substring(strings, substring){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = filter_by_substring;\n assert.deepEqual(candidate([], \"john\"),[]);\n assert.deepEqual(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"),[\"xxx\", \"xxxAAA\", \"xxx\"]);\n assert.deepEqual(candidate([\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xx\"),[\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"]);\n assert.deepEqual(candidate([\"grunt\", \"trumpet\", \"prune\", \"gruesome\"], \"run\"),[\"grunt\", \"prune\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "js", - "prompt": "//Given an integer. return a tuple that has the number of even and odd digits respectively.\n// Example:\nfunction even_odd_count(num){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = even_odd_count;\n assert.deepEqual(candidate(7),[0, 1]);\n assert.deepEqual(candidate(-78),[1, 1]);\n assert.deepEqual(candidate(3452),[2, 2]);\n assert.deepEqual(candidate(346211),[3, 3]);\n assert.deepEqual(candidate(-345821),[3, 3]);\n assert.deepEqual(candidate(-2),[1, 0]);\n assert.deepEqual(candidate(-45347),[2, 3]);\n assert.deepEqual(candidate(0),[1, 0]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "js", - "prompt": "//Write a function that accepts a list of strings.\n// The list contains different words. Return the word with maximum number\n// of unique characters. If multiple strings have maximum number of unique\n// characters, return the one which comes first in lexicographical order.\nfunction find_max(words){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = find_max;\n assert.deepEqual(candidate([\"name\", \"of\", \"string\"]),\"string\");\n assert.deepEqual(candidate([\"name\", \"enam\", \"game\"]),\"enam\");\n assert.deepEqual(candidate([\"aaaaaaa\", \"bb\", \"cc\"]),\"aaaaaaa\");\n assert.deepEqual(candidate([\"abc\", \"cba\"]),\"abc\");\n assert.deepEqual(candidate([\"play\", \"this\", \"game\", \"of\", \"footbott\"]),\"footbott\");\n assert.deepEqual(candidate([\"we\", \"are\", \"gonna\", \"rock\"]),\"gonna\");\n assert.deepEqual(candidate([\"we\", \"are\", \"a\", \"mad\", \"nation\"]),\"nation\");\n assert.deepEqual(candidate([\"this\", \"is\", \"a\", \"prrk\"]),\"this\");\n assert.deepEqual(candidate([\"b\"]),\"b\");\n assert.deepEqual(candidate([\"play\", \"play\", \"play\"]),\"play\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "js", - "prompt": "//Create a function that returns a tuple (a, b), where 'a' is\n// the largest of negative integers, and 'b' is the smallest\n// of positive integers in a list.\n// If there is no negative or positive integers, return them as None.\n// Examples:\nfunction largest_smallest_integers(lst){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = largest_smallest_integers;\n assert.deepEqual(candidate([2, 4, 1, 3, 5, 7]),[undefined, 1]);\n assert.deepEqual(candidate([2, 4, 1, 3, 5, 7, 0]),[undefined, 1]);\n assert.deepEqual(candidate([1, 3, 2, 4, 5, 6, -2]),[-2, 1]);\n assert.deepEqual(candidate([4, 5, 3, 6, 2, 7, -7]),[-7, 2]);\n assert.deepEqual(candidate([7, 3, 8, 4, 9, 2, 5, -9]),[-9, 2]);\n assert.deepEqual(candidate([]),[undefined, undefined]);\n assert.deepEqual(candidate([0]),[undefined, undefined]);\n assert.deepEqual(candidate([-1, -3, -5, -6]),[-1, undefined]);\n assert.deepEqual(candidate([-1, -3, -5, -6, 0]),[-1, undefined]);\n assert.deepEqual(candidate([-6, -4, -4, -3, 1]),[-3, 1]);\n assert.deepEqual(candidate([-6, -4, -4, -3, -100, 1]),[-3, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "js", - "prompt": "//\"Given an array representing a branch of a tree that has non-negative integer nodes\n// your task is to pluck one of the nodes and return it.\n// The plucked node should be the node with the smallest even value.\n// If multiple nodes with the same smallest even value are found return the node that has smallest index.\n// The plucked node should be returned in a list, [ smalest_value, its index ],\n// If there are no even values or the given array is empty, return [].\n// Example 1:\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 2:\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 3:\n// Example 4:\n// Explanation: 0 is the smallest value, but there are two zeros,\n// so we will choose the first zero, which has the smallest index.\n// Constraints:\n// * 1 <= nodes.length <= 10000\n// * 0 <= node.value\nfunction pluck(arr){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = pluck;\n assert.deepEqual(candidate([4, 2, 3]),[2, 1]);\n assert.deepEqual(candidate([1, 2, 3]),[2, 1]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([5, 0, 3, 0, 4, 2]),[0, 1]);\n assert.deepEqual(candidate([1, 2, 3, 0, 5, 3]),[0, 3]);\n assert.deepEqual(candidate([5, 4, 8, 4, 8]),[4, 1]);\n assert.deepEqual(candidate([7, 6, 7, 1]),[6, 1]);\n assert.deepEqual(candidate([7, 9, 7, 1]),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "js", - "prompt": "//Write a function count_nums which takes an array of integers and returns\n// the number of elements which has a sum of digits > 0.\n// If a number is negative, then its first signed digit will be negative:\n// e.g. -123 has signed digits -1, 2, and 3.\nfunction count_nums(arr){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_nums;\n assert.deepEqual(candidate([]),0);\n assert.deepEqual(candidate([-1, -2, 0]),0);\n assert.deepEqual(candidate([1, 1, 2, -2, 3, 4, 5]),6);\n assert.deepEqual(candidate([1, 6, 9, -6, 0, 1, 5]),5);\n assert.deepEqual(candidate([1, 100, 98, -7, 1, -1]),4);\n assert.deepEqual(candidate([12, 23, 34, -45, -56, 0]),5);\n assert.deepEqual(candidate([0, 1]),1);\n assert.deepEqual(candidate([1]),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "js", - "prompt": "//Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n// each cell of the grid contains a value. Every integer in the range [1, N * N]\n// inclusive appears exactly once on the cells of the grid.\n// You have to find the minimum path of length k in the grid. You can start\n// from any cell, and in each step you can move to any of the neighbor cells,\n// in other words, you can go to cells which share an edge with you current\n// cell.\n// Please note that a path of length k means visiting exactly k cells (not\n// necessarily distinct).\n// You CANNOT go off the grid.\n// A path A (of length k) is considered less than a path B (of length k) if\n// after making the ordered lists of the values on the cells that A and B go\n// through (let's call them lst_A and lst_B), lst_A is lexicographically less\n// than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n// such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n// lst_A[j] = lst_B[j].\n// It is guaranteed that the answer is unique.\n// Return an ordered list of the values on the cells that the minimum path go through.\n// Examples:\nfunction minPath(grid, k){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = minPath;\n assert.deepEqual(candidate([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3),[1, 2, 1]);\n assert.deepEqual(candidate([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1),[1]);\n assert.deepEqual(candidate([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], 4),[1, 2, 1, 2]);\n assert.deepEqual(candidate([[6, 4, 13, 10], [5, 7, 12, 1], [3, 16, 11, 15], [8, 14, 9, 2]], 7),[1, 10, 1, 10, 1, 10, 1]);\n assert.deepEqual(candidate([[8, 14, 9, 2], [6, 4, 13, 15], [5, 7, 1, 12], [3, 10, 11, 16]], 5),[1, 7, 1, 7, 1]);\n assert.deepEqual(candidate([[11, 8, 7, 2], [5, 16, 14, 4], [9, 3, 15, 6], [12, 13, 10, 1]], 9),[1, 6, 1, 6, 1, 6, 1, 6, 1]);\n assert.deepEqual(candidate([[12, 13, 10, 1], [9, 3, 15, 6], [5, 16, 14, 4], [11, 8, 7, 2]], 12),[1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6]);\n assert.deepEqual(candidate([[2, 7, 4], [3, 1, 5], [6, 8, 9]], 8),[1, 3, 1, 3, 1, 3, 1, 3]);\n assert.deepEqual(candidate([[6, 1, 5], [3, 8, 9], [2, 7, 4]], 8),[1, 5, 1, 5, 1, 5, 1, 5]);\n assert.deepEqual(candidate([[1, 2], [3, 4]], 10),[1, 2, 1, 2, 1, 2, 1, 2, 1, 2]);\n assert.deepEqual(candidate([[1, 3], [3, 2]], 10),[1, 3, 1, 3, 1, 3, 1, 3, 1, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "js", - "prompt": "//Given list of integers, return list in strange order.\n// Strange sorting, is when you start with the minimum value,\n// then maximum of the remaining integers, then minimum and so on.\n// Examples:\nfunction strange_sort_list(lst){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = strange_sort_list;\n assert.deepEqual(candidate([1, 2, 3, 4]),[1, 4, 2, 3]);\n assert.deepEqual(candidate([5, 6, 7, 8, 9]),[5, 9, 6, 8, 7]);\n assert.deepEqual(candidate([1, 2, 3, 4, 5]),[1, 5, 2, 4, 3]);\n assert.deepEqual(candidate([5, 6, 7, 8, 9, 1]),[1, 9, 5, 8, 6, 7]);\n assert.deepEqual(candidate([5, 5, 5, 5]),[5, 5, 5, 5]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6, 7, 8]),[1, 8, 2, 7, 3, 6, 4, 5]);\n assert.deepEqual(candidate([0, 2, 2, 2, 5, 5, -5, -5]),[-5, 5, -5, 5, 0, 2, 2, 2]);\n assert.deepEqual(candidate([111111]),[111111]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "js", - "prompt": "//Given a string 'text', return its md5 hash equivalent string.\n// If 'text' is an empty string, return None.\nfunction string_to_md5(text){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = string_to_md5;\n assert.deepEqual(candidate(\"Hello world\"),\"3e25960a79dbc69b674cd4ec67a72c62\");\n assert.deepEqual(candidate(\"\"),undefined);\n assert.deepEqual(candidate(\"A B C\"),\"0ef78513b0cb8cef12743f5aeb35f888\");\n assert.deepEqual(candidate(\"password\"),\"5f4dcc3b5aa765d61d8327deb882cf99\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "js", - "prompt": "//You are given a word. Your task is to find the closest vowel that stands between \n// two consonants from the right side of the word (case sensitive).\n// Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n// find any vowel met the above condition. \n// You may assume that the given string contains English letter only.\n// Example:\nfunction get_closest_vowel(word){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_closest_vowel;\n assert.deepEqual(candidate(\"yogurt\"),\"u\");\n assert.deepEqual(candidate(\"full\"),\"u\");\n assert.deepEqual(candidate(\"easy\"),\"\");\n assert.deepEqual(candidate(\"eAsy\"),\"\");\n assert.deepEqual(candidate(\"ali\"),\"\");\n assert.deepEqual(candidate(\"bad\"),\"a\");\n assert.deepEqual(candidate(\"most\"),\"o\");\n assert.deepEqual(candidate(\"ab\"),\"\");\n assert.deepEqual(candidate(\"ba\"),\"\");\n assert.deepEqual(candidate(\"quick\"),\"\");\n assert.deepEqual(candidate(\"anime\"),\"i\");\n assert.deepEqual(candidate(\"Asia\"),\"\");\n assert.deepEqual(candidate(\"Above\"),\"o\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "js", - "prompt": "//Change numerical base of input number x to base.\n// return string representation after the conversion.\n// base numbers are less than 10.\nfunction change_base(x, base){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = change_base;\n assert.deepEqual(candidate(8, 3),\"22\");\n assert.deepEqual(candidate(9, 3),\"100\");\n assert.deepEqual(candidate(234, 2),\"11101010\");\n assert.deepEqual(candidate(16, 2),\"10000\");\n assert.deepEqual(candidate(8, 2),\"1000\");\n assert.deepEqual(candidate(7, 2),\"111\");\n assert.deepEqual(candidate(2, 3),\"2\");\n assert.deepEqual(candidate(3, 4),\"3\");\n assert.deepEqual(candidate(4, 5),\"4\");\n assert.deepEqual(candidate(5, 6),\"5\");\n assert.deepEqual(candidate(6, 7),\"6\");\n assert.deepEqual(candidate(7, 8),\"7\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "js", - "prompt": "//Check if in given list of numbers, are any two numbers closer to each other than\n// given threshold.\nfunction has_close_elements(numbers, threshold){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = has_close_elements;\n assert.deepEqual(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3),true);\n assert.deepEqual(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05),false);\n assert.deepEqual(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.95),true);\n assert.deepEqual(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.8),false);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1),true);\n assert.deepEqual(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 1.0),true);\n assert.deepEqual(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 0.5),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "js", - "prompt": "//Create a function that takes a string as input which contains only square brackets.\n// The function should return True if and only if there is a valid subsequence of brackets \n// where at least one bracket in the subsequence is nested.\nfunction is_nested(string){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_nested;\n assert.deepEqual(candidate(\"[[]]\"),true);\n assert.deepEqual(candidate(\"[]]]]]]][[[[[]\"),false);\n assert.deepEqual(candidate(\"[][]\"),false);\n assert.deepEqual(candidate(\"[]\"),false);\n assert.deepEqual(candidate(\"[[[[]]]]\"),true);\n assert.deepEqual(candidate(\"[]]]]]]]]]]\"),false);\n assert.deepEqual(candidate(\"[][][[]]\"),true);\n assert.deepEqual(candidate(\"[[]\"),false);\n assert.deepEqual(candidate(\"[]]\"),false);\n assert.deepEqual(candidate(\"[[]][[\"),true);\n assert.deepEqual(candidate(\"[[][]]\"),true);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"[[[[[[[[\"),false);\n assert.deepEqual(candidate(\"]]]]]]]]\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "js", - "prompt": "//Concatenate list of strings into a single string\nfunction concatenate(strings){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = concatenate;\n assert.deepEqual(candidate([]),\"\");\n assert.deepEqual(candidate([\"x\", \"y\", \"z\"]),\"xyz\");\n assert.deepEqual(candidate([\"x\", \"y\", \"z\", \"w\", \"k\"]),\"xyzwk\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "js", - "prompt": "//prime_fib returns n-th number that is a Fibonacci number and it's also prime.\nfunction prime_fib(n){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = prime_fib;\n assert.deepEqual(candidate(1),2);\n assert.deepEqual(candidate(2),3);\n assert.deepEqual(candidate(3),5);\n assert.deepEqual(candidate(4),13);\n assert.deepEqual(candidate(5),89);\n assert.deepEqual(candidate(6),233);\n assert.deepEqual(candidate(7),1597);\n assert.deepEqual(candidate(8),28657);\n assert.deepEqual(candidate(9),514229);\n assert.deepEqual(candidate(10),433494437);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "js", - "prompt": "//From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n// other and return them in order (smaller number, larger number).\nfunction find_closest_elements(numbers){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = find_closest_elements;\n assert.deepEqual(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2]),[3.9, 4.0]);\n assert.deepEqual(candidate([1.0, 2.0, 5.9, 4.0, 5.0]),[5.0, 5.9]);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]),[2.0, 2.2]);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]),[2.0, 2.0]);\n assert.deepEqual(candidate([1.1, 2.2, 3.1, 4.1, 5.1]),[2.2, 3.1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "js", - "prompt": "//You have been tasked to write a function that receives \n// a hexadecimal number as a string and counts the number of hexadecimal \n// digits that are primes (prime number, or a prime, is a natural number \n// greater than 1 that is not a product of two smaller natural numbers).\n// Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n// Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n// So you have to determine a number of the following digits: 2, 3, 5, 7, \n// B (=decimal 11), D (=decimal 13).\n// Note: you may assume the input is always correct or empty string, \n// and symbols A,B,C,D,E,F are always uppercase.\n// Examples:\nfunction hex_key(num){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = hex_key;\n assert.deepEqual(candidate(\"AB\"),1);\n assert.deepEqual(candidate(\"1077E\"),2);\n assert.deepEqual(candidate(\"ABED1A33\"),4);\n assert.deepEqual(candidate(\"2020\"),2);\n assert.deepEqual(candidate(\"123456789ABCDEF0\"),6);\n assert.deepEqual(candidate(\"112233445566778899AABBCCDDEEFF00\"),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "js", - "prompt": "//Complete the function that takes two integers and returns \n// the product of their unit digits.\n// Assume the input is always valid.\n// Examples:\nfunction multiply(a, b){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = multiply;\n assert.deepEqual(candidate(148, 412),16);\n assert.deepEqual(candidate(19, 28),72);\n assert.deepEqual(candidate(2020, 1851),0);\n assert.deepEqual(candidate(14, -15),20);\n assert.deepEqual(candidate(76, 67),42);\n assert.deepEqual(candidate(17, 27),49);\n assert.deepEqual(candidate(0, 1),0);\n assert.deepEqual(candidate(0, 0),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "js", - "prompt": "//Given list of numbers (of at least two elements), apply a linear transform to that list,\n// such that the smallest number will become 0 and the largest will become 1\nfunction rescale_to_unit(numbers){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = rescale_to_unit;\n assert.deepEqual(candidate([2.0, 49.9]),[0.0, 1.0]);\n assert.deepEqual(candidate([100.0, 49.9]),[1.0, 0.0]);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0]),[0.0, 0.25, 0.5, 0.75, 1.0]);\n assert.deepEqual(candidate([2.0, 1.0, 5.0, 3.0, 4.0]),[0.25, 0.0, 1.0, 0.5, 0.75]);\n assert.deepEqual(candidate([12.0, 11.0, 15.0, 13.0, 14.0]),[0.25, 0.0, 1.0, 0.5, 0.75]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "js", - "prompt": "//Given a positive integer n, return the product of the odd digits.\n// Return 0 if all digits are even.\n// For example:\nfunction digits(n){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = digits;\n assert.deepEqual(candidate(5),5);\n assert.deepEqual(candidate(54),5);\n assert.deepEqual(candidate(120),1);\n assert.deepEqual(candidate(5014),5);\n assert.deepEqual(candidate(98765),315);\n assert.deepEqual(candidate(5576543),2625);\n assert.deepEqual(candidate(2468),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "js", - "prompt": "//You will be given the name of a class (a string) and a list of extensions.\n// The extensions are to be used to load additional classes to the class. The\n// strength of the extension is as follows: Let CAP be the number of the uppercase\n// letters in the extension's name, and let SM be the number of lowercase letters \n// in the extension's name, the strength is given by the fraction CAP - SM. \n// You should find the strongest extension and return a string in this \n// format: ClassName.StrongestExtensionName.\n// If there are two or more extensions with the same strength, you should\n// choose the one that comes first in the list.\n// For example, if you are given \"Slices\" as the class and a list of the\n// extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n// return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n// (its strength is -1).\n// Example:\nfunction Strongest_Extension(class_name, extensions){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = Strongest_Extension;\n assert.deepEqual(candidate(\"Watashi\", [\"tEN\", \"niNE\", \"eIGHt8OKe\"]),\"Watashi.eIGHt8OKe\");\n assert.deepEqual(candidate(\"Boku123\", [\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"]),\"Boku123.YEs.WeCaNe\");\n assert.deepEqual(candidate(\"__YESIMHERE\", [\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"]),\"__YESIMHERE.NuLl__\");\n assert.deepEqual(candidate(\"K\", [\"Ta\", \"TAR\", \"t234An\", \"cosSo\"]),\"K.TAR\");\n assert.deepEqual(candidate(\"__HAHA\", [\"Tab\", \"123\", \"781345\", \"-_-\"]),\"__HAHA.123\");\n assert.deepEqual(candidate(\"YameRore\", [\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"]),\"YameRore.okIWILL123\");\n assert.deepEqual(candidate(\"finNNalLLly\", [\"Die\", \"NowW\", \"Wow\", \"WoW\"]),\"finNNalLLly.WoW\");\n assert.deepEqual(candidate(\"_\", [\"Bb\", \"91245\"]),\"_.Bb\");\n assert.deepEqual(candidate(\"Sp\", [\"671235\", \"Bb\"]),\"Sp.671235\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "js", - "prompt": "//Given a string representing a space separated lowercase letters, return a dictionary\n// of the letter with the most repetition and containing the corresponding count.\n// If several letters have the same occurrence, return all of them.\n// Example:\nfunction histogram(test){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = histogram;\n assert.deepEqual(candidate(\"a b b a\"),{\"a\": 2, \"b\": 2});\n assert.deepEqual(candidate(\"a b c a b\"),{\"a\": 2, \"b\": 2});\n assert.deepEqual(candidate(\"a b c d g\"),{\"a\": 1, \"b\": 1, \"c\": 1, \"d\": 1, \"g\": 1});\n assert.deepEqual(candidate(\"r t g\"),{\"r\": 1, \"t\": 1, \"g\": 1});\n assert.deepEqual(candidate(\"b b b b a\"),{\"b\": 4});\n assert.deepEqual(candidate(\"r t g\"),{\"r\": 1, \"t\": 1, \"g\": 1});\n assert.deepEqual(candidate(\"\"),{});\n assert.deepEqual(candidate(\"a\"),{\"a\": 1});\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "js", - "prompt": "//pairs_sum_to_zero takes a list of integers as an input.\n// it returns True if there are two distinct elements in the list that\n// sum to zero, and False otherwise.\nfunction pairs_sum_to_zero(l){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = pairs_sum_to_zero;\n assert.deepEqual(candidate([1, 3, 5, 0]),false);\n assert.deepEqual(candidate([1, 3, -2, 1]),false);\n assert.deepEqual(candidate([1, 2, 3, 7]),false);\n assert.deepEqual(candidate([2, 4, -5, 3, 5, 7]),true);\n assert.deepEqual(candidate([1]),false);\n assert.deepEqual(candidate([-3, 9, -1, 3, 2, 30]),true);\n assert.deepEqual(candidate([-3, 9, -1, 3, 2, 31]),true);\n assert.deepEqual(candidate([-3, 9, -1, 4, 2, 30]),false);\n assert.deepEqual(candidate([-3, 9, -1, 4, 2, 31]),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "js", - "prompt": "//Write a function that accepts two lists of strings and returns the list that has \n// total number of chars in the all strings of the list less than the other list.\n// if the two lists have the same number of chars, return the first list.\n// Examples\nfunction total_match(lst1, lst2){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = total_match;\n assert.deepEqual(candidate([], []),[]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\"]),[\"hi\", \"hi\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"]),[\"hi\", \"admin\"]);\n assert.deepEqual(candidate([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"]),[\"4\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hI\", \"Hi\"]),[\"hI\", \"Hi\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"]),[\"hI\", \"hi\", \"hi\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hii\"]),[\"hi\", \"admin\"]);\n assert.deepEqual(candidate([], [\"this\"]),[]);\n assert.deepEqual(candidate([\"this\"], []),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "js", - "prompt": "//Circular shift the digits of the integer x, shift the digits right by shift\n// and return the result as a string.\n// If shift > number of digits, return digits reversed.\nfunction circular_shift(x, shift){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = circular_shift;\n assert.deepEqual(candidate(100, 2),\"001\");\n assert.deepEqual(candidate(12, 2),\"12\");\n assert.deepEqual(candidate(97, 8),\"79\");\n assert.deepEqual(candidate(12, 1),\"21\");\n assert.deepEqual(candidate(11, 101),\"11\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "js", - "prompt": "//Return True is list elements are monotonically increasing or decreasing.\nfunction monotonic(l){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = monotonic;\n assert.deepEqual(candidate([1, 2, 4, 10]),true);\n assert.deepEqual(candidate([1, 2, 4, 20]),true);\n assert.deepEqual(candidate([1, 20, 4, 10]),false);\n assert.deepEqual(candidate([4, 1, 0, -10]),true);\n assert.deepEqual(candidate([4, 1, 1, 0]),true);\n assert.deepEqual(candidate([1, 2, 3, 2, 5, 60]),false);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 60]),true);\n assert.deepEqual(candidate([9, 9, 9, 9]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "js", - "prompt": "//Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n// Example\nfunction is_equal_to_sum_even(n){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_equal_to_sum_even;\n assert.deepEqual(candidate(4),false);\n assert.deepEqual(candidate(6),false);\n assert.deepEqual(candidate(8),true);\n assert.deepEqual(candidate(10),true);\n assert.deepEqual(candidate(11),false);\n assert.deepEqual(candidate(12),true);\n assert.deepEqual(candidate(13),false);\n assert.deepEqual(candidate(16),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "js", - "prompt": "//Input to this function is a string representing musical notes in a special ASCII format.\n// Your task is to parse this string and return list of integers corresponding to how many beats does each\n// not last.\n// Here is a legend:\n// 'o' - whole note, lasts four beats\n// 'o|' - half note, lasts two beats\n// '.|' - quater note, lasts one beat\nfunction parse_music(music_string){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = parse_music;\n assert.deepEqual(candidate(\"\"),[]);\n assert.deepEqual(candidate(\"o o o o\"),[4, 4, 4, 4]);\n assert.deepEqual(candidate(\".| .| .| .|\"),[1, 1, 1, 1]);\n assert.deepEqual(candidate(\"o| o| .| .| o o o o\"),[2, 2, 1, 1, 4, 4, 4, 4]);\n assert.deepEqual(candidate(\"o| .| o| .| o o| o o|\"),[2, 1, 2, 1, 4, 2, 4, 2]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "js", - "prompt": "//\"\n// This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n// multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n// change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n// Examples:\nfunction sum_squares(lst){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_squares;\n assert.deepEqual(candidate([1, 2, 3]),6);\n assert.deepEqual(candidate([1, 4, 9]),14);\n assert.deepEqual(candidate([]),0);\n assert.deepEqual(candidate([1, 1, 1, 1, 1, 1, 1, 1, 1]),9);\n assert.deepEqual(candidate([-1, -1, -1, -1, -1, -1, -1, -1, -1]),-3);\n assert.deepEqual(candidate([0]),0);\n assert.deepEqual(candidate([-1, -5, 2, -1, -5]),-126);\n assert.deepEqual(candidate([-56, -99, 1, 0, -2]),3030);\n assert.deepEqual(candidate([-1, 0, 0, 0, 0, 0, 0, 0, -1]),0);\n assert.deepEqual(candidate([-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37]),-14196);\n assert.deepEqual(candidate([-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10]),-1448);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "js", - "prompt": "//triples_sum_to_zero takes a list of integers as an input.\n// it returns True if there are three distinct elements in the list that\n// sum to zero, and False otherwise.\nfunction triples_sum_to_zero(l){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = triples_sum_to_zero;\n assert.deepEqual(candidate([1, 3, 5, 0]),false);\n assert.deepEqual(candidate([1, 3, 5, -1]),false);\n assert.deepEqual(candidate([1, 3, -2, 1]),true);\n assert.deepEqual(candidate([1, 2, 3, 7]),false);\n assert.deepEqual(candidate([1, 2, 5, 7]),false);\n assert.deepEqual(candidate([2, 4, -5, 3, 9, 7]),true);\n assert.deepEqual(candidate([1]),false);\n assert.deepEqual(candidate([1, 3, 5, -100]),false);\n assert.deepEqual(candidate([100, 3, 5, -100]),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "js", - "prompt": "//brackets is a string of \"<\" and \">\".\n// return True if every opening bracket has a corresponding closing bracket.\nfunction correct_bracketing(brackets){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = correct_bracketing;\n assert.deepEqual(candidate(\"<>\"),true);\n assert.deepEqual(candidate(\"<<><>>\"),true);\n assert.deepEqual(candidate(\"<><><<><>><>\"),true);\n assert.deepEqual(candidate(\"<><><<<><><>><>><<><><<>>>\"),true);\n assert.deepEqual(candidate(\"<<<><>>>>\"),false);\n assert.deepEqual(candidate(\"><<>\"),false);\n assert.deepEqual(candidate(\"<\"),false);\n assert.deepEqual(candidate(\"<<<<\"),false);\n assert.deepEqual(candidate(\">\"),false);\n assert.deepEqual(candidate(\"<<>\"),false);\n assert.deepEqual(candidate(\"<><><<><>><>><<>\"),false);\n assert.deepEqual(candidate(\"<><><<><>><>>><>\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "js", - "prompt": "//Write a function that takes an array of numbers as input and returns \n// the number of elements in the array that are greater than 10 and both \n// first and last digits of a number are odd (1, 3, 5, 7, 9).\n// For example:\nfunction specialFilter(nums){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = specialFilter;\n assert.deepEqual(candidate([5, -2, 1, -5]),0);\n assert.deepEqual(candidate([15, -73, 14, -15]),1);\n assert.deepEqual(candidate([33, -2, -3, 45, 21, 109]),2);\n assert.deepEqual(candidate([43, -12, 93, 125, 121, 109]),4);\n assert.deepEqual(candidate([71, -2, -33, 75, 21, 19]),3);\n assert.deepEqual(candidate([1]),0);\n assert.deepEqual(candidate([]),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "js", - "prompt": "//Given a dictionary, return True if all keys are strings in lower \n// case or all keys are strings in upper case, else return False.\n// The function should return False is the given dictionary is empty.\n// Examples:\nfunction check_dict_case(dict){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = check_dict_case;\n assert.deepEqual(candidate({\"p\": \"pineapple\", \"b\": \"banana\"}),true);\n assert.deepEqual(candidate({\"p\": \"pineapple\", \"A\": \"banana\", \"B\": \"banana\"}),false);\n assert.deepEqual(candidate({\"p\": \"pineapple\", \"5\": \"banana\", \"a\": \"apple\"}),false);\n assert.deepEqual(candidate({\"Name\": \"John\", \"Age\": \"36\", \"City\": \"Houston\"}),false);\n assert.deepEqual(candidate({\"STATE\": \"NC\", \"ZIP\": \"12345\"}),true);\n assert.deepEqual(candidate({\"fruit\": \"Orange\", \"taste\": \"Sweet\"}),true);\n assert.deepEqual(candidate({}),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "js", - "prompt": "//Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n// should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n// alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n// Examples\nfunction split_words(txt){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = split_words;\n assert.deepEqual(candidate(\"Hello world!\"),[\"Hello\", \"world!\"]);\n assert.deepEqual(candidate(\"Hello,world!\"),[\"Hello\", \"world!\"]);\n assert.deepEqual(candidate(\"Hello world,!\"),[\"Hello\", \"world,!\"]);\n assert.deepEqual(candidate(\"Hello,Hello,world !\"),[\"Hello,Hello,world\", \"!\"]);\n assert.deepEqual(candidate(\"abcdef\"),3);\n assert.deepEqual(candidate(\"aaabb\"),2);\n assert.deepEqual(candidate(\"aaaBb\"),1);\n assert.deepEqual(candidate(\"\"),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "js", - "prompt": "//The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fibfib(0) == 0\n// fibfib(1) == 0\n// fibfib(2) == 1\n// fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n// Please write a function to efficiently compute the n-th element of the fibfib number sequence.\nfunction fibfib(n){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fibfib;\n assert.deepEqual(candidate(2),1);\n assert.deepEqual(candidate(1),0);\n assert.deepEqual(candidate(5),4);\n assert.deepEqual(candidate(8),24);\n assert.deepEqual(candidate(10),81);\n assert.deepEqual(candidate(12),274);\n assert.deepEqual(candidate(14),927);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "js", - "prompt": "//You are given a list of numbers.\n// You need to return the sum of squared numbers in the given list,\n// round each element in the list to the upper int(Ceiling) first.\n// Examples:\nfunction sum_squares(lst){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_squares;\n assert.deepEqual(candidate([1.0, 2.0, 3.0]),14);\n assert.deepEqual(candidate([1.0, 2.0, 3.0]),14);\n assert.deepEqual(candidate([1.0, 3.0, 5.0, 7.0]),84);\n assert.deepEqual(candidate([1.4, 4.2, 0.0]),29);\n assert.deepEqual(candidate([-2.4, 1.0, 1.0]),6);\n assert.deepEqual(candidate([100.0, 1.0, 15.0, 2.0]),10230);\n assert.deepEqual(candidate([10000.0, 10000.0]),200000000);\n assert.deepEqual(candidate([-1.4, 4.6, 6.3]),75);\n assert.deepEqual(candidate([-1.4, 17.9, 18.9, 19.9]),1086);\n assert.deepEqual(candidate([0.0]),0);\n assert.deepEqual(candidate([-1.0]),1);\n assert.deepEqual(candidate([-1.0, 1.0, 0.0]),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_85_add", - "language": "js", - "prompt": "//Given a non-empty list of integers lst. add the even elements that are at odd indices..\n// Examples:\nfunction add(lst){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = add;\n assert.deepEqual(candidate([4, 88]),88);\n assert.deepEqual(candidate([4, 5, 6, 7, 2, 122]),122);\n assert.deepEqual(candidate([4, 0, 6, 7]),0);\n assert.deepEqual(candidate([4, 4, 6, 8]),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "js", - "prompt": "//Return sorted unique elements in a list\nfunction unique(l){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = unique;\n assert.deepEqual(candidate([5, 3, 5, 2, 3, 3, 9, 0, 123]),[0, 2, 3, 5, 9, 123]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "js", - "prompt": "//Given a string text, replace all spaces in it with underscores, \n// and if a string has more than 2 consecutive spaces, \n// then replace all consecutive spaces with -\nfunction fix_spaces(text){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fix_spaces;\n assert.deepEqual(candidate(\"Example\"),\"Example\");\n assert.deepEqual(candidate(\"Mudasir Hanif \"),\"Mudasir_Hanif_\");\n assert.deepEqual(candidate(\"Yellow Yellow Dirty Fellow\"),\"Yellow_Yellow__Dirty__Fellow\");\n assert.deepEqual(candidate(\"Exa mple\"),\"Exa-mple\");\n assert.deepEqual(candidate(\" Exa 1 2 2 mple\"),\"-Exa_1_2_2_mple\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "js", - "prompt": "//Return 2^n modulo p (be aware of numerics).\nfunction modp(n, p){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = modp;\n assert.deepEqual(candidate(3, 5),3);\n assert.deepEqual(candidate(1101, 101),2);\n assert.deepEqual(candidate(0, 101),1);\n assert.deepEqual(candidate(3, 11),8);\n assert.deepEqual(candidate(100, 101),1);\n assert.deepEqual(candidate(30, 5),4);\n assert.deepEqual(candidate(31, 5),3);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "js", - "prompt": "//You have to write a function which validates a given date string and\n// returns True if the date is valid otherwise False.\n// The date is valid if all of the following rules are satisfied:\n// 1. The date string is not empty.\n// 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n// 3. The months should not be less than 1 or higher than 12.\n// 4. The date should be in the format: mm-dd-yyyy\nfunction valid_date(date){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = valid_date;\n assert.deepEqual(candidate(\"03-11-2000\"),true);\n assert.deepEqual(candidate(\"15-01-2012\"),false);\n assert.deepEqual(candidate(\"04-0-2040\"),false);\n assert.deepEqual(candidate(\"06-04-2020\"),true);\n assert.deepEqual(candidate(\"01-01-2007\"),true);\n assert.deepEqual(candidate(\"03-32-2011\"),false);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"04-31-3000\"),false);\n assert.deepEqual(candidate(\"06-06-2005\"),true);\n assert.deepEqual(candidate(\"21-31-2000\"),false);\n assert.deepEqual(candidate(\"04-12-2003\"),true);\n assert.deepEqual(candidate(\"04122003\"),false);\n assert.deepEqual(candidate(\"20030412\"),false);\n assert.deepEqual(candidate(\"2003-04\"),false);\n assert.deepEqual(candidate(\"2003-04-12\"),false);\n assert.deepEqual(candidate(\"04-2003\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "js", - "prompt": "//Write a function that takes a string and returns an ordered version of it.\n// Ordered version of string, is a string where all words (separated by space)\n// are replaced by a new word where all the characters arranged in\n// ascending order based on ascii value.\n// Note: You should keep the order of words and blank spaces in the sentence.\n// For example:\nfunction anti_shuffle(s){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = anti_shuffle;\n assert.deepEqual(candidate(\"Hi\"),\"Hi\");\n assert.deepEqual(candidate(\"hello\"),\"ehllo\");\n assert.deepEqual(candidate(\"number\"),\"bemnru\");\n assert.deepEqual(candidate(\"abcd\"),\"abcd\");\n assert.deepEqual(candidate(\"Hello World!!!\"),\"Hello !!!Wdlor\");\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"Hi. My name is Mister Robot. How are you?\"),\".Hi My aemn is Meirst .Rboot How aer ?ouy\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "js", - "prompt": "//Given a list of numbers, return whether or not they are sorted\n// in ascending order. If list has more than 1 duplicate of the same\n// number, return False. Assume no negative numbers and only integers.\n// Examples\nfunction is_sorted(lst){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_sorted;\n assert.deepEqual(candidate([5]),true);\n assert.deepEqual(candidate([1, 2, 3, 4, 5]),true);\n assert.deepEqual(candidate([1, 3, 2, 4, 5]),false);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6]),true);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6, 7]),true);\n assert.deepEqual(candidate([1, 3, 2, 4, 5, 6, 7]),false);\n assert.deepEqual(candidate([]),true);\n assert.deepEqual(candidate([1]),true);\n assert.deepEqual(candidate([3, 2, 1]),false);\n assert.deepEqual(candidate([1, 2, 2, 2, 3, 4]),false);\n assert.deepEqual(candidate([1, 2, 3, 3, 3, 4]),false);\n assert.deepEqual(candidate([1, 2, 2, 3, 3, 4]),true);\n assert.deepEqual(candidate([1, 2, 3, 4]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "js", - "prompt": "//You are given a string s.\n// Your task is to check if the string is happy or not.\n// A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n// For example:\nfunction is_happy(s){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_happy;\n assert.deepEqual(candidate(\"a\"),false);\n assert.deepEqual(candidate(\"aa\"),false);\n assert.deepEqual(candidate(\"abcd\"),true);\n assert.deepEqual(candidate(\"aabb\"),false);\n assert.deepEqual(candidate(\"adb\"),true);\n assert.deepEqual(candidate(\"xyy\"),false);\n assert.deepEqual(candidate(\"iopaxpoi\"),true);\n assert.deepEqual(candidate(\"iopaxioi\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "js", - "prompt": "//Write a function that returns True if the object q will fly, and False otherwise.\n// The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n// Example:\n// # 1+2 is less than the maximum possible weight, but it's unbalanced.\n// # it's balanced, but 3+2+3 is more than the maximum possible weight.\n// # 3+2+3 is less than the maximum possible weight, and it's balanced.\n// # 3 is less than the maximum possible weight, and it's balanced.\nfunction will_it_fly(q, w){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = will_it_fly;\n assert.deepEqual(candidate([3, 2, 3], 9),true);\n assert.deepEqual(candidate([1, 2], 5),false);\n assert.deepEqual(candidate([3], 5),true);\n assert.deepEqual(candidate([3, 2, 3], 1),false);\n assert.deepEqual(candidate([1, 2, 3], 6),false);\n assert.deepEqual(candidate([5], 5),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "js", - "prompt": "//Given an array of non-negative integers, return a copy of the given array after sorting,\n// you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n// or sort it in descending order if the sum( first index value, last index value) is even.\n// Note:\n// * don't change the given array.\n// Examples:\nfunction sort_array(array){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_array;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([5]),[5]);\n assert.deepEqual(candidate([2, 4, 3, 0, 1, 5]),[0, 1, 2, 3, 4, 5]);\n assert.deepEqual(candidate([2, 4, 3, 0, 1, 5, 6]),[6, 5, 4, 3, 2, 1, 0]);\n assert.deepEqual(candidate([2, 1]),[1, 2]);\n assert.deepEqual(candidate([15, 42, 87, 32, 11, 0]),[0, 11, 15, 32, 42, 87]);\n assert.deepEqual(candidate([21, 14, 23, 11]),[23, 21, 14, 11]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "js", - "prompt": "//Implement a function that takes an non-negative integer and returns an array of the first n\n// integers that are prime numbers and less than n.\n// for example:\nfunction count_up_to(n){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_up_to;\n assert.deepEqual(candidate(5),[2, 3]);\n assert.deepEqual(candidate(6),[2, 3, 5]);\n assert.deepEqual(candidate(7),[2, 3, 5]);\n assert.deepEqual(candidate(10),[2, 3, 5, 7]);\n assert.deepEqual(candidate(0),[]);\n assert.deepEqual(candidate(22),[2, 3, 5, 7, 11, 13, 17, 19]);\n assert.deepEqual(candidate(1),[]);\n assert.deepEqual(candidate(18),[2, 3, 5, 7, 11, 13, 17]);\n assert.deepEqual(candidate(47),[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43]);\n assert.deepEqual(candidate(101),[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "js", - "prompt": "//Out of list of strings, return the longest one. Return the first one in case of multiple\n// strings of the same length. Return None in case the input list is empty.\nfunction longest(strings){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = longest;\n assert.deepEqual(candidate([]),undefined);\n assert.deepEqual(candidate([\"x\", \"y\", \"z\"]),\"x\");\n assert.deepEqual(candidate([\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"]),\"zzzz\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "js", - "prompt": "//Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n// reverse the resulting array, and then replace each digit by its corresponding name from\n// \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n// For example:\n// If the array is empty, return an empty array:\n// If the array has any strange number ignore it:\nfunction by_length(arr){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = by_length;\n assert.deepEqual(candidate([2, 1, 1, 4, 5, 8, 2, 3]),[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, -1, 55]),[\"One\"]);\n assert.deepEqual(candidate([1, -1, 3, 2]),[\"Three\", \"Two\", \"One\"]);\n assert.deepEqual(candidate([9, 4, 8]),[\"Nine\", \"Eight\", \"Four\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_106_f", - "language": "js", - "prompt": "//Implement the function f that takes n as a parameter,\n// 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\n// or the sum of numbers from 1 to i otherwise.\n// i starts from 1.\n// the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n// Example:\nfunction f(n){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = f;\n assert.deepEqual(candidate(5),[1, 2, 6, 24, 15]);\n assert.deepEqual(candidate(7),[1, 2, 6, 24, 15, 720, 28]);\n assert.deepEqual(candidate(1),[1]);\n assert.deepEqual(candidate(3),[1, 2, 6]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "js", - "prompt": "//Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\nfunction fizz_buzz(n){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fizz_buzz;\n assert.deepEqual(candidate(50),0);\n assert.deepEqual(candidate(78),2);\n assert.deepEqual(candidate(79),3);\n assert.deepEqual(candidate(100),3);\n assert.deepEqual(candidate(200),6);\n assert.deepEqual(candidate(4000),192);\n assert.deepEqual(candidate(10000),639);\n assert.deepEqual(candidate(100000),8026);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "js", - "prompt": "//Given a positive floating point number, it can be decomposed into\n// and integer part (largest integer smaller than given number) and decimals\n// (leftover part always smaller than 1).\n// Return the decimal part of the number.\nfunction truncate_number(number){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = truncate_number;\n assert.deepEqual(candidate(3.5),0.5);\n assert.deepEqual(candidate(1.25),0.25);\n assert.deepEqual(candidate(123.0),0.0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "js", - "prompt": "//For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n// Empty sum should be equal to 0 and empty product should be equal to 1.\nfunction sum_product(numbers){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_product;\n assert.deepEqual(candidate([]),[0, 1]);\n assert.deepEqual(candidate([1, 1, 1]),[3, 1]);\n assert.deepEqual(candidate([100, 0]),[100, 0]);\n assert.deepEqual(candidate([3, 5, 7]),[15, 105]);\n assert.deepEqual(candidate([10]),[10, 10]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "js", - "prompt": "//You are given a 2 dimensional data, as a nested lists,\n// which is similar to matrix, however, unlike matrices,\n// each row may contain a different number of columns.\n// Given lst, and integer x, find integers x in the list,\n// and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n// each tuple is a coordinate - (row, columns), starting with 0.\n// Sort coordinates initially by rows in ascending order.\n// Also, sort coordinates of the row by columns in descending order.\n// Examples:\nfunction get_row(lst, x){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_row;\n assert.deepEqual(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1),[[0, 0], [1, 4], [1, 0], [2, 5], [2, 0]]);\n assert.deepEqual(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6]], 2),[[0, 1], [1, 1], [2, 1], [3, 1], [4, 1], [5, 1]]);\n assert.deepEqual(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 1, 3, 4, 5, 6], [1, 2, 1, 4, 5, 6], [1, 2, 3, 1, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1),[[0, 0], [1, 0], [2, 1], [2, 0], [3, 2], [3, 0], [4, 3], [4, 0], [5, 4], [5, 0], [6, 5], [6, 0]]);\n assert.deepEqual(candidate([], 1),[]);\n assert.deepEqual(candidate([[1]], 2),[]);\n assert.deepEqual(candidate([[], [1], [1, 2, 3]], 3),[[2, 2]]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "js", - "prompt": "//You're a hungry rabbit, and you already have eaten a certain number of carrots,\n// but now you need to eat more carrots to complete the day's meals.\n// you should return an array of [ total number of eaten carrots after your meals,\n// the number of carrots left after your meals ]\n// if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n// Example:\n// Variables:\n// @number : integer\n// the number of carrots that you have eaten.\n// @need : integer\n// the number of carrots that you need to eat.\n// @remaining : integer\n// the number of remaining carrots thet exist in stock\n// Constrain:\n// * 0 <= number <= 1000\n// * 0 <= need <= 1000\n// * 0 <= remaining <= 1000\n// Have fun :)\nfunction eat(number, need, remaining){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = eat;\n assert.deepEqual(candidate(5, 6, 10),[11, 4]);\n assert.deepEqual(candidate(4, 8, 9),[12, 1]);\n assert.deepEqual(candidate(1, 10, 10),[11, 0]);\n assert.deepEqual(candidate(2, 11, 5),[7, 0]);\n assert.deepEqual(candidate(4, 5, 7),[9, 2]);\n assert.deepEqual(candidate(4, 5, 1),[5, 0]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "js", - "prompt": "//Given a positive integer N, return the total sum of its digits in binary.\n// Example\n// Variables:\n// @N integer\n// Constraints: 0 \u2264 N \u2264 10000.\n// Output:\n// a string of binary number\nfunction solve(N){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = solve;\n assert.deepEqual(candidate(1000),\"1\");\n assert.deepEqual(candidate(150),\"110\");\n assert.deepEqual(candidate(147),\"1100\");\n assert.deepEqual(candidate(333),\"1001\");\n assert.deepEqual(candidate(963),\"10010\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "js", - "prompt": "//You are given a list of integers.\n// You need to find the largest prime value and return the sum of its digits.\n// Examples:\nfunction skjkasdkd(lst){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = skjkasdkd;\n assert.deepEqual(candidate([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]),10);\n assert.deepEqual(candidate([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]),25);\n assert.deepEqual(candidate([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]),13);\n assert.deepEqual(candidate([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]),11);\n assert.deepEqual(candidate([0, 81, 12, 3, 1, 21]),3);\n assert.deepEqual(candidate([0, 8, 1, 2, 1, 7]),7);\n assert.deepEqual(candidate([8191]),19);\n assert.deepEqual(candidate([8191, 123456, 127, 7]),19);\n assert.deepEqual(candidate([127, 97, 8192]),10);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "js", - "prompt": "//Given an array arr of integers, find the minimum number of elements that\n// need to be changed to make the array palindromic. A palindromic array is an array that\n// is read the same backwards and forwards. In one change, you can change one element to any other element.\n// For example:\nfunction smallest_change(arr){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = smallest_change;\n assert.deepEqual(candidate([1, 2, 3, 5, 4, 7, 9, 6]),4);\n assert.deepEqual(candidate([1, 2, 3, 4, 3, 2, 2]),1);\n assert.deepEqual(candidate([1, 4, 2]),1);\n assert.deepEqual(candidate([1, 4, 4, 2]),1);\n assert.deepEqual(candidate([1, 2, 3, 2, 1]),0);\n assert.deepEqual(candidate([3, 1, 1, 3]),0);\n assert.deepEqual(candidate([1]),0);\n assert.deepEqual(candidate([0, 1]),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "js", - "prompt": "//It is the last week of the semester and the teacher has to give the grades\n// to students. The teacher has been making her own algorithm for grading.\n// The only problem is, she has lost the code she used for grading.\n// She has given you a list of GPAs for some students and you have to write \n// a function that can output a list of letter grades using the following table:\n// GPA | Letter grade\n// 4.0 A+\n// > 3.7 A \n// > 3.3 A- \n// > 3.0 B+\n// > 2.7 B \n// > 2.3 B-\n// > 2.0 C+\n// > 1.7 C\n// > 1.3 C-\n// > 1.0 D+ \n// > 0.7 D \n// > 0.0 D-\n// 0.0 E\n// Example:\nfunction numerical_letter_grade(grades){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = numerical_letter_grade;\n assert.deepEqual(candidate([4.0, 3, 1.7, 2, 3.5]),[\"A+\", \"B\", \"C-\", \"C\", \"A-\"]);\n assert.deepEqual(candidate([1.2]),[\"D+\"]);\n assert.deepEqual(candidate([0.5]),[\"D-\"]);\n assert.deepEqual(candidate([0.0]),[\"E\"]);\n assert.deepEqual(candidate([1.0, 0.3, 1.5, 2.8, 3.3]),[\"D\", \"D-\", \"C-\", \"B\", \"B+\"]);\n assert.deepEqual(candidate([0.0, 0.7]),[\"E\", \"D-\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "js", - "prompt": "//Given the lengths of the three sides of a triangle. Return the area of\n// the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n// Otherwise return -1\n// Three sides make a valid triangle when the sum of any two sides is greater \n// than the third side.\n// Example:\nfunction triangle_area(a, b, c){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = triangle_area;\n assert.deepEqual(candidate(3, 4, 5),6.0);\n assert.deepEqual(candidate(1, 2, 10),-1);\n assert.deepEqual(candidate(4, 8, 5),8.18);\n assert.deepEqual(candidate(2, 2, 2),1.73);\n assert.deepEqual(candidate(1, 2, 3),-1);\n assert.deepEqual(candidate(10, 5, 7),16.25);\n assert.deepEqual(candidate(2, 6, 3),-1);\n assert.deepEqual(candidate(1, 1, 1),0.43);\n assert.deepEqual(candidate(2, 2, 10),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "js", - "prompt": "//Check if two words have the same characters.\nfunction same_chars(s0, s1){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = same_chars;\n assert.deepEqual(candidate(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\"),true);\n assert.deepEqual(candidate(\"abcd\", \"dddddddabc\"),true);\n assert.deepEqual(candidate(\"dddddddabc\", \"abcd\"),true);\n assert.deepEqual(candidate(\"eabcd\", \"dddddddabc\"),false);\n assert.deepEqual(candidate(\"abcd\", \"dddddddabcf\"),false);\n assert.deepEqual(candidate(\"eabcdzzzz\", \"dddzzzzzzzddddabc\"),false);\n assert.deepEqual(candidate(\"aabb\", \"aaccc\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "js", - "prompt": "//Given an array of integers nums, find the minimum sum of any non-empty sub-array\n// of nums.\n// Example\nfunction minSubArraySum(nums){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = minSubArraySum;\n assert.deepEqual(candidate([2, 3, 4, 1, 2, 4]),1);\n assert.deepEqual(candidate([-1, -2, -3]),-6);\n assert.deepEqual(candidate([-1, -2, -3, 2, -10]),-14);\n assert.deepEqual(candidate([-9999999999999999]),-9999999999999999);\n assert.deepEqual(candidate([0, 10, 20, 1000000]),0);\n assert.deepEqual(candidate([-1, -2, -3, 10, -5]),-6);\n assert.deepEqual(candidate([100, -1, -2, -3, 10, -5]),-6);\n assert.deepEqual(candidate([10, 11, 13, 8, 3, 4]),3);\n assert.deepEqual(candidate([100, -33, 32, -1, 0, -2]),-33);\n assert.deepEqual(candidate([-10]),-10);\n assert.deepEqual(candidate([7]),7);\n assert.deepEqual(candidate([1, -1]),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "js", - "prompt": "//Given a string s and a natural number n, you have been tasked to implement \n// a function that returns a list of all words from string s that contain exactly \n// n consonants, in order these words appear in the string s.\n// If the string s is empty then the function should return an empty list.\n// Note: you may assume the input string contains only letters and spaces.\n// Examples:\nfunction select_words(s, n){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = select_words;\n assert.deepEqual(candidate(\"Mary had a little lamb\", 4),[\"little\"]);\n assert.deepEqual(candidate(\"Mary had a little lamb\", 3),[\"Mary\", \"lamb\"]);\n assert.deepEqual(candidate(\"simple white space\", 2),[]);\n assert.deepEqual(candidate(\"Hello world\", 4),[\"world\"]);\n assert.deepEqual(candidate(\"Uncle sam\", 3),[\"Uncle\"]);\n assert.deepEqual(candidate(\"\", 4),[]);\n assert.deepEqual(candidate(\"a b c d e f\", 1),[\"b\", \"c\", \"d\", \"f\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "js", - "prompt": "//Return list of all prefixes from shortest to longest of the input string\nfunction all_prefixes(string){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = all_prefixes;\n assert.deepEqual(candidate(\"\"),[]);\n assert.deepEqual(candidate(\"asdfgh\"),[\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"]);\n assert.deepEqual(candidate(\"WWW\"),[\"W\", \"WW\", \"WWW\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "js", - "prompt": "//Create a function that takes a value (string) representing a number\n// and returns the closest integer to it. If the number is equidistant\n// from two integers, round it away from zero.\n// Examples\n// Note:\n// Rounding away from zero means that if the given number is equidistant\n// from two integers, the one you should return is the one that is the\n// farthest from zero. For example closest_integer(\"14.5\") should\n// return 15 and closest_integer(\"-14.5\") should return -15.\nfunction closest_integer(value){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = closest_integer;\n assert.deepEqual(candidate(\"10\"),10);\n assert.deepEqual(candidate(\"14.5\"),15);\n assert.deepEqual(candidate(\"-15.5\"),-16);\n assert.deepEqual(candidate(\"15.3\"),15);\n assert.deepEqual(candidate(\"0\"),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "js", - "prompt": "//Create a function which takes a string representing a file's name, and returns\n// 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n// A file's name is considered to be valid if and only if all the following conditions \n// are met:\n// - There should not be more than three digits ('0'-'9') in the file's name.\n// - The file's name contains exactly one dot '.'\n// - The substring before the dot should not be empty, and it starts with a letter from \n// the latin alphapet ('a'-'z' and 'A'-'Z').\n// - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n// Examples:\nfunction file_name_check(file_name){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = file_name_check;\n assert.deepEqual(candidate(\"example.txt\"),\"Yes\");\n assert.deepEqual(candidate(\"1example.dll\"),\"No\");\n assert.deepEqual(candidate(\"s1sdf3.asd\"),\"No\");\n assert.deepEqual(candidate(\"K.dll\"),\"Yes\");\n assert.deepEqual(candidate(\"MY16FILE3.exe\"),\"Yes\");\n assert.deepEqual(candidate(\"His12FILE94.exe\"),\"No\");\n assert.deepEqual(candidate(\"_Y.txt\"),\"No\");\n assert.deepEqual(candidate(\"?aREYA.exe\"),\"No\");\n assert.deepEqual(candidate(\"/this_is_valid.dll\"),\"No\");\n assert.deepEqual(candidate(\"this_is_valid.wow\"),\"No\");\n assert.deepEqual(candidate(\"this_is_valid.txt\"),\"Yes\");\n assert.deepEqual(candidate(\"this_is_valid.txtexe\"),\"No\");\n assert.deepEqual(candidate(\"#this2_i4s_5valid.ten\"),\"No\");\n assert.deepEqual(candidate(\"@this1_is6_valid.exe\"),\"No\");\n assert.deepEqual(candidate(\"this_is_12valid.6exe4.txt\"),\"No\");\n assert.deepEqual(candidate(\"all.exe.txt\"),\"No\");\n assert.deepEqual(candidate(\"I563_No.exe\"),\"Yes\");\n assert.deepEqual(candidate(\"Is3youfault.txt\"),\"Yes\");\n assert.deepEqual(candidate(\"no_one#knows.dll\"),\"Yes\");\n assert.deepEqual(candidate(\"1I563_Yes3.exe\"),\"No\");\n assert.deepEqual(candidate(\"I563_Yes3.txtt\"),\"No\");\n assert.deepEqual(candidate(\"final..txt\"),\"No\");\n assert.deepEqual(candidate(\"final132\"),\"No\");\n assert.deepEqual(candidate(\"_f4indsartal132.\"),\"No\");\n assert.deepEqual(candidate(\".txt\"),\"No\");\n assert.deepEqual(candidate(\"s.\"),\"No\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "js", - "prompt": "//You are given two intervals,\n// where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n// The given intervals are closed which means that the interval (start, end)\n// includes both start and end.\n// For each given interval, it is assumed that its start is less or equal its end.\n// Your task is to determine whether the length of intersection of these two \n// intervals is a prime number.\n// Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n// which its length is 1, which not a prime number.\n// If the length of the intersection is a prime number, return \"YES\",\n// otherwise, return \"NO\".\n// If the two intervals don't intersect, return \"NO\".\n// [input/output] samples:\nfunction intersection(interval1, interval2){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = intersection;\n assert.deepEqual(candidate([1, 2], [2, 3]),\"NO\");\n assert.deepEqual(candidate([-1, 1], [0, 4]),\"NO\");\n assert.deepEqual(candidate([-3, -1], [-5, 5]),\"YES\");\n assert.deepEqual(candidate([-2, 2], [-4, 0]),\"YES\");\n assert.deepEqual(candidate([-11, 2], [-1, -1]),\"NO\");\n assert.deepEqual(candidate([1, 2], [3, 5]),\"NO\");\n assert.deepEqual(candidate([1, 2], [1, 2]),\"NO\");\n assert.deepEqual(candidate([-2, -2], [-3, -2]),\"NO\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "js", - "prompt": "//Return the largest prime factor of n. Assume n > 1 and is not a prime.\nfunction largest_prime_factor(n){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = largest_prime_factor;\n assert.deepEqual(candidate(15),5);\n assert.deepEqual(candidate(27),3);\n assert.deepEqual(candidate(63),7);\n assert.deepEqual(candidate(330),11);\n assert.deepEqual(candidate(13195),29);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "js", - "prompt": "//Given a string, find out how many distinct characters (regardless of case) does it consist of\nfunction count_distinct_characters(string){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_distinct_characters;\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"abcde\"),5);\n assert.deepEqual(candidate(\"abcdecadeCADE\"),5);\n assert.deepEqual(candidate(\"aaaaAAAAaaaa\"),1);\n assert.deepEqual(candidate(\"Jerry jERRY JeRRRY\"),5);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "js", - "prompt": "//You're given a list of deposit and withdrawal operations on a bank account that starts with\n// zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n// at that point function should return True. Otherwise it should return False.\nfunction below_zero(operations){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = below_zero;\n assert.deepEqual(candidate([]),false);\n assert.deepEqual(candidate([1, 2, -3, 1, 2, -3]),false);\n assert.deepEqual(candidate([1, 2, -4, 5, 6]),true);\n assert.deepEqual(candidate([1, -1, 2, -2, 5, -5, 4, -4]),false);\n assert.deepEqual(candidate([1, -1, 2, -2, 5, -5, 4, -5]),true);\n assert.deepEqual(candidate([1, -2, 2, -2, 5, -5, 4, -4]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "js", - "prompt": "//Find the shortest palindrome that begins with a supplied string.\n// Algorithm idea is simple:\n// - Find the longest postfix of supplied string that is a palindrome.\n// - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\nfunction make_palindrome(string){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = make_palindrome;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"x\"),\"x\");\n assert.deepEqual(candidate(\"xyz\"),\"xyzyx\");\n assert.deepEqual(candidate(\"xyx\"),\"xyx\");\n assert.deepEqual(candidate(\"jerry\"),\"jerryrrej\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "js", - "prompt": "//Given a positive integer, obtain its roman numeral equivalent as a string,\n// and return it in lowercase.\n// Restrictions: 1 <= num <= 1000\n// Examples:\nfunction int_to_mini_roman(number){\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = int_to_mini_roman;\n assert.deepEqual(candidate(19),\"xix\");\n assert.deepEqual(candidate(152),\"clii\");\n assert.deepEqual(candidate(251),\"ccli\");\n assert.deepEqual(candidate(426),\"cdxxvi\");\n assert.deepEqual(candidate(500),\"d\");\n assert.deepEqual(candidate(1),\"i\");\n assert.deepEqual(candidate(4),\"iv\");\n assert.deepEqual(candidate(43),\"xliii\");\n assert.deepEqual(candidate(90),\"xc\");\n assert.deepEqual(candidate(94),\"xciv\");\n assert.deepEqual(candidate(532),\"dxxxii\");\n assert.deepEqual(candidate(900),\"cm\");\n assert.deepEqual(candidate(994),\"cmxciv\");\n assert.deepEqual(candidate(1000),\"m\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - } -] \ No newline at end of file diff --git a/data/js-reworded.json b/data/js-reworded.json deleted file mode 100644 index d657fc16eea135f500ae70990535ee0aa0fc8b5f..0000000000000000000000000000000000000000 --- a/data/js-reworded.json +++ /dev/null @@ -1,2417 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "js", - "prompt": "//For a given number n, find the largest number that divides n evenly, smaller than n\n// >>> largest_divisor(15)\n// 5\nfunction largest_divisor(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = largest_divisor;\n assert.deepEqual(candidate(3),1);\n assert.deepEqual(candidate(7),1);\n assert.deepEqual(candidate(10),5);\n assert.deepEqual(candidate(100),50);\n assert.deepEqual(candidate(49),7);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_47_median", - "language": "js", - "prompt": "//Return median of elements in the array l.\n// >>> median([3, 1, 2, 4, 5])\n// 3\n// >>> median([-10, 4, 6, 1000, 10, 20])\n// 15.0\nfunction median(l){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = median;\n assert.deepEqual(candidate([3, 1, 2, 4, 5]),3);\n assert.deepEqual(candidate([-10, 4, 6, 1000, 10, 20]),8.0);\n assert.deepEqual(candidate([5]),5);\n assert.deepEqual(candidate([6, 5]),5.5);\n assert.deepEqual(candidate([8, 1, 3, 9, 9, 2, 7]),7);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "js", - "prompt": "//Given two arrays operator, and operand. The first array has basic algebra operations, and \n// the second array is an array of integers. Use the two given arrays to build the algebric \n// expression and return the evaluation of this expression.\n// The basic algebra operations:\n// Addition ( + ) \n// Subtraction ( - ) \n// Multiplication ( * ) \n// Floor division ( // ) \n// Exponentiation ( ** ) \n// Example:\n// operator['+', '*', '-']\n// array = [2, 3, 4, 5]\n// result = 2 + 3 * 4 - 5\n// => result = 9\n// Note:\n// The length of operator array is equal to the length of operand array minus one.\n// Operand is an array of of non-negative integers.\n// Operator array has at least one operator, and operand array has at least two operands.\nfunction do_algebra(operator, operand){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = do_algebra;\n assert.deepEqual(candidate([\"**\", \"*\", \"+\"], [2, 3, 4, 5]),37);\n assert.deepEqual(candidate([\"+\", \"*\", \"-\"], [2, 3, 4, 5]),9);\n assert.deepEqual(candidate([\"//\", \"*\"], [7, 3, 4]),8);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "js", - "prompt": "//Return maximum element in the array.\n// >>> max_element([1, 2, 3])\n// 3\n// >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n// 123\nfunction max_element(l){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = max_element;\n assert.deepEqual(candidate([1, 2, 3]),3);\n assert.deepEqual(candidate([5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]),124);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "js", - "prompt": "//Create a function which returns the largest index of an element which\n// is not greater than or equal to the element immediately preceding it. If\n// no such element exists then return -1. The given array will not contain\n// duplicate values.\n// Examples:\n// >>> can_arrange([1, 2, 4, 3, 5])\n// 3\n// >>> can_arrange([1, 2, 3])\n// -1\nfunction can_arrange(arr){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = can_arrange;\n assert.deepEqual(candidate([1, 2, 4, 3, 5]),3);\n assert.deepEqual(candidate([1, 2, 4, 5]),-1);\n assert.deepEqual(candidate([1, 4, 2, 5, 6, 7, 8, 9, 10]),2);\n assert.deepEqual(candidate([4, 8, 5, 7, 3]),4);\n assert.deepEqual(candidate([]),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "js", - "prompt": "//Imagine a road that's a perfectly straight infinitely long line.\n// n cars are driving left to right; simultaneously, a different set of n cars\n// are driving right to left. The two sets of cars start out being very far from\n// each other. All cars move in the same speed. Two cars are said to collide\n// when a car that's moving left to right hits a car that's moving right to left.\n// However, the cars are infinitely sturdy and strong; as a result, they continue moving\n// in their trajectory as if they did not collide.\n// This function outputs the number of such collisions.\nfunction car_race_collision(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = car_race_collision;\n assert.deepEqual(candidate(2),4);\n assert.deepEqual(candidate(3),9);\n assert.deepEqual(candidate(4),16);\n assert.deepEqual(candidate(8),64);\n assert.deepEqual(candidate(10),100);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "js", - "prompt": "//Create a function that returns true if the last character\n// of a given string is an alphabetical character and is not\n// a part of a word, and false otherwise.\n// Note: \"word\" is a group of characters separated by space.\n// Examples:\n// >>> check_if_last_char_is_a_letter(\"apple pie\")\n// false\n// >>> check_if_last_char_is_a_letter(\"apple pi e\")\n// true\n// >>> check_if_last_char_is_a_letter(\"apple pi e \")\n// false\n// >>> check_if_last_char_is_a_letter(\"\")\n// false\nfunction check_if_last_char_is_a_letter(txt){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = check_if_last_char_is_a_letter;\n assert.deepEqual(candidate(\"apple\"),false);\n assert.deepEqual(candidate(\"apple pi e\"),true);\n assert.deepEqual(candidate(\"eeeee\"),false);\n assert.deepEqual(candidate(\"A\"),true);\n assert.deepEqual(candidate(\"Pumpkin pie \"),false);\n assert.deepEqual(candidate(\"Pumpkin pie 1\"),false);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"eeeee e \"),false);\n assert.deepEqual(candidate(\"apple pie\"),false);\n assert.deepEqual(candidate(\"apple pi e \"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "js", - "prompt": "//Return true if a given number is prime, and false otherwise.\n// >>> is_prime(6)\n// false\n// >>> is_prime(101)\n// true\n// >>> is_prime(11)\n// true\n// >>> is_prime(13441)\n// true\n// >>> is_prime(61)\n// true\n// >>> is_prime(4)\n// false\n// >>> is_prime(1)\n// false\nfunction is_prime(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_prime;\n assert.deepEqual(candidate(6),false);\n assert.deepEqual(candidate(101),true);\n assert.deepEqual(candidate(11),true);\n assert.deepEqual(candidate(13441),true);\n assert.deepEqual(candidate(61),true);\n assert.deepEqual(candidate(4),false);\n assert.deepEqual(candidate(1),false);\n assert.deepEqual(candidate(5),true);\n assert.deepEqual(candidate(11),true);\n assert.deepEqual(candidate(17),true);\n assert.deepEqual(candidate(85),false);\n assert.deepEqual(candidate(77),false);\n assert.deepEqual(candidate(255379),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "js", - "prompt": "//Given an array of positive integers x. return a sorted array of all \n// elements that hasn't any even digit.\n// Note: Returned array should be sorted in increasing order.\n// For example:\n// >>> unique_digits([15, 33, 1422, 1])\n// [1, 15, 33]\n// >>> unique_digits([152, 323, 1422, 10])\n// []\nfunction unique_digits(x){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = unique_digits;\n assert.deepEqual(candidate([15, 33, 1422, 1]),[1, 15, 33]);\n assert.deepEqual(candidate([152, 323, 1422, 10]),[]);\n assert.deepEqual(candidate([12345, 2033, 111, 151]),[111, 151]);\n assert.deepEqual(candidate([135, 103, 31]),[31, 135]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "js", - "prompt": "//Input are two strings a and b consisting only of 1s and 0s.\n// Perform binary XOR on these inputs and return result also as a string.\n// >>> string_xor(\"010\", \"110\")\n// \"100\"\nfunction string_xor(a, b){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = string_xor;\n assert.deepEqual(candidate(\"111000\", \"101010\"),\"010010\");\n assert.deepEqual(candidate(\"1\", \"1\"),\"0\");\n assert.deepEqual(candidate(\"0101\", \"0000\"),\"0101\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "js", - "prompt": "//sum_to_n is a function that sums numbers from 1 to n.\n// >>> sum_to_n(30)\n// 465\n// >>> sum_to_n(100)\n// 5050\n// >>> sum_to_n(5)\n// 15\n// >>> sum_to_n(10)\n// 55\n// >>> sum_to_n(1)\n// 1\nfunction sum_to_n(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_to_n;\n assert.deepEqual(candidate(1),1);\n assert.deepEqual(candidate(6),21);\n assert.deepEqual(candidate(11),66);\n assert.deepEqual(candidate(30),465);\n assert.deepEqual(candidate(100),5050);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "js", - "prompt": "//Given an array of numbers, return the sum of squares of the numbers\n// in the array that are odd. Ignore numbers that are negative or not integers.\n// >>> double_the_difference([1, 3, 2, 0])\n// 10\n// >>> double_the_difference([-1, -2, 0])\n// 0\n// >>> double_the_difference([9, -2])\n// 81\n// >>> double_the_difference([0])\n// 0\n// If the input array is empty, return 0.\nfunction double_the_difference(lst){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = double_the_difference;\n assert.deepEqual(candidate([]),0);\n assert.deepEqual(candidate([5.0, 4.0]),25);\n assert.deepEqual(candidate([0.1, 0.2, 0.3]),0);\n assert.deepEqual(candidate([-10.0, -20.0, -30.0]),0);\n assert.deepEqual(candidate([-1.0, -2.0, 8.0]),0);\n assert.deepEqual(candidate([0.2, 3.0, 5.0]),34);\n assert.deepEqual(candidate([-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]),165);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "js", - "prompt": "//Return length of given string\n// >>> strlen(\"\")\n// 0\n// >>> strlen(\"abc\")\n// 3\nfunction strlen(string){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = strlen;\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"x\"),1);\n assert.deepEqual(candidate(\"asdasnakj\"),9);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "js", - "prompt": "//You'll be given a string of words, and your task is to count the number\n// of boredoms. A boredom is a sentence that starts with the word \"I\".\n// Sentences are delimited by '.', '?' or '!'.\n// For example:\n// >>> is_bored(\"Hello world\")\n// 0\n// >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n// 1\nfunction is_bored(S){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_bored;\n assert.deepEqual(candidate(\"Hello world\"),0);\n assert.deepEqual(candidate(\"Is the sky blue?\"),0);\n assert.deepEqual(candidate(\"I love It !\"),1);\n assert.deepEqual(candidate(\"bIt\"),0);\n assert.deepEqual(candidate(\"I feel good today. I will be productive. will kill It\"),2);\n assert.deepEqual(candidate(\"You and I are going for a walk\"),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "js", - "prompt": "//Write a function vowels_count which takes a string representing\n// a word as input and returns the number of vowels in the string.\n// Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n// vowel, but only when it is at the end of the given word.\n// Example:\n// >>> vowels_count(\"abcde\")\n// 2\n// >>> vowels_count(\"ACEDY\")\n// 3\nfunction vowels_count(s){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = vowels_count;\n assert.deepEqual(candidate(\"abcde\"),2);\n assert.deepEqual(candidate(\"Alone\"),3);\n assert.deepEqual(candidate(\"key\"),2);\n assert.deepEqual(candidate(\"bye\"),1);\n assert.deepEqual(candidate(\"keY\"),2);\n assert.deepEqual(candidate(\"bYe\"),1);\n assert.deepEqual(candidate(\"ACEDY\"),3);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "js", - "prompt": "//Return n-th Fibonacci number.\n// >>> fib(10)\n// 55\n// >>> fib(1)\n// 1\n// >>> fib(8)\n// 21\nfunction fib(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fib;\n assert.deepEqual(candidate(10),55);\n assert.deepEqual(candidate(1),1);\n assert.deepEqual(candidate(8),21);\n assert.deepEqual(candidate(11),89);\n assert.deepEqual(candidate(12),144);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "js", - "prompt": "//Your task is to implement a function that will simplify the expression\n// x * n. The function returns true if x * n evaluates to a whole number and false\n// otherwise. Both x and n, are string representation of a fraction, and have the following format,\n// / where both numerator and denominator are positive whole numbers.\n// You can assume that x, and n are valid fractions, and do not have zero as denominator.\n// >>> simplify(\"1/5\", \"5/1\")\n// true\n// >>> simplify(\"1/6\", \"2/1\")\n// false\n// >>> simplify(\"7/10\", \"10/2\")\n// false\nfunction simplify(x, n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = simplify;\n assert.deepEqual(candidate(\"1/5\", \"5/1\"),true);\n assert.deepEqual(candidate(\"1/6\", \"2/1\"),false);\n assert.deepEqual(candidate(\"5/1\", \"3/1\"),true);\n assert.deepEqual(candidate(\"7/10\", \"10/2\"),false);\n assert.deepEqual(candidate(\"2/10\", \"50/10\"),true);\n assert.deepEqual(candidate(\"7/2\", \"4/2\"),true);\n assert.deepEqual(candidate(\"11/6\", \"6/1\"),true);\n assert.deepEqual(candidate(\"2/3\", \"5/2\"),false);\n assert.deepEqual(candidate(\"5/2\", \"3/5\"),false);\n assert.deepEqual(candidate(\"2/4\", \"8/4\"),true);\n assert.deepEqual(candidate(\"2/4\", \"4/2\"),true);\n assert.deepEqual(candidate(\"1/5\", \"5/1\"),true);\n assert.deepEqual(candidate(\"1/5\", \"1/5\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "js", - "prompt": "//Given a string s, count the number of uppercase vowels in even indices.\n// For example:\n// >>> count_upper(\"aBCdEf\")\n// 1\n// >>> count_upper(\"abcdefg\")\n// 0\n// >>> count_upper(\"dBBE\")\n// 0\nfunction count_upper(s){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_upper;\n assert.deepEqual(candidate(\"aBCdEf\"),1);\n assert.deepEqual(candidate(\"abcdefg\"),0);\n assert.deepEqual(candidate(\"dBBE\"),0);\n assert.deepEqual(candidate(\"B\"),0);\n assert.deepEqual(candidate(\"U\"),1);\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"EEEE\"),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "js", - "prompt": "//You are given a rectangular grid of wells. Each row represents a single well,\n// and each 1 in a row represents a single unit of water.\n// Each well has a corresponding bucket that can be used to extract water from it, \n// and all buckets have the same capacity.\n// Your task is to use the buckets to empty the wells.\n// Output the number of times you need to lower the buckets.\n// Example 1:\n// >>> max_fill([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1)\n// 6\n// Example 2:\n// >>> max_fill([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2)\n// 5\n// Example 3:\n// >>> max_fill([[0, 0, 0], [0, 0, 0]], 5)\n// 0\n// Constraints:\n// * all wells have the same length\n// * 1 <= grid.length <= 10^2\n// * 1 <= grid[:,1].length <= 10^2\n// * grid[i][j] -> 0 | 1\n// * 1 <= capacity <= 10\nfunction max_fill(grid, capacity){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = max_fill;\n assert.deepEqual(candidate([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1),6);\n assert.deepEqual(candidate([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2),5);\n assert.deepEqual(candidate([[0, 0, 0], [0, 0, 0]], 5),0);\n assert.deepEqual(candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 2),4);\n assert.deepEqual(candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 9),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "js", - "prompt": "//Given an array arr of integers and a positive integer k, return a sorted array \n// of length k with the maximum k numbers in arr.\n// Example 1:\n// >>> maximum([-3, -4, 5], 3)\n// [-4, -3, 5]\n// Example 2:\n// >>> maximum([4, -4, 4], 2)\n// [4, 4]\n// Example 3:\n// >>> maximum([-3, 2, 1, 2, -1, -2, 1], 1)\n// [2]\n// Note:\n// 1. The length of the array will be in the range of [1, 1000].\n// 2. The elements in the array will be in the range of [-1000, 1000].\n// 3. 0 <= k <= len(arr)\nfunction maximum(arr, k){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = maximum;\n assert.deepEqual(candidate([-3, -4, 5], 3),[-4, -3, 5]);\n assert.deepEqual(candidate([4, -4, 4], 2),[4, 4]);\n assert.deepEqual(candidate([-3, 2, 1, 2, -1, -2, 1], 1),[2]);\n assert.deepEqual(candidate([123, -123, 20, 0, 1, 2, -3], 3),[2, 20, 123]);\n assert.deepEqual(candidate([-123, 20, 0, 1, 2, -3], 4),[0, 1, 2, 20]);\n assert.deepEqual(candidate([5, 15, 0, 3, -13, -8, 0], 7),[-13, -8, 0, 0, 3, 5, 15]);\n assert.deepEqual(candidate([-1, 0, 2, 5, 3, -10], 2),[3, 5]);\n assert.deepEqual(candidate([1, 0, 5, -7], 1),[5]);\n assert.deepEqual(candidate([4, -4], 2),[-4, 4]);\n assert.deepEqual(candidate([-10, 10], 2),[-10, 10]);\n assert.deepEqual(candidate([1, 2, 3, -23, 243, -400, 0], 0),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "js", - "prompt": "//Write a function that takes a message, and encodes in such a \n// way that it swaps case of all letters, replaces all vowels in \n// the message with the letter that appears 2 places ahead of that \n// vowel in the english alphabet. \n// Assume only letters. \n// Examples:\n// >>> encode(\"test\")\n// \"TGST\"\n// >>> encode(\"This is a message\")\n// \"tHKS KS C MGSSCGG\"\nfunction encode(message){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = encode;\n assert.deepEqual(candidate(\"TEST\"),\"tgst\");\n assert.deepEqual(candidate(\"Mudasir\"),\"mWDCSKR\");\n assert.deepEqual(candidate(\"YES\"),\"ygs\");\n assert.deepEqual(candidate(\"This is a message\"),\"tHKS KS C MGSSCGG\");\n assert.deepEqual(candidate(\"I DoNt KnOw WhAt tO WrItE\"),\"k dQnT kNqW wHcT Tq wRkTg\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "js", - "prompt": "//remove_vowels is a function that takes string and returns string without vowels.\n// >>> remove_vowels(\"\")\n// \"\"\n// >>> remove_vowels(\"abcdef\")\n// \"bcdf\"\n// >>> remove_vowels(\"aaaaa\")\n// \"\"\n// >>> remove_vowels(\"aaBAA\")\n// \"B\"\n// >>> remove_vowels(\"zbcd\")\n// \"zbcd\"\nfunction remove_vowels(text){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = remove_vowels;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"abcdef\nghijklm\"),\"bcdf\nghjklm\");\n assert.deepEqual(candidate(\"fedcba\"),\"fdcb\");\n assert.deepEqual(candidate(\"eeeee\"),\"\");\n assert.deepEqual(candidate(\"acBAA\"),\"cB\");\n assert.deepEqual(candidate(\"EcBOO\"),\"cB\");\n assert.deepEqual(candidate(\"ybcd\"),\"ybcd\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "js", - "prompt": "//Return only positive numbers in the array.\n// >>> get_positive([-1, 2, -4, 5, 6])\n// [2, 5, 6]\n// >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n// [5, 3, 2, 3, 9, 123, 1]\nfunction get_positive(l){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_positive;\n assert.deepEqual(candidate([-1, -2, 4, 5, 6]),[4, 5, 6]);\n assert.deepEqual(candidate([5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]),[5, 3, 2, 3, 3, 9, 123, 1]);\n assert.deepEqual(candidate([-1, -2]),[]);\n assert.deepEqual(candidate([]),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "js", - "prompt": "//Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n// >>> string_sequence(0)\n// \"0\"\n// >>> string_sequence(5)\n// \"0 1 2 3 4 5\"\nfunction string_sequence(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = string_sequence;\n assert.deepEqual(candidate(0),\"0\");\n assert.deepEqual(candidate(3),\"0 1 2 3\");\n assert.deepEqual(candidate(10),\"0 1 2 3 4 5 6 7 8 9 10\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "js", - "prompt": "//Given a positive integer n, you have to make a pile of n levels of stones.\n// The first level has n stones.\n// The number of stones in the next level is:\n// - the next odd number if n is odd.\n// - the next even number if n is even.\n// Return the number of stones in each level in an array, where element at index\n// i represents the number of stones in the level (i+1).\n// Examples:\n// >>> make_a_pile(3)\n// [3, 5, 7]\nfunction make_a_pile(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = make_a_pile;\n assert.deepEqual(candidate(3),[3, 5, 7]);\n assert.deepEqual(candidate(4),[4, 6, 8, 10]);\n assert.deepEqual(candidate(5),[5, 7, 9, 11, 13]);\n assert.deepEqual(candidate(6),[6, 8, 10, 12, 14, 16]);\n assert.deepEqual(candidate(8),[8, 10, 12, 14, 16, 18, 20, 22]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "js", - "prompt": "//Task\n// 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\n// then check if the result string is palindrome.\n// A string is called palindrome if it reads the same backward as forward.\n// You should return an array containing the result string and true/false for the check.\n// Example\n// >>> reverse_delete(\"abcde\", \"ae\")\n// [\"bcd\", false]\n// >>> reverse_delete(\"abcdef\", \"b\")\n// [\"acdef\", false]\n// >>> reverse_delete(\"abcdedcba\", \"ab\")\n// [\"cdedc\", true]\nfunction reverse_delete(s, c){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = reverse_delete;\n assert.deepEqual(candidate(\"abcde\", \"ae\"),[\"bcd\", false]);\n assert.deepEqual(candidate(\"abcdef\", \"b\"),[\"acdef\", false]);\n assert.deepEqual(candidate(\"abcdedcba\", \"ab\"),[\"cdedc\", true]);\n assert.deepEqual(candidate(\"dwik\", \"w\"),[\"dik\", false]);\n assert.deepEqual(candidate(\"a\", \"a\"),[\"\", true]);\n assert.deepEqual(candidate(\"abcdedcba\", \"\"),[\"abcdedcba\", true]);\n assert.deepEqual(candidate(\"abcdedcba\", \"v\"),[\"abcdedcba\", true]);\n assert.deepEqual(candidate(\"vabba\", \"v\"),[\"abba\", true]);\n assert.deepEqual(candidate(\"mamma\", \"mia\"),[\"\", true]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "js", - "prompt": "//For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n// >>> flip_case(\"Hello\")\n// \"hELLO\"\nfunction flip_case(string){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = flip_case;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"Hello!\"),\"hELLO!\");\n assert.deepEqual(candidate(\"These violent delights have violent ends\"),\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "js", - "prompt": "//You are given a string s.\n// if s[i] is a letter, reverse its case from lower to upper or vise versa, \n// otherwise keep it as it is.\n// If the string contains no letters, reverse the string.\n// The function should return the resulted string.\n// Examples\n// >>> solve(\"1234\")\n// \"4321\"\n// >>> solve(\"ab\")\n// \"AB\"\n// >>> solve(\"#a@C\")\n// \"#A@c\"\nfunction solve(s){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = solve;\n assert.deepEqual(candidate(\"AsDf\"),\"aSdF\");\n assert.deepEqual(candidate(\"1234\"),\"4321\");\n assert.deepEqual(candidate(\"ab\"),\"AB\");\n assert.deepEqual(candidate(\"#a@C\"),\"#A@c\");\n assert.deepEqual(candidate(\"#AsdfW^45\"),\"#aSDFw^45\");\n assert.deepEqual(candidate(\"#6@2\"),\"2@6#\");\n assert.deepEqual(candidate(\"#$a^D\"),\"#$A^d\");\n assert.deepEqual(candidate(\"#ccc\"),\"#CCC\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "js", - "prompt": "//Filter an input array of strings only for ones that start with a given prefix.\n// >>> filter_by_prefix([], \"a\")\n// []\n// >>> filter_by_prefix([\"abc\", \"bcd\", \"cde\", \"array\"], \"a\")\n// [\"abc\", \"array\"]\nfunction filter_by_prefix(strings, prefix){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = filter_by_prefix;\n assert.deepEqual(candidate([], \"john\"),[]);\n assert.deepEqual(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"),[\"xxx\", \"xxxAAA\", \"xxx\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "js", - "prompt": "//This function takes two positive numbers x and y and returns the\n// biggest even integer number that is in the range [x, y] inclusive. If \n// there's no such number, then the function should return -1.\n// For example:\n// >>> choose_num(12, 15)\n// 14\n// >>> choose_num(13, 12)\n// -1\nfunction choose_num(x, y){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = choose_num;\n assert.deepEqual(candidate(12, 15),14);\n assert.deepEqual(candidate(13, 12),-1);\n assert.deepEqual(candidate(33, 12354),12354);\n assert.deepEqual(candidate(5234, 5233),-1);\n assert.deepEqual(candidate(6, 29),28);\n assert.deepEqual(candidate(27, 10),-1);\n assert.deepEqual(candidate(7, 7),-1);\n assert.deepEqual(candidate(546, 546),546);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "js", - "prompt": "//You are given a string representing a sentence,\n// the sentence contains some words separated by a space,\n// and you have to return a string that contains the words from the original sentence,\n// whose lengths are prime numbers,\n// the order of the words in the new string should be the same as the original one.\n// Example 1:\n// >>> words_in_sentence(\"This is a test\")\n// \"is\"\n// Example 2:\n// >>> words_in_sentence(\"lets go for swimming\")\n// \"go for\"\n// Constraints:\n// * 1 <= len(sentence) <= 100\n// * sentence contains only letters\nfunction words_in_sentence(sentence){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = words_in_sentence;\n assert.deepEqual(candidate(\"This is a test\"),\"is\");\n assert.deepEqual(candidate(\"lets go for swimming\"),\"go for\");\n assert.deepEqual(candidate(\"there is no place available here\"),\"there is no place\");\n assert.deepEqual(candidate(\"Hi I am Hussein\"),\"Hi am Hussein\");\n assert.deepEqual(candidate(\"go for it\"),\"go for it\");\n assert.deepEqual(candidate(\"here\"),\"\");\n assert.deepEqual(candidate(\"here is\"),\"is\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "js", - "prompt": "//Insert a number 'delimeter' between every two consecutive elements of input array `numbers'\n// >>> intersperse([], 4)\n// []\n// >>> intersperse([1, 2, 3], 4)\n// [1, 4, 2, 4, 3]\nfunction intersperse(numbers, delimeter){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = intersperse;\n assert.deepEqual(candidate([], 7),[]);\n assert.deepEqual(candidate([5, 6, 3, 2], 8),[5, 8, 6, 8, 3, 8, 2]);\n assert.deepEqual(candidate([2, 2, 2], 2),[2, 2, 2, 2, 2]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "js", - "prompt": "//Your task is to write a function that returns true if a number x is a simple\n// power of n and false in other cases.\n// x is a simple power of n if n**int=x\n// For example:\n// >>> is_simple_power(1, 4)\n// true\n// >>> is_simple_power(2, 2)\n// true\n// >>> is_simple_power(8, 2)\n// true\n// >>> is_simple_power(3, 2)\n// false\n// >>> is_simple_power(3, 1)\n// false\n// >>> is_simple_power(5, 3)\n// false\nfunction is_simple_power(x, n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_simple_power;\n assert.deepEqual(candidate(16, 2),true);\n assert.deepEqual(candidate(143214, 16),false);\n assert.deepEqual(candidate(4, 2),true);\n assert.deepEqual(candidate(9, 3),true);\n assert.deepEqual(candidate(16, 4),true);\n assert.deepEqual(candidate(24, 2),false);\n assert.deepEqual(candidate(128, 4),false);\n assert.deepEqual(candidate(12, 6),false);\n assert.deepEqual(candidate(1, 1),true);\n assert.deepEqual(candidate(1, 12),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "js", - "prompt": "//Write a function that returns true if the given number is the multiplication of 3 prime numbers\n// and false otherwise.\n// Knowing that (a) is less then 100. \n// Example:\n// >>> is_multiply_prime(30)\n// true\n// 30 = 2 * 3 * 5\nfunction is_multiply_prime(a){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_multiply_prime;\n assert.deepEqual(candidate(5),false);\n assert.deepEqual(candidate(30),true);\n assert.deepEqual(candidate(8),true);\n assert.deepEqual(candidate(10),false);\n assert.deepEqual(candidate(125),true);\n assert.deepEqual(candidate(105),true);\n assert.deepEqual(candidate(126),false);\n assert.deepEqual(candidate(729),false);\n assert.deepEqual(candidate(891),false);\n assert.deepEqual(candidate(1001),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "js", - "prompt": "//Given the lengths of the three sides of a triangle. Return true if the three\n// sides form a right-angled triangle, false otherwise.\n// A right-angled triangle is a triangle in which one angle is right angle or \n// 90 degree.\n// Example:\n// >>> right_angle_triangle(3, 4, 5)\n// true\n// >>> right_angle_triangle(1, 2, 3)\n// false\nfunction right_angle_triangle(a, b, c){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = right_angle_triangle;\n assert.deepEqual(candidate(3, 4, 5),true);\n assert.deepEqual(candidate(1, 2, 3),false);\n assert.deepEqual(candidate(10, 6, 8),true);\n assert.deepEqual(candidate(2, 2, 2),false);\n assert.deepEqual(candidate(7, 24, 25),true);\n assert.deepEqual(candidate(10, 5, 7),false);\n assert.deepEqual(candidate(5, 12, 13),true);\n assert.deepEqual(candidate(15, 8, 17),true);\n assert.deepEqual(candidate(48, 55, 73),true);\n assert.deepEqual(candidate(1, 1, 1),false);\n assert.deepEqual(candidate(2, 2, 10),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "js", - "prompt": "//Create a function that takes 3 numbers.\n// Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n// Returns false in any other cases.\n// Examples\n// >>> any_int(5, 2, 7)\n// true\n// >>> any_int(3, 2, 2)\n// false\n// >>> any_int(3, -2, 1)\n// true\n// >>> any_int(3.6, -2.2, 2)\n// false\nfunction any_int(x, y, z){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = any_int;\n assert.deepEqual(candidate(2, 3, 1),true);\n assert.deepEqual(candidate(2.5, 2, 3),false);\n assert.deepEqual(candidate(1.5, 5, 3.5),false);\n assert.deepEqual(candidate(2, 6, 2),false);\n assert.deepEqual(candidate(4, 2, 2),true);\n assert.deepEqual(candidate(2.2, 2.2, 2.2),false);\n assert.deepEqual(candidate(-4, 6, 2),true);\n assert.deepEqual(candidate(2, 1, 1),true);\n assert.deepEqual(candidate(3, 4, 7),true);\n assert.deepEqual(candidate(3.0, 4, 7),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "js", - "prompt": "//This function takes an array l and returns an array l' such that\n// l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n// to the values of the corresponding indicies of l, but sorted.\n// >>> sort_third([1, 2, 3])\n// [1, 2, 3]\n// >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n// [2, 6, 3, 4, 8, 9, 5]\nfunction sort_third(l){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_third;\n assert.deepEqual(candidate([5, 6, 3, 4, 8, 9, 2]),[2, 6, 3, 4, 8, 9, 5]);\n assert.deepEqual(candidate([5, 8, 3, 4, 6, 9, 2]),[2, 8, 3, 4, 6, 9, 5]);\n assert.deepEqual(candidate([5, 6, 9, 4, 8, 3, 2]),[2, 6, 9, 4, 8, 3, 5]);\n assert.deepEqual(candidate([5, 6, 3, 4, 8, 9, 2, 1]),[2, 6, 3, 4, 8, 9, 5, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_53_add", - "language": "js", - "prompt": "//Add two numbers x and y\n// >>> add(2, 3)\n// 5\n// >>> add(5, 7)\n// 12\nfunction add(x, y){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = add;\n assert.deepEqual(candidate(0, 1),1);\n assert.deepEqual(candidate(1, 0),1);\n assert.deepEqual(candidate(2, 3),5);\n assert.deepEqual(candidate(5, 7),12);\n assert.deepEqual(candidate(7, 5),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_69_search", - "language": "js", - "prompt": "//You are given a non-empty array of positive integers. Return the greatest integer that is greater than \n// zero, and has a frequency greater than or equal to the value of the integer itself. \n// The frequency of an integer is the number of times it appears in the array.\n// If no such a value exist, return -1.\n// Examples:\n// >>> search([4, 1, 2, 2, 3, 1])\n// 2\n// >>> search([1, 2, 2, 3, 3, 3, 4, 4, 4])\n// 3\n// >>> search([5, 5, 4, 4, 4])\n// -1\nfunction search(lst){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = search;\n assert.deepEqual(candidate([5, 5, 5, 5, 1]),1);\n assert.deepEqual(candidate([4, 1, 4, 1, 4, 4]),4);\n assert.deepEqual(candidate([3, 3]),-1);\n assert.deepEqual(candidate([8, 8, 8, 8, 8, 8, 8, 8]),8);\n assert.deepEqual(candidate([2, 3, 3, 2, 2]),2);\n assert.deepEqual(candidate([2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]),1);\n assert.deepEqual(candidate([3, 2, 8, 2]),2);\n assert.deepEqual(candidate([6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]),1);\n assert.deepEqual(candidate([8, 8, 3, 6, 5, 6, 4]),-1);\n assert.deepEqual(candidate([6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]),1);\n assert.deepEqual(candidate([1, 9, 10, 1, 3]),1);\n assert.deepEqual(candidate([6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]),5);\n assert.deepEqual(candidate([1]),1);\n assert.deepEqual(candidate([8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]),4);\n assert.deepEqual(candidate([2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]),2);\n assert.deepEqual(candidate([1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]),1);\n assert.deepEqual(candidate([9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]),4);\n assert.deepEqual(candidate([2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]),4);\n assert.deepEqual(candidate([9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]),2);\n assert.deepEqual(candidate([5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]),-1);\n assert.deepEqual(candidate([10]),-1);\n assert.deepEqual(candidate([9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]),2);\n assert.deepEqual(candidate([5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]),1);\n assert.deepEqual(candidate([7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]),1);\n assert.deepEqual(candidate([3, 10, 10, 9, 2]),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "js", - "prompt": "//Write a function that takes a string and returns true if the string\n// length is a prime number or false otherwise\n// Examples\n// >>> prime_length(\"Hello\")\n// true\n// >>> prime_length(\"abcdcba\")\n// true\n// >>> prime_length(\"kittens\")\n// true\n// >>> prime_length(\"orange\")\n// false\nfunction prime_length(string){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = prime_length;\n assert.deepEqual(candidate(\"Hello\"),true);\n assert.deepEqual(candidate(\"abcdcba\"),true);\n assert.deepEqual(candidate(\"kittens\"),true);\n assert.deepEqual(candidate(\"orange\"),false);\n assert.deepEqual(candidate(\"wow\"),true);\n assert.deepEqual(candidate(\"world\"),true);\n assert.deepEqual(candidate(\"MadaM\"),true);\n assert.deepEqual(candidate(\"Wow\"),true);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"HI\"),true);\n assert.deepEqual(candidate(\"go\"),true);\n assert.deepEqual(candidate(\"gogo\"),false);\n assert.deepEqual(candidate(\"aaaaaaaaaaaaaaa\"),false);\n assert.deepEqual(candidate(\"Madam\"),true);\n assert.deepEqual(candidate(\"M\"),false);\n assert.deepEqual(candidate(\"0\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_58_common", - "language": "js", - "prompt": "//Return sorted unique common elements for two arrays.\n// >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n// [1, 5, 653]\n// >>> common([5, 3, 2, 8], [3, 2])\n// [2, 3]\nfunction common(l1, l2){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = common;\n assert.deepEqual(candidate([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]),[1, 5, 653]);\n assert.deepEqual(candidate([5, 3, 2, 8], [3, 2]),[2, 3]);\n assert.deepEqual(candidate([4, 3, 2, 8], [3, 2, 4]),[2, 3, 4]);\n assert.deepEqual(candidate([4, 3, 2, 8], []),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "js", - "prompt": "//The Brazilian factorial is defined as:\n// brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n// where n > 0\n// For example:\n// >>> special_factorial(4)\n// 288\n// The function will receive an integer as input and should return the special\n// factorial of this integer.\nfunction special_factorial(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = special_factorial;\n assert.deepEqual(candidate(4),288);\n assert.deepEqual(candidate(5),34560);\n assert.deepEqual(candidate(7),125411328000);\n assert.deepEqual(candidate(1),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "js", - "prompt": "//In this problem, you will implement a function that takes two arrays of numbers,\n// and determines whether it is possible to perform an exchange of elements\n// between them to make lst1 an array of only even numbers.\n// There is no limit on the number of exchanged elements between lst1 and lst2.\n// If it is possible to exchange elements between the lst1 and lst2 to make\n// all the elements of lst1 to be even, return \"YES\".\n// Otherwise, return \"NO\".\n// For example:\n// >>> exchange([1, 2, 3, 4], [1, 2, 3, 4])\n// \"YES\"\n// >>> exchange([1, 2, 3, 4], [1, 5, 3, 4])\n// \"NO\"\n// It is assumed that the input arrays will be non-empty.\nfunction exchange(lst1, lst2){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = exchange;\n assert.deepEqual(candidate([1, 2, 3, 4], [1, 2, 3, 4]),\"YES\");\n assert.deepEqual(candidate([1, 2, 3, 4], [1, 5, 3, 4]),\"NO\");\n assert.deepEqual(candidate([1, 2, 3, 4], [2, 1, 4, 3]),\"YES\");\n assert.deepEqual(candidate([5, 7, 3], [2, 6, 4]),\"YES\");\n assert.deepEqual(candidate([5, 7, 3], [2, 6, 3]),\"NO\");\n assert.deepEqual(candidate([3, 2, 6, 1, 8, 9], [3, 5, 5, 1, 1, 1]),\"NO\");\n assert.deepEqual(candidate([100, 200], [200, 200]),\"YES\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "js", - "prompt": "//Given a non-empty array of integers arr and an integer k, return\n// the sum of the elements with at most two digits from the first k elements of arr.\n// Example:\n// >>> add_elements([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4)\n// 24\n// Constraints:\n// 1. 1 <= len(arr) <= 100\n// 2. 1 <= k <= len(arr)\nfunction add_elements(arr, k){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = add_elements;\n assert.deepEqual(candidate([1, -2, -3, 41, 57, 76, 87, 88, 99], 3),-4);\n assert.deepEqual(candidate([111, 121, 3, 4000, 5, 6], 2),0);\n assert.deepEqual(candidate([11, 21, 3, 90, 5, 6, 7, 8, 9], 4),125);\n assert.deepEqual(candidate([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4),24);\n assert.deepEqual(candidate([1], 1),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "js", - "prompt": "//A simple program which should return the value of x if n is \n// a prime number and should return the value of y otherwise.\n// Examples:\n// >>> x_or_y(7, 34, 12)\n// 34\n// >>> x_or_y(15, 8, 5)\n// 5\nfunction x_or_y(n, x, y){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = x_or_y;\n assert.deepEqual(candidate(7, 34, 12),34);\n assert.deepEqual(candidate(15, 8, 5),5);\n assert.deepEqual(candidate(3, 33, 5212),33);\n assert.deepEqual(candidate(1259, 3, 52),3);\n assert.deepEqual(candidate(7919, -1, 12),-1);\n assert.deepEqual(candidate(3609, 1245, 583),583);\n assert.deepEqual(candidate(91, 56, 129),129);\n assert.deepEqual(candidate(6, 34, 1234),1234);\n assert.deepEqual(candidate(1, 2, 0),0);\n assert.deepEqual(candidate(2, 2, 0),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "js", - "prompt": "//Given length of a side and high return area for a triangle.\n// >>> triangle_area(5, 3)\n// 7.5\nfunction triangle_area(a, h){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = triangle_area;\n assert.deepEqual(candidate(5, 3),7.5);\n assert.deepEqual(candidate(2, 2),2.0);\n assert.deepEqual(candidate(10, 8),40.0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "js", - "prompt": "//Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n// the last couple centuries. However, what people don't know is Tribonacci sequence.\n// Tribonacci sequence is defined by the recurrence:\n// tri(1) = 3\n// tri(n) = 1 + n / 2, if n is even.\n// tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n// For example:\n// tri(2) = 1 + (2 / 2) = 2\n// tri(4) = 3\n// tri(3) = tri(2) + tri(1) + tri(4)\n// = 2 + 3 + 3 = 8 \n// You are given a non-negative integer number n, you have to a return an array of the \n// first n + 1 numbers of the Tribonacci sequence.\n// Examples:\n// >>> tri(3)\n// [1, 3, 2, 8]\nfunction tri(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = tri;\n assert.deepEqual(candidate(3),[1, 3, 2, 8]);\n assert.deepEqual(candidate(4),[1, 3, 2, 8, 3]);\n assert.deepEqual(candidate(5),[1, 3, 2, 8, 3, 15]);\n assert.deepEqual(candidate(6),[1, 3, 2, 8, 3, 15, 4]);\n assert.deepEqual(candidate(7),[1, 3, 2, 8, 3, 15, 4, 24]);\n assert.deepEqual(candidate(8),[1, 3, 2, 8, 3, 15, 4, 24, 5]);\n assert.deepEqual(candidate(9),[1, 3, 2, 8, 3, 15, 4, 24, 5, 35]);\n assert.deepEqual(candidate(20),[1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11]);\n assert.deepEqual(candidate(0),[1]);\n assert.deepEqual(candidate(1),[1, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "js", - "prompt": "//You are given an array of two strings, both strings consist of open\n// parentheses '(' or close parentheses ')' only.\n// Your job is to check if it is possible to concatenate the two strings in\n// some order, that the resulting string will be good.\n// A string S is considered to be good if and only if all parentheses in S\n// are balanced. For example: the string '(())()' is good, while the string\n// '())' is not.\n// Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n// Examples:\n// >>> match_parens([\"()(\", \")\"])\n// \"Yes\"\n// >>> match_parens([\")\", \")\"])\n// \"No\"\nfunction match_parens(lst){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = match_parens;\n assert.deepEqual(candidate([\"()(\", \")\"]),\"Yes\");\n assert.deepEqual(candidate([\")\", \")\"]),\"No\");\n assert.deepEqual(candidate([\"(()(())\", \"())())\"]),\"No\");\n assert.deepEqual(candidate([\")())\", \"(()()(\"]),\"Yes\");\n assert.deepEqual(candidate([\"(())))\", \"(()())((\"]),\"Yes\");\n assert.deepEqual(candidate([\"()\", \"())\"]),\"No\");\n assert.deepEqual(candidate([\"(()(\", \"()))()\"]),\"Yes\");\n assert.deepEqual(candidate([\"((((\", \"((())\"]),\"No\");\n assert.deepEqual(candidate([\")(()\", \"(()(\"]),\"No\");\n assert.deepEqual(candidate([\")(\", \")(\"]),\"No\");\n assert.deepEqual(candidate([\"(\", \")\"]),\"Yes\");\n assert.deepEqual(candidate([\")\", \"(\"]),\"Yes\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "js", - "prompt": "//From an array of integers, remove all elements that occur more than once.\n// Keep order of elements left the same as in the input.\n// >>> remove_duplicates([1, 2, 3, 2, 4])\n// [1, 3, 4]\nfunction remove_duplicates(numbers){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = remove_duplicates;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, 2, 3, 4]),[1, 2, 3, 4]);\n assert.deepEqual(candidate([1, 2, 3, 2, 4, 3, 5]),[1, 4, 5]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "js", - "prompt": "//Return a greatest common divisor of two integers a and b\n// >>> greatest_common_divisor(3, 5)\n// 1\n// >>> greatest_common_divisor(25, 15)\n// 5\nfunction greatest_common_divisor(a, b){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = greatest_common_divisor;\n assert.deepEqual(candidate(3, 7),1);\n assert.deepEqual(candidate(10, 15),5);\n assert.deepEqual(candidate(49, 14),7);\n assert.deepEqual(candidate(144, 60),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "js", - "prompt": "//Checks if given string is a palindrome\n// >>> is_palindrome(\"\")\n// true\n// >>> is_palindrome(\"aba\")\n// true\n// >>> is_palindrome(\"aaaaa\")\n// true\n// >>> is_palindrome(\"zbcd\")\n// false\nfunction is_palindrome(text){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_palindrome;\n assert.deepEqual(candidate(\"\"),true);\n assert.deepEqual(candidate(\"aba\"),true);\n assert.deepEqual(candidate(\"aaaaa\"),true);\n assert.deepEqual(candidate(\"zbcd\"),false);\n assert.deepEqual(candidate(\"xywyx\"),true);\n assert.deepEqual(candidate(\"xywyz\"),false);\n assert.deepEqual(candidate(\"xywzx\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "js", - "prompt": "//xs represent coefficients of a polynomial.\n// xs[0] + xs[1] * x + xs[2] * x^2 + ....\n// Return derivative of this polynomial in the same form.\n// >>> derivative([3, 1, 2, 4, 5])\n// [1, 4, 12, 20]\n// >>> derivative([1, 2, 3])\n// [2, 6]\nfunction derivative(xs){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = derivative;\n assert.deepEqual(candidate([3, 1, 2, 4, 5]),[1, 4, 12, 20]);\n assert.deepEqual(candidate([1, 2, 3]),[2, 6]);\n assert.deepEqual(candidate([3, 2, 1]),[2, 2]);\n assert.deepEqual(candidate([3, 2, 1, 0, 4]),[2, 2, 0, 16]);\n assert.deepEqual(candidate([1]),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "js", - "prompt": "//In this task, you will be given a string that represents a number of apples and oranges \n// that are distributed in a basket of fruit this basket contains \n// apples, oranges, and mango fruits. Given the string that represents the total number of \n// the oranges and apples and an integer that represent the total number of the fruits \n// in the basket return the number of the mango fruits in the basket.\n// for examble:\n// >>> fruit_distribution(\"5 apples and 6 oranges\", 19)\n// 8\n// >>> fruit_distribution(\"0 apples and 1 oranges\", 3)\n// 2\n// >>> fruit_distribution(\"2 apples and 3 oranges\", 100)\n// 95\n// >>> fruit_distribution(\"100 apples and 1 oranges\", 120)\n// 19\nfunction fruit_distribution(s, n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fruit_distribution;\n assert.deepEqual(candidate(\"5 apples and 6 oranges\", 19),8);\n assert.deepEqual(candidate(\"5 apples and 6 oranges\", 21),10);\n assert.deepEqual(candidate(\"0 apples and 1 oranges\", 3),2);\n assert.deepEqual(candidate(\"1 apples and 0 oranges\", 3),2);\n assert.deepEqual(candidate(\"2 apples and 3 oranges\", 100),95);\n assert.deepEqual(candidate(\"2 apples and 3 oranges\", 5),0);\n assert.deepEqual(candidate(\"1 apples and 100 oranges\", 120),19);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "js", - "prompt": "//Write a function that takes an integer a and returns true \n// if this ingeger is a cube of some integer number.\n// Note: you may assume the input is always valid.\n// Examples:\n// >>> iscube(1)\n// true\n// >>> iscube(2)\n// false\n// >>> iscube(-1)\n// true\n// >>> iscube(64)\n// true\n// >>> iscube(0)\n// true\n// >>> iscube(180)\n// false\nfunction iscube(a){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = iscube;\n assert.deepEqual(candidate(1),true);\n assert.deepEqual(candidate(2),false);\n assert.deepEqual(candidate(-1),true);\n assert.deepEqual(candidate(64),true);\n assert.deepEqual(candidate(180),false);\n assert.deepEqual(candidate(1000),true);\n assert.deepEqual(candidate(0),true);\n assert.deepEqual(candidate(1729),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "js", - "prompt": "//In this Kata, you have to sort an array of non-negative integers according to\n// number of ones in their binary representation in ascending order.\n// For similar number of ones, sort based on decimal value.\n// It must be implemented like this:\n// >>> sort_array([1, 5, 2, 3, 4])\n// [1, 2, 3, 4, 5]\n// >>> sort_array([-2, -3, -4, -5, -6])\n// [-6, -5, -4, -3, -2]\n// >>> sort_array([1, 0, 2, 3, 4])\n// [0, 1, 2, 3, 4]\nfunction sort_array(arr){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_array;\n assert.deepEqual(candidate([1, 5, 2, 3, 4]),[1, 2, 4, 3, 5]);\n assert.deepEqual(candidate([-2, -3, -4, -5, -6]),[-4, -2, -6, -5, -3]);\n assert.deepEqual(candidate([1, 0, 2, 3, 4]),[0, 1, 2, 4, 3]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]),[2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77]);\n assert.deepEqual(candidate([3, 6, 44, 12, 32, 5]),[32, 3, 5, 6, 12, 44]);\n assert.deepEqual(candidate([2, 4, 8, 16, 32]),[2, 4, 8, 16, 32]);\n assert.deepEqual(candidate([2, 4, 8, 16, 32]),[2, 4, 8, 16, 32]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "js", - "prompt": "//Given an array of strings, where each string consists of only digits, return an array.\n// Each element i of the output should be \"the number of odd elements in the\n// string i of the input.\" where all the i's should be replaced by the number\n// of odd digits in the i'th string of the input.\n// >>> odd_count([\"1234567\"])\n// [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n// >>> odd_count([\"3\", \"11111111\"])\n// [\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\nfunction odd_count(lst){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = odd_count;\n assert.deepEqual(candidate([\"1234567\"]),[\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]);\n assert.deepEqual(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.\"]);\n assert.deepEqual(candidate([\"271\", \"137\", \"314\"]),[\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "js", - "prompt": "//brackets is a string of \"(\" and \")\".\n// return true if every opening bracket has a corresponding closing bracket.\n// >>> correct_bracketing(\"(\")\n// false\n// >>> correct_bracketing(\"()\")\n// true\n// >>> correct_bracketing(\"(()())\")\n// true\n// >>> correct_bracketing(\")(()\")\n// false\nfunction correct_bracketing(brackets){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = correct_bracketing;\n assert.deepEqual(candidate(\"()\"),true);\n assert.deepEqual(candidate(\"(()())\"),true);\n assert.deepEqual(candidate(\"()()(()())()\"),true);\n assert.deepEqual(candidate(\"()()((()()())())(()()(()))\"),true);\n assert.deepEqual(candidate(\"((()())))\"),false);\n assert.deepEqual(candidate(\")(()\"),false);\n assert.deepEqual(candidate(\"(\"),false);\n assert.deepEqual(candidate(\"((((\"),false);\n assert.deepEqual(candidate(\")\"),false);\n assert.deepEqual(candidate(\"(()\"),false);\n assert.deepEqual(candidate(\"()()(()())())(()\"),false);\n assert.deepEqual(candidate(\"()()(()())()))()\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "js", - "prompt": "//Task\n// Write a function that takes a string as input and returns the sum of the upper characters only'\n// ASCII codes.\n// Examples:\n// >>> digitSum(\"\")\n// 0\n// >>> digitSum(\"abAB\")\n// 131\n// >>> digitSum(\"abcCd\")\n// 67\n// >>> digitSum(\"helloE\")\n// 69\n// >>> digitSum(\"woArBld\")\n// 131\n// >>> digitSum(\"aAaaaXa\")\n// 153\nfunction digitSum(s){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = digitSum;\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"abAB\"),131);\n assert.deepEqual(candidate(\"abcCd\"),67);\n assert.deepEqual(candidate(\"helloE\"),69);\n assert.deepEqual(candidate(\"woArBld\"),131);\n assert.deepEqual(candidate(\"aAaaaXa\"),153);\n assert.deepEqual(candidate(\" How are yOu?\"),151);\n assert.deepEqual(candidate(\"You arE Very Smart\"),327);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "js", - "prompt": "//Write a function that accepts an array of strings as a parameter,\n// deletes the strings that have odd lengths from it,\n// and returns the resulted array with a sorted order,\n// The array is always an array of strings and never an array of numbers,\n// and it may contain duplicates.\n// The order of the array should be ascending by length of each word, and you\n// should return the array sorted by that rule.\n// If two words have the same length, sort the array alphabetically.\n// The function should return an array of strings in sorted order.\n// You may assume that all words will have the same length.\n// For example:\n// >>> list_sort([\"aa\", \"a\", \"aaa\"])\n// [\"aa\"]\n// >>> list_sort([\"ab\", \"a\", \"aaa\", \"cd\"])\n// [\"ab\", \"cd\"]\nfunction sorted_list_sum(lst){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sorted_list_sum;\n assert.deepEqual(candidate([\"aa\", \"a\", \"aaa\"]),[\"aa\"]);\n assert.deepEqual(candidate([\"school\", \"AI\", \"asdf\", \"b\"]),[\"AI\", \"asdf\", \"school\"]);\n assert.deepEqual(candidate([\"d\", \"b\", \"c\", \"a\"]),[]);\n assert.deepEqual(candidate([\"d\", \"dcba\", \"abcd\", \"a\"]),[\"abcd\", \"dcba\"]);\n assert.deepEqual(candidate([\"AI\", \"ai\", \"au\"]),[\"AI\", \"ai\", \"au\"]);\n assert.deepEqual(candidate([\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"]),[]);\n assert.deepEqual(candidate([\"aaaa\", \"bbbb\", \"dd\", \"cc\"]),[\"cc\", \"dd\", \"aaaa\", \"bbbb\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "js", - "prompt": "//You are given an array arr of integers and you need to return\n// sum of magnitudes of integers multiplied by product of all signs\n// of each number in the array, represented by 1, -1 or 0.\n// Note: return undefined for empty arr.\n// Example:\n// >>> prod_signs([1, 2, 2, -4])\n// 9\n// >>> prod_signs([0, 1])\n// 0\n// >>> prod_signs([])\n// undefined\nfunction prod_signs(arr){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = prod_signs;\n assert.deepEqual(candidate([1, 2, 2, -4]),-9);\n assert.deepEqual(candidate([0, 1]),0);\n assert.deepEqual(candidate([1, 1, 1, 2, 3, -1, 1]),-10);\n assert.deepEqual(candidate([]),undefined);\n assert.deepEqual(candidate([2, 4, 1, 2, -1, -1, 9]),20);\n assert.deepEqual(candidate([-1, 1, -1, 1]),4);\n assert.deepEqual(candidate([-1, 1, 1, 1]),-4);\n assert.deepEqual(candidate([-1, 1, 1, 0]),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "js", - "prompt": "//Return array with elements incremented by 1.\n// >>> incr_list([1, 2, 3])\n// [2, 3, 4]\n// >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123])\n// [6, 4, 6, 3, 4, 4, 10, 1, 124]\nfunction incr_list(l){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = incr_list;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([3, 2, 1]),[4, 3, 2]);\n assert.deepEqual(candidate([5, 2, 5, 2, 3, 3, 9, 0, 123]),[6, 3, 6, 3, 4, 4, 10, 1, 124]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "js", - "prompt": "//From a given array of integers, generate an array of rolling maximum element found until given moment\n// in the sequence.\n// >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n// [1, 2, 3, 3, 3, 4, 4]\nfunction rolling_max(numbers){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = rolling_max;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, 2, 3, 4]),[1, 2, 3, 4]);\n assert.deepEqual(candidate([4, 3, 2, 1]),[4, 4, 4, 4]);\n assert.deepEqual(candidate([3, 2, 3, 100, 3]),[3, 3, 3, 100, 100]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "js", - "prompt": "//Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n// separate those group into separate strings and return the array of those.\n// Separate groups are balanced (each open brace is properly closed) and not nested within each other\n// Ignore any spaces in the input string.\n// >>> separate_paren_groups(\"( ) (( )) (( )( ))\")\n// [\"()\", \"(())\", \"(()())\"]\nfunction separate_paren_groups(paren_string){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = separate_paren_groups;\n assert.deepEqual(candidate(\"(()()) ((())) () ((())()())\"),[\"(()())\", \"((()))\", \"()\", \"((())()())\"]);\n assert.deepEqual(candidate(\"() (()) ((())) (((())))\"),[\"()\", \"(())\", \"((()))\", \"(((())))\"]);\n assert.deepEqual(candidate(\"(()(())((())))\"),[\"(()(())((())))\"]);\n assert.deepEqual(candidate(\"( ) (( )) (( )( ))\"),[\"()\", \"(())\", \"(()())\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "js", - "prompt": "//You will be given a string of words separated by commas or spaces. Your task is\n// to split the string into words and return an array of the words.\n// For example:\n// >>> words_string(\"Hi, my name is John\")\n// [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n// >>> words_string(\"One, two, three, four, five, six\")\n// [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\nfunction words_string(s){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = words_string;\n assert.deepEqual(candidate(\"Hi, my name is John\"),[\"Hi\", \"my\", \"name\", \"is\", \"John\"]);\n assert.deepEqual(candidate(\"One, two, three, four, five, six\"),[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]);\n assert.deepEqual(candidate(\"Hi, my name\"),[\"Hi\", \"my\", \"name\"]);\n assert.deepEqual(candidate(\"One,, two, three, four, five, six,\"),[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]);\n assert.deepEqual(candidate(\"\"),[]);\n assert.deepEqual(candidate(\"ahmed , gamal\"),[\"ahmed\", \"gamal\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "js", - "prompt": "//Create a function that takes integers, floats, or strings representing\n// real numbers, and returns the larger variable in its given variable type.\n// Return undefined if the values are equal.\n// Note: If a real number is represented as a string, the floating point might be . or ,\n// >>> compare_one(1, 2.5)\n// 2.5\n// >>> compare_one(1, \"2,3\")\n// \"2,3\"\n// >>> compare_one(\"5,1\", \"6\")\n// \"6\"\n// >>> compare_one(\"1\", 1)\n// undefined\nfunction compare_one(a, b){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = compare_one;\n assert.deepEqual(candidate(1, 2),2);\n assert.deepEqual(candidate(1, 2.5),2.5);\n assert.deepEqual(candidate(2, 3),3);\n assert.deepEqual(candidate(5, 6),6);\n assert.deepEqual(candidate(1, \"2,3\"),\"2,3\");\n assert.deepEqual(candidate(\"5,1\", \"6\"),\"6\");\n assert.deepEqual(candidate(\"1\", \"2\"),\"2\");\n assert.deepEqual(candidate(\"1\", 1),undefined);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "js", - "prompt": "//Filter given array of any jsthon values only for integers\n// >>> filter_integers([\"a\", 3.14, 5])\n// [5]\n// >>> filter_integers([1, 2, 3, \"abc\", {}, []])\n// [1, 2, 3]\nfunction filter_integers(values){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = filter_integers;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([4, {}, [], 23.2, 9, \"adasd\"]),[4, 9]);\n assert.deepEqual(candidate([3, \"c\", 3, 3, \"a\", \"b\"]),[3, 3, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "js", - "prompt": "//This function takes an array l and returns an array l' such that\n// l' is identical to l in the odd indicies, while its values at the even indicies are equal\n// to the values of the even indicies of l, but sorted.\n// >>> sort_even([1, 2, 3])\n// [1, 2, 3]\n// >>> sort_even([5, 6, 3, 4])\n// [3, 6, 5, 4]\nfunction sort_even(l){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_even;\n assert.deepEqual(candidate([1, 2, 3]),[1, 2, 3]);\n assert.deepEqual(candidate([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]),[-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123]);\n assert.deepEqual(candidate([5, 8, -12, 4, 23, 2, 3, 11, 12, -10]),[-12, 8, 3, 4, 5, 2, 12, 11, 23, -10]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "js", - "prompt": "//I think we all remember that feeling when the result of some long-awaited\n// event is finally known. The feelings and thoughts you have at that moment are\n// definitely worth noting down and comparing.\n// Your task is to determine if a person correctly guessed the results of a number of matches.\n// You are given two arrays of scores and guesses of equal length, where each index shows a match. \n// Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n// the value is 0, and if not, the value is the absolute difference between the guess and the score.\n// example:\n// >>> compare([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2])\n// [0, 0, 0, 0, 3, 3]\n// >>> compare([0, 5, 0, 0, 0, 4], [4, 1, 1, 0, 0, -2])\n// [4, 4, 1, 0, 0, 6]\nfunction compare(game, guess){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = compare;\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2]),[0, 0, 0, 0, 3, 3]);\n assert.deepEqual(candidate([0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]),[0, 0, 0, 0, 0, 0]);\n assert.deepEqual(candidate([1, 2, 3], [-1, -2, -3]),[2, 4, 6]);\n assert.deepEqual(candidate([1, 2, 3, 5], [-1, 2, 3, 4]),[2, 0, 0, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "js", - "prompt": "//Given a positive integer n, return an array that has the number of even and odd\n// integer palindromes that fall within the range(1, n), inclusive.\n// Example 1:\n// >>> even_odd_palindrome(3)\n// [1, 2]\n// Explanation:\n// Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n// Example 2:\n// >>> even_odd_palindrome(12)\n// [4, 6]\n// Explanation:\n// Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n// Note:\n// 1. 1 <= n <= 10^3\n// 2. returned array has the number of even and odd integer palindromes respectively.\nfunction even_odd_palindrome(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = even_odd_palindrome;\n assert.deepEqual(candidate(123),[8, 13]);\n assert.deepEqual(candidate(12),[4, 6]);\n assert.deepEqual(candidate(3),[1, 2]);\n assert.deepEqual(candidate(63),[6, 8]);\n assert.deepEqual(candidate(25),[5, 6]);\n assert.deepEqual(candidate(19),[4, 6]);\n assert.deepEqual(candidate(9),[4, 5]);\n assert.deepEqual(candidate(1),[0, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "js", - "prompt": "//The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fib4(0) -> 0\n// fib4(1) -> 0\n// fib4(2) -> 2\n// fib4(3) -> 0\n// fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n// Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n// >>> fib4(5)\n// 4\n// >>> fib4(6)\n// 8\n// >>> fib4(7)\n// 14\nfunction fib4(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fib4;\n assert.deepEqual(candidate(5),4);\n assert.deepEqual(candidate(8),28);\n assert.deepEqual(candidate(10),104);\n assert.deepEqual(candidate(12),386);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "js", - "prompt": "//Given two positive integers a and b, return the even digits between a\n// and b, in ascending order.\n// For example:\n// >>> generate_integers(2, 8)\n// [2, 4, 6, 8]\n// >>> generate_integers(8, 2)\n// [2, 4, 6, 8]\n// >>> generate_integers(10, 14)\n// []\nfunction generate_integers(a, b){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = generate_integers;\n assert.deepEqual(candidate(2, 10),[2, 4, 6, 8]);\n assert.deepEqual(candidate(10, 2),[2, 4, 6, 8]);\n assert.deepEqual(candidate(132, 2),[2, 4, 6, 8]);\n assert.deepEqual(candidate(17, 89),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "js", - "prompt": "//For a given array of input numbers, calculate Mean Absolute Deviation\n// around the mean of this dataset.\n// Mean Absolute Deviation is the average absolute difference between each\n// element and a centerpoint (mean in this case):\n// MAD = average | x - x_mean |\n// >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n// 1.0\nfunction mean_absolute_deviation(numbers){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = mean_absolute_deviation;\n assert.deepEqual(candidate([1.0, 2.0]),0.5);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0]),1.0);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0]),1.2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "js", - "prompt": "//Create a function encrypt that takes a string as an argument and\n// returns a string encrypted with the alphabet being rotated. \n// The alphabet should be rotated in a manner such that the letters \n// shift down by two multiplied to two places.\n// For example:\n// >>> encrypt(\"hi\")\n// \"lm\"\n// >>> encrypt(\"asdfghjkl\")\n// \"ewhjklnop\"\n// >>> encrypt(\"gf\")\n// \"kj\"\n// >>> encrypt(\"et\")\n// \"ix\"\nfunction encrypt(s){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = encrypt;\n assert.deepEqual(candidate(\"hi\"),\"lm\");\n assert.deepEqual(candidate(\"asdfghjkl\"),\"ewhjklnop\");\n assert.deepEqual(candidate(\"gf\"),\"kj\");\n assert.deepEqual(candidate(\"et\"),\"ix\");\n assert.deepEqual(candidate(\"faewfawefaewg\"),\"jeiajeaijeiak\");\n assert.deepEqual(candidate(\"hellomyfriend\"),\"lippsqcjvmirh\");\n assert.deepEqual(candidate(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\"),\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\");\n assert.deepEqual(candidate(\"a\"),\"e\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "js", - "prompt": "//Given a positive integer n, return a sorted array that has the odd numbers in collatz sequence.\n// The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n// as follows: start with any positive integer n. Then each term is obtained from the \n// previous term as follows: if the previous term is even, the next term is one half of \n// the previous term. If the previous term is odd, the next term is 3 times the previous\n// term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n// Note: \n// 1. Collatz(1) is [1].\n// 2. returned array sorted in increasing order.\n// For example:\n// get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n// >>> get_odd_collatz(5)\n// [1, 5]\nfunction get_odd_collatz(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_odd_collatz;\n assert.deepEqual(candidate(14),[1, 5, 7, 11, 13, 17]);\n assert.deepEqual(candidate(5),[1, 5]);\n assert.deepEqual(candidate(12),[1, 3, 5]);\n assert.deepEqual(candidate(1),[1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "js", - "prompt": "//Find how many times a given substring can be found in the original string. Count overlaping cases.\n// >>> how_many_times(\"\", \"a\")\n// 0\n// >>> how_many_times(\"aaa\", \"a\")\n// 3\n// >>> how_many_times(\"aaaa\", \"aa\")\n// 3\nfunction how_many_times(string, substring){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = how_many_times;\n assert.deepEqual(candidate(\"\", \"x\"),0);\n assert.deepEqual(candidate(\"xyxyxyx\", \"x\"),4);\n assert.deepEqual(candidate(\"cacacacac\", \"cac\"),4);\n assert.deepEqual(candidate(\"john doe\", \"john\"),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "js", - "prompt": "//We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n// numbers in the array will be randomly ordered. Your task is to determine if\n// it is possible to get an array sorted in non-decreasing order by performing \n// the following operation on the given array:\n// You are allowed to perform right shift operation any number of times.\n// One right shift operation means shifting all elements of the array by one\n// position in the right direction. The last element of the array will be moved to\n// the starting position in the array i.e. 0th index. \n// If it is possible to obtain the sorted array by performing the above operation\n// then return true else return false.\n// If the given array is empty then return true.\n// Note: The given array is guaranteed to have unique elements.\n// For Example:\n// >>> move_one_ball([3, 4, 5, 1, 2])\n// true\n// Explanation: By performin 2 right shift operations, non-decreasing order can\n// be achieved for the given array.\n// >>> move_one_ball([3, 5, 4, 1, 2])\n// false\n// Explanation:It is not possible to get non-decreasing order for the given\n// array by performing any number of right shift operations.\nfunction move_one_ball(arr){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = move_one_ball;\n assert.deepEqual(candidate([3, 4, 5, 1, 2]),true);\n assert.deepEqual(candidate([3, 5, 10, 1, 2]),true);\n assert.deepEqual(candidate([4, 3, 1, 2]),false);\n assert.deepEqual(candidate([3, 5, 4, 1, 2]),false);\n assert.deepEqual(candidate([]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "js", - "prompt": "//Write a function which sorts the given array of integers\n// in ascending order according to the sum of their digits.\n// Note: if there are several items with similar sum of their digits,\n// order them based on their index in original array.\n// For example:\n// >>> order_by_points([1, 11, -1, -11, -12])\n// [-1, -11, 1, -12, 11]\n// >>> order_by_points([])\n// []\nfunction order_by_points(nums){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = order_by_points;\n assert.deepEqual(candidate([1, 11, -1, -11, -12]),[-1, -11, 1, -12, 11]);\n assert.deepEqual(candidate([1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]),[0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, -11, -32, 43, 54, -98, 2, -3]),[-3, -32, -98, -11, 1, 2, 43, 54]);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]),[1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9]);\n assert.deepEqual(candidate([0, 6, 6, -76, -21, 23, 4]),[-76, -21, 0, 4, 23, 6, 6]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "js", - "prompt": "//Return array of prime factors of given integer in the order from smallest to largest.\n// Each of the factors should be arrayed number of times corresponding to how many times it appeares in factorization.\n// Input number should be equal to the product of all factors\n// >>> factorize(8)\n// [2, 2, 2]\n// >>> factorize(25)\n// [5, 5]\n// >>> factorize(70)\n// [2, 5, 7]\nfunction factorize(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = factorize;\n assert.deepEqual(candidate(2),[2]);\n assert.deepEqual(candidate(4),[2, 2]);\n assert.deepEqual(candidate(8),[2, 2, 2]);\n assert.deepEqual(candidate(57),[3, 19]);\n assert.deepEqual(candidate(3249),[3, 3, 19, 19]);\n assert.deepEqual(candidate(185193),[3, 3, 3, 19, 19, 19]);\n assert.deepEqual(candidate(20577),[3, 19, 19, 19]);\n assert.deepEqual(candidate(18),[2, 3, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "js", - "prompt": "//Return true if all numbers in the array l are below threshold t.\n// >>> below_threshold([1, 2, 4, 10], 100)\n// true\n// >>> below_threshold([1, 20, 4, 10], 5)\n// false\nfunction below_threshold(l, t){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = below_threshold;\n assert.deepEqual(candidate([1, 2, 4, 10], 100),true);\n assert.deepEqual(candidate([1, 20, 4, 10], 5),false);\n assert.deepEqual(candidate([1, 20, 4, 10], 21),true);\n assert.deepEqual(candidate([1, 20, 4, 10], 22),true);\n assert.deepEqual(candidate([1, 8, 4, 10], 11),true);\n assert.deepEqual(candidate([1, 8, 4, 10], 10),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "js", - "prompt": "//You are given two positive integers n and m, and your task is to compute the\n// average of the integers from n through m (including n and m). \n// Round the answer to the nearest integer and convert that to binary.\n// If n is greater than m, return -1.\n// Example:\n// >>> rounded_avg(1, 5)\n// \"0b11\"\n// >>> rounded_avg(7, 5)\n// -1\n// >>> rounded_avg(10, 20)\n// \"0b1111\"\n// >>> rounded_avg(20, 33)\n// \"0b11010\"\nfunction rounded_avg(n, m){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = rounded_avg;\n assert.deepEqual(candidate(1, 5),\"0b11\");\n assert.deepEqual(candidate(7, 13),\"0b1010\");\n assert.deepEqual(candidate(964, 977),\"0b1111001010\");\n assert.deepEqual(candidate(996, 997),\"0b1111100100\");\n assert.deepEqual(candidate(560, 851),\"0b1011000010\");\n assert.deepEqual(candidate(185, 546),\"0b101101110\");\n assert.deepEqual(candidate(362, 496),\"0b110101101\");\n assert.deepEqual(candidate(350, 902),\"0b1001110010\");\n assert.deepEqual(candidate(197, 233),\"0b11010111\");\n assert.deepEqual(candidate(7, 5),-1);\n assert.deepEqual(candidate(5, 1),-1);\n assert.deepEqual(candidate(5, 5),\"0b101\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "js", - "prompt": "//Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n// For each of the group, output the deepest level of nesting of parentheses.\n// E.g. (()()) has maximum two levels of nesting while ((())) has three.\n// >>> parse_nested_parens(\"(()()) ((())) () ((())()())\")\n// [2, 3, 1, 3]\nfunction parse_nested_parens(paren_string){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = parse_nested_parens;\n assert.deepEqual(candidate(\"(()()) ((())) () ((())()())\"),[2, 3, 1, 3]);\n assert.deepEqual(candidate(\"() (()) ((())) (((())))\"),[1, 2, 3, 4]);\n assert.deepEqual(candidate(\"(()(())((())))\"),[4]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "js", - "prompt": "//Given a non-empty array of integers, return the sum of all of the odd elements that are in even positions.\n// Examples\n// >>> solution([5, 8, 7, 1])\n// 12\n// >>> solution([3, 3, 3, 3, 3])\n// 9\n// >>> solution([30, 13, 24, 321])\n// 0\nfunction solution(lst){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = solution;\n assert.deepEqual(candidate([5, 8, 7, 1]),12);\n assert.deepEqual(candidate([3, 3, 3, 3, 3]),9);\n assert.deepEqual(candidate([30, 13, 24, 321]),0);\n assert.deepEqual(candidate([5, 9]),5);\n assert.deepEqual(candidate([2, 4, 8]),0);\n assert.deepEqual(candidate([30, 13, 23, 32]),23);\n assert.deepEqual(candidate([3, 13, 2, 9]),3);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "js", - "prompt": "//You are given a positive integer n. You have to create an integer array a of length n.\n// For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n// Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n// and a[i] + a[j] + a[k] is a multiple of 3.\n// Example :\n// >>> get_max_triples(5)\n// 1\n// Explanation: \n// a = [1, 3, 7, 13, 21]\n// The only valid triple is (1, 7, 13).\nfunction get_max_triples(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_max_triples;\n assert.deepEqual(candidate(5),1);\n assert.deepEqual(candidate(6),4);\n assert.deepEqual(candidate(10),36);\n assert.deepEqual(candidate(100),53361);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "js", - "prompt": "//There are eight planets in our solar system: the closerst to the Sun \n// is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n// Uranus, Neptune.\n// Write a function that takes two planet names as strings planet1 and planet2. \n// The function should return an array containing all planets whose orbits are \n// located between the orbit of planet1 and the orbit of planet2, sorted by \n// the proximity to the sun. \n// The function should return an empty array if planet1 or planet2\n// are not correct planet names. \n// Examples\n// >>> bf(\"Jupiter\", \"Neptune\")\n// [\"Saturn\", \"Uranus\"]\n// >>> bf(\"Earth\", \"Mercury\")\n// \"Venus\"\n// >>> bf(\"Mercury\", \"Uranus\")\n// [\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"]\nfunction bf(planet1, planet2){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = bf;\n assert.deepEqual(candidate(\"Jupiter\", \"Neptune\"),[\"Saturn\", \"Uranus\"]);\n assert.deepEqual(candidate(\"Earth\", \"Mercury\"),[\"Venus\"]);\n assert.deepEqual(candidate(\"Mercury\", \"Uranus\"),[\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"]);\n assert.deepEqual(candidate(\"Neptune\", \"Venus\"),[\"Earth\", \"Mars\", \"Jupiter\", \"Saturn\", \"Uranus\"]);\n assert.deepEqual(candidate(\"Earth\", \"Earth\"),[]);\n assert.deepEqual(candidate(\"Mars\", \"Earth\"),[]);\n assert.deepEqual(candidate(\"Jupiter\", \"Makemake\"),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "js", - "prompt": "//You are given an array of integers.\n// Write a function next_smallest() that returns the 2nd smallest element of the array.\n// Return undefined if there is no such element.\n// >>> next_smallest([1, 2, 3, 4, 5])\n// 2\n// >>> next_smallest([5, 1, 4, 3, 2])\n// 2\n// >>> next_smallest([])\n// undefined\n// >>> next_smallest([1, 1])\n// undefined\nfunction next_smallest(lst){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = next_smallest;\n assert.deepEqual(candidate([1, 2, 3, 4, 5]),2);\n assert.deepEqual(candidate([5, 1, 4, 3, 2]),2);\n assert.deepEqual(candidate([]),undefined);\n assert.deepEqual(candidate([1, 1]),undefined);\n assert.deepEqual(candidate([1, 1, 1, 1, 0]),1);\n assert.deepEqual(candidate([1, 1]),undefined);\n assert.deepEqual(candidate([-35, 34, 12, -45]),-35);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "js", - "prompt": "//Input is a space-delimited string of numberals from 'zero' to 'nine'.\n// Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n// Return the string with numbers sorted from smallest to largest\n// >>> sort_numbers(\"three one five\")\n// \"one three five\"\nfunction sort_numbers(numbers){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_numbers;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"three\"),\"three\");\n assert.deepEqual(candidate(\"three five nine\"),\"three five nine\");\n assert.deepEqual(candidate(\"five zero four seven nine eight\"),\"zero four five seven eight nine\");\n assert.deepEqual(candidate(\"six five four three two one zero\"),\"zero one two three four five six\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "js", - "prompt": "//You are given 2 words. You need to return true if the second word or any of its rotations is a substring in the first word\n// >>> cycpattern_check(\"abcd\", \"abd\")\n// false\n// >>> cycpattern_check(\"hello\", \"ell\")\n// true\n// >>> cycpattern_check(\"whassup\", \"psus\")\n// false\n// >>> cycpattern_check(\"abab\", \"baa\")\n// true\n// >>> cycpattern_check(\"efef\", \"eeff\")\n// false\n// >>> cycpattern_check(\"himenss\", \"simen\")\n// true\nfunction cycpattern_check(a, b){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = cycpattern_check;\n assert.deepEqual(candidate(\"xyzw\", \"xyw\"),false);\n assert.deepEqual(candidate(\"yello\", \"ell\"),true);\n assert.deepEqual(candidate(\"whattup\", \"ptut\"),false);\n assert.deepEqual(candidate(\"efef\", \"fee\"),true);\n assert.deepEqual(candidate(\"abab\", \"aabb\"),false);\n assert.deepEqual(candidate(\"winemtt\", \"tinem\"),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "js", - "prompt": "//You will be given a number in decimal form and your task is to convert it to\n// binary format. The function should return a string, with each character representing a binary\n// number. Each character in the string will be '0' or '1'.\n// There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n// The extra characters are there to help with the format.\n// Examples:\n// >>> decimal_to_binary(15)\n// \"db1111db\"\n// >>> decimal_to_binary(32)\n// \"db100000db\"\nfunction decimal_to_binary(decimal){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = decimal_to_binary;\n assert.deepEqual(candidate(0),\"db0db\");\n assert.deepEqual(candidate(32),\"db100000db\");\n assert.deepEqual(candidate(103),\"db1100111db\");\n assert.deepEqual(candidate(15),\"db1111db\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "js", - "prompt": "//Filter an input array of strings only for ones that contain given substring\n// >>> filter_by_substring([], \"a\")\n// []\n// >>> filter_by_substring([\"abc\", \"bacd\", \"cde\", \"array\"], \"a\")\n// [\"abc\", \"bacd\", \"array\"]\nfunction filter_by_substring(strings, substring){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = filter_by_substring;\n assert.deepEqual(candidate([], \"john\"),[]);\n assert.deepEqual(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"),[\"xxx\", \"xxxAAA\", \"xxx\"]);\n assert.deepEqual(candidate([\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xx\"),[\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"]);\n assert.deepEqual(candidate([\"grunt\", \"trumpet\", \"prune\", \"gruesome\"], \"run\"),[\"grunt\", \"prune\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "js", - "prompt": "//Given an integer. return an array that has the number of even and odd digits respectively.\n// Example:\n// >>> even_odd_count(-12)\n// [1, 1]\n// >>> even_odd_count(123)\n// [1, 2]\nfunction even_odd_count(num){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = even_odd_count;\n assert.deepEqual(candidate(7),[0, 1]);\n assert.deepEqual(candidate(-78),[1, 1]);\n assert.deepEqual(candidate(3452),[2, 2]);\n assert.deepEqual(candidate(346211),[3, 3]);\n assert.deepEqual(candidate(-345821),[3, 3]);\n assert.deepEqual(candidate(-2),[1, 0]);\n assert.deepEqual(candidate(-45347),[2, 3]);\n assert.deepEqual(candidate(0),[1, 0]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "js", - "prompt": "//Write a function that accepts an array of strings.\n// The array contains different words. Return the word with maximum number\n// of unique characters. If multiple strings have maximum number of unique\n// characters, return the one which comes first in lexicographical order.\n// >>> find_max([\"name\", \"of\", \"string\"])\n// \"string\"\n// >>> find_max([\"name\", \"enam\", \"game\"])\n// \"enam\"\n// >>> find_max([\"aaaaaaa\", \"bb\", \"cc\"])\n// \"aaaaaaa\"\nfunction find_max(words){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = find_max;\n assert.deepEqual(candidate([\"name\", \"of\", \"string\"]),\"string\");\n assert.deepEqual(candidate([\"name\", \"enam\", \"game\"]),\"enam\");\n assert.deepEqual(candidate([\"aaaaaaa\", \"bb\", \"cc\"]),\"aaaaaaa\");\n assert.deepEqual(candidate([\"abc\", \"cba\"]),\"abc\");\n assert.deepEqual(candidate([\"play\", \"this\", \"game\", \"of\", \"footbott\"]),\"footbott\");\n assert.deepEqual(candidate([\"we\", \"are\", \"gonna\", \"rock\"]),\"gonna\");\n assert.deepEqual(candidate([\"we\", \"are\", \"a\", \"mad\", \"nation\"]),\"nation\");\n assert.deepEqual(candidate([\"this\", \"is\", \"a\", \"prrk\"]),\"this\");\n assert.deepEqual(candidate([\"b\"]),\"b\");\n assert.deepEqual(candidate([\"play\", \"play\", \"play\"]),\"play\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "js", - "prompt": "//Given a positive integer n, return the count of the numbers of n-digit\n// positive integers that start or end with 1.\nfunction starts_one_ends(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = starts_one_ends;\n assert.deepEqual(candidate(1),1);\n assert.deepEqual(candidate(2),18);\n assert.deepEqual(candidate(3),180);\n assert.deepEqual(candidate(4),1800);\n assert.deepEqual(candidate(5),18000);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "js", - "prompt": "//Create a function that returns an array (a, b), where 'a' is\n// the largest of negative integers, and 'b' is the smallest\n// of positive integers in an array.\n// If there is no negative or positive integers, return them as undefined.\n// Examples:\n// >>> largest_smallest_integers([2, 4, 1, 3, 5, 7])\n// [undefined, 1]\n// >>> largest_smallest_integers([])\n// [undefined, undefined]\n// >>> largest_smallest_integers([0])\n// [undefined, undefined]\nfunction largest_smallest_integers(lst){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = largest_smallest_integers;\n assert.deepEqual(candidate([2, 4, 1, 3, 5, 7]),[undefined, 1]);\n assert.deepEqual(candidate([2, 4, 1, 3, 5, 7, 0]),[undefined, 1]);\n assert.deepEqual(candidate([1, 3, 2, 4, 5, 6, -2]),[-2, 1]);\n assert.deepEqual(candidate([4, 5, 3, 6, 2, 7, -7]),[-7, 2]);\n assert.deepEqual(candidate([7, 3, 8, 4, 9, 2, 5, -9]),[-9, 2]);\n assert.deepEqual(candidate([]),[undefined, undefined]);\n assert.deepEqual(candidate([0]),[undefined, undefined]);\n assert.deepEqual(candidate([-1, -3, -5, -6]),[-1, undefined]);\n assert.deepEqual(candidate([-1, -3, -5, -6, 0]),[-1, undefined]);\n assert.deepEqual(candidate([-6, -4, -4, -3, 1]),[-3, 1]);\n assert.deepEqual(candidate([-6, -4, -4, -3, -100, 1]),[-3, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "js", - "prompt": "//\"Given an array representing a branch of a tree that has non-negative integer nodes\n// your task is to pluck one of the nodes and return it.\n// The plucked node should be the node with the smallest even value.\n// If multiple nodes with the same smallest even value are found return the node that has smallest index.\n// The plucked node should be returned in an array, [ smalest_value, its index ],\n// If there are no even values or the given array is empty, return [].\n// Example 1:\n// >>> pluck([4, 2, 3])\n// [2, 1]\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 2:\n// >>> pluck([1, 2, 3])\n// [2, 1]\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 3:\n// >>> pluck([])\n// []\n// Example 4:\n// >>> pluck([5, 0, 3, 0, 4, 2])\n// [0, 1]\n// Explanation: 0 is the smallest value, but there are two zeros,\n// so we will choose the first zero, which has the smallest index.\n// Constraints:\n// * 1 <= nodes.length <= 10000\n// * 0 <= node.value\nfunction pluck(arr){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = pluck;\n assert.deepEqual(candidate([4, 2, 3]),[2, 1]);\n assert.deepEqual(candidate([1, 2, 3]),[2, 1]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([5, 0, 3, 0, 4, 2]),[0, 1]);\n assert.deepEqual(candidate([1, 2, 3, 0, 5, 3]),[0, 3]);\n assert.deepEqual(candidate([5, 4, 8, 4, 8]),[4, 1]);\n assert.deepEqual(candidate([7, 6, 7, 1]),[6, 1]);\n assert.deepEqual(candidate([7, 9, 7, 1]),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "js", - "prompt": "//Write a function count_nums which takes an array of integers and returns\n// the number of elements which has a sum of digits > 0.\n// If a number is negative, then its first signed digit will be negative:\n// e.g. -123 has signed digits -1, 2, and 3.\n// >>> count_nums([])\n// 0\n// >>> count_nums([-1, 11, -11])\n// 1\n// >>> count_nums([1, 1, 2])\n// 3\nfunction count_nums(arr){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_nums;\n assert.deepEqual(candidate([]),0);\n assert.deepEqual(candidate([-1, -2, 0]),0);\n assert.deepEqual(candidate([1, 1, 2, -2, 3, 4, 5]),6);\n assert.deepEqual(candidate([1, 6, 9, -6, 0, 1, 5]),5);\n assert.deepEqual(candidate([1, 100, 98, -7, 1, -1]),4);\n assert.deepEqual(candidate([12, 23, 34, -45, -56, 0]),5);\n assert.deepEqual(candidate([0, 1]),1);\n assert.deepEqual(candidate([1]),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "js", - "prompt": "//Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n// each cell of the grid contains a value. Every integer in the range [1, N * N]\n// inclusive appears exactly once on the cells of the grid.\n// You have to find the minimum path of length k in the grid. You can start\n// from any cell, and in each step you can move to any of the neighbor cells,\n// in other words, you can go to cells which share an edge with you current\n// cell.\n// Please note that a path of length k means visiting exactly k cells (not\n// necessarily distinct).\n// You CANNOT go off the grid.\n// A path A (of length k) is considered less than a path B (of length k) if\n// after making the ordered arrays of the values on the cells that A and B go\n// through (let's call them lst_A and lst_B), lst_A is lexicographically less\n// than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n// such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n// lst_A[j] = lst_B[j].\n// It is guaranteed that the answer is unique.\n// Return an ordered array of the values on the cells that the minimum path go through.\n// Examples: \n// >>> minPath([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3)\n// [1, 2, 1]\n// >>> minPath([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1)\n// [1]\nfunction minPath(grid, k){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = minPath;\n assert.deepEqual(candidate([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3),[1, 2, 1]);\n assert.deepEqual(candidate([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1),[1]);\n assert.deepEqual(candidate([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], 4),[1, 2, 1, 2]);\n assert.deepEqual(candidate([[6, 4, 13, 10], [5, 7, 12, 1], [3, 16, 11, 15], [8, 14, 9, 2]], 7),[1, 10, 1, 10, 1, 10, 1]);\n assert.deepEqual(candidate([[8, 14, 9, 2], [6, 4, 13, 15], [5, 7, 1, 12], [3, 10, 11, 16]], 5),[1, 7, 1, 7, 1]);\n assert.deepEqual(candidate([[11, 8, 7, 2], [5, 16, 14, 4], [9, 3, 15, 6], [12, 13, 10, 1]], 9),[1, 6, 1, 6, 1, 6, 1, 6, 1]);\n assert.deepEqual(candidate([[12, 13, 10, 1], [9, 3, 15, 6], [5, 16, 14, 4], [11, 8, 7, 2]], 12),[1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6]);\n assert.deepEqual(candidate([[2, 7, 4], [3, 1, 5], [6, 8, 9]], 8),[1, 3, 1, 3, 1, 3, 1, 3]);\n assert.deepEqual(candidate([[6, 1, 5], [3, 8, 9], [2, 7, 4]], 8),[1, 5, 1, 5, 1, 5, 1, 5]);\n assert.deepEqual(candidate([[1, 2], [3, 4]], 10),[1, 2, 1, 2, 1, 2, 1, 2, 1, 2]);\n assert.deepEqual(candidate([[1, 3], [3, 2]], 10),[1, 3, 1, 3, 1, 3, 1, 3, 1, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "js", - "prompt": "//Given array of integers, return array in strange order.\n// Strange sorting, is when you start with the minimum value,\n// then maximum of the remaining integers, then minimum and so on.\n// Examples:\n// >>> strange_sort_list([1, 2, 3, 4])\n// [1, 4, 2, 3]\n// >>> strange_sort_list([5, 5, 5, 5])\n// [5, 5, 5, 5]\n// >>> strange_sort_list([])\n// []\nfunction strange_sort_list(lst){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = strange_sort_list;\n assert.deepEqual(candidate([1, 2, 3, 4]),[1, 4, 2, 3]);\n assert.deepEqual(candidate([5, 6, 7, 8, 9]),[5, 9, 6, 8, 7]);\n assert.deepEqual(candidate([1, 2, 3, 4, 5]),[1, 5, 2, 4, 3]);\n assert.deepEqual(candidate([5, 6, 7, 8, 9, 1]),[1, 9, 5, 8, 6, 7]);\n assert.deepEqual(candidate([5, 5, 5, 5]),[5, 5, 5, 5]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6, 7, 8]),[1, 8, 2, 7, 3, 6, 4, 5]);\n assert.deepEqual(candidate([0, 2, 2, 2, 5, 5, -5, -5]),[-5, 5, -5, 5, 0, 2, 2, 2]);\n assert.deepEqual(candidate([111111]),[111111]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "js", - "prompt": "//Given a string 'text', return its md5 hash equivalent string.\n// If 'text' is an empty string, return undefined.\n// >>> string_to_md5(\"Hello world\")\n// \"3e25960a79dbc69b674cd4ec67a72c62\"\nfunction string_to_md5(text){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = string_to_md5;\n assert.deepEqual(candidate(\"Hello world\"),\"3e25960a79dbc69b674cd4ec67a72c62\");\n assert.deepEqual(candidate(\"\"),undefined);\n assert.deepEqual(candidate(\"A B C\"),\"0ef78513b0cb8cef12743f5aeb35f888\");\n assert.deepEqual(candidate(\"password\"),\"5f4dcc3b5aa765d61d8327deb882cf99\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "js", - "prompt": "//You are given a word. Your task is to find the closest vowel that stands between \n// two consonants from the right side of the word (case sensitive).\n// Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n// find any vowel met the above condition. \n// You may assume that the given string contains English letter only.\n// Example:\n// >>> get_closest_vowel(\"yogurt\")\n// \"u\"\n// >>> get_closest_vowel(\"FULL\")\n// \"U\"\n// >>> get_closest_vowel(\"quick\")\n// \"\"\n// >>> get_closest_vowel(\"ab\")\n// \"\"\nfunction get_closest_vowel(word){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_closest_vowel;\n assert.deepEqual(candidate(\"yogurt\"),\"u\");\n assert.deepEqual(candidate(\"full\"),\"u\");\n assert.deepEqual(candidate(\"easy\"),\"\");\n assert.deepEqual(candidate(\"eAsy\"),\"\");\n assert.deepEqual(candidate(\"ali\"),\"\");\n assert.deepEqual(candidate(\"bad\"),\"a\");\n assert.deepEqual(candidate(\"most\"),\"o\");\n assert.deepEqual(candidate(\"ab\"),\"\");\n assert.deepEqual(candidate(\"ba\"),\"\");\n assert.deepEqual(candidate(\"quick\"),\"\");\n assert.deepEqual(candidate(\"anime\"),\"i\");\n assert.deepEqual(candidate(\"Asia\"),\"\");\n assert.deepEqual(candidate(\"Above\"),\"o\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "js", - "prompt": "//Change numerical base of input number x to base.\n// return string representation after the conversion.\n// base numbers are less than 10.\n// >>> change_base(8, 3)\n// \"22\"\n// >>> change_base(8, 2)\n// \"1000\"\n// >>> change_base(7, 2)\n// \"111\"\nfunction change_base(x, base){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = change_base;\n assert.deepEqual(candidate(8, 3),\"22\");\n assert.deepEqual(candidate(9, 3),\"100\");\n assert.deepEqual(candidate(234, 2),\"11101010\");\n assert.deepEqual(candidate(16, 2),\"10000\");\n assert.deepEqual(candidate(8, 2),\"1000\");\n assert.deepEqual(candidate(7, 2),\"111\");\n assert.deepEqual(candidate(2, 3),\"2\");\n assert.deepEqual(candidate(3, 4),\"3\");\n assert.deepEqual(candidate(4, 5),\"4\");\n assert.deepEqual(candidate(5, 6),\"5\");\n assert.deepEqual(candidate(6, 7),\"6\");\n assert.deepEqual(candidate(7, 8),\"7\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "js", - "prompt": "//Check if in given array of numbers, are any two numbers closer to each other than\n// given threshold.\n// >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n// false\n// >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n// true\nfunction has_close_elements(numbers, threshold){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = has_close_elements;\n assert.deepEqual(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3),true);\n assert.deepEqual(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05),false);\n assert.deepEqual(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.95),true);\n assert.deepEqual(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.8),false);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1),true);\n assert.deepEqual(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 1.0),true);\n assert.deepEqual(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 0.5),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "js", - "prompt": "//Create a function that takes a string as input which contains only square brackets.\n// The function should return true if and only if there is a valid subsequence of brackets \n// where at least one bracket in the subsequence is nested.\n// >>> is_nested(\"[[]]\")\n// true\n// >>> is_nested(\"[]]]]]]][[[[[]\")\n// false\n// >>> is_nested(\"[][]\")\n// false\n// >>> is_nested(\"[]\")\n// false\n// >>> is_nested(\"[[][]]\")\n// true\n// >>> is_nested(\"[[]][[\")\n// true\nfunction is_nested(string){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_nested;\n assert.deepEqual(candidate(\"[[]]\"),true);\n assert.deepEqual(candidate(\"[]]]]]]][[[[[]\"),false);\n assert.deepEqual(candidate(\"[][]\"),false);\n assert.deepEqual(candidate(\"[]\"),false);\n assert.deepEqual(candidate(\"[[[[]]]]\"),true);\n assert.deepEqual(candidate(\"[]]]]]]]]]]\"),false);\n assert.deepEqual(candidate(\"[][][[]]\"),true);\n assert.deepEqual(candidate(\"[[]\"),false);\n assert.deepEqual(candidate(\"[]]\"),false);\n assert.deepEqual(candidate(\"[[]][[\"),true);\n assert.deepEqual(candidate(\"[[][]]\"),true);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"[[[[[[[[\"),false);\n assert.deepEqual(candidate(\"]]]]]]]]\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "js", - "prompt": "//Concatenate array of strings into a single string\n// >>> concatenate([])\n// \"\"\n// >>> concatenate([\"a\", \"b\", \"c\"])\n// \"abc\"\nfunction concatenate(strings){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = concatenate;\n assert.deepEqual(candidate([]),\"\");\n assert.deepEqual(candidate([\"x\", \"y\", \"z\"]),\"xyz\");\n assert.deepEqual(candidate([\"x\", \"y\", \"z\", \"w\", \"k\"]),\"xyzwk\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "js", - "prompt": "//prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n// >>> prime_fib(1)\n// 2\n// >>> prime_fib(2)\n// 3\n// >>> prime_fib(3)\n// 5\n// >>> prime_fib(4)\n// 13\n// >>> prime_fib(5)\n// 89\nfunction prime_fib(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = prime_fib;\n assert.deepEqual(candidate(1),2);\n assert.deepEqual(candidate(2),3);\n assert.deepEqual(candidate(3),5);\n assert.deepEqual(candidate(4),13);\n assert.deepEqual(candidate(5),89);\n assert.deepEqual(candidate(6),233);\n assert.deepEqual(candidate(7),1597);\n assert.deepEqual(candidate(8),28657);\n assert.deepEqual(candidate(9),514229);\n assert.deepEqual(candidate(10),433494437);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "js", - "prompt": "//From a supplied array of numbers (of length at least two) select and return two that are the closest to each\n// other and return them in order (smaller number, larger number).\n// >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n// [2.0, 2.2]\n// >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n// [2.0, 2.0]\nfunction find_closest_elements(numbers){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = find_closest_elements;\n assert.deepEqual(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2]),[3.9, 4.0]);\n assert.deepEqual(candidate([1.0, 2.0, 5.9, 4.0, 5.0]),[5.0, 5.9]);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]),[2.0, 2.2]);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]),[2.0, 2.0]);\n assert.deepEqual(candidate([1.1, 2.2, 3.1, 4.1, 5.1]),[2.2, 3.1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "js", - "prompt": "//You have been tasked to write a function that receives \n// a hexadecimal number as a string and counts the number of hexadecimal \n// digits that are primes (prime number, or a prime, is a natural number \n// greater than 1 that is not a product of two smaller natural numbers).\n// Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n// Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n// So you have to determine a number of the following digits: 2, 3, 5, 7, \n// B (=decimal 11), D (=decimal 13).\n// Note: you may assume the input is always correct or empty string, \n// and symbols A,B,C,D,E,F are always uppercase.\n// Examples:\n// >>> hex_key(\"AB\")\n// 1\n// >>> hex_key(\"1077E\")\n// 2\n// >>> hex_key(\"ABED1A33\")\n// 4\n// >>> hex_key(\"123456789ABCDEF0\")\n// 6\n// >>> hex_key(\"2020\")\n// 2\nfunction hex_key(num){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = hex_key;\n assert.deepEqual(candidate(\"AB\"),1);\n assert.deepEqual(candidate(\"1077E\"),2);\n assert.deepEqual(candidate(\"ABED1A33\"),4);\n assert.deepEqual(candidate(\"2020\"),2);\n assert.deepEqual(candidate(\"123456789ABCDEF0\"),6);\n assert.deepEqual(candidate(\"112233445566778899AABBCCDDEEFF00\"),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "js", - "prompt": "//Complete the function that takes two integers and returns \n// the product of their unit digits.\n// Assume the input is always valid.\n// Examples:\n// >>> multiply(148, 412)\n// 16\n// >>> multiply(19, 28)\n// 72\n// >>> multiply(2020, 1851)\n// 0\n// >>> multiply(14, -15)\n// 20\nfunction multiply(a, b){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = multiply;\n assert.deepEqual(candidate(148, 412),16);\n assert.deepEqual(candidate(19, 28),72);\n assert.deepEqual(candidate(2020, 1851),0);\n assert.deepEqual(candidate(14, -15),20);\n assert.deepEqual(candidate(76, 67),42);\n assert.deepEqual(candidate(17, 27),49);\n assert.deepEqual(candidate(0, 1),0);\n assert.deepEqual(candidate(0, 0),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "js", - "prompt": "//Given array of numbers (of at least two elements), apply a linear transform to that array,\n// such that the smallest number will become 0 and the largest will become 1\n// >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n// [0.0, 0.25, 0.5, 0.75, 1.0]\nfunction rescale_to_unit(numbers){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = rescale_to_unit;\n assert.deepEqual(candidate([2.0, 49.9]),[0.0, 1.0]);\n assert.deepEqual(candidate([100.0, 49.9]),[1.0, 0.0]);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0]),[0.0, 0.25, 0.5, 0.75, 1.0]);\n assert.deepEqual(candidate([2.0, 1.0, 5.0, 3.0, 4.0]),[0.25, 0.0, 1.0, 0.5, 0.75]);\n assert.deepEqual(candidate([12.0, 11.0, 15.0, 13.0, 14.0]),[0.25, 0.0, 1.0, 0.5, 0.75]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "js", - "prompt": "//Given a positive integer n, return the product of the odd digits.\n// Return 0 if all digits are even.\n// For example:\n// >>> digits(1)\n// 1\n// >>> digits(4)\n// 0\n// >>> digits(235)\n// 15\nfunction digits(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = digits;\n assert.deepEqual(candidate(5),5);\n assert.deepEqual(candidate(54),5);\n assert.deepEqual(candidate(120),1);\n assert.deepEqual(candidate(5014),5);\n assert.deepEqual(candidate(98765),315);\n assert.deepEqual(candidate(5576543),2625);\n assert.deepEqual(candidate(2468),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "js", - "prompt": "//You will be given the name of a class (a string) and an array of extensions.\n// The extensions are to be used to load additional classes to the class. The\n// strength of the extension is as follows: Let CAP be the number of the uppercase\n// letters in the extension's name, and let SM be the number of lowercase letters \n// in the extension's name, the strength is given by the fraction CAP - SM. \n// You should find the strongest extension and return a string in this \n// format: ClassName.StrongestExtensionName.\n// If there are two or more extensions with the same strength, you should\n// choose the one that comes first in the array.\n// For example, if you are given \"Slices\" as the class and an array of the\n// extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n// return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n// (its strength is -1).\n// Example:\n// >>> Strongest_Extension(\"my_class\", [\"AA\", \"Be\", \"CC\"])\n// \"my_class.AA\"\nfunction Strongest_Extension(class_name, extensions){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = Strongest_Extension;\n assert.deepEqual(candidate(\"Watashi\", [\"tEN\", \"niNE\", \"eIGHt8OKe\"]),\"Watashi.eIGHt8OKe\");\n assert.deepEqual(candidate(\"Boku123\", [\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"]),\"Boku123.YEs.WeCaNe\");\n assert.deepEqual(candidate(\"__YESIMHERE\", [\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"]),\"__YESIMHERE.NuLl__\");\n assert.deepEqual(candidate(\"K\", [\"Ta\", \"TAR\", \"t234An\", \"cosSo\"]),\"K.TAR\");\n assert.deepEqual(candidate(\"__HAHA\", [\"Tab\", \"123\", \"781345\", \"-_-\"]),\"__HAHA.123\");\n assert.deepEqual(candidate(\"YameRore\", [\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"]),\"YameRore.okIWILL123\");\n assert.deepEqual(candidate(\"finNNalLLly\", [\"Die\", \"NowW\", \"Wow\", \"WoW\"]),\"finNNalLLly.WoW\");\n assert.deepEqual(candidate(\"_\", [\"Bb\", \"91245\"]),\"_.Bb\");\n assert.deepEqual(candidate(\"Sp\", [\"671235\", \"Bb\"]),\"Sp.671235\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "js", - "prompt": "//Given a string representing a space separated lowercase letters, return an object\n// of the letter with the most repetition and containing the corresponding count.\n// If several letters have the same occurrence, return all of them.\n// Example:\n// >>> histogram(\"a b c\")\n// {\"a\": 1, \"b\": 1, \"c\": 1}\n// >>> histogram(\"a b b a\")\n// {\"a\": 2, \"b\": 2}\n// >>> histogram(\"a b c a b\")\n// {\"a\": 2, \"b\": 2}\n// >>> histogram(\"b b b b a\")\n// {\"b\": 4}\n// >>> histogram(\"\")\n// {}\nfunction histogram(test){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = histogram;\n assert.deepEqual(candidate(\"a b b a\"),{\"a\": 2, \"b\": 2});\n assert.deepEqual(candidate(\"a b c a b\"),{\"a\": 2, \"b\": 2});\n assert.deepEqual(candidate(\"a b c d g\"),{\"a\": 1, \"b\": 1, \"c\": 1, \"d\": 1, \"g\": 1});\n assert.deepEqual(candidate(\"r t g\"),{\"r\": 1, \"t\": 1, \"g\": 1});\n assert.deepEqual(candidate(\"b b b b a\"),{\"b\": 4});\n assert.deepEqual(candidate(\"r t g\"),{\"r\": 1, \"t\": 1, \"g\": 1});\n assert.deepEqual(candidate(\"\"),{});\n assert.deepEqual(candidate(\"a\"),{\"a\": 1});\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "js", - "prompt": "//pairs_sum_to_zero takes an array of integers as an input.\n// it returns true if there are two distinct elements in the array that\n// sum to zero, and false otherwise.\n// >>> pairs_sum_to_zero([1, 3, 5, 0])\n// false\n// >>> pairs_sum_to_zero([1, 3, -2, 1])\n// false\n// >>> pairs_sum_to_zero([1, 2, 3, 7])\n// false\n// >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7])\n// true\n// >>> pairs_sum_to_zero([1])\n// false\nfunction pairs_sum_to_zero(l){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = pairs_sum_to_zero;\n assert.deepEqual(candidate([1, 3, 5, 0]),false);\n assert.deepEqual(candidate([1, 3, -2, 1]),false);\n assert.deepEqual(candidate([1, 2, 3, 7]),false);\n assert.deepEqual(candidate([2, 4, -5, 3, 5, 7]),true);\n assert.deepEqual(candidate([1]),false);\n assert.deepEqual(candidate([-3, 9, -1, 3, 2, 30]),true);\n assert.deepEqual(candidate([-3, 9, -1, 3, 2, 31]),true);\n assert.deepEqual(candidate([-3, 9, -1, 4, 2, 30]),false);\n assert.deepEqual(candidate([-3, 9, -1, 4, 2, 31]),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "js", - "prompt": "//Write a function that accepts two arrays of strings and returns the array that has \n// total number of chars in the all strings of the array less than the other array.\n// if the two arrays have the same number of chars, return the first array.\n// Examples\n// >>> total_match([], [])\n// []\n// >>> total_match([\"hi\", \"admin\"], [\"hI\", \"Hi\"])\n// [\"hI\", \"Hi\"]\n// >>> total_match([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"])\n// [\"hi\", \"admin\"]\n// >>> total_match([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"])\n// [\"hI\", \"hi\", \"hi\"]\n// >>> total_match([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"])\n// [\"4\"]\nfunction total_match(lst1, lst2){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = total_match;\n assert.deepEqual(candidate([], []),[]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\"]),[\"hi\", \"hi\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"]),[\"hi\", \"admin\"]);\n assert.deepEqual(candidate([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"]),[\"4\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hI\", \"Hi\"]),[\"hI\", \"Hi\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"]),[\"hI\", \"hi\", \"hi\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hii\"]),[\"hi\", \"admin\"]);\n assert.deepEqual(candidate([], [\"this\"]),[]);\n assert.deepEqual(candidate([\"this\"], []),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "js", - "prompt": "//Circular shift the digits of the integer x, shift the digits right by shift\n// and return the result as a string.\n// If shift > number of digits, return digits reversed.\n// >>> circular_shift(12, 1)\n// \"21\"\n// >>> circular_shift(12, 2)\n// \"12\"\nfunction circular_shift(x, shift){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = circular_shift;\n assert.deepEqual(candidate(100, 2),\"001\");\n assert.deepEqual(candidate(12, 2),\"12\");\n assert.deepEqual(candidate(97, 8),\"79\");\n assert.deepEqual(candidate(12, 1),\"21\");\n assert.deepEqual(candidate(11, 101),\"11\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "js", - "prompt": "//Return true is array elements are monotonically increasing or decreasing.\n// >>> monotonic([1, 2, 4, 20])\n// true\n// >>> monotonic([1, 20, 4, 10])\n// false\n// >>> monotonic([4, 1, 0, -10])\n// true\nfunction monotonic(l){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = monotonic;\n assert.deepEqual(candidate([1, 2, 4, 10]),true);\n assert.deepEqual(candidate([1, 2, 4, 20]),true);\n assert.deepEqual(candidate([1, 20, 4, 10]),false);\n assert.deepEqual(candidate([4, 1, 0, -10]),true);\n assert.deepEqual(candidate([4, 1, 1, 0]),true);\n assert.deepEqual(candidate([1, 2, 3, 2, 5, 60]),false);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 60]),true);\n assert.deepEqual(candidate([9, 9, 9, 9]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "js", - "prompt": "//Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n// Example\n// >>> is_equal_to_sum_even(4)\n// false\n// >>> is_equal_to_sum_even(6)\n// false\n// >>> is_equal_to_sum_even(8)\n// true\nfunction is_equal_to_sum_even(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_equal_to_sum_even;\n assert.deepEqual(candidate(4),false);\n assert.deepEqual(candidate(6),false);\n assert.deepEqual(candidate(8),true);\n assert.deepEqual(candidate(10),true);\n assert.deepEqual(candidate(11),false);\n assert.deepEqual(candidate(12),true);\n assert.deepEqual(candidate(13),false);\n assert.deepEqual(candidate(16),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "js", - "prompt": "//Input to this function is a string representing musical notes in a special ASCII format.\n// Your task is to parse this string and return array of integers corresponding to how many beats does each\n// not last.\n// Here is a legend:\n// 'o' - whole note, lasts four beats\n// 'o|' - half note, lasts two beats\n// '.|' - quater note, lasts one beat\n// >>> parse_music(\"o o| .| o| o| .| .| .| .| o o\")\n// [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\nfunction parse_music(music_string){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = parse_music;\n assert.deepEqual(candidate(\"\"),[]);\n assert.deepEqual(candidate(\"o o o o\"),[4, 4, 4, 4]);\n assert.deepEqual(candidate(\".| .| .| .|\"),[1, 1, 1, 1]);\n assert.deepEqual(candidate(\"o| o| .| .| o o o o\"),[2, 2, 1, 1, 4, 4, 4, 4]);\n assert.deepEqual(candidate(\"o| .| o| .| o o| o o|\"),[2, 1, 2, 1, 4, 2, 4, 2]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "js", - "prompt": "//\"\n// This function will take an array of integers. For all entries in the array, the function shall square the integer entry if its index is a \n// multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n// change the entries in the array whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n// Examples:\n// >>> lst\n// [1, 2, 3]\n// >>> lst\n// []\n// >>> lst\n// [-1, -5, 2, -1, -5]\nfunction sum_squares(lst){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_squares;\n assert.deepEqual(candidate([1, 2, 3]),6);\n assert.deepEqual(candidate([1, 4, 9]),14);\n assert.deepEqual(candidate([]),0);\n assert.deepEqual(candidate([1, 1, 1, 1, 1, 1, 1, 1, 1]),9);\n assert.deepEqual(candidate([-1, -1, -1, -1, -1, -1, -1, -1, -1]),-3);\n assert.deepEqual(candidate([0]),0);\n assert.deepEqual(candidate([-1, -5, 2, -1, -5]),-126);\n assert.deepEqual(candidate([-56, -99, 1, 0, -2]),3030);\n assert.deepEqual(candidate([-1, 0, 0, 0, 0, 0, 0, 0, -1]),0);\n assert.deepEqual(candidate([-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37]),-14196);\n assert.deepEqual(candidate([-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10]),-1448);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "js", - "prompt": "//triples_sum_to_zero takes an array of integers as an input.\n// it returns true if there are three distinct elements in the array that\n// sum to zero, and false otherwise.\n// >>> triples_sum_to_zero([1, 3, 5, 0])\n// false\n// >>> triples_sum_to_zero([1, 3, -2, 1])\n// true\n// >>> triples_sum_to_zero([1, 2, 3, 7])\n// false\n// >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n// true\n// >>> triples_sum_to_zero([1])\n// false\nfunction triples_sum_to_zero(l){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = triples_sum_to_zero;\n assert.deepEqual(candidate([1, 3, 5, 0]),false);\n assert.deepEqual(candidate([1, 3, 5, -1]),false);\n assert.deepEqual(candidate([1, 3, -2, 1]),true);\n assert.deepEqual(candidate([1, 2, 3, 7]),false);\n assert.deepEqual(candidate([1, 2, 5, 7]),false);\n assert.deepEqual(candidate([2, 4, -5, 3, 9, 7]),true);\n assert.deepEqual(candidate([1]),false);\n assert.deepEqual(candidate([1, 3, 5, -100]),false);\n assert.deepEqual(candidate([100, 3, 5, -100]),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "js", - "prompt": "//brackets is a string of \"<\" and \">\".\n// return true if every opening bracket has a corresponding closing bracket.\n// >>> correct_bracketing(\"<\")\n// false\n// >>> correct_bracketing(\"<>\")\n// true\n// >>> correct_bracketing(\"<<><>>\")\n// true\n// >>> correct_bracketing(\"><<>\")\n// false\nfunction correct_bracketing(brackets){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = correct_bracketing;\n assert.deepEqual(candidate(\"<>\"),true);\n assert.deepEqual(candidate(\"<<><>>\"),true);\n assert.deepEqual(candidate(\"<><><<><>><>\"),true);\n assert.deepEqual(candidate(\"<><><<<><><>><>><<><><<>>>\"),true);\n assert.deepEqual(candidate(\"<<<><>>>>\"),false);\n assert.deepEqual(candidate(\"><<>\"),false);\n assert.deepEqual(candidate(\"<\"),false);\n assert.deepEqual(candidate(\"<<<<\"),false);\n assert.deepEqual(candidate(\">\"),false);\n assert.deepEqual(candidate(\"<<>\"),false);\n assert.deepEqual(candidate(\"<><><<><>><>><<>\"),false);\n assert.deepEqual(candidate(\"<><><<><>><>>><>\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "js", - "prompt": "//Write a function that takes an array of numbers as input and returns \n// the number of elements in the array that are greater than 10 and both \n// first and last digits of a number are odd (1, 3, 5, 7, 9).\n// For example:\n// >>> specialFilter([15, -73, 14, -15])\n// 1\n// >>> specialFilter([33, -2, -3, 45, 21, 109])\n// 2\nfunction specialFilter(nums){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = specialFilter;\n assert.deepEqual(candidate([5, -2, 1, -5]),0);\n assert.deepEqual(candidate([15, -73, 14, -15]),1);\n assert.deepEqual(candidate([33, -2, -3, 45, 21, 109]),2);\n assert.deepEqual(candidate([43, -12, 93, 125, 121, 109]),4);\n assert.deepEqual(candidate([71, -2, -33, 75, 21, 19]),3);\n assert.deepEqual(candidate([1]),0);\n assert.deepEqual(candidate([]),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "js", - "prompt": "//Given an object, return true if all keys are strings in lower \n// case or all keys are strings in upper case, else return false.\n// The function should return false is the given object is empty.\n// Examples:\n// >>> check_dict_case({\"a\": \"apple\", \"b\": \"banana\"})\n// true\n// >>> check_dict_case({\"a\": \"apple\", \"A\": \"banana\", \"B\": \"banana\"})\n// false\n// >>> check_dict_case({\"a\": \"apple\", 8: \"banana\", \"a\": \"apple\"})\n// false\n// >>> check_dict_case({\"Name\": \"John\", \"Age\": \"36\", \"City\": \"Houston\"})\n// false\n// >>> check_dict_case({\"STATE\": \"NC\", \"ZIP\": \"12345\"})\n// true\nfunction check_dict_case(dict){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = check_dict_case;\n assert.deepEqual(candidate({\"p\": \"pineapple\", \"b\": \"banana\"}),true);\n assert.deepEqual(candidate({\"p\": \"pineapple\", \"A\": \"banana\", \"B\": \"banana\"}),false);\n assert.deepEqual(candidate({\"p\": \"pineapple\", \"5\": \"banana\", \"a\": \"apple\"}),false);\n assert.deepEqual(candidate({\"Name\": \"John\", \"Age\": \"36\", \"City\": \"Houston\"}),false);\n assert.deepEqual(candidate({\"STATE\": \"NC\", \"ZIP\": \"12345\"}),true);\n assert.deepEqual(candidate({\"fruit\": \"Orange\", \"taste\": \"Sweet\"}),true);\n assert.deepEqual(candidate({}),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "js", - "prompt": "//Given a string of words, return an array of words split on whitespace, if no whitespaces exists in the text you\n// should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n// alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n// Examples\n// >>> split_words(\"Hello world!\")\n// [\"Hello\", \"world!\"]\n// >>> split_words(\"Hello,world!\")\n// [\"Hello\", \"world!\"]\n// >>> split_words(\"abcdef\")\n// 3\nfunction split_words(txt){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = split_words;\n assert.deepEqual(candidate(\"Hello world!\"),[\"Hello\", \"world!\"]);\n assert.deepEqual(candidate(\"Hello,world!\"),[\"Hello\", \"world!\"]);\n assert.deepEqual(candidate(\"Hello world,!\"),[\"Hello\", \"world,!\"]);\n assert.deepEqual(candidate(\"Hello,Hello,world !\"),[\"Hello,Hello,world\", \"!\"]);\n assert.deepEqual(candidate(\"abcdef\"),3);\n assert.deepEqual(candidate(\"aaabb\"),2);\n assert.deepEqual(candidate(\"aaaBb\"),1);\n assert.deepEqual(candidate(\"\"),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "js", - "prompt": "//The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fibfib(0) == 0\n// fibfib(1) == 0\n// fibfib(2) == 1\n// fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n// Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n// >>> fibfib(1)\n// 0\n// >>> fibfib(5)\n// 4\n// >>> fibfib(8)\n// 24\nfunction fibfib(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fibfib;\n assert.deepEqual(candidate(2),1);\n assert.deepEqual(candidate(1),0);\n assert.deepEqual(candidate(5),4);\n assert.deepEqual(candidate(8),24);\n assert.deepEqual(candidate(10),81);\n assert.deepEqual(candidate(12),274);\n assert.deepEqual(candidate(14),927);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "js", - "prompt": "//You are given an array of numbers.\n// You need to return the sum of squared numbers in the given array,\n// round each element in the array to the upper int(Ceiling) first.\n// Examples:\n// >>> lst([1.0, 2.0, 3.0])\n// 14\n// >>> lst([1.0, 4.0, 9.0])\n// 98\n// >>> lst([1.0, 3.0, 5.0, 7.0])\n// 84\n// >>> lst([1.4, 4.2, 0.0])\n// 29\n// >>> lst([-2.4, 1.0, 1.0])\n// 6\nfunction sum_squares(lst){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_squares;\n assert.deepEqual(candidate([1.0, 2.0, 3.0]),14);\n assert.deepEqual(candidate([1.0, 2.0, 3.0]),14);\n assert.deepEqual(candidate([1.0, 3.0, 5.0, 7.0]),84);\n assert.deepEqual(candidate([1.4, 4.2, 0.0]),29);\n assert.deepEqual(candidate([-2.4, 1.0, 1.0]),6);\n assert.deepEqual(candidate([100.0, 1.0, 15.0, 2.0]),10230);\n assert.deepEqual(candidate([10000.0, 10000.0]),200000000);\n assert.deepEqual(candidate([-1.4, 4.6, 6.3]),75);\n assert.deepEqual(candidate([-1.4, 17.9, 18.9, 19.9]),1086);\n assert.deepEqual(candidate([0.0]),0);\n assert.deepEqual(candidate([-1.0]),1);\n assert.deepEqual(candidate([-1.0, 1.0, 0.0]),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_85_add", - "language": "js", - "prompt": "//Given a non-empty array of integers lst. add the even elements that are at odd indices..\n// Examples:\n// >>> add([4, 2, 6, 7])\n// 2\nfunction add(lst){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = add;\n assert.deepEqual(candidate([4, 88]),88);\n assert.deepEqual(candidate([4, 5, 6, 7, 2, 122]),122);\n assert.deepEqual(candidate([4, 0, 6, 7]),0);\n assert.deepEqual(candidate([4, 4, 6, 8]),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "js", - "prompt": "//Return sorted unique elements in an array\n// >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123])\n// [0, 2, 3, 5, 9, 123]\nfunction unique(l){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = unique;\n assert.deepEqual(candidate([5, 3, 5, 2, 3, 3, 9, 0, 123]),[0, 2, 3, 5, 9, 123]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "js", - "prompt": "//Given a string text, replace all spaces in it with underscores, \n// and if a string has more than 2 consecutive spaces, \n// then replace all consecutive spaces with - \n// >>> fix_spaces(\" Example\")\n// \"Example\"\n// >>> fix_spaces(\" Example 1\")\n// \"Example_1\"\n// >>> fix_spaces(\" Example 2\")\n// \"_Example_2\"\n// >>> fix_spaces(\" Example 3\")\n// \"_Example-3\"\nfunction fix_spaces(text){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fix_spaces;\n assert.deepEqual(candidate(\"Example\"),\"Example\");\n assert.deepEqual(candidate(\"Mudasir Hanif \"),\"Mudasir_Hanif_\");\n assert.deepEqual(candidate(\"Yellow Yellow Dirty Fellow\"),\"Yellow_Yellow__Dirty__Fellow\");\n assert.deepEqual(candidate(\"Exa mple\"),\"Exa-mple\");\n assert.deepEqual(candidate(\" Exa 1 2 2 mple\"),\"-Exa_1_2_2_mple\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "js", - "prompt": "//Return 2^n modulo p (be aware of numerics).\n// >>> modp(3, 5)\n// 3\n// >>> modp(1101, 101)\n// 2\n// >>> modp(0, 101)\n// 1\n// >>> modp(3, 11)\n// 8\n// >>> modp(100, 101)\n// 1\nfunction modp(n, p){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = modp;\n assert.deepEqual(candidate(3, 5),3);\n assert.deepEqual(candidate(1101, 101),2);\n assert.deepEqual(candidate(0, 101),1);\n assert.deepEqual(candidate(3, 11),8);\n assert.deepEqual(candidate(100, 101),1);\n assert.deepEqual(candidate(30, 5),4);\n assert.deepEqual(candidate(31, 5),3);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "js", - "prompt": "//You have to write a function which validates a given date string and\n// returns true if the date is valid otherwise false.\n// The date is valid if all of the following rules are satisfied:\n// 1. The date string is not empty.\n// 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n// 3. The months should not be less than 1 or higher than 12.\n// 4. The date should be in the format: mm-dd-yyyy\n// >>> valid_date(\"03-11-2000\")\n// true\n// >>> valid_date(\"15-01-2012\")\n// false\n// >>> valid_date(\"04-0-2040\")\n// false\n// >>> valid_date(\"06-04-2020\")\n// true\n// >>> valid_date(\"06/04/2020\")\n// false\nfunction valid_date(date){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = valid_date;\n assert.deepEqual(candidate(\"03-11-2000\"),true);\n assert.deepEqual(candidate(\"15-01-2012\"),false);\n assert.deepEqual(candidate(\"04-0-2040\"),false);\n assert.deepEqual(candidate(\"06-04-2020\"),true);\n assert.deepEqual(candidate(\"01-01-2007\"),true);\n assert.deepEqual(candidate(\"03-32-2011\"),false);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"04-31-3000\"),false);\n assert.deepEqual(candidate(\"06-06-2005\"),true);\n assert.deepEqual(candidate(\"21-31-2000\"),false);\n assert.deepEqual(candidate(\"04-12-2003\"),true);\n assert.deepEqual(candidate(\"04122003\"),false);\n assert.deepEqual(candidate(\"20030412\"),false);\n assert.deepEqual(candidate(\"2003-04\"),false);\n assert.deepEqual(candidate(\"2003-04-12\"),false);\n assert.deepEqual(candidate(\"04-2003\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "js", - "prompt": "//Write a function that takes a string and returns an ordered version of it.\n// Ordered version of string, is a string where all words (separated by space)\n// are replaced by a new word where all the characters arranged in\n// ascending order based on ascii value.\n// Note: You should keep the order of words and blank spaces in the sentence.\n// For example:\n// >>> anti_shuffle(\"Hi\")\n// \"Hi\"\n// >>> anti_shuffle(\"hello\")\n// \"ehllo\"\n// >>> anti_shuffle(\"Hello World!!!\")\n// \"Hello !!!Wdlor\"\nfunction anti_shuffle(s){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = anti_shuffle;\n assert.deepEqual(candidate(\"Hi\"),\"Hi\");\n assert.deepEqual(candidate(\"hello\"),\"ehllo\");\n assert.deepEqual(candidate(\"number\"),\"bemnru\");\n assert.deepEqual(candidate(\"abcd\"),\"abcd\");\n assert.deepEqual(candidate(\"Hello World!!!\"),\"Hello !!!Wdlor\");\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"Hi. My name is Mister Robot. How are you?\"),\".Hi My aemn is Meirst .Rboot How aer ?ouy\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "js", - "prompt": "//Given an array of numbers, return whether or not they are sorted\n// in ascending order. If array has more than 1 duplicate of the same\n// number, return false. Assume no negative numbers and only integers.\n// Examples\n// >>> is_sorted([5])\n// true\n// >>> is_sorted([1, 2, 3, 4, 5])\n// true\n// >>> is_sorted([1, 3, 2, 4, 5])\n// false\n// >>> is_sorted([1, 2, 3, 4, 5, 6])\n// true\n// >>> is_sorted([1, 2, 3, 4, 5, 6, 7])\n// true\n// >>> is_sorted([1, 3, 2, 4, 5, 6, 7])\n// false\n// >>> is_sorted([1, 2, 2, 3, 3, 4])\n// true\n// >>> is_sorted([1, 2, 2, 2, 3, 4])\n// false\nfunction is_sorted(lst){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_sorted;\n assert.deepEqual(candidate([5]),true);\n assert.deepEqual(candidate([1, 2, 3, 4, 5]),true);\n assert.deepEqual(candidate([1, 3, 2, 4, 5]),false);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6]),true);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6, 7]),true);\n assert.deepEqual(candidate([1, 3, 2, 4, 5, 6, 7]),false);\n assert.deepEqual(candidate([]),true);\n assert.deepEqual(candidate([1]),true);\n assert.deepEqual(candidate([3, 2, 1]),false);\n assert.deepEqual(candidate([1, 2, 2, 2, 3, 4]),false);\n assert.deepEqual(candidate([1, 2, 3, 3, 3, 4]),false);\n assert.deepEqual(candidate([1, 2, 2, 3, 3, 4]),true);\n assert.deepEqual(candidate([1, 2, 3, 4]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "js", - "prompt": "//You are given a string s.\n// Your task is to check if the string is hapjs or not.\n// A string is hapjs if its length is at least 3 and every 3 consecutive letters are distinct\n// For example:\n// >>> is_happy(\"a\")\n// false\n// >>> is_happy(\"aa\")\n// false\n// >>> is_happy(\"abcd\")\n// true\n// >>> is_happy(\"aabb\")\n// false\n// >>> is_happy(\"adb\")\n// true\n// >>> is_happy(\"xyy\")\n// false\nfunction is_happy(s){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_happy;\n assert.deepEqual(candidate(\"a\"),false);\n assert.deepEqual(candidate(\"aa\"),false);\n assert.deepEqual(candidate(\"abcd\"),true);\n assert.deepEqual(candidate(\"aabb\"),false);\n assert.deepEqual(candidate(\"adb\"),true);\n assert.deepEqual(candidate(\"xyy\"),false);\n assert.deepEqual(candidate(\"iopaxpoi\"),true);\n assert.deepEqual(candidate(\"iopaxioi\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "js", - "prompt": "//Write a function that returns true if the object q will fly, and false otherwise.\n// The object q will fly if it's balanced (it is a palindromic array) and the sum of its elements is less than or equal the maximum possible weight w.\n// Example:\n// >>> will_it_fly([1, 2], 5)\n// false\n// # 1+2 is less than the maximum possible weight, but it's unbalanced.\n// >>> will_it_fly([3, 2, 3], 1)\n// false\n// # it's balanced, but 3+2+3 is more than the maximum possible weight.\n// >>> will_it_fly([3, 2, 3], 9)\n// true\n// # 3+2+3 is less than the maximum possible weight, and it's balanced.\n// >>> will_it_fly([3], 5)\n// true\n// # 3 is less than the maximum possible weight, and it's balanced.\nfunction will_it_fly(q, w){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = will_it_fly;\n assert.deepEqual(candidate([3, 2, 3], 9),true);\n assert.deepEqual(candidate([1, 2], 5),false);\n assert.deepEqual(candidate([3], 5),true);\n assert.deepEqual(candidate([3, 2, 3], 1),false);\n assert.deepEqual(candidate([1, 2, 3], 6),false);\n assert.deepEqual(candidate([5], 5),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "js", - "prompt": "//Given an array of non-negative integers, return a cojs of the given array after sorting,\n// you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n// or sort it in descending order if the sum( first index value, last index value) is even.\n// Note:\n// * don't change the given array.\n// Examples:\n// >>> sort_array([])\n// []\n// >>> sort_array([5])\n// [5]\n// >>> sort_array([2, 4, 3, 0, 1, 5])\n// [0, 1, 2, 3, 4, 5]\n// >>> sort_array([2, 4, 3, 0, 1, 5, 6])\n// [6, 5, 4, 3, 2, 1, 0]\nfunction sort_array(array){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_array;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([5]),[5]);\n assert.deepEqual(candidate([2, 4, 3, 0, 1, 5]),[0, 1, 2, 3, 4, 5]);\n assert.deepEqual(candidate([2, 4, 3, 0, 1, 5, 6]),[6, 5, 4, 3, 2, 1, 0]);\n assert.deepEqual(candidate([2, 1]),[1, 2]);\n assert.deepEqual(candidate([15, 42, 87, 32, 11, 0]),[0, 11, 15, 32, 42, 87]);\n assert.deepEqual(candidate([21, 14, 23, 11]),[23, 21, 14, 11]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "js", - "prompt": "//Implement a function that takes an non-negative integer and returns an array of the first n\n// integers that are prime numbers and less than n.\n// for example:\n// >>> count_up_to(5)\n// [2, 3]\n// >>> count_up_to(11)\n// [2, 3, 5, 7]\n// >>> count_up_to(0)\n// []\n// >>> count_up_to(20)\n// [2, 3, 5, 7, 11, 13, 17, 19]\n// >>> count_up_to(1)\n// []\n// >>> count_up_to(18)\n// [2, 3, 5, 7, 11, 13, 17]\nfunction count_up_to(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_up_to;\n assert.deepEqual(candidate(5),[2, 3]);\n assert.deepEqual(candidate(6),[2, 3, 5]);\n assert.deepEqual(candidate(7),[2, 3, 5]);\n assert.deepEqual(candidate(10),[2, 3, 5, 7]);\n assert.deepEqual(candidate(0),[]);\n assert.deepEqual(candidate(22),[2, 3, 5, 7, 11, 13, 17, 19]);\n assert.deepEqual(candidate(1),[]);\n assert.deepEqual(candidate(18),[2, 3, 5, 7, 11, 13, 17]);\n assert.deepEqual(candidate(47),[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43]);\n assert.deepEqual(candidate(101),[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "js", - "prompt": "//Out of array of strings, return the longest one. Return the first one in case of multiple\n// strings of the same length. Return undefined in case the input array is empty.\n// >>> longest([])\n// undefined\n// >>> longest([\"a\", \"b\", \"c\"])\n// \"a\"\n// >>> longest([\"a\", \"bb\", \"ccc\"])\n// \"ccc\"\nfunction longest(strings){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = longest;\n assert.deepEqual(candidate([]),undefined);\n assert.deepEqual(candidate([\"x\", \"y\", \"z\"]),\"x\");\n assert.deepEqual(candidate([\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"]),\"zzzz\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "js", - "prompt": "//Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n// reverse the resulting array, and then replace each digit by its corresponding name from\n// \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n// For example:\n// >>> by_length([2, 1, 1, 4, 5, 8, 2, 3])\n// [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n// If the array is empty, return an empty array:\n// >>> by_length([])\n// []\n// If the array has any strange number ignore it:\n// >>> by_length([1, -1, 55])\n// [\"One\"]\nfunction by_length(arr){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = by_length;\n assert.deepEqual(candidate([2, 1, 1, 4, 5, 8, 2, 3]),[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, -1, 55]),[\"One\"]);\n assert.deepEqual(candidate([1, -1, 3, 2]),[\"Three\", \"Two\", \"One\"]);\n assert.deepEqual(candidate([9, 4, 8]),[\"Nine\", \"Eight\", \"Four\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_106_f", - "language": "js", - "prompt": "//Implement the function f that takes n as a parameter,\n// and returns an array of size n, such that the value of the element at index i is the factorial of i if i is even\n// or the sum of numbers from 1 to i otherwise.\n// i starts from 1.\n// the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n// Example:\n// >>> f(5)\n// [1, 2, 6, 24, 15]\nfunction f(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = f;\n assert.deepEqual(candidate(5),[1, 2, 6, 24, 15]);\n assert.deepEqual(candidate(7),[1, 2, 6, 24, 15, 720, 28]);\n assert.deepEqual(candidate(1),[1]);\n assert.deepEqual(candidate(3),[1, 2, 6]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "js", - "prompt": "//Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n// >>> fizz_buzz(50)\n// 0\n// >>> fizz_buzz(78)\n// 2\n// >>> fizz_buzz(79)\n// 3\nfunction fizz_buzz(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fizz_buzz;\n assert.deepEqual(candidate(50),0);\n assert.deepEqual(candidate(78),2);\n assert.deepEqual(candidate(79),3);\n assert.deepEqual(candidate(100),3);\n assert.deepEqual(candidate(200),6);\n assert.deepEqual(candidate(4000),192);\n assert.deepEqual(candidate(10000),639);\n assert.deepEqual(candidate(100000),8026);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "js", - "prompt": "//Given a positive floating point number, it can be decomposed into\n// and integer part (largest integer smaller than given number) and decimals\n// (leftover part always smaller than 1).\n// Return the decimal part of the number.\n// >>> truncate_number(3.5)\n// 0.5\nfunction truncate_number(number){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = truncate_number;\n assert.deepEqual(candidate(3.5),0.5);\n assert.deepEqual(candidate(1.25),0.25);\n assert.deepEqual(candidate(123.0),0.0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "js", - "prompt": "//For a given array of integers, return an array consisting of a sum and a product of all the integers in an array.\n// Empty sum should be equal to 0 and empty product should be equal to 1.\n// >>> sum_product([])\n// [0, 1]\n// >>> sum_product([1, 2, 3, 4])\n// [10, 24]\nfunction sum_product(numbers){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_product;\n assert.deepEqual(candidate([]),[0, 1]);\n assert.deepEqual(candidate([1, 1, 1]),[3, 1]);\n assert.deepEqual(candidate([100, 0]),[100, 0]);\n assert.deepEqual(candidate([3, 5, 7]),[15, 105]);\n assert.deepEqual(candidate([10]),[10, 10]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "js", - "prompt": "//You are given a 2 dimensional data, as a nested arrays,\n// which is similar to matrix, however, unlike matrices,\n// each row may contain a different number of columns.\n// Given lst, and integer x, find integers x in the array,\n// and return array of arrays, [(x1, y1), (x2, y2) ...] such that\n// each array is a coordinate - (row, columns), starting with 0.\n// Sort coordinates initially by rows in ascending order.\n// Also, sort coordinates of the row by columns in descending order.\n// Examples:\n// >>> get_row([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1)\n// [[0, 0], [1, 4], [1, 0], [2, 5], [2, 0]]\n// >>> get_row([], 1)\n// []\n// >>> get_row([[], [1], [1, 2, 3]], 3)\n// [[2, 2]]\nfunction get_row(lst, x){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_row;\n assert.deepEqual(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1),[[0, 0], [1, 4], [1, 0], [2, 5], [2, 0]]);\n assert.deepEqual(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6]], 2),[[0, 1], [1, 1], [2, 1], [3, 1], [4, 1], [5, 1]]);\n assert.deepEqual(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 1, 3, 4, 5, 6], [1, 2, 1, 4, 5, 6], [1, 2, 3, 1, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1),[[0, 0], [1, 0], [2, 1], [2, 0], [3, 2], [3, 0], [4, 3], [4, 0], [5, 4], [5, 0], [6, 5], [6, 0]]);\n assert.deepEqual(candidate([], 1),[]);\n assert.deepEqual(candidate([[1]], 2),[]);\n assert.deepEqual(candidate([[], [1], [1, 2, 3]], 3),[[2, 2]]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "js", - "prompt": "//You're a hungry rabbit, and you already have eaten a certain number of carrots,\n// but now you need to eat more carrots to complete the day's meals.\n// you should return an array of [ total number of eaten carrots after your meals,\n// the number of carrots left after your meals ]\n// if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n// Example:\n// >>> eat(5, 6, 10)\n// [11, 4]\n// >>> eat(4, 8, 9)\n// [12, 1]\n// >>> eat(1, 10, 10)\n// [11, 0]\n// >>> eat(2, 11, 5)\n// [7, 0]\n// Variables:\n// @number : integer\n// the number of carrots that you have eaten.\n// @need : integer\n// the number of carrots that you need to eat.\n// @remaining : integer\n// the number of remaining carrots thet exist in stock\n// Constrain:\n// * 0 <= number <= 1000\n// * 0 <= need <= 1000\n// * 0 <= remaining <= 1000\n// Have fun :)\nfunction eat(number, need, remaining){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = eat;\n assert.deepEqual(candidate(5, 6, 10),[11, 4]);\n assert.deepEqual(candidate(4, 8, 9),[12, 1]);\n assert.deepEqual(candidate(1, 10, 10),[11, 0]);\n assert.deepEqual(candidate(2, 11, 5),[7, 0]);\n assert.deepEqual(candidate(4, 5, 7),[9, 2]);\n assert.deepEqual(candidate(4, 5, 1),[5, 0]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "js", - "prompt": "//Given a positive integer N, return the total sum of its digits in binary.\n// Example\n// >>> solve(1000)\n// \"1\"\n// >>> solve(150)\n// \"110\"\n// >>> solve(147)\n// \"1100\"\n// Variables:\n// @N integer\n// Constraints: 0 \u2264 N \u2264 10000.\n// Output:\n// a string of binary number\nfunction solve(N){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = solve;\n assert.deepEqual(candidate(1000),\"1\");\n assert.deepEqual(candidate(150),\"110\");\n assert.deepEqual(candidate(147),\"1100\");\n assert.deepEqual(candidate(333),\"1001\");\n assert.deepEqual(candidate(963),\"10010\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "js", - "prompt": "//You are given an array of integers.\n// You need to find the largest prime value and return the sum of its digits.\n// Examples:\n// >>> skjkasdkd([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3])\n// 10\n// >>> skjkasdkd([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1])\n// 25\n// >>> skjkasdkd([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3])\n// 13\n// >>> skjkasdkd([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6])\n// 11\n// >>> skjkasdkd([0, 81, 12, 3, 1, 21])\n// 3\n// >>> skjkasdkd([0, 8, 1, 2, 1, 7])\n// 7\nfunction skjkasdkd(lst){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = skjkasdkd;\n assert.deepEqual(candidate([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]),10);\n assert.deepEqual(candidate([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]),25);\n assert.deepEqual(candidate([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]),13);\n assert.deepEqual(candidate([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]),11);\n assert.deepEqual(candidate([0, 81, 12, 3, 1, 21]),3);\n assert.deepEqual(candidate([0, 8, 1, 2, 1, 7]),7);\n assert.deepEqual(candidate([8191]),19);\n assert.deepEqual(candidate([8191, 123456, 127, 7]),19);\n assert.deepEqual(candidate([127, 97, 8192]),10);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "js", - "prompt": "//Given an array arr of integers, find the minimum number of elements that\n// need to be changed to make the array palindromic. A palindromic array is an array that\n// is read the same backwards and forwards. In one change, you can change one element to any other element.\n// For example:\n// >>> smallest_change([1, 2, 3, 5, 4, 7, 9, 6])\n// 4\n// >>> smallest_change([1, 2, 3, 4, 3, 2, 2])\n// 1\n// >>> smallest_change([1, 2, 3, 2, 1])\n// 0\nfunction smallest_change(arr){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = smallest_change;\n assert.deepEqual(candidate([1, 2, 3, 5, 4, 7, 9, 6]),4);\n assert.deepEqual(candidate([1, 2, 3, 4, 3, 2, 2]),1);\n assert.deepEqual(candidate([1, 4, 2]),1);\n assert.deepEqual(candidate([1, 4, 4, 2]),1);\n assert.deepEqual(candidate([1, 2, 3, 2, 1]),0);\n assert.deepEqual(candidate([3, 1, 1, 3]),0);\n assert.deepEqual(candidate([1]),0);\n assert.deepEqual(candidate([0, 1]),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "js", - "prompt": "//It is the last week of the semester and the teacher has to give the grades\n// to students. The teacher has been making her own algorithm for grading.\n// The only problem is, she has lost the code she used for grading.\n// She has given you an array of GPAs for some students and you have to write \n// a function that can output an array of letter grades using the following table:\n// GPA | Letter grade\n// 4.0 A+\n// > 3.7 A \n// > 3.3 A- \n// > 3.0 B+\n// > 2.7 B \n// > 2.3 B-\n// > 2.0 C+\n// > 1.7 C\n// > 1.3 C-\n// > 1.0 D+ \n// > 0.7 D \n// > 0.0 D-\n// 0.0 E\n// Example:\n// >>> grade_equation([4.0, 3, 1.7, 2, 3.5])\n// [\"A+\", \"B\", \"C-\", \"C\", \"A-\"]\nfunction numerical_letter_grade(grades){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = numerical_letter_grade;\n assert.deepEqual(candidate([4.0, 3, 1.7, 2, 3.5]),[\"A+\", \"B\", \"C-\", \"C\", \"A-\"]);\n assert.deepEqual(candidate([1.2]),[\"D+\"]);\n assert.deepEqual(candidate([0.5]),[\"D-\"]);\n assert.deepEqual(candidate([0.0]),[\"E\"]);\n assert.deepEqual(candidate([1.0, 0.3, 1.5, 2.8, 3.3]),[\"D\", \"D-\", \"C-\", \"B\", \"B+\"]);\n assert.deepEqual(candidate([0.0, 0.7]),[\"E\", \"D-\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "js", - "prompt": "//Given the lengths of the three sides of a triangle. Return the area of\n// the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n// Otherwise return -1\n// Three sides make a valid triangle when the sum of any two sides is greater \n// than the third side.\n// Example:\n// >>> triangle_area(3, 4, 5)\n// 6.0\n// >>> triangle_area(1, 2, 10)\n// -1\nfunction triangle_area(a, b, c){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = triangle_area;\n assert.deepEqual(candidate(3, 4, 5),6.0);\n assert.deepEqual(candidate(1, 2, 10),-1);\n assert.deepEqual(candidate(4, 8, 5),8.18);\n assert.deepEqual(candidate(2, 2, 2),1.73);\n assert.deepEqual(candidate(1, 2, 3),-1);\n assert.deepEqual(candidate(10, 5, 7),16.25);\n assert.deepEqual(candidate(2, 6, 3),-1);\n assert.deepEqual(candidate(1, 1, 1),0.43);\n assert.deepEqual(candidate(2, 2, 10),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "js", - "prompt": "//Check if two words have the same characters.\n// >>> same_chars(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\")\n// true\n// >>> same_chars(\"abcd\", \"dddddddabc\")\n// true\n// >>> same_chars(\"dddddddabc\", \"abcd\")\n// true\n// >>> same_chars(\"eabcd\", \"dddddddabc\")\n// false\n// >>> same_chars(\"abcd\", \"dddddddabce\")\n// false\n// >>> same_chars(\"eabcdzzzz\", \"dddzzzzzzzddddabc\")\n// false\nfunction same_chars(s0, s1){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = same_chars;\n assert.deepEqual(candidate(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\"),true);\n assert.deepEqual(candidate(\"abcd\", \"dddddddabc\"),true);\n assert.deepEqual(candidate(\"dddddddabc\", \"abcd\"),true);\n assert.deepEqual(candidate(\"eabcd\", \"dddddddabc\"),false);\n assert.deepEqual(candidate(\"abcd\", \"dddddddabcf\"),false);\n assert.deepEqual(candidate(\"eabcdzzzz\", \"dddzzzzzzzddddabc\"),false);\n assert.deepEqual(candidate(\"aabb\", \"aaccc\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "js", - "prompt": "//Given an array of integers nums, find the minimum sum of any non-empty sub-array\n// of nums.\n// Example\n// >>> minSubArraySum([2, 3, 4, 1, 2, 4])\n// 1\n// >>> minSubArraySum([-1, -2, -3])\n// -6\nfunction minSubArraySum(nums){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = minSubArraySum;\n assert.deepEqual(candidate([2, 3, 4, 1, 2, 4]),1);\n assert.deepEqual(candidate([-1, -2, -3]),-6);\n assert.deepEqual(candidate([-1, -2, -3, 2, -10]),-14);\n assert.deepEqual(candidate([-9999999999999999]),-9999999999999999);\n assert.deepEqual(candidate([0, 10, 20, 1000000]),0);\n assert.deepEqual(candidate([-1, -2, -3, 10, -5]),-6);\n assert.deepEqual(candidate([100, -1, -2, -3, 10, -5]),-6);\n assert.deepEqual(candidate([10, 11, 13, 8, 3, 4]),3);\n assert.deepEqual(candidate([100, -33, 32, -1, 0, -2]),-33);\n assert.deepEqual(candidate([-10]),-10);\n assert.deepEqual(candidate([7]),7);\n assert.deepEqual(candidate([1, -1]),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "js", - "prompt": "//Given a string s and a natural number n, you have been tasked to implement \n// a function that returns an array of all words from string s that contain exactly \n// n consonants, in order these words appear in the string s.\n// If the string s is empty then the function should return an empty array.\n// Note: you may assume the input string contains only letters and spaces.\n// Examples:\n// >>> select_words(\"Mary had a little lamb\", 4)\n// [\"little\"]\n// >>> select_words(\"Mary had a little lamb\", 3)\n// [\"Mary\", \"lamb\"]\n// >>> select_words(\"simple white space\", 2)\n// []\n// >>> select_words(\"Hello world\", 4)\n// [\"world\"]\n// >>> select_words(\"Uncle sam\", 3)\n// [\"Uncle\"]\nfunction select_words(s, n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = select_words;\n assert.deepEqual(candidate(\"Mary had a little lamb\", 4),[\"little\"]);\n assert.deepEqual(candidate(\"Mary had a little lamb\", 3),[\"Mary\", \"lamb\"]);\n assert.deepEqual(candidate(\"simple white space\", 2),[]);\n assert.deepEqual(candidate(\"Hello world\", 4),[\"world\"]);\n assert.deepEqual(candidate(\"Uncle sam\", 3),[\"Uncle\"]);\n assert.deepEqual(candidate(\"\", 4),[]);\n assert.deepEqual(candidate(\"a b c d e f\", 1),[\"b\", \"c\", \"d\", \"f\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "js", - "prompt": "//Return array of all prefixes from shortest to longest of the input string\n// >>> all_prefixes(\"abc\")\n// [\"a\", \"ab\", \"abc\"]\nfunction all_prefixes(string){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = all_prefixes;\n assert.deepEqual(candidate(\"\"),[]);\n assert.deepEqual(candidate(\"asdfgh\"),[\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"]);\n assert.deepEqual(candidate(\"WWW\"),[\"W\", \"WW\", \"WWW\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "js", - "prompt": "//Create a function that takes a value (string) representing a number\n// and returns the closest integer to it. If the number is equidistant\n// from two integers, round it away from zero.\n// Examples\n// >>> closest_integer(\"10\")\n// 10\n// >>> closest_integer(\"15.3\")\n// 15\n// Note:\n// Rounding away from zero means that if the given number is equidistant\n// from two integers, the one you should return is the one that is the\n// farthest from zero. For example closest_integer(\"14.5\") should\n// return 15 and closest_integer(\"-14.5\") should return -15.\nfunction closest_integer(value){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = closest_integer;\n assert.deepEqual(candidate(\"10\"),10);\n assert.deepEqual(candidate(\"14.5\"),15);\n assert.deepEqual(candidate(\"-15.5\"),-16);\n assert.deepEqual(candidate(\"15.3\"),15);\n assert.deepEqual(candidate(\"0\"),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "js", - "prompt": "//Create a function which takes a string representing a file's name, and returns\n// 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n// A file's name is considered to be valid if and only if all the following conditions \n// are met:\n// - There should not be more than three digits ('0'-'9') in the file's name.\n// - The file's name contains exactly one dot '.'\n// - The substring before the dot should not be empty, and it starts with a letter from \n// the latin alphapet ('a'-'z' and 'A'-'Z').\n// - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n// Examples:\n// >>> file_name_check(\"example.txt\")\n// \"Yes\"\n// >>> file_name_check(\"1example.dll\")\n// \"No\"\nfunction file_name_check(file_name){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = file_name_check;\n assert.deepEqual(candidate(\"example.txt\"),\"Yes\");\n assert.deepEqual(candidate(\"1example.dll\"),\"No\");\n assert.deepEqual(candidate(\"s1sdf3.asd\"),\"No\");\n assert.deepEqual(candidate(\"K.dll\"),\"Yes\");\n assert.deepEqual(candidate(\"MY16FILE3.exe\"),\"Yes\");\n assert.deepEqual(candidate(\"His12FILE94.exe\"),\"No\");\n assert.deepEqual(candidate(\"_Y.txt\"),\"No\");\n assert.deepEqual(candidate(\"?aREYA.exe\"),\"No\");\n assert.deepEqual(candidate(\"/this_is_valid.dll\"),\"No\");\n assert.deepEqual(candidate(\"this_is_valid.wow\"),\"No\");\n assert.deepEqual(candidate(\"this_is_valid.txt\"),\"Yes\");\n assert.deepEqual(candidate(\"this_is_valid.txtexe\"),\"No\");\n assert.deepEqual(candidate(\"#this2_i4s_5valid.ten\"),\"No\");\n assert.deepEqual(candidate(\"@this1_is6_valid.exe\"),\"No\");\n assert.deepEqual(candidate(\"this_is_12valid.6exe4.txt\"),\"No\");\n assert.deepEqual(candidate(\"all.exe.txt\"),\"No\");\n assert.deepEqual(candidate(\"I563_No.exe\"),\"Yes\");\n assert.deepEqual(candidate(\"Is3youfault.txt\"),\"Yes\");\n assert.deepEqual(candidate(\"no_one#knows.dll\"),\"Yes\");\n assert.deepEqual(candidate(\"1I563_Yes3.exe\"),\"No\");\n assert.deepEqual(candidate(\"I563_Yes3.txtt\"),\"No\");\n assert.deepEqual(candidate(\"final..txt\"),\"No\");\n assert.deepEqual(candidate(\"final132\"),\"No\");\n assert.deepEqual(candidate(\"_f4indsartal132.\"),\"No\");\n assert.deepEqual(candidate(\".txt\"),\"No\");\n assert.deepEqual(candidate(\"s.\"),\"No\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "js", - "prompt": "//You are given two intervals,\n// where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n// The given intervals are closed which means that the interval (start, end)\n// includes both start and end.\n// For each given interval, it is assumed that its start is less or equal its end.\n// Your task is to determine whether the length of intersection of these two \n// intervals is a prime number.\n// Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n// which its length is 1, which not a prime number.\n// If the length of the intersection is a prime number, return \"YES\",\n// otherwise, return \"NO\".\n// If the two intervals don't intersect, return \"NO\".\n// [input/output] samples:\n// >>> intersection([1, 2], [2, 3])\n// \"NO\"\n// >>> intersection([-1, 1], [0, 4])\n// \"NO\"\n// >>> intersection([-3, -1], [-5, 5])\n// \"YES\"\nfunction intersection(interval1, interval2){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = intersection;\n assert.deepEqual(candidate([1, 2], [2, 3]),\"NO\");\n assert.deepEqual(candidate([-1, 1], [0, 4]),\"NO\");\n assert.deepEqual(candidate([-3, -1], [-5, 5]),\"YES\");\n assert.deepEqual(candidate([-2, 2], [-4, 0]),\"YES\");\n assert.deepEqual(candidate([-11, 2], [-1, -1]),\"NO\");\n assert.deepEqual(candidate([1, 2], [3, 5]),\"NO\");\n assert.deepEqual(candidate([1, 2], [1, 2]),\"NO\");\n assert.deepEqual(candidate([-2, -2], [-3, -2]),\"NO\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "js", - "prompt": "//Return the largest prime factor of n. Assume n > 1 and is not a prime.\n// >>> largest_prime_factor(13195)\n// 29\n// >>> largest_prime_factor(2048)\n// 2\nfunction largest_prime_factor(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = largest_prime_factor;\n assert.deepEqual(candidate(15),5);\n assert.deepEqual(candidate(27),3);\n assert.deepEqual(candidate(63),7);\n assert.deepEqual(candidate(330),11);\n assert.deepEqual(candidate(13195),29);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "js", - "prompt": "//Given a string, find out how many distinct characters (regardless of case) does it consist of\n// >>> count_distinct_characters(\"xyzXYZ\")\n// 3\n// >>> count_distinct_characters(\"Jerry\")\n// 4\nfunction count_distinct_characters(string){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_distinct_characters;\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"abcde\"),5);\n assert.deepEqual(candidate(\"abcdecadeCADE\"),5);\n assert.deepEqual(candidate(\"aaaaAAAAaaaa\"),1);\n assert.deepEqual(candidate(\"Jerry jERRY JeRRRY\"),5);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "js", - "prompt": "//You're given an array of deposit and withdrawal operations on a bank account that starts with\n// zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n// at that point function should return true. Otherwise it should return false.\n// >>> below_zero([1, 2, 3])\n// false\n// >>> below_zero([1, 2, -4, 5])\n// true\nfunction below_zero(operations){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = below_zero;\n assert.deepEqual(candidate([]),false);\n assert.deepEqual(candidate([1, 2, -3, 1, 2, -3]),false);\n assert.deepEqual(candidate([1, 2, -4, 5, 6]),true);\n assert.deepEqual(candidate([1, -1, 2, -2, 5, -5, 4, -4]),false);\n assert.deepEqual(candidate([1, -1, 2, -2, 5, -5, 4, -5]),true);\n assert.deepEqual(candidate([1, -2, 2, -2, 5, -5, 4, -4]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "js", - "prompt": "//Find the shortest palindrome that begins with a supplied string.\n// Algorithm idea is simple:\n// - Find the longest postfix of supplied string that is a palindrome.\n// - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n// >>> make_palindrome(\"\")\n// \"\"\n// >>> make_palindrome(\"cat\")\n// \"catac\"\n// >>> make_palindrome(\"cata\")\n// \"catac\"\nfunction make_palindrome(string){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = make_palindrome;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"x\"),\"x\");\n assert.deepEqual(candidate(\"xyz\"),\"xyzyx\");\n assert.deepEqual(candidate(\"xyx\"),\"xyx\");\n assert.deepEqual(candidate(\"jerry\"),\"jerryrrej\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "js", - "prompt": "//Given a positive integer, obtain its roman numeral equivalent as a string,\n// and return it in lowercase.\n// Restrictions: 1 <= num <= 1000\n// Examples:\n// >>> int_to_mini_roman(19)\n// \"xix\"\n// >>> int_to_mini_roman(152)\n// \"clii\"\n// >>> int_to_mini_roman(426)\n// \"cdxxvi\"\nfunction int_to_mini_roman(number){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "reworded", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = int_to_mini_roman;\n assert.deepEqual(candidate(19),\"xix\");\n assert.deepEqual(candidate(152),\"clii\");\n assert.deepEqual(candidate(251),\"ccli\");\n assert.deepEqual(candidate(426),\"cdxxvi\");\n assert.deepEqual(candidate(500),\"d\");\n assert.deepEqual(candidate(1),\"i\");\n assert.deepEqual(candidate(4),\"iv\");\n assert.deepEqual(candidate(43),\"xliii\");\n assert.deepEqual(candidate(90),\"xc\");\n assert.deepEqual(candidate(94),\"xciv\");\n assert.deepEqual(candidate(532),\"dxxxii\");\n assert.deepEqual(candidate(900),\"cm\");\n assert.deepEqual(candidate(994),\"cmxciv\");\n assert.deepEqual(candidate(1000),\"m\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - } -] \ No newline at end of file diff --git a/data/js-transform.json b/data/js-transform.json deleted file mode 100644 index 948745bea82d9d11f252e27f73ccbf6d4f4f18d5..0000000000000000000000000000000000000000 --- a/data/js-transform.json +++ /dev/null @@ -1,2417 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "js", - "prompt": "//For a given number n, find the largest number that divides n evenly, smaller than n\n// >>> largest_divisor(15)\n// 5\nfunction largest_divisor(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = largest_divisor;\n assert.deepEqual(candidate(3),1);\n assert.deepEqual(candidate(7),1);\n assert.deepEqual(candidate(10),5);\n assert.deepEqual(candidate(100),50);\n assert.deepEqual(candidate(49),7);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_47_median", - "language": "js", - "prompt": "//Return median of elements in the list l.\n// >>> median([3, 1, 2, 4, 5])\n// 3\n// >>> median([-10, 4, 6, 1000, 10, 20])\n// 15.0\nfunction median(l){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = median;\n assert.deepEqual(candidate([3, 1, 2, 4, 5]),3);\n assert.deepEqual(candidate([-10, 4, 6, 1000, 10, 20]),8.0);\n assert.deepEqual(candidate([5]),5);\n assert.deepEqual(candidate([6, 5]),5.5);\n assert.deepEqual(candidate([8, 1, 3, 9, 9, 2, 7]),7);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "js", - "prompt": "//Given two lists operator, and operand. The first list has basic algebra operations, and \n// the second list is a list of integers. Use the two given lists to build the algebric \n// expression and return the evaluation of this expression.\n// The basic algebra operations:\n// Addition ( + ) \n// Subtraction ( - ) \n// Multiplication ( * ) \n// Floor division ( // ) \n// Exponentiation ( ** ) \n// Example:\n// operator['+', '*', '-']\n// array = [2, 3, 4, 5]\n// result = 2 + 3 * 4 - 5\n// => result = 9\n// Note:\n// The length of operator list is equal to the length of operand list minus one.\n// Operand is a list of of non-negative integers.\n// Operator list has at least one operator, and operand list has at least two operands.\nfunction do_algebra(operator, operand){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = do_algebra;\n assert.deepEqual(candidate([\"**\", \"*\", \"+\"], [2, 3, 4, 5]),37);\n assert.deepEqual(candidate([\"+\", \"*\", \"-\"], [2, 3, 4, 5]),9);\n assert.deepEqual(candidate([\"//\", \"*\"], [7, 3, 4]),8);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "js", - "prompt": "//Return maximum element in the list.\n// >>> max_element([1, 2, 3])\n// 3\n// >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n// 123\nfunction max_element(l){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = max_element;\n assert.deepEqual(candidate([1, 2, 3]),3);\n assert.deepEqual(candidate([5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]),124);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "js", - "prompt": "//Create a function which returns the largest index of an element which\n// is not greater than or equal to the element immediately preceding it. If\n// no such element exists then return -1. The given array will not contain\n// duplicate values.\n// Examples:\n// >>> can_arrange([1, 2, 4, 3, 5])\n// 3\n// >>> can_arrange([1, 2, 3])\n// -1\nfunction can_arrange(arr){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = can_arrange;\n assert.deepEqual(candidate([1, 2, 4, 3, 5]),3);\n assert.deepEqual(candidate([1, 2, 4, 5]),-1);\n assert.deepEqual(candidate([1, 4, 2, 5, 6, 7, 8, 9, 10]),2);\n assert.deepEqual(candidate([4, 8, 5, 7, 3]),4);\n assert.deepEqual(candidate([]),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "js", - "prompt": "//Imagine a road that's a perfectly straight infinitely long line.\n// n cars are driving left to right; simultaneously, a different set of n cars\n// are driving right to left. The two sets of cars start out being very far from\n// each other. All cars move in the same speed. Two cars are said to collide\n// when a car that's moving left to right hits a car that's moving right to left.\n// However, the cars are infinitely sturdy and strong; as a result, they continue moving\n// in their trajectory as if they did not collide.\n// This function outputs the number of such collisions.\nfunction car_race_collision(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = car_race_collision;\n assert.deepEqual(candidate(2),4);\n assert.deepEqual(candidate(3),9);\n assert.deepEqual(candidate(4),16);\n assert.deepEqual(candidate(8),64);\n assert.deepEqual(candidate(10),100);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "js", - "prompt": "//Create a function that returns True if the last character\n// of a given string is an alphabetical character and is not\n// a part of a word, and False otherwise.\n// Note: \"word\" is a group of characters separated by space.\n// Examples:\n// >>> check_if_last_char_is_a_letter(\"apple pie\")\n// false\n// >>> check_if_last_char_is_a_letter(\"apple pi e\")\n// true\n// >>> check_if_last_char_is_a_letter(\"apple pi e \")\n// false\n// >>> check_if_last_char_is_a_letter(\"\")\n// false\nfunction check_if_last_char_is_a_letter(txt){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = check_if_last_char_is_a_letter;\n assert.deepEqual(candidate(\"apple\"),false);\n assert.deepEqual(candidate(\"apple pi e\"),true);\n assert.deepEqual(candidate(\"eeeee\"),false);\n assert.deepEqual(candidate(\"A\"),true);\n assert.deepEqual(candidate(\"Pumpkin pie \"),false);\n assert.deepEqual(candidate(\"Pumpkin pie 1\"),false);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"eeeee e \"),false);\n assert.deepEqual(candidate(\"apple pie\"),false);\n assert.deepEqual(candidate(\"apple pi e \"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "js", - "prompt": "//Return true if a given number is prime, and false otherwise.\n// >>> is_prime(6)\n// false\n// >>> is_prime(101)\n// true\n// >>> is_prime(11)\n// true\n// >>> is_prime(13441)\n// true\n// >>> is_prime(61)\n// true\n// >>> is_prime(4)\n// false\n// >>> is_prime(1)\n// false\nfunction is_prime(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_prime;\n assert.deepEqual(candidate(6),false);\n assert.deepEqual(candidate(101),true);\n assert.deepEqual(candidate(11),true);\n assert.deepEqual(candidate(13441),true);\n assert.deepEqual(candidate(61),true);\n assert.deepEqual(candidate(4),false);\n assert.deepEqual(candidate(1),false);\n assert.deepEqual(candidate(5),true);\n assert.deepEqual(candidate(11),true);\n assert.deepEqual(candidate(17),true);\n assert.deepEqual(candidate(85),false);\n assert.deepEqual(candidate(77),false);\n assert.deepEqual(candidate(255379),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "js", - "prompt": "//Given a list of positive integers x. return a sorted list of all \n// elements that hasn't any even digit.\n// Note: Returned list should be sorted in increasing order.\n// For example:\n// >>> unique_digits([15, 33, 1422, 1])\n// [1, 15, 33]\n// >>> unique_digits([152, 323, 1422, 10])\n// []\nfunction unique_digits(x){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = unique_digits;\n assert.deepEqual(candidate([15, 33, 1422, 1]),[1, 15, 33]);\n assert.deepEqual(candidate([152, 323, 1422, 10]),[]);\n assert.deepEqual(candidate([12345, 2033, 111, 151]),[111, 151]);\n assert.deepEqual(candidate([135, 103, 31]),[31, 135]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "js", - "prompt": "//Input are two strings a and b consisting only of 1s and 0s.\n// Perform binary XOR on these inputs and return result also as a string.\n// >>> string_xor(\"010\", \"110\")\n// \"100\"\nfunction string_xor(a, b){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = string_xor;\n assert.deepEqual(candidate(\"111000\", \"101010\"),\"010010\");\n assert.deepEqual(candidate(\"1\", \"1\"),\"0\");\n assert.deepEqual(candidate(\"0101\", \"0000\"),\"0101\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "js", - "prompt": "//sum_to_n is a function that sums numbers from 1 to n.\n// >>> sum_to_n(30)\n// 465\n// >>> sum_to_n(100)\n// 5050\n// >>> sum_to_n(5)\n// 15\n// >>> sum_to_n(10)\n// 55\n// >>> sum_to_n(1)\n// 1\nfunction sum_to_n(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_to_n;\n assert.deepEqual(candidate(1),1);\n assert.deepEqual(candidate(6),21);\n assert.deepEqual(candidate(11),66);\n assert.deepEqual(candidate(30),465);\n assert.deepEqual(candidate(100),5050);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "js", - "prompt": "//Given a list of numbers, return the sum of squares of the numbers\n// in the list that are odd. Ignore numbers that are negative or not integers.\n// >>> double_the_difference([1, 3, 2, 0])\n// 10\n// >>> double_the_difference([-1, -2, 0])\n// 0\n// >>> double_the_difference([9, -2])\n// 81\n// >>> double_the_difference([0])\n// 0\n// If the input list is empty, return 0.\nfunction double_the_difference(lst){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = double_the_difference;\n assert.deepEqual(candidate([]),0);\n assert.deepEqual(candidate([5.0, 4.0]),25);\n assert.deepEqual(candidate([0.1, 0.2, 0.3]),0);\n assert.deepEqual(candidate([-10.0, -20.0, -30.0]),0);\n assert.deepEqual(candidate([-1.0, -2.0, 8.0]),0);\n assert.deepEqual(candidate([0.2, 3.0, 5.0]),34);\n assert.deepEqual(candidate([-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]),165);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "js", - "prompt": "//Return length of given string\n// >>> strlen(\"\")\n// 0\n// >>> strlen(\"abc\")\n// 3\nfunction strlen(string){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = strlen;\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"x\"),1);\n assert.deepEqual(candidate(\"asdasnakj\"),9);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "js", - "prompt": "//You'll be given a string of words, and your task is to count the number\n// of boredoms. A boredom is a sentence that starts with the word \"I\".\n// Sentences are delimited by '.', '?' or '!'.\n// For example:\n// >>> is_bored(\"Hello world\")\n// 0\n// >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n// 1\nfunction is_bored(S){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_bored;\n assert.deepEqual(candidate(\"Hello world\"),0);\n assert.deepEqual(candidate(\"Is the sky blue?\"),0);\n assert.deepEqual(candidate(\"I love It !\"),1);\n assert.deepEqual(candidate(\"bIt\"),0);\n assert.deepEqual(candidate(\"I feel good today. I will be productive. will kill It\"),2);\n assert.deepEqual(candidate(\"You and I are going for a walk\"),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "js", - "prompt": "//Write a function vowels_count which takes a string representing\n// a word as input and returns the number of vowels in the string.\n// Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n// vowel, but only when it is at the end of the given word.\n// Example:\n// >>> vowels_count(\"abcde\")\n// 2\n// >>> vowels_count(\"ACEDY\")\n// 3\nfunction vowels_count(s){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = vowels_count;\n assert.deepEqual(candidate(\"abcde\"),2);\n assert.deepEqual(candidate(\"Alone\"),3);\n assert.deepEqual(candidate(\"key\"),2);\n assert.deepEqual(candidate(\"bye\"),1);\n assert.deepEqual(candidate(\"keY\"),2);\n assert.deepEqual(candidate(\"bYe\"),1);\n assert.deepEqual(candidate(\"ACEDY\"),3);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "js", - "prompt": "//Return n-th Fibonacci number.\n// >>> fib(10)\n// 55\n// >>> fib(1)\n// 1\n// >>> fib(8)\n// 21\nfunction fib(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fib;\n assert.deepEqual(candidate(10),55);\n assert.deepEqual(candidate(1),1);\n assert.deepEqual(candidate(8),21);\n assert.deepEqual(candidate(11),89);\n assert.deepEqual(candidate(12),144);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "js", - "prompt": "//Your task is to implement a function that will simplify the expression\n// x * n. The function returns True if x * n evaluates to a whole number and False\n// otherwise. Both x and n, are string representation of a fraction, and have the following format,\n// / where both numerator and denominator are positive whole numbers.\n// You can assume that x, and n are valid fractions, and do not have zero as denominator.\n// >>> simplify(\"1/5\", \"5/1\")\n// true\n// >>> simplify(\"1/6\", \"2/1\")\n// false\n// >>> simplify(\"7/10\", \"10/2\")\n// false\nfunction simplify(x, n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = simplify;\n assert.deepEqual(candidate(\"1/5\", \"5/1\"),true);\n assert.deepEqual(candidate(\"1/6\", \"2/1\"),false);\n assert.deepEqual(candidate(\"5/1\", \"3/1\"),true);\n assert.deepEqual(candidate(\"7/10\", \"10/2\"),false);\n assert.deepEqual(candidate(\"2/10\", \"50/10\"),true);\n assert.deepEqual(candidate(\"7/2\", \"4/2\"),true);\n assert.deepEqual(candidate(\"11/6\", \"6/1\"),true);\n assert.deepEqual(candidate(\"2/3\", \"5/2\"),false);\n assert.deepEqual(candidate(\"5/2\", \"3/5\"),false);\n assert.deepEqual(candidate(\"2/4\", \"8/4\"),true);\n assert.deepEqual(candidate(\"2/4\", \"4/2\"),true);\n assert.deepEqual(candidate(\"1/5\", \"5/1\"),true);\n assert.deepEqual(candidate(\"1/5\", \"1/5\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "js", - "prompt": "//Given a string s, count the number of uppercase vowels in even indices.\n// For example:\n// >>> count_upper(\"aBCdEf\")\n// 1\n// >>> count_upper(\"abcdefg\")\n// 0\n// >>> count_upper(\"dBBE\")\n// 0\nfunction count_upper(s){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_upper;\n assert.deepEqual(candidate(\"aBCdEf\"),1);\n assert.deepEqual(candidate(\"abcdefg\"),0);\n assert.deepEqual(candidate(\"dBBE\"),0);\n assert.deepEqual(candidate(\"B\"),0);\n assert.deepEqual(candidate(\"U\"),1);\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"EEEE\"),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "js", - "prompt": "//You are given a rectangular grid of wells. Each row represents a single well,\n// and each 1 in a row represents a single unit of water.\n// Each well has a corresponding bucket that can be used to extract water from it, \n// and all buckets have the same capacity.\n// Your task is to use the buckets to empty the wells.\n// Output the number of times you need to lower the buckets.\n// Example 1:\n// >>> max_fill([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1)\n// 6\n// Example 2:\n// >>> max_fill([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2)\n// 5\n// Example 3:\n// >>> max_fill([[0, 0, 0], [0, 0, 0]], 5)\n// 0\n// Constraints:\n// * all wells have the same length\n// * 1 <= grid.length <= 10^2\n// * 1 <= grid[:,1].length <= 10^2\n// * grid[i][j] -> 0 | 1\n// * 1 <= capacity <= 10\nfunction max_fill(grid, capacity){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = max_fill;\n assert.deepEqual(candidate([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1),6);\n assert.deepEqual(candidate([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2),5);\n assert.deepEqual(candidate([[0, 0, 0], [0, 0, 0]], 5),0);\n assert.deepEqual(candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 2),4);\n assert.deepEqual(candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 9),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "js", - "prompt": "//Given an array arr of integers and a positive integer k, return a sorted list \n// of length k with the maximum k numbers in arr.\n// Example 1:\n// >>> maximum([-3, -4, 5], 3)\n// [-4, -3, 5]\n// Example 2:\n// >>> maximum([4, -4, 4], 2)\n// [4, 4]\n// Example 3:\n// >>> maximum([-3, 2, 1, 2, -1, -2, 1], 1)\n// [2]\n// Note:\n// 1. The length of the array will be in the range of [1, 1000].\n// 2. The elements in the array will be in the range of [-1000, 1000].\n// 3. 0 <= k <= len(arr)\nfunction maximum(arr, k){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = maximum;\n assert.deepEqual(candidate([-3, -4, 5], 3),[-4, -3, 5]);\n assert.deepEqual(candidate([4, -4, 4], 2),[4, 4]);\n assert.deepEqual(candidate([-3, 2, 1, 2, -1, -2, 1], 1),[2]);\n assert.deepEqual(candidate([123, -123, 20, 0, 1, 2, -3], 3),[2, 20, 123]);\n assert.deepEqual(candidate([-123, 20, 0, 1, 2, -3], 4),[0, 1, 2, 20]);\n assert.deepEqual(candidate([5, 15, 0, 3, -13, -8, 0], 7),[-13, -8, 0, 0, 3, 5, 15]);\n assert.deepEqual(candidate([-1, 0, 2, 5, 3, -10], 2),[3, 5]);\n assert.deepEqual(candidate([1, 0, 5, -7], 1),[5]);\n assert.deepEqual(candidate([4, -4], 2),[-4, 4]);\n assert.deepEqual(candidate([-10, 10], 2),[-10, 10]);\n assert.deepEqual(candidate([1, 2, 3, -23, 243, -400, 0], 0),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "js", - "prompt": "//Write a function that takes a message, and encodes in such a \n// way that it swaps case of all letters, replaces all vowels in \n// the message with the letter that appears 2 places ahead of that \n// vowel in the english alphabet. \n// Assume only letters. \n// Examples:\n// >>> encode(\"test\")\n// \"TGST\"\n// >>> encode(\"This is a message\")\n// \"tHKS KS C MGSSCGG\"\nfunction encode(message){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = encode;\n assert.deepEqual(candidate(\"TEST\"),\"tgst\");\n assert.deepEqual(candidate(\"Mudasir\"),\"mWDCSKR\");\n assert.deepEqual(candidate(\"YES\"),\"ygs\");\n assert.deepEqual(candidate(\"This is a message\"),\"tHKS KS C MGSSCGG\");\n assert.deepEqual(candidate(\"I DoNt KnOw WhAt tO WrItE\"),\"k dQnT kNqW wHcT Tq wRkTg\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "js", - "prompt": "//remove_vowels is a function that takes string and returns string without vowels.\n// >>> remove_vowels(\"\")\n// \"\"\n// >>> remove_vowels(\"abcdef\")\n// \"bcdf\"\n// >>> remove_vowels(\"aaaaa\")\n// \"\"\n// >>> remove_vowels(\"aaBAA\")\n// \"B\"\n// >>> remove_vowels(\"zbcd\")\n// \"zbcd\"\nfunction remove_vowels(text){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = remove_vowels;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"abcdef\nghijklm\"),\"bcdf\nghjklm\");\n assert.deepEqual(candidate(\"fedcba\"),\"fdcb\");\n assert.deepEqual(candidate(\"eeeee\"),\"\");\n assert.deepEqual(candidate(\"acBAA\"),\"cB\");\n assert.deepEqual(candidate(\"EcBOO\"),\"cB\");\n assert.deepEqual(candidate(\"ybcd\"),\"ybcd\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "js", - "prompt": "//Return only positive numbers in the list.\n// >>> get_positive([-1, 2, -4, 5, 6])\n// [2, 5, 6]\n// >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n// [5, 3, 2, 3, 9, 123, 1]\nfunction get_positive(l){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_positive;\n assert.deepEqual(candidate([-1, -2, 4, 5, 6]),[4, 5, 6]);\n assert.deepEqual(candidate([5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]),[5, 3, 2, 3, 3, 9, 123, 1]);\n assert.deepEqual(candidate([-1, -2]),[]);\n assert.deepEqual(candidate([]),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "js", - "prompt": "//Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n// >>> string_sequence(0)\n// \"0\"\n// >>> string_sequence(5)\n// \"0 1 2 3 4 5\"\nfunction string_sequence(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = string_sequence;\n assert.deepEqual(candidate(0),\"0\");\n assert.deepEqual(candidate(3),\"0 1 2 3\");\n assert.deepEqual(candidate(10),\"0 1 2 3 4 5 6 7 8 9 10\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "js", - "prompt": "//Given a positive integer n, you have to make a pile of n levels of stones.\n// The first level has n stones.\n// The number of stones in the next level is:\n// - the next odd number if n is odd.\n// - the next even number if n is even.\n// Return the number of stones in each level in a list, where element at index\n// i represents the number of stones in the level (i+1).\n// Examples:\n// >>> make_a_pile(3)\n// [3, 5, 7]\nfunction make_a_pile(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = make_a_pile;\n assert.deepEqual(candidate(3),[3, 5, 7]);\n assert.deepEqual(candidate(4),[4, 6, 8, 10]);\n assert.deepEqual(candidate(5),[5, 7, 9, 11, 13]);\n assert.deepEqual(candidate(6),[6, 8, 10, 12, 14, 16]);\n assert.deepEqual(candidate(8),[8, 10, 12, 14, 16, 18, 20, 22]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "js", - "prompt": "//Task\n// 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\n// then check if the result string is palindrome.\n// A string is called palindrome if it reads the same backward as forward.\n// You should return a tuple containing the result string and True/False for the check.\n// Example\n// >>> reverse_delete(\"abcde\", \"ae\")\n// [\"bcd\", false]\n// >>> reverse_delete(\"abcdef\", \"b\")\n// [\"acdef\", false]\n// >>> reverse_delete(\"abcdedcba\", \"ab\")\n// [\"cdedc\", true]\nfunction reverse_delete(s, c){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = reverse_delete;\n assert.deepEqual(candidate(\"abcde\", \"ae\"),[\"bcd\", false]);\n assert.deepEqual(candidate(\"abcdef\", \"b\"),[\"acdef\", false]);\n assert.deepEqual(candidate(\"abcdedcba\", \"ab\"),[\"cdedc\", true]);\n assert.deepEqual(candidate(\"dwik\", \"w\"),[\"dik\", false]);\n assert.deepEqual(candidate(\"a\", \"a\"),[\"\", true]);\n assert.deepEqual(candidate(\"abcdedcba\", \"\"),[\"abcdedcba\", true]);\n assert.deepEqual(candidate(\"abcdedcba\", \"v\"),[\"abcdedcba\", true]);\n assert.deepEqual(candidate(\"vabba\", \"v\"),[\"abba\", true]);\n assert.deepEqual(candidate(\"mamma\", \"mia\"),[\"\", true]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "js", - "prompt": "//For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n// >>> flip_case(\"Hello\")\n// \"hELLO\"\nfunction flip_case(string){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = flip_case;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"Hello!\"),\"hELLO!\");\n assert.deepEqual(candidate(\"These violent delights have violent ends\"),\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "js", - "prompt": "//You are given a string s.\n// if s[i] is a letter, reverse its case from lower to upper or vise versa, \n// otherwise keep it as it is.\n// If the string contains no letters, reverse the string.\n// The function should return the resulted string.\n// Examples\n// >>> solve(\"1234\")\n// \"4321\"\n// >>> solve(\"ab\")\n// \"AB\"\n// >>> solve(\"#a@C\")\n// \"#A@c\"\nfunction solve(s){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = solve;\n assert.deepEqual(candidate(\"AsDf\"),\"aSdF\");\n assert.deepEqual(candidate(\"1234\"),\"4321\");\n assert.deepEqual(candidate(\"ab\"),\"AB\");\n assert.deepEqual(candidate(\"#a@C\"),\"#A@c\");\n assert.deepEqual(candidate(\"#AsdfW^45\"),\"#aSDFw^45\");\n assert.deepEqual(candidate(\"#6@2\"),\"2@6#\");\n assert.deepEqual(candidate(\"#$a^D\"),\"#$A^d\");\n assert.deepEqual(candidate(\"#ccc\"),\"#CCC\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "js", - "prompt": "//Filter an input list of strings only for ones that start with a given prefix.\n// >>> filter_by_prefix([], \"a\")\n// []\n// >>> filter_by_prefix([\"abc\", \"bcd\", \"cde\", \"array\"], \"a\")\n// [\"abc\", \"array\"]\nfunction filter_by_prefix(strings, prefix){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = filter_by_prefix;\n assert.deepEqual(candidate([], \"john\"),[]);\n assert.deepEqual(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"),[\"xxx\", \"xxxAAA\", \"xxx\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "js", - "prompt": "//This function takes two positive numbers x and y and returns the\n// biggest even integer number that is in the range [x, y] inclusive. If \n// there's no such number, then the function should return -1.\n// For example:\n// >>> choose_num(12, 15)\n// 14\n// >>> choose_num(13, 12)\n// -1\nfunction choose_num(x, y){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = choose_num;\n assert.deepEqual(candidate(12, 15),14);\n assert.deepEqual(candidate(13, 12),-1);\n assert.deepEqual(candidate(33, 12354),12354);\n assert.deepEqual(candidate(5234, 5233),-1);\n assert.deepEqual(candidate(6, 29),28);\n assert.deepEqual(candidate(27, 10),-1);\n assert.deepEqual(candidate(7, 7),-1);\n assert.deepEqual(candidate(546, 546),546);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "js", - "prompt": "//You are given a string representing a sentence,\n// the sentence contains some words separated by a space,\n// and you have to return a string that contains the words from the original sentence,\n// whose lengths are prime numbers,\n// the order of the words in the new string should be the same as the original one.\n// Example 1:\n// >>> words_in_sentence(\"This is a test\")\n// \"is\"\n// Example 2:\n// >>> words_in_sentence(\"lets go for swimming\")\n// \"go for\"\n// Constraints:\n// * 1 <= len(sentence) <= 100\n// * sentence contains only letters\nfunction words_in_sentence(sentence){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = words_in_sentence;\n assert.deepEqual(candidate(\"This is a test\"),\"is\");\n assert.deepEqual(candidate(\"lets go for swimming\"),\"go for\");\n assert.deepEqual(candidate(\"there is no place available here\"),\"there is no place\");\n assert.deepEqual(candidate(\"Hi I am Hussein\"),\"Hi am Hussein\");\n assert.deepEqual(candidate(\"go for it\"),\"go for it\");\n assert.deepEqual(candidate(\"here\"),\"\");\n assert.deepEqual(candidate(\"here is\"),\"is\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "js", - "prompt": "//Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n// >>> intersperse([], 4)\n// []\n// >>> intersperse([1, 2, 3], 4)\n// [1, 4, 2, 4, 3]\nfunction intersperse(numbers, delimeter){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = intersperse;\n assert.deepEqual(candidate([], 7),[]);\n assert.deepEqual(candidate([5, 6, 3, 2], 8),[5, 8, 6, 8, 3, 8, 2]);\n assert.deepEqual(candidate([2, 2, 2], 2),[2, 2, 2, 2, 2]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "js", - "prompt": "//Your task is to write a function that returns true if a number x is a simple\n// power of n and false in other cases.\n// x is a simple power of n if n**int=x\n// For example:\n// >>> is_simple_power(1, 4)\n// true\n// >>> is_simple_power(2, 2)\n// true\n// >>> is_simple_power(8, 2)\n// true\n// >>> is_simple_power(3, 2)\n// false\n// >>> is_simple_power(3, 1)\n// false\n// >>> is_simple_power(5, 3)\n// false\nfunction is_simple_power(x, n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_simple_power;\n assert.deepEqual(candidate(16, 2),true);\n assert.deepEqual(candidate(143214, 16),false);\n assert.deepEqual(candidate(4, 2),true);\n assert.deepEqual(candidate(9, 3),true);\n assert.deepEqual(candidate(16, 4),true);\n assert.deepEqual(candidate(24, 2),false);\n assert.deepEqual(candidate(128, 4),false);\n assert.deepEqual(candidate(12, 6),false);\n assert.deepEqual(candidate(1, 1),true);\n assert.deepEqual(candidate(1, 12),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "js", - "prompt": "//Write a function that returns true if the given number is the multiplication of 3 prime numbers\n// and false otherwise.\n// Knowing that (a) is less then 100. \n// Example:\n// >>> is_multiply_prime(30)\n// true\n// 30 = 2 * 3 * 5\nfunction is_multiply_prime(a){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_multiply_prime;\n assert.deepEqual(candidate(5),false);\n assert.deepEqual(candidate(30),true);\n assert.deepEqual(candidate(8),true);\n assert.deepEqual(candidate(10),false);\n assert.deepEqual(candidate(125),true);\n assert.deepEqual(candidate(105),true);\n assert.deepEqual(candidate(126),false);\n assert.deepEqual(candidate(729),false);\n assert.deepEqual(candidate(891),false);\n assert.deepEqual(candidate(1001),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "js", - "prompt": "//Given the lengths of the three sides of a triangle. Return True if the three\n// sides form a right-angled triangle, False otherwise.\n// A right-angled triangle is a triangle in which one angle is right angle or \n// 90 degree.\n// Example:\n// >>> right_angle_triangle(3, 4, 5)\n// true\n// >>> right_angle_triangle(1, 2, 3)\n// false\nfunction right_angle_triangle(a, b, c){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = right_angle_triangle;\n assert.deepEqual(candidate(3, 4, 5),true);\n assert.deepEqual(candidate(1, 2, 3),false);\n assert.deepEqual(candidate(10, 6, 8),true);\n assert.deepEqual(candidate(2, 2, 2),false);\n assert.deepEqual(candidate(7, 24, 25),true);\n assert.deepEqual(candidate(10, 5, 7),false);\n assert.deepEqual(candidate(5, 12, 13),true);\n assert.deepEqual(candidate(15, 8, 17),true);\n assert.deepEqual(candidate(48, 55, 73),true);\n assert.deepEqual(candidate(1, 1, 1),false);\n assert.deepEqual(candidate(2, 2, 10),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "js", - "prompt": "//Create a function that takes 3 numbers.\n// Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n// Returns false in any other cases.\n// Examples\n// >>> any_int(5, 2, 7)\n// true\n// >>> any_int(3, 2, 2)\n// false\n// >>> any_int(3, -2, 1)\n// true\n// >>> any_int(3.6, -2.2, 2)\n// false\nfunction any_int(x, y, z){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = any_int;\n assert.deepEqual(candidate(2, 3, 1),true);\n assert.deepEqual(candidate(2.5, 2, 3),false);\n assert.deepEqual(candidate(1.5, 5, 3.5),false);\n assert.deepEqual(candidate(2, 6, 2),false);\n assert.deepEqual(candidate(4, 2, 2),true);\n assert.deepEqual(candidate(2.2, 2.2, 2.2),false);\n assert.deepEqual(candidate(-4, 6, 2),true);\n assert.deepEqual(candidate(2, 1, 1),true);\n assert.deepEqual(candidate(3, 4, 7),true);\n assert.deepEqual(candidate(3.0, 4, 7),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "js", - "prompt": "//This function takes a list l and returns a list l' such that\n// l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n// to the values of the corresponding indicies of l, but sorted.\n// >>> sort_third([1, 2, 3])\n// [1, 2, 3]\n// >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n// [2, 6, 3, 4, 8, 9, 5]\nfunction sort_third(l){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_third;\n assert.deepEqual(candidate([5, 6, 3, 4, 8, 9, 2]),[2, 6, 3, 4, 8, 9, 5]);\n assert.deepEqual(candidate([5, 8, 3, 4, 6, 9, 2]),[2, 8, 3, 4, 6, 9, 5]);\n assert.deepEqual(candidate([5, 6, 9, 4, 8, 3, 2]),[2, 6, 9, 4, 8, 3, 5]);\n assert.deepEqual(candidate([5, 6, 3, 4, 8, 9, 2, 1]),[2, 6, 3, 4, 8, 9, 5, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_53_add", - "language": "js", - "prompt": "//Add two numbers x and y\n// >>> add(2, 3)\n// 5\n// >>> add(5, 7)\n// 12\nfunction add(x, y){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = add;\n assert.deepEqual(candidate(0, 1),1);\n assert.deepEqual(candidate(1, 0),1);\n assert.deepEqual(candidate(2, 3),5);\n assert.deepEqual(candidate(5, 7),12);\n assert.deepEqual(candidate(7, 5),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_69_search", - "language": "js", - "prompt": "//You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n// zero, and has a frequency greater than or equal to the value of the integer itself. \n// The frequency of an integer is the number of times it appears in the list.\n// If no such a value exist, return -1.\n// Examples:\n// >>> search([4, 1, 2, 2, 3, 1])\n// 2\n// >>> search([1, 2, 2, 3, 3, 3, 4, 4, 4])\n// 3\n// >>> search([5, 5, 4, 4, 4])\n// -1\nfunction search(lst){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = search;\n assert.deepEqual(candidate([5, 5, 5, 5, 1]),1);\n assert.deepEqual(candidate([4, 1, 4, 1, 4, 4]),4);\n assert.deepEqual(candidate([3, 3]),-1);\n assert.deepEqual(candidate([8, 8, 8, 8, 8, 8, 8, 8]),8);\n assert.deepEqual(candidate([2, 3, 3, 2, 2]),2);\n assert.deepEqual(candidate([2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]),1);\n assert.deepEqual(candidate([3, 2, 8, 2]),2);\n assert.deepEqual(candidate([6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]),1);\n assert.deepEqual(candidate([8, 8, 3, 6, 5, 6, 4]),-1);\n assert.deepEqual(candidate([6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]),1);\n assert.deepEqual(candidate([1, 9, 10, 1, 3]),1);\n assert.deepEqual(candidate([6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]),5);\n assert.deepEqual(candidate([1]),1);\n assert.deepEqual(candidate([8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]),4);\n assert.deepEqual(candidate([2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]),2);\n assert.deepEqual(candidate([1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]),1);\n assert.deepEqual(candidate([9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]),4);\n assert.deepEqual(candidate([2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]),4);\n assert.deepEqual(candidate([9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]),2);\n assert.deepEqual(candidate([5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]),-1);\n assert.deepEqual(candidate([10]),-1);\n assert.deepEqual(candidate([9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]),2);\n assert.deepEqual(candidate([5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]),1);\n assert.deepEqual(candidate([7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]),1);\n assert.deepEqual(candidate([3, 10, 10, 9, 2]),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "js", - "prompt": "//Write a function that takes a string and returns True if the string\n// length is a prime number or False otherwise\n// Examples\n// >>> prime_length(\"Hello\")\n// true\n// >>> prime_length(\"abcdcba\")\n// true\n// >>> prime_length(\"kittens\")\n// true\n// >>> prime_length(\"orange\")\n// false\nfunction prime_length(string){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = prime_length;\n assert.deepEqual(candidate(\"Hello\"),true);\n assert.deepEqual(candidate(\"abcdcba\"),true);\n assert.deepEqual(candidate(\"kittens\"),true);\n assert.deepEqual(candidate(\"orange\"),false);\n assert.deepEqual(candidate(\"wow\"),true);\n assert.deepEqual(candidate(\"world\"),true);\n assert.deepEqual(candidate(\"MadaM\"),true);\n assert.deepEqual(candidate(\"Wow\"),true);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"HI\"),true);\n assert.deepEqual(candidate(\"go\"),true);\n assert.deepEqual(candidate(\"gogo\"),false);\n assert.deepEqual(candidate(\"aaaaaaaaaaaaaaa\"),false);\n assert.deepEqual(candidate(\"Madam\"),true);\n assert.deepEqual(candidate(\"M\"),false);\n assert.deepEqual(candidate(\"0\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_58_common", - "language": "js", - "prompt": "//Return sorted unique common elements for two lists.\n// >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n// [1, 5, 653]\n// >>> common([5, 3, 2, 8], [3, 2])\n// [2, 3]\nfunction common(l1, l2){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = common;\n assert.deepEqual(candidate([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]),[1, 5, 653]);\n assert.deepEqual(candidate([5, 3, 2, 8], [3, 2]),[2, 3]);\n assert.deepEqual(candidate([4, 3, 2, 8], [3, 2, 4]),[2, 3, 4]);\n assert.deepEqual(candidate([4, 3, 2, 8], []),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "js", - "prompt": "//The Brazilian factorial is defined as:\n// brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n// where n > 0\n// For example:\n// >>> special_factorial(4)\n// 288\n// The function will receive an integer as input and should return the special\n// factorial of this integer.\nfunction special_factorial(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = special_factorial;\n assert.deepEqual(candidate(4),288);\n assert.deepEqual(candidate(5),34560);\n assert.deepEqual(candidate(7),125411328000);\n assert.deepEqual(candidate(1),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "js", - "prompt": "//In this problem, you will implement a function that takes two lists of numbers,\n// and determines whether it is possible to perform an exchange of elements\n// between them to make lst1 a list of only even numbers.\n// There is no limit on the number of exchanged elements between lst1 and lst2.\n// If it is possible to exchange elements between the lst1 and lst2 to make\n// all the elements of lst1 to be even, return \"YES\".\n// Otherwise, return \"NO\".\n// For example:\n// >>> exchange([1, 2, 3, 4], [1, 2, 3, 4])\n// \"YES\"\n// >>> exchange([1, 2, 3, 4], [1, 5, 3, 4])\n// \"NO\"\n// It is assumed that the input lists will be non-empty.\nfunction exchange(lst1, lst2){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = exchange;\n assert.deepEqual(candidate([1, 2, 3, 4], [1, 2, 3, 4]),\"YES\");\n assert.deepEqual(candidate([1, 2, 3, 4], [1, 5, 3, 4]),\"NO\");\n assert.deepEqual(candidate([1, 2, 3, 4], [2, 1, 4, 3]),\"YES\");\n assert.deepEqual(candidate([5, 7, 3], [2, 6, 4]),\"YES\");\n assert.deepEqual(candidate([5, 7, 3], [2, 6, 3]),\"NO\");\n assert.deepEqual(candidate([3, 2, 6, 1, 8, 9], [3, 5, 5, 1, 1, 1]),\"NO\");\n assert.deepEqual(candidate([100, 200], [200, 200]),\"YES\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "js", - "prompt": "//Given a non-empty array of integers arr and an integer k, return\n// the sum of the elements with at most two digits from the first k elements of arr.\n// Example:\n// >>> add_elements([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4)\n// 24\n// Constraints:\n// 1. 1 <= len(arr) <= 100\n// 2. 1 <= k <= len(arr)\nfunction add_elements(arr, k){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = add_elements;\n assert.deepEqual(candidate([1, -2, -3, 41, 57, 76, 87, 88, 99], 3),-4);\n assert.deepEqual(candidate([111, 121, 3, 4000, 5, 6], 2),0);\n assert.deepEqual(candidate([11, 21, 3, 90, 5, 6, 7, 8, 9], 4),125);\n assert.deepEqual(candidate([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4),24);\n assert.deepEqual(candidate([1], 1),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "js", - "prompt": "//A simple program which should return the value of x if n is \n// a prime number and should return the value of y otherwise.\n// Examples:\n// >>> x_or_y(7, 34, 12)\n// 34\n// >>> x_or_y(15, 8, 5)\n// 5\nfunction x_or_y(n, x, y){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = x_or_y;\n assert.deepEqual(candidate(7, 34, 12),34);\n assert.deepEqual(candidate(15, 8, 5),5);\n assert.deepEqual(candidate(3, 33, 5212),33);\n assert.deepEqual(candidate(1259, 3, 52),3);\n assert.deepEqual(candidate(7919, -1, 12),-1);\n assert.deepEqual(candidate(3609, 1245, 583),583);\n assert.deepEqual(candidate(91, 56, 129),129);\n assert.deepEqual(candidate(6, 34, 1234),1234);\n assert.deepEqual(candidate(1, 2, 0),0);\n assert.deepEqual(candidate(2, 2, 0),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "js", - "prompt": "//Given length of a side and high return area for a triangle.\n// >>> triangle_area(5, 3)\n// 7.5\nfunction triangle_area(a, h){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = triangle_area;\n assert.deepEqual(candidate(5, 3),7.5);\n assert.deepEqual(candidate(2, 2),2.0);\n assert.deepEqual(candidate(10, 8),40.0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "js", - "prompt": "//Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n// the last couple centuries. However, what people don't know is Tribonacci sequence.\n// Tribonacci sequence is defined by the recurrence:\n// tri(1) = 3\n// tri(n) = 1 + n / 2, if n is even.\n// tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n// For example:\n// tri(2) = 1 + (2 / 2) = 2\n// tri(4) = 3\n// tri(3) = tri(2) + tri(1) + tri(4)\n// = 2 + 3 + 3 = 8 \n// You are given a non-negative integer number n, you have to a return a list of the \n// first n + 1 numbers of the Tribonacci sequence.\n// Examples:\n// >>> tri(3)\n// [1, 3, 2, 8]\nfunction tri(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = tri;\n assert.deepEqual(candidate(3),[1, 3, 2, 8]);\n assert.deepEqual(candidate(4),[1, 3, 2, 8, 3]);\n assert.deepEqual(candidate(5),[1, 3, 2, 8, 3, 15]);\n assert.deepEqual(candidate(6),[1, 3, 2, 8, 3, 15, 4]);\n assert.deepEqual(candidate(7),[1, 3, 2, 8, 3, 15, 4, 24]);\n assert.deepEqual(candidate(8),[1, 3, 2, 8, 3, 15, 4, 24, 5]);\n assert.deepEqual(candidate(9),[1, 3, 2, 8, 3, 15, 4, 24, 5, 35]);\n assert.deepEqual(candidate(20),[1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11]);\n assert.deepEqual(candidate(0),[1]);\n assert.deepEqual(candidate(1),[1, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "js", - "prompt": "//You are given a list of two strings, both strings consist of open\n// parentheses '(' or close parentheses ')' only.\n// Your job is to check if it is possible to concatenate the two strings in\n// some order, that the resulting string will be good.\n// A string S is considered to be good if and only if all parentheses in S\n// are balanced. For example: the string '(())()' is good, while the string\n// '())' is not.\n// Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n// Examples:\n// >>> match_parens([\"()(\", \")\"])\n// \"Yes\"\n// >>> match_parens([\")\", \")\"])\n// \"No\"\nfunction match_parens(lst){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = match_parens;\n assert.deepEqual(candidate([\"()(\", \")\"]),\"Yes\");\n assert.deepEqual(candidate([\")\", \")\"]),\"No\");\n assert.deepEqual(candidate([\"(()(())\", \"())())\"]),\"No\");\n assert.deepEqual(candidate([\")())\", \"(()()(\"]),\"Yes\");\n assert.deepEqual(candidate([\"(())))\", \"(()())((\"]),\"Yes\");\n assert.deepEqual(candidate([\"()\", \"())\"]),\"No\");\n assert.deepEqual(candidate([\"(()(\", \"()))()\"]),\"Yes\");\n assert.deepEqual(candidate([\"((((\", \"((())\"]),\"No\");\n assert.deepEqual(candidate([\")(()\", \"(()(\"]),\"No\");\n assert.deepEqual(candidate([\")(\", \")(\"]),\"No\");\n assert.deepEqual(candidate([\"(\", \")\"]),\"Yes\");\n assert.deepEqual(candidate([\")\", \"(\"]),\"Yes\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "js", - "prompt": "//From a list of integers, remove all elements that occur more than once.\n// Keep order of elements left the same as in the input.\n// >>> remove_duplicates([1, 2, 3, 2, 4])\n// [1, 3, 4]\nfunction remove_duplicates(numbers){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = remove_duplicates;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, 2, 3, 4]),[1, 2, 3, 4]);\n assert.deepEqual(candidate([1, 2, 3, 2, 4, 3, 5]),[1, 4, 5]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "js", - "prompt": "//Return a greatest common divisor of two integers a and b\n// >>> greatest_common_divisor(3, 5)\n// 1\n// >>> greatest_common_divisor(25, 15)\n// 5\nfunction greatest_common_divisor(a, b){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = greatest_common_divisor;\n assert.deepEqual(candidate(3, 7),1);\n assert.deepEqual(candidate(10, 15),5);\n assert.deepEqual(candidate(49, 14),7);\n assert.deepEqual(candidate(144, 60),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "js", - "prompt": "//Checks if given string is a palindrome\n// >>> is_palindrome(\"\")\n// true\n// >>> is_palindrome(\"aba\")\n// true\n// >>> is_palindrome(\"aaaaa\")\n// true\n// >>> is_palindrome(\"zbcd\")\n// false\nfunction is_palindrome(text){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_palindrome;\n assert.deepEqual(candidate(\"\"),true);\n assert.deepEqual(candidate(\"aba\"),true);\n assert.deepEqual(candidate(\"aaaaa\"),true);\n assert.deepEqual(candidate(\"zbcd\"),false);\n assert.deepEqual(candidate(\"xywyx\"),true);\n assert.deepEqual(candidate(\"xywyz\"),false);\n assert.deepEqual(candidate(\"xywzx\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "js", - "prompt": "//xs represent coefficients of a polynomial.\n// xs[0] + xs[1] * x + xs[2] * x^2 + ....\n// Return derivative of this polynomial in the same form.\n// >>> derivative([3, 1, 2, 4, 5])\n// [1, 4, 12, 20]\n// >>> derivative([1, 2, 3])\n// [2, 6]\nfunction derivative(xs){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = derivative;\n assert.deepEqual(candidate([3, 1, 2, 4, 5]),[1, 4, 12, 20]);\n assert.deepEqual(candidate([1, 2, 3]),[2, 6]);\n assert.deepEqual(candidate([3, 2, 1]),[2, 2]);\n assert.deepEqual(candidate([3, 2, 1, 0, 4]),[2, 2, 0, 16]);\n assert.deepEqual(candidate([1]),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "js", - "prompt": "//In this task, you will be given a string that represents a number of apples and oranges \n// that are distributed in a basket of fruit this basket contains \n// apples, oranges, and mango fruits. Given the string that represents the total number of \n// the oranges and apples and an integer that represent the total number of the fruits \n// in the basket return the number of the mango fruits in the basket.\n// for examble:\n// >>> fruit_distribution(\"5 apples and 6 oranges\", 19)\n// 8\n// >>> fruit_distribution(\"0 apples and 1 oranges\", 3)\n// 2\n// >>> fruit_distribution(\"2 apples and 3 oranges\", 100)\n// 95\n// >>> fruit_distribution(\"100 apples and 1 oranges\", 120)\n// 19\nfunction fruit_distribution(s, n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fruit_distribution;\n assert.deepEqual(candidate(\"5 apples and 6 oranges\", 19),8);\n assert.deepEqual(candidate(\"5 apples and 6 oranges\", 21),10);\n assert.deepEqual(candidate(\"0 apples and 1 oranges\", 3),2);\n assert.deepEqual(candidate(\"1 apples and 0 oranges\", 3),2);\n assert.deepEqual(candidate(\"2 apples and 3 oranges\", 100),95);\n assert.deepEqual(candidate(\"2 apples and 3 oranges\", 5),0);\n assert.deepEqual(candidate(\"1 apples and 100 oranges\", 120),19);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "js", - "prompt": "//Write a function that takes an integer a and returns True \n// if this ingeger is a cube of some integer number.\n// Note: you may assume the input is always valid.\n// Examples:\n// >>> iscube(1)\n// true\n// >>> iscube(2)\n// false\n// >>> iscube(-1)\n// true\n// >>> iscube(64)\n// true\n// >>> iscube(0)\n// true\n// >>> iscube(180)\n// false\nfunction iscube(a){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = iscube;\n assert.deepEqual(candidate(1),true);\n assert.deepEqual(candidate(2),false);\n assert.deepEqual(candidate(-1),true);\n assert.deepEqual(candidate(64),true);\n assert.deepEqual(candidate(180),false);\n assert.deepEqual(candidate(1000),true);\n assert.deepEqual(candidate(0),true);\n assert.deepEqual(candidate(1729),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "js", - "prompt": "//In this Kata, you have to sort an array of non-negative integers according to\n// number of ones in their binary representation in ascending order.\n// For similar number of ones, sort based on decimal value.\n// It must be implemented like this:\n// >>> sort_array([1, 5, 2, 3, 4])\n// [1, 2, 3, 4, 5]\n// >>> sort_array([-2, -3, -4, -5, -6])\n// [-6, -5, -4, -3, -2]\n// >>> sort_array([1, 0, 2, 3, 4])\n// [0, 1, 2, 3, 4]\nfunction sort_array(arr){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_array;\n assert.deepEqual(candidate([1, 5, 2, 3, 4]),[1, 2, 4, 3, 5]);\n assert.deepEqual(candidate([-2, -3, -4, -5, -6]),[-4, -2, -6, -5, -3]);\n assert.deepEqual(candidate([1, 0, 2, 3, 4]),[0, 1, 2, 4, 3]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]),[2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77]);\n assert.deepEqual(candidate([3, 6, 44, 12, 32, 5]),[32, 3, 5, 6, 12, 44]);\n assert.deepEqual(candidate([2, 4, 8, 16, 32]),[2, 4, 8, 16, 32]);\n assert.deepEqual(candidate([2, 4, 8, 16, 32]),[2, 4, 8, 16, 32]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "js", - "prompt": "//Given a list of strings, where each string consists of only digits, return a list.\n// Each element i of the output should be \"the number of odd elements in the\n// string i of the input.\" where all the i's should be replaced by the number\n// of odd digits in the i'th string of the input.\n// >>> odd_count([\"1234567\"])\n// [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n// >>> odd_count([\"3\", \"11111111\"])\n// [\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\nfunction odd_count(lst){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = odd_count;\n assert.deepEqual(candidate([\"1234567\"]),[\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]);\n assert.deepEqual(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.\"]);\n assert.deepEqual(candidate([\"271\", \"137\", \"314\"]),[\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "js", - "prompt": "//brackets is a string of \"(\" and \")\".\n// return True if every opening bracket has a corresponding closing bracket.\n// >>> correct_bracketing(\"(\")\n// false\n// >>> correct_bracketing(\"()\")\n// true\n// >>> correct_bracketing(\"(()())\")\n// true\n// >>> correct_bracketing(\")(()\")\n// false\nfunction correct_bracketing(brackets){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = correct_bracketing;\n assert.deepEqual(candidate(\"()\"),true);\n assert.deepEqual(candidate(\"(()())\"),true);\n assert.deepEqual(candidate(\"()()(()())()\"),true);\n assert.deepEqual(candidate(\"()()((()()())())(()()(()))\"),true);\n assert.deepEqual(candidate(\"((()())))\"),false);\n assert.deepEqual(candidate(\")(()\"),false);\n assert.deepEqual(candidate(\"(\"),false);\n assert.deepEqual(candidate(\"((((\"),false);\n assert.deepEqual(candidate(\")\"),false);\n assert.deepEqual(candidate(\"(()\"),false);\n assert.deepEqual(candidate(\"()()(()())())(()\"),false);\n assert.deepEqual(candidate(\"()()(()())()))()\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "js", - "prompt": "//Task\n// Write a function that takes a string as input and returns the sum of the upper characters only'\n// ASCII codes.\n// Examples:\n// >>> digitSum(\"\")\n// 0\n// >>> digitSum(\"abAB\")\n// 131\n// >>> digitSum(\"abcCd\")\n// 67\n// >>> digitSum(\"helloE\")\n// 69\n// >>> digitSum(\"woArBld\")\n// 131\n// >>> digitSum(\"aAaaaXa\")\n// 153\nfunction digitSum(s){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = digitSum;\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"abAB\"),131);\n assert.deepEqual(candidate(\"abcCd\"),67);\n assert.deepEqual(candidate(\"helloE\"),69);\n assert.deepEqual(candidate(\"woArBld\"),131);\n assert.deepEqual(candidate(\"aAaaaXa\"),153);\n assert.deepEqual(candidate(\" How are yOu?\"),151);\n assert.deepEqual(candidate(\"You arE Very Smart\"),327);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "js", - "prompt": "//Write a function that accepts a list of strings as a parameter,\n// deletes the strings that have odd lengths from it,\n// and returns the resulted list with a sorted order,\n// The list is always a list of strings and never an array of numbers,\n// and it may contain duplicates.\n// The order of the list should be ascending by length of each word, and you\n// should return the list sorted by that rule.\n// If two words have the same length, sort the list alphabetically.\n// The function should return a list of strings in sorted order.\n// You may assume that all words will have the same length.\n// For example:\n// >>> list_sort([\"aa\", \"a\", \"aaa\"])\n// [\"aa\"]\n// >>> list_sort([\"ab\", \"a\", \"aaa\", \"cd\"])\n// [\"ab\", \"cd\"]\nfunction sorted_list_sum(lst){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sorted_list_sum;\n assert.deepEqual(candidate([\"aa\", \"a\", \"aaa\"]),[\"aa\"]);\n assert.deepEqual(candidate([\"school\", \"AI\", \"asdf\", \"b\"]),[\"AI\", \"asdf\", \"school\"]);\n assert.deepEqual(candidate([\"d\", \"b\", \"c\", \"a\"]),[]);\n assert.deepEqual(candidate([\"d\", \"dcba\", \"abcd\", \"a\"]),[\"abcd\", \"dcba\"]);\n assert.deepEqual(candidate([\"AI\", \"ai\", \"au\"]),[\"AI\", \"ai\", \"au\"]);\n assert.deepEqual(candidate([\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"]),[]);\n assert.deepEqual(candidate([\"aaaa\", \"bbbb\", \"dd\", \"cc\"]),[\"cc\", \"dd\", \"aaaa\", \"bbbb\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "js", - "prompt": "//You are given an array arr of integers and you need to return\n// sum of magnitudes of integers multiplied by product of all signs\n// of each number in the array, represented by 1, -1 or 0.\n// Note: return None for empty arr.\n// Example:\n// >>> prod_signs([1, 2, 2, -4])\n// 9\n// >>> prod_signs([0, 1])\n// 0\n// >>> prod_signs([])\n// undefined\nfunction prod_signs(arr){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = prod_signs;\n assert.deepEqual(candidate([1, 2, 2, -4]),-9);\n assert.deepEqual(candidate([0, 1]),0);\n assert.deepEqual(candidate([1, 1, 1, 2, 3, -1, 1]),-10);\n assert.deepEqual(candidate([]),undefined);\n assert.deepEqual(candidate([2, 4, 1, 2, -1, -1, 9]),20);\n assert.deepEqual(candidate([-1, 1, -1, 1]),4);\n assert.deepEqual(candidate([-1, 1, 1, 1]),-4);\n assert.deepEqual(candidate([-1, 1, 1, 0]),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "js", - "prompt": "//Return list with elements incremented by 1.\n// >>> incr_list([1, 2, 3])\n// [2, 3, 4]\n// >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123])\n// [6, 4, 6, 3, 4, 4, 10, 1, 124]\nfunction incr_list(l){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = incr_list;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([3, 2, 1]),[4, 3, 2]);\n assert.deepEqual(candidate([5, 2, 5, 2, 3, 3, 9, 0, 123]),[6, 3, 6, 3, 4, 4, 10, 1, 124]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "js", - "prompt": "//From a given list of integers, generate a list of rolling maximum element found until given moment\n// in the sequence.\n// >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n// [1, 2, 3, 3, 3, 4, 4]\nfunction rolling_max(numbers){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = rolling_max;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, 2, 3, 4]),[1, 2, 3, 4]);\n assert.deepEqual(candidate([4, 3, 2, 1]),[4, 4, 4, 4]);\n assert.deepEqual(candidate([3, 2, 3, 100, 3]),[3, 3, 3, 100, 100]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "js", - "prompt": "//Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n// separate those group into separate strings and return the list of those.\n// Separate groups are balanced (each open brace is properly closed) and not nested within each other\n// Ignore any spaces in the input string.\n// >>> separate_paren_groups(\"( ) (( )) (( )( ))\")\n// [\"()\", \"(())\", \"(()())\"]\nfunction separate_paren_groups(paren_string){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = separate_paren_groups;\n assert.deepEqual(candidate(\"(()()) ((())) () ((())()())\"),[\"(()())\", \"((()))\", \"()\", \"((())()())\"]);\n assert.deepEqual(candidate(\"() (()) ((())) (((())))\"),[\"()\", \"(())\", \"((()))\", \"(((())))\"]);\n assert.deepEqual(candidate(\"(()(())((())))\"),[\"(()(())((())))\"]);\n assert.deepEqual(candidate(\"( ) (( )) (( )( ))\"),[\"()\", \"(())\", \"(()())\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "js", - "prompt": "//You will be given a string of words separated by commas or spaces. Your task is\n// to split the string into words and return an array of the words.\n// For example:\n// >>> words_string(\"Hi, my name is John\")\n// [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n// >>> words_string(\"One, two, three, four, five, six\")\n// [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\nfunction words_string(s){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = words_string;\n assert.deepEqual(candidate(\"Hi, my name is John\"),[\"Hi\", \"my\", \"name\", \"is\", \"John\"]);\n assert.deepEqual(candidate(\"One, two, three, four, five, six\"),[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]);\n assert.deepEqual(candidate(\"Hi, my name\"),[\"Hi\", \"my\", \"name\"]);\n assert.deepEqual(candidate(\"One,, two, three, four, five, six,\"),[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]);\n assert.deepEqual(candidate(\"\"),[]);\n assert.deepEqual(candidate(\"ahmed , gamal\"),[\"ahmed\", \"gamal\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "js", - "prompt": "//Create a function that takes integers, floats, or strings representing\n// real numbers, and returns the larger variable in its given variable type.\n// Return None if the values are equal.\n// Note: If a real number is represented as a string, the floating point might be . or ,\n// >>> compare_one(1, 2.5)\n// 2.5\n// >>> compare_one(1, \"2,3\")\n// \"2,3\"\n// >>> compare_one(\"5,1\", \"6\")\n// \"6\"\n// >>> compare_one(\"1\", 1)\n// undefined\nfunction compare_one(a, b){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = compare_one;\n assert.deepEqual(candidate(1, 2),2);\n assert.deepEqual(candidate(1, 2.5),2.5);\n assert.deepEqual(candidate(2, 3),3);\n assert.deepEqual(candidate(5, 6),6);\n assert.deepEqual(candidate(1, \"2,3\"),\"2,3\");\n assert.deepEqual(candidate(\"5,1\", \"6\"),\"6\");\n assert.deepEqual(candidate(\"1\", \"2\"),\"2\");\n assert.deepEqual(candidate(\"1\", 1),undefined);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "js", - "prompt": "//Filter given list of any python values only for integers\n// >>> filter_integers([\"a\", 3.14, 5])\n// [5]\n// >>> filter_integers([1, 2, 3, \"abc\", {}, []])\n// [1, 2, 3]\nfunction filter_integers(values){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = filter_integers;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([4, {}, [], 23.2, 9, \"adasd\"]),[4, 9]);\n assert.deepEqual(candidate([3, \"c\", 3, 3, \"a\", \"b\"]),[3, 3, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "js", - "prompt": "//This function takes a list l and returns a list l' such that\n// l' is identical to l in the odd indicies, while its values at the even indicies are equal\n// to the values of the even indicies of l, but sorted.\n// >>> sort_even([1, 2, 3])\n// [1, 2, 3]\n// >>> sort_even([5, 6, 3, 4])\n// [3, 6, 5, 4]\nfunction sort_even(l){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_even;\n assert.deepEqual(candidate([1, 2, 3]),[1, 2, 3]);\n assert.deepEqual(candidate([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]),[-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123]);\n assert.deepEqual(candidate([5, 8, -12, 4, 23, 2, 3, 11, 12, -10]),[-12, 8, 3, 4, 5, 2, 12, 11, 23, -10]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "js", - "prompt": "//I think we all remember that feeling when the result of some long-awaited\n// event is finally known. The feelings and thoughts you have at that moment are\n// definitely worth noting down and comparing.\n// Your task is to determine if a person correctly guessed the results of a number of matches.\n// You are given two arrays of scores and guesses of equal length, where each index shows a match. \n// Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n// the value is 0, and if not, the value is the absolute difference between the guess and the score.\n// example:\n// >>> compare([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2])\n// [0, 0, 0, 0, 3, 3]\n// >>> compare([0, 5, 0, 0, 0, 4], [4, 1, 1, 0, 0, -2])\n// [4, 4, 1, 0, 0, 6]\nfunction compare(game, guess){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = compare;\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2]),[0, 0, 0, 0, 3, 3]);\n assert.deepEqual(candidate([0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]),[0, 0, 0, 0, 0, 0]);\n assert.deepEqual(candidate([1, 2, 3], [-1, -2, -3]),[2, 4, 6]);\n assert.deepEqual(candidate([1, 2, 3, 5], [-1, 2, 3, 4]),[2, 0, 0, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "js", - "prompt": "//Given a positive integer n, return a tuple that has the number of even and odd\n// integer palindromes that fall within the range(1, n), inclusive.\n// Example 1:\n// >>> even_odd_palindrome(3)\n// [1, 2]\n// Explanation:\n// Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n// Example 2:\n// >>> even_odd_palindrome(12)\n// [4, 6]\n// Explanation:\n// Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n// Note:\n// 1. 1 <= n <= 10^3\n// 2. returned tuple has the number of even and odd integer palindromes respectively.\nfunction even_odd_palindrome(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = even_odd_palindrome;\n assert.deepEqual(candidate(123),[8, 13]);\n assert.deepEqual(candidate(12),[4, 6]);\n assert.deepEqual(candidate(3),[1, 2]);\n assert.deepEqual(candidate(63),[6, 8]);\n assert.deepEqual(candidate(25),[5, 6]);\n assert.deepEqual(candidate(19),[4, 6]);\n assert.deepEqual(candidate(9),[4, 5]);\n assert.deepEqual(candidate(1),[0, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "js", - "prompt": "//The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fib4(0) -> 0\n// fib4(1) -> 0\n// fib4(2) -> 2\n// fib4(3) -> 0\n// fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n// Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n// >>> fib4(5)\n// 4\n// >>> fib4(6)\n// 8\n// >>> fib4(7)\n// 14\nfunction fib4(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fib4;\n assert.deepEqual(candidate(5),4);\n assert.deepEqual(candidate(8),28);\n assert.deepEqual(candidate(10),104);\n assert.deepEqual(candidate(12),386);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "js", - "prompt": "//Given two positive integers a and b, return the even digits between a\n// and b, in ascending order.\n// For example:\n// >>> generate_integers(2, 8)\n// [2, 4, 6, 8]\n// >>> generate_integers(8, 2)\n// [2, 4, 6, 8]\n// >>> generate_integers(10, 14)\n// []\nfunction generate_integers(a, b){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = generate_integers;\n assert.deepEqual(candidate(2, 10),[2, 4, 6, 8]);\n assert.deepEqual(candidate(10, 2),[2, 4, 6, 8]);\n assert.deepEqual(candidate(132, 2),[2, 4, 6, 8]);\n assert.deepEqual(candidate(17, 89),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "js", - "prompt": "//For a given list of input numbers, calculate Mean Absolute Deviation\n// around the mean of this dataset.\n// Mean Absolute Deviation is the average absolute difference between each\n// element and a centerpoint (mean in this case):\n// MAD = average | x - x_mean |\n// >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n// 1.0\nfunction mean_absolute_deviation(numbers){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = mean_absolute_deviation;\n assert.deepEqual(candidate([1.0, 2.0]),0.5);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0]),1.0);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0]),1.2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "js", - "prompt": "//Create a function encrypt that takes a string as an argument and\n// returns a string encrypted with the alphabet being rotated. \n// The alphabet should be rotated in a manner such that the letters \n// shift down by two multiplied to two places.\n// For example:\n// >>> encrypt(\"hi\")\n// \"lm\"\n// >>> encrypt(\"asdfghjkl\")\n// \"ewhjklnop\"\n// >>> encrypt(\"gf\")\n// \"kj\"\n// >>> encrypt(\"et\")\n// \"ix\"\nfunction encrypt(s){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = encrypt;\n assert.deepEqual(candidate(\"hi\"),\"lm\");\n assert.deepEqual(candidate(\"asdfghjkl\"),\"ewhjklnop\");\n assert.deepEqual(candidate(\"gf\"),\"kj\");\n assert.deepEqual(candidate(\"et\"),\"ix\");\n assert.deepEqual(candidate(\"faewfawefaewg\"),\"jeiajeaijeiak\");\n assert.deepEqual(candidate(\"hellomyfriend\"),\"lippsqcjvmirh\");\n assert.deepEqual(candidate(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\"),\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\");\n assert.deepEqual(candidate(\"a\"),\"e\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "js", - "prompt": "//Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n// The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n// as follows: start with any positive integer n. Then each term is obtained from the \n// previous term as follows: if the previous term is even, the next term is one half of \n// the previous term. If the previous term is odd, the next term is 3 times the previous\n// term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n// Note: \n// 1. Collatz(1) is [1].\n// 2. returned list sorted in increasing order.\n// For example:\n// get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n// >>> get_odd_collatz(5)\n// [1, 5]\nfunction get_odd_collatz(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_odd_collatz;\n assert.deepEqual(candidate(14),[1, 5, 7, 11, 13, 17]);\n assert.deepEqual(candidate(5),[1, 5]);\n assert.deepEqual(candidate(12),[1, 3, 5]);\n assert.deepEqual(candidate(1),[1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "js", - "prompt": "//Find how many times a given substring can be found in the original string. Count overlaping cases.\n// >>> how_many_times(\"\", \"a\")\n// 0\n// >>> how_many_times(\"aaa\", \"a\")\n// 3\n// >>> how_many_times(\"aaaa\", \"aa\")\n// 3\nfunction how_many_times(string, substring){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = how_many_times;\n assert.deepEqual(candidate(\"\", \"x\"),0);\n assert.deepEqual(candidate(\"xyxyxyx\", \"x\"),4);\n assert.deepEqual(candidate(\"cacacacac\", \"cac\"),4);\n assert.deepEqual(candidate(\"john doe\", \"john\"),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "js", - "prompt": "//We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n// numbers in the array will be randomly ordered. Your task is to determine if\n// it is possible to get an array sorted in non-decreasing order by performing \n// the following operation on the given array:\n// You are allowed to perform right shift operation any number of times.\n// One right shift operation means shifting all elements of the array by one\n// position in the right direction. The last element of the array will be moved to\n// the starting position in the array i.e. 0th index. \n// If it is possible to obtain the sorted array by performing the above operation\n// then return True else return False.\n// If the given array is empty then return True.\n// Note: The given list is guaranteed to have unique elements.\n// For Example:\n// >>> move_one_ball([3, 4, 5, 1, 2])\n// true\n// Explanation: By performin 2 right shift operations, non-decreasing order can\n// be achieved for the given array.\n// >>> move_one_ball([3, 5, 4, 1, 2])\n// false\n// Explanation:It is not possible to get non-decreasing order for the given\n// array by performing any number of right shift operations.\nfunction move_one_ball(arr){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = move_one_ball;\n assert.deepEqual(candidate([3, 4, 5, 1, 2]),true);\n assert.deepEqual(candidate([3, 5, 10, 1, 2]),true);\n assert.deepEqual(candidate([4, 3, 1, 2]),false);\n assert.deepEqual(candidate([3, 5, 4, 1, 2]),false);\n assert.deepEqual(candidate([]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "js", - "prompt": "//Write a function which sorts the given list of integers\n// in ascending order according to the sum of their digits.\n// Note: if there are several items with similar sum of their digits,\n// order them based on their index in original list.\n// For example:\n// >>> order_by_points([1, 11, -1, -11, -12])\n// [-1, -11, 1, -12, 11]\n// >>> order_by_points([])\n// []\nfunction order_by_points(nums){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = order_by_points;\n assert.deepEqual(candidate([1, 11, -1, -11, -12]),[-1, -11, 1, -12, 11]);\n assert.deepEqual(candidate([1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]),[0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, -11, -32, 43, 54, -98, 2, -3]),[-3, -32, -98, -11, 1, 2, 43, 54]);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]),[1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9]);\n assert.deepEqual(candidate([0, 6, 6, -76, -21, 23, 4]),[-76, -21, 0, 4, 23, 6, 6]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "js", - "prompt": "//Return list of prime factors of given integer in the order from smallest to largest.\n// Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n// Input number should be equal to the product of all factors\n// >>> factorize(8)\n// [2, 2, 2]\n// >>> factorize(25)\n// [5, 5]\n// >>> factorize(70)\n// [2, 5, 7]\nfunction factorize(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = factorize;\n assert.deepEqual(candidate(2),[2]);\n assert.deepEqual(candidate(4),[2, 2]);\n assert.deepEqual(candidate(8),[2, 2, 2]);\n assert.deepEqual(candidate(57),[3, 19]);\n assert.deepEqual(candidate(3249),[3, 3, 19, 19]);\n assert.deepEqual(candidate(185193),[3, 3, 3, 19, 19, 19]);\n assert.deepEqual(candidate(20577),[3, 19, 19, 19]);\n assert.deepEqual(candidate(18),[2, 3, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "js", - "prompt": "//Return True if all numbers in the list l are below threshold t.\n// >>> below_threshold([1, 2, 4, 10], 100)\n// true\n// >>> below_threshold([1, 20, 4, 10], 5)\n// false\nfunction below_threshold(l, t){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = below_threshold;\n assert.deepEqual(candidate([1, 2, 4, 10], 100),true);\n assert.deepEqual(candidate([1, 20, 4, 10], 5),false);\n assert.deepEqual(candidate([1, 20, 4, 10], 21),true);\n assert.deepEqual(candidate([1, 20, 4, 10], 22),true);\n assert.deepEqual(candidate([1, 8, 4, 10], 11),true);\n assert.deepEqual(candidate([1, 8, 4, 10], 10),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "js", - "prompt": "//You are given two positive integers n and m, and your task is to compute the\n// average of the integers from n through m (including n and m). \n// Round the answer to the nearest integer and convert that to binary.\n// If n is greater than m, return -1.\n// Example:\n// >>> rounded_avg(1, 5)\n// \"0b11\"\n// >>> rounded_avg(7, 5)\n// -1\n// >>> rounded_avg(10, 20)\n// \"0b1111\"\n// >>> rounded_avg(20, 33)\n// \"0b11010\"\nfunction rounded_avg(n, m){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = rounded_avg;\n assert.deepEqual(candidate(1, 5),\"0b11\");\n assert.deepEqual(candidate(7, 13),\"0b1010\");\n assert.deepEqual(candidate(964, 977),\"0b1111001010\");\n assert.deepEqual(candidate(996, 997),\"0b1111100100\");\n assert.deepEqual(candidate(560, 851),\"0b1011000010\");\n assert.deepEqual(candidate(185, 546),\"0b101101110\");\n assert.deepEqual(candidate(362, 496),\"0b110101101\");\n assert.deepEqual(candidate(350, 902),\"0b1001110010\");\n assert.deepEqual(candidate(197, 233),\"0b11010111\");\n assert.deepEqual(candidate(7, 5),-1);\n assert.deepEqual(candidate(5, 1),-1);\n assert.deepEqual(candidate(5, 5),\"0b101\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "js", - "prompt": "//Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n// For each of the group, output the deepest level of nesting of parentheses.\n// E.g. (()()) has maximum two levels of nesting while ((())) has three.\n// >>> parse_nested_parens(\"(()()) ((())) () ((())()())\")\n// [2, 3, 1, 3]\nfunction parse_nested_parens(paren_string){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = parse_nested_parens;\n assert.deepEqual(candidate(\"(()()) ((())) () ((())()())\"),[2, 3, 1, 3]);\n assert.deepEqual(candidate(\"() (()) ((())) (((())))\"),[1, 2, 3, 4]);\n assert.deepEqual(candidate(\"(()(())((())))\"),[4]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "js", - "prompt": "//Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n// Examples\n// >>> solution([5, 8, 7, 1])\n// 12\n// >>> solution([3, 3, 3, 3, 3])\n// 9\n// >>> solution([30, 13, 24, 321])\n// 0\nfunction solution(lst){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = solution;\n assert.deepEqual(candidate([5, 8, 7, 1]),12);\n assert.deepEqual(candidate([3, 3, 3, 3, 3]),9);\n assert.deepEqual(candidate([30, 13, 24, 321]),0);\n assert.deepEqual(candidate([5, 9]),5);\n assert.deepEqual(candidate([2, 4, 8]),0);\n assert.deepEqual(candidate([30, 13, 23, 32]),23);\n assert.deepEqual(candidate([3, 13, 2, 9]),3);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "js", - "prompt": "//You are given a positive integer n. You have to create an integer array a of length n.\n// For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n// Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n// and a[i] + a[j] + a[k] is a multiple of 3.\n// Example :\n// >>> get_max_triples(5)\n// 1\n// Explanation: \n// a = [1, 3, 7, 13, 21]\n// The only valid triple is (1, 7, 13).\nfunction get_max_triples(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_max_triples;\n assert.deepEqual(candidate(5),1);\n assert.deepEqual(candidate(6),4);\n assert.deepEqual(candidate(10),36);\n assert.deepEqual(candidate(100),53361);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "js", - "prompt": "//There are eight planets in our solar system: the closerst to the Sun \n// is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n// Uranus, Neptune.\n// Write a function that takes two planet names as strings planet1 and planet2. \n// The function should return a tuple containing all planets whose orbits are \n// located between the orbit of planet1 and the orbit of planet2, sorted by \n// the proximity to the sun. \n// The function should return an empty tuple if planet1 or planet2\n// are not correct planet names. \n// Examples\n// >>> bf(\"Jupiter\", \"Neptune\")\n// [\"Saturn\", \"Uranus\"]\n// >>> bf(\"Earth\", \"Mercury\")\n// \"Venus\"\n// >>> bf(\"Mercury\", \"Uranus\")\n// [\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"]\nfunction bf(planet1, planet2){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = bf;\n assert.deepEqual(candidate(\"Jupiter\", \"Neptune\"),[\"Saturn\", \"Uranus\"]);\n assert.deepEqual(candidate(\"Earth\", \"Mercury\"),[\"Venus\"]);\n assert.deepEqual(candidate(\"Mercury\", \"Uranus\"),[\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"]);\n assert.deepEqual(candidate(\"Neptune\", \"Venus\"),[\"Earth\", \"Mars\", \"Jupiter\", \"Saturn\", \"Uranus\"]);\n assert.deepEqual(candidate(\"Earth\", \"Earth\"),[]);\n assert.deepEqual(candidate(\"Mars\", \"Earth\"),[]);\n assert.deepEqual(candidate(\"Jupiter\", \"Makemake\"),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "js", - "prompt": "//You are given a list of integers.\n// Write a function next_smallest() that returns the 2nd smallest element of the list.\n// Return None if there is no such element.\n// >>> next_smallest([1, 2, 3, 4, 5])\n// 2\n// >>> next_smallest([5, 1, 4, 3, 2])\n// 2\n// >>> next_smallest([])\n// undefined\n// >>> next_smallest([1, 1])\n// undefined\nfunction next_smallest(lst){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = next_smallest;\n assert.deepEqual(candidate([1, 2, 3, 4, 5]),2);\n assert.deepEqual(candidate([5, 1, 4, 3, 2]),2);\n assert.deepEqual(candidate([]),undefined);\n assert.deepEqual(candidate([1, 1]),undefined);\n assert.deepEqual(candidate([1, 1, 1, 1, 0]),1);\n assert.deepEqual(candidate([1, 1]),undefined);\n assert.deepEqual(candidate([-35, 34, 12, -45]),-35);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "js", - "prompt": "//Input is a space-delimited string of numberals from 'zero' to 'nine'.\n// Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n// Return the string with numbers sorted from smallest to largest\n// >>> sort_numbers(\"three one five\")\n// \"one three five\"\nfunction sort_numbers(numbers){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_numbers;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"three\"),\"three\");\n assert.deepEqual(candidate(\"three five nine\"),\"three five nine\");\n assert.deepEqual(candidate(\"five zero four seven nine eight\"),\"zero four five seven eight nine\");\n assert.deepEqual(candidate(\"six five four three two one zero\"),\"zero one two three four five six\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "js", - "prompt": "//You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n// >>> cycpattern_check(\"abcd\", \"abd\")\n// false\n// >>> cycpattern_check(\"hello\", \"ell\")\n// true\n// >>> cycpattern_check(\"whassup\", \"psus\")\n// false\n// >>> cycpattern_check(\"abab\", \"baa\")\n// true\n// >>> cycpattern_check(\"efef\", \"eeff\")\n// false\n// >>> cycpattern_check(\"himenss\", \"simen\")\n// true\nfunction cycpattern_check(a, b){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = cycpattern_check;\n assert.deepEqual(candidate(\"xyzw\", \"xyw\"),false);\n assert.deepEqual(candidate(\"yello\", \"ell\"),true);\n assert.deepEqual(candidate(\"whattup\", \"ptut\"),false);\n assert.deepEqual(candidate(\"efef\", \"fee\"),true);\n assert.deepEqual(candidate(\"abab\", \"aabb\"),false);\n assert.deepEqual(candidate(\"winemtt\", \"tinem\"),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "js", - "prompt": "//You will be given a number in decimal form and your task is to convert it to\n// binary format. The function should return a string, with each character representing a binary\n// number. Each character in the string will be '0' or '1'.\n// There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n// The extra characters are there to help with the format.\n// Examples:\n// >>> decimal_to_binary(15)\n// \"db1111db\"\n// >>> decimal_to_binary(32)\n// \"db100000db\"\nfunction decimal_to_binary(decimal){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = decimal_to_binary;\n assert.deepEqual(candidate(0),\"db0db\");\n assert.deepEqual(candidate(32),\"db100000db\");\n assert.deepEqual(candidate(103),\"db1100111db\");\n assert.deepEqual(candidate(15),\"db1111db\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "js", - "prompt": "//Filter an input list of strings only for ones that contain given substring\n// >>> filter_by_substring([], \"a\")\n// []\n// >>> filter_by_substring([\"abc\", \"bacd\", \"cde\", \"array\"], \"a\")\n// [\"abc\", \"bacd\", \"array\"]\nfunction filter_by_substring(strings, substring){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = filter_by_substring;\n assert.deepEqual(candidate([], \"john\"),[]);\n assert.deepEqual(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"),[\"xxx\", \"xxxAAA\", \"xxx\"]);\n assert.deepEqual(candidate([\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xx\"),[\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"]);\n assert.deepEqual(candidate([\"grunt\", \"trumpet\", \"prune\", \"gruesome\"], \"run\"),[\"grunt\", \"prune\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "js", - "prompt": "//Given an integer. return a tuple that has the number of even and odd digits respectively.\n// Example:\n// >>> even_odd_count(-12)\n// [1, 1]\n// >>> even_odd_count(123)\n// [1, 2]\nfunction even_odd_count(num){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = even_odd_count;\n assert.deepEqual(candidate(7),[0, 1]);\n assert.deepEqual(candidate(-78),[1, 1]);\n assert.deepEqual(candidate(3452),[2, 2]);\n assert.deepEqual(candidate(346211),[3, 3]);\n assert.deepEqual(candidate(-345821),[3, 3]);\n assert.deepEqual(candidate(-2),[1, 0]);\n assert.deepEqual(candidate(-45347),[2, 3]);\n assert.deepEqual(candidate(0),[1, 0]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "js", - "prompt": "//Write a function that accepts a list of strings.\n// The list contains different words. Return the word with maximum number\n// of unique characters. If multiple strings have maximum number of unique\n// characters, return the one which comes first in lexicographical order.\n// >>> find_max([\"name\", \"of\", \"string\"])\n// \"string\"\n// >>> find_max([\"name\", \"enam\", \"game\"])\n// \"enam\"\n// >>> find_max([\"aaaaaaa\", \"bb\", \"cc\"])\n// \"aaaaaaa\"\nfunction find_max(words){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = find_max;\n assert.deepEqual(candidate([\"name\", \"of\", \"string\"]),\"string\");\n assert.deepEqual(candidate([\"name\", \"enam\", \"game\"]),\"enam\");\n assert.deepEqual(candidate([\"aaaaaaa\", \"bb\", \"cc\"]),\"aaaaaaa\");\n assert.deepEqual(candidate([\"abc\", \"cba\"]),\"abc\");\n assert.deepEqual(candidate([\"play\", \"this\", \"game\", \"of\", \"footbott\"]),\"footbott\");\n assert.deepEqual(candidate([\"we\", \"are\", \"gonna\", \"rock\"]),\"gonna\");\n assert.deepEqual(candidate([\"we\", \"are\", \"a\", \"mad\", \"nation\"]),\"nation\");\n assert.deepEqual(candidate([\"this\", \"is\", \"a\", \"prrk\"]),\"this\");\n assert.deepEqual(candidate([\"b\"]),\"b\");\n assert.deepEqual(candidate([\"play\", \"play\", \"play\"]),\"play\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "js", - "prompt": "//Given a positive integer n, return the count of the numbers of n-digit\n// positive integers that start or end with 1.\nfunction starts_one_ends(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = starts_one_ends;\n assert.deepEqual(candidate(1),1);\n assert.deepEqual(candidate(2),18);\n assert.deepEqual(candidate(3),180);\n assert.deepEqual(candidate(4),1800);\n assert.deepEqual(candidate(5),18000);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "js", - "prompt": "//Create a function that returns a tuple (a, b), where 'a' is\n// the largest of negative integers, and 'b' is the smallest\n// of positive integers in a list.\n// If there is no negative or positive integers, return them as None.\n// Examples:\n// >>> largest_smallest_integers([2, 4, 1, 3, 5, 7])\n// [undefined, 1]\n// >>> largest_smallest_integers([])\n// [undefined, undefined]\n// >>> largest_smallest_integers([0])\n// [undefined, undefined]\nfunction largest_smallest_integers(lst){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = largest_smallest_integers;\n assert.deepEqual(candidate([2, 4, 1, 3, 5, 7]),[undefined, 1]);\n assert.deepEqual(candidate([2, 4, 1, 3, 5, 7, 0]),[undefined, 1]);\n assert.deepEqual(candidate([1, 3, 2, 4, 5, 6, -2]),[-2, 1]);\n assert.deepEqual(candidate([4, 5, 3, 6, 2, 7, -7]),[-7, 2]);\n assert.deepEqual(candidate([7, 3, 8, 4, 9, 2, 5, -9]),[-9, 2]);\n assert.deepEqual(candidate([]),[undefined, undefined]);\n assert.deepEqual(candidate([0]),[undefined, undefined]);\n assert.deepEqual(candidate([-1, -3, -5, -6]),[-1, undefined]);\n assert.deepEqual(candidate([-1, -3, -5, -6, 0]),[-1, undefined]);\n assert.deepEqual(candidate([-6, -4, -4, -3, 1]),[-3, 1]);\n assert.deepEqual(candidate([-6, -4, -4, -3, -100, 1]),[-3, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "js", - "prompt": "//\"Given an array representing a branch of a tree that has non-negative integer nodes\n// your task is to pluck one of the nodes and return it.\n// The plucked node should be the node with the smallest even value.\n// If multiple nodes with the same smallest even value are found return the node that has smallest index.\n// The plucked node should be returned in a list, [ smalest_value, its index ],\n// If there are no even values or the given array is empty, return [].\n// Example 1:\n// >>> pluck([4, 2, 3])\n// [2, 1]\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 2:\n// >>> pluck([1, 2, 3])\n// [2, 1]\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 3:\n// >>> pluck([])\n// []\n// Example 4:\n// >>> pluck([5, 0, 3, 0, 4, 2])\n// [0, 1]\n// Explanation: 0 is the smallest value, but there are two zeros,\n// so we will choose the first zero, which has the smallest index.\n// Constraints:\n// * 1 <= nodes.length <= 10000\n// * 0 <= node.value\nfunction pluck(arr){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = pluck;\n assert.deepEqual(candidate([4, 2, 3]),[2, 1]);\n assert.deepEqual(candidate([1, 2, 3]),[2, 1]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([5, 0, 3, 0, 4, 2]),[0, 1]);\n assert.deepEqual(candidate([1, 2, 3, 0, 5, 3]),[0, 3]);\n assert.deepEqual(candidate([5, 4, 8, 4, 8]),[4, 1]);\n assert.deepEqual(candidate([7, 6, 7, 1]),[6, 1]);\n assert.deepEqual(candidate([7, 9, 7, 1]),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "js", - "prompt": "//Write a function count_nums which takes an array of integers and returns\n// the number of elements which has a sum of digits > 0.\n// If a number is negative, then its first signed digit will be negative:\n// e.g. -123 has signed digits -1, 2, and 3.\n// >>> count_nums([])\n// 0\n// >>> count_nums([-1, 11, -11])\n// 1\n// >>> count_nums([1, 1, 2])\n// 3\nfunction count_nums(arr){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_nums;\n assert.deepEqual(candidate([]),0);\n assert.deepEqual(candidate([-1, -2, 0]),0);\n assert.deepEqual(candidate([1, 1, 2, -2, 3, 4, 5]),6);\n assert.deepEqual(candidate([1, 6, 9, -6, 0, 1, 5]),5);\n assert.deepEqual(candidate([1, 100, 98, -7, 1, -1]),4);\n assert.deepEqual(candidate([12, 23, 34, -45, -56, 0]),5);\n assert.deepEqual(candidate([0, 1]),1);\n assert.deepEqual(candidate([1]),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "js", - "prompt": "//Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n// each cell of the grid contains a value. Every integer in the range [1, N * N]\n// inclusive appears exactly once on the cells of the grid.\n// You have to find the minimum path of length k in the grid. You can start\n// from any cell, and in each step you can move to any of the neighbor cells,\n// in other words, you can go to cells which share an edge with you current\n// cell.\n// Please note that a path of length k means visiting exactly k cells (not\n// necessarily distinct).\n// You CANNOT go off the grid.\n// A path A (of length k) is considered less than a path B (of length k) if\n// after making the ordered lists of the values on the cells that A and B go\n// through (let's call them lst_A and lst_B), lst_A is lexicographically less\n// than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n// such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n// lst_A[j] = lst_B[j].\n// It is guaranteed that the answer is unique.\n// Return an ordered list of the values on the cells that the minimum path go through.\n// Examples: \n// >>> minPath([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3)\n// [1, 2, 1]\n// >>> minPath([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1)\n// [1]\nfunction minPath(grid, k){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = minPath;\n assert.deepEqual(candidate([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3),[1, 2, 1]);\n assert.deepEqual(candidate([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1),[1]);\n assert.deepEqual(candidate([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], 4),[1, 2, 1, 2]);\n assert.deepEqual(candidate([[6, 4, 13, 10], [5, 7, 12, 1], [3, 16, 11, 15], [8, 14, 9, 2]], 7),[1, 10, 1, 10, 1, 10, 1]);\n assert.deepEqual(candidate([[8, 14, 9, 2], [6, 4, 13, 15], [5, 7, 1, 12], [3, 10, 11, 16]], 5),[1, 7, 1, 7, 1]);\n assert.deepEqual(candidate([[11, 8, 7, 2], [5, 16, 14, 4], [9, 3, 15, 6], [12, 13, 10, 1]], 9),[1, 6, 1, 6, 1, 6, 1, 6, 1]);\n assert.deepEqual(candidate([[12, 13, 10, 1], [9, 3, 15, 6], [5, 16, 14, 4], [11, 8, 7, 2]], 12),[1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6]);\n assert.deepEqual(candidate([[2, 7, 4], [3, 1, 5], [6, 8, 9]], 8),[1, 3, 1, 3, 1, 3, 1, 3]);\n assert.deepEqual(candidate([[6, 1, 5], [3, 8, 9], [2, 7, 4]], 8),[1, 5, 1, 5, 1, 5, 1, 5]);\n assert.deepEqual(candidate([[1, 2], [3, 4]], 10),[1, 2, 1, 2, 1, 2, 1, 2, 1, 2]);\n assert.deepEqual(candidate([[1, 3], [3, 2]], 10),[1, 3, 1, 3, 1, 3, 1, 3, 1, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "js", - "prompt": "//Given list of integers, return list in strange order.\n// Strange sorting, is when you start with the minimum value,\n// then maximum of the remaining integers, then minimum and so on.\n// Examples:\n// >>> strange_sort_list([1, 2, 3, 4])\n// [1, 4, 2, 3]\n// >>> strange_sort_list([5, 5, 5, 5])\n// [5, 5, 5, 5]\n// >>> strange_sort_list([])\n// []\nfunction strange_sort_list(lst){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = strange_sort_list;\n assert.deepEqual(candidate([1, 2, 3, 4]),[1, 4, 2, 3]);\n assert.deepEqual(candidate([5, 6, 7, 8, 9]),[5, 9, 6, 8, 7]);\n assert.deepEqual(candidate([1, 2, 3, 4, 5]),[1, 5, 2, 4, 3]);\n assert.deepEqual(candidate([5, 6, 7, 8, 9, 1]),[1, 9, 5, 8, 6, 7]);\n assert.deepEqual(candidate([5, 5, 5, 5]),[5, 5, 5, 5]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6, 7, 8]),[1, 8, 2, 7, 3, 6, 4, 5]);\n assert.deepEqual(candidate([0, 2, 2, 2, 5, 5, -5, -5]),[-5, 5, -5, 5, 0, 2, 2, 2]);\n assert.deepEqual(candidate([111111]),[111111]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "js", - "prompt": "//Given a string 'text', return its md5 hash equivalent string.\n// If 'text' is an empty string, return None.\n// >>> string_to_md5(\"Hello world\")\n// \"3e25960a79dbc69b674cd4ec67a72c62\"\nfunction string_to_md5(text){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = string_to_md5;\n assert.deepEqual(candidate(\"Hello world\"),\"3e25960a79dbc69b674cd4ec67a72c62\");\n assert.deepEqual(candidate(\"\"),undefined);\n assert.deepEqual(candidate(\"A B C\"),\"0ef78513b0cb8cef12743f5aeb35f888\");\n assert.deepEqual(candidate(\"password\"),\"5f4dcc3b5aa765d61d8327deb882cf99\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "js", - "prompt": "//You are given a word. Your task is to find the closest vowel that stands between \n// two consonants from the right side of the word (case sensitive).\n// Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n// find any vowel met the above condition. \n// You may assume that the given string contains English letter only.\n// Example:\n// >>> get_closest_vowel(\"yogurt\")\n// \"u\"\n// >>> get_closest_vowel(\"FULL\")\n// \"U\"\n// >>> get_closest_vowel(\"quick\")\n// \"\"\n// >>> get_closest_vowel(\"ab\")\n// \"\"\nfunction get_closest_vowel(word){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_closest_vowel;\n assert.deepEqual(candidate(\"yogurt\"),\"u\");\n assert.deepEqual(candidate(\"full\"),\"u\");\n assert.deepEqual(candidate(\"easy\"),\"\");\n assert.deepEqual(candidate(\"eAsy\"),\"\");\n assert.deepEqual(candidate(\"ali\"),\"\");\n assert.deepEqual(candidate(\"bad\"),\"a\");\n assert.deepEqual(candidate(\"most\"),\"o\");\n assert.deepEqual(candidate(\"ab\"),\"\");\n assert.deepEqual(candidate(\"ba\"),\"\");\n assert.deepEqual(candidate(\"quick\"),\"\");\n assert.deepEqual(candidate(\"anime\"),\"i\");\n assert.deepEqual(candidate(\"Asia\"),\"\");\n assert.deepEqual(candidate(\"Above\"),\"o\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "js", - "prompt": "//Change numerical base of input number x to base.\n// return string representation after the conversion.\n// base numbers are less than 10.\n// >>> change_base(8, 3)\n// \"22\"\n// >>> change_base(8, 2)\n// \"1000\"\n// >>> change_base(7, 2)\n// \"111\"\nfunction change_base(x, base){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = change_base;\n assert.deepEqual(candidate(8, 3),\"22\");\n assert.deepEqual(candidate(9, 3),\"100\");\n assert.deepEqual(candidate(234, 2),\"11101010\");\n assert.deepEqual(candidate(16, 2),\"10000\");\n assert.deepEqual(candidate(8, 2),\"1000\");\n assert.deepEqual(candidate(7, 2),\"111\");\n assert.deepEqual(candidate(2, 3),\"2\");\n assert.deepEqual(candidate(3, 4),\"3\");\n assert.deepEqual(candidate(4, 5),\"4\");\n assert.deepEqual(candidate(5, 6),\"5\");\n assert.deepEqual(candidate(6, 7),\"6\");\n assert.deepEqual(candidate(7, 8),\"7\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "js", - "prompt": "//Check if in given list of numbers, are any two numbers closer to each other than\n// given threshold.\n// >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n// false\n// >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n// true\nfunction has_close_elements(numbers, threshold){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = has_close_elements;\n assert.deepEqual(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3),true);\n assert.deepEqual(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05),false);\n assert.deepEqual(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.95),true);\n assert.deepEqual(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.8),false);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1),true);\n assert.deepEqual(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 1.0),true);\n assert.deepEqual(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 0.5),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "js", - "prompt": "//Create a function that takes a string as input which contains only square brackets.\n// The function should return True if and only if there is a valid subsequence of brackets \n// where at least one bracket in the subsequence is nested.\n// >>> is_nested(\"[[]]\")\n// true\n// >>> is_nested(\"[]]]]]]][[[[[]\")\n// false\n// >>> is_nested(\"[][]\")\n// false\n// >>> is_nested(\"[]\")\n// false\n// >>> is_nested(\"[[][]]\")\n// true\n// >>> is_nested(\"[[]][[\")\n// true\nfunction is_nested(string){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_nested;\n assert.deepEqual(candidate(\"[[]]\"),true);\n assert.deepEqual(candidate(\"[]]]]]]][[[[[]\"),false);\n assert.deepEqual(candidate(\"[][]\"),false);\n assert.deepEqual(candidate(\"[]\"),false);\n assert.deepEqual(candidate(\"[[[[]]]]\"),true);\n assert.deepEqual(candidate(\"[]]]]]]]]]]\"),false);\n assert.deepEqual(candidate(\"[][][[]]\"),true);\n assert.deepEqual(candidate(\"[[]\"),false);\n assert.deepEqual(candidate(\"[]]\"),false);\n assert.deepEqual(candidate(\"[[]][[\"),true);\n assert.deepEqual(candidate(\"[[][]]\"),true);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"[[[[[[[[\"),false);\n assert.deepEqual(candidate(\"]]]]]]]]\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "js", - "prompt": "//Concatenate list of strings into a single string\n// >>> concatenate([])\n// \"\"\n// >>> concatenate([\"a\", \"b\", \"c\"])\n// \"abc\"\nfunction concatenate(strings){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = concatenate;\n assert.deepEqual(candidate([]),\"\");\n assert.deepEqual(candidate([\"x\", \"y\", \"z\"]),\"xyz\");\n assert.deepEqual(candidate([\"x\", \"y\", \"z\", \"w\", \"k\"]),\"xyzwk\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "js", - "prompt": "//prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n// >>> prime_fib(1)\n// 2\n// >>> prime_fib(2)\n// 3\n// >>> prime_fib(3)\n// 5\n// >>> prime_fib(4)\n// 13\n// >>> prime_fib(5)\n// 89\nfunction prime_fib(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = prime_fib;\n assert.deepEqual(candidate(1),2);\n assert.deepEqual(candidate(2),3);\n assert.deepEqual(candidate(3),5);\n assert.deepEqual(candidate(4),13);\n assert.deepEqual(candidate(5),89);\n assert.deepEqual(candidate(6),233);\n assert.deepEqual(candidate(7),1597);\n assert.deepEqual(candidate(8),28657);\n assert.deepEqual(candidate(9),514229);\n assert.deepEqual(candidate(10),433494437);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "js", - "prompt": "//From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n// other and return them in order (smaller number, larger number).\n// >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n// [2.0, 2.2]\n// >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n// [2.0, 2.0]\nfunction find_closest_elements(numbers){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = find_closest_elements;\n assert.deepEqual(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2]),[3.9, 4.0]);\n assert.deepEqual(candidate([1.0, 2.0, 5.9, 4.0, 5.0]),[5.0, 5.9]);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]),[2.0, 2.2]);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]),[2.0, 2.0]);\n assert.deepEqual(candidate([1.1, 2.2, 3.1, 4.1, 5.1]),[2.2, 3.1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "js", - "prompt": "//You have been tasked to write a function that receives \n// a hexadecimal number as a string and counts the number of hexadecimal \n// digits that are primes (prime number, or a prime, is a natural number \n// greater than 1 that is not a product of two smaller natural numbers).\n// Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n// Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n// So you have to determine a number of the following digits: 2, 3, 5, 7, \n// B (=decimal 11), D (=decimal 13).\n// Note: you may assume the input is always correct or empty string, \n// and symbols A,B,C,D,E,F are always uppercase.\n// Examples:\n// >>> hex_key(\"AB\")\n// 1\n// >>> hex_key(\"1077E\")\n// 2\n// >>> hex_key(\"ABED1A33\")\n// 4\n// >>> hex_key(\"123456789ABCDEF0\")\n// 6\n// >>> hex_key(\"2020\")\n// 2\nfunction hex_key(num){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = hex_key;\n assert.deepEqual(candidate(\"AB\"),1);\n assert.deepEqual(candidate(\"1077E\"),2);\n assert.deepEqual(candidate(\"ABED1A33\"),4);\n assert.deepEqual(candidate(\"2020\"),2);\n assert.deepEqual(candidate(\"123456789ABCDEF0\"),6);\n assert.deepEqual(candidate(\"112233445566778899AABBCCDDEEFF00\"),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "js", - "prompt": "//Complete the function that takes two integers and returns \n// the product of their unit digits.\n// Assume the input is always valid.\n// Examples:\n// >>> multiply(148, 412)\n// 16\n// >>> multiply(19, 28)\n// 72\n// >>> multiply(2020, 1851)\n// 0\n// >>> multiply(14, -15)\n// 20\nfunction multiply(a, b){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = multiply;\n assert.deepEqual(candidate(148, 412),16);\n assert.deepEqual(candidate(19, 28),72);\n assert.deepEqual(candidate(2020, 1851),0);\n assert.deepEqual(candidate(14, -15),20);\n assert.deepEqual(candidate(76, 67),42);\n assert.deepEqual(candidate(17, 27),49);\n assert.deepEqual(candidate(0, 1),0);\n assert.deepEqual(candidate(0, 0),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "js", - "prompt": "//Given list of numbers (of at least two elements), apply a linear transform to that list,\n// such that the smallest number will become 0 and the largest will become 1\n// >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n// [0.0, 0.25, 0.5, 0.75, 1.0]\nfunction rescale_to_unit(numbers){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = rescale_to_unit;\n assert.deepEqual(candidate([2.0, 49.9]),[0.0, 1.0]);\n assert.deepEqual(candidate([100.0, 49.9]),[1.0, 0.0]);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0]),[0.0, 0.25, 0.5, 0.75, 1.0]);\n assert.deepEqual(candidate([2.0, 1.0, 5.0, 3.0, 4.0]),[0.25, 0.0, 1.0, 0.5, 0.75]);\n assert.deepEqual(candidate([12.0, 11.0, 15.0, 13.0, 14.0]),[0.25, 0.0, 1.0, 0.5, 0.75]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "js", - "prompt": "//Given a positive integer n, return the product of the odd digits.\n// Return 0 if all digits are even.\n// For example:\n// >>> digits(1)\n// 1\n// >>> digits(4)\n// 0\n// >>> digits(235)\n// 15\nfunction digits(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = digits;\n assert.deepEqual(candidate(5),5);\n assert.deepEqual(candidate(54),5);\n assert.deepEqual(candidate(120),1);\n assert.deepEqual(candidate(5014),5);\n assert.deepEqual(candidate(98765),315);\n assert.deepEqual(candidate(5576543),2625);\n assert.deepEqual(candidate(2468),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "js", - "prompt": "//You will be given the name of a class (a string) and a list of extensions.\n// The extensions are to be used to load additional classes to the class. The\n// strength of the extension is as follows: Let CAP be the number of the uppercase\n// letters in the extension's name, and let SM be the number of lowercase letters \n// in the extension's name, the strength is given by the fraction CAP - SM. \n// You should find the strongest extension and return a string in this \n// format: ClassName.StrongestExtensionName.\n// If there are two or more extensions with the same strength, you should\n// choose the one that comes first in the list.\n// For example, if you are given \"Slices\" as the class and a list of the\n// extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n// return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n// (its strength is -1).\n// Example:\n// >>> Strongest_Extension(\"my_class\", [\"AA\", \"Be\", \"CC\"])\n// \"my_class.AA\"\nfunction Strongest_Extension(class_name, extensions){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = Strongest_Extension;\n assert.deepEqual(candidate(\"Watashi\", [\"tEN\", \"niNE\", \"eIGHt8OKe\"]),\"Watashi.eIGHt8OKe\");\n assert.deepEqual(candidate(\"Boku123\", [\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"]),\"Boku123.YEs.WeCaNe\");\n assert.deepEqual(candidate(\"__YESIMHERE\", [\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"]),\"__YESIMHERE.NuLl__\");\n assert.deepEqual(candidate(\"K\", [\"Ta\", \"TAR\", \"t234An\", \"cosSo\"]),\"K.TAR\");\n assert.deepEqual(candidate(\"__HAHA\", [\"Tab\", \"123\", \"781345\", \"-_-\"]),\"__HAHA.123\");\n assert.deepEqual(candidate(\"YameRore\", [\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"]),\"YameRore.okIWILL123\");\n assert.deepEqual(candidate(\"finNNalLLly\", [\"Die\", \"NowW\", \"Wow\", \"WoW\"]),\"finNNalLLly.WoW\");\n assert.deepEqual(candidate(\"_\", [\"Bb\", \"91245\"]),\"_.Bb\");\n assert.deepEqual(candidate(\"Sp\", [\"671235\", \"Bb\"]),\"Sp.671235\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "js", - "prompt": "//Given a string representing a space separated lowercase letters, return a dictionary\n// of the letter with the most repetition and containing the corresponding count.\n// If several letters have the same occurrence, return all of them.\n// Example:\n// >>> histogram(\"a b c\")\n// {\"a\": 1, \"b\": 1, \"c\": 1}\n// >>> histogram(\"a b b a\")\n// {\"a\": 2, \"b\": 2}\n// >>> histogram(\"a b c a b\")\n// {\"a\": 2, \"b\": 2}\n// >>> histogram(\"b b b b a\")\n// {\"b\": 4}\n// >>> histogram(\"\")\n// {}\nfunction histogram(test){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = histogram;\n assert.deepEqual(candidate(\"a b b a\"),{\"a\": 2, \"b\": 2});\n assert.deepEqual(candidate(\"a b c a b\"),{\"a\": 2, \"b\": 2});\n assert.deepEqual(candidate(\"a b c d g\"),{\"a\": 1, \"b\": 1, \"c\": 1, \"d\": 1, \"g\": 1});\n assert.deepEqual(candidate(\"r t g\"),{\"r\": 1, \"t\": 1, \"g\": 1});\n assert.deepEqual(candidate(\"b b b b a\"),{\"b\": 4});\n assert.deepEqual(candidate(\"r t g\"),{\"r\": 1, \"t\": 1, \"g\": 1});\n assert.deepEqual(candidate(\"\"),{});\n assert.deepEqual(candidate(\"a\"),{\"a\": 1});\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "js", - "prompt": "//pairs_sum_to_zero takes a list of integers as an input.\n// it returns True if there are two distinct elements in the list that\n// sum to zero, and False otherwise.\n// >>> pairs_sum_to_zero([1, 3, 5, 0])\n// false\n// >>> pairs_sum_to_zero([1, 3, -2, 1])\n// false\n// >>> pairs_sum_to_zero([1, 2, 3, 7])\n// false\n// >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7])\n// true\n// >>> pairs_sum_to_zero([1])\n// false\nfunction pairs_sum_to_zero(l){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = pairs_sum_to_zero;\n assert.deepEqual(candidate([1, 3, 5, 0]),false);\n assert.deepEqual(candidate([1, 3, -2, 1]),false);\n assert.deepEqual(candidate([1, 2, 3, 7]),false);\n assert.deepEqual(candidate([2, 4, -5, 3, 5, 7]),true);\n assert.deepEqual(candidate([1]),false);\n assert.deepEqual(candidate([-3, 9, -1, 3, 2, 30]),true);\n assert.deepEqual(candidate([-3, 9, -1, 3, 2, 31]),true);\n assert.deepEqual(candidate([-3, 9, -1, 4, 2, 30]),false);\n assert.deepEqual(candidate([-3, 9, -1, 4, 2, 31]),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "js", - "prompt": "//Write a function that accepts two lists of strings and returns the list that has \n// total number of chars in the all strings of the list less than the other list.\n// if the two lists have the same number of chars, return the first list.\n// Examples\n// >>> total_match([], [])\n// []\n// >>> total_match([\"hi\", \"admin\"], [\"hI\", \"Hi\"])\n// [\"hI\", \"Hi\"]\n// >>> total_match([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"])\n// [\"hi\", \"admin\"]\n// >>> total_match([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"])\n// [\"hI\", \"hi\", \"hi\"]\n// >>> total_match([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"])\n// [\"4\"]\nfunction total_match(lst1, lst2){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = total_match;\n assert.deepEqual(candidate([], []),[]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\"]),[\"hi\", \"hi\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"]),[\"hi\", \"admin\"]);\n assert.deepEqual(candidate([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"]),[\"4\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hI\", \"Hi\"]),[\"hI\", \"Hi\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"]),[\"hI\", \"hi\", \"hi\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hii\"]),[\"hi\", \"admin\"]);\n assert.deepEqual(candidate([], [\"this\"]),[]);\n assert.deepEqual(candidate([\"this\"], []),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "js", - "prompt": "//Circular shift the digits of the integer x, shift the digits right by shift\n// and return the result as a string.\n// If shift > number of digits, return digits reversed.\n// >>> circular_shift(12, 1)\n// \"21\"\n// >>> circular_shift(12, 2)\n// \"12\"\nfunction circular_shift(x, shift){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = circular_shift;\n assert.deepEqual(candidate(100, 2),\"001\");\n assert.deepEqual(candidate(12, 2),\"12\");\n assert.deepEqual(candidate(97, 8),\"79\");\n assert.deepEqual(candidate(12, 1),\"21\");\n assert.deepEqual(candidate(11, 101),\"11\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "js", - "prompt": "//Return True is list elements are monotonically increasing or decreasing.\n// >>> monotonic([1, 2, 4, 20])\n// true\n// >>> monotonic([1, 20, 4, 10])\n// false\n// >>> monotonic([4, 1, 0, -10])\n// true\nfunction monotonic(l){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = monotonic;\n assert.deepEqual(candidate([1, 2, 4, 10]),true);\n assert.deepEqual(candidate([1, 2, 4, 20]),true);\n assert.deepEqual(candidate([1, 20, 4, 10]),false);\n assert.deepEqual(candidate([4, 1, 0, -10]),true);\n assert.deepEqual(candidate([4, 1, 1, 0]),true);\n assert.deepEqual(candidate([1, 2, 3, 2, 5, 60]),false);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 60]),true);\n assert.deepEqual(candidate([9, 9, 9, 9]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "js", - "prompt": "//Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n// Example\n// >>> is_equal_to_sum_even(4)\n// false\n// >>> is_equal_to_sum_even(6)\n// false\n// >>> is_equal_to_sum_even(8)\n// true\nfunction is_equal_to_sum_even(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_equal_to_sum_even;\n assert.deepEqual(candidate(4),false);\n assert.deepEqual(candidate(6),false);\n assert.deepEqual(candidate(8),true);\n assert.deepEqual(candidate(10),true);\n assert.deepEqual(candidate(11),false);\n assert.deepEqual(candidate(12),true);\n assert.deepEqual(candidate(13),false);\n assert.deepEqual(candidate(16),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "js", - "prompt": "//Input to this function is a string representing musical notes in a special ASCII format.\n// Your task is to parse this string and return list of integers corresponding to how many beats does each\n// not last.\n// Here is a legend:\n// 'o' - whole note, lasts four beats\n// 'o|' - half note, lasts two beats\n// '.|' - quater note, lasts one beat\n// >>> parse_music(\"o o| .| o| o| .| .| .| .| o o\")\n// [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\nfunction parse_music(music_string){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = parse_music;\n assert.deepEqual(candidate(\"\"),[]);\n assert.deepEqual(candidate(\"o o o o\"),[4, 4, 4, 4]);\n assert.deepEqual(candidate(\".| .| .| .|\"),[1, 1, 1, 1]);\n assert.deepEqual(candidate(\"o| o| .| .| o o o o\"),[2, 2, 1, 1, 4, 4, 4, 4]);\n assert.deepEqual(candidate(\"o| .| o| .| o o| o o|\"),[2, 1, 2, 1, 4, 2, 4, 2]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "js", - "prompt": "//\"\n// This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n// multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n// change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n// Examples:\n// >>> lst\n// [1, 2, 3]\n// >>> lst\n// []\n// >>> lst\n// [-1, -5, 2, -1, -5]\nfunction sum_squares(lst){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_squares;\n assert.deepEqual(candidate([1, 2, 3]),6);\n assert.deepEqual(candidate([1, 4, 9]),14);\n assert.deepEqual(candidate([]),0);\n assert.deepEqual(candidate([1, 1, 1, 1, 1, 1, 1, 1, 1]),9);\n assert.deepEqual(candidate([-1, -1, -1, -1, -1, -1, -1, -1, -1]),-3);\n assert.deepEqual(candidate([0]),0);\n assert.deepEqual(candidate([-1, -5, 2, -1, -5]),-126);\n assert.deepEqual(candidate([-56, -99, 1, 0, -2]),3030);\n assert.deepEqual(candidate([-1, 0, 0, 0, 0, 0, 0, 0, -1]),0);\n assert.deepEqual(candidate([-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37]),-14196);\n assert.deepEqual(candidate([-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10]),-1448);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "js", - "prompt": "//triples_sum_to_zero takes a list of integers as an input.\n// it returns True if there are three distinct elements in the list that\n// sum to zero, and False otherwise.\n// >>> triples_sum_to_zero([1, 3, 5, 0])\n// false\n// >>> triples_sum_to_zero([1, 3, -2, 1])\n// true\n// >>> triples_sum_to_zero([1, 2, 3, 7])\n// false\n// >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n// true\n// >>> triples_sum_to_zero([1])\n// false\nfunction triples_sum_to_zero(l){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = triples_sum_to_zero;\n assert.deepEqual(candidate([1, 3, 5, 0]),false);\n assert.deepEqual(candidate([1, 3, 5, -1]),false);\n assert.deepEqual(candidate([1, 3, -2, 1]),true);\n assert.deepEqual(candidate([1, 2, 3, 7]),false);\n assert.deepEqual(candidate([1, 2, 5, 7]),false);\n assert.deepEqual(candidate([2, 4, -5, 3, 9, 7]),true);\n assert.deepEqual(candidate([1]),false);\n assert.deepEqual(candidate([1, 3, 5, -100]),false);\n assert.deepEqual(candidate([100, 3, 5, -100]),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "js", - "prompt": "//brackets is a string of \"<\" and \">\".\n// return True if every opening bracket has a corresponding closing bracket.\n// >>> correct_bracketing(\"<\")\n// false\n// >>> correct_bracketing(\"<>\")\n// true\n// >>> correct_bracketing(\"<<><>>\")\n// true\n// >>> correct_bracketing(\"><<>\")\n// false\nfunction correct_bracketing(brackets){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = correct_bracketing;\n assert.deepEqual(candidate(\"<>\"),true);\n assert.deepEqual(candidate(\"<<><>>\"),true);\n assert.deepEqual(candidate(\"<><><<><>><>\"),true);\n assert.deepEqual(candidate(\"<><><<<><><>><>><<><><<>>>\"),true);\n assert.deepEqual(candidate(\"<<<><>>>>\"),false);\n assert.deepEqual(candidate(\"><<>\"),false);\n assert.deepEqual(candidate(\"<\"),false);\n assert.deepEqual(candidate(\"<<<<\"),false);\n assert.deepEqual(candidate(\">\"),false);\n assert.deepEqual(candidate(\"<<>\"),false);\n assert.deepEqual(candidate(\"<><><<><>><>><<>\"),false);\n assert.deepEqual(candidate(\"<><><<><>><>>><>\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "js", - "prompt": "//Write a function that takes an array of numbers as input and returns \n// the number of elements in the array that are greater than 10 and both \n// first and last digits of a number are odd (1, 3, 5, 7, 9).\n// For example:\n// >>> specialFilter([15, -73, 14, -15])\n// 1\n// >>> specialFilter([33, -2, -3, 45, 21, 109])\n// 2\nfunction specialFilter(nums){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = specialFilter;\n assert.deepEqual(candidate([5, -2, 1, -5]),0);\n assert.deepEqual(candidate([15, -73, 14, -15]),1);\n assert.deepEqual(candidate([33, -2, -3, 45, 21, 109]),2);\n assert.deepEqual(candidate([43, -12, 93, 125, 121, 109]),4);\n assert.deepEqual(candidate([71, -2, -33, 75, 21, 19]),3);\n assert.deepEqual(candidate([1]),0);\n assert.deepEqual(candidate([]),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "js", - "prompt": "//Given a dictionary, return True if all keys are strings in lower \n// case or all keys are strings in upper case, else return False.\n// The function should return False is the given dictionary is empty.\n// Examples:\n// >>> check_dict_case({\"a\": \"apple\", \"b\": \"banana\"})\n// true\n// >>> check_dict_case({\"a\": \"apple\", \"A\": \"banana\", \"B\": \"banana\"})\n// false\n// >>> check_dict_case({\"a\": \"apple\", 8: \"banana\", \"a\": \"apple\"})\n// false\n// >>> check_dict_case({\"Name\": \"John\", \"Age\": \"36\", \"City\": \"Houston\"})\n// false\n// >>> check_dict_case({\"STATE\": \"NC\", \"ZIP\": \"12345\"})\n// true\nfunction check_dict_case(dict){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = check_dict_case;\n assert.deepEqual(candidate({\"p\": \"pineapple\", \"b\": \"banana\"}),true);\n assert.deepEqual(candidate({\"p\": \"pineapple\", \"A\": \"banana\", \"B\": \"banana\"}),false);\n assert.deepEqual(candidate({\"p\": \"pineapple\", \"5\": \"banana\", \"a\": \"apple\"}),false);\n assert.deepEqual(candidate({\"Name\": \"John\", \"Age\": \"36\", \"City\": \"Houston\"}),false);\n assert.deepEqual(candidate({\"STATE\": \"NC\", \"ZIP\": \"12345\"}),true);\n assert.deepEqual(candidate({\"fruit\": \"Orange\", \"taste\": \"Sweet\"}),true);\n assert.deepEqual(candidate({}),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "js", - "prompt": "//Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n// should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n// alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n// Examples\n// >>> split_words(\"Hello world!\")\n// [\"Hello\", \"world!\"]\n// >>> split_words(\"Hello,world!\")\n// [\"Hello\", \"world!\"]\n// >>> split_words(\"abcdef\")\n// 3\nfunction split_words(txt){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = split_words;\n assert.deepEqual(candidate(\"Hello world!\"),[\"Hello\", \"world!\"]);\n assert.deepEqual(candidate(\"Hello,world!\"),[\"Hello\", \"world!\"]);\n assert.deepEqual(candidate(\"Hello world,!\"),[\"Hello\", \"world,!\"]);\n assert.deepEqual(candidate(\"Hello,Hello,world !\"),[\"Hello,Hello,world\", \"!\"]);\n assert.deepEqual(candidate(\"abcdef\"),3);\n assert.deepEqual(candidate(\"aaabb\"),2);\n assert.deepEqual(candidate(\"aaaBb\"),1);\n assert.deepEqual(candidate(\"\"),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "js", - "prompt": "//The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fibfib(0) == 0\n// fibfib(1) == 0\n// fibfib(2) == 1\n// fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n// Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n// >>> fibfib(1)\n// 0\n// >>> fibfib(5)\n// 4\n// >>> fibfib(8)\n// 24\nfunction fibfib(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fibfib;\n assert.deepEqual(candidate(2),1);\n assert.deepEqual(candidate(1),0);\n assert.deepEqual(candidate(5),4);\n assert.deepEqual(candidate(8),24);\n assert.deepEqual(candidate(10),81);\n assert.deepEqual(candidate(12),274);\n assert.deepEqual(candidate(14),927);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "js", - "prompt": "//You are given a list of numbers.\n// You need to return the sum of squared numbers in the given list,\n// round each element in the list to the upper int(Ceiling) first.\n// Examples:\n// >>> lst([1.0, 2.0, 3.0])\n// 14\n// >>> lst([1.0, 4.0, 9.0])\n// 98\n// >>> lst([1.0, 3.0, 5.0, 7.0])\n// 84\n// >>> lst([1.4, 4.2, 0.0])\n// 29\n// >>> lst([-2.4, 1.0, 1.0])\n// 6\nfunction sum_squares(lst){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_squares;\n assert.deepEqual(candidate([1.0, 2.0, 3.0]),14);\n assert.deepEqual(candidate([1.0, 2.0, 3.0]),14);\n assert.deepEqual(candidate([1.0, 3.0, 5.0, 7.0]),84);\n assert.deepEqual(candidate([1.4, 4.2, 0.0]),29);\n assert.deepEqual(candidate([-2.4, 1.0, 1.0]),6);\n assert.deepEqual(candidate([100.0, 1.0, 15.0, 2.0]),10230);\n assert.deepEqual(candidate([10000.0, 10000.0]),200000000);\n assert.deepEqual(candidate([-1.4, 4.6, 6.3]),75);\n assert.deepEqual(candidate([-1.4, 17.9, 18.9, 19.9]),1086);\n assert.deepEqual(candidate([0.0]),0);\n assert.deepEqual(candidate([-1.0]),1);\n assert.deepEqual(candidate([-1.0, 1.0, 0.0]),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_85_add", - "language": "js", - "prompt": "//Given a non-empty list of integers lst. add the even elements that are at odd indices..\n// Examples:\n// >>> add([4, 2, 6, 7])\n// 2\nfunction add(lst){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = add;\n assert.deepEqual(candidate([4, 88]),88);\n assert.deepEqual(candidate([4, 5, 6, 7, 2, 122]),122);\n assert.deepEqual(candidate([4, 0, 6, 7]),0);\n assert.deepEqual(candidate([4, 4, 6, 8]),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "js", - "prompt": "//Return sorted unique elements in a list\n// >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123])\n// [0, 2, 3, 5, 9, 123]\nfunction unique(l){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = unique;\n assert.deepEqual(candidate([5, 3, 5, 2, 3, 3, 9, 0, 123]),[0, 2, 3, 5, 9, 123]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "js", - "prompt": "//Given a string text, replace all spaces in it with underscores, \n// and if a string has more than 2 consecutive spaces, \n// then replace all consecutive spaces with - \n// >>> fix_spaces(\" Example\")\n// \"Example\"\n// >>> fix_spaces(\" Example 1\")\n// \"Example_1\"\n// >>> fix_spaces(\" Example 2\")\n// \"_Example_2\"\n// >>> fix_spaces(\" Example 3\")\n// \"_Example-3\"\nfunction fix_spaces(text){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fix_spaces;\n assert.deepEqual(candidate(\"Example\"),\"Example\");\n assert.deepEqual(candidate(\"Mudasir Hanif \"),\"Mudasir_Hanif_\");\n assert.deepEqual(candidate(\"Yellow Yellow Dirty Fellow\"),\"Yellow_Yellow__Dirty__Fellow\");\n assert.deepEqual(candidate(\"Exa mple\"),\"Exa-mple\");\n assert.deepEqual(candidate(\" Exa 1 2 2 mple\"),\"-Exa_1_2_2_mple\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "js", - "prompt": "//Return 2^n modulo p (be aware of numerics).\n// >>> modp(3, 5)\n// 3\n// >>> modp(1101, 101)\n// 2\n// >>> modp(0, 101)\n// 1\n// >>> modp(3, 11)\n// 8\n// >>> modp(100, 101)\n// 1\nfunction modp(n, p){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = modp;\n assert.deepEqual(candidate(3, 5),3);\n assert.deepEqual(candidate(1101, 101),2);\n assert.deepEqual(candidate(0, 101),1);\n assert.deepEqual(candidate(3, 11),8);\n assert.deepEqual(candidate(100, 101),1);\n assert.deepEqual(candidate(30, 5),4);\n assert.deepEqual(candidate(31, 5),3);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "js", - "prompt": "//You have to write a function which validates a given date string and\n// returns True if the date is valid otherwise False.\n// The date is valid if all of the following rules are satisfied:\n// 1. The date string is not empty.\n// 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n// 3. The months should not be less than 1 or higher than 12.\n// 4. The date should be in the format: mm-dd-yyyy\n// >>> valid_date(\"03-11-2000\")\n// true\n// >>> valid_date(\"15-01-2012\")\n// false\n// >>> valid_date(\"04-0-2040\")\n// false\n// >>> valid_date(\"06-04-2020\")\n// true\n// >>> valid_date(\"06/04/2020\")\n// false\nfunction valid_date(date){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = valid_date;\n assert.deepEqual(candidate(\"03-11-2000\"),true);\n assert.deepEqual(candidate(\"15-01-2012\"),false);\n assert.deepEqual(candidate(\"04-0-2040\"),false);\n assert.deepEqual(candidate(\"06-04-2020\"),true);\n assert.deepEqual(candidate(\"01-01-2007\"),true);\n assert.deepEqual(candidate(\"03-32-2011\"),false);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"04-31-3000\"),false);\n assert.deepEqual(candidate(\"06-06-2005\"),true);\n assert.deepEqual(candidate(\"21-31-2000\"),false);\n assert.deepEqual(candidate(\"04-12-2003\"),true);\n assert.deepEqual(candidate(\"04122003\"),false);\n assert.deepEqual(candidate(\"20030412\"),false);\n assert.deepEqual(candidate(\"2003-04\"),false);\n assert.deepEqual(candidate(\"2003-04-12\"),false);\n assert.deepEqual(candidate(\"04-2003\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "js", - "prompt": "//Write a function that takes a string and returns an ordered version of it.\n// Ordered version of string, is a string where all words (separated by space)\n// are replaced by a new word where all the characters arranged in\n// ascending order based on ascii value.\n// Note: You should keep the order of words and blank spaces in the sentence.\n// For example:\n// >>> anti_shuffle(\"Hi\")\n// \"Hi\"\n// >>> anti_shuffle(\"hello\")\n// \"ehllo\"\n// >>> anti_shuffle(\"Hello World!!!\")\n// \"Hello !!!Wdlor\"\nfunction anti_shuffle(s){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = anti_shuffle;\n assert.deepEqual(candidate(\"Hi\"),\"Hi\");\n assert.deepEqual(candidate(\"hello\"),\"ehllo\");\n assert.deepEqual(candidate(\"number\"),\"bemnru\");\n assert.deepEqual(candidate(\"abcd\"),\"abcd\");\n assert.deepEqual(candidate(\"Hello World!!!\"),\"Hello !!!Wdlor\");\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"Hi. My name is Mister Robot. How are you?\"),\".Hi My aemn is Meirst .Rboot How aer ?ouy\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "js", - "prompt": "//Given a list of numbers, return whether or not they are sorted\n// in ascending order. If list has more than 1 duplicate of the same\n// number, return False. Assume no negative numbers and only integers.\n// Examples\n// >>> is_sorted([5])\n// true\n// >>> is_sorted([1, 2, 3, 4, 5])\n// true\n// >>> is_sorted([1, 3, 2, 4, 5])\n// false\n// >>> is_sorted([1, 2, 3, 4, 5, 6])\n// true\n// >>> is_sorted([1, 2, 3, 4, 5, 6, 7])\n// true\n// >>> is_sorted([1, 3, 2, 4, 5, 6, 7])\n// false\n// >>> is_sorted([1, 2, 2, 3, 3, 4])\n// true\n// >>> is_sorted([1, 2, 2, 2, 3, 4])\n// false\nfunction is_sorted(lst){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_sorted;\n assert.deepEqual(candidate([5]),true);\n assert.deepEqual(candidate([1, 2, 3, 4, 5]),true);\n assert.deepEqual(candidate([1, 3, 2, 4, 5]),false);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6]),true);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6, 7]),true);\n assert.deepEqual(candidate([1, 3, 2, 4, 5, 6, 7]),false);\n assert.deepEqual(candidate([]),true);\n assert.deepEqual(candidate([1]),true);\n assert.deepEqual(candidate([3, 2, 1]),false);\n assert.deepEqual(candidate([1, 2, 2, 2, 3, 4]),false);\n assert.deepEqual(candidate([1, 2, 3, 3, 3, 4]),false);\n assert.deepEqual(candidate([1, 2, 2, 3, 3, 4]),true);\n assert.deepEqual(candidate([1, 2, 3, 4]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "js", - "prompt": "//You are given a string s.\n// Your task is to check if the string is happy or not.\n// A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n// For example:\n// >>> is_happy(\"a\")\n// false\n// >>> is_happy(\"aa\")\n// false\n// >>> is_happy(\"abcd\")\n// true\n// >>> is_happy(\"aabb\")\n// false\n// >>> is_happy(\"adb\")\n// true\n// >>> is_happy(\"xyy\")\n// false\nfunction is_happy(s){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_happy;\n assert.deepEqual(candidate(\"a\"),false);\n assert.deepEqual(candidate(\"aa\"),false);\n assert.deepEqual(candidate(\"abcd\"),true);\n assert.deepEqual(candidate(\"aabb\"),false);\n assert.deepEqual(candidate(\"adb\"),true);\n assert.deepEqual(candidate(\"xyy\"),false);\n assert.deepEqual(candidate(\"iopaxpoi\"),true);\n assert.deepEqual(candidate(\"iopaxioi\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "js", - "prompt": "//Write a function that returns True if the object q will fly, and False otherwise.\n// The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n// Example:\n// >>> will_it_fly([1, 2], 5)\n// false\n// # 1+2 is less than the maximum possible weight, but it's unbalanced.\n// >>> will_it_fly([3, 2, 3], 1)\n// false\n// # it's balanced, but 3+2+3 is more than the maximum possible weight.\n// >>> will_it_fly([3, 2, 3], 9)\n// true\n// # 3+2+3 is less than the maximum possible weight, and it's balanced.\n// >>> will_it_fly([3], 5)\n// true\n// # 3 is less than the maximum possible weight, and it's balanced.\nfunction will_it_fly(q, w){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = will_it_fly;\n assert.deepEqual(candidate([3, 2, 3], 9),true);\n assert.deepEqual(candidate([1, 2], 5),false);\n assert.deepEqual(candidate([3], 5),true);\n assert.deepEqual(candidate([3, 2, 3], 1),false);\n assert.deepEqual(candidate([1, 2, 3], 6),false);\n assert.deepEqual(candidate([5], 5),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "js", - "prompt": "//Given an array of non-negative integers, return a copy of the given array after sorting,\n// you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n// or sort it in descending order if the sum( first index value, last index value) is even.\n// Note:\n// * don't change the given array.\n// Examples:\n// >>> sort_array([])\n// []\n// >>> sort_array([5])\n// [5]\n// >>> sort_array([2, 4, 3, 0, 1, 5])\n// [0, 1, 2, 3, 4, 5]\n// >>> sort_array([2, 4, 3, 0, 1, 5, 6])\n// [6, 5, 4, 3, 2, 1, 0]\nfunction sort_array(array){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_array;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([5]),[5]);\n assert.deepEqual(candidate([2, 4, 3, 0, 1, 5]),[0, 1, 2, 3, 4, 5]);\n assert.deepEqual(candidate([2, 4, 3, 0, 1, 5, 6]),[6, 5, 4, 3, 2, 1, 0]);\n assert.deepEqual(candidate([2, 1]),[1, 2]);\n assert.deepEqual(candidate([15, 42, 87, 32, 11, 0]),[0, 11, 15, 32, 42, 87]);\n assert.deepEqual(candidate([21, 14, 23, 11]),[23, 21, 14, 11]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "js", - "prompt": "//Implement a function that takes an non-negative integer and returns an array of the first n\n// integers that are prime numbers and less than n.\n// for example:\n// >>> count_up_to(5)\n// [2, 3]\n// >>> count_up_to(11)\n// [2, 3, 5, 7]\n// >>> count_up_to(0)\n// []\n// >>> count_up_to(20)\n// [2, 3, 5, 7, 11, 13, 17, 19]\n// >>> count_up_to(1)\n// []\n// >>> count_up_to(18)\n// [2, 3, 5, 7, 11, 13, 17]\nfunction count_up_to(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_up_to;\n assert.deepEqual(candidate(5),[2, 3]);\n assert.deepEqual(candidate(6),[2, 3, 5]);\n assert.deepEqual(candidate(7),[2, 3, 5]);\n assert.deepEqual(candidate(10),[2, 3, 5, 7]);\n assert.deepEqual(candidate(0),[]);\n assert.deepEqual(candidate(22),[2, 3, 5, 7, 11, 13, 17, 19]);\n assert.deepEqual(candidate(1),[]);\n assert.deepEqual(candidate(18),[2, 3, 5, 7, 11, 13, 17]);\n assert.deepEqual(candidate(47),[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43]);\n assert.deepEqual(candidate(101),[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "js", - "prompt": "//Out of list of strings, return the longest one. Return the first one in case of multiple\n// strings of the same length. Return None in case the input list is empty.\n// >>> longest([])\n// undefined\n// >>> longest([\"a\", \"b\", \"c\"])\n// \"a\"\n// >>> longest([\"a\", \"bb\", \"ccc\"])\n// \"ccc\"\nfunction longest(strings){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = longest;\n assert.deepEqual(candidate([]),undefined);\n assert.deepEqual(candidate([\"x\", \"y\", \"z\"]),\"x\");\n assert.deepEqual(candidate([\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"]),\"zzzz\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "js", - "prompt": "//Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n// reverse the resulting array, and then replace each digit by its corresponding name from\n// \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n// For example:\n// >>> by_length([2, 1, 1, 4, 5, 8, 2, 3])\n// [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n// If the array is empty, return an empty array:\n// >>> by_length([])\n// []\n// If the array has any strange number ignore it:\n// >>> by_length([1, -1, 55])\n// [\"One\"]\nfunction by_length(arr){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = by_length;\n assert.deepEqual(candidate([2, 1, 1, 4, 5, 8, 2, 3]),[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, -1, 55]),[\"One\"]);\n assert.deepEqual(candidate([1, -1, 3, 2]),[\"Three\", \"Two\", \"One\"]);\n assert.deepEqual(candidate([9, 4, 8]),[\"Nine\", \"Eight\", \"Four\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_106_f", - "language": "js", - "prompt": "//Implement the function f that takes n as a parameter,\n// 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\n// or the sum of numbers from 1 to i otherwise.\n// i starts from 1.\n// the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n// Example:\n// >>> f(5)\n// [1, 2, 6, 24, 15]\nfunction f(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = f;\n assert.deepEqual(candidate(5),[1, 2, 6, 24, 15]);\n assert.deepEqual(candidate(7),[1, 2, 6, 24, 15, 720, 28]);\n assert.deepEqual(candidate(1),[1]);\n assert.deepEqual(candidate(3),[1, 2, 6]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "js", - "prompt": "//Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n// >>> fizz_buzz(50)\n// 0\n// >>> fizz_buzz(78)\n// 2\n// >>> fizz_buzz(79)\n// 3\nfunction fizz_buzz(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fizz_buzz;\n assert.deepEqual(candidate(50),0);\n assert.deepEqual(candidate(78),2);\n assert.deepEqual(candidate(79),3);\n assert.deepEqual(candidate(100),3);\n assert.deepEqual(candidate(200),6);\n assert.deepEqual(candidate(4000),192);\n assert.deepEqual(candidate(10000),639);\n assert.deepEqual(candidate(100000),8026);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "js", - "prompt": "//Given a positive floating point number, it can be decomposed into\n// and integer part (largest integer smaller than given number) and decimals\n// (leftover part always smaller than 1).\n// Return the decimal part of the number.\n// >>> truncate_number(3.5)\n// 0.5\nfunction truncate_number(number){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = truncate_number;\n assert.deepEqual(candidate(3.5),0.5);\n assert.deepEqual(candidate(1.25),0.25);\n assert.deepEqual(candidate(123.0),0.0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "js", - "prompt": "//For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n// Empty sum should be equal to 0 and empty product should be equal to 1.\n// >>> sum_product([])\n// [0, 1]\n// >>> sum_product([1, 2, 3, 4])\n// [10, 24]\nfunction sum_product(numbers){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_product;\n assert.deepEqual(candidate([]),[0, 1]);\n assert.deepEqual(candidate([1, 1, 1]),[3, 1]);\n assert.deepEqual(candidate([100, 0]),[100, 0]);\n assert.deepEqual(candidate([3, 5, 7]),[15, 105]);\n assert.deepEqual(candidate([10]),[10, 10]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "js", - "prompt": "//You are given a 2 dimensional data, as a nested lists,\n// which is similar to matrix, however, unlike matrices,\n// each row may contain a different number of columns.\n// Given lst, and integer x, find integers x in the list,\n// and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n// each tuple is a coordinate - (row, columns), starting with 0.\n// Sort coordinates initially by rows in ascending order.\n// Also, sort coordinates of the row by columns in descending order.\n// Examples:\n// >>> get_row([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1)\n// [[0, 0], [1, 4], [1, 0], [2, 5], [2, 0]]\n// >>> get_row([], 1)\n// []\n// >>> get_row([[], [1], [1, 2, 3]], 3)\n// [[2, 2]]\nfunction get_row(lst, x){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_row;\n assert.deepEqual(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1),[[0, 0], [1, 4], [1, 0], [2, 5], [2, 0]]);\n assert.deepEqual(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6]], 2),[[0, 1], [1, 1], [2, 1], [3, 1], [4, 1], [5, 1]]);\n assert.deepEqual(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 1, 3, 4, 5, 6], [1, 2, 1, 4, 5, 6], [1, 2, 3, 1, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1),[[0, 0], [1, 0], [2, 1], [2, 0], [3, 2], [3, 0], [4, 3], [4, 0], [5, 4], [5, 0], [6, 5], [6, 0]]);\n assert.deepEqual(candidate([], 1),[]);\n assert.deepEqual(candidate([[1]], 2),[]);\n assert.deepEqual(candidate([[], [1], [1, 2, 3]], 3),[[2, 2]]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "js", - "prompt": "//You're a hungry rabbit, and you already have eaten a certain number of carrots,\n// but now you need to eat more carrots to complete the day's meals.\n// you should return an array of [ total number of eaten carrots after your meals,\n// the number of carrots left after your meals ]\n// if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n// Example:\n// >>> eat(5, 6, 10)\n// [11, 4]\n// >>> eat(4, 8, 9)\n// [12, 1]\n// >>> eat(1, 10, 10)\n// [11, 0]\n// >>> eat(2, 11, 5)\n// [7, 0]\n// Variables:\n// @number : integer\n// the number of carrots that you have eaten.\n// @need : integer\n// the number of carrots that you need to eat.\n// @remaining : integer\n// the number of remaining carrots thet exist in stock\n// Constrain:\n// * 0 <= number <= 1000\n// * 0 <= need <= 1000\n// * 0 <= remaining <= 1000\n// Have fun :)\nfunction eat(number, need, remaining){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = eat;\n assert.deepEqual(candidate(5, 6, 10),[11, 4]);\n assert.deepEqual(candidate(4, 8, 9),[12, 1]);\n assert.deepEqual(candidate(1, 10, 10),[11, 0]);\n assert.deepEqual(candidate(2, 11, 5),[7, 0]);\n assert.deepEqual(candidate(4, 5, 7),[9, 2]);\n assert.deepEqual(candidate(4, 5, 1),[5, 0]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "js", - "prompt": "//Given a positive integer N, return the total sum of its digits in binary.\n// Example\n// >>> solve(1000)\n// \"1\"\n// >>> solve(150)\n// \"110\"\n// >>> solve(147)\n// \"1100\"\n// Variables:\n// @N integer\n// Constraints: 0 \u2264 N \u2264 10000.\n// Output:\n// a string of binary number\nfunction solve(N){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = solve;\n assert.deepEqual(candidate(1000),\"1\");\n assert.deepEqual(candidate(150),\"110\");\n assert.deepEqual(candidate(147),\"1100\");\n assert.deepEqual(candidate(333),\"1001\");\n assert.deepEqual(candidate(963),\"10010\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "js", - "prompt": "//You are given a list of integers.\n// You need to find the largest prime value and return the sum of its digits.\n// Examples:\n// >>> skjkasdkd([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3])\n// 10\n// >>> skjkasdkd([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1])\n// 25\n// >>> skjkasdkd([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3])\n// 13\n// >>> skjkasdkd([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6])\n// 11\n// >>> skjkasdkd([0, 81, 12, 3, 1, 21])\n// 3\n// >>> skjkasdkd([0, 8, 1, 2, 1, 7])\n// 7\nfunction skjkasdkd(lst){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = skjkasdkd;\n assert.deepEqual(candidate([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]),10);\n assert.deepEqual(candidate([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]),25);\n assert.deepEqual(candidate([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]),13);\n assert.deepEqual(candidate([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]),11);\n assert.deepEqual(candidate([0, 81, 12, 3, 1, 21]),3);\n assert.deepEqual(candidate([0, 8, 1, 2, 1, 7]),7);\n assert.deepEqual(candidate([8191]),19);\n assert.deepEqual(candidate([8191, 123456, 127, 7]),19);\n assert.deepEqual(candidate([127, 97, 8192]),10);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "js", - "prompt": "//Given an array arr of integers, find the minimum number of elements that\n// need to be changed to make the array palindromic. A palindromic array is an array that\n// is read the same backwards and forwards. In one change, you can change one element to any other element.\n// For example:\n// >>> smallest_change([1, 2, 3, 5, 4, 7, 9, 6])\n// 4\n// >>> smallest_change([1, 2, 3, 4, 3, 2, 2])\n// 1\n// >>> smallest_change([1, 2, 3, 2, 1])\n// 0\nfunction smallest_change(arr){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = smallest_change;\n assert.deepEqual(candidate([1, 2, 3, 5, 4, 7, 9, 6]),4);\n assert.deepEqual(candidate([1, 2, 3, 4, 3, 2, 2]),1);\n assert.deepEqual(candidate([1, 4, 2]),1);\n assert.deepEqual(candidate([1, 4, 4, 2]),1);\n assert.deepEqual(candidate([1, 2, 3, 2, 1]),0);\n assert.deepEqual(candidate([3, 1, 1, 3]),0);\n assert.deepEqual(candidate([1]),0);\n assert.deepEqual(candidate([0, 1]),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "js", - "prompt": "//It is the last week of the semester and the teacher has to give the grades\n// to students. The teacher has been making her own algorithm for grading.\n// The only problem is, she has lost the code she used for grading.\n// She has given you a list of GPAs for some students and you have to write \n// a function that can output a list of letter grades using the following table:\n// GPA | Letter grade\n// 4.0 A+\n// > 3.7 A \n// > 3.3 A- \n// > 3.0 B+\n// > 2.7 B \n// > 2.3 B-\n// > 2.0 C+\n// > 1.7 C\n// > 1.3 C-\n// > 1.0 D+ \n// > 0.7 D \n// > 0.0 D-\n// 0.0 E\n// Example:\n// >>> grade_equation([4.0, 3, 1.7, 2, 3.5])\n// [\"A+\", \"B\", \"C-\", \"C\", \"A-\"]\nfunction numerical_letter_grade(grades){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = numerical_letter_grade;\n assert.deepEqual(candidate([4.0, 3, 1.7, 2, 3.5]),[\"A+\", \"B\", \"C-\", \"C\", \"A-\"]);\n assert.deepEqual(candidate([1.2]),[\"D+\"]);\n assert.deepEqual(candidate([0.5]),[\"D-\"]);\n assert.deepEqual(candidate([0.0]),[\"E\"]);\n assert.deepEqual(candidate([1.0, 0.3, 1.5, 2.8, 3.3]),[\"D\", \"D-\", \"C-\", \"B\", \"B+\"]);\n assert.deepEqual(candidate([0.0, 0.7]),[\"E\", \"D-\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "js", - "prompt": "//Given the lengths of the three sides of a triangle. Return the area of\n// the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n// Otherwise return -1\n// Three sides make a valid triangle when the sum of any two sides is greater \n// than the third side.\n// Example:\n// >>> triangle_area(3, 4, 5)\n// 6.0\n// >>> triangle_area(1, 2, 10)\n// -1\nfunction triangle_area(a, b, c){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = triangle_area;\n assert.deepEqual(candidate(3, 4, 5),6.0);\n assert.deepEqual(candidate(1, 2, 10),-1);\n assert.deepEqual(candidate(4, 8, 5),8.18);\n assert.deepEqual(candidate(2, 2, 2),1.73);\n assert.deepEqual(candidate(1, 2, 3),-1);\n assert.deepEqual(candidate(10, 5, 7),16.25);\n assert.deepEqual(candidate(2, 6, 3),-1);\n assert.deepEqual(candidate(1, 1, 1),0.43);\n assert.deepEqual(candidate(2, 2, 10),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "js", - "prompt": "//Check if two words have the same characters.\n// >>> same_chars(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\")\n// true\n// >>> same_chars(\"abcd\", \"dddddddabc\")\n// true\n// >>> same_chars(\"dddddddabc\", \"abcd\")\n// true\n// >>> same_chars(\"eabcd\", \"dddddddabc\")\n// false\n// >>> same_chars(\"abcd\", \"dddddddabce\")\n// false\n// >>> same_chars(\"eabcdzzzz\", \"dddzzzzzzzddddabc\")\n// false\nfunction same_chars(s0, s1){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = same_chars;\n assert.deepEqual(candidate(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\"),true);\n assert.deepEqual(candidate(\"abcd\", \"dddddddabc\"),true);\n assert.deepEqual(candidate(\"dddddddabc\", \"abcd\"),true);\n assert.deepEqual(candidate(\"eabcd\", \"dddddddabc\"),false);\n assert.deepEqual(candidate(\"abcd\", \"dddddddabcf\"),false);\n assert.deepEqual(candidate(\"eabcdzzzz\", \"dddzzzzzzzddddabc\"),false);\n assert.deepEqual(candidate(\"aabb\", \"aaccc\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "js", - "prompt": "//Given an array of integers nums, find the minimum sum of any non-empty sub-array\n// of nums.\n// Example\n// >>> minSubArraySum([2, 3, 4, 1, 2, 4])\n// 1\n// >>> minSubArraySum([-1, -2, -3])\n// -6\nfunction minSubArraySum(nums){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = minSubArraySum;\n assert.deepEqual(candidate([2, 3, 4, 1, 2, 4]),1);\n assert.deepEqual(candidate([-1, -2, -3]),-6);\n assert.deepEqual(candidate([-1, -2, -3, 2, -10]),-14);\n assert.deepEqual(candidate([-9999999999999999]),-9999999999999999);\n assert.deepEqual(candidate([0, 10, 20, 1000000]),0);\n assert.deepEqual(candidate([-1, -2, -3, 10, -5]),-6);\n assert.deepEqual(candidate([100, -1, -2, -3, 10, -5]),-6);\n assert.deepEqual(candidate([10, 11, 13, 8, 3, 4]),3);\n assert.deepEqual(candidate([100, -33, 32, -1, 0, -2]),-33);\n assert.deepEqual(candidate([-10]),-10);\n assert.deepEqual(candidate([7]),7);\n assert.deepEqual(candidate([1, -1]),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "js", - "prompt": "//Given a string s and a natural number n, you have been tasked to implement \n// a function that returns a list of all words from string s that contain exactly \n// n consonants, in order these words appear in the string s.\n// If the string s is empty then the function should return an empty list.\n// Note: you may assume the input string contains only letters and spaces.\n// Examples:\n// >>> select_words(\"Mary had a little lamb\", 4)\n// [\"little\"]\n// >>> select_words(\"Mary had a little lamb\", 3)\n// [\"Mary\", \"lamb\"]\n// >>> select_words(\"simple white space\", 2)\n// []\n// >>> select_words(\"Hello world\", 4)\n// [\"world\"]\n// >>> select_words(\"Uncle sam\", 3)\n// [\"Uncle\"]\nfunction select_words(s, n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = select_words;\n assert.deepEqual(candidate(\"Mary had a little lamb\", 4),[\"little\"]);\n assert.deepEqual(candidate(\"Mary had a little lamb\", 3),[\"Mary\", \"lamb\"]);\n assert.deepEqual(candidate(\"simple white space\", 2),[]);\n assert.deepEqual(candidate(\"Hello world\", 4),[\"world\"]);\n assert.deepEqual(candidate(\"Uncle sam\", 3),[\"Uncle\"]);\n assert.deepEqual(candidate(\"\", 4),[]);\n assert.deepEqual(candidate(\"a b c d e f\", 1),[\"b\", \"c\", \"d\", \"f\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "js", - "prompt": "//Return list of all prefixes from shortest to longest of the input string\n// >>> all_prefixes(\"abc\")\n// [\"a\", \"ab\", \"abc\"]\nfunction all_prefixes(string){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = all_prefixes;\n assert.deepEqual(candidate(\"\"),[]);\n assert.deepEqual(candidate(\"asdfgh\"),[\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"]);\n assert.deepEqual(candidate(\"WWW\"),[\"W\", \"WW\", \"WWW\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "js", - "prompt": "//Create a function that takes a value (string) representing a number\n// and returns the closest integer to it. If the number is equidistant\n// from two integers, round it away from zero.\n// Examples\n// >>> closest_integer(\"10\")\n// 10\n// >>> closest_integer(\"15.3\")\n// 15\n// Note:\n// Rounding away from zero means that if the given number is equidistant\n// from two integers, the one you should return is the one that is the\n// farthest from zero. For example closest_integer(\"14.5\") should\n// return 15 and closest_integer(\"-14.5\") should return -15.\nfunction closest_integer(value){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = closest_integer;\n assert.deepEqual(candidate(\"10\"),10);\n assert.deepEqual(candidate(\"14.5\"),15);\n assert.deepEqual(candidate(\"-15.5\"),-16);\n assert.deepEqual(candidate(\"15.3\"),15);\n assert.deepEqual(candidate(\"0\"),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "js", - "prompt": "//Create a function which takes a string representing a file's name, and returns\n// 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n// A file's name is considered to be valid if and only if all the following conditions \n// are met:\n// - There should not be more than three digits ('0'-'9') in the file's name.\n// - The file's name contains exactly one dot '.'\n// - The substring before the dot should not be empty, and it starts with a letter from \n// the latin alphapet ('a'-'z' and 'A'-'Z').\n// - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n// Examples:\n// >>> file_name_check(\"example.txt\")\n// \"Yes\"\n// >>> file_name_check(\"1example.dll\")\n// \"No\"\nfunction file_name_check(file_name){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = file_name_check;\n assert.deepEqual(candidate(\"example.txt\"),\"Yes\");\n assert.deepEqual(candidate(\"1example.dll\"),\"No\");\n assert.deepEqual(candidate(\"s1sdf3.asd\"),\"No\");\n assert.deepEqual(candidate(\"K.dll\"),\"Yes\");\n assert.deepEqual(candidate(\"MY16FILE3.exe\"),\"Yes\");\n assert.deepEqual(candidate(\"His12FILE94.exe\"),\"No\");\n assert.deepEqual(candidate(\"_Y.txt\"),\"No\");\n assert.deepEqual(candidate(\"?aREYA.exe\"),\"No\");\n assert.deepEqual(candidate(\"/this_is_valid.dll\"),\"No\");\n assert.deepEqual(candidate(\"this_is_valid.wow\"),\"No\");\n assert.deepEqual(candidate(\"this_is_valid.txt\"),\"Yes\");\n assert.deepEqual(candidate(\"this_is_valid.txtexe\"),\"No\");\n assert.deepEqual(candidate(\"#this2_i4s_5valid.ten\"),\"No\");\n assert.deepEqual(candidate(\"@this1_is6_valid.exe\"),\"No\");\n assert.deepEqual(candidate(\"this_is_12valid.6exe4.txt\"),\"No\");\n assert.deepEqual(candidate(\"all.exe.txt\"),\"No\");\n assert.deepEqual(candidate(\"I563_No.exe\"),\"Yes\");\n assert.deepEqual(candidate(\"Is3youfault.txt\"),\"Yes\");\n assert.deepEqual(candidate(\"no_one#knows.dll\"),\"Yes\");\n assert.deepEqual(candidate(\"1I563_Yes3.exe\"),\"No\");\n assert.deepEqual(candidate(\"I563_Yes3.txtt\"),\"No\");\n assert.deepEqual(candidate(\"final..txt\"),\"No\");\n assert.deepEqual(candidate(\"final132\"),\"No\");\n assert.deepEqual(candidate(\"_f4indsartal132.\"),\"No\");\n assert.deepEqual(candidate(\".txt\"),\"No\");\n assert.deepEqual(candidate(\"s.\"),\"No\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "js", - "prompt": "//You are given two intervals,\n// where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n// The given intervals are closed which means that the interval (start, end)\n// includes both start and end.\n// For each given interval, it is assumed that its start is less or equal its end.\n// Your task is to determine whether the length of intersection of these two \n// intervals is a prime number.\n// Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n// which its length is 1, which not a prime number.\n// If the length of the intersection is a prime number, return \"YES\",\n// otherwise, return \"NO\".\n// If the two intervals don't intersect, return \"NO\".\n// [input/output] samples:\n// >>> intersection([1, 2], [2, 3])\n// \"NO\"\n// >>> intersection([-1, 1], [0, 4])\n// \"NO\"\n// >>> intersection([-3, -1], [-5, 5])\n// \"YES\"\nfunction intersection(interval1, interval2){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = intersection;\n assert.deepEqual(candidate([1, 2], [2, 3]),\"NO\");\n assert.deepEqual(candidate([-1, 1], [0, 4]),\"NO\");\n assert.deepEqual(candidate([-3, -1], [-5, 5]),\"YES\");\n assert.deepEqual(candidate([-2, 2], [-4, 0]),\"YES\");\n assert.deepEqual(candidate([-11, 2], [-1, -1]),\"NO\");\n assert.deepEqual(candidate([1, 2], [3, 5]),\"NO\");\n assert.deepEqual(candidate([1, 2], [1, 2]),\"NO\");\n assert.deepEqual(candidate([-2, -2], [-3, -2]),\"NO\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "js", - "prompt": "//Return the largest prime factor of n. Assume n > 1 and is not a prime.\n// >>> largest_prime_factor(13195)\n// 29\n// >>> largest_prime_factor(2048)\n// 2\nfunction largest_prime_factor(n){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = largest_prime_factor;\n assert.deepEqual(candidate(15),5);\n assert.deepEqual(candidate(27),3);\n assert.deepEqual(candidate(63),7);\n assert.deepEqual(candidate(330),11);\n assert.deepEqual(candidate(13195),29);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "js", - "prompt": "//Given a string, find out how many distinct characters (regardless of case) does it consist of\n// >>> count_distinct_characters(\"xyzXYZ\")\n// 3\n// >>> count_distinct_characters(\"Jerry\")\n// 4\nfunction count_distinct_characters(string){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_distinct_characters;\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"abcde\"),5);\n assert.deepEqual(candidate(\"abcdecadeCADE\"),5);\n assert.deepEqual(candidate(\"aaaaAAAAaaaa\"),1);\n assert.deepEqual(candidate(\"Jerry jERRY JeRRRY\"),5);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "js", - "prompt": "//You're given a list of deposit and withdrawal operations on a bank account that starts with\n// zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n// at that point function should return True. Otherwise it should return False.\n// >>> below_zero([1, 2, 3])\n// false\n// >>> below_zero([1, 2, -4, 5])\n// true\nfunction below_zero(operations){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = below_zero;\n assert.deepEqual(candidate([]),false);\n assert.deepEqual(candidate([1, 2, -3, 1, 2, -3]),false);\n assert.deepEqual(candidate([1, 2, -4, 5, 6]),true);\n assert.deepEqual(candidate([1, -1, 2, -2, 5, -5, 4, -4]),false);\n assert.deepEqual(candidate([1, -1, 2, -2, 5, -5, 4, -5]),true);\n assert.deepEqual(candidate([1, -2, 2, -2, 5, -5, 4, -4]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "js", - "prompt": "//Find the shortest palindrome that begins with a supplied string.\n// Algorithm idea is simple:\n// - Find the longest postfix of supplied string that is a palindrome.\n// - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n// >>> make_palindrome(\"\")\n// \"\"\n// >>> make_palindrome(\"cat\")\n// \"catac\"\n// >>> make_palindrome(\"cata\")\n// \"catac\"\nfunction make_palindrome(string){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = make_palindrome;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"x\"),\"x\");\n assert.deepEqual(candidate(\"xyz\"),\"xyzyx\");\n assert.deepEqual(candidate(\"xyx\"),\"xyx\");\n assert.deepEqual(candidate(\"jerry\"),\"jerryrrej\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "js", - "prompt": "//Given a positive integer, obtain its roman numeral equivalent as a string,\n// and return it in lowercase.\n// Restrictions: 1 <= num <= 1000\n// Examples:\n// >>> int_to_mini_roman(19)\n// \"xix\"\n// >>> int_to_mini_roman(152)\n// \"clii\"\n// >>> int_to_mini_roman(426)\n// \"cdxxvi\"\nfunction int_to_mini_roman(number){\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "const assert = require('node:assert');\n\n\nfunction test() {\n let candidate = int_to_mini_roman;\n assert.deepEqual(candidate(19),\"xix\");\n assert.deepEqual(candidate(152),\"clii\");\n assert.deepEqual(candidate(251),\"ccli\");\n assert.deepEqual(candidate(426),\"cdxxvi\");\n assert.deepEqual(candidate(500),\"d\");\n assert.deepEqual(candidate(1),\"i\");\n assert.deepEqual(candidate(4),\"iv\");\n assert.deepEqual(candidate(43),\"xliii\");\n assert.deepEqual(candidate(90),\"xc\");\n assert.deepEqual(candidate(94),\"xciv\");\n assert.deepEqual(candidate(532),\"dxxxii\");\n assert.deepEqual(candidate(900),\"cm\");\n assert.deepEqual(candidate(994),\"cmxciv\");\n assert.deepEqual(candidate(1000),\"m\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nconsole.log" - ] - } -] \ No newline at end of file diff --git a/data/lua-keep.json b/data/lua-keep.json deleted file mode 100644 index d7ce8a2113e9df956d219b6e6bcf73dbe53cc5e1..0000000000000000000000000000000000000000 --- a/data/lua-keep.json +++ /dev/null @@ -1,2417 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "lua", - "prompt": "-- For a given number n, find the largest number that divides n evenly, smaller than n\n-- >>> largest_divisor(15)\n-- 5\nlocal function largest_divisor(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = largest_divisor\n lu.assertEquals(candidate(3), 1)\n lu.assertEquals(candidate(7), 1)\n lu.assertEquals(candidate(10), 5)\n lu.assertEquals(candidate(100), 50)\n lu.assertEquals(candidate(49), 7)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_47_median", - "language": "lua", - "prompt": "-- Return median of elements in the list l.\n-- >>> median([3, 1, 2, 4, 5])\n-- 3\n-- >>> median([-10, 4, 6, 1000, 10, 20])\n-- 15.0\nlocal function median(l)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = median\n lu.assertEquals(candidate({3, 1, 2, 4, 5}), 3)\n lu.assertEquals(candidate({-10, 4, 6, 1000, 10, 20}), 8.0)\n lu.assertEquals(candidate({5}), 5)\n lu.assertEquals(candidate({6, 5}), 5.5)\n lu.assertEquals(candidate({8, 1, 3, 9, 9, 2, 7}), 7)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "lua", - "prompt": "-- Given two lists operator, and operand. The first list has basic algebra operations, and \n-- the second list is a list of integers. Use the two given lists to build the algebric \n-- expression and return the evaluation of this expression.\n-- The basic algebra operations:\n-- Addition ( + ) \n-- Subtraction ( - ) \n-- Multiplication ( * ) \n-- Floor division ( // ) \n-- Exponentiation ( ** ) \n-- Example:\n-- operator['+', '*', '-']\n-- array = [2, 3, 4, 5]\n-- result = 2 + 3 * 4 - 5\n-- => result = 9\n-- Note:\n-- The length of operator list is equal to the length of operand list minus one.\n-- Operand is a list of of non-negative integers.\n-- Operator list has at least one operator, and operand list has at least two operands.\nlocal function do_algebra(operator, operand)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = do_algebra\n lu.assertEquals(candidate({'**', '*', '+'}, {2, 3, 4, 5}), 37)\n lu.assertEquals(candidate({'+', '*', '-'}, {2, 3, 4, 5}), 9)\n lu.assertEquals(candidate({'//', '*'}, {7, 3, 4}), 8)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "lua", - "prompt": "-- Return maximum element in the list.\n-- >>> max_element([1, 2, 3])\n-- 3\n-- >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n-- 123\nlocal function max_element(l)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = max_element\n lu.assertEquals(candidate({1, 2, 3}), 3)\n lu.assertEquals(candidate({5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10}), 124)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "lua", - "prompt": "-- Create a function which returns the largest index of an element which\n-- is not greater than or equal to the element immediately preceding it. If\n-- no such element exists then return -1. The given array will not contain\n-- duplicate values.\n-- Examples:\n-- can_arrange([1,2,4,3,5]) = 3\n-- can_arrange([1,2,3]) = -1\nlocal function can_arrange(arr)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = can_arrange\n lu.assertEquals(candidate({1, 2, 4, 3, 5}), 3)\n lu.assertEquals(candidate({1, 2, 4, 5}), -1)\n lu.assertEquals(candidate({1, 4, 2, 5, 6, 7, 8, 9, 10}), 2)\n lu.assertEquals(candidate({4, 8, 5, 7, 3}), 4)\n lu.assertEquals(candidate({}), -1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "lua", - "prompt": "-- Imagine a road that's a perfectly straight infinitely long line.\n-- n cars are driving left to right; simultaneously, a different set of n cars\n-- are driving right to left. The two sets of cars start out being very far from\n-- each other. All cars move in the same speed. Two cars are said to collide\n-- when a car that's moving left to right hits a car that's moving right to left.\n-- However, the cars are infinitely sturdy and strong; as a result, they continue moving\n-- in their trajectory as if they did not collide.\n-- This function outputs the number of such collisions.\nlocal function car_race_collision(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = car_race_collision\n lu.assertEquals(candidate(2), 4)\n lu.assertEquals(candidate(3), 9)\n lu.assertEquals(candidate(4), 16)\n lu.assertEquals(candidate(8), 64)\n lu.assertEquals(candidate(10), 100)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "lua", - "prompt": "-- Create a function that returns True if the last character\n-- of a given string is an alphabetical character and is not\n-- a part of a word, and False otherwise.\n-- Note: \"word\" is a group of characters separated by space.\n-- Examples:\n-- check_if_last_char_is_a_letter(\"apple pie\") \u279e False\n-- check_if_last_char_is_a_letter(\"apple pi e\") \u279e True\n-- check_if_last_char_is_a_letter(\"apple pi e \") \u279e False\n-- check_if_last_char_is_a_letter(\"\") \u279e False\nlocal function check_if_last_char_is_a_letter(txt)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = check_if_last_char_is_a_letter\n lu.assertEquals(candidate('apple'), false)\n lu.assertEquals(candidate('apple pi e'), true)\n lu.assertEquals(candidate('eeeee'), false)\n lu.assertEquals(candidate('A'), true)\n lu.assertEquals(candidate('Pumpkin pie '), false)\n lu.assertEquals(candidate('Pumpkin pie 1'), false)\n lu.assertEquals(candidate(''), false)\n lu.assertEquals(candidate('eeeee e '), false)\n lu.assertEquals(candidate('apple pie'), false)\n lu.assertEquals(candidate('apple pi e '), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "lua", - "prompt": "-- Return true if a given number is prime, and false otherwise.\n-- >>> is_prime(6)\n-- False\n-- >>> is_prime(101)\n-- True\n-- >>> is_prime(11)\n-- True\n-- >>> is_prime(13441)\n-- True\n-- >>> is_prime(61)\n-- True\n-- >>> is_prime(4)\n-- False\n-- >>> is_prime(1)\n-- False\nlocal function is_prime(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_prime\n lu.assertEquals(candidate(6), false)\n lu.assertEquals(candidate(101), true)\n lu.assertEquals(candidate(11), true)\n lu.assertEquals(candidate(13441), true)\n lu.assertEquals(candidate(61), true)\n lu.assertEquals(candidate(4), false)\n lu.assertEquals(candidate(1), false)\n lu.assertEquals(candidate(5), true)\n lu.assertEquals(candidate(11), true)\n lu.assertEquals(candidate(17), true)\n lu.assertEquals(candidate(85), false)\n lu.assertEquals(candidate(77), false)\n lu.assertEquals(candidate(255379), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "lua", - "prompt": "-- Given a list of positive integers x. return a sorted list of all \n-- elements that hasn't any even digit.\n-- Note: Returned list should be sorted in increasing order.\n-- For example:\n-- >>> unique_digits([15, 33, 1422, 1])\n-- [1, 15, 33]\n-- >>> unique_digits([152, 323, 1422, 10])\n-- []\nlocal function unique_digits(x)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = unique_digits\n lu.assertEquals(candidate({15, 33, 1422, 1}), {1, 15, 33})\n lu.assertEquals(candidate({152, 323, 1422, 10}), {})\n lu.assertEquals(candidate({12345, 2033, 111, 151}), {111, 151})\n lu.assertEquals(candidate({135, 103, 31}), {31, 135})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "lua", - "prompt": "-- Input are two strings a and b consisting only of 1s and 0s.\n-- Perform binary XOR on these inputs and return result also as a string.\n-- >>> string_xor('010', '110')\n-- '100'\nlocal function string_xor(a, b)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = string_xor\n lu.assertEquals(candidate('111000', '101010'), '010010')\n lu.assertEquals(candidate('1', '1'), '0')\n lu.assertEquals(candidate('0101', '0000'), '0101')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "lua", - "prompt": "-- sum_to_n is a function that sums numbers from 1 to n.\n-- >>> sum_to_n(30)\n-- 465\n-- >>> sum_to_n(100)\n-- 5050\n-- >>> sum_to_n(5)\n-- 15\n-- >>> sum_to_n(10)\n-- 55\n-- >>> sum_to_n(1)\n-- 1\nlocal function sum_to_n(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sum_to_n\n lu.assertEquals(candidate(1), 1)\n lu.assertEquals(candidate(6), 21)\n lu.assertEquals(candidate(11), 66)\n lu.assertEquals(candidate(30), 465)\n lu.assertEquals(candidate(100), 5050)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "lua", - "prompt": "-- Given a list of numbers, return the sum of squares of the numbers\n-- in the list that are odd. Ignore numbers that are negative or not integers.\n-- double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10\n-- double_the_difference([-1, -2, 0]) == 0\n-- double_the_difference([9, -2]) == 81\n-- double_the_difference([0]) == 0 \n-- If the input list is empty, return 0.\nlocal function double_the_difference(lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = double_the_difference\n lu.assertEquals(candidate({}), 0)\n lu.assertEquals(candidate({5.0, 4.0}), 25)\n lu.assertEquals(candidate({0.1, 0.2, 0.3}), 0)\n lu.assertEquals(candidate({-10.0, -20.0, -30.0}), 0)\n lu.assertEquals(candidate({-1.0, -2.0, 8.0}), 0)\n lu.assertEquals(candidate({0.2, 3.0, 5.0}), 34)\n lu.assertEquals(candidate({-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0}), 165)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "lua", - "prompt": "-- Return length of given string\n-- >>> strlen('')\n-- 0\n-- >>> strlen('abc')\n-- 3\nlocal function strlen(string)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = strlen\n lu.assertEquals(candidate(''), 0)\n lu.assertEquals(candidate('x'), 1)\n lu.assertEquals(candidate('asdasnakj'), 9)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "lua", - "prompt": "-- You'll be given a string of words, and your task is to count the number\n-- of boredoms. A boredom is a sentence that starts with the word \"I\".\n-- Sentences are delimited by '.', '?' or '!'.\n-- For example:\n-- >>> is_bored(\"Hello world\")\n-- 0\n-- >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n-- 1\nlocal function is_bored(S)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_bored\n lu.assertEquals(candidate('Hello world'), 0)\n lu.assertEquals(candidate('Is the sky blue?'), 0)\n lu.assertEquals(candidate('I love It !'), 1)\n lu.assertEquals(candidate('bIt'), 0)\n lu.assertEquals(candidate('I feel good today. I will be productive. will kill It'), 2)\n lu.assertEquals(candidate('You and I are going for a walk'), 0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "lua", - "prompt": "-- Write a function vowels_count which takes a string representing\n-- a word as input and returns the number of vowels in the string.\n-- Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n-- vowel, but only when it is at the end of the given word.\n-- Example:\n-- >>> vowels_count(\"abcde\")\n-- 2\n-- >>> vowels_count(\"ACEDY\")\n-- 3\nlocal function vowels_count(s)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = vowels_count\n lu.assertEquals(candidate('abcde'), 2)\n lu.assertEquals(candidate('Alone'), 3)\n lu.assertEquals(candidate('key'), 2)\n lu.assertEquals(candidate('bye'), 1)\n lu.assertEquals(candidate('keY'), 2)\n lu.assertEquals(candidate('bYe'), 1)\n lu.assertEquals(candidate('ACEDY'), 3)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "lua", - "prompt": "-- Return n-th Fibonacci number.\n-- >>> fib(10)\n-- 55\n-- >>> fib(1)\n-- 1\n-- >>> fib(8)\n-- 21\nlocal function fib(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = fib\n lu.assertEquals(candidate(10), 55)\n lu.assertEquals(candidate(1), 1)\n lu.assertEquals(candidate(8), 21)\n lu.assertEquals(candidate(11), 89)\n lu.assertEquals(candidate(12), 144)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "lua", - "prompt": "-- Your task is to implement a function that will simplify the expression\n-- x * n. The function returns True if x * n evaluates to a whole number and False\n-- otherwise. Both x and n, are string representation of a fraction, and have the following format,\n-- / where both numerator and denominator are positive whole numbers.\n-- You can assume that x, and n are valid fractions, and do not have zero as denominator.\n-- simplify(\"1/5\", \"5/1\") = True\n-- simplify(\"1/6\", \"2/1\") = False\n-- simplify(\"7/10\", \"10/2\") = False\nlocal function simplify(x, n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = simplify\n lu.assertEquals(candidate('1/5', '5/1'), true)\n lu.assertEquals(candidate('1/6', '2/1'), false)\n lu.assertEquals(candidate('5/1', '3/1'), true)\n lu.assertEquals(candidate('7/10', '10/2'), false)\n lu.assertEquals(candidate('2/10', '50/10'), true)\n lu.assertEquals(candidate('7/2', '4/2'), true)\n lu.assertEquals(candidate('11/6', '6/1'), true)\n lu.assertEquals(candidate('2/3', '5/2'), false)\n lu.assertEquals(candidate('5/2', '3/5'), false)\n lu.assertEquals(candidate('2/4', '8/4'), true)\n lu.assertEquals(candidate('2/4', '4/2'), true)\n lu.assertEquals(candidate('1/5', '5/1'), true)\n lu.assertEquals(candidate('1/5', '1/5'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "lua", - "prompt": "-- Given a string s, count the number of uppercase vowels in even indices.\n-- For example:\n-- count_upper('aBCdEf') returns 1\n-- count_upper('abcdefg') returns 0\n-- count_upper('dBBE') returns 0\nlocal function count_upper(s)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = count_upper\n lu.assertEquals(candidate('aBCdEf'), 1)\n lu.assertEquals(candidate('abcdefg'), 0)\n lu.assertEquals(candidate('dBBE'), 0)\n lu.assertEquals(candidate('B'), 0)\n lu.assertEquals(candidate('U'), 1)\n lu.assertEquals(candidate(''), 0)\n lu.assertEquals(candidate('EEEE'), 2)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "lua", - "prompt": "-- You are given a rectangular grid of wells. Each row represents a single well,\n-- and each 1 in a row represents a single unit of water.\n-- Each well has a corresponding bucket that can be used to extract water from it, \n-- and all buckets have the same capacity.\n-- Your task is to use the buckets to empty the wells.\n-- Output the number of times you need to lower the buckets.\n-- Example 1:\n-- Input: \n-- grid : [[0,0,1,0], [0,1,0,0], [1,1,1,1]]\n-- bucket_capacity : 1\n-- Output: 6\n-- Example 2:\n-- Input: \n-- grid : [[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]]\n-- bucket_capacity : 2\n-- Output: 5\n-- Example 3:\n-- Input: \n-- grid : [[0,0,0], [0,0,0]]\n-- bucket_capacity : 5\n-- Output: 0\n-- Constraints:\n-- * all wells have the same length\n-- * 1 <= grid.length <= 10^2\n-- * 1 <= grid[:,1].length <= 10^2\n-- * grid[i][j] -> 0 | 1\n-- * 1 <= capacity <= 10\nlocal function max_fill(grid, capacity)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = max_fill\n lu.assertEquals(candidate({{0, 0, 1, 0}, {0, 1, 0, 0}, {1, 1, 1, 1}}, 1), 6)\n lu.assertEquals(candidate({{0, 0, 1, 1}, {0, 0, 0, 0}, {1, 1, 1, 1}, {0, 1, 1, 1}}, 2), 5)\n lu.assertEquals(candidate({{0, 0, 0}, {0, 0, 0}}, 5), 0)\n lu.assertEquals(candidate({{1, 1, 1, 1}, {1, 1, 1, 1}}, 2), 4)\n lu.assertEquals(candidate({{1, 1, 1, 1}, {1, 1, 1, 1}}, 9), 2)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "lua", - "prompt": "-- Given an array arr of integers and a positive integer k, return a sorted list \n-- of length k with the maximum k numbers in arr.\n-- Example 1:\n-- Input: arr = [-3, -4, 5], k = 3\n-- Output: [-4, -3, 5]\n-- Example 2:\n-- Input: arr = [4, -4, 4], k = 2\n-- Output: [4, 4]\n-- Example 3:\n-- Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1\n-- Output: [2]\n-- Note:\n-- 1. The length of the array will be in the range of [1, 1000].\n-- 2. The elements in the array will be in the range of [-1000, 1000].\n-- 3. 0 <= k <= len(arr)\nlocal function maximum(arr, k)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = maximum\n lu.assertEquals(candidate({-3, -4, 5}, 3), {-4, -3, 5})\n lu.assertEquals(candidate({4, -4, 4}, 2), {4, 4})\n lu.assertEquals(candidate({-3, 2, 1, 2, -1, -2, 1}, 1), {2})\n lu.assertEquals(candidate({123, -123, 20, 0, 1, 2, -3}, 3), {2, 20, 123})\n lu.assertEquals(candidate({-123, 20, 0, 1, 2, -3}, 4), {0, 1, 2, 20})\n lu.assertEquals(candidate({5, 15, 0, 3, -13, -8, 0}, 7), {-13, -8, 0, 0, 3, 5, 15})\n lu.assertEquals(candidate({-1, 0, 2, 5, 3, -10}, 2), {3, 5})\n lu.assertEquals(candidate({1, 0, 5, -7}, 1), {5})\n lu.assertEquals(candidate({4, -4}, 2), {-4, 4})\n lu.assertEquals(candidate({-10, 10}, 2), {-10, 10})\n lu.assertEquals(candidate({1, 2, 3, -23, 243, -400, 0}, 0), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "lua", - "prompt": "-- Write a function that takes a message, and encodes in such a \n-- way that it swaps case of all letters, replaces all vowels in \n-- the message with the letter that appears 2 places ahead of that \n-- vowel in the english alphabet. \n-- Assume only letters. \n-- Examples:\n-- >>> encode('test')\n-- 'TGST'\n-- >>> encode('This is a message')\n-- 'tHKS KS C MGSSCGG'\nlocal function encode(message)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = encode\n lu.assertEquals(candidate('TEST'), 'tgst')\n lu.assertEquals(candidate('Mudasir'), 'mWDCSKR')\n lu.assertEquals(candidate('YES'), 'ygs')\n lu.assertEquals(candidate('This is a message'), 'tHKS KS C MGSSCGG')\n lu.assertEquals(candidate('I DoNt KnOw WhAt tO WrItE'), 'k dQnT kNqW wHcT Tq wRkTg')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "lua", - "prompt": "-- remove_vowels is a function that takes string and returns string without vowels.\n-- >>> remove_vowels('')\n-- ''\n-- >>> remove_vowels('abcdef')\n-- 'bcdf'\n-- >>> remove_vowels('aaaaa')\n-- ''\n-- >>> remove_vowels('aaBAA')\n-- 'B'\n-- >>> remove_vowels('zbcd')\n-- 'zbcd'\nlocal function remove_vowels(text)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = remove_vowels\n lu.assertEquals(candidate(''), '')\n lu.assertEquals(candidate('abcdef\\nghijklm'), 'bcdf\\nghjklm')\n lu.assertEquals(candidate('fedcba'), 'fdcb')\n lu.assertEquals(candidate('eeeee'), '')\n lu.assertEquals(candidate('acBAA'), 'cB')\n lu.assertEquals(candidate('EcBOO'), 'cB')\n lu.assertEquals(candidate('ybcd'), 'ybcd')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "lua", - "prompt": "-- Return only positive numbers in the list.\n-- >>> get_positive([-1, 2, -4, 5, 6])\n-- [2, 5, 6]\n-- >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n-- [5, 3, 2, 3, 9, 123, 1]\nlocal function get_positive(l)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = get_positive\n lu.assertEquals(candidate({-1, -2, 4, 5, 6}), {4, 5, 6})\n lu.assertEquals(candidate({5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10}), {5, 3, 2, 3, 3, 9, 123, 1})\n lu.assertEquals(candidate({-1, -2}), {})\n lu.assertEquals(candidate({}), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "lua", - "prompt": "-- Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n-- >>> string_sequence(0)\n-- '0'\n-- >>> string_sequence(5)\n-- '0 1 2 3 4 5'\nlocal function string_sequence(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = string_sequence\n lu.assertEquals(candidate(0), '0')\n lu.assertEquals(candidate(3), '0 1 2 3')\n lu.assertEquals(candidate(10), '0 1 2 3 4 5 6 7 8 9 10')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "lua", - "prompt": "-- Given a positive integer n, you have to make a pile of n levels of stones.\n-- The first level has n stones.\n-- The number of stones in the next level is:\n-- - the next odd number if n is odd.\n-- - the next even number if n is even.\n-- Return the number of stones in each level in a list, where element at index\n-- i represents the number of stones in the level (i+1).\n-- Examples:\n-- >>> make_a_pile(3)\n-- [3, 5, 7]\nlocal function make_a_pile(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = make_a_pile\n lu.assertEquals(candidate(3), {3, 5, 7})\n lu.assertEquals(candidate(4), {4, 6, 8, 10})\n lu.assertEquals(candidate(5), {5, 7, 9, 11, 13})\n lu.assertEquals(candidate(6), {6, 8, 10, 12, 14, 16})\n lu.assertEquals(candidate(8), {8, 10, 12, 14, 16, 18, 20, 22})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "lua", - "prompt": "-- Task\n-- 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\n-- then check if the result string is palindrome.\n-- A string is called palindrome if it reads the same backward as forward.\n-- You should return a tuple containing the result string and True/False for the check.\n-- Example\n-- For s = \"abcde\", c = \"ae\", the result should be ('bcd',False)\n-- For s = \"abcdef\", c = \"b\" the result should be ('acdef',False)\n-- For s = \"abcdedcba\", c = \"ab\", the result should be ('cdedc',True)\nlocal function reverse_delete(s, c)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = reverse_delete\n lu.assertEquals(candidate('abcde', 'ae'), {'bcd', false})\n lu.assertEquals(candidate('abcdef', 'b'), {'acdef', false})\n lu.assertEquals(candidate('abcdedcba', 'ab'), {'cdedc', true})\n lu.assertEquals(candidate('dwik', 'w'), {'dik', false})\n lu.assertEquals(candidate('a', 'a'), {'', true})\n lu.assertEquals(candidate('abcdedcba', ''), {'abcdedcba', true})\n lu.assertEquals(candidate('abcdedcba', 'v'), {'abcdedcba', true})\n lu.assertEquals(candidate('vabba', 'v'), {'abba', true})\n lu.assertEquals(candidate('mamma', 'mia'), {'', true})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "lua", - "prompt": "-- For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n-- >>> flip_case('Hello')\n-- 'hELLO'\nlocal function flip_case(string)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = flip_case\n lu.assertEquals(candidate(''), '')\n lu.assertEquals(candidate('Hello!'), 'hELLO!')\n lu.assertEquals(candidate('These violent delights have violent ends'), 'tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "lua", - "prompt": "-- You are given a string s.\n-- if s[i] is a letter, reverse its case from lower to upper or vise versa, \n-- otherwise keep it as it is.\n-- If the string contains no letters, reverse the string.\n-- The function should return the resulted string.\n-- Examples\n-- solve(\"1234\") = \"4321\"\n-- solve(\"ab\") = \"AB\"\n-- solve(\"#a@C\") = \"#A@c\"\nlocal function solve(s)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = solve\n lu.assertEquals(candidate('AsDf'), 'aSdF')\n lu.assertEquals(candidate('1234'), '4321')\n lu.assertEquals(candidate('ab'), 'AB')\n lu.assertEquals(candidate('#a@C'), '#A@c')\n lu.assertEquals(candidate('#AsdfW^45'), '#aSDFw^45')\n lu.assertEquals(candidate('#6@2'), '2@6#')\n lu.assertEquals(candidate('#$a^D'), '#$A^d')\n lu.assertEquals(candidate('#ccc'), '#CCC')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "lua", - "prompt": "-- Filter an input list of strings only for ones that start with a given prefix.\n-- >>> filter_by_prefix([], 'a')\n-- []\n-- >>> filter_by_prefix(['abc', 'bcd', 'cde', 'array'], 'a')\n-- ['abc', 'array']\nlocal function filter_by_prefix(strings, prefix)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = filter_by_prefix\n lu.assertEquals(candidate({}, 'john'), {})\n lu.assertEquals(candidate({'xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'}, 'xxx'), {'xxx', 'xxxAAA', 'xxx'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "lua", - "prompt": "-- This function takes two positive numbers x and y and returns the\n-- biggest even integer number that is in the range [x, y] inclusive. If \n-- there's no such number, then the function should return -1.\n-- For example:\n-- choose_num(12, 15) = 14\n-- choose_num(13, 12) = -1\nlocal function choose_num(x, y)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = choose_num\n lu.assertEquals(candidate(12, 15), 14)\n lu.assertEquals(candidate(13, 12), -1)\n lu.assertEquals(candidate(33, 12354), 12354)\n lu.assertEquals(candidate(5234, 5233), -1)\n lu.assertEquals(candidate(6, 29), 28)\n lu.assertEquals(candidate(27, 10), -1)\n lu.assertEquals(candidate(7, 7), -1)\n lu.assertEquals(candidate(546, 546), 546)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "lua", - "prompt": "-- You are given a string representing a sentence,\n-- the sentence contains some words separated by a space,\n-- and you have to return a string that contains the words from the original sentence,\n-- whose lengths are prime numbers,\n-- the order of the words in the new string should be the same as the original one.\n-- Example 1:\n-- Input: sentence = \"This is a test\"\n-- Output: \"is\"\n-- Example 2:\n-- Input: sentence = \"lets go for swimming\"\n-- Output: \"go for\"\n-- Constraints:\n-- * 1 <= len(sentence) <= 100\n-- * sentence contains only letters\nlocal function words_in_sentence(sentence)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = words_in_sentence\n lu.assertEquals(candidate('This is a test'), 'is')\n lu.assertEquals(candidate('lets go for swimming'), 'go for')\n lu.assertEquals(candidate('there is no place available here'), 'there is no place')\n lu.assertEquals(candidate('Hi I am Hussein'), 'Hi am Hussein')\n lu.assertEquals(candidate('go for it'), 'go for it')\n lu.assertEquals(candidate('here'), '')\n lu.assertEquals(candidate('here is'), 'is')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "lua", - "prompt": "-- Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n-- >>> intersperse([], 4)\n-- []\n-- >>> intersperse([1, 2, 3], 4)\n-- [1, 4, 2, 4, 3]\nlocal function intersperse(numbers, delimeter)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = intersperse\n lu.assertEquals(candidate({}, 7), {})\n lu.assertEquals(candidate({5, 6, 3, 2}, 8), {5, 8, 6, 8, 3, 8, 2})\n lu.assertEquals(candidate({2, 2, 2}, 2), {2, 2, 2, 2, 2})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "lua", - "prompt": "-- Your task is to write a function that returns true if a number x is a simple\n-- power of n and false in other cases.\n-- x is a simple power of n if n**int=x\n-- For example:\n-- is_simple_power(1, 4) => true\n-- is_simple_power(2, 2) => true\n-- is_simple_power(8, 2) => true\n-- is_simple_power(3, 2) => false\n-- is_simple_power(3, 1) => false\n-- is_simple_power(5, 3) => false\nlocal function is_simple_power(x, n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_simple_power\n lu.assertEquals(candidate(16, 2), true)\n lu.assertEquals(candidate(143214, 16), false)\n lu.assertEquals(candidate(4, 2), true)\n lu.assertEquals(candidate(9, 3), true)\n lu.assertEquals(candidate(16, 4), true)\n lu.assertEquals(candidate(24, 2), false)\n lu.assertEquals(candidate(128, 4), false)\n lu.assertEquals(candidate(12, 6), false)\n lu.assertEquals(candidate(1, 1), true)\n lu.assertEquals(candidate(1, 12), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "lua", - "prompt": "-- Write a function that returns true if the given number is the multiplication of 3 prime numbers\n-- and false otherwise.\n-- Knowing that (a) is less then 100. \n-- Example:\n-- is_multiply_prime(30) == True\n-- 30 = 2 * 3 * 5\nlocal function is_multiply_prime(a)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_multiply_prime\n lu.assertEquals(candidate(5), false)\n lu.assertEquals(candidate(30), true)\n lu.assertEquals(candidate(8), true)\n lu.assertEquals(candidate(10), false)\n lu.assertEquals(candidate(125), true)\n lu.assertEquals(candidate(105), true)\n lu.assertEquals(candidate(126), false)\n lu.assertEquals(candidate(729), false)\n lu.assertEquals(candidate(891), false)\n lu.assertEquals(candidate(1001), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "lua", - "prompt": "-- Given the lengths of the three sides of a triangle. Return True if the three\n-- sides form a right-angled triangle, False otherwise.\n-- A right-angled triangle is a triangle in which one angle is right angle or \n-- 90 degree.\n-- Example:\n-- right_angle_triangle(3, 4, 5) == True\n-- right_angle_triangle(1, 2, 3) == False\nlocal function right_angle_triangle(a, b, c)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = right_angle_triangle\n lu.assertEquals(candidate(3, 4, 5), true)\n lu.assertEquals(candidate(1, 2, 3), false)\n lu.assertEquals(candidate(10, 6, 8), true)\n lu.assertEquals(candidate(2, 2, 2), false)\n lu.assertEquals(candidate(7, 24, 25), true)\n lu.assertEquals(candidate(10, 5, 7), false)\n lu.assertEquals(candidate(5, 12, 13), true)\n lu.assertEquals(candidate(15, 8, 17), true)\n lu.assertEquals(candidate(48, 55, 73), true)\n lu.assertEquals(candidate(1, 1, 1), false)\n lu.assertEquals(candidate(2, 2, 10), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "lua", - "prompt": "-- Create a function that takes 3 numbers.\n-- Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n-- Returns false in any other cases.\n-- Examples\n-- any_int(5, 2, 7) \u279e True\n-- any_int(3, 2, 2) \u279e False\n-- any_int(3, -2, 1) \u279e True\n-- any_int(3.6, -2.2, 2) \u279e False\nlocal function any_int(x, y, z)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = any_int\n lu.assertEquals(candidate(2, 3, 1), true)\n lu.assertEquals(candidate(2.5, 2, 3), false)\n lu.assertEquals(candidate(1.5, 5, 3.5), false)\n lu.assertEquals(candidate(2, 6, 2), false)\n lu.assertEquals(candidate(4, 2, 2), true)\n lu.assertEquals(candidate(2.2, 2.2, 2.2), false)\n lu.assertEquals(candidate(-4, 6, 2), true)\n lu.assertEquals(candidate(2, 1, 1), true)\n lu.assertEquals(candidate(3, 4, 7), true)\n lu.assertEquals(candidate(3.0, 4, 7), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "lua", - "prompt": "-- This function takes a list l and returns a list l' such that\n-- l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n-- to the values of the corresponding indicies of l, but sorted.\n-- >>> sort_third([1, 2, 3])\n-- [1, 2, 3]\n-- >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n-- [2, 6, 3, 4, 8, 9, 5]\nlocal function sort_third(l)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sort_third\n lu.assertEquals(candidate({5, 6, 3, 4, 8, 9, 2}), {2, 6, 3, 4, 8, 9, 5})\n lu.assertEquals(candidate({5, 8, 3, 4, 6, 9, 2}), {2, 8, 3, 4, 6, 9, 5})\n lu.assertEquals(candidate({5, 6, 9, 4, 8, 3, 2}), {2, 6, 9, 4, 8, 3, 5})\n lu.assertEquals(candidate({5, 6, 3, 4, 8, 9, 2, 1}), {2, 6, 3, 4, 8, 9, 5, 1})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_53_add", - "language": "lua", - "prompt": "-- Add two numbers x and y\n-- >>> add(2, 3)\n-- 5\n-- >>> add(5, 7)\n-- 12\nlocal function add(x, y)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = add\n lu.assertEquals(candidate(0, 1), 1)\n lu.assertEquals(candidate(1, 0), 1)\n lu.assertEquals(candidate(2, 3), 5)\n lu.assertEquals(candidate(5, 7), 12)\n lu.assertEquals(candidate(7, 5), 12)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_69_search", - "language": "lua", - "prompt": "-- You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n-- zero, and has a frequency greater than or equal to the value of the integer itself. \n-- The frequency of an integer is the number of times it appears in the list.\n-- If no such a value exist, return -1.\n-- Examples:\n-- search([4, 1, 2, 2, 3, 1]) == 2\n-- search([1, 2, 2, 3, 3, 3, 4, 4, 4]) == 3\n-- search([5, 5, 4, 4, 4]) == -1\nlocal function search(lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = search\n lu.assertEquals(candidate({5, 5, 5, 5, 1}), 1)\n lu.assertEquals(candidate({4, 1, 4, 1, 4, 4}), 4)\n lu.assertEquals(candidate({3, 3}), -1)\n lu.assertEquals(candidate({8, 8, 8, 8, 8, 8, 8, 8}), 8)\n lu.assertEquals(candidate({2, 3, 3, 2, 2}), 2)\n lu.assertEquals(candidate({2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1}), 1)\n lu.assertEquals(candidate({3, 2, 8, 2}), 2)\n lu.assertEquals(candidate({6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10}), 1)\n lu.assertEquals(candidate({8, 8, 3, 6, 5, 6, 4}), -1)\n lu.assertEquals(candidate({6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9}), 1)\n lu.assertEquals(candidate({1, 9, 10, 1, 3}), 1)\n lu.assertEquals(candidate({6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10}), 5)\n lu.assertEquals(candidate({1}), 1)\n lu.assertEquals(candidate({8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5}), 4)\n lu.assertEquals(candidate({2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10}), 2)\n lu.assertEquals(candidate({1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3}), 1)\n lu.assertEquals(candidate({9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4}), 4)\n lu.assertEquals(candidate({2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7}), 4)\n lu.assertEquals(candidate({9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1}), 2)\n lu.assertEquals(candidate({5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8}), -1)\n lu.assertEquals(candidate({10}), -1)\n lu.assertEquals(candidate({9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2}), 2)\n lu.assertEquals(candidate({5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8}), 1)\n lu.assertEquals(candidate({7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6}), 1)\n lu.assertEquals(candidate({3, 10, 10, 9, 2}), -1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "lua", - "prompt": "-- Write a function that takes a string and returns True if the string\n-- length is a prime number or False otherwise\n-- Examples\n-- prime_length('Hello') == True\n-- prime_length('abcdcba') == True\n-- prime_length('kittens') == True\n-- prime_length('orange') == False\nlocal function prime_length(string)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = prime_length\n lu.assertEquals(candidate('Hello'), true)\n lu.assertEquals(candidate('abcdcba'), true)\n lu.assertEquals(candidate('kittens'), true)\n lu.assertEquals(candidate('orange'), false)\n lu.assertEquals(candidate('wow'), true)\n lu.assertEquals(candidate('world'), true)\n lu.assertEquals(candidate('MadaM'), true)\n lu.assertEquals(candidate('Wow'), true)\n lu.assertEquals(candidate(''), false)\n lu.assertEquals(candidate('HI'), true)\n lu.assertEquals(candidate('go'), true)\n lu.assertEquals(candidate('gogo'), false)\n lu.assertEquals(candidate('aaaaaaaaaaaaaaa'), false)\n lu.assertEquals(candidate('Madam'), true)\n lu.assertEquals(candidate('M'), false)\n lu.assertEquals(candidate('0'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_58_common", - "language": "lua", - "prompt": "-- Return sorted unique common elements for two lists.\n-- >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n-- [1, 5, 653]\n-- >>> common([5, 3, 2, 8], [3, 2])\n-- [2, 3]\nlocal function common(l1, l2)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = common\n lu.assertEquals(candidate({1, 4, 3, 34, 653, 2, 5}, {5, 7, 1, 5, 9, 653, 121}), {1, 5, 653})\n lu.assertEquals(candidate({5, 3, 2, 8}, {3, 2}), {2, 3})\n lu.assertEquals(candidate({4, 3, 2, 8}, {3, 2, 4}), {2, 3, 4})\n lu.assertEquals(candidate({4, 3, 2, 8}, {}), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "lua", - "prompt": "-- The Brazilian factorial is defined as:\n-- brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n-- where n > 0\n-- For example:\n-- >>> special_factorial(4)\n-- 288\n-- The function will receive an integer as input and should return the special\n-- factorial of this integer.\nlocal function special_factorial(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = special_factorial\n lu.assertEquals(candidate(4), 288)\n lu.assertEquals(candidate(5), 34560)\n lu.assertEquals(candidate(7), 125411328000)\n lu.assertEquals(candidate(1), 1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "lua", - "prompt": "-- In this problem, you will implement a function that takes two lists of numbers,\n-- and determines whether it is possible to perform an exchange of elements\n-- between them to make lst1 a list of only even numbers.\n-- There is no limit on the number of exchanged elements between lst1 and lst2.\n-- If it is possible to exchange elements between the lst1 and lst2 to make\n-- all the elements of lst1 to be even, return \"YES\".\n-- Otherwise, return \"NO\".\n-- For example:\n-- exchange([1, 2, 3, 4], [1, 2, 3, 4]) => \"YES\"\n-- exchange([1, 2, 3, 4], [1, 5, 3, 4]) => \"NO\"\n-- It is assumed that the input lists will be non-empty.\nlocal function exchange(lst1, lst2)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = exchange\n lu.assertEquals(candidate({1, 2, 3, 4}, {1, 2, 3, 4}), 'YES')\n lu.assertEquals(candidate({1, 2, 3, 4}, {1, 5, 3, 4}), 'NO')\n lu.assertEquals(candidate({1, 2, 3, 4}, {2, 1, 4, 3}), 'YES')\n lu.assertEquals(candidate({5, 7, 3}, {2, 6, 4}), 'YES')\n lu.assertEquals(candidate({5, 7, 3}, {2, 6, 3}), 'NO')\n lu.assertEquals(candidate({3, 2, 6, 1, 8, 9}, {3, 5, 5, 1, 1, 1}), 'NO')\n lu.assertEquals(candidate({100, 200}, {200, 200}), 'YES')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "lua", - "prompt": "-- Given a non-empty array of integers arr and an integer k, return\n-- the sum of the elements with at most two digits from the first k elements of arr.\n-- Example:\n-- Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4\n-- Output: 24 # sum of 21 + 3\n-- Constraints:\n-- 1. 1 <= len(arr) <= 100\n-- 2. 1 <= k <= len(arr)\nlocal function add_elements(arr, k)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = add_elements\n lu.assertEquals(candidate({1, -2, -3, 41, 57, 76, 87, 88, 99}, 3), -4)\n lu.assertEquals(candidate({111, 121, 3, 4000, 5, 6}, 2), 0)\n lu.assertEquals(candidate({11, 21, 3, 90, 5, 6, 7, 8, 9}, 4), 125)\n lu.assertEquals(candidate({111, 21, 3, 4000, 5, 6, 7, 8, 9}, 4), 24)\n lu.assertEquals(candidate({1}, 1), 1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "lua", - "prompt": "-- A simple program which should return the value of x if n is \n-- a prime number and should return the value of y otherwise.\n-- Examples:\n-- for x_or_y(7, 34, 12) == 34\n-- for x_or_y(15, 8, 5) == 5\nlocal function x_or_y(n, x, y)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = x_or_y\n lu.assertEquals(candidate(7, 34, 12), 34)\n lu.assertEquals(candidate(15, 8, 5), 5)\n lu.assertEquals(candidate(3, 33, 5212), 33)\n lu.assertEquals(candidate(1259, 3, 52), 3)\n lu.assertEquals(candidate(7919, -1, 12), -1)\n lu.assertEquals(candidate(3609, 1245, 583), 583)\n lu.assertEquals(candidate(91, 56, 129), 129)\n lu.assertEquals(candidate(6, 34, 1234), 1234)\n lu.assertEquals(candidate(1, 2, 0), 0)\n lu.assertEquals(candidate(2, 2, 0), 2)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "lua", - "prompt": "-- Given length of a side and high return area for a triangle.\n-- >>> triangle_area(5, 3)\n-- 7.5\nlocal function triangle_area(a, h)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = triangle_area\n lu.assertEquals(candidate(5, 3), 7.5)\n lu.assertEquals(candidate(2, 2), 2.0)\n lu.assertEquals(candidate(10, 8), 40.0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "lua", - "prompt": "-- Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n-- the last couple centuries. However, what people don't know is Tribonacci sequence.\n-- Tribonacci sequence is defined by the recurrence:\n-- tri(1) = 3\n-- tri(n) = 1 + n / 2, if n is even.\n-- tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n-- For example:\n-- tri(2) = 1 + (2 / 2) = 2\n-- tri(4) = 3\n-- tri(3) = tri(2) + tri(1) + tri(4)\n-- = 2 + 3 + 3 = 8 \n-- You are given a non-negative integer number n, you have to a return a list of the \n-- first n + 1 numbers of the Tribonacci sequence.\n-- Examples:\n-- tri(3) = [1, 3, 2, 8]\nlocal function tri(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = tri\n lu.assertEquals(candidate(3), {1, 3, 2, 8})\n lu.assertEquals(candidate(4), {1, 3, 2, 8, 3})\n lu.assertEquals(candidate(5), {1, 3, 2, 8, 3, 15})\n lu.assertEquals(candidate(6), {1, 3, 2, 8, 3, 15, 4})\n lu.assertEquals(candidate(7), {1, 3, 2, 8, 3, 15, 4, 24})\n lu.assertEquals(candidate(8), {1, 3, 2, 8, 3, 15, 4, 24, 5})\n lu.assertEquals(candidate(9), {1, 3, 2, 8, 3, 15, 4, 24, 5, 35})\n lu.assertEquals(candidate(20), {1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11})\n lu.assertEquals(candidate(0), {1})\n lu.assertEquals(candidate(1), {1, 3})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "lua", - "prompt": "-- You are given a list of two strings, both strings consist of open\n-- parentheses '(' or close parentheses ')' only.\n-- Your job is to check if it is possible to concatenate the two strings in\n-- some order, that the resulting string will be good.\n-- A string S is considered to be good if and only if all parentheses in S\n-- are balanced. For example: the string '(())()' is good, while the string\n-- '())' is not.\n-- Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n-- Examples:\n-- match_parens(['()(', ')']) == 'Yes'\n-- match_parens([')', ')']) == 'No'\nlocal function match_parens(lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = match_parens\n lu.assertEquals(candidate({'()(', ')'}), 'Yes')\n lu.assertEquals(candidate({')', ')'}), 'No')\n lu.assertEquals(candidate({'(()(())', '())())'}), 'No')\n lu.assertEquals(candidate({')())', '(()()('}), 'Yes')\n lu.assertEquals(candidate({'(())))', '(()())(('}), 'Yes')\n lu.assertEquals(candidate({'()', '())'}), 'No')\n lu.assertEquals(candidate({'(()(', '()))()'}), 'Yes')\n lu.assertEquals(candidate({'((((', '((())'}), 'No')\n lu.assertEquals(candidate({')(()', '(()('}), 'No')\n lu.assertEquals(candidate({')(', ')('}), 'No')\n lu.assertEquals(candidate({'(', ')'}), 'Yes')\n lu.assertEquals(candidate({')', '('}), 'Yes')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "lua", - "prompt": "-- From a list of integers, remove all elements that occur more than once.\n-- Keep order of elements left the same as in the input.\n-- >>> remove_duplicates([1, 2, 3, 2, 4])\n-- [1, 3, 4]\nlocal function remove_duplicates(numbers)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = remove_duplicates\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({1, 2, 3, 4}), {1, 2, 3, 4})\n lu.assertEquals(candidate({1, 2, 3, 2, 4, 3, 5}), {1, 4, 5})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "lua", - "prompt": "-- Return a greatest common divisor of two integers a and b\n-- >>> greatest_common_divisor(3, 5)\n-- 1\n-- >>> greatest_common_divisor(25, 15)\n-- 5\nlocal function greatest_common_divisor(a, b)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = greatest_common_divisor\n lu.assertEquals(candidate(3, 7), 1)\n lu.assertEquals(candidate(10, 15), 5)\n lu.assertEquals(candidate(49, 14), 7)\n lu.assertEquals(candidate(144, 60), 12)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "lua", - "prompt": "-- Checks if given string is a palindrome\n-- >>> is_palindrome('')\n-- True\n-- >>> is_palindrome('aba')\n-- True\n-- >>> is_palindrome('aaaaa')\n-- True\n-- >>> is_palindrome('zbcd')\n-- False\nlocal function is_palindrome(text)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_palindrome\n lu.assertEquals(candidate(''), true)\n lu.assertEquals(candidate('aba'), true)\n lu.assertEquals(candidate('aaaaa'), true)\n lu.assertEquals(candidate('zbcd'), false)\n lu.assertEquals(candidate('xywyx'), true)\n lu.assertEquals(candidate('xywyz'), false)\n lu.assertEquals(candidate('xywzx'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "lua", - "prompt": "-- xs represent coefficients of a polynomial.\n-- xs[0] + xs[1] * x + xs[2] * x^2 + ....\n-- Return derivative of this polynomial in the same form.\n-- >>> derivative([3, 1, 2, 4, 5])\n-- [1, 4, 12, 20]\n-- >>> derivative([1, 2, 3])\n-- [2, 6]\nlocal function derivative(xs)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = derivative\n lu.assertEquals(candidate({3, 1, 2, 4, 5}), {1, 4, 12, 20})\n lu.assertEquals(candidate({1, 2, 3}), {2, 6})\n lu.assertEquals(candidate({3, 2, 1}), {2, 2})\n lu.assertEquals(candidate({3, 2, 1, 0, 4}), {2, 2, 0, 16})\n lu.assertEquals(candidate({1}), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "lua", - "prompt": "-- In this task, you will be given a string that represents a number of apples and oranges \n-- that are distributed in a basket of fruit this basket contains \n-- apples, oranges, and mango fruits. Given the string that represents the total number of \n-- the oranges and apples and an integer that represent the total number of the fruits \n-- in the basket return the number of the mango fruits in the basket.\n-- for examble:\n-- fruit_distribution(\"5 apples and 6 oranges\", 19) ->19 - 5 - 6 = 8\n-- fruit_distribution(\"0 apples and 1 oranges\",3) -> 3 - 0 - 1 = 2\n-- fruit_distribution(\"2 apples and 3 oranges\", 100) -> 100 - 2 - 3 = 95\n-- fruit_distribution(\"100 apples and 1 oranges\",120) -> 120 - 100 - 1 = 19\nlocal function fruit_distribution(s, n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = fruit_distribution\n lu.assertEquals(candidate('5 apples and 6 oranges', 19), 8)\n lu.assertEquals(candidate('5 apples and 6 oranges', 21), 10)\n lu.assertEquals(candidate('0 apples and 1 oranges', 3), 2)\n lu.assertEquals(candidate('1 apples and 0 oranges', 3), 2)\n lu.assertEquals(candidate('2 apples and 3 oranges', 100), 95)\n lu.assertEquals(candidate('2 apples and 3 oranges', 5), 0)\n lu.assertEquals(candidate('1 apples and 100 oranges', 120), 19)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "lua", - "prompt": "-- Write a function that takes an integer a and returns True \n-- if this ingeger is a cube of some integer number.\n-- Note: you may assume the input is always valid.\n-- Examples:\n-- iscube(1) ==> True\n-- iscube(2) ==> False\n-- iscube(-1) ==> True\n-- iscube(64) ==> True\n-- iscube(0) ==> True\n-- iscube(180) ==> False\nlocal function iscube(a)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = iscube\n lu.assertEquals(candidate(1), true)\n lu.assertEquals(candidate(2), false)\n lu.assertEquals(candidate(-1), true)\n lu.assertEquals(candidate(64), true)\n lu.assertEquals(candidate(180), false)\n lu.assertEquals(candidate(1000), true)\n lu.assertEquals(candidate(0), true)\n lu.assertEquals(candidate(1729), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "lua", - "prompt": "-- In this Kata, you have to sort an array of non-negative integers according to\n-- number of ones in their binary representation in ascending order.\n-- For similar number of ones, sort based on decimal value.\n-- It must be implemented like this:\n-- >>> sort_array([1, 5, 2, 3, 4]) == [1, 2, 3, 4, 5]\n-- >>> sort_array([-2, -3, -4, -5, -6]) == [-6, -5, -4, -3, -2]\n-- >>> sort_array([1, 0, 2, 3, 4]) [0, 1, 2, 3, 4]\nlocal function sort_array(arr)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sort_array\n lu.assertEquals(candidate({1, 5, 2, 3, 4}), {1, 2, 4, 3, 5})\n lu.assertEquals(candidate({-2, -3, -4, -5, -6}), {-4, -2, -6, -5, -3})\n lu.assertEquals(candidate({1, 0, 2, 3, 4}), {0, 1, 2, 4, 3})\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4}), {2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77})\n lu.assertEquals(candidate({3, 6, 44, 12, 32, 5}), {32, 3, 5, 6, 12, 44})\n lu.assertEquals(candidate({2, 4, 8, 16, 32}), {2, 4, 8, 16, 32})\n lu.assertEquals(candidate({2, 4, 8, 16, 32}), {2, 4, 8, 16, 32})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "lua", - "prompt": "-- Given a list of strings, where each string consists of only digits, return a list.\n-- Each element i of the output should be \"the number of odd elements in the\n-- string i of the input.\" where all the i's should be replaced by the number\n-- of odd digits in the i'th string of the input.\n-- >>> odd_count(['1234567'])\n-- [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n-- >>> odd_count(['3',\"11111111\"])\n-- [\"the number of odd elements 1n the str1ng 1 of the 1nput.\",\n-- \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\nlocal function odd_count(lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = odd_count\n lu.assertEquals(candidate({'1234567'}), {'the number of odd elements 4n the str4ng 4 of the 4nput.'})\n lu.assertEquals(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.'})\n lu.assertEquals(candidate({'271', '137', '314'}), {'the number of odd elements 2n the str2ng 2 of the 2nput.', 'the number of odd elements 3n the str3ng 3 of the 3nput.', 'the number of odd elements 2n the str2ng 2 of the 2nput.'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "lua", - "prompt": "-- brackets is a string of \"(\" and \")\".\n-- return True if every opening bracket has a corresponding closing bracket.\n-- >>> correct_bracketing(\"(\")\n-- False\n-- >>> correct_bracketing(\"()\")\n-- True\n-- >>> correct_bracketing(\"(()())\")\n-- True\n-- >>> correct_bracketing(\")(()\")\n-- False\nlocal function correct_bracketing(brackets)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = correct_bracketing\n lu.assertEquals(candidate('()'), true)\n lu.assertEquals(candidate('(()())'), true)\n lu.assertEquals(candidate('()()(()())()'), true)\n lu.assertEquals(candidate('()()((()()())())(()()(()))'), true)\n lu.assertEquals(candidate('((()())))'), false)\n lu.assertEquals(candidate(')(()'), false)\n lu.assertEquals(candidate('('), false)\n lu.assertEquals(candidate('(((('), false)\n lu.assertEquals(candidate(')'), false)\n lu.assertEquals(candidate('(()'), false)\n lu.assertEquals(candidate('()()(()())())(()'), false)\n lu.assertEquals(candidate('()()(()())()))()'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "lua", - "prompt": "-- Task\n-- Write a function that takes a string as input and returns the sum of the upper characters only'\n-- ASCII codes.\n-- Examples:\n-- digitSum(\"\") => 0\n-- digitSum(\"abAB\") => 131\n-- digitSum(\"abcCd\") => 67\n-- digitSum(\"helloE\") => 69\n-- digitSum(\"woArBld\") => 131\n-- digitSum(\"aAaaaXa\") => 153\nlocal function digitSum(s)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = digitSum\n lu.assertEquals(candidate(''), 0)\n lu.assertEquals(candidate('abAB'), 131)\n lu.assertEquals(candidate('abcCd'), 67)\n lu.assertEquals(candidate('helloE'), 69)\n lu.assertEquals(candidate('woArBld'), 131)\n lu.assertEquals(candidate('aAaaaXa'), 153)\n lu.assertEquals(candidate(' How are yOu?'), 151)\n lu.assertEquals(candidate('You arE Very Smart'), 327)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "lua", - "prompt": "-- Write a function that accepts a list of strings as a parameter,\n-- deletes the strings that have odd lengths from it,\n-- and returns the resulted list with a sorted order,\n-- The list is always a list of strings and never an array of numbers,\n-- and it may contain duplicates.\n-- The order of the list should be ascending by length of each word, and you\n-- should return the list sorted by that rule.\n-- If two words have the same length, sort the list alphabetically.\n-- The function should return a list of strings in sorted order.\n-- You may assume that all words will have the same length.\n-- For example:\n-- assert list_sort([\"aa\", \"a\", \"aaa\"]) => [\"aa\"]\n-- assert list_sort([\"ab\", \"a\", \"aaa\", \"cd\"]) => [\"ab\", \"cd\"]\nlocal function sorted_list_sum(lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sorted_list_sum\n lu.assertEquals(candidate({'aa', 'a', 'aaa'}), {'aa'})\n lu.assertEquals(candidate({'school', 'AI', 'asdf', 'b'}), {'AI', 'asdf', 'school'})\n lu.assertEquals(candidate({'d', 'b', 'c', 'a'}), {})\n lu.assertEquals(candidate({'d', 'dcba', 'abcd', 'a'}), {'abcd', 'dcba'})\n lu.assertEquals(candidate({'AI', 'ai', 'au'}), {'AI', 'ai', 'au'})\n lu.assertEquals(candidate({'a', 'b', 'b', 'c', 'c', 'a'}), {})\n lu.assertEquals(candidate({'aaaa', 'bbbb', 'dd', 'cc'}), {'cc', 'dd', 'aaaa', 'bbbb'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "lua", - "prompt": "-- You are given an array arr of integers and you need to return\n-- sum of magnitudes of integers multiplied by product of all signs\n-- of each number in the array, represented by 1, -1 or 0.\n-- Note: return None for empty arr.\n-- Example:\n-- >>> prod_signs([1, 2, 2, -4]) == -9\n-- >>> prod_signs([0, 1]) == 0\n-- >>> prod_signs([]) == None\nlocal function prod_signs(arr)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = prod_signs\n lu.assertEquals(candidate({1, 2, 2, -4}), -9)\n lu.assertEquals(candidate({0, 1}), 0)\n lu.assertEquals(candidate({1, 1, 1, 2, 3, -1, 1}), -10)\n lu.assertEquals(candidate({}), None)\n lu.assertEquals(candidate({2, 4, 1, 2, -1, -1, 9}), 20)\n lu.assertEquals(candidate({-1, 1, -1, 1}), 4)\n lu.assertEquals(candidate({-1, 1, 1, 1}), -4)\n lu.assertEquals(candidate({-1, 1, 1, 0}), 0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "lua", - "prompt": "-- Return list with elements incremented by 1.\n-- >>> incr_list([1, 2, 3])\n-- [2, 3, 4]\n-- >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123])\n-- [6, 4, 6, 3, 4, 4, 10, 1, 124]\nlocal function incr_list(l)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = incr_list\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({3, 2, 1}), {4, 3, 2})\n lu.assertEquals(candidate({5, 2, 5, 2, 3, 3, 9, 0, 123}), {6, 3, 6, 3, 4, 4, 10, 1, 124})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "lua", - "prompt": "-- From a given list of integers, generate a list of rolling maximum element found until given moment\n-- in the sequence.\n-- >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n-- [1, 2, 3, 3, 3, 4, 4]\nlocal function rolling_max(numbers)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = rolling_max\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({1, 2, 3, 4}), {1, 2, 3, 4})\n lu.assertEquals(candidate({4, 3, 2, 1}), {4, 4, 4, 4})\n lu.assertEquals(candidate({3, 2, 3, 100, 3}), {3, 3, 3, 100, 100})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "lua", - "prompt": "-- Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n-- separate those group into separate strings and return the list of those.\n-- Separate groups are balanced (each open brace is properly closed) and not nested within each other\n-- Ignore any spaces in the input string.\n-- >>> separate_paren_groups('( ) (( )) (( )( ))')\n-- ['()', '(())', '(()())']\nlocal function separate_paren_groups(paren_string)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = separate_paren_groups\n lu.assertEquals(candidate('(()()) ((())) () ((())()())'), {'(()())', '((()))', '()', '((())()())'})\n lu.assertEquals(candidate('() (()) ((())) (((())))'), {'()', '(())', '((()))', '(((())))'})\n lu.assertEquals(candidate('(()(())((())))'), {'(()(())((())))'})\n lu.assertEquals(candidate('( ) (( )) (( )( ))'), {'()', '(())', '(()())'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "lua", - "prompt": "-- You will be given a string of words separated by commas or spaces. Your task is\n-- to split the string into words and return an array of the words.\n-- For example:\n-- words_string(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n-- words_string(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\nlocal function words_string(s)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = words_string\n lu.assertEquals(candidate('Hi, my name is John'), {'Hi', 'my', 'name', 'is', 'John'})\n lu.assertEquals(candidate('One, two, three, four, five, six'), {'One', 'two', 'three', 'four', 'five', 'six'})\n lu.assertEquals(candidate('Hi, my name'), {'Hi', 'my', 'name'})\n lu.assertEquals(candidate('One,, two, three, four, five, six,'), {'One', 'two', 'three', 'four', 'five', 'six'})\n lu.assertEquals(candidate(''), {})\n lu.assertEquals(candidate('ahmed , gamal'), {'ahmed', 'gamal'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "lua", - "prompt": "-- Create a function that takes integers, floats, or strings representing\n-- real numbers, and returns the larger variable in its given variable type.\n-- Return None if the values are equal.\n-- Note: If a real number is represented as a string, the floating point might be . or ,\n-- compare_one(1, 2.5) \u279e 2.5\n-- compare_one(1, \"2,3\") \u279e \"2,3\"\n-- compare_one(\"5,1\", \"6\") \u279e \"6\"\n-- compare_one(\"1\", 1) \u279e None\nlocal function compare_one(a, b)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_137_compare_one.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = compare_one\n lu.assertEquals(candidate(1, 2), 2)\n lu.assertEquals(candidate(1, 2.5), 2.5)\n lu.assertEquals(candidate(2, 3), 3)\n lu.assertEquals(candidate(5, 6), 6)\n lu.assertEquals(candidate(1, '2,3'), '2,3')\n lu.assertEquals(candidate('5,1', '6'), '6')\n lu.assertEquals(candidate('1', '2'), '2')\n lu.assertEquals(candidate('1', 1), None)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "lua", - "prompt": "-- Filter given list of any python values only for integers\n-- >>> filter_integers(['a', 3.14, 5])\n-- [5]\n-- >>> filter_integers([1, 2, 3, 'abc', {}, []])\n-- [1, 2, 3]\nlocal function filter_integers(values)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = filter_integers\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({4, {}, {}, 23.2, 9, 'adasd'}), {4, 9})\n lu.assertEquals(candidate({3, 'c', 3, 3, 'a', 'b'}), {3, 3, 3})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "lua", - "prompt": "-- This function takes a list l and returns a list l' such that\n-- l' is identical to l in the odd indicies, while its values at the even indicies are equal\n-- to the values of the even indicies of l, but sorted.\n-- >>> sort_even([1, 2, 3])\n-- [1, 2, 3]\n-- >>> sort_even([5, 6, 3, 4])\n-- [3, 6, 5, 4]\nlocal function sort_even(l)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sort_even\n lu.assertEquals(candidate({1, 2, 3}), {1, 2, 3})\n lu.assertEquals(candidate({5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10}), {-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123})\n lu.assertEquals(candidate({5, 8, -12, 4, 23, 2, 3, 11, 12, -10}), {-12, 8, 3, 4, 5, 2, 12, 11, 23, -10})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "lua", - "prompt": "-- I think we all remember that feeling when the result of some long-awaited\n-- event is finally known. The feelings and thoughts you have at that moment are\n-- definitely worth noting down and comparing.\n-- Your task is to determine if a person correctly guessed the results of a number of matches.\n-- You are given two arrays of scores and guesses of equal length, where each index shows a match. \n-- Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n-- the value is 0, and if not, the value is the absolute difference between the guess and the score.\n-- example:\n-- compare([1,2,3,4,5,1],[1,2,3,4,2,-2]) -> [0,0,0,0,3,3]\n-- compare([0,5,0,0,0,4],[4,1,1,0,0,-2]) -> [4,4,1,0,0,6]\nlocal function compare(game, guess)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = compare\n lu.assertEquals(candidate({1, 2, 3, 4, 5, 1}, {1, 2, 3, 4, 2, -2}), {0, 0, 0, 0, 3, 3})\n lu.assertEquals(candidate({0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}), {0, 0, 0, 0, 0, 0})\n lu.assertEquals(candidate({1, 2, 3}, {-1, -2, -3}), {2, 4, 6})\n lu.assertEquals(candidate({1, 2, 3, 5}, {-1, 2, 3, 4}), {2, 0, 0, 1})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "lua", - "prompt": "-- Given a positive integer n, return a tuple that has the number of even and odd\n-- integer palindromes that fall within the range(1, n), inclusive.\n-- Example 1:\n-- Input: 3\n-- Output: (1, 2)\n-- Explanation:\n-- Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n-- Example 2:\n-- Input: 12\n-- Output: (4, 6)\n-- Explanation:\n-- Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n-- Note:\n-- 1. 1 <= n <= 10^3\n-- 2. returned tuple has the number of even and odd integer palindromes respectively.\nlocal function even_odd_palindrome(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = even_odd_palindrome\n lu.assertEquals(candidate(123), {8, 13})\n lu.assertEquals(candidate(12), {4, 6})\n lu.assertEquals(candidate(3), {1, 2})\n lu.assertEquals(candidate(63), {6, 8})\n lu.assertEquals(candidate(25), {5, 6})\n lu.assertEquals(candidate(19), {4, 6})\n lu.assertEquals(candidate(9), {4, 5})\n lu.assertEquals(candidate(1), {0, 1})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "lua", - "prompt": "-- The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n-- fib4(0) -> 0\n-- fib4(1) -> 0\n-- fib4(2) -> 2\n-- fib4(3) -> 0\n-- fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n-- Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n-- >>> fib4(5)\n-- 4\n-- >>> fib4(6)\n-- 8\n-- >>> fib4(7)\n-- 14\nlocal function fib4(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = fib4\n lu.assertEquals(candidate(5), 4)\n lu.assertEquals(candidate(8), 28)\n lu.assertEquals(candidate(10), 104)\n lu.assertEquals(candidate(12), 386)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "lua", - "prompt": "-- Given two positive integers a and b, return the even digits between a\n-- and b, in ascending order.\n-- For example:\n-- generate_integers(2, 8) => [2, 4, 6, 8]\n-- generate_integers(8, 2) => [2, 4, 6, 8]\n-- generate_integers(10, 14) => []\nlocal function generate_integers(a, b)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = generate_integers\n lu.assertEquals(candidate(2, 10), {2, 4, 6, 8})\n lu.assertEquals(candidate(10, 2), {2, 4, 6, 8})\n lu.assertEquals(candidate(132, 2), {2, 4, 6, 8})\n lu.assertEquals(candidate(17, 89), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "lua", - "prompt": "-- For a given list of input numbers, calculate Mean Absolute Deviation\n-- around the mean of this dataset.\n-- Mean Absolute Deviation is the average absolute difference between each\n-- element and a centerpoint (mean in this case):\n-- MAD = average | x - x_mean |\n-- >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n-- 1.0\nlocal function mean_absolute_deviation(numbers)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = mean_absolute_deviation\n lu.assertEquals(candidate({1.0, 2.0}), 0.5)\n lu.assertEquals(candidate({1.0, 2.0, 3.0, 4.0}), 1.0)\n lu.assertEquals(candidate({1.0, 2.0, 3.0, 4.0, 5.0}), 1.2)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "lua", - "prompt": "-- Create a function encrypt that takes a string as an argument and\n-- returns a string encrypted with the alphabet being rotated. \n-- The alphabet should be rotated in a manner such that the letters \n-- shift down by two multiplied to two places.\n-- For example:\n-- encrypt('hi') returns 'lm'\n-- encrypt('asdfghjkl') returns 'ewhjklnop'\n-- encrypt('gf') returns 'kj'\n-- encrypt('et') returns 'ix'\nlocal function encrypt(s)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = encrypt\n lu.assertEquals(candidate('hi'), 'lm')\n lu.assertEquals(candidate('asdfghjkl'), 'ewhjklnop')\n lu.assertEquals(candidate('gf'), 'kj')\n lu.assertEquals(candidate('et'), 'ix')\n lu.assertEquals(candidate('faewfawefaewg'), 'jeiajeaijeiak')\n lu.assertEquals(candidate('hellomyfriend'), 'lippsqcjvmirh')\n lu.assertEquals(candidate('dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh'), 'hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl')\n lu.assertEquals(candidate('a'), 'e')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "lua", - "prompt": "-- Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n-- The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n-- as follows: start with any positive integer n. Then each term is obtained from the \n-- previous term as follows: if the previous term is even, the next term is one half of \n-- the previous term. If the previous term is odd, the next term is 3 times the previous\n-- term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n-- Note: \n-- 1. Collatz(1) is [1].\n-- 2. returned list sorted in increasing order.\n-- For example:\n-- get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\nlocal function get_odd_collatz(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = get_odd_collatz\n lu.assertEquals(candidate(14), {1, 5, 7, 11, 13, 17})\n lu.assertEquals(candidate(5), {1, 5})\n lu.assertEquals(candidate(12), {1, 3, 5})\n lu.assertEquals(candidate(1), {1})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "lua", - "prompt": "-- Find how many times a given substring can be found in the original string. Count overlaping cases.\n-- >>> how_many_times('', 'a')\n-- 0\n-- >>> how_many_times('aaa', 'a')\n-- 3\n-- >>> how_many_times('aaaa', 'aa')\n-- 3\nlocal function how_many_times(string, substring)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = how_many_times\n lu.assertEquals(candidate('', 'x'), 0)\n lu.assertEquals(candidate('xyxyxyx', 'x'), 4)\n lu.assertEquals(candidate('cacacacac', 'cac'), 4)\n lu.assertEquals(candidate('john doe', 'john'), 1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "lua", - "prompt": "-- We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n-- numbers in the array will be randomly ordered. Your task is to determine if\n-- it is possible to get an array sorted in non-decreasing order by performing \n-- the following operation on the given array:\n-- You are allowed to perform right shift operation any number of times.\n-- One right shift operation means shifting all elements of the array by one\n-- position in the right direction. The last element of the array will be moved to\n-- the starting position in the array i.e. 0th index. \n-- If it is possible to obtain the sorted array by performing the above operation\n-- then return True else return False.\n-- If the given array is empty then return True.\n-- Note: The given list is guaranteed to have unique elements.\n-- For Example:\n-- move_one_ball([3, 4, 5, 1, 2])==>True\n-- Explanation: By performin 2 right shift operations, non-decreasing order can\n-- be achieved for the given array.\n-- move_one_ball([3, 5, 4, 1, 2])==>False\n-- Explanation:It is not possible to get non-decreasing order for the given\n-- array by performing any number of right shift operations.\nlocal function move_one_ball(arr)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = move_one_ball\n lu.assertEquals(candidate({3, 4, 5, 1, 2}), true)\n lu.assertEquals(candidate({3, 5, 10, 1, 2}), true)\n lu.assertEquals(candidate({4, 3, 1, 2}), false)\n lu.assertEquals(candidate({3, 5, 4, 1, 2}), false)\n lu.assertEquals(candidate({}), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "lua", - "prompt": "-- Write a function which sorts the given list of integers\n-- in ascending order according to the sum of their digits.\n-- Note: if there are several items with similar sum of their digits,\n-- order them based on their index in original list.\n-- For example:\n-- >>> order_by_points([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]\n-- >>> order_by_points([]) == []\nlocal function order_by_points(nums)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = order_by_points\n lu.assertEquals(candidate({1, 11, -1, -11, -12}), {-1, -11, 1, -12, 11})\n lu.assertEquals(candidate({1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46}), {0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457})\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({1, -11, -32, 43, 54, -98, 2, -3}), {-3, -32, -98, -11, 1, 2, 43, 54})\n lu.assertEquals(candidate({1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}), {1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9})\n lu.assertEquals(candidate({0, 6, 6, -76, -21, 23, 4}), {-76, -21, 0, 4, 23, 6, 6})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "lua", - "prompt": "-- Return list of prime factors of given integer in the order from smallest to largest.\n-- Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n-- Input number should be equal to the product of all factors\n-- >>> factorize(8)\n-- [2, 2, 2]\n-- >>> factorize(25)\n-- [5, 5]\n-- >>> factorize(70)\n-- [2, 5, 7]\nlocal function factorize(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = factorize\n lu.assertEquals(candidate(2), {2})\n lu.assertEquals(candidate(4), {2, 2})\n lu.assertEquals(candidate(8), {2, 2, 2})\n lu.assertEquals(candidate(57), {3, 19})\n lu.assertEquals(candidate(3249), {3, 3, 19, 19})\n lu.assertEquals(candidate(185193), {3, 3, 3, 19, 19, 19})\n lu.assertEquals(candidate(20577), {3, 19, 19, 19})\n lu.assertEquals(candidate(18), {2, 3, 3})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "lua", - "prompt": "-- Return True if all numbers in the list l are below threshold t.\n-- >>> below_threshold([1, 2, 4, 10], 100)\n-- True\n-- >>> below_threshold([1, 20, 4, 10], 5)\n-- False\nlocal function below_threshold(l, t)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = below_threshold\n lu.assertEquals(candidate({1, 2, 4, 10}, 100), true)\n lu.assertEquals(candidate({1, 20, 4, 10}, 5), false)\n lu.assertEquals(candidate({1, 20, 4, 10}, 21), true)\n lu.assertEquals(candidate({1, 20, 4, 10}, 22), true)\n lu.assertEquals(candidate({1, 8, 4, 10}, 11), true)\n lu.assertEquals(candidate({1, 8, 4, 10}, 10), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "lua", - "prompt": "-- You are given two positive integers n and m, and your task is to compute the\n-- average of the integers from n through m (including n and m). \n-- Round the answer to the nearest integer and convert that to binary.\n-- If n is greater than m, return -1.\n-- Example:\n-- rounded_avg(1, 5) => \"0b11\"\n-- rounded_avg(7, 5) => -1\n-- rounded_avg(10, 20) => \"0b1111\"\n-- rounded_avg(20, 33) => \"0b11010\"\nlocal function rounded_avg(n, m)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = rounded_avg\n lu.assertEquals(candidate(1, 5), '0b11')\n lu.assertEquals(candidate(7, 13), '0b1010')\n lu.assertEquals(candidate(964, 977), '0b1111001010')\n lu.assertEquals(candidate(996, 997), '0b1111100100')\n lu.assertEquals(candidate(560, 851), '0b1011000010')\n lu.assertEquals(candidate(185, 546), '0b101101110')\n lu.assertEquals(candidate(362, 496), '0b110101101')\n lu.assertEquals(candidate(350, 902), '0b1001110010')\n lu.assertEquals(candidate(197, 233), '0b11010111')\n lu.assertEquals(candidate(7, 5), -1)\n lu.assertEquals(candidate(5, 1), -1)\n lu.assertEquals(candidate(5, 5), '0b101')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "lua", - "prompt": "-- Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n-- For each of the group, output the deepest level of nesting of parentheses.\n-- E.g. (()()) has maximum two levels of nesting while ((())) has three.\n-- >>> parse_nested_parens('(()()) ((())) () ((())()())')\n-- [2, 3, 1, 3]\nlocal function parse_nested_parens(paren_string)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = parse_nested_parens\n lu.assertEquals(candidate('(()()) ((())) () ((())()())'), {2, 3, 1, 3})\n lu.assertEquals(candidate('() (()) ((())) (((())))'), {1, 2, 3, 4})\n lu.assertEquals(candidate('(()(())((())))'), {4})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "lua", - "prompt": "-- Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n-- Examples\n-- solution([5, 8, 7, 1]) ==> 12\n-- solution([3, 3, 3, 3, 3]) ==> 9\n-- solution([30, 13, 24, 321]) ==>0\nlocal function solution(lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = solution\n lu.assertEquals(candidate({5, 8, 7, 1}), 12)\n lu.assertEquals(candidate({3, 3, 3, 3, 3}), 9)\n lu.assertEquals(candidate({30, 13, 24, 321}), 0)\n lu.assertEquals(candidate({5, 9}), 5)\n lu.assertEquals(candidate({2, 4, 8}), 0)\n lu.assertEquals(candidate({30, 13, 23, 32}), 23)\n lu.assertEquals(candidate({3, 13, 2, 9}), 3)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "lua", - "prompt": "-- You are given a positive integer n. You have to create an integer array a of length n.\n-- For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n-- Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n-- and a[i] + a[j] + a[k] is a multiple of 3.\n-- Example :\n-- Input: n = 5\n-- Output: 1\n-- Explanation: \n-- a = [1, 3, 7, 13, 21]\n-- The only valid triple is (1, 7, 13).\nlocal function get_max_triples(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = get_max_triples\n lu.assertEquals(candidate(5), 1)\n lu.assertEquals(candidate(6), 4)\n lu.assertEquals(candidate(10), 36)\n lu.assertEquals(candidate(100), 53361)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "lua", - "prompt": "-- There are eight planets in our solar system: the closerst to the Sun \n-- is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n-- Uranus, Neptune.\n-- Write a function that takes two planet names as strings planet1 and planet2. \n-- The function should return a tuple containing all planets whose orbits are \n-- located between the orbit of planet1 and the orbit of planet2, sorted by \n-- the proximity to the sun. \n-- The function should return an empty tuple if planet1 or planet2\n-- are not correct planet names. \n-- Examples\n-- bf(\"Jupiter\", \"Neptune\") ==> (\"Saturn\", \"Uranus\")\n-- bf(\"Earth\", \"Mercury\") ==> (\"Venus\")\n-- bf(\"Mercury\", \"Uranus\") ==> (\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\")\nlocal function bf(planet1, planet2)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = bf\n lu.assertEquals(candidate('Jupiter', 'Neptune'), {'Saturn', 'Uranus'})\n lu.assertEquals(candidate('Earth', 'Mercury'), {'Venus'})\n lu.assertEquals(candidate('Mercury', 'Uranus'), {'Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn'})\n lu.assertEquals(candidate('Neptune', 'Venus'), {'Earth', 'Mars', 'Jupiter', 'Saturn', 'Uranus'})\n lu.assertEquals(candidate('Earth', 'Earth'), {})\n lu.assertEquals(candidate('Mars', 'Earth'), {})\n lu.assertEquals(candidate('Jupiter', 'Makemake'), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "lua", - "prompt": "-- You are given a list of integers.\n-- Write a function next_smallest() that returns the 2nd smallest element of the list.\n-- Return None if there is no such element.\n-- next_smallest([1, 2, 3, 4, 5]) == 2\n-- next_smallest([5, 1, 4, 3, 2]) == 2\n-- next_smallest([]) == None\n-- next_smallest([1, 1]) == None\nlocal function next_smallest(lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = next_smallest\n lu.assertEquals(candidate({1, 2, 3, 4, 5}), 2)\n lu.assertEquals(candidate({5, 1, 4, 3, 2}), 2)\n lu.assertEquals(candidate({}), None)\n lu.assertEquals(candidate({1, 1}), None)\n lu.assertEquals(candidate({1, 1, 1, 1, 0}), 1)\n lu.assertEquals(candidate({1, 1}), None)\n lu.assertEquals(candidate({-35, 34, 12, -45}), -35)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "lua", - "prompt": "-- Input is a space-delimited string of numberals from 'zero' to 'nine'.\n-- Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n-- Return the string with numbers sorted from smallest to largest\n-- >>> sort_numbers('three one five')\n-- 'one three five'\nlocal function sort_numbers(numbers)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sort_numbers\n lu.assertEquals(candidate(''), '')\n lu.assertEquals(candidate('three'), 'three')\n lu.assertEquals(candidate('three five nine'), 'three five nine')\n lu.assertEquals(candidate('five zero four seven nine eight'), 'zero four five seven eight nine')\n lu.assertEquals(candidate('six five four three two one zero'), 'zero one two three four five six')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "lua", - "prompt": "-- You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n-- cycpattern_check(\"abcd\",\"abd\") => False\n-- cycpattern_check(\"hello\",\"ell\") => True\n-- cycpattern_check(\"whassup\",\"psus\") => False\n-- cycpattern_check(\"abab\",\"baa\") => True\n-- cycpattern_check(\"efef\",\"eeff\") => False\n-- cycpattern_check(\"himenss\",\"simen\") => True\nlocal function cycpattern_check(a, b)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = cycpattern_check\n lu.assertEquals(candidate('xyzw', 'xyw'), false)\n lu.assertEquals(candidate('yello', 'ell'), true)\n lu.assertEquals(candidate('whattup', 'ptut'), false)\n lu.assertEquals(candidate('efef', 'fee'), true)\n lu.assertEquals(candidate('abab', 'aabb'), false)\n lu.assertEquals(candidate('winemtt', 'tinem'), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "lua", - "prompt": "-- You will be given a number in decimal form and your task is to convert it to\n-- binary format. The function should return a string, with each character representing a binary\n-- number. Each character in the string will be '0' or '1'.\n-- There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n-- The extra characters are there to help with the format.\n-- Examples:\n-- decimal_to_binary(15) # returns \"db1111db\"\n-- decimal_to_binary(32) # returns \"db100000db\"\nlocal function decimal_to_binary(decimal)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = decimal_to_binary\n lu.assertEquals(candidate(0), 'db0db')\n lu.assertEquals(candidate(32), 'db100000db')\n lu.assertEquals(candidate(103), 'db1100111db')\n lu.assertEquals(candidate(15), 'db1111db')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "lua", - "prompt": "-- Filter an input list of strings only for ones that contain given substring\n-- >>> filter_by_substring([], 'a')\n-- []\n-- >>> filter_by_substring(['abc', 'bacd', 'cde', 'array'], 'a')\n-- ['abc', 'bacd', 'array']\nlocal function filter_by_substring(strings, substring)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = filter_by_substring\n lu.assertEquals(candidate({}, 'john'), {})\n lu.assertEquals(candidate({'xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'}, 'xxx'), {'xxx', 'xxxAAA', 'xxx'})\n lu.assertEquals(candidate({'xxx', 'asd', 'aaaxxy', 'john doe', 'xxxAAA', 'xxx'}, 'xx'), {'xxx', 'aaaxxy', 'xxxAAA', 'xxx'})\n lu.assertEquals(candidate({'grunt', 'trumpet', 'prune', 'gruesome'}, 'run'), {'grunt', 'prune'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "lua", - "prompt": "-- Given an integer. return a tuple that has the number of even and odd digits respectively.\n-- Example:\n-- even_odd_count(-12) ==> (1, 1)\n-- even_odd_count(123) ==> (1, 2)\nlocal function even_odd_count(num)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = even_odd_count\n lu.assertEquals(candidate(7), {0, 1})\n lu.assertEquals(candidate(-78), {1, 1})\n lu.assertEquals(candidate(3452), {2, 2})\n lu.assertEquals(candidate(346211), {3, 3})\n lu.assertEquals(candidate(-345821), {3, 3})\n lu.assertEquals(candidate(-2), {1, 0})\n lu.assertEquals(candidate(-45347), {2, 3})\n lu.assertEquals(candidate(0), {1, 0})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "lua", - "prompt": "-- Write a function that accepts a list of strings.\n-- The list contains different words. Return the word with maximum number\n-- of unique characters. If multiple strings have maximum number of unique\n-- characters, return the one which comes first in lexicographical order.\n-- find_max([\"name\", \"of\", \"string\"]) == \"string\"\n-- find_max([\"name\", \"enam\", \"game\"]) == \"enam\"\n-- find_max([\"aaaaaaa\", \"bb\" ,\"cc\"]) == \"\"aaaaaaa\"\nlocal function find_max(words)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = find_max\n lu.assertEquals(candidate({'name', 'of', 'string'}), 'string')\n lu.assertEquals(candidate({'name', 'enam', 'game'}), 'enam')\n lu.assertEquals(candidate({'aaaaaaa', 'bb', 'cc'}), 'aaaaaaa')\n lu.assertEquals(candidate({'abc', 'cba'}), 'abc')\n lu.assertEquals(candidate({'play', 'this', 'game', 'of', 'footbott'}), 'footbott')\n lu.assertEquals(candidate({'we', 'are', 'gonna', 'rock'}), 'gonna')\n lu.assertEquals(candidate({'we', 'are', 'a', 'mad', 'nation'}), 'nation')\n lu.assertEquals(candidate({'this', 'is', 'a', 'prrk'}), 'this')\n lu.assertEquals(candidate({'b'}), 'b')\n lu.assertEquals(candidate({'play', 'play', 'play'}), 'play')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "lua", - "prompt": "-- Given a positive integer n, return the count of the numbers of n-digit\n-- positive integers that start or end with 1.\nlocal function starts_one_ends(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = starts_one_ends\n lu.assertEquals(candidate(1), 1)\n lu.assertEquals(candidate(2), 18)\n lu.assertEquals(candidate(3), 180)\n lu.assertEquals(candidate(4), 1800)\n lu.assertEquals(candidate(5), 18000)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "lua", - "prompt": "-- Create a function that returns a tuple (a, b), where 'a' is\n-- the largest of negative integers, and 'b' is the smallest\n-- of positive integers in a list.\n-- If there is no negative or positive integers, return them as None.\n-- Examples:\n-- largest_smallest_integers([2, 4, 1, 3, 5, 7]) == (None, 1)\n-- largest_smallest_integers([]) == (None, None)\n-- largest_smallest_integers([0]) == (None, None)\nlocal function largest_smallest_integers(lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = largest_smallest_integers\n lu.assertEquals(candidate({2, 4, 1, 3, 5, 7}), {None, 1})\n lu.assertEquals(candidate({2, 4, 1, 3, 5, 7, 0}), {None, 1})\n lu.assertEquals(candidate({1, 3, 2, 4, 5, 6, -2}), {-2, 1})\n lu.assertEquals(candidate({4, 5, 3, 6, 2, 7, -7}), {-7, 2})\n lu.assertEquals(candidate({7, 3, 8, 4, 9, 2, 5, -9}), {-9, 2})\n lu.assertEquals(candidate({}), {None, None})\n lu.assertEquals(candidate({0}), {None, None})\n lu.assertEquals(candidate({-1, -3, -5, -6}), {-1, None})\n lu.assertEquals(candidate({-1, -3, -5, -6, 0}), {-1, None})\n lu.assertEquals(candidate({-6, -4, -4, -3, 1}), {-3, 1})\n lu.assertEquals(candidate({-6, -4, -4, -3, -100, 1}), {-3, 1})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "lua", - "prompt": "-- \"Given an array representing a branch of a tree that has non-negative integer nodes\n-- your task is to pluck one of the nodes and return it.\n-- The plucked node should be the node with the smallest even value.\n-- If multiple nodes with the same smallest even value are found return the node that has smallest index.\n-- The plucked node should be returned in a list, [ smalest_value, its index ],\n-- If there are no even values or the given array is empty, return [].\n-- Example 1:\n-- Input: [4,2,3]\n-- Output: [2, 1]\n-- Explanation: 2 has the smallest even value, and 2 has the smallest index.\n-- Example 2:\n-- Input: [1,2,3]\n-- Output: [2, 1]\n-- Explanation: 2 has the smallest even value, and 2 has the smallest index. \n-- Example 3:\n-- Input: []\n-- Output: []\n-- Example 4:\n-- Input: [5, 0, 3, 0, 4, 2]\n-- Output: [0, 1]\n-- Explanation: 0 is the smallest value, but there are two zeros,\n-- so we will choose the first zero, which has the smallest index.\n-- Constraints:\n-- * 1 <= nodes.length <= 10000\n-- * 0 <= node.value\nlocal function pluck(arr)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = pluck\n lu.assertEquals(candidate({4, 2, 3}), {2, 1})\n lu.assertEquals(candidate({1, 2, 3}), {2, 1})\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({5, 0, 3, 0, 4, 2}), {0, 1})\n lu.assertEquals(candidate({1, 2, 3, 0, 5, 3}), {0, 3})\n lu.assertEquals(candidate({5, 4, 8, 4, 8}), {4, 1})\n lu.assertEquals(candidate({7, 6, 7, 1}), {6, 1})\n lu.assertEquals(candidate({7, 9, 7, 1}), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "lua", - "prompt": "-- Write a function count_nums which takes an array of integers and returns\n-- the number of elements which has a sum of digits > 0.\n-- If a number is negative, then its first signed digit will be negative:\n-- e.g. -123 has signed digits -1, 2, and 3.\n-- >>> count_nums([]) == 0\n-- >>> count_nums([-1, 11, -11]) == 1\n-- >>> count_nums([1, 1, 2]) == 3\nlocal function count_nums(arr)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = count_nums\n lu.assertEquals(candidate({}), 0)\n lu.assertEquals(candidate({-1, -2, 0}), 0)\n lu.assertEquals(candidate({1, 1, 2, -2, 3, 4, 5}), 6)\n lu.assertEquals(candidate({1, 6, 9, -6, 0, 1, 5}), 5)\n lu.assertEquals(candidate({1, 100, 98, -7, 1, -1}), 4)\n lu.assertEquals(candidate({12, 23, 34, -45, -56, 0}), 5)\n lu.assertEquals(candidate({0, 1}), 1)\n lu.assertEquals(candidate({1}), 1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "lua", - "prompt": "-- Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n-- each cell of the grid contains a value. Every integer in the range [1, N * N]\n-- inclusive appears exactly once on the cells of the grid.\n-- You have to find the minimum path of length k in the grid. You can start\n-- from any cell, and in each step you can move to any of the neighbor cells,\n-- in other words, you can go to cells which share an edge with you current\n-- cell.\n-- Please note that a path of length k means visiting exactly k cells (not\n-- necessarily distinct).\n-- You CANNOT go off the grid.\n-- A path A (of length k) is considered less than a path B (of length k) if\n-- after making the ordered lists of the values on the cells that A and B go\n-- through (let's call them lst_A and lst_B), lst_A is lexicographically less\n-- than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n-- such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n-- lst_A[j] = lst_B[j].\n-- It is guaranteed that the answer is unique.\n-- Return an ordered list of the values on the cells that the minimum path go through.\n-- Examples:\n-- Input: grid = [ [1,2,3], [4,5,6], [7,8,9]], k = 3\n-- Output: [1, 2, 1]\n-- Input: grid = [ [5,9,3], [4,1,6], [7,8,2]], k = 1\n-- Output: [1]\nlocal function minPath(grid, k)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = minPath\n lu.assertEquals(candidate({{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}, 3), {1, 2, 1})\n lu.assertEquals(candidate({{5, 9, 3}, {4, 1, 6}, {7, 8, 2}}, 1), {1})\n lu.assertEquals(candidate({{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}, {13, 14, 15, 16}}, 4), {1, 2, 1, 2})\n lu.assertEquals(candidate({{6, 4, 13, 10}, {5, 7, 12, 1}, {3, 16, 11, 15}, {8, 14, 9, 2}}, 7), {1, 10, 1, 10, 1, 10, 1})\n lu.assertEquals(candidate({{8, 14, 9, 2}, {6, 4, 13, 15}, {5, 7, 1, 12}, {3, 10, 11, 16}}, 5), {1, 7, 1, 7, 1})\n lu.assertEquals(candidate({{11, 8, 7, 2}, {5, 16, 14, 4}, {9, 3, 15, 6}, {12, 13, 10, 1}}, 9), {1, 6, 1, 6, 1, 6, 1, 6, 1})\n lu.assertEquals(candidate({{12, 13, 10, 1}, {9, 3, 15, 6}, {5, 16, 14, 4}, {11, 8, 7, 2}}, 12), {1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6})\n lu.assertEquals(candidate({{2, 7, 4}, {3, 1, 5}, {6, 8, 9}}, 8), {1, 3, 1, 3, 1, 3, 1, 3})\n lu.assertEquals(candidate({{6, 1, 5}, {3, 8, 9}, {2, 7, 4}}, 8), {1, 5, 1, 5, 1, 5, 1, 5})\n lu.assertEquals(candidate({{1, 2}, {3, 4}}, 10), {1, 2, 1, 2, 1, 2, 1, 2, 1, 2})\n lu.assertEquals(candidate({{1, 3}, {3, 2}}, 10), {1, 3, 1, 3, 1, 3, 1, 3, 1, 3})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "lua", - "prompt": "-- Given list of integers, return list in strange order.\n-- Strange sorting, is when you start with the minimum value,\n-- then maximum of the remaining integers, then minimum and so on.\n-- Examples:\n-- strange_sort_list([1, 2, 3, 4]) == [1, 4, 2, 3]\n-- strange_sort_list([5, 5, 5, 5]) == [5, 5, 5, 5]\n-- strange_sort_list([]) == []\nlocal function strange_sort_list(lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = strange_sort_list\n lu.assertEquals(candidate({1, 2, 3, 4}), {1, 4, 2, 3})\n lu.assertEquals(candidate({5, 6, 7, 8, 9}), {5, 9, 6, 8, 7})\n lu.assertEquals(candidate({1, 2, 3, 4, 5}), {1, 5, 2, 4, 3})\n lu.assertEquals(candidate({5, 6, 7, 8, 9, 1}), {1, 9, 5, 8, 6, 7})\n lu.assertEquals(candidate({5, 5, 5, 5}), {5, 5, 5, 5})\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({1, 2, 3, 4, 5, 6, 7, 8}), {1, 8, 2, 7, 3, 6, 4, 5})\n lu.assertEquals(candidate({0, 2, 2, 2, 5, 5, -5, -5}), {-5, 5, -5, 5, 0, 2, 2, 2})\n lu.assertEquals(candidate({111111}), {111111})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "lua", - "prompt": "-- Given a string 'text', return its md5 hash equivalent string.\n-- If 'text' is an empty string, return None.\n-- >>> string_to_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'\nlocal function string_to_md5(text)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = string_to_md5\n lu.assertEquals(candidate('Hello world'), '3e25960a79dbc69b674cd4ec67a72c62')\n lu.assertEquals(candidate(''), None)\n lu.assertEquals(candidate('A B C'), '0ef78513b0cb8cef12743f5aeb35f888')\n lu.assertEquals(candidate('password'), '5f4dcc3b5aa765d61d8327deb882cf99')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "lua", - "prompt": "-- You are given a word. Your task is to find the closest vowel that stands between \n-- two consonants from the right side of the word (case sensitive).\n-- Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n-- find any vowel met the above condition. \n-- You may assume that the given string contains English letter only.\n-- Example:\n-- get_closest_vowel(\"yogurt\") ==> \"u\"\n-- get_closest_vowel(\"FULL\") ==> \"U\"\n-- get_closest_vowel(\"quick\") ==> \"\"\n-- get_closest_vowel(\"ab\") ==> \"\"\nlocal function get_closest_vowel(word)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = get_closest_vowel\n lu.assertEquals(candidate('yogurt'), 'u')\n lu.assertEquals(candidate('full'), 'u')\n lu.assertEquals(candidate('easy'), '')\n lu.assertEquals(candidate('eAsy'), '')\n lu.assertEquals(candidate('ali'), '')\n lu.assertEquals(candidate('bad'), 'a')\n lu.assertEquals(candidate('most'), 'o')\n lu.assertEquals(candidate('ab'), '')\n lu.assertEquals(candidate('ba'), '')\n lu.assertEquals(candidate('quick'), '')\n lu.assertEquals(candidate('anime'), 'i')\n lu.assertEquals(candidate('Asia'), '')\n lu.assertEquals(candidate('Above'), 'o')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "lua", - "prompt": "-- Change numerical base of input number x to base.\n-- return string representation after the conversion.\n-- base numbers are less than 10.\n-- >>> change_base(8, 3)\n-- '22'\n-- >>> change_base(8, 2)\n-- '1000'\n-- >>> change_base(7, 2)\n-- '111'\nlocal function change_base(x, base)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = change_base\n lu.assertEquals(candidate(8, 3), '22')\n lu.assertEquals(candidate(9, 3), '100')\n lu.assertEquals(candidate(234, 2), '11101010')\n lu.assertEquals(candidate(16, 2), '10000')\n lu.assertEquals(candidate(8, 2), '1000')\n lu.assertEquals(candidate(7, 2), '111')\n lu.assertEquals(candidate(2, 3), '2')\n lu.assertEquals(candidate(3, 4), '3')\n lu.assertEquals(candidate(4, 5), '4')\n lu.assertEquals(candidate(5, 6), '5')\n lu.assertEquals(candidate(6, 7), '6')\n lu.assertEquals(candidate(7, 8), '7')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "lua", - "prompt": "-- Check if in given list of numbers, are any two numbers closer to each other than\n-- given threshold.\n-- >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n-- False\n-- >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n-- True\nlocal function has_close_elements(numbers, threshold)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = has_close_elements\n lu.assertEquals(candidate({1.0, 2.0, 3.9, 4.0, 5.0, 2.2}, 0.3), true)\n lu.assertEquals(candidate({1.0, 2.0, 3.9, 4.0, 5.0, 2.2}, 0.05), false)\n lu.assertEquals(candidate({1.0, 2.0, 5.9, 4.0, 5.0}, 0.95), true)\n lu.assertEquals(candidate({1.0, 2.0, 5.9, 4.0, 5.0}, 0.8), false)\n lu.assertEquals(candidate({1.0, 2.0, 3.0, 4.0, 5.0, 2.0}, 0.1), true)\n lu.assertEquals(candidate({1.1, 2.2, 3.1, 4.1, 5.1}, 1.0), true)\n lu.assertEquals(candidate({1.1, 2.2, 3.1, 4.1, 5.1}, 0.5), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "lua", - "prompt": "-- Create a function that takes a string as input which contains only square brackets.\n-- The function should return True if and only if there is a valid subsequence of brackets \n-- where at least one bracket in the subsequence is nested.\n-- is_nested('[[]]') \u279e True\n-- is_nested('[]]]]]]][[[[[]') \u279e False\n-- is_nested('[][]') \u279e False\n-- is_nested('[]') \u279e False\n-- is_nested('[[][]]') \u279e True\n-- is_nested('[[]][[') \u279e True\nlocal function is_nested(string)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_nested\n lu.assertEquals(candidate('[[]]'), true)\n lu.assertEquals(candidate('[]]]]]]][[[[[]'), false)\n lu.assertEquals(candidate('[][]'), false)\n lu.assertEquals(candidate('[]'), false)\n lu.assertEquals(candidate('[[[[]]]]'), true)\n lu.assertEquals(candidate('[]]]]]]]]]]'), false)\n lu.assertEquals(candidate('[][][[]]'), true)\n lu.assertEquals(candidate('[[]'), false)\n lu.assertEquals(candidate('[]]'), false)\n lu.assertEquals(candidate('[[]][['), true)\n lu.assertEquals(candidate('[[][]]'), true)\n lu.assertEquals(candidate(''), false)\n lu.assertEquals(candidate('[[[[[[[['), false)\n lu.assertEquals(candidate(']]]]]]]]'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "lua", - "prompt": "-- Concatenate list of strings into a single string\n-- >>> concatenate([])\n-- ''\n-- >>> concatenate(['a', 'b', 'c'])\n-- 'abc'\nlocal function concatenate(strings)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = concatenate\n lu.assertEquals(candidate({}), '')\n lu.assertEquals(candidate({'x', 'y', 'z'}), 'xyz')\n lu.assertEquals(candidate({'x', 'y', 'z', 'w', 'k'}), 'xyzwk')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "lua", - "prompt": "-- prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n-- >>> prime_fib(1)\n-- 2\n-- >>> prime_fib(2)\n-- 3\n-- >>> prime_fib(3)\n-- 5\n-- >>> prime_fib(4)\n-- 13\n-- >>> prime_fib(5)\n-- 89\nlocal function prime_fib(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = prime_fib\n lu.assertEquals(candidate(1), 2)\n lu.assertEquals(candidate(2), 3)\n lu.assertEquals(candidate(3), 5)\n lu.assertEquals(candidate(4), 13)\n lu.assertEquals(candidate(5), 89)\n lu.assertEquals(candidate(6), 233)\n lu.assertEquals(candidate(7), 1597)\n lu.assertEquals(candidate(8), 28657)\n lu.assertEquals(candidate(9), 514229)\n lu.assertEquals(candidate(10), 433494437)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "lua", - "prompt": "-- From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n-- other and return them in order (smaller number, larger number).\n-- >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n-- (2.0, 2.2)\n-- >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n-- (2.0, 2.0)\nlocal function find_closest_elements(numbers)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = find_closest_elements\n lu.assertEquals(candidate({1.0, 2.0, 3.9, 4.0, 5.0, 2.2}), {3.9, 4.0})\n lu.assertEquals(candidate({1.0, 2.0, 5.9, 4.0, 5.0}), {5.0, 5.9})\n lu.assertEquals(candidate({1.0, 2.0, 3.0, 4.0, 5.0, 2.2}), {2.0, 2.2})\n lu.assertEquals(candidate({1.0, 2.0, 3.0, 4.0, 5.0, 2.0}), {2.0, 2.0})\n lu.assertEquals(candidate({1.1, 2.2, 3.1, 4.1, 5.1}), {2.2, 3.1})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "lua", - "prompt": "-- You have been tasked to write a function that receives \n-- a hexadecimal number as a string and counts the number of hexadecimal \n-- digits that are primes (prime number, or a prime, is a natural number \n-- greater than 1 that is not a product of two smaller natural numbers).\n-- Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n-- Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n-- So you have to determine a number of the following digits: 2, 3, 5, 7, \n-- B (=decimal 11), D (=decimal 13).\n-- Note: you may assume the input is always correct or empty string, \n-- and symbols A,B,C,D,E,F are always uppercase.\n-- Examples:\n-- For num = \"AB\" the output should be 1.\n-- For num = \"1077E\" the output should be 2.\n-- For num = \"ABED1A33\" the output should be 4.\n-- For num = \"123456789ABCDEF0\" the output should be 6.\n-- For num = \"2020\" the output should be 2.\nlocal function hex_key(num)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = hex_key\n lu.assertEquals(candidate('AB'), 1)\n lu.assertEquals(candidate('1077E'), 2)\n lu.assertEquals(candidate('ABED1A33'), 4)\n lu.assertEquals(candidate('2020'), 2)\n lu.assertEquals(candidate('123456789ABCDEF0'), 6)\n lu.assertEquals(candidate('112233445566778899AABBCCDDEEFF00'), 12)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "lua", - "prompt": "-- Complete the function that takes two integers and returns \n-- the product of their unit digits.\n-- Assume the input is always valid.\n-- Examples:\n-- multiply(148, 412) should return 16.\n-- multiply(19, 28) should return 72.\n-- multiply(2020, 1851) should return 0.\n-- multiply(14,-15) should return 20.\nlocal function multiply(a, b)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = multiply\n lu.assertEquals(candidate(148, 412), 16)\n lu.assertEquals(candidate(19, 28), 72)\n lu.assertEquals(candidate(2020, 1851), 0)\n lu.assertEquals(candidate(14, -15), 20)\n lu.assertEquals(candidate(76, 67), 42)\n lu.assertEquals(candidate(17, 27), 49)\n lu.assertEquals(candidate(0, 1), 0)\n lu.assertEquals(candidate(0, 0), 0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "lua", - "prompt": "-- Given list of numbers (of at least two elements), apply a linear transform to that list,\n-- such that the smallest number will become 0 and the largest will become 1\n-- >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n-- [0.0, 0.25, 0.5, 0.75, 1.0]\nlocal function rescale_to_unit(numbers)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = rescale_to_unit\n lu.assertEquals(candidate({2.0, 49.9}), {0.0, 1.0})\n lu.assertEquals(candidate({100.0, 49.9}), {1.0, 0.0})\n lu.assertEquals(candidate({1.0, 2.0, 3.0, 4.0, 5.0}), {0.0, 0.25, 0.5, 0.75, 1.0})\n lu.assertEquals(candidate({2.0, 1.0, 5.0, 3.0, 4.0}), {0.25, 0.0, 1.0, 0.5, 0.75})\n lu.assertEquals(candidate({12.0, 11.0, 15.0, 13.0, 14.0}), {0.25, 0.0, 1.0, 0.5, 0.75})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "lua", - "prompt": "-- Given a positive integer n, return the product of the odd digits.\n-- Return 0 if all digits are even.\n-- For example:\n-- digits(1) == 1\n-- digits(4) == 0\n-- digits(235) == 15\nlocal function digits(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = digits\n lu.assertEquals(candidate(5), 5)\n lu.assertEquals(candidate(54), 5)\n lu.assertEquals(candidate(120), 1)\n lu.assertEquals(candidate(5014), 5)\n lu.assertEquals(candidate(98765), 315)\n lu.assertEquals(candidate(5576543), 2625)\n lu.assertEquals(candidate(2468), 0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "lua", - "prompt": "-- You will be given the name of a class (a string) and a list of extensions.\n-- The extensions are to be used to load additional classes to the class. The\n-- strength of the extension is as follows: Let CAP be the number of the uppercase\n-- letters in the extension's name, and let SM be the number of lowercase letters \n-- in the extension's name, the strength is given by the fraction CAP - SM. \n-- You should find the strongest extension and return a string in this \n-- format: ClassName.StrongestExtensionName.\n-- If there are two or more extensions with the same strength, you should\n-- choose the one that comes first in the list.\n-- For example, if you are given \"Slices\" as the class and a list of the\n-- extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n-- return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n-- (its strength is -1).\n-- Example:\n-- for Strongest_Extension('my_class', ['AA', 'Be', 'CC']) == 'my_class.AA'\nlocal function Strongest_Extension(class_name, extensions)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = Strongest_Extension\n lu.assertEquals(candidate('Watashi', {'tEN', 'niNE', 'eIGHt8OKe'}), 'Watashi.eIGHt8OKe')\n lu.assertEquals(candidate('Boku123', {'nani', 'NazeDa', 'YEs.WeCaNe', '32145tggg'}), 'Boku123.YEs.WeCaNe')\n lu.assertEquals(candidate('__YESIMHERE', {'t', 'eMptY', 'nothing', 'zeR00', 'NuLl__', '123NoooneB321'}), '__YESIMHERE.NuLl__')\n lu.assertEquals(candidate('K', {'Ta', 'TAR', 't234An', 'cosSo'}), 'K.TAR')\n lu.assertEquals(candidate('__HAHA', {'Tab', '123', '781345', '-_-'}), '__HAHA.123')\n lu.assertEquals(candidate('YameRore', {'HhAas', 'okIWILL123', 'WorkOut', 'Fails', '-_-'}), 'YameRore.okIWILL123')\n lu.assertEquals(candidate('finNNalLLly', {'Die', 'NowW', 'Wow', 'WoW'}), 'finNNalLLly.WoW')\n lu.assertEquals(candidate('_', {'Bb', '91245'}), '_.Bb')\n lu.assertEquals(candidate('Sp', {'671235', 'Bb'}), 'Sp.671235')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "lua", - "prompt": "-- Given a string representing a space separated lowercase letters, return a dictionary\n-- of the letter with the most repetition and containing the corresponding count.\n-- If several letters have the same occurrence, return all of them.\n-- Example:\n-- histogram('a b c') == {'a': 1, 'b': 1, 'c': 1}\n-- histogram('a b b a') == {'a': 2, 'b': 2}\n-- histogram('a b c a b') == {'a': 2, 'b': 2}\n-- histogram('b b b b a') == {'b': 4}\n-- histogram('') == {}\nlocal function histogram(test)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = histogram\n lu.assertEquals(candidate('a b b a'), {['a'] = 2, ['b'] = 2})\n lu.assertEquals(candidate('a b c a b'), {['a'] = 2, ['b'] = 2})\n lu.assertEquals(candidate('a b c d g'), {['a'] = 1, ['b'] = 1, ['c'] = 1, ['d'] = 1, ['g'] = 1})\n lu.assertEquals(candidate('r t g'), {['r'] = 1, ['t'] = 1, ['g'] = 1})\n lu.assertEquals(candidate('b b b b a'), {['b'] = 4})\n lu.assertEquals(candidate('r t g'), {['r'] = 1, ['t'] = 1, ['g'] = 1})\n lu.assertEquals(candidate(''), {})\n lu.assertEquals(candidate('a'), {['a'] = 1})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "lua", - "prompt": "-- pairs_sum_to_zero takes a list of integers as an input.\n-- it returns True if there are two distinct elements in the list that\n-- sum to zero, and False otherwise.\n-- >>> pairs_sum_to_zero([1, 3, 5, 0])\n-- False\n-- >>> pairs_sum_to_zero([1, 3, -2, 1])\n-- False\n-- >>> pairs_sum_to_zero([1, 2, 3, 7])\n-- False\n-- >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7])\n-- True\n-- >>> pairs_sum_to_zero([1])\n-- False\nlocal function pairs_sum_to_zero(l)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = pairs_sum_to_zero\n lu.assertEquals(candidate({1, 3, 5, 0}), false)\n lu.assertEquals(candidate({1, 3, -2, 1}), false)\n lu.assertEquals(candidate({1, 2, 3, 7}), false)\n lu.assertEquals(candidate({2, 4, -5, 3, 5, 7}), true)\n lu.assertEquals(candidate({1}), false)\n lu.assertEquals(candidate({-3, 9, -1, 3, 2, 30}), true)\n lu.assertEquals(candidate({-3, 9, -1, 3, 2, 31}), true)\n lu.assertEquals(candidate({-3, 9, -1, 4, 2, 30}), false)\n lu.assertEquals(candidate({-3, 9, -1, 4, 2, 31}), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "lua", - "prompt": "-- Write a function that accepts two lists of strings and returns the list that has \n-- total number of chars in the all strings of the list less than the other list.\n-- if the two lists have the same number of chars, return the first list.\n-- Examples\n-- total_match([], []) \u279e []\n-- total_match(['hi', 'admin'], ['hI', 'Hi']) \u279e ['hI', 'Hi']\n-- total_match(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) \u279e ['hi', 'admin']\n-- total_match(['hi', 'admin'], ['hI', 'hi', 'hi']) \u279e ['hI', 'hi', 'hi']\n-- total_match(['4'], ['1', '2', '3', '4', '5']) \u279e ['4']\nlocal function total_match(lst1, lst2)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = total_match\n lu.assertEquals(candidate({}, {}), {})\n lu.assertEquals(candidate({'hi', 'admin'}, {'hi', 'hi'}), {'hi', 'hi'})\n lu.assertEquals(candidate({'hi', 'admin'}, {'hi', 'hi', 'admin', 'project'}), {'hi', 'admin'})\n lu.assertEquals(candidate({'4'}, {'1', '2', '3', '4', '5'}), {'4'})\n lu.assertEquals(candidate({'hi', 'admin'}, {'hI', 'Hi'}), {'hI', 'Hi'})\n lu.assertEquals(candidate({'hi', 'admin'}, {'hI', 'hi', 'hi'}), {'hI', 'hi', 'hi'})\n lu.assertEquals(candidate({'hi', 'admin'}, {'hI', 'hi', 'hii'}), {'hi', 'admin'})\n lu.assertEquals(candidate({}, {'this'}), {})\n lu.assertEquals(candidate({'this'}, {}), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "lua", - "prompt": "-- Circular shift the digits of the integer x, shift the digits right by shift\n-- and return the result as a string.\n-- If shift > number of digits, return digits reversed.\n-- >>> circular_shift(12, 1)\n-- \"21\"\n-- >>> circular_shift(12, 2)\n-- \"12\"\nlocal function circular_shift(x, shift)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = circular_shift\n lu.assertEquals(candidate(100, 2), '001')\n lu.assertEquals(candidate(12, 2), '12')\n lu.assertEquals(candidate(97, 8), '79')\n lu.assertEquals(candidate(12, 1), '21')\n lu.assertEquals(candidate(11, 101), '11')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "lua", - "prompt": "-- Return True is list elements are monotonically increasing or decreasing.\n-- >>> monotonic([1, 2, 4, 20])\n-- True\n-- >>> monotonic([1, 20, 4, 10])\n-- False\n-- >>> monotonic([4, 1, 0, -10])\n-- True\nlocal function monotonic(l)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = monotonic\n lu.assertEquals(candidate({1, 2, 4, 10}), true)\n lu.assertEquals(candidate({1, 2, 4, 20}), true)\n lu.assertEquals(candidate({1, 20, 4, 10}), false)\n lu.assertEquals(candidate({4, 1, 0, -10}), true)\n lu.assertEquals(candidate({4, 1, 1, 0}), true)\n lu.assertEquals(candidate({1, 2, 3, 2, 5, 60}), false)\n lu.assertEquals(candidate({1, 2, 3, 4, 5, 60}), true)\n lu.assertEquals(candidate({9, 9, 9, 9}), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "lua", - "prompt": "-- Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n-- Example\n-- is_equal_to_sum_even(4) == False\n-- is_equal_to_sum_even(6) == False\n-- is_equal_to_sum_even(8) == True\nlocal function is_equal_to_sum_even(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_equal_to_sum_even\n lu.assertEquals(candidate(4), false)\n lu.assertEquals(candidate(6), false)\n lu.assertEquals(candidate(8), true)\n lu.assertEquals(candidate(10), true)\n lu.assertEquals(candidate(11), false)\n lu.assertEquals(candidate(12), true)\n lu.assertEquals(candidate(13), false)\n lu.assertEquals(candidate(16), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "lua", - "prompt": "-- Input to this function is a string representing musical notes in a special ASCII format.\n-- Your task is to parse this string and return list of integers corresponding to how many beats does each\n-- not last.\n-- Here is a legend:\n-- 'o' - whole note, lasts four beats\n-- 'o|' - half note, lasts two beats\n-- '.|' - quater note, lasts one beat\n-- >>> parse_music('o o| .| o| o| .| .| .| .| o o')\n-- [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\nlocal function parse_music(music_string)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = parse_music\n lu.assertEquals(candidate(''), {})\n lu.assertEquals(candidate('o o o o'), {4, 4, 4, 4})\n lu.assertEquals(candidate('.| .| .| .|'), {1, 1, 1, 1})\n lu.assertEquals(candidate('o| o| .| .| o o o o'), {2, 2, 1, 1, 4, 4, 4, 4})\n lu.assertEquals(candidate('o| .| o| .| o o| o o|'), {2, 1, 2, 1, 4, 2, 4, 2})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "lua", - "prompt": "-- \"\n-- This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n-- multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n-- change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n-- Examples:\n-- For lst = [1,2,3] the output should be 6\n-- For lst = [] the output should be 0\n-- For lst = [-1,-5,2,-1,-5] the output should be -126\nlocal function sum_squares(lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sum_squares\n lu.assertEquals(candidate({1, 2, 3}), 6)\n lu.assertEquals(candidate({1, 4, 9}), 14)\n lu.assertEquals(candidate({}), 0)\n lu.assertEquals(candidate({1, 1, 1, 1, 1, 1, 1, 1, 1}), 9)\n lu.assertEquals(candidate({-1, -1, -1, -1, -1, -1, -1, -1, -1}), -3)\n lu.assertEquals(candidate({0}), 0)\n lu.assertEquals(candidate({-1, -5, 2, -1, -5}), -126)\n lu.assertEquals(candidate({-56, -99, 1, 0, -2}), 3030)\n lu.assertEquals(candidate({-1, 0, 0, 0, 0, 0, 0, 0, -1}), 0)\n lu.assertEquals(candidate({-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37}), -14196)\n lu.assertEquals(candidate({-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10}), -1448)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "lua", - "prompt": "-- triples_sum_to_zero takes a list of integers as an input.\n-- it returns True if there are three distinct elements in the list that\n-- sum to zero, and False otherwise.\n-- >>> triples_sum_to_zero([1, 3, 5, 0])\n-- False\n-- >>> triples_sum_to_zero([1, 3, -2, 1])\n-- True\n-- >>> triples_sum_to_zero([1, 2, 3, 7])\n-- False\n-- >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n-- True\n-- >>> triples_sum_to_zero([1])\n-- False\nlocal function triples_sum_to_zero(l)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = triples_sum_to_zero\n lu.assertEquals(candidate({1, 3, 5, 0}), false)\n lu.assertEquals(candidate({1, 3, 5, -1}), false)\n lu.assertEquals(candidate({1, 3, -2, 1}), true)\n lu.assertEquals(candidate({1, 2, 3, 7}), false)\n lu.assertEquals(candidate({1, 2, 5, 7}), false)\n lu.assertEquals(candidate({2, 4, -5, 3, 9, 7}), true)\n lu.assertEquals(candidate({1}), false)\n lu.assertEquals(candidate({1, 3, 5, -100}), false)\n lu.assertEquals(candidate({100, 3, 5, -100}), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "lua", - "prompt": "-- brackets is a string of \"<\" and \">\".\n-- return True if every opening bracket has a corresponding closing bracket.\n-- >>> correct_bracketing(\"<\")\n-- False\n-- >>> correct_bracketing(\"<>\")\n-- True\n-- >>> correct_bracketing(\"<<><>>\")\n-- True\n-- >>> correct_bracketing(\"><<>\")\n-- False\nlocal function correct_bracketing(brackets)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = correct_bracketing\n lu.assertEquals(candidate('<>'), true)\n lu.assertEquals(candidate('<<><>>'), true)\n lu.assertEquals(candidate('<><><<><>><>'), true)\n lu.assertEquals(candidate('<><><<<><><>><>><<><><<>>>'), true)\n lu.assertEquals(candidate('<<<><>>>>'), false)\n lu.assertEquals(candidate('><<>'), false)\n lu.assertEquals(candidate('<'), false)\n lu.assertEquals(candidate('<<<<'), false)\n lu.assertEquals(candidate('>'), false)\n lu.assertEquals(candidate('<<>'), false)\n lu.assertEquals(candidate('<><><<><>><>><<>'), false)\n lu.assertEquals(candidate('<><><<><>><>>><>'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "lua", - "prompt": "-- Write a function that takes an array of numbers as input and returns \n-- the number of elements in the array that are greater than 10 and both \n-- first and last digits of a number are odd (1, 3, 5, 7, 9).\n-- For example:\n-- specialFilter([15, -73, 14, -15]) => 1 \n-- specialFilter([33, -2, -3, 45, 21, 109]) => 2\nlocal function specialFilter(nums)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = specialFilter\n lu.assertEquals(candidate({5, -2, 1, -5}), 0)\n lu.assertEquals(candidate({15, -73, 14, -15}), 1)\n lu.assertEquals(candidate({33, -2, -3, 45, 21, 109}), 2)\n lu.assertEquals(candidate({43, -12, 93, 125, 121, 109}), 4)\n lu.assertEquals(candidate({71, -2, -33, 75, 21, 19}), 3)\n lu.assertEquals(candidate({1}), 0)\n lu.assertEquals(candidate({}), 0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "lua", - "prompt": "-- Given a dictionary, return True if all keys are strings in lower \n-- case or all keys are strings in upper case, else return False.\n-- The function should return False is the given dictionary is empty.\n-- Examples:\n-- check_dict_case({\"a\":\"apple\", \"b\":\"banana\"}) should return True.\n-- check_dict_case({\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}) should return False.\n-- check_dict_case({\"a\":\"apple\", \"8\":\"banana\", \"a\":\"apple\"}) should return False.\n-- check_dict_case({\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}) should return False.\n-- check_dict_case({\"STATE\":\"NC\", \"ZIP\":\"12345\" }) should return True.\nlocal function check_dict_case(dict)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = check_dict_case\n lu.assertEquals(candidate({['p'] = 'pineapple', ['b'] = 'banana'}), true)\n lu.assertEquals(candidate({['p'] = 'pineapple', ['A'] = 'banana', ['B'] = 'banana'}), false)\n lu.assertEquals(candidate({['p'] = 'pineapple', ['5'] = 'banana', ['a'] = 'apple'}), false)\n lu.assertEquals(candidate({['Name'] = 'John', ['Age'] = '36', ['City'] = 'Houston'}), false)\n lu.assertEquals(candidate({['STATE'] = 'NC', ['ZIP'] = '12345'}), true)\n lu.assertEquals(candidate({['fruit'] = 'Orange', ['taste'] = 'Sweet'}), true)\n lu.assertEquals(candidate({}), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "lua", - "prompt": "-- Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n-- should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n-- alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n-- Examples\n-- split_words(\"Hello world!\") \u279e [\"Hello\", \"world!\"]\n-- split_words(\"Hello,world!\") \u279e [\"Hello\", \"world!\"]\n-- split_words(\"abcdef\") == 3\nlocal function split_words(txt)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = split_words\n lu.assertEquals(candidate('Hello world!'), {'Hello', 'world!'})\n lu.assertEquals(candidate('Hello,world!'), {'Hello', 'world!'})\n lu.assertEquals(candidate('Hello world,!'), {'Hello', 'world,!'})\n lu.assertEquals(candidate('Hello,Hello,world !'), {'Hello,Hello,world', '!'})\n lu.assertEquals(candidate('abcdef'), 3)\n lu.assertEquals(candidate('aaabb'), 2)\n lu.assertEquals(candidate('aaaBb'), 1)\n lu.assertEquals(candidate(''), 0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "lua", - "prompt": "-- The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n-- fibfib(0) == 0\n-- fibfib(1) == 0\n-- fibfib(2) == 1\n-- fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n-- Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n-- >>> fibfib(1)\n-- 0\n-- >>> fibfib(5)\n-- 4\n-- >>> fibfib(8)\n-- 24\nlocal function fibfib(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = fibfib\n lu.assertEquals(candidate(2), 1)\n lu.assertEquals(candidate(1), 0)\n lu.assertEquals(candidate(5), 4)\n lu.assertEquals(candidate(8), 24)\n lu.assertEquals(candidate(10), 81)\n lu.assertEquals(candidate(12), 274)\n lu.assertEquals(candidate(14), 927)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "lua", - "prompt": "-- You are given a list of numbers.\n-- You need to return the sum of squared numbers in the given list,\n-- round each element in the list to the upper int(Ceiling) first.\n-- Examples:\n-- For lst = [1,2,3] the output should be 14\n-- For lst = [1,4,9] the output should be 98\n-- For lst = [1,3,5,7] the output should be 84\n-- For lst = [1.4,4.2,0] the output should be 29\n-- For lst = [-2.4,1,1] the output should be 6\nlocal function sum_squares(lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sum_squares\n lu.assertEquals(candidate({1.0, 2.0, 3.0}), 14)\n lu.assertEquals(candidate({1.0, 2.0, 3.0}), 14)\n lu.assertEquals(candidate({1.0, 3.0, 5.0, 7.0}), 84)\n lu.assertEquals(candidate({1.4, 4.2, 0.0}), 29)\n lu.assertEquals(candidate({-2.4, 1.0, 1.0}), 6)\n lu.assertEquals(candidate({100.0, 1.0, 15.0, 2.0}), 10230)\n lu.assertEquals(candidate({10000.0, 10000.0}), 200000000)\n lu.assertEquals(candidate({-1.4, 4.6, 6.3}), 75)\n lu.assertEquals(candidate({-1.4, 17.9, 18.9, 19.9}), 1086)\n lu.assertEquals(candidate({0.0}), 0)\n lu.assertEquals(candidate({-1.0}), 1)\n lu.assertEquals(candidate({-1.0, 1.0, 0.0}), 2)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_85_add", - "language": "lua", - "prompt": "-- Given a non-empty list of integers lst. add the even elements that are at odd indices..\n-- Examples:\n-- add([4, 2, 6, 7]) ==> 2\nlocal function add(lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = add\n lu.assertEquals(candidate({4, 88}), 88)\n lu.assertEquals(candidate({4, 5, 6, 7, 2, 122}), 122)\n lu.assertEquals(candidate({4, 0, 6, 7}), 0)\n lu.assertEquals(candidate({4, 4, 6, 8}), 12)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "lua", - "prompt": "-- Return sorted unique elements in a list\n-- >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123])\n-- [0, 2, 3, 5, 9, 123]\nlocal function unique(l)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = unique\n lu.assertEquals(candidate({5, 3, 5, 2, 3, 3, 9, 0, 123}), {0, 2, 3, 5, 9, 123})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "lua", - "prompt": "-- Given a string text, replace all spaces in it with underscores, \n-- and if a string has more than 2 consecutive spaces, \n-- then replace all consecutive spaces with - \n-- fix_spaces(\"Example\") == \"Example\"\n-- fix_spaces(\"Example 1\") == \"Example_1\"\n-- fix_spaces(\" Example 2\") == \"_Example_2\"\n-- fix_spaces(\" Example 3\") == \"_Example-3\"\nlocal function fix_spaces(text)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = fix_spaces\n lu.assertEquals(candidate('Example'), 'Example')\n lu.assertEquals(candidate('Mudasir Hanif '), 'Mudasir_Hanif_')\n lu.assertEquals(candidate('Yellow Yellow Dirty Fellow'), 'Yellow_Yellow__Dirty__Fellow')\n lu.assertEquals(candidate('Exa mple'), 'Exa-mple')\n lu.assertEquals(candidate(' Exa 1 2 2 mple'), '-Exa_1_2_2_mple')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "lua", - "prompt": "-- Return 2^n modulo p (be aware of numerics).\n-- >>> modp(3, 5)\n-- 3\n-- >>> modp(1101, 101)\n-- 2\n-- >>> modp(0, 101)\n-- 1\n-- >>> modp(3, 11)\n-- 8\n-- >>> modp(100, 101)\n-- 1\nlocal function modp(n, p)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = modp\n lu.assertEquals(candidate(3, 5), 3)\n lu.assertEquals(candidate(1101, 101), 2)\n lu.assertEquals(candidate(0, 101), 1)\n lu.assertEquals(candidate(3, 11), 8)\n lu.assertEquals(candidate(100, 101), 1)\n lu.assertEquals(candidate(30, 5), 4)\n lu.assertEquals(candidate(31, 5), 3)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "lua", - "prompt": "-- You have to write a function which validates a given date string and\n-- returns True if the date is valid otherwise False.\n-- The date is valid if all of the following rules are satisfied:\n-- 1. The date string is not empty.\n-- 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n-- 3. The months should not be less than 1 or higher than 12.\n-- 4. The date should be in the format: mm-dd-yyyy\n-- for example: \n-- valid_date('03-11-2000') => True\n-- valid_date('15-01-2012') => False\n-- valid_date('04-0-2040') => False\n-- valid_date('06-04-2020') => True\n-- valid_date('06/04/2020') => False\nlocal function valid_date(date)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = valid_date\n lu.assertEquals(candidate('03-11-2000'), true)\n lu.assertEquals(candidate('15-01-2012'), false)\n lu.assertEquals(candidate('04-0-2040'), false)\n lu.assertEquals(candidate('06-04-2020'), true)\n lu.assertEquals(candidate('01-01-2007'), true)\n lu.assertEquals(candidate('03-32-2011'), false)\n lu.assertEquals(candidate(''), false)\n lu.assertEquals(candidate('04-31-3000'), false)\n lu.assertEquals(candidate('06-06-2005'), true)\n lu.assertEquals(candidate('21-31-2000'), false)\n lu.assertEquals(candidate('04-12-2003'), true)\n lu.assertEquals(candidate('04122003'), false)\n lu.assertEquals(candidate('20030412'), false)\n lu.assertEquals(candidate('2003-04'), false)\n lu.assertEquals(candidate('2003-04-12'), false)\n lu.assertEquals(candidate('04-2003'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "lua", - "prompt": "-- Write a function that takes a string and returns an ordered version of it.\n-- Ordered version of string, is a string where all words (separated by space)\n-- are replaced by a new word where all the characters arranged in\n-- ascending order based on ascii value.\n-- Note: You should keep the order of words and blank spaces in the sentence.\n-- For example:\n-- anti_shuffle('Hi') returns 'Hi'\n-- anti_shuffle('hello') returns 'ehllo'\n-- anti_shuffle('Hello World!!!') returns 'Hello !!!Wdlor'\nlocal function anti_shuffle(s)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = anti_shuffle\n lu.assertEquals(candidate('Hi'), 'Hi')\n lu.assertEquals(candidate('hello'), 'ehllo')\n lu.assertEquals(candidate('number'), 'bemnru')\n lu.assertEquals(candidate('abcd'), 'abcd')\n lu.assertEquals(candidate('Hello World!!!'), 'Hello !!!Wdlor')\n lu.assertEquals(candidate(''), '')\n lu.assertEquals(candidate('Hi. My name is Mister Robot. How are you?'), '.Hi My aemn is Meirst .Rboot How aer ?ouy')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "lua", - "prompt": "-- Given a list of numbers, return whether or not they are sorted\n-- in ascending order. If list has more than 1 duplicate of the same\n-- number, return False. Assume no negative numbers and only integers.\n-- Examples\n-- is_sorted([5]) \u279e True\n-- is_sorted([1, 2, 3, 4, 5]) \u279e True\n-- is_sorted([1, 3, 2, 4, 5]) \u279e False\n-- is_sorted([1, 2, 3, 4, 5, 6]) \u279e True\n-- is_sorted([1, 2, 3, 4, 5, 6, 7]) \u279e True\n-- is_sorted([1, 3, 2, 4, 5, 6, 7]) \u279e False\n-- is_sorted([1, 2, 2, 3, 3, 4]) \u279e True\n-- is_sorted([1, 2, 2, 2, 3, 4]) \u279e False\nlocal function is_sorted(lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_sorted\n lu.assertEquals(candidate({5}), true)\n lu.assertEquals(candidate({1, 2, 3, 4, 5}), true)\n lu.assertEquals(candidate({1, 3, 2, 4, 5}), false)\n lu.assertEquals(candidate({1, 2, 3, 4, 5, 6}), true)\n lu.assertEquals(candidate({1, 2, 3, 4, 5, 6, 7}), true)\n lu.assertEquals(candidate({1, 3, 2, 4, 5, 6, 7}), false)\n lu.assertEquals(candidate({}), true)\n lu.assertEquals(candidate({1}), true)\n lu.assertEquals(candidate({3, 2, 1}), false)\n lu.assertEquals(candidate({1, 2, 2, 2, 3, 4}), false)\n lu.assertEquals(candidate({1, 2, 3, 3, 3, 4}), false)\n lu.assertEquals(candidate({1, 2, 2, 3, 3, 4}), true)\n lu.assertEquals(candidate({1, 2, 3, 4}), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "lua", - "prompt": "-- You are given a string s.\n-- Your task is to check if the string is happy or not.\n-- A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n-- For example:\n-- is_happy(a) => False\n-- is_happy(aa) => False\n-- is_happy(abcd) => True\n-- is_happy(aabb) => False\n-- is_happy(adb) => True\n-- is_happy(xyy) => False\nlocal function is_happy(s)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_happy\n lu.assertEquals(candidate('a'), false)\n lu.assertEquals(candidate('aa'), false)\n lu.assertEquals(candidate('abcd'), true)\n lu.assertEquals(candidate('aabb'), false)\n lu.assertEquals(candidate('adb'), true)\n lu.assertEquals(candidate('xyy'), false)\n lu.assertEquals(candidate('iopaxpoi'), true)\n lu.assertEquals(candidate('iopaxioi'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "lua", - "prompt": "-- Write a function that returns True if the object q will fly, and False otherwise.\n-- The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n-- Example:\n-- will_it_fly([1, 2], 5) \u279e False \n-- # 1+2 is less than the maximum possible weight, but it's unbalanced.\n-- will_it_fly([3, 2, 3], 1) \u279e False\n-- # it's balanced, but 3+2+3 is more than the maximum possible weight.\n-- will_it_fly([3, 2, 3], 9) \u279e True\n-- # 3+2+3 is less than the maximum possible weight, and it's balanced.\n-- will_it_fly([3], 5) \u279e True\n-- # 3 is less than the maximum possible weight, and it's balanced.\nlocal function will_it_fly(q, w)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = will_it_fly\n lu.assertEquals(candidate({3, 2, 3}, 9), true)\n lu.assertEquals(candidate({1, 2}, 5), false)\n lu.assertEquals(candidate({3}, 5), true)\n lu.assertEquals(candidate({3, 2, 3}, 1), false)\n lu.assertEquals(candidate({1, 2, 3}, 6), false)\n lu.assertEquals(candidate({5}, 5), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "lua", - "prompt": "-- Given an array of non-negative integers, return a copy of the given array after sorting,\n-- you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n-- or sort it in descending order if the sum( first index value, last index value) is even.\n-- Note:\n-- * don't change the given array.\n-- Examples:\n-- * sort_array([]) => []\n-- * sort_array([5]) => [5]\n-- * sort_array([2, 4, 3, 0, 1, 5]) => [0, 1, 2, 3, 4, 5]\n-- * sort_array([2, 4, 3, 0, 1, 5, 6]) => [6, 5, 4, 3, 2, 1, 0]\nlocal function sort_array(array)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sort_array\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({5}), {5})\n lu.assertEquals(candidate({2, 4, 3, 0, 1, 5}), {0, 1, 2, 3, 4, 5})\n lu.assertEquals(candidate({2, 4, 3, 0, 1, 5, 6}), {6, 5, 4, 3, 2, 1, 0})\n lu.assertEquals(candidate({2, 1}), {1, 2})\n lu.assertEquals(candidate({15, 42, 87, 32, 11, 0}), {0, 11, 15, 32, 42, 87})\n lu.assertEquals(candidate({21, 14, 23, 11}), {23, 21, 14, 11})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "lua", - "prompt": "-- Implement a function that takes an non-negative integer and returns an array of the first n\n-- integers that are prime numbers and less than n.\n-- for example:\n-- count_up_to(5) => [2,3]\n-- count_up_to(11) => [2,3,5,7]\n-- count_up_to(0) => []\n-- count_up_to(20) => [2,3,5,7,11,13,17,19]\n-- count_up_to(1) => []\n-- count_up_to(18) => [2,3,5,7,11,13,17]\nlocal function count_up_to(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = count_up_to\n lu.assertEquals(candidate(5), {2, 3})\n lu.assertEquals(candidate(6), {2, 3, 5})\n lu.assertEquals(candidate(7), {2, 3, 5})\n lu.assertEquals(candidate(10), {2, 3, 5, 7})\n lu.assertEquals(candidate(0), {})\n lu.assertEquals(candidate(22), {2, 3, 5, 7, 11, 13, 17, 19})\n lu.assertEquals(candidate(1), {})\n lu.assertEquals(candidate(18), {2, 3, 5, 7, 11, 13, 17})\n lu.assertEquals(candidate(47), {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43})\n lu.assertEquals(candidate(101), {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "lua", - "prompt": "-- Out of list of strings, return the longest one. Return the first one in case of multiple\n-- strings of the same length. Return None in case the input list is empty.\n-- >>> longest([])\n-- >>> longest(['a', 'b', 'c'])\n-- 'a'\n-- >>> longest(['a', 'bb', 'ccc'])\n-- 'ccc'\nlocal function longest(strings)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = longest\n lu.assertEquals(candidate({}), None)\n lu.assertEquals(candidate({'x', 'y', 'z'}), 'x')\n lu.assertEquals(candidate({'x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc'}), 'zzzz')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "lua", - "prompt": "-- Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n-- reverse the resulting array, and then replace each digit by its corresponding name from\n-- \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n-- For example:\n-- arr = [2, 1, 1, 4, 5, 8, 2, 3] \n-- -> sort arr -> [1, 1, 2, 2, 3, 4, 5, 8] \n-- -> reverse arr -> [8, 5, 4, 3, 2, 2, 1, 1]\n-- return [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n-- If the array is empty, return an empty array:\n-- arr = []\n-- return []\n-- If the array has any strange number ignore it:\n-- arr = [1, -1 , 55] \n-- -> sort arr -> [-1, 1, 55]\n-- -> reverse arr -> [55, 1, -1]\n-- return = ['One']\nlocal function by_length(arr)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = by_length\n lu.assertEquals(candidate({2, 1, 1, 4, 5, 8, 2, 3}), {'Eight', 'Five', 'Four', 'Three', 'Two', 'Two', 'One', 'One'})\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({1, -1, 55}), {'One'})\n lu.assertEquals(candidate({1, -1, 3, 2}), {'Three', 'Two', 'One'})\n lu.assertEquals(candidate({9, 4, 8}), {'Nine', 'Eight', 'Four'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_106_f", - "language": "lua", - "prompt": "-- Implement the function f that takes n as a parameter,\n-- 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\n-- or the sum of numbers from 1 to i otherwise.\n-- i starts from 1.\n-- the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n-- Example:\n-- f(5) == [1, 2, 6, 24, 15]\nlocal function f(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = f\n lu.assertEquals(candidate(5), {1, 2, 6, 24, 15})\n lu.assertEquals(candidate(7), {1, 2, 6, 24, 15, 720, 28})\n lu.assertEquals(candidate(1), {1})\n lu.assertEquals(candidate(3), {1, 2, 6})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "lua", - "prompt": "-- Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n-- >>> fizz_buzz(50)\n-- 0\n-- >>> fizz_buzz(78)\n-- 2\n-- >>> fizz_buzz(79)\n-- 3\nlocal function fizz_buzz(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = fizz_buzz\n lu.assertEquals(candidate(50), 0)\n lu.assertEquals(candidate(78), 2)\n lu.assertEquals(candidate(79), 3)\n lu.assertEquals(candidate(100), 3)\n lu.assertEquals(candidate(200), 6)\n lu.assertEquals(candidate(4000), 192)\n lu.assertEquals(candidate(10000), 639)\n lu.assertEquals(candidate(100000), 8026)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "lua", - "prompt": "-- Given a positive floating point number, it can be decomposed into\n-- and integer part (largest integer smaller than given number) and decimals\n-- (leftover part always smaller than 1).\n-- Return the decimal part of the number.\n-- >>> truncate_number(3.5)\n-- 0.5\nlocal function truncate_number(number)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = truncate_number\n lu.assertEquals(candidate(3.5), 0.5)\n lu.assertEquals(candidate(1.25), 0.25)\n lu.assertEquals(candidate(123.0), 0.0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "lua", - "prompt": "-- For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n-- Empty sum should be equal to 0 and empty product should be equal to 1.\n-- >>> sum_product([])\n-- (0, 1)\n-- >>> sum_product([1, 2, 3, 4])\n-- (10, 24)\nlocal function sum_product(numbers)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sum_product\n lu.assertEquals(candidate({}), {0, 1})\n lu.assertEquals(candidate({1, 1, 1}), {3, 1})\n lu.assertEquals(candidate({100, 0}), {100, 0})\n lu.assertEquals(candidate({3, 5, 7}), {15, 105})\n lu.assertEquals(candidate({10}), {10, 10})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "lua", - "prompt": "-- You are given a 2 dimensional data, as a nested lists,\n-- which is similar to matrix, however, unlike matrices,\n-- each row may contain a different number of columns.\n-- Given lst, and integer x, find integers x in the list,\n-- and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n-- each tuple is a coordinate - (row, columns), starting with 0.\n-- Sort coordinates initially by rows in ascending order.\n-- Also, sort coordinates of the row by columns in descending order.\n-- Examples:\n-- get_row([\n-- [1,2,3,4,5,6],\n-- [1,2,3,4,1,6],\n-- [1,2,3,4,5,1]\n-- ], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n-- get_row([], 1) == []\n-- get_row([[], [1], [1, 2, 3]], 3) == [(2, 2)]\nlocal function get_row(lst, x)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = get_row\n lu.assertEquals(candidate({{1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 1, 6}, {1, 2, 3, 4, 5, 1}}, 1), {{0, 0}, {1, 4}, {1, 0}, {2, 5}, {2, 0}})\n lu.assertEquals(candidate({{1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 6}}, 2), {{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}, {5, 1}})\n lu.assertEquals(candidate({{1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 6}, {1, 1, 3, 4, 5, 6}, {1, 2, 1, 4, 5, 6}, {1, 2, 3, 1, 5, 6}, {1, 2, 3, 4, 1, 6}, {1, 2, 3, 4, 5, 1}}, 1), {{0, 0}, {1, 0}, {2, 1}, {2, 0}, {3, 2}, {3, 0}, {4, 3}, {4, 0}, {5, 4}, {5, 0}, {6, 5}, {6, 0}})\n lu.assertEquals(candidate({}, 1), {})\n lu.assertEquals(candidate({{1}}, 2), {})\n lu.assertEquals(candidate({{}, {1}, {1, 2, 3}}, 3), {{2, 2}})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "lua", - "prompt": "-- You're a hungry rabbit, and you already have eaten a certain number of carrots,\n-- but now you need to eat more carrots to complete the day's meals.\n-- you should return an array of [ total number of eaten carrots after your meals,\n-- the number of carrots left after your meals ]\n-- if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n-- Example:\n-- * eat(5, 6, 10) -> [11, 4]\n-- * eat(4, 8, 9) -> [12, 1]\n-- * eat(1, 10, 10) -> [11, 0]\n-- * eat(2, 11, 5) -> [7, 0]\n-- Variables:\n-- @number : integer\n-- the number of carrots that you have eaten.\n-- @need : integer\n-- the number of carrots that you need to eat.\n-- @remaining : integer\n-- the number of remaining carrots thet exist in stock\n-- Constrain:\n-- * 0 <= number <= 1000\n-- * 0 <= need <= 1000\n-- * 0 <= remaining <= 1000\n-- Have fun :)\nlocal function eat(number, need, remaining)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = eat\n lu.assertEquals(candidate(5, 6, 10), {11, 4})\n lu.assertEquals(candidate(4, 8, 9), {12, 1})\n lu.assertEquals(candidate(1, 10, 10), {11, 0})\n lu.assertEquals(candidate(2, 11, 5), {7, 0})\n lu.assertEquals(candidate(4, 5, 7), {9, 2})\n lu.assertEquals(candidate(4, 5, 1), {5, 0})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "lua", - "prompt": "-- Given a positive integer N, return the total sum of its digits in binary.\n-- Example\n-- For N = 1000, the sum of digits will be 1 the output should be \"1\".\n-- For N = 150, the sum of digits will be 6 the output should be \"110\".\n-- For N = 147, the sum of digits will be 12 the output should be \"1100\".\n-- Variables:\n-- @N integer\n-- Constraints: 0 \u2264 N \u2264 10000.\n-- Output:\n-- a string of binary number\nlocal function solve(N)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = solve\n lu.assertEquals(candidate(1000), '1')\n lu.assertEquals(candidate(150), '110')\n lu.assertEquals(candidate(147), '1100')\n lu.assertEquals(candidate(333), '1001')\n lu.assertEquals(candidate(963), '10010')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "lua", - "prompt": "-- You are given a list of integers.\n-- You need to find the largest prime value and return the sum of its digits.\n-- Examples:\n-- For lst = [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] the output should be 10\n-- For lst = [1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1] the output should be 25\n-- For lst = [1,3,1,32,5107,34,83278,109,163,23,2323,32,30,1,9,3] the output should be 13\n-- For lst = [0,724,32,71,99,32,6,0,5,91,83,0,5,6] the output should be 11\n-- For lst = [0,81,12,3,1,21] the output should be 3\n-- For lst = [0,8,1,2,1,7] the output should be 7\nlocal function skjkasdkd(lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = skjkasdkd\n lu.assertEquals(candidate({0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3}), 10)\n lu.assertEquals(candidate({1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1}), 25)\n lu.assertEquals(candidate({1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3}), 13)\n lu.assertEquals(candidate({0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6}), 11)\n lu.assertEquals(candidate({0, 81, 12, 3, 1, 21}), 3)\n lu.assertEquals(candidate({0, 8, 1, 2, 1, 7}), 7)\n lu.assertEquals(candidate({8191}), 19)\n lu.assertEquals(candidate({8191, 123456, 127, 7}), 19)\n lu.assertEquals(candidate({127, 97, 8192}), 10)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "lua", - "prompt": "-- Given an array arr of integers, find the minimum number of elements that\n-- need to be changed to make the array palindromic. A palindromic array is an array that\n-- is read the same backwards and forwards. In one change, you can change one element to any other element.\n-- For example:\n-- smallest_change([1,2,3,5,4,7,9,6]) == 4\n-- smallest_change([1, 2, 3, 4, 3, 2, 2]) == 1\n-- smallest_change([1, 2, 3, 2, 1]) == 0\nlocal function smallest_change(arr)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = smallest_change\n lu.assertEquals(candidate({1, 2, 3, 5, 4, 7, 9, 6}), 4)\n lu.assertEquals(candidate({1, 2, 3, 4, 3, 2, 2}), 1)\n lu.assertEquals(candidate({1, 4, 2}), 1)\n lu.assertEquals(candidate({1, 4, 4, 2}), 1)\n lu.assertEquals(candidate({1, 2, 3, 2, 1}), 0)\n lu.assertEquals(candidate({3, 1, 1, 3}), 0)\n lu.assertEquals(candidate({1}), 0)\n lu.assertEquals(candidate({0, 1}), 1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "lua", - "prompt": "-- It is the last week of the semester and the teacher has to give the grades\n-- to students. The teacher has been making her own algorithm for grading.\n-- The only problem is, she has lost the code she used for grading.\n-- She has given you a list of GPAs for some students and you have to write \n-- a function that can output a list of letter grades using the following table:\n-- GPA | Letter grade\n-- 4.0 A+\n-- > 3.7 A \n-- > 3.3 A- \n-- > 3.0 B+\n-- > 2.7 B \n-- > 2.3 B-\n-- > 2.0 C+\n-- > 1.7 C\n-- > 1.3 C-\n-- > 1.0 D+ \n-- > 0.7 D \n-- > 0.0 D-\n-- 0.0 E\n-- Example:\n-- grade_equation([4.0, 3, 1.7, 2, 3.5]) ==> ['A+', 'B', 'C-', 'C', 'A-']\nlocal function numerical_letter_grade(grades)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = numerical_letter_grade\n lu.assertEquals(candidate({4.0, 3, 1.7, 2, 3.5}), {'A+', 'B', 'C-', 'C', 'A-'})\n lu.assertEquals(candidate({1.2}), {'D+'})\n lu.assertEquals(candidate({0.5}), {'D-'})\n lu.assertEquals(candidate({0.0}), {'E'})\n lu.assertEquals(candidate({1.0, 0.3, 1.5, 2.8, 3.3}), {'D', 'D-', 'C-', 'B', 'B+'})\n lu.assertEquals(candidate({0.0, 0.7}), {'E', 'D-'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "lua", - "prompt": "-- Given the lengths of the three sides of a triangle. Return the area of\n-- the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n-- Otherwise return -1\n-- Three sides make a valid triangle when the sum of any two sides is greater \n-- than the third side.\n-- Example:\n-- triangle_area(3, 4, 5) == 6.00\n-- triangle_area(1, 2, 10) == -1\nlocal function triangle_area(a, b, c)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = triangle_area\n lu.assertEquals(candidate(3, 4, 5), 6.0)\n lu.assertEquals(candidate(1, 2, 10), -1)\n lu.assertEquals(candidate(4, 8, 5), 8.18)\n lu.assertEquals(candidate(2, 2, 2), 1.73)\n lu.assertEquals(candidate(1, 2, 3), -1)\n lu.assertEquals(candidate(10, 5, 7), 16.25)\n lu.assertEquals(candidate(2, 6, 3), -1)\n lu.assertEquals(candidate(1, 1, 1), 0.43)\n lu.assertEquals(candidate(2, 2, 10), -1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "lua", - "prompt": "-- Check if two words have the same characters.\n-- >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n-- True\n-- >>> same_chars('abcd', 'dddddddabc')\n-- True\n-- >>> same_chars('dddddddabc', 'abcd')\n-- True\n-- >>> same_chars('eabcd', 'dddddddabc')\n-- False\n-- >>> same_chars('abcd', 'dddddddabce')\n-- False\n-- >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc')\n-- False\nlocal function same_chars(s0, s1)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = same_chars\n lu.assertEquals(candidate('eabcdzzzz', 'dddzzzzzzzddeddabc'), true)\n lu.assertEquals(candidate('abcd', 'dddddddabc'), true)\n lu.assertEquals(candidate('dddddddabc', 'abcd'), true)\n lu.assertEquals(candidate('eabcd', 'dddddddabc'), false)\n lu.assertEquals(candidate('abcd', 'dddddddabcf'), false)\n lu.assertEquals(candidate('eabcdzzzz', 'dddzzzzzzzddddabc'), false)\n lu.assertEquals(candidate('aabb', 'aaccc'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "lua", - "prompt": "-- Given an array of integers nums, find the minimum sum of any non-empty sub-array\n-- of nums.\n-- Example\n-- minSubArraySum([2, 3, 4, 1, 2, 4]) == 1\n-- minSubArraySum([-1, -2, -3]) == -6\nlocal function minSubArraySum(nums)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = minSubArraySum\n lu.assertEquals(candidate({2, 3, 4, 1, 2, 4}), 1)\n lu.assertEquals(candidate({-1, -2, -3}), -6)\n lu.assertEquals(candidate({-1, -2, -3, 2, -10}), -14)\n lu.assertEquals(candidate({-9999999999999999}), -9999999999999999)\n lu.assertEquals(candidate({0, 10, 20, 1000000}), 0)\n lu.assertEquals(candidate({-1, -2, -3, 10, -5}), -6)\n lu.assertEquals(candidate({100, -1, -2, -3, 10, -5}), -6)\n lu.assertEquals(candidate({10, 11, 13, 8, 3, 4}), 3)\n lu.assertEquals(candidate({100, -33, 32, -1, 0, -2}), -33)\n lu.assertEquals(candidate({-10}), -10)\n lu.assertEquals(candidate({7}), 7)\n lu.assertEquals(candidate({1, -1}), -1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "lua", - "prompt": "-- Given a string s and a natural number n, you have been tasked to implement \n-- a function that returns a list of all words from string s that contain exactly \n-- n consonants, in order these words appear in the string s.\n-- If the string s is empty then the function should return an empty list.\n-- Note: you may assume the input string contains only letters and spaces.\n-- Examples:\n-- select_words(\"Mary had a little lamb\", 4) ==> [\"little\"]\n-- select_words(\"Mary had a little lamb\", 3) ==> [\"Mary\", \"lamb\"]\n-- select_words(\"simple white space\", 2) ==> []\n-- select_words(\"Hello world\", 4) ==> [\"world\"]\n-- select_words(\"Uncle sam\", 3) ==> [\"Uncle\"]\nlocal function select_words(s, n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = select_words\n lu.assertEquals(candidate('Mary had a little lamb', 4), {'little'})\n lu.assertEquals(candidate('Mary had a little lamb', 3), {'Mary', 'lamb'})\n lu.assertEquals(candidate('simple white space', 2), {})\n lu.assertEquals(candidate('Hello world', 4), {'world'})\n lu.assertEquals(candidate('Uncle sam', 3), {'Uncle'})\n lu.assertEquals(candidate('', 4), {})\n lu.assertEquals(candidate('a b c d e f', 1), {'b', 'c', 'd', 'f'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "lua", - "prompt": "-- Return list of all prefixes from shortest to longest of the input string\n-- >>> all_prefixes('abc')\n-- ['a', 'ab', 'abc']\nlocal function all_prefixes(string)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = all_prefixes\n lu.assertEquals(candidate(''), {})\n lu.assertEquals(candidate('asdfgh'), {'a', 'as', 'asd', 'asdf', 'asdfg', 'asdfgh'})\n lu.assertEquals(candidate('WWW'), {'W', 'WW', 'WWW'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "lua", - "prompt": "-- Create a function that takes a value (string) representing a number\n-- and returns the closest integer to it. If the number is equidistant\n-- from two integers, round it away from zero.\n-- Examples\n-- >>> closest_integer(\"10\")\n-- 10\n-- >>> closest_integer(\"15.3\")\n-- 15\n-- Note:\n-- Rounding away from zero means that if the given number is equidistant\n-- from two integers, the one you should return is the one that is the\n-- farthest from zero. For example closest_integer(\"14.5\") should\n-- return 15 and closest_integer(\"-14.5\") should return -15.\nlocal function closest_integer(value)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = closest_integer\n lu.assertEquals(candidate('10'), 10)\n lu.assertEquals(candidate('14.5'), 15)\n lu.assertEquals(candidate('-15.5'), -16)\n lu.assertEquals(candidate('15.3'), 15)\n lu.assertEquals(candidate('0'), 0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "lua", - "prompt": "-- Create a function which takes a string representing a file's name, and returns\n-- 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n-- A file's name is considered to be valid if and only if all the following conditions \n-- are met:\n-- - There should not be more than three digits ('0'-'9') in the file's name.\n-- - The file's name contains exactly one dot '.'\n-- - The substring before the dot should not be empty, and it starts with a letter from \n-- the latin alphapet ('a'-'z' and 'A'-'Z').\n-- - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n-- Examples:\n-- file_name_check(\"example.txt\") # => 'Yes'\n-- file_name_check(\"1example.dll\") # => 'No' (the name should start with a latin alphapet letter)\nlocal function file_name_check(file_name)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = file_name_check\n lu.assertEquals(candidate('example.txt'), 'Yes')\n lu.assertEquals(candidate('1example.dll'), 'No')\n lu.assertEquals(candidate('s1sdf3.asd'), 'No')\n lu.assertEquals(candidate('K.dll'), 'Yes')\n lu.assertEquals(candidate('MY16FILE3.exe'), 'Yes')\n lu.assertEquals(candidate('His12FILE94.exe'), 'No')\n lu.assertEquals(candidate('_Y.txt'), 'No')\n lu.assertEquals(candidate('?aREYA.exe'), 'No')\n lu.assertEquals(candidate('/this_is_valid.dll'), 'No')\n lu.assertEquals(candidate('this_is_valid.wow'), 'No')\n lu.assertEquals(candidate('this_is_valid.txt'), 'Yes')\n lu.assertEquals(candidate('this_is_valid.txtexe'), 'No')\n lu.assertEquals(candidate('#this2_i4s_5valid.ten'), 'No')\n lu.assertEquals(candidate('@this1_is6_valid.exe'), 'No')\n lu.assertEquals(candidate('this_is_12valid.6exe4.txt'), 'No')\n lu.assertEquals(candidate('all.exe.txt'), 'No')\n lu.assertEquals(candidate('I563_No.exe'), 'Yes')\n lu.assertEquals(candidate('Is3youfault.txt'), 'Yes')\n lu.assertEquals(candidate('no_one#knows.dll'), 'Yes')\n lu.assertEquals(candidate('1I563_Yes3.exe'), 'No')\n lu.assertEquals(candidate('I563_Yes3.txtt'), 'No')\n lu.assertEquals(candidate('final..txt'), 'No')\n lu.assertEquals(candidate('final132'), 'No')\n lu.assertEquals(candidate('_f4indsartal132.'), 'No')\n lu.assertEquals(candidate('.txt'), 'No')\n lu.assertEquals(candidate('s.'), 'No')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "lua", - "prompt": "-- You are given two intervals,\n-- where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n-- The given intervals are closed which means that the interval (start, end)\n-- includes both start and end.\n-- For each given interval, it is assumed that its start is less or equal its end.\n-- Your task is to determine whether the length of intersection of these two \n-- intervals is a prime number.\n-- Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n-- which its length is 1, which not a prime number.\n-- If the length of the intersection is a prime number, return \"YES\",\n-- otherwise, return \"NO\".\n-- If the two intervals don't intersect, return \"NO\".\n-- [input/output] samples:\n-- intersection((1, 2), (2, 3)) ==> \"NO\"\n-- intersection((-1, 1), (0, 4)) ==> \"NO\"\n-- intersection((-3, -1), (-5, 5)) ==> \"YES\"\nlocal function intersection(interval1, interval2)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = intersection\n lu.assertEquals(candidate({1, 2}, {2, 3}), 'NO')\n lu.assertEquals(candidate({-1, 1}, {0, 4}), 'NO')\n lu.assertEquals(candidate({-3, -1}, {-5, 5}), 'YES')\n lu.assertEquals(candidate({-2, 2}, {-4, 0}), 'YES')\n lu.assertEquals(candidate({-11, 2}, {-1, -1}), 'NO')\n lu.assertEquals(candidate({1, 2}, {3, 5}), 'NO')\n lu.assertEquals(candidate({1, 2}, {1, 2}), 'NO')\n lu.assertEquals(candidate({-2, -2}, {-3, -2}), 'NO')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "lua", - "prompt": "-- Return the largest prime factor of n. Assume n > 1 and is not a prime.\n-- >>> largest_prime_factor(13195)\n-- 29\n-- >>> largest_prime_factor(2048)\n-- 2\nlocal function largest_prime_factor(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = largest_prime_factor\n lu.assertEquals(candidate(15), 5)\n lu.assertEquals(candidate(27), 3)\n lu.assertEquals(candidate(63), 7)\n lu.assertEquals(candidate(330), 11)\n lu.assertEquals(candidate(13195), 29)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "lua", - "prompt": "-- Given a string, find out how many distinct characters (regardless of case) does it consist of\n-- >>> count_distinct_characters('xyzXYZ')\n-- 3\n-- >>> count_distinct_characters('Jerry')\n-- 4\nlocal function count_distinct_characters(string)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = count_distinct_characters\n lu.assertEquals(candidate(''), 0)\n lu.assertEquals(candidate('abcde'), 5)\n lu.assertEquals(candidate('abcdecadeCADE'), 5)\n lu.assertEquals(candidate('aaaaAAAAaaaa'), 1)\n lu.assertEquals(candidate('Jerry jERRY JeRRRY'), 5)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "lua", - "prompt": "-- You're given a list of deposit and withdrawal operations on a bank account that starts with\n-- zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n-- at that point function should return True. Otherwise it should return False.\n-- >>> below_zero([1, 2, 3])\n-- False\n-- >>> below_zero([1, 2, -4, 5])\n-- True\nlocal function below_zero(operations)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = below_zero\n lu.assertEquals(candidate({}), false)\n lu.assertEquals(candidate({1, 2, -3, 1, 2, -3}), false)\n lu.assertEquals(candidate({1, 2, -4, 5, 6}), true)\n lu.assertEquals(candidate({1, -1, 2, -2, 5, -5, 4, -4}), false)\n lu.assertEquals(candidate({1, -1, 2, -2, 5, -5, 4, -5}), true)\n lu.assertEquals(candidate({1, -2, 2, -2, 5, -5, 4, -4}), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "lua", - "prompt": "-- Find the shortest palindrome that begins with a supplied string.\n-- Algorithm idea is simple:\n-- - Find the longest postfix of supplied string that is a palindrome.\n-- - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n-- >>> make_palindrome('')\n-- ''\n-- >>> make_palindrome('cat')\n-- 'catac'\n-- >>> make_palindrome('cata')\n-- 'catac'\nlocal function make_palindrome(string)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = make_palindrome\n lu.assertEquals(candidate(''), '')\n lu.assertEquals(candidate('x'), 'x')\n lu.assertEquals(candidate('xyz'), 'xyzyx')\n lu.assertEquals(candidate('xyx'), 'xyx')\n lu.assertEquals(candidate('jerry'), 'jerryrrej')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "lua", - "prompt": "-- Given a positive integer, obtain its roman numeral equivalent as a string,\n-- and return it in lowercase.\n-- Restrictions: 1 <= num <= 1000\n-- Examples:\n-- >>> int_to_mini_roman(19) == 'xix'\n-- >>> int_to_mini_roman(152) == 'clii'\n-- >>> int_to_mini_roman(426) == 'cdxxvi'\nlocal function int_to_mini_roman(number)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = int_to_mini_roman\n lu.assertEquals(candidate(19), 'xix')\n lu.assertEquals(candidate(152), 'clii')\n lu.assertEquals(candidate(251), 'ccli')\n lu.assertEquals(candidate(426), 'cdxxvi')\n lu.assertEquals(candidate(500), 'd')\n lu.assertEquals(candidate(1), 'i')\n lu.assertEquals(candidate(4), 'iv')\n lu.assertEquals(candidate(43), 'xliii')\n lu.assertEquals(candidate(90), 'xc')\n lu.assertEquals(candidate(94), 'xciv')\n lu.assertEquals(candidate(532), 'dxxxii')\n lu.assertEquals(candidate(900), 'cm')\n lu.assertEquals(candidate(994), 'cmxciv')\n lu.assertEquals(candidate(1000), 'm')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - } -] \ No newline at end of file diff --git a/data/lua-remove.json b/data/lua-remove.json deleted file mode 100644 index cf5cc368b77942a8ce37ba07cd776f5312397a1a..0000000000000000000000000000000000000000 --- a/data/lua-remove.json +++ /dev/null @@ -1,2372 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "lua", - "prompt": "-- For a given number n, find the largest number that divides n evenly, smaller than n\nlocal function largest_divisor(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = largest_divisor\n lu.assertEquals(candidate(3), 1)\n lu.assertEquals(candidate(7), 1)\n lu.assertEquals(candidate(10), 5)\n lu.assertEquals(candidate(100), 50)\n lu.assertEquals(candidate(49), 7)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_47_median", - "language": "lua", - "prompt": "-- Return median of elements in the list l.\nlocal function median(l)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = median\n lu.assertEquals(candidate({3, 1, 2, 4, 5}), 3)\n lu.assertEquals(candidate({-10, 4, 6, 1000, 10, 20}), 8.0)\n lu.assertEquals(candidate({5}), 5)\n lu.assertEquals(candidate({6, 5}), 5.5)\n lu.assertEquals(candidate({8, 1, 3, 9, 9, 2, 7}), 7)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "lua", - "prompt": "-- Return maximum element in the list.\nlocal function max_element(l)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = max_element\n lu.assertEquals(candidate({1, 2, 3}), 3)\n lu.assertEquals(candidate({5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10}), 124)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "lua", - "prompt": "-- Create a function which returns the largest index of an element which\n-- is not greater than or equal to the element immediately preceding it. If\n-- no such element exists then return -1. The given array will not contain\n-- duplicate values.\n-- Examples:\nlocal function can_arrange(arr)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = can_arrange\n lu.assertEquals(candidate({1, 2, 4, 3, 5}), 3)\n lu.assertEquals(candidate({1, 2, 4, 5}), -1)\n lu.assertEquals(candidate({1, 4, 2, 5, 6, 7, 8, 9, 10}), 2)\n lu.assertEquals(candidate({4, 8, 5, 7, 3}), 4)\n lu.assertEquals(candidate({}), -1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "lua", - "prompt": "-- Create a function that returns True if the last character\n-- of a given string is an alphabetical character and is not\n-- a part of a word, and False otherwise.\n-- Note: \"word\" is a group of characters separated by space.\n-- Examples:\nlocal function check_if_last_char_is_a_letter(txt)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = check_if_last_char_is_a_letter\n lu.assertEquals(candidate('apple'), false)\n lu.assertEquals(candidate('apple pi e'), true)\n lu.assertEquals(candidate('eeeee'), false)\n lu.assertEquals(candidate('A'), true)\n lu.assertEquals(candidate('Pumpkin pie '), false)\n lu.assertEquals(candidate('Pumpkin pie 1'), false)\n lu.assertEquals(candidate(''), false)\n lu.assertEquals(candidate('eeeee e '), false)\n lu.assertEquals(candidate('apple pie'), false)\n lu.assertEquals(candidate('apple pi e '), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "lua", - "prompt": "-- Return true if a given number is prime, and false otherwise.\nlocal function is_prime(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_prime\n lu.assertEquals(candidate(6), false)\n lu.assertEquals(candidate(101), true)\n lu.assertEquals(candidate(11), true)\n lu.assertEquals(candidate(13441), true)\n lu.assertEquals(candidate(61), true)\n lu.assertEquals(candidate(4), false)\n lu.assertEquals(candidate(1), false)\n lu.assertEquals(candidate(5), true)\n lu.assertEquals(candidate(11), true)\n lu.assertEquals(candidate(17), true)\n lu.assertEquals(candidate(85), false)\n lu.assertEquals(candidate(77), false)\n lu.assertEquals(candidate(255379), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "lua", - "prompt": "-- Given a list of positive integers x. return a sorted list of all \n-- elements that hasn't any even digit.\n-- Note: Returned list should be sorted in increasing order.\n-- For example:\nlocal function unique_digits(x)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = unique_digits\n lu.assertEquals(candidate({15, 33, 1422, 1}), {1, 15, 33})\n lu.assertEquals(candidate({152, 323, 1422, 10}), {})\n lu.assertEquals(candidate({12345, 2033, 111, 151}), {111, 151})\n lu.assertEquals(candidate({135, 103, 31}), {31, 135})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "lua", - "prompt": "-- Input are two strings a and b consisting only of 1s and 0s.\n-- Perform binary XOR on these inputs and return result also as a string.\nlocal function string_xor(a, b)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = string_xor\n lu.assertEquals(candidate('111000', '101010'), '010010')\n lu.assertEquals(candidate('1', '1'), '0')\n lu.assertEquals(candidate('0101', '0000'), '0101')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "lua", - "prompt": "-- sum_to_n is a function that sums numbers from 1 to n.\nlocal function sum_to_n(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sum_to_n\n lu.assertEquals(candidate(1), 1)\n lu.assertEquals(candidate(6), 21)\n lu.assertEquals(candidate(11), 66)\n lu.assertEquals(candidate(30), 465)\n lu.assertEquals(candidate(100), 5050)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "lua", - "prompt": "-- Given a list of numbers, return the sum of squares of the numbers\n-- in the list that are odd. Ignore numbers that are negative or not integers.\n-- If the input list is empty, return 0.\nlocal function double_the_difference(lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = double_the_difference\n lu.assertEquals(candidate({}), 0)\n lu.assertEquals(candidate({5.0, 4.0}), 25)\n lu.assertEquals(candidate({0.1, 0.2, 0.3}), 0)\n lu.assertEquals(candidate({-10.0, -20.0, -30.0}), 0)\n lu.assertEquals(candidate({-1.0, -2.0, 8.0}), 0)\n lu.assertEquals(candidate({0.2, 3.0, 5.0}), 34)\n lu.assertEquals(candidate({-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0}), 165)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "lua", - "prompt": "-- Return length of given string\nlocal function strlen(string)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = strlen\n lu.assertEquals(candidate(''), 0)\n lu.assertEquals(candidate('x'), 1)\n lu.assertEquals(candidate('asdasnakj'), 9)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "lua", - "prompt": "-- You'll be given a string of words, and your task is to count the number\n-- of boredoms. A boredom is a sentence that starts with the word \"I\".\n-- Sentences are delimited by '.', '?' or '!'.\n-- For example:\nlocal function is_bored(S)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_bored\n lu.assertEquals(candidate('Hello world'), 0)\n lu.assertEquals(candidate('Is the sky blue?'), 0)\n lu.assertEquals(candidate('I love It !'), 1)\n lu.assertEquals(candidate('bIt'), 0)\n lu.assertEquals(candidate('I feel good today. I will be productive. will kill It'), 2)\n lu.assertEquals(candidate('You and I are going for a walk'), 0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "lua", - "prompt": "-- Write a function vowels_count which takes a string representing\n-- a word as input and returns the number of vowels in the string.\n-- Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n-- vowel, but only when it is at the end of the given word.\n-- Example:\nlocal function vowels_count(s)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = vowels_count\n lu.assertEquals(candidate('abcde'), 2)\n lu.assertEquals(candidate('Alone'), 3)\n lu.assertEquals(candidate('key'), 2)\n lu.assertEquals(candidate('bye'), 1)\n lu.assertEquals(candidate('keY'), 2)\n lu.assertEquals(candidate('bYe'), 1)\n lu.assertEquals(candidate('ACEDY'), 3)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "lua", - "prompt": "-- Return n-th Fibonacci number.\nlocal function fib(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = fib\n lu.assertEquals(candidate(10), 55)\n lu.assertEquals(candidate(1), 1)\n lu.assertEquals(candidate(8), 21)\n lu.assertEquals(candidate(11), 89)\n lu.assertEquals(candidate(12), 144)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "lua", - "prompt": "-- Your task is to implement a function that will simplify the expression\n-- x * n. The function returns True if x * n evaluates to a whole number and False\n-- otherwise. Both x and n, are string representation of a fraction, and have the following format,\n-- / where both numerator and denominator are positive whole numbers.\n-- You can assume that x, and n are valid fractions, and do not have zero as denominator.\nlocal function simplify(x, n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = simplify\n lu.assertEquals(candidate('1/5', '5/1'), true)\n lu.assertEquals(candidate('1/6', '2/1'), false)\n lu.assertEquals(candidate('5/1', '3/1'), true)\n lu.assertEquals(candidate('7/10', '10/2'), false)\n lu.assertEquals(candidate('2/10', '50/10'), true)\n lu.assertEquals(candidate('7/2', '4/2'), true)\n lu.assertEquals(candidate('11/6', '6/1'), true)\n lu.assertEquals(candidate('2/3', '5/2'), false)\n lu.assertEquals(candidate('5/2', '3/5'), false)\n lu.assertEquals(candidate('2/4', '8/4'), true)\n lu.assertEquals(candidate('2/4', '4/2'), true)\n lu.assertEquals(candidate('1/5', '5/1'), true)\n lu.assertEquals(candidate('1/5', '1/5'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "lua", - "prompt": "-- Given a string s, count the number of uppercase vowels in even indices.\n-- For example:\nlocal function count_upper(s)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = count_upper\n lu.assertEquals(candidate('aBCdEf'), 1)\n lu.assertEquals(candidate('abcdefg'), 0)\n lu.assertEquals(candidate('dBBE'), 0)\n lu.assertEquals(candidate('B'), 0)\n lu.assertEquals(candidate('U'), 1)\n lu.assertEquals(candidate(''), 0)\n lu.assertEquals(candidate('EEEE'), 2)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "lua", - "prompt": "-- You are given a rectangular grid of wells. Each row represents a single well,\n-- and each 1 in a row represents a single unit of water.\n-- Each well has a corresponding bucket that can be used to extract water from it, \n-- and all buckets have the same capacity.\n-- Your task is to use the buckets to empty the wells.\n-- Output the number of times you need to lower the buckets.\n-- Example 1:\n-- Example 2:\n-- Example 3:\n-- Constraints:\n-- * all wells have the same length\n-- * 1 <= grid.length <= 10^2\n-- * 1 <= grid[:,1].length <= 10^2\n-- * grid[i][j] -> 0 | 1\n-- * 1 <= capacity <= 10\nlocal function max_fill(grid, capacity)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = max_fill\n lu.assertEquals(candidate({{0, 0, 1, 0}, {0, 1, 0, 0}, {1, 1, 1, 1}}, 1), 6)\n lu.assertEquals(candidate({{0, 0, 1, 1}, {0, 0, 0, 0}, {1, 1, 1, 1}, {0, 1, 1, 1}}, 2), 5)\n lu.assertEquals(candidate({{0, 0, 0}, {0, 0, 0}}, 5), 0)\n lu.assertEquals(candidate({{1, 1, 1, 1}, {1, 1, 1, 1}}, 2), 4)\n lu.assertEquals(candidate({{1, 1, 1, 1}, {1, 1, 1, 1}}, 9), 2)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "lua", - "prompt": "-- Given an array arr of integers and a positive integer k, return a sorted list \n-- of length k with the maximum k numbers in arr.\n-- Example 1:\n-- Example 2:\n-- Example 3:\n-- Note:\n-- 1. The length of the array will be in the range of [1, 1000].\n-- 2. The elements in the array will be in the range of [-1000, 1000].\n-- 3. 0 <= k <= len(arr)\nlocal function maximum(arr, k)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = maximum\n lu.assertEquals(candidate({-3, -4, 5}, 3), {-4, -3, 5})\n lu.assertEquals(candidate({4, -4, 4}, 2), {4, 4})\n lu.assertEquals(candidate({-3, 2, 1, 2, -1, -2, 1}, 1), {2})\n lu.assertEquals(candidate({123, -123, 20, 0, 1, 2, -3}, 3), {2, 20, 123})\n lu.assertEquals(candidate({-123, 20, 0, 1, 2, -3}, 4), {0, 1, 2, 20})\n lu.assertEquals(candidate({5, 15, 0, 3, -13, -8, 0}, 7), {-13, -8, 0, 0, 3, 5, 15})\n lu.assertEquals(candidate({-1, 0, 2, 5, 3, -10}, 2), {3, 5})\n lu.assertEquals(candidate({1, 0, 5, -7}, 1), {5})\n lu.assertEquals(candidate({4, -4}, 2), {-4, 4})\n lu.assertEquals(candidate({-10, 10}, 2), {-10, 10})\n lu.assertEquals(candidate({1, 2, 3, -23, 243, -400, 0}, 0), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "lua", - "prompt": "-- Write a function that takes a message, and encodes in such a \n-- way that it swaps case of all letters, replaces all vowels in \n-- the message with the letter that appears 2 places ahead of that \n-- vowel in the english alphabet. \n-- Assume only letters. \n-- Examples:\nlocal function encode(message)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = encode\n lu.assertEquals(candidate('TEST'), 'tgst')\n lu.assertEquals(candidate('Mudasir'), 'mWDCSKR')\n lu.assertEquals(candidate('YES'), 'ygs')\n lu.assertEquals(candidate('This is a message'), 'tHKS KS C MGSSCGG')\n lu.assertEquals(candidate('I DoNt KnOw WhAt tO WrItE'), 'k dQnT kNqW wHcT Tq wRkTg')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "lua", - "prompt": "-- remove_vowels is a function that takes string and returns string without vowels.\nlocal function remove_vowels(text)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = remove_vowels\n lu.assertEquals(candidate(''), '')\n lu.assertEquals(candidate('abcdef\\nghijklm'), 'bcdf\\nghjklm')\n lu.assertEquals(candidate('fedcba'), 'fdcb')\n lu.assertEquals(candidate('eeeee'), '')\n lu.assertEquals(candidate('acBAA'), 'cB')\n lu.assertEquals(candidate('EcBOO'), 'cB')\n lu.assertEquals(candidate('ybcd'), 'ybcd')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "lua", - "prompt": "-- Return only positive numbers in the list.\nlocal function get_positive(l)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = get_positive\n lu.assertEquals(candidate({-1, -2, 4, 5, 6}), {4, 5, 6})\n lu.assertEquals(candidate({5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10}), {5, 3, 2, 3, 3, 9, 123, 1})\n lu.assertEquals(candidate({-1, -2}), {})\n lu.assertEquals(candidate({}), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "lua", - "prompt": "-- Return a string containing space-delimited numbers starting from 0 upto n inclusive.\nlocal function string_sequence(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = string_sequence\n lu.assertEquals(candidate(0), '0')\n lu.assertEquals(candidate(3), '0 1 2 3')\n lu.assertEquals(candidate(10), '0 1 2 3 4 5 6 7 8 9 10')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "lua", - "prompt": "-- Given a positive integer n, you have to make a pile of n levels of stones.\n-- The first level has n stones.\n-- The number of stones in the next level is:\n-- - the next odd number if n is odd.\n-- - the next even number if n is even.\n-- Return the number of stones in each level in a list, where element at index\n-- i represents the number of stones in the level (i+1).\n-- Examples:\nlocal function make_a_pile(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = make_a_pile\n lu.assertEquals(candidate(3), {3, 5, 7})\n lu.assertEquals(candidate(4), {4, 6, 8, 10})\n lu.assertEquals(candidate(5), {5, 7, 9, 11, 13})\n lu.assertEquals(candidate(6), {6, 8, 10, 12, 14, 16})\n lu.assertEquals(candidate(8), {8, 10, 12, 14, 16, 18, 20, 22})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "lua", - "prompt": "-- Task\n-- 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\n-- then check if the result string is palindrome.\n-- A string is called palindrome if it reads the same backward as forward.\n-- You should return a tuple containing the result string and True/False for the check.\n-- Example\nlocal function reverse_delete(s, c)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = reverse_delete\n lu.assertEquals(candidate('abcde', 'ae'), {'bcd', false})\n lu.assertEquals(candidate('abcdef', 'b'), {'acdef', false})\n lu.assertEquals(candidate('abcdedcba', 'ab'), {'cdedc', true})\n lu.assertEquals(candidate('dwik', 'w'), {'dik', false})\n lu.assertEquals(candidate('a', 'a'), {'', true})\n lu.assertEquals(candidate('abcdedcba', ''), {'abcdedcba', true})\n lu.assertEquals(candidate('abcdedcba', 'v'), {'abcdedcba', true})\n lu.assertEquals(candidate('vabba', 'v'), {'abba', true})\n lu.assertEquals(candidate('mamma', 'mia'), {'', true})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "lua", - "prompt": "-- For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\nlocal function flip_case(string)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = flip_case\n lu.assertEquals(candidate(''), '')\n lu.assertEquals(candidate('Hello!'), 'hELLO!')\n lu.assertEquals(candidate('These violent delights have violent ends'), 'tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "lua", - "prompt": "-- You are given a string s.\n-- if s[i] is a letter, reverse its case from lower to upper or vise versa, \n-- otherwise keep it as it is.\n-- If the string contains no letters, reverse the string.\n-- The function should return the resulted string.\n-- Examples\nlocal function solve(s)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = solve\n lu.assertEquals(candidate('AsDf'), 'aSdF')\n lu.assertEquals(candidate('1234'), '4321')\n lu.assertEquals(candidate('ab'), 'AB')\n lu.assertEquals(candidate('#a@C'), '#A@c')\n lu.assertEquals(candidate('#AsdfW^45'), '#aSDFw^45')\n lu.assertEquals(candidate('#6@2'), '2@6#')\n lu.assertEquals(candidate('#$a^D'), '#$A^d')\n lu.assertEquals(candidate('#ccc'), '#CCC')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "lua", - "prompt": "-- Filter an input list of strings only for ones that start with a given prefix.\nlocal function filter_by_prefix(strings, prefix)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = filter_by_prefix\n lu.assertEquals(candidate({}, 'john'), {})\n lu.assertEquals(candidate({'xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'}, 'xxx'), {'xxx', 'xxxAAA', 'xxx'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "lua", - "prompt": "-- This function takes two positive numbers x and y and returns the\n-- biggest even integer number that is in the range [x, y] inclusive. If \n-- there's no such number, then the function should return -1.\n-- For example:\nlocal function choose_num(x, y)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = choose_num\n lu.assertEquals(candidate(12, 15), 14)\n lu.assertEquals(candidate(13, 12), -1)\n lu.assertEquals(candidate(33, 12354), 12354)\n lu.assertEquals(candidate(5234, 5233), -1)\n lu.assertEquals(candidate(6, 29), 28)\n lu.assertEquals(candidate(27, 10), -1)\n lu.assertEquals(candidate(7, 7), -1)\n lu.assertEquals(candidate(546, 546), 546)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "lua", - "prompt": "-- You are given a string representing a sentence,\n-- the sentence contains some words separated by a space,\n-- and you have to return a string that contains the words from the original sentence,\n-- whose lengths are prime numbers,\n-- the order of the words in the new string should be the same as the original one.\n-- Example 1:\n-- Example 2:\n-- Constraints:\n-- * 1 <= len(sentence) <= 100\n-- * sentence contains only letters\nlocal function words_in_sentence(sentence)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = words_in_sentence\n lu.assertEquals(candidate('This is a test'), 'is')\n lu.assertEquals(candidate('lets go for swimming'), 'go for')\n lu.assertEquals(candidate('there is no place available here'), 'there is no place')\n lu.assertEquals(candidate('Hi I am Hussein'), 'Hi am Hussein')\n lu.assertEquals(candidate('go for it'), 'go for it')\n lu.assertEquals(candidate('here'), '')\n lu.assertEquals(candidate('here is'), 'is')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "lua", - "prompt": "-- Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\nlocal function intersperse(numbers, delimeter)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = intersperse\n lu.assertEquals(candidate({}, 7), {})\n lu.assertEquals(candidate({5, 6, 3, 2}, 8), {5, 8, 6, 8, 3, 8, 2})\n lu.assertEquals(candidate({2, 2, 2}, 2), {2, 2, 2, 2, 2})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "lua", - "prompt": "-- Your task is to write a function that returns true if a number x is a simple\n-- power of n and false in other cases.\n-- x is a simple power of n if n**int=x\n-- For example:\nlocal function is_simple_power(x, n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_simple_power\n lu.assertEquals(candidate(16, 2), true)\n lu.assertEquals(candidate(143214, 16), false)\n lu.assertEquals(candidate(4, 2), true)\n lu.assertEquals(candidate(9, 3), true)\n lu.assertEquals(candidate(16, 4), true)\n lu.assertEquals(candidate(24, 2), false)\n lu.assertEquals(candidate(128, 4), false)\n lu.assertEquals(candidate(12, 6), false)\n lu.assertEquals(candidate(1, 1), true)\n lu.assertEquals(candidate(1, 12), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "lua", - "prompt": "-- Write a function that returns true if the given number is the multiplication of 3 prime numbers\n-- and false otherwise.\n-- Knowing that (a) is less then 100. \n-- Example:\n-- 30 = 2 * 3 * 5\nlocal function is_multiply_prime(a)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_multiply_prime\n lu.assertEquals(candidate(5), false)\n lu.assertEquals(candidate(30), true)\n lu.assertEquals(candidate(8), true)\n lu.assertEquals(candidate(10), false)\n lu.assertEquals(candidate(125), true)\n lu.assertEquals(candidate(105), true)\n lu.assertEquals(candidate(126), false)\n lu.assertEquals(candidate(729), false)\n lu.assertEquals(candidate(891), false)\n lu.assertEquals(candidate(1001), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "lua", - "prompt": "-- Given the lengths of the three sides of a triangle. Return True if the three\n-- sides form a right-angled triangle, False otherwise.\n-- A right-angled triangle is a triangle in which one angle is right angle or \n-- 90 degree.\n-- Example:\nlocal function right_angle_triangle(a, b, c)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = right_angle_triangle\n lu.assertEquals(candidate(3, 4, 5), true)\n lu.assertEquals(candidate(1, 2, 3), false)\n lu.assertEquals(candidate(10, 6, 8), true)\n lu.assertEquals(candidate(2, 2, 2), false)\n lu.assertEquals(candidate(7, 24, 25), true)\n lu.assertEquals(candidate(10, 5, 7), false)\n lu.assertEquals(candidate(5, 12, 13), true)\n lu.assertEquals(candidate(15, 8, 17), true)\n lu.assertEquals(candidate(48, 55, 73), true)\n lu.assertEquals(candidate(1, 1, 1), false)\n lu.assertEquals(candidate(2, 2, 10), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "lua", - "prompt": "-- Create a function that takes 3 numbers.\n-- Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n-- Returns false in any other cases.\n-- Examples\nlocal function any_int(x, y, z)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = any_int\n lu.assertEquals(candidate(2, 3, 1), true)\n lu.assertEquals(candidate(2.5, 2, 3), false)\n lu.assertEquals(candidate(1.5, 5, 3.5), false)\n lu.assertEquals(candidate(2, 6, 2), false)\n lu.assertEquals(candidate(4, 2, 2), true)\n lu.assertEquals(candidate(2.2, 2.2, 2.2), false)\n lu.assertEquals(candidate(-4, 6, 2), true)\n lu.assertEquals(candidate(2, 1, 1), true)\n lu.assertEquals(candidate(3, 4, 7), true)\n lu.assertEquals(candidate(3.0, 4, 7), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "lua", - "prompt": "-- This function takes a list l and returns a list l' such that\n-- l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n-- to the values of the corresponding indicies of l, but sorted.\nlocal function sort_third(l)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sort_third\n lu.assertEquals(candidate({5, 6, 3, 4, 8, 9, 2}), {2, 6, 3, 4, 8, 9, 5})\n lu.assertEquals(candidate({5, 8, 3, 4, 6, 9, 2}), {2, 8, 3, 4, 6, 9, 5})\n lu.assertEquals(candidate({5, 6, 9, 4, 8, 3, 2}), {2, 6, 9, 4, 8, 3, 5})\n lu.assertEquals(candidate({5, 6, 3, 4, 8, 9, 2, 1}), {2, 6, 3, 4, 8, 9, 5, 1})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_53_add", - "language": "lua", - "prompt": "-- Add two numbers x and y\nlocal function add(x, y)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = add\n lu.assertEquals(candidate(0, 1), 1)\n lu.assertEquals(candidate(1, 0), 1)\n lu.assertEquals(candidate(2, 3), 5)\n lu.assertEquals(candidate(5, 7), 12)\n lu.assertEquals(candidate(7, 5), 12)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_69_search", - "language": "lua", - "prompt": "-- You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n-- zero, and has a frequency greater than or equal to the value of the integer itself. \n-- The frequency of an integer is the number of times it appears in the list.\n-- If no such a value exist, return -1.\n-- Examples:\nlocal function search(lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = search\n lu.assertEquals(candidate({5, 5, 5, 5, 1}), 1)\n lu.assertEquals(candidate({4, 1, 4, 1, 4, 4}), 4)\n lu.assertEquals(candidate({3, 3}), -1)\n lu.assertEquals(candidate({8, 8, 8, 8, 8, 8, 8, 8}), 8)\n lu.assertEquals(candidate({2, 3, 3, 2, 2}), 2)\n lu.assertEquals(candidate({2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1}), 1)\n lu.assertEquals(candidate({3, 2, 8, 2}), 2)\n lu.assertEquals(candidate({6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10}), 1)\n lu.assertEquals(candidate({8, 8, 3, 6, 5, 6, 4}), -1)\n lu.assertEquals(candidate({6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9}), 1)\n lu.assertEquals(candidate({1, 9, 10, 1, 3}), 1)\n lu.assertEquals(candidate({6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10}), 5)\n lu.assertEquals(candidate({1}), 1)\n lu.assertEquals(candidate({8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5}), 4)\n lu.assertEquals(candidate({2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10}), 2)\n lu.assertEquals(candidate({1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3}), 1)\n lu.assertEquals(candidate({9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4}), 4)\n lu.assertEquals(candidate({2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7}), 4)\n lu.assertEquals(candidate({9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1}), 2)\n lu.assertEquals(candidate({5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8}), -1)\n lu.assertEquals(candidate({10}), -1)\n lu.assertEquals(candidate({9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2}), 2)\n lu.assertEquals(candidate({5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8}), 1)\n lu.assertEquals(candidate({7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6}), 1)\n lu.assertEquals(candidate({3, 10, 10, 9, 2}), -1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "lua", - "prompt": "-- Write a function that takes a string and returns True if the string\n-- length is a prime number or False otherwise\n-- Examples\nlocal function prime_length(string)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = prime_length\n lu.assertEquals(candidate('Hello'), true)\n lu.assertEquals(candidate('abcdcba'), true)\n lu.assertEquals(candidate('kittens'), true)\n lu.assertEquals(candidate('orange'), false)\n lu.assertEquals(candidate('wow'), true)\n lu.assertEquals(candidate('world'), true)\n lu.assertEquals(candidate('MadaM'), true)\n lu.assertEquals(candidate('Wow'), true)\n lu.assertEquals(candidate(''), false)\n lu.assertEquals(candidate('HI'), true)\n lu.assertEquals(candidate('go'), true)\n lu.assertEquals(candidate('gogo'), false)\n lu.assertEquals(candidate('aaaaaaaaaaaaaaa'), false)\n lu.assertEquals(candidate('Madam'), true)\n lu.assertEquals(candidate('M'), false)\n lu.assertEquals(candidate('0'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_58_common", - "language": "lua", - "prompt": "-- Return sorted unique common elements for two lists.\nlocal function common(l1, l2)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = common\n lu.assertEquals(candidate({1, 4, 3, 34, 653, 2, 5}, {5, 7, 1, 5, 9, 653, 121}), {1, 5, 653})\n lu.assertEquals(candidate({5, 3, 2, 8}, {3, 2}), {2, 3})\n lu.assertEquals(candidate({4, 3, 2, 8}, {3, 2, 4}), {2, 3, 4})\n lu.assertEquals(candidate({4, 3, 2, 8}, {}), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "lua", - "prompt": "-- The Brazilian factorial is defined as:\n-- brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n-- where n > 0\n-- For example:\n-- The function will receive an integer as input and should return the special\n-- factorial of this integer.\nlocal function special_factorial(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = special_factorial\n lu.assertEquals(candidate(4), 288)\n lu.assertEquals(candidate(5), 34560)\n lu.assertEquals(candidate(7), 125411328000)\n lu.assertEquals(candidate(1), 1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "lua", - "prompt": "-- In this problem, you will implement a function that takes two lists of numbers,\n-- and determines whether it is possible to perform an exchange of elements\n-- between them to make lst1 a list of only even numbers.\n-- There is no limit on the number of exchanged elements between lst1 and lst2.\n-- If it is possible to exchange elements between the lst1 and lst2 to make\n-- all the elements of lst1 to be even, return \"YES\".\n-- Otherwise, return \"NO\".\n-- For example:\n-- It is assumed that the input lists will be non-empty.\nlocal function exchange(lst1, lst2)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = exchange\n lu.assertEquals(candidate({1, 2, 3, 4}, {1, 2, 3, 4}), 'YES')\n lu.assertEquals(candidate({1, 2, 3, 4}, {1, 5, 3, 4}), 'NO')\n lu.assertEquals(candidate({1, 2, 3, 4}, {2, 1, 4, 3}), 'YES')\n lu.assertEquals(candidate({5, 7, 3}, {2, 6, 4}), 'YES')\n lu.assertEquals(candidate({5, 7, 3}, {2, 6, 3}), 'NO')\n lu.assertEquals(candidate({3, 2, 6, 1, 8, 9}, {3, 5, 5, 1, 1, 1}), 'NO')\n lu.assertEquals(candidate({100, 200}, {200, 200}), 'YES')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "lua", - "prompt": "-- Given a non-empty array of integers arr and an integer k, return\n-- the sum of the elements with at most two digits from the first k elements of arr.\n-- Example:\n-- Constraints:\n-- 1. 1 <= len(arr) <= 100\n-- 2. 1 <= k <= len(arr)\nlocal function add_elements(arr, k)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = add_elements\n lu.assertEquals(candidate({1, -2, -3, 41, 57, 76, 87, 88, 99}, 3), -4)\n lu.assertEquals(candidate({111, 121, 3, 4000, 5, 6}, 2), 0)\n lu.assertEquals(candidate({11, 21, 3, 90, 5, 6, 7, 8, 9}, 4), 125)\n lu.assertEquals(candidate({111, 21, 3, 4000, 5, 6, 7, 8, 9}, 4), 24)\n lu.assertEquals(candidate({1}, 1), 1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "lua", - "prompt": "-- A simple program which should return the value of x if n is \n-- a prime number and should return the value of y otherwise.\n-- Examples:\nlocal function x_or_y(n, x, y)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = x_or_y\n lu.assertEquals(candidate(7, 34, 12), 34)\n lu.assertEquals(candidate(15, 8, 5), 5)\n lu.assertEquals(candidate(3, 33, 5212), 33)\n lu.assertEquals(candidate(1259, 3, 52), 3)\n lu.assertEquals(candidate(7919, -1, 12), -1)\n lu.assertEquals(candidate(3609, 1245, 583), 583)\n lu.assertEquals(candidate(91, 56, 129), 129)\n lu.assertEquals(candidate(6, 34, 1234), 1234)\n lu.assertEquals(candidate(1, 2, 0), 0)\n lu.assertEquals(candidate(2, 2, 0), 2)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "lua", - "prompt": "-- Given length of a side and high return area for a triangle.\nlocal function triangle_area(a, h)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = triangle_area\n lu.assertEquals(candidate(5, 3), 7.5)\n lu.assertEquals(candidate(2, 2), 2.0)\n lu.assertEquals(candidate(10, 8), 40.0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "lua", - "prompt": "-- Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n-- the last couple centuries. However, what people don't know is Tribonacci sequence.\n-- Tribonacci sequence is defined by the recurrence:\n-- tri(1) = 3\n-- tri(n) = 1 + n / 2, if n is even.\n-- tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n-- For example:\n-- tri(2) = 1 + (2 / 2) = 2\n-- tri(4) = 3\n-- tri(3) = tri(2) + tri(1) + tri(4)\n-- = 2 + 3 + 3 = 8 \n-- You are given a non-negative integer number n, you have to a return a list of the \n-- first n + 1 numbers of the Tribonacci sequence.\n-- Examples:\nlocal function tri(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = tri\n lu.assertEquals(candidate(3), {1, 3, 2, 8})\n lu.assertEquals(candidate(4), {1, 3, 2, 8, 3})\n lu.assertEquals(candidate(5), {1, 3, 2, 8, 3, 15})\n lu.assertEquals(candidate(6), {1, 3, 2, 8, 3, 15, 4})\n lu.assertEquals(candidate(7), {1, 3, 2, 8, 3, 15, 4, 24})\n lu.assertEquals(candidate(8), {1, 3, 2, 8, 3, 15, 4, 24, 5})\n lu.assertEquals(candidate(9), {1, 3, 2, 8, 3, 15, 4, 24, 5, 35})\n lu.assertEquals(candidate(20), {1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11})\n lu.assertEquals(candidate(0), {1})\n lu.assertEquals(candidate(1), {1, 3})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "lua", - "prompt": "-- You are given a list of two strings, both strings consist of open\n-- parentheses '(' or close parentheses ')' only.\n-- Your job is to check if it is possible to concatenate the two strings in\n-- some order, that the resulting string will be good.\n-- A string S is considered to be good if and only if all parentheses in S\n-- are balanced. For example: the string '(())()' is good, while the string\n-- '())' is not.\n-- Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n-- Examples:\nlocal function match_parens(lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = match_parens\n lu.assertEquals(candidate({'()(', ')'}), 'Yes')\n lu.assertEquals(candidate({')', ')'}), 'No')\n lu.assertEquals(candidate({'(()(())', '())())'}), 'No')\n lu.assertEquals(candidate({')())', '(()()('}), 'Yes')\n lu.assertEquals(candidate({'(())))', '(()())(('}), 'Yes')\n lu.assertEquals(candidate({'()', '())'}), 'No')\n lu.assertEquals(candidate({'(()(', '()))()'}), 'Yes')\n lu.assertEquals(candidate({'((((', '((())'}), 'No')\n lu.assertEquals(candidate({')(()', '(()('}), 'No')\n lu.assertEquals(candidate({')(', ')('}), 'No')\n lu.assertEquals(candidate({'(', ')'}), 'Yes')\n lu.assertEquals(candidate({')', '('}), 'Yes')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "lua", - "prompt": "-- From a list of integers, remove all elements that occur more than once.\n-- Keep order of elements left the same as in the input.\nlocal function remove_duplicates(numbers)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = remove_duplicates\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({1, 2, 3, 4}), {1, 2, 3, 4})\n lu.assertEquals(candidate({1, 2, 3, 2, 4, 3, 5}), {1, 4, 5})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "lua", - "prompt": "-- Return a greatest common divisor of two integers a and b\nlocal function greatest_common_divisor(a, b)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = greatest_common_divisor\n lu.assertEquals(candidate(3, 7), 1)\n lu.assertEquals(candidate(10, 15), 5)\n lu.assertEquals(candidate(49, 14), 7)\n lu.assertEquals(candidate(144, 60), 12)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "lua", - "prompt": "-- Checks if given string is a palindrome\nlocal function is_palindrome(text)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_palindrome\n lu.assertEquals(candidate(''), true)\n lu.assertEquals(candidate('aba'), true)\n lu.assertEquals(candidate('aaaaa'), true)\n lu.assertEquals(candidate('zbcd'), false)\n lu.assertEquals(candidate('xywyx'), true)\n lu.assertEquals(candidate('xywyz'), false)\n lu.assertEquals(candidate('xywzx'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "lua", - "prompt": "-- xs represent coefficients of a polynomial.\n-- xs[0] + xs[1] * x + xs[2] * x^2 + ....\n-- Return derivative of this polynomial in the same form.\nlocal function derivative(xs)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = derivative\n lu.assertEquals(candidate({3, 1, 2, 4, 5}), {1, 4, 12, 20})\n lu.assertEquals(candidate({1, 2, 3}), {2, 6})\n lu.assertEquals(candidate({3, 2, 1}), {2, 2})\n lu.assertEquals(candidate({3, 2, 1, 0, 4}), {2, 2, 0, 16})\n lu.assertEquals(candidate({1}), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "lua", - "prompt": "-- In this task, you will be given a string that represents a number of apples and oranges \n-- that are distributed in a basket of fruit this basket contains \n-- apples, oranges, and mango fruits. Given the string that represents the total number of \n-- the oranges and apples and an integer that represent the total number of the fruits \n-- in the basket return the number of the mango fruits in the basket.\n-- for examble:\nlocal function fruit_distribution(s, n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = fruit_distribution\n lu.assertEquals(candidate('5 apples and 6 oranges', 19), 8)\n lu.assertEquals(candidate('5 apples and 6 oranges', 21), 10)\n lu.assertEquals(candidate('0 apples and 1 oranges', 3), 2)\n lu.assertEquals(candidate('1 apples and 0 oranges', 3), 2)\n lu.assertEquals(candidate('2 apples and 3 oranges', 100), 95)\n lu.assertEquals(candidate('2 apples and 3 oranges', 5), 0)\n lu.assertEquals(candidate('1 apples and 100 oranges', 120), 19)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "lua", - "prompt": "-- Write a function that takes an integer a and returns True \n-- if this ingeger is a cube of some integer number.\n-- Note: you may assume the input is always valid.\n-- Examples:\nlocal function iscube(a)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = iscube\n lu.assertEquals(candidate(1), true)\n lu.assertEquals(candidate(2), false)\n lu.assertEquals(candidate(-1), true)\n lu.assertEquals(candidate(64), true)\n lu.assertEquals(candidate(180), false)\n lu.assertEquals(candidate(1000), true)\n lu.assertEquals(candidate(0), true)\n lu.assertEquals(candidate(1729), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "lua", - "prompt": "-- In this Kata, you have to sort an array of non-negative integers according to\n-- number of ones in their binary representation in ascending order.\n-- For similar number of ones, sort based on decimal value.\n-- It must be implemented like this:\nlocal function sort_array(arr)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sort_array\n lu.assertEquals(candidate({1, 5, 2, 3, 4}), {1, 2, 4, 3, 5})\n lu.assertEquals(candidate({-2, -3, -4, -5, -6}), {-4, -2, -6, -5, -3})\n lu.assertEquals(candidate({1, 0, 2, 3, 4}), {0, 1, 2, 4, 3})\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4}), {2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77})\n lu.assertEquals(candidate({3, 6, 44, 12, 32, 5}), {32, 3, 5, 6, 12, 44})\n lu.assertEquals(candidate({2, 4, 8, 16, 32}), {2, 4, 8, 16, 32})\n lu.assertEquals(candidate({2, 4, 8, 16, 32}), {2, 4, 8, 16, 32})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "lua", - "prompt": "-- Given a list of strings, where each string consists of only digits, return a list.\n-- Each element i of the output should be \"the number of odd elements in the\n-- string i of the input.\" where all the i's should be replaced by the number\n-- of odd digits in the i'th string of the input.\nlocal function odd_count(lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = odd_count\n lu.assertEquals(candidate({'1234567'}), {'the number of odd elements 4n the str4ng 4 of the 4nput.'})\n lu.assertEquals(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.'})\n lu.assertEquals(candidate({'271', '137', '314'}), {'the number of odd elements 2n the str2ng 2 of the 2nput.', 'the number of odd elements 3n the str3ng 3 of the 3nput.', 'the number of odd elements 2n the str2ng 2 of the 2nput.'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "lua", - "prompt": "-- brackets is a string of \"(\" and \")\".\n-- return True if every opening bracket has a corresponding closing bracket.\nlocal function correct_bracketing(brackets)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = correct_bracketing\n lu.assertEquals(candidate('()'), true)\n lu.assertEquals(candidate('(()())'), true)\n lu.assertEquals(candidate('()()(()())()'), true)\n lu.assertEquals(candidate('()()((()()())())(()()(()))'), true)\n lu.assertEquals(candidate('((()())))'), false)\n lu.assertEquals(candidate(')(()'), false)\n lu.assertEquals(candidate('('), false)\n lu.assertEquals(candidate('(((('), false)\n lu.assertEquals(candidate(')'), false)\n lu.assertEquals(candidate('(()'), false)\n lu.assertEquals(candidate('()()(()())())(()'), false)\n lu.assertEquals(candidate('()()(()())()))()'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "lua", - "prompt": "-- Task\n-- Write a function that takes a string as input and returns the sum of the upper characters only'\n-- ASCII codes.\n-- Examples:\nlocal function digitSum(s)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = digitSum\n lu.assertEquals(candidate(''), 0)\n lu.assertEquals(candidate('abAB'), 131)\n lu.assertEquals(candidate('abcCd'), 67)\n lu.assertEquals(candidate('helloE'), 69)\n lu.assertEquals(candidate('woArBld'), 131)\n lu.assertEquals(candidate('aAaaaXa'), 153)\n lu.assertEquals(candidate(' How are yOu?'), 151)\n lu.assertEquals(candidate('You arE Very Smart'), 327)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "lua", - "prompt": "-- Write a function that accepts a list of strings as a parameter,\n-- deletes the strings that have odd lengths from it,\n-- and returns the resulted list with a sorted order,\n-- The list is always a list of strings and never an array of numbers,\n-- and it may contain duplicates.\n-- The order of the list should be ascending by length of each word, and you\n-- should return the list sorted by that rule.\n-- If two words have the same length, sort the list alphabetically.\n-- The function should return a list of strings in sorted order.\n-- You may assume that all words will have the same length.\n-- For example:\nlocal function sorted_list_sum(lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sorted_list_sum\n lu.assertEquals(candidate({'aa', 'a', 'aaa'}), {'aa'})\n lu.assertEquals(candidate({'school', 'AI', 'asdf', 'b'}), {'AI', 'asdf', 'school'})\n lu.assertEquals(candidate({'d', 'b', 'c', 'a'}), {})\n lu.assertEquals(candidate({'d', 'dcba', 'abcd', 'a'}), {'abcd', 'dcba'})\n lu.assertEquals(candidate({'AI', 'ai', 'au'}), {'AI', 'ai', 'au'})\n lu.assertEquals(candidate({'a', 'b', 'b', 'c', 'c', 'a'}), {})\n lu.assertEquals(candidate({'aaaa', 'bbbb', 'dd', 'cc'}), {'cc', 'dd', 'aaaa', 'bbbb'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "lua", - "prompt": "-- You are given an array arr of integers and you need to return\n-- sum of magnitudes of integers multiplied by product of all signs\n-- of each number in the array, represented by 1, -1 or 0.\n-- Note: return None for empty arr.\n-- Example:\nlocal function prod_signs(arr)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = prod_signs\n lu.assertEquals(candidate({1, 2, 2, -4}), -9)\n lu.assertEquals(candidate({0, 1}), 0)\n lu.assertEquals(candidate({1, 1, 1, 2, 3, -1, 1}), -10)\n lu.assertEquals(candidate({}), None)\n lu.assertEquals(candidate({2, 4, 1, 2, -1, -1, 9}), 20)\n lu.assertEquals(candidate({-1, 1, -1, 1}), 4)\n lu.assertEquals(candidate({-1, 1, 1, 1}), -4)\n lu.assertEquals(candidate({-1, 1, 1, 0}), 0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "lua", - "prompt": "-- Return list with elements incremented by 1.\nlocal function incr_list(l)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = incr_list\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({3, 2, 1}), {4, 3, 2})\n lu.assertEquals(candidate({5, 2, 5, 2, 3, 3, 9, 0, 123}), {6, 3, 6, 3, 4, 4, 10, 1, 124})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "lua", - "prompt": "-- From a given list of integers, generate a list of rolling maximum element found until given moment\n-- in the sequence.\nlocal function rolling_max(numbers)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = rolling_max\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({1, 2, 3, 4}), {1, 2, 3, 4})\n lu.assertEquals(candidate({4, 3, 2, 1}), {4, 4, 4, 4})\n lu.assertEquals(candidate({3, 2, 3, 100, 3}), {3, 3, 3, 100, 100})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "lua", - "prompt": "-- Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n-- separate those group into separate strings and return the list of those.\n-- Separate groups are balanced (each open brace is properly closed) and not nested within each other\n-- Ignore any spaces in the input string.\nlocal function separate_paren_groups(paren_string)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = separate_paren_groups\n lu.assertEquals(candidate('(()()) ((())) () ((())()())'), {'(()())', '((()))', '()', '((())()())'})\n lu.assertEquals(candidate('() (()) ((())) (((())))'), {'()', '(())', '((()))', '(((())))'})\n lu.assertEquals(candidate('(()(())((())))'), {'(()(())((())))'})\n lu.assertEquals(candidate('( ) (( )) (( )( ))'), {'()', '(())', '(()())'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "lua", - "prompt": "-- You will be given a string of words separated by commas or spaces. Your task is\n-- to split the string into words and return an array of the words.\n-- For example:\nlocal function words_string(s)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = words_string\n lu.assertEquals(candidate('Hi, my name is John'), {'Hi', 'my', 'name', 'is', 'John'})\n lu.assertEquals(candidate('One, two, three, four, five, six'), {'One', 'two', 'three', 'four', 'five', 'six'})\n lu.assertEquals(candidate('Hi, my name'), {'Hi', 'my', 'name'})\n lu.assertEquals(candidate('One,, two, three, four, five, six,'), {'One', 'two', 'three', 'four', 'five', 'six'})\n lu.assertEquals(candidate(''), {})\n lu.assertEquals(candidate('ahmed , gamal'), {'ahmed', 'gamal'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "lua", - "prompt": "-- Create a function that takes integers, floats, or strings representing\n-- real numbers, and returns the larger variable in its given variable type.\n-- Return None if the values are equal.\n-- Note: If a real number is represented as a string, the floating point might be . or ,\nlocal function compare_one(a, b)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = compare_one\n lu.assertEquals(candidate(1, 2), 2)\n lu.assertEquals(candidate(1, 2.5), 2.5)\n lu.assertEquals(candidate(2, 3), 3)\n lu.assertEquals(candidate(5, 6), 6)\n lu.assertEquals(candidate(1, '2,3'), '2,3')\n lu.assertEquals(candidate('5,1', '6'), '6')\n lu.assertEquals(candidate('1', '2'), '2')\n lu.assertEquals(candidate('1', 1), None)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "lua", - "prompt": "-- Filter given list of any python values only for integers\nlocal function filter_integers(values)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = filter_integers\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({4, {}, {}, 23.2, 9, 'adasd'}), {4, 9})\n lu.assertEquals(candidate({3, 'c', 3, 3, 'a', 'b'}), {3, 3, 3})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "lua", - "prompt": "-- This function takes a list l and returns a list l' such that\n-- l' is identical to l in the odd indicies, while its values at the even indicies are equal\n-- to the values of the even indicies of l, but sorted.\nlocal function sort_even(l)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sort_even\n lu.assertEquals(candidate({1, 2, 3}), {1, 2, 3})\n lu.assertEquals(candidate({5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10}), {-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123})\n lu.assertEquals(candidate({5, 8, -12, 4, 23, 2, 3, 11, 12, -10}), {-12, 8, 3, 4, 5, 2, 12, 11, 23, -10})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "lua", - "prompt": "-- I think we all remember that feeling when the result of some long-awaited\n-- event is finally known. The feelings and thoughts you have at that moment are\n-- definitely worth noting down and comparing.\n-- Your task is to determine if a person correctly guessed the results of a number of matches.\n-- You are given two arrays of scores and guesses of equal length, where each index shows a match. \n-- Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n-- the value is 0, and if not, the value is the absolute difference between the guess and the score.\n-- example:\nlocal function compare(game, guess)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = compare\n lu.assertEquals(candidate({1, 2, 3, 4, 5, 1}, {1, 2, 3, 4, 2, -2}), {0, 0, 0, 0, 3, 3})\n lu.assertEquals(candidate({0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}), {0, 0, 0, 0, 0, 0})\n lu.assertEquals(candidate({1, 2, 3}, {-1, -2, -3}), {2, 4, 6})\n lu.assertEquals(candidate({1, 2, 3, 5}, {-1, 2, 3, 4}), {2, 0, 0, 1})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "lua", - "prompt": "-- Given a positive integer n, return a tuple that has the number of even and odd\n-- integer palindromes that fall within the range(1, n), inclusive.\n-- Example 1:\n-- Explanation:\n-- Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n-- Example 2:\n-- Explanation:\n-- Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n-- Note:\n-- 1. 1 <= n <= 10^3\n-- 2. returned tuple has the number of even and odd integer palindromes respectively.\nlocal function even_odd_palindrome(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = even_odd_palindrome\n lu.assertEquals(candidate(123), {8, 13})\n lu.assertEquals(candidate(12), {4, 6})\n lu.assertEquals(candidate(3), {1, 2})\n lu.assertEquals(candidate(63), {6, 8})\n lu.assertEquals(candidate(25), {5, 6})\n lu.assertEquals(candidate(19), {4, 6})\n lu.assertEquals(candidate(9), {4, 5})\n lu.assertEquals(candidate(1), {0, 1})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "lua", - "prompt": "-- The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n-- fib4(0) -> 0\n-- fib4(1) -> 0\n-- fib4(2) -> 2\n-- fib4(3) -> 0\n-- fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n-- Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\nlocal function fib4(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = fib4\n lu.assertEquals(candidate(5), 4)\n lu.assertEquals(candidate(8), 28)\n lu.assertEquals(candidate(10), 104)\n lu.assertEquals(candidate(12), 386)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "lua", - "prompt": "-- Given two positive integers a and b, return the even digits between a\n-- and b, in ascending order.\n-- For example:\nlocal function generate_integers(a, b)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = generate_integers\n lu.assertEquals(candidate(2, 10), {2, 4, 6, 8})\n lu.assertEquals(candidate(10, 2), {2, 4, 6, 8})\n lu.assertEquals(candidate(132, 2), {2, 4, 6, 8})\n lu.assertEquals(candidate(17, 89), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "lua", - "prompt": "-- For a given list of input numbers, calculate Mean Absolute Deviation\n-- around the mean of this dataset.\n-- Mean Absolute Deviation is the average absolute difference between each\n-- element and a centerpoint (mean in this case):\n-- MAD = average | x - x_mean |\nlocal function mean_absolute_deviation(numbers)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = mean_absolute_deviation\n lu.assertEquals(candidate({1.0, 2.0}), 0.5)\n lu.assertEquals(candidate({1.0, 2.0, 3.0, 4.0}), 1.0)\n lu.assertEquals(candidate({1.0, 2.0, 3.0, 4.0, 5.0}), 1.2)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "lua", - "prompt": "-- Create a function encrypt that takes a string as an argument and\n-- returns a string encrypted with the alphabet being rotated. \n-- The alphabet should be rotated in a manner such that the letters \n-- shift down by two multiplied to two places.\n-- For example:\nlocal function encrypt(s)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = encrypt\n lu.assertEquals(candidate('hi'), 'lm')\n lu.assertEquals(candidate('asdfghjkl'), 'ewhjklnop')\n lu.assertEquals(candidate('gf'), 'kj')\n lu.assertEquals(candidate('et'), 'ix')\n lu.assertEquals(candidate('faewfawefaewg'), 'jeiajeaijeiak')\n lu.assertEquals(candidate('hellomyfriend'), 'lippsqcjvmirh')\n lu.assertEquals(candidate('dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh'), 'hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl')\n lu.assertEquals(candidate('a'), 'e')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "lua", - "prompt": "-- Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n-- The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n-- as follows: start with any positive integer n. Then each term is obtained from the \n-- previous term as follows: if the previous term is even, the next term is one half of \n-- the previous term. If the previous term is odd, the next term is 3 times the previous\n-- term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n-- Note: \n-- 1. Collatz(1) is [1].\n-- 2. returned list sorted in increasing order.\n-- For example:\n-- get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\nlocal function get_odd_collatz(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = get_odd_collatz\n lu.assertEquals(candidate(14), {1, 5, 7, 11, 13, 17})\n lu.assertEquals(candidate(5), {1, 5})\n lu.assertEquals(candidate(12), {1, 3, 5})\n lu.assertEquals(candidate(1), {1})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "lua", - "prompt": "-- Find how many times a given substring can be found in the original string. Count overlaping cases.\nlocal function how_many_times(string, substring)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = how_many_times\n lu.assertEquals(candidate('', 'x'), 0)\n lu.assertEquals(candidate('xyxyxyx', 'x'), 4)\n lu.assertEquals(candidate('cacacacac', 'cac'), 4)\n lu.assertEquals(candidate('john doe', 'john'), 1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "lua", - "prompt": "-- We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n-- numbers in the array will be randomly ordered. Your task is to determine if\n-- it is possible to get an array sorted in non-decreasing order by performing \n-- the following operation on the given array:\n-- You are allowed to perform right shift operation any number of times.\n-- One right shift operation means shifting all elements of the array by one\n-- position in the right direction. The last element of the array will be moved to\n-- the starting position in the array i.e. 0th index. \n-- If it is possible to obtain the sorted array by performing the above operation\n-- then return True else return False.\n-- If the given array is empty then return True.\n-- Note: The given list is guaranteed to have unique elements.\n-- For Example:\n-- Explanation: By performin 2 right shift operations, non-decreasing order can\n-- be achieved for the given array.\n-- Explanation:It is not possible to get non-decreasing order for the given\n-- array by performing any number of right shift operations.\nlocal function move_one_ball(arr)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = move_one_ball\n lu.assertEquals(candidate({3, 4, 5, 1, 2}), true)\n lu.assertEquals(candidate({3, 5, 10, 1, 2}), true)\n lu.assertEquals(candidate({4, 3, 1, 2}), false)\n lu.assertEquals(candidate({3, 5, 4, 1, 2}), false)\n lu.assertEquals(candidate({}), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "lua", - "prompt": "-- Write a function which sorts the given list of integers\n-- in ascending order according to the sum of their digits.\n-- Note: if there are several items with similar sum of their digits,\n-- order them based on their index in original list.\n-- For example:\nlocal function order_by_points(nums)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = order_by_points\n lu.assertEquals(candidate({1, 11, -1, -11, -12}), {-1, -11, 1, -12, 11})\n lu.assertEquals(candidate({1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46}), {0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457})\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({1, -11, -32, 43, 54, -98, 2, -3}), {-3, -32, -98, -11, 1, 2, 43, 54})\n lu.assertEquals(candidate({1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}), {1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9})\n lu.assertEquals(candidate({0, 6, 6, -76, -21, 23, 4}), {-76, -21, 0, 4, 23, 6, 6})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "lua", - "prompt": "-- Return list of prime factors of given integer in the order from smallest to largest.\n-- Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n-- Input number should be equal to the product of all factors\nlocal function factorize(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = factorize\n lu.assertEquals(candidate(2), {2})\n lu.assertEquals(candidate(4), {2, 2})\n lu.assertEquals(candidate(8), {2, 2, 2})\n lu.assertEquals(candidate(57), {3, 19})\n lu.assertEquals(candidate(3249), {3, 3, 19, 19})\n lu.assertEquals(candidate(185193), {3, 3, 3, 19, 19, 19})\n lu.assertEquals(candidate(20577), {3, 19, 19, 19})\n lu.assertEquals(candidate(18), {2, 3, 3})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "lua", - "prompt": "-- Return True if all numbers in the list l are below threshold t.\nlocal function below_threshold(l, t)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = below_threshold\n lu.assertEquals(candidate({1, 2, 4, 10}, 100), true)\n lu.assertEquals(candidate({1, 20, 4, 10}, 5), false)\n lu.assertEquals(candidate({1, 20, 4, 10}, 21), true)\n lu.assertEquals(candidate({1, 20, 4, 10}, 22), true)\n lu.assertEquals(candidate({1, 8, 4, 10}, 11), true)\n lu.assertEquals(candidate({1, 8, 4, 10}, 10), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "lua", - "prompt": "-- You are given two positive integers n and m, and your task is to compute the\n-- average of the integers from n through m (including n and m). \n-- Round the answer to the nearest integer and convert that to binary.\n-- If n is greater than m, return -1.\n-- Example:\nlocal function rounded_avg(n, m)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = rounded_avg\n lu.assertEquals(candidate(1, 5), '0b11')\n lu.assertEquals(candidate(7, 13), '0b1010')\n lu.assertEquals(candidate(964, 977), '0b1111001010')\n lu.assertEquals(candidate(996, 997), '0b1111100100')\n lu.assertEquals(candidate(560, 851), '0b1011000010')\n lu.assertEquals(candidate(185, 546), '0b101101110')\n lu.assertEquals(candidate(362, 496), '0b110101101')\n lu.assertEquals(candidate(350, 902), '0b1001110010')\n lu.assertEquals(candidate(197, 233), '0b11010111')\n lu.assertEquals(candidate(7, 5), -1)\n lu.assertEquals(candidate(5, 1), -1)\n lu.assertEquals(candidate(5, 5), '0b101')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "lua", - "prompt": "-- Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n-- For each of the group, output the deepest level of nesting of parentheses.\n-- E.g. (()()) has maximum two levels of nesting while ((())) has three.\nlocal function parse_nested_parens(paren_string)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = parse_nested_parens\n lu.assertEquals(candidate('(()()) ((())) () ((())()())'), {2, 3, 1, 3})\n lu.assertEquals(candidate('() (()) ((())) (((())))'), {1, 2, 3, 4})\n lu.assertEquals(candidate('(()(())((())))'), {4})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "lua", - "prompt": "-- Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n-- Examples\nlocal function solution(lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = solution\n lu.assertEquals(candidate({5, 8, 7, 1}), 12)\n lu.assertEquals(candidate({3, 3, 3, 3, 3}), 9)\n lu.assertEquals(candidate({30, 13, 24, 321}), 0)\n lu.assertEquals(candidate({5, 9}), 5)\n lu.assertEquals(candidate({2, 4, 8}), 0)\n lu.assertEquals(candidate({30, 13, 23, 32}), 23)\n lu.assertEquals(candidate({3, 13, 2, 9}), 3)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "lua", - "prompt": "-- You are given a positive integer n. You have to create an integer array a of length n.\n-- For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n-- Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n-- and a[i] + a[j] + a[k] is a multiple of 3.\n-- Example :\n-- Explanation: \n-- a = [1, 3, 7, 13, 21]\n-- The only valid triple is (1, 7, 13).\nlocal function get_max_triples(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = get_max_triples\n lu.assertEquals(candidate(5), 1)\n lu.assertEquals(candidate(6), 4)\n lu.assertEquals(candidate(10), 36)\n lu.assertEquals(candidate(100), 53361)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "lua", - "prompt": "-- There are eight planets in our solar system: the closerst to the Sun \n-- is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n-- Uranus, Neptune.\n-- Write a function that takes two planet names as strings planet1 and planet2. \n-- The function should return a tuple containing all planets whose orbits are \n-- located between the orbit of planet1 and the orbit of planet2, sorted by \n-- the proximity to the sun. \n-- The function should return an empty tuple if planet1 or planet2\n-- are not correct planet names. \n-- Examples\nlocal function bf(planet1, planet2)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = bf\n lu.assertEquals(candidate('Jupiter', 'Neptune'), {'Saturn', 'Uranus'})\n lu.assertEquals(candidate('Earth', 'Mercury'), {'Venus'})\n lu.assertEquals(candidate('Mercury', 'Uranus'), {'Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn'})\n lu.assertEquals(candidate('Neptune', 'Venus'), {'Earth', 'Mars', 'Jupiter', 'Saturn', 'Uranus'})\n lu.assertEquals(candidate('Earth', 'Earth'), {})\n lu.assertEquals(candidate('Mars', 'Earth'), {})\n lu.assertEquals(candidate('Jupiter', 'Makemake'), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "lua", - "prompt": "-- You are given a list of integers.\n-- Write a function next_smallest() that returns the 2nd smallest element of the list.\n-- Return None if there is no such element.\nlocal function next_smallest(lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = next_smallest\n lu.assertEquals(candidate({1, 2, 3, 4, 5}), 2)\n lu.assertEquals(candidate({5, 1, 4, 3, 2}), 2)\n lu.assertEquals(candidate({}), None)\n lu.assertEquals(candidate({1, 1}), None)\n lu.assertEquals(candidate({1, 1, 1, 1, 0}), 1)\n lu.assertEquals(candidate({1, 1}), None)\n lu.assertEquals(candidate({-35, 34, 12, -45}), -35)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "lua", - "prompt": "-- Input is a space-delimited string of numberals from 'zero' to 'nine'.\n-- Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n-- Return the string with numbers sorted from smallest to largest\nlocal function sort_numbers(numbers)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sort_numbers\n lu.assertEquals(candidate(''), '')\n lu.assertEquals(candidate('three'), 'three')\n lu.assertEquals(candidate('three five nine'), 'three five nine')\n lu.assertEquals(candidate('five zero four seven nine eight'), 'zero four five seven eight nine')\n lu.assertEquals(candidate('six five four three two one zero'), 'zero one two three four five six')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "lua", - "prompt": "-- You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\nlocal function cycpattern_check(a, b)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = cycpattern_check\n lu.assertEquals(candidate('xyzw', 'xyw'), false)\n lu.assertEquals(candidate('yello', 'ell'), true)\n lu.assertEquals(candidate('whattup', 'ptut'), false)\n lu.assertEquals(candidate('efef', 'fee'), true)\n lu.assertEquals(candidate('abab', 'aabb'), false)\n lu.assertEquals(candidate('winemtt', 'tinem'), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "lua", - "prompt": "-- You will be given a number in decimal form and your task is to convert it to\n-- binary format. The function should return a string, with each character representing a binary\n-- number. Each character in the string will be '0' or '1'.\n-- There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n-- The extra characters are there to help with the format.\n-- Examples:\nlocal function decimal_to_binary(decimal)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = decimal_to_binary\n lu.assertEquals(candidate(0), 'db0db')\n lu.assertEquals(candidate(32), 'db100000db')\n lu.assertEquals(candidate(103), 'db1100111db')\n lu.assertEquals(candidate(15), 'db1111db')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "lua", - "prompt": "-- Filter an input list of strings only for ones that contain given substring\nlocal function filter_by_substring(strings, substring)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = filter_by_substring\n lu.assertEquals(candidate({}, 'john'), {})\n lu.assertEquals(candidate({'xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'}, 'xxx'), {'xxx', 'xxxAAA', 'xxx'})\n lu.assertEquals(candidate({'xxx', 'asd', 'aaaxxy', 'john doe', 'xxxAAA', 'xxx'}, 'xx'), {'xxx', 'aaaxxy', 'xxxAAA', 'xxx'})\n lu.assertEquals(candidate({'grunt', 'trumpet', 'prune', 'gruesome'}, 'run'), {'grunt', 'prune'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "lua", - "prompt": "-- Given an integer. return a tuple that has the number of even and odd digits respectively.\n-- Example:\nlocal function even_odd_count(num)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = even_odd_count\n lu.assertEquals(candidate(7), {0, 1})\n lu.assertEquals(candidate(-78), {1, 1})\n lu.assertEquals(candidate(3452), {2, 2})\n lu.assertEquals(candidate(346211), {3, 3})\n lu.assertEquals(candidate(-345821), {3, 3})\n lu.assertEquals(candidate(-2), {1, 0})\n lu.assertEquals(candidate(-45347), {2, 3})\n lu.assertEquals(candidate(0), {1, 0})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "lua", - "prompt": "-- Write a function that accepts a list of strings.\n-- The list contains different words. Return the word with maximum number\n-- of unique characters. If multiple strings have maximum number of unique\n-- characters, return the one which comes first in lexicographical order.\nlocal function find_max(words)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = find_max\n lu.assertEquals(candidate({'name', 'of', 'string'}), 'string')\n lu.assertEquals(candidate({'name', 'enam', 'game'}), 'enam')\n lu.assertEquals(candidate({'aaaaaaa', 'bb', 'cc'}), 'aaaaaaa')\n lu.assertEquals(candidate({'abc', 'cba'}), 'abc')\n lu.assertEquals(candidate({'play', 'this', 'game', 'of', 'footbott'}), 'footbott')\n lu.assertEquals(candidate({'we', 'are', 'gonna', 'rock'}), 'gonna')\n lu.assertEquals(candidate({'we', 'are', 'a', 'mad', 'nation'}), 'nation')\n lu.assertEquals(candidate({'this', 'is', 'a', 'prrk'}), 'this')\n lu.assertEquals(candidate({'b'}), 'b')\n lu.assertEquals(candidate({'play', 'play', 'play'}), 'play')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "lua", - "prompt": "-- Create a function that returns a tuple (a, b), where 'a' is\n-- the largest of negative integers, and 'b' is the smallest\n-- of positive integers in a list.\n-- If there is no negative or positive integers, return them as None.\n-- Examples:\nlocal function largest_smallest_integers(lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = largest_smallest_integers\n lu.assertEquals(candidate({2, 4, 1, 3, 5, 7}), {None, 1})\n lu.assertEquals(candidate({2, 4, 1, 3, 5, 7, 0}), {None, 1})\n lu.assertEquals(candidate({1, 3, 2, 4, 5, 6, -2}), {-2, 1})\n lu.assertEquals(candidate({4, 5, 3, 6, 2, 7, -7}), {-7, 2})\n lu.assertEquals(candidate({7, 3, 8, 4, 9, 2, 5, -9}), {-9, 2})\n lu.assertEquals(candidate({}), {None, None})\n lu.assertEquals(candidate({0}), {None, None})\n lu.assertEquals(candidate({-1, -3, -5, -6}), {-1, None})\n lu.assertEquals(candidate({-1, -3, -5, -6, 0}), {-1, None})\n lu.assertEquals(candidate({-6, -4, -4, -3, 1}), {-3, 1})\n lu.assertEquals(candidate({-6, -4, -4, -3, -100, 1}), {-3, 1})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "lua", - "prompt": "-- \"Given an array representing a branch of a tree that has non-negative integer nodes\n-- your task is to pluck one of the nodes and return it.\n-- The plucked node should be the node with the smallest even value.\n-- If multiple nodes with the same smallest even value are found return the node that has smallest index.\n-- The plucked node should be returned in a list, [ smalest_value, its index ],\n-- If there are no even values or the given array is empty, return [].\n-- Example 1:\n-- Explanation: 2 has the smallest even value, and 2 has the smallest index.\n-- Example 2:\n-- Explanation: 2 has the smallest even value, and 2 has the smallest index.\n-- Example 3:\n-- Example 4:\n-- Explanation: 0 is the smallest value, but there are two zeros,\n-- so we will choose the first zero, which has the smallest index.\n-- Constraints:\n-- * 1 <= nodes.length <= 10000\n-- * 0 <= node.value\nlocal function pluck(arr)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = pluck\n lu.assertEquals(candidate({4, 2, 3}), {2, 1})\n lu.assertEquals(candidate({1, 2, 3}), {2, 1})\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({5, 0, 3, 0, 4, 2}), {0, 1})\n lu.assertEquals(candidate({1, 2, 3, 0, 5, 3}), {0, 3})\n lu.assertEquals(candidate({5, 4, 8, 4, 8}), {4, 1})\n lu.assertEquals(candidate({7, 6, 7, 1}), {6, 1})\n lu.assertEquals(candidate({7, 9, 7, 1}), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "lua", - "prompt": "-- Write a function count_nums which takes an array of integers and returns\n-- the number of elements which has a sum of digits > 0.\n-- If a number is negative, then its first signed digit will be negative:\n-- e.g. -123 has signed digits -1, 2, and 3.\nlocal function count_nums(arr)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = count_nums\n lu.assertEquals(candidate({}), 0)\n lu.assertEquals(candidate({-1, -2, 0}), 0)\n lu.assertEquals(candidate({1, 1, 2, -2, 3, 4, 5}), 6)\n lu.assertEquals(candidate({1, 6, 9, -6, 0, 1, 5}), 5)\n lu.assertEquals(candidate({1, 100, 98, -7, 1, -1}), 4)\n lu.assertEquals(candidate({12, 23, 34, -45, -56, 0}), 5)\n lu.assertEquals(candidate({0, 1}), 1)\n lu.assertEquals(candidate({1}), 1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "lua", - "prompt": "-- Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n-- each cell of the grid contains a value. Every integer in the range [1, N * N]\n-- inclusive appears exactly once on the cells of the grid.\n-- You have to find the minimum path of length k in the grid. You can start\n-- from any cell, and in each step you can move to any of the neighbor cells,\n-- in other words, you can go to cells which share an edge with you current\n-- cell.\n-- Please note that a path of length k means visiting exactly k cells (not\n-- necessarily distinct).\n-- You CANNOT go off the grid.\n-- A path A (of length k) is considered less than a path B (of length k) if\n-- after making the ordered lists of the values on the cells that A and B go\n-- through (let's call them lst_A and lst_B), lst_A is lexicographically less\n-- than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n-- such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n-- lst_A[j] = lst_B[j].\n-- It is guaranteed that the answer is unique.\n-- Return an ordered list of the values on the cells that the minimum path go through.\n-- Examples:\nlocal function minPath(grid, k)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = minPath\n lu.assertEquals(candidate({{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}, 3), {1, 2, 1})\n lu.assertEquals(candidate({{5, 9, 3}, {4, 1, 6}, {7, 8, 2}}, 1), {1})\n lu.assertEquals(candidate({{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}, {13, 14, 15, 16}}, 4), {1, 2, 1, 2})\n lu.assertEquals(candidate({{6, 4, 13, 10}, {5, 7, 12, 1}, {3, 16, 11, 15}, {8, 14, 9, 2}}, 7), {1, 10, 1, 10, 1, 10, 1})\n lu.assertEquals(candidate({{8, 14, 9, 2}, {6, 4, 13, 15}, {5, 7, 1, 12}, {3, 10, 11, 16}}, 5), {1, 7, 1, 7, 1})\n lu.assertEquals(candidate({{11, 8, 7, 2}, {5, 16, 14, 4}, {9, 3, 15, 6}, {12, 13, 10, 1}}, 9), {1, 6, 1, 6, 1, 6, 1, 6, 1})\n lu.assertEquals(candidate({{12, 13, 10, 1}, {9, 3, 15, 6}, {5, 16, 14, 4}, {11, 8, 7, 2}}, 12), {1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6})\n lu.assertEquals(candidate({{2, 7, 4}, {3, 1, 5}, {6, 8, 9}}, 8), {1, 3, 1, 3, 1, 3, 1, 3})\n lu.assertEquals(candidate({{6, 1, 5}, {3, 8, 9}, {2, 7, 4}}, 8), {1, 5, 1, 5, 1, 5, 1, 5})\n lu.assertEquals(candidate({{1, 2}, {3, 4}}, 10), {1, 2, 1, 2, 1, 2, 1, 2, 1, 2})\n lu.assertEquals(candidate({{1, 3}, {3, 2}}, 10), {1, 3, 1, 3, 1, 3, 1, 3, 1, 3})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "lua", - "prompt": "-- Given list of integers, return list in strange order.\n-- Strange sorting, is when you start with the minimum value,\n-- then maximum of the remaining integers, then minimum and so on.\n-- Examples:\nlocal function strange_sort_list(lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = strange_sort_list\n lu.assertEquals(candidate({1, 2, 3, 4}), {1, 4, 2, 3})\n lu.assertEquals(candidate({5, 6, 7, 8, 9}), {5, 9, 6, 8, 7})\n lu.assertEquals(candidate({1, 2, 3, 4, 5}), {1, 5, 2, 4, 3})\n lu.assertEquals(candidate({5, 6, 7, 8, 9, 1}), {1, 9, 5, 8, 6, 7})\n lu.assertEquals(candidate({5, 5, 5, 5}), {5, 5, 5, 5})\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({1, 2, 3, 4, 5, 6, 7, 8}), {1, 8, 2, 7, 3, 6, 4, 5})\n lu.assertEquals(candidate({0, 2, 2, 2, 5, 5, -5, -5}), {-5, 5, -5, 5, 0, 2, 2, 2})\n lu.assertEquals(candidate({111111}), {111111})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "lua", - "prompt": "-- Given a string 'text', return its md5 hash equivalent string.\n-- If 'text' is an empty string, return None.\nlocal function string_to_md5(text)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = string_to_md5\n lu.assertEquals(candidate('Hello world'), '3e25960a79dbc69b674cd4ec67a72c62')\n lu.assertEquals(candidate(''), None)\n lu.assertEquals(candidate('A B C'), '0ef78513b0cb8cef12743f5aeb35f888')\n lu.assertEquals(candidate('password'), '5f4dcc3b5aa765d61d8327deb882cf99')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "lua", - "prompt": "-- You are given a word. Your task is to find the closest vowel that stands between \n-- two consonants from the right side of the word (case sensitive).\n-- Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n-- find any vowel met the above condition. \n-- You may assume that the given string contains English letter only.\n-- Example:\nlocal function get_closest_vowel(word)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = get_closest_vowel\n lu.assertEquals(candidate('yogurt'), 'u')\n lu.assertEquals(candidate('full'), 'u')\n lu.assertEquals(candidate('easy'), '')\n lu.assertEquals(candidate('eAsy'), '')\n lu.assertEquals(candidate('ali'), '')\n lu.assertEquals(candidate('bad'), 'a')\n lu.assertEquals(candidate('most'), 'o')\n lu.assertEquals(candidate('ab'), '')\n lu.assertEquals(candidate('ba'), '')\n lu.assertEquals(candidate('quick'), '')\n lu.assertEquals(candidate('anime'), 'i')\n lu.assertEquals(candidate('Asia'), '')\n lu.assertEquals(candidate('Above'), 'o')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "lua", - "prompt": "-- Change numerical base of input number x to base.\n-- return string representation after the conversion.\n-- base numbers are less than 10.\nlocal function change_base(x, base)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = change_base\n lu.assertEquals(candidate(8, 3), '22')\n lu.assertEquals(candidate(9, 3), '100')\n lu.assertEquals(candidate(234, 2), '11101010')\n lu.assertEquals(candidate(16, 2), '10000')\n lu.assertEquals(candidate(8, 2), '1000')\n lu.assertEquals(candidate(7, 2), '111')\n lu.assertEquals(candidate(2, 3), '2')\n lu.assertEquals(candidate(3, 4), '3')\n lu.assertEquals(candidate(4, 5), '4')\n lu.assertEquals(candidate(5, 6), '5')\n lu.assertEquals(candidate(6, 7), '6')\n lu.assertEquals(candidate(7, 8), '7')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "lua", - "prompt": "-- Check if in given list of numbers, are any two numbers closer to each other than\n-- given threshold.\nlocal function has_close_elements(numbers, threshold)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = has_close_elements\n lu.assertEquals(candidate({1.0, 2.0, 3.9, 4.0, 5.0, 2.2}, 0.3), true)\n lu.assertEquals(candidate({1.0, 2.0, 3.9, 4.0, 5.0, 2.2}, 0.05), false)\n lu.assertEquals(candidate({1.0, 2.0, 5.9, 4.0, 5.0}, 0.95), true)\n lu.assertEquals(candidate({1.0, 2.0, 5.9, 4.0, 5.0}, 0.8), false)\n lu.assertEquals(candidate({1.0, 2.0, 3.0, 4.0, 5.0, 2.0}, 0.1), true)\n lu.assertEquals(candidate({1.1, 2.2, 3.1, 4.1, 5.1}, 1.0), true)\n lu.assertEquals(candidate({1.1, 2.2, 3.1, 4.1, 5.1}, 0.5), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "lua", - "prompt": "-- Create a function that takes a string as input which contains only square brackets.\n-- The function should return True if and only if there is a valid subsequence of brackets \n-- where at least one bracket in the subsequence is nested.\nlocal function is_nested(string)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_nested\n lu.assertEquals(candidate('[[]]'), true)\n lu.assertEquals(candidate('[]]]]]]][[[[[]'), false)\n lu.assertEquals(candidate('[][]'), false)\n lu.assertEquals(candidate('[]'), false)\n lu.assertEquals(candidate('[[[[]]]]'), true)\n lu.assertEquals(candidate('[]]]]]]]]]]'), false)\n lu.assertEquals(candidate('[][][[]]'), true)\n lu.assertEquals(candidate('[[]'), false)\n lu.assertEquals(candidate('[]]'), false)\n lu.assertEquals(candidate('[[]][['), true)\n lu.assertEquals(candidate('[[][]]'), true)\n lu.assertEquals(candidate(''), false)\n lu.assertEquals(candidate('[[[[[[[['), false)\n lu.assertEquals(candidate(']]]]]]]]'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "lua", - "prompt": "-- Concatenate list of strings into a single string\nlocal function concatenate(strings)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = concatenate\n lu.assertEquals(candidate({}), '')\n lu.assertEquals(candidate({'x', 'y', 'z'}), 'xyz')\n lu.assertEquals(candidate({'x', 'y', 'z', 'w', 'k'}), 'xyzwk')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "lua", - "prompt": "-- prime_fib returns n-th number that is a Fibonacci number and it's also prime.\nlocal function prime_fib(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = prime_fib\n lu.assertEquals(candidate(1), 2)\n lu.assertEquals(candidate(2), 3)\n lu.assertEquals(candidate(3), 5)\n lu.assertEquals(candidate(4), 13)\n lu.assertEquals(candidate(5), 89)\n lu.assertEquals(candidate(6), 233)\n lu.assertEquals(candidate(7), 1597)\n lu.assertEquals(candidate(8), 28657)\n lu.assertEquals(candidate(9), 514229)\n lu.assertEquals(candidate(10), 433494437)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "lua", - "prompt": "-- From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n-- other and return them in order (smaller number, larger number).\nlocal function find_closest_elements(numbers)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = find_closest_elements\n lu.assertEquals(candidate({1.0, 2.0, 3.9, 4.0, 5.0, 2.2}), {3.9, 4.0})\n lu.assertEquals(candidate({1.0, 2.0, 5.9, 4.0, 5.0}), {5.0, 5.9})\n lu.assertEquals(candidate({1.0, 2.0, 3.0, 4.0, 5.0, 2.2}), {2.0, 2.2})\n lu.assertEquals(candidate({1.0, 2.0, 3.0, 4.0, 5.0, 2.0}), {2.0, 2.0})\n lu.assertEquals(candidate({1.1, 2.2, 3.1, 4.1, 5.1}), {2.2, 3.1})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "lua", - "prompt": "-- You have been tasked to write a function that receives \n-- a hexadecimal number as a string and counts the number of hexadecimal \n-- digits that are primes (prime number, or a prime, is a natural number \n-- greater than 1 that is not a product of two smaller natural numbers).\n-- Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n-- Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n-- So you have to determine a number of the following digits: 2, 3, 5, 7, \n-- B (=decimal 11), D (=decimal 13).\n-- Note: you may assume the input is always correct or empty string, \n-- and symbols A,B,C,D,E,F are always uppercase.\n-- Examples:\nlocal function hex_key(num)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = hex_key\n lu.assertEquals(candidate('AB'), 1)\n lu.assertEquals(candidate('1077E'), 2)\n lu.assertEquals(candidate('ABED1A33'), 4)\n lu.assertEquals(candidate('2020'), 2)\n lu.assertEquals(candidate('123456789ABCDEF0'), 6)\n lu.assertEquals(candidate('112233445566778899AABBCCDDEEFF00'), 12)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "lua", - "prompt": "-- Complete the function that takes two integers and returns \n-- the product of their unit digits.\n-- Assume the input is always valid.\n-- Examples:\nlocal function multiply(a, b)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = multiply\n lu.assertEquals(candidate(148, 412), 16)\n lu.assertEquals(candidate(19, 28), 72)\n lu.assertEquals(candidate(2020, 1851), 0)\n lu.assertEquals(candidate(14, -15), 20)\n lu.assertEquals(candidate(76, 67), 42)\n lu.assertEquals(candidate(17, 27), 49)\n lu.assertEquals(candidate(0, 1), 0)\n lu.assertEquals(candidate(0, 0), 0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "lua", - "prompt": "-- Given list of numbers (of at least two elements), apply a linear transform to that list,\n-- such that the smallest number will become 0 and the largest will become 1\nlocal function rescale_to_unit(numbers)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = rescale_to_unit\n lu.assertEquals(candidate({2.0, 49.9}), {0.0, 1.0})\n lu.assertEquals(candidate({100.0, 49.9}), {1.0, 0.0})\n lu.assertEquals(candidate({1.0, 2.0, 3.0, 4.0, 5.0}), {0.0, 0.25, 0.5, 0.75, 1.0})\n lu.assertEquals(candidate({2.0, 1.0, 5.0, 3.0, 4.0}), {0.25, 0.0, 1.0, 0.5, 0.75})\n lu.assertEquals(candidate({12.0, 11.0, 15.0, 13.0, 14.0}), {0.25, 0.0, 1.0, 0.5, 0.75})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "lua", - "prompt": "-- Given a positive integer n, return the product of the odd digits.\n-- Return 0 if all digits are even.\n-- For example:\nlocal function digits(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = digits\n lu.assertEquals(candidate(5), 5)\n lu.assertEquals(candidate(54), 5)\n lu.assertEquals(candidate(120), 1)\n lu.assertEquals(candidate(5014), 5)\n lu.assertEquals(candidate(98765), 315)\n lu.assertEquals(candidate(5576543), 2625)\n lu.assertEquals(candidate(2468), 0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "lua", - "prompt": "-- You will be given the name of a class (a string) and a list of extensions.\n-- The extensions are to be used to load additional classes to the class. The\n-- strength of the extension is as follows: Let CAP be the number of the uppercase\n-- letters in the extension's name, and let SM be the number of lowercase letters \n-- in the extension's name, the strength is given by the fraction CAP - SM. \n-- You should find the strongest extension and return a string in this \n-- format: ClassName.StrongestExtensionName.\n-- If there are two or more extensions with the same strength, you should\n-- choose the one that comes first in the list.\n-- For example, if you are given \"Slices\" as the class and a list of the\n-- extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n-- return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n-- (its strength is -1).\n-- Example:\nlocal function Strongest_Extension(class_name, extensions)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = Strongest_Extension\n lu.assertEquals(candidate('Watashi', {'tEN', 'niNE', 'eIGHt8OKe'}), 'Watashi.eIGHt8OKe')\n lu.assertEquals(candidate('Boku123', {'nani', 'NazeDa', 'YEs.WeCaNe', '32145tggg'}), 'Boku123.YEs.WeCaNe')\n lu.assertEquals(candidate('__YESIMHERE', {'t', 'eMptY', 'nothing', 'zeR00', 'NuLl__', '123NoooneB321'}), '__YESIMHERE.NuLl__')\n lu.assertEquals(candidate('K', {'Ta', 'TAR', 't234An', 'cosSo'}), 'K.TAR')\n lu.assertEquals(candidate('__HAHA', {'Tab', '123', '781345', '-_-'}), '__HAHA.123')\n lu.assertEquals(candidate('YameRore', {'HhAas', 'okIWILL123', 'WorkOut', 'Fails', '-_-'}), 'YameRore.okIWILL123')\n lu.assertEquals(candidate('finNNalLLly', {'Die', 'NowW', 'Wow', 'WoW'}), 'finNNalLLly.WoW')\n lu.assertEquals(candidate('_', {'Bb', '91245'}), '_.Bb')\n lu.assertEquals(candidate('Sp', {'671235', 'Bb'}), 'Sp.671235')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "lua", - "prompt": "-- Given a string representing a space separated lowercase letters, return a dictionary\n-- of the letter with the most repetition and containing the corresponding count.\n-- If several letters have the same occurrence, return all of them.\n-- Example:\nlocal function histogram(test)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = histogram\n lu.assertEquals(candidate('a b b a'), {['a'] = 2, ['b'] = 2})\n lu.assertEquals(candidate('a b c a b'), {['a'] = 2, ['b'] = 2})\n lu.assertEquals(candidate('a b c d g'), {['a'] = 1, ['b'] = 1, ['c'] = 1, ['d'] = 1, ['g'] = 1})\n lu.assertEquals(candidate('r t g'), {['r'] = 1, ['t'] = 1, ['g'] = 1})\n lu.assertEquals(candidate('b b b b a'), {['b'] = 4})\n lu.assertEquals(candidate('r t g'), {['r'] = 1, ['t'] = 1, ['g'] = 1})\n lu.assertEquals(candidate(''), {})\n lu.assertEquals(candidate('a'), {['a'] = 1})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "lua", - "prompt": "-- pairs_sum_to_zero takes a list of integers as an input.\n-- it returns True if there are two distinct elements in the list that\n-- sum to zero, and False otherwise.\nlocal function pairs_sum_to_zero(l)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = pairs_sum_to_zero\n lu.assertEquals(candidate({1, 3, 5, 0}), false)\n lu.assertEquals(candidate({1, 3, -2, 1}), false)\n lu.assertEquals(candidate({1, 2, 3, 7}), false)\n lu.assertEquals(candidate({2, 4, -5, 3, 5, 7}), true)\n lu.assertEquals(candidate({1}), false)\n lu.assertEquals(candidate({-3, 9, -1, 3, 2, 30}), true)\n lu.assertEquals(candidate({-3, 9, -1, 3, 2, 31}), true)\n lu.assertEquals(candidate({-3, 9, -1, 4, 2, 30}), false)\n lu.assertEquals(candidate({-3, 9, -1, 4, 2, 31}), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "lua", - "prompt": "-- Write a function that accepts two lists of strings and returns the list that has \n-- total number of chars in the all strings of the list less than the other list.\n-- if the two lists have the same number of chars, return the first list.\n-- Examples\nlocal function total_match(lst1, lst2)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = total_match\n lu.assertEquals(candidate({}, {}), {})\n lu.assertEquals(candidate({'hi', 'admin'}, {'hi', 'hi'}), {'hi', 'hi'})\n lu.assertEquals(candidate({'hi', 'admin'}, {'hi', 'hi', 'admin', 'project'}), {'hi', 'admin'})\n lu.assertEquals(candidate({'4'}, {'1', '2', '3', '4', '5'}), {'4'})\n lu.assertEquals(candidate({'hi', 'admin'}, {'hI', 'Hi'}), {'hI', 'Hi'})\n lu.assertEquals(candidate({'hi', 'admin'}, {'hI', 'hi', 'hi'}), {'hI', 'hi', 'hi'})\n lu.assertEquals(candidate({'hi', 'admin'}, {'hI', 'hi', 'hii'}), {'hi', 'admin'})\n lu.assertEquals(candidate({}, {'this'}), {})\n lu.assertEquals(candidate({'this'}, {}), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "lua", - "prompt": "-- Circular shift the digits of the integer x, shift the digits right by shift\n-- and return the result as a string.\n-- If shift > number of digits, return digits reversed.\nlocal function circular_shift(x, shift)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = circular_shift\n lu.assertEquals(candidate(100, 2), '001')\n lu.assertEquals(candidate(12, 2), '12')\n lu.assertEquals(candidate(97, 8), '79')\n lu.assertEquals(candidate(12, 1), '21')\n lu.assertEquals(candidate(11, 101), '11')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "lua", - "prompt": "-- Return True is list elements are monotonically increasing or decreasing.\nlocal function monotonic(l)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = monotonic\n lu.assertEquals(candidate({1, 2, 4, 10}), true)\n lu.assertEquals(candidate({1, 2, 4, 20}), true)\n lu.assertEquals(candidate({1, 20, 4, 10}), false)\n lu.assertEquals(candidate({4, 1, 0, -10}), true)\n lu.assertEquals(candidate({4, 1, 1, 0}), true)\n lu.assertEquals(candidate({1, 2, 3, 2, 5, 60}), false)\n lu.assertEquals(candidate({1, 2, 3, 4, 5, 60}), true)\n lu.assertEquals(candidate({9, 9, 9, 9}), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "lua", - "prompt": "-- Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n-- Example\nlocal function is_equal_to_sum_even(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_equal_to_sum_even\n lu.assertEquals(candidate(4), false)\n lu.assertEquals(candidate(6), false)\n lu.assertEquals(candidate(8), true)\n lu.assertEquals(candidate(10), true)\n lu.assertEquals(candidate(11), false)\n lu.assertEquals(candidate(12), true)\n lu.assertEquals(candidate(13), false)\n lu.assertEquals(candidate(16), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "lua", - "prompt": "-- Input to this function is a string representing musical notes in a special ASCII format.\n-- Your task is to parse this string and return list of integers corresponding to how many beats does each\n-- not last.\n-- Here is a legend:\n-- 'o' - whole note, lasts four beats\n-- 'o|' - half note, lasts two beats\n-- '.|' - quater note, lasts one beat\nlocal function parse_music(music_string)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = parse_music\n lu.assertEquals(candidate(''), {})\n lu.assertEquals(candidate('o o o o'), {4, 4, 4, 4})\n lu.assertEquals(candidate('.| .| .| .|'), {1, 1, 1, 1})\n lu.assertEquals(candidate('o| o| .| .| o o o o'), {2, 2, 1, 1, 4, 4, 4, 4})\n lu.assertEquals(candidate('o| .| o| .| o o| o o|'), {2, 1, 2, 1, 4, 2, 4, 2})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "lua", - "prompt": "-- \"\n-- This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n-- multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n-- change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n-- Examples:\nlocal function sum_squares(lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sum_squares\n lu.assertEquals(candidate({1, 2, 3}), 6)\n lu.assertEquals(candidate({1, 4, 9}), 14)\n lu.assertEquals(candidate({}), 0)\n lu.assertEquals(candidate({1, 1, 1, 1, 1, 1, 1, 1, 1}), 9)\n lu.assertEquals(candidate({-1, -1, -1, -1, -1, -1, -1, -1, -1}), -3)\n lu.assertEquals(candidate({0}), 0)\n lu.assertEquals(candidate({-1, -5, 2, -1, -5}), -126)\n lu.assertEquals(candidate({-56, -99, 1, 0, -2}), 3030)\n lu.assertEquals(candidate({-1, 0, 0, 0, 0, 0, 0, 0, -1}), 0)\n lu.assertEquals(candidate({-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37}), -14196)\n lu.assertEquals(candidate({-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10}), -1448)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "lua", - "prompt": "-- triples_sum_to_zero takes a list of integers as an input.\n-- it returns True if there are three distinct elements in the list that\n-- sum to zero, and False otherwise.\nlocal function triples_sum_to_zero(l)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = triples_sum_to_zero\n lu.assertEquals(candidate({1, 3, 5, 0}), false)\n lu.assertEquals(candidate({1, 3, 5, -1}), false)\n lu.assertEquals(candidate({1, 3, -2, 1}), true)\n lu.assertEquals(candidate({1, 2, 3, 7}), false)\n lu.assertEquals(candidate({1, 2, 5, 7}), false)\n lu.assertEquals(candidate({2, 4, -5, 3, 9, 7}), true)\n lu.assertEquals(candidate({1}), false)\n lu.assertEquals(candidate({1, 3, 5, -100}), false)\n lu.assertEquals(candidate({100, 3, 5, -100}), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "lua", - "prompt": "-- brackets is a string of \"<\" and \">\".\n-- return True if every opening bracket has a corresponding closing bracket.\nlocal function correct_bracketing(brackets)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = correct_bracketing\n lu.assertEquals(candidate('<>'), true)\n lu.assertEquals(candidate('<<><>>'), true)\n lu.assertEquals(candidate('<><><<><>><>'), true)\n lu.assertEquals(candidate('<><><<<><><>><>><<><><<>>>'), true)\n lu.assertEquals(candidate('<<<><>>>>'), false)\n lu.assertEquals(candidate('><<>'), false)\n lu.assertEquals(candidate('<'), false)\n lu.assertEquals(candidate('<<<<'), false)\n lu.assertEquals(candidate('>'), false)\n lu.assertEquals(candidate('<<>'), false)\n lu.assertEquals(candidate('<><><<><>><>><<>'), false)\n lu.assertEquals(candidate('<><><<><>><>>><>'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "lua", - "prompt": "-- Write a function that takes an array of numbers as input and returns \n-- the number of elements in the array that are greater than 10 and both \n-- first and last digits of a number are odd (1, 3, 5, 7, 9).\n-- For example:\nlocal function specialFilter(nums)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = specialFilter\n lu.assertEquals(candidate({5, -2, 1, -5}), 0)\n lu.assertEquals(candidate({15, -73, 14, -15}), 1)\n lu.assertEquals(candidate({33, -2, -3, 45, 21, 109}), 2)\n lu.assertEquals(candidate({43, -12, 93, 125, 121, 109}), 4)\n lu.assertEquals(candidate({71, -2, -33, 75, 21, 19}), 3)\n lu.assertEquals(candidate({1}), 0)\n lu.assertEquals(candidate({}), 0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "lua", - "prompt": "-- Given a dictionary, return True if all keys are strings in lower \n-- case or all keys are strings in upper case, else return False.\n-- The function should return False is the given dictionary is empty.\n-- Examples:\nlocal function check_dict_case(dict)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = check_dict_case\n lu.assertEquals(candidate({['p'] = 'pineapple', ['b'] = 'banana'}), true)\n lu.assertEquals(candidate({['p'] = 'pineapple', ['A'] = 'banana', ['B'] = 'banana'}), false)\n lu.assertEquals(candidate({['p'] = 'pineapple', ['5'] = 'banana', ['a'] = 'apple'}), false)\n lu.assertEquals(candidate({['Name'] = 'John', ['Age'] = '36', ['City'] = 'Houston'}), false)\n lu.assertEquals(candidate({['STATE'] = 'NC', ['ZIP'] = '12345'}), true)\n lu.assertEquals(candidate({['fruit'] = 'Orange', ['taste'] = 'Sweet'}), true)\n lu.assertEquals(candidate({}), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "lua", - "prompt": "-- Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n-- should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n-- alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n-- Examples\nlocal function split_words(txt)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = split_words\n lu.assertEquals(candidate('Hello world!'), {'Hello', 'world!'})\n lu.assertEquals(candidate('Hello,world!'), {'Hello', 'world!'})\n lu.assertEquals(candidate('Hello world,!'), {'Hello', 'world,!'})\n lu.assertEquals(candidate('Hello,Hello,world !'), {'Hello,Hello,world', '!'})\n lu.assertEquals(candidate('abcdef'), 3)\n lu.assertEquals(candidate('aaabb'), 2)\n lu.assertEquals(candidate('aaaBb'), 1)\n lu.assertEquals(candidate(''), 0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "lua", - "prompt": "-- The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n-- fibfib(0) == 0\n-- fibfib(1) == 0\n-- fibfib(2) == 1\n-- fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n-- Please write a function to efficiently compute the n-th element of the fibfib number sequence.\nlocal function fibfib(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = fibfib\n lu.assertEquals(candidate(2), 1)\n lu.assertEquals(candidate(1), 0)\n lu.assertEquals(candidate(5), 4)\n lu.assertEquals(candidate(8), 24)\n lu.assertEquals(candidate(10), 81)\n lu.assertEquals(candidate(12), 274)\n lu.assertEquals(candidate(14), 927)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "lua", - "prompt": "-- You are given a list of numbers.\n-- You need to return the sum of squared numbers in the given list,\n-- round each element in the list to the upper int(Ceiling) first.\n-- Examples:\nlocal function sum_squares(lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sum_squares\n lu.assertEquals(candidate({1.0, 2.0, 3.0}), 14)\n lu.assertEquals(candidate({1.0, 2.0, 3.0}), 14)\n lu.assertEquals(candidate({1.0, 3.0, 5.0, 7.0}), 84)\n lu.assertEquals(candidate({1.4, 4.2, 0.0}), 29)\n lu.assertEquals(candidate({-2.4, 1.0, 1.0}), 6)\n lu.assertEquals(candidate({100.0, 1.0, 15.0, 2.0}), 10230)\n lu.assertEquals(candidate({10000.0, 10000.0}), 200000000)\n lu.assertEquals(candidate({-1.4, 4.6, 6.3}), 75)\n lu.assertEquals(candidate({-1.4, 17.9, 18.9, 19.9}), 1086)\n lu.assertEquals(candidate({0.0}), 0)\n lu.assertEquals(candidate({-1.0}), 1)\n lu.assertEquals(candidate({-1.0, 1.0, 0.0}), 2)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_85_add", - "language": "lua", - "prompt": "-- Given a non-empty list of integers lst. add the even elements that are at odd indices..\n-- Examples:\nlocal function add(lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = add\n lu.assertEquals(candidate({4, 88}), 88)\n lu.assertEquals(candidate({4, 5, 6, 7, 2, 122}), 122)\n lu.assertEquals(candidate({4, 0, 6, 7}), 0)\n lu.assertEquals(candidate({4, 4, 6, 8}), 12)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "lua", - "prompt": "-- Return sorted unique elements in a list\nlocal function unique(l)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = unique\n lu.assertEquals(candidate({5, 3, 5, 2, 3, 3, 9, 0, 123}), {0, 2, 3, 5, 9, 123})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "lua", - "prompt": "-- Given a string text, replace all spaces in it with underscores, \n-- and if a string has more than 2 consecutive spaces, \n-- then replace all consecutive spaces with -\nlocal function fix_spaces(text)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = fix_spaces\n lu.assertEquals(candidate('Example'), 'Example')\n lu.assertEquals(candidate('Mudasir Hanif '), 'Mudasir_Hanif_')\n lu.assertEquals(candidate('Yellow Yellow Dirty Fellow'), 'Yellow_Yellow__Dirty__Fellow')\n lu.assertEquals(candidate('Exa mple'), 'Exa-mple')\n lu.assertEquals(candidate(' Exa 1 2 2 mple'), '-Exa_1_2_2_mple')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "lua", - "prompt": "-- Return 2^n modulo p (be aware of numerics).\nlocal function modp(n, p)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = modp\n lu.assertEquals(candidate(3, 5), 3)\n lu.assertEquals(candidate(1101, 101), 2)\n lu.assertEquals(candidate(0, 101), 1)\n lu.assertEquals(candidate(3, 11), 8)\n lu.assertEquals(candidate(100, 101), 1)\n lu.assertEquals(candidate(30, 5), 4)\n lu.assertEquals(candidate(31, 5), 3)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "lua", - "prompt": "-- You have to write a function which validates a given date string and\n-- returns True if the date is valid otherwise False.\n-- The date is valid if all of the following rules are satisfied:\n-- 1. The date string is not empty.\n-- 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n-- 3. The months should not be less than 1 or higher than 12.\n-- 4. The date should be in the format: mm-dd-yyyy\nlocal function valid_date(date)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = valid_date\n lu.assertEquals(candidate('03-11-2000'), true)\n lu.assertEquals(candidate('15-01-2012'), false)\n lu.assertEquals(candidate('04-0-2040'), false)\n lu.assertEquals(candidate('06-04-2020'), true)\n lu.assertEquals(candidate('01-01-2007'), true)\n lu.assertEquals(candidate('03-32-2011'), false)\n lu.assertEquals(candidate(''), false)\n lu.assertEquals(candidate('04-31-3000'), false)\n lu.assertEquals(candidate('06-06-2005'), true)\n lu.assertEquals(candidate('21-31-2000'), false)\n lu.assertEquals(candidate('04-12-2003'), true)\n lu.assertEquals(candidate('04122003'), false)\n lu.assertEquals(candidate('20030412'), false)\n lu.assertEquals(candidate('2003-04'), false)\n lu.assertEquals(candidate('2003-04-12'), false)\n lu.assertEquals(candidate('04-2003'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "lua", - "prompt": "-- Write a function that takes a string and returns an ordered version of it.\n-- Ordered version of string, is a string where all words (separated by space)\n-- are replaced by a new word where all the characters arranged in\n-- ascending order based on ascii value.\n-- Note: You should keep the order of words and blank spaces in the sentence.\n-- For example:\nlocal function anti_shuffle(s)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = anti_shuffle\n lu.assertEquals(candidate('Hi'), 'Hi')\n lu.assertEquals(candidate('hello'), 'ehllo')\n lu.assertEquals(candidate('number'), 'bemnru')\n lu.assertEquals(candidate('abcd'), 'abcd')\n lu.assertEquals(candidate('Hello World!!!'), 'Hello !!!Wdlor')\n lu.assertEquals(candidate(''), '')\n lu.assertEquals(candidate('Hi. My name is Mister Robot. How are you?'), '.Hi My aemn is Meirst .Rboot How aer ?ouy')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "lua", - "prompt": "-- Given a list of numbers, return whether or not they are sorted\n-- in ascending order. If list has more than 1 duplicate of the same\n-- number, return False. Assume no negative numbers and only integers.\n-- Examples\nlocal function is_sorted(lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_sorted\n lu.assertEquals(candidate({5}), true)\n lu.assertEquals(candidate({1, 2, 3, 4, 5}), true)\n lu.assertEquals(candidate({1, 3, 2, 4, 5}), false)\n lu.assertEquals(candidate({1, 2, 3, 4, 5, 6}), true)\n lu.assertEquals(candidate({1, 2, 3, 4, 5, 6, 7}), true)\n lu.assertEquals(candidate({1, 3, 2, 4, 5, 6, 7}), false)\n lu.assertEquals(candidate({}), true)\n lu.assertEquals(candidate({1}), true)\n lu.assertEquals(candidate({3, 2, 1}), false)\n lu.assertEquals(candidate({1, 2, 2, 2, 3, 4}), false)\n lu.assertEquals(candidate({1, 2, 3, 3, 3, 4}), false)\n lu.assertEquals(candidate({1, 2, 2, 3, 3, 4}), true)\n lu.assertEquals(candidate({1, 2, 3, 4}), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "lua", - "prompt": "-- You are given a string s.\n-- Your task is to check if the string is happy or not.\n-- A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n-- For example:\nlocal function is_happy(s)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_happy\n lu.assertEquals(candidate('a'), false)\n lu.assertEquals(candidate('aa'), false)\n lu.assertEquals(candidate('abcd'), true)\n lu.assertEquals(candidate('aabb'), false)\n lu.assertEquals(candidate('adb'), true)\n lu.assertEquals(candidate('xyy'), false)\n lu.assertEquals(candidate('iopaxpoi'), true)\n lu.assertEquals(candidate('iopaxioi'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "lua", - "prompt": "-- Write a function that returns True if the object q will fly, and False otherwise.\n-- The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n-- Example:\n-- # 1+2 is less than the maximum possible weight, but it's unbalanced.\n-- # it's balanced, but 3+2+3 is more than the maximum possible weight.\n-- # 3+2+3 is less than the maximum possible weight, and it's balanced.\n-- # 3 is less than the maximum possible weight, and it's balanced.\nlocal function will_it_fly(q, w)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = will_it_fly\n lu.assertEquals(candidate({3, 2, 3}, 9), true)\n lu.assertEquals(candidate({1, 2}, 5), false)\n lu.assertEquals(candidate({3}, 5), true)\n lu.assertEquals(candidate({3, 2, 3}, 1), false)\n lu.assertEquals(candidate({1, 2, 3}, 6), false)\n lu.assertEquals(candidate({5}, 5), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "lua", - "prompt": "-- Given an array of non-negative integers, return a copy of the given array after sorting,\n-- you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n-- or sort it in descending order if the sum( first index value, last index value) is even.\n-- Note:\n-- * don't change the given array.\n-- Examples:\nlocal function sort_array(array)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sort_array\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({5}), {5})\n lu.assertEquals(candidate({2, 4, 3, 0, 1, 5}), {0, 1, 2, 3, 4, 5})\n lu.assertEquals(candidate({2, 4, 3, 0, 1, 5, 6}), {6, 5, 4, 3, 2, 1, 0})\n lu.assertEquals(candidate({2, 1}), {1, 2})\n lu.assertEquals(candidate({15, 42, 87, 32, 11, 0}), {0, 11, 15, 32, 42, 87})\n lu.assertEquals(candidate({21, 14, 23, 11}), {23, 21, 14, 11})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "lua", - "prompt": "-- Implement a function that takes an non-negative integer and returns an array of the first n\n-- integers that are prime numbers and less than n.\n-- for example:\nlocal function count_up_to(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = count_up_to\n lu.assertEquals(candidate(5), {2, 3})\n lu.assertEquals(candidate(6), {2, 3, 5})\n lu.assertEquals(candidate(7), {2, 3, 5})\n lu.assertEquals(candidate(10), {2, 3, 5, 7})\n lu.assertEquals(candidate(0), {})\n lu.assertEquals(candidate(22), {2, 3, 5, 7, 11, 13, 17, 19})\n lu.assertEquals(candidate(1), {})\n lu.assertEquals(candidate(18), {2, 3, 5, 7, 11, 13, 17})\n lu.assertEquals(candidate(47), {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43})\n lu.assertEquals(candidate(101), {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "lua", - "prompt": "-- Out of list of strings, return the longest one. Return the first one in case of multiple\n-- strings of the same length. Return None in case the input list is empty.\nlocal function longest(strings)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = longest\n lu.assertEquals(candidate({}), None)\n lu.assertEquals(candidate({'x', 'y', 'z'}), 'x')\n lu.assertEquals(candidate({'x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc'}), 'zzzz')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "lua", - "prompt": "-- Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n-- reverse the resulting array, and then replace each digit by its corresponding name from\n-- \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n-- For example:\n-- If the array is empty, return an empty array:\n-- If the array has any strange number ignore it:\nlocal function by_length(arr)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = by_length\n lu.assertEquals(candidate({2, 1, 1, 4, 5, 8, 2, 3}), {'Eight', 'Five', 'Four', 'Three', 'Two', 'Two', 'One', 'One'})\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({1, -1, 55}), {'One'})\n lu.assertEquals(candidate({1, -1, 3, 2}), {'Three', 'Two', 'One'})\n lu.assertEquals(candidate({9, 4, 8}), {'Nine', 'Eight', 'Four'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_106_f", - "language": "lua", - "prompt": "-- Implement the function f that takes n as a parameter,\n-- 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\n-- or the sum of numbers from 1 to i otherwise.\n-- i starts from 1.\n-- the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n-- Example:\nlocal function f(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = f\n lu.assertEquals(candidate(5), {1, 2, 6, 24, 15})\n lu.assertEquals(candidate(7), {1, 2, 6, 24, 15, 720, 28})\n lu.assertEquals(candidate(1), {1})\n lu.assertEquals(candidate(3), {1, 2, 6})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "lua", - "prompt": "-- Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\nlocal function fizz_buzz(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = fizz_buzz\n lu.assertEquals(candidate(50), 0)\n lu.assertEquals(candidate(78), 2)\n lu.assertEquals(candidate(79), 3)\n lu.assertEquals(candidate(100), 3)\n lu.assertEquals(candidate(200), 6)\n lu.assertEquals(candidate(4000), 192)\n lu.assertEquals(candidate(10000), 639)\n lu.assertEquals(candidate(100000), 8026)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "lua", - "prompt": "-- Given a positive floating point number, it can be decomposed into\n-- and integer part (largest integer smaller than given number) and decimals\n-- (leftover part always smaller than 1).\n-- Return the decimal part of the number.\nlocal function truncate_number(number)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = truncate_number\n lu.assertEquals(candidate(3.5), 0.5)\n lu.assertEquals(candidate(1.25), 0.25)\n lu.assertEquals(candidate(123.0), 0.0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "lua", - "prompt": "-- For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n-- Empty sum should be equal to 0 and empty product should be equal to 1.\nlocal function sum_product(numbers)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sum_product\n lu.assertEquals(candidate({}), {0, 1})\n lu.assertEquals(candidate({1, 1, 1}), {3, 1})\n lu.assertEquals(candidate({100, 0}), {100, 0})\n lu.assertEquals(candidate({3, 5, 7}), {15, 105})\n lu.assertEquals(candidate({10}), {10, 10})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "lua", - "prompt": "-- You are given a 2 dimensional data, as a nested lists,\n-- which is similar to matrix, however, unlike matrices,\n-- each row may contain a different number of columns.\n-- Given lst, and integer x, find integers x in the list,\n-- and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n-- each tuple is a coordinate - (row, columns), starting with 0.\n-- Sort coordinates initially by rows in ascending order.\n-- Also, sort coordinates of the row by columns in descending order.\n-- Examples:\nlocal function get_row(lst, x)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = get_row\n lu.assertEquals(candidate({{1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 1, 6}, {1, 2, 3, 4, 5, 1}}, 1), {{0, 0}, {1, 4}, {1, 0}, {2, 5}, {2, 0}})\n lu.assertEquals(candidate({{1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 6}}, 2), {{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}, {5, 1}})\n lu.assertEquals(candidate({{1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 6}, {1, 1, 3, 4, 5, 6}, {1, 2, 1, 4, 5, 6}, {1, 2, 3, 1, 5, 6}, {1, 2, 3, 4, 1, 6}, {1, 2, 3, 4, 5, 1}}, 1), {{0, 0}, {1, 0}, {2, 1}, {2, 0}, {3, 2}, {3, 0}, {4, 3}, {4, 0}, {5, 4}, {5, 0}, {6, 5}, {6, 0}})\n lu.assertEquals(candidate({}, 1), {})\n lu.assertEquals(candidate({{1}}, 2), {})\n lu.assertEquals(candidate({{}, {1}, {1, 2, 3}}, 3), {{2, 2}})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "lua", - "prompt": "-- You're a hungry rabbit, and you already have eaten a certain number of carrots,\n-- but now you need to eat more carrots to complete the day's meals.\n-- you should return an array of [ total number of eaten carrots after your meals,\n-- the number of carrots left after your meals ]\n-- if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n-- Example:\n-- Variables:\n-- @number : integer\n-- the number of carrots that you have eaten.\n-- @need : integer\n-- the number of carrots that you need to eat.\n-- @remaining : integer\n-- the number of remaining carrots thet exist in stock\n-- Constrain:\n-- * 0 <= number <= 1000\n-- * 0 <= need <= 1000\n-- * 0 <= remaining <= 1000\n-- Have fun :)\nlocal function eat(number, need, remaining)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = eat\n lu.assertEquals(candidate(5, 6, 10), {11, 4})\n lu.assertEquals(candidate(4, 8, 9), {12, 1})\n lu.assertEquals(candidate(1, 10, 10), {11, 0})\n lu.assertEquals(candidate(2, 11, 5), {7, 0})\n lu.assertEquals(candidate(4, 5, 7), {9, 2})\n lu.assertEquals(candidate(4, 5, 1), {5, 0})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "lua", - "prompt": "-- Given a positive integer N, return the total sum of its digits in binary.\n-- Example\n-- Variables:\n-- @N integer\n-- Constraints: 0 \u2264 N \u2264 10000.\n-- Output:\n-- a string of binary number\nlocal function solve(N)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = solve\n lu.assertEquals(candidate(1000), '1')\n lu.assertEquals(candidate(150), '110')\n lu.assertEquals(candidate(147), '1100')\n lu.assertEquals(candidate(333), '1001')\n lu.assertEquals(candidate(963), '10010')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "lua", - "prompt": "-- You are given a list of integers.\n-- You need to find the largest prime value and return the sum of its digits.\n-- Examples:\nlocal function skjkasdkd(lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = skjkasdkd\n lu.assertEquals(candidate({0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3}), 10)\n lu.assertEquals(candidate({1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1}), 25)\n lu.assertEquals(candidate({1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3}), 13)\n lu.assertEquals(candidate({0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6}), 11)\n lu.assertEquals(candidate({0, 81, 12, 3, 1, 21}), 3)\n lu.assertEquals(candidate({0, 8, 1, 2, 1, 7}), 7)\n lu.assertEquals(candidate({8191}), 19)\n lu.assertEquals(candidate({8191, 123456, 127, 7}), 19)\n lu.assertEquals(candidate({127, 97, 8192}), 10)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "lua", - "prompt": "-- Given an array arr of integers, find the minimum number of elements that\n-- need to be changed to make the array palindromic. A palindromic array is an array that\n-- is read the same backwards and forwards. In one change, you can change one element to any other element.\n-- For example:\nlocal function smallest_change(arr)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = smallest_change\n lu.assertEquals(candidate({1, 2, 3, 5, 4, 7, 9, 6}), 4)\n lu.assertEquals(candidate({1, 2, 3, 4, 3, 2, 2}), 1)\n lu.assertEquals(candidate({1, 4, 2}), 1)\n lu.assertEquals(candidate({1, 4, 4, 2}), 1)\n lu.assertEquals(candidate({1, 2, 3, 2, 1}), 0)\n lu.assertEquals(candidate({3, 1, 1, 3}), 0)\n lu.assertEquals(candidate({1}), 0)\n lu.assertEquals(candidate({0, 1}), 1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "lua", - "prompt": "-- It is the last week of the semester and the teacher has to give the grades\n-- to students. The teacher has been making her own algorithm for grading.\n-- The only problem is, she has lost the code she used for grading.\n-- She has given you a list of GPAs for some students and you have to write \n-- a function that can output a list of letter grades using the following table:\n-- GPA | Letter grade\n-- 4.0 A+\n-- > 3.7 A \n-- > 3.3 A- \n-- > 3.0 B+\n-- > 2.7 B \n-- > 2.3 B-\n-- > 2.0 C+\n-- > 1.7 C\n-- > 1.3 C-\n-- > 1.0 D+ \n-- > 0.7 D \n-- > 0.0 D-\n-- 0.0 E\n-- Example:\nlocal function numerical_letter_grade(grades)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = numerical_letter_grade\n lu.assertEquals(candidate({4.0, 3, 1.7, 2, 3.5}), {'A+', 'B', 'C-', 'C', 'A-'})\n lu.assertEquals(candidate({1.2}), {'D+'})\n lu.assertEquals(candidate({0.5}), {'D-'})\n lu.assertEquals(candidate({0.0}), {'E'})\n lu.assertEquals(candidate({1.0, 0.3, 1.5, 2.8, 3.3}), {'D', 'D-', 'C-', 'B', 'B+'})\n lu.assertEquals(candidate({0.0, 0.7}), {'E', 'D-'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "lua", - "prompt": "-- Given the lengths of the three sides of a triangle. Return the area of\n-- the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n-- Otherwise return -1\n-- Three sides make a valid triangle when the sum of any two sides is greater \n-- than the third side.\n-- Example:\nlocal function triangle_area(a, b, c)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = triangle_area\n lu.assertEquals(candidate(3, 4, 5), 6.0)\n lu.assertEquals(candidate(1, 2, 10), -1)\n lu.assertEquals(candidate(4, 8, 5), 8.18)\n lu.assertEquals(candidate(2, 2, 2), 1.73)\n lu.assertEquals(candidate(1, 2, 3), -1)\n lu.assertEquals(candidate(10, 5, 7), 16.25)\n lu.assertEquals(candidate(2, 6, 3), -1)\n lu.assertEquals(candidate(1, 1, 1), 0.43)\n lu.assertEquals(candidate(2, 2, 10), -1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "lua", - "prompt": "-- Check if two words have the same characters.\nlocal function same_chars(s0, s1)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = same_chars\n lu.assertEquals(candidate('eabcdzzzz', 'dddzzzzzzzddeddabc'), true)\n lu.assertEquals(candidate('abcd', 'dddddddabc'), true)\n lu.assertEquals(candidate('dddddddabc', 'abcd'), true)\n lu.assertEquals(candidate('eabcd', 'dddddddabc'), false)\n lu.assertEquals(candidate('abcd', 'dddddddabcf'), false)\n lu.assertEquals(candidate('eabcdzzzz', 'dddzzzzzzzddddabc'), false)\n lu.assertEquals(candidate('aabb', 'aaccc'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "lua", - "prompt": "-- Given an array of integers nums, find the minimum sum of any non-empty sub-array\n-- of nums.\n-- Example\nlocal function minSubArraySum(nums)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = minSubArraySum\n lu.assertEquals(candidate({2, 3, 4, 1, 2, 4}), 1)\n lu.assertEquals(candidate({-1, -2, -3}), -6)\n lu.assertEquals(candidate({-1, -2, -3, 2, -10}), -14)\n lu.assertEquals(candidate({-9999999999999999}), -9999999999999999)\n lu.assertEquals(candidate({0, 10, 20, 1000000}), 0)\n lu.assertEquals(candidate({-1, -2, -3, 10, -5}), -6)\n lu.assertEquals(candidate({100, -1, -2, -3, 10, -5}), -6)\n lu.assertEquals(candidate({10, 11, 13, 8, 3, 4}), 3)\n lu.assertEquals(candidate({100, -33, 32, -1, 0, -2}), -33)\n lu.assertEquals(candidate({-10}), -10)\n lu.assertEquals(candidate({7}), 7)\n lu.assertEquals(candidate({1, -1}), -1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "lua", - "prompt": "-- Given a string s and a natural number n, you have been tasked to implement \n-- a function that returns a list of all words from string s that contain exactly \n-- n consonants, in order these words appear in the string s.\n-- If the string s is empty then the function should return an empty list.\n-- Note: you may assume the input string contains only letters and spaces.\n-- Examples:\nlocal function select_words(s, n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = select_words\n lu.assertEquals(candidate('Mary had a little lamb', 4), {'little'})\n lu.assertEquals(candidate('Mary had a little lamb', 3), {'Mary', 'lamb'})\n lu.assertEquals(candidate('simple white space', 2), {})\n lu.assertEquals(candidate('Hello world', 4), {'world'})\n lu.assertEquals(candidate('Uncle sam', 3), {'Uncle'})\n lu.assertEquals(candidate('', 4), {})\n lu.assertEquals(candidate('a b c d e f', 1), {'b', 'c', 'd', 'f'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "lua", - "prompt": "-- Return list of all prefixes from shortest to longest of the input string\nlocal function all_prefixes(string)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = all_prefixes\n lu.assertEquals(candidate(''), {})\n lu.assertEquals(candidate('asdfgh'), {'a', 'as', 'asd', 'asdf', 'asdfg', 'asdfgh'})\n lu.assertEquals(candidate('WWW'), {'W', 'WW', 'WWW'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "lua", - "prompt": "-- Create a function that takes a value (string) representing a number\n-- and returns the closest integer to it. If the number is equidistant\n-- from two integers, round it away from zero.\n-- Examples\n-- Note:\n-- Rounding away from zero means that if the given number is equidistant\n-- from two integers, the one you should return is the one that is the\n-- farthest from zero. For example closest_integer(\"14.5\") should\n-- return 15 and closest_integer(\"-14.5\") should return -15.\nlocal function closest_integer(value)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = closest_integer\n lu.assertEquals(candidate('10'), 10)\n lu.assertEquals(candidate('14.5'), 15)\n lu.assertEquals(candidate('-15.5'), -16)\n lu.assertEquals(candidate('15.3'), 15)\n lu.assertEquals(candidate('0'), 0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "lua", - "prompt": "-- Create a function which takes a string representing a file's name, and returns\n-- 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n-- A file's name is considered to be valid if and only if all the following conditions \n-- are met:\n-- - There should not be more than three digits ('0'-'9') in the file's name.\n-- - The file's name contains exactly one dot '.'\n-- - The substring before the dot should not be empty, and it starts with a letter from \n-- the latin alphapet ('a'-'z' and 'A'-'Z').\n-- - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n-- Examples:\nlocal function file_name_check(file_name)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = file_name_check\n lu.assertEquals(candidate('example.txt'), 'Yes')\n lu.assertEquals(candidate('1example.dll'), 'No')\n lu.assertEquals(candidate('s1sdf3.asd'), 'No')\n lu.assertEquals(candidate('K.dll'), 'Yes')\n lu.assertEquals(candidate('MY16FILE3.exe'), 'Yes')\n lu.assertEquals(candidate('His12FILE94.exe'), 'No')\n lu.assertEquals(candidate('_Y.txt'), 'No')\n lu.assertEquals(candidate('?aREYA.exe'), 'No')\n lu.assertEquals(candidate('/this_is_valid.dll'), 'No')\n lu.assertEquals(candidate('this_is_valid.wow'), 'No')\n lu.assertEquals(candidate('this_is_valid.txt'), 'Yes')\n lu.assertEquals(candidate('this_is_valid.txtexe'), 'No')\n lu.assertEquals(candidate('#this2_i4s_5valid.ten'), 'No')\n lu.assertEquals(candidate('@this1_is6_valid.exe'), 'No')\n lu.assertEquals(candidate('this_is_12valid.6exe4.txt'), 'No')\n lu.assertEquals(candidate('all.exe.txt'), 'No')\n lu.assertEquals(candidate('I563_No.exe'), 'Yes')\n lu.assertEquals(candidate('Is3youfault.txt'), 'Yes')\n lu.assertEquals(candidate('no_one#knows.dll'), 'Yes')\n lu.assertEquals(candidate('1I563_Yes3.exe'), 'No')\n lu.assertEquals(candidate('I563_Yes3.txtt'), 'No')\n lu.assertEquals(candidate('final..txt'), 'No')\n lu.assertEquals(candidate('final132'), 'No')\n lu.assertEquals(candidate('_f4indsartal132.'), 'No')\n lu.assertEquals(candidate('.txt'), 'No')\n lu.assertEquals(candidate('s.'), 'No')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "lua", - "prompt": "-- You are given two intervals,\n-- where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n-- The given intervals are closed which means that the interval (start, end)\n-- includes both start and end.\n-- For each given interval, it is assumed that its start is less or equal its end.\n-- Your task is to determine whether the length of intersection of these two \n-- intervals is a prime number.\n-- Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n-- which its length is 1, which not a prime number.\n-- If the length of the intersection is a prime number, return \"YES\",\n-- otherwise, return \"NO\".\n-- If the two intervals don't intersect, return \"NO\".\n-- [input/output] samples:\nlocal function intersection(interval1, interval2)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = intersection\n lu.assertEquals(candidate({1, 2}, {2, 3}), 'NO')\n lu.assertEquals(candidate({-1, 1}, {0, 4}), 'NO')\n lu.assertEquals(candidate({-3, -1}, {-5, 5}), 'YES')\n lu.assertEquals(candidate({-2, 2}, {-4, 0}), 'YES')\n lu.assertEquals(candidate({-11, 2}, {-1, -1}), 'NO')\n lu.assertEquals(candidate({1, 2}, {3, 5}), 'NO')\n lu.assertEquals(candidate({1, 2}, {1, 2}), 'NO')\n lu.assertEquals(candidate({-2, -2}, {-3, -2}), 'NO')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "lua", - "prompt": "-- Return the largest prime factor of n. Assume n > 1 and is not a prime.\nlocal function largest_prime_factor(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = largest_prime_factor\n lu.assertEquals(candidate(15), 5)\n lu.assertEquals(candidate(27), 3)\n lu.assertEquals(candidate(63), 7)\n lu.assertEquals(candidate(330), 11)\n lu.assertEquals(candidate(13195), 29)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "lua", - "prompt": "-- Given a string, find out how many distinct characters (regardless of case) does it consist of\nlocal function count_distinct_characters(string)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = count_distinct_characters\n lu.assertEquals(candidate(''), 0)\n lu.assertEquals(candidate('abcde'), 5)\n lu.assertEquals(candidate('abcdecadeCADE'), 5)\n lu.assertEquals(candidate('aaaaAAAAaaaa'), 1)\n lu.assertEquals(candidate('Jerry jERRY JeRRRY'), 5)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "lua", - "prompt": "-- You're given a list of deposit and withdrawal operations on a bank account that starts with\n-- zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n-- at that point function should return True. Otherwise it should return False.\nlocal function below_zero(operations)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = below_zero\n lu.assertEquals(candidate({}), false)\n lu.assertEquals(candidate({1, 2, -3, 1, 2, -3}), false)\n lu.assertEquals(candidate({1, 2, -4, 5, 6}), true)\n lu.assertEquals(candidate({1, -1, 2, -2, 5, -5, 4, -4}), false)\n lu.assertEquals(candidate({1, -1, 2, -2, 5, -5, 4, -5}), true)\n lu.assertEquals(candidate({1, -2, 2, -2, 5, -5, 4, -4}), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "lua", - "prompt": "-- Find the shortest palindrome that begins with a supplied string.\n-- Algorithm idea is simple:\n-- - Find the longest postfix of supplied string that is a palindrome.\n-- - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\nlocal function make_palindrome(string)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = make_palindrome\n lu.assertEquals(candidate(''), '')\n lu.assertEquals(candidate('x'), 'x')\n lu.assertEquals(candidate('xyz'), 'xyzyx')\n lu.assertEquals(candidate('xyx'), 'xyx')\n lu.assertEquals(candidate('jerry'), 'jerryrrej')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "lua", - "prompt": "-- Given a positive integer, obtain its roman numeral equivalent as a string,\n-- and return it in lowercase.\n-- Restrictions: 1 <= num <= 1000\n-- Examples:\nlocal function int_to_mini_roman(number)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = int_to_mini_roman\n lu.assertEquals(candidate(19), 'xix')\n lu.assertEquals(candidate(152), 'clii')\n lu.assertEquals(candidate(251), 'ccli')\n lu.assertEquals(candidate(426), 'cdxxvi')\n lu.assertEquals(candidate(500), 'd')\n lu.assertEquals(candidate(1), 'i')\n lu.assertEquals(candidate(4), 'iv')\n lu.assertEquals(candidate(43), 'xliii')\n lu.assertEquals(candidate(90), 'xc')\n lu.assertEquals(candidate(94), 'xciv')\n lu.assertEquals(candidate(532), 'dxxxii')\n lu.assertEquals(candidate(900), 'cm')\n lu.assertEquals(candidate(994), 'cmxciv')\n lu.assertEquals(candidate(1000), 'm')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - } -] \ No newline at end of file diff --git a/data/lua-reworded.json b/data/lua-reworded.json deleted file mode 100644 index d46ec7acd166876f3c5b78287725d3a7663d2900..0000000000000000000000000000000000000000 --- a/data/lua-reworded.json +++ /dev/null @@ -1,2417 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "lua", - "prompt": "-- For a given number n, find the largest number that divides n evenly, smaller than n\n-- >>> largest_divisor(15)\n-- 5\nlocal function largest_divisor(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = largest_divisor\n lu.assertEquals(candidate(3), 1)\n lu.assertEquals(candidate(7), 1)\n lu.assertEquals(candidate(10), 5)\n lu.assertEquals(candidate(100), 50)\n lu.assertEquals(candidate(49), 7)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_47_median", - "language": "lua", - "prompt": "-- Return median of elements in the table l.\n-- >>> median({3, 1, 2, 4, 5})\n-- 3\n-- >>> median({-10, 4, 6, 1000, 10, 20})\n-- 15.0\nlocal function median(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = median\n lu.assertEquals(candidate({3, 1, 2, 4, 5}), 3)\n lu.assertEquals(candidate({-10, 4, 6, 1000, 10, 20}), 8.0)\n lu.assertEquals(candidate({5}), 5)\n lu.assertEquals(candidate({6, 5}), 5.5)\n lu.assertEquals(candidate({8, 1, 3, 9, 9, 2, 7}), 7)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "lua", - "prompt": "-- Given two tables operator, and operand. The first table has basic algebra operations, and \n-- the second table is a table of integers. Use the two given tables to build the algebric \n-- expression and return the evaluation of this expression.\n-- The basic algebra operations:\n-- Addition ( + ) \n-- Subtraction ( - ) \n-- Multiplication ( * ) \n-- Floor division ( // ) \n-- Exponentiation ( ** ) \n-- Example:\n-- operator['+', '*', '-']\n-- table = [2, 3, 4, 5]\n-- result = 2 + 3 * 4 - 5\n-- => result = 9\n-- Note:\n-- The length of operator table is equal to the length of operand table minus one.\n-- Operand is a table of of non-negative integers.\n-- Operator table has at least one operator, and operand table has at least two operands.\nlocal function do_algebra(operator, operand)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = do_algebra\n lu.assertEquals(candidate({'**', '*', '+'}, {2, 3, 4, 5}), 37)\n lu.assertEquals(candidate({'+', '*', '-'}, {2, 3, 4, 5}), 9)\n lu.assertEquals(candidate({'//', '*'}, {7, 3, 4}), 8)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "lua", - "prompt": "-- Return maximum element in the table.\n-- >>> max_element({1, 2, 3})\n-- 3\n-- >>> max_element({5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10})\n-- 123\nlocal function max_element(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = max_element\n lu.assertEquals(candidate({1, 2, 3}), 3)\n lu.assertEquals(candidate({5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10}), 124)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "lua", - "prompt": "-- Create a function which returns the largest index of an element which\n-- is not greater than or equal to the element immediately preceding it. If\n-- no such element exists then return -1. The given table will not contain\n-- duplicate values.\n-- Examples:\n-- >>> can_arrange({1, 2, 4, 3, 5})\n-- 3\n-- >>> can_arrange({1, 2, 3})\n-- -1\nlocal function can_arrange(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = can_arrange\n lu.assertEquals(candidate({1, 2, 4, 3, 5}), 3)\n lu.assertEquals(candidate({1, 2, 4, 5}), -1)\n lu.assertEquals(candidate({1, 4, 2, 5, 6, 7, 8, 9, 10}), 2)\n lu.assertEquals(candidate({4, 8, 5, 7, 3}), 4)\n lu.assertEquals(candidate({}), -1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "lua", - "prompt": "-- Imagine a road that's a perfectly straight infinitely long line.\n-- n cars are driving left to right; simultaneously, a different set of n cars\n-- are driving right to left. The two sets of cars start out being very far from\n-- each other. All cars move in the same speed. Two cars are said to collide\n-- when a car that's moving left to right hits a car that's moving right to left.\n-- However, the cars are infinitely sturdy and strong; as a result, they continue moving\n-- in their trajectory as if they did not collide.\n-- This function outputs the number of such collisions.\nlocal function car_race_collision(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = car_race_collision\n lu.assertEquals(candidate(2), 4)\n lu.assertEquals(candidate(3), 9)\n lu.assertEquals(candidate(4), 16)\n lu.assertEquals(candidate(8), 64)\n lu.assertEquals(candidate(10), 100)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "lua", - "prompt": "-- Create a function that returns true if the last character\n-- of a given string is an alphabetical character and is not\n-- a part of a word, and false otherwise.\n-- Note: \"word\" is a group of characters separated by space.\n-- Examples:\n-- >>> check_if_last_char_is_a_letter('apple pie')\n-- false\n-- >>> check_if_last_char_is_a_letter('apple pi e')\n-- true\n-- >>> check_if_last_char_is_a_letter('apple pi e ')\n-- false\n-- >>> check_if_last_char_is_a_letter('')\n-- false\nlocal function check_if_last_char_is_a_letter(txt)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = check_if_last_char_is_a_letter\n lu.assertEquals(candidate('apple'), false)\n lu.assertEquals(candidate('apple pi e'), true)\n lu.assertEquals(candidate('eeeee'), false)\n lu.assertEquals(candidate('A'), true)\n lu.assertEquals(candidate('Pumpkin pie '), false)\n lu.assertEquals(candidate('Pumpkin pie 1'), false)\n lu.assertEquals(candidate(''), false)\n lu.assertEquals(candidate('eeeee e '), false)\n lu.assertEquals(candidate('apple pie'), false)\n lu.assertEquals(candidate('apple pi e '), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "lua", - "prompt": "-- Return true if a given number is prime, and false otherwise.\n-- >>> is_prime(6)\n-- false\n-- >>> is_prime(101)\n-- true\n-- >>> is_prime(11)\n-- true\n-- >>> is_prime(13441)\n-- true\n-- >>> is_prime(61)\n-- true\n-- >>> is_prime(4)\n-- false\n-- >>> is_prime(1)\n-- false\nlocal function is_prime(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_prime\n lu.assertEquals(candidate(6), false)\n lu.assertEquals(candidate(101), true)\n lu.assertEquals(candidate(11), true)\n lu.assertEquals(candidate(13441), true)\n lu.assertEquals(candidate(61), true)\n lu.assertEquals(candidate(4), false)\n lu.assertEquals(candidate(1), false)\n lu.assertEquals(candidate(5), true)\n lu.assertEquals(candidate(11), true)\n lu.assertEquals(candidate(17), true)\n lu.assertEquals(candidate(85), false)\n lu.assertEquals(candidate(77), false)\n lu.assertEquals(candidate(255379), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "lua", - "prompt": "-- Given a table of positive integers x. return a sorted table of all \n-- elements that hasn't any even digit.\n-- Note: Returned table should be sorted in increasing order.\n-- For example:\n-- >>> unique_digits({15, 33, 1422, 1})\n-- {1, 15, 33}\n-- >>> unique_digits({152, 323, 1422, 10})\n-- {}\nlocal function unique_digits(x)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = unique_digits\n lu.assertEquals(candidate({15, 33, 1422, 1}), {1, 15, 33})\n lu.assertEquals(candidate({152, 323, 1422, 10}), {})\n lu.assertEquals(candidate({12345, 2033, 111, 151}), {111, 151})\n lu.assertEquals(candidate({135, 103, 31}), {31, 135})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "lua", - "prompt": "-- Input are two strings a and b consisting only of 1s and 0s.\n-- Perform binary XOR on these inputs and return result also as a string.\n-- >>> string_xor('010', '110')\n-- '100'\nlocal function string_xor(a, b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = string_xor\n lu.assertEquals(candidate('111000', '101010'), '010010')\n lu.assertEquals(candidate('1', '1'), '0')\n lu.assertEquals(candidate('0101', '0000'), '0101')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "lua", - "prompt": "-- sum_to_n is a function that sums numbers from 1 to n.\n-- >>> sum_to_n(30)\n-- 465\n-- >>> sum_to_n(100)\n-- 5050\n-- >>> sum_to_n(5)\n-- 15\n-- >>> sum_to_n(10)\n-- 55\n-- >>> sum_to_n(1)\n-- 1\nlocal function sum_to_n(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sum_to_n\n lu.assertEquals(candidate(1), 1)\n lu.assertEquals(candidate(6), 21)\n lu.assertEquals(candidate(11), 66)\n lu.assertEquals(candidate(30), 465)\n lu.assertEquals(candidate(100), 5050)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "lua", - "prompt": "-- Given a table of numbers, return the sum of squares of the numbers\n-- in the table that are odd. Ignore numbers that are negative or not integers.\n-- >>> double_the_difference({1, 3, 2, 0})\n-- 10\n-- >>> double_the_difference({-1, -2, 0})\n-- 0\n-- >>> double_the_difference({9, -2})\n-- 81\n-- >>> double_the_difference({0})\n-- 0\n-- If the input table is empty, return 0.\nlocal function double_the_difference(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = double_the_difference\n lu.assertEquals(candidate({}), 0)\n lu.assertEquals(candidate({5.0, 4.0}), 25)\n lu.assertEquals(candidate({0.1, 0.2, 0.3}), 0)\n lu.assertEquals(candidate({-10.0, -20.0, -30.0}), 0)\n lu.assertEquals(candidate({-1.0, -2.0, 8.0}), 0)\n lu.assertEquals(candidate({0.2, 3.0, 5.0}), 34)\n lu.assertEquals(candidate({-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0}), 165)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "lua", - "prompt": "-- Return length of given string\n-- >>> strlen('')\n-- 0\n-- >>> strlen('abc')\n-- 3\nlocal function strlen(string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = strlen\n lu.assertEquals(candidate(''), 0)\n lu.assertEquals(candidate('x'), 1)\n lu.assertEquals(candidate('asdasnakj'), 9)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "lua", - "prompt": "-- You'll be given a string of words, and your task is to count the number\n-- of boredoms. A boredom is a sentence that starts with the word \"I\".\n-- Sentences are delimited by '.', '?' or '!'.\n-- For example:\n-- >>> is_bored('Hello world')\n-- 0\n-- >>> is_bored('The sky is blue. The sun is shining. I love this weather')\n-- 1\nlocal function is_bored(S)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_bored\n lu.assertEquals(candidate('Hello world'), 0)\n lu.assertEquals(candidate('Is the sky blue?'), 0)\n lu.assertEquals(candidate('I love It !'), 1)\n lu.assertEquals(candidate('bIt'), 0)\n lu.assertEquals(candidate('I feel good today. I will be productive. will kill It'), 2)\n lu.assertEquals(candidate('You and I are going for a walk'), 0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "lua", - "prompt": "-- Write a function vowels_count which takes a string representing\n-- a word as input and returns the number of vowels in the string.\n-- Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n-- vowel, but only when it is at the end of the given word.\n-- Example:\n-- >>> vowels_count('abcde')\n-- 2\n-- >>> vowels_count('ACEDY')\n-- 3\nlocal function vowels_count(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = vowels_count\n lu.assertEquals(candidate('abcde'), 2)\n lu.assertEquals(candidate('Alone'), 3)\n lu.assertEquals(candidate('key'), 2)\n lu.assertEquals(candidate('bye'), 1)\n lu.assertEquals(candidate('keY'), 2)\n lu.assertEquals(candidate('bYe'), 1)\n lu.assertEquals(candidate('ACEDY'), 3)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "lua", - "prompt": "-- Return n-th Fibonacci number.\n-- >>> fib(10)\n-- 55\n-- >>> fib(1)\n-- 1\n-- >>> fib(8)\n-- 21\nlocal function fib(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = fib\n lu.assertEquals(candidate(10), 55)\n lu.assertEquals(candidate(1), 1)\n lu.assertEquals(candidate(8), 21)\n lu.assertEquals(candidate(11), 89)\n lu.assertEquals(candidate(12), 144)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "lua", - "prompt": "-- Your task is to implement a function that will simplify the expression\n-- x * n. The function returns true if x * n evaluates to a whole number and false\n-- otherwise. Both x and n, are string representation of a fraction, and have the following format,\n-- / where both numerator and denominator are positive whole numbers.\n-- You can assume that x, and n are valid fractions, and do not have zero as denominator.\n-- >>> simplify('1/5', '5/1')\n-- true\n-- >>> simplify('1/6', '2/1')\n-- false\n-- >>> simplify('7/10', '10/2')\n-- false\nlocal function simplify(x, n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = simplify\n lu.assertEquals(candidate('1/5', '5/1'), true)\n lu.assertEquals(candidate('1/6', '2/1'), false)\n lu.assertEquals(candidate('5/1', '3/1'), true)\n lu.assertEquals(candidate('7/10', '10/2'), false)\n lu.assertEquals(candidate('2/10', '50/10'), true)\n lu.assertEquals(candidate('7/2', '4/2'), true)\n lu.assertEquals(candidate('11/6', '6/1'), true)\n lu.assertEquals(candidate('2/3', '5/2'), false)\n lu.assertEquals(candidate('5/2', '3/5'), false)\n lu.assertEquals(candidate('2/4', '8/4'), true)\n lu.assertEquals(candidate('2/4', '4/2'), true)\n lu.assertEquals(candidate('1/5', '5/1'), true)\n lu.assertEquals(candidate('1/5', '1/5'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "lua", - "prompt": "-- Given a string s, count the number of uppercase vowels in even indices.\n-- For example:\n-- >>> count_upper('aBCdEf')\n-- 1\n-- >>> count_upper('abcdefg')\n-- 0\n-- >>> count_upper('dBBE')\n-- 0\nlocal function count_upper(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = count_upper\n lu.assertEquals(candidate('aBCdEf'), 1)\n lu.assertEquals(candidate('abcdefg'), 0)\n lu.assertEquals(candidate('dBBE'), 0)\n lu.assertEquals(candidate('B'), 0)\n lu.assertEquals(candidate('U'), 1)\n lu.assertEquals(candidate(''), 0)\n lu.assertEquals(candidate('EEEE'), 2)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "lua", - "prompt": "-- You are given a rectangular grid of wells. Each row represents a single well,\n-- and each 1 in a row represents a single unit of water.\n-- Each well has a corresponding bucket that can be used to extract water from it, \n-- and all buckets have the same capacity.\n-- Your task is to use the buckets to empty the wells.\n-- Output the number of times you need to lower the buckets.\n-- Example 1:\n-- >>> max_fill({{0, 0, 1, 0}, {0, 1, 0, 0}, {1, 1, 1, 1}}, 1)\n-- 6\n-- Example 2:\n-- >>> max_fill({{0, 0, 1, 1}, {0, 0, 0, 0}, {1, 1, 1, 1}, {0, 1, 1, 1}}, 2)\n-- 5\n-- Example 3:\n-- >>> max_fill({{0, 0, 0}, {0, 0, 0}}, 5)\n-- 0\n-- Constraints:\n-- * all wells have the same length\n-- * 1 <= grid.length <= 10^2\n-- * 1 <= grid[:,1].length <= 10^2\n-- * grid[i][j] -> 0 | 1\n-- * 1 <= capacity <= 10\nlocal function max_fill(grid, capacity)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = max_fill\n lu.assertEquals(candidate({{0, 0, 1, 0}, {0, 1, 0, 0}, {1, 1, 1, 1}}, 1), 6)\n lu.assertEquals(candidate({{0, 0, 1, 1}, {0, 0, 0, 0}, {1, 1, 1, 1}, {0, 1, 1, 1}}, 2), 5)\n lu.assertEquals(candidate({{0, 0, 0}, {0, 0, 0}}, 5), 0)\n lu.assertEquals(candidate({{1, 1, 1, 1}, {1, 1, 1, 1}}, 2), 4)\n lu.assertEquals(candidate({{1, 1, 1, 1}, {1, 1, 1, 1}}, 9), 2)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "lua", - "prompt": "-- Given a table arr of integers and a positive integer k, return a sorted table \n-- of length k with the maximum k numbers in arr.\n-- Example 1:\n-- >>> maximum({-3, -4, 5}, 3)\n-- {-4, -3, 5}\n-- Example 2:\n-- >>> maximum({4, -4, 4}, 2)\n-- {4, 4}\n-- Example 3:\n-- >>> maximum({-3, 2, 1, 2, -1, -2, 1}, 1)\n-- {2}\n-- Note:\n-- 1. The length of the table will be in the range of [1, 1000].\n-- 2. The elements in the table will be in the range of [-1000, 1000].\n-- 3. 0 <= k <= len(arr)\nlocal function maximum(arr, k)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = maximum\n lu.assertEquals(candidate({-3, -4, 5}, 3), {-4, -3, 5})\n lu.assertEquals(candidate({4, -4, 4}, 2), {4, 4})\n lu.assertEquals(candidate({-3, 2, 1, 2, -1, -2, 1}, 1), {2})\n lu.assertEquals(candidate({123, -123, 20, 0, 1, 2, -3}, 3), {2, 20, 123})\n lu.assertEquals(candidate({-123, 20, 0, 1, 2, -3}, 4), {0, 1, 2, 20})\n lu.assertEquals(candidate({5, 15, 0, 3, -13, -8, 0}, 7), {-13, -8, 0, 0, 3, 5, 15})\n lu.assertEquals(candidate({-1, 0, 2, 5, 3, -10}, 2), {3, 5})\n lu.assertEquals(candidate({1, 0, 5, -7}, 1), {5})\n lu.assertEquals(candidate({4, -4}, 2), {-4, 4})\n lu.assertEquals(candidate({-10, 10}, 2), {-10, 10})\n lu.assertEquals(candidate({1, 2, 3, -23, 243, -400, 0}, 0), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "lua", - "prompt": "-- Write a function that takes a message, and encodes in such a \n-- way that it swaps case of all letters, replaces all vowels in \n-- the message with the letter that appears 2 places ahead of that \n-- vowel in the english alphabet. \n-- Assume only letters. \n-- Examples:\n-- >>> encode('test')\n-- 'TGST'\n-- >>> encode('This is a message')\n-- 'tHKS KS C MGSSCGG'\nlocal function encode(message)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = encode\n lu.assertEquals(candidate('TEST'), 'tgst')\n lu.assertEquals(candidate('Mudasir'), 'mWDCSKR')\n lu.assertEquals(candidate('YES'), 'ygs')\n lu.assertEquals(candidate('This is a message'), 'tHKS KS C MGSSCGG')\n lu.assertEquals(candidate('I DoNt KnOw WhAt tO WrItE'), 'k dQnT kNqW wHcT Tq wRkTg')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "lua", - "prompt": "-- remove_vowels is a function that takes string and returns string without vowels.\n-- >>> remove_vowels('')\n-- ''\n-- >>> remove_vowels('abcdef')\n-- 'bcdf'\n-- >>> remove_vowels('aaaaa')\n-- ''\n-- >>> remove_vowels('aaBAA')\n-- 'B'\n-- >>> remove_vowels('zbcd')\n-- 'zbcd'\nlocal function remove_vowels(text)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = remove_vowels\n lu.assertEquals(candidate(''), '')\n lu.assertEquals(candidate('abcdef\\nghijklm'), 'bcdf\\nghjklm')\n lu.assertEquals(candidate('fedcba'), 'fdcb')\n lu.assertEquals(candidate('eeeee'), '')\n lu.assertEquals(candidate('acBAA'), 'cB')\n lu.assertEquals(candidate('EcBOO'), 'cB')\n lu.assertEquals(candidate('ybcd'), 'ybcd')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "lua", - "prompt": "-- Return only positive numbers in the table.\n-- >>> get_positive({-1, 2, -4, 5, 6})\n-- {2, 5, 6}\n-- >>> get_positive({5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10})\n-- {5, 3, 2, 3, 9, 123, 1}\nlocal function get_positive(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = get_positive\n lu.assertEquals(candidate({-1, -2, 4, 5, 6}), {4, 5, 6})\n lu.assertEquals(candidate({5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10}), {5, 3, 2, 3, 3, 9, 123, 1})\n lu.assertEquals(candidate({-1, -2}), {})\n lu.assertEquals(candidate({}), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "lua", - "prompt": "-- Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n-- >>> string_sequence(0)\n-- '0'\n-- >>> string_sequence(5)\n-- '0 1 2 3 4 5'\nlocal function string_sequence(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = string_sequence\n lu.assertEquals(candidate(0), '0')\n lu.assertEquals(candidate(3), '0 1 2 3')\n lu.assertEquals(candidate(10), '0 1 2 3 4 5 6 7 8 9 10')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "lua", - "prompt": "-- Given a positive integer n, you have to make a pile of n levels of stones.\n-- The first level has n stones.\n-- The number of stones in the next level is:\n-- - the next odd number if n is odd.\n-- - the next even number if n is even.\n-- Return the number of stones in each level in a table, where element at index\n-- i represents the number of stones in the level (i+1).\n-- Examples:\n-- >>> make_a_pile(3)\n-- {3, 5, 7}\nlocal function make_a_pile(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = make_a_pile\n lu.assertEquals(candidate(3), {3, 5, 7})\n lu.assertEquals(candidate(4), {4, 6, 8, 10})\n lu.assertEquals(candidate(5), {5, 7, 9, 11, 13})\n lu.assertEquals(candidate(6), {6, 8, 10, 12, 14, 16})\n lu.assertEquals(candidate(8), {8, 10, 12, 14, 16, 18, 20, 22})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "lua", - "prompt": "-- Task\n-- 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\n-- then check if the result string is palindrome.\n-- A string is called palindrome if it reads the same backward as forward.\n-- You should return a table containing the result string and true/false for the check.\n-- Example\n-- >>> reverse_delete('abcde', 'ae')\n-- {'bcd', false}\n-- >>> reverse_delete('abcdef', 'b')\n-- {'acdef', false}\n-- >>> reverse_delete('abcdedcba', 'ab')\n-- {'cdedc', true}\nlocal function reverse_delete(s, c)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = reverse_delete\n lu.assertEquals(candidate('abcde', 'ae'), {'bcd', false})\n lu.assertEquals(candidate('abcdef', 'b'), {'acdef', false})\n lu.assertEquals(candidate('abcdedcba', 'ab'), {'cdedc', true})\n lu.assertEquals(candidate('dwik', 'w'), {'dik', false})\n lu.assertEquals(candidate('a', 'a'), {'', true})\n lu.assertEquals(candidate('abcdedcba', ''), {'abcdedcba', true})\n lu.assertEquals(candidate('abcdedcba', 'v'), {'abcdedcba', true})\n lu.assertEquals(candidate('vabba', 'v'), {'abba', true})\n lu.assertEquals(candidate('mamma', 'mia'), {'', true})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "lua", - "prompt": "-- For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n-- >>> flip_case('Hello')\n-- 'hELLO'\nlocal function flip_case(string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = flip_case\n lu.assertEquals(candidate(''), '')\n lu.assertEquals(candidate('Hello!'), 'hELLO!')\n lu.assertEquals(candidate('These violent delights have violent ends'), 'tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "lua", - "prompt": "-- You are given a string s.\n-- if s[i] is a letter, reverse its case from lower to upper or vise versa, \n-- otherwise keep it as it is.\n-- If the string contains no letters, reverse the string.\n-- The function should return the resulted string.\n-- Examples\n-- >>> solve('1234')\n-- '4321'\n-- >>> solve('ab')\n-- 'AB'\n-- >>> solve('#a@C')\n-- '#A@c'\nlocal function solve(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = solve\n lu.assertEquals(candidate('AsDf'), 'aSdF')\n lu.assertEquals(candidate('1234'), '4321')\n lu.assertEquals(candidate('ab'), 'AB')\n lu.assertEquals(candidate('#a@C'), '#A@c')\n lu.assertEquals(candidate('#AsdfW^45'), '#aSDFw^45')\n lu.assertEquals(candidate('#6@2'), '2@6#')\n lu.assertEquals(candidate('#$a^D'), '#$A^d')\n lu.assertEquals(candidate('#ccc'), '#CCC')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "lua", - "prompt": "-- Filter an input table of strings only for ones that start with a given prefix.\n-- >>> filter_by_prefix({}, 'a')\n-- {}\n-- >>> filter_by_prefix({'abc', 'bcd', 'cde', 'array'}, 'a')\n-- {'abc', 'array'}\nlocal function filter_by_prefix(strings, prefix)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = filter_by_prefix\n lu.assertEquals(candidate({}, 'john'), {})\n lu.assertEquals(candidate({'xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'}, 'xxx'), {'xxx', 'xxxAAA', 'xxx'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "lua", - "prompt": "-- This function takes two positive numbers x and y and returns the\n-- biggest even integer number that is in the range [x, y] inclusive. If \n-- there's no such number, then the function should return -1.\n-- For example:\n-- >>> choose_num(12, 15)\n-- 14\n-- >>> choose_num(13, 12)\n-- -1\nlocal function choose_num(x, y)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = choose_num\n lu.assertEquals(candidate(12, 15), 14)\n lu.assertEquals(candidate(13, 12), -1)\n lu.assertEquals(candidate(33, 12354), 12354)\n lu.assertEquals(candidate(5234, 5233), -1)\n lu.assertEquals(candidate(6, 29), 28)\n lu.assertEquals(candidate(27, 10), -1)\n lu.assertEquals(candidate(7, 7), -1)\n lu.assertEquals(candidate(546, 546), 546)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "lua", - "prompt": "-- You are given a string representing a sentence,\n-- the sentence contains some words separated by a space,\n-- and you have to return a string that contains the words from the original sentence,\n-- whose lengths are prime numbers,\n-- the order of the words in the new string should be the same as the original one.\n-- Example 1:\n-- >>> words_in_sentence('This is a test')\n-- 'is'\n-- Example 2:\n-- >>> words_in_sentence('lets go for swimming')\n-- 'go for'\n-- Constraints:\n-- * 1 <= len(sentence) <= 100\n-- * sentence contains only letters\nlocal function words_in_sentence(sentence)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = words_in_sentence\n lu.assertEquals(candidate('This is a test'), 'is')\n lu.assertEquals(candidate('lets go for swimming'), 'go for')\n lu.assertEquals(candidate('there is no place available here'), 'there is no place')\n lu.assertEquals(candidate('Hi I am Hussein'), 'Hi am Hussein')\n lu.assertEquals(candidate('go for it'), 'go for it')\n lu.assertEquals(candidate('here'), '')\n lu.assertEquals(candidate('here is'), 'is')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "lua", - "prompt": "-- Insert a number 'delimeter' between every two consecutive elements of input table `numbers'\n-- >>> intersperse({}, 4)\n-- {}\n-- >>> intersperse({1, 2, 3}, 4)\n-- {1, 4, 2, 4, 3}\nlocal function intersperse(numbers, delimeter)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = intersperse\n lu.assertEquals(candidate({}, 7), {})\n lu.assertEquals(candidate({5, 6, 3, 2}, 8), {5, 8, 6, 8, 3, 8, 2})\n lu.assertEquals(candidate({2, 2, 2}, 2), {2, 2, 2, 2, 2})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "lua", - "prompt": "-- Your task is to write a function that returns true if a number x is a simple\n-- power of n and false in other cases.\n-- x is a simple power of n if n**int=x\n-- For example:\n-- >>> is_simple_power(1, 4)\n-- true\n-- >>> is_simple_power(2, 2)\n-- true\n-- >>> is_simple_power(8, 2)\n-- true\n-- >>> is_simple_power(3, 2)\n-- false\n-- >>> is_simple_power(3, 1)\n-- false\n-- >>> is_simple_power(5, 3)\n-- false\nlocal function is_simple_power(x, n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_simple_power\n lu.assertEquals(candidate(16, 2), true)\n lu.assertEquals(candidate(143214, 16), false)\n lu.assertEquals(candidate(4, 2), true)\n lu.assertEquals(candidate(9, 3), true)\n lu.assertEquals(candidate(16, 4), true)\n lu.assertEquals(candidate(24, 2), false)\n lu.assertEquals(candidate(128, 4), false)\n lu.assertEquals(candidate(12, 6), false)\n lu.assertEquals(candidate(1, 1), true)\n lu.assertEquals(candidate(1, 12), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "lua", - "prompt": "-- Write a function that returns true if the given number is the multiplication of 3 prime numbers\n-- and false otherwise.\n-- Knowing that (a) is less then 100. \n-- Example:\n-- >>> is_multiply_prime(30)\n-- true\n-- 30 = 2 * 3 * 5\nlocal function is_multiply_prime(a)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_multiply_prime\n lu.assertEquals(candidate(5), false)\n lu.assertEquals(candidate(30), true)\n lu.assertEquals(candidate(8), true)\n lu.assertEquals(candidate(10), false)\n lu.assertEquals(candidate(125), true)\n lu.assertEquals(candidate(105), true)\n lu.assertEquals(candidate(126), false)\n lu.assertEquals(candidate(729), false)\n lu.assertEquals(candidate(891), false)\n lu.assertEquals(candidate(1001), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "lua", - "prompt": "-- Given the lengths of the three sides of a triangle. Return true if the three\n-- sides form a right-angled triangle, false otherwise.\n-- A right-angled triangle is a triangle in which one angle is right angle or \n-- 90 degree.\n-- Example:\n-- >>> right_angle_triangle(3, 4, 5)\n-- true\n-- >>> right_angle_triangle(1, 2, 3)\n-- false\nlocal function right_angle_triangle(a, b, c)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = right_angle_triangle\n lu.assertEquals(candidate(3, 4, 5), true)\n lu.assertEquals(candidate(1, 2, 3), false)\n lu.assertEquals(candidate(10, 6, 8), true)\n lu.assertEquals(candidate(2, 2, 2), false)\n lu.assertEquals(candidate(7, 24, 25), true)\n lu.assertEquals(candidate(10, 5, 7), false)\n lu.assertEquals(candidate(5, 12, 13), true)\n lu.assertEquals(candidate(15, 8, 17), true)\n lu.assertEquals(candidate(48, 55, 73), true)\n lu.assertEquals(candidate(1, 1, 1), false)\n lu.assertEquals(candidate(2, 2, 10), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "lua", - "prompt": "-- Create a function that takes 3 numbers.\n-- Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n-- Returns false in any other cases.\n-- Examples\n-- >>> any_int(5, 2, 7)\n-- true\n-- >>> any_int(3, 2, 2)\n-- false\n-- >>> any_int(3, -2, 1)\n-- true\n-- >>> any_int(3.6, -2.2, 2)\n-- false\nlocal function any_int(x, y, z)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = any_int\n lu.assertEquals(candidate(2, 3, 1), true)\n lu.assertEquals(candidate(2.5, 2, 3), false)\n lu.assertEquals(candidate(1.5, 5, 3.5), false)\n lu.assertEquals(candidate(2, 6, 2), false)\n lu.assertEquals(candidate(4, 2, 2), true)\n lu.assertEquals(candidate(2.2, 2.2, 2.2), false)\n lu.assertEquals(candidate(-4, 6, 2), true)\n lu.assertEquals(candidate(2, 1, 1), true)\n lu.assertEquals(candidate(3, 4, 7), true)\n lu.assertEquals(candidate(3.0, 4, 7), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "lua", - "prompt": "-- This function takes a table l and returns a table l' such that\n-- l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n-- to the values of the corresponding indicies of l, but sorted.\n-- >>> sort_third({1, 2, 3})\n-- {1, 2, 3}\n-- >>> sort_third({5, 6, 3, 4, 8, 9, 2})\n-- {2, 6, 3, 4, 8, 9, 5}\nlocal function sort_third(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sort_third\n lu.assertEquals(candidate({5, 6, 3, 4, 8, 9, 2}), {2, 6, 3, 4, 8, 9, 5})\n lu.assertEquals(candidate({5, 8, 3, 4, 6, 9, 2}), {2, 8, 3, 4, 6, 9, 5})\n lu.assertEquals(candidate({5, 6, 9, 4, 8, 3, 2}), {2, 6, 9, 4, 8, 3, 5})\n lu.assertEquals(candidate({5, 6, 3, 4, 8, 9, 2, 1}), {2, 6, 3, 4, 8, 9, 5, 1})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_53_add", - "language": "lua", - "prompt": "-- Add two numbers x and y\n-- >>> add(2, 3)\n-- 5\n-- >>> add(5, 7)\n-- 12\nlocal function add(x, y)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = add\n lu.assertEquals(candidate(0, 1), 1)\n lu.assertEquals(candidate(1, 0), 1)\n lu.assertEquals(candidate(2, 3), 5)\n lu.assertEquals(candidate(5, 7), 12)\n lu.assertEquals(candidate(7, 5), 12)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_69_search", - "language": "lua", - "prompt": "-- You are given a non-empty table of positive integers. Return the greatest integer that is greater than \n-- zero, and has a frequency greater than or equal to the value of the integer itself. \n-- The frequency of an integer is the number of times it appears in the table.\n-- If no such a value exist, return -1.\n-- Examples:\n-- >>> search({4, 1, 2, 2, 3, 1})\n-- 2\n-- >>> search({1, 2, 2, 3, 3, 3, 4, 4, 4})\n-- 3\n-- >>> search({5, 5, 4, 4, 4})\n-- -1\nlocal function search(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = search\n lu.assertEquals(candidate({5, 5, 5, 5, 1}), 1)\n lu.assertEquals(candidate({4, 1, 4, 1, 4, 4}), 4)\n lu.assertEquals(candidate({3, 3}), -1)\n lu.assertEquals(candidate({8, 8, 8, 8, 8, 8, 8, 8}), 8)\n lu.assertEquals(candidate({2, 3, 3, 2, 2}), 2)\n lu.assertEquals(candidate({2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1}), 1)\n lu.assertEquals(candidate({3, 2, 8, 2}), 2)\n lu.assertEquals(candidate({6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10}), 1)\n lu.assertEquals(candidate({8, 8, 3, 6, 5, 6, 4}), -1)\n lu.assertEquals(candidate({6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9}), 1)\n lu.assertEquals(candidate({1, 9, 10, 1, 3}), 1)\n lu.assertEquals(candidate({6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10}), 5)\n lu.assertEquals(candidate({1}), 1)\n lu.assertEquals(candidate({8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5}), 4)\n lu.assertEquals(candidate({2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10}), 2)\n lu.assertEquals(candidate({1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3}), 1)\n lu.assertEquals(candidate({9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4}), 4)\n lu.assertEquals(candidate({2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7}), 4)\n lu.assertEquals(candidate({9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1}), 2)\n lu.assertEquals(candidate({5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8}), -1)\n lu.assertEquals(candidate({10}), -1)\n lu.assertEquals(candidate({9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2}), 2)\n lu.assertEquals(candidate({5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8}), 1)\n lu.assertEquals(candidate({7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6}), 1)\n lu.assertEquals(candidate({3, 10, 10, 9, 2}), -1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "lua", - "prompt": "-- Write a function that takes a string and returns true if the string\n-- length is a prime number or false otherwise\n-- Examples\n-- >>> prime_length('Hello')\n-- true\n-- >>> prime_length('abcdcba')\n-- true\n-- >>> prime_length('kittens')\n-- true\n-- >>> prime_length('orange')\n-- false\nlocal function prime_length(string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = prime_length\n lu.assertEquals(candidate('Hello'), true)\n lu.assertEquals(candidate('abcdcba'), true)\n lu.assertEquals(candidate('kittens'), true)\n lu.assertEquals(candidate('orange'), false)\n lu.assertEquals(candidate('wow'), true)\n lu.assertEquals(candidate('world'), true)\n lu.assertEquals(candidate('MadaM'), true)\n lu.assertEquals(candidate('Wow'), true)\n lu.assertEquals(candidate(''), false)\n lu.assertEquals(candidate('HI'), true)\n lu.assertEquals(candidate('go'), true)\n lu.assertEquals(candidate('gogo'), false)\n lu.assertEquals(candidate('aaaaaaaaaaaaaaa'), false)\n lu.assertEquals(candidate('Madam'), true)\n lu.assertEquals(candidate('M'), false)\n lu.assertEquals(candidate('0'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_58_common", - "language": "lua", - "prompt": "-- Return sorted unique common elements for two tables.\n-- >>> common({1, 4, 3, 34, 653, 2, 5}, {5, 7, 1, 5, 9, 653, 121})\n-- {1, 5, 653}\n-- >>> common({5, 3, 2, 8}, {3, 2})\n-- {2, 3}\nlocal function common(l1, l2)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = common\n lu.assertEquals(candidate({1, 4, 3, 34, 653, 2, 5}, {5, 7, 1, 5, 9, 653, 121}), {1, 5, 653})\n lu.assertEquals(candidate({5, 3, 2, 8}, {3, 2}), {2, 3})\n lu.assertEquals(candidate({4, 3, 2, 8}, {3, 2, 4}), {2, 3, 4})\n lu.assertEquals(candidate({4, 3, 2, 8}, {}), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "lua", - "prompt": "-- The Brazilian factorial is defined as:\n-- brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n-- where n > 0\n-- For example:\n-- >>> special_factorial(4)\n-- 288\n-- The function will receive an integer as input and should return the special\n-- factorial of this integer.\nlocal function special_factorial(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = special_factorial\n lu.assertEquals(candidate(4), 288)\n lu.assertEquals(candidate(5), 34560)\n lu.assertEquals(candidate(7), 125411328000)\n lu.assertEquals(candidate(1), 1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "lua", - "prompt": "-- In this problem, you will implement a function that takes two tables of numbers,\n-- and determines whether it is possible to perform an exchange of elements\n-- between them to make lst1 a table of only even numbers.\n-- There is no limit on the number of exchanged elements between lst1 and lst2.\n-- If it is possible to exchange elements between the lst1 and lst2 to make\n-- all the elements of lst1 to be even, return \"YES\".\n-- Otherwise, return \"NO\".\n-- For example:\n-- >>> exchange({1, 2, 3, 4}, {1, 2, 3, 4})\n-- 'YES'\n-- >>> exchange({1, 2, 3, 4}, {1, 5, 3, 4})\n-- 'NO'\n-- It is assumed that the input tables will be non-empty.\nlocal function exchange(lst1, lst2)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = exchange\n lu.assertEquals(candidate({1, 2, 3, 4}, {1, 2, 3, 4}), 'YES')\n lu.assertEquals(candidate({1, 2, 3, 4}, {1, 5, 3, 4}), 'NO')\n lu.assertEquals(candidate({1, 2, 3, 4}, {2, 1, 4, 3}), 'YES')\n lu.assertEquals(candidate({5, 7, 3}, {2, 6, 4}), 'YES')\n lu.assertEquals(candidate({5, 7, 3}, {2, 6, 3}), 'NO')\n lu.assertEquals(candidate({3, 2, 6, 1, 8, 9}, {3, 5, 5, 1, 1, 1}), 'NO')\n lu.assertEquals(candidate({100, 200}, {200, 200}), 'YES')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "lua", - "prompt": "-- Given a non-empty table of integers arr and an integer k, return\n-- the sum of the elements with at most two digits from the first k elements of arr.\n-- Example:\n-- >>> add_elements({111, 21, 3, 4000, 5, 6, 7, 8, 9}, 4)\n-- 24\n-- Constraints:\n-- 1. 1 <= len(arr) <= 100\n-- 2. 1 <= k <= len(arr)\nlocal function add_elements(arr, k)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = add_elements\n lu.assertEquals(candidate({1, -2, -3, 41, 57, 76, 87, 88, 99}, 3), -4)\n lu.assertEquals(candidate({111, 121, 3, 4000, 5, 6}, 2), 0)\n lu.assertEquals(candidate({11, 21, 3, 90, 5, 6, 7, 8, 9}, 4), 125)\n lu.assertEquals(candidate({111, 21, 3, 4000, 5, 6, 7, 8, 9}, 4), 24)\n lu.assertEquals(candidate({1}, 1), 1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "lua", - "prompt": "-- A simple program which should return the value of x if n is \n-- a prime number and should return the value of y otherwise.\n-- Examples:\n-- >>> x_or_y(7, 34, 12)\n-- 34\n-- >>> x_or_y(15, 8, 5)\n-- 5\nlocal function x_or_y(n, x, y)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = x_or_y\n lu.assertEquals(candidate(7, 34, 12), 34)\n lu.assertEquals(candidate(15, 8, 5), 5)\n lu.assertEquals(candidate(3, 33, 5212), 33)\n lu.assertEquals(candidate(1259, 3, 52), 3)\n lu.assertEquals(candidate(7919, -1, 12), -1)\n lu.assertEquals(candidate(3609, 1245, 583), 583)\n lu.assertEquals(candidate(91, 56, 129), 129)\n lu.assertEquals(candidate(6, 34, 1234), 1234)\n lu.assertEquals(candidate(1, 2, 0), 0)\n lu.assertEquals(candidate(2, 2, 0), 2)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "lua", - "prompt": "-- Given length of a side and high return area for a triangle.\n-- >>> triangle_area(5, 3)\n-- 7.5\nlocal function triangle_area(a, h)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = triangle_area\n lu.assertEquals(candidate(5, 3), 7.5)\n lu.assertEquals(candidate(2, 2), 2.0)\n lu.assertEquals(candidate(10, 8), 40.0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "lua", - "prompt": "-- Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n-- the last couple centuries. However, what people don't know is Tribonacci sequence.\n-- Tribonacci sequence is defined by the recurrence:\n-- tri(1) = 3\n-- tri(n) = 1 + n / 2, if n is even.\n-- tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n-- For example:\n-- tri(2) = 1 + (2 / 2) = 2\n-- tri(4) = 3\n-- tri(3) = tri(2) + tri(1) + tri(4)\n-- = 2 + 3 + 3 = 8 \n-- You are given a non-negative integer number n, you have to a return a table of the \n-- first n + 1 numbers of the Tribonacci sequence.\n-- Examples:\n-- >>> tri(3)\n-- {1, 3, 2, 8}\nlocal function tri(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = tri\n lu.assertEquals(candidate(3), {1, 3, 2, 8})\n lu.assertEquals(candidate(4), {1, 3, 2, 8, 3})\n lu.assertEquals(candidate(5), {1, 3, 2, 8, 3, 15})\n lu.assertEquals(candidate(6), {1, 3, 2, 8, 3, 15, 4})\n lu.assertEquals(candidate(7), {1, 3, 2, 8, 3, 15, 4, 24})\n lu.assertEquals(candidate(8), {1, 3, 2, 8, 3, 15, 4, 24, 5})\n lu.assertEquals(candidate(9), {1, 3, 2, 8, 3, 15, 4, 24, 5, 35})\n lu.assertEquals(candidate(20), {1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11})\n lu.assertEquals(candidate(0), {1})\n lu.assertEquals(candidate(1), {1, 3})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "lua", - "prompt": "-- You are given a table of two strings, both strings consist of open\n-- parentheses '(' or close parentheses ')' only.\n-- Your job is to check if it is possible to concatenate the two strings in\n-- some order, that the resulting string will be good.\n-- A string S is considered to be good if and only if all parentheses in S\n-- are balanced. For example: the string '(())()' is good, while the string\n-- '())' is not.\n-- Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n-- Examples:\n-- >>> match_parens({'()(', ')'})\n-- 'Yes'\n-- >>> match_parens({')', ')'})\n-- 'No'\nlocal function match_parens(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = match_parens\n lu.assertEquals(candidate({'()(', ')'}), 'Yes')\n lu.assertEquals(candidate({')', ')'}), 'No')\n lu.assertEquals(candidate({'(()(())', '())())'}), 'No')\n lu.assertEquals(candidate({')())', '(()()('}), 'Yes')\n lu.assertEquals(candidate({'(())))', '(()())(('}), 'Yes')\n lu.assertEquals(candidate({'()', '())'}), 'No')\n lu.assertEquals(candidate({'(()(', '()))()'}), 'Yes')\n lu.assertEquals(candidate({'((((', '((())'}), 'No')\n lu.assertEquals(candidate({')(()', '(()('}), 'No')\n lu.assertEquals(candidate({')(', ')('}), 'No')\n lu.assertEquals(candidate({'(', ')'}), 'Yes')\n lu.assertEquals(candidate({')', '('}), 'Yes')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "lua", - "prompt": "-- From a table of integers, remove all elements that occur more than once.\n-- Keep order of elements left the same as in the input.\n-- >>> remove_duplicates({1, 2, 3, 2, 4})\n-- {1, 3, 4}\nlocal function remove_duplicates(numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = remove_duplicates\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({1, 2, 3, 4}), {1, 2, 3, 4})\n lu.assertEquals(candidate({1, 2, 3, 2, 4, 3, 5}), {1, 4, 5})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "lua", - "prompt": "-- Return a greatest common divisor of two integers a and b\n-- >>> greatest_common_divisor(3, 5)\n-- 1\n-- >>> greatest_common_divisor(25, 15)\n-- 5\nlocal function greatest_common_divisor(a, b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = greatest_common_divisor\n lu.assertEquals(candidate(3, 7), 1)\n lu.assertEquals(candidate(10, 15), 5)\n lu.assertEquals(candidate(49, 14), 7)\n lu.assertEquals(candidate(144, 60), 12)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "lua", - "prompt": "-- Checks if given string is a palindrome\n-- >>> is_palindrome('')\n-- true\n-- >>> is_palindrome('aba')\n-- true\n-- >>> is_palindrome('aaaaa')\n-- true\n-- >>> is_palindrome('zbcd')\n-- false\nlocal function is_palindrome(text)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_palindrome\n lu.assertEquals(candidate(''), true)\n lu.assertEquals(candidate('aba'), true)\n lu.assertEquals(candidate('aaaaa'), true)\n lu.assertEquals(candidate('zbcd'), false)\n lu.assertEquals(candidate('xywyx'), true)\n lu.assertEquals(candidate('xywyz'), false)\n lu.assertEquals(candidate('xywzx'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "lua", - "prompt": "-- xs represent coefficients of a polynomial.\n-- xs[0] + xs[1] * x + xs[2] * x^2 + ....\n-- Return derivative of this polynomial in the same form.\n-- >>> derivative({3, 1, 2, 4, 5})\n-- {1, 4, 12, 20}\n-- >>> derivative({1, 2, 3})\n-- {2, 6}\nlocal function derivative(xs)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = derivative\n lu.assertEquals(candidate({3, 1, 2, 4, 5}), {1, 4, 12, 20})\n lu.assertEquals(candidate({1, 2, 3}), {2, 6})\n lu.assertEquals(candidate({3, 2, 1}), {2, 2})\n lu.assertEquals(candidate({3, 2, 1, 0, 4}), {2, 2, 0, 16})\n lu.assertEquals(candidate({1}), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "lua", - "prompt": "-- In this task, you will be given a string that represents a number of apples and oranges \n-- that are distributed in a basket of fruit this basket contains \n-- apples, oranges, and mango fruits. Given the string that represents the total number of \n-- the oranges and apples and an integer that represent the total number of the fruits \n-- in the basket return the number of the mango fruits in the basket.\n-- for examble:\n-- >>> fruit_distribution('5 apples and 6 oranges', 19)\n-- 8\n-- >>> fruit_distribution('0 apples and 1 oranges', 3)\n-- 2\n-- >>> fruit_distribution('2 apples and 3 oranges', 100)\n-- 95\n-- >>> fruit_distribution('100 apples and 1 oranges', 120)\n-- 19\nlocal function fruit_distribution(s, n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = fruit_distribution\n lu.assertEquals(candidate('5 apples and 6 oranges', 19), 8)\n lu.assertEquals(candidate('5 apples and 6 oranges', 21), 10)\n lu.assertEquals(candidate('0 apples and 1 oranges', 3), 2)\n lu.assertEquals(candidate('1 apples and 0 oranges', 3), 2)\n lu.assertEquals(candidate('2 apples and 3 oranges', 100), 95)\n lu.assertEquals(candidate('2 apples and 3 oranges', 5), 0)\n lu.assertEquals(candidate('1 apples and 100 oranges', 120), 19)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "lua", - "prompt": "-- Write a function that takes an integer a and returns true \n-- if this ingeger is a cube of some integer number.\n-- Note: you may assume the input is always valid.\n-- Examples:\n-- >>> iscube(1)\n-- true\n-- >>> iscube(2)\n-- false\n-- >>> iscube(-1)\n-- true\n-- >>> iscube(64)\n-- true\n-- >>> iscube(0)\n-- true\n-- >>> iscube(180)\n-- false\nlocal function iscube(a)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = iscube\n lu.assertEquals(candidate(1), true)\n lu.assertEquals(candidate(2), false)\n lu.assertEquals(candidate(-1), true)\n lu.assertEquals(candidate(64), true)\n lu.assertEquals(candidate(180), false)\n lu.assertEquals(candidate(1000), true)\n lu.assertEquals(candidate(0), true)\n lu.assertEquals(candidate(1729), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "lua", - "prompt": "-- In this Kata, you have to sort a table of non-negative integers according to\n-- number of ones in their binary representation in ascending order.\n-- For similar number of ones, sort based on decimal value.\n-- It must be implemented like this:\n-- >>> sort_array({1, 5, 2, 3, 4})\n-- {1, 2, 3, 4, 5}\n-- >>> sort_array({-2, -3, -4, -5, -6})\n-- {-6, -5, -4, -3, -2}\n-- >>> sort_array({1, 0, 2, 3, 4})\n-- {0, 1, 2, 3, 4}\nlocal function sort_array(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sort_array\n lu.assertEquals(candidate({1, 5, 2, 3, 4}), {1, 2, 4, 3, 5})\n lu.assertEquals(candidate({-2, -3, -4, -5, -6}), {-4, -2, -6, -5, -3})\n lu.assertEquals(candidate({1, 0, 2, 3, 4}), {0, 1, 2, 4, 3})\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4}), {2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77})\n lu.assertEquals(candidate({3, 6, 44, 12, 32, 5}), {32, 3, 5, 6, 12, 44})\n lu.assertEquals(candidate({2, 4, 8, 16, 32}), {2, 4, 8, 16, 32})\n lu.assertEquals(candidate({2, 4, 8, 16, 32}), {2, 4, 8, 16, 32})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "lua", - "prompt": "-- Given a table of strings, where each string consists of only digits, return a table.\n-- Each element i of the output should be \"the number of odd elements in the\n-- string i of the input.\" where all the i's should be replaced by the number\n-- of odd digits in the i'th string of the input.\n-- >>> odd_count({'1234567'})\n-- {'the number of odd elements 4n the str4ng 4 of the 4nput.'}\n-- >>> odd_count({'3', '11111111'})\n-- {'the number of odd elements 1n the str1ng 1 of the 1nput.', 'the number of odd elements 8n the str8ng 8 of the 8nput.'}\nlocal function odd_count(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = odd_count\n lu.assertEquals(candidate({'1234567'}), {'the number of odd elements 4n the str4ng 4 of the 4nput.'})\n lu.assertEquals(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.'})\n lu.assertEquals(candidate({'271', '137', '314'}), {'the number of odd elements 2n the str2ng 2 of the 2nput.', 'the number of odd elements 3n the str3ng 3 of the 3nput.', 'the number of odd elements 2n the str2ng 2 of the 2nput.'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "lua", - "prompt": "-- brackets is a string of \"(\" and \")\".\n-- return true if every opening bracket has a corresponding closing bracket.\n-- >>> correct_bracketing('(')\n-- false\n-- >>> correct_bracketing('()')\n-- true\n-- >>> correct_bracketing('(()())')\n-- true\n-- >>> correct_bracketing(')(()')\n-- false\nlocal function correct_bracketing(brackets)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = correct_bracketing\n lu.assertEquals(candidate('()'), true)\n lu.assertEquals(candidate('(()())'), true)\n lu.assertEquals(candidate('()()(()())()'), true)\n lu.assertEquals(candidate('()()((()()())())(()()(()))'), true)\n lu.assertEquals(candidate('((()())))'), false)\n lu.assertEquals(candidate(')(()'), false)\n lu.assertEquals(candidate('('), false)\n lu.assertEquals(candidate('(((('), false)\n lu.assertEquals(candidate(')'), false)\n lu.assertEquals(candidate('(()'), false)\n lu.assertEquals(candidate('()()(()())())(()'), false)\n lu.assertEquals(candidate('()()(()())()))()'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "lua", - "prompt": "-- Task\n-- Write a function that takes a string as input and returns the sum of the upper characters only'\n-- ASCII codes.\n-- Examples:\n-- >>> digitSum('')\n-- 0\n-- >>> digitSum('abAB')\n-- 131\n-- >>> digitSum('abcCd')\n-- 67\n-- >>> digitSum('helloE')\n-- 69\n-- >>> digitSum('woArBld')\n-- 131\n-- >>> digitSum('aAaaaXa')\n-- 153\nlocal function digitSum(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = digitSum\n lu.assertEquals(candidate(''), 0)\n lu.assertEquals(candidate('abAB'), 131)\n lu.assertEquals(candidate('abcCd'), 67)\n lu.assertEquals(candidate('helloE'), 69)\n lu.assertEquals(candidate('woArBld'), 131)\n lu.assertEquals(candidate('aAaaaXa'), 153)\n lu.assertEquals(candidate(' How are yOu?'), 151)\n lu.assertEquals(candidate('You arE Very Smart'), 327)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "lua", - "prompt": "-- Write a function that accepts a table of strings as a parameter,\n-- deletes the strings that have odd lengths from it,\n-- and returns the resulted table with a sorted order,\n-- The table is always a table of strings and never a table of numbers,\n-- and it may contain duplicates.\n-- The order of the table should be ascending by length of each word, and you\n-- should return the table sorted by that rule.\n-- If two words have the same length, sort the table alphabetically.\n-- The function should return a table of strings in sorted order.\n-- You may assume that all words will have the same length.\n-- For example:\n-- >>> list_sort({'aa', 'a', 'aaa'})\n-- {'aa'}\n-- >>> list_sort({'ab', 'a', 'aaa', 'cd'})\n-- {'ab', 'cd'}\nlocal function sorted_list_sum(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sorted_list_sum\n lu.assertEquals(candidate({'aa', 'a', 'aaa'}), {'aa'})\n lu.assertEquals(candidate({'school', 'AI', 'asdf', 'b'}), {'AI', 'asdf', 'school'})\n lu.assertEquals(candidate({'d', 'b', 'c', 'a'}), {})\n lu.assertEquals(candidate({'d', 'dcba', 'abcd', 'a'}), {'abcd', 'dcba'})\n lu.assertEquals(candidate({'AI', 'ai', 'au'}), {'AI', 'ai', 'au'})\n lu.assertEquals(candidate({'a', 'b', 'b', 'c', 'c', 'a'}), {})\n lu.assertEquals(candidate({'aaaa', 'bbbb', 'dd', 'cc'}), {'cc', 'dd', 'aaaa', 'bbbb'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "lua", - "prompt": "-- You are given a table arr of integers and you need to return\n-- sum of magnitudes of integers multiplied by product of all signs\n-- of each number in the table, represented by 1, -1 or 0.\n-- Note: return None for empty arr.\n-- Example:\n-- >>> prod_signs({1, 2, 2, -4})\n-- 9\n-- >>> prod_signs({0, 1})\n-- 0\n-- >>> prod_signs({})\n-- None\nlocal function prod_signs(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = prod_signs\n lu.assertEquals(candidate({1, 2, 2, -4}), -9)\n lu.assertEquals(candidate({0, 1}), 0)\n lu.assertEquals(candidate({1, 1, 1, 2, 3, -1, 1}), -10)\n lu.assertEquals(candidate({}), None)\n lu.assertEquals(candidate({2, 4, 1, 2, -1, -1, 9}), 20)\n lu.assertEquals(candidate({-1, 1, -1, 1}), 4)\n lu.assertEquals(candidate({-1, 1, 1, 1}), -4)\n lu.assertEquals(candidate({-1, 1, 1, 0}), 0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "lua", - "prompt": "-- Return table with elements incremented by 1.\n-- >>> incr_list({1, 2, 3})\n-- {2, 3, 4}\n-- >>> incr_list({5, 3, 5, 2, 3, 3, 9, 0, 123})\n-- {6, 4, 6, 3, 4, 4, 10, 1, 124}\nlocal function incr_list(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = incr_list\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({3, 2, 1}), {4, 3, 2})\n lu.assertEquals(candidate({5, 2, 5, 2, 3, 3, 9, 0, 123}), {6, 3, 6, 3, 4, 4, 10, 1, 124})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "lua", - "prompt": "-- From a given table of integers, generate a table of rolling maximum element found until given moment\n-- in the sequence.\n-- >>> rolling_max({1, 2, 3, 2, 3, 4, 2})\n-- {1, 2, 3, 3, 3, 4, 4}\nlocal function rolling_max(numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = rolling_max\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({1, 2, 3, 4}), {1, 2, 3, 4})\n lu.assertEquals(candidate({4, 3, 2, 1}), {4, 4, 4, 4})\n lu.assertEquals(candidate({3, 2, 3, 100, 3}), {3, 3, 3, 100, 100})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "lua", - "prompt": "-- Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n-- separate those group into separate strings and return the table of those.\n-- Separate groups are balanced (each open brace is properly closed) and not nested within each other\n-- Ignore any spaces in the input string.\n-- >>> separate_paren_groups('( ) (( )) (( )( ))')\n-- {'()', '(())', '(()())'}\nlocal function separate_paren_groups(paren_string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = separate_paren_groups\n lu.assertEquals(candidate('(()()) ((())) () ((())()())'), {'(()())', '((()))', '()', '((())()())'})\n lu.assertEquals(candidate('() (()) ((())) (((())))'), {'()', '(())', '((()))', '(((())))'})\n lu.assertEquals(candidate('(()(())((())))'), {'(()(())((())))'})\n lu.assertEquals(candidate('( ) (( )) (( )( ))'), {'()', '(())', '(()())'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "lua", - "prompt": "-- You will be given a string of words separated by commas or spaces. Your task is\n-- to split the string into words and return a table of the words.\n-- For example:\n-- >>> words_string('Hi, my name is John')\n-- {'Hi', 'my', 'name', 'is', 'John'}\n-- >>> words_string('One, two, three, four, five, six')\n-- {'One', 'two', 'three', 'four', 'five', 'six'}\nlocal function words_string(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = words_string\n lu.assertEquals(candidate('Hi, my name is John'), {'Hi', 'my', 'name', 'is', 'John'})\n lu.assertEquals(candidate('One, two, three, four, five, six'), {'One', 'two', 'three', 'four', 'five', 'six'})\n lu.assertEquals(candidate('Hi, my name'), {'Hi', 'my', 'name'})\n lu.assertEquals(candidate('One,, two, three, four, five, six,'), {'One', 'two', 'three', 'four', 'five', 'six'})\n lu.assertEquals(candidate(''), {})\n lu.assertEquals(candidate('ahmed , gamal'), {'ahmed', 'gamal'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "lua", - "prompt": "-- Create a function that takes integers, floats, or strings representing\n-- real numbers, and returns the larger variable in its given variable type.\n-- Return None if the values are equal.\n-- Note: If a real number is represented as a string, the floating point might be . or ,\n-- >>> compare_one(1, 2.5)\n-- 2.5\n-- >>> compare_one(1, '2,3')\n-- '2,3'\n-- >>> compare_one('5,1', '6')\n-- '6'\n-- >>> compare_one('1', 1)\n-- None\nlocal function compare_one(a, b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = compare_one\n lu.assertEquals(candidate(1, 2), 2)\n lu.assertEquals(candidate(1, 2.5), 2.5)\n lu.assertEquals(candidate(2, 3), 3)\n lu.assertEquals(candidate(5, 6), 6)\n lu.assertEquals(candidate(1, '2,3'), '2,3')\n lu.assertEquals(candidate('5,1', '6'), '6')\n lu.assertEquals(candidate('1', '2'), '2')\n lu.assertEquals(candidate('1', 1), None)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "lua", - "prompt": "-- Filter given table of any luathon values only for integers\n-- >>> filter_integers({'a', 3.14, 5})\n-- {5}\n-- >>> filter_integers({1, 2, 3, 'abc', {}, {}})\n-- {1, 2, 3}\nlocal function filter_integers(values)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = filter_integers\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({4, {}, {}, 23.2, 9, 'adasd'}), {4, 9})\n lu.assertEquals(candidate({3, 'c', 3, 3, 'a', 'b'}), {3, 3, 3})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "lua", - "prompt": "-- This function takes a table l and returns a table l' such that\n-- l' is identical to l in the odd indicies, while its values at the even indicies are equal\n-- to the values of the even indicies of l, but sorted.\n-- >>> sort_even({1, 2, 3})\n-- {1, 2, 3}\n-- >>> sort_even({5, 6, 3, 4})\n-- {3, 6, 5, 4}\nlocal function sort_even(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sort_even\n lu.assertEquals(candidate({1, 2, 3}), {1, 2, 3})\n lu.assertEquals(candidate({5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10}), {-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123})\n lu.assertEquals(candidate({5, 8, -12, 4, 23, 2, 3, 11, 12, -10}), {-12, 8, 3, 4, 5, 2, 12, 11, 23, -10})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "lua", - "prompt": "-- I think we all remember that feeling when the result of some long-awaited\n-- event is finally known. The feelings and thoughts you have at that moment are\n-- definitely worth noting down and comparing.\n-- Your task is to determine if a person correctly guessed the results of a number of matches.\n-- You are given two tables of scores and guesses of equal length, where each index shows a match. \n-- Return a table of the same length denoting how far off each guess was. If they have guessed correctly,\n-- the value is 0, and if not, the value is the absolute difference between the guess and the score.\n-- example:\n-- >>> compare({1, 2, 3, 4, 5, 1}, {1, 2, 3, 4, 2, -2})\n-- {0, 0, 0, 0, 3, 3}\n-- >>> compare({0, 5, 0, 0, 0, 4}, {4, 1, 1, 0, 0, -2})\n-- {4, 4, 1, 0, 0, 6}\nlocal function compare(game, guess)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = compare\n lu.assertEquals(candidate({1, 2, 3, 4, 5, 1}, {1, 2, 3, 4, 2, -2}), {0, 0, 0, 0, 3, 3})\n lu.assertEquals(candidate({0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}), {0, 0, 0, 0, 0, 0})\n lu.assertEquals(candidate({1, 2, 3}, {-1, -2, -3}), {2, 4, 6})\n lu.assertEquals(candidate({1, 2, 3, 5}, {-1, 2, 3, 4}), {2, 0, 0, 1})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "lua", - "prompt": "-- Given a positive integer n, return a table that has the number of even and odd\n-- integer palindromes that fall within the range(1, n), inclusive.\n-- Example 1:\n-- >>> even_odd_palindrome(3)\n-- {1, 2}\n-- Explanation:\n-- Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n-- Example 2:\n-- >>> even_odd_palindrome(12)\n-- {4, 6}\n-- Explanation:\n-- Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n-- Note:\n-- 1. 1 <= n <= 10^3\n-- 2. returned table has the number of even and odd integer palindromes respectively.\nlocal function even_odd_palindrome(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = even_odd_palindrome\n lu.assertEquals(candidate(123), {8, 13})\n lu.assertEquals(candidate(12), {4, 6})\n lu.assertEquals(candidate(3), {1, 2})\n lu.assertEquals(candidate(63), {6, 8})\n lu.assertEquals(candidate(25), {5, 6})\n lu.assertEquals(candidate(19), {4, 6})\n lu.assertEquals(candidate(9), {4, 5})\n lu.assertEquals(candidate(1), {0, 1})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "lua", - "prompt": "-- The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n-- fib4(0) -> 0\n-- fib4(1) -> 0\n-- fib4(2) -> 2\n-- fib4(3) -> 0\n-- fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n-- Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n-- >>> fib4(5)\n-- 4\n-- >>> fib4(6)\n-- 8\n-- >>> fib4(7)\n-- 14\nlocal function fib4(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = fib4\n lu.assertEquals(candidate(5), 4)\n lu.assertEquals(candidate(8), 28)\n lu.assertEquals(candidate(10), 104)\n lu.assertEquals(candidate(12), 386)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "lua", - "prompt": "-- Given two positive integers a and b, return the even digits between a\n-- and b, in ascending order.\n-- For example:\n-- >>> generate_integers(2, 8)\n-- {2, 4, 6, 8}\n-- >>> generate_integers(8, 2)\n-- {2, 4, 6, 8}\n-- >>> generate_integers(10, 14)\n-- {}\nlocal function generate_integers(a, b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = generate_integers\n lu.assertEquals(candidate(2, 10), {2, 4, 6, 8})\n lu.assertEquals(candidate(10, 2), {2, 4, 6, 8})\n lu.assertEquals(candidate(132, 2), {2, 4, 6, 8})\n lu.assertEquals(candidate(17, 89), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "lua", - "prompt": "-- For a given table of input numbers, calculate Mean Absolute Deviation\n-- around the mean of this dataset.\n-- Mean Absolute Deviation is the average absolute difference between each\n-- element and a centerpoint (mean in this case):\n-- MAD = average | x - x_mean |\n-- >>> mean_absolute_deviation({1.0, 2.0, 3.0, 4.0})\n-- 1.0\nlocal function mean_absolute_deviation(numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = mean_absolute_deviation\n lu.assertEquals(candidate({1.0, 2.0}), 0.5)\n lu.assertEquals(candidate({1.0, 2.0, 3.0, 4.0}), 1.0)\n lu.assertEquals(candidate({1.0, 2.0, 3.0, 4.0, 5.0}), 1.2)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "lua", - "prompt": "-- Create a function encrypt that takes a string as an argument and\n-- returns a string encrypted with the alphabet being rotated. \n-- The alphabet should be rotated in a manner such that the letters \n-- shift down by two multiplied to two places.\n-- For example:\n-- >>> encrypt('hi')\n-- 'lm'\n-- >>> encrypt('asdfghjkl')\n-- 'ewhjklnop'\n-- >>> encrypt('gf')\n-- 'kj'\n-- >>> encrypt('et')\n-- 'ix'\nlocal function encrypt(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = encrypt\n lu.assertEquals(candidate('hi'), 'lm')\n lu.assertEquals(candidate('asdfghjkl'), 'ewhjklnop')\n lu.assertEquals(candidate('gf'), 'kj')\n lu.assertEquals(candidate('et'), 'ix')\n lu.assertEquals(candidate('faewfawefaewg'), 'jeiajeaijeiak')\n lu.assertEquals(candidate('hellomyfriend'), 'lippsqcjvmirh')\n lu.assertEquals(candidate('dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh'), 'hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl')\n lu.assertEquals(candidate('a'), 'e')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "lua", - "prompt": "-- Given a positive integer n, return a sorted table that has the odd numbers in collatz sequence.\n-- The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n-- as follows: start with any positive integer n. Then each term is obtained from the \n-- previous term as follows: if the previous term is even, the next term is one half of \n-- the previous term. If the previous term is odd, the next term is 3 times the previous\n-- term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n-- Note: \n-- 1. Collatz(1) is [1].\n-- 2. returned table sorted in increasing order.\n-- For example:\n-- get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n-- >>> get_odd_collatz(5)\n-- {1, 5}\nlocal function get_odd_collatz(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = get_odd_collatz\n lu.assertEquals(candidate(14), {1, 5, 7, 11, 13, 17})\n lu.assertEquals(candidate(5), {1, 5})\n lu.assertEquals(candidate(12), {1, 3, 5})\n lu.assertEquals(candidate(1), {1})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "lua", - "prompt": "-- Find how many times a given substring can be found in the original string. Count overlaping cases.\n-- >>> how_many_times('', 'a')\n-- 0\n-- >>> how_many_times('aaa', 'a')\n-- 3\n-- >>> how_many_times('aaaa', 'aa')\n-- 3\nlocal function how_many_times(string, substring)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = how_many_times\n lu.assertEquals(candidate('', 'x'), 0)\n lu.assertEquals(candidate('xyxyxyx', 'x'), 4)\n lu.assertEquals(candidate('cacacacac', 'cac'), 4)\n lu.assertEquals(candidate('john doe', 'john'), 1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "lua", - "prompt": "-- We have a table 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n-- numbers in the table will be randomly ordered. Your task is to determine if\n-- it is possible to get a table sorted in non-decreasing order by performing \n-- the following operation on the given table:\n-- You are allowed to perform right shift operation any number of times.\n-- One right shift operation means shifting all elements of the table by one\n-- position in the right direction. The last element of the table will be moved to\n-- the starting position in the table i.e. 0th index. \n-- If it is possible to obtain the sorted table by performing the above operation\n-- then return true else return false.\n-- If the given table is empty then return true.\n-- Note: The given table is guaranteed to have unique elements.\n-- For Example:\n-- >>> move_one_ball({3, 4, 5, 1, 2})\n-- true\n-- Explanation: By performin 2 right shift operations, non-decreasing order can\n-- be achieved for the given table.\n-- >>> move_one_ball({3, 5, 4, 1, 2})\n-- false\n-- Explanation:It is not possible to get non-decreasing order for the given\n-- table by performing any number of right shift operations.\nlocal function move_one_ball(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = move_one_ball\n lu.assertEquals(candidate({3, 4, 5, 1, 2}), true)\n lu.assertEquals(candidate({3, 5, 10, 1, 2}), true)\n lu.assertEquals(candidate({4, 3, 1, 2}), false)\n lu.assertEquals(candidate({3, 5, 4, 1, 2}), false)\n lu.assertEquals(candidate({}), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "lua", - "prompt": "-- Write a function which sorts the given table of integers\n-- in ascending order according to the sum of their digits.\n-- Note: if there are several items with similar sum of their digits,\n-- order them based on their index in original table.\n-- For example:\n-- >>> order_by_points({1, 11, -1, -11, -12})\n-- {-1, -11, 1, -12, 11}\n-- >>> order_by_points({})\n-- {}\nlocal function order_by_points(nums)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = order_by_points\n lu.assertEquals(candidate({1, 11, -1, -11, -12}), {-1, -11, 1, -12, 11})\n lu.assertEquals(candidate({1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46}), {0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457})\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({1, -11, -32, 43, 54, -98, 2, -3}), {-3, -32, -98, -11, 1, 2, 43, 54})\n lu.assertEquals(candidate({1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}), {1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9})\n lu.assertEquals(candidate({0, 6, 6, -76, -21, 23, 4}), {-76, -21, 0, 4, 23, 6, 6})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "lua", - "prompt": "-- Return table of prime factors of given integer in the order from smallest to largest.\n-- Each of the factors should be tableed number of times corresponding to how many times it appeares in factorization.\n-- Input number should be equal to the product of all factors\n-- >>> factorize(8)\n-- {2, 2, 2}\n-- >>> factorize(25)\n-- {5, 5}\n-- >>> factorize(70)\n-- {2, 5, 7}\nlocal function factorize(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = factorize\n lu.assertEquals(candidate(2), {2})\n lu.assertEquals(candidate(4), {2, 2})\n lu.assertEquals(candidate(8), {2, 2, 2})\n lu.assertEquals(candidate(57), {3, 19})\n lu.assertEquals(candidate(3249), {3, 3, 19, 19})\n lu.assertEquals(candidate(185193), {3, 3, 3, 19, 19, 19})\n lu.assertEquals(candidate(20577), {3, 19, 19, 19})\n lu.assertEquals(candidate(18), {2, 3, 3})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "lua", - "prompt": "-- Return true if all numbers in the table l are below threshold t.\n-- >>> below_threshold({1, 2, 4, 10}, 100)\n-- true\n-- >>> below_threshold({1, 20, 4, 10}, 5)\n-- false\nlocal function below_threshold(l, t)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = below_threshold\n lu.assertEquals(candidate({1, 2, 4, 10}, 100), true)\n lu.assertEquals(candidate({1, 20, 4, 10}, 5), false)\n lu.assertEquals(candidate({1, 20, 4, 10}, 21), true)\n lu.assertEquals(candidate({1, 20, 4, 10}, 22), true)\n lu.assertEquals(candidate({1, 8, 4, 10}, 11), true)\n lu.assertEquals(candidate({1, 8, 4, 10}, 10), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "lua", - "prompt": "-- You are given two positive integers n and m, and your task is to compute the\n-- average of the integers from n through m (including n and m). \n-- Round the answer to the nearest integer and convert that to binary.\n-- If n is greater than m, return -1.\n-- Example:\n-- >>> rounded_avg(1, 5)\n-- '0b11'\n-- >>> rounded_avg(7, 5)\n-- -1\n-- >>> rounded_avg(10, 20)\n-- '0b1111'\n-- >>> rounded_avg(20, 33)\n-- '0b11010'\nlocal function rounded_avg(n, m)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = rounded_avg\n lu.assertEquals(candidate(1, 5), '0b11')\n lu.assertEquals(candidate(7, 13), '0b1010')\n lu.assertEquals(candidate(964, 977), '0b1111001010')\n lu.assertEquals(candidate(996, 997), '0b1111100100')\n lu.assertEquals(candidate(560, 851), '0b1011000010')\n lu.assertEquals(candidate(185, 546), '0b101101110')\n lu.assertEquals(candidate(362, 496), '0b110101101')\n lu.assertEquals(candidate(350, 902), '0b1001110010')\n lu.assertEquals(candidate(197, 233), '0b11010111')\n lu.assertEquals(candidate(7, 5), -1)\n lu.assertEquals(candidate(5, 1), -1)\n lu.assertEquals(candidate(5, 5), '0b101')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "lua", - "prompt": "-- Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n-- For each of the group, output the deepest level of nesting of parentheses.\n-- E.g. (()()) has maximum two levels of nesting while ((())) has three.\n-- >>> parse_nested_parens('(()()) ((())) () ((())()())')\n-- {2, 3, 1, 3}\nlocal function parse_nested_parens(paren_string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = parse_nested_parens\n lu.assertEquals(candidate('(()()) ((())) () ((())()())'), {2, 3, 1, 3})\n lu.assertEquals(candidate('() (()) ((())) (((())))'), {1, 2, 3, 4})\n lu.assertEquals(candidate('(()(())((())))'), {4})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "lua", - "prompt": "-- Given a non-empty table of integers, return the sum of all of the odd elements that are in even positions.\n-- Examples\n-- >>> solution({5, 8, 7, 1})\n-- 12\n-- >>> solution({3, 3, 3, 3, 3})\n-- 9\n-- >>> solution({30, 13, 24, 321})\n-- 0\nlocal function solution(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = solution\n lu.assertEquals(candidate({5, 8, 7, 1}), 12)\n lu.assertEquals(candidate({3, 3, 3, 3, 3}), 9)\n lu.assertEquals(candidate({30, 13, 24, 321}), 0)\n lu.assertEquals(candidate({5, 9}), 5)\n lu.assertEquals(candidate({2, 4, 8}), 0)\n lu.assertEquals(candidate({30, 13, 23, 32}), 23)\n lu.assertEquals(candidate({3, 13, 2, 9}), 3)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "lua", - "prompt": "-- You are given a positive integer n. You have to create an integer table a of length n.\n-- For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n-- Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n-- and a[i] + a[j] + a[k] is a multiple of 3.\n-- Example :\n-- >>> get_max_triples(5)\n-- 1\n-- Explanation: \n-- a = [1, 3, 7, 13, 21]\n-- The only valid triple is (1, 7, 13).\nlocal function get_max_triples(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = get_max_triples\n lu.assertEquals(candidate(5), 1)\n lu.assertEquals(candidate(6), 4)\n lu.assertEquals(candidate(10), 36)\n lu.assertEquals(candidate(100), 53361)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "lua", - "prompt": "-- There are eight planets in our solar system: the closerst to the Sun \n-- is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n-- Uranus, Neptune.\n-- Write a function that takes two planet names as strings planet1 and planet2. \n-- The function should return a table containing all planets whose orbits are \n-- located between the orbit of planet1 and the orbit of planet2, sorted by \n-- the proximity to the sun. \n-- The function should return an empty table if planet1 or planet2\n-- are not correct planet names. \n-- Examples\n-- >>> bf('Jupiter', 'Neptune')\n-- {'Saturn', 'Uranus'}\n-- >>> bf('Earth', 'Mercury')\n-- 'Venus'\n-- >>> bf('Mercury', 'Uranus')\n-- {'Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn'}\nlocal function bf(planet1, planet2)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = bf\n lu.assertEquals(candidate('Jupiter', 'Neptune'), {'Saturn', 'Uranus'})\n lu.assertEquals(candidate('Earth', 'Mercury'), {'Venus'})\n lu.assertEquals(candidate('Mercury', 'Uranus'), {'Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn'})\n lu.assertEquals(candidate('Neptune', 'Venus'), {'Earth', 'Mars', 'Jupiter', 'Saturn', 'Uranus'})\n lu.assertEquals(candidate('Earth', 'Earth'), {})\n lu.assertEquals(candidate('Mars', 'Earth'), {})\n lu.assertEquals(candidate('Jupiter', 'Makemake'), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "lua", - "prompt": "-- You are given a table of integers.\n-- Write a function next_smallest() that returns the 2nd smallest element of the table.\n-- Return None if there is no such element.\n-- >>> next_smallest({1, 2, 3, 4, 5})\n-- 2\n-- >>> next_smallest({5, 1, 4, 3, 2})\n-- 2\n-- >>> next_smallest({})\n-- None\n-- >>> next_smallest({1, 1})\n-- None\nlocal function next_smallest(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = next_smallest\n lu.assertEquals(candidate({1, 2, 3, 4, 5}), 2)\n lu.assertEquals(candidate({5, 1, 4, 3, 2}), 2)\n lu.assertEquals(candidate({}), None)\n lu.assertEquals(candidate({1, 1}), None)\n lu.assertEquals(candidate({1, 1, 1, 1, 0}), 1)\n lu.assertEquals(candidate({1, 1}), None)\n lu.assertEquals(candidate({-35, 34, 12, -45}), -35)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "lua", - "prompt": "-- Input is a space-delimited string of numberals from 'zero' to 'nine'.\n-- Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n-- Return the string with numbers sorted from smallest to largest\n-- >>> sort_numbers('three one five')\n-- 'one three five'\nlocal function sort_numbers(numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sort_numbers\n lu.assertEquals(candidate(''), '')\n lu.assertEquals(candidate('three'), 'three')\n lu.assertEquals(candidate('three five nine'), 'three five nine')\n lu.assertEquals(candidate('five zero four seven nine eight'), 'zero four five seven eight nine')\n lu.assertEquals(candidate('six five four three two one zero'), 'zero one two three four five six')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "lua", - "prompt": "-- You are given 2 words. You need to return true if the second word or any of its rotations is a substring in the first word\n-- >>> cycpattern_check('abcd', 'abd')\n-- false\n-- >>> cycpattern_check('hello', 'ell')\n-- true\n-- >>> cycpattern_check('whassup', 'psus')\n-- false\n-- >>> cycpattern_check('abab', 'baa')\n-- true\n-- >>> cycpattern_check('efef', 'eeff')\n-- false\n-- >>> cycpattern_check('himenss', 'simen')\n-- true\nlocal function cycpattern_check(a, b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = cycpattern_check\n lu.assertEquals(candidate('xyzw', 'xyw'), false)\n lu.assertEquals(candidate('yello', 'ell'), true)\n lu.assertEquals(candidate('whattup', 'ptut'), false)\n lu.assertEquals(candidate('efef', 'fee'), true)\n lu.assertEquals(candidate('abab', 'aabb'), false)\n lu.assertEquals(candidate('winemtt', 'tinem'), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "lua", - "prompt": "-- You will be given a number in decimal form and your task is to convert it to\n-- binary format. The function should return a string, with each character representing a binary\n-- number. Each character in the string will be '0' or '1'.\n-- There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n-- The extra characters are there to help with the format.\n-- Examples:\n-- >>> decimal_to_binary(15)\n-- 'db1111db'\n-- >>> decimal_to_binary(32)\n-- 'db100000db'\nlocal function decimal_to_binary(decimal)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = decimal_to_binary\n lu.assertEquals(candidate(0), 'db0db')\n lu.assertEquals(candidate(32), 'db100000db')\n lu.assertEquals(candidate(103), 'db1100111db')\n lu.assertEquals(candidate(15), 'db1111db')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "lua", - "prompt": "-- Filter an input table of strings only for ones that contain given substring\n-- >>> filter_by_substring({}, 'a')\n-- {}\n-- >>> filter_by_substring({'abc', 'bacd', 'cde', 'array'}, 'a')\n-- {'abc', 'bacd', 'array'}\nlocal function filter_by_substring(strings, substring)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = filter_by_substring\n lu.assertEquals(candidate({}, 'john'), {})\n lu.assertEquals(candidate({'xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'}, 'xxx'), {'xxx', 'xxxAAA', 'xxx'})\n lu.assertEquals(candidate({'xxx', 'asd', 'aaaxxy', 'john doe', 'xxxAAA', 'xxx'}, 'xx'), {'xxx', 'aaaxxy', 'xxxAAA', 'xxx'})\n lu.assertEquals(candidate({'grunt', 'trumpet', 'prune', 'gruesome'}, 'run'), {'grunt', 'prune'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "lua", - "prompt": "-- Given an integer. return a table that has the number of even and odd digits respectively.\n-- Example:\n-- >>> even_odd_count(-12)\n-- {1, 1}\n-- >>> even_odd_count(123)\n-- {1, 2}\nlocal function even_odd_count(num)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = even_odd_count\n lu.assertEquals(candidate(7), {0, 1})\n lu.assertEquals(candidate(-78), {1, 1})\n lu.assertEquals(candidate(3452), {2, 2})\n lu.assertEquals(candidate(346211), {3, 3})\n lu.assertEquals(candidate(-345821), {3, 3})\n lu.assertEquals(candidate(-2), {1, 0})\n lu.assertEquals(candidate(-45347), {2, 3})\n lu.assertEquals(candidate(0), {1, 0})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "lua", - "prompt": "-- Write a function that accepts a table of strings.\n-- The table contains different words. Return the word with maximum number\n-- of unique characters. If multiple strings have maximum number of unique\n-- characters, return the one which comes first in lexicographical order.\n-- >>> find_max({'name', 'of', 'string'})\n-- 'string'\n-- >>> find_max({'name', 'enam', 'game'})\n-- 'enam'\n-- >>> find_max({'aaaaaaa', 'bb', 'cc'})\n-- 'aaaaaaa'\nlocal function find_max(words)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = find_max\n lu.assertEquals(candidate({'name', 'of', 'string'}), 'string')\n lu.assertEquals(candidate({'name', 'enam', 'game'}), 'enam')\n lu.assertEquals(candidate({'aaaaaaa', 'bb', 'cc'}), 'aaaaaaa')\n lu.assertEquals(candidate({'abc', 'cba'}), 'abc')\n lu.assertEquals(candidate({'play', 'this', 'game', 'of', 'footbott'}), 'footbott')\n lu.assertEquals(candidate({'we', 'are', 'gonna', 'rock'}), 'gonna')\n lu.assertEquals(candidate({'we', 'are', 'a', 'mad', 'nation'}), 'nation')\n lu.assertEquals(candidate({'this', 'is', 'a', 'prrk'}), 'this')\n lu.assertEquals(candidate({'b'}), 'b')\n lu.assertEquals(candidate({'play', 'play', 'play'}), 'play')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "lua", - "prompt": "-- Given a positive integer n, return the count of the numbers of n-digit\n-- positive integers that start or end with 1.\nlocal function starts_one_ends(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = starts_one_ends\n lu.assertEquals(candidate(1), 1)\n lu.assertEquals(candidate(2), 18)\n lu.assertEquals(candidate(3), 180)\n lu.assertEquals(candidate(4), 1800)\n lu.assertEquals(candidate(5), 18000)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "lua", - "prompt": "-- Create a function that returns a table (a, b), where 'a' is\n-- the largest of negative integers, and 'b' is the smallest\n-- of positive integers in a table.\n-- If there is no negative or positive integers, return them as None.\n-- Examples:\n-- >>> largest_smallest_integers({2, 4, 1, 3, 5, 7})\n-- {None, 1}\n-- >>> largest_smallest_integers({})\n-- {None, None}\n-- >>> largest_smallest_integers({0})\n-- {None, None}\nlocal function largest_smallest_integers(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = largest_smallest_integers\n lu.assertEquals(candidate({2, 4, 1, 3, 5, 7}), {None, 1})\n lu.assertEquals(candidate({2, 4, 1, 3, 5, 7, 0}), {None, 1})\n lu.assertEquals(candidate({1, 3, 2, 4, 5, 6, -2}), {-2, 1})\n lu.assertEquals(candidate({4, 5, 3, 6, 2, 7, -7}), {-7, 2})\n lu.assertEquals(candidate({7, 3, 8, 4, 9, 2, 5, -9}), {-9, 2})\n lu.assertEquals(candidate({}), {None, None})\n lu.assertEquals(candidate({0}), {None, None})\n lu.assertEquals(candidate({-1, -3, -5, -6}), {-1, None})\n lu.assertEquals(candidate({-1, -3, -5, -6, 0}), {-1, None})\n lu.assertEquals(candidate({-6, -4, -4, -3, 1}), {-3, 1})\n lu.assertEquals(candidate({-6, -4, -4, -3, -100, 1}), {-3, 1})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "lua", - "prompt": "-- \"Given a table representing a branch of a tree that has non-negative integer nodes\n-- your task is to pluck one of the nodes and return it.\n-- The plucked node should be the node with the smallest even value.\n-- If multiple nodes with the same smallest even value are found return the node that has smallest index.\n-- The plucked node should be returned in a table, [ smalest_value, its index ],\n-- If there are no even values or the given table is empty, return [].\n-- Example 1:\n-- >>> pluck({4, 2, 3})\n-- {2, 1}\n-- Explanation: 2 has the smallest even value, and 2 has the smallest index.\n-- Example 2:\n-- >>> pluck({1, 2, 3})\n-- {2, 1}\n-- Explanation: 2 has the smallest even value, and 2 has the smallest index.\n-- Example 3:\n-- >>> pluck({})\n-- {}\n-- Example 4:\n-- >>> pluck({5, 0, 3, 0, 4, 2})\n-- {0, 1}\n-- Explanation: 0 is the smallest value, but there are two zeros,\n-- so we will choose the first zero, which has the smallest index.\n-- Constraints:\n-- * 1 <= nodes.length <= 10000\n-- * 0 <= node.value\nlocal function pluck(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = pluck\n lu.assertEquals(candidate({4, 2, 3}), {2, 1})\n lu.assertEquals(candidate({1, 2, 3}), {2, 1})\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({5, 0, 3, 0, 4, 2}), {0, 1})\n lu.assertEquals(candidate({1, 2, 3, 0, 5, 3}), {0, 3})\n lu.assertEquals(candidate({5, 4, 8, 4, 8}), {4, 1})\n lu.assertEquals(candidate({7, 6, 7, 1}), {6, 1})\n lu.assertEquals(candidate({7, 9, 7, 1}), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "lua", - "prompt": "-- Write a function count_nums which takes a table of integers and returns\n-- the number of elements which has a sum of digits > 0.\n-- If a number is negative, then its first signed digit will be negative:\n-- e.g. -123 has signed digits -1, 2, and 3.\n-- >>> count_nums({})\n-- 0\n-- >>> count_nums({-1, 11, -11})\n-- 1\n-- >>> count_nums({1, 1, 2})\n-- 3\nlocal function count_nums(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = count_nums\n lu.assertEquals(candidate({}), 0)\n lu.assertEquals(candidate({-1, -2, 0}), 0)\n lu.assertEquals(candidate({1, 1, 2, -2, 3, 4, 5}), 6)\n lu.assertEquals(candidate({1, 6, 9, -6, 0, 1, 5}), 5)\n lu.assertEquals(candidate({1, 100, 98, -7, 1, -1}), 4)\n lu.assertEquals(candidate({12, 23, 34, -45, -56, 0}), 5)\n lu.assertEquals(candidate({0, 1}), 1)\n lu.assertEquals(candidate({1}), 1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "lua", - "prompt": "-- Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n-- each cell of the grid contains a value. Every integer in the range [1, N * N]\n-- inclusive appears exactly once on the cells of the grid.\n-- You have to find the minimum path of length k in the grid. You can start\n-- from any cell, and in each step you can move to any of the neighbor cells,\n-- in other words, you can go to cells which share an edge with you current\n-- cell.\n-- Please note that a path of length k means visiting exactly k cells (not\n-- necessarily distinct).\n-- You CANNOT go off the grid.\n-- A path A (of length k) is considered less than a path B (of length k) if\n-- after making the ordered tables of the values on the cells that A and B go\n-- through (let's call them lst_A and lst_B), lst_A is lexicographically less\n-- than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n-- such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n-- lst_A[j] = lst_B[j].\n-- It is guaranteed that the answer is unique.\n-- Return an ordered table of the values on the cells that the minimum path go through.\n-- Examples: \n-- >>> minPath({{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}, 3)\n-- {1, 2, 1}\n-- >>> minPath({{5, 9, 3}, {4, 1, 6}, {7, 8, 2}}, 1)\n-- {1}\nlocal function minPath(grid, k)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = minPath\n lu.assertEquals(candidate({{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}, 3), {1, 2, 1})\n lu.assertEquals(candidate({{5, 9, 3}, {4, 1, 6}, {7, 8, 2}}, 1), {1})\n lu.assertEquals(candidate({{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}, {13, 14, 15, 16}}, 4), {1, 2, 1, 2})\n lu.assertEquals(candidate({{6, 4, 13, 10}, {5, 7, 12, 1}, {3, 16, 11, 15}, {8, 14, 9, 2}}, 7), {1, 10, 1, 10, 1, 10, 1})\n lu.assertEquals(candidate({{8, 14, 9, 2}, {6, 4, 13, 15}, {5, 7, 1, 12}, {3, 10, 11, 16}}, 5), {1, 7, 1, 7, 1})\n lu.assertEquals(candidate({{11, 8, 7, 2}, {5, 16, 14, 4}, {9, 3, 15, 6}, {12, 13, 10, 1}}, 9), {1, 6, 1, 6, 1, 6, 1, 6, 1})\n lu.assertEquals(candidate({{12, 13, 10, 1}, {9, 3, 15, 6}, {5, 16, 14, 4}, {11, 8, 7, 2}}, 12), {1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6})\n lu.assertEquals(candidate({{2, 7, 4}, {3, 1, 5}, {6, 8, 9}}, 8), {1, 3, 1, 3, 1, 3, 1, 3})\n lu.assertEquals(candidate({{6, 1, 5}, {3, 8, 9}, {2, 7, 4}}, 8), {1, 5, 1, 5, 1, 5, 1, 5})\n lu.assertEquals(candidate({{1, 2}, {3, 4}}, 10), {1, 2, 1, 2, 1, 2, 1, 2, 1, 2})\n lu.assertEquals(candidate({{1, 3}, {3, 2}}, 10), {1, 3, 1, 3, 1, 3, 1, 3, 1, 3})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "lua", - "prompt": "-- Given table of integers, return table in strange order.\n-- Strange sorting, is when you start with the minimum value,\n-- then maximum of the remaining integers, then minimum and so on.\n-- Examples:\n-- >>> strange_sort_list({1, 2, 3, 4})\n-- {1, 4, 2, 3}\n-- >>> strange_sort_list({5, 5, 5, 5})\n-- {5, 5, 5, 5}\n-- >>> strange_sort_list({})\n-- {}\nlocal function strange_sort_list(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = strange_sort_list\n lu.assertEquals(candidate({1, 2, 3, 4}), {1, 4, 2, 3})\n lu.assertEquals(candidate({5, 6, 7, 8, 9}), {5, 9, 6, 8, 7})\n lu.assertEquals(candidate({1, 2, 3, 4, 5}), {1, 5, 2, 4, 3})\n lu.assertEquals(candidate({5, 6, 7, 8, 9, 1}), {1, 9, 5, 8, 6, 7})\n lu.assertEquals(candidate({5, 5, 5, 5}), {5, 5, 5, 5})\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({1, 2, 3, 4, 5, 6, 7, 8}), {1, 8, 2, 7, 3, 6, 4, 5})\n lu.assertEquals(candidate({0, 2, 2, 2, 5, 5, -5, -5}), {-5, 5, -5, 5, 0, 2, 2, 2})\n lu.assertEquals(candidate({111111}), {111111})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "lua", - "prompt": "-- Given a string 'text', return its md5 hash equivalent string.\n-- If 'text' is an empty string, return None.\n-- >>> string_to_md5('Hello world')\n-- '3e25960a79dbc69b674cd4ec67a72c62'\nlocal function string_to_md5(text)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = string_to_md5\n lu.assertEquals(candidate('Hello world'), '3e25960a79dbc69b674cd4ec67a72c62')\n lu.assertEquals(candidate(''), None)\n lu.assertEquals(candidate('A B C'), '0ef78513b0cb8cef12743f5aeb35f888')\n lu.assertEquals(candidate('password'), '5f4dcc3b5aa765d61d8327deb882cf99')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "lua", - "prompt": "-- You are given a word. Your task is to find the closest vowel that stands between \n-- two consonants from the right side of the word (case sensitive).\n-- Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n-- find any vowel met the above condition. \n-- You may assume that the given string contains English letter only.\n-- Example:\n-- >>> get_closest_vowel('yogurt')\n-- 'u'\n-- >>> get_closest_vowel('FULL')\n-- 'U'\n-- >>> get_closest_vowel('quick')\n-- ''\n-- >>> get_closest_vowel('ab')\n-- ''\nlocal function get_closest_vowel(word)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = get_closest_vowel\n lu.assertEquals(candidate('yogurt'), 'u')\n lu.assertEquals(candidate('full'), 'u')\n lu.assertEquals(candidate('easy'), '')\n lu.assertEquals(candidate('eAsy'), '')\n lu.assertEquals(candidate('ali'), '')\n lu.assertEquals(candidate('bad'), 'a')\n lu.assertEquals(candidate('most'), 'o')\n lu.assertEquals(candidate('ab'), '')\n lu.assertEquals(candidate('ba'), '')\n lu.assertEquals(candidate('quick'), '')\n lu.assertEquals(candidate('anime'), 'i')\n lu.assertEquals(candidate('Asia'), '')\n lu.assertEquals(candidate('Above'), 'o')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "lua", - "prompt": "-- Change numerical base of input number x to base.\n-- return string representation after the conversion.\n-- base numbers are less than 10.\n-- >>> change_base(8, 3)\n-- '22'\n-- >>> change_base(8, 2)\n-- '1000'\n-- >>> change_base(7, 2)\n-- '111'\nlocal function change_base(x, base)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = change_base\n lu.assertEquals(candidate(8, 3), '22')\n lu.assertEquals(candidate(9, 3), '100')\n lu.assertEquals(candidate(234, 2), '11101010')\n lu.assertEquals(candidate(16, 2), '10000')\n lu.assertEquals(candidate(8, 2), '1000')\n lu.assertEquals(candidate(7, 2), '111')\n lu.assertEquals(candidate(2, 3), '2')\n lu.assertEquals(candidate(3, 4), '3')\n lu.assertEquals(candidate(4, 5), '4')\n lu.assertEquals(candidate(5, 6), '5')\n lu.assertEquals(candidate(6, 7), '6')\n lu.assertEquals(candidate(7, 8), '7')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "lua", - "prompt": "-- Check if in given table of numbers, are any two numbers closer to each other than\n-- given threshold.\n-- >>> has_close_elements({1.0, 2.0, 3.0}, 0.5)\n-- false\n-- >>> has_close_elements({1.0, 2.8, 3.0, 4.0, 5.0, 2.0}, 0.3)\n-- true\nlocal function has_close_elements(numbers, threshold)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = has_close_elements\n lu.assertEquals(candidate({1.0, 2.0, 3.9, 4.0, 5.0, 2.2}, 0.3), true)\n lu.assertEquals(candidate({1.0, 2.0, 3.9, 4.0, 5.0, 2.2}, 0.05), false)\n lu.assertEquals(candidate({1.0, 2.0, 5.9, 4.0, 5.0}, 0.95), true)\n lu.assertEquals(candidate({1.0, 2.0, 5.9, 4.0, 5.0}, 0.8), false)\n lu.assertEquals(candidate({1.0, 2.0, 3.0, 4.0, 5.0, 2.0}, 0.1), true)\n lu.assertEquals(candidate({1.1, 2.2, 3.1, 4.1, 5.1}, 1.0), true)\n lu.assertEquals(candidate({1.1, 2.2, 3.1, 4.1, 5.1}, 0.5), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "lua", - "prompt": "-- Create a function that takes a string as input which contains only square brackets.\n-- The function should return true if and only if there is a valid subsequence of brackets \n-- where at least one bracket in the subsequence is nested.\n-- >>> is_nested('[[]]')\n-- true\n-- >>> is_nested('[]]]]]]][[[[[]')\n-- false\n-- >>> is_nested('[][]')\n-- false\n-- >>> is_nested('[]')\n-- false\n-- >>> is_nested('[[][]]')\n-- true\n-- >>> is_nested('[[]][[')\n-- true\nlocal function is_nested(string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_nested\n lu.assertEquals(candidate('[[]]'), true)\n lu.assertEquals(candidate('[]]]]]]][[[[[]'), false)\n lu.assertEquals(candidate('[][]'), false)\n lu.assertEquals(candidate('[]'), false)\n lu.assertEquals(candidate('[[[[]]]]'), true)\n lu.assertEquals(candidate('[]]]]]]]]]]'), false)\n lu.assertEquals(candidate('[][][[]]'), true)\n lu.assertEquals(candidate('[[]'), false)\n lu.assertEquals(candidate('[]]'), false)\n lu.assertEquals(candidate('[[]][['), true)\n lu.assertEquals(candidate('[[][]]'), true)\n lu.assertEquals(candidate(''), false)\n lu.assertEquals(candidate('[[[[[[[['), false)\n lu.assertEquals(candidate(']]]]]]]]'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "lua", - "prompt": "-- Concatenate table of strings into a single string\n-- >>> concatenate({})\n-- ''\n-- >>> concatenate({'a', 'b', 'c'})\n-- 'abc'\nlocal function concatenate(strings)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = concatenate\n lu.assertEquals(candidate({}), '')\n lu.assertEquals(candidate({'x', 'y', 'z'}), 'xyz')\n lu.assertEquals(candidate({'x', 'y', 'z', 'w', 'k'}), 'xyzwk')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "lua", - "prompt": "-- prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n-- >>> prime_fib(1)\n-- 2\n-- >>> prime_fib(2)\n-- 3\n-- >>> prime_fib(3)\n-- 5\n-- >>> prime_fib(4)\n-- 13\n-- >>> prime_fib(5)\n-- 89\nlocal function prime_fib(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = prime_fib\n lu.assertEquals(candidate(1), 2)\n lu.assertEquals(candidate(2), 3)\n lu.assertEquals(candidate(3), 5)\n lu.assertEquals(candidate(4), 13)\n lu.assertEquals(candidate(5), 89)\n lu.assertEquals(candidate(6), 233)\n lu.assertEquals(candidate(7), 1597)\n lu.assertEquals(candidate(8), 28657)\n lu.assertEquals(candidate(9), 514229)\n lu.assertEquals(candidate(10), 433494437)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "lua", - "prompt": "-- From a supplied table of numbers (of length at least two) select and return two that are the closest to each\n-- other and return them in order (smaller number, larger number).\n-- >>> find_closest_elements({1.0, 2.0, 3.0, 4.0, 5.0, 2.2})\n-- {2.0, 2.2}\n-- >>> find_closest_elements({1.0, 2.0, 3.0, 4.0, 5.0, 2.0})\n-- {2.0, 2.0}\nlocal function find_closest_elements(numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = find_closest_elements\n lu.assertEquals(candidate({1.0, 2.0, 3.9, 4.0, 5.0, 2.2}), {3.9, 4.0})\n lu.assertEquals(candidate({1.0, 2.0, 5.9, 4.0, 5.0}), {5.0, 5.9})\n lu.assertEquals(candidate({1.0, 2.0, 3.0, 4.0, 5.0, 2.2}), {2.0, 2.2})\n lu.assertEquals(candidate({1.0, 2.0, 3.0, 4.0, 5.0, 2.0}), {2.0, 2.0})\n lu.assertEquals(candidate({1.1, 2.2, 3.1, 4.1, 5.1}), {2.2, 3.1})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "lua", - "prompt": "-- You have been tasked to write a function that receives \n-- a hexadecimal number as a string and counts the number of hexadecimal \n-- digits that are primes (prime number, or a prime, is a natural number \n-- greater than 1 that is not a product of two smaller natural numbers).\n-- Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n-- Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n-- So you have to determine a number of the following digits: 2, 3, 5, 7, \n-- B (=decimal 11), D (=decimal 13).\n-- Note: you may assume the input is always correct or empty string, \n-- and symbols A,B,C,D,E,F are always uppercase.\n-- Examples:\n-- >>> hex_key('AB')\n-- 1\n-- >>> hex_key('1077E')\n-- 2\n-- >>> hex_key('ABED1A33')\n-- 4\n-- >>> hex_key('123456789ABCDEF0')\n-- 6\n-- >>> hex_key('2020')\n-- 2\nlocal function hex_key(num)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = hex_key\n lu.assertEquals(candidate('AB'), 1)\n lu.assertEquals(candidate('1077E'), 2)\n lu.assertEquals(candidate('ABED1A33'), 4)\n lu.assertEquals(candidate('2020'), 2)\n lu.assertEquals(candidate('123456789ABCDEF0'), 6)\n lu.assertEquals(candidate('112233445566778899AABBCCDDEEFF00'), 12)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "lua", - "prompt": "-- Complete the function that takes two integers and returns \n-- the product of their unit digits.\n-- Assume the input is always valid.\n-- Examples:\n-- >>> multiply(148, 412)\n-- 16\n-- >>> multiply(19, 28)\n-- 72\n-- >>> multiply(2020, 1851)\n-- 0\n-- >>> multiply(14, -15)\n-- 20\nlocal function multiply(a, b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = multiply\n lu.assertEquals(candidate(148, 412), 16)\n lu.assertEquals(candidate(19, 28), 72)\n lu.assertEquals(candidate(2020, 1851), 0)\n lu.assertEquals(candidate(14, -15), 20)\n lu.assertEquals(candidate(76, 67), 42)\n lu.assertEquals(candidate(17, 27), 49)\n lu.assertEquals(candidate(0, 1), 0)\n lu.assertEquals(candidate(0, 0), 0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "lua", - "prompt": "-- Given table of numbers (of at least two elements), apply a linear transform to that table,\n-- such that the smallest number will become 0 and the largest will become 1\n-- >>> rescale_to_unit({1.0, 2.0, 3.0, 4.0, 5.0})\n-- {0.0, 0.25, 0.5, 0.75, 1.0}\nlocal function rescale_to_unit(numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = rescale_to_unit\n lu.assertEquals(candidate({2.0, 49.9}), {0.0, 1.0})\n lu.assertEquals(candidate({100.0, 49.9}), {1.0, 0.0})\n lu.assertEquals(candidate({1.0, 2.0, 3.0, 4.0, 5.0}), {0.0, 0.25, 0.5, 0.75, 1.0})\n lu.assertEquals(candidate({2.0, 1.0, 5.0, 3.0, 4.0}), {0.25, 0.0, 1.0, 0.5, 0.75})\n lu.assertEquals(candidate({12.0, 11.0, 15.0, 13.0, 14.0}), {0.25, 0.0, 1.0, 0.5, 0.75})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "lua", - "prompt": "-- Given a positive integer n, return the product of the odd digits.\n-- Return 0 if all digits are even.\n-- For example:\n-- >>> digits(1)\n-- 1\n-- >>> digits(4)\n-- 0\n-- >>> digits(235)\n-- 15\nlocal function digits(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = digits\n lu.assertEquals(candidate(5), 5)\n lu.assertEquals(candidate(54), 5)\n lu.assertEquals(candidate(120), 1)\n lu.assertEquals(candidate(5014), 5)\n lu.assertEquals(candidate(98765), 315)\n lu.assertEquals(candidate(5576543), 2625)\n lu.assertEquals(candidate(2468), 0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "lua", - "prompt": "-- You will be given the name of a class (a string) and a table of extensions.\n-- The extensions are to be used to load additional classes to the class. The\n-- strength of the extension is as follows: Let CAP be the number of the uppercase\n-- letters in the extension's name, and let SM be the number of lowercase letters \n-- in the extension's name, the strength is given by the fraction CAP - SM. \n-- You should find the strongest extension and return a string in this \n-- format: ClassName.StrongestExtensionName.\n-- If there are two or more extensions with the same strength, you should\n-- choose the one that comes first in the table.\n-- For example, if you are given \"Slices\" as the class and a table of the\n-- extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n-- return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n-- (its strength is -1).\n-- Example:\n-- >>> Strongest_Extension('my_class', {'AA', 'Be', 'CC'})\n-- 'my_class.AA'\nlocal function Strongest_Extension(class_name, extensions)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = Strongest_Extension\n lu.assertEquals(candidate('Watashi', {'tEN', 'niNE', 'eIGHt8OKe'}), 'Watashi.eIGHt8OKe')\n lu.assertEquals(candidate('Boku123', {'nani', 'NazeDa', 'YEs.WeCaNe', '32145tggg'}), 'Boku123.YEs.WeCaNe')\n lu.assertEquals(candidate('__YESIMHERE', {'t', 'eMptY', 'nothing', 'zeR00', 'NuLl__', '123NoooneB321'}), '__YESIMHERE.NuLl__')\n lu.assertEquals(candidate('K', {'Ta', 'TAR', 't234An', 'cosSo'}), 'K.TAR')\n lu.assertEquals(candidate('__HAHA', {'Tab', '123', '781345', '-_-'}), '__HAHA.123')\n lu.assertEquals(candidate('YameRore', {'HhAas', 'okIWILL123', 'WorkOut', 'Fails', '-_-'}), 'YameRore.okIWILL123')\n lu.assertEquals(candidate('finNNalLLly', {'Die', 'NowW', 'Wow', 'WoW'}), 'finNNalLLly.WoW')\n lu.assertEquals(candidate('_', {'Bb', '91245'}), '_.Bb')\n lu.assertEquals(candidate('Sp', {'671235', 'Bb'}), 'Sp.671235')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "lua", - "prompt": "-- Given a string representing a space separated lowercase letters, return a table\n-- of the letter with the most repetition and containing the corresponding count.\n-- If several letters have the same occurrence, return all of them.\n-- Example:\n-- >>> histogram('a b c')\n-- {['a'] = 1, ['b'] = 1, ['c'] = 1}\n-- >>> histogram('a b b a')\n-- {['a'] = 2, ['b'] = 2}\n-- >>> histogram('a b c a b')\n-- {['a'] = 2, ['b'] = 2}\n-- >>> histogram('b b b b a')\n-- {['b'] = 4}\n-- >>> histogram('')\n-- {}\nlocal function histogram(test)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = histogram\n lu.assertEquals(candidate('a b b a'), {['a'] = 2, ['b'] = 2})\n lu.assertEquals(candidate('a b c a b'), {['a'] = 2, ['b'] = 2})\n lu.assertEquals(candidate('a b c d g'), {['a'] = 1, ['b'] = 1, ['c'] = 1, ['d'] = 1, ['g'] = 1})\n lu.assertEquals(candidate('r t g'), {['r'] = 1, ['t'] = 1, ['g'] = 1})\n lu.assertEquals(candidate('b b b b a'), {['b'] = 4})\n lu.assertEquals(candidate('r t g'), {['r'] = 1, ['t'] = 1, ['g'] = 1})\n lu.assertEquals(candidate(''), {})\n lu.assertEquals(candidate('a'), {['a'] = 1})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "lua", - "prompt": "-- pairs_sum_to_zero takes a table of integers as an input.\n-- it returns true if there are two distinct elements in the table that\n-- sum to zero, and false otherwise.\n-- >>> pairs_sum_to_zero({1, 3, 5, 0})\n-- false\n-- >>> pairs_sum_to_zero({1, 3, -2, 1})\n-- false\n-- >>> pairs_sum_to_zero({1, 2, 3, 7})\n-- false\n-- >>> pairs_sum_to_zero({2, 4, -5, 3, 5, 7})\n-- true\n-- >>> pairs_sum_to_zero({1})\n-- false\nlocal function pairs_sum_to_zero(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = pairs_sum_to_zero\n lu.assertEquals(candidate({1, 3, 5, 0}), false)\n lu.assertEquals(candidate({1, 3, -2, 1}), false)\n lu.assertEquals(candidate({1, 2, 3, 7}), false)\n lu.assertEquals(candidate({2, 4, -5, 3, 5, 7}), true)\n lu.assertEquals(candidate({1}), false)\n lu.assertEquals(candidate({-3, 9, -1, 3, 2, 30}), true)\n lu.assertEquals(candidate({-3, 9, -1, 3, 2, 31}), true)\n lu.assertEquals(candidate({-3, 9, -1, 4, 2, 30}), false)\n lu.assertEquals(candidate({-3, 9, -1, 4, 2, 31}), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "lua", - "prompt": "-- Write a function that accepts two tables of strings and returns the table that has \n-- total number of chars in the all strings of the table less than the other table.\n-- if the two tables have the same number of chars, return the first table.\n-- Examples\n-- >>> total_match({}, {})\n-- {}\n-- >>> total_match({'hi', 'admin'}, {'hI', 'Hi'})\n-- {'hI', 'Hi'}\n-- >>> total_match({'hi', 'admin'}, {'hi', 'hi', 'admin', 'project'})\n-- {'hi', 'admin'}\n-- >>> total_match({'hi', 'admin'}, {'hI', 'hi', 'hi'})\n-- {'hI', 'hi', 'hi'}\n-- >>> total_match({'4'}, {'1', '2', '3', '4', '5'})\n-- {'4'}\nlocal function total_match(lst1, lst2)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = total_match\n lu.assertEquals(candidate({}, {}), {})\n lu.assertEquals(candidate({'hi', 'admin'}, {'hi', 'hi'}), {'hi', 'hi'})\n lu.assertEquals(candidate({'hi', 'admin'}, {'hi', 'hi', 'admin', 'project'}), {'hi', 'admin'})\n lu.assertEquals(candidate({'4'}, {'1', '2', '3', '4', '5'}), {'4'})\n lu.assertEquals(candidate({'hi', 'admin'}, {'hI', 'Hi'}), {'hI', 'Hi'})\n lu.assertEquals(candidate({'hi', 'admin'}, {'hI', 'hi', 'hi'}), {'hI', 'hi', 'hi'})\n lu.assertEquals(candidate({'hi', 'admin'}, {'hI', 'hi', 'hii'}), {'hi', 'admin'})\n lu.assertEquals(candidate({}, {'this'}), {})\n lu.assertEquals(candidate({'this'}, {}), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "lua", - "prompt": "-- Circular shift the digits of the integer x, shift the digits right by shift\n-- and return the result as a string.\n-- If shift > number of digits, return digits reversed.\n-- >>> circular_shift(12, 1)\n-- '21'\n-- >>> circular_shift(12, 2)\n-- '12'\nlocal function circular_shift(x, shift)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = circular_shift\n lu.assertEquals(candidate(100, 2), '001')\n lu.assertEquals(candidate(12, 2), '12')\n lu.assertEquals(candidate(97, 8), '79')\n lu.assertEquals(candidate(12, 1), '21')\n lu.assertEquals(candidate(11, 101), '11')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "lua", - "prompt": "-- Return true is table elements are monotonically increasing or decreasing.\n-- >>> monotonic({1, 2, 4, 20})\n-- true\n-- >>> monotonic({1, 20, 4, 10})\n-- false\n-- >>> monotonic({4, 1, 0, -10})\n-- true\nlocal function monotonic(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = monotonic\n lu.assertEquals(candidate({1, 2, 4, 10}), true)\n lu.assertEquals(candidate({1, 2, 4, 20}), true)\n lu.assertEquals(candidate({1, 20, 4, 10}), false)\n lu.assertEquals(candidate({4, 1, 0, -10}), true)\n lu.assertEquals(candidate({4, 1, 1, 0}), true)\n lu.assertEquals(candidate({1, 2, 3, 2, 5, 60}), false)\n lu.assertEquals(candidate({1, 2, 3, 4, 5, 60}), true)\n lu.assertEquals(candidate({9, 9, 9, 9}), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "lua", - "prompt": "-- Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n-- Example\n-- >>> is_equal_to_sum_even(4)\n-- false\n-- >>> is_equal_to_sum_even(6)\n-- false\n-- >>> is_equal_to_sum_even(8)\n-- true\nlocal function is_equal_to_sum_even(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_equal_to_sum_even\n lu.assertEquals(candidate(4), false)\n lu.assertEquals(candidate(6), false)\n lu.assertEquals(candidate(8), true)\n lu.assertEquals(candidate(10), true)\n lu.assertEquals(candidate(11), false)\n lu.assertEquals(candidate(12), true)\n lu.assertEquals(candidate(13), false)\n lu.assertEquals(candidate(16), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "lua", - "prompt": "-- Input to this function is a string representing musical notes in a special ASCII format.\n-- Your task is to parse this string and return table of integers corresponding to how many beats does each\n-- not last.\n-- Here is a legend:\n-- 'o' - whole note, lasts four beats\n-- 'o|' - half note, lasts two beats\n-- '.|' - quater note, lasts one beat\n-- >>> parse_music('o o| .| o| o| .| .| .| .| o o')\n-- {4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4}\nlocal function parse_music(music_string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = parse_music\n lu.assertEquals(candidate(''), {})\n lu.assertEquals(candidate('o o o o'), {4, 4, 4, 4})\n lu.assertEquals(candidate('.| .| .| .|'), {1, 1, 1, 1})\n lu.assertEquals(candidate('o| o| .| .| o o o o'), {2, 2, 1, 1, 4, 4, 4, 4})\n lu.assertEquals(candidate('o| .| o| .| o o| o o|'), {2, 1, 2, 1, 4, 2, 4, 2})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "lua", - "prompt": "-- \"\n-- This function will take a table of integers. For all entries in the table, the function shall square the integer entry if its index is a \n-- multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n-- change the entries in the table whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n-- Examples:\n-- >>> lst\n-- {1, 2, 3}\n-- >>> lst\n-- {}\n-- >>> lst\n-- {-1, -5, 2, -1, -5}\nlocal function sum_squares(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sum_squares\n lu.assertEquals(candidate({1, 2, 3}), 6)\n lu.assertEquals(candidate({1, 4, 9}), 14)\n lu.assertEquals(candidate({}), 0)\n lu.assertEquals(candidate({1, 1, 1, 1, 1, 1, 1, 1, 1}), 9)\n lu.assertEquals(candidate({-1, -1, -1, -1, -1, -1, -1, -1, -1}), -3)\n lu.assertEquals(candidate({0}), 0)\n lu.assertEquals(candidate({-1, -5, 2, -1, -5}), -126)\n lu.assertEquals(candidate({-56, -99, 1, 0, -2}), 3030)\n lu.assertEquals(candidate({-1, 0, 0, 0, 0, 0, 0, 0, -1}), 0)\n lu.assertEquals(candidate({-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37}), -14196)\n lu.assertEquals(candidate({-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10}), -1448)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "lua", - "prompt": "-- triples_sum_to_zero takes a table of integers as an input.\n-- it returns true if there are three distinct elements in the table that\n-- sum to zero, and false otherwise.\n-- >>> triples_sum_to_zero({1, 3, 5, 0})\n-- false\n-- >>> triples_sum_to_zero({1, 3, -2, 1})\n-- true\n-- >>> triples_sum_to_zero({1, 2, 3, 7})\n-- false\n-- >>> triples_sum_to_zero({2, 4, -5, 3, 9, 7})\n-- true\n-- >>> triples_sum_to_zero({1})\n-- false\nlocal function triples_sum_to_zero(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = triples_sum_to_zero\n lu.assertEquals(candidate({1, 3, 5, 0}), false)\n lu.assertEquals(candidate({1, 3, 5, -1}), false)\n lu.assertEquals(candidate({1, 3, -2, 1}), true)\n lu.assertEquals(candidate({1, 2, 3, 7}), false)\n lu.assertEquals(candidate({1, 2, 5, 7}), false)\n lu.assertEquals(candidate({2, 4, -5, 3, 9, 7}), true)\n lu.assertEquals(candidate({1}), false)\n lu.assertEquals(candidate({1, 3, 5, -100}), false)\n lu.assertEquals(candidate({100, 3, 5, -100}), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "lua", - "prompt": "-- brackets is a string of \"<\" and \">\".\n-- return true if every opening bracket has a corresponding closing bracket.\n-- >>> correct_bracketing('<')\n-- false\n-- >>> correct_bracketing('<>')\n-- true\n-- >>> correct_bracketing('<<><>>')\n-- true\n-- >>> correct_bracketing('><<>')\n-- false\nlocal function correct_bracketing(brackets)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = correct_bracketing\n lu.assertEquals(candidate('<>'), true)\n lu.assertEquals(candidate('<<><>>'), true)\n lu.assertEquals(candidate('<><><<><>><>'), true)\n lu.assertEquals(candidate('<><><<<><><>><>><<><><<>>>'), true)\n lu.assertEquals(candidate('<<<><>>>>'), false)\n lu.assertEquals(candidate('><<>'), false)\n lu.assertEquals(candidate('<'), false)\n lu.assertEquals(candidate('<<<<'), false)\n lu.assertEquals(candidate('>'), false)\n lu.assertEquals(candidate('<<>'), false)\n lu.assertEquals(candidate('<><><<><>><>><<>'), false)\n lu.assertEquals(candidate('<><><<><>><>>><>'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "lua", - "prompt": "-- Write a function that takes a table of numbers as input and returns \n-- the number of elements in the table that are greater than 10 and both \n-- first and last digits of a number are odd (1, 3, 5, 7, 9).\n-- For example:\n-- >>> specialFilter({15, -73, 14, -15})\n-- 1\n-- >>> specialFilter({33, -2, -3, 45, 21, 109})\n-- 2\nlocal function specialFilter(nums)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = specialFilter\n lu.assertEquals(candidate({5, -2, 1, -5}), 0)\n lu.assertEquals(candidate({15, -73, 14, -15}), 1)\n lu.assertEquals(candidate({33, -2, -3, 45, 21, 109}), 2)\n lu.assertEquals(candidate({43, -12, 93, 125, 121, 109}), 4)\n lu.assertEquals(candidate({71, -2, -33, 75, 21, 19}), 3)\n lu.assertEquals(candidate({1}), 0)\n lu.assertEquals(candidate({}), 0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "lua", - "prompt": "-- Given a table, return true if all keys are strings in lower \n-- case or all keys are strings in upper case, else return false.\n-- The function should return false is the given table is empty.\n-- Examples:\n-- >>> check_dict_case({['a'] = 'apple', ['b'] = 'banana'})\n-- true\n-- >>> check_dict_case({['a'] = 'apple', ['A'] = 'banana', ['B'] = 'banana'})\n-- false\n-- >>> check_dict_case({['a'] = 'apple', [8] = 'banana', ['a'] = 'apple'})\n-- false\n-- >>> check_dict_case({['Name'] = 'John', ['Age'] = '36', ['City'] = 'Houston'})\n-- false\n-- >>> check_dict_case({['STATE'] = 'NC', ['ZIP'] = '12345'})\n-- true\nlocal function check_dict_case(dict)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = check_dict_case\n lu.assertEquals(candidate({['p'] = 'pineapple', ['b'] = 'banana'}), true)\n lu.assertEquals(candidate({['p'] = 'pineapple', ['A'] = 'banana', ['B'] = 'banana'}), false)\n lu.assertEquals(candidate({['p'] = 'pineapple', ['5'] = 'banana', ['a'] = 'apple'}), false)\n lu.assertEquals(candidate({['Name'] = 'John', ['Age'] = '36', ['City'] = 'Houston'}), false)\n lu.assertEquals(candidate({['STATE'] = 'NC', ['ZIP'] = '12345'}), true)\n lu.assertEquals(candidate({['fruit'] = 'Orange', ['taste'] = 'Sweet'}), true)\n lu.assertEquals(candidate({}), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "lua", - "prompt": "-- Given a string of words, return a table of words split on whitespace, if no whitespaces exists in the text you\n-- should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n-- alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n-- Examples\n-- >>> split_words('Hello world!')\n-- {'Hello', 'world!'}\n-- >>> split_words('Hello,world!')\n-- {'Hello', 'world!'}\n-- >>> split_words('abcdef')\n-- 3\nlocal function split_words(txt)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = split_words\n lu.assertEquals(candidate('Hello world!'), {'Hello', 'world!'})\n lu.assertEquals(candidate('Hello,world!'), {'Hello', 'world!'})\n lu.assertEquals(candidate('Hello world,!'), {'Hello', 'world,!'})\n lu.assertEquals(candidate('Hello,Hello,world !'), {'Hello,Hello,world', '!'})\n lu.assertEquals(candidate('abcdef'), 3)\n lu.assertEquals(candidate('aaabb'), 2)\n lu.assertEquals(candidate('aaaBb'), 1)\n lu.assertEquals(candidate(''), 0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "lua", - "prompt": "-- The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n-- fibfib(0) == 0\n-- fibfib(1) == 0\n-- fibfib(2) == 1\n-- fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n-- Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n-- >>> fibfib(1)\n-- 0\n-- >>> fibfib(5)\n-- 4\n-- >>> fibfib(8)\n-- 24\nlocal function fibfib(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = fibfib\n lu.assertEquals(candidate(2), 1)\n lu.assertEquals(candidate(1), 0)\n lu.assertEquals(candidate(5), 4)\n lu.assertEquals(candidate(8), 24)\n lu.assertEquals(candidate(10), 81)\n lu.assertEquals(candidate(12), 274)\n lu.assertEquals(candidate(14), 927)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "lua", - "prompt": "-- You are given a table of numbers.\n-- You need to return the sum of squared numbers in the given table,\n-- round each element in the table to the upper int(Ceiling) first.\n-- Examples:\n-- >>> lst({1.0, 2.0, 3.0})\n-- 14\n-- >>> lst({1.0, 4.0, 9.0})\n-- 98\n-- >>> lst({1.0, 3.0, 5.0, 7.0})\n-- 84\n-- >>> lst({1.4, 4.2, 0.0})\n-- 29\n-- >>> lst({-2.4, 1.0, 1.0})\n-- 6\nlocal function sum_squares(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sum_squares\n lu.assertEquals(candidate({1.0, 2.0, 3.0}), 14)\n lu.assertEquals(candidate({1.0, 2.0, 3.0}), 14)\n lu.assertEquals(candidate({1.0, 3.0, 5.0, 7.0}), 84)\n lu.assertEquals(candidate({1.4, 4.2, 0.0}), 29)\n lu.assertEquals(candidate({-2.4, 1.0, 1.0}), 6)\n lu.assertEquals(candidate({100.0, 1.0, 15.0, 2.0}), 10230)\n lu.assertEquals(candidate({10000.0, 10000.0}), 200000000)\n lu.assertEquals(candidate({-1.4, 4.6, 6.3}), 75)\n lu.assertEquals(candidate({-1.4, 17.9, 18.9, 19.9}), 1086)\n lu.assertEquals(candidate({0.0}), 0)\n lu.assertEquals(candidate({-1.0}), 1)\n lu.assertEquals(candidate({-1.0, 1.0, 0.0}), 2)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_85_add", - "language": "lua", - "prompt": "-- Given a non-empty table of integers lst. add the even elements that are at odd indices..\n-- Examples:\n-- >>> add({4, 2, 6, 7})\n-- 2\nlocal function add(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = add\n lu.assertEquals(candidate({4, 88}), 88)\n lu.assertEquals(candidate({4, 5, 6, 7, 2, 122}), 122)\n lu.assertEquals(candidate({4, 0, 6, 7}), 0)\n lu.assertEquals(candidate({4, 4, 6, 8}), 12)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "lua", - "prompt": "-- Return sorted unique elements in a table\n-- >>> unique({5, 3, 5, 2, 3, 3, 9, 0, 123})\n-- {0, 2, 3, 5, 9, 123}\nlocal function unique(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = unique\n lu.assertEquals(candidate({5, 3, 5, 2, 3, 3, 9, 0, 123}), {0, 2, 3, 5, 9, 123})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "lua", - "prompt": "-- Given a string text, replace all spaces in it with underscores, \n-- and if a string has more than 2 consecutive spaces, \n-- then replace all consecutive spaces with - \n-- >>> fix_spaces(' Example')\n-- 'Example'\n-- >>> fix_spaces(' Example 1')\n-- 'Example_1'\n-- >>> fix_spaces(' Example 2')\n-- '_Example_2'\n-- >>> fix_spaces(' Example 3')\n-- '_Example-3'\nlocal function fix_spaces(text)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = fix_spaces\n lu.assertEquals(candidate('Example'), 'Example')\n lu.assertEquals(candidate('Mudasir Hanif '), 'Mudasir_Hanif_')\n lu.assertEquals(candidate('Yellow Yellow Dirty Fellow'), 'Yellow_Yellow__Dirty__Fellow')\n lu.assertEquals(candidate('Exa mple'), 'Exa-mple')\n lu.assertEquals(candidate(' Exa 1 2 2 mple'), '-Exa_1_2_2_mple')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "lua", - "prompt": "-- Return 2^n modulo p (be aware of numerics).\n-- >>> modp(3, 5)\n-- 3\n-- >>> modp(1101, 101)\n-- 2\n-- >>> modp(0, 101)\n-- 1\n-- >>> modp(3, 11)\n-- 8\n-- >>> modp(100, 101)\n-- 1\nlocal function modp(n, p)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = modp\n lu.assertEquals(candidate(3, 5), 3)\n lu.assertEquals(candidate(1101, 101), 2)\n lu.assertEquals(candidate(0, 101), 1)\n lu.assertEquals(candidate(3, 11), 8)\n lu.assertEquals(candidate(100, 101), 1)\n lu.assertEquals(candidate(30, 5), 4)\n lu.assertEquals(candidate(31, 5), 3)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "lua", - "prompt": "-- You have to write a function which validates a given date string and\n-- returns true if the date is valid otherwise false.\n-- The date is valid if all of the following rules are satisfied:\n-- 1. The date string is not empty.\n-- 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n-- 3. The months should not be less than 1 or higher than 12.\n-- 4. The date should be in the format: mm-dd-yyyy\n-- >>> valid_date('03-11-2000')\n-- true\n-- >>> valid_date('15-01-2012')\n-- false\n-- >>> valid_date('04-0-2040')\n-- false\n-- >>> valid_date('06-04-2020')\n-- true\n-- >>> valid_date('06/04/2020')\n-- false\nlocal function valid_date(date)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = valid_date\n lu.assertEquals(candidate('03-11-2000'), true)\n lu.assertEquals(candidate('15-01-2012'), false)\n lu.assertEquals(candidate('04-0-2040'), false)\n lu.assertEquals(candidate('06-04-2020'), true)\n lu.assertEquals(candidate('01-01-2007'), true)\n lu.assertEquals(candidate('03-32-2011'), false)\n lu.assertEquals(candidate(''), false)\n lu.assertEquals(candidate('04-31-3000'), false)\n lu.assertEquals(candidate('06-06-2005'), true)\n lu.assertEquals(candidate('21-31-2000'), false)\n lu.assertEquals(candidate('04-12-2003'), true)\n lu.assertEquals(candidate('04122003'), false)\n lu.assertEquals(candidate('20030412'), false)\n lu.assertEquals(candidate('2003-04'), false)\n lu.assertEquals(candidate('2003-04-12'), false)\n lu.assertEquals(candidate('04-2003'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "lua", - "prompt": "-- Write a function that takes a string and returns an ordered version of it.\n-- Ordered version of string, is a string where all words (separated by space)\n-- are replaced by a new word where all the characters arranged in\n-- ascending order based on ascii value.\n-- Note: You should keep the order of words and blank spaces in the sentence.\n-- For example:\n-- >>> anti_shuffle('Hi')\n-- 'Hi'\n-- >>> anti_shuffle('hello')\n-- 'ehllo'\n-- >>> anti_shuffle('Hello World!!!')\n-- 'Hello !!!Wdlor'\nlocal function anti_shuffle(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = anti_shuffle\n lu.assertEquals(candidate('Hi'), 'Hi')\n lu.assertEquals(candidate('hello'), 'ehllo')\n lu.assertEquals(candidate('number'), 'bemnru')\n lu.assertEquals(candidate('abcd'), 'abcd')\n lu.assertEquals(candidate('Hello World!!!'), 'Hello !!!Wdlor')\n lu.assertEquals(candidate(''), '')\n lu.assertEquals(candidate('Hi. My name is Mister Robot. How are you?'), '.Hi My aemn is Meirst .Rboot How aer ?ouy')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "lua", - "prompt": "-- Given a table of numbers, return whether or not they are sorted\n-- in ascending order. If table has more than 1 duplicate of the same\n-- number, return false. Assume no negative numbers and only integers.\n-- Examples\n-- >>> is_sorted({5})\n-- true\n-- >>> is_sorted({1, 2, 3, 4, 5})\n-- true\n-- >>> is_sorted({1, 3, 2, 4, 5})\n-- false\n-- >>> is_sorted({1, 2, 3, 4, 5, 6})\n-- true\n-- >>> is_sorted({1, 2, 3, 4, 5, 6, 7})\n-- true\n-- >>> is_sorted({1, 3, 2, 4, 5, 6, 7})\n-- false\n-- >>> is_sorted({1, 2, 2, 3, 3, 4})\n-- true\n-- >>> is_sorted({1, 2, 2, 2, 3, 4})\n-- false\nlocal function is_sorted(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_sorted\n lu.assertEquals(candidate({5}), true)\n lu.assertEquals(candidate({1, 2, 3, 4, 5}), true)\n lu.assertEquals(candidate({1, 3, 2, 4, 5}), false)\n lu.assertEquals(candidate({1, 2, 3, 4, 5, 6}), true)\n lu.assertEquals(candidate({1, 2, 3, 4, 5, 6, 7}), true)\n lu.assertEquals(candidate({1, 3, 2, 4, 5, 6, 7}), false)\n lu.assertEquals(candidate({}), true)\n lu.assertEquals(candidate({1}), true)\n lu.assertEquals(candidate({3, 2, 1}), false)\n lu.assertEquals(candidate({1, 2, 2, 2, 3, 4}), false)\n lu.assertEquals(candidate({1, 2, 3, 3, 3, 4}), false)\n lu.assertEquals(candidate({1, 2, 2, 3, 3, 4}), true)\n lu.assertEquals(candidate({1, 2, 3, 4}), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "lua", - "prompt": "-- You are given a string s.\n-- Your task is to check if the string is haplua or not.\n-- A string is haplua if its length is at least 3 and every 3 consecutive letters are distinct\n-- For example:\n-- >>> is_happy('a')\n-- false\n-- >>> is_happy('aa')\n-- false\n-- >>> is_happy('abcd')\n-- true\n-- >>> is_happy('aabb')\n-- false\n-- >>> is_happy('adb')\n-- true\n-- >>> is_happy('xyy')\n-- false\nlocal function is_happy(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_happy\n lu.assertEquals(candidate('a'), false)\n lu.assertEquals(candidate('aa'), false)\n lu.assertEquals(candidate('abcd'), true)\n lu.assertEquals(candidate('aabb'), false)\n lu.assertEquals(candidate('adb'), true)\n lu.assertEquals(candidate('xyy'), false)\n lu.assertEquals(candidate('iopaxpoi'), true)\n lu.assertEquals(candidate('iopaxioi'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "lua", - "prompt": "-- Write a function that returns true if the object q will fly, and false otherwise.\n-- The object q will fly if it's balanced (it is a palindromic table) and the sum of its elements is less than or equal the maximum possible weight w.\n-- Example:\n-- >>> will_it_fly({1, 2}, 5)\n-- false\n-- # 1+2 is less than the maximum possible weight, but it's unbalanced.\n-- >>> will_it_fly({3, 2, 3}, 1)\n-- false\n-- # it's balanced, but 3+2+3 is more than the maximum possible weight.\n-- >>> will_it_fly({3, 2, 3}, 9)\n-- true\n-- # 3+2+3 is less than the maximum possible weight, and it's balanced.\n-- >>> will_it_fly({3}, 5)\n-- true\n-- # 3 is less than the maximum possible weight, and it's balanced.\nlocal function will_it_fly(q, w)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = will_it_fly\n lu.assertEquals(candidate({3, 2, 3}, 9), true)\n lu.assertEquals(candidate({1, 2}, 5), false)\n lu.assertEquals(candidate({3}, 5), true)\n lu.assertEquals(candidate({3, 2, 3}, 1), false)\n lu.assertEquals(candidate({1, 2, 3}, 6), false)\n lu.assertEquals(candidate({5}, 5), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "lua", - "prompt": "-- Given a table of non-negative integers, return a colua of the given table after sorting,\n-- you will sort the given table in ascending order if the sum( first index value, last index value) is odd,\n-- or sort it in descending order if the sum( first index value, last index value) is even.\n-- Note:\n-- * don't change the given table.\n-- Examples:\n-- >>> sort_array({})\n-- {}\n-- >>> sort_array({5})\n-- {5}\n-- >>> sort_array({2, 4, 3, 0, 1, 5})\n-- {0, 1, 2, 3, 4, 5}\n-- >>> sort_array({2, 4, 3, 0, 1, 5, 6})\n-- {6, 5, 4, 3, 2, 1, 0}\nlocal function sort_array(array)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sort_array\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({5}), {5})\n lu.assertEquals(candidate({2, 4, 3, 0, 1, 5}), {0, 1, 2, 3, 4, 5})\n lu.assertEquals(candidate({2, 4, 3, 0, 1, 5, 6}), {6, 5, 4, 3, 2, 1, 0})\n lu.assertEquals(candidate({2, 1}), {1, 2})\n lu.assertEquals(candidate({15, 42, 87, 32, 11, 0}), {0, 11, 15, 32, 42, 87})\n lu.assertEquals(candidate({21, 14, 23, 11}), {23, 21, 14, 11})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "lua", - "prompt": "-- Implement a function that takes an non-negative integer and returns a table of the first n\n-- integers that are prime numbers and less than n.\n-- for example:\n-- >>> count_up_to(5)\n-- {2, 3}\n-- >>> count_up_to(11)\n-- {2, 3, 5, 7}\n-- >>> count_up_to(0)\n-- {}\n-- >>> count_up_to(20)\n-- {2, 3, 5, 7, 11, 13, 17, 19}\n-- >>> count_up_to(1)\n-- {}\n-- >>> count_up_to(18)\n-- {2, 3, 5, 7, 11, 13, 17}\nlocal function count_up_to(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = count_up_to\n lu.assertEquals(candidate(5), {2, 3})\n lu.assertEquals(candidate(6), {2, 3, 5})\n lu.assertEquals(candidate(7), {2, 3, 5})\n lu.assertEquals(candidate(10), {2, 3, 5, 7})\n lu.assertEquals(candidate(0), {})\n lu.assertEquals(candidate(22), {2, 3, 5, 7, 11, 13, 17, 19})\n lu.assertEquals(candidate(1), {})\n lu.assertEquals(candidate(18), {2, 3, 5, 7, 11, 13, 17})\n lu.assertEquals(candidate(47), {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43})\n lu.assertEquals(candidate(101), {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "lua", - "prompt": "-- Out of table of strings, return the longest one. Return the first one in case of multiple\n-- strings of the same length. Return None in case the input table is empty.\n-- >>> longest({})\n-- None\n-- >>> longest({'a', 'b', 'c'})\n-- 'a'\n-- >>> longest({'a', 'bb', 'ccc'})\n-- 'ccc'\nlocal function longest(strings)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = longest\n lu.assertEquals(candidate({}), None)\n lu.assertEquals(candidate({'x', 'y', 'z'}), 'x')\n lu.assertEquals(candidate({'x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc'}), 'zzzz')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "lua", - "prompt": "-- Given a table of integers, sort the integers that are between 1 and 9 inclusive,\n-- reverse the resulting table, and then replace each digit by its corresponding name from\n-- \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n-- For example:\n-- >>> by_length({2, 1, 1, 4, 5, 8, 2, 3})\n-- {'Eight', 'Five', 'Four', 'Three', 'Two', 'Two', 'One', 'One'}\n-- If the table is empty, return an empty table:\n-- >>> by_length({})\n-- {}\n-- If the table has any strange number ignore it:\n-- >>> by_length({1, -1, 55})\n-- {'One'}\nlocal function by_length(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = by_length\n lu.assertEquals(candidate({2, 1, 1, 4, 5, 8, 2, 3}), {'Eight', 'Five', 'Four', 'Three', 'Two', 'Two', 'One', 'One'})\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({1, -1, 55}), {'One'})\n lu.assertEquals(candidate({1, -1, 3, 2}), {'Three', 'Two', 'One'})\n lu.assertEquals(candidate({9, 4, 8}), {'Nine', 'Eight', 'Four'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_106_f", - "language": "lua", - "prompt": "-- Implement the function f that takes n as a parameter,\n-- and returns a table of size n, such that the value of the element at index i is the factorial of i if i is even\n-- or the sum of numbers from 1 to i otherwise.\n-- i starts from 1.\n-- the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n-- Example:\n-- >>> f(5)\n-- {1, 2, 6, 24, 15}\nlocal function f(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = f\n lu.assertEquals(candidate(5), {1, 2, 6, 24, 15})\n lu.assertEquals(candidate(7), {1, 2, 6, 24, 15, 720, 28})\n lu.assertEquals(candidate(1), {1})\n lu.assertEquals(candidate(3), {1, 2, 6})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "lua", - "prompt": "-- Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n-- >>> fizz_buzz(50)\n-- 0\n-- >>> fizz_buzz(78)\n-- 2\n-- >>> fizz_buzz(79)\n-- 3\nlocal function fizz_buzz(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = fizz_buzz\n lu.assertEquals(candidate(50), 0)\n lu.assertEquals(candidate(78), 2)\n lu.assertEquals(candidate(79), 3)\n lu.assertEquals(candidate(100), 3)\n lu.assertEquals(candidate(200), 6)\n lu.assertEquals(candidate(4000), 192)\n lu.assertEquals(candidate(10000), 639)\n lu.assertEquals(candidate(100000), 8026)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "lua", - "prompt": "-- Given a positive floating point number, it can be decomposed into\n-- and integer part (largest integer smaller than given number) and decimals\n-- (leftover part always smaller than 1).\n-- Return the decimal part of the number.\n-- >>> truncate_number(3.5)\n-- 0.5\nlocal function truncate_number(number)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = truncate_number\n lu.assertEquals(candidate(3.5), 0.5)\n lu.assertEquals(candidate(1.25), 0.25)\n lu.assertEquals(candidate(123.0), 0.0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "lua", - "prompt": "-- For a given table of integers, return a table consisting of a sum and a product of all the integers in a table.\n-- Empty sum should be equal to 0 and empty product should be equal to 1.\n-- >>> sum_product({})\n-- {0, 1}\n-- >>> sum_product({1, 2, 3, 4})\n-- {10, 24}\nlocal function sum_product(numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sum_product\n lu.assertEquals(candidate({}), {0, 1})\n lu.assertEquals(candidate({1, 1, 1}), {3, 1})\n lu.assertEquals(candidate({100, 0}), {100, 0})\n lu.assertEquals(candidate({3, 5, 7}), {15, 105})\n lu.assertEquals(candidate({10}), {10, 10})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "lua", - "prompt": "-- You are given a 2 dimensional data, as a nested tables,\n-- which is similar to matrix, however, unlike matrices,\n-- each row may contain a different number of columns.\n-- Given lst, and integer x, find integers x in the table,\n-- and return table of tables, [(x1, y1), (x2, y2) ...] such that\n-- each table is a coordinate - (row, columns), starting with 0.\n-- Sort coordinates initially by rows in ascending order.\n-- Also, sort coordinates of the row by columns in descending order.\n-- Examples:\n-- >>> get_row({{1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 1, 6}, {1, 2, 3, 4, 5, 1}}, 1)\n-- {{0, 0}, {1, 4}, {1, 0}, {2, 5}, {2, 0}}\n-- >>> get_row({}, 1)\n-- {}\n-- >>> get_row({{}, {1}, {1, 2, 3}}, 3)\n-- {{2, 2}}\nlocal function get_row(lst, x)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = get_row\n lu.assertEquals(candidate({{1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 1, 6}, {1, 2, 3, 4, 5, 1}}, 1), {{0, 0}, {1, 4}, {1, 0}, {2, 5}, {2, 0}})\n lu.assertEquals(candidate({{1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 6}}, 2), {{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}, {5, 1}})\n lu.assertEquals(candidate({{1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 6}, {1, 1, 3, 4, 5, 6}, {1, 2, 1, 4, 5, 6}, {1, 2, 3, 1, 5, 6}, {1, 2, 3, 4, 1, 6}, {1, 2, 3, 4, 5, 1}}, 1), {{0, 0}, {1, 0}, {2, 1}, {2, 0}, {3, 2}, {3, 0}, {4, 3}, {4, 0}, {5, 4}, {5, 0}, {6, 5}, {6, 0}})\n lu.assertEquals(candidate({}, 1), {})\n lu.assertEquals(candidate({{1}}, 2), {})\n lu.assertEquals(candidate({{}, {1}, {1, 2, 3}}, 3), {{2, 2}})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "lua", - "prompt": "-- You're a hungry rabbit, and you already have eaten a certain number of carrots,\n-- but now you need to eat more carrots to complete the day's meals.\n-- you should return a table of [ total number of eaten carrots after your meals,\n-- the number of carrots left after your meals ]\n-- if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n-- Example:\n-- >>> eat(5, 6, 10)\n-- {11, 4}\n-- >>> eat(4, 8, 9)\n-- {12, 1}\n-- >>> eat(1, 10, 10)\n-- {11, 0}\n-- >>> eat(2, 11, 5)\n-- {7, 0}\n-- Variables:\n-- @number : integer\n-- the number of carrots that you have eaten.\n-- @need : integer\n-- the number of carrots that you need to eat.\n-- @remaining : integer\n-- the number of remaining carrots thet exist in stock\n-- Constrain:\n-- * 0 <= number <= 1000\n-- * 0 <= need <= 1000\n-- * 0 <= remaining <= 1000\n-- Have fun :)\nlocal function eat(number, need, remaining)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = eat\n lu.assertEquals(candidate(5, 6, 10), {11, 4})\n lu.assertEquals(candidate(4, 8, 9), {12, 1})\n lu.assertEquals(candidate(1, 10, 10), {11, 0})\n lu.assertEquals(candidate(2, 11, 5), {7, 0})\n lu.assertEquals(candidate(4, 5, 7), {9, 2})\n lu.assertEquals(candidate(4, 5, 1), {5, 0})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "lua", - "prompt": "-- Given a positive integer N, return the total sum of its digits in binary.\n-- Example\n-- >>> solve(1000)\n-- '1'\n-- >>> solve(150)\n-- '110'\n-- >>> solve(147)\n-- '1100'\n-- Variables:\n-- @N integer\n-- Constraints: 0 \u2264 N \u2264 10000.\n-- Output:\n-- a string of binary number\nlocal function solve(N)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = solve\n lu.assertEquals(candidate(1000), '1')\n lu.assertEquals(candidate(150), '110')\n lu.assertEquals(candidate(147), '1100')\n lu.assertEquals(candidate(333), '1001')\n lu.assertEquals(candidate(963), '10010')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "lua", - "prompt": "-- You are given a table of integers.\n-- You need to find the largest prime value and return the sum of its digits.\n-- Examples:\n-- >>> skjkasdkd({0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3})\n-- 10\n-- >>> skjkasdkd({1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1})\n-- 25\n-- >>> skjkasdkd({1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3})\n-- 13\n-- >>> skjkasdkd({0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6})\n-- 11\n-- >>> skjkasdkd({0, 81, 12, 3, 1, 21})\n-- 3\n-- >>> skjkasdkd({0, 8, 1, 2, 1, 7})\n-- 7\nlocal function skjkasdkd(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = skjkasdkd\n lu.assertEquals(candidate({0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3}), 10)\n lu.assertEquals(candidate({1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1}), 25)\n lu.assertEquals(candidate({1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3}), 13)\n lu.assertEquals(candidate({0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6}), 11)\n lu.assertEquals(candidate({0, 81, 12, 3, 1, 21}), 3)\n lu.assertEquals(candidate({0, 8, 1, 2, 1, 7}), 7)\n lu.assertEquals(candidate({8191}), 19)\n lu.assertEquals(candidate({8191, 123456, 127, 7}), 19)\n lu.assertEquals(candidate({127, 97, 8192}), 10)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "lua", - "prompt": "-- Given a table arr of integers, find the minimum number of elements that\n-- need to be changed to make the table palindromic. A palindromic table is a table that\n-- is read the same backwards and forwards. In one change, you can change one element to any other element.\n-- For example:\n-- >>> smallest_change({1, 2, 3, 5, 4, 7, 9, 6})\n-- 4\n-- >>> smallest_change({1, 2, 3, 4, 3, 2, 2})\n-- 1\n-- >>> smallest_change({1, 2, 3, 2, 1})\n-- 0\nlocal function smallest_change(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = smallest_change\n lu.assertEquals(candidate({1, 2, 3, 5, 4, 7, 9, 6}), 4)\n lu.assertEquals(candidate({1, 2, 3, 4, 3, 2, 2}), 1)\n lu.assertEquals(candidate({1, 4, 2}), 1)\n lu.assertEquals(candidate({1, 4, 4, 2}), 1)\n lu.assertEquals(candidate({1, 2, 3, 2, 1}), 0)\n lu.assertEquals(candidate({3, 1, 1, 3}), 0)\n lu.assertEquals(candidate({1}), 0)\n lu.assertEquals(candidate({0, 1}), 1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "lua", - "prompt": "-- It is the last week of the semester and the teacher has to give the grades\n-- to students. The teacher has been making her own algorithm for grading.\n-- The only problem is, she has lost the code she used for grading.\n-- She has given you a table of GPAs for some students and you have to write \n-- a function that can output a table of letter grades using the following table:\n-- GPA | Letter grade\n-- 4.0 A+\n-- > 3.7 A \n-- > 3.3 A- \n-- > 3.0 B+\n-- > 2.7 B \n-- > 2.3 B-\n-- > 2.0 C+\n-- > 1.7 C\n-- > 1.3 C-\n-- > 1.0 D+ \n-- > 0.7 D \n-- > 0.0 D-\n-- 0.0 E\n-- Example:\n-- >>> grade_equation({4.0, 3, 1.7, 2, 3.5})\n-- {'A+', 'B', 'C-', 'C', 'A-'}\nlocal function numerical_letter_grade(grades)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = numerical_letter_grade\n lu.assertEquals(candidate({4.0, 3, 1.7, 2, 3.5}), {'A+', 'B', 'C-', 'C', 'A-'})\n lu.assertEquals(candidate({1.2}), {'D+'})\n lu.assertEquals(candidate({0.5}), {'D-'})\n lu.assertEquals(candidate({0.0}), {'E'})\n lu.assertEquals(candidate({1.0, 0.3, 1.5, 2.8, 3.3}), {'D', 'D-', 'C-', 'B', 'B+'})\n lu.assertEquals(candidate({0.0, 0.7}), {'E', 'D-'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "lua", - "prompt": "-- Given the lengths of the three sides of a triangle. Return the area of\n-- the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n-- Otherwise return -1\n-- Three sides make a valid triangle when the sum of any two sides is greater \n-- than the third side.\n-- Example:\n-- >>> triangle_area(3, 4, 5)\n-- 6.0\n-- >>> triangle_area(1, 2, 10)\n-- -1\nlocal function triangle_area(a, b, c)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = triangle_area\n lu.assertEquals(candidate(3, 4, 5), 6.0)\n lu.assertEquals(candidate(1, 2, 10), -1)\n lu.assertEquals(candidate(4, 8, 5), 8.18)\n lu.assertEquals(candidate(2, 2, 2), 1.73)\n lu.assertEquals(candidate(1, 2, 3), -1)\n lu.assertEquals(candidate(10, 5, 7), 16.25)\n lu.assertEquals(candidate(2, 6, 3), -1)\n lu.assertEquals(candidate(1, 1, 1), 0.43)\n lu.assertEquals(candidate(2, 2, 10), -1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "lua", - "prompt": "-- Check if two words have the same characters.\n-- >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n-- true\n-- >>> same_chars('abcd', 'dddddddabc')\n-- true\n-- >>> same_chars('dddddddabc', 'abcd')\n-- true\n-- >>> same_chars('eabcd', 'dddddddabc')\n-- false\n-- >>> same_chars('abcd', 'dddddddabce')\n-- false\n-- >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc')\n-- false\nlocal function same_chars(s0, s1)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = same_chars\n lu.assertEquals(candidate('eabcdzzzz', 'dddzzzzzzzddeddabc'), true)\n lu.assertEquals(candidate('abcd', 'dddddddabc'), true)\n lu.assertEquals(candidate('dddddddabc', 'abcd'), true)\n lu.assertEquals(candidate('eabcd', 'dddddddabc'), false)\n lu.assertEquals(candidate('abcd', 'dddddddabcf'), false)\n lu.assertEquals(candidate('eabcdzzzz', 'dddzzzzzzzddddabc'), false)\n lu.assertEquals(candidate('aabb', 'aaccc'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "lua", - "prompt": "-- Given a table of integers nums, find the minimum sum of any non-empty sub-table\n-- of nums.\n-- Example\n-- >>> minSubArraySum({2, 3, 4, 1, 2, 4})\n-- 1\n-- >>> minSubArraySum({-1, -2, -3})\n-- -6\nlocal function minSubArraySum(nums)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = minSubArraySum\n lu.assertEquals(candidate({2, 3, 4, 1, 2, 4}), 1)\n lu.assertEquals(candidate({-1, -2, -3}), -6)\n lu.assertEquals(candidate({-1, -2, -3, 2, -10}), -14)\n lu.assertEquals(candidate({-9999999999999999}), -9999999999999999)\n lu.assertEquals(candidate({0, 10, 20, 1000000}), 0)\n lu.assertEquals(candidate({-1, -2, -3, 10, -5}), -6)\n lu.assertEquals(candidate({100, -1, -2, -3, 10, -5}), -6)\n lu.assertEquals(candidate({10, 11, 13, 8, 3, 4}), 3)\n lu.assertEquals(candidate({100, -33, 32, -1, 0, -2}), -33)\n lu.assertEquals(candidate({-10}), -10)\n lu.assertEquals(candidate({7}), 7)\n lu.assertEquals(candidate({1, -1}), -1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "lua", - "prompt": "-- Given a string s and a natural number n, you have been tasked to implement \n-- a function that returns a table of all words from string s that contain exactly \n-- n consonants, in order these words appear in the string s.\n-- If the string s is empty then the function should return an empty table.\n-- Note: you may assume the input string contains only letters and spaces.\n-- Examples:\n-- >>> select_words('Mary had a little lamb', 4)\n-- {'little'}\n-- >>> select_words('Mary had a little lamb', 3)\n-- {'Mary', 'lamb'}\n-- >>> select_words('simple white space', 2)\n-- {}\n-- >>> select_words('Hello world', 4)\n-- {'world'}\n-- >>> select_words('Uncle sam', 3)\n-- {'Uncle'}\nlocal function select_words(s, n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = select_words\n lu.assertEquals(candidate('Mary had a little lamb', 4), {'little'})\n lu.assertEquals(candidate('Mary had a little lamb', 3), {'Mary', 'lamb'})\n lu.assertEquals(candidate('simple white space', 2), {})\n lu.assertEquals(candidate('Hello world', 4), {'world'})\n lu.assertEquals(candidate('Uncle sam', 3), {'Uncle'})\n lu.assertEquals(candidate('', 4), {})\n lu.assertEquals(candidate('a b c d e f', 1), {'b', 'c', 'd', 'f'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "lua", - "prompt": "-- Return table of all prefixes from shortest to longest of the input string\n-- >>> all_prefixes('abc')\n-- {'a', 'ab', 'abc'}\nlocal function all_prefixes(string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = all_prefixes\n lu.assertEquals(candidate(''), {})\n lu.assertEquals(candidate('asdfgh'), {'a', 'as', 'asd', 'asdf', 'asdfg', 'asdfgh'})\n lu.assertEquals(candidate('WWW'), {'W', 'WW', 'WWW'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "lua", - "prompt": "-- Create a function that takes a value (string) representing a number\n-- and returns the closest integer to it. If the number is equidistant\n-- from two integers, round it away from zero.\n-- Examples\n-- >>> closest_integer('10')\n-- 10\n-- >>> closest_integer('15.3')\n-- 15\n-- Note:\n-- Rounding away from zero means that if the given number is equidistant\n-- from two integers, the one you should return is the one that is the\n-- farthest from zero. For example closest_integer(\"14.5\") should\n-- return 15 and closest_integer(\"-14.5\") should return -15.\nlocal function closest_integer(value)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = closest_integer\n lu.assertEquals(candidate('10'), 10)\n lu.assertEquals(candidate('14.5'), 15)\n lu.assertEquals(candidate('-15.5'), -16)\n lu.assertEquals(candidate('15.3'), 15)\n lu.assertEquals(candidate('0'), 0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "lua", - "prompt": "-- Create a function which takes a string representing a file's name, and returns\n-- 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n-- A file's name is considered to be valid if and only if all the following conditions \n-- are met:\n-- - There should not be more than three digits ('0'-'9') in the file's name.\n-- - The file's name contains exactly one dot '.'\n-- - The substring before the dot should not be empty, and it starts with a letter from \n-- the latin alphapet ('a'-'z' and 'A'-'Z').\n-- - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n-- Examples:\n-- >>> file_name_check('example.txt')\n-- 'Yes'\n-- >>> file_name_check('1example.dll')\n-- 'No'\nlocal function file_name_check(file_name)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = file_name_check\n lu.assertEquals(candidate('example.txt'), 'Yes')\n lu.assertEquals(candidate('1example.dll'), 'No')\n lu.assertEquals(candidate('s1sdf3.asd'), 'No')\n lu.assertEquals(candidate('K.dll'), 'Yes')\n lu.assertEquals(candidate('MY16FILE3.exe'), 'Yes')\n lu.assertEquals(candidate('His12FILE94.exe'), 'No')\n lu.assertEquals(candidate('_Y.txt'), 'No')\n lu.assertEquals(candidate('?aREYA.exe'), 'No')\n lu.assertEquals(candidate('/this_is_valid.dll'), 'No')\n lu.assertEquals(candidate('this_is_valid.wow'), 'No')\n lu.assertEquals(candidate('this_is_valid.txt'), 'Yes')\n lu.assertEquals(candidate('this_is_valid.txtexe'), 'No')\n lu.assertEquals(candidate('#this2_i4s_5valid.ten'), 'No')\n lu.assertEquals(candidate('@this1_is6_valid.exe'), 'No')\n lu.assertEquals(candidate('this_is_12valid.6exe4.txt'), 'No')\n lu.assertEquals(candidate('all.exe.txt'), 'No')\n lu.assertEquals(candidate('I563_No.exe'), 'Yes')\n lu.assertEquals(candidate('Is3youfault.txt'), 'Yes')\n lu.assertEquals(candidate('no_one#knows.dll'), 'Yes')\n lu.assertEquals(candidate('1I563_Yes3.exe'), 'No')\n lu.assertEquals(candidate('I563_Yes3.txtt'), 'No')\n lu.assertEquals(candidate('final..txt'), 'No')\n lu.assertEquals(candidate('final132'), 'No')\n lu.assertEquals(candidate('_f4indsartal132.'), 'No')\n lu.assertEquals(candidate('.txt'), 'No')\n lu.assertEquals(candidate('s.'), 'No')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "lua", - "prompt": "-- You are given two intervals,\n-- where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n-- The given intervals are closed which means that the interval (start, end)\n-- includes both start and end.\n-- For each given interval, it is assumed that its start is less or equal its end.\n-- Your task is to determine whether the length of intersection of these two \n-- intervals is a prime number.\n-- Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n-- which its length is 1, which not a prime number.\n-- If the length of the intersection is a prime number, return \"YES\",\n-- otherwise, return \"NO\".\n-- If the two intervals don't intersect, return \"NO\".\n-- [input/output] samples:\n-- >>> intersection({1, 2}, {2, 3})\n-- 'NO'\n-- >>> intersection({-1, 1}, {0, 4})\n-- 'NO'\n-- >>> intersection({-3, -1}, {-5, 5})\n-- 'YES'\nlocal function intersection(interval1, interval2)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = intersection\n lu.assertEquals(candidate({1, 2}, {2, 3}), 'NO')\n lu.assertEquals(candidate({-1, 1}, {0, 4}), 'NO')\n lu.assertEquals(candidate({-3, -1}, {-5, 5}), 'YES')\n lu.assertEquals(candidate({-2, 2}, {-4, 0}), 'YES')\n lu.assertEquals(candidate({-11, 2}, {-1, -1}), 'NO')\n lu.assertEquals(candidate({1, 2}, {3, 5}), 'NO')\n lu.assertEquals(candidate({1, 2}, {1, 2}), 'NO')\n lu.assertEquals(candidate({-2, -2}, {-3, -2}), 'NO')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "lua", - "prompt": "-- Return the largest prime factor of n. Assume n > 1 and is not a prime.\n-- >>> largest_prime_factor(13195)\n-- 29\n-- >>> largest_prime_factor(2048)\n-- 2\nlocal function largest_prime_factor(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = largest_prime_factor\n lu.assertEquals(candidate(15), 5)\n lu.assertEquals(candidate(27), 3)\n lu.assertEquals(candidate(63), 7)\n lu.assertEquals(candidate(330), 11)\n lu.assertEquals(candidate(13195), 29)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "lua", - "prompt": "-- Given a string, find out how many distinct characters (regardless of case) does it consist of\n-- >>> count_distinct_characters('xyzXYZ')\n-- 3\n-- >>> count_distinct_characters('Jerry')\n-- 4\nlocal function count_distinct_characters(string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = count_distinct_characters\n lu.assertEquals(candidate(''), 0)\n lu.assertEquals(candidate('abcde'), 5)\n lu.assertEquals(candidate('abcdecadeCADE'), 5)\n lu.assertEquals(candidate('aaaaAAAAaaaa'), 1)\n lu.assertEquals(candidate('Jerry jERRY JeRRRY'), 5)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "lua", - "prompt": "-- You're given a table of deposit and withdrawal operations on a bank account that starts with\n-- zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n-- at that point function should return true. Otherwise it should return false.\n-- >>> below_zero({1, 2, 3})\n-- false\n-- >>> below_zero({1, 2, -4, 5})\n-- true\nlocal function below_zero(operations)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = below_zero\n lu.assertEquals(candidate({}), false)\n lu.assertEquals(candidate({1, 2, -3, 1, 2, -3}), false)\n lu.assertEquals(candidate({1, 2, -4, 5, 6}), true)\n lu.assertEquals(candidate({1, -1, 2, -2, 5, -5, 4, -4}), false)\n lu.assertEquals(candidate({1, -1, 2, -2, 5, -5, 4, -5}), true)\n lu.assertEquals(candidate({1, -2, 2, -2, 5, -5, 4, -4}), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "lua", - "prompt": "-- Find the shortest palindrome that begins with a supplied string.\n-- Algorithm idea is simple:\n-- - Find the longest postfix of supplied string that is a palindrome.\n-- - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n-- >>> make_palindrome('')\n-- ''\n-- >>> make_palindrome('cat')\n-- 'catac'\n-- >>> make_palindrome('cata')\n-- 'catac'\nlocal function make_palindrome(string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = make_palindrome\n lu.assertEquals(candidate(''), '')\n lu.assertEquals(candidate('x'), 'x')\n lu.assertEquals(candidate('xyz'), 'xyzyx')\n lu.assertEquals(candidate('xyx'), 'xyx')\n lu.assertEquals(candidate('jerry'), 'jerryrrej')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "lua", - "prompt": "-- Given a positive integer, obtain its roman numeral equivalent as a string,\n-- and return it in lowercase.\n-- Restrictions: 1 <= num <= 1000\n-- Examples:\n-- >>> int_to_mini_roman(19)\n-- 'xix'\n-- >>> int_to_mini_roman(152)\n-- 'clii'\n-- >>> int_to_mini_roman(426)\n-- 'cdxxvi'\nlocal function int_to_mini_roman(number)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "reworded", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = int_to_mini_roman\n lu.assertEquals(candidate(19), 'xix')\n lu.assertEquals(candidate(152), 'clii')\n lu.assertEquals(candidate(251), 'ccli')\n lu.assertEquals(candidate(426), 'cdxxvi')\n lu.assertEquals(candidate(500), 'd')\n lu.assertEquals(candidate(1), 'i')\n lu.assertEquals(candidate(4), 'iv')\n lu.assertEquals(candidate(43), 'xliii')\n lu.assertEquals(candidate(90), 'xc')\n lu.assertEquals(candidate(94), 'xciv')\n lu.assertEquals(candidate(532), 'dxxxii')\n lu.assertEquals(candidate(900), 'cm')\n lu.assertEquals(candidate(994), 'cmxciv')\n lu.assertEquals(candidate(1000), 'm')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - } -] \ No newline at end of file diff --git a/data/lua-transform.json b/data/lua-transform.json deleted file mode 100644 index 50cda83c67b6aba36a92edd313dc64633361c0ef..0000000000000000000000000000000000000000 --- a/data/lua-transform.json +++ /dev/null @@ -1,2417 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "lua", - "prompt": "-- For a given number n, find the largest number that divides n evenly, smaller than n\n-- >>> largest_divisor(15)\n-- 5\nlocal function largest_divisor(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = largest_divisor\n lu.assertEquals(candidate(3), 1)\n lu.assertEquals(candidate(7), 1)\n lu.assertEquals(candidate(10), 5)\n lu.assertEquals(candidate(100), 50)\n lu.assertEquals(candidate(49), 7)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_47_median", - "language": "lua", - "prompt": "-- Return median of elements in the list l.\n-- >>> median({3, 1, 2, 4, 5})\n-- 3\n-- >>> median({-10, 4, 6, 1000, 10, 20})\n-- 15.0\nlocal function median(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = median\n lu.assertEquals(candidate({3, 1, 2, 4, 5}), 3)\n lu.assertEquals(candidate({-10, 4, 6, 1000, 10, 20}), 8.0)\n lu.assertEquals(candidate({5}), 5)\n lu.assertEquals(candidate({6, 5}), 5.5)\n lu.assertEquals(candidate({8, 1, 3, 9, 9, 2, 7}), 7)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "lua", - "prompt": "-- Given two lists operator, and operand. The first list has basic algebra operations, and \n-- the second list is a list of integers. Use the two given lists to build the algebric \n-- expression and return the evaluation of this expression.\n-- The basic algebra operations:\n-- Addition ( + ) \n-- Subtraction ( - ) \n-- Multiplication ( * ) \n-- Floor division ( // ) \n-- Exponentiation ( ** ) \n-- Example:\n-- operator['+', '*', '-']\n-- array = [2, 3, 4, 5]\n-- result = 2 + 3 * 4 - 5\n-- => result = 9\n-- Note:\n-- The length of operator list is equal to the length of operand list minus one.\n-- Operand is a list of of non-negative integers.\n-- Operator list has at least one operator, and operand list has at least two operands.\nlocal function do_algebra(operator, operand)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = do_algebra\n lu.assertEquals(candidate({'**', '*', '+'}, {2, 3, 4, 5}), 37)\n lu.assertEquals(candidate({'+', '*', '-'}, {2, 3, 4, 5}), 9)\n lu.assertEquals(candidate({'//', '*'}, {7, 3, 4}), 8)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "lua", - "prompt": "-- Return maximum element in the list.\n-- >>> max_element({1, 2, 3})\n-- 3\n-- >>> max_element({5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10})\n-- 123\nlocal function max_element(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = max_element\n lu.assertEquals(candidate({1, 2, 3}), 3)\n lu.assertEquals(candidate({5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10}), 124)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "lua", - "prompt": "-- Create a function which returns the largest index of an element which\n-- is not greater than or equal to the element immediately preceding it. If\n-- no such element exists then return -1. The given array will not contain\n-- duplicate values.\n-- Examples:\n-- >>> can_arrange({1, 2, 4, 3, 5})\n-- 3\n-- >>> can_arrange({1, 2, 3})\n-- -1\nlocal function can_arrange(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = can_arrange\n lu.assertEquals(candidate({1, 2, 4, 3, 5}), 3)\n lu.assertEquals(candidate({1, 2, 4, 5}), -1)\n lu.assertEquals(candidate({1, 4, 2, 5, 6, 7, 8, 9, 10}), 2)\n lu.assertEquals(candidate({4, 8, 5, 7, 3}), 4)\n lu.assertEquals(candidate({}), -1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "lua", - "prompt": "-- Imagine a road that's a perfectly straight infinitely long line.\n-- n cars are driving left to right; simultaneously, a different set of n cars\n-- are driving right to left. The two sets of cars start out being very far from\n-- each other. All cars move in the same speed. Two cars are said to collide\n-- when a car that's moving left to right hits a car that's moving right to left.\n-- However, the cars are infinitely sturdy and strong; as a result, they continue moving\n-- in their trajectory as if they did not collide.\n-- This function outputs the number of such collisions.\nlocal function car_race_collision(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = car_race_collision\n lu.assertEquals(candidate(2), 4)\n lu.assertEquals(candidate(3), 9)\n lu.assertEquals(candidate(4), 16)\n lu.assertEquals(candidate(8), 64)\n lu.assertEquals(candidate(10), 100)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "lua", - "prompt": "-- Create a function that returns True if the last character\n-- of a given string is an alphabetical character and is not\n-- a part of a word, and False otherwise.\n-- Note: \"word\" is a group of characters separated by space.\n-- Examples:\n-- >>> check_if_last_char_is_a_letter('apple pie')\n-- false\n-- >>> check_if_last_char_is_a_letter('apple pi e')\n-- true\n-- >>> check_if_last_char_is_a_letter('apple pi e ')\n-- false\n-- >>> check_if_last_char_is_a_letter('')\n-- false\nlocal function check_if_last_char_is_a_letter(txt)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = check_if_last_char_is_a_letter\n lu.assertEquals(candidate('apple'), false)\n lu.assertEquals(candidate('apple pi e'), true)\n lu.assertEquals(candidate('eeeee'), false)\n lu.assertEquals(candidate('A'), true)\n lu.assertEquals(candidate('Pumpkin pie '), false)\n lu.assertEquals(candidate('Pumpkin pie 1'), false)\n lu.assertEquals(candidate(''), false)\n lu.assertEquals(candidate('eeeee e '), false)\n lu.assertEquals(candidate('apple pie'), false)\n lu.assertEquals(candidate('apple pi e '), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "lua", - "prompt": "-- Return true if a given number is prime, and false otherwise.\n-- >>> is_prime(6)\n-- false\n-- >>> is_prime(101)\n-- true\n-- >>> is_prime(11)\n-- true\n-- >>> is_prime(13441)\n-- true\n-- >>> is_prime(61)\n-- true\n-- >>> is_prime(4)\n-- false\n-- >>> is_prime(1)\n-- false\nlocal function is_prime(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_prime\n lu.assertEquals(candidate(6), false)\n lu.assertEquals(candidate(101), true)\n lu.assertEquals(candidate(11), true)\n lu.assertEquals(candidate(13441), true)\n lu.assertEquals(candidate(61), true)\n lu.assertEquals(candidate(4), false)\n lu.assertEquals(candidate(1), false)\n lu.assertEquals(candidate(5), true)\n lu.assertEquals(candidate(11), true)\n lu.assertEquals(candidate(17), true)\n lu.assertEquals(candidate(85), false)\n lu.assertEquals(candidate(77), false)\n lu.assertEquals(candidate(255379), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "lua", - "prompt": "-- Given a list of positive integers x. return a sorted list of all \n-- elements that hasn't any even digit.\n-- Note: Returned list should be sorted in increasing order.\n-- For example:\n-- >>> unique_digits({15, 33, 1422, 1})\n-- {1, 15, 33}\n-- >>> unique_digits({152, 323, 1422, 10})\n-- {}\nlocal function unique_digits(x)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = unique_digits\n lu.assertEquals(candidate({15, 33, 1422, 1}), {1, 15, 33})\n lu.assertEquals(candidate({152, 323, 1422, 10}), {})\n lu.assertEquals(candidate({12345, 2033, 111, 151}), {111, 151})\n lu.assertEquals(candidate({135, 103, 31}), {31, 135})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "lua", - "prompt": "-- Input are two strings a and b consisting only of 1s and 0s.\n-- Perform binary XOR on these inputs and return result also as a string.\n-- >>> string_xor('010', '110')\n-- '100'\nlocal function string_xor(a, b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = string_xor\n lu.assertEquals(candidate('111000', '101010'), '010010')\n lu.assertEquals(candidate('1', '1'), '0')\n lu.assertEquals(candidate('0101', '0000'), '0101')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "lua", - "prompt": "-- sum_to_n is a function that sums numbers from 1 to n.\n-- >>> sum_to_n(30)\n-- 465\n-- >>> sum_to_n(100)\n-- 5050\n-- >>> sum_to_n(5)\n-- 15\n-- >>> sum_to_n(10)\n-- 55\n-- >>> sum_to_n(1)\n-- 1\nlocal function sum_to_n(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sum_to_n\n lu.assertEquals(candidate(1), 1)\n lu.assertEquals(candidate(6), 21)\n lu.assertEquals(candidate(11), 66)\n lu.assertEquals(candidate(30), 465)\n lu.assertEquals(candidate(100), 5050)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "lua", - "prompt": "-- Given a list of numbers, return the sum of squares of the numbers\n-- in the list that are odd. Ignore numbers that are negative or not integers.\n-- >>> double_the_difference({1, 3, 2, 0})\n-- 10\n-- >>> double_the_difference({-1, -2, 0})\n-- 0\n-- >>> double_the_difference({9, -2})\n-- 81\n-- >>> double_the_difference({0})\n-- 0\n-- If the input list is empty, return 0.\nlocal function double_the_difference(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = double_the_difference\n lu.assertEquals(candidate({}), 0)\n lu.assertEquals(candidate({5.0, 4.0}), 25)\n lu.assertEquals(candidate({0.1, 0.2, 0.3}), 0)\n lu.assertEquals(candidate({-10.0, -20.0, -30.0}), 0)\n lu.assertEquals(candidate({-1.0, -2.0, 8.0}), 0)\n lu.assertEquals(candidate({0.2, 3.0, 5.0}), 34)\n lu.assertEquals(candidate({-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0}), 165)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "lua", - "prompt": "-- Return length of given string\n-- >>> strlen('')\n-- 0\n-- >>> strlen('abc')\n-- 3\nlocal function strlen(string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = strlen\n lu.assertEquals(candidate(''), 0)\n lu.assertEquals(candidate('x'), 1)\n lu.assertEquals(candidate('asdasnakj'), 9)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "lua", - "prompt": "-- You'll be given a string of words, and your task is to count the number\n-- of boredoms. A boredom is a sentence that starts with the word \"I\".\n-- Sentences are delimited by '.', '?' or '!'.\n-- For example:\n-- >>> is_bored('Hello world')\n-- 0\n-- >>> is_bored('The sky is blue. The sun is shining. I love this weather')\n-- 1\nlocal function is_bored(S)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_bored\n lu.assertEquals(candidate('Hello world'), 0)\n lu.assertEquals(candidate('Is the sky blue?'), 0)\n lu.assertEquals(candidate('I love It !'), 1)\n lu.assertEquals(candidate('bIt'), 0)\n lu.assertEquals(candidate('I feel good today. I will be productive. will kill It'), 2)\n lu.assertEquals(candidate('You and I are going for a walk'), 0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "lua", - "prompt": "-- Write a function vowels_count which takes a string representing\n-- a word as input and returns the number of vowels in the string.\n-- Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n-- vowel, but only when it is at the end of the given word.\n-- Example:\n-- >>> vowels_count('abcde')\n-- 2\n-- >>> vowels_count('ACEDY')\n-- 3\nlocal function vowels_count(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = vowels_count\n lu.assertEquals(candidate('abcde'), 2)\n lu.assertEquals(candidate('Alone'), 3)\n lu.assertEquals(candidate('key'), 2)\n lu.assertEquals(candidate('bye'), 1)\n lu.assertEquals(candidate('keY'), 2)\n lu.assertEquals(candidate('bYe'), 1)\n lu.assertEquals(candidate('ACEDY'), 3)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "lua", - "prompt": "-- Return n-th Fibonacci number.\n-- >>> fib(10)\n-- 55\n-- >>> fib(1)\n-- 1\n-- >>> fib(8)\n-- 21\nlocal function fib(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = fib\n lu.assertEquals(candidate(10), 55)\n lu.assertEquals(candidate(1), 1)\n lu.assertEquals(candidate(8), 21)\n lu.assertEquals(candidate(11), 89)\n lu.assertEquals(candidate(12), 144)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "lua", - "prompt": "-- Your task is to implement a function that will simplify the expression\n-- x * n. The function returns True if x * n evaluates to a whole number and False\n-- otherwise. Both x and n, are string representation of a fraction, and have the following format,\n-- / where both numerator and denominator are positive whole numbers.\n-- You can assume that x, and n are valid fractions, and do not have zero as denominator.\n-- >>> simplify('1/5', '5/1')\n-- true\n-- >>> simplify('1/6', '2/1')\n-- false\n-- >>> simplify('7/10', '10/2')\n-- false\nlocal function simplify(x, n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = simplify\n lu.assertEquals(candidate('1/5', '5/1'), true)\n lu.assertEquals(candidate('1/6', '2/1'), false)\n lu.assertEquals(candidate('5/1', '3/1'), true)\n lu.assertEquals(candidate('7/10', '10/2'), false)\n lu.assertEquals(candidate('2/10', '50/10'), true)\n lu.assertEquals(candidate('7/2', '4/2'), true)\n lu.assertEquals(candidate('11/6', '6/1'), true)\n lu.assertEquals(candidate('2/3', '5/2'), false)\n lu.assertEquals(candidate('5/2', '3/5'), false)\n lu.assertEquals(candidate('2/4', '8/4'), true)\n lu.assertEquals(candidate('2/4', '4/2'), true)\n lu.assertEquals(candidate('1/5', '5/1'), true)\n lu.assertEquals(candidate('1/5', '1/5'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "lua", - "prompt": "-- Given a string s, count the number of uppercase vowels in even indices.\n-- For example:\n-- >>> count_upper('aBCdEf')\n-- 1\n-- >>> count_upper('abcdefg')\n-- 0\n-- >>> count_upper('dBBE')\n-- 0\nlocal function count_upper(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = count_upper\n lu.assertEquals(candidate('aBCdEf'), 1)\n lu.assertEquals(candidate('abcdefg'), 0)\n lu.assertEquals(candidate('dBBE'), 0)\n lu.assertEquals(candidate('B'), 0)\n lu.assertEquals(candidate('U'), 1)\n lu.assertEquals(candidate(''), 0)\n lu.assertEquals(candidate('EEEE'), 2)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "lua", - "prompt": "-- You are given a rectangular grid of wells. Each row represents a single well,\n-- and each 1 in a row represents a single unit of water.\n-- Each well has a corresponding bucket that can be used to extract water from it, \n-- and all buckets have the same capacity.\n-- Your task is to use the buckets to empty the wells.\n-- Output the number of times you need to lower the buckets.\n-- Example 1:\n-- >>> max_fill({{0, 0, 1, 0}, {0, 1, 0, 0}, {1, 1, 1, 1}}, 1)\n-- 6\n-- Example 2:\n-- >>> max_fill({{0, 0, 1, 1}, {0, 0, 0, 0}, {1, 1, 1, 1}, {0, 1, 1, 1}}, 2)\n-- 5\n-- Example 3:\n-- >>> max_fill({{0, 0, 0}, {0, 0, 0}}, 5)\n-- 0\n-- Constraints:\n-- * all wells have the same length\n-- * 1 <= grid.length <= 10^2\n-- * 1 <= grid[:,1].length <= 10^2\n-- * grid[i][j] -> 0 | 1\n-- * 1 <= capacity <= 10\nlocal function max_fill(grid, capacity)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = max_fill\n lu.assertEquals(candidate({{0, 0, 1, 0}, {0, 1, 0, 0}, {1, 1, 1, 1}}, 1), 6)\n lu.assertEquals(candidate({{0, 0, 1, 1}, {0, 0, 0, 0}, {1, 1, 1, 1}, {0, 1, 1, 1}}, 2), 5)\n lu.assertEquals(candidate({{0, 0, 0}, {0, 0, 0}}, 5), 0)\n lu.assertEquals(candidate({{1, 1, 1, 1}, {1, 1, 1, 1}}, 2), 4)\n lu.assertEquals(candidate({{1, 1, 1, 1}, {1, 1, 1, 1}}, 9), 2)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "lua", - "prompt": "-- Given an array arr of integers and a positive integer k, return a sorted list \n-- of length k with the maximum k numbers in arr.\n-- Example 1:\n-- >>> maximum({-3, -4, 5}, 3)\n-- {-4, -3, 5}\n-- Example 2:\n-- >>> maximum({4, -4, 4}, 2)\n-- {4, 4}\n-- Example 3:\n-- >>> maximum({-3, 2, 1, 2, -1, -2, 1}, 1)\n-- {2}\n-- Note:\n-- 1. The length of the array will be in the range of [1, 1000].\n-- 2. The elements in the array will be in the range of [-1000, 1000].\n-- 3. 0 <= k <= len(arr)\nlocal function maximum(arr, k)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = maximum\n lu.assertEquals(candidate({-3, -4, 5}, 3), {-4, -3, 5})\n lu.assertEquals(candidate({4, -4, 4}, 2), {4, 4})\n lu.assertEquals(candidate({-3, 2, 1, 2, -1, -2, 1}, 1), {2})\n lu.assertEquals(candidate({123, -123, 20, 0, 1, 2, -3}, 3), {2, 20, 123})\n lu.assertEquals(candidate({-123, 20, 0, 1, 2, -3}, 4), {0, 1, 2, 20})\n lu.assertEquals(candidate({5, 15, 0, 3, -13, -8, 0}, 7), {-13, -8, 0, 0, 3, 5, 15})\n lu.assertEquals(candidate({-1, 0, 2, 5, 3, -10}, 2), {3, 5})\n lu.assertEquals(candidate({1, 0, 5, -7}, 1), {5})\n lu.assertEquals(candidate({4, -4}, 2), {-4, 4})\n lu.assertEquals(candidate({-10, 10}, 2), {-10, 10})\n lu.assertEquals(candidate({1, 2, 3, -23, 243, -400, 0}, 0), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "lua", - "prompt": "-- Write a function that takes a message, and encodes in such a \n-- way that it swaps case of all letters, replaces all vowels in \n-- the message with the letter that appears 2 places ahead of that \n-- vowel in the english alphabet. \n-- Assume only letters. \n-- Examples:\n-- >>> encode('test')\n-- 'TGST'\n-- >>> encode('This is a message')\n-- 'tHKS KS C MGSSCGG'\nlocal function encode(message)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = encode\n lu.assertEquals(candidate('TEST'), 'tgst')\n lu.assertEquals(candidate('Mudasir'), 'mWDCSKR')\n lu.assertEquals(candidate('YES'), 'ygs')\n lu.assertEquals(candidate('This is a message'), 'tHKS KS C MGSSCGG')\n lu.assertEquals(candidate('I DoNt KnOw WhAt tO WrItE'), 'k dQnT kNqW wHcT Tq wRkTg')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "lua", - "prompt": "-- remove_vowels is a function that takes string and returns string without vowels.\n-- >>> remove_vowels('')\n-- ''\n-- >>> remove_vowels('abcdef')\n-- 'bcdf'\n-- >>> remove_vowels('aaaaa')\n-- ''\n-- >>> remove_vowels('aaBAA')\n-- 'B'\n-- >>> remove_vowels('zbcd')\n-- 'zbcd'\nlocal function remove_vowels(text)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = remove_vowels\n lu.assertEquals(candidate(''), '')\n lu.assertEquals(candidate('abcdef\\nghijklm'), 'bcdf\\nghjklm')\n lu.assertEquals(candidate('fedcba'), 'fdcb')\n lu.assertEquals(candidate('eeeee'), '')\n lu.assertEquals(candidate('acBAA'), 'cB')\n lu.assertEquals(candidate('EcBOO'), 'cB')\n lu.assertEquals(candidate('ybcd'), 'ybcd')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "lua", - "prompt": "-- Return only positive numbers in the list.\n-- >>> get_positive({-1, 2, -4, 5, 6})\n-- {2, 5, 6}\n-- >>> get_positive({5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10})\n-- {5, 3, 2, 3, 9, 123, 1}\nlocal function get_positive(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = get_positive\n lu.assertEquals(candidate({-1, -2, 4, 5, 6}), {4, 5, 6})\n lu.assertEquals(candidate({5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10}), {5, 3, 2, 3, 3, 9, 123, 1})\n lu.assertEquals(candidate({-1, -2}), {})\n lu.assertEquals(candidate({}), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "lua", - "prompt": "-- Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n-- >>> string_sequence(0)\n-- '0'\n-- >>> string_sequence(5)\n-- '0 1 2 3 4 5'\nlocal function string_sequence(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = string_sequence\n lu.assertEquals(candidate(0), '0')\n lu.assertEquals(candidate(3), '0 1 2 3')\n lu.assertEquals(candidate(10), '0 1 2 3 4 5 6 7 8 9 10')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "lua", - "prompt": "-- Given a positive integer n, you have to make a pile of n levels of stones.\n-- The first level has n stones.\n-- The number of stones in the next level is:\n-- - the next odd number if n is odd.\n-- - the next even number if n is even.\n-- Return the number of stones in each level in a list, where element at index\n-- i represents the number of stones in the level (i+1).\n-- Examples:\n-- >>> make_a_pile(3)\n-- {3, 5, 7}\nlocal function make_a_pile(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = make_a_pile\n lu.assertEquals(candidate(3), {3, 5, 7})\n lu.assertEquals(candidate(4), {4, 6, 8, 10})\n lu.assertEquals(candidate(5), {5, 7, 9, 11, 13})\n lu.assertEquals(candidate(6), {6, 8, 10, 12, 14, 16})\n lu.assertEquals(candidate(8), {8, 10, 12, 14, 16, 18, 20, 22})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "lua", - "prompt": "-- Task\n-- 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\n-- then check if the result string is palindrome.\n-- A string is called palindrome if it reads the same backward as forward.\n-- You should return a tuple containing the result string and True/False for the check.\n-- Example\n-- >>> reverse_delete('abcde', 'ae')\n-- {'bcd', false}\n-- >>> reverse_delete('abcdef', 'b')\n-- {'acdef', false}\n-- >>> reverse_delete('abcdedcba', 'ab')\n-- {'cdedc', true}\nlocal function reverse_delete(s, c)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = reverse_delete\n lu.assertEquals(candidate('abcde', 'ae'), {'bcd', false})\n lu.assertEquals(candidate('abcdef', 'b'), {'acdef', false})\n lu.assertEquals(candidate('abcdedcba', 'ab'), {'cdedc', true})\n lu.assertEquals(candidate('dwik', 'w'), {'dik', false})\n lu.assertEquals(candidate('a', 'a'), {'', true})\n lu.assertEquals(candidate('abcdedcba', ''), {'abcdedcba', true})\n lu.assertEquals(candidate('abcdedcba', 'v'), {'abcdedcba', true})\n lu.assertEquals(candidate('vabba', 'v'), {'abba', true})\n lu.assertEquals(candidate('mamma', 'mia'), {'', true})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "lua", - "prompt": "-- For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n-- >>> flip_case('Hello')\n-- 'hELLO'\nlocal function flip_case(string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = flip_case\n lu.assertEquals(candidate(''), '')\n lu.assertEquals(candidate('Hello!'), 'hELLO!')\n lu.assertEquals(candidate('These violent delights have violent ends'), 'tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "lua", - "prompt": "-- You are given a string s.\n-- if s[i] is a letter, reverse its case from lower to upper or vise versa, \n-- otherwise keep it as it is.\n-- If the string contains no letters, reverse the string.\n-- The function should return the resulted string.\n-- Examples\n-- >>> solve('1234')\n-- '4321'\n-- >>> solve('ab')\n-- 'AB'\n-- >>> solve('#a@C')\n-- '#A@c'\nlocal function solve(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = solve\n lu.assertEquals(candidate('AsDf'), 'aSdF')\n lu.assertEquals(candidate('1234'), '4321')\n lu.assertEquals(candidate('ab'), 'AB')\n lu.assertEquals(candidate('#a@C'), '#A@c')\n lu.assertEquals(candidate('#AsdfW^45'), '#aSDFw^45')\n lu.assertEquals(candidate('#6@2'), '2@6#')\n lu.assertEquals(candidate('#$a^D'), '#$A^d')\n lu.assertEquals(candidate('#ccc'), '#CCC')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "lua", - "prompt": "-- Filter an input list of strings only for ones that start with a given prefix.\n-- >>> filter_by_prefix({}, 'a')\n-- {}\n-- >>> filter_by_prefix({'abc', 'bcd', 'cde', 'array'}, 'a')\n-- {'abc', 'array'}\nlocal function filter_by_prefix(strings, prefix)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = filter_by_prefix\n lu.assertEquals(candidate({}, 'john'), {})\n lu.assertEquals(candidate({'xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'}, 'xxx'), {'xxx', 'xxxAAA', 'xxx'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "lua", - "prompt": "-- This function takes two positive numbers x and y and returns the\n-- biggest even integer number that is in the range [x, y] inclusive. If \n-- there's no such number, then the function should return -1.\n-- For example:\n-- >>> choose_num(12, 15)\n-- 14\n-- >>> choose_num(13, 12)\n-- -1\nlocal function choose_num(x, y)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = choose_num\n lu.assertEquals(candidate(12, 15), 14)\n lu.assertEquals(candidate(13, 12), -1)\n lu.assertEquals(candidate(33, 12354), 12354)\n lu.assertEquals(candidate(5234, 5233), -1)\n lu.assertEquals(candidate(6, 29), 28)\n lu.assertEquals(candidate(27, 10), -1)\n lu.assertEquals(candidate(7, 7), -1)\n lu.assertEquals(candidate(546, 546), 546)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "lua", - "prompt": "-- You are given a string representing a sentence,\n-- the sentence contains some words separated by a space,\n-- and you have to return a string that contains the words from the original sentence,\n-- whose lengths are prime numbers,\n-- the order of the words in the new string should be the same as the original one.\n-- Example 1:\n-- >>> words_in_sentence('This is a test')\n-- 'is'\n-- Example 2:\n-- >>> words_in_sentence('lets go for swimming')\n-- 'go for'\n-- Constraints:\n-- * 1 <= len(sentence) <= 100\n-- * sentence contains only letters\nlocal function words_in_sentence(sentence)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = words_in_sentence\n lu.assertEquals(candidate('This is a test'), 'is')\n lu.assertEquals(candidate('lets go for swimming'), 'go for')\n lu.assertEquals(candidate('there is no place available here'), 'there is no place')\n lu.assertEquals(candidate('Hi I am Hussein'), 'Hi am Hussein')\n lu.assertEquals(candidate('go for it'), 'go for it')\n lu.assertEquals(candidate('here'), '')\n lu.assertEquals(candidate('here is'), 'is')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "lua", - "prompt": "-- Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n-- >>> intersperse({}, 4)\n-- {}\n-- >>> intersperse({1, 2, 3}, 4)\n-- {1, 4, 2, 4, 3}\nlocal function intersperse(numbers, delimeter)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = intersperse\n lu.assertEquals(candidate({}, 7), {})\n lu.assertEquals(candidate({5, 6, 3, 2}, 8), {5, 8, 6, 8, 3, 8, 2})\n lu.assertEquals(candidate({2, 2, 2}, 2), {2, 2, 2, 2, 2})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "lua", - "prompt": "-- Your task is to write a function that returns true if a number x is a simple\n-- power of n and false in other cases.\n-- x is a simple power of n if n**int=x\n-- For example:\n-- >>> is_simple_power(1, 4)\n-- true\n-- >>> is_simple_power(2, 2)\n-- true\n-- >>> is_simple_power(8, 2)\n-- true\n-- >>> is_simple_power(3, 2)\n-- false\n-- >>> is_simple_power(3, 1)\n-- false\n-- >>> is_simple_power(5, 3)\n-- false\nlocal function is_simple_power(x, n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_simple_power\n lu.assertEquals(candidate(16, 2), true)\n lu.assertEquals(candidate(143214, 16), false)\n lu.assertEquals(candidate(4, 2), true)\n lu.assertEquals(candidate(9, 3), true)\n lu.assertEquals(candidate(16, 4), true)\n lu.assertEquals(candidate(24, 2), false)\n lu.assertEquals(candidate(128, 4), false)\n lu.assertEquals(candidate(12, 6), false)\n lu.assertEquals(candidate(1, 1), true)\n lu.assertEquals(candidate(1, 12), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "lua", - "prompt": "-- Write a function that returns true if the given number is the multiplication of 3 prime numbers\n-- and false otherwise.\n-- Knowing that (a) is less then 100. \n-- Example:\n-- >>> is_multiply_prime(30)\n-- true\n-- 30 = 2 * 3 * 5\nlocal function is_multiply_prime(a)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_multiply_prime\n lu.assertEquals(candidate(5), false)\n lu.assertEquals(candidate(30), true)\n lu.assertEquals(candidate(8), true)\n lu.assertEquals(candidate(10), false)\n lu.assertEquals(candidate(125), true)\n lu.assertEquals(candidate(105), true)\n lu.assertEquals(candidate(126), false)\n lu.assertEquals(candidate(729), false)\n lu.assertEquals(candidate(891), false)\n lu.assertEquals(candidate(1001), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "lua", - "prompt": "-- Given the lengths of the three sides of a triangle. Return True if the three\n-- sides form a right-angled triangle, False otherwise.\n-- A right-angled triangle is a triangle in which one angle is right angle or \n-- 90 degree.\n-- Example:\n-- >>> right_angle_triangle(3, 4, 5)\n-- true\n-- >>> right_angle_triangle(1, 2, 3)\n-- false\nlocal function right_angle_triangle(a, b, c)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = right_angle_triangle\n lu.assertEquals(candidate(3, 4, 5), true)\n lu.assertEquals(candidate(1, 2, 3), false)\n lu.assertEquals(candidate(10, 6, 8), true)\n lu.assertEquals(candidate(2, 2, 2), false)\n lu.assertEquals(candidate(7, 24, 25), true)\n lu.assertEquals(candidate(10, 5, 7), false)\n lu.assertEquals(candidate(5, 12, 13), true)\n lu.assertEquals(candidate(15, 8, 17), true)\n lu.assertEquals(candidate(48, 55, 73), true)\n lu.assertEquals(candidate(1, 1, 1), false)\n lu.assertEquals(candidate(2, 2, 10), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "lua", - "prompt": "-- Create a function that takes 3 numbers.\n-- Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n-- Returns false in any other cases.\n-- Examples\n-- >>> any_int(5, 2, 7)\n-- true\n-- >>> any_int(3, 2, 2)\n-- false\n-- >>> any_int(3, -2, 1)\n-- true\n-- >>> any_int(3.6, -2.2, 2)\n-- false\nlocal function any_int(x, y, z)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = any_int\n lu.assertEquals(candidate(2, 3, 1), true)\n lu.assertEquals(candidate(2.5, 2, 3), false)\n lu.assertEquals(candidate(1.5, 5, 3.5), false)\n lu.assertEquals(candidate(2, 6, 2), false)\n lu.assertEquals(candidate(4, 2, 2), true)\n lu.assertEquals(candidate(2.2, 2.2, 2.2), false)\n lu.assertEquals(candidate(-4, 6, 2), true)\n lu.assertEquals(candidate(2, 1, 1), true)\n lu.assertEquals(candidate(3, 4, 7), true)\n lu.assertEquals(candidate(3.0, 4, 7), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "lua", - "prompt": "-- This function takes a list l and returns a list l' such that\n-- l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n-- to the values of the corresponding indicies of l, but sorted.\n-- >>> sort_third({1, 2, 3})\n-- {1, 2, 3}\n-- >>> sort_third({5, 6, 3, 4, 8, 9, 2})\n-- {2, 6, 3, 4, 8, 9, 5}\nlocal function sort_third(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sort_third\n lu.assertEquals(candidate({5, 6, 3, 4, 8, 9, 2}), {2, 6, 3, 4, 8, 9, 5})\n lu.assertEquals(candidate({5, 8, 3, 4, 6, 9, 2}), {2, 8, 3, 4, 6, 9, 5})\n lu.assertEquals(candidate({5, 6, 9, 4, 8, 3, 2}), {2, 6, 9, 4, 8, 3, 5})\n lu.assertEquals(candidate({5, 6, 3, 4, 8, 9, 2, 1}), {2, 6, 3, 4, 8, 9, 5, 1})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_53_add", - "language": "lua", - "prompt": "-- Add two numbers x and y\n-- >>> add(2, 3)\n-- 5\n-- >>> add(5, 7)\n-- 12\nlocal function add(x, y)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = add\n lu.assertEquals(candidate(0, 1), 1)\n lu.assertEquals(candidate(1, 0), 1)\n lu.assertEquals(candidate(2, 3), 5)\n lu.assertEquals(candidate(5, 7), 12)\n lu.assertEquals(candidate(7, 5), 12)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_69_search", - "language": "lua", - "prompt": "-- You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n-- zero, and has a frequency greater than or equal to the value of the integer itself. \n-- The frequency of an integer is the number of times it appears in the list.\n-- If no such a value exist, return -1.\n-- Examples:\n-- >>> search({4, 1, 2, 2, 3, 1})\n-- 2\n-- >>> search({1, 2, 2, 3, 3, 3, 4, 4, 4})\n-- 3\n-- >>> search({5, 5, 4, 4, 4})\n-- -1\nlocal function search(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = search\n lu.assertEquals(candidate({5, 5, 5, 5, 1}), 1)\n lu.assertEquals(candidate({4, 1, 4, 1, 4, 4}), 4)\n lu.assertEquals(candidate({3, 3}), -1)\n lu.assertEquals(candidate({8, 8, 8, 8, 8, 8, 8, 8}), 8)\n lu.assertEquals(candidate({2, 3, 3, 2, 2}), 2)\n lu.assertEquals(candidate({2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1}), 1)\n lu.assertEquals(candidate({3, 2, 8, 2}), 2)\n lu.assertEquals(candidate({6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10}), 1)\n lu.assertEquals(candidate({8, 8, 3, 6, 5, 6, 4}), -1)\n lu.assertEquals(candidate({6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9}), 1)\n lu.assertEquals(candidate({1, 9, 10, 1, 3}), 1)\n lu.assertEquals(candidate({6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10}), 5)\n lu.assertEquals(candidate({1}), 1)\n lu.assertEquals(candidate({8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5}), 4)\n lu.assertEquals(candidate({2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10}), 2)\n lu.assertEquals(candidate({1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3}), 1)\n lu.assertEquals(candidate({9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4}), 4)\n lu.assertEquals(candidate({2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7}), 4)\n lu.assertEquals(candidate({9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1}), 2)\n lu.assertEquals(candidate({5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8}), -1)\n lu.assertEquals(candidate({10}), -1)\n lu.assertEquals(candidate({9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2}), 2)\n lu.assertEquals(candidate({5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8}), 1)\n lu.assertEquals(candidate({7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6}), 1)\n lu.assertEquals(candidate({3, 10, 10, 9, 2}), -1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "lua", - "prompt": "-- Write a function that takes a string and returns True if the string\n-- length is a prime number or False otherwise\n-- Examples\n-- >>> prime_length('Hello')\n-- true\n-- >>> prime_length('abcdcba')\n-- true\n-- >>> prime_length('kittens')\n-- true\n-- >>> prime_length('orange')\n-- false\nlocal function prime_length(string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = prime_length\n lu.assertEquals(candidate('Hello'), true)\n lu.assertEquals(candidate('abcdcba'), true)\n lu.assertEquals(candidate('kittens'), true)\n lu.assertEquals(candidate('orange'), false)\n lu.assertEquals(candidate('wow'), true)\n lu.assertEquals(candidate('world'), true)\n lu.assertEquals(candidate('MadaM'), true)\n lu.assertEquals(candidate('Wow'), true)\n lu.assertEquals(candidate(''), false)\n lu.assertEquals(candidate('HI'), true)\n lu.assertEquals(candidate('go'), true)\n lu.assertEquals(candidate('gogo'), false)\n lu.assertEquals(candidate('aaaaaaaaaaaaaaa'), false)\n lu.assertEquals(candidate('Madam'), true)\n lu.assertEquals(candidate('M'), false)\n lu.assertEquals(candidate('0'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_58_common", - "language": "lua", - "prompt": "-- Return sorted unique common elements for two lists.\n-- >>> common({1, 4, 3, 34, 653, 2, 5}, {5, 7, 1, 5, 9, 653, 121})\n-- {1, 5, 653}\n-- >>> common({5, 3, 2, 8}, {3, 2})\n-- {2, 3}\nlocal function common(l1, l2)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = common\n lu.assertEquals(candidate({1, 4, 3, 34, 653, 2, 5}, {5, 7, 1, 5, 9, 653, 121}), {1, 5, 653})\n lu.assertEquals(candidate({5, 3, 2, 8}, {3, 2}), {2, 3})\n lu.assertEquals(candidate({4, 3, 2, 8}, {3, 2, 4}), {2, 3, 4})\n lu.assertEquals(candidate({4, 3, 2, 8}, {}), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "lua", - "prompt": "-- The Brazilian factorial is defined as:\n-- brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n-- where n > 0\n-- For example:\n-- >>> special_factorial(4)\n-- 288\n-- The function will receive an integer as input and should return the special\n-- factorial of this integer.\nlocal function special_factorial(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = special_factorial\n lu.assertEquals(candidate(4), 288)\n lu.assertEquals(candidate(5), 34560)\n lu.assertEquals(candidate(7), 125411328000)\n lu.assertEquals(candidate(1), 1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "lua", - "prompt": "-- In this problem, you will implement a function that takes two lists of numbers,\n-- and determines whether it is possible to perform an exchange of elements\n-- between them to make lst1 a list of only even numbers.\n-- There is no limit on the number of exchanged elements between lst1 and lst2.\n-- If it is possible to exchange elements between the lst1 and lst2 to make\n-- all the elements of lst1 to be even, return \"YES\".\n-- Otherwise, return \"NO\".\n-- For example:\n-- >>> exchange({1, 2, 3, 4}, {1, 2, 3, 4})\n-- 'YES'\n-- >>> exchange({1, 2, 3, 4}, {1, 5, 3, 4})\n-- 'NO'\n-- It is assumed that the input lists will be non-empty.\nlocal function exchange(lst1, lst2)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = exchange\n lu.assertEquals(candidate({1, 2, 3, 4}, {1, 2, 3, 4}), 'YES')\n lu.assertEquals(candidate({1, 2, 3, 4}, {1, 5, 3, 4}), 'NO')\n lu.assertEquals(candidate({1, 2, 3, 4}, {2, 1, 4, 3}), 'YES')\n lu.assertEquals(candidate({5, 7, 3}, {2, 6, 4}), 'YES')\n lu.assertEquals(candidate({5, 7, 3}, {2, 6, 3}), 'NO')\n lu.assertEquals(candidate({3, 2, 6, 1, 8, 9}, {3, 5, 5, 1, 1, 1}), 'NO')\n lu.assertEquals(candidate({100, 200}, {200, 200}), 'YES')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "lua", - "prompt": "-- Given a non-empty array of integers arr and an integer k, return\n-- the sum of the elements with at most two digits from the first k elements of arr.\n-- Example:\n-- >>> add_elements({111, 21, 3, 4000, 5, 6, 7, 8, 9}, 4)\n-- 24\n-- Constraints:\n-- 1. 1 <= len(arr) <= 100\n-- 2. 1 <= k <= len(arr)\nlocal function add_elements(arr, k)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = add_elements\n lu.assertEquals(candidate({1, -2, -3, 41, 57, 76, 87, 88, 99}, 3), -4)\n lu.assertEquals(candidate({111, 121, 3, 4000, 5, 6}, 2), 0)\n lu.assertEquals(candidate({11, 21, 3, 90, 5, 6, 7, 8, 9}, 4), 125)\n lu.assertEquals(candidate({111, 21, 3, 4000, 5, 6, 7, 8, 9}, 4), 24)\n lu.assertEquals(candidate({1}, 1), 1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "lua", - "prompt": "-- A simple program which should return the value of x if n is \n-- a prime number and should return the value of y otherwise.\n-- Examples:\n-- >>> x_or_y(7, 34, 12)\n-- 34\n-- >>> x_or_y(15, 8, 5)\n-- 5\nlocal function x_or_y(n, x, y)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = x_or_y\n lu.assertEquals(candidate(7, 34, 12), 34)\n lu.assertEquals(candidate(15, 8, 5), 5)\n lu.assertEquals(candidate(3, 33, 5212), 33)\n lu.assertEquals(candidate(1259, 3, 52), 3)\n lu.assertEquals(candidate(7919, -1, 12), -1)\n lu.assertEquals(candidate(3609, 1245, 583), 583)\n lu.assertEquals(candidate(91, 56, 129), 129)\n lu.assertEquals(candidate(6, 34, 1234), 1234)\n lu.assertEquals(candidate(1, 2, 0), 0)\n lu.assertEquals(candidate(2, 2, 0), 2)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "lua", - "prompt": "-- Given length of a side and high return area for a triangle.\n-- >>> triangle_area(5, 3)\n-- 7.5\nlocal function triangle_area(a, h)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = triangle_area\n lu.assertEquals(candidate(5, 3), 7.5)\n lu.assertEquals(candidate(2, 2), 2.0)\n lu.assertEquals(candidate(10, 8), 40.0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "lua", - "prompt": "-- Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n-- the last couple centuries. However, what people don't know is Tribonacci sequence.\n-- Tribonacci sequence is defined by the recurrence:\n-- tri(1) = 3\n-- tri(n) = 1 + n / 2, if n is even.\n-- tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n-- For example:\n-- tri(2) = 1 + (2 / 2) = 2\n-- tri(4) = 3\n-- tri(3) = tri(2) + tri(1) + tri(4)\n-- = 2 + 3 + 3 = 8 \n-- You are given a non-negative integer number n, you have to a return a list of the \n-- first n + 1 numbers of the Tribonacci sequence.\n-- Examples:\n-- >>> tri(3)\n-- {1, 3, 2, 8}\nlocal function tri(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = tri\n lu.assertEquals(candidate(3), {1, 3, 2, 8})\n lu.assertEquals(candidate(4), {1, 3, 2, 8, 3})\n lu.assertEquals(candidate(5), {1, 3, 2, 8, 3, 15})\n lu.assertEquals(candidate(6), {1, 3, 2, 8, 3, 15, 4})\n lu.assertEquals(candidate(7), {1, 3, 2, 8, 3, 15, 4, 24})\n lu.assertEquals(candidate(8), {1, 3, 2, 8, 3, 15, 4, 24, 5})\n lu.assertEquals(candidate(9), {1, 3, 2, 8, 3, 15, 4, 24, 5, 35})\n lu.assertEquals(candidate(20), {1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11})\n lu.assertEquals(candidate(0), {1})\n lu.assertEquals(candidate(1), {1, 3})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "lua", - "prompt": "-- You are given a list of two strings, both strings consist of open\n-- parentheses '(' or close parentheses ')' only.\n-- Your job is to check if it is possible to concatenate the two strings in\n-- some order, that the resulting string will be good.\n-- A string S is considered to be good if and only if all parentheses in S\n-- are balanced. For example: the string '(())()' is good, while the string\n-- '())' is not.\n-- Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n-- Examples:\n-- >>> match_parens({'()(', ')'})\n-- 'Yes'\n-- >>> match_parens({')', ')'})\n-- 'No'\nlocal function match_parens(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = match_parens\n lu.assertEquals(candidate({'()(', ')'}), 'Yes')\n lu.assertEquals(candidate({')', ')'}), 'No')\n lu.assertEquals(candidate({'(()(())', '())())'}), 'No')\n lu.assertEquals(candidate({')())', '(()()('}), 'Yes')\n lu.assertEquals(candidate({'(())))', '(()())(('}), 'Yes')\n lu.assertEquals(candidate({'()', '())'}), 'No')\n lu.assertEquals(candidate({'(()(', '()))()'}), 'Yes')\n lu.assertEquals(candidate({'((((', '((())'}), 'No')\n lu.assertEquals(candidate({')(()', '(()('}), 'No')\n lu.assertEquals(candidate({')(', ')('}), 'No')\n lu.assertEquals(candidate({'(', ')'}), 'Yes')\n lu.assertEquals(candidate({')', '('}), 'Yes')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "lua", - "prompt": "-- From a list of integers, remove all elements that occur more than once.\n-- Keep order of elements left the same as in the input.\n-- >>> remove_duplicates({1, 2, 3, 2, 4})\n-- {1, 3, 4}\nlocal function remove_duplicates(numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = remove_duplicates\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({1, 2, 3, 4}), {1, 2, 3, 4})\n lu.assertEquals(candidate({1, 2, 3, 2, 4, 3, 5}), {1, 4, 5})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "lua", - "prompt": "-- Return a greatest common divisor of two integers a and b\n-- >>> greatest_common_divisor(3, 5)\n-- 1\n-- >>> greatest_common_divisor(25, 15)\n-- 5\nlocal function greatest_common_divisor(a, b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = greatest_common_divisor\n lu.assertEquals(candidate(3, 7), 1)\n lu.assertEquals(candidate(10, 15), 5)\n lu.assertEquals(candidate(49, 14), 7)\n lu.assertEquals(candidate(144, 60), 12)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "lua", - "prompt": "-- Checks if given string is a palindrome\n-- >>> is_palindrome('')\n-- true\n-- >>> is_palindrome('aba')\n-- true\n-- >>> is_palindrome('aaaaa')\n-- true\n-- >>> is_palindrome('zbcd')\n-- false\nlocal function is_palindrome(text)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_palindrome\n lu.assertEquals(candidate(''), true)\n lu.assertEquals(candidate('aba'), true)\n lu.assertEquals(candidate('aaaaa'), true)\n lu.assertEquals(candidate('zbcd'), false)\n lu.assertEquals(candidate('xywyx'), true)\n lu.assertEquals(candidate('xywyz'), false)\n lu.assertEquals(candidate('xywzx'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "lua", - "prompt": "-- xs represent coefficients of a polynomial.\n-- xs[0] + xs[1] * x + xs[2] * x^2 + ....\n-- Return derivative of this polynomial in the same form.\n-- >>> derivative({3, 1, 2, 4, 5})\n-- {1, 4, 12, 20}\n-- >>> derivative({1, 2, 3})\n-- {2, 6}\nlocal function derivative(xs)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = derivative\n lu.assertEquals(candidate({3, 1, 2, 4, 5}), {1, 4, 12, 20})\n lu.assertEquals(candidate({1, 2, 3}), {2, 6})\n lu.assertEquals(candidate({3, 2, 1}), {2, 2})\n lu.assertEquals(candidate({3, 2, 1, 0, 4}), {2, 2, 0, 16})\n lu.assertEquals(candidate({1}), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "lua", - "prompt": "-- In this task, you will be given a string that represents a number of apples and oranges \n-- that are distributed in a basket of fruit this basket contains \n-- apples, oranges, and mango fruits. Given the string that represents the total number of \n-- the oranges and apples and an integer that represent the total number of the fruits \n-- in the basket return the number of the mango fruits in the basket.\n-- for examble:\n-- >>> fruit_distribution('5 apples and 6 oranges', 19)\n-- 8\n-- >>> fruit_distribution('0 apples and 1 oranges', 3)\n-- 2\n-- >>> fruit_distribution('2 apples and 3 oranges', 100)\n-- 95\n-- >>> fruit_distribution('100 apples and 1 oranges', 120)\n-- 19\nlocal function fruit_distribution(s, n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = fruit_distribution\n lu.assertEquals(candidate('5 apples and 6 oranges', 19), 8)\n lu.assertEquals(candidate('5 apples and 6 oranges', 21), 10)\n lu.assertEquals(candidate('0 apples and 1 oranges', 3), 2)\n lu.assertEquals(candidate('1 apples and 0 oranges', 3), 2)\n lu.assertEquals(candidate('2 apples and 3 oranges', 100), 95)\n lu.assertEquals(candidate('2 apples and 3 oranges', 5), 0)\n lu.assertEquals(candidate('1 apples and 100 oranges', 120), 19)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "lua", - "prompt": "-- Write a function that takes an integer a and returns True \n-- if this ingeger is a cube of some integer number.\n-- Note: you may assume the input is always valid.\n-- Examples:\n-- >>> iscube(1)\n-- true\n-- >>> iscube(2)\n-- false\n-- >>> iscube(-1)\n-- true\n-- >>> iscube(64)\n-- true\n-- >>> iscube(0)\n-- true\n-- >>> iscube(180)\n-- false\nlocal function iscube(a)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = iscube\n lu.assertEquals(candidate(1), true)\n lu.assertEquals(candidate(2), false)\n lu.assertEquals(candidate(-1), true)\n lu.assertEquals(candidate(64), true)\n lu.assertEquals(candidate(180), false)\n lu.assertEquals(candidate(1000), true)\n lu.assertEquals(candidate(0), true)\n lu.assertEquals(candidate(1729), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "lua", - "prompt": "-- In this Kata, you have to sort an array of non-negative integers according to\n-- number of ones in their binary representation in ascending order.\n-- For similar number of ones, sort based on decimal value.\n-- It must be implemented like this:\n-- >>> sort_array({1, 5, 2, 3, 4})\n-- {1, 2, 3, 4, 5}\n-- >>> sort_array({-2, -3, -4, -5, -6})\n-- {-6, -5, -4, -3, -2}\n-- >>> sort_array({1, 0, 2, 3, 4})\n-- {0, 1, 2, 3, 4}\nlocal function sort_array(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sort_array\n lu.assertEquals(candidate({1, 5, 2, 3, 4}), {1, 2, 4, 3, 5})\n lu.assertEquals(candidate({-2, -3, -4, -5, -6}), {-4, -2, -6, -5, -3})\n lu.assertEquals(candidate({1, 0, 2, 3, 4}), {0, 1, 2, 4, 3})\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4}), {2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77})\n lu.assertEquals(candidate({3, 6, 44, 12, 32, 5}), {32, 3, 5, 6, 12, 44})\n lu.assertEquals(candidate({2, 4, 8, 16, 32}), {2, 4, 8, 16, 32})\n lu.assertEquals(candidate({2, 4, 8, 16, 32}), {2, 4, 8, 16, 32})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "lua", - "prompt": "-- Given a list of strings, where each string consists of only digits, return a list.\n-- Each element i of the output should be \"the number of odd elements in the\n-- string i of the input.\" where all the i's should be replaced by the number\n-- of odd digits in the i'th string of the input.\n-- >>> odd_count({'1234567'})\n-- {'the number of odd elements 4n the str4ng 4 of the 4nput.'}\n-- >>> odd_count({'3', '11111111'})\n-- {'the number of odd elements 1n the str1ng 1 of the 1nput.', 'the number of odd elements 8n the str8ng 8 of the 8nput.'}\nlocal function odd_count(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = odd_count\n lu.assertEquals(candidate({'1234567'}), {'the number of odd elements 4n the str4ng 4 of the 4nput.'})\n lu.assertEquals(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.'})\n lu.assertEquals(candidate({'271', '137', '314'}), {'the number of odd elements 2n the str2ng 2 of the 2nput.', 'the number of odd elements 3n the str3ng 3 of the 3nput.', 'the number of odd elements 2n the str2ng 2 of the 2nput.'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "lua", - "prompt": "-- brackets is a string of \"(\" and \")\".\n-- return True if every opening bracket has a corresponding closing bracket.\n-- >>> correct_bracketing('(')\n-- false\n-- >>> correct_bracketing('()')\n-- true\n-- >>> correct_bracketing('(()())')\n-- true\n-- >>> correct_bracketing(')(()')\n-- false\nlocal function correct_bracketing(brackets)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = correct_bracketing\n lu.assertEquals(candidate('()'), true)\n lu.assertEquals(candidate('(()())'), true)\n lu.assertEquals(candidate('()()(()())()'), true)\n lu.assertEquals(candidate('()()((()()())())(()()(()))'), true)\n lu.assertEquals(candidate('((()())))'), false)\n lu.assertEquals(candidate(')(()'), false)\n lu.assertEquals(candidate('('), false)\n lu.assertEquals(candidate('(((('), false)\n lu.assertEquals(candidate(')'), false)\n lu.assertEquals(candidate('(()'), false)\n lu.assertEquals(candidate('()()(()())())(()'), false)\n lu.assertEquals(candidate('()()(()())()))()'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "lua", - "prompt": "-- Task\n-- Write a function that takes a string as input and returns the sum of the upper characters only'\n-- ASCII codes.\n-- Examples:\n-- >>> digitSum('')\n-- 0\n-- >>> digitSum('abAB')\n-- 131\n-- >>> digitSum('abcCd')\n-- 67\n-- >>> digitSum('helloE')\n-- 69\n-- >>> digitSum('woArBld')\n-- 131\n-- >>> digitSum('aAaaaXa')\n-- 153\nlocal function digitSum(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = digitSum\n lu.assertEquals(candidate(''), 0)\n lu.assertEquals(candidate('abAB'), 131)\n lu.assertEquals(candidate('abcCd'), 67)\n lu.assertEquals(candidate('helloE'), 69)\n lu.assertEquals(candidate('woArBld'), 131)\n lu.assertEquals(candidate('aAaaaXa'), 153)\n lu.assertEquals(candidate(' How are yOu?'), 151)\n lu.assertEquals(candidate('You arE Very Smart'), 327)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "lua", - "prompt": "-- Write a function that accepts a list of strings as a parameter,\n-- deletes the strings that have odd lengths from it,\n-- and returns the resulted list with a sorted order,\n-- The list is always a list of strings and never an array of numbers,\n-- and it may contain duplicates.\n-- The order of the list should be ascending by length of each word, and you\n-- should return the list sorted by that rule.\n-- If two words have the same length, sort the list alphabetically.\n-- The function should return a list of strings in sorted order.\n-- You may assume that all words will have the same length.\n-- For example:\n-- >>> list_sort({'aa', 'a', 'aaa'})\n-- {'aa'}\n-- >>> list_sort({'ab', 'a', 'aaa', 'cd'})\n-- {'ab', 'cd'}\nlocal function sorted_list_sum(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sorted_list_sum\n lu.assertEquals(candidate({'aa', 'a', 'aaa'}), {'aa'})\n lu.assertEquals(candidate({'school', 'AI', 'asdf', 'b'}), {'AI', 'asdf', 'school'})\n lu.assertEquals(candidate({'d', 'b', 'c', 'a'}), {})\n lu.assertEquals(candidate({'d', 'dcba', 'abcd', 'a'}), {'abcd', 'dcba'})\n lu.assertEquals(candidate({'AI', 'ai', 'au'}), {'AI', 'ai', 'au'})\n lu.assertEquals(candidate({'a', 'b', 'b', 'c', 'c', 'a'}), {})\n lu.assertEquals(candidate({'aaaa', 'bbbb', 'dd', 'cc'}), {'cc', 'dd', 'aaaa', 'bbbb'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "lua", - "prompt": "-- You are given an array arr of integers and you need to return\n-- sum of magnitudes of integers multiplied by product of all signs\n-- of each number in the array, represented by 1, -1 or 0.\n-- Note: return None for empty arr.\n-- Example:\n-- >>> prod_signs({1, 2, 2, -4})\n-- 9\n-- >>> prod_signs({0, 1})\n-- 0\n-- >>> prod_signs({})\n-- None\nlocal function prod_signs(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = prod_signs\n lu.assertEquals(candidate({1, 2, 2, -4}), -9)\n lu.assertEquals(candidate({0, 1}), 0)\n lu.assertEquals(candidate({1, 1, 1, 2, 3, -1, 1}), -10)\n lu.assertEquals(candidate({}), None)\n lu.assertEquals(candidate({2, 4, 1, 2, -1, -1, 9}), 20)\n lu.assertEquals(candidate({-1, 1, -1, 1}), 4)\n lu.assertEquals(candidate({-1, 1, 1, 1}), -4)\n lu.assertEquals(candidate({-1, 1, 1, 0}), 0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "lua", - "prompt": "-- Return list with elements incremented by 1.\n-- >>> incr_list({1, 2, 3})\n-- {2, 3, 4}\n-- >>> incr_list({5, 3, 5, 2, 3, 3, 9, 0, 123})\n-- {6, 4, 6, 3, 4, 4, 10, 1, 124}\nlocal function incr_list(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = incr_list\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({3, 2, 1}), {4, 3, 2})\n lu.assertEquals(candidate({5, 2, 5, 2, 3, 3, 9, 0, 123}), {6, 3, 6, 3, 4, 4, 10, 1, 124})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "lua", - "prompt": "-- From a given list of integers, generate a list of rolling maximum element found until given moment\n-- in the sequence.\n-- >>> rolling_max({1, 2, 3, 2, 3, 4, 2})\n-- {1, 2, 3, 3, 3, 4, 4}\nlocal function rolling_max(numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = rolling_max\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({1, 2, 3, 4}), {1, 2, 3, 4})\n lu.assertEquals(candidate({4, 3, 2, 1}), {4, 4, 4, 4})\n lu.assertEquals(candidate({3, 2, 3, 100, 3}), {3, 3, 3, 100, 100})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "lua", - "prompt": "-- Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n-- separate those group into separate strings and return the list of those.\n-- Separate groups are balanced (each open brace is properly closed) and not nested within each other\n-- Ignore any spaces in the input string.\n-- >>> separate_paren_groups('( ) (( )) (( )( ))')\n-- {'()', '(())', '(()())'}\nlocal function separate_paren_groups(paren_string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = separate_paren_groups\n lu.assertEquals(candidate('(()()) ((())) () ((())()())'), {'(()())', '((()))', '()', '((())()())'})\n lu.assertEquals(candidate('() (()) ((())) (((())))'), {'()', '(())', '((()))', '(((())))'})\n lu.assertEquals(candidate('(()(())((())))'), {'(()(())((())))'})\n lu.assertEquals(candidate('( ) (( )) (( )( ))'), {'()', '(())', '(()())'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "lua", - "prompt": "-- You will be given a string of words separated by commas or spaces. Your task is\n-- to split the string into words and return an array of the words.\n-- For example:\n-- >>> words_string('Hi, my name is John')\n-- {'Hi', 'my', 'name', 'is', 'John'}\n-- >>> words_string('One, two, three, four, five, six')\n-- {'One', 'two', 'three', 'four', 'five', 'six'}\nlocal function words_string(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = words_string\n lu.assertEquals(candidate('Hi, my name is John'), {'Hi', 'my', 'name', 'is', 'John'})\n lu.assertEquals(candidate('One, two, three, four, five, six'), {'One', 'two', 'three', 'four', 'five', 'six'})\n lu.assertEquals(candidate('Hi, my name'), {'Hi', 'my', 'name'})\n lu.assertEquals(candidate('One,, two, three, four, five, six,'), {'One', 'two', 'three', 'four', 'five', 'six'})\n lu.assertEquals(candidate(''), {})\n lu.assertEquals(candidate('ahmed , gamal'), {'ahmed', 'gamal'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "lua", - "prompt": "-- Create a function that takes integers, floats, or strings representing\n-- real numbers, and returns the larger variable in its given variable type.\n-- Return None if the values are equal.\n-- Note: If a real number is represented as a string, the floating point might be . or ,\n-- >>> compare_one(1, 2.5)\n-- 2.5\n-- >>> compare_one(1, '2,3')\n-- '2,3'\n-- >>> compare_one('5,1', '6')\n-- '6'\n-- >>> compare_one('1', 1)\n-- None\nlocal function compare_one(a, b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = compare_one\n lu.assertEquals(candidate(1, 2), 2)\n lu.assertEquals(candidate(1, 2.5), 2.5)\n lu.assertEquals(candidate(2, 3), 3)\n lu.assertEquals(candidate(5, 6), 6)\n lu.assertEquals(candidate(1, '2,3'), '2,3')\n lu.assertEquals(candidate('5,1', '6'), '6')\n lu.assertEquals(candidate('1', '2'), '2')\n lu.assertEquals(candidate('1', 1), None)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "lua", - "prompt": "-- Filter given list of any python values only for integers\n-- >>> filter_integers({'a', 3.14, 5})\n-- {5}\n-- >>> filter_integers({1, 2, 3, 'abc', {}, {}})\n-- {1, 2, 3}\nlocal function filter_integers(values)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = filter_integers\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({4, {}, {}, 23.2, 9, 'adasd'}), {4, 9})\n lu.assertEquals(candidate({3, 'c', 3, 3, 'a', 'b'}), {3, 3, 3})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "lua", - "prompt": "-- This function takes a list l and returns a list l' such that\n-- l' is identical to l in the odd indicies, while its values at the even indicies are equal\n-- to the values of the even indicies of l, but sorted.\n-- >>> sort_even({1, 2, 3})\n-- {1, 2, 3}\n-- >>> sort_even({5, 6, 3, 4})\n-- {3, 6, 5, 4}\nlocal function sort_even(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sort_even\n lu.assertEquals(candidate({1, 2, 3}), {1, 2, 3})\n lu.assertEquals(candidate({5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10}), {-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123})\n lu.assertEquals(candidate({5, 8, -12, 4, 23, 2, 3, 11, 12, -10}), {-12, 8, 3, 4, 5, 2, 12, 11, 23, -10})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "lua", - "prompt": "-- I think we all remember that feeling when the result of some long-awaited\n-- event is finally known. The feelings and thoughts you have at that moment are\n-- definitely worth noting down and comparing.\n-- Your task is to determine if a person correctly guessed the results of a number of matches.\n-- You are given two arrays of scores and guesses of equal length, where each index shows a match. \n-- Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n-- the value is 0, and if not, the value is the absolute difference between the guess and the score.\n-- example:\n-- >>> compare({1, 2, 3, 4, 5, 1}, {1, 2, 3, 4, 2, -2})\n-- {0, 0, 0, 0, 3, 3}\n-- >>> compare({0, 5, 0, 0, 0, 4}, {4, 1, 1, 0, 0, -2})\n-- {4, 4, 1, 0, 0, 6}\nlocal function compare(game, guess)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = compare\n lu.assertEquals(candidate({1, 2, 3, 4, 5, 1}, {1, 2, 3, 4, 2, -2}), {0, 0, 0, 0, 3, 3})\n lu.assertEquals(candidate({0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}), {0, 0, 0, 0, 0, 0})\n lu.assertEquals(candidate({1, 2, 3}, {-1, -2, -3}), {2, 4, 6})\n lu.assertEquals(candidate({1, 2, 3, 5}, {-1, 2, 3, 4}), {2, 0, 0, 1})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "lua", - "prompt": "-- Given a positive integer n, return a tuple that has the number of even and odd\n-- integer palindromes that fall within the range(1, n), inclusive.\n-- Example 1:\n-- >>> even_odd_palindrome(3)\n-- {1, 2}\n-- Explanation:\n-- Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n-- Example 2:\n-- >>> even_odd_palindrome(12)\n-- {4, 6}\n-- Explanation:\n-- Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n-- Note:\n-- 1. 1 <= n <= 10^3\n-- 2. returned tuple has the number of even and odd integer palindromes respectively.\nlocal function even_odd_palindrome(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = even_odd_palindrome\n lu.assertEquals(candidate(123), {8, 13})\n lu.assertEquals(candidate(12), {4, 6})\n lu.assertEquals(candidate(3), {1, 2})\n lu.assertEquals(candidate(63), {6, 8})\n lu.assertEquals(candidate(25), {5, 6})\n lu.assertEquals(candidate(19), {4, 6})\n lu.assertEquals(candidate(9), {4, 5})\n lu.assertEquals(candidate(1), {0, 1})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "lua", - "prompt": "-- The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n-- fib4(0) -> 0\n-- fib4(1) -> 0\n-- fib4(2) -> 2\n-- fib4(3) -> 0\n-- fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n-- Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n-- >>> fib4(5)\n-- 4\n-- >>> fib4(6)\n-- 8\n-- >>> fib4(7)\n-- 14\nlocal function fib4(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = fib4\n lu.assertEquals(candidate(5), 4)\n lu.assertEquals(candidate(8), 28)\n lu.assertEquals(candidate(10), 104)\n lu.assertEquals(candidate(12), 386)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "lua", - "prompt": "-- Given two positive integers a and b, return the even digits between a\n-- and b, in ascending order.\n-- For example:\n-- >>> generate_integers(2, 8)\n-- {2, 4, 6, 8}\n-- >>> generate_integers(8, 2)\n-- {2, 4, 6, 8}\n-- >>> generate_integers(10, 14)\n-- {}\nlocal function generate_integers(a, b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = generate_integers\n lu.assertEquals(candidate(2, 10), {2, 4, 6, 8})\n lu.assertEquals(candidate(10, 2), {2, 4, 6, 8})\n lu.assertEquals(candidate(132, 2), {2, 4, 6, 8})\n lu.assertEquals(candidate(17, 89), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "lua", - "prompt": "-- For a given list of input numbers, calculate Mean Absolute Deviation\n-- around the mean of this dataset.\n-- Mean Absolute Deviation is the average absolute difference between each\n-- element and a centerpoint (mean in this case):\n-- MAD = average | x - x_mean |\n-- >>> mean_absolute_deviation({1.0, 2.0, 3.0, 4.0})\n-- 1.0\nlocal function mean_absolute_deviation(numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = mean_absolute_deviation\n lu.assertEquals(candidate({1.0, 2.0}), 0.5)\n lu.assertEquals(candidate({1.0, 2.0, 3.0, 4.0}), 1.0)\n lu.assertEquals(candidate({1.0, 2.0, 3.0, 4.0, 5.0}), 1.2)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "lua", - "prompt": "-- Create a function encrypt that takes a string as an argument and\n-- returns a string encrypted with the alphabet being rotated. \n-- The alphabet should be rotated in a manner such that the letters \n-- shift down by two multiplied to two places.\n-- For example:\n-- >>> encrypt('hi')\n-- 'lm'\n-- >>> encrypt('asdfghjkl')\n-- 'ewhjklnop'\n-- >>> encrypt('gf')\n-- 'kj'\n-- >>> encrypt('et')\n-- 'ix'\nlocal function encrypt(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = encrypt\n lu.assertEquals(candidate('hi'), 'lm')\n lu.assertEquals(candidate('asdfghjkl'), 'ewhjklnop')\n lu.assertEquals(candidate('gf'), 'kj')\n lu.assertEquals(candidate('et'), 'ix')\n lu.assertEquals(candidate('faewfawefaewg'), 'jeiajeaijeiak')\n lu.assertEquals(candidate('hellomyfriend'), 'lippsqcjvmirh')\n lu.assertEquals(candidate('dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh'), 'hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl')\n lu.assertEquals(candidate('a'), 'e')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "lua", - "prompt": "-- Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n-- The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n-- as follows: start with any positive integer n. Then each term is obtained from the \n-- previous term as follows: if the previous term is even, the next term is one half of \n-- the previous term. If the previous term is odd, the next term is 3 times the previous\n-- term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n-- Note: \n-- 1. Collatz(1) is [1].\n-- 2. returned list sorted in increasing order.\n-- For example:\n-- get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n-- >>> get_odd_collatz(5)\n-- {1, 5}\nlocal function get_odd_collatz(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = get_odd_collatz\n lu.assertEquals(candidate(14), {1, 5, 7, 11, 13, 17})\n lu.assertEquals(candidate(5), {1, 5})\n lu.assertEquals(candidate(12), {1, 3, 5})\n lu.assertEquals(candidate(1), {1})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "lua", - "prompt": "-- Find how many times a given substring can be found in the original string. Count overlaping cases.\n-- >>> how_many_times('', 'a')\n-- 0\n-- >>> how_many_times('aaa', 'a')\n-- 3\n-- >>> how_many_times('aaaa', 'aa')\n-- 3\nlocal function how_many_times(string, substring)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = how_many_times\n lu.assertEquals(candidate('', 'x'), 0)\n lu.assertEquals(candidate('xyxyxyx', 'x'), 4)\n lu.assertEquals(candidate('cacacacac', 'cac'), 4)\n lu.assertEquals(candidate('john doe', 'john'), 1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "lua", - "prompt": "-- We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n-- numbers in the array will be randomly ordered. Your task is to determine if\n-- it is possible to get an array sorted in non-decreasing order by performing \n-- the following operation on the given array:\n-- You are allowed to perform right shift operation any number of times.\n-- One right shift operation means shifting all elements of the array by one\n-- position in the right direction. The last element of the array will be moved to\n-- the starting position in the array i.e. 0th index. \n-- If it is possible to obtain the sorted array by performing the above operation\n-- then return True else return False.\n-- If the given array is empty then return True.\n-- Note: The given list is guaranteed to have unique elements.\n-- For Example:\n-- >>> move_one_ball({3, 4, 5, 1, 2})\n-- true\n-- Explanation: By performin 2 right shift operations, non-decreasing order can\n-- be achieved for the given array.\n-- >>> move_one_ball({3, 5, 4, 1, 2})\n-- false\n-- Explanation:It is not possible to get non-decreasing order for the given\n-- array by performing any number of right shift operations.\nlocal function move_one_ball(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = move_one_ball\n lu.assertEquals(candidate({3, 4, 5, 1, 2}), true)\n lu.assertEquals(candidate({3, 5, 10, 1, 2}), true)\n lu.assertEquals(candidate({4, 3, 1, 2}), false)\n lu.assertEquals(candidate({3, 5, 4, 1, 2}), false)\n lu.assertEquals(candidate({}), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "lua", - "prompt": "-- Write a function which sorts the given list of integers\n-- in ascending order according to the sum of their digits.\n-- Note: if there are several items with similar sum of their digits,\n-- order them based on their index in original list.\n-- For example:\n-- >>> order_by_points({1, 11, -1, -11, -12})\n-- {-1, -11, 1, -12, 11}\n-- >>> order_by_points({})\n-- {}\nlocal function order_by_points(nums)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = order_by_points\n lu.assertEquals(candidate({1, 11, -1, -11, -12}), {-1, -11, 1, -12, 11})\n lu.assertEquals(candidate({1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46}), {0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457})\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({1, -11, -32, 43, 54, -98, 2, -3}), {-3, -32, -98, -11, 1, 2, 43, 54})\n lu.assertEquals(candidate({1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}), {1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9})\n lu.assertEquals(candidate({0, 6, 6, -76, -21, 23, 4}), {-76, -21, 0, 4, 23, 6, 6})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "lua", - "prompt": "-- Return list of prime factors of given integer in the order from smallest to largest.\n-- Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n-- Input number should be equal to the product of all factors\n-- >>> factorize(8)\n-- {2, 2, 2}\n-- >>> factorize(25)\n-- {5, 5}\n-- >>> factorize(70)\n-- {2, 5, 7}\nlocal function factorize(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = factorize\n lu.assertEquals(candidate(2), {2})\n lu.assertEquals(candidate(4), {2, 2})\n lu.assertEquals(candidate(8), {2, 2, 2})\n lu.assertEquals(candidate(57), {3, 19})\n lu.assertEquals(candidate(3249), {3, 3, 19, 19})\n lu.assertEquals(candidate(185193), {3, 3, 3, 19, 19, 19})\n lu.assertEquals(candidate(20577), {3, 19, 19, 19})\n lu.assertEquals(candidate(18), {2, 3, 3})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "lua", - "prompt": "-- Return True if all numbers in the list l are below threshold t.\n-- >>> below_threshold({1, 2, 4, 10}, 100)\n-- true\n-- >>> below_threshold({1, 20, 4, 10}, 5)\n-- false\nlocal function below_threshold(l, t)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = below_threshold\n lu.assertEquals(candidate({1, 2, 4, 10}, 100), true)\n lu.assertEquals(candidate({1, 20, 4, 10}, 5), false)\n lu.assertEquals(candidate({1, 20, 4, 10}, 21), true)\n lu.assertEquals(candidate({1, 20, 4, 10}, 22), true)\n lu.assertEquals(candidate({1, 8, 4, 10}, 11), true)\n lu.assertEquals(candidate({1, 8, 4, 10}, 10), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "lua", - "prompt": "-- You are given two positive integers n and m, and your task is to compute the\n-- average of the integers from n through m (including n and m). \n-- Round the answer to the nearest integer and convert that to binary.\n-- If n is greater than m, return -1.\n-- Example:\n-- >>> rounded_avg(1, 5)\n-- '0b11'\n-- >>> rounded_avg(7, 5)\n-- -1\n-- >>> rounded_avg(10, 20)\n-- '0b1111'\n-- >>> rounded_avg(20, 33)\n-- '0b11010'\nlocal function rounded_avg(n, m)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = rounded_avg\n lu.assertEquals(candidate(1, 5), '0b11')\n lu.assertEquals(candidate(7, 13), '0b1010')\n lu.assertEquals(candidate(964, 977), '0b1111001010')\n lu.assertEquals(candidate(996, 997), '0b1111100100')\n lu.assertEquals(candidate(560, 851), '0b1011000010')\n lu.assertEquals(candidate(185, 546), '0b101101110')\n lu.assertEquals(candidate(362, 496), '0b110101101')\n lu.assertEquals(candidate(350, 902), '0b1001110010')\n lu.assertEquals(candidate(197, 233), '0b11010111')\n lu.assertEquals(candidate(7, 5), -1)\n lu.assertEquals(candidate(5, 1), -1)\n lu.assertEquals(candidate(5, 5), '0b101')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "lua", - "prompt": "-- Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n-- For each of the group, output the deepest level of nesting of parentheses.\n-- E.g. (()()) has maximum two levels of nesting while ((())) has three.\n-- >>> parse_nested_parens('(()()) ((())) () ((())()())')\n-- {2, 3, 1, 3}\nlocal function parse_nested_parens(paren_string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = parse_nested_parens\n lu.assertEquals(candidate('(()()) ((())) () ((())()())'), {2, 3, 1, 3})\n lu.assertEquals(candidate('() (()) ((())) (((())))'), {1, 2, 3, 4})\n lu.assertEquals(candidate('(()(())((())))'), {4})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "lua", - "prompt": "-- Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n-- Examples\n-- >>> solution({5, 8, 7, 1})\n-- 12\n-- >>> solution({3, 3, 3, 3, 3})\n-- 9\n-- >>> solution({30, 13, 24, 321})\n-- 0\nlocal function solution(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = solution\n lu.assertEquals(candidate({5, 8, 7, 1}), 12)\n lu.assertEquals(candidate({3, 3, 3, 3, 3}), 9)\n lu.assertEquals(candidate({30, 13, 24, 321}), 0)\n lu.assertEquals(candidate({5, 9}), 5)\n lu.assertEquals(candidate({2, 4, 8}), 0)\n lu.assertEquals(candidate({30, 13, 23, 32}), 23)\n lu.assertEquals(candidate({3, 13, 2, 9}), 3)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "lua", - "prompt": "-- You are given a positive integer n. You have to create an integer array a of length n.\n-- For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n-- Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n-- and a[i] + a[j] + a[k] is a multiple of 3.\n-- Example :\n-- >>> get_max_triples(5)\n-- 1\n-- Explanation: \n-- a = [1, 3, 7, 13, 21]\n-- The only valid triple is (1, 7, 13).\nlocal function get_max_triples(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = get_max_triples\n lu.assertEquals(candidate(5), 1)\n lu.assertEquals(candidate(6), 4)\n lu.assertEquals(candidate(10), 36)\n lu.assertEquals(candidate(100), 53361)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "lua", - "prompt": "-- There are eight planets in our solar system: the closerst to the Sun \n-- is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n-- Uranus, Neptune.\n-- Write a function that takes two planet names as strings planet1 and planet2. \n-- The function should return a tuple containing all planets whose orbits are \n-- located between the orbit of planet1 and the orbit of planet2, sorted by \n-- the proximity to the sun. \n-- The function should return an empty tuple if planet1 or planet2\n-- are not correct planet names. \n-- Examples\n-- >>> bf('Jupiter', 'Neptune')\n-- {'Saturn', 'Uranus'}\n-- >>> bf('Earth', 'Mercury')\n-- 'Venus'\n-- >>> bf('Mercury', 'Uranus')\n-- {'Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn'}\nlocal function bf(planet1, planet2)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = bf\n lu.assertEquals(candidate('Jupiter', 'Neptune'), {'Saturn', 'Uranus'})\n lu.assertEquals(candidate('Earth', 'Mercury'), {'Venus'})\n lu.assertEquals(candidate('Mercury', 'Uranus'), {'Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn'})\n lu.assertEquals(candidate('Neptune', 'Venus'), {'Earth', 'Mars', 'Jupiter', 'Saturn', 'Uranus'})\n lu.assertEquals(candidate('Earth', 'Earth'), {})\n lu.assertEquals(candidate('Mars', 'Earth'), {})\n lu.assertEquals(candidate('Jupiter', 'Makemake'), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "lua", - "prompt": "-- You are given a list of integers.\n-- Write a function next_smallest() that returns the 2nd smallest element of the list.\n-- Return None if there is no such element.\n-- >>> next_smallest({1, 2, 3, 4, 5})\n-- 2\n-- >>> next_smallest({5, 1, 4, 3, 2})\n-- 2\n-- >>> next_smallest({})\n-- None\n-- >>> next_smallest({1, 1})\n-- None\nlocal function next_smallest(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = next_smallest\n lu.assertEquals(candidate({1, 2, 3, 4, 5}), 2)\n lu.assertEquals(candidate({5, 1, 4, 3, 2}), 2)\n lu.assertEquals(candidate({}), None)\n lu.assertEquals(candidate({1, 1}), None)\n lu.assertEquals(candidate({1, 1, 1, 1, 0}), 1)\n lu.assertEquals(candidate({1, 1}), None)\n lu.assertEquals(candidate({-35, 34, 12, -45}), -35)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "lua", - "prompt": "-- Input is a space-delimited string of numberals from 'zero' to 'nine'.\n-- Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n-- Return the string with numbers sorted from smallest to largest\n-- >>> sort_numbers('three one five')\n-- 'one three five'\nlocal function sort_numbers(numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sort_numbers\n lu.assertEquals(candidate(''), '')\n lu.assertEquals(candidate('three'), 'three')\n lu.assertEquals(candidate('three five nine'), 'three five nine')\n lu.assertEquals(candidate('five zero four seven nine eight'), 'zero four five seven eight nine')\n lu.assertEquals(candidate('six five four three two one zero'), 'zero one two three four five six')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "lua", - "prompt": "-- You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n-- >>> cycpattern_check('abcd', 'abd')\n-- false\n-- >>> cycpattern_check('hello', 'ell')\n-- true\n-- >>> cycpattern_check('whassup', 'psus')\n-- false\n-- >>> cycpattern_check('abab', 'baa')\n-- true\n-- >>> cycpattern_check('efef', 'eeff')\n-- false\n-- >>> cycpattern_check('himenss', 'simen')\n-- true\nlocal function cycpattern_check(a, b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = cycpattern_check\n lu.assertEquals(candidate('xyzw', 'xyw'), false)\n lu.assertEquals(candidate('yello', 'ell'), true)\n lu.assertEquals(candidate('whattup', 'ptut'), false)\n lu.assertEquals(candidate('efef', 'fee'), true)\n lu.assertEquals(candidate('abab', 'aabb'), false)\n lu.assertEquals(candidate('winemtt', 'tinem'), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "lua", - "prompt": "-- You will be given a number in decimal form and your task is to convert it to\n-- binary format. The function should return a string, with each character representing a binary\n-- number. Each character in the string will be '0' or '1'.\n-- There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n-- The extra characters are there to help with the format.\n-- Examples:\n-- >>> decimal_to_binary(15)\n-- 'db1111db'\n-- >>> decimal_to_binary(32)\n-- 'db100000db'\nlocal function decimal_to_binary(decimal)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = decimal_to_binary\n lu.assertEquals(candidate(0), 'db0db')\n lu.assertEquals(candidate(32), 'db100000db')\n lu.assertEquals(candidate(103), 'db1100111db')\n lu.assertEquals(candidate(15), 'db1111db')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "lua", - "prompt": "-- Filter an input list of strings only for ones that contain given substring\n-- >>> filter_by_substring({}, 'a')\n-- {}\n-- >>> filter_by_substring({'abc', 'bacd', 'cde', 'array'}, 'a')\n-- {'abc', 'bacd', 'array'}\nlocal function filter_by_substring(strings, substring)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = filter_by_substring\n lu.assertEquals(candidate({}, 'john'), {})\n lu.assertEquals(candidate({'xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'}, 'xxx'), {'xxx', 'xxxAAA', 'xxx'})\n lu.assertEquals(candidate({'xxx', 'asd', 'aaaxxy', 'john doe', 'xxxAAA', 'xxx'}, 'xx'), {'xxx', 'aaaxxy', 'xxxAAA', 'xxx'})\n lu.assertEquals(candidate({'grunt', 'trumpet', 'prune', 'gruesome'}, 'run'), {'grunt', 'prune'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "lua", - "prompt": "-- Given an integer. return a tuple that has the number of even and odd digits respectively.\n-- Example:\n-- >>> even_odd_count(-12)\n-- {1, 1}\n-- >>> even_odd_count(123)\n-- {1, 2}\nlocal function even_odd_count(num)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = even_odd_count\n lu.assertEquals(candidate(7), {0, 1})\n lu.assertEquals(candidate(-78), {1, 1})\n lu.assertEquals(candidate(3452), {2, 2})\n lu.assertEquals(candidate(346211), {3, 3})\n lu.assertEquals(candidate(-345821), {3, 3})\n lu.assertEquals(candidate(-2), {1, 0})\n lu.assertEquals(candidate(-45347), {2, 3})\n lu.assertEquals(candidate(0), {1, 0})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "lua", - "prompt": "-- Write a function that accepts a list of strings.\n-- The list contains different words. Return the word with maximum number\n-- of unique characters. If multiple strings have maximum number of unique\n-- characters, return the one which comes first in lexicographical order.\n-- >>> find_max({'name', 'of', 'string'})\n-- 'string'\n-- >>> find_max({'name', 'enam', 'game'})\n-- 'enam'\n-- >>> find_max({'aaaaaaa', 'bb', 'cc'})\n-- 'aaaaaaa'\nlocal function find_max(words)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = find_max\n lu.assertEquals(candidate({'name', 'of', 'string'}), 'string')\n lu.assertEquals(candidate({'name', 'enam', 'game'}), 'enam')\n lu.assertEquals(candidate({'aaaaaaa', 'bb', 'cc'}), 'aaaaaaa')\n lu.assertEquals(candidate({'abc', 'cba'}), 'abc')\n lu.assertEquals(candidate({'play', 'this', 'game', 'of', 'footbott'}), 'footbott')\n lu.assertEquals(candidate({'we', 'are', 'gonna', 'rock'}), 'gonna')\n lu.assertEquals(candidate({'we', 'are', 'a', 'mad', 'nation'}), 'nation')\n lu.assertEquals(candidate({'this', 'is', 'a', 'prrk'}), 'this')\n lu.assertEquals(candidate({'b'}), 'b')\n lu.assertEquals(candidate({'play', 'play', 'play'}), 'play')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "lua", - "prompt": "-- Given a positive integer n, return the count of the numbers of n-digit\n-- positive integers that start or end with 1.\nlocal function starts_one_ends(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = starts_one_ends\n lu.assertEquals(candidate(1), 1)\n lu.assertEquals(candidate(2), 18)\n lu.assertEquals(candidate(3), 180)\n lu.assertEquals(candidate(4), 1800)\n lu.assertEquals(candidate(5), 18000)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "lua", - "prompt": "-- Create a function that returns a tuple (a, b), where 'a' is\n-- the largest of negative integers, and 'b' is the smallest\n-- of positive integers in a list.\n-- If there is no negative or positive integers, return them as None.\n-- Examples:\n-- >>> largest_smallest_integers({2, 4, 1, 3, 5, 7})\n-- {None, 1}\n-- >>> largest_smallest_integers({})\n-- {None, None}\n-- >>> largest_smallest_integers({0})\n-- {None, None}\nlocal function largest_smallest_integers(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = largest_smallest_integers\n lu.assertEquals(candidate({2, 4, 1, 3, 5, 7}), {None, 1})\n lu.assertEquals(candidate({2, 4, 1, 3, 5, 7, 0}), {None, 1})\n lu.assertEquals(candidate({1, 3, 2, 4, 5, 6, -2}), {-2, 1})\n lu.assertEquals(candidate({4, 5, 3, 6, 2, 7, -7}), {-7, 2})\n lu.assertEquals(candidate({7, 3, 8, 4, 9, 2, 5, -9}), {-9, 2})\n lu.assertEquals(candidate({}), {None, None})\n lu.assertEquals(candidate({0}), {None, None})\n lu.assertEquals(candidate({-1, -3, -5, -6}), {-1, None})\n lu.assertEquals(candidate({-1, -3, -5, -6, 0}), {-1, None})\n lu.assertEquals(candidate({-6, -4, -4, -3, 1}), {-3, 1})\n lu.assertEquals(candidate({-6, -4, -4, -3, -100, 1}), {-3, 1})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "lua", - "prompt": "-- \"Given an array representing a branch of a tree that has non-negative integer nodes\n-- your task is to pluck one of the nodes and return it.\n-- The plucked node should be the node with the smallest even value.\n-- If multiple nodes with the same smallest even value are found return the node that has smallest index.\n-- The plucked node should be returned in a list, [ smalest_value, its index ],\n-- If there are no even values or the given array is empty, return [].\n-- Example 1:\n-- >>> pluck({4, 2, 3})\n-- {2, 1}\n-- Explanation: 2 has the smallest even value, and 2 has the smallest index.\n-- Example 2:\n-- >>> pluck({1, 2, 3})\n-- {2, 1}\n-- Explanation: 2 has the smallest even value, and 2 has the smallest index.\n-- Example 3:\n-- >>> pluck({})\n-- {}\n-- Example 4:\n-- >>> pluck({5, 0, 3, 0, 4, 2})\n-- {0, 1}\n-- Explanation: 0 is the smallest value, but there are two zeros,\n-- so we will choose the first zero, which has the smallest index.\n-- Constraints:\n-- * 1 <= nodes.length <= 10000\n-- * 0 <= node.value\nlocal function pluck(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = pluck\n lu.assertEquals(candidate({4, 2, 3}), {2, 1})\n lu.assertEquals(candidate({1, 2, 3}), {2, 1})\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({5, 0, 3, 0, 4, 2}), {0, 1})\n lu.assertEquals(candidate({1, 2, 3, 0, 5, 3}), {0, 3})\n lu.assertEquals(candidate({5, 4, 8, 4, 8}), {4, 1})\n lu.assertEquals(candidate({7, 6, 7, 1}), {6, 1})\n lu.assertEquals(candidate({7, 9, 7, 1}), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "lua", - "prompt": "-- Write a function count_nums which takes an array of integers and returns\n-- the number of elements which has a sum of digits > 0.\n-- If a number is negative, then its first signed digit will be negative:\n-- e.g. -123 has signed digits -1, 2, and 3.\n-- >>> count_nums({})\n-- 0\n-- >>> count_nums({-1, 11, -11})\n-- 1\n-- >>> count_nums({1, 1, 2})\n-- 3\nlocal function count_nums(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = count_nums\n lu.assertEquals(candidate({}), 0)\n lu.assertEquals(candidate({-1, -2, 0}), 0)\n lu.assertEquals(candidate({1, 1, 2, -2, 3, 4, 5}), 6)\n lu.assertEquals(candidate({1, 6, 9, -6, 0, 1, 5}), 5)\n lu.assertEquals(candidate({1, 100, 98, -7, 1, -1}), 4)\n lu.assertEquals(candidate({12, 23, 34, -45, -56, 0}), 5)\n lu.assertEquals(candidate({0, 1}), 1)\n lu.assertEquals(candidate({1}), 1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "lua", - "prompt": "-- Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n-- each cell of the grid contains a value. Every integer in the range [1, N * N]\n-- inclusive appears exactly once on the cells of the grid.\n-- You have to find the minimum path of length k in the grid. You can start\n-- from any cell, and in each step you can move to any of the neighbor cells,\n-- in other words, you can go to cells which share an edge with you current\n-- cell.\n-- Please note that a path of length k means visiting exactly k cells (not\n-- necessarily distinct).\n-- You CANNOT go off the grid.\n-- A path A (of length k) is considered less than a path B (of length k) if\n-- after making the ordered lists of the values on the cells that A and B go\n-- through (let's call them lst_A and lst_B), lst_A is lexicographically less\n-- than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n-- such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n-- lst_A[j] = lst_B[j].\n-- It is guaranteed that the answer is unique.\n-- Return an ordered list of the values on the cells that the minimum path go through.\n-- Examples: \n-- >>> minPath({{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}, 3)\n-- {1, 2, 1}\n-- >>> minPath({{5, 9, 3}, {4, 1, 6}, {7, 8, 2}}, 1)\n-- {1}\nlocal function minPath(grid, k)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = minPath\n lu.assertEquals(candidate({{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}, 3), {1, 2, 1})\n lu.assertEquals(candidate({{5, 9, 3}, {4, 1, 6}, {7, 8, 2}}, 1), {1})\n lu.assertEquals(candidate({{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}, {13, 14, 15, 16}}, 4), {1, 2, 1, 2})\n lu.assertEquals(candidate({{6, 4, 13, 10}, {5, 7, 12, 1}, {3, 16, 11, 15}, {8, 14, 9, 2}}, 7), {1, 10, 1, 10, 1, 10, 1})\n lu.assertEquals(candidate({{8, 14, 9, 2}, {6, 4, 13, 15}, {5, 7, 1, 12}, {3, 10, 11, 16}}, 5), {1, 7, 1, 7, 1})\n lu.assertEquals(candidate({{11, 8, 7, 2}, {5, 16, 14, 4}, {9, 3, 15, 6}, {12, 13, 10, 1}}, 9), {1, 6, 1, 6, 1, 6, 1, 6, 1})\n lu.assertEquals(candidate({{12, 13, 10, 1}, {9, 3, 15, 6}, {5, 16, 14, 4}, {11, 8, 7, 2}}, 12), {1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6})\n lu.assertEquals(candidate({{2, 7, 4}, {3, 1, 5}, {6, 8, 9}}, 8), {1, 3, 1, 3, 1, 3, 1, 3})\n lu.assertEquals(candidate({{6, 1, 5}, {3, 8, 9}, {2, 7, 4}}, 8), {1, 5, 1, 5, 1, 5, 1, 5})\n lu.assertEquals(candidate({{1, 2}, {3, 4}}, 10), {1, 2, 1, 2, 1, 2, 1, 2, 1, 2})\n lu.assertEquals(candidate({{1, 3}, {3, 2}}, 10), {1, 3, 1, 3, 1, 3, 1, 3, 1, 3})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "lua", - "prompt": "-- Given list of integers, return list in strange order.\n-- Strange sorting, is when you start with the minimum value,\n-- then maximum of the remaining integers, then minimum and so on.\n-- Examples:\n-- >>> strange_sort_list({1, 2, 3, 4})\n-- {1, 4, 2, 3}\n-- >>> strange_sort_list({5, 5, 5, 5})\n-- {5, 5, 5, 5}\n-- >>> strange_sort_list({})\n-- {}\nlocal function strange_sort_list(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = strange_sort_list\n lu.assertEquals(candidate({1, 2, 3, 4}), {1, 4, 2, 3})\n lu.assertEquals(candidate({5, 6, 7, 8, 9}), {5, 9, 6, 8, 7})\n lu.assertEquals(candidate({1, 2, 3, 4, 5}), {1, 5, 2, 4, 3})\n lu.assertEquals(candidate({5, 6, 7, 8, 9, 1}), {1, 9, 5, 8, 6, 7})\n lu.assertEquals(candidate({5, 5, 5, 5}), {5, 5, 5, 5})\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({1, 2, 3, 4, 5, 6, 7, 8}), {1, 8, 2, 7, 3, 6, 4, 5})\n lu.assertEquals(candidate({0, 2, 2, 2, 5, 5, -5, -5}), {-5, 5, -5, 5, 0, 2, 2, 2})\n lu.assertEquals(candidate({111111}), {111111})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "lua", - "prompt": "-- Given a string 'text', return its md5 hash equivalent string.\n-- If 'text' is an empty string, return None.\n-- >>> string_to_md5('Hello world')\n-- '3e25960a79dbc69b674cd4ec67a72c62'\nlocal function string_to_md5(text)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = string_to_md5\n lu.assertEquals(candidate('Hello world'), '3e25960a79dbc69b674cd4ec67a72c62')\n lu.assertEquals(candidate(''), None)\n lu.assertEquals(candidate('A B C'), '0ef78513b0cb8cef12743f5aeb35f888')\n lu.assertEquals(candidate('password'), '5f4dcc3b5aa765d61d8327deb882cf99')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "lua", - "prompt": "-- You are given a word. Your task is to find the closest vowel that stands between \n-- two consonants from the right side of the word (case sensitive).\n-- Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n-- find any vowel met the above condition. \n-- You may assume that the given string contains English letter only.\n-- Example:\n-- >>> get_closest_vowel('yogurt')\n-- 'u'\n-- >>> get_closest_vowel('FULL')\n-- 'U'\n-- >>> get_closest_vowel('quick')\n-- ''\n-- >>> get_closest_vowel('ab')\n-- ''\nlocal function get_closest_vowel(word)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = get_closest_vowel\n lu.assertEquals(candidate('yogurt'), 'u')\n lu.assertEquals(candidate('full'), 'u')\n lu.assertEquals(candidate('easy'), '')\n lu.assertEquals(candidate('eAsy'), '')\n lu.assertEquals(candidate('ali'), '')\n lu.assertEquals(candidate('bad'), 'a')\n lu.assertEquals(candidate('most'), 'o')\n lu.assertEquals(candidate('ab'), '')\n lu.assertEquals(candidate('ba'), '')\n lu.assertEquals(candidate('quick'), '')\n lu.assertEquals(candidate('anime'), 'i')\n lu.assertEquals(candidate('Asia'), '')\n lu.assertEquals(candidate('Above'), 'o')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "lua", - "prompt": "-- Change numerical base of input number x to base.\n-- return string representation after the conversion.\n-- base numbers are less than 10.\n-- >>> change_base(8, 3)\n-- '22'\n-- >>> change_base(8, 2)\n-- '1000'\n-- >>> change_base(7, 2)\n-- '111'\nlocal function change_base(x, base)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = change_base\n lu.assertEquals(candidate(8, 3), '22')\n lu.assertEquals(candidate(9, 3), '100')\n lu.assertEquals(candidate(234, 2), '11101010')\n lu.assertEquals(candidate(16, 2), '10000')\n lu.assertEquals(candidate(8, 2), '1000')\n lu.assertEquals(candidate(7, 2), '111')\n lu.assertEquals(candidate(2, 3), '2')\n lu.assertEquals(candidate(3, 4), '3')\n lu.assertEquals(candidate(4, 5), '4')\n lu.assertEquals(candidate(5, 6), '5')\n lu.assertEquals(candidate(6, 7), '6')\n lu.assertEquals(candidate(7, 8), '7')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "lua", - "prompt": "-- Check if in given list of numbers, are any two numbers closer to each other than\n-- given threshold.\n-- >>> has_close_elements({1.0, 2.0, 3.0}, 0.5)\n-- false\n-- >>> has_close_elements({1.0, 2.8, 3.0, 4.0, 5.0, 2.0}, 0.3)\n-- true\nlocal function has_close_elements(numbers, threshold)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = has_close_elements\n lu.assertEquals(candidate({1.0, 2.0, 3.9, 4.0, 5.0, 2.2}, 0.3), true)\n lu.assertEquals(candidate({1.0, 2.0, 3.9, 4.0, 5.0, 2.2}, 0.05), false)\n lu.assertEquals(candidate({1.0, 2.0, 5.9, 4.0, 5.0}, 0.95), true)\n lu.assertEquals(candidate({1.0, 2.0, 5.9, 4.0, 5.0}, 0.8), false)\n lu.assertEquals(candidate({1.0, 2.0, 3.0, 4.0, 5.0, 2.0}, 0.1), true)\n lu.assertEquals(candidate({1.1, 2.2, 3.1, 4.1, 5.1}, 1.0), true)\n lu.assertEquals(candidate({1.1, 2.2, 3.1, 4.1, 5.1}, 0.5), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "lua", - "prompt": "-- Create a function that takes a string as input which contains only square brackets.\n-- The function should return True if and only if there is a valid subsequence of brackets \n-- where at least one bracket in the subsequence is nested.\n-- >>> is_nested('[[]]')\n-- true\n-- >>> is_nested('[]]]]]]][[[[[]')\n-- false\n-- >>> is_nested('[][]')\n-- false\n-- >>> is_nested('[]')\n-- false\n-- >>> is_nested('[[][]]')\n-- true\n-- >>> is_nested('[[]][[')\n-- true\nlocal function is_nested(string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_nested\n lu.assertEquals(candidate('[[]]'), true)\n lu.assertEquals(candidate('[]]]]]]][[[[[]'), false)\n lu.assertEquals(candidate('[][]'), false)\n lu.assertEquals(candidate('[]'), false)\n lu.assertEquals(candidate('[[[[]]]]'), true)\n lu.assertEquals(candidate('[]]]]]]]]]]'), false)\n lu.assertEquals(candidate('[][][[]]'), true)\n lu.assertEquals(candidate('[[]'), false)\n lu.assertEquals(candidate('[]]'), false)\n lu.assertEquals(candidate('[[]][['), true)\n lu.assertEquals(candidate('[[][]]'), true)\n lu.assertEquals(candidate(''), false)\n lu.assertEquals(candidate('[[[[[[[['), false)\n lu.assertEquals(candidate(']]]]]]]]'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "lua", - "prompt": "-- Concatenate list of strings into a single string\n-- >>> concatenate({})\n-- ''\n-- >>> concatenate({'a', 'b', 'c'})\n-- 'abc'\nlocal function concatenate(strings)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = concatenate\n lu.assertEquals(candidate({}), '')\n lu.assertEquals(candidate({'x', 'y', 'z'}), 'xyz')\n lu.assertEquals(candidate({'x', 'y', 'z', 'w', 'k'}), 'xyzwk')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "lua", - "prompt": "-- prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n-- >>> prime_fib(1)\n-- 2\n-- >>> prime_fib(2)\n-- 3\n-- >>> prime_fib(3)\n-- 5\n-- >>> prime_fib(4)\n-- 13\n-- >>> prime_fib(5)\n-- 89\nlocal function prime_fib(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = prime_fib\n lu.assertEquals(candidate(1), 2)\n lu.assertEquals(candidate(2), 3)\n lu.assertEquals(candidate(3), 5)\n lu.assertEquals(candidate(4), 13)\n lu.assertEquals(candidate(5), 89)\n lu.assertEquals(candidate(6), 233)\n lu.assertEquals(candidate(7), 1597)\n lu.assertEquals(candidate(8), 28657)\n lu.assertEquals(candidate(9), 514229)\n lu.assertEquals(candidate(10), 433494437)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "lua", - "prompt": "-- From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n-- other and return them in order (smaller number, larger number).\n-- >>> find_closest_elements({1.0, 2.0, 3.0, 4.0, 5.0, 2.2})\n-- {2.0, 2.2}\n-- >>> find_closest_elements({1.0, 2.0, 3.0, 4.0, 5.0, 2.0})\n-- {2.0, 2.0}\nlocal function find_closest_elements(numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = find_closest_elements\n lu.assertEquals(candidate({1.0, 2.0, 3.9, 4.0, 5.0, 2.2}), {3.9, 4.0})\n lu.assertEquals(candidate({1.0, 2.0, 5.9, 4.0, 5.0}), {5.0, 5.9})\n lu.assertEquals(candidate({1.0, 2.0, 3.0, 4.0, 5.0, 2.2}), {2.0, 2.2})\n lu.assertEquals(candidate({1.0, 2.0, 3.0, 4.0, 5.0, 2.0}), {2.0, 2.0})\n lu.assertEquals(candidate({1.1, 2.2, 3.1, 4.1, 5.1}), {2.2, 3.1})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "lua", - "prompt": "-- You have been tasked to write a function that receives \n-- a hexadecimal number as a string and counts the number of hexadecimal \n-- digits that are primes (prime number, or a prime, is a natural number \n-- greater than 1 that is not a product of two smaller natural numbers).\n-- Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n-- Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n-- So you have to determine a number of the following digits: 2, 3, 5, 7, \n-- B (=decimal 11), D (=decimal 13).\n-- Note: you may assume the input is always correct or empty string, \n-- and symbols A,B,C,D,E,F are always uppercase.\n-- Examples:\n-- >>> hex_key('AB')\n-- 1\n-- >>> hex_key('1077E')\n-- 2\n-- >>> hex_key('ABED1A33')\n-- 4\n-- >>> hex_key('123456789ABCDEF0')\n-- 6\n-- >>> hex_key('2020')\n-- 2\nlocal function hex_key(num)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = hex_key\n lu.assertEquals(candidate('AB'), 1)\n lu.assertEquals(candidate('1077E'), 2)\n lu.assertEquals(candidate('ABED1A33'), 4)\n lu.assertEquals(candidate('2020'), 2)\n lu.assertEquals(candidate('123456789ABCDEF0'), 6)\n lu.assertEquals(candidate('112233445566778899AABBCCDDEEFF00'), 12)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "lua", - "prompt": "-- Complete the function that takes two integers and returns \n-- the product of their unit digits.\n-- Assume the input is always valid.\n-- Examples:\n-- >>> multiply(148, 412)\n-- 16\n-- >>> multiply(19, 28)\n-- 72\n-- >>> multiply(2020, 1851)\n-- 0\n-- >>> multiply(14, -15)\n-- 20\nlocal function multiply(a, b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = multiply\n lu.assertEquals(candidate(148, 412), 16)\n lu.assertEquals(candidate(19, 28), 72)\n lu.assertEquals(candidate(2020, 1851), 0)\n lu.assertEquals(candidate(14, -15), 20)\n lu.assertEquals(candidate(76, 67), 42)\n lu.assertEquals(candidate(17, 27), 49)\n lu.assertEquals(candidate(0, 1), 0)\n lu.assertEquals(candidate(0, 0), 0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "lua", - "prompt": "-- Given list of numbers (of at least two elements), apply a linear transform to that list,\n-- such that the smallest number will become 0 and the largest will become 1\n-- >>> rescale_to_unit({1.0, 2.0, 3.0, 4.0, 5.0})\n-- {0.0, 0.25, 0.5, 0.75, 1.0}\nlocal function rescale_to_unit(numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = rescale_to_unit\n lu.assertEquals(candidate({2.0, 49.9}), {0.0, 1.0})\n lu.assertEquals(candidate({100.0, 49.9}), {1.0, 0.0})\n lu.assertEquals(candidate({1.0, 2.0, 3.0, 4.0, 5.0}), {0.0, 0.25, 0.5, 0.75, 1.0})\n lu.assertEquals(candidate({2.0, 1.0, 5.0, 3.0, 4.0}), {0.25, 0.0, 1.0, 0.5, 0.75})\n lu.assertEquals(candidate({12.0, 11.0, 15.0, 13.0, 14.0}), {0.25, 0.0, 1.0, 0.5, 0.75})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "lua", - "prompt": "-- Given a positive integer n, return the product of the odd digits.\n-- Return 0 if all digits are even.\n-- For example:\n-- >>> digits(1)\n-- 1\n-- >>> digits(4)\n-- 0\n-- >>> digits(235)\n-- 15\nlocal function digits(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = digits\n lu.assertEquals(candidate(5), 5)\n lu.assertEquals(candidate(54), 5)\n lu.assertEquals(candidate(120), 1)\n lu.assertEquals(candidate(5014), 5)\n lu.assertEquals(candidate(98765), 315)\n lu.assertEquals(candidate(5576543), 2625)\n lu.assertEquals(candidate(2468), 0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "lua", - "prompt": "-- You will be given the name of a class (a string) and a list of extensions.\n-- The extensions are to be used to load additional classes to the class. The\n-- strength of the extension is as follows: Let CAP be the number of the uppercase\n-- letters in the extension's name, and let SM be the number of lowercase letters \n-- in the extension's name, the strength is given by the fraction CAP - SM. \n-- You should find the strongest extension and return a string in this \n-- format: ClassName.StrongestExtensionName.\n-- If there are two or more extensions with the same strength, you should\n-- choose the one that comes first in the list.\n-- For example, if you are given \"Slices\" as the class and a list of the\n-- extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n-- return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n-- (its strength is -1).\n-- Example:\n-- >>> Strongest_Extension('my_class', {'AA', 'Be', 'CC'})\n-- 'my_class.AA'\nlocal function Strongest_Extension(class_name, extensions)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = Strongest_Extension\n lu.assertEquals(candidate('Watashi', {'tEN', 'niNE', 'eIGHt8OKe'}), 'Watashi.eIGHt8OKe')\n lu.assertEquals(candidate('Boku123', {'nani', 'NazeDa', 'YEs.WeCaNe', '32145tggg'}), 'Boku123.YEs.WeCaNe')\n lu.assertEquals(candidate('__YESIMHERE', {'t', 'eMptY', 'nothing', 'zeR00', 'NuLl__', '123NoooneB321'}), '__YESIMHERE.NuLl__')\n lu.assertEquals(candidate('K', {'Ta', 'TAR', 't234An', 'cosSo'}), 'K.TAR')\n lu.assertEquals(candidate('__HAHA', {'Tab', '123', '781345', '-_-'}), '__HAHA.123')\n lu.assertEquals(candidate('YameRore', {'HhAas', 'okIWILL123', 'WorkOut', 'Fails', '-_-'}), 'YameRore.okIWILL123')\n lu.assertEquals(candidate('finNNalLLly', {'Die', 'NowW', 'Wow', 'WoW'}), 'finNNalLLly.WoW')\n lu.assertEquals(candidate('_', {'Bb', '91245'}), '_.Bb')\n lu.assertEquals(candidate('Sp', {'671235', 'Bb'}), 'Sp.671235')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "lua", - "prompt": "-- Given a string representing a space separated lowercase letters, return a dictionary\n-- of the letter with the most repetition and containing the corresponding count.\n-- If several letters have the same occurrence, return all of them.\n-- Example:\n-- >>> histogram('a b c')\n-- {['a'] = 1, ['b'] = 1, ['c'] = 1}\n-- >>> histogram('a b b a')\n-- {['a'] = 2, ['b'] = 2}\n-- >>> histogram('a b c a b')\n-- {['a'] = 2, ['b'] = 2}\n-- >>> histogram('b b b b a')\n-- {['b'] = 4}\n-- >>> histogram('')\n-- {}\nlocal function histogram(test)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = histogram\n lu.assertEquals(candidate('a b b a'), {['a'] = 2, ['b'] = 2})\n lu.assertEquals(candidate('a b c a b'), {['a'] = 2, ['b'] = 2})\n lu.assertEquals(candidate('a b c d g'), {['a'] = 1, ['b'] = 1, ['c'] = 1, ['d'] = 1, ['g'] = 1})\n lu.assertEquals(candidate('r t g'), {['r'] = 1, ['t'] = 1, ['g'] = 1})\n lu.assertEquals(candidate('b b b b a'), {['b'] = 4})\n lu.assertEquals(candidate('r t g'), {['r'] = 1, ['t'] = 1, ['g'] = 1})\n lu.assertEquals(candidate(''), {})\n lu.assertEquals(candidate('a'), {['a'] = 1})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "lua", - "prompt": "-- pairs_sum_to_zero takes a list of integers as an input.\n-- it returns True if there are two distinct elements in the list that\n-- sum to zero, and False otherwise.\n-- >>> pairs_sum_to_zero({1, 3, 5, 0})\n-- false\n-- >>> pairs_sum_to_zero({1, 3, -2, 1})\n-- false\n-- >>> pairs_sum_to_zero({1, 2, 3, 7})\n-- false\n-- >>> pairs_sum_to_zero({2, 4, -5, 3, 5, 7})\n-- true\n-- >>> pairs_sum_to_zero({1})\n-- false\nlocal function pairs_sum_to_zero(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = pairs_sum_to_zero\n lu.assertEquals(candidate({1, 3, 5, 0}), false)\n lu.assertEquals(candidate({1, 3, -2, 1}), false)\n lu.assertEquals(candidate({1, 2, 3, 7}), false)\n lu.assertEquals(candidate({2, 4, -5, 3, 5, 7}), true)\n lu.assertEquals(candidate({1}), false)\n lu.assertEquals(candidate({-3, 9, -1, 3, 2, 30}), true)\n lu.assertEquals(candidate({-3, 9, -1, 3, 2, 31}), true)\n lu.assertEquals(candidate({-3, 9, -1, 4, 2, 30}), false)\n lu.assertEquals(candidate({-3, 9, -1, 4, 2, 31}), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "lua", - "prompt": "-- Write a function that accepts two lists of strings and returns the list that has \n-- total number of chars in the all strings of the list less than the other list.\n-- if the two lists have the same number of chars, return the first list.\n-- Examples\n-- >>> total_match({}, {})\n-- {}\n-- >>> total_match({'hi', 'admin'}, {'hI', 'Hi'})\n-- {'hI', 'Hi'}\n-- >>> total_match({'hi', 'admin'}, {'hi', 'hi', 'admin', 'project'})\n-- {'hi', 'admin'}\n-- >>> total_match({'hi', 'admin'}, {'hI', 'hi', 'hi'})\n-- {'hI', 'hi', 'hi'}\n-- >>> total_match({'4'}, {'1', '2', '3', '4', '5'})\n-- {'4'}\nlocal function total_match(lst1, lst2)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = total_match\n lu.assertEquals(candidate({}, {}), {})\n lu.assertEquals(candidate({'hi', 'admin'}, {'hi', 'hi'}), {'hi', 'hi'})\n lu.assertEquals(candidate({'hi', 'admin'}, {'hi', 'hi', 'admin', 'project'}), {'hi', 'admin'})\n lu.assertEquals(candidate({'4'}, {'1', '2', '3', '4', '5'}), {'4'})\n lu.assertEquals(candidate({'hi', 'admin'}, {'hI', 'Hi'}), {'hI', 'Hi'})\n lu.assertEquals(candidate({'hi', 'admin'}, {'hI', 'hi', 'hi'}), {'hI', 'hi', 'hi'})\n lu.assertEquals(candidate({'hi', 'admin'}, {'hI', 'hi', 'hii'}), {'hi', 'admin'})\n lu.assertEquals(candidate({}, {'this'}), {})\n lu.assertEquals(candidate({'this'}, {}), {})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "lua", - "prompt": "-- Circular shift the digits of the integer x, shift the digits right by shift\n-- and return the result as a string.\n-- If shift > number of digits, return digits reversed.\n-- >>> circular_shift(12, 1)\n-- '21'\n-- >>> circular_shift(12, 2)\n-- '12'\nlocal function circular_shift(x, shift)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = circular_shift\n lu.assertEquals(candidate(100, 2), '001')\n lu.assertEquals(candidate(12, 2), '12')\n lu.assertEquals(candidate(97, 8), '79')\n lu.assertEquals(candidate(12, 1), '21')\n lu.assertEquals(candidate(11, 101), '11')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "lua", - "prompt": "-- Return True is list elements are monotonically increasing or decreasing.\n-- >>> monotonic({1, 2, 4, 20})\n-- true\n-- >>> monotonic({1, 20, 4, 10})\n-- false\n-- >>> monotonic({4, 1, 0, -10})\n-- true\nlocal function monotonic(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = monotonic\n lu.assertEquals(candidate({1, 2, 4, 10}), true)\n lu.assertEquals(candidate({1, 2, 4, 20}), true)\n lu.assertEquals(candidate({1, 20, 4, 10}), false)\n lu.assertEquals(candidate({4, 1, 0, -10}), true)\n lu.assertEquals(candidate({4, 1, 1, 0}), true)\n lu.assertEquals(candidate({1, 2, 3, 2, 5, 60}), false)\n lu.assertEquals(candidate({1, 2, 3, 4, 5, 60}), true)\n lu.assertEquals(candidate({9, 9, 9, 9}), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "lua", - "prompt": "-- Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n-- Example\n-- >>> is_equal_to_sum_even(4)\n-- false\n-- >>> is_equal_to_sum_even(6)\n-- false\n-- >>> is_equal_to_sum_even(8)\n-- true\nlocal function is_equal_to_sum_even(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_equal_to_sum_even\n lu.assertEquals(candidate(4), false)\n lu.assertEquals(candidate(6), false)\n lu.assertEquals(candidate(8), true)\n lu.assertEquals(candidate(10), true)\n lu.assertEquals(candidate(11), false)\n lu.assertEquals(candidate(12), true)\n lu.assertEquals(candidate(13), false)\n lu.assertEquals(candidate(16), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "lua", - "prompt": "-- Input to this function is a string representing musical notes in a special ASCII format.\n-- Your task is to parse this string and return list of integers corresponding to how many beats does each\n-- not last.\n-- Here is a legend:\n-- 'o' - whole note, lasts four beats\n-- 'o|' - half note, lasts two beats\n-- '.|' - quater note, lasts one beat\n-- >>> parse_music('o o| .| o| o| .| .| .| .| o o')\n-- {4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4}\nlocal function parse_music(music_string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = parse_music\n lu.assertEquals(candidate(''), {})\n lu.assertEquals(candidate('o o o o'), {4, 4, 4, 4})\n lu.assertEquals(candidate('.| .| .| .|'), {1, 1, 1, 1})\n lu.assertEquals(candidate('o| o| .| .| o o o o'), {2, 2, 1, 1, 4, 4, 4, 4})\n lu.assertEquals(candidate('o| .| o| .| o o| o o|'), {2, 1, 2, 1, 4, 2, 4, 2})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "lua", - "prompt": "-- \"\n-- This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n-- multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n-- change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n-- Examples:\n-- >>> lst\n-- {1, 2, 3}\n-- >>> lst\n-- {}\n-- >>> lst\n-- {-1, -5, 2, -1, -5}\nlocal function sum_squares(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sum_squares\n lu.assertEquals(candidate({1, 2, 3}), 6)\n lu.assertEquals(candidate({1, 4, 9}), 14)\n lu.assertEquals(candidate({}), 0)\n lu.assertEquals(candidate({1, 1, 1, 1, 1, 1, 1, 1, 1}), 9)\n lu.assertEquals(candidate({-1, -1, -1, -1, -1, -1, -1, -1, -1}), -3)\n lu.assertEquals(candidate({0}), 0)\n lu.assertEquals(candidate({-1, -5, 2, -1, -5}), -126)\n lu.assertEquals(candidate({-56, -99, 1, 0, -2}), 3030)\n lu.assertEquals(candidate({-1, 0, 0, 0, 0, 0, 0, 0, -1}), 0)\n lu.assertEquals(candidate({-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37}), -14196)\n lu.assertEquals(candidate({-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10}), -1448)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "lua", - "prompt": "-- triples_sum_to_zero takes a list of integers as an input.\n-- it returns True if there are three distinct elements in the list that\n-- sum to zero, and False otherwise.\n-- >>> triples_sum_to_zero({1, 3, 5, 0})\n-- false\n-- >>> triples_sum_to_zero({1, 3, -2, 1})\n-- true\n-- >>> triples_sum_to_zero({1, 2, 3, 7})\n-- false\n-- >>> triples_sum_to_zero({2, 4, -5, 3, 9, 7})\n-- true\n-- >>> triples_sum_to_zero({1})\n-- false\nlocal function triples_sum_to_zero(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = triples_sum_to_zero\n lu.assertEquals(candidate({1, 3, 5, 0}), false)\n lu.assertEquals(candidate({1, 3, 5, -1}), false)\n lu.assertEquals(candidate({1, 3, -2, 1}), true)\n lu.assertEquals(candidate({1, 2, 3, 7}), false)\n lu.assertEquals(candidate({1, 2, 5, 7}), false)\n lu.assertEquals(candidate({2, 4, -5, 3, 9, 7}), true)\n lu.assertEquals(candidate({1}), false)\n lu.assertEquals(candidate({1, 3, 5, -100}), false)\n lu.assertEquals(candidate({100, 3, 5, -100}), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "lua", - "prompt": "-- brackets is a string of \"<\" and \">\".\n-- return True if every opening bracket has a corresponding closing bracket.\n-- >>> correct_bracketing('<')\n-- false\n-- >>> correct_bracketing('<>')\n-- true\n-- >>> correct_bracketing('<<><>>')\n-- true\n-- >>> correct_bracketing('><<>')\n-- false\nlocal function correct_bracketing(brackets)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = correct_bracketing\n lu.assertEquals(candidate('<>'), true)\n lu.assertEquals(candidate('<<><>>'), true)\n lu.assertEquals(candidate('<><><<><>><>'), true)\n lu.assertEquals(candidate('<><><<<><><>><>><<><><<>>>'), true)\n lu.assertEquals(candidate('<<<><>>>>'), false)\n lu.assertEquals(candidate('><<>'), false)\n lu.assertEquals(candidate('<'), false)\n lu.assertEquals(candidate('<<<<'), false)\n lu.assertEquals(candidate('>'), false)\n lu.assertEquals(candidate('<<>'), false)\n lu.assertEquals(candidate('<><><<><>><>><<>'), false)\n lu.assertEquals(candidate('<><><<><>><>>><>'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "lua", - "prompt": "-- Write a function that takes an array of numbers as input and returns \n-- the number of elements in the array that are greater than 10 and both \n-- first and last digits of a number are odd (1, 3, 5, 7, 9).\n-- For example:\n-- >>> specialFilter({15, -73, 14, -15})\n-- 1\n-- >>> specialFilter({33, -2, -3, 45, 21, 109})\n-- 2\nlocal function specialFilter(nums)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = specialFilter\n lu.assertEquals(candidate({5, -2, 1, -5}), 0)\n lu.assertEquals(candidate({15, -73, 14, -15}), 1)\n lu.assertEquals(candidate({33, -2, -3, 45, 21, 109}), 2)\n lu.assertEquals(candidate({43, -12, 93, 125, 121, 109}), 4)\n lu.assertEquals(candidate({71, -2, -33, 75, 21, 19}), 3)\n lu.assertEquals(candidate({1}), 0)\n lu.assertEquals(candidate({}), 0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "lua", - "prompt": "-- Given a dictionary, return True if all keys are strings in lower \n-- case or all keys are strings in upper case, else return False.\n-- The function should return False is the given dictionary is empty.\n-- Examples:\n-- >>> check_dict_case({['a'] = 'apple', ['b'] = 'banana'})\n-- true\n-- >>> check_dict_case({['a'] = 'apple', ['A'] = 'banana', ['B'] = 'banana'})\n-- false\n-- >>> check_dict_case({['a'] = 'apple', [8] = 'banana', ['a'] = 'apple'})\n-- false\n-- >>> check_dict_case({['Name'] = 'John', ['Age'] = '36', ['City'] = 'Houston'})\n-- false\n-- >>> check_dict_case({['STATE'] = 'NC', ['ZIP'] = '12345'})\n-- true\nlocal function check_dict_case(dict)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = check_dict_case\n lu.assertEquals(candidate({['p'] = 'pineapple', ['b'] = 'banana'}), true)\n lu.assertEquals(candidate({['p'] = 'pineapple', ['A'] = 'banana', ['B'] = 'banana'}), false)\n lu.assertEquals(candidate({['p'] = 'pineapple', ['5'] = 'banana', ['a'] = 'apple'}), false)\n lu.assertEquals(candidate({['Name'] = 'John', ['Age'] = '36', ['City'] = 'Houston'}), false)\n lu.assertEquals(candidate({['STATE'] = 'NC', ['ZIP'] = '12345'}), true)\n lu.assertEquals(candidate({['fruit'] = 'Orange', ['taste'] = 'Sweet'}), true)\n lu.assertEquals(candidate({}), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "lua", - "prompt": "-- Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n-- should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n-- alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n-- Examples\n-- >>> split_words('Hello world!')\n-- {'Hello', 'world!'}\n-- >>> split_words('Hello,world!')\n-- {'Hello', 'world!'}\n-- >>> split_words('abcdef')\n-- 3\nlocal function split_words(txt)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = split_words\n lu.assertEquals(candidate('Hello world!'), {'Hello', 'world!'})\n lu.assertEquals(candidate('Hello,world!'), {'Hello', 'world!'})\n lu.assertEquals(candidate('Hello world,!'), {'Hello', 'world,!'})\n lu.assertEquals(candidate('Hello,Hello,world !'), {'Hello,Hello,world', '!'})\n lu.assertEquals(candidate('abcdef'), 3)\n lu.assertEquals(candidate('aaabb'), 2)\n lu.assertEquals(candidate('aaaBb'), 1)\n lu.assertEquals(candidate(''), 0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "lua", - "prompt": "-- The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n-- fibfib(0) == 0\n-- fibfib(1) == 0\n-- fibfib(2) == 1\n-- fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n-- Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n-- >>> fibfib(1)\n-- 0\n-- >>> fibfib(5)\n-- 4\n-- >>> fibfib(8)\n-- 24\nlocal function fibfib(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = fibfib\n lu.assertEquals(candidate(2), 1)\n lu.assertEquals(candidate(1), 0)\n lu.assertEquals(candidate(5), 4)\n lu.assertEquals(candidate(8), 24)\n lu.assertEquals(candidate(10), 81)\n lu.assertEquals(candidate(12), 274)\n lu.assertEquals(candidate(14), 927)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "lua", - "prompt": "-- You are given a list of numbers.\n-- You need to return the sum of squared numbers in the given list,\n-- round each element in the list to the upper int(Ceiling) first.\n-- Examples:\n-- >>> lst({1.0, 2.0, 3.0})\n-- 14\n-- >>> lst({1.0, 4.0, 9.0})\n-- 98\n-- >>> lst({1.0, 3.0, 5.0, 7.0})\n-- 84\n-- >>> lst({1.4, 4.2, 0.0})\n-- 29\n-- >>> lst({-2.4, 1.0, 1.0})\n-- 6\nlocal function sum_squares(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sum_squares\n lu.assertEquals(candidate({1.0, 2.0, 3.0}), 14)\n lu.assertEquals(candidate({1.0, 2.0, 3.0}), 14)\n lu.assertEquals(candidate({1.0, 3.0, 5.0, 7.0}), 84)\n lu.assertEquals(candidate({1.4, 4.2, 0.0}), 29)\n lu.assertEquals(candidate({-2.4, 1.0, 1.0}), 6)\n lu.assertEquals(candidate({100.0, 1.0, 15.0, 2.0}), 10230)\n lu.assertEquals(candidate({10000.0, 10000.0}), 200000000)\n lu.assertEquals(candidate({-1.4, 4.6, 6.3}), 75)\n lu.assertEquals(candidate({-1.4, 17.9, 18.9, 19.9}), 1086)\n lu.assertEquals(candidate({0.0}), 0)\n lu.assertEquals(candidate({-1.0}), 1)\n lu.assertEquals(candidate({-1.0, 1.0, 0.0}), 2)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_85_add", - "language": "lua", - "prompt": "-- Given a non-empty list of integers lst. add the even elements that are at odd indices..\n-- Examples:\n-- >>> add({4, 2, 6, 7})\n-- 2\nlocal function add(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = add\n lu.assertEquals(candidate({4, 88}), 88)\n lu.assertEquals(candidate({4, 5, 6, 7, 2, 122}), 122)\n lu.assertEquals(candidate({4, 0, 6, 7}), 0)\n lu.assertEquals(candidate({4, 4, 6, 8}), 12)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "lua", - "prompt": "-- Return sorted unique elements in a list\n-- >>> unique({5, 3, 5, 2, 3, 3, 9, 0, 123})\n-- {0, 2, 3, 5, 9, 123}\nlocal function unique(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = unique\n lu.assertEquals(candidate({5, 3, 5, 2, 3, 3, 9, 0, 123}), {0, 2, 3, 5, 9, 123})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "lua", - "prompt": "-- Given a string text, replace all spaces in it with underscores, \n-- and if a string has more than 2 consecutive spaces, \n-- then replace all consecutive spaces with - \n-- >>> fix_spaces(' Example')\n-- 'Example'\n-- >>> fix_spaces(' Example 1')\n-- 'Example_1'\n-- >>> fix_spaces(' Example 2')\n-- '_Example_2'\n-- >>> fix_spaces(' Example 3')\n-- '_Example-3'\nlocal function fix_spaces(text)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = fix_spaces\n lu.assertEquals(candidate('Example'), 'Example')\n lu.assertEquals(candidate('Mudasir Hanif '), 'Mudasir_Hanif_')\n lu.assertEquals(candidate('Yellow Yellow Dirty Fellow'), 'Yellow_Yellow__Dirty__Fellow')\n lu.assertEquals(candidate('Exa mple'), 'Exa-mple')\n lu.assertEquals(candidate(' Exa 1 2 2 mple'), '-Exa_1_2_2_mple')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "lua", - "prompt": "-- Return 2^n modulo p (be aware of numerics).\n-- >>> modp(3, 5)\n-- 3\n-- >>> modp(1101, 101)\n-- 2\n-- >>> modp(0, 101)\n-- 1\n-- >>> modp(3, 11)\n-- 8\n-- >>> modp(100, 101)\n-- 1\nlocal function modp(n, p)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = modp\n lu.assertEquals(candidate(3, 5), 3)\n lu.assertEquals(candidate(1101, 101), 2)\n lu.assertEquals(candidate(0, 101), 1)\n lu.assertEquals(candidate(3, 11), 8)\n lu.assertEquals(candidate(100, 101), 1)\n lu.assertEquals(candidate(30, 5), 4)\n lu.assertEquals(candidate(31, 5), 3)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "lua", - "prompt": "-- You have to write a function which validates a given date string and\n-- returns True if the date is valid otherwise False.\n-- The date is valid if all of the following rules are satisfied:\n-- 1. The date string is not empty.\n-- 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n-- 3. The months should not be less than 1 or higher than 12.\n-- 4. The date should be in the format: mm-dd-yyyy\n-- >>> valid_date('03-11-2000')\n-- true\n-- >>> valid_date('15-01-2012')\n-- false\n-- >>> valid_date('04-0-2040')\n-- false\n-- >>> valid_date('06-04-2020')\n-- true\n-- >>> valid_date('06/04/2020')\n-- false\nlocal function valid_date(date)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = valid_date\n lu.assertEquals(candidate('03-11-2000'), true)\n lu.assertEquals(candidate('15-01-2012'), false)\n lu.assertEquals(candidate('04-0-2040'), false)\n lu.assertEquals(candidate('06-04-2020'), true)\n lu.assertEquals(candidate('01-01-2007'), true)\n lu.assertEquals(candidate('03-32-2011'), false)\n lu.assertEquals(candidate(''), false)\n lu.assertEquals(candidate('04-31-3000'), false)\n lu.assertEquals(candidate('06-06-2005'), true)\n lu.assertEquals(candidate('21-31-2000'), false)\n lu.assertEquals(candidate('04-12-2003'), true)\n lu.assertEquals(candidate('04122003'), false)\n lu.assertEquals(candidate('20030412'), false)\n lu.assertEquals(candidate('2003-04'), false)\n lu.assertEquals(candidate('2003-04-12'), false)\n lu.assertEquals(candidate('04-2003'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "lua", - "prompt": "-- Write a function that takes a string and returns an ordered version of it.\n-- Ordered version of string, is a string where all words (separated by space)\n-- are replaced by a new word where all the characters arranged in\n-- ascending order based on ascii value.\n-- Note: You should keep the order of words and blank spaces in the sentence.\n-- For example:\n-- >>> anti_shuffle('Hi')\n-- 'Hi'\n-- >>> anti_shuffle('hello')\n-- 'ehllo'\n-- >>> anti_shuffle('Hello World!!!')\n-- 'Hello !!!Wdlor'\nlocal function anti_shuffle(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = anti_shuffle\n lu.assertEquals(candidate('Hi'), 'Hi')\n lu.assertEquals(candidate('hello'), 'ehllo')\n lu.assertEquals(candidate('number'), 'bemnru')\n lu.assertEquals(candidate('abcd'), 'abcd')\n lu.assertEquals(candidate('Hello World!!!'), 'Hello !!!Wdlor')\n lu.assertEquals(candidate(''), '')\n lu.assertEquals(candidate('Hi. My name is Mister Robot. How are you?'), '.Hi My aemn is Meirst .Rboot How aer ?ouy')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "lua", - "prompt": "-- Given a list of numbers, return whether or not they are sorted\n-- in ascending order. If list has more than 1 duplicate of the same\n-- number, return False. Assume no negative numbers and only integers.\n-- Examples\n-- >>> is_sorted({5})\n-- true\n-- >>> is_sorted({1, 2, 3, 4, 5})\n-- true\n-- >>> is_sorted({1, 3, 2, 4, 5})\n-- false\n-- >>> is_sorted({1, 2, 3, 4, 5, 6})\n-- true\n-- >>> is_sorted({1, 2, 3, 4, 5, 6, 7})\n-- true\n-- >>> is_sorted({1, 3, 2, 4, 5, 6, 7})\n-- false\n-- >>> is_sorted({1, 2, 2, 3, 3, 4})\n-- true\n-- >>> is_sorted({1, 2, 2, 2, 3, 4})\n-- false\nlocal function is_sorted(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_sorted\n lu.assertEquals(candidate({5}), true)\n lu.assertEquals(candidate({1, 2, 3, 4, 5}), true)\n lu.assertEquals(candidate({1, 3, 2, 4, 5}), false)\n lu.assertEquals(candidate({1, 2, 3, 4, 5, 6}), true)\n lu.assertEquals(candidate({1, 2, 3, 4, 5, 6, 7}), true)\n lu.assertEquals(candidate({1, 3, 2, 4, 5, 6, 7}), false)\n lu.assertEquals(candidate({}), true)\n lu.assertEquals(candidate({1}), true)\n lu.assertEquals(candidate({3, 2, 1}), false)\n lu.assertEquals(candidate({1, 2, 2, 2, 3, 4}), false)\n lu.assertEquals(candidate({1, 2, 3, 3, 3, 4}), false)\n lu.assertEquals(candidate({1, 2, 2, 3, 3, 4}), true)\n lu.assertEquals(candidate({1, 2, 3, 4}), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "lua", - "prompt": "-- You are given a string s.\n-- Your task is to check if the string is happy or not.\n-- A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n-- For example:\n-- >>> is_happy('a')\n-- false\n-- >>> is_happy('aa')\n-- false\n-- >>> is_happy('abcd')\n-- true\n-- >>> is_happy('aabb')\n-- false\n-- >>> is_happy('adb')\n-- true\n-- >>> is_happy('xyy')\n-- false\nlocal function is_happy(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = is_happy\n lu.assertEquals(candidate('a'), false)\n lu.assertEquals(candidate('aa'), false)\n lu.assertEquals(candidate('abcd'), true)\n lu.assertEquals(candidate('aabb'), false)\n lu.assertEquals(candidate('adb'), true)\n lu.assertEquals(candidate('xyy'), false)\n lu.assertEquals(candidate('iopaxpoi'), true)\n lu.assertEquals(candidate('iopaxioi'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "lua", - "prompt": "-- Write a function that returns True if the object q will fly, and False otherwise.\n-- The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n-- Example:\n-- >>> will_it_fly({1, 2}, 5)\n-- false\n-- # 1+2 is less than the maximum possible weight, but it's unbalanced.\n-- >>> will_it_fly({3, 2, 3}, 1)\n-- false\n-- # it's balanced, but 3+2+3 is more than the maximum possible weight.\n-- >>> will_it_fly({3, 2, 3}, 9)\n-- true\n-- # 3+2+3 is less than the maximum possible weight, and it's balanced.\n-- >>> will_it_fly({3}, 5)\n-- true\n-- # 3 is less than the maximum possible weight, and it's balanced.\nlocal function will_it_fly(q, w)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = will_it_fly\n lu.assertEquals(candidate({3, 2, 3}, 9), true)\n lu.assertEquals(candidate({1, 2}, 5), false)\n lu.assertEquals(candidate({3}, 5), true)\n lu.assertEquals(candidate({3, 2, 3}, 1), false)\n lu.assertEquals(candidate({1, 2, 3}, 6), false)\n lu.assertEquals(candidate({5}, 5), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "lua", - "prompt": "-- Given an array of non-negative integers, return a copy of the given array after sorting,\n-- you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n-- or sort it in descending order if the sum( first index value, last index value) is even.\n-- Note:\n-- * don't change the given array.\n-- Examples:\n-- >>> sort_array({})\n-- {}\n-- >>> sort_array({5})\n-- {5}\n-- >>> sort_array({2, 4, 3, 0, 1, 5})\n-- {0, 1, 2, 3, 4, 5}\n-- >>> sort_array({2, 4, 3, 0, 1, 5, 6})\n-- {6, 5, 4, 3, 2, 1, 0}\nlocal function sort_array(array)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sort_array\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({5}), {5})\n lu.assertEquals(candidate({2, 4, 3, 0, 1, 5}), {0, 1, 2, 3, 4, 5})\n lu.assertEquals(candidate({2, 4, 3, 0, 1, 5, 6}), {6, 5, 4, 3, 2, 1, 0})\n lu.assertEquals(candidate({2, 1}), {1, 2})\n lu.assertEquals(candidate({15, 42, 87, 32, 11, 0}), {0, 11, 15, 32, 42, 87})\n lu.assertEquals(candidate({21, 14, 23, 11}), {23, 21, 14, 11})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "lua", - "prompt": "-- Implement a function that takes an non-negative integer and returns an array of the first n\n-- integers that are prime numbers and less than n.\n-- for example:\n-- >>> count_up_to(5)\n-- {2, 3}\n-- >>> count_up_to(11)\n-- {2, 3, 5, 7}\n-- >>> count_up_to(0)\n-- {}\n-- >>> count_up_to(20)\n-- {2, 3, 5, 7, 11, 13, 17, 19}\n-- >>> count_up_to(1)\n-- {}\n-- >>> count_up_to(18)\n-- {2, 3, 5, 7, 11, 13, 17}\nlocal function count_up_to(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = count_up_to\n lu.assertEquals(candidate(5), {2, 3})\n lu.assertEquals(candidate(6), {2, 3, 5})\n lu.assertEquals(candidate(7), {2, 3, 5})\n lu.assertEquals(candidate(10), {2, 3, 5, 7})\n lu.assertEquals(candidate(0), {})\n lu.assertEquals(candidate(22), {2, 3, 5, 7, 11, 13, 17, 19})\n lu.assertEquals(candidate(1), {})\n lu.assertEquals(candidate(18), {2, 3, 5, 7, 11, 13, 17})\n lu.assertEquals(candidate(47), {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43})\n lu.assertEquals(candidate(101), {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "lua", - "prompt": "-- Out of list of strings, return the longest one. Return the first one in case of multiple\n-- strings of the same length. Return None in case the input list is empty.\n-- >>> longest({})\n-- None\n-- >>> longest({'a', 'b', 'c'})\n-- 'a'\n-- >>> longest({'a', 'bb', 'ccc'})\n-- 'ccc'\nlocal function longest(strings)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = longest\n lu.assertEquals(candidate({}), None)\n lu.assertEquals(candidate({'x', 'y', 'z'}), 'x')\n lu.assertEquals(candidate({'x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc'}), 'zzzz')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "lua", - "prompt": "-- Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n-- reverse the resulting array, and then replace each digit by its corresponding name from\n-- \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n-- For example:\n-- >>> by_length({2, 1, 1, 4, 5, 8, 2, 3})\n-- {'Eight', 'Five', 'Four', 'Three', 'Two', 'Two', 'One', 'One'}\n-- If the array is empty, return an empty array:\n-- >>> by_length({})\n-- {}\n-- If the array has any strange number ignore it:\n-- >>> by_length({1, -1, 55})\n-- {'One'}\nlocal function by_length(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = by_length\n lu.assertEquals(candidate({2, 1, 1, 4, 5, 8, 2, 3}), {'Eight', 'Five', 'Four', 'Three', 'Two', 'Two', 'One', 'One'})\n lu.assertEquals(candidate({}), {})\n lu.assertEquals(candidate({1, -1, 55}), {'One'})\n lu.assertEquals(candidate({1, -1, 3, 2}), {'Three', 'Two', 'One'})\n lu.assertEquals(candidate({9, 4, 8}), {'Nine', 'Eight', 'Four'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_106_f", - "language": "lua", - "prompt": "-- Implement the function f that takes n as a parameter,\n-- 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\n-- or the sum of numbers from 1 to i otherwise.\n-- i starts from 1.\n-- the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n-- Example:\n-- >>> f(5)\n-- {1, 2, 6, 24, 15}\nlocal function f(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = f\n lu.assertEquals(candidate(5), {1, 2, 6, 24, 15})\n lu.assertEquals(candidate(7), {1, 2, 6, 24, 15, 720, 28})\n lu.assertEquals(candidate(1), {1})\n lu.assertEquals(candidate(3), {1, 2, 6})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "lua", - "prompt": "-- Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n-- >>> fizz_buzz(50)\n-- 0\n-- >>> fizz_buzz(78)\n-- 2\n-- >>> fizz_buzz(79)\n-- 3\nlocal function fizz_buzz(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = fizz_buzz\n lu.assertEquals(candidate(50), 0)\n lu.assertEquals(candidate(78), 2)\n lu.assertEquals(candidate(79), 3)\n lu.assertEquals(candidate(100), 3)\n lu.assertEquals(candidate(200), 6)\n lu.assertEquals(candidate(4000), 192)\n lu.assertEquals(candidate(10000), 639)\n lu.assertEquals(candidate(100000), 8026)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "lua", - "prompt": "-- Given a positive floating point number, it can be decomposed into\n-- and integer part (largest integer smaller than given number) and decimals\n-- (leftover part always smaller than 1).\n-- Return the decimal part of the number.\n-- >>> truncate_number(3.5)\n-- 0.5\nlocal function truncate_number(number)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = truncate_number\n lu.assertEquals(candidate(3.5), 0.5)\n lu.assertEquals(candidate(1.25), 0.25)\n lu.assertEquals(candidate(123.0), 0.0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "lua", - "prompt": "-- For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n-- Empty sum should be equal to 0 and empty product should be equal to 1.\n-- >>> sum_product({})\n-- {0, 1}\n-- >>> sum_product({1, 2, 3, 4})\n-- {10, 24}\nlocal function sum_product(numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = sum_product\n lu.assertEquals(candidate({}), {0, 1})\n lu.assertEquals(candidate({1, 1, 1}), {3, 1})\n lu.assertEquals(candidate({100, 0}), {100, 0})\n lu.assertEquals(candidate({3, 5, 7}), {15, 105})\n lu.assertEquals(candidate({10}), {10, 10})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "lua", - "prompt": "-- You are given a 2 dimensional data, as a nested lists,\n-- which is similar to matrix, however, unlike matrices,\n-- each row may contain a different number of columns.\n-- Given lst, and integer x, find integers x in the list,\n-- and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n-- each tuple is a coordinate - (row, columns), starting with 0.\n-- Sort coordinates initially by rows in ascending order.\n-- Also, sort coordinates of the row by columns in descending order.\n-- Examples:\n-- >>> get_row({{1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 1, 6}, {1, 2, 3, 4, 5, 1}}, 1)\n-- {{0, 0}, {1, 4}, {1, 0}, {2, 5}, {2, 0}}\n-- >>> get_row({}, 1)\n-- {}\n-- >>> get_row({{}, {1}, {1, 2, 3}}, 3)\n-- {{2, 2}}\nlocal function get_row(lst, x)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = get_row\n lu.assertEquals(candidate({{1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 1, 6}, {1, 2, 3, 4, 5, 1}}, 1), {{0, 0}, {1, 4}, {1, 0}, {2, 5}, {2, 0}})\n lu.assertEquals(candidate({{1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 6}}, 2), {{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}, {5, 1}})\n lu.assertEquals(candidate({{1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 6}, {1, 1, 3, 4, 5, 6}, {1, 2, 1, 4, 5, 6}, {1, 2, 3, 1, 5, 6}, {1, 2, 3, 4, 1, 6}, {1, 2, 3, 4, 5, 1}}, 1), {{0, 0}, {1, 0}, {2, 1}, {2, 0}, {3, 2}, {3, 0}, {4, 3}, {4, 0}, {5, 4}, {5, 0}, {6, 5}, {6, 0}})\n lu.assertEquals(candidate({}, 1), {})\n lu.assertEquals(candidate({{1}}, 2), {})\n lu.assertEquals(candidate({{}, {1}, {1, 2, 3}}, 3), {{2, 2}})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "lua", - "prompt": "-- You're a hungry rabbit, and you already have eaten a certain number of carrots,\n-- but now you need to eat more carrots to complete the day's meals.\n-- you should return an array of [ total number of eaten carrots after your meals,\n-- the number of carrots left after your meals ]\n-- if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n-- Example:\n-- >>> eat(5, 6, 10)\n-- {11, 4}\n-- >>> eat(4, 8, 9)\n-- {12, 1}\n-- >>> eat(1, 10, 10)\n-- {11, 0}\n-- >>> eat(2, 11, 5)\n-- {7, 0}\n-- Variables:\n-- @number : integer\n-- the number of carrots that you have eaten.\n-- @need : integer\n-- the number of carrots that you need to eat.\n-- @remaining : integer\n-- the number of remaining carrots thet exist in stock\n-- Constrain:\n-- * 0 <= number <= 1000\n-- * 0 <= need <= 1000\n-- * 0 <= remaining <= 1000\n-- Have fun :)\nlocal function eat(number, need, remaining)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = eat\n lu.assertEquals(candidate(5, 6, 10), {11, 4})\n lu.assertEquals(candidate(4, 8, 9), {12, 1})\n lu.assertEquals(candidate(1, 10, 10), {11, 0})\n lu.assertEquals(candidate(2, 11, 5), {7, 0})\n lu.assertEquals(candidate(4, 5, 7), {9, 2})\n lu.assertEquals(candidate(4, 5, 1), {5, 0})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "lua", - "prompt": "-- Given a positive integer N, return the total sum of its digits in binary.\n-- Example\n-- >>> solve(1000)\n-- '1'\n-- >>> solve(150)\n-- '110'\n-- >>> solve(147)\n-- '1100'\n-- Variables:\n-- @N integer\n-- Constraints: 0 \u2264 N \u2264 10000.\n-- Output:\n-- a string of binary number\nlocal function solve(N)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = solve\n lu.assertEquals(candidate(1000), '1')\n lu.assertEquals(candidate(150), '110')\n lu.assertEquals(candidate(147), '1100')\n lu.assertEquals(candidate(333), '1001')\n lu.assertEquals(candidate(963), '10010')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "lua", - "prompt": "-- You are given a list of integers.\n-- You need to find the largest prime value and return the sum of its digits.\n-- Examples:\n-- >>> skjkasdkd({0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3})\n-- 10\n-- >>> skjkasdkd({1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1})\n-- 25\n-- >>> skjkasdkd({1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3})\n-- 13\n-- >>> skjkasdkd({0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6})\n-- 11\n-- >>> skjkasdkd({0, 81, 12, 3, 1, 21})\n-- 3\n-- >>> skjkasdkd({0, 8, 1, 2, 1, 7})\n-- 7\nlocal function skjkasdkd(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = skjkasdkd\n lu.assertEquals(candidate({0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3}), 10)\n lu.assertEquals(candidate({1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1}), 25)\n lu.assertEquals(candidate({1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3}), 13)\n lu.assertEquals(candidate({0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6}), 11)\n lu.assertEquals(candidate({0, 81, 12, 3, 1, 21}), 3)\n lu.assertEquals(candidate({0, 8, 1, 2, 1, 7}), 7)\n lu.assertEquals(candidate({8191}), 19)\n lu.assertEquals(candidate({8191, 123456, 127, 7}), 19)\n lu.assertEquals(candidate({127, 97, 8192}), 10)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "lua", - "prompt": "-- Given an array arr of integers, find the minimum number of elements that\n-- need to be changed to make the array palindromic. A palindromic array is an array that\n-- is read the same backwards and forwards. In one change, you can change one element to any other element.\n-- For example:\n-- >>> smallest_change({1, 2, 3, 5, 4, 7, 9, 6})\n-- 4\n-- >>> smallest_change({1, 2, 3, 4, 3, 2, 2})\n-- 1\n-- >>> smallest_change({1, 2, 3, 2, 1})\n-- 0\nlocal function smallest_change(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = smallest_change\n lu.assertEquals(candidate({1, 2, 3, 5, 4, 7, 9, 6}), 4)\n lu.assertEquals(candidate({1, 2, 3, 4, 3, 2, 2}), 1)\n lu.assertEquals(candidate({1, 4, 2}), 1)\n lu.assertEquals(candidate({1, 4, 4, 2}), 1)\n lu.assertEquals(candidate({1, 2, 3, 2, 1}), 0)\n lu.assertEquals(candidate({3, 1, 1, 3}), 0)\n lu.assertEquals(candidate({1}), 0)\n lu.assertEquals(candidate({0, 1}), 1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "lua", - "prompt": "-- It is the last week of the semester and the teacher has to give the grades\n-- to students. The teacher has been making her own algorithm for grading.\n-- The only problem is, she has lost the code she used for grading.\n-- She has given you a list of GPAs for some students and you have to write \n-- a function that can output a list of letter grades using the following table:\n-- GPA | Letter grade\n-- 4.0 A+\n-- > 3.7 A \n-- > 3.3 A- \n-- > 3.0 B+\n-- > 2.7 B \n-- > 2.3 B-\n-- > 2.0 C+\n-- > 1.7 C\n-- > 1.3 C-\n-- > 1.0 D+ \n-- > 0.7 D \n-- > 0.0 D-\n-- 0.0 E\n-- Example:\n-- >>> grade_equation({4.0, 3, 1.7, 2, 3.5})\n-- {'A+', 'B', 'C-', 'C', 'A-'}\nlocal function numerical_letter_grade(grades)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = numerical_letter_grade\n lu.assertEquals(candidate({4.0, 3, 1.7, 2, 3.5}), {'A+', 'B', 'C-', 'C', 'A-'})\n lu.assertEquals(candidate({1.2}), {'D+'})\n lu.assertEquals(candidate({0.5}), {'D-'})\n lu.assertEquals(candidate({0.0}), {'E'})\n lu.assertEquals(candidate({1.0, 0.3, 1.5, 2.8, 3.3}), {'D', 'D-', 'C-', 'B', 'B+'})\n lu.assertEquals(candidate({0.0, 0.7}), {'E', 'D-'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "lua", - "prompt": "-- Given the lengths of the three sides of a triangle. Return the area of\n-- the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n-- Otherwise return -1\n-- Three sides make a valid triangle when the sum of any two sides is greater \n-- than the third side.\n-- Example:\n-- >>> triangle_area(3, 4, 5)\n-- 6.0\n-- >>> triangle_area(1, 2, 10)\n-- -1\nlocal function triangle_area(a, b, c)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = triangle_area\n lu.assertEquals(candidate(3, 4, 5), 6.0)\n lu.assertEquals(candidate(1, 2, 10), -1)\n lu.assertEquals(candidate(4, 8, 5), 8.18)\n lu.assertEquals(candidate(2, 2, 2), 1.73)\n lu.assertEquals(candidate(1, 2, 3), -1)\n lu.assertEquals(candidate(10, 5, 7), 16.25)\n lu.assertEquals(candidate(2, 6, 3), -1)\n lu.assertEquals(candidate(1, 1, 1), 0.43)\n lu.assertEquals(candidate(2, 2, 10), -1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "lua", - "prompt": "-- Check if two words have the same characters.\n-- >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n-- true\n-- >>> same_chars('abcd', 'dddddddabc')\n-- true\n-- >>> same_chars('dddddddabc', 'abcd')\n-- true\n-- >>> same_chars('eabcd', 'dddddddabc')\n-- false\n-- >>> same_chars('abcd', 'dddddddabce')\n-- false\n-- >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc')\n-- false\nlocal function same_chars(s0, s1)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = same_chars\n lu.assertEquals(candidate('eabcdzzzz', 'dddzzzzzzzddeddabc'), true)\n lu.assertEquals(candidate('abcd', 'dddddddabc'), true)\n lu.assertEquals(candidate('dddddddabc', 'abcd'), true)\n lu.assertEquals(candidate('eabcd', 'dddddddabc'), false)\n lu.assertEquals(candidate('abcd', 'dddddddabcf'), false)\n lu.assertEquals(candidate('eabcdzzzz', 'dddzzzzzzzddddabc'), false)\n lu.assertEquals(candidate('aabb', 'aaccc'), false)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "lua", - "prompt": "-- Given an array of integers nums, find the minimum sum of any non-empty sub-array\n-- of nums.\n-- Example\n-- >>> minSubArraySum({2, 3, 4, 1, 2, 4})\n-- 1\n-- >>> minSubArraySum({-1, -2, -3})\n-- -6\nlocal function minSubArraySum(nums)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = minSubArraySum\n lu.assertEquals(candidate({2, 3, 4, 1, 2, 4}), 1)\n lu.assertEquals(candidate({-1, -2, -3}), -6)\n lu.assertEquals(candidate({-1, -2, -3, 2, -10}), -14)\n lu.assertEquals(candidate({-9999999999999999}), -9999999999999999)\n lu.assertEquals(candidate({0, 10, 20, 1000000}), 0)\n lu.assertEquals(candidate({-1, -2, -3, 10, -5}), -6)\n lu.assertEquals(candidate({100, -1, -2, -3, 10, -5}), -6)\n lu.assertEquals(candidate({10, 11, 13, 8, 3, 4}), 3)\n lu.assertEquals(candidate({100, -33, 32, -1, 0, -2}), -33)\n lu.assertEquals(candidate({-10}), -10)\n lu.assertEquals(candidate({7}), 7)\n lu.assertEquals(candidate({1, -1}), -1)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "lua", - "prompt": "-- Given a string s and a natural number n, you have been tasked to implement \n-- a function that returns a list of all words from string s that contain exactly \n-- n consonants, in order these words appear in the string s.\n-- If the string s is empty then the function should return an empty list.\n-- Note: you may assume the input string contains only letters and spaces.\n-- Examples:\n-- >>> select_words('Mary had a little lamb', 4)\n-- {'little'}\n-- >>> select_words('Mary had a little lamb', 3)\n-- {'Mary', 'lamb'}\n-- >>> select_words('simple white space', 2)\n-- {}\n-- >>> select_words('Hello world', 4)\n-- {'world'}\n-- >>> select_words('Uncle sam', 3)\n-- {'Uncle'}\nlocal function select_words(s, n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = select_words\n lu.assertEquals(candidate('Mary had a little lamb', 4), {'little'})\n lu.assertEquals(candidate('Mary had a little lamb', 3), {'Mary', 'lamb'})\n lu.assertEquals(candidate('simple white space', 2), {})\n lu.assertEquals(candidate('Hello world', 4), {'world'})\n lu.assertEquals(candidate('Uncle sam', 3), {'Uncle'})\n lu.assertEquals(candidate('', 4), {})\n lu.assertEquals(candidate('a b c d e f', 1), {'b', 'c', 'd', 'f'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "lua", - "prompt": "-- Return list of all prefixes from shortest to longest of the input string\n-- >>> all_prefixes('abc')\n-- {'a', 'ab', 'abc'}\nlocal function all_prefixes(string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = all_prefixes\n lu.assertEquals(candidate(''), {})\n lu.assertEquals(candidate('asdfgh'), {'a', 'as', 'asd', 'asdf', 'asdfg', 'asdfgh'})\n lu.assertEquals(candidate('WWW'), {'W', 'WW', 'WWW'})\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "lua", - "prompt": "-- Create a function that takes a value (string) representing a number\n-- and returns the closest integer to it. If the number is equidistant\n-- from two integers, round it away from zero.\n-- Examples\n-- >>> closest_integer('10')\n-- 10\n-- >>> closest_integer('15.3')\n-- 15\n-- Note:\n-- Rounding away from zero means that if the given number is equidistant\n-- from two integers, the one you should return is the one that is the\n-- farthest from zero. For example closest_integer(\"14.5\") should\n-- return 15 and closest_integer(\"-14.5\") should return -15.\nlocal function closest_integer(value)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = closest_integer\n lu.assertEquals(candidate('10'), 10)\n lu.assertEquals(candidate('14.5'), 15)\n lu.assertEquals(candidate('-15.5'), -16)\n lu.assertEquals(candidate('15.3'), 15)\n lu.assertEquals(candidate('0'), 0)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "lua", - "prompt": "-- Create a function which takes a string representing a file's name, and returns\n-- 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n-- A file's name is considered to be valid if and only if all the following conditions \n-- are met:\n-- - There should not be more than three digits ('0'-'9') in the file's name.\n-- - The file's name contains exactly one dot '.'\n-- - The substring before the dot should not be empty, and it starts with a letter from \n-- the latin alphapet ('a'-'z' and 'A'-'Z').\n-- - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n-- Examples:\n-- >>> file_name_check('example.txt')\n-- 'Yes'\n-- >>> file_name_check('1example.dll')\n-- 'No'\nlocal function file_name_check(file_name)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = file_name_check\n lu.assertEquals(candidate('example.txt'), 'Yes')\n lu.assertEquals(candidate('1example.dll'), 'No')\n lu.assertEquals(candidate('s1sdf3.asd'), 'No')\n lu.assertEquals(candidate('K.dll'), 'Yes')\n lu.assertEquals(candidate('MY16FILE3.exe'), 'Yes')\n lu.assertEquals(candidate('His12FILE94.exe'), 'No')\n lu.assertEquals(candidate('_Y.txt'), 'No')\n lu.assertEquals(candidate('?aREYA.exe'), 'No')\n lu.assertEquals(candidate('/this_is_valid.dll'), 'No')\n lu.assertEquals(candidate('this_is_valid.wow'), 'No')\n lu.assertEquals(candidate('this_is_valid.txt'), 'Yes')\n lu.assertEquals(candidate('this_is_valid.txtexe'), 'No')\n lu.assertEquals(candidate('#this2_i4s_5valid.ten'), 'No')\n lu.assertEquals(candidate('@this1_is6_valid.exe'), 'No')\n lu.assertEquals(candidate('this_is_12valid.6exe4.txt'), 'No')\n lu.assertEquals(candidate('all.exe.txt'), 'No')\n lu.assertEquals(candidate('I563_No.exe'), 'Yes')\n lu.assertEquals(candidate('Is3youfault.txt'), 'Yes')\n lu.assertEquals(candidate('no_one#knows.dll'), 'Yes')\n lu.assertEquals(candidate('1I563_Yes3.exe'), 'No')\n lu.assertEquals(candidate('I563_Yes3.txtt'), 'No')\n lu.assertEquals(candidate('final..txt'), 'No')\n lu.assertEquals(candidate('final132'), 'No')\n lu.assertEquals(candidate('_f4indsartal132.'), 'No')\n lu.assertEquals(candidate('.txt'), 'No')\n lu.assertEquals(candidate('s.'), 'No')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "lua", - "prompt": "-- You are given two intervals,\n-- where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n-- The given intervals are closed which means that the interval (start, end)\n-- includes both start and end.\n-- For each given interval, it is assumed that its start is less or equal its end.\n-- Your task is to determine whether the length of intersection of these two \n-- intervals is a prime number.\n-- Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n-- which its length is 1, which not a prime number.\n-- If the length of the intersection is a prime number, return \"YES\",\n-- otherwise, return \"NO\".\n-- If the two intervals don't intersect, return \"NO\".\n-- [input/output] samples:\n-- >>> intersection({1, 2}, {2, 3})\n-- 'NO'\n-- >>> intersection({-1, 1}, {0, 4})\n-- 'NO'\n-- >>> intersection({-3, -1}, {-5, 5})\n-- 'YES'\nlocal function intersection(interval1, interval2)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = intersection\n lu.assertEquals(candidate({1, 2}, {2, 3}), 'NO')\n lu.assertEquals(candidate({-1, 1}, {0, 4}), 'NO')\n lu.assertEquals(candidate({-3, -1}, {-5, 5}), 'YES')\n lu.assertEquals(candidate({-2, 2}, {-4, 0}), 'YES')\n lu.assertEquals(candidate({-11, 2}, {-1, -1}), 'NO')\n lu.assertEquals(candidate({1, 2}, {3, 5}), 'NO')\n lu.assertEquals(candidate({1, 2}, {1, 2}), 'NO')\n lu.assertEquals(candidate({-2, -2}, {-3, -2}), 'NO')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "lua", - "prompt": "-- Return the largest prime factor of n. Assume n > 1 and is not a prime.\n-- >>> largest_prime_factor(13195)\n-- 29\n-- >>> largest_prime_factor(2048)\n-- 2\nlocal function largest_prime_factor(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = largest_prime_factor\n lu.assertEquals(candidate(15), 5)\n lu.assertEquals(candidate(27), 3)\n lu.assertEquals(candidate(63), 7)\n lu.assertEquals(candidate(330), 11)\n lu.assertEquals(candidate(13195), 29)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "lua", - "prompt": "-- Given a string, find out how many distinct characters (regardless of case) does it consist of\n-- >>> count_distinct_characters('xyzXYZ')\n-- 3\n-- >>> count_distinct_characters('Jerry')\n-- 4\nlocal function count_distinct_characters(string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = count_distinct_characters\n lu.assertEquals(candidate(''), 0)\n lu.assertEquals(candidate('abcde'), 5)\n lu.assertEquals(candidate('abcdecadeCADE'), 5)\n lu.assertEquals(candidate('aaaaAAAAaaaa'), 1)\n lu.assertEquals(candidate('Jerry jERRY JeRRRY'), 5)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "lua", - "prompt": "-- You're given a list of deposit and withdrawal operations on a bank account that starts with\n-- zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n-- at that point function should return True. Otherwise it should return False.\n-- >>> below_zero({1, 2, 3})\n-- false\n-- >>> below_zero({1, 2, -4, 5})\n-- true\nlocal function below_zero(operations)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = below_zero\n lu.assertEquals(candidate({}), false)\n lu.assertEquals(candidate({1, 2, -3, 1, 2, -3}), false)\n lu.assertEquals(candidate({1, 2, -4, 5, 6}), true)\n lu.assertEquals(candidate({1, -1, 2, -2, 5, -5, 4, -4}), false)\n lu.assertEquals(candidate({1, -1, 2, -2, 5, -5, 4, -5}), true)\n lu.assertEquals(candidate({1, -2, 2, -2, 5, -5, 4, -4}), true)\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "lua", - "prompt": "-- Find the shortest palindrome that begins with a supplied string.\n-- Algorithm idea is simple:\n-- - Find the longest postfix of supplied string that is a palindrome.\n-- - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n-- >>> make_palindrome('')\n-- ''\n-- >>> make_palindrome('cat')\n-- 'catac'\n-- >>> make_palindrome('cata')\n-- 'catac'\nlocal function make_palindrome(string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = make_palindrome\n lu.assertEquals(candidate(''), '')\n lu.assertEquals(candidate('x'), 'x')\n lu.assertEquals(candidate('xyz'), 'xyzyx')\n lu.assertEquals(candidate('xyx'), 'xyx')\n lu.assertEquals(candidate('jerry'), 'jerryrrej')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "lua", - "prompt": "-- Given a positive integer, obtain its roman numeral equivalent as a string,\n-- and return it in lowercase.\n-- Restrictions: 1 <= num <= 1000\n-- Examples:\n-- >>> int_to_mini_roman(19)\n-- 'xix'\n-- >>> int_to_mini_roman(152)\n-- 'clii'\n-- >>> int_to_mini_roman(426)\n-- 'cdxxvi'\nlocal function int_to_mini_roman(number)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "lu = require('luaunit')\n\nfunction test_humaneval()\nlocal candidate = int_to_mini_roman\n lu.assertEquals(candidate(19), 'xix')\n lu.assertEquals(candidate(152), 'clii')\n lu.assertEquals(candidate(251), 'ccli')\n lu.assertEquals(candidate(426), 'cdxxvi')\n lu.assertEquals(candidate(500), 'd')\n lu.assertEquals(candidate(1), 'i')\n lu.assertEquals(candidate(4), 'iv')\n lu.assertEquals(candidate(43), 'xliii')\n lu.assertEquals(candidate(90), 'xc')\n lu.assertEquals(candidate(94), 'xciv')\n lu.assertEquals(candidate(532), 'dxxxii')\n lu.assertEquals(candidate(900), 'cm')\n lu.assertEquals(candidate(994), 'cmxciv')\n lu.assertEquals(candidate(1000), 'm')\nend\n\nos.exit(lu.LuaUnit.run())", - "stop_tokens": [ - "\nlocal", - "\nfunction", - "\n--", - "\n\n" - ] - } -] \ No newline at end of file diff --git a/data/php-keep.json b/data/php-keep.json deleted file mode 100644 index e66af846e56769e527f104f11e6cd4e367e749bd..0000000000000000000000000000000000000000 --- a/data/php-keep.json +++ /dev/null @@ -1,2417 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "php", - "prompt": ">> largest_divisor(15)\n// 5\nfunction largest_divisor($n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return largest_divisor(...$args);\n}\n\nfunction test(): void {\n if (candidate(3) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(7) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(10) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(100) !== 50) { throw new Exception(\"Test failed!\"); }\n if (candidate(49) !== 7) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_47_median", - "language": "php", - "prompt": ">> median([3, 1, 2, 4, 5])\n// 3\n// >>> median([-10, 4, 6, 1000, 10, 20])\n// 15.0\nfunction median($l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return median(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(3, 1, 2, 4, 5)) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-10, 4, 6, 1000, 10, 20)) !== 8.0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5)) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(6, 5)) !== 5.5) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(8, 1, 3, 9, 9, 2, 7)) !== 7) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "php", - "prompt": " result = 9\n// Note:\n// The length of operator list is equal to the length of operand list minus one.\n// Operand is a list of of non-negative integers.\n// Operator list has at least one operator, and operand list has at least two operands.\nfunction do_algebra($operator, $operand) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return do_algebra(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(\"**\", \"*\", \"+\"), array(2, 3, 4, 5)) !== 37) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"+\", \"*\", \"-\"), array(2, 3, 4, 5)) !== 9) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"//\", \"*\"), array(7, 3, 4)) !== 8) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "php", - "prompt": ">> max_element([1, 2, 3])\n// 3\n// >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n// 123\nfunction max_element($l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return max_element(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2, 3)) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10)) !== 124) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "php", - "prompt": ">> is_prime(6)\n// False\n// >>> is_prime(101)\n// True\n// >>> is_prime(11)\n// True\n// >>> is_prime(13441)\n// True\n// >>> is_prime(61)\n// True\n// >>> is_prime(4)\n// False\n// >>> is_prime(1)\n// False\nfunction is_prime($n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return is_prime(...$args);\n}\n\nfunction test(): void {\n if (candidate(6) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(101) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(11) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(13441) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(61) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(4) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(1) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(5) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(11) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(17) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(85) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(77) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(255379) !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "php", - "prompt": ">> unique_digits([15, 33, 1422, 1])\n// [1, 15, 33]\n// >>> unique_digits([152, 323, 1422, 10])\n// []\nfunction unique_digits($x) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return unique_digits(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(15, 33, 1422, 1)) !== array(1, 15, 33)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(152, 323, 1422, 10)) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(12345, 2033, 111, 151)) !== array(111, 151)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(135, 103, 31)) !== array(31, 135)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "php", - "prompt": ">> string_xor('010', '110')\n// '100'\nfunction string_xor($a, $b) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return string_xor(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"111000\", \"101010\") !== \"010010\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1\", \"1\") !== \"0\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"0101\", \"0000\") !== \"0101\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "php", - "prompt": ">> sum_to_n(30)\n// 465\n// >>> sum_to_n(100)\n// 5050\n// >>> sum_to_n(5)\n// 15\n// >>> sum_to_n(10)\n// 55\n// >>> sum_to_n(1)\n// 1\nfunction sum_to_n($n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return sum_to_n(...$args);\n}\n\nfunction test(): void {\n if (candidate(1) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(6) !== 21) { throw new Exception(\"Test failed!\"); }\n if (candidate(11) !== 66) { throw new Exception(\"Test failed!\"); }\n if (candidate(30) !== 465) { throw new Exception(\"Test failed!\"); }\n if (candidate(100) !== 5050) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "php", - "prompt": ">> strlen('')\n// 0\n// >>> strlen('abc')\n// 3\nfunction strlen($string) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return strlen(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\") !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"x\") !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"asdasnakj\") !== 9) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "php", - "prompt": ">> is_bored(\"Hello world\")\n// 0\n// >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n// 1\nfunction is_bored($S) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return is_bored(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"Hello world\") !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Is the sky blue?\") !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"I love It !\") !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"bIt\") !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"I feel good today. I will be productive. will kill It\") !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"You and I are going for a walk\") !== 0) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "php", - "prompt": ">> vowels_count(\"abcde\")\n// 2\n// >>> vowels_count(\"ACEDY\")\n// 3\nfunction vowels_count($s) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return vowels_count(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"abcde\") !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Alone\") !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"key\") !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"bye\") !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"keY\") !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"bYe\") !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"ACEDY\") !== 3) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "php", - "prompt": ">> fib(10)\n// 55\n// >>> fib(1)\n// 1\n// >>> fib(8)\n// 21\nfunction fib($n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return fib(...$args);\n}\n\nfunction test(): void {\n if (candidate(10) !== 55) { throw new Exception(\"Test failed!\"); }\n if (candidate(1) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(8) !== 21) { throw new Exception(\"Test failed!\"); }\n if (candidate(11) !== 89) { throw new Exception(\"Test failed!\"); }\n if (candidate(12) !== 144) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "php", - "prompt": "/ where both numerator and denominator are positive whole numbers.\n// You can assume that x, and n are valid fractions, and do not have zero as denominator.\n// simplify(\"1/5\", \"5/1\") = True\n// simplify(\"1/6\", \"2/1\") = False\n// simplify(\"7/10\", \"10/2\") = False\nfunction simplify($x, $n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return simplify(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"1/5\", \"5/1\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1/6\", \"2/1\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"5/1\", \"3/1\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"7/10\", \"10/2\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"2/10\", \"50/10\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"7/2\", \"4/2\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"11/6\", \"6/1\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"2/3\", \"5/2\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"5/2\", \"3/5\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"2/4\", \"8/4\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"2/4\", \"4/2\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1/5\", \"5/1\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1/5\", \"1/5\") !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "php", - "prompt": " 0 | 1\n// * 1 <= capacity <= 10\nfunction max_fill($grid, $capacity) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return max_fill(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(array(0, 0, 1, 0), array(0, 1, 0, 0), array(1, 1, 1, 1)), 1) !== 6) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(0, 0, 1, 1), array(0, 0, 0, 0), array(1, 1, 1, 1), array(0, 1, 1, 1)), 2) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(0, 0, 0), array(0, 0, 0)), 5) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(1, 1, 1, 1), array(1, 1, 1, 1)), 2) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(1, 1, 1, 1), array(1, 1, 1, 1)), 9) !== 2) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "php", - "prompt": ">> encode('test')\n// 'TGST'\n// >>> encode('This is a message')\n// 'tHKS KS C MGSSCGG'\nfunction encode($message) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return encode(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"TEST\") !== \"tgst\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Mudasir\") !== \"mWDCSKR\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"YES\") !== \"ygs\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"This is a message\") !== \"tHKS KS C MGSSCGG\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"I DoNt KnOw WhAt tO WrItE\") !== \"k dQnT kNqW wHcT Tq wRkTg\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "php", - "prompt": ">> remove_vowels('')\n// ''\n// >>> remove_vowels('abcdef')\n// 'bcdf'\n// >>> remove_vowels('aaaaa')\n// ''\n// >>> remove_vowels('aaBAA')\n// 'B'\n// >>> remove_vowels('zbcd')\n// 'zbcd'\nfunction remove_vowels($text) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return remove_vowels(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcdef\\nghijklm\") !== \"bcdf\\nghjklm\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"fedcba\") !== \"fdcb\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"eeeee\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"acBAA\") !== \"cB\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"EcBOO\") !== \"cB\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"ybcd\") !== \"ybcd\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "php", - "prompt": ">> get_positive([-1, 2, -4, 5, 6])\n// [2, 5, 6]\n// >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n// [5, 3, 2, 3, 9, 123, 1]\nfunction get_positive($l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return get_positive(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(-1, -2, 4, 5, 6)) !== array(4, 5, 6)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10)) !== array(5, 3, 2, 3, 3, 9, 123, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, -2)) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== array()) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "php", - "prompt": ">> string_sequence(0)\n// '0'\n// >>> string_sequence(5)\n// '0 1 2 3 4 5'\nfunction string_sequence($n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return string_sequence(...$args);\n}\n\nfunction test(): void {\n if (candidate(0) !== \"0\") { throw new Exception(\"Test failed!\"); }\n if (candidate(3) !== \"0 1 2 3\") { throw new Exception(\"Test failed!\"); }\n if (candidate(10) !== \"0 1 2 3 4 5 6 7 8 9 10\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "php", - "prompt": ">> make_a_pile(3)\n// [3, 5, 7]\nfunction make_a_pile($n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return make_a_pile(...$args);\n}\n\nfunction test(): void {\n if (candidate(3) !== array(3, 5, 7)) { throw new Exception(\"Test failed!\"); }\n if (candidate(4) !== array(4, 6, 8, 10)) { throw new Exception(\"Test failed!\"); }\n if (candidate(5) !== array(5, 7, 9, 11, 13)) { throw new Exception(\"Test failed!\"); }\n if (candidate(6) !== array(6, 8, 10, 12, 14, 16)) { throw new Exception(\"Test failed!\"); }\n if (candidate(8) !== array(8, 10, 12, 14, 16, 18, 20, 22)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "php", - "prompt": ">> flip_case('Hello')\n// 'hELLO'\nfunction flip_case($string) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return flip_case(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Hello!\") !== \"hELLO!\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"These violent delights have violent ends\") !== \"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "php", - "prompt": ">> filter_by_prefix([], 'a')\n// []\n// >>> filter_by_prefix(['abc', 'bcd', 'cde', 'array'], 'a')\n// ['abc', 'array']\nfunction filter_by_prefix($strings, $prefix) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return filter_by_prefix(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(), \"john\") !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"), \"xxx\") !== array(\"xxx\", \"xxxAAA\", \"xxx\")) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "php", - "prompt": ">> intersperse([], 4)\n// []\n// >>> intersperse([1, 2, 3], 4)\n// [1, 4, 2, 4, 3]\nfunction intersperse($numbers, $delimeter) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return intersperse(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(), 7) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 6, 3, 2), 8) !== array(5, 8, 6, 8, 3, 8, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 2, 2), 2) !== array(2, 2, 2, 2, 2)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "php", - "prompt": " true\n// is_simple_power(2, 2) => true\n// is_simple_power(8, 2) => true\n// is_simple_power(3, 2) => false\n// is_simple_power(3, 1) => false\n// is_simple_power(5, 3) => false\nfunction is_simple_power($x, $n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return is_simple_power(...$args);\n}\n\nfunction test(): void {\n if (candidate(16, 2) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(143214, 16) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(4, 2) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(9, 3) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(16, 4) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(24, 2) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(128, 4) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(12, 6) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(1, 1) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(1, 12) !== true) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "php", - "prompt": ">> sort_third([1, 2, 3])\n// [1, 2, 3]\n// >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n// [2, 6, 3, 4, 8, 9, 5]\nfunction sort_third($l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return sort_third(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(5, 6, 3, 4, 8, 9, 2)) !== array(2, 6, 3, 4, 8, 9, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 8, 3, 4, 6, 9, 2)) !== array(2, 8, 3, 4, 6, 9, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 6, 9, 4, 8, 3, 2)) !== array(2, 6, 9, 4, 8, 3, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 6, 3, 4, 8, 9, 2, 1)) !== array(2, 6, 3, 4, 8, 9, 5, 1)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_53_add", - "language": "php", - "prompt": ">> add(2, 3)\n// 5\n// >>> add(5, 7)\n// 12\nfunction add($x, $y) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return add(...$args);\n}\n\nfunction test(): void {\n if (candidate(0, 1) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(1, 0) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(2, 3) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(5, 7) !== 12) { throw new Exception(\"Test failed!\"); }\n if (candidate(7, 5) !== 12) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_69_search", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_58_common", - "language": "php", - "prompt": ">> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n// [1, 5, 653]\n// >>> common([5, 3, 2, 8], [3, 2])\n// [2, 3]\nfunction common($l1, $l2) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return common(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 4, 3, 34, 653, 2, 5), array(5, 7, 1, 5, 9, 653, 121)) !== array(1, 5, 653)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 3, 2, 8), array(3, 2)) !== array(2, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 3, 2, 8), array(3, 2, 4)) !== array(2, 3, 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 3, 2, 8), array()) !== array()) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "php", - "prompt": " 0\n// For example:\n// >>> special_factorial(4)\n// 288\n// The function will receive an integer as input and should return the special\n// factorial of this integer.\nfunction special_factorial($n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return special_factorial(...$args);\n}\n\nfunction test(): void {\n if (candidate(4) !== 288) { throw new Exception(\"Test failed!\"); }\n if (candidate(5) !== 34560) { throw new Exception(\"Test failed!\"); }\n if (candidate(7) !== 125411328000) { throw new Exception(\"Test failed!\"); }\n if (candidate(1) !== 1) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "php", - "prompt": " \"YES\"\n// exchange([1, 2, 3, 4], [1, 5, 3, 4]) => \"NO\"\n// It is assumed that the input lists will be non-empty.\nfunction exchange($lst1, $lst2) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return exchange(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2, 3, 4), array(1, 2, 3, 4)) !== \"YES\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4), array(1, 5, 3, 4)) !== \"NO\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4), array(2, 1, 4, 3)) !== \"YES\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 7, 3), array(2, 6, 4)) !== \"YES\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 7, 3), array(2, 6, 3)) !== \"NO\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 2, 6, 1, 8, 9), array(3, 5, 5, 1, 1, 1)) !== \"NO\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(100, 200), array(200, 200)) !== \"YES\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "php", - "prompt": ">> triangle_area(5, 3)\n// 7.5\nfunction triangle_area($a, $h) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return triangle_area(...$args);\n}\n\nfunction test(): void {\n if (candidate(5, 3) !== 7.5) { throw new Exception(\"Test failed!\"); }\n if (candidate(2, 2) !== 2.0) { throw new Exception(\"Test failed!\"); }\n if (candidate(10, 8) !== 40.0) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "php", - "prompt": ">> remove_duplicates([1, 2, 3, 2, 4])\n// [1, 3, 4]\nfunction remove_duplicates($numbers) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return remove_duplicates(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4)) !== array(1, 2, 3, 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 2, 4, 3, 5)) !== array(1, 4, 5)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "php", - "prompt": ">> greatest_common_divisor(3, 5)\n// 1\n// >>> greatest_common_divisor(25, 15)\n// 5\nfunction greatest_common_divisor($a, $b) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return greatest_common_divisor(...$args);\n}\n\nfunction test(): void {\n if (candidate(3, 7) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(10, 15) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(49, 14) !== 7) { throw new Exception(\"Test failed!\"); }\n if (candidate(144, 60) !== 12) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "php", - "prompt": ">> is_palindrome('')\n// True\n// >>> is_palindrome('aba')\n// True\n// >>> is_palindrome('aaaaa')\n// True\n// >>> is_palindrome('zbcd')\n// False\nfunction is_palindrome($text) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return is_palindrome(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"aba\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"aaaaa\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"zbcd\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"xywyx\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"xywyz\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"xywzx\") !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "php", - "prompt": ">> derivative([3, 1, 2, 4, 5])\n// [1, 4, 12, 20]\n// >>> derivative([1, 2, 3])\n// [2, 6]\nfunction derivative($xs) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return derivative(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(3, 1, 2, 4, 5)) !== array(1, 4, 12, 20)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3)) !== array(2, 6)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 2, 1)) !== array(2, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 2, 1, 0, 4)) !== array(2, 2, 0, 16)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1)) !== array()) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "php", - "prompt": "19 - 5 - 6 = 8\n// fruit_distribution(\"0 apples and 1 oranges\",3) -> 3 - 0 - 1 = 2\n// fruit_distribution(\"2 apples and 3 oranges\", 100) -> 100 - 2 - 3 = 95\n// fruit_distribution(\"100 apples and 1 oranges\",120) -> 120 - 100 - 1 = 19\nfunction fruit_distribution($s, $n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return fruit_distribution(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"5 apples and 6 oranges\", 19) !== 8) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"5 apples and 6 oranges\", 21) !== 10) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"0 apples and 1 oranges\", 3) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1 apples and 0 oranges\", 3) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"2 apples and 3 oranges\", 100) !== 95) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"2 apples and 3 oranges\", 5) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1 apples and 100 oranges\", 120) !== 19) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "php", - "prompt": " True\n// iscube(2) ==> False\n// iscube(-1) ==> True\n// iscube(64) ==> True\n// iscube(0) ==> True\n// iscube(180) ==> False\nfunction iscube($a) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return iscube(...$args);\n}\n\nfunction test(): void {\n if (candidate(1) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(2) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(-1) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(64) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(180) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(1000) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(0) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(1729) !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "php", - "prompt": ">> sort_array([1, 5, 2, 3, 4]) == [1, 2, 3, 4, 5]\n// >>> sort_array([-2, -3, -4, -5, -6]) == [-6, -5, -4, -3, -2]\n// >>> sort_array([1, 0, 2, 3, 4]) [0, 1, 2, 3, 4]\nfunction sort_array($arr) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return sort_array(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 5, 2, 3, 4)) !== array(1, 2, 4, 3, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-2, -3, -4, -5, -6)) !== array(-4, -2, -6, -5, -3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 0, 2, 3, 4)) !== array(0, 1, 2, 4, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4)) !== array(2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 6, 44, 12, 32, 5)) !== array(32, 3, 5, 6, 12, 44)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 4, 8, 16, 32)) !== array(2, 4, 8, 16, 32)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 4, 8, 16, 32)) !== array(2, 4, 8, 16, 32)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "php", - "prompt": ">> odd_count(['1234567'])\n// [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n// >>> odd_count(['3',\"11111111\"])\n// [\"the number of odd elements 1n the str1ng 1 of the 1nput.\",\n// \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\nfunction odd_count($lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return odd_count(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(\"1234567\")) !== array(\"the number of odd elements 4n the str4ng 4 of the 4nput.\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"3\", \"11111111\")) !== array(\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"271\", \"137\", \"314\")) !== array(\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\")) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "php", - "prompt": ">> correct_bracketing(\"(\")\n// False\n// >>> correct_bracketing(\"()\")\n// True\n// >>> correct_bracketing(\"(()())\")\n// True\n// >>> correct_bracketing(\")(()\")\n// False\nfunction correct_bracketing($brackets) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return correct_bracketing(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"()\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"(()())\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"()()(()())()\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"()()((()()())())(()()(()))\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"((()())))\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\")(()\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"(\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"((((\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\")\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"(()\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"()()(()())())(()\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"()()(()())()))()\") !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "php", - "prompt": " 0\n// digitSum(\"abAB\") => 131\n// digitSum(\"abcCd\") => 67\n// digitSum(\"helloE\") => 69\n// digitSum(\"woArBld\") => 131\n// digitSum(\"aAaaaXa\") => 153\nfunction digitSum($s) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return digitSum(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\") !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abAB\") !== 131) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcCd\") !== 67) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"helloE\") !== 69) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"woArBld\") !== 131) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"aAaaaXa\") !== 153) { throw new Exception(\"Test failed!\"); }\n if (candidate(\" How are yOu?\") !== 151) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"You arE Very Smart\") !== 327) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "php", - "prompt": " [\"aa\"]\n// assert list_sort([\"ab\", \"a\", \"aaa\", \"cd\"]) => [\"ab\", \"cd\"]\nfunction sorted_list_sum($lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return sorted_list_sum(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(\"aa\", \"a\", \"aaa\")) !== array(\"aa\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"school\", \"AI\", \"asdf\", \"b\")) !== array(\"AI\", \"asdf\", \"school\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"d\", \"b\", \"c\", \"a\")) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"d\", \"dcba\", \"abcd\", \"a\")) !== array(\"abcd\", \"dcba\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"AI\", \"ai\", \"au\")) !== array(\"AI\", \"ai\", \"au\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"a\", \"b\", \"b\", \"c\", \"c\", \"a\")) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"aaaa\", \"bbbb\", \"dd\", \"cc\")) !== array(\"cc\", \"dd\", \"aaaa\", \"bbbb\")) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "php", - "prompt": ">> prod_signs([1, 2, 2, -4]) == -9\n// >>> prod_signs([0, 1]) == 0\n// >>> prod_signs([]) == None\nfunction prod_signs($arr) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return prod_signs(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2, 2, -4)) !== -9) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0, 1)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 1, 1, 2, 3, -1, 1)) !== -10) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== null) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 4, 1, 2, -1, -1, 9)) !== 20) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, 1, -1, 1)) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, 1, 1, 1)) !== -4) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, 1, 1, 0)) !== 0) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "php", - "prompt": ">> incr_list([1, 2, 3])\n// [2, 3, 4]\n// >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123])\n// [6, 4, 6, 3, 4, 4, 10, 1, 124]\nfunction incr_list($l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return incr_list(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 2, 1)) !== array(4, 3, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 2, 5, 2, 3, 3, 9, 0, 123)) !== array(6, 3, 6, 3, 4, 4, 10, 1, 124)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "php", - "prompt": ">> rolling_max([1, 2, 3, 2, 3, 4, 2])\n// [1, 2, 3, 3, 3, 4, 4]\nfunction rolling_max($numbers) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return rolling_max(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4)) !== array(1, 2, 3, 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 3, 2, 1)) !== array(4, 4, 4, 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 2, 3, 100, 3)) !== array(3, 3, 3, 100, 100)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "php", - "prompt": ">> separate_paren_groups('( ) (( )) (( )( ))')\n// ['()', '(())', '(()())']\nfunction separate_paren_groups($paren_string) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return separate_paren_groups(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"(()()) ((())) () ((())()())\") !== array(\"(()())\", \"((()))\", \"()\", \"((())()())\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"() (()) ((())) (((())))\") !== array(\"()\", \"(())\", \"((()))\", \"(((())))\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"(()(())((())))\") !== array(\"(()(())((())))\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"( ) (( )) (( )( ))\") !== array(\"()\", \"(())\", \"(()())\")) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "php", - "prompt": ">> filter_integers(['a', 3.14, 5])\n// [5]\n// >>> filter_integers([1, 2, 3, 'abc', {}, []])\n// [1, 2, 3]\nfunction filter_integers($values) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return filter_integers(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, array(), array(), 23.2, 9, \"adasd\")) !== array(4, 9)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, \"c\", 3, 3, \"a\", \"b\")) !== array(3, 3, 3)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "php", - "prompt": ">> sort_even([1, 2, 3])\n// [1, 2, 3]\n// >>> sort_even([5, 6, 3, 4])\n// [3, 6, 5, 4]\nfunction sort_even($l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return sort_even(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2, 3)) !== array(1, 2, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10)) !== array(-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 8, -12, 4, 23, 2, 3, 11, 12, -10)) !== array(-12, 8, 3, 4, 5, 2, 12, 11, 23, -10)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "php", - "prompt": " [0,0,0,0,3,3]\n// compare([0,5,0,0,0,4],[4,1,1,0,0,-2]) -> [4,4,1,0,0,6]\nfunction compare($game, $guess) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return compare(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2, 3, 4, 5, 1), array(1, 2, 3, 4, 2, -2)) !== array(0, 0, 0, 0, 3, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0, 0, 0, 0, 0, 0), array(0, 0, 0, 0, 0, 0)) !== array(0, 0, 0, 0, 0, 0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3), array(-1, -2, -3)) !== array(2, 4, 6)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 5), array(-1, 2, 3, 4)) !== array(2, 0, 0, 1)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "php", - "prompt": " 0\n// fib4(1) -> 0\n// fib4(2) -> 2\n// fib4(3) -> 0\n// fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n// Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n// >>> fib4(5)\n// 4\n// >>> fib4(6)\n// 8\n// >>> fib4(7)\n// 14\nfunction fib4($n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return fib4(...$args);\n}\n\nfunction test(): void {\n if (candidate(5) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(8) !== 28) { throw new Exception(\"Test failed!\"); }\n if (candidate(10) !== 104) { throw new Exception(\"Test failed!\"); }\n if (candidate(12) !== 386) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "php", - "prompt": " [2, 4, 6, 8]\n// generate_integers(8, 2) => [2, 4, 6, 8]\n// generate_integers(10, 14) => []\nfunction generate_integers($a, $b) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return generate_integers(...$args);\n}\n\nfunction test(): void {\n if (candidate(2, 10) !== array(2, 4, 6, 8)) { throw new Exception(\"Test failed!\"); }\n if (candidate(10, 2) !== array(2, 4, 6, 8)) { throw new Exception(\"Test failed!\"); }\n if (candidate(132, 2) !== array(2, 4, 6, 8)) { throw new Exception(\"Test failed!\"); }\n if (candidate(17, 89) !== array()) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "php", - "prompt": ">> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n// 1.0\nfunction mean_absolute_deviation($numbers) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return mean_absolute_deviation(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1.0, 2.0)) !== 0.5) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 3.0, 4.0)) !== 1.0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 3.0, 4.0, 5.0)) !== 1.2) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "php", - "prompt": ">> how_many_times('', 'a')\n// 0\n// >>> how_many_times('aaa', 'a')\n// 3\n// >>> how_many_times('aaaa', 'aa')\n// 3\nfunction how_many_times($string, $substring) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return how_many_times(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\", \"x\") !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"xyxyxyx\", \"x\") !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"cacacacac\", \"cac\") !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"john doe\", \"john\") !== 1) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "php", - "prompt": "True\n// Explanation: By performin 2 right shift operations, non-decreasing order can\n// be achieved for the given array.\n// move_one_ball([3, 5, 4, 1, 2])==>False\n// Explanation:It is not possible to get non-decreasing order for the given\n// array by performing any number of right shift operations.\nfunction move_one_ball($arr) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return move_one_ball(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(3, 4, 5, 1, 2)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 5, 10, 1, 2)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 3, 1, 2)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 5, 4, 1, 2)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== true) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "php", - "prompt": ">> order_by_points([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]\n// >>> order_by_points([]) == []\nfunction order_by_points($nums) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return order_by_points(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 11, -1, -11, -12)) !== array(-1, -11, 1, -12, 11)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46)) !== array(0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, -11, -32, 43, 54, -98, 2, -3)) !== array(-3, -32, -98, -11, 1, 2, 43, 54)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)) !== array(1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0, 6, 6, -76, -21, 23, 4)) !== array(-76, -21, 0, 4, 23, 6, 6)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "php", - "prompt": ">> factorize(8)\n// [2, 2, 2]\n// >>> factorize(25)\n// [5, 5]\n// >>> factorize(70)\n// [2, 5, 7]\nfunction factorize($n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return factorize(...$args);\n}\n\nfunction test(): void {\n if (candidate(2) !== array(2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(4) !== array(2, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(8) !== array(2, 2, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(57) !== array(3, 19)) { throw new Exception(\"Test failed!\"); }\n if (candidate(3249) !== array(3, 3, 19, 19)) { throw new Exception(\"Test failed!\"); }\n if (candidate(185193) !== array(3, 3, 3, 19, 19, 19)) { throw new Exception(\"Test failed!\"); }\n if (candidate(20577) !== array(3, 19, 19, 19)) { throw new Exception(\"Test failed!\"); }\n if (candidate(18) !== array(2, 3, 3)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "php", - "prompt": ">> below_threshold([1, 2, 4, 10], 100)\n// True\n// >>> below_threshold([1, 20, 4, 10], 5)\n// False\nfunction below_threshold($l, $t) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return below_threshold(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2, 4, 10), 100) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 20, 4, 10), 5) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 20, 4, 10), 21) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 20, 4, 10), 22) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 8, 4, 10), 11) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 8, 4, 10), 10) !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "php", - "prompt": " \"0b11\"\n// rounded_avg(7, 5) => -1\n// rounded_avg(10, 20) => \"0b1111\"\n// rounded_avg(20, 33) => \"0b11010\"\nfunction rounded_avg($n, $m) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return rounded_avg(...$args);\n}\n\nfunction test(): void {\n if (candidate(1, 5) !== \"0b11\") { throw new Exception(\"Test failed!\"); }\n if (candidate(7, 13) !== \"0b1010\") { throw new Exception(\"Test failed!\"); }\n if (candidate(964, 977) !== \"0b1111001010\") { throw new Exception(\"Test failed!\"); }\n if (candidate(996, 997) !== \"0b1111100100\") { throw new Exception(\"Test failed!\"); }\n if (candidate(560, 851) !== \"0b1011000010\") { throw new Exception(\"Test failed!\"); }\n if (candidate(185, 546) !== \"0b101101110\") { throw new Exception(\"Test failed!\"); }\n if (candidate(362, 496) !== \"0b110101101\") { throw new Exception(\"Test failed!\"); }\n if (candidate(350, 902) !== \"0b1001110010\") { throw new Exception(\"Test failed!\"); }\n if (candidate(197, 233) !== \"0b11010111\") { throw new Exception(\"Test failed!\"); }\n if (candidate(7, 5) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(5, 1) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(5, 5) !== \"0b101\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "php", - "prompt": ">> parse_nested_parens('(()()) ((())) () ((())()())')\n// [2, 3, 1, 3]\nfunction parse_nested_parens($paren_string) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return parse_nested_parens(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"(()()) ((())) () ((())()())\") !== array(2, 3, 1, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"() (()) ((())) (((())))\") !== array(1, 2, 3, 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"(()(())((())))\") !== array(4)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "php", - "prompt": " 12\n// solution([3, 3, 3, 3, 3]) ==> 9\n// solution([30, 13, 24, 321]) ==>0\nfunction solution($lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return solution(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(5, 8, 7, 1)) !== 12) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 3, 3, 3, 3)) !== 9) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(30, 13, 24, 321)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 9)) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 4, 8)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(30, 13, 23, 32)) !== 23) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 13, 2, 9)) !== 3) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "php", - "prompt": " (\"Saturn\", \"Uranus\")\n// bf(\"Earth\", \"Mercury\") ==> (\"Venus\")\n// bf(\"Mercury\", \"Uranus\") ==> (\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\")\nfunction bf($planet1, $planet2) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return bf(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"Jupiter\", \"Neptune\") !== array(\"Saturn\", \"Uranus\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Earth\", \"Mercury\") !== array(\"Venus\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Mercury\", \"Uranus\") !== array(\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Neptune\", \"Venus\") !== array(\"Earth\", \"Mars\", \"Jupiter\", \"Saturn\", \"Uranus\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Earth\", \"Earth\") !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Mars\", \"Earth\") !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Jupiter\", \"Makemake\") !== array()) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "php", - "prompt": ">> sort_numbers('three one five')\n// 'one three five'\nfunction sort_numbers($numbers) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return sort_numbers(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"three\") !== \"three\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"three five nine\") !== \"three five nine\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"five zero four seven nine eight\") !== \"zero four five seven eight nine\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"six five four three two one zero\") !== \"zero one two three four five six\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "php", - "prompt": " False\n// cycpattern_check(\"hello\",\"ell\") => True\n// cycpattern_check(\"whassup\",\"psus\") => False\n// cycpattern_check(\"abab\",\"baa\") => True\n// cycpattern_check(\"efef\",\"eeff\") => False\n// cycpattern_check(\"himenss\",\"simen\") => True\nfunction cycpattern_check($a, $b) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return cycpattern_check(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"xyzw\", \"xyw\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"yello\", \"ell\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"whattup\", \"ptut\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"efef\", \"fee\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abab\", \"aabb\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"winemtt\", \"tinem\") !== true) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "php", - "prompt": ">> filter_by_substring([], 'a')\n// []\n// >>> filter_by_substring(['abc', 'bacd', 'cde', 'array'], 'a')\n// ['abc', 'bacd', 'array']\nfunction filter_by_substring($strings, $substring) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return filter_by_substring(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(), \"john\") !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"), \"xxx\") !== array(\"xxx\", \"xxxAAA\", \"xxx\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"), \"xx\") !== array(\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"grunt\", \"trumpet\", \"prune\", \"gruesome\"), \"run\") !== array(\"grunt\", \"prune\")) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "php", - "prompt": " (1, 1)\n// even_odd_count(123) ==> (1, 2)\nfunction even_odd_count($num) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return even_odd_count(...$args);\n}\n\nfunction test(): void {\n if (candidate(7) !== array(0, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(-78) !== array(1, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(3452) !== array(2, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(346211) !== array(3, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(-345821) !== array(3, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(-2) !== array(1, 0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(-45347) !== array(2, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(0) !== array(1, 0)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "php", - "prompt": " 0.\n// If a number is negative, then its first signed digit will be negative:\n// e.g. -123 has signed digits -1, 2, and 3.\n// >>> count_nums([]) == 0\n// >>> count_nums([-1, 11, -11]) == 1\n// >>> count_nums([1, 1, 2]) == 3\nfunction count_nums($arr) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return count_nums(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, -2, 0)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 1, 2, -2, 3, 4, 5)) !== 6) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 6, 9, -6, 0, 1, 5)) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 100, 98, -7, 1, -1)) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(12, 23, 34, -45, -56, 0)) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0, 1)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1)) !== 1) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "php", - "prompt": "= 2) and a positive integer k, \n// each cell of the grid contains a value. Every integer in the range [1, N * N]\n// inclusive appears exactly once on the cells of the grid.\n// You have to find the minimum path of length k in the grid. You can start\n// from any cell, and in each step you can move to any of the neighbor cells,\n// in other words, you can go to cells which share an edge with you current\n// cell.\n// Please note that a path of length k means visiting exactly k cells (not\n// necessarily distinct).\n// You CANNOT go off the grid.\n// A path A (of length k) is considered less than a path B (of length k) if\n// after making the ordered lists of the values on the cells that A and B go\n// through (let's call them lst_A and lst_B), lst_A is lexicographically less\n// than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n// such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n// lst_A[j] = lst_B[j].\n// It is guaranteed that the answer is unique.\n// Return an ordered list of the values on the cells that the minimum path go through.\n// Examples:\n// Input: grid = [ [1,2,3], [4,5,6], [7,8,9]], k = 3\n// Output: [1, 2, 1]\n// Input: grid = [ [5,9,3], [4,1,6], [7,8,2]], k = 1\n// Output: [1]\nfunction minPath($grid, $k) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return minPath(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(array(1, 2, 3), array(4, 5, 6), array(7, 8, 9)), 3) !== array(1, 2, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(5, 9, 3), array(4, 1, 6), array(7, 8, 2)), 1) !== array(1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(1, 2, 3, 4), array(5, 6, 7, 8), array(9, 10, 11, 12), array(13, 14, 15, 16)), 4) !== array(1, 2, 1, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(6, 4, 13, 10), array(5, 7, 12, 1), array(3, 16, 11, 15), array(8, 14, 9, 2)), 7) !== array(1, 10, 1, 10, 1, 10, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(8, 14, 9, 2), array(6, 4, 13, 15), array(5, 7, 1, 12), array(3, 10, 11, 16)), 5) !== array(1, 7, 1, 7, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(11, 8, 7, 2), array(5, 16, 14, 4), array(9, 3, 15, 6), array(12, 13, 10, 1)), 9) !== array(1, 6, 1, 6, 1, 6, 1, 6, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(12, 13, 10, 1), array(9, 3, 15, 6), array(5, 16, 14, 4), array(11, 8, 7, 2)), 12) !== array(1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(2, 7, 4), array(3, 1, 5), array(6, 8, 9)), 8) !== array(1, 3, 1, 3, 1, 3, 1, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(6, 1, 5), array(3, 8, 9), array(2, 7, 4)), 8) !== array(1, 5, 1, 5, 1, 5, 1, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(1, 2), array(3, 4)), 10) !== array(1, 2, 1, 2, 1, 2, 1, 2, 1, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(1, 3), array(3, 2)), 10) !== array(1, 3, 1, 3, 1, 3, 1, 3, 1, 3)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "php", - "prompt": ">> string_to_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'\nfunction string_to_md5($text) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return string_to_md5(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"Hello world\") !== \"3e25960a79dbc69b674cd4ec67a72c62\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"\") !== null) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"A B C\") !== \"0ef78513b0cb8cef12743f5aeb35f888\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"password\") !== \"5f4dcc3b5aa765d61d8327deb882cf99\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "php", - "prompt": " \"u\"\n// get_closest_vowel(\"FULL\") ==> \"U\"\n// get_closest_vowel(\"quick\") ==> \"\"\n// get_closest_vowel(\"ab\") ==> \"\"\nfunction get_closest_vowel($word) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return get_closest_vowel(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"yogurt\") !== \"u\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"full\") !== \"u\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"easy\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"eAsy\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"ali\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"bad\") !== \"a\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"most\") !== \"o\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"ab\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"ba\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"quick\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"anime\") !== \"i\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Asia\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Above\") !== \"o\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "php", - "prompt": ">> change_base(8, 3)\n// '22'\n// >>> change_base(8, 2)\n// '1000'\n// >>> change_base(7, 2)\n// '111'\nfunction change_base($x, $base) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return change_base(...$args);\n}\n\nfunction test(): void {\n if (candidate(8, 3) !== \"22\") { throw new Exception(\"Test failed!\"); }\n if (candidate(9, 3) !== \"100\") { throw new Exception(\"Test failed!\"); }\n if (candidate(234, 2) !== \"11101010\") { throw new Exception(\"Test failed!\"); }\n if (candidate(16, 2) !== \"10000\") { throw new Exception(\"Test failed!\"); }\n if (candidate(8, 2) !== \"1000\") { throw new Exception(\"Test failed!\"); }\n if (candidate(7, 2) !== \"111\") { throw new Exception(\"Test failed!\"); }\n if (candidate(2, 3) !== \"2\") { throw new Exception(\"Test failed!\"); }\n if (candidate(3, 4) !== \"3\") { throw new Exception(\"Test failed!\"); }\n if (candidate(4, 5) !== \"4\") { throw new Exception(\"Test failed!\"); }\n if (candidate(5, 6) !== \"5\") { throw new Exception(\"Test failed!\"); }\n if (candidate(6, 7) !== \"6\") { throw new Exception(\"Test failed!\"); }\n if (candidate(7, 8) !== \"7\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "php", - "prompt": ">> has_close_elements([1.0, 2.0, 3.0], 0.5)\n// False\n// >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n// True\nfunction has_close_elements($numbers, $threshold) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return has_close_elements(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1.0, 2.0, 3.9, 4.0, 5.0, 2.2), 0.3) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 3.9, 4.0, 5.0, 2.2), 0.05) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 5.9, 4.0, 5.0), 0.95) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 5.9, 4.0, 5.0), 0.8) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 3.0, 4.0, 5.0, 2.0), 0.1) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.1, 2.2, 3.1, 4.1, 5.1), 1.0) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.1, 2.2, 3.1, 4.1, 5.1), 0.5) !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "php", - "prompt": ">> concatenate([])\n// ''\n// >>> concatenate(['a', 'b', 'c'])\n// 'abc'\nfunction concatenate($strings) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return concatenate(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"x\", \"y\", \"z\")) !== \"xyz\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"x\", \"y\", \"z\", \"w\", \"k\")) !== \"xyzwk\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "php", - "prompt": ">> prime_fib(1)\n// 2\n// >>> prime_fib(2)\n// 3\n// >>> prime_fib(3)\n// 5\n// >>> prime_fib(4)\n// 13\n// >>> prime_fib(5)\n// 89\nfunction prime_fib($n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return prime_fib(...$args);\n}\n\nfunction test(): void {\n if (candidate(1) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(2) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(3) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(4) !== 13) { throw new Exception(\"Test failed!\"); }\n if (candidate(5) !== 89) { throw new Exception(\"Test failed!\"); }\n if (candidate(6) !== 233) { throw new Exception(\"Test failed!\"); }\n if (candidate(7) !== 1597) { throw new Exception(\"Test failed!\"); }\n if (candidate(8) !== 28657) { throw new Exception(\"Test failed!\"); }\n if (candidate(9) !== 514229) { throw new Exception(\"Test failed!\"); }\n if (candidate(10) !== 433494437) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "php", - "prompt": ">> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n// (2.0, 2.2)\n// >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n// (2.0, 2.0)\nfunction find_closest_elements($numbers) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return find_closest_elements(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1.0, 2.0, 3.9, 4.0, 5.0, 2.2)) !== array(3.9, 4.0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 5.9, 4.0, 5.0)) !== array(5.0, 5.9)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 3.0, 4.0, 5.0, 2.2)) !== array(2.0, 2.2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 3.0, 4.0, 5.0, 2.0)) !== array(2.0, 2.0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.1, 2.2, 3.1, 4.1, 5.1)) !== array(2.2, 3.1)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "php", - "prompt": ">> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n// [0.0, 0.25, 0.5, 0.75, 1.0]\nfunction rescale_to_unit($numbers) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return rescale_to_unit(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(2.0, 49.9)) !== array(0.0, 1.0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(100.0, 49.9)) !== array(1.0, 0.0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 3.0, 4.0, 5.0)) !== array(0.0, 0.25, 0.5, 0.75, 1.0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2.0, 1.0, 5.0, 3.0, 4.0)) !== array(0.25, 0.0, 1.0, 0.5, 0.75)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(12.0, 11.0, 15.0, 13.0, 14.0)) !== array(0.25, 0.0, 1.0, 0.5, 0.75)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "php", - "prompt": " 2, \"b\" => 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"a b c a b\") !== array(\"a\" => 2, \"b\" => 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"a b c d g\") !== array(\"a\" => 1, \"b\" => 1, \"c\" => 1, \"d\" => 1, \"g\" => 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"r t g\") !== array(\"r\" => 1, \"t\" => 1, \"g\" => 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"b b b b a\") !== array(\"b\" => 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"r t g\") !== array(\"r\" => 1, \"t\" => 1, \"g\" => 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"\") !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"a\") !== array(\"a\" => 1)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "php", - "prompt": ">> pairs_sum_to_zero([1, 3, 5, 0])\n// False\n// >>> pairs_sum_to_zero([1, 3, -2, 1])\n// False\n// >>> pairs_sum_to_zero([1, 2, 3, 7])\n// False\n// >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7])\n// True\n// >>> pairs_sum_to_zero([1])\n// False\nfunction pairs_sum_to_zero($l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return pairs_sum_to_zero(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 3, 5, 0)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 3, -2, 1)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 7)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 4, -5, 3, 5, 7)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-3, 9, -1, 3, 2, 30)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-3, 9, -1, 3, 2, 31)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-3, 9, -1, 4, 2, 30)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-3, 9, -1, 4, 2, 31)) !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "php", - "prompt": " number of digits, return digits reversed.\n// >>> circular_shift(12, 1)\n// \"21\"\n// >>> circular_shift(12, 2)\n// \"12\"\nfunction circular_shift($x, $shift) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return circular_shift(...$args);\n}\n\nfunction test(): void {\n if (candidate(100, 2) !== \"001\") { throw new Exception(\"Test failed!\"); }\n if (candidate(12, 2) !== \"12\") { throw new Exception(\"Test failed!\"); }\n if (candidate(97, 8) !== \"79\") { throw new Exception(\"Test failed!\"); }\n if (candidate(12, 1) !== \"21\") { throw new Exception(\"Test failed!\"); }\n if (candidate(11, 101) !== \"11\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "php", - "prompt": ">> monotonic([1, 2, 4, 20])\n// True\n// >>> monotonic([1, 20, 4, 10])\n// False\n// >>> monotonic([4, 1, 0, -10])\n// True\nfunction monotonic($l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return monotonic(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2, 4, 10)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 4, 20)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 20, 4, 10)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 1, 0, -10)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 1, 1, 0)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 2, 5, 60)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4, 5, 60)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(9, 9, 9, 9)) !== true) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "php", - "prompt": ">> parse_music('o o| .| o| o| .| .| .| .| o o')\n// [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\nfunction parse_music($music_string) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return parse_music(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\") !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"o o o o\") !== array(4, 4, 4, 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\".| .| .| .|\") !== array(1, 1, 1, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"o| o| .| .| o o o o\") !== array(2, 2, 1, 1, 4, 4, 4, 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"o| .| o| .| o o| o o|\") !== array(2, 1, 2, 1, 4, 2, 4, 2)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "php", - "prompt": ">> triples_sum_to_zero([1, 3, 5, 0])\n// False\n// >>> triples_sum_to_zero([1, 3, -2, 1])\n// True\n// >>> triples_sum_to_zero([1, 2, 3, 7])\n// False\n// >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n// True\n// >>> triples_sum_to_zero([1])\n// False\nfunction triples_sum_to_zero($l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return triples_sum_to_zero(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 3, 5, 0)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 3, 5, -1)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 3, -2, 1)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 7)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 5, 7)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 4, -5, 3, 9, 7)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 3, 5, -100)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(100, 3, 5, -100)) !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "php", - "prompt": "\".\n// return True if every opening bracket has a corresponding closing bracket.\n// >>> correct_bracketing(\"<\")\n// False\n// >>> correct_bracketing(\"<>\")\n// True\n// >>> correct_bracketing(\"<<><>>\")\n// True\n// >>> correct_bracketing(\"><<>\")\n// False\nfunction correct_bracketing($brackets) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return correct_bracketing(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"<>\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<<><>>\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<><><<><>><>\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<><><<<><><>><>><<><><<>>>\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<<<><>>>>\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"><<>\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<<<<\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\">\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<<>\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<><><<><>><>><<>\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<><><<><>><>>><>\") !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "php", - "prompt": " 1 \n// specialFilter([33, -2, -3, 45, 21, 109]) => 2\nfunction specialFilter($nums) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return specialFilter(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(5, -2, 1, -5)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(15, -73, 14, -15)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(33, -2, -3, 45, 21, 109)) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(43, -12, 93, 125, 121, 109)) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(71, -2, -33, 75, 21, 19)) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== 0) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "php", - "prompt": " \"pineapple\", \"b\" => \"banana\")) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"p\" => \"pineapple\", \"A\" => \"banana\", \"B\" => \"banana\")) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"p\" => \"pineapple\", \"5\" => \"banana\", \"a\" => \"apple\")) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"Name\" => \"John\", \"Age\" => \"36\", \"City\" => \"Houston\")) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"STATE\" => \"NC\", \"ZIP\" => \"12345\")) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"fruit\" => \"Orange\", \"taste\" => \"Sweet\")) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "php", - "prompt": ">> fibfib(1)\n// 0\n// >>> fibfib(5)\n// 4\n// >>> fibfib(8)\n// 24\nfunction fibfib($n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return fibfib(...$args);\n}\n\nfunction test(): void {\n if (candidate(2) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(1) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(5) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(8) !== 24) { throw new Exception(\"Test failed!\"); }\n if (candidate(10) !== 81) { throw new Exception(\"Test failed!\"); }\n if (candidate(12) !== 274) { throw new Exception(\"Test failed!\"); }\n if (candidate(14) !== 927) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_85_add", - "language": "php", - "prompt": " 2\nfunction add($lst) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return add(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(4, 88)) !== 88) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 5, 6, 7, 2, 122)) !== 122) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 0, 6, 7)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 4, 6, 8)) !== 12) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "php", - "prompt": ">> unique([5, 3, 5, 2, 3, 3, 9, 0, 123])\n// [0, 2, 3, 5, 9, 123]\nfunction unique($l) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return unique(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(5, 3, 5, 2, 3, 3, 9, 0, 123)) !== array(0, 2, 3, 5, 9, 123)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "php", - "prompt": ">> modp(3, 5)\n// 3\n// >>> modp(1101, 101)\n// 2\n// >>> modp(0, 101)\n// 1\n// >>> modp(3, 11)\n// 8\n// >>> modp(100, 101)\n// 1\nfunction modp($n, $p) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return modp(...$args);\n}\n\nfunction test(): void {\n if (candidate(3, 5) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(1101, 101) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(0, 101) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(3, 11) !== 8) { throw new Exception(\"Test failed!\"); }\n if (candidate(100, 101) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(30, 5) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(31, 5) !== 3) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "php", - "prompt": " True\n// valid_date('15-01-2012') => False\n// valid_date('04-0-2040') => False\n// valid_date('06-04-2020') => True\n// valid_date('06/04/2020') => False\nfunction valid_date($date) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return valid_date(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"03-11-2000\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"15-01-2012\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"04-0-2040\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"06-04-2020\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"01-01-2007\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"03-32-2011\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"04-31-3000\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"06-06-2005\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"21-31-2000\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"04-12-2003\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"04122003\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"20030412\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"2003-04\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"2003-04-12\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"04-2003\") !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "php", - "prompt": " False\n// is_happy(aa) => False\n// is_happy(abcd) => True\n// is_happy(aabb) => False\n// is_happy(adb) => True\n// is_happy(xyy) => False\nfunction is_happy($s) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return is_happy(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"a\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"aa\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcd\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"aabb\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"adb\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"xyy\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"iopaxpoi\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"iopaxioi\") !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "php", - "prompt": " []\n// * sort_array([5]) => [5]\n// * sort_array([2, 4, 3, 0, 1, 5]) => [0, 1, 2, 3, 4, 5]\n// * sort_array([2, 4, 3, 0, 1, 5, 6]) => [6, 5, 4, 3, 2, 1, 0]\nfunction sort_array($array) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return sort_array(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5)) !== array(5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 4, 3, 0, 1, 5)) !== array(0, 1, 2, 3, 4, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 4, 3, 0, 1, 5, 6)) !== array(6, 5, 4, 3, 2, 1, 0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 1)) !== array(1, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(15, 42, 87, 32, 11, 0)) !== array(0, 11, 15, 32, 42, 87)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(21, 14, 23, 11)) !== array(23, 21, 14, 11)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "php", - "prompt": " [2,3]\n// count_up_to(11) => [2,3,5,7]\n// count_up_to(0) => []\n// count_up_to(20) => [2,3,5,7,11,13,17,19]\n// count_up_to(1) => []\n// count_up_to(18) => [2,3,5,7,11,13,17]\nfunction count_up_to($n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return count_up_to(...$args);\n}\n\nfunction test(): void {\n if (candidate(5) !== array(2, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(6) !== array(2, 3, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(7) !== array(2, 3, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(10) !== array(2, 3, 5, 7)) { throw new Exception(\"Test failed!\"); }\n if (candidate(0) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(22) !== array(2, 3, 5, 7, 11, 13, 17, 19)) { throw new Exception(\"Test failed!\"); }\n if (candidate(1) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(18) !== array(2, 3, 5, 7, 11, 13, 17)) { throw new Exception(\"Test failed!\"); }\n if (candidate(47) !== array(2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43)) { throw new Exception(\"Test failed!\"); }\n if (candidate(101) !== array(2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "php", - "prompt": ">> longest([])\n// >>> longest(['a', 'b', 'c'])\n// 'a'\n// >>> longest(['a', 'bb', 'ccc'])\n// 'ccc'\nfunction longest($strings) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return longest(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== null) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"x\", \"y\", \"z\")) !== \"x\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\")) !== \"zzzz\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "php", - "prompt": " sort arr -> [1, 1, 2, 2, 3, 4, 5, 8] \n// -> reverse arr -> [8, 5, 4, 3, 2, 2, 1, 1]\n// return [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n// If the array is empty, return an empty array:\n// arr = []\n// return []\n// If the array has any strange number ignore it:\n// arr = [1, -1 , 55] \n// -> sort arr -> [-1, 1, 55]\n// -> reverse arr -> [55, 1, -1]\n// return = ['One']\nfunction by_length($arr) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return by_length(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(2, 1, 1, 4, 5, 8, 2, 3)) !== array(\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, -1, 55)) !== array(\"One\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, -1, 3, 2)) !== array(\"Three\", \"Two\", \"One\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(9, 4, 8)) !== array(\"Nine\", \"Eight\", \"Four\")) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_106_f", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "php", - "prompt": ">> fizz_buzz(50)\n// 0\n// >>> fizz_buzz(78)\n// 2\n// >>> fizz_buzz(79)\n// 3\nfunction fizz_buzz($n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return fizz_buzz(...$args);\n}\n\nfunction test(): void {\n if (candidate(50) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(78) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(79) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(100) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(200) !== 6) { throw new Exception(\"Test failed!\"); }\n if (candidate(4000) !== 192) { throw new Exception(\"Test failed!\"); }\n if (candidate(10000) !== 639) { throw new Exception(\"Test failed!\"); }\n if (candidate(100000) !== 8026) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "php", - "prompt": ">> truncate_number(3.5)\n// 0.5\nfunction truncate_number($number) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return truncate_number(...$args);\n}\n\nfunction test(): void {\n if (candidate(3.5) !== 0.5) { throw new Exception(\"Test failed!\"); }\n if (candidate(1.25) !== 0.25) { throw new Exception(\"Test failed!\"); }\n if (candidate(123.0) !== 0.0) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "php", - "prompt": ">> sum_product([])\n// (0, 1)\n// >>> sum_product([1, 2, 3, 4])\n// (10, 24)\nfunction sum_product($numbers) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return sum_product(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== array(0, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 1, 1)) !== array(3, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(100, 0)) !== array(100, 0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 5, 7)) !== array(15, 105)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(10)) !== array(10, 10)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "php", - "prompt": " [11, 4]\n// * eat(4, 8, 9) -> [12, 1]\n// * eat(1, 10, 10) -> [11, 0]\n// * eat(2, 11, 5) -> [7, 0]\n// Variables:\n// @number : integer\n// the number of carrots that you have eaten.\n// @need : integer\n// the number of carrots that you need to eat.\n// @remaining : integer\n// the number of remaining carrots thet exist in stock\n// Constrain:\n// * 0 <= number <= 1000\n// * 0 <= need <= 1000\n// * 0 <= remaining <= 1000\n// Have fun :)\nfunction eat($number, $need, $remaining) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return eat(...$args);\n}\n\nfunction test(): void {\n if (candidate(5, 6, 10) !== array(11, 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(4, 8, 9) !== array(12, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(1, 10, 10) !== array(11, 0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(2, 11, 5) !== array(7, 0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(4, 5, 7) !== array(9, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(4, 5, 1) !== array(5, 0)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "php", - "prompt": " 3.7 A \n// > 3.3 A- \n// > 3.0 B+\n// > 2.7 B \n// > 2.3 B-\n// > 2.0 C+\n// > 1.7 C\n// > 1.3 C-\n// > 1.0 D+ \n// > 0.7 D \n// > 0.0 D-\n// 0.0 E\n// Example:\n// grade_equation([4.0, 3, 1.7, 2, 3.5]) ==> ['A+', 'B', 'C-', 'C', 'A-']\nfunction numerical_letter_grade($grades) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return numerical_letter_grade(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(4.0, 3, 1.7, 2, 3.5)) !== array(\"A+\", \"B\", \"C-\", \"C\", \"A-\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.2)) !== array(\"D+\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0.5)) !== array(\"D-\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0.0)) !== array(\"E\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 0.3, 1.5, 2.8, 3.3)) !== array(\"D\", \"D-\", \"C-\", \"B\", \"B+\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0.0, 0.7)) !== array(\"E\", \"D-\")) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "php", - "prompt": ">> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n// True\n// >>> same_chars('abcd', 'dddddddabc')\n// True\n// >>> same_chars('dddddddabc', 'abcd')\n// True\n// >>> same_chars('eabcd', 'dddddddabc')\n// False\n// >>> same_chars('abcd', 'dddddddabce')\n// False\n// >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc')\n// False\nfunction same_chars($s0, $s1) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return same_chars(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcd\", \"dddddddabc\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"dddddddabc\", \"abcd\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"eabcd\", \"dddddddabc\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcd\", \"dddddddabcf\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"eabcdzzzz\", \"dddzzzzzzzddddabc\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"aabb\", \"aaccc\") !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "php", - "prompt": " [\"little\"]\n// select_words(\"Mary had a little lamb\", 3) ==> [\"Mary\", \"lamb\"]\n// select_words(\"simple white space\", 2) ==> []\n// select_words(\"Hello world\", 4) ==> [\"world\"]\n// select_words(\"Uncle sam\", 3) ==> [\"Uncle\"]\nfunction select_words($s, $n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return select_words(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"Mary had a little lamb\", 4) !== array(\"little\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Mary had a little lamb\", 3) !== array(\"Mary\", \"lamb\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"simple white space\", 2) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Hello world\", 4) !== array(\"world\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Uncle sam\", 3) !== array(\"Uncle\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"\", 4) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"a b c d e f\", 1) !== array(\"b\", \"c\", \"d\", \"f\")) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "php", - "prompt": ">> all_prefixes('abc')\n// ['a', 'ab', 'abc']\nfunction all_prefixes($string) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return all_prefixes(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\") !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"asdfgh\") !== array(\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"WWW\") !== array(\"W\", \"WW\", \"WWW\")) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "php", - "prompt": ">> closest_integer(\"10\")\n// 10\n// >>> closest_integer(\"15.3\")\n// 15\n// Note:\n// Rounding away from zero means that if the given number is equidistant\n// from two integers, the one you should return is the one that is the\n// farthest from zero. For example closest_integer(\"14.5\") should\n// return 15 and closest_integer(\"-14.5\") should return -15.\nfunction closest_integer($value) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return closest_integer(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"10\") !== 10) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"14.5\") !== 15) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"-15.5\") !== -16) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"15.3\") !== 15) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"0\") !== 0) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "php", - "prompt": " 'Yes'\n// file_name_check(\"1example.dll\") # => 'No' (the name should start with a latin alphapet letter)\nfunction file_name_check($file_name) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return file_name_check(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"example.txt\") !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1example.dll\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"s1sdf3.asd\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"K.dll\") !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"MY16FILE3.exe\") !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"His12FILE94.exe\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"_Y.txt\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"?aREYA.exe\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"/this_is_valid.dll\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"this_is_valid.wow\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"this_is_valid.txt\") !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"this_is_valid.txtexe\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"#this2_i4s_5valid.ten\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"@this1_is6_valid.exe\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"this_is_12valid.6exe4.txt\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"all.exe.txt\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"I563_No.exe\") !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Is3youfault.txt\") !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"no_one#knows.dll\") !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1I563_Yes3.exe\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"I563_Yes3.txtt\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"final..txt\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"final132\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"_f4indsartal132.\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\".txt\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"s.\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "php", - "prompt": " \"NO\"\n// intersection((-1, 1), (0, 4)) ==> \"NO\"\n// intersection((-3, -1), (-5, 5)) ==> \"YES\"\nfunction intersection($interval1, $interval2) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return intersection(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2), array(2, 3)) !== \"NO\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, 1), array(0, 4)) !== \"NO\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-3, -1), array(-5, 5)) !== \"YES\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-2, 2), array(-4, 0)) !== \"YES\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-11, 2), array(-1, -1)) !== \"NO\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2), array(3, 5)) !== \"NO\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2), array(1, 2)) !== \"NO\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-2, -2), array(-3, -2)) !== \"NO\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "php", - "prompt": " 1 and is not a prime.\n// >>> largest_prime_factor(13195)\n// 29\n// >>> largest_prime_factor(2048)\n// 2\nfunction largest_prime_factor($n) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return largest_prime_factor(...$args);\n}\n\nfunction test(): void {\n if (candidate(15) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(27) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(63) !== 7) { throw new Exception(\"Test failed!\"); }\n if (candidate(330) !== 11) { throw new Exception(\"Test failed!\"); }\n if (candidate(13195) !== 29) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "php", - "prompt": ">> count_distinct_characters('xyzXYZ')\n// 3\n// >>> count_distinct_characters('Jerry')\n// 4\nfunction count_distinct_characters($string) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return count_distinct_characters(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\") !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcde\") !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcdecadeCADE\") !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"aaaaAAAAaaaa\") !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Jerry jERRY JeRRRY\") !== 5) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "php", - "prompt": ">> below_zero([1, 2, 3])\n// False\n// >>> below_zero([1, 2, -4, 5])\n// True\nfunction below_zero($operations) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return below_zero(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, -3, 1, 2, -3)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, -4, 5, 6)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, -1, 2, -2, 5, -5, 4, -4)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, -1, 2, -2, 5, -5, 4, -5)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, -2, 2, -2, 5, -5, 4, -4)) !== true) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "php", - "prompt": ">> make_palindrome('')\n// ''\n// >>> make_palindrome('cat')\n// 'catac'\n// >>> make_palindrome('cata')\n// 'catac'\nfunction make_palindrome($string) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return make_palindrome(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"x\") !== \"x\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"xyz\") !== \"xyzyx\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"xyx\") !== \"xyx\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"jerry\") !== \"jerryrrej\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "php", - "prompt": ">> int_to_mini_roman(19) == 'xix'\n// >>> int_to_mini_roman(152) == 'clii'\n// >>> int_to_mini_roman(426) == 'cdxxvi'\nfunction int_to_mini_roman($number) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return int_to_mini_roman(...$args);\n}\n\nfunction test(): void {\n if (candidate(19) !== \"xix\") { throw new Exception(\"Test failed!\"); }\n if (candidate(152) !== \"clii\") { throw new Exception(\"Test failed!\"); }\n if (candidate(251) !== \"ccli\") { throw new Exception(\"Test failed!\"); }\n if (candidate(426) !== \"cdxxvi\") { throw new Exception(\"Test failed!\"); }\n if (candidate(500) !== \"d\") { throw new Exception(\"Test failed!\"); }\n if (candidate(1) !== \"i\") { throw new Exception(\"Test failed!\"); }\n if (candidate(4) !== \"iv\") { throw new Exception(\"Test failed!\"); }\n if (candidate(43) !== \"xliii\") { throw new Exception(\"Test failed!\"); }\n if (candidate(90) !== \"xc\") { throw new Exception(\"Test failed!\"); }\n if (candidate(94) !== \"xciv\") { throw new Exception(\"Test failed!\"); }\n if (candidate(532) !== \"dxxxii\") { throw new Exception(\"Test failed!\"); }\n if (candidate(900) !== \"cm\") { throw new Exception(\"Test failed!\"); }\n if (candidate(994) !== \"cmxciv\") { throw new Exception(\"Test failed!\"); }\n if (candidate(1000) !== \"m\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - } -] \ No newline at end of file diff --git a/data/php-remove.json b/data/php-remove.json deleted file mode 100644 index 5c291bbe46294e19d79d93271a9076e19b8c8e2e..0000000000000000000000000000000000000000 --- a/data/php-remove.json +++ /dev/null @@ -1,2372 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_47_median", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "php", - "prompt": "/ where both numerator and denominator are positive whole numbers.\n// You can assume that x, and n are valid fractions, and do not have zero as denominator.\nfunction simplify($x, $n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return simplify(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"1/5\", \"5/1\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1/6\", \"2/1\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"5/1\", \"3/1\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"7/10\", \"10/2\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"2/10\", \"50/10\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"7/2\", \"4/2\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"11/6\", \"6/1\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"2/3\", \"5/2\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"5/2\", \"3/5\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"2/4\", \"8/4\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"2/4\", \"4/2\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1/5\", \"5/1\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1/5\", \"1/5\") !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "php", - "prompt": " 0 | 1\n// * 1 <= capacity <= 10\nfunction max_fill($grid, $capacity) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return max_fill(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(array(0, 0, 1, 0), array(0, 1, 0, 0), array(1, 1, 1, 1)), 1) !== 6) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(0, 0, 1, 1), array(0, 0, 0, 0), array(1, 1, 1, 1), array(0, 1, 1, 1)), 2) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(0, 0, 0), array(0, 0, 0)), 5) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(1, 1, 1, 1), array(1, 1, 1, 1)), 2) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(1, 1, 1, 1), array(1, 1, 1, 1)), 9) !== 2) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_53_add", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_69_search", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_58_common", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "php", - "prompt": " 0\n// For example:\n// The function will receive an integer as input and should return the special\n// factorial of this integer.\nfunction special_factorial($n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return special_factorial(...$args);\n}\n\nfunction test(): void {\n if (candidate(4) !== 288) { throw new Exception(\"Test failed!\"); }\n if (candidate(5) !== 34560) { throw new Exception(\"Test failed!\"); }\n if (candidate(7) !== 125411328000) { throw new Exception(\"Test failed!\"); }\n if (candidate(1) !== 1) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "php", - "prompt": " 0\n// fib4(1) -> 0\n// fib4(2) -> 2\n// fib4(3) -> 0\n// fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n// Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\nfunction fib4($n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return fib4(...$args);\n}\n\nfunction test(): void {\n if (candidate(5) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(8) !== 28) { throw new Exception(\"Test failed!\"); }\n if (candidate(10) !== 104) { throw new Exception(\"Test failed!\"); }\n if (candidate(12) !== 386) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "php", - "prompt": " 0.\n// If a number is negative, then its first signed digit will be negative:\n// e.g. -123 has signed digits -1, 2, and 3.\nfunction count_nums($arr) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return count_nums(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, -2, 0)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 1, 2, -2, 3, 4, 5)) !== 6) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 6, 9, -6, 0, 1, 5)) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 100, 98, -7, 1, -1)) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(12, 23, 34, -45, -56, 0)) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0, 1)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1)) !== 1) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "php", - "prompt": "= 2) and a positive integer k, \n// each cell of the grid contains a value. Every integer in the range [1, N * N]\n// inclusive appears exactly once on the cells of the grid.\n// You have to find the minimum path of length k in the grid. You can start\n// from any cell, and in each step you can move to any of the neighbor cells,\n// in other words, you can go to cells which share an edge with you current\n// cell.\n// Please note that a path of length k means visiting exactly k cells (not\n// necessarily distinct).\n// You CANNOT go off the grid.\n// A path A (of length k) is considered less than a path B (of length k) if\n// after making the ordered lists of the values on the cells that A and B go\n// through (let's call them lst_A and lst_B), lst_A is lexicographically less\n// than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n// such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n// lst_A[j] = lst_B[j].\n// It is guaranteed that the answer is unique.\n// Return an ordered list of the values on the cells that the minimum path go through.\n// Examples:\nfunction minPath($grid, $k) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return minPath(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(array(1, 2, 3), array(4, 5, 6), array(7, 8, 9)), 3) !== array(1, 2, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(5, 9, 3), array(4, 1, 6), array(7, 8, 2)), 1) !== array(1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(1, 2, 3, 4), array(5, 6, 7, 8), array(9, 10, 11, 12), array(13, 14, 15, 16)), 4) !== array(1, 2, 1, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(6, 4, 13, 10), array(5, 7, 12, 1), array(3, 16, 11, 15), array(8, 14, 9, 2)), 7) !== array(1, 10, 1, 10, 1, 10, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(8, 14, 9, 2), array(6, 4, 13, 15), array(5, 7, 1, 12), array(3, 10, 11, 16)), 5) !== array(1, 7, 1, 7, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(11, 8, 7, 2), array(5, 16, 14, 4), array(9, 3, 15, 6), array(12, 13, 10, 1)), 9) !== array(1, 6, 1, 6, 1, 6, 1, 6, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(12, 13, 10, 1), array(9, 3, 15, 6), array(5, 16, 14, 4), array(11, 8, 7, 2)), 12) !== array(1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(2, 7, 4), array(3, 1, 5), array(6, 8, 9)), 8) !== array(1, 3, 1, 3, 1, 3, 1, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(6, 1, 5), array(3, 8, 9), array(2, 7, 4)), 8) !== array(1, 5, 1, 5, 1, 5, 1, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(1, 2), array(3, 4)), 10) !== array(1, 2, 1, 2, 1, 2, 1, 2, 1, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(1, 3), array(3, 2)), 10) !== array(1, 3, 1, 3, 1, 3, 1, 3, 1, 3)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "php", - "prompt": " 2, \"b\" => 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"a b c a b\") !== array(\"a\" => 2, \"b\" => 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"a b c d g\") !== array(\"a\" => 1, \"b\" => 1, \"c\" => 1, \"d\" => 1, \"g\" => 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"r t g\") !== array(\"r\" => 1, \"t\" => 1, \"g\" => 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"b b b b a\") !== array(\"b\" => 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"r t g\") !== array(\"r\" => 1, \"t\" => 1, \"g\" => 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"\") !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"a\") !== array(\"a\" => 1)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "php", - "prompt": " number of digits, return digits reversed.\nfunction circular_shift($x, $shift) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return circular_shift(...$args);\n}\n\nfunction test(): void {\n if (candidate(100, 2) !== \"001\") { throw new Exception(\"Test failed!\"); }\n if (candidate(12, 2) !== \"12\") { throw new Exception(\"Test failed!\"); }\n if (candidate(97, 8) !== \"79\") { throw new Exception(\"Test failed!\"); }\n if (candidate(12, 1) !== \"21\") { throw new Exception(\"Test failed!\"); }\n if (candidate(11, 101) !== \"11\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "php", - "prompt": "\".\n// return True if every opening bracket has a corresponding closing bracket.\nfunction correct_bracketing($brackets) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return correct_bracketing(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"<>\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<<><>>\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<><><<><>><>\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<><><<<><><>><>><<><><<>>>\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<<<><>>>>\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"><<>\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<<<<\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\">\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<<>\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<><><<><>><>><<>\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<><><<><>><>>><>\") !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "php", - "prompt": " \"pineapple\", \"b\" => \"banana\")) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"p\" => \"pineapple\", \"A\" => \"banana\", \"B\" => \"banana\")) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"p\" => \"pineapple\", \"5\" => \"banana\", \"a\" => \"apple\")) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"Name\" => \"John\", \"Age\" => \"36\", \"City\" => \"Houston\")) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"STATE\" => \"NC\", \"ZIP\" => \"12345\")) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"fruit\" => \"Orange\", \"taste\" => \"Sweet\")) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_85_add", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_106_f", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "php", - "prompt": " 3.7 A \n// > 3.3 A- \n// > 3.0 B+\n// > 2.7 B \n// > 2.3 B-\n// > 2.0 C+\n// > 1.7 C\n// > 1.3 C-\n// > 1.0 D+ \n// > 0.7 D \n// > 0.0 D-\n// 0.0 E\n// Example:\nfunction numerical_letter_grade($grades) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return numerical_letter_grade(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(4.0, 3, 1.7, 2, 3.5)) !== array(\"A+\", \"B\", \"C-\", \"C\", \"A-\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.2)) !== array(\"D+\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0.5)) !== array(\"D-\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0.0)) !== array(\"E\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 0.3, 1.5, 2.8, 3.3)) !== array(\"D\", \"D-\", \"C-\", \"B\", \"B+\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0.0, 0.7)) !== array(\"E\", \"D-\")) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "php", - "prompt": " 1 and is not a prime.\nfunction largest_prime_factor($n) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return largest_prime_factor(...$args);\n}\n\nfunction test(): void {\n if (candidate(15) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(27) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(63) !== 7) { throw new Exception(\"Test failed!\"); }\n if (candidate(330) !== 11) { throw new Exception(\"Test failed!\"); }\n if (candidate(13195) !== 29) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - } -] \ No newline at end of file diff --git a/data/php-reworded.json b/data/php-reworded.json deleted file mode 100644 index ec378f995b3adbbea165e589b45719ad1d4a1190..0000000000000000000000000000000000000000 --- a/data/php-reworded.json +++ /dev/null @@ -1,2417 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "php", - "prompt": ">> largest_divisor(15)\n// 5\nfunction largest_divisor($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return largest_divisor(...$args);\n}\n\nfunction test(): void {\n if (candidate(3) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(7) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(10) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(100) !== 50) { throw new Exception(\"Test failed!\"); }\n if (candidate(49) !== 7) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_47_median", - "language": "php", - "prompt": ">> median(array(3, 1, 2, 4, 5))\n// 3\n// >>> median(array(-10, 4, 6, 1000, 10, 20))\n// 15.0\nfunction median($l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return median(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(3, 1, 2, 4, 5)) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-10, 4, 6, 1000, 10, 20)) !== 8.0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5)) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(6, 5)) !== 5.5) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(8, 1, 3, 9, 9, 2, 7)) !== 7) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "php", - "prompt": " result = 9\n// Note:\n// The length of operator array is equal to the length of operand array minus one.\n// Operand is an array of of non-negative integers.\n// Operator array has at least one operator, and operand array has at least two operands.\nfunction do_algebra($operator, $operand) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return do_algebra(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(\"**\", \"*\", \"+\"), array(2, 3, 4, 5)) !== 37) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"+\", \"*\", \"-\"), array(2, 3, 4, 5)) !== 9) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"//\", \"*\"), array(7, 3, 4)) !== 8) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "php", - "prompt": ">> max_element(array(1, 2, 3))\n// 3\n// >>> max_element(array(5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10))\n// 123\nfunction max_element($l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return max_element(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2, 3)) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10)) !== 124) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "php", - "prompt": ">> can_arrange(array(1, 2, 4, 3, 5))\n// 3\n// >>> can_arrange(array(1, 2, 3))\n// -1\nfunction can_arrange($arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return can_arrange(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2, 4, 3, 5)) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 4, 5)) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 4, 2, 5, 6, 7, 8, 9, 10)) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 8, 5, 7, 3)) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== -1) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "php", - "prompt": ">> check_if_last_char_is_a_letter(\"apple pie\")\n// false\n// >>> check_if_last_char_is_a_letter(\"apple pi e\")\n// true\n// >>> check_if_last_char_is_a_letter(\"apple pi e \")\n// false\n// >>> check_if_last_char_is_a_letter(\"\")\n// false\nfunction check_if_last_char_is_a_letter($txt) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return check_if_last_char_is_a_letter(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"apple\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"apple pi e\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"eeeee\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"A\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Pumpkin pie \") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Pumpkin pie 1\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"eeeee e \") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"apple pie\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"apple pi e \") !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "php", - "prompt": ">> is_prime(6)\n// false\n// >>> is_prime(101)\n// true\n// >>> is_prime(11)\n// true\n// >>> is_prime(13441)\n// true\n// >>> is_prime(61)\n// true\n// >>> is_prime(4)\n// false\n// >>> is_prime(1)\n// false\nfunction is_prime($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return is_prime(...$args);\n}\n\nfunction test(): void {\n if (candidate(6) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(101) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(11) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(13441) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(61) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(4) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(1) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(5) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(11) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(17) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(85) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(77) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(255379) !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "php", - "prompt": ">> unique_digits(array(15, 33, 1422, 1))\n// array(1, 15, 33)\n// >>> unique_digits(array(152, 323, 1422, 10))\n// array()\nfunction unique_digits($x) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return unique_digits(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(15, 33, 1422, 1)) !== array(1, 15, 33)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(152, 323, 1422, 10)) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(12345, 2033, 111, 151)) !== array(111, 151)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(135, 103, 31)) !== array(31, 135)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "php", - "prompt": ">> string_xor(\"010\", \"110\")\n// \"100\"\nfunction string_xor($a, $b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return string_xor(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"111000\", \"101010\") !== \"010010\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1\", \"1\") !== \"0\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"0101\", \"0000\") !== \"0101\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "php", - "prompt": ">> sum_to_n(30)\n// 465\n// >>> sum_to_n(100)\n// 5050\n// >>> sum_to_n(5)\n// 15\n// >>> sum_to_n(10)\n// 55\n// >>> sum_to_n(1)\n// 1\nfunction sum_to_n($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return sum_to_n(...$args);\n}\n\nfunction test(): void {\n if (candidate(1) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(6) !== 21) { throw new Exception(\"Test failed!\"); }\n if (candidate(11) !== 66) { throw new Exception(\"Test failed!\"); }\n if (candidate(30) !== 465) { throw new Exception(\"Test failed!\"); }\n if (candidate(100) !== 5050) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "php", - "prompt": ">> double_the_difference(array(1, 3, 2, 0))\n// 10\n// >>> double_the_difference(array(-1, -2, 0))\n// 0\n// >>> double_the_difference(array(9, -2))\n// 81\n// >>> double_the_difference(array(0))\n// 0\n// If the input array is empty, return 0.\nfunction double_the_difference($lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return double_the_difference(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5.0, 4.0)) !== 25) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0.1, 0.2, 0.3)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-10.0, -20.0, -30.0)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1.0, -2.0, 8.0)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0.2, 3.0, 5.0)) !== 34) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0)) !== 165) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "php", - "prompt": ">> strlen(\"\")\n// 0\n// >>> strlen(\"abc\")\n// 3\nfunction strlen($string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return strlen(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\") !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"x\") !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"asdasnakj\") !== 9) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "php", - "prompt": ">> is_bored(\"Hello world\")\n// 0\n// >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n// 1\nfunction is_bored($S) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return is_bored(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"Hello world\") !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Is the sky blue?\") !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"I love It !\") !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"bIt\") !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"I feel good today. I will be productive. will kill It\") !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"You and I are going for a walk\") !== 0) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "php", - "prompt": ">> vowels_count(\"abcde\")\n// 2\n// >>> vowels_count(\"ACEDY\")\n// 3\nfunction vowels_count($s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return vowels_count(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"abcde\") !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Alone\") !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"key\") !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"bye\") !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"keY\") !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"bYe\") !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"ACEDY\") !== 3) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "php", - "prompt": ">> fib(10)\n// 55\n// >>> fib(1)\n// 1\n// >>> fib(8)\n// 21\nfunction fib($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return fib(...$args);\n}\n\nfunction test(): void {\n if (candidate(10) !== 55) { throw new Exception(\"Test failed!\"); }\n if (candidate(1) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(8) !== 21) { throw new Exception(\"Test failed!\"); }\n if (candidate(11) !== 89) { throw new Exception(\"Test failed!\"); }\n if (candidate(12) !== 144) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "php", - "prompt": "/ where both numerator and denominator are positive whole numbers.\n// You can assume that x, and n are valid fractions, and do not have zero as denominator.\n// >>> simplify(\"1/5\", \"5/1\")\n// true\n// >>> simplify(\"1/6\", \"2/1\")\n// false\n// >>> simplify(\"7/10\", \"10/2\")\n// false\nfunction simplify($x, $n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return simplify(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"1/5\", \"5/1\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1/6\", \"2/1\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"5/1\", \"3/1\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"7/10\", \"10/2\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"2/10\", \"50/10\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"7/2\", \"4/2\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"11/6\", \"6/1\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"2/3\", \"5/2\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"5/2\", \"3/5\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"2/4\", \"8/4\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"2/4\", \"4/2\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1/5\", \"5/1\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1/5\", \"1/5\") !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "php", - "prompt": ">> count_upper(\"aBCdEf\")\n// 1\n// >>> count_upper(\"abcdefg\")\n// 0\n// >>> count_upper(\"dBBE\")\n// 0\nfunction count_upper($s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return count_upper(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"aBCdEf\") !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcdefg\") !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"dBBE\") !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"B\") !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"U\") !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"\") !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"EEEE\") !== 2) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "php", - "prompt": ">> max_fill(array(array(0, 0, 1, 0), array(0, 1, 0, 0), array(1, 1, 1, 1)), 1)\n// 6\n// Example 2:\n// >>> max_fill(array(array(0, 0, 1, 1), array(0, 0, 0, 0), array(1, 1, 1, 1), array(0, 1, 1, 1)), 2)\n// 5\n// Example 3:\n// >>> max_fill(array(array(0, 0, 0), array(0, 0, 0)), 5)\n// 0\n// Constraints:\n// * all wells have the same length\n// * 1 <= grid.length <= 10^2\n// * 1 <= grid[:,1].length <= 10^2\n// * grid[i][j] -> 0 | 1\n// * 1 <= capacity <= 10\nfunction max_fill($grid, $capacity) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return max_fill(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(array(0, 0, 1, 0), array(0, 1, 0, 0), array(1, 1, 1, 1)), 1) !== 6) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(0, 0, 1, 1), array(0, 0, 0, 0), array(1, 1, 1, 1), array(0, 1, 1, 1)), 2) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(0, 0, 0), array(0, 0, 0)), 5) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(1, 1, 1, 1), array(1, 1, 1, 1)), 2) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(1, 1, 1, 1), array(1, 1, 1, 1)), 9) !== 2) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "php", - "prompt": ">> maximum(array(-3, -4, 5), 3)\n// array(-4, -3, 5)\n// Example 2:\n// >>> maximum(array(4, -4, 4), 2)\n// array(4, 4)\n// Example 3:\n// >>> maximum(array(-3, 2, 1, 2, -1, -2, 1), 1)\n// array(2)\n// Note:\n// 1. The length of the array will be in the range of [1, 1000].\n// 2. The elements in the array will be in the range of [-1000, 1000].\n// 3. 0 <= k <= len(arr)\nfunction maximum($arr, $k) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return maximum(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(-3, -4, 5), 3) !== array(-4, -3, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, -4, 4), 2) !== array(4, 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-3, 2, 1, 2, -1, -2, 1), 1) !== array(2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(123, -123, 20, 0, 1, 2, -3), 3) !== array(2, 20, 123)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-123, 20, 0, 1, 2, -3), 4) !== array(0, 1, 2, 20)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 15, 0, 3, -13, -8, 0), 7) !== array(-13, -8, 0, 0, 3, 5, 15)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, 0, 2, 5, 3, -10), 2) !== array(3, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 0, 5, -7), 1) !== array(5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, -4), 2) !== array(-4, 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-10, 10), 2) !== array(-10, 10)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, -23, 243, -400, 0), 0) !== array()) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "php", - "prompt": ">> encode(\"test\")\n// \"TGST\"\n// >>> encode(\"This is a message\")\n// \"tHKS KS C MGSSCGG\"\nfunction encode($message) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return encode(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"TEST\") !== \"tgst\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Mudasir\") !== \"mWDCSKR\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"YES\") !== \"ygs\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"This is a message\") !== \"tHKS KS C MGSSCGG\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"I DoNt KnOw WhAt tO WrItE\") !== \"k dQnT kNqW wHcT Tq wRkTg\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "php", - "prompt": ">> remove_vowels(\"\")\n// \"\"\n// >>> remove_vowels(\"abcdef\")\n// \"bcdf\"\n// >>> remove_vowels(\"aaaaa\")\n// \"\"\n// >>> remove_vowels(\"aaBAA\")\n// \"B\"\n// >>> remove_vowels(\"zbcd\")\n// \"zbcd\"\nfunction remove_vowels($text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return remove_vowels(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcdef\\nghijklm\") !== \"bcdf\\nghjklm\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"fedcba\") !== \"fdcb\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"eeeee\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"acBAA\") !== \"cB\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"EcBOO\") !== \"cB\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"ybcd\") !== \"ybcd\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "php", - "prompt": ">> get_positive(array(-1, 2, -4, 5, 6))\n// array(2, 5, 6)\n// >>> get_positive(array(5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10))\n// array(5, 3, 2, 3, 9, 123, 1)\nfunction get_positive($l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return get_positive(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(-1, -2, 4, 5, 6)) !== array(4, 5, 6)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10)) !== array(5, 3, 2, 3, 3, 9, 123, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, -2)) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== array()) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "php", - "prompt": ">> string_sequence(0)\n// \"0\"\n// >>> string_sequence(5)\n// \"0 1 2 3 4 5\"\nfunction string_sequence($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return string_sequence(...$args);\n}\n\nfunction test(): void {\n if (candidate(0) !== \"0\") { throw new Exception(\"Test failed!\"); }\n if (candidate(3) !== \"0 1 2 3\") { throw new Exception(\"Test failed!\"); }\n if (candidate(10) !== \"0 1 2 3 4 5 6 7 8 9 10\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "php", - "prompt": ">> make_a_pile(3)\n// array(3, 5, 7)\nfunction make_a_pile($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return make_a_pile(...$args);\n}\n\nfunction test(): void {\n if (candidate(3) !== array(3, 5, 7)) { throw new Exception(\"Test failed!\"); }\n if (candidate(4) !== array(4, 6, 8, 10)) { throw new Exception(\"Test failed!\"); }\n if (candidate(5) !== array(5, 7, 9, 11, 13)) { throw new Exception(\"Test failed!\"); }\n if (candidate(6) !== array(6, 8, 10, 12, 14, 16)) { throw new Exception(\"Test failed!\"); }\n if (candidate(8) !== array(8, 10, 12, 14, 16, 18, 20, 22)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "php", - "prompt": ">> reverse_delete(\"abcde\", \"ae\")\n// array(\"bcd\", false)\n// >>> reverse_delete(\"abcdef\", \"b\")\n// array(\"acdef\", false)\n// >>> reverse_delete(\"abcdedcba\", \"ab\")\n// array(\"cdedc\", true)\nfunction reverse_delete($s, $c) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return reverse_delete(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"abcde\", \"ae\") !== array(\"bcd\", false)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcdef\", \"b\") !== array(\"acdef\", false)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcdedcba\", \"ab\") !== array(\"cdedc\", true)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"dwik\", \"w\") !== array(\"dik\", false)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"a\", \"a\") !== array(\"\", true)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcdedcba\", \"\") !== array(\"abcdedcba\", true)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcdedcba\", \"v\") !== array(\"abcdedcba\", true)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"vabba\", \"v\") !== array(\"abba\", true)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"mamma\", \"mia\") !== array(\"\", true)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "php", - "prompt": ">> flip_case(\"Hello\")\n// \"hELLO\"\nfunction flip_case($string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return flip_case(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Hello!\") !== \"hELLO!\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"These violent delights have violent ends\") !== \"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "php", - "prompt": ">> solve(\"1234\")\n// \"4321\"\n// >>> solve(\"ab\")\n// \"AB\"\n// >>> solve(\"#a@C\")\n// \"#A@c\"\nfunction solve($s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return solve(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"AsDf\") !== \"aSdF\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1234\") !== \"4321\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"ab\") !== \"AB\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"#a@C\") !== \"#A@c\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"#AsdfW^45\") !== \"#aSDFw^45\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"#6@2\") !== \"2@6#\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"#$a^D\") !== \"#$A^d\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"#ccc\") !== \"#CCC\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "php", - "prompt": ">> filter_by_prefix(array(), \"a\")\n// array()\n// >>> filter_by_prefix(array(\"abc\", \"bcd\", \"cde\", \"array\"), \"a\")\n// array(\"abc\", \"array\")\nfunction filter_by_prefix($strings, $prefix) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return filter_by_prefix(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(), \"john\") !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"), \"xxx\") !== array(\"xxx\", \"xxxAAA\", \"xxx\")) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "php", - "prompt": ">> choose_num(12, 15)\n// 14\n// >>> choose_num(13, 12)\n// -1\nfunction choose_num($x, $y) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return choose_num(...$args);\n}\n\nfunction test(): void {\n if (candidate(12, 15) !== 14) { throw new Exception(\"Test failed!\"); }\n if (candidate(13, 12) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(33, 12354) !== 12354) { throw new Exception(\"Test failed!\"); }\n if (candidate(5234, 5233) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(6, 29) !== 28) { throw new Exception(\"Test failed!\"); }\n if (candidate(27, 10) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(7, 7) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(546, 546) !== 546) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "php", - "prompt": ">> words_in_sentence(\"This is a test\")\n// \"is\"\n// Example 2:\n// >>> words_in_sentence(\"lets go for swimming\")\n// \"go for\"\n// Constraints:\n// * 1 <= len(sentence) <= 100\n// * sentence contains only letters\nfunction words_in_sentence($sentence) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return words_in_sentence(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"This is a test\") !== \"is\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"lets go for swimming\") !== \"go for\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"there is no place available here\") !== \"there is no place\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Hi I am Hussein\") !== \"Hi am Hussein\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"go for it\") !== \"go for it\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"here\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"here is\") !== \"is\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "php", - "prompt": ">> intersperse(array(), 4)\n// array()\n// >>> intersperse(array(1, 2, 3), 4)\n// array(1, 4, 2, 4, 3)\nfunction intersperse($numbers, $delimeter) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return intersperse(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(), 7) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 6, 3, 2), 8) !== array(5, 8, 6, 8, 3, 8, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 2, 2), 2) !== array(2, 2, 2, 2, 2)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "php", - "prompt": ">> is_simple_power(1, 4)\n// true\n// >>> is_simple_power(2, 2)\n// true\n// >>> is_simple_power(8, 2)\n// true\n// >>> is_simple_power(3, 2)\n// false\n// >>> is_simple_power(3, 1)\n// false\n// >>> is_simple_power(5, 3)\n// false\nfunction is_simple_power($x, $n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return is_simple_power(...$args);\n}\n\nfunction test(): void {\n if (candidate(16, 2) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(143214, 16) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(4, 2) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(9, 3) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(16, 4) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(24, 2) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(128, 4) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(12, 6) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(1, 1) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(1, 12) !== true) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "php", - "prompt": ">> is_multiply_prime(30)\n// true\n// 30 = 2 * 3 * 5\nfunction is_multiply_prime($a) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return is_multiply_prime(...$args);\n}\n\nfunction test(): void {\n if (candidate(5) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(30) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(8) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(10) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(125) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(105) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(126) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(729) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(891) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(1001) !== true) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "php", - "prompt": ">> right_angle_triangle(3, 4, 5)\n// true\n// >>> right_angle_triangle(1, 2, 3)\n// false\nfunction right_angle_triangle($a, $b, $c) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return right_angle_triangle(...$args);\n}\n\nfunction test(): void {\n if (candidate(3, 4, 5) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(1, 2, 3) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(10, 6, 8) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(2, 2, 2) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(7, 24, 25) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(10, 5, 7) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(5, 12, 13) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(15, 8, 17) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(48, 55, 73) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(1, 1, 1) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(2, 2, 10) !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "php", - "prompt": ">> any_int(5, 2, 7)\n// true\n// >>> any_int(3, 2, 2)\n// false\n// >>> any_int(3, -2, 1)\n// true\n// >>> any_int(3.6, -2.2, 2)\n// false\nfunction any_int($x, $y, $z) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return any_int(...$args);\n}\n\nfunction test(): void {\n if (candidate(2, 3, 1) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(2.5, 2, 3) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(1.5, 5, 3.5) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(2, 6, 2) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(4, 2, 2) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(2.2, 2.2, 2.2) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(-4, 6, 2) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(2, 1, 1) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(3, 4, 7) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(3.0, 4, 7) !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "php", - "prompt": ">> sort_third(array(1, 2, 3))\n// array(1, 2, 3)\n// >>> sort_third(array(5, 6, 3, 4, 8, 9, 2))\n// array(2, 6, 3, 4, 8, 9, 5)\nfunction sort_third($l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return sort_third(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(5, 6, 3, 4, 8, 9, 2)) !== array(2, 6, 3, 4, 8, 9, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 8, 3, 4, 6, 9, 2)) !== array(2, 8, 3, 4, 6, 9, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 6, 9, 4, 8, 3, 2)) !== array(2, 6, 9, 4, 8, 3, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 6, 3, 4, 8, 9, 2, 1)) !== array(2, 6, 3, 4, 8, 9, 5, 1)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_53_add", - "language": "php", - "prompt": ">> add(2, 3)\n// 5\n// >>> add(5, 7)\n// 12\nfunction add($x, $y) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return add(...$args);\n}\n\nfunction test(): void {\n if (candidate(0, 1) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(1, 0) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(2, 3) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(5, 7) !== 12) { throw new Exception(\"Test failed!\"); }\n if (candidate(7, 5) !== 12) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_69_search", - "language": "php", - "prompt": ">> search(array(4, 1, 2, 2, 3, 1))\n// 2\n// >>> search(array(1, 2, 2, 3, 3, 3, 4, 4, 4))\n// 3\n// >>> search(array(5, 5, 4, 4, 4))\n// -1\nfunction search($lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return search(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(5, 5, 5, 5, 1)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 1, 4, 1, 4, 4)) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 3)) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(8, 8, 8, 8, 8, 8, 8, 8)) !== 8) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 3, 3, 2, 2)) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 2, 8, 2)) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(8, 8, 3, 6, 5, 6, 4)) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 9, 10, 1, 3)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10)) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5)) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10)) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4)) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7)) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1)) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8)) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(10)) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2)) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 10, 10, 9, 2)) !== -1) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "php", - "prompt": ">> prime_length(\"Hello\")\n// true\n// >>> prime_length(\"abcdcba\")\n// true\n// >>> prime_length(\"kittens\")\n// true\n// >>> prime_length(\"orange\")\n// false\nfunction prime_length($string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return prime_length(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"Hello\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcdcba\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"kittens\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"orange\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"wow\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"world\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"MadaM\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Wow\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"HI\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"go\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"gogo\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"aaaaaaaaaaaaaaa\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Madam\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"M\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"0\") !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_58_common", - "language": "php", - "prompt": ">> common(array(1, 4, 3, 34, 653, 2, 5), array(5, 7, 1, 5, 9, 653, 121))\n// array(1, 5, 653)\n// >>> common(array(5, 3, 2, 8), array(3, 2))\n// array(2, 3)\nfunction common($l1, $l2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return common(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 4, 3, 34, 653, 2, 5), array(5, 7, 1, 5, 9, 653, 121)) !== array(1, 5, 653)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 3, 2, 8), array(3, 2)) !== array(2, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 3, 2, 8), array(3, 2, 4)) !== array(2, 3, 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 3, 2, 8), array()) !== array()) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "php", - "prompt": " 0\n// For example:\n// >>> special_factorial(4)\n// 288\n// The function will receive an integer as input and should return the special\n// factorial of this integer.\nfunction special_factorial($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return special_factorial(...$args);\n}\n\nfunction test(): void {\n if (candidate(4) !== 288) { throw new Exception(\"Test failed!\"); }\n if (candidate(5) !== 34560) { throw new Exception(\"Test failed!\"); }\n if (candidate(7) !== 125411328000) { throw new Exception(\"Test failed!\"); }\n if (candidate(1) !== 1) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "php", - "prompt": ">> exchange(array(1, 2, 3, 4), array(1, 2, 3, 4))\n// \"YES\"\n// >>> exchange(array(1, 2, 3, 4), array(1, 5, 3, 4))\n// \"NO\"\n// It is assumed that the input arrays will be non-empty.\nfunction exchange($lst1, $lst2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return exchange(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2, 3, 4), array(1, 2, 3, 4)) !== \"YES\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4), array(1, 5, 3, 4)) !== \"NO\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4), array(2, 1, 4, 3)) !== \"YES\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 7, 3), array(2, 6, 4)) !== \"YES\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 7, 3), array(2, 6, 3)) !== \"NO\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 2, 6, 1, 8, 9), array(3, 5, 5, 1, 1, 1)) !== \"NO\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(100, 200), array(200, 200)) !== \"YES\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "php", - "prompt": ">> add_elements(array(111, 21, 3, 4000, 5, 6, 7, 8, 9), 4)\n// 24\n// Constraints:\n// 1. 1 <= len(arr) <= 100\n// 2. 1 <= k <= len(arr)\nfunction add_elements($arr, $k) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return add_elements(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, -2, -3, 41, 57, 76, 87, 88, 99), 3) !== -4) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(111, 121, 3, 4000, 5, 6), 2) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(11, 21, 3, 90, 5, 6, 7, 8, 9), 4) !== 125) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(111, 21, 3, 4000, 5, 6, 7, 8, 9), 4) !== 24) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1), 1) !== 1) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "php", - "prompt": ">> x_or_y(7, 34, 12)\n// 34\n// >>> x_or_y(15, 8, 5)\n// 5\nfunction x_or_y($n, $x, $y) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return x_or_y(...$args);\n}\n\nfunction test(): void {\n if (candidate(7, 34, 12) !== 34) { throw new Exception(\"Test failed!\"); }\n if (candidate(15, 8, 5) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(3, 33, 5212) !== 33) { throw new Exception(\"Test failed!\"); }\n if (candidate(1259, 3, 52) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(7919, -1, 12) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(3609, 1245, 583) !== 583) { throw new Exception(\"Test failed!\"); }\n if (candidate(91, 56, 129) !== 129) { throw new Exception(\"Test failed!\"); }\n if (candidate(6, 34, 1234) !== 1234) { throw new Exception(\"Test failed!\"); }\n if (candidate(1, 2, 0) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(2, 2, 0) !== 2) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "php", - "prompt": ">> triangle_area(5, 3)\n// 7.5\nfunction triangle_area($a, $h) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return triangle_area(...$args);\n}\n\nfunction test(): void {\n if (candidate(5, 3) !== 7.5) { throw new Exception(\"Test failed!\"); }\n if (candidate(2, 2) !== 2.0) { throw new Exception(\"Test failed!\"); }\n if (candidate(10, 8) !== 40.0) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "php", - "prompt": ">> tri(3)\n// array(1, 3, 2, 8)\nfunction tri($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return tri(...$args);\n}\n\nfunction test(): void {\n if (candidate(3) !== array(1, 3, 2, 8)) { throw new Exception(\"Test failed!\"); }\n if (candidate(4) !== array(1, 3, 2, 8, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(5) !== array(1, 3, 2, 8, 3, 15)) { throw new Exception(\"Test failed!\"); }\n if (candidate(6) !== array(1, 3, 2, 8, 3, 15, 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(7) !== array(1, 3, 2, 8, 3, 15, 4, 24)) { throw new Exception(\"Test failed!\"); }\n if (candidate(8) !== array(1, 3, 2, 8, 3, 15, 4, 24, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(9) !== array(1, 3, 2, 8, 3, 15, 4, 24, 5, 35)) { throw new Exception(\"Test failed!\"); }\n if (candidate(20) !== array(1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11)) { throw new Exception(\"Test failed!\"); }\n if (candidate(0) !== array(1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(1) !== array(1, 3)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "php", - "prompt": ">> match_parens(array(\"()(\", \")\"))\n// \"Yes\"\n// >>> match_parens(array(\")\", \")\"))\n// \"No\"\nfunction match_parens($lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return match_parens(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(\"()(\", \")\")) !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\")\", \")\")) !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"(()(())\", \"())())\")) !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\")())\", \"(()()(\")) !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"(())))\", \"(()())((\")) !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"()\", \"())\")) !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"(()(\", \"()))()\")) !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"((((\", \"((())\")) !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\")(()\", \"(()(\")) !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\")(\", \")(\")) !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"(\", \")\")) !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\")\", \"(\")) !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "php", - "prompt": ">> remove_duplicates(array(1, 2, 3, 2, 4))\n// array(1, 3, 4)\nfunction remove_duplicates($numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return remove_duplicates(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4)) !== array(1, 2, 3, 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 2, 4, 3, 5)) !== array(1, 4, 5)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "php", - "prompt": ">> greatest_common_divisor(3, 5)\n// 1\n// >>> greatest_common_divisor(25, 15)\n// 5\nfunction greatest_common_divisor($a, $b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return greatest_common_divisor(...$args);\n}\n\nfunction test(): void {\n if (candidate(3, 7) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(10, 15) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(49, 14) !== 7) { throw new Exception(\"Test failed!\"); }\n if (candidate(144, 60) !== 12) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "php", - "prompt": ">> is_palindrome(\"\")\n// true\n// >>> is_palindrome(\"aba\")\n// true\n// >>> is_palindrome(\"aaaaa\")\n// true\n// >>> is_palindrome(\"zbcd\")\n// false\nfunction is_palindrome($text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return is_palindrome(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"aba\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"aaaaa\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"zbcd\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"xywyx\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"xywyz\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"xywzx\") !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "php", - "prompt": ">> derivative(array(3, 1, 2, 4, 5))\n// array(1, 4, 12, 20)\n// >>> derivative(array(1, 2, 3))\n// array(2, 6)\nfunction derivative($xs) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return derivative(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(3, 1, 2, 4, 5)) !== array(1, 4, 12, 20)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3)) !== array(2, 6)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 2, 1)) !== array(2, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 2, 1, 0, 4)) !== array(2, 2, 0, 16)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1)) !== array()) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "php", - "prompt": ">> fruit_distribution(\"5 apples and 6 oranges\", 19)\n// 8\n// >>> fruit_distribution(\"0 apples and 1 oranges\", 3)\n// 2\n// >>> fruit_distribution(\"2 apples and 3 oranges\", 100)\n// 95\n// >>> fruit_distribution(\"100 apples and 1 oranges\", 120)\n// 19\nfunction fruit_distribution($s, $n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return fruit_distribution(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"5 apples and 6 oranges\", 19) !== 8) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"5 apples and 6 oranges\", 21) !== 10) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"0 apples and 1 oranges\", 3) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1 apples and 0 oranges\", 3) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"2 apples and 3 oranges\", 100) !== 95) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"2 apples and 3 oranges\", 5) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1 apples and 100 oranges\", 120) !== 19) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "php", - "prompt": ">> iscube(1)\n// true\n// >>> iscube(2)\n// false\n// >>> iscube(-1)\n// true\n// >>> iscube(64)\n// true\n// >>> iscube(0)\n// true\n// >>> iscube(180)\n// false\nfunction iscube($a) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return iscube(...$args);\n}\n\nfunction test(): void {\n if (candidate(1) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(2) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(-1) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(64) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(180) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(1000) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(0) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(1729) !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "php", - "prompt": ">> sort_array(array(1, 5, 2, 3, 4))\n// array(1, 2, 3, 4, 5)\n// >>> sort_array(array(-2, -3, -4, -5, -6))\n// array(-6, -5, -4, -3, -2)\n// >>> sort_array(array(1, 0, 2, 3, 4))\n// array(0, 1, 2, 3, 4)\nfunction sort_array($arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return sort_array(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 5, 2, 3, 4)) !== array(1, 2, 4, 3, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-2, -3, -4, -5, -6)) !== array(-4, -2, -6, -5, -3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 0, 2, 3, 4)) !== array(0, 1, 2, 4, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4)) !== array(2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 6, 44, 12, 32, 5)) !== array(32, 3, 5, 6, 12, 44)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 4, 8, 16, 32)) !== array(2, 4, 8, 16, 32)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 4, 8, 16, 32)) !== array(2, 4, 8, 16, 32)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "php", - "prompt": ">> odd_count(array(\"1234567\"))\n// array(\"the number of odd elements 4n the str4ng 4 of the 4nput.\")\n// >>> odd_count(array(\"3\", \"11111111\"))\n// array(\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\")\nfunction odd_count($lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return odd_count(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(\"1234567\")) !== array(\"the number of odd elements 4n the str4ng 4 of the 4nput.\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"3\", \"11111111\")) !== array(\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"271\", \"137\", \"314\")) !== array(\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\")) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "php", - "prompt": ">> correct_bracketing(\"(\")\n// false\n// >>> correct_bracketing(\"()\")\n// true\n// >>> correct_bracketing(\"(()())\")\n// true\n// >>> correct_bracketing(\")(()\")\n// false\nfunction correct_bracketing($brackets) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return correct_bracketing(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"()\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"(()())\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"()()(()())()\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"()()((()()())())(()()(()))\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"((()())))\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\")(()\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"(\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"((((\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\")\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"(()\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"()()(()())())(()\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"()()(()())()))()\") !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "php", - "prompt": ">> digitSum(\"\")\n// 0\n// >>> digitSum(\"abAB\")\n// 131\n// >>> digitSum(\"abcCd\")\n// 67\n// >>> digitSum(\"helloE\")\n// 69\n// >>> digitSum(\"woArBld\")\n// 131\n// >>> digitSum(\"aAaaaXa\")\n// 153\nfunction digitSum($s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return digitSum(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\") !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abAB\") !== 131) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcCd\") !== 67) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"helloE\") !== 69) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"woArBld\") !== 131) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"aAaaaXa\") !== 153) { throw new Exception(\"Test failed!\"); }\n if (candidate(\" How are yOu?\") !== 151) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"You arE Very Smart\") !== 327) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "php", - "prompt": ">> list_sort(array(\"aa\", \"a\", \"aaa\"))\n// array(\"aa\")\n// >>> list_sort(array(\"ab\", \"a\", \"aaa\", \"cd\"))\n// array(\"ab\", \"cd\")\nfunction sorted_list_sum($lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return sorted_list_sum(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(\"aa\", \"a\", \"aaa\")) !== array(\"aa\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"school\", \"AI\", \"asdf\", \"b\")) !== array(\"AI\", \"asdf\", \"school\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"d\", \"b\", \"c\", \"a\")) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"d\", \"dcba\", \"abcd\", \"a\")) !== array(\"abcd\", \"dcba\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"AI\", \"ai\", \"au\")) !== array(\"AI\", \"ai\", \"au\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"a\", \"b\", \"b\", \"c\", \"c\", \"a\")) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"aaaa\", \"bbbb\", \"dd\", \"cc\")) !== array(\"cc\", \"dd\", \"aaaa\", \"bbbb\")) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "php", - "prompt": ">> prod_signs(array(1, 2, 2, -4))\n// 9\n// >>> prod_signs(array(0, 1))\n// 0\n// >>> prod_signs(array())\n// null\nfunction prod_signs($arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return prod_signs(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2, 2, -4)) !== -9) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0, 1)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 1, 1, 2, 3, -1, 1)) !== -10) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== null) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 4, 1, 2, -1, -1, 9)) !== 20) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, 1, -1, 1)) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, 1, 1, 1)) !== -4) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, 1, 1, 0)) !== 0) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "php", - "prompt": ">> incr_list(array(1, 2, 3))\n// array(2, 3, 4)\n// >>> incr_list(array(5, 3, 5, 2, 3, 3, 9, 0, 123))\n// array(6, 4, 6, 3, 4, 4, 10, 1, 124)\nfunction incr_list($l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return incr_list(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 2, 1)) !== array(4, 3, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 2, 5, 2, 3, 3, 9, 0, 123)) !== array(6, 3, 6, 3, 4, 4, 10, 1, 124)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "php", - "prompt": ">> rolling_max(array(1, 2, 3, 2, 3, 4, 2))\n// array(1, 2, 3, 3, 3, 4, 4)\nfunction rolling_max($numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return rolling_max(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4)) !== array(1, 2, 3, 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 3, 2, 1)) !== array(4, 4, 4, 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 2, 3, 100, 3)) !== array(3, 3, 3, 100, 100)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "php", - "prompt": ">> separate_paren_groups(\"( ) (( )) (( )( ))\")\n// array(\"()\", \"(())\", \"(()())\")\nfunction separate_paren_groups($paren_string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return separate_paren_groups(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"(()()) ((())) () ((())()())\") !== array(\"(()())\", \"((()))\", \"()\", \"((())()())\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"() (()) ((())) (((())))\") !== array(\"()\", \"(())\", \"((()))\", \"(((())))\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"(()(())((())))\") !== array(\"(()(())((())))\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"( ) (( )) (( )( ))\") !== array(\"()\", \"(())\", \"(()())\")) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "php", - "prompt": ">> words_string(\"Hi, my name is John\")\n// array(\"Hi\", \"my\", \"name\", \"is\", \"John\")\n// >>> words_string(\"One, two, three, four, five, six\")\n// array(\"One\", \"two\", \"three\", \"four\", \"five\", \"six\")\nfunction words_string($s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return words_string(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"Hi, my name is John\") !== array(\"Hi\", \"my\", \"name\", \"is\", \"John\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"One, two, three, four, five, six\") !== array(\"One\", \"two\", \"three\", \"four\", \"five\", \"six\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Hi, my name\") !== array(\"Hi\", \"my\", \"name\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"One,, two, three, four, five, six,\") !== array(\"One\", \"two\", \"three\", \"four\", \"five\", \"six\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"\") !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"ahmed , gamal\") !== array(\"ahmed\", \"gamal\")) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "php", - "prompt": ">> compare_one(1, 2.5)\n// 2.5\n// >>> compare_one(1, \"2,3\")\n// \"2,3\"\n// >>> compare_one(\"5,1\", \"6\")\n// \"6\"\n// >>> compare_one(\"1\", 1)\n// null\nfunction compare_one($a, $b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return compare_one(...$args);\n}\n\nfunction test(): void {\n if (candidate(1, 2) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(1, 2.5) !== 2.5) { throw new Exception(\"Test failed!\"); }\n if (candidate(2, 3) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(5, 6) !== 6) { throw new Exception(\"Test failed!\"); }\n if (candidate(1, \"2,3\") !== \"2,3\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"5,1\", \"6\") !== \"6\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1\", \"2\") !== \"2\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1\", 1) !== null) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "php", - "prompt": ">> filter_integers(array(\"a\", 3.14, 5))\n// array(5)\n// >>> filter_integers(array(1, 2, 3, \"abc\", array(), array()))\n// array(1, 2, 3)\nfunction filter_integers($values) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return filter_integers(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, array(), array(), 23.2, 9, \"adasd\")) !== array(4, 9)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, \"c\", 3, 3, \"a\", \"b\")) !== array(3, 3, 3)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "php", - "prompt": ">> sort_even(array(1, 2, 3))\n// array(1, 2, 3)\n// >>> sort_even(array(5, 6, 3, 4))\n// array(3, 6, 5, 4)\nfunction sort_even($l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return sort_even(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2, 3)) !== array(1, 2, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10)) !== array(-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 8, -12, 4, 23, 2, 3, 11, 12, -10)) !== array(-12, 8, 3, 4, 5, 2, 12, 11, 23, -10)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "php", - "prompt": ">> compare(array(1, 2, 3, 4, 5, 1), array(1, 2, 3, 4, 2, -2))\n// array(0, 0, 0, 0, 3, 3)\n// >>> compare(array(0, 5, 0, 0, 0, 4), array(4, 1, 1, 0, 0, -2))\n// array(4, 4, 1, 0, 0, 6)\nfunction compare($game, $guess) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return compare(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2, 3, 4, 5, 1), array(1, 2, 3, 4, 2, -2)) !== array(0, 0, 0, 0, 3, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0, 0, 0, 0, 0, 0), array(0, 0, 0, 0, 0, 0)) !== array(0, 0, 0, 0, 0, 0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3), array(-1, -2, -3)) !== array(2, 4, 6)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 5), array(-1, 2, 3, 4)) !== array(2, 0, 0, 1)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "php", - "prompt": ">> even_odd_palindrome(3)\n// array(1, 2)\n// Explanation:\n// Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n// Example 2:\n// >>> even_odd_palindrome(12)\n// array(4, 6)\n// Explanation:\n// Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n// Note:\n// 1. 1 <= n <= 10^3\n// 2. returned array has the number of even and odd integer palindromes respectively.\nfunction even_odd_palindrome($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return even_odd_palindrome(...$args);\n}\n\nfunction test(): void {\n if (candidate(123) !== array(8, 13)) { throw new Exception(\"Test failed!\"); }\n if (candidate(12) !== array(4, 6)) { throw new Exception(\"Test failed!\"); }\n if (candidate(3) !== array(1, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(63) !== array(6, 8)) { throw new Exception(\"Test failed!\"); }\n if (candidate(25) !== array(5, 6)) { throw new Exception(\"Test failed!\"); }\n if (candidate(19) !== array(4, 6)) { throw new Exception(\"Test failed!\"); }\n if (candidate(9) !== array(4, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(1) !== array(0, 1)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "php", - "prompt": " 0\n// fib4(1) -> 0\n// fib4(2) -> 2\n// fib4(3) -> 0\n// fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n// Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n// >>> fib4(5)\n// 4\n// >>> fib4(6)\n// 8\n// >>> fib4(7)\n// 14\nfunction fib4($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return fib4(...$args);\n}\n\nfunction test(): void {\n if (candidate(5) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(8) !== 28) { throw new Exception(\"Test failed!\"); }\n if (candidate(10) !== 104) { throw new Exception(\"Test failed!\"); }\n if (candidate(12) !== 386) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "php", - "prompt": ">> generate_integers(2, 8)\n// array(2, 4, 6, 8)\n// >>> generate_integers(8, 2)\n// array(2, 4, 6, 8)\n// >>> generate_integers(10, 14)\n// array()\nfunction generate_integers($a, $b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return generate_integers(...$args);\n}\n\nfunction test(): void {\n if (candidate(2, 10) !== array(2, 4, 6, 8)) { throw new Exception(\"Test failed!\"); }\n if (candidate(10, 2) !== array(2, 4, 6, 8)) { throw new Exception(\"Test failed!\"); }\n if (candidate(132, 2) !== array(2, 4, 6, 8)) { throw new Exception(\"Test failed!\"); }\n if (candidate(17, 89) !== array()) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "php", - "prompt": ">> mean_absolute_deviation(array(1.0, 2.0, 3.0, 4.0))\n// 1.0\nfunction mean_absolute_deviation($numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return mean_absolute_deviation(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1.0, 2.0)) !== 0.5) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 3.0, 4.0)) !== 1.0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 3.0, 4.0, 5.0)) !== 1.2) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "php", - "prompt": ">> encrypt(\"hi\")\n// \"lm\"\n// >>> encrypt(\"asdfghjkl\")\n// \"ewhjklnop\"\n// >>> encrypt(\"gf\")\n// \"kj\"\n// >>> encrypt(\"et\")\n// \"ix\"\nfunction encrypt($s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return encrypt(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"hi\") !== \"lm\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"asdfghjkl\") !== \"ewhjklnop\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"gf\") !== \"kj\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"et\") !== \"ix\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"faewfawefaewg\") !== \"jeiajeaijeiak\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"hellomyfriend\") !== \"lippsqcjvmirh\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\") !== \"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"a\") !== \"e\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "php", - "prompt": ">> get_odd_collatz(5)\n// array(1, 5)\nfunction get_odd_collatz($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return get_odd_collatz(...$args);\n}\n\nfunction test(): void {\n if (candidate(14) !== array(1, 5, 7, 11, 13, 17)) { throw new Exception(\"Test failed!\"); }\n if (candidate(5) !== array(1, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(12) !== array(1, 3, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(1) !== array(1)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "php", - "prompt": ">> how_many_times(\"\", \"a\")\n// 0\n// >>> how_many_times(\"aaa\", \"a\")\n// 3\n// >>> how_many_times(\"aaaa\", \"aa\")\n// 3\nfunction how_many_times($string, $substring) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return how_many_times(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\", \"x\") !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"xyxyxyx\", \"x\") !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"cacacacac\", \"cac\") !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"john doe\", \"john\") !== 1) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "php", - "prompt": ">> move_one_ball(array(3, 4, 5, 1, 2))\n// true\n// Explanation: By performin 2 right shift operations, non-decreasing order can\n// be achieved for the given array.\n// >>> move_one_ball(array(3, 5, 4, 1, 2))\n// false\n// Explanation:It is not possible to get non-decreasing order for the given\n// array by performing any number of right shift operations.\nfunction move_one_ball($arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return move_one_ball(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(3, 4, 5, 1, 2)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 5, 10, 1, 2)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 3, 1, 2)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 5, 4, 1, 2)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== true) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "php", - "prompt": ">> order_by_points(array(1, 11, -1, -11, -12))\n// array(-1, -11, 1, -12, 11)\n// >>> order_by_points(array())\n// array()\nfunction order_by_points($nums) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return order_by_points(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 11, -1, -11, -12)) !== array(-1, -11, 1, -12, 11)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46)) !== array(0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, -11, -32, 43, 54, -98, 2, -3)) !== array(-3, -32, -98, -11, 1, 2, 43, 54)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)) !== array(1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0, 6, 6, -76, -21, 23, 4)) !== array(-76, -21, 0, 4, 23, 6, 6)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "php", - "prompt": ">> factorize(8)\n// array(2, 2, 2)\n// >>> factorize(25)\n// array(5, 5)\n// >>> factorize(70)\n// array(2, 5, 7)\nfunction factorize($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return factorize(...$args);\n}\n\nfunction test(): void {\n if (candidate(2) !== array(2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(4) !== array(2, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(8) !== array(2, 2, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(57) !== array(3, 19)) { throw new Exception(\"Test failed!\"); }\n if (candidate(3249) !== array(3, 3, 19, 19)) { throw new Exception(\"Test failed!\"); }\n if (candidate(185193) !== array(3, 3, 3, 19, 19, 19)) { throw new Exception(\"Test failed!\"); }\n if (candidate(20577) !== array(3, 19, 19, 19)) { throw new Exception(\"Test failed!\"); }\n if (candidate(18) !== array(2, 3, 3)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "php", - "prompt": ">> below_threshold(array(1, 2, 4, 10), 100)\n// true\n// >>> below_threshold(array(1, 20, 4, 10), 5)\n// false\nfunction below_threshold($l, $t) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return below_threshold(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2, 4, 10), 100) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 20, 4, 10), 5) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 20, 4, 10), 21) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 20, 4, 10), 22) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 8, 4, 10), 11) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 8, 4, 10), 10) !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "php", - "prompt": ">> rounded_avg(1, 5)\n// \"0b11\"\n// >>> rounded_avg(7, 5)\n// -1\n// >>> rounded_avg(10, 20)\n// \"0b1111\"\n// >>> rounded_avg(20, 33)\n// \"0b11010\"\nfunction rounded_avg($n, $m) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return rounded_avg(...$args);\n}\n\nfunction test(): void {\n if (candidate(1, 5) !== \"0b11\") { throw new Exception(\"Test failed!\"); }\n if (candidate(7, 13) !== \"0b1010\") { throw new Exception(\"Test failed!\"); }\n if (candidate(964, 977) !== \"0b1111001010\") { throw new Exception(\"Test failed!\"); }\n if (candidate(996, 997) !== \"0b1111100100\") { throw new Exception(\"Test failed!\"); }\n if (candidate(560, 851) !== \"0b1011000010\") { throw new Exception(\"Test failed!\"); }\n if (candidate(185, 546) !== \"0b101101110\") { throw new Exception(\"Test failed!\"); }\n if (candidate(362, 496) !== \"0b110101101\") { throw new Exception(\"Test failed!\"); }\n if (candidate(350, 902) !== \"0b1001110010\") { throw new Exception(\"Test failed!\"); }\n if (candidate(197, 233) !== \"0b11010111\") { throw new Exception(\"Test failed!\"); }\n if (candidate(7, 5) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(5, 1) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(5, 5) !== \"0b101\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "php", - "prompt": ">> parse_nested_parens(\"(()()) ((())) () ((())()())\")\n// array(2, 3, 1, 3)\nfunction parse_nested_parens($paren_string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return parse_nested_parens(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"(()()) ((())) () ((())()())\") !== array(2, 3, 1, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"() (()) ((())) (((())))\") !== array(1, 2, 3, 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"(()(())((())))\") !== array(4)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "php", - "prompt": ">> solution(array(5, 8, 7, 1))\n// 12\n// >>> solution(array(3, 3, 3, 3, 3))\n// 9\n// >>> solution(array(30, 13, 24, 321))\n// 0\nfunction solution($lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return solution(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(5, 8, 7, 1)) !== 12) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 3, 3, 3, 3)) !== 9) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(30, 13, 24, 321)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 9)) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 4, 8)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(30, 13, 23, 32)) !== 23) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 13, 2, 9)) !== 3) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "php", - "prompt": ">> get_max_triples(5)\n// 1\n// Explanation: \n// a = [1, 3, 7, 13, 21]\n// The only valid triple is (1, 7, 13).\nfunction get_max_triples($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return get_max_triples(...$args);\n}\n\nfunction test(): void {\n if (candidate(5) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(6) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(10) !== 36) { throw new Exception(\"Test failed!\"); }\n if (candidate(100) !== 53361) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "php", - "prompt": ">> bf(\"Jupiter\", \"Neptune\")\n// array(\"Saturn\", \"Uranus\")\n// >>> bf(\"Earth\", \"Mercury\")\n// \"Venus\"\n// >>> bf(\"Mercury\", \"Uranus\")\n// array(\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\")\nfunction bf($planet1, $planet2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return bf(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"Jupiter\", \"Neptune\") !== array(\"Saturn\", \"Uranus\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Earth\", \"Mercury\") !== array(\"Venus\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Mercury\", \"Uranus\") !== array(\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Neptune\", \"Venus\") !== array(\"Earth\", \"Mars\", \"Jupiter\", \"Saturn\", \"Uranus\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Earth\", \"Earth\") !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Mars\", \"Earth\") !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Jupiter\", \"Makemake\") !== array()) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "php", - "prompt": ">> next_smallest(array(1, 2, 3, 4, 5))\n// 2\n// >>> next_smallest(array(5, 1, 4, 3, 2))\n// 2\n// >>> next_smallest(array())\n// null\n// >>> next_smallest(array(1, 1))\n// null\nfunction next_smallest($lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return next_smallest(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2, 3, 4, 5)) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 1, 4, 3, 2)) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== null) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 1)) !== null) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 1, 1, 1, 0)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 1)) !== null) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-35, 34, 12, -45)) !== -35) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "php", - "prompt": ">> sort_numbers(\"three one five\")\n// \"one three five\"\nfunction sort_numbers($numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return sort_numbers(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"three\") !== \"three\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"three five nine\") !== \"three five nine\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"five zero four seven nine eight\") !== \"zero four five seven eight nine\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"six five four three two one zero\") !== \"zero one two three four five six\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "php", - "prompt": ">> cycpattern_check(\"abcd\", \"abd\")\n// false\n// >>> cycpattern_check(\"hello\", \"ell\")\n// true\n// >>> cycpattern_check(\"whassup\", \"psus\")\n// false\n// >>> cycpattern_check(\"abab\", \"baa\")\n// true\n// >>> cycpattern_check(\"efef\", \"eeff\")\n// false\n// >>> cycpattern_check(\"himenss\", \"simen\")\n// true\nfunction cycpattern_check($a, $b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return cycpattern_check(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"xyzw\", \"xyw\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"yello\", \"ell\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"whattup\", \"ptut\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"efef\", \"fee\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abab\", \"aabb\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"winemtt\", \"tinem\") !== true) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "php", - "prompt": ">> decimal_to_binary(15)\n// \"db1111db\"\n// >>> decimal_to_binary(32)\n// \"db100000db\"\nfunction decimal_to_binary($decimal) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return decimal_to_binary(...$args);\n}\n\nfunction test(): void {\n if (candidate(0) !== \"db0db\") { throw new Exception(\"Test failed!\"); }\n if (candidate(32) !== \"db100000db\") { throw new Exception(\"Test failed!\"); }\n if (candidate(103) !== \"db1100111db\") { throw new Exception(\"Test failed!\"); }\n if (candidate(15) !== \"db1111db\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "php", - "prompt": ">> filter_by_substring(array(), \"a\")\n// array()\n// >>> filter_by_substring(array(\"abc\", \"bacd\", \"cde\", \"array\"), \"a\")\n// array(\"abc\", \"bacd\", \"array\")\nfunction filter_by_substring($strings, $substring) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return filter_by_substring(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(), \"john\") !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"), \"xxx\") !== array(\"xxx\", \"xxxAAA\", \"xxx\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"), \"xx\") !== array(\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"grunt\", \"trumpet\", \"prune\", \"gruesome\"), \"run\") !== array(\"grunt\", \"prune\")) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "php", - "prompt": ">> even_odd_count(-12)\n// array(1, 1)\n// >>> even_odd_count(123)\n// array(1, 2)\nfunction even_odd_count($num) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return even_odd_count(...$args);\n}\n\nfunction test(): void {\n if (candidate(7) !== array(0, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(-78) !== array(1, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(3452) !== array(2, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(346211) !== array(3, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(-345821) !== array(3, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(-2) !== array(1, 0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(-45347) !== array(2, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(0) !== array(1, 0)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "php", - "prompt": ">> find_max(array(\"name\", \"of\", \"string\"))\n// \"string\"\n// >>> find_max(array(\"name\", \"enam\", \"game\"))\n// \"enam\"\n// >>> find_max(array(\"aaaaaaa\", \"bb\", \"cc\"))\n// \"aaaaaaa\"\nfunction find_max($words) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return find_max(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(\"name\", \"of\", \"string\")) !== \"string\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"name\", \"enam\", \"game\")) !== \"enam\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"aaaaaaa\", \"bb\", \"cc\")) !== \"aaaaaaa\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"abc\", \"cba\")) !== \"abc\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"play\", \"this\", \"game\", \"of\", \"footbott\")) !== \"footbott\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"we\", \"are\", \"gonna\", \"rock\")) !== \"gonna\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"we\", \"are\", \"a\", \"mad\", \"nation\")) !== \"nation\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"this\", \"is\", \"a\", \"prrk\")) !== \"this\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"b\")) !== \"b\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"play\", \"play\", \"play\")) !== \"play\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "php", - "prompt": ">> largest_smallest_integers(array(2, 4, 1, 3, 5, 7))\n// array(null, 1)\n// >>> largest_smallest_integers(array())\n// array(null, null)\n// >>> largest_smallest_integers(array(0))\n// array(null, null)\nfunction largest_smallest_integers($lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return largest_smallest_integers(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(2, 4, 1, 3, 5, 7)) !== array(null, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 4, 1, 3, 5, 7, 0)) !== array(null, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 3, 2, 4, 5, 6, -2)) !== array(-2, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 5, 3, 6, 2, 7, -7)) !== array(-7, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(7, 3, 8, 4, 9, 2, 5, -9)) !== array(-9, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== array(null, null)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0)) !== array(null, null)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, -3, -5, -6)) !== array(-1, null)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, -3, -5, -6, 0)) !== array(-1, null)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-6, -4, -4, -3, 1)) !== array(-3, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-6, -4, -4, -3, -100, 1)) !== array(-3, 1)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "php", - "prompt": ">> pluck(array(4, 2, 3))\n// array(2, 1)\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 2:\n// >>> pluck(array(1, 2, 3))\n// array(2, 1)\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 3:\n// >>> pluck(array())\n// array()\n// Example 4:\n// >>> pluck(array(5, 0, 3, 0, 4, 2))\n// array(0, 1)\n// Explanation: 0 is the smallest value, but there are two zeros,\n// so we will choose the first zero, which has the smallest index.\n// Constraints:\n// * 1 <= nodes.length <= 10000\n// * 0 <= node.value\nfunction pluck($arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return pluck(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(4, 2, 3)) !== array(2, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3)) !== array(2, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 0, 3, 0, 4, 2)) !== array(0, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 0, 5, 3)) !== array(0, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 4, 8, 4, 8)) !== array(4, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(7, 6, 7, 1)) !== array(6, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(7, 9, 7, 1)) !== array()) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "php", - "prompt": " 0.\n// If a number is negative, then its first signed digit will be negative:\n// e.g. -123 has signed digits -1, 2, and 3.\n// >>> count_nums(array())\n// 0\n// >>> count_nums(array(-1, 11, -11))\n// 1\n// >>> count_nums(array(1, 1, 2))\n// 3\nfunction count_nums($arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return count_nums(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, -2, 0)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 1, 2, -2, 3, 4, 5)) !== 6) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 6, 9, -6, 0, 1, 5)) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 100, 98, -7, 1, -1)) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(12, 23, 34, -45, -56, 0)) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0, 1)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1)) !== 1) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "php", - "prompt": "= 2) and a positive integer k, \n// each cell of the grid contains a value. Every integer in the range [1, N * N]\n// inclusive appears exactly once on the cells of the grid.\n// You have to find the minimum path of length k in the grid. You can start\n// from any cell, and in each step you can move to any of the neighbor cells,\n// in other words, you can go to cells which share an edge with you current\n// cell.\n// Please note that a path of length k means visiting exactly k cells (not\n// necessarily distinct).\n// You CANNOT go off the grid.\n// A path A (of length k) is considered less than a path B (of length k) if\n// after making the ordered arrays of the values on the cells that A and B go\n// through (let's call them lst_A and lst_B), lst_A is lexicographically less\n// than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n// such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n// lst_A[j] = lst_B[j].\n// It is guaranteed that the answer is unique.\n// Return an ordered array of the values on the cells that the minimum path go through.\n// Examples: \n// >>> minPath(array(array(1, 2, 3), array(4, 5, 6), array(7, 8, 9)), 3)\n// array(1, 2, 1)\n// >>> minPath(array(array(5, 9, 3), array(4, 1, 6), array(7, 8, 2)), 1)\n// array(1)\nfunction minPath($grid, $k) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return minPath(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(array(1, 2, 3), array(4, 5, 6), array(7, 8, 9)), 3) !== array(1, 2, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(5, 9, 3), array(4, 1, 6), array(7, 8, 2)), 1) !== array(1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(1, 2, 3, 4), array(5, 6, 7, 8), array(9, 10, 11, 12), array(13, 14, 15, 16)), 4) !== array(1, 2, 1, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(6, 4, 13, 10), array(5, 7, 12, 1), array(3, 16, 11, 15), array(8, 14, 9, 2)), 7) !== array(1, 10, 1, 10, 1, 10, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(8, 14, 9, 2), array(6, 4, 13, 15), array(5, 7, 1, 12), array(3, 10, 11, 16)), 5) !== array(1, 7, 1, 7, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(11, 8, 7, 2), array(5, 16, 14, 4), array(9, 3, 15, 6), array(12, 13, 10, 1)), 9) !== array(1, 6, 1, 6, 1, 6, 1, 6, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(12, 13, 10, 1), array(9, 3, 15, 6), array(5, 16, 14, 4), array(11, 8, 7, 2)), 12) !== array(1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(2, 7, 4), array(3, 1, 5), array(6, 8, 9)), 8) !== array(1, 3, 1, 3, 1, 3, 1, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(6, 1, 5), array(3, 8, 9), array(2, 7, 4)), 8) !== array(1, 5, 1, 5, 1, 5, 1, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(1, 2), array(3, 4)), 10) !== array(1, 2, 1, 2, 1, 2, 1, 2, 1, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(1, 3), array(3, 2)), 10) !== array(1, 3, 1, 3, 1, 3, 1, 3, 1, 3)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "php", - "prompt": ">> strange_sort_list(array(1, 2, 3, 4))\n// array(1, 4, 2, 3)\n// >>> strange_sort_list(array(5, 5, 5, 5))\n// array(5, 5, 5, 5)\n// >>> strange_sort_list(array())\n// array()\nfunction strange_sort_list($lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return strange_sort_list(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2, 3, 4)) !== array(1, 4, 2, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 6, 7, 8, 9)) !== array(5, 9, 6, 8, 7)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4, 5)) !== array(1, 5, 2, 4, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 6, 7, 8, 9, 1)) !== array(1, 9, 5, 8, 6, 7)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 5, 5, 5)) !== array(5, 5, 5, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4, 5, 6, 7, 8)) !== array(1, 8, 2, 7, 3, 6, 4, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0, 2, 2, 2, 5, 5, -5, -5)) !== array(-5, 5, -5, 5, 0, 2, 2, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(111111)) !== array(111111)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "php", - "prompt": ">> string_to_md5(\"Hello world\")\n// \"3e25960a79dbc69b674cd4ec67a72c62\"\nfunction string_to_md5($text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return string_to_md5(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"Hello world\") !== \"3e25960a79dbc69b674cd4ec67a72c62\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"\") !== null) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"A B C\") !== \"0ef78513b0cb8cef12743f5aeb35f888\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"password\") !== \"5f4dcc3b5aa765d61d8327deb882cf99\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "php", - "prompt": ">> get_closest_vowel(\"yogurt\")\n// \"u\"\n// >>> get_closest_vowel(\"FULL\")\n// \"U\"\n// >>> get_closest_vowel(\"quick\")\n// \"\"\n// >>> get_closest_vowel(\"ab\")\n// \"\"\nfunction get_closest_vowel($word) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return get_closest_vowel(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"yogurt\") !== \"u\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"full\") !== \"u\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"easy\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"eAsy\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"ali\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"bad\") !== \"a\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"most\") !== \"o\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"ab\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"ba\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"quick\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"anime\") !== \"i\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Asia\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Above\") !== \"o\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "php", - "prompt": ">> change_base(8, 3)\n// \"22\"\n// >>> change_base(8, 2)\n// \"1000\"\n// >>> change_base(7, 2)\n// \"111\"\nfunction change_base($x, $base) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return change_base(...$args);\n}\n\nfunction test(): void {\n if (candidate(8, 3) !== \"22\") { throw new Exception(\"Test failed!\"); }\n if (candidate(9, 3) !== \"100\") { throw new Exception(\"Test failed!\"); }\n if (candidate(234, 2) !== \"11101010\") { throw new Exception(\"Test failed!\"); }\n if (candidate(16, 2) !== \"10000\") { throw new Exception(\"Test failed!\"); }\n if (candidate(8, 2) !== \"1000\") { throw new Exception(\"Test failed!\"); }\n if (candidate(7, 2) !== \"111\") { throw new Exception(\"Test failed!\"); }\n if (candidate(2, 3) !== \"2\") { throw new Exception(\"Test failed!\"); }\n if (candidate(3, 4) !== \"3\") { throw new Exception(\"Test failed!\"); }\n if (candidate(4, 5) !== \"4\") { throw new Exception(\"Test failed!\"); }\n if (candidate(5, 6) !== \"5\") { throw new Exception(\"Test failed!\"); }\n if (candidate(6, 7) !== \"6\") { throw new Exception(\"Test failed!\"); }\n if (candidate(7, 8) !== \"7\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "php", - "prompt": ">> has_close_elements(array(1.0, 2.0, 3.0), 0.5)\n// false\n// >>> has_close_elements(array(1.0, 2.8, 3.0, 4.0, 5.0, 2.0), 0.3)\n// true\nfunction has_close_elements($numbers, $threshold) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return has_close_elements(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1.0, 2.0, 3.9, 4.0, 5.0, 2.2), 0.3) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 3.9, 4.0, 5.0, 2.2), 0.05) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 5.9, 4.0, 5.0), 0.95) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 5.9, 4.0, 5.0), 0.8) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 3.0, 4.0, 5.0, 2.0), 0.1) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.1, 2.2, 3.1, 4.1, 5.1), 1.0) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.1, 2.2, 3.1, 4.1, 5.1), 0.5) !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "php", - "prompt": ">> is_nested(\"[[]]\")\n// true\n// >>> is_nested(\"[]]]]]]][[[[[]\")\n// false\n// >>> is_nested(\"[][]\")\n// false\n// >>> is_nested(\"[]\")\n// false\n// >>> is_nested(\"[[][]]\")\n// true\n// >>> is_nested(\"[[]][[\")\n// true\nfunction is_nested($string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return is_nested(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"[[]]\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"[]]]]]]][[[[[]\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"[][]\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"[]\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"[[[[]]]]\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"[]]]]]]]]]]\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"[][][[]]\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"[[]\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"[]]\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"[[]][[\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"[[][]]\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"[[[[[[[[\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"]]]]]]]]\") !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "php", - "prompt": ">> concatenate(array())\n// \"\"\n// >>> concatenate(array(\"a\", \"b\", \"c\"))\n// \"abc\"\nfunction concatenate($strings) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return concatenate(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"x\", \"y\", \"z\")) !== \"xyz\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"x\", \"y\", \"z\", \"w\", \"k\")) !== \"xyzwk\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "php", - "prompt": ">> prime_fib(1)\n// 2\n// >>> prime_fib(2)\n// 3\n// >>> prime_fib(3)\n// 5\n// >>> prime_fib(4)\n// 13\n// >>> prime_fib(5)\n// 89\nfunction prime_fib($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return prime_fib(...$args);\n}\n\nfunction test(): void {\n if (candidate(1) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(2) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(3) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(4) !== 13) { throw new Exception(\"Test failed!\"); }\n if (candidate(5) !== 89) { throw new Exception(\"Test failed!\"); }\n if (candidate(6) !== 233) { throw new Exception(\"Test failed!\"); }\n if (candidate(7) !== 1597) { throw new Exception(\"Test failed!\"); }\n if (candidate(8) !== 28657) { throw new Exception(\"Test failed!\"); }\n if (candidate(9) !== 514229) { throw new Exception(\"Test failed!\"); }\n if (candidate(10) !== 433494437) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "php", - "prompt": ">> find_closest_elements(array(1.0, 2.0, 3.0, 4.0, 5.0, 2.2))\n// array(2.0, 2.2)\n// >>> find_closest_elements(array(1.0, 2.0, 3.0, 4.0, 5.0, 2.0))\n// array(2.0, 2.0)\nfunction find_closest_elements($numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return find_closest_elements(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1.0, 2.0, 3.9, 4.0, 5.0, 2.2)) !== array(3.9, 4.0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 5.9, 4.0, 5.0)) !== array(5.0, 5.9)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 3.0, 4.0, 5.0, 2.2)) !== array(2.0, 2.2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 3.0, 4.0, 5.0, 2.0)) !== array(2.0, 2.0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.1, 2.2, 3.1, 4.1, 5.1)) !== array(2.2, 3.1)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "php", - "prompt": ">> hex_key(\"AB\")\n// 1\n// >>> hex_key(\"1077E\")\n// 2\n// >>> hex_key(\"ABED1A33\")\n// 4\n// >>> hex_key(\"123456789ABCDEF0\")\n// 6\n// >>> hex_key(\"2020\")\n// 2\nfunction hex_key($num) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return hex_key(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"AB\") !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1077E\") !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"ABED1A33\") !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"2020\") !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"123456789ABCDEF0\") !== 6) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"112233445566778899AABBCCDDEEFF00\") !== 12) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "php", - "prompt": ">> multiply(148, 412)\n// 16\n// >>> multiply(19, 28)\n// 72\n// >>> multiply(2020, 1851)\n// 0\n// >>> multiply(14, -15)\n// 20\nfunction multiply($a, $b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return multiply(...$args);\n}\n\nfunction test(): void {\n if (candidate(148, 412) !== 16) { throw new Exception(\"Test failed!\"); }\n if (candidate(19, 28) !== 72) { throw new Exception(\"Test failed!\"); }\n if (candidate(2020, 1851) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(14, -15) !== 20) { throw new Exception(\"Test failed!\"); }\n if (candidate(76, 67) !== 42) { throw new Exception(\"Test failed!\"); }\n if (candidate(17, 27) !== 49) { throw new Exception(\"Test failed!\"); }\n if (candidate(0, 1) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(0, 0) !== 0) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "php", - "prompt": ">> rescale_to_unit(array(1.0, 2.0, 3.0, 4.0, 5.0))\n// array(0.0, 0.25, 0.5, 0.75, 1.0)\nfunction rescale_to_unit($numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return rescale_to_unit(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(2.0, 49.9)) !== array(0.0, 1.0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(100.0, 49.9)) !== array(1.0, 0.0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 3.0, 4.0, 5.0)) !== array(0.0, 0.25, 0.5, 0.75, 1.0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2.0, 1.0, 5.0, 3.0, 4.0)) !== array(0.25, 0.0, 1.0, 0.5, 0.75)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(12.0, 11.0, 15.0, 13.0, 14.0)) !== array(0.25, 0.0, 1.0, 0.5, 0.75)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "php", - "prompt": ">> digits(1)\n// 1\n// >>> digits(4)\n// 0\n// >>> digits(235)\n// 15\nfunction digits($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return digits(...$args);\n}\n\nfunction test(): void {\n if (candidate(5) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(54) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(120) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(5014) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(98765) !== 315) { throw new Exception(\"Test failed!\"); }\n if (candidate(5576543) !== 2625) { throw new Exception(\"Test failed!\"); }\n if (candidate(2468) !== 0) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "php", - "prompt": ">> Strongest_Extension(\"my_class\", array(\"AA\", \"Be\", \"CC\"))\n// \"my_class.AA\"\nfunction Strongest_Extension($class_name, $extensions) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return Strongest_Extension(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"Watashi\", array(\"tEN\", \"niNE\", \"eIGHt8OKe\")) !== \"Watashi.eIGHt8OKe\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Boku123\", array(\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\")) !== \"Boku123.YEs.WeCaNe\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"__YESIMHERE\", array(\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\")) !== \"__YESIMHERE.NuLl__\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"K\", array(\"Ta\", \"TAR\", \"t234An\", \"cosSo\")) !== \"K.TAR\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"__HAHA\", array(\"Tab\", \"123\", \"781345\", \"-_-\")) !== \"__HAHA.123\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"YameRore\", array(\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\")) !== \"YameRore.okIWILL123\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"finNNalLLly\", array(\"Die\", \"NowW\", \"Wow\", \"WoW\")) !== \"finNNalLLly.WoW\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"_\", array(\"Bb\", \"91245\")) !== \"_.Bb\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Sp\", array(\"671235\", \"Bb\")) !== \"Sp.671235\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "php", - "prompt": ">> histogram(\"a b c\")\n// array(\"a\" => 1, \"b\" => 1, \"c\" => 1)\n// >>> histogram(\"a b b a\")\n// array(\"a\" => 2, \"b\" => 2)\n// >>> histogram(\"a b c a b\")\n// array(\"a\" => 2, \"b\" => 2)\n// >>> histogram(\"b b b b a\")\n// array(\"b\" => 4)\n// >>> histogram(\"\")\n// array()\nfunction histogram($test) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return histogram(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"a b b a\") !== array(\"a\" => 2, \"b\" => 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"a b c a b\") !== array(\"a\" => 2, \"b\" => 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"a b c d g\") !== array(\"a\" => 1, \"b\" => 1, \"c\" => 1, \"d\" => 1, \"g\" => 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"r t g\") !== array(\"r\" => 1, \"t\" => 1, \"g\" => 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"b b b b a\") !== array(\"b\" => 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"r t g\") !== array(\"r\" => 1, \"t\" => 1, \"g\" => 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"\") !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"a\") !== array(\"a\" => 1)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "php", - "prompt": ">> pairs_sum_to_zero(array(1, 3, 5, 0))\n// false\n// >>> pairs_sum_to_zero(array(1, 3, -2, 1))\n// false\n// >>> pairs_sum_to_zero(array(1, 2, 3, 7))\n// false\n// >>> pairs_sum_to_zero(array(2, 4, -5, 3, 5, 7))\n// true\n// >>> pairs_sum_to_zero(array(1))\n// false\nfunction pairs_sum_to_zero($l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return pairs_sum_to_zero(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 3, 5, 0)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 3, -2, 1)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 7)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 4, -5, 3, 5, 7)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-3, 9, -1, 3, 2, 30)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-3, 9, -1, 3, 2, 31)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-3, 9, -1, 4, 2, 30)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-3, 9, -1, 4, 2, 31)) !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "php", - "prompt": ">> total_match(array(), array())\n// array()\n// >>> total_match(array(\"hi\", \"admin\"), array(\"hI\", \"Hi\"))\n// array(\"hI\", \"Hi\")\n// >>> total_match(array(\"hi\", \"admin\"), array(\"hi\", \"hi\", \"admin\", \"project\"))\n// array(\"hi\", \"admin\")\n// >>> total_match(array(\"hi\", \"admin\"), array(\"hI\", \"hi\", \"hi\"))\n// array(\"hI\", \"hi\", \"hi\")\n// >>> total_match(array(\"4\"), array(\"1\", \"2\", \"3\", \"4\", \"5\"))\n// array(\"4\")\nfunction total_match($lst1, $lst2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return total_match(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(), array()) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"hi\", \"admin\"), array(\"hi\", \"hi\")) !== array(\"hi\", \"hi\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"hi\", \"admin\"), array(\"hi\", \"hi\", \"admin\", \"project\")) !== array(\"hi\", \"admin\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"4\"), array(\"1\", \"2\", \"3\", \"4\", \"5\")) !== array(\"4\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"hi\", \"admin\"), array(\"hI\", \"Hi\")) !== array(\"hI\", \"Hi\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"hi\", \"admin\"), array(\"hI\", \"hi\", \"hi\")) !== array(\"hI\", \"hi\", \"hi\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"hi\", \"admin\"), array(\"hI\", \"hi\", \"hii\")) !== array(\"hi\", \"admin\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(), array(\"this\")) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"this\"), array()) !== array()) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "php", - "prompt": " number of digits, return digits reversed.\n// >>> circular_shift(12, 1)\n// \"21\"\n// >>> circular_shift(12, 2)\n// \"12\"\nfunction circular_shift($x, $shift) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return circular_shift(...$args);\n}\n\nfunction test(): void {\n if (candidate(100, 2) !== \"001\") { throw new Exception(\"Test failed!\"); }\n if (candidate(12, 2) !== \"12\") { throw new Exception(\"Test failed!\"); }\n if (candidate(97, 8) !== \"79\") { throw new Exception(\"Test failed!\"); }\n if (candidate(12, 1) !== \"21\") { throw new Exception(\"Test failed!\"); }\n if (candidate(11, 101) !== \"11\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "php", - "prompt": ">> monotonic(array(1, 2, 4, 20))\n// true\n// >>> monotonic(array(1, 20, 4, 10))\n// false\n// >>> monotonic(array(4, 1, 0, -10))\n// true\nfunction monotonic($l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return monotonic(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2, 4, 10)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 4, 20)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 20, 4, 10)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 1, 0, -10)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 1, 1, 0)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 2, 5, 60)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4, 5, 60)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(9, 9, 9, 9)) !== true) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "php", - "prompt": ">> is_equal_to_sum_even(4)\n// false\n// >>> is_equal_to_sum_even(6)\n// false\n// >>> is_equal_to_sum_even(8)\n// true\nfunction is_equal_to_sum_even($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return is_equal_to_sum_even(...$args);\n}\n\nfunction test(): void {\n if (candidate(4) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(6) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(8) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(10) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(11) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(12) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(13) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(16) !== true) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "php", - "prompt": ">> parse_music(\"o o| .| o| o| .| .| .| .| o o\")\n// array(4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4)\nfunction parse_music($music_string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return parse_music(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\") !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"o o o o\") !== array(4, 4, 4, 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\".| .| .| .|\") !== array(1, 1, 1, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"o| o| .| .| o o o o\") !== array(2, 2, 1, 1, 4, 4, 4, 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"o| .| o| .| o o| o o|\") !== array(2, 1, 2, 1, 4, 2, 4, 2)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "php", - "prompt": ">> lst\n// array(1, 2, 3)\n// >>> lst\n// array()\n// >>> lst\n// array(-1, -5, 2, -1, -5)\nfunction sum_squares($lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return sum_squares(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2, 3)) !== 6) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 4, 9)) !== 14) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 1, 1, 1, 1, 1, 1, 1, 1)) !== 9) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, -1, -1, -1, -1, -1, -1, -1, -1)) !== -3) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, -5, 2, -1, -5)) !== -126) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-56, -99, 1, 0, -2)) !== 3030) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, 0, 0, 0, 0, 0, 0, 0, -1)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37)) !== -14196) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10)) !== -1448) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "php", - "prompt": ">> triples_sum_to_zero(array(1, 3, 5, 0))\n// false\n// >>> triples_sum_to_zero(array(1, 3, -2, 1))\n// true\n// >>> triples_sum_to_zero(array(1, 2, 3, 7))\n// false\n// >>> triples_sum_to_zero(array(2, 4, -5, 3, 9, 7))\n// true\n// >>> triples_sum_to_zero(array(1))\n// false\nfunction triples_sum_to_zero($l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return triples_sum_to_zero(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 3, 5, 0)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 3, 5, -1)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 3, -2, 1)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 7)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 5, 7)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 4, -5, 3, 9, 7)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 3, 5, -100)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(100, 3, 5, -100)) !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "php", - "prompt": "\".\n// return true if every opening bracket has a corresponding closing bracket.\n// >>> correct_bracketing(\"<\")\n// false\n// >>> correct_bracketing(\"<>\")\n// true\n// >>> correct_bracketing(\"<<><>>\")\n// true\n// >>> correct_bracketing(\"><<>\")\n// false\nfunction correct_bracketing($brackets) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return correct_bracketing(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"<>\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<<><>>\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<><><<><>><>\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<><><<<><><>><>><<><><<>>>\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<<<><>>>>\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"><<>\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<<<<\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\">\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<<>\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<><><<><>><>><<>\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<><><<><>><>>><>\") !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "php", - "prompt": ">> specialFilter(array(15, -73, 14, -15))\n// 1\n// >>> specialFilter(array(33, -2, -3, 45, 21, 109))\n// 2\nfunction specialFilter($nums) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return specialFilter(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(5, -2, 1, -5)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(15, -73, 14, -15)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(33, -2, -3, 45, 21, 109)) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(43, -12, 93, 125, 121, 109)) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(71, -2, -33, 75, 21, 19)) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== 0) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "php", - "prompt": ">> check_dict_case(array(\"a\" => \"apple\", \"b\" => \"banana\"))\n// true\n// >>> check_dict_case(array(\"a\" => \"apple\", \"A\" => \"banana\", \"B\" => \"banana\"))\n// false\n// >>> check_dict_case(array(\"a\" => \"apple\", 8 => \"banana\", \"a\" => \"apple\"))\n// false\n// >>> check_dict_case(array(\"Name\" => \"John\", \"Age\" => \"36\", \"City\" => \"Houston\"))\n// false\n// >>> check_dict_case(array(\"STATE\" => \"NC\", \"ZIP\" => \"12345\"))\n// true\nfunction check_dict_case($dict) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return check_dict_case(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(\"p\" => \"pineapple\", \"b\" => \"banana\")) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"p\" => \"pineapple\", \"A\" => \"banana\", \"B\" => \"banana\")) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"p\" => \"pineapple\", \"5\" => \"banana\", \"a\" => \"apple\")) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"Name\" => \"John\", \"Age\" => \"36\", \"City\" => \"Houston\")) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"STATE\" => \"NC\", \"ZIP\" => \"12345\")) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"fruit\" => \"Orange\", \"taste\" => \"Sweet\")) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "php", - "prompt": ">> split_words(\"Hello world!\")\n// array(\"Hello\", \"world!\")\n// >>> split_words(\"Hello,world!\")\n// array(\"Hello\", \"world!\")\n// >>> split_words(\"abcdef\")\n// 3\nfunction split_words($txt) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return split_words(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"Hello world!\") !== array(\"Hello\", \"world!\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Hello,world!\") !== array(\"Hello\", \"world!\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Hello world,!\") !== array(\"Hello\", \"world,!\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Hello,Hello,world !\") !== array(\"Hello,Hello,world\", \"!\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcdef\") !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"aaabb\") !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"aaaBb\") !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"\") !== 0) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "php", - "prompt": ">> fibfib(1)\n// 0\n// >>> fibfib(5)\n// 4\n// >>> fibfib(8)\n// 24\nfunction fibfib($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return fibfib(...$args);\n}\n\nfunction test(): void {\n if (candidate(2) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(1) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(5) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(8) !== 24) { throw new Exception(\"Test failed!\"); }\n if (candidate(10) !== 81) { throw new Exception(\"Test failed!\"); }\n if (candidate(12) !== 274) { throw new Exception(\"Test failed!\"); }\n if (candidate(14) !== 927) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "php", - "prompt": ">> lst(array(1.0, 2.0, 3.0))\n// 14\n// >>> lst(array(1.0, 4.0, 9.0))\n// 98\n// >>> lst(array(1.0, 3.0, 5.0, 7.0))\n// 84\n// >>> lst(array(1.4, 4.2, 0.0))\n// 29\n// >>> lst(array(-2.4, 1.0, 1.0))\n// 6\nfunction sum_squares($lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return sum_squares(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1.0, 2.0, 3.0)) !== 14) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 3.0)) !== 14) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 3.0, 5.0, 7.0)) !== 84) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.4, 4.2, 0.0)) !== 29) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-2.4, 1.0, 1.0)) !== 6) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(100.0, 1.0, 15.0, 2.0)) !== 10230) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(10000.0, 10000.0)) !== 200000000) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1.4, 4.6, 6.3)) !== 75) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1.4, 17.9, 18.9, 19.9)) !== 1086) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0.0)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1.0)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1.0, 1.0, 0.0)) !== 2) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_85_add", - "language": "php", - "prompt": ">> add(array(4, 2, 6, 7))\n// 2\nfunction add($lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return add(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(4, 88)) !== 88) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 5, 6, 7, 2, 122)) !== 122) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 0, 6, 7)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 4, 6, 8)) !== 12) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "php", - "prompt": ">> unique(array(5, 3, 5, 2, 3, 3, 9, 0, 123))\n// array(0, 2, 3, 5, 9, 123)\nfunction unique($l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return unique(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(5, 3, 5, 2, 3, 3, 9, 0, 123)) !== array(0, 2, 3, 5, 9, 123)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "php", - "prompt": ">> fix_spaces(\" Example\")\n// \"Example\"\n// >>> fix_spaces(\" Example 1\")\n// \"Example_1\"\n// >>> fix_spaces(\" Example 2\")\n// \"_Example_2\"\n// >>> fix_spaces(\" Example 3\")\n// \"_Example-3\"\nfunction fix_spaces($text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return fix_spaces(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"Example\") !== \"Example\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Mudasir Hanif \") !== \"Mudasir_Hanif_\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Yellow Yellow Dirty Fellow\") !== \"Yellow_Yellow__Dirty__Fellow\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Exa mple\") !== \"Exa-mple\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\" Exa 1 2 2 mple\") !== \"-Exa_1_2_2_mple\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "php", - "prompt": ">> modp(3, 5)\n// 3\n// >>> modp(1101, 101)\n// 2\n// >>> modp(0, 101)\n// 1\n// >>> modp(3, 11)\n// 8\n// >>> modp(100, 101)\n// 1\nfunction modp($n, $p) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return modp(...$args);\n}\n\nfunction test(): void {\n if (candidate(3, 5) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(1101, 101) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(0, 101) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(3, 11) !== 8) { throw new Exception(\"Test failed!\"); }\n if (candidate(100, 101) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(30, 5) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(31, 5) !== 3) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "php", - "prompt": ">> valid_date(\"03-11-2000\")\n// true\n// >>> valid_date(\"15-01-2012\")\n// false\n// >>> valid_date(\"04-0-2040\")\n// false\n// >>> valid_date(\"06-04-2020\")\n// true\n// >>> valid_date(\"06/04/2020\")\n// false\nfunction valid_date($date) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return valid_date(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"03-11-2000\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"15-01-2012\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"04-0-2040\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"06-04-2020\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"01-01-2007\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"03-32-2011\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"04-31-3000\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"06-06-2005\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"21-31-2000\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"04-12-2003\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"04122003\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"20030412\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"2003-04\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"2003-04-12\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"04-2003\") !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "php", - "prompt": ">> anti_shuffle(\"Hi\")\n// \"Hi\"\n// >>> anti_shuffle(\"hello\")\n// \"ehllo\"\n// >>> anti_shuffle(\"Hello World!!!\")\n// \"Hello !!!Wdlor\"\nfunction anti_shuffle($s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return anti_shuffle(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"Hi\") !== \"Hi\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"hello\") !== \"ehllo\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"number\") !== \"bemnru\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcd\") !== \"abcd\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Hello World!!!\") !== \"Hello !!!Wdlor\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Hi. My name is Mister Robot. How are you?\") !== \".Hi My aemn is Meirst .Rboot How aer ?ouy\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "php", - "prompt": ">> is_sorted(array(5))\n// true\n// >>> is_sorted(array(1, 2, 3, 4, 5))\n// true\n// >>> is_sorted(array(1, 3, 2, 4, 5))\n// false\n// >>> is_sorted(array(1, 2, 3, 4, 5, 6))\n// true\n// >>> is_sorted(array(1, 2, 3, 4, 5, 6, 7))\n// true\n// >>> is_sorted(array(1, 3, 2, 4, 5, 6, 7))\n// false\n// >>> is_sorted(array(1, 2, 2, 3, 3, 4))\n// true\n// >>> is_sorted(array(1, 2, 2, 2, 3, 4))\n// false\nfunction is_sorted($lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return is_sorted(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(5)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4, 5)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 3, 2, 4, 5)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4, 5, 6)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4, 5, 6, 7)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 3, 2, 4, 5, 6, 7)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 2, 1)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 2, 2, 3, 4)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 3, 3, 4)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 2, 3, 3, 4)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4)) !== true) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "php", - "prompt": ">> is_happy(\"a\")\n// false\n// >>> is_happy(\"aa\")\n// false\n// >>> is_happy(\"abcd\")\n// true\n// >>> is_happy(\"aabb\")\n// false\n// >>> is_happy(\"adb\")\n// true\n// >>> is_happy(\"xyy\")\n// false\nfunction is_happy($s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return is_happy(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"a\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"aa\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcd\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"aabb\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"adb\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"xyy\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"iopaxpoi\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"iopaxioi\") !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "php", - "prompt": ">> will_it_fly(array(1, 2), 5)\n// false\n// # 1+2 is less than the maximum possible weight, but it's unbalanced.\n// >>> will_it_fly(array(3, 2, 3), 1)\n// false\n// # it's balanced, but 3+2+3 is more than the maximum possible weight.\n// >>> will_it_fly(array(3, 2, 3), 9)\n// true\n// # 3+2+3 is less than the maximum possible weight, and it's balanced.\n// >>> will_it_fly(array(3), 5)\n// true\n// # 3 is less than the maximum possible weight, and it's balanced.\nfunction will_it_fly($q, $w) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return will_it_fly(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(3, 2, 3), 9) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2), 5) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3), 5) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 2, 3), 1) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3), 6) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5), 5) !== true) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "php", - "prompt": ">> sort_array(array())\n// array()\n// >>> sort_array(array(5))\n// array(5)\n// >>> sort_array(array(2, 4, 3, 0, 1, 5))\n// array(0, 1, 2, 3, 4, 5)\n// >>> sort_array(array(2, 4, 3, 0, 1, 5, 6))\n// array(6, 5, 4, 3, 2, 1, 0)\nfunction sort_array($array) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return sort_array(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5)) !== array(5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 4, 3, 0, 1, 5)) !== array(0, 1, 2, 3, 4, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 4, 3, 0, 1, 5, 6)) !== array(6, 5, 4, 3, 2, 1, 0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 1)) !== array(1, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(15, 42, 87, 32, 11, 0)) !== array(0, 11, 15, 32, 42, 87)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(21, 14, 23, 11)) !== array(23, 21, 14, 11)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "php", - "prompt": ">> count_up_to(5)\n// array(2, 3)\n// >>> count_up_to(11)\n// array(2, 3, 5, 7)\n// >>> count_up_to(0)\n// array()\n// >>> count_up_to(20)\n// array(2, 3, 5, 7, 11, 13, 17, 19)\n// >>> count_up_to(1)\n// array()\n// >>> count_up_to(18)\n// array(2, 3, 5, 7, 11, 13, 17)\nfunction count_up_to($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return count_up_to(...$args);\n}\n\nfunction test(): void {\n if (candidate(5) !== array(2, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(6) !== array(2, 3, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(7) !== array(2, 3, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(10) !== array(2, 3, 5, 7)) { throw new Exception(\"Test failed!\"); }\n if (candidate(0) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(22) !== array(2, 3, 5, 7, 11, 13, 17, 19)) { throw new Exception(\"Test failed!\"); }\n if (candidate(1) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(18) !== array(2, 3, 5, 7, 11, 13, 17)) { throw new Exception(\"Test failed!\"); }\n if (candidate(47) !== array(2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43)) { throw new Exception(\"Test failed!\"); }\n if (candidate(101) !== array(2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "php", - "prompt": ">> longest(array())\n// null\n// >>> longest(array(\"a\", \"b\", \"c\"))\n// \"a\"\n// >>> longest(array(\"a\", \"bb\", \"ccc\"))\n// \"ccc\"\nfunction longest($strings) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return longest(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== null) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"x\", \"y\", \"z\")) !== \"x\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\")) !== \"zzzz\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "php", - "prompt": ">> by_length(array(2, 1, 1, 4, 5, 8, 2, 3))\n// array(\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\")\n// If the array is empty, return an empty array:\n// >>> by_length(array())\n// array()\n// If the array has any strange number ignore it:\n// >>> by_length(array(1, -1, 55))\n// array(\"One\")\nfunction by_length($arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return by_length(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(2, 1, 1, 4, 5, 8, 2, 3)) !== array(\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, -1, 55)) !== array(\"One\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, -1, 3, 2)) !== array(\"Three\", \"Two\", \"One\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(9, 4, 8)) !== array(\"Nine\", \"Eight\", \"Four\")) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_106_f", - "language": "php", - "prompt": ">> f(5)\n// array(1, 2, 6, 24, 15)\nfunction f($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return f(...$args);\n}\n\nfunction test(): void {\n if (candidate(5) !== array(1, 2, 6, 24, 15)) { throw new Exception(\"Test failed!\"); }\n if (candidate(7) !== array(1, 2, 6, 24, 15, 720, 28)) { throw new Exception(\"Test failed!\"); }\n if (candidate(1) !== array(1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(3) !== array(1, 2, 6)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "php", - "prompt": ">> fizz_buzz(50)\n// 0\n// >>> fizz_buzz(78)\n// 2\n// >>> fizz_buzz(79)\n// 3\nfunction fizz_buzz($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return fizz_buzz(...$args);\n}\n\nfunction test(): void {\n if (candidate(50) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(78) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(79) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(100) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(200) !== 6) { throw new Exception(\"Test failed!\"); }\n if (candidate(4000) !== 192) { throw new Exception(\"Test failed!\"); }\n if (candidate(10000) !== 639) { throw new Exception(\"Test failed!\"); }\n if (candidate(100000) !== 8026) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "php", - "prompt": ">> truncate_number(3.5)\n// 0.5\nfunction truncate_number($number) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return truncate_number(...$args);\n}\n\nfunction test(): void {\n if (candidate(3.5) !== 0.5) { throw new Exception(\"Test failed!\"); }\n if (candidate(1.25) !== 0.25) { throw new Exception(\"Test failed!\"); }\n if (candidate(123.0) !== 0.0) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "php", - "prompt": ">> sum_product(array())\n// array(0, 1)\n// >>> sum_product(array(1, 2, 3, 4))\n// array(10, 24)\nfunction sum_product($numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return sum_product(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== array(0, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 1, 1)) !== array(3, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(100, 0)) !== array(100, 0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 5, 7)) !== array(15, 105)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(10)) !== array(10, 10)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "php", - "prompt": ">> get_row(array(array(1, 2, 3, 4, 5, 6), array(1, 2, 3, 4, 1, 6), array(1, 2, 3, 4, 5, 1)), 1)\n// array(array(0, 0), array(1, 4), array(1, 0), array(2, 5), array(2, 0))\n// >>> get_row(array(), 1)\n// array()\n// >>> get_row(array(array(), array(1), array(1, 2, 3)), 3)\n// array(array(2, 2))\nfunction get_row($lst, $x) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return get_row(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(array(1, 2, 3, 4, 5, 6), array(1, 2, 3, 4, 1, 6), array(1, 2, 3, 4, 5, 1)), 1) !== array(array(0, 0), array(1, 4), array(1, 0), array(2, 5), array(2, 0))) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(1, 2, 3, 4, 5, 6), array(1, 2, 3, 4, 5, 6), array(1, 2, 3, 4, 5, 6), array(1, 2, 3, 4, 5, 6), array(1, 2, 3, 4, 5, 6), array(1, 2, 3, 4, 5, 6)), 2) !== array(array(0, 1), array(1, 1), array(2, 1), array(3, 1), array(4, 1), array(5, 1))) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(1, 2, 3, 4, 5, 6), array(1, 2, 3, 4, 5, 6), array(1, 1, 3, 4, 5, 6), array(1, 2, 1, 4, 5, 6), array(1, 2, 3, 1, 5, 6), array(1, 2, 3, 4, 1, 6), array(1, 2, 3, 4, 5, 1)), 1) !== array(array(0, 0), array(1, 0), array(2, 1), array(2, 0), array(3, 2), array(3, 0), array(4, 3), array(4, 0), array(5, 4), array(5, 0), array(6, 5), array(6, 0))) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(), 1) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(1)), 2) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(), array(1), array(1, 2, 3)), 3) !== array(array(2, 2))) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "php", - "prompt": ">> eat(5, 6, 10)\n// array(11, 4)\n// >>> eat(4, 8, 9)\n// array(12, 1)\n// >>> eat(1, 10, 10)\n// array(11, 0)\n// >>> eat(2, 11, 5)\n// array(7, 0)\n// Variables:\n// @number : integer\n// the number of carrots that you have eaten.\n// @need : integer\n// the number of carrots that you need to eat.\n// @remaining : integer\n// the number of remaining carrots thet exist in stock\n// Constrain:\n// * 0 <= number <= 1000\n// * 0 <= need <= 1000\n// * 0 <= remaining <= 1000\n// Have fun :)\nfunction eat($number, $need, $remaining) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return eat(...$args);\n}\n\nfunction test(): void {\n if (candidate(5, 6, 10) !== array(11, 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(4, 8, 9) !== array(12, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(1, 10, 10) !== array(11, 0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(2, 11, 5) !== array(7, 0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(4, 5, 7) !== array(9, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(4, 5, 1) !== array(5, 0)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "php", - "prompt": ">> solve(1000)\n// \"1\"\n// >>> solve(150)\n// \"110\"\n// >>> solve(147)\n// \"1100\"\n// Variables:\n// @N integer\n// Constraints: 0 \u2264 N \u2264 10000.\n// Output:\n// a string of binary number\nfunction solve($N) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return solve(...$args);\n}\n\nfunction test(): void {\n if (candidate(1000) !== \"1\") { throw new Exception(\"Test failed!\"); }\n if (candidate(150) !== \"110\") { throw new Exception(\"Test failed!\"); }\n if (candidate(147) !== \"1100\") { throw new Exception(\"Test failed!\"); }\n if (candidate(333) !== \"1001\") { throw new Exception(\"Test failed!\"); }\n if (candidate(963) !== \"10010\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "php", - "prompt": ">> skjkasdkd(array(0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3))\n// 10\n// >>> skjkasdkd(array(1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1))\n// 25\n// >>> skjkasdkd(array(1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3))\n// 13\n// >>> skjkasdkd(array(0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6))\n// 11\n// >>> skjkasdkd(array(0, 81, 12, 3, 1, 21))\n// 3\n// >>> skjkasdkd(array(0, 8, 1, 2, 1, 7))\n// 7\nfunction skjkasdkd($lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return skjkasdkd(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3)) !== 10) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1)) !== 25) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3)) !== 13) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6)) !== 11) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0, 81, 12, 3, 1, 21)) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0, 8, 1, 2, 1, 7)) !== 7) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(8191)) !== 19) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(8191, 123456, 127, 7)) !== 19) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(127, 97, 8192)) !== 10) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "php", - "prompt": ">> smallest_change(array(1, 2, 3, 5, 4, 7, 9, 6))\n// 4\n// >>> smallest_change(array(1, 2, 3, 4, 3, 2, 2))\n// 1\n// >>> smallest_change(array(1, 2, 3, 2, 1))\n// 0\nfunction smallest_change($arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return smallest_change(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2, 3, 5, 4, 7, 9, 6)) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4, 3, 2, 2)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 4, 2)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 4, 4, 2)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 2, 1)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 1, 1, 3)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0, 1)) !== 1) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "php", - "prompt": " 3.7 A \n// > 3.3 A- \n// > 3.0 B+\n// > 2.7 B \n// > 2.3 B-\n// > 2.0 C+\n// > 1.7 C\n// > 1.3 C-\n// > 1.0 D+ \n// > 0.7 D \n// > 0.0 D-\n// 0.0 E\n// Example:\n// >>> grade_equation(array(4.0, 3, 1.7, 2, 3.5))\n// array(\"A+\", \"B\", \"C-\", \"C\", \"A-\")\nfunction numerical_letter_grade($grades) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return numerical_letter_grade(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(4.0, 3, 1.7, 2, 3.5)) !== array(\"A+\", \"B\", \"C-\", \"C\", \"A-\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.2)) !== array(\"D+\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0.5)) !== array(\"D-\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0.0)) !== array(\"E\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 0.3, 1.5, 2.8, 3.3)) !== array(\"D\", \"D-\", \"C-\", \"B\", \"B+\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0.0, 0.7)) !== array(\"E\", \"D-\")) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "php", - "prompt": ">> triangle_area(3, 4, 5)\n// 6.0\n// >>> triangle_area(1, 2, 10)\n// -1\nfunction triangle_area($a, $b, $c) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return triangle_area(...$args);\n}\n\nfunction test(): void {\n if (candidate(3, 4, 5) !== 6.0) { throw new Exception(\"Test failed!\"); }\n if (candidate(1, 2, 10) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(4, 8, 5) !== 8.18) { throw new Exception(\"Test failed!\"); }\n if (candidate(2, 2, 2) !== 1.73) { throw new Exception(\"Test failed!\"); }\n if (candidate(1, 2, 3) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(10, 5, 7) !== 16.25) { throw new Exception(\"Test failed!\"); }\n if (candidate(2, 6, 3) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(1, 1, 1) !== 0.43) { throw new Exception(\"Test failed!\"); }\n if (candidate(2, 2, 10) !== -1) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "php", - "prompt": ">> same_chars(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\")\n// true\n// >>> same_chars(\"abcd\", \"dddddddabc\")\n// true\n// >>> same_chars(\"dddddddabc\", \"abcd\")\n// true\n// >>> same_chars(\"eabcd\", \"dddddddabc\")\n// false\n// >>> same_chars(\"abcd\", \"dddddddabce\")\n// false\n// >>> same_chars(\"eabcdzzzz\", \"dddzzzzzzzddddabc\")\n// false\nfunction same_chars($s0, $s1) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return same_chars(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcd\", \"dddddddabc\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"dddddddabc\", \"abcd\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"eabcd\", \"dddddddabc\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcd\", \"dddddddabcf\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"eabcdzzzz\", \"dddzzzzzzzddddabc\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"aabb\", \"aaccc\") !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "php", - "prompt": ">> minSubArraySum(array(2, 3, 4, 1, 2, 4))\n// 1\n// >>> minSubArraySum(array(-1, -2, -3))\n// -6\nfunction minSubArraySum($nums) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return minSubArraySum(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(2, 3, 4, 1, 2, 4)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, -2, -3)) !== -6) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, -2, -3, 2, -10)) !== -14) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-9999999999999999)) !== -9999999999999999) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0, 10, 20, 1000000)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, -2, -3, 10, -5)) !== -6) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(100, -1, -2, -3, 10, -5)) !== -6) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(10, 11, 13, 8, 3, 4)) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(100, -33, 32, -1, 0, -2)) !== -33) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-10)) !== -10) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(7)) !== 7) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, -1)) !== -1) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "php", - "prompt": ">> select_words(\"Mary had a little lamb\", 4)\n// array(\"little\")\n// >>> select_words(\"Mary had a little lamb\", 3)\n// array(\"Mary\", \"lamb\")\n// >>> select_words(\"simple white space\", 2)\n// array()\n// >>> select_words(\"Hello world\", 4)\n// array(\"world\")\n// >>> select_words(\"Uncle sam\", 3)\n// array(\"Uncle\")\nfunction select_words($s, $n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return select_words(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"Mary had a little lamb\", 4) !== array(\"little\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Mary had a little lamb\", 3) !== array(\"Mary\", \"lamb\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"simple white space\", 2) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Hello world\", 4) !== array(\"world\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Uncle sam\", 3) !== array(\"Uncle\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"\", 4) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"a b c d e f\", 1) !== array(\"b\", \"c\", \"d\", \"f\")) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "php", - "prompt": ">> all_prefixes(\"abc\")\n// array(\"a\", \"ab\", \"abc\")\nfunction all_prefixes($string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return all_prefixes(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\") !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"asdfgh\") !== array(\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"WWW\") !== array(\"W\", \"WW\", \"WWW\")) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "php", - "prompt": ">> closest_integer(\"10\")\n// 10\n// >>> closest_integer(\"15.3\")\n// 15\n// Note:\n// Rounding away from zero means that if the given number is equidistant\n// from two integers, the one you should return is the one that is the\n// farthest from zero. For example closest_integer(\"14.5\") should\n// return 15 and closest_integer(\"-14.5\") should return -15.\nfunction closest_integer($value) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return closest_integer(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"10\") !== 10) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"14.5\") !== 15) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"-15.5\") !== -16) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"15.3\") !== 15) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"0\") !== 0) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "php", - "prompt": ">> file_name_check(\"example.txt\")\n// \"Yes\"\n// >>> file_name_check(\"1example.dll\")\n// \"No\"\nfunction file_name_check($file_name) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return file_name_check(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"example.txt\") !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1example.dll\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"s1sdf3.asd\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"K.dll\") !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"MY16FILE3.exe\") !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"His12FILE94.exe\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"_Y.txt\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"?aREYA.exe\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"/this_is_valid.dll\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"this_is_valid.wow\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"this_is_valid.txt\") !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"this_is_valid.txtexe\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"#this2_i4s_5valid.ten\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"@this1_is6_valid.exe\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"this_is_12valid.6exe4.txt\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"all.exe.txt\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"I563_No.exe\") !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Is3youfault.txt\") !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"no_one#knows.dll\") !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1I563_Yes3.exe\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"I563_Yes3.txtt\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"final..txt\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"final132\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"_f4indsartal132.\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\".txt\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"s.\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "php", - "prompt": ">> intersection(array(1, 2), array(2, 3))\n// \"NO\"\n// >>> intersection(array(-1, 1), array(0, 4))\n// \"NO\"\n// >>> intersection(array(-3, -1), array(-5, 5))\n// \"YES\"\nfunction intersection($interval1, $interval2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return intersection(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2), array(2, 3)) !== \"NO\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, 1), array(0, 4)) !== \"NO\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-3, -1), array(-5, 5)) !== \"YES\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-2, 2), array(-4, 0)) !== \"YES\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-11, 2), array(-1, -1)) !== \"NO\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2), array(3, 5)) !== \"NO\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2), array(1, 2)) !== \"NO\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-2, -2), array(-3, -2)) !== \"NO\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "php", - "prompt": " 1 and is not a prime.\n// >>> largest_prime_factor(13195)\n// 29\n// >>> largest_prime_factor(2048)\n// 2\nfunction largest_prime_factor($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return largest_prime_factor(...$args);\n}\n\nfunction test(): void {\n if (candidate(15) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(27) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(63) !== 7) { throw new Exception(\"Test failed!\"); }\n if (candidate(330) !== 11) { throw new Exception(\"Test failed!\"); }\n if (candidate(13195) !== 29) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "php", - "prompt": ">> count_distinct_characters(\"xyzXYZ\")\n// 3\n// >>> count_distinct_characters(\"Jerry\")\n// 4\nfunction count_distinct_characters($string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return count_distinct_characters(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\") !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcde\") !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcdecadeCADE\") !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"aaaaAAAAaaaa\") !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Jerry jERRY JeRRRY\") !== 5) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "php", - "prompt": ">> below_zero(array(1, 2, 3))\n// false\n// >>> below_zero(array(1, 2, -4, 5))\n// true\nfunction below_zero($operations) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return below_zero(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, -3, 1, 2, -3)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, -4, 5, 6)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, -1, 2, -2, 5, -5, 4, -4)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, -1, 2, -2, 5, -5, 4, -5)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, -2, 2, -2, 5, -5, 4, -4)) !== true) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "php", - "prompt": ">> make_palindrome(\"\")\n// \"\"\n// >>> make_palindrome(\"cat\")\n// \"catac\"\n// >>> make_palindrome(\"cata\")\n// \"catac\"\nfunction make_palindrome($string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return make_palindrome(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"x\") !== \"x\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"xyz\") !== \"xyzyx\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"xyx\") !== \"xyx\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"jerry\") !== \"jerryrrej\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "php", - "prompt": ">> int_to_mini_roman(19)\n// \"xix\"\n// >>> int_to_mini_roman(152)\n// \"clii\"\n// >>> int_to_mini_roman(426)\n// \"cdxxvi\"\nfunction int_to_mini_roman($number) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "reworded", - "tests": "function candidate(...$args) {\n return int_to_mini_roman(...$args);\n}\n\nfunction test(): void {\n if (candidate(19) !== \"xix\") { throw new Exception(\"Test failed!\"); }\n if (candidate(152) !== \"clii\") { throw new Exception(\"Test failed!\"); }\n if (candidate(251) !== \"ccli\") { throw new Exception(\"Test failed!\"); }\n if (candidate(426) !== \"cdxxvi\") { throw new Exception(\"Test failed!\"); }\n if (candidate(500) !== \"d\") { throw new Exception(\"Test failed!\"); }\n if (candidate(1) !== \"i\") { throw new Exception(\"Test failed!\"); }\n if (candidate(4) !== \"iv\") { throw new Exception(\"Test failed!\"); }\n if (candidate(43) !== \"xliii\") { throw new Exception(\"Test failed!\"); }\n if (candidate(90) !== \"xc\") { throw new Exception(\"Test failed!\"); }\n if (candidate(94) !== \"xciv\") { throw new Exception(\"Test failed!\"); }\n if (candidate(532) !== \"dxxxii\") { throw new Exception(\"Test failed!\"); }\n if (candidate(900) !== \"cm\") { throw new Exception(\"Test failed!\"); }\n if (candidate(994) !== \"cmxciv\") { throw new Exception(\"Test failed!\"); }\n if (candidate(1000) !== \"m\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - } -] \ No newline at end of file diff --git a/data/php-transform.json b/data/php-transform.json deleted file mode 100644 index 826cda5b74abd0500f65c7f36b095d23dd6f0c15..0000000000000000000000000000000000000000 --- a/data/php-transform.json +++ /dev/null @@ -1,2417 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "php", - "prompt": ">> largest_divisor(15)\n// 5\nfunction largest_divisor($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return largest_divisor(...$args);\n}\n\nfunction test(): void {\n if (candidate(3) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(7) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(10) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(100) !== 50) { throw new Exception(\"Test failed!\"); }\n if (candidate(49) !== 7) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_47_median", - "language": "php", - "prompt": ">> median(array(3, 1, 2, 4, 5))\n// 3\n// >>> median(array(-10, 4, 6, 1000, 10, 20))\n// 15.0\nfunction median($l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return median(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(3, 1, 2, 4, 5)) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-10, 4, 6, 1000, 10, 20)) !== 8.0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5)) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(6, 5)) !== 5.5) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(8, 1, 3, 9, 9, 2, 7)) !== 7) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "php", - "prompt": " result = 9\n// Note:\n// The length of operator list is equal to the length of operand list minus one.\n// Operand is a list of of non-negative integers.\n// Operator list has at least one operator, and operand list has at least two operands.\nfunction do_algebra($operator, $operand) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return do_algebra(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(\"**\", \"*\", \"+\"), array(2, 3, 4, 5)) !== 37) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"+\", \"*\", \"-\"), array(2, 3, 4, 5)) !== 9) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"//\", \"*\"), array(7, 3, 4)) !== 8) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "php", - "prompt": ">> max_element(array(1, 2, 3))\n// 3\n// >>> max_element(array(5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10))\n// 123\nfunction max_element($l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return max_element(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2, 3)) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10)) !== 124) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "php", - "prompt": ">> can_arrange(array(1, 2, 4, 3, 5))\n// 3\n// >>> can_arrange(array(1, 2, 3))\n// -1\nfunction can_arrange($arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return can_arrange(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2, 4, 3, 5)) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 4, 5)) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 4, 2, 5, 6, 7, 8, 9, 10)) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 8, 5, 7, 3)) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== -1) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "php", - "prompt": ">> check_if_last_char_is_a_letter(\"apple pie\")\n// false\n// >>> check_if_last_char_is_a_letter(\"apple pi e\")\n// true\n// >>> check_if_last_char_is_a_letter(\"apple pi e \")\n// false\n// >>> check_if_last_char_is_a_letter(\"\")\n// false\nfunction check_if_last_char_is_a_letter($txt) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return check_if_last_char_is_a_letter(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"apple\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"apple pi e\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"eeeee\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"A\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Pumpkin pie \") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Pumpkin pie 1\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"eeeee e \") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"apple pie\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"apple pi e \") !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "php", - "prompt": ">> is_prime(6)\n// false\n// >>> is_prime(101)\n// true\n// >>> is_prime(11)\n// true\n// >>> is_prime(13441)\n// true\n// >>> is_prime(61)\n// true\n// >>> is_prime(4)\n// false\n// >>> is_prime(1)\n// false\nfunction is_prime($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return is_prime(...$args);\n}\n\nfunction test(): void {\n if (candidate(6) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(101) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(11) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(13441) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(61) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(4) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(1) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(5) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(11) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(17) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(85) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(77) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(255379) !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "php", - "prompt": ">> unique_digits(array(15, 33, 1422, 1))\n// array(1, 15, 33)\n// >>> unique_digits(array(152, 323, 1422, 10))\n// array()\nfunction unique_digits($x) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return unique_digits(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(15, 33, 1422, 1)) !== array(1, 15, 33)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(152, 323, 1422, 10)) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(12345, 2033, 111, 151)) !== array(111, 151)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(135, 103, 31)) !== array(31, 135)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "php", - "prompt": ">> string_xor(\"010\", \"110\")\n// \"100\"\nfunction string_xor($a, $b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return string_xor(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"111000\", \"101010\") !== \"010010\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1\", \"1\") !== \"0\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"0101\", \"0000\") !== \"0101\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "php", - "prompt": ">> sum_to_n(30)\n// 465\n// >>> sum_to_n(100)\n// 5050\n// >>> sum_to_n(5)\n// 15\n// >>> sum_to_n(10)\n// 55\n// >>> sum_to_n(1)\n// 1\nfunction sum_to_n($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return sum_to_n(...$args);\n}\n\nfunction test(): void {\n if (candidate(1) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(6) !== 21) { throw new Exception(\"Test failed!\"); }\n if (candidate(11) !== 66) { throw new Exception(\"Test failed!\"); }\n if (candidate(30) !== 465) { throw new Exception(\"Test failed!\"); }\n if (candidate(100) !== 5050) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "php", - "prompt": ">> double_the_difference(array(1, 3, 2, 0))\n// 10\n// >>> double_the_difference(array(-1, -2, 0))\n// 0\n// >>> double_the_difference(array(9, -2))\n// 81\n// >>> double_the_difference(array(0))\n// 0\n// If the input list is empty, return 0.\nfunction double_the_difference($lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return double_the_difference(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5.0, 4.0)) !== 25) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0.1, 0.2, 0.3)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-10.0, -20.0, -30.0)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1.0, -2.0, 8.0)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0.2, 3.0, 5.0)) !== 34) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0)) !== 165) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "php", - "prompt": ">> strlen(\"\")\n// 0\n// >>> strlen(\"abc\")\n// 3\nfunction strlen($string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return strlen(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\") !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"x\") !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"asdasnakj\") !== 9) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "php", - "prompt": ">> is_bored(\"Hello world\")\n// 0\n// >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n// 1\nfunction is_bored($S) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return is_bored(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"Hello world\") !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Is the sky blue?\") !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"I love It !\") !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"bIt\") !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"I feel good today. I will be productive. will kill It\") !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"You and I are going for a walk\") !== 0) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "php", - "prompt": ">> vowels_count(\"abcde\")\n// 2\n// >>> vowels_count(\"ACEDY\")\n// 3\nfunction vowels_count($s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return vowels_count(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"abcde\") !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Alone\") !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"key\") !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"bye\") !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"keY\") !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"bYe\") !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"ACEDY\") !== 3) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "php", - "prompt": ">> fib(10)\n// 55\n// >>> fib(1)\n// 1\n// >>> fib(8)\n// 21\nfunction fib($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return fib(...$args);\n}\n\nfunction test(): void {\n if (candidate(10) !== 55) { throw new Exception(\"Test failed!\"); }\n if (candidate(1) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(8) !== 21) { throw new Exception(\"Test failed!\"); }\n if (candidate(11) !== 89) { throw new Exception(\"Test failed!\"); }\n if (candidate(12) !== 144) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "php", - "prompt": "/ where both numerator and denominator are positive whole numbers.\n// You can assume that x, and n are valid fractions, and do not have zero as denominator.\n// >>> simplify(\"1/5\", \"5/1\")\n// true\n// >>> simplify(\"1/6\", \"2/1\")\n// false\n// >>> simplify(\"7/10\", \"10/2\")\n// false\nfunction simplify($x, $n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return simplify(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"1/5\", \"5/1\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1/6\", \"2/1\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"5/1\", \"3/1\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"7/10\", \"10/2\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"2/10\", \"50/10\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"7/2\", \"4/2\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"11/6\", \"6/1\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"2/3\", \"5/2\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"5/2\", \"3/5\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"2/4\", \"8/4\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"2/4\", \"4/2\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1/5\", \"5/1\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1/5\", \"1/5\") !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "php", - "prompt": ">> count_upper(\"aBCdEf\")\n// 1\n// >>> count_upper(\"abcdefg\")\n// 0\n// >>> count_upper(\"dBBE\")\n// 0\nfunction count_upper($s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return count_upper(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"aBCdEf\") !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcdefg\") !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"dBBE\") !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"B\") !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"U\") !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"\") !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"EEEE\") !== 2) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "php", - "prompt": ">> max_fill(array(array(0, 0, 1, 0), array(0, 1, 0, 0), array(1, 1, 1, 1)), 1)\n// 6\n// Example 2:\n// >>> max_fill(array(array(0, 0, 1, 1), array(0, 0, 0, 0), array(1, 1, 1, 1), array(0, 1, 1, 1)), 2)\n// 5\n// Example 3:\n// >>> max_fill(array(array(0, 0, 0), array(0, 0, 0)), 5)\n// 0\n// Constraints:\n// * all wells have the same length\n// * 1 <= grid.length <= 10^2\n// * 1 <= grid[:,1].length <= 10^2\n// * grid[i][j] -> 0 | 1\n// * 1 <= capacity <= 10\nfunction max_fill($grid, $capacity) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return max_fill(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(array(0, 0, 1, 0), array(0, 1, 0, 0), array(1, 1, 1, 1)), 1) !== 6) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(0, 0, 1, 1), array(0, 0, 0, 0), array(1, 1, 1, 1), array(0, 1, 1, 1)), 2) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(0, 0, 0), array(0, 0, 0)), 5) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(1, 1, 1, 1), array(1, 1, 1, 1)), 2) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(1, 1, 1, 1), array(1, 1, 1, 1)), 9) !== 2) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "php", - "prompt": ">> maximum(array(-3, -4, 5), 3)\n// array(-4, -3, 5)\n// Example 2:\n// >>> maximum(array(4, -4, 4), 2)\n// array(4, 4)\n// Example 3:\n// >>> maximum(array(-3, 2, 1, 2, -1, -2, 1), 1)\n// array(2)\n// Note:\n// 1. The length of the array will be in the range of [1, 1000].\n// 2. The elements in the array will be in the range of [-1000, 1000].\n// 3. 0 <= k <= len(arr)\nfunction maximum($arr, $k) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return maximum(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(-3, -4, 5), 3) !== array(-4, -3, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, -4, 4), 2) !== array(4, 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-3, 2, 1, 2, -1, -2, 1), 1) !== array(2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(123, -123, 20, 0, 1, 2, -3), 3) !== array(2, 20, 123)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-123, 20, 0, 1, 2, -3), 4) !== array(0, 1, 2, 20)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 15, 0, 3, -13, -8, 0), 7) !== array(-13, -8, 0, 0, 3, 5, 15)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, 0, 2, 5, 3, -10), 2) !== array(3, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 0, 5, -7), 1) !== array(5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, -4), 2) !== array(-4, 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-10, 10), 2) !== array(-10, 10)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, -23, 243, -400, 0), 0) !== array()) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "php", - "prompt": ">> encode(\"test\")\n// \"TGST\"\n// >>> encode(\"This is a message\")\n// \"tHKS KS C MGSSCGG\"\nfunction encode($message) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return encode(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"TEST\") !== \"tgst\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Mudasir\") !== \"mWDCSKR\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"YES\") !== \"ygs\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"This is a message\") !== \"tHKS KS C MGSSCGG\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"I DoNt KnOw WhAt tO WrItE\") !== \"k dQnT kNqW wHcT Tq wRkTg\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "php", - "prompt": ">> remove_vowels(\"\")\n// \"\"\n// >>> remove_vowels(\"abcdef\")\n// \"bcdf\"\n// >>> remove_vowels(\"aaaaa\")\n// \"\"\n// >>> remove_vowels(\"aaBAA\")\n// \"B\"\n// >>> remove_vowels(\"zbcd\")\n// \"zbcd\"\nfunction remove_vowels($text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return remove_vowels(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcdef\\nghijklm\") !== \"bcdf\\nghjklm\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"fedcba\") !== \"fdcb\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"eeeee\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"acBAA\") !== \"cB\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"EcBOO\") !== \"cB\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"ybcd\") !== \"ybcd\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "php", - "prompt": ">> get_positive(array(-1, 2, -4, 5, 6))\n// array(2, 5, 6)\n// >>> get_positive(array(5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10))\n// array(5, 3, 2, 3, 9, 123, 1)\nfunction get_positive($l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return get_positive(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(-1, -2, 4, 5, 6)) !== array(4, 5, 6)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10)) !== array(5, 3, 2, 3, 3, 9, 123, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, -2)) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== array()) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "php", - "prompt": ">> string_sequence(0)\n// \"0\"\n// >>> string_sequence(5)\n// \"0 1 2 3 4 5\"\nfunction string_sequence($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return string_sequence(...$args);\n}\n\nfunction test(): void {\n if (candidate(0) !== \"0\") { throw new Exception(\"Test failed!\"); }\n if (candidate(3) !== \"0 1 2 3\") { throw new Exception(\"Test failed!\"); }\n if (candidate(10) !== \"0 1 2 3 4 5 6 7 8 9 10\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "php", - "prompt": ">> make_a_pile(3)\n// array(3, 5, 7)\nfunction make_a_pile($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return make_a_pile(...$args);\n}\n\nfunction test(): void {\n if (candidate(3) !== array(3, 5, 7)) { throw new Exception(\"Test failed!\"); }\n if (candidate(4) !== array(4, 6, 8, 10)) { throw new Exception(\"Test failed!\"); }\n if (candidate(5) !== array(5, 7, 9, 11, 13)) { throw new Exception(\"Test failed!\"); }\n if (candidate(6) !== array(6, 8, 10, 12, 14, 16)) { throw new Exception(\"Test failed!\"); }\n if (candidate(8) !== array(8, 10, 12, 14, 16, 18, 20, 22)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "php", - "prompt": ">> reverse_delete(\"abcde\", \"ae\")\n// array(\"bcd\", false)\n// >>> reverse_delete(\"abcdef\", \"b\")\n// array(\"acdef\", false)\n// >>> reverse_delete(\"abcdedcba\", \"ab\")\n// array(\"cdedc\", true)\nfunction reverse_delete($s, $c) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return reverse_delete(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"abcde\", \"ae\") !== array(\"bcd\", false)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcdef\", \"b\") !== array(\"acdef\", false)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcdedcba\", \"ab\") !== array(\"cdedc\", true)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"dwik\", \"w\") !== array(\"dik\", false)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"a\", \"a\") !== array(\"\", true)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcdedcba\", \"\") !== array(\"abcdedcba\", true)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcdedcba\", \"v\") !== array(\"abcdedcba\", true)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"vabba\", \"v\") !== array(\"abba\", true)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"mamma\", \"mia\") !== array(\"\", true)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "php", - "prompt": ">> flip_case(\"Hello\")\n// \"hELLO\"\nfunction flip_case($string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return flip_case(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Hello!\") !== \"hELLO!\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"These violent delights have violent ends\") !== \"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "php", - "prompt": ">> solve(\"1234\")\n// \"4321\"\n// >>> solve(\"ab\")\n// \"AB\"\n// >>> solve(\"#a@C\")\n// \"#A@c\"\nfunction solve($s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return solve(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"AsDf\") !== \"aSdF\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1234\") !== \"4321\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"ab\") !== \"AB\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"#a@C\") !== \"#A@c\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"#AsdfW^45\") !== \"#aSDFw^45\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"#6@2\") !== \"2@6#\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"#$a^D\") !== \"#$A^d\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"#ccc\") !== \"#CCC\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "php", - "prompt": ">> filter_by_prefix(array(), \"a\")\n// array()\n// >>> filter_by_prefix(array(\"abc\", \"bcd\", \"cde\", \"array\"), \"a\")\n// array(\"abc\", \"array\")\nfunction filter_by_prefix($strings, $prefix) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return filter_by_prefix(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(), \"john\") !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"), \"xxx\") !== array(\"xxx\", \"xxxAAA\", \"xxx\")) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "php", - "prompt": ">> choose_num(12, 15)\n// 14\n// >>> choose_num(13, 12)\n// -1\nfunction choose_num($x, $y) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return choose_num(...$args);\n}\n\nfunction test(): void {\n if (candidate(12, 15) !== 14) { throw new Exception(\"Test failed!\"); }\n if (candidate(13, 12) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(33, 12354) !== 12354) { throw new Exception(\"Test failed!\"); }\n if (candidate(5234, 5233) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(6, 29) !== 28) { throw new Exception(\"Test failed!\"); }\n if (candidate(27, 10) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(7, 7) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(546, 546) !== 546) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "php", - "prompt": ">> words_in_sentence(\"This is a test\")\n// \"is\"\n// Example 2:\n// >>> words_in_sentence(\"lets go for swimming\")\n// \"go for\"\n// Constraints:\n// * 1 <= len(sentence) <= 100\n// * sentence contains only letters\nfunction words_in_sentence($sentence) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return words_in_sentence(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"This is a test\") !== \"is\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"lets go for swimming\") !== \"go for\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"there is no place available here\") !== \"there is no place\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Hi I am Hussein\") !== \"Hi am Hussein\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"go for it\") !== \"go for it\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"here\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"here is\") !== \"is\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "php", - "prompt": ">> intersperse(array(), 4)\n// array()\n// >>> intersperse(array(1, 2, 3), 4)\n// array(1, 4, 2, 4, 3)\nfunction intersperse($numbers, $delimeter) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return intersperse(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(), 7) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 6, 3, 2), 8) !== array(5, 8, 6, 8, 3, 8, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 2, 2), 2) !== array(2, 2, 2, 2, 2)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "php", - "prompt": ">> is_simple_power(1, 4)\n// true\n// >>> is_simple_power(2, 2)\n// true\n// >>> is_simple_power(8, 2)\n// true\n// >>> is_simple_power(3, 2)\n// false\n// >>> is_simple_power(3, 1)\n// false\n// >>> is_simple_power(5, 3)\n// false\nfunction is_simple_power($x, $n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return is_simple_power(...$args);\n}\n\nfunction test(): void {\n if (candidate(16, 2) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(143214, 16) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(4, 2) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(9, 3) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(16, 4) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(24, 2) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(128, 4) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(12, 6) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(1, 1) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(1, 12) !== true) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "php", - "prompt": ">> is_multiply_prime(30)\n// true\n// 30 = 2 * 3 * 5\nfunction is_multiply_prime($a) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return is_multiply_prime(...$args);\n}\n\nfunction test(): void {\n if (candidate(5) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(30) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(8) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(10) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(125) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(105) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(126) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(729) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(891) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(1001) !== true) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "php", - "prompt": ">> right_angle_triangle(3, 4, 5)\n// true\n// >>> right_angle_triangle(1, 2, 3)\n// false\nfunction right_angle_triangle($a, $b, $c) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return right_angle_triangle(...$args);\n}\n\nfunction test(): void {\n if (candidate(3, 4, 5) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(1, 2, 3) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(10, 6, 8) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(2, 2, 2) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(7, 24, 25) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(10, 5, 7) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(5, 12, 13) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(15, 8, 17) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(48, 55, 73) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(1, 1, 1) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(2, 2, 10) !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "php", - "prompt": ">> any_int(5, 2, 7)\n// true\n// >>> any_int(3, 2, 2)\n// false\n// >>> any_int(3, -2, 1)\n// true\n// >>> any_int(3.6, -2.2, 2)\n// false\nfunction any_int($x, $y, $z) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return any_int(...$args);\n}\n\nfunction test(): void {\n if (candidate(2, 3, 1) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(2.5, 2, 3) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(1.5, 5, 3.5) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(2, 6, 2) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(4, 2, 2) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(2.2, 2.2, 2.2) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(-4, 6, 2) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(2, 1, 1) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(3, 4, 7) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(3.0, 4, 7) !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "php", - "prompt": ">> sort_third(array(1, 2, 3))\n// array(1, 2, 3)\n// >>> sort_third(array(5, 6, 3, 4, 8, 9, 2))\n// array(2, 6, 3, 4, 8, 9, 5)\nfunction sort_third($l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return sort_third(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(5, 6, 3, 4, 8, 9, 2)) !== array(2, 6, 3, 4, 8, 9, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 8, 3, 4, 6, 9, 2)) !== array(2, 8, 3, 4, 6, 9, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 6, 9, 4, 8, 3, 2)) !== array(2, 6, 9, 4, 8, 3, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 6, 3, 4, 8, 9, 2, 1)) !== array(2, 6, 3, 4, 8, 9, 5, 1)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_53_add", - "language": "php", - "prompt": ">> add(2, 3)\n// 5\n// >>> add(5, 7)\n// 12\nfunction add($x, $y) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return add(...$args);\n}\n\nfunction test(): void {\n if (candidate(0, 1) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(1, 0) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(2, 3) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(5, 7) !== 12) { throw new Exception(\"Test failed!\"); }\n if (candidate(7, 5) !== 12) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_69_search", - "language": "php", - "prompt": ">> search(array(4, 1, 2, 2, 3, 1))\n// 2\n// >>> search(array(1, 2, 2, 3, 3, 3, 4, 4, 4))\n// 3\n// >>> search(array(5, 5, 4, 4, 4))\n// -1\nfunction search($lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return search(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(5, 5, 5, 5, 1)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 1, 4, 1, 4, 4)) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 3)) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(8, 8, 8, 8, 8, 8, 8, 8)) !== 8) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 3, 3, 2, 2)) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 2, 8, 2)) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(8, 8, 3, 6, 5, 6, 4)) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 9, 10, 1, 3)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10)) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5)) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10)) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4)) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7)) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1)) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8)) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(10)) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2)) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 10, 10, 9, 2)) !== -1) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "php", - "prompt": ">> prime_length(\"Hello\")\n// true\n// >>> prime_length(\"abcdcba\")\n// true\n// >>> prime_length(\"kittens\")\n// true\n// >>> prime_length(\"orange\")\n// false\nfunction prime_length($string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return prime_length(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"Hello\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcdcba\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"kittens\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"orange\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"wow\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"world\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"MadaM\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Wow\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"HI\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"go\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"gogo\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"aaaaaaaaaaaaaaa\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Madam\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"M\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"0\") !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_58_common", - "language": "php", - "prompt": ">> common(array(1, 4, 3, 34, 653, 2, 5), array(5, 7, 1, 5, 9, 653, 121))\n// array(1, 5, 653)\n// >>> common(array(5, 3, 2, 8), array(3, 2))\n// array(2, 3)\nfunction common($l1, $l2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return common(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 4, 3, 34, 653, 2, 5), array(5, 7, 1, 5, 9, 653, 121)) !== array(1, 5, 653)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 3, 2, 8), array(3, 2)) !== array(2, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 3, 2, 8), array(3, 2, 4)) !== array(2, 3, 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 3, 2, 8), array()) !== array()) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "php", - "prompt": " 0\n// For example:\n// >>> special_factorial(4)\n// 288\n// The function will receive an integer as input and should return the special\n// factorial of this integer.\nfunction special_factorial($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return special_factorial(...$args);\n}\n\nfunction test(): void {\n if (candidate(4) !== 288) { throw new Exception(\"Test failed!\"); }\n if (candidate(5) !== 34560) { throw new Exception(\"Test failed!\"); }\n if (candidate(7) !== 125411328000) { throw new Exception(\"Test failed!\"); }\n if (candidate(1) !== 1) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "php", - "prompt": ">> exchange(array(1, 2, 3, 4), array(1, 2, 3, 4))\n// \"YES\"\n// >>> exchange(array(1, 2, 3, 4), array(1, 5, 3, 4))\n// \"NO\"\n// It is assumed that the input lists will be non-empty.\nfunction exchange($lst1, $lst2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return exchange(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2, 3, 4), array(1, 2, 3, 4)) !== \"YES\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4), array(1, 5, 3, 4)) !== \"NO\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4), array(2, 1, 4, 3)) !== \"YES\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 7, 3), array(2, 6, 4)) !== \"YES\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 7, 3), array(2, 6, 3)) !== \"NO\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 2, 6, 1, 8, 9), array(3, 5, 5, 1, 1, 1)) !== \"NO\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(100, 200), array(200, 200)) !== \"YES\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "php", - "prompt": ">> add_elements(array(111, 21, 3, 4000, 5, 6, 7, 8, 9), 4)\n// 24\n// Constraints:\n// 1. 1 <= len(arr) <= 100\n// 2. 1 <= k <= len(arr)\nfunction add_elements($arr, $k) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return add_elements(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, -2, -3, 41, 57, 76, 87, 88, 99), 3) !== -4) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(111, 121, 3, 4000, 5, 6), 2) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(11, 21, 3, 90, 5, 6, 7, 8, 9), 4) !== 125) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(111, 21, 3, 4000, 5, 6, 7, 8, 9), 4) !== 24) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1), 1) !== 1) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "php", - "prompt": ">> x_or_y(7, 34, 12)\n// 34\n// >>> x_or_y(15, 8, 5)\n// 5\nfunction x_or_y($n, $x, $y) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return x_or_y(...$args);\n}\n\nfunction test(): void {\n if (candidate(7, 34, 12) !== 34) { throw new Exception(\"Test failed!\"); }\n if (candidate(15, 8, 5) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(3, 33, 5212) !== 33) { throw new Exception(\"Test failed!\"); }\n if (candidate(1259, 3, 52) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(7919, -1, 12) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(3609, 1245, 583) !== 583) { throw new Exception(\"Test failed!\"); }\n if (candidate(91, 56, 129) !== 129) { throw new Exception(\"Test failed!\"); }\n if (candidate(6, 34, 1234) !== 1234) { throw new Exception(\"Test failed!\"); }\n if (candidate(1, 2, 0) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(2, 2, 0) !== 2) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "php", - "prompt": ">> triangle_area(5, 3)\n// 7.5\nfunction triangle_area($a, $h) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return triangle_area(...$args);\n}\n\nfunction test(): void {\n if (candidate(5, 3) !== 7.5) { throw new Exception(\"Test failed!\"); }\n if (candidate(2, 2) !== 2.0) { throw new Exception(\"Test failed!\"); }\n if (candidate(10, 8) !== 40.0) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "php", - "prompt": ">> tri(3)\n// array(1, 3, 2, 8)\nfunction tri($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return tri(...$args);\n}\n\nfunction test(): void {\n if (candidate(3) !== array(1, 3, 2, 8)) { throw new Exception(\"Test failed!\"); }\n if (candidate(4) !== array(1, 3, 2, 8, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(5) !== array(1, 3, 2, 8, 3, 15)) { throw new Exception(\"Test failed!\"); }\n if (candidate(6) !== array(1, 3, 2, 8, 3, 15, 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(7) !== array(1, 3, 2, 8, 3, 15, 4, 24)) { throw new Exception(\"Test failed!\"); }\n if (candidate(8) !== array(1, 3, 2, 8, 3, 15, 4, 24, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(9) !== array(1, 3, 2, 8, 3, 15, 4, 24, 5, 35)) { throw new Exception(\"Test failed!\"); }\n if (candidate(20) !== array(1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11)) { throw new Exception(\"Test failed!\"); }\n if (candidate(0) !== array(1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(1) !== array(1, 3)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "php", - "prompt": ">> match_parens(array(\"()(\", \")\"))\n// \"Yes\"\n// >>> match_parens(array(\")\", \")\"))\n// \"No\"\nfunction match_parens($lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return match_parens(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(\"()(\", \")\")) !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\")\", \")\")) !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"(()(())\", \"())())\")) !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\")())\", \"(()()(\")) !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"(())))\", \"(()())((\")) !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"()\", \"())\")) !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"(()(\", \"()))()\")) !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"((((\", \"((())\")) !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\")(()\", \"(()(\")) !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\")(\", \")(\")) !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"(\", \")\")) !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\")\", \"(\")) !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "php", - "prompt": ">> remove_duplicates(array(1, 2, 3, 2, 4))\n// array(1, 3, 4)\nfunction remove_duplicates($numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return remove_duplicates(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4)) !== array(1, 2, 3, 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 2, 4, 3, 5)) !== array(1, 4, 5)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "php", - "prompt": ">> greatest_common_divisor(3, 5)\n// 1\n// >>> greatest_common_divisor(25, 15)\n// 5\nfunction greatest_common_divisor($a, $b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return greatest_common_divisor(...$args);\n}\n\nfunction test(): void {\n if (candidate(3, 7) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(10, 15) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(49, 14) !== 7) { throw new Exception(\"Test failed!\"); }\n if (candidate(144, 60) !== 12) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "php", - "prompt": ">> is_palindrome(\"\")\n// true\n// >>> is_palindrome(\"aba\")\n// true\n// >>> is_palindrome(\"aaaaa\")\n// true\n// >>> is_palindrome(\"zbcd\")\n// false\nfunction is_palindrome($text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return is_palindrome(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"aba\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"aaaaa\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"zbcd\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"xywyx\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"xywyz\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"xywzx\") !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "php", - "prompt": ">> derivative(array(3, 1, 2, 4, 5))\n// array(1, 4, 12, 20)\n// >>> derivative(array(1, 2, 3))\n// array(2, 6)\nfunction derivative($xs) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return derivative(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(3, 1, 2, 4, 5)) !== array(1, 4, 12, 20)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3)) !== array(2, 6)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 2, 1)) !== array(2, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 2, 1, 0, 4)) !== array(2, 2, 0, 16)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1)) !== array()) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "php", - "prompt": ">> fruit_distribution(\"5 apples and 6 oranges\", 19)\n// 8\n// >>> fruit_distribution(\"0 apples and 1 oranges\", 3)\n// 2\n// >>> fruit_distribution(\"2 apples and 3 oranges\", 100)\n// 95\n// >>> fruit_distribution(\"100 apples and 1 oranges\", 120)\n// 19\nfunction fruit_distribution($s, $n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return fruit_distribution(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"5 apples and 6 oranges\", 19) !== 8) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"5 apples and 6 oranges\", 21) !== 10) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"0 apples and 1 oranges\", 3) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1 apples and 0 oranges\", 3) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"2 apples and 3 oranges\", 100) !== 95) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"2 apples and 3 oranges\", 5) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1 apples and 100 oranges\", 120) !== 19) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "php", - "prompt": ">> iscube(1)\n// true\n// >>> iscube(2)\n// false\n// >>> iscube(-1)\n// true\n// >>> iscube(64)\n// true\n// >>> iscube(0)\n// true\n// >>> iscube(180)\n// false\nfunction iscube($a) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return iscube(...$args);\n}\n\nfunction test(): void {\n if (candidate(1) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(2) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(-1) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(64) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(180) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(1000) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(0) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(1729) !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "php", - "prompt": ">> sort_array(array(1, 5, 2, 3, 4))\n// array(1, 2, 3, 4, 5)\n// >>> sort_array(array(-2, -3, -4, -5, -6))\n// array(-6, -5, -4, -3, -2)\n// >>> sort_array(array(1, 0, 2, 3, 4))\n// array(0, 1, 2, 3, 4)\nfunction sort_array($arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return sort_array(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 5, 2, 3, 4)) !== array(1, 2, 4, 3, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-2, -3, -4, -5, -6)) !== array(-4, -2, -6, -5, -3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 0, 2, 3, 4)) !== array(0, 1, 2, 4, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4)) !== array(2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 6, 44, 12, 32, 5)) !== array(32, 3, 5, 6, 12, 44)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 4, 8, 16, 32)) !== array(2, 4, 8, 16, 32)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 4, 8, 16, 32)) !== array(2, 4, 8, 16, 32)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "php", - "prompt": ">> odd_count(array(\"1234567\"))\n// array(\"the number of odd elements 4n the str4ng 4 of the 4nput.\")\n// >>> odd_count(array(\"3\", \"11111111\"))\n// array(\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\")\nfunction odd_count($lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return odd_count(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(\"1234567\")) !== array(\"the number of odd elements 4n the str4ng 4 of the 4nput.\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"3\", \"11111111\")) !== array(\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"271\", \"137\", \"314\")) !== array(\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\")) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "php", - "prompt": ">> correct_bracketing(\"(\")\n// false\n// >>> correct_bracketing(\"()\")\n// true\n// >>> correct_bracketing(\"(()())\")\n// true\n// >>> correct_bracketing(\")(()\")\n// false\nfunction correct_bracketing($brackets) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return correct_bracketing(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"()\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"(()())\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"()()(()())()\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"()()((()()())())(()()(()))\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"((()())))\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\")(()\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"(\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"((((\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\")\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"(()\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"()()(()())())(()\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"()()(()())()))()\") !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "php", - "prompt": ">> digitSum(\"\")\n// 0\n// >>> digitSum(\"abAB\")\n// 131\n// >>> digitSum(\"abcCd\")\n// 67\n// >>> digitSum(\"helloE\")\n// 69\n// >>> digitSum(\"woArBld\")\n// 131\n// >>> digitSum(\"aAaaaXa\")\n// 153\nfunction digitSum($s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return digitSum(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\") !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abAB\") !== 131) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcCd\") !== 67) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"helloE\") !== 69) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"woArBld\") !== 131) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"aAaaaXa\") !== 153) { throw new Exception(\"Test failed!\"); }\n if (candidate(\" How are yOu?\") !== 151) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"You arE Very Smart\") !== 327) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "php", - "prompt": ">> list_sort(array(\"aa\", \"a\", \"aaa\"))\n// array(\"aa\")\n// >>> list_sort(array(\"ab\", \"a\", \"aaa\", \"cd\"))\n// array(\"ab\", \"cd\")\nfunction sorted_list_sum($lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return sorted_list_sum(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(\"aa\", \"a\", \"aaa\")) !== array(\"aa\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"school\", \"AI\", \"asdf\", \"b\")) !== array(\"AI\", \"asdf\", \"school\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"d\", \"b\", \"c\", \"a\")) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"d\", \"dcba\", \"abcd\", \"a\")) !== array(\"abcd\", \"dcba\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"AI\", \"ai\", \"au\")) !== array(\"AI\", \"ai\", \"au\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"a\", \"b\", \"b\", \"c\", \"c\", \"a\")) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"aaaa\", \"bbbb\", \"dd\", \"cc\")) !== array(\"cc\", \"dd\", \"aaaa\", \"bbbb\")) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "php", - "prompt": ">> prod_signs(array(1, 2, 2, -4))\n// 9\n// >>> prod_signs(array(0, 1))\n// 0\n// >>> prod_signs(array())\n// null\nfunction prod_signs($arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return prod_signs(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2, 2, -4)) !== -9) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0, 1)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 1, 1, 2, 3, -1, 1)) !== -10) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== null) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 4, 1, 2, -1, -1, 9)) !== 20) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, 1, -1, 1)) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, 1, 1, 1)) !== -4) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, 1, 1, 0)) !== 0) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "php", - "prompt": ">> incr_list(array(1, 2, 3))\n// array(2, 3, 4)\n// >>> incr_list(array(5, 3, 5, 2, 3, 3, 9, 0, 123))\n// array(6, 4, 6, 3, 4, 4, 10, 1, 124)\nfunction incr_list($l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return incr_list(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 2, 1)) !== array(4, 3, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 2, 5, 2, 3, 3, 9, 0, 123)) !== array(6, 3, 6, 3, 4, 4, 10, 1, 124)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "php", - "prompt": ">> rolling_max(array(1, 2, 3, 2, 3, 4, 2))\n// array(1, 2, 3, 3, 3, 4, 4)\nfunction rolling_max($numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return rolling_max(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4)) !== array(1, 2, 3, 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 3, 2, 1)) !== array(4, 4, 4, 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 2, 3, 100, 3)) !== array(3, 3, 3, 100, 100)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "php", - "prompt": ">> separate_paren_groups(\"( ) (( )) (( )( ))\")\n// array(\"()\", \"(())\", \"(()())\")\nfunction separate_paren_groups($paren_string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return separate_paren_groups(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"(()()) ((())) () ((())()())\") !== array(\"(()())\", \"((()))\", \"()\", \"((())()())\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"() (()) ((())) (((())))\") !== array(\"()\", \"(())\", \"((()))\", \"(((())))\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"(()(())((())))\") !== array(\"(()(())((())))\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"( ) (( )) (( )( ))\") !== array(\"()\", \"(())\", \"(()())\")) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "php", - "prompt": ">> words_string(\"Hi, my name is John\")\n// array(\"Hi\", \"my\", \"name\", \"is\", \"John\")\n// >>> words_string(\"One, two, three, four, five, six\")\n// array(\"One\", \"two\", \"three\", \"four\", \"five\", \"six\")\nfunction words_string($s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return words_string(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"Hi, my name is John\") !== array(\"Hi\", \"my\", \"name\", \"is\", \"John\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"One, two, three, four, five, six\") !== array(\"One\", \"two\", \"three\", \"four\", \"five\", \"six\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Hi, my name\") !== array(\"Hi\", \"my\", \"name\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"One,, two, three, four, five, six,\") !== array(\"One\", \"two\", \"three\", \"four\", \"five\", \"six\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"\") !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"ahmed , gamal\") !== array(\"ahmed\", \"gamal\")) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "php", - "prompt": ">> compare_one(1, 2.5)\n// 2.5\n// >>> compare_one(1, \"2,3\")\n// \"2,3\"\n// >>> compare_one(\"5,1\", \"6\")\n// \"6\"\n// >>> compare_one(\"1\", 1)\n// null\nfunction compare_one($a, $b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return compare_one(...$args);\n}\n\nfunction test(): void {\n if (candidate(1, 2) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(1, 2.5) !== 2.5) { throw new Exception(\"Test failed!\"); }\n if (candidate(2, 3) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(5, 6) !== 6) { throw new Exception(\"Test failed!\"); }\n if (candidate(1, \"2,3\") !== \"2,3\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"5,1\", \"6\") !== \"6\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1\", \"2\") !== \"2\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1\", 1) !== null) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "php", - "prompt": ">> filter_integers(array(\"a\", 3.14, 5))\n// array(5)\n// >>> filter_integers(array(1, 2, 3, \"abc\", array(), array()))\n// array(1, 2, 3)\nfunction filter_integers($values) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return filter_integers(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, array(), array(), 23.2, 9, \"adasd\")) !== array(4, 9)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, \"c\", 3, 3, \"a\", \"b\")) !== array(3, 3, 3)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "php", - "prompt": ">> sort_even(array(1, 2, 3))\n// array(1, 2, 3)\n// >>> sort_even(array(5, 6, 3, 4))\n// array(3, 6, 5, 4)\nfunction sort_even($l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return sort_even(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2, 3)) !== array(1, 2, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10)) !== array(-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 8, -12, 4, 23, 2, 3, 11, 12, -10)) !== array(-12, 8, 3, 4, 5, 2, 12, 11, 23, -10)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "php", - "prompt": ">> compare(array(1, 2, 3, 4, 5, 1), array(1, 2, 3, 4, 2, -2))\n// array(0, 0, 0, 0, 3, 3)\n// >>> compare(array(0, 5, 0, 0, 0, 4), array(4, 1, 1, 0, 0, -2))\n// array(4, 4, 1, 0, 0, 6)\nfunction compare($game, $guess) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return compare(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2, 3, 4, 5, 1), array(1, 2, 3, 4, 2, -2)) !== array(0, 0, 0, 0, 3, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0, 0, 0, 0, 0, 0), array(0, 0, 0, 0, 0, 0)) !== array(0, 0, 0, 0, 0, 0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3), array(-1, -2, -3)) !== array(2, 4, 6)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 5), array(-1, 2, 3, 4)) !== array(2, 0, 0, 1)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "php", - "prompt": ">> even_odd_palindrome(3)\n// array(1, 2)\n// Explanation:\n// Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n// Example 2:\n// >>> even_odd_palindrome(12)\n// array(4, 6)\n// Explanation:\n// Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n// Note:\n// 1. 1 <= n <= 10^3\n// 2. returned tuple has the number of even and odd integer palindromes respectively.\nfunction even_odd_palindrome($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return even_odd_palindrome(...$args);\n}\n\nfunction test(): void {\n if (candidate(123) !== array(8, 13)) { throw new Exception(\"Test failed!\"); }\n if (candidate(12) !== array(4, 6)) { throw new Exception(\"Test failed!\"); }\n if (candidate(3) !== array(1, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(63) !== array(6, 8)) { throw new Exception(\"Test failed!\"); }\n if (candidate(25) !== array(5, 6)) { throw new Exception(\"Test failed!\"); }\n if (candidate(19) !== array(4, 6)) { throw new Exception(\"Test failed!\"); }\n if (candidate(9) !== array(4, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(1) !== array(0, 1)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "php", - "prompt": " 0\n// fib4(1) -> 0\n// fib4(2) -> 2\n// fib4(3) -> 0\n// fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n// Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n// >>> fib4(5)\n// 4\n// >>> fib4(6)\n// 8\n// >>> fib4(7)\n// 14\nfunction fib4($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return fib4(...$args);\n}\n\nfunction test(): void {\n if (candidate(5) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(8) !== 28) { throw new Exception(\"Test failed!\"); }\n if (candidate(10) !== 104) { throw new Exception(\"Test failed!\"); }\n if (candidate(12) !== 386) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "php", - "prompt": ">> generate_integers(2, 8)\n// array(2, 4, 6, 8)\n// >>> generate_integers(8, 2)\n// array(2, 4, 6, 8)\n// >>> generate_integers(10, 14)\n// array()\nfunction generate_integers($a, $b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return generate_integers(...$args);\n}\n\nfunction test(): void {\n if (candidate(2, 10) !== array(2, 4, 6, 8)) { throw new Exception(\"Test failed!\"); }\n if (candidate(10, 2) !== array(2, 4, 6, 8)) { throw new Exception(\"Test failed!\"); }\n if (candidate(132, 2) !== array(2, 4, 6, 8)) { throw new Exception(\"Test failed!\"); }\n if (candidate(17, 89) !== array()) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "php", - "prompt": ">> mean_absolute_deviation(array(1.0, 2.0, 3.0, 4.0))\n// 1.0\nfunction mean_absolute_deviation($numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return mean_absolute_deviation(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1.0, 2.0)) !== 0.5) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 3.0, 4.0)) !== 1.0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 3.0, 4.0, 5.0)) !== 1.2) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "php", - "prompt": ">> encrypt(\"hi\")\n// \"lm\"\n// >>> encrypt(\"asdfghjkl\")\n// \"ewhjklnop\"\n// >>> encrypt(\"gf\")\n// \"kj\"\n// >>> encrypt(\"et\")\n// \"ix\"\nfunction encrypt($s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return encrypt(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"hi\") !== \"lm\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"asdfghjkl\") !== \"ewhjklnop\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"gf\") !== \"kj\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"et\") !== \"ix\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"faewfawefaewg\") !== \"jeiajeaijeiak\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"hellomyfriend\") !== \"lippsqcjvmirh\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\") !== \"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"a\") !== \"e\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "php", - "prompt": ">> get_odd_collatz(5)\n// array(1, 5)\nfunction get_odd_collatz($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return get_odd_collatz(...$args);\n}\n\nfunction test(): void {\n if (candidate(14) !== array(1, 5, 7, 11, 13, 17)) { throw new Exception(\"Test failed!\"); }\n if (candidate(5) !== array(1, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(12) !== array(1, 3, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(1) !== array(1)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "php", - "prompt": ">> how_many_times(\"\", \"a\")\n// 0\n// >>> how_many_times(\"aaa\", \"a\")\n// 3\n// >>> how_many_times(\"aaaa\", \"aa\")\n// 3\nfunction how_many_times($string, $substring) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return how_many_times(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\", \"x\") !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"xyxyxyx\", \"x\") !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"cacacacac\", \"cac\") !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"john doe\", \"john\") !== 1) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "php", - "prompt": ">> move_one_ball(array(3, 4, 5, 1, 2))\n// true\n// Explanation: By performin 2 right shift operations, non-decreasing order can\n// be achieved for the given array.\n// >>> move_one_ball(array(3, 5, 4, 1, 2))\n// false\n// Explanation:It is not possible to get non-decreasing order for the given\n// array by performing any number of right shift operations.\nfunction move_one_ball($arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return move_one_ball(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(3, 4, 5, 1, 2)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 5, 10, 1, 2)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 3, 1, 2)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 5, 4, 1, 2)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== true) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "php", - "prompt": ">> order_by_points(array(1, 11, -1, -11, -12))\n// array(-1, -11, 1, -12, 11)\n// >>> order_by_points(array())\n// array()\nfunction order_by_points($nums) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return order_by_points(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 11, -1, -11, -12)) !== array(-1, -11, 1, -12, 11)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46)) !== array(0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, -11, -32, 43, 54, -98, 2, -3)) !== array(-3, -32, -98, -11, 1, 2, 43, 54)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)) !== array(1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0, 6, 6, -76, -21, 23, 4)) !== array(-76, -21, 0, 4, 23, 6, 6)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "php", - "prompt": ">> factorize(8)\n// array(2, 2, 2)\n// >>> factorize(25)\n// array(5, 5)\n// >>> factorize(70)\n// array(2, 5, 7)\nfunction factorize($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return factorize(...$args);\n}\n\nfunction test(): void {\n if (candidate(2) !== array(2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(4) !== array(2, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(8) !== array(2, 2, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(57) !== array(3, 19)) { throw new Exception(\"Test failed!\"); }\n if (candidate(3249) !== array(3, 3, 19, 19)) { throw new Exception(\"Test failed!\"); }\n if (candidate(185193) !== array(3, 3, 3, 19, 19, 19)) { throw new Exception(\"Test failed!\"); }\n if (candidate(20577) !== array(3, 19, 19, 19)) { throw new Exception(\"Test failed!\"); }\n if (candidate(18) !== array(2, 3, 3)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "php", - "prompt": ">> below_threshold(array(1, 2, 4, 10), 100)\n// true\n// >>> below_threshold(array(1, 20, 4, 10), 5)\n// false\nfunction below_threshold($l, $t) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return below_threshold(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2, 4, 10), 100) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 20, 4, 10), 5) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 20, 4, 10), 21) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 20, 4, 10), 22) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 8, 4, 10), 11) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 8, 4, 10), 10) !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "php", - "prompt": ">> rounded_avg(1, 5)\n// \"0b11\"\n// >>> rounded_avg(7, 5)\n// -1\n// >>> rounded_avg(10, 20)\n// \"0b1111\"\n// >>> rounded_avg(20, 33)\n// \"0b11010\"\nfunction rounded_avg($n, $m) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return rounded_avg(...$args);\n}\n\nfunction test(): void {\n if (candidate(1, 5) !== \"0b11\") { throw new Exception(\"Test failed!\"); }\n if (candidate(7, 13) !== \"0b1010\") { throw new Exception(\"Test failed!\"); }\n if (candidate(964, 977) !== \"0b1111001010\") { throw new Exception(\"Test failed!\"); }\n if (candidate(996, 997) !== \"0b1111100100\") { throw new Exception(\"Test failed!\"); }\n if (candidate(560, 851) !== \"0b1011000010\") { throw new Exception(\"Test failed!\"); }\n if (candidate(185, 546) !== \"0b101101110\") { throw new Exception(\"Test failed!\"); }\n if (candidate(362, 496) !== \"0b110101101\") { throw new Exception(\"Test failed!\"); }\n if (candidate(350, 902) !== \"0b1001110010\") { throw new Exception(\"Test failed!\"); }\n if (candidate(197, 233) !== \"0b11010111\") { throw new Exception(\"Test failed!\"); }\n if (candidate(7, 5) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(5, 1) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(5, 5) !== \"0b101\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "php", - "prompt": ">> parse_nested_parens(\"(()()) ((())) () ((())()())\")\n// array(2, 3, 1, 3)\nfunction parse_nested_parens($paren_string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return parse_nested_parens(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"(()()) ((())) () ((())()())\") !== array(2, 3, 1, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"() (()) ((())) (((())))\") !== array(1, 2, 3, 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"(()(())((())))\") !== array(4)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "php", - "prompt": ">> solution(array(5, 8, 7, 1))\n// 12\n// >>> solution(array(3, 3, 3, 3, 3))\n// 9\n// >>> solution(array(30, 13, 24, 321))\n// 0\nfunction solution($lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return solution(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(5, 8, 7, 1)) !== 12) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 3, 3, 3, 3)) !== 9) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(30, 13, 24, 321)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 9)) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 4, 8)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(30, 13, 23, 32)) !== 23) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 13, 2, 9)) !== 3) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "php", - "prompt": ">> get_max_triples(5)\n// 1\n// Explanation: \n// a = [1, 3, 7, 13, 21]\n// The only valid triple is (1, 7, 13).\nfunction get_max_triples($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return get_max_triples(...$args);\n}\n\nfunction test(): void {\n if (candidate(5) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(6) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(10) !== 36) { throw new Exception(\"Test failed!\"); }\n if (candidate(100) !== 53361) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "php", - "prompt": ">> bf(\"Jupiter\", \"Neptune\")\n// array(\"Saturn\", \"Uranus\")\n// >>> bf(\"Earth\", \"Mercury\")\n// \"Venus\"\n// >>> bf(\"Mercury\", \"Uranus\")\n// array(\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\")\nfunction bf($planet1, $planet2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return bf(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"Jupiter\", \"Neptune\") !== array(\"Saturn\", \"Uranus\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Earth\", \"Mercury\") !== array(\"Venus\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Mercury\", \"Uranus\") !== array(\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Neptune\", \"Venus\") !== array(\"Earth\", \"Mars\", \"Jupiter\", \"Saturn\", \"Uranus\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Earth\", \"Earth\") !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Mars\", \"Earth\") !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Jupiter\", \"Makemake\") !== array()) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "php", - "prompt": ">> next_smallest(array(1, 2, 3, 4, 5))\n// 2\n// >>> next_smallest(array(5, 1, 4, 3, 2))\n// 2\n// >>> next_smallest(array())\n// null\n// >>> next_smallest(array(1, 1))\n// null\nfunction next_smallest($lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return next_smallest(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2, 3, 4, 5)) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 1, 4, 3, 2)) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== null) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 1)) !== null) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 1, 1, 1, 0)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 1)) !== null) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-35, 34, 12, -45)) !== -35) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "php", - "prompt": ">> sort_numbers(\"three one five\")\n// \"one three five\"\nfunction sort_numbers($numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return sort_numbers(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"three\") !== \"three\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"three five nine\") !== \"three five nine\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"five zero four seven nine eight\") !== \"zero four five seven eight nine\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"six five four three two one zero\") !== \"zero one two three four five six\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "php", - "prompt": ">> cycpattern_check(\"abcd\", \"abd\")\n// false\n// >>> cycpattern_check(\"hello\", \"ell\")\n// true\n// >>> cycpattern_check(\"whassup\", \"psus\")\n// false\n// >>> cycpattern_check(\"abab\", \"baa\")\n// true\n// >>> cycpattern_check(\"efef\", \"eeff\")\n// false\n// >>> cycpattern_check(\"himenss\", \"simen\")\n// true\nfunction cycpattern_check($a, $b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return cycpattern_check(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"xyzw\", \"xyw\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"yello\", \"ell\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"whattup\", \"ptut\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"efef\", \"fee\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abab\", \"aabb\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"winemtt\", \"tinem\") !== true) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "php", - "prompt": ">> decimal_to_binary(15)\n// \"db1111db\"\n// >>> decimal_to_binary(32)\n// \"db100000db\"\nfunction decimal_to_binary($decimal) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return decimal_to_binary(...$args);\n}\n\nfunction test(): void {\n if (candidate(0) !== \"db0db\") { throw new Exception(\"Test failed!\"); }\n if (candidate(32) !== \"db100000db\") { throw new Exception(\"Test failed!\"); }\n if (candidate(103) !== \"db1100111db\") { throw new Exception(\"Test failed!\"); }\n if (candidate(15) !== \"db1111db\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "php", - "prompt": ">> filter_by_substring(array(), \"a\")\n// array()\n// >>> filter_by_substring(array(\"abc\", \"bacd\", \"cde\", \"array\"), \"a\")\n// array(\"abc\", \"bacd\", \"array\")\nfunction filter_by_substring($strings, $substring) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return filter_by_substring(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(), \"john\") !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"), \"xxx\") !== array(\"xxx\", \"xxxAAA\", \"xxx\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"), \"xx\") !== array(\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"grunt\", \"trumpet\", \"prune\", \"gruesome\"), \"run\") !== array(\"grunt\", \"prune\")) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "php", - "prompt": ">> even_odd_count(-12)\n// array(1, 1)\n// >>> even_odd_count(123)\n// array(1, 2)\nfunction even_odd_count($num) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return even_odd_count(...$args);\n}\n\nfunction test(): void {\n if (candidate(7) !== array(0, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(-78) !== array(1, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(3452) !== array(2, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(346211) !== array(3, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(-345821) !== array(3, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(-2) !== array(1, 0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(-45347) !== array(2, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(0) !== array(1, 0)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "php", - "prompt": ">> find_max(array(\"name\", \"of\", \"string\"))\n// \"string\"\n// >>> find_max(array(\"name\", \"enam\", \"game\"))\n// \"enam\"\n// >>> find_max(array(\"aaaaaaa\", \"bb\", \"cc\"))\n// \"aaaaaaa\"\nfunction find_max($words) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return find_max(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(\"name\", \"of\", \"string\")) !== \"string\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"name\", \"enam\", \"game\")) !== \"enam\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"aaaaaaa\", \"bb\", \"cc\")) !== \"aaaaaaa\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"abc\", \"cba\")) !== \"abc\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"play\", \"this\", \"game\", \"of\", \"footbott\")) !== \"footbott\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"we\", \"are\", \"gonna\", \"rock\")) !== \"gonna\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"we\", \"are\", \"a\", \"mad\", \"nation\")) !== \"nation\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"this\", \"is\", \"a\", \"prrk\")) !== \"this\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"b\")) !== \"b\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"play\", \"play\", \"play\")) !== \"play\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "php", - "prompt": "", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "php", - "prompt": ">> largest_smallest_integers(array(2, 4, 1, 3, 5, 7))\n// array(null, 1)\n// >>> largest_smallest_integers(array())\n// array(null, null)\n// >>> largest_smallest_integers(array(0))\n// array(null, null)\nfunction largest_smallest_integers($lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return largest_smallest_integers(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(2, 4, 1, 3, 5, 7)) !== array(null, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 4, 1, 3, 5, 7, 0)) !== array(null, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 3, 2, 4, 5, 6, -2)) !== array(-2, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 5, 3, 6, 2, 7, -7)) !== array(-7, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(7, 3, 8, 4, 9, 2, 5, -9)) !== array(-9, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== array(null, null)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0)) !== array(null, null)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, -3, -5, -6)) !== array(-1, null)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, -3, -5, -6, 0)) !== array(-1, null)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-6, -4, -4, -3, 1)) !== array(-3, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-6, -4, -4, -3, -100, 1)) !== array(-3, 1)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "php", - "prompt": ">> pluck(array(4, 2, 3))\n// array(2, 1)\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 2:\n// >>> pluck(array(1, 2, 3))\n// array(2, 1)\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 3:\n// >>> pluck(array())\n// array()\n// Example 4:\n// >>> pluck(array(5, 0, 3, 0, 4, 2))\n// array(0, 1)\n// Explanation: 0 is the smallest value, but there are two zeros,\n// so we will choose the first zero, which has the smallest index.\n// Constraints:\n// * 1 <= nodes.length <= 10000\n// * 0 <= node.value\nfunction pluck($arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return pluck(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(4, 2, 3)) !== array(2, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3)) !== array(2, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 0, 3, 0, 4, 2)) !== array(0, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 0, 5, 3)) !== array(0, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 4, 8, 4, 8)) !== array(4, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(7, 6, 7, 1)) !== array(6, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(7, 9, 7, 1)) !== array()) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "php", - "prompt": " 0.\n// If a number is negative, then its first signed digit will be negative:\n// e.g. -123 has signed digits -1, 2, and 3.\n// >>> count_nums(array())\n// 0\n// >>> count_nums(array(-1, 11, -11))\n// 1\n// >>> count_nums(array(1, 1, 2))\n// 3\nfunction count_nums($arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return count_nums(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, -2, 0)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 1, 2, -2, 3, 4, 5)) !== 6) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 6, 9, -6, 0, 1, 5)) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 100, 98, -7, 1, -1)) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(12, 23, 34, -45, -56, 0)) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0, 1)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1)) !== 1) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "php", - "prompt": "= 2) and a positive integer k, \n// each cell of the grid contains a value. Every integer in the range [1, N * N]\n// inclusive appears exactly once on the cells of the grid.\n// You have to find the minimum path of length k in the grid. You can start\n// from any cell, and in each step you can move to any of the neighbor cells,\n// in other words, you can go to cells which share an edge with you current\n// cell.\n// Please note that a path of length k means visiting exactly k cells (not\n// necessarily distinct).\n// You CANNOT go off the grid.\n// A path A (of length k) is considered less than a path B (of length k) if\n// after making the ordered lists of the values on the cells that A and B go\n// through (let's call them lst_A and lst_B), lst_A is lexicographically less\n// than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n// such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n// lst_A[j] = lst_B[j].\n// It is guaranteed that the answer is unique.\n// Return an ordered list of the values on the cells that the minimum path go through.\n// Examples: \n// >>> minPath(array(array(1, 2, 3), array(4, 5, 6), array(7, 8, 9)), 3)\n// array(1, 2, 1)\n// >>> minPath(array(array(5, 9, 3), array(4, 1, 6), array(7, 8, 2)), 1)\n// array(1)\nfunction minPath($grid, $k) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return minPath(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(array(1, 2, 3), array(4, 5, 6), array(7, 8, 9)), 3) !== array(1, 2, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(5, 9, 3), array(4, 1, 6), array(7, 8, 2)), 1) !== array(1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(1, 2, 3, 4), array(5, 6, 7, 8), array(9, 10, 11, 12), array(13, 14, 15, 16)), 4) !== array(1, 2, 1, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(6, 4, 13, 10), array(5, 7, 12, 1), array(3, 16, 11, 15), array(8, 14, 9, 2)), 7) !== array(1, 10, 1, 10, 1, 10, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(8, 14, 9, 2), array(6, 4, 13, 15), array(5, 7, 1, 12), array(3, 10, 11, 16)), 5) !== array(1, 7, 1, 7, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(11, 8, 7, 2), array(5, 16, 14, 4), array(9, 3, 15, 6), array(12, 13, 10, 1)), 9) !== array(1, 6, 1, 6, 1, 6, 1, 6, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(12, 13, 10, 1), array(9, 3, 15, 6), array(5, 16, 14, 4), array(11, 8, 7, 2)), 12) !== array(1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(2, 7, 4), array(3, 1, 5), array(6, 8, 9)), 8) !== array(1, 3, 1, 3, 1, 3, 1, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(6, 1, 5), array(3, 8, 9), array(2, 7, 4)), 8) !== array(1, 5, 1, 5, 1, 5, 1, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(1, 2), array(3, 4)), 10) !== array(1, 2, 1, 2, 1, 2, 1, 2, 1, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(1, 3), array(3, 2)), 10) !== array(1, 3, 1, 3, 1, 3, 1, 3, 1, 3)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "php", - "prompt": ">> strange_sort_list(array(1, 2, 3, 4))\n// array(1, 4, 2, 3)\n// >>> strange_sort_list(array(5, 5, 5, 5))\n// array(5, 5, 5, 5)\n// >>> strange_sort_list(array())\n// array()\nfunction strange_sort_list($lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return strange_sort_list(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2, 3, 4)) !== array(1, 4, 2, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 6, 7, 8, 9)) !== array(5, 9, 6, 8, 7)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4, 5)) !== array(1, 5, 2, 4, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 6, 7, 8, 9, 1)) !== array(1, 9, 5, 8, 6, 7)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5, 5, 5, 5)) !== array(5, 5, 5, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4, 5, 6, 7, 8)) !== array(1, 8, 2, 7, 3, 6, 4, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0, 2, 2, 2, 5, 5, -5, -5)) !== array(-5, 5, -5, 5, 0, 2, 2, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(111111)) !== array(111111)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "php", - "prompt": ">> string_to_md5(\"Hello world\")\n// \"3e25960a79dbc69b674cd4ec67a72c62\"\nfunction string_to_md5($text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return string_to_md5(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"Hello world\") !== \"3e25960a79dbc69b674cd4ec67a72c62\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"\") !== null) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"A B C\") !== \"0ef78513b0cb8cef12743f5aeb35f888\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"password\") !== \"5f4dcc3b5aa765d61d8327deb882cf99\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "php", - "prompt": ">> get_closest_vowel(\"yogurt\")\n// \"u\"\n// >>> get_closest_vowel(\"FULL\")\n// \"U\"\n// >>> get_closest_vowel(\"quick\")\n// \"\"\n// >>> get_closest_vowel(\"ab\")\n// \"\"\nfunction get_closest_vowel($word) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return get_closest_vowel(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"yogurt\") !== \"u\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"full\") !== \"u\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"easy\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"eAsy\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"ali\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"bad\") !== \"a\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"most\") !== \"o\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"ab\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"ba\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"quick\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"anime\") !== \"i\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Asia\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Above\") !== \"o\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "php", - "prompt": ">> change_base(8, 3)\n// \"22\"\n// >>> change_base(8, 2)\n// \"1000\"\n// >>> change_base(7, 2)\n// \"111\"\nfunction change_base($x, $base) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return change_base(...$args);\n}\n\nfunction test(): void {\n if (candidate(8, 3) !== \"22\") { throw new Exception(\"Test failed!\"); }\n if (candidate(9, 3) !== \"100\") { throw new Exception(\"Test failed!\"); }\n if (candidate(234, 2) !== \"11101010\") { throw new Exception(\"Test failed!\"); }\n if (candidate(16, 2) !== \"10000\") { throw new Exception(\"Test failed!\"); }\n if (candidate(8, 2) !== \"1000\") { throw new Exception(\"Test failed!\"); }\n if (candidate(7, 2) !== \"111\") { throw new Exception(\"Test failed!\"); }\n if (candidate(2, 3) !== \"2\") { throw new Exception(\"Test failed!\"); }\n if (candidate(3, 4) !== \"3\") { throw new Exception(\"Test failed!\"); }\n if (candidate(4, 5) !== \"4\") { throw new Exception(\"Test failed!\"); }\n if (candidate(5, 6) !== \"5\") { throw new Exception(\"Test failed!\"); }\n if (candidate(6, 7) !== \"6\") { throw new Exception(\"Test failed!\"); }\n if (candidate(7, 8) !== \"7\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "php", - "prompt": ">> has_close_elements(array(1.0, 2.0, 3.0), 0.5)\n// false\n// >>> has_close_elements(array(1.0, 2.8, 3.0, 4.0, 5.0, 2.0), 0.3)\n// true\nfunction has_close_elements($numbers, $threshold) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return has_close_elements(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1.0, 2.0, 3.9, 4.0, 5.0, 2.2), 0.3) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 3.9, 4.0, 5.0, 2.2), 0.05) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 5.9, 4.0, 5.0), 0.95) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 5.9, 4.0, 5.0), 0.8) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 3.0, 4.0, 5.0, 2.0), 0.1) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.1, 2.2, 3.1, 4.1, 5.1), 1.0) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.1, 2.2, 3.1, 4.1, 5.1), 0.5) !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "php", - "prompt": ">> is_nested(\"[[]]\")\n// true\n// >>> is_nested(\"[]]]]]]][[[[[]\")\n// false\n// >>> is_nested(\"[][]\")\n// false\n// >>> is_nested(\"[]\")\n// false\n// >>> is_nested(\"[[][]]\")\n// true\n// >>> is_nested(\"[[]][[\")\n// true\nfunction is_nested($string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return is_nested(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"[[]]\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"[]]]]]]][[[[[]\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"[][]\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"[]\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"[[[[]]]]\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"[]]]]]]]]]]\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"[][][[]]\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"[[]\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"[]]\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"[[]][[\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"[[][]]\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"[[[[[[[[\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"]]]]]]]]\") !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "php", - "prompt": ">> concatenate(array())\n// \"\"\n// >>> concatenate(array(\"a\", \"b\", \"c\"))\n// \"abc\"\nfunction concatenate($strings) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return concatenate(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"x\", \"y\", \"z\")) !== \"xyz\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"x\", \"y\", \"z\", \"w\", \"k\")) !== \"xyzwk\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "php", - "prompt": ">> prime_fib(1)\n// 2\n// >>> prime_fib(2)\n// 3\n// >>> prime_fib(3)\n// 5\n// >>> prime_fib(4)\n// 13\n// >>> prime_fib(5)\n// 89\nfunction prime_fib($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return prime_fib(...$args);\n}\n\nfunction test(): void {\n if (candidate(1) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(2) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(3) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(4) !== 13) { throw new Exception(\"Test failed!\"); }\n if (candidate(5) !== 89) { throw new Exception(\"Test failed!\"); }\n if (candidate(6) !== 233) { throw new Exception(\"Test failed!\"); }\n if (candidate(7) !== 1597) { throw new Exception(\"Test failed!\"); }\n if (candidate(8) !== 28657) { throw new Exception(\"Test failed!\"); }\n if (candidate(9) !== 514229) { throw new Exception(\"Test failed!\"); }\n if (candidate(10) !== 433494437) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "php", - "prompt": ">> find_closest_elements(array(1.0, 2.0, 3.0, 4.0, 5.0, 2.2))\n// array(2.0, 2.2)\n// >>> find_closest_elements(array(1.0, 2.0, 3.0, 4.0, 5.0, 2.0))\n// array(2.0, 2.0)\nfunction find_closest_elements($numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return find_closest_elements(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1.0, 2.0, 3.9, 4.0, 5.0, 2.2)) !== array(3.9, 4.0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 5.9, 4.0, 5.0)) !== array(5.0, 5.9)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 3.0, 4.0, 5.0, 2.2)) !== array(2.0, 2.2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 3.0, 4.0, 5.0, 2.0)) !== array(2.0, 2.0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.1, 2.2, 3.1, 4.1, 5.1)) !== array(2.2, 3.1)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "php", - "prompt": ">> hex_key(\"AB\")\n// 1\n// >>> hex_key(\"1077E\")\n// 2\n// >>> hex_key(\"ABED1A33\")\n// 4\n// >>> hex_key(\"123456789ABCDEF0\")\n// 6\n// >>> hex_key(\"2020\")\n// 2\nfunction hex_key($num) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return hex_key(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"AB\") !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1077E\") !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"ABED1A33\") !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"2020\") !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"123456789ABCDEF0\") !== 6) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"112233445566778899AABBCCDDEEFF00\") !== 12) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "php", - "prompt": ">> multiply(148, 412)\n// 16\n// >>> multiply(19, 28)\n// 72\n// >>> multiply(2020, 1851)\n// 0\n// >>> multiply(14, -15)\n// 20\nfunction multiply($a, $b) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return multiply(...$args);\n}\n\nfunction test(): void {\n if (candidate(148, 412) !== 16) { throw new Exception(\"Test failed!\"); }\n if (candidate(19, 28) !== 72) { throw new Exception(\"Test failed!\"); }\n if (candidate(2020, 1851) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(14, -15) !== 20) { throw new Exception(\"Test failed!\"); }\n if (candidate(76, 67) !== 42) { throw new Exception(\"Test failed!\"); }\n if (candidate(17, 27) !== 49) { throw new Exception(\"Test failed!\"); }\n if (candidate(0, 1) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(0, 0) !== 0) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "php", - "prompt": ">> rescale_to_unit(array(1.0, 2.0, 3.0, 4.0, 5.0))\n// array(0.0, 0.25, 0.5, 0.75, 1.0)\nfunction rescale_to_unit($numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return rescale_to_unit(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(2.0, 49.9)) !== array(0.0, 1.0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(100.0, 49.9)) !== array(1.0, 0.0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 3.0, 4.0, 5.0)) !== array(0.0, 0.25, 0.5, 0.75, 1.0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2.0, 1.0, 5.0, 3.0, 4.0)) !== array(0.25, 0.0, 1.0, 0.5, 0.75)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(12.0, 11.0, 15.0, 13.0, 14.0)) !== array(0.25, 0.0, 1.0, 0.5, 0.75)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "php", - "prompt": ">> digits(1)\n// 1\n// >>> digits(4)\n// 0\n// >>> digits(235)\n// 15\nfunction digits($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return digits(...$args);\n}\n\nfunction test(): void {\n if (candidate(5) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(54) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(120) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(5014) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(98765) !== 315) { throw new Exception(\"Test failed!\"); }\n if (candidate(5576543) !== 2625) { throw new Exception(\"Test failed!\"); }\n if (candidate(2468) !== 0) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "php", - "prompt": ">> Strongest_Extension(\"my_class\", array(\"AA\", \"Be\", \"CC\"))\n// \"my_class.AA\"\nfunction Strongest_Extension($class_name, $extensions) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return Strongest_Extension(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"Watashi\", array(\"tEN\", \"niNE\", \"eIGHt8OKe\")) !== \"Watashi.eIGHt8OKe\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Boku123\", array(\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\")) !== \"Boku123.YEs.WeCaNe\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"__YESIMHERE\", array(\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\")) !== \"__YESIMHERE.NuLl__\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"K\", array(\"Ta\", \"TAR\", \"t234An\", \"cosSo\")) !== \"K.TAR\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"__HAHA\", array(\"Tab\", \"123\", \"781345\", \"-_-\")) !== \"__HAHA.123\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"YameRore\", array(\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\")) !== \"YameRore.okIWILL123\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"finNNalLLly\", array(\"Die\", \"NowW\", \"Wow\", \"WoW\")) !== \"finNNalLLly.WoW\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"_\", array(\"Bb\", \"91245\")) !== \"_.Bb\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Sp\", array(\"671235\", \"Bb\")) !== \"Sp.671235\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "php", - "prompt": ">> histogram(\"a b c\")\n// array(\"a\" => 1, \"b\" => 1, \"c\" => 1)\n// >>> histogram(\"a b b a\")\n// array(\"a\" => 2, \"b\" => 2)\n// >>> histogram(\"a b c a b\")\n// array(\"a\" => 2, \"b\" => 2)\n// >>> histogram(\"b b b b a\")\n// array(\"b\" => 4)\n// >>> histogram(\"\")\n// array()\nfunction histogram($test) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return histogram(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"a b b a\") !== array(\"a\" => 2, \"b\" => 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"a b c a b\") !== array(\"a\" => 2, \"b\" => 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"a b c d g\") !== array(\"a\" => 1, \"b\" => 1, \"c\" => 1, \"d\" => 1, \"g\" => 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"r t g\") !== array(\"r\" => 1, \"t\" => 1, \"g\" => 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"b b b b a\") !== array(\"b\" => 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"r t g\") !== array(\"r\" => 1, \"t\" => 1, \"g\" => 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"\") !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"a\") !== array(\"a\" => 1)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "php", - "prompt": ">> pairs_sum_to_zero(array(1, 3, 5, 0))\n// false\n// >>> pairs_sum_to_zero(array(1, 3, -2, 1))\n// false\n// >>> pairs_sum_to_zero(array(1, 2, 3, 7))\n// false\n// >>> pairs_sum_to_zero(array(2, 4, -5, 3, 5, 7))\n// true\n// >>> pairs_sum_to_zero(array(1))\n// false\nfunction pairs_sum_to_zero($l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return pairs_sum_to_zero(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 3, 5, 0)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 3, -2, 1)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 7)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 4, -5, 3, 5, 7)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-3, 9, -1, 3, 2, 30)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-3, 9, -1, 3, 2, 31)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-3, 9, -1, 4, 2, 30)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-3, 9, -1, 4, 2, 31)) !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "php", - "prompt": ">> total_match(array(), array())\n// array()\n// >>> total_match(array(\"hi\", \"admin\"), array(\"hI\", \"Hi\"))\n// array(\"hI\", \"Hi\")\n// >>> total_match(array(\"hi\", \"admin\"), array(\"hi\", \"hi\", \"admin\", \"project\"))\n// array(\"hi\", \"admin\")\n// >>> total_match(array(\"hi\", \"admin\"), array(\"hI\", \"hi\", \"hi\"))\n// array(\"hI\", \"hi\", \"hi\")\n// >>> total_match(array(\"4\"), array(\"1\", \"2\", \"3\", \"4\", \"5\"))\n// array(\"4\")\nfunction total_match($lst1, $lst2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return total_match(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(), array()) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"hi\", \"admin\"), array(\"hi\", \"hi\")) !== array(\"hi\", \"hi\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"hi\", \"admin\"), array(\"hi\", \"hi\", \"admin\", \"project\")) !== array(\"hi\", \"admin\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"4\"), array(\"1\", \"2\", \"3\", \"4\", \"5\")) !== array(\"4\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"hi\", \"admin\"), array(\"hI\", \"Hi\")) !== array(\"hI\", \"Hi\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"hi\", \"admin\"), array(\"hI\", \"hi\", \"hi\")) !== array(\"hI\", \"hi\", \"hi\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"hi\", \"admin\"), array(\"hI\", \"hi\", \"hii\")) !== array(\"hi\", \"admin\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(), array(\"this\")) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"this\"), array()) !== array()) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "php", - "prompt": " number of digits, return digits reversed.\n// >>> circular_shift(12, 1)\n// \"21\"\n// >>> circular_shift(12, 2)\n// \"12\"\nfunction circular_shift($x, $shift) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return circular_shift(...$args);\n}\n\nfunction test(): void {\n if (candidate(100, 2) !== \"001\") { throw new Exception(\"Test failed!\"); }\n if (candidate(12, 2) !== \"12\") { throw new Exception(\"Test failed!\"); }\n if (candidate(97, 8) !== \"79\") { throw new Exception(\"Test failed!\"); }\n if (candidate(12, 1) !== \"21\") { throw new Exception(\"Test failed!\"); }\n if (candidate(11, 101) !== \"11\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "php", - "prompt": ">> monotonic(array(1, 2, 4, 20))\n// true\n// >>> monotonic(array(1, 20, 4, 10))\n// false\n// >>> monotonic(array(4, 1, 0, -10))\n// true\nfunction monotonic($l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return monotonic(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2, 4, 10)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 4, 20)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 20, 4, 10)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 1, 0, -10)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 1, 1, 0)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 2, 5, 60)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4, 5, 60)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(9, 9, 9, 9)) !== true) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "php", - "prompt": ">> is_equal_to_sum_even(4)\n// false\n// >>> is_equal_to_sum_even(6)\n// false\n// >>> is_equal_to_sum_even(8)\n// true\nfunction is_equal_to_sum_even($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return is_equal_to_sum_even(...$args);\n}\n\nfunction test(): void {\n if (candidate(4) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(6) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(8) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(10) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(11) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(12) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(13) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(16) !== true) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "php", - "prompt": ">> parse_music(\"o o| .| o| o| .| .| .| .| o o\")\n// array(4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4)\nfunction parse_music($music_string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return parse_music(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\") !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"o o o o\") !== array(4, 4, 4, 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\".| .| .| .|\") !== array(1, 1, 1, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"o| o| .| .| o o o o\") !== array(2, 2, 1, 1, 4, 4, 4, 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"o| .| o| .| o o| o o|\") !== array(2, 1, 2, 1, 4, 2, 4, 2)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "php", - "prompt": ">> lst\n// array(1, 2, 3)\n// >>> lst\n// array()\n// >>> lst\n// array(-1, -5, 2, -1, -5)\nfunction sum_squares($lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return sum_squares(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2, 3)) !== 6) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 4, 9)) !== 14) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 1, 1, 1, 1, 1, 1, 1, 1)) !== 9) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, -1, -1, -1, -1, -1, -1, -1, -1)) !== -3) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, -5, 2, -1, -5)) !== -126) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-56, -99, 1, 0, -2)) !== 3030) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, 0, 0, 0, 0, 0, 0, 0, -1)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37)) !== -14196) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10)) !== -1448) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "php", - "prompt": ">> triples_sum_to_zero(array(1, 3, 5, 0))\n// false\n// >>> triples_sum_to_zero(array(1, 3, -2, 1))\n// true\n// >>> triples_sum_to_zero(array(1, 2, 3, 7))\n// false\n// >>> triples_sum_to_zero(array(2, 4, -5, 3, 9, 7))\n// true\n// >>> triples_sum_to_zero(array(1))\n// false\nfunction triples_sum_to_zero($l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return triples_sum_to_zero(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 3, 5, 0)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 3, 5, -1)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 3, -2, 1)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 7)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 5, 7)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 4, -5, 3, 9, 7)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 3, 5, -100)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(100, 3, 5, -100)) !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "php", - "prompt": "\".\n// return True if every opening bracket has a corresponding closing bracket.\n// >>> correct_bracketing(\"<\")\n// false\n// >>> correct_bracketing(\"<>\")\n// true\n// >>> correct_bracketing(\"<<><>>\")\n// true\n// >>> correct_bracketing(\"><<>\")\n// false\nfunction correct_bracketing($brackets) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return correct_bracketing(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"<>\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<<><>>\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<><><<><>><>\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<><><<<><><>><>><<><><<>>>\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<<<><>>>>\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"><<>\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<<<<\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\">\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<<>\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<><><<><>><>><<>\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"<><><<><>><>>><>\") !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "php", - "prompt": ">> specialFilter(array(15, -73, 14, -15))\n// 1\n// >>> specialFilter(array(33, -2, -3, 45, 21, 109))\n// 2\nfunction specialFilter($nums) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return specialFilter(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(5, -2, 1, -5)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(15, -73, 14, -15)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(33, -2, -3, 45, 21, 109)) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(43, -12, 93, 125, 121, 109)) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(71, -2, -33, 75, 21, 19)) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== 0) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "php", - "prompt": ">> check_dict_case(array(\"a\" => \"apple\", \"b\" => \"banana\"))\n// true\n// >>> check_dict_case(array(\"a\" => \"apple\", \"A\" => \"banana\", \"B\" => \"banana\"))\n// false\n// >>> check_dict_case(array(\"a\" => \"apple\", 8 => \"banana\", \"a\" => \"apple\"))\n// false\n// >>> check_dict_case(array(\"Name\" => \"John\", \"Age\" => \"36\", \"City\" => \"Houston\"))\n// false\n// >>> check_dict_case(array(\"STATE\" => \"NC\", \"ZIP\" => \"12345\"))\n// true\nfunction check_dict_case($dict) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return check_dict_case(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(\"p\" => \"pineapple\", \"b\" => \"banana\")) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"p\" => \"pineapple\", \"A\" => \"banana\", \"B\" => \"banana\")) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"p\" => \"pineapple\", \"5\" => \"banana\", \"a\" => \"apple\")) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"Name\" => \"John\", \"Age\" => \"36\", \"City\" => \"Houston\")) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"STATE\" => \"NC\", \"ZIP\" => \"12345\")) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"fruit\" => \"Orange\", \"taste\" => \"Sweet\")) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "php", - "prompt": ">> split_words(\"Hello world!\")\n// array(\"Hello\", \"world!\")\n// >>> split_words(\"Hello,world!\")\n// array(\"Hello\", \"world!\")\n// >>> split_words(\"abcdef\")\n// 3\nfunction split_words($txt) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return split_words(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"Hello world!\") !== array(\"Hello\", \"world!\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Hello,world!\") !== array(\"Hello\", \"world!\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Hello world,!\") !== array(\"Hello\", \"world,!\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Hello,Hello,world !\") !== array(\"Hello,Hello,world\", \"!\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcdef\") !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"aaabb\") !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"aaaBb\") !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"\") !== 0) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "php", - "prompt": ">> fibfib(1)\n// 0\n// >>> fibfib(5)\n// 4\n// >>> fibfib(8)\n// 24\nfunction fibfib($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return fibfib(...$args);\n}\n\nfunction test(): void {\n if (candidate(2) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(1) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(5) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(8) !== 24) { throw new Exception(\"Test failed!\"); }\n if (candidate(10) !== 81) { throw new Exception(\"Test failed!\"); }\n if (candidate(12) !== 274) { throw new Exception(\"Test failed!\"); }\n if (candidate(14) !== 927) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "php", - "prompt": ">> lst(array(1.0, 2.0, 3.0))\n// 14\n// >>> lst(array(1.0, 4.0, 9.0))\n// 98\n// >>> lst(array(1.0, 3.0, 5.0, 7.0))\n// 84\n// >>> lst(array(1.4, 4.2, 0.0))\n// 29\n// >>> lst(array(-2.4, 1.0, 1.0))\n// 6\nfunction sum_squares($lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return sum_squares(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1.0, 2.0, 3.0)) !== 14) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 2.0, 3.0)) !== 14) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 3.0, 5.0, 7.0)) !== 84) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.4, 4.2, 0.0)) !== 29) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-2.4, 1.0, 1.0)) !== 6) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(100.0, 1.0, 15.0, 2.0)) !== 10230) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(10000.0, 10000.0)) !== 200000000) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1.4, 4.6, 6.3)) !== 75) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1.4, 17.9, 18.9, 19.9)) !== 1086) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0.0)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1.0)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1.0, 1.0, 0.0)) !== 2) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_85_add", - "language": "php", - "prompt": ">> add(array(4, 2, 6, 7))\n// 2\nfunction add($lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return add(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(4, 88)) !== 88) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 5, 6, 7, 2, 122)) !== 122) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 0, 6, 7)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(4, 4, 6, 8)) !== 12) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "php", - "prompt": ">> unique(array(5, 3, 5, 2, 3, 3, 9, 0, 123))\n// array(0, 2, 3, 5, 9, 123)\nfunction unique($l) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return unique(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(5, 3, 5, 2, 3, 3, 9, 0, 123)) !== array(0, 2, 3, 5, 9, 123)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "php", - "prompt": ">> fix_spaces(\" Example\")\n// \"Example\"\n// >>> fix_spaces(\" Example 1\")\n// \"Example_1\"\n// >>> fix_spaces(\" Example 2\")\n// \"_Example_2\"\n// >>> fix_spaces(\" Example 3\")\n// \"_Example-3\"\nfunction fix_spaces($text) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return fix_spaces(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"Example\") !== \"Example\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Mudasir Hanif \") !== \"Mudasir_Hanif_\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Yellow Yellow Dirty Fellow\") !== \"Yellow_Yellow__Dirty__Fellow\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Exa mple\") !== \"Exa-mple\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\" Exa 1 2 2 mple\") !== \"-Exa_1_2_2_mple\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "php", - "prompt": ">> modp(3, 5)\n// 3\n// >>> modp(1101, 101)\n// 2\n// >>> modp(0, 101)\n// 1\n// >>> modp(3, 11)\n// 8\n// >>> modp(100, 101)\n// 1\nfunction modp($n, $p) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return modp(...$args);\n}\n\nfunction test(): void {\n if (candidate(3, 5) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(1101, 101) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(0, 101) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(3, 11) !== 8) { throw new Exception(\"Test failed!\"); }\n if (candidate(100, 101) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(30, 5) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(31, 5) !== 3) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "php", - "prompt": ">> valid_date(\"03-11-2000\")\n// true\n// >>> valid_date(\"15-01-2012\")\n// false\n// >>> valid_date(\"04-0-2040\")\n// false\n// >>> valid_date(\"06-04-2020\")\n// true\n// >>> valid_date(\"06/04/2020\")\n// false\nfunction valid_date($date) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return valid_date(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"03-11-2000\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"15-01-2012\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"04-0-2040\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"06-04-2020\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"01-01-2007\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"03-32-2011\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"04-31-3000\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"06-06-2005\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"21-31-2000\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"04-12-2003\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"04122003\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"20030412\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"2003-04\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"2003-04-12\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"04-2003\") !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "php", - "prompt": ">> anti_shuffle(\"Hi\")\n// \"Hi\"\n// >>> anti_shuffle(\"hello\")\n// \"ehllo\"\n// >>> anti_shuffle(\"Hello World!!!\")\n// \"Hello !!!Wdlor\"\nfunction anti_shuffle($s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return anti_shuffle(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"Hi\") !== \"Hi\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"hello\") !== \"ehllo\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"number\") !== \"bemnru\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcd\") !== \"abcd\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Hello World!!!\") !== \"Hello !!!Wdlor\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Hi. My name is Mister Robot. How are you?\") !== \".Hi My aemn is Meirst .Rboot How aer ?ouy\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "php", - "prompt": ">> is_sorted(array(5))\n// true\n// >>> is_sorted(array(1, 2, 3, 4, 5))\n// true\n// >>> is_sorted(array(1, 3, 2, 4, 5))\n// false\n// >>> is_sorted(array(1, 2, 3, 4, 5, 6))\n// true\n// >>> is_sorted(array(1, 2, 3, 4, 5, 6, 7))\n// true\n// >>> is_sorted(array(1, 3, 2, 4, 5, 6, 7))\n// false\n// >>> is_sorted(array(1, 2, 2, 3, 3, 4))\n// true\n// >>> is_sorted(array(1, 2, 2, 2, 3, 4))\n// false\nfunction is_sorted($lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return is_sorted(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(5)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4, 5)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 3, 2, 4, 5)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4, 5, 6)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4, 5, 6, 7)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 3, 2, 4, 5, 6, 7)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 2, 1)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 2, 2, 3, 4)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 3, 3, 4)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 2, 3, 3, 4)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4)) !== true) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "php", - "prompt": ">> is_happy(\"a\")\n// false\n// >>> is_happy(\"aa\")\n// false\n// >>> is_happy(\"abcd\")\n// true\n// >>> is_happy(\"aabb\")\n// false\n// >>> is_happy(\"adb\")\n// true\n// >>> is_happy(\"xyy\")\n// false\nfunction is_happy($s) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return is_happy(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"a\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"aa\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcd\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"aabb\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"adb\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"xyy\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"iopaxpoi\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"iopaxioi\") !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "php", - "prompt": ">> will_it_fly(array(1, 2), 5)\n// false\n// # 1+2 is less than the maximum possible weight, but it's unbalanced.\n// >>> will_it_fly(array(3, 2, 3), 1)\n// false\n// # it's balanced, but 3+2+3 is more than the maximum possible weight.\n// >>> will_it_fly(array(3, 2, 3), 9)\n// true\n// # 3+2+3 is less than the maximum possible weight, and it's balanced.\n// >>> will_it_fly(array(3), 5)\n// true\n// # 3 is less than the maximum possible weight, and it's balanced.\nfunction will_it_fly($q, $w) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return will_it_fly(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(3, 2, 3), 9) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2), 5) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3), 5) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 2, 3), 1) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3), 6) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5), 5) !== true) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "php", - "prompt": ">> sort_array(array())\n// array()\n// >>> sort_array(array(5))\n// array(5)\n// >>> sort_array(array(2, 4, 3, 0, 1, 5))\n// array(0, 1, 2, 3, 4, 5)\n// >>> sort_array(array(2, 4, 3, 0, 1, 5, 6))\n// array(6, 5, 4, 3, 2, 1, 0)\nfunction sort_array($array) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return sort_array(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(5)) !== array(5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 4, 3, 0, 1, 5)) !== array(0, 1, 2, 3, 4, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 4, 3, 0, 1, 5, 6)) !== array(6, 5, 4, 3, 2, 1, 0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(2, 1)) !== array(1, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(15, 42, 87, 32, 11, 0)) !== array(0, 11, 15, 32, 42, 87)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(21, 14, 23, 11)) !== array(23, 21, 14, 11)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "php", - "prompt": ">> count_up_to(5)\n// array(2, 3)\n// >>> count_up_to(11)\n// array(2, 3, 5, 7)\n// >>> count_up_to(0)\n// array()\n// >>> count_up_to(20)\n// array(2, 3, 5, 7, 11, 13, 17, 19)\n// >>> count_up_to(1)\n// array()\n// >>> count_up_to(18)\n// array(2, 3, 5, 7, 11, 13, 17)\nfunction count_up_to($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return count_up_to(...$args);\n}\n\nfunction test(): void {\n if (candidate(5) !== array(2, 3)) { throw new Exception(\"Test failed!\"); }\n if (candidate(6) !== array(2, 3, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(7) !== array(2, 3, 5)) { throw new Exception(\"Test failed!\"); }\n if (candidate(10) !== array(2, 3, 5, 7)) { throw new Exception(\"Test failed!\"); }\n if (candidate(0) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(22) !== array(2, 3, 5, 7, 11, 13, 17, 19)) { throw new Exception(\"Test failed!\"); }\n if (candidate(1) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(18) !== array(2, 3, 5, 7, 11, 13, 17)) { throw new Exception(\"Test failed!\"); }\n if (candidate(47) !== array(2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43)) { throw new Exception(\"Test failed!\"); }\n if (candidate(101) !== array(2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "php", - "prompt": ">> longest(array())\n// null\n// >>> longest(array(\"a\", \"b\", \"c\"))\n// \"a\"\n// >>> longest(array(\"a\", \"bb\", \"ccc\"))\n// \"ccc\"\nfunction longest($strings) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return longest(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== null) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"x\", \"y\", \"z\")) !== \"x\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\")) !== \"zzzz\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "php", - "prompt": ">> by_length(array(2, 1, 1, 4, 5, 8, 2, 3))\n// array(\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\")\n// If the array is empty, return an empty array:\n// >>> by_length(array())\n// array()\n// If the array has any strange number ignore it:\n// >>> by_length(array(1, -1, 55))\n// array(\"One\")\nfunction by_length($arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return by_length(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(2, 1, 1, 4, 5, 8, 2, 3)) !== array(\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array()) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, -1, 55)) !== array(\"One\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, -1, 3, 2)) !== array(\"Three\", \"Two\", \"One\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(9, 4, 8)) !== array(\"Nine\", \"Eight\", \"Four\")) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_106_f", - "language": "php", - "prompt": ">> f(5)\n// array(1, 2, 6, 24, 15)\nfunction f($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return f(...$args);\n}\n\nfunction test(): void {\n if (candidate(5) !== array(1, 2, 6, 24, 15)) { throw new Exception(\"Test failed!\"); }\n if (candidate(7) !== array(1, 2, 6, 24, 15, 720, 28)) { throw new Exception(\"Test failed!\"); }\n if (candidate(1) !== array(1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(3) !== array(1, 2, 6)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "php", - "prompt": ">> fizz_buzz(50)\n// 0\n// >>> fizz_buzz(78)\n// 2\n// >>> fizz_buzz(79)\n// 3\nfunction fizz_buzz($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return fizz_buzz(...$args);\n}\n\nfunction test(): void {\n if (candidate(50) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(78) !== 2) { throw new Exception(\"Test failed!\"); }\n if (candidate(79) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(100) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(200) !== 6) { throw new Exception(\"Test failed!\"); }\n if (candidate(4000) !== 192) { throw new Exception(\"Test failed!\"); }\n if (candidate(10000) !== 639) { throw new Exception(\"Test failed!\"); }\n if (candidate(100000) !== 8026) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "php", - "prompt": ">> truncate_number(3.5)\n// 0.5\nfunction truncate_number($number) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return truncate_number(...$args);\n}\n\nfunction test(): void {\n if (candidate(3.5) !== 0.5) { throw new Exception(\"Test failed!\"); }\n if (candidate(1.25) !== 0.25) { throw new Exception(\"Test failed!\"); }\n if (candidate(123.0) !== 0.0) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "php", - "prompt": ">> sum_product(array())\n// array(0, 1)\n// >>> sum_product(array(1, 2, 3, 4))\n// array(10, 24)\nfunction sum_product($numbers) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return sum_product(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== array(0, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 1, 1)) !== array(3, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(100, 0)) !== array(100, 0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 5, 7)) !== array(15, 105)) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(10)) !== array(10, 10)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "php", - "prompt": ">> get_row(array(array(1, 2, 3, 4, 5, 6), array(1, 2, 3, 4, 1, 6), array(1, 2, 3, 4, 5, 1)), 1)\n// array(array(0, 0), array(1, 4), array(1, 0), array(2, 5), array(2, 0))\n// >>> get_row(array(), 1)\n// array()\n// >>> get_row(array(array(), array(1), array(1, 2, 3)), 3)\n// array(array(2, 2))\nfunction get_row($lst, $x) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return get_row(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(array(1, 2, 3, 4, 5, 6), array(1, 2, 3, 4, 1, 6), array(1, 2, 3, 4, 5, 1)), 1) !== array(array(0, 0), array(1, 4), array(1, 0), array(2, 5), array(2, 0))) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(1, 2, 3, 4, 5, 6), array(1, 2, 3, 4, 5, 6), array(1, 2, 3, 4, 5, 6), array(1, 2, 3, 4, 5, 6), array(1, 2, 3, 4, 5, 6), array(1, 2, 3, 4, 5, 6)), 2) !== array(array(0, 1), array(1, 1), array(2, 1), array(3, 1), array(4, 1), array(5, 1))) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(1, 2, 3, 4, 5, 6), array(1, 2, 3, 4, 5, 6), array(1, 1, 3, 4, 5, 6), array(1, 2, 1, 4, 5, 6), array(1, 2, 3, 1, 5, 6), array(1, 2, 3, 4, 1, 6), array(1, 2, 3, 4, 5, 1)), 1) !== array(array(0, 0), array(1, 0), array(2, 1), array(2, 0), array(3, 2), array(3, 0), array(4, 3), array(4, 0), array(5, 4), array(5, 0), array(6, 5), array(6, 0))) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(), 1) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(1)), 2) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(array(), array(1), array(1, 2, 3)), 3) !== array(array(2, 2))) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "php", - "prompt": ">> eat(5, 6, 10)\n// array(11, 4)\n// >>> eat(4, 8, 9)\n// array(12, 1)\n// >>> eat(1, 10, 10)\n// array(11, 0)\n// >>> eat(2, 11, 5)\n// array(7, 0)\n// Variables:\n// @number : integer\n// the number of carrots that you have eaten.\n// @need : integer\n// the number of carrots that you need to eat.\n// @remaining : integer\n// the number of remaining carrots thet exist in stock\n// Constrain:\n// * 0 <= number <= 1000\n// * 0 <= need <= 1000\n// * 0 <= remaining <= 1000\n// Have fun :)\nfunction eat($number, $need, $remaining) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return eat(...$args);\n}\n\nfunction test(): void {\n if (candidate(5, 6, 10) !== array(11, 4)) { throw new Exception(\"Test failed!\"); }\n if (candidate(4, 8, 9) !== array(12, 1)) { throw new Exception(\"Test failed!\"); }\n if (candidate(1, 10, 10) !== array(11, 0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(2, 11, 5) !== array(7, 0)) { throw new Exception(\"Test failed!\"); }\n if (candidate(4, 5, 7) !== array(9, 2)) { throw new Exception(\"Test failed!\"); }\n if (candidate(4, 5, 1) !== array(5, 0)) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "php", - "prompt": ">> solve(1000)\n// \"1\"\n// >>> solve(150)\n// \"110\"\n// >>> solve(147)\n// \"1100\"\n// Variables:\n// @N integer\n// Constraints: 0 \u2264 N \u2264 10000.\n// Output:\n// a string of binary number\nfunction solve($N) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return solve(...$args);\n}\n\nfunction test(): void {\n if (candidate(1000) !== \"1\") { throw new Exception(\"Test failed!\"); }\n if (candidate(150) !== \"110\") { throw new Exception(\"Test failed!\"); }\n if (candidate(147) !== \"1100\") { throw new Exception(\"Test failed!\"); }\n if (candidate(333) !== \"1001\") { throw new Exception(\"Test failed!\"); }\n if (candidate(963) !== \"10010\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "php", - "prompt": ">> skjkasdkd(array(0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3))\n// 10\n// >>> skjkasdkd(array(1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1))\n// 25\n// >>> skjkasdkd(array(1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3))\n// 13\n// >>> skjkasdkd(array(0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6))\n// 11\n// >>> skjkasdkd(array(0, 81, 12, 3, 1, 21))\n// 3\n// >>> skjkasdkd(array(0, 8, 1, 2, 1, 7))\n// 7\nfunction skjkasdkd($lst) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return skjkasdkd(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3)) !== 10) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1)) !== 25) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3)) !== 13) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6)) !== 11) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0, 81, 12, 3, 1, 21)) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0, 8, 1, 2, 1, 7)) !== 7) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(8191)) !== 19) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(8191, 123456, 127, 7)) !== 19) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(127, 97, 8192)) !== 10) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "php", - "prompt": ">> smallest_change(array(1, 2, 3, 5, 4, 7, 9, 6))\n// 4\n// >>> smallest_change(array(1, 2, 3, 4, 3, 2, 2))\n// 1\n// >>> smallest_change(array(1, 2, 3, 2, 1))\n// 0\nfunction smallest_change($arr) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return smallest_change(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2, 3, 5, 4, 7, 9, 6)) !== 4) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 4, 3, 2, 2)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 4, 2)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 4, 4, 2)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, 3, 2, 1)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(3, 1, 1, 3)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0, 1)) !== 1) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "php", - "prompt": " 3.7 A \n// > 3.3 A- \n// > 3.0 B+\n// > 2.7 B \n// > 2.3 B-\n// > 2.0 C+\n// > 1.7 C\n// > 1.3 C-\n// > 1.0 D+ \n// > 0.7 D \n// > 0.0 D-\n// 0.0 E\n// Example:\n// >>> grade_equation(array(4.0, 3, 1.7, 2, 3.5))\n// array(\"A+\", \"B\", \"C-\", \"C\", \"A-\")\nfunction numerical_letter_grade($grades) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return numerical_letter_grade(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(4.0, 3, 1.7, 2, 3.5)) !== array(\"A+\", \"B\", \"C-\", \"C\", \"A-\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.2)) !== array(\"D+\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0.5)) !== array(\"D-\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0.0)) !== array(\"E\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1.0, 0.3, 1.5, 2.8, 3.3)) !== array(\"D\", \"D-\", \"C-\", \"B\", \"B+\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0.0, 0.7)) !== array(\"E\", \"D-\")) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "php", - "prompt": ">> triangle_area(3, 4, 5)\n// 6.0\n// >>> triangle_area(1, 2, 10)\n// -1\nfunction triangle_area($a, $b, $c) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return triangle_area(...$args);\n}\n\nfunction test(): void {\n if (candidate(3, 4, 5) !== 6.0) { throw new Exception(\"Test failed!\"); }\n if (candidate(1, 2, 10) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(4, 8, 5) !== 8.18) { throw new Exception(\"Test failed!\"); }\n if (candidate(2, 2, 2) !== 1.73) { throw new Exception(\"Test failed!\"); }\n if (candidate(1, 2, 3) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(10, 5, 7) !== 16.25) { throw new Exception(\"Test failed!\"); }\n if (candidate(2, 6, 3) !== -1) { throw new Exception(\"Test failed!\"); }\n if (candidate(1, 1, 1) !== 0.43) { throw new Exception(\"Test failed!\"); }\n if (candidate(2, 2, 10) !== -1) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "php", - "prompt": ">> same_chars(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\")\n// true\n// >>> same_chars(\"abcd\", \"dddddddabc\")\n// true\n// >>> same_chars(\"dddddddabc\", \"abcd\")\n// true\n// >>> same_chars(\"eabcd\", \"dddddddabc\")\n// false\n// >>> same_chars(\"abcd\", \"dddddddabce\")\n// false\n// >>> same_chars(\"eabcdzzzz\", \"dddzzzzzzzddddabc\")\n// false\nfunction same_chars($s0, $s1) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return same_chars(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcd\", \"dddddddabc\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"dddddddabc\", \"abcd\") !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"eabcd\", \"dddddddabc\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcd\", \"dddddddabcf\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"eabcdzzzz\", \"dddzzzzzzzddddabc\") !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"aabb\", \"aaccc\") !== false) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "php", - "prompt": ">> minSubArraySum(array(2, 3, 4, 1, 2, 4))\n// 1\n// >>> minSubArraySum(array(-1, -2, -3))\n// -6\nfunction minSubArraySum($nums) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return minSubArraySum(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(2, 3, 4, 1, 2, 4)) !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, -2, -3)) !== -6) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, -2, -3, 2, -10)) !== -14) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-9999999999999999)) !== -9999999999999999) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(0, 10, 20, 1000000)) !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, -2, -3, 10, -5)) !== -6) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(100, -1, -2, -3, 10, -5)) !== -6) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(10, 11, 13, 8, 3, 4)) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(100, -33, 32, -1, 0, -2)) !== -33) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-10)) !== -10) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(7)) !== 7) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, -1)) !== -1) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "php", - "prompt": ">> select_words(\"Mary had a little lamb\", 4)\n// array(\"little\")\n// >>> select_words(\"Mary had a little lamb\", 3)\n// array(\"Mary\", \"lamb\")\n// >>> select_words(\"simple white space\", 2)\n// array()\n// >>> select_words(\"Hello world\", 4)\n// array(\"world\")\n// >>> select_words(\"Uncle sam\", 3)\n// array(\"Uncle\")\nfunction select_words($s, $n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return select_words(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"Mary had a little lamb\", 4) !== array(\"little\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Mary had a little lamb\", 3) !== array(\"Mary\", \"lamb\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"simple white space\", 2) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Hello world\", 4) !== array(\"world\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Uncle sam\", 3) !== array(\"Uncle\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"\", 4) !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"a b c d e f\", 1) !== array(\"b\", \"c\", \"d\", \"f\")) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "php", - "prompt": ">> all_prefixes(\"abc\")\n// array(\"a\", \"ab\", \"abc\")\nfunction all_prefixes($string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return all_prefixes(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\") !== array()) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"asdfgh\") !== array(\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\")) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"WWW\") !== array(\"W\", \"WW\", \"WWW\")) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "php", - "prompt": ">> closest_integer(\"10\")\n// 10\n// >>> closest_integer(\"15.3\")\n// 15\n// Note:\n// Rounding away from zero means that if the given number is equidistant\n// from two integers, the one you should return is the one that is the\n// farthest from zero. For example closest_integer(\"14.5\") should\n// return 15 and closest_integer(\"-14.5\") should return -15.\nfunction closest_integer($value) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return closest_integer(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"10\") !== 10) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"14.5\") !== 15) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"-15.5\") !== -16) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"15.3\") !== 15) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"0\") !== 0) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "php", - "prompt": ">> file_name_check(\"example.txt\")\n// \"Yes\"\n// >>> file_name_check(\"1example.dll\")\n// \"No\"\nfunction file_name_check($file_name) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return file_name_check(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"example.txt\") !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1example.dll\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"s1sdf3.asd\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"K.dll\") !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"MY16FILE3.exe\") !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"His12FILE94.exe\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"_Y.txt\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"?aREYA.exe\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"/this_is_valid.dll\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"this_is_valid.wow\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"this_is_valid.txt\") !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"this_is_valid.txtexe\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"#this2_i4s_5valid.ten\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"@this1_is6_valid.exe\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"this_is_12valid.6exe4.txt\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"all.exe.txt\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"I563_No.exe\") !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Is3youfault.txt\") !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"no_one#knows.dll\") !== \"Yes\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"1I563_Yes3.exe\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"I563_Yes3.txtt\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"final..txt\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"final132\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"_f4indsartal132.\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\".txt\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"s.\") !== \"No\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "php", - "prompt": ">> intersection(array(1, 2), array(2, 3))\n// \"NO\"\n// >>> intersection(array(-1, 1), array(0, 4))\n// \"NO\"\n// >>> intersection(array(-3, -1), array(-5, 5))\n// \"YES\"\nfunction intersection($interval1, $interval2) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return intersection(...$args);\n}\n\nfunction test(): void {\n if (candidate(array(1, 2), array(2, 3)) !== \"NO\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-1, 1), array(0, 4)) !== \"NO\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-3, -1), array(-5, 5)) !== \"YES\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-2, 2), array(-4, 0)) !== \"YES\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-11, 2), array(-1, -1)) !== \"NO\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2), array(3, 5)) !== \"NO\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2), array(1, 2)) !== \"NO\") { throw new Exception(\"Test failed!\"); }\n if (candidate(array(-2, -2), array(-3, -2)) !== \"NO\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "php", - "prompt": " 1 and is not a prime.\n// >>> largest_prime_factor(13195)\n// 29\n// >>> largest_prime_factor(2048)\n// 2\nfunction largest_prime_factor($n) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return largest_prime_factor(...$args);\n}\n\nfunction test(): void {\n if (candidate(15) !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(27) !== 3) { throw new Exception(\"Test failed!\"); }\n if (candidate(63) !== 7) { throw new Exception(\"Test failed!\"); }\n if (candidate(330) !== 11) { throw new Exception(\"Test failed!\"); }\n if (candidate(13195) !== 29) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "php", - "prompt": ">> count_distinct_characters(\"xyzXYZ\")\n// 3\n// >>> count_distinct_characters(\"Jerry\")\n// 4\nfunction count_distinct_characters($string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return count_distinct_characters(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\") !== 0) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcde\") !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"abcdecadeCADE\") !== 5) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"aaaaAAAAaaaa\") !== 1) { throw new Exception(\"Test failed!\"); }\n if (candidate(\"Jerry jERRY JeRRRY\") !== 5) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "php", - "prompt": ">> below_zero(array(1, 2, 3))\n// false\n// >>> below_zero(array(1, 2, -4, 5))\n// true\nfunction below_zero($operations) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return below_zero(...$args);\n}\n\nfunction test(): void {\n if (candidate(array()) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, -3, 1, 2, -3)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, 2, -4, 5, 6)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, -1, 2, -2, 5, -5, 4, -4)) !== false) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, -1, 2, -2, 5, -5, 4, -5)) !== true) { throw new Exception(\"Test failed!\"); }\n if (candidate(array(1, -2, 2, -2, 5, -5, 4, -4)) !== true) { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "php", - "prompt": ">> make_palindrome(\"\")\n// \"\"\n// >>> make_palindrome(\"cat\")\n// \"catac\"\n// >>> make_palindrome(\"cata\")\n// \"catac\"\nfunction make_palindrome($string) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return make_palindrome(...$args);\n}\n\nfunction test(): void {\n if (candidate(\"\") !== \"\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"x\") !== \"x\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"xyz\") !== \"xyzyx\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"xyx\") !== \"xyx\") { throw new Exception(\"Test failed!\"); }\n if (candidate(\"jerry\") !== \"jerryrrej\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "php", - "prompt": ">> int_to_mini_roman(19)\n// \"xix\"\n// >>> int_to_mini_roman(152)\n// \"clii\"\n// >>> int_to_mini_roman(426)\n// \"cdxxvi\"\nfunction int_to_mini_roman($number) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "function candidate(...$args) {\n return int_to_mini_roman(...$args);\n}\n\nfunction test(): void {\n if (candidate(19) !== \"xix\") { throw new Exception(\"Test failed!\"); }\n if (candidate(152) !== \"clii\") { throw new Exception(\"Test failed!\"); }\n if (candidate(251) !== \"ccli\") { throw new Exception(\"Test failed!\"); }\n if (candidate(426) !== \"cdxxvi\") { throw new Exception(\"Test failed!\"); }\n if (candidate(500) !== \"d\") { throw new Exception(\"Test failed!\"); }\n if (candidate(1) !== \"i\") { throw new Exception(\"Test failed!\"); }\n if (candidate(4) !== \"iv\") { throw new Exception(\"Test failed!\"); }\n if (candidate(43) !== \"xliii\") { throw new Exception(\"Test failed!\"); }\n if (candidate(90) !== \"xc\") { throw new Exception(\"Test failed!\"); }\n if (candidate(94) !== \"xciv\") { throw new Exception(\"Test failed!\"); }\n if (candidate(532) !== \"dxxxii\") { throw new Exception(\"Test failed!\"); }\n if (candidate(900) !== \"cm\") { throw new Exception(\"Test failed!\"); }\n if (candidate(994) !== \"cmxciv\") { throw new Exception(\"Test failed!\"); }\n if (candidate(1000) !== \"m\") { throw new Exception(\"Test failed!\"); }\n}\n\ntest();", - "stop_tokens": [ - "\nfunction", - "\n?>", - "\n//", - "\n#" - ] - } -] \ No newline at end of file diff --git a/data/pl-keep.json b/data/pl-keep.json deleted file mode 100644 index 1aea4770e75ee5fea54884259857a7b68ee34e0c..0000000000000000000000000000000000000000 --- a/data/pl-keep.json +++ /dev/null @@ -1,2256 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "pl", - "prompt": "# For a given number n, find the largest number that divides n evenly, smaller than n\n# >>> largest_divisor(15)\n# 5\nsub largest_divisor {\n my($n) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&largest_divisor;\n if(eq_deeply($candidate->(3),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(100),50)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(49),7)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_47_median", - "language": "pl", - "prompt": "# Return median of elements in the list l.\n# >>> median([3, 1, 2, 4, 5])\n# 3\n# >>> median([-10, 4, 6, 1000, 10, 20])\n# 15.0\nsub median {\n my($l) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&median;\n if(eq_deeply($candidate->([3, 1, 2, 4, 5]),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-10, 4, 6, 1000, 10, 20]),8.0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5]),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([6, 5]),5.5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([8, 1, 3, 9, 9, 2, 7]),7)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "pl", - "prompt": "# Given two lists operator, and operand. The first list has basic algebra operations, and \n# the second list is a list of integers. Use the two given lists to build the algebric \n# expression and return the evaluation of this expression.\n# The basic algebra operations:\n# Addition ( + ) \n# Subtraction ( - ) \n# Multiplication ( * ) \n# Floor division ( // ) \n# Exponentiation ( ** ) \n# Example:\n# operator['+', '*', '-']\n# array = [2, 3, 4, 5]\n# result = 2 + 3 * 4 - 5\n# => result = 9\n# Note:\n# The length of operator list is equal to the length of operand list minus one.\n# Operand is a list of of non-negative integers.\n# Operator list has at least one operator, and operand list has at least two operands.\nsub do_algebra {\n my($operator, $operand) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&do_algebra;\n if(eq_deeply($candidate->([\"**\", \"*\", \"+\"], [2, 3, 4, 5]),37)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"+\", \"*\", \"-\"], [2, 3, 4, 5]),9)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"//\", \"*\"], [7, 3, 4]),8)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "pl", - "prompt": "# Return maximum element in the list.\n# >>> max_element([1, 2, 3])\n# 3\n# >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n# 123\nsub max_element {\n my($l) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&max_element;\n if(eq_deeply($candidate->([1, 2, 3]),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]),124)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "pl", - "prompt": "# Create a function which returns the largest index of an element which\n# is not greater than or equal to the element immediately preceding it. If\n# no such element exists then return -1. The given array will not contain\n# duplicate values.\n# Examples:\n# can_arrange([1,2,4,3,5]) = 3\n# can_arrange([1,2,3]) = -1\nsub can_arrange {\n my($arr) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&can_arrange;\n if(eq_deeply($candidate->([1, 2, 4, 3, 5]),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 4, 5]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 4, 2, 5, 6, 7, 8, 9, 10]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 8, 5, 7, 3]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "pl", - "prompt": "# Imagine a road that's a perfectly straight infinitely long line.\n# n cars are driving left to right; simultaneously, a different set of n cars\n# are driving right to left. The two sets of cars start out being very far from\n# each other. All cars move in the same speed. Two cars are said to collide\n# when a car that's moving left to right hits a car that's moving right to left.\n# However, the cars are infinitely sturdy and strong; as a result, they continue moving\n# in their trajectory as if they did not collide.\n# This function outputs the number of such collisions.\nsub car_race_collision {\n my($n) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&car_race_collision;\n if(eq_deeply($candidate->(2),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3),9)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4),16)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),64)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),100)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "pl", - "prompt": "# Create a function that returns True if the last character\n# of a given string is an alphabetical character and is not\n# a part of a word, and False otherwise.\n# Note: \"word\" is a group of characters separated by space.\n# Examples:\n# check_if_last_char_is_a_letter(\"apple pie\") \u279e False\n# check_if_last_char_is_a_letter(\"apple pi e\") \u279e True\n# check_if_last_char_is_a_letter(\"apple pi e \") \u279e False\n# check_if_last_char_is_a_letter(\"\") \u279e False\nsub check_if_last_char_is_a_letter {\n my($txt) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&check_if_last_char_is_a_letter;\n if(eq_deeply($candidate->(\"apple\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"apple pi e\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"eeeee\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"A\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Pumpkin pie \"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Pumpkin pie 1\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"eeeee e \"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"apple pie\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"apple pi e \"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "pl", - "prompt": "# Return true if a given number is prime, and false otherwise.\n# >>> is_prime(6)\n# False\n# >>> is_prime(101)\n# True\n# >>> is_prime(11)\n# True\n# >>> is_prime(13441)\n# True\n# >>> is_prime(61)\n# True\n# >>> is_prime(4)\n# False\n# >>> is_prime(1)\n# False\nsub is_prime {\n my($n) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_prime;\n if(eq_deeply($candidate->(6),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(101),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(11),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(13441),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(61),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(11),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(17),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(85),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(77),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(255379),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "pl", - "prompt": "# Given a list of positive integers x. return a sorted list of all \n# elements that hasn't any even digit.\n# Note: Returned list should be sorted in increasing order.\n# For example:\n# >>> unique_digits([15, 33, 1422, 1])\n# [1, 15, 33]\n# >>> unique_digits([152, 323, 1422, 10])\n# []\nsub unique_digits {\n my($x) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&unique_digits;\n if(eq_deeply($candidate->([15, 33, 1422, 1]),[1, 15, 33])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([152, 323, 1422, 10]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([12345, 2033, 111, 151]),[111, 151])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([135, 103, 31]),[31, 135])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "pl", - "prompt": "# Input are two strings a and b consisting only of 1s and 0s.\n# Perform binary XOR on these inputs and return result also as a string.\n# >>> string_xor('010', '110')\n# '100'\nsub string_xor {\n my($a, $b) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&string_xor;\n if(eq_deeply($candidate->(\"111000\", \"101010\"),\"010010\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1\", \"1\"),\"0\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"0101\", \"0000\"),\"0101\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "pl", - "prompt": "# sum_to_n is a function that sums numbers from 1 to n.\n# >>> sum_to_n(30)\n# 465\n# >>> sum_to_n(100)\n# 5050\n# >>> sum_to_n(5)\n# 15\n# >>> sum_to_n(10)\n# 55\n# >>> sum_to_n(1)\n# 1\nsub sum_to_n {\n my($n) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sum_to_n;\n if(eq_deeply($candidate->(1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6),21)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(11),66)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(30),465)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(100),5050)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "pl", - "prompt": "# Given a list of numbers, return the sum of squares of the numbers\n# in the list that are odd. Ignore numbers that are negative or not integers.\n# double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10\n# double_the_difference([-1, -2, 0]) == 0\n# double_the_difference([9, -2]) == 81\n# double_the_difference([0]) == 0 \n# If the input list is empty, return 0.\nsub double_the_difference {\n my($lst) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&double_the_difference;\n if(eq_deeply($candidate->([]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5.0, 4.0]),25)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0.1, 0.2, 0.3]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-10.0, -20.0, -30.0]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1.0, -2.0, 8.0]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0.2, 3.0, 5.0]),34)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]),165)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "pl", - "prompt": "# Return length of given string\n# >>> strlen('')\n# 0\n# >>> strlen('abc')\n# 3\nsub strlen {\n my($string) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&strlen;\n if(eq_deeply($candidate->(\"\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"x\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"asdasnakj\"),9)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "pl", - "prompt": "# You'll be given a string of words, and your task is to count the number\n# of boredoms. A boredom is a sentence that starts with the word \"I\".\n# Sentences are delimited by '.', '?' or '!'.\n# For example:\n# >>> is_bored(\"Hello world\")\n# 0\n# >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n# 1\nsub is_bored {\n my($S) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_bored;\n if(eq_deeply($candidate->(\"Hello world\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Is the sky blue?\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"I love It !\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"bIt\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"I feel good today. I will be productive. will kill It\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"You and I are going for a walk\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "pl", - "prompt": "# Write a function vowels_count which takes a string representing\n# a word as input and returns the number of vowels in the string.\n# Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n# vowel, but only when it is at the end of the given word.\n# Example:\n# >>> vowels_count(\"abcde\")\n# 2\n# >>> vowels_count(\"ACEDY\")\n# 3\nsub vowels_count {\n my($s) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&vowels_count;\n if(eq_deeply($candidate->(\"abcde\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Alone\"),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"key\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"bye\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"keY\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"bYe\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ACEDY\"),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "pl", - "prompt": "# Return n-th Fibonacci number.\n# >>> fib(10)\n# 55\n# >>> fib(1)\n# 1\n# >>> fib(8)\n# 21\nsub fib {\n my($n) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&fib;\n if(eq_deeply($candidate->(10),55)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),21)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(11),89)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12),144)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "pl", - "prompt": "# Your task is to implement a function that will simplify the expression\n# x * n. The function returns True if x * n evaluates to a whole number and False\n# otherwise. Both x and n, are string representation of a fraction, and have the following format,\n# / where both numerator and denominator are positive whole numbers.\n# You can assume that x, and n are valid fractions, and do not have zero as denominator.\n# simplify(\"1/5\", \"5/1\") = True\n# simplify(\"1/6\", \"2/1\") = False\n# simplify(\"7/10\", \"10/2\") = False\nsub simplify {\n my($x, $n) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&simplify;\n if(eq_deeply($candidate->(\"1/5\", \"5/1\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1/6\", \"2/1\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"5/1\", \"3/1\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"7/10\", \"10/2\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2/10\", \"50/10\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"7/2\", \"4/2\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"11/6\", \"6/1\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2/3\", \"5/2\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"5/2\", \"3/5\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2/4\", \"8/4\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2/4\", \"4/2\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1/5\", \"5/1\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1/5\", \"1/5\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "pl", - "prompt": "# Given a string s, count the number of uppercase vowels in even indices.\n# For example:\n# count_upper('aBCdEf') returns 1\n# count_upper('abcdefg') returns 0\n# count_upper('dBBE') returns 0\nsub count_upper {\n my($s) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&count_upper;\n if(eq_deeply($candidate->(\"aBCdEf\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdefg\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"dBBE\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"B\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"U\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"EEEE\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "pl", - "prompt": "# You are given a rectangular grid of wells. Each row represents a single well,\n# and each 1 in a row represents a single unit of water.\n# Each well has a corresponding bucket that can be used to extract water from it, \n# and all buckets have the same capacity.\n# Your task is to use the buckets to empty the wells.\n# Output the number of times you need to lower the buckets.\n# Example 1:\n# Input: \n# grid : [[0,0,1,0], [0,1,0,0], [1,1,1,1]]\n# bucket_capacity : 1\n# Output: 6\n# Example 2:\n# Input: \n# grid : [[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]]\n# bucket_capacity : 2\n# Output: 5\n# Example 3:\n# Input: \n# grid : [[0,0,0], [0,0,0]]\n# bucket_capacity : 5\n# Output: 0\n# Constraints:\n# * all wells have the same length\n# * 1 <= grid.length <= 10^2\n# * 1 <= grid[:,1].length <= 10^2\n# * grid[i][j] -> 0 | 1\n# * 1 <= capacity <= 10\nsub max_fill {\n my($grid, $capacity) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&max_fill;\n if(eq_deeply($candidate->([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1),6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[0, 0, 0], [0, 0, 0]], 5),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1, 1, 1, 1], [1, 1, 1, 1]], 2),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1, 1, 1, 1], [1, 1, 1, 1]], 9),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "pl", - "prompt": "# Given an array arr of integers and a positive integer k, return a sorted list \n# of length k with the maximum k numbers in arr.\n# Example 1:\n# Input: arr = [-3, -4, 5], k = 3\n# Output: [-4, -3, 5]\n# Example 2:\n# Input: arr = [4, -4, 4], k = 2\n# Output: [4, 4]\n# Example 3:\n# Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1\n# Output: [2]\n# Note:\n# 1. The length of the array will be in the range of [1, 1000].\n# 2. The elements in the array will be in the range of [-1000, 1000].\n# 3. 0 <= k <= len(arr)\nsub maximum {\n my($arr, $k) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&maximum;\n if(eq_deeply($candidate->([-3, -4, 5], 3),[-4, -3, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, -4, 4], 2),[4, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-3, 2, 1, 2, -1, -2, 1], 1),[2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([123, -123, 20, 0, 1, 2, -3], 3),[2, 20, 123])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-123, 20, 0, 1, 2, -3], 4),[0, 1, 2, 20])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 15, 0, 3, -13, -8, 0], 7),[-13, -8, 0, 0, 3, 5, 15])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, 0, 2, 5, 3, -10], 2),[3, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 0, 5, -7], 1),[5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, -4], 2),[-4, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-10, 10], 2),[-10, 10])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, -23, 243, -400, 0], 0),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "pl", - "prompt": "# Write a function that takes a message, and encodes in such a \n# way that it swaps case of all letters, replaces all vowels in \n# the message with the letter that appears 2 places ahead of that \n# vowel in the english alphabet. \n# Assume only letters. \n# Examples:\n# >>> encode('test')\n# 'TGST'\n# >>> encode('This is a message')\n# 'tHKS KS C MGSSCGG'\nsub encode {\n my($message) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&encode;\n if(eq_deeply($candidate->(\"TEST\"),\"tgst\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Mudasir\"),\"mWDCSKR\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"YES\"),\"ygs\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"This is a message\"),\"tHKS KS C MGSSCGG\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"I DoNt KnOw WhAt tO WrItE\"),\"k dQnT kNqW wHcT Tq wRkTg\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "pl", - "prompt": "# remove_vowels is a function that takes string and returns string without vowels.\n# >>> remove_vowels('')\n# ''\n# >>> remove_vowels('abcdef')\n# 'bcdf'\n# >>> remove_vowels('aaaaa')\n# ''\n# >>> remove_vowels('aaBAA')\n# 'B'\n# >>> remove_vowels('zbcd')\n# 'zbcd'\nsub remove_vowels {\n my($text) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&remove_vowels;\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdef\nghijklm\"),\"bcdf\nghjklm\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"fedcba\"),\"fdcb\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"eeeee\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"acBAA\"),\"cB\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"EcBOO\"),\"cB\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ybcd\"),\"ybcd\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "pl", - "prompt": "# Return only positive numbers in the list.\n# >>> get_positive([-1, 2, -4, 5, 6])\n# [2, 5, 6]\n# >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n# [5, 3, 2, 3, 9, 123, 1]\nsub get_positive {\n my($l) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&get_positive;\n if(eq_deeply($candidate->([-1, -2, 4, 5, 6]),[4, 5, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]),[5, 3, 2, 3, 3, 9, 123, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -2]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "pl", - "prompt": "# Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n# >>> string_sequence(0)\n# '0'\n# >>> string_sequence(5)\n# '0 1 2 3 4 5'\nsub string_sequence {\n my($n) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&string_sequence;\n if(eq_deeply($candidate->(0),\"0\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3),\"0 1 2 3\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),\"0 1 2 3 4 5 6 7 8 9 10\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "pl", - "prompt": "# Given a positive integer n, you have to make a pile of n levels of stones.\n# The first level has n stones.\n# The number of stones in the next level is:\n# - the next odd number if n is odd.\n# - the next even number if n is even.\n# Return the number of stones in each level in a list, where element at index\n# i represents the number of stones in the level (i+1).\n# Examples:\n# >>> make_a_pile(3)\n# [3, 5, 7]\nsub make_a_pile {\n my($n) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&make_a_pile;\n if(eq_deeply($candidate->(3),[3, 5, 7])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4),[4, 6, 8, 10])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5),[5, 7, 9, 11, 13])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6),[6, 8, 10, 12, 14, 16])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),[8, 10, 12, 14, 16, 18, 20, 22])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "pl", - "prompt": "# Task\n# 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\n# then check if the result string is palindrome.\n# A string is called palindrome if it reads the same backward as forward.\n# You should return a tuple containing the result string and True/False for the check.\n# Example\n# For s = \"abcde\", c = \"ae\", the result should be ('bcd',False)\n# For s = \"abcdef\", c = \"b\" the result should be ('acdef',False)\n# For s = \"abcdedcba\", c = \"ab\", the result should be ('cdedc',True)\nsub reverse_delete {\n my($s, $c) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&reverse_delete;\n if(eq_deeply($candidate->(\"abcde\", \"ae\"),[\"bcd\", \"\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdef\", \"b\"),[\"acdef\", \"\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdedcba\", \"ab\"),[\"cdedc\", 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"dwik\", \"w\"),[\"dik\", \"\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"a\", \"a\"),[\"\", 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdedcba\", \"\"),[\"abcdedcba\", 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdedcba\", \"v\"),[\"abcdedcba\", 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"vabba\", \"v\"),[\"abba\", 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"mamma\", \"mia\"),[\"\", 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "pl", - "prompt": "# For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n# >>> flip_case('Hello')\n# 'hELLO'\nsub flip_case {\n my($string) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&flip_case;\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hello!\"),\"hELLO!\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"These violent delights have violent ends\"),\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "pl", - "prompt": "# You are given a string s.\n# if s[i] is a letter, reverse its case from lower to upper or vise versa, \n# otherwise keep it as it is.\n# If the string contains no letters, reverse the string.\n# The function should return the resulted string.\n# Examples\n# solve(\"1234\") = \"4321\"\n# solve(\"ab\") = \"AB\"\n# solve(\"#a@C\") = \"#A@c\"\nsub solve {\n my($s) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&solve;\n if(eq_deeply($candidate->(\"AsDf\"),\"aSdF\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1234\"),\"4321\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ab\"),\"AB\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"#a@C\"),\"#A@c\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"#AsdfW^45\"),\"#aSDFw^45\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"#6@2\"),\"2@6#\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"#$a^D\"),\"#$A^d\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"#ccc\"),\"#CCC\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "pl", - "prompt": "# Filter an input list of strings only for ones that start with a given prefix.\n# >>> filter_by_prefix([], 'a')\n# []\n# >>> filter_by_prefix(['abc', 'bcd', 'cde', 'array'], 'a')\n# ['abc', 'array']\nsub filter_by_prefix {\n my($strings, $prefix) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&filter_by_prefix;\n if(eq_deeply($candidate->([], \"john\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"),[\"xxx\", \"xxxAAA\", \"xxx\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "pl", - "prompt": "# This function takes two positive numbers x and y and returns the\n# biggest even integer number that is in the range [x, y] inclusive. If \n# there's no such number, then the function should return -1.\n# For example:\n# choose_num(12, 15) = 14\n# choose_num(13, 12) = -1\nsub choose_num {\n my($x, $y) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&choose_num;\n if(eq_deeply($candidate->(12, 15),14)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(13, 12),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(33, 12354),12354)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5234, 5233),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6, 29),28)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(27, 10),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7, 7),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(546, 546),546)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "pl", - "prompt": "# You are given a string representing a sentence,\n# the sentence contains some words separated by a space,\n# and you have to return a string that contains the words from the original sentence,\n# whose lengths are prime numbers,\n# the order of the words in the new string should be the same as the original one.\n# Example 1:\n# Input: sentence = \"This is a test\"\n# Output: \"is\"\n# Example 2:\n# Input: sentence = \"lets go for swimming\"\n# Output: \"go for\"\n# Constraints:\n# * 1 <= len(sentence) <= 100\n# * sentence contains only letters\nsub words_in_sentence {\n my($sentence) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&words_in_sentence;\n if(eq_deeply($candidate->(\"This is a test\"),\"is\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"lets go for swimming\"),\"go for\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"there is no place available here\"),\"there is no place\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hi I am Hussein\"),\"Hi am Hussein\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"go for it\"),\"go for it\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"here\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"here is\"),\"is\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "pl", - "prompt": "# Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n# >>> intersperse([], 4)\n# []\n# >>> intersperse([1, 2, 3], 4)\n# [1, 4, 2, 4, 3]\nsub intersperse {\n my($numbers, $delimeter) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&intersperse;\n if(eq_deeply($candidate->([], 7),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 6, 3, 2], 8),[5, 8, 6, 8, 3, 8, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 2, 2], 2),[2, 2, 2, 2, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "pl", - "prompt": "# Your task is to write a function that returns true if a number x is a simple\n# power of n and false in other cases.\n# x is a simple power of n if n**int=x\n# For example:\n# is_simple_power(1, 4) => true\n# is_simple_power(2, 2) => true\n# is_simple_power(8, 2) => true\n# is_simple_power(3, 2) => false\n# is_simple_power(3, 1) => false\n# is_simple_power(5, 3) => false\nsub is_simple_power {\n my($x, $n) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_simple_power;\n if(eq_deeply($candidate->(16, 2),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(143214, 16),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4, 2),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(9, 3),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(16, 4),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(24, 2),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(128, 4),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12, 6),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 12),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "pl", - "prompt": "# Write a function that returns true if the given number is the multiplication of 3 prime numbers\n# and false otherwise.\n# Knowing that (a) is less then 100. \n# Example:\n# is_multiply_prime(30) == True\n# 30 = 2 * 3 * 5\nsub is_multiply_prime {\n my($a) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_multiply_prime;\n if(eq_deeply($candidate->(5),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(30),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(125),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(105),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(126),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(729),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(891),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1001),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "pl", - "prompt": "# Given the lengths of the three sides of a triangle. Return True if the three\n# sides form a right-angled triangle, False otherwise.\n# A right-angled triangle is a triangle in which one angle is right angle or \n# 90 degree.\n# Example:\n# right_angle_triangle(3, 4, 5) == True\n# right_angle_triangle(1, 2, 3) == False\nsub right_angle_triangle {\n my($a, $b, $c) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&right_angle_triangle;\n if(eq_deeply($candidate->(3, 4, 5),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 2, 3),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10, 6, 8),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 2, 2),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7, 24, 25),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10, 5, 7),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5, 12, 13),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(15, 8, 17),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(48, 55, 73),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 1, 1),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 2, 10),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "pl", - "prompt": "# Create a function that takes 3 numbers.\n# Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n# Returns false in any other cases.\n# Examples\n# any_int(5, 2, 7) \u279e True\n# any_int(3, 2, 2) \u279e False\n# any_int(3, -2, 1) \u279e True\n# any_int(3.6, -2.2, 2) \u279e False\nsub any_int {\n my($x, $y, $z) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&any_int;\n if(eq_deeply($candidate->(2, 3, 1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2.5, 2, 3),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1.5, 5, 3.5),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 6, 2),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4, 2, 2),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2.2, 2.2, 2.2),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(-4, 6, 2),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 1, 1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3, 4, 7),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3.0, 4, 7),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "pl", - "prompt": "# This function takes a list l and returns a list l' such that\n# l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n# to the values of the corresponding indicies of l, but sorted.\n# >>> sort_third([1, 2, 3])\n# [1, 2, 3]\n# >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n# [2, 6, 3, 4, 8, 9, 5]\nsub sort_third {\n my($l) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sort_third;\n if(eq_deeply($candidate->([5, 6, 3, 4, 8, 9, 2]),[2, 6, 3, 4, 8, 9, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 8, 3, 4, 6, 9, 2]),[2, 8, 3, 4, 6, 9, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 6, 9, 4, 8, 3, 2]),[2, 6, 9, 4, 8, 3, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 6, 3, 4, 8, 9, 2, 1]),[2, 6, 3, 4, 8, 9, 5, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_53_add", - "language": "pl", - "prompt": "# Add two numbers x and y\n# >>> add(2, 3)\n# 5\n# >>> add(5, 7)\n# 12\nsub add {\n my($x, $y) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&add;\n if(eq_deeply($candidate->(0, 1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 0),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 3),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5, 7),12)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7, 5),12)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_69_search", - "language": "pl", - "prompt": "# You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n# zero, and has a frequency greater than or equal to the value of the integer itself. \n# The frequency of an integer is the number of times it appears in the list.\n# If no such a value exist, return -1.\n# Examples:\n# search([4, 1, 2, 2, 3, 1]) == 2\n# search([1, 2, 2, 3, 3, 3, 4, 4, 4]) == 3\n# search([5, 5, 4, 4, 4]) == -1\nsub search {\n my($lst) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&search;\n if(eq_deeply($candidate->([5, 5, 5, 5, 1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 1, 4, 1, 4, 4]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 3]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([8, 8, 8, 8, 8, 8, 8, 8]),8)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 3, 3, 2, 2]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 8, 2]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([8, 8, 3, 6, 5, 6, 4]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 9, 10, 1, 3]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([10]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 10, 10, 9, 2]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "pl", - "prompt": "# Write a function that takes a string and returns True if the string\n# length is a prime number or False otherwise\n# Examples\n# prime_length('Hello') == True\n# prime_length('abcdcba') == True\n# prime_length('kittens') == True\n# prime_length('orange') == False\nsub prime_length {\n my($string) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&prime_length;\n if(eq_deeply($candidate->(\"Hello\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdcba\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"kittens\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"orange\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"wow\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"world\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"MadaM\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Wow\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"HI\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"go\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"gogo\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aaaaaaaaaaaaaaa\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Madam\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"M\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"0\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_58_common", - "language": "pl", - "prompt": "# Return sorted unique common elements for two lists.\n# >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n# [1, 5, 653]\n# >>> common([5, 3, 2, 8], [3, 2])\n# [2, 3]\nsub common {\n my($l1, $l2) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&common;\n if(eq_deeply($candidate->([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]),[1, 5, 653])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 3, 2, 8], [3, 2]),[2, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 3, 2, 8], [3, 2, 4]),[2, 3, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 3, 2, 8], []),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "pl", - "prompt": "# The Brazilian factorial is defined as:\n# brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n# where n > 0\n# For example:\n# >>> special_factorial(4)\n# 288\n# The function will receive an integer as input and should return the special\n# factorial of this integer.\nsub special_factorial {\n my($n) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&special_factorial;\n if(eq_deeply($candidate->(4),288)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5),34560)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7),125411328000)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "pl", - "prompt": "# In this problem, you will implement a function that takes two lists of numbers,\n# and determines whether it is possible to perform an exchange of elements\n# between them to make lst1 a list of only even numbers.\n# There is no limit on the number of exchanged elements between lst1 and lst2.\n# If it is possible to exchange elements between the lst1 and lst2 to make\n# all the elements of lst1 to be even, return \"YES\".\n# Otherwise, return \"NO\".\n# For example:\n# exchange([1, 2, 3, 4], [1, 2, 3, 4]) => \"YES\"\n# exchange([1, 2, 3, 4], [1, 5, 3, 4]) => \"NO\"\n# It is assumed that the input lists will be non-empty.\nsub exchange {\n my($lst1, $lst2) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&exchange;\n if(eq_deeply($candidate->([1, 2, 3, 4], [1, 2, 3, 4]),\"YES\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4], [1, 5, 3, 4]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4], [2, 1, 4, 3]),\"YES\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 7, 3], [2, 6, 4]),\"YES\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 7, 3], [2, 6, 3]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 6, 1, 8, 9], [3, 5, 5, 1, 1, 1]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([100, 200], [200, 200]),\"YES\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "pl", - "prompt": "# Given a non-empty array of integers arr and an integer k, return\n# the sum of the elements with at most two digits from the first k elements of arr.\n# Example:\n# Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4\n# Output: 24 # sum of 21 + 3\n# Constraints:\n# 1. 1 <= len(arr) <= 100\n# 2. 1 <= k <= len(arr)\nsub add_elements {\n my($arr, $k) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&add_elements;\n if(eq_deeply($candidate->([1, -2, -3, 41, 57, 76, 87, 88, 99], 3),-4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([111, 121, 3, 4000, 5, 6], 2),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([11, 21, 3, 90, 5, 6, 7, 8, 9], 4),125)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4),24)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1], 1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "pl", - "prompt": "# A simple program which should return the value of x if n is \n# a prime number and should return the value of y otherwise.\n# Examples:\n# for x_or_y(7, 34, 12) == 34\n# for x_or_y(15, 8, 5) == 5\nsub x_or_y {\n my($n, $x, $y) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&x_or_y;\n if(eq_deeply($candidate->(7, 34, 12),34)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(15, 8, 5),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3, 33, 5212),33)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1259, 3, 52),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7919, -1, 12),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3609, 1245, 583),583)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(91, 56, 129),129)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6, 34, 1234),1234)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 2, 0),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 2, 0),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "pl", - "prompt": "# Given length of a side and high return area for a triangle.\n# >>> triangle_area(5, 3)\n# 7.5\nsub triangle_area {\n my($a, $h) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&triangle_area;\n if(eq_deeply($candidate->(5, 3),7.5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 2),2.0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10, 8),40.0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "pl", - "prompt": "# Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n# the last couple centuries. However, what people don't know is Tribonacci sequence.\n# Tribonacci sequence is defined by the recurrence:\n# tri(1) = 3\n# tri(n) = 1 + n / 2, if n is even.\n# tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n# For example:\n# tri(2) = 1 + (2 / 2) = 2\n# tri(4) = 3\n# tri(3) = tri(2) + tri(1) + tri(4)\n# = 2 + 3 + 3 = 8 \n# You are given a non-negative integer number n, you have to a return a list of the \n# first n + 1 numbers of the Tribonacci sequence.\n# Examples:\n# tri(3) = [1, 3, 2, 8]\nsub tri {\n my($n) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&tri;\n if(eq_deeply($candidate->(3),[1, 3, 2, 8])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4),[1, 3, 2, 8, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5),[1, 3, 2, 8, 3, 15])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6),[1, 3, 2, 8, 3, 15, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7),[1, 3, 2, 8, 3, 15, 4, 24])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),[1, 3, 2, 8, 3, 15, 4, 24, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(9),[1, 3, 2, 8, 3, 15, 4, 24, 5, 35])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(20),[1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(0),[1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),[1, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "pl", - "prompt": "# You are given a list of two strings, both strings consist of open\n# parentheses '(' or close parentheses ')' only.\n# Your job is to check if it is possible to concatenate the two strings in\n# some order, that the resulting string will be good.\n# A string S is considered to be good if and only if all parentheses in S\n# are balanced. For example: the string '(())()' is good, while the string\n# '())' is not.\n# Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n# Examples:\n# match_parens(['()(', ')']) == 'Yes'\n# match_parens([')', ')']) == 'No'\nsub match_parens {\n my($lst) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&match_parens;\n if(eq_deeply($candidate->([\"()(\", \")\"]),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\")\", \")\"]),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"(()(())\", \"())())\"]),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\")())\", \"(()()(\"]),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"(())))\", \"(()())((\"]),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"()\", \"())\"]),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"(()(\", \"()))()\"]),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"((((\", \"((())\"]),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\")(()\", \"(()(\"]),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\")(\", \")(\"]),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"(\", \")\"]),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\")\", \"(\"]),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "pl", - "prompt": "# From a list of integers, remove all elements that occur more than once.\n# Keep order of elements left the same as in the input.\n# >>> remove_duplicates([1, 2, 3, 2, 4])\n# [1, 3, 4]\nsub remove_duplicates {\n my($numbers) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&remove_duplicates;\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4]),[1, 2, 3, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 2, 4, 3, 5]),[1, 4, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "pl", - "prompt": "# Return a greatest common divisor of two integers a and b\n# >>> greatest_common_divisor(3, 5)\n# 1\n# >>> greatest_common_divisor(25, 15)\n# 5\nsub greatest_common_divisor {\n my($a, $b) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&greatest_common_divisor;\n if(eq_deeply($candidate->(3, 7),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10, 15),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(49, 14),7)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(144, 60),12)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "pl", - "prompt": "# Checks if given string is a palindrome\n# >>> is_palindrome('')\n# True\n# >>> is_palindrome('aba')\n# True\n# >>> is_palindrome('aaaaa')\n# True\n# >>> is_palindrome('zbcd')\n# False\nsub is_palindrome {\n my($text) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_palindrome;\n if(eq_deeply($candidate->(\"\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aba\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aaaaa\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"zbcd\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"xywyx\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"xywyz\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"xywzx\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "pl", - "prompt": "# xs represent coefficients of a polynomial.\n# xs[0] + xs[1] * x + xs[2] * x^2 + ....\n# Return derivative of this polynomial in the same form.\n# >>> derivative([3, 1, 2, 4, 5])\n# [1, 4, 12, 20]\n# >>> derivative([1, 2, 3])\n# [2, 6]\nsub derivative {\n my($xs) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&derivative;\n if(eq_deeply($candidate->([3, 1, 2, 4, 5]),[1, 4, 12, 20])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3]),[2, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 1]),[2, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 1, 0, 4]),[2, 2, 0, 16])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "pl", - "prompt": "# In this task, you will be given a string that represents a number of apples and oranges \n# that are distributed in a basket of fruit this basket contains \n# apples, oranges, and mango fruits. Given the string that represents the total number of \n# the oranges and apples and an integer that represent the total number of the fruits \n# in the basket return the number of the mango fruits in the basket.\n# for examble:\n# fruit_distribution(\"5 apples and 6 oranges\", 19) ->19 - 5 - 6 = 8\n# fruit_distribution(\"0 apples and 1 oranges\",3) -> 3 - 0 - 1 = 2\n# fruit_distribution(\"2 apples and 3 oranges\", 100) -> 100 - 2 - 3 = 95\n# fruit_distribution(\"100 apples and 1 oranges\",120) -> 120 - 100 - 1 = 19\nsub fruit_distribution {\n my($s, $n) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&fruit_distribution;\n if(eq_deeply($candidate->(\"5 apples and 6 oranges\", 19),8)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"5 apples and 6 oranges\", 21),10)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"0 apples and 1 oranges\", 3),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1 apples and 0 oranges\", 3),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2 apples and 3 oranges\", 100),95)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2 apples and 3 oranges\", 5),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1 apples and 100 oranges\", 120),19)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "pl", - "prompt": "# Write a function that takes an integer a and returns True \n# if this ingeger is a cube of some integer number.\n# Note: you may assume the input is always valid.\n# Examples:\n# iscube(1) ==> True\n# iscube(2) ==> False\n# iscube(-1) ==> True\n# iscube(64) ==> True\n# iscube(0) ==> True\n# iscube(180) ==> False\nsub iscube {\n my($a) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&iscube;\n if(eq_deeply($candidate->(1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(-1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(64),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(180),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1000),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(0),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1729),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "pl", - "prompt": "# In this Kata, you have to sort an array of non-negative integers according to\n# number of ones in their binary representation in ascending order.\n# For similar number of ones, sort based on decimal value.\n# It must be implemented like this:\n# >>> sort_array([1, 5, 2, 3, 4]) == [1, 2, 3, 4, 5]\n# >>> sort_array([-2, -3, -4, -5, -6]) == [-6, -5, -4, -3, -2]\n# >>> sort_array([1, 0, 2, 3, 4]) [0, 1, 2, 3, 4]\nsub sort_array {\n my($arr) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sort_array;\n if(eq_deeply($candidate->([1, 5, 2, 3, 4]),[1, 2, 4, 3, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-2, -3, -4, -5, -6]),[-4, -2, -6, -5, -3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 0, 2, 3, 4]),[0, 1, 2, 4, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]),[2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 6, 44, 12, 32, 5]),[32, 3, 5, 6, 12, 44])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, 8, 16, 32]),[2, 4, 8, 16, 32])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, 8, 16, 32]),[2, 4, 8, 16, 32])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "pl", - "prompt": "# Given a list of strings, where each string consists of only digits, return a list.\n# Each element i of the output should be \"the number of odd elements in the\n# string i of the input.\" where all the i's should be replaced by the number\n# of odd digits in the i'th string of the input.\n# >>> odd_count(['1234567'])\n# [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n# >>> odd_count(['3',\"11111111\"])\n# [\"the number of odd elements 1n the str1ng 1 of the 1nput.\",\n# \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\nsub odd_count {\n my($lst) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&odd_count;\n if(eq_deeply($candidate->([\"1234567\"]),[\"the number of odd elements 4n the str4ng 4 of the 4nput.\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($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.\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"271\", \"137\", \"314\"]),[\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "pl", - "prompt": "# brackets is a string of \"(\" and \")\".\n# return True if every opening bracket has a corresponding closing bracket.\n# >>> correct_bracketing(\"(\")\n# False\n# >>> correct_bracketing(\"()\")\n# True\n# >>> correct_bracketing(\"(()())\")\n# True\n# >>> correct_bracketing(\")(()\")\n# False\nsub correct_bracketing {\n my($brackets) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&correct_bracketing;\n if(eq_deeply($candidate->(\"()\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"(()())\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"()()(()())()\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"()()((()()())())(()()(()))\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"((()())))\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\")(()\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"(\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"((((\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\")\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"(()\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"()()(()())())(()\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"()()(()())()))()\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "pl", - "prompt": "# Task\n# Write a function that takes a string as input and returns the sum of the upper characters only'\n# ASCII codes.\n# Examples:\n# digitSum(\"\") => 0\n# digitSum(\"abAB\") => 131\n# digitSum(\"abcCd\") => 67\n# digitSum(\"helloE\") => 69\n# digitSum(\"woArBld\") => 131\n# digitSum(\"aAaaaXa\") => 153\nsub digitSum {\n my($s) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&digitSum;\n if(eq_deeply($candidate->(\"\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abAB\"),131)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcCd\"),67)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"helloE\"),69)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"woArBld\"),131)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aAaaaXa\"),153)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\" How are yOu?\"),151)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"You arE Very Smart\"),327)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "pl", - "prompt": "# Write a function that accepts a list of strings as a parameter,\n# deletes the strings that have odd lengths from it,\n# and returns the resulted list with a sorted order,\n# The list is always a list of strings and never an array of numbers,\n# and it may contain duplicates.\n# The order of the list should be ascending by length of each word, and you\n# should return the list sorted by that rule.\n# If two words have the same length, sort the list alphabetically.\n# The function should return a list of strings in sorted order.\n# You may assume that all words will have the same length.\n# For example:\n# assert list_sort([\"aa\", \"a\", \"aaa\"]) => [\"aa\"]\n# assert list_sort([\"ab\", \"a\", \"aaa\", \"cd\"]) => [\"ab\", \"cd\"]\nsub sorted_list_sum {\n my($lst) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sorted_list_sum;\n if(eq_deeply($candidate->([\"aa\", \"a\", \"aaa\"]),[\"aa\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"school\", \"AI\", \"asdf\", \"b\"]),[\"AI\", \"asdf\", \"school\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"d\", \"b\", \"c\", \"a\"]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"d\", \"dcba\", \"abcd\", \"a\"]),[\"abcd\", \"dcba\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"AI\", \"ai\", \"au\"]),[\"AI\", \"ai\", \"au\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"aaaa\", \"bbbb\", \"dd\", \"cc\"]),[\"cc\", \"dd\", \"aaaa\", \"bbbb\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "pl", - "prompt": "# You are given an array arr of integers and you need to return\n# sum of magnitudes of integers multiplied by product of all signs\n# of each number in the array, represented by 1, -1 or 0.\n# Note: return None for empty arr.\n# Example:\n# >>> prod_signs([1, 2, 2, -4]) == -9\n# >>> prod_signs([0, 1]) == 0\n# >>> prod_signs([]) == None\nsub prod_signs {\n my($arr) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&prod_signs;\n if(eq_deeply($candidate->([1, 2, 2, -4]),-9)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 1]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 1, 1, 2, 3, -1, 1]),-10)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),undef)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, 1, 2, -1, -1, 9]),20)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, 1, -1, 1]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, 1, 1, 1]),-4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, 1, 1, 0]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "pl", - "prompt": "# Return list with elements incremented by 1.\n# >>> incr_list([1, 2, 3])\n# [2, 3, 4]\n# >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123])\n# [6, 4, 6, 3, 4, 4, 10, 1, 124]\nsub incr_list {\n my($l) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&incr_list;\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 1]),[4, 3, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 2, 5, 2, 3, 3, 9, 0, 123]),[6, 3, 6, 3, 4, 4, 10, 1, 124])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "pl", - "prompt": "# From a given list of integers, generate a list of rolling maximum element found until given moment\n# in the sequence.\n# >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n# [1, 2, 3, 3, 3, 4, 4]\nsub rolling_max {\n my($numbers) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&rolling_max;\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4]),[1, 2, 3, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 3, 2, 1]),[4, 4, 4, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 3, 100, 3]),[3, 3, 3, 100, 100])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "pl", - "prompt": "# Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n# separate those group into separate strings and return the list of those.\n# Separate groups are balanced (each open brace is properly closed) and not nested within each other\n# Ignore any spaces in the input string.\n# >>> separate_paren_groups('( ) (( )) (( )( ))')\n# ['()', '(())', '(()())']\nsub separate_paren_groups {\n my($paren_string) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&separate_paren_groups;\n if(eq_deeply($candidate->(\"(()()) ((())) () ((())()())\"),[\"(()())\", \"((()))\", \"()\", \"((())()())\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"() (()) ((())) (((())))\"),[\"()\", \"(())\", \"((()))\", \"(((())))\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"(()(())((())))\"),[\"(()(())((())))\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"( ) (( )) (( )( ))\"),[\"()\", \"(())\", \"(()())\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "pl", - "prompt": "# You will be given a string of words separated by commas or spaces. Your task is\n# to split the string into words and return an array of the words.\n# For example:\n# words_string(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n# words_string(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\nsub words_string {\n my($s) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&words_string;\n if(eq_deeply($candidate->(\"Hi, my name is John\"),[\"Hi\", \"my\", \"name\", \"is\", \"John\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"One, two, three, four, five, six\"),[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hi, my name\"),[\"Hi\", \"my\", \"name\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"One,, two, three, four, five, six,\"),[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ahmed , gamal\"),[\"ahmed\", \"gamal\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "pl", - "prompt": "# Create a function that takes integers, floats, or strings representing\n# real numbers, and returns the larger variable in its given variable type.\n# Return None if the values are equal.\n# Note: If a real number is represented as a string, the floating point might be . or ,\n# compare_one(1, 2.5) \u279e 2.5\n# compare_one(1, \"2,3\") \u279e \"2,3\"\n# compare_one(\"5,1\", \"6\") \u279e \"6\"\n# compare_one(\"1\", 1) \u279e None\nsub compare_one {\n my($a, $b) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_137_compare_one.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&compare_one;\n if(eq_deeply($candidate->(1, 2),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 2.5),2.5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 3),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5, 6),6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, \"2,3\"),\"2,3\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"5,1\", \"6\"),\"6\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1\", \"2\"),\"2\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1\", 1),undef)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "pl", - "prompt": "# Filter given list of any python values only for integers\n# >>> filter_integers(['a', 3.14, 5])\n# [5]\n# >>> filter_integers([1, 2, 3, 'abc', {}, []])\n# [1, 2, 3]\nsub filter_integers {\n my($values) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&filter_integers;\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, {}, [], 23.2, 9, \"adasd\"]),[4, 9])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, \"c\", 3, 3, \"a\", \"b\"]),[3, 3, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "pl", - "prompt": "# This function takes a list l and returns a list l' such that\n# l' is identical to l in the odd indicies, while its values at the even indicies are equal\n# to the values of the even indicies of l, but sorted.\n# >>> sort_even([1, 2, 3])\n# [1, 2, 3]\n# >>> sort_even([5, 6, 3, 4])\n# [3, 6, 5, 4]\nsub sort_even {\n my($l) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sort_even;\n if(eq_deeply($candidate->([1, 2, 3]),[1, 2, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]),[-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 8, -12, 4, 23, 2, 3, 11, 12, -10]),[-12, 8, 3, 4, 5, 2, 12, 11, 23, -10])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "pl", - "prompt": "# I think we all remember that feeling when the result of some long-awaited\n# event is finally known. The feelings and thoughts you have at that moment are\n# definitely worth noting down and comparing.\n# Your task is to determine if a person correctly guessed the results of a number of matches.\n# You are given two arrays of scores and guesses of equal length, where each index shows a match. \n# Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n# the value is 0, and if not, the value is the absolute difference between the guess and the score.\n# example:\n# compare([1,2,3,4,5,1],[1,2,3,4,2,-2]) -> [0,0,0,0,3,3]\n# compare([0,5,0,0,0,4],[4,1,1,0,0,-2]) -> [4,4,1,0,0,6]\nsub compare {\n my($game, $guess) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&compare;\n if(eq_deeply($candidate->([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2]),[0, 0, 0, 0, 3, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]),[0, 0, 0, 0, 0, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3], [-1, -2, -3]),[2, 4, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 5], [-1, 2, 3, 4]),[2, 0, 0, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "pl", - "prompt": "# Given a positive integer n, return a tuple that has the number of even and odd\n# integer palindromes that fall within the range(1, n), inclusive.\n# Example 1:\n# Input: 3\n# Output: (1, 2)\n# Explanation:\n# Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n# Example 2:\n# Input: 12\n# Output: (4, 6)\n# Explanation:\n# Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n# Note:\n# 1. 1 <= n <= 10^3\n# 2. returned tuple has the number of even and odd integer palindromes respectively.\nsub even_odd_palindrome {\n my($n) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&even_odd_palindrome;\n if(eq_deeply($candidate->(123),[8, 13])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12),[4, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3),[1, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(63),[6, 8])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(25),[5, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(19),[4, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(9),[4, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),[0, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "pl", - "prompt": "# The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fib4(0) -> 0\n# fib4(1) -> 0\n# fib4(2) -> 2\n# fib4(3) -> 0\n# fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n# Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n# >>> fib4(5)\n# 4\n# >>> fib4(6)\n# 8\n# >>> fib4(7)\n# 14\nsub fib4 {\n my($n) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&fib4;\n if(eq_deeply($candidate->(5),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),28)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),104)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12),386)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "pl", - "prompt": "# Given two positive integers a and b, return the even digits between a\n# and b, in ascending order.\n# For example:\n# generate_integers(2, 8) => [2, 4, 6, 8]\n# generate_integers(8, 2) => [2, 4, 6, 8]\n# generate_integers(10, 14) => []\nsub generate_integers {\n my($a, $b) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&generate_integers;\n if(eq_deeply($candidate->(2, 10),[2, 4, 6, 8])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10, 2),[2, 4, 6, 8])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(132, 2),[2, 4, 6, 8])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(17, 89),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "pl", - "prompt": "# For a given list of input numbers, calculate Mean Absolute Deviation\n# around the mean of this dataset.\n# Mean Absolute Deviation is the average absolute difference between each\n# element and a centerpoint (mean in this case):\n# MAD = average | x - x_mean |\n# >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n# 1.0\nsub mean_absolute_deviation {\n my($numbers) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&mean_absolute_deviation;\n if(eq_deeply($candidate->([1.0, 2.0]),0.5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.0, 4.0]),1.0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.0, 4.0, 5.0]),1.2)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "pl", - "prompt": "# Create a function encrypt that takes a string as an argument and\n# returns a string encrypted with the alphabet being rotated. \n# The alphabet should be rotated in a manner such that the letters \n# shift down by two multiplied to two places.\n# For example:\n# encrypt('hi') returns 'lm'\n# encrypt('asdfghjkl') returns 'ewhjklnop'\n# encrypt('gf') returns 'kj'\n# encrypt('et') returns 'ix'\nsub encrypt {\n my($s) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&encrypt;\n if(eq_deeply($candidate->(\"hi\"),\"lm\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"asdfghjkl\"),\"ewhjklnop\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"gf\"),\"kj\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"et\"),\"ix\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"faewfawefaewg\"),\"jeiajeaijeiak\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"hellomyfriend\"),\"lippsqcjvmirh\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\"),\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"a\"),\"e\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "pl", - "prompt": "# Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n# The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n# as follows: start with any positive integer n. Then each term is obtained from the \n# previous term as follows: if the previous term is even, the next term is one half of \n# the previous term. If the previous term is odd, the next term is 3 times the previous\n# term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n# Note: \n# 1. Collatz(1) is [1].\n# 2. returned list sorted in increasing order.\n# For example:\n# get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\nsub get_odd_collatz {\n my($n) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&get_odd_collatz;\n if(eq_deeply($candidate->(14),[1, 5, 7, 11, 13, 17])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5),[1, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12),[1, 3, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),[1])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "pl", - "prompt": "# Find how many times a given substring can be found in the original string. Count overlaping cases.\n# >>> how_many_times('', 'a')\n# 0\n# >>> how_many_times('aaa', 'a')\n# 3\n# >>> how_many_times('aaaa', 'aa')\n# 3\nsub how_many_times {\n my($string, $substring) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&how_many_times;\n if(eq_deeply($candidate->(\"\", \"x\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"xyxyxyx\", \"x\"),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"cacacacac\", \"cac\"),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"john doe\", \"john\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "pl", - "prompt": "# We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n# numbers in the array will be randomly ordered. Your task is to determine if\n# it is possible to get an array sorted in non-decreasing order by performing \n# the following operation on the given array:\n# You are allowed to perform right shift operation any number of times.\n# One right shift operation means shifting all elements of the array by one\n# position in the right direction. The last element of the array will be moved to\n# the starting position in the array i.e. 0th index. \n# If it is possible to obtain the sorted array by performing the above operation\n# then return True else return False.\n# If the given array is empty then return True.\n# Note: The given list is guaranteed to have unique elements.\n# For Example:\n# move_one_ball([3, 4, 5, 1, 2])==>True\n# Explanation: By performin 2 right shift operations, non-decreasing order can\n# be achieved for the given array.\n# move_one_ball([3, 5, 4, 1, 2])==>False\n# Explanation:It is not possible to get non-decreasing order for the given\n# array by performing any number of right shift operations.\nsub move_one_ball {\n my($arr) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&move_one_ball;\n if(eq_deeply($candidate->([3, 4, 5, 1, 2]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 5, 10, 1, 2]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 3, 1, 2]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 5, 4, 1, 2]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "pl", - "prompt": "# Write a function which sorts the given list of integers\n# in ascending order according to the sum of their digits.\n# Note: if there are several items with similar sum of their digits,\n# order them based on their index in original list.\n# For example:\n# >>> order_by_points([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]\n# >>> order_by_points([]) == []\nsub order_by_points {\n my($nums) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&order_by_points;\n if(eq_deeply($candidate->([1, 11, -1, -11, -12]),[-1, -11, 1, -12, 11])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]),[0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, -11, -32, 43, 54, -98, 2, -3]),[-3, -32, -98, -11, 1, 2, 43, 54])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]),[1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 6, 6, -76, -21, 23, 4]),[-76, -21, 0, 4, 23, 6, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "pl", - "prompt": "# Return list of prime factors of given integer in the order from smallest to largest.\n# Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n# Input number should be equal to the product of all factors\n# >>> factorize(8)\n# [2, 2, 2]\n# >>> factorize(25)\n# [5, 5]\n# >>> factorize(70)\n# [2, 5, 7]\nsub factorize {\n my($n) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&factorize;\n if(eq_deeply($candidate->(2),[2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4),[2, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),[2, 2, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(57),[3, 19])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3249),[3, 3, 19, 19])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(185193),[3, 3, 3, 19, 19, 19])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(20577),[3, 19, 19, 19])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(18),[2, 3, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "pl", - "prompt": "# Return True if all numbers in the list l are below threshold t.\n# >>> below_threshold([1, 2, 4, 10], 100)\n# True\n# >>> below_threshold([1, 20, 4, 10], 5)\n# False\nsub below_threshold {\n my($l, $t) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&below_threshold;\n if(eq_deeply($candidate->([1, 2, 4, 10], 100),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 20, 4, 10], 5),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 20, 4, 10], 21),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 20, 4, 10], 22),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 8, 4, 10], 11),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 8, 4, 10], 10),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "pl", - "prompt": "# You are given two positive integers n and m, and your task is to compute the\n# average of the integers from n through m (including n and m). \n# Round the answer to the nearest integer and convert that to binary.\n# If n is greater than m, return -1.\n# Example:\n# rounded_avg(1, 5) => \"0b11\"\n# rounded_avg(7, 5) => -1\n# rounded_avg(10, 20) => \"0b1111\"\n# rounded_avg(20, 33) => \"0b11010\"\nsub rounded_avg {\n my($n, $m) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&rounded_avg;\n if(eq_deeply($candidate->(1, 5),\"0b11\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7, 13),\"0b1010\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(964, 977),\"0b1111001010\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(996, 997),\"0b1111100100\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(560, 851),\"0b1011000010\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(185, 546),\"0b101101110\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(362, 496),\"0b110101101\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(350, 902),\"0b1001110010\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(197, 233),\"0b11010111\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7, 5),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5, 1),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5, 5),\"0b101\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "pl", - "prompt": "# Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n# For each of the group, output the deepest level of nesting of parentheses.\n# E.g. (()()) has maximum two levels of nesting while ((())) has three.\n# >>> parse_nested_parens('(()()) ((())) () ((())()())')\n# [2, 3, 1, 3]\nsub parse_nested_parens {\n my($paren_string) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&parse_nested_parens;\n if(eq_deeply($candidate->(\"(()()) ((())) () ((())()())\"),[2, 3, 1, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"() (()) ((())) (((())))\"),[1, 2, 3, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"(()(())((())))\"),[4])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "pl", - "prompt": "# Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n# Examples\n# solution([5, 8, 7, 1]) ==> 12\n# solution([3, 3, 3, 3, 3]) ==> 9\n# solution([30, 13, 24, 321]) ==>0\nsub solution {\n my($lst) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&solution;\n if(eq_deeply($candidate->([5, 8, 7, 1]),12)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 3, 3, 3, 3]),9)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([30, 13, 24, 321]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 9]),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, 8]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([30, 13, 23, 32]),23)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 13, 2, 9]),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "pl", - "prompt": "# You are given a positive integer n. You have to create an integer array a of length n.\n# For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n# Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n# and a[i] + a[j] + a[k] is a multiple of 3.\n# Example :\n# Input: n = 5\n# Output: 1\n# Explanation: \n# a = [1, 3, 7, 13, 21]\n# The only valid triple is (1, 7, 13).\nsub get_max_triples {\n my($n) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&get_max_triples;\n if(eq_deeply($candidate->(5),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),36)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(100),53361)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "pl", - "prompt": "# There are eight planets in our solar system: the closerst to the Sun \n# is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n# Uranus, Neptune.\n# Write a function that takes two planet names as strings planet1 and planet2. \n# The function should return a tuple containing all planets whose orbits are \n# located between the orbit of planet1 and the orbit of planet2, sorted by \n# the proximity to the sun. \n# The function should return an empty tuple if planet1 or planet2\n# are not correct planet names. \n# Examples\n# bf(\"Jupiter\", \"Neptune\") ==> (\"Saturn\", \"Uranus\")\n# bf(\"Earth\", \"Mercury\") ==> (\"Venus\")\n# bf(\"Mercury\", \"Uranus\") ==> (\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\")\nsub bf {\n my($planet1, $planet2) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&bf;\n if(eq_deeply($candidate->(\"Jupiter\", \"Neptune\"),[\"Saturn\", \"Uranus\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Earth\", \"Mercury\"),[\"Venus\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Mercury\", \"Uranus\"),[\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Neptune\", \"Venus\"),[\"Earth\", \"Mars\", \"Jupiter\", \"Saturn\", \"Uranus\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Earth\", \"Earth\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Mars\", \"Earth\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Jupiter\", \"Makemake\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "pl", - "prompt": "# You are given a list of integers.\n# Write a function next_smallest() that returns the 2nd smallest element of the list.\n# Return None if there is no such element.\n# next_smallest([1, 2, 3, 4, 5]) == 2\n# next_smallest([5, 1, 4, 3, 2]) == 2\n# next_smallest([]) == None\n# next_smallest([1, 1]) == None\nsub next_smallest {\n my($lst) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&next_smallest;\n if(eq_deeply($candidate->([1, 2, 3, 4, 5]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 1, 4, 3, 2]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),undef)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 1]),undef)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 1, 1, 1, 0]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 1]),undef)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-35, 34, 12, -45]),-35)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "pl", - "prompt": "# Input is a space-delimited string of numberals from 'zero' to 'nine'.\n# Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n# Return the string with numbers sorted from smallest to largest\n# >>> sort_numbers('three one five')\n# 'one three five'\nsub sort_numbers {\n my($numbers) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sort_numbers;\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"three\"),\"three\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"three five nine\"),\"three five nine\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"five zero four seven nine eight\"),\"zero four five seven eight nine\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"six five four three two one zero\"),\"zero one two three four five six\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "pl", - "prompt": "# You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n# cycpattern_check(\"abcd\",\"abd\") => False\n# cycpattern_check(\"hello\",\"ell\") => True\n# cycpattern_check(\"whassup\",\"psus\") => False\n# cycpattern_check(\"abab\",\"baa\") => True\n# cycpattern_check(\"efef\",\"eeff\") => False\n# cycpattern_check(\"himenss\",\"simen\") => True\nsub cycpattern_check {\n my($a, $b) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&cycpattern_check;\n if(eq_deeply($candidate->(\"xyzw\", \"xyw\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"yello\", \"ell\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"whattup\", \"ptut\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"efef\", \"fee\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abab\", \"aabb\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"winemtt\", \"tinem\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "pl", - "prompt": "# You will be given a number in decimal form and your task is to convert it to\n# binary format. The function should return a string, with each character representing a binary\n# number. Each character in the string will be '0' or '1'.\n# There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n# The extra characters are there to help with the format.\n# Examples:\n# decimal_to_binary(15) # returns \"db1111db\"\n# decimal_to_binary(32) # returns \"db100000db\"\nsub decimal_to_binary {\n my($decimal) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&decimal_to_binary;\n if(eq_deeply($candidate->(0),\"db0db\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(32),\"db100000db\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(103),\"db1100111db\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(15),\"db1111db\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "pl", - "prompt": "# Filter an input list of strings only for ones that contain given substring\n# >>> filter_by_substring([], 'a')\n# []\n# >>> filter_by_substring(['abc', 'bacd', 'cde', 'array'], 'a')\n# ['abc', 'bacd', 'array']\nsub filter_by_substring {\n my($strings, $substring) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&filter_by_substring;\n if(eq_deeply($candidate->([], \"john\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"),[\"xxx\", \"xxxAAA\", \"xxx\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xx\"),[\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"grunt\", \"trumpet\", \"prune\", \"gruesome\"], \"run\"),[\"grunt\", \"prune\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "pl", - "prompt": "# Given an integer. return a tuple that has the number of even and odd digits respectively.\n# Example:\n# even_odd_count(-12) ==> (1, 1)\n# even_odd_count(123) ==> (1, 2)\nsub even_odd_count {\n my($num) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&even_odd_count;\n if(eq_deeply($candidate->(7),[0, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(-78),[1, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3452),[2, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(346211),[3, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(-345821),[3, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(-2),[1, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(-45347),[2, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(0),[1, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "pl", - "prompt": "# Write a function that accepts a list of strings.\n# The list contains different words. Return the word with maximum number\n# of unique characters. If multiple strings have maximum number of unique\n# characters, return the one which comes first in lexicographical order.\n# find_max([\"name\", \"of\", \"string\"]) == \"string\"\n# find_max([\"name\", \"enam\", \"game\"]) == \"enam\"\n# find_max([\"aaaaaaa\", \"bb\" ,\"cc\"]) == \"\"aaaaaaa\"\nsub find_max {\n my($words) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&find_max;\n if(eq_deeply($candidate->([\"name\", \"of\", \"string\"]),\"string\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"name\", \"enam\", \"game\"]),\"enam\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"aaaaaaa\", \"bb\", \"cc\"]),\"aaaaaaa\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"abc\", \"cba\"]),\"abc\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"play\", \"this\", \"game\", \"of\", \"footbott\"]),\"footbott\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"we\", \"are\", \"gonna\", \"rock\"]),\"gonna\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"we\", \"are\", \"a\", \"mad\", \"nation\"]),\"nation\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"this\", \"is\", \"a\", \"prrk\"]),\"this\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"b\"]),\"b\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"play\", \"play\", \"play\"]),\"play\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "pl", - "prompt": "# Given a positive integer n, return the count of the numbers of n-digit\n# positive integers that start or end with 1.\nsub starts_one_ends {\n my($n) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&starts_one_ends;\n if(eq_deeply($candidate->(1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2),18)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3),180)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4),1800)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5),18000)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "pl", - "prompt": "# Create a function that returns a tuple (a, b), where 'a' is\n# the largest of negative integers, and 'b' is the smallest\n# of positive integers in a list.\n# If there is no negative or positive integers, return them as None.\n# Examples:\n# largest_smallest_integers([2, 4, 1, 3, 5, 7]) == (None, 1)\n# largest_smallest_integers([]) == (None, None)\n# largest_smallest_integers([0]) == (None, None)\nsub largest_smallest_integers {\n my($lst) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&largest_smallest_integers;\n if(eq_deeply($candidate->([2, 4, 1, 3, 5, 7]),[undef, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, 1, 3, 5, 7, 0]),[undef, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, 2, 4, 5, 6, -2]),[-2, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 5, 3, 6, 2, 7, -7]),[-7, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([7, 3, 8, 4, 9, 2, 5, -9]),[-9, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),[undef, undef])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0]),[undef, undef])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -3, -5, -6]),[-1, undef])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -3, -5, -6, 0]),[-1, undef])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-6, -4, -4, -3, 1]),[-3, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-6, -4, -4, -3, -100, 1]),[-3, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "pl", - "prompt": "# \"Given an array representing a branch of a tree that has non-negative integer nodes\n# your task is to pluck one of the nodes and return it.\n# The plucked node should be the node with the smallest even value.\n# If multiple nodes with the same smallest even value are found return the node that has smallest index.\n# The plucked node should be returned in a list, [ smalest_value, its index ],\n# If there are no even values or the given array is empty, return [].\n# Example 1:\n# Input: [4,2,3]\n# Output: [2, 1]\n# Explanation: 2 has the smallest even value, and 2 has the smallest index.\n# Example 2:\n# Input: [1,2,3]\n# Output: [2, 1]\n# Explanation: 2 has the smallest even value, and 2 has the smallest index. \n# Example 3:\n# Input: []\n# Output: []\n# Example 4:\n# Input: [5, 0, 3, 0, 4, 2]\n# Output: [0, 1]\n# Explanation: 0 is the smallest value, but there are two zeros,\n# so we will choose the first zero, which has the smallest index.\n# Constraints:\n# * 1 <= nodes.length <= 10000\n# * 0 <= node.value\nsub pluck {\n my($arr) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&pluck;\n if(eq_deeply($candidate->([4, 2, 3]),[2, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3]),[2, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 0, 3, 0, 4, 2]),[0, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 0, 5, 3]),[0, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 4, 8, 4, 8]),[4, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([7, 6, 7, 1]),[6, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([7, 9, 7, 1]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "pl", - "prompt": "# Write a function count_nums which takes an array of integers and returns\n# the number of elements which has a sum of digits > 0.\n# If a number is negative, then its first signed digit will be negative:\n# e.g. -123 has signed digits -1, 2, and 3.\n# >>> count_nums([]) == 0\n# >>> count_nums([-1, 11, -11]) == 1\n# >>> count_nums([1, 1, 2]) == 3\nsub count_nums {\n my($arr) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&count_nums;\n if(eq_deeply($candidate->([]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -2, 0]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 1, 2, -2, 3, 4, 5]),6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 6, 9, -6, 0, 1, 5]),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 100, 98, -7, 1, -1]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([12, 23, 34, -45, -56, 0]),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "pl", - "prompt": "# Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n# each cell of the grid contains a value. Every integer in the range [1, N * N]\n# inclusive appears exactly once on the cells of the grid.\n# You have to find the minimum path of length k in the grid. You can start\n# from any cell, and in each step you can move to any of the neighbor cells,\n# in other words, you can go to cells which share an edge with you current\n# cell.\n# Please note that a path of length k means visiting exactly k cells (not\n# necessarily distinct).\n# You CANNOT go off the grid.\n# A path A (of length k) is considered less than a path B (of length k) if\n# after making the ordered lists of the values on the cells that A and B go\n# through (let's call them lst_A and lst_B), lst_A is lexicographically less\n# than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n# such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n# lst_A[j] = lst_B[j].\n# It is guaranteed that the answer is unique.\n# Return an ordered list of the values on the cells that the minimum path go through.\n# Examples:\n# Input: grid = [ [1,2,3], [4,5,6], [7,8,9]], k = 3\n# Output: [1, 2, 1]\n# Input: grid = [ [5,9,3], [4,1,6], [7,8,2]], k = 1\n# Output: [1]\nsub minPath {\n my($grid, $k) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&minPath;\n if(eq_deeply($candidate->([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3),[1, 2, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1),[1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], 4),[1, 2, 1, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[6, 4, 13, 10], [5, 7, 12, 1], [3, 16, 11, 15], [8, 14, 9, 2]], 7),[1, 10, 1, 10, 1, 10, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[8, 14, 9, 2], [6, 4, 13, 15], [5, 7, 1, 12], [3, 10, 11, 16]], 5),[1, 7, 1, 7, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[11, 8, 7, 2], [5, 16, 14, 4], [9, 3, 15, 6], [12, 13, 10, 1]], 9),[1, 6, 1, 6, 1, 6, 1, 6, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[12, 13, 10, 1], [9, 3, 15, 6], [5, 16, 14, 4], [11, 8, 7, 2]], 12),[1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[2, 7, 4], [3, 1, 5], [6, 8, 9]], 8),[1, 3, 1, 3, 1, 3, 1, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[6, 1, 5], [3, 8, 9], [2, 7, 4]], 8),[1, 5, 1, 5, 1, 5, 1, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1, 2], [3, 4]], 10),[1, 2, 1, 2, 1, 2, 1, 2, 1, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1, 3], [3, 2]], 10),[1, 3, 1, 3, 1, 3, 1, 3, 1, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "pl", - "prompt": "# Given list of integers, return list in strange order.\n# Strange sorting, is when you start with the minimum value,\n# then maximum of the remaining integers, then minimum and so on.\n# Examples:\n# strange_sort_list([1, 2, 3, 4]) == [1, 4, 2, 3]\n# strange_sort_list([5, 5, 5, 5]) == [5, 5, 5, 5]\n# strange_sort_list([]) == []\nsub strange_sort_list {\n my($lst) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&strange_sort_list;\n if(eq_deeply($candidate->([1, 2, 3, 4]),[1, 4, 2, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 6, 7, 8, 9]),[5, 9, 6, 8, 7])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 5]),[1, 5, 2, 4, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 6, 7, 8, 9, 1]),[1, 9, 5, 8, 6, 7])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 5, 5, 5]),[5, 5, 5, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 5, 6, 7, 8]),[1, 8, 2, 7, 3, 6, 4, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 2, 2, 2, 5, 5, -5, -5]),[-5, 5, -5, 5, 0, 2, 2, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([111111]),[111111])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "pl", - "prompt": "# Given a string 'text', return its md5 hash equivalent string.\n# If 'text' is an empty string, return None.\n# >>> string_to_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'\nsub string_to_md5 {\n my($text) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&string_to_md5;\n if(eq_deeply($candidate->(\"Hello world\"),\"3e25960a79dbc69b674cd4ec67a72c62\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),undef)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"A B C\"),\"0ef78513b0cb8cef12743f5aeb35f888\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"password\"),\"5f4dcc3b5aa765d61d8327deb882cf99\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "pl", - "prompt": "# You are given a word. Your task is to find the closest vowel that stands between \n# two consonants from the right side of the word (case sensitive).\n# Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n# find any vowel met the above condition. \n# You may assume that the given string contains English letter only.\n# Example:\n# get_closest_vowel(\"yogurt\") ==> \"u\"\n# get_closest_vowel(\"FULL\") ==> \"U\"\n# get_closest_vowel(\"quick\") ==> \"\"\n# get_closest_vowel(\"ab\") ==> \"\"\nsub get_closest_vowel {\n my($word) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&get_closest_vowel;\n if(eq_deeply($candidate->(\"yogurt\"),\"u\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"full\"),\"u\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"easy\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"eAsy\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ali\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"bad\"),\"a\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"most\"),\"o\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ab\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ba\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"quick\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"anime\"),\"i\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Asia\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Above\"),\"o\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "pl", - "prompt": "# Change numerical base of input number x to base.\n# return string representation after the conversion.\n# base numbers are less than 10.\n# >>> change_base(8, 3)\n# '22'\n# >>> change_base(8, 2)\n# '1000'\n# >>> change_base(7, 2)\n# '111'\nsub change_base {\n my($x, $base) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&change_base;\n if(eq_deeply($candidate->(8, 3),\"22\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(9, 3),\"100\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(234, 2),\"11101010\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(16, 2),\"10000\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8, 2),\"1000\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7, 2),\"111\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 3),\"2\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3, 4),\"3\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4, 5),\"4\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5, 6),\"5\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6, 7),\"6\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7, 8),\"7\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "pl", - "prompt": "# Check if in given list of numbers, are any two numbers closer to each other than\n# given threshold.\n# >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n# False\n# >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n# True\nsub has_close_elements {\n my($numbers, $threshold) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&has_close_elements;\n if(eq_deeply($candidate->([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 5.9, 4.0, 5.0], 0.95),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 5.9, 4.0, 5.0], 0.8),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.1, 2.2, 3.1, 4.1, 5.1], 1.0),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.1, 2.2, 3.1, 4.1, 5.1], 0.5),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "pl", - "prompt": "# Create a function that takes a string as input which contains only square brackets.\n# The function should return True if and only if there is a valid subsequence of brackets \n# where at least one bracket in the subsequence is nested.\n# is_nested('[[]]') \u279e True\n# is_nested('[]]]]]]][[[[[]') \u279e False\n# is_nested('[][]') \u279e False\n# is_nested('[]') \u279e False\n# is_nested('[[][]]') \u279e True\n# is_nested('[[]][[') \u279e True\nsub is_nested {\n my($string) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_nested;\n if(eq_deeply($candidate->(\"[[]]\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[]]]]]]][[[[[]\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[][]\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[]\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[[[[]]]]\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[]]]]]]]]]]\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[][][[]]\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[[]\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[]]\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[[]][[\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[[][]]\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[[[[[[[[\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"]]]]]]]]\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "pl", - "prompt": "# Concatenate list of strings into a single string\n# >>> concatenate([])\n# ''\n# >>> concatenate(['a', 'b', 'c'])\n# 'abc'\nsub concatenate {\n my($strings) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&concatenate;\n if(eq_deeply($candidate->([]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"x\", \"y\", \"z\"]),\"xyz\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"x\", \"y\", \"z\", \"w\", \"k\"]),\"xyzwk\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "pl", - "prompt": "# prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n# >>> prime_fib(1)\n# 2\n# >>> prime_fib(2)\n# 3\n# >>> prime_fib(3)\n# 5\n# >>> prime_fib(4)\n# 13\n# >>> prime_fib(5)\n# 89\nsub prime_fib {\n my($n) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&prime_fib;\n if(eq_deeply($candidate->(1),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4),13)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5),89)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6),233)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7),1597)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),28657)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(9),514229)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),433494437)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "pl", - "prompt": "# From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n# other and return them in order (smaller number, larger number).\n# >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n# (2.0, 2.2)\n# >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n# (2.0, 2.0)\nsub find_closest_elements {\n my($numbers) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&find_closest_elements;\n if(eq_deeply($candidate->([1.0, 2.0, 3.9, 4.0, 5.0, 2.2]),[3.9, 4.0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 5.9, 4.0, 5.0]),[5.0, 5.9])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]),[2.0, 2.2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]),[2.0, 2.0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.1, 2.2, 3.1, 4.1, 5.1]),[2.2, 3.1])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "pl", - "prompt": "# You have been tasked to write a function that receives \n# a hexadecimal number as a string and counts the number of hexadecimal \n# digits that are primes (prime number, or a prime, is a natural number \n# greater than 1 that is not a product of two smaller natural numbers).\n# Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n# Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n# So you have to determine a number of the following digits: 2, 3, 5, 7, \n# B (=decimal 11), D (=decimal 13).\n# Note: you may assume the input is always correct or empty string, \n# and symbols A,B,C,D,E,F are always uppercase.\n# Examples:\n# For num = \"AB\" the output should be 1.\n# For num = \"1077E\" the output should be 2.\n# For num = \"ABED1A33\" the output should be 4.\n# For num = \"123456789ABCDEF0\" the output should be 6.\n# For num = \"2020\" the output should be 2.\nsub hex_key {\n my($num) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&hex_key;\n if(eq_deeply($candidate->(\"AB\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1077E\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ABED1A33\"),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2020\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"123456789ABCDEF0\"),6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"112233445566778899AABBCCDDEEFF00\"),12)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "pl", - "prompt": "# Complete the function that takes two integers and returns \n# the product of their unit digits.\n# Assume the input is always valid.\n# Examples:\n# multiply(148, 412) should return 16.\n# multiply(19, 28) should return 72.\n# multiply(2020, 1851) should return 0.\n# multiply(14,-15) should return 20.\nsub multiply {\n my($a, $b) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&multiply;\n if(eq_deeply($candidate->(148, 412),16)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(19, 28),72)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2020, 1851),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(14, -15),20)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(76, 67),42)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(17, 27),49)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(0, 1),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(0, 0),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "pl", - "prompt": "# Given list of numbers (of at least two elements), apply a linear transform to that list,\n# such that the smallest number will become 0 and the largest will become 1\n# >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n# [0.0, 0.25, 0.5, 0.75, 1.0]\nsub rescale_to_unit {\n my($numbers) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&rescale_to_unit;\n if(eq_deeply($candidate->([2.0, 49.9]),[0.0, 1.0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([100.0, 49.9]),[1.0, 0.0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.0, 4.0, 5.0]),[0.0, 0.25, 0.5, 0.75, 1.0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2.0, 1.0, 5.0, 3.0, 4.0]),[0.25, 0.0, 1.0, 0.5, 0.75])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([12.0, 11.0, 15.0, 13.0, 14.0]),[0.25, 0.0, 1.0, 0.5, 0.75])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "pl", - "prompt": "# Given a positive integer n, return the product of the odd digits.\n# Return 0 if all digits are even.\n# For example:\n# digits(1) == 1\n# digits(4) == 0\n# digits(235) == 15\nsub digits {\n my($n) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&digits;\n if(eq_deeply($candidate->(5),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(54),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(120),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5014),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(98765),315)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5576543),2625)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2468),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "pl", - "prompt": "# You will be given the name of a class (a string) and a list of extensions.\n# The extensions are to be used to load additional classes to the class. The\n# strength of the extension is as follows: Let CAP be the number of the uppercase\n# letters in the extension's name, and let SM be the number of lowercase letters \n# in the extension's name, the strength is given by the fraction CAP - SM. \n# You should find the strongest extension and return a string in this \n# format: ClassName.StrongestExtensionName.\n# If there are two or more extensions with the same strength, you should\n# choose the one that comes first in the list.\n# For example, if you are given \"Slices\" as the class and a list of the\n# extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n# return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n# (its strength is -1).\n# Example:\n# for Strongest_Extension('my_class', ['AA', 'Be', 'CC']) == 'my_class.AA'\nsub Strongest_Extension {\n my($class_name, $extensions) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&Strongest_Extension;\n if(eq_deeply($candidate->(\"Watashi\", [\"tEN\", \"niNE\", \"eIGHt8OKe\"]),\"Watashi.eIGHt8OKe\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Boku123\", [\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"]),\"Boku123.YEs.WeCaNe\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"__YESIMHERE\", [\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"]),\"__YESIMHERE.NuLl__\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"K\", [\"Ta\", \"TAR\", \"t234An\", \"cosSo\"]),\"K.TAR\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"__HAHA\", [\"Tab\", \"123\", \"781345\", \"-_-\"]),\"__HAHA.123\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"YameRore\", [\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"]),\"YameRore.okIWILL123\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"finNNalLLly\", [\"Die\", \"NowW\", \"Wow\", \"WoW\"]),\"finNNalLLly.WoW\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"_\", [\"Bb\", \"91245\"]),\"_.Bb\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Sp\", [\"671235\", \"Bb\"]),\"Sp.671235\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "pl", - "prompt": "# Given a string representing a space separated lowercase letters, return a dictionary\n# of the letter with the most repetition and containing the corresponding count.\n# If several letters have the same occurrence, return all of them.\n# Example:\n# histogram('a b c') == {'a': 1, 'b': 1, 'c': 1}\n# histogram('a b b a') == {'a': 2, 'b': 2}\n# histogram('a b c a b') == {'a': 2, 'b': 2}\n# histogram('b b b b a') == {'b': 4}\n# histogram('') == {}\nsub histogram {\n my($test) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&histogram;\n if(eq_deeply($candidate->(\"a b b a\"),{\"a\" => 2, \"b\" => 2})) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"a b c a b\"),{\"a\" => 2, \"b\" => 2})) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"a b c d g\"),{\"a\" => 1, \"b\" => 1, \"c\" => 1, \"d\" => 1, \"g\" => 1})) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"r t g\"),{\"r\" => 1, \"t\" => 1, \"g\" => 1})) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"b b b b a\"),{\"b\" => 4})) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"r t g\"),{\"r\" => 1, \"t\" => 1, \"g\" => 1})) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),{})) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"a\"),{\"a\" => 1})) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "pl", - "prompt": "# pairs_sum_to_zero takes a list of integers as an input.\n# it returns True if there are two distinct elements in the list that\n# sum to zero, and False otherwise.\n# >>> pairs_sum_to_zero([1, 3, 5, 0])\n# False\n# >>> pairs_sum_to_zero([1, 3, -2, 1])\n# False\n# >>> pairs_sum_to_zero([1, 2, 3, 7])\n# False\n# >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7])\n# True\n# >>> pairs_sum_to_zero([1])\n# False\nsub pairs_sum_to_zero {\n my($l) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&pairs_sum_to_zero;\n if(eq_deeply($candidate->([1, 3, 5, 0]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, -2, 1]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 7]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, -5, 3, 5, 7]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-3, 9, -1, 3, 2, 30]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-3, 9, -1, 3, 2, 31]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-3, 9, -1, 4, 2, 30]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-3, 9, -1, 4, 2, 31]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "pl", - "prompt": "# Write a function that accepts two lists of strings and returns the list that has \n# total number of chars in the all strings of the list less than the other list.\n# if the two lists have the same number of chars, return the first list.\n# Examples\n# total_match([], []) \u279e []\n# total_match(['hi', 'admin'], ['hI', 'Hi']) \u279e ['hI', 'Hi']\n# total_match(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) \u279e ['hi', 'admin']\n# total_match(['hi', 'admin'], ['hI', 'hi', 'hi']) \u279e ['hI', 'hi', 'hi']\n# total_match(['4'], ['1', '2', '3', '4', '5']) \u279e ['4']\nsub total_match {\n my($lst1, $lst2) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&total_match;\n if(eq_deeply($candidate->([], []),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"hi\", \"admin\"], [\"hi\", \"hi\"]),[\"hi\", \"hi\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"]),[\"hi\", \"admin\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"]),[\"4\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"hi\", \"admin\"], [\"hI\", \"Hi\"]),[\"hI\", \"Hi\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"]),[\"hI\", \"hi\", \"hi\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hii\"]),[\"hi\", \"admin\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([], [\"this\"]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"this\"], []),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "pl", - "prompt": "# Circular shift the digits of the integer x, shift the digits right by shift\n# and return the result as a string.\n# If shift > number of digits, return digits reversed.\n# >>> circular_shift(12, 1)\n# \"21\"\n# >>> circular_shift(12, 2)\n# \"12\"\nsub circular_shift {\n my($x, $shift) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&circular_shift;\n if(eq_deeply($candidate->(100, 2),\"001\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12, 2),\"12\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(97, 8),\"79\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12, 1),\"21\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(11, 101),\"11\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "pl", - "prompt": "# Return True is list elements are monotonically increasing or decreasing.\n# >>> monotonic([1, 2, 4, 20])\n# True\n# >>> monotonic([1, 20, 4, 10])\n# False\n# >>> monotonic([4, 1, 0, -10])\n# True\nsub monotonic {\n my($l) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&monotonic;\n if(eq_deeply($candidate->([1, 2, 4, 10]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 4, 20]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 20, 4, 10]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 1, 0, -10]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 1, 1, 0]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 2, 5, 60]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 5, 60]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([9, 9, 9, 9]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "pl", - "prompt": "# Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n# Example\n# is_equal_to_sum_even(4) == False\n# is_equal_to_sum_even(6) == False\n# is_equal_to_sum_even(8) == True\nsub is_equal_to_sum_even {\n my($n) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_equal_to_sum_even;\n if(eq_deeply($candidate->(4),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(11),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(13),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(16),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "pl", - "prompt": "# Input to this function is a string representing musical notes in a special ASCII format.\n# Your task is to parse this string and return list of integers corresponding to how many beats does each\n# not last.\n# Here is a legend:\n# 'o' - whole note, lasts four beats\n# 'o|' - half note, lasts two beats\n# '.|' - quater note, lasts one beat\n# >>> parse_music('o o| .| o| o| .| .| .| .| o o')\n# [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\nsub parse_music {\n my($music_string) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&parse_music;\n if(eq_deeply($candidate->(\"\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"o o o o\"),[4, 4, 4, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\".| .| .| .|\"),[1, 1, 1, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"o| o| .| .| o o o o\"),[2, 2, 1, 1, 4, 4, 4, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"o| .| o| .| o o| o o|\"),[2, 1, 2, 1, 4, 2, 4, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "pl", - "prompt": "# \"\n# This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n# multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n# change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n# Examples:\n# For lst = [1,2,3] the output should be 6\n# For lst = [] the output should be 0\n# For lst = [-1,-5,2,-1,-5] the output should be -126\nsub sum_squares {\n my($lst) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sum_squares;\n if(eq_deeply($candidate->([1, 2, 3]),6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 4, 9]),14)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 1, 1, 1, 1, 1, 1, 1, 1]),9)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -1, -1, -1, -1, -1, -1, -1, -1]),-3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -5, 2, -1, -5]),-126)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-56, -99, 1, 0, -2]),3030)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, 0, 0, 0, 0, 0, 0, 0, -1]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37]),-14196)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10]),-1448)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "pl", - "prompt": "# triples_sum_to_zero takes a list of integers as an input.\n# it returns True if there are three distinct elements in the list that\n# sum to zero, and False otherwise.\n# >>> triples_sum_to_zero([1, 3, 5, 0])\n# False\n# >>> triples_sum_to_zero([1, 3, -2, 1])\n# True\n# >>> triples_sum_to_zero([1, 2, 3, 7])\n# False\n# >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n# True\n# >>> triples_sum_to_zero([1])\n# False\nsub triples_sum_to_zero {\n my($l) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&triples_sum_to_zero;\n if(eq_deeply($candidate->([1, 3, 5, 0]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, 5, -1]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, -2, 1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 7]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 5, 7]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, -5, 3, 9, 7]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, 5, -100]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([100, 3, 5, -100]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "pl", - "prompt": "# brackets is a string of \"<\" and \">\".\n# return True if every opening bracket has a corresponding closing bracket.\n# >>> correct_bracketing(\"<\")\n# False\n# >>> correct_bracketing(\"<>\")\n# True\n# >>> correct_bracketing(\"<<><>>\")\n# True\n# >>> correct_bracketing(\"><<>\")\n# False\nsub correct_bracketing {\n my($brackets) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&correct_bracketing;\n if(eq_deeply($candidate->(\"<>\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<<><>>\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<><><<><>><>\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<><><<<><><>><>><<><><<>>>\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<<<><>>>>\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"><<>\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<<<<\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\">\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<<>\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<><><<><>><>><<>\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<><><<><>><>>><>\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "pl", - "prompt": "# Write a function that takes an array of numbers as input and returns \n# the number of elements in the array that are greater than 10 and both \n# first and last digits of a number are odd (1, 3, 5, 7, 9).\n# For example:\n# specialFilter([15, -73, 14, -15]) => 1 \n# specialFilter([33, -2, -3, 45, 21, 109]) => 2\nsub specialFilter {\n my($nums) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&specialFilter;\n if(eq_deeply($candidate->([5, -2, 1, -5]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([15, -73, 14, -15]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([33, -2, -3, 45, 21, 109]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([43, -12, 93, 125, 121, 109]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([71, -2, -33, 75, 21, 19]),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "pl", - "prompt": "# Given a dictionary, return True if all keys are strings in lower \n# case or all keys are strings in upper case, else return False.\n# The function should return False is the given dictionary is empty.\n# Examples:\n# check_dict_case({\"a\":\"apple\", \"b\":\"banana\"}) should return True.\n# check_dict_case({\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}) should return False.\n# check_dict_case({\"a\":\"apple\", \"8\":\"banana\", \"a\":\"apple\"}) should return False.\n# check_dict_case({\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}) should return False.\n# check_dict_case({\"STATE\":\"NC\", \"ZIP\":\"12345\" }) should return True.\nsub check_dict_case {\n my($dict) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&check_dict_case;\n if(eq_deeply($candidate->({\"p\" => \"pineapple\", \"b\" => \"banana\"}),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->({\"p\" => \"pineapple\", \"A\" => \"banana\", \"B\" => \"banana\"}),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->({\"p\" => \"pineapple\", \"5\" => \"banana\", \"a\" => \"apple\"}),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->({\"Name\" => \"John\", \"Age\" => \"36\", \"City\" => \"Houston\"}),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->({\"STATE\" => \"NC\", \"ZIP\" => \"12345\"}),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->({\"fruit\" => \"Orange\", \"taste\" => \"Sweet\"}),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->({}),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "pl", - "prompt": "# Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n# should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n# alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n# Examples\n# split_words(\"Hello world!\") \u279e [\"Hello\", \"world!\"]\n# split_words(\"Hello,world!\") \u279e [\"Hello\", \"world!\"]\n# split_words(\"abcdef\") == 3\nsub split_words {\n my($txt) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&split_words;\n if(eq_deeply($candidate->(\"Hello world!\"),[\"Hello\", \"world!\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hello,world!\"),[\"Hello\", \"world!\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hello world,!\"),[\"Hello\", \"world,!\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hello,Hello,world !\"),[\"Hello,Hello,world\", \"!\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdef\"),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aaabb\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aaaBb\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "pl", - "prompt": "# The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fibfib(0) == 0\n# fibfib(1) == 0\n# fibfib(2) == 1\n# fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n# Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n# >>> fibfib(1)\n# 0\n# >>> fibfib(5)\n# 4\n# >>> fibfib(8)\n# 24\nsub fibfib {\n my($n) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&fibfib;\n if(eq_deeply($candidate->(2),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),24)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),81)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12),274)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(14),927)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "pl", - "prompt": "# You are given a list of numbers.\n# You need to return the sum of squared numbers in the given list,\n# round each element in the list to the upper int(Ceiling) first.\n# Examples:\n# For lst = [1,2,3] the output should be 14\n# For lst = [1,4,9] the output should be 98\n# For lst = [1,3,5,7] the output should be 84\n# For lst = [1.4,4.2,0] the output should be 29\n# For lst = [-2.4,1,1] the output should be 6\nsub sum_squares {\n my($lst) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sum_squares;\n if(eq_deeply($candidate->([1.0, 2.0, 3.0]),14)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.0]),14)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 3.0, 5.0, 7.0]),84)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.4, 4.2, 0.0]),29)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-2.4, 1.0, 1.0]),6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([100.0, 1.0, 15.0, 2.0]),10230)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([10000.0, 10000.0]),200000000)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1.4, 4.6, 6.3]),75)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1.4, 17.9, 18.9, 19.9]),1086)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0.0]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1.0]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1.0, 1.0, 0.0]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_85_add", - "language": "pl", - "prompt": "# Given a non-empty list of integers lst. add the even elements that are at odd indices..\n# Examples:\n# add([4, 2, 6, 7]) ==> 2\nsub add {\n my($lst) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&add;\n if(eq_deeply($candidate->([4, 88]),88)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 5, 6, 7, 2, 122]),122)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 0, 6, 7]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 4, 6, 8]),12)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "pl", - "prompt": "# Return sorted unique elements in a list\n# >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123])\n# [0, 2, 3, 5, 9, 123]\nsub unique {\n my($l) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&unique;\n if(eq_deeply($candidate->([5, 3, 5, 2, 3, 3, 9, 0, 123]),[0, 2, 3, 5, 9, 123])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "pl", - "prompt": "# Given a string text, replace all spaces in it with underscores, \n# and if a string has more than 2 consecutive spaces, \n# then replace all consecutive spaces with - \n# fix_spaces(\"Example\") == \"Example\"\n# fix_spaces(\"Example 1\") == \"Example_1\"\n# fix_spaces(\" Example 2\") == \"_Example_2\"\n# fix_spaces(\" Example 3\") == \"_Example-3\"\nsub fix_spaces {\n my($text) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&fix_spaces;\n if(eq_deeply($candidate->(\"Example\"),\"Example\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Mudasir Hanif \"),\"Mudasir_Hanif_\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Yellow Yellow Dirty Fellow\"),\"Yellow_Yellow__Dirty__Fellow\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Exa mple\"),\"Exa-mple\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\" Exa 1 2 2 mple\"),\"-Exa_1_2_2_mple\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "pl", - "prompt": "# Return 2^n modulo p (be aware of numerics).\n# >>> modp(3, 5)\n# 3\n# >>> modp(1101, 101)\n# 2\n# >>> modp(0, 101)\n# 1\n# >>> modp(3, 11)\n# 8\n# >>> modp(100, 101)\n# 1\nsub modp {\n my($n, $p) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&modp;\n if(eq_deeply($candidate->(3, 5),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1101, 101),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(0, 101),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3, 11),8)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(100, 101),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(30, 5),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(31, 5),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "pl", - "prompt": "# You have to write a function which validates a given date string and\n# returns True if the date is valid otherwise False.\n# The date is valid if all of the following rules are satisfied:\n# 1. The date string is not empty.\n# 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n# 3. The months should not be less than 1 or higher than 12.\n# 4. The date should be in the format: mm-dd-yyyy\n# for example: \n# valid_date('03-11-2000') => True\n# valid_date('15-01-2012') => False\n# valid_date('04-0-2040') => False\n# valid_date('06-04-2020') => True\n# valid_date('06/04/2020') => False\nsub valid_date {\n my($date) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&valid_date;\n if(eq_deeply($candidate->(\"03-11-2000\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"15-01-2012\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"04-0-2040\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"06-04-2020\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"01-01-2007\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"03-32-2011\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"04-31-3000\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"06-06-2005\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"21-31-2000\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"04-12-2003\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"04122003\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"20030412\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2003-04\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2003-04-12\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"04-2003\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "pl", - "prompt": "# Write a function that takes a string and returns an ordered version of it.\n# Ordered version of string, is a string where all words (separated by space)\n# are replaced by a new word where all the characters arranged in\n# ascending order based on ascii value.\n# Note: You should keep the order of words and blank spaces in the sentence.\n# For example:\n# anti_shuffle('Hi') returns 'Hi'\n# anti_shuffle('hello') returns 'ehllo'\n# anti_shuffle('Hello World!!!') returns 'Hello !!!Wdlor'\nsub anti_shuffle {\n my($s) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&anti_shuffle;\n if(eq_deeply($candidate->(\"Hi\"),\"Hi\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"hello\"),\"ehllo\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"number\"),\"bemnru\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcd\"),\"abcd\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hello World!!!\"),\"Hello !!!Wdlor\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hi. My name is Mister Robot. How are you?\"),\".Hi My aemn is Meirst .Rboot How aer ?ouy\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "pl", - "prompt": "# Given a list of numbers, return whether or not they are sorted\n# in ascending order. If list has more than 1 duplicate of the same\n# number, return False. Assume no negative numbers and only integers.\n# Examples\n# is_sorted([5]) \u279e True\n# is_sorted([1, 2, 3, 4, 5]) \u279e True\n# is_sorted([1, 3, 2, 4, 5]) \u279e False\n# is_sorted([1, 2, 3, 4, 5, 6]) \u279e True\n# is_sorted([1, 2, 3, 4, 5, 6, 7]) \u279e True\n# is_sorted([1, 3, 2, 4, 5, 6, 7]) \u279e False\n# is_sorted([1, 2, 2, 3, 3, 4]) \u279e True\n# is_sorted([1, 2, 2, 2, 3, 4]) \u279e False\nsub is_sorted {\n my($lst) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_sorted;\n if(eq_deeply($candidate->([5]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 5]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, 2, 4, 5]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 5, 6]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 5, 6, 7]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, 2, 4, 5, 6, 7]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 1]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 2, 2, 3, 4]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 3, 3, 4]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 2, 3, 3, 4]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "pl", - "prompt": "# You are given a string s.\n# Your task is to check if the string is happy or not.\n# A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n# For example:\n# is_happy(a) => False\n# is_happy(aa) => False\n# is_happy(abcd) => True\n# is_happy(aabb) => False\n# is_happy(adb) => True\n# is_happy(xyy) => False\nsub is_happy {\n my($s) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_happy;\n if(eq_deeply($candidate->(\"a\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aa\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcd\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aabb\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"adb\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"xyy\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"iopaxpoi\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"iopaxioi\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "pl", - "prompt": "# Write a function that returns True if the object q will fly, and False otherwise.\n# The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n# Example:\n# will_it_fly([1, 2], 5) \u279e False \n# # 1+2 is less than the maximum possible weight, but it's unbalanced.\n# will_it_fly([3, 2, 3], 1) \u279e False\n# # it's balanced, but 3+2+3 is more than the maximum possible weight.\n# will_it_fly([3, 2, 3], 9) \u279e True\n# # 3+2+3 is less than the maximum possible weight, and it's balanced.\n# will_it_fly([3], 5) \u279e True\n# # 3 is less than the maximum possible weight, and it's balanced.\nsub will_it_fly {\n my($q, $w) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&will_it_fly;\n if(eq_deeply($candidate->([3, 2, 3], 9),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2], 5),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3], 5),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 3], 1),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3], 6),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5], 5),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "pl", - "prompt": "# Given an array of non-negative integers, return a copy of the given array after sorting,\n# you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n# or sort it in descending order if the sum( first index value, last index value) is even.\n# Note:\n# * don't change the given array.\n# Examples:\n# * sort_array([]) => []\n# * sort_array([5]) => [5]\n# * sort_array([2, 4, 3, 0, 1, 5]) => [0, 1, 2, 3, 4, 5]\n# * sort_array([2, 4, 3, 0, 1, 5, 6]) => [6, 5, 4, 3, 2, 1, 0]\nsub sort_array {\n my($array) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sort_array;\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5]),[5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, 3, 0, 1, 5]),[0, 1, 2, 3, 4, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, 3, 0, 1, 5, 6]),[6, 5, 4, 3, 2, 1, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 1]),[1, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([15, 42, 87, 32, 11, 0]),[0, 11, 15, 32, 42, 87])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([21, 14, 23, 11]),[23, 21, 14, 11])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "pl", - "prompt": "# Implement a function that takes an non-negative integer and returns an array of the first n\n# integers that are prime numbers and less than n.\n# for example:\n# count_up_to(5) => [2,3]\n# count_up_to(11) => [2,3,5,7]\n# count_up_to(0) => []\n# count_up_to(20) => [2,3,5,7,11,13,17,19]\n# count_up_to(1) => []\n# count_up_to(18) => [2,3,5,7,11,13,17]\nsub count_up_to {\n my($n) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&count_up_to;\n if(eq_deeply($candidate->(5),[2, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6),[2, 3, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7),[2, 3, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),[2, 3, 5, 7])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(0),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(22),[2, 3, 5, 7, 11, 13, 17, 19])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(18),[2, 3, 5, 7, 11, 13, 17])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(47),[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(101),[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "pl", - "prompt": "# Out of list of strings, return the longest one. Return the first one in case of multiple\n# strings of the same length. Return None in case the input list is empty.\n# >>> longest([])\n# >>> longest(['a', 'b', 'c'])\n# 'a'\n# >>> longest(['a', 'bb', 'ccc'])\n# 'ccc'\nsub longest {\n my($strings) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&longest;\n if(eq_deeply($candidate->([]),undef)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"x\", \"y\", \"z\"]),\"x\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"]),\"zzzz\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "pl", - "prompt": "# Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n# reverse the resulting array, and then replace each digit by its corresponding name from\n# \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n# For example:\n# arr = [2, 1, 1, 4, 5, 8, 2, 3] \n# -> sort arr -> [1, 1, 2, 2, 3, 4, 5, 8] \n# -> reverse arr -> [8, 5, 4, 3, 2, 2, 1, 1]\n# return [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n# If the array is empty, return an empty array:\n# arr = []\n# return []\n# If the array has any strange number ignore it:\n# arr = [1, -1 , 55] \n# -> sort arr -> [-1, 1, 55]\n# -> reverse arr -> [55, 1, -1]\n# return = ['One']\nsub by_length {\n my($arr) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&by_length;\n if(eq_deeply($candidate->([2, 1, 1, 4, 5, 8, 2, 3]),[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, -1, 55]),[\"One\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, -1, 3, 2]),[\"Three\", \"Two\", \"One\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([9, 4, 8]),[\"Nine\", \"Eight\", \"Four\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_106_f", - "language": "pl", - "prompt": "# Implement the function f that takes n as a parameter,\n# 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\n# or the sum of numbers from 1 to i otherwise.\n# i starts from 1.\n# the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n# Example:\n# f(5) == [1, 2, 6, 24, 15]\nsub f {\n my($n) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&f;\n if(eq_deeply($candidate->(5),[1, 2, 6, 24, 15])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7),[1, 2, 6, 24, 15, 720, 28])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),[1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3),[1, 2, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "pl", - "prompt": "# Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n# >>> fizz_buzz(50)\n# 0\n# >>> fizz_buzz(78)\n# 2\n# >>> fizz_buzz(79)\n# 3\nsub fizz_buzz {\n my($n) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&fizz_buzz;\n if(eq_deeply($candidate->(50),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(78),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(79),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(100),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(200),6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4000),192)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10000),639)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(100000),8026)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "pl", - "prompt": "# Given a positive floating point number, it can be decomposed into\n# and integer part (largest integer smaller than given number) and decimals\n# (leftover part always smaller than 1).\n# Return the decimal part of the number.\n# >>> truncate_number(3.5)\n# 0.5\nsub truncate_number {\n my($number) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&truncate_number;\n if(eq_deeply($candidate->(3.5),0.5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1.25),0.25)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(123.0),0.0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "pl", - "prompt": "# For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n# Empty sum should be equal to 0 and empty product should be equal to 1.\n# >>> sum_product([])\n# (0, 1)\n# >>> sum_product([1, 2, 3, 4])\n# (10, 24)\nsub sum_product {\n my($numbers) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sum_product;\n if(eq_deeply($candidate->([]),[0, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 1, 1]),[3, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([100, 0]),[100, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 5, 7]),[15, 105])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([10]),[10, 10])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "pl", - "prompt": "# You are given a 2 dimensional data, as a nested lists,\n# which is similar to matrix, however, unlike matrices,\n# each row may contain a different number of columns.\n# Given lst, and integer x, find integers x in the list,\n# and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n# each tuple is a coordinate - (row, columns), starting with 0.\n# Sort coordinates initially by rows in ascending order.\n# Also, sort coordinates of the row by columns in descending order.\n# Examples:\n# get_row([\n# [1,2,3,4,5,6],\n# [1,2,3,4,1,6],\n# [1,2,3,4,5,1]\n# ], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n# get_row([], 1) == []\n# get_row([[], [1], [1, 2, 3]], 3) == [(2, 2)]\nsub get_row {\n my($lst, $x) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&get_row;\n if(eq_deeply($candidate->([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1),[[0, 0], [1, 4], [1, 0], [2, 5], [2, 0]])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6]], 2),[[0, 1], [1, 1], [2, 1], [3, 1], [4, 1], [5, 1]])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 1, 3, 4, 5, 6], [1, 2, 1, 4, 5, 6], [1, 2, 3, 1, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1),[[0, 0], [1, 0], [2, 1], [2, 0], [3, 2], [3, 0], [4, 3], [4, 0], [5, 4], [5, 0], [6, 5], [6, 0]])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([], 1),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1]], 2),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[], [1], [1, 2, 3]], 3),[[2, 2]])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "pl", - "prompt": "# You're a hungry rabbit, and you already have eaten a certain number of carrots,\n# but now you need to eat more carrots to complete the day's meals.\n# you should return an array of [ total number of eaten carrots after your meals,\n# the number of carrots left after your meals ]\n# if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n# Example:\n# * eat(5, 6, 10) -> [11, 4]\n# * eat(4, 8, 9) -> [12, 1]\n# * eat(1, 10, 10) -> [11, 0]\n# * eat(2, 11, 5) -> [7, 0]\n# Variables:\n# @number : integer\n# the number of carrots that you have eaten.\n# @need : integer\n# the number of carrots that you need to eat.\n# @remaining : integer\n# the number of remaining carrots thet exist in stock\n# Constrain:\n# * 0 <= number <= 1000\n# * 0 <= need <= 1000\n# * 0 <= remaining <= 1000\n# Have fun :)\nsub eat {\n my($number, $need, $remaining) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&eat;\n if(eq_deeply($candidate->(5, 6, 10),[11, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4, 8, 9),[12, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 10, 10),[11, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 11, 5),[7, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4, 5, 7),[9, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4, 5, 1),[5, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "pl", - "prompt": "# Given a positive integer N, return the total sum of its digits in binary.\n# Example\n# For N = 1000, the sum of digits will be 1 the output should be \"1\".\n# For N = 150, the sum of digits will be 6 the output should be \"110\".\n# For N = 147, the sum of digits will be 12 the output should be \"1100\".\n# Variables:\n# @N integer\n# Constraints: 0 \u2264 N \u2264 10000.\n# Output:\n# a string of binary number\nsub solve {\n my($N) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&solve;\n if(eq_deeply($candidate->(1000),\"1\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(150),\"110\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(147),\"1100\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(333),\"1001\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(963),\"10010\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "pl", - "prompt": "# You are given a list of integers.\n# You need to find the largest prime value and return the sum of its digits.\n# Examples:\n# For lst = [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] the output should be 10\n# For lst = [1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1] the output should be 25\n# For lst = [1,3,1,32,5107,34,83278,109,163,23,2323,32,30,1,9,3] the output should be 13\n# For lst = [0,724,32,71,99,32,6,0,5,91,83,0,5,6] the output should be 11\n# For lst = [0,81,12,3,1,21] the output should be 3\n# For lst = [0,8,1,2,1,7] the output should be 7\nsub skjkasdkd {\n my($lst) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&skjkasdkd;\n if(eq_deeply($candidate->([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]),10)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]),25)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]),13)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]),11)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 81, 12, 3, 1, 21]),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 8, 1, 2, 1, 7]),7)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([8191]),19)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([8191, 123456, 127, 7]),19)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([127, 97, 8192]),10)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "pl", - "prompt": "# Given an array arr of integers, find the minimum number of elements that\n# need to be changed to make the array palindromic. A palindromic array is an array that\n# is read the same backwards and forwards. In one change, you can change one element to any other element.\n# For example:\n# smallest_change([1,2,3,5,4,7,9,6]) == 4\n# smallest_change([1, 2, 3, 4, 3, 2, 2]) == 1\n# smallest_change([1, 2, 3, 2, 1]) == 0\nsub smallest_change {\n my($arr) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&smallest_change;\n if(eq_deeply($candidate->([1, 2, 3, 5, 4, 7, 9, 6]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 3, 2, 2]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 4, 2]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 4, 4, 2]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 2, 1]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 1, 1, 3]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "pl", - "prompt": "# It is the last week of the semester and the teacher has to give the grades\n# to students. The teacher has been making her own algorithm for grading.\n# The only problem is, she has lost the code she used for grading.\n# She has given you a list of GPAs for some students and you have to write \n# a function that can output a list of letter grades using the following table:\n# GPA | Letter grade\n# 4.0 A+\n# > 3.7 A \n# > 3.3 A- \n# > 3.0 B+\n# > 2.7 B \n# > 2.3 B-\n# > 2.0 C+\n# > 1.7 C\n# > 1.3 C-\n# > 1.0 D+ \n# > 0.7 D \n# > 0.0 D-\n# 0.0 E\n# Example:\n# grade_equation([4.0, 3, 1.7, 2, 3.5]) ==> ['A+', 'B', 'C-', 'C', 'A-']\nsub numerical_letter_grade {\n my($grades) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&numerical_letter_grade;\n if(eq_deeply($candidate->([4.0, 3, 1.7, 2, 3.5]),[\"A+\", \"B\", \"C-\", \"C\", \"A-\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.2]),[\"D+\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0.5]),[\"D-\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0.0]),[\"E\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 0.3, 1.5, 2.8, 3.3]),[\"D\", \"D-\", \"C-\", \"B\", \"B+\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0.0, 0.7]),[\"E\", \"D-\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "pl", - "prompt": "# Given the lengths of the three sides of a triangle. Return the area of\n# the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n# Otherwise return -1\n# Three sides make a valid triangle when the sum of any two sides is greater \n# than the third side.\n# Example:\n# triangle_area(3, 4, 5) == 6.00\n# triangle_area(1, 2, 10) == -1\nsub triangle_area {\n my($a, $b, $c) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&triangle_area;\n if(eq_deeply($candidate->(3, 4, 5),6.0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 2, 10),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4, 8, 5),8.18)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 2, 2),1.73)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 2, 3),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10, 5, 7),16.25)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 6, 3),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 1, 1),0.43)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 2, 10),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "pl", - "prompt": "# Check if two words have the same characters.\n# >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n# True\n# >>> same_chars('abcd', 'dddddddabc')\n# True\n# >>> same_chars('dddddddabc', 'abcd')\n# True\n# >>> same_chars('eabcd', 'dddddddabc')\n# False\n# >>> same_chars('abcd', 'dddddddabce')\n# False\n# >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc')\n# False\nsub same_chars {\n my($s0, $s1) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&same_chars;\n if(eq_deeply($candidate->(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcd\", \"dddddddabc\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"dddddddabc\", \"abcd\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"eabcd\", \"dddddddabc\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcd\", \"dddddddabcf\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"eabcdzzzz\", \"dddzzzzzzzddddabc\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aabb\", \"aaccc\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "pl", - "prompt": "# Given an array of integers nums, find the minimum sum of any non-empty sub-array\n# of nums.\n# Example\n# minSubArraySum([2, 3, 4, 1, 2, 4]) == 1\n# minSubArraySum([-1, -2, -3]) == -6\nsub minSubArraySum {\n my($nums) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&minSubArraySum;\n if(eq_deeply($candidate->([2, 3, 4, 1, 2, 4]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -2, -3]),-6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -2, -3, 2, -10]),-14)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-9999999999999999]),-9999999999999999)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 10, 20, 1000000]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -2, -3, 10, -5]),-6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([100, -1, -2, -3, 10, -5]),-6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([10, 11, 13, 8, 3, 4]),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([100, -33, 32, -1, 0, -2]),-33)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-10]),-10)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([7]),7)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, -1]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "pl", - "prompt": "# Given a string s and a natural number n, you have been tasked to implement \n# a function that returns a list of all words from string s that contain exactly \n# n consonants, in order these words appear in the string s.\n# If the string s is empty then the function should return an empty list.\n# Note: you may assume the input string contains only letters and spaces.\n# Examples:\n# select_words(\"Mary had a little lamb\", 4) ==> [\"little\"]\n# select_words(\"Mary had a little lamb\", 3) ==> [\"Mary\", \"lamb\"]\n# select_words(\"simple white space\", 2) ==> []\n# select_words(\"Hello world\", 4) ==> [\"world\"]\n# select_words(\"Uncle sam\", 3) ==> [\"Uncle\"]\nsub select_words {\n my($s, $n) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&select_words;\n if(eq_deeply($candidate->(\"Mary had a little lamb\", 4),[\"little\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Mary had a little lamb\", 3),[\"Mary\", \"lamb\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"simple white space\", 2),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hello world\", 4),[\"world\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Uncle sam\", 3),[\"Uncle\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\", 4),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"a b c d e f\", 1),[\"b\", \"c\", \"d\", \"f\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "pl", - "prompt": "# Return list of all prefixes from shortest to longest of the input string\n# >>> all_prefixes('abc')\n# ['a', 'ab', 'abc']\nsub all_prefixes {\n my($string) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&all_prefixes;\n if(eq_deeply($candidate->(\"\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"asdfgh\"),[\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"WWW\"),[\"W\", \"WW\", \"WWW\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "pl", - "prompt": "# Create a function that takes a value (string) representing a number\n# and returns the closest integer to it. If the number is equidistant\n# from two integers, round it away from zero.\n# Examples\n# >>> closest_integer(\"10\")\n# 10\n# >>> closest_integer(\"15.3\")\n# 15\n# Note:\n# Rounding away from zero means that if the given number is equidistant\n# from two integers, the one you should return is the one that is the\n# farthest from zero. For example closest_integer(\"14.5\") should\n# return 15 and closest_integer(\"-14.5\") should return -15.\nsub closest_integer {\n my($value) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&closest_integer;\n if(eq_deeply($candidate->(\"10\"),10)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"14.5\"),15)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"-15.5\"),-16)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"15.3\"),15)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"0\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "pl", - "prompt": "# Create a function which takes a string representing a file's name, and returns\n# 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n# A file's name is considered to be valid if and only if all the following conditions \n# are met:\n# - There should not be more than three digits ('0'-'9') in the file's name.\n# - The file's name contains exactly one dot '.'\n# - The substring before the dot should not be empty, and it starts with a letter from \n# the latin alphapet ('a'-'z' and 'A'-'Z').\n# - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n# Examples:\n# file_name_check(\"example.txt\") # => 'Yes'\n# file_name_check(\"1example.dll\") # => 'No' (the name should start with a latin alphapet letter)\nsub file_name_check {\n my($file_name) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&file_name_check;\n if(eq_deeply($candidate->(\"example.txt\"),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1example.dll\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"s1sdf3.asd\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"K.dll\"),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"MY16FILE3.exe\"),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"His12FILE94.exe\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"_Y.txt\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"?aREYA.exe\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"/this_is_valid.dll\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"this_is_valid.wow\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"this_is_valid.txt\"),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"this_is_valid.txtexe\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"#this2_i4s_5valid.ten\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"@this1_is6_valid.exe\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"this_is_12valid.6exe4.txt\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"all.exe.txt\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"I563_No.exe\"),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Is3youfault.txt\"),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"no_one#knows.dll\"),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1I563_Yes3.exe\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"I563_Yes3.txtt\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"final..txt\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"final132\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"_f4indsartal132.\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\".txt\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"s.\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "pl", - "prompt": "# You are given two intervals,\n# where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n# The given intervals are closed which means that the interval (start, end)\n# includes both start and end.\n# For each given interval, it is assumed that its start is less or equal its end.\n# Your task is to determine whether the length of intersection of these two \n# intervals is a prime number.\n# Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n# which its length is 1, which not a prime number.\n# If the length of the intersection is a prime number, return \"YES\",\n# otherwise, return \"NO\".\n# If the two intervals don't intersect, return \"NO\".\n# [input/output] samples:\n# intersection((1, 2), (2, 3)) ==> \"NO\"\n# intersection((-1, 1), (0, 4)) ==> \"NO\"\n# intersection((-3, -1), (-5, 5)) ==> \"YES\"\nsub intersection {\n my($interval1, $interval2) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&intersection;\n if(eq_deeply($candidate->([1, 2], [2, 3]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, 1], [0, 4]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-3, -1], [-5, 5]),\"YES\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-2, 2], [-4, 0]),\"YES\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-11, 2], [-1, -1]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2], [3, 5]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2], [1, 2]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-2, -2], [-3, -2]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "pl", - "prompt": "# Return the largest prime factor of n. Assume n > 1 and is not a prime.\n# >>> largest_prime_factor(13195)\n# 29\n# >>> largest_prime_factor(2048)\n# 2\nsub largest_prime_factor {\n my($n) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&largest_prime_factor;\n if(eq_deeply($candidate->(15),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(27),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(63),7)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(330),11)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(13195),29)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "pl", - "prompt": "# Given a string, find out how many distinct characters (regardless of case) does it consist of\n# >>> count_distinct_characters('xyzXYZ')\n# 3\n# >>> count_distinct_characters('Jerry')\n# 4\nsub count_distinct_characters {\n my($string) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&count_distinct_characters;\n if(eq_deeply($candidate->(\"\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcde\"),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdecadeCADE\"),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aaaaAAAAaaaa\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Jerry jERRY JeRRRY\"),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "pl", - "prompt": "# You're given a list of deposit and withdrawal operations on a bank account that starts with\n# zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n# at that point function should return True. Otherwise it should return False.\n# >>> below_zero([1, 2, 3])\n# False\n# >>> below_zero([1, 2, -4, 5])\n# True\nsub below_zero {\n my($operations) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&below_zero;\n if(eq_deeply($candidate->([]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, -3, 1, 2, -3]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, -4, 5, 6]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, -1, 2, -2, 5, -5, 4, -4]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, -1, 2, -2, 5, -5, 4, -5]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, -2, 2, -2, 5, -5, 4, -4]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "pl", - "prompt": "# Find the shortest palindrome that begins with a supplied string.\n# Algorithm idea is simple:\n# - Find the longest postfix of supplied string that is a palindrome.\n# - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n# >>> make_palindrome('')\n# ''\n# >>> make_palindrome('cat')\n# 'catac'\n# >>> make_palindrome('cata')\n# 'catac'\nsub make_palindrome {\n my($string) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&make_palindrome;\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"x\"),\"x\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"xyz\"),\"xyzyx\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"xyx\"),\"xyx\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"jerry\"),\"jerryrrej\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "pl", - "prompt": "# Given a positive integer, obtain its roman numeral equivalent as a string,\n# and return it in lowercase.\n# Restrictions: 1 <= num <= 1000\n# Examples:\n# >>> int_to_mini_roman(19) == 'xix'\n# >>> int_to_mini_roman(152) == 'clii'\n# >>> int_to_mini_roman(426) == 'cdxxvi'\nsub int_to_mini_roman {\n my($number) = @_;\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&int_to_mini_roman;\n if(eq_deeply($candidate->(19),\"xix\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(152),\"clii\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(251),\"ccli\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(426),\"cdxxvi\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(500),\"d\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),\"i\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4),\"iv\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(43),\"xliii\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(90),\"xc\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(94),\"xciv\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(532),\"dxxxii\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(900),\"cm\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(994),\"cmxciv\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1000),\"m\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - } -] \ No newline at end of file diff --git a/data/pl-remove.json b/data/pl-remove.json deleted file mode 100644 index bb4fccbe7a53e2283a32e2b3d275866f9158f1b5..0000000000000000000000000000000000000000 --- a/data/pl-remove.json +++ /dev/null @@ -1,2214 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "pl", - "prompt": "# For a given number n, find the largest number that divides n evenly, smaller than n\nsub largest_divisor {\n my($n) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&largest_divisor;\n if(eq_deeply($candidate->(3),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(100),50)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(49),7)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_47_median", - "language": "pl", - "prompt": "# Return median of elements in the list l.\nsub median {\n my($l) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&median;\n if(eq_deeply($candidate->([3, 1, 2, 4, 5]),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-10, 4, 6, 1000, 10, 20]),8.0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5]),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([6, 5]),5.5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([8, 1, 3, 9, 9, 2, 7]),7)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "pl", - "prompt": "# Return maximum element in the list.\nsub max_element {\n my($l) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&max_element;\n if(eq_deeply($candidate->([1, 2, 3]),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]),124)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "pl", - "prompt": "# Create a function which returns the largest index of an element which\n# is not greater than or equal to the element immediately preceding it. If\n# no such element exists then return -1. The given array will not contain\n# duplicate values.\n# Examples:\nsub can_arrange {\n my($arr) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&can_arrange;\n if(eq_deeply($candidate->([1, 2, 4, 3, 5]),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 4, 5]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 4, 2, 5, 6, 7, 8, 9, 10]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 8, 5, 7, 3]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "pl", - "prompt": "# Create a function that returns True if the last character\n# of a given string is an alphabetical character and is not\n# a part of a word, and False otherwise.\n# Note: \"word\" is a group of characters separated by space.\n# Examples:\nsub check_if_last_char_is_a_letter {\n my($txt) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&check_if_last_char_is_a_letter;\n if(eq_deeply($candidate->(\"apple\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"apple pi e\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"eeeee\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"A\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Pumpkin pie \"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Pumpkin pie 1\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"eeeee e \"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"apple pie\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"apple pi e \"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "pl", - "prompt": "# Return true if a given number is prime, and false otherwise.\nsub is_prime {\n my($n) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_prime;\n if(eq_deeply($candidate->(6),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(101),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(11),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(13441),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(61),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(11),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(17),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(85),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(77),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(255379),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "pl", - "prompt": "# Given a list of positive integers x. return a sorted list of all \n# elements that hasn't any even digit.\n# Note: Returned list should be sorted in increasing order.\n# For example:\nsub unique_digits {\n my($x) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&unique_digits;\n if(eq_deeply($candidate->([15, 33, 1422, 1]),[1, 15, 33])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([152, 323, 1422, 10]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([12345, 2033, 111, 151]),[111, 151])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([135, 103, 31]),[31, 135])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "pl", - "prompt": "# Input are two strings a and b consisting only of 1s and 0s.\n# Perform binary XOR on these inputs and return result also as a string.\nsub string_xor {\n my($a, $b) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&string_xor;\n if(eq_deeply($candidate->(\"111000\", \"101010\"),\"010010\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1\", \"1\"),\"0\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"0101\", \"0000\"),\"0101\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "pl", - "prompt": "# sum_to_n is a function that sums numbers from 1 to n.\nsub sum_to_n {\n my($n) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sum_to_n;\n if(eq_deeply($candidate->(1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6),21)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(11),66)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(30),465)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(100),5050)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "pl", - "prompt": "# Given a list of numbers, return the sum of squares of the numbers\n# in the list that are odd. Ignore numbers that are negative or not integers.\n# If the input list is empty, return 0.\nsub double_the_difference {\n my($lst) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&double_the_difference;\n if(eq_deeply($candidate->([]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5.0, 4.0]),25)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0.1, 0.2, 0.3]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-10.0, -20.0, -30.0]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1.0, -2.0, 8.0]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0.2, 3.0, 5.0]),34)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]),165)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "pl", - "prompt": "# Return length of given string\nsub strlen {\n my($string) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&strlen;\n if(eq_deeply($candidate->(\"\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"x\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"asdasnakj\"),9)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "pl", - "prompt": "# You'll be given a string of words, and your task is to count the number\n# of boredoms. A boredom is a sentence that starts with the word \"I\".\n# Sentences are delimited by '.', '?' or '!'.\n# For example:\nsub is_bored {\n my($S) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_bored;\n if(eq_deeply($candidate->(\"Hello world\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Is the sky blue?\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"I love It !\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"bIt\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"I feel good today. I will be productive. will kill It\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"You and I are going for a walk\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "pl", - "prompt": "# Write a function vowels_count which takes a string representing\n# a word as input and returns the number of vowels in the string.\n# Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n# vowel, but only when it is at the end of the given word.\n# Example:\nsub vowels_count {\n my($s) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&vowels_count;\n if(eq_deeply($candidate->(\"abcde\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Alone\"),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"key\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"bye\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"keY\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"bYe\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ACEDY\"),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "pl", - "prompt": "# Return n-th Fibonacci number.\nsub fib {\n my($n) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&fib;\n if(eq_deeply($candidate->(10),55)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),21)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(11),89)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12),144)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "pl", - "prompt": "# Your task is to implement a function that will simplify the expression\n# x * n. The function returns True if x * n evaluates to a whole number and False\n# otherwise. Both x and n, are string representation of a fraction, and have the following format,\n# / where both numerator and denominator are positive whole numbers.\n# You can assume that x, and n are valid fractions, and do not have zero as denominator.\nsub simplify {\n my($x, $n) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&simplify;\n if(eq_deeply($candidate->(\"1/5\", \"5/1\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1/6\", \"2/1\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"5/1\", \"3/1\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"7/10\", \"10/2\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2/10\", \"50/10\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"7/2\", \"4/2\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"11/6\", \"6/1\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2/3\", \"5/2\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"5/2\", \"3/5\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2/4\", \"8/4\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2/4\", \"4/2\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1/5\", \"5/1\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1/5\", \"1/5\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "pl", - "prompt": "# Given a string s, count the number of uppercase vowels in even indices.\n# For example:\nsub count_upper {\n my($s) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&count_upper;\n if(eq_deeply($candidate->(\"aBCdEf\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdefg\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"dBBE\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"B\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"U\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"EEEE\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "pl", - "prompt": "# You are given a rectangular grid of wells. Each row represents a single well,\n# and each 1 in a row represents a single unit of water.\n# Each well has a corresponding bucket that can be used to extract water from it, \n# and all buckets have the same capacity.\n# Your task is to use the buckets to empty the wells.\n# Output the number of times you need to lower the buckets.\n# Example 1:\n# Example 2:\n# Example 3:\n# Constraints:\n# * all wells have the same length\n# * 1 <= grid.length <= 10^2\n# * 1 <= grid[:,1].length <= 10^2\n# * grid[i][j] -> 0 | 1\n# * 1 <= capacity <= 10\nsub max_fill {\n my($grid, $capacity) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&max_fill;\n if(eq_deeply($candidate->([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1),6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[0, 0, 0], [0, 0, 0]], 5),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1, 1, 1, 1], [1, 1, 1, 1]], 2),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1, 1, 1, 1], [1, 1, 1, 1]], 9),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "pl", - "prompt": "# Given an array arr of integers and a positive integer k, return a sorted list \n# of length k with the maximum k numbers in arr.\n# Example 1:\n# Example 2:\n# Example 3:\n# Note:\n# 1. The length of the array will be in the range of [1, 1000].\n# 2. The elements in the array will be in the range of [-1000, 1000].\n# 3. 0 <= k <= len(arr)\nsub maximum {\n my($arr, $k) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&maximum;\n if(eq_deeply($candidate->([-3, -4, 5], 3),[-4, -3, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, -4, 4], 2),[4, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-3, 2, 1, 2, -1, -2, 1], 1),[2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([123, -123, 20, 0, 1, 2, -3], 3),[2, 20, 123])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-123, 20, 0, 1, 2, -3], 4),[0, 1, 2, 20])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 15, 0, 3, -13, -8, 0], 7),[-13, -8, 0, 0, 3, 5, 15])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, 0, 2, 5, 3, -10], 2),[3, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 0, 5, -7], 1),[5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, -4], 2),[-4, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-10, 10], 2),[-10, 10])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, -23, 243, -400, 0], 0),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "pl", - "prompt": "# Write a function that takes a message, and encodes in such a \n# way that it swaps case of all letters, replaces all vowels in \n# the message with the letter that appears 2 places ahead of that \n# vowel in the english alphabet. \n# Assume only letters. \n# Examples:\nsub encode {\n my($message) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&encode;\n if(eq_deeply($candidate->(\"TEST\"),\"tgst\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Mudasir\"),\"mWDCSKR\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"YES\"),\"ygs\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"This is a message\"),\"tHKS KS C MGSSCGG\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"I DoNt KnOw WhAt tO WrItE\"),\"k dQnT kNqW wHcT Tq wRkTg\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "pl", - "prompt": "# remove_vowels is a function that takes string and returns string without vowels.\nsub remove_vowels {\n my($text) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&remove_vowels;\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdef\nghijklm\"),\"bcdf\nghjklm\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"fedcba\"),\"fdcb\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"eeeee\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"acBAA\"),\"cB\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"EcBOO\"),\"cB\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ybcd\"),\"ybcd\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "pl", - "prompt": "# Return only positive numbers in the list.\nsub get_positive {\n my($l) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&get_positive;\n if(eq_deeply($candidate->([-1, -2, 4, 5, 6]),[4, 5, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]),[5, 3, 2, 3, 3, 9, 123, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -2]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "pl", - "prompt": "# Return a string containing space-delimited numbers starting from 0 upto n inclusive.\nsub string_sequence {\n my($n) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&string_sequence;\n if(eq_deeply($candidate->(0),\"0\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3),\"0 1 2 3\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),\"0 1 2 3 4 5 6 7 8 9 10\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "pl", - "prompt": "# Given a positive integer n, you have to make a pile of n levels of stones.\n# The first level has n stones.\n# The number of stones in the next level is:\n# - the next odd number if n is odd.\n# - the next even number if n is even.\n# Return the number of stones in each level in a list, where element at index\n# i represents the number of stones in the level (i+1).\n# Examples:\nsub make_a_pile {\n my($n) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&make_a_pile;\n if(eq_deeply($candidate->(3),[3, 5, 7])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4),[4, 6, 8, 10])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5),[5, 7, 9, 11, 13])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6),[6, 8, 10, 12, 14, 16])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),[8, 10, 12, 14, 16, 18, 20, 22])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "pl", - "prompt": "# Task\n# 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\n# then check if the result string is palindrome.\n# A string is called palindrome if it reads the same backward as forward.\n# You should return a tuple containing the result string and True/False for the check.\n# Example\nsub reverse_delete {\n my($s, $c) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&reverse_delete;\n if(eq_deeply($candidate->(\"abcde\", \"ae\"),[\"bcd\", \"\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdef\", \"b\"),[\"acdef\", \"\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdedcba\", \"ab\"),[\"cdedc\", 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"dwik\", \"w\"),[\"dik\", \"\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"a\", \"a\"),[\"\", 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdedcba\", \"\"),[\"abcdedcba\", 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdedcba\", \"v\"),[\"abcdedcba\", 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"vabba\", \"v\"),[\"abba\", 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"mamma\", \"mia\"),[\"\", 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "pl", - "prompt": "# For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\nsub flip_case {\n my($string) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&flip_case;\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hello!\"),\"hELLO!\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"These violent delights have violent ends\"),\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "pl", - "prompt": "# You are given a string s.\n# if s[i] is a letter, reverse its case from lower to upper or vise versa, \n# otherwise keep it as it is.\n# If the string contains no letters, reverse the string.\n# The function should return the resulted string.\n# Examples\nsub solve {\n my($s) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&solve;\n if(eq_deeply($candidate->(\"AsDf\"),\"aSdF\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1234\"),\"4321\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ab\"),\"AB\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"#a@C\"),\"#A@c\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"#AsdfW^45\"),\"#aSDFw^45\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"#6@2\"),\"2@6#\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"#$a^D\"),\"#$A^d\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"#ccc\"),\"#CCC\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "pl", - "prompt": "# Filter an input list of strings only for ones that start with a given prefix.\nsub filter_by_prefix {\n my($strings, $prefix) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&filter_by_prefix;\n if(eq_deeply($candidate->([], \"john\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"),[\"xxx\", \"xxxAAA\", \"xxx\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "pl", - "prompt": "# This function takes two positive numbers x and y and returns the\n# biggest even integer number that is in the range [x, y] inclusive. If \n# there's no such number, then the function should return -1.\n# For example:\nsub choose_num {\n my($x, $y) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&choose_num;\n if(eq_deeply($candidate->(12, 15),14)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(13, 12),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(33, 12354),12354)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5234, 5233),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6, 29),28)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(27, 10),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7, 7),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(546, 546),546)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "pl", - "prompt": "# You are given a string representing a sentence,\n# the sentence contains some words separated by a space,\n# and you have to return a string that contains the words from the original sentence,\n# whose lengths are prime numbers,\n# the order of the words in the new string should be the same as the original one.\n# Example 1:\n# Example 2:\n# Constraints:\n# * 1 <= len(sentence) <= 100\n# * sentence contains only letters\nsub words_in_sentence {\n my($sentence) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&words_in_sentence;\n if(eq_deeply($candidate->(\"This is a test\"),\"is\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"lets go for swimming\"),\"go for\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"there is no place available here\"),\"there is no place\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hi I am Hussein\"),\"Hi am Hussein\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"go for it\"),\"go for it\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"here\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"here is\"),\"is\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "pl", - "prompt": "# Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\nsub intersperse {\n my($numbers, $delimeter) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&intersperse;\n if(eq_deeply($candidate->([], 7),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 6, 3, 2], 8),[5, 8, 6, 8, 3, 8, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 2, 2], 2),[2, 2, 2, 2, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "pl", - "prompt": "# Your task is to write a function that returns true if a number x is a simple\n# power of n and false in other cases.\n# x is a simple power of n if n**int=x\n# For example:\nsub is_simple_power {\n my($x, $n) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_simple_power;\n if(eq_deeply($candidate->(16, 2),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(143214, 16),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4, 2),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(9, 3),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(16, 4),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(24, 2),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(128, 4),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12, 6),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 12),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "pl", - "prompt": "# Write a function that returns true if the given number is the multiplication of 3 prime numbers\n# and false otherwise.\n# Knowing that (a) is less then 100. \n# Example:\n# 30 = 2 * 3 * 5\nsub is_multiply_prime {\n my($a) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_multiply_prime;\n if(eq_deeply($candidate->(5),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(30),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(125),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(105),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(126),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(729),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(891),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1001),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "pl", - "prompt": "# Given the lengths of the three sides of a triangle. Return True if the three\n# sides form a right-angled triangle, False otherwise.\n# A right-angled triangle is a triangle in which one angle is right angle or \n# 90 degree.\n# Example:\nsub right_angle_triangle {\n my($a, $b, $c) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&right_angle_triangle;\n if(eq_deeply($candidate->(3, 4, 5),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 2, 3),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10, 6, 8),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 2, 2),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7, 24, 25),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10, 5, 7),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5, 12, 13),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(15, 8, 17),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(48, 55, 73),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 1, 1),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 2, 10),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "pl", - "prompt": "# Create a function that takes 3 numbers.\n# Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n# Returns false in any other cases.\n# Examples\nsub any_int {\n my($x, $y, $z) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&any_int;\n if(eq_deeply($candidate->(2, 3, 1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2.5, 2, 3),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1.5, 5, 3.5),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 6, 2),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4, 2, 2),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2.2, 2.2, 2.2),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(-4, 6, 2),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 1, 1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3, 4, 7),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3.0, 4, 7),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "pl", - "prompt": "# This function takes a list l and returns a list l' such that\n# l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n# to the values of the corresponding indicies of l, but sorted.\nsub sort_third {\n my($l) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sort_third;\n if(eq_deeply($candidate->([5, 6, 3, 4, 8, 9, 2]),[2, 6, 3, 4, 8, 9, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 8, 3, 4, 6, 9, 2]),[2, 8, 3, 4, 6, 9, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 6, 9, 4, 8, 3, 2]),[2, 6, 9, 4, 8, 3, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 6, 3, 4, 8, 9, 2, 1]),[2, 6, 3, 4, 8, 9, 5, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_53_add", - "language": "pl", - "prompt": "# Add two numbers x and y\nsub add {\n my($x, $y) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&add;\n if(eq_deeply($candidate->(0, 1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 0),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 3),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5, 7),12)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7, 5),12)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_69_search", - "language": "pl", - "prompt": "# You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n# zero, and has a frequency greater than or equal to the value of the integer itself. \n# The frequency of an integer is the number of times it appears in the list.\n# If no such a value exist, return -1.\n# Examples:\nsub search {\n my($lst) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&search;\n if(eq_deeply($candidate->([5, 5, 5, 5, 1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 1, 4, 1, 4, 4]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 3]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([8, 8, 8, 8, 8, 8, 8, 8]),8)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 3, 3, 2, 2]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 8, 2]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([8, 8, 3, 6, 5, 6, 4]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 9, 10, 1, 3]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([10]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 10, 10, 9, 2]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "pl", - "prompt": "# Write a function that takes a string and returns True if the string\n# length is a prime number or False otherwise\n# Examples\nsub prime_length {\n my($string) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&prime_length;\n if(eq_deeply($candidate->(\"Hello\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdcba\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"kittens\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"orange\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"wow\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"world\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"MadaM\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Wow\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"HI\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"go\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"gogo\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aaaaaaaaaaaaaaa\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Madam\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"M\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"0\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_58_common", - "language": "pl", - "prompt": "# Return sorted unique common elements for two lists.\nsub common {\n my($l1, $l2) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&common;\n if(eq_deeply($candidate->([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]),[1, 5, 653])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 3, 2, 8], [3, 2]),[2, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 3, 2, 8], [3, 2, 4]),[2, 3, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 3, 2, 8], []),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "pl", - "prompt": "# The Brazilian factorial is defined as:\n# brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n# where n > 0\n# For example:\n# The function will receive an integer as input and should return the special\n# factorial of this integer.\nsub special_factorial {\n my($n) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&special_factorial;\n if(eq_deeply($candidate->(4),288)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5),34560)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7),125411328000)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "pl", - "prompt": "# In this problem, you will implement a function that takes two lists of numbers,\n# and determines whether it is possible to perform an exchange of elements\n# between them to make lst1 a list of only even numbers.\n# There is no limit on the number of exchanged elements between lst1 and lst2.\n# If it is possible to exchange elements between the lst1 and lst2 to make\n# all the elements of lst1 to be even, return \"YES\".\n# Otherwise, return \"NO\".\n# For example:\n# It is assumed that the input lists will be non-empty.\nsub exchange {\n my($lst1, $lst2) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&exchange;\n if(eq_deeply($candidate->([1, 2, 3, 4], [1, 2, 3, 4]),\"YES\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4], [1, 5, 3, 4]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4], [2, 1, 4, 3]),\"YES\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 7, 3], [2, 6, 4]),\"YES\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 7, 3], [2, 6, 3]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 6, 1, 8, 9], [3, 5, 5, 1, 1, 1]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([100, 200], [200, 200]),\"YES\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "pl", - "prompt": "# Given a non-empty array of integers arr and an integer k, return\n# the sum of the elements with at most two digits from the first k elements of arr.\n# Example:\n# Constraints:\n# 1. 1 <= len(arr) <= 100\n# 2. 1 <= k <= len(arr)\nsub add_elements {\n my($arr, $k) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&add_elements;\n if(eq_deeply($candidate->([1, -2, -3, 41, 57, 76, 87, 88, 99], 3),-4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([111, 121, 3, 4000, 5, 6], 2),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([11, 21, 3, 90, 5, 6, 7, 8, 9], 4),125)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4),24)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1], 1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "pl", - "prompt": "# A simple program which should return the value of x if n is \n# a prime number and should return the value of y otherwise.\n# Examples:\nsub x_or_y {\n my($n, $x, $y) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&x_or_y;\n if(eq_deeply($candidate->(7, 34, 12),34)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(15, 8, 5),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3, 33, 5212),33)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1259, 3, 52),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7919, -1, 12),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3609, 1245, 583),583)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(91, 56, 129),129)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6, 34, 1234),1234)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 2, 0),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 2, 0),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "pl", - "prompt": "# Given length of a side and high return area for a triangle.\nsub triangle_area {\n my($a, $h) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&triangle_area;\n if(eq_deeply($candidate->(5, 3),7.5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 2),2.0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10, 8),40.0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "pl", - "prompt": "# Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n# the last couple centuries. However, what people don't know is Tribonacci sequence.\n# Tribonacci sequence is defined by the recurrence:\n# tri(1) = 3\n# tri(n) = 1 + n / 2, if n is even.\n# tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n# For example:\n# tri(2) = 1 + (2 / 2) = 2\n# tri(4) = 3\n# tri(3) = tri(2) + tri(1) + tri(4)\n# = 2 + 3 + 3 = 8 \n# You are given a non-negative integer number n, you have to a return a list of the \n# first n + 1 numbers of the Tribonacci sequence.\n# Examples:\nsub tri {\n my($n) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&tri;\n if(eq_deeply($candidate->(3),[1, 3, 2, 8])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4),[1, 3, 2, 8, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5),[1, 3, 2, 8, 3, 15])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6),[1, 3, 2, 8, 3, 15, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7),[1, 3, 2, 8, 3, 15, 4, 24])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),[1, 3, 2, 8, 3, 15, 4, 24, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(9),[1, 3, 2, 8, 3, 15, 4, 24, 5, 35])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(20),[1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(0),[1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),[1, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "pl", - "prompt": "# You are given a list of two strings, both strings consist of open\n# parentheses '(' or close parentheses ')' only.\n# Your job is to check if it is possible to concatenate the two strings in\n# some order, that the resulting string will be good.\n# A string S is considered to be good if and only if all parentheses in S\n# are balanced. For example: the string '(())()' is good, while the string\n# '())' is not.\n# Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n# Examples:\nsub match_parens {\n my($lst) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&match_parens;\n if(eq_deeply($candidate->([\"()(\", \")\"]),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\")\", \")\"]),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"(()(())\", \"())())\"]),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\")())\", \"(()()(\"]),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"(())))\", \"(()())((\"]),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"()\", \"())\"]),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"(()(\", \"()))()\"]),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"((((\", \"((())\"]),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\")(()\", \"(()(\"]),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\")(\", \")(\"]),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"(\", \")\"]),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\")\", \"(\"]),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "pl", - "prompt": "# From a list of integers, remove all elements that occur more than once.\n# Keep order of elements left the same as in the input.\nsub remove_duplicates {\n my($numbers) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&remove_duplicates;\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4]),[1, 2, 3, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 2, 4, 3, 5]),[1, 4, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "pl", - "prompt": "# Return a greatest common divisor of two integers a and b\nsub greatest_common_divisor {\n my($a, $b) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&greatest_common_divisor;\n if(eq_deeply($candidate->(3, 7),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10, 15),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(49, 14),7)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(144, 60),12)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "pl", - "prompt": "# Checks if given string is a palindrome\nsub is_palindrome {\n my($text) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_palindrome;\n if(eq_deeply($candidate->(\"\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aba\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aaaaa\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"zbcd\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"xywyx\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"xywyz\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"xywzx\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "pl", - "prompt": "# xs represent coefficients of a polynomial.\n# xs[0] + xs[1] * x + xs[2] * x^2 + ....\n# Return derivative of this polynomial in the same form.\nsub derivative {\n my($xs) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&derivative;\n if(eq_deeply($candidate->([3, 1, 2, 4, 5]),[1, 4, 12, 20])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3]),[2, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 1]),[2, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 1, 0, 4]),[2, 2, 0, 16])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "pl", - "prompt": "# In this task, you will be given a string that represents a number of apples and oranges \n# that are distributed in a basket of fruit this basket contains \n# apples, oranges, and mango fruits. Given the string that represents the total number of \n# the oranges and apples and an integer that represent the total number of the fruits \n# in the basket return the number of the mango fruits in the basket.\n# for examble:\nsub fruit_distribution {\n my($s, $n) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&fruit_distribution;\n if(eq_deeply($candidate->(\"5 apples and 6 oranges\", 19),8)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"5 apples and 6 oranges\", 21),10)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"0 apples and 1 oranges\", 3),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1 apples and 0 oranges\", 3),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2 apples and 3 oranges\", 100),95)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2 apples and 3 oranges\", 5),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1 apples and 100 oranges\", 120),19)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "pl", - "prompt": "# Write a function that takes an integer a and returns True \n# if this ingeger is a cube of some integer number.\n# Note: you may assume the input is always valid.\n# Examples:\nsub iscube {\n my($a) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&iscube;\n if(eq_deeply($candidate->(1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(-1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(64),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(180),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1000),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(0),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1729),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "pl", - "prompt": "# In this Kata, you have to sort an array of non-negative integers according to\n# number of ones in their binary representation in ascending order.\n# For similar number of ones, sort based on decimal value.\n# It must be implemented like this:\nsub sort_array {\n my($arr) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sort_array;\n if(eq_deeply($candidate->([1, 5, 2, 3, 4]),[1, 2, 4, 3, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-2, -3, -4, -5, -6]),[-4, -2, -6, -5, -3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 0, 2, 3, 4]),[0, 1, 2, 4, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]),[2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 6, 44, 12, 32, 5]),[32, 3, 5, 6, 12, 44])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, 8, 16, 32]),[2, 4, 8, 16, 32])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, 8, 16, 32]),[2, 4, 8, 16, 32])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "pl", - "prompt": "# Given a list of strings, where each string consists of only digits, return a list.\n# Each element i of the output should be \"the number of odd elements in the\n# string i of the input.\" where all the i's should be replaced by the number\n# of odd digits in the i'th string of the input.\nsub odd_count {\n my($lst) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&odd_count;\n if(eq_deeply($candidate->([\"1234567\"]),[\"the number of odd elements 4n the str4ng 4 of the 4nput.\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($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.\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"271\", \"137\", \"314\"]),[\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "pl", - "prompt": "# brackets is a string of \"(\" and \")\".\n# return True if every opening bracket has a corresponding closing bracket.\nsub correct_bracketing {\n my($brackets) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&correct_bracketing;\n if(eq_deeply($candidate->(\"()\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"(()())\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"()()(()())()\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"()()((()()())())(()()(()))\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"((()())))\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\")(()\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"(\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"((((\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\")\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"(()\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"()()(()())())(()\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"()()(()())()))()\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "pl", - "prompt": "# Task\n# Write a function that takes a string as input and returns the sum of the upper characters only'\n# ASCII codes.\n# Examples:\nsub digitSum {\n my($s) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&digitSum;\n if(eq_deeply($candidate->(\"\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abAB\"),131)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcCd\"),67)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"helloE\"),69)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"woArBld\"),131)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aAaaaXa\"),153)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\" How are yOu?\"),151)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"You arE Very Smart\"),327)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "pl", - "prompt": "# Write a function that accepts a list of strings as a parameter,\n# deletes the strings that have odd lengths from it,\n# and returns the resulted list with a sorted order,\n# The list is always a list of strings and never an array of numbers,\n# and it may contain duplicates.\n# The order of the list should be ascending by length of each word, and you\n# should return the list sorted by that rule.\n# If two words have the same length, sort the list alphabetically.\n# The function should return a list of strings in sorted order.\n# You may assume that all words will have the same length.\n# For example:\nsub sorted_list_sum {\n my($lst) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sorted_list_sum;\n if(eq_deeply($candidate->([\"aa\", \"a\", \"aaa\"]),[\"aa\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"school\", \"AI\", \"asdf\", \"b\"]),[\"AI\", \"asdf\", \"school\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"d\", \"b\", \"c\", \"a\"]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"d\", \"dcba\", \"abcd\", \"a\"]),[\"abcd\", \"dcba\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"AI\", \"ai\", \"au\"]),[\"AI\", \"ai\", \"au\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"aaaa\", \"bbbb\", \"dd\", \"cc\"]),[\"cc\", \"dd\", \"aaaa\", \"bbbb\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "pl", - "prompt": "# You are given an array arr of integers and you need to return\n# sum of magnitudes of integers multiplied by product of all signs\n# of each number in the array, represented by 1, -1 or 0.\n# Note: return None for empty arr.\n# Example:\nsub prod_signs {\n my($arr) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&prod_signs;\n if(eq_deeply($candidate->([1, 2, 2, -4]),-9)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 1]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 1, 1, 2, 3, -1, 1]),-10)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),undef)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, 1, 2, -1, -1, 9]),20)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, 1, -1, 1]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, 1, 1, 1]),-4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, 1, 1, 0]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "pl", - "prompt": "# Return list with elements incremented by 1.\nsub incr_list {\n my($l) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&incr_list;\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 1]),[4, 3, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 2, 5, 2, 3, 3, 9, 0, 123]),[6, 3, 6, 3, 4, 4, 10, 1, 124])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "pl", - "prompt": "# From a given list of integers, generate a list of rolling maximum element found until given moment\n# in the sequence.\nsub rolling_max {\n my($numbers) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&rolling_max;\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4]),[1, 2, 3, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 3, 2, 1]),[4, 4, 4, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 3, 100, 3]),[3, 3, 3, 100, 100])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "pl", - "prompt": "# Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n# separate those group into separate strings and return the list of those.\n# Separate groups are balanced (each open brace is properly closed) and not nested within each other\n# Ignore any spaces in the input string.\nsub separate_paren_groups {\n my($paren_string) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&separate_paren_groups;\n if(eq_deeply($candidate->(\"(()()) ((())) () ((())()())\"),[\"(()())\", \"((()))\", \"()\", \"((())()())\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"() (()) ((())) (((())))\"),[\"()\", \"(())\", \"((()))\", \"(((())))\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"(()(())((())))\"),[\"(()(())((())))\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"( ) (( )) (( )( ))\"),[\"()\", \"(())\", \"(()())\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "pl", - "prompt": "# You will be given a string of words separated by commas or spaces. Your task is\n# to split the string into words and return an array of the words.\n# For example:\nsub words_string {\n my($s) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&words_string;\n if(eq_deeply($candidate->(\"Hi, my name is John\"),[\"Hi\", \"my\", \"name\", \"is\", \"John\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"One, two, three, four, five, six\"),[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hi, my name\"),[\"Hi\", \"my\", \"name\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"One,, two, three, four, five, six,\"),[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ahmed , gamal\"),[\"ahmed\", \"gamal\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "pl", - "prompt": "# Create a function that takes integers, floats, or strings representing\n# real numbers, and returns the larger variable in its given variable type.\n# Return None if the values are equal.\n# Note: If a real number is represented as a string, the floating point might be . or ,\nsub compare_one {\n my($a, $b) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&compare_one;\n if(eq_deeply($candidate->(1, 2),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 2.5),2.5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 3),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5, 6),6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, \"2,3\"),\"2,3\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"5,1\", \"6\"),\"6\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1\", \"2\"),\"2\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1\", 1),undef)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "pl", - "prompt": "# Filter given list of any python values only for integers\nsub filter_integers {\n my($values) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&filter_integers;\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, {}, [], 23.2, 9, \"adasd\"]),[4, 9])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, \"c\", 3, 3, \"a\", \"b\"]),[3, 3, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "pl", - "prompt": "# This function takes a list l and returns a list l' such that\n# l' is identical to l in the odd indicies, while its values at the even indicies are equal\n# to the values of the even indicies of l, but sorted.\nsub sort_even {\n my($l) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sort_even;\n if(eq_deeply($candidate->([1, 2, 3]),[1, 2, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]),[-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 8, -12, 4, 23, 2, 3, 11, 12, -10]),[-12, 8, 3, 4, 5, 2, 12, 11, 23, -10])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "pl", - "prompt": "# I think we all remember that feeling when the result of some long-awaited\n# event is finally known. The feelings and thoughts you have at that moment are\n# definitely worth noting down and comparing.\n# Your task is to determine if a person correctly guessed the results of a number of matches.\n# You are given two arrays of scores and guesses of equal length, where each index shows a match. \n# Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n# the value is 0, and if not, the value is the absolute difference between the guess and the score.\n# example:\nsub compare {\n my($game, $guess) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&compare;\n if(eq_deeply($candidate->([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2]),[0, 0, 0, 0, 3, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]),[0, 0, 0, 0, 0, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3], [-1, -2, -3]),[2, 4, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 5], [-1, 2, 3, 4]),[2, 0, 0, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "pl", - "prompt": "# Given a positive integer n, return a tuple that has the number of even and odd\n# integer palindromes that fall within the range(1, n), inclusive.\n# Example 1:\n# Explanation:\n# Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n# Example 2:\n# Explanation:\n# Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n# Note:\n# 1. 1 <= n <= 10^3\n# 2. returned tuple has the number of even and odd integer palindromes respectively.\nsub even_odd_palindrome {\n my($n) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&even_odd_palindrome;\n if(eq_deeply($candidate->(123),[8, 13])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12),[4, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3),[1, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(63),[6, 8])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(25),[5, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(19),[4, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(9),[4, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),[0, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "pl", - "prompt": "# The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fib4(0) -> 0\n# fib4(1) -> 0\n# fib4(2) -> 2\n# fib4(3) -> 0\n# fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n# Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\nsub fib4 {\n my($n) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&fib4;\n if(eq_deeply($candidate->(5),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),28)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),104)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12),386)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "pl", - "prompt": "# Given two positive integers a and b, return the even digits between a\n# and b, in ascending order.\n# For example:\nsub generate_integers {\n my($a, $b) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&generate_integers;\n if(eq_deeply($candidate->(2, 10),[2, 4, 6, 8])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10, 2),[2, 4, 6, 8])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(132, 2),[2, 4, 6, 8])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(17, 89),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "pl", - "prompt": "# For a given list of input numbers, calculate Mean Absolute Deviation\n# around the mean of this dataset.\n# Mean Absolute Deviation is the average absolute difference between each\n# element and a centerpoint (mean in this case):\n# MAD = average | x - x_mean |\nsub mean_absolute_deviation {\n my($numbers) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&mean_absolute_deviation;\n if(eq_deeply($candidate->([1.0, 2.0]),0.5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.0, 4.0]),1.0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.0, 4.0, 5.0]),1.2)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "pl", - "prompt": "# Create a function encrypt that takes a string as an argument and\n# returns a string encrypted with the alphabet being rotated. \n# The alphabet should be rotated in a manner such that the letters \n# shift down by two multiplied to two places.\n# For example:\nsub encrypt {\n my($s) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&encrypt;\n if(eq_deeply($candidate->(\"hi\"),\"lm\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"asdfghjkl\"),\"ewhjklnop\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"gf\"),\"kj\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"et\"),\"ix\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"faewfawefaewg\"),\"jeiajeaijeiak\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"hellomyfriend\"),\"lippsqcjvmirh\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\"),\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"a\"),\"e\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "pl", - "prompt": "# Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n# The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n# as follows: start with any positive integer n. Then each term is obtained from the \n# previous term as follows: if the previous term is even, the next term is one half of \n# the previous term. If the previous term is odd, the next term is 3 times the previous\n# term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n# Note: \n# 1. Collatz(1) is [1].\n# 2. returned list sorted in increasing order.\n# For example:\n# get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\nsub get_odd_collatz {\n my($n) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&get_odd_collatz;\n if(eq_deeply($candidate->(14),[1, 5, 7, 11, 13, 17])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5),[1, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12),[1, 3, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),[1])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "pl", - "prompt": "# Find how many times a given substring can be found in the original string. Count overlaping cases.\nsub how_many_times {\n my($string, $substring) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&how_many_times;\n if(eq_deeply($candidate->(\"\", \"x\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"xyxyxyx\", \"x\"),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"cacacacac\", \"cac\"),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"john doe\", \"john\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "pl", - "prompt": "# We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n# numbers in the array will be randomly ordered. Your task is to determine if\n# it is possible to get an array sorted in non-decreasing order by performing \n# the following operation on the given array:\n# You are allowed to perform right shift operation any number of times.\n# One right shift operation means shifting all elements of the array by one\n# position in the right direction. The last element of the array will be moved to\n# the starting position in the array i.e. 0th index. \n# If it is possible to obtain the sorted array by performing the above operation\n# then return True else return False.\n# If the given array is empty then return True.\n# Note: The given list is guaranteed to have unique elements.\n# For Example:\n# Explanation: By performin 2 right shift operations, non-decreasing order can\n# be achieved for the given array.\n# Explanation:It is not possible to get non-decreasing order for the given\n# array by performing any number of right shift operations.\nsub move_one_ball {\n my($arr) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&move_one_ball;\n if(eq_deeply($candidate->([3, 4, 5, 1, 2]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 5, 10, 1, 2]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 3, 1, 2]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 5, 4, 1, 2]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "pl", - "prompt": "# Write a function which sorts the given list of integers\n# in ascending order according to the sum of their digits.\n# Note: if there are several items with similar sum of their digits,\n# order them based on their index in original list.\n# For example:\nsub order_by_points {\n my($nums) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&order_by_points;\n if(eq_deeply($candidate->([1, 11, -1, -11, -12]),[-1, -11, 1, -12, 11])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]),[0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, -11, -32, 43, 54, -98, 2, -3]),[-3, -32, -98, -11, 1, 2, 43, 54])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]),[1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 6, 6, -76, -21, 23, 4]),[-76, -21, 0, 4, 23, 6, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "pl", - "prompt": "# Return list of prime factors of given integer in the order from smallest to largest.\n# Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n# Input number should be equal to the product of all factors\nsub factorize {\n my($n) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&factorize;\n if(eq_deeply($candidate->(2),[2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4),[2, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),[2, 2, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(57),[3, 19])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3249),[3, 3, 19, 19])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(185193),[3, 3, 3, 19, 19, 19])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(20577),[3, 19, 19, 19])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(18),[2, 3, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "pl", - "prompt": "# Return True if all numbers in the list l are below threshold t.\nsub below_threshold {\n my($l, $t) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&below_threshold;\n if(eq_deeply($candidate->([1, 2, 4, 10], 100),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 20, 4, 10], 5),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 20, 4, 10], 21),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 20, 4, 10], 22),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 8, 4, 10], 11),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 8, 4, 10], 10),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "pl", - "prompt": "# You are given two positive integers n and m, and your task is to compute the\n# average of the integers from n through m (including n and m). \n# Round the answer to the nearest integer and convert that to binary.\n# If n is greater than m, return -1.\n# Example:\nsub rounded_avg {\n my($n, $m) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&rounded_avg;\n if(eq_deeply($candidate->(1, 5),\"0b11\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7, 13),\"0b1010\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(964, 977),\"0b1111001010\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(996, 997),\"0b1111100100\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(560, 851),\"0b1011000010\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(185, 546),\"0b101101110\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(362, 496),\"0b110101101\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(350, 902),\"0b1001110010\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(197, 233),\"0b11010111\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7, 5),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5, 1),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5, 5),\"0b101\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "pl", - "prompt": "# Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n# For each of the group, output the deepest level of nesting of parentheses.\n# E.g. (()()) has maximum two levels of nesting while ((())) has three.\nsub parse_nested_parens {\n my($paren_string) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&parse_nested_parens;\n if(eq_deeply($candidate->(\"(()()) ((())) () ((())()())\"),[2, 3, 1, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"() (()) ((())) (((())))\"),[1, 2, 3, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"(()(())((())))\"),[4])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "pl", - "prompt": "# Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n# Examples\nsub solution {\n my($lst) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&solution;\n if(eq_deeply($candidate->([5, 8, 7, 1]),12)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 3, 3, 3, 3]),9)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([30, 13, 24, 321]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 9]),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, 8]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([30, 13, 23, 32]),23)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 13, 2, 9]),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "pl", - "prompt": "# You are given a positive integer n. You have to create an integer array a of length n.\n# For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n# Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n# and a[i] + a[j] + a[k] is a multiple of 3.\n# Example :\n# Explanation: \n# a = [1, 3, 7, 13, 21]\n# The only valid triple is (1, 7, 13).\nsub get_max_triples {\n my($n) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&get_max_triples;\n if(eq_deeply($candidate->(5),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),36)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(100),53361)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "pl", - "prompt": "# There are eight planets in our solar system: the closerst to the Sun \n# is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n# Uranus, Neptune.\n# Write a function that takes two planet names as strings planet1 and planet2. \n# The function should return a tuple containing all planets whose orbits are \n# located between the orbit of planet1 and the orbit of planet2, sorted by \n# the proximity to the sun. \n# The function should return an empty tuple if planet1 or planet2\n# are not correct planet names. \n# Examples\nsub bf {\n my($planet1, $planet2) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&bf;\n if(eq_deeply($candidate->(\"Jupiter\", \"Neptune\"),[\"Saturn\", \"Uranus\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Earth\", \"Mercury\"),[\"Venus\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Mercury\", \"Uranus\"),[\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Neptune\", \"Venus\"),[\"Earth\", \"Mars\", \"Jupiter\", \"Saturn\", \"Uranus\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Earth\", \"Earth\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Mars\", \"Earth\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Jupiter\", \"Makemake\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "pl", - "prompt": "# You are given a list of integers.\n# Write a function next_smallest() that returns the 2nd smallest element of the list.\n# Return None if there is no such element.\nsub next_smallest {\n my($lst) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&next_smallest;\n if(eq_deeply($candidate->([1, 2, 3, 4, 5]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 1, 4, 3, 2]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),undef)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 1]),undef)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 1, 1, 1, 0]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 1]),undef)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-35, 34, 12, -45]),-35)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "pl", - "prompt": "# Input is a space-delimited string of numberals from 'zero' to 'nine'.\n# Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n# Return the string with numbers sorted from smallest to largest\nsub sort_numbers {\n my($numbers) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sort_numbers;\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"three\"),\"three\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"three five nine\"),\"three five nine\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"five zero four seven nine eight\"),\"zero four five seven eight nine\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"six five four three two one zero\"),\"zero one two three four five six\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "pl", - "prompt": "# You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\nsub cycpattern_check {\n my($a, $b) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&cycpattern_check;\n if(eq_deeply($candidate->(\"xyzw\", \"xyw\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"yello\", \"ell\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"whattup\", \"ptut\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"efef\", \"fee\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abab\", \"aabb\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"winemtt\", \"tinem\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "pl", - "prompt": "# You will be given a number in decimal form and your task is to convert it to\n# binary format. The function should return a string, with each character representing a binary\n# number. Each character in the string will be '0' or '1'.\n# There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n# The extra characters are there to help with the format.\n# Examples:\nsub decimal_to_binary {\n my($decimal) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&decimal_to_binary;\n if(eq_deeply($candidate->(0),\"db0db\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(32),\"db100000db\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(103),\"db1100111db\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(15),\"db1111db\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "pl", - "prompt": "# Filter an input list of strings only for ones that contain given substring\nsub filter_by_substring {\n my($strings, $substring) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&filter_by_substring;\n if(eq_deeply($candidate->([], \"john\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"),[\"xxx\", \"xxxAAA\", \"xxx\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xx\"),[\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"grunt\", \"trumpet\", \"prune\", \"gruesome\"], \"run\"),[\"grunt\", \"prune\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "pl", - "prompt": "# Given an integer. return a tuple that has the number of even and odd digits respectively.\n# Example:\nsub even_odd_count {\n my($num) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&even_odd_count;\n if(eq_deeply($candidate->(7),[0, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(-78),[1, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3452),[2, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(346211),[3, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(-345821),[3, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(-2),[1, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(-45347),[2, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(0),[1, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "pl", - "prompt": "# Write a function that accepts a list of strings.\n# The list contains different words. Return the word with maximum number\n# of unique characters. If multiple strings have maximum number of unique\n# characters, return the one which comes first in lexicographical order.\nsub find_max {\n my($words) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&find_max;\n if(eq_deeply($candidate->([\"name\", \"of\", \"string\"]),\"string\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"name\", \"enam\", \"game\"]),\"enam\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"aaaaaaa\", \"bb\", \"cc\"]),\"aaaaaaa\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"abc\", \"cba\"]),\"abc\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"play\", \"this\", \"game\", \"of\", \"footbott\"]),\"footbott\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"we\", \"are\", \"gonna\", \"rock\"]),\"gonna\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"we\", \"are\", \"a\", \"mad\", \"nation\"]),\"nation\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"this\", \"is\", \"a\", \"prrk\"]),\"this\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"b\"]),\"b\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"play\", \"play\", \"play\"]),\"play\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "pl", - "prompt": "# Create a function that returns a tuple (a, b), where 'a' is\n# the largest of negative integers, and 'b' is the smallest\n# of positive integers in a list.\n# If there is no negative or positive integers, return them as None.\n# Examples:\nsub largest_smallest_integers {\n my($lst) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&largest_smallest_integers;\n if(eq_deeply($candidate->([2, 4, 1, 3, 5, 7]),[undef, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, 1, 3, 5, 7, 0]),[undef, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, 2, 4, 5, 6, -2]),[-2, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 5, 3, 6, 2, 7, -7]),[-7, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([7, 3, 8, 4, 9, 2, 5, -9]),[-9, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),[undef, undef])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0]),[undef, undef])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -3, -5, -6]),[-1, undef])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -3, -5, -6, 0]),[-1, undef])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-6, -4, -4, -3, 1]),[-3, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-6, -4, -4, -3, -100, 1]),[-3, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "pl", - "prompt": "# \"Given an array representing a branch of a tree that has non-negative integer nodes\n# your task is to pluck one of the nodes and return it.\n# The plucked node should be the node with the smallest even value.\n# If multiple nodes with the same smallest even value are found return the node that has smallest index.\n# The plucked node should be returned in a list, [ smalest_value, its index ],\n# If there are no even values or the given array is empty, return [].\n# Example 1:\n# Explanation: 2 has the smallest even value, and 2 has the smallest index.\n# Example 2:\n# Explanation: 2 has the smallest even value, and 2 has the smallest index.\n# Example 3:\n# Example 4:\n# Explanation: 0 is the smallest value, but there are two zeros,\n# so we will choose the first zero, which has the smallest index.\n# Constraints:\n# * 1 <= nodes.length <= 10000\n# * 0 <= node.value\nsub pluck {\n my($arr) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&pluck;\n if(eq_deeply($candidate->([4, 2, 3]),[2, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3]),[2, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 0, 3, 0, 4, 2]),[0, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 0, 5, 3]),[0, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 4, 8, 4, 8]),[4, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([7, 6, 7, 1]),[6, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([7, 9, 7, 1]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "pl", - "prompt": "# Write a function count_nums which takes an array of integers and returns\n# the number of elements which has a sum of digits > 0.\n# If a number is negative, then its first signed digit will be negative:\n# e.g. -123 has signed digits -1, 2, and 3.\nsub count_nums {\n my($arr) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&count_nums;\n if(eq_deeply($candidate->([]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -2, 0]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 1, 2, -2, 3, 4, 5]),6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 6, 9, -6, 0, 1, 5]),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 100, 98, -7, 1, -1]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([12, 23, 34, -45, -56, 0]),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "pl", - "prompt": "# Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n# each cell of the grid contains a value. Every integer in the range [1, N * N]\n# inclusive appears exactly once on the cells of the grid.\n# You have to find the minimum path of length k in the grid. You can start\n# from any cell, and in each step you can move to any of the neighbor cells,\n# in other words, you can go to cells which share an edge with you current\n# cell.\n# Please note that a path of length k means visiting exactly k cells (not\n# necessarily distinct).\n# You CANNOT go off the grid.\n# A path A (of length k) is considered less than a path B (of length k) if\n# after making the ordered lists of the values on the cells that A and B go\n# through (let's call them lst_A and lst_B), lst_A is lexicographically less\n# than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n# such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n# lst_A[j] = lst_B[j].\n# It is guaranteed that the answer is unique.\n# Return an ordered list of the values on the cells that the minimum path go through.\n# Examples:\nsub minPath {\n my($grid, $k) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&minPath;\n if(eq_deeply($candidate->([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3),[1, 2, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1),[1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], 4),[1, 2, 1, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[6, 4, 13, 10], [5, 7, 12, 1], [3, 16, 11, 15], [8, 14, 9, 2]], 7),[1, 10, 1, 10, 1, 10, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[8, 14, 9, 2], [6, 4, 13, 15], [5, 7, 1, 12], [3, 10, 11, 16]], 5),[1, 7, 1, 7, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[11, 8, 7, 2], [5, 16, 14, 4], [9, 3, 15, 6], [12, 13, 10, 1]], 9),[1, 6, 1, 6, 1, 6, 1, 6, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[12, 13, 10, 1], [9, 3, 15, 6], [5, 16, 14, 4], [11, 8, 7, 2]], 12),[1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[2, 7, 4], [3, 1, 5], [6, 8, 9]], 8),[1, 3, 1, 3, 1, 3, 1, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[6, 1, 5], [3, 8, 9], [2, 7, 4]], 8),[1, 5, 1, 5, 1, 5, 1, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1, 2], [3, 4]], 10),[1, 2, 1, 2, 1, 2, 1, 2, 1, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1, 3], [3, 2]], 10),[1, 3, 1, 3, 1, 3, 1, 3, 1, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "pl", - "prompt": "# Given list of integers, return list in strange order.\n# Strange sorting, is when you start with the minimum value,\n# then maximum of the remaining integers, then minimum and so on.\n# Examples:\nsub strange_sort_list {\n my($lst) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&strange_sort_list;\n if(eq_deeply($candidate->([1, 2, 3, 4]),[1, 4, 2, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 6, 7, 8, 9]),[5, 9, 6, 8, 7])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 5]),[1, 5, 2, 4, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 6, 7, 8, 9, 1]),[1, 9, 5, 8, 6, 7])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 5, 5, 5]),[5, 5, 5, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 5, 6, 7, 8]),[1, 8, 2, 7, 3, 6, 4, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 2, 2, 2, 5, 5, -5, -5]),[-5, 5, -5, 5, 0, 2, 2, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([111111]),[111111])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "pl", - "prompt": "# Given a string 'text', return its md5 hash equivalent string.\n# If 'text' is an empty string, return None.\nsub string_to_md5 {\n my($text) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&string_to_md5;\n if(eq_deeply($candidate->(\"Hello world\"),\"3e25960a79dbc69b674cd4ec67a72c62\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),undef)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"A B C\"),\"0ef78513b0cb8cef12743f5aeb35f888\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"password\"),\"5f4dcc3b5aa765d61d8327deb882cf99\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "pl", - "prompt": "# You are given a word. Your task is to find the closest vowel that stands between \n# two consonants from the right side of the word (case sensitive).\n# Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n# find any vowel met the above condition. \n# You may assume that the given string contains English letter only.\n# Example:\nsub get_closest_vowel {\n my($word) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&get_closest_vowel;\n if(eq_deeply($candidate->(\"yogurt\"),\"u\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"full\"),\"u\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"easy\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"eAsy\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ali\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"bad\"),\"a\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"most\"),\"o\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ab\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ba\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"quick\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"anime\"),\"i\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Asia\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Above\"),\"o\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "pl", - "prompt": "# Change numerical base of input number x to base.\n# return string representation after the conversion.\n# base numbers are less than 10.\nsub change_base {\n my($x, $base) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&change_base;\n if(eq_deeply($candidate->(8, 3),\"22\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(9, 3),\"100\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(234, 2),\"11101010\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(16, 2),\"10000\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8, 2),\"1000\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7, 2),\"111\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 3),\"2\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3, 4),\"3\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4, 5),\"4\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5, 6),\"5\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6, 7),\"6\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7, 8),\"7\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "pl", - "prompt": "# Check if in given list of numbers, are any two numbers closer to each other than\n# given threshold.\nsub has_close_elements {\n my($numbers, $threshold) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&has_close_elements;\n if(eq_deeply($candidate->([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 5.9, 4.0, 5.0], 0.95),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 5.9, 4.0, 5.0], 0.8),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.1, 2.2, 3.1, 4.1, 5.1], 1.0),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.1, 2.2, 3.1, 4.1, 5.1], 0.5),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "pl", - "prompt": "# Create a function that takes a string as input which contains only square brackets.\n# The function should return True if and only if there is a valid subsequence of brackets \n# where at least one bracket in the subsequence is nested.\nsub is_nested {\n my($string) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_nested;\n if(eq_deeply($candidate->(\"[[]]\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[]]]]]]][[[[[]\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[][]\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[]\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[[[[]]]]\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[]]]]]]]]]]\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[][][[]]\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[[]\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[]]\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[[]][[\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[[][]]\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[[[[[[[[\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"]]]]]]]]\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "pl", - "prompt": "# Concatenate list of strings into a single string\nsub concatenate {\n my($strings) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&concatenate;\n if(eq_deeply($candidate->([]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"x\", \"y\", \"z\"]),\"xyz\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"x\", \"y\", \"z\", \"w\", \"k\"]),\"xyzwk\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "pl", - "prompt": "# prime_fib returns n-th number that is a Fibonacci number and it's also prime.\nsub prime_fib {\n my($n) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&prime_fib;\n if(eq_deeply($candidate->(1),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4),13)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5),89)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6),233)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7),1597)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),28657)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(9),514229)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),433494437)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "pl", - "prompt": "# From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n# other and return them in order (smaller number, larger number).\nsub find_closest_elements {\n my($numbers) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&find_closest_elements;\n if(eq_deeply($candidate->([1.0, 2.0, 3.9, 4.0, 5.0, 2.2]),[3.9, 4.0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 5.9, 4.0, 5.0]),[5.0, 5.9])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]),[2.0, 2.2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]),[2.0, 2.0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.1, 2.2, 3.1, 4.1, 5.1]),[2.2, 3.1])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "pl", - "prompt": "# You have been tasked to write a function that receives \n# a hexadecimal number as a string and counts the number of hexadecimal \n# digits that are primes (prime number, or a prime, is a natural number \n# greater than 1 that is not a product of two smaller natural numbers).\n# Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n# Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n# So you have to determine a number of the following digits: 2, 3, 5, 7, \n# B (=decimal 11), D (=decimal 13).\n# Note: you may assume the input is always correct or empty string, \n# and symbols A,B,C,D,E,F are always uppercase.\n# Examples:\nsub hex_key {\n my($num) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&hex_key;\n if(eq_deeply($candidate->(\"AB\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1077E\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ABED1A33\"),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2020\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"123456789ABCDEF0\"),6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"112233445566778899AABBCCDDEEFF00\"),12)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "pl", - "prompt": "# Complete the function that takes two integers and returns \n# the product of their unit digits.\n# Assume the input is always valid.\n# Examples:\nsub multiply {\n my($a, $b) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&multiply;\n if(eq_deeply($candidate->(148, 412),16)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(19, 28),72)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2020, 1851),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(14, -15),20)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(76, 67),42)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(17, 27),49)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(0, 1),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(0, 0),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "pl", - "prompt": "# Given list of numbers (of at least two elements), apply a linear transform to that list,\n# such that the smallest number will become 0 and the largest will become 1\nsub rescale_to_unit {\n my($numbers) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&rescale_to_unit;\n if(eq_deeply($candidate->([2.0, 49.9]),[0.0, 1.0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([100.0, 49.9]),[1.0, 0.0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.0, 4.0, 5.0]),[0.0, 0.25, 0.5, 0.75, 1.0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2.0, 1.0, 5.0, 3.0, 4.0]),[0.25, 0.0, 1.0, 0.5, 0.75])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([12.0, 11.0, 15.0, 13.0, 14.0]),[0.25, 0.0, 1.0, 0.5, 0.75])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "pl", - "prompt": "# Given a positive integer n, return the product of the odd digits.\n# Return 0 if all digits are even.\n# For example:\nsub digits {\n my($n) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&digits;\n if(eq_deeply($candidate->(5),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(54),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(120),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5014),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(98765),315)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5576543),2625)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2468),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "pl", - "prompt": "# You will be given the name of a class (a string) and a list of extensions.\n# The extensions are to be used to load additional classes to the class. The\n# strength of the extension is as follows: Let CAP be the number of the uppercase\n# letters in the extension's name, and let SM be the number of lowercase letters \n# in the extension's name, the strength is given by the fraction CAP - SM. \n# You should find the strongest extension and return a string in this \n# format: ClassName.StrongestExtensionName.\n# If there are two or more extensions with the same strength, you should\n# choose the one that comes first in the list.\n# For example, if you are given \"Slices\" as the class and a list of the\n# extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n# return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n# (its strength is -1).\n# Example:\nsub Strongest_Extension {\n my($class_name, $extensions) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&Strongest_Extension;\n if(eq_deeply($candidate->(\"Watashi\", [\"tEN\", \"niNE\", \"eIGHt8OKe\"]),\"Watashi.eIGHt8OKe\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Boku123\", [\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"]),\"Boku123.YEs.WeCaNe\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"__YESIMHERE\", [\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"]),\"__YESIMHERE.NuLl__\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"K\", [\"Ta\", \"TAR\", \"t234An\", \"cosSo\"]),\"K.TAR\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"__HAHA\", [\"Tab\", \"123\", \"781345\", \"-_-\"]),\"__HAHA.123\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"YameRore\", [\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"]),\"YameRore.okIWILL123\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"finNNalLLly\", [\"Die\", \"NowW\", \"Wow\", \"WoW\"]),\"finNNalLLly.WoW\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"_\", [\"Bb\", \"91245\"]),\"_.Bb\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Sp\", [\"671235\", \"Bb\"]),\"Sp.671235\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "pl", - "prompt": "# Given a string representing a space separated lowercase letters, return a dictionary\n# of the letter with the most repetition and containing the corresponding count.\n# If several letters have the same occurrence, return all of them.\n# Example:\nsub histogram {\n my($test) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&histogram;\n if(eq_deeply($candidate->(\"a b b a\"),{\"a\" => 2, \"b\" => 2})) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"a b c a b\"),{\"a\" => 2, \"b\" => 2})) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"a b c d g\"),{\"a\" => 1, \"b\" => 1, \"c\" => 1, \"d\" => 1, \"g\" => 1})) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"r t g\"),{\"r\" => 1, \"t\" => 1, \"g\" => 1})) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"b b b b a\"),{\"b\" => 4})) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"r t g\"),{\"r\" => 1, \"t\" => 1, \"g\" => 1})) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),{})) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"a\"),{\"a\" => 1})) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "pl", - "prompt": "# pairs_sum_to_zero takes a list of integers as an input.\n# it returns True if there are two distinct elements in the list that\n# sum to zero, and False otherwise.\nsub pairs_sum_to_zero {\n my($l) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&pairs_sum_to_zero;\n if(eq_deeply($candidate->([1, 3, 5, 0]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, -2, 1]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 7]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, -5, 3, 5, 7]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-3, 9, -1, 3, 2, 30]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-3, 9, -1, 3, 2, 31]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-3, 9, -1, 4, 2, 30]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-3, 9, -1, 4, 2, 31]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "pl", - "prompt": "# Write a function that accepts two lists of strings and returns the list that has \n# total number of chars in the all strings of the list less than the other list.\n# if the two lists have the same number of chars, return the first list.\n# Examples\nsub total_match {\n my($lst1, $lst2) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&total_match;\n if(eq_deeply($candidate->([], []),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"hi\", \"admin\"], [\"hi\", \"hi\"]),[\"hi\", \"hi\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"]),[\"hi\", \"admin\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"]),[\"4\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"hi\", \"admin\"], [\"hI\", \"Hi\"]),[\"hI\", \"Hi\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"]),[\"hI\", \"hi\", \"hi\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hii\"]),[\"hi\", \"admin\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([], [\"this\"]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"this\"], []),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "pl", - "prompt": "# Circular shift the digits of the integer x, shift the digits right by shift\n# and return the result as a string.\n# If shift > number of digits, return digits reversed.\nsub circular_shift {\n my($x, $shift) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&circular_shift;\n if(eq_deeply($candidate->(100, 2),\"001\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12, 2),\"12\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(97, 8),\"79\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12, 1),\"21\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(11, 101),\"11\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "pl", - "prompt": "# Return True is list elements are monotonically increasing or decreasing.\nsub monotonic {\n my($l) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&monotonic;\n if(eq_deeply($candidate->([1, 2, 4, 10]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 4, 20]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 20, 4, 10]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 1, 0, -10]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 1, 1, 0]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 2, 5, 60]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 5, 60]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([9, 9, 9, 9]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "pl", - "prompt": "# Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n# Example\nsub is_equal_to_sum_even {\n my($n) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_equal_to_sum_even;\n if(eq_deeply($candidate->(4),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(11),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(13),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(16),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "pl", - "prompt": "# Input to this function is a string representing musical notes in a special ASCII format.\n# Your task is to parse this string and return list of integers corresponding to how many beats does each\n# not last.\n# Here is a legend:\n# 'o' - whole note, lasts four beats\n# 'o|' - half note, lasts two beats\n# '.|' - quater note, lasts one beat\nsub parse_music {\n my($music_string) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&parse_music;\n if(eq_deeply($candidate->(\"\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"o o o o\"),[4, 4, 4, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\".| .| .| .|\"),[1, 1, 1, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"o| o| .| .| o o o o\"),[2, 2, 1, 1, 4, 4, 4, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"o| .| o| .| o o| o o|\"),[2, 1, 2, 1, 4, 2, 4, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "pl", - "prompt": "# \"\n# This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n# multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n# change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n# Examples:\nsub sum_squares {\n my($lst) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sum_squares;\n if(eq_deeply($candidate->([1, 2, 3]),6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 4, 9]),14)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 1, 1, 1, 1, 1, 1, 1, 1]),9)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -1, -1, -1, -1, -1, -1, -1, -1]),-3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -5, 2, -1, -5]),-126)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-56, -99, 1, 0, -2]),3030)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, 0, 0, 0, 0, 0, 0, 0, -1]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37]),-14196)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10]),-1448)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "pl", - "prompt": "# triples_sum_to_zero takes a list of integers as an input.\n# it returns True if there are three distinct elements in the list that\n# sum to zero, and False otherwise.\nsub triples_sum_to_zero {\n my($l) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&triples_sum_to_zero;\n if(eq_deeply($candidate->([1, 3, 5, 0]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, 5, -1]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, -2, 1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 7]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 5, 7]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, -5, 3, 9, 7]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, 5, -100]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([100, 3, 5, -100]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "pl", - "prompt": "# brackets is a string of \"<\" and \">\".\n# return True if every opening bracket has a corresponding closing bracket.\nsub correct_bracketing {\n my($brackets) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&correct_bracketing;\n if(eq_deeply($candidate->(\"<>\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<<><>>\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<><><<><>><>\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<><><<<><><>><>><<><><<>>>\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<<<><>>>>\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"><<>\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<<<<\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\">\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<<>\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<><><<><>><>><<>\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<><><<><>><>>><>\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "pl", - "prompt": "# Write a function that takes an array of numbers as input and returns \n# the number of elements in the array that are greater than 10 and both \n# first and last digits of a number are odd (1, 3, 5, 7, 9).\n# For example:\nsub specialFilter {\n my($nums) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&specialFilter;\n if(eq_deeply($candidate->([5, -2, 1, -5]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([15, -73, 14, -15]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([33, -2, -3, 45, 21, 109]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([43, -12, 93, 125, 121, 109]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([71, -2, -33, 75, 21, 19]),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "pl", - "prompt": "# Given a dictionary, return True if all keys are strings in lower \n# case or all keys are strings in upper case, else return False.\n# The function should return False is the given dictionary is empty.\n# Examples:\nsub check_dict_case {\n my($dict) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&check_dict_case;\n if(eq_deeply($candidate->({\"p\" => \"pineapple\", \"b\" => \"banana\"}),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->({\"p\" => \"pineapple\", \"A\" => \"banana\", \"B\" => \"banana\"}),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->({\"p\" => \"pineapple\", \"5\" => \"banana\", \"a\" => \"apple\"}),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->({\"Name\" => \"John\", \"Age\" => \"36\", \"City\" => \"Houston\"}),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->({\"STATE\" => \"NC\", \"ZIP\" => \"12345\"}),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->({\"fruit\" => \"Orange\", \"taste\" => \"Sweet\"}),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->({}),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "pl", - "prompt": "# Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n# should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n# alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n# Examples\nsub split_words {\n my($txt) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&split_words;\n if(eq_deeply($candidate->(\"Hello world!\"),[\"Hello\", \"world!\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hello,world!\"),[\"Hello\", \"world!\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hello world,!\"),[\"Hello\", \"world,!\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hello,Hello,world !\"),[\"Hello,Hello,world\", \"!\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdef\"),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aaabb\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aaaBb\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "pl", - "prompt": "# The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fibfib(0) == 0\n# fibfib(1) == 0\n# fibfib(2) == 1\n# fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n# Please write a function to efficiently compute the n-th element of the fibfib number sequence.\nsub fibfib {\n my($n) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&fibfib;\n if(eq_deeply($candidate->(2),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),24)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),81)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12),274)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(14),927)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "pl", - "prompt": "# You are given a list of numbers.\n# You need to return the sum of squared numbers in the given list,\n# round each element in the list to the upper int(Ceiling) first.\n# Examples:\nsub sum_squares {\n my($lst) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sum_squares;\n if(eq_deeply($candidate->([1.0, 2.0, 3.0]),14)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.0]),14)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 3.0, 5.0, 7.0]),84)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.4, 4.2, 0.0]),29)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-2.4, 1.0, 1.0]),6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([100.0, 1.0, 15.0, 2.0]),10230)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([10000.0, 10000.0]),200000000)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1.4, 4.6, 6.3]),75)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1.4, 17.9, 18.9, 19.9]),1086)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0.0]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1.0]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1.0, 1.0, 0.0]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_85_add", - "language": "pl", - "prompt": "# Given a non-empty list of integers lst. add the even elements that are at odd indices..\n# Examples:\nsub add {\n my($lst) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&add;\n if(eq_deeply($candidate->([4, 88]),88)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 5, 6, 7, 2, 122]),122)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 0, 6, 7]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 4, 6, 8]),12)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "pl", - "prompt": "# Return sorted unique elements in a list\nsub unique {\n my($l) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&unique;\n if(eq_deeply($candidate->([5, 3, 5, 2, 3, 3, 9, 0, 123]),[0, 2, 3, 5, 9, 123])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "pl", - "prompt": "# Given a string text, replace all spaces in it with underscores, \n# and if a string has more than 2 consecutive spaces, \n# then replace all consecutive spaces with -\nsub fix_spaces {\n my($text) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&fix_spaces;\n if(eq_deeply($candidate->(\"Example\"),\"Example\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Mudasir Hanif \"),\"Mudasir_Hanif_\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Yellow Yellow Dirty Fellow\"),\"Yellow_Yellow__Dirty__Fellow\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Exa mple\"),\"Exa-mple\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\" Exa 1 2 2 mple\"),\"-Exa_1_2_2_mple\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "pl", - "prompt": "# Return 2^n modulo p (be aware of numerics).\nsub modp {\n my($n, $p) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&modp;\n if(eq_deeply($candidate->(3, 5),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1101, 101),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(0, 101),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3, 11),8)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(100, 101),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(30, 5),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(31, 5),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "pl", - "prompt": "# You have to write a function which validates a given date string and\n# returns True if the date is valid otherwise False.\n# The date is valid if all of the following rules are satisfied:\n# 1. The date string is not empty.\n# 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n# 3. The months should not be less than 1 or higher than 12.\n# 4. The date should be in the format: mm-dd-yyyy\nsub valid_date {\n my($date) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&valid_date;\n if(eq_deeply($candidate->(\"03-11-2000\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"15-01-2012\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"04-0-2040\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"06-04-2020\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"01-01-2007\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"03-32-2011\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"04-31-3000\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"06-06-2005\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"21-31-2000\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"04-12-2003\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"04122003\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"20030412\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2003-04\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2003-04-12\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"04-2003\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "pl", - "prompt": "# Write a function that takes a string and returns an ordered version of it.\n# Ordered version of string, is a string where all words (separated by space)\n# are replaced by a new word where all the characters arranged in\n# ascending order based on ascii value.\n# Note: You should keep the order of words and blank spaces in the sentence.\n# For example:\nsub anti_shuffle {\n my($s) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&anti_shuffle;\n if(eq_deeply($candidate->(\"Hi\"),\"Hi\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"hello\"),\"ehllo\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"number\"),\"bemnru\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcd\"),\"abcd\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hello World!!!\"),\"Hello !!!Wdlor\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hi. My name is Mister Robot. How are you?\"),\".Hi My aemn is Meirst .Rboot How aer ?ouy\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "pl", - "prompt": "# Given a list of numbers, return whether or not they are sorted\n# in ascending order. If list has more than 1 duplicate of the same\n# number, return False. Assume no negative numbers and only integers.\n# Examples\nsub is_sorted {\n my($lst) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_sorted;\n if(eq_deeply($candidate->([5]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 5]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, 2, 4, 5]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 5, 6]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 5, 6, 7]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, 2, 4, 5, 6, 7]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 1]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 2, 2, 3, 4]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 3, 3, 4]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 2, 3, 3, 4]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "pl", - "prompt": "# You are given a string s.\n# Your task is to check if the string is happy or not.\n# A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n# For example:\nsub is_happy {\n my($s) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_happy;\n if(eq_deeply($candidate->(\"a\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aa\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcd\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aabb\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"adb\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"xyy\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"iopaxpoi\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"iopaxioi\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "pl", - "prompt": "# Write a function that returns True if the object q will fly, and False otherwise.\n# The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n# Example:\n# # 1+2 is less than the maximum possible weight, but it's unbalanced.\n# # it's balanced, but 3+2+3 is more than the maximum possible weight.\n# # 3+2+3 is less than the maximum possible weight, and it's balanced.\n# # 3 is less than the maximum possible weight, and it's balanced.\nsub will_it_fly {\n my($q, $w) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&will_it_fly;\n if(eq_deeply($candidate->([3, 2, 3], 9),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2], 5),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3], 5),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 3], 1),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3], 6),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5], 5),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "pl", - "prompt": "# Given an array of non-negative integers, return a copy of the given array after sorting,\n# you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n# or sort it in descending order if the sum( first index value, last index value) is even.\n# Note:\n# * don't change the given array.\n# Examples:\nsub sort_array {\n my($array) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sort_array;\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5]),[5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, 3, 0, 1, 5]),[0, 1, 2, 3, 4, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, 3, 0, 1, 5, 6]),[6, 5, 4, 3, 2, 1, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 1]),[1, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([15, 42, 87, 32, 11, 0]),[0, 11, 15, 32, 42, 87])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([21, 14, 23, 11]),[23, 21, 14, 11])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "pl", - "prompt": "# Implement a function that takes an non-negative integer and returns an array of the first n\n# integers that are prime numbers and less than n.\n# for example:\nsub count_up_to {\n my($n) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&count_up_to;\n if(eq_deeply($candidate->(5),[2, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6),[2, 3, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7),[2, 3, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),[2, 3, 5, 7])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(0),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(22),[2, 3, 5, 7, 11, 13, 17, 19])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(18),[2, 3, 5, 7, 11, 13, 17])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(47),[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(101),[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "pl", - "prompt": "# Out of list of strings, return the longest one. Return the first one in case of multiple\n# strings of the same length. Return None in case the input list is empty.\nsub longest {\n my($strings) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&longest;\n if(eq_deeply($candidate->([]),undef)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"x\", \"y\", \"z\"]),\"x\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"]),\"zzzz\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "pl", - "prompt": "# Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n# reverse the resulting array, and then replace each digit by its corresponding name from\n# \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n# For example:\n# If the array is empty, return an empty array:\n# If the array has any strange number ignore it:\nsub by_length {\n my($arr) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&by_length;\n if(eq_deeply($candidate->([2, 1, 1, 4, 5, 8, 2, 3]),[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, -1, 55]),[\"One\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, -1, 3, 2]),[\"Three\", \"Two\", \"One\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([9, 4, 8]),[\"Nine\", \"Eight\", \"Four\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_106_f", - "language": "pl", - "prompt": "# Implement the function f that takes n as a parameter,\n# 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\n# or the sum of numbers from 1 to i otherwise.\n# i starts from 1.\n# the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n# Example:\nsub f {\n my($n) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&f;\n if(eq_deeply($candidate->(5),[1, 2, 6, 24, 15])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7),[1, 2, 6, 24, 15, 720, 28])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),[1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3),[1, 2, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "pl", - "prompt": "# Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\nsub fizz_buzz {\n my($n) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&fizz_buzz;\n if(eq_deeply($candidate->(50),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(78),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(79),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(100),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(200),6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4000),192)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10000),639)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(100000),8026)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "pl", - "prompt": "# Given a positive floating point number, it can be decomposed into\n# and integer part (largest integer smaller than given number) and decimals\n# (leftover part always smaller than 1).\n# Return the decimal part of the number.\nsub truncate_number {\n my($number) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&truncate_number;\n if(eq_deeply($candidate->(3.5),0.5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1.25),0.25)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(123.0),0.0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "pl", - "prompt": "# For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n# Empty sum should be equal to 0 and empty product should be equal to 1.\nsub sum_product {\n my($numbers) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sum_product;\n if(eq_deeply($candidate->([]),[0, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 1, 1]),[3, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([100, 0]),[100, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 5, 7]),[15, 105])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([10]),[10, 10])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "pl", - "prompt": "# You are given a 2 dimensional data, as a nested lists,\n# which is similar to matrix, however, unlike matrices,\n# each row may contain a different number of columns.\n# Given lst, and integer x, find integers x in the list,\n# and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n# each tuple is a coordinate - (row, columns), starting with 0.\n# Sort coordinates initially by rows in ascending order.\n# Also, sort coordinates of the row by columns in descending order.\n# Examples:\nsub get_row {\n my($lst, $x) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&get_row;\n if(eq_deeply($candidate->([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1),[[0, 0], [1, 4], [1, 0], [2, 5], [2, 0]])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6]], 2),[[0, 1], [1, 1], [2, 1], [3, 1], [4, 1], [5, 1]])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 1, 3, 4, 5, 6], [1, 2, 1, 4, 5, 6], [1, 2, 3, 1, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1),[[0, 0], [1, 0], [2, 1], [2, 0], [3, 2], [3, 0], [4, 3], [4, 0], [5, 4], [5, 0], [6, 5], [6, 0]])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([], 1),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1]], 2),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[], [1], [1, 2, 3]], 3),[[2, 2]])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "pl", - "prompt": "# You're a hungry rabbit, and you already have eaten a certain number of carrots,\n# but now you need to eat more carrots to complete the day's meals.\n# you should return an array of [ total number of eaten carrots after your meals,\n# the number of carrots left after your meals ]\n# if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n# Example:\n# Variables:\n# @number : integer\n# the number of carrots that you have eaten.\n# @need : integer\n# the number of carrots that you need to eat.\n# @remaining : integer\n# the number of remaining carrots thet exist in stock\n# Constrain:\n# * 0 <= number <= 1000\n# * 0 <= need <= 1000\n# * 0 <= remaining <= 1000\n# Have fun :)\nsub eat {\n my($number, $need, $remaining) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&eat;\n if(eq_deeply($candidate->(5, 6, 10),[11, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4, 8, 9),[12, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 10, 10),[11, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 11, 5),[7, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4, 5, 7),[9, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4, 5, 1),[5, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "pl", - "prompt": "# Given a positive integer N, return the total sum of its digits in binary.\n# Example\n# Variables:\n# @N integer\n# Constraints: 0 \u2264 N \u2264 10000.\n# Output:\n# a string of binary number\nsub solve {\n my($N) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&solve;\n if(eq_deeply($candidate->(1000),\"1\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(150),\"110\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(147),\"1100\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(333),\"1001\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(963),\"10010\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "pl", - "prompt": "# You are given a list of integers.\n# You need to find the largest prime value and return the sum of its digits.\n# Examples:\nsub skjkasdkd {\n my($lst) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&skjkasdkd;\n if(eq_deeply($candidate->([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]),10)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]),25)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]),13)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]),11)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 81, 12, 3, 1, 21]),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 8, 1, 2, 1, 7]),7)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([8191]),19)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([8191, 123456, 127, 7]),19)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([127, 97, 8192]),10)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "pl", - "prompt": "# Given an array arr of integers, find the minimum number of elements that\n# need to be changed to make the array palindromic. A palindromic array is an array that\n# is read the same backwards and forwards. In one change, you can change one element to any other element.\n# For example:\nsub smallest_change {\n my($arr) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&smallest_change;\n if(eq_deeply($candidate->([1, 2, 3, 5, 4, 7, 9, 6]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 3, 2, 2]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 4, 2]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 4, 4, 2]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 2, 1]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 1, 1, 3]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "pl", - "prompt": "# It is the last week of the semester and the teacher has to give the grades\n# to students. The teacher has been making her own algorithm for grading.\n# The only problem is, she has lost the code she used for grading.\n# She has given you a list of GPAs for some students and you have to write \n# a function that can output a list of letter grades using the following table:\n# GPA | Letter grade\n# 4.0 A+\n# > 3.7 A \n# > 3.3 A- \n# > 3.0 B+\n# > 2.7 B \n# > 2.3 B-\n# > 2.0 C+\n# > 1.7 C\n# > 1.3 C-\n# > 1.0 D+ \n# > 0.7 D \n# > 0.0 D-\n# 0.0 E\n# Example:\nsub numerical_letter_grade {\n my($grades) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&numerical_letter_grade;\n if(eq_deeply($candidate->([4.0, 3, 1.7, 2, 3.5]),[\"A+\", \"B\", \"C-\", \"C\", \"A-\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.2]),[\"D+\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0.5]),[\"D-\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0.0]),[\"E\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 0.3, 1.5, 2.8, 3.3]),[\"D\", \"D-\", \"C-\", \"B\", \"B+\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0.0, 0.7]),[\"E\", \"D-\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "pl", - "prompt": "# Given the lengths of the three sides of a triangle. Return the area of\n# the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n# Otherwise return -1\n# Three sides make a valid triangle when the sum of any two sides is greater \n# than the third side.\n# Example:\nsub triangle_area {\n my($a, $b, $c) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&triangle_area;\n if(eq_deeply($candidate->(3, 4, 5),6.0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 2, 10),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4, 8, 5),8.18)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 2, 2),1.73)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 2, 3),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10, 5, 7),16.25)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 6, 3),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 1, 1),0.43)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 2, 10),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "pl", - "prompt": "# Check if two words have the same characters.\nsub same_chars {\n my($s0, $s1) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&same_chars;\n if(eq_deeply($candidate->(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcd\", \"dddddddabc\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"dddddddabc\", \"abcd\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"eabcd\", \"dddddddabc\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcd\", \"dddddddabcf\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"eabcdzzzz\", \"dddzzzzzzzddddabc\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aabb\", \"aaccc\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "pl", - "prompt": "# Given an array of integers nums, find the minimum sum of any non-empty sub-array\n# of nums.\n# Example\nsub minSubArraySum {\n my($nums) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&minSubArraySum;\n if(eq_deeply($candidate->([2, 3, 4, 1, 2, 4]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -2, -3]),-6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -2, -3, 2, -10]),-14)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-9999999999999999]),-9999999999999999)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 10, 20, 1000000]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -2, -3, 10, -5]),-6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([100, -1, -2, -3, 10, -5]),-6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([10, 11, 13, 8, 3, 4]),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([100, -33, 32, -1, 0, -2]),-33)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-10]),-10)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([7]),7)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, -1]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "pl", - "prompt": "# Given a string s and a natural number n, you have been tasked to implement \n# a function that returns a list of all words from string s that contain exactly \n# n consonants, in order these words appear in the string s.\n# If the string s is empty then the function should return an empty list.\n# Note: you may assume the input string contains only letters and spaces.\n# Examples:\nsub select_words {\n my($s, $n) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&select_words;\n if(eq_deeply($candidate->(\"Mary had a little lamb\", 4),[\"little\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Mary had a little lamb\", 3),[\"Mary\", \"lamb\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"simple white space\", 2),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hello world\", 4),[\"world\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Uncle sam\", 3),[\"Uncle\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\", 4),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"a b c d e f\", 1),[\"b\", \"c\", \"d\", \"f\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "pl", - "prompt": "# Return list of all prefixes from shortest to longest of the input string\nsub all_prefixes {\n my($string) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&all_prefixes;\n if(eq_deeply($candidate->(\"\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"asdfgh\"),[\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"WWW\"),[\"W\", \"WW\", \"WWW\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "pl", - "prompt": "# Create a function that takes a value (string) representing a number\n# and returns the closest integer to it. If the number is equidistant\n# from two integers, round it away from zero.\n# Examples\n# Note:\n# Rounding away from zero means that if the given number is equidistant\n# from two integers, the one you should return is the one that is the\n# farthest from zero. For example closest_integer(\"14.5\") should\n# return 15 and closest_integer(\"-14.5\") should return -15.\nsub closest_integer {\n my($value) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&closest_integer;\n if(eq_deeply($candidate->(\"10\"),10)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"14.5\"),15)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"-15.5\"),-16)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"15.3\"),15)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"0\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "pl", - "prompt": "# Create a function which takes a string representing a file's name, and returns\n# 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n# A file's name is considered to be valid if and only if all the following conditions \n# are met:\n# - There should not be more than three digits ('0'-'9') in the file's name.\n# - The file's name contains exactly one dot '.'\n# - The substring before the dot should not be empty, and it starts with a letter from \n# the latin alphapet ('a'-'z' and 'A'-'Z').\n# - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n# Examples:\nsub file_name_check {\n my($file_name) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&file_name_check;\n if(eq_deeply($candidate->(\"example.txt\"),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1example.dll\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"s1sdf3.asd\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"K.dll\"),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"MY16FILE3.exe\"),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"His12FILE94.exe\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"_Y.txt\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"?aREYA.exe\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"/this_is_valid.dll\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"this_is_valid.wow\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"this_is_valid.txt\"),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"this_is_valid.txtexe\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"#this2_i4s_5valid.ten\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"@this1_is6_valid.exe\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"this_is_12valid.6exe4.txt\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"all.exe.txt\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"I563_No.exe\"),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Is3youfault.txt\"),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"no_one#knows.dll\"),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1I563_Yes3.exe\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"I563_Yes3.txtt\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"final..txt\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"final132\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"_f4indsartal132.\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\".txt\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"s.\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "pl", - "prompt": "# You are given two intervals,\n# where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n# The given intervals are closed which means that the interval (start, end)\n# includes both start and end.\n# For each given interval, it is assumed that its start is less or equal its end.\n# Your task is to determine whether the length of intersection of these two \n# intervals is a prime number.\n# Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n# which its length is 1, which not a prime number.\n# If the length of the intersection is a prime number, return \"YES\",\n# otherwise, return \"NO\".\n# If the two intervals don't intersect, return \"NO\".\n# [input/output] samples:\nsub intersection {\n my($interval1, $interval2) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&intersection;\n if(eq_deeply($candidate->([1, 2], [2, 3]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, 1], [0, 4]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-3, -1], [-5, 5]),\"YES\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-2, 2], [-4, 0]),\"YES\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-11, 2], [-1, -1]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2], [3, 5]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2], [1, 2]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-2, -2], [-3, -2]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "pl", - "prompt": "# Return the largest prime factor of n. Assume n > 1 and is not a prime.\nsub largest_prime_factor {\n my($n) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&largest_prime_factor;\n if(eq_deeply($candidate->(15),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(27),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(63),7)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(330),11)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(13195),29)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "pl", - "prompt": "# Given a string, find out how many distinct characters (regardless of case) does it consist of\nsub count_distinct_characters {\n my($string) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&count_distinct_characters;\n if(eq_deeply($candidate->(\"\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcde\"),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdecadeCADE\"),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aaaaAAAAaaaa\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Jerry jERRY JeRRRY\"),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "pl", - "prompt": "# You're given a list of deposit and withdrawal operations on a bank account that starts with\n# zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n# at that point function should return True. Otherwise it should return False.\nsub below_zero {\n my($operations) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&below_zero;\n if(eq_deeply($candidate->([]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, -3, 1, 2, -3]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, -4, 5, 6]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, -1, 2, -2, 5, -5, 4, -4]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, -1, 2, -2, 5, -5, 4, -5]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, -2, 2, -2, 5, -5, 4, -4]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "pl", - "prompt": "# Find the shortest palindrome that begins with a supplied string.\n# Algorithm idea is simple:\n# - Find the longest postfix of supplied string that is a palindrome.\n# - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\nsub make_palindrome {\n my($string) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&make_palindrome;\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"x\"),\"x\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"xyz\"),\"xyzyx\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"xyx\"),\"xyx\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"jerry\"),\"jerryrrej\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "pl", - "prompt": "# Given a positive integer, obtain its roman numeral equivalent as a string,\n# and return it in lowercase.\n# Restrictions: 1 <= num <= 1000\n# Examples:\nsub int_to_mini_roman {\n my($number) = @_;\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&int_to_mini_roman;\n if(eq_deeply($candidate->(19),\"xix\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(152),\"clii\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(251),\"ccli\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(426),\"cdxxvi\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(500),\"d\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),\"i\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4),\"iv\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(43),\"xliii\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(90),\"xc\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(94),\"xciv\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(532),\"dxxxii\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(900),\"cm\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(994),\"cmxciv\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1000),\"m\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - } -] \ No newline at end of file diff --git a/data/pl-reworded.json b/data/pl-reworded.json deleted file mode 100644 index 463ac8614b2c6899f39c526ca84ab2548b652f6c..0000000000000000000000000000000000000000 --- a/data/pl-reworded.json +++ /dev/null @@ -1,2256 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "pl", - "prompt": "# For a given number n, find the largest number that divides n evenly, smaller than n\n# >>> largest_divisor(15)\n# 5\nsub largest_divisor {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&largest_divisor;\n if(eq_deeply($candidate->(3),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(100),50)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(49),7)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_47_median", - "language": "pl", - "prompt": "# Return median of elements in the array l.\n# >>> median([3, 1, 2, 4, 5])\n# 3\n# >>> median([-10, 4, 6, 1000, 10, 20])\n# 15.0\nsub median {\n my($l) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&median;\n if(eq_deeply($candidate->([3, 1, 2, 4, 5]),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-10, 4, 6, 1000, 10, 20]),8.0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5]),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([6, 5]),5.5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([8, 1, 3, 9, 9, 2, 7]),7)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "pl", - "prompt": "# Given two arrays operator, and operand. The first array has basic algebra operations, and \n# the second array is an array of integers. Use the two given arrays to build the algebric \n# expression and return the evaluation of this expression.\n# The basic algebra operations:\n# Addition ( + ) \n# Subtraction ( - ) \n# Multiplication ( * ) \n# Floor division ( // ) \n# Exponentiation ( ** ) \n# Example:\n# operator['+', '*', '-']\n# array = [2, 3, 4, 5]\n# result = 2 + 3 * 4 - 5\n# => result = 9\n# Note:\n# The length of operator array is equal to the length of operand array minus one.\n# Operand is an array of of non-negative integers.\n# Operator array has at least one operator, and operand array has at least two operands.\nsub do_algebra {\n my($operator, $operand) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&do_algebra;\n if(eq_deeply($candidate->([\"**\", \"*\", \"+\"], [2, 3, 4, 5]),37)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"+\", \"*\", \"-\"], [2, 3, 4, 5]),9)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"//\", \"*\"], [7, 3, 4]),8)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "pl", - "prompt": "# Return maximum element in the array.\n# >>> max_element([1, 2, 3])\n# 3\n# >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n# 123\nsub max_element {\n my($l) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&max_element;\n if(eq_deeply($candidate->([1, 2, 3]),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]),124)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "pl", - "prompt": "# Create a function which returns the largest index of an element which\n# is not greater than or equal to the element immediately preceding it. If\n# no such element exists then return -1. The given array will not contain\n# duplicate values.\n# Examples:\n# >>> can_arrange([1, 2, 4, 3, 5])\n# 3\n# >>> can_arrange([1, 2, 3])\n# -1\nsub can_arrange {\n my($arr) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&can_arrange;\n if(eq_deeply($candidate->([1, 2, 4, 3, 5]),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 4, 5]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 4, 2, 5, 6, 7, 8, 9, 10]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 8, 5, 7, 3]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "pl", - "prompt": "# Imagine a road that's a perfectly straight infinitely long line.\n# n cars are driving left to right; simultaneously, a different set of n cars\n# are driving right to left. The two sets of cars start out being very far from\n# each other. All cars move in the same speed. Two cars are said to collide\n# when a car that's moving left to right hits a car that's moving right to left.\n# However, the cars are infinitely sturdy and strong; as a result, they continue moving\n# in their trajectory as if they did not collide.\n# This function outputs the number of such collisions.\nsub car_race_collision {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&car_race_collision;\n if(eq_deeply($candidate->(2),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3),9)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4),16)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),64)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),100)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "pl", - "prompt": "# Create a function that returns 1 if the last character\n# of a given string is an alphabetical character and is not\n# a part of a word, and '' otherwise.\n# Note: \"word\" is a group of characters separated by space.\n# Examples:\n# >>> check_if_last_char_is_a_letter(\"apple pie\")\n# \"\"\n# >>> check_if_last_char_is_a_letter(\"apple pi e\")\n# 1\n# >>> check_if_last_char_is_a_letter(\"apple pi e \")\n# \"\"\n# >>> check_if_last_char_is_a_letter(\"\")\n# \"\"\nsub check_if_last_char_is_a_letter {\n my($txt) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&check_if_last_char_is_a_letter;\n if(eq_deeply($candidate->(\"apple\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"apple pi e\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"eeeee\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"A\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Pumpkin pie \"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Pumpkin pie 1\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"eeeee e \"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"apple pie\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"apple pi e \"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "pl", - "prompt": "# Return true if a given number is prime, and false otherwise.\n# >>> is_prime(6)\n# \"\"\n# >>> is_prime(101)\n# 1\n# >>> is_prime(11)\n# 1\n# >>> is_prime(13441)\n# 1\n# >>> is_prime(61)\n# 1\n# >>> is_prime(4)\n# \"\"\n# >>> is_prime(1)\n# \"\"\nsub is_prime {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_prime;\n if(eq_deeply($candidate->(6),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(101),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(11),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(13441),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(61),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(11),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(17),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(85),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(77),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(255379),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "pl", - "prompt": "# Given an array of positive integers x. return a sorted array of all \n# elements that hasn't any even digit.\n# Note: Returned array should be sorted in increasing order.\n# For example:\n# >>> unique_digits([15, 33, 1422, 1])\n# [1, 15, 33]\n# >>> unique_digits([152, 323, 1422, 10])\n# []\nsub unique_digits {\n my($x) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&unique_digits;\n if(eq_deeply($candidate->([15, 33, 1422, 1]),[1, 15, 33])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([152, 323, 1422, 10]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([12345, 2033, 111, 151]),[111, 151])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([135, 103, 31]),[31, 135])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "pl", - "prompt": "# Input are two strings a and b consisting only of 1s and 0s.\n# Perform binary XOR on these inputs and return result also as a string.\n# >>> string_xor(\"010\", \"110\")\n# \"100\"\nsub string_xor {\n my($a, $b) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&string_xor;\n if(eq_deeply($candidate->(\"111000\", \"101010\"),\"010010\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1\", \"1\"),\"0\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"0101\", \"0000\"),\"0101\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "pl", - "prompt": "# sum_to_n is a function that sums numbers from 1 to n.\n# >>> sum_to_n(30)\n# 465\n# >>> sum_to_n(100)\n# 5050\n# >>> sum_to_n(5)\n# 15\n# >>> sum_to_n(10)\n# 55\n# >>> sum_to_n(1)\n# 1\nsub sum_to_n {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sum_to_n;\n if(eq_deeply($candidate->(1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6),21)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(11),66)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(30),465)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(100),5050)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "pl", - "prompt": "# Given an array of numbers, return the sum of squares of the numbers\n# in the array that are odd. Ignore numbers that are negative or not integers.\n# >>> double_the_difference([1, 3, 2, 0])\n# 10\n# >>> double_the_difference([-1, -2, 0])\n# 0\n# >>> double_the_difference([9, -2])\n# 81\n# >>> double_the_difference([0])\n# 0\n# If the input array is empty, return 0.\nsub double_the_difference {\n my($lst) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&double_the_difference;\n if(eq_deeply($candidate->([]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5.0, 4.0]),25)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0.1, 0.2, 0.3]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-10.0, -20.0, -30.0]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1.0, -2.0, 8.0]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0.2, 3.0, 5.0]),34)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]),165)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "pl", - "prompt": "# Return length of given string\n# >>> strlen(\"\")\n# 0\n# >>> strlen(\"abc\")\n# 3\nsub strlen {\n my($string) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&strlen;\n if(eq_deeply($candidate->(\"\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"x\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"asdasnakj\"),9)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "pl", - "prompt": "# You'll be given a string of words, and your task is to count the number\n# of boredoms. A boredom is a sentence that starts with the word \"I\".\n# Sentences are delimited by '.', '?' or '!'.\n# For example:\n# >>> is_bored(\"Hello world\")\n# 0\n# >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n# 1\nsub is_bored {\n my($S) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_bored;\n if(eq_deeply($candidate->(\"Hello world\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Is the sky blue?\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"I love It !\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"bIt\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"I feel good today. I will be productive. will kill It\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"You and I are going for a walk\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "pl", - "prompt": "# Write a function vowels_count which takes a string representing\n# a word as input and returns the number of vowels in the string.\n# Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n# vowel, but only when it is at the end of the given word.\n# Example:\n# >>> vowels_count(\"abcde\")\n# 2\n# >>> vowels_count(\"ACEDY\")\n# 3\nsub vowels_count {\n my($s) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&vowels_count;\n if(eq_deeply($candidate->(\"abcde\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Alone\"),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"key\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"bye\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"keY\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"bYe\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ACEDY\"),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "pl", - "prompt": "# Return n-th Fibonacci number.\n# >>> fib(10)\n# 55\n# >>> fib(1)\n# 1\n# >>> fib(8)\n# 21\nsub fib {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&fib;\n if(eq_deeply($candidate->(10),55)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),21)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(11),89)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12),144)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "pl", - "prompt": "# Your task is to implement a function that will simplify the expression\n# x * n. The function returns 1 if x * n evaluates to a whole number and ''\n# otherwise. Both x and n, are string representation of a fraction, and have the following format,\n# / where both numerator and denominator are positive whole numbers.\n# You can assume that x, and n are valid fractions, and do not have zero as denominator.\n# >>> simplify(\"1/5\", \"5/1\")\n# 1\n# >>> simplify(\"1/6\", \"2/1\")\n# \"\"\n# >>> simplify(\"7/10\", \"10/2\")\n# \"\"\nsub simplify {\n my($x, $n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&simplify;\n if(eq_deeply($candidate->(\"1/5\", \"5/1\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1/6\", \"2/1\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"5/1\", \"3/1\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"7/10\", \"10/2\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2/10\", \"50/10\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"7/2\", \"4/2\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"11/6\", \"6/1\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2/3\", \"5/2\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"5/2\", \"3/5\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2/4\", \"8/4\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2/4\", \"4/2\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1/5\", \"5/1\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1/5\", \"1/5\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "pl", - "prompt": "# Given a string s, count the number of uppercase vowels in even indices.\n# For example:\n# >>> count_upper(\"aBCdEf\")\n# 1\n# >>> count_upper(\"abcdefg\")\n# 0\n# >>> count_upper(\"dBBE\")\n# 0\nsub count_upper {\n my($s) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&count_upper;\n if(eq_deeply($candidate->(\"aBCdEf\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdefg\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"dBBE\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"B\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"U\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"EEEE\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "pl", - "prompt": "# You are given a rectangular grid of wells. Each row represents a single well,\n# and each 1 in a row represents a single unit of water.\n# Each well has a corresponding bucket that can be used to extract water from it, \n# and all buckets have the same capacity.\n# Your task is to use the buckets to empty the wells.\n# Output the number of times you need to lower the buckets.\n# Example 1:\n# >>> max_fill([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1)\n# 6\n# Example 2:\n# >>> max_fill([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2)\n# 5\n# Example 3:\n# >>> max_fill([[0, 0, 0], [0, 0, 0]], 5)\n# 0\n# Constraints:\n# * all wells have the same length\n# * 1 <= grid.length <= 10^2\n# * 1 <= grid[:,1].length <= 10^2\n# * grid[i][j] -> 0 | 1\n# * 1 <= capacity <= 10\nsub max_fill {\n my($grid, $capacity) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&max_fill;\n if(eq_deeply($candidate->([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1),6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[0, 0, 0], [0, 0, 0]], 5),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1, 1, 1, 1], [1, 1, 1, 1]], 2),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1, 1, 1, 1], [1, 1, 1, 1]], 9),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "pl", - "prompt": "# Given an array arr of integers and a positive integer k, return a sorted array \n# of length k with the maximum k numbers in arr.\n# Example 1:\n# >>> maximum([-3, -4, 5], 3)\n# [-4, -3, 5]\n# Example 2:\n# >>> maximum([4, -4, 4], 2)\n# [4, 4]\n# Example 3:\n# >>> maximum([-3, 2, 1, 2, -1, -2, 1], 1)\n# [2]\n# Note:\n# 1. The length of the array will be in the range of [1, 1000].\n# 2. The elements in the array will be in the range of [-1000, 1000].\n# 3. 0 <= k <= len(arr)\nsub maximum {\n my($arr, $k) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&maximum;\n if(eq_deeply($candidate->([-3, -4, 5], 3),[-4, -3, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, -4, 4], 2),[4, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-3, 2, 1, 2, -1, -2, 1], 1),[2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([123, -123, 20, 0, 1, 2, -3], 3),[2, 20, 123])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-123, 20, 0, 1, 2, -3], 4),[0, 1, 2, 20])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 15, 0, 3, -13, -8, 0], 7),[-13, -8, 0, 0, 3, 5, 15])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, 0, 2, 5, 3, -10], 2),[3, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 0, 5, -7], 1),[5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, -4], 2),[-4, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-10, 10], 2),[-10, 10])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, -23, 243, -400, 0], 0),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "pl", - "prompt": "# Write a function that takes a message, and encodes in such a \n# way that it swaps case of all letters, replaces all vowels in \n# the message with the letter that appears 2 places ahead of that \n# vowel in the english alphabet. \n# Assume only letters. \n# Examples:\n# >>> encode(\"test\")\n# \"TGST\"\n# >>> encode(\"This is a message\")\n# \"tHKS KS C MGSSCGG\"\nsub encode {\n my($message) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&encode;\n if(eq_deeply($candidate->(\"TEST\"),\"tgst\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Mudasir\"),\"mWDCSKR\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"YES\"),\"ygs\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"This is a message\"),\"tHKS KS C MGSSCGG\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"I DoNt KnOw WhAt tO WrItE\"),\"k dQnT kNqW wHcT Tq wRkTg\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "pl", - "prompt": "# remove_vowels is a function that takes string and returns string without vowels.\n# >>> remove_vowels(\"\")\n# \"\"\n# >>> remove_vowels(\"abcdef\")\n# \"bcdf\"\n# >>> remove_vowels(\"aaaaa\")\n# \"\"\n# >>> remove_vowels(\"aaBAA\")\n# \"B\"\n# >>> remove_vowels(\"zbcd\")\n# \"zbcd\"\nsub remove_vowels {\n my($text) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&remove_vowels;\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdef\nghijklm\"),\"bcdf\nghjklm\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"fedcba\"),\"fdcb\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"eeeee\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"acBAA\"),\"cB\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"EcBOO\"),\"cB\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ybcd\"),\"ybcd\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "pl", - "prompt": "# Return only positive numbers in the array.\n# >>> get_positive([-1, 2, -4, 5, 6])\n# [2, 5, 6]\n# >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n# [5, 3, 2, 3, 9, 123, 1]\nsub get_positive {\n my($l) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&get_positive;\n if(eq_deeply($candidate->([-1, -2, 4, 5, 6]),[4, 5, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]),[5, 3, 2, 3, 3, 9, 123, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -2]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "pl", - "prompt": "# Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n# >>> string_sequence(0)\n# \"0\"\n# >>> string_sequence(5)\n# \"0 1 2 3 4 5\"\nsub string_sequence {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&string_sequence;\n if(eq_deeply($candidate->(0),\"0\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3),\"0 1 2 3\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),\"0 1 2 3 4 5 6 7 8 9 10\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "pl", - "prompt": "# Given a positive integer n, you have to make a pile of n levels of stones.\n# The first level has n stones.\n# The number of stones in the next level is:\n# - the next odd number if n is odd.\n# - the next even number if n is even.\n# Return the number of stones in each level in an array, where element at index\n# i represents the number of stones in the level (i+1).\n# Examples:\n# >>> make_a_pile(3)\n# [3, 5, 7]\nsub make_a_pile {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&make_a_pile;\n if(eq_deeply($candidate->(3),[3, 5, 7])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4),[4, 6, 8, 10])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5),[5, 7, 9, 11, 13])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6),[6, 8, 10, 12, 14, 16])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),[8, 10, 12, 14, 16, 18, 20, 22])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "pl", - "prompt": "# Task\n# 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\n# then check if the result string is palindrome.\n# A string is called palindrome if it reads the same backward as forward.\n# You should return an array containing the result string and 1/'' for the check.\n# Example\n# >>> reverse_delete(\"abcde\", \"ae\")\n# [\"bcd\", \"\"]\n# >>> reverse_delete(\"abcdef\", \"b\")\n# [\"acdef\", \"\"]\n# >>> reverse_delete(\"abcdedcba\", \"ab\")\n# [\"cdedc\", 1]\nsub reverse_delete {\n my($s, $c) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&reverse_delete;\n if(eq_deeply($candidate->(\"abcde\", \"ae\"),[\"bcd\", \"\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdef\", \"b\"),[\"acdef\", \"\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdedcba\", \"ab\"),[\"cdedc\", 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"dwik\", \"w\"),[\"dik\", \"\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"a\", \"a\"),[\"\", 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdedcba\", \"\"),[\"abcdedcba\", 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdedcba\", \"v\"),[\"abcdedcba\", 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"vabba\", \"v\"),[\"abba\", 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"mamma\", \"mia\"),[\"\", 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "pl", - "prompt": "# For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n# >>> flip_case(\"Hello\")\n# \"hELLO\"\nsub flip_case {\n my($string) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&flip_case;\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hello!\"),\"hELLO!\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"These violent delights have violent ends\"),\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "pl", - "prompt": "# You are given a string s.\n# if s[i] is a letter, reverse its case from lower to upper or vise versa, \n# otherwise keep it as it is.\n# If the string contains no letters, reverse the string.\n# The function should return the resulted string.\n# Examples\n# >>> solve(\"1234\")\n# \"4321\"\n# >>> solve(\"ab\")\n# \"AB\"\n# >>> solve(\"#a@C\")\n# \"#A@c\"\nsub solve {\n my($s) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&solve;\n if(eq_deeply($candidate->(\"AsDf\"),\"aSdF\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1234\"),\"4321\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ab\"),\"AB\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"#a@C\"),\"#A@c\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"#AsdfW^45\"),\"#aSDFw^45\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"#6@2\"),\"2@6#\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"#$a^D\"),\"#$A^d\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"#ccc\"),\"#CCC\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "pl", - "prompt": "# Filter an input array of strings only for ones that start with a given prefix.\n# >>> filter_by_prefix([], \"a\")\n# []\n# >>> filter_by_prefix([\"abc\", \"bcd\", \"cde\", \"array\"], \"a\")\n# [\"abc\", \"array\"]\nsub filter_by_prefix {\n my($strings, $prefix) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&filter_by_prefix;\n if(eq_deeply($candidate->([], \"john\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"),[\"xxx\", \"xxxAAA\", \"xxx\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "pl", - "prompt": "# This function takes two positive numbers x and y and returns the\n# biggest even integer number that is in the range [x, y] inclusive. If \n# there's no such number, then the function should return -1.\n# For example:\n# >>> choose_num(12, 15)\n# 14\n# >>> choose_num(13, 12)\n# -1\nsub choose_num {\n my($x, $y) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&choose_num;\n if(eq_deeply($candidate->(12, 15),14)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(13, 12),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(33, 12354),12354)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5234, 5233),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6, 29),28)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(27, 10),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7, 7),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(546, 546),546)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "pl", - "prompt": "# You are given a string representing a sentence,\n# the sentence contains some words separated by a space,\n# and you have to return a string that contains the words from the original sentence,\n# whose lengths are prime numbers,\n# the order of the words in the new string should be the same as the original one.\n# Example 1:\n# >>> words_in_sentence(\"This is a test\")\n# \"is\"\n# Example 2:\n# >>> words_in_sentence(\"lets go for swimming\")\n# \"go for\"\n# Constraints:\n# * 1 <= len(sentence) <= 100\n# * sentence contains only letters\nsub words_in_sentence {\n my($sentence) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&words_in_sentence;\n if(eq_deeply($candidate->(\"This is a test\"),\"is\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"lets go for swimming\"),\"go for\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"there is no place available here\"),\"there is no place\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hi I am Hussein\"),\"Hi am Hussein\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"go for it\"),\"go for it\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"here\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"here is\"),\"is\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "pl", - "prompt": "# Insert a number 'delimeter' between every two consecutive elements of input array `numbers'\n# >>> intersperse([], 4)\n# []\n# >>> intersperse([1, 2, 3], 4)\n# [1, 4, 2, 4, 3]\nsub intersperse {\n my($numbers, $delimeter) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&intersperse;\n if(eq_deeply($candidate->([], 7),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 6, 3, 2], 8),[5, 8, 6, 8, 3, 8, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 2, 2], 2),[2, 2, 2, 2, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "pl", - "prompt": "# Your task is to write a function that returns true if a number x is a simple\n# power of n and false in other cases.\n# x is a simple power of n if n**int=x\n# For example:\n# >>> is_simple_power(1, 4)\n# 1\n# >>> is_simple_power(2, 2)\n# 1\n# >>> is_simple_power(8, 2)\n# 1\n# >>> is_simple_power(3, 2)\n# \"\"\n# >>> is_simple_power(3, 1)\n# \"\"\n# >>> is_simple_power(5, 3)\n# \"\"\nsub is_simple_power {\n my($x, $n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_simple_power;\n if(eq_deeply($candidate->(16, 2),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(143214, 16),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4, 2),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(9, 3),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(16, 4),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(24, 2),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(128, 4),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12, 6),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 12),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "pl", - "prompt": "# Write a function that returns true if the given number is the multiplication of 3 prime numbers\n# and false otherwise.\n# Knowing that (a) is less then 100. \n# Example:\n# >>> is_multiply_prime(30)\n# 1\n# 30 = 2 * 3 * 5\nsub is_multiply_prime {\n my($a) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_multiply_prime;\n if(eq_deeply($candidate->(5),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(30),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(125),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(105),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(126),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(729),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(891),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1001),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "pl", - "prompt": "# Given the lengths of the three sides of a triangle. Return 1 if the three\n# sides form a right-angled triangle, '' otherwise.\n# A right-angled triangle is a triangle in which one angle is right angle or \n# 90 degree.\n# Example:\n# >>> right_angle_triangle(3, 4, 5)\n# 1\n# >>> right_angle_triangle(1, 2, 3)\n# \"\"\nsub right_angle_triangle {\n my($a, $b, $c) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&right_angle_triangle;\n if(eq_deeply($candidate->(3, 4, 5),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 2, 3),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10, 6, 8),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 2, 2),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7, 24, 25),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10, 5, 7),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5, 12, 13),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(15, 8, 17),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(48, 55, 73),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 1, 1),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 2, 10),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "pl", - "prompt": "# Create a function that takes 3 numbers.\n# Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n# Returns false in any other cases.\n# Examples\n# >>> any_int(5, 2, 7)\n# 1\n# >>> any_int(3, 2, 2)\n# \"\"\n# >>> any_int(3, -2, 1)\n# 1\n# >>> any_int(3.6, -2.2, 2)\n# \"\"\nsub any_int {\n my($x, $y, $z) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&any_int;\n if(eq_deeply($candidate->(2, 3, 1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2.5, 2, 3),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1.5, 5, 3.5),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 6, 2),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4, 2, 2),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2.2, 2.2, 2.2),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(-4, 6, 2),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 1, 1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3, 4, 7),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3.0, 4, 7),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "pl", - "prompt": "# This function takes an array l and returns an array l' such that\n# l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n# to the values of the corresponding indicies of l, but sorted.\n# >>> sort_third([1, 2, 3])\n# [1, 2, 3]\n# >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n# [2, 6, 3, 4, 8, 9, 5]\nsub sort_third {\n my($l) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sort_third;\n if(eq_deeply($candidate->([5, 6, 3, 4, 8, 9, 2]),[2, 6, 3, 4, 8, 9, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 8, 3, 4, 6, 9, 2]),[2, 8, 3, 4, 6, 9, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 6, 9, 4, 8, 3, 2]),[2, 6, 9, 4, 8, 3, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 6, 3, 4, 8, 9, 2, 1]),[2, 6, 3, 4, 8, 9, 5, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_53_add", - "language": "pl", - "prompt": "# Add two numbers x and y\n# >>> add(2, 3)\n# 5\n# >>> add(5, 7)\n# 12\nsub add {\n my($x, $y) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&add;\n if(eq_deeply($candidate->(0, 1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 0),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 3),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5, 7),12)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7, 5),12)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_69_search", - "language": "pl", - "prompt": "# You are given a non-empty array of positive integers. Return the greatest integer that is greater than \n# zero, and has a frequency greater than or equal to the value of the integer itself. \n# The frequency of an integer is the number of times it appears in the array.\n# If no such a value exist, return -1.\n# Examples:\n# >>> search([4, 1, 2, 2, 3, 1])\n# 2\n# >>> search([1, 2, 2, 3, 3, 3, 4, 4, 4])\n# 3\n# >>> search([5, 5, 4, 4, 4])\n# -1\nsub search {\n my($lst) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&search;\n if(eq_deeply($candidate->([5, 5, 5, 5, 1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 1, 4, 1, 4, 4]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 3]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([8, 8, 8, 8, 8, 8, 8, 8]),8)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 3, 3, 2, 2]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 8, 2]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([8, 8, 3, 6, 5, 6, 4]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 9, 10, 1, 3]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([10]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 10, 10, 9, 2]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "pl", - "prompt": "# Write a function that takes a string and returns 1 if the string\n# length is a prime number or '' otherwise\n# Examples\n# >>> prime_length(\"Hello\")\n# 1\n# >>> prime_length(\"abcdcba\")\n# 1\n# >>> prime_length(\"kittens\")\n# 1\n# >>> prime_length(\"orange\")\n# \"\"\nsub prime_length {\n my($string) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&prime_length;\n if(eq_deeply($candidate->(\"Hello\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdcba\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"kittens\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"orange\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"wow\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"world\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"MadaM\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Wow\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"HI\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"go\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"gogo\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aaaaaaaaaaaaaaa\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Madam\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"M\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"0\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_58_common", - "language": "pl", - "prompt": "# Return sorted unique common elements for two arrays.\n# >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n# [1, 5, 653]\n# >>> common([5, 3, 2, 8], [3, 2])\n# [2, 3]\nsub common {\n my($l1, $l2) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&common;\n if(eq_deeply($candidate->([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]),[1, 5, 653])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 3, 2, 8], [3, 2]),[2, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 3, 2, 8], [3, 2, 4]),[2, 3, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 3, 2, 8], []),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "pl", - "prompt": "# The Brazilian factorial is defined as:\n# brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n# where n > 0\n# For example:\n# >>> special_factorial(4)\n# 288\n# The function will receive an integer as input and should return the special\n# factorial of this integer.\nsub special_factorial {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&special_factorial;\n if(eq_deeply($candidate->(4),288)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5),34560)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7),125411328000)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "pl", - "prompt": "# In this problem, you will implement a function that takes two arrays of numbers,\n# and determines whether it is possible to perform an exchange of elements\n# between them to make lst1 an array of only even numbers.\n# There is no limit on the number of exchanged elements between lst1 and lst2.\n# If it is possible to exchange elements between the lst1 and lst2 to make\n# all the elements of lst1 to be even, return \"YES\".\n# Otherwise, return \"NO\".\n# For example:\n# >>> exchange([1, 2, 3, 4], [1, 2, 3, 4])\n# \"YES\"\n# >>> exchange([1, 2, 3, 4], [1, 5, 3, 4])\n# \"NO\"\n# It is assumed that the input arrays will be non-empty.\nsub exchange {\n my($lst1, $lst2) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&exchange;\n if(eq_deeply($candidate->([1, 2, 3, 4], [1, 2, 3, 4]),\"YES\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4], [1, 5, 3, 4]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4], [2, 1, 4, 3]),\"YES\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 7, 3], [2, 6, 4]),\"YES\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 7, 3], [2, 6, 3]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 6, 1, 8, 9], [3, 5, 5, 1, 1, 1]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([100, 200], [200, 200]),\"YES\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "pl", - "prompt": "# Given a non-empty array of integers arr and an integer k, return\n# the sum of the elements with at most two digits from the first k elements of arr.\n# Example:\n# >>> add_elements([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4)\n# 24\n# Constraints:\n# 1. 1 <= len(arr) <= 100\n# 2. 1 <= k <= len(arr)\nsub add_elements {\n my($arr, $k) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&add_elements;\n if(eq_deeply($candidate->([1, -2, -3, 41, 57, 76, 87, 88, 99], 3),-4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([111, 121, 3, 4000, 5, 6], 2),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([11, 21, 3, 90, 5, 6, 7, 8, 9], 4),125)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4),24)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1], 1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "pl", - "prompt": "# A simple program which should return the value of x if n is \n# a prime number and should return the value of y otherwise.\n# Examples:\n# >>> x_or_y(7, 34, 12)\n# 34\n# >>> x_or_y(15, 8, 5)\n# 5\nsub x_or_y {\n my($n, $x, $y) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&x_or_y;\n if(eq_deeply($candidate->(7, 34, 12),34)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(15, 8, 5),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3, 33, 5212),33)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1259, 3, 52),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7919, -1, 12),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3609, 1245, 583),583)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(91, 56, 129),129)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6, 34, 1234),1234)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 2, 0),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 2, 0),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "pl", - "prompt": "# Given length of a side and high return area for a triangle.\n# >>> triangle_area(5, 3)\n# 7.5\nsub triangle_area {\n my($a, $h) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&triangle_area;\n if(eq_deeply($candidate->(5, 3),7.5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 2),2.0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10, 8),40.0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "pl", - "prompt": "# Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n# the last couple centuries. However, what people don't know is Tribonacci sequence.\n# Tribonacci sequence is defined by the recurrence:\n# tri(1) = 3\n# tri(n) = 1 + n / 2, if n is even.\n# tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n# For example:\n# tri(2) = 1 + (2 / 2) = 2\n# tri(4) = 3\n# tri(3) = tri(2) + tri(1) + tri(4)\n# = 2 + 3 + 3 = 8 \n# You are given a non-negative integer number n, you have to a return an array of the \n# first n + 1 numbers of the Tribonacci sequence.\n# Examples:\n# >>> tri(3)\n# [1, 3, 2, 8]\nsub tri {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&tri;\n if(eq_deeply($candidate->(3),[1, 3, 2, 8])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4),[1, 3, 2, 8, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5),[1, 3, 2, 8, 3, 15])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6),[1, 3, 2, 8, 3, 15, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7),[1, 3, 2, 8, 3, 15, 4, 24])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),[1, 3, 2, 8, 3, 15, 4, 24, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(9),[1, 3, 2, 8, 3, 15, 4, 24, 5, 35])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(20),[1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(0),[1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),[1, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "pl", - "prompt": "# You are given an array of two strings, both strings consist of open\n# parentheses '(' or close parentheses ')' only.\n# Your job is to check if it is possible to concatenate the two strings in\n# some order, that the resulting string will be good.\n# A string S is considered to be good if and only if all parentheses in S\n# are balanced. For example: the string '(())()' is good, while the string\n# '())' is not.\n# Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n# Examples:\n# >>> match_parens([\"()(\", \")\"])\n# \"Yes\"\n# >>> match_parens([\")\", \")\"])\n# \"No\"\nsub match_parens {\n my($lst) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&match_parens;\n if(eq_deeply($candidate->([\"()(\", \")\"]),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\")\", \")\"]),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"(()(())\", \"())())\"]),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\")())\", \"(()()(\"]),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"(())))\", \"(()())((\"]),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"()\", \"())\"]),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"(()(\", \"()))()\"]),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"((((\", \"((())\"]),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\")(()\", \"(()(\"]),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\")(\", \")(\"]),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"(\", \")\"]),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\")\", \"(\"]),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "pl", - "prompt": "# From an array of integers, remove all elements that occur more than once.\n# Keep order of elements left the same as in the input.\n# >>> remove_duplicates([1, 2, 3, 2, 4])\n# [1, 3, 4]\nsub remove_duplicates {\n my($numbers) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&remove_duplicates;\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4]),[1, 2, 3, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 2, 4, 3, 5]),[1, 4, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "pl", - "prompt": "# Return a greatest common divisor of two integers a and b\n# >>> greatest_common_divisor(3, 5)\n# 1\n# >>> greatest_common_divisor(25, 15)\n# 5\nsub greatest_common_divisor {\n my($a, $b) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&greatest_common_divisor;\n if(eq_deeply($candidate->(3, 7),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10, 15),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(49, 14),7)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(144, 60),12)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "pl", - "prompt": "# Checks if given string is a palindrome\n# >>> is_palindrome(\"\")\n# 1\n# >>> is_palindrome(\"aba\")\n# 1\n# >>> is_palindrome(\"aaaaa\")\n# 1\n# >>> is_palindrome(\"zbcd\")\n# \"\"\nsub is_palindrome {\n my($text) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_palindrome;\n if(eq_deeply($candidate->(\"\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aba\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aaaaa\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"zbcd\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"xywyx\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"xywyz\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"xywzx\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "pl", - "prompt": "# xs represent coefficients of a polynomial.\n# xs[0] + xs[1] * x + xs[2] * x^2 + ....\n# Return derivative of this polynomial in the same form.\n# >>> derivative([3, 1, 2, 4, 5])\n# [1, 4, 12, 20]\n# >>> derivative([1, 2, 3])\n# [2, 6]\nsub derivative {\n my($xs) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&derivative;\n if(eq_deeply($candidate->([3, 1, 2, 4, 5]),[1, 4, 12, 20])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3]),[2, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 1]),[2, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 1, 0, 4]),[2, 2, 0, 16])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "pl", - "prompt": "# In this task, you will be given a string that represents a number of apples and oranges \n# that are distributed in a basket of fruit this basket contains \n# apples, oranges, and mango fruits. Given the string that represents the total number of \n# the oranges and apples and an integer that represent the total number of the fruits \n# in the basket return the number of the mango fruits in the basket.\n# for examble:\n# >>> fruit_distribution(\"5 apples and 6 oranges\", 19)\n# 8\n# >>> fruit_distribution(\"0 apples and 1 oranges\", 3)\n# 2\n# >>> fruit_distribution(\"2 apples and 3 oranges\", 100)\n# 95\n# >>> fruit_distribution(\"100 apples and 1 oranges\", 120)\n# 19\nsub fruit_distribution {\n my($s, $n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&fruit_distribution;\n if(eq_deeply($candidate->(\"5 apples and 6 oranges\", 19),8)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"5 apples and 6 oranges\", 21),10)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"0 apples and 1 oranges\", 3),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1 apples and 0 oranges\", 3),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2 apples and 3 oranges\", 100),95)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2 apples and 3 oranges\", 5),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1 apples and 100 oranges\", 120),19)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "pl", - "prompt": "# Write a function that takes an integer a and returns 1 \n# if this ingeger is a cube of some integer number.\n# Note: you may assume the input is always valid.\n# Examples:\n# >>> iscube(1)\n# 1\n# >>> iscube(2)\n# \"\"\n# >>> iscube(-1)\n# 1\n# >>> iscube(64)\n# 1\n# >>> iscube(0)\n# 1\n# >>> iscube(180)\n# \"\"\nsub iscube {\n my($a) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&iscube;\n if(eq_deeply($candidate->(1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(-1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(64),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(180),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1000),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(0),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1729),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "pl", - "prompt": "# In this Kata, you have to sort an array of non-negative integers according to\n# number of ones in their binary representation in ascending order.\n# For similar number of ones, sort based on decimal value.\n# It must be implemented like this:\n# >>> sort_array([1, 5, 2, 3, 4])\n# [1, 2, 3, 4, 5]\n# >>> sort_array([-2, -3, -4, -5, -6])\n# [-6, -5, -4, -3, -2]\n# >>> sort_array([1, 0, 2, 3, 4])\n# [0, 1, 2, 3, 4]\nsub sort_array {\n my($arr) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sort_array;\n if(eq_deeply($candidate->([1, 5, 2, 3, 4]),[1, 2, 4, 3, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-2, -3, -4, -5, -6]),[-4, -2, -6, -5, -3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 0, 2, 3, 4]),[0, 1, 2, 4, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]),[2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 6, 44, 12, 32, 5]),[32, 3, 5, 6, 12, 44])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, 8, 16, 32]),[2, 4, 8, 16, 32])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, 8, 16, 32]),[2, 4, 8, 16, 32])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "pl", - "prompt": "# Given an array of strings, where each string consists of only digits, return an array.\n# Each element i of the output should be \"the number of odd elements in the\n# string i of the input.\" where all the i's should be replaced by the number\n# of odd digits in the i'th string of the input.\n# >>> odd_count([\"1234567\"])\n# [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n# >>> odd_count([\"3\", \"11111111\"])\n# [\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\nsub odd_count {\n my($lst) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&odd_count;\n if(eq_deeply($candidate->([\"1234567\"]),[\"the number of odd elements 4n the str4ng 4 of the 4nput.\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($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.\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"271\", \"137\", \"314\"]),[\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "pl", - "prompt": "# brackets is a string of \"(\" and \")\".\n# return 1 if every opening bracket has a corresponding closing bracket.\n# >>> correct_bracketing(\"(\")\n# \"\"\n# >>> correct_bracketing(\"()\")\n# 1\n# >>> correct_bracketing(\"(()())\")\n# 1\n# >>> correct_bracketing(\")(()\")\n# \"\"\nsub correct_bracketing {\n my($brackets) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&correct_bracketing;\n if(eq_deeply($candidate->(\"()\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"(()())\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"()()(()())()\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"()()((()()())())(()()(()))\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"((()())))\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\")(()\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"(\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"((((\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\")\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"(()\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"()()(()())())(()\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"()()(()())()))()\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "pl", - "prompt": "# Task\n# Write a function that takes a string as input and returns the sum of the upper characters only'\n# ASCII codes.\n# Examples:\n# >>> digitSum(\"\")\n# 0\n# >>> digitSum(\"abAB\")\n# 131\n# >>> digitSum(\"abcCd\")\n# 67\n# >>> digitSum(\"helloE\")\n# 69\n# >>> digitSum(\"woArBld\")\n# 131\n# >>> digitSum(\"aAaaaXa\")\n# 153\nsub digitSum {\n my($s) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&digitSum;\n if(eq_deeply($candidate->(\"\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abAB\"),131)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcCd\"),67)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"helloE\"),69)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"woArBld\"),131)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aAaaaXa\"),153)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\" How are yOu?\"),151)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"You arE Very Smart\"),327)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "pl", - "prompt": "# Write a function that accepts an array of strings as a parameter,\n# deletes the strings that have odd lengths from it,\n# and returns the resulted array with a sorted order,\n# The array is always an array of strings and never an array of numbers,\n# and it may contain duplicates.\n# The order of the array should be ascending by length of each word, and you\n# should return the array sorted by that rule.\n# If two words have the same length, sort the array alphabetically.\n# The function should return an array of strings in sorted order.\n# You may assume that all words will have the same length.\n# For example:\n# >>> list_sort([\"aa\", \"a\", \"aaa\"])\n# [\"aa\"]\n# >>> list_sort([\"ab\", \"a\", \"aaa\", \"cd\"])\n# [\"ab\", \"cd\"]\nsub sorted_list_sum {\n my($lst) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sorted_list_sum;\n if(eq_deeply($candidate->([\"aa\", \"a\", \"aaa\"]),[\"aa\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"school\", \"AI\", \"asdf\", \"b\"]),[\"AI\", \"asdf\", \"school\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"d\", \"b\", \"c\", \"a\"]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"d\", \"dcba\", \"abcd\", \"a\"]),[\"abcd\", \"dcba\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"AI\", \"ai\", \"au\"]),[\"AI\", \"ai\", \"au\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"aaaa\", \"bbbb\", \"dd\", \"cc\"]),[\"cc\", \"dd\", \"aaaa\", \"bbbb\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "pl", - "prompt": "# You are given an array arr of integers and you need to return\n# sum of magnitudes of integers multiplied by product of all signs\n# of each number in the array, represented by 1, -1 or 0.\n# Note: return undef for empty arr.\n# Example:\n# >>> prod_signs([1, 2, 2, -4])\n# 9\n# >>> prod_signs([0, 1])\n# 0\n# >>> prod_signs([])\n# undef\nsub prod_signs {\n my($arr) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&prod_signs;\n if(eq_deeply($candidate->([1, 2, 2, -4]),-9)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 1]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 1, 1, 2, 3, -1, 1]),-10)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),undef)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, 1, 2, -1, -1, 9]),20)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, 1, -1, 1]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, 1, 1, 1]),-4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, 1, 1, 0]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "pl", - "prompt": "# Return array with elements incremented by 1.\n# >>> incr_list([1, 2, 3])\n# [2, 3, 4]\n# >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123])\n# [6, 4, 6, 3, 4, 4, 10, 1, 124]\nsub incr_list {\n my($l) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&incr_list;\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 1]),[4, 3, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 2, 5, 2, 3, 3, 9, 0, 123]),[6, 3, 6, 3, 4, 4, 10, 1, 124])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "pl", - "prompt": "# From a given array of integers, generate an array of rolling maximum element found until given moment\n# in the sequence.\n# >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n# [1, 2, 3, 3, 3, 4, 4]\nsub rolling_max {\n my($numbers) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&rolling_max;\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4]),[1, 2, 3, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 3, 2, 1]),[4, 4, 4, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 3, 100, 3]),[3, 3, 3, 100, 100])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "pl", - "prompt": "# Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n# separate those group into separate strings and return the array of those.\n# Separate groups are balanced (each open brace is properly closed) and not nested within each other\n# Ignore any spaces in the input string.\n# >>> separate_paren_groups(\"( ) (( )) (( )( ))\")\n# [\"()\", \"(())\", \"(()())\"]\nsub separate_paren_groups {\n my($paren_string) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&separate_paren_groups;\n if(eq_deeply($candidate->(\"(()()) ((())) () ((())()())\"),[\"(()())\", \"((()))\", \"()\", \"((())()())\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"() (()) ((())) (((())))\"),[\"()\", \"(())\", \"((()))\", \"(((())))\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"(()(())((())))\"),[\"(()(())((())))\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"( ) (( )) (( )( ))\"),[\"()\", \"(())\", \"(()())\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "pl", - "prompt": "# You will be given a string of words separated by commas or spaces. Your task is\n# to split the string into words and return an array of the words.\n# For example:\n# >>> words_string(\"Hi, my name is John\")\n# [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n# >>> words_string(\"One, two, three, four, five, six\")\n# [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\nsub words_string {\n my($s) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&words_string;\n if(eq_deeply($candidate->(\"Hi, my name is John\"),[\"Hi\", \"my\", \"name\", \"is\", \"John\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"One, two, three, four, five, six\"),[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hi, my name\"),[\"Hi\", \"my\", \"name\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"One,, two, three, four, five, six,\"),[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ahmed , gamal\"),[\"ahmed\", \"gamal\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "pl", - "prompt": "# Create a function that takes integers, floats, or strings representing\n# real numbers, and returns the larger variable in its given variable type.\n# Return undef if the values are equal.\n# Note: If a real number is represented as a string, the floating point might be . or ,\n# >>> compare_one(1, 2.5)\n# 2.5\n# >>> compare_one(1, \"2,3\")\n# \"2,3\"\n# >>> compare_one(\"5,1\", \"6\")\n# \"6\"\n# >>> compare_one(\"1\", 1)\n# undef\nsub compare_one {\n my($a, $b) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&compare_one;\n if(eq_deeply($candidate->(1, 2),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 2.5),2.5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 3),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5, 6),6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, \"2,3\"),\"2,3\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"5,1\", \"6\"),\"6\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1\", \"2\"),\"2\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1\", 1),undef)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "pl", - "prompt": "# Filter given array of any plthon values only for integers\n# >>> filter_integers([\"a\", 3.14, 5])\n# [5]\n# >>> filter_integers([1, 2, 3, \"abc\", {}, []])\n# [1, 2, 3]\nsub filter_integers {\n my($values) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&filter_integers;\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, {}, [], 23.2, 9, \"adasd\"]),[4, 9])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, \"c\", 3, 3, \"a\", \"b\"]),[3, 3, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "pl", - "prompt": "# This function takes an array l and returns an array l' such that\n# l' is identical to l in the odd indicies, while its values at the even indicies are equal\n# to the values of the even indicies of l, but sorted.\n# >>> sort_even([1, 2, 3])\n# [1, 2, 3]\n# >>> sort_even([5, 6, 3, 4])\n# [3, 6, 5, 4]\nsub sort_even {\n my($l) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sort_even;\n if(eq_deeply($candidate->([1, 2, 3]),[1, 2, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]),[-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 8, -12, 4, 23, 2, 3, 11, 12, -10]),[-12, 8, 3, 4, 5, 2, 12, 11, 23, -10])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "pl", - "prompt": "# I think we all remember that feeling when the result of some long-awaited\n# event is finally known. The feelings and thoughts you have at that moment are\n# definitely worth noting down and comparing.\n# Your task is to determine if a person correctly guessed the results of a number of matches.\n# You are given two arrays of scores and guesses of equal length, where each index shows a match. \n# Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n# the value is 0, and if not, the value is the absolute difference between the guess and the score.\n# example:\n# >>> compare([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2])\n# [0, 0, 0, 0, 3, 3]\n# >>> compare([0, 5, 0, 0, 0, 4], [4, 1, 1, 0, 0, -2])\n# [4, 4, 1, 0, 0, 6]\nsub compare {\n my($game, $guess) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&compare;\n if(eq_deeply($candidate->([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2]),[0, 0, 0, 0, 3, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]),[0, 0, 0, 0, 0, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3], [-1, -2, -3]),[2, 4, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 5], [-1, 2, 3, 4]),[2, 0, 0, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "pl", - "prompt": "# Given a positive integer n, return an array that has the number of even and odd\n# integer palindromes that fall within the range(1, n), inclusive.\n# Example 1:\n# >>> even_odd_palindrome(3)\n# [1, 2]\n# Explanation:\n# Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n# Example 2:\n# >>> even_odd_palindrome(12)\n# [4, 6]\n# Explanation:\n# Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n# Note:\n# 1. 1 <= n <= 10^3\n# 2. returned array has the number of even and odd integer palindromes respectively.\nsub even_odd_palindrome {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&even_odd_palindrome;\n if(eq_deeply($candidate->(123),[8, 13])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12),[4, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3),[1, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(63),[6, 8])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(25),[5, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(19),[4, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(9),[4, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),[0, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "pl", - "prompt": "# The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fib4(0) -> 0\n# fib4(1) -> 0\n# fib4(2) -> 2\n# fib4(3) -> 0\n# fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n# Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n# >>> fib4(5)\n# 4\n# >>> fib4(6)\n# 8\n# >>> fib4(7)\n# 14\nsub fib4 {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&fib4;\n if(eq_deeply($candidate->(5),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),28)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),104)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12),386)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "pl", - "prompt": "# Given two positive integers a and b, return the even digits between a\n# and b, in ascending order.\n# For example:\n# >>> generate_integers(2, 8)\n# [2, 4, 6, 8]\n# >>> generate_integers(8, 2)\n# [2, 4, 6, 8]\n# >>> generate_integers(10, 14)\n# []\nsub generate_integers {\n my($a, $b) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&generate_integers;\n if(eq_deeply($candidate->(2, 10),[2, 4, 6, 8])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10, 2),[2, 4, 6, 8])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(132, 2),[2, 4, 6, 8])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(17, 89),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "pl", - "prompt": "# For a given array of input numbers, calculate Mean Absolute Deviation\n# around the mean of this dataset.\n# Mean Absolute Deviation is the average absolute difference between each\n# element and a centerpoint (mean in this case):\n# MAD = average | x - x_mean |\n# >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n# 1.0\nsub mean_absolute_deviation {\n my($numbers) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&mean_absolute_deviation;\n if(eq_deeply($candidate->([1.0, 2.0]),0.5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.0, 4.0]),1.0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.0, 4.0, 5.0]),1.2)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "pl", - "prompt": "# Create a function encrypt that takes a string as an argument and\n# returns a string encrypted with the alphabet being rotated. \n# The alphabet should be rotated in a manner such that the letters \n# shift down by two multiplied to two places.\n# For example:\n# >>> encrypt(\"hi\")\n# \"lm\"\n# >>> encrypt(\"asdfghjkl\")\n# \"ewhjklnop\"\n# >>> encrypt(\"gf\")\n# \"kj\"\n# >>> encrypt(\"et\")\n# \"ix\"\nsub encrypt {\n my($s) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&encrypt;\n if(eq_deeply($candidate->(\"hi\"),\"lm\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"asdfghjkl\"),\"ewhjklnop\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"gf\"),\"kj\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"et\"),\"ix\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"faewfawefaewg\"),\"jeiajeaijeiak\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"hellomyfriend\"),\"lippsqcjvmirh\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\"),\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"a\"),\"e\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "pl", - "prompt": "# Given a positive integer n, return a sorted array that has the odd numbers in collatz sequence.\n# The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n# as follows: start with any positive integer n. Then each term is obtained from the \n# previous term as follows: if the previous term is even, the next term is one half of \n# the previous term. If the previous term is odd, the next term is 3 times the previous\n# term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n# Note: \n# 1. Collatz(1) is [1].\n# 2. returned array sorted in increasing order.\n# For example:\n# get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n# >>> get_odd_collatz(5)\n# [1, 5]\nsub get_odd_collatz {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&get_odd_collatz;\n if(eq_deeply($candidate->(14),[1, 5, 7, 11, 13, 17])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5),[1, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12),[1, 3, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),[1])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "pl", - "prompt": "# Find how many times a given substring can be found in the original string. Count overlaping cases.\n# >>> how_many_times(\"\", \"a\")\n# 0\n# >>> how_many_times(\"aaa\", \"a\")\n# 3\n# >>> how_many_times(\"aaaa\", \"aa\")\n# 3\nsub how_many_times {\n my($string, $substring) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&how_many_times;\n if(eq_deeply($candidate->(\"\", \"x\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"xyxyxyx\", \"x\"),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"cacacacac\", \"cac\"),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"john doe\", \"john\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "pl", - "prompt": "# We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n# numbers in the array will be randomly ordered. Your task is to determine if\n# it is possible to get an array sorted in non-decreasing order by performing \n# the following operation on the given array:\n# You are allowed to perform right shift operation any number of times.\n# One right shift operation means shifting all elements of the array by one\n# position in the right direction. The last element of the array will be moved to\n# the starting position in the array i.e. 0th index. \n# If it is possible to obtain the sorted array by performing the above operation\n# then return 1 else return ''.\n# If the given array is empty then return 1.\n# Note: The given array is guaranteed to have unique elements.\n# For Example:\n# >>> move_one_ball([3, 4, 5, 1, 2])\n# 1\n# Explanation: By performin 2 right shift operations, non-decreasing order can\n# be achieved for the given array.\n# >>> move_one_ball([3, 5, 4, 1, 2])\n# \"\"\n# Explanation:It is not possible to get non-decreasing order for the given\n# array by performing any number of right shift operations.\nsub move_one_ball {\n my($arr) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&move_one_ball;\n if(eq_deeply($candidate->([3, 4, 5, 1, 2]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 5, 10, 1, 2]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 3, 1, 2]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 5, 4, 1, 2]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "pl", - "prompt": "# Write a function which sorts the given array of integers\n# in ascending order according to the sum of their digits.\n# Note: if there are several items with similar sum of their digits,\n# order them based on their index in original array.\n# For example:\n# >>> order_by_points([1, 11, -1, -11, -12])\n# [-1, -11, 1, -12, 11]\n# >>> order_by_points([])\n# []\nsub order_by_points {\n my($nums) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&order_by_points;\n if(eq_deeply($candidate->([1, 11, -1, -11, -12]),[-1, -11, 1, -12, 11])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]),[0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, -11, -32, 43, 54, -98, 2, -3]),[-3, -32, -98, -11, 1, 2, 43, 54])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]),[1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 6, 6, -76, -21, 23, 4]),[-76, -21, 0, 4, 23, 6, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "pl", - "prompt": "# Return array of prime factors of given integer in the order from smallest to largest.\n# Each of the factors should be arrayed number of times corresponding to how many times it appeares in factorization.\n# Input number should be equal to the product of all factors\n# >>> factorize(8)\n# [2, 2, 2]\n# >>> factorize(25)\n# [5, 5]\n# >>> factorize(70)\n# [2, 5, 7]\nsub factorize {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&factorize;\n if(eq_deeply($candidate->(2),[2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4),[2, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),[2, 2, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(57),[3, 19])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3249),[3, 3, 19, 19])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(185193),[3, 3, 3, 19, 19, 19])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(20577),[3, 19, 19, 19])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(18),[2, 3, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "pl", - "prompt": "# Return 1 if all numbers in the array l are below threshold t.\n# >>> below_threshold([1, 2, 4, 10], 100)\n# 1\n# >>> below_threshold([1, 20, 4, 10], 5)\n# \"\"\nsub below_threshold {\n my($l, $t) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&below_threshold;\n if(eq_deeply($candidate->([1, 2, 4, 10], 100),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 20, 4, 10], 5),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 20, 4, 10], 21),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 20, 4, 10], 22),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 8, 4, 10], 11),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 8, 4, 10], 10),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "pl", - "prompt": "# You are given two positive integers n and m, and your task is to compute the\n# average of the integers from n through m (including n and m). \n# Round the answer to the nearest integer and convert that to binary.\n# If n is greater than m, return -1.\n# Example:\n# >>> rounded_avg(1, 5)\n# \"0b11\"\n# >>> rounded_avg(7, 5)\n# -1\n# >>> rounded_avg(10, 20)\n# \"0b1111\"\n# >>> rounded_avg(20, 33)\n# \"0b11010\"\nsub rounded_avg {\n my($n, $m) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&rounded_avg;\n if(eq_deeply($candidate->(1, 5),\"0b11\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7, 13),\"0b1010\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(964, 977),\"0b1111001010\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(996, 997),\"0b1111100100\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(560, 851),\"0b1011000010\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(185, 546),\"0b101101110\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(362, 496),\"0b110101101\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(350, 902),\"0b1001110010\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(197, 233),\"0b11010111\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7, 5),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5, 1),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5, 5),\"0b101\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "pl", - "prompt": "# Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n# For each of the group, output the deepest level of nesting of parentheses.\n# E.g. (()()) has maximum two levels of nesting while ((())) has three.\n# >>> parse_nested_parens(\"(()()) ((())) () ((())()())\")\n# [2, 3, 1, 3]\nsub parse_nested_parens {\n my($paren_string) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&parse_nested_parens;\n if(eq_deeply($candidate->(\"(()()) ((())) () ((())()())\"),[2, 3, 1, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"() (()) ((())) (((())))\"),[1, 2, 3, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"(()(())((())))\"),[4])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "pl", - "prompt": "# Given a non-empty array of integers, return the sum of all of the odd elements that are in even positions.\n# Examples\n# >>> solution([5, 8, 7, 1])\n# 12\n# >>> solution([3, 3, 3, 3, 3])\n# 9\n# >>> solution([30, 13, 24, 321])\n# 0\nsub solution {\n my($lst) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&solution;\n if(eq_deeply($candidate->([5, 8, 7, 1]),12)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 3, 3, 3, 3]),9)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([30, 13, 24, 321]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 9]),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, 8]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([30, 13, 23, 32]),23)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 13, 2, 9]),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "pl", - "prompt": "# You are given a positive integer n. You have to create an integer array a of length n.\n# For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n# Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n# and a[i] + a[j] + a[k] is a multiple of 3.\n# Example :\n# >>> get_max_triples(5)\n# 1\n# Explanation: \n# a = [1, 3, 7, 13, 21]\n# The only valid triple is (1, 7, 13).\nsub get_max_triples {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&get_max_triples;\n if(eq_deeply($candidate->(5),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),36)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(100),53361)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "pl", - "prompt": "# There are eight planets in our solar system: the closerst to the Sun \n# is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n# Uranus, Neptune.\n# Write a function that takes two planet names as strings planet1 and planet2. \n# The function should return an array containing all planets whose orbits are \n# located between the orbit of planet1 and the orbit of planet2, sorted by \n# the proximity to the sun. \n# The function should return an empty array if planet1 or planet2\n# are not correct planet names. \n# Examples\n# >>> bf(\"Jupiter\", \"Neptune\")\n# [\"Saturn\", \"Uranus\"]\n# >>> bf(\"Earth\", \"Mercury\")\n# \"Venus\"\n# >>> bf(\"Mercury\", \"Uranus\")\n# [\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"]\nsub bf {\n my($planet1, $planet2) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&bf;\n if(eq_deeply($candidate->(\"Jupiter\", \"Neptune\"),[\"Saturn\", \"Uranus\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Earth\", \"Mercury\"),[\"Venus\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Mercury\", \"Uranus\"),[\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Neptune\", \"Venus\"),[\"Earth\", \"Mars\", \"Jupiter\", \"Saturn\", \"Uranus\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Earth\", \"Earth\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Mars\", \"Earth\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Jupiter\", \"Makemake\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "pl", - "prompt": "# You are given an array of integers.\n# Write a function next_smallest() that returns the 2nd smallest element of the array.\n# Return undef if there is no such element.\n# >>> next_smallest([1, 2, 3, 4, 5])\n# 2\n# >>> next_smallest([5, 1, 4, 3, 2])\n# 2\n# >>> next_smallest([])\n# undef\n# >>> next_smallest([1, 1])\n# undef\nsub next_smallest {\n my($lst) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&next_smallest;\n if(eq_deeply($candidate->([1, 2, 3, 4, 5]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 1, 4, 3, 2]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),undef)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 1]),undef)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 1, 1, 1, 0]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 1]),undef)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-35, 34, 12, -45]),-35)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "pl", - "prompt": "# Input is a space-delimited string of numberals from 'zero' to 'nine'.\n# Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n# Return the string with numbers sorted from smallest to largest\n# >>> sort_numbers(\"three one five\")\n# \"one three five\"\nsub sort_numbers {\n my($numbers) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sort_numbers;\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"three\"),\"three\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"three five nine\"),\"three five nine\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"five zero four seven nine eight\"),\"zero four five seven eight nine\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"six five four three two one zero\"),\"zero one two three four five six\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "pl", - "prompt": "# You are given 2 words. You need to return 1 if the second word or any of its rotations is a substring in the first word\n# >>> cycpattern_check(\"abcd\", \"abd\")\n# \"\"\n# >>> cycpattern_check(\"hello\", \"ell\")\n# 1\n# >>> cycpattern_check(\"whassup\", \"psus\")\n# \"\"\n# >>> cycpattern_check(\"abab\", \"baa\")\n# 1\n# >>> cycpattern_check(\"efef\", \"eeff\")\n# \"\"\n# >>> cycpattern_check(\"himenss\", \"simen\")\n# 1\nsub cycpattern_check {\n my($a, $b) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&cycpattern_check;\n if(eq_deeply($candidate->(\"xyzw\", \"xyw\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"yello\", \"ell\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"whattup\", \"ptut\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"efef\", \"fee\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abab\", \"aabb\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"winemtt\", \"tinem\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "pl", - "prompt": "# You will be given a number in decimal form and your task is to convert it to\n# binary format. The function should return a string, with each character representing a binary\n# number. Each character in the string will be '0' or '1'.\n# There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n# The extra characters are there to help with the format.\n# Examples:\n# >>> decimal_to_binary(15)\n# \"db1111db\"\n# >>> decimal_to_binary(32)\n# \"db100000db\"\nsub decimal_to_binary {\n my($decimal) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&decimal_to_binary;\n if(eq_deeply($candidate->(0),\"db0db\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(32),\"db100000db\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(103),\"db1100111db\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(15),\"db1111db\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "pl", - "prompt": "# Filter an input array of strings only for ones that contain given substring\n# >>> filter_by_substring([], \"a\")\n# []\n# >>> filter_by_substring([\"abc\", \"bacd\", \"cde\", \"array\"], \"a\")\n# [\"abc\", \"bacd\", \"array\"]\nsub filter_by_substring {\n my($strings, $substring) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&filter_by_substring;\n if(eq_deeply($candidate->([], \"john\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"),[\"xxx\", \"xxxAAA\", \"xxx\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xx\"),[\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"grunt\", \"trumpet\", \"prune\", \"gruesome\"], \"run\"),[\"grunt\", \"prune\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "pl", - "prompt": "# Given an integer. return an array that has the number of even and odd digits respectively.\n# Example:\n# >>> even_odd_count(-12)\n# [1, 1]\n# >>> even_odd_count(123)\n# [1, 2]\nsub even_odd_count {\n my($num) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&even_odd_count;\n if(eq_deeply($candidate->(7),[0, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(-78),[1, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3452),[2, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(346211),[3, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(-345821),[3, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(-2),[1, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(-45347),[2, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(0),[1, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "pl", - "prompt": "# Write a function that accepts an array of strings.\n# The array contains different words. Return the word with maximum number\n# of unique characters. If multiple strings have maximum number of unique\n# characters, return the one which comes first in lexicographical order.\n# >>> find_max([\"name\", \"of\", \"string\"])\n# \"string\"\n# >>> find_max([\"name\", \"enam\", \"game\"])\n# \"enam\"\n# >>> find_max([\"aaaaaaa\", \"bb\", \"cc\"])\n# \"aaaaaaa\"\nsub find_max {\n my($words) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&find_max;\n if(eq_deeply($candidate->([\"name\", \"of\", \"string\"]),\"string\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"name\", \"enam\", \"game\"]),\"enam\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"aaaaaaa\", \"bb\", \"cc\"]),\"aaaaaaa\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"abc\", \"cba\"]),\"abc\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"play\", \"this\", \"game\", \"of\", \"footbott\"]),\"footbott\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"we\", \"are\", \"gonna\", \"rock\"]),\"gonna\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"we\", \"are\", \"a\", \"mad\", \"nation\"]),\"nation\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"this\", \"is\", \"a\", \"prrk\"]),\"this\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"b\"]),\"b\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"play\", \"play\", \"play\"]),\"play\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "pl", - "prompt": "# Given a positive integer n, return the count of the numbers of n-digit\n# positive integers that start or end with 1.\nsub starts_one_ends {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&starts_one_ends;\n if(eq_deeply($candidate->(1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2),18)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3),180)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4),1800)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5),18000)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "pl", - "prompt": "# Create a function that returns an array (a, b), where 'a' is\n# the largest of negative integers, and 'b' is the smallest\n# of positive integers in an array.\n# If there is no negative or positive integers, return them as undef.\n# Examples:\n# >>> largest_smallest_integers([2, 4, 1, 3, 5, 7])\n# [undef, 1]\n# >>> largest_smallest_integers([])\n# [undef, undef]\n# >>> largest_smallest_integers([0])\n# [undef, undef]\nsub largest_smallest_integers {\n my($lst) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&largest_smallest_integers;\n if(eq_deeply($candidate->([2, 4, 1, 3, 5, 7]),[undef, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, 1, 3, 5, 7, 0]),[undef, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, 2, 4, 5, 6, -2]),[-2, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 5, 3, 6, 2, 7, -7]),[-7, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([7, 3, 8, 4, 9, 2, 5, -9]),[-9, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),[undef, undef])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0]),[undef, undef])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -3, -5, -6]),[-1, undef])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -3, -5, -6, 0]),[-1, undef])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-6, -4, -4, -3, 1]),[-3, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-6, -4, -4, -3, -100, 1]),[-3, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "pl", - "prompt": "# \"Given an array representing a branch of a tree that has non-negative integer nodes\n# your task is to pluck one of the nodes and return it.\n# The plucked node should be the node with the smallest even value.\n# If multiple nodes with the same smallest even value are found return the node that has smallest index.\n# The plucked node should be returned in an array, [ smalest_value, its index ],\n# If there are no even values or the given array is empty, return [].\n# Example 1:\n# >>> pluck([4, 2, 3])\n# [2, 1]\n# Explanation: 2 has the smallest even value, and 2 has the smallest index.\n# Example 2:\n# >>> pluck([1, 2, 3])\n# [2, 1]\n# Explanation: 2 has the smallest even value, and 2 has the smallest index.\n# Example 3:\n# >>> pluck([])\n# []\n# Example 4:\n# >>> pluck([5, 0, 3, 0, 4, 2])\n# [0, 1]\n# Explanation: 0 is the smallest value, but there are two zeros,\n# so we will choose the first zero, which has the smallest index.\n# Constraints:\n# * 1 <= nodes.length <= 10000\n# * 0 <= node.value\nsub pluck {\n my($arr) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&pluck;\n if(eq_deeply($candidate->([4, 2, 3]),[2, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3]),[2, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 0, 3, 0, 4, 2]),[0, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 0, 5, 3]),[0, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 4, 8, 4, 8]),[4, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([7, 6, 7, 1]),[6, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([7, 9, 7, 1]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "pl", - "prompt": "# Write a function count_nums which takes an array of integers and returns\n# the number of elements which has a sum of digits > 0.\n# If a number is negative, then its first signed digit will be negative:\n# e.g. -123 has signed digits -1, 2, and 3.\n# >>> count_nums([])\n# 0\n# >>> count_nums([-1, 11, -11])\n# 1\n# >>> count_nums([1, 1, 2])\n# 3\nsub count_nums {\n my($arr) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&count_nums;\n if(eq_deeply($candidate->([]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -2, 0]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 1, 2, -2, 3, 4, 5]),6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 6, 9, -6, 0, 1, 5]),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 100, 98, -7, 1, -1]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([12, 23, 34, -45, -56, 0]),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "pl", - "prompt": "# Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n# each cell of the grid contains a value. Every integer in the range [1, N * N]\n# inclusive appears exactly once on the cells of the grid.\n# You have to find the minimum path of length k in the grid. You can start\n# from any cell, and in each step you can move to any of the neighbor cells,\n# in other words, you can go to cells which share an edge with you current\n# cell.\n# Please note that a path of length k means visiting exactly k cells (not\n# necessarily distinct).\n# You CANNOT go off the grid.\n# A path A (of length k) is considered less than a path B (of length k) if\n# after making the ordered arrays of the values on the cells that A and B go\n# through (let's call them lst_A and lst_B), lst_A is lexicographically less\n# than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n# such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n# lst_A[j] = lst_B[j].\n# It is guaranteed that the answer is unique.\n# Return an ordered array of the values on the cells that the minimum path go through.\n# Examples: \n# >>> minPath([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3)\n# [1, 2, 1]\n# >>> minPath([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1)\n# [1]\nsub minPath {\n my($grid, $k) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&minPath;\n if(eq_deeply($candidate->([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3),[1, 2, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1),[1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], 4),[1, 2, 1, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[6, 4, 13, 10], [5, 7, 12, 1], [3, 16, 11, 15], [8, 14, 9, 2]], 7),[1, 10, 1, 10, 1, 10, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[8, 14, 9, 2], [6, 4, 13, 15], [5, 7, 1, 12], [3, 10, 11, 16]], 5),[1, 7, 1, 7, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[11, 8, 7, 2], [5, 16, 14, 4], [9, 3, 15, 6], [12, 13, 10, 1]], 9),[1, 6, 1, 6, 1, 6, 1, 6, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[12, 13, 10, 1], [9, 3, 15, 6], [5, 16, 14, 4], [11, 8, 7, 2]], 12),[1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[2, 7, 4], [3, 1, 5], [6, 8, 9]], 8),[1, 3, 1, 3, 1, 3, 1, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[6, 1, 5], [3, 8, 9], [2, 7, 4]], 8),[1, 5, 1, 5, 1, 5, 1, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1, 2], [3, 4]], 10),[1, 2, 1, 2, 1, 2, 1, 2, 1, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1, 3], [3, 2]], 10),[1, 3, 1, 3, 1, 3, 1, 3, 1, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "pl", - "prompt": "# Given array of integers, return array in strange order.\n# Strange sorting, is when you start with the minimum value,\n# then maximum of the remaining integers, then minimum and so on.\n# Examples:\n# >>> strange_sort_list([1, 2, 3, 4])\n# [1, 4, 2, 3]\n# >>> strange_sort_list([5, 5, 5, 5])\n# [5, 5, 5, 5]\n# >>> strange_sort_list([])\n# []\nsub strange_sort_list {\n my($lst) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&strange_sort_list;\n if(eq_deeply($candidate->([1, 2, 3, 4]),[1, 4, 2, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 6, 7, 8, 9]),[5, 9, 6, 8, 7])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 5]),[1, 5, 2, 4, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 6, 7, 8, 9, 1]),[1, 9, 5, 8, 6, 7])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 5, 5, 5]),[5, 5, 5, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 5, 6, 7, 8]),[1, 8, 2, 7, 3, 6, 4, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 2, 2, 2, 5, 5, -5, -5]),[-5, 5, -5, 5, 0, 2, 2, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([111111]),[111111])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "pl", - "prompt": "# Given a string 'text', return its md5 hash equivalent string.\n# If 'text' is an empty string, return undef.\n# >>> string_to_md5(\"Hello world\")\n# \"3e25960a79dbc69b674cd4ec67a72c62\"\nsub string_to_md5 {\n my($text) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&string_to_md5;\n if(eq_deeply($candidate->(\"Hello world\"),\"3e25960a79dbc69b674cd4ec67a72c62\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),undef)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"A B C\"),\"0ef78513b0cb8cef12743f5aeb35f888\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"password\"),\"5f4dcc3b5aa765d61d8327deb882cf99\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "pl", - "prompt": "# You are given a word. Your task is to find the closest vowel that stands between \n# two consonants from the right side of the word (case sensitive).\n# Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n# find any vowel met the above condition. \n# You may assume that the given string contains English letter only.\n# Example:\n# >>> get_closest_vowel(\"yogurt\")\n# \"u\"\n# >>> get_closest_vowel(\"FULL\")\n# \"U\"\n# >>> get_closest_vowel(\"quick\")\n# \"\"\n# >>> get_closest_vowel(\"ab\")\n# \"\"\nsub get_closest_vowel {\n my($word) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&get_closest_vowel;\n if(eq_deeply($candidate->(\"yogurt\"),\"u\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"full\"),\"u\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"easy\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"eAsy\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ali\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"bad\"),\"a\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"most\"),\"o\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ab\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ba\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"quick\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"anime\"),\"i\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Asia\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Above\"),\"o\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "pl", - "prompt": "# Change numerical base of input number x to base.\n# return string representation after the conversion.\n# base numbers are less than 10.\n# >>> change_base(8, 3)\n# \"22\"\n# >>> change_base(8, 2)\n# \"1000\"\n# >>> change_base(7, 2)\n# \"111\"\nsub change_base {\n my($x, $base) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&change_base;\n if(eq_deeply($candidate->(8, 3),\"22\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(9, 3),\"100\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(234, 2),\"11101010\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(16, 2),\"10000\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8, 2),\"1000\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7, 2),\"111\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 3),\"2\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3, 4),\"3\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4, 5),\"4\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5, 6),\"5\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6, 7),\"6\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7, 8),\"7\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "pl", - "prompt": "# Check if in given array of numbers, are any two numbers closer to each other than\n# given threshold.\n# >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n# \"\"\n# >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n# 1\nsub has_close_elements {\n my($numbers, $threshold) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&has_close_elements;\n if(eq_deeply($candidate->([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 5.9, 4.0, 5.0], 0.95),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 5.9, 4.0, 5.0], 0.8),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.1, 2.2, 3.1, 4.1, 5.1], 1.0),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.1, 2.2, 3.1, 4.1, 5.1], 0.5),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "pl", - "prompt": "# Create a function that takes a string as input which contains only square brackets.\n# The function should return 1 if and only if there is a valid subsequence of brackets \n# where at least one bracket in the subsequence is nested.\n# >>> is_nested(\"[[]]\")\n# 1\n# >>> is_nested(\"[]]]]]]][[[[[]\")\n# \"\"\n# >>> is_nested(\"[][]\")\n# \"\"\n# >>> is_nested(\"[]\")\n# \"\"\n# >>> is_nested(\"[[][]]\")\n# 1\n# >>> is_nested(\"[[]][[\")\n# 1\nsub is_nested {\n my($string) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_nested;\n if(eq_deeply($candidate->(\"[[]]\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[]]]]]]][[[[[]\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[][]\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[]\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[[[[]]]]\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[]]]]]]]]]]\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[][][[]]\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[[]\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[]]\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[[]][[\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[[][]]\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[[[[[[[[\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"]]]]]]]]\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "pl", - "prompt": "# Concatenate array of strings into a single string\n# >>> concatenate([])\n# \"\"\n# >>> concatenate([\"a\", \"b\", \"c\"])\n# \"abc\"\nsub concatenate {\n my($strings) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&concatenate;\n if(eq_deeply($candidate->([]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"x\", \"y\", \"z\"]),\"xyz\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"x\", \"y\", \"z\", \"w\", \"k\"]),\"xyzwk\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "pl", - "prompt": "# prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n# >>> prime_fib(1)\n# 2\n# >>> prime_fib(2)\n# 3\n# >>> prime_fib(3)\n# 5\n# >>> prime_fib(4)\n# 13\n# >>> prime_fib(5)\n# 89\nsub prime_fib {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&prime_fib;\n if(eq_deeply($candidate->(1),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4),13)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5),89)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6),233)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7),1597)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),28657)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(9),514229)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),433494437)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "pl", - "prompt": "# From a supplied array of numbers (of length at least two) select and return two that are the closest to each\n# other and return them in order (smaller number, larger number).\n# >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n# [2.0, 2.2]\n# >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n# [2.0, 2.0]\nsub find_closest_elements {\n my($numbers) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&find_closest_elements;\n if(eq_deeply($candidate->([1.0, 2.0, 3.9, 4.0, 5.0, 2.2]),[3.9, 4.0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 5.9, 4.0, 5.0]),[5.0, 5.9])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]),[2.0, 2.2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]),[2.0, 2.0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.1, 2.2, 3.1, 4.1, 5.1]),[2.2, 3.1])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "pl", - "prompt": "# You have been tasked to write a function that receives \n# a hexadecimal number as a string and counts the number of hexadecimal \n# digits that are primes (prime number, or a prime, is a natural number \n# greater than 1 that is not a product of two smaller natural numbers).\n# Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n# Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n# So you have to determine a number of the following digits: 2, 3, 5, 7, \n# B (=decimal 11), D (=decimal 13).\n# Note: you may assume the input is always correct or empty string, \n# and symbols A,B,C,D,E,F are always uppercase.\n# Examples:\n# >>> hex_key(\"AB\")\n# 1\n# >>> hex_key(\"1077E\")\n# 2\n# >>> hex_key(\"ABED1A33\")\n# 4\n# >>> hex_key(\"123456789ABCDEF0\")\n# 6\n# >>> hex_key(\"2020\")\n# 2\nsub hex_key {\n my($num) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&hex_key;\n if(eq_deeply($candidate->(\"AB\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1077E\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ABED1A33\"),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2020\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"123456789ABCDEF0\"),6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"112233445566778899AABBCCDDEEFF00\"),12)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "pl", - "prompt": "# Complete the function that takes two integers and returns \n# the product of their unit digits.\n# Assume the input is always valid.\n# Examples:\n# >>> multiply(148, 412)\n# 16\n# >>> multiply(19, 28)\n# 72\n# >>> multiply(2020, 1851)\n# 0\n# >>> multiply(14, -15)\n# 20\nsub multiply {\n my($a, $b) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&multiply;\n if(eq_deeply($candidate->(148, 412),16)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(19, 28),72)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2020, 1851),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(14, -15),20)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(76, 67),42)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(17, 27),49)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(0, 1),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(0, 0),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "pl", - "prompt": "# Given array of numbers (of at least two elements), apply a linear transform to that array,\n# such that the smallest number will become 0 and the largest will become 1\n# >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n# [0.0, 0.25, 0.5, 0.75, 1.0]\nsub rescale_to_unit {\n my($numbers) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&rescale_to_unit;\n if(eq_deeply($candidate->([2.0, 49.9]),[0.0, 1.0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([100.0, 49.9]),[1.0, 0.0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.0, 4.0, 5.0]),[0.0, 0.25, 0.5, 0.75, 1.0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2.0, 1.0, 5.0, 3.0, 4.0]),[0.25, 0.0, 1.0, 0.5, 0.75])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([12.0, 11.0, 15.0, 13.0, 14.0]),[0.25, 0.0, 1.0, 0.5, 0.75])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "pl", - "prompt": "# Given a positive integer n, return the product of the odd digits.\n# Return 0 if all digits are even.\n# For example:\n# >>> digits(1)\n# 1\n# >>> digits(4)\n# 0\n# >>> digits(235)\n# 15\nsub digits {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&digits;\n if(eq_deeply($candidate->(5),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(54),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(120),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5014),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(98765),315)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5576543),2625)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2468),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "pl", - "prompt": "# You will be given the name of a class (a string) and an array of extensions.\n# The extensions are to be used to load additional classes to the class. The\n# strength of the extension is as follows: Let CAP be the number of the uppercase\n# letters in the extension's name, and let SM be the number of lowercase letters \n# in the extension's name, the strength is given by the fraction CAP - SM. \n# You should find the strongest extension and return a string in this \n# format: ClassName.StrongestExtensionName.\n# If there are two or more extensions with the same strength, you should\n# choose the one that comes first in the array.\n# For example, if you are given \"Slices\" as the class and an array of the\n# extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n# return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n# (its strength is -1).\n# Example:\n# >>> Strongest_Extension(\"my_class\", [\"AA\", \"Be\", \"CC\"])\n# \"my_class.AA\"\nsub Strongest_Extension {\n my($class_name, $extensions) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&Strongest_Extension;\n if(eq_deeply($candidate->(\"Watashi\", [\"tEN\", \"niNE\", \"eIGHt8OKe\"]),\"Watashi.eIGHt8OKe\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Boku123\", [\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"]),\"Boku123.YEs.WeCaNe\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"__YESIMHERE\", [\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"]),\"__YESIMHERE.NuLl__\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"K\", [\"Ta\", \"TAR\", \"t234An\", \"cosSo\"]),\"K.TAR\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"__HAHA\", [\"Tab\", \"123\", \"781345\", \"-_-\"]),\"__HAHA.123\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"YameRore\", [\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"]),\"YameRore.okIWILL123\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"finNNalLLly\", [\"Die\", \"NowW\", \"Wow\", \"WoW\"]),\"finNNalLLly.WoW\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"_\", [\"Bb\", \"91245\"]),\"_.Bb\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Sp\", [\"671235\", \"Bb\"]),\"Sp.671235\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "pl", - "prompt": "# Given a string representing a space separated lowercase letters, return a hash\n# of the letter with the most repetition and containing the corresponding count.\n# If several letters have the same occurrence, return all of them.\n# Example:\n# >>> histogram(\"a b c\")\n# {\"a\" => 1, \"b\" => 1, \"c\" => 1}\n# >>> histogram(\"a b b a\")\n# {\"a\" => 2, \"b\" => 2}\n# >>> histogram(\"a b c a b\")\n# {\"a\" => 2, \"b\" => 2}\n# >>> histogram(\"b b b b a\")\n# {\"b\" => 4}\n# >>> histogram(\"\")\n# {}\nsub histogram {\n my($test) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&histogram;\n if(eq_deeply($candidate->(\"a b b a\"),{\"a\" => 2, \"b\" => 2})) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"a b c a b\"),{\"a\" => 2, \"b\" => 2})) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"a b c d g\"),{\"a\" => 1, \"b\" => 1, \"c\" => 1, \"d\" => 1, \"g\" => 1})) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"r t g\"),{\"r\" => 1, \"t\" => 1, \"g\" => 1})) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"b b b b a\"),{\"b\" => 4})) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"r t g\"),{\"r\" => 1, \"t\" => 1, \"g\" => 1})) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),{})) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"a\"),{\"a\" => 1})) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "pl", - "prompt": "# pairs_sum_to_zero takes an array of integers as an input.\n# it returns 1 if there are two distinct elements in the array that\n# sum to zero, and '' otherwise.\n# >>> pairs_sum_to_zero([1, 3, 5, 0])\n# \"\"\n# >>> pairs_sum_to_zero([1, 3, -2, 1])\n# \"\"\n# >>> pairs_sum_to_zero([1, 2, 3, 7])\n# \"\"\n# >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7])\n# 1\n# >>> pairs_sum_to_zero([1])\n# \"\"\nsub pairs_sum_to_zero {\n my($l) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&pairs_sum_to_zero;\n if(eq_deeply($candidate->([1, 3, 5, 0]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, -2, 1]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 7]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, -5, 3, 5, 7]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-3, 9, -1, 3, 2, 30]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-3, 9, -1, 3, 2, 31]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-3, 9, -1, 4, 2, 30]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-3, 9, -1, 4, 2, 31]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "pl", - "prompt": "# Write a function that accepts two arrays of strings and returns the array that has \n# total number of chars in the all strings of the array less than the other array.\n# if the two arrays have the same number of chars, return the first array.\n# Examples\n# >>> total_match([], [])\n# []\n# >>> total_match([\"hi\", \"admin\"], [\"hI\", \"Hi\"])\n# [\"hI\", \"Hi\"]\n# >>> total_match([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"])\n# [\"hi\", \"admin\"]\n# >>> total_match([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"])\n# [\"hI\", \"hi\", \"hi\"]\n# >>> total_match([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"])\n# [\"4\"]\nsub total_match {\n my($lst1, $lst2) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&total_match;\n if(eq_deeply($candidate->([], []),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"hi\", \"admin\"], [\"hi\", \"hi\"]),[\"hi\", \"hi\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"]),[\"hi\", \"admin\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"]),[\"4\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"hi\", \"admin\"], [\"hI\", \"Hi\"]),[\"hI\", \"Hi\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"]),[\"hI\", \"hi\", \"hi\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hii\"]),[\"hi\", \"admin\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([], [\"this\"]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"this\"], []),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "pl", - "prompt": "# Circular shift the digits of the integer x, shift the digits right by shift\n# and return the result as a string.\n# If shift > number of digits, return digits reversed.\n# >>> circular_shift(12, 1)\n# \"21\"\n# >>> circular_shift(12, 2)\n# \"12\"\nsub circular_shift {\n my($x, $shift) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&circular_shift;\n if(eq_deeply($candidate->(100, 2),\"001\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12, 2),\"12\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(97, 8),\"79\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12, 1),\"21\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(11, 101),\"11\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "pl", - "prompt": "# Return 1 is array elements are monotonically increasing or decreasing.\n# >>> monotonic([1, 2, 4, 20])\n# 1\n# >>> monotonic([1, 20, 4, 10])\n# \"\"\n# >>> monotonic([4, 1, 0, -10])\n# 1\nsub monotonic {\n my($l) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&monotonic;\n if(eq_deeply($candidate->([1, 2, 4, 10]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 4, 20]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 20, 4, 10]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 1, 0, -10]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 1, 1, 0]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 2, 5, 60]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 5, 60]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([9, 9, 9, 9]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "pl", - "prompt": "# Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n# Example\n# >>> is_equal_to_sum_even(4)\n# \"\"\n# >>> is_equal_to_sum_even(6)\n# \"\"\n# >>> is_equal_to_sum_even(8)\n# 1\nsub is_equal_to_sum_even {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_equal_to_sum_even;\n if(eq_deeply($candidate->(4),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(11),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(13),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(16),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "pl", - "prompt": "# Input to this function is a string representing musical notes in a special ASCII format.\n# Your task is to parse this string and return array of integers corresponding to how many beats does each\n# not last.\n# Here is a legend:\n# 'o' - whole note, lasts four beats\n# 'o|' - half note, lasts two beats\n# '.|' - quater note, lasts one beat\n# >>> parse_music(\"o o| .| o| o| .| .| .| .| o o\")\n# [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\nsub parse_music {\n my($music_string) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&parse_music;\n if(eq_deeply($candidate->(\"\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"o o o o\"),[4, 4, 4, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\".| .| .| .|\"),[1, 1, 1, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"o| o| .| .| o o o o\"),[2, 2, 1, 1, 4, 4, 4, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"o| .| o| .| o o| o o|\"),[2, 1, 2, 1, 4, 2, 4, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "pl", - "prompt": "# \"\n# This function will take an array of integers. For all entries in the array, the function shall square the integer entry if its index is a \n# multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n# change the entries in the array whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n# Examples:\n# >>> lst\n# [1, 2, 3]\n# >>> lst\n# []\n# >>> lst\n# [-1, -5, 2, -1, -5]\nsub sum_squares {\n my($lst) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sum_squares;\n if(eq_deeply($candidate->([1, 2, 3]),6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 4, 9]),14)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 1, 1, 1, 1, 1, 1, 1, 1]),9)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -1, -1, -1, -1, -1, -1, -1, -1]),-3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -5, 2, -1, -5]),-126)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-56, -99, 1, 0, -2]),3030)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, 0, 0, 0, 0, 0, 0, 0, -1]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37]),-14196)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10]),-1448)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "pl", - "prompt": "# triples_sum_to_zero takes an array of integers as an input.\n# it returns 1 if there are three distinct elements in the array that\n# sum to zero, and '' otherwise.\n# >>> triples_sum_to_zero([1, 3, 5, 0])\n# \"\"\n# >>> triples_sum_to_zero([1, 3, -2, 1])\n# 1\n# >>> triples_sum_to_zero([1, 2, 3, 7])\n# \"\"\n# >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n# 1\n# >>> triples_sum_to_zero([1])\n# \"\"\nsub triples_sum_to_zero {\n my($l) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&triples_sum_to_zero;\n if(eq_deeply($candidate->([1, 3, 5, 0]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, 5, -1]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, -2, 1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 7]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 5, 7]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, -5, 3, 9, 7]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, 5, -100]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([100, 3, 5, -100]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "pl", - "prompt": "# brackets is a string of \"<\" and \">\".\n# return 1 if every opening bracket has a corresponding closing bracket.\n# >>> correct_bracketing(\"<\")\n# \"\"\n# >>> correct_bracketing(\"<>\")\n# 1\n# >>> correct_bracketing(\"<<><>>\")\n# 1\n# >>> correct_bracketing(\"><<>\")\n# \"\"\nsub correct_bracketing {\n my($brackets) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&correct_bracketing;\n if(eq_deeply($candidate->(\"<>\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<<><>>\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<><><<><>><>\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<><><<<><><>><>><<><><<>>>\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<<<><>>>>\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"><<>\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<<<<\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\">\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<<>\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<><><<><>><>><<>\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<><><<><>><>>><>\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "pl", - "prompt": "# Write a function that takes an array of numbers as input and returns \n# the number of elements in the array that are greater than 10 and both \n# first and last digits of a number are odd (1, 3, 5, 7, 9).\n# For example:\n# >>> specialFilter([15, -73, 14, -15])\n# 1\n# >>> specialFilter([33, -2, -3, 45, 21, 109])\n# 2\nsub specialFilter {\n my($nums) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&specialFilter;\n if(eq_deeply($candidate->([5, -2, 1, -5]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([15, -73, 14, -15]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([33, -2, -3, 45, 21, 109]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([43, -12, 93, 125, 121, 109]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([71, -2, -33, 75, 21, 19]),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "pl", - "prompt": "# Given a hash, return 1 if all keys are strings in lower \n# case or all keys are strings in upper case, else return ''.\n# The function should return '' is the given hash is empty.\n# Examples:\n# >>> check_dict_case({\"a\" => \"apple\", \"b\" => \"banana\"})\n# 1\n# >>> check_dict_case({\"a\" => \"apple\", \"A\" => \"banana\", \"B\" => \"banana\"})\n# \"\"\n# >>> check_dict_case({\"a\" => \"apple\", 8 => \"banana\", \"a\" => \"apple\"})\n# \"\"\n# >>> check_dict_case({\"Name\" => \"John\", \"Age\" => \"36\", \"City\" => \"Houston\"})\n# \"\"\n# >>> check_dict_case({\"STATE\" => \"NC\", \"ZIP\" => \"12345\"})\n# 1\nsub check_dict_case {\n my($dict) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&check_dict_case;\n if(eq_deeply($candidate->({\"p\" => \"pineapple\", \"b\" => \"banana\"}),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->({\"p\" => \"pineapple\", \"A\" => \"banana\", \"B\" => \"banana\"}),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->({\"p\" => \"pineapple\", \"5\" => \"banana\", \"a\" => \"apple\"}),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->({\"Name\" => \"John\", \"Age\" => \"36\", \"City\" => \"Houston\"}),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->({\"STATE\" => \"NC\", \"ZIP\" => \"12345\"}),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->({\"fruit\" => \"Orange\", \"taste\" => \"Sweet\"}),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->({}),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "pl", - "prompt": "# Given a string of words, return an array of words split on whitespace, if no whitespaces exists in the text you\n# should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n# alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n# Examples\n# >>> split_words(\"Hello world!\")\n# [\"Hello\", \"world!\"]\n# >>> split_words(\"Hello,world!\")\n# [\"Hello\", \"world!\"]\n# >>> split_words(\"abcdef\")\n# 3\nsub split_words {\n my($txt) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&split_words;\n if(eq_deeply($candidate->(\"Hello world!\"),[\"Hello\", \"world!\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hello,world!\"),[\"Hello\", \"world!\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hello world,!\"),[\"Hello\", \"world,!\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hello,Hello,world !\"),[\"Hello,Hello,world\", \"!\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdef\"),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aaabb\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aaaBb\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "pl", - "prompt": "# The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fibfib(0) == 0\n# fibfib(1) == 0\n# fibfib(2) == 1\n# fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n# Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n# >>> fibfib(1)\n# 0\n# >>> fibfib(5)\n# 4\n# >>> fibfib(8)\n# 24\nsub fibfib {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&fibfib;\n if(eq_deeply($candidate->(2),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),24)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),81)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12),274)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(14),927)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "pl", - "prompt": "# You are given an array of numbers.\n# You need to return the sum of squared numbers in the given array,\n# round each element in the array to the upper int(Ceiling) first.\n# Examples:\n# >>> lst([1.0, 2.0, 3.0])\n# 14\n# >>> lst([1.0, 4.0, 9.0])\n# 98\n# >>> lst([1.0, 3.0, 5.0, 7.0])\n# 84\n# >>> lst([1.4, 4.2, 0.0])\n# 29\n# >>> lst([-2.4, 1.0, 1.0])\n# 6\nsub sum_squares {\n my($lst) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sum_squares;\n if(eq_deeply($candidate->([1.0, 2.0, 3.0]),14)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.0]),14)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 3.0, 5.0, 7.0]),84)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.4, 4.2, 0.0]),29)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-2.4, 1.0, 1.0]),6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([100.0, 1.0, 15.0, 2.0]),10230)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([10000.0, 10000.0]),200000000)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1.4, 4.6, 6.3]),75)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1.4, 17.9, 18.9, 19.9]),1086)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0.0]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1.0]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1.0, 1.0, 0.0]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_85_add", - "language": "pl", - "prompt": "# Given a non-empty array of integers lst. add the even elements that are at odd indices..\n# Examples:\n# >>> add([4, 2, 6, 7])\n# 2\nsub add {\n my($lst) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&add;\n if(eq_deeply($candidate->([4, 88]),88)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 5, 6, 7, 2, 122]),122)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 0, 6, 7]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 4, 6, 8]),12)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "pl", - "prompt": "# Return sorted unique elements in an array\n# >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123])\n# [0, 2, 3, 5, 9, 123]\nsub unique {\n my($l) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&unique;\n if(eq_deeply($candidate->([5, 3, 5, 2, 3, 3, 9, 0, 123]),[0, 2, 3, 5, 9, 123])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "pl", - "prompt": "# Given a string text, replace all spaces in it with underscores, \n# and if a string has more than 2 consecutive spaces, \n# then replace all consecutive spaces with - \n# >>> fix_spaces(\" Example\")\n# \"Example\"\n# >>> fix_spaces(\" Example 1\")\n# \"Example_1\"\n# >>> fix_spaces(\" Example 2\")\n# \"_Example_2\"\n# >>> fix_spaces(\" Example 3\")\n# \"_Example-3\"\nsub fix_spaces {\n my($text) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&fix_spaces;\n if(eq_deeply($candidate->(\"Example\"),\"Example\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Mudasir Hanif \"),\"Mudasir_Hanif_\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Yellow Yellow Dirty Fellow\"),\"Yellow_Yellow__Dirty__Fellow\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Exa mple\"),\"Exa-mple\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\" Exa 1 2 2 mple\"),\"-Exa_1_2_2_mple\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "pl", - "prompt": "# Return 2^n modulo p (be aware of numerics).\n# >>> modp(3, 5)\n# 3\n# >>> modp(1101, 101)\n# 2\n# >>> modp(0, 101)\n# 1\n# >>> modp(3, 11)\n# 8\n# >>> modp(100, 101)\n# 1\nsub modp {\n my($n, $p) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&modp;\n if(eq_deeply($candidate->(3, 5),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1101, 101),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(0, 101),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3, 11),8)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(100, 101),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(30, 5),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(31, 5),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "pl", - "prompt": "# You have to write a function which validates a given date string and\n# returns 1 if the date is valid otherwise ''.\n# The date is valid if all of the following rules are satisfied:\n# 1. The date string is not empty.\n# 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n# 3. The months should not be less than 1 or higher than 12.\n# 4. The date should be in the format: mm-dd-yyyy\n# >>> valid_date(\"03-11-2000\")\n# 1\n# >>> valid_date(\"15-01-2012\")\n# \"\"\n# >>> valid_date(\"04-0-2040\")\n# \"\"\n# >>> valid_date(\"06-04-2020\")\n# 1\n# >>> valid_date(\"06/04/2020\")\n# \"\"\nsub valid_date {\n my($date) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&valid_date;\n if(eq_deeply($candidate->(\"03-11-2000\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"15-01-2012\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"04-0-2040\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"06-04-2020\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"01-01-2007\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"03-32-2011\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"04-31-3000\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"06-06-2005\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"21-31-2000\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"04-12-2003\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"04122003\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"20030412\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2003-04\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2003-04-12\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"04-2003\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "pl", - "prompt": "# Write a function that takes a string and returns an ordered version of it.\n# Ordered version of string, is a string where all words (separated by space)\n# are replaced by a new word where all the characters arranged in\n# ascending order based on ascii value.\n# Note: You should keep the order of words and blank spaces in the sentence.\n# For example:\n# >>> anti_shuffle(\"Hi\")\n# \"Hi\"\n# >>> anti_shuffle(\"hello\")\n# \"ehllo\"\n# >>> anti_shuffle(\"Hello World!!!\")\n# \"Hello !!!Wdlor\"\nsub anti_shuffle {\n my($s) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&anti_shuffle;\n if(eq_deeply($candidate->(\"Hi\"),\"Hi\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"hello\"),\"ehllo\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"number\"),\"bemnru\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcd\"),\"abcd\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hello World!!!\"),\"Hello !!!Wdlor\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hi. My name is Mister Robot. How are you?\"),\".Hi My aemn is Meirst .Rboot How aer ?ouy\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "pl", - "prompt": "# Given an array of numbers, return whether or not they are sorted\n# in ascending order. If array has more than 1 duplicate of the same\n# number, return ''. Assume no negative numbers and only integers.\n# Examples\n# >>> is_sorted([5])\n# 1\n# >>> is_sorted([1, 2, 3, 4, 5])\n# 1\n# >>> is_sorted([1, 3, 2, 4, 5])\n# \"\"\n# >>> is_sorted([1, 2, 3, 4, 5, 6])\n# 1\n# >>> is_sorted([1, 2, 3, 4, 5, 6, 7])\n# 1\n# >>> is_sorted([1, 3, 2, 4, 5, 6, 7])\n# \"\"\n# >>> is_sorted([1, 2, 2, 3, 3, 4])\n# 1\n# >>> is_sorted([1, 2, 2, 2, 3, 4])\n# \"\"\nsub is_sorted {\n my($lst) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_sorted;\n if(eq_deeply($candidate->([5]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 5]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, 2, 4, 5]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 5, 6]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 5, 6, 7]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, 2, 4, 5, 6, 7]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 1]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 2, 2, 3, 4]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 3, 3, 4]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 2, 3, 3, 4]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "pl", - "prompt": "# You are given a string s.\n# Your task is to check if the string is happl or not.\n# A string is happl if its length is at least 3 and every 3 consecutive letters are distinct\n# For example:\n# >>> is_happy(\"a\")\n# \"\"\n# >>> is_happy(\"aa\")\n# \"\"\n# >>> is_happy(\"abcd\")\n# 1\n# >>> is_happy(\"aabb\")\n# \"\"\n# >>> is_happy(\"adb\")\n# 1\n# >>> is_happy(\"xyy\")\n# \"\"\nsub is_happy {\n my($s) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_happy;\n if(eq_deeply($candidate->(\"a\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aa\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcd\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aabb\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"adb\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"xyy\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"iopaxpoi\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"iopaxioi\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "pl", - "prompt": "# Write a function that returns 1 if the object q will fly, and '' otherwise.\n# The object q will fly if it's balanced (it is a palindromic array) and the sum of its elements is less than or equal the maximum possible weight w.\n# Example:\n# >>> will_it_fly([1, 2], 5)\n# \"\"\n# # 1+2 is less than the maximum possible weight, but it's unbalanced.\n# >>> will_it_fly([3, 2, 3], 1)\n# \"\"\n# # it's balanced, but 3+2+3 is more than the maximum possible weight.\n# >>> will_it_fly([3, 2, 3], 9)\n# 1\n# # 3+2+3 is less than the maximum possible weight, and it's balanced.\n# >>> will_it_fly([3], 5)\n# 1\n# # 3 is less than the maximum possible weight, and it's balanced.\nsub will_it_fly {\n my($q, $w) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&will_it_fly;\n if(eq_deeply($candidate->([3, 2, 3], 9),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2], 5),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3], 5),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 3], 1),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3], 6),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5], 5),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "pl", - "prompt": "# Given an array of non-negative integers, return a copl of the given array after sorting,\n# you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n# or sort it in descending order if the sum( first index value, last index value) is even.\n# Note:\n# * don't change the given array.\n# Examples:\n# >>> sort_array([])\n# []\n# >>> sort_array([5])\n# [5]\n# >>> sort_array([2, 4, 3, 0, 1, 5])\n# [0, 1, 2, 3, 4, 5]\n# >>> sort_array([2, 4, 3, 0, 1, 5, 6])\n# [6, 5, 4, 3, 2, 1, 0]\nsub sort_array {\n my($array) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sort_array;\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5]),[5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, 3, 0, 1, 5]),[0, 1, 2, 3, 4, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, 3, 0, 1, 5, 6]),[6, 5, 4, 3, 2, 1, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 1]),[1, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([15, 42, 87, 32, 11, 0]),[0, 11, 15, 32, 42, 87])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([21, 14, 23, 11]),[23, 21, 14, 11])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "pl", - "prompt": "# Implement a function that takes an non-negative integer and returns an array of the first n\n# integers that are prime numbers and less than n.\n# for example:\n# >>> count_up_to(5)\n# [2, 3]\n# >>> count_up_to(11)\n# [2, 3, 5, 7]\n# >>> count_up_to(0)\n# []\n# >>> count_up_to(20)\n# [2, 3, 5, 7, 11, 13, 17, 19]\n# >>> count_up_to(1)\n# []\n# >>> count_up_to(18)\n# [2, 3, 5, 7, 11, 13, 17]\nsub count_up_to {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&count_up_to;\n if(eq_deeply($candidate->(5),[2, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6),[2, 3, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7),[2, 3, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),[2, 3, 5, 7])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(0),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(22),[2, 3, 5, 7, 11, 13, 17, 19])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(18),[2, 3, 5, 7, 11, 13, 17])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(47),[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(101),[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "pl", - "prompt": "# Out of array of strings, return the longest one. Return the first one in case of multiple\n# strings of the same length. Return undef in case the input array is empty.\n# >>> longest([])\n# undef\n# >>> longest([\"a\", \"b\", \"c\"])\n# \"a\"\n# >>> longest([\"a\", \"bb\", \"ccc\"])\n# \"ccc\"\nsub longest {\n my($strings) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&longest;\n if(eq_deeply($candidate->([]),undef)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"x\", \"y\", \"z\"]),\"x\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"]),\"zzzz\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "pl", - "prompt": "# Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n# reverse the resulting array, and then replace each digit by its corresponding name from\n# \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n# For example:\n# >>> by_length([2, 1, 1, 4, 5, 8, 2, 3])\n# [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n# If the array is empty, return an empty array:\n# >>> by_length([])\n# []\n# If the array has any strange number ignore it:\n# >>> by_length([1, -1, 55])\n# [\"One\"]\nsub by_length {\n my($arr) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&by_length;\n if(eq_deeply($candidate->([2, 1, 1, 4, 5, 8, 2, 3]),[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, -1, 55]),[\"One\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, -1, 3, 2]),[\"Three\", \"Two\", \"One\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([9, 4, 8]),[\"Nine\", \"Eight\", \"Four\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_106_f", - "language": "pl", - "prompt": "# Implement the function f that takes n as a parameter,\n# and returns an array of size n, such that the value of the element at index i is the factorial of i if i is even\n# or the sum of numbers from 1 to i otherwise.\n# i starts from 1.\n# the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n# Example:\n# >>> f(5)\n# [1, 2, 6, 24, 15]\nsub f {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&f;\n if(eq_deeply($candidate->(5),[1, 2, 6, 24, 15])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7),[1, 2, 6, 24, 15, 720, 28])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),[1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3),[1, 2, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "pl", - "prompt": "# Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n# >>> fizz_buzz(50)\n# 0\n# >>> fizz_buzz(78)\n# 2\n# >>> fizz_buzz(79)\n# 3\nsub fizz_buzz {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&fizz_buzz;\n if(eq_deeply($candidate->(50),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(78),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(79),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(100),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(200),6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4000),192)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10000),639)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(100000),8026)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "pl", - "prompt": "# Given a positive floating point number, it can be decomposed into\n# and integer part (largest integer smaller than given number) and decimals\n# (leftover part always smaller than 1).\n# Return the decimal part of the number.\n# >>> truncate_number(3.5)\n# 0.5\nsub truncate_number {\n my($number) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&truncate_number;\n if(eq_deeply($candidate->(3.5),0.5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1.25),0.25)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(123.0),0.0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "pl", - "prompt": "# For a given array of integers, return an array consisting of a sum and a product of all the integers in an array.\n# Empty sum should be equal to 0 and empty product should be equal to 1.\n# >>> sum_product([])\n# [0, 1]\n# >>> sum_product([1, 2, 3, 4])\n# [10, 24]\nsub sum_product {\n my($numbers) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sum_product;\n if(eq_deeply($candidate->([]),[0, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 1, 1]),[3, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([100, 0]),[100, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 5, 7]),[15, 105])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([10]),[10, 10])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "pl", - "prompt": "# You are given a 2 dimensional data, as a nested arrays,\n# which is similar to matrix, however, unlike matrices,\n# each row may contain a different number of columns.\n# Given lst, and integer x, find integers x in the array,\n# and return array of arrays, [(x1, y1), (x2, y2) ...] such that\n# each array is a coordinate - (row, columns), starting with 0.\n# Sort coordinates initially by rows in ascending order.\n# Also, sort coordinates of the row by columns in descending order.\n# Examples:\n# >>> get_row([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1)\n# [[0, 0], [1, 4], [1, 0], [2, 5], [2, 0]]\n# >>> get_row([], 1)\n# []\n# >>> get_row([[], [1], [1, 2, 3]], 3)\n# [[2, 2]]\nsub get_row {\n my($lst, $x) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&get_row;\n if(eq_deeply($candidate->([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1),[[0, 0], [1, 4], [1, 0], [2, 5], [2, 0]])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6]], 2),[[0, 1], [1, 1], [2, 1], [3, 1], [4, 1], [5, 1]])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 1, 3, 4, 5, 6], [1, 2, 1, 4, 5, 6], [1, 2, 3, 1, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1),[[0, 0], [1, 0], [2, 1], [2, 0], [3, 2], [3, 0], [4, 3], [4, 0], [5, 4], [5, 0], [6, 5], [6, 0]])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([], 1),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1]], 2),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[], [1], [1, 2, 3]], 3),[[2, 2]])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "pl", - "prompt": "# You're a hungry rabbit, and you already have eaten a certain number of carrots,\n# but now you need to eat more carrots to complete the day's meals.\n# you should return an array of [ total number of eaten carrots after your meals,\n# the number of carrots left after your meals ]\n# if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n# Example:\n# >>> eat(5, 6, 10)\n# [11, 4]\n# >>> eat(4, 8, 9)\n# [12, 1]\n# >>> eat(1, 10, 10)\n# [11, 0]\n# >>> eat(2, 11, 5)\n# [7, 0]\n# Variables:\n# @number : integer\n# the number of carrots that you have eaten.\n# @need : integer\n# the number of carrots that you need to eat.\n# @remaining : integer\n# the number of remaining carrots thet exist in stock\n# Constrain:\n# * 0 <= number <= 1000\n# * 0 <= need <= 1000\n# * 0 <= remaining <= 1000\n# Have fun :)\nsub eat {\n my($number, $need, $remaining) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&eat;\n if(eq_deeply($candidate->(5, 6, 10),[11, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4, 8, 9),[12, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 10, 10),[11, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 11, 5),[7, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4, 5, 7),[9, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4, 5, 1),[5, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "pl", - "prompt": "# Given a positive integer N, return the total sum of its digits in binary.\n# Example\n# >>> solve(1000)\n# \"1\"\n# >>> solve(150)\n# \"110\"\n# >>> solve(147)\n# \"1100\"\n# Variables:\n# @N integer\n# Constraints: 0 \u2264 N \u2264 10000.\n# Output:\n# a string of binary number\nsub solve {\n my($N) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&solve;\n if(eq_deeply($candidate->(1000),\"1\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(150),\"110\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(147),\"1100\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(333),\"1001\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(963),\"10010\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "pl", - "prompt": "# You are given an array of integers.\n# You need to find the largest prime value and return the sum of its digits.\n# Examples:\n# >>> skjkasdkd([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3])\n# 10\n# >>> skjkasdkd([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1])\n# 25\n# >>> skjkasdkd([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3])\n# 13\n# >>> skjkasdkd([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6])\n# 11\n# >>> skjkasdkd([0, 81, 12, 3, 1, 21])\n# 3\n# >>> skjkasdkd([0, 8, 1, 2, 1, 7])\n# 7\nsub skjkasdkd {\n my($lst) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&skjkasdkd;\n if(eq_deeply($candidate->([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]),10)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]),25)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]),13)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]),11)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 81, 12, 3, 1, 21]),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 8, 1, 2, 1, 7]),7)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([8191]),19)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([8191, 123456, 127, 7]),19)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([127, 97, 8192]),10)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "pl", - "prompt": "# Given an array arr of integers, find the minimum number of elements that\n# need to be changed to make the array palindromic. A palindromic array is an array that\n# is read the same backwards and forwards. In one change, you can change one element to any other element.\n# For example:\n# >>> smallest_change([1, 2, 3, 5, 4, 7, 9, 6])\n# 4\n# >>> smallest_change([1, 2, 3, 4, 3, 2, 2])\n# 1\n# >>> smallest_change([1, 2, 3, 2, 1])\n# 0\nsub smallest_change {\n my($arr) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&smallest_change;\n if(eq_deeply($candidate->([1, 2, 3, 5, 4, 7, 9, 6]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 3, 2, 2]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 4, 2]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 4, 4, 2]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 2, 1]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 1, 1, 3]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "pl", - "prompt": "# It is the last week of the semester and the teacher has to give the grades\n# to students. The teacher has been making her own algorithm for grading.\n# The only problem is, she has lost the code she used for grading.\n# She has given you an array of GPAs for some students and you have to write \n# a function that can output an array of letter grades using the following table:\n# GPA | Letter grade\n# 4.0 A+\n# > 3.7 A \n# > 3.3 A- \n# > 3.0 B+\n# > 2.7 B \n# > 2.3 B-\n# > 2.0 C+\n# > 1.7 C\n# > 1.3 C-\n# > 1.0 D+ \n# > 0.7 D \n# > 0.0 D-\n# 0.0 E\n# Example:\n# >>> grade_equation([4.0, 3, 1.7, 2, 3.5])\n# [\"A+\", \"B\", \"C-\", \"C\", \"A-\"]\nsub numerical_letter_grade {\n my($grades) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&numerical_letter_grade;\n if(eq_deeply($candidate->([4.0, 3, 1.7, 2, 3.5]),[\"A+\", \"B\", \"C-\", \"C\", \"A-\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.2]),[\"D+\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0.5]),[\"D-\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0.0]),[\"E\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 0.3, 1.5, 2.8, 3.3]),[\"D\", \"D-\", \"C-\", \"B\", \"B+\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0.0, 0.7]),[\"E\", \"D-\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "pl", - "prompt": "# Given the lengths of the three sides of a triangle. Return the area of\n# the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n# Otherwise return -1\n# Three sides make a valid triangle when the sum of any two sides is greater \n# than the third side.\n# Example:\n# >>> triangle_area(3, 4, 5)\n# 6.0\n# >>> triangle_area(1, 2, 10)\n# -1\nsub triangle_area {\n my($a, $b, $c) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&triangle_area;\n if(eq_deeply($candidate->(3, 4, 5),6.0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 2, 10),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4, 8, 5),8.18)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 2, 2),1.73)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 2, 3),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10, 5, 7),16.25)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 6, 3),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 1, 1),0.43)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 2, 10),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "pl", - "prompt": "# Check if two words have the same characters.\n# >>> same_chars(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\")\n# 1\n# >>> same_chars(\"abcd\", \"dddddddabc\")\n# 1\n# >>> same_chars(\"dddddddabc\", \"abcd\")\n# 1\n# >>> same_chars(\"eabcd\", \"dddddddabc\")\n# \"\"\n# >>> same_chars(\"abcd\", \"dddddddabce\")\n# \"\"\n# >>> same_chars(\"eabcdzzzz\", \"dddzzzzzzzddddabc\")\n# \"\"\nsub same_chars {\n my($s0, $s1) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&same_chars;\n if(eq_deeply($candidate->(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcd\", \"dddddddabc\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"dddddddabc\", \"abcd\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"eabcd\", \"dddddddabc\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcd\", \"dddddddabcf\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"eabcdzzzz\", \"dddzzzzzzzddddabc\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aabb\", \"aaccc\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "pl", - "prompt": "# Given an array of integers nums, find the minimum sum of any non-empty sub-array\n# of nums.\n# Example\n# >>> minSubArraySum([2, 3, 4, 1, 2, 4])\n# 1\n# >>> minSubArraySum([-1, -2, -3])\n# -6\nsub minSubArraySum {\n my($nums) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&minSubArraySum;\n if(eq_deeply($candidate->([2, 3, 4, 1, 2, 4]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -2, -3]),-6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -2, -3, 2, -10]),-14)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-9999999999999999]),-9999999999999999)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 10, 20, 1000000]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -2, -3, 10, -5]),-6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([100, -1, -2, -3, 10, -5]),-6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([10, 11, 13, 8, 3, 4]),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([100, -33, 32, -1, 0, -2]),-33)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-10]),-10)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([7]),7)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, -1]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "pl", - "prompt": "# Given a string s and a natural number n, you have been tasked to implement \n# a function that returns an array of all words from string s that contain exactly \n# n consonants, in order these words appear in the string s.\n# If the string s is empty then the function should return an empty array.\n# Note: you may assume the input string contains only letters and spaces.\n# Examples:\n# >>> select_words(\"Mary had a little lamb\", 4)\n# [\"little\"]\n# >>> select_words(\"Mary had a little lamb\", 3)\n# [\"Mary\", \"lamb\"]\n# >>> select_words(\"simple white space\", 2)\n# []\n# >>> select_words(\"Hello world\", 4)\n# [\"world\"]\n# >>> select_words(\"Uncle sam\", 3)\n# [\"Uncle\"]\nsub select_words {\n my($s, $n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&select_words;\n if(eq_deeply($candidate->(\"Mary had a little lamb\", 4),[\"little\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Mary had a little lamb\", 3),[\"Mary\", \"lamb\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"simple white space\", 2),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hello world\", 4),[\"world\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Uncle sam\", 3),[\"Uncle\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\", 4),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"a b c d e f\", 1),[\"b\", \"c\", \"d\", \"f\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "pl", - "prompt": "# Return array of all prefixes from shortest to longest of the input string\n# >>> all_prefixes(\"abc\")\n# [\"a\", \"ab\", \"abc\"]\nsub all_prefixes {\n my($string) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&all_prefixes;\n if(eq_deeply($candidate->(\"\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"asdfgh\"),[\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"WWW\"),[\"W\", \"WW\", \"WWW\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "pl", - "prompt": "# Create a function that takes a value (string) representing a number\n# and returns the closest integer to it. If the number is equidistant\n# from two integers, round it away from zero.\n# Examples\n# >>> closest_integer(\"10\")\n# 10\n# >>> closest_integer(\"15.3\")\n# 15\n# Note:\n# Rounding away from zero means that if the given number is equidistant\n# from two integers, the one you should return is the one that is the\n# farthest from zero. For example closest_integer(\"14.5\") should\n# return 15 and closest_integer(\"-14.5\") should return -15.\nsub closest_integer {\n my($value) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&closest_integer;\n if(eq_deeply($candidate->(\"10\"),10)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"14.5\"),15)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"-15.5\"),-16)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"15.3\"),15)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"0\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "pl", - "prompt": "# Create a function which takes a string representing a file's name, and returns\n# 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n# A file's name is considered to be valid if and only if all the following conditions \n# are met:\n# - There should not be more than three digits ('0'-'9') in the file's name.\n# - The file's name contains exactly one dot '.'\n# - The substring before the dot should not be empty, and it starts with a letter from \n# the latin alphapet ('a'-'z' and 'A'-'Z').\n# - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n# Examples:\n# >>> file_name_check(\"example.txt\")\n# \"Yes\"\n# >>> file_name_check(\"1example.dll\")\n# \"No\"\nsub file_name_check {\n my($file_name) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&file_name_check;\n if(eq_deeply($candidate->(\"example.txt\"),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1example.dll\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"s1sdf3.asd\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"K.dll\"),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"MY16FILE3.exe\"),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"His12FILE94.exe\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"_Y.txt\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"?aREYA.exe\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"/this_is_valid.dll\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"this_is_valid.wow\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"this_is_valid.txt\"),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"this_is_valid.txtexe\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"#this2_i4s_5valid.ten\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"@this1_is6_valid.exe\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"this_is_12valid.6exe4.txt\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"all.exe.txt\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"I563_No.exe\"),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Is3youfault.txt\"),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"no_one#knows.dll\"),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1I563_Yes3.exe\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"I563_Yes3.txtt\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"final..txt\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"final132\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"_f4indsartal132.\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\".txt\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"s.\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "pl", - "prompt": "# You are given two intervals,\n# where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n# The given intervals are closed which means that the interval (start, end)\n# includes both start and end.\n# For each given interval, it is assumed that its start is less or equal its end.\n# Your task is to determine whether the length of intersection of these two \n# intervals is a prime number.\n# Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n# which its length is 1, which not a prime number.\n# If the length of the intersection is a prime number, return \"YES\",\n# otherwise, return \"NO\".\n# If the two intervals don't intersect, return \"NO\".\n# [input/output] samples:\n# >>> intersection([1, 2], [2, 3])\n# \"NO\"\n# >>> intersection([-1, 1], [0, 4])\n# \"NO\"\n# >>> intersection([-3, -1], [-5, 5])\n# \"YES\"\nsub intersection {\n my($interval1, $interval2) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&intersection;\n if(eq_deeply($candidate->([1, 2], [2, 3]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, 1], [0, 4]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-3, -1], [-5, 5]),\"YES\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-2, 2], [-4, 0]),\"YES\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-11, 2], [-1, -1]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2], [3, 5]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2], [1, 2]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-2, -2], [-3, -2]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "pl", - "prompt": "# Return the largest prime factor of n. Assume n > 1 and is not a prime.\n# >>> largest_prime_factor(13195)\n# 29\n# >>> largest_prime_factor(2048)\n# 2\nsub largest_prime_factor {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&largest_prime_factor;\n if(eq_deeply($candidate->(15),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(27),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(63),7)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(330),11)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(13195),29)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "pl", - "prompt": "# Given a string, find out how many distinct characters (regardless of case) does it consist of\n# >>> count_distinct_characters(\"xyzXYZ\")\n# 3\n# >>> count_distinct_characters(\"Jerry\")\n# 4\nsub count_distinct_characters {\n my($string) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&count_distinct_characters;\n if(eq_deeply($candidate->(\"\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcde\"),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdecadeCADE\"),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aaaaAAAAaaaa\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Jerry jERRY JeRRRY\"),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "pl", - "prompt": "# You're given an array of deposit and withdrawal operations on a bank account that starts with\n# zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n# at that point function should return 1. Otherwise it should return ''.\n# >>> below_zero([1, 2, 3])\n# \"\"\n# >>> below_zero([1, 2, -4, 5])\n# 1\nsub below_zero {\n my($operations) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&below_zero;\n if(eq_deeply($candidate->([]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, -3, 1, 2, -3]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, -4, 5, 6]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, -1, 2, -2, 5, -5, 4, -4]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, -1, 2, -2, 5, -5, 4, -5]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, -2, 2, -2, 5, -5, 4, -4]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "pl", - "prompt": "# Find the shortest palindrome that begins with a supplied string.\n# Algorithm idea is simple:\n# - Find the longest postfix of supplied string that is a palindrome.\n# - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n# >>> make_palindrome(\"\")\n# \"\"\n# >>> make_palindrome(\"cat\")\n# \"catac\"\n# >>> make_palindrome(\"cata\")\n# \"catac\"\nsub make_palindrome {\n my($string) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&make_palindrome;\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"x\"),\"x\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"xyz\"),\"xyzyx\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"xyx\"),\"xyx\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"jerry\"),\"jerryrrej\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "pl", - "prompt": "# Given a positive integer, obtain its roman numeral equivalent as a string,\n# and return it in lowercase.\n# Restrictions: 1 <= num <= 1000\n# Examples:\n# >>> int_to_mini_roman(19)\n# \"xix\"\n# >>> int_to_mini_roman(152)\n# \"clii\"\n# >>> int_to_mini_roman(426)\n# \"cdxxvi\"\nsub int_to_mini_roman {\n my($number) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "reworded", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&int_to_mini_roman;\n if(eq_deeply($candidate->(19),\"xix\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(152),\"clii\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(251),\"ccli\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(426),\"cdxxvi\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(500),\"d\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),\"i\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4),\"iv\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(43),\"xliii\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(90),\"xc\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(94),\"xciv\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(532),\"dxxxii\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(900),\"cm\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(994),\"cmxciv\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1000),\"m\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - } -] \ No newline at end of file diff --git a/data/pl-transform.json b/data/pl-transform.json deleted file mode 100644 index 2e637f780941fdf123710f53ba2aeea10a89951f..0000000000000000000000000000000000000000 --- a/data/pl-transform.json +++ /dev/null @@ -1,2256 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "pl", - "prompt": "# For a given number n, find the largest number that divides n evenly, smaller than n\n# >>> largest_divisor(15)\n# 5\nsub largest_divisor {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&largest_divisor;\n if(eq_deeply($candidate->(3),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(100),50)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(49),7)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_47_median", - "language": "pl", - "prompt": "# Return median of elements in the list l.\n# >>> median([3, 1, 2, 4, 5])\n# 3\n# >>> median([-10, 4, 6, 1000, 10, 20])\n# 15.0\nsub median {\n my($l) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&median;\n if(eq_deeply($candidate->([3, 1, 2, 4, 5]),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-10, 4, 6, 1000, 10, 20]),8.0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5]),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([6, 5]),5.5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([8, 1, 3, 9, 9, 2, 7]),7)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "pl", - "prompt": "# Given two lists operator, and operand. The first list has basic algebra operations, and \n# the second list is a list of integers. Use the two given lists to build the algebric \n# expression and return the evaluation of this expression.\n# The basic algebra operations:\n# Addition ( + ) \n# Subtraction ( - ) \n# Multiplication ( * ) \n# Floor division ( // ) \n# Exponentiation ( ** ) \n# Example:\n# operator['+', '*', '-']\n# array = [2, 3, 4, 5]\n# result = 2 + 3 * 4 - 5\n# => result = 9\n# Note:\n# The length of operator list is equal to the length of operand list minus one.\n# Operand is a list of of non-negative integers.\n# Operator list has at least one operator, and operand list has at least two operands.\nsub do_algebra {\n my($operator, $operand) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&do_algebra;\n if(eq_deeply($candidate->([\"**\", \"*\", \"+\"], [2, 3, 4, 5]),37)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"+\", \"*\", \"-\"], [2, 3, 4, 5]),9)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"//\", \"*\"], [7, 3, 4]),8)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "pl", - "prompt": "# Return maximum element in the list.\n# >>> max_element([1, 2, 3])\n# 3\n# >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n# 123\nsub max_element {\n my($l) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&max_element;\n if(eq_deeply($candidate->([1, 2, 3]),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]),124)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "pl", - "prompt": "# Create a function which returns the largest index of an element which\n# is not greater than or equal to the element immediately preceding it. If\n# no such element exists then return -1. The given array will not contain\n# duplicate values.\n# Examples:\n# >>> can_arrange([1, 2, 4, 3, 5])\n# 3\n# >>> can_arrange([1, 2, 3])\n# -1\nsub can_arrange {\n my($arr) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&can_arrange;\n if(eq_deeply($candidate->([1, 2, 4, 3, 5]),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 4, 5]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 4, 2, 5, 6, 7, 8, 9, 10]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 8, 5, 7, 3]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "pl", - "prompt": "# Imagine a road that's a perfectly straight infinitely long line.\n# n cars are driving left to right; simultaneously, a different set of n cars\n# are driving right to left. The two sets of cars start out being very far from\n# each other. All cars move in the same speed. Two cars are said to collide\n# when a car that's moving left to right hits a car that's moving right to left.\n# However, the cars are infinitely sturdy and strong; as a result, they continue moving\n# in their trajectory as if they did not collide.\n# This function outputs the number of such collisions.\nsub car_race_collision {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&car_race_collision;\n if(eq_deeply($candidate->(2),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3),9)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4),16)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),64)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),100)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "pl", - "prompt": "# Create a function that returns True if the last character\n# of a given string is an alphabetical character and is not\n# a part of a word, and False otherwise.\n# Note: \"word\" is a group of characters separated by space.\n# Examples:\n# >>> check_if_last_char_is_a_letter(\"apple pie\")\n# \"\"\n# >>> check_if_last_char_is_a_letter(\"apple pi e\")\n# 1\n# >>> check_if_last_char_is_a_letter(\"apple pi e \")\n# \"\"\n# >>> check_if_last_char_is_a_letter(\"\")\n# \"\"\nsub check_if_last_char_is_a_letter {\n my($txt) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&check_if_last_char_is_a_letter;\n if(eq_deeply($candidate->(\"apple\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"apple pi e\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"eeeee\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"A\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Pumpkin pie \"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Pumpkin pie 1\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"eeeee e \"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"apple pie\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"apple pi e \"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "pl", - "prompt": "# Return true if a given number is prime, and false otherwise.\n# >>> is_prime(6)\n# \"\"\n# >>> is_prime(101)\n# 1\n# >>> is_prime(11)\n# 1\n# >>> is_prime(13441)\n# 1\n# >>> is_prime(61)\n# 1\n# >>> is_prime(4)\n# \"\"\n# >>> is_prime(1)\n# \"\"\nsub is_prime {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_prime;\n if(eq_deeply($candidate->(6),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(101),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(11),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(13441),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(61),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(11),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(17),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(85),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(77),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(255379),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "pl", - "prompt": "# Given a list of positive integers x. return a sorted list of all \n# elements that hasn't any even digit.\n# Note: Returned list should be sorted in increasing order.\n# For example:\n# >>> unique_digits([15, 33, 1422, 1])\n# [1, 15, 33]\n# >>> unique_digits([152, 323, 1422, 10])\n# []\nsub unique_digits {\n my($x) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&unique_digits;\n if(eq_deeply($candidate->([15, 33, 1422, 1]),[1, 15, 33])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([152, 323, 1422, 10]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([12345, 2033, 111, 151]),[111, 151])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([135, 103, 31]),[31, 135])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "pl", - "prompt": "# Input are two strings a and b consisting only of 1s and 0s.\n# Perform binary XOR on these inputs and return result also as a string.\n# >>> string_xor(\"010\", \"110\")\n# \"100\"\nsub string_xor {\n my($a, $b) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&string_xor;\n if(eq_deeply($candidate->(\"111000\", \"101010\"),\"010010\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1\", \"1\"),\"0\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"0101\", \"0000\"),\"0101\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "pl", - "prompt": "# sum_to_n is a function that sums numbers from 1 to n.\n# >>> sum_to_n(30)\n# 465\n# >>> sum_to_n(100)\n# 5050\n# >>> sum_to_n(5)\n# 15\n# >>> sum_to_n(10)\n# 55\n# >>> sum_to_n(1)\n# 1\nsub sum_to_n {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sum_to_n;\n if(eq_deeply($candidate->(1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6),21)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(11),66)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(30),465)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(100),5050)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "pl", - "prompt": "# Given a list of numbers, return the sum of squares of the numbers\n# in the list that are odd. Ignore numbers that are negative or not integers.\n# >>> double_the_difference([1, 3, 2, 0])\n# 10\n# >>> double_the_difference([-1, -2, 0])\n# 0\n# >>> double_the_difference([9, -2])\n# 81\n# >>> double_the_difference([0])\n# 0\n# If the input list is empty, return 0.\nsub double_the_difference {\n my($lst) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&double_the_difference;\n if(eq_deeply($candidate->([]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5.0, 4.0]),25)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0.1, 0.2, 0.3]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-10.0, -20.0, -30.0]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1.0, -2.0, 8.0]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0.2, 3.0, 5.0]),34)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]),165)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "pl", - "prompt": "# Return length of given string\n# >>> strlen(\"\")\n# 0\n# >>> strlen(\"abc\")\n# 3\nsub strlen {\n my($string) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&strlen;\n if(eq_deeply($candidate->(\"\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"x\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"asdasnakj\"),9)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "pl", - "prompt": "# You'll be given a string of words, and your task is to count the number\n# of boredoms. A boredom is a sentence that starts with the word \"I\".\n# Sentences are delimited by '.', '?' or '!'.\n# For example:\n# >>> is_bored(\"Hello world\")\n# 0\n# >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n# 1\nsub is_bored {\n my($S) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_bored;\n if(eq_deeply($candidate->(\"Hello world\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Is the sky blue?\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"I love It !\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"bIt\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"I feel good today. I will be productive. will kill It\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"You and I are going for a walk\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "pl", - "prompt": "# Write a function vowels_count which takes a string representing\n# a word as input and returns the number of vowels in the string.\n# Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n# vowel, but only when it is at the end of the given word.\n# Example:\n# >>> vowels_count(\"abcde\")\n# 2\n# >>> vowels_count(\"ACEDY\")\n# 3\nsub vowels_count {\n my($s) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&vowels_count;\n if(eq_deeply($candidate->(\"abcde\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Alone\"),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"key\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"bye\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"keY\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"bYe\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ACEDY\"),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "pl", - "prompt": "# Return n-th Fibonacci number.\n# >>> fib(10)\n# 55\n# >>> fib(1)\n# 1\n# >>> fib(8)\n# 21\nsub fib {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&fib;\n if(eq_deeply($candidate->(10),55)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),21)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(11),89)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12),144)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "pl", - "prompt": "# Your task is to implement a function that will simplify the expression\n# x * n. The function returns True if x * n evaluates to a whole number and False\n# otherwise. Both x and n, are string representation of a fraction, and have the following format,\n# / where both numerator and denominator are positive whole numbers.\n# You can assume that x, and n are valid fractions, and do not have zero as denominator.\n# >>> simplify(\"1/5\", \"5/1\")\n# 1\n# >>> simplify(\"1/6\", \"2/1\")\n# \"\"\n# >>> simplify(\"7/10\", \"10/2\")\n# \"\"\nsub simplify {\n my($x, $n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&simplify;\n if(eq_deeply($candidate->(\"1/5\", \"5/1\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1/6\", \"2/1\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"5/1\", \"3/1\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"7/10\", \"10/2\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2/10\", \"50/10\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"7/2\", \"4/2\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"11/6\", \"6/1\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2/3\", \"5/2\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"5/2\", \"3/5\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2/4\", \"8/4\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2/4\", \"4/2\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1/5\", \"5/1\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1/5\", \"1/5\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "pl", - "prompt": "# Given a string s, count the number of uppercase vowels in even indices.\n# For example:\n# >>> count_upper(\"aBCdEf\")\n# 1\n# >>> count_upper(\"abcdefg\")\n# 0\n# >>> count_upper(\"dBBE\")\n# 0\nsub count_upper {\n my($s) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&count_upper;\n if(eq_deeply($candidate->(\"aBCdEf\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdefg\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"dBBE\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"B\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"U\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"EEEE\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "pl", - "prompt": "# You are given a rectangular grid of wells. Each row represents a single well,\n# and each 1 in a row represents a single unit of water.\n# Each well has a corresponding bucket that can be used to extract water from it, \n# and all buckets have the same capacity.\n# Your task is to use the buckets to empty the wells.\n# Output the number of times you need to lower the buckets.\n# Example 1:\n# >>> max_fill([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1)\n# 6\n# Example 2:\n# >>> max_fill([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2)\n# 5\n# Example 3:\n# >>> max_fill([[0, 0, 0], [0, 0, 0]], 5)\n# 0\n# Constraints:\n# * all wells have the same length\n# * 1 <= grid.length <= 10^2\n# * 1 <= grid[:,1].length <= 10^2\n# * grid[i][j] -> 0 | 1\n# * 1 <= capacity <= 10\nsub max_fill {\n my($grid, $capacity) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&max_fill;\n if(eq_deeply($candidate->([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1),6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[0, 0, 0], [0, 0, 0]], 5),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1, 1, 1, 1], [1, 1, 1, 1]], 2),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1, 1, 1, 1], [1, 1, 1, 1]], 9),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "pl", - "prompt": "# Given an array arr of integers and a positive integer k, return a sorted list \n# of length k with the maximum k numbers in arr.\n# Example 1:\n# >>> maximum([-3, -4, 5], 3)\n# [-4, -3, 5]\n# Example 2:\n# >>> maximum([4, -4, 4], 2)\n# [4, 4]\n# Example 3:\n# >>> maximum([-3, 2, 1, 2, -1, -2, 1], 1)\n# [2]\n# Note:\n# 1. The length of the array will be in the range of [1, 1000].\n# 2. The elements in the array will be in the range of [-1000, 1000].\n# 3. 0 <= k <= len(arr)\nsub maximum {\n my($arr, $k) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&maximum;\n if(eq_deeply($candidate->([-3, -4, 5], 3),[-4, -3, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, -4, 4], 2),[4, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-3, 2, 1, 2, -1, -2, 1], 1),[2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([123, -123, 20, 0, 1, 2, -3], 3),[2, 20, 123])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-123, 20, 0, 1, 2, -3], 4),[0, 1, 2, 20])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 15, 0, 3, -13, -8, 0], 7),[-13, -8, 0, 0, 3, 5, 15])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, 0, 2, 5, 3, -10], 2),[3, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 0, 5, -7], 1),[5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, -4], 2),[-4, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-10, 10], 2),[-10, 10])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, -23, 243, -400, 0], 0),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "pl", - "prompt": "# Write a function that takes a message, and encodes in such a \n# way that it swaps case of all letters, replaces all vowels in \n# the message with the letter that appears 2 places ahead of that \n# vowel in the english alphabet. \n# Assume only letters. \n# Examples:\n# >>> encode(\"test\")\n# \"TGST\"\n# >>> encode(\"This is a message\")\n# \"tHKS KS C MGSSCGG\"\nsub encode {\n my($message) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&encode;\n if(eq_deeply($candidate->(\"TEST\"),\"tgst\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Mudasir\"),\"mWDCSKR\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"YES\"),\"ygs\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"This is a message\"),\"tHKS KS C MGSSCGG\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"I DoNt KnOw WhAt tO WrItE\"),\"k dQnT kNqW wHcT Tq wRkTg\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "pl", - "prompt": "# remove_vowels is a function that takes string and returns string without vowels.\n# >>> remove_vowels(\"\")\n# \"\"\n# >>> remove_vowels(\"abcdef\")\n# \"bcdf\"\n# >>> remove_vowels(\"aaaaa\")\n# \"\"\n# >>> remove_vowels(\"aaBAA\")\n# \"B\"\n# >>> remove_vowels(\"zbcd\")\n# \"zbcd\"\nsub remove_vowels {\n my($text) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&remove_vowels;\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdef\nghijklm\"),\"bcdf\nghjklm\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"fedcba\"),\"fdcb\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"eeeee\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"acBAA\"),\"cB\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"EcBOO\"),\"cB\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ybcd\"),\"ybcd\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "pl", - "prompt": "# Return only positive numbers in the list.\n# >>> get_positive([-1, 2, -4, 5, 6])\n# [2, 5, 6]\n# >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n# [5, 3, 2, 3, 9, 123, 1]\nsub get_positive {\n my($l) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&get_positive;\n if(eq_deeply($candidate->([-1, -2, 4, 5, 6]),[4, 5, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]),[5, 3, 2, 3, 3, 9, 123, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -2]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "pl", - "prompt": "# Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n# >>> string_sequence(0)\n# \"0\"\n# >>> string_sequence(5)\n# \"0 1 2 3 4 5\"\nsub string_sequence {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&string_sequence;\n if(eq_deeply($candidate->(0),\"0\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3),\"0 1 2 3\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),\"0 1 2 3 4 5 6 7 8 9 10\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "pl", - "prompt": "# Given a positive integer n, you have to make a pile of n levels of stones.\n# The first level has n stones.\n# The number of stones in the next level is:\n# - the next odd number if n is odd.\n# - the next even number if n is even.\n# Return the number of stones in each level in a list, where element at index\n# i represents the number of stones in the level (i+1).\n# Examples:\n# >>> make_a_pile(3)\n# [3, 5, 7]\nsub make_a_pile {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&make_a_pile;\n if(eq_deeply($candidate->(3),[3, 5, 7])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4),[4, 6, 8, 10])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5),[5, 7, 9, 11, 13])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6),[6, 8, 10, 12, 14, 16])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),[8, 10, 12, 14, 16, 18, 20, 22])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "pl", - "prompt": "# Task\n# 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\n# then check if the result string is palindrome.\n# A string is called palindrome if it reads the same backward as forward.\n# You should return a tuple containing the result string and True/False for the check.\n# Example\n# >>> reverse_delete(\"abcde\", \"ae\")\n# [\"bcd\", \"\"]\n# >>> reverse_delete(\"abcdef\", \"b\")\n# [\"acdef\", \"\"]\n# >>> reverse_delete(\"abcdedcba\", \"ab\")\n# [\"cdedc\", 1]\nsub reverse_delete {\n my($s, $c) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&reverse_delete;\n if(eq_deeply($candidate->(\"abcde\", \"ae\"),[\"bcd\", \"\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdef\", \"b\"),[\"acdef\", \"\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdedcba\", \"ab\"),[\"cdedc\", 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"dwik\", \"w\"),[\"dik\", \"\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"a\", \"a\"),[\"\", 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdedcba\", \"\"),[\"abcdedcba\", 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdedcba\", \"v\"),[\"abcdedcba\", 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"vabba\", \"v\"),[\"abba\", 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"mamma\", \"mia\"),[\"\", 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "pl", - "prompt": "# For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n# >>> flip_case(\"Hello\")\n# \"hELLO\"\nsub flip_case {\n my($string) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&flip_case;\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hello!\"),\"hELLO!\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"These violent delights have violent ends\"),\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "pl", - "prompt": "# You are given a string s.\n# if s[i] is a letter, reverse its case from lower to upper or vise versa, \n# otherwise keep it as it is.\n# If the string contains no letters, reverse the string.\n# The function should return the resulted string.\n# Examples\n# >>> solve(\"1234\")\n# \"4321\"\n# >>> solve(\"ab\")\n# \"AB\"\n# >>> solve(\"#a@C\")\n# \"#A@c\"\nsub solve {\n my($s) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&solve;\n if(eq_deeply($candidate->(\"AsDf\"),\"aSdF\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1234\"),\"4321\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ab\"),\"AB\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"#a@C\"),\"#A@c\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"#AsdfW^45\"),\"#aSDFw^45\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"#6@2\"),\"2@6#\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"#$a^D\"),\"#$A^d\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"#ccc\"),\"#CCC\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "pl", - "prompt": "# Filter an input list of strings only for ones that start with a given prefix.\n# >>> filter_by_prefix([], \"a\")\n# []\n# >>> filter_by_prefix([\"abc\", \"bcd\", \"cde\", \"array\"], \"a\")\n# [\"abc\", \"array\"]\nsub filter_by_prefix {\n my($strings, $prefix) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&filter_by_prefix;\n if(eq_deeply($candidate->([], \"john\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"),[\"xxx\", \"xxxAAA\", \"xxx\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "pl", - "prompt": "# This function takes two positive numbers x and y and returns the\n# biggest even integer number that is in the range [x, y] inclusive. If \n# there's no such number, then the function should return -1.\n# For example:\n# >>> choose_num(12, 15)\n# 14\n# >>> choose_num(13, 12)\n# -1\nsub choose_num {\n my($x, $y) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&choose_num;\n if(eq_deeply($candidate->(12, 15),14)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(13, 12),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(33, 12354),12354)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5234, 5233),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6, 29),28)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(27, 10),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7, 7),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(546, 546),546)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "pl", - "prompt": "# You are given a string representing a sentence,\n# the sentence contains some words separated by a space,\n# and you have to return a string that contains the words from the original sentence,\n# whose lengths are prime numbers,\n# the order of the words in the new string should be the same as the original one.\n# Example 1:\n# >>> words_in_sentence(\"This is a test\")\n# \"is\"\n# Example 2:\n# >>> words_in_sentence(\"lets go for swimming\")\n# \"go for\"\n# Constraints:\n# * 1 <= len(sentence) <= 100\n# * sentence contains only letters\nsub words_in_sentence {\n my($sentence) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&words_in_sentence;\n if(eq_deeply($candidate->(\"This is a test\"),\"is\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"lets go for swimming\"),\"go for\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"there is no place available here\"),\"there is no place\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hi I am Hussein\"),\"Hi am Hussein\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"go for it\"),\"go for it\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"here\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"here is\"),\"is\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "pl", - "prompt": "# Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n# >>> intersperse([], 4)\n# []\n# >>> intersperse([1, 2, 3], 4)\n# [1, 4, 2, 4, 3]\nsub intersperse {\n my($numbers, $delimeter) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&intersperse;\n if(eq_deeply($candidate->([], 7),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 6, 3, 2], 8),[5, 8, 6, 8, 3, 8, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 2, 2], 2),[2, 2, 2, 2, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "pl", - "prompt": "# Your task is to write a function that returns true if a number x is a simple\n# power of n and false in other cases.\n# x is a simple power of n if n**int=x\n# For example:\n# >>> is_simple_power(1, 4)\n# 1\n# >>> is_simple_power(2, 2)\n# 1\n# >>> is_simple_power(8, 2)\n# 1\n# >>> is_simple_power(3, 2)\n# \"\"\n# >>> is_simple_power(3, 1)\n# \"\"\n# >>> is_simple_power(5, 3)\n# \"\"\nsub is_simple_power {\n my($x, $n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_simple_power;\n if(eq_deeply($candidate->(16, 2),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(143214, 16),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4, 2),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(9, 3),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(16, 4),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(24, 2),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(128, 4),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12, 6),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 12),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "pl", - "prompt": "# Write a function that returns true if the given number is the multiplication of 3 prime numbers\n# and false otherwise.\n# Knowing that (a) is less then 100. \n# Example:\n# >>> is_multiply_prime(30)\n# 1\n# 30 = 2 * 3 * 5\nsub is_multiply_prime {\n my($a) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_multiply_prime;\n if(eq_deeply($candidate->(5),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(30),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(125),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(105),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(126),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(729),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(891),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1001),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "pl", - "prompt": "# Given the lengths of the three sides of a triangle. Return True if the three\n# sides form a right-angled triangle, False otherwise.\n# A right-angled triangle is a triangle in which one angle is right angle or \n# 90 degree.\n# Example:\n# >>> right_angle_triangle(3, 4, 5)\n# 1\n# >>> right_angle_triangle(1, 2, 3)\n# \"\"\nsub right_angle_triangle {\n my($a, $b, $c) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&right_angle_triangle;\n if(eq_deeply($candidate->(3, 4, 5),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 2, 3),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10, 6, 8),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 2, 2),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7, 24, 25),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10, 5, 7),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5, 12, 13),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(15, 8, 17),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(48, 55, 73),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 1, 1),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 2, 10),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "pl", - "prompt": "# Create a function that takes 3 numbers.\n# Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n# Returns false in any other cases.\n# Examples\n# >>> any_int(5, 2, 7)\n# 1\n# >>> any_int(3, 2, 2)\n# \"\"\n# >>> any_int(3, -2, 1)\n# 1\n# >>> any_int(3.6, -2.2, 2)\n# \"\"\nsub any_int {\n my($x, $y, $z) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&any_int;\n if(eq_deeply($candidate->(2, 3, 1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2.5, 2, 3),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1.5, 5, 3.5),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 6, 2),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4, 2, 2),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2.2, 2.2, 2.2),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(-4, 6, 2),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 1, 1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3, 4, 7),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3.0, 4, 7),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "pl", - "prompt": "# This function takes a list l and returns a list l' such that\n# l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n# to the values of the corresponding indicies of l, but sorted.\n# >>> sort_third([1, 2, 3])\n# [1, 2, 3]\n# >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n# [2, 6, 3, 4, 8, 9, 5]\nsub sort_third {\n my($l) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sort_third;\n if(eq_deeply($candidate->([5, 6, 3, 4, 8, 9, 2]),[2, 6, 3, 4, 8, 9, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 8, 3, 4, 6, 9, 2]),[2, 8, 3, 4, 6, 9, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 6, 9, 4, 8, 3, 2]),[2, 6, 9, 4, 8, 3, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 6, 3, 4, 8, 9, 2, 1]),[2, 6, 3, 4, 8, 9, 5, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_53_add", - "language": "pl", - "prompt": "# Add two numbers x and y\n# >>> add(2, 3)\n# 5\n# >>> add(5, 7)\n# 12\nsub add {\n my($x, $y) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&add;\n if(eq_deeply($candidate->(0, 1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 0),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 3),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5, 7),12)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7, 5),12)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_69_search", - "language": "pl", - "prompt": "# You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n# zero, and has a frequency greater than or equal to the value of the integer itself. \n# The frequency of an integer is the number of times it appears in the list.\n# If no such a value exist, return -1.\n# Examples:\n# >>> search([4, 1, 2, 2, 3, 1])\n# 2\n# >>> search([1, 2, 2, 3, 3, 3, 4, 4, 4])\n# 3\n# >>> search([5, 5, 4, 4, 4])\n# -1\nsub search {\n my($lst) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&search;\n if(eq_deeply($candidate->([5, 5, 5, 5, 1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 1, 4, 1, 4, 4]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 3]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([8, 8, 8, 8, 8, 8, 8, 8]),8)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 3, 3, 2, 2]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 8, 2]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([8, 8, 3, 6, 5, 6, 4]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 9, 10, 1, 3]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([10]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 10, 10, 9, 2]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "pl", - "prompt": "# Write a function that takes a string and returns True if the string\n# length is a prime number or False otherwise\n# Examples\n# >>> prime_length(\"Hello\")\n# 1\n# >>> prime_length(\"abcdcba\")\n# 1\n# >>> prime_length(\"kittens\")\n# 1\n# >>> prime_length(\"orange\")\n# \"\"\nsub prime_length {\n my($string) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&prime_length;\n if(eq_deeply($candidate->(\"Hello\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdcba\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"kittens\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"orange\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"wow\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"world\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"MadaM\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Wow\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"HI\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"go\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"gogo\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aaaaaaaaaaaaaaa\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Madam\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"M\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"0\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_58_common", - "language": "pl", - "prompt": "# Return sorted unique common elements for two lists.\n# >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n# [1, 5, 653]\n# >>> common([5, 3, 2, 8], [3, 2])\n# [2, 3]\nsub common {\n my($l1, $l2) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&common;\n if(eq_deeply($candidate->([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]),[1, 5, 653])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 3, 2, 8], [3, 2]),[2, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 3, 2, 8], [3, 2, 4]),[2, 3, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 3, 2, 8], []),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "pl", - "prompt": "# The Brazilian factorial is defined as:\n# brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n# where n > 0\n# For example:\n# >>> special_factorial(4)\n# 288\n# The function will receive an integer as input and should return the special\n# factorial of this integer.\nsub special_factorial {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&special_factorial;\n if(eq_deeply($candidate->(4),288)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5),34560)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7),125411328000)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "pl", - "prompt": "# In this problem, you will implement a function that takes two lists of numbers,\n# and determines whether it is possible to perform an exchange of elements\n# between them to make lst1 a list of only even numbers.\n# There is no limit on the number of exchanged elements between lst1 and lst2.\n# If it is possible to exchange elements between the lst1 and lst2 to make\n# all the elements of lst1 to be even, return \"YES\".\n# Otherwise, return \"NO\".\n# For example:\n# >>> exchange([1, 2, 3, 4], [1, 2, 3, 4])\n# \"YES\"\n# >>> exchange([1, 2, 3, 4], [1, 5, 3, 4])\n# \"NO\"\n# It is assumed that the input lists will be non-empty.\nsub exchange {\n my($lst1, $lst2) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&exchange;\n if(eq_deeply($candidate->([1, 2, 3, 4], [1, 2, 3, 4]),\"YES\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4], [1, 5, 3, 4]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4], [2, 1, 4, 3]),\"YES\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 7, 3], [2, 6, 4]),\"YES\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 7, 3], [2, 6, 3]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 6, 1, 8, 9], [3, 5, 5, 1, 1, 1]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([100, 200], [200, 200]),\"YES\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "pl", - "prompt": "# Given a non-empty array of integers arr and an integer k, return\n# the sum of the elements with at most two digits from the first k elements of arr.\n# Example:\n# >>> add_elements([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4)\n# 24\n# Constraints:\n# 1. 1 <= len(arr) <= 100\n# 2. 1 <= k <= len(arr)\nsub add_elements {\n my($arr, $k) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&add_elements;\n if(eq_deeply($candidate->([1, -2, -3, 41, 57, 76, 87, 88, 99], 3),-4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([111, 121, 3, 4000, 5, 6], 2),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([11, 21, 3, 90, 5, 6, 7, 8, 9], 4),125)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4),24)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1], 1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "pl", - "prompt": "# A simple program which should return the value of x if n is \n# a prime number and should return the value of y otherwise.\n# Examples:\n# >>> x_or_y(7, 34, 12)\n# 34\n# >>> x_or_y(15, 8, 5)\n# 5\nsub x_or_y {\n my($n, $x, $y) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&x_or_y;\n if(eq_deeply($candidate->(7, 34, 12),34)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(15, 8, 5),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3, 33, 5212),33)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1259, 3, 52),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7919, -1, 12),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3609, 1245, 583),583)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(91, 56, 129),129)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6, 34, 1234),1234)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 2, 0),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 2, 0),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "pl", - "prompt": "# Given length of a side and high return area for a triangle.\n# >>> triangle_area(5, 3)\n# 7.5\nsub triangle_area {\n my($a, $h) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&triangle_area;\n if(eq_deeply($candidate->(5, 3),7.5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 2),2.0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10, 8),40.0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "pl", - "prompt": "# Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n# the last couple centuries. However, what people don't know is Tribonacci sequence.\n# Tribonacci sequence is defined by the recurrence:\n# tri(1) = 3\n# tri(n) = 1 + n / 2, if n is even.\n# tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n# For example:\n# tri(2) = 1 + (2 / 2) = 2\n# tri(4) = 3\n# tri(3) = tri(2) + tri(1) + tri(4)\n# = 2 + 3 + 3 = 8 \n# You are given a non-negative integer number n, you have to a return a list of the \n# first n + 1 numbers of the Tribonacci sequence.\n# Examples:\n# >>> tri(3)\n# [1, 3, 2, 8]\nsub tri {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&tri;\n if(eq_deeply($candidate->(3),[1, 3, 2, 8])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4),[1, 3, 2, 8, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5),[1, 3, 2, 8, 3, 15])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6),[1, 3, 2, 8, 3, 15, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7),[1, 3, 2, 8, 3, 15, 4, 24])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),[1, 3, 2, 8, 3, 15, 4, 24, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(9),[1, 3, 2, 8, 3, 15, 4, 24, 5, 35])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(20),[1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(0),[1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),[1, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "pl", - "prompt": "# You are given a list of two strings, both strings consist of open\n# parentheses '(' or close parentheses ')' only.\n# Your job is to check if it is possible to concatenate the two strings in\n# some order, that the resulting string will be good.\n# A string S is considered to be good if and only if all parentheses in S\n# are balanced. For example: the string '(())()' is good, while the string\n# '())' is not.\n# Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n# Examples:\n# >>> match_parens([\"()(\", \")\"])\n# \"Yes\"\n# >>> match_parens([\")\", \")\"])\n# \"No\"\nsub match_parens {\n my($lst) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&match_parens;\n if(eq_deeply($candidate->([\"()(\", \")\"]),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\")\", \")\"]),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"(()(())\", \"())())\"]),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\")())\", \"(()()(\"]),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"(())))\", \"(()())((\"]),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"()\", \"())\"]),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"(()(\", \"()))()\"]),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"((((\", \"((())\"]),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\")(()\", \"(()(\"]),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\")(\", \")(\"]),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"(\", \")\"]),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\")\", \"(\"]),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "pl", - "prompt": "# From a list of integers, remove all elements that occur more than once.\n# Keep order of elements left the same as in the input.\n# >>> remove_duplicates([1, 2, 3, 2, 4])\n# [1, 3, 4]\nsub remove_duplicates {\n my($numbers) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&remove_duplicates;\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4]),[1, 2, 3, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 2, 4, 3, 5]),[1, 4, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "pl", - "prompt": "# Return a greatest common divisor of two integers a and b\n# >>> greatest_common_divisor(3, 5)\n# 1\n# >>> greatest_common_divisor(25, 15)\n# 5\nsub greatest_common_divisor {\n my($a, $b) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&greatest_common_divisor;\n if(eq_deeply($candidate->(3, 7),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10, 15),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(49, 14),7)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(144, 60),12)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "pl", - "prompt": "# Checks if given string is a palindrome\n# >>> is_palindrome(\"\")\n# 1\n# >>> is_palindrome(\"aba\")\n# 1\n# >>> is_palindrome(\"aaaaa\")\n# 1\n# >>> is_palindrome(\"zbcd\")\n# \"\"\nsub is_palindrome {\n my($text) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_palindrome;\n if(eq_deeply($candidate->(\"\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aba\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aaaaa\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"zbcd\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"xywyx\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"xywyz\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"xywzx\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "pl", - "prompt": "# xs represent coefficients of a polynomial.\n# xs[0] + xs[1] * x + xs[2] * x^2 + ....\n# Return derivative of this polynomial in the same form.\n# >>> derivative([3, 1, 2, 4, 5])\n# [1, 4, 12, 20]\n# >>> derivative([1, 2, 3])\n# [2, 6]\nsub derivative {\n my($xs) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&derivative;\n if(eq_deeply($candidate->([3, 1, 2, 4, 5]),[1, 4, 12, 20])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3]),[2, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 1]),[2, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 1, 0, 4]),[2, 2, 0, 16])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "pl", - "prompt": "# In this task, you will be given a string that represents a number of apples and oranges \n# that are distributed in a basket of fruit this basket contains \n# apples, oranges, and mango fruits. Given the string that represents the total number of \n# the oranges and apples and an integer that represent the total number of the fruits \n# in the basket return the number of the mango fruits in the basket.\n# for examble:\n# >>> fruit_distribution(\"5 apples and 6 oranges\", 19)\n# 8\n# >>> fruit_distribution(\"0 apples and 1 oranges\", 3)\n# 2\n# >>> fruit_distribution(\"2 apples and 3 oranges\", 100)\n# 95\n# >>> fruit_distribution(\"100 apples and 1 oranges\", 120)\n# 19\nsub fruit_distribution {\n my($s, $n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&fruit_distribution;\n if(eq_deeply($candidate->(\"5 apples and 6 oranges\", 19),8)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"5 apples and 6 oranges\", 21),10)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"0 apples and 1 oranges\", 3),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1 apples and 0 oranges\", 3),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2 apples and 3 oranges\", 100),95)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2 apples and 3 oranges\", 5),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1 apples and 100 oranges\", 120),19)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "pl", - "prompt": "# Write a function that takes an integer a and returns True \n# if this ingeger is a cube of some integer number.\n# Note: you may assume the input is always valid.\n# Examples:\n# >>> iscube(1)\n# 1\n# >>> iscube(2)\n# \"\"\n# >>> iscube(-1)\n# 1\n# >>> iscube(64)\n# 1\n# >>> iscube(0)\n# 1\n# >>> iscube(180)\n# \"\"\nsub iscube {\n my($a) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&iscube;\n if(eq_deeply($candidate->(1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(-1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(64),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(180),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1000),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(0),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1729),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "pl", - "prompt": "# In this Kata, you have to sort an array of non-negative integers according to\n# number of ones in their binary representation in ascending order.\n# For similar number of ones, sort based on decimal value.\n# It must be implemented like this:\n# >>> sort_array([1, 5, 2, 3, 4])\n# [1, 2, 3, 4, 5]\n# >>> sort_array([-2, -3, -4, -5, -6])\n# [-6, -5, -4, -3, -2]\n# >>> sort_array([1, 0, 2, 3, 4])\n# [0, 1, 2, 3, 4]\nsub sort_array {\n my($arr) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sort_array;\n if(eq_deeply($candidate->([1, 5, 2, 3, 4]),[1, 2, 4, 3, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-2, -3, -4, -5, -6]),[-4, -2, -6, -5, -3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 0, 2, 3, 4]),[0, 1, 2, 4, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]),[2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 6, 44, 12, 32, 5]),[32, 3, 5, 6, 12, 44])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, 8, 16, 32]),[2, 4, 8, 16, 32])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, 8, 16, 32]),[2, 4, 8, 16, 32])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "pl", - "prompt": "# Given a list of strings, where each string consists of only digits, return a list.\n# Each element i of the output should be \"the number of odd elements in the\n# string i of the input.\" where all the i's should be replaced by the number\n# of odd digits in the i'th string of the input.\n# >>> odd_count([\"1234567\"])\n# [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n# >>> odd_count([\"3\", \"11111111\"])\n# [\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\nsub odd_count {\n my($lst) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&odd_count;\n if(eq_deeply($candidate->([\"1234567\"]),[\"the number of odd elements 4n the str4ng 4 of the 4nput.\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($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.\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"271\", \"137\", \"314\"]),[\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "pl", - "prompt": "# brackets is a string of \"(\" and \")\".\n# return True if every opening bracket has a corresponding closing bracket.\n# >>> correct_bracketing(\"(\")\n# \"\"\n# >>> correct_bracketing(\"()\")\n# 1\n# >>> correct_bracketing(\"(()())\")\n# 1\n# >>> correct_bracketing(\")(()\")\n# \"\"\nsub correct_bracketing {\n my($brackets) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&correct_bracketing;\n if(eq_deeply($candidate->(\"()\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"(()())\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"()()(()())()\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"()()((()()())())(()()(()))\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"((()())))\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\")(()\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"(\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"((((\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\")\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"(()\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"()()(()())())(()\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"()()(()())()))()\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "pl", - "prompt": "# Task\n# Write a function that takes a string as input and returns the sum of the upper characters only'\n# ASCII codes.\n# Examples:\n# >>> digitSum(\"\")\n# 0\n# >>> digitSum(\"abAB\")\n# 131\n# >>> digitSum(\"abcCd\")\n# 67\n# >>> digitSum(\"helloE\")\n# 69\n# >>> digitSum(\"woArBld\")\n# 131\n# >>> digitSum(\"aAaaaXa\")\n# 153\nsub digitSum {\n my($s) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&digitSum;\n if(eq_deeply($candidate->(\"\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abAB\"),131)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcCd\"),67)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"helloE\"),69)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"woArBld\"),131)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aAaaaXa\"),153)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\" How are yOu?\"),151)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"You arE Very Smart\"),327)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "pl", - "prompt": "# Write a function that accepts a list of strings as a parameter,\n# deletes the strings that have odd lengths from it,\n# and returns the resulted list with a sorted order,\n# The list is always a list of strings and never an array of numbers,\n# and it may contain duplicates.\n# The order of the list should be ascending by length of each word, and you\n# should return the list sorted by that rule.\n# If two words have the same length, sort the list alphabetically.\n# The function should return a list of strings in sorted order.\n# You may assume that all words will have the same length.\n# For example:\n# >>> list_sort([\"aa\", \"a\", \"aaa\"])\n# [\"aa\"]\n# >>> list_sort([\"ab\", \"a\", \"aaa\", \"cd\"])\n# [\"ab\", \"cd\"]\nsub sorted_list_sum {\n my($lst) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sorted_list_sum;\n if(eq_deeply($candidate->([\"aa\", \"a\", \"aaa\"]),[\"aa\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"school\", \"AI\", \"asdf\", \"b\"]),[\"AI\", \"asdf\", \"school\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"d\", \"b\", \"c\", \"a\"]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"d\", \"dcba\", \"abcd\", \"a\"]),[\"abcd\", \"dcba\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"AI\", \"ai\", \"au\"]),[\"AI\", \"ai\", \"au\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"aaaa\", \"bbbb\", \"dd\", \"cc\"]),[\"cc\", \"dd\", \"aaaa\", \"bbbb\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "pl", - "prompt": "# You are given an array arr of integers and you need to return\n# sum of magnitudes of integers multiplied by product of all signs\n# of each number in the array, represented by 1, -1 or 0.\n# Note: return None for empty arr.\n# Example:\n# >>> prod_signs([1, 2, 2, -4])\n# 9\n# >>> prod_signs([0, 1])\n# 0\n# >>> prod_signs([])\n# undef\nsub prod_signs {\n my($arr) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&prod_signs;\n if(eq_deeply($candidate->([1, 2, 2, -4]),-9)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 1]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 1, 1, 2, 3, -1, 1]),-10)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),undef)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, 1, 2, -1, -1, 9]),20)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, 1, -1, 1]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, 1, 1, 1]),-4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, 1, 1, 0]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "pl", - "prompt": "# Return list with elements incremented by 1.\n# >>> incr_list([1, 2, 3])\n# [2, 3, 4]\n# >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123])\n# [6, 4, 6, 3, 4, 4, 10, 1, 124]\nsub incr_list {\n my($l) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&incr_list;\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 1]),[4, 3, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 2, 5, 2, 3, 3, 9, 0, 123]),[6, 3, 6, 3, 4, 4, 10, 1, 124])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "pl", - "prompt": "# From a given list of integers, generate a list of rolling maximum element found until given moment\n# in the sequence.\n# >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n# [1, 2, 3, 3, 3, 4, 4]\nsub rolling_max {\n my($numbers) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&rolling_max;\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4]),[1, 2, 3, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 3, 2, 1]),[4, 4, 4, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 3, 100, 3]),[3, 3, 3, 100, 100])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "pl", - "prompt": "# Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n# separate those group into separate strings and return the list of those.\n# Separate groups are balanced (each open brace is properly closed) and not nested within each other\n# Ignore any spaces in the input string.\n# >>> separate_paren_groups(\"( ) (( )) (( )( ))\")\n# [\"()\", \"(())\", \"(()())\"]\nsub separate_paren_groups {\n my($paren_string) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&separate_paren_groups;\n if(eq_deeply($candidate->(\"(()()) ((())) () ((())()())\"),[\"(()())\", \"((()))\", \"()\", \"((())()())\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"() (()) ((())) (((())))\"),[\"()\", \"(())\", \"((()))\", \"(((())))\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"(()(())((())))\"),[\"(()(())((())))\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"( ) (( )) (( )( ))\"),[\"()\", \"(())\", \"(()())\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "pl", - "prompt": "# You will be given a string of words separated by commas or spaces. Your task is\n# to split the string into words and return an array of the words.\n# For example:\n# >>> words_string(\"Hi, my name is John\")\n# [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n# >>> words_string(\"One, two, three, four, five, six\")\n# [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\nsub words_string {\n my($s) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&words_string;\n if(eq_deeply($candidate->(\"Hi, my name is John\"),[\"Hi\", \"my\", \"name\", \"is\", \"John\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"One, two, three, four, five, six\"),[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hi, my name\"),[\"Hi\", \"my\", \"name\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"One,, two, three, four, five, six,\"),[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ahmed , gamal\"),[\"ahmed\", \"gamal\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "pl", - "prompt": "# Create a function that takes integers, floats, or strings representing\n# real numbers, and returns the larger variable in its given variable type.\n# Return None if the values are equal.\n# Note: If a real number is represented as a string, the floating point might be . or ,\n# >>> compare_one(1, 2.5)\n# 2.5\n# >>> compare_one(1, \"2,3\")\n# \"2,3\"\n# >>> compare_one(\"5,1\", \"6\")\n# \"6\"\n# >>> compare_one(\"1\", 1)\n# undef\nsub compare_one {\n my($a, $b) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&compare_one;\n if(eq_deeply($candidate->(1, 2),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 2.5),2.5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 3),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5, 6),6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, \"2,3\"),\"2,3\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"5,1\", \"6\"),\"6\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1\", \"2\"),\"2\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1\", 1),undef)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "pl", - "prompt": "# Filter given list of any python values only for integers\n# >>> filter_integers([\"a\", 3.14, 5])\n# [5]\n# >>> filter_integers([1, 2, 3, \"abc\", {}, []])\n# [1, 2, 3]\nsub filter_integers {\n my($values) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&filter_integers;\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, {}, [], 23.2, 9, \"adasd\"]),[4, 9])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, \"c\", 3, 3, \"a\", \"b\"]),[3, 3, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "pl", - "prompt": "# This function takes a list l and returns a list l' such that\n# l' is identical to l in the odd indicies, while its values at the even indicies are equal\n# to the values of the even indicies of l, but sorted.\n# >>> sort_even([1, 2, 3])\n# [1, 2, 3]\n# >>> sort_even([5, 6, 3, 4])\n# [3, 6, 5, 4]\nsub sort_even {\n my($l) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sort_even;\n if(eq_deeply($candidate->([1, 2, 3]),[1, 2, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]),[-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 8, -12, 4, 23, 2, 3, 11, 12, -10]),[-12, 8, 3, 4, 5, 2, 12, 11, 23, -10])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "pl", - "prompt": "# I think we all remember that feeling when the result of some long-awaited\n# event is finally known. The feelings and thoughts you have at that moment are\n# definitely worth noting down and comparing.\n# Your task is to determine if a person correctly guessed the results of a number of matches.\n# You are given two arrays of scores and guesses of equal length, where each index shows a match. \n# Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n# the value is 0, and if not, the value is the absolute difference between the guess and the score.\n# example:\n# >>> compare([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2])\n# [0, 0, 0, 0, 3, 3]\n# >>> compare([0, 5, 0, 0, 0, 4], [4, 1, 1, 0, 0, -2])\n# [4, 4, 1, 0, 0, 6]\nsub compare {\n my($game, $guess) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&compare;\n if(eq_deeply($candidate->([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2]),[0, 0, 0, 0, 3, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]),[0, 0, 0, 0, 0, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3], [-1, -2, -3]),[2, 4, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 5], [-1, 2, 3, 4]),[2, 0, 0, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "pl", - "prompt": "# Given a positive integer n, return a tuple that has the number of even and odd\n# integer palindromes that fall within the range(1, n), inclusive.\n# Example 1:\n# >>> even_odd_palindrome(3)\n# [1, 2]\n# Explanation:\n# Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n# Example 2:\n# >>> even_odd_palindrome(12)\n# [4, 6]\n# Explanation:\n# Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n# Note:\n# 1. 1 <= n <= 10^3\n# 2. returned tuple has the number of even and odd integer palindromes respectively.\nsub even_odd_palindrome {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&even_odd_palindrome;\n if(eq_deeply($candidate->(123),[8, 13])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12),[4, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3),[1, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(63),[6, 8])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(25),[5, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(19),[4, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(9),[4, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),[0, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "pl", - "prompt": "# The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fib4(0) -> 0\n# fib4(1) -> 0\n# fib4(2) -> 2\n# fib4(3) -> 0\n# fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n# Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n# >>> fib4(5)\n# 4\n# >>> fib4(6)\n# 8\n# >>> fib4(7)\n# 14\nsub fib4 {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&fib4;\n if(eq_deeply($candidate->(5),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),28)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),104)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12),386)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "pl", - "prompt": "# Given two positive integers a and b, return the even digits between a\n# and b, in ascending order.\n# For example:\n# >>> generate_integers(2, 8)\n# [2, 4, 6, 8]\n# >>> generate_integers(8, 2)\n# [2, 4, 6, 8]\n# >>> generate_integers(10, 14)\n# []\nsub generate_integers {\n my($a, $b) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&generate_integers;\n if(eq_deeply($candidate->(2, 10),[2, 4, 6, 8])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10, 2),[2, 4, 6, 8])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(132, 2),[2, 4, 6, 8])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(17, 89),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "pl", - "prompt": "# For a given list of input numbers, calculate Mean Absolute Deviation\n# around the mean of this dataset.\n# Mean Absolute Deviation is the average absolute difference between each\n# element and a centerpoint (mean in this case):\n# MAD = average | x - x_mean |\n# >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n# 1.0\nsub mean_absolute_deviation {\n my($numbers) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&mean_absolute_deviation;\n if(eq_deeply($candidate->([1.0, 2.0]),0.5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.0, 4.0]),1.0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.0, 4.0, 5.0]),1.2)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "pl", - "prompt": "# Create a function encrypt that takes a string as an argument and\n# returns a string encrypted with the alphabet being rotated. \n# The alphabet should be rotated in a manner such that the letters \n# shift down by two multiplied to two places.\n# For example:\n# >>> encrypt(\"hi\")\n# \"lm\"\n# >>> encrypt(\"asdfghjkl\")\n# \"ewhjklnop\"\n# >>> encrypt(\"gf\")\n# \"kj\"\n# >>> encrypt(\"et\")\n# \"ix\"\nsub encrypt {\n my($s) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&encrypt;\n if(eq_deeply($candidate->(\"hi\"),\"lm\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"asdfghjkl\"),\"ewhjklnop\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"gf\"),\"kj\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"et\"),\"ix\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"faewfawefaewg\"),\"jeiajeaijeiak\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"hellomyfriend\"),\"lippsqcjvmirh\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\"),\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"a\"),\"e\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "pl", - "prompt": "# Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n# The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n# as follows: start with any positive integer n. Then each term is obtained from the \n# previous term as follows: if the previous term is even, the next term is one half of \n# the previous term. If the previous term is odd, the next term is 3 times the previous\n# term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n# Note: \n# 1. Collatz(1) is [1].\n# 2. returned list sorted in increasing order.\n# For example:\n# get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n# >>> get_odd_collatz(5)\n# [1, 5]\nsub get_odd_collatz {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&get_odd_collatz;\n if(eq_deeply($candidate->(14),[1, 5, 7, 11, 13, 17])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5),[1, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12),[1, 3, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),[1])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "pl", - "prompt": "# Find how many times a given substring can be found in the original string. Count overlaping cases.\n# >>> how_many_times(\"\", \"a\")\n# 0\n# >>> how_many_times(\"aaa\", \"a\")\n# 3\n# >>> how_many_times(\"aaaa\", \"aa\")\n# 3\nsub how_many_times {\n my($string, $substring) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&how_many_times;\n if(eq_deeply($candidate->(\"\", \"x\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"xyxyxyx\", \"x\"),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"cacacacac\", \"cac\"),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"john doe\", \"john\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "pl", - "prompt": "# We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n# numbers in the array will be randomly ordered. Your task is to determine if\n# it is possible to get an array sorted in non-decreasing order by performing \n# the following operation on the given array:\n# You are allowed to perform right shift operation any number of times.\n# One right shift operation means shifting all elements of the array by one\n# position in the right direction. The last element of the array will be moved to\n# the starting position in the array i.e. 0th index. \n# If it is possible to obtain the sorted array by performing the above operation\n# then return True else return False.\n# If the given array is empty then return True.\n# Note: The given list is guaranteed to have unique elements.\n# For Example:\n# >>> move_one_ball([3, 4, 5, 1, 2])\n# 1\n# Explanation: By performin 2 right shift operations, non-decreasing order can\n# be achieved for the given array.\n# >>> move_one_ball([3, 5, 4, 1, 2])\n# \"\"\n# Explanation:It is not possible to get non-decreasing order for the given\n# array by performing any number of right shift operations.\nsub move_one_ball {\n my($arr) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&move_one_ball;\n if(eq_deeply($candidate->([3, 4, 5, 1, 2]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 5, 10, 1, 2]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 3, 1, 2]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 5, 4, 1, 2]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "pl", - "prompt": "# Write a function which sorts the given list of integers\n# in ascending order according to the sum of their digits.\n# Note: if there are several items with similar sum of their digits,\n# order them based on their index in original list.\n# For example:\n# >>> order_by_points([1, 11, -1, -11, -12])\n# [-1, -11, 1, -12, 11]\n# >>> order_by_points([])\n# []\nsub order_by_points {\n my($nums) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&order_by_points;\n if(eq_deeply($candidate->([1, 11, -1, -11, -12]),[-1, -11, 1, -12, 11])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]),[0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, -11, -32, 43, 54, -98, 2, -3]),[-3, -32, -98, -11, 1, 2, 43, 54])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]),[1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 6, 6, -76, -21, 23, 4]),[-76, -21, 0, 4, 23, 6, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "pl", - "prompt": "# Return list of prime factors of given integer in the order from smallest to largest.\n# Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n# Input number should be equal to the product of all factors\n# >>> factorize(8)\n# [2, 2, 2]\n# >>> factorize(25)\n# [5, 5]\n# >>> factorize(70)\n# [2, 5, 7]\nsub factorize {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&factorize;\n if(eq_deeply($candidate->(2),[2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4),[2, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),[2, 2, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(57),[3, 19])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3249),[3, 3, 19, 19])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(185193),[3, 3, 3, 19, 19, 19])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(20577),[3, 19, 19, 19])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(18),[2, 3, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "pl", - "prompt": "# Return True if all numbers in the list l are below threshold t.\n# >>> below_threshold([1, 2, 4, 10], 100)\n# 1\n# >>> below_threshold([1, 20, 4, 10], 5)\n# \"\"\nsub below_threshold {\n my($l, $t) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&below_threshold;\n if(eq_deeply($candidate->([1, 2, 4, 10], 100),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 20, 4, 10], 5),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 20, 4, 10], 21),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 20, 4, 10], 22),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 8, 4, 10], 11),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 8, 4, 10], 10),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "pl", - "prompt": "# You are given two positive integers n and m, and your task is to compute the\n# average of the integers from n through m (including n and m). \n# Round the answer to the nearest integer and convert that to binary.\n# If n is greater than m, return -1.\n# Example:\n# >>> rounded_avg(1, 5)\n# \"0b11\"\n# >>> rounded_avg(7, 5)\n# -1\n# >>> rounded_avg(10, 20)\n# \"0b1111\"\n# >>> rounded_avg(20, 33)\n# \"0b11010\"\nsub rounded_avg {\n my($n, $m) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&rounded_avg;\n if(eq_deeply($candidate->(1, 5),\"0b11\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7, 13),\"0b1010\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(964, 977),\"0b1111001010\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(996, 997),\"0b1111100100\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(560, 851),\"0b1011000010\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(185, 546),\"0b101101110\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(362, 496),\"0b110101101\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(350, 902),\"0b1001110010\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(197, 233),\"0b11010111\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7, 5),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5, 1),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5, 5),\"0b101\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "pl", - "prompt": "# Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n# For each of the group, output the deepest level of nesting of parentheses.\n# E.g. (()()) has maximum two levels of nesting while ((())) has three.\n# >>> parse_nested_parens(\"(()()) ((())) () ((())()())\")\n# [2, 3, 1, 3]\nsub parse_nested_parens {\n my($paren_string) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&parse_nested_parens;\n if(eq_deeply($candidate->(\"(()()) ((())) () ((())()())\"),[2, 3, 1, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"() (()) ((())) (((())))\"),[1, 2, 3, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"(()(())((())))\"),[4])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "pl", - "prompt": "# Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n# Examples\n# >>> solution([5, 8, 7, 1])\n# 12\n# >>> solution([3, 3, 3, 3, 3])\n# 9\n# >>> solution([30, 13, 24, 321])\n# 0\nsub solution {\n my($lst) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&solution;\n if(eq_deeply($candidate->([5, 8, 7, 1]),12)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 3, 3, 3, 3]),9)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([30, 13, 24, 321]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 9]),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, 8]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([30, 13, 23, 32]),23)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 13, 2, 9]),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "pl", - "prompt": "# You are given a positive integer n. You have to create an integer array a of length n.\n# For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n# Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n# and a[i] + a[j] + a[k] is a multiple of 3.\n# Example :\n# >>> get_max_triples(5)\n# 1\n# Explanation: \n# a = [1, 3, 7, 13, 21]\n# The only valid triple is (1, 7, 13).\nsub get_max_triples {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&get_max_triples;\n if(eq_deeply($candidate->(5),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),36)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(100),53361)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "pl", - "prompt": "# There are eight planets in our solar system: the closerst to the Sun \n# is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n# Uranus, Neptune.\n# Write a function that takes two planet names as strings planet1 and planet2. \n# The function should return a tuple containing all planets whose orbits are \n# located between the orbit of planet1 and the orbit of planet2, sorted by \n# the proximity to the sun. \n# The function should return an empty tuple if planet1 or planet2\n# are not correct planet names. \n# Examples\n# >>> bf(\"Jupiter\", \"Neptune\")\n# [\"Saturn\", \"Uranus\"]\n# >>> bf(\"Earth\", \"Mercury\")\n# \"Venus\"\n# >>> bf(\"Mercury\", \"Uranus\")\n# [\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"]\nsub bf {\n my($planet1, $planet2) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&bf;\n if(eq_deeply($candidate->(\"Jupiter\", \"Neptune\"),[\"Saturn\", \"Uranus\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Earth\", \"Mercury\"),[\"Venus\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Mercury\", \"Uranus\"),[\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Neptune\", \"Venus\"),[\"Earth\", \"Mars\", \"Jupiter\", \"Saturn\", \"Uranus\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Earth\", \"Earth\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Mars\", \"Earth\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Jupiter\", \"Makemake\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "pl", - "prompt": "# You are given a list of integers.\n# Write a function next_smallest() that returns the 2nd smallest element of the list.\n# Return None if there is no such element.\n# >>> next_smallest([1, 2, 3, 4, 5])\n# 2\n# >>> next_smallest([5, 1, 4, 3, 2])\n# 2\n# >>> next_smallest([])\n# undef\n# >>> next_smallest([1, 1])\n# undef\nsub next_smallest {\n my($lst) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&next_smallest;\n if(eq_deeply($candidate->([1, 2, 3, 4, 5]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 1, 4, 3, 2]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),undef)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 1]),undef)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 1, 1, 1, 0]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 1]),undef)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-35, 34, 12, -45]),-35)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "pl", - "prompt": "# Input is a space-delimited string of numberals from 'zero' to 'nine'.\n# Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n# Return the string with numbers sorted from smallest to largest\n# >>> sort_numbers(\"three one five\")\n# \"one three five\"\nsub sort_numbers {\n my($numbers) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sort_numbers;\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"three\"),\"three\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"three five nine\"),\"three five nine\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"five zero four seven nine eight\"),\"zero four five seven eight nine\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"six five four three two one zero\"),\"zero one two three four five six\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "pl", - "prompt": "# You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n# >>> cycpattern_check(\"abcd\", \"abd\")\n# \"\"\n# >>> cycpattern_check(\"hello\", \"ell\")\n# 1\n# >>> cycpattern_check(\"whassup\", \"psus\")\n# \"\"\n# >>> cycpattern_check(\"abab\", \"baa\")\n# 1\n# >>> cycpattern_check(\"efef\", \"eeff\")\n# \"\"\n# >>> cycpattern_check(\"himenss\", \"simen\")\n# 1\nsub cycpattern_check {\n my($a, $b) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&cycpattern_check;\n if(eq_deeply($candidate->(\"xyzw\", \"xyw\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"yello\", \"ell\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"whattup\", \"ptut\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"efef\", \"fee\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abab\", \"aabb\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"winemtt\", \"tinem\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "pl", - "prompt": "# You will be given a number in decimal form and your task is to convert it to\n# binary format. The function should return a string, with each character representing a binary\n# number. Each character in the string will be '0' or '1'.\n# There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n# The extra characters are there to help with the format.\n# Examples:\n# >>> decimal_to_binary(15)\n# \"db1111db\"\n# >>> decimal_to_binary(32)\n# \"db100000db\"\nsub decimal_to_binary {\n my($decimal) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&decimal_to_binary;\n if(eq_deeply($candidate->(0),\"db0db\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(32),\"db100000db\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(103),\"db1100111db\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(15),\"db1111db\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "pl", - "prompt": "# Filter an input list of strings only for ones that contain given substring\n# >>> filter_by_substring([], \"a\")\n# []\n# >>> filter_by_substring([\"abc\", \"bacd\", \"cde\", \"array\"], \"a\")\n# [\"abc\", \"bacd\", \"array\"]\nsub filter_by_substring {\n my($strings, $substring) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&filter_by_substring;\n if(eq_deeply($candidate->([], \"john\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"),[\"xxx\", \"xxxAAA\", \"xxx\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xx\"),[\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"grunt\", \"trumpet\", \"prune\", \"gruesome\"], \"run\"),[\"grunt\", \"prune\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "pl", - "prompt": "# Given an integer. return a tuple that has the number of even and odd digits respectively.\n# Example:\n# >>> even_odd_count(-12)\n# [1, 1]\n# >>> even_odd_count(123)\n# [1, 2]\nsub even_odd_count {\n my($num) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&even_odd_count;\n if(eq_deeply($candidate->(7),[0, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(-78),[1, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3452),[2, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(346211),[3, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(-345821),[3, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(-2),[1, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(-45347),[2, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(0),[1, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "pl", - "prompt": "# Write a function that accepts a list of strings.\n# The list contains different words. Return the word with maximum number\n# of unique characters. If multiple strings have maximum number of unique\n# characters, return the one which comes first in lexicographical order.\n# >>> find_max([\"name\", \"of\", \"string\"])\n# \"string\"\n# >>> find_max([\"name\", \"enam\", \"game\"])\n# \"enam\"\n# >>> find_max([\"aaaaaaa\", \"bb\", \"cc\"])\n# \"aaaaaaa\"\nsub find_max {\n my($words) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&find_max;\n if(eq_deeply($candidate->([\"name\", \"of\", \"string\"]),\"string\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"name\", \"enam\", \"game\"]),\"enam\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"aaaaaaa\", \"bb\", \"cc\"]),\"aaaaaaa\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"abc\", \"cba\"]),\"abc\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"play\", \"this\", \"game\", \"of\", \"footbott\"]),\"footbott\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"we\", \"are\", \"gonna\", \"rock\"]),\"gonna\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"we\", \"are\", \"a\", \"mad\", \"nation\"]),\"nation\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"this\", \"is\", \"a\", \"prrk\"]),\"this\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"b\"]),\"b\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"play\", \"play\", \"play\"]),\"play\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "pl", - "prompt": "# Given a positive integer n, return the count of the numbers of n-digit\n# positive integers that start or end with 1.\nsub starts_one_ends {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&starts_one_ends;\n if(eq_deeply($candidate->(1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2),18)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3),180)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4),1800)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5),18000)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "pl", - "prompt": "# Create a function that returns a tuple (a, b), where 'a' is\n# the largest of negative integers, and 'b' is the smallest\n# of positive integers in a list.\n# If there is no negative or positive integers, return them as None.\n# Examples:\n# >>> largest_smallest_integers([2, 4, 1, 3, 5, 7])\n# [undef, 1]\n# >>> largest_smallest_integers([])\n# [undef, undef]\n# >>> largest_smallest_integers([0])\n# [undef, undef]\nsub largest_smallest_integers {\n my($lst) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&largest_smallest_integers;\n if(eq_deeply($candidate->([2, 4, 1, 3, 5, 7]),[undef, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, 1, 3, 5, 7, 0]),[undef, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, 2, 4, 5, 6, -2]),[-2, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 5, 3, 6, 2, 7, -7]),[-7, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([7, 3, 8, 4, 9, 2, 5, -9]),[-9, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),[undef, undef])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0]),[undef, undef])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -3, -5, -6]),[-1, undef])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -3, -5, -6, 0]),[-1, undef])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-6, -4, -4, -3, 1]),[-3, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-6, -4, -4, -3, -100, 1]),[-3, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "pl", - "prompt": "# \"Given an array representing a branch of a tree that has non-negative integer nodes\n# your task is to pluck one of the nodes and return it.\n# The plucked node should be the node with the smallest even value.\n# If multiple nodes with the same smallest even value are found return the node that has smallest index.\n# The plucked node should be returned in a list, [ smalest_value, its index ],\n# If there are no even values or the given array is empty, return [].\n# Example 1:\n# >>> pluck([4, 2, 3])\n# [2, 1]\n# Explanation: 2 has the smallest even value, and 2 has the smallest index.\n# Example 2:\n# >>> pluck([1, 2, 3])\n# [2, 1]\n# Explanation: 2 has the smallest even value, and 2 has the smallest index.\n# Example 3:\n# >>> pluck([])\n# []\n# Example 4:\n# >>> pluck([5, 0, 3, 0, 4, 2])\n# [0, 1]\n# Explanation: 0 is the smallest value, but there are two zeros,\n# so we will choose the first zero, which has the smallest index.\n# Constraints:\n# * 1 <= nodes.length <= 10000\n# * 0 <= node.value\nsub pluck {\n my($arr) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&pluck;\n if(eq_deeply($candidate->([4, 2, 3]),[2, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3]),[2, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 0, 3, 0, 4, 2]),[0, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 0, 5, 3]),[0, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 4, 8, 4, 8]),[4, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([7, 6, 7, 1]),[6, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([7, 9, 7, 1]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "pl", - "prompt": "# Write a function count_nums which takes an array of integers and returns\n# the number of elements which has a sum of digits > 0.\n# If a number is negative, then its first signed digit will be negative:\n# e.g. -123 has signed digits -1, 2, and 3.\n# >>> count_nums([])\n# 0\n# >>> count_nums([-1, 11, -11])\n# 1\n# >>> count_nums([1, 1, 2])\n# 3\nsub count_nums {\n my($arr) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&count_nums;\n if(eq_deeply($candidate->([]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -2, 0]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 1, 2, -2, 3, 4, 5]),6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 6, 9, -6, 0, 1, 5]),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 100, 98, -7, 1, -1]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([12, 23, 34, -45, -56, 0]),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "pl", - "prompt": "# Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n# each cell of the grid contains a value. Every integer in the range [1, N * N]\n# inclusive appears exactly once on the cells of the grid.\n# You have to find the minimum path of length k in the grid. You can start\n# from any cell, and in each step you can move to any of the neighbor cells,\n# in other words, you can go to cells which share an edge with you current\n# cell.\n# Please note that a path of length k means visiting exactly k cells (not\n# necessarily distinct).\n# You CANNOT go off the grid.\n# A path A (of length k) is considered less than a path B (of length k) if\n# after making the ordered lists of the values on the cells that A and B go\n# through (let's call them lst_A and lst_B), lst_A is lexicographically less\n# than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n# such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n# lst_A[j] = lst_B[j].\n# It is guaranteed that the answer is unique.\n# Return an ordered list of the values on the cells that the minimum path go through.\n# Examples: \n# >>> minPath([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3)\n# [1, 2, 1]\n# >>> minPath([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1)\n# [1]\nsub minPath {\n my($grid, $k) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&minPath;\n if(eq_deeply($candidate->([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3),[1, 2, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1),[1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], 4),[1, 2, 1, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[6, 4, 13, 10], [5, 7, 12, 1], [3, 16, 11, 15], [8, 14, 9, 2]], 7),[1, 10, 1, 10, 1, 10, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[8, 14, 9, 2], [6, 4, 13, 15], [5, 7, 1, 12], [3, 10, 11, 16]], 5),[1, 7, 1, 7, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[11, 8, 7, 2], [5, 16, 14, 4], [9, 3, 15, 6], [12, 13, 10, 1]], 9),[1, 6, 1, 6, 1, 6, 1, 6, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[12, 13, 10, 1], [9, 3, 15, 6], [5, 16, 14, 4], [11, 8, 7, 2]], 12),[1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[2, 7, 4], [3, 1, 5], [6, 8, 9]], 8),[1, 3, 1, 3, 1, 3, 1, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[6, 1, 5], [3, 8, 9], [2, 7, 4]], 8),[1, 5, 1, 5, 1, 5, 1, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1, 2], [3, 4]], 10),[1, 2, 1, 2, 1, 2, 1, 2, 1, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1, 3], [3, 2]], 10),[1, 3, 1, 3, 1, 3, 1, 3, 1, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "pl", - "prompt": "# Given list of integers, return list in strange order.\n# Strange sorting, is when you start with the minimum value,\n# then maximum of the remaining integers, then minimum and so on.\n# Examples:\n# >>> strange_sort_list([1, 2, 3, 4])\n# [1, 4, 2, 3]\n# >>> strange_sort_list([5, 5, 5, 5])\n# [5, 5, 5, 5]\n# >>> strange_sort_list([])\n# []\nsub strange_sort_list {\n my($lst) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&strange_sort_list;\n if(eq_deeply($candidate->([1, 2, 3, 4]),[1, 4, 2, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 6, 7, 8, 9]),[5, 9, 6, 8, 7])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 5]),[1, 5, 2, 4, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 6, 7, 8, 9, 1]),[1, 9, 5, 8, 6, 7])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5, 5, 5, 5]),[5, 5, 5, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 5, 6, 7, 8]),[1, 8, 2, 7, 3, 6, 4, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 2, 2, 2, 5, 5, -5, -5]),[-5, 5, -5, 5, 0, 2, 2, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([111111]),[111111])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "pl", - "prompt": "# Given a string 'text', return its md5 hash equivalent string.\n# If 'text' is an empty string, return None.\n# >>> string_to_md5(\"Hello world\")\n# \"3e25960a79dbc69b674cd4ec67a72c62\"\nsub string_to_md5 {\n my($text) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&string_to_md5;\n if(eq_deeply($candidate->(\"Hello world\"),\"3e25960a79dbc69b674cd4ec67a72c62\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),undef)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"A B C\"),\"0ef78513b0cb8cef12743f5aeb35f888\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"password\"),\"5f4dcc3b5aa765d61d8327deb882cf99\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "pl", - "prompt": "# You are given a word. Your task is to find the closest vowel that stands between \n# two consonants from the right side of the word (case sensitive).\n# Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n# find any vowel met the above condition. \n# You may assume that the given string contains English letter only.\n# Example:\n# >>> get_closest_vowel(\"yogurt\")\n# \"u\"\n# >>> get_closest_vowel(\"FULL\")\n# \"U\"\n# >>> get_closest_vowel(\"quick\")\n# \"\"\n# >>> get_closest_vowel(\"ab\")\n# \"\"\nsub get_closest_vowel {\n my($word) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&get_closest_vowel;\n if(eq_deeply($candidate->(\"yogurt\"),\"u\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"full\"),\"u\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"easy\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"eAsy\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ali\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"bad\"),\"a\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"most\"),\"o\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ab\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ba\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"quick\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"anime\"),\"i\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Asia\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Above\"),\"o\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "pl", - "prompt": "# Change numerical base of input number x to base.\n# return string representation after the conversion.\n# base numbers are less than 10.\n# >>> change_base(8, 3)\n# \"22\"\n# >>> change_base(8, 2)\n# \"1000\"\n# >>> change_base(7, 2)\n# \"111\"\nsub change_base {\n my($x, $base) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&change_base;\n if(eq_deeply($candidate->(8, 3),\"22\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(9, 3),\"100\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(234, 2),\"11101010\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(16, 2),\"10000\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8, 2),\"1000\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7, 2),\"111\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 3),\"2\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3, 4),\"3\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4, 5),\"4\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5, 6),\"5\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6, 7),\"6\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7, 8),\"7\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "pl", - "prompt": "# Check if in given list of numbers, are any two numbers closer to each other than\n# given threshold.\n# >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n# \"\"\n# >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n# 1\nsub has_close_elements {\n my($numbers, $threshold) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&has_close_elements;\n if(eq_deeply($candidate->([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 5.9, 4.0, 5.0], 0.95),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 5.9, 4.0, 5.0], 0.8),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.1, 2.2, 3.1, 4.1, 5.1], 1.0),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.1, 2.2, 3.1, 4.1, 5.1], 0.5),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "pl", - "prompt": "# Create a function that takes a string as input which contains only square brackets.\n# The function should return True if and only if there is a valid subsequence of brackets \n# where at least one bracket in the subsequence is nested.\n# >>> is_nested(\"[[]]\")\n# 1\n# >>> is_nested(\"[]]]]]]][[[[[]\")\n# \"\"\n# >>> is_nested(\"[][]\")\n# \"\"\n# >>> is_nested(\"[]\")\n# \"\"\n# >>> is_nested(\"[[][]]\")\n# 1\n# >>> is_nested(\"[[]][[\")\n# 1\nsub is_nested {\n my($string) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_nested;\n if(eq_deeply($candidate->(\"[[]]\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[]]]]]]][[[[[]\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[][]\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[]\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[[[[]]]]\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[]]]]]]]]]]\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[][][[]]\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[[]\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[]]\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[[]][[\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[[][]]\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"[[[[[[[[\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"]]]]]]]]\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "pl", - "prompt": "# Concatenate list of strings into a single string\n# >>> concatenate([])\n# \"\"\n# >>> concatenate([\"a\", \"b\", \"c\"])\n# \"abc\"\nsub concatenate {\n my($strings) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&concatenate;\n if(eq_deeply($candidate->([]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"x\", \"y\", \"z\"]),\"xyz\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"x\", \"y\", \"z\", \"w\", \"k\"]),\"xyzwk\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "pl", - "prompt": "# prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n# >>> prime_fib(1)\n# 2\n# >>> prime_fib(2)\n# 3\n# >>> prime_fib(3)\n# 5\n# >>> prime_fib(4)\n# 13\n# >>> prime_fib(5)\n# 89\nsub prime_fib {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&prime_fib;\n if(eq_deeply($candidate->(1),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4),13)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5),89)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6),233)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7),1597)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),28657)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(9),514229)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),433494437)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "pl", - "prompt": "# From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n# other and return them in order (smaller number, larger number).\n# >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n# [2.0, 2.2]\n# >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n# [2.0, 2.0]\nsub find_closest_elements {\n my($numbers) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&find_closest_elements;\n if(eq_deeply($candidate->([1.0, 2.0, 3.9, 4.0, 5.0, 2.2]),[3.9, 4.0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 5.9, 4.0, 5.0]),[5.0, 5.9])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]),[2.0, 2.2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]),[2.0, 2.0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.1, 2.2, 3.1, 4.1, 5.1]),[2.2, 3.1])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "pl", - "prompt": "# You have been tasked to write a function that receives \n# a hexadecimal number as a string and counts the number of hexadecimal \n# digits that are primes (prime number, or a prime, is a natural number \n# greater than 1 that is not a product of two smaller natural numbers).\n# Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n# Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n# So you have to determine a number of the following digits: 2, 3, 5, 7, \n# B (=decimal 11), D (=decimal 13).\n# Note: you may assume the input is always correct or empty string, \n# and symbols A,B,C,D,E,F are always uppercase.\n# Examples:\n# >>> hex_key(\"AB\")\n# 1\n# >>> hex_key(\"1077E\")\n# 2\n# >>> hex_key(\"ABED1A33\")\n# 4\n# >>> hex_key(\"123456789ABCDEF0\")\n# 6\n# >>> hex_key(\"2020\")\n# 2\nsub hex_key {\n my($num) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&hex_key;\n if(eq_deeply($candidate->(\"AB\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1077E\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"ABED1A33\"),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2020\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"123456789ABCDEF0\"),6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"112233445566778899AABBCCDDEEFF00\"),12)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "pl", - "prompt": "# Complete the function that takes two integers and returns \n# the product of their unit digits.\n# Assume the input is always valid.\n# Examples:\n# >>> multiply(148, 412)\n# 16\n# >>> multiply(19, 28)\n# 72\n# >>> multiply(2020, 1851)\n# 0\n# >>> multiply(14, -15)\n# 20\nsub multiply {\n my($a, $b) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&multiply;\n if(eq_deeply($candidate->(148, 412),16)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(19, 28),72)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2020, 1851),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(14, -15),20)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(76, 67),42)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(17, 27),49)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(0, 1),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(0, 0),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "pl", - "prompt": "# Given list of numbers (of at least two elements), apply a linear transform to that list,\n# such that the smallest number will become 0 and the largest will become 1\n# >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n# [0.0, 0.25, 0.5, 0.75, 1.0]\nsub rescale_to_unit {\n my($numbers) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&rescale_to_unit;\n if(eq_deeply($candidate->([2.0, 49.9]),[0.0, 1.0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([100.0, 49.9]),[1.0, 0.0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.0, 4.0, 5.0]),[0.0, 0.25, 0.5, 0.75, 1.0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2.0, 1.0, 5.0, 3.0, 4.0]),[0.25, 0.0, 1.0, 0.5, 0.75])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([12.0, 11.0, 15.0, 13.0, 14.0]),[0.25, 0.0, 1.0, 0.5, 0.75])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "pl", - "prompt": "# Given a positive integer n, return the product of the odd digits.\n# Return 0 if all digits are even.\n# For example:\n# >>> digits(1)\n# 1\n# >>> digits(4)\n# 0\n# >>> digits(235)\n# 15\nsub digits {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&digits;\n if(eq_deeply($candidate->(5),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(54),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(120),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5014),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(98765),315)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5576543),2625)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2468),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "pl", - "prompt": "# You will be given the name of a class (a string) and a list of extensions.\n# The extensions are to be used to load additional classes to the class. The\n# strength of the extension is as follows: Let CAP be the number of the uppercase\n# letters in the extension's name, and let SM be the number of lowercase letters \n# in the extension's name, the strength is given by the fraction CAP - SM. \n# You should find the strongest extension and return a string in this \n# format: ClassName.StrongestExtensionName.\n# If there are two or more extensions with the same strength, you should\n# choose the one that comes first in the list.\n# For example, if you are given \"Slices\" as the class and a list of the\n# extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n# return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n# (its strength is -1).\n# Example:\n# >>> Strongest_Extension(\"my_class\", [\"AA\", \"Be\", \"CC\"])\n# \"my_class.AA\"\nsub Strongest_Extension {\n my($class_name, $extensions) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&Strongest_Extension;\n if(eq_deeply($candidate->(\"Watashi\", [\"tEN\", \"niNE\", \"eIGHt8OKe\"]),\"Watashi.eIGHt8OKe\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Boku123\", [\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"]),\"Boku123.YEs.WeCaNe\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"__YESIMHERE\", [\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"]),\"__YESIMHERE.NuLl__\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"K\", [\"Ta\", \"TAR\", \"t234An\", \"cosSo\"]),\"K.TAR\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"__HAHA\", [\"Tab\", \"123\", \"781345\", \"-_-\"]),\"__HAHA.123\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"YameRore\", [\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"]),\"YameRore.okIWILL123\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"finNNalLLly\", [\"Die\", \"NowW\", \"Wow\", \"WoW\"]),\"finNNalLLly.WoW\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"_\", [\"Bb\", \"91245\"]),\"_.Bb\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Sp\", [\"671235\", \"Bb\"]),\"Sp.671235\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "pl", - "prompt": "# Given a string representing a space separated lowercase letters, return a dictionary\n# of the letter with the most repetition and containing the corresponding count.\n# If several letters have the same occurrence, return all of them.\n# Example:\n# >>> histogram(\"a b c\")\n# {\"a\" => 1, \"b\" => 1, \"c\" => 1}\n# >>> histogram(\"a b b a\")\n# {\"a\" => 2, \"b\" => 2}\n# >>> histogram(\"a b c a b\")\n# {\"a\" => 2, \"b\" => 2}\n# >>> histogram(\"b b b b a\")\n# {\"b\" => 4}\n# >>> histogram(\"\")\n# {}\nsub histogram {\n my($test) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&histogram;\n if(eq_deeply($candidate->(\"a b b a\"),{\"a\" => 2, \"b\" => 2})) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"a b c a b\"),{\"a\" => 2, \"b\" => 2})) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"a b c d g\"),{\"a\" => 1, \"b\" => 1, \"c\" => 1, \"d\" => 1, \"g\" => 1})) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"r t g\"),{\"r\" => 1, \"t\" => 1, \"g\" => 1})) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"b b b b a\"),{\"b\" => 4})) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"r t g\"),{\"r\" => 1, \"t\" => 1, \"g\" => 1})) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),{})) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"a\"),{\"a\" => 1})) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "pl", - "prompt": "# pairs_sum_to_zero takes a list of integers as an input.\n# it returns True if there are two distinct elements in the list that\n# sum to zero, and False otherwise.\n# >>> pairs_sum_to_zero([1, 3, 5, 0])\n# \"\"\n# >>> pairs_sum_to_zero([1, 3, -2, 1])\n# \"\"\n# >>> pairs_sum_to_zero([1, 2, 3, 7])\n# \"\"\n# >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7])\n# 1\n# >>> pairs_sum_to_zero([1])\n# \"\"\nsub pairs_sum_to_zero {\n my($l) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&pairs_sum_to_zero;\n if(eq_deeply($candidate->([1, 3, 5, 0]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, -2, 1]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 7]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, -5, 3, 5, 7]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-3, 9, -1, 3, 2, 30]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-3, 9, -1, 3, 2, 31]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-3, 9, -1, 4, 2, 30]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-3, 9, -1, 4, 2, 31]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "pl", - "prompt": "# Write a function that accepts two lists of strings and returns the list that has \n# total number of chars in the all strings of the list less than the other list.\n# if the two lists have the same number of chars, return the first list.\n# Examples\n# >>> total_match([], [])\n# []\n# >>> total_match([\"hi\", \"admin\"], [\"hI\", \"Hi\"])\n# [\"hI\", \"Hi\"]\n# >>> total_match([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"])\n# [\"hi\", \"admin\"]\n# >>> total_match([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"])\n# [\"hI\", \"hi\", \"hi\"]\n# >>> total_match([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"])\n# [\"4\"]\nsub total_match {\n my($lst1, $lst2) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&total_match;\n if(eq_deeply($candidate->([], []),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"hi\", \"admin\"], [\"hi\", \"hi\"]),[\"hi\", \"hi\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"]),[\"hi\", \"admin\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"]),[\"4\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"hi\", \"admin\"], [\"hI\", \"Hi\"]),[\"hI\", \"Hi\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"]),[\"hI\", \"hi\", \"hi\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hii\"]),[\"hi\", \"admin\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([], [\"this\"]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"this\"], []),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "pl", - "prompt": "# Circular shift the digits of the integer x, shift the digits right by shift\n# and return the result as a string.\n# If shift > number of digits, return digits reversed.\n# >>> circular_shift(12, 1)\n# \"21\"\n# >>> circular_shift(12, 2)\n# \"12\"\nsub circular_shift {\n my($x, $shift) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&circular_shift;\n if(eq_deeply($candidate->(100, 2),\"001\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12, 2),\"12\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(97, 8),\"79\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12, 1),\"21\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(11, 101),\"11\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "pl", - "prompt": "# Return True is list elements are monotonically increasing or decreasing.\n# >>> monotonic([1, 2, 4, 20])\n# 1\n# >>> monotonic([1, 20, 4, 10])\n# \"\"\n# >>> monotonic([4, 1, 0, -10])\n# 1\nsub monotonic {\n my($l) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&monotonic;\n if(eq_deeply($candidate->([1, 2, 4, 10]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 4, 20]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 20, 4, 10]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 1, 0, -10]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 1, 1, 0]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 2, 5, 60]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 5, 60]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([9, 9, 9, 9]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "pl", - "prompt": "# Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n# Example\n# >>> is_equal_to_sum_even(4)\n# \"\"\n# >>> is_equal_to_sum_even(6)\n# \"\"\n# >>> is_equal_to_sum_even(8)\n# 1\nsub is_equal_to_sum_even {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_equal_to_sum_even;\n if(eq_deeply($candidate->(4),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(11),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(13),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(16),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "pl", - "prompt": "# Input to this function is a string representing musical notes in a special ASCII format.\n# Your task is to parse this string and return list of integers corresponding to how many beats does each\n# not last.\n# Here is a legend:\n# 'o' - whole note, lasts four beats\n# 'o|' - half note, lasts two beats\n# '.|' - quater note, lasts one beat\n# >>> parse_music(\"o o| .| o| o| .| .| .| .| o o\")\n# [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\nsub parse_music {\n my($music_string) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&parse_music;\n if(eq_deeply($candidate->(\"\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"o o o o\"),[4, 4, 4, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\".| .| .| .|\"),[1, 1, 1, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"o| o| .| .| o o o o\"),[2, 2, 1, 1, 4, 4, 4, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"o| .| o| .| o o| o o|\"),[2, 1, 2, 1, 4, 2, 4, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "pl", - "prompt": "# \"\n# This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n# multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n# change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n# Examples:\n# >>> lst\n# [1, 2, 3]\n# >>> lst\n# []\n# >>> lst\n# [-1, -5, 2, -1, -5]\nsub sum_squares {\n my($lst) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sum_squares;\n if(eq_deeply($candidate->([1, 2, 3]),6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 4, 9]),14)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 1, 1, 1, 1, 1, 1, 1, 1]),9)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -1, -1, -1, -1, -1, -1, -1, -1]),-3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -5, 2, -1, -5]),-126)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-56, -99, 1, 0, -2]),3030)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, 0, 0, 0, 0, 0, 0, 0, -1]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37]),-14196)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10]),-1448)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "pl", - "prompt": "# triples_sum_to_zero takes a list of integers as an input.\n# it returns True if there are three distinct elements in the list that\n# sum to zero, and False otherwise.\n# >>> triples_sum_to_zero([1, 3, 5, 0])\n# \"\"\n# >>> triples_sum_to_zero([1, 3, -2, 1])\n# 1\n# >>> triples_sum_to_zero([1, 2, 3, 7])\n# \"\"\n# >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n# 1\n# >>> triples_sum_to_zero([1])\n# \"\"\nsub triples_sum_to_zero {\n my($l) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&triples_sum_to_zero;\n if(eq_deeply($candidate->([1, 3, 5, 0]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, 5, -1]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, -2, 1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 7]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 5, 7]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, -5, 3, 9, 7]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, 5, -100]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([100, 3, 5, -100]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "pl", - "prompt": "# brackets is a string of \"<\" and \">\".\n# return True if every opening bracket has a corresponding closing bracket.\n# >>> correct_bracketing(\"<\")\n# \"\"\n# >>> correct_bracketing(\"<>\")\n# 1\n# >>> correct_bracketing(\"<<><>>\")\n# 1\n# >>> correct_bracketing(\"><<>\")\n# \"\"\nsub correct_bracketing {\n my($brackets) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&correct_bracketing;\n if(eq_deeply($candidate->(\"<>\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<<><>>\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<><><<><>><>\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<><><<<><><>><>><<><><<>>>\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<<<><>>>>\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"><<>\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<<<<\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\">\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<<>\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<><><<><>><>><<>\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"<><><<><>><>>><>\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "pl", - "prompt": "# Write a function that takes an array of numbers as input and returns \n# the number of elements in the array that are greater than 10 and both \n# first and last digits of a number are odd (1, 3, 5, 7, 9).\n# For example:\n# >>> specialFilter([15, -73, 14, -15])\n# 1\n# >>> specialFilter([33, -2, -3, 45, 21, 109])\n# 2\nsub specialFilter {\n my($nums) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&specialFilter;\n if(eq_deeply($candidate->([5, -2, 1, -5]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([15, -73, 14, -15]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([33, -2, -3, 45, 21, 109]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([43, -12, 93, 125, 121, 109]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([71, -2, -33, 75, 21, 19]),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "pl", - "prompt": "# Given a dictionary, return True if all keys are strings in lower \n# case or all keys are strings in upper case, else return False.\n# The function should return False is the given dictionary is empty.\n# Examples:\n# >>> check_dict_case({\"a\" => \"apple\", \"b\" => \"banana\"})\n# 1\n# >>> check_dict_case({\"a\" => \"apple\", \"A\" => \"banana\", \"B\" => \"banana\"})\n# \"\"\n# >>> check_dict_case({\"a\" => \"apple\", 8 => \"banana\", \"a\" => \"apple\"})\n# \"\"\n# >>> check_dict_case({\"Name\" => \"John\", \"Age\" => \"36\", \"City\" => \"Houston\"})\n# \"\"\n# >>> check_dict_case({\"STATE\" => \"NC\", \"ZIP\" => \"12345\"})\n# 1\nsub check_dict_case {\n my($dict) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&check_dict_case;\n if(eq_deeply($candidate->({\"p\" => \"pineapple\", \"b\" => \"banana\"}),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->({\"p\" => \"pineapple\", \"A\" => \"banana\", \"B\" => \"banana\"}),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->({\"p\" => \"pineapple\", \"5\" => \"banana\", \"a\" => \"apple\"}),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->({\"Name\" => \"John\", \"Age\" => \"36\", \"City\" => \"Houston\"}),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->({\"STATE\" => \"NC\", \"ZIP\" => \"12345\"}),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->({\"fruit\" => \"Orange\", \"taste\" => \"Sweet\"}),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->({}),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "pl", - "prompt": "# Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n# should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n# alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n# Examples\n# >>> split_words(\"Hello world!\")\n# [\"Hello\", \"world!\"]\n# >>> split_words(\"Hello,world!\")\n# [\"Hello\", \"world!\"]\n# >>> split_words(\"abcdef\")\n# 3\nsub split_words {\n my($txt) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&split_words;\n if(eq_deeply($candidate->(\"Hello world!\"),[\"Hello\", \"world!\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hello,world!\"),[\"Hello\", \"world!\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hello world,!\"),[\"Hello\", \"world,!\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hello,Hello,world !\"),[\"Hello,Hello,world\", \"!\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdef\"),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aaabb\"),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aaaBb\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "pl", - "prompt": "# The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fibfib(0) == 0\n# fibfib(1) == 0\n# fibfib(2) == 1\n# fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n# Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n# >>> fibfib(1)\n# 0\n# >>> fibfib(5)\n# 4\n# >>> fibfib(8)\n# 24\nsub fibfib {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&fibfib;\n if(eq_deeply($candidate->(2),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(5),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(8),24)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),81)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(12),274)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(14),927)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "pl", - "prompt": "# You are given a list of numbers.\n# You need to return the sum of squared numbers in the given list,\n# round each element in the list to the upper int(Ceiling) first.\n# Examples:\n# >>> lst([1.0, 2.0, 3.0])\n# 14\n# >>> lst([1.0, 4.0, 9.0])\n# 98\n# >>> lst([1.0, 3.0, 5.0, 7.0])\n# 84\n# >>> lst([1.4, 4.2, 0.0])\n# 29\n# >>> lst([-2.4, 1.0, 1.0])\n# 6\nsub sum_squares {\n my($lst) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sum_squares;\n if(eq_deeply($candidate->([1.0, 2.0, 3.0]),14)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 2.0, 3.0]),14)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 3.0, 5.0, 7.0]),84)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.4, 4.2, 0.0]),29)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-2.4, 1.0, 1.0]),6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([100.0, 1.0, 15.0, 2.0]),10230)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([10000.0, 10000.0]),200000000)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1.4, 4.6, 6.3]),75)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1.4, 17.9, 18.9, 19.9]),1086)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0.0]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1.0]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1.0, 1.0, 0.0]),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_85_add", - "language": "pl", - "prompt": "# Given a non-empty list of integers lst. add the even elements that are at odd indices..\n# Examples:\n# >>> add([4, 2, 6, 7])\n# 2\nsub add {\n my($lst) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&add;\n if(eq_deeply($candidate->([4, 88]),88)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 5, 6, 7, 2, 122]),122)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 0, 6, 7]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([4, 4, 6, 8]),12)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "pl", - "prompt": "# Return sorted unique elements in a list\n# >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123])\n# [0, 2, 3, 5, 9, 123]\nsub unique {\n my($l) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&unique;\n if(eq_deeply($candidate->([5, 3, 5, 2, 3, 3, 9, 0, 123]),[0, 2, 3, 5, 9, 123])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "pl", - "prompt": "# Given a string text, replace all spaces in it with underscores, \n# and if a string has more than 2 consecutive spaces, \n# then replace all consecutive spaces with - \n# >>> fix_spaces(\" Example\")\n# \"Example\"\n# >>> fix_spaces(\" Example 1\")\n# \"Example_1\"\n# >>> fix_spaces(\" Example 2\")\n# \"_Example_2\"\n# >>> fix_spaces(\" Example 3\")\n# \"_Example-3\"\nsub fix_spaces {\n my($text) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&fix_spaces;\n if(eq_deeply($candidate->(\"Example\"),\"Example\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Mudasir Hanif \"),\"Mudasir_Hanif_\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Yellow Yellow Dirty Fellow\"),\"Yellow_Yellow__Dirty__Fellow\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Exa mple\"),\"Exa-mple\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\" Exa 1 2 2 mple\"),\"-Exa_1_2_2_mple\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "pl", - "prompt": "# Return 2^n modulo p (be aware of numerics).\n# >>> modp(3, 5)\n# 3\n# >>> modp(1101, 101)\n# 2\n# >>> modp(0, 101)\n# 1\n# >>> modp(3, 11)\n# 8\n# >>> modp(100, 101)\n# 1\nsub modp {\n my($n, $p) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&modp;\n if(eq_deeply($candidate->(3, 5),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1101, 101),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(0, 101),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3, 11),8)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(100, 101),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(30, 5),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(31, 5),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "pl", - "prompt": "# You have to write a function which validates a given date string and\n# returns True if the date is valid otherwise False.\n# The date is valid if all of the following rules are satisfied:\n# 1. The date string is not empty.\n# 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n# 3. The months should not be less than 1 or higher than 12.\n# 4. The date should be in the format: mm-dd-yyyy\n# >>> valid_date(\"03-11-2000\")\n# 1\n# >>> valid_date(\"15-01-2012\")\n# \"\"\n# >>> valid_date(\"04-0-2040\")\n# \"\"\n# >>> valid_date(\"06-04-2020\")\n# 1\n# >>> valid_date(\"06/04/2020\")\n# \"\"\nsub valid_date {\n my($date) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&valid_date;\n if(eq_deeply($candidate->(\"03-11-2000\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"15-01-2012\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"04-0-2040\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"06-04-2020\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"01-01-2007\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"03-32-2011\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"04-31-3000\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"06-06-2005\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"21-31-2000\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"04-12-2003\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"04122003\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"20030412\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2003-04\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"2003-04-12\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"04-2003\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "pl", - "prompt": "# Write a function that takes a string and returns an ordered version of it.\n# Ordered version of string, is a string where all words (separated by space)\n# are replaced by a new word where all the characters arranged in\n# ascending order based on ascii value.\n# Note: You should keep the order of words and blank spaces in the sentence.\n# For example:\n# >>> anti_shuffle(\"Hi\")\n# \"Hi\"\n# >>> anti_shuffle(\"hello\")\n# \"ehllo\"\n# >>> anti_shuffle(\"Hello World!!!\")\n# \"Hello !!!Wdlor\"\nsub anti_shuffle {\n my($s) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&anti_shuffle;\n if(eq_deeply($candidate->(\"Hi\"),\"Hi\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"hello\"),\"ehllo\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"number\"),\"bemnru\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcd\"),\"abcd\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hello World!!!\"),\"Hello !!!Wdlor\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hi. My name is Mister Robot. How are you?\"),\".Hi My aemn is Meirst .Rboot How aer ?ouy\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "pl", - "prompt": "# Given a list of numbers, return whether or not they are sorted\n# in ascending order. If list has more than 1 duplicate of the same\n# number, return False. Assume no negative numbers and only integers.\n# Examples\n# >>> is_sorted([5])\n# 1\n# >>> is_sorted([1, 2, 3, 4, 5])\n# 1\n# >>> is_sorted([1, 3, 2, 4, 5])\n# \"\"\n# >>> is_sorted([1, 2, 3, 4, 5, 6])\n# 1\n# >>> is_sorted([1, 2, 3, 4, 5, 6, 7])\n# 1\n# >>> is_sorted([1, 3, 2, 4, 5, 6, 7])\n# \"\"\n# >>> is_sorted([1, 2, 2, 3, 3, 4])\n# 1\n# >>> is_sorted([1, 2, 2, 2, 3, 4])\n# \"\"\nsub is_sorted {\n my($lst) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_sorted;\n if(eq_deeply($candidate->([5]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 5]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, 2, 4, 5]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 5, 6]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 5, 6, 7]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, 2, 4, 5, 6, 7]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 1]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 2, 2, 3, 4]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 3, 3, 4]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 2, 3, 3, 4]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "pl", - "prompt": "# You are given a string s.\n# Your task is to check if the string is happy or not.\n# A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n# For example:\n# >>> is_happy(\"a\")\n# \"\"\n# >>> is_happy(\"aa\")\n# \"\"\n# >>> is_happy(\"abcd\")\n# 1\n# >>> is_happy(\"aabb\")\n# \"\"\n# >>> is_happy(\"adb\")\n# 1\n# >>> is_happy(\"xyy\")\n# \"\"\nsub is_happy {\n my($s) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&is_happy;\n if(eq_deeply($candidate->(\"a\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aa\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcd\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aabb\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"adb\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"xyy\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"iopaxpoi\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"iopaxioi\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "pl", - "prompt": "# Write a function that returns True if the object q will fly, and False otherwise.\n# The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n# Example:\n# >>> will_it_fly([1, 2], 5)\n# \"\"\n# # 1+2 is less than the maximum possible weight, but it's unbalanced.\n# >>> will_it_fly([3, 2, 3], 1)\n# \"\"\n# # it's balanced, but 3+2+3 is more than the maximum possible weight.\n# >>> will_it_fly([3, 2, 3], 9)\n# 1\n# # 3+2+3 is less than the maximum possible weight, and it's balanced.\n# >>> will_it_fly([3], 5)\n# 1\n# # 3 is less than the maximum possible weight, and it's balanced.\nsub will_it_fly {\n my($q, $w) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&will_it_fly;\n if(eq_deeply($candidate->([3, 2, 3], 9),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2], 5),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3], 5),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 2, 3], 1),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3], 6),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5], 5),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "pl", - "prompt": "# Given an array of non-negative integers, return a copy of the given array after sorting,\n# you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n# or sort it in descending order if the sum( first index value, last index value) is even.\n# Note:\n# * don't change the given array.\n# Examples:\n# >>> sort_array([])\n# []\n# >>> sort_array([5])\n# [5]\n# >>> sort_array([2, 4, 3, 0, 1, 5])\n# [0, 1, 2, 3, 4, 5]\n# >>> sort_array([2, 4, 3, 0, 1, 5, 6])\n# [6, 5, 4, 3, 2, 1, 0]\nsub sort_array {\n my($array) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sort_array;\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([5]),[5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, 3, 0, 1, 5]),[0, 1, 2, 3, 4, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 4, 3, 0, 1, 5, 6]),[6, 5, 4, 3, 2, 1, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([2, 1]),[1, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([15, 42, 87, 32, 11, 0]),[0, 11, 15, 32, 42, 87])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([21, 14, 23, 11]),[23, 21, 14, 11])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "pl", - "prompt": "# Implement a function that takes an non-negative integer and returns an array of the first n\n# integers that are prime numbers and less than n.\n# for example:\n# >>> count_up_to(5)\n# [2, 3]\n# >>> count_up_to(11)\n# [2, 3, 5, 7]\n# >>> count_up_to(0)\n# []\n# >>> count_up_to(20)\n# [2, 3, 5, 7, 11, 13, 17, 19]\n# >>> count_up_to(1)\n# []\n# >>> count_up_to(18)\n# [2, 3, 5, 7, 11, 13, 17]\nsub count_up_to {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&count_up_to;\n if(eq_deeply($candidate->(5),[2, 3])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(6),[2, 3, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7),[2, 3, 5])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10),[2, 3, 5, 7])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(0),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(22),[2, 3, 5, 7, 11, 13, 17, 19])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(18),[2, 3, 5, 7, 11, 13, 17])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(47),[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(101),[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "pl", - "prompt": "# Out of list of strings, return the longest one. Return the first one in case of multiple\n# strings of the same length. Return None in case the input list is empty.\n# >>> longest([])\n# undef\n# >>> longest([\"a\", \"b\", \"c\"])\n# \"a\"\n# >>> longest([\"a\", \"bb\", \"ccc\"])\n# \"ccc\"\nsub longest {\n my($strings) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&longest;\n if(eq_deeply($candidate->([]),undef)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"x\", \"y\", \"z\"]),\"x\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"]),\"zzzz\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "pl", - "prompt": "# Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n# reverse the resulting array, and then replace each digit by its corresponding name from\n# \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n# For example:\n# >>> by_length([2, 1, 1, 4, 5, 8, 2, 3])\n# [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n# If the array is empty, return an empty array:\n# >>> by_length([])\n# []\n# If the array has any strange number ignore it:\n# >>> by_length([1, -1, 55])\n# [\"One\"]\nsub by_length {\n my($arr) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&by_length;\n if(eq_deeply($candidate->([2, 1, 1, 4, 5, 8, 2, 3]),[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([]),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, -1, 55]),[\"One\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, -1, 3, 2]),[\"Three\", \"Two\", \"One\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([9, 4, 8]),[\"Nine\", \"Eight\", \"Four\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_106_f", - "language": "pl", - "prompt": "# Implement the function f that takes n as a parameter,\n# 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\n# or the sum of numbers from 1 to i otherwise.\n# i starts from 1.\n# the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n# Example:\n# >>> f(5)\n# [1, 2, 6, 24, 15]\nsub f {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&f;\n if(eq_deeply($candidate->(5),[1, 2, 6, 24, 15])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(7),[1, 2, 6, 24, 15, 720, 28])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),[1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(3),[1, 2, 6])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "pl", - "prompt": "# Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n# >>> fizz_buzz(50)\n# 0\n# >>> fizz_buzz(78)\n# 2\n# >>> fizz_buzz(79)\n# 3\nsub fizz_buzz {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&fizz_buzz;\n if(eq_deeply($candidate->(50),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(78),2)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(79),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(100),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(200),6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4000),192)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10000),639)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(100000),8026)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "pl", - "prompt": "# Given a positive floating point number, it can be decomposed into\n# and integer part (largest integer smaller than given number) and decimals\n# (leftover part always smaller than 1).\n# Return the decimal part of the number.\n# >>> truncate_number(3.5)\n# 0.5\nsub truncate_number {\n my($number) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&truncate_number;\n if(eq_deeply($candidate->(3.5),0.5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1.25),0.25)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(123.0),0.0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "pl", - "prompt": "# For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n# Empty sum should be equal to 0 and empty product should be equal to 1.\n# >>> sum_product([])\n# [0, 1]\n# >>> sum_product([1, 2, 3, 4])\n# [10, 24]\nsub sum_product {\n my($numbers) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&sum_product;\n if(eq_deeply($candidate->([]),[0, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 1, 1]),[3, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([100, 0]),[100, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 5, 7]),[15, 105])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([10]),[10, 10])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "pl", - "prompt": "# You are given a 2 dimensional data, as a nested lists,\n# which is similar to matrix, however, unlike matrices,\n# each row may contain a different number of columns.\n# Given lst, and integer x, find integers x in the list,\n# and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n# each tuple is a coordinate - (row, columns), starting with 0.\n# Sort coordinates initially by rows in ascending order.\n# Also, sort coordinates of the row by columns in descending order.\n# Examples:\n# >>> get_row([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1)\n# [[0, 0], [1, 4], [1, 0], [2, 5], [2, 0]]\n# >>> get_row([], 1)\n# []\n# >>> get_row([[], [1], [1, 2, 3]], 3)\n# [[2, 2]]\nsub get_row {\n my($lst, $x) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&get_row;\n if(eq_deeply($candidate->([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1),[[0, 0], [1, 4], [1, 0], [2, 5], [2, 0]])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6]], 2),[[0, 1], [1, 1], [2, 1], [3, 1], [4, 1], [5, 1]])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 1, 3, 4, 5, 6], [1, 2, 1, 4, 5, 6], [1, 2, 3, 1, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1),[[0, 0], [1, 0], [2, 1], [2, 0], [3, 2], [3, 0], [4, 3], [4, 0], [5, 4], [5, 0], [6, 5], [6, 0]])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([], 1),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[1]], 2),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([[], [1], [1, 2, 3]], 3),[[2, 2]])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "pl", - "prompt": "# You're a hungry rabbit, and you already have eaten a certain number of carrots,\n# but now you need to eat more carrots to complete the day's meals.\n# you should return an array of [ total number of eaten carrots after your meals,\n# the number of carrots left after your meals ]\n# if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n# Example:\n# >>> eat(5, 6, 10)\n# [11, 4]\n# >>> eat(4, 8, 9)\n# [12, 1]\n# >>> eat(1, 10, 10)\n# [11, 0]\n# >>> eat(2, 11, 5)\n# [7, 0]\n# Variables:\n# @number : integer\n# the number of carrots that you have eaten.\n# @need : integer\n# the number of carrots that you need to eat.\n# @remaining : integer\n# the number of remaining carrots thet exist in stock\n# Constrain:\n# * 0 <= number <= 1000\n# * 0 <= need <= 1000\n# * 0 <= remaining <= 1000\n# Have fun :)\nsub eat {\n my($number, $need, $remaining) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&eat;\n if(eq_deeply($candidate->(5, 6, 10),[11, 4])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4, 8, 9),[12, 1])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 10, 10),[11, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 11, 5),[7, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4, 5, 7),[9, 2])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4, 5, 1),[5, 0])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "pl", - "prompt": "# Given a positive integer N, return the total sum of its digits in binary.\n# Example\n# >>> solve(1000)\n# \"1\"\n# >>> solve(150)\n# \"110\"\n# >>> solve(147)\n# \"1100\"\n# Variables:\n# @N integer\n# Constraints: 0 \u2264 N \u2264 10000.\n# Output:\n# a string of binary number\nsub solve {\n my($N) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&solve;\n if(eq_deeply($candidate->(1000),\"1\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(150),\"110\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(147),\"1100\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(333),\"1001\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(963),\"10010\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "pl", - "prompt": "# You are given a list of integers.\n# You need to find the largest prime value and return the sum of its digits.\n# Examples:\n# >>> skjkasdkd([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3])\n# 10\n# >>> skjkasdkd([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1])\n# 25\n# >>> skjkasdkd([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3])\n# 13\n# >>> skjkasdkd([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6])\n# 11\n# >>> skjkasdkd([0, 81, 12, 3, 1, 21])\n# 3\n# >>> skjkasdkd([0, 8, 1, 2, 1, 7])\n# 7\nsub skjkasdkd {\n my($lst) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&skjkasdkd;\n if(eq_deeply($candidate->([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]),10)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]),25)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]),13)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]),11)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 81, 12, 3, 1, 21]),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 8, 1, 2, 1, 7]),7)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([8191]),19)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([8191, 123456, 127, 7]),19)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([127, 97, 8192]),10)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "pl", - "prompt": "# Given an array arr of integers, find the minimum number of elements that\n# need to be changed to make the array palindromic. A palindromic array is an array that\n# is read the same backwards and forwards. In one change, you can change one element to any other element.\n# For example:\n# >>> smallest_change([1, 2, 3, 5, 4, 7, 9, 6])\n# 4\n# >>> smallest_change([1, 2, 3, 4, 3, 2, 2])\n# 1\n# >>> smallest_change([1, 2, 3, 2, 1])\n# 0\nsub smallest_change {\n my($arr) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&smallest_change;\n if(eq_deeply($candidate->([1, 2, 3, 5, 4, 7, 9, 6]),4)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 4, 3, 2, 2]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 4, 2]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 4, 4, 2]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, 3, 2, 1]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([3, 1, 1, 3]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 1]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "pl", - "prompt": "# It is the last week of the semester and the teacher has to give the grades\n# to students. The teacher has been making her own algorithm for grading.\n# The only problem is, she has lost the code she used for grading.\n# She has given you a list of GPAs for some students and you have to write \n# a function that can output a list of letter grades using the following table:\n# GPA | Letter grade\n# 4.0 A+\n# > 3.7 A \n# > 3.3 A- \n# > 3.0 B+\n# > 2.7 B \n# > 2.3 B-\n# > 2.0 C+\n# > 1.7 C\n# > 1.3 C-\n# > 1.0 D+ \n# > 0.7 D \n# > 0.0 D-\n# 0.0 E\n# Example:\n# >>> grade_equation([4.0, 3, 1.7, 2, 3.5])\n# [\"A+\", \"B\", \"C-\", \"C\", \"A-\"]\nsub numerical_letter_grade {\n my($grades) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&numerical_letter_grade;\n if(eq_deeply($candidate->([4.0, 3, 1.7, 2, 3.5]),[\"A+\", \"B\", \"C-\", \"C\", \"A-\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.2]),[\"D+\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0.5]),[\"D-\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0.0]),[\"E\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1.0, 0.3, 1.5, 2.8, 3.3]),[\"D\", \"D-\", \"C-\", \"B\", \"B+\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0.0, 0.7]),[\"E\", \"D-\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "pl", - "prompt": "# Given the lengths of the three sides of a triangle. Return the area of\n# the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n# Otherwise return -1\n# Three sides make a valid triangle when the sum of any two sides is greater \n# than the third side.\n# Example:\n# >>> triangle_area(3, 4, 5)\n# 6.0\n# >>> triangle_area(1, 2, 10)\n# -1\nsub triangle_area {\n my($a, $b, $c) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&triangle_area;\n if(eq_deeply($candidate->(3, 4, 5),6.0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 2, 10),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4, 8, 5),8.18)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 2, 2),1.73)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 2, 3),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(10, 5, 7),16.25)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 6, 3),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1, 1, 1),0.43)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(2, 2, 10),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "pl", - "prompt": "# Check if two words have the same characters.\n# >>> same_chars(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\")\n# 1\n# >>> same_chars(\"abcd\", \"dddddddabc\")\n# 1\n# >>> same_chars(\"dddddddabc\", \"abcd\")\n# 1\n# >>> same_chars(\"eabcd\", \"dddddddabc\")\n# \"\"\n# >>> same_chars(\"abcd\", \"dddddddabce\")\n# \"\"\n# >>> same_chars(\"eabcdzzzz\", \"dddzzzzzzzddddabc\")\n# \"\"\nsub same_chars {\n my($s0, $s1) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&same_chars;\n if(eq_deeply($candidate->(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcd\", \"dddddddabc\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"dddddddabc\", \"abcd\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"eabcd\", \"dddddddabc\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcd\", \"dddddddabcf\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"eabcdzzzz\", \"dddzzzzzzzddddabc\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aabb\", \"aaccc\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "pl", - "prompt": "# Given an array of integers nums, find the minimum sum of any non-empty sub-array\n# of nums.\n# Example\n# >>> minSubArraySum([2, 3, 4, 1, 2, 4])\n# 1\n# >>> minSubArraySum([-1, -2, -3])\n# -6\nsub minSubArraySum {\n my($nums) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&minSubArraySum;\n if(eq_deeply($candidate->([2, 3, 4, 1, 2, 4]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -2, -3]),-6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -2, -3, 2, -10]),-14)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-9999999999999999]),-9999999999999999)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([0, 10, 20, 1000000]),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, -2, -3, 10, -5]),-6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([100, -1, -2, -3, 10, -5]),-6)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([10, 11, 13, 8, 3, 4]),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([100, -33, 32, -1, 0, -2]),-33)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-10]),-10)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([7]),7)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, -1]),-1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "pl", - "prompt": "# Given a string s and a natural number n, you have been tasked to implement \n# a function that returns a list of all words from string s that contain exactly \n# n consonants, in order these words appear in the string s.\n# If the string s is empty then the function should return an empty list.\n# Note: you may assume the input string contains only letters and spaces.\n# Examples:\n# >>> select_words(\"Mary had a little lamb\", 4)\n# [\"little\"]\n# >>> select_words(\"Mary had a little lamb\", 3)\n# [\"Mary\", \"lamb\"]\n# >>> select_words(\"simple white space\", 2)\n# []\n# >>> select_words(\"Hello world\", 4)\n# [\"world\"]\n# >>> select_words(\"Uncle sam\", 3)\n# [\"Uncle\"]\nsub select_words {\n my($s, $n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&select_words;\n if(eq_deeply($candidate->(\"Mary had a little lamb\", 4),[\"little\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Mary had a little lamb\", 3),[\"Mary\", \"lamb\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"simple white space\", 2),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Hello world\", 4),[\"world\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Uncle sam\", 3),[\"Uncle\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"\", 4),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"a b c d e f\", 1),[\"b\", \"c\", \"d\", \"f\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "pl", - "prompt": "# Return list of all prefixes from shortest to longest of the input string\n# >>> all_prefixes(\"abc\")\n# [\"a\", \"ab\", \"abc\"]\nsub all_prefixes {\n my($string) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&all_prefixes;\n if(eq_deeply($candidate->(\"\"),[])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"asdfgh\"),[\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"WWW\"),[\"W\", \"WW\", \"WWW\"])) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "pl", - "prompt": "# Create a function that takes a value (string) representing a number\n# and returns the closest integer to it. If the number is equidistant\n# from two integers, round it away from zero.\n# Examples\n# >>> closest_integer(\"10\")\n# 10\n# >>> closest_integer(\"15.3\")\n# 15\n# Note:\n# Rounding away from zero means that if the given number is equidistant\n# from two integers, the one you should return is the one that is the\n# farthest from zero. For example closest_integer(\"14.5\") should\n# return 15 and closest_integer(\"-14.5\") should return -15.\nsub closest_integer {\n my($value) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&closest_integer;\n if(eq_deeply($candidate->(\"10\"),10)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"14.5\"),15)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"-15.5\"),-16)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"15.3\"),15)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"0\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "pl", - "prompt": "# Create a function which takes a string representing a file's name, and returns\n# 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n# A file's name is considered to be valid if and only if all the following conditions \n# are met:\n# - There should not be more than three digits ('0'-'9') in the file's name.\n# - The file's name contains exactly one dot '.'\n# - The substring before the dot should not be empty, and it starts with a letter from \n# the latin alphapet ('a'-'z' and 'A'-'Z').\n# - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n# Examples:\n# >>> file_name_check(\"example.txt\")\n# \"Yes\"\n# >>> file_name_check(\"1example.dll\")\n# \"No\"\nsub file_name_check {\n my($file_name) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&file_name_check;\n if(eq_deeply($candidate->(\"example.txt\"),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1example.dll\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"s1sdf3.asd\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"K.dll\"),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"MY16FILE3.exe\"),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"His12FILE94.exe\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"_Y.txt\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"?aREYA.exe\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"/this_is_valid.dll\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"this_is_valid.wow\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"this_is_valid.txt\"),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"this_is_valid.txtexe\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"#this2_i4s_5valid.ten\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"@this1_is6_valid.exe\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"this_is_12valid.6exe4.txt\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"all.exe.txt\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"I563_No.exe\"),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Is3youfault.txt\"),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"no_one#knows.dll\"),\"Yes\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"1I563_Yes3.exe\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"I563_Yes3.txtt\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"final..txt\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"final132\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"_f4indsartal132.\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\".txt\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"s.\"),\"No\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "pl", - "prompt": "# You are given two intervals,\n# where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n# The given intervals are closed which means that the interval (start, end)\n# includes both start and end.\n# For each given interval, it is assumed that its start is less or equal its end.\n# Your task is to determine whether the length of intersection of these two \n# intervals is a prime number.\n# Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n# which its length is 1, which not a prime number.\n# If the length of the intersection is a prime number, return \"YES\",\n# otherwise, return \"NO\".\n# If the two intervals don't intersect, return \"NO\".\n# [input/output] samples:\n# >>> intersection([1, 2], [2, 3])\n# \"NO\"\n# >>> intersection([-1, 1], [0, 4])\n# \"NO\"\n# >>> intersection([-3, -1], [-5, 5])\n# \"YES\"\nsub intersection {\n my($interval1, $interval2) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&intersection;\n if(eq_deeply($candidate->([1, 2], [2, 3]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-1, 1], [0, 4]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-3, -1], [-5, 5]),\"YES\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-2, 2], [-4, 0]),\"YES\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-11, 2], [-1, -1]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2], [3, 5]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2], [1, 2]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([-2, -2], [-3, -2]),\"NO\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "pl", - "prompt": "# Return the largest prime factor of n. Assume n > 1 and is not a prime.\n# >>> largest_prime_factor(13195)\n# 29\n# >>> largest_prime_factor(2048)\n# 2\nsub largest_prime_factor {\n my($n) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&largest_prime_factor;\n if(eq_deeply($candidate->(15),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(27),3)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(63),7)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(330),11)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(13195),29)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "pl", - "prompt": "# Given a string, find out how many distinct characters (regardless of case) does it consist of\n# >>> count_distinct_characters(\"xyzXYZ\")\n# 3\n# >>> count_distinct_characters(\"Jerry\")\n# 4\nsub count_distinct_characters {\n my($string) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&count_distinct_characters;\n if(eq_deeply($candidate->(\"\"),0)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcde\"),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"abcdecadeCADE\"),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"aaaaAAAAaaaa\"),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"Jerry jERRY JeRRRY\"),5)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "pl", - "prompt": "# You're given a list of deposit and withdrawal operations on a bank account that starts with\n# zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n# at that point function should return True. Otherwise it should return False.\n# >>> below_zero([1, 2, 3])\n# \"\"\n# >>> below_zero([1, 2, -4, 5])\n# 1\nsub below_zero {\n my($operations) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&below_zero;\n if(eq_deeply($candidate->([]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, -3, 1, 2, -3]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, 2, -4, 5, 6]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, -1, 2, -2, 5, -5, 4, -4]),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, -1, 2, -2, 5, -5, 4, -5]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->([1, -2, 2, -2, 5, -5, 4, -4]),1)) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "pl", - "prompt": "# Find the shortest palindrome that begins with a supplied string.\n# Algorithm idea is simple:\n# - Find the longest postfix of supplied string that is a palindrome.\n# - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n# >>> make_palindrome(\"\")\n# \"\"\n# >>> make_palindrome(\"cat\")\n# \"catac\"\n# >>> make_palindrome(\"cata\")\n# \"catac\"\nsub make_palindrome {\n my($string) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&make_palindrome;\n if(eq_deeply($candidate->(\"\"),\"\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"x\"),\"x\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"xyz\"),\"xyzyx\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"xyx\"),\"xyx\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(\"jerry\"),\"jerryrrej\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "pl", - "prompt": "# Given a positive integer, obtain its roman numeral equivalent as a string,\n# and return it in lowercase.\n# Restrictions: 1 <= num <= 1000\n# Examples:\n# >>> int_to_mini_roman(19)\n# \"xix\"\n# >>> int_to_mini_roman(152)\n# \"clii\"\n# >>> int_to_mini_roman(426)\n# \"cdxxvi\"\nsub int_to_mini_roman {\n my($number) = @_;\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "use Test::Deep;\n\n\nsub testhumaneval {\n my $candidate = \\&int_to_mini_roman;\n if(eq_deeply($candidate->(19),\"xix\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(152),\"clii\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(251),\"ccli\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(426),\"cdxxvi\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(500),\"d\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1),\"i\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(4),\"iv\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(43),\"xliii\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(90),\"xc\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(94),\"xciv\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(532),\"dxxxii\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(900),\"cm\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(994),\"cmxciv\")) {\n print \"ok!\" }else{\n exit 1;\n }\n if(eq_deeply($candidate->(1000),\"m\")) {\n print \"ok!\" }else{\n exit 1;\n }\n}\n\ntesthumaneval();", - "stop_tokens": [ - "\nsub", - "\n#", - "\n\n" - ] - } -] \ No newline at end of file diff --git a/data/py-keep.json b/data/py-keep.json deleted file mode 100644 index 2aaf492014482d27db58259129661864802e659b..0000000000000000000000000000000000000000 --- a/data/py-keep.json +++ /dev/null @@ -1,2417 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "py", - "prompt": "def largest_divisor(n: int) -> int:\n \"\"\" For a given number n, find the largest number that divides n evenly, smaller than n\n >>> largest_divisor(15)\n 5\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(3) == 1\n assert candidate(7) == 1\n assert candidate(10) == 5\n assert candidate(100) == 50\n assert candidate(49) == 7\n\ndef test_check():\n check(largest_divisor)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_47_median", - "language": "py", - "prompt": "from typing import List\n\ndef median(l: List[int]) -> float:\n \"\"\"Return median of elements in the list l.\n >>> median([3, 1, 2, 4, 5])\n 3\n >>> median([-10, 4, 6, 1000, 10, 20])\n 15.0\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([3, 1, 2, 4, 5]) == 3\n assert candidate([-10, 4, 6, 1000, 10, 20]) == 8.0\n assert candidate([5]) == 5\n assert candidate([6, 5]) == 5.5\n assert candidate([8, 1, 3, 9, 9, 2, 7]) == 7\n\ndef test_check():\n check(median)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "py", - "prompt": "from typing import List\n\ndef do_algebra(operator: List[str], operand: List[int]) -> int:\n \"\"\"\n Given two lists operator, and operand. The first list has basic algebra operations, and \n the second list is a list of integers. Use the two given lists to build the algebric \n expression and return the evaluation of this expression.\n\n The basic algebra operations:\n Addition ( + ) \n Subtraction ( - ) \n Multiplication ( * ) \n Floor division ( // ) \n Exponentiation ( ** ) \n\n Example:\n operator['+', '*', '-']\n array = [2, 3, 4, 5]\n result = 2 + 3 * 4 - 5\n => result = 9\n\n Note:\n The length of operator list is equal to the length of operand list minus one.\n Operand is a list of of non-negative integers.\n Operator list has at least one operator, and operand list has at least two operands.\n\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(['**', '*', '+'], [2, 3, 4, 5]) == 37\n assert candidate(['+', '*', '-'], [2, 3, 4, 5]) == 9\n assert candidate(['//', '*'], [7, 3, 4]) == 8\n\ndef test_check():\n check(do_algebra)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "py", - "prompt": "from typing import List\n\ndef max_element(l: List[int]) -> int:\n \"\"\"Return maximum element in the list.\n >>> max_element([1, 2, 3])\n 3\n >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n 123\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 3]) == 3\n assert candidate([5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]) == 124\n\ndef test_check():\n check(max_element)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "py", - "prompt": "from typing import List\n\ndef can_arrange(arr: List[int]) -> int:\n \"\"\"Create a function which returns the largest index of an element which\n is not greater than or equal to the element immediately preceding it. If\n no such element exists then return -1. The given array will not contain\n duplicate values.\n\n Examples:\n can_arrange([1,2,4,3,5]) = 3\n can_arrange([1,2,3]) = -1\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 4, 3, 5]) == 3\n assert candidate([1, 2, 4, 5]) == -1\n assert candidate([1, 4, 2, 5, 6, 7, 8, 9, 10]) == 2\n assert candidate([4, 8, 5, 7, 3]) == 4\n assert candidate([]) == -1\n\ndef test_check():\n check(can_arrange)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "py", - "prompt": "def car_race_collision(n: int) -> int:\n \"\"\"\n Imagine a road that's a perfectly straight infinitely long line.\n n cars are driving left to right; simultaneously, a different set of n cars\n are driving right to left. The two sets of cars start out being very far from\n each other. All cars move in the same speed. Two cars are said to collide\n when a car that's moving left to right hits a car that's moving right to left.\n However, the cars are infinitely sturdy and strong; as a result, they continue moving\n in their trajectory as if they did not collide.\n\n This function outputs the number of such collisions.\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(2) == 4\n assert candidate(3) == 9\n assert candidate(4) == 16\n assert candidate(8) == 64\n assert candidate(10) == 100\n\ndef test_check():\n check(car_race_collision)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "py", - "prompt": "def check_if_last_char_is_a_letter(txt: str) -> bool:\n \"\"\"\n Create a function that returns True if the last character\n of a given string is an alphabetical character and is not\n a part of a word, and False otherwise.\n Note: \"word\" is a group of characters separated by space.\n\n Examples:\n check_if_last_char_is_a_letter(\"apple pie\") \u279e False\n check_if_last_char_is_a_letter(\"apple pi e\") \u279e True\n check_if_last_char_is_a_letter(\"apple pi e \") \u279e False\n check_if_last_char_is_a_letter(\"\") \u279e False \n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('apple') == False\n assert candidate('apple pi e') == True\n assert candidate('eeeee') == False\n assert candidate('A') == True\n assert candidate('Pumpkin pie ') == False\n assert candidate('Pumpkin pie 1') == False\n assert candidate('') == False\n assert candidate('eeeee e ') == False\n assert candidate('apple pie') == False\n assert candidate('apple pi e ') == False\n\ndef test_check():\n check(check_if_last_char_is_a_letter)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "py", - "prompt": "def is_prime(n: int) -> bool:\n \"\"\"Return true if a given number is prime, and false otherwise.\n >>> is_prime(6)\n False\n >>> is_prime(101)\n True\n >>> is_prime(11)\n True\n >>> is_prime(13441)\n True\n >>> is_prime(61)\n True\n >>> is_prime(4)\n False\n >>> is_prime(1)\n False\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(6) == False\n assert candidate(101) == True\n assert candidate(11) == True\n assert candidate(13441) == True\n assert candidate(61) == True\n assert candidate(4) == False\n assert candidate(1) == False\n assert candidate(5) == True\n assert candidate(11) == True\n assert candidate(17) == True\n assert candidate(85) == False\n assert candidate(77) == False\n assert candidate(255379) == False\n\ndef test_check():\n check(is_prime)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "py", - "prompt": "from typing import List\n\ndef unique_digits(x: List[int]) -> List[int]:\n \"\"\"Given a list of positive integers x. return a sorted list of all \n elements that hasn't any even digit.\n\n Note: Returned list should be sorted in increasing order.\n \n For example:\n >>> unique_digits([15, 33, 1422, 1])\n [1, 15, 33]\n >>> unique_digits([152, 323, 1422, 10])\n []\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([15, 33, 1422, 1]) == [1, 15, 33]\n assert candidate([152, 323, 1422, 10]) == []\n assert candidate([12345, 2033, 111, 151]) == [111, 151]\n assert candidate([135, 103, 31]) == [31, 135]\n\ndef test_check():\n check(unique_digits)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "py", - "prompt": "def string_xor(a: str, b: str) -> str:\n \"\"\" Input are two strings a and b consisting only of 1s and 0s.\n Perform binary XOR on these inputs and return result also as a string.\n >>> string_xor('010', '110')\n '100'\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('111000', '101010') == '010010'\n assert candidate('1', '1') == '0'\n assert candidate('0101', '0000') == '0101'\n\ndef test_check():\n check(string_xor)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "py", - "prompt": "def sum_to_n(n: int) -> int:\n \"\"\"sum_to_n is a function that sums numbers from 1 to n.\n >>> sum_to_n(30)\n 465\n >>> sum_to_n(100)\n 5050\n >>> sum_to_n(5)\n 15\n >>> sum_to_n(10)\n 55\n >>> sum_to_n(1)\n 1\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(1) == 1\n assert candidate(6) == 21\n assert candidate(11) == 66\n assert candidate(30) == 465\n assert candidate(100) == 5050\n\ndef test_check():\n check(sum_to_n)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "py", - "prompt": "from typing import List\n\ndef double_the_difference(lst: List[float]) -> int:\n \"\"\"\n Given a list of numbers, return the sum of squares of the numbers\n in the list that are odd. Ignore numbers that are negative or not integers.\n \n double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10\n double_the_difference([-1, -2, 0]) == 0\n double_the_difference([9, -2]) == 81\n double_the_difference([0]) == 0 \n \n If the input list is empty, return 0.\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == 0\n assert candidate([5.0, 4.0]) == 25\n assert candidate([0.1, 0.2, 0.3]) == 0\n assert candidate([-10.0, -20.0, -30.0]) == 0\n assert candidate([-1.0, -2.0, 8.0]) == 0\n assert candidate([0.2, 3.0, 5.0]) == 34\n assert candidate([-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]) == 165\n\ndef test_check():\n check(double_the_difference)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "py", - "prompt": "def strlen(string: str) -> int:\n \"\"\" Return length of given string\n >>> strlen('')\n 0\n >>> strlen('abc')\n 3\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('') == 0\n assert candidate('x') == 1\n assert candidate('asdasnakj') == 9\n\ndef test_check():\n check(strlen)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "py", - "prompt": "def is_bored(S: str) -> int:\n \"\"\"\n You'll be given a string of words, and your task is to count the number\n of boredoms. A boredom is a sentence that starts with the word \"I\".\n Sentences are delimited by '.', '?' or '!'.\n \n For example:\n >>> is_bored(\"Hello world\")\n 0\n >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n 1\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('Hello world') == 0\n assert candidate('Is the sky blue?') == 0\n assert candidate('I love It !') == 1\n assert candidate('bIt') == 0\n assert candidate('I feel good today. I will be productive. will kill It') == 2\n assert candidate('You and I are going for a walk') == 0\n\ndef test_check():\n check(is_bored)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "py", - "prompt": "def vowels_count(s: str) -> int:\n \"\"\"Write a function vowels_count which takes a string representing\n a word as input and returns the number of vowels in the string.\n Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n vowel, but only when it is at the end of the given word.\n\n Example:\n >>> vowels_count(\"abcde\")\n 2\n >>> vowels_count(\"ACEDY\")\n 3\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('abcde') == 2\n assert candidate('Alone') == 3\n assert candidate('key') == 2\n assert candidate('bye') == 1\n assert candidate('keY') == 2\n assert candidate('bYe') == 1\n assert candidate('ACEDY') == 3\n\ndef test_check():\n check(vowels_count)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "py", - "prompt": "def fib(n: int) -> int:\n \"\"\"Return n-th Fibonacci number.\n >>> fib(10)\n 55\n >>> fib(1)\n 1\n >>> fib(8)\n 21\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(10) == 55\n assert candidate(1) == 1\n assert candidate(8) == 21\n assert candidate(11) == 89\n assert candidate(12) == 144\n\ndef test_check():\n check(fib)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "py", - "prompt": "def simplify(x: str, n: str) -> bool:\n \"\"\"Your task is to implement a function that will simplify the expression\n x * n. The function returns True if x * n evaluates to a whole number and False\n otherwise. Both x and n, are string representation of a fraction, and have the following format,\n / where both numerator and denominator are positive whole numbers.\n\n You can assume that x, and n are valid fractions, and do not have zero as denominator.\n\n simplify(\"1/5\", \"5/1\") = True\n simplify(\"1/6\", \"2/1\") = False\n simplify(\"7/10\", \"10/2\") = False\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('1/5', '5/1') == True\n assert candidate('1/6', '2/1') == False\n assert candidate('5/1', '3/1') == True\n assert candidate('7/10', '10/2') == False\n assert candidate('2/10', '50/10') == True\n assert candidate('7/2', '4/2') == True\n assert candidate('11/6', '6/1') == True\n assert candidate('2/3', '5/2') == False\n assert candidate('5/2', '3/5') == False\n assert candidate('2/4', '8/4') == True\n assert candidate('2/4', '4/2') == True\n assert candidate('1/5', '5/1') == True\n assert candidate('1/5', '1/5') == False\n\ndef test_check():\n check(simplify)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "py", - "prompt": "def count_upper(s: str) -> int:\n \"\"\"\n Given a string s, count the number of uppercase vowels in even indices.\n \n For example:\n count_upper('aBCdEf') returns 1\n count_upper('abcdefg') returns 0\n count_upper('dBBE') returns 0\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('aBCdEf') == 1\n assert candidate('abcdefg') == 0\n assert candidate('dBBE') == 0\n assert candidate('B') == 0\n assert candidate('U') == 1\n assert candidate('') == 0\n assert candidate('EEEE') == 2\n\ndef test_check():\n check(count_upper)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "py", - "prompt": "from typing import List\n\ndef max_fill(grid: List[List[int]], capacity: int) -> int:\n \"\"\"\n You are given a rectangular grid of wells. Each row represents a single well,\n and each 1 in a row represents a single unit of water.\n Each well has a corresponding bucket that can be used to extract water from it, \n and all buckets have the same capacity.\n Your task is to use the buckets to empty the wells.\n Output the number of times you need to lower the buckets.\n\n Example 1:\n Input: \n grid : [[0,0,1,0], [0,1,0,0], [1,1,1,1]]\n bucket_capacity : 1\n Output: 6\n\n Example 2:\n Input: \n grid : [[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]]\n bucket_capacity : 2\n Output: 5\n \n Example 3:\n Input: \n grid : [[0,0,0], [0,0,0]]\n bucket_capacity : 5\n Output: 0\n\n Constraints:\n * all wells have the same length\n * 1 <= grid.length <= 10^2\n * 1 <= grid[:,1].length <= 10^2\n * grid[i][j] -> 0 | 1\n * 1 <= capacity <= 10\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1) == 6\n assert candidate([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2) == 5\n assert candidate([[0, 0, 0], [0, 0, 0]], 5) == 0\n assert candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 2) == 4\n assert candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 9) == 2\n\ndef test_check():\n check(max_fill)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "py", - "prompt": "from typing import List\n\ndef maximum(arr: List[int], k: int) -> List[int]:\n \"\"\"\n Given an array arr of integers and a positive integer k, return a sorted list \n of length k with the maximum k numbers in arr.\n\n Example 1:\n\n Input: arr = [-3, -4, 5], k = 3\n Output: [-4, -3, 5]\n\n Example 2:\n\n Input: arr = [4, -4, 4], k = 2\n Output: [4, 4]\n\n Example 3:\n\n Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1\n Output: [2]\n\n Note:\n 1. The length of the array will be in the range of [1, 1000].\n 2. The elements in the array will be in the range of [-1000, 1000].\n 3. 0 <= k <= len(arr)\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([-3, -4, 5], 3) == [-4, -3, 5]\n assert candidate([4, -4, 4], 2) == [4, 4]\n assert candidate([-3, 2, 1, 2, -1, -2, 1], 1) == [2]\n assert candidate([123, -123, 20, 0, 1, 2, -3], 3) == [2, 20, 123]\n assert candidate([-123, 20, 0, 1, 2, -3], 4) == [0, 1, 2, 20]\n assert candidate([5, 15, 0, 3, -13, -8, 0], 7) == [-13, -8, 0, 0, 3, 5, 15]\n assert candidate([-1, 0, 2, 5, 3, -10], 2) == [3, 5]\n assert candidate([1, 0, 5, -7], 1) == [5]\n assert candidate([4, -4], 2) == [-4, 4]\n assert candidate([-10, 10], 2) == [-10, 10]\n assert candidate([1, 2, 3, -23, 243, -400, 0], 0) == []\n\ndef test_check():\n check(maximum)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "py", - "prompt": "def encode(message: str) -> str:\n \"\"\"\n Write a function that takes a message, and encodes in such a \n way that it swaps case of all letters, replaces all vowels in \n the message with the letter that appears 2 places ahead of that \n vowel in the english alphabet. \n Assume only letters. \n \n Examples:\n >>> encode('test')\n 'TGST'\n >>> encode('This is a message')\n 'tHKS KS C MGSSCGG'\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('TEST') == 'tgst'\n assert candidate('Mudasir') == 'mWDCSKR'\n assert candidate('YES') == 'ygs'\n assert candidate('This is a message') == 'tHKS KS C MGSSCGG'\n assert candidate('I DoNt KnOw WhAt tO WrItE') == 'k dQnT kNqW wHcT Tq wRkTg'\n\ndef test_check():\n check(encode)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "py", - "prompt": "def remove_vowels(text: str) -> str:\n \"\"\"\n remove_vowels is a function that takes string and returns string without vowels.\n >>> remove_vowels('')\n ''\n >>> remove_vowels('abcdef')\n 'bcdf'\n >>> remove_vowels('aaaaa')\n ''\n >>> remove_vowels('aaBAA')\n 'B'\n >>> remove_vowels('zbcd')\n 'zbcd'\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('') == ''\n assert candidate('abcdef\\nghijklm') == 'bcdf\\nghjklm'\n assert candidate('fedcba') == 'fdcb'\n assert candidate('eeeee') == ''\n assert candidate('acBAA') == 'cB'\n assert candidate('EcBOO') == 'cB'\n assert candidate('ybcd') == 'ybcd'\n\ndef test_check():\n check(remove_vowels)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "py", - "prompt": "from typing import List\n\ndef get_positive(l: List[int]) -> List[int]:\n \"\"\"Return only positive numbers in the list.\n >>> get_positive([-1, 2, -4, 5, 6])\n [2, 5, 6]\n >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n [5, 3, 2, 3, 9, 123, 1]\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([-1, -2, 4, 5, 6]) == [4, 5, 6]\n assert candidate([5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]) == [5, 3, 2, 3, 3, 9, 123, 1]\n assert candidate([-1, -2]) == []\n assert candidate([]) == []\n\ndef test_check():\n check(get_positive)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "py", - "prompt": "def string_sequence(n: int) -> str:\n \"\"\" Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n >>> string_sequence(0)\n '0'\n >>> string_sequence(5)\n '0 1 2 3 4 5'\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(0) == '0'\n assert candidate(3) == '0 1 2 3'\n assert candidate(10) == '0 1 2 3 4 5 6 7 8 9 10'\n\ndef test_check():\n check(string_sequence)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "py", - "prompt": "from typing import List\n\ndef make_a_pile(n: int) -> List[int]:\n \"\"\"\n Given a positive integer n, you have to make a pile of n levels of stones.\n The first level has n stones.\n The number of stones in the next level is:\n - the next odd number if n is odd.\n - the next even number if n is even.\n Return the number of stones in each level in a list, where element at index\n i represents the number of stones in the level (i+1).\n\n Examples:\n >>> make_a_pile(3)\n [3, 5, 7]\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(3) == [3, 5, 7]\n assert candidate(4) == [4, 6, 8, 10]\n assert candidate(5) == [5, 7, 9, 11, 13]\n assert candidate(6) == [6, 8, 10, 12, 14, 16]\n assert candidate(8) == [8, 10, 12, 14, 16, 18, 20, 22]\n\ndef test_check():\n check(make_a_pile)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "py", - "prompt": "from typing import Tuple\n\ndef reverse_delete(s: str, c: str) -> Tuple[str, bool]:\n \"\"\"Task\n 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\n then check if the result string is palindrome.\n A string is called palindrome if it reads the same backward as forward.\n You should return a tuple containing the result string and True/False for the check.\n Example\n For s = \"abcde\", c = \"ae\", the result should be ('bcd',False)\n For s = \"abcdef\", c = \"b\" the result should be ('acdef',False)\n For s = \"abcdedcba\", c = \"ab\", the result should be ('cdedc',True)\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('abcde', 'ae') == ('bcd', False)\n assert candidate('abcdef', 'b') == ('acdef', False)\n assert candidate('abcdedcba', 'ab') == ('cdedc', True)\n assert candidate('dwik', 'w') == ('dik', False)\n assert candidate('a', 'a') == ('', True)\n assert candidate('abcdedcba', '') == ('abcdedcba', True)\n assert candidate('abcdedcba', 'v') == ('abcdedcba', True)\n assert candidate('vabba', 'v') == ('abba', True)\n assert candidate('mamma', 'mia') == ('', True)\n\ndef test_check():\n check(reverse_delete)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "py", - "prompt": "def flip_case(string: str) -> str:\n \"\"\" For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n >>> flip_case('Hello')\n 'hELLO'\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('') == ''\n assert candidate('Hello!') == 'hELLO!'\n assert candidate('These violent delights have violent ends') == 'tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS'\n\ndef test_check():\n check(flip_case)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "py", - "prompt": "def solve(s: str) -> str:\n \"\"\"You are given a string s.\n if s[i] is a letter, reverse its case from lower to upper or vise versa, \n otherwise keep it as it is.\n If the string contains no letters, reverse the string.\n The function should return the resulted string.\n Examples\n solve(\"1234\") = \"4321\"\n solve(\"ab\") = \"AB\"\n solve(\"#a@C\") = \"#A@c\"\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('AsDf') == 'aSdF'\n assert candidate('1234') == '4321'\n assert candidate('ab') == 'AB'\n assert candidate('#a@C') == '#A@c'\n assert candidate('#AsdfW^45') == '#aSDFw^45'\n assert candidate('#6@2') == '2@6#'\n assert candidate('#$a^D') == '#$A^d'\n assert candidate('#ccc') == '#CCC'\n\ndef test_check():\n check(solve)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "py", - "prompt": "from typing import List\n\ndef filter_by_prefix(strings: List[str], prefix: str) -> List[str]:\n \"\"\" Filter an input list of strings only for ones that start with a given prefix.\n >>> filter_by_prefix([], 'a')\n []\n >>> filter_by_prefix(['abc', 'bcd', 'cde', 'array'], 'a')\n ['abc', 'array']\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([], 'john') == []\n assert candidate(['xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'], 'xxx') == ['xxx', 'xxxAAA', 'xxx']\n\ndef test_check():\n check(filter_by_prefix)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "py", - "prompt": "def choose_num(x: int, y: int) -> int:\n \"\"\"This function takes two positive numbers x and y and returns the\n biggest even integer number that is in the range [x, y] inclusive. If \n there's no such number, then the function should return -1.\n\n For example:\n choose_num(12, 15) = 14\n choose_num(13, 12) = -1\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(12, 15) == 14\n assert candidate(13, 12) == -1\n assert candidate(33, 12354) == 12354\n assert candidate(5234, 5233) == -1\n assert candidate(6, 29) == 28\n assert candidate(27, 10) == -1\n assert candidate(7, 7) == -1\n assert candidate(546, 546) == 546\n\ndef test_check():\n check(choose_num)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "py", - "prompt": "def words_in_sentence(sentence: str) -> str:\n \"\"\"\n You are given a string representing a sentence,\n the sentence contains some words separated by a space,\n and you have to return a string that contains the words from the original sentence,\n whose lengths are prime numbers,\n the order of the words in the new string should be the same as the original one.\n\n Example 1:\n Input: sentence = \"This is a test\"\n Output: \"is\"\n\n Example 2:\n Input: sentence = \"lets go for swimming\"\n Output: \"go for\"\n\n Constraints:\n * 1 <= len(sentence) <= 100\n * sentence contains only letters\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('This is a test') == 'is'\n assert candidate('lets go for swimming') == 'go for'\n assert candidate('there is no place available here') == 'there is no place'\n assert candidate('Hi I am Hussein') == 'Hi am Hussein'\n assert candidate('go for it') == 'go for it'\n assert candidate('here') == ''\n assert candidate('here is') == 'is'\n\ndef test_check():\n check(words_in_sentence)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "py", - "prompt": "from typing import List\n\ndef intersperse(numbers: List[int], delimeter: int) -> List[int]:\n \"\"\" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n >>> intersperse([], 4)\n []\n >>> intersperse([1, 2, 3], 4)\n [1, 4, 2, 4, 3]\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([], 7) == []\n assert candidate([5, 6, 3, 2], 8) == [5, 8, 6, 8, 3, 8, 2]\n assert candidate([2, 2, 2], 2) == [2, 2, 2, 2, 2]\n\ndef test_check():\n check(intersperse)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "py", - "prompt": "def is_simple_power(x: int, n: int) -> bool:\n \"\"\"Your task is to write a function that returns true if a number x is a simple\n power of n and false in other cases.\n x is a simple power of n if n**int=x\n For example:\n is_simple_power(1, 4) => true\n is_simple_power(2, 2) => true\n is_simple_power(8, 2) => true\n is_simple_power(3, 2) => false\n is_simple_power(3, 1) => false\n is_simple_power(5, 3) => false\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(16, 2) == True\n assert candidate(143214, 16) == False\n assert candidate(4, 2) == True\n assert candidate(9, 3) == True\n assert candidate(16, 4) == True\n assert candidate(24, 2) == False\n assert candidate(128, 4) == False\n assert candidate(12, 6) == False\n assert candidate(1, 1) == True\n assert candidate(1, 12) == True\n\ndef test_check():\n check(is_simple_power)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "py", - "prompt": "def is_multiply_prime(a: int) -> bool:\n \"\"\"Write a function that returns true if the given number is the multiplication of 3 prime numbers\n and false otherwise.\n Knowing that (a) is less then 100. \n Example:\n is_multiply_prime(30) == True\n 30 = 2 * 3 * 5\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(5) == False\n assert candidate(30) == True\n assert candidate(8) == True\n assert candidate(10) == False\n assert candidate(125) == True\n assert candidate(105) == True\n assert candidate(126) == False\n assert candidate(729) == False\n assert candidate(891) == False\n assert candidate(1001) == True\n\ndef test_check():\n check(is_multiply_prime)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "py", - "prompt": "def right_angle_triangle(a: int, b: int, c: int) -> bool:\n \"\"\"\n Given the lengths of the three sides of a triangle. Return True if the three\n sides form a right-angled triangle, False otherwise.\n A right-angled triangle is a triangle in which one angle is right angle or \n 90 degree.\n Example:\n right_angle_triangle(3, 4, 5) == True\n right_angle_triangle(1, 2, 3) == False\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(3, 4, 5) == True\n assert candidate(1, 2, 3) == False\n assert candidate(10, 6, 8) == True\n assert candidate(2, 2, 2) == False\n assert candidate(7, 24, 25) == True\n assert candidate(10, 5, 7) == False\n assert candidate(5, 12, 13) == True\n assert candidate(15, 8, 17) == True\n assert candidate(48, 55, 73) == True\n assert candidate(1, 1, 1) == False\n assert candidate(2, 2, 10) == False\n\ndef test_check():\n check(right_angle_triangle)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "py", - "prompt": "def any_int(x: float, y: float, z: float) -> bool:\n \"\"\"\n Create a function that takes 3 numbers.\n Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n Returns false in any other cases.\n \n Examples\n any_int(5, 2, 7) \u279e True\n \n any_int(3, 2, 2) \u279e False\n\n any_int(3, -2, 1) \u279e True\n \n any_int(3.6, -2.2, 2) \u279e False\n \n\n \n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(2, 3, 1) == True\n assert candidate(2.5, 2, 3) == False\n assert candidate(1.5, 5, 3.5) == False\n assert candidate(2, 6, 2) == False\n assert candidate(4, 2, 2) == True\n assert candidate(2.2, 2.2, 2.2) == False\n assert candidate(-4, 6, 2) == True\n assert candidate(2, 1, 1) == True\n assert candidate(3, 4, 7) == True\n assert candidate(3.0, 4, 7) == False\n\ndef test_check():\n check(any_int)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "py", - "prompt": "from typing import List\n\ndef sort_third(l: List[int]) -> List[int]:\n \"\"\"This function takes a list l and returns a list l' such that\n l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n to the values of the corresponding indicies of l, but sorted.\n >>> sort_third([1, 2, 3])\n [1, 2, 3]\n >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n [2, 6, 3, 4, 8, 9, 5]\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([5, 6, 3, 4, 8, 9, 2]) == [2, 6, 3, 4, 8, 9, 5]\n assert candidate([5, 8, 3, 4, 6, 9, 2]) == [2, 8, 3, 4, 6, 9, 5]\n assert candidate([5, 6, 9, 4, 8, 3, 2]) == [2, 6, 9, 4, 8, 3, 5]\n assert candidate([5, 6, 3, 4, 8, 9, 2, 1]) == [2, 6, 3, 4, 8, 9, 5, 1]\n\ndef test_check():\n check(sort_third)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_53_add", - "language": "py", - "prompt": "def add(x: int, y: int) -> int:\n \"\"\"Add two numbers x and y\n >>> add(2, 3)\n 5\n >>> add(5, 7)\n 12\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(0, 1) == 1\n assert candidate(1, 0) == 1\n assert candidate(2, 3) == 5\n assert candidate(5, 7) == 12\n assert candidate(7, 5) == 12\n\ndef test_check():\n check(add)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_69_search", - "language": "py", - "prompt": "from typing import List\n\ndef search(lst: List[int]) -> int:\n \"\"\"\n You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n zero, and has a frequency greater than or equal to the value of the integer itself. \n The frequency of an integer is the number of times it appears in the list.\n If no such a value exist, return -1.\n Examples:\n search([4, 1, 2, 2, 3, 1]) == 2\n search([1, 2, 2, 3, 3, 3, 4, 4, 4]) == 3\n search([5, 5, 4, 4, 4]) == -1\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([5, 5, 5, 5, 1]) == 1\n assert candidate([4, 1, 4, 1, 4, 4]) == 4\n assert candidate([3, 3]) == -1\n assert candidate([8, 8, 8, 8, 8, 8, 8, 8]) == 8\n assert candidate([2, 3, 3, 2, 2]) == 2\n assert candidate([2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]) == 1\n assert candidate([3, 2, 8, 2]) == 2\n assert candidate([6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]) == 1\n assert candidate([8, 8, 3, 6, 5, 6, 4]) == -1\n assert candidate([6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]) == 1\n assert candidate([1, 9, 10, 1, 3]) == 1\n assert candidate([6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]) == 5\n assert candidate([1]) == 1\n assert candidate([8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]) == 4\n assert candidate([2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]) == 2\n assert candidate([1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]) == 1\n assert candidate([9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]) == 4\n assert candidate([2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]) == 4\n assert candidate([9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]) == 2\n assert candidate([5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]) == -1\n assert candidate([10]) == -1\n assert candidate([9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]) == 2\n assert candidate([5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]) == 1\n assert candidate([7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]) == 1\n assert candidate([3, 10, 10, 9, 2]) == -1\n\ndef test_check():\n check(search)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "py", - "prompt": "def prime_length(string: str) -> bool:\n \"\"\"Write a function that takes a string and returns True if the string\n length is a prime number or False otherwise\n Examples\n prime_length('Hello') == True\n prime_length('abcdcba') == True\n prime_length('kittens') == True\n prime_length('orange') == False\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('Hello') == True\n assert candidate('abcdcba') == True\n assert candidate('kittens') == True\n assert candidate('orange') == False\n assert candidate('wow') == True\n assert candidate('world') == True\n assert candidate('MadaM') == True\n assert candidate('Wow') == True\n assert candidate('') == False\n assert candidate('HI') == True\n assert candidate('go') == True\n assert candidate('gogo') == False\n assert candidate('aaaaaaaaaaaaaaa') == False\n assert candidate('Madam') == True\n assert candidate('M') == False\n assert candidate('0') == False\n\ndef test_check():\n check(prime_length)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_58_common", - "language": "py", - "prompt": "from typing import List\n\ndef common(l1: List[int], l2: List[int]) -> List[int]:\n \"\"\"Return sorted unique common elements for two lists.\n >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n [1, 5, 653]\n >>> common([5, 3, 2, 8], [3, 2])\n [2, 3]\n\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]) == [1, 5, 653]\n assert candidate([5, 3, 2, 8], [3, 2]) == [2, 3]\n assert candidate([4, 3, 2, 8], [3, 2, 4]) == [2, 3, 4]\n assert candidate([4, 3, 2, 8], []) == []\n\ndef test_check():\n check(common)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "py", - "prompt": "def special_factorial(n: int) -> int:\n \"\"\"The Brazilian factorial is defined as:\n brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n where n > 0\n\n For example:\n >>> special_factorial(4)\n 288\n\n The function will receive an integer as input and should return the special\n factorial of this integer.\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(4) == 288\n assert candidate(5) == 34560\n assert candidate(7) == 125411328000\n assert candidate(1) == 1\n\ndef test_check():\n check(special_factorial)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "py", - "prompt": "from typing import List\n\ndef exchange(lst1: List[int], lst2: List[int]) -> str:\n \"\"\"In this problem, you will implement a function that takes two lists of numbers,\n and determines whether it is possible to perform an exchange of elements\n between them to make lst1 a list of only even numbers.\n There is no limit on the number of exchanged elements between lst1 and lst2.\n If it is possible to exchange elements between the lst1 and lst2 to make\n all the elements of lst1 to be even, return \"YES\".\n Otherwise, return \"NO\".\n For example:\n exchange([1, 2, 3, 4], [1, 2, 3, 4]) => \"YES\"\n exchange([1, 2, 3, 4], [1, 5, 3, 4]) => \"NO\"\n It is assumed that the input lists will be non-empty.\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 3, 4], [1, 2, 3, 4]) == 'YES'\n assert candidate([1, 2, 3, 4], [1, 5, 3, 4]) == 'NO'\n assert candidate([1, 2, 3, 4], [2, 1, 4, 3]) == 'YES'\n assert candidate([5, 7, 3], [2, 6, 4]) == 'YES'\n assert candidate([5, 7, 3], [2, 6, 3]) == 'NO'\n assert candidate([3, 2, 6, 1, 8, 9], [3, 5, 5, 1, 1, 1]) == 'NO'\n assert candidate([100, 200], [200, 200]) == 'YES'\n\ndef test_check():\n check(exchange)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "py", - "prompt": "from typing import List\n\ndef add_elements(arr: List[int], k: int) -> int:\n \"\"\"\n Given a non-empty array of integers arr and an integer k, return\n the sum of the elements with at most two digits from the first k elements of arr.\n\n Example:\n\n Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4\n Output: 24 # sum of 21 + 3\n\n Constraints:\n 1. 1 <= len(arr) <= 100\n 2. 1 <= k <= len(arr)\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, -2, -3, 41, 57, 76, 87, 88, 99], 3) == -4\n assert candidate([111, 121, 3, 4000, 5, 6], 2) == 0\n assert candidate([11, 21, 3, 90, 5, 6, 7, 8, 9], 4) == 125\n assert candidate([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4) == 24\n assert candidate([1], 1) == 1\n\ndef test_check():\n check(add_elements)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "py", - "prompt": "def x_or_y(n: int, x: int, y: int) -> int:\n \"\"\"A simple program which should return the value of x if n is \n a prime number and should return the value of y otherwise.\n\n Examples:\n for x_or_y(7, 34, 12) == 34\n for x_or_y(15, 8, 5) == 5\n \n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(7, 34, 12) == 34\n assert candidate(15, 8, 5) == 5\n assert candidate(3, 33, 5212) == 33\n assert candidate(1259, 3, 52) == 3\n assert candidate(7919, -1, 12) == -1\n assert candidate(3609, 1245, 583) == 583\n assert candidate(91, 56, 129) == 129\n assert candidate(6, 34, 1234) == 1234\n assert candidate(1, 2, 0) == 0\n assert candidate(2, 2, 0) == 2\n\ndef test_check():\n check(x_or_y)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "py", - "prompt": "def triangle_area(a: int, h: int) -> float:\n \"\"\"Given length of a side and high return area for a triangle.\n >>> triangle_area(5, 3)\n 7.5\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(5, 3) == 7.5\n assert candidate(2, 2) == 2.0\n assert candidate(10, 8) == 40.0\n\ndef test_check():\n check(triangle_area)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "py", - "prompt": "from typing import List\n\ndef tri(n: int) -> List[int]:\n \"\"\"Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n the last couple centuries. However, what people don't know is Tribonacci sequence.\n Tribonacci sequence is defined by the recurrence:\n tri(1) = 3\n tri(n) = 1 + n / 2, if n is even.\n tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n For example:\n tri(2) = 1 + (2 / 2) = 2\n tri(4) = 3\n tri(3) = tri(2) + tri(1) + tri(4)\n = 2 + 3 + 3 = 8 \n You are given a non-negative integer number n, you have to a return a list of the \n first n + 1 numbers of the Tribonacci sequence.\n Examples:\n tri(3) = [1, 3, 2, 8]\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(3) == [1, 3, 2, 8]\n assert candidate(4) == [1, 3, 2, 8, 3]\n assert candidate(5) == [1, 3, 2, 8, 3, 15]\n assert candidate(6) == [1, 3, 2, 8, 3, 15, 4]\n assert candidate(7) == [1, 3, 2, 8, 3, 15, 4, 24]\n assert candidate(8) == [1, 3, 2, 8, 3, 15, 4, 24, 5]\n assert candidate(9) == [1, 3, 2, 8, 3, 15, 4, 24, 5, 35]\n assert candidate(20) == [1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11]\n assert candidate(0) == [1]\n assert candidate(1) == [1, 3]\n\ndef test_check():\n check(tri)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "py", - "prompt": "from typing import List\n\ndef match_parens(lst: List[str]) -> str:\n \"\"\"\n You are given a list of two strings, both strings consist of open\n parentheses '(' or close parentheses ')' only.\n Your job is to check if it is possible to concatenate the two strings in\n some order, that the resulting string will be good.\n A string S is considered to be good if and only if all parentheses in S\n are balanced. For example: the string '(())()' is good, while the string\n '())' is not.\n Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n\n Examples:\n match_parens(['()(', ')']) == 'Yes'\n match_parens([')', ')']) == 'No'\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(['()(', ')']) == 'Yes'\n assert candidate([')', ')']) == 'No'\n assert candidate(['(()(())', '())())']) == 'No'\n assert candidate([')())', '(()()(']) == 'Yes'\n assert candidate(['(())))', '(()())((']) == 'Yes'\n assert candidate(['()', '())']) == 'No'\n assert candidate(['(()(', '()))()']) == 'Yes'\n assert candidate(['((((', '((())']) == 'No'\n assert candidate([')(()', '(()(']) == 'No'\n assert candidate([')(', ')(']) == 'No'\n assert candidate(['(', ')']) == 'Yes'\n assert candidate([')', '(']) == 'Yes'\n\ndef test_check():\n check(match_parens)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "py", - "prompt": "from typing import List\n\ndef remove_duplicates(numbers: List[int]) -> List[int]:\n \"\"\" From a list of integers, remove all elements that occur more than once.\n Keep order of elements left the same as in the input.\n >>> remove_duplicates([1, 2, 3, 2, 4])\n [1, 3, 4]\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == []\n assert candidate([1, 2, 3, 4]) == [1, 2, 3, 4]\n assert candidate([1, 2, 3, 2, 4, 3, 5]) == [1, 4, 5]\n\ndef test_check():\n check(remove_duplicates)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "py", - "prompt": "def greatest_common_divisor(a: int, b: int) -> int:\n \"\"\" Return a greatest common divisor of two integers a and b\n >>> greatest_common_divisor(3, 5)\n 1\n >>> greatest_common_divisor(25, 15)\n 5\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(3, 7) == 1\n assert candidate(10, 15) == 5\n assert candidate(49, 14) == 7\n assert candidate(144, 60) == 12\n\ndef test_check():\n check(greatest_common_divisor)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "py", - "prompt": "def is_palindrome(text: str) -> bool:\n \"\"\"\n Checks if given string is a palindrome\n >>> is_palindrome('')\n True\n >>> is_palindrome('aba')\n True\n >>> is_palindrome('aaaaa')\n True\n >>> is_palindrome('zbcd')\n False\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('') == True\n assert candidate('aba') == True\n assert candidate('aaaaa') == True\n assert candidate('zbcd') == False\n assert candidate('xywyx') == True\n assert candidate('xywyz') == False\n assert candidate('xywzx') == False\n\ndef test_check():\n check(is_palindrome)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "py", - "prompt": "from typing import List\n\ndef derivative(xs: List[int]) -> List[int]:\n \"\"\" xs represent coefficients of a polynomial.\n xs[0] + xs[1] * x + xs[2] * x^2 + ....\n Return derivative of this polynomial in the same form.\n >>> derivative([3, 1, 2, 4, 5])\n [1, 4, 12, 20]\n >>> derivative([1, 2, 3])\n [2, 6]\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([3, 1, 2, 4, 5]) == [1, 4, 12, 20]\n assert candidate([1, 2, 3]) == [2, 6]\n assert candidate([3, 2, 1]) == [2, 2]\n assert candidate([3, 2, 1, 0, 4]) == [2, 2, 0, 16]\n assert candidate([1]) == []\n\ndef test_check():\n check(derivative)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "py", - "prompt": "def fruit_distribution(s: str, n: int) -> int:\n \"\"\"\n In this task, you will be given a string that represents a number of apples and oranges \n that are distributed in a basket of fruit this basket contains \n apples, oranges, and mango fruits. Given the string that represents the total number of \n the oranges and apples and an integer that represent the total number of the fruits \n in the basket return the number of the mango fruits in the basket.\n for examble:\n fruit_distribution(\"5 apples and 6 oranges\", 19) ->19 - 5 - 6 = 8\n fruit_distribution(\"0 apples and 1 oranges\",3) -> 3 - 0 - 1 = 2\n fruit_distribution(\"2 apples and 3 oranges\", 100) -> 100 - 2 - 3 = 95\n fruit_distribution(\"100 apples and 1 oranges\",120) -> 120 - 100 - 1 = 19\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('5 apples and 6 oranges', 19) == 8\n assert candidate('5 apples and 6 oranges', 21) == 10\n assert candidate('0 apples and 1 oranges', 3) == 2\n assert candidate('1 apples and 0 oranges', 3) == 2\n assert candidate('2 apples and 3 oranges', 100) == 95\n assert candidate('2 apples and 3 oranges', 5) == 0\n assert candidate('1 apples and 100 oranges', 120) == 19\n\ndef test_check():\n check(fruit_distribution)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "py", - "prompt": "def iscube(a: int) -> bool:\n \"\"\"\n Write a function that takes an integer a and returns True \n if this ingeger is a cube of some integer number.\n Note: you may assume the input is always valid.\n Examples:\n iscube(1) ==> True\n iscube(2) ==> False\n iscube(-1) ==> True\n iscube(64) ==> True\n iscube(0) ==> True\n iscube(180) ==> False\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(1) == True\n assert candidate(2) == False\n assert candidate(-1) == True\n assert candidate(64) == True\n assert candidate(180) == False\n assert candidate(1000) == True\n assert candidate(0) == True\n assert candidate(1729) == False\n\ndef test_check():\n check(iscube)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "py", - "prompt": "from typing import List\n\ndef sort_array(arr: List[int]) -> List[int]:\n \"\"\"\n In this Kata, you have to sort an array of non-negative integers according to\n number of ones in their binary representation in ascending order.\n For similar number of ones, sort based on decimal value.\n\n It must be implemented like this:\n >>> sort_array([1, 5, 2, 3, 4]) == [1, 2, 3, 4, 5]\n >>> sort_array([-2, -3, -4, -5, -6]) == [-6, -5, -4, -3, -2]\n >>> sort_array([1, 0, 2, 3, 4]) [0, 1, 2, 3, 4]\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 5, 2, 3, 4]) == [1, 2, 4, 3, 5]\n assert candidate([-2, -3, -4, -5, -6]) == [-4, -2, -6, -5, -3]\n assert candidate([1, 0, 2, 3, 4]) == [0, 1, 2, 4, 3]\n assert candidate([]) == []\n assert candidate([2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]) == [2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77]\n assert candidate([3, 6, 44, 12, 32, 5]) == [32, 3, 5, 6, 12, 44]\n assert candidate([2, 4, 8, 16, 32]) == [2, 4, 8, 16, 32]\n assert candidate([2, 4, 8, 16, 32]) == [2, 4, 8, 16, 32]\n\ndef test_check():\n check(sort_array)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "py", - "prompt": "from typing import List\n\ndef odd_count(lst: List[str]) -> List[str]:\n \"\"\"Given a list of strings, where each string consists of only digits, return a list.\n Each element i of the output should be \"the number of odd elements in the\n string i of the input.\" where all the i's should be replaced by the number\n of odd digits in the i'th string of the input.\n\n >>> odd_count(['1234567'])\n [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n >>> odd_count(['3',\"11111111\"])\n [\"the number of odd elements 1n the str1ng 1 of the 1nput.\",\n \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(['1234567']) == ['the number of odd elements 4n the str4ng 4 of the 4nput.']\n 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.']\n assert candidate(['271', '137', '314']) == ['the number of odd elements 2n the str2ng 2 of the 2nput.', 'the number of odd elements 3n the str3ng 3 of the 3nput.', 'the number of odd elements 2n the str2ng 2 of the 2nput.']\n\ndef test_check():\n check(odd_count)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "py", - "prompt": "def correct_bracketing(brackets: str) -> bool:\n \"\"\" brackets is a string of \"(\" and \")\".\n return True if every opening bracket has a corresponding closing bracket.\n\n >>> correct_bracketing(\"(\")\n False\n >>> correct_bracketing(\"()\")\n True\n >>> correct_bracketing(\"(()())\")\n True\n >>> correct_bracketing(\")(()\")\n False\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('()') == True\n assert candidate('(()())') == True\n assert candidate('()()(()())()') == True\n assert candidate('()()((()()())())(()()(()))') == True\n assert candidate('((()())))') == False\n assert candidate(')(()') == False\n assert candidate('(') == False\n assert candidate('((((') == False\n assert candidate(')') == False\n assert candidate('(()') == False\n assert candidate('()()(()())())(()') == False\n assert candidate('()()(()())()))()') == False\n\ndef test_check():\n check(correct_bracketing)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "py", - "prompt": "def digitSum(s: str) -> int:\n \"\"\"Task\n Write a function that takes a string as input and returns the sum of the upper characters only'\n ASCII codes.\n\n Examples:\n digitSum(\"\") => 0\n digitSum(\"abAB\") => 131\n digitSum(\"abcCd\") => 67\n digitSum(\"helloE\") => 69\n digitSum(\"woArBld\") => 131\n digitSum(\"aAaaaXa\") => 153\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('') == 0\n assert candidate('abAB') == 131\n assert candidate('abcCd') == 67\n assert candidate('helloE') == 69\n assert candidate('woArBld') == 131\n assert candidate('aAaaaXa') == 153\n assert candidate(' How are yOu?') == 151\n assert candidate('You arE Very Smart') == 327\n\ndef test_check():\n check(digitSum)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "py", - "prompt": "from typing import List\n\ndef sorted_list_sum(lst: List[str]) -> List[str]:\n \"\"\"Write a function that accepts a list of strings as a parameter,\n deletes the strings that have odd lengths from it,\n and returns the resulted list with a sorted order,\n The list is always a list of strings and never an array of numbers,\n and it may contain duplicates.\n The order of the list should be ascending by length of each word, and you\n should return the list sorted by that rule.\n If two words have the same length, sort the list alphabetically.\n The function should return a list of strings in sorted order.\n You may assume that all words will have the same length.\n For example:\n assert list_sort([\"aa\", \"a\", \"aaa\"]) => [\"aa\"]\n assert list_sort([\"ab\", \"a\", \"aaa\", \"cd\"]) => [\"ab\", \"cd\"]\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(['aa', 'a', 'aaa']) == ['aa']\n assert candidate(['school', 'AI', 'asdf', 'b']) == ['AI', 'asdf', 'school']\n assert candidate(['d', 'b', 'c', 'a']) == []\n assert candidate(['d', 'dcba', 'abcd', 'a']) == ['abcd', 'dcba']\n assert candidate(['AI', 'ai', 'au']) == ['AI', 'ai', 'au']\n assert candidate(['a', 'b', 'b', 'c', 'c', 'a']) == []\n assert candidate(['aaaa', 'bbbb', 'dd', 'cc']) == ['cc', 'dd', 'aaaa', 'bbbb']\n\ndef test_check():\n check(sorted_list_sum)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "py", - "prompt": "from typing import List, Optional\n\ndef prod_signs(arr: List[int]) -> Optional[int]:\n \"\"\"\n You are given an array arr of integers and you need to return\n sum of magnitudes of integers multiplied by product of all signs\n of each number in the array, represented by 1, -1 or 0.\n Note: return None for empty arr.\n\n Example:\n >>> prod_signs([1, 2, 2, -4]) == -9\n >>> prod_signs([0, 1]) == 0\n >>> prod_signs([]) == None\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 2, -4]) == -9\n assert candidate([0, 1]) == 0\n assert candidate([1, 1, 1, 2, 3, -1, 1]) == -10\n assert candidate([]) == None\n assert candidate([2, 4, 1, 2, -1, -1, 9]) == 20\n assert candidate([-1, 1, -1, 1]) == 4\n assert candidate([-1, 1, 1, 1]) == -4\n assert candidate([-1, 1, 1, 0]) == 0\n\ndef test_check():\n check(prod_signs)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "py", - "prompt": "from typing import List\n\ndef incr_list(l: List[int]) -> List[int]:\n \"\"\"Return list with elements incremented by 1.\n >>> incr_list([1, 2, 3])\n [2, 3, 4]\n >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123])\n [6, 4, 6, 3, 4, 4, 10, 1, 124]\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == []\n assert candidate([3, 2, 1]) == [4, 3, 2]\n assert candidate([5, 2, 5, 2, 3, 3, 9, 0, 123]) == [6, 3, 6, 3, 4, 4, 10, 1, 124]\n\ndef test_check():\n check(incr_list)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "py", - "prompt": "from typing import List\n\ndef rolling_max(numbers: List[int]) -> List[int]:\n \"\"\" From a given list of integers, generate a list of rolling maximum element found until given moment\n in the sequence.\n >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n [1, 2, 3, 3, 3, 4, 4]\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == []\n assert candidate([1, 2, 3, 4]) == [1, 2, 3, 4]\n assert candidate([4, 3, 2, 1]) == [4, 4, 4, 4]\n assert candidate([3, 2, 3, 100, 3]) == [3, 3, 3, 100, 100]\n\ndef test_check():\n check(rolling_max)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "py", - "prompt": "from typing import List\n\ndef separate_paren_groups(paren_string: str) -> List[str]:\n \"\"\" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n separate those group into separate strings and return the list of those.\n Separate groups are balanced (each open brace is properly closed) and not nested within each other\n Ignore any spaces in the input string.\n >>> separate_paren_groups('( ) (( )) (( )( ))')\n ['()', '(())', '(()())']\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('(()()) ((())) () ((())()())') == ['(()())', '((()))', '()', '((())()())']\n assert candidate('() (()) ((())) (((())))') == ['()', '(())', '((()))', '(((())))']\n assert candidate('(()(())((())))') == ['(()(())((())))']\n assert candidate('( ) (( )) (( )( ))') == ['()', '(())', '(()())']\n\ndef test_check():\n check(separate_paren_groups)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "py", - "prompt": "from typing import List\n\ndef words_string(s: str) -> List[str]:\n \"\"\"\n You will be given a string of words separated by commas or spaces. Your task is\n to split the string into words and return an array of the words.\n \n For example:\n words_string(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n words_string(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('Hi, my name is John') == ['Hi', 'my', 'name', 'is', 'John']\n assert candidate('One, two, three, four, five, six') == ['One', 'two', 'three', 'four', 'five', 'six']\n assert candidate('Hi, my name') == ['Hi', 'my', 'name']\n assert candidate('One,, two, three, four, five, six,') == ['One', 'two', 'three', 'four', 'five', 'six']\n assert candidate('') == []\n assert candidate('ahmed , gamal') == ['ahmed', 'gamal']\n\ndef test_check():\n check(words_string)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "py", - "prompt": "from typing import Union\n\ndef compare_one(a: Union[int, float, str], b: Union[int, float, str]) -> Union[int, float, str, None]:\n \"\"\"\n Create a function that takes integers, floats, or strings representing\n real numbers, and returns the larger variable in its given variable type.\n Return None if the values are equal.\n Note: If a real number is represented as a string, the floating point might be . or ,\n\n compare_one(1, 2.5) \u279e 2.5\n compare_one(1, \"2,3\") \u279e \"2,3\"\n compare_one(\"5,1\", \"6\") \u279e \"6\"\n compare_one(\"1\", 1) \u279e None\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_137_compare_one.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(1, 2) == 2\n assert candidate(1, 2.5) == 2.5\n assert candidate(2, 3) == 3\n assert candidate(5, 6) == 6\n assert candidate(1, '2,3') == '2,3'\n assert candidate('5,1', '6') == '6'\n assert candidate('1', '2') == '2'\n assert candidate('1', 1) == None\n\ndef test_check():\n check(compare_one)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "py", - "prompt": "from typing import List, Any\n\ndef filter_integers(values: List[Any]) -> List[int]:\n \"\"\" Filter given list of any python values only for integers\n >>> filter_integers(['a', 3.14, 5])\n [5]\n >>> filter_integers([1, 2, 3, 'abc', {}, []])\n [1, 2, 3]\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == []\n assert candidate([4, { }, [], 23.2, 9, 'adasd']) == [4, 9]\n assert candidate([3, 'c', 3, 3, 'a', 'b']) == [3, 3, 3]\n\ndef test_check():\n check(filter_integers)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "py", - "prompt": "from typing import List\n\ndef sort_even(l: List[int]) -> List[int]:\n \"\"\"This function takes a list l and returns a list l' such that\n l' is identical to l in the odd indicies, while its values at the even indicies are equal\n to the values of the even indicies of l, but sorted.\n >>> sort_even([1, 2, 3])\n [1, 2, 3]\n >>> sort_even([5, 6, 3, 4])\n [3, 6, 5, 4]\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 3]) == [1, 2, 3]\n assert candidate([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]) == [-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123]\n assert candidate([5, 8, -12, 4, 23, 2, 3, 11, 12, -10]) == [-12, 8, 3, 4, 5, 2, 12, 11, 23, -10]\n\ndef test_check():\n check(sort_even)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "py", - "prompt": "from typing import List\n\ndef compare(game: List[int], guess: List[int]) -> List[int]:\n \"\"\"I think we all remember that feeling when the result of some long-awaited\n event is finally known. The feelings and thoughts you have at that moment are\n definitely worth noting down and comparing.\n Your task is to determine if a person correctly guessed the results of a number of matches.\n You are given two arrays of scores and guesses of equal length, where each index shows a match. \n Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n the value is 0, and if not, the value is the absolute difference between the guess and the score.\n \n \n example:\n\n compare([1,2,3,4,5,1],[1,2,3,4,2,-2]) -> [0,0,0,0,3,3]\n compare([0,5,0,0,0,4],[4,1,1,0,0,-2]) -> [4,4,1,0,0,6]\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2]) == [0, 0, 0, 0, 3, 3]\n assert candidate([0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]) == [0, 0, 0, 0, 0, 0]\n assert candidate([1, 2, 3], [-1, -2, -3]) == [2, 4, 6]\n assert candidate([1, 2, 3, 5], [-1, 2, 3, 4]) == [2, 0, 0, 1]\n\ndef test_check():\n check(compare)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "py", - "prompt": "from typing import Tuple\n\ndef even_odd_palindrome(n: int) -> Tuple[int, int]:\n \"\"\"\n Given a positive integer n, return a tuple that has the number of even and odd\n integer palindromes that fall within the range(1, n), inclusive.\n\n Example 1:\n\n Input: 3\n Output: (1, 2)\n Explanation:\n Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n\n Example 2:\n\n Input: 12\n Output: (4, 6)\n Explanation:\n Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n\n Note:\n 1. 1 <= n <= 10^3\n 2. returned tuple has the number of even and odd integer palindromes respectively.\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(123) == (8, 13)\n assert candidate(12) == (4, 6)\n assert candidate(3) == (1, 2)\n assert candidate(63) == (6, 8)\n assert candidate(25) == (5, 6)\n assert candidate(19) == (4, 6)\n assert candidate(9) == (4, 5)\n assert candidate(1) == (0, 1)\n\ndef test_check():\n check(even_odd_palindrome)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "py", - "prompt": "def fib4(n: int) -> int:\n \"\"\"The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fib4(0) -> 0\n fib4(1) -> 0\n fib4(2) -> 2\n fib4(3) -> 0\n fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n >>> fib4(5)\n 4\n >>> fib4(6)\n 8\n >>> fib4(7)\n 14\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(5) == 4\n assert candidate(8) == 28\n assert candidate(10) == 104\n assert candidate(12) == 386\n\ndef test_check():\n check(fib4)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "py", - "prompt": "from typing import List\n\ndef generate_integers(a: int, b: int) -> List[int]:\n \"\"\"\n Given two positive integers a and b, return the even digits between a\n and b, in ascending order.\n\n For example:\n generate_integers(2, 8) => [2, 4, 6, 8]\n generate_integers(8, 2) => [2, 4, 6, 8]\n generate_integers(10, 14) => []\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(2, 10) == [2, 4, 6, 8]\n assert candidate(10, 2) == [2, 4, 6, 8]\n assert candidate(132, 2) == [2, 4, 6, 8]\n assert candidate(17, 89) == []\n\ndef test_check():\n check(generate_integers)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "py", - "prompt": "from typing import List\n\ndef mean_absolute_deviation(numbers: List[float]) -> float:\n \"\"\" For a given list of input numbers, calculate Mean Absolute Deviation\n around the mean of this dataset.\n Mean Absolute Deviation is the average absolute difference between each\n element and a centerpoint (mean in this case):\n MAD = average | x - x_mean |\n >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n 1.0\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1.0, 2.0]) == 0.5\n assert candidate([1.0, 2.0, 3.0, 4.0]) == 1.0\n assert candidate([1.0, 2.0, 3.0, 4.0, 5.0]) == 1.2\n\ndef test_check():\n check(mean_absolute_deviation)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "py", - "prompt": "def encrypt(s: str) -> str:\n \"\"\"Create a function encrypt that takes a string as an argument and\n returns a string encrypted with the alphabet being rotated. \n The alphabet should be rotated in a manner such that the letters \n shift down by two multiplied to two places.\n For example:\n encrypt('hi') returns 'lm'\n encrypt('asdfghjkl') returns 'ewhjklnop'\n encrypt('gf') returns 'kj'\n encrypt('et') returns 'ix'\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('hi') == 'lm'\n assert candidate('asdfghjkl') == 'ewhjklnop'\n assert candidate('gf') == 'kj'\n assert candidate('et') == 'ix'\n assert candidate('faewfawefaewg') == 'jeiajeaijeiak'\n assert candidate('hellomyfriend') == 'lippsqcjvmirh'\n assert candidate('dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh') == 'hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl'\n assert candidate('a') == 'e'\n\ndef test_check():\n check(encrypt)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "py", - "prompt": "from typing import List\n\ndef get_odd_collatz(n: int) -> List[int]:\n \"\"\"\n Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n\n The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n as follows: start with any positive integer n. Then each term is obtained from the \n previous term as follows: if the previous term is even, the next term is one half of \n the previous term. If the previous term is odd, the next term is 3 times the previous\n term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n\n Note: \n 1. Collatz(1) is [1].\n 2. returned list sorted in increasing order.\n\n For example:\n get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(14) == [1, 5, 7, 11, 13, 17]\n assert candidate(5) == [1, 5]\n assert candidate(12) == [1, 3, 5]\n assert candidate(1) == [1]\n\ndef test_check():\n check(get_odd_collatz)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "py", - "prompt": "def how_many_times(string: str, substring: str) -> int:\n \"\"\" Find how many times a given substring can be found in the original string. Count overlaping cases.\n >>> how_many_times('', 'a')\n 0\n >>> how_many_times('aaa', 'a')\n 3\n >>> how_many_times('aaaa', 'aa')\n 3\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('', 'x') == 0\n assert candidate('xyxyxyx', 'x') == 4\n assert candidate('cacacacac', 'cac') == 4\n assert candidate('john doe', 'john') == 1\n\ndef test_check():\n check(how_many_times)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "py", - "prompt": "from typing import List\n\ndef move_one_ball(arr: List[int]) -> bool:\n \"\"\"We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n numbers in the array will be randomly ordered. Your task is to determine if\n it is possible to get an array sorted in non-decreasing order by performing \n the following operation on the given array:\n You are allowed to perform right shift operation any number of times.\n \n One right shift operation means shifting all elements of the array by one\n position in the right direction. The last element of the array will be moved to\n the starting position in the array i.e. 0th index. \n\n If it is possible to obtain the sorted array by performing the above operation\n then return True else return False.\n If the given array is empty then return True.\n\n Note: The given list is guaranteed to have unique elements.\n\n For Example:\n \n move_one_ball([3, 4, 5, 1, 2])==>True\n Explanation: By performin 2 right shift operations, non-decreasing order can\n be achieved for the given array.\n move_one_ball([3, 5, 4, 1, 2])==>False\n Explanation:It is not possible to get non-decreasing order for the given\n array by performing any number of right shift operations.\n \n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([3, 4, 5, 1, 2]) == True\n assert candidate([3, 5, 10, 1, 2]) == True\n assert candidate([4, 3, 1, 2]) == False\n assert candidate([3, 5, 4, 1, 2]) == False\n assert candidate([]) == True\n\ndef test_check():\n check(move_one_ball)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "py", - "prompt": "from typing import List\n\ndef order_by_points(nums: List[int]) -> List[int]:\n \"\"\"\n Write a function which sorts the given list of integers\n in ascending order according to the sum of their digits.\n Note: if there are several items with similar sum of their digits,\n order them based on their index in original list.\n\n For example:\n >>> order_by_points([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]\n >>> order_by_points([]) == []\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]\n assert candidate([1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]) == [0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457]\n assert candidate([]) == []\n assert candidate([1, -11, -32, 43, 54, -98, 2, -3]) == [-3, -32, -98, -11, 1, 2, 43, 54]\n assert candidate([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) == [1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9]\n assert candidate([0, 6, 6, -76, -21, 23, 4]) == [-76, -21, 0, 4, 23, 6, 6]\n\ndef test_check():\n check(order_by_points)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "py", - "prompt": "from typing import List\n\ndef factorize(n: int) -> List[int]:\n \"\"\" Return list of prime factors of given integer in the order from smallest to largest.\n Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n Input number should be equal to the product of all factors\n >>> factorize(8)\n [2, 2, 2]\n >>> factorize(25)\n [5, 5]\n >>> factorize(70)\n [2, 5, 7]\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(2) == [2]\n assert candidate(4) == [2, 2]\n assert candidate(8) == [2, 2, 2]\n assert candidate(57) == [3, 19]\n assert candidate(3249) == [3, 3, 19, 19]\n assert candidate(185193) == [3, 3, 3, 19, 19, 19]\n assert candidate(20577) == [3, 19, 19, 19]\n assert candidate(18) == [2, 3, 3]\n\ndef test_check():\n check(factorize)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "py", - "prompt": "from typing import List\n\ndef below_threshold(l: List[int], t: int) -> bool:\n \"\"\"Return True if all numbers in the list l are below threshold t.\n >>> below_threshold([1, 2, 4, 10], 100)\n True\n >>> below_threshold([1, 20, 4, 10], 5)\n False\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 4, 10], 100) == True\n assert candidate([1, 20, 4, 10], 5) == False\n assert candidate([1, 20, 4, 10], 21) == True\n assert candidate([1, 20, 4, 10], 22) == True\n assert candidate([1, 8, 4, 10], 11) == True\n assert candidate([1, 8, 4, 10], 10) == False\n\ndef test_check():\n check(below_threshold)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "py", - "prompt": "from typing import Union\n\ndef rounded_avg(n: int, m: int) -> Union[str, int]:\n \"\"\"You are given two positive integers n and m, and your task is to compute the\n average of the integers from n through m (including n and m). \n Round the answer to the nearest integer and convert that to binary.\n If n is greater than m, return -1.\n Example:\n rounded_avg(1, 5) => \"0b11\"\n rounded_avg(7, 5) => -1\n rounded_avg(10, 20) => \"0b1111\"\n rounded_avg(20, 33) => \"0b11010\"\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(1, 5) == '0b11'\n assert candidate(7, 13) == '0b1010'\n assert candidate(964, 977) == '0b1111001010'\n assert candidate(996, 997) == '0b1111100100'\n assert candidate(560, 851) == '0b1011000010'\n assert candidate(185, 546) == '0b101101110'\n assert candidate(362, 496) == '0b110101101'\n assert candidate(350, 902) == '0b1001110010'\n assert candidate(197, 233) == '0b11010111'\n assert candidate(7, 5) == -1\n assert candidate(5, 1) == -1\n assert candidate(5, 5) == '0b101'\n\ndef test_check():\n check(rounded_avg)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "py", - "prompt": "from typing import List\n\ndef parse_nested_parens(paren_string: str) -> List[int]:\n \"\"\" Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n For each of the group, output the deepest level of nesting of parentheses.\n E.g. (()()) has maximum two levels of nesting while ((())) has three.\n\n >>> parse_nested_parens('(()()) ((())) () ((())()())')\n [2, 3, 1, 3]\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('(()()) ((())) () ((())()())') == [2, 3, 1, 3]\n assert candidate('() (()) ((())) (((())))') == [1, 2, 3, 4]\n assert candidate('(()(())((())))') == [4]\n\ndef test_check():\n check(parse_nested_parens)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "py", - "prompt": "from typing import List\n\ndef solution(lst: List[int]) -> int:\n \"\"\"Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n \n\n Examples\n solution([5, 8, 7, 1]) ==> 12\n solution([3, 3, 3, 3, 3]) ==> 9\n solution([30, 13, 24, 321]) ==>0\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([5, 8, 7, 1]) == 12\n assert candidate([3, 3, 3, 3, 3]) == 9\n assert candidate([30, 13, 24, 321]) == 0\n assert candidate([5, 9]) == 5\n assert candidate([2, 4, 8]) == 0\n assert candidate([30, 13, 23, 32]) == 23\n assert candidate([3, 13, 2, 9]) == 3\n\ndef test_check():\n check(solution)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "py", - "prompt": "def get_max_triples(n: int) -> int:\n \"\"\"\n You are given a positive integer n. You have to create an integer array a of length n.\n For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n and a[i] + a[j] + a[k] is a multiple of 3.\n\n Example :\n Input: n = 5\n Output: 1\n Explanation: \n a = [1, 3, 7, 13, 21]\n The only valid triple is (1, 7, 13).\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(5) == 1\n assert candidate(6) == 4\n assert candidate(10) == 36\n assert candidate(100) == 53361\n\ndef test_check():\n check(get_max_triples)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "py", - "prompt": "from typing import Tuple\n\ndef bf(planet1: str, planet2: str) -> Tuple[str, ...]:\n \"\"\"\n There are eight planets in our solar system: the closerst to the Sun \n is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n Uranus, Neptune.\n Write a function that takes two planet names as strings planet1 and planet2. \n The function should return a tuple containing all planets whose orbits are \n located between the orbit of planet1 and the orbit of planet2, sorted by \n the proximity to the sun. \n The function should return an empty tuple if planet1 or planet2\n are not correct planet names. \n Examples\n bf(\"Jupiter\", \"Neptune\") ==> (\"Saturn\", \"Uranus\")\n bf(\"Earth\", \"Mercury\") ==> (\"Venus\")\n bf(\"Mercury\", \"Uranus\") ==> (\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\")\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('Jupiter', 'Neptune') == ('Saturn', 'Uranus')\n assert candidate('Earth', 'Mercury') == ('Venus',)\n assert candidate('Mercury', 'Uranus') == ('Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn')\n assert candidate('Neptune', 'Venus') == ('Earth', 'Mars', 'Jupiter', 'Saturn', 'Uranus')\n assert candidate('Earth', 'Earth') == ()\n assert candidate('Mars', 'Earth') == ()\n assert candidate('Jupiter', 'Makemake') == ()\n\ndef test_check():\n check(bf)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "py", - "prompt": "from typing import List, Optional\n\ndef next_smallest(lst: List[int]) -> Optional[int]:\n \"\"\"\n You are given a list of integers.\n Write a function next_smallest() that returns the 2nd smallest element of the list.\n Return None if there is no such element.\n \n next_smallest([1, 2, 3, 4, 5]) == 2\n next_smallest([5, 1, 4, 3, 2]) == 2\n next_smallest([]) == None\n next_smallest([1, 1]) == None\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 3, 4, 5]) == 2\n assert candidate([5, 1, 4, 3, 2]) == 2\n assert candidate([]) == None\n assert candidate([1, 1]) == None\n assert candidate([1, 1, 1, 1, 0]) == 1\n assert candidate([1, 1]) == None\n assert candidate([-35, 34, 12, -45]) == -35\n\ndef test_check():\n check(next_smallest)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "py", - "prompt": "def sort_numbers(numbers: str) -> str:\n \"\"\" Input is a space-delimited string of numberals from 'zero' to 'nine'.\n Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n Return the string with numbers sorted from smallest to largest\n >>> sort_numbers('three one five')\n 'one three five'\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('') == ''\n assert candidate('three') == 'three'\n assert candidate('three five nine') == 'three five nine'\n assert candidate('five zero four seven nine eight') == 'zero four five seven eight nine'\n assert candidate('six five four three two one zero') == 'zero one two three four five six'\n\ndef test_check():\n check(sort_numbers)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "py", - "prompt": "def cycpattern_check(a: str, b: str) -> bool:\n \"\"\"You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n cycpattern_check(\"abcd\",\"abd\") => False\n cycpattern_check(\"hello\",\"ell\") => True\n cycpattern_check(\"whassup\",\"psus\") => False\n cycpattern_check(\"abab\",\"baa\") => True\n cycpattern_check(\"efef\",\"eeff\") => False\n cycpattern_check(\"himenss\",\"simen\") => True\n\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('xyzw', 'xyw') == False\n assert candidate('yello', 'ell') == True\n assert candidate('whattup', 'ptut') == False\n assert candidate('efef', 'fee') == True\n assert candidate('abab', 'aabb') == False\n assert candidate('winemtt', 'tinem') == True\n\ndef test_check():\n check(cycpattern_check)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "py", - "prompt": "def decimal_to_binary(decimal: int) -> str:\n \"\"\"You will be given a number in decimal form and your task is to convert it to\n binary format. The function should return a string, with each character representing a binary\n number. Each character in the string will be '0' or '1'.\n\n There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n The extra characters are there to help with the format.\n\n Examples:\n decimal_to_binary(15) # returns \"db1111db\"\n decimal_to_binary(32) # returns \"db100000db\"\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(0) == 'db0db'\n assert candidate(32) == 'db100000db'\n assert candidate(103) == 'db1100111db'\n assert candidate(15) == 'db1111db'\n\ndef test_check():\n check(decimal_to_binary)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "py", - "prompt": "from typing import List\n\ndef filter_by_substring(strings: List[str], substring: str) -> List[str]:\n \"\"\" Filter an input list of strings only for ones that contain given substring\n >>> filter_by_substring([], 'a')\n []\n >>> filter_by_substring(['abc', 'bacd', 'cde', 'array'], 'a')\n ['abc', 'bacd', 'array']\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([], 'john') == []\n assert candidate(['xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'], 'xxx') == ['xxx', 'xxxAAA', 'xxx']\n assert candidate(['xxx', 'asd', 'aaaxxy', 'john doe', 'xxxAAA', 'xxx'], 'xx') == ['xxx', 'aaaxxy', 'xxxAAA', 'xxx']\n assert candidate(['grunt', 'trumpet', 'prune', 'gruesome'], 'run') == ['grunt', 'prune']\n\ndef test_check():\n check(filter_by_substring)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "py", - "prompt": "from typing import Tuple\n\ndef even_odd_count(num: int) -> Tuple[int, int]:\n \"\"\"Given an integer. return a tuple that has the number of even and odd digits respectively.\n\n Example:\n even_odd_count(-12) ==> (1, 1)\n even_odd_count(123) ==> (1, 2)\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(7) == (0, 1)\n assert candidate(-78) == (1, 1)\n assert candidate(3452) == (2, 2)\n assert candidate(346211) == (3, 3)\n assert candidate(-345821) == (3, 3)\n assert candidate(-2) == (1, 0)\n assert candidate(-45347) == (2, 3)\n assert candidate(0) == (1, 0)\n\ndef test_check():\n check(even_odd_count)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "py", - "prompt": "from typing import List\n\ndef find_max(words: List[str]) -> str:\n \"\"\"Write a function that accepts a list of strings.\n The list contains different words. Return the word with maximum number\n of unique characters. If multiple strings have maximum number of unique\n characters, return the one which comes first in lexicographical order.\n\n find_max([\"name\", \"of\", \"string\"]) == \"string\"\n find_max([\"name\", \"enam\", \"game\"]) == \"enam\"\n find_max([\"aaaaaaa\", \"bb\" ,\"cc\"]) == \"\"aaaaaaa\"\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(['name', 'of', 'string']) == 'string'\n assert candidate(['name', 'enam', 'game']) == 'enam'\n assert candidate(['aaaaaaa', 'bb', 'cc']) == 'aaaaaaa'\n assert candidate(['abc', 'cba']) == 'abc'\n assert candidate(['play', 'this', 'game', 'of', 'footbott']) == 'footbott'\n assert candidate(['we', 'are', 'gonna', 'rock']) == 'gonna'\n assert candidate(['we', 'are', 'a', 'mad', 'nation']) == 'nation'\n assert candidate(['this', 'is', 'a', 'prrk']) == 'this'\n assert candidate(['b']) == 'b'\n assert candidate(['play', 'play', 'play']) == 'play'\n\ndef test_check():\n check(find_max)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "py", - "prompt": "def starts_one_ends(n: int) -> int:\n \"\"\"\n Given a positive integer n, return the count of the numbers of n-digit\n positive integers that start or end with 1.\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(1) == 1\n assert candidate(2) == 18\n assert candidate(3) == 180\n assert candidate(4) == 1800\n assert candidate(5) == 18000\n\ndef test_check():\n check(starts_one_ends)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "py", - "prompt": "from typing import List, Tuple, Optional\n\ndef largest_smallest_integers(lst: List[int]) -> Tuple[Optional[int], Optional[int]]:\n \"\"\"\n Create a function that returns a tuple (a, b), where 'a' is\n the largest of negative integers, and 'b' is the smallest\n of positive integers in a list.\n If there is no negative or positive integers, return them as None.\n\n Examples:\n largest_smallest_integers([2, 4, 1, 3, 5, 7]) == (None, 1)\n largest_smallest_integers([]) == (None, None)\n largest_smallest_integers([0]) == (None, None)\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([2, 4, 1, 3, 5, 7]) == (None, 1)\n assert candidate([2, 4, 1, 3, 5, 7, 0]) == (None, 1)\n assert candidate([1, 3, 2, 4, 5, 6, -2]) == (-2, 1)\n assert candidate([4, 5, 3, 6, 2, 7, -7]) == (-7, 2)\n assert candidate([7, 3, 8, 4, 9, 2, 5, -9]) == (-9, 2)\n assert candidate([]) == (None, None)\n assert candidate([0]) == (None, None)\n assert candidate([-1, -3, -5, -6]) == (-1, None)\n assert candidate([-1, -3, -5, -6, 0]) == (-1, None)\n assert candidate([-6, -4, -4, -3, 1]) == (-3, 1)\n assert candidate([-6, -4, -4, -3, -100, 1]) == (-3, 1)\n\ndef test_check():\n check(largest_smallest_integers)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "py", - "prompt": "from typing import List\n\ndef pluck(arr: List[int]) -> List[int]:\n \"\"\"\n \"Given an array representing a branch of a tree that has non-negative integer nodes\n your task is to pluck one of the nodes and return it.\n The plucked node should be the node with the smallest even value.\n If multiple nodes with the same smallest even value are found return the node that has smallest index.\n\n The plucked node should be returned in a list, [ smalest_value, its index ],\n If there are no even values or the given array is empty, return [].\n\n Example 1:\n Input: [4,2,3]\n Output: [2, 1]\n Explanation: 2 has the smallest even value, and 2 has the smallest index.\n\n Example 2:\n Input: [1,2,3]\n Output: [2, 1]\n Explanation: 2 has the smallest even value, and 2 has the smallest index. \n\n Example 3:\n Input: []\n Output: []\n \n Example 4:\n Input: [5, 0, 3, 0, 4, 2]\n Output: [0, 1]\n Explanation: 0 is the smallest value, but there are two zeros,\n so we will choose the first zero, which has the smallest index.\n\n Constraints:\n * 1 <= nodes.length <= 10000\n * 0 <= node.value\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([4, 2, 3]) == [2, 1]\n assert candidate([1, 2, 3]) == [2, 1]\n assert candidate([]) == []\n assert candidate([5, 0, 3, 0, 4, 2]) == [0, 1]\n assert candidate([1, 2, 3, 0, 5, 3]) == [0, 3]\n assert candidate([5, 4, 8, 4, 8]) == [4, 1]\n assert candidate([7, 6, 7, 1]) == [6, 1]\n assert candidate([7, 9, 7, 1]) == []\n\ndef test_check():\n check(pluck)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "py", - "prompt": "from typing import List\n\ndef count_nums(arr: List[int]) -> int:\n \"\"\"\n Write a function count_nums which takes an array of integers and returns\n the number of elements which has a sum of digits > 0.\n If a number is negative, then its first signed digit will be negative:\n e.g. -123 has signed digits -1, 2, and 3.\n >>> count_nums([]) == 0\n >>> count_nums([-1, 11, -11]) == 1\n >>> count_nums([1, 1, 2]) == 3\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == 0\n assert candidate([-1, -2, 0]) == 0\n assert candidate([1, 1, 2, -2, 3, 4, 5]) == 6\n assert candidate([1, 6, 9, -6, 0, 1, 5]) == 5\n assert candidate([1, 100, 98, -7, 1, -1]) == 4\n assert candidate([12, 23, 34, -45, -56, 0]) == 5\n assert candidate([0, 1]) == 1\n assert candidate([1]) == 1\n\ndef test_check():\n check(count_nums)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "py", - "prompt": "from typing import List\n\ndef minPath(grid: List[List[int]], k: int) -> List[int]:\n \"\"\"\n Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n each cell of the grid contains a value. Every integer in the range [1, N * N]\n inclusive appears exactly once on the cells of the grid.\n\n You have to find the minimum path of length k in the grid. You can start\n from any cell, and in each step you can move to any of the neighbor cells,\n in other words, you can go to cells which share an edge with you current\n cell.\n Please note that a path of length k means visiting exactly k cells (not\n necessarily distinct).\n You CANNOT go off the grid.\n A path A (of length k) is considered less than a path B (of length k) if\n after making the ordered lists of the values on the cells that A and B go\n through (let's call them lst_A and lst_B), lst_A is lexicographically less\n than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n lst_A[j] = lst_B[j].\n It is guaranteed that the answer is unique.\n Return an ordered list of the values on the cells that the minimum path go through.\n\n Examples:\n\n Input: grid = [ [1,2,3], [4,5,6], [7,8,9]], k = 3\n Output: [1, 2, 1]\n\n Input: grid = [ [5,9,3], [4,1,6], [7,8,2]], k = 1\n Output: [1]\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3) == [1, 2, 1]\n assert candidate([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1) == [1]\n assert candidate([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], 4) == [1, 2, 1, 2]\n assert candidate([[6, 4, 13, 10], [5, 7, 12, 1], [3, 16, 11, 15], [8, 14, 9, 2]], 7) == [1, 10, 1, 10, 1, 10, 1]\n assert candidate([[8, 14, 9, 2], [6, 4, 13, 15], [5, 7, 1, 12], [3, 10, 11, 16]], 5) == [1, 7, 1, 7, 1]\n assert candidate([[11, 8, 7, 2], [5, 16, 14, 4], [9, 3, 15, 6], [12, 13, 10, 1]], 9) == [1, 6, 1, 6, 1, 6, 1, 6, 1]\n assert candidate([[12, 13, 10, 1], [9, 3, 15, 6], [5, 16, 14, 4], [11, 8, 7, 2]], 12) == [1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6]\n assert candidate([[2, 7, 4], [3, 1, 5], [6, 8, 9]], 8) == [1, 3, 1, 3, 1, 3, 1, 3]\n assert candidate([[6, 1, 5], [3, 8, 9], [2, 7, 4]], 8) == [1, 5, 1, 5, 1, 5, 1, 5]\n assert candidate([[1, 2], [3, 4]], 10) == [1, 2, 1, 2, 1, 2, 1, 2, 1, 2]\n assert candidate([[1, 3], [3, 2]], 10) == [1, 3, 1, 3, 1, 3, 1, 3, 1, 3]\n\ndef test_check():\n check(minPath)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "py", - "prompt": "from typing import List\n\ndef strange_sort_list(lst: List[int]) -> List[int]:\n \"\"\"\n Given list of integers, return list in strange order.\n Strange sorting, is when you start with the minimum value,\n then maximum of the remaining integers, then minimum and so on.\n\n Examples:\n strange_sort_list([1, 2, 3, 4]) == [1, 4, 2, 3]\n strange_sort_list([5, 5, 5, 5]) == [5, 5, 5, 5]\n strange_sort_list([]) == []\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 3, 4]) == [1, 4, 2, 3]\n assert candidate([5, 6, 7, 8, 9]) == [5, 9, 6, 8, 7]\n assert candidate([1, 2, 3, 4, 5]) == [1, 5, 2, 4, 3]\n assert candidate([5, 6, 7, 8, 9, 1]) == [1, 9, 5, 8, 6, 7]\n assert candidate([5, 5, 5, 5]) == [5, 5, 5, 5]\n assert candidate([]) == []\n assert candidate([1, 2, 3, 4, 5, 6, 7, 8]) == [1, 8, 2, 7, 3, 6, 4, 5]\n assert candidate([0, 2, 2, 2, 5, 5, -5, -5]) == [-5, 5, -5, 5, 0, 2, 2, 2]\n assert candidate([111111]) == [111111]\n\ndef test_check():\n check(strange_sort_list)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "py", - "prompt": "from typing import Optional\n\ndef string_to_md5(text: str) -> Optional[str]:\n \"\"\"\n Given a string 'text', return its md5 hash equivalent string.\n If 'text' is an empty string, return None.\n\n >>> string_to_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'\n assert candidate('') == None\n assert candidate('A B C') == '0ef78513b0cb8cef12743f5aeb35f888'\n assert candidate('password') == '5f4dcc3b5aa765d61d8327deb882cf99'\n\ndef test_check():\n check(string_to_md5)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "py", - "prompt": "def get_closest_vowel(word: str) -> str:\n \"\"\"You are given a word. Your task is to find the closest vowel that stands between \n two consonants from the right side of the word (case sensitive).\n \n Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n find any vowel met the above condition. \n\n You may assume that the given string contains English letter only.\n\n Example:\n get_closest_vowel(\"yogurt\") ==> \"u\"\n get_closest_vowel(\"FULL\") ==> \"U\"\n get_closest_vowel(\"quick\") ==> \"\"\n get_closest_vowel(\"ab\") ==> \"\"\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('yogurt') == 'u'\n assert candidate('full') == 'u'\n assert candidate('easy') == ''\n assert candidate('eAsy') == ''\n assert candidate('ali') == ''\n assert candidate('bad') == 'a'\n assert candidate('most') == 'o'\n assert candidate('ab') == ''\n assert candidate('ba') == ''\n assert candidate('quick') == ''\n assert candidate('anime') == 'i'\n assert candidate('Asia') == ''\n assert candidate('Above') == 'o'\n\ndef test_check():\n check(get_closest_vowel)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "py", - "prompt": "def change_base(x: int, base: int) -> str:\n \"\"\"Change numerical base of input number x to base.\n return string representation after the conversion.\n base numbers are less than 10.\n >>> change_base(8, 3)\n '22'\n >>> change_base(8, 2)\n '1000'\n >>> change_base(7, 2)\n '111'\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(8, 3) == '22'\n assert candidate(9, 3) == '100'\n assert candidate(234, 2) == '11101010'\n assert candidate(16, 2) == '10000'\n assert candidate(8, 2) == '1000'\n assert candidate(7, 2) == '111'\n assert candidate(2, 3) == '2'\n assert candidate(3, 4) == '3'\n assert candidate(4, 5) == '4'\n assert candidate(5, 6) == '5'\n assert candidate(6, 7) == '6'\n assert candidate(7, 8) == '7'\n\ndef test_check():\n check(change_base)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "py", - "prompt": "from typing import List\n\ndef has_close_elements(numbers: List[float], threshold: float) -> bool:\n \"\"\" Check if in given list of numbers, are any two numbers closer to each other than\n given threshold.\n >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n False\n >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n True\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3) == True\n assert candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05) == False\n assert candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.95) == True\n assert candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.8) == False\n assert candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1) == True\n assert candidate([1.1, 2.2, 3.1, 4.1, 5.1], 1.0) == True\n assert candidate([1.1, 2.2, 3.1, 4.1, 5.1], 0.5) == False\n\ndef test_check():\n check(has_close_elements)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "py", - "prompt": "def is_nested(string: str) -> bool:\n \"\"\"\n Create a function that takes a string as input which contains only square brackets.\n The function should return True if and only if there is a valid subsequence of brackets \n where at least one bracket in the subsequence is nested.\n\n is_nested('[[]]') \u279e True\n is_nested('[]]]]]]][[[[[]') \u279e False\n is_nested('[][]') \u279e False\n is_nested('[]') \u279e False\n is_nested('[[][]]') \u279e True\n is_nested('[[]][[') \u279e True\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('[[]]') == True\n assert candidate('[]]]]]]][[[[[]') == False\n assert candidate('[][]') == False\n assert candidate('[]') == False\n assert candidate('[[[[]]]]') == True\n assert candidate('[]]]]]]]]]]') == False\n assert candidate('[][][[]]') == True\n assert candidate('[[]') == False\n assert candidate('[]]') == False\n assert candidate('[[]][[') == True\n assert candidate('[[][]]') == True\n assert candidate('') == False\n assert candidate('[[[[[[[[') == False\n assert candidate(']]]]]]]]') == False\n\ndef test_check():\n check(is_nested)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "py", - "prompt": "from typing import List\n\ndef concatenate(strings: List[str]) -> str:\n \"\"\" Concatenate list of strings into a single string\n >>> concatenate([])\n ''\n >>> concatenate(['a', 'b', 'c'])\n 'abc'\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == ''\n assert candidate(['x', 'y', 'z']) == 'xyz'\n assert candidate(['x', 'y', 'z', 'w', 'k']) == 'xyzwk'\n\ndef test_check():\n check(concatenate)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "py", - "prompt": "def prime_fib(n: int) -> int:\n \"\"\"\n prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n >>> prime_fib(1)\n 2\n >>> prime_fib(2)\n 3\n >>> prime_fib(3)\n 5\n >>> prime_fib(4)\n 13\n >>> prime_fib(5)\n 89\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(1) == 2\n assert candidate(2) == 3\n assert candidate(3) == 5\n assert candidate(4) == 13\n assert candidate(5) == 89\n assert candidate(6) == 233\n assert candidate(7) == 1597\n assert candidate(8) == 28657\n assert candidate(9) == 514229\n assert candidate(10) == 433494437\n\ndef test_check():\n check(prime_fib)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "py", - "prompt": "from typing import List, Tuple\n\ndef find_closest_elements(numbers: List[float]) -> Tuple[float, float]:\n \"\"\" From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n other and return them in order (smaller number, larger number).\n >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n (2.0, 2.2)\n >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n (2.0, 2.0)\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2]) == (3.9, 4.0)\n assert candidate([1.0, 2.0, 5.9, 4.0, 5.0]) == (5.0, 5.9)\n assert candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]) == (2.0, 2.2)\n assert candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]) == (2.0, 2.0)\n assert candidate([1.1, 2.2, 3.1, 4.1, 5.1]) == (2.2, 3.1)\n\ndef test_check():\n check(find_closest_elements)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "py", - "prompt": "def hex_key(num: str) -> int:\n \"\"\"You have been tasked to write a function that receives \n a hexadecimal number as a string and counts the number of hexadecimal \n digits that are primes (prime number, or a prime, is a natural number \n greater than 1 that is not a product of two smaller natural numbers).\n Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n So you have to determine a number of the following digits: 2, 3, 5, 7, \n B (=decimal 11), D (=decimal 13).\n Note: you may assume the input is always correct or empty string, \n and symbols A,B,C,D,E,F are always uppercase.\n Examples:\n For num = \"AB\" the output should be 1.\n For num = \"1077E\" the output should be 2.\n For num = \"ABED1A33\" the output should be 4.\n For num = \"123456789ABCDEF0\" the output should be 6.\n For num = \"2020\" the output should be 2.\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('AB') == 1\n assert candidate('1077E') == 2\n assert candidate('ABED1A33') == 4\n assert candidate('2020') == 2\n assert candidate('123456789ABCDEF0') == 6\n assert candidate('112233445566778899AABBCCDDEEFF00') == 12\n\ndef test_check():\n check(hex_key)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "py", - "prompt": "def multiply(a: int, b: int) -> int:\n \"\"\"Complete the function that takes two integers and returns \n the product of their unit digits.\n Assume the input is always valid.\n Examples:\n multiply(148, 412) should return 16.\n multiply(19, 28) should return 72.\n multiply(2020, 1851) should return 0.\n multiply(14,-15) should return 20.\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(148, 412) == 16\n assert candidate(19, 28) == 72\n assert candidate(2020, 1851) == 0\n assert candidate(14, -15) == 20\n assert candidate(76, 67) == 42\n assert candidate(17, 27) == 49\n assert candidate(0, 1) == 0\n assert candidate(0, 0) == 0\n\ndef test_check():\n check(multiply)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "py", - "prompt": "from typing import List\n\ndef rescale_to_unit(numbers: List[float]) -> List[float]:\n \"\"\" Given list of numbers (of at least two elements), apply a linear transform to that list,\n such that the smallest number will become 0 and the largest will become 1\n >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n [0.0, 0.25, 0.5, 0.75, 1.0]\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([2.0, 49.9]) == [0.0, 1.0]\n assert candidate([100.0, 49.9]) == [1.0, 0.0]\n assert candidate([1.0, 2.0, 3.0, 4.0, 5.0]) == [0.0, 0.25, 0.5, 0.75, 1.0]\n assert candidate([2.0, 1.0, 5.0, 3.0, 4.0]) == [0.25, 0.0, 1.0, 0.5, 0.75]\n assert candidate([12.0, 11.0, 15.0, 13.0, 14.0]) == [0.25, 0.0, 1.0, 0.5, 0.75]\n\ndef test_check():\n check(rescale_to_unit)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "py", - "prompt": "def digits(n: int) -> int:\n \"\"\"Given a positive integer n, return the product of the odd digits.\n Return 0 if all digits are even.\n For example:\n digits(1) == 1\n digits(4) == 0\n digits(235) == 15\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(5) == 5\n assert candidate(54) == 5\n assert candidate(120) == 1\n assert candidate(5014) == 5\n assert candidate(98765) == 315\n assert candidate(5576543) == 2625\n assert candidate(2468) == 0\n\ndef test_check():\n check(digits)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "py", - "prompt": "from typing import List\n\ndef Strongest_Extension(class_name: str, extensions: List[str]) -> str:\n \"\"\"You will be given the name of a class (a string) and a list of extensions.\n The extensions are to be used to load additional classes to the class. The\n strength of the extension is as follows: Let CAP be the number of the uppercase\n letters in the extension's name, and let SM be the number of lowercase letters \n in the extension's name, the strength is given by the fraction CAP - SM. \n You should find the strongest extension and return a string in this \n format: ClassName.StrongestExtensionName.\n If there are two or more extensions with the same strength, you should\n choose the one that comes first in the list.\n For example, if you are given \"Slices\" as the class and a list of the\n extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n (its strength is -1).\n Example:\n for Strongest_Extension('my_class', ['AA', 'Be', 'CC']) == 'my_class.AA'\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('Watashi', ['tEN', 'niNE', 'eIGHt8OKe']) == 'Watashi.eIGHt8OKe'\n assert candidate('Boku123', ['nani', 'NazeDa', 'YEs.WeCaNe', '32145tggg']) == 'Boku123.YEs.WeCaNe'\n assert candidate('__YESIMHERE', ['t', 'eMptY', 'nothing', 'zeR00', 'NuLl__', '123NoooneB321']) == '__YESIMHERE.NuLl__'\n assert candidate('K', ['Ta', 'TAR', 't234An', 'cosSo']) == 'K.TAR'\n assert candidate('__HAHA', ['Tab', '123', '781345', '-_-']) == '__HAHA.123'\n assert candidate('YameRore', ['HhAas', 'okIWILL123', 'WorkOut', 'Fails', '-_-']) == 'YameRore.okIWILL123'\n assert candidate('finNNalLLly', ['Die', 'NowW', 'Wow', 'WoW']) == 'finNNalLLly.WoW'\n assert candidate('_', ['Bb', '91245']) == '_.Bb'\n assert candidate('Sp', ['671235', 'Bb']) == 'Sp.671235'\n\ndef test_check():\n check(Strongest_Extension)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "py", - "prompt": "from typing import Dict\n\ndef histogram(test: str) -> Dict[str, int]:\n \"\"\"Given a string representing a space separated lowercase letters, return a dictionary\n of the letter with the most repetition and containing the corresponding count.\n If several letters have the same occurrence, return all of them.\n \n Example:\n histogram('a b c') == {'a': 1, 'b': 1, 'c': 1}\n histogram('a b b a') == {'a': 2, 'b': 2}\n histogram('a b c a b') == {'a': 2, 'b': 2}\n histogram('b b b b a') == {'b': 4}\n histogram('') == {}\n\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('a b b a') == { 'a': 2, 'b': 2 }\n assert candidate('a b c a b') == { 'a': 2, 'b': 2 }\n assert candidate('a b c d g') == { 'a': 1, 'b': 1, 'c': 1, 'd': 1, 'g': 1 }\n assert candidate('r t g') == { 'r': 1, 't': 1, 'g': 1 }\n assert candidate('b b b b a') == { 'b': 4 }\n assert candidate('r t g') == { 'r': 1, 't': 1, 'g': 1 }\n assert candidate('') == { }\n assert candidate('a') == { 'a': 1 }\n\ndef test_check():\n check(histogram)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "py", - "prompt": "from typing import List\n\ndef pairs_sum_to_zero(l: List[int]) -> bool:\n \"\"\"\n pairs_sum_to_zero takes a list of integers as an input.\n it returns True if there are two distinct elements in the list that\n sum to zero, and False otherwise.\n >>> pairs_sum_to_zero([1, 3, 5, 0])\n False\n >>> pairs_sum_to_zero([1, 3, -2, 1])\n False\n >>> pairs_sum_to_zero([1, 2, 3, 7])\n False\n >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7])\n True\n >>> pairs_sum_to_zero([1])\n False\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 3, 5, 0]) == False\n assert candidate([1, 3, -2, 1]) == False\n assert candidate([1, 2, 3, 7]) == False\n assert candidate([2, 4, -5, 3, 5, 7]) == True\n assert candidate([1]) == False\n assert candidate([-3, 9, -1, 3, 2, 30]) == True\n assert candidate([-3, 9, -1, 3, 2, 31]) == True\n assert candidate([-3, 9, -1, 4, 2, 30]) == False\n assert candidate([-3, 9, -1, 4, 2, 31]) == False\n\ndef test_check():\n check(pairs_sum_to_zero)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "py", - "prompt": "from typing import List\n\ndef total_match(lst1: List[str], lst2: List[str]) -> List[str]:\n \"\"\"\n Write a function that accepts two lists of strings and returns the list that has \n total number of chars in the all strings of the list less than the other list.\n\n if the two lists have the same number of chars, return the first list.\n\n Examples\n total_match([], []) \u279e []\n total_match(['hi', 'admin'], ['hI', 'Hi']) \u279e ['hI', 'Hi']\n total_match(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) \u279e ['hi', 'admin']\n total_match(['hi', 'admin'], ['hI', 'hi', 'hi']) \u279e ['hI', 'hi', 'hi']\n total_match(['4'], ['1', '2', '3', '4', '5']) \u279e ['4']\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([], []) == []\n assert candidate(['hi', 'admin'], ['hi', 'hi']) == ['hi', 'hi']\n assert candidate(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) == ['hi', 'admin']\n assert candidate(['4'], ['1', '2', '3', '4', '5']) == ['4']\n assert candidate(['hi', 'admin'], ['hI', 'Hi']) == ['hI', 'Hi']\n assert candidate(['hi', 'admin'], ['hI', 'hi', 'hi']) == ['hI', 'hi', 'hi']\n assert candidate(['hi', 'admin'], ['hI', 'hi', 'hii']) == ['hi', 'admin']\n assert candidate([], ['this']) == []\n assert candidate(['this'], []) == []\n\ndef test_check():\n check(total_match)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "py", - "prompt": "def circular_shift(x: int, shift: int) -> str:\n \"\"\"Circular shift the digits of the integer x, shift the digits right by shift\n and return the result as a string.\n If shift > number of digits, return digits reversed.\n >>> circular_shift(12, 1)\n \"21\"\n >>> circular_shift(12, 2)\n \"12\"\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(100, 2) == '001'\n assert candidate(12, 2) == '12'\n assert candidate(97, 8) == '79'\n assert candidate(12, 1) == '21'\n assert candidate(11, 101) == '11'\n\ndef test_check():\n check(circular_shift)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "py", - "prompt": "from typing import List\n\ndef monotonic(l: List[int]) -> bool:\n \"\"\"Return True is list elements are monotonically increasing or decreasing.\n >>> monotonic([1, 2, 4, 20])\n True\n >>> monotonic([1, 20, 4, 10])\n False\n >>> monotonic([4, 1, 0, -10])\n True\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 4, 10]) == True\n assert candidate([1, 2, 4, 20]) == True\n assert candidate([1, 20, 4, 10]) == False\n assert candidate([4, 1, 0, -10]) == True\n assert candidate([4, 1, 1, 0]) == True\n assert candidate([1, 2, 3, 2, 5, 60]) == False\n assert candidate([1, 2, 3, 4, 5, 60]) == True\n assert candidate([9, 9, 9, 9]) == True\n\ndef test_check():\n check(monotonic)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "py", - "prompt": "def is_equal_to_sum_even(n: int) -> bool:\n \"\"\"Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n Example\n is_equal_to_sum_even(4) == False\n is_equal_to_sum_even(6) == False\n is_equal_to_sum_even(8) == True\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(4) == False\n assert candidate(6) == False\n assert candidate(8) == True\n assert candidate(10) == True\n assert candidate(11) == False\n assert candidate(12) == True\n assert candidate(13) == False\n assert candidate(16) == True\n\ndef test_check():\n check(is_equal_to_sum_even)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "py", - "prompt": "from typing import List\n\ndef parse_music(music_string: str) -> List[int]:\n \"\"\" Input to this function is a string representing musical notes in a special ASCII format.\n Your task is to parse this string and return list of integers corresponding to how many beats does each\n not last.\n\n Here is a legend:\n 'o' - whole note, lasts four beats\n 'o|' - half note, lasts two beats\n '.|' - quater note, lasts one beat\n\n >>> parse_music('o o| .| o| o| .| .| .| .| o o')\n [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('') == []\n assert candidate('o o o o') == [4, 4, 4, 4]\n assert candidate('.| .| .| .|') == [1, 1, 1, 1]\n assert candidate('o| o| .| .| o o o o') == [2, 2, 1, 1, 4, 4, 4, 4]\n assert candidate('o| .| o| .| o o| o o|') == [2, 1, 2, 1, 4, 2, 4, 2]\n\ndef test_check():\n check(parse_music)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "py", - "prompt": "from typing import List\n\ndef sum_squares(lst: List[int]) -> int:\n \"\"\"\"\n This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n \n Examples:\n For lst = [1,2,3] the output should be 6\n For lst = [] the output should be 0\n For lst = [-1,-5,2,-1,-5] the output should be -126\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 3]) == 6\n assert candidate([1, 4, 9]) == 14\n assert candidate([]) == 0\n assert candidate([1, 1, 1, 1, 1, 1, 1, 1, 1]) == 9\n assert candidate([-1, -1, -1, -1, -1, -1, -1, -1, -1]) == -3\n assert candidate([0]) == 0\n assert candidate([-1, -5, 2, -1, -5]) == -126\n assert candidate([-56, -99, 1, 0, -2]) == 3030\n assert candidate([-1, 0, 0, 0, 0, 0, 0, 0, -1]) == 0\n assert candidate([-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37]) == -14196\n assert candidate([-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10]) == -1448\n\ndef test_check():\n check(sum_squares)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "py", - "prompt": "from typing import List\n\ndef triples_sum_to_zero(l: List[int]) -> bool:\n \"\"\"\n triples_sum_to_zero takes a list of integers as an input.\n it returns True if there are three distinct elements in the list that\n sum to zero, and False otherwise.\n\n >>> triples_sum_to_zero([1, 3, 5, 0])\n False\n >>> triples_sum_to_zero([1, 3, -2, 1])\n True\n >>> triples_sum_to_zero([1, 2, 3, 7])\n False\n >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n True\n >>> triples_sum_to_zero([1])\n False\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 3, 5, 0]) == False\n assert candidate([1, 3, 5, -1]) == False\n assert candidate([1, 3, -2, 1]) == True\n assert candidate([1, 2, 3, 7]) == False\n assert candidate([1, 2, 5, 7]) == False\n assert candidate([2, 4, -5, 3, 9, 7]) == True\n assert candidate([1]) == False\n assert candidate([1, 3, 5, -100]) == False\n assert candidate([100, 3, 5, -100]) == False\n\ndef test_check():\n check(triples_sum_to_zero)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "py", - "prompt": "def correct_bracketing(brackets: str) -> bool:\n \"\"\" brackets is a string of \"<\" and \">\".\n return True if every opening bracket has a corresponding closing bracket.\n\n >>> correct_bracketing(\"<\")\n False\n >>> correct_bracketing(\"<>\")\n True\n >>> correct_bracketing(\"<<><>>\")\n True\n >>> correct_bracketing(\"><<>\")\n False\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('<>') == True\n assert candidate('<<><>>') == True\n assert candidate('<><><<><>><>') == True\n assert candidate('<><><<<><><>><>><<><><<>>>') == True\n assert candidate('<<<><>>>>') == False\n assert candidate('><<>') == False\n assert candidate('<') == False\n assert candidate('<<<<') == False\n assert candidate('>') == False\n assert candidate('<<>') == False\n assert candidate('<><><<><>><>><<>') == False\n assert candidate('<><><<><>><>>><>') == False\n\ndef test_check():\n check(correct_bracketing)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "py", - "prompt": "from typing import List\n\ndef specialFilter(nums: List[int]) -> int:\n \"\"\"Write a function that takes an array of numbers as input and returns \n the number of elements in the array that are greater than 10 and both \n first and last digits of a number are odd (1, 3, 5, 7, 9).\n For example:\n specialFilter([15, -73, 14, -15]) => 1 \n specialFilter([33, -2, -3, 45, 21, 109]) => 2\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([5, -2, 1, -5]) == 0\n assert candidate([15, -73, 14, -15]) == 1\n assert candidate([33, -2, -3, 45, 21, 109]) == 2\n assert candidate([43, -12, 93, 125, 121, 109]) == 4\n assert candidate([71, -2, -33, 75, 21, 19]) == 3\n assert candidate([1]) == 0\n assert candidate([]) == 0\n\ndef test_check():\n check(specialFilter)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "py", - "prompt": "from typing import Dict\n\ndef check_dict_case(dict: Dict[str, str]) -> bool:\n \"\"\"\n Given a dictionary, return True if all keys are strings in lower \n case or all keys are strings in upper case, else return False.\n The function should return False is the given dictionary is empty.\n Examples:\n check_dict_case({\"a\":\"apple\", \"b\":\"banana\"}) should return True.\n check_dict_case({\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}) should return False.\n check_dict_case({\"a\":\"apple\", \"8\":\"banana\", \"a\":\"apple\"}) should return False.\n check_dict_case({\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}) should return False.\n check_dict_case({\"STATE\":\"NC\", \"ZIP\":\"12345\" }) should return True.\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate({ 'p': 'pineapple', 'b': 'banana' }) == True\n assert candidate({ 'p': 'pineapple', 'A': 'banana', 'B': 'banana' }) == False\n assert candidate({ 'p': 'pineapple', '5': 'banana', 'a': 'apple' }) == False\n assert candidate({ 'Name': 'John', 'Age': '36', 'City': 'Houston' }) == False\n assert candidate({ 'STATE': 'NC', 'ZIP': '12345' }) == True\n assert candidate({ 'fruit': 'Orange', 'taste': 'Sweet' }) == True\n assert candidate({ }) == False\n\ndef test_check():\n check(check_dict_case)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "py", - "prompt": "from typing import Union, List\n\ndef split_words(txt: str) -> Union[List[str], int]:\n \"\"\"\n Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n Examples\n split_words(\"Hello world!\") \u279e [\"Hello\", \"world!\"]\n split_words(\"Hello,world!\") \u279e [\"Hello\", \"world!\"]\n split_words(\"abcdef\") == 3 \n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('Hello world!') == ['Hello', 'world!']\n assert candidate('Hello,world!') == ['Hello', 'world!']\n assert candidate('Hello world,!') == ['Hello', 'world,!']\n assert candidate('Hello,Hello,world !') == ['Hello,Hello,world', '!']\n assert candidate('abcdef') == 3\n assert candidate('aaabb') == 2\n assert candidate('aaaBb') == 1\n assert candidate('') == 0\n\ndef test_check():\n check(split_words)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "py", - "prompt": "def fibfib(n: int) -> int:\n \"\"\"The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fibfib(0) == 0\n fibfib(1) == 0\n fibfib(2) == 1\n fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n >>> fibfib(1)\n 0\n >>> fibfib(5)\n 4\n >>> fibfib(8)\n 24\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(2) == 1\n assert candidate(1) == 0\n assert candidate(5) == 4\n assert candidate(8) == 24\n assert candidate(10) == 81\n assert candidate(12) == 274\n assert candidate(14) == 927\n\ndef test_check():\n check(fibfib)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "py", - "prompt": "from typing import List\n\ndef sum_squares(lst: List[float]) -> int:\n \"\"\"You are given a list of numbers.\n You need to return the sum of squared numbers in the given list,\n round each element in the list to the upper int(Ceiling) first.\n Examples:\n For lst = [1,2,3] the output should be 14\n For lst = [1,4,9] the output should be 98\n For lst = [1,3,5,7] the output should be 84\n For lst = [1.4,4.2,0] the output should be 29\n For lst = [-2.4,1,1] the output should be 6\n \n\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1.0, 2.0, 3.0]) == 14\n assert candidate([1.0, 2.0, 3.0]) == 14\n assert candidate([1.0, 3.0, 5.0, 7.0]) == 84\n assert candidate([1.4, 4.2, 0.0]) == 29\n assert candidate([-2.4, 1.0, 1.0]) == 6\n assert candidate([100.0, 1.0, 15.0, 2.0]) == 10230\n assert candidate([10000.0, 10000.0]) == 200000000\n assert candidate([-1.4, 4.6, 6.3]) == 75\n assert candidate([-1.4, 17.9, 18.9, 19.9]) == 1086\n assert candidate([0.0]) == 0\n assert candidate([-1.0]) == 1\n assert candidate([-1.0, 1.0, 0.0]) == 2\n\ndef test_check():\n check(sum_squares)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_85_add", - "language": "py", - "prompt": "from typing import List\n\ndef add(lst: List[int]) -> int:\n \"\"\"Given a non-empty list of integers lst. add the even elements that are at odd indices..\n\n\n Examples:\n add([4, 2, 6, 7]) ==> 2 \n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([4, 88]) == 88\n assert candidate([4, 5, 6, 7, 2, 122]) == 122\n assert candidate([4, 0, 6, 7]) == 0\n assert candidate([4, 4, 6, 8]) == 12\n\ndef test_check():\n check(add)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "py", - "prompt": "from typing import List\n\ndef unique(l: List[int]) -> List[int]:\n \"\"\"Return sorted unique elements in a list\n >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123])\n [0, 2, 3, 5, 9, 123]\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([5, 3, 5, 2, 3, 3, 9, 0, 123]) == [0, 2, 3, 5, 9, 123]\n\ndef test_check():\n check(unique)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "py", - "prompt": "def fix_spaces(text: str) -> str:\n \"\"\"\n Given a string text, replace all spaces in it with underscores, \n and if a string has more than 2 consecutive spaces, \n then replace all consecutive spaces with - \n \n fix_spaces(\"Example\") == \"Example\"\n fix_spaces(\"Example 1\") == \"Example_1\"\n fix_spaces(\" Example 2\") == \"_Example_2\"\n fix_spaces(\" Example 3\") == \"_Example-3\"\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('Example') == 'Example'\n assert candidate('Mudasir Hanif ') == 'Mudasir_Hanif_'\n assert candidate('Yellow Yellow Dirty Fellow') == 'Yellow_Yellow__Dirty__Fellow'\n assert candidate('Exa mple') == 'Exa-mple'\n assert candidate(' Exa 1 2 2 mple') == '-Exa_1_2_2_mple'\n\ndef test_check():\n check(fix_spaces)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "py", - "prompt": "def modp(n: int, p: int) -> int:\n \"\"\"Return 2^n modulo p (be aware of numerics).\n >>> modp(3, 5)\n 3\n >>> modp(1101, 101)\n 2\n >>> modp(0, 101)\n 1\n >>> modp(3, 11)\n 8\n >>> modp(100, 101)\n 1\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(3, 5) == 3\n assert candidate(1101, 101) == 2\n assert candidate(0, 101) == 1\n assert candidate(3, 11) == 8\n assert candidate(100, 101) == 1\n assert candidate(30, 5) == 4\n assert candidate(31, 5) == 3\n\ndef test_check():\n check(modp)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "py", - "prompt": "def valid_date(date: str) -> bool:\n \"\"\"You have to write a function which validates a given date string and\n returns True if the date is valid otherwise False.\n The date is valid if all of the following rules are satisfied:\n 1. The date string is not empty.\n 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n 3. The months should not be less than 1 or higher than 12.\n 4. The date should be in the format: mm-dd-yyyy\n\n for example: \n valid_date('03-11-2000') => True\n\n valid_date('15-01-2012') => False\n\n valid_date('04-0-2040') => False\n\n valid_date('06-04-2020') => True\n\n valid_date('06/04/2020') => False\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('03-11-2000') == True\n assert candidate('15-01-2012') == False\n assert candidate('04-0-2040') == False\n assert candidate('06-04-2020') == True\n assert candidate('01-01-2007') == True\n assert candidate('03-32-2011') == False\n assert candidate('') == False\n assert candidate('04-31-3000') == False\n assert candidate('06-06-2005') == True\n assert candidate('21-31-2000') == False\n assert candidate('04-12-2003') == True\n assert candidate('04122003') == False\n assert candidate('20030412') == False\n assert candidate('2003-04') == False\n assert candidate('2003-04-12') == False\n assert candidate('04-2003') == False\n\ndef test_check():\n check(valid_date)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "py", - "prompt": "def anti_shuffle(s: str) -> str:\n \"\"\"\n Write a function that takes a string and returns an ordered version of it.\n Ordered version of string, is a string where all words (separated by space)\n are replaced by a new word where all the characters arranged in\n ascending order based on ascii value.\n Note: You should keep the order of words and blank spaces in the sentence.\n\n For example:\n anti_shuffle('Hi') returns 'Hi'\n anti_shuffle('hello') returns 'ehllo'\n anti_shuffle('Hello World!!!') returns 'Hello !!!Wdlor'\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('Hi') == 'Hi'\n assert candidate('hello') == 'ehllo'\n assert candidate('number') == 'bemnru'\n assert candidate('abcd') == 'abcd'\n assert candidate('Hello World!!!') == 'Hello !!!Wdlor'\n assert candidate('') == ''\n assert candidate('Hi. My name is Mister Robot. How are you?') == '.Hi My aemn is Meirst .Rboot How aer ?ouy'\n\ndef test_check():\n check(anti_shuffle)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "py", - "prompt": "from typing import List\n\ndef is_sorted(lst: List[int]) -> bool:\n \"\"\"\n Given a list of numbers, return whether or not they are sorted\n in ascending order. If list has more than 1 duplicate of the same\n number, return False. Assume no negative numbers and only integers.\n\n Examples\n is_sorted([5]) \u279e True\n is_sorted([1, 2, 3, 4, 5]) \u279e True\n is_sorted([1, 3, 2, 4, 5]) \u279e False\n is_sorted([1, 2, 3, 4, 5, 6]) \u279e True\n is_sorted([1, 2, 3, 4, 5, 6, 7]) \u279e True\n is_sorted([1, 3, 2, 4, 5, 6, 7]) \u279e False\n is_sorted([1, 2, 2, 3, 3, 4]) \u279e True\n is_sorted([1, 2, 2, 2, 3, 4]) \u279e False\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([5]) == True\n assert candidate([1, 2, 3, 4, 5]) == True\n assert candidate([1, 3, 2, 4, 5]) == False\n assert candidate([1, 2, 3, 4, 5, 6]) == True\n assert candidate([1, 2, 3, 4, 5, 6, 7]) == True\n assert candidate([1, 3, 2, 4, 5, 6, 7]) == False\n assert candidate([]) == True\n assert candidate([1]) == True\n assert candidate([3, 2, 1]) == False\n assert candidate([1, 2, 2, 2, 3, 4]) == False\n assert candidate([1, 2, 3, 3, 3, 4]) == False\n assert candidate([1, 2, 2, 3, 3, 4]) == True\n assert candidate([1, 2, 3, 4]) == True\n\ndef test_check():\n check(is_sorted)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "py", - "prompt": "def is_happy(s: str) -> bool:\n \"\"\"You are given a string s.\n Your task is to check if the string is happy or not.\n A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n For example:\n is_happy(a) => False\n is_happy(aa) => False\n is_happy(abcd) => True\n is_happy(aabb) => False\n is_happy(adb) => True\n is_happy(xyy) => False\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('a') == False\n assert candidate('aa') == False\n assert candidate('abcd') == True\n assert candidate('aabb') == False\n assert candidate('adb') == True\n assert candidate('xyy') == False\n assert candidate('iopaxpoi') == True\n assert candidate('iopaxioi') == False\n\ndef test_check():\n check(is_happy)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "py", - "prompt": "from typing import List\n\ndef will_it_fly(q: List[int], w: int) -> bool:\n \"\"\"\n Write a function that returns True if the object q will fly, and False otherwise.\n The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n\n Example:\n will_it_fly([1, 2], 5) \u279e False \n # 1+2 is less than the maximum possible weight, but it's unbalanced.\n\n will_it_fly([3, 2, 3], 1) \u279e False\n # it's balanced, but 3+2+3 is more than the maximum possible weight.\n\n will_it_fly([3, 2, 3], 9) \u279e True\n # 3+2+3 is less than the maximum possible weight, and it's balanced.\n\n will_it_fly([3], 5) \u279e True\n # 3 is less than the maximum possible weight, and it's balanced.\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([3, 2, 3], 9) == True\n assert candidate([1, 2], 5) == False\n assert candidate([3], 5) == True\n assert candidate([3, 2, 3], 1) == False\n assert candidate([1, 2, 3], 6) == False\n assert candidate([5], 5) == True\n\ndef test_check():\n check(will_it_fly)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "py", - "prompt": "from typing import List\n\ndef sort_array(array: List[int]) -> List[int]:\n \"\"\"\n Given an array of non-negative integers, return a copy of the given array after sorting,\n you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n or sort it in descending order if the sum( first index value, last index value) is even.\n\n Note:\n * don't change the given array.\n\n Examples:\n * sort_array([]) => []\n * sort_array([5]) => [5]\n * sort_array([2, 4, 3, 0, 1, 5]) => [0, 1, 2, 3, 4, 5]\n * sort_array([2, 4, 3, 0, 1, 5, 6]) => [6, 5, 4, 3, 2, 1, 0]\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == []\n assert candidate([5]) == [5]\n assert candidate([2, 4, 3, 0, 1, 5]) == [0, 1, 2, 3, 4, 5]\n assert candidate([2, 4, 3, 0, 1, 5, 6]) == [6, 5, 4, 3, 2, 1, 0]\n assert candidate([2, 1]) == [1, 2]\n assert candidate([15, 42, 87, 32, 11, 0]) == [0, 11, 15, 32, 42, 87]\n assert candidate([21, 14, 23, 11]) == [23, 21, 14, 11]\n\ndef test_check():\n check(sort_array)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "py", - "prompt": "from typing import List\n\ndef count_up_to(n: int) -> List[int]:\n \"\"\"Implement a function that takes an non-negative integer and returns an array of the first n\n integers that are prime numbers and less than n.\n for example:\n count_up_to(5) => [2,3]\n count_up_to(11) => [2,3,5,7]\n count_up_to(0) => []\n count_up_to(20) => [2,3,5,7,11,13,17,19]\n count_up_to(1) => []\n count_up_to(18) => [2,3,5,7,11,13,17]\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(5) == [2, 3]\n assert candidate(6) == [2, 3, 5]\n assert candidate(7) == [2, 3, 5]\n assert candidate(10) == [2, 3, 5, 7]\n assert candidate(0) == []\n assert candidate(22) == [2, 3, 5, 7, 11, 13, 17, 19]\n assert candidate(1) == []\n assert candidate(18) == [2, 3, 5, 7, 11, 13, 17]\n assert candidate(47) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43]\n assert candidate(101) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]\n\ndef test_check():\n check(count_up_to)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "py", - "prompt": "from typing import List, Optional\n\ndef longest(strings: List[str]) -> Optional[str]:\n \"\"\" Out of list of strings, return the longest one. Return the first one in case of multiple\n strings of the same length. Return None in case the input list is empty.\n >>> longest([])\n\n >>> longest(['a', 'b', 'c'])\n 'a'\n >>> longest(['a', 'bb', 'ccc'])\n 'ccc'\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == None\n assert candidate(['x', 'y', 'z']) == 'x'\n assert candidate(['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']) == 'zzzz'\n\ndef test_check():\n check(longest)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "py", - "prompt": "from typing import List\n\ndef by_length(arr: List[int]) -> List[str]:\n \"\"\"\n Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n reverse the resulting array, and then replace each digit by its corresponding name from\n \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n\n For example:\n arr = [2, 1, 1, 4, 5, 8, 2, 3] \n -> sort arr -> [1, 1, 2, 2, 3, 4, 5, 8] \n -> reverse arr -> [8, 5, 4, 3, 2, 2, 1, 1]\n return [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n \n If the array is empty, return an empty array:\n arr = []\n return []\n \n If the array has any strange number ignore it:\n arr = [1, -1 , 55] \n -> sort arr -> [-1, 1, 55]\n -> reverse arr -> [55, 1, -1]\n return = ['One']\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([2, 1, 1, 4, 5, 8, 2, 3]) == ['Eight', 'Five', 'Four', 'Three', 'Two', 'Two', 'One', 'One']\n assert candidate([]) == []\n assert candidate([1, -1, 55]) == ['One']\n assert candidate([1, -1, 3, 2]) == ['Three', 'Two', 'One']\n assert candidate([9, 4, 8]) == ['Nine', 'Eight', 'Four']\n\ndef test_check():\n check(by_length)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_106_f", - "language": "py", - "prompt": "from typing import List\n\ndef f(n: int) -> List[int]:\n \"\"\" Implement the function f that takes n as a parameter,\n 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\n or the sum of numbers from 1 to i otherwise.\n i starts from 1.\n the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n Example:\n f(5) == [1, 2, 6, 24, 15]\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(5) == [1, 2, 6, 24, 15]\n assert candidate(7) == [1, 2, 6, 24, 15, 720, 28]\n assert candidate(1) == [1]\n assert candidate(3) == [1, 2, 6]\n\ndef test_check():\n check(f)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "py", - "prompt": "def fizz_buzz(n: int) -> int:\n \"\"\"Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n >>> fizz_buzz(50)\n 0\n >>> fizz_buzz(78)\n 2\n >>> fizz_buzz(79)\n 3\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(50) == 0\n assert candidate(78) == 2\n assert candidate(79) == 3\n assert candidate(100) == 3\n assert candidate(200) == 6\n assert candidate(4000) == 192\n assert candidate(10000) == 639\n assert candidate(100000) == 8026\n\ndef test_check():\n check(fizz_buzz)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "py", - "prompt": "def truncate_number(number: float) -> float:\n \"\"\" Given a positive floating point number, it can be decomposed into\n and integer part (largest integer smaller than given number) and decimals\n (leftover part always smaller than 1).\n\n Return the decimal part of the number.\n >>> truncate_number(3.5)\n 0.5\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(3.5) == 0.5\n assert candidate(1.25) == 0.25\n assert candidate(123.0) == 0.0\n\ndef test_check():\n check(truncate_number)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "py", - "prompt": "from typing import List, Tuple\n\ndef sum_product(numbers: List[int]) -> Tuple[int, int]:\n \"\"\" For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n Empty sum should be equal to 0 and empty product should be equal to 1.\n >>> sum_product([])\n (0, 1)\n >>> sum_product([1, 2, 3, 4])\n (10, 24)\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == (0, 1)\n assert candidate([1, 1, 1]) == (3, 1)\n assert candidate([100, 0]) == (100, 0)\n assert candidate([3, 5, 7]) == (15, 105)\n assert candidate([10]) == (10, 10)\n\ndef test_check():\n check(sum_product)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "py", - "prompt": "from typing import List, Tuple\n\ndef get_row(lst: List[List[int]], x: int) -> List[Tuple[int, int]]:\n \"\"\"\n You are given a 2 dimensional data, as a nested lists,\n which is similar to matrix, however, unlike matrices,\n each row may contain a different number of columns.\n Given lst, and integer x, find integers x in the list,\n and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n each tuple is a coordinate - (row, columns), starting with 0.\n Sort coordinates initially by rows in ascending order.\n Also, sort coordinates of the row by columns in descending order.\n \n Examples:\n get_row([\n [1,2,3,4,5,6],\n [1,2,3,4,1,6],\n [1,2,3,4,5,1]\n ], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n get_row([], 1) == []\n get_row([[], [1], [1, 2, 3]], 3) == [(2, 2)]\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n assert candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6]], 2) == [(0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1)]\n assert candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 1, 3, 4, 5, 6], [1, 2, 1, 4, 5, 6], [1, 2, 3, 1, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1) == [(0, 0), (1, 0), (2, 1), (2, 0), (3, 2), (3, 0), (4, 3), (4, 0), (5, 4), (5, 0), (6, 5), (6, 0)]\n assert candidate([], 1) == []\n assert candidate([[1]], 2) == []\n assert candidate([[], [1], [1, 2, 3]], 3) == [(2, 2)]\n\ndef test_check():\n check(get_row)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "py", - "prompt": "from typing import List\n\ndef eat(number: int, need: int, remaining: int) -> List[int]:\n \"\"\"\n You're a hungry rabbit, and you already have eaten a certain number of carrots,\n but now you need to eat more carrots to complete the day's meals.\n you should return an array of [ total number of eaten carrots after your meals,\n the number of carrots left after your meals ]\n if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n \n Example:\n * eat(5, 6, 10) -> [11, 4]\n * eat(4, 8, 9) -> [12, 1]\n * eat(1, 10, 10) -> [11, 0]\n * eat(2, 11, 5) -> [7, 0]\n \n Variables:\n @number : integer\n the number of carrots that you have eaten.\n @need : integer\n the number of carrots that you need to eat.\n @remaining : integer\n the number of remaining carrots thet exist in stock\n \n Constrain:\n * 0 <= number <= 1000\n * 0 <= need <= 1000\n * 0 <= remaining <= 1000\n\n Have fun :)\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(5, 6, 10) == [11, 4]\n assert candidate(4, 8, 9) == [12, 1]\n assert candidate(1, 10, 10) == [11, 0]\n assert candidate(2, 11, 5) == [7, 0]\n assert candidate(4, 5, 7) == [9, 2]\n assert candidate(4, 5, 1) == [5, 0]\n\ndef test_check():\n check(eat)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "py", - "prompt": "def solve(N: int) -> str:\n \"\"\"Given a positive integer N, return the total sum of its digits in binary.\n \n Example\n For N = 1000, the sum of digits will be 1 the output should be \"1\".\n For N = 150, the sum of digits will be 6 the output should be \"110\".\n For N = 147, the sum of digits will be 12 the output should be \"1100\".\n \n Variables:\n @N integer\n Constraints: 0 \u2264 N \u2264 10000.\n Output:\n a string of binary number\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(1000) == '1'\n assert candidate(150) == '110'\n assert candidate(147) == '1100'\n assert candidate(333) == '1001'\n assert candidate(963) == '10010'\n\ndef test_check():\n check(solve)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "py", - "prompt": "from typing import List\n\ndef skjkasdkd(lst: List[int]) -> int:\n \"\"\"You are given a list of integers.\n You need to find the largest prime value and return the sum of its digits.\n\n Examples:\n For lst = [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] the output should be 10\n For lst = [1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1] the output should be 25\n For lst = [1,3,1,32,5107,34,83278,109,163,23,2323,32,30,1,9,3] the output should be 13\n For lst = [0,724,32,71,99,32,6,0,5,91,83,0,5,6] the output should be 11\n For lst = [0,81,12,3,1,21] the output should be 3\n For lst = [0,8,1,2,1,7] the output should be 7\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]) == 10\n assert candidate([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]) == 25\n assert candidate([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]) == 13\n assert candidate([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]) == 11\n assert candidate([0, 81, 12, 3, 1, 21]) == 3\n assert candidate([0, 8, 1, 2, 1, 7]) == 7\n assert candidate([8191]) == 19\n assert candidate([8191, 123456, 127, 7]) == 19\n assert candidate([127, 97, 8192]) == 10\n\ndef test_check():\n check(skjkasdkd)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "py", - "prompt": "from typing import List\n\ndef smallest_change(arr: List[int]) -> int:\n \"\"\"\n Given an array arr of integers, find the minimum number of elements that\n need to be changed to make the array palindromic. A palindromic array is an array that\n is read the same backwards and forwards. In one change, you can change one element to any other element.\n\n For example:\n smallest_change([1,2,3,5,4,7,9,6]) == 4\n smallest_change([1, 2, 3, 4, 3, 2, 2]) == 1\n smallest_change([1, 2, 3, 2, 1]) == 0\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 3, 5, 4, 7, 9, 6]) == 4\n assert candidate([1, 2, 3, 4, 3, 2, 2]) == 1\n assert candidate([1, 4, 2]) == 1\n assert candidate([1, 4, 4, 2]) == 1\n assert candidate([1, 2, 3, 2, 1]) == 0\n assert candidate([3, 1, 1, 3]) == 0\n assert candidate([1]) == 0\n assert candidate([0, 1]) == 1\n\ndef test_check():\n check(smallest_change)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "py", - "prompt": "from typing import List\n\ndef numerical_letter_grade(grades: List[float]) -> List[str]:\n \"\"\"It is the last week of the semester and the teacher has to give the grades\n to students. The teacher has been making her own algorithm for grading.\n The only problem is, she has lost the code she used for grading.\n She has given you a list of GPAs for some students and you have to write \n a function that can output a list of letter grades using the following table:\n GPA | Letter grade\n 4.0 A+\n > 3.7 A \n > 3.3 A- \n > 3.0 B+\n > 2.7 B \n > 2.3 B-\n > 2.0 C+\n > 1.7 C\n > 1.3 C-\n > 1.0 D+ \n > 0.7 D \n > 0.0 D-\n 0.0 E\n \n\n Example:\n grade_equation([4.0, 3, 1.7, 2, 3.5]) ==> ['A+', 'B', 'C-', 'C', 'A-']\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([4.0, 3, 1.7, 2, 3.5]) == ['A+', 'B', 'C-', 'C', 'A-']\n assert candidate([1.2]) == ['D+']\n assert candidate([0.5]) == ['D-']\n assert candidate([0.0]) == ['E']\n assert candidate([1.0, 0.3, 1.5, 2.8, 3.3]) == ['D', 'D-', 'C-', 'B', 'B+']\n assert candidate([0.0, 0.7]) == ['E', 'D-']\n\ndef test_check():\n check(numerical_letter_grade)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "py", - "prompt": "def triangle_area(a: int, b: int, c: int) -> float:\n \"\"\"\n Given the lengths of the three sides of a triangle. Return the area of\n the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n Otherwise return -1\n Three sides make a valid triangle when the sum of any two sides is greater \n than the third side.\n Example:\n triangle_area(3, 4, 5) == 6.00\n triangle_area(1, 2, 10) == -1\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(3, 4, 5) == 6.0\n assert candidate(1, 2, 10) == -1\n assert candidate(4, 8, 5) == 8.18\n assert candidate(2, 2, 2) == 1.73\n assert candidate(1, 2, 3) == -1\n assert candidate(10, 5, 7) == 16.25\n assert candidate(2, 6, 3) == -1\n assert candidate(1, 1, 1) == 0.43\n assert candidate(2, 2, 10) == -1\n\ndef test_check():\n check(triangle_area)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "py", - "prompt": "def same_chars(s0: str, s1: str) -> bool:\n \"\"\"\n Check if two words have the same characters.\n >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n True\n >>> same_chars('abcd', 'dddddddabc')\n True\n >>> same_chars('dddddddabc', 'abcd')\n True\n >>> same_chars('eabcd', 'dddddddabc')\n False\n >>> same_chars('abcd', 'dddddddabce')\n False\n >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc')\n False\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('eabcdzzzz', 'dddzzzzzzzddeddabc') == True\n assert candidate('abcd', 'dddddddabc') == True\n assert candidate('dddddddabc', 'abcd') == True\n assert candidate('eabcd', 'dddddddabc') == False\n assert candidate('abcd', 'dddddddabcf') == False\n assert candidate('eabcdzzzz', 'dddzzzzzzzddddabc') == False\n assert candidate('aabb', 'aaccc') == False\n\ndef test_check():\n check(same_chars)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "py", - "prompt": "from typing import List\n\ndef minSubArraySum(nums: List[int]) -> int:\n \"\"\"\n Given an array of integers nums, find the minimum sum of any non-empty sub-array\n of nums.\n Example\n minSubArraySum([2, 3, 4, 1, 2, 4]) == 1\n minSubArraySum([-1, -2, -3]) == -6\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([2, 3, 4, 1, 2, 4]) == 1\n assert candidate([-1, -2, -3]) == -6\n assert candidate([-1, -2, -3, 2, -10]) == -14\n assert candidate([-9999999999999999]) == -9999999999999999\n assert candidate([0, 10, 20, 1000000]) == 0\n assert candidate([-1, -2, -3, 10, -5]) == -6\n assert candidate([100, -1, -2, -3, 10, -5]) == -6\n assert candidate([10, 11, 13, 8, 3, 4]) == 3\n assert candidate([100, -33, 32, -1, 0, -2]) == -33\n assert candidate([-10]) == -10\n assert candidate([7]) == 7\n assert candidate([1, -1]) == -1\n\ndef test_check():\n check(minSubArraySum)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "py", - "prompt": "from typing import List\n\ndef select_words(s: str, n: int) -> List[str]:\n \"\"\"Given a string s and a natural number n, you have been tasked to implement \n a function that returns a list of all words from string s that contain exactly \n n consonants, in order these words appear in the string s.\n If the string s is empty then the function should return an empty list.\n Note: you may assume the input string contains only letters and spaces.\n Examples:\n select_words(\"Mary had a little lamb\", 4) ==> [\"little\"]\n select_words(\"Mary had a little lamb\", 3) ==> [\"Mary\", \"lamb\"]\n select_words(\"simple white space\", 2) ==> []\n select_words(\"Hello world\", 4) ==> [\"world\"]\n select_words(\"Uncle sam\", 3) ==> [\"Uncle\"]\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('Mary had a little lamb', 4) == ['little']\n assert candidate('Mary had a little lamb', 3) == ['Mary', 'lamb']\n assert candidate('simple white space', 2) == []\n assert candidate('Hello world', 4) == ['world']\n assert candidate('Uncle sam', 3) == ['Uncle']\n assert candidate('', 4) == []\n assert candidate('a b c d e f', 1) == ['b', 'c', 'd', 'f']\n\ndef test_check():\n check(select_words)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "py", - "prompt": "from typing import List\n\ndef all_prefixes(string: str) -> List[str]:\n \"\"\" Return list of all prefixes from shortest to longest of the input string\n >>> all_prefixes('abc')\n ['a', 'ab', 'abc']\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('') == []\n assert candidate('asdfgh') == ['a', 'as', 'asd', 'asdf', 'asdfg', 'asdfgh']\n assert candidate('WWW') == ['W', 'WW', 'WWW']\n\ndef test_check():\n check(all_prefixes)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "py", - "prompt": "def closest_integer(value: str) -> int:\n \"\"\"\n Create a function that takes a value (string) representing a number\n and returns the closest integer to it. If the number is equidistant\n from two integers, round it away from zero.\n\n Examples\n >>> closest_integer(\"10\")\n 10\n >>> closest_integer(\"15.3\")\n 15\n\n Note:\n Rounding away from zero means that if the given number is equidistant\n from two integers, the one you should return is the one that is the\n farthest from zero. For example closest_integer(\"14.5\") should\n return 15 and closest_integer(\"-14.5\") should return -15.\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('10') == 10\n assert candidate('14.5') == 15\n assert candidate('-15.5') == -16\n assert candidate('15.3') == 15\n assert candidate('0') == 0\n\ndef test_check():\n check(closest_integer)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "py", - "prompt": "def file_name_check(file_name: str) -> str:\n \"\"\"Create a function which takes a string representing a file's name, and returns\n 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n A file's name is considered to be valid if and only if all the following conditions \n are met:\n - There should not be more than three digits ('0'-'9') in the file's name.\n - The file's name contains exactly one dot '.'\n - The substring before the dot should not be empty, and it starts with a letter from \n the latin alphapet ('a'-'z' and 'A'-'Z').\n - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n Examples:\n file_name_check(\"example.txt\") # => 'Yes'\n file_name_check(\"1example.dll\") # => 'No' (the name should start with a latin alphapet letter)\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('example.txt') == 'Yes'\n assert candidate('1example.dll') == 'No'\n assert candidate('s1sdf3.asd') == 'No'\n assert candidate('K.dll') == 'Yes'\n assert candidate('MY16FILE3.exe') == 'Yes'\n assert candidate('His12FILE94.exe') == 'No'\n assert candidate('_Y.txt') == 'No'\n assert candidate('?aREYA.exe') == 'No'\n assert candidate('/this_is_valid.dll') == 'No'\n assert candidate('this_is_valid.wow') == 'No'\n assert candidate('this_is_valid.txt') == 'Yes'\n assert candidate('this_is_valid.txtexe') == 'No'\n assert candidate('#this2_i4s_5valid.ten') == 'No'\n assert candidate('@this1_is6_valid.exe') == 'No'\n assert candidate('this_is_12valid.6exe4.txt') == 'No'\n assert candidate('all.exe.txt') == 'No'\n assert candidate('I563_No.exe') == 'Yes'\n assert candidate('Is3youfault.txt') == 'Yes'\n assert candidate('no_one#knows.dll') == 'Yes'\n assert candidate('1I563_Yes3.exe') == 'No'\n assert candidate('I563_Yes3.txtt') == 'No'\n assert candidate('final..txt') == 'No'\n assert candidate('final132') == 'No'\n assert candidate('_f4indsartal132.') == 'No'\n assert candidate('.txt') == 'No'\n assert candidate('s.') == 'No'\n\ndef test_check():\n check(file_name_check)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "py", - "prompt": "from typing import Tuple\n\ndef intersection(interval1: Tuple[int, int], interval2: Tuple[int, int]) -> str:\n \"\"\"You are given two intervals,\n where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n The given intervals are closed which means that the interval (start, end)\n includes both start and end.\n For each given interval, it is assumed that its start is less or equal its end.\n Your task is to determine whether the length of intersection of these two \n intervals is a prime number.\n Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n which its length is 1, which not a prime number.\n If the length of the intersection is a prime number, return \"YES\",\n otherwise, return \"NO\".\n If the two intervals don't intersect, return \"NO\".\n\n\n [input/output] samples:\n intersection((1, 2), (2, 3)) ==> \"NO\"\n intersection((-1, 1), (0, 4)) ==> \"NO\"\n intersection((-3, -1), (-5, 5)) ==> \"YES\"\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate((1, 2), (2, 3)) == 'NO'\n assert candidate((-1, 1), (0, 4)) == 'NO'\n assert candidate((-3, -1), (-5, 5)) == 'YES'\n assert candidate((-2, 2), (-4, 0)) == 'YES'\n assert candidate((-11, 2), (-1, -1)) == 'NO'\n assert candidate((1, 2), (3, 5)) == 'NO'\n assert candidate((1, 2), (1, 2)) == 'NO'\n assert candidate((-2, -2), (-3, -2)) == 'NO'\n\ndef test_check():\n check(intersection)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "py", - "prompt": "def largest_prime_factor(n: int) -> int:\n \"\"\"Return the largest prime factor of n. Assume n > 1 and is not a prime.\n >>> largest_prime_factor(13195)\n 29\n >>> largest_prime_factor(2048)\n 2\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(15) == 5\n assert candidate(27) == 3\n assert candidate(63) == 7\n assert candidate(330) == 11\n assert candidate(13195) == 29\n\ndef test_check():\n check(largest_prime_factor)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "py", - "prompt": "def count_distinct_characters(string: str) -> int:\n \"\"\" Given a string, find out how many distinct characters (regardless of case) does it consist of\n >>> count_distinct_characters('xyzXYZ')\n 3\n >>> count_distinct_characters('Jerry')\n 4\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('') == 0\n assert candidate('abcde') == 5\n assert candidate('abcdecadeCADE') == 5\n assert candidate('aaaaAAAAaaaa') == 1\n assert candidate('Jerry jERRY JeRRRY') == 5\n\ndef test_check():\n check(count_distinct_characters)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "py", - "prompt": "from typing import List\n\ndef below_zero(operations: List[int]) -> bool:\n \"\"\" You're given a list of deposit and withdrawal operations on a bank account that starts with\n zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n at that point function should return True. Otherwise it should return False.\n >>> below_zero([1, 2, 3])\n False\n >>> below_zero([1, 2, -4, 5])\n True\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == False\n assert candidate([1, 2, -3, 1, 2, -3]) == False\n assert candidate([1, 2, -4, 5, 6]) == True\n assert candidate([1, -1, 2, -2, 5, -5, 4, -4]) == False\n assert candidate([1, -1, 2, -2, 5, -5, 4, -5]) == True\n assert candidate([1, -2, 2, -2, 5, -5, 4, -4]) == True\n\ndef test_check():\n check(below_zero)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "py", - "prompt": "def make_palindrome(string: str) -> str:\n \"\"\" Find the shortest palindrome that begins with a supplied string.\n Algorithm idea is simple:\n - Find the longest postfix of supplied string that is a palindrome.\n - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n >>> make_palindrome('')\n ''\n >>> make_palindrome('cat')\n 'catac'\n >>> make_palindrome('cata')\n 'catac'\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('') == ''\n assert candidate('x') == 'x'\n assert candidate('xyz') == 'xyzyx'\n assert candidate('xyx') == 'xyx'\n assert candidate('jerry') == 'jerryrrej'\n\ndef test_check():\n check(make_palindrome)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "py", - "prompt": "def int_to_mini_roman(number: int) -> str:\n \"\"\"\n Given a positive integer, obtain its roman numeral equivalent as a string,\n and return it in lowercase.\n Restrictions: 1 <= num <= 1000\n\n Examples:\n >>> int_to_mini_roman(19) == 'xix'\n >>> int_to_mini_roman(152) == 'clii'\n >>> int_to_mini_roman(426) == 'cdxxvi'\n \"\"\"\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(19) == 'xix'\n assert candidate(152) == 'clii'\n assert candidate(251) == 'ccli'\n assert candidate(426) == 'cdxxvi'\n assert candidate(500) == 'd'\n assert candidate(1) == 'i'\n assert candidate(4) == 'iv'\n assert candidate(43) == 'xliii'\n assert candidate(90) == 'xc'\n assert candidate(94) == 'xciv'\n assert candidate(532) == 'dxxxii'\n assert candidate(900) == 'cm'\n assert candidate(994) == 'cmxciv'\n assert candidate(1000) == 'm'\n\ndef test_check():\n check(int_to_mini_roman)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - } -] \ No newline at end of file diff --git a/data/py-remove.json b/data/py-remove.json deleted file mode 100644 index 3a57bc15c52cab74066f4d687c8e0768e06693ca..0000000000000000000000000000000000000000 --- a/data/py-remove.json +++ /dev/null @@ -1,2372 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "py", - "prompt": "def largest_divisor(n: int) -> int:\n \"\"\" For a given number n, find the largest number that divides n evenly, smaller than n\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(3) == 1\n assert candidate(7) == 1\n assert candidate(10) == 5\n assert candidate(100) == 50\n assert candidate(49) == 7\n\ndef test_check():\n check(largest_divisor)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_47_median", - "language": "py", - "prompt": "from typing import List\n\ndef median(l: List[int]) -> float:\n \"\"\"Return median of elements in the list l.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([3, 1, 2, 4, 5]) == 3\n assert candidate([-10, 4, 6, 1000, 10, 20]) == 8.0\n assert candidate([5]) == 5\n assert candidate([6, 5]) == 5.5\n assert candidate([8, 1, 3, 9, 9, 2, 7]) == 7\n\ndef test_check():\n check(median)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "py", - "prompt": "from typing import List\n\ndef max_element(l: List[int]) -> int:\n \"\"\"Return maximum element in the list.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 3]) == 3\n assert candidate([5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]) == 124\n\ndef test_check():\n check(max_element)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "py", - "prompt": "from typing import List\n\ndef can_arrange(arr: List[int]) -> int:\n \"\"\"Create a function which returns the largest index of an element which\n is not greater than or equal to the element immediately preceding it. If\n no such element exists then return -1. The given array will not contain\n duplicate values.\n\n Examples:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 4, 3, 5]) == 3\n assert candidate([1, 2, 4, 5]) == -1\n assert candidate([1, 4, 2, 5, 6, 7, 8, 9, 10]) == 2\n assert candidate([4, 8, 5, 7, 3]) == 4\n assert candidate([]) == -1\n\ndef test_check():\n check(can_arrange)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "py", - "prompt": "def check_if_last_char_is_a_letter(txt: str) -> bool:\n \"\"\"\n Create a function that returns True if the last character\n of a given string is an alphabetical character and is not\n a part of a word, and False otherwise.\n Note: \"word\" is a group of characters separated by space.\n\n Examples:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('apple') == False\n assert candidate('apple pi e') == True\n assert candidate('eeeee') == False\n assert candidate('A') == True\n assert candidate('Pumpkin pie ') == False\n assert candidate('Pumpkin pie 1') == False\n assert candidate('') == False\n assert candidate('eeeee e ') == False\n assert candidate('apple pie') == False\n assert candidate('apple pi e ') == False\n\ndef test_check():\n check(check_if_last_char_is_a_letter)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "py", - "prompt": "def is_prime(n: int) -> bool:\n \"\"\"Return true if a given number is prime, and false otherwise.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(6) == False\n assert candidate(101) == True\n assert candidate(11) == True\n assert candidate(13441) == True\n assert candidate(61) == True\n assert candidate(4) == False\n assert candidate(1) == False\n assert candidate(5) == True\n assert candidate(11) == True\n assert candidate(17) == True\n assert candidate(85) == False\n assert candidate(77) == False\n assert candidate(255379) == False\n\ndef test_check():\n check(is_prime)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "py", - "prompt": "from typing import List\n\ndef unique_digits(x: List[int]) -> List[int]:\n \"\"\"Given a list of positive integers x. return a sorted list of all \n elements that hasn't any even digit.\n\n Note: Returned list should be sorted in increasing order.\n \n For example:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([15, 33, 1422, 1]) == [1, 15, 33]\n assert candidate([152, 323, 1422, 10]) == []\n assert candidate([12345, 2033, 111, 151]) == [111, 151]\n assert candidate([135, 103, 31]) == [31, 135]\n\ndef test_check():\n check(unique_digits)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "py", - "prompt": "def string_xor(a: str, b: str) -> str:\n \"\"\" Input are two strings a and b consisting only of 1s and 0s.\n Perform binary XOR on these inputs and return result also as a string.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('111000', '101010') == '010010'\n assert candidate('1', '1') == '0'\n assert candidate('0101', '0000') == '0101'\n\ndef test_check():\n check(string_xor)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "py", - "prompt": "def sum_to_n(n: int) -> int:\n \"\"\"sum_to_n is a function that sums numbers from 1 to n.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(1) == 1\n assert candidate(6) == 21\n assert candidate(11) == 66\n assert candidate(30) == 465\n assert candidate(100) == 5050\n\ndef test_check():\n check(sum_to_n)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "py", - "prompt": "from typing import List\n\ndef double_the_difference(lst: List[float]) -> int:\n \"\"\"\n Given a list of numbers, return the sum of squares of the numbers\n in the list that are odd. Ignore numbers that are negative or not integers.\n \n \n If the input list is empty, return 0.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == 0\n assert candidate([5.0, 4.0]) == 25\n assert candidate([0.1, 0.2, 0.3]) == 0\n assert candidate([-10.0, -20.0, -30.0]) == 0\n assert candidate([-1.0, -2.0, 8.0]) == 0\n assert candidate([0.2, 3.0, 5.0]) == 34\n assert candidate([-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]) == 165\n\ndef test_check():\n check(double_the_difference)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "py", - "prompt": "def strlen(string: str) -> int:\n \"\"\" Return length of given string\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('') == 0\n assert candidate('x') == 1\n assert candidate('asdasnakj') == 9\n\ndef test_check():\n check(strlen)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "py", - "prompt": "def is_bored(S: str) -> int:\n \"\"\"\n You'll be given a string of words, and your task is to count the number\n of boredoms. A boredom is a sentence that starts with the word \"I\".\n Sentences are delimited by '.', '?' or '!'.\n \n For example:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('Hello world') == 0\n assert candidate('Is the sky blue?') == 0\n assert candidate('I love It !') == 1\n assert candidate('bIt') == 0\n assert candidate('I feel good today. I will be productive. will kill It') == 2\n assert candidate('You and I are going for a walk') == 0\n\ndef test_check():\n check(is_bored)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "py", - "prompt": "def vowels_count(s: str) -> int:\n \"\"\"Write a function vowels_count which takes a string representing\n a word as input and returns the number of vowels in the string.\n Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n vowel, but only when it is at the end of the given word.\n\n Example:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('abcde') == 2\n assert candidate('Alone') == 3\n assert candidate('key') == 2\n assert candidate('bye') == 1\n assert candidate('keY') == 2\n assert candidate('bYe') == 1\n assert candidate('ACEDY') == 3\n\ndef test_check():\n check(vowels_count)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "py", - "prompt": "def fib(n: int) -> int:\n \"\"\"Return n-th Fibonacci number.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(10) == 55\n assert candidate(1) == 1\n assert candidate(8) == 21\n assert candidate(11) == 89\n assert candidate(12) == 144\n\ndef test_check():\n check(fib)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "py", - "prompt": "def simplify(x: str, n: str) -> bool:\n \"\"\"Your task is to implement a function that will simplify the expression\n x * n. The function returns True if x * n evaluates to a whole number and False\n otherwise. Both x and n, are string representation of a fraction, and have the following format,\n / where both numerator and denominator are positive whole numbers.\n\n You can assume that x, and n are valid fractions, and do not have zero as denominator.\n\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('1/5', '5/1') == True\n assert candidate('1/6', '2/1') == False\n assert candidate('5/1', '3/1') == True\n assert candidate('7/10', '10/2') == False\n assert candidate('2/10', '50/10') == True\n assert candidate('7/2', '4/2') == True\n assert candidate('11/6', '6/1') == True\n assert candidate('2/3', '5/2') == False\n assert candidate('5/2', '3/5') == False\n assert candidate('2/4', '8/4') == True\n assert candidate('2/4', '4/2') == True\n assert candidate('1/5', '5/1') == True\n assert candidate('1/5', '1/5') == False\n\ndef test_check():\n check(simplify)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "py", - "prompt": "def count_upper(s: str) -> int:\n \"\"\"\n Given a string s, count the number of uppercase vowels in even indices.\n \n For example:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('aBCdEf') == 1\n assert candidate('abcdefg') == 0\n assert candidate('dBBE') == 0\n assert candidate('B') == 0\n assert candidate('U') == 1\n assert candidate('') == 0\n assert candidate('EEEE') == 2\n\ndef test_check():\n check(count_upper)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "py", - "prompt": "from typing import List\n\ndef max_fill(grid: List[List[int]], capacity: int) -> int:\n \"\"\"\n You are given a rectangular grid of wells. Each row represents a single well,\n and each 1 in a row represents a single unit of water.\n Each well has a corresponding bucket that can be used to extract water from it, \n and all buckets have the same capacity.\n Your task is to use the buckets to empty the wells.\n Output the number of times you need to lower the buckets.\n\n Example 1:\n \n Example 2:\n \n Example 3:\n \n Constraints:\n * all wells have the same length\n * 1 <= grid.length <= 10^2\n * 1 <= grid[:,1].length <= 10^2\n * grid[i][j] -> 0 | 1\n * 1 <= capacity <= 10\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1) == 6\n assert candidate([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2) == 5\n assert candidate([[0, 0, 0], [0, 0, 0]], 5) == 0\n assert candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 2) == 4\n assert candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 9) == 2\n\ndef test_check():\n check(max_fill)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "py", - "prompt": "from typing import List\n\ndef maximum(arr: List[int], k: int) -> List[int]:\n \"\"\"\n Given an array arr of integers and a positive integer k, return a sorted list \n of length k with the maximum k numbers in arr.\n\n Example 1:\n\n \n Example 2:\n\n \n Example 3:\n\n \n Note:\n 1. The length of the array will be in the range of [1, 1000].\n 2. The elements in the array will be in the range of [-1000, 1000].\n 3. 0 <= k <= len(arr)\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([-3, -4, 5], 3) == [-4, -3, 5]\n assert candidate([4, -4, 4], 2) == [4, 4]\n assert candidate([-3, 2, 1, 2, -1, -2, 1], 1) == [2]\n assert candidate([123, -123, 20, 0, 1, 2, -3], 3) == [2, 20, 123]\n assert candidate([-123, 20, 0, 1, 2, -3], 4) == [0, 1, 2, 20]\n assert candidate([5, 15, 0, 3, -13, -8, 0], 7) == [-13, -8, 0, 0, 3, 5, 15]\n assert candidate([-1, 0, 2, 5, 3, -10], 2) == [3, 5]\n assert candidate([1, 0, 5, -7], 1) == [5]\n assert candidate([4, -4], 2) == [-4, 4]\n assert candidate([-10, 10], 2) == [-10, 10]\n assert candidate([1, 2, 3, -23, 243, -400, 0], 0) == []\n\ndef test_check():\n check(maximum)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "py", - "prompt": "def encode(message: str) -> str:\n \"\"\"\n Write a function that takes a message, and encodes in such a \n way that it swaps case of all letters, replaces all vowels in \n the message with the letter that appears 2 places ahead of that \n vowel in the english alphabet. \n Assume only letters. \n \n Examples:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('TEST') == 'tgst'\n assert candidate('Mudasir') == 'mWDCSKR'\n assert candidate('YES') == 'ygs'\n assert candidate('This is a message') == 'tHKS KS C MGSSCGG'\n assert candidate('I DoNt KnOw WhAt tO WrItE') == 'k dQnT kNqW wHcT Tq wRkTg'\n\ndef test_check():\n check(encode)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "py", - "prompt": "def remove_vowels(text: str) -> str:\n \"\"\"\n remove_vowels is a function that takes string and returns string without vowels.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('') == ''\n assert candidate('abcdef\\nghijklm') == 'bcdf\\nghjklm'\n assert candidate('fedcba') == 'fdcb'\n assert candidate('eeeee') == ''\n assert candidate('acBAA') == 'cB'\n assert candidate('EcBOO') == 'cB'\n assert candidate('ybcd') == 'ybcd'\n\ndef test_check():\n check(remove_vowels)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "py", - "prompt": "from typing import List\n\ndef get_positive(l: List[int]) -> List[int]:\n \"\"\"Return only positive numbers in the list.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([-1, -2, 4, 5, 6]) == [4, 5, 6]\n assert candidate([5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]) == [5, 3, 2, 3, 3, 9, 123, 1]\n assert candidate([-1, -2]) == []\n assert candidate([]) == []\n\ndef test_check():\n check(get_positive)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "py", - "prompt": "def string_sequence(n: int) -> str:\n \"\"\" Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(0) == '0'\n assert candidate(3) == '0 1 2 3'\n assert candidate(10) == '0 1 2 3 4 5 6 7 8 9 10'\n\ndef test_check():\n check(string_sequence)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "py", - "prompt": "from typing import List\n\ndef make_a_pile(n: int) -> List[int]:\n \"\"\"\n Given a positive integer n, you have to make a pile of n levels of stones.\n The first level has n stones.\n The number of stones in the next level is:\n - the next odd number if n is odd.\n - the next even number if n is even.\n Return the number of stones in each level in a list, where element at index\n i represents the number of stones in the level (i+1).\n\n Examples:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(3) == [3, 5, 7]\n assert candidate(4) == [4, 6, 8, 10]\n assert candidate(5) == [5, 7, 9, 11, 13]\n assert candidate(6) == [6, 8, 10, 12, 14, 16]\n assert candidate(8) == [8, 10, 12, 14, 16, 18, 20, 22]\n\ndef test_check():\n check(make_a_pile)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "py", - "prompt": "from typing import Tuple\n\ndef reverse_delete(s: str, c: str) -> Tuple[str, bool]:\n \"\"\"Task\n 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\n then check if the result string is palindrome.\n A string is called palindrome if it reads the same backward as forward.\n You should return a tuple containing the result string and True/False for the check.\n Example\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('abcde', 'ae') == ('bcd', False)\n assert candidate('abcdef', 'b') == ('acdef', False)\n assert candidate('abcdedcba', 'ab') == ('cdedc', True)\n assert candidate('dwik', 'w') == ('dik', False)\n assert candidate('a', 'a') == ('', True)\n assert candidate('abcdedcba', '') == ('abcdedcba', True)\n assert candidate('abcdedcba', 'v') == ('abcdedcba', True)\n assert candidate('vabba', 'v') == ('abba', True)\n assert candidate('mamma', 'mia') == ('', True)\n\ndef test_check():\n check(reverse_delete)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "py", - "prompt": "def flip_case(string: str) -> str:\n \"\"\" For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('') == ''\n assert candidate('Hello!') == 'hELLO!'\n assert candidate('These violent delights have violent ends') == 'tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS'\n\ndef test_check():\n check(flip_case)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "py", - "prompt": "def solve(s: str) -> str:\n \"\"\"You are given a string s.\n if s[i] is a letter, reverse its case from lower to upper or vise versa, \n otherwise keep it as it is.\n If the string contains no letters, reverse the string.\n The function should return the resulted string.\n Examples\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('AsDf') == 'aSdF'\n assert candidate('1234') == '4321'\n assert candidate('ab') == 'AB'\n assert candidate('#a@C') == '#A@c'\n assert candidate('#AsdfW^45') == '#aSDFw^45'\n assert candidate('#6@2') == '2@6#'\n assert candidate('#$a^D') == '#$A^d'\n assert candidate('#ccc') == '#CCC'\n\ndef test_check():\n check(solve)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "py", - "prompt": "from typing import List\n\ndef filter_by_prefix(strings: List[str], prefix: str) -> List[str]:\n \"\"\" Filter an input list of strings only for ones that start with a given prefix.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([], 'john') == []\n assert candidate(['xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'], 'xxx') == ['xxx', 'xxxAAA', 'xxx']\n\ndef test_check():\n check(filter_by_prefix)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "py", - "prompt": "def choose_num(x: int, y: int) -> int:\n \"\"\"This function takes two positive numbers x and y and returns the\n biggest even integer number that is in the range [x, y] inclusive. If \n there's no such number, then the function should return -1.\n\n For example:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(12, 15) == 14\n assert candidate(13, 12) == -1\n assert candidate(33, 12354) == 12354\n assert candidate(5234, 5233) == -1\n assert candidate(6, 29) == 28\n assert candidate(27, 10) == -1\n assert candidate(7, 7) == -1\n assert candidate(546, 546) == 546\n\ndef test_check():\n check(choose_num)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "py", - "prompt": "def words_in_sentence(sentence: str) -> str:\n \"\"\"\n You are given a string representing a sentence,\n the sentence contains some words separated by a space,\n and you have to return a string that contains the words from the original sentence,\n whose lengths are prime numbers,\n the order of the words in the new string should be the same as the original one.\n\n Example 1:\n \n Example 2:\n \n Constraints:\n * 1 <= len(sentence) <= 100\n * sentence contains only letters\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('This is a test') == 'is'\n assert candidate('lets go for swimming') == 'go for'\n assert candidate('there is no place available here') == 'there is no place'\n assert candidate('Hi I am Hussein') == 'Hi am Hussein'\n assert candidate('go for it') == 'go for it'\n assert candidate('here') == ''\n assert candidate('here is') == 'is'\n\ndef test_check():\n check(words_in_sentence)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "py", - "prompt": "from typing import List\n\ndef intersperse(numbers: List[int], delimeter: int) -> List[int]:\n \"\"\" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([], 7) == []\n assert candidate([5, 6, 3, 2], 8) == [5, 8, 6, 8, 3, 8, 2]\n assert candidate([2, 2, 2], 2) == [2, 2, 2, 2, 2]\n\ndef test_check():\n check(intersperse)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "py", - "prompt": "def is_simple_power(x: int, n: int) -> bool:\n \"\"\"Your task is to write a function that returns true if a number x is a simple\n power of n and false in other cases.\n x is a simple power of n if n**int=x\n For example:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(16, 2) == True\n assert candidate(143214, 16) == False\n assert candidate(4, 2) == True\n assert candidate(9, 3) == True\n assert candidate(16, 4) == True\n assert candidate(24, 2) == False\n assert candidate(128, 4) == False\n assert candidate(12, 6) == False\n assert candidate(1, 1) == True\n assert candidate(1, 12) == True\n\ndef test_check():\n check(is_simple_power)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "py", - "prompt": "def is_multiply_prime(a: int) -> bool:\n \"\"\"Write a function that returns true if the given number is the multiplication of 3 prime numbers\n and false otherwise.\n Knowing that (a) is less then 100. \n Example:\n 30 = 2 * 3 * 5\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(5) == False\n assert candidate(30) == True\n assert candidate(8) == True\n assert candidate(10) == False\n assert candidate(125) == True\n assert candidate(105) == True\n assert candidate(126) == False\n assert candidate(729) == False\n assert candidate(891) == False\n assert candidate(1001) == True\n\ndef test_check():\n check(is_multiply_prime)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "py", - "prompt": "def right_angle_triangle(a: int, b: int, c: int) -> bool:\n \"\"\"\n Given the lengths of the three sides of a triangle. Return True if the three\n sides form a right-angled triangle, False otherwise.\n A right-angled triangle is a triangle in which one angle is right angle or \n 90 degree.\n Example:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(3, 4, 5) == True\n assert candidate(1, 2, 3) == False\n assert candidate(10, 6, 8) == True\n assert candidate(2, 2, 2) == False\n assert candidate(7, 24, 25) == True\n assert candidate(10, 5, 7) == False\n assert candidate(5, 12, 13) == True\n assert candidate(15, 8, 17) == True\n assert candidate(48, 55, 73) == True\n assert candidate(1, 1, 1) == False\n assert candidate(2, 2, 10) == False\n\ndef test_check():\n check(right_angle_triangle)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "py", - "prompt": "def any_int(x: float, y: float, z: float) -> bool:\n \"\"\"\n Create a function that takes 3 numbers.\n Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n Returns false in any other cases.\n \n Examples\n \n \n \n \n\n \n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(2, 3, 1) == True\n assert candidate(2.5, 2, 3) == False\n assert candidate(1.5, 5, 3.5) == False\n assert candidate(2, 6, 2) == False\n assert candidate(4, 2, 2) == True\n assert candidate(2.2, 2.2, 2.2) == False\n assert candidate(-4, 6, 2) == True\n assert candidate(2, 1, 1) == True\n assert candidate(3, 4, 7) == True\n assert candidate(3.0, 4, 7) == False\n\ndef test_check():\n check(any_int)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "py", - "prompt": "from typing import List\n\ndef sort_third(l: List[int]) -> List[int]:\n \"\"\"This function takes a list l and returns a list l' such that\n l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n to the values of the corresponding indicies of l, but sorted.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([5, 6, 3, 4, 8, 9, 2]) == [2, 6, 3, 4, 8, 9, 5]\n assert candidate([5, 8, 3, 4, 6, 9, 2]) == [2, 8, 3, 4, 6, 9, 5]\n assert candidate([5, 6, 9, 4, 8, 3, 2]) == [2, 6, 9, 4, 8, 3, 5]\n assert candidate([5, 6, 3, 4, 8, 9, 2, 1]) == [2, 6, 3, 4, 8, 9, 5, 1]\n\ndef test_check():\n check(sort_third)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_53_add", - "language": "py", - "prompt": "def add(x: int, y: int) -> int:\n \"\"\"Add two numbers x and y\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(0, 1) == 1\n assert candidate(1, 0) == 1\n assert candidate(2, 3) == 5\n assert candidate(5, 7) == 12\n assert candidate(7, 5) == 12\n\ndef test_check():\n check(add)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_69_search", - "language": "py", - "prompt": "from typing import List\n\ndef search(lst: List[int]) -> int:\n \"\"\"\n You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n zero, and has a frequency greater than or equal to the value of the integer itself. \n The frequency of an integer is the number of times it appears in the list.\n If no such a value exist, return -1.\n Examples:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([5, 5, 5, 5, 1]) == 1\n assert candidate([4, 1, 4, 1, 4, 4]) == 4\n assert candidate([3, 3]) == -1\n assert candidate([8, 8, 8, 8, 8, 8, 8, 8]) == 8\n assert candidate([2, 3, 3, 2, 2]) == 2\n assert candidate([2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]) == 1\n assert candidate([3, 2, 8, 2]) == 2\n assert candidate([6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]) == 1\n assert candidate([8, 8, 3, 6, 5, 6, 4]) == -1\n assert candidate([6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]) == 1\n assert candidate([1, 9, 10, 1, 3]) == 1\n assert candidate([6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]) == 5\n assert candidate([1]) == 1\n assert candidate([8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]) == 4\n assert candidate([2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]) == 2\n assert candidate([1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]) == 1\n assert candidate([9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]) == 4\n assert candidate([2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]) == 4\n assert candidate([9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]) == 2\n assert candidate([5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]) == -1\n assert candidate([10]) == -1\n assert candidate([9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]) == 2\n assert candidate([5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]) == 1\n assert candidate([7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]) == 1\n assert candidate([3, 10, 10, 9, 2]) == -1\n\ndef test_check():\n check(search)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "py", - "prompt": "def prime_length(string: str) -> bool:\n \"\"\"Write a function that takes a string and returns True if the string\n length is a prime number or False otherwise\n Examples\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('Hello') == True\n assert candidate('abcdcba') == True\n assert candidate('kittens') == True\n assert candidate('orange') == False\n assert candidate('wow') == True\n assert candidate('world') == True\n assert candidate('MadaM') == True\n assert candidate('Wow') == True\n assert candidate('') == False\n assert candidate('HI') == True\n assert candidate('go') == True\n assert candidate('gogo') == False\n assert candidate('aaaaaaaaaaaaaaa') == False\n assert candidate('Madam') == True\n assert candidate('M') == False\n assert candidate('0') == False\n\ndef test_check():\n check(prime_length)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_58_common", - "language": "py", - "prompt": "from typing import List\n\ndef common(l1: List[int], l2: List[int]) -> List[int]:\n \"\"\"Return sorted unique common elements for two lists.\n \n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]) == [1, 5, 653]\n assert candidate([5, 3, 2, 8], [3, 2]) == [2, 3]\n assert candidate([4, 3, 2, 8], [3, 2, 4]) == [2, 3, 4]\n assert candidate([4, 3, 2, 8], []) == []\n\ndef test_check():\n check(common)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "py", - "prompt": "def special_factorial(n: int) -> int:\n \"\"\"The Brazilian factorial is defined as:\n brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n where n > 0\n\n For example:\n \n The function will receive an integer as input and should return the special\n factorial of this integer.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(4) == 288\n assert candidate(5) == 34560\n assert candidate(7) == 125411328000\n assert candidate(1) == 1\n\ndef test_check():\n check(special_factorial)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "py", - "prompt": "from typing import List\n\ndef exchange(lst1: List[int], lst2: List[int]) -> str:\n \"\"\"In this problem, you will implement a function that takes two lists of numbers,\n and determines whether it is possible to perform an exchange of elements\n between them to make lst1 a list of only even numbers.\n There is no limit on the number of exchanged elements between lst1 and lst2.\n If it is possible to exchange elements between the lst1 and lst2 to make\n all the elements of lst1 to be even, return \"YES\".\n Otherwise, return \"NO\".\n For example:\n It is assumed that the input lists will be non-empty.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 3, 4], [1, 2, 3, 4]) == 'YES'\n assert candidate([1, 2, 3, 4], [1, 5, 3, 4]) == 'NO'\n assert candidate([1, 2, 3, 4], [2, 1, 4, 3]) == 'YES'\n assert candidate([5, 7, 3], [2, 6, 4]) == 'YES'\n assert candidate([5, 7, 3], [2, 6, 3]) == 'NO'\n assert candidate([3, 2, 6, 1, 8, 9], [3, 5, 5, 1, 1, 1]) == 'NO'\n assert candidate([100, 200], [200, 200]) == 'YES'\n\ndef test_check():\n check(exchange)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "py", - "prompt": "from typing import List\n\ndef add_elements(arr: List[int], k: int) -> int:\n \"\"\"\n Given a non-empty array of integers arr and an integer k, return\n the sum of the elements with at most two digits from the first k elements of arr.\n\n Example:\n\n \n Constraints:\n 1. 1 <= len(arr) <= 100\n 2. 1 <= k <= len(arr)\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, -2, -3, 41, 57, 76, 87, 88, 99], 3) == -4\n assert candidate([111, 121, 3, 4000, 5, 6], 2) == 0\n assert candidate([11, 21, 3, 90, 5, 6, 7, 8, 9], 4) == 125\n assert candidate([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4) == 24\n assert candidate([1], 1) == 1\n\ndef test_check():\n check(add_elements)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "py", - "prompt": "def x_or_y(n: int, x: int, y: int) -> int:\n \"\"\"A simple program which should return the value of x if n is \n a prime number and should return the value of y otherwise.\n\n Examples:\n \n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(7, 34, 12) == 34\n assert candidate(15, 8, 5) == 5\n assert candidate(3, 33, 5212) == 33\n assert candidate(1259, 3, 52) == 3\n assert candidate(7919, -1, 12) == -1\n assert candidate(3609, 1245, 583) == 583\n assert candidate(91, 56, 129) == 129\n assert candidate(6, 34, 1234) == 1234\n assert candidate(1, 2, 0) == 0\n assert candidate(2, 2, 0) == 2\n\ndef test_check():\n check(x_or_y)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "py", - "prompt": "def triangle_area(a: int, h: int) -> float:\n \"\"\"Given length of a side and high return area for a triangle.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(5, 3) == 7.5\n assert candidate(2, 2) == 2.0\n assert candidate(10, 8) == 40.0\n\ndef test_check():\n check(triangle_area)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "py", - "prompt": "from typing import List\n\ndef tri(n: int) -> List[int]:\n \"\"\"Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n the last couple centuries. However, what people don't know is Tribonacci sequence.\n Tribonacci sequence is defined by the recurrence:\n tri(1) = 3\n tri(n) = 1 + n / 2, if n is even.\n tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n For example:\n tri(2) = 1 + (2 / 2) = 2\n tri(4) = 3\n tri(3) = tri(2) + tri(1) + tri(4)\n = 2 + 3 + 3 = 8 \n You are given a non-negative integer number n, you have to a return a list of the \n first n + 1 numbers of the Tribonacci sequence.\n Examples:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(3) == [1, 3, 2, 8]\n assert candidate(4) == [1, 3, 2, 8, 3]\n assert candidate(5) == [1, 3, 2, 8, 3, 15]\n assert candidate(6) == [1, 3, 2, 8, 3, 15, 4]\n assert candidate(7) == [1, 3, 2, 8, 3, 15, 4, 24]\n assert candidate(8) == [1, 3, 2, 8, 3, 15, 4, 24, 5]\n assert candidate(9) == [1, 3, 2, 8, 3, 15, 4, 24, 5, 35]\n assert candidate(20) == [1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11]\n assert candidate(0) == [1]\n assert candidate(1) == [1, 3]\n\ndef test_check():\n check(tri)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "py", - "prompt": "from typing import List\n\ndef match_parens(lst: List[str]) -> str:\n \"\"\"\n You are given a list of two strings, both strings consist of open\n parentheses '(' or close parentheses ')' only.\n Your job is to check if it is possible to concatenate the two strings in\n some order, that the resulting string will be good.\n A string S is considered to be good if and only if all parentheses in S\n are balanced. For example: the string '(())()' is good, while the string\n '())' is not.\n Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n\n Examples:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(['()(', ')']) == 'Yes'\n assert candidate([')', ')']) == 'No'\n assert candidate(['(()(())', '())())']) == 'No'\n assert candidate([')())', '(()()(']) == 'Yes'\n assert candidate(['(())))', '(()())((']) == 'Yes'\n assert candidate(['()', '())']) == 'No'\n assert candidate(['(()(', '()))()']) == 'Yes'\n assert candidate(['((((', '((())']) == 'No'\n assert candidate([')(()', '(()(']) == 'No'\n assert candidate([')(', ')(']) == 'No'\n assert candidate(['(', ')']) == 'Yes'\n assert candidate([')', '(']) == 'Yes'\n\ndef test_check():\n check(match_parens)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "py", - "prompt": "from typing import List\n\ndef remove_duplicates(numbers: List[int]) -> List[int]:\n \"\"\" From a list of integers, remove all elements that occur more than once.\n Keep order of elements left the same as in the input.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == []\n assert candidate([1, 2, 3, 4]) == [1, 2, 3, 4]\n assert candidate([1, 2, 3, 2, 4, 3, 5]) == [1, 4, 5]\n\ndef test_check():\n check(remove_duplicates)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "py", - "prompt": "def greatest_common_divisor(a: int, b: int) -> int:\n \"\"\" Return a greatest common divisor of two integers a and b\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(3, 7) == 1\n assert candidate(10, 15) == 5\n assert candidate(49, 14) == 7\n assert candidate(144, 60) == 12\n\ndef test_check():\n check(greatest_common_divisor)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "py", - "prompt": "def is_palindrome(text: str) -> bool:\n \"\"\"\n Checks if given string is a palindrome\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('') == True\n assert candidate('aba') == True\n assert candidate('aaaaa') == True\n assert candidate('zbcd') == False\n assert candidate('xywyx') == True\n assert candidate('xywyz') == False\n assert candidate('xywzx') == False\n\ndef test_check():\n check(is_palindrome)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "py", - "prompt": "from typing import List\n\ndef derivative(xs: List[int]) -> List[int]:\n \"\"\" xs represent coefficients of a polynomial.\n xs[0] + xs[1] * x + xs[2] * x^2 + ....\n Return derivative of this polynomial in the same form.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([3, 1, 2, 4, 5]) == [1, 4, 12, 20]\n assert candidate([1, 2, 3]) == [2, 6]\n assert candidate([3, 2, 1]) == [2, 2]\n assert candidate([3, 2, 1, 0, 4]) == [2, 2, 0, 16]\n assert candidate([1]) == []\n\ndef test_check():\n check(derivative)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "py", - "prompt": "def fruit_distribution(s: str, n: int) -> int:\n \"\"\"\n In this task, you will be given a string that represents a number of apples and oranges \n that are distributed in a basket of fruit this basket contains \n apples, oranges, and mango fruits. Given the string that represents the total number of \n the oranges and apples and an integer that represent the total number of the fruits \n in the basket return the number of the mango fruits in the basket.\n for examble:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('5 apples and 6 oranges', 19) == 8\n assert candidate('5 apples and 6 oranges', 21) == 10\n assert candidate('0 apples and 1 oranges', 3) == 2\n assert candidate('1 apples and 0 oranges', 3) == 2\n assert candidate('2 apples and 3 oranges', 100) == 95\n assert candidate('2 apples and 3 oranges', 5) == 0\n assert candidate('1 apples and 100 oranges', 120) == 19\n\ndef test_check():\n check(fruit_distribution)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "py", - "prompt": "def iscube(a: int) -> bool:\n \"\"\"\n Write a function that takes an integer a and returns True \n if this ingeger is a cube of some integer number.\n Note: you may assume the input is always valid.\n Examples:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(1) == True\n assert candidate(2) == False\n assert candidate(-1) == True\n assert candidate(64) == True\n assert candidate(180) == False\n assert candidate(1000) == True\n assert candidate(0) == True\n assert candidate(1729) == False\n\ndef test_check():\n check(iscube)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "py", - "prompt": "from typing import List\n\ndef sort_array(arr: List[int]) -> List[int]:\n \"\"\"\n In this Kata, you have to sort an array of non-negative integers according to\n number of ones in their binary representation in ascending order.\n For similar number of ones, sort based on decimal value.\n\n It must be implemented like this:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 5, 2, 3, 4]) == [1, 2, 4, 3, 5]\n assert candidate([-2, -3, -4, -5, -6]) == [-4, -2, -6, -5, -3]\n assert candidate([1, 0, 2, 3, 4]) == [0, 1, 2, 4, 3]\n assert candidate([]) == []\n assert candidate([2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]) == [2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77]\n assert candidate([3, 6, 44, 12, 32, 5]) == [32, 3, 5, 6, 12, 44]\n assert candidate([2, 4, 8, 16, 32]) == [2, 4, 8, 16, 32]\n assert candidate([2, 4, 8, 16, 32]) == [2, 4, 8, 16, 32]\n\ndef test_check():\n check(sort_array)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "py", - "prompt": "from typing import List\n\ndef odd_count(lst: List[str]) -> List[str]:\n \"\"\"Given a list of strings, where each string consists of only digits, return a list.\n Each element i of the output should be \"the number of odd elements in the\n string i of the input.\" where all the i's should be replaced by the number\n of odd digits in the i'th string of the input.\n\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(['1234567']) == ['the number of odd elements 4n the str4ng 4 of the 4nput.']\n 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.']\n assert candidate(['271', '137', '314']) == ['the number of odd elements 2n the str2ng 2 of the 2nput.', 'the number of odd elements 3n the str3ng 3 of the 3nput.', 'the number of odd elements 2n the str2ng 2 of the 2nput.']\n\ndef test_check():\n check(odd_count)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "py", - "prompt": "def correct_bracketing(brackets: str) -> bool:\n \"\"\" brackets is a string of \"(\" and \")\".\n return True if every opening bracket has a corresponding closing bracket.\n\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('()') == True\n assert candidate('(()())') == True\n assert candidate('()()(()())()') == True\n assert candidate('()()((()()())())(()()(()))') == True\n assert candidate('((()())))') == False\n assert candidate(')(()') == False\n assert candidate('(') == False\n assert candidate('((((') == False\n assert candidate(')') == False\n assert candidate('(()') == False\n assert candidate('()()(()())())(()') == False\n assert candidate('()()(()())()))()') == False\n\ndef test_check():\n check(correct_bracketing)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "py", - "prompt": "def digitSum(s: str) -> int:\n \"\"\"Task\n Write a function that takes a string as input and returns the sum of the upper characters only'\n ASCII codes.\n\n Examples:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('') == 0\n assert candidate('abAB') == 131\n assert candidate('abcCd') == 67\n assert candidate('helloE') == 69\n assert candidate('woArBld') == 131\n assert candidate('aAaaaXa') == 153\n assert candidate(' How are yOu?') == 151\n assert candidate('You arE Very Smart') == 327\n\ndef test_check():\n check(digitSum)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "py", - "prompt": "from typing import List\n\ndef sorted_list_sum(lst: List[str]) -> List[str]:\n \"\"\"Write a function that accepts a list of strings as a parameter,\n deletes the strings that have odd lengths from it,\n and returns the resulted list with a sorted order,\n The list is always a list of strings and never an array of numbers,\n and it may contain duplicates.\n The order of the list should be ascending by length of each word, and you\n should return the list sorted by that rule.\n If two words have the same length, sort the list alphabetically.\n The function should return a list of strings in sorted order.\n You may assume that all words will have the same length.\n For example:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(['aa', 'a', 'aaa']) == ['aa']\n assert candidate(['school', 'AI', 'asdf', 'b']) == ['AI', 'asdf', 'school']\n assert candidate(['d', 'b', 'c', 'a']) == []\n assert candidate(['d', 'dcba', 'abcd', 'a']) == ['abcd', 'dcba']\n assert candidate(['AI', 'ai', 'au']) == ['AI', 'ai', 'au']\n assert candidate(['a', 'b', 'b', 'c', 'c', 'a']) == []\n assert candidate(['aaaa', 'bbbb', 'dd', 'cc']) == ['cc', 'dd', 'aaaa', 'bbbb']\n\ndef test_check():\n check(sorted_list_sum)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "py", - "prompt": "from typing import List, Optional\n\ndef prod_signs(arr: List[int]) -> Optional[int]:\n \"\"\"\n You are given an array arr of integers and you need to return\n sum of magnitudes of integers multiplied by product of all signs\n of each number in the array, represented by 1, -1 or 0.\n Note: return None for empty arr.\n\n Example:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 2, -4]) == -9\n assert candidate([0, 1]) == 0\n assert candidate([1, 1, 1, 2, 3, -1, 1]) == -10\n assert candidate([]) == None\n assert candidate([2, 4, 1, 2, -1, -1, 9]) == 20\n assert candidate([-1, 1, -1, 1]) == 4\n assert candidate([-1, 1, 1, 1]) == -4\n assert candidate([-1, 1, 1, 0]) == 0\n\ndef test_check():\n check(prod_signs)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "py", - "prompt": "from typing import List\n\ndef incr_list(l: List[int]) -> List[int]:\n \"\"\"Return list with elements incremented by 1.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == []\n assert candidate([3, 2, 1]) == [4, 3, 2]\n assert candidate([5, 2, 5, 2, 3, 3, 9, 0, 123]) == [6, 3, 6, 3, 4, 4, 10, 1, 124]\n\ndef test_check():\n check(incr_list)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "py", - "prompt": "from typing import List\n\ndef rolling_max(numbers: List[int]) -> List[int]:\n \"\"\" From a given list of integers, generate a list of rolling maximum element found until given moment\n in the sequence.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == []\n assert candidate([1, 2, 3, 4]) == [1, 2, 3, 4]\n assert candidate([4, 3, 2, 1]) == [4, 4, 4, 4]\n assert candidate([3, 2, 3, 100, 3]) == [3, 3, 3, 100, 100]\n\ndef test_check():\n check(rolling_max)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "py", - "prompt": "from typing import List\n\ndef separate_paren_groups(paren_string: str) -> List[str]:\n \"\"\" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n separate those group into separate strings and return the list of those.\n Separate groups are balanced (each open brace is properly closed) and not nested within each other\n Ignore any spaces in the input string.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('(()()) ((())) () ((())()())') == ['(()())', '((()))', '()', '((())()())']\n assert candidate('() (()) ((())) (((())))') == ['()', '(())', '((()))', '(((())))']\n assert candidate('(()(())((())))') == ['(()(())((())))']\n assert candidate('( ) (( )) (( )( ))') == ['()', '(())', '(()())']\n\ndef test_check():\n check(separate_paren_groups)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "py", - "prompt": "from typing import List\n\ndef words_string(s: str) -> List[str]:\n \"\"\"\n You will be given a string of words separated by commas or spaces. Your task is\n to split the string into words and return an array of the words.\n \n For example:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('Hi, my name is John') == ['Hi', 'my', 'name', 'is', 'John']\n assert candidate('One, two, three, four, five, six') == ['One', 'two', 'three', 'four', 'five', 'six']\n assert candidate('Hi, my name') == ['Hi', 'my', 'name']\n assert candidate('One,, two, three, four, five, six,') == ['One', 'two', 'three', 'four', 'five', 'six']\n assert candidate('') == []\n assert candidate('ahmed , gamal') == ['ahmed', 'gamal']\n\ndef test_check():\n check(words_string)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "py", - "prompt": "from typing import Union\n\ndef compare_one(a: Union[int, float, str], b: Union[int, float, str]) -> Union[int, float, str, None]:\n \"\"\"\n Create a function that takes integers, floats, or strings representing\n real numbers, and returns the larger variable in its given variable type.\n Return None if the values are equal.\n Note: If a real number is represented as a string, the floating point might be . or ,\n\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(1, 2) == 2\n assert candidate(1, 2.5) == 2.5\n assert candidate(2, 3) == 3\n assert candidate(5, 6) == 6\n assert candidate(1, '2,3') == '2,3'\n assert candidate('5,1', '6') == '6'\n assert candidate('1', '2') == '2'\n assert candidate('1', 1) == None\n\ndef test_check():\n check(compare_one)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "py", - "prompt": "from typing import List, Any\n\ndef filter_integers(values: List[Any]) -> List[int]:\n \"\"\" Filter given list of any python values only for integers\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == []\n assert candidate([4, { }, [], 23.2, 9, 'adasd']) == [4, 9]\n assert candidate([3, 'c', 3, 3, 'a', 'b']) == [3, 3, 3]\n\ndef test_check():\n check(filter_integers)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "py", - "prompt": "from typing import List\n\ndef sort_even(l: List[int]) -> List[int]:\n \"\"\"This function takes a list l and returns a list l' such that\n l' is identical to l in the odd indicies, while its values at the even indicies are equal\n to the values of the even indicies of l, but sorted.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 3]) == [1, 2, 3]\n assert candidate([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]) == [-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123]\n assert candidate([5, 8, -12, 4, 23, 2, 3, 11, 12, -10]) == [-12, 8, 3, 4, 5, 2, 12, 11, 23, -10]\n\ndef test_check():\n check(sort_even)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "py", - "prompt": "from typing import List\n\ndef compare(game: List[int], guess: List[int]) -> List[int]:\n \"\"\"I think we all remember that feeling when the result of some long-awaited\n event is finally known. The feelings and thoughts you have at that moment are\n definitely worth noting down and comparing.\n Your task is to determine if a person correctly guessed the results of a number of matches.\n You are given two arrays of scores and guesses of equal length, where each index shows a match. \n Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n the value is 0, and if not, the value is the absolute difference between the guess and the score.\n \n \n example:\n\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2]) == [0, 0, 0, 0, 3, 3]\n assert candidate([0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]) == [0, 0, 0, 0, 0, 0]\n assert candidate([1, 2, 3], [-1, -2, -3]) == [2, 4, 6]\n assert candidate([1, 2, 3, 5], [-1, 2, 3, 4]) == [2, 0, 0, 1]\n\ndef test_check():\n check(compare)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "py", - "prompt": "from typing import Tuple\n\ndef even_odd_palindrome(n: int) -> Tuple[int, int]:\n \"\"\"\n Given a positive integer n, return a tuple that has the number of even and odd\n integer palindromes that fall within the range(1, n), inclusive.\n\n Example 1:\n\n Explanation:\n Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n\n Example 2:\n\n Explanation:\n Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n\n Note:\n 1. 1 <= n <= 10^3\n 2. returned tuple has the number of even and odd integer palindromes respectively.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(123) == (8, 13)\n assert candidate(12) == (4, 6)\n assert candidate(3) == (1, 2)\n assert candidate(63) == (6, 8)\n assert candidate(25) == (5, 6)\n assert candidate(19) == (4, 6)\n assert candidate(9) == (4, 5)\n assert candidate(1) == (0, 1)\n\ndef test_check():\n check(even_odd_palindrome)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "py", - "prompt": "def fib4(n: int) -> int:\n \"\"\"The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fib4(0) -> 0\n fib4(1) -> 0\n fib4(2) -> 2\n fib4(3) -> 0\n fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(5) == 4\n assert candidate(8) == 28\n assert candidate(10) == 104\n assert candidate(12) == 386\n\ndef test_check():\n check(fib4)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "py", - "prompt": "from typing import List\n\ndef generate_integers(a: int, b: int) -> List[int]:\n \"\"\"\n Given two positive integers a and b, return the even digits between a\n and b, in ascending order.\n\n For example:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(2, 10) == [2, 4, 6, 8]\n assert candidate(10, 2) == [2, 4, 6, 8]\n assert candidate(132, 2) == [2, 4, 6, 8]\n assert candidate(17, 89) == []\n\ndef test_check():\n check(generate_integers)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "py", - "prompt": "from typing import List\n\ndef mean_absolute_deviation(numbers: List[float]) -> float:\n \"\"\" For a given list of input numbers, calculate Mean Absolute Deviation\n around the mean of this dataset.\n Mean Absolute Deviation is the average absolute difference between each\n element and a centerpoint (mean in this case):\n MAD = average | x - x_mean |\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1.0, 2.0]) == 0.5\n assert candidate([1.0, 2.0, 3.0, 4.0]) == 1.0\n assert candidate([1.0, 2.0, 3.0, 4.0, 5.0]) == 1.2\n\ndef test_check():\n check(mean_absolute_deviation)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "py", - "prompt": "def encrypt(s: str) -> str:\n \"\"\"Create a function encrypt that takes a string as an argument and\n returns a string encrypted with the alphabet being rotated. \n The alphabet should be rotated in a manner such that the letters \n shift down by two multiplied to two places.\n For example:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('hi') == 'lm'\n assert candidate('asdfghjkl') == 'ewhjklnop'\n assert candidate('gf') == 'kj'\n assert candidate('et') == 'ix'\n assert candidate('faewfawefaewg') == 'jeiajeaijeiak'\n assert candidate('hellomyfriend') == 'lippsqcjvmirh'\n assert candidate('dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh') == 'hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl'\n assert candidate('a') == 'e'\n\ndef test_check():\n check(encrypt)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "py", - "prompt": "from typing import List\n\ndef get_odd_collatz(n: int) -> List[int]:\n \"\"\"\n Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n\n The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n as follows: start with any positive integer n. Then each term is obtained from the \n previous term as follows: if the previous term is even, the next term is one half of \n the previous term. If the previous term is odd, the next term is 3 times the previous\n term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n\n Note: \n 1. Collatz(1) is [1].\n 2. returned list sorted in increasing order.\n\n For example:\n get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(14) == [1, 5, 7, 11, 13, 17]\n assert candidate(5) == [1, 5]\n assert candidate(12) == [1, 3, 5]\n assert candidate(1) == [1]\n\ndef test_check():\n check(get_odd_collatz)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "py", - "prompt": "def how_many_times(string: str, substring: str) -> int:\n \"\"\" Find how many times a given substring can be found in the original string. Count overlaping cases.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('', 'x') == 0\n assert candidate('xyxyxyx', 'x') == 4\n assert candidate('cacacacac', 'cac') == 4\n assert candidate('john doe', 'john') == 1\n\ndef test_check():\n check(how_many_times)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "py", - "prompt": "from typing import List\n\ndef move_one_ball(arr: List[int]) -> bool:\n \"\"\"We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n numbers in the array will be randomly ordered. Your task is to determine if\n it is possible to get an array sorted in non-decreasing order by performing \n the following operation on the given array:\n You are allowed to perform right shift operation any number of times.\n \n One right shift operation means shifting all elements of the array by one\n position in the right direction. The last element of the array will be moved to\n the starting position in the array i.e. 0th index. \n\n If it is possible to obtain the sorted array by performing the above operation\n then return True else return False.\n If the given array is empty then return True.\n\n Note: The given list is guaranteed to have unique elements.\n\n For Example:\n \n Explanation: By performin 2 right shift operations, non-decreasing order can\n be achieved for the given array.\n Explanation:It is not possible to get non-decreasing order for the given\n array by performing any number of right shift operations.\n \n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([3, 4, 5, 1, 2]) == True\n assert candidate([3, 5, 10, 1, 2]) == True\n assert candidate([4, 3, 1, 2]) == False\n assert candidate([3, 5, 4, 1, 2]) == False\n assert candidate([]) == True\n\ndef test_check():\n check(move_one_ball)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "py", - "prompt": "from typing import List\n\ndef order_by_points(nums: List[int]) -> List[int]:\n \"\"\"\n Write a function which sorts the given list of integers\n in ascending order according to the sum of their digits.\n Note: if there are several items with similar sum of their digits,\n order them based on their index in original list.\n\n For example:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]\n assert candidate([1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]) == [0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457]\n assert candidate([]) == []\n assert candidate([1, -11, -32, 43, 54, -98, 2, -3]) == [-3, -32, -98, -11, 1, 2, 43, 54]\n assert candidate([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) == [1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9]\n assert candidate([0, 6, 6, -76, -21, 23, 4]) == [-76, -21, 0, 4, 23, 6, 6]\n\ndef test_check():\n check(order_by_points)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "py", - "prompt": "from typing import List\n\ndef factorize(n: int) -> List[int]:\n \"\"\" Return list of prime factors of given integer in the order from smallest to largest.\n Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n Input number should be equal to the product of all factors\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(2) == [2]\n assert candidate(4) == [2, 2]\n assert candidate(8) == [2, 2, 2]\n assert candidate(57) == [3, 19]\n assert candidate(3249) == [3, 3, 19, 19]\n assert candidate(185193) == [3, 3, 3, 19, 19, 19]\n assert candidate(20577) == [3, 19, 19, 19]\n assert candidate(18) == [2, 3, 3]\n\ndef test_check():\n check(factorize)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "py", - "prompt": "from typing import List\n\ndef below_threshold(l: List[int], t: int) -> bool:\n \"\"\"Return True if all numbers in the list l are below threshold t.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 4, 10], 100) == True\n assert candidate([1, 20, 4, 10], 5) == False\n assert candidate([1, 20, 4, 10], 21) == True\n assert candidate([1, 20, 4, 10], 22) == True\n assert candidate([1, 8, 4, 10], 11) == True\n assert candidate([1, 8, 4, 10], 10) == False\n\ndef test_check():\n check(below_threshold)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "py", - "prompt": "from typing import Union\n\ndef rounded_avg(n: int, m: int) -> Union[str, int]:\n \"\"\"You are given two positive integers n and m, and your task is to compute the\n average of the integers from n through m (including n and m). \n Round the answer to the nearest integer and convert that to binary.\n If n is greater than m, return -1.\n Example:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(1, 5) == '0b11'\n assert candidate(7, 13) == '0b1010'\n assert candidate(964, 977) == '0b1111001010'\n assert candidate(996, 997) == '0b1111100100'\n assert candidate(560, 851) == '0b1011000010'\n assert candidate(185, 546) == '0b101101110'\n assert candidate(362, 496) == '0b110101101'\n assert candidate(350, 902) == '0b1001110010'\n assert candidate(197, 233) == '0b11010111'\n assert candidate(7, 5) == -1\n assert candidate(5, 1) == -1\n assert candidate(5, 5) == '0b101'\n\ndef test_check():\n check(rounded_avg)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "py", - "prompt": "from typing import List\n\ndef parse_nested_parens(paren_string: str) -> List[int]:\n \"\"\" Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n For each of the group, output the deepest level of nesting of parentheses.\n E.g. (()()) has maximum two levels of nesting while ((())) has three.\n\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('(()()) ((())) () ((())()())') == [2, 3, 1, 3]\n assert candidate('() (()) ((())) (((())))') == [1, 2, 3, 4]\n assert candidate('(()(())((())))') == [4]\n\ndef test_check():\n check(parse_nested_parens)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "py", - "prompt": "from typing import List\n\ndef solution(lst: List[int]) -> int:\n \"\"\"Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n \n\n Examples\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([5, 8, 7, 1]) == 12\n assert candidate([3, 3, 3, 3, 3]) == 9\n assert candidate([30, 13, 24, 321]) == 0\n assert candidate([5, 9]) == 5\n assert candidate([2, 4, 8]) == 0\n assert candidate([30, 13, 23, 32]) == 23\n assert candidate([3, 13, 2, 9]) == 3\n\ndef test_check():\n check(solution)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "py", - "prompt": "def get_max_triples(n: int) -> int:\n \"\"\"\n You are given a positive integer n. You have to create an integer array a of length n.\n For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n and a[i] + a[j] + a[k] is a multiple of 3.\n\n Example :\n Explanation: \n a = [1, 3, 7, 13, 21]\n The only valid triple is (1, 7, 13).\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(5) == 1\n assert candidate(6) == 4\n assert candidate(10) == 36\n assert candidate(100) == 53361\n\ndef test_check():\n check(get_max_triples)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "py", - "prompt": "from typing import Tuple\n\ndef bf(planet1: str, planet2: str) -> Tuple[str, ...]:\n \"\"\"\n There are eight planets in our solar system: the closerst to the Sun \n is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n Uranus, Neptune.\n Write a function that takes two planet names as strings planet1 and planet2. \n The function should return a tuple containing all planets whose orbits are \n located between the orbit of planet1 and the orbit of planet2, sorted by \n the proximity to the sun. \n The function should return an empty tuple if planet1 or planet2\n are not correct planet names. \n Examples\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('Jupiter', 'Neptune') == ('Saturn', 'Uranus')\n assert candidate('Earth', 'Mercury') == ('Venus',)\n assert candidate('Mercury', 'Uranus') == ('Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn')\n assert candidate('Neptune', 'Venus') == ('Earth', 'Mars', 'Jupiter', 'Saturn', 'Uranus')\n assert candidate('Earth', 'Earth') == ()\n assert candidate('Mars', 'Earth') == ()\n assert candidate('Jupiter', 'Makemake') == ()\n\ndef test_check():\n check(bf)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "py", - "prompt": "from typing import List, Optional\n\ndef next_smallest(lst: List[int]) -> Optional[int]:\n \"\"\"\n You are given a list of integers.\n Write a function next_smallest() that returns the 2nd smallest element of the list.\n Return None if there is no such element.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 3, 4, 5]) == 2\n assert candidate([5, 1, 4, 3, 2]) == 2\n assert candidate([]) == None\n assert candidate([1, 1]) == None\n assert candidate([1, 1, 1, 1, 0]) == 1\n assert candidate([1, 1]) == None\n assert candidate([-35, 34, 12, -45]) == -35\n\ndef test_check():\n check(next_smallest)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "py", - "prompt": "def sort_numbers(numbers: str) -> str:\n \"\"\" Input is a space-delimited string of numberals from 'zero' to 'nine'.\n Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n Return the string with numbers sorted from smallest to largest\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('') == ''\n assert candidate('three') == 'three'\n assert candidate('three five nine') == 'three five nine'\n assert candidate('five zero four seven nine eight') == 'zero four five seven eight nine'\n assert candidate('six five four three two one zero') == 'zero one two three four five six'\n\ndef test_check():\n check(sort_numbers)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "py", - "prompt": "def cycpattern_check(a: str, b: str) -> bool:\n \"\"\"You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n \n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('xyzw', 'xyw') == False\n assert candidate('yello', 'ell') == True\n assert candidate('whattup', 'ptut') == False\n assert candidate('efef', 'fee') == True\n assert candidate('abab', 'aabb') == False\n assert candidate('winemtt', 'tinem') == True\n\ndef test_check():\n check(cycpattern_check)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "py", - "prompt": "def decimal_to_binary(decimal: int) -> str:\n \"\"\"You will be given a number in decimal form and your task is to convert it to\n binary format. The function should return a string, with each character representing a binary\n number. Each character in the string will be '0' or '1'.\n\n There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n The extra characters are there to help with the format.\n\n Examples:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(0) == 'db0db'\n assert candidate(32) == 'db100000db'\n assert candidate(103) == 'db1100111db'\n assert candidate(15) == 'db1111db'\n\ndef test_check():\n check(decimal_to_binary)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "py", - "prompt": "from typing import List\n\ndef filter_by_substring(strings: List[str], substring: str) -> List[str]:\n \"\"\" Filter an input list of strings only for ones that contain given substring\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([], 'john') == []\n assert candidate(['xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'], 'xxx') == ['xxx', 'xxxAAA', 'xxx']\n assert candidate(['xxx', 'asd', 'aaaxxy', 'john doe', 'xxxAAA', 'xxx'], 'xx') == ['xxx', 'aaaxxy', 'xxxAAA', 'xxx']\n assert candidate(['grunt', 'trumpet', 'prune', 'gruesome'], 'run') == ['grunt', 'prune']\n\ndef test_check():\n check(filter_by_substring)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "py", - "prompt": "from typing import Tuple\n\ndef even_odd_count(num: int) -> Tuple[int, int]:\n \"\"\"Given an integer. return a tuple that has the number of even and odd digits respectively.\n\n Example:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(7) == (0, 1)\n assert candidate(-78) == (1, 1)\n assert candidate(3452) == (2, 2)\n assert candidate(346211) == (3, 3)\n assert candidate(-345821) == (3, 3)\n assert candidate(-2) == (1, 0)\n assert candidate(-45347) == (2, 3)\n assert candidate(0) == (1, 0)\n\ndef test_check():\n check(even_odd_count)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "py", - "prompt": "from typing import List\n\ndef find_max(words: List[str]) -> str:\n \"\"\"Write a function that accepts a list of strings.\n The list contains different words. Return the word with maximum number\n of unique characters. If multiple strings have maximum number of unique\n characters, return the one which comes first in lexicographical order.\n\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(['name', 'of', 'string']) == 'string'\n assert candidate(['name', 'enam', 'game']) == 'enam'\n assert candidate(['aaaaaaa', 'bb', 'cc']) == 'aaaaaaa'\n assert candidate(['abc', 'cba']) == 'abc'\n assert candidate(['play', 'this', 'game', 'of', 'footbott']) == 'footbott'\n assert candidate(['we', 'are', 'gonna', 'rock']) == 'gonna'\n assert candidate(['we', 'are', 'a', 'mad', 'nation']) == 'nation'\n assert candidate(['this', 'is', 'a', 'prrk']) == 'this'\n assert candidate(['b']) == 'b'\n assert candidate(['play', 'play', 'play']) == 'play'\n\ndef test_check():\n check(find_max)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "py", - "prompt": "from typing import List, Tuple, Optional\n\ndef largest_smallest_integers(lst: List[int]) -> Tuple[Optional[int], Optional[int]]:\n \"\"\"\n Create a function that returns a tuple (a, b), where 'a' is\n the largest of negative integers, and 'b' is the smallest\n of positive integers in a list.\n If there is no negative or positive integers, return them as None.\n\n Examples:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([2, 4, 1, 3, 5, 7]) == (None, 1)\n assert candidate([2, 4, 1, 3, 5, 7, 0]) == (None, 1)\n assert candidate([1, 3, 2, 4, 5, 6, -2]) == (-2, 1)\n assert candidate([4, 5, 3, 6, 2, 7, -7]) == (-7, 2)\n assert candidate([7, 3, 8, 4, 9, 2, 5, -9]) == (-9, 2)\n assert candidate([]) == (None, None)\n assert candidate([0]) == (None, None)\n assert candidate([-1, -3, -5, -6]) == (-1, None)\n assert candidate([-1, -3, -5, -6, 0]) == (-1, None)\n assert candidate([-6, -4, -4, -3, 1]) == (-3, 1)\n assert candidate([-6, -4, -4, -3, -100, 1]) == (-3, 1)\n\ndef test_check():\n check(largest_smallest_integers)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "py", - "prompt": "from typing import List\n\ndef pluck(arr: List[int]) -> List[int]:\n \"\"\"\n \"Given an array representing a branch of a tree that has non-negative integer nodes\n your task is to pluck one of the nodes and return it.\n The plucked node should be the node with the smallest even value.\n If multiple nodes with the same smallest even value are found return the node that has smallest index.\n\n The plucked node should be returned in a list, [ smalest_value, its index ],\n If there are no even values or the given array is empty, return [].\n\n Example 1:\n Explanation: 2 has the smallest even value, and 2 has the smallest index.\n\n Example 2:\n Explanation: 2 has the smallest even value, and 2 has the smallest index.\n\n Example 3:\n \n Example 4:\n Explanation: 0 is the smallest value, but there are two zeros,\n so we will choose the first zero, which has the smallest index.\n\n Constraints:\n * 1 <= nodes.length <= 10000\n * 0 <= node.value\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([4, 2, 3]) == [2, 1]\n assert candidate([1, 2, 3]) == [2, 1]\n assert candidate([]) == []\n assert candidate([5, 0, 3, 0, 4, 2]) == [0, 1]\n assert candidate([1, 2, 3, 0, 5, 3]) == [0, 3]\n assert candidate([5, 4, 8, 4, 8]) == [4, 1]\n assert candidate([7, 6, 7, 1]) == [6, 1]\n assert candidate([7, 9, 7, 1]) == []\n\ndef test_check():\n check(pluck)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "py", - "prompt": "from typing import List\n\ndef count_nums(arr: List[int]) -> int:\n \"\"\"\n Write a function count_nums which takes an array of integers and returns\n the number of elements which has a sum of digits > 0.\n If a number is negative, then its first signed digit will be negative:\n e.g. -123 has signed digits -1, 2, and 3.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == 0\n assert candidate([-1, -2, 0]) == 0\n assert candidate([1, 1, 2, -2, 3, 4, 5]) == 6\n assert candidate([1, 6, 9, -6, 0, 1, 5]) == 5\n assert candidate([1, 100, 98, -7, 1, -1]) == 4\n assert candidate([12, 23, 34, -45, -56, 0]) == 5\n assert candidate([0, 1]) == 1\n assert candidate([1]) == 1\n\ndef test_check():\n check(count_nums)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "py", - "prompt": "from typing import List\n\ndef minPath(grid: List[List[int]], k: int) -> List[int]:\n \"\"\"\n Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n each cell of the grid contains a value. Every integer in the range [1, N * N]\n inclusive appears exactly once on the cells of the grid.\n\n You have to find the minimum path of length k in the grid. You can start\n from any cell, and in each step you can move to any of the neighbor cells,\n in other words, you can go to cells which share an edge with you current\n cell.\n Please note that a path of length k means visiting exactly k cells (not\n necessarily distinct).\n You CANNOT go off the grid.\n A path A (of length k) is considered less than a path B (of length k) if\n after making the ordered lists of the values on the cells that A and B go\n through (let's call them lst_A and lst_B), lst_A is lexicographically less\n than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n lst_A[j] = lst_B[j].\n It is guaranteed that the answer is unique.\n Return an ordered list of the values on the cells that the minimum path go through.\n\n Examples: \n \n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3) == [1, 2, 1]\n assert candidate([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1) == [1]\n assert candidate([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], 4) == [1, 2, 1, 2]\n assert candidate([[6, 4, 13, 10], [5, 7, 12, 1], [3, 16, 11, 15], [8, 14, 9, 2]], 7) == [1, 10, 1, 10, 1, 10, 1]\n assert candidate([[8, 14, 9, 2], [6, 4, 13, 15], [5, 7, 1, 12], [3, 10, 11, 16]], 5) == [1, 7, 1, 7, 1]\n assert candidate([[11, 8, 7, 2], [5, 16, 14, 4], [9, 3, 15, 6], [12, 13, 10, 1]], 9) == [1, 6, 1, 6, 1, 6, 1, 6, 1]\n assert candidate([[12, 13, 10, 1], [9, 3, 15, 6], [5, 16, 14, 4], [11, 8, 7, 2]], 12) == [1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6]\n assert candidate([[2, 7, 4], [3, 1, 5], [6, 8, 9]], 8) == [1, 3, 1, 3, 1, 3, 1, 3]\n assert candidate([[6, 1, 5], [3, 8, 9], [2, 7, 4]], 8) == [1, 5, 1, 5, 1, 5, 1, 5]\n assert candidate([[1, 2], [3, 4]], 10) == [1, 2, 1, 2, 1, 2, 1, 2, 1, 2]\n assert candidate([[1, 3], [3, 2]], 10) == [1, 3, 1, 3, 1, 3, 1, 3, 1, 3]\n\ndef test_check():\n check(minPath)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "py", - "prompt": "from typing import List\n\ndef strange_sort_list(lst: List[int]) -> List[int]:\n \"\"\"\n Given list of integers, return list in strange order.\n Strange sorting, is when you start with the minimum value,\n then maximum of the remaining integers, then minimum and so on.\n\n Examples:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 3, 4]) == [1, 4, 2, 3]\n assert candidate([5, 6, 7, 8, 9]) == [5, 9, 6, 8, 7]\n assert candidate([1, 2, 3, 4, 5]) == [1, 5, 2, 4, 3]\n assert candidate([5, 6, 7, 8, 9, 1]) == [1, 9, 5, 8, 6, 7]\n assert candidate([5, 5, 5, 5]) == [5, 5, 5, 5]\n assert candidate([]) == []\n assert candidate([1, 2, 3, 4, 5, 6, 7, 8]) == [1, 8, 2, 7, 3, 6, 4, 5]\n assert candidate([0, 2, 2, 2, 5, 5, -5, -5]) == [-5, 5, -5, 5, 0, 2, 2, 2]\n assert candidate([111111]) == [111111]\n\ndef test_check():\n check(strange_sort_list)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "py", - "prompt": "from typing import Optional\n\ndef string_to_md5(text: str) -> Optional[str]:\n \"\"\"\n Given a string 'text', return its md5 hash equivalent string.\n If 'text' is an empty string, return None.\n\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'\n assert candidate('') == None\n assert candidate('A B C') == '0ef78513b0cb8cef12743f5aeb35f888'\n assert candidate('password') == '5f4dcc3b5aa765d61d8327deb882cf99'\n\ndef test_check():\n check(string_to_md5)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "py", - "prompt": "def get_closest_vowel(word: str) -> str:\n \"\"\"You are given a word. Your task is to find the closest vowel that stands between \n two consonants from the right side of the word (case sensitive).\n \n Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n find any vowel met the above condition. \n\n You may assume that the given string contains English letter only.\n\n Example:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('yogurt') == 'u'\n assert candidate('full') == 'u'\n assert candidate('easy') == ''\n assert candidate('eAsy') == ''\n assert candidate('ali') == ''\n assert candidate('bad') == 'a'\n assert candidate('most') == 'o'\n assert candidate('ab') == ''\n assert candidate('ba') == ''\n assert candidate('quick') == ''\n assert candidate('anime') == 'i'\n assert candidate('Asia') == ''\n assert candidate('Above') == 'o'\n\ndef test_check():\n check(get_closest_vowel)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "py", - "prompt": "def change_base(x: int, base: int) -> str:\n \"\"\"Change numerical base of input number x to base.\n return string representation after the conversion.\n base numbers are less than 10.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(8, 3) == '22'\n assert candidate(9, 3) == '100'\n assert candidate(234, 2) == '11101010'\n assert candidate(16, 2) == '10000'\n assert candidate(8, 2) == '1000'\n assert candidate(7, 2) == '111'\n assert candidate(2, 3) == '2'\n assert candidate(3, 4) == '3'\n assert candidate(4, 5) == '4'\n assert candidate(5, 6) == '5'\n assert candidate(6, 7) == '6'\n assert candidate(7, 8) == '7'\n\ndef test_check():\n check(change_base)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "py", - "prompt": "from typing import List\n\ndef has_close_elements(numbers: List[float], threshold: float) -> bool:\n \"\"\" Check if in given list of numbers, are any two numbers closer to each other than\n given threshold.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3) == True\n assert candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05) == False\n assert candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.95) == True\n assert candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.8) == False\n assert candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1) == True\n assert candidate([1.1, 2.2, 3.1, 4.1, 5.1], 1.0) == True\n assert candidate([1.1, 2.2, 3.1, 4.1, 5.1], 0.5) == False\n\ndef test_check():\n check(has_close_elements)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "py", - "prompt": "def is_nested(string: str) -> bool:\n \"\"\"\n Create a function that takes a string as input which contains only square brackets.\n The function should return True if and only if there is a valid subsequence of brackets \n where at least one bracket in the subsequence is nested.\n\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('[[]]') == True\n assert candidate('[]]]]]]][[[[[]') == False\n assert candidate('[][]') == False\n assert candidate('[]') == False\n assert candidate('[[[[]]]]') == True\n assert candidate('[]]]]]]]]]]') == False\n assert candidate('[][][[]]') == True\n assert candidate('[[]') == False\n assert candidate('[]]') == False\n assert candidate('[[]][[') == True\n assert candidate('[[][]]') == True\n assert candidate('') == False\n assert candidate('[[[[[[[[') == False\n assert candidate(']]]]]]]]') == False\n\ndef test_check():\n check(is_nested)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "py", - "prompt": "from typing import List\n\ndef concatenate(strings: List[str]) -> str:\n \"\"\" Concatenate list of strings into a single string\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == ''\n assert candidate(['x', 'y', 'z']) == 'xyz'\n assert candidate(['x', 'y', 'z', 'w', 'k']) == 'xyzwk'\n\ndef test_check():\n check(concatenate)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "py", - "prompt": "def prime_fib(n: int) -> int:\n \"\"\"\n prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(1) == 2\n assert candidate(2) == 3\n assert candidate(3) == 5\n assert candidate(4) == 13\n assert candidate(5) == 89\n assert candidate(6) == 233\n assert candidate(7) == 1597\n assert candidate(8) == 28657\n assert candidate(9) == 514229\n assert candidate(10) == 433494437\n\ndef test_check():\n check(prime_fib)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "py", - "prompt": "from typing import List, Tuple\n\ndef find_closest_elements(numbers: List[float]) -> Tuple[float, float]:\n \"\"\" From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n other and return them in order (smaller number, larger number).\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2]) == (3.9, 4.0)\n assert candidate([1.0, 2.0, 5.9, 4.0, 5.0]) == (5.0, 5.9)\n assert candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]) == (2.0, 2.2)\n assert candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]) == (2.0, 2.0)\n assert candidate([1.1, 2.2, 3.1, 4.1, 5.1]) == (2.2, 3.1)\n\ndef test_check():\n check(find_closest_elements)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "py", - "prompt": "def hex_key(num: str) -> int:\n \"\"\"You have been tasked to write a function that receives \n a hexadecimal number as a string and counts the number of hexadecimal \n digits that are primes (prime number, or a prime, is a natural number \n greater than 1 that is not a product of two smaller natural numbers).\n Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n So you have to determine a number of the following digits: 2, 3, 5, 7, \n B (=decimal 11), D (=decimal 13).\n Note: you may assume the input is always correct or empty string, \n and symbols A,B,C,D,E,F are always uppercase.\n Examples:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('AB') == 1\n assert candidate('1077E') == 2\n assert candidate('ABED1A33') == 4\n assert candidate('2020') == 2\n assert candidate('123456789ABCDEF0') == 6\n assert candidate('112233445566778899AABBCCDDEEFF00') == 12\n\ndef test_check():\n check(hex_key)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "py", - "prompt": "def multiply(a: int, b: int) -> int:\n \"\"\"Complete the function that takes two integers and returns \n the product of their unit digits.\n Assume the input is always valid.\n Examples:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(148, 412) == 16\n assert candidate(19, 28) == 72\n assert candidate(2020, 1851) == 0\n assert candidate(14, -15) == 20\n assert candidate(76, 67) == 42\n assert candidate(17, 27) == 49\n assert candidate(0, 1) == 0\n assert candidate(0, 0) == 0\n\ndef test_check():\n check(multiply)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "py", - "prompt": "from typing import List\n\ndef rescale_to_unit(numbers: List[float]) -> List[float]:\n \"\"\" Given list of numbers (of at least two elements), apply a linear transform to that list,\n such that the smallest number will become 0 and the largest will become 1\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([2.0, 49.9]) == [0.0, 1.0]\n assert candidate([100.0, 49.9]) == [1.0, 0.0]\n assert candidate([1.0, 2.0, 3.0, 4.0, 5.0]) == [0.0, 0.25, 0.5, 0.75, 1.0]\n assert candidate([2.0, 1.0, 5.0, 3.0, 4.0]) == [0.25, 0.0, 1.0, 0.5, 0.75]\n assert candidate([12.0, 11.0, 15.0, 13.0, 14.0]) == [0.25, 0.0, 1.0, 0.5, 0.75]\n\ndef test_check():\n check(rescale_to_unit)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "py", - "prompt": "def digits(n: int) -> int:\n \"\"\"Given a positive integer n, return the product of the odd digits.\n Return 0 if all digits are even.\n For example:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(5) == 5\n assert candidate(54) == 5\n assert candidate(120) == 1\n assert candidate(5014) == 5\n assert candidate(98765) == 315\n assert candidate(5576543) == 2625\n assert candidate(2468) == 0\n\ndef test_check():\n check(digits)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "py", - "prompt": "from typing import List\n\ndef Strongest_Extension(class_name: str, extensions: List[str]) -> str:\n \"\"\"You will be given the name of a class (a string) and a list of extensions.\n The extensions are to be used to load additional classes to the class. The\n strength of the extension is as follows: Let CAP be the number of the uppercase\n letters in the extension's name, and let SM be the number of lowercase letters \n in the extension's name, the strength is given by the fraction CAP - SM. \n You should find the strongest extension and return a string in this \n format: ClassName.StrongestExtensionName.\n If there are two or more extensions with the same strength, you should\n choose the one that comes first in the list.\n For example, if you are given \"Slices\" as the class and a list of the\n extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n (its strength is -1).\n Example:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('Watashi', ['tEN', 'niNE', 'eIGHt8OKe']) == 'Watashi.eIGHt8OKe'\n assert candidate('Boku123', ['nani', 'NazeDa', 'YEs.WeCaNe', '32145tggg']) == 'Boku123.YEs.WeCaNe'\n assert candidate('__YESIMHERE', ['t', 'eMptY', 'nothing', 'zeR00', 'NuLl__', '123NoooneB321']) == '__YESIMHERE.NuLl__'\n assert candidate('K', ['Ta', 'TAR', 't234An', 'cosSo']) == 'K.TAR'\n assert candidate('__HAHA', ['Tab', '123', '781345', '-_-']) == '__HAHA.123'\n assert candidate('YameRore', ['HhAas', 'okIWILL123', 'WorkOut', 'Fails', '-_-']) == 'YameRore.okIWILL123'\n assert candidate('finNNalLLly', ['Die', 'NowW', 'Wow', 'WoW']) == 'finNNalLLly.WoW'\n assert candidate('_', ['Bb', '91245']) == '_.Bb'\n assert candidate('Sp', ['671235', 'Bb']) == 'Sp.671235'\n\ndef test_check():\n check(Strongest_Extension)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "py", - "prompt": "from typing import Dict\n\ndef histogram(test: str) -> Dict[str, int]:\n \"\"\"Given a string representing a space separated lowercase letters, return a dictionary\n of the letter with the most repetition and containing the corresponding count.\n If several letters have the same occurrence, return all of them.\n \n Example:\n \n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('a b b a') == { 'a': 2, 'b': 2 }\n assert candidate('a b c a b') == { 'a': 2, 'b': 2 }\n assert candidate('a b c d g') == { 'a': 1, 'b': 1, 'c': 1, 'd': 1, 'g': 1 }\n assert candidate('r t g') == { 'r': 1, 't': 1, 'g': 1 }\n assert candidate('b b b b a') == { 'b': 4 }\n assert candidate('r t g') == { 'r': 1, 't': 1, 'g': 1 }\n assert candidate('') == { }\n assert candidate('a') == { 'a': 1 }\n\ndef test_check():\n check(histogram)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "py", - "prompt": "from typing import List\n\ndef pairs_sum_to_zero(l: List[int]) -> bool:\n \"\"\"\n pairs_sum_to_zero takes a list of integers as an input.\n it returns True if there are two distinct elements in the list that\n sum to zero, and False otherwise.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 3, 5, 0]) == False\n assert candidate([1, 3, -2, 1]) == False\n assert candidate([1, 2, 3, 7]) == False\n assert candidate([2, 4, -5, 3, 5, 7]) == True\n assert candidate([1]) == False\n assert candidate([-3, 9, -1, 3, 2, 30]) == True\n assert candidate([-3, 9, -1, 3, 2, 31]) == True\n assert candidate([-3, 9, -1, 4, 2, 30]) == False\n assert candidate([-3, 9, -1, 4, 2, 31]) == False\n\ndef test_check():\n check(pairs_sum_to_zero)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "py", - "prompt": "from typing import List\n\ndef total_match(lst1: List[str], lst2: List[str]) -> List[str]:\n \"\"\"\n Write a function that accepts two lists of strings and returns the list that has \n total number of chars in the all strings of the list less than the other list.\n\n if the two lists have the same number of chars, return the first list.\n\n Examples\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([], []) == []\n assert candidate(['hi', 'admin'], ['hi', 'hi']) == ['hi', 'hi']\n assert candidate(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) == ['hi', 'admin']\n assert candidate(['4'], ['1', '2', '3', '4', '5']) == ['4']\n assert candidate(['hi', 'admin'], ['hI', 'Hi']) == ['hI', 'Hi']\n assert candidate(['hi', 'admin'], ['hI', 'hi', 'hi']) == ['hI', 'hi', 'hi']\n assert candidate(['hi', 'admin'], ['hI', 'hi', 'hii']) == ['hi', 'admin']\n assert candidate([], ['this']) == []\n assert candidate(['this'], []) == []\n\ndef test_check():\n check(total_match)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "py", - "prompt": "def circular_shift(x: int, shift: int) -> str:\n \"\"\"Circular shift the digits of the integer x, shift the digits right by shift\n and return the result as a string.\n If shift > number of digits, return digits reversed.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(100, 2) == '001'\n assert candidate(12, 2) == '12'\n assert candidate(97, 8) == '79'\n assert candidate(12, 1) == '21'\n assert candidate(11, 101) == '11'\n\ndef test_check():\n check(circular_shift)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "py", - "prompt": "from typing import List\n\ndef monotonic(l: List[int]) -> bool:\n \"\"\"Return True is list elements are monotonically increasing or decreasing.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 4, 10]) == True\n assert candidate([1, 2, 4, 20]) == True\n assert candidate([1, 20, 4, 10]) == False\n assert candidate([4, 1, 0, -10]) == True\n assert candidate([4, 1, 1, 0]) == True\n assert candidate([1, 2, 3, 2, 5, 60]) == False\n assert candidate([1, 2, 3, 4, 5, 60]) == True\n assert candidate([9, 9, 9, 9]) == True\n\ndef test_check():\n check(monotonic)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "py", - "prompt": "def is_equal_to_sum_even(n: int) -> bool:\n \"\"\"Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n Example\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(4) == False\n assert candidate(6) == False\n assert candidate(8) == True\n assert candidate(10) == True\n assert candidate(11) == False\n assert candidate(12) == True\n assert candidate(13) == False\n assert candidate(16) == True\n\ndef test_check():\n check(is_equal_to_sum_even)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "py", - "prompt": "from typing import List\n\ndef parse_music(music_string: str) -> List[int]:\n \"\"\" Input to this function is a string representing musical notes in a special ASCII format.\n Your task is to parse this string and return list of integers corresponding to how many beats does each\n not last.\n\n Here is a legend:\n 'o' - whole note, lasts four beats\n 'o|' - half note, lasts two beats\n '.|' - quater note, lasts one beat\n\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('') == []\n assert candidate('o o o o') == [4, 4, 4, 4]\n assert candidate('.| .| .| .|') == [1, 1, 1, 1]\n assert candidate('o| o| .| .| o o o o') == [2, 2, 1, 1, 4, 4, 4, 4]\n assert candidate('o| .| o| .| o o| o o|') == [2, 1, 2, 1, 4, 2, 4, 2]\n\ndef test_check():\n check(parse_music)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "py", - "prompt": "from typing import List\n\ndef sum_squares(lst: List[int]) -> int:\n \"\"\"\"\n This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n \n Examples:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 3]) == 6\n assert candidate([1, 4, 9]) == 14\n assert candidate([]) == 0\n assert candidate([1, 1, 1, 1, 1, 1, 1, 1, 1]) == 9\n assert candidate([-1, -1, -1, -1, -1, -1, -1, -1, -1]) == -3\n assert candidate([0]) == 0\n assert candidate([-1, -5, 2, -1, -5]) == -126\n assert candidate([-56, -99, 1, 0, -2]) == 3030\n assert candidate([-1, 0, 0, 0, 0, 0, 0, 0, -1]) == 0\n assert candidate([-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37]) == -14196\n assert candidate([-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10]) == -1448\n\ndef test_check():\n check(sum_squares)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "py", - "prompt": "from typing import List\n\ndef triples_sum_to_zero(l: List[int]) -> bool:\n \"\"\"\n triples_sum_to_zero takes a list of integers as an input.\n it returns True if there are three distinct elements in the list that\n sum to zero, and False otherwise.\n\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 3, 5, 0]) == False\n assert candidate([1, 3, 5, -1]) == False\n assert candidate([1, 3, -2, 1]) == True\n assert candidate([1, 2, 3, 7]) == False\n assert candidate([1, 2, 5, 7]) == False\n assert candidate([2, 4, -5, 3, 9, 7]) == True\n assert candidate([1]) == False\n assert candidate([1, 3, 5, -100]) == False\n assert candidate([100, 3, 5, -100]) == False\n\ndef test_check():\n check(triples_sum_to_zero)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "py", - "prompt": "def correct_bracketing(brackets: str) -> bool:\n \"\"\" brackets is a string of \"<\" and \">\".\n return True if every opening bracket has a corresponding closing bracket.\n\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('<>') == True\n assert candidate('<<><>>') == True\n assert candidate('<><><<><>><>') == True\n assert candidate('<><><<<><><>><>><<><><<>>>') == True\n assert candidate('<<<><>>>>') == False\n assert candidate('><<>') == False\n assert candidate('<') == False\n assert candidate('<<<<') == False\n assert candidate('>') == False\n assert candidate('<<>') == False\n assert candidate('<><><<><>><>><<>') == False\n assert candidate('<><><<><>><>>><>') == False\n\ndef test_check():\n check(correct_bracketing)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "py", - "prompt": "from typing import List\n\ndef specialFilter(nums: List[int]) -> int:\n \"\"\"Write a function that takes an array of numbers as input and returns \n the number of elements in the array that are greater than 10 and both \n first and last digits of a number are odd (1, 3, 5, 7, 9).\n For example:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([5, -2, 1, -5]) == 0\n assert candidate([15, -73, 14, -15]) == 1\n assert candidate([33, -2, -3, 45, 21, 109]) == 2\n assert candidate([43, -12, 93, 125, 121, 109]) == 4\n assert candidate([71, -2, -33, 75, 21, 19]) == 3\n assert candidate([1]) == 0\n assert candidate([]) == 0\n\ndef test_check():\n check(specialFilter)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "py", - "prompt": "from typing import Dict\n\ndef check_dict_case(dict: Dict[str, str]) -> bool:\n \"\"\"\n Given a dictionary, return True if all keys are strings in lower \n case or all keys are strings in upper case, else return False.\n The function should return False is the given dictionary is empty.\n Examples:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate({ 'p': 'pineapple', 'b': 'banana' }) == True\n assert candidate({ 'p': 'pineapple', 'A': 'banana', 'B': 'banana' }) == False\n assert candidate({ 'p': 'pineapple', '5': 'banana', 'a': 'apple' }) == False\n assert candidate({ 'Name': 'John', 'Age': '36', 'City': 'Houston' }) == False\n assert candidate({ 'STATE': 'NC', 'ZIP': '12345' }) == True\n assert candidate({ 'fruit': 'Orange', 'taste': 'Sweet' }) == True\n assert candidate({ }) == False\n\ndef test_check():\n check(check_dict_case)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "py", - "prompt": "from typing import Union, List\n\ndef split_words(txt: str) -> Union[List[str], int]:\n \"\"\"\n Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n Examples\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('Hello world!') == ['Hello', 'world!']\n assert candidate('Hello,world!') == ['Hello', 'world!']\n assert candidate('Hello world,!') == ['Hello', 'world,!']\n assert candidate('Hello,Hello,world !') == ['Hello,Hello,world', '!']\n assert candidate('abcdef') == 3\n assert candidate('aaabb') == 2\n assert candidate('aaaBb') == 1\n assert candidate('') == 0\n\ndef test_check():\n check(split_words)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "py", - "prompt": "def fibfib(n: int) -> int:\n \"\"\"The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fibfib(0) == 0\n fibfib(1) == 0\n fibfib(2) == 1\n fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(2) == 1\n assert candidate(1) == 0\n assert candidate(5) == 4\n assert candidate(8) == 24\n assert candidate(10) == 81\n assert candidate(12) == 274\n assert candidate(14) == 927\n\ndef test_check():\n check(fibfib)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "py", - "prompt": "from typing import List\n\ndef sum_squares(lst: List[float]) -> int:\n \"\"\"You are given a list of numbers.\n You need to return the sum of squared numbers in the given list,\n round each element in the list to the upper int(Ceiling) first.\n Examples:\n \n\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1.0, 2.0, 3.0]) == 14\n assert candidate([1.0, 2.0, 3.0]) == 14\n assert candidate([1.0, 3.0, 5.0, 7.0]) == 84\n assert candidate([1.4, 4.2, 0.0]) == 29\n assert candidate([-2.4, 1.0, 1.0]) == 6\n assert candidate([100.0, 1.0, 15.0, 2.0]) == 10230\n assert candidate([10000.0, 10000.0]) == 200000000\n assert candidate([-1.4, 4.6, 6.3]) == 75\n assert candidate([-1.4, 17.9, 18.9, 19.9]) == 1086\n assert candidate([0.0]) == 0\n assert candidate([-1.0]) == 1\n assert candidate([-1.0, 1.0, 0.0]) == 2\n\ndef test_check():\n check(sum_squares)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_85_add", - "language": "py", - "prompt": "from typing import List\n\ndef add(lst: List[int]) -> int:\n \"\"\"Given a non-empty list of integers lst. add the even elements that are at odd indices..\n\n\n Examples:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([4, 88]) == 88\n assert candidate([4, 5, 6, 7, 2, 122]) == 122\n assert candidate([4, 0, 6, 7]) == 0\n assert candidate([4, 4, 6, 8]) == 12\n\ndef test_check():\n check(add)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "py", - "prompt": "from typing import List\n\ndef unique(l: List[int]) -> List[int]:\n \"\"\"Return sorted unique elements in a list\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([5, 3, 5, 2, 3, 3, 9, 0, 123]) == [0, 2, 3, 5, 9, 123]\n\ndef test_check():\n check(unique)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "py", - "prompt": "def fix_spaces(text: str) -> str:\n \"\"\"\n Given a string text, replace all spaces in it with underscores, \n and if a string has more than 2 consecutive spaces, \n then replace all consecutive spaces with - \n \n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('Example') == 'Example'\n assert candidate('Mudasir Hanif ') == 'Mudasir_Hanif_'\n assert candidate('Yellow Yellow Dirty Fellow') == 'Yellow_Yellow__Dirty__Fellow'\n assert candidate('Exa mple') == 'Exa-mple'\n assert candidate(' Exa 1 2 2 mple') == '-Exa_1_2_2_mple'\n\ndef test_check():\n check(fix_spaces)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "py", - "prompt": "def modp(n: int, p: int) -> int:\n \"\"\"Return 2^n modulo p (be aware of numerics).\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(3, 5) == 3\n assert candidate(1101, 101) == 2\n assert candidate(0, 101) == 1\n assert candidate(3, 11) == 8\n assert candidate(100, 101) == 1\n assert candidate(30, 5) == 4\n assert candidate(31, 5) == 3\n\ndef test_check():\n check(modp)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "py", - "prompt": "def valid_date(date: str) -> bool:\n \"\"\"You have to write a function which validates a given date string and\n returns True if the date is valid otherwise False.\n The date is valid if all of the following rules are satisfied:\n 1. The date string is not empty.\n 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n 3. The months should not be less than 1 or higher than 12.\n 4. The date should be in the format: mm-dd-yyyy\n\n \n \n \n \n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('03-11-2000') == True\n assert candidate('15-01-2012') == False\n assert candidate('04-0-2040') == False\n assert candidate('06-04-2020') == True\n assert candidate('01-01-2007') == True\n assert candidate('03-32-2011') == False\n assert candidate('') == False\n assert candidate('04-31-3000') == False\n assert candidate('06-06-2005') == True\n assert candidate('21-31-2000') == False\n assert candidate('04-12-2003') == True\n assert candidate('04122003') == False\n assert candidate('20030412') == False\n assert candidate('2003-04') == False\n assert candidate('2003-04-12') == False\n assert candidate('04-2003') == False\n\ndef test_check():\n check(valid_date)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "py", - "prompt": "def anti_shuffle(s: str) -> str:\n \"\"\"\n Write a function that takes a string and returns an ordered version of it.\n Ordered version of string, is a string where all words (separated by space)\n are replaced by a new word where all the characters arranged in\n ascending order based on ascii value.\n Note: You should keep the order of words and blank spaces in the sentence.\n\n For example:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('Hi') == 'Hi'\n assert candidate('hello') == 'ehllo'\n assert candidate('number') == 'bemnru'\n assert candidate('abcd') == 'abcd'\n assert candidate('Hello World!!!') == 'Hello !!!Wdlor'\n assert candidate('') == ''\n assert candidate('Hi. My name is Mister Robot. How are you?') == '.Hi My aemn is Meirst .Rboot How aer ?ouy'\n\ndef test_check():\n check(anti_shuffle)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "py", - "prompt": "from typing import List\n\ndef is_sorted(lst: List[int]) -> bool:\n \"\"\"\n Given a list of numbers, return whether or not they are sorted\n in ascending order. If list has more than 1 duplicate of the same\n number, return False. Assume no negative numbers and only integers.\n\n Examples\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([5]) == True\n assert candidate([1, 2, 3, 4, 5]) == True\n assert candidate([1, 3, 2, 4, 5]) == False\n assert candidate([1, 2, 3, 4, 5, 6]) == True\n assert candidate([1, 2, 3, 4, 5, 6, 7]) == True\n assert candidate([1, 3, 2, 4, 5, 6, 7]) == False\n assert candidate([]) == True\n assert candidate([1]) == True\n assert candidate([3, 2, 1]) == False\n assert candidate([1, 2, 2, 2, 3, 4]) == False\n assert candidate([1, 2, 3, 3, 3, 4]) == False\n assert candidate([1, 2, 2, 3, 3, 4]) == True\n assert candidate([1, 2, 3, 4]) == True\n\ndef test_check():\n check(is_sorted)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "py", - "prompt": "def is_happy(s: str) -> bool:\n \"\"\"You are given a string s.\n Your task is to check if the string is happy or not.\n A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n For example:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('a') == False\n assert candidate('aa') == False\n assert candidate('abcd') == True\n assert candidate('aabb') == False\n assert candidate('adb') == True\n assert candidate('xyy') == False\n assert candidate('iopaxpoi') == True\n assert candidate('iopaxioi') == False\n\ndef test_check():\n check(is_happy)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "py", - "prompt": "from typing import List\n\ndef will_it_fly(q: List[int], w: int) -> bool:\n \"\"\"\n Write a function that returns True if the object q will fly, and False otherwise.\n The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n\n Example:\n # 1+2 is less than the maximum possible weight, but it's unbalanced.\n\n # it's balanced, but 3+2+3 is more than the maximum possible weight.\n\n # 3+2+3 is less than the maximum possible weight, and it's balanced.\n\n # 3 is less than the maximum possible weight, and it's balanced.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([3, 2, 3], 9) == True\n assert candidate([1, 2], 5) == False\n assert candidate([3], 5) == True\n assert candidate([3, 2, 3], 1) == False\n assert candidate([1, 2, 3], 6) == False\n assert candidate([5], 5) == True\n\ndef test_check():\n check(will_it_fly)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "py", - "prompt": "from typing import List\n\ndef sort_array(array: List[int]) -> List[int]:\n \"\"\"\n Given an array of non-negative integers, return a copy of the given array after sorting,\n you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n or sort it in descending order if the sum( first index value, last index value) is even.\n\n Note:\n * don't change the given array.\n\n Examples:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == []\n assert candidate([5]) == [5]\n assert candidate([2, 4, 3, 0, 1, 5]) == [0, 1, 2, 3, 4, 5]\n assert candidate([2, 4, 3, 0, 1, 5, 6]) == [6, 5, 4, 3, 2, 1, 0]\n assert candidate([2, 1]) == [1, 2]\n assert candidate([15, 42, 87, 32, 11, 0]) == [0, 11, 15, 32, 42, 87]\n assert candidate([21, 14, 23, 11]) == [23, 21, 14, 11]\n\ndef test_check():\n check(sort_array)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "py", - "prompt": "from typing import List\n\ndef count_up_to(n: int) -> List[int]:\n \"\"\"Implement a function that takes an non-negative integer and returns an array of the first n\n integers that are prime numbers and less than n.\n for example:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(5) == [2, 3]\n assert candidate(6) == [2, 3, 5]\n assert candidate(7) == [2, 3, 5]\n assert candidate(10) == [2, 3, 5, 7]\n assert candidate(0) == []\n assert candidate(22) == [2, 3, 5, 7, 11, 13, 17, 19]\n assert candidate(1) == []\n assert candidate(18) == [2, 3, 5, 7, 11, 13, 17]\n assert candidate(47) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43]\n assert candidate(101) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]\n\ndef test_check():\n check(count_up_to)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "py", - "prompt": "from typing import List, Optional\n\ndef longest(strings: List[str]) -> Optional[str]:\n \"\"\" Out of list of strings, return the longest one. Return the first one in case of multiple\n strings of the same length. Return None in case the input list is empty.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == None\n assert candidate(['x', 'y', 'z']) == 'x'\n assert candidate(['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']) == 'zzzz'\n\ndef test_check():\n check(longest)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "py", - "prompt": "from typing import List\n\ndef by_length(arr: List[int]) -> List[str]:\n \"\"\"\n Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n reverse the resulting array, and then replace each digit by its corresponding name from\n \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n\n For example:\n \n If the array is empty, return an empty array:\n \n If the array has any strange number ignore it:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([2, 1, 1, 4, 5, 8, 2, 3]) == ['Eight', 'Five', 'Four', 'Three', 'Two', 'Two', 'One', 'One']\n assert candidate([]) == []\n assert candidate([1, -1, 55]) == ['One']\n assert candidate([1, -1, 3, 2]) == ['Three', 'Two', 'One']\n assert candidate([9, 4, 8]) == ['Nine', 'Eight', 'Four']\n\ndef test_check():\n check(by_length)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_106_f", - "language": "py", - "prompt": "from typing import List\n\ndef f(n: int) -> List[int]:\n \"\"\" Implement the function f that takes n as a parameter,\n 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\n or the sum of numbers from 1 to i otherwise.\n i starts from 1.\n the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n Example:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(5) == [1, 2, 6, 24, 15]\n assert candidate(7) == [1, 2, 6, 24, 15, 720, 28]\n assert candidate(1) == [1]\n assert candidate(3) == [1, 2, 6]\n\ndef test_check():\n check(f)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "py", - "prompt": "def fizz_buzz(n: int) -> int:\n \"\"\"Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(50) == 0\n assert candidate(78) == 2\n assert candidate(79) == 3\n assert candidate(100) == 3\n assert candidate(200) == 6\n assert candidate(4000) == 192\n assert candidate(10000) == 639\n assert candidate(100000) == 8026\n\ndef test_check():\n check(fizz_buzz)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "py", - "prompt": "def truncate_number(number: float) -> float:\n \"\"\" Given a positive floating point number, it can be decomposed into\n and integer part (largest integer smaller than given number) and decimals\n (leftover part always smaller than 1).\n\n Return the decimal part of the number.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(3.5) == 0.5\n assert candidate(1.25) == 0.25\n assert candidate(123.0) == 0.0\n\ndef test_check():\n check(truncate_number)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "py", - "prompt": "from typing import List, Tuple\n\ndef sum_product(numbers: List[int]) -> Tuple[int, int]:\n \"\"\" For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n Empty sum should be equal to 0 and empty product should be equal to 1.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == (0, 1)\n assert candidate([1, 1, 1]) == (3, 1)\n assert candidate([100, 0]) == (100, 0)\n assert candidate([3, 5, 7]) == (15, 105)\n assert candidate([10]) == (10, 10)\n\ndef test_check():\n check(sum_product)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "py", - "prompt": "from typing import List, Tuple\n\ndef get_row(lst: List[List[int]], x: int) -> List[Tuple[int, int]]:\n \"\"\"\n You are given a 2 dimensional data, as a nested lists,\n which is similar to matrix, however, unlike matrices,\n each row may contain a different number of columns.\n Given lst, and integer x, find integers x in the list,\n and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n each tuple is a coordinate - (row, columns), starting with 0.\n Sort coordinates initially by rows in ascending order.\n Also, sort coordinates of the row by columns in descending order.\n \n Examples:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n assert candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6]], 2) == [(0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1)]\n assert candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 1, 3, 4, 5, 6], [1, 2, 1, 4, 5, 6], [1, 2, 3, 1, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1) == [(0, 0), (1, 0), (2, 1), (2, 0), (3, 2), (3, 0), (4, 3), (4, 0), (5, 4), (5, 0), (6, 5), (6, 0)]\n assert candidate([], 1) == []\n assert candidate([[1]], 2) == []\n assert candidate([[], [1], [1, 2, 3]], 3) == [(2, 2)]\n\ndef test_check():\n check(get_row)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "py", - "prompt": "from typing import List\n\ndef eat(number: int, need: int, remaining: int) -> List[int]:\n \"\"\"\n You're a hungry rabbit, and you already have eaten a certain number of carrots,\n but now you need to eat more carrots to complete the day's meals.\n you should return an array of [ total number of eaten carrots after your meals,\n the number of carrots left after your meals ]\n if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n \n Example:\n \n Variables:\n @number : integer\n the number of carrots that you have eaten.\n @need : integer\n the number of carrots that you need to eat.\n @remaining : integer\n the number of remaining carrots thet exist in stock\n \n Constrain:\n * 0 <= number <= 1000\n * 0 <= need <= 1000\n * 0 <= remaining <= 1000\n\n Have fun :)\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(5, 6, 10) == [11, 4]\n assert candidate(4, 8, 9) == [12, 1]\n assert candidate(1, 10, 10) == [11, 0]\n assert candidate(2, 11, 5) == [7, 0]\n assert candidate(4, 5, 7) == [9, 2]\n assert candidate(4, 5, 1) == [5, 0]\n\ndef test_check():\n check(eat)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "py", - "prompt": "def solve(N: int) -> str:\n \"\"\"Given a positive integer N, return the total sum of its digits in binary.\n \n Example\n \n Variables:\n @N integer\n Constraints: 0 \u2264 N \u2264 10000.\n Output:\n a string of binary number\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(1000) == '1'\n assert candidate(150) == '110'\n assert candidate(147) == '1100'\n assert candidate(333) == '1001'\n assert candidate(963) == '10010'\n\ndef test_check():\n check(solve)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "py", - "prompt": "from typing import List\n\ndef skjkasdkd(lst: List[int]) -> int:\n \"\"\"You are given a list of integers.\n You need to find the largest prime value and return the sum of its digits.\n\n Examples:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]) == 10\n assert candidate([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]) == 25\n assert candidate([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]) == 13\n assert candidate([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]) == 11\n assert candidate([0, 81, 12, 3, 1, 21]) == 3\n assert candidate([0, 8, 1, 2, 1, 7]) == 7\n assert candidate([8191]) == 19\n assert candidate([8191, 123456, 127, 7]) == 19\n assert candidate([127, 97, 8192]) == 10\n\ndef test_check():\n check(skjkasdkd)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "py", - "prompt": "from typing import List\n\ndef smallest_change(arr: List[int]) -> int:\n \"\"\"\n Given an array arr of integers, find the minimum number of elements that\n need to be changed to make the array palindromic. A palindromic array is an array that\n is read the same backwards and forwards. In one change, you can change one element to any other element.\n\n For example:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 3, 5, 4, 7, 9, 6]) == 4\n assert candidate([1, 2, 3, 4, 3, 2, 2]) == 1\n assert candidate([1, 4, 2]) == 1\n assert candidate([1, 4, 4, 2]) == 1\n assert candidate([1, 2, 3, 2, 1]) == 0\n assert candidate([3, 1, 1, 3]) == 0\n assert candidate([1]) == 0\n assert candidate([0, 1]) == 1\n\ndef test_check():\n check(smallest_change)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "py", - "prompt": "from typing import List\n\ndef numerical_letter_grade(grades: List[float]) -> List[str]:\n \"\"\"It is the last week of the semester and the teacher has to give the grades\n to students. The teacher has been making her own algorithm for grading.\n The only problem is, she has lost the code she used for grading.\n She has given you a list of GPAs for some students and you have to write \n a function that can output a list of letter grades using the following table:\n GPA | Letter grade\n 4.0 A+\n > 3.7 A \n > 3.3 A- \n > 3.0 B+\n > 2.7 B \n > 2.3 B-\n > 2.0 C+\n > 1.7 C\n > 1.3 C-\n > 1.0 D+ \n > 0.7 D \n > 0.0 D-\n 0.0 E\n \n\n Example:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([4.0, 3, 1.7, 2, 3.5]) == ['A+', 'B', 'C-', 'C', 'A-']\n assert candidate([1.2]) == ['D+']\n assert candidate([0.5]) == ['D-']\n assert candidate([0.0]) == ['E']\n assert candidate([1.0, 0.3, 1.5, 2.8, 3.3]) == ['D', 'D-', 'C-', 'B', 'B+']\n assert candidate([0.0, 0.7]) == ['E', 'D-']\n\ndef test_check():\n check(numerical_letter_grade)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "py", - "prompt": "def triangle_area(a: int, b: int, c: int) -> float:\n \"\"\"\n Given the lengths of the three sides of a triangle. Return the area of\n the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n Otherwise return -1\n Three sides make a valid triangle when the sum of any two sides is greater \n than the third side.\n Example:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(3, 4, 5) == 6.0\n assert candidate(1, 2, 10) == -1\n assert candidate(4, 8, 5) == 8.18\n assert candidate(2, 2, 2) == 1.73\n assert candidate(1, 2, 3) == -1\n assert candidate(10, 5, 7) == 16.25\n assert candidate(2, 6, 3) == -1\n assert candidate(1, 1, 1) == 0.43\n assert candidate(2, 2, 10) == -1\n\ndef test_check():\n check(triangle_area)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "py", - "prompt": "def same_chars(s0: str, s1: str) -> bool:\n \"\"\"\n Check if two words have the same characters.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('eabcdzzzz', 'dddzzzzzzzddeddabc') == True\n assert candidate('abcd', 'dddddddabc') == True\n assert candidate('dddddddabc', 'abcd') == True\n assert candidate('eabcd', 'dddddddabc') == False\n assert candidate('abcd', 'dddddddabcf') == False\n assert candidate('eabcdzzzz', 'dddzzzzzzzddddabc') == False\n assert candidate('aabb', 'aaccc') == False\n\ndef test_check():\n check(same_chars)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "py", - "prompt": "from typing import List\n\ndef minSubArraySum(nums: List[int]) -> int:\n \"\"\"\n Given an array of integers nums, find the minimum sum of any non-empty sub-array\n of nums.\n Example\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([2, 3, 4, 1, 2, 4]) == 1\n assert candidate([-1, -2, -3]) == -6\n assert candidate([-1, -2, -3, 2, -10]) == -14\n assert candidate([-9999999999999999]) == -9999999999999999\n assert candidate([0, 10, 20, 1000000]) == 0\n assert candidate([-1, -2, -3, 10, -5]) == -6\n assert candidate([100, -1, -2, -3, 10, -5]) == -6\n assert candidate([10, 11, 13, 8, 3, 4]) == 3\n assert candidate([100, -33, 32, -1, 0, -2]) == -33\n assert candidate([-10]) == -10\n assert candidate([7]) == 7\n assert candidate([1, -1]) == -1\n\ndef test_check():\n check(minSubArraySum)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "py", - "prompt": "from typing import List\n\ndef select_words(s: str, n: int) -> List[str]:\n \"\"\"Given a string s and a natural number n, you have been tasked to implement \n a function that returns a list of all words from string s that contain exactly \n n consonants, in order these words appear in the string s.\n If the string s is empty then the function should return an empty list.\n Note: you may assume the input string contains only letters and spaces.\n Examples:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('Mary had a little lamb', 4) == ['little']\n assert candidate('Mary had a little lamb', 3) == ['Mary', 'lamb']\n assert candidate('simple white space', 2) == []\n assert candidate('Hello world', 4) == ['world']\n assert candidate('Uncle sam', 3) == ['Uncle']\n assert candidate('', 4) == []\n assert candidate('a b c d e f', 1) == ['b', 'c', 'd', 'f']\n\ndef test_check():\n check(select_words)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "py", - "prompt": "from typing import List\n\ndef all_prefixes(string: str) -> List[str]:\n \"\"\" Return list of all prefixes from shortest to longest of the input string\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('') == []\n assert candidate('asdfgh') == ['a', 'as', 'asd', 'asdf', 'asdfg', 'asdfgh']\n assert candidate('WWW') == ['W', 'WW', 'WWW']\n\ndef test_check():\n check(all_prefixes)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "py", - "prompt": "def closest_integer(value: str) -> int:\n \"\"\"\n Create a function that takes a value (string) representing a number\n and returns the closest integer to it. If the number is equidistant\n from two integers, round it away from zero.\n\n Examples\n \n Note:\n Rounding away from zero means that if the given number is equidistant\n from two integers, the one you should return is the one that is the\n farthest from zero. For example closest_integer(\"14.5\") should\n return 15 and closest_integer(\"-14.5\") should return -15.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('10') == 10\n assert candidate('14.5') == 15\n assert candidate('-15.5') == -16\n assert candidate('15.3') == 15\n assert candidate('0') == 0\n\ndef test_check():\n check(closest_integer)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "py", - "prompt": "def file_name_check(file_name: str) -> str:\n \"\"\"Create a function which takes a string representing a file's name, and returns\n 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n A file's name is considered to be valid if and only if all the following conditions \n are met:\n - There should not be more than three digits ('0'-'9') in the file's name.\n - The file's name contains exactly one dot '.'\n - The substring before the dot should not be empty, and it starts with a letter from \n the latin alphapet ('a'-'z' and 'A'-'Z').\n - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n Examples:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('example.txt') == 'Yes'\n assert candidate('1example.dll') == 'No'\n assert candidate('s1sdf3.asd') == 'No'\n assert candidate('K.dll') == 'Yes'\n assert candidate('MY16FILE3.exe') == 'Yes'\n assert candidate('His12FILE94.exe') == 'No'\n assert candidate('_Y.txt') == 'No'\n assert candidate('?aREYA.exe') == 'No'\n assert candidate('/this_is_valid.dll') == 'No'\n assert candidate('this_is_valid.wow') == 'No'\n assert candidate('this_is_valid.txt') == 'Yes'\n assert candidate('this_is_valid.txtexe') == 'No'\n assert candidate('#this2_i4s_5valid.ten') == 'No'\n assert candidate('@this1_is6_valid.exe') == 'No'\n assert candidate('this_is_12valid.6exe4.txt') == 'No'\n assert candidate('all.exe.txt') == 'No'\n assert candidate('I563_No.exe') == 'Yes'\n assert candidate('Is3youfault.txt') == 'Yes'\n assert candidate('no_one#knows.dll') == 'Yes'\n assert candidate('1I563_Yes3.exe') == 'No'\n assert candidate('I563_Yes3.txtt') == 'No'\n assert candidate('final..txt') == 'No'\n assert candidate('final132') == 'No'\n assert candidate('_f4indsartal132.') == 'No'\n assert candidate('.txt') == 'No'\n assert candidate('s.') == 'No'\n\ndef test_check():\n check(file_name_check)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "py", - "prompt": "from typing import Tuple\n\ndef intersection(interval1: Tuple[int, int], interval2: Tuple[int, int]) -> str:\n \"\"\"You are given two intervals,\n where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n The given intervals are closed which means that the interval (start, end)\n includes both start and end.\n For each given interval, it is assumed that its start is less or equal its end.\n Your task is to determine whether the length of intersection of these two \n intervals is a prime number.\n Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n which its length is 1, which not a prime number.\n If the length of the intersection is a prime number, return \"YES\",\n otherwise, return \"NO\".\n If the two intervals don't intersect, return \"NO\".\n\n\n [input/output] samples:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate((1, 2), (2, 3)) == 'NO'\n assert candidate((-1, 1), (0, 4)) == 'NO'\n assert candidate((-3, -1), (-5, 5)) == 'YES'\n assert candidate((-2, 2), (-4, 0)) == 'YES'\n assert candidate((-11, 2), (-1, -1)) == 'NO'\n assert candidate((1, 2), (3, 5)) == 'NO'\n assert candidate((1, 2), (1, 2)) == 'NO'\n assert candidate((-2, -2), (-3, -2)) == 'NO'\n\ndef test_check():\n check(intersection)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "py", - "prompt": "def largest_prime_factor(n: int) -> int:\n \"\"\"Return the largest prime factor of n. Assume n > 1 and is not a prime.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(15) == 5\n assert candidate(27) == 3\n assert candidate(63) == 7\n assert candidate(330) == 11\n assert candidate(13195) == 29\n\ndef test_check():\n check(largest_prime_factor)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "py", - "prompt": "def count_distinct_characters(string: str) -> int:\n \"\"\" Given a string, find out how many distinct characters (regardless of case) does it consist of\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('') == 0\n assert candidate('abcde') == 5\n assert candidate('abcdecadeCADE') == 5\n assert candidate('aaaaAAAAaaaa') == 1\n assert candidate('Jerry jERRY JeRRRY') == 5\n\ndef test_check():\n check(count_distinct_characters)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "py", - "prompt": "from typing import List\n\ndef below_zero(operations: List[int]) -> bool:\n \"\"\" You're given a list of deposit and withdrawal operations on a bank account that starts with\n zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n at that point function should return True. Otherwise it should return False.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == False\n assert candidate([1, 2, -3, 1, 2, -3]) == False\n assert candidate([1, 2, -4, 5, 6]) == True\n assert candidate([1, -1, 2, -2, 5, -5, 4, -4]) == False\n assert candidate([1, -1, 2, -2, 5, -5, 4, -5]) == True\n assert candidate([1, -2, 2, -2, 5, -5, 4, -4]) == True\n\ndef test_check():\n check(below_zero)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "py", - "prompt": "def make_palindrome(string: str) -> str:\n \"\"\" Find the shortest palindrome that begins with a supplied string.\n Algorithm idea is simple:\n - Find the longest postfix of supplied string that is a palindrome.\n - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('') == ''\n assert candidate('x') == 'x'\n assert candidate('xyz') == 'xyzyx'\n assert candidate('xyx') == 'xyx'\n assert candidate('jerry') == 'jerryrrej'\n\ndef test_check():\n check(make_palindrome)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "py", - "prompt": "def int_to_mini_roman(number: int) -> str:\n \"\"\"\n Given a positive integer, obtain its roman numeral equivalent as a string,\n and return it in lowercase.\n Restrictions: 1 <= num <= 1000\n\n Examples:\n \"\"\"\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(19) == 'xix'\n assert candidate(152) == 'clii'\n assert candidate(251) == 'ccli'\n assert candidate(426) == 'cdxxvi'\n assert candidate(500) == 'd'\n assert candidate(1) == 'i'\n assert candidate(4) == 'iv'\n assert candidate(43) == 'xliii'\n assert candidate(90) == 'xc'\n assert candidate(94) == 'xciv'\n assert candidate(532) == 'dxxxii'\n assert candidate(900) == 'cm'\n assert candidate(994) == 'cmxciv'\n assert candidate(1000) == 'm'\n\ndef test_check():\n check(int_to_mini_roman)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - } -] \ No newline at end of file diff --git a/data/py-reworded.json b/data/py-reworded.json deleted file mode 100644 index 243b7447c8d9223e1d1cb0fae8edba2daa47dcca..0000000000000000000000000000000000000000 --- a/data/py-reworded.json +++ /dev/null @@ -1,2417 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "py", - "prompt": "def largest_divisor(n: int) -> int:\n \"\"\" For a given number n, find the largest number that divides n evenly, smaller than n\n >>> largest_divisor(15)\n 5\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(3) == 1\n assert candidate(7) == 1\n assert candidate(10) == 5\n assert candidate(100) == 50\n assert candidate(49) == 7\n\ndef test_check():\n check(largest_divisor)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_47_median", - "language": "py", - "prompt": "from typing import List\n\ndef median(l: List[int]) -> float:\n \"\"\"Return median of elements in the list l.\n >>> median([3, 1, 2, 4, 5])\n 3\n >>> median([-10, 4, 6, 1000, 10, 20])\n 15.0\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([3, 1, 2, 4, 5]) == 3\n assert candidate([-10, 4, 6, 1000, 10, 20]) == 8.0\n assert candidate([5]) == 5\n assert candidate([6, 5]) == 5.5\n assert candidate([8, 1, 3, 9, 9, 2, 7]) == 7\n\ndef test_check():\n check(median)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "py", - "prompt": "from typing import List\n\ndef do_algebra(operator: List[str], operand: List[int]) -> int:\n \"\"\"\n Given two lists operator, and operand. The first list has basic algebra operations, and \n the second list is a list of integers. Use the two given lists to build the algebric \n expression and return the evaluation of this expression.\n\n The basic algebra operations:\n Addition ( + ) \n Subtraction ( - ) \n Multiplication ( * ) \n Floor division ( // ) \n Exponentiation ( ** ) \n\n Example:\n operator['+', '*', '-']\n array = [2, 3, 4, 5]\n result = 2 + 3 * 4 - 5\n => result = 9\n\n Note:\n The length of operator list is equal to the length of operand list minus one.\n Operand is a list of of non-negative integers.\n Operator list has at least one operator, and operand list has at least two operands.\n\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(['**', '*', '+'], [2, 3, 4, 5]) == 37\n assert candidate(['+', '*', '-'], [2, 3, 4, 5]) == 9\n assert candidate(['//', '*'], [7, 3, 4]) == 8\n\ndef test_check():\n check(do_algebra)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "py", - "prompt": "from typing import List\n\ndef max_element(l: List[int]) -> int:\n \"\"\"Return maximum element in the list.\n >>> max_element([1, 2, 3])\n 3\n >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n 123\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([1, 2, 3]) == 3\n assert candidate([5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]) == 124\n\ndef test_check():\n check(max_element)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "py", - "prompt": "from typing import List\n\ndef can_arrange(arr: List[int]) -> int:\n \"\"\"Create a function which returns the largest index of an element which\n is not greater than or equal to the element immediately preceding it. If\n no such element exists then return -1. The given array will not contain\n duplicate values.\n\n Examples:\n >>> can_arrange([1, 2, 4, 3, 5])\n 3\n >>> can_arrange([1, 2, 3])\n -1\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([1, 2, 4, 3, 5]) == 3\n assert candidate([1, 2, 4, 5]) == -1\n assert candidate([1, 4, 2, 5, 6, 7, 8, 9, 10]) == 2\n assert candidate([4, 8, 5, 7, 3]) == 4\n assert candidate([]) == -1\n\ndef test_check():\n check(can_arrange)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "py", - "prompt": "def car_race_collision(n: int) -> int:\n \"\"\"\n Imagine a road that's a perfectly straight infinitely long line.\n n cars are driving left to right; simultaneously, a different set of n cars\n are driving right to left. The two sets of cars start out being very far from\n each other. All cars move in the same speed. Two cars are said to collide\n when a car that's moving left to right hits a car that's moving right to left.\n However, the cars are infinitely sturdy and strong; as a result, they continue moving\n in their trajectory as if they did not collide.\n\n This function outputs the number of such collisions.\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(2) == 4\n assert candidate(3) == 9\n assert candidate(4) == 16\n assert candidate(8) == 64\n assert candidate(10) == 100\n\ndef test_check():\n check(car_race_collision)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "py", - "prompt": "def check_if_last_char_is_a_letter(txt: str) -> bool:\n \"\"\"\n Create a function that returns True if the last character\n of a given string is an alphabetical character and is not\n a part of a word, and False otherwise.\n Note: \"word\" is a group of characters separated by space.\n\n Examples:\n >>> check_if_last_char_is_a_letter('apple pie')\n False\n >>> check_if_last_char_is_a_letter('apple pi e')\n True\n >>> check_if_last_char_is_a_letter('apple pi e ')\n False\n >>> check_if_last_char_is_a_letter('')\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('apple') == False\n assert candidate('apple pi e') == True\n assert candidate('eeeee') == False\n assert candidate('A') == True\n assert candidate('Pumpkin pie ') == False\n assert candidate('Pumpkin pie 1') == False\n assert candidate('') == False\n assert candidate('eeeee e ') == False\n assert candidate('apple pie') == False\n assert candidate('apple pi e ') == False\n\ndef test_check():\n check(check_if_last_char_is_a_letter)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "py", - "prompt": "def is_prime(n: int) -> bool:\n \"\"\"Return true if a given number is prime, and false otherwise.\n >>> is_prime(6)\n False\n >>> is_prime(101)\n True\n >>> is_prime(11)\n True\n >>> is_prime(13441)\n True\n >>> is_prime(61)\n True\n >>> is_prime(4)\n False\n >>> is_prime(1)\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(6) == False\n assert candidate(101) == True\n assert candidate(11) == True\n assert candidate(13441) == True\n assert candidate(61) == True\n assert candidate(4) == False\n assert candidate(1) == False\n assert candidate(5) == True\n assert candidate(11) == True\n assert candidate(17) == True\n assert candidate(85) == False\n assert candidate(77) == False\n assert candidate(255379) == False\n\ndef test_check():\n check(is_prime)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "py", - "prompt": "from typing import List\n\ndef unique_digits(x: List[int]) -> List[int]:\n \"\"\"Given a list of positive integers x. return a sorted list of all \n elements that hasn't any even digit.\n\n Note: Returned list should be sorted in increasing order.\n \n For example:\n >>> unique_digits([15, 33, 1422, 1])\n [1, 15, 33]\n >>> unique_digits([152, 323, 1422, 10])\n []\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([15, 33, 1422, 1]) == [1, 15, 33]\n assert candidate([152, 323, 1422, 10]) == []\n assert candidate([12345, 2033, 111, 151]) == [111, 151]\n assert candidate([135, 103, 31]) == [31, 135]\n\ndef test_check():\n check(unique_digits)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "py", - "prompt": "def string_xor(a: str, b: str) -> str:\n \"\"\" Input are two strings a and b consisting only of 1s and 0s.\n Perform binary XOR on these inputs and return result also as a string.\n >>> string_xor('010', '110')\n '100'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('111000', '101010') == '010010'\n assert candidate('1', '1') == '0'\n assert candidate('0101', '0000') == '0101'\n\ndef test_check():\n check(string_xor)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "py", - "prompt": "def sum_to_n(n: int) -> int:\n \"\"\"sum_to_n is a function that sums numbers from 1 to n.\n >>> sum_to_n(30)\n 465\n >>> sum_to_n(100)\n 5050\n >>> sum_to_n(5)\n 15\n >>> sum_to_n(10)\n 55\n >>> sum_to_n(1)\n 1\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(1) == 1\n assert candidate(6) == 21\n assert candidate(11) == 66\n assert candidate(30) == 465\n assert candidate(100) == 5050\n\ndef test_check():\n check(sum_to_n)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "py", - "prompt": "from typing import List\n\ndef double_the_difference(lst: List[float]) -> int:\n \"\"\"\n Given a list of numbers, return the sum of squares of the numbers\n in the list that are odd. Ignore numbers that are negative or not integers.\n \n >>> double_the_difference([1, 3, 2, 0])\n 10\n >>> double_the_difference([-1, -2, 0])\n 0\n >>> double_the_difference([9, -2])\n 81\n >>> double_the_difference([0])\n 0\n \n If the input list is empty, return 0.\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([]) == 0\n assert candidate([5.0, 4.0]) == 25\n assert candidate([0.1, 0.2, 0.3]) == 0\n assert candidate([-10.0, -20.0, -30.0]) == 0\n assert candidate([-1.0, -2.0, 8.0]) == 0\n assert candidate([0.2, 3.0, 5.0]) == 34\n assert candidate([-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]) == 165\n\ndef test_check():\n check(double_the_difference)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "py", - "prompt": "def strlen(string: str) -> int:\n \"\"\" Return length of given string\n >>> strlen('')\n 0\n >>> strlen('abc')\n 3\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('') == 0\n assert candidate('x') == 1\n assert candidate('asdasnakj') == 9\n\ndef test_check():\n check(strlen)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "py", - "prompt": "def is_bored(S: str) -> int:\n \"\"\"\n You'll be given a string of words, and your task is to count the number\n of boredoms. A boredom is a sentence that starts with the word \"I\".\n Sentences are delimited by '.', '?' or '!'.\n \n For example:\n >>> is_bored('Hello world')\n 0\n >>> is_bored('The sky is blue. The sun is shining. I love this weather')\n 1\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('Hello world') == 0\n assert candidate('Is the sky blue?') == 0\n assert candidate('I love It !') == 1\n assert candidate('bIt') == 0\n assert candidate('I feel good today. I will be productive. will kill It') == 2\n assert candidate('You and I are going for a walk') == 0\n\ndef test_check():\n check(is_bored)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "py", - "prompt": "def vowels_count(s: str) -> int:\n \"\"\"Write a function vowels_count which takes a string representing\n a word as input and returns the number of vowels in the string.\n Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n vowel, but only when it is at the end of the given word.\n\n Example:\n >>> vowels_count('abcde')\n 2\n >>> vowels_count('ACEDY')\n 3\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('abcde') == 2\n assert candidate('Alone') == 3\n assert candidate('key') == 2\n assert candidate('bye') == 1\n assert candidate('keY') == 2\n assert candidate('bYe') == 1\n assert candidate('ACEDY') == 3\n\ndef test_check():\n check(vowels_count)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "py", - "prompt": "def fib(n: int) -> int:\n \"\"\"Return n-th Fibonacci number.\n >>> fib(10)\n 55\n >>> fib(1)\n 1\n >>> fib(8)\n 21\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(10) == 55\n assert candidate(1) == 1\n assert candidate(8) == 21\n assert candidate(11) == 89\n assert candidate(12) == 144\n\ndef test_check():\n check(fib)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "py", - "prompt": "def simplify(x: str, n: str) -> bool:\n \"\"\"Your task is to implement a function that will simplify the expression\n x * n. The function returns True if x * n evaluates to a whole number and False\n otherwise. Both x and n, are string representation of a fraction, and have the following format,\n / where both numerator and denominator are positive whole numbers.\n\n You can assume that x, and n are valid fractions, and do not have zero as denominator.\n\n >>> simplify('1/5', '5/1')\n True\n >>> simplify('1/6', '2/1')\n False\n >>> simplify('7/10', '10/2')\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('1/5', '5/1') == True\n assert candidate('1/6', '2/1') == False\n assert candidate('5/1', '3/1') == True\n assert candidate('7/10', '10/2') == False\n assert candidate('2/10', '50/10') == True\n assert candidate('7/2', '4/2') == True\n assert candidate('11/6', '6/1') == True\n assert candidate('2/3', '5/2') == False\n assert candidate('5/2', '3/5') == False\n assert candidate('2/4', '8/4') == True\n assert candidate('2/4', '4/2') == True\n assert candidate('1/5', '5/1') == True\n assert candidate('1/5', '1/5') == False\n\ndef test_check():\n check(simplify)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "py", - "prompt": "def count_upper(s: str) -> int:\n \"\"\"\n Given a string s, count the number of uppercase vowels in even indices.\n \n For example:\n >>> count_upper('aBCdEf')\n 1\n >>> count_upper('abcdefg')\n 0\n >>> count_upper('dBBE')\n 0\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('aBCdEf') == 1\n assert candidate('abcdefg') == 0\n assert candidate('dBBE') == 0\n assert candidate('B') == 0\n assert candidate('U') == 1\n assert candidate('') == 0\n assert candidate('EEEE') == 2\n\ndef test_check():\n check(count_upper)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "py", - "prompt": "from typing import List\n\ndef max_fill(grid: List[List[int]], capacity: int) -> int:\n \"\"\"\n You are given a rectangular grid of wells. Each row represents a single well,\n and each 1 in a row represents a single unit of water.\n Each well has a corresponding bucket that can be used to extract water from it, \n and all buckets have the same capacity.\n Your task is to use the buckets to empty the wells.\n Output the number of times you need to lower the buckets.\n\n Example 1:\n >>> max_fill([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1)\n 6\n\n Example 2:\n >>> max_fill([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2)\n 5\n \n Example 3:\n >>> max_fill([[0, 0, 0], [0, 0, 0]], 5)\n 0\n\n Constraints:\n * all wells have the same length\n * 1 <= grid.length <= 10^2\n * 1 <= grid[:,1].length <= 10^2\n * grid[i][j] -> 0 | 1\n * 1 <= capacity <= 10\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1) == 6\n assert candidate([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2) == 5\n assert candidate([[0, 0, 0], [0, 0, 0]], 5) == 0\n assert candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 2) == 4\n assert candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 9) == 2\n\ndef test_check():\n check(max_fill)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "py", - "prompt": "from typing import List\n\ndef maximum(arr: List[int], k: int) -> List[int]:\n \"\"\"\n Given an array arr of integers and a positive integer k, return a sorted list \n of length k with the maximum k numbers in arr.\n\n Example 1:\n\n >>> maximum([-3, -4, 5], 3)\n [-4, -3, 5]\n\n Example 2:\n\n >>> maximum([4, -4, 4], 2)\n [4, 4]\n\n Example 3:\n\n >>> maximum([-3, 2, 1, 2, -1, -2, 1], 1)\n [2]\n\n Note:\n 1. The length of the array will be in the range of [1, 1000].\n 2. The elements in the array will be in the range of [-1000, 1000].\n 3. 0 <= k <= len(arr)\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([-3, -4, 5], 3) == [-4, -3, 5]\n assert candidate([4, -4, 4], 2) == [4, 4]\n assert candidate([-3, 2, 1, 2, -1, -2, 1], 1) == [2]\n assert candidate([123, -123, 20, 0, 1, 2, -3], 3) == [2, 20, 123]\n assert candidate([-123, 20, 0, 1, 2, -3], 4) == [0, 1, 2, 20]\n assert candidate([5, 15, 0, 3, -13, -8, 0], 7) == [-13, -8, 0, 0, 3, 5, 15]\n assert candidate([-1, 0, 2, 5, 3, -10], 2) == [3, 5]\n assert candidate([1, 0, 5, -7], 1) == [5]\n assert candidate([4, -4], 2) == [-4, 4]\n assert candidate([-10, 10], 2) == [-10, 10]\n assert candidate([1, 2, 3, -23, 243, -400, 0], 0) == []\n\ndef test_check():\n check(maximum)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "py", - "prompt": "def encode(message: str) -> str:\n \"\"\"\n Write a function that takes a message, and encodes in such a \n way that it swaps case of all letters, replaces all vowels in \n the message with the letter that appears 2 places ahead of that \n vowel in the english alphabet. \n Assume only letters. \n \n Examples:\n >>> encode('test')\n 'TGST'\n >>> encode('This is a message')\n 'tHKS KS C MGSSCGG'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('TEST') == 'tgst'\n assert candidate('Mudasir') == 'mWDCSKR'\n assert candidate('YES') == 'ygs'\n assert candidate('This is a message') == 'tHKS KS C MGSSCGG'\n assert candidate('I DoNt KnOw WhAt tO WrItE') == 'k dQnT kNqW wHcT Tq wRkTg'\n\ndef test_check():\n check(encode)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "py", - "prompt": "def remove_vowels(text: str) -> str:\n \"\"\"\n remove_vowels is a function that takes string and returns string without vowels.\n >>> remove_vowels('')\n ''\n >>> remove_vowels('abcdef')\n 'bcdf'\n >>> remove_vowels('aaaaa')\n ''\n >>> remove_vowels('aaBAA')\n 'B'\n >>> remove_vowels('zbcd')\n 'zbcd'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('') == ''\n assert candidate('abcdef\\nghijklm') == 'bcdf\\nghjklm'\n assert candidate('fedcba') == 'fdcb'\n assert candidate('eeeee') == ''\n assert candidate('acBAA') == 'cB'\n assert candidate('EcBOO') == 'cB'\n assert candidate('ybcd') == 'ybcd'\n\ndef test_check():\n check(remove_vowels)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "py", - "prompt": "from typing import List\n\ndef get_positive(l: List[int]) -> List[int]:\n \"\"\"Return only positive numbers in the list.\n >>> get_positive([-1, 2, -4, 5, 6])\n [2, 5, 6]\n >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n [5, 3, 2, 3, 9, 123, 1]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([-1, -2, 4, 5, 6]) == [4, 5, 6]\n assert candidate([5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]) == [5, 3, 2, 3, 3, 9, 123, 1]\n assert candidate([-1, -2]) == []\n assert candidate([]) == []\n\ndef test_check():\n check(get_positive)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "py", - "prompt": "def string_sequence(n: int) -> str:\n \"\"\" Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n >>> string_sequence(0)\n '0'\n >>> string_sequence(5)\n '0 1 2 3 4 5'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(0) == '0'\n assert candidate(3) == '0 1 2 3'\n assert candidate(10) == '0 1 2 3 4 5 6 7 8 9 10'\n\ndef test_check():\n check(string_sequence)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "py", - "prompt": "from typing import List\n\ndef make_a_pile(n: int) -> List[int]:\n \"\"\"\n Given a positive integer n, you have to make a pile of n levels of stones.\n The first level has n stones.\n The number of stones in the next level is:\n - the next odd number if n is odd.\n - the next even number if n is even.\n Return the number of stones in each level in a list, where element at index\n i represents the number of stones in the level (i+1).\n\n Examples:\n >>> make_a_pile(3)\n [3, 5, 7]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(3) == [3, 5, 7]\n assert candidate(4) == [4, 6, 8, 10]\n assert candidate(5) == [5, 7, 9, 11, 13]\n assert candidate(6) == [6, 8, 10, 12, 14, 16]\n assert candidate(8) == [8, 10, 12, 14, 16, 18, 20, 22]\n\ndef test_check():\n check(make_a_pile)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "py", - "prompt": "from typing import Tuple\n\ndef reverse_delete(s: str, c: str) -> Tuple[str, bool]:\n \"\"\"Task\n 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\n then check if the result string is palindrome.\n A string is called palindrome if it reads the same backward as forward.\n You should return a tuple containing the result string and True/False for the check.\n Example\n >>> reverse_delete('abcde', 'ae')\n ('bcd', False)\n >>> reverse_delete('abcdef', 'b')\n ('acdef', False)\n >>> reverse_delete('abcdedcba', 'ab')\n ('cdedc', True)\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('abcde', 'ae') == ('bcd', False)\n assert candidate('abcdef', 'b') == ('acdef', False)\n assert candidate('abcdedcba', 'ab') == ('cdedc', True)\n assert candidate('dwik', 'w') == ('dik', False)\n assert candidate('a', 'a') == ('', True)\n assert candidate('abcdedcba', '') == ('abcdedcba', True)\n assert candidate('abcdedcba', 'v') == ('abcdedcba', True)\n assert candidate('vabba', 'v') == ('abba', True)\n assert candidate('mamma', 'mia') == ('', True)\n\ndef test_check():\n check(reverse_delete)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "py", - "prompt": "def flip_case(string: str) -> str:\n \"\"\" For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n >>> flip_case('Hello')\n 'hELLO'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('') == ''\n assert candidate('Hello!') == 'hELLO!'\n assert candidate('These violent delights have violent ends') == 'tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS'\n\ndef test_check():\n check(flip_case)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "py", - "prompt": "def solve(s: str) -> str:\n \"\"\"You are given a string s.\n if s[i] is a letter, reverse its case from lower to upper or vise versa, \n otherwise keep it as it is.\n If the string contains no letters, reverse the string.\n The function should return the resulted string.\n Examples\n >>> solve('1234')\n '4321'\n >>> solve('ab')\n 'AB'\n >>> solve('#a@C')\n '#A@c'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('AsDf') == 'aSdF'\n assert candidate('1234') == '4321'\n assert candidate('ab') == 'AB'\n assert candidate('#a@C') == '#A@c'\n assert candidate('#AsdfW^45') == '#aSDFw^45'\n assert candidate('#6@2') == '2@6#'\n assert candidate('#$a^D') == '#$A^d'\n assert candidate('#ccc') == '#CCC'\n\ndef test_check():\n check(solve)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "py", - "prompt": "from typing import List\n\ndef filter_by_prefix(strings: List[str], prefix: str) -> List[str]:\n \"\"\" Filter an input list of strings only for ones that start with a given prefix.\n >>> filter_by_prefix([], 'a')\n []\n >>> filter_by_prefix(['abc', 'bcd', 'cde', 'array'], 'a')\n ['abc', 'array']\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([], 'john') == []\n assert candidate(['xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'], 'xxx') == ['xxx', 'xxxAAA', 'xxx']\n\ndef test_check():\n check(filter_by_prefix)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "py", - "prompt": "def choose_num(x: int, y: int) -> int:\n \"\"\"This function takes two positive numbers x and y and returns the\n biggest even integer number that is in the range [x, y] inclusive. If \n there's no such number, then the function should return -1.\n\n For example:\n >>> choose_num(12, 15)\n 14\n >>> choose_num(13, 12)\n -1\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(12, 15) == 14\n assert candidate(13, 12) == -1\n assert candidate(33, 12354) == 12354\n assert candidate(5234, 5233) == -1\n assert candidate(6, 29) == 28\n assert candidate(27, 10) == -1\n assert candidate(7, 7) == -1\n assert candidate(546, 546) == 546\n\ndef test_check():\n check(choose_num)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "py", - "prompt": "def words_in_sentence(sentence: str) -> str:\n \"\"\"\n You are given a string representing a sentence,\n the sentence contains some words separated by a space,\n and you have to return a string that contains the words from the original sentence,\n whose lengths are prime numbers,\n the order of the words in the new string should be the same as the original one.\n\n Example 1:\n >>> words_in_sentence('This is a test')\n 'is'\n\n Example 2:\n >>> words_in_sentence('lets go for swimming')\n 'go for'\n \n Constraints:\n * 1 <= len(sentence) <= 100\n * sentence contains only letters\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('This is a test') == 'is'\n assert candidate('lets go for swimming') == 'go for'\n assert candidate('there is no place available here') == 'there is no place'\n assert candidate('Hi I am Hussein') == 'Hi am Hussein'\n assert candidate('go for it') == 'go for it'\n assert candidate('here') == ''\n assert candidate('here is') == 'is'\n\ndef test_check():\n check(words_in_sentence)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "py", - "prompt": "from typing import List\n\ndef intersperse(numbers: List[int], delimeter: int) -> List[int]:\n \"\"\" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n >>> intersperse([], 4)\n []\n >>> intersperse([1, 2, 3], 4)\n [1, 4, 2, 4, 3]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([], 7) == []\n assert candidate([5, 6, 3, 2], 8) == [5, 8, 6, 8, 3, 8, 2]\n assert candidate([2, 2, 2], 2) == [2, 2, 2, 2, 2]\n\ndef test_check():\n check(intersperse)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "py", - "prompt": "def is_simple_power(x: int, n: int) -> bool:\n \"\"\"Your task is to write a function that returns true if a number x is a simple\n power of n and false in other cases.\n x is a simple power of n if n**int=x\n For example:\n >>> is_simple_power(1, 4)\n True\n >>> is_simple_power(2, 2)\n True\n >>> is_simple_power(8, 2)\n True\n >>> is_simple_power(3, 2)\n False\n >>> is_simple_power(3, 1)\n False\n >>> is_simple_power(5, 3)\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(16, 2) == True\n assert candidate(143214, 16) == False\n assert candidate(4, 2) == True\n assert candidate(9, 3) == True\n assert candidate(16, 4) == True\n assert candidate(24, 2) == False\n assert candidate(128, 4) == False\n assert candidate(12, 6) == False\n assert candidate(1, 1) == True\n assert candidate(1, 12) == True\n\ndef test_check():\n check(is_simple_power)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "py", - "prompt": "def is_multiply_prime(a: int) -> bool:\n \"\"\"Write a function that returns true if the given number is the multiplication of 3 prime numbers\n and false otherwise.\n Knowing that (a) is less then 100. \n Example:\n >>> is_multiply_prime(30)\n True\n 30 = 2 * 3 * 5\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(5) == False\n assert candidate(30) == True\n assert candidate(8) == True\n assert candidate(10) == False\n assert candidate(125) == True\n assert candidate(105) == True\n assert candidate(126) == False\n assert candidate(729) == False\n assert candidate(891) == False\n assert candidate(1001) == True\n\ndef test_check():\n check(is_multiply_prime)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "py", - "prompt": "def right_angle_triangle(a: int, b: int, c: int) -> bool:\n \"\"\"\n Given the lengths of the three sides of a triangle. Return True if the three\n sides form a right-angled triangle, False otherwise.\n A right-angled triangle is a triangle in which one angle is right angle or \n 90 degree.\n Example:\n >>> right_angle_triangle(3, 4, 5)\n True\n >>> right_angle_triangle(1, 2, 3)\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(3, 4, 5) == True\n assert candidate(1, 2, 3) == False\n assert candidate(10, 6, 8) == True\n assert candidate(2, 2, 2) == False\n assert candidate(7, 24, 25) == True\n assert candidate(10, 5, 7) == False\n assert candidate(5, 12, 13) == True\n assert candidate(15, 8, 17) == True\n assert candidate(48, 55, 73) == True\n assert candidate(1, 1, 1) == False\n assert candidate(2, 2, 10) == False\n\ndef test_check():\n check(right_angle_triangle)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "py", - "prompt": "def any_int(x: float, y: float, z: float) -> bool:\n \"\"\"\n Create a function that takes 3 numbers.\n Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n Returns false in any other cases.\n \n Examples\n >>> any_int(5, 2, 7)\n True\n \n >>> any_int(3, 2, 2)\n False\n\n >>> any_int(3, -2, 1)\n True\n \n >>> any_int(3.6, -2.2, 2)\n False\n \n\n \n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(2, 3, 1) == True\n assert candidate(2.5, 2, 3) == False\n assert candidate(1.5, 5, 3.5) == False\n assert candidate(2, 6, 2) == False\n assert candidate(4, 2, 2) == True\n assert candidate(2.2, 2.2, 2.2) == False\n assert candidate(-4, 6, 2) == True\n assert candidate(2, 1, 1) == True\n assert candidate(3, 4, 7) == True\n assert candidate(3.0, 4, 7) == False\n\ndef test_check():\n check(any_int)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "py", - "prompt": "from typing import List\n\ndef sort_third(l: List[int]) -> List[int]:\n \"\"\"This function takes a list l and returns a list l' such that\n l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n to the values of the corresponding indicies of l, but sorted.\n >>> sort_third([1, 2, 3])\n [1, 2, 3]\n >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n [2, 6, 3, 4, 8, 9, 5]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([5, 6, 3, 4, 8, 9, 2]) == [2, 6, 3, 4, 8, 9, 5]\n assert candidate([5, 8, 3, 4, 6, 9, 2]) == [2, 8, 3, 4, 6, 9, 5]\n assert candidate([5, 6, 9, 4, 8, 3, 2]) == [2, 6, 9, 4, 8, 3, 5]\n assert candidate([5, 6, 3, 4, 8, 9, 2, 1]) == [2, 6, 3, 4, 8, 9, 5, 1]\n\ndef test_check():\n check(sort_third)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_53_add", - "language": "py", - "prompt": "def add(x: int, y: int) -> int:\n \"\"\"Add two numbers x and y\n >>> add(2, 3)\n 5\n >>> add(5, 7)\n 12\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(0, 1) == 1\n assert candidate(1, 0) == 1\n assert candidate(2, 3) == 5\n assert candidate(5, 7) == 12\n assert candidate(7, 5) == 12\n\ndef test_check():\n check(add)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_69_search", - "language": "py", - "prompt": "from typing import List\n\ndef search(lst: List[int]) -> int:\n \"\"\"\n You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n zero, and has a frequency greater than or equal to the value of the integer itself. \n The frequency of an integer is the number of times it appears in the list.\n If no such a value exist, return -1.\n Examples:\n >>> search([4, 1, 2, 2, 3, 1])\n 2\n >>> search([1, 2, 2, 3, 3, 3, 4, 4, 4])\n 3\n >>> search([5, 5, 4, 4, 4])\n -1\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([5, 5, 5, 5, 1]) == 1\n assert candidate([4, 1, 4, 1, 4, 4]) == 4\n assert candidate([3, 3]) == -1\n assert candidate([8, 8, 8, 8, 8, 8, 8, 8]) == 8\n assert candidate([2, 3, 3, 2, 2]) == 2\n assert candidate([2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]) == 1\n assert candidate([3, 2, 8, 2]) == 2\n assert candidate([6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]) == 1\n assert candidate([8, 8, 3, 6, 5, 6, 4]) == -1\n assert candidate([6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]) == 1\n assert candidate([1, 9, 10, 1, 3]) == 1\n assert candidate([6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]) == 5\n assert candidate([1]) == 1\n assert candidate([8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]) == 4\n assert candidate([2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]) == 2\n assert candidate([1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]) == 1\n assert candidate([9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]) == 4\n assert candidate([2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]) == 4\n assert candidate([9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]) == 2\n assert candidate([5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]) == -1\n assert candidate([10]) == -1\n assert candidate([9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]) == 2\n assert candidate([5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]) == 1\n assert candidate([7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]) == 1\n assert candidate([3, 10, 10, 9, 2]) == -1\n\ndef test_check():\n check(search)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "py", - "prompt": "def prime_length(string: str) -> bool:\n \"\"\"Write a function that takes a string and returns True if the string\n length is a prime number or False otherwise\n Examples\n >>> prime_length('Hello')\n True\n >>> prime_length('abcdcba')\n True\n >>> prime_length('kittens')\n True\n >>> prime_length('orange')\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('Hello') == True\n assert candidate('abcdcba') == True\n assert candidate('kittens') == True\n assert candidate('orange') == False\n assert candidate('wow') == True\n assert candidate('world') == True\n assert candidate('MadaM') == True\n assert candidate('Wow') == True\n assert candidate('') == False\n assert candidate('HI') == True\n assert candidate('go') == True\n assert candidate('gogo') == False\n assert candidate('aaaaaaaaaaaaaaa') == False\n assert candidate('Madam') == True\n assert candidate('M') == False\n assert candidate('0') == False\n\ndef test_check():\n check(prime_length)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_58_common", - "language": "py", - "prompt": "from typing import List\n\ndef common(l1: List[int], l2: List[int]) -> List[int]:\n \"\"\"Return sorted unique common elements for two lists.\n >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n [1, 5, 653]\n >>> common([5, 3, 2, 8], [3, 2])\n [2, 3]\n\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]) == [1, 5, 653]\n assert candidate([5, 3, 2, 8], [3, 2]) == [2, 3]\n assert candidate([4, 3, 2, 8], [3, 2, 4]) == [2, 3, 4]\n assert candidate([4, 3, 2, 8], []) == []\n\ndef test_check():\n check(common)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "py", - "prompt": "def special_factorial(n: int) -> int:\n \"\"\"The Brazilian factorial is defined as:\n brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n where n > 0\n\n For example:\n >>> special_factorial(4)\n 288\n\n The function will receive an integer as input and should return the special\n factorial of this integer.\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(4) == 288\n assert candidate(5) == 34560\n assert candidate(7) == 125411328000\n assert candidate(1) == 1\n\ndef test_check():\n check(special_factorial)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "py", - "prompt": "from typing import List\n\ndef exchange(lst1: List[int], lst2: List[int]) -> str:\n \"\"\"In this problem, you will implement a function that takes two lists of numbers,\n and determines whether it is possible to perform an exchange of elements\n between them to make lst1 a list of only even numbers.\n There is no limit on the number of exchanged elements between lst1 and lst2.\n If it is possible to exchange elements between the lst1 and lst2 to make\n all the elements of lst1 to be even, return \"YES\".\n Otherwise, return \"NO\".\n For example:\n >>> exchange([1, 2, 3, 4], [1, 2, 3, 4])\n 'YES'\n >>> exchange([1, 2, 3, 4], [1, 5, 3, 4])\n 'NO'\n It is assumed that the input lists will be non-empty.\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([1, 2, 3, 4], [1, 2, 3, 4]) == 'YES'\n assert candidate([1, 2, 3, 4], [1, 5, 3, 4]) == 'NO'\n assert candidate([1, 2, 3, 4], [2, 1, 4, 3]) == 'YES'\n assert candidate([5, 7, 3], [2, 6, 4]) == 'YES'\n assert candidate([5, 7, 3], [2, 6, 3]) == 'NO'\n assert candidate([3, 2, 6, 1, 8, 9], [3, 5, 5, 1, 1, 1]) == 'NO'\n assert candidate([100, 200], [200, 200]) == 'YES'\n\ndef test_check():\n check(exchange)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "py", - "prompt": "from typing import List\n\ndef add_elements(arr: List[int], k: int) -> int:\n \"\"\"\n Given a non-empty array of integers arr and an integer k, return\n the sum of the elements with at most two digits from the first k elements of arr.\n\n Example:\n\n >>> add_elements([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4)\n 24\n\n Constraints:\n 1. 1 <= len(arr) <= 100\n 2. 1 <= k <= len(arr)\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([1, -2, -3, 41, 57, 76, 87, 88, 99], 3) == -4\n assert candidate([111, 121, 3, 4000, 5, 6], 2) == 0\n assert candidate([11, 21, 3, 90, 5, 6, 7, 8, 9], 4) == 125\n assert candidate([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4) == 24\n assert candidate([1], 1) == 1\n\ndef test_check():\n check(add_elements)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "py", - "prompt": "def x_or_y(n: int, x: int, y: int) -> int:\n \"\"\"A simple program which should return the value of x if n is \n a prime number and should return the value of y otherwise.\n\n Examples:\n >>> x_or_y(7, 34, 12)\n 34\n >>> x_or_y(15, 8, 5)\n 5\n \n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(7, 34, 12) == 34\n assert candidate(15, 8, 5) == 5\n assert candidate(3, 33, 5212) == 33\n assert candidate(1259, 3, 52) == 3\n assert candidate(7919, -1, 12) == -1\n assert candidate(3609, 1245, 583) == 583\n assert candidate(91, 56, 129) == 129\n assert candidate(6, 34, 1234) == 1234\n assert candidate(1, 2, 0) == 0\n assert candidate(2, 2, 0) == 2\n\ndef test_check():\n check(x_or_y)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "py", - "prompt": "def triangle_area(a: int, h: int) -> float:\n \"\"\"Given length of a side and high return area for a triangle.\n >>> triangle_area(5, 3)\n 7.5\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(5, 3) == 7.5\n assert candidate(2, 2) == 2.0\n assert candidate(10, 8) == 40.0\n\ndef test_check():\n check(triangle_area)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "py", - "prompt": "from typing import List\n\ndef tri(n: int) -> List[int]:\n \"\"\"Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n the last couple centuries. However, what people don't know is Tribonacci sequence.\n Tribonacci sequence is defined by the recurrence:\n tri(1) = 3\n tri(n) = 1 + n / 2, if n is even.\n tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n For example:\n tri(2) = 1 + (2 / 2) = 2\n tri(4) = 3\n tri(3) = tri(2) + tri(1) + tri(4)\n = 2 + 3 + 3 = 8 \n You are given a non-negative integer number n, you have to a return a list of the \n first n + 1 numbers of the Tribonacci sequence.\n Examples:\n >>> tri(3)\n [1, 3, 2, 8]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(3) == [1, 3, 2, 8]\n assert candidate(4) == [1, 3, 2, 8, 3]\n assert candidate(5) == [1, 3, 2, 8, 3, 15]\n assert candidate(6) == [1, 3, 2, 8, 3, 15, 4]\n assert candidate(7) == [1, 3, 2, 8, 3, 15, 4, 24]\n assert candidate(8) == [1, 3, 2, 8, 3, 15, 4, 24, 5]\n assert candidate(9) == [1, 3, 2, 8, 3, 15, 4, 24, 5, 35]\n assert candidate(20) == [1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11]\n assert candidate(0) == [1]\n assert candidate(1) == [1, 3]\n\ndef test_check():\n check(tri)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "py", - "prompt": "from typing import List\n\ndef match_parens(lst: List[str]) -> str:\n \"\"\"\n You are given a list of two strings, both strings consist of open\n parentheses '(' or close parentheses ')' only.\n Your job is to check if it is possible to concatenate the two strings in\n some order, that the resulting string will be good.\n A string S is considered to be good if and only if all parentheses in S\n are balanced. For example: the string '(())()' is good, while the string\n '())' is not.\n Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n\n Examples:\n >>> match_parens(['()(', ')'])\n 'Yes'\n >>> match_parens([')', ')'])\n 'No'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(['()(', ')']) == 'Yes'\n assert candidate([')', ')']) == 'No'\n assert candidate(['(()(())', '())())']) == 'No'\n assert candidate([')())', '(()()(']) == 'Yes'\n assert candidate(['(())))', '(()())((']) == 'Yes'\n assert candidate(['()', '())']) == 'No'\n assert candidate(['(()(', '()))()']) == 'Yes'\n assert candidate(['((((', '((())']) == 'No'\n assert candidate([')(()', '(()(']) == 'No'\n assert candidate([')(', ')(']) == 'No'\n assert candidate(['(', ')']) == 'Yes'\n assert candidate([')', '(']) == 'Yes'\n\ndef test_check():\n check(match_parens)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "py", - "prompt": "from typing import List\n\ndef remove_duplicates(numbers: List[int]) -> List[int]:\n \"\"\" From a list of integers, remove all elements that occur more than once.\n Keep order of elements left the same as in the input.\n >>> remove_duplicates([1, 2, 3, 2, 4])\n [1, 3, 4]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([]) == []\n assert candidate([1, 2, 3, 4]) == [1, 2, 3, 4]\n assert candidate([1, 2, 3, 2, 4, 3, 5]) == [1, 4, 5]\n\ndef test_check():\n check(remove_duplicates)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "py", - "prompt": "def greatest_common_divisor(a: int, b: int) -> int:\n \"\"\" Return a greatest common divisor of two integers a and b\n >>> greatest_common_divisor(3, 5)\n 1\n >>> greatest_common_divisor(25, 15)\n 5\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(3, 7) == 1\n assert candidate(10, 15) == 5\n assert candidate(49, 14) == 7\n assert candidate(144, 60) == 12\n\ndef test_check():\n check(greatest_common_divisor)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "py", - "prompt": "def is_palindrome(text: str) -> bool:\n \"\"\"\n Checks if given string is a palindrome\n >>> is_palindrome('')\n True\n >>> is_palindrome('aba')\n True\n >>> is_palindrome('aaaaa')\n True\n >>> is_palindrome('zbcd')\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('') == True\n assert candidate('aba') == True\n assert candidate('aaaaa') == True\n assert candidate('zbcd') == False\n assert candidate('xywyx') == True\n assert candidate('xywyz') == False\n assert candidate('xywzx') == False\n\ndef test_check():\n check(is_palindrome)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "py", - "prompt": "from typing import List\n\ndef derivative(xs: List[int]) -> List[int]:\n \"\"\" xs represent coefficients of a polynomial.\n xs[0] + xs[1] * x + xs[2] * x^2 + ....\n Return derivative of this polynomial in the same form.\n >>> derivative([3, 1, 2, 4, 5])\n [1, 4, 12, 20]\n >>> derivative([1, 2, 3])\n [2, 6]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([3, 1, 2, 4, 5]) == [1, 4, 12, 20]\n assert candidate([1, 2, 3]) == [2, 6]\n assert candidate([3, 2, 1]) == [2, 2]\n assert candidate([3, 2, 1, 0, 4]) == [2, 2, 0, 16]\n assert candidate([1]) == []\n\ndef test_check():\n check(derivative)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "py", - "prompt": "def fruit_distribution(s: str, n: int) -> int:\n \"\"\"\n In this task, you will be given a string that represents a number of apples and oranges \n that are distributed in a basket of fruit this basket contains \n apples, oranges, and mango fruits. Given the string that represents the total number of \n the oranges and apples and an integer that represent the total number of the fruits \n in the basket return the number of the mango fruits in the basket.\n for examble:\n >>> fruit_distribution('5 apples and 6 oranges', 19)\n 8\n >>> fruit_distribution('0 apples and 1 oranges', 3)\n 2\n >>> fruit_distribution('2 apples and 3 oranges', 100)\n 95\n >>> fruit_distribution('100 apples and 1 oranges', 120)\n 19\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('5 apples and 6 oranges', 19) == 8\n assert candidate('5 apples and 6 oranges', 21) == 10\n assert candidate('0 apples and 1 oranges', 3) == 2\n assert candidate('1 apples and 0 oranges', 3) == 2\n assert candidate('2 apples and 3 oranges', 100) == 95\n assert candidate('2 apples and 3 oranges', 5) == 0\n assert candidate('1 apples and 100 oranges', 120) == 19\n\ndef test_check():\n check(fruit_distribution)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "py", - "prompt": "def iscube(a: int) -> bool:\n \"\"\"\n Write a function that takes an integer a and returns True \n if this ingeger is a cube of some integer number.\n Note: you may assume the input is always valid.\n Examples:\n >>> iscube(1)\n True\n >>> iscube(2)\n False\n >>> iscube(-1)\n True\n >>> iscube(64)\n True\n >>> iscube(0)\n True\n >>> iscube(180)\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(1) == True\n assert candidate(2) == False\n assert candidate(-1) == True\n assert candidate(64) == True\n assert candidate(180) == False\n assert candidate(1000) == True\n assert candidate(0) == True\n assert candidate(1729) == False\n\ndef test_check():\n check(iscube)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "py", - "prompt": "from typing import List\n\ndef sort_array(arr: List[int]) -> List[int]:\n \"\"\"\n In this Kata, you have to sort an array of non-negative integers according to\n number of ones in their binary representation in ascending order.\n For similar number of ones, sort based on decimal value.\n\n It must be implemented like this:\n >>> sort_array([1, 5, 2, 3, 4])\n [1, 2, 3, 4, 5]\n >>> sort_array([-2, -3, -4, -5, -6])\n [-6, -5, -4, -3, -2]\n >>> sort_array([1, 0, 2, 3, 4])\n [0, 1, 2, 3, 4]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([1, 5, 2, 3, 4]) == [1, 2, 4, 3, 5]\n assert candidate([-2, -3, -4, -5, -6]) == [-4, -2, -6, -5, -3]\n assert candidate([1, 0, 2, 3, 4]) == [0, 1, 2, 4, 3]\n assert candidate([]) == []\n assert candidate([2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]) == [2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77]\n assert candidate([3, 6, 44, 12, 32, 5]) == [32, 3, 5, 6, 12, 44]\n assert candidate([2, 4, 8, 16, 32]) == [2, 4, 8, 16, 32]\n assert candidate([2, 4, 8, 16, 32]) == [2, 4, 8, 16, 32]\n\ndef test_check():\n check(sort_array)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "py", - "prompt": "from typing import List\n\ndef odd_count(lst: List[str]) -> List[str]:\n \"\"\"Given a list of strings, where each string consists of only digits, return a list.\n Each element i of the output should be \"the number of odd elements in the\n string i of the input.\" where all the i's should be replaced by the number\n of odd digits in the i'th string of the input.\n\n >>> odd_count(['1234567'])\n ['the number of odd elements 4n the str4ng 4 of the 4nput.']\n >>> odd_count(['3', '11111111'])\n ['the number of odd elements 1n the str1ng 1 of the 1nput.', 'the number of odd elements 8n the str8ng 8 of the 8nput.']\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(['1234567']) == ['the number of odd elements 4n the str4ng 4 of the 4nput.']\n 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.']\n assert candidate(['271', '137', '314']) == ['the number of odd elements 2n the str2ng 2 of the 2nput.', 'the number of odd elements 3n the str3ng 3 of the 3nput.', 'the number of odd elements 2n the str2ng 2 of the 2nput.']\n\ndef test_check():\n check(odd_count)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "py", - "prompt": "def correct_bracketing(brackets: str) -> bool:\n \"\"\" brackets is a string of \"(\" and \")\".\n return True if every opening bracket has a corresponding closing bracket.\n\n >>> correct_bracketing('(')\n False\n >>> correct_bracketing('()')\n True\n >>> correct_bracketing('(()())')\n True\n >>> correct_bracketing(')(()')\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('()') == True\n assert candidate('(()())') == True\n assert candidate('()()(()())()') == True\n assert candidate('()()((()()())())(()()(()))') == True\n assert candidate('((()())))') == False\n assert candidate(')(()') == False\n assert candidate('(') == False\n assert candidate('((((') == False\n assert candidate(')') == False\n assert candidate('(()') == False\n assert candidate('()()(()())())(()') == False\n assert candidate('()()(()())()))()') == False\n\ndef test_check():\n check(correct_bracketing)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "py", - "prompt": "def digitSum(s: str) -> int:\n \"\"\"Task\n Write a function that takes a string as input and returns the sum of the upper characters only'\n ASCII codes.\n\n Examples:\n >>> digitSum('')\n 0\n >>> digitSum('abAB')\n 131\n >>> digitSum('abcCd')\n 67\n >>> digitSum('helloE')\n 69\n >>> digitSum('woArBld')\n 131\n >>> digitSum('aAaaaXa')\n 153\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('') == 0\n assert candidate('abAB') == 131\n assert candidate('abcCd') == 67\n assert candidate('helloE') == 69\n assert candidate('woArBld') == 131\n assert candidate('aAaaaXa') == 153\n assert candidate(' How are yOu?') == 151\n assert candidate('You arE Very Smart') == 327\n\ndef test_check():\n check(digitSum)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "py", - "prompt": "from typing import List\n\ndef sorted_list_sum(lst: List[str]) -> List[str]:\n \"\"\"Write a function that accepts a list of strings as a parameter,\n deletes the strings that have odd lengths from it,\n and returns the resulted list with a sorted order,\n The list is always a list of strings and never an array of numbers,\n and it may contain duplicates.\n The order of the list should be ascending by length of each word, and you\n should return the list sorted by that rule.\n If two words have the same length, sort the list alphabetically.\n The function should return a list of strings in sorted order.\n You may assume that all words will have the same length.\n For example:\n >>> list_sort(['aa', 'a', 'aaa'])\n ['aa']\n >>> list_sort(['ab', 'a', 'aaa', 'cd'])\n ['ab', 'cd']\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(['aa', 'a', 'aaa']) == ['aa']\n assert candidate(['school', 'AI', 'asdf', 'b']) == ['AI', 'asdf', 'school']\n assert candidate(['d', 'b', 'c', 'a']) == []\n assert candidate(['d', 'dcba', 'abcd', 'a']) == ['abcd', 'dcba']\n assert candidate(['AI', 'ai', 'au']) == ['AI', 'ai', 'au']\n assert candidate(['a', 'b', 'b', 'c', 'c', 'a']) == []\n assert candidate(['aaaa', 'bbbb', 'dd', 'cc']) == ['cc', 'dd', 'aaaa', 'bbbb']\n\ndef test_check():\n check(sorted_list_sum)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "py", - "prompt": "from typing import List, Optional\n\ndef prod_signs(arr: List[int]) -> Optional[int]:\n \"\"\"\n You are given an array arr of integers and you need to return\n sum of magnitudes of integers multiplied by product of all signs\n of each number in the array, represented by 1, -1 or 0.\n Note: return None for empty arr.\n\n Example:\n >>> prod_signs([1, 2, 2, -4])\n 9\n >>> prod_signs([0, 1])\n 0\n >>> prod_signs([])\n None\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([1, 2, 2, -4]) == -9\n assert candidate([0, 1]) == 0\n assert candidate([1, 1, 1, 2, 3, -1, 1]) == -10\n assert candidate([]) == None\n assert candidate([2, 4, 1, 2, -1, -1, 9]) == 20\n assert candidate([-1, 1, -1, 1]) == 4\n assert candidate([-1, 1, 1, 1]) == -4\n assert candidate([-1, 1, 1, 0]) == 0\n\ndef test_check():\n check(prod_signs)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "py", - "prompt": "from typing import List\n\ndef incr_list(l: List[int]) -> List[int]:\n \"\"\"Return list with elements incremented by 1.\n >>> incr_list([1, 2, 3])\n [2, 3, 4]\n >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123])\n [6, 4, 6, 3, 4, 4, 10, 1, 124]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([]) == []\n assert candidate([3, 2, 1]) == [4, 3, 2]\n assert candidate([5, 2, 5, 2, 3, 3, 9, 0, 123]) == [6, 3, 6, 3, 4, 4, 10, 1, 124]\n\ndef test_check():\n check(incr_list)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "py", - "prompt": "from typing import List\n\ndef rolling_max(numbers: List[int]) -> List[int]:\n \"\"\" From a given list of integers, generate a list of rolling maximum element found until given moment\n in the sequence.\n >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n [1, 2, 3, 3, 3, 4, 4]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([]) == []\n assert candidate([1, 2, 3, 4]) == [1, 2, 3, 4]\n assert candidate([4, 3, 2, 1]) == [4, 4, 4, 4]\n assert candidate([3, 2, 3, 100, 3]) == [3, 3, 3, 100, 100]\n\ndef test_check():\n check(rolling_max)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "py", - "prompt": "from typing import List\n\ndef separate_paren_groups(paren_string: str) -> List[str]:\n \"\"\" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n separate those group into separate strings and return the list of those.\n Separate groups are balanced (each open brace is properly closed) and not nested within each other\n Ignore any spaces in the input string.\n >>> separate_paren_groups('( ) (( )) (( )( ))')\n ['()', '(())', '(()())']\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('(()()) ((())) () ((())()())') == ['(()())', '((()))', '()', '((())()())']\n assert candidate('() (()) ((())) (((())))') == ['()', '(())', '((()))', '(((())))']\n assert candidate('(()(())((())))') == ['(()(())((())))']\n assert candidate('( ) (( )) (( )( ))') == ['()', '(())', '(()())']\n\ndef test_check():\n check(separate_paren_groups)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "py", - "prompt": "from typing import List\n\ndef words_string(s: str) -> List[str]:\n \"\"\"\n You will be given a string of words separated by commas or spaces. Your task is\n to split the string into words and return an array of the words.\n \n For example:\n >>> words_string('Hi, my name is John')\n ['Hi', 'my', 'name', 'is', 'John']\n >>> words_string('One, two, three, four, five, six')\n ['One', 'two', 'three', 'four', 'five', 'six']\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('Hi, my name is John') == ['Hi', 'my', 'name', 'is', 'John']\n assert candidate('One, two, three, four, five, six') == ['One', 'two', 'three', 'four', 'five', 'six']\n assert candidate('Hi, my name') == ['Hi', 'my', 'name']\n assert candidate('One,, two, three, four, five, six,') == ['One', 'two', 'three', 'four', 'five', 'six']\n assert candidate('') == []\n assert candidate('ahmed , gamal') == ['ahmed', 'gamal']\n\ndef test_check():\n check(words_string)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "py", - "prompt": "from typing import Union\n\ndef compare_one(a: Union[int, float, str], b: Union[int, float, str]) -> Union[int, float, str, None]:\n \"\"\"\n Create a function that takes integers, floats, or strings representing\n real numbers, and returns the larger variable in its given variable type.\n Return None if the values are equal.\n Note: If a real number is represented as a string, the floating point might be . or ,\n\n >>> compare_one(1, 2.5)\n 2.5\n >>> compare_one(1, '2,3')\n '2,3'\n >>> compare_one('5,1', '6')\n '6'\n >>> compare_one('1', 1)\n None\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(1, 2) == 2\n assert candidate(1, 2.5) == 2.5\n assert candidate(2, 3) == 3\n assert candidate(5, 6) == 6\n assert candidate(1, '2,3') == '2,3'\n assert candidate('5,1', '6') == '6'\n assert candidate('1', '2') == '2'\n assert candidate('1', 1) == None\n\ndef test_check():\n check(compare_one)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "py", - "prompt": "from typing import List, Any\n\ndef filter_integers(values: List[Any]) -> List[int]:\n \"\"\" Filter given list of any python values only for integers\n >>> filter_integers(['a', 3.14, 5])\n [5]\n >>> filter_integers([1, 2, 3, 'abc', { }, []])\n [1, 2, 3]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([]) == []\n assert candidate([4, { }, [], 23.2, 9, 'adasd']) == [4, 9]\n assert candidate([3, 'c', 3, 3, 'a', 'b']) == [3, 3, 3]\n\ndef test_check():\n check(filter_integers)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "py", - "prompt": "from typing import List\n\ndef sort_even(l: List[int]) -> List[int]:\n \"\"\"This function takes a list l and returns a list l' such that\n l' is identical to l in the odd indicies, while its values at the even indicies are equal\n to the values of the even indicies of l, but sorted.\n >>> sort_even([1, 2, 3])\n [1, 2, 3]\n >>> sort_even([5, 6, 3, 4])\n [3, 6, 5, 4]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([1, 2, 3]) == [1, 2, 3]\n assert candidate([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]) == [-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123]\n assert candidate([5, 8, -12, 4, 23, 2, 3, 11, 12, -10]) == [-12, 8, 3, 4, 5, 2, 12, 11, 23, -10]\n\ndef test_check():\n check(sort_even)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "py", - "prompt": "from typing import List\n\ndef compare(game: List[int], guess: List[int]) -> List[int]:\n \"\"\"I think we all remember that feeling when the result of some long-awaited\n event is finally known. The feelings and thoughts you have at that moment are\n definitely worth noting down and comparing.\n Your task is to determine if a person correctly guessed the results of a number of matches.\n You are given two arrays of scores and guesses of equal length, where each index shows a match. \n Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n the value is 0, and if not, the value is the absolute difference between the guess and the score.\n \n \n example:\n\n >>> compare([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2])\n [0, 0, 0, 0, 3, 3]\n >>> compare([0, 5, 0, 0, 0, 4], [4, 1, 1, 0, 0, -2])\n [4, 4, 1, 0, 0, 6]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2]) == [0, 0, 0, 0, 3, 3]\n assert candidate([0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]) == [0, 0, 0, 0, 0, 0]\n assert candidate([1, 2, 3], [-1, -2, -3]) == [2, 4, 6]\n assert candidate([1, 2, 3, 5], [-1, 2, 3, 4]) == [2, 0, 0, 1]\n\ndef test_check():\n check(compare)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "py", - "prompt": "from typing import Tuple\n\ndef even_odd_palindrome(n: int) -> Tuple[int, int]:\n \"\"\"\n Given a positive integer n, return a tuple that has the number of even and odd\n integer palindromes that fall within the range(1, n), inclusive.\n\n Example 1:\n\n >>> even_odd_palindrome(3)\n (1, 2)\n Explanation:\n Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n\n Example 2:\n\n >>> even_odd_palindrome(12)\n (4, 6)\n Explanation:\n Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n\n Note:\n 1. 1 <= n <= 10^3\n 2. returned tuple has the number of even and odd integer palindromes respectively.\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(123) == (8, 13)\n assert candidate(12) == (4, 6)\n assert candidate(3) == (1, 2)\n assert candidate(63) == (6, 8)\n assert candidate(25) == (5, 6)\n assert candidate(19) == (4, 6)\n assert candidate(9) == (4, 5)\n assert candidate(1) == (0, 1)\n\ndef test_check():\n check(even_odd_palindrome)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "py", - "prompt": "def fib4(n: int) -> int:\n \"\"\"The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fib4(0) -> 0\n fib4(1) -> 0\n fib4(2) -> 2\n fib4(3) -> 0\n fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n >>> fib4(5)\n 4\n >>> fib4(6)\n 8\n >>> fib4(7)\n 14\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(5) == 4\n assert candidate(8) == 28\n assert candidate(10) == 104\n assert candidate(12) == 386\n\ndef test_check():\n check(fib4)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "py", - "prompt": "from typing import List\n\ndef generate_integers(a: int, b: int) -> List[int]:\n \"\"\"\n Given two positive integers a and b, return the even digits between a\n and b, in ascending order.\n\n For example:\n >>> generate_integers(2, 8)\n [2, 4, 6, 8]\n >>> generate_integers(8, 2)\n [2, 4, 6, 8]\n >>> generate_integers(10, 14)\n []\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(2, 10) == [2, 4, 6, 8]\n assert candidate(10, 2) == [2, 4, 6, 8]\n assert candidate(132, 2) == [2, 4, 6, 8]\n assert candidate(17, 89) == []\n\ndef test_check():\n check(generate_integers)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "py", - "prompt": "from typing import List\n\ndef mean_absolute_deviation(numbers: List[float]) -> float:\n \"\"\" For a given list of input numbers, calculate Mean Absolute Deviation\n around the mean of this dataset.\n Mean Absolute Deviation is the average absolute difference between each\n element and a centerpoint (mean in this case):\n MAD = average | x - x_mean |\n >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n 1.0\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([1.0, 2.0]) == 0.5\n assert candidate([1.0, 2.0, 3.0, 4.0]) == 1.0\n assert candidate([1.0, 2.0, 3.0, 4.0, 5.0]) == 1.2\n\ndef test_check():\n check(mean_absolute_deviation)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "py", - "prompt": "def encrypt(s: str) -> str:\n \"\"\"Create a function encrypt that takes a string as an argument and\n returns a string encrypted with the alphabet being rotated. \n The alphabet should be rotated in a manner such that the letters \n shift down by two multiplied to two places.\n For example:\n >>> encrypt('hi')\n 'lm'\n >>> encrypt('asdfghjkl')\n 'ewhjklnop'\n >>> encrypt('gf')\n 'kj'\n >>> encrypt('et')\n 'ix'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('hi') == 'lm'\n assert candidate('asdfghjkl') == 'ewhjklnop'\n assert candidate('gf') == 'kj'\n assert candidate('et') == 'ix'\n assert candidate('faewfawefaewg') == 'jeiajeaijeiak'\n assert candidate('hellomyfriend') == 'lippsqcjvmirh'\n assert candidate('dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh') == 'hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl'\n assert candidate('a') == 'e'\n\ndef test_check():\n check(encrypt)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "py", - "prompt": "from typing import List\n\ndef get_odd_collatz(n: int) -> List[int]:\n \"\"\"\n Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n\n The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n as follows: start with any positive integer n. Then each term is obtained from the \n previous term as follows: if the previous term is even, the next term is one half of \n the previous term. If the previous term is odd, the next term is 3 times the previous\n term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n\n Note: \n 1. Collatz(1) is [1].\n 2. returned list sorted in increasing order.\n\n For example:\n get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n >>> get_odd_collatz(5)\n [1, 5]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(14) == [1, 5, 7, 11, 13, 17]\n assert candidate(5) == [1, 5]\n assert candidate(12) == [1, 3, 5]\n assert candidate(1) == [1]\n\ndef test_check():\n check(get_odd_collatz)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "py", - "prompt": "def how_many_times(string: str, substring: str) -> int:\n \"\"\" Find how many times a given substring can be found in the original string. Count overlaping cases.\n >>> how_many_times('', 'a')\n 0\n >>> how_many_times('aaa', 'a')\n 3\n >>> how_many_times('aaaa', 'aa')\n 3\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('', 'x') == 0\n assert candidate('xyxyxyx', 'x') == 4\n assert candidate('cacacacac', 'cac') == 4\n assert candidate('john doe', 'john') == 1\n\ndef test_check():\n check(how_many_times)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "py", - "prompt": "from typing import List\n\ndef move_one_ball(arr: List[int]) -> bool:\n \"\"\"We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n numbers in the array will be randomly ordered. Your task is to determine if\n it is possible to get an array sorted in non-decreasing order by performing \n the following operation on the given array:\n You are allowed to perform right shift operation any number of times.\n \n One right shift operation means shifting all elements of the array by one\n position in the right direction. The last element of the array will be moved to\n the starting position in the array i.e. 0th index. \n\n If it is possible to obtain the sorted array by performing the above operation\n then return True else return False.\n If the given array is empty then return True.\n\n Note: The given list is guaranteed to have unique elements.\n\n For Example:\n \n >>> move_one_ball([3, 4, 5, 1, 2])\n True\n Explanation: By performin 2 right shift operations, non-decreasing order can\n be achieved for the given array.\n >>> move_one_ball([3, 5, 4, 1, 2])\n False\n Explanation:It is not possible to get non-decreasing order for the given\n array by performing any number of right shift operations.\n \n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([3, 4, 5, 1, 2]) == True\n assert candidate([3, 5, 10, 1, 2]) == True\n assert candidate([4, 3, 1, 2]) == False\n assert candidate([3, 5, 4, 1, 2]) == False\n assert candidate([]) == True\n\ndef test_check():\n check(move_one_ball)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "py", - "prompt": "from typing import List\n\ndef order_by_points(nums: List[int]) -> List[int]:\n \"\"\"\n Write a function which sorts the given list of integers\n in ascending order according to the sum of their digits.\n Note: if there are several items with similar sum of their digits,\n order them based on their index in original list.\n\n For example:\n >>> order_by_points([1, 11, -1, -11, -12])\n [-1, -11, 1, -12, 11]\n >>> order_by_points([])\n []\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]\n assert candidate([1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]) == [0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457]\n assert candidate([]) == []\n assert candidate([1, -11, -32, 43, 54, -98, 2, -3]) == [-3, -32, -98, -11, 1, 2, 43, 54]\n assert candidate([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) == [1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9]\n assert candidate([0, 6, 6, -76, -21, 23, 4]) == [-76, -21, 0, 4, 23, 6, 6]\n\ndef test_check():\n check(order_by_points)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "py", - "prompt": "from typing import List\n\ndef factorize(n: int) -> List[int]:\n \"\"\" Return list of prime factors of given integer in the order from smallest to largest.\n Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n Input number should be equal to the product of all factors\n >>> factorize(8)\n [2, 2, 2]\n >>> factorize(25)\n [5, 5]\n >>> factorize(70)\n [2, 5, 7]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(2) == [2]\n assert candidate(4) == [2, 2]\n assert candidate(8) == [2, 2, 2]\n assert candidate(57) == [3, 19]\n assert candidate(3249) == [3, 3, 19, 19]\n assert candidate(185193) == [3, 3, 3, 19, 19, 19]\n assert candidate(20577) == [3, 19, 19, 19]\n assert candidate(18) == [2, 3, 3]\n\ndef test_check():\n check(factorize)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "py", - "prompt": "from typing import List\n\ndef below_threshold(l: List[int], t: int) -> bool:\n \"\"\"Return True if all numbers in the list l are below threshold t.\n >>> below_threshold([1, 2, 4, 10], 100)\n True\n >>> below_threshold([1, 20, 4, 10], 5)\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([1, 2, 4, 10], 100) == True\n assert candidate([1, 20, 4, 10], 5) == False\n assert candidate([1, 20, 4, 10], 21) == True\n assert candidate([1, 20, 4, 10], 22) == True\n assert candidate([1, 8, 4, 10], 11) == True\n assert candidate([1, 8, 4, 10], 10) == False\n\ndef test_check():\n check(below_threshold)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "py", - "prompt": "from typing import Union\n\ndef rounded_avg(n: int, m: int) -> Union[str, int]:\n \"\"\"You are given two positive integers n and m, and your task is to compute the\n average of the integers from n through m (including n and m). \n Round the answer to the nearest integer and convert that to binary.\n If n is greater than m, return -1.\n Example:\n >>> rounded_avg(1, 5)\n '0b11'\n >>> rounded_avg(7, 5)\n -1\n >>> rounded_avg(10, 20)\n '0b1111'\n >>> rounded_avg(20, 33)\n '0b11010'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(1, 5) == '0b11'\n assert candidate(7, 13) == '0b1010'\n assert candidate(964, 977) == '0b1111001010'\n assert candidate(996, 997) == '0b1111100100'\n assert candidate(560, 851) == '0b1011000010'\n assert candidate(185, 546) == '0b101101110'\n assert candidate(362, 496) == '0b110101101'\n assert candidate(350, 902) == '0b1001110010'\n assert candidate(197, 233) == '0b11010111'\n assert candidate(7, 5) == -1\n assert candidate(5, 1) == -1\n assert candidate(5, 5) == '0b101'\n\ndef test_check():\n check(rounded_avg)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "py", - "prompt": "from typing import List\n\ndef parse_nested_parens(paren_string: str) -> List[int]:\n \"\"\" Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n For each of the group, output the deepest level of nesting of parentheses.\n E.g. (()()) has maximum two levels of nesting while ((())) has three.\n\n >>> parse_nested_parens('(()()) ((())) () ((())()())')\n [2, 3, 1, 3]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('(()()) ((())) () ((())()())') == [2, 3, 1, 3]\n assert candidate('() (()) ((())) (((())))') == [1, 2, 3, 4]\n assert candidate('(()(())((())))') == [4]\n\ndef test_check():\n check(parse_nested_parens)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "py", - "prompt": "from typing import List\n\ndef solution(lst: List[int]) -> int:\n \"\"\"Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n \n\n Examples\n >>> solution([5, 8, 7, 1])\n 12\n >>> solution([3, 3, 3, 3, 3])\n 9\n >>> solution([30, 13, 24, 321])\n 0\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([5, 8, 7, 1]) == 12\n assert candidate([3, 3, 3, 3, 3]) == 9\n assert candidate([30, 13, 24, 321]) == 0\n assert candidate([5, 9]) == 5\n assert candidate([2, 4, 8]) == 0\n assert candidate([30, 13, 23, 32]) == 23\n assert candidate([3, 13, 2, 9]) == 3\n\ndef test_check():\n check(solution)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "py", - "prompt": "def get_max_triples(n: int) -> int:\n \"\"\"\n You are given a positive integer n. You have to create an integer array a of length n.\n For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n and a[i] + a[j] + a[k] is a multiple of 3.\n\n Example :\n >>> get_max_triples(5)\n 1\n Explanation: \n a = [1, 3, 7, 13, 21]\n The only valid triple is (1, 7, 13).\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(5) == 1\n assert candidate(6) == 4\n assert candidate(10) == 36\n assert candidate(100) == 53361\n\ndef test_check():\n check(get_max_triples)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "py", - "prompt": "from typing import Tuple\n\ndef bf(planet1: str, planet2: str) -> Tuple[str, ...]:\n \"\"\"\n There are eight planets in our solar system: the closerst to the Sun \n is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n Uranus, Neptune.\n Write a function that takes two planet names as strings planet1 and planet2. \n The function should return a tuple containing all planets whose orbits are \n located between the orbit of planet1 and the orbit of planet2, sorted by \n the proximity to the sun. \n The function should return an empty tuple if planet1 or planet2\n are not correct planet names. \n Examples\n >>> bf('Jupiter', 'Neptune')\n ('Saturn', 'Uranus')\n >>> bf('Earth', 'Mercury')\n 'Venus'\n >>> bf('Mercury', 'Uranus')\n ('Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn')\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('Jupiter', 'Neptune') == ('Saturn', 'Uranus')\n assert candidate('Earth', 'Mercury') == ('Venus',)\n assert candidate('Mercury', 'Uranus') == ('Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn')\n assert candidate('Neptune', 'Venus') == ('Earth', 'Mars', 'Jupiter', 'Saturn', 'Uranus')\n assert candidate('Earth', 'Earth') == ()\n assert candidate('Mars', 'Earth') == ()\n assert candidate('Jupiter', 'Makemake') == ()\n\ndef test_check():\n check(bf)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "py", - "prompt": "from typing import List, Optional\n\ndef next_smallest(lst: List[int]) -> Optional[int]:\n \"\"\"\n You are given a list of integers.\n Write a function next_smallest() that returns the 2nd smallest element of the list.\n Return None if there is no such element.\n >>> next_smallest([1, 2, 3, 4, 5])\n 2\n >>> next_smallest([5, 1, 4, 3, 2])\n 2\n >>> next_smallest([])\n None\n >>> next_smallest([1, 1])\n None\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([1, 2, 3, 4, 5]) == 2\n assert candidate([5, 1, 4, 3, 2]) == 2\n assert candidate([]) == None\n assert candidate([1, 1]) == None\n assert candidate([1, 1, 1, 1, 0]) == 1\n assert candidate([1, 1]) == None\n assert candidate([-35, 34, 12, -45]) == -35\n\ndef test_check():\n check(next_smallest)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "py", - "prompt": "def sort_numbers(numbers: str) -> str:\n \"\"\" Input is a space-delimited string of numberals from 'zero' to 'nine'.\n Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n Return the string with numbers sorted from smallest to largest\n >>> sort_numbers('three one five')\n 'one three five'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('') == ''\n assert candidate('three') == 'three'\n assert candidate('three five nine') == 'three five nine'\n assert candidate('five zero four seven nine eight') == 'zero four five seven eight nine'\n assert candidate('six five four three two one zero') == 'zero one two three four five six'\n\ndef test_check():\n check(sort_numbers)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "py", - "prompt": "def cycpattern_check(a: str, b: str) -> bool:\n \"\"\"You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n >>> cycpattern_check('abcd', 'abd')\n False\n >>> cycpattern_check('hello', 'ell')\n True\n >>> cycpattern_check('whassup', 'psus')\n False\n >>> cycpattern_check('abab', 'baa')\n True\n >>> cycpattern_check('efef', 'eeff')\n False\n >>> cycpattern_check('himenss', 'simen')\n True\n\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('xyzw', 'xyw') == False\n assert candidate('yello', 'ell') == True\n assert candidate('whattup', 'ptut') == False\n assert candidate('efef', 'fee') == True\n assert candidate('abab', 'aabb') == False\n assert candidate('winemtt', 'tinem') == True\n\ndef test_check():\n check(cycpattern_check)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "py", - "prompt": "def decimal_to_binary(decimal: int) -> str:\n \"\"\"You will be given a number in decimal form and your task is to convert it to\n binary format. The function should return a string, with each character representing a binary\n number. Each character in the string will be '0' or '1'.\n\n There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n The extra characters are there to help with the format.\n\n Examples:\n >>> decimal_to_binary(15)\n 'db1111db'\n >>> decimal_to_binary(32)\n 'db100000db'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(0) == 'db0db'\n assert candidate(32) == 'db100000db'\n assert candidate(103) == 'db1100111db'\n assert candidate(15) == 'db1111db'\n\ndef test_check():\n check(decimal_to_binary)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "py", - "prompt": "from typing import List\n\ndef filter_by_substring(strings: List[str], substring: str) -> List[str]:\n \"\"\" Filter an input list of strings only for ones that contain given substring\n >>> filter_by_substring([], 'a')\n []\n >>> filter_by_substring(['abc', 'bacd', 'cde', 'array'], 'a')\n ['abc', 'bacd', 'array']\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([], 'john') == []\n assert candidate(['xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'], 'xxx') == ['xxx', 'xxxAAA', 'xxx']\n assert candidate(['xxx', 'asd', 'aaaxxy', 'john doe', 'xxxAAA', 'xxx'], 'xx') == ['xxx', 'aaaxxy', 'xxxAAA', 'xxx']\n assert candidate(['grunt', 'trumpet', 'prune', 'gruesome'], 'run') == ['grunt', 'prune']\n\ndef test_check():\n check(filter_by_substring)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "py", - "prompt": "from typing import Tuple\n\ndef even_odd_count(num: int) -> Tuple[int, int]:\n \"\"\"Given an integer. return a tuple that has the number of even and odd digits respectively.\n\n Example:\n >>> even_odd_count(-12)\n (1, 1)\n >>> even_odd_count(123)\n (1, 2)\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(7) == (0, 1)\n assert candidate(-78) == (1, 1)\n assert candidate(3452) == (2, 2)\n assert candidate(346211) == (3, 3)\n assert candidate(-345821) == (3, 3)\n assert candidate(-2) == (1, 0)\n assert candidate(-45347) == (2, 3)\n assert candidate(0) == (1, 0)\n\ndef test_check():\n check(even_odd_count)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "py", - "prompt": "from typing import List\n\ndef find_max(words: List[str]) -> str:\n \"\"\"Write a function that accepts a list of strings.\n The list contains different words. Return the word with maximum number\n of unique characters. If multiple strings have maximum number of unique\n characters, return the one which comes first in lexicographical order.\n\n >>> find_max(['name', 'of', 'string'])\n 'string'\n >>> find_max(['name', 'enam', 'game'])\n 'enam'\n >>> find_max(['aaaaaaa', 'bb', 'cc'])\n 'aaaaaaa'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(['name', 'of', 'string']) == 'string'\n assert candidate(['name', 'enam', 'game']) == 'enam'\n assert candidate(['aaaaaaa', 'bb', 'cc']) == 'aaaaaaa'\n assert candidate(['abc', 'cba']) == 'abc'\n assert candidate(['play', 'this', 'game', 'of', 'footbott']) == 'footbott'\n assert candidate(['we', 'are', 'gonna', 'rock']) == 'gonna'\n assert candidate(['we', 'are', 'a', 'mad', 'nation']) == 'nation'\n assert candidate(['this', 'is', 'a', 'prrk']) == 'this'\n assert candidate(['b']) == 'b'\n assert candidate(['play', 'play', 'play']) == 'play'\n\ndef test_check():\n check(find_max)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "py", - "prompt": "def starts_one_ends(n: int) -> int:\n \"\"\"\n Given a positive integer n, return the count of the numbers of n-digit\n positive integers that start or end with 1.\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(1) == 1\n assert candidate(2) == 18\n assert candidate(3) == 180\n assert candidate(4) == 1800\n assert candidate(5) == 18000\n\ndef test_check():\n check(starts_one_ends)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "py", - "prompt": "from typing import List, Tuple, Optional\n\ndef largest_smallest_integers(lst: List[int]) -> Tuple[Optional[int], Optional[int]]:\n \"\"\"\n Create a function that returns a tuple (a, b), where 'a' is\n the largest of negative integers, and 'b' is the smallest\n of positive integers in a list.\n If there is no negative or positive integers, return them as None.\n\n Examples:\n >>> largest_smallest_integers([2, 4, 1, 3, 5, 7])\n (None, 1)\n >>> largest_smallest_integers([])\n (None, None)\n >>> largest_smallest_integers([0])\n (None, None)\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([2, 4, 1, 3, 5, 7]) == (None, 1)\n assert candidate([2, 4, 1, 3, 5, 7, 0]) == (None, 1)\n assert candidate([1, 3, 2, 4, 5, 6, -2]) == (-2, 1)\n assert candidate([4, 5, 3, 6, 2, 7, -7]) == (-7, 2)\n assert candidate([7, 3, 8, 4, 9, 2, 5, -9]) == (-9, 2)\n assert candidate([]) == (None, None)\n assert candidate([0]) == (None, None)\n assert candidate([-1, -3, -5, -6]) == (-1, None)\n assert candidate([-1, -3, -5, -6, 0]) == (-1, None)\n assert candidate([-6, -4, -4, -3, 1]) == (-3, 1)\n assert candidate([-6, -4, -4, -3, -100, 1]) == (-3, 1)\n\ndef test_check():\n check(largest_smallest_integers)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "py", - "prompt": "from typing import List\n\ndef pluck(arr: List[int]) -> List[int]:\n \"\"\"\n \"Given an array representing a branch of a tree that has non-negative integer nodes\n your task is to pluck one of the nodes and return it.\n The plucked node should be the node with the smallest even value.\n If multiple nodes with the same smallest even value are found return the node that has smallest index.\n\n The plucked node should be returned in a list, [ smalest_value, its index ],\n If there are no even values or the given array is empty, return [].\n\n Example 1:\n >>> pluck([4, 2, 3])\n [2, 1]\n Explanation: 2 has the smallest even value, and 2 has the smallest index.\n\n Example 2:\n >>> pluck([1, 2, 3])\n [2, 1]\n Explanation: 2 has the smallest even value, and 2 has the smallest index.\n\n Example 3:\n >>> pluck([])\n []\n \n Example 4:\n >>> pluck([5, 0, 3, 0, 4, 2])\n [0, 1]\n Explanation: 0 is the smallest value, but there are two zeros,\n so we will choose the first zero, which has the smallest index.\n\n Constraints:\n * 1 <= nodes.length <= 10000\n * 0 <= node.value\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([4, 2, 3]) == [2, 1]\n assert candidate([1, 2, 3]) == [2, 1]\n assert candidate([]) == []\n assert candidate([5, 0, 3, 0, 4, 2]) == [0, 1]\n assert candidate([1, 2, 3, 0, 5, 3]) == [0, 3]\n assert candidate([5, 4, 8, 4, 8]) == [4, 1]\n assert candidate([7, 6, 7, 1]) == [6, 1]\n assert candidate([7, 9, 7, 1]) == []\n\ndef test_check():\n check(pluck)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "py", - "prompt": "from typing import List\n\ndef count_nums(arr: List[int]) -> int:\n \"\"\"\n Write a function count_nums which takes an array of integers and returns\n the number of elements which has a sum of digits > 0.\n If a number is negative, then its first signed digit will be negative:\n e.g. -123 has signed digits -1, 2, and 3.\n >>> count_nums([])\n 0\n >>> count_nums([-1, 11, -11])\n 1\n >>> count_nums([1, 1, 2])\n 3\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([]) == 0\n assert candidate([-1, -2, 0]) == 0\n assert candidate([1, 1, 2, -2, 3, 4, 5]) == 6\n assert candidate([1, 6, 9, -6, 0, 1, 5]) == 5\n assert candidate([1, 100, 98, -7, 1, -1]) == 4\n assert candidate([12, 23, 34, -45, -56, 0]) == 5\n assert candidate([0, 1]) == 1\n assert candidate([1]) == 1\n\ndef test_check():\n check(count_nums)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "py", - "prompt": "from typing import List\n\ndef minPath(grid: List[List[int]], k: int) -> List[int]:\n \"\"\"\n Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n each cell of the grid contains a value. Every integer in the range [1, N * N]\n inclusive appears exactly once on the cells of the grid.\n\n You have to find the minimum path of length k in the grid. You can start\n from any cell, and in each step you can move to any of the neighbor cells,\n in other words, you can go to cells which share an edge with you current\n cell.\n Please note that a path of length k means visiting exactly k cells (not\n necessarily distinct).\n You CANNOT go off the grid.\n A path A (of length k) is considered less than a path B (of length k) if\n after making the ordered lists of the values on the cells that A and B go\n through (let's call them lst_A and lst_B), lst_A is lexicographically less\n than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n lst_A[j] = lst_B[j].\n It is guaranteed that the answer is unique.\n Return an ordered list of the values on the cells that the minimum path go through.\n\n Examples: \n >>> minPath([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3)\n [1, 2, 1]\n\n >>> minPath([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1)\n [1]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3) == [1, 2, 1]\n assert candidate([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1) == [1]\n assert candidate([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], 4) == [1, 2, 1, 2]\n assert candidate([[6, 4, 13, 10], [5, 7, 12, 1], [3, 16, 11, 15], [8, 14, 9, 2]], 7) == [1, 10, 1, 10, 1, 10, 1]\n assert candidate([[8, 14, 9, 2], [6, 4, 13, 15], [5, 7, 1, 12], [3, 10, 11, 16]], 5) == [1, 7, 1, 7, 1]\n assert candidate([[11, 8, 7, 2], [5, 16, 14, 4], [9, 3, 15, 6], [12, 13, 10, 1]], 9) == [1, 6, 1, 6, 1, 6, 1, 6, 1]\n assert candidate([[12, 13, 10, 1], [9, 3, 15, 6], [5, 16, 14, 4], [11, 8, 7, 2]], 12) == [1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6]\n assert candidate([[2, 7, 4], [3, 1, 5], [6, 8, 9]], 8) == [1, 3, 1, 3, 1, 3, 1, 3]\n assert candidate([[6, 1, 5], [3, 8, 9], [2, 7, 4]], 8) == [1, 5, 1, 5, 1, 5, 1, 5]\n assert candidate([[1, 2], [3, 4]], 10) == [1, 2, 1, 2, 1, 2, 1, 2, 1, 2]\n assert candidate([[1, 3], [3, 2]], 10) == [1, 3, 1, 3, 1, 3, 1, 3, 1, 3]\n\ndef test_check():\n check(minPath)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "py", - "prompt": "from typing import List\n\ndef strange_sort_list(lst: List[int]) -> List[int]:\n \"\"\"\n Given list of integers, return list in strange order.\n Strange sorting, is when you start with the minimum value,\n then maximum of the remaining integers, then minimum and so on.\n\n Examples:\n >>> strange_sort_list([1, 2, 3, 4])\n [1, 4, 2, 3]\n >>> strange_sort_list([5, 5, 5, 5])\n [5, 5, 5, 5]\n >>> strange_sort_list([])\n []\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([1, 2, 3, 4]) == [1, 4, 2, 3]\n assert candidate([5, 6, 7, 8, 9]) == [5, 9, 6, 8, 7]\n assert candidate([1, 2, 3, 4, 5]) == [1, 5, 2, 4, 3]\n assert candidate([5, 6, 7, 8, 9, 1]) == [1, 9, 5, 8, 6, 7]\n assert candidate([5, 5, 5, 5]) == [5, 5, 5, 5]\n assert candidate([]) == []\n assert candidate([1, 2, 3, 4, 5, 6, 7, 8]) == [1, 8, 2, 7, 3, 6, 4, 5]\n assert candidate([0, 2, 2, 2, 5, 5, -5, -5]) == [-5, 5, -5, 5, 0, 2, 2, 2]\n assert candidate([111111]) == [111111]\n\ndef test_check():\n check(strange_sort_list)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "py", - "prompt": "from typing import Optional\n\ndef string_to_md5(text: str) -> Optional[str]:\n \"\"\"\n Given a string 'text', return its md5 hash equivalent string.\n If 'text' is an empty string, return None.\n\n >>> string_to_md5('Hello world')\n '3e25960a79dbc69b674cd4ec67a72c62'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'\n assert candidate('') == None\n assert candidate('A B C') == '0ef78513b0cb8cef12743f5aeb35f888'\n assert candidate('password') == '5f4dcc3b5aa765d61d8327deb882cf99'\n\ndef test_check():\n check(string_to_md5)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "py", - "prompt": "def get_closest_vowel(word: str) -> str:\n \"\"\"You are given a word. Your task is to find the closest vowel that stands between \n two consonants from the right side of the word (case sensitive).\n \n Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n find any vowel met the above condition. \n\n You may assume that the given string contains English letter only.\n\n Example:\n >>> get_closest_vowel('yogurt')\n 'u'\n >>> get_closest_vowel('FULL')\n 'U'\n >>> get_closest_vowel('quick')\n ''\n >>> get_closest_vowel('ab')\n ''\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('yogurt') == 'u'\n assert candidate('full') == 'u'\n assert candidate('easy') == ''\n assert candidate('eAsy') == ''\n assert candidate('ali') == ''\n assert candidate('bad') == 'a'\n assert candidate('most') == 'o'\n assert candidate('ab') == ''\n assert candidate('ba') == ''\n assert candidate('quick') == ''\n assert candidate('anime') == 'i'\n assert candidate('Asia') == ''\n assert candidate('Above') == 'o'\n\ndef test_check():\n check(get_closest_vowel)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "py", - "prompt": "def change_base(x: int, base: int) -> str:\n \"\"\"Change numerical base of input number x to base.\n return string representation after the conversion.\n base numbers are less than 10.\n >>> change_base(8, 3)\n '22'\n >>> change_base(8, 2)\n '1000'\n >>> change_base(7, 2)\n '111'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(8, 3) == '22'\n assert candidate(9, 3) == '100'\n assert candidate(234, 2) == '11101010'\n assert candidate(16, 2) == '10000'\n assert candidate(8, 2) == '1000'\n assert candidate(7, 2) == '111'\n assert candidate(2, 3) == '2'\n assert candidate(3, 4) == '3'\n assert candidate(4, 5) == '4'\n assert candidate(5, 6) == '5'\n assert candidate(6, 7) == '6'\n assert candidate(7, 8) == '7'\n\ndef test_check():\n check(change_base)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "py", - "prompt": "from typing import List\n\ndef has_close_elements(numbers: List[float], threshold: float) -> bool:\n \"\"\" Check if in given list of numbers, are any two numbers closer to each other than\n given threshold.\n >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n False\n >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n True\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3) == True\n assert candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05) == False\n assert candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.95) == True\n assert candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.8) == False\n assert candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1) == True\n assert candidate([1.1, 2.2, 3.1, 4.1, 5.1], 1.0) == True\n assert candidate([1.1, 2.2, 3.1, 4.1, 5.1], 0.5) == False\n\ndef test_check():\n check(has_close_elements)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "py", - "prompt": "def is_nested(string: str) -> bool:\n \"\"\"\n Create a function that takes a string as input which contains only square brackets.\n The function should return True if and only if there is a valid subsequence of brackets \n where at least one bracket in the subsequence is nested.\n\n >>> is_nested('[[]]')\n True\n >>> is_nested('[]]]]]]][[[[[]')\n False\n >>> is_nested('[][]')\n False\n >>> is_nested('[]')\n False\n >>> is_nested('[[][]]')\n True\n >>> is_nested('[[]][[')\n True\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('[[]]') == True\n assert candidate('[]]]]]]][[[[[]') == False\n assert candidate('[][]') == False\n assert candidate('[]') == False\n assert candidate('[[[[]]]]') == True\n assert candidate('[]]]]]]]]]]') == False\n assert candidate('[][][[]]') == True\n assert candidate('[[]') == False\n assert candidate('[]]') == False\n assert candidate('[[]][[') == True\n assert candidate('[[][]]') == True\n assert candidate('') == False\n assert candidate('[[[[[[[[') == False\n assert candidate(']]]]]]]]') == False\n\ndef test_check():\n check(is_nested)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "py", - "prompt": "from typing import List\n\ndef concatenate(strings: List[str]) -> str:\n \"\"\" Concatenate list of strings into a single string\n >>> concatenate([])\n ''\n >>> concatenate(['a', 'b', 'c'])\n 'abc'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([]) == ''\n assert candidate(['x', 'y', 'z']) == 'xyz'\n assert candidate(['x', 'y', 'z', 'w', 'k']) == 'xyzwk'\n\ndef test_check():\n check(concatenate)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "py", - "prompt": "def prime_fib(n: int) -> int:\n \"\"\"\n prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n >>> prime_fib(1)\n 2\n >>> prime_fib(2)\n 3\n >>> prime_fib(3)\n 5\n >>> prime_fib(4)\n 13\n >>> prime_fib(5)\n 89\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(1) == 2\n assert candidate(2) == 3\n assert candidate(3) == 5\n assert candidate(4) == 13\n assert candidate(5) == 89\n assert candidate(6) == 233\n assert candidate(7) == 1597\n assert candidate(8) == 28657\n assert candidate(9) == 514229\n assert candidate(10) == 433494437\n\ndef test_check():\n check(prime_fib)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "py", - "prompt": "from typing import List, Tuple\n\ndef find_closest_elements(numbers: List[float]) -> Tuple[float, float]:\n \"\"\" From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n other and return them in order (smaller number, larger number).\n >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n (2.0, 2.2)\n >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n (2.0, 2.0)\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2]) == (3.9, 4.0)\n assert candidate([1.0, 2.0, 5.9, 4.0, 5.0]) == (5.0, 5.9)\n assert candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]) == (2.0, 2.2)\n assert candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]) == (2.0, 2.0)\n assert candidate([1.1, 2.2, 3.1, 4.1, 5.1]) == (2.2, 3.1)\n\ndef test_check():\n check(find_closest_elements)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "py", - "prompt": "def hex_key(num: str) -> int:\n \"\"\"You have been tasked to write a function that receives \n a hexadecimal number as a string and counts the number of hexadecimal \n digits that are primes (prime number, or a prime, is a natural number \n greater than 1 that is not a product of two smaller natural numbers).\n Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n So you have to determine a number of the following digits: 2, 3, 5, 7, \n B (=decimal 11), D (=decimal 13).\n Note: you may assume the input is always correct or empty string, \n and symbols A,B,C,D,E,F are always uppercase.\n Examples:\n >>> hex_key('AB')\n 1\n >>> hex_key('1077E')\n 2\n >>> hex_key('ABED1A33')\n 4\n >>> hex_key('123456789ABCDEF0')\n 6\n >>> hex_key('2020')\n 2\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('AB') == 1\n assert candidate('1077E') == 2\n assert candidate('ABED1A33') == 4\n assert candidate('2020') == 2\n assert candidate('123456789ABCDEF0') == 6\n assert candidate('112233445566778899AABBCCDDEEFF00') == 12\n\ndef test_check():\n check(hex_key)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "py", - "prompt": "def multiply(a: int, b: int) -> int:\n \"\"\"Complete the function that takes two integers and returns \n the product of their unit digits.\n Assume the input is always valid.\n Examples:\n >>> multiply(148, 412)\n 16\n >>> multiply(19, 28)\n 72\n >>> multiply(2020, 1851)\n 0\n >>> multiply(14, -15)\n 20\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(148, 412) == 16\n assert candidate(19, 28) == 72\n assert candidate(2020, 1851) == 0\n assert candidate(14, -15) == 20\n assert candidate(76, 67) == 42\n assert candidate(17, 27) == 49\n assert candidate(0, 1) == 0\n assert candidate(0, 0) == 0\n\ndef test_check():\n check(multiply)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "py", - "prompt": "from typing import List\n\ndef rescale_to_unit(numbers: List[float]) -> List[float]:\n \"\"\" Given list of numbers (of at least two elements), apply a linear transform to that list,\n such that the smallest number will become 0 and the largest will become 1\n >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n [0.0, 0.25, 0.5, 0.75, 1.0]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([2.0, 49.9]) == [0.0, 1.0]\n assert candidate([100.0, 49.9]) == [1.0, 0.0]\n assert candidate([1.0, 2.0, 3.0, 4.0, 5.0]) == [0.0, 0.25, 0.5, 0.75, 1.0]\n assert candidate([2.0, 1.0, 5.0, 3.0, 4.0]) == [0.25, 0.0, 1.0, 0.5, 0.75]\n assert candidate([12.0, 11.0, 15.0, 13.0, 14.0]) == [0.25, 0.0, 1.0, 0.5, 0.75]\n\ndef test_check():\n check(rescale_to_unit)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "py", - "prompt": "def digits(n: int) -> int:\n \"\"\"Given a positive integer n, return the product of the odd digits.\n Return 0 if all digits are even.\n For example:\n >>> digits(1)\n 1\n >>> digits(4)\n 0\n >>> digits(235)\n 15\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(5) == 5\n assert candidate(54) == 5\n assert candidate(120) == 1\n assert candidate(5014) == 5\n assert candidate(98765) == 315\n assert candidate(5576543) == 2625\n assert candidate(2468) == 0\n\ndef test_check():\n check(digits)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "py", - "prompt": "from typing import List\n\ndef Strongest_Extension(class_name: str, extensions: List[str]) -> str:\n \"\"\"You will be given the name of a class (a string) and a list of extensions.\n The extensions are to be used to load additional classes to the class. The\n strength of the extension is as follows: Let CAP be the number of the uppercase\n letters in the extension's name, and let SM be the number of lowercase letters \n in the extension's name, the strength is given by the fraction CAP - SM. \n You should find the strongest extension and return a string in this \n format: ClassName.StrongestExtensionName.\n If there are two or more extensions with the same strength, you should\n choose the one that comes first in the list.\n For example, if you are given \"Slices\" as the class and a list of the\n extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n (its strength is -1).\n Example:\n >>> Strongest_Extension('my_class', ['AA', 'Be', 'CC'])\n 'my_class.AA'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('Watashi', ['tEN', 'niNE', 'eIGHt8OKe']) == 'Watashi.eIGHt8OKe'\n assert candidate('Boku123', ['nani', 'NazeDa', 'YEs.WeCaNe', '32145tggg']) == 'Boku123.YEs.WeCaNe'\n assert candidate('__YESIMHERE', ['t', 'eMptY', 'nothing', 'zeR00', 'NuLl__', '123NoooneB321']) == '__YESIMHERE.NuLl__'\n assert candidate('K', ['Ta', 'TAR', 't234An', 'cosSo']) == 'K.TAR'\n assert candidate('__HAHA', ['Tab', '123', '781345', '-_-']) == '__HAHA.123'\n assert candidate('YameRore', ['HhAas', 'okIWILL123', 'WorkOut', 'Fails', '-_-']) == 'YameRore.okIWILL123'\n assert candidate('finNNalLLly', ['Die', 'NowW', 'Wow', 'WoW']) == 'finNNalLLly.WoW'\n assert candidate('_', ['Bb', '91245']) == '_.Bb'\n assert candidate('Sp', ['671235', 'Bb']) == 'Sp.671235'\n\ndef test_check():\n check(Strongest_Extension)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "py", - "prompt": "from typing import Dict\n\ndef histogram(test: str) -> Dict[str, int]:\n \"\"\"Given a string representing a space separated lowercase letters, return a dictionary\n of the letter with the most repetition and containing the corresponding count.\n If several letters have the same occurrence, return all of them.\n \n Example:\n >>> histogram('a b c')\n { 'a': 1, 'b': 1, 'c': 1 }\n >>> histogram('a b b a')\n { 'a': 2, 'b': 2 }\n >>> histogram('a b c a b')\n { 'a': 2, 'b': 2 }\n >>> histogram('b b b b a')\n { 'b': 4 }\n >>> histogram('')\n { }\n\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('a b b a') == { 'a': 2, 'b': 2 }\n assert candidate('a b c a b') == { 'a': 2, 'b': 2 }\n assert candidate('a b c d g') == { 'a': 1, 'b': 1, 'c': 1, 'd': 1, 'g': 1 }\n assert candidate('r t g') == { 'r': 1, 't': 1, 'g': 1 }\n assert candidate('b b b b a') == { 'b': 4 }\n assert candidate('r t g') == { 'r': 1, 't': 1, 'g': 1 }\n assert candidate('') == { }\n assert candidate('a') == { 'a': 1 }\n\ndef test_check():\n check(histogram)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "py", - "prompt": "from typing import List\n\ndef pairs_sum_to_zero(l: List[int]) -> bool:\n \"\"\"\n pairs_sum_to_zero takes a list of integers as an input.\n it returns True if there are two distinct elements in the list that\n sum to zero, and False otherwise.\n >>> pairs_sum_to_zero([1, 3, 5, 0])\n False\n >>> pairs_sum_to_zero([1, 3, -2, 1])\n False\n >>> pairs_sum_to_zero([1, 2, 3, 7])\n False\n >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7])\n True\n >>> pairs_sum_to_zero([1])\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([1, 3, 5, 0]) == False\n assert candidate([1, 3, -2, 1]) == False\n assert candidate([1, 2, 3, 7]) == False\n assert candidate([2, 4, -5, 3, 5, 7]) == True\n assert candidate([1]) == False\n assert candidate([-3, 9, -1, 3, 2, 30]) == True\n assert candidate([-3, 9, -1, 3, 2, 31]) == True\n assert candidate([-3, 9, -1, 4, 2, 30]) == False\n assert candidate([-3, 9, -1, 4, 2, 31]) == False\n\ndef test_check():\n check(pairs_sum_to_zero)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "py", - "prompt": "from typing import List\n\ndef total_match(lst1: List[str], lst2: List[str]) -> List[str]:\n \"\"\"\n Write a function that accepts two lists of strings and returns the list that has \n total number of chars in the all strings of the list less than the other list.\n\n if the two lists have the same number of chars, return the first list.\n\n Examples\n >>> total_match([], [])\n []\n >>> total_match(['hi', 'admin'], ['hI', 'Hi'])\n ['hI', 'Hi']\n >>> total_match(['hi', 'admin'], ['hi', 'hi', 'admin', 'project'])\n ['hi', 'admin']\n >>> total_match(['hi', 'admin'], ['hI', 'hi', 'hi'])\n ['hI', 'hi', 'hi']\n >>> total_match(['4'], ['1', '2', '3', '4', '5'])\n ['4']\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([], []) == []\n assert candidate(['hi', 'admin'], ['hi', 'hi']) == ['hi', 'hi']\n assert candidate(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) == ['hi', 'admin']\n assert candidate(['4'], ['1', '2', '3', '4', '5']) == ['4']\n assert candidate(['hi', 'admin'], ['hI', 'Hi']) == ['hI', 'Hi']\n assert candidate(['hi', 'admin'], ['hI', 'hi', 'hi']) == ['hI', 'hi', 'hi']\n assert candidate(['hi', 'admin'], ['hI', 'hi', 'hii']) == ['hi', 'admin']\n assert candidate([], ['this']) == []\n assert candidate(['this'], []) == []\n\ndef test_check():\n check(total_match)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "py", - "prompt": "def circular_shift(x: int, shift: int) -> str:\n \"\"\"Circular shift the digits of the integer x, shift the digits right by shift\n and return the result as a string.\n If shift > number of digits, return digits reversed.\n >>> circular_shift(12, 1)\n '21'\n >>> circular_shift(12, 2)\n '12'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(100, 2) == '001'\n assert candidate(12, 2) == '12'\n assert candidate(97, 8) == '79'\n assert candidate(12, 1) == '21'\n assert candidate(11, 101) == '11'\n\ndef test_check():\n check(circular_shift)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "py", - "prompt": "from typing import List\n\ndef monotonic(l: List[int]) -> bool:\n \"\"\"Return True is list elements are monotonically increasing or decreasing.\n >>> monotonic([1, 2, 4, 20])\n True\n >>> monotonic([1, 20, 4, 10])\n False\n >>> monotonic([4, 1, 0, -10])\n True\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([1, 2, 4, 10]) == True\n assert candidate([1, 2, 4, 20]) == True\n assert candidate([1, 20, 4, 10]) == False\n assert candidate([4, 1, 0, -10]) == True\n assert candidate([4, 1, 1, 0]) == True\n assert candidate([1, 2, 3, 2, 5, 60]) == False\n assert candidate([1, 2, 3, 4, 5, 60]) == True\n assert candidate([9, 9, 9, 9]) == True\n\ndef test_check():\n check(monotonic)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "py", - "prompt": "def is_equal_to_sum_even(n: int) -> bool:\n \"\"\"Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n Example\n >>> is_equal_to_sum_even(4)\n False\n >>> is_equal_to_sum_even(6)\n False\n >>> is_equal_to_sum_even(8)\n True\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(4) == False\n assert candidate(6) == False\n assert candidate(8) == True\n assert candidate(10) == True\n assert candidate(11) == False\n assert candidate(12) == True\n assert candidate(13) == False\n assert candidate(16) == True\n\ndef test_check():\n check(is_equal_to_sum_even)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "py", - "prompt": "from typing import List\n\ndef parse_music(music_string: str) -> List[int]:\n \"\"\" Input to this function is a string representing musical notes in a special ASCII format.\n Your task is to parse this string and return list of integers corresponding to how many beats does each\n not last.\n\n Here is a legend:\n 'o' - whole note, lasts four beats\n 'o|' - half note, lasts two beats\n '.|' - quater note, lasts one beat\n\n >>> parse_music('o o| .| o| o| .| .| .| .| o o')\n [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('') == []\n assert candidate('o o o o') == [4, 4, 4, 4]\n assert candidate('.| .| .| .|') == [1, 1, 1, 1]\n assert candidate('o| o| .| .| o o o o') == [2, 2, 1, 1, 4, 4, 4, 4]\n assert candidate('o| .| o| .| o o| o o|') == [2, 1, 2, 1, 4, 2, 4, 2]\n\ndef test_check():\n check(parse_music)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "py", - "prompt": "from typing import List\n\ndef sum_squares(lst: List[int]) -> int:\n \"\"\"\"\n This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n \n Examples:\n >>> lst\n [1, 2, 3]\n >>> lst\n []\n >>> lst\n [-1, -5, 2, -1, -5]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([1, 2, 3]) == 6\n assert candidate([1, 4, 9]) == 14\n assert candidate([]) == 0\n assert candidate([1, 1, 1, 1, 1, 1, 1, 1, 1]) == 9\n assert candidate([-1, -1, -1, -1, -1, -1, -1, -1, -1]) == -3\n assert candidate([0]) == 0\n assert candidate([-1, -5, 2, -1, -5]) == -126\n assert candidate([-56, -99, 1, 0, -2]) == 3030\n assert candidate([-1, 0, 0, 0, 0, 0, 0, 0, -1]) == 0\n assert candidate([-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37]) == -14196\n assert candidate([-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10]) == -1448\n\ndef test_check():\n check(sum_squares)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "py", - "prompt": "from typing import List\n\ndef triples_sum_to_zero(l: List[int]) -> bool:\n \"\"\"\n triples_sum_to_zero takes a list of integers as an input.\n it returns True if there are three distinct elements in the list that\n sum to zero, and False otherwise.\n\n >>> triples_sum_to_zero([1, 3, 5, 0])\n False\n >>> triples_sum_to_zero([1, 3, -2, 1])\n True\n >>> triples_sum_to_zero([1, 2, 3, 7])\n False\n >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n True\n >>> triples_sum_to_zero([1])\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([1, 3, 5, 0]) == False\n assert candidate([1, 3, 5, -1]) == False\n assert candidate([1, 3, -2, 1]) == True\n assert candidate([1, 2, 3, 7]) == False\n assert candidate([1, 2, 5, 7]) == False\n assert candidate([2, 4, -5, 3, 9, 7]) == True\n assert candidate([1]) == False\n assert candidate([1, 3, 5, -100]) == False\n assert candidate([100, 3, 5, -100]) == False\n\ndef test_check():\n check(triples_sum_to_zero)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "py", - "prompt": "def correct_bracketing(brackets: str) -> bool:\n \"\"\" brackets is a string of \"<\" and \">\".\n return True if every opening bracket has a corresponding closing bracket.\n\n >>> correct_bracketing('<')\n False\n >>> correct_bracketing('<>')\n True\n >>> correct_bracketing('<<><>>')\n True\n >>> correct_bracketing('><<>')\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('<>') == True\n assert candidate('<<><>>') == True\n assert candidate('<><><<><>><>') == True\n assert candidate('<><><<<><><>><>><<><><<>>>') == True\n assert candidate('<<<><>>>>') == False\n assert candidate('><<>') == False\n assert candidate('<') == False\n assert candidate('<<<<') == False\n assert candidate('>') == False\n assert candidate('<<>') == False\n assert candidate('<><><<><>><>><<>') == False\n assert candidate('<><><<><>><>>><>') == False\n\ndef test_check():\n check(correct_bracketing)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "py", - "prompt": "from typing import List\n\ndef specialFilter(nums: List[int]) -> int:\n \"\"\"Write a function that takes an array of numbers as input and returns \n the number of elements in the array that are greater than 10 and both \n first and last digits of a number are odd (1, 3, 5, 7, 9).\n For example:\n >>> specialFilter([15, -73, 14, -15])\n 1\n >>> specialFilter([33, -2, -3, 45, 21, 109])\n 2\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([5, -2, 1, -5]) == 0\n assert candidate([15, -73, 14, -15]) == 1\n assert candidate([33, -2, -3, 45, 21, 109]) == 2\n assert candidate([43, -12, 93, 125, 121, 109]) == 4\n assert candidate([71, -2, -33, 75, 21, 19]) == 3\n assert candidate([1]) == 0\n assert candidate([]) == 0\n\ndef test_check():\n check(specialFilter)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "py", - "prompt": "from typing import Dict\n\ndef check_dict_case(dict: Dict[str, str]) -> bool:\n \"\"\"\n Given a dictionary, return True if all keys are strings in lower \n case or all keys are strings in upper case, else return False.\n The function should return False is the given dictionary is empty.\n Examples:\n >>> check_dict_case({ 'a': 'apple', 'b': 'banana' })\n True\n >>> check_dict_case({ 'a': 'apple', 'A': 'banana', 'B': 'banana' })\n False\n >>> check_dict_case({ 'a': 'apple', 8: 'banana', 'a': 'apple' })\n False\n >>> check_dict_case({ 'Name': 'John', 'Age': '36', 'City': 'Houston' })\n False\n >>> check_dict_case({ 'STATE': 'NC', 'ZIP': '12345' })\n True\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate({ 'p': 'pineapple', 'b': 'banana' }) == True\n assert candidate({ 'p': 'pineapple', 'A': 'banana', 'B': 'banana' }) == False\n assert candidate({ 'p': 'pineapple', '5': 'banana', 'a': 'apple' }) == False\n assert candidate({ 'Name': 'John', 'Age': '36', 'City': 'Houston' }) == False\n assert candidate({ 'STATE': 'NC', 'ZIP': '12345' }) == True\n assert candidate({ 'fruit': 'Orange', 'taste': 'Sweet' }) == True\n assert candidate({ }) == False\n\ndef test_check():\n check(check_dict_case)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "py", - "prompt": "from typing import Union, List\n\ndef split_words(txt: str) -> Union[List[str], int]:\n \"\"\"\n Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n Examples\n >>> split_words('Hello world!')\n ['Hello', 'world!']\n >>> split_words('Hello,world!')\n ['Hello', 'world!']\n >>> split_words('abcdef')\n 3\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('Hello world!') == ['Hello', 'world!']\n assert candidate('Hello,world!') == ['Hello', 'world!']\n assert candidate('Hello world,!') == ['Hello', 'world,!']\n assert candidate('Hello,Hello,world !') == ['Hello,Hello,world', '!']\n assert candidate('abcdef') == 3\n assert candidate('aaabb') == 2\n assert candidate('aaaBb') == 1\n assert candidate('') == 0\n\ndef test_check():\n check(split_words)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "py", - "prompt": "def fibfib(n: int) -> int:\n \"\"\"The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fibfib(0) == 0\n fibfib(1) == 0\n fibfib(2) == 1\n fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n >>> fibfib(1)\n 0\n >>> fibfib(5)\n 4\n >>> fibfib(8)\n 24\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(2) == 1\n assert candidate(1) == 0\n assert candidate(5) == 4\n assert candidate(8) == 24\n assert candidate(10) == 81\n assert candidate(12) == 274\n assert candidate(14) == 927\n\ndef test_check():\n check(fibfib)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "py", - "prompt": "from typing import List\n\ndef sum_squares(lst: List[float]) -> int:\n \"\"\"You are given a list of numbers.\n You need to return the sum of squared numbers in the given list,\n round each element in the list to the upper int(Ceiling) first.\n Examples:\n >>> lst([1.0, 2.0, 3.0])\n 14\n >>> lst([1.0, 4.0, 9.0])\n 98\n >>> lst([1.0, 3.0, 5.0, 7.0])\n 84\n >>> lst([1.4, 4.2, 0.0])\n 29\n >>> lst([-2.4, 1.0, 1.0])\n 6\n \n\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([1.0, 2.0, 3.0]) == 14\n assert candidate([1.0, 2.0, 3.0]) == 14\n assert candidate([1.0, 3.0, 5.0, 7.0]) == 84\n assert candidate([1.4, 4.2, 0.0]) == 29\n assert candidate([-2.4, 1.0, 1.0]) == 6\n assert candidate([100.0, 1.0, 15.0, 2.0]) == 10230\n assert candidate([10000.0, 10000.0]) == 200000000\n assert candidate([-1.4, 4.6, 6.3]) == 75\n assert candidate([-1.4, 17.9, 18.9, 19.9]) == 1086\n assert candidate([0.0]) == 0\n assert candidate([-1.0]) == 1\n assert candidate([-1.0, 1.0, 0.0]) == 2\n\ndef test_check():\n check(sum_squares)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_85_add", - "language": "py", - "prompt": "from typing import List\n\ndef add(lst: List[int]) -> int:\n \"\"\"Given a non-empty list of integers lst. add the even elements that are at odd indices..\n\n\n Examples:\n >>> add([4, 2, 6, 7])\n 2\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([4, 88]) == 88\n assert candidate([4, 5, 6, 7, 2, 122]) == 122\n assert candidate([4, 0, 6, 7]) == 0\n assert candidate([4, 4, 6, 8]) == 12\n\ndef test_check():\n check(add)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "py", - "prompt": "from typing import List\n\ndef unique(l: List[int]) -> List[int]:\n \"\"\"Return sorted unique elements in a list\n >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123])\n [0, 2, 3, 5, 9, 123]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([5, 3, 5, 2, 3, 3, 9, 0, 123]) == [0, 2, 3, 5, 9, 123]\n\ndef test_check():\n check(unique)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "py", - "prompt": "def fix_spaces(text: str) -> str:\n \"\"\"\n Given a string text, replace all spaces in it with underscores, \n and if a string has more than 2 consecutive spaces, \n then replace all consecutive spaces with - \n \n >>> fix_spaces(' Example')\n 'Example'\n >>> fix_spaces(' Example 1')\n 'Example_1'\n >>> fix_spaces(' Example 2')\n '_Example_2'\n >>> fix_spaces(' Example 3')\n '_Example-3'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('Example') == 'Example'\n assert candidate('Mudasir Hanif ') == 'Mudasir_Hanif_'\n assert candidate('Yellow Yellow Dirty Fellow') == 'Yellow_Yellow__Dirty__Fellow'\n assert candidate('Exa mple') == 'Exa-mple'\n assert candidate(' Exa 1 2 2 mple') == '-Exa_1_2_2_mple'\n\ndef test_check():\n check(fix_spaces)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "py", - "prompt": "def modp(n: int, p: int) -> int:\n \"\"\"Return 2^n modulo p (be aware of numerics).\n >>> modp(3, 5)\n 3\n >>> modp(1101, 101)\n 2\n >>> modp(0, 101)\n 1\n >>> modp(3, 11)\n 8\n >>> modp(100, 101)\n 1\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(3, 5) == 3\n assert candidate(1101, 101) == 2\n assert candidate(0, 101) == 1\n assert candidate(3, 11) == 8\n assert candidate(100, 101) == 1\n assert candidate(30, 5) == 4\n assert candidate(31, 5) == 3\n\ndef test_check():\n check(modp)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "py", - "prompt": "def valid_date(date: str) -> bool:\n \"\"\"You have to write a function which validates a given date string and\n returns True if the date is valid otherwise False.\n The date is valid if all of the following rules are satisfied:\n 1. The date string is not empty.\n 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n 3. The months should not be less than 1 or higher than 12.\n 4. The date should be in the format: mm-dd-yyyy\n\n >>> valid_date('03-11-2000')\n True\n\n >>> valid_date('15-01-2012')\n False\n\n >>> valid_date('04-0-2040')\n False\n\n >>> valid_date('06-04-2020')\n True\n\n >>> valid_date('06/04/2020')\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('03-11-2000') == True\n assert candidate('15-01-2012') == False\n assert candidate('04-0-2040') == False\n assert candidate('06-04-2020') == True\n assert candidate('01-01-2007') == True\n assert candidate('03-32-2011') == False\n assert candidate('') == False\n assert candidate('04-31-3000') == False\n assert candidate('06-06-2005') == True\n assert candidate('21-31-2000') == False\n assert candidate('04-12-2003') == True\n assert candidate('04122003') == False\n assert candidate('20030412') == False\n assert candidate('2003-04') == False\n assert candidate('2003-04-12') == False\n assert candidate('04-2003') == False\n\ndef test_check():\n check(valid_date)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "py", - "prompt": "def anti_shuffle(s: str) -> str:\n \"\"\"\n Write a function that takes a string and returns an ordered version of it.\n Ordered version of string, is a string where all words (separated by space)\n are replaced by a new word where all the characters arranged in\n ascending order based on ascii value.\n Note: You should keep the order of words and blank spaces in the sentence.\n\n For example:\n >>> anti_shuffle('Hi')\n 'Hi'\n >>> anti_shuffle('hello')\n 'ehllo'\n >>> anti_shuffle('Hello World!!!')\n 'Hello !!!Wdlor'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('Hi') == 'Hi'\n assert candidate('hello') == 'ehllo'\n assert candidate('number') == 'bemnru'\n assert candidate('abcd') == 'abcd'\n assert candidate('Hello World!!!') == 'Hello !!!Wdlor'\n assert candidate('') == ''\n assert candidate('Hi. My name is Mister Robot. How are you?') == '.Hi My aemn is Meirst .Rboot How aer ?ouy'\n\ndef test_check():\n check(anti_shuffle)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "py", - "prompt": "from typing import List\n\ndef is_sorted(lst: List[int]) -> bool:\n \"\"\"\n Given a list of numbers, return whether or not they are sorted\n in ascending order. If list has more than 1 duplicate of the same\n number, return False. Assume no negative numbers and only integers.\n\n Examples\n >>> is_sorted([5])\n True\n >>> is_sorted([1, 2, 3, 4, 5])\n True\n >>> is_sorted([1, 3, 2, 4, 5])\n False\n >>> is_sorted([1, 2, 3, 4, 5, 6])\n True\n >>> is_sorted([1, 2, 3, 4, 5, 6, 7])\n True\n >>> is_sorted([1, 3, 2, 4, 5, 6, 7])\n False\n >>> is_sorted([1, 2, 2, 3, 3, 4])\n True\n >>> is_sorted([1, 2, 2, 2, 3, 4])\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([5]) == True\n assert candidate([1, 2, 3, 4, 5]) == True\n assert candidate([1, 3, 2, 4, 5]) == False\n assert candidate([1, 2, 3, 4, 5, 6]) == True\n assert candidate([1, 2, 3, 4, 5, 6, 7]) == True\n assert candidate([1, 3, 2, 4, 5, 6, 7]) == False\n assert candidate([]) == True\n assert candidate([1]) == True\n assert candidate([3, 2, 1]) == False\n assert candidate([1, 2, 2, 2, 3, 4]) == False\n assert candidate([1, 2, 3, 3, 3, 4]) == False\n assert candidate([1, 2, 2, 3, 3, 4]) == True\n assert candidate([1, 2, 3, 4]) == True\n\ndef test_check():\n check(is_sorted)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "py", - "prompt": "def is_happy(s: str) -> bool:\n \"\"\"You are given a string s.\n Your task is to check if the string is happy or not.\n A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n For example:\n >>> is_happy('a')\n False\n >>> is_happy('aa')\n False\n >>> is_happy('abcd')\n True\n >>> is_happy('aabb')\n False\n >>> is_happy('adb')\n True\n >>> is_happy('xyy')\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('a') == False\n assert candidate('aa') == False\n assert candidate('abcd') == True\n assert candidate('aabb') == False\n assert candidate('adb') == True\n assert candidate('xyy') == False\n assert candidate('iopaxpoi') == True\n assert candidate('iopaxioi') == False\n\ndef test_check():\n check(is_happy)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "py", - "prompt": "from typing import List\n\ndef will_it_fly(q: List[int], w: int) -> bool:\n \"\"\"\n Write a function that returns True if the object q will fly, and False otherwise.\n The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n\n Example:\n >>> will_it_fly([1, 2], 5)\n False\n # 1+2 is less than the maximum possible weight, but it's unbalanced.\n\n >>> will_it_fly([3, 2, 3], 1)\n False\n # it's balanced, but 3+2+3 is more than the maximum possible weight.\n\n >>> will_it_fly([3, 2, 3], 9)\n True\n # 3+2+3 is less than the maximum possible weight, and it's balanced.\n\n >>> will_it_fly([3], 5)\n True\n # 3 is less than the maximum possible weight, and it's balanced.\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([3, 2, 3], 9) == True\n assert candidate([1, 2], 5) == False\n assert candidate([3], 5) == True\n assert candidate([3, 2, 3], 1) == False\n assert candidate([1, 2, 3], 6) == False\n assert candidate([5], 5) == True\n\ndef test_check():\n check(will_it_fly)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "py", - "prompt": "from typing import List\n\ndef sort_array(array: List[int]) -> List[int]:\n \"\"\"\n Given an array of non-negative integers, return a copy of the given array after sorting,\n you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n or sort it in descending order if the sum( first index value, last index value) is even.\n\n Note:\n * don't change the given array.\n\n Examples:\n >>> sort_array([])\n []\n >>> sort_array([5])\n [5]\n >>> sort_array([2, 4, 3, 0, 1, 5])\n [0, 1, 2, 3, 4, 5]\n >>> sort_array([2, 4, 3, 0, 1, 5, 6])\n [6, 5, 4, 3, 2, 1, 0]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([]) == []\n assert candidate([5]) == [5]\n assert candidate([2, 4, 3, 0, 1, 5]) == [0, 1, 2, 3, 4, 5]\n assert candidate([2, 4, 3, 0, 1, 5, 6]) == [6, 5, 4, 3, 2, 1, 0]\n assert candidate([2, 1]) == [1, 2]\n assert candidate([15, 42, 87, 32, 11, 0]) == [0, 11, 15, 32, 42, 87]\n assert candidate([21, 14, 23, 11]) == [23, 21, 14, 11]\n\ndef test_check():\n check(sort_array)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "py", - "prompt": "from typing import List\n\ndef count_up_to(n: int) -> List[int]:\n \"\"\"Implement a function that takes an non-negative integer and returns an array of the first n\n integers that are prime numbers and less than n.\n for example:\n >>> count_up_to(5)\n [2, 3]\n >>> count_up_to(11)\n [2, 3, 5, 7]\n >>> count_up_to(0)\n []\n >>> count_up_to(20)\n [2, 3, 5, 7, 11, 13, 17, 19]\n >>> count_up_to(1)\n []\n >>> count_up_to(18)\n [2, 3, 5, 7, 11, 13, 17]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(5) == [2, 3]\n assert candidate(6) == [2, 3, 5]\n assert candidate(7) == [2, 3, 5]\n assert candidate(10) == [2, 3, 5, 7]\n assert candidate(0) == []\n assert candidate(22) == [2, 3, 5, 7, 11, 13, 17, 19]\n assert candidate(1) == []\n assert candidate(18) == [2, 3, 5, 7, 11, 13, 17]\n assert candidate(47) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43]\n assert candidate(101) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]\n\ndef test_check():\n check(count_up_to)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "py", - "prompt": "from typing import List, Optional\n\ndef longest(strings: List[str]) -> Optional[str]:\n \"\"\" Out of list of strings, return the longest one. Return the first one in case of multiple\n strings of the same length. Return None in case the input list is empty.\n >>> longest([])\n None\n >>> longest(['a', 'b', 'c'])\n 'a'\n >>> longest(['a', 'bb', 'ccc'])\n 'ccc'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([]) == None\n assert candidate(['x', 'y', 'z']) == 'x'\n assert candidate(['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']) == 'zzzz'\n\ndef test_check():\n check(longest)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "py", - "prompt": "from typing import List\n\ndef by_length(arr: List[int]) -> List[str]:\n \"\"\"\n Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n reverse the resulting array, and then replace each digit by its corresponding name from\n \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n\n For example:\n >>> by_length([2, 1, 1, 4, 5, 8, 2, 3])\n ['Eight', 'Five', 'Four', 'Three', 'Two', 'Two', 'One', 'One']\n \n If the array is empty, return an empty array:\n >>> by_length([])\n []\n \n If the array has any strange number ignore it:\n >>> by_length([1, -1, 55])\n ['One']\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([2, 1, 1, 4, 5, 8, 2, 3]) == ['Eight', 'Five', 'Four', 'Three', 'Two', 'Two', 'One', 'One']\n assert candidate([]) == []\n assert candidate([1, -1, 55]) == ['One']\n assert candidate([1, -1, 3, 2]) == ['Three', 'Two', 'One']\n assert candidate([9, 4, 8]) == ['Nine', 'Eight', 'Four']\n\ndef test_check():\n check(by_length)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_106_f", - "language": "py", - "prompt": "from typing import List\n\ndef f(n: int) -> List[int]:\n \"\"\" Implement the function f that takes n as a parameter,\n 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\n or the sum of numbers from 1 to i otherwise.\n i starts from 1.\n the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n Example:\n >>> f(5)\n [1, 2, 6, 24, 15]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(5) == [1, 2, 6, 24, 15]\n assert candidate(7) == [1, 2, 6, 24, 15, 720, 28]\n assert candidate(1) == [1]\n assert candidate(3) == [1, 2, 6]\n\ndef test_check():\n check(f)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "py", - "prompt": "def fizz_buzz(n: int) -> int:\n \"\"\"Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n >>> fizz_buzz(50)\n 0\n >>> fizz_buzz(78)\n 2\n >>> fizz_buzz(79)\n 3\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(50) == 0\n assert candidate(78) == 2\n assert candidate(79) == 3\n assert candidate(100) == 3\n assert candidate(200) == 6\n assert candidate(4000) == 192\n assert candidate(10000) == 639\n assert candidate(100000) == 8026\n\ndef test_check():\n check(fizz_buzz)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "py", - "prompt": "def truncate_number(number: float) -> float:\n \"\"\" Given a positive floating point number, it can be decomposed into\n and integer part (largest integer smaller than given number) and decimals\n (leftover part always smaller than 1).\n\n Return the decimal part of the number.\n >>> truncate_number(3.5)\n 0.5\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(3.5) == 0.5\n assert candidate(1.25) == 0.25\n assert candidate(123.0) == 0.0\n\ndef test_check():\n check(truncate_number)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "py", - "prompt": "from typing import List, Tuple\n\ndef sum_product(numbers: List[int]) -> Tuple[int, int]:\n \"\"\" For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n Empty sum should be equal to 0 and empty product should be equal to 1.\n >>> sum_product([])\n (0, 1)\n >>> sum_product([1, 2, 3, 4])\n (10, 24)\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([]) == (0, 1)\n assert candidate([1, 1, 1]) == (3, 1)\n assert candidate([100, 0]) == (100, 0)\n assert candidate([3, 5, 7]) == (15, 105)\n assert candidate([10]) == (10, 10)\n\ndef test_check():\n check(sum_product)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "py", - "prompt": "from typing import List, Tuple\n\ndef get_row(lst: List[List[int]], x: int) -> List[Tuple[int, int]]:\n \"\"\"\n You are given a 2 dimensional data, as a nested lists,\n which is similar to matrix, however, unlike matrices,\n each row may contain a different number of columns.\n Given lst, and integer x, find integers x in the list,\n and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n each tuple is a coordinate - (row, columns), starting with 0.\n Sort coordinates initially by rows in ascending order.\n Also, sort coordinates of the row by columns in descending order.\n \n Examples:\n >>> get_row([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1)\n [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n >>> get_row([], 1)\n []\n >>> get_row([[], [1], [1, 2, 3]], 3)\n [(2, 2)]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n assert candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6]], 2) == [(0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1)]\n assert candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 1, 3, 4, 5, 6], [1, 2, 1, 4, 5, 6], [1, 2, 3, 1, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1) == [(0, 0), (1, 0), (2, 1), (2, 0), (3, 2), (3, 0), (4, 3), (4, 0), (5, 4), (5, 0), (6, 5), (6, 0)]\n assert candidate([], 1) == []\n assert candidate([[1]], 2) == []\n assert candidate([[], [1], [1, 2, 3]], 3) == [(2, 2)]\n\ndef test_check():\n check(get_row)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "py", - "prompt": "from typing import List\n\ndef eat(number: int, need: int, remaining: int) -> List[int]:\n \"\"\"\n You're a hungry rabbit, and you already have eaten a certain number of carrots,\n but now you need to eat more carrots to complete the day's meals.\n you should return an array of [ total number of eaten carrots after your meals,\n the number of carrots left after your meals ]\n if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n \n Example:\n >>> eat(5, 6, 10)\n [11, 4]\n >>> eat(4, 8, 9)\n [12, 1]\n >>> eat(1, 10, 10)\n [11, 0]\n >>> eat(2, 11, 5)\n [7, 0]\n \n Variables:\n @number : integer\n the number of carrots that you have eaten.\n @need : integer\n the number of carrots that you need to eat.\n @remaining : integer\n the number of remaining carrots thet exist in stock\n \n Constrain:\n * 0 <= number <= 1000\n * 0 <= need <= 1000\n * 0 <= remaining <= 1000\n\n Have fun :)\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(5, 6, 10) == [11, 4]\n assert candidate(4, 8, 9) == [12, 1]\n assert candidate(1, 10, 10) == [11, 0]\n assert candidate(2, 11, 5) == [7, 0]\n assert candidate(4, 5, 7) == [9, 2]\n assert candidate(4, 5, 1) == [5, 0]\n\ndef test_check():\n check(eat)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "py", - "prompt": "def solve(N: int) -> str:\n \"\"\"Given a positive integer N, return the total sum of its digits in binary.\n \n Example\n >>> solve(1000)\n '1'\n >>> solve(150)\n '110'\n >>> solve(147)\n '1100'\n \n Variables:\n @N integer\n Constraints: 0 \u2264 N \u2264 10000.\n Output:\n a string of binary number\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(1000) == '1'\n assert candidate(150) == '110'\n assert candidate(147) == '1100'\n assert candidate(333) == '1001'\n assert candidate(963) == '10010'\n\ndef test_check():\n check(solve)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "py", - "prompt": "from typing import List\n\ndef skjkasdkd(lst: List[int]) -> int:\n \"\"\"You are given a list of integers.\n You need to find the largest prime value and return the sum of its digits.\n\n Examples:\n >>> skjkasdkd([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3])\n 10\n >>> skjkasdkd([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1])\n 25\n >>> skjkasdkd([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3])\n 13\n >>> skjkasdkd([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6])\n 11\n >>> skjkasdkd([0, 81, 12, 3, 1, 21])\n 3\n >>> skjkasdkd([0, 8, 1, 2, 1, 7])\n 7\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]) == 10\n assert candidate([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]) == 25\n assert candidate([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]) == 13\n assert candidate([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]) == 11\n assert candidate([0, 81, 12, 3, 1, 21]) == 3\n assert candidate([0, 8, 1, 2, 1, 7]) == 7\n assert candidate([8191]) == 19\n assert candidate([8191, 123456, 127, 7]) == 19\n assert candidate([127, 97, 8192]) == 10\n\ndef test_check():\n check(skjkasdkd)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "py", - "prompt": "from typing import List\n\ndef smallest_change(arr: List[int]) -> int:\n \"\"\"\n Given an array arr of integers, find the minimum number of elements that\n need to be changed to make the array palindromic. A palindromic array is an array that\n is read the same backwards and forwards. In one change, you can change one element to any other element.\n\n For example:\n >>> smallest_change([1, 2, 3, 5, 4, 7, 9, 6])\n 4\n >>> smallest_change([1, 2, 3, 4, 3, 2, 2])\n 1\n >>> smallest_change([1, 2, 3, 2, 1])\n 0\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([1, 2, 3, 5, 4, 7, 9, 6]) == 4\n assert candidate([1, 2, 3, 4, 3, 2, 2]) == 1\n assert candidate([1, 4, 2]) == 1\n assert candidate([1, 4, 4, 2]) == 1\n assert candidate([1, 2, 3, 2, 1]) == 0\n assert candidate([3, 1, 1, 3]) == 0\n assert candidate([1]) == 0\n assert candidate([0, 1]) == 1\n\ndef test_check():\n check(smallest_change)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "py", - "prompt": "from typing import List\n\ndef numerical_letter_grade(grades: List[float]) -> List[str]:\n \"\"\"It is the last week of the semester and the teacher has to give the grades\n to students. The teacher has been making her own algorithm for grading.\n The only problem is, she has lost the code she used for grading.\n She has given you a list of GPAs for some students and you have to write \n a function that can output a list of letter grades using the following table:\n GPA | Letter grade\n 4.0 A+\n > 3.7 A \n > 3.3 A- \n > 3.0 B+\n > 2.7 B \n > 2.3 B-\n > 2.0 C+\n > 1.7 C\n > 1.3 C-\n > 1.0 D+ \n > 0.7 D \n > 0.0 D-\n 0.0 E\n \n\n Example:\n >>> grade_equation([4.0, 3, 1.7, 2, 3.5])\n ['A+', 'B', 'C-', 'C', 'A-']\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([4.0, 3, 1.7, 2, 3.5]) == ['A+', 'B', 'C-', 'C', 'A-']\n assert candidate([1.2]) == ['D+']\n assert candidate([0.5]) == ['D-']\n assert candidate([0.0]) == ['E']\n assert candidate([1.0, 0.3, 1.5, 2.8, 3.3]) == ['D', 'D-', 'C-', 'B', 'B+']\n assert candidate([0.0, 0.7]) == ['E', 'D-']\n\ndef test_check():\n check(numerical_letter_grade)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "py", - "prompt": "def triangle_area(a: int, b: int, c: int) -> float:\n \"\"\"\n Given the lengths of the three sides of a triangle. Return the area of\n the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n Otherwise return -1\n Three sides make a valid triangle when the sum of any two sides is greater \n than the third side.\n Example:\n >>> triangle_area(3, 4, 5)\n 6.0\n >>> triangle_area(1, 2, 10)\n -1\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(3, 4, 5) == 6.0\n assert candidate(1, 2, 10) == -1\n assert candidate(4, 8, 5) == 8.18\n assert candidate(2, 2, 2) == 1.73\n assert candidate(1, 2, 3) == -1\n assert candidate(10, 5, 7) == 16.25\n assert candidate(2, 6, 3) == -1\n assert candidate(1, 1, 1) == 0.43\n assert candidate(2, 2, 10) == -1\n\ndef test_check():\n check(triangle_area)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "py", - "prompt": "def same_chars(s0: str, s1: str) -> bool:\n \"\"\"\n Check if two words have the same characters.\n >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n True\n >>> same_chars('abcd', 'dddddddabc')\n True\n >>> same_chars('dddddddabc', 'abcd')\n True\n >>> same_chars('eabcd', 'dddddddabc')\n False\n >>> same_chars('abcd', 'dddddddabce')\n False\n >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc')\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('eabcdzzzz', 'dddzzzzzzzddeddabc') == True\n assert candidate('abcd', 'dddddddabc') == True\n assert candidate('dddddddabc', 'abcd') == True\n assert candidate('eabcd', 'dddddddabc') == False\n assert candidate('abcd', 'dddddddabcf') == False\n assert candidate('eabcdzzzz', 'dddzzzzzzzddddabc') == False\n assert candidate('aabb', 'aaccc') == False\n\ndef test_check():\n check(same_chars)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "py", - "prompt": "from typing import List\n\ndef minSubArraySum(nums: List[int]) -> int:\n \"\"\"\n Given an array of integers nums, find the minimum sum of any non-empty sub-array\n of nums.\n Example\n >>> minSubArraySum([2, 3, 4, 1, 2, 4])\n 1\n >>> minSubArraySum([-1, -2, -3])\n -6\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([2, 3, 4, 1, 2, 4]) == 1\n assert candidate([-1, -2, -3]) == -6\n assert candidate([-1, -2, -3, 2, -10]) == -14\n assert candidate([-9999999999999999]) == -9999999999999999\n assert candidate([0, 10, 20, 1000000]) == 0\n assert candidate([-1, -2, -3, 10, -5]) == -6\n assert candidate([100, -1, -2, -3, 10, -5]) == -6\n assert candidate([10, 11, 13, 8, 3, 4]) == 3\n assert candidate([100, -33, 32, -1, 0, -2]) == -33\n assert candidate([-10]) == -10\n assert candidate([7]) == 7\n assert candidate([1, -1]) == -1\n\ndef test_check():\n check(minSubArraySum)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "py", - "prompt": "from typing import List\n\ndef select_words(s: str, n: int) -> List[str]:\n \"\"\"Given a string s and a natural number n, you have been tasked to implement \n a function that returns a list of all words from string s that contain exactly \n n consonants, in order these words appear in the string s.\n If the string s is empty then the function should return an empty list.\n Note: you may assume the input string contains only letters and spaces.\n Examples:\n >>> select_words('Mary had a little lamb', 4)\n ['little']\n >>> select_words('Mary had a little lamb', 3)\n ['Mary', 'lamb']\n >>> select_words('simple white space', 2)\n []\n >>> select_words('Hello world', 4)\n ['world']\n >>> select_words('Uncle sam', 3)\n ['Uncle']\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('Mary had a little lamb', 4) == ['little']\n assert candidate('Mary had a little lamb', 3) == ['Mary', 'lamb']\n assert candidate('simple white space', 2) == []\n assert candidate('Hello world', 4) == ['world']\n assert candidate('Uncle sam', 3) == ['Uncle']\n assert candidate('', 4) == []\n assert candidate('a b c d e f', 1) == ['b', 'c', 'd', 'f']\n\ndef test_check():\n check(select_words)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "py", - "prompt": "from typing import List\n\ndef all_prefixes(string: str) -> List[str]:\n \"\"\" Return list of all prefixes from shortest to longest of the input string\n >>> all_prefixes('abc')\n ['a', 'ab', 'abc']\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('') == []\n assert candidate('asdfgh') == ['a', 'as', 'asd', 'asdf', 'asdfg', 'asdfgh']\n assert candidate('WWW') == ['W', 'WW', 'WWW']\n\ndef test_check():\n check(all_prefixes)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "py", - "prompt": "def closest_integer(value: str) -> int:\n \"\"\"\n Create a function that takes a value (string) representing a number\n and returns the closest integer to it. If the number is equidistant\n from two integers, round it away from zero.\n\n Examples\n >>> closest_integer('10')\n 10\n >>> closest_integer('15.3')\n 15\n\n Note:\n Rounding away from zero means that if the given number is equidistant\n from two integers, the one you should return is the one that is the\n farthest from zero. For example closest_integer(\"14.5\") should\n return 15 and closest_integer(\"-14.5\") should return -15.\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('10') == 10\n assert candidate('14.5') == 15\n assert candidate('-15.5') == -16\n assert candidate('15.3') == 15\n assert candidate('0') == 0\n\ndef test_check():\n check(closest_integer)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "py", - "prompt": "def file_name_check(file_name: str) -> str:\n \"\"\"Create a function which takes a string representing a file's name, and returns\n 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n A file's name is considered to be valid if and only if all the following conditions \n are met:\n - There should not be more than three digits ('0'-'9') in the file's name.\n - The file's name contains exactly one dot '.'\n - The substring before the dot should not be empty, and it starts with a letter from \n the latin alphapet ('a'-'z' and 'A'-'Z').\n - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n Examples:\n >>> file_name_check('example.txt')\n 'Yes'\n >>> file_name_check('1example.dll')\n 'No'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('example.txt') == 'Yes'\n assert candidate('1example.dll') == 'No'\n assert candidate('s1sdf3.asd') == 'No'\n assert candidate('K.dll') == 'Yes'\n assert candidate('MY16FILE3.exe') == 'Yes'\n assert candidate('His12FILE94.exe') == 'No'\n assert candidate('_Y.txt') == 'No'\n assert candidate('?aREYA.exe') == 'No'\n assert candidate('/this_is_valid.dll') == 'No'\n assert candidate('this_is_valid.wow') == 'No'\n assert candidate('this_is_valid.txt') == 'Yes'\n assert candidate('this_is_valid.txtexe') == 'No'\n assert candidate('#this2_i4s_5valid.ten') == 'No'\n assert candidate('@this1_is6_valid.exe') == 'No'\n assert candidate('this_is_12valid.6exe4.txt') == 'No'\n assert candidate('all.exe.txt') == 'No'\n assert candidate('I563_No.exe') == 'Yes'\n assert candidate('Is3youfault.txt') == 'Yes'\n assert candidate('no_one#knows.dll') == 'Yes'\n assert candidate('1I563_Yes3.exe') == 'No'\n assert candidate('I563_Yes3.txtt') == 'No'\n assert candidate('final..txt') == 'No'\n assert candidate('final132') == 'No'\n assert candidate('_f4indsartal132.') == 'No'\n assert candidate('.txt') == 'No'\n assert candidate('s.') == 'No'\n\ndef test_check():\n check(file_name_check)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "py", - "prompt": "from typing import Tuple\n\ndef intersection(interval1: Tuple[int, int], interval2: Tuple[int, int]) -> str:\n \"\"\"You are given two intervals,\n where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n The given intervals are closed which means that the interval (start, end)\n includes both start and end.\n For each given interval, it is assumed that its start is less or equal its end.\n Your task is to determine whether the length of intersection of these two \n intervals is a prime number.\n Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n which its length is 1, which not a prime number.\n If the length of the intersection is a prime number, return \"YES\",\n otherwise, return \"NO\".\n If the two intervals don't intersect, return \"NO\".\n\n\n [input/output] samples:\n >>> intersection((1, 2), (2, 3))\n 'NO'\n >>> intersection((-1, 1), (0, 4))\n 'NO'\n >>> intersection((-3, -1), (-5, 5))\n 'YES'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate((1, 2), (2, 3)) == 'NO'\n assert candidate((-1, 1), (0, 4)) == 'NO'\n assert candidate((-3, -1), (-5, 5)) == 'YES'\n assert candidate((-2, 2), (-4, 0)) == 'YES'\n assert candidate((-11, 2), (-1, -1)) == 'NO'\n assert candidate((1, 2), (3, 5)) == 'NO'\n assert candidate((1, 2), (1, 2)) == 'NO'\n assert candidate((-2, -2), (-3, -2)) == 'NO'\n\ndef test_check():\n check(intersection)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "py", - "prompt": "def largest_prime_factor(n: int) -> int:\n \"\"\"Return the largest prime factor of n. Assume n > 1 and is not a prime.\n >>> largest_prime_factor(13195)\n 29\n >>> largest_prime_factor(2048)\n 2\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(15) == 5\n assert candidate(27) == 3\n assert candidate(63) == 7\n assert candidate(330) == 11\n assert candidate(13195) == 29\n\ndef test_check():\n check(largest_prime_factor)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "py", - "prompt": "def count_distinct_characters(string: str) -> int:\n \"\"\" Given a string, find out how many distinct characters (regardless of case) does it consist of\n >>> count_distinct_characters('xyzXYZ')\n 3\n >>> count_distinct_characters('Jerry')\n 4\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('') == 0\n assert candidate('abcde') == 5\n assert candidate('abcdecadeCADE') == 5\n assert candidate('aaaaAAAAaaaa') == 1\n assert candidate('Jerry jERRY JeRRRY') == 5\n\ndef test_check():\n check(count_distinct_characters)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "py", - "prompt": "from typing import List\n\ndef below_zero(operations: List[int]) -> bool:\n \"\"\" You're given a list of deposit and withdrawal operations on a bank account that starts with\n zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n at that point function should return True. Otherwise it should return False.\n >>> below_zero([1, 2, 3])\n False\n >>> below_zero([1, 2, -4, 5])\n True\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate([]) == False\n assert candidate([1, 2, -3, 1, 2, -3]) == False\n assert candidate([1, 2, -4, 5, 6]) == True\n assert candidate([1, -1, 2, -2, 5, -5, 4, -4]) == False\n assert candidate([1, -1, 2, -2, 5, -5, 4, -5]) == True\n assert candidate([1, -2, 2, -2, 5, -5, 4, -4]) == True\n\ndef test_check():\n check(below_zero)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "py", - "prompt": "def make_palindrome(string: str) -> str:\n \"\"\" Find the shortest palindrome that begins with a supplied string.\n Algorithm idea is simple:\n - Find the longest postfix of supplied string that is a palindrome.\n - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n >>> make_palindrome('')\n ''\n >>> make_palindrome('cat')\n 'catac'\n >>> make_palindrome('cata')\n 'catac'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate('') == ''\n assert candidate('x') == 'x'\n assert candidate('xyz') == 'xyzyx'\n assert candidate('xyx') == 'xyx'\n assert candidate('jerry') == 'jerryrrej'\n\ndef test_check():\n check(make_palindrome)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "py", - "prompt": "def int_to_mini_roman(number: int) -> str:\n \"\"\"\n Given a positive integer, obtain its roman numeral equivalent as a string,\n and return it in lowercase.\n Restrictions: 1 <= num <= 1000\n\n Examples:\n >>> int_to_mini_roman(19)\n 'xix'\n >>> int_to_mini_roman(152)\n 'clii'\n >>> int_to_mini_roman(426)\n 'cdxxvi'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "reworded", - "tests": "def check(candidate):\n assert candidate(19) == 'xix'\n assert candidate(152) == 'clii'\n assert candidate(251) == 'ccli'\n assert candidate(426) == 'cdxxvi'\n assert candidate(500) == 'd'\n assert candidate(1) == 'i'\n assert candidate(4) == 'iv'\n assert candidate(43) == 'xliii'\n assert candidate(90) == 'xc'\n assert candidate(94) == 'xciv'\n assert candidate(532) == 'dxxxii'\n assert candidate(900) == 'cm'\n assert candidate(994) == 'cmxciv'\n assert candidate(1000) == 'm'\n\ndef test_check():\n check(int_to_mini_roman)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - } -] \ No newline at end of file diff --git a/data/py-transform.json b/data/py-transform.json deleted file mode 100644 index 925d5d7bb63b316c2ca5d10d45f85b2af7975f77..0000000000000000000000000000000000000000 --- a/data/py-transform.json +++ /dev/null @@ -1,2417 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "py", - "prompt": "def largest_divisor(n: int) -> int:\n \"\"\" For a given number n, find the largest number that divides n evenly, smaller than n\n >>> largest_divisor(15)\n 5\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(3) == 1\n assert candidate(7) == 1\n assert candidate(10) == 5\n assert candidate(100) == 50\n assert candidate(49) == 7\n\ndef test_check():\n check(largest_divisor)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_47_median", - "language": "py", - "prompt": "from typing import List\n\ndef median(l: List[int]) -> float:\n \"\"\"Return median of elements in the list l.\n >>> median([3, 1, 2, 4, 5])\n 3\n >>> median([-10, 4, 6, 1000, 10, 20])\n 15.0\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([3, 1, 2, 4, 5]) == 3\n assert candidate([-10, 4, 6, 1000, 10, 20]) == 8.0\n assert candidate([5]) == 5\n assert candidate([6, 5]) == 5.5\n assert candidate([8, 1, 3, 9, 9, 2, 7]) == 7\n\ndef test_check():\n check(median)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "py", - "prompt": "from typing import List\n\ndef do_algebra(operator: List[str], operand: List[int]) -> int:\n \"\"\"\n Given two lists operator, and operand. The first list has basic algebra operations, and \n the second list is a list of integers. Use the two given lists to build the algebric \n expression and return the evaluation of this expression.\n\n The basic algebra operations:\n Addition ( + ) \n Subtraction ( - ) \n Multiplication ( * ) \n Floor division ( // ) \n Exponentiation ( ** ) \n\n Example:\n operator['+', '*', '-']\n array = [2, 3, 4, 5]\n result = 2 + 3 * 4 - 5\n => result = 9\n\n Note:\n The length of operator list is equal to the length of operand list minus one.\n Operand is a list of of non-negative integers.\n Operator list has at least one operator, and operand list has at least two operands.\n\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(['**', '*', '+'], [2, 3, 4, 5]) == 37\n assert candidate(['+', '*', '-'], [2, 3, 4, 5]) == 9\n assert candidate(['//', '*'], [7, 3, 4]) == 8\n\ndef test_check():\n check(do_algebra)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "py", - "prompt": "from typing import List\n\ndef max_element(l: List[int]) -> int:\n \"\"\"Return maximum element in the list.\n >>> max_element([1, 2, 3])\n 3\n >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n 123\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 3]) == 3\n assert candidate([5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]) == 124\n\ndef test_check():\n check(max_element)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "py", - "prompt": "from typing import List\n\ndef can_arrange(arr: List[int]) -> int:\n \"\"\"Create a function which returns the largest index of an element which\n is not greater than or equal to the element immediately preceding it. If\n no such element exists then return -1. The given array will not contain\n duplicate values.\n\n Examples:\n >>> can_arrange([1, 2, 4, 3, 5])\n 3\n >>> can_arrange([1, 2, 3])\n -1\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 4, 3, 5]) == 3\n assert candidate([1, 2, 4, 5]) == -1\n assert candidate([1, 4, 2, 5, 6, 7, 8, 9, 10]) == 2\n assert candidate([4, 8, 5, 7, 3]) == 4\n assert candidate([]) == -1\n\ndef test_check():\n check(can_arrange)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "py", - "prompt": "def car_race_collision(n: int) -> int:\n \"\"\"\n Imagine a road that's a perfectly straight infinitely long line.\n n cars are driving left to right; simultaneously, a different set of n cars\n are driving right to left. The two sets of cars start out being very far from\n each other. All cars move in the same speed. Two cars are said to collide\n when a car that's moving left to right hits a car that's moving right to left.\n However, the cars are infinitely sturdy and strong; as a result, they continue moving\n in their trajectory as if they did not collide.\n\n This function outputs the number of such collisions.\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(2) == 4\n assert candidate(3) == 9\n assert candidate(4) == 16\n assert candidate(8) == 64\n assert candidate(10) == 100\n\ndef test_check():\n check(car_race_collision)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "py", - "prompt": "def check_if_last_char_is_a_letter(txt: str) -> bool:\n \"\"\"\n Create a function that returns True if the last character\n of a given string is an alphabetical character and is not\n a part of a word, and False otherwise.\n Note: \"word\" is a group of characters separated by space.\n\n Examples:\n >>> check_if_last_char_is_a_letter('apple pie')\n False\n >>> check_if_last_char_is_a_letter('apple pi e')\n True\n >>> check_if_last_char_is_a_letter('apple pi e ')\n False\n >>> check_if_last_char_is_a_letter('')\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('apple') == False\n assert candidate('apple pi e') == True\n assert candidate('eeeee') == False\n assert candidate('A') == True\n assert candidate('Pumpkin pie ') == False\n assert candidate('Pumpkin pie 1') == False\n assert candidate('') == False\n assert candidate('eeeee e ') == False\n assert candidate('apple pie') == False\n assert candidate('apple pi e ') == False\n\ndef test_check():\n check(check_if_last_char_is_a_letter)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "py", - "prompt": "def is_prime(n: int) -> bool:\n \"\"\"Return true if a given number is prime, and false otherwise.\n >>> is_prime(6)\n False\n >>> is_prime(101)\n True\n >>> is_prime(11)\n True\n >>> is_prime(13441)\n True\n >>> is_prime(61)\n True\n >>> is_prime(4)\n False\n >>> is_prime(1)\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(6) == False\n assert candidate(101) == True\n assert candidate(11) == True\n assert candidate(13441) == True\n assert candidate(61) == True\n assert candidate(4) == False\n assert candidate(1) == False\n assert candidate(5) == True\n assert candidate(11) == True\n assert candidate(17) == True\n assert candidate(85) == False\n assert candidate(77) == False\n assert candidate(255379) == False\n\ndef test_check():\n check(is_prime)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "py", - "prompt": "from typing import List\n\ndef unique_digits(x: List[int]) -> List[int]:\n \"\"\"Given a list of positive integers x. return a sorted list of all \n elements that hasn't any even digit.\n\n Note: Returned list should be sorted in increasing order.\n \n For example:\n >>> unique_digits([15, 33, 1422, 1])\n [1, 15, 33]\n >>> unique_digits([152, 323, 1422, 10])\n []\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([15, 33, 1422, 1]) == [1, 15, 33]\n assert candidate([152, 323, 1422, 10]) == []\n assert candidate([12345, 2033, 111, 151]) == [111, 151]\n assert candidate([135, 103, 31]) == [31, 135]\n\ndef test_check():\n check(unique_digits)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "py", - "prompt": "def string_xor(a: str, b: str) -> str:\n \"\"\" Input are two strings a and b consisting only of 1s and 0s.\n Perform binary XOR on these inputs and return result also as a string.\n >>> string_xor('010', '110')\n '100'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('111000', '101010') == '010010'\n assert candidate('1', '1') == '0'\n assert candidate('0101', '0000') == '0101'\n\ndef test_check():\n check(string_xor)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "py", - "prompt": "def sum_to_n(n: int) -> int:\n \"\"\"sum_to_n is a function that sums numbers from 1 to n.\n >>> sum_to_n(30)\n 465\n >>> sum_to_n(100)\n 5050\n >>> sum_to_n(5)\n 15\n >>> sum_to_n(10)\n 55\n >>> sum_to_n(1)\n 1\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(1) == 1\n assert candidate(6) == 21\n assert candidate(11) == 66\n assert candidate(30) == 465\n assert candidate(100) == 5050\n\ndef test_check():\n check(sum_to_n)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "py", - "prompt": "from typing import List\n\ndef double_the_difference(lst: List[float]) -> int:\n \"\"\"\n Given a list of numbers, return the sum of squares of the numbers\n in the list that are odd. Ignore numbers that are negative or not integers.\n \n >>> double_the_difference([1, 3, 2, 0])\n 10\n >>> double_the_difference([-1, -2, 0])\n 0\n >>> double_the_difference([9, -2])\n 81\n >>> double_the_difference([0])\n 0\n \n If the input list is empty, return 0.\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == 0\n assert candidate([5.0, 4.0]) == 25\n assert candidate([0.1, 0.2, 0.3]) == 0\n assert candidate([-10.0, -20.0, -30.0]) == 0\n assert candidate([-1.0, -2.0, 8.0]) == 0\n assert candidate([0.2, 3.0, 5.0]) == 34\n assert candidate([-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]) == 165\n\ndef test_check():\n check(double_the_difference)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "py", - "prompt": "def strlen(string: str) -> int:\n \"\"\" Return length of given string\n >>> strlen('')\n 0\n >>> strlen('abc')\n 3\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('') == 0\n assert candidate('x') == 1\n assert candidate('asdasnakj') == 9\n\ndef test_check():\n check(strlen)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "py", - "prompt": "def is_bored(S: str) -> int:\n \"\"\"\n You'll be given a string of words, and your task is to count the number\n of boredoms. A boredom is a sentence that starts with the word \"I\".\n Sentences are delimited by '.', '?' or '!'.\n \n For example:\n >>> is_bored('Hello world')\n 0\n >>> is_bored('The sky is blue. The sun is shining. I love this weather')\n 1\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('Hello world') == 0\n assert candidate('Is the sky blue?') == 0\n assert candidate('I love It !') == 1\n assert candidate('bIt') == 0\n assert candidate('I feel good today. I will be productive. will kill It') == 2\n assert candidate('You and I are going for a walk') == 0\n\ndef test_check():\n check(is_bored)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "py", - "prompt": "def vowels_count(s: str) -> int:\n \"\"\"Write a function vowels_count which takes a string representing\n a word as input and returns the number of vowels in the string.\n Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n vowel, but only when it is at the end of the given word.\n\n Example:\n >>> vowels_count('abcde')\n 2\n >>> vowels_count('ACEDY')\n 3\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('abcde') == 2\n assert candidate('Alone') == 3\n assert candidate('key') == 2\n assert candidate('bye') == 1\n assert candidate('keY') == 2\n assert candidate('bYe') == 1\n assert candidate('ACEDY') == 3\n\ndef test_check():\n check(vowels_count)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "py", - "prompt": "def fib(n: int) -> int:\n \"\"\"Return n-th Fibonacci number.\n >>> fib(10)\n 55\n >>> fib(1)\n 1\n >>> fib(8)\n 21\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(10) == 55\n assert candidate(1) == 1\n assert candidate(8) == 21\n assert candidate(11) == 89\n assert candidate(12) == 144\n\ndef test_check():\n check(fib)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "py", - "prompt": "def simplify(x: str, n: str) -> bool:\n \"\"\"Your task is to implement a function that will simplify the expression\n x * n. The function returns True if x * n evaluates to a whole number and False\n otherwise. Both x and n, are string representation of a fraction, and have the following format,\n / where both numerator and denominator are positive whole numbers.\n\n You can assume that x, and n are valid fractions, and do not have zero as denominator.\n\n >>> simplify('1/5', '5/1')\n True\n >>> simplify('1/6', '2/1')\n False\n >>> simplify('7/10', '10/2')\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('1/5', '5/1') == True\n assert candidate('1/6', '2/1') == False\n assert candidate('5/1', '3/1') == True\n assert candidate('7/10', '10/2') == False\n assert candidate('2/10', '50/10') == True\n assert candidate('7/2', '4/2') == True\n assert candidate('11/6', '6/1') == True\n assert candidate('2/3', '5/2') == False\n assert candidate('5/2', '3/5') == False\n assert candidate('2/4', '8/4') == True\n assert candidate('2/4', '4/2') == True\n assert candidate('1/5', '5/1') == True\n assert candidate('1/5', '1/5') == False\n\ndef test_check():\n check(simplify)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "py", - "prompt": "def count_upper(s: str) -> int:\n \"\"\"\n Given a string s, count the number of uppercase vowels in even indices.\n \n For example:\n >>> count_upper('aBCdEf')\n 1\n >>> count_upper('abcdefg')\n 0\n >>> count_upper('dBBE')\n 0\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('aBCdEf') == 1\n assert candidate('abcdefg') == 0\n assert candidate('dBBE') == 0\n assert candidate('B') == 0\n assert candidate('U') == 1\n assert candidate('') == 0\n assert candidate('EEEE') == 2\n\ndef test_check():\n check(count_upper)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "py", - "prompt": "from typing import List\n\ndef max_fill(grid: List[List[int]], capacity: int) -> int:\n \"\"\"\n You are given a rectangular grid of wells. Each row represents a single well,\n and each 1 in a row represents a single unit of water.\n Each well has a corresponding bucket that can be used to extract water from it, \n and all buckets have the same capacity.\n Your task is to use the buckets to empty the wells.\n Output the number of times you need to lower the buckets.\n\n Example 1:\n >>> max_fill([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1)\n 6\n\n Example 2:\n >>> max_fill([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2)\n 5\n \n Example 3:\n >>> max_fill([[0, 0, 0], [0, 0, 0]], 5)\n 0\n\n Constraints:\n * all wells have the same length\n * 1 <= grid.length <= 10^2\n * 1 <= grid[:,1].length <= 10^2\n * grid[i][j] -> 0 | 1\n * 1 <= capacity <= 10\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1) == 6\n assert candidate([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2) == 5\n assert candidate([[0, 0, 0], [0, 0, 0]], 5) == 0\n assert candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 2) == 4\n assert candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 9) == 2\n\ndef test_check():\n check(max_fill)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "py", - "prompt": "from typing import List\n\ndef maximum(arr: List[int], k: int) -> List[int]:\n \"\"\"\n Given an array arr of integers and a positive integer k, return a sorted list \n of length k with the maximum k numbers in arr.\n\n Example 1:\n\n >>> maximum([-3, -4, 5], 3)\n [-4, -3, 5]\n\n Example 2:\n\n >>> maximum([4, -4, 4], 2)\n [4, 4]\n\n Example 3:\n\n >>> maximum([-3, 2, 1, 2, -1, -2, 1], 1)\n [2]\n\n Note:\n 1. The length of the array will be in the range of [1, 1000].\n 2. The elements in the array will be in the range of [-1000, 1000].\n 3. 0 <= k <= len(arr)\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([-3, -4, 5], 3) == [-4, -3, 5]\n assert candidate([4, -4, 4], 2) == [4, 4]\n assert candidate([-3, 2, 1, 2, -1, -2, 1], 1) == [2]\n assert candidate([123, -123, 20, 0, 1, 2, -3], 3) == [2, 20, 123]\n assert candidate([-123, 20, 0, 1, 2, -3], 4) == [0, 1, 2, 20]\n assert candidate([5, 15, 0, 3, -13, -8, 0], 7) == [-13, -8, 0, 0, 3, 5, 15]\n assert candidate([-1, 0, 2, 5, 3, -10], 2) == [3, 5]\n assert candidate([1, 0, 5, -7], 1) == [5]\n assert candidate([4, -4], 2) == [-4, 4]\n assert candidate([-10, 10], 2) == [-10, 10]\n assert candidate([1, 2, 3, -23, 243, -400, 0], 0) == []\n\ndef test_check():\n check(maximum)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "py", - "prompt": "def encode(message: str) -> str:\n \"\"\"\n Write a function that takes a message, and encodes in such a \n way that it swaps case of all letters, replaces all vowels in \n the message with the letter that appears 2 places ahead of that \n vowel in the english alphabet. \n Assume only letters. \n \n Examples:\n >>> encode('test')\n 'TGST'\n >>> encode('This is a message')\n 'tHKS KS C MGSSCGG'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('TEST') == 'tgst'\n assert candidate('Mudasir') == 'mWDCSKR'\n assert candidate('YES') == 'ygs'\n assert candidate('This is a message') == 'tHKS KS C MGSSCGG'\n assert candidate('I DoNt KnOw WhAt tO WrItE') == 'k dQnT kNqW wHcT Tq wRkTg'\n\ndef test_check():\n check(encode)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "py", - "prompt": "def remove_vowels(text: str) -> str:\n \"\"\"\n remove_vowels is a function that takes string and returns string without vowels.\n >>> remove_vowels('')\n ''\n >>> remove_vowels('abcdef')\n 'bcdf'\n >>> remove_vowels('aaaaa')\n ''\n >>> remove_vowels('aaBAA')\n 'B'\n >>> remove_vowels('zbcd')\n 'zbcd'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('') == ''\n assert candidate('abcdef\\nghijklm') == 'bcdf\\nghjklm'\n assert candidate('fedcba') == 'fdcb'\n assert candidate('eeeee') == ''\n assert candidate('acBAA') == 'cB'\n assert candidate('EcBOO') == 'cB'\n assert candidate('ybcd') == 'ybcd'\n\ndef test_check():\n check(remove_vowels)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "py", - "prompt": "from typing import List\n\ndef get_positive(l: List[int]) -> List[int]:\n \"\"\"Return only positive numbers in the list.\n >>> get_positive([-1, 2, -4, 5, 6])\n [2, 5, 6]\n >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n [5, 3, 2, 3, 9, 123, 1]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([-1, -2, 4, 5, 6]) == [4, 5, 6]\n assert candidate([5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]) == [5, 3, 2, 3, 3, 9, 123, 1]\n assert candidate([-1, -2]) == []\n assert candidate([]) == []\n\ndef test_check():\n check(get_positive)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "py", - "prompt": "def string_sequence(n: int) -> str:\n \"\"\" Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n >>> string_sequence(0)\n '0'\n >>> string_sequence(5)\n '0 1 2 3 4 5'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(0) == '0'\n assert candidate(3) == '0 1 2 3'\n assert candidate(10) == '0 1 2 3 4 5 6 7 8 9 10'\n\ndef test_check():\n check(string_sequence)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "py", - "prompt": "from typing import List\n\ndef make_a_pile(n: int) -> List[int]:\n \"\"\"\n Given a positive integer n, you have to make a pile of n levels of stones.\n The first level has n stones.\n The number of stones in the next level is:\n - the next odd number if n is odd.\n - the next even number if n is even.\n Return the number of stones in each level in a list, where element at index\n i represents the number of stones in the level (i+1).\n\n Examples:\n >>> make_a_pile(3)\n [3, 5, 7]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(3) == [3, 5, 7]\n assert candidate(4) == [4, 6, 8, 10]\n assert candidate(5) == [5, 7, 9, 11, 13]\n assert candidate(6) == [6, 8, 10, 12, 14, 16]\n assert candidate(8) == [8, 10, 12, 14, 16, 18, 20, 22]\n\ndef test_check():\n check(make_a_pile)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "py", - "prompt": "from typing import Tuple\n\ndef reverse_delete(s: str, c: str) -> Tuple[str, bool]:\n \"\"\"Task\n 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\n then check if the result string is palindrome.\n A string is called palindrome if it reads the same backward as forward.\n You should return a tuple containing the result string and True/False for the check.\n Example\n >>> reverse_delete('abcde', 'ae')\n ('bcd', False)\n >>> reverse_delete('abcdef', 'b')\n ('acdef', False)\n >>> reverse_delete('abcdedcba', 'ab')\n ('cdedc', True)\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('abcde', 'ae') == ('bcd', False)\n assert candidate('abcdef', 'b') == ('acdef', False)\n assert candidate('abcdedcba', 'ab') == ('cdedc', True)\n assert candidate('dwik', 'w') == ('dik', False)\n assert candidate('a', 'a') == ('', True)\n assert candidate('abcdedcba', '') == ('abcdedcba', True)\n assert candidate('abcdedcba', 'v') == ('abcdedcba', True)\n assert candidate('vabba', 'v') == ('abba', True)\n assert candidate('mamma', 'mia') == ('', True)\n\ndef test_check():\n check(reverse_delete)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "py", - "prompt": "def flip_case(string: str) -> str:\n \"\"\" For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n >>> flip_case('Hello')\n 'hELLO'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('') == ''\n assert candidate('Hello!') == 'hELLO!'\n assert candidate('These violent delights have violent ends') == 'tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS'\n\ndef test_check():\n check(flip_case)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "py", - "prompt": "def solve(s: str) -> str:\n \"\"\"You are given a string s.\n if s[i] is a letter, reverse its case from lower to upper or vise versa, \n otherwise keep it as it is.\n If the string contains no letters, reverse the string.\n The function should return the resulted string.\n Examples\n >>> solve('1234')\n '4321'\n >>> solve('ab')\n 'AB'\n >>> solve('#a@C')\n '#A@c'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('AsDf') == 'aSdF'\n assert candidate('1234') == '4321'\n assert candidate('ab') == 'AB'\n assert candidate('#a@C') == '#A@c'\n assert candidate('#AsdfW^45') == '#aSDFw^45'\n assert candidate('#6@2') == '2@6#'\n assert candidate('#$a^D') == '#$A^d'\n assert candidate('#ccc') == '#CCC'\n\ndef test_check():\n check(solve)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "py", - "prompt": "from typing import List\n\ndef filter_by_prefix(strings: List[str], prefix: str) -> List[str]:\n \"\"\" Filter an input list of strings only for ones that start with a given prefix.\n >>> filter_by_prefix([], 'a')\n []\n >>> filter_by_prefix(['abc', 'bcd', 'cde', 'array'], 'a')\n ['abc', 'array']\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([], 'john') == []\n assert candidate(['xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'], 'xxx') == ['xxx', 'xxxAAA', 'xxx']\n\ndef test_check():\n check(filter_by_prefix)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "py", - "prompt": "def choose_num(x: int, y: int) -> int:\n \"\"\"This function takes two positive numbers x and y and returns the\n biggest even integer number that is in the range [x, y] inclusive. If \n there's no such number, then the function should return -1.\n\n For example:\n >>> choose_num(12, 15)\n 14\n >>> choose_num(13, 12)\n -1\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(12, 15) == 14\n assert candidate(13, 12) == -1\n assert candidate(33, 12354) == 12354\n assert candidate(5234, 5233) == -1\n assert candidate(6, 29) == 28\n assert candidate(27, 10) == -1\n assert candidate(7, 7) == -1\n assert candidate(546, 546) == 546\n\ndef test_check():\n check(choose_num)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "py", - "prompt": "def words_in_sentence(sentence: str) -> str:\n \"\"\"\n You are given a string representing a sentence,\n the sentence contains some words separated by a space,\n and you have to return a string that contains the words from the original sentence,\n whose lengths are prime numbers,\n the order of the words in the new string should be the same as the original one.\n\n Example 1:\n >>> words_in_sentence('This is a test')\n 'is'\n\n Example 2:\n >>> words_in_sentence('lets go for swimming')\n 'go for'\n \n Constraints:\n * 1 <= len(sentence) <= 100\n * sentence contains only letters\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('This is a test') == 'is'\n assert candidate('lets go for swimming') == 'go for'\n assert candidate('there is no place available here') == 'there is no place'\n assert candidate('Hi I am Hussein') == 'Hi am Hussein'\n assert candidate('go for it') == 'go for it'\n assert candidate('here') == ''\n assert candidate('here is') == 'is'\n\ndef test_check():\n check(words_in_sentence)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "py", - "prompt": "from typing import List\n\ndef intersperse(numbers: List[int], delimeter: int) -> List[int]:\n \"\"\" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n >>> intersperse([], 4)\n []\n >>> intersperse([1, 2, 3], 4)\n [1, 4, 2, 4, 3]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([], 7) == []\n assert candidate([5, 6, 3, 2], 8) == [5, 8, 6, 8, 3, 8, 2]\n assert candidate([2, 2, 2], 2) == [2, 2, 2, 2, 2]\n\ndef test_check():\n check(intersperse)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "py", - "prompt": "def is_simple_power(x: int, n: int) -> bool:\n \"\"\"Your task is to write a function that returns true if a number x is a simple\n power of n and false in other cases.\n x is a simple power of n if n**int=x\n For example:\n >>> is_simple_power(1, 4)\n True\n >>> is_simple_power(2, 2)\n True\n >>> is_simple_power(8, 2)\n True\n >>> is_simple_power(3, 2)\n False\n >>> is_simple_power(3, 1)\n False\n >>> is_simple_power(5, 3)\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(16, 2) == True\n assert candidate(143214, 16) == False\n assert candidate(4, 2) == True\n assert candidate(9, 3) == True\n assert candidate(16, 4) == True\n assert candidate(24, 2) == False\n assert candidate(128, 4) == False\n assert candidate(12, 6) == False\n assert candidate(1, 1) == True\n assert candidate(1, 12) == True\n\ndef test_check():\n check(is_simple_power)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "py", - "prompt": "def is_multiply_prime(a: int) -> bool:\n \"\"\"Write a function that returns true if the given number is the multiplication of 3 prime numbers\n and false otherwise.\n Knowing that (a) is less then 100. \n Example:\n >>> is_multiply_prime(30)\n True\n 30 = 2 * 3 * 5\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(5) == False\n assert candidate(30) == True\n assert candidate(8) == True\n assert candidate(10) == False\n assert candidate(125) == True\n assert candidate(105) == True\n assert candidate(126) == False\n assert candidate(729) == False\n assert candidate(891) == False\n assert candidate(1001) == True\n\ndef test_check():\n check(is_multiply_prime)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "py", - "prompt": "def right_angle_triangle(a: int, b: int, c: int) -> bool:\n \"\"\"\n Given the lengths of the three sides of a triangle. Return True if the three\n sides form a right-angled triangle, False otherwise.\n A right-angled triangle is a triangle in which one angle is right angle or \n 90 degree.\n Example:\n >>> right_angle_triangle(3, 4, 5)\n True\n >>> right_angle_triangle(1, 2, 3)\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(3, 4, 5) == True\n assert candidate(1, 2, 3) == False\n assert candidate(10, 6, 8) == True\n assert candidate(2, 2, 2) == False\n assert candidate(7, 24, 25) == True\n assert candidate(10, 5, 7) == False\n assert candidate(5, 12, 13) == True\n assert candidate(15, 8, 17) == True\n assert candidate(48, 55, 73) == True\n assert candidate(1, 1, 1) == False\n assert candidate(2, 2, 10) == False\n\ndef test_check():\n check(right_angle_triangle)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "py", - "prompt": "def any_int(x: float, y: float, z: float) -> bool:\n \"\"\"\n Create a function that takes 3 numbers.\n Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n Returns false in any other cases.\n \n Examples\n >>> any_int(5, 2, 7)\n True\n \n >>> any_int(3, 2, 2)\n False\n\n >>> any_int(3, -2, 1)\n True\n \n >>> any_int(3.6, -2.2, 2)\n False\n \n\n \n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(2, 3, 1) == True\n assert candidate(2.5, 2, 3) == False\n assert candidate(1.5, 5, 3.5) == False\n assert candidate(2, 6, 2) == False\n assert candidate(4, 2, 2) == True\n assert candidate(2.2, 2.2, 2.2) == False\n assert candidate(-4, 6, 2) == True\n assert candidate(2, 1, 1) == True\n assert candidate(3, 4, 7) == True\n assert candidate(3.0, 4, 7) == False\n\ndef test_check():\n check(any_int)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "py", - "prompt": "from typing import List\n\ndef sort_third(l: List[int]) -> List[int]:\n \"\"\"This function takes a list l and returns a list l' such that\n l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n to the values of the corresponding indicies of l, but sorted.\n >>> sort_third([1, 2, 3])\n [1, 2, 3]\n >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n [2, 6, 3, 4, 8, 9, 5]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([5, 6, 3, 4, 8, 9, 2]) == [2, 6, 3, 4, 8, 9, 5]\n assert candidate([5, 8, 3, 4, 6, 9, 2]) == [2, 8, 3, 4, 6, 9, 5]\n assert candidate([5, 6, 9, 4, 8, 3, 2]) == [2, 6, 9, 4, 8, 3, 5]\n assert candidate([5, 6, 3, 4, 8, 9, 2, 1]) == [2, 6, 3, 4, 8, 9, 5, 1]\n\ndef test_check():\n check(sort_third)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_53_add", - "language": "py", - "prompt": "def add(x: int, y: int) -> int:\n \"\"\"Add two numbers x and y\n >>> add(2, 3)\n 5\n >>> add(5, 7)\n 12\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(0, 1) == 1\n assert candidate(1, 0) == 1\n assert candidate(2, 3) == 5\n assert candidate(5, 7) == 12\n assert candidate(7, 5) == 12\n\ndef test_check():\n check(add)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_69_search", - "language": "py", - "prompt": "from typing import List\n\ndef search(lst: List[int]) -> int:\n \"\"\"\n You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n zero, and has a frequency greater than or equal to the value of the integer itself. \n The frequency of an integer is the number of times it appears in the list.\n If no such a value exist, return -1.\n Examples:\n >>> search([4, 1, 2, 2, 3, 1])\n 2\n >>> search([1, 2, 2, 3, 3, 3, 4, 4, 4])\n 3\n >>> search([5, 5, 4, 4, 4])\n -1\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([5, 5, 5, 5, 1]) == 1\n assert candidate([4, 1, 4, 1, 4, 4]) == 4\n assert candidate([3, 3]) == -1\n assert candidate([8, 8, 8, 8, 8, 8, 8, 8]) == 8\n assert candidate([2, 3, 3, 2, 2]) == 2\n assert candidate([2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]) == 1\n assert candidate([3, 2, 8, 2]) == 2\n assert candidate([6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]) == 1\n assert candidate([8, 8, 3, 6, 5, 6, 4]) == -1\n assert candidate([6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]) == 1\n assert candidate([1, 9, 10, 1, 3]) == 1\n assert candidate([6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]) == 5\n assert candidate([1]) == 1\n assert candidate([8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]) == 4\n assert candidate([2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]) == 2\n assert candidate([1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]) == 1\n assert candidate([9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]) == 4\n assert candidate([2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]) == 4\n assert candidate([9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]) == 2\n assert candidate([5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]) == -1\n assert candidate([10]) == -1\n assert candidate([9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]) == 2\n assert candidate([5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]) == 1\n assert candidate([7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]) == 1\n assert candidate([3, 10, 10, 9, 2]) == -1\n\ndef test_check():\n check(search)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "py", - "prompt": "def prime_length(string: str) -> bool:\n \"\"\"Write a function that takes a string and returns True if the string\n length is a prime number or False otherwise\n Examples\n >>> prime_length('Hello')\n True\n >>> prime_length('abcdcba')\n True\n >>> prime_length('kittens')\n True\n >>> prime_length('orange')\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('Hello') == True\n assert candidate('abcdcba') == True\n assert candidate('kittens') == True\n assert candidate('orange') == False\n assert candidate('wow') == True\n assert candidate('world') == True\n assert candidate('MadaM') == True\n assert candidate('Wow') == True\n assert candidate('') == False\n assert candidate('HI') == True\n assert candidate('go') == True\n assert candidate('gogo') == False\n assert candidate('aaaaaaaaaaaaaaa') == False\n assert candidate('Madam') == True\n assert candidate('M') == False\n assert candidate('0') == False\n\ndef test_check():\n check(prime_length)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_58_common", - "language": "py", - "prompt": "from typing import List\n\ndef common(l1: List[int], l2: List[int]) -> List[int]:\n \"\"\"Return sorted unique common elements for two lists.\n >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n [1, 5, 653]\n >>> common([5, 3, 2, 8], [3, 2])\n [2, 3]\n\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]) == [1, 5, 653]\n assert candidate([5, 3, 2, 8], [3, 2]) == [2, 3]\n assert candidate([4, 3, 2, 8], [3, 2, 4]) == [2, 3, 4]\n assert candidate([4, 3, 2, 8], []) == []\n\ndef test_check():\n check(common)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "py", - "prompt": "def special_factorial(n: int) -> int:\n \"\"\"The Brazilian factorial is defined as:\n brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n where n > 0\n\n For example:\n >>> special_factorial(4)\n 288\n\n The function will receive an integer as input and should return the special\n factorial of this integer.\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(4) == 288\n assert candidate(5) == 34560\n assert candidate(7) == 125411328000\n assert candidate(1) == 1\n\ndef test_check():\n check(special_factorial)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "py", - "prompt": "from typing import List\n\ndef exchange(lst1: List[int], lst2: List[int]) -> str:\n \"\"\"In this problem, you will implement a function that takes two lists of numbers,\n and determines whether it is possible to perform an exchange of elements\n between them to make lst1 a list of only even numbers.\n There is no limit on the number of exchanged elements between lst1 and lst2.\n If it is possible to exchange elements between the lst1 and lst2 to make\n all the elements of lst1 to be even, return \"YES\".\n Otherwise, return \"NO\".\n For example:\n >>> exchange([1, 2, 3, 4], [1, 2, 3, 4])\n 'YES'\n >>> exchange([1, 2, 3, 4], [1, 5, 3, 4])\n 'NO'\n It is assumed that the input lists will be non-empty.\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 3, 4], [1, 2, 3, 4]) == 'YES'\n assert candidate([1, 2, 3, 4], [1, 5, 3, 4]) == 'NO'\n assert candidate([1, 2, 3, 4], [2, 1, 4, 3]) == 'YES'\n assert candidate([5, 7, 3], [2, 6, 4]) == 'YES'\n assert candidate([5, 7, 3], [2, 6, 3]) == 'NO'\n assert candidate([3, 2, 6, 1, 8, 9], [3, 5, 5, 1, 1, 1]) == 'NO'\n assert candidate([100, 200], [200, 200]) == 'YES'\n\ndef test_check():\n check(exchange)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "py", - "prompt": "from typing import List\n\ndef add_elements(arr: List[int], k: int) -> int:\n \"\"\"\n Given a non-empty array of integers arr and an integer k, return\n the sum of the elements with at most two digits from the first k elements of arr.\n\n Example:\n\n >>> add_elements([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4)\n 24\n\n Constraints:\n 1. 1 <= len(arr) <= 100\n 2. 1 <= k <= len(arr)\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, -2, -3, 41, 57, 76, 87, 88, 99], 3) == -4\n assert candidate([111, 121, 3, 4000, 5, 6], 2) == 0\n assert candidate([11, 21, 3, 90, 5, 6, 7, 8, 9], 4) == 125\n assert candidate([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4) == 24\n assert candidate([1], 1) == 1\n\ndef test_check():\n check(add_elements)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "py", - "prompt": "def x_or_y(n: int, x: int, y: int) -> int:\n \"\"\"A simple program which should return the value of x if n is \n a prime number and should return the value of y otherwise.\n\n Examples:\n >>> x_or_y(7, 34, 12)\n 34\n >>> x_or_y(15, 8, 5)\n 5\n \n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(7, 34, 12) == 34\n assert candidate(15, 8, 5) == 5\n assert candidate(3, 33, 5212) == 33\n assert candidate(1259, 3, 52) == 3\n assert candidate(7919, -1, 12) == -1\n assert candidate(3609, 1245, 583) == 583\n assert candidate(91, 56, 129) == 129\n assert candidate(6, 34, 1234) == 1234\n assert candidate(1, 2, 0) == 0\n assert candidate(2, 2, 0) == 2\n\ndef test_check():\n check(x_or_y)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "py", - "prompt": "def triangle_area(a: int, h: int) -> float:\n \"\"\"Given length of a side and high return area for a triangle.\n >>> triangle_area(5, 3)\n 7.5\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(5, 3) == 7.5\n assert candidate(2, 2) == 2.0\n assert candidate(10, 8) == 40.0\n\ndef test_check():\n check(triangle_area)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "py", - "prompt": "from typing import List\n\ndef tri(n: int) -> List[int]:\n \"\"\"Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n the last couple centuries. However, what people don't know is Tribonacci sequence.\n Tribonacci sequence is defined by the recurrence:\n tri(1) = 3\n tri(n) = 1 + n / 2, if n is even.\n tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n For example:\n tri(2) = 1 + (2 / 2) = 2\n tri(4) = 3\n tri(3) = tri(2) + tri(1) + tri(4)\n = 2 + 3 + 3 = 8 \n You are given a non-negative integer number n, you have to a return a list of the \n first n + 1 numbers of the Tribonacci sequence.\n Examples:\n >>> tri(3)\n [1, 3, 2, 8]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(3) == [1, 3, 2, 8]\n assert candidate(4) == [1, 3, 2, 8, 3]\n assert candidate(5) == [1, 3, 2, 8, 3, 15]\n assert candidate(6) == [1, 3, 2, 8, 3, 15, 4]\n assert candidate(7) == [1, 3, 2, 8, 3, 15, 4, 24]\n assert candidate(8) == [1, 3, 2, 8, 3, 15, 4, 24, 5]\n assert candidate(9) == [1, 3, 2, 8, 3, 15, 4, 24, 5, 35]\n assert candidate(20) == [1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11]\n assert candidate(0) == [1]\n assert candidate(1) == [1, 3]\n\ndef test_check():\n check(tri)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "py", - "prompt": "from typing import List\n\ndef match_parens(lst: List[str]) -> str:\n \"\"\"\n You are given a list of two strings, both strings consist of open\n parentheses '(' or close parentheses ')' only.\n Your job is to check if it is possible to concatenate the two strings in\n some order, that the resulting string will be good.\n A string S is considered to be good if and only if all parentheses in S\n are balanced. For example: the string '(())()' is good, while the string\n '())' is not.\n Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n\n Examples:\n >>> match_parens(['()(', ')'])\n 'Yes'\n >>> match_parens([')', ')'])\n 'No'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(['()(', ')']) == 'Yes'\n assert candidate([')', ')']) == 'No'\n assert candidate(['(()(())', '())())']) == 'No'\n assert candidate([')())', '(()()(']) == 'Yes'\n assert candidate(['(())))', '(()())((']) == 'Yes'\n assert candidate(['()', '())']) == 'No'\n assert candidate(['(()(', '()))()']) == 'Yes'\n assert candidate(['((((', '((())']) == 'No'\n assert candidate([')(()', '(()(']) == 'No'\n assert candidate([')(', ')(']) == 'No'\n assert candidate(['(', ')']) == 'Yes'\n assert candidate([')', '(']) == 'Yes'\n\ndef test_check():\n check(match_parens)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "py", - "prompt": "from typing import List\n\ndef remove_duplicates(numbers: List[int]) -> List[int]:\n \"\"\" From a list of integers, remove all elements that occur more than once.\n Keep order of elements left the same as in the input.\n >>> remove_duplicates([1, 2, 3, 2, 4])\n [1, 3, 4]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == []\n assert candidate([1, 2, 3, 4]) == [1, 2, 3, 4]\n assert candidate([1, 2, 3, 2, 4, 3, 5]) == [1, 4, 5]\n\ndef test_check():\n check(remove_duplicates)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "py", - "prompt": "def greatest_common_divisor(a: int, b: int) -> int:\n \"\"\" Return a greatest common divisor of two integers a and b\n >>> greatest_common_divisor(3, 5)\n 1\n >>> greatest_common_divisor(25, 15)\n 5\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(3, 7) == 1\n assert candidate(10, 15) == 5\n assert candidate(49, 14) == 7\n assert candidate(144, 60) == 12\n\ndef test_check():\n check(greatest_common_divisor)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "py", - "prompt": "def is_palindrome(text: str) -> bool:\n \"\"\"\n Checks if given string is a palindrome\n >>> is_palindrome('')\n True\n >>> is_palindrome('aba')\n True\n >>> is_palindrome('aaaaa')\n True\n >>> is_palindrome('zbcd')\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('') == True\n assert candidate('aba') == True\n assert candidate('aaaaa') == True\n assert candidate('zbcd') == False\n assert candidate('xywyx') == True\n assert candidate('xywyz') == False\n assert candidate('xywzx') == False\n\ndef test_check():\n check(is_palindrome)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "py", - "prompt": "from typing import List\n\ndef derivative(xs: List[int]) -> List[int]:\n \"\"\" xs represent coefficients of a polynomial.\n xs[0] + xs[1] * x + xs[2] * x^2 + ....\n Return derivative of this polynomial in the same form.\n >>> derivative([3, 1, 2, 4, 5])\n [1, 4, 12, 20]\n >>> derivative([1, 2, 3])\n [2, 6]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([3, 1, 2, 4, 5]) == [1, 4, 12, 20]\n assert candidate([1, 2, 3]) == [2, 6]\n assert candidate([3, 2, 1]) == [2, 2]\n assert candidate([3, 2, 1, 0, 4]) == [2, 2, 0, 16]\n assert candidate([1]) == []\n\ndef test_check():\n check(derivative)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "py", - "prompt": "def fruit_distribution(s: str, n: int) -> int:\n \"\"\"\n In this task, you will be given a string that represents a number of apples and oranges \n that are distributed in a basket of fruit this basket contains \n apples, oranges, and mango fruits. Given the string that represents the total number of \n the oranges and apples and an integer that represent the total number of the fruits \n in the basket return the number of the mango fruits in the basket.\n for examble:\n >>> fruit_distribution('5 apples and 6 oranges', 19)\n 8\n >>> fruit_distribution('0 apples and 1 oranges', 3)\n 2\n >>> fruit_distribution('2 apples and 3 oranges', 100)\n 95\n >>> fruit_distribution('100 apples and 1 oranges', 120)\n 19\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('5 apples and 6 oranges', 19) == 8\n assert candidate('5 apples and 6 oranges', 21) == 10\n assert candidate('0 apples and 1 oranges', 3) == 2\n assert candidate('1 apples and 0 oranges', 3) == 2\n assert candidate('2 apples and 3 oranges', 100) == 95\n assert candidate('2 apples and 3 oranges', 5) == 0\n assert candidate('1 apples and 100 oranges', 120) == 19\n\ndef test_check():\n check(fruit_distribution)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "py", - "prompt": "def iscube(a: int) -> bool:\n \"\"\"\n Write a function that takes an integer a and returns True \n if this ingeger is a cube of some integer number.\n Note: you may assume the input is always valid.\n Examples:\n >>> iscube(1)\n True\n >>> iscube(2)\n False\n >>> iscube(-1)\n True\n >>> iscube(64)\n True\n >>> iscube(0)\n True\n >>> iscube(180)\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(1) == True\n assert candidate(2) == False\n assert candidate(-1) == True\n assert candidate(64) == True\n assert candidate(180) == False\n assert candidate(1000) == True\n assert candidate(0) == True\n assert candidate(1729) == False\n\ndef test_check():\n check(iscube)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "py", - "prompt": "from typing import List\n\ndef sort_array(arr: List[int]) -> List[int]:\n \"\"\"\n In this Kata, you have to sort an array of non-negative integers according to\n number of ones in their binary representation in ascending order.\n For similar number of ones, sort based on decimal value.\n\n It must be implemented like this:\n >>> sort_array([1, 5, 2, 3, 4])\n [1, 2, 3, 4, 5]\n >>> sort_array([-2, -3, -4, -5, -6])\n [-6, -5, -4, -3, -2]\n >>> sort_array([1, 0, 2, 3, 4])\n [0, 1, 2, 3, 4]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 5, 2, 3, 4]) == [1, 2, 4, 3, 5]\n assert candidate([-2, -3, -4, -5, -6]) == [-4, -2, -6, -5, -3]\n assert candidate([1, 0, 2, 3, 4]) == [0, 1, 2, 4, 3]\n assert candidate([]) == []\n assert candidate([2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]) == [2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77]\n assert candidate([3, 6, 44, 12, 32, 5]) == [32, 3, 5, 6, 12, 44]\n assert candidate([2, 4, 8, 16, 32]) == [2, 4, 8, 16, 32]\n assert candidate([2, 4, 8, 16, 32]) == [2, 4, 8, 16, 32]\n\ndef test_check():\n check(sort_array)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "py", - "prompt": "from typing import List\n\ndef odd_count(lst: List[str]) -> List[str]:\n \"\"\"Given a list of strings, where each string consists of only digits, return a list.\n Each element i of the output should be \"the number of odd elements in the\n string i of the input.\" where all the i's should be replaced by the number\n of odd digits in the i'th string of the input.\n\n >>> odd_count(['1234567'])\n ['the number of odd elements 4n the str4ng 4 of the 4nput.']\n >>> odd_count(['3', '11111111'])\n ['the number of odd elements 1n the str1ng 1 of the 1nput.', 'the number of odd elements 8n the str8ng 8 of the 8nput.']\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(['1234567']) == ['the number of odd elements 4n the str4ng 4 of the 4nput.']\n 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.']\n assert candidate(['271', '137', '314']) == ['the number of odd elements 2n the str2ng 2 of the 2nput.', 'the number of odd elements 3n the str3ng 3 of the 3nput.', 'the number of odd elements 2n the str2ng 2 of the 2nput.']\n\ndef test_check():\n check(odd_count)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "py", - "prompt": "def correct_bracketing(brackets: str) -> bool:\n \"\"\" brackets is a string of \"(\" and \")\".\n return True if every opening bracket has a corresponding closing bracket.\n\n >>> correct_bracketing('(')\n False\n >>> correct_bracketing('()')\n True\n >>> correct_bracketing('(()())')\n True\n >>> correct_bracketing(')(()')\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('()') == True\n assert candidate('(()())') == True\n assert candidate('()()(()())()') == True\n assert candidate('()()((()()())())(()()(()))') == True\n assert candidate('((()())))') == False\n assert candidate(')(()') == False\n assert candidate('(') == False\n assert candidate('((((') == False\n assert candidate(')') == False\n assert candidate('(()') == False\n assert candidate('()()(()())())(()') == False\n assert candidate('()()(()())()))()') == False\n\ndef test_check():\n check(correct_bracketing)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "py", - "prompt": "def digitSum(s: str) -> int:\n \"\"\"Task\n Write a function that takes a string as input and returns the sum of the upper characters only'\n ASCII codes.\n\n Examples:\n >>> digitSum('')\n 0\n >>> digitSum('abAB')\n 131\n >>> digitSum('abcCd')\n 67\n >>> digitSum('helloE')\n 69\n >>> digitSum('woArBld')\n 131\n >>> digitSum('aAaaaXa')\n 153\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('') == 0\n assert candidate('abAB') == 131\n assert candidate('abcCd') == 67\n assert candidate('helloE') == 69\n assert candidate('woArBld') == 131\n assert candidate('aAaaaXa') == 153\n assert candidate(' How are yOu?') == 151\n assert candidate('You arE Very Smart') == 327\n\ndef test_check():\n check(digitSum)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "py", - "prompt": "from typing import List\n\ndef sorted_list_sum(lst: List[str]) -> List[str]:\n \"\"\"Write a function that accepts a list of strings as a parameter,\n deletes the strings that have odd lengths from it,\n and returns the resulted list with a sorted order,\n The list is always a list of strings and never an array of numbers,\n and it may contain duplicates.\n The order of the list should be ascending by length of each word, and you\n should return the list sorted by that rule.\n If two words have the same length, sort the list alphabetically.\n The function should return a list of strings in sorted order.\n You may assume that all words will have the same length.\n For example:\n >>> list_sort(['aa', 'a', 'aaa'])\n ['aa']\n >>> list_sort(['ab', 'a', 'aaa', 'cd'])\n ['ab', 'cd']\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(['aa', 'a', 'aaa']) == ['aa']\n assert candidate(['school', 'AI', 'asdf', 'b']) == ['AI', 'asdf', 'school']\n assert candidate(['d', 'b', 'c', 'a']) == []\n assert candidate(['d', 'dcba', 'abcd', 'a']) == ['abcd', 'dcba']\n assert candidate(['AI', 'ai', 'au']) == ['AI', 'ai', 'au']\n assert candidate(['a', 'b', 'b', 'c', 'c', 'a']) == []\n assert candidate(['aaaa', 'bbbb', 'dd', 'cc']) == ['cc', 'dd', 'aaaa', 'bbbb']\n\ndef test_check():\n check(sorted_list_sum)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "py", - "prompt": "from typing import List, Optional\n\ndef prod_signs(arr: List[int]) -> Optional[int]:\n \"\"\"\n You are given an array arr of integers and you need to return\n sum of magnitudes of integers multiplied by product of all signs\n of each number in the array, represented by 1, -1 or 0.\n Note: return None for empty arr.\n\n Example:\n >>> prod_signs([1, 2, 2, -4])\n 9\n >>> prod_signs([0, 1])\n 0\n >>> prod_signs([])\n None\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 2, -4]) == -9\n assert candidate([0, 1]) == 0\n assert candidate([1, 1, 1, 2, 3, -1, 1]) == -10\n assert candidate([]) == None\n assert candidate([2, 4, 1, 2, -1, -1, 9]) == 20\n assert candidate([-1, 1, -1, 1]) == 4\n assert candidate([-1, 1, 1, 1]) == -4\n assert candidate([-1, 1, 1, 0]) == 0\n\ndef test_check():\n check(prod_signs)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "py", - "prompt": "from typing import List\n\ndef incr_list(l: List[int]) -> List[int]:\n \"\"\"Return list with elements incremented by 1.\n >>> incr_list([1, 2, 3])\n [2, 3, 4]\n >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123])\n [6, 4, 6, 3, 4, 4, 10, 1, 124]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == []\n assert candidate([3, 2, 1]) == [4, 3, 2]\n assert candidate([5, 2, 5, 2, 3, 3, 9, 0, 123]) == [6, 3, 6, 3, 4, 4, 10, 1, 124]\n\ndef test_check():\n check(incr_list)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "py", - "prompt": "from typing import List\n\ndef rolling_max(numbers: List[int]) -> List[int]:\n \"\"\" From a given list of integers, generate a list of rolling maximum element found until given moment\n in the sequence.\n >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n [1, 2, 3, 3, 3, 4, 4]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == []\n assert candidate([1, 2, 3, 4]) == [1, 2, 3, 4]\n assert candidate([4, 3, 2, 1]) == [4, 4, 4, 4]\n assert candidate([3, 2, 3, 100, 3]) == [3, 3, 3, 100, 100]\n\ndef test_check():\n check(rolling_max)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "py", - "prompt": "from typing import List\n\ndef separate_paren_groups(paren_string: str) -> List[str]:\n \"\"\" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n separate those group into separate strings and return the list of those.\n Separate groups are balanced (each open brace is properly closed) and not nested within each other\n Ignore any spaces in the input string.\n >>> separate_paren_groups('( ) (( )) (( )( ))')\n ['()', '(())', '(()())']\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('(()()) ((())) () ((())()())') == ['(()())', '((()))', '()', '((())()())']\n assert candidate('() (()) ((())) (((())))') == ['()', '(())', '((()))', '(((())))']\n assert candidate('(()(())((())))') == ['(()(())((())))']\n assert candidate('( ) (( )) (( )( ))') == ['()', '(())', '(()())']\n\ndef test_check():\n check(separate_paren_groups)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "py", - "prompt": "from typing import List\n\ndef words_string(s: str) -> List[str]:\n \"\"\"\n You will be given a string of words separated by commas or spaces. Your task is\n to split the string into words and return an array of the words.\n \n For example:\n >>> words_string('Hi, my name is John')\n ['Hi', 'my', 'name', 'is', 'John']\n >>> words_string('One, two, three, four, five, six')\n ['One', 'two', 'three', 'four', 'five', 'six']\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('Hi, my name is John') == ['Hi', 'my', 'name', 'is', 'John']\n assert candidate('One, two, three, four, five, six') == ['One', 'two', 'three', 'four', 'five', 'six']\n assert candidate('Hi, my name') == ['Hi', 'my', 'name']\n assert candidate('One,, two, three, four, five, six,') == ['One', 'two', 'three', 'four', 'five', 'six']\n assert candidate('') == []\n assert candidate('ahmed , gamal') == ['ahmed', 'gamal']\n\ndef test_check():\n check(words_string)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "py", - "prompt": "from typing import Union\n\ndef compare_one(a: Union[int, float, str], b: Union[int, float, str]) -> Union[int, float, str, None]:\n \"\"\"\n Create a function that takes integers, floats, or strings representing\n real numbers, and returns the larger variable in its given variable type.\n Return None if the values are equal.\n Note: If a real number is represented as a string, the floating point might be . or ,\n\n >>> compare_one(1, 2.5)\n 2.5\n >>> compare_one(1, '2,3')\n '2,3'\n >>> compare_one('5,1', '6')\n '6'\n >>> compare_one('1', 1)\n None\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(1, 2) == 2\n assert candidate(1, 2.5) == 2.5\n assert candidate(2, 3) == 3\n assert candidate(5, 6) == 6\n assert candidate(1, '2,3') == '2,3'\n assert candidate('5,1', '6') == '6'\n assert candidate('1', '2') == '2'\n assert candidate('1', 1) == None\n\ndef test_check():\n check(compare_one)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "py", - "prompt": "from typing import List, Any\n\ndef filter_integers(values: List[Any]) -> List[int]:\n \"\"\" Filter given list of any python values only for integers\n >>> filter_integers(['a', 3.14, 5])\n [5]\n >>> filter_integers([1, 2, 3, 'abc', { }, []])\n [1, 2, 3]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == []\n assert candidate([4, { }, [], 23.2, 9, 'adasd']) == [4, 9]\n assert candidate([3, 'c', 3, 3, 'a', 'b']) == [3, 3, 3]\n\ndef test_check():\n check(filter_integers)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "py", - "prompt": "from typing import List\n\ndef sort_even(l: List[int]) -> List[int]:\n \"\"\"This function takes a list l and returns a list l' such that\n l' is identical to l in the odd indicies, while its values at the even indicies are equal\n to the values of the even indicies of l, but sorted.\n >>> sort_even([1, 2, 3])\n [1, 2, 3]\n >>> sort_even([5, 6, 3, 4])\n [3, 6, 5, 4]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 3]) == [1, 2, 3]\n assert candidate([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]) == [-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123]\n assert candidate([5, 8, -12, 4, 23, 2, 3, 11, 12, -10]) == [-12, 8, 3, 4, 5, 2, 12, 11, 23, -10]\n\ndef test_check():\n check(sort_even)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "py", - "prompt": "from typing import List\n\ndef compare(game: List[int], guess: List[int]) -> List[int]:\n \"\"\"I think we all remember that feeling when the result of some long-awaited\n event is finally known. The feelings and thoughts you have at that moment are\n definitely worth noting down and comparing.\n Your task is to determine if a person correctly guessed the results of a number of matches.\n You are given two arrays of scores and guesses of equal length, where each index shows a match. \n Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n the value is 0, and if not, the value is the absolute difference between the guess and the score.\n \n \n example:\n\n >>> compare([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2])\n [0, 0, 0, 0, 3, 3]\n >>> compare([0, 5, 0, 0, 0, 4], [4, 1, 1, 0, 0, -2])\n [4, 4, 1, 0, 0, 6]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2]) == [0, 0, 0, 0, 3, 3]\n assert candidate([0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]) == [0, 0, 0, 0, 0, 0]\n assert candidate([1, 2, 3], [-1, -2, -3]) == [2, 4, 6]\n assert candidate([1, 2, 3, 5], [-1, 2, 3, 4]) == [2, 0, 0, 1]\n\ndef test_check():\n check(compare)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "py", - "prompt": "from typing import Tuple\n\ndef even_odd_palindrome(n: int) -> Tuple[int, int]:\n \"\"\"\n Given a positive integer n, return a tuple that has the number of even and odd\n integer palindromes that fall within the range(1, n), inclusive.\n\n Example 1:\n\n >>> even_odd_palindrome(3)\n (1, 2)\n Explanation:\n Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n\n Example 2:\n\n >>> even_odd_palindrome(12)\n (4, 6)\n Explanation:\n Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n\n Note:\n 1. 1 <= n <= 10^3\n 2. returned tuple has the number of even and odd integer palindromes respectively.\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(123) == (8, 13)\n assert candidate(12) == (4, 6)\n assert candidate(3) == (1, 2)\n assert candidate(63) == (6, 8)\n assert candidate(25) == (5, 6)\n assert candidate(19) == (4, 6)\n assert candidate(9) == (4, 5)\n assert candidate(1) == (0, 1)\n\ndef test_check():\n check(even_odd_palindrome)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "py", - "prompt": "def fib4(n: int) -> int:\n \"\"\"The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fib4(0) -> 0\n fib4(1) -> 0\n fib4(2) -> 2\n fib4(3) -> 0\n fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n >>> fib4(5)\n 4\n >>> fib4(6)\n 8\n >>> fib4(7)\n 14\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(5) == 4\n assert candidate(8) == 28\n assert candidate(10) == 104\n assert candidate(12) == 386\n\ndef test_check():\n check(fib4)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "py", - "prompt": "from typing import List\n\ndef generate_integers(a: int, b: int) -> List[int]:\n \"\"\"\n Given two positive integers a and b, return the even digits between a\n and b, in ascending order.\n\n For example:\n >>> generate_integers(2, 8)\n [2, 4, 6, 8]\n >>> generate_integers(8, 2)\n [2, 4, 6, 8]\n >>> generate_integers(10, 14)\n []\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(2, 10) == [2, 4, 6, 8]\n assert candidate(10, 2) == [2, 4, 6, 8]\n assert candidate(132, 2) == [2, 4, 6, 8]\n assert candidate(17, 89) == []\n\ndef test_check():\n check(generate_integers)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "py", - "prompt": "from typing import List\n\ndef mean_absolute_deviation(numbers: List[float]) -> float:\n \"\"\" For a given list of input numbers, calculate Mean Absolute Deviation\n around the mean of this dataset.\n Mean Absolute Deviation is the average absolute difference between each\n element and a centerpoint (mean in this case):\n MAD = average | x - x_mean |\n >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n 1.0\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1.0, 2.0]) == 0.5\n assert candidate([1.0, 2.0, 3.0, 4.0]) == 1.0\n assert candidate([1.0, 2.0, 3.0, 4.0, 5.0]) == 1.2\n\ndef test_check():\n check(mean_absolute_deviation)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "py", - "prompt": "def encrypt(s: str) -> str:\n \"\"\"Create a function encrypt that takes a string as an argument and\n returns a string encrypted with the alphabet being rotated. \n The alphabet should be rotated in a manner such that the letters \n shift down by two multiplied to two places.\n For example:\n >>> encrypt('hi')\n 'lm'\n >>> encrypt('asdfghjkl')\n 'ewhjklnop'\n >>> encrypt('gf')\n 'kj'\n >>> encrypt('et')\n 'ix'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('hi') == 'lm'\n assert candidate('asdfghjkl') == 'ewhjklnop'\n assert candidate('gf') == 'kj'\n assert candidate('et') == 'ix'\n assert candidate('faewfawefaewg') == 'jeiajeaijeiak'\n assert candidate('hellomyfriend') == 'lippsqcjvmirh'\n assert candidate('dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh') == 'hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl'\n assert candidate('a') == 'e'\n\ndef test_check():\n check(encrypt)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "py", - "prompt": "from typing import List\n\ndef get_odd_collatz(n: int) -> List[int]:\n \"\"\"\n Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n\n The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n as follows: start with any positive integer n. Then each term is obtained from the \n previous term as follows: if the previous term is even, the next term is one half of \n the previous term. If the previous term is odd, the next term is 3 times the previous\n term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n\n Note: \n 1. Collatz(1) is [1].\n 2. returned list sorted in increasing order.\n\n For example:\n get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n >>> get_odd_collatz(5)\n [1, 5]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(14) == [1, 5, 7, 11, 13, 17]\n assert candidate(5) == [1, 5]\n assert candidate(12) == [1, 3, 5]\n assert candidate(1) == [1]\n\ndef test_check():\n check(get_odd_collatz)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "py", - "prompt": "def how_many_times(string: str, substring: str) -> int:\n \"\"\" Find how many times a given substring can be found in the original string. Count overlaping cases.\n >>> how_many_times('', 'a')\n 0\n >>> how_many_times('aaa', 'a')\n 3\n >>> how_many_times('aaaa', 'aa')\n 3\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('', 'x') == 0\n assert candidate('xyxyxyx', 'x') == 4\n assert candidate('cacacacac', 'cac') == 4\n assert candidate('john doe', 'john') == 1\n\ndef test_check():\n check(how_many_times)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "py", - "prompt": "from typing import List\n\ndef move_one_ball(arr: List[int]) -> bool:\n \"\"\"We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n numbers in the array will be randomly ordered. Your task is to determine if\n it is possible to get an array sorted in non-decreasing order by performing \n the following operation on the given array:\n You are allowed to perform right shift operation any number of times.\n \n One right shift operation means shifting all elements of the array by one\n position in the right direction. The last element of the array will be moved to\n the starting position in the array i.e. 0th index. \n\n If it is possible to obtain the sorted array by performing the above operation\n then return True else return False.\n If the given array is empty then return True.\n\n Note: The given list is guaranteed to have unique elements.\n\n For Example:\n \n >>> move_one_ball([3, 4, 5, 1, 2])\n True\n Explanation: By performin 2 right shift operations, non-decreasing order can\n be achieved for the given array.\n >>> move_one_ball([3, 5, 4, 1, 2])\n False\n Explanation:It is not possible to get non-decreasing order for the given\n array by performing any number of right shift operations.\n \n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([3, 4, 5, 1, 2]) == True\n assert candidate([3, 5, 10, 1, 2]) == True\n assert candidate([4, 3, 1, 2]) == False\n assert candidate([3, 5, 4, 1, 2]) == False\n assert candidate([]) == True\n\ndef test_check():\n check(move_one_ball)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "py", - "prompt": "from typing import List\n\ndef order_by_points(nums: List[int]) -> List[int]:\n \"\"\"\n Write a function which sorts the given list of integers\n in ascending order according to the sum of their digits.\n Note: if there are several items with similar sum of their digits,\n order them based on their index in original list.\n\n For example:\n >>> order_by_points([1, 11, -1, -11, -12])\n [-1, -11, 1, -12, 11]\n >>> order_by_points([])\n []\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]\n assert candidate([1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]) == [0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457]\n assert candidate([]) == []\n assert candidate([1, -11, -32, 43, 54, -98, 2, -3]) == [-3, -32, -98, -11, 1, 2, 43, 54]\n assert candidate([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) == [1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9]\n assert candidate([0, 6, 6, -76, -21, 23, 4]) == [-76, -21, 0, 4, 23, 6, 6]\n\ndef test_check():\n check(order_by_points)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "py", - "prompt": "from typing import List\n\ndef factorize(n: int) -> List[int]:\n \"\"\" Return list of prime factors of given integer in the order from smallest to largest.\n Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n Input number should be equal to the product of all factors\n >>> factorize(8)\n [2, 2, 2]\n >>> factorize(25)\n [5, 5]\n >>> factorize(70)\n [2, 5, 7]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(2) == [2]\n assert candidate(4) == [2, 2]\n assert candidate(8) == [2, 2, 2]\n assert candidate(57) == [3, 19]\n assert candidate(3249) == [3, 3, 19, 19]\n assert candidate(185193) == [3, 3, 3, 19, 19, 19]\n assert candidate(20577) == [3, 19, 19, 19]\n assert candidate(18) == [2, 3, 3]\n\ndef test_check():\n check(factorize)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "py", - "prompt": "from typing import List\n\ndef below_threshold(l: List[int], t: int) -> bool:\n \"\"\"Return True if all numbers in the list l are below threshold t.\n >>> below_threshold([1, 2, 4, 10], 100)\n True\n >>> below_threshold([1, 20, 4, 10], 5)\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 4, 10], 100) == True\n assert candidate([1, 20, 4, 10], 5) == False\n assert candidate([1, 20, 4, 10], 21) == True\n assert candidate([1, 20, 4, 10], 22) == True\n assert candidate([1, 8, 4, 10], 11) == True\n assert candidate([1, 8, 4, 10], 10) == False\n\ndef test_check():\n check(below_threshold)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "py", - "prompt": "from typing import Union\n\ndef rounded_avg(n: int, m: int) -> Union[str, int]:\n \"\"\"You are given two positive integers n and m, and your task is to compute the\n average of the integers from n through m (including n and m). \n Round the answer to the nearest integer and convert that to binary.\n If n is greater than m, return -1.\n Example:\n >>> rounded_avg(1, 5)\n '0b11'\n >>> rounded_avg(7, 5)\n -1\n >>> rounded_avg(10, 20)\n '0b1111'\n >>> rounded_avg(20, 33)\n '0b11010'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(1, 5) == '0b11'\n assert candidate(7, 13) == '0b1010'\n assert candidate(964, 977) == '0b1111001010'\n assert candidate(996, 997) == '0b1111100100'\n assert candidate(560, 851) == '0b1011000010'\n assert candidate(185, 546) == '0b101101110'\n assert candidate(362, 496) == '0b110101101'\n assert candidate(350, 902) == '0b1001110010'\n assert candidate(197, 233) == '0b11010111'\n assert candidate(7, 5) == -1\n assert candidate(5, 1) == -1\n assert candidate(5, 5) == '0b101'\n\ndef test_check():\n check(rounded_avg)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "py", - "prompt": "from typing import List\n\ndef parse_nested_parens(paren_string: str) -> List[int]:\n \"\"\" Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n For each of the group, output the deepest level of nesting of parentheses.\n E.g. (()()) has maximum two levels of nesting while ((())) has three.\n\n >>> parse_nested_parens('(()()) ((())) () ((())()())')\n [2, 3, 1, 3]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('(()()) ((())) () ((())()())') == [2, 3, 1, 3]\n assert candidate('() (()) ((())) (((())))') == [1, 2, 3, 4]\n assert candidate('(()(())((())))') == [4]\n\ndef test_check():\n check(parse_nested_parens)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "py", - "prompt": "from typing import List\n\ndef solution(lst: List[int]) -> int:\n \"\"\"Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n \n\n Examples\n >>> solution([5, 8, 7, 1])\n 12\n >>> solution([3, 3, 3, 3, 3])\n 9\n >>> solution([30, 13, 24, 321])\n 0\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([5, 8, 7, 1]) == 12\n assert candidate([3, 3, 3, 3, 3]) == 9\n assert candidate([30, 13, 24, 321]) == 0\n assert candidate([5, 9]) == 5\n assert candidate([2, 4, 8]) == 0\n assert candidate([30, 13, 23, 32]) == 23\n assert candidate([3, 13, 2, 9]) == 3\n\ndef test_check():\n check(solution)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "py", - "prompt": "def get_max_triples(n: int) -> int:\n \"\"\"\n You are given a positive integer n. You have to create an integer array a of length n.\n For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n and a[i] + a[j] + a[k] is a multiple of 3.\n\n Example :\n >>> get_max_triples(5)\n 1\n Explanation: \n a = [1, 3, 7, 13, 21]\n The only valid triple is (1, 7, 13).\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(5) == 1\n assert candidate(6) == 4\n assert candidate(10) == 36\n assert candidate(100) == 53361\n\ndef test_check():\n check(get_max_triples)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "py", - "prompt": "from typing import Tuple\n\ndef bf(planet1: str, planet2: str) -> Tuple[str, ...]:\n \"\"\"\n There are eight planets in our solar system: the closerst to the Sun \n is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n Uranus, Neptune.\n Write a function that takes two planet names as strings planet1 and planet2. \n The function should return a tuple containing all planets whose orbits are \n located between the orbit of planet1 and the orbit of planet2, sorted by \n the proximity to the sun. \n The function should return an empty tuple if planet1 or planet2\n are not correct planet names. \n Examples\n >>> bf('Jupiter', 'Neptune')\n ('Saturn', 'Uranus')\n >>> bf('Earth', 'Mercury')\n 'Venus'\n >>> bf('Mercury', 'Uranus')\n ('Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn')\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('Jupiter', 'Neptune') == ('Saturn', 'Uranus')\n assert candidate('Earth', 'Mercury') == ('Venus',)\n assert candidate('Mercury', 'Uranus') == ('Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn')\n assert candidate('Neptune', 'Venus') == ('Earth', 'Mars', 'Jupiter', 'Saturn', 'Uranus')\n assert candidate('Earth', 'Earth') == ()\n assert candidate('Mars', 'Earth') == ()\n assert candidate('Jupiter', 'Makemake') == ()\n\ndef test_check():\n check(bf)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "py", - "prompt": "from typing import List, Optional\n\ndef next_smallest(lst: List[int]) -> Optional[int]:\n \"\"\"\n You are given a list of integers.\n Write a function next_smallest() that returns the 2nd smallest element of the list.\n Return None if there is no such element.\n >>> next_smallest([1, 2, 3, 4, 5])\n 2\n >>> next_smallest([5, 1, 4, 3, 2])\n 2\n >>> next_smallest([])\n None\n >>> next_smallest([1, 1])\n None\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 3, 4, 5]) == 2\n assert candidate([5, 1, 4, 3, 2]) == 2\n assert candidate([]) == None\n assert candidate([1, 1]) == None\n assert candidate([1, 1, 1, 1, 0]) == 1\n assert candidate([1, 1]) == None\n assert candidate([-35, 34, 12, -45]) == -35\n\ndef test_check():\n check(next_smallest)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "py", - "prompt": "def sort_numbers(numbers: str) -> str:\n \"\"\" Input is a space-delimited string of numberals from 'zero' to 'nine'.\n Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n Return the string with numbers sorted from smallest to largest\n >>> sort_numbers('three one five')\n 'one three five'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('') == ''\n assert candidate('three') == 'three'\n assert candidate('three five nine') == 'three five nine'\n assert candidate('five zero four seven nine eight') == 'zero four five seven eight nine'\n assert candidate('six five four three two one zero') == 'zero one two three four five six'\n\ndef test_check():\n check(sort_numbers)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "py", - "prompt": "def cycpattern_check(a: str, b: str) -> bool:\n \"\"\"You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n >>> cycpattern_check('abcd', 'abd')\n False\n >>> cycpattern_check('hello', 'ell')\n True\n >>> cycpattern_check('whassup', 'psus')\n False\n >>> cycpattern_check('abab', 'baa')\n True\n >>> cycpattern_check('efef', 'eeff')\n False\n >>> cycpattern_check('himenss', 'simen')\n True\n\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('xyzw', 'xyw') == False\n assert candidate('yello', 'ell') == True\n assert candidate('whattup', 'ptut') == False\n assert candidate('efef', 'fee') == True\n assert candidate('abab', 'aabb') == False\n assert candidate('winemtt', 'tinem') == True\n\ndef test_check():\n check(cycpattern_check)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "py", - "prompt": "def decimal_to_binary(decimal: int) -> str:\n \"\"\"You will be given a number in decimal form and your task is to convert it to\n binary format. The function should return a string, with each character representing a binary\n number. Each character in the string will be '0' or '1'.\n\n There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n The extra characters are there to help with the format.\n\n Examples:\n >>> decimal_to_binary(15)\n 'db1111db'\n >>> decimal_to_binary(32)\n 'db100000db'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(0) == 'db0db'\n assert candidate(32) == 'db100000db'\n assert candidate(103) == 'db1100111db'\n assert candidate(15) == 'db1111db'\n\ndef test_check():\n check(decimal_to_binary)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "py", - "prompt": "from typing import List\n\ndef filter_by_substring(strings: List[str], substring: str) -> List[str]:\n \"\"\" Filter an input list of strings only for ones that contain given substring\n >>> filter_by_substring([], 'a')\n []\n >>> filter_by_substring(['abc', 'bacd', 'cde', 'array'], 'a')\n ['abc', 'bacd', 'array']\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([], 'john') == []\n assert candidate(['xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'], 'xxx') == ['xxx', 'xxxAAA', 'xxx']\n assert candidate(['xxx', 'asd', 'aaaxxy', 'john doe', 'xxxAAA', 'xxx'], 'xx') == ['xxx', 'aaaxxy', 'xxxAAA', 'xxx']\n assert candidate(['grunt', 'trumpet', 'prune', 'gruesome'], 'run') == ['grunt', 'prune']\n\ndef test_check():\n check(filter_by_substring)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "py", - "prompt": "from typing import Tuple\n\ndef even_odd_count(num: int) -> Tuple[int, int]:\n \"\"\"Given an integer. return a tuple that has the number of even and odd digits respectively.\n\n Example:\n >>> even_odd_count(-12)\n (1, 1)\n >>> even_odd_count(123)\n (1, 2)\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(7) == (0, 1)\n assert candidate(-78) == (1, 1)\n assert candidate(3452) == (2, 2)\n assert candidate(346211) == (3, 3)\n assert candidate(-345821) == (3, 3)\n assert candidate(-2) == (1, 0)\n assert candidate(-45347) == (2, 3)\n assert candidate(0) == (1, 0)\n\ndef test_check():\n check(even_odd_count)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "py", - "prompt": "from typing import List\n\ndef find_max(words: List[str]) -> str:\n \"\"\"Write a function that accepts a list of strings.\n The list contains different words. Return the word with maximum number\n of unique characters. If multiple strings have maximum number of unique\n characters, return the one which comes first in lexicographical order.\n\n >>> find_max(['name', 'of', 'string'])\n 'string'\n >>> find_max(['name', 'enam', 'game'])\n 'enam'\n >>> find_max(['aaaaaaa', 'bb', 'cc'])\n 'aaaaaaa'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(['name', 'of', 'string']) == 'string'\n assert candidate(['name', 'enam', 'game']) == 'enam'\n assert candidate(['aaaaaaa', 'bb', 'cc']) == 'aaaaaaa'\n assert candidate(['abc', 'cba']) == 'abc'\n assert candidate(['play', 'this', 'game', 'of', 'footbott']) == 'footbott'\n assert candidate(['we', 'are', 'gonna', 'rock']) == 'gonna'\n assert candidate(['we', 'are', 'a', 'mad', 'nation']) == 'nation'\n assert candidate(['this', 'is', 'a', 'prrk']) == 'this'\n assert candidate(['b']) == 'b'\n assert candidate(['play', 'play', 'play']) == 'play'\n\ndef test_check():\n check(find_max)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "py", - "prompt": "def starts_one_ends(n: int) -> int:\n \"\"\"\n Given a positive integer n, return the count of the numbers of n-digit\n positive integers that start or end with 1.\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(1) == 1\n assert candidate(2) == 18\n assert candidate(3) == 180\n assert candidate(4) == 1800\n assert candidate(5) == 18000\n\ndef test_check():\n check(starts_one_ends)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "py", - "prompt": "from typing import List, Tuple, Optional\n\ndef largest_smallest_integers(lst: List[int]) -> Tuple[Optional[int], Optional[int]]:\n \"\"\"\n Create a function that returns a tuple (a, b), where 'a' is\n the largest of negative integers, and 'b' is the smallest\n of positive integers in a list.\n If there is no negative or positive integers, return them as None.\n\n Examples:\n >>> largest_smallest_integers([2, 4, 1, 3, 5, 7])\n (None, 1)\n >>> largest_smallest_integers([])\n (None, None)\n >>> largest_smallest_integers([0])\n (None, None)\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([2, 4, 1, 3, 5, 7]) == (None, 1)\n assert candidate([2, 4, 1, 3, 5, 7, 0]) == (None, 1)\n assert candidate([1, 3, 2, 4, 5, 6, -2]) == (-2, 1)\n assert candidate([4, 5, 3, 6, 2, 7, -7]) == (-7, 2)\n assert candidate([7, 3, 8, 4, 9, 2, 5, -9]) == (-9, 2)\n assert candidate([]) == (None, None)\n assert candidate([0]) == (None, None)\n assert candidate([-1, -3, -5, -6]) == (-1, None)\n assert candidate([-1, -3, -5, -6, 0]) == (-1, None)\n assert candidate([-6, -4, -4, -3, 1]) == (-3, 1)\n assert candidate([-6, -4, -4, -3, -100, 1]) == (-3, 1)\n\ndef test_check():\n check(largest_smallest_integers)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "py", - "prompt": "from typing import List\n\ndef pluck(arr: List[int]) -> List[int]:\n \"\"\"\n \"Given an array representing a branch of a tree that has non-negative integer nodes\n your task is to pluck one of the nodes and return it.\n The plucked node should be the node with the smallest even value.\n If multiple nodes with the same smallest even value are found return the node that has smallest index.\n\n The plucked node should be returned in a list, [ smalest_value, its index ],\n If there are no even values or the given array is empty, return [].\n\n Example 1:\n >>> pluck([4, 2, 3])\n [2, 1]\n Explanation: 2 has the smallest even value, and 2 has the smallest index.\n\n Example 2:\n >>> pluck([1, 2, 3])\n [2, 1]\n Explanation: 2 has the smallest even value, and 2 has the smallest index.\n\n Example 3:\n >>> pluck([])\n []\n \n Example 4:\n >>> pluck([5, 0, 3, 0, 4, 2])\n [0, 1]\n Explanation: 0 is the smallest value, but there are two zeros,\n so we will choose the first zero, which has the smallest index.\n\n Constraints:\n * 1 <= nodes.length <= 10000\n * 0 <= node.value\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([4, 2, 3]) == [2, 1]\n assert candidate([1, 2, 3]) == [2, 1]\n assert candidate([]) == []\n assert candidate([5, 0, 3, 0, 4, 2]) == [0, 1]\n assert candidate([1, 2, 3, 0, 5, 3]) == [0, 3]\n assert candidate([5, 4, 8, 4, 8]) == [4, 1]\n assert candidate([7, 6, 7, 1]) == [6, 1]\n assert candidate([7, 9, 7, 1]) == []\n\ndef test_check():\n check(pluck)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "py", - "prompt": "from typing import List\n\ndef count_nums(arr: List[int]) -> int:\n \"\"\"\n Write a function count_nums which takes an array of integers and returns\n the number of elements which has a sum of digits > 0.\n If a number is negative, then its first signed digit will be negative:\n e.g. -123 has signed digits -1, 2, and 3.\n >>> count_nums([])\n 0\n >>> count_nums([-1, 11, -11])\n 1\n >>> count_nums([1, 1, 2])\n 3\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == 0\n assert candidate([-1, -2, 0]) == 0\n assert candidate([1, 1, 2, -2, 3, 4, 5]) == 6\n assert candidate([1, 6, 9, -6, 0, 1, 5]) == 5\n assert candidate([1, 100, 98, -7, 1, -1]) == 4\n assert candidate([12, 23, 34, -45, -56, 0]) == 5\n assert candidate([0, 1]) == 1\n assert candidate([1]) == 1\n\ndef test_check():\n check(count_nums)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "py", - "prompt": "from typing import List\n\ndef minPath(grid: List[List[int]], k: int) -> List[int]:\n \"\"\"\n Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n each cell of the grid contains a value. Every integer in the range [1, N * N]\n inclusive appears exactly once on the cells of the grid.\n\n You have to find the minimum path of length k in the grid. You can start\n from any cell, and in each step you can move to any of the neighbor cells,\n in other words, you can go to cells which share an edge with you current\n cell.\n Please note that a path of length k means visiting exactly k cells (not\n necessarily distinct).\n You CANNOT go off the grid.\n A path A (of length k) is considered less than a path B (of length k) if\n after making the ordered lists of the values on the cells that A and B go\n through (let's call them lst_A and lst_B), lst_A is lexicographically less\n than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n lst_A[j] = lst_B[j].\n It is guaranteed that the answer is unique.\n Return an ordered list of the values on the cells that the minimum path go through.\n\n Examples: \n >>> minPath([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3)\n [1, 2, 1]\n\n >>> minPath([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1)\n [1]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3) == [1, 2, 1]\n assert candidate([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1) == [1]\n assert candidate([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], 4) == [1, 2, 1, 2]\n assert candidate([[6, 4, 13, 10], [5, 7, 12, 1], [3, 16, 11, 15], [8, 14, 9, 2]], 7) == [1, 10, 1, 10, 1, 10, 1]\n assert candidate([[8, 14, 9, 2], [6, 4, 13, 15], [5, 7, 1, 12], [3, 10, 11, 16]], 5) == [1, 7, 1, 7, 1]\n assert candidate([[11, 8, 7, 2], [5, 16, 14, 4], [9, 3, 15, 6], [12, 13, 10, 1]], 9) == [1, 6, 1, 6, 1, 6, 1, 6, 1]\n assert candidate([[12, 13, 10, 1], [9, 3, 15, 6], [5, 16, 14, 4], [11, 8, 7, 2]], 12) == [1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6]\n assert candidate([[2, 7, 4], [3, 1, 5], [6, 8, 9]], 8) == [1, 3, 1, 3, 1, 3, 1, 3]\n assert candidate([[6, 1, 5], [3, 8, 9], [2, 7, 4]], 8) == [1, 5, 1, 5, 1, 5, 1, 5]\n assert candidate([[1, 2], [3, 4]], 10) == [1, 2, 1, 2, 1, 2, 1, 2, 1, 2]\n assert candidate([[1, 3], [3, 2]], 10) == [1, 3, 1, 3, 1, 3, 1, 3, 1, 3]\n\ndef test_check():\n check(minPath)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "py", - "prompt": "from typing import List\n\ndef strange_sort_list(lst: List[int]) -> List[int]:\n \"\"\"\n Given list of integers, return list in strange order.\n Strange sorting, is when you start with the minimum value,\n then maximum of the remaining integers, then minimum and so on.\n\n Examples:\n >>> strange_sort_list([1, 2, 3, 4])\n [1, 4, 2, 3]\n >>> strange_sort_list([5, 5, 5, 5])\n [5, 5, 5, 5]\n >>> strange_sort_list([])\n []\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 3, 4]) == [1, 4, 2, 3]\n assert candidate([5, 6, 7, 8, 9]) == [5, 9, 6, 8, 7]\n assert candidate([1, 2, 3, 4, 5]) == [1, 5, 2, 4, 3]\n assert candidate([5, 6, 7, 8, 9, 1]) == [1, 9, 5, 8, 6, 7]\n assert candidate([5, 5, 5, 5]) == [5, 5, 5, 5]\n assert candidate([]) == []\n assert candidate([1, 2, 3, 4, 5, 6, 7, 8]) == [1, 8, 2, 7, 3, 6, 4, 5]\n assert candidate([0, 2, 2, 2, 5, 5, -5, -5]) == [-5, 5, -5, 5, 0, 2, 2, 2]\n assert candidate([111111]) == [111111]\n\ndef test_check():\n check(strange_sort_list)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "py", - "prompt": "from typing import Optional\n\ndef string_to_md5(text: str) -> Optional[str]:\n \"\"\"\n Given a string 'text', return its md5 hash equivalent string.\n If 'text' is an empty string, return None.\n\n >>> string_to_md5('Hello world')\n '3e25960a79dbc69b674cd4ec67a72c62'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'\n assert candidate('') == None\n assert candidate('A B C') == '0ef78513b0cb8cef12743f5aeb35f888'\n assert candidate('password') == '5f4dcc3b5aa765d61d8327deb882cf99'\n\ndef test_check():\n check(string_to_md5)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "py", - "prompt": "def get_closest_vowel(word: str) -> str:\n \"\"\"You are given a word. Your task is to find the closest vowel that stands between \n two consonants from the right side of the word (case sensitive).\n \n Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n find any vowel met the above condition. \n\n You may assume that the given string contains English letter only.\n\n Example:\n >>> get_closest_vowel('yogurt')\n 'u'\n >>> get_closest_vowel('FULL')\n 'U'\n >>> get_closest_vowel('quick')\n ''\n >>> get_closest_vowel('ab')\n ''\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('yogurt') == 'u'\n assert candidate('full') == 'u'\n assert candidate('easy') == ''\n assert candidate('eAsy') == ''\n assert candidate('ali') == ''\n assert candidate('bad') == 'a'\n assert candidate('most') == 'o'\n assert candidate('ab') == ''\n assert candidate('ba') == ''\n assert candidate('quick') == ''\n assert candidate('anime') == 'i'\n assert candidate('Asia') == ''\n assert candidate('Above') == 'o'\n\ndef test_check():\n check(get_closest_vowel)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "py", - "prompt": "def change_base(x: int, base: int) -> str:\n \"\"\"Change numerical base of input number x to base.\n return string representation after the conversion.\n base numbers are less than 10.\n >>> change_base(8, 3)\n '22'\n >>> change_base(8, 2)\n '1000'\n >>> change_base(7, 2)\n '111'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(8, 3) == '22'\n assert candidate(9, 3) == '100'\n assert candidate(234, 2) == '11101010'\n assert candidate(16, 2) == '10000'\n assert candidate(8, 2) == '1000'\n assert candidate(7, 2) == '111'\n assert candidate(2, 3) == '2'\n assert candidate(3, 4) == '3'\n assert candidate(4, 5) == '4'\n assert candidate(5, 6) == '5'\n assert candidate(6, 7) == '6'\n assert candidate(7, 8) == '7'\n\ndef test_check():\n check(change_base)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "py", - "prompt": "from typing import List\n\ndef has_close_elements(numbers: List[float], threshold: float) -> bool:\n \"\"\" Check if in given list of numbers, are any two numbers closer to each other than\n given threshold.\n >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n False\n >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n True\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3) == True\n assert candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05) == False\n assert candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.95) == True\n assert candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.8) == False\n assert candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1) == True\n assert candidate([1.1, 2.2, 3.1, 4.1, 5.1], 1.0) == True\n assert candidate([1.1, 2.2, 3.1, 4.1, 5.1], 0.5) == False\n\ndef test_check():\n check(has_close_elements)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "py", - "prompt": "def is_nested(string: str) -> bool:\n \"\"\"\n Create a function that takes a string as input which contains only square brackets.\n The function should return True if and only if there is a valid subsequence of brackets \n where at least one bracket in the subsequence is nested.\n\n >>> is_nested('[[]]')\n True\n >>> is_nested('[]]]]]]][[[[[]')\n False\n >>> is_nested('[][]')\n False\n >>> is_nested('[]')\n False\n >>> is_nested('[[][]]')\n True\n >>> is_nested('[[]][[')\n True\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('[[]]') == True\n assert candidate('[]]]]]]][[[[[]') == False\n assert candidate('[][]') == False\n assert candidate('[]') == False\n assert candidate('[[[[]]]]') == True\n assert candidate('[]]]]]]]]]]') == False\n assert candidate('[][][[]]') == True\n assert candidate('[[]') == False\n assert candidate('[]]') == False\n assert candidate('[[]][[') == True\n assert candidate('[[][]]') == True\n assert candidate('') == False\n assert candidate('[[[[[[[[') == False\n assert candidate(']]]]]]]]') == False\n\ndef test_check():\n check(is_nested)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "py", - "prompt": "from typing import List\n\ndef concatenate(strings: List[str]) -> str:\n \"\"\" Concatenate list of strings into a single string\n >>> concatenate([])\n ''\n >>> concatenate(['a', 'b', 'c'])\n 'abc'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == ''\n assert candidate(['x', 'y', 'z']) == 'xyz'\n assert candidate(['x', 'y', 'z', 'w', 'k']) == 'xyzwk'\n\ndef test_check():\n check(concatenate)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "py", - "prompt": "def prime_fib(n: int) -> int:\n \"\"\"\n prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n >>> prime_fib(1)\n 2\n >>> prime_fib(2)\n 3\n >>> prime_fib(3)\n 5\n >>> prime_fib(4)\n 13\n >>> prime_fib(5)\n 89\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(1) == 2\n assert candidate(2) == 3\n assert candidate(3) == 5\n assert candidate(4) == 13\n assert candidate(5) == 89\n assert candidate(6) == 233\n assert candidate(7) == 1597\n assert candidate(8) == 28657\n assert candidate(9) == 514229\n assert candidate(10) == 433494437\n\ndef test_check():\n check(prime_fib)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "py", - "prompt": "from typing import List, Tuple\n\ndef find_closest_elements(numbers: List[float]) -> Tuple[float, float]:\n \"\"\" From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n other and return them in order (smaller number, larger number).\n >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n (2.0, 2.2)\n >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n (2.0, 2.0)\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2]) == (3.9, 4.0)\n assert candidate([1.0, 2.0, 5.9, 4.0, 5.0]) == (5.0, 5.9)\n assert candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]) == (2.0, 2.2)\n assert candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]) == (2.0, 2.0)\n assert candidate([1.1, 2.2, 3.1, 4.1, 5.1]) == (2.2, 3.1)\n\ndef test_check():\n check(find_closest_elements)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "py", - "prompt": "def hex_key(num: str) -> int:\n \"\"\"You have been tasked to write a function that receives \n a hexadecimal number as a string and counts the number of hexadecimal \n digits that are primes (prime number, or a prime, is a natural number \n greater than 1 that is not a product of two smaller natural numbers).\n Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n So you have to determine a number of the following digits: 2, 3, 5, 7, \n B (=decimal 11), D (=decimal 13).\n Note: you may assume the input is always correct or empty string, \n and symbols A,B,C,D,E,F are always uppercase.\n Examples:\n >>> hex_key('AB')\n 1\n >>> hex_key('1077E')\n 2\n >>> hex_key('ABED1A33')\n 4\n >>> hex_key('123456789ABCDEF0')\n 6\n >>> hex_key('2020')\n 2\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('AB') == 1\n assert candidate('1077E') == 2\n assert candidate('ABED1A33') == 4\n assert candidate('2020') == 2\n assert candidate('123456789ABCDEF0') == 6\n assert candidate('112233445566778899AABBCCDDEEFF00') == 12\n\ndef test_check():\n check(hex_key)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "py", - "prompt": "def multiply(a: int, b: int) -> int:\n \"\"\"Complete the function that takes two integers and returns \n the product of their unit digits.\n Assume the input is always valid.\n Examples:\n >>> multiply(148, 412)\n 16\n >>> multiply(19, 28)\n 72\n >>> multiply(2020, 1851)\n 0\n >>> multiply(14, -15)\n 20\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(148, 412) == 16\n assert candidate(19, 28) == 72\n assert candidate(2020, 1851) == 0\n assert candidate(14, -15) == 20\n assert candidate(76, 67) == 42\n assert candidate(17, 27) == 49\n assert candidate(0, 1) == 0\n assert candidate(0, 0) == 0\n\ndef test_check():\n check(multiply)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "py", - "prompt": "from typing import List\n\ndef rescale_to_unit(numbers: List[float]) -> List[float]:\n \"\"\" Given list of numbers (of at least two elements), apply a linear transform to that list,\n such that the smallest number will become 0 and the largest will become 1\n >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n [0.0, 0.25, 0.5, 0.75, 1.0]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([2.0, 49.9]) == [0.0, 1.0]\n assert candidate([100.0, 49.9]) == [1.0, 0.0]\n assert candidate([1.0, 2.0, 3.0, 4.0, 5.0]) == [0.0, 0.25, 0.5, 0.75, 1.0]\n assert candidate([2.0, 1.0, 5.0, 3.0, 4.0]) == [0.25, 0.0, 1.0, 0.5, 0.75]\n assert candidate([12.0, 11.0, 15.0, 13.0, 14.0]) == [0.25, 0.0, 1.0, 0.5, 0.75]\n\ndef test_check():\n check(rescale_to_unit)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "py", - "prompt": "def digits(n: int) -> int:\n \"\"\"Given a positive integer n, return the product of the odd digits.\n Return 0 if all digits are even.\n For example:\n >>> digits(1)\n 1\n >>> digits(4)\n 0\n >>> digits(235)\n 15\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(5) == 5\n assert candidate(54) == 5\n assert candidate(120) == 1\n assert candidate(5014) == 5\n assert candidate(98765) == 315\n assert candidate(5576543) == 2625\n assert candidate(2468) == 0\n\ndef test_check():\n check(digits)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "py", - "prompt": "from typing import List\n\ndef Strongest_Extension(class_name: str, extensions: List[str]) -> str:\n \"\"\"You will be given the name of a class (a string) and a list of extensions.\n The extensions are to be used to load additional classes to the class. The\n strength of the extension is as follows: Let CAP be the number of the uppercase\n letters in the extension's name, and let SM be the number of lowercase letters \n in the extension's name, the strength is given by the fraction CAP - SM. \n You should find the strongest extension and return a string in this \n format: ClassName.StrongestExtensionName.\n If there are two or more extensions with the same strength, you should\n choose the one that comes first in the list.\n For example, if you are given \"Slices\" as the class and a list of the\n extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n (its strength is -1).\n Example:\n >>> Strongest_Extension('my_class', ['AA', 'Be', 'CC'])\n 'my_class.AA'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('Watashi', ['tEN', 'niNE', 'eIGHt8OKe']) == 'Watashi.eIGHt8OKe'\n assert candidate('Boku123', ['nani', 'NazeDa', 'YEs.WeCaNe', '32145tggg']) == 'Boku123.YEs.WeCaNe'\n assert candidate('__YESIMHERE', ['t', 'eMptY', 'nothing', 'zeR00', 'NuLl__', '123NoooneB321']) == '__YESIMHERE.NuLl__'\n assert candidate('K', ['Ta', 'TAR', 't234An', 'cosSo']) == 'K.TAR'\n assert candidate('__HAHA', ['Tab', '123', '781345', '-_-']) == '__HAHA.123'\n assert candidate('YameRore', ['HhAas', 'okIWILL123', 'WorkOut', 'Fails', '-_-']) == 'YameRore.okIWILL123'\n assert candidate('finNNalLLly', ['Die', 'NowW', 'Wow', 'WoW']) == 'finNNalLLly.WoW'\n assert candidate('_', ['Bb', '91245']) == '_.Bb'\n assert candidate('Sp', ['671235', 'Bb']) == 'Sp.671235'\n\ndef test_check():\n check(Strongest_Extension)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "py", - "prompt": "from typing import Dict\n\ndef histogram(test: str) -> Dict[str, int]:\n \"\"\"Given a string representing a space separated lowercase letters, return a dictionary\n of the letter with the most repetition and containing the corresponding count.\n If several letters have the same occurrence, return all of them.\n \n Example:\n >>> histogram('a b c')\n { 'a': 1, 'b': 1, 'c': 1 }\n >>> histogram('a b b a')\n { 'a': 2, 'b': 2 }\n >>> histogram('a b c a b')\n { 'a': 2, 'b': 2 }\n >>> histogram('b b b b a')\n { 'b': 4 }\n >>> histogram('')\n { }\n\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('a b b a') == { 'a': 2, 'b': 2 }\n assert candidate('a b c a b') == { 'a': 2, 'b': 2 }\n assert candidate('a b c d g') == { 'a': 1, 'b': 1, 'c': 1, 'd': 1, 'g': 1 }\n assert candidate('r t g') == { 'r': 1, 't': 1, 'g': 1 }\n assert candidate('b b b b a') == { 'b': 4 }\n assert candidate('r t g') == { 'r': 1, 't': 1, 'g': 1 }\n assert candidate('') == { }\n assert candidate('a') == { 'a': 1 }\n\ndef test_check():\n check(histogram)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "py", - "prompt": "from typing import List\n\ndef pairs_sum_to_zero(l: List[int]) -> bool:\n \"\"\"\n pairs_sum_to_zero takes a list of integers as an input.\n it returns True if there are two distinct elements in the list that\n sum to zero, and False otherwise.\n >>> pairs_sum_to_zero([1, 3, 5, 0])\n False\n >>> pairs_sum_to_zero([1, 3, -2, 1])\n False\n >>> pairs_sum_to_zero([1, 2, 3, 7])\n False\n >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7])\n True\n >>> pairs_sum_to_zero([1])\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 3, 5, 0]) == False\n assert candidate([1, 3, -2, 1]) == False\n assert candidate([1, 2, 3, 7]) == False\n assert candidate([2, 4, -5, 3, 5, 7]) == True\n assert candidate([1]) == False\n assert candidate([-3, 9, -1, 3, 2, 30]) == True\n assert candidate([-3, 9, -1, 3, 2, 31]) == True\n assert candidate([-3, 9, -1, 4, 2, 30]) == False\n assert candidate([-3, 9, -1, 4, 2, 31]) == False\n\ndef test_check():\n check(pairs_sum_to_zero)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "py", - "prompt": "from typing import List\n\ndef total_match(lst1: List[str], lst2: List[str]) -> List[str]:\n \"\"\"\n Write a function that accepts two lists of strings and returns the list that has \n total number of chars in the all strings of the list less than the other list.\n\n if the two lists have the same number of chars, return the first list.\n\n Examples\n >>> total_match([], [])\n []\n >>> total_match(['hi', 'admin'], ['hI', 'Hi'])\n ['hI', 'Hi']\n >>> total_match(['hi', 'admin'], ['hi', 'hi', 'admin', 'project'])\n ['hi', 'admin']\n >>> total_match(['hi', 'admin'], ['hI', 'hi', 'hi'])\n ['hI', 'hi', 'hi']\n >>> total_match(['4'], ['1', '2', '3', '4', '5'])\n ['4']\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([], []) == []\n assert candidate(['hi', 'admin'], ['hi', 'hi']) == ['hi', 'hi']\n assert candidate(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) == ['hi', 'admin']\n assert candidate(['4'], ['1', '2', '3', '4', '5']) == ['4']\n assert candidate(['hi', 'admin'], ['hI', 'Hi']) == ['hI', 'Hi']\n assert candidate(['hi', 'admin'], ['hI', 'hi', 'hi']) == ['hI', 'hi', 'hi']\n assert candidate(['hi', 'admin'], ['hI', 'hi', 'hii']) == ['hi', 'admin']\n assert candidate([], ['this']) == []\n assert candidate(['this'], []) == []\n\ndef test_check():\n check(total_match)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "py", - "prompt": "def circular_shift(x: int, shift: int) -> str:\n \"\"\"Circular shift the digits of the integer x, shift the digits right by shift\n and return the result as a string.\n If shift > number of digits, return digits reversed.\n >>> circular_shift(12, 1)\n '21'\n >>> circular_shift(12, 2)\n '12'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(100, 2) == '001'\n assert candidate(12, 2) == '12'\n assert candidate(97, 8) == '79'\n assert candidate(12, 1) == '21'\n assert candidate(11, 101) == '11'\n\ndef test_check():\n check(circular_shift)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "py", - "prompt": "from typing import List\n\ndef monotonic(l: List[int]) -> bool:\n \"\"\"Return True is list elements are monotonically increasing or decreasing.\n >>> monotonic([1, 2, 4, 20])\n True\n >>> monotonic([1, 20, 4, 10])\n False\n >>> monotonic([4, 1, 0, -10])\n True\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 4, 10]) == True\n assert candidate([1, 2, 4, 20]) == True\n assert candidate([1, 20, 4, 10]) == False\n assert candidate([4, 1, 0, -10]) == True\n assert candidate([4, 1, 1, 0]) == True\n assert candidate([1, 2, 3, 2, 5, 60]) == False\n assert candidate([1, 2, 3, 4, 5, 60]) == True\n assert candidate([9, 9, 9, 9]) == True\n\ndef test_check():\n check(monotonic)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "py", - "prompt": "def is_equal_to_sum_even(n: int) -> bool:\n \"\"\"Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n Example\n >>> is_equal_to_sum_even(4)\n False\n >>> is_equal_to_sum_even(6)\n False\n >>> is_equal_to_sum_even(8)\n True\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(4) == False\n assert candidate(6) == False\n assert candidate(8) == True\n assert candidate(10) == True\n assert candidate(11) == False\n assert candidate(12) == True\n assert candidate(13) == False\n assert candidate(16) == True\n\ndef test_check():\n check(is_equal_to_sum_even)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "py", - "prompt": "from typing import List\n\ndef parse_music(music_string: str) -> List[int]:\n \"\"\" Input to this function is a string representing musical notes in a special ASCII format.\n Your task is to parse this string and return list of integers corresponding to how many beats does each\n not last.\n\n Here is a legend:\n 'o' - whole note, lasts four beats\n 'o|' - half note, lasts two beats\n '.|' - quater note, lasts one beat\n\n >>> parse_music('o o| .| o| o| .| .| .| .| o o')\n [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('') == []\n assert candidate('o o o o') == [4, 4, 4, 4]\n assert candidate('.| .| .| .|') == [1, 1, 1, 1]\n assert candidate('o| o| .| .| o o o o') == [2, 2, 1, 1, 4, 4, 4, 4]\n assert candidate('o| .| o| .| o o| o o|') == [2, 1, 2, 1, 4, 2, 4, 2]\n\ndef test_check():\n check(parse_music)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "py", - "prompt": "from typing import List\n\ndef sum_squares(lst: List[int]) -> int:\n \"\"\"\"\n This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n \n Examples:\n >>> lst\n [1, 2, 3]\n >>> lst\n []\n >>> lst\n [-1, -5, 2, -1, -5]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 3]) == 6\n assert candidate([1, 4, 9]) == 14\n assert candidate([]) == 0\n assert candidate([1, 1, 1, 1, 1, 1, 1, 1, 1]) == 9\n assert candidate([-1, -1, -1, -1, -1, -1, -1, -1, -1]) == -3\n assert candidate([0]) == 0\n assert candidate([-1, -5, 2, -1, -5]) == -126\n assert candidate([-56, -99, 1, 0, -2]) == 3030\n assert candidate([-1, 0, 0, 0, 0, 0, 0, 0, -1]) == 0\n assert candidate([-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37]) == -14196\n assert candidate([-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10]) == -1448\n\ndef test_check():\n check(sum_squares)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "py", - "prompt": "from typing import List\n\ndef triples_sum_to_zero(l: List[int]) -> bool:\n \"\"\"\n triples_sum_to_zero takes a list of integers as an input.\n it returns True if there are three distinct elements in the list that\n sum to zero, and False otherwise.\n\n >>> triples_sum_to_zero([1, 3, 5, 0])\n False\n >>> triples_sum_to_zero([1, 3, -2, 1])\n True\n >>> triples_sum_to_zero([1, 2, 3, 7])\n False\n >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n True\n >>> triples_sum_to_zero([1])\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 3, 5, 0]) == False\n assert candidate([1, 3, 5, -1]) == False\n assert candidate([1, 3, -2, 1]) == True\n assert candidate([1, 2, 3, 7]) == False\n assert candidate([1, 2, 5, 7]) == False\n assert candidate([2, 4, -5, 3, 9, 7]) == True\n assert candidate([1]) == False\n assert candidate([1, 3, 5, -100]) == False\n assert candidate([100, 3, 5, -100]) == False\n\ndef test_check():\n check(triples_sum_to_zero)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "py", - "prompt": "def correct_bracketing(brackets: str) -> bool:\n \"\"\" brackets is a string of \"<\" and \">\".\n return True if every opening bracket has a corresponding closing bracket.\n\n >>> correct_bracketing('<')\n False\n >>> correct_bracketing('<>')\n True\n >>> correct_bracketing('<<><>>')\n True\n >>> correct_bracketing('><<>')\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('<>') == True\n assert candidate('<<><>>') == True\n assert candidate('<><><<><>><>') == True\n assert candidate('<><><<<><><>><>><<><><<>>>') == True\n assert candidate('<<<><>>>>') == False\n assert candidate('><<>') == False\n assert candidate('<') == False\n assert candidate('<<<<') == False\n assert candidate('>') == False\n assert candidate('<<>') == False\n assert candidate('<><><<><>><>><<>') == False\n assert candidate('<><><<><>><>>><>') == False\n\ndef test_check():\n check(correct_bracketing)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "py", - "prompt": "from typing import List\n\ndef specialFilter(nums: List[int]) -> int:\n \"\"\"Write a function that takes an array of numbers as input and returns \n the number of elements in the array that are greater than 10 and both \n first and last digits of a number are odd (1, 3, 5, 7, 9).\n For example:\n >>> specialFilter([15, -73, 14, -15])\n 1\n >>> specialFilter([33, -2, -3, 45, 21, 109])\n 2\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([5, -2, 1, -5]) == 0\n assert candidate([15, -73, 14, -15]) == 1\n assert candidate([33, -2, -3, 45, 21, 109]) == 2\n assert candidate([43, -12, 93, 125, 121, 109]) == 4\n assert candidate([71, -2, -33, 75, 21, 19]) == 3\n assert candidate([1]) == 0\n assert candidate([]) == 0\n\ndef test_check():\n check(specialFilter)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "py", - "prompt": "from typing import Dict\n\ndef check_dict_case(dict: Dict[str, str]) -> bool:\n \"\"\"\n Given a dictionary, return True if all keys are strings in lower \n case or all keys are strings in upper case, else return False.\n The function should return False is the given dictionary is empty.\n Examples:\n >>> check_dict_case({ 'a': 'apple', 'b': 'banana' })\n True\n >>> check_dict_case({ 'a': 'apple', 'A': 'banana', 'B': 'banana' })\n False\n >>> check_dict_case({ 'a': 'apple', 8: 'banana', 'a': 'apple' })\n False\n >>> check_dict_case({ 'Name': 'John', 'Age': '36', 'City': 'Houston' })\n False\n >>> check_dict_case({ 'STATE': 'NC', 'ZIP': '12345' })\n True\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate({ 'p': 'pineapple', 'b': 'banana' }) == True\n assert candidate({ 'p': 'pineapple', 'A': 'banana', 'B': 'banana' }) == False\n assert candidate({ 'p': 'pineapple', '5': 'banana', 'a': 'apple' }) == False\n assert candidate({ 'Name': 'John', 'Age': '36', 'City': 'Houston' }) == False\n assert candidate({ 'STATE': 'NC', 'ZIP': '12345' }) == True\n assert candidate({ 'fruit': 'Orange', 'taste': 'Sweet' }) == True\n assert candidate({ }) == False\n\ndef test_check():\n check(check_dict_case)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "py", - "prompt": "from typing import Union, List\n\ndef split_words(txt: str) -> Union[List[str], int]:\n \"\"\"\n Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n Examples\n >>> split_words('Hello world!')\n ['Hello', 'world!']\n >>> split_words('Hello,world!')\n ['Hello', 'world!']\n >>> split_words('abcdef')\n 3\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('Hello world!') == ['Hello', 'world!']\n assert candidate('Hello,world!') == ['Hello', 'world!']\n assert candidate('Hello world,!') == ['Hello', 'world,!']\n assert candidate('Hello,Hello,world !') == ['Hello,Hello,world', '!']\n assert candidate('abcdef') == 3\n assert candidate('aaabb') == 2\n assert candidate('aaaBb') == 1\n assert candidate('') == 0\n\ndef test_check():\n check(split_words)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "py", - "prompt": "def fibfib(n: int) -> int:\n \"\"\"The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fibfib(0) == 0\n fibfib(1) == 0\n fibfib(2) == 1\n fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n >>> fibfib(1)\n 0\n >>> fibfib(5)\n 4\n >>> fibfib(8)\n 24\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(2) == 1\n assert candidate(1) == 0\n assert candidate(5) == 4\n assert candidate(8) == 24\n assert candidate(10) == 81\n assert candidate(12) == 274\n assert candidate(14) == 927\n\ndef test_check():\n check(fibfib)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "py", - "prompt": "from typing import List\n\ndef sum_squares(lst: List[float]) -> int:\n \"\"\"You are given a list of numbers.\n You need to return the sum of squared numbers in the given list,\n round each element in the list to the upper int(Ceiling) first.\n Examples:\n >>> lst([1.0, 2.0, 3.0])\n 14\n >>> lst([1.0, 4.0, 9.0])\n 98\n >>> lst([1.0, 3.0, 5.0, 7.0])\n 84\n >>> lst([1.4, 4.2, 0.0])\n 29\n >>> lst([-2.4, 1.0, 1.0])\n 6\n \n\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1.0, 2.0, 3.0]) == 14\n assert candidate([1.0, 2.0, 3.0]) == 14\n assert candidate([1.0, 3.0, 5.0, 7.0]) == 84\n assert candidate([1.4, 4.2, 0.0]) == 29\n assert candidate([-2.4, 1.0, 1.0]) == 6\n assert candidate([100.0, 1.0, 15.0, 2.0]) == 10230\n assert candidate([10000.0, 10000.0]) == 200000000\n assert candidate([-1.4, 4.6, 6.3]) == 75\n assert candidate([-1.4, 17.9, 18.9, 19.9]) == 1086\n assert candidate([0.0]) == 0\n assert candidate([-1.0]) == 1\n assert candidate([-1.0, 1.0, 0.0]) == 2\n\ndef test_check():\n check(sum_squares)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_85_add", - "language": "py", - "prompt": "from typing import List\n\ndef add(lst: List[int]) -> int:\n \"\"\"Given a non-empty list of integers lst. add the even elements that are at odd indices..\n\n\n Examples:\n >>> add([4, 2, 6, 7])\n 2\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([4, 88]) == 88\n assert candidate([4, 5, 6, 7, 2, 122]) == 122\n assert candidate([4, 0, 6, 7]) == 0\n assert candidate([4, 4, 6, 8]) == 12\n\ndef test_check():\n check(add)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "py", - "prompt": "from typing import List\n\ndef unique(l: List[int]) -> List[int]:\n \"\"\"Return sorted unique elements in a list\n >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123])\n [0, 2, 3, 5, 9, 123]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([5, 3, 5, 2, 3, 3, 9, 0, 123]) == [0, 2, 3, 5, 9, 123]\n\ndef test_check():\n check(unique)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "py", - "prompt": "def fix_spaces(text: str) -> str:\n \"\"\"\n Given a string text, replace all spaces in it with underscores, \n and if a string has more than 2 consecutive spaces, \n then replace all consecutive spaces with - \n \n >>> fix_spaces(' Example')\n 'Example'\n >>> fix_spaces(' Example 1')\n 'Example_1'\n >>> fix_spaces(' Example 2')\n '_Example_2'\n >>> fix_spaces(' Example 3')\n '_Example-3'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('Example') == 'Example'\n assert candidate('Mudasir Hanif ') == 'Mudasir_Hanif_'\n assert candidate('Yellow Yellow Dirty Fellow') == 'Yellow_Yellow__Dirty__Fellow'\n assert candidate('Exa mple') == 'Exa-mple'\n assert candidate(' Exa 1 2 2 mple') == '-Exa_1_2_2_mple'\n\ndef test_check():\n check(fix_spaces)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "py", - "prompt": "def modp(n: int, p: int) -> int:\n \"\"\"Return 2^n modulo p (be aware of numerics).\n >>> modp(3, 5)\n 3\n >>> modp(1101, 101)\n 2\n >>> modp(0, 101)\n 1\n >>> modp(3, 11)\n 8\n >>> modp(100, 101)\n 1\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(3, 5) == 3\n assert candidate(1101, 101) == 2\n assert candidate(0, 101) == 1\n assert candidate(3, 11) == 8\n assert candidate(100, 101) == 1\n assert candidate(30, 5) == 4\n assert candidate(31, 5) == 3\n\ndef test_check():\n check(modp)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "py", - "prompt": "def valid_date(date: str) -> bool:\n \"\"\"You have to write a function which validates a given date string and\n returns True if the date is valid otherwise False.\n The date is valid if all of the following rules are satisfied:\n 1. The date string is not empty.\n 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n 3. The months should not be less than 1 or higher than 12.\n 4. The date should be in the format: mm-dd-yyyy\n\n >>> valid_date('03-11-2000')\n True\n\n >>> valid_date('15-01-2012')\n False\n\n >>> valid_date('04-0-2040')\n False\n\n >>> valid_date('06-04-2020')\n True\n\n >>> valid_date('06/04/2020')\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('03-11-2000') == True\n assert candidate('15-01-2012') == False\n assert candidate('04-0-2040') == False\n assert candidate('06-04-2020') == True\n assert candidate('01-01-2007') == True\n assert candidate('03-32-2011') == False\n assert candidate('') == False\n assert candidate('04-31-3000') == False\n assert candidate('06-06-2005') == True\n assert candidate('21-31-2000') == False\n assert candidate('04-12-2003') == True\n assert candidate('04122003') == False\n assert candidate('20030412') == False\n assert candidate('2003-04') == False\n assert candidate('2003-04-12') == False\n assert candidate('04-2003') == False\n\ndef test_check():\n check(valid_date)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "py", - "prompt": "def anti_shuffle(s: str) -> str:\n \"\"\"\n Write a function that takes a string and returns an ordered version of it.\n Ordered version of string, is a string where all words (separated by space)\n are replaced by a new word where all the characters arranged in\n ascending order based on ascii value.\n Note: You should keep the order of words and blank spaces in the sentence.\n\n For example:\n >>> anti_shuffle('Hi')\n 'Hi'\n >>> anti_shuffle('hello')\n 'ehllo'\n >>> anti_shuffle('Hello World!!!')\n 'Hello !!!Wdlor'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('Hi') == 'Hi'\n assert candidate('hello') == 'ehllo'\n assert candidate('number') == 'bemnru'\n assert candidate('abcd') == 'abcd'\n assert candidate('Hello World!!!') == 'Hello !!!Wdlor'\n assert candidate('') == ''\n assert candidate('Hi. My name is Mister Robot. How are you?') == '.Hi My aemn is Meirst .Rboot How aer ?ouy'\n\ndef test_check():\n check(anti_shuffle)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "py", - "prompt": "from typing import List\n\ndef is_sorted(lst: List[int]) -> bool:\n \"\"\"\n Given a list of numbers, return whether or not they are sorted\n in ascending order. If list has more than 1 duplicate of the same\n number, return False. Assume no negative numbers and only integers.\n\n Examples\n >>> is_sorted([5])\n True\n >>> is_sorted([1, 2, 3, 4, 5])\n True\n >>> is_sorted([1, 3, 2, 4, 5])\n False\n >>> is_sorted([1, 2, 3, 4, 5, 6])\n True\n >>> is_sorted([1, 2, 3, 4, 5, 6, 7])\n True\n >>> is_sorted([1, 3, 2, 4, 5, 6, 7])\n False\n >>> is_sorted([1, 2, 2, 3, 3, 4])\n True\n >>> is_sorted([1, 2, 2, 2, 3, 4])\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([5]) == True\n assert candidate([1, 2, 3, 4, 5]) == True\n assert candidate([1, 3, 2, 4, 5]) == False\n assert candidate([1, 2, 3, 4, 5, 6]) == True\n assert candidate([1, 2, 3, 4, 5, 6, 7]) == True\n assert candidate([1, 3, 2, 4, 5, 6, 7]) == False\n assert candidate([]) == True\n assert candidate([1]) == True\n assert candidate([3, 2, 1]) == False\n assert candidate([1, 2, 2, 2, 3, 4]) == False\n assert candidate([1, 2, 3, 3, 3, 4]) == False\n assert candidate([1, 2, 2, 3, 3, 4]) == True\n assert candidate([1, 2, 3, 4]) == True\n\ndef test_check():\n check(is_sorted)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "py", - "prompt": "def is_happy(s: str) -> bool:\n \"\"\"You are given a string s.\n Your task is to check if the string is happy or not.\n A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n For example:\n >>> is_happy('a')\n False\n >>> is_happy('aa')\n False\n >>> is_happy('abcd')\n True\n >>> is_happy('aabb')\n False\n >>> is_happy('adb')\n True\n >>> is_happy('xyy')\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('a') == False\n assert candidate('aa') == False\n assert candidate('abcd') == True\n assert candidate('aabb') == False\n assert candidate('adb') == True\n assert candidate('xyy') == False\n assert candidate('iopaxpoi') == True\n assert candidate('iopaxioi') == False\n\ndef test_check():\n check(is_happy)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "py", - "prompt": "from typing import List\n\ndef will_it_fly(q: List[int], w: int) -> bool:\n \"\"\"\n Write a function that returns True if the object q will fly, and False otherwise.\n The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n\n Example:\n >>> will_it_fly([1, 2], 5)\n False\n # 1+2 is less than the maximum possible weight, but it's unbalanced.\n\n >>> will_it_fly([3, 2, 3], 1)\n False\n # it's balanced, but 3+2+3 is more than the maximum possible weight.\n\n >>> will_it_fly([3, 2, 3], 9)\n True\n # 3+2+3 is less than the maximum possible weight, and it's balanced.\n\n >>> will_it_fly([3], 5)\n True\n # 3 is less than the maximum possible weight, and it's balanced.\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([3, 2, 3], 9) == True\n assert candidate([1, 2], 5) == False\n assert candidate([3], 5) == True\n assert candidate([3, 2, 3], 1) == False\n assert candidate([1, 2, 3], 6) == False\n assert candidate([5], 5) == True\n\ndef test_check():\n check(will_it_fly)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "py", - "prompt": "from typing import List\n\ndef sort_array(array: List[int]) -> List[int]:\n \"\"\"\n Given an array of non-negative integers, return a copy of the given array after sorting,\n you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n or sort it in descending order if the sum( first index value, last index value) is even.\n\n Note:\n * don't change the given array.\n\n Examples:\n >>> sort_array([])\n []\n >>> sort_array([5])\n [5]\n >>> sort_array([2, 4, 3, 0, 1, 5])\n [0, 1, 2, 3, 4, 5]\n >>> sort_array([2, 4, 3, 0, 1, 5, 6])\n [6, 5, 4, 3, 2, 1, 0]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == []\n assert candidate([5]) == [5]\n assert candidate([2, 4, 3, 0, 1, 5]) == [0, 1, 2, 3, 4, 5]\n assert candidate([2, 4, 3, 0, 1, 5, 6]) == [6, 5, 4, 3, 2, 1, 0]\n assert candidate([2, 1]) == [1, 2]\n assert candidate([15, 42, 87, 32, 11, 0]) == [0, 11, 15, 32, 42, 87]\n assert candidate([21, 14, 23, 11]) == [23, 21, 14, 11]\n\ndef test_check():\n check(sort_array)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "py", - "prompt": "from typing import List\n\ndef count_up_to(n: int) -> List[int]:\n \"\"\"Implement a function that takes an non-negative integer and returns an array of the first n\n integers that are prime numbers and less than n.\n for example:\n >>> count_up_to(5)\n [2, 3]\n >>> count_up_to(11)\n [2, 3, 5, 7]\n >>> count_up_to(0)\n []\n >>> count_up_to(20)\n [2, 3, 5, 7, 11, 13, 17, 19]\n >>> count_up_to(1)\n []\n >>> count_up_to(18)\n [2, 3, 5, 7, 11, 13, 17]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(5) == [2, 3]\n assert candidate(6) == [2, 3, 5]\n assert candidate(7) == [2, 3, 5]\n assert candidate(10) == [2, 3, 5, 7]\n assert candidate(0) == []\n assert candidate(22) == [2, 3, 5, 7, 11, 13, 17, 19]\n assert candidate(1) == []\n assert candidate(18) == [2, 3, 5, 7, 11, 13, 17]\n assert candidate(47) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43]\n assert candidate(101) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]\n\ndef test_check():\n check(count_up_to)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "py", - "prompt": "from typing import List, Optional\n\ndef longest(strings: List[str]) -> Optional[str]:\n \"\"\" Out of list of strings, return the longest one. Return the first one in case of multiple\n strings of the same length. Return None in case the input list is empty.\n >>> longest([])\n None\n >>> longest(['a', 'b', 'c'])\n 'a'\n >>> longest(['a', 'bb', 'ccc'])\n 'ccc'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == None\n assert candidate(['x', 'y', 'z']) == 'x'\n assert candidate(['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']) == 'zzzz'\n\ndef test_check():\n check(longest)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "py", - "prompt": "from typing import List\n\ndef by_length(arr: List[int]) -> List[str]:\n \"\"\"\n Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n reverse the resulting array, and then replace each digit by its corresponding name from\n \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n\n For example:\n >>> by_length([2, 1, 1, 4, 5, 8, 2, 3])\n ['Eight', 'Five', 'Four', 'Three', 'Two', 'Two', 'One', 'One']\n \n If the array is empty, return an empty array:\n >>> by_length([])\n []\n \n If the array has any strange number ignore it:\n >>> by_length([1, -1, 55])\n ['One']\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([2, 1, 1, 4, 5, 8, 2, 3]) == ['Eight', 'Five', 'Four', 'Three', 'Two', 'Two', 'One', 'One']\n assert candidate([]) == []\n assert candidate([1, -1, 55]) == ['One']\n assert candidate([1, -1, 3, 2]) == ['Three', 'Two', 'One']\n assert candidate([9, 4, 8]) == ['Nine', 'Eight', 'Four']\n\ndef test_check():\n check(by_length)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_106_f", - "language": "py", - "prompt": "from typing import List\n\ndef f(n: int) -> List[int]:\n \"\"\" Implement the function f that takes n as a parameter,\n 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\n or the sum of numbers from 1 to i otherwise.\n i starts from 1.\n the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n Example:\n >>> f(5)\n [1, 2, 6, 24, 15]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(5) == [1, 2, 6, 24, 15]\n assert candidate(7) == [1, 2, 6, 24, 15, 720, 28]\n assert candidate(1) == [1]\n assert candidate(3) == [1, 2, 6]\n\ndef test_check():\n check(f)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "py", - "prompt": "def fizz_buzz(n: int) -> int:\n \"\"\"Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n >>> fizz_buzz(50)\n 0\n >>> fizz_buzz(78)\n 2\n >>> fizz_buzz(79)\n 3\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(50) == 0\n assert candidate(78) == 2\n assert candidate(79) == 3\n assert candidate(100) == 3\n assert candidate(200) == 6\n assert candidate(4000) == 192\n assert candidate(10000) == 639\n assert candidate(100000) == 8026\n\ndef test_check():\n check(fizz_buzz)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "py", - "prompt": "def truncate_number(number: float) -> float:\n \"\"\" Given a positive floating point number, it can be decomposed into\n and integer part (largest integer smaller than given number) and decimals\n (leftover part always smaller than 1).\n\n Return the decimal part of the number.\n >>> truncate_number(3.5)\n 0.5\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(3.5) == 0.5\n assert candidate(1.25) == 0.25\n assert candidate(123.0) == 0.0\n\ndef test_check():\n check(truncate_number)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "py", - "prompt": "from typing import List, Tuple\n\ndef sum_product(numbers: List[int]) -> Tuple[int, int]:\n \"\"\" For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n Empty sum should be equal to 0 and empty product should be equal to 1.\n >>> sum_product([])\n (0, 1)\n >>> sum_product([1, 2, 3, 4])\n (10, 24)\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == (0, 1)\n assert candidate([1, 1, 1]) == (3, 1)\n assert candidate([100, 0]) == (100, 0)\n assert candidate([3, 5, 7]) == (15, 105)\n assert candidate([10]) == (10, 10)\n\ndef test_check():\n check(sum_product)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "py", - "prompt": "from typing import List, Tuple\n\ndef get_row(lst: List[List[int]], x: int) -> List[Tuple[int, int]]:\n \"\"\"\n You are given a 2 dimensional data, as a nested lists,\n which is similar to matrix, however, unlike matrices,\n each row may contain a different number of columns.\n Given lst, and integer x, find integers x in the list,\n and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n each tuple is a coordinate - (row, columns), starting with 0.\n Sort coordinates initially by rows in ascending order.\n Also, sort coordinates of the row by columns in descending order.\n \n Examples:\n >>> get_row([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1)\n [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n >>> get_row([], 1)\n []\n >>> get_row([[], [1], [1, 2, 3]], 3)\n [(2, 2)]\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n assert candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6]], 2) == [(0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1)]\n assert candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 1, 3, 4, 5, 6], [1, 2, 1, 4, 5, 6], [1, 2, 3, 1, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1) == [(0, 0), (1, 0), (2, 1), (2, 0), (3, 2), (3, 0), (4, 3), (4, 0), (5, 4), (5, 0), (6, 5), (6, 0)]\n assert candidate([], 1) == []\n assert candidate([[1]], 2) == []\n assert candidate([[], [1], [1, 2, 3]], 3) == [(2, 2)]\n\ndef test_check():\n check(get_row)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "py", - "prompt": "from typing import List\n\ndef eat(number: int, need: int, remaining: int) -> List[int]:\n \"\"\"\n You're a hungry rabbit, and you already have eaten a certain number of carrots,\n but now you need to eat more carrots to complete the day's meals.\n you should return an array of [ total number of eaten carrots after your meals,\n the number of carrots left after your meals ]\n if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n \n Example:\n >>> eat(5, 6, 10)\n [11, 4]\n >>> eat(4, 8, 9)\n [12, 1]\n >>> eat(1, 10, 10)\n [11, 0]\n >>> eat(2, 11, 5)\n [7, 0]\n \n Variables:\n @number : integer\n the number of carrots that you have eaten.\n @need : integer\n the number of carrots that you need to eat.\n @remaining : integer\n the number of remaining carrots thet exist in stock\n \n Constrain:\n * 0 <= number <= 1000\n * 0 <= need <= 1000\n * 0 <= remaining <= 1000\n\n Have fun :)\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(5, 6, 10) == [11, 4]\n assert candidate(4, 8, 9) == [12, 1]\n assert candidate(1, 10, 10) == [11, 0]\n assert candidate(2, 11, 5) == [7, 0]\n assert candidate(4, 5, 7) == [9, 2]\n assert candidate(4, 5, 1) == [5, 0]\n\ndef test_check():\n check(eat)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "py", - "prompt": "def solve(N: int) -> str:\n \"\"\"Given a positive integer N, return the total sum of its digits in binary.\n \n Example\n >>> solve(1000)\n '1'\n >>> solve(150)\n '110'\n >>> solve(147)\n '1100'\n \n Variables:\n @N integer\n Constraints: 0 \u2264 N \u2264 10000.\n Output:\n a string of binary number\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(1000) == '1'\n assert candidate(150) == '110'\n assert candidate(147) == '1100'\n assert candidate(333) == '1001'\n assert candidate(963) == '10010'\n\ndef test_check():\n check(solve)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "py", - "prompt": "from typing import List\n\ndef skjkasdkd(lst: List[int]) -> int:\n \"\"\"You are given a list of integers.\n You need to find the largest prime value and return the sum of its digits.\n\n Examples:\n >>> skjkasdkd([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3])\n 10\n >>> skjkasdkd([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1])\n 25\n >>> skjkasdkd([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3])\n 13\n >>> skjkasdkd([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6])\n 11\n >>> skjkasdkd([0, 81, 12, 3, 1, 21])\n 3\n >>> skjkasdkd([0, 8, 1, 2, 1, 7])\n 7\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]) == 10\n assert candidate([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]) == 25\n assert candidate([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]) == 13\n assert candidate([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]) == 11\n assert candidate([0, 81, 12, 3, 1, 21]) == 3\n assert candidate([0, 8, 1, 2, 1, 7]) == 7\n assert candidate([8191]) == 19\n assert candidate([8191, 123456, 127, 7]) == 19\n assert candidate([127, 97, 8192]) == 10\n\ndef test_check():\n check(skjkasdkd)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "py", - "prompt": "from typing import List\n\ndef smallest_change(arr: List[int]) -> int:\n \"\"\"\n Given an array arr of integers, find the minimum number of elements that\n need to be changed to make the array palindromic. A palindromic array is an array that\n is read the same backwards and forwards. In one change, you can change one element to any other element.\n\n For example:\n >>> smallest_change([1, 2, 3, 5, 4, 7, 9, 6])\n 4\n >>> smallest_change([1, 2, 3, 4, 3, 2, 2])\n 1\n >>> smallest_change([1, 2, 3, 2, 1])\n 0\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([1, 2, 3, 5, 4, 7, 9, 6]) == 4\n assert candidate([1, 2, 3, 4, 3, 2, 2]) == 1\n assert candidate([1, 4, 2]) == 1\n assert candidate([1, 4, 4, 2]) == 1\n assert candidate([1, 2, 3, 2, 1]) == 0\n assert candidate([3, 1, 1, 3]) == 0\n assert candidate([1]) == 0\n assert candidate([0, 1]) == 1\n\ndef test_check():\n check(smallest_change)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "py", - "prompt": "from typing import List\n\ndef numerical_letter_grade(grades: List[float]) -> List[str]:\n \"\"\"It is the last week of the semester and the teacher has to give the grades\n to students. The teacher has been making her own algorithm for grading.\n The only problem is, she has lost the code she used for grading.\n She has given you a list of GPAs for some students and you have to write \n a function that can output a list of letter grades using the following table:\n GPA | Letter grade\n 4.0 A+\n > 3.7 A \n > 3.3 A- \n > 3.0 B+\n > 2.7 B \n > 2.3 B-\n > 2.0 C+\n > 1.7 C\n > 1.3 C-\n > 1.0 D+ \n > 0.7 D \n > 0.0 D-\n 0.0 E\n \n\n Example:\n >>> grade_equation([4.0, 3, 1.7, 2, 3.5])\n ['A+', 'B', 'C-', 'C', 'A-']\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([4.0, 3, 1.7, 2, 3.5]) == ['A+', 'B', 'C-', 'C', 'A-']\n assert candidate([1.2]) == ['D+']\n assert candidate([0.5]) == ['D-']\n assert candidate([0.0]) == ['E']\n assert candidate([1.0, 0.3, 1.5, 2.8, 3.3]) == ['D', 'D-', 'C-', 'B', 'B+']\n assert candidate([0.0, 0.7]) == ['E', 'D-']\n\ndef test_check():\n check(numerical_letter_grade)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "py", - "prompt": "def triangle_area(a: int, b: int, c: int) -> float:\n \"\"\"\n Given the lengths of the three sides of a triangle. Return the area of\n the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n Otherwise return -1\n Three sides make a valid triangle when the sum of any two sides is greater \n than the third side.\n Example:\n >>> triangle_area(3, 4, 5)\n 6.0\n >>> triangle_area(1, 2, 10)\n -1\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(3, 4, 5) == 6.0\n assert candidate(1, 2, 10) == -1\n assert candidate(4, 8, 5) == 8.18\n assert candidate(2, 2, 2) == 1.73\n assert candidate(1, 2, 3) == -1\n assert candidate(10, 5, 7) == 16.25\n assert candidate(2, 6, 3) == -1\n assert candidate(1, 1, 1) == 0.43\n assert candidate(2, 2, 10) == -1\n\ndef test_check():\n check(triangle_area)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "py", - "prompt": "def same_chars(s0: str, s1: str) -> bool:\n \"\"\"\n Check if two words have the same characters.\n >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n True\n >>> same_chars('abcd', 'dddddddabc')\n True\n >>> same_chars('dddddddabc', 'abcd')\n True\n >>> same_chars('eabcd', 'dddddddabc')\n False\n >>> same_chars('abcd', 'dddddddabce')\n False\n >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc')\n False\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('eabcdzzzz', 'dddzzzzzzzddeddabc') == True\n assert candidate('abcd', 'dddddddabc') == True\n assert candidate('dddddddabc', 'abcd') == True\n assert candidate('eabcd', 'dddddddabc') == False\n assert candidate('abcd', 'dddddddabcf') == False\n assert candidate('eabcdzzzz', 'dddzzzzzzzddddabc') == False\n assert candidate('aabb', 'aaccc') == False\n\ndef test_check():\n check(same_chars)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "py", - "prompt": "from typing import List\n\ndef minSubArraySum(nums: List[int]) -> int:\n \"\"\"\n Given an array of integers nums, find the minimum sum of any non-empty sub-array\n of nums.\n Example\n >>> minSubArraySum([2, 3, 4, 1, 2, 4])\n 1\n >>> minSubArraySum([-1, -2, -3])\n -6\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([2, 3, 4, 1, 2, 4]) == 1\n assert candidate([-1, -2, -3]) == -6\n assert candidate([-1, -2, -3, 2, -10]) == -14\n assert candidate([-9999999999999999]) == -9999999999999999\n assert candidate([0, 10, 20, 1000000]) == 0\n assert candidate([-1, -2, -3, 10, -5]) == -6\n assert candidate([100, -1, -2, -3, 10, -5]) == -6\n assert candidate([10, 11, 13, 8, 3, 4]) == 3\n assert candidate([100, -33, 32, -1, 0, -2]) == -33\n assert candidate([-10]) == -10\n assert candidate([7]) == 7\n assert candidate([1, -1]) == -1\n\ndef test_check():\n check(minSubArraySum)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "py", - "prompt": "from typing import List\n\ndef select_words(s: str, n: int) -> List[str]:\n \"\"\"Given a string s and a natural number n, you have been tasked to implement \n a function that returns a list of all words from string s that contain exactly \n n consonants, in order these words appear in the string s.\n If the string s is empty then the function should return an empty list.\n Note: you may assume the input string contains only letters and spaces.\n Examples:\n >>> select_words('Mary had a little lamb', 4)\n ['little']\n >>> select_words('Mary had a little lamb', 3)\n ['Mary', 'lamb']\n >>> select_words('simple white space', 2)\n []\n >>> select_words('Hello world', 4)\n ['world']\n >>> select_words('Uncle sam', 3)\n ['Uncle']\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('Mary had a little lamb', 4) == ['little']\n assert candidate('Mary had a little lamb', 3) == ['Mary', 'lamb']\n assert candidate('simple white space', 2) == []\n assert candidate('Hello world', 4) == ['world']\n assert candidate('Uncle sam', 3) == ['Uncle']\n assert candidate('', 4) == []\n assert candidate('a b c d e f', 1) == ['b', 'c', 'd', 'f']\n\ndef test_check():\n check(select_words)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "py", - "prompt": "from typing import List\n\ndef all_prefixes(string: str) -> List[str]:\n \"\"\" Return list of all prefixes from shortest to longest of the input string\n >>> all_prefixes('abc')\n ['a', 'ab', 'abc']\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('') == []\n assert candidate('asdfgh') == ['a', 'as', 'asd', 'asdf', 'asdfg', 'asdfgh']\n assert candidate('WWW') == ['W', 'WW', 'WWW']\n\ndef test_check():\n check(all_prefixes)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "py", - "prompt": "def closest_integer(value: str) -> int:\n \"\"\"\n Create a function that takes a value (string) representing a number\n and returns the closest integer to it. If the number is equidistant\n from two integers, round it away from zero.\n\n Examples\n >>> closest_integer('10')\n 10\n >>> closest_integer('15.3')\n 15\n\n Note:\n Rounding away from zero means that if the given number is equidistant\n from two integers, the one you should return is the one that is the\n farthest from zero. For example closest_integer(\"14.5\") should\n return 15 and closest_integer(\"-14.5\") should return -15.\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('10') == 10\n assert candidate('14.5') == 15\n assert candidate('-15.5') == -16\n assert candidate('15.3') == 15\n assert candidate('0') == 0\n\ndef test_check():\n check(closest_integer)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "py", - "prompt": "def file_name_check(file_name: str) -> str:\n \"\"\"Create a function which takes a string representing a file's name, and returns\n 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n A file's name is considered to be valid if and only if all the following conditions \n are met:\n - There should not be more than three digits ('0'-'9') in the file's name.\n - The file's name contains exactly one dot '.'\n - The substring before the dot should not be empty, and it starts with a letter from \n the latin alphapet ('a'-'z' and 'A'-'Z').\n - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n Examples:\n >>> file_name_check('example.txt')\n 'Yes'\n >>> file_name_check('1example.dll')\n 'No'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('example.txt') == 'Yes'\n assert candidate('1example.dll') == 'No'\n assert candidate('s1sdf3.asd') == 'No'\n assert candidate('K.dll') == 'Yes'\n assert candidate('MY16FILE3.exe') == 'Yes'\n assert candidate('His12FILE94.exe') == 'No'\n assert candidate('_Y.txt') == 'No'\n assert candidate('?aREYA.exe') == 'No'\n assert candidate('/this_is_valid.dll') == 'No'\n assert candidate('this_is_valid.wow') == 'No'\n assert candidate('this_is_valid.txt') == 'Yes'\n assert candidate('this_is_valid.txtexe') == 'No'\n assert candidate('#this2_i4s_5valid.ten') == 'No'\n assert candidate('@this1_is6_valid.exe') == 'No'\n assert candidate('this_is_12valid.6exe4.txt') == 'No'\n assert candidate('all.exe.txt') == 'No'\n assert candidate('I563_No.exe') == 'Yes'\n assert candidate('Is3youfault.txt') == 'Yes'\n assert candidate('no_one#knows.dll') == 'Yes'\n assert candidate('1I563_Yes3.exe') == 'No'\n assert candidate('I563_Yes3.txtt') == 'No'\n assert candidate('final..txt') == 'No'\n assert candidate('final132') == 'No'\n assert candidate('_f4indsartal132.') == 'No'\n assert candidate('.txt') == 'No'\n assert candidate('s.') == 'No'\n\ndef test_check():\n check(file_name_check)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "py", - "prompt": "from typing import Tuple\n\ndef intersection(interval1: Tuple[int, int], interval2: Tuple[int, int]) -> str:\n \"\"\"You are given two intervals,\n where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n The given intervals are closed which means that the interval (start, end)\n includes both start and end.\n For each given interval, it is assumed that its start is less or equal its end.\n Your task is to determine whether the length of intersection of these two \n intervals is a prime number.\n Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n which its length is 1, which not a prime number.\n If the length of the intersection is a prime number, return \"YES\",\n otherwise, return \"NO\".\n If the two intervals don't intersect, return \"NO\".\n\n\n [input/output] samples:\n >>> intersection((1, 2), (2, 3))\n 'NO'\n >>> intersection((-1, 1), (0, 4))\n 'NO'\n >>> intersection((-3, -1), (-5, 5))\n 'YES'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate((1, 2), (2, 3)) == 'NO'\n assert candidate((-1, 1), (0, 4)) == 'NO'\n assert candidate((-3, -1), (-5, 5)) == 'YES'\n assert candidate((-2, 2), (-4, 0)) == 'YES'\n assert candidate((-11, 2), (-1, -1)) == 'NO'\n assert candidate((1, 2), (3, 5)) == 'NO'\n assert candidate((1, 2), (1, 2)) == 'NO'\n assert candidate((-2, -2), (-3, -2)) == 'NO'\n\ndef test_check():\n check(intersection)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "py", - "prompt": "def largest_prime_factor(n: int) -> int:\n \"\"\"Return the largest prime factor of n. Assume n > 1 and is not a prime.\n >>> largest_prime_factor(13195)\n 29\n >>> largest_prime_factor(2048)\n 2\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(15) == 5\n assert candidate(27) == 3\n assert candidate(63) == 7\n assert candidate(330) == 11\n assert candidate(13195) == 29\n\ndef test_check():\n check(largest_prime_factor)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "py", - "prompt": "def count_distinct_characters(string: str) -> int:\n \"\"\" Given a string, find out how many distinct characters (regardless of case) does it consist of\n >>> count_distinct_characters('xyzXYZ')\n 3\n >>> count_distinct_characters('Jerry')\n 4\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('') == 0\n assert candidate('abcde') == 5\n assert candidate('abcdecadeCADE') == 5\n assert candidate('aaaaAAAAaaaa') == 1\n assert candidate('Jerry jERRY JeRRRY') == 5\n\ndef test_check():\n check(count_distinct_characters)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "py", - "prompt": "from typing import List\n\ndef below_zero(operations: List[int]) -> bool:\n \"\"\" You're given a list of deposit and withdrawal operations on a bank account that starts with\n zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n at that point function should return True. Otherwise it should return False.\n >>> below_zero([1, 2, 3])\n False\n >>> below_zero([1, 2, -4, 5])\n True\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate([]) == False\n assert candidate([1, 2, -3, 1, 2, -3]) == False\n assert candidate([1, 2, -4, 5, 6]) == True\n assert candidate([1, -1, 2, -2, 5, -5, 4, -4]) == False\n assert candidate([1, -1, 2, -2, 5, -5, 4, -5]) == True\n assert candidate([1, -2, 2, -2, 5, -5, 4, -4]) == True\n\ndef test_check():\n check(below_zero)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "py", - "prompt": "def make_palindrome(string: str) -> str:\n \"\"\" Find the shortest palindrome that begins with a supplied string.\n Algorithm idea is simple:\n - Find the longest postfix of supplied string that is a palindrome.\n - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n >>> make_palindrome('')\n ''\n >>> make_palindrome('cat')\n 'catac'\n >>> make_palindrome('cata')\n 'catac'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate('') == ''\n assert candidate('x') == 'x'\n assert candidate('xyz') == 'xyzyx'\n assert candidate('xyx') == 'xyx'\n assert candidate('jerry') == 'jerryrrej'\n\ndef test_check():\n check(make_palindrome)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "py", - "prompt": "def int_to_mini_roman(number: int) -> str:\n \"\"\"\n Given a positive integer, obtain its roman numeral equivalent as a string,\n and return it in lowercase.\n Restrictions: 1 <= num <= 1000\n\n Examples:\n >>> int_to_mini_roman(19)\n 'xix'\n >>> int_to_mini_roman(152)\n 'clii'\n >>> int_to_mini_roman(426)\n 'cdxxvi'\n \"\"\"\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "def check(candidate):\n assert candidate(19) == 'xix'\n assert candidate(152) == 'clii'\n assert candidate(251) == 'ccli'\n assert candidate(426) == 'cdxxvi'\n assert candidate(500) == 'd'\n assert candidate(1) == 'i'\n assert candidate(4) == 'iv'\n assert candidate(43) == 'xliii'\n assert candidate(90) == 'xc'\n assert candidate(94) == 'xciv'\n assert candidate(532) == 'dxxxii'\n assert candidate(900) == 'cm'\n assert candidate(994) == 'cmxciv'\n assert candidate(1000) == 'm'\n\ndef test_check():\n check(int_to_mini_roman)\n\ntest_check()\n", - "stop_tokens": [ - "\ndef", - "\n#", - "\nif", - "\nclass" - ] - } -] \ No newline at end of file diff --git a/data/r-keep.json b/data/r-keep.json deleted file mode 100644 index 80db04a9c8ffe3be6d38cf13fbd049686111cf09..0000000000000000000000000000000000000000 --- a/data/r-keep.json +++ /dev/null @@ -1,2095 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "r", - "prompt": "# For a given number n, find the largest number that divides n evenly, smaller than n\n# >>> largest_divisor(15)\n# 5\nlargest_divisor <- function(n) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- largest_divisor\n if(!identical(candidate(3), 1)){quit('no', 1)}\n if(!identical(candidate(7), 1)){quit('no', 1)}\n if(!identical(candidate(10), 5)){quit('no', 1)}\n if(!identical(candidate(100), 50)){quit('no', 1)}\n if(!identical(candidate(49), 7)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_47_median", - "language": "r", - "prompt": "# Return median of elements in the list l.\n# >>> median([3, 1, 2, 4, 5])\n# 3\n# >>> median([-10, 4, 6, 1000, 10, 20])\n# 15.0\nmedian <- function(l) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- median\n if(!identical(candidate(c(3, 1, 2, 4, 5)), 3)){quit('no', 1)}\n if(!identical(candidate(c(-10, 4, 6, 1000, 10, 20)), 8.0)){quit('no', 1)}\n if(!identical(candidate(c(5)), 5)){quit('no', 1)}\n if(!identical(candidate(c(6, 5)), 5.5)){quit('no', 1)}\n if(!identical(candidate(c(8, 1, 3, 9, 9, 2, 7)), 7)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "r", - "prompt": "# Given two lists operator, and operand. The first list has basic algebra operations, and \n# the second list is a list of integers. Use the two given lists to build the algebric \n# expression and return the evaluation of this expression.\n# The basic algebra operations:\n# Addition ( + ) \n# Subtraction ( - ) \n# Multiplication ( * ) \n# Floor division ( // ) \n# Exponentiation ( ** ) \n# Example:\n# operator['+', '*', '-']\n# array = [2, 3, 4, 5]\n# result = 2 + 3 * 4 - 5\n# => result = 9\n# Note:\n# The length of operator list is equal to the length of operand list minus one.\n# Operand is a list of of non-negative integers.\n# Operator list has at least one operator, and operand list has at least two operands.\ndo_algebra <- function(operator, operand) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- do_algebra\n if(!identical(candidate(c('**', '*', '+'), c(2, 3, 4, 5)), 37)){quit('no', 1)}\n if(!identical(candidate(c('+', '*', '-'), c(2, 3, 4, 5)), 9)){quit('no', 1)}\n if(!identical(candidate(c('//', '*'), c(7, 3, 4)), 8)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "r", - "prompt": "# Return maximum element in the list.\n# >>> max_element([1, 2, 3])\n# 3\n# >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n# 123\nmax_element <- function(l) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- max_element\n if(!identical(candidate(c(1, 2, 3)), 3)){quit('no', 1)}\n if(!identical(candidate(c(5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10)), 124)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "r", - "prompt": "# Create a function which returns the largest index of an element which\n# is not greater than or equal to the element immediately preceding it. If\n# no such element exists then return -1. The given array will not contain\n# duplicate values.\n# Examples:\n# can_arrange([1,2,4,3,5]) = 3\n# can_arrange([1,2,3]) = -1\ncan_arrange <- function(arr) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- can_arrange\n if(!identical(candidate(c(1, 2, 4, 3, 5)), 3)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 4, 5)), -1)){quit('no', 1)}\n if(!identical(candidate(c(1, 4, 2, 5, 6, 7, 8, 9, 10)), 2)){quit('no', 1)}\n if(!identical(candidate(c(4, 8, 5, 7, 3)), 4)){quit('no', 1)}\n if(!identical(candidate(c()), -1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "r", - "prompt": "# Imagine a road that's a perfectly straight infinitely long line.\n# n cars are driving left to right; simultaneously, a different set of n cars\n# are driving right to left. The two sets of cars start out being very far from\n# each other. All cars move in the same speed. Two cars are said to collide\n# when a car that's moving left to right hits a car that's moving right to left.\n# However, the cars are infinitely sturdy and strong; as a result, they continue moving\n# in their trajectory as if they did not collide.\n# This function outputs the number of such collisions.\ncar_race_collision <- function(n) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- car_race_collision\n if(!identical(candidate(2), 4)){quit('no', 1)}\n if(!identical(candidate(3), 9)){quit('no', 1)}\n if(!identical(candidate(4), 16)){quit('no', 1)}\n if(!identical(candidate(8), 64)){quit('no', 1)}\n if(!identical(candidate(10), 100)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "r", - "prompt": "# Create a function that returns True if the last character\n# of a given string is an alphabetical character and is not\n# a part of a word, and False otherwise.\n# Note: \"word\" is a group of characters separated by space.\n# Examples:\n# check_if_last_char_is_a_letter(\"apple pie\") \u279e False\n# check_if_last_char_is_a_letter(\"apple pi e\") \u279e True\n# check_if_last_char_is_a_letter(\"apple pi e \") \u279e False\n# check_if_last_char_is_a_letter(\"\") \u279e False\ncheck_if_last_char_is_a_letter <- function(txt) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- check_if_last_char_is_a_letter\n if(!identical(candidate('apple'), FALSE)){quit('no', 1)}\n if(!identical(candidate('apple pi e'), TRUE)){quit('no', 1)}\n if(!identical(candidate('eeeee'), FALSE)){quit('no', 1)}\n if(!identical(candidate('A'), TRUE)){quit('no', 1)}\n if(!identical(candidate('Pumpkin pie '), FALSE)){quit('no', 1)}\n if(!identical(candidate('Pumpkin pie 1'), FALSE)){quit('no', 1)}\n if(!identical(candidate(''), FALSE)){quit('no', 1)}\n if(!identical(candidate('eeeee e '), FALSE)){quit('no', 1)}\n if(!identical(candidate('apple pie'), FALSE)){quit('no', 1)}\n if(!identical(candidate('apple pi e '), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "r", - "prompt": "# Return true if a given number is prime, and false otherwise.\n# >>> is_prime(6)\n# False\n# >>> is_prime(101)\n# True\n# >>> is_prime(11)\n# True\n# >>> is_prime(13441)\n# True\n# >>> is_prime(61)\n# True\n# >>> is_prime(4)\n# False\n# >>> is_prime(1)\n# False\nis_prime <- function(n) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- is_prime\n if(!identical(candidate(6), FALSE)){quit('no', 1)}\n if(!identical(candidate(101), TRUE)){quit('no', 1)}\n if(!identical(candidate(11), TRUE)){quit('no', 1)}\n if(!identical(candidate(13441), TRUE)){quit('no', 1)}\n if(!identical(candidate(61), TRUE)){quit('no', 1)}\n if(!identical(candidate(4), FALSE)){quit('no', 1)}\n if(!identical(candidate(1), FALSE)){quit('no', 1)}\n if(!identical(candidate(5), TRUE)){quit('no', 1)}\n if(!identical(candidate(11), TRUE)){quit('no', 1)}\n if(!identical(candidate(17), TRUE)){quit('no', 1)}\n if(!identical(candidate(85), FALSE)){quit('no', 1)}\n if(!identical(candidate(77), FALSE)){quit('no', 1)}\n if(!identical(candidate(255379), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "r", - "prompt": "# Given a list of positive integers x. return a sorted list of all \n# elements that hasn't any even digit.\n# Note: Returned list should be sorted in increasing order.\n# For example:\n# >>> unique_digits([15, 33, 1422, 1])\n# [1, 15, 33]\n# >>> unique_digits([152, 323, 1422, 10])\n# []\nunique_digits <- function(x) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- unique_digits\n if(!identical(candidate(c(15, 33, 1422, 1)), list(1, 15, 33))){quit('no', 1)}\n if(!identical(candidate(c(152, 323, 1422, 10)), list())){quit('no', 1)}\n if(!identical(candidate(c(12345, 2033, 111, 151)), list(111, 151))){quit('no', 1)}\n if(!identical(candidate(c(135, 103, 31)), list(31, 135))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "r", - "prompt": "# Input are two strings a and b consisting only of 1s and 0s.\n# Perform binary XOR on these inputs and return result also as a string.\n# >>> string_xor('010', '110')\n# '100'\nstring_xor <- function(a, b) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- string_xor\n if(!identical(candidate('111000', '101010'), '010010')){quit('no', 1)}\n if(!identical(candidate('1', '1'), '0')){quit('no', 1)}\n if(!identical(candidate('0101', '0000'), '0101')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "r", - "prompt": "# sum_to_n is a function that sums numbers from 1 to n.\n# >>> sum_to_n(30)\n# 465\n# >>> sum_to_n(100)\n# 5050\n# >>> sum_to_n(5)\n# 15\n# >>> sum_to_n(10)\n# 55\n# >>> sum_to_n(1)\n# 1\nsum_to_n <- function(n) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- sum_to_n\n if(!identical(candidate(1), 1)){quit('no', 1)}\n if(!identical(candidate(6), 21)){quit('no', 1)}\n if(!identical(candidate(11), 66)){quit('no', 1)}\n if(!identical(candidate(30), 465)){quit('no', 1)}\n if(!identical(candidate(100), 5050)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "r", - "prompt": "# Given a list of numbers, return the sum of squares of the numbers\n# in the list that are odd. Ignore numbers that are negative or not integers.\n# double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10\n# double_the_difference([-1, -2, 0]) == 0\n# double_the_difference([9, -2]) == 81\n# double_the_difference([0]) == 0 \n# If the input list is empty, return 0.\ndouble_the_difference <- function(lst) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- double_the_difference\n if(!identical(candidate(c()), 0)){quit('no', 1)}\n if(!identical(candidate(c(5.0, 4.0)), 25)){quit('no', 1)}\n if(!identical(candidate(c(0.1, 0.2, 0.3)), 0)){quit('no', 1)}\n if(!identical(candidate(c(-10.0, -20.0, -30.0)), 0)){quit('no', 1)}\n if(!identical(candidate(c(-1.0, -2.0, 8.0)), 0)){quit('no', 1)}\n if(!identical(candidate(c(0.2, 3.0, 5.0)), 34)){quit('no', 1)}\n if(!identical(candidate(c(-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0)), 165)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "r", - "prompt": "# Return length of given string\n# >>> strlen('')\n# 0\n# >>> strlen('abc')\n# 3\nstrlen <- function(string) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- strlen\n if(!identical(candidate(''), 0)){quit('no', 1)}\n if(!identical(candidate('x'), 1)){quit('no', 1)}\n if(!identical(candidate('asdasnakj'), 9)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "r", - "prompt": "# You'll be given a string of words, and your task is to count the number\n# of boredoms. A boredom is a sentence that starts with the word \"I\".\n# Sentences are delimited by '.', '?' or '!'.\n# For example:\n# >>> is_bored(\"Hello world\")\n# 0\n# >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n# 1\nis_bored <- function(S) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- is_bored\n if(!identical(candidate('Hello world'), 0)){quit('no', 1)}\n if(!identical(candidate('Is the sky blue?'), 0)){quit('no', 1)}\n if(!identical(candidate('I love It !'), 1)){quit('no', 1)}\n if(!identical(candidate('bIt'), 0)){quit('no', 1)}\n if(!identical(candidate('I feel good today. I will be productive. will kill It'), 2)){quit('no', 1)}\n if(!identical(candidate('You and I are going for a walk'), 0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "r", - "prompt": "# Write a function vowels_count which takes a string representing\n# a word as input and returns the number of vowels in the string.\n# Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n# vowel, but only when it is at the end of the given word.\n# Example:\n# >>> vowels_count(\"abcde\")\n# 2\n# >>> vowels_count(\"ACEDY\")\n# 3\nvowels_count <- function(s) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- vowels_count\n if(!identical(candidate('abcde'), 2)){quit('no', 1)}\n if(!identical(candidate('Alone'), 3)){quit('no', 1)}\n if(!identical(candidate('key'), 2)){quit('no', 1)}\n if(!identical(candidate('bye'), 1)){quit('no', 1)}\n if(!identical(candidate('keY'), 2)){quit('no', 1)}\n if(!identical(candidate('bYe'), 1)){quit('no', 1)}\n if(!identical(candidate('ACEDY'), 3)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "r", - "prompt": "# Return n-th Fibonacci number.\n# >>> fib(10)\n# 55\n# >>> fib(1)\n# 1\n# >>> fib(8)\n# 21\nfib <- function(n) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- fib\n if(!identical(candidate(10), 55)){quit('no', 1)}\n if(!identical(candidate(1), 1)){quit('no', 1)}\n if(!identical(candidate(8), 21)){quit('no', 1)}\n if(!identical(candidate(11), 89)){quit('no', 1)}\n if(!identical(candidate(12), 144)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "r", - "prompt": "# Your task is to implement a function that will simplify the expression\n# x * n. The function returns True if x * n evaluates to a whole number and False\n# otherwise. Both x and n, are string representation of a fraction, and have the following format,\n# / where both numerator and denominator are positive whole numbers.\n# You can assume that x, and n are valid fractions, and do not have zero as denominator.\n# simplify(\"1/5\", \"5/1\") = True\n# simplify(\"1/6\", \"2/1\") = False\n# simplify(\"7/10\", \"10/2\") = False\nsimplify <- function(x, n) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- simplify\n if(!identical(candidate('1/5', '5/1'), TRUE)){quit('no', 1)}\n if(!identical(candidate('1/6', '2/1'), FALSE)){quit('no', 1)}\n if(!identical(candidate('5/1', '3/1'), TRUE)){quit('no', 1)}\n if(!identical(candidate('7/10', '10/2'), FALSE)){quit('no', 1)}\n if(!identical(candidate('2/10', '50/10'), TRUE)){quit('no', 1)}\n if(!identical(candidate('7/2', '4/2'), TRUE)){quit('no', 1)}\n if(!identical(candidate('11/6', '6/1'), TRUE)){quit('no', 1)}\n if(!identical(candidate('2/3', '5/2'), FALSE)){quit('no', 1)}\n if(!identical(candidate('5/2', '3/5'), FALSE)){quit('no', 1)}\n if(!identical(candidate('2/4', '8/4'), TRUE)){quit('no', 1)}\n if(!identical(candidate('2/4', '4/2'), TRUE)){quit('no', 1)}\n if(!identical(candidate('1/5', '5/1'), TRUE)){quit('no', 1)}\n if(!identical(candidate('1/5', '1/5'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "r", - "prompt": "# Given a string s, count the number of uppercase vowels in even indices.\n# For example:\n# count_upper('aBCdEf') returns 1\n# count_upper('abcdefg') returns 0\n# count_upper('dBBE') returns 0\ncount_upper <- function(s) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- count_upper\n if(!identical(candidate('aBCdEf'), 1)){quit('no', 1)}\n if(!identical(candidate('abcdefg'), 0)){quit('no', 1)}\n if(!identical(candidate('dBBE'), 0)){quit('no', 1)}\n if(!identical(candidate('B'), 0)){quit('no', 1)}\n if(!identical(candidate('U'), 1)){quit('no', 1)}\n if(!identical(candidate(''), 0)){quit('no', 1)}\n if(!identical(candidate('EEEE'), 2)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "r", - "prompt": "# You are given a rectangular grid of wells. Each row represents a single well,\n# and each 1 in a row represents a single unit of water.\n# Each well has a corresponding bucket that can be used to extract water from it, \n# and all buckets have the same capacity.\n# Your task is to use the buckets to empty the wells.\n# Output the number of times you need to lower the buckets.\n# Example 1:\n# Input: \n# grid : [[0,0,1,0], [0,1,0,0], [1,1,1,1]]\n# bucket_capacity : 1\n# Output: 6\n# Example 2:\n# Input: \n# grid : [[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]]\n# bucket_capacity : 2\n# Output: 5\n# Example 3:\n# Input: \n# grid : [[0,0,0], [0,0,0]]\n# bucket_capacity : 5\n# Output: 0\n# Constraints:\n# * all wells have the same length\n# * 1 <= grid.length <= 10^2\n# * 1 <= grid[:,1].length <= 10^2\n# * grid[i][j] -> 0 | 1\n# * 1 <= capacity <= 10\nmax_fill <- function(grid, capacity) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- max_fill\n if(!identical(candidate(list(list(0, 0, 1, 0), list(0, 1, 0, 0), list(1, 1, 1, 1)), 1), 6)){quit('no', 1)}\n if(!identical(candidate(list(list(0, 0, 1, 1), list(0, 0, 0, 0), list(1, 1, 1, 1), list(0, 1, 1, 1)), 2), 5)){quit('no', 1)}\n if(!identical(candidate(list(list(0, 0, 0), list(0, 0, 0)), 5), 0)){quit('no', 1)}\n if(!identical(candidate(list(list(1, 1, 1, 1), list(1, 1, 1, 1)), 2), 4)){quit('no', 1)}\n if(!identical(candidate(list(list(1, 1, 1, 1), list(1, 1, 1, 1)), 9), 2)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "r", - "prompt": "# Given an array arr of integers and a positive integer k, return a sorted list \n# of length k with the maximum k numbers in arr.\n# Example 1:\n# Input: arr = [-3, -4, 5], k = 3\n# Output: [-4, -3, 5]\n# Example 2:\n# Input: arr = [4, -4, 4], k = 2\n# Output: [4, 4]\n# Example 3:\n# Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1\n# Output: [2]\n# Note:\n# 1. The length of the array will be in the range of [1, 1000].\n# 2. The elements in the array will be in the range of [-1000, 1000].\n# 3. 0 <= k <= len(arr)\nmaximum <- function(arr, k) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- maximum\n if(!identical(candidate(c(-3, -4, 5), 3), list(-4, -3, 5))){quit('no', 1)}\n if(!identical(candidate(c(4, -4, 4), 2), list(4, 4))){quit('no', 1)}\n if(!identical(candidate(c(-3, 2, 1, 2, -1, -2, 1), 1), list(2))){quit('no', 1)}\n if(!identical(candidate(c(123, -123, 20, 0, 1, 2, -3), 3), list(2, 20, 123))){quit('no', 1)}\n if(!identical(candidate(c(-123, 20, 0, 1, 2, -3), 4), list(0, 1, 2, 20))){quit('no', 1)}\n if(!identical(candidate(c(5, 15, 0, 3, -13, -8, 0), 7), list(-13, -8, 0, 0, 3, 5, 15))){quit('no', 1)}\n if(!identical(candidate(c(-1, 0, 2, 5, 3, -10), 2), list(3, 5))){quit('no', 1)}\n if(!identical(candidate(c(1, 0, 5, -7), 1), list(5))){quit('no', 1)}\n if(!identical(candidate(c(4, -4), 2), list(-4, 4))){quit('no', 1)}\n if(!identical(candidate(c(-10, 10), 2), list(-10, 10))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, -23, 243, -400, 0), 0), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "r", - "prompt": "# Write a function that takes a message, and encodes in such a \n# way that it swaps case of all letters, replaces all vowels in \n# the message with the letter that appears 2 places ahead of that \n# vowel in the english alphabet. \n# Assume only letters. \n# Examples:\n# >>> encode('test')\n# 'TGST'\n# >>> encode('This is a message')\n# 'tHKS KS C MGSSCGG'\nencode <- function(message) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- encode\n if(!identical(candidate('TEST'), 'tgst')){quit('no', 1)}\n if(!identical(candidate('Mudasir'), 'mWDCSKR')){quit('no', 1)}\n if(!identical(candidate('YES'), 'ygs')){quit('no', 1)}\n if(!identical(candidate('This is a message'), 'tHKS KS C MGSSCGG')){quit('no', 1)}\n if(!identical(candidate('I DoNt KnOw WhAt tO WrItE'), 'k dQnT kNqW wHcT Tq wRkTg')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "r", - "prompt": "# remove_vowels is a function that takes string and returns string without vowels.\n# >>> remove_vowels('')\n# ''\n# >>> remove_vowels('abcdef')\n# 'bcdf'\n# >>> remove_vowels('aaaaa')\n# ''\n# >>> remove_vowels('aaBAA')\n# 'B'\n# >>> remove_vowels('zbcd')\n# 'zbcd'\nremove_vowels <- function(text) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- remove_vowels\n if(!identical(candidate(''), '')){quit('no', 1)}\n if(!identical(candidate('abcdef\\nghijklm'), 'bcdf\\nghjklm')){quit('no', 1)}\n if(!identical(candidate('fedcba'), 'fdcb')){quit('no', 1)}\n if(!identical(candidate('eeeee'), '')){quit('no', 1)}\n if(!identical(candidate('acBAA'), 'cB')){quit('no', 1)}\n if(!identical(candidate('EcBOO'), 'cB')){quit('no', 1)}\n if(!identical(candidate('ybcd'), 'ybcd')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "r", - "prompt": "# Return only positive numbers in the list.\n# >>> get_positive([-1, 2, -4, 5, 6])\n# [2, 5, 6]\n# >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n# [5, 3, 2, 3, 9, 123, 1]\nget_positive <- function(l) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- get_positive\n if(!identical(candidate(c(-1, -2, 4, 5, 6)), list(4, 5, 6))){quit('no', 1)}\n if(!identical(candidate(c(5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10)), list(5, 3, 2, 3, 3, 9, 123, 1))){quit('no', 1)}\n if(!identical(candidate(c(-1, -2)), list())){quit('no', 1)}\n if(!identical(candidate(c()), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "r", - "prompt": "# Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n# >>> string_sequence(0)\n# '0'\n# >>> string_sequence(5)\n# '0 1 2 3 4 5'\nstring_sequence <- function(n) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- string_sequence\n if(!identical(candidate(0), '0')){quit('no', 1)}\n if(!identical(candidate(3), '0 1 2 3')){quit('no', 1)}\n if(!identical(candidate(10), '0 1 2 3 4 5 6 7 8 9 10')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "r", - "prompt": "# Given a positive integer n, you have to make a pile of n levels of stones.\n# The first level has n stones.\n# The number of stones in the next level is:\n# - the next odd number if n is odd.\n# - the next even number if n is even.\n# Return the number of stones in each level in a list, where element at index\n# i represents the number of stones in the level (i+1).\n# Examples:\n# >>> make_a_pile(3)\n# [3, 5, 7]\nmake_a_pile <- function(n) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- make_a_pile\n if(!identical(candidate(3), list(3, 5, 7))){quit('no', 1)}\n if(!identical(candidate(4), list(4, 6, 8, 10))){quit('no', 1)}\n if(!identical(candidate(5), list(5, 7, 9, 11, 13))){quit('no', 1)}\n if(!identical(candidate(6), list(6, 8, 10, 12, 14, 16))){quit('no', 1)}\n if(!identical(candidate(8), list(8, 10, 12, 14, 16, 18, 20, 22))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "r", - "prompt": "# Task\n# 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\n# then check if the result string is palindrome.\n# A string is called palindrome if it reads the same backward as forward.\n# You should return a tuple containing the result string and True/False for the check.\n# Example\n# For s = \"abcde\", c = \"ae\", the result should be ('bcd',False)\n# For s = \"abcdef\", c = \"b\" the result should be ('acdef',False)\n# For s = \"abcdedcba\", c = \"ab\", the result should be ('cdedc',True)\nreverse_delete <- function(s, c) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- reverse_delete\n if(!identical(candidate('abcde', 'ae'), list('bcd', FALSE))){quit('no', 1)}\n if(!identical(candidate('abcdef', 'b'), list('acdef', FALSE))){quit('no', 1)}\n if(!identical(candidate('abcdedcba', 'ab'), list('cdedc', TRUE))){quit('no', 1)}\n if(!identical(candidate('dwik', 'w'), list('dik', FALSE))){quit('no', 1)}\n if(!identical(candidate('a', 'a'), list('', TRUE))){quit('no', 1)}\n if(!identical(candidate('abcdedcba', ''), list('abcdedcba', TRUE))){quit('no', 1)}\n if(!identical(candidate('abcdedcba', 'v'), list('abcdedcba', TRUE))){quit('no', 1)}\n if(!identical(candidate('vabba', 'v'), list('abba', TRUE))){quit('no', 1)}\n if(!identical(candidate('mamma', 'mia'), list('', TRUE))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "r", - "prompt": "# For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n# >>> flip_case('Hello')\n# 'hELLO'\nflip_case <- function(string) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- flip_case\n if(!identical(candidate(''), '')){quit('no', 1)}\n if(!identical(candidate('Hello!'), 'hELLO!')){quit('no', 1)}\n if(!identical(candidate('These violent delights have violent ends'), 'tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "r", - "prompt": "# You are given a string s.\n# if s[i] is a letter, reverse its case from lower to upper or vise versa, \n# otherwise keep it as it is.\n# If the string contains no letters, reverse the string.\n# The function should return the resulted string.\n# Examples\n# solve(\"1234\") = \"4321\"\n# solve(\"ab\") = \"AB\"\n# solve(\"#a@C\") = \"#A@c\"\nsolve <- function(s) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- solve\n if(!identical(candidate('AsDf'), 'aSdF')){quit('no', 1)}\n if(!identical(candidate('1234'), '4321')){quit('no', 1)}\n if(!identical(candidate('ab'), 'AB')){quit('no', 1)}\n if(!identical(candidate('#a@C'), '#A@c')){quit('no', 1)}\n if(!identical(candidate('#AsdfW^45'), '#aSDFw^45')){quit('no', 1)}\n if(!identical(candidate('#6@2'), '2@6#')){quit('no', 1)}\n if(!identical(candidate('#$a^D'), '#$A^d')){quit('no', 1)}\n if(!identical(candidate('#ccc'), '#CCC')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "r", - "prompt": "# Filter an input list of strings only for ones that start with a given prefix.\n# >>> filter_by_prefix([], 'a')\n# []\n# >>> filter_by_prefix(['abc', 'bcd', 'cde', 'array'], 'a')\n# ['abc', 'array']\nfilter_by_prefix <- function(strings, prefix) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- filter_by_prefix\n if(!identical(candidate(c(), 'john'), list())){quit('no', 1)}\n if(!identical(candidate(c('xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'), 'xxx'), list('xxx', 'xxxAAA', 'xxx'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "r", - "prompt": "# This function takes two positive numbers x and y and returns the\n# biggest even integer number that is in the range [x, y] inclusive. If \n# there's no such number, then the function should return -1.\n# For example:\n# choose_num(12, 15) = 14\n# choose_num(13, 12) = -1\nchoose_num <- function(x, y) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- choose_num\n if(!identical(candidate(12, 15), 14)){quit('no', 1)}\n if(!identical(candidate(13, 12), -1)){quit('no', 1)}\n if(!identical(candidate(33, 12354), 12354)){quit('no', 1)}\n if(!identical(candidate(5234, 5233), -1)){quit('no', 1)}\n if(!identical(candidate(6, 29), 28)){quit('no', 1)}\n if(!identical(candidate(27, 10), -1)){quit('no', 1)}\n if(!identical(candidate(7, 7), -1)){quit('no', 1)}\n if(!identical(candidate(546, 546), 546)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "r", - "prompt": "# You are given a string representing a sentence,\n# the sentence contains some words separated by a space,\n# and you have to return a string that contains the words from the original sentence,\n# whose lengths are prime numbers,\n# the order of the words in the new string should be the same as the original one.\n# Example 1:\n# Input: sentence = \"This is a test\"\n# Output: \"is\"\n# Example 2:\n# Input: sentence = \"lets go for swimming\"\n# Output: \"go for\"\n# Constraints:\n# * 1 <= len(sentence) <= 100\n# * sentence contains only letters\nwords_in_sentence <- function(sentence) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- words_in_sentence\n if(!identical(candidate('This is a test'), 'is')){quit('no', 1)}\n if(!identical(candidate('lets go for swimming'), 'go for')){quit('no', 1)}\n if(!identical(candidate('there is no place available here'), 'there is no place')){quit('no', 1)}\n if(!identical(candidate('Hi I am Hussein'), 'Hi am Hussein')){quit('no', 1)}\n if(!identical(candidate('go for it'), 'go for it')){quit('no', 1)}\n if(!identical(candidate('here'), '')){quit('no', 1)}\n if(!identical(candidate('here is'), 'is')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "r", - "prompt": "# Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n# >>> intersperse([], 4)\n# []\n# >>> intersperse([1, 2, 3], 4)\n# [1, 4, 2, 4, 3]\nintersperse <- function(numbers, delimeter) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- intersperse\n if(!identical(candidate(c(), 7), list())){quit('no', 1)}\n if(!identical(candidate(c(5, 6, 3, 2), 8), list(5, 8, 6, 8, 3, 8, 2))){quit('no', 1)}\n if(!identical(candidate(c(2, 2, 2), 2), list(2, 2, 2, 2, 2))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "r", - "prompt": "# Your task is to write a function that returns true if a number x is a simple\n# power of n and false in other cases.\n# x is a simple power of n if n**int=x\n# For example:\n# is_simple_power(1, 4) => true\n# is_simple_power(2, 2) => true\n# is_simple_power(8, 2) => true\n# is_simple_power(3, 2) => false\n# is_simple_power(3, 1) => false\n# is_simple_power(5, 3) => false\nis_simple_power <- function(x, n) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- is_simple_power\n if(!identical(candidate(16, 2), TRUE)){quit('no', 1)}\n if(!identical(candidate(143214, 16), FALSE)){quit('no', 1)}\n if(!identical(candidate(4, 2), TRUE)){quit('no', 1)}\n if(!identical(candidate(9, 3), TRUE)){quit('no', 1)}\n if(!identical(candidate(16, 4), TRUE)){quit('no', 1)}\n if(!identical(candidate(24, 2), FALSE)){quit('no', 1)}\n if(!identical(candidate(128, 4), FALSE)){quit('no', 1)}\n if(!identical(candidate(12, 6), FALSE)){quit('no', 1)}\n if(!identical(candidate(1, 1), TRUE)){quit('no', 1)}\n if(!identical(candidate(1, 12), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "r", - "prompt": "# Write a function that returns true if the given number is the multiplication of 3 prime numbers\n# and false otherwise.\n# Knowing that (a) is less then 100. \n# Example:\n# is_multiply_prime(30) == True\n# 30 = 2 * 3 * 5\nis_multiply_prime <- function(a) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- is_multiply_prime\n if(!identical(candidate(5), FALSE)){quit('no', 1)}\n if(!identical(candidate(30), TRUE)){quit('no', 1)}\n if(!identical(candidate(8), TRUE)){quit('no', 1)}\n if(!identical(candidate(10), FALSE)){quit('no', 1)}\n if(!identical(candidate(125), TRUE)){quit('no', 1)}\n if(!identical(candidate(105), TRUE)){quit('no', 1)}\n if(!identical(candidate(126), FALSE)){quit('no', 1)}\n if(!identical(candidate(729), FALSE)){quit('no', 1)}\n if(!identical(candidate(891), FALSE)){quit('no', 1)}\n if(!identical(candidate(1001), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "r", - "prompt": "# Given the lengths of the three sides of a triangle. Return True if the three\n# sides form a right-angled triangle, False otherwise.\n# A right-angled triangle is a triangle in which one angle is right angle or \n# 90 degree.\n# Example:\n# right_angle_triangle(3, 4, 5) == True\n# right_angle_triangle(1, 2, 3) == False\nright_angle_triangle <- function(a, b, c) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- right_angle_triangle\n if(!identical(candidate(3, 4, 5), TRUE)){quit('no', 1)}\n if(!identical(candidate(1, 2, 3), FALSE)){quit('no', 1)}\n if(!identical(candidate(10, 6, 8), TRUE)){quit('no', 1)}\n if(!identical(candidate(2, 2, 2), FALSE)){quit('no', 1)}\n if(!identical(candidate(7, 24, 25), TRUE)){quit('no', 1)}\n if(!identical(candidate(10, 5, 7), FALSE)){quit('no', 1)}\n if(!identical(candidate(5, 12, 13), TRUE)){quit('no', 1)}\n if(!identical(candidate(15, 8, 17), TRUE)){quit('no', 1)}\n if(!identical(candidate(48, 55, 73), TRUE)){quit('no', 1)}\n if(!identical(candidate(1, 1, 1), FALSE)){quit('no', 1)}\n if(!identical(candidate(2, 2, 10), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "r", - "prompt": "# Create a function that takes 3 numbers.\n# Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n# Returns false in any other cases.\n# Examples\n# any_int(5, 2, 7) \u279e True\n# any_int(3, 2, 2) \u279e False\n# any_int(3, -2, 1) \u279e True\n# any_int(3.6, -2.2, 2) \u279e False\nany_int <- function(x, y, z) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- any_int\n if(!identical(candidate(2, 3, 1), TRUE)){quit('no', 1)}\n if(!identical(candidate(2.5, 2, 3), FALSE)){quit('no', 1)}\n if(!identical(candidate(1.5, 5, 3.5), FALSE)){quit('no', 1)}\n if(!identical(candidate(2, 6, 2), FALSE)){quit('no', 1)}\n if(!identical(candidate(4, 2, 2), TRUE)){quit('no', 1)}\n if(!identical(candidate(2.2, 2.2, 2.2), FALSE)){quit('no', 1)}\n if(!identical(candidate(-4, 6, 2), TRUE)){quit('no', 1)}\n if(!identical(candidate(2, 1, 1), TRUE)){quit('no', 1)}\n if(!identical(candidate(3, 4, 7), TRUE)){quit('no', 1)}\n if(!identical(candidate(3.0, 4, 7), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "r", - "prompt": "# This function takes a list l and returns a list l' such that\n# l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n# to the values of the corresponding indicies of l, but sorted.\n# >>> sort_third([1, 2, 3])\n# [1, 2, 3]\n# >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n# [2, 6, 3, 4, 8, 9, 5]\nsort_third <- function(l) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- sort_third\n if(!identical(candidate(c(5, 6, 3, 4, 8, 9, 2)), list(2, 6, 3, 4, 8, 9, 5))){quit('no', 1)}\n if(!identical(candidate(c(5, 8, 3, 4, 6, 9, 2)), list(2, 8, 3, 4, 6, 9, 5))){quit('no', 1)}\n if(!identical(candidate(c(5, 6, 9, 4, 8, 3, 2)), list(2, 6, 9, 4, 8, 3, 5))){quit('no', 1)}\n if(!identical(candidate(c(5, 6, 3, 4, 8, 9, 2, 1)), list(2, 6, 3, 4, 8, 9, 5, 1))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_53_add", - "language": "r", - "prompt": "# Add two numbers x and y\n# >>> add(2, 3)\n# 5\n# >>> add(5, 7)\n# 12\nadd <- function(x, y) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- add\n if(!identical(candidate(0, 1), 1)){quit('no', 1)}\n if(!identical(candidate(1, 0), 1)){quit('no', 1)}\n if(!identical(candidate(2, 3), 5)){quit('no', 1)}\n if(!identical(candidate(5, 7), 12)){quit('no', 1)}\n if(!identical(candidate(7, 5), 12)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_69_search", - "language": "r", - "prompt": "# You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n# zero, and has a frequency greater than or equal to the value of the integer itself. \n# The frequency of an integer is the number of times it appears in the list.\n# If no such a value exist, return -1.\n# Examples:\n# search([4, 1, 2, 2, 3, 1]) == 2\n# search([1, 2, 2, 3, 3, 3, 4, 4, 4]) == 3\n# search([5, 5, 4, 4, 4]) == -1\nsearch <- function(lst) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- search\n if(!identical(candidate(c(5, 5, 5, 5, 1)), 1)){quit('no', 1)}\n if(!identical(candidate(c(4, 1, 4, 1, 4, 4)), 4)){quit('no', 1)}\n if(!identical(candidate(c(3, 3)), -1)){quit('no', 1)}\n if(!identical(candidate(c(8, 8, 8, 8, 8, 8, 8, 8)), 8)){quit('no', 1)}\n if(!identical(candidate(c(2, 3, 3, 2, 2)), 2)){quit('no', 1)}\n if(!identical(candidate(c(2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1)), 1)){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 8, 2)), 2)){quit('no', 1)}\n if(!identical(candidate(c(6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10)), 1)){quit('no', 1)}\n if(!identical(candidate(c(8, 8, 3, 6, 5, 6, 4)), -1)){quit('no', 1)}\n if(!identical(candidate(c(6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9)), 1)){quit('no', 1)}\n if(!identical(candidate(c(1, 9, 10, 1, 3)), 1)){quit('no', 1)}\n if(!identical(candidate(c(6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10)), 5)){quit('no', 1)}\n if(!identical(candidate(c(1)), 1)){quit('no', 1)}\n if(!identical(candidate(c(8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5)), 4)){quit('no', 1)}\n if(!identical(candidate(c(2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10)), 2)){quit('no', 1)}\n if(!identical(candidate(c(1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3)), 1)){quit('no', 1)}\n if(!identical(candidate(c(9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4)), 4)){quit('no', 1)}\n if(!identical(candidate(c(2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7)), 4)){quit('no', 1)}\n if(!identical(candidate(c(9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1)), 2)){quit('no', 1)}\n if(!identical(candidate(c(5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8)), -1)){quit('no', 1)}\n if(!identical(candidate(c(10)), -1)){quit('no', 1)}\n if(!identical(candidate(c(9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2)), 2)){quit('no', 1)}\n if(!identical(candidate(c(5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8)), 1)){quit('no', 1)}\n if(!identical(candidate(c(7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6)), 1)){quit('no', 1)}\n if(!identical(candidate(c(3, 10, 10, 9, 2)), -1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "r", - "prompt": "# Write a function that takes a string and returns True if the string\n# length is a prime number or False otherwise\n# Examples\n# prime_length('Hello') == True\n# prime_length('abcdcba') == True\n# prime_length('kittens') == True\n# prime_length('orange') == False\nprime_length <- function(string) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- prime_length\n if(!identical(candidate('Hello'), TRUE)){quit('no', 1)}\n if(!identical(candidate('abcdcba'), TRUE)){quit('no', 1)}\n if(!identical(candidate('kittens'), TRUE)){quit('no', 1)}\n if(!identical(candidate('orange'), FALSE)){quit('no', 1)}\n if(!identical(candidate('wow'), TRUE)){quit('no', 1)}\n if(!identical(candidate('world'), TRUE)){quit('no', 1)}\n if(!identical(candidate('MadaM'), TRUE)){quit('no', 1)}\n if(!identical(candidate('Wow'), TRUE)){quit('no', 1)}\n if(!identical(candidate(''), FALSE)){quit('no', 1)}\n if(!identical(candidate('HI'), TRUE)){quit('no', 1)}\n if(!identical(candidate('go'), TRUE)){quit('no', 1)}\n if(!identical(candidate('gogo'), FALSE)){quit('no', 1)}\n if(!identical(candidate('aaaaaaaaaaaaaaa'), FALSE)){quit('no', 1)}\n if(!identical(candidate('Madam'), TRUE)){quit('no', 1)}\n if(!identical(candidate('M'), FALSE)){quit('no', 1)}\n if(!identical(candidate('0'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_58_common", - "language": "r", - "prompt": "# Return sorted unique common elements for two lists.\n# >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n# [1, 5, 653]\n# >>> common([5, 3, 2, 8], [3, 2])\n# [2, 3]\ncommon <- function(l1, l2) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- common\n if(!identical(candidate(c(1, 4, 3, 34, 653, 2, 5), c(5, 7, 1, 5, 9, 653, 121)), list(1, 5, 653))){quit('no', 1)}\n if(!identical(candidate(c(5, 3, 2, 8), c(3, 2)), list(2, 3))){quit('no', 1)}\n if(!identical(candidate(c(4, 3, 2, 8), c(3, 2, 4)), list(2, 3, 4))){quit('no', 1)}\n if(!identical(candidate(c(4, 3, 2, 8), c()), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "r", - "prompt": "# The Brazilian factorial is defined as:\n# brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n# where n > 0\n# For example:\n# >>> special_factorial(4)\n# 288\n# The function will receive an integer as input and should return the special\n# factorial of this integer.\nspecial_factorial <- function(n) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- special_factorial\n if(!identical(candidate(4), 288)){quit('no', 1)}\n if(!identical(candidate(5), 34560)){quit('no', 1)}\n if(!identical(candidate(7), 125411328000)){quit('no', 1)}\n if(!identical(candidate(1), 1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "r", - "prompt": "# In this problem, you will implement a function that takes two lists of numbers,\n# and determines whether it is possible to perform an exchange of elements\n# between them to make lst1 a list of only even numbers.\n# There is no limit on the number of exchanged elements between lst1 and lst2.\n# If it is possible to exchange elements between the lst1 and lst2 to make\n# all the elements of lst1 to be even, return \"YES\".\n# Otherwise, return \"NO\".\n# For example:\n# exchange([1, 2, 3, 4], [1, 2, 3, 4]) => \"YES\"\n# exchange([1, 2, 3, 4], [1, 5, 3, 4]) => \"NO\"\n# It is assumed that the input lists will be non-empty.\nexchange <- function(lst1, lst2) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- exchange\n if(!identical(candidate(c(1, 2, 3, 4), c(1, 2, 3, 4)), 'YES')){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4), c(1, 5, 3, 4)), 'NO')){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4), c(2, 1, 4, 3)), 'YES')){quit('no', 1)}\n if(!identical(candidate(c(5, 7, 3), c(2, 6, 4)), 'YES')){quit('no', 1)}\n if(!identical(candidate(c(5, 7, 3), c(2, 6, 3)), 'NO')){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 6, 1, 8, 9), c(3, 5, 5, 1, 1, 1)), 'NO')){quit('no', 1)}\n if(!identical(candidate(c(100, 200), c(200, 200)), 'YES')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "r", - "prompt": "# Given a non-empty array of integers arr and an integer k, return\n# the sum of the elements with at most two digits from the first k elements of arr.\n# Example:\n# Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4\n# Output: 24 # sum of 21 + 3\n# Constraints:\n# 1. 1 <= len(arr) <= 100\n# 2. 1 <= k <= len(arr)\nadd_elements <- function(arr, k) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- add_elements\n if(!identical(candidate(c(1, -2, -3, 41, 57, 76, 87, 88, 99), 3), -4)){quit('no', 1)}\n if(!identical(candidate(c(111, 121, 3, 4000, 5, 6), 2), 0)){quit('no', 1)}\n if(!identical(candidate(c(11, 21, 3, 90, 5, 6, 7, 8, 9), 4), 125)){quit('no', 1)}\n if(!identical(candidate(c(111, 21, 3, 4000, 5, 6, 7, 8, 9), 4), 24)){quit('no', 1)}\n if(!identical(candidate(c(1), 1), 1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "r", - "prompt": "# A simple program which should return the value of x if n is \n# a prime number and should return the value of y otherwise.\n# Examples:\n# for x_or_y(7, 34, 12) == 34\n# for x_or_y(15, 8, 5) == 5\nx_or_y <- function(n, x, y) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- x_or_y\n if(!identical(candidate(7, 34, 12), 34)){quit('no', 1)}\n if(!identical(candidate(15, 8, 5), 5)){quit('no', 1)}\n if(!identical(candidate(3, 33, 5212), 33)){quit('no', 1)}\n if(!identical(candidate(1259, 3, 52), 3)){quit('no', 1)}\n if(!identical(candidate(7919, -1, 12), -1)){quit('no', 1)}\n if(!identical(candidate(3609, 1245, 583), 583)){quit('no', 1)}\n if(!identical(candidate(91, 56, 129), 129)){quit('no', 1)}\n if(!identical(candidate(6, 34, 1234), 1234)){quit('no', 1)}\n if(!identical(candidate(1, 2, 0), 0)){quit('no', 1)}\n if(!identical(candidate(2, 2, 0), 2)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "r", - "prompt": "# Given length of a side and high return area for a triangle.\n# >>> triangle_area(5, 3)\n# 7.5\ntriangle_area <- function(a, h) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- triangle_area\n if(!identical(candidate(5, 3), 7.5)){quit('no', 1)}\n if(!identical(candidate(2, 2), 2.0)){quit('no', 1)}\n if(!identical(candidate(10, 8), 40.0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "r", - "prompt": "# Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n# the last couple centuries. However, what people don't know is Tribonacci sequence.\n# Tribonacci sequence is defined by the recurrence:\n# tri(1) = 3\n# tri(n) = 1 + n / 2, if n is even.\n# tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n# For example:\n# tri(2) = 1 + (2 / 2) = 2\n# tri(4) = 3\n# tri(3) = tri(2) + tri(1) + tri(4)\n# = 2 + 3 + 3 = 8 \n# You are given a non-negative integer number n, you have to a return a list of the \n# first n + 1 numbers of the Tribonacci sequence.\n# Examples:\n# tri(3) = [1, 3, 2, 8]\ntri <- function(n) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- tri\n if(!identical(candidate(3), list(1, 3, 2, 8))){quit('no', 1)}\n if(!identical(candidate(4), list(1, 3, 2, 8, 3))){quit('no', 1)}\n if(!identical(candidate(5), list(1, 3, 2, 8, 3, 15))){quit('no', 1)}\n if(!identical(candidate(6), list(1, 3, 2, 8, 3, 15, 4))){quit('no', 1)}\n if(!identical(candidate(7), list(1, 3, 2, 8, 3, 15, 4, 24))){quit('no', 1)}\n if(!identical(candidate(8), list(1, 3, 2, 8, 3, 15, 4, 24, 5))){quit('no', 1)}\n if(!identical(candidate(9), list(1, 3, 2, 8, 3, 15, 4, 24, 5, 35))){quit('no', 1)}\n if(!identical(candidate(20), list(1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11))){quit('no', 1)}\n if(!identical(candidate(0), list(1))){quit('no', 1)}\n if(!identical(candidate(1), list(1, 3))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "r", - "prompt": "# You are given a list of two strings, both strings consist of open\n# parentheses '(' or close parentheses ')' only.\n# Your job is to check if it is possible to concatenate the two strings in\n# some order, that the resulting string will be good.\n# A string S is considered to be good if and only if all parentheses in S\n# are balanced. For example: the string '(())()' is good, while the string\n# '())' is not.\n# Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n# Examples:\n# match_parens(['()(', ')']) == 'Yes'\n# match_parens([')', ')']) == 'No'\nmatch_parens <- function(lst) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- match_parens\n if(!identical(candidate(c('()(', ')')), 'Yes')){quit('no', 1)}\n if(!identical(candidate(c(')', ')')), 'No')){quit('no', 1)}\n if(!identical(candidate(c('(()(())', '())())')), 'No')){quit('no', 1)}\n if(!identical(candidate(c(')())', '(()()(')), 'Yes')){quit('no', 1)}\n if(!identical(candidate(c('(())))', '(()())((')), 'Yes')){quit('no', 1)}\n if(!identical(candidate(c('()', '())')), 'No')){quit('no', 1)}\n if(!identical(candidate(c('(()(', '()))()')), 'Yes')){quit('no', 1)}\n if(!identical(candidate(c('((((', '((())')), 'No')){quit('no', 1)}\n if(!identical(candidate(c(')(()', '(()(')), 'No')){quit('no', 1)}\n if(!identical(candidate(c(')(', ')(')), 'No')){quit('no', 1)}\n if(!identical(candidate(c('(', ')')), 'Yes')){quit('no', 1)}\n if(!identical(candidate(c(')', '(')), 'Yes')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "r", - "prompt": "# From a list of integers, remove all elements that occur more than once.\n# Keep order of elements left the same as in the input.\n# >>> remove_duplicates([1, 2, 3, 2, 4])\n# [1, 3, 4]\nremove_duplicates <- function(numbers) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- remove_duplicates\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4)), list(1, 2, 3, 4))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 2, 4, 3, 5)), list(1, 4, 5))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "r", - "prompt": "# Return a greatest common divisor of two integers a and b\n# >>> greatest_common_divisor(3, 5)\n# 1\n# >>> greatest_common_divisor(25, 15)\n# 5\ngreatest_common_divisor <- function(a, b) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- greatest_common_divisor\n if(!identical(candidate(3, 7), 1)){quit('no', 1)}\n if(!identical(candidate(10, 15), 5)){quit('no', 1)}\n if(!identical(candidate(49, 14), 7)){quit('no', 1)}\n if(!identical(candidate(144, 60), 12)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "r", - "prompt": "# Checks if given string is a palindrome\n# >>> is_palindrome('')\n# True\n# >>> is_palindrome('aba')\n# True\n# >>> is_palindrome('aaaaa')\n# True\n# >>> is_palindrome('zbcd')\n# False\nis_palindrome <- function(text) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- is_palindrome\n if(!identical(candidate(''), TRUE)){quit('no', 1)}\n if(!identical(candidate('aba'), TRUE)){quit('no', 1)}\n if(!identical(candidate('aaaaa'), TRUE)){quit('no', 1)}\n if(!identical(candidate('zbcd'), FALSE)){quit('no', 1)}\n if(!identical(candidate('xywyx'), TRUE)){quit('no', 1)}\n if(!identical(candidate('xywyz'), FALSE)){quit('no', 1)}\n if(!identical(candidate('xywzx'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "r", - "prompt": "# xs represent coefficients of a polynomial.\n# xs[0] + xs[1] * x + xs[2] * x^2 + ....\n# Return derivative of this polynomial in the same form.\n# >>> derivative([3, 1, 2, 4, 5])\n# [1, 4, 12, 20]\n# >>> derivative([1, 2, 3])\n# [2, 6]\nderivative <- function(xs) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- derivative\n if(!identical(candidate(c(3, 1, 2, 4, 5)), list(1, 4, 12, 20))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3)), list(2, 6))){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 1)), list(2, 2))){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 1, 0, 4)), list(2, 2, 0, 16))){quit('no', 1)}\n if(!identical(candidate(c(1)), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "r", - "prompt": "# In this task, you will be given a string that represents a number of apples and oranges \n# that are distributed in a basket of fruit this basket contains \n# apples, oranges, and mango fruits. Given the string that represents the total number of \n# the oranges and apples and an integer that represent the total number of the fruits \n# in the basket return the number of the mango fruits in the basket.\n# for examble:\n# fruit_distribution(\"5 apples and 6 oranges\", 19) ->19 - 5 - 6 = 8\n# fruit_distribution(\"0 apples and 1 oranges\",3) -> 3 - 0 - 1 = 2\n# fruit_distribution(\"2 apples and 3 oranges\", 100) -> 100 - 2 - 3 = 95\n# fruit_distribution(\"100 apples and 1 oranges\",120) -> 120 - 100 - 1 = 19\nfruit_distribution <- function(s, n) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- fruit_distribution\n if(!identical(candidate('5 apples and 6 oranges', 19), 8)){quit('no', 1)}\n if(!identical(candidate('5 apples and 6 oranges', 21), 10)){quit('no', 1)}\n if(!identical(candidate('0 apples and 1 oranges', 3), 2)){quit('no', 1)}\n if(!identical(candidate('1 apples and 0 oranges', 3), 2)){quit('no', 1)}\n if(!identical(candidate('2 apples and 3 oranges', 100), 95)){quit('no', 1)}\n if(!identical(candidate('2 apples and 3 oranges', 5), 0)){quit('no', 1)}\n if(!identical(candidate('1 apples and 100 oranges', 120), 19)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "r", - "prompt": "# Write a function that takes an integer a and returns True \n# if this ingeger is a cube of some integer number.\n# Note: you may assume the input is always valid.\n# Examples:\n# iscube(1) ==> True\n# iscube(2) ==> False\n# iscube(-1) ==> True\n# iscube(64) ==> True\n# iscube(0) ==> True\n# iscube(180) ==> False\niscube <- function(a) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- iscube\n if(!identical(candidate(1), TRUE)){quit('no', 1)}\n if(!identical(candidate(2), FALSE)){quit('no', 1)}\n if(!identical(candidate(-1), TRUE)){quit('no', 1)}\n if(!identical(candidate(64), TRUE)){quit('no', 1)}\n if(!identical(candidate(180), FALSE)){quit('no', 1)}\n if(!identical(candidate(1000), TRUE)){quit('no', 1)}\n if(!identical(candidate(0), TRUE)){quit('no', 1)}\n if(!identical(candidate(1729), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "r", - "prompt": "# In this Kata, you have to sort an array of non-negative integers according to\n# number of ones in their binary representation in ascending order.\n# For similar number of ones, sort based on decimal value.\n# It must be implemented like this:\n# >>> sort_array([1, 5, 2, 3, 4]) == [1, 2, 3, 4, 5]\n# >>> sort_array([-2, -3, -4, -5, -6]) == [-6, -5, -4, -3, -2]\n# >>> sort_array([1, 0, 2, 3, 4]) [0, 1, 2, 3, 4]\nsort_array <- function(arr) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- sort_array\n if(!identical(candidate(c(1, 5, 2, 3, 4)), list(1, 2, 4, 3, 5))){quit('no', 1)}\n if(!identical(candidate(c(-2, -3, -4, -5, -6)), list(-4, -2, -6, -5, -3))){quit('no', 1)}\n if(!identical(candidate(c(1, 0, 2, 3, 4)), list(0, 1, 2, 4, 3))){quit('no', 1)}\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4)), list(2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77))){quit('no', 1)}\n if(!identical(candidate(c(3, 6, 44, 12, 32, 5)), list(32, 3, 5, 6, 12, 44))){quit('no', 1)}\n if(!identical(candidate(c(2, 4, 8, 16, 32)), list(2, 4, 8, 16, 32))){quit('no', 1)}\n if(!identical(candidate(c(2, 4, 8, 16, 32)), list(2, 4, 8, 16, 32))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "r", - "prompt": "# Given a list of strings, where each string consists of only digits, return a list.\n# Each element i of the output should be \"the number of odd elements in the\n# string i of the input.\" where all the i's should be replaced by the number\n# of odd digits in the i'th string of the input.\n# >>> odd_count(['1234567'])\n# [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n# >>> odd_count(['3',\"11111111\"])\n# [\"the number of odd elements 1n the str1ng 1 of the 1nput.\",\n# \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\nodd_count <- function(lst) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- odd_count\n if(!identical(candidate(c('1234567')), list('the number of odd elements 4n the str4ng 4 of the 4nput.'))){quit('no', 1)}\n if(!identical(candidate(c('3', '11111111')), list('the number of odd elements 1n the str1ng 1 of the 1nput.', 'the number of odd elements 8n the str8ng 8 of the 8nput.'))){quit('no', 1)}\n if(!identical(candidate(c('271', '137', '314')), list('the number of odd elements 2n the str2ng 2 of the 2nput.', 'the number of odd elements 3n the str3ng 3 of the 3nput.', 'the number of odd elements 2n the str2ng 2 of the 2nput.'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "r", - "prompt": "# brackets is a string of \"(\" and \")\".\n# return True if every opening bracket has a corresponding closing bracket.\n# >>> correct_bracketing(\"(\")\n# False\n# >>> correct_bracketing(\"()\")\n# True\n# >>> correct_bracketing(\"(()())\")\n# True\n# >>> correct_bracketing(\")(()\")\n# False\ncorrect_bracketing <- function(brackets) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- correct_bracketing\n if(!identical(candidate('()'), TRUE)){quit('no', 1)}\n if(!identical(candidate('(()())'), TRUE)){quit('no', 1)}\n if(!identical(candidate('()()(()())()'), TRUE)){quit('no', 1)}\n if(!identical(candidate('()()((()()())())(()()(()))'), TRUE)){quit('no', 1)}\n if(!identical(candidate('((()())))'), FALSE)){quit('no', 1)}\n if(!identical(candidate(')(()'), FALSE)){quit('no', 1)}\n if(!identical(candidate('('), FALSE)){quit('no', 1)}\n if(!identical(candidate('(((('), FALSE)){quit('no', 1)}\n if(!identical(candidate(')'), FALSE)){quit('no', 1)}\n if(!identical(candidate('(()'), FALSE)){quit('no', 1)}\n if(!identical(candidate('()()(()())())(()'), FALSE)){quit('no', 1)}\n if(!identical(candidate('()()(()())()))()'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "r", - "prompt": "# Task\n# Write a function that takes a string as input and returns the sum of the upper characters only'\n# ASCII codes.\n# Examples:\n# digitSum(\"\") => 0\n# digitSum(\"abAB\") => 131\n# digitSum(\"abcCd\") => 67\n# digitSum(\"helloE\") => 69\n# digitSum(\"woArBld\") => 131\n# digitSum(\"aAaaaXa\") => 153\ndigitSum <- function(s) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- digitSum\n if(!identical(candidate(''), 0)){quit('no', 1)}\n if(!identical(candidate('abAB'), 131)){quit('no', 1)}\n if(!identical(candidate('abcCd'), 67)){quit('no', 1)}\n if(!identical(candidate('helloE'), 69)){quit('no', 1)}\n if(!identical(candidate('woArBld'), 131)){quit('no', 1)}\n if(!identical(candidate('aAaaaXa'), 153)){quit('no', 1)}\n if(!identical(candidate(' How are yOu?'), 151)){quit('no', 1)}\n if(!identical(candidate('You arE Very Smart'), 327)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "r", - "prompt": "# Write a function that accepts a list of strings as a parameter,\n# deletes the strings that have odd lengths from it,\n# and returns the resulted list with a sorted order,\n# The list is always a list of strings and never an array of numbers,\n# and it may contain duplicates.\n# The order of the list should be ascending by length of each word, and you\n# should return the list sorted by that rule.\n# If two words have the same length, sort the list alphabetically.\n# The function should return a list of strings in sorted order.\n# You may assume that all words will have the same length.\n# For example:\n# assert list_sort([\"aa\", \"a\", \"aaa\"]) => [\"aa\"]\n# assert list_sort([\"ab\", \"a\", \"aaa\", \"cd\"]) => [\"ab\", \"cd\"]\nsorted_list_sum <- function(lst) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- sorted_list_sum\n if(!identical(candidate(c('aa', 'a', 'aaa')), list('aa'))){quit('no', 1)}\n if(!identical(candidate(c('school', 'AI', 'asdf', 'b')), list('AI', 'asdf', 'school'))){quit('no', 1)}\n if(!identical(candidate(c('d', 'b', 'c', 'a')), list())){quit('no', 1)}\n if(!identical(candidate(c('d', 'dcba', 'abcd', 'a')), list('abcd', 'dcba'))){quit('no', 1)}\n if(!identical(candidate(c('AI', 'ai', 'au')), list('AI', 'ai', 'au'))){quit('no', 1)}\n if(!identical(candidate(c('a', 'b', 'b', 'c', 'c', 'a')), list())){quit('no', 1)}\n if(!identical(candidate(c('aaaa', 'bbbb', 'dd', 'cc')), list('cc', 'dd', 'aaaa', 'bbbb'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "r", - "prompt": "# You are given an array arr of integers and you need to return\n# sum of magnitudes of integers multiplied by product of all signs\n# of each number in the array, represented by 1, -1 or 0.\n# Note: return None for empty arr.\n# Example:\n# >>> prod_signs([1, 2, 2, -4]) == -9\n# >>> prod_signs([0, 1]) == 0\n# >>> prod_signs([]) == None\nprod_signs <- function(arr) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- prod_signs\n if(!identical(candidate(c(1, 2, 2, -4)), -9)){quit('no', 1)}\n if(!identical(candidate(c(0, 1)), 0)){quit('no', 1)}\n if(!identical(candidate(c(1, 1, 1, 2, 3, -1, 1)), -10)){quit('no', 1)}\n if(!identical(candidate(c()), NULL)){quit('no', 1)}\n if(!identical(candidate(c(2, 4, 1, 2, -1, -1, 9)), 20)){quit('no', 1)}\n if(!identical(candidate(c(-1, 1, -1, 1)), 4)){quit('no', 1)}\n if(!identical(candidate(c(-1, 1, 1, 1)), -4)){quit('no', 1)}\n if(!identical(candidate(c(-1, 1, 1, 0)), 0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "r", - "prompt": "# Return list with elements incremented by 1.\n# >>> incr_list([1, 2, 3])\n# [2, 3, 4]\n# >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123])\n# [6, 4, 6, 3, 4, 4, 10, 1, 124]\nincr_list <- function(l) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- incr_list\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 1)), list(4, 3, 2))){quit('no', 1)}\n if(!identical(candidate(c(5, 2, 5, 2, 3, 3, 9, 0, 123)), list(6, 3, 6, 3, 4, 4, 10, 1, 124))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "r", - "prompt": "# From a given list of integers, generate a list of rolling maximum element found until given moment\n# in the sequence.\n# >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n# [1, 2, 3, 3, 3, 4, 4]\nrolling_max <- function(numbers) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- rolling_max\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4)), list(1, 2, 3, 4))){quit('no', 1)}\n if(!identical(candidate(c(4, 3, 2, 1)), list(4, 4, 4, 4))){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 3, 100, 3)), list(3, 3, 3, 100, 100))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "r", - "prompt": "# Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n# separate those group into separate strings and return the list of those.\n# Separate groups are balanced (each open brace is properly closed) and not nested within each other\n# Ignore any spaces in the input string.\n# >>> separate_paren_groups('( ) (( )) (( )( ))')\n# ['()', '(())', '(()())']\nseparate_paren_groups <- function(paren_string) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- separate_paren_groups\n if(!identical(candidate('(()()) ((())) () ((())()())'), list('(()())', '((()))', '()', '((())()())'))){quit('no', 1)}\n if(!identical(candidate('() (()) ((())) (((())))'), list('()', '(())', '((()))', '(((())))'))){quit('no', 1)}\n if(!identical(candidate('(()(())((())))'), list('(()(())((())))'))){quit('no', 1)}\n if(!identical(candidate('( ) (( )) (( )( ))'), list('()', '(())', '(()())'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "r", - "prompt": "# You will be given a string of words separated by commas or spaces. Your task is\n# to split the string into words and return an array of the words.\n# For example:\n# words_string(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n# words_string(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\nwords_string <- function(s) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- words_string\n if(!identical(candidate('Hi, my name is John'), list('Hi', 'my', 'name', 'is', 'John'))){quit('no', 1)}\n if(!identical(candidate('One, two, three, four, five, six'), list('One', 'two', 'three', 'four', 'five', 'six'))){quit('no', 1)}\n if(!identical(candidate('Hi, my name'), list('Hi', 'my', 'name'))){quit('no', 1)}\n if(!identical(candidate('One,, two, three, four, five, six,'), list('One', 'two', 'three', 'four', 'five', 'six'))){quit('no', 1)}\n if(!identical(candidate(''), list())){quit('no', 1)}\n if(!identical(candidate('ahmed , gamal'), list('ahmed', 'gamal'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "r", - "prompt": "# Create a function that takes integers, floats, or strings representing\n# real numbers, and returns the larger variable in its given variable type.\n# Return None if the values are equal.\n# Note: If a real number is represented as a string, the floating point might be . or ,\n# compare_one(1, 2.5) \u279e 2.5\n# compare_one(1, \"2,3\") \u279e \"2,3\"\n# compare_one(\"5,1\", \"6\") \u279e \"6\"\n# compare_one(\"1\", 1) \u279e None\ncompare_one <- function(a, b) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_137_compare_one.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- compare_one\n if(!identical(candidate(1, 2), 2)){quit('no', 1)}\n if(!identical(candidate(1, 2.5), 2.5)){quit('no', 1)}\n if(!identical(candidate(2, 3), 3)){quit('no', 1)}\n if(!identical(candidate(5, 6), 6)){quit('no', 1)}\n if(!identical(candidate(1, '2,3'), '2,3')){quit('no', 1)}\n if(!identical(candidate('5,1', '6'), '6')){quit('no', 1)}\n if(!identical(candidate('1', '2'), '2')){quit('no', 1)}\n if(!identical(candidate('1', 1), NULL)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "r", - "prompt": "# Filter given list of any python values only for integers\n# >>> filter_integers(['a', 3.14, 5])\n# [5]\n# >>> filter_integers([1, 2, 3, 'abc', {}, []])\n# [1, 2, 3]\nfilter_integers <- function(values) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- filter_integers\n if(!identical(candidate(list()), list())){quit('no', 1)}\n if(!identical(candidate(list(4, list(), list(), 23.2, 9, 'adasd')), list(4, 9))){quit('no', 1)}\n if(!identical(candidate(list(3, 'c', 3, 3, 'a', 'b')), list(3, 3, 3))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "r", - "prompt": "# This function takes a list l and returns a list l' such that\n# l' is identical to l in the odd indicies, while its values at the even indicies are equal\n# to the values of the even indicies of l, but sorted.\n# >>> sort_even([1, 2, 3])\n# [1, 2, 3]\n# >>> sort_even([5, 6, 3, 4])\n# [3, 6, 5, 4]\nsort_even <- function(l) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- sort_even\n if(!identical(candidate(c(1, 2, 3)), list(1, 2, 3))){quit('no', 1)}\n if(!identical(candidate(c(5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10)), list(-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123))){quit('no', 1)}\n if(!identical(candidate(c(5, 8, -12, 4, 23, 2, 3, 11, 12, -10)), list(-12, 8, 3, 4, 5, 2, 12, 11, 23, -10))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "r", - "prompt": "# I think we all remember that feeling when the result of some long-awaited\n# event is finally known. The feelings and thoughts you have at that moment are\n# definitely worth noting down and comparing.\n# Your task is to determine if a person correctly guessed the results of a number of matches.\n# You are given two arrays of scores and guesses of equal length, where each index shows a match. \n# Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n# the value is 0, and if not, the value is the absolute difference between the guess and the score.\n# example:\n# compare([1,2,3,4,5,1],[1,2,3,4,2,-2]) -> [0,0,0,0,3,3]\n# compare([0,5,0,0,0,4],[4,1,1,0,0,-2]) -> [4,4,1,0,0,6]\ncompare <- function(game, guess) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- compare\n if(!identical(candidate(c(1, 2, 3, 4, 5, 1), c(1, 2, 3, 4, 2, -2)), list(0, 0, 0, 0, 3, 3))){quit('no', 1)}\n if(!identical(candidate(c(0, 0, 0, 0, 0, 0), c(0, 0, 0, 0, 0, 0)), list(0, 0, 0, 0, 0, 0))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3), c(-1, -2, -3)), list(2, 4, 6))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 5), c(-1, 2, 3, 4)), list(2, 0, 0, 1))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "r", - "prompt": "# Given a positive integer n, return a tuple that has the number of even and odd\n# integer palindromes that fall within the range(1, n), inclusive.\n# Example 1:\n# Input: 3\n# Output: (1, 2)\n# Explanation:\n# Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n# Example 2:\n# Input: 12\n# Output: (4, 6)\n# Explanation:\n# Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n# Note:\n# 1. 1 <= n <= 10^3\n# 2. returned tuple has the number of even and odd integer palindromes respectively.\neven_odd_palindrome <- function(n) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- even_odd_palindrome\n if(!identical(candidate(123), list(8, 13))){quit('no', 1)}\n if(!identical(candidate(12), list(4, 6))){quit('no', 1)}\n if(!identical(candidate(3), list(1, 2))){quit('no', 1)}\n if(!identical(candidate(63), list(6, 8))){quit('no', 1)}\n if(!identical(candidate(25), list(5, 6))){quit('no', 1)}\n if(!identical(candidate(19), list(4, 6))){quit('no', 1)}\n if(!identical(candidate(9), list(4, 5))){quit('no', 1)}\n if(!identical(candidate(1), list(0, 1))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "r", - "prompt": "# The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fib4(0) -> 0\n# fib4(1) -> 0\n# fib4(2) -> 2\n# fib4(3) -> 0\n# fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n# Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n# >>> fib4(5)\n# 4\n# >>> fib4(6)\n# 8\n# >>> fib4(7)\n# 14\nfib4 <- function(n) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- fib4\n if(!identical(candidate(5), 4)){quit('no', 1)}\n if(!identical(candidate(8), 28)){quit('no', 1)}\n if(!identical(candidate(10), 104)){quit('no', 1)}\n if(!identical(candidate(12), 386)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "r", - "prompt": "# Given two positive integers a and b, return the even digits between a\n# and b, in ascending order.\n# For example:\n# generate_integers(2, 8) => [2, 4, 6, 8]\n# generate_integers(8, 2) => [2, 4, 6, 8]\n# generate_integers(10, 14) => []\ngenerate_integers <- function(a, b) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- generate_integers\n if(!identical(candidate(2, 10), list(2, 4, 6, 8))){quit('no', 1)}\n if(!identical(candidate(10, 2), list(2, 4, 6, 8))){quit('no', 1)}\n if(!identical(candidate(132, 2), list(2, 4, 6, 8))){quit('no', 1)}\n if(!identical(candidate(17, 89), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "r", - "prompt": "# For a given list of input numbers, calculate Mean Absolute Deviation\n# around the mean of this dataset.\n# Mean Absolute Deviation is the average absolute difference between each\n# element and a centerpoint (mean in this case):\n# MAD = average | x - x_mean |\n# >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n# 1.0\nmean_absolute_deviation <- function(numbers) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- mean_absolute_deviation\n if(!identical(candidate(c(1.0, 2.0)), 0.5)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.0, 4.0)), 1.0)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.0, 4.0, 5.0)), 1.2)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "r", - "prompt": "# Create a function encrypt that takes a string as an argument and\n# returns a string encrypted with the alphabet being rotated. \n# The alphabet should be rotated in a manner such that the letters \n# shift down by two multiplied to two places.\n# For example:\n# encrypt('hi') returns 'lm'\n# encrypt('asdfghjkl') returns 'ewhjklnop'\n# encrypt('gf') returns 'kj'\n# encrypt('et') returns 'ix'\nencrypt <- function(s) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- encrypt\n if(!identical(candidate('hi'), 'lm')){quit('no', 1)}\n if(!identical(candidate('asdfghjkl'), 'ewhjklnop')){quit('no', 1)}\n if(!identical(candidate('gf'), 'kj')){quit('no', 1)}\n if(!identical(candidate('et'), 'ix')){quit('no', 1)}\n if(!identical(candidate('faewfawefaewg'), 'jeiajeaijeiak')){quit('no', 1)}\n if(!identical(candidate('hellomyfriend'), 'lippsqcjvmirh')){quit('no', 1)}\n if(!identical(candidate('dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh'), 'hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl')){quit('no', 1)}\n if(!identical(candidate('a'), 'e')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "r", - "prompt": "# Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n# The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n# as follows: start with any positive integer n. Then each term is obtained from the \n# previous term as follows: if the previous term is even, the next term is one half of \n# the previous term. If the previous term is odd, the next term is 3 times the previous\n# term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n# Note: \n# 1. Collatz(1) is [1].\n# 2. returned list sorted in increasing order.\n# For example:\n# get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\nget_odd_collatz <- function(n) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- get_odd_collatz\n if(!identical(candidate(14), list(1, 5, 7, 11, 13, 17))){quit('no', 1)}\n if(!identical(candidate(5), list(1, 5))){quit('no', 1)}\n if(!identical(candidate(12), list(1, 3, 5))){quit('no', 1)}\n if(!identical(candidate(1), list(1))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "r", - "prompt": "# Find how many times a given substring can be found in the original string. Count overlaping cases.\n# >>> how_many_times('', 'a')\n# 0\n# >>> how_many_times('aaa', 'a')\n# 3\n# >>> how_many_times('aaaa', 'aa')\n# 3\nhow_many_times <- function(string, substring) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- how_many_times\n if(!identical(candidate('', 'x'), 0)){quit('no', 1)}\n if(!identical(candidate('xyxyxyx', 'x'), 4)){quit('no', 1)}\n if(!identical(candidate('cacacacac', 'cac'), 4)){quit('no', 1)}\n if(!identical(candidate('john doe', 'john'), 1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "r", - "prompt": "# We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n# numbers in the array will be randomly ordered. Your task is to determine if\n# it is possible to get an array sorted in non-decreasing order by performing \n# the following operation on the given array:\n# You are allowed to perform right shift operation any number of times.\n# One right shift operation means shifting all elements of the array by one\n# position in the right direction. The last element of the array will be moved to\n# the starting position in the array i.e. 0th index. \n# If it is possible to obtain the sorted array by performing the above operation\n# then return True else return False.\n# If the given array is empty then return True.\n# Note: The given list is guaranteed to have unique elements.\n# For Example:\n# move_one_ball([3, 4, 5, 1, 2])==>True\n# Explanation: By performin 2 right shift operations, non-decreasing order can\n# be achieved for the given array.\n# move_one_ball([3, 5, 4, 1, 2])==>False\n# Explanation:It is not possible to get non-decreasing order for the given\n# array by performing any number of right shift operations.\nmove_one_ball <- function(arr) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- move_one_ball\n if(!identical(candidate(c(3, 4, 5, 1, 2)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(3, 5, 10, 1, 2)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(4, 3, 1, 2)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(3, 5, 4, 1, 2)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c()), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "r", - "prompt": "# Write a function which sorts the given list of integers\n# in ascending order according to the sum of their digits.\n# Note: if there are several items with similar sum of their digits,\n# order them based on their index in original list.\n# For example:\n# >>> order_by_points([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]\n# >>> order_by_points([]) == []\norder_by_points <- function(nums) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- order_by_points\n if(!identical(candidate(c(1, 11, -1, -11, -12)), list(-1, -11, 1, -12, 11))){quit('no', 1)}\n if(!identical(candidate(c(1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46)), list(0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457))){quit('no', 1)}\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(1, -11, -32, 43, 54, -98, 2, -3)), list(-3, -32, -98, -11, 1, 2, 43, 54))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)), list(1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9))){quit('no', 1)}\n if(!identical(candidate(c(0, 6, 6, -76, -21, 23, 4)), list(-76, -21, 0, 4, 23, 6, 6))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "r", - "prompt": "# Return list of prime factors of given integer in the order from smallest to largest.\n# Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n# Input number should be equal to the product of all factors\n# >>> factorize(8)\n# [2, 2, 2]\n# >>> factorize(25)\n# [5, 5]\n# >>> factorize(70)\n# [2, 5, 7]\nfactorize <- function(n) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- factorize\n if(!identical(candidate(2), list(2))){quit('no', 1)}\n if(!identical(candidate(4), list(2, 2))){quit('no', 1)}\n if(!identical(candidate(8), list(2, 2, 2))){quit('no', 1)}\n if(!identical(candidate(57), list(3, 19))){quit('no', 1)}\n if(!identical(candidate(3249), list(3, 3, 19, 19))){quit('no', 1)}\n if(!identical(candidate(185193), list(3, 3, 3, 19, 19, 19))){quit('no', 1)}\n if(!identical(candidate(20577), list(3, 19, 19, 19))){quit('no', 1)}\n if(!identical(candidate(18), list(2, 3, 3))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "r", - "prompt": "# Return True if all numbers in the list l are below threshold t.\n# >>> below_threshold([1, 2, 4, 10], 100)\n# True\n# >>> below_threshold([1, 20, 4, 10], 5)\n# False\nbelow_threshold <- function(l, t) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- below_threshold\n if(!identical(candidate(c(1, 2, 4, 10), 100), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 20, 4, 10), 5), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 20, 4, 10), 21), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 20, 4, 10), 22), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 8, 4, 10), 11), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 8, 4, 10), 10), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "r", - "prompt": "# You are given two positive integers n and m, and your task is to compute the\n# average of the integers from n through m (including n and m). \n# Round the answer to the nearest integer and convert that to binary.\n# If n is greater than m, return -1.\n# Example:\n# rounded_avg(1, 5) => \"0b11\"\n# rounded_avg(7, 5) => -1\n# rounded_avg(10, 20) => \"0b1111\"\n# rounded_avg(20, 33) => \"0b11010\"\nrounded_avg <- function(n, m) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- rounded_avg\n if(!identical(candidate(1, 5), '0b11')){quit('no', 1)}\n if(!identical(candidate(7, 13), '0b1010')){quit('no', 1)}\n if(!identical(candidate(964, 977), '0b1111001010')){quit('no', 1)}\n if(!identical(candidate(996, 997), '0b1111100100')){quit('no', 1)}\n if(!identical(candidate(560, 851), '0b1011000010')){quit('no', 1)}\n if(!identical(candidate(185, 546), '0b101101110')){quit('no', 1)}\n if(!identical(candidate(362, 496), '0b110101101')){quit('no', 1)}\n if(!identical(candidate(350, 902), '0b1001110010')){quit('no', 1)}\n if(!identical(candidate(197, 233), '0b11010111')){quit('no', 1)}\n if(!identical(candidate(7, 5), -1)){quit('no', 1)}\n if(!identical(candidate(5, 1), -1)){quit('no', 1)}\n if(!identical(candidate(5, 5), '0b101')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "r", - "prompt": "# Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n# For each of the group, output the deepest level of nesting of parentheses.\n# E.g. (()()) has maximum two levels of nesting while ((())) has three.\n# >>> parse_nested_parens('(()()) ((())) () ((())()())')\n# [2, 3, 1, 3]\nparse_nested_parens <- function(paren_string) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- parse_nested_parens\n if(!identical(candidate('(()()) ((())) () ((())()())'), list(2, 3, 1, 3))){quit('no', 1)}\n if(!identical(candidate('() (()) ((())) (((())))'), list(1, 2, 3, 4))){quit('no', 1)}\n if(!identical(candidate('(()(())((())))'), list(4))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "r", - "prompt": "# Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n# Examples\n# solution([5, 8, 7, 1]) ==> 12\n# solution([3, 3, 3, 3, 3]) ==> 9\n# solution([30, 13, 24, 321]) ==>0\nsolution <- function(lst) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- solution\n if(!identical(candidate(c(5, 8, 7, 1)), 12)){quit('no', 1)}\n if(!identical(candidate(c(3, 3, 3, 3, 3)), 9)){quit('no', 1)}\n if(!identical(candidate(c(30, 13, 24, 321)), 0)){quit('no', 1)}\n if(!identical(candidate(c(5, 9)), 5)){quit('no', 1)}\n if(!identical(candidate(c(2, 4, 8)), 0)){quit('no', 1)}\n if(!identical(candidate(c(30, 13, 23, 32)), 23)){quit('no', 1)}\n if(!identical(candidate(c(3, 13, 2, 9)), 3)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "r", - "prompt": "# You are given a positive integer n. You have to create an integer array a of length n.\n# For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n# Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n# and a[i] + a[j] + a[k] is a multiple of 3.\n# Example :\n# Input: n = 5\n# Output: 1\n# Explanation: \n# a = [1, 3, 7, 13, 21]\n# The only valid triple is (1, 7, 13).\nget_max_triples <- function(n) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- get_max_triples\n if(!identical(candidate(5), 1)){quit('no', 1)}\n if(!identical(candidate(6), 4)){quit('no', 1)}\n if(!identical(candidate(10), 36)){quit('no', 1)}\n if(!identical(candidate(100), 53361)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "r", - "prompt": "# There are eight planets in our solar system: the closerst to the Sun \n# is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n# Uranus, Neptune.\n# Write a function that takes two planet names as strings planet1 and planet2. \n# The function should return a tuple containing all planets whose orbits are \n# located between the orbit of planet1 and the orbit of planet2, sorted by \n# the proximity to the sun. \n# The function should return an empty tuple if planet1 or planet2\n# are not correct planet names. \n# Examples\n# bf(\"Jupiter\", \"Neptune\") ==> (\"Saturn\", \"Uranus\")\n# bf(\"Earth\", \"Mercury\") ==> (\"Venus\")\n# bf(\"Mercury\", \"Uranus\") ==> (\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\")\nbf <- function(planet1, planet2) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- bf\n if(!identical(candidate('Jupiter', 'Neptune'), list('Saturn', 'Uranus'))){quit('no', 1)}\n if(!identical(candidate('Earth', 'Mercury'), list('Venus'))){quit('no', 1)}\n if(!identical(candidate('Mercury', 'Uranus'), list('Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn'))){quit('no', 1)}\n if(!identical(candidate('Neptune', 'Venus'), list('Earth', 'Mars', 'Jupiter', 'Saturn', 'Uranus'))){quit('no', 1)}\n if(!identical(candidate('Earth', 'Earth'), list())){quit('no', 1)}\n if(!identical(candidate('Mars', 'Earth'), list())){quit('no', 1)}\n if(!identical(candidate('Jupiter', 'Makemake'), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "r", - "prompt": "# You are given a list of integers.\n# Write a function next_smallest() that returns the 2nd smallest element of the list.\n# Return None if there is no such element.\n# next_smallest([1, 2, 3, 4, 5]) == 2\n# next_smallest([5, 1, 4, 3, 2]) == 2\n# next_smallest([]) == None\n# next_smallest([1, 1]) == None\nnext_smallest <- function(lst) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- next_smallest\n if(!identical(candidate(c(1, 2, 3, 4, 5)), 2)){quit('no', 1)}\n if(!identical(candidate(c(5, 1, 4, 3, 2)), 2)){quit('no', 1)}\n if(!identical(candidate(c()), NULL)){quit('no', 1)}\n if(!identical(candidate(c(1, 1)), NULL)){quit('no', 1)}\n if(!identical(candidate(c(1, 1, 1, 1, 0)), 1)){quit('no', 1)}\n if(!identical(candidate(c(1, 1)), NULL)){quit('no', 1)}\n if(!identical(candidate(c(-35, 34, 12, -45)), -35)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "r", - "prompt": "# Input is a space-delimited string of numberals from 'zero' to 'nine'.\n# Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n# Return the string with numbers sorted from smallest to largest\n# >>> sort_numbers('three one five')\n# 'one three five'\nsort_numbers <- function(numbers) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- sort_numbers\n if(!identical(candidate(''), '')){quit('no', 1)}\n if(!identical(candidate('three'), 'three')){quit('no', 1)}\n if(!identical(candidate('three five nine'), 'three five nine')){quit('no', 1)}\n if(!identical(candidate('five zero four seven nine eight'), 'zero four five seven eight nine')){quit('no', 1)}\n if(!identical(candidate('six five four three two one zero'), 'zero one two three four five six')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "r", - "prompt": "# You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n# cycpattern_check(\"abcd\",\"abd\") => False\n# cycpattern_check(\"hello\",\"ell\") => True\n# cycpattern_check(\"whassup\",\"psus\") => False\n# cycpattern_check(\"abab\",\"baa\") => True\n# cycpattern_check(\"efef\",\"eeff\") => False\n# cycpattern_check(\"himenss\",\"simen\") => True\ncycpattern_check <- function(a, b) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- cycpattern_check\n if(!identical(candidate('xyzw', 'xyw'), FALSE)){quit('no', 1)}\n if(!identical(candidate('yello', 'ell'), TRUE)){quit('no', 1)}\n if(!identical(candidate('whattup', 'ptut'), FALSE)){quit('no', 1)}\n if(!identical(candidate('efef', 'fee'), TRUE)){quit('no', 1)}\n if(!identical(candidate('abab', 'aabb'), FALSE)){quit('no', 1)}\n if(!identical(candidate('winemtt', 'tinem'), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "r", - "prompt": "# You will be given a number in decimal form and your task is to convert it to\n# binary format. The function should return a string, with each character representing a binary\n# number. Each character in the string will be '0' or '1'.\n# There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n# The extra characters are there to help with the format.\n# Examples:\n# decimal_to_binary(15) # returns \"db1111db\"\n# decimal_to_binary(32) # returns \"db100000db\"\ndecimal_to_binary <- function(decimal) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- decimal_to_binary\n if(!identical(candidate(0), 'db0db')){quit('no', 1)}\n if(!identical(candidate(32), 'db100000db')){quit('no', 1)}\n if(!identical(candidate(103), 'db1100111db')){quit('no', 1)}\n if(!identical(candidate(15), 'db1111db')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "r", - "prompt": "# Filter an input list of strings only for ones that contain given substring\n# >>> filter_by_substring([], 'a')\n# []\n# >>> filter_by_substring(['abc', 'bacd', 'cde', 'array'], 'a')\n# ['abc', 'bacd', 'array']\nfilter_by_substring <- function(strings, substring) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- filter_by_substring\n if(!identical(candidate(c(), 'john'), list())){quit('no', 1)}\n if(!identical(candidate(c('xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'), 'xxx'), list('xxx', 'xxxAAA', 'xxx'))){quit('no', 1)}\n if(!identical(candidate(c('xxx', 'asd', 'aaaxxy', 'john doe', 'xxxAAA', 'xxx'), 'xx'), list('xxx', 'aaaxxy', 'xxxAAA', 'xxx'))){quit('no', 1)}\n if(!identical(candidate(c('grunt', 'trumpet', 'prune', 'gruesome'), 'run'), list('grunt', 'prune'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "r", - "prompt": "# Given an integer. return a tuple that has the number of even and odd digits respectively.\n# Example:\n# even_odd_count(-12) ==> (1, 1)\n# even_odd_count(123) ==> (1, 2)\neven_odd_count <- function(num) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- even_odd_count\n if(!identical(candidate(7), list(0, 1))){quit('no', 1)}\n if(!identical(candidate(-78), list(1, 1))){quit('no', 1)}\n if(!identical(candidate(3452), list(2, 2))){quit('no', 1)}\n if(!identical(candidate(346211), list(3, 3))){quit('no', 1)}\n if(!identical(candidate(-345821), list(3, 3))){quit('no', 1)}\n if(!identical(candidate(-2), list(1, 0))){quit('no', 1)}\n if(!identical(candidate(-45347), list(2, 3))){quit('no', 1)}\n if(!identical(candidate(0), list(1, 0))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "r", - "prompt": "# Write a function that accepts a list of strings.\n# The list contains different words. Return the word with maximum number\n# of unique characters. If multiple strings have maximum number of unique\n# characters, return the one which comes first in lexicographical order.\n# find_max([\"name\", \"of\", \"string\"]) == \"string\"\n# find_max([\"name\", \"enam\", \"game\"]) == \"enam\"\n# find_max([\"aaaaaaa\", \"bb\" ,\"cc\"]) == \"\"aaaaaaa\"\nfind_max <- function(words) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- find_max\n if(!identical(candidate(c('name', 'of', 'string')), 'string')){quit('no', 1)}\n if(!identical(candidate(c('name', 'enam', 'game')), 'enam')){quit('no', 1)}\n if(!identical(candidate(c('aaaaaaa', 'bb', 'cc')), 'aaaaaaa')){quit('no', 1)}\n if(!identical(candidate(c('abc', 'cba')), 'abc')){quit('no', 1)}\n if(!identical(candidate(c('play', 'this', 'game', 'of', 'footbott')), 'footbott')){quit('no', 1)}\n if(!identical(candidate(c('we', 'are', 'gonna', 'rock')), 'gonna')){quit('no', 1)}\n if(!identical(candidate(c('we', 'are', 'a', 'mad', 'nation')), 'nation')){quit('no', 1)}\n if(!identical(candidate(c('this', 'is', 'a', 'prrk')), 'this')){quit('no', 1)}\n if(!identical(candidate(c('b')), 'b')){quit('no', 1)}\n if(!identical(candidate(c('play', 'play', 'play')), 'play')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "r", - "prompt": "# Given a positive integer n, return the count of the numbers of n-digit\n# positive integers that start or end with 1.\nstarts_one_ends <- function(n) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- starts_one_ends\n if(!identical(candidate(1), 1)){quit('no', 1)}\n if(!identical(candidate(2), 18)){quit('no', 1)}\n if(!identical(candidate(3), 180)){quit('no', 1)}\n if(!identical(candidate(4), 1800)){quit('no', 1)}\n if(!identical(candidate(5), 18000)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "r", - "prompt": "# Create a function that returns a tuple (a, b), where 'a' is\n# the largest of negative integers, and 'b' is the smallest\n# of positive integers in a list.\n# If there is no negative or positive integers, return them as None.\n# Examples:\n# largest_smallest_integers([2, 4, 1, 3, 5, 7]) == (None, 1)\n# largest_smallest_integers([]) == (None, None)\n# largest_smallest_integers([0]) == (None, None)\nlargest_smallest_integers <- function(lst) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- largest_smallest_integers\n if(!identical(candidate(c(2, 4, 1, 3, 5, 7)), list(NULL, 1))){quit('no', 1)}\n if(!identical(candidate(c(2, 4, 1, 3, 5, 7, 0)), list(NULL, 1))){quit('no', 1)}\n if(!identical(candidate(c(1, 3, 2, 4, 5, 6, -2)), list(-2, 1))){quit('no', 1)}\n if(!identical(candidate(c(4, 5, 3, 6, 2, 7, -7)), list(-7, 2))){quit('no', 1)}\n if(!identical(candidate(c(7, 3, 8, 4, 9, 2, 5, -9)), list(-9, 2))){quit('no', 1)}\n if(!identical(candidate(c()), list(NULL, NULL))){quit('no', 1)}\n if(!identical(candidate(c(0)), list(NULL, NULL))){quit('no', 1)}\n if(!identical(candidate(c(-1, -3, -5, -6)), list(-1, NULL))){quit('no', 1)}\n if(!identical(candidate(c(-1, -3, -5, -6, 0)), list(-1, NULL))){quit('no', 1)}\n if(!identical(candidate(c(-6, -4, -4, -3, 1)), list(-3, 1))){quit('no', 1)}\n if(!identical(candidate(c(-6, -4, -4, -3, -100, 1)), list(-3, 1))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "r", - "prompt": "# \"Given an array representing a branch of a tree that has non-negative integer nodes\n# your task is to pluck one of the nodes and return it.\n# The plucked node should be the node with the smallest even value.\n# If multiple nodes with the same smallest even value are found return the node that has smallest index.\n# The plucked node should be returned in a list, [ smalest_value, its index ],\n# If there are no even values or the given array is empty, return [].\n# Example 1:\n# Input: [4,2,3]\n# Output: [2, 1]\n# Explanation: 2 has the smallest even value, and 2 has the smallest index.\n# Example 2:\n# Input: [1,2,3]\n# Output: [2, 1]\n# Explanation: 2 has the smallest even value, and 2 has the smallest index. \n# Example 3:\n# Input: []\n# Output: []\n# Example 4:\n# Input: [5, 0, 3, 0, 4, 2]\n# Output: [0, 1]\n# Explanation: 0 is the smallest value, but there are two zeros,\n# so we will choose the first zero, which has the smallest index.\n# Constraints:\n# * 1 <= nodes.length <= 10000\n# * 0 <= node.value\npluck <- function(arr) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- pluck\n if(!identical(candidate(c(4, 2, 3)), list(2, 1))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3)), list(2, 1))){quit('no', 1)}\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(5, 0, 3, 0, 4, 2)), list(0, 1))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 0, 5, 3)), list(0, 3))){quit('no', 1)}\n if(!identical(candidate(c(5, 4, 8, 4, 8)), list(4, 1))){quit('no', 1)}\n if(!identical(candidate(c(7, 6, 7, 1)), list(6, 1))){quit('no', 1)}\n if(!identical(candidate(c(7, 9, 7, 1)), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "r", - "prompt": "# Write a function count_nums which takes an array of integers and returns\n# the number of elements which has a sum of digits > 0.\n# If a number is negative, then its first signed digit will be negative:\n# e.g. -123 has signed digits -1, 2, and 3.\n# >>> count_nums([]) == 0\n# >>> count_nums([-1, 11, -11]) == 1\n# >>> count_nums([1, 1, 2]) == 3\ncount_nums <- function(arr) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- count_nums\n if(!identical(candidate(c()), 0)){quit('no', 1)}\n if(!identical(candidate(c(-1, -2, 0)), 0)){quit('no', 1)}\n if(!identical(candidate(c(1, 1, 2, -2, 3, 4, 5)), 6)){quit('no', 1)}\n if(!identical(candidate(c(1, 6, 9, -6, 0, 1, 5)), 5)){quit('no', 1)}\n if(!identical(candidate(c(1, 100, 98, -7, 1, -1)), 4)){quit('no', 1)}\n if(!identical(candidate(c(12, 23, 34, -45, -56, 0)), 5)){quit('no', 1)}\n if(!identical(candidate(c(0, 1)), 1)){quit('no', 1)}\n if(!identical(candidate(c(1)), 1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "r", - "prompt": "# Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n# each cell of the grid contains a value. Every integer in the range [1, N * N]\n# inclusive appears exactly once on the cells of the grid.\n# You have to find the minimum path of length k in the grid. You can start\n# from any cell, and in each step you can move to any of the neighbor cells,\n# in other words, you can go to cells which share an edge with you current\n# cell.\n# Please note that a path of length k means visiting exactly k cells (not\n# necessarily distinct).\n# You CANNOT go off the grid.\n# A path A (of length k) is considered less than a path B (of length k) if\n# after making the ordered lists of the values on the cells that A and B go\n# through (let's call them lst_A and lst_B), lst_A is lexicographically less\n# than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n# such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n# lst_A[j] = lst_B[j].\n# It is guaranteed that the answer is unique.\n# Return an ordered list of the values on the cells that the minimum path go through.\n# Examples:\n# Input: grid = [ [1,2,3], [4,5,6], [7,8,9]], k = 3\n# Output: [1, 2, 1]\n# Input: grid = [ [5,9,3], [4,1,6], [7,8,2]], k = 1\n# Output: [1]\nminPath <- function(grid, k) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- minPath\n if(!identical(candidate(list(list(1, 2, 3), list(4, 5, 6), list(7, 8, 9)), 3), list(1, 2, 1))){quit('no', 1)}\n if(!identical(candidate(list(list(5, 9, 3), list(4, 1, 6), list(7, 8, 2)), 1), list(1))){quit('no', 1)}\n if(!identical(candidate(list(list(1, 2, 3, 4), list(5, 6, 7, 8), list(9, 10, 11, 12), list(13, 14, 15, 16)), 4), list(1, 2, 1, 2))){quit('no', 1)}\n if(!identical(candidate(list(list(6, 4, 13, 10), list(5, 7, 12, 1), list(3, 16, 11, 15), list(8, 14, 9, 2)), 7), list(1, 10, 1, 10, 1, 10, 1))){quit('no', 1)}\n if(!identical(candidate(list(list(8, 14, 9, 2), list(6, 4, 13, 15), list(5, 7, 1, 12), list(3, 10, 11, 16)), 5), list(1, 7, 1, 7, 1))){quit('no', 1)}\n if(!identical(candidate(list(list(11, 8, 7, 2), list(5, 16, 14, 4), list(9, 3, 15, 6), list(12, 13, 10, 1)), 9), list(1, 6, 1, 6, 1, 6, 1, 6, 1))){quit('no', 1)}\n if(!identical(candidate(list(list(12, 13, 10, 1), list(9, 3, 15, 6), list(5, 16, 14, 4), list(11, 8, 7, 2)), 12), list(1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6))){quit('no', 1)}\n if(!identical(candidate(list(list(2, 7, 4), list(3, 1, 5), list(6, 8, 9)), 8), list(1, 3, 1, 3, 1, 3, 1, 3))){quit('no', 1)}\n if(!identical(candidate(list(list(6, 1, 5), list(3, 8, 9), list(2, 7, 4)), 8), list(1, 5, 1, 5, 1, 5, 1, 5))){quit('no', 1)}\n if(!identical(candidate(list(list(1, 2), list(3, 4)), 10), list(1, 2, 1, 2, 1, 2, 1, 2, 1, 2))){quit('no', 1)}\n if(!identical(candidate(list(list(1, 3), list(3, 2)), 10), list(1, 3, 1, 3, 1, 3, 1, 3, 1, 3))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "r", - "prompt": "# Given list of integers, return list in strange order.\n# Strange sorting, is when you start with the minimum value,\n# then maximum of the remaining integers, then minimum and so on.\n# Examples:\n# strange_sort_list([1, 2, 3, 4]) == [1, 4, 2, 3]\n# strange_sort_list([5, 5, 5, 5]) == [5, 5, 5, 5]\n# strange_sort_list([]) == []\nstrange_sort_list <- function(lst) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- strange_sort_list\n if(!identical(candidate(c(1, 2, 3, 4)), list(1, 4, 2, 3))){quit('no', 1)}\n if(!identical(candidate(c(5, 6, 7, 8, 9)), list(5, 9, 6, 8, 7))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 5)), list(1, 5, 2, 4, 3))){quit('no', 1)}\n if(!identical(candidate(c(5, 6, 7, 8, 9, 1)), list(1, 9, 5, 8, 6, 7))){quit('no', 1)}\n if(!identical(candidate(c(5, 5, 5, 5)), list(5, 5, 5, 5))){quit('no', 1)}\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 5, 6, 7, 8)), list(1, 8, 2, 7, 3, 6, 4, 5))){quit('no', 1)}\n if(!identical(candidate(c(0, 2, 2, 2, 5, 5, -5, -5)), list(-5, 5, -5, 5, 0, 2, 2, 2))){quit('no', 1)}\n if(!identical(candidate(c(111111)), list(111111))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "r", - "prompt": "# Given a string 'text', return its md5 hash equivalent string.\n# If 'text' is an empty string, return None.\n# >>> string_to_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'\nstring_to_md5 <- function(text) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- string_to_md5\n if(!identical(candidate('Hello world'), '3e25960a79dbc69b674cd4ec67a72c62')){quit('no', 1)}\n if(!identical(candidate(''), NULL)){quit('no', 1)}\n if(!identical(candidate('A B C'), '0ef78513b0cb8cef12743f5aeb35f888')){quit('no', 1)}\n if(!identical(candidate('password'), '5f4dcc3b5aa765d61d8327deb882cf99')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "r", - "prompt": "# You are given a word. Your task is to find the closest vowel that stands between \n# two consonants from the right side of the word (case sensitive).\n# Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n# find any vowel met the above condition. \n# You may assume that the given string contains English letter only.\n# Example:\n# get_closest_vowel(\"yogurt\") ==> \"u\"\n# get_closest_vowel(\"FULL\") ==> \"U\"\n# get_closest_vowel(\"quick\") ==> \"\"\n# get_closest_vowel(\"ab\") ==> \"\"\nget_closest_vowel <- function(word) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- get_closest_vowel\n if(!identical(candidate('yogurt'), 'u')){quit('no', 1)}\n if(!identical(candidate('full'), 'u')){quit('no', 1)}\n if(!identical(candidate('easy'), '')){quit('no', 1)}\n if(!identical(candidate('eAsy'), '')){quit('no', 1)}\n if(!identical(candidate('ali'), '')){quit('no', 1)}\n if(!identical(candidate('bad'), 'a')){quit('no', 1)}\n if(!identical(candidate('most'), 'o')){quit('no', 1)}\n if(!identical(candidate('ab'), '')){quit('no', 1)}\n if(!identical(candidate('ba'), '')){quit('no', 1)}\n if(!identical(candidate('quick'), '')){quit('no', 1)}\n if(!identical(candidate('anime'), 'i')){quit('no', 1)}\n if(!identical(candidate('Asia'), '')){quit('no', 1)}\n if(!identical(candidate('Above'), 'o')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "r", - "prompt": "# Change numerical base of input number x to base.\n# return string representation after the conversion.\n# base numbers are less than 10.\n# >>> change_base(8, 3)\n# '22'\n# >>> change_base(8, 2)\n# '1000'\n# >>> change_base(7, 2)\n# '111'\nchange_base <- function(x, base) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- change_base\n if(!identical(candidate(8, 3), '22')){quit('no', 1)}\n if(!identical(candidate(9, 3), '100')){quit('no', 1)}\n if(!identical(candidate(234, 2), '11101010')){quit('no', 1)}\n if(!identical(candidate(16, 2), '10000')){quit('no', 1)}\n if(!identical(candidate(8, 2), '1000')){quit('no', 1)}\n if(!identical(candidate(7, 2), '111')){quit('no', 1)}\n if(!identical(candidate(2, 3), '2')){quit('no', 1)}\n if(!identical(candidate(3, 4), '3')){quit('no', 1)}\n if(!identical(candidate(4, 5), '4')){quit('no', 1)}\n if(!identical(candidate(5, 6), '5')){quit('no', 1)}\n if(!identical(candidate(6, 7), '6')){quit('no', 1)}\n if(!identical(candidate(7, 8), '7')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "r", - "prompt": "# Check if in given list of numbers, are any two numbers closer to each other than\n# given threshold.\n# >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n# False\n# >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n# True\nhas_close_elements <- function(numbers, threshold) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- has_close_elements\n if(!identical(candidate(c(1.0, 2.0, 3.9, 4.0, 5.0, 2.2), 0.3), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.9, 4.0, 5.0, 2.2), 0.05), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 5.9, 4.0, 5.0), 0.95), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 5.9, 4.0, 5.0), 0.8), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.0, 4.0, 5.0, 2.0), 0.1), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1.1, 2.2, 3.1, 4.1, 5.1), 1.0), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1.1, 2.2, 3.1, 4.1, 5.1), 0.5), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "r", - "prompt": "# Create a function that takes a string as input which contains only square brackets.\n# The function should return True if and only if there is a valid subsequence of brackets \n# where at least one bracket in the subsequence is nested.\n# is_nested('[[]]') \u279e True\n# is_nested('[]]]]]]][[[[[]') \u279e False\n# is_nested('[][]') \u279e False\n# is_nested('[]') \u279e False\n# is_nested('[[][]]') \u279e True\n# is_nested('[[]][[') \u279e True\nis_nested <- function(string) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- is_nested\n if(!identical(candidate('[[]]'), TRUE)){quit('no', 1)}\n if(!identical(candidate('[]]]]]]][[[[[]'), FALSE)){quit('no', 1)}\n if(!identical(candidate('[][]'), FALSE)){quit('no', 1)}\n if(!identical(candidate('[]'), FALSE)){quit('no', 1)}\n if(!identical(candidate('[[[[]]]]'), TRUE)){quit('no', 1)}\n if(!identical(candidate('[]]]]]]]]]]'), FALSE)){quit('no', 1)}\n if(!identical(candidate('[][][[]]'), TRUE)){quit('no', 1)}\n if(!identical(candidate('[[]'), FALSE)){quit('no', 1)}\n if(!identical(candidate('[]]'), FALSE)){quit('no', 1)}\n if(!identical(candidate('[[]][['), TRUE)){quit('no', 1)}\n if(!identical(candidate('[[][]]'), TRUE)){quit('no', 1)}\n if(!identical(candidate(''), FALSE)){quit('no', 1)}\n if(!identical(candidate('[[[[[[[['), FALSE)){quit('no', 1)}\n if(!identical(candidate(']]]]]]]]'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "r", - "prompt": "# Concatenate list of strings into a single string\n# >>> concatenate([])\n# ''\n# >>> concatenate(['a', 'b', 'c'])\n# 'abc'\nconcatenate <- function(strings) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- concatenate\n if(!identical(candidate(c()), '')){quit('no', 1)}\n if(!identical(candidate(c('x', 'y', 'z')), 'xyz')){quit('no', 1)}\n if(!identical(candidate(c('x', 'y', 'z', 'w', 'k')), 'xyzwk')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "r", - "prompt": "# prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n# >>> prime_fib(1)\n# 2\n# >>> prime_fib(2)\n# 3\n# >>> prime_fib(3)\n# 5\n# >>> prime_fib(4)\n# 13\n# >>> prime_fib(5)\n# 89\nprime_fib <- function(n) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- prime_fib\n if(!identical(candidate(1), 2)){quit('no', 1)}\n if(!identical(candidate(2), 3)){quit('no', 1)}\n if(!identical(candidate(3), 5)){quit('no', 1)}\n if(!identical(candidate(4), 13)){quit('no', 1)}\n if(!identical(candidate(5), 89)){quit('no', 1)}\n if(!identical(candidate(6), 233)){quit('no', 1)}\n if(!identical(candidate(7), 1597)){quit('no', 1)}\n if(!identical(candidate(8), 28657)){quit('no', 1)}\n if(!identical(candidate(9), 514229)){quit('no', 1)}\n if(!identical(candidate(10), 433494437)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "r", - "prompt": "# From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n# other and return them in order (smaller number, larger number).\n# >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n# (2.0, 2.2)\n# >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n# (2.0, 2.0)\nfind_closest_elements <- function(numbers) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- find_closest_elements\n if(!identical(candidate(c(1.0, 2.0, 3.9, 4.0, 5.0, 2.2)), list(3.9, 4.0))){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 5.9, 4.0, 5.0)), list(5.0, 5.9))){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.0, 4.0, 5.0, 2.2)), list(2.0, 2.2))){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.0, 4.0, 5.0, 2.0)), list(2.0, 2.0))){quit('no', 1)}\n if(!identical(candidate(c(1.1, 2.2, 3.1, 4.1, 5.1)), list(2.2, 3.1))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "r", - "prompt": "# You have been tasked to write a function that receives \n# a hexadecimal number as a string and counts the number of hexadecimal \n# digits that are primes (prime number, or a prime, is a natural number \n# greater than 1 that is not a product of two smaller natural numbers).\n# Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n# Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n# So you have to determine a number of the following digits: 2, 3, 5, 7, \n# B (=decimal 11), D (=decimal 13).\n# Note: you may assume the input is always correct or empty string, \n# and symbols A,B,C,D,E,F are always uppercase.\n# Examples:\n# For num = \"AB\" the output should be 1.\n# For num = \"1077E\" the output should be 2.\n# For num = \"ABED1A33\" the output should be 4.\n# For num = \"123456789ABCDEF0\" the output should be 6.\n# For num = \"2020\" the output should be 2.\nhex_key <- function(num) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- hex_key\n if(!identical(candidate('AB'), 1)){quit('no', 1)}\n if(!identical(candidate('1077E'), 2)){quit('no', 1)}\n if(!identical(candidate('ABED1A33'), 4)){quit('no', 1)}\n if(!identical(candidate('2020'), 2)){quit('no', 1)}\n if(!identical(candidate('123456789ABCDEF0'), 6)){quit('no', 1)}\n if(!identical(candidate('112233445566778899AABBCCDDEEFF00'), 12)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "r", - "prompt": "# Complete the function that takes two integers and returns \n# the product of their unit digits.\n# Assume the input is always valid.\n# Examples:\n# multiply(148, 412) should return 16.\n# multiply(19, 28) should return 72.\n# multiply(2020, 1851) should return 0.\n# multiply(14,-15) should return 20.\nmultiply <- function(a, b) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- multiply\n if(!identical(candidate(148, 412), 16)){quit('no', 1)}\n if(!identical(candidate(19, 28), 72)){quit('no', 1)}\n if(!identical(candidate(2020, 1851), 0)){quit('no', 1)}\n if(!identical(candidate(14, -15), 20)){quit('no', 1)}\n if(!identical(candidate(76, 67), 42)){quit('no', 1)}\n if(!identical(candidate(17, 27), 49)){quit('no', 1)}\n if(!identical(candidate(0, 1), 0)){quit('no', 1)}\n if(!identical(candidate(0, 0), 0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "r", - "prompt": "# Given list of numbers (of at least two elements), apply a linear transform to that list,\n# such that the smallest number will become 0 and the largest will become 1\n# >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n# [0.0, 0.25, 0.5, 0.75, 1.0]\nrescale_to_unit <- function(numbers) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- rescale_to_unit\n if(!identical(candidate(c(2.0, 49.9)), list(0.0, 1.0))){quit('no', 1)}\n if(!identical(candidate(c(100.0, 49.9)), list(1.0, 0.0))){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.0, 4.0, 5.0)), list(0.0, 0.25, 0.5, 0.75, 1.0))){quit('no', 1)}\n if(!identical(candidate(c(2.0, 1.0, 5.0, 3.0, 4.0)), list(0.25, 0.0, 1.0, 0.5, 0.75))){quit('no', 1)}\n if(!identical(candidate(c(12.0, 11.0, 15.0, 13.0, 14.0)), list(0.25, 0.0, 1.0, 0.5, 0.75))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "r", - "prompt": "# Given a positive integer n, return the product of the odd digits.\n# Return 0 if all digits are even.\n# For example:\n# digits(1) == 1\n# digits(4) == 0\n# digits(235) == 15\ndigits <- function(n) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- digits\n if(!identical(candidate(5), 5)){quit('no', 1)}\n if(!identical(candidate(54), 5)){quit('no', 1)}\n if(!identical(candidate(120), 1)){quit('no', 1)}\n if(!identical(candidate(5014), 5)){quit('no', 1)}\n if(!identical(candidate(98765), 315)){quit('no', 1)}\n if(!identical(candidate(5576543), 2625)){quit('no', 1)}\n if(!identical(candidate(2468), 0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "r", - "prompt": "# You will be given the name of a class (a string) and a list of extensions.\n# The extensions are to be used to load additional classes to the class. The\n# strength of the extension is as follows: Let CAP be the number of the uppercase\n# letters in the extension's name, and let SM be the number of lowercase letters \n# in the extension's name, the strength is given by the fraction CAP - SM. \n# You should find the strongest extension and return a string in this \n# format: ClassName.StrongestExtensionName.\n# If there are two or more extensions with the same strength, you should\n# choose the one that comes first in the list.\n# For example, if you are given \"Slices\" as the class and a list of the\n# extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n# return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n# (its strength is -1).\n# Example:\n# for Strongest_Extension('my_class', ['AA', 'Be', 'CC']) == 'my_class.AA'\nStrongest_Extension <- function(class_name, extensions) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- Strongest_Extension\n if(!identical(candidate('Watashi', c('tEN', 'niNE', 'eIGHt8OKe')), 'Watashi.eIGHt8OKe')){quit('no', 1)}\n if(!identical(candidate('Boku123', c('nani', 'NazeDa', 'YEs.WeCaNe', '32145tggg')), 'Boku123.YEs.WeCaNe')){quit('no', 1)}\n if(!identical(candidate('__YESIMHERE', c('t', 'eMptY', 'nothing', 'zeR00', 'NuLl__', '123NoooneB321')), '__YESIMHERE.NuLl__')){quit('no', 1)}\n if(!identical(candidate('K', c('Ta', 'TAR', 't234An', 'cosSo')), 'K.TAR')){quit('no', 1)}\n if(!identical(candidate('__HAHA', c('Tab', '123', '781345', '-_-')), '__HAHA.123')){quit('no', 1)}\n if(!identical(candidate('YameRore', c('HhAas', 'okIWILL123', 'WorkOut', 'Fails', '-_-')), 'YameRore.okIWILL123')){quit('no', 1)}\n if(!identical(candidate('finNNalLLly', c('Die', 'NowW', 'Wow', 'WoW')), 'finNNalLLly.WoW')){quit('no', 1)}\n if(!identical(candidate('_', c('Bb', '91245')), '_.Bb')){quit('no', 1)}\n if(!identical(candidate('Sp', c('671235', 'Bb')), 'Sp.671235')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "r", - "prompt": "# Given a string representing a space separated lowercase letters, return a dictionary\n# of the letter with the most repetition and containing the corresponding count.\n# If several letters have the same occurrence, return all of them.\n# Example:\n# histogram('a b c') == {'a': 1, 'b': 1, 'c': 1}\n# histogram('a b b a') == {'a': 2, 'b': 2}\n# histogram('a b c a b') == {'a': 2, 'b': 2}\n# histogram('b b b b a') == {'b': 4}\n# histogram('') == {}\nhistogram <- function(test) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- histogram\n if(!identical(candidate('a b b a'), list('a' = 2, 'b' = 2))){quit('no', 1)}\n if(!identical(candidate('a b c a b'), list('a' = 2, 'b' = 2))){quit('no', 1)}\n if(!identical(candidate('a b c d g'), list('a' = 1, 'b' = 1, 'c' = 1, 'd' = 1, 'g' = 1))){quit('no', 1)}\n if(!identical(candidate('r t g'), list('r' = 1, 't' = 1, 'g' = 1))){quit('no', 1)}\n if(!identical(candidate('b b b b a'), list('b' = 4))){quit('no', 1)}\n if(!identical(candidate('r t g'), list('r' = 1, 't' = 1, 'g' = 1))){quit('no', 1)}\n if(!identical(candidate(''), list())){quit('no', 1)}\n if(!identical(candidate('a'), list('a' = 1))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "r", - "prompt": "# pairs_sum_to_zero takes a list of integers as an input.\n# it returns True if there are two distinct elements in the list that\n# sum to zero, and False otherwise.\n# >>> pairs_sum_to_zero([1, 3, 5, 0])\n# False\n# >>> pairs_sum_to_zero([1, 3, -2, 1])\n# False\n# >>> pairs_sum_to_zero([1, 2, 3, 7])\n# False\n# >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7])\n# True\n# >>> pairs_sum_to_zero([1])\n# False\npairs_sum_to_zero <- function(l) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- pairs_sum_to_zero\n if(!identical(candidate(c(1, 3, 5, 0)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 3, -2, 1)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 7)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(2, 4, -5, 3, 5, 7)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(-3, 9, -1, 3, 2, 30)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(-3, 9, -1, 3, 2, 31)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(-3, 9, -1, 4, 2, 30)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(-3, 9, -1, 4, 2, 31)), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "r", - "prompt": "# Write a function that accepts two lists of strings and returns the list that has \n# total number of chars in the all strings of the list less than the other list.\n# if the two lists have the same number of chars, return the first list.\n# Examples\n# total_match([], []) \u279e []\n# total_match(['hi', 'admin'], ['hI', 'Hi']) \u279e ['hI', 'Hi']\n# total_match(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) \u279e ['hi', 'admin']\n# total_match(['hi', 'admin'], ['hI', 'hi', 'hi']) \u279e ['hI', 'hi', 'hi']\n# total_match(['4'], ['1', '2', '3', '4', '5']) \u279e ['4']\ntotal_match <- function(lst1, lst2) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- total_match\n if(!identical(candidate(c(), c()), list())){quit('no', 1)}\n if(!identical(candidate(c('hi', 'admin'), c('hi', 'hi')), list('hi', 'hi'))){quit('no', 1)}\n if(!identical(candidate(c('hi', 'admin'), c('hi', 'hi', 'admin', 'project')), list('hi', 'admin'))){quit('no', 1)}\n if(!identical(candidate(c('4'), c('1', '2', '3', '4', '5')), list('4'))){quit('no', 1)}\n if(!identical(candidate(c('hi', 'admin'), c('hI', 'Hi')), list('hI', 'Hi'))){quit('no', 1)}\n if(!identical(candidate(c('hi', 'admin'), c('hI', 'hi', 'hi')), list('hI', 'hi', 'hi'))){quit('no', 1)}\n if(!identical(candidate(c('hi', 'admin'), c('hI', 'hi', 'hii')), list('hi', 'admin'))){quit('no', 1)}\n if(!identical(candidate(c(), c('this')), list())){quit('no', 1)}\n if(!identical(candidate(c('this'), c()), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "r", - "prompt": "# Circular shift the digits of the integer x, shift the digits right by shift\n# and return the result as a string.\n# If shift > number of digits, return digits reversed.\n# >>> circular_shift(12, 1)\n# \"21\"\n# >>> circular_shift(12, 2)\n# \"12\"\ncircular_shift <- function(x, shift) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- circular_shift\n if(!identical(candidate(100, 2), '001')){quit('no', 1)}\n if(!identical(candidate(12, 2), '12')){quit('no', 1)}\n if(!identical(candidate(97, 8), '79')){quit('no', 1)}\n if(!identical(candidate(12, 1), '21')){quit('no', 1)}\n if(!identical(candidate(11, 101), '11')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "r", - "prompt": "# Return True is list elements are monotonically increasing or decreasing.\n# >>> monotonic([1, 2, 4, 20])\n# True\n# >>> monotonic([1, 20, 4, 10])\n# False\n# >>> monotonic([4, 1, 0, -10])\n# True\nmonotonic <- function(l) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- monotonic\n if(!identical(candidate(c(1, 2, 4, 10)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 4, 20)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 20, 4, 10)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(4, 1, 0, -10)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(4, 1, 1, 0)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 2, 5, 60)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 5, 60)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(9, 9, 9, 9)), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "r", - "prompt": "# Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n# Example\n# is_equal_to_sum_even(4) == False\n# is_equal_to_sum_even(6) == False\n# is_equal_to_sum_even(8) == True\nis_equal_to_sum_even <- function(n) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- is_equal_to_sum_even\n if(!identical(candidate(4), FALSE)){quit('no', 1)}\n if(!identical(candidate(6), FALSE)){quit('no', 1)}\n if(!identical(candidate(8), TRUE)){quit('no', 1)}\n if(!identical(candidate(10), TRUE)){quit('no', 1)}\n if(!identical(candidate(11), FALSE)){quit('no', 1)}\n if(!identical(candidate(12), TRUE)){quit('no', 1)}\n if(!identical(candidate(13), FALSE)){quit('no', 1)}\n if(!identical(candidate(16), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "r", - "prompt": "# Input to this function is a string representing musical notes in a special ASCII format.\n# Your task is to parse this string and return list of integers corresponding to how many beats does each\n# not last.\n# Here is a legend:\n# 'o' - whole note, lasts four beats\n# 'o|' - half note, lasts two beats\n# '.|' - quater note, lasts one beat\n# >>> parse_music('o o| .| o| o| .| .| .| .| o o')\n# [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\nparse_music <- function(music_string) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- parse_music\n if(!identical(candidate(''), list())){quit('no', 1)}\n if(!identical(candidate('o o o o'), list(4, 4, 4, 4))){quit('no', 1)}\n if(!identical(candidate('.| .| .| .|'), list(1, 1, 1, 1))){quit('no', 1)}\n if(!identical(candidate('o| o| .| .| o o o o'), list(2, 2, 1, 1, 4, 4, 4, 4))){quit('no', 1)}\n if(!identical(candidate('o| .| o| .| o o| o o|'), list(2, 1, 2, 1, 4, 2, 4, 2))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "r", - "prompt": "# \"\n# This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n# multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n# change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n# Examples:\n# For lst = [1,2,3] the output should be 6\n# For lst = [] the output should be 0\n# For lst = [-1,-5,2,-1,-5] the output should be -126\nsum_squares <- function(lst) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- sum_squares\n if(!identical(candidate(c(1, 2, 3)), 6)){quit('no', 1)}\n if(!identical(candidate(c(1, 4, 9)), 14)){quit('no', 1)}\n if(!identical(candidate(c()), 0)){quit('no', 1)}\n if(!identical(candidate(c(1, 1, 1, 1, 1, 1, 1, 1, 1)), 9)){quit('no', 1)}\n if(!identical(candidate(c(-1, -1, -1, -1, -1, -1, -1, -1, -1)), -3)){quit('no', 1)}\n if(!identical(candidate(c(0)), 0)){quit('no', 1)}\n if(!identical(candidate(c(-1, -5, 2, -1, -5)), -126)){quit('no', 1)}\n if(!identical(candidate(c(-56, -99, 1, 0, -2)), 3030)){quit('no', 1)}\n if(!identical(candidate(c(-1, 0, 0, 0, 0, 0, 0, 0, -1)), 0)){quit('no', 1)}\n if(!identical(candidate(c(-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37)), -14196)){quit('no', 1)}\n if(!identical(candidate(c(-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10)), -1448)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "r", - "prompt": "# triples_sum_to_zero takes a list of integers as an input.\n# it returns True if there are three distinct elements in the list that\n# sum to zero, and False otherwise.\n# >>> triples_sum_to_zero([1, 3, 5, 0])\n# False\n# >>> triples_sum_to_zero([1, 3, -2, 1])\n# True\n# >>> triples_sum_to_zero([1, 2, 3, 7])\n# False\n# >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n# True\n# >>> triples_sum_to_zero([1])\n# False\ntriples_sum_to_zero <- function(l) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- triples_sum_to_zero\n if(!identical(candidate(c(1, 3, 5, 0)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 3, 5, -1)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 3, -2, 1)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 7)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 5, 7)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(2, 4, -5, 3, 9, 7)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 3, 5, -100)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(100, 3, 5, -100)), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "r", - "prompt": "# brackets is a string of \"<\" and \">\".\n# return True if every opening bracket has a corresponding closing bracket.\n# >>> correct_bracketing(\"<\")\n# False\n# >>> correct_bracketing(\"<>\")\n# True\n# >>> correct_bracketing(\"<<><>>\")\n# True\n# >>> correct_bracketing(\"><<>\")\n# False\ncorrect_bracketing <- function(brackets) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- correct_bracketing\n if(!identical(candidate('<>'), TRUE)){quit('no', 1)}\n if(!identical(candidate('<<><>>'), TRUE)){quit('no', 1)}\n if(!identical(candidate('<><><<><>><>'), TRUE)){quit('no', 1)}\n if(!identical(candidate('<><><<<><><>><>><<><><<>>>'), TRUE)){quit('no', 1)}\n if(!identical(candidate('<<<><>>>>'), FALSE)){quit('no', 1)}\n if(!identical(candidate('><<>'), FALSE)){quit('no', 1)}\n if(!identical(candidate('<'), FALSE)){quit('no', 1)}\n if(!identical(candidate('<<<<'), FALSE)){quit('no', 1)}\n if(!identical(candidate('>'), FALSE)){quit('no', 1)}\n if(!identical(candidate('<<>'), FALSE)){quit('no', 1)}\n if(!identical(candidate('<><><<><>><>><<>'), FALSE)){quit('no', 1)}\n if(!identical(candidate('<><><<><>><>>><>'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "r", - "prompt": "# Write a function that takes an array of numbers as input and returns \n# the number of elements in the array that are greater than 10 and both \n# first and last digits of a number are odd (1, 3, 5, 7, 9).\n# For example:\n# specialFilter([15, -73, 14, -15]) => 1 \n# specialFilter([33, -2, -3, 45, 21, 109]) => 2\nspecialFilter <- function(nums) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- specialFilter\n if(!identical(candidate(c(5, -2, 1, -5)), 0)){quit('no', 1)}\n if(!identical(candidate(c(15, -73, 14, -15)), 1)){quit('no', 1)}\n if(!identical(candidate(c(33, -2, -3, 45, 21, 109)), 2)){quit('no', 1)}\n if(!identical(candidate(c(43, -12, 93, 125, 121, 109)), 4)){quit('no', 1)}\n if(!identical(candidate(c(71, -2, -33, 75, 21, 19)), 3)){quit('no', 1)}\n if(!identical(candidate(c(1)), 0)){quit('no', 1)}\n if(!identical(candidate(c()), 0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "r", - "prompt": "# Given a dictionary, return True if all keys are strings in lower \n# case or all keys are strings in upper case, else return False.\n# The function should return False is the given dictionary is empty.\n# Examples:\n# check_dict_case({\"a\":\"apple\", \"b\":\"banana\"}) should return True.\n# check_dict_case({\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}) should return False.\n# check_dict_case({\"a\":\"apple\", \"8\":\"banana\", \"a\":\"apple\"}) should return False.\n# check_dict_case({\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}) should return False.\n# check_dict_case({\"STATE\":\"NC\", \"ZIP\":\"12345\" }) should return True.\ncheck_dict_case <- function(dict) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- check_dict_case\n if(!identical(candidate(list('p' = 'pineapple', 'b' = 'banana')), TRUE)){quit('no', 1)}\n if(!identical(candidate(list('p' = 'pineapple', 'A' = 'banana', 'B' = 'banana')), FALSE)){quit('no', 1)}\n if(!identical(candidate(list('p' = 'pineapple', '5' = 'banana', 'a' = 'apple')), FALSE)){quit('no', 1)}\n if(!identical(candidate(list('Name' = 'John', 'Age' = '36', 'City' = 'Houston')), FALSE)){quit('no', 1)}\n if(!identical(candidate(list('STATE' = 'NC', 'ZIP' = '12345')), TRUE)){quit('no', 1)}\n if(!identical(candidate(list('fruit' = 'Orange', 'taste' = 'Sweet')), TRUE)){quit('no', 1)}\n if(!identical(candidate(list()), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "r", - "prompt": "# Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n# should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n# alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n# Examples\n# split_words(\"Hello world!\") \u279e [\"Hello\", \"world!\"]\n# split_words(\"Hello,world!\") \u279e [\"Hello\", \"world!\"]\n# split_words(\"abcdef\") == 3\nsplit_words <- function(txt) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- split_words\n if(!identical(candidate('Hello world!'), list('Hello', 'world!'))){quit('no', 1)}\n if(!identical(candidate('Hello,world!'), list('Hello', 'world!'))){quit('no', 1)}\n if(!identical(candidate('Hello world,!'), list('Hello', 'world,!'))){quit('no', 1)}\n if(!identical(candidate('Hello,Hello,world !'), list('Hello,Hello,world', '!'))){quit('no', 1)}\n if(!identical(candidate('abcdef'), 3)){quit('no', 1)}\n if(!identical(candidate('aaabb'), 2)){quit('no', 1)}\n if(!identical(candidate('aaaBb'), 1)){quit('no', 1)}\n if(!identical(candidate(''), 0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "r", - "prompt": "# The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fibfib(0) == 0\n# fibfib(1) == 0\n# fibfib(2) == 1\n# fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n# Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n# >>> fibfib(1)\n# 0\n# >>> fibfib(5)\n# 4\n# >>> fibfib(8)\n# 24\nfibfib <- function(n) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- fibfib\n if(!identical(candidate(2), 1)){quit('no', 1)}\n if(!identical(candidate(1), 0)){quit('no', 1)}\n if(!identical(candidate(5), 4)){quit('no', 1)}\n if(!identical(candidate(8), 24)){quit('no', 1)}\n if(!identical(candidate(10), 81)){quit('no', 1)}\n if(!identical(candidate(12), 274)){quit('no', 1)}\n if(!identical(candidate(14), 927)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "r", - "prompt": "# You are given a list of numbers.\n# You need to return the sum of squared numbers in the given list,\n# round each element in the list to the upper int(Ceiling) first.\n# Examples:\n# For lst = [1,2,3] the output should be 14\n# For lst = [1,4,9] the output should be 98\n# For lst = [1,3,5,7] the output should be 84\n# For lst = [1.4,4.2,0] the output should be 29\n# For lst = [-2.4,1,1] the output should be 6\nsum_squares <- function(lst) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- sum_squares\n if(!identical(candidate(c(1.0, 2.0, 3.0)), 14)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.0)), 14)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 3.0, 5.0, 7.0)), 84)){quit('no', 1)}\n if(!identical(candidate(c(1.4, 4.2, 0.0)), 29)){quit('no', 1)}\n if(!identical(candidate(c(-2.4, 1.0, 1.0)), 6)){quit('no', 1)}\n if(!identical(candidate(c(100.0, 1.0, 15.0, 2.0)), 10230)){quit('no', 1)}\n if(!identical(candidate(c(10000.0, 10000.0)), 200000000)){quit('no', 1)}\n if(!identical(candidate(c(-1.4, 4.6, 6.3)), 75)){quit('no', 1)}\n if(!identical(candidate(c(-1.4, 17.9, 18.9, 19.9)), 1086)){quit('no', 1)}\n if(!identical(candidate(c(0.0)), 0)){quit('no', 1)}\n if(!identical(candidate(c(-1.0)), 1)){quit('no', 1)}\n if(!identical(candidate(c(-1.0, 1.0, 0.0)), 2)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_85_add", - "language": "r", - "prompt": "# Given a non-empty list of integers lst. add the even elements that are at odd indices..\n# Examples:\n# add([4, 2, 6, 7]) ==> 2\nadd <- function(lst) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- add\n if(!identical(candidate(c(4, 88)), 88)){quit('no', 1)}\n if(!identical(candidate(c(4, 5, 6, 7, 2, 122)), 122)){quit('no', 1)}\n if(!identical(candidate(c(4, 0, 6, 7)), 0)){quit('no', 1)}\n if(!identical(candidate(c(4, 4, 6, 8)), 12)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "r", - "prompt": "# Return sorted unique elements in a list\n# >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123])\n# [0, 2, 3, 5, 9, 123]\nunique <- function(l) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- unique\n if(!identical(candidate(c(5, 3, 5, 2, 3, 3, 9, 0, 123)), list(0, 2, 3, 5, 9, 123))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "r", - "prompt": "# Given a string text, replace all spaces in it with underscores, \n# and if a string has more than 2 consecutive spaces, \n# then replace all consecutive spaces with - \n# fix_spaces(\"Example\") == \"Example\"\n# fix_spaces(\"Example 1\") == \"Example_1\"\n# fix_spaces(\" Example 2\") == \"_Example_2\"\n# fix_spaces(\" Example 3\") == \"_Example-3\"\nfix_spaces <- function(text) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- fix_spaces\n if(!identical(candidate('Example'), 'Example')){quit('no', 1)}\n if(!identical(candidate('Mudasir Hanif '), 'Mudasir_Hanif_')){quit('no', 1)}\n if(!identical(candidate('Yellow Yellow Dirty Fellow'), 'Yellow_Yellow__Dirty__Fellow')){quit('no', 1)}\n if(!identical(candidate('Exa mple'), 'Exa-mple')){quit('no', 1)}\n if(!identical(candidate(' Exa 1 2 2 mple'), '-Exa_1_2_2_mple')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "r", - "prompt": "# Return 2^n modulo p (be aware of numerics).\n# >>> modp(3, 5)\n# 3\n# >>> modp(1101, 101)\n# 2\n# >>> modp(0, 101)\n# 1\n# >>> modp(3, 11)\n# 8\n# >>> modp(100, 101)\n# 1\nmodp <- function(n, p) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- modp\n if(!identical(candidate(3, 5), 3)){quit('no', 1)}\n if(!identical(candidate(1101, 101), 2)){quit('no', 1)}\n if(!identical(candidate(0, 101), 1)){quit('no', 1)}\n if(!identical(candidate(3, 11), 8)){quit('no', 1)}\n if(!identical(candidate(100, 101), 1)){quit('no', 1)}\n if(!identical(candidate(30, 5), 4)){quit('no', 1)}\n if(!identical(candidate(31, 5), 3)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "r", - "prompt": "# You have to write a function which validates a given date string and\n# returns True if the date is valid otherwise False.\n# The date is valid if all of the following rules are satisfied:\n# 1. The date string is not empty.\n# 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n# 3. The months should not be less than 1 or higher than 12.\n# 4. The date should be in the format: mm-dd-yyyy\n# for example: \n# valid_date('03-11-2000') => True\n# valid_date('15-01-2012') => False\n# valid_date('04-0-2040') => False\n# valid_date('06-04-2020') => True\n# valid_date('06/04/2020') => False\nvalid_date <- function(date) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- valid_date\n if(!identical(candidate('03-11-2000'), TRUE)){quit('no', 1)}\n if(!identical(candidate('15-01-2012'), FALSE)){quit('no', 1)}\n if(!identical(candidate('04-0-2040'), FALSE)){quit('no', 1)}\n if(!identical(candidate('06-04-2020'), TRUE)){quit('no', 1)}\n if(!identical(candidate('01-01-2007'), TRUE)){quit('no', 1)}\n if(!identical(candidate('03-32-2011'), FALSE)){quit('no', 1)}\n if(!identical(candidate(''), FALSE)){quit('no', 1)}\n if(!identical(candidate('04-31-3000'), FALSE)){quit('no', 1)}\n if(!identical(candidate('06-06-2005'), TRUE)){quit('no', 1)}\n if(!identical(candidate('21-31-2000'), FALSE)){quit('no', 1)}\n if(!identical(candidate('04-12-2003'), TRUE)){quit('no', 1)}\n if(!identical(candidate('04122003'), FALSE)){quit('no', 1)}\n if(!identical(candidate('20030412'), FALSE)){quit('no', 1)}\n if(!identical(candidate('2003-04'), FALSE)){quit('no', 1)}\n if(!identical(candidate('2003-04-12'), FALSE)){quit('no', 1)}\n if(!identical(candidate('04-2003'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "r", - "prompt": "# Write a function that takes a string and returns an ordered version of it.\n# Ordered version of string, is a string where all words (separated by space)\n# are replaced by a new word where all the characters arranged in\n# ascending order based on ascii value.\n# Note: You should keep the order of words and blank spaces in the sentence.\n# For example:\n# anti_shuffle('Hi') returns 'Hi'\n# anti_shuffle('hello') returns 'ehllo'\n# anti_shuffle('Hello World!!!') returns 'Hello !!!Wdlor'\nanti_shuffle <- function(s) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- anti_shuffle\n if(!identical(candidate('Hi'), 'Hi')){quit('no', 1)}\n if(!identical(candidate('hello'), 'ehllo')){quit('no', 1)}\n if(!identical(candidate('number'), 'bemnru')){quit('no', 1)}\n if(!identical(candidate('abcd'), 'abcd')){quit('no', 1)}\n if(!identical(candidate('Hello World!!!'), 'Hello !!!Wdlor')){quit('no', 1)}\n if(!identical(candidate(''), '')){quit('no', 1)}\n if(!identical(candidate('Hi. My name is Mister Robot. How are you?'), '.Hi My aemn is Meirst .Rboot How aer ?ouy')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "r", - "prompt": "# Given a list of numbers, return whether or not they are sorted\n# in ascending order. If list has more than 1 duplicate of the same\n# number, return False. Assume no negative numbers and only integers.\n# Examples\n# is_sorted([5]) \u279e True\n# is_sorted([1, 2, 3, 4, 5]) \u279e True\n# is_sorted([1, 3, 2, 4, 5]) \u279e False\n# is_sorted([1, 2, 3, 4, 5, 6]) \u279e True\n# is_sorted([1, 2, 3, 4, 5, 6, 7]) \u279e True\n# is_sorted([1, 3, 2, 4, 5, 6, 7]) \u279e False\n# is_sorted([1, 2, 2, 3, 3, 4]) \u279e True\n# is_sorted([1, 2, 2, 2, 3, 4]) \u279e False\nis_sorted <- function(lst) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- is_sorted\n if(!identical(candidate(c(5)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 5)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 3, 2, 4, 5)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 5, 6)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 5, 6, 7)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 3, 2, 4, 5, 6, 7)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c()), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 1)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 2, 2, 3, 4)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 3, 3, 4)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 2, 3, 3, 4)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4)), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "r", - "prompt": "# You are given a string s.\n# Your task is to check if the string is happy or not.\n# A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n# For example:\n# is_happy(a) => False\n# is_happy(aa) => False\n# is_happy(abcd) => True\n# is_happy(aabb) => False\n# is_happy(adb) => True\n# is_happy(xyy) => False\nis_happy <- function(s) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- is_happy\n if(!identical(candidate('a'), FALSE)){quit('no', 1)}\n if(!identical(candidate('aa'), FALSE)){quit('no', 1)}\n if(!identical(candidate('abcd'), TRUE)){quit('no', 1)}\n if(!identical(candidate('aabb'), FALSE)){quit('no', 1)}\n if(!identical(candidate('adb'), TRUE)){quit('no', 1)}\n if(!identical(candidate('xyy'), FALSE)){quit('no', 1)}\n if(!identical(candidate('iopaxpoi'), TRUE)){quit('no', 1)}\n if(!identical(candidate('iopaxioi'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "r", - "prompt": "# Write a function that returns True if the object q will fly, and False otherwise.\n# The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n# Example:\n# will_it_fly([1, 2], 5) \u279e False \n# # 1+2 is less than the maximum possible weight, but it's unbalanced.\n# will_it_fly([3, 2, 3], 1) \u279e False\n# # it's balanced, but 3+2+3 is more than the maximum possible weight.\n# will_it_fly([3, 2, 3], 9) \u279e True\n# # 3+2+3 is less than the maximum possible weight, and it's balanced.\n# will_it_fly([3], 5) \u279e True\n# # 3 is less than the maximum possible weight, and it's balanced.\nwill_it_fly <- function(q, w) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- will_it_fly\n if(!identical(candidate(c(3, 2, 3), 9), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2), 5), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(3), 5), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 3), 1), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3), 6), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(5), 5), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "r", - "prompt": "# Given an array of non-negative integers, return a copy of the given array after sorting,\n# you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n# or sort it in descending order if the sum( first index value, last index value) is even.\n# Note:\n# * don't change the given array.\n# Examples:\n# * sort_array([]) => []\n# * sort_array([5]) => [5]\n# * sort_array([2, 4, 3, 0, 1, 5]) => [0, 1, 2, 3, 4, 5]\n# * sort_array([2, 4, 3, 0, 1, 5, 6]) => [6, 5, 4, 3, 2, 1, 0]\nsort_array <- function(array) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- sort_array\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(5)), list(5))){quit('no', 1)}\n if(!identical(candidate(c(2, 4, 3, 0, 1, 5)), list(0, 1, 2, 3, 4, 5))){quit('no', 1)}\n if(!identical(candidate(c(2, 4, 3, 0, 1, 5, 6)), list(6, 5, 4, 3, 2, 1, 0))){quit('no', 1)}\n if(!identical(candidate(c(2, 1)), list(1, 2))){quit('no', 1)}\n if(!identical(candidate(c(15, 42, 87, 32, 11, 0)), list(0, 11, 15, 32, 42, 87))){quit('no', 1)}\n if(!identical(candidate(c(21, 14, 23, 11)), list(23, 21, 14, 11))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "r", - "prompt": "# Implement a function that takes an non-negative integer and returns an array of the first n\n# integers that are prime numbers and less than n.\n# for example:\n# count_up_to(5) => [2,3]\n# count_up_to(11) => [2,3,5,7]\n# count_up_to(0) => []\n# count_up_to(20) => [2,3,5,7,11,13,17,19]\n# count_up_to(1) => []\n# count_up_to(18) => [2,3,5,7,11,13,17]\ncount_up_to <- function(n) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- count_up_to\n if(!identical(candidate(5), list(2, 3))){quit('no', 1)}\n if(!identical(candidate(6), list(2, 3, 5))){quit('no', 1)}\n if(!identical(candidate(7), list(2, 3, 5))){quit('no', 1)}\n if(!identical(candidate(10), list(2, 3, 5, 7))){quit('no', 1)}\n if(!identical(candidate(0), list())){quit('no', 1)}\n if(!identical(candidate(22), list(2, 3, 5, 7, 11, 13, 17, 19))){quit('no', 1)}\n if(!identical(candidate(1), list())){quit('no', 1)}\n if(!identical(candidate(18), list(2, 3, 5, 7, 11, 13, 17))){quit('no', 1)}\n if(!identical(candidate(47), list(2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43))){quit('no', 1)}\n if(!identical(candidate(101), list(2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "r", - "prompt": "# Out of list of strings, return the longest one. Return the first one in case of multiple\n# strings of the same length. Return None in case the input list is empty.\n# >>> longest([])\n# >>> longest(['a', 'b', 'c'])\n# 'a'\n# >>> longest(['a', 'bb', 'ccc'])\n# 'ccc'\nlongest <- function(strings) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- longest\n if(!identical(candidate(c()), NULL)){quit('no', 1)}\n if(!identical(candidate(c('x', 'y', 'z')), 'x')){quit('no', 1)}\n if(!identical(candidate(c('x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc')), 'zzzz')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "r", - "prompt": "# Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n# reverse the resulting array, and then replace each digit by its corresponding name from\n# \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n# For example:\n# arr = [2, 1, 1, 4, 5, 8, 2, 3] \n# -> sort arr -> [1, 1, 2, 2, 3, 4, 5, 8] \n# -> reverse arr -> [8, 5, 4, 3, 2, 2, 1, 1]\n# return [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n# If the array is empty, return an empty array:\n# arr = []\n# return []\n# If the array has any strange number ignore it:\n# arr = [1, -1 , 55] \n# -> sort arr -> [-1, 1, 55]\n# -> reverse arr -> [55, 1, -1]\n# return = ['One']\nby_length <- function(arr) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- by_length\n if(!identical(candidate(c(2, 1, 1, 4, 5, 8, 2, 3)), list('Eight', 'Five', 'Four', 'Three', 'Two', 'Two', 'One', 'One'))){quit('no', 1)}\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(1, -1, 55)), list('One'))){quit('no', 1)}\n if(!identical(candidate(c(1, -1, 3, 2)), list('Three', 'Two', 'One'))){quit('no', 1)}\n if(!identical(candidate(c(9, 4, 8)), list('Nine', 'Eight', 'Four'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_106_f", - "language": "r", - "prompt": "# Implement the function f that takes n as a parameter,\n# 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\n# or the sum of numbers from 1 to i otherwise.\n# i starts from 1.\n# the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n# Example:\n# f(5) == [1, 2, 6, 24, 15]\nf <- function(n) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- f\n if(!identical(candidate(5), list(1, 2, 6, 24, 15))){quit('no', 1)}\n if(!identical(candidate(7), list(1, 2, 6, 24, 15, 720, 28))){quit('no', 1)}\n if(!identical(candidate(1), list(1))){quit('no', 1)}\n if(!identical(candidate(3), list(1, 2, 6))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "r", - "prompt": "# Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n# >>> fizz_buzz(50)\n# 0\n# >>> fizz_buzz(78)\n# 2\n# >>> fizz_buzz(79)\n# 3\nfizz_buzz <- function(n) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- fizz_buzz\n if(!identical(candidate(50), 0)){quit('no', 1)}\n if(!identical(candidate(78), 2)){quit('no', 1)}\n if(!identical(candidate(79), 3)){quit('no', 1)}\n if(!identical(candidate(100), 3)){quit('no', 1)}\n if(!identical(candidate(200), 6)){quit('no', 1)}\n if(!identical(candidate(4000), 192)){quit('no', 1)}\n if(!identical(candidate(10000), 639)){quit('no', 1)}\n if(!identical(candidate(100000), 8026)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "r", - "prompt": "# Given a positive floating point number, it can be decomposed into\n# and integer part (largest integer smaller than given number) and decimals\n# (leftover part always smaller than 1).\n# Return the decimal part of the number.\n# >>> truncate_number(3.5)\n# 0.5\ntruncate_number <- function(number) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- truncate_number\n if(!identical(candidate(3.5), 0.5)){quit('no', 1)}\n if(!identical(candidate(1.25), 0.25)){quit('no', 1)}\n if(!identical(candidate(123.0), 0.0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "r", - "prompt": "# For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n# Empty sum should be equal to 0 and empty product should be equal to 1.\n# >>> sum_product([])\n# (0, 1)\n# >>> sum_product([1, 2, 3, 4])\n# (10, 24)\nsum_product <- function(numbers) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- sum_product\n if(!identical(candidate(c()), list(0, 1))){quit('no', 1)}\n if(!identical(candidate(c(1, 1, 1)), list(3, 1))){quit('no', 1)}\n if(!identical(candidate(c(100, 0)), list(100, 0))){quit('no', 1)}\n if(!identical(candidate(c(3, 5, 7)), list(15, 105))){quit('no', 1)}\n if(!identical(candidate(c(10)), list(10, 10))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "r", - "prompt": "# You are given a 2 dimensional data, as a nested lists,\n# which is similar to matrix, however, unlike matrices,\n# each row may contain a different number of columns.\n# Given lst, and integer x, find integers x in the list,\n# and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n# each tuple is a coordinate - (row, columns), starting with 0.\n# Sort coordinates initially by rows in ascending order.\n# Also, sort coordinates of the row by columns in descending order.\n# Examples:\n# get_row([\n# [1,2,3,4,5,6],\n# [1,2,3,4,1,6],\n# [1,2,3,4,5,1]\n# ], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n# get_row([], 1) == []\n# get_row([[], [1], [1, 2, 3]], 3) == [(2, 2)]\nget_row <- function(lst, x) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- get_row\n if(!identical(candidate(list(list(1, 2, 3, 4, 5, 6), list(1, 2, 3, 4, 1, 6), list(1, 2, 3, 4, 5, 1)), 1), list(list(0, 0), list(1, 4), list(1, 0), list(2, 5), list(2, 0)))){quit('no', 1)}\n if(!identical(candidate(list(list(1, 2, 3, 4, 5, 6), list(1, 2, 3, 4, 5, 6), list(1, 2, 3, 4, 5, 6), list(1, 2, 3, 4, 5, 6), list(1, 2, 3, 4, 5, 6), list(1, 2, 3, 4, 5, 6)), 2), list(list(0, 1), list(1, 1), list(2, 1), list(3, 1), list(4, 1), list(5, 1)))){quit('no', 1)}\n if(!identical(candidate(list(list(1, 2, 3, 4, 5, 6), list(1, 2, 3, 4, 5, 6), list(1, 1, 3, 4, 5, 6), list(1, 2, 1, 4, 5, 6), list(1, 2, 3, 1, 5, 6), list(1, 2, 3, 4, 1, 6), list(1, 2, 3, 4, 5, 1)), 1), list(list(0, 0), list(1, 0), list(2, 1), list(2, 0), list(3, 2), list(3, 0), list(4, 3), list(4, 0), list(5, 4), list(5, 0), list(6, 5), list(6, 0)))){quit('no', 1)}\n if(!identical(candidate(list(), 1), list())){quit('no', 1)}\n if(!identical(candidate(list(list(1)), 2), list())){quit('no', 1)}\n if(!identical(candidate(list(list(), list(1), list(1, 2, 3)), 3), list(list(2, 2)))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "r", - "prompt": "# You're a hungry rabbit, and you already have eaten a certain number of carrots,\n# but now you need to eat more carrots to complete the day's meals.\n# you should return an array of [ total number of eaten carrots after your meals,\n# the number of carrots left after your meals ]\n# if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n# Example:\n# * eat(5, 6, 10) -> [11, 4]\n# * eat(4, 8, 9) -> [12, 1]\n# * eat(1, 10, 10) -> [11, 0]\n# * eat(2, 11, 5) -> [7, 0]\n# Variables:\n# @number : integer\n# the number of carrots that you have eaten.\n# @need : integer\n# the number of carrots that you need to eat.\n# @remaining : integer\n# the number of remaining carrots thet exist in stock\n# Constrain:\n# * 0 <= number <= 1000\n# * 0 <= need <= 1000\n# * 0 <= remaining <= 1000\n# Have fun :)\neat <- function(number, need, remaining) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- eat\n if(!identical(candidate(5, 6, 10), list(11, 4))){quit('no', 1)}\n if(!identical(candidate(4, 8, 9), list(12, 1))){quit('no', 1)}\n if(!identical(candidate(1, 10, 10), list(11, 0))){quit('no', 1)}\n if(!identical(candidate(2, 11, 5), list(7, 0))){quit('no', 1)}\n if(!identical(candidate(4, 5, 7), list(9, 2))){quit('no', 1)}\n if(!identical(candidate(4, 5, 1), list(5, 0))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "r", - "prompt": "# Given a positive integer N, return the total sum of its digits in binary.\n# Example\n# For N = 1000, the sum of digits will be 1 the output should be \"1\".\n# For N = 150, the sum of digits will be 6 the output should be \"110\".\n# For N = 147, the sum of digits will be 12 the output should be \"1100\".\n# Variables:\n# @N integer\n# Constraints: 0 \u2264 N \u2264 10000.\n# Output:\n# a string of binary number\nsolve <- function(N) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- solve\n if(!identical(candidate(1000), '1')){quit('no', 1)}\n if(!identical(candidate(150), '110')){quit('no', 1)}\n if(!identical(candidate(147), '1100')){quit('no', 1)}\n if(!identical(candidate(333), '1001')){quit('no', 1)}\n if(!identical(candidate(963), '10010')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "r", - "prompt": "# You are given a list of integers.\n# You need to find the largest prime value and return the sum of its digits.\n# Examples:\n# For lst = [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] the output should be 10\n# For lst = [1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1] the output should be 25\n# For lst = [1,3,1,32,5107,34,83278,109,163,23,2323,32,30,1,9,3] the output should be 13\n# For lst = [0,724,32,71,99,32,6,0,5,91,83,0,5,6] the output should be 11\n# For lst = [0,81,12,3,1,21] the output should be 3\n# For lst = [0,8,1,2,1,7] the output should be 7\nskjkasdkd <- function(lst) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- skjkasdkd\n if(!identical(candidate(c(0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3)), 10)){quit('no', 1)}\n if(!identical(candidate(c(1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1)), 25)){quit('no', 1)}\n if(!identical(candidate(c(1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3)), 13)){quit('no', 1)}\n if(!identical(candidate(c(0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6)), 11)){quit('no', 1)}\n if(!identical(candidate(c(0, 81, 12, 3, 1, 21)), 3)){quit('no', 1)}\n if(!identical(candidate(c(0, 8, 1, 2, 1, 7)), 7)){quit('no', 1)}\n if(!identical(candidate(c(8191)), 19)){quit('no', 1)}\n if(!identical(candidate(c(8191, 123456, 127, 7)), 19)){quit('no', 1)}\n if(!identical(candidate(c(127, 97, 8192)), 10)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "r", - "prompt": "# Given an array arr of integers, find the minimum number of elements that\n# need to be changed to make the array palindromic. A palindromic array is an array that\n# is read the same backwards and forwards. In one change, you can change one element to any other element.\n# For example:\n# smallest_change([1,2,3,5,4,7,9,6]) == 4\n# smallest_change([1, 2, 3, 4, 3, 2, 2]) == 1\n# smallest_change([1, 2, 3, 2, 1]) == 0\nsmallest_change <- function(arr) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- smallest_change\n if(!identical(candidate(c(1, 2, 3, 5, 4, 7, 9, 6)), 4)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 3, 2, 2)), 1)){quit('no', 1)}\n if(!identical(candidate(c(1, 4, 2)), 1)){quit('no', 1)}\n if(!identical(candidate(c(1, 4, 4, 2)), 1)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 2, 1)), 0)){quit('no', 1)}\n if(!identical(candidate(c(3, 1, 1, 3)), 0)){quit('no', 1)}\n if(!identical(candidate(c(1)), 0)){quit('no', 1)}\n if(!identical(candidate(c(0, 1)), 1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "r", - "prompt": "# It is the last week of the semester and the teacher has to give the grades\n# to students. The teacher has been making her own algorithm for grading.\n# The only problem is, she has lost the code she used for grading.\n# She has given you a list of GPAs for some students and you have to write \n# a function that can output a list of letter grades using the following table:\n# GPA | Letter grade\n# 4.0 A+\n# > 3.7 A \n# > 3.3 A- \n# > 3.0 B+\n# > 2.7 B \n# > 2.3 B-\n# > 2.0 C+\n# > 1.7 C\n# > 1.3 C-\n# > 1.0 D+ \n# > 0.7 D \n# > 0.0 D-\n# 0.0 E\n# Example:\n# grade_equation([4.0, 3, 1.7, 2, 3.5]) ==> ['A+', 'B', 'C-', 'C', 'A-']\nnumerical_letter_grade <- function(grades) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- numerical_letter_grade\n if(!identical(candidate(c(4.0, 3, 1.7, 2, 3.5)), list('A+', 'B', 'C-', 'C', 'A-'))){quit('no', 1)}\n if(!identical(candidate(c(1.2)), list('D+'))){quit('no', 1)}\n if(!identical(candidate(c(0.5)), list('D-'))){quit('no', 1)}\n if(!identical(candidate(c(0.0)), list('E'))){quit('no', 1)}\n if(!identical(candidate(c(1.0, 0.3, 1.5, 2.8, 3.3)), list('D', 'D-', 'C-', 'B', 'B+'))){quit('no', 1)}\n if(!identical(candidate(c(0.0, 0.7)), list('E', 'D-'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "r", - "prompt": "# Given the lengths of the three sides of a triangle. Return the area of\n# the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n# Otherwise return -1\n# Three sides make a valid triangle when the sum of any two sides is greater \n# than the third side.\n# Example:\n# triangle_area(3, 4, 5) == 6.00\n# triangle_area(1, 2, 10) == -1\ntriangle_area <- function(a, b, c) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- triangle_area\n if(!identical(candidate(3, 4, 5), 6.0)){quit('no', 1)}\n if(!identical(candidate(1, 2, 10), -1)){quit('no', 1)}\n if(!identical(candidate(4, 8, 5), 8.18)){quit('no', 1)}\n if(!identical(candidate(2, 2, 2), 1.73)){quit('no', 1)}\n if(!identical(candidate(1, 2, 3), -1)){quit('no', 1)}\n if(!identical(candidate(10, 5, 7), 16.25)){quit('no', 1)}\n if(!identical(candidate(2, 6, 3), -1)){quit('no', 1)}\n if(!identical(candidate(1, 1, 1), 0.43)){quit('no', 1)}\n if(!identical(candidate(2, 2, 10), -1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "r", - "prompt": "# Check if two words have the same characters.\n# >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n# True\n# >>> same_chars('abcd', 'dddddddabc')\n# True\n# >>> same_chars('dddddddabc', 'abcd')\n# True\n# >>> same_chars('eabcd', 'dddddddabc')\n# False\n# >>> same_chars('abcd', 'dddddddabce')\n# False\n# >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc')\n# False\nsame_chars <- function(s0, s1) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- same_chars\n if(!identical(candidate('eabcdzzzz', 'dddzzzzzzzddeddabc'), TRUE)){quit('no', 1)}\n if(!identical(candidate('abcd', 'dddddddabc'), TRUE)){quit('no', 1)}\n if(!identical(candidate('dddddddabc', 'abcd'), TRUE)){quit('no', 1)}\n if(!identical(candidate('eabcd', 'dddddddabc'), FALSE)){quit('no', 1)}\n if(!identical(candidate('abcd', 'dddddddabcf'), FALSE)){quit('no', 1)}\n if(!identical(candidate('eabcdzzzz', 'dddzzzzzzzddddabc'), FALSE)){quit('no', 1)}\n if(!identical(candidate('aabb', 'aaccc'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "r", - "prompt": "# Given an array of integers nums, find the minimum sum of any non-empty sub-array\n# of nums.\n# Example\n# minSubArraySum([2, 3, 4, 1, 2, 4]) == 1\n# minSubArraySum([-1, -2, -3]) == -6\nminSubArraySum <- function(nums) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- minSubArraySum\n if(!identical(candidate(c(2, 3, 4, 1, 2, 4)), 1)){quit('no', 1)}\n if(!identical(candidate(c(-1, -2, -3)), -6)){quit('no', 1)}\n if(!identical(candidate(c(-1, -2, -3, 2, -10)), -14)){quit('no', 1)}\n if(!identical(candidate(c(-9999999999999999)), -9999999999999999)){quit('no', 1)}\n if(!identical(candidate(c(0, 10, 20, 1000000)), 0)){quit('no', 1)}\n if(!identical(candidate(c(-1, -2, -3, 10, -5)), -6)){quit('no', 1)}\n if(!identical(candidate(c(100, -1, -2, -3, 10, -5)), -6)){quit('no', 1)}\n if(!identical(candidate(c(10, 11, 13, 8, 3, 4)), 3)){quit('no', 1)}\n if(!identical(candidate(c(100, -33, 32, -1, 0, -2)), -33)){quit('no', 1)}\n if(!identical(candidate(c(-10)), -10)){quit('no', 1)}\n if(!identical(candidate(c(7)), 7)){quit('no', 1)}\n if(!identical(candidate(c(1, -1)), -1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "r", - "prompt": "# Given a string s and a natural number n, you have been tasked to implement \n# a function that returns a list of all words from string s that contain exactly \n# n consonants, in order these words appear in the string s.\n# If the string s is empty then the function should return an empty list.\n# Note: you may assume the input string contains only letters and spaces.\n# Examples:\n# select_words(\"Mary had a little lamb\", 4) ==> [\"little\"]\n# select_words(\"Mary had a little lamb\", 3) ==> [\"Mary\", \"lamb\"]\n# select_words(\"simple white space\", 2) ==> []\n# select_words(\"Hello world\", 4) ==> [\"world\"]\n# select_words(\"Uncle sam\", 3) ==> [\"Uncle\"]\nselect_words <- function(s, n) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- select_words\n if(!identical(candidate('Mary had a little lamb', 4), list('little'))){quit('no', 1)}\n if(!identical(candidate('Mary had a little lamb', 3), list('Mary', 'lamb'))){quit('no', 1)}\n if(!identical(candidate('simple white space', 2), list())){quit('no', 1)}\n if(!identical(candidate('Hello world', 4), list('world'))){quit('no', 1)}\n if(!identical(candidate('Uncle sam', 3), list('Uncle'))){quit('no', 1)}\n if(!identical(candidate('', 4), list())){quit('no', 1)}\n if(!identical(candidate('a b c d e f', 1), list('b', 'c', 'd', 'f'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "r", - "prompt": "# Return list of all prefixes from shortest to longest of the input string\n# >>> all_prefixes('abc')\n# ['a', 'ab', 'abc']\nall_prefixes <- function(string) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- all_prefixes\n if(!identical(candidate(''), list())){quit('no', 1)}\n if(!identical(candidate('asdfgh'), list('a', 'as', 'asd', 'asdf', 'asdfg', 'asdfgh'))){quit('no', 1)}\n if(!identical(candidate('WWW'), list('W', 'WW', 'WWW'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "r", - "prompt": "# Create a function that takes a value (string) representing a number\n# and returns the closest integer to it. If the number is equidistant\n# from two integers, round it away from zero.\n# Examples\n# >>> closest_integer(\"10\")\n# 10\n# >>> closest_integer(\"15.3\")\n# 15\n# Note:\n# Rounding away from zero means that if the given number is equidistant\n# from two integers, the one you should return is the one that is the\n# farthest from zero. For example closest_integer(\"14.5\") should\n# return 15 and closest_integer(\"-14.5\") should return -15.\nclosest_integer <- function(value) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- closest_integer\n if(!identical(candidate('10'), 10)){quit('no', 1)}\n if(!identical(candidate('14.5'), 15)){quit('no', 1)}\n if(!identical(candidate('-15.5'), -16)){quit('no', 1)}\n if(!identical(candidate('15.3'), 15)){quit('no', 1)}\n if(!identical(candidate('0'), 0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "r", - "prompt": "# Create a function which takes a string representing a file's name, and returns\n# 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n# A file's name is considered to be valid if and only if all the following conditions \n# are met:\n# - There should not be more than three digits ('0'-'9') in the file's name.\n# - The file's name contains exactly one dot '.'\n# - The substring before the dot should not be empty, and it starts with a letter from \n# the latin alphapet ('a'-'z' and 'A'-'Z').\n# - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n# Examples:\n# file_name_check(\"example.txt\") # => 'Yes'\n# file_name_check(\"1example.dll\") # => 'No' (the name should start with a latin alphapet letter)\nfile_name_check <- function(file_name) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- file_name_check\n if(!identical(candidate('example.txt'), 'Yes')){quit('no', 1)}\n if(!identical(candidate('1example.dll'), 'No')){quit('no', 1)}\n if(!identical(candidate('s1sdf3.asd'), 'No')){quit('no', 1)}\n if(!identical(candidate('K.dll'), 'Yes')){quit('no', 1)}\n if(!identical(candidate('MY16FILE3.exe'), 'Yes')){quit('no', 1)}\n if(!identical(candidate('His12FILE94.exe'), 'No')){quit('no', 1)}\n if(!identical(candidate('_Y.txt'), 'No')){quit('no', 1)}\n if(!identical(candidate('?aREYA.exe'), 'No')){quit('no', 1)}\n if(!identical(candidate('/this_is_valid.dll'), 'No')){quit('no', 1)}\n if(!identical(candidate('this_is_valid.wow'), 'No')){quit('no', 1)}\n if(!identical(candidate('this_is_valid.txt'), 'Yes')){quit('no', 1)}\n if(!identical(candidate('this_is_valid.txtexe'), 'No')){quit('no', 1)}\n if(!identical(candidate('#this2_i4s_5valid.ten'), 'No')){quit('no', 1)}\n if(!identical(candidate('@this1_is6_valid.exe'), 'No')){quit('no', 1)}\n if(!identical(candidate('this_is_12valid.6exe4.txt'), 'No')){quit('no', 1)}\n if(!identical(candidate('all.exe.txt'), 'No')){quit('no', 1)}\n if(!identical(candidate('I563_No.exe'), 'Yes')){quit('no', 1)}\n if(!identical(candidate('Is3youfault.txt'), 'Yes')){quit('no', 1)}\n if(!identical(candidate('no_one#knows.dll'), 'Yes')){quit('no', 1)}\n if(!identical(candidate('1I563_Yes3.exe'), 'No')){quit('no', 1)}\n if(!identical(candidate('I563_Yes3.txtt'), 'No')){quit('no', 1)}\n if(!identical(candidate('final..txt'), 'No')){quit('no', 1)}\n if(!identical(candidate('final132'), 'No')){quit('no', 1)}\n if(!identical(candidate('_f4indsartal132.'), 'No')){quit('no', 1)}\n if(!identical(candidate('.txt'), 'No')){quit('no', 1)}\n if(!identical(candidate('s.'), 'No')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "r", - "prompt": "# You are given two intervals,\n# where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n# The given intervals are closed which means that the interval (start, end)\n# includes both start and end.\n# For each given interval, it is assumed that its start is less or equal its end.\n# Your task is to determine whether the length of intersection of these two \n# intervals is a prime number.\n# Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n# which its length is 1, which not a prime number.\n# If the length of the intersection is a prime number, return \"YES\",\n# otherwise, return \"NO\".\n# If the two intervals don't intersect, return \"NO\".\n# [input/output] samples:\n# intersection((1, 2), (2, 3)) ==> \"NO\"\n# intersection((-1, 1), (0, 4)) ==> \"NO\"\n# intersection((-3, -1), (-5, 5)) ==> \"YES\"\nintersection <- function(interval1, interval2) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- intersection\n if(!identical(candidate(list(1, 2), list(2, 3)), 'NO')){quit('no', 1)}\n if(!identical(candidate(list(-1, 1), list(0, 4)), 'NO')){quit('no', 1)}\n if(!identical(candidate(list(-3, -1), list(-5, 5)), 'YES')){quit('no', 1)}\n if(!identical(candidate(list(-2, 2), list(-4, 0)), 'YES')){quit('no', 1)}\n if(!identical(candidate(list(-11, 2), list(-1, -1)), 'NO')){quit('no', 1)}\n if(!identical(candidate(list(1, 2), list(3, 5)), 'NO')){quit('no', 1)}\n if(!identical(candidate(list(1, 2), list(1, 2)), 'NO')){quit('no', 1)}\n if(!identical(candidate(list(-2, -2), list(-3, -2)), 'NO')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "r", - "prompt": "# Return the largest prime factor of n. Assume n > 1 and is not a prime.\n# >>> largest_prime_factor(13195)\n# 29\n# >>> largest_prime_factor(2048)\n# 2\nlargest_prime_factor <- function(n) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- largest_prime_factor\n if(!identical(candidate(15), 5)){quit('no', 1)}\n if(!identical(candidate(27), 3)){quit('no', 1)}\n if(!identical(candidate(63), 7)){quit('no', 1)}\n if(!identical(candidate(330), 11)){quit('no', 1)}\n if(!identical(candidate(13195), 29)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "r", - "prompt": "# Given a string, find out how many distinct characters (regardless of case) does it consist of\n# >>> count_distinct_characters('xyzXYZ')\n# 3\n# >>> count_distinct_characters('Jerry')\n# 4\ncount_distinct_characters <- function(string) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- count_distinct_characters\n if(!identical(candidate(''), 0)){quit('no', 1)}\n if(!identical(candidate('abcde'), 5)){quit('no', 1)}\n if(!identical(candidate('abcdecadeCADE'), 5)){quit('no', 1)}\n if(!identical(candidate('aaaaAAAAaaaa'), 1)){quit('no', 1)}\n if(!identical(candidate('Jerry jERRY JeRRRY'), 5)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "r", - "prompt": "# You're given a list of deposit and withdrawal operations on a bank account that starts with\n# zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n# at that point function should return True. Otherwise it should return False.\n# >>> below_zero([1, 2, 3])\n# False\n# >>> below_zero([1, 2, -4, 5])\n# True\nbelow_zero <- function(operations) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- below_zero\n if(!identical(candidate(c()), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, -3, 1, 2, -3)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, -4, 5, 6)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, -1, 2, -2, 5, -5, 4, -4)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, -1, 2, -2, 5, -5, 4, -5)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, -2, 2, -2, 5, -5, 4, -4)), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "r", - "prompt": "# Find the shortest palindrome that begins with a supplied string.\n# Algorithm idea is simple:\n# - Find the longest postfix of supplied string that is a palindrome.\n# - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n# >>> make_palindrome('')\n# ''\n# >>> make_palindrome('cat')\n# 'catac'\n# >>> make_palindrome('cata')\n# 'catac'\nmake_palindrome <- function(string) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- make_palindrome\n if(!identical(candidate(''), '')){quit('no', 1)}\n if(!identical(candidate('x'), 'x')){quit('no', 1)}\n if(!identical(candidate('xyz'), 'xyzyx')){quit('no', 1)}\n if(!identical(candidate('xyx'), 'xyx')){quit('no', 1)}\n if(!identical(candidate('jerry'), 'jerryrrej')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "r", - "prompt": "# Given a positive integer, obtain its roman numeral equivalent as a string,\n# and return it in lowercase.\n# Restrictions: 1 <= num <= 1000\n# Examples:\n# >>> int_to_mini_roman(19) == 'xix'\n# >>> int_to_mini_roman(152) == 'clii'\n# >>> int_to_mini_roman(426) == 'cdxxvi'\nint_to_mini_roman <- function(number) {", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- int_to_mini_roman\n if(!identical(candidate(19), 'xix')){quit('no', 1)}\n if(!identical(candidate(152), 'clii')){quit('no', 1)}\n if(!identical(candidate(251), 'ccli')){quit('no', 1)}\n if(!identical(candidate(426), 'cdxxvi')){quit('no', 1)}\n if(!identical(candidate(500), 'd')){quit('no', 1)}\n if(!identical(candidate(1), 'i')){quit('no', 1)}\n if(!identical(candidate(4), 'iv')){quit('no', 1)}\n if(!identical(candidate(43), 'xliii')){quit('no', 1)}\n if(!identical(candidate(90), 'xc')){quit('no', 1)}\n if(!identical(candidate(94), 'xciv')){quit('no', 1)}\n if(!identical(candidate(532), 'dxxxii')){quit('no', 1)}\n if(!identical(candidate(900), 'cm')){quit('no', 1)}\n if(!identical(candidate(994), 'cmxciv')){quit('no', 1)}\n if(!identical(candidate(1000), 'm')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - } -] \ No newline at end of file diff --git a/data/r-remove.json b/data/r-remove.json deleted file mode 100644 index 91d24a898083ed14a84636358fa4d9283e18c51b..0000000000000000000000000000000000000000 --- a/data/r-remove.json +++ /dev/null @@ -1,2056 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "r", - "prompt": "# For a given number n, find the largest number that divides n evenly, smaller than n\nlargest_divisor <- function(n) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- largest_divisor\n if(!identical(candidate(3), 1)){quit('no', 1)}\n if(!identical(candidate(7), 1)){quit('no', 1)}\n if(!identical(candidate(10), 5)){quit('no', 1)}\n if(!identical(candidate(100), 50)){quit('no', 1)}\n if(!identical(candidate(49), 7)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_47_median", - "language": "r", - "prompt": "# Return median of elements in the list l.\nmedian <- function(l) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- median\n if(!identical(candidate(c(3, 1, 2, 4, 5)), 3)){quit('no', 1)}\n if(!identical(candidate(c(-10, 4, 6, 1000, 10, 20)), 8.0)){quit('no', 1)}\n if(!identical(candidate(c(5)), 5)){quit('no', 1)}\n if(!identical(candidate(c(6, 5)), 5.5)){quit('no', 1)}\n if(!identical(candidate(c(8, 1, 3, 9, 9, 2, 7)), 7)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "r", - "prompt": "# Return maximum element in the list.\nmax_element <- function(l) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- max_element\n if(!identical(candidate(c(1, 2, 3)), 3)){quit('no', 1)}\n if(!identical(candidate(c(5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10)), 124)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "r", - "prompt": "# Create a function which returns the largest index of an element which\n# is not greater than or equal to the element immediately preceding it. If\n# no such element exists then return -1. The given array will not contain\n# duplicate values.\n# Examples:\ncan_arrange <- function(arr) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- can_arrange\n if(!identical(candidate(c(1, 2, 4, 3, 5)), 3)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 4, 5)), -1)){quit('no', 1)}\n if(!identical(candidate(c(1, 4, 2, 5, 6, 7, 8, 9, 10)), 2)){quit('no', 1)}\n if(!identical(candidate(c(4, 8, 5, 7, 3)), 4)){quit('no', 1)}\n if(!identical(candidate(c()), -1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "r", - "prompt": "# Create a function that returns True if the last character\n# of a given string is an alphabetical character and is not\n# a part of a word, and False otherwise.\n# Note: \"word\" is a group of characters separated by space.\n# Examples:\ncheck_if_last_char_is_a_letter <- function(txt) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- check_if_last_char_is_a_letter\n if(!identical(candidate('apple'), FALSE)){quit('no', 1)}\n if(!identical(candidate('apple pi e'), TRUE)){quit('no', 1)}\n if(!identical(candidate('eeeee'), FALSE)){quit('no', 1)}\n if(!identical(candidate('A'), TRUE)){quit('no', 1)}\n if(!identical(candidate('Pumpkin pie '), FALSE)){quit('no', 1)}\n if(!identical(candidate('Pumpkin pie 1'), FALSE)){quit('no', 1)}\n if(!identical(candidate(''), FALSE)){quit('no', 1)}\n if(!identical(candidate('eeeee e '), FALSE)){quit('no', 1)}\n if(!identical(candidate('apple pie'), FALSE)){quit('no', 1)}\n if(!identical(candidate('apple pi e '), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "r", - "prompt": "# Return true if a given number is prime, and false otherwise.\nis_prime <- function(n) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- is_prime\n if(!identical(candidate(6), FALSE)){quit('no', 1)}\n if(!identical(candidate(101), TRUE)){quit('no', 1)}\n if(!identical(candidate(11), TRUE)){quit('no', 1)}\n if(!identical(candidate(13441), TRUE)){quit('no', 1)}\n if(!identical(candidate(61), TRUE)){quit('no', 1)}\n if(!identical(candidate(4), FALSE)){quit('no', 1)}\n if(!identical(candidate(1), FALSE)){quit('no', 1)}\n if(!identical(candidate(5), TRUE)){quit('no', 1)}\n if(!identical(candidate(11), TRUE)){quit('no', 1)}\n if(!identical(candidate(17), TRUE)){quit('no', 1)}\n if(!identical(candidate(85), FALSE)){quit('no', 1)}\n if(!identical(candidate(77), FALSE)){quit('no', 1)}\n if(!identical(candidate(255379), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "r", - "prompt": "# Given a list of positive integers x. return a sorted list of all \n# elements that hasn't any even digit.\n# Note: Returned list should be sorted in increasing order.\n# For example:\nunique_digits <- function(x) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- unique_digits\n if(!identical(candidate(c(15, 33, 1422, 1)), list(1, 15, 33))){quit('no', 1)}\n if(!identical(candidate(c(152, 323, 1422, 10)), list())){quit('no', 1)}\n if(!identical(candidate(c(12345, 2033, 111, 151)), list(111, 151))){quit('no', 1)}\n if(!identical(candidate(c(135, 103, 31)), list(31, 135))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "r", - "prompt": "# Input are two strings a and b consisting only of 1s and 0s.\n# Perform binary XOR on these inputs and return result also as a string.\nstring_xor <- function(a, b) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- string_xor\n if(!identical(candidate('111000', '101010'), '010010')){quit('no', 1)}\n if(!identical(candidate('1', '1'), '0')){quit('no', 1)}\n if(!identical(candidate('0101', '0000'), '0101')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "r", - "prompt": "# sum_to_n is a function that sums numbers from 1 to n.\nsum_to_n <- function(n) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- sum_to_n\n if(!identical(candidate(1), 1)){quit('no', 1)}\n if(!identical(candidate(6), 21)){quit('no', 1)}\n if(!identical(candidate(11), 66)){quit('no', 1)}\n if(!identical(candidate(30), 465)){quit('no', 1)}\n if(!identical(candidate(100), 5050)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "r", - "prompt": "# Given a list of numbers, return the sum of squares of the numbers\n# in the list that are odd. Ignore numbers that are negative or not integers.\n# If the input list is empty, return 0.\ndouble_the_difference <- function(lst) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- double_the_difference\n if(!identical(candidate(c()), 0)){quit('no', 1)}\n if(!identical(candidate(c(5.0, 4.0)), 25)){quit('no', 1)}\n if(!identical(candidate(c(0.1, 0.2, 0.3)), 0)){quit('no', 1)}\n if(!identical(candidate(c(-10.0, -20.0, -30.0)), 0)){quit('no', 1)}\n if(!identical(candidate(c(-1.0, -2.0, 8.0)), 0)){quit('no', 1)}\n if(!identical(candidate(c(0.2, 3.0, 5.0)), 34)){quit('no', 1)}\n if(!identical(candidate(c(-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0)), 165)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "r", - "prompt": "# Return length of given string\nstrlen <- function(string) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- strlen\n if(!identical(candidate(''), 0)){quit('no', 1)}\n if(!identical(candidate('x'), 1)){quit('no', 1)}\n if(!identical(candidate('asdasnakj'), 9)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "r", - "prompt": "# You'll be given a string of words, and your task is to count the number\n# of boredoms. A boredom is a sentence that starts with the word \"I\".\n# Sentences are delimited by '.', '?' or '!'.\n# For example:\nis_bored <- function(S) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- is_bored\n if(!identical(candidate('Hello world'), 0)){quit('no', 1)}\n if(!identical(candidate('Is the sky blue?'), 0)){quit('no', 1)}\n if(!identical(candidate('I love It !'), 1)){quit('no', 1)}\n if(!identical(candidate('bIt'), 0)){quit('no', 1)}\n if(!identical(candidate('I feel good today. I will be productive. will kill It'), 2)){quit('no', 1)}\n if(!identical(candidate('You and I are going for a walk'), 0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "r", - "prompt": "# Write a function vowels_count which takes a string representing\n# a word as input and returns the number of vowels in the string.\n# Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n# vowel, but only when it is at the end of the given word.\n# Example:\nvowels_count <- function(s) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- vowels_count\n if(!identical(candidate('abcde'), 2)){quit('no', 1)}\n if(!identical(candidate('Alone'), 3)){quit('no', 1)}\n if(!identical(candidate('key'), 2)){quit('no', 1)}\n if(!identical(candidate('bye'), 1)){quit('no', 1)}\n if(!identical(candidate('keY'), 2)){quit('no', 1)}\n if(!identical(candidate('bYe'), 1)){quit('no', 1)}\n if(!identical(candidate('ACEDY'), 3)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "r", - "prompt": "# Return n-th Fibonacci number.\nfib <- function(n) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- fib\n if(!identical(candidate(10), 55)){quit('no', 1)}\n if(!identical(candidate(1), 1)){quit('no', 1)}\n if(!identical(candidate(8), 21)){quit('no', 1)}\n if(!identical(candidate(11), 89)){quit('no', 1)}\n if(!identical(candidate(12), 144)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "r", - "prompt": "# Your task is to implement a function that will simplify the expression\n# x * n. The function returns True if x * n evaluates to a whole number and False\n# otherwise. Both x and n, are string representation of a fraction, and have the following format,\n# / where both numerator and denominator are positive whole numbers.\n# You can assume that x, and n are valid fractions, and do not have zero as denominator.\nsimplify <- function(x, n) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- simplify\n if(!identical(candidate('1/5', '5/1'), TRUE)){quit('no', 1)}\n if(!identical(candidate('1/6', '2/1'), FALSE)){quit('no', 1)}\n if(!identical(candidate('5/1', '3/1'), TRUE)){quit('no', 1)}\n if(!identical(candidate('7/10', '10/2'), FALSE)){quit('no', 1)}\n if(!identical(candidate('2/10', '50/10'), TRUE)){quit('no', 1)}\n if(!identical(candidate('7/2', '4/2'), TRUE)){quit('no', 1)}\n if(!identical(candidate('11/6', '6/1'), TRUE)){quit('no', 1)}\n if(!identical(candidate('2/3', '5/2'), FALSE)){quit('no', 1)}\n if(!identical(candidate('5/2', '3/5'), FALSE)){quit('no', 1)}\n if(!identical(candidate('2/4', '8/4'), TRUE)){quit('no', 1)}\n if(!identical(candidate('2/4', '4/2'), TRUE)){quit('no', 1)}\n if(!identical(candidate('1/5', '5/1'), TRUE)){quit('no', 1)}\n if(!identical(candidate('1/5', '1/5'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "r", - "prompt": "# Given a string s, count the number of uppercase vowels in even indices.\n# For example:\ncount_upper <- function(s) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- count_upper\n if(!identical(candidate('aBCdEf'), 1)){quit('no', 1)}\n if(!identical(candidate('abcdefg'), 0)){quit('no', 1)}\n if(!identical(candidate('dBBE'), 0)){quit('no', 1)}\n if(!identical(candidate('B'), 0)){quit('no', 1)}\n if(!identical(candidate('U'), 1)){quit('no', 1)}\n if(!identical(candidate(''), 0)){quit('no', 1)}\n if(!identical(candidate('EEEE'), 2)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "r", - "prompt": "# You are given a rectangular grid of wells. Each row represents a single well,\n# and each 1 in a row represents a single unit of water.\n# Each well has a corresponding bucket that can be used to extract water from it, \n# and all buckets have the same capacity.\n# Your task is to use the buckets to empty the wells.\n# Output the number of times you need to lower the buckets.\n# Example 1:\n# Example 2:\n# Example 3:\n# Constraints:\n# * all wells have the same length\n# * 1 <= grid.length <= 10^2\n# * 1 <= grid[:,1].length <= 10^2\n# * grid[i][j] -> 0 | 1\n# * 1 <= capacity <= 10\nmax_fill <- function(grid, capacity) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- max_fill\n if(!identical(candidate(list(list(0, 0, 1, 0), list(0, 1, 0, 0), list(1, 1, 1, 1)), 1), 6)){quit('no', 1)}\n if(!identical(candidate(list(list(0, 0, 1, 1), list(0, 0, 0, 0), list(1, 1, 1, 1), list(0, 1, 1, 1)), 2), 5)){quit('no', 1)}\n if(!identical(candidate(list(list(0, 0, 0), list(0, 0, 0)), 5), 0)){quit('no', 1)}\n if(!identical(candidate(list(list(1, 1, 1, 1), list(1, 1, 1, 1)), 2), 4)){quit('no', 1)}\n if(!identical(candidate(list(list(1, 1, 1, 1), list(1, 1, 1, 1)), 9), 2)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "r", - "prompt": "# Given an array arr of integers and a positive integer k, return a sorted list \n# of length k with the maximum k numbers in arr.\n# Example 1:\n# Example 2:\n# Example 3:\n# Note:\n# 1. The length of the array will be in the range of [1, 1000].\n# 2. The elements in the array will be in the range of [-1000, 1000].\n# 3. 0 <= k <= len(arr)\nmaximum <- function(arr, k) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- maximum\n if(!identical(candidate(c(-3, -4, 5), 3), list(-4, -3, 5))){quit('no', 1)}\n if(!identical(candidate(c(4, -4, 4), 2), list(4, 4))){quit('no', 1)}\n if(!identical(candidate(c(-3, 2, 1, 2, -1, -2, 1), 1), list(2))){quit('no', 1)}\n if(!identical(candidate(c(123, -123, 20, 0, 1, 2, -3), 3), list(2, 20, 123))){quit('no', 1)}\n if(!identical(candidate(c(-123, 20, 0, 1, 2, -3), 4), list(0, 1, 2, 20))){quit('no', 1)}\n if(!identical(candidate(c(5, 15, 0, 3, -13, -8, 0), 7), list(-13, -8, 0, 0, 3, 5, 15))){quit('no', 1)}\n if(!identical(candidate(c(-1, 0, 2, 5, 3, -10), 2), list(3, 5))){quit('no', 1)}\n if(!identical(candidate(c(1, 0, 5, -7), 1), list(5))){quit('no', 1)}\n if(!identical(candidate(c(4, -4), 2), list(-4, 4))){quit('no', 1)}\n if(!identical(candidate(c(-10, 10), 2), list(-10, 10))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, -23, 243, -400, 0), 0), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "r", - "prompt": "# Write a function that takes a message, and encodes in such a \n# way that it swaps case of all letters, replaces all vowels in \n# the message with the letter that appears 2 places ahead of that \n# vowel in the english alphabet. \n# Assume only letters. \n# Examples:\nencode <- function(message) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- encode\n if(!identical(candidate('TEST'), 'tgst')){quit('no', 1)}\n if(!identical(candidate('Mudasir'), 'mWDCSKR')){quit('no', 1)}\n if(!identical(candidate('YES'), 'ygs')){quit('no', 1)}\n if(!identical(candidate('This is a message'), 'tHKS KS C MGSSCGG')){quit('no', 1)}\n if(!identical(candidate('I DoNt KnOw WhAt tO WrItE'), 'k dQnT kNqW wHcT Tq wRkTg')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "r", - "prompt": "# remove_vowels is a function that takes string and returns string without vowels.\nremove_vowels <- function(text) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- remove_vowels\n if(!identical(candidate(''), '')){quit('no', 1)}\n if(!identical(candidate('abcdef\\nghijklm'), 'bcdf\\nghjklm')){quit('no', 1)}\n if(!identical(candidate('fedcba'), 'fdcb')){quit('no', 1)}\n if(!identical(candidate('eeeee'), '')){quit('no', 1)}\n if(!identical(candidate('acBAA'), 'cB')){quit('no', 1)}\n if(!identical(candidate('EcBOO'), 'cB')){quit('no', 1)}\n if(!identical(candidate('ybcd'), 'ybcd')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "r", - "prompt": "# Return only positive numbers in the list.\nget_positive <- function(l) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- get_positive\n if(!identical(candidate(c(-1, -2, 4, 5, 6)), list(4, 5, 6))){quit('no', 1)}\n if(!identical(candidate(c(5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10)), list(5, 3, 2, 3, 3, 9, 123, 1))){quit('no', 1)}\n if(!identical(candidate(c(-1, -2)), list())){quit('no', 1)}\n if(!identical(candidate(c()), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "r", - "prompt": "# Return a string containing space-delimited numbers starting from 0 upto n inclusive.\nstring_sequence <- function(n) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- string_sequence\n if(!identical(candidate(0), '0')){quit('no', 1)}\n if(!identical(candidate(3), '0 1 2 3')){quit('no', 1)}\n if(!identical(candidate(10), '0 1 2 3 4 5 6 7 8 9 10')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "r", - "prompt": "# Given a positive integer n, you have to make a pile of n levels of stones.\n# The first level has n stones.\n# The number of stones in the next level is:\n# - the next odd number if n is odd.\n# - the next even number if n is even.\n# Return the number of stones in each level in a list, where element at index\n# i represents the number of stones in the level (i+1).\n# Examples:\nmake_a_pile <- function(n) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- make_a_pile\n if(!identical(candidate(3), list(3, 5, 7))){quit('no', 1)}\n if(!identical(candidate(4), list(4, 6, 8, 10))){quit('no', 1)}\n if(!identical(candidate(5), list(5, 7, 9, 11, 13))){quit('no', 1)}\n if(!identical(candidate(6), list(6, 8, 10, 12, 14, 16))){quit('no', 1)}\n if(!identical(candidate(8), list(8, 10, 12, 14, 16, 18, 20, 22))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "r", - "prompt": "# Task\n# 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\n# then check if the result string is palindrome.\n# A string is called palindrome if it reads the same backward as forward.\n# You should return a tuple containing the result string and True/False for the check.\n# Example\nreverse_delete <- function(s, c) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- reverse_delete\n if(!identical(candidate('abcde', 'ae'), list('bcd', FALSE))){quit('no', 1)}\n if(!identical(candidate('abcdef', 'b'), list('acdef', FALSE))){quit('no', 1)}\n if(!identical(candidate('abcdedcba', 'ab'), list('cdedc', TRUE))){quit('no', 1)}\n if(!identical(candidate('dwik', 'w'), list('dik', FALSE))){quit('no', 1)}\n if(!identical(candidate('a', 'a'), list('', TRUE))){quit('no', 1)}\n if(!identical(candidate('abcdedcba', ''), list('abcdedcba', TRUE))){quit('no', 1)}\n if(!identical(candidate('abcdedcba', 'v'), list('abcdedcba', TRUE))){quit('no', 1)}\n if(!identical(candidate('vabba', 'v'), list('abba', TRUE))){quit('no', 1)}\n if(!identical(candidate('mamma', 'mia'), list('', TRUE))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "r", - "prompt": "# For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\nflip_case <- function(string) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- flip_case\n if(!identical(candidate(''), '')){quit('no', 1)}\n if(!identical(candidate('Hello!'), 'hELLO!')){quit('no', 1)}\n if(!identical(candidate('These violent delights have violent ends'), 'tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "r", - "prompt": "# You are given a string s.\n# if s[i] is a letter, reverse its case from lower to upper or vise versa, \n# otherwise keep it as it is.\n# If the string contains no letters, reverse the string.\n# The function should return the resulted string.\n# Examples\nsolve <- function(s) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- solve\n if(!identical(candidate('AsDf'), 'aSdF')){quit('no', 1)}\n if(!identical(candidate('1234'), '4321')){quit('no', 1)}\n if(!identical(candidate('ab'), 'AB')){quit('no', 1)}\n if(!identical(candidate('#a@C'), '#A@c')){quit('no', 1)}\n if(!identical(candidate('#AsdfW^45'), '#aSDFw^45')){quit('no', 1)}\n if(!identical(candidate('#6@2'), '2@6#')){quit('no', 1)}\n if(!identical(candidate('#$a^D'), '#$A^d')){quit('no', 1)}\n if(!identical(candidate('#ccc'), '#CCC')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "r", - "prompt": "# Filter an input list of strings only for ones that start with a given prefix.\nfilter_by_prefix <- function(strings, prefix) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- filter_by_prefix\n if(!identical(candidate(c(), 'john'), list())){quit('no', 1)}\n if(!identical(candidate(c('xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'), 'xxx'), list('xxx', 'xxxAAA', 'xxx'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "r", - "prompt": "# This function takes two positive numbers x and y and returns the\n# biggest even integer number that is in the range [x, y] inclusive. If \n# there's no such number, then the function should return -1.\n# For example:\nchoose_num <- function(x, y) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- choose_num\n if(!identical(candidate(12, 15), 14)){quit('no', 1)}\n if(!identical(candidate(13, 12), -1)){quit('no', 1)}\n if(!identical(candidate(33, 12354), 12354)){quit('no', 1)}\n if(!identical(candidate(5234, 5233), -1)){quit('no', 1)}\n if(!identical(candidate(6, 29), 28)){quit('no', 1)}\n if(!identical(candidate(27, 10), -1)){quit('no', 1)}\n if(!identical(candidate(7, 7), -1)){quit('no', 1)}\n if(!identical(candidate(546, 546), 546)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "r", - "prompt": "# You are given a string representing a sentence,\n# the sentence contains some words separated by a space,\n# and you have to return a string that contains the words from the original sentence,\n# whose lengths are prime numbers,\n# the order of the words in the new string should be the same as the original one.\n# Example 1:\n# Example 2:\n# Constraints:\n# * 1 <= len(sentence) <= 100\n# * sentence contains only letters\nwords_in_sentence <- function(sentence) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- words_in_sentence\n if(!identical(candidate('This is a test'), 'is')){quit('no', 1)}\n if(!identical(candidate('lets go for swimming'), 'go for')){quit('no', 1)}\n if(!identical(candidate('there is no place available here'), 'there is no place')){quit('no', 1)}\n if(!identical(candidate('Hi I am Hussein'), 'Hi am Hussein')){quit('no', 1)}\n if(!identical(candidate('go for it'), 'go for it')){quit('no', 1)}\n if(!identical(candidate('here'), '')){quit('no', 1)}\n if(!identical(candidate('here is'), 'is')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "r", - "prompt": "# Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\nintersperse <- function(numbers, delimeter) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- intersperse\n if(!identical(candidate(c(), 7), list())){quit('no', 1)}\n if(!identical(candidate(c(5, 6, 3, 2), 8), list(5, 8, 6, 8, 3, 8, 2))){quit('no', 1)}\n if(!identical(candidate(c(2, 2, 2), 2), list(2, 2, 2, 2, 2))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "r", - "prompt": "# Your task is to write a function that returns true if a number x is a simple\n# power of n and false in other cases.\n# x is a simple power of n if n**int=x\n# For example:\nis_simple_power <- function(x, n) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- is_simple_power\n if(!identical(candidate(16, 2), TRUE)){quit('no', 1)}\n if(!identical(candidate(143214, 16), FALSE)){quit('no', 1)}\n if(!identical(candidate(4, 2), TRUE)){quit('no', 1)}\n if(!identical(candidate(9, 3), TRUE)){quit('no', 1)}\n if(!identical(candidate(16, 4), TRUE)){quit('no', 1)}\n if(!identical(candidate(24, 2), FALSE)){quit('no', 1)}\n if(!identical(candidate(128, 4), FALSE)){quit('no', 1)}\n if(!identical(candidate(12, 6), FALSE)){quit('no', 1)}\n if(!identical(candidate(1, 1), TRUE)){quit('no', 1)}\n if(!identical(candidate(1, 12), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "r", - "prompt": "# Write a function that returns true if the given number is the multiplication of 3 prime numbers\n# and false otherwise.\n# Knowing that (a) is less then 100. \n# Example:\n# 30 = 2 * 3 * 5\nis_multiply_prime <- function(a) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- is_multiply_prime\n if(!identical(candidate(5), FALSE)){quit('no', 1)}\n if(!identical(candidate(30), TRUE)){quit('no', 1)}\n if(!identical(candidate(8), TRUE)){quit('no', 1)}\n if(!identical(candidate(10), FALSE)){quit('no', 1)}\n if(!identical(candidate(125), TRUE)){quit('no', 1)}\n if(!identical(candidate(105), TRUE)){quit('no', 1)}\n if(!identical(candidate(126), FALSE)){quit('no', 1)}\n if(!identical(candidate(729), FALSE)){quit('no', 1)}\n if(!identical(candidate(891), FALSE)){quit('no', 1)}\n if(!identical(candidate(1001), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "r", - "prompt": "# Given the lengths of the three sides of a triangle. Return True if the three\n# sides form a right-angled triangle, False otherwise.\n# A right-angled triangle is a triangle in which one angle is right angle or \n# 90 degree.\n# Example:\nright_angle_triangle <- function(a, b, c) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- right_angle_triangle\n if(!identical(candidate(3, 4, 5), TRUE)){quit('no', 1)}\n if(!identical(candidate(1, 2, 3), FALSE)){quit('no', 1)}\n if(!identical(candidate(10, 6, 8), TRUE)){quit('no', 1)}\n if(!identical(candidate(2, 2, 2), FALSE)){quit('no', 1)}\n if(!identical(candidate(7, 24, 25), TRUE)){quit('no', 1)}\n if(!identical(candidate(10, 5, 7), FALSE)){quit('no', 1)}\n if(!identical(candidate(5, 12, 13), TRUE)){quit('no', 1)}\n if(!identical(candidate(15, 8, 17), TRUE)){quit('no', 1)}\n if(!identical(candidate(48, 55, 73), TRUE)){quit('no', 1)}\n if(!identical(candidate(1, 1, 1), FALSE)){quit('no', 1)}\n if(!identical(candidate(2, 2, 10), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "r", - "prompt": "# Create a function that takes 3 numbers.\n# Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n# Returns false in any other cases.\n# Examples\nany_int <- function(x, y, z) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- any_int\n if(!identical(candidate(2, 3, 1), TRUE)){quit('no', 1)}\n if(!identical(candidate(2.5, 2, 3), FALSE)){quit('no', 1)}\n if(!identical(candidate(1.5, 5, 3.5), FALSE)){quit('no', 1)}\n if(!identical(candidate(2, 6, 2), FALSE)){quit('no', 1)}\n if(!identical(candidate(4, 2, 2), TRUE)){quit('no', 1)}\n if(!identical(candidate(2.2, 2.2, 2.2), FALSE)){quit('no', 1)}\n if(!identical(candidate(-4, 6, 2), TRUE)){quit('no', 1)}\n if(!identical(candidate(2, 1, 1), TRUE)){quit('no', 1)}\n if(!identical(candidate(3, 4, 7), TRUE)){quit('no', 1)}\n if(!identical(candidate(3.0, 4, 7), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "r", - "prompt": "# This function takes a list l and returns a list l' such that\n# l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n# to the values of the corresponding indicies of l, but sorted.\nsort_third <- function(l) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- sort_third\n if(!identical(candidate(c(5, 6, 3, 4, 8, 9, 2)), list(2, 6, 3, 4, 8, 9, 5))){quit('no', 1)}\n if(!identical(candidate(c(5, 8, 3, 4, 6, 9, 2)), list(2, 8, 3, 4, 6, 9, 5))){quit('no', 1)}\n if(!identical(candidate(c(5, 6, 9, 4, 8, 3, 2)), list(2, 6, 9, 4, 8, 3, 5))){quit('no', 1)}\n if(!identical(candidate(c(5, 6, 3, 4, 8, 9, 2, 1)), list(2, 6, 3, 4, 8, 9, 5, 1))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_53_add", - "language": "r", - "prompt": "# Add two numbers x and y\nadd <- function(x, y) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- add\n if(!identical(candidate(0, 1), 1)){quit('no', 1)}\n if(!identical(candidate(1, 0), 1)){quit('no', 1)}\n if(!identical(candidate(2, 3), 5)){quit('no', 1)}\n if(!identical(candidate(5, 7), 12)){quit('no', 1)}\n if(!identical(candidate(7, 5), 12)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_69_search", - "language": "r", - "prompt": "# You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n# zero, and has a frequency greater than or equal to the value of the integer itself. \n# The frequency of an integer is the number of times it appears in the list.\n# If no such a value exist, return -1.\n# Examples:\nsearch <- function(lst) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- search\n if(!identical(candidate(c(5, 5, 5, 5, 1)), 1)){quit('no', 1)}\n if(!identical(candidate(c(4, 1, 4, 1, 4, 4)), 4)){quit('no', 1)}\n if(!identical(candidate(c(3, 3)), -1)){quit('no', 1)}\n if(!identical(candidate(c(8, 8, 8, 8, 8, 8, 8, 8)), 8)){quit('no', 1)}\n if(!identical(candidate(c(2, 3, 3, 2, 2)), 2)){quit('no', 1)}\n if(!identical(candidate(c(2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1)), 1)){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 8, 2)), 2)){quit('no', 1)}\n if(!identical(candidate(c(6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10)), 1)){quit('no', 1)}\n if(!identical(candidate(c(8, 8, 3, 6, 5, 6, 4)), -1)){quit('no', 1)}\n if(!identical(candidate(c(6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9)), 1)){quit('no', 1)}\n if(!identical(candidate(c(1, 9, 10, 1, 3)), 1)){quit('no', 1)}\n if(!identical(candidate(c(6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10)), 5)){quit('no', 1)}\n if(!identical(candidate(c(1)), 1)){quit('no', 1)}\n if(!identical(candidate(c(8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5)), 4)){quit('no', 1)}\n if(!identical(candidate(c(2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10)), 2)){quit('no', 1)}\n if(!identical(candidate(c(1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3)), 1)){quit('no', 1)}\n if(!identical(candidate(c(9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4)), 4)){quit('no', 1)}\n if(!identical(candidate(c(2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7)), 4)){quit('no', 1)}\n if(!identical(candidate(c(9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1)), 2)){quit('no', 1)}\n if(!identical(candidate(c(5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8)), -1)){quit('no', 1)}\n if(!identical(candidate(c(10)), -1)){quit('no', 1)}\n if(!identical(candidate(c(9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2)), 2)){quit('no', 1)}\n if(!identical(candidate(c(5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8)), 1)){quit('no', 1)}\n if(!identical(candidate(c(7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6)), 1)){quit('no', 1)}\n if(!identical(candidate(c(3, 10, 10, 9, 2)), -1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "r", - "prompt": "# Write a function that takes a string and returns True if the string\n# length is a prime number or False otherwise\n# Examples\nprime_length <- function(string) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- prime_length\n if(!identical(candidate('Hello'), TRUE)){quit('no', 1)}\n if(!identical(candidate('abcdcba'), TRUE)){quit('no', 1)}\n if(!identical(candidate('kittens'), TRUE)){quit('no', 1)}\n if(!identical(candidate('orange'), FALSE)){quit('no', 1)}\n if(!identical(candidate('wow'), TRUE)){quit('no', 1)}\n if(!identical(candidate('world'), TRUE)){quit('no', 1)}\n if(!identical(candidate('MadaM'), TRUE)){quit('no', 1)}\n if(!identical(candidate('Wow'), TRUE)){quit('no', 1)}\n if(!identical(candidate(''), FALSE)){quit('no', 1)}\n if(!identical(candidate('HI'), TRUE)){quit('no', 1)}\n if(!identical(candidate('go'), TRUE)){quit('no', 1)}\n if(!identical(candidate('gogo'), FALSE)){quit('no', 1)}\n if(!identical(candidate('aaaaaaaaaaaaaaa'), FALSE)){quit('no', 1)}\n if(!identical(candidate('Madam'), TRUE)){quit('no', 1)}\n if(!identical(candidate('M'), FALSE)){quit('no', 1)}\n if(!identical(candidate('0'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_58_common", - "language": "r", - "prompt": "# Return sorted unique common elements for two lists.\ncommon <- function(l1, l2) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- common\n if(!identical(candidate(c(1, 4, 3, 34, 653, 2, 5), c(5, 7, 1, 5, 9, 653, 121)), list(1, 5, 653))){quit('no', 1)}\n if(!identical(candidate(c(5, 3, 2, 8), c(3, 2)), list(2, 3))){quit('no', 1)}\n if(!identical(candidate(c(4, 3, 2, 8), c(3, 2, 4)), list(2, 3, 4))){quit('no', 1)}\n if(!identical(candidate(c(4, 3, 2, 8), c()), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "r", - "prompt": "# The Brazilian factorial is defined as:\n# brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n# where n > 0\n# For example:\n# The function will receive an integer as input and should return the special\n# factorial of this integer.\nspecial_factorial <- function(n) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- special_factorial\n if(!identical(candidate(4), 288)){quit('no', 1)}\n if(!identical(candidate(5), 34560)){quit('no', 1)}\n if(!identical(candidate(7), 125411328000)){quit('no', 1)}\n if(!identical(candidate(1), 1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "r", - "prompt": "# In this problem, you will implement a function that takes two lists of numbers,\n# and determines whether it is possible to perform an exchange of elements\n# between them to make lst1 a list of only even numbers.\n# There is no limit on the number of exchanged elements between lst1 and lst2.\n# If it is possible to exchange elements between the lst1 and lst2 to make\n# all the elements of lst1 to be even, return \"YES\".\n# Otherwise, return \"NO\".\n# For example:\n# It is assumed that the input lists will be non-empty.\nexchange <- function(lst1, lst2) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- exchange\n if(!identical(candidate(c(1, 2, 3, 4), c(1, 2, 3, 4)), 'YES')){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4), c(1, 5, 3, 4)), 'NO')){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4), c(2, 1, 4, 3)), 'YES')){quit('no', 1)}\n if(!identical(candidate(c(5, 7, 3), c(2, 6, 4)), 'YES')){quit('no', 1)}\n if(!identical(candidate(c(5, 7, 3), c(2, 6, 3)), 'NO')){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 6, 1, 8, 9), c(3, 5, 5, 1, 1, 1)), 'NO')){quit('no', 1)}\n if(!identical(candidate(c(100, 200), c(200, 200)), 'YES')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "r", - "prompt": "# Given a non-empty array of integers arr and an integer k, return\n# the sum of the elements with at most two digits from the first k elements of arr.\n# Example:\n# Constraints:\n# 1. 1 <= len(arr) <= 100\n# 2. 1 <= k <= len(arr)\nadd_elements <- function(arr, k) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- add_elements\n if(!identical(candidate(c(1, -2, -3, 41, 57, 76, 87, 88, 99), 3), -4)){quit('no', 1)}\n if(!identical(candidate(c(111, 121, 3, 4000, 5, 6), 2), 0)){quit('no', 1)}\n if(!identical(candidate(c(11, 21, 3, 90, 5, 6, 7, 8, 9), 4), 125)){quit('no', 1)}\n if(!identical(candidate(c(111, 21, 3, 4000, 5, 6, 7, 8, 9), 4), 24)){quit('no', 1)}\n if(!identical(candidate(c(1), 1), 1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "r", - "prompt": "# A simple program which should return the value of x if n is \n# a prime number and should return the value of y otherwise.\n# Examples:\nx_or_y <- function(n, x, y) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- x_or_y\n if(!identical(candidate(7, 34, 12), 34)){quit('no', 1)}\n if(!identical(candidate(15, 8, 5), 5)){quit('no', 1)}\n if(!identical(candidate(3, 33, 5212), 33)){quit('no', 1)}\n if(!identical(candidate(1259, 3, 52), 3)){quit('no', 1)}\n if(!identical(candidate(7919, -1, 12), -1)){quit('no', 1)}\n if(!identical(candidate(3609, 1245, 583), 583)){quit('no', 1)}\n if(!identical(candidate(91, 56, 129), 129)){quit('no', 1)}\n if(!identical(candidate(6, 34, 1234), 1234)){quit('no', 1)}\n if(!identical(candidate(1, 2, 0), 0)){quit('no', 1)}\n if(!identical(candidate(2, 2, 0), 2)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "r", - "prompt": "# Given length of a side and high return area for a triangle.\ntriangle_area <- function(a, h) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- triangle_area\n if(!identical(candidate(5, 3), 7.5)){quit('no', 1)}\n if(!identical(candidate(2, 2), 2.0)){quit('no', 1)}\n if(!identical(candidate(10, 8), 40.0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "r", - "prompt": "# Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n# the last couple centuries. However, what people don't know is Tribonacci sequence.\n# Tribonacci sequence is defined by the recurrence:\n# tri(1) = 3\n# tri(n) = 1 + n / 2, if n is even.\n# tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n# For example:\n# tri(2) = 1 + (2 / 2) = 2\n# tri(4) = 3\n# tri(3) = tri(2) + tri(1) + tri(4)\n# = 2 + 3 + 3 = 8 \n# You are given a non-negative integer number n, you have to a return a list of the \n# first n + 1 numbers of the Tribonacci sequence.\n# Examples:\ntri <- function(n) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- tri\n if(!identical(candidate(3), list(1, 3, 2, 8))){quit('no', 1)}\n if(!identical(candidate(4), list(1, 3, 2, 8, 3))){quit('no', 1)}\n if(!identical(candidate(5), list(1, 3, 2, 8, 3, 15))){quit('no', 1)}\n if(!identical(candidate(6), list(1, 3, 2, 8, 3, 15, 4))){quit('no', 1)}\n if(!identical(candidate(7), list(1, 3, 2, 8, 3, 15, 4, 24))){quit('no', 1)}\n if(!identical(candidate(8), list(1, 3, 2, 8, 3, 15, 4, 24, 5))){quit('no', 1)}\n if(!identical(candidate(9), list(1, 3, 2, 8, 3, 15, 4, 24, 5, 35))){quit('no', 1)}\n if(!identical(candidate(20), list(1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11))){quit('no', 1)}\n if(!identical(candidate(0), list(1))){quit('no', 1)}\n if(!identical(candidate(1), list(1, 3))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "r", - "prompt": "# You are given a list of two strings, both strings consist of open\n# parentheses '(' or close parentheses ')' only.\n# Your job is to check if it is possible to concatenate the two strings in\n# some order, that the resulting string will be good.\n# A string S is considered to be good if and only if all parentheses in S\n# are balanced. For example: the string '(())()' is good, while the string\n# '())' is not.\n# Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n# Examples:\nmatch_parens <- function(lst) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- match_parens\n if(!identical(candidate(c('()(', ')')), 'Yes')){quit('no', 1)}\n if(!identical(candidate(c(')', ')')), 'No')){quit('no', 1)}\n if(!identical(candidate(c('(()(())', '())())')), 'No')){quit('no', 1)}\n if(!identical(candidate(c(')())', '(()()(')), 'Yes')){quit('no', 1)}\n if(!identical(candidate(c('(())))', '(()())((')), 'Yes')){quit('no', 1)}\n if(!identical(candidate(c('()', '())')), 'No')){quit('no', 1)}\n if(!identical(candidate(c('(()(', '()))()')), 'Yes')){quit('no', 1)}\n if(!identical(candidate(c('((((', '((())')), 'No')){quit('no', 1)}\n if(!identical(candidate(c(')(()', '(()(')), 'No')){quit('no', 1)}\n if(!identical(candidate(c(')(', ')(')), 'No')){quit('no', 1)}\n if(!identical(candidate(c('(', ')')), 'Yes')){quit('no', 1)}\n if(!identical(candidate(c(')', '(')), 'Yes')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "r", - "prompt": "# From a list of integers, remove all elements that occur more than once.\n# Keep order of elements left the same as in the input.\nremove_duplicates <- function(numbers) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- remove_duplicates\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4)), list(1, 2, 3, 4))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 2, 4, 3, 5)), list(1, 4, 5))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "r", - "prompt": "# Return a greatest common divisor of two integers a and b\ngreatest_common_divisor <- function(a, b) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- greatest_common_divisor\n if(!identical(candidate(3, 7), 1)){quit('no', 1)}\n if(!identical(candidate(10, 15), 5)){quit('no', 1)}\n if(!identical(candidate(49, 14), 7)){quit('no', 1)}\n if(!identical(candidate(144, 60), 12)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "r", - "prompt": "# Checks if given string is a palindrome\nis_palindrome <- function(text) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- is_palindrome\n if(!identical(candidate(''), TRUE)){quit('no', 1)}\n if(!identical(candidate('aba'), TRUE)){quit('no', 1)}\n if(!identical(candidate('aaaaa'), TRUE)){quit('no', 1)}\n if(!identical(candidate('zbcd'), FALSE)){quit('no', 1)}\n if(!identical(candidate('xywyx'), TRUE)){quit('no', 1)}\n if(!identical(candidate('xywyz'), FALSE)){quit('no', 1)}\n if(!identical(candidate('xywzx'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "r", - "prompt": "# xs represent coefficients of a polynomial.\n# xs[0] + xs[1] * x + xs[2] * x^2 + ....\n# Return derivative of this polynomial in the same form.\nderivative <- function(xs) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- derivative\n if(!identical(candidate(c(3, 1, 2, 4, 5)), list(1, 4, 12, 20))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3)), list(2, 6))){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 1)), list(2, 2))){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 1, 0, 4)), list(2, 2, 0, 16))){quit('no', 1)}\n if(!identical(candidate(c(1)), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "r", - "prompt": "# In this task, you will be given a string that represents a number of apples and oranges \n# that are distributed in a basket of fruit this basket contains \n# apples, oranges, and mango fruits. Given the string that represents the total number of \n# the oranges and apples and an integer that represent the total number of the fruits \n# in the basket return the number of the mango fruits in the basket.\n# for examble:\nfruit_distribution <- function(s, n) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- fruit_distribution\n if(!identical(candidate('5 apples and 6 oranges', 19), 8)){quit('no', 1)}\n if(!identical(candidate('5 apples and 6 oranges', 21), 10)){quit('no', 1)}\n if(!identical(candidate('0 apples and 1 oranges', 3), 2)){quit('no', 1)}\n if(!identical(candidate('1 apples and 0 oranges', 3), 2)){quit('no', 1)}\n if(!identical(candidate('2 apples and 3 oranges', 100), 95)){quit('no', 1)}\n if(!identical(candidate('2 apples and 3 oranges', 5), 0)){quit('no', 1)}\n if(!identical(candidate('1 apples and 100 oranges', 120), 19)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "r", - "prompt": "# Write a function that takes an integer a and returns True \n# if this ingeger is a cube of some integer number.\n# Note: you may assume the input is always valid.\n# Examples:\niscube <- function(a) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- iscube\n if(!identical(candidate(1), TRUE)){quit('no', 1)}\n if(!identical(candidate(2), FALSE)){quit('no', 1)}\n if(!identical(candidate(-1), TRUE)){quit('no', 1)}\n if(!identical(candidate(64), TRUE)){quit('no', 1)}\n if(!identical(candidate(180), FALSE)){quit('no', 1)}\n if(!identical(candidate(1000), TRUE)){quit('no', 1)}\n if(!identical(candidate(0), TRUE)){quit('no', 1)}\n if(!identical(candidate(1729), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "r", - "prompt": "# In this Kata, you have to sort an array of non-negative integers according to\n# number of ones in their binary representation in ascending order.\n# For similar number of ones, sort based on decimal value.\n# It must be implemented like this:\nsort_array <- function(arr) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- sort_array\n if(!identical(candidate(c(1, 5, 2, 3, 4)), list(1, 2, 4, 3, 5))){quit('no', 1)}\n if(!identical(candidate(c(-2, -3, -4, -5, -6)), list(-4, -2, -6, -5, -3))){quit('no', 1)}\n if(!identical(candidate(c(1, 0, 2, 3, 4)), list(0, 1, 2, 4, 3))){quit('no', 1)}\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4)), list(2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77))){quit('no', 1)}\n if(!identical(candidate(c(3, 6, 44, 12, 32, 5)), list(32, 3, 5, 6, 12, 44))){quit('no', 1)}\n if(!identical(candidate(c(2, 4, 8, 16, 32)), list(2, 4, 8, 16, 32))){quit('no', 1)}\n if(!identical(candidate(c(2, 4, 8, 16, 32)), list(2, 4, 8, 16, 32))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "r", - "prompt": "# Given a list of strings, where each string consists of only digits, return a list.\n# Each element i of the output should be \"the number of odd elements in the\n# string i of the input.\" where all the i's should be replaced by the number\n# of odd digits in the i'th string of the input.\nodd_count <- function(lst) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- odd_count\n if(!identical(candidate(c('1234567')), list('the number of odd elements 4n the str4ng 4 of the 4nput.'))){quit('no', 1)}\n if(!identical(candidate(c('3', '11111111')), list('the number of odd elements 1n the str1ng 1 of the 1nput.', 'the number of odd elements 8n the str8ng 8 of the 8nput.'))){quit('no', 1)}\n if(!identical(candidate(c('271', '137', '314')), list('the number of odd elements 2n the str2ng 2 of the 2nput.', 'the number of odd elements 3n the str3ng 3 of the 3nput.', 'the number of odd elements 2n the str2ng 2 of the 2nput.'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "r", - "prompt": "# brackets is a string of \"(\" and \")\".\n# return True if every opening bracket has a corresponding closing bracket.\ncorrect_bracketing <- function(brackets) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- correct_bracketing\n if(!identical(candidate('()'), TRUE)){quit('no', 1)}\n if(!identical(candidate('(()())'), TRUE)){quit('no', 1)}\n if(!identical(candidate('()()(()())()'), TRUE)){quit('no', 1)}\n if(!identical(candidate('()()((()()())())(()()(()))'), TRUE)){quit('no', 1)}\n if(!identical(candidate('((()())))'), FALSE)){quit('no', 1)}\n if(!identical(candidate(')(()'), FALSE)){quit('no', 1)}\n if(!identical(candidate('('), FALSE)){quit('no', 1)}\n if(!identical(candidate('(((('), FALSE)){quit('no', 1)}\n if(!identical(candidate(')'), FALSE)){quit('no', 1)}\n if(!identical(candidate('(()'), FALSE)){quit('no', 1)}\n if(!identical(candidate('()()(()())())(()'), FALSE)){quit('no', 1)}\n if(!identical(candidate('()()(()())()))()'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "r", - "prompt": "# Task\n# Write a function that takes a string as input and returns the sum of the upper characters only'\n# ASCII codes.\n# Examples:\ndigitSum <- function(s) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- digitSum\n if(!identical(candidate(''), 0)){quit('no', 1)}\n if(!identical(candidate('abAB'), 131)){quit('no', 1)}\n if(!identical(candidate('abcCd'), 67)){quit('no', 1)}\n if(!identical(candidate('helloE'), 69)){quit('no', 1)}\n if(!identical(candidate('woArBld'), 131)){quit('no', 1)}\n if(!identical(candidate('aAaaaXa'), 153)){quit('no', 1)}\n if(!identical(candidate(' How are yOu?'), 151)){quit('no', 1)}\n if(!identical(candidate('You arE Very Smart'), 327)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "r", - "prompt": "# Write a function that accepts a list of strings as a parameter,\n# deletes the strings that have odd lengths from it,\n# and returns the resulted list with a sorted order,\n# The list is always a list of strings and never an array of numbers,\n# and it may contain duplicates.\n# The order of the list should be ascending by length of each word, and you\n# should return the list sorted by that rule.\n# If two words have the same length, sort the list alphabetically.\n# The function should return a list of strings in sorted order.\n# You may assume that all words will have the same length.\n# For example:\nsorted_list_sum <- function(lst) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- sorted_list_sum\n if(!identical(candidate(c('aa', 'a', 'aaa')), list('aa'))){quit('no', 1)}\n if(!identical(candidate(c('school', 'AI', 'asdf', 'b')), list('AI', 'asdf', 'school'))){quit('no', 1)}\n if(!identical(candidate(c('d', 'b', 'c', 'a')), list())){quit('no', 1)}\n if(!identical(candidate(c('d', 'dcba', 'abcd', 'a')), list('abcd', 'dcba'))){quit('no', 1)}\n if(!identical(candidate(c('AI', 'ai', 'au')), list('AI', 'ai', 'au'))){quit('no', 1)}\n if(!identical(candidate(c('a', 'b', 'b', 'c', 'c', 'a')), list())){quit('no', 1)}\n if(!identical(candidate(c('aaaa', 'bbbb', 'dd', 'cc')), list('cc', 'dd', 'aaaa', 'bbbb'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "r", - "prompt": "# You are given an array arr of integers and you need to return\n# sum of magnitudes of integers multiplied by product of all signs\n# of each number in the array, represented by 1, -1 or 0.\n# Note: return None for empty arr.\n# Example:\nprod_signs <- function(arr) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- prod_signs\n if(!identical(candidate(c(1, 2, 2, -4)), -9)){quit('no', 1)}\n if(!identical(candidate(c(0, 1)), 0)){quit('no', 1)}\n if(!identical(candidate(c(1, 1, 1, 2, 3, -1, 1)), -10)){quit('no', 1)}\n if(!identical(candidate(c()), NULL)){quit('no', 1)}\n if(!identical(candidate(c(2, 4, 1, 2, -1, -1, 9)), 20)){quit('no', 1)}\n if(!identical(candidate(c(-1, 1, -1, 1)), 4)){quit('no', 1)}\n if(!identical(candidate(c(-1, 1, 1, 1)), -4)){quit('no', 1)}\n if(!identical(candidate(c(-1, 1, 1, 0)), 0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "r", - "prompt": "# Return list with elements incremented by 1.\nincr_list <- function(l) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- incr_list\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 1)), list(4, 3, 2))){quit('no', 1)}\n if(!identical(candidate(c(5, 2, 5, 2, 3, 3, 9, 0, 123)), list(6, 3, 6, 3, 4, 4, 10, 1, 124))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "r", - "prompt": "# From a given list of integers, generate a list of rolling maximum element found until given moment\n# in the sequence.\nrolling_max <- function(numbers) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- rolling_max\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4)), list(1, 2, 3, 4))){quit('no', 1)}\n if(!identical(candidate(c(4, 3, 2, 1)), list(4, 4, 4, 4))){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 3, 100, 3)), list(3, 3, 3, 100, 100))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "r", - "prompt": "# Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n# separate those group into separate strings and return the list of those.\n# Separate groups are balanced (each open brace is properly closed) and not nested within each other\n# Ignore any spaces in the input string.\nseparate_paren_groups <- function(paren_string) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- separate_paren_groups\n if(!identical(candidate('(()()) ((())) () ((())()())'), list('(()())', '((()))', '()', '((())()())'))){quit('no', 1)}\n if(!identical(candidate('() (()) ((())) (((())))'), list('()', '(())', '((()))', '(((())))'))){quit('no', 1)}\n if(!identical(candidate('(()(())((())))'), list('(()(())((())))'))){quit('no', 1)}\n if(!identical(candidate('( ) (( )) (( )( ))'), list('()', '(())', '(()())'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "r", - "prompt": "# You will be given a string of words separated by commas or spaces. Your task is\n# to split the string into words and return an array of the words.\n# For example:\nwords_string <- function(s) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- words_string\n if(!identical(candidate('Hi, my name is John'), list('Hi', 'my', 'name', 'is', 'John'))){quit('no', 1)}\n if(!identical(candidate('One, two, three, four, five, six'), list('One', 'two', 'three', 'four', 'five', 'six'))){quit('no', 1)}\n if(!identical(candidate('Hi, my name'), list('Hi', 'my', 'name'))){quit('no', 1)}\n if(!identical(candidate('One,, two, three, four, five, six,'), list('One', 'two', 'three', 'four', 'five', 'six'))){quit('no', 1)}\n if(!identical(candidate(''), list())){quit('no', 1)}\n if(!identical(candidate('ahmed , gamal'), list('ahmed', 'gamal'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "r", - "prompt": "# Create a function that takes integers, floats, or strings representing\n# real numbers, and returns the larger variable in its given variable type.\n# Return None if the values are equal.\n# Note: If a real number is represented as a string, the floating point might be . or ,\ncompare_one <- function(a, b) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- compare_one\n if(!identical(candidate(1, 2), 2)){quit('no', 1)}\n if(!identical(candidate(1, 2.5), 2.5)){quit('no', 1)}\n if(!identical(candidate(2, 3), 3)){quit('no', 1)}\n if(!identical(candidate(5, 6), 6)){quit('no', 1)}\n if(!identical(candidate(1, '2,3'), '2,3')){quit('no', 1)}\n if(!identical(candidate('5,1', '6'), '6')){quit('no', 1)}\n if(!identical(candidate('1', '2'), '2')){quit('no', 1)}\n if(!identical(candidate('1', 1), NULL)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "r", - "prompt": "# Filter given list of any python values only for integers\nfilter_integers <- function(values) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- filter_integers\n if(!identical(candidate(list()), list())){quit('no', 1)}\n if(!identical(candidate(list(4, list(), list(), 23.2, 9, 'adasd')), list(4, 9))){quit('no', 1)}\n if(!identical(candidate(list(3, 'c', 3, 3, 'a', 'b')), list(3, 3, 3))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "r", - "prompt": "# This function takes a list l and returns a list l' such that\n# l' is identical to l in the odd indicies, while its values at the even indicies are equal\n# to the values of the even indicies of l, but sorted.\nsort_even <- function(l) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- sort_even\n if(!identical(candidate(c(1, 2, 3)), list(1, 2, 3))){quit('no', 1)}\n if(!identical(candidate(c(5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10)), list(-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123))){quit('no', 1)}\n if(!identical(candidate(c(5, 8, -12, 4, 23, 2, 3, 11, 12, -10)), list(-12, 8, 3, 4, 5, 2, 12, 11, 23, -10))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "r", - "prompt": "# I think we all remember that feeling when the result of some long-awaited\n# event is finally known. The feelings and thoughts you have at that moment are\n# definitely worth noting down and comparing.\n# Your task is to determine if a person correctly guessed the results of a number of matches.\n# You are given two arrays of scores and guesses of equal length, where each index shows a match. \n# Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n# the value is 0, and if not, the value is the absolute difference between the guess and the score.\n# example:\ncompare <- function(game, guess) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- compare\n if(!identical(candidate(c(1, 2, 3, 4, 5, 1), c(1, 2, 3, 4, 2, -2)), list(0, 0, 0, 0, 3, 3))){quit('no', 1)}\n if(!identical(candidate(c(0, 0, 0, 0, 0, 0), c(0, 0, 0, 0, 0, 0)), list(0, 0, 0, 0, 0, 0))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3), c(-1, -2, -3)), list(2, 4, 6))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 5), c(-1, 2, 3, 4)), list(2, 0, 0, 1))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "r", - "prompt": "# Given a positive integer n, return a tuple that has the number of even and odd\n# integer palindromes that fall within the range(1, n), inclusive.\n# Example 1:\n# Explanation:\n# Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n# Example 2:\n# Explanation:\n# Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n# Note:\n# 1. 1 <= n <= 10^3\n# 2. returned tuple has the number of even and odd integer palindromes respectively.\neven_odd_palindrome <- function(n) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- even_odd_palindrome\n if(!identical(candidate(123), list(8, 13))){quit('no', 1)}\n if(!identical(candidate(12), list(4, 6))){quit('no', 1)}\n if(!identical(candidate(3), list(1, 2))){quit('no', 1)}\n if(!identical(candidate(63), list(6, 8))){quit('no', 1)}\n if(!identical(candidate(25), list(5, 6))){quit('no', 1)}\n if(!identical(candidate(19), list(4, 6))){quit('no', 1)}\n if(!identical(candidate(9), list(4, 5))){quit('no', 1)}\n if(!identical(candidate(1), list(0, 1))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "r", - "prompt": "# The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fib4(0) -> 0\n# fib4(1) -> 0\n# fib4(2) -> 2\n# fib4(3) -> 0\n# fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n# Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\nfib4 <- function(n) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- fib4\n if(!identical(candidate(5), 4)){quit('no', 1)}\n if(!identical(candidate(8), 28)){quit('no', 1)}\n if(!identical(candidate(10), 104)){quit('no', 1)}\n if(!identical(candidate(12), 386)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "r", - "prompt": "# Given two positive integers a and b, return the even digits between a\n# and b, in ascending order.\n# For example:\ngenerate_integers <- function(a, b) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- generate_integers\n if(!identical(candidate(2, 10), list(2, 4, 6, 8))){quit('no', 1)}\n if(!identical(candidate(10, 2), list(2, 4, 6, 8))){quit('no', 1)}\n if(!identical(candidate(132, 2), list(2, 4, 6, 8))){quit('no', 1)}\n if(!identical(candidate(17, 89), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "r", - "prompt": "# For a given list of input numbers, calculate Mean Absolute Deviation\n# around the mean of this dataset.\n# Mean Absolute Deviation is the average absolute difference between each\n# element and a centerpoint (mean in this case):\n# MAD = average | x - x_mean |\nmean_absolute_deviation <- function(numbers) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- mean_absolute_deviation\n if(!identical(candidate(c(1.0, 2.0)), 0.5)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.0, 4.0)), 1.0)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.0, 4.0, 5.0)), 1.2)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "r", - "prompt": "# Create a function encrypt that takes a string as an argument and\n# returns a string encrypted with the alphabet being rotated. \n# The alphabet should be rotated in a manner such that the letters \n# shift down by two multiplied to two places.\n# For example:\nencrypt <- function(s) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- encrypt\n if(!identical(candidate('hi'), 'lm')){quit('no', 1)}\n if(!identical(candidate('asdfghjkl'), 'ewhjklnop')){quit('no', 1)}\n if(!identical(candidate('gf'), 'kj')){quit('no', 1)}\n if(!identical(candidate('et'), 'ix')){quit('no', 1)}\n if(!identical(candidate('faewfawefaewg'), 'jeiajeaijeiak')){quit('no', 1)}\n if(!identical(candidate('hellomyfriend'), 'lippsqcjvmirh')){quit('no', 1)}\n if(!identical(candidate('dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh'), 'hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl')){quit('no', 1)}\n if(!identical(candidate('a'), 'e')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "r", - "prompt": "# Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n# The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n# as follows: start with any positive integer n. Then each term is obtained from the \n# previous term as follows: if the previous term is even, the next term is one half of \n# the previous term. If the previous term is odd, the next term is 3 times the previous\n# term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n# Note: \n# 1. Collatz(1) is [1].\n# 2. returned list sorted in increasing order.\n# For example:\n# get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\nget_odd_collatz <- function(n) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- get_odd_collatz\n if(!identical(candidate(14), list(1, 5, 7, 11, 13, 17))){quit('no', 1)}\n if(!identical(candidate(5), list(1, 5))){quit('no', 1)}\n if(!identical(candidate(12), list(1, 3, 5))){quit('no', 1)}\n if(!identical(candidate(1), list(1))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "r", - "prompt": "# Find how many times a given substring can be found in the original string. Count overlaping cases.\nhow_many_times <- function(string, substring) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- how_many_times\n if(!identical(candidate('', 'x'), 0)){quit('no', 1)}\n if(!identical(candidate('xyxyxyx', 'x'), 4)){quit('no', 1)}\n if(!identical(candidate('cacacacac', 'cac'), 4)){quit('no', 1)}\n if(!identical(candidate('john doe', 'john'), 1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "r", - "prompt": "# We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n# numbers in the array will be randomly ordered. Your task is to determine if\n# it is possible to get an array sorted in non-decreasing order by performing \n# the following operation on the given array:\n# You are allowed to perform right shift operation any number of times.\n# One right shift operation means shifting all elements of the array by one\n# position in the right direction. The last element of the array will be moved to\n# the starting position in the array i.e. 0th index. \n# If it is possible to obtain the sorted array by performing the above operation\n# then return True else return False.\n# If the given array is empty then return True.\n# Note: The given list is guaranteed to have unique elements.\n# For Example:\n# Explanation: By performin 2 right shift operations, non-decreasing order can\n# be achieved for the given array.\n# Explanation:It is not possible to get non-decreasing order for the given\n# array by performing any number of right shift operations.\nmove_one_ball <- function(arr) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- move_one_ball\n if(!identical(candidate(c(3, 4, 5, 1, 2)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(3, 5, 10, 1, 2)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(4, 3, 1, 2)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(3, 5, 4, 1, 2)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c()), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "r", - "prompt": "# Write a function which sorts the given list of integers\n# in ascending order according to the sum of their digits.\n# Note: if there are several items with similar sum of their digits,\n# order them based on their index in original list.\n# For example:\norder_by_points <- function(nums) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- order_by_points\n if(!identical(candidate(c(1, 11, -1, -11, -12)), list(-1, -11, 1, -12, 11))){quit('no', 1)}\n if(!identical(candidate(c(1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46)), list(0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457))){quit('no', 1)}\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(1, -11, -32, 43, 54, -98, 2, -3)), list(-3, -32, -98, -11, 1, 2, 43, 54))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)), list(1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9))){quit('no', 1)}\n if(!identical(candidate(c(0, 6, 6, -76, -21, 23, 4)), list(-76, -21, 0, 4, 23, 6, 6))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "r", - "prompt": "# Return list of prime factors of given integer in the order from smallest to largest.\n# Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n# Input number should be equal to the product of all factors\nfactorize <- function(n) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- factorize\n if(!identical(candidate(2), list(2))){quit('no', 1)}\n if(!identical(candidate(4), list(2, 2))){quit('no', 1)}\n if(!identical(candidate(8), list(2, 2, 2))){quit('no', 1)}\n if(!identical(candidate(57), list(3, 19))){quit('no', 1)}\n if(!identical(candidate(3249), list(3, 3, 19, 19))){quit('no', 1)}\n if(!identical(candidate(185193), list(3, 3, 3, 19, 19, 19))){quit('no', 1)}\n if(!identical(candidate(20577), list(3, 19, 19, 19))){quit('no', 1)}\n if(!identical(candidate(18), list(2, 3, 3))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "r", - "prompt": "# Return True if all numbers in the list l are below threshold t.\nbelow_threshold <- function(l, t) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- below_threshold\n if(!identical(candidate(c(1, 2, 4, 10), 100), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 20, 4, 10), 5), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 20, 4, 10), 21), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 20, 4, 10), 22), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 8, 4, 10), 11), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 8, 4, 10), 10), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "r", - "prompt": "# You are given two positive integers n and m, and your task is to compute the\n# average of the integers from n through m (including n and m). \n# Round the answer to the nearest integer and convert that to binary.\n# If n is greater than m, return -1.\n# Example:\nrounded_avg <- function(n, m) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- rounded_avg\n if(!identical(candidate(1, 5), '0b11')){quit('no', 1)}\n if(!identical(candidate(7, 13), '0b1010')){quit('no', 1)}\n if(!identical(candidate(964, 977), '0b1111001010')){quit('no', 1)}\n if(!identical(candidate(996, 997), '0b1111100100')){quit('no', 1)}\n if(!identical(candidate(560, 851), '0b1011000010')){quit('no', 1)}\n if(!identical(candidate(185, 546), '0b101101110')){quit('no', 1)}\n if(!identical(candidate(362, 496), '0b110101101')){quit('no', 1)}\n if(!identical(candidate(350, 902), '0b1001110010')){quit('no', 1)}\n if(!identical(candidate(197, 233), '0b11010111')){quit('no', 1)}\n if(!identical(candidate(7, 5), -1)){quit('no', 1)}\n if(!identical(candidate(5, 1), -1)){quit('no', 1)}\n if(!identical(candidate(5, 5), '0b101')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "r", - "prompt": "# Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n# For each of the group, output the deepest level of nesting of parentheses.\n# E.g. (()()) has maximum two levels of nesting while ((())) has three.\nparse_nested_parens <- function(paren_string) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- parse_nested_parens\n if(!identical(candidate('(()()) ((())) () ((())()())'), list(2, 3, 1, 3))){quit('no', 1)}\n if(!identical(candidate('() (()) ((())) (((())))'), list(1, 2, 3, 4))){quit('no', 1)}\n if(!identical(candidate('(()(())((())))'), list(4))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "r", - "prompt": "# Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n# Examples\nsolution <- function(lst) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- solution\n if(!identical(candidate(c(5, 8, 7, 1)), 12)){quit('no', 1)}\n if(!identical(candidate(c(3, 3, 3, 3, 3)), 9)){quit('no', 1)}\n if(!identical(candidate(c(30, 13, 24, 321)), 0)){quit('no', 1)}\n if(!identical(candidate(c(5, 9)), 5)){quit('no', 1)}\n if(!identical(candidate(c(2, 4, 8)), 0)){quit('no', 1)}\n if(!identical(candidate(c(30, 13, 23, 32)), 23)){quit('no', 1)}\n if(!identical(candidate(c(3, 13, 2, 9)), 3)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "r", - "prompt": "# You are given a positive integer n. You have to create an integer array a of length n.\n# For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n# Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n# and a[i] + a[j] + a[k] is a multiple of 3.\n# Example :\n# Explanation: \n# a = [1, 3, 7, 13, 21]\n# The only valid triple is (1, 7, 13).\nget_max_triples <- function(n) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- get_max_triples\n if(!identical(candidate(5), 1)){quit('no', 1)}\n if(!identical(candidate(6), 4)){quit('no', 1)}\n if(!identical(candidate(10), 36)){quit('no', 1)}\n if(!identical(candidate(100), 53361)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "r", - "prompt": "# There are eight planets in our solar system: the closerst to the Sun \n# is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n# Uranus, Neptune.\n# Write a function that takes two planet names as strings planet1 and planet2. \n# The function should return a tuple containing all planets whose orbits are \n# located between the orbit of planet1 and the orbit of planet2, sorted by \n# the proximity to the sun. \n# The function should return an empty tuple if planet1 or planet2\n# are not correct planet names. \n# Examples\nbf <- function(planet1, planet2) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- bf\n if(!identical(candidate('Jupiter', 'Neptune'), list('Saturn', 'Uranus'))){quit('no', 1)}\n if(!identical(candidate('Earth', 'Mercury'), list('Venus'))){quit('no', 1)}\n if(!identical(candidate('Mercury', 'Uranus'), list('Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn'))){quit('no', 1)}\n if(!identical(candidate('Neptune', 'Venus'), list('Earth', 'Mars', 'Jupiter', 'Saturn', 'Uranus'))){quit('no', 1)}\n if(!identical(candidate('Earth', 'Earth'), list())){quit('no', 1)}\n if(!identical(candidate('Mars', 'Earth'), list())){quit('no', 1)}\n if(!identical(candidate('Jupiter', 'Makemake'), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "r", - "prompt": "# You are given a list of integers.\n# Write a function next_smallest() that returns the 2nd smallest element of the list.\n# Return None if there is no such element.\nnext_smallest <- function(lst) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- next_smallest\n if(!identical(candidate(c(1, 2, 3, 4, 5)), 2)){quit('no', 1)}\n if(!identical(candidate(c(5, 1, 4, 3, 2)), 2)){quit('no', 1)}\n if(!identical(candidate(c()), NULL)){quit('no', 1)}\n if(!identical(candidate(c(1, 1)), NULL)){quit('no', 1)}\n if(!identical(candidate(c(1, 1, 1, 1, 0)), 1)){quit('no', 1)}\n if(!identical(candidate(c(1, 1)), NULL)){quit('no', 1)}\n if(!identical(candidate(c(-35, 34, 12, -45)), -35)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "r", - "prompt": "# Input is a space-delimited string of numberals from 'zero' to 'nine'.\n# Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n# Return the string with numbers sorted from smallest to largest\nsort_numbers <- function(numbers) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- sort_numbers\n if(!identical(candidate(''), '')){quit('no', 1)}\n if(!identical(candidate('three'), 'three')){quit('no', 1)}\n if(!identical(candidate('three five nine'), 'three five nine')){quit('no', 1)}\n if(!identical(candidate('five zero four seven nine eight'), 'zero four five seven eight nine')){quit('no', 1)}\n if(!identical(candidate('six five four three two one zero'), 'zero one two three four five six')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "r", - "prompt": "# You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\ncycpattern_check <- function(a, b) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- cycpattern_check\n if(!identical(candidate('xyzw', 'xyw'), FALSE)){quit('no', 1)}\n if(!identical(candidate('yello', 'ell'), TRUE)){quit('no', 1)}\n if(!identical(candidate('whattup', 'ptut'), FALSE)){quit('no', 1)}\n if(!identical(candidate('efef', 'fee'), TRUE)){quit('no', 1)}\n if(!identical(candidate('abab', 'aabb'), FALSE)){quit('no', 1)}\n if(!identical(candidate('winemtt', 'tinem'), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "r", - "prompt": "# You will be given a number in decimal form and your task is to convert it to\n# binary format. The function should return a string, with each character representing a binary\n# number. Each character in the string will be '0' or '1'.\n# There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n# The extra characters are there to help with the format.\n# Examples:\ndecimal_to_binary <- function(decimal) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- decimal_to_binary\n if(!identical(candidate(0), 'db0db')){quit('no', 1)}\n if(!identical(candidate(32), 'db100000db')){quit('no', 1)}\n if(!identical(candidate(103), 'db1100111db')){quit('no', 1)}\n if(!identical(candidate(15), 'db1111db')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "r", - "prompt": "# Filter an input list of strings only for ones that contain given substring\nfilter_by_substring <- function(strings, substring) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- filter_by_substring\n if(!identical(candidate(c(), 'john'), list())){quit('no', 1)}\n if(!identical(candidate(c('xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'), 'xxx'), list('xxx', 'xxxAAA', 'xxx'))){quit('no', 1)}\n if(!identical(candidate(c('xxx', 'asd', 'aaaxxy', 'john doe', 'xxxAAA', 'xxx'), 'xx'), list('xxx', 'aaaxxy', 'xxxAAA', 'xxx'))){quit('no', 1)}\n if(!identical(candidate(c('grunt', 'trumpet', 'prune', 'gruesome'), 'run'), list('grunt', 'prune'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "r", - "prompt": "# Given an integer. return a tuple that has the number of even and odd digits respectively.\n# Example:\neven_odd_count <- function(num) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- even_odd_count\n if(!identical(candidate(7), list(0, 1))){quit('no', 1)}\n if(!identical(candidate(-78), list(1, 1))){quit('no', 1)}\n if(!identical(candidate(3452), list(2, 2))){quit('no', 1)}\n if(!identical(candidate(346211), list(3, 3))){quit('no', 1)}\n if(!identical(candidate(-345821), list(3, 3))){quit('no', 1)}\n if(!identical(candidate(-2), list(1, 0))){quit('no', 1)}\n if(!identical(candidate(-45347), list(2, 3))){quit('no', 1)}\n if(!identical(candidate(0), list(1, 0))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "r", - "prompt": "# Write a function that accepts a list of strings.\n# The list contains different words. Return the word with maximum number\n# of unique characters. If multiple strings have maximum number of unique\n# characters, return the one which comes first in lexicographical order.\nfind_max <- function(words) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- find_max\n if(!identical(candidate(c('name', 'of', 'string')), 'string')){quit('no', 1)}\n if(!identical(candidate(c('name', 'enam', 'game')), 'enam')){quit('no', 1)}\n if(!identical(candidate(c('aaaaaaa', 'bb', 'cc')), 'aaaaaaa')){quit('no', 1)}\n if(!identical(candidate(c('abc', 'cba')), 'abc')){quit('no', 1)}\n if(!identical(candidate(c('play', 'this', 'game', 'of', 'footbott')), 'footbott')){quit('no', 1)}\n if(!identical(candidate(c('we', 'are', 'gonna', 'rock')), 'gonna')){quit('no', 1)}\n if(!identical(candidate(c('we', 'are', 'a', 'mad', 'nation')), 'nation')){quit('no', 1)}\n if(!identical(candidate(c('this', 'is', 'a', 'prrk')), 'this')){quit('no', 1)}\n if(!identical(candidate(c('b')), 'b')){quit('no', 1)}\n if(!identical(candidate(c('play', 'play', 'play')), 'play')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "r", - "prompt": "# Create a function that returns a tuple (a, b), where 'a' is\n# the largest of negative integers, and 'b' is the smallest\n# of positive integers in a list.\n# If there is no negative or positive integers, return them as None.\n# Examples:\nlargest_smallest_integers <- function(lst) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- largest_smallest_integers\n if(!identical(candidate(c(2, 4, 1, 3, 5, 7)), list(NULL, 1))){quit('no', 1)}\n if(!identical(candidate(c(2, 4, 1, 3, 5, 7, 0)), list(NULL, 1))){quit('no', 1)}\n if(!identical(candidate(c(1, 3, 2, 4, 5, 6, -2)), list(-2, 1))){quit('no', 1)}\n if(!identical(candidate(c(4, 5, 3, 6, 2, 7, -7)), list(-7, 2))){quit('no', 1)}\n if(!identical(candidate(c(7, 3, 8, 4, 9, 2, 5, -9)), list(-9, 2))){quit('no', 1)}\n if(!identical(candidate(c()), list(NULL, NULL))){quit('no', 1)}\n if(!identical(candidate(c(0)), list(NULL, NULL))){quit('no', 1)}\n if(!identical(candidate(c(-1, -3, -5, -6)), list(-1, NULL))){quit('no', 1)}\n if(!identical(candidate(c(-1, -3, -5, -6, 0)), list(-1, NULL))){quit('no', 1)}\n if(!identical(candidate(c(-6, -4, -4, -3, 1)), list(-3, 1))){quit('no', 1)}\n if(!identical(candidate(c(-6, -4, -4, -3, -100, 1)), list(-3, 1))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "r", - "prompt": "# \"Given an array representing a branch of a tree that has non-negative integer nodes\n# your task is to pluck one of the nodes and return it.\n# The plucked node should be the node with the smallest even value.\n# If multiple nodes with the same smallest even value are found return the node that has smallest index.\n# The plucked node should be returned in a list, [ smalest_value, its index ],\n# If there are no even values or the given array is empty, return [].\n# Example 1:\n# Explanation: 2 has the smallest even value, and 2 has the smallest index.\n# Example 2:\n# Explanation: 2 has the smallest even value, and 2 has the smallest index.\n# Example 3:\n# Example 4:\n# Explanation: 0 is the smallest value, but there are two zeros,\n# so we will choose the first zero, which has the smallest index.\n# Constraints:\n# * 1 <= nodes.length <= 10000\n# * 0 <= node.value\npluck <- function(arr) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- pluck\n if(!identical(candidate(c(4, 2, 3)), list(2, 1))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3)), list(2, 1))){quit('no', 1)}\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(5, 0, 3, 0, 4, 2)), list(0, 1))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 0, 5, 3)), list(0, 3))){quit('no', 1)}\n if(!identical(candidate(c(5, 4, 8, 4, 8)), list(4, 1))){quit('no', 1)}\n if(!identical(candidate(c(7, 6, 7, 1)), list(6, 1))){quit('no', 1)}\n if(!identical(candidate(c(7, 9, 7, 1)), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "r", - "prompt": "# Write a function count_nums which takes an array of integers and returns\n# the number of elements which has a sum of digits > 0.\n# If a number is negative, then its first signed digit will be negative:\n# e.g. -123 has signed digits -1, 2, and 3.\ncount_nums <- function(arr) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- count_nums\n if(!identical(candidate(c()), 0)){quit('no', 1)}\n if(!identical(candidate(c(-1, -2, 0)), 0)){quit('no', 1)}\n if(!identical(candidate(c(1, 1, 2, -2, 3, 4, 5)), 6)){quit('no', 1)}\n if(!identical(candidate(c(1, 6, 9, -6, 0, 1, 5)), 5)){quit('no', 1)}\n if(!identical(candidate(c(1, 100, 98, -7, 1, -1)), 4)){quit('no', 1)}\n if(!identical(candidate(c(12, 23, 34, -45, -56, 0)), 5)){quit('no', 1)}\n if(!identical(candidate(c(0, 1)), 1)){quit('no', 1)}\n if(!identical(candidate(c(1)), 1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "r", - "prompt": "# Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n# each cell of the grid contains a value. Every integer in the range [1, N * N]\n# inclusive appears exactly once on the cells of the grid.\n# You have to find the minimum path of length k in the grid. You can start\n# from any cell, and in each step you can move to any of the neighbor cells,\n# in other words, you can go to cells which share an edge with you current\n# cell.\n# Please note that a path of length k means visiting exactly k cells (not\n# necessarily distinct).\n# You CANNOT go off the grid.\n# A path A (of length k) is considered less than a path B (of length k) if\n# after making the ordered lists of the values on the cells that A and B go\n# through (let's call them lst_A and lst_B), lst_A is lexicographically less\n# than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n# such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n# lst_A[j] = lst_B[j].\n# It is guaranteed that the answer is unique.\n# Return an ordered list of the values on the cells that the minimum path go through.\n# Examples:\nminPath <- function(grid, k) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- minPath\n if(!identical(candidate(list(list(1, 2, 3), list(4, 5, 6), list(7, 8, 9)), 3), list(1, 2, 1))){quit('no', 1)}\n if(!identical(candidate(list(list(5, 9, 3), list(4, 1, 6), list(7, 8, 2)), 1), list(1))){quit('no', 1)}\n if(!identical(candidate(list(list(1, 2, 3, 4), list(5, 6, 7, 8), list(9, 10, 11, 12), list(13, 14, 15, 16)), 4), list(1, 2, 1, 2))){quit('no', 1)}\n if(!identical(candidate(list(list(6, 4, 13, 10), list(5, 7, 12, 1), list(3, 16, 11, 15), list(8, 14, 9, 2)), 7), list(1, 10, 1, 10, 1, 10, 1))){quit('no', 1)}\n if(!identical(candidate(list(list(8, 14, 9, 2), list(6, 4, 13, 15), list(5, 7, 1, 12), list(3, 10, 11, 16)), 5), list(1, 7, 1, 7, 1))){quit('no', 1)}\n if(!identical(candidate(list(list(11, 8, 7, 2), list(5, 16, 14, 4), list(9, 3, 15, 6), list(12, 13, 10, 1)), 9), list(1, 6, 1, 6, 1, 6, 1, 6, 1))){quit('no', 1)}\n if(!identical(candidate(list(list(12, 13, 10, 1), list(9, 3, 15, 6), list(5, 16, 14, 4), list(11, 8, 7, 2)), 12), list(1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6))){quit('no', 1)}\n if(!identical(candidate(list(list(2, 7, 4), list(3, 1, 5), list(6, 8, 9)), 8), list(1, 3, 1, 3, 1, 3, 1, 3))){quit('no', 1)}\n if(!identical(candidate(list(list(6, 1, 5), list(3, 8, 9), list(2, 7, 4)), 8), list(1, 5, 1, 5, 1, 5, 1, 5))){quit('no', 1)}\n if(!identical(candidate(list(list(1, 2), list(3, 4)), 10), list(1, 2, 1, 2, 1, 2, 1, 2, 1, 2))){quit('no', 1)}\n if(!identical(candidate(list(list(1, 3), list(3, 2)), 10), list(1, 3, 1, 3, 1, 3, 1, 3, 1, 3))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "r", - "prompt": "# Given list of integers, return list in strange order.\n# Strange sorting, is when you start with the minimum value,\n# then maximum of the remaining integers, then minimum and so on.\n# Examples:\nstrange_sort_list <- function(lst) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- strange_sort_list\n if(!identical(candidate(c(1, 2, 3, 4)), list(1, 4, 2, 3))){quit('no', 1)}\n if(!identical(candidate(c(5, 6, 7, 8, 9)), list(5, 9, 6, 8, 7))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 5)), list(1, 5, 2, 4, 3))){quit('no', 1)}\n if(!identical(candidate(c(5, 6, 7, 8, 9, 1)), list(1, 9, 5, 8, 6, 7))){quit('no', 1)}\n if(!identical(candidate(c(5, 5, 5, 5)), list(5, 5, 5, 5))){quit('no', 1)}\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 5, 6, 7, 8)), list(1, 8, 2, 7, 3, 6, 4, 5))){quit('no', 1)}\n if(!identical(candidate(c(0, 2, 2, 2, 5, 5, -5, -5)), list(-5, 5, -5, 5, 0, 2, 2, 2))){quit('no', 1)}\n if(!identical(candidate(c(111111)), list(111111))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "r", - "prompt": "# Given a string 'text', return its md5 hash equivalent string.\n# If 'text' is an empty string, return None.\nstring_to_md5 <- function(text) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- string_to_md5\n if(!identical(candidate('Hello world'), '3e25960a79dbc69b674cd4ec67a72c62')){quit('no', 1)}\n if(!identical(candidate(''), NULL)){quit('no', 1)}\n if(!identical(candidate('A B C'), '0ef78513b0cb8cef12743f5aeb35f888')){quit('no', 1)}\n if(!identical(candidate('password'), '5f4dcc3b5aa765d61d8327deb882cf99')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "r", - "prompt": "# You are given a word. Your task is to find the closest vowel that stands between \n# two consonants from the right side of the word (case sensitive).\n# Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n# find any vowel met the above condition. \n# You may assume that the given string contains English letter only.\n# Example:\nget_closest_vowel <- function(word) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- get_closest_vowel\n if(!identical(candidate('yogurt'), 'u')){quit('no', 1)}\n if(!identical(candidate('full'), 'u')){quit('no', 1)}\n if(!identical(candidate('easy'), '')){quit('no', 1)}\n if(!identical(candidate('eAsy'), '')){quit('no', 1)}\n if(!identical(candidate('ali'), '')){quit('no', 1)}\n if(!identical(candidate('bad'), 'a')){quit('no', 1)}\n if(!identical(candidate('most'), 'o')){quit('no', 1)}\n if(!identical(candidate('ab'), '')){quit('no', 1)}\n if(!identical(candidate('ba'), '')){quit('no', 1)}\n if(!identical(candidate('quick'), '')){quit('no', 1)}\n if(!identical(candidate('anime'), 'i')){quit('no', 1)}\n if(!identical(candidate('Asia'), '')){quit('no', 1)}\n if(!identical(candidate('Above'), 'o')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "r", - "prompt": "# Change numerical base of input number x to base.\n# return string representation after the conversion.\n# base numbers are less than 10.\nchange_base <- function(x, base) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- change_base\n if(!identical(candidate(8, 3), '22')){quit('no', 1)}\n if(!identical(candidate(9, 3), '100')){quit('no', 1)}\n if(!identical(candidate(234, 2), '11101010')){quit('no', 1)}\n if(!identical(candidate(16, 2), '10000')){quit('no', 1)}\n if(!identical(candidate(8, 2), '1000')){quit('no', 1)}\n if(!identical(candidate(7, 2), '111')){quit('no', 1)}\n if(!identical(candidate(2, 3), '2')){quit('no', 1)}\n if(!identical(candidate(3, 4), '3')){quit('no', 1)}\n if(!identical(candidate(4, 5), '4')){quit('no', 1)}\n if(!identical(candidate(5, 6), '5')){quit('no', 1)}\n if(!identical(candidate(6, 7), '6')){quit('no', 1)}\n if(!identical(candidate(7, 8), '7')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "r", - "prompt": "# Check if in given list of numbers, are any two numbers closer to each other than\n# given threshold.\nhas_close_elements <- function(numbers, threshold) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- has_close_elements\n if(!identical(candidate(c(1.0, 2.0, 3.9, 4.0, 5.0, 2.2), 0.3), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.9, 4.0, 5.0, 2.2), 0.05), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 5.9, 4.0, 5.0), 0.95), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 5.9, 4.0, 5.0), 0.8), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.0, 4.0, 5.0, 2.0), 0.1), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1.1, 2.2, 3.1, 4.1, 5.1), 1.0), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1.1, 2.2, 3.1, 4.1, 5.1), 0.5), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "r", - "prompt": "# Create a function that takes a string as input which contains only square brackets.\n# The function should return True if and only if there is a valid subsequence of brackets \n# where at least one bracket in the subsequence is nested.\nis_nested <- function(string) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- is_nested\n if(!identical(candidate('[[]]'), TRUE)){quit('no', 1)}\n if(!identical(candidate('[]]]]]]][[[[[]'), FALSE)){quit('no', 1)}\n if(!identical(candidate('[][]'), FALSE)){quit('no', 1)}\n if(!identical(candidate('[]'), FALSE)){quit('no', 1)}\n if(!identical(candidate('[[[[]]]]'), TRUE)){quit('no', 1)}\n if(!identical(candidate('[]]]]]]]]]]'), FALSE)){quit('no', 1)}\n if(!identical(candidate('[][][[]]'), TRUE)){quit('no', 1)}\n if(!identical(candidate('[[]'), FALSE)){quit('no', 1)}\n if(!identical(candidate('[]]'), FALSE)){quit('no', 1)}\n if(!identical(candidate('[[]][['), TRUE)){quit('no', 1)}\n if(!identical(candidate('[[][]]'), TRUE)){quit('no', 1)}\n if(!identical(candidate(''), FALSE)){quit('no', 1)}\n if(!identical(candidate('[[[[[[[['), FALSE)){quit('no', 1)}\n if(!identical(candidate(']]]]]]]]'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "r", - "prompt": "# Concatenate list of strings into a single string\nconcatenate <- function(strings) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- concatenate\n if(!identical(candidate(c()), '')){quit('no', 1)}\n if(!identical(candidate(c('x', 'y', 'z')), 'xyz')){quit('no', 1)}\n if(!identical(candidate(c('x', 'y', 'z', 'w', 'k')), 'xyzwk')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "r", - "prompt": "# prime_fib returns n-th number that is a Fibonacci number and it's also prime.\nprime_fib <- function(n) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- prime_fib\n if(!identical(candidate(1), 2)){quit('no', 1)}\n if(!identical(candidate(2), 3)){quit('no', 1)}\n if(!identical(candidate(3), 5)){quit('no', 1)}\n if(!identical(candidate(4), 13)){quit('no', 1)}\n if(!identical(candidate(5), 89)){quit('no', 1)}\n if(!identical(candidate(6), 233)){quit('no', 1)}\n if(!identical(candidate(7), 1597)){quit('no', 1)}\n if(!identical(candidate(8), 28657)){quit('no', 1)}\n if(!identical(candidate(9), 514229)){quit('no', 1)}\n if(!identical(candidate(10), 433494437)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "r", - "prompt": "# From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n# other and return them in order (smaller number, larger number).\nfind_closest_elements <- function(numbers) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- find_closest_elements\n if(!identical(candidate(c(1.0, 2.0, 3.9, 4.0, 5.0, 2.2)), list(3.9, 4.0))){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 5.9, 4.0, 5.0)), list(5.0, 5.9))){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.0, 4.0, 5.0, 2.2)), list(2.0, 2.2))){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.0, 4.0, 5.0, 2.0)), list(2.0, 2.0))){quit('no', 1)}\n if(!identical(candidate(c(1.1, 2.2, 3.1, 4.1, 5.1)), list(2.2, 3.1))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "r", - "prompt": "# You have been tasked to write a function that receives \n# a hexadecimal number as a string and counts the number of hexadecimal \n# digits that are primes (prime number, or a prime, is a natural number \n# greater than 1 that is not a product of two smaller natural numbers).\n# Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n# Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n# So you have to determine a number of the following digits: 2, 3, 5, 7, \n# B (=decimal 11), D (=decimal 13).\n# Note: you may assume the input is always correct or empty string, \n# and symbols A,B,C,D,E,F are always uppercase.\n# Examples:\nhex_key <- function(num) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- hex_key\n if(!identical(candidate('AB'), 1)){quit('no', 1)}\n if(!identical(candidate('1077E'), 2)){quit('no', 1)}\n if(!identical(candidate('ABED1A33'), 4)){quit('no', 1)}\n if(!identical(candidate('2020'), 2)){quit('no', 1)}\n if(!identical(candidate('123456789ABCDEF0'), 6)){quit('no', 1)}\n if(!identical(candidate('112233445566778899AABBCCDDEEFF00'), 12)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "r", - "prompt": "# Complete the function that takes two integers and returns \n# the product of their unit digits.\n# Assume the input is always valid.\n# Examples:\nmultiply <- function(a, b) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- multiply\n if(!identical(candidate(148, 412), 16)){quit('no', 1)}\n if(!identical(candidate(19, 28), 72)){quit('no', 1)}\n if(!identical(candidate(2020, 1851), 0)){quit('no', 1)}\n if(!identical(candidate(14, -15), 20)){quit('no', 1)}\n if(!identical(candidate(76, 67), 42)){quit('no', 1)}\n if(!identical(candidate(17, 27), 49)){quit('no', 1)}\n if(!identical(candidate(0, 1), 0)){quit('no', 1)}\n if(!identical(candidate(0, 0), 0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "r", - "prompt": "# Given list of numbers (of at least two elements), apply a linear transform to that list,\n# such that the smallest number will become 0 and the largest will become 1\nrescale_to_unit <- function(numbers) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- rescale_to_unit\n if(!identical(candidate(c(2.0, 49.9)), list(0.0, 1.0))){quit('no', 1)}\n if(!identical(candidate(c(100.0, 49.9)), list(1.0, 0.0))){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.0, 4.0, 5.0)), list(0.0, 0.25, 0.5, 0.75, 1.0))){quit('no', 1)}\n if(!identical(candidate(c(2.0, 1.0, 5.0, 3.0, 4.0)), list(0.25, 0.0, 1.0, 0.5, 0.75))){quit('no', 1)}\n if(!identical(candidate(c(12.0, 11.0, 15.0, 13.0, 14.0)), list(0.25, 0.0, 1.0, 0.5, 0.75))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "r", - "prompt": "# Given a positive integer n, return the product of the odd digits.\n# Return 0 if all digits are even.\n# For example:\ndigits <- function(n) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- digits\n if(!identical(candidate(5), 5)){quit('no', 1)}\n if(!identical(candidate(54), 5)){quit('no', 1)}\n if(!identical(candidate(120), 1)){quit('no', 1)}\n if(!identical(candidate(5014), 5)){quit('no', 1)}\n if(!identical(candidate(98765), 315)){quit('no', 1)}\n if(!identical(candidate(5576543), 2625)){quit('no', 1)}\n if(!identical(candidate(2468), 0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "r", - "prompt": "# You will be given the name of a class (a string) and a list of extensions.\n# The extensions are to be used to load additional classes to the class. The\n# strength of the extension is as follows: Let CAP be the number of the uppercase\n# letters in the extension's name, and let SM be the number of lowercase letters \n# in the extension's name, the strength is given by the fraction CAP - SM. \n# You should find the strongest extension and return a string in this \n# format: ClassName.StrongestExtensionName.\n# If there are two or more extensions with the same strength, you should\n# choose the one that comes first in the list.\n# For example, if you are given \"Slices\" as the class and a list of the\n# extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n# return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n# (its strength is -1).\n# Example:\nStrongest_Extension <- function(class_name, extensions) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- Strongest_Extension\n if(!identical(candidate('Watashi', c('tEN', 'niNE', 'eIGHt8OKe')), 'Watashi.eIGHt8OKe')){quit('no', 1)}\n if(!identical(candidate('Boku123', c('nani', 'NazeDa', 'YEs.WeCaNe', '32145tggg')), 'Boku123.YEs.WeCaNe')){quit('no', 1)}\n if(!identical(candidate('__YESIMHERE', c('t', 'eMptY', 'nothing', 'zeR00', 'NuLl__', '123NoooneB321')), '__YESIMHERE.NuLl__')){quit('no', 1)}\n if(!identical(candidate('K', c('Ta', 'TAR', 't234An', 'cosSo')), 'K.TAR')){quit('no', 1)}\n if(!identical(candidate('__HAHA', c('Tab', '123', '781345', '-_-')), '__HAHA.123')){quit('no', 1)}\n if(!identical(candidate('YameRore', c('HhAas', 'okIWILL123', 'WorkOut', 'Fails', '-_-')), 'YameRore.okIWILL123')){quit('no', 1)}\n if(!identical(candidate('finNNalLLly', c('Die', 'NowW', 'Wow', 'WoW')), 'finNNalLLly.WoW')){quit('no', 1)}\n if(!identical(candidate('_', c('Bb', '91245')), '_.Bb')){quit('no', 1)}\n if(!identical(candidate('Sp', c('671235', 'Bb')), 'Sp.671235')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "r", - "prompt": "# Given a string representing a space separated lowercase letters, return a dictionary\n# of the letter with the most repetition and containing the corresponding count.\n# If several letters have the same occurrence, return all of them.\n# Example:\nhistogram <- function(test) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- histogram\n if(!identical(candidate('a b b a'), list('a' = 2, 'b' = 2))){quit('no', 1)}\n if(!identical(candidate('a b c a b'), list('a' = 2, 'b' = 2))){quit('no', 1)}\n if(!identical(candidate('a b c d g'), list('a' = 1, 'b' = 1, 'c' = 1, 'd' = 1, 'g' = 1))){quit('no', 1)}\n if(!identical(candidate('r t g'), list('r' = 1, 't' = 1, 'g' = 1))){quit('no', 1)}\n if(!identical(candidate('b b b b a'), list('b' = 4))){quit('no', 1)}\n if(!identical(candidate('r t g'), list('r' = 1, 't' = 1, 'g' = 1))){quit('no', 1)}\n if(!identical(candidate(''), list())){quit('no', 1)}\n if(!identical(candidate('a'), list('a' = 1))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "r", - "prompt": "# pairs_sum_to_zero takes a list of integers as an input.\n# it returns True if there are two distinct elements in the list that\n# sum to zero, and False otherwise.\npairs_sum_to_zero <- function(l) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- pairs_sum_to_zero\n if(!identical(candidate(c(1, 3, 5, 0)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 3, -2, 1)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 7)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(2, 4, -5, 3, 5, 7)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(-3, 9, -1, 3, 2, 30)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(-3, 9, -1, 3, 2, 31)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(-3, 9, -1, 4, 2, 30)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(-3, 9, -1, 4, 2, 31)), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "r", - "prompt": "# Write a function that accepts two lists of strings and returns the list that has \n# total number of chars in the all strings of the list less than the other list.\n# if the two lists have the same number of chars, return the first list.\n# Examples\ntotal_match <- function(lst1, lst2) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- total_match\n if(!identical(candidate(c(), c()), list())){quit('no', 1)}\n if(!identical(candidate(c('hi', 'admin'), c('hi', 'hi')), list('hi', 'hi'))){quit('no', 1)}\n if(!identical(candidate(c('hi', 'admin'), c('hi', 'hi', 'admin', 'project')), list('hi', 'admin'))){quit('no', 1)}\n if(!identical(candidate(c('4'), c('1', '2', '3', '4', '5')), list('4'))){quit('no', 1)}\n if(!identical(candidate(c('hi', 'admin'), c('hI', 'Hi')), list('hI', 'Hi'))){quit('no', 1)}\n if(!identical(candidate(c('hi', 'admin'), c('hI', 'hi', 'hi')), list('hI', 'hi', 'hi'))){quit('no', 1)}\n if(!identical(candidate(c('hi', 'admin'), c('hI', 'hi', 'hii')), list('hi', 'admin'))){quit('no', 1)}\n if(!identical(candidate(c(), c('this')), list())){quit('no', 1)}\n if(!identical(candidate(c('this'), c()), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "r", - "prompt": "# Circular shift the digits of the integer x, shift the digits right by shift\n# and return the result as a string.\n# If shift > number of digits, return digits reversed.\ncircular_shift <- function(x, shift) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- circular_shift\n if(!identical(candidate(100, 2), '001')){quit('no', 1)}\n if(!identical(candidate(12, 2), '12')){quit('no', 1)}\n if(!identical(candidate(97, 8), '79')){quit('no', 1)}\n if(!identical(candidate(12, 1), '21')){quit('no', 1)}\n if(!identical(candidate(11, 101), '11')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "r", - "prompt": "# Return True is list elements are monotonically increasing or decreasing.\nmonotonic <- function(l) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- monotonic\n if(!identical(candidate(c(1, 2, 4, 10)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 4, 20)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 20, 4, 10)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(4, 1, 0, -10)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(4, 1, 1, 0)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 2, 5, 60)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 5, 60)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(9, 9, 9, 9)), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "r", - "prompt": "# Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n# Example\nis_equal_to_sum_even <- function(n) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- is_equal_to_sum_even\n if(!identical(candidate(4), FALSE)){quit('no', 1)}\n if(!identical(candidate(6), FALSE)){quit('no', 1)}\n if(!identical(candidate(8), TRUE)){quit('no', 1)}\n if(!identical(candidate(10), TRUE)){quit('no', 1)}\n if(!identical(candidate(11), FALSE)){quit('no', 1)}\n if(!identical(candidate(12), TRUE)){quit('no', 1)}\n if(!identical(candidate(13), FALSE)){quit('no', 1)}\n if(!identical(candidate(16), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "r", - "prompt": "# Input to this function is a string representing musical notes in a special ASCII format.\n# Your task is to parse this string and return list of integers corresponding to how many beats does each\n# not last.\n# Here is a legend:\n# 'o' - whole note, lasts four beats\n# 'o|' - half note, lasts two beats\n# '.|' - quater note, lasts one beat\nparse_music <- function(music_string) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- parse_music\n if(!identical(candidate(''), list())){quit('no', 1)}\n if(!identical(candidate('o o o o'), list(4, 4, 4, 4))){quit('no', 1)}\n if(!identical(candidate('.| .| .| .|'), list(1, 1, 1, 1))){quit('no', 1)}\n if(!identical(candidate('o| o| .| .| o o o o'), list(2, 2, 1, 1, 4, 4, 4, 4))){quit('no', 1)}\n if(!identical(candidate('o| .| o| .| o o| o o|'), list(2, 1, 2, 1, 4, 2, 4, 2))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "r", - "prompt": "# \"\n# This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n# multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n# change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n# Examples:\nsum_squares <- function(lst) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- sum_squares\n if(!identical(candidate(c(1, 2, 3)), 6)){quit('no', 1)}\n if(!identical(candidate(c(1, 4, 9)), 14)){quit('no', 1)}\n if(!identical(candidate(c()), 0)){quit('no', 1)}\n if(!identical(candidate(c(1, 1, 1, 1, 1, 1, 1, 1, 1)), 9)){quit('no', 1)}\n if(!identical(candidate(c(-1, -1, -1, -1, -1, -1, -1, -1, -1)), -3)){quit('no', 1)}\n if(!identical(candidate(c(0)), 0)){quit('no', 1)}\n if(!identical(candidate(c(-1, -5, 2, -1, -5)), -126)){quit('no', 1)}\n if(!identical(candidate(c(-56, -99, 1, 0, -2)), 3030)){quit('no', 1)}\n if(!identical(candidate(c(-1, 0, 0, 0, 0, 0, 0, 0, -1)), 0)){quit('no', 1)}\n if(!identical(candidate(c(-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37)), -14196)){quit('no', 1)}\n if(!identical(candidate(c(-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10)), -1448)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "r", - "prompt": "# triples_sum_to_zero takes a list of integers as an input.\n# it returns True if there are three distinct elements in the list that\n# sum to zero, and False otherwise.\ntriples_sum_to_zero <- function(l) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- triples_sum_to_zero\n if(!identical(candidate(c(1, 3, 5, 0)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 3, 5, -1)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 3, -2, 1)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 7)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 5, 7)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(2, 4, -5, 3, 9, 7)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 3, 5, -100)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(100, 3, 5, -100)), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "r", - "prompt": "# brackets is a string of \"<\" and \">\".\n# return True if every opening bracket has a corresponding closing bracket.\ncorrect_bracketing <- function(brackets) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- correct_bracketing\n if(!identical(candidate('<>'), TRUE)){quit('no', 1)}\n if(!identical(candidate('<<><>>'), TRUE)){quit('no', 1)}\n if(!identical(candidate('<><><<><>><>'), TRUE)){quit('no', 1)}\n if(!identical(candidate('<><><<<><><>><>><<><><<>>>'), TRUE)){quit('no', 1)}\n if(!identical(candidate('<<<><>>>>'), FALSE)){quit('no', 1)}\n if(!identical(candidate('><<>'), FALSE)){quit('no', 1)}\n if(!identical(candidate('<'), FALSE)){quit('no', 1)}\n if(!identical(candidate('<<<<'), FALSE)){quit('no', 1)}\n if(!identical(candidate('>'), FALSE)){quit('no', 1)}\n if(!identical(candidate('<<>'), FALSE)){quit('no', 1)}\n if(!identical(candidate('<><><<><>><>><<>'), FALSE)){quit('no', 1)}\n if(!identical(candidate('<><><<><>><>>><>'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "r", - "prompt": "# Write a function that takes an array of numbers as input and returns \n# the number of elements in the array that are greater than 10 and both \n# first and last digits of a number are odd (1, 3, 5, 7, 9).\n# For example:\nspecialFilter <- function(nums) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- specialFilter\n if(!identical(candidate(c(5, -2, 1, -5)), 0)){quit('no', 1)}\n if(!identical(candidate(c(15, -73, 14, -15)), 1)){quit('no', 1)}\n if(!identical(candidate(c(33, -2, -3, 45, 21, 109)), 2)){quit('no', 1)}\n if(!identical(candidate(c(43, -12, 93, 125, 121, 109)), 4)){quit('no', 1)}\n if(!identical(candidate(c(71, -2, -33, 75, 21, 19)), 3)){quit('no', 1)}\n if(!identical(candidate(c(1)), 0)){quit('no', 1)}\n if(!identical(candidate(c()), 0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "r", - "prompt": "# Given a dictionary, return True if all keys are strings in lower \n# case or all keys are strings in upper case, else return False.\n# The function should return False is the given dictionary is empty.\n# Examples:\ncheck_dict_case <- function(dict) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- check_dict_case\n if(!identical(candidate(list('p' = 'pineapple', 'b' = 'banana')), TRUE)){quit('no', 1)}\n if(!identical(candidate(list('p' = 'pineapple', 'A' = 'banana', 'B' = 'banana')), FALSE)){quit('no', 1)}\n if(!identical(candidate(list('p' = 'pineapple', '5' = 'banana', 'a' = 'apple')), FALSE)){quit('no', 1)}\n if(!identical(candidate(list('Name' = 'John', 'Age' = '36', 'City' = 'Houston')), FALSE)){quit('no', 1)}\n if(!identical(candidate(list('STATE' = 'NC', 'ZIP' = '12345')), TRUE)){quit('no', 1)}\n if(!identical(candidate(list('fruit' = 'Orange', 'taste' = 'Sweet')), TRUE)){quit('no', 1)}\n if(!identical(candidate(list()), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "r", - "prompt": "# Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n# should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n# alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n# Examples\nsplit_words <- function(txt) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- split_words\n if(!identical(candidate('Hello world!'), list('Hello', 'world!'))){quit('no', 1)}\n if(!identical(candidate('Hello,world!'), list('Hello', 'world!'))){quit('no', 1)}\n if(!identical(candidate('Hello world,!'), list('Hello', 'world,!'))){quit('no', 1)}\n if(!identical(candidate('Hello,Hello,world !'), list('Hello,Hello,world', '!'))){quit('no', 1)}\n if(!identical(candidate('abcdef'), 3)){quit('no', 1)}\n if(!identical(candidate('aaabb'), 2)){quit('no', 1)}\n if(!identical(candidate('aaaBb'), 1)){quit('no', 1)}\n if(!identical(candidate(''), 0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "r", - "prompt": "# The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fibfib(0) == 0\n# fibfib(1) == 0\n# fibfib(2) == 1\n# fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n# Please write a function to efficiently compute the n-th element of the fibfib number sequence.\nfibfib <- function(n) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- fibfib\n if(!identical(candidate(2), 1)){quit('no', 1)}\n if(!identical(candidate(1), 0)){quit('no', 1)}\n if(!identical(candidate(5), 4)){quit('no', 1)}\n if(!identical(candidate(8), 24)){quit('no', 1)}\n if(!identical(candidate(10), 81)){quit('no', 1)}\n if(!identical(candidate(12), 274)){quit('no', 1)}\n if(!identical(candidate(14), 927)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "r", - "prompt": "# You are given a list of numbers.\n# You need to return the sum of squared numbers in the given list,\n# round each element in the list to the upper int(Ceiling) first.\n# Examples:\nsum_squares <- function(lst) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- sum_squares\n if(!identical(candidate(c(1.0, 2.0, 3.0)), 14)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.0)), 14)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 3.0, 5.0, 7.0)), 84)){quit('no', 1)}\n if(!identical(candidate(c(1.4, 4.2, 0.0)), 29)){quit('no', 1)}\n if(!identical(candidate(c(-2.4, 1.0, 1.0)), 6)){quit('no', 1)}\n if(!identical(candidate(c(100.0, 1.0, 15.0, 2.0)), 10230)){quit('no', 1)}\n if(!identical(candidate(c(10000.0, 10000.0)), 200000000)){quit('no', 1)}\n if(!identical(candidate(c(-1.4, 4.6, 6.3)), 75)){quit('no', 1)}\n if(!identical(candidate(c(-1.4, 17.9, 18.9, 19.9)), 1086)){quit('no', 1)}\n if(!identical(candidate(c(0.0)), 0)){quit('no', 1)}\n if(!identical(candidate(c(-1.0)), 1)){quit('no', 1)}\n if(!identical(candidate(c(-1.0, 1.0, 0.0)), 2)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_85_add", - "language": "r", - "prompt": "# Given a non-empty list of integers lst. add the even elements that are at odd indices..\n# Examples:\nadd <- function(lst) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- add\n if(!identical(candidate(c(4, 88)), 88)){quit('no', 1)}\n if(!identical(candidate(c(4, 5, 6, 7, 2, 122)), 122)){quit('no', 1)}\n if(!identical(candidate(c(4, 0, 6, 7)), 0)){quit('no', 1)}\n if(!identical(candidate(c(4, 4, 6, 8)), 12)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "r", - "prompt": "# Return sorted unique elements in a list\nunique <- function(l) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- unique\n if(!identical(candidate(c(5, 3, 5, 2, 3, 3, 9, 0, 123)), list(0, 2, 3, 5, 9, 123))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "r", - "prompt": "# Given a string text, replace all spaces in it with underscores, \n# and if a string has more than 2 consecutive spaces, \n# then replace all consecutive spaces with -\nfix_spaces <- function(text) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- fix_spaces\n if(!identical(candidate('Example'), 'Example')){quit('no', 1)}\n if(!identical(candidate('Mudasir Hanif '), 'Mudasir_Hanif_')){quit('no', 1)}\n if(!identical(candidate('Yellow Yellow Dirty Fellow'), 'Yellow_Yellow__Dirty__Fellow')){quit('no', 1)}\n if(!identical(candidate('Exa mple'), 'Exa-mple')){quit('no', 1)}\n if(!identical(candidate(' Exa 1 2 2 mple'), '-Exa_1_2_2_mple')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "r", - "prompt": "# Return 2^n modulo p (be aware of numerics).\nmodp <- function(n, p) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- modp\n if(!identical(candidate(3, 5), 3)){quit('no', 1)}\n if(!identical(candidate(1101, 101), 2)){quit('no', 1)}\n if(!identical(candidate(0, 101), 1)){quit('no', 1)}\n if(!identical(candidate(3, 11), 8)){quit('no', 1)}\n if(!identical(candidate(100, 101), 1)){quit('no', 1)}\n if(!identical(candidate(30, 5), 4)){quit('no', 1)}\n if(!identical(candidate(31, 5), 3)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "r", - "prompt": "# You have to write a function which validates a given date string and\n# returns True if the date is valid otherwise False.\n# The date is valid if all of the following rules are satisfied:\n# 1. The date string is not empty.\n# 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n# 3. The months should not be less than 1 or higher than 12.\n# 4. The date should be in the format: mm-dd-yyyy\nvalid_date <- function(date) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- valid_date\n if(!identical(candidate('03-11-2000'), TRUE)){quit('no', 1)}\n if(!identical(candidate('15-01-2012'), FALSE)){quit('no', 1)}\n if(!identical(candidate('04-0-2040'), FALSE)){quit('no', 1)}\n if(!identical(candidate('06-04-2020'), TRUE)){quit('no', 1)}\n if(!identical(candidate('01-01-2007'), TRUE)){quit('no', 1)}\n if(!identical(candidate('03-32-2011'), FALSE)){quit('no', 1)}\n if(!identical(candidate(''), FALSE)){quit('no', 1)}\n if(!identical(candidate('04-31-3000'), FALSE)){quit('no', 1)}\n if(!identical(candidate('06-06-2005'), TRUE)){quit('no', 1)}\n if(!identical(candidate('21-31-2000'), FALSE)){quit('no', 1)}\n if(!identical(candidate('04-12-2003'), TRUE)){quit('no', 1)}\n if(!identical(candidate('04122003'), FALSE)){quit('no', 1)}\n if(!identical(candidate('20030412'), FALSE)){quit('no', 1)}\n if(!identical(candidate('2003-04'), FALSE)){quit('no', 1)}\n if(!identical(candidate('2003-04-12'), FALSE)){quit('no', 1)}\n if(!identical(candidate('04-2003'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "r", - "prompt": "# Write a function that takes a string and returns an ordered version of it.\n# Ordered version of string, is a string where all words (separated by space)\n# are replaced by a new word where all the characters arranged in\n# ascending order based on ascii value.\n# Note: You should keep the order of words and blank spaces in the sentence.\n# For example:\nanti_shuffle <- function(s) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- anti_shuffle\n if(!identical(candidate('Hi'), 'Hi')){quit('no', 1)}\n if(!identical(candidate('hello'), 'ehllo')){quit('no', 1)}\n if(!identical(candidate('number'), 'bemnru')){quit('no', 1)}\n if(!identical(candidate('abcd'), 'abcd')){quit('no', 1)}\n if(!identical(candidate('Hello World!!!'), 'Hello !!!Wdlor')){quit('no', 1)}\n if(!identical(candidate(''), '')){quit('no', 1)}\n if(!identical(candidate('Hi. My name is Mister Robot. How are you?'), '.Hi My aemn is Meirst .Rboot How aer ?ouy')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "r", - "prompt": "# Given a list of numbers, return whether or not they are sorted\n# in ascending order. If list has more than 1 duplicate of the same\n# number, return False. Assume no negative numbers and only integers.\n# Examples\nis_sorted <- function(lst) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- is_sorted\n if(!identical(candidate(c(5)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 5)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 3, 2, 4, 5)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 5, 6)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 5, 6, 7)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 3, 2, 4, 5, 6, 7)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c()), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 1)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 2, 2, 3, 4)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 3, 3, 4)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 2, 3, 3, 4)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4)), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "r", - "prompt": "# You are given a string s.\n# Your task is to check if the string is happy or not.\n# A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n# For example:\nis_happy <- function(s) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- is_happy\n if(!identical(candidate('a'), FALSE)){quit('no', 1)}\n if(!identical(candidate('aa'), FALSE)){quit('no', 1)}\n if(!identical(candidate('abcd'), TRUE)){quit('no', 1)}\n if(!identical(candidate('aabb'), FALSE)){quit('no', 1)}\n if(!identical(candidate('adb'), TRUE)){quit('no', 1)}\n if(!identical(candidate('xyy'), FALSE)){quit('no', 1)}\n if(!identical(candidate('iopaxpoi'), TRUE)){quit('no', 1)}\n if(!identical(candidate('iopaxioi'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "r", - "prompt": "# Write a function that returns True if the object q will fly, and False otherwise.\n# The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n# Example:\n# # 1+2 is less than the maximum possible weight, but it's unbalanced.\n# # it's balanced, but 3+2+3 is more than the maximum possible weight.\n# # 3+2+3 is less than the maximum possible weight, and it's balanced.\n# # 3 is less than the maximum possible weight, and it's balanced.\nwill_it_fly <- function(q, w) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- will_it_fly\n if(!identical(candidate(c(3, 2, 3), 9), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2), 5), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(3), 5), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 3), 1), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3), 6), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(5), 5), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "r", - "prompt": "# Given an array of non-negative integers, return a copy of the given array after sorting,\n# you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n# or sort it in descending order if the sum( first index value, last index value) is even.\n# Note:\n# * don't change the given array.\n# Examples:\nsort_array <- function(array) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- sort_array\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(5)), list(5))){quit('no', 1)}\n if(!identical(candidate(c(2, 4, 3, 0, 1, 5)), list(0, 1, 2, 3, 4, 5))){quit('no', 1)}\n if(!identical(candidate(c(2, 4, 3, 0, 1, 5, 6)), list(6, 5, 4, 3, 2, 1, 0))){quit('no', 1)}\n if(!identical(candidate(c(2, 1)), list(1, 2))){quit('no', 1)}\n if(!identical(candidate(c(15, 42, 87, 32, 11, 0)), list(0, 11, 15, 32, 42, 87))){quit('no', 1)}\n if(!identical(candidate(c(21, 14, 23, 11)), list(23, 21, 14, 11))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "r", - "prompt": "# Implement a function that takes an non-negative integer and returns an array of the first n\n# integers that are prime numbers and less than n.\n# for example:\ncount_up_to <- function(n) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- count_up_to\n if(!identical(candidate(5), list(2, 3))){quit('no', 1)}\n if(!identical(candidate(6), list(2, 3, 5))){quit('no', 1)}\n if(!identical(candidate(7), list(2, 3, 5))){quit('no', 1)}\n if(!identical(candidate(10), list(2, 3, 5, 7))){quit('no', 1)}\n if(!identical(candidate(0), list())){quit('no', 1)}\n if(!identical(candidate(22), list(2, 3, 5, 7, 11, 13, 17, 19))){quit('no', 1)}\n if(!identical(candidate(1), list())){quit('no', 1)}\n if(!identical(candidate(18), list(2, 3, 5, 7, 11, 13, 17))){quit('no', 1)}\n if(!identical(candidate(47), list(2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43))){quit('no', 1)}\n if(!identical(candidate(101), list(2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "r", - "prompt": "# Out of list of strings, return the longest one. Return the first one in case of multiple\n# strings of the same length. Return None in case the input list is empty.\nlongest <- function(strings) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- longest\n if(!identical(candidate(c()), NULL)){quit('no', 1)}\n if(!identical(candidate(c('x', 'y', 'z')), 'x')){quit('no', 1)}\n if(!identical(candidate(c('x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc')), 'zzzz')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "r", - "prompt": "# Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n# reverse the resulting array, and then replace each digit by its corresponding name from\n# \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n# For example:\n# If the array is empty, return an empty array:\n# If the array has any strange number ignore it:\nby_length <- function(arr) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- by_length\n if(!identical(candidate(c(2, 1, 1, 4, 5, 8, 2, 3)), list('Eight', 'Five', 'Four', 'Three', 'Two', 'Two', 'One', 'One'))){quit('no', 1)}\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(1, -1, 55)), list('One'))){quit('no', 1)}\n if(!identical(candidate(c(1, -1, 3, 2)), list('Three', 'Two', 'One'))){quit('no', 1)}\n if(!identical(candidate(c(9, 4, 8)), list('Nine', 'Eight', 'Four'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_106_f", - "language": "r", - "prompt": "# Implement the function f that takes n as a parameter,\n# 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\n# or the sum of numbers from 1 to i otherwise.\n# i starts from 1.\n# the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n# Example:\nf <- function(n) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- f\n if(!identical(candidate(5), list(1, 2, 6, 24, 15))){quit('no', 1)}\n if(!identical(candidate(7), list(1, 2, 6, 24, 15, 720, 28))){quit('no', 1)}\n if(!identical(candidate(1), list(1))){quit('no', 1)}\n if(!identical(candidate(3), list(1, 2, 6))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "r", - "prompt": "# Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\nfizz_buzz <- function(n) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- fizz_buzz\n if(!identical(candidate(50), 0)){quit('no', 1)}\n if(!identical(candidate(78), 2)){quit('no', 1)}\n if(!identical(candidate(79), 3)){quit('no', 1)}\n if(!identical(candidate(100), 3)){quit('no', 1)}\n if(!identical(candidate(200), 6)){quit('no', 1)}\n if(!identical(candidate(4000), 192)){quit('no', 1)}\n if(!identical(candidate(10000), 639)){quit('no', 1)}\n if(!identical(candidate(100000), 8026)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "r", - "prompt": "# Given a positive floating point number, it can be decomposed into\n# and integer part (largest integer smaller than given number) and decimals\n# (leftover part always smaller than 1).\n# Return the decimal part of the number.\ntruncate_number <- function(number) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- truncate_number\n if(!identical(candidate(3.5), 0.5)){quit('no', 1)}\n if(!identical(candidate(1.25), 0.25)){quit('no', 1)}\n if(!identical(candidate(123.0), 0.0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "r", - "prompt": "# For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n# Empty sum should be equal to 0 and empty product should be equal to 1.\nsum_product <- function(numbers) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- sum_product\n if(!identical(candidate(c()), list(0, 1))){quit('no', 1)}\n if(!identical(candidate(c(1, 1, 1)), list(3, 1))){quit('no', 1)}\n if(!identical(candidate(c(100, 0)), list(100, 0))){quit('no', 1)}\n if(!identical(candidate(c(3, 5, 7)), list(15, 105))){quit('no', 1)}\n if(!identical(candidate(c(10)), list(10, 10))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "r", - "prompt": "# You are given a 2 dimensional data, as a nested lists,\n# which is similar to matrix, however, unlike matrices,\n# each row may contain a different number of columns.\n# Given lst, and integer x, find integers x in the list,\n# and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n# each tuple is a coordinate - (row, columns), starting with 0.\n# Sort coordinates initially by rows in ascending order.\n# Also, sort coordinates of the row by columns in descending order.\n# Examples:\nget_row <- function(lst, x) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- get_row\n if(!identical(candidate(list(list(1, 2, 3, 4, 5, 6), list(1, 2, 3, 4, 1, 6), list(1, 2, 3, 4, 5, 1)), 1), list(list(0, 0), list(1, 4), list(1, 0), list(2, 5), list(2, 0)))){quit('no', 1)}\n if(!identical(candidate(list(list(1, 2, 3, 4, 5, 6), list(1, 2, 3, 4, 5, 6), list(1, 2, 3, 4, 5, 6), list(1, 2, 3, 4, 5, 6), list(1, 2, 3, 4, 5, 6), list(1, 2, 3, 4, 5, 6)), 2), list(list(0, 1), list(1, 1), list(2, 1), list(3, 1), list(4, 1), list(5, 1)))){quit('no', 1)}\n if(!identical(candidate(list(list(1, 2, 3, 4, 5, 6), list(1, 2, 3, 4, 5, 6), list(1, 1, 3, 4, 5, 6), list(1, 2, 1, 4, 5, 6), list(1, 2, 3, 1, 5, 6), list(1, 2, 3, 4, 1, 6), list(1, 2, 3, 4, 5, 1)), 1), list(list(0, 0), list(1, 0), list(2, 1), list(2, 0), list(3, 2), list(3, 0), list(4, 3), list(4, 0), list(5, 4), list(5, 0), list(6, 5), list(6, 0)))){quit('no', 1)}\n if(!identical(candidate(list(), 1), list())){quit('no', 1)}\n if(!identical(candidate(list(list(1)), 2), list())){quit('no', 1)}\n if(!identical(candidate(list(list(), list(1), list(1, 2, 3)), 3), list(list(2, 2)))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "r", - "prompt": "# You're a hungry rabbit, and you already have eaten a certain number of carrots,\n# but now you need to eat more carrots to complete the day's meals.\n# you should return an array of [ total number of eaten carrots after your meals,\n# the number of carrots left after your meals ]\n# if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n# Example:\n# Variables:\n# @number : integer\n# the number of carrots that you have eaten.\n# @need : integer\n# the number of carrots that you need to eat.\n# @remaining : integer\n# the number of remaining carrots thet exist in stock\n# Constrain:\n# * 0 <= number <= 1000\n# * 0 <= need <= 1000\n# * 0 <= remaining <= 1000\n# Have fun :)\neat <- function(number, need, remaining) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- eat\n if(!identical(candidate(5, 6, 10), list(11, 4))){quit('no', 1)}\n if(!identical(candidate(4, 8, 9), list(12, 1))){quit('no', 1)}\n if(!identical(candidate(1, 10, 10), list(11, 0))){quit('no', 1)}\n if(!identical(candidate(2, 11, 5), list(7, 0))){quit('no', 1)}\n if(!identical(candidate(4, 5, 7), list(9, 2))){quit('no', 1)}\n if(!identical(candidate(4, 5, 1), list(5, 0))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "r", - "prompt": "# Given a positive integer N, return the total sum of its digits in binary.\n# Example\n# Variables:\n# @N integer\n# Constraints: 0 \u2264 N \u2264 10000.\n# Output:\n# a string of binary number\nsolve <- function(N) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- solve\n if(!identical(candidate(1000), '1')){quit('no', 1)}\n if(!identical(candidate(150), '110')){quit('no', 1)}\n if(!identical(candidate(147), '1100')){quit('no', 1)}\n if(!identical(candidate(333), '1001')){quit('no', 1)}\n if(!identical(candidate(963), '10010')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "r", - "prompt": "# You are given a list of integers.\n# You need to find the largest prime value and return the sum of its digits.\n# Examples:\nskjkasdkd <- function(lst) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- skjkasdkd\n if(!identical(candidate(c(0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3)), 10)){quit('no', 1)}\n if(!identical(candidate(c(1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1)), 25)){quit('no', 1)}\n if(!identical(candidate(c(1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3)), 13)){quit('no', 1)}\n if(!identical(candidate(c(0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6)), 11)){quit('no', 1)}\n if(!identical(candidate(c(0, 81, 12, 3, 1, 21)), 3)){quit('no', 1)}\n if(!identical(candidate(c(0, 8, 1, 2, 1, 7)), 7)){quit('no', 1)}\n if(!identical(candidate(c(8191)), 19)){quit('no', 1)}\n if(!identical(candidate(c(8191, 123456, 127, 7)), 19)){quit('no', 1)}\n if(!identical(candidate(c(127, 97, 8192)), 10)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "r", - "prompt": "# Given an array arr of integers, find the minimum number of elements that\n# need to be changed to make the array palindromic. A palindromic array is an array that\n# is read the same backwards and forwards. In one change, you can change one element to any other element.\n# For example:\nsmallest_change <- function(arr) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- smallest_change\n if(!identical(candidate(c(1, 2, 3, 5, 4, 7, 9, 6)), 4)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 3, 2, 2)), 1)){quit('no', 1)}\n if(!identical(candidate(c(1, 4, 2)), 1)){quit('no', 1)}\n if(!identical(candidate(c(1, 4, 4, 2)), 1)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 2, 1)), 0)){quit('no', 1)}\n if(!identical(candidate(c(3, 1, 1, 3)), 0)){quit('no', 1)}\n if(!identical(candidate(c(1)), 0)){quit('no', 1)}\n if(!identical(candidate(c(0, 1)), 1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "r", - "prompt": "# It is the last week of the semester and the teacher has to give the grades\n# to students. The teacher has been making her own algorithm for grading.\n# The only problem is, she has lost the code she used for grading.\n# She has given you a list of GPAs for some students and you have to write \n# a function that can output a list of letter grades using the following table:\n# GPA | Letter grade\n# 4.0 A+\n# > 3.7 A \n# > 3.3 A- \n# > 3.0 B+\n# > 2.7 B \n# > 2.3 B-\n# > 2.0 C+\n# > 1.7 C\n# > 1.3 C-\n# > 1.0 D+ \n# > 0.7 D \n# > 0.0 D-\n# 0.0 E\n# Example:\nnumerical_letter_grade <- function(grades) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- numerical_letter_grade\n if(!identical(candidate(c(4.0, 3, 1.7, 2, 3.5)), list('A+', 'B', 'C-', 'C', 'A-'))){quit('no', 1)}\n if(!identical(candidate(c(1.2)), list('D+'))){quit('no', 1)}\n if(!identical(candidate(c(0.5)), list('D-'))){quit('no', 1)}\n if(!identical(candidate(c(0.0)), list('E'))){quit('no', 1)}\n if(!identical(candidate(c(1.0, 0.3, 1.5, 2.8, 3.3)), list('D', 'D-', 'C-', 'B', 'B+'))){quit('no', 1)}\n if(!identical(candidate(c(0.0, 0.7)), list('E', 'D-'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "r", - "prompt": "# Given the lengths of the three sides of a triangle. Return the area of\n# the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n# Otherwise return -1\n# Three sides make a valid triangle when the sum of any two sides is greater \n# than the third side.\n# Example:\ntriangle_area <- function(a, b, c) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- triangle_area\n if(!identical(candidate(3, 4, 5), 6.0)){quit('no', 1)}\n if(!identical(candidate(1, 2, 10), -1)){quit('no', 1)}\n if(!identical(candidate(4, 8, 5), 8.18)){quit('no', 1)}\n if(!identical(candidate(2, 2, 2), 1.73)){quit('no', 1)}\n if(!identical(candidate(1, 2, 3), -1)){quit('no', 1)}\n if(!identical(candidate(10, 5, 7), 16.25)){quit('no', 1)}\n if(!identical(candidate(2, 6, 3), -1)){quit('no', 1)}\n if(!identical(candidate(1, 1, 1), 0.43)){quit('no', 1)}\n if(!identical(candidate(2, 2, 10), -1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "r", - "prompt": "# Check if two words have the same characters.\nsame_chars <- function(s0, s1) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- same_chars\n if(!identical(candidate('eabcdzzzz', 'dddzzzzzzzddeddabc'), TRUE)){quit('no', 1)}\n if(!identical(candidate('abcd', 'dddddddabc'), TRUE)){quit('no', 1)}\n if(!identical(candidate('dddddddabc', 'abcd'), TRUE)){quit('no', 1)}\n if(!identical(candidate('eabcd', 'dddddddabc'), FALSE)){quit('no', 1)}\n if(!identical(candidate('abcd', 'dddddddabcf'), FALSE)){quit('no', 1)}\n if(!identical(candidate('eabcdzzzz', 'dddzzzzzzzddddabc'), FALSE)){quit('no', 1)}\n if(!identical(candidate('aabb', 'aaccc'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "r", - "prompt": "# Given an array of integers nums, find the minimum sum of any non-empty sub-array\n# of nums.\n# Example\nminSubArraySum <- function(nums) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- minSubArraySum\n if(!identical(candidate(c(2, 3, 4, 1, 2, 4)), 1)){quit('no', 1)}\n if(!identical(candidate(c(-1, -2, -3)), -6)){quit('no', 1)}\n if(!identical(candidate(c(-1, -2, -3, 2, -10)), -14)){quit('no', 1)}\n if(!identical(candidate(c(-9999999999999999)), -9999999999999999)){quit('no', 1)}\n if(!identical(candidate(c(0, 10, 20, 1000000)), 0)){quit('no', 1)}\n if(!identical(candidate(c(-1, -2, -3, 10, -5)), -6)){quit('no', 1)}\n if(!identical(candidate(c(100, -1, -2, -3, 10, -5)), -6)){quit('no', 1)}\n if(!identical(candidate(c(10, 11, 13, 8, 3, 4)), 3)){quit('no', 1)}\n if(!identical(candidate(c(100, -33, 32, -1, 0, -2)), -33)){quit('no', 1)}\n if(!identical(candidate(c(-10)), -10)){quit('no', 1)}\n if(!identical(candidate(c(7)), 7)){quit('no', 1)}\n if(!identical(candidate(c(1, -1)), -1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "r", - "prompt": "# Given a string s and a natural number n, you have been tasked to implement \n# a function that returns a list of all words from string s that contain exactly \n# n consonants, in order these words appear in the string s.\n# If the string s is empty then the function should return an empty list.\n# Note: you may assume the input string contains only letters and spaces.\n# Examples:\nselect_words <- function(s, n) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- select_words\n if(!identical(candidate('Mary had a little lamb', 4), list('little'))){quit('no', 1)}\n if(!identical(candidate('Mary had a little lamb', 3), list('Mary', 'lamb'))){quit('no', 1)}\n if(!identical(candidate('simple white space', 2), list())){quit('no', 1)}\n if(!identical(candidate('Hello world', 4), list('world'))){quit('no', 1)}\n if(!identical(candidate('Uncle sam', 3), list('Uncle'))){quit('no', 1)}\n if(!identical(candidate('', 4), list())){quit('no', 1)}\n if(!identical(candidate('a b c d e f', 1), list('b', 'c', 'd', 'f'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "r", - "prompt": "# Return list of all prefixes from shortest to longest of the input string\nall_prefixes <- function(string) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- all_prefixes\n if(!identical(candidate(''), list())){quit('no', 1)}\n if(!identical(candidate('asdfgh'), list('a', 'as', 'asd', 'asdf', 'asdfg', 'asdfgh'))){quit('no', 1)}\n if(!identical(candidate('WWW'), list('W', 'WW', 'WWW'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "r", - "prompt": "# Create a function that takes a value (string) representing a number\n# and returns the closest integer to it. If the number is equidistant\n# from two integers, round it away from zero.\n# Examples\n# Note:\n# Rounding away from zero means that if the given number is equidistant\n# from two integers, the one you should return is the one that is the\n# farthest from zero. For example closest_integer(\"14.5\") should\n# return 15 and closest_integer(\"-14.5\") should return -15.\nclosest_integer <- function(value) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- closest_integer\n if(!identical(candidate('10'), 10)){quit('no', 1)}\n if(!identical(candidate('14.5'), 15)){quit('no', 1)}\n if(!identical(candidate('-15.5'), -16)){quit('no', 1)}\n if(!identical(candidate('15.3'), 15)){quit('no', 1)}\n if(!identical(candidate('0'), 0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "r", - "prompt": "# Create a function which takes a string representing a file's name, and returns\n# 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n# A file's name is considered to be valid if and only if all the following conditions \n# are met:\n# - There should not be more than three digits ('0'-'9') in the file's name.\n# - The file's name contains exactly one dot '.'\n# - The substring before the dot should not be empty, and it starts with a letter from \n# the latin alphapet ('a'-'z' and 'A'-'Z').\n# - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n# Examples:\nfile_name_check <- function(file_name) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- file_name_check\n if(!identical(candidate('example.txt'), 'Yes')){quit('no', 1)}\n if(!identical(candidate('1example.dll'), 'No')){quit('no', 1)}\n if(!identical(candidate('s1sdf3.asd'), 'No')){quit('no', 1)}\n if(!identical(candidate('K.dll'), 'Yes')){quit('no', 1)}\n if(!identical(candidate('MY16FILE3.exe'), 'Yes')){quit('no', 1)}\n if(!identical(candidate('His12FILE94.exe'), 'No')){quit('no', 1)}\n if(!identical(candidate('_Y.txt'), 'No')){quit('no', 1)}\n if(!identical(candidate('?aREYA.exe'), 'No')){quit('no', 1)}\n if(!identical(candidate('/this_is_valid.dll'), 'No')){quit('no', 1)}\n if(!identical(candidate('this_is_valid.wow'), 'No')){quit('no', 1)}\n if(!identical(candidate('this_is_valid.txt'), 'Yes')){quit('no', 1)}\n if(!identical(candidate('this_is_valid.txtexe'), 'No')){quit('no', 1)}\n if(!identical(candidate('#this2_i4s_5valid.ten'), 'No')){quit('no', 1)}\n if(!identical(candidate('@this1_is6_valid.exe'), 'No')){quit('no', 1)}\n if(!identical(candidate('this_is_12valid.6exe4.txt'), 'No')){quit('no', 1)}\n if(!identical(candidate('all.exe.txt'), 'No')){quit('no', 1)}\n if(!identical(candidate('I563_No.exe'), 'Yes')){quit('no', 1)}\n if(!identical(candidate('Is3youfault.txt'), 'Yes')){quit('no', 1)}\n if(!identical(candidate('no_one#knows.dll'), 'Yes')){quit('no', 1)}\n if(!identical(candidate('1I563_Yes3.exe'), 'No')){quit('no', 1)}\n if(!identical(candidate('I563_Yes3.txtt'), 'No')){quit('no', 1)}\n if(!identical(candidate('final..txt'), 'No')){quit('no', 1)}\n if(!identical(candidate('final132'), 'No')){quit('no', 1)}\n if(!identical(candidate('_f4indsartal132.'), 'No')){quit('no', 1)}\n if(!identical(candidate('.txt'), 'No')){quit('no', 1)}\n if(!identical(candidate('s.'), 'No')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "r", - "prompt": "# You are given two intervals,\n# where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n# The given intervals are closed which means that the interval (start, end)\n# includes both start and end.\n# For each given interval, it is assumed that its start is less or equal its end.\n# Your task is to determine whether the length of intersection of these two \n# intervals is a prime number.\n# Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n# which its length is 1, which not a prime number.\n# If the length of the intersection is a prime number, return \"YES\",\n# otherwise, return \"NO\".\n# If the two intervals don't intersect, return \"NO\".\n# [input/output] samples:\nintersection <- function(interval1, interval2) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- intersection\n if(!identical(candidate(list(1, 2), list(2, 3)), 'NO')){quit('no', 1)}\n if(!identical(candidate(list(-1, 1), list(0, 4)), 'NO')){quit('no', 1)}\n if(!identical(candidate(list(-3, -1), list(-5, 5)), 'YES')){quit('no', 1)}\n if(!identical(candidate(list(-2, 2), list(-4, 0)), 'YES')){quit('no', 1)}\n if(!identical(candidate(list(-11, 2), list(-1, -1)), 'NO')){quit('no', 1)}\n if(!identical(candidate(list(1, 2), list(3, 5)), 'NO')){quit('no', 1)}\n if(!identical(candidate(list(1, 2), list(1, 2)), 'NO')){quit('no', 1)}\n if(!identical(candidate(list(-2, -2), list(-3, -2)), 'NO')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "r", - "prompt": "# Return the largest prime factor of n. Assume n > 1 and is not a prime.\nlargest_prime_factor <- function(n) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- largest_prime_factor\n if(!identical(candidate(15), 5)){quit('no', 1)}\n if(!identical(candidate(27), 3)){quit('no', 1)}\n if(!identical(candidate(63), 7)){quit('no', 1)}\n if(!identical(candidate(330), 11)){quit('no', 1)}\n if(!identical(candidate(13195), 29)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "r", - "prompt": "# Given a string, find out how many distinct characters (regardless of case) does it consist of\ncount_distinct_characters <- function(string) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- count_distinct_characters\n if(!identical(candidate(''), 0)){quit('no', 1)}\n if(!identical(candidate('abcde'), 5)){quit('no', 1)}\n if(!identical(candidate('abcdecadeCADE'), 5)){quit('no', 1)}\n if(!identical(candidate('aaaaAAAAaaaa'), 1)){quit('no', 1)}\n if(!identical(candidate('Jerry jERRY JeRRRY'), 5)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "r", - "prompt": "# You're given a list of deposit and withdrawal operations on a bank account that starts with\n# zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n# at that point function should return True. Otherwise it should return False.\nbelow_zero <- function(operations) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- below_zero\n if(!identical(candidate(c()), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, -3, 1, 2, -3)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, -4, 5, 6)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, -1, 2, -2, 5, -5, 4, -4)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, -1, 2, -2, 5, -5, 4, -5)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, -2, 2, -2, 5, -5, 4, -4)), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "r", - "prompt": "# Find the shortest palindrome that begins with a supplied string.\n# Algorithm idea is simple:\n# - Find the longest postfix of supplied string that is a palindrome.\n# - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\nmake_palindrome <- function(string) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- make_palindrome\n if(!identical(candidate(''), '')){quit('no', 1)}\n if(!identical(candidate('x'), 'x')){quit('no', 1)}\n if(!identical(candidate('xyz'), 'xyzyx')){quit('no', 1)}\n if(!identical(candidate('xyx'), 'xyx')){quit('no', 1)}\n if(!identical(candidate('jerry'), 'jerryrrej')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "r", - "prompt": "# Given a positive integer, obtain its roman numeral equivalent as a string,\n# and return it in lowercase.\n# Restrictions: 1 <= num <= 1000\n# Examples:\nint_to_mini_roman <- function(number) {", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- int_to_mini_roman\n if(!identical(candidate(19), 'xix')){quit('no', 1)}\n if(!identical(candidate(152), 'clii')){quit('no', 1)}\n if(!identical(candidate(251), 'ccli')){quit('no', 1)}\n if(!identical(candidate(426), 'cdxxvi')){quit('no', 1)}\n if(!identical(candidate(500), 'd')){quit('no', 1)}\n if(!identical(candidate(1), 'i')){quit('no', 1)}\n if(!identical(candidate(4), 'iv')){quit('no', 1)}\n if(!identical(candidate(43), 'xliii')){quit('no', 1)}\n if(!identical(candidate(90), 'xc')){quit('no', 1)}\n if(!identical(candidate(94), 'xciv')){quit('no', 1)}\n if(!identical(candidate(532), 'dxxxii')){quit('no', 1)}\n if(!identical(candidate(900), 'cm')){quit('no', 1)}\n if(!identical(candidate(994), 'cmxciv')){quit('no', 1)}\n if(!identical(candidate(1000), 'm')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - } -] \ No newline at end of file diff --git a/data/r-reworded.json b/data/r-reworded.json deleted file mode 100644 index 2ff9d87efd19c625143a12d84a1a47183a4e22a4..0000000000000000000000000000000000000000 --- a/data/r-reworded.json +++ /dev/null @@ -1,2095 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "r", - "prompt": "# For a given number n, find the largest number that divides n evenly, smaller than n\n# >>> largest_divisor(15)\n# 5\nlargest_divisor <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- largest_divisor\n if(!identical(candidate(3), 1)){quit('no', 1)}\n if(!identical(candidate(7), 1)){quit('no', 1)}\n if(!identical(candidate(10), 5)){quit('no', 1)}\n if(!identical(candidate(100), 50)){quit('no', 1)}\n if(!identical(candidate(49), 7)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_47_median", - "language": "r", - "prompt": "# Return median of elements in the list l.\n# >>> median(c(3, 1, 2, 4, 5))\n# 3\n# >>> median(c(-10, 4, 6, 1000, 10, 20))\n# 15.0\nmedian <- function(l) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- median\n if(!identical(candidate(c(3, 1, 2, 4, 5)), 3)){quit('no', 1)}\n if(!identical(candidate(c(-10, 4, 6, 1000, 10, 20)), 8.0)){quit('no', 1)}\n if(!identical(candidate(c(5)), 5)){quit('no', 1)}\n if(!identical(candidate(c(6, 5)), 5.5)){quit('no', 1)}\n if(!identical(candidate(c(8, 1, 3, 9, 9, 2, 7)), 7)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "r", - "prompt": "# Given two lists operator, and operand. The first list has basic algebra operations, and \n# the second list is a list of integers. Use the two given lists to build the algebric \n# expression and return the evaluation of this expression.\n# The basic algebra operations:\n# Addition ( + ) \n# Subtraction ( - ) \n# Multiplication ( * ) \n# Floor division ( // ) \n# Exponentiation ( ** ) \n# Example:\n# operator['+', '*', '-']\n# vector = [2, 3, 4, 5]\n# result = 2 + 3 * 4 - 5\n# => result = 9\n# Note:\n# The length of operator list is equal to the length of operand list minus one.\n# Operand is a list of of non-negative integers.\n# Operator list has at least one operator, and operand list has at least two operands.\ndo_algebra <- function(operator, operand) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- do_algebra\n if(!identical(candidate(c('**', '*', '+'), c(2, 3, 4, 5)), 37)){quit('no', 1)}\n if(!identical(candidate(c('+', '*', '-'), c(2, 3, 4, 5)), 9)){quit('no', 1)}\n if(!identical(candidate(c('//', '*'), c(7, 3, 4)), 8)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "r", - "prompt": "# Return maximum element in the list.\n# >>> max_element(c(1, 2, 3))\n# 3\n# >>> max_element(c(5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10))\n# 123\nmax_element <- function(l) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- max_element\n if(!identical(candidate(c(1, 2, 3)), 3)){quit('no', 1)}\n if(!identical(candidate(c(5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10)), 124)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "r", - "prompt": "# Create a function which returns the largest index of an element which\n# is not greater than or equal to the element immediately preceding it. If\n# no such element exists then return -1. The given vector will not contain\n# duplicate values.\n# Examples:\n# >>> can_arrange(c(1, 2, 4, 3, 5))\n# 3\n# >>> can_arrange(c(1, 2, 3))\n# -1\ncan_arrange <- function(arr) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- can_arrange\n if(!identical(candidate(c(1, 2, 4, 3, 5)), 3)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 4, 5)), -1)){quit('no', 1)}\n if(!identical(candidate(c(1, 4, 2, 5, 6, 7, 8, 9, 10)), 2)){quit('no', 1)}\n if(!identical(candidate(c(4, 8, 5, 7, 3)), 4)){quit('no', 1)}\n if(!identical(candidate(c()), -1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "r", - "prompt": "# Imagine a road that's a perfectly straight infinitely long line.\n# n cars are driving left to right; simultaneously, a different set of n cars\n# are driving right to left. The two sets of cars start out being very far from\n# each other. All cars move in the same speed. Two cars are said to collide\n# when a car that's moving left to right hits a car that's moving right to left.\n# However, the cars are infinitely sturdy and strong; as a result, they continue moving\n# in their trajectory as if they did not collide.\n# This function outputs the number of such collisions.\ncar_race_collision <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- car_race_collision\n if(!identical(candidate(2), 4)){quit('no', 1)}\n if(!identical(candidate(3), 9)){quit('no', 1)}\n if(!identical(candidate(4), 16)){quit('no', 1)}\n if(!identical(candidate(8), 64)){quit('no', 1)}\n if(!identical(candidate(10), 100)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "r", - "prompt": "# Create a function that returns TRUE if the last character\n# of a given string is an alphabetical character and is not\n# a part of a word, and FALSE otherwise.\n# Note: \"word\" is a group of characters separated by space.\n# Examples:\n# >>> check_if_last_char_is_a_letter('apple pie')\n# FALSE\n# >>> check_if_last_char_is_a_letter('apple pi e')\n# TRUE\n# >>> check_if_last_char_is_a_letter('apple pi e ')\n# FALSE\n# >>> check_if_last_char_is_a_letter('')\n# FALSE\ncheck_if_last_char_is_a_letter <- function(txt) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- check_if_last_char_is_a_letter\n if(!identical(candidate('apple'), FALSE)){quit('no', 1)}\n if(!identical(candidate('apple pi e'), TRUE)){quit('no', 1)}\n if(!identical(candidate('eeeee'), FALSE)){quit('no', 1)}\n if(!identical(candidate('A'), TRUE)){quit('no', 1)}\n if(!identical(candidate('Pumpkin pie '), FALSE)){quit('no', 1)}\n if(!identical(candidate('Pumpkin pie 1'), FALSE)){quit('no', 1)}\n if(!identical(candidate(''), FALSE)){quit('no', 1)}\n if(!identical(candidate('eeeee e '), FALSE)){quit('no', 1)}\n if(!identical(candidate('apple pie'), FALSE)){quit('no', 1)}\n if(!identical(candidate('apple pi e '), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "r", - "prompt": "# Return true if a given number is prime, and false otherwise.\n# >>> is_prime(6)\n# FALSE\n# >>> is_prime(101)\n# TRUE\n# >>> is_prime(11)\n# TRUE\n# >>> is_prime(13441)\n# TRUE\n# >>> is_prime(61)\n# TRUE\n# >>> is_prime(4)\n# FALSE\n# >>> is_prime(1)\n# FALSE\nis_prime <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- is_prime\n if(!identical(candidate(6), FALSE)){quit('no', 1)}\n if(!identical(candidate(101), TRUE)){quit('no', 1)}\n if(!identical(candidate(11), TRUE)){quit('no', 1)}\n if(!identical(candidate(13441), TRUE)){quit('no', 1)}\n if(!identical(candidate(61), TRUE)){quit('no', 1)}\n if(!identical(candidate(4), FALSE)){quit('no', 1)}\n if(!identical(candidate(1), FALSE)){quit('no', 1)}\n if(!identical(candidate(5), TRUE)){quit('no', 1)}\n if(!identical(candidate(11), TRUE)){quit('no', 1)}\n if(!identical(candidate(17), TRUE)){quit('no', 1)}\n if(!identical(candidate(85), FALSE)){quit('no', 1)}\n if(!identical(candidate(77), FALSE)){quit('no', 1)}\n if(!identical(candidate(255379), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "r", - "prompt": "# Given a list of positive integers x. return a sorted list of all \n# elements that hasn't any even digit.\n# Note: Returned list should be sorted in increasing order.\n# For example:\n# >>> unique_digits(c(15, 33, 1422, 1))\n# list(1, 15, 33)\n# >>> unique_digits(c(152, 323, 1422, 10))\n# list()\nunique_digits <- function(x) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- unique_digits\n if(!identical(candidate(c(15, 33, 1422, 1)), list(1, 15, 33))){quit('no', 1)}\n if(!identical(candidate(c(152, 323, 1422, 10)), list())){quit('no', 1)}\n if(!identical(candidate(c(12345, 2033, 111, 151)), list(111, 151))){quit('no', 1)}\n if(!identical(candidate(c(135, 103, 31)), list(31, 135))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "r", - "prompt": "# Input are two strings a and b consisting only of 1s and 0s.\n# Perform binary XOR on these inputs and return result also as a string.\n# >>> string_xor('010', '110')\n# '100'\nstring_xor <- function(a, b) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- string_xor\n if(!identical(candidate('111000', '101010'), '010010')){quit('no', 1)}\n if(!identical(candidate('1', '1'), '0')){quit('no', 1)}\n if(!identical(candidate('0101', '0000'), '0101')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "r", - "prompt": "# sum_to_n is a function that sums numbers from 1 to n.\n# >>> sum_to_n(30)\n# 465\n# >>> sum_to_n(100)\n# 5050\n# >>> sum_to_n(5)\n# 15\n# >>> sum_to_n(10)\n# 55\n# >>> sum_to_n(1)\n# 1\nsum_to_n <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- sum_to_n\n if(!identical(candidate(1), 1)){quit('no', 1)}\n if(!identical(candidate(6), 21)){quit('no', 1)}\n if(!identical(candidate(11), 66)){quit('no', 1)}\n if(!identical(candidate(30), 465)){quit('no', 1)}\n if(!identical(candidate(100), 5050)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "r", - "prompt": "# Given a list of numbers, return the sum of squares of the numbers\n# in the list that are odd. Ignore numbers that are negative or not integers.\n# >>> double_the_difference(c(1, 3, 2, 0))\n# 10\n# >>> double_the_difference(c(-1, -2, 0))\n# 0\n# >>> double_the_difference(c(9, -2))\n# 81\n# >>> double_the_difference(c(0))\n# 0\n# If the input list is empty, return 0.\ndouble_the_difference <- function(lst) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- double_the_difference\n if(!identical(candidate(c()), 0)){quit('no', 1)}\n if(!identical(candidate(c(5.0, 4.0)), 25)){quit('no', 1)}\n if(!identical(candidate(c(0.1, 0.2, 0.3)), 0)){quit('no', 1)}\n if(!identical(candidate(c(-10.0, -20.0, -30.0)), 0)){quit('no', 1)}\n if(!identical(candidate(c(-1.0, -2.0, 8.0)), 0)){quit('no', 1)}\n if(!identical(candidate(c(0.2, 3.0, 5.0)), 34)){quit('no', 1)}\n if(!identical(candidate(c(-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0)), 165)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "r", - "prompt": "# Return length of given string\n# >>> strlen('')\n# 0\n# >>> strlen('abc')\n# 3\nstrlen <- function(string) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- strlen\n if(!identical(candidate(''), 0)){quit('no', 1)}\n if(!identical(candidate('x'), 1)){quit('no', 1)}\n if(!identical(candidate('asdasnakj'), 9)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "r", - "prompt": "# You'll be given a string of words, and your task is to count the number\n# of boredoms. A boredom is a sentence that starts with the word \"I\".\n# Sentences are delimited by '.', '?' or '!'.\n# For example:\n# >>> is_bored('Hello world')\n# 0\n# >>> is_bored('The sky is blue. The sun is shining. I love this weather')\n# 1\nis_bored <- function(S) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- is_bored\n if(!identical(candidate('Hello world'), 0)){quit('no', 1)}\n if(!identical(candidate('Is the sky blue?'), 0)){quit('no', 1)}\n if(!identical(candidate('I love It !'), 1)){quit('no', 1)}\n if(!identical(candidate('bIt'), 0)){quit('no', 1)}\n if(!identical(candidate('I feel good today. I will be productive. will kill It'), 2)){quit('no', 1)}\n if(!identical(candidate('You and I are going for a walk'), 0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "r", - "prompt": "# Write a function vowels_count which takes a string representing\n# a word as input and returns the number of vowels in the string.\n# Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n# vowel, but only when it is at the end of the given word.\n# Example:\n# >>> vowels_count('abcde')\n# 2\n# >>> vowels_count('ACEDY')\n# 3\nvowels_count <- function(s) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- vowels_count\n if(!identical(candidate('abcde'), 2)){quit('no', 1)}\n if(!identical(candidate('Alone'), 3)){quit('no', 1)}\n if(!identical(candidate('key'), 2)){quit('no', 1)}\n if(!identical(candidate('bye'), 1)){quit('no', 1)}\n if(!identical(candidate('keY'), 2)){quit('no', 1)}\n if(!identical(candidate('bYe'), 1)){quit('no', 1)}\n if(!identical(candidate('ACEDY'), 3)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "r", - "prompt": "# Return n-th Fibonacci number.\n# >>> fib(10)\n# 55\n# >>> fib(1)\n# 1\n# >>> fib(8)\n# 21\nfib <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- fib\n if(!identical(candidate(10), 55)){quit('no', 1)}\n if(!identical(candidate(1), 1)){quit('no', 1)}\n if(!identical(candidate(8), 21)){quit('no', 1)}\n if(!identical(candidate(11), 89)){quit('no', 1)}\n if(!identical(candidate(12), 144)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "r", - "prompt": "# Your task is to implement a function that will simplify the expression\n# x * n. The function returns TRUE if x * n evaluates to a whole number and FALSE\n# otherwise. Both x and n, are string representation of a fraction, and have the following format,\n# / where both numerator and denominator are positive whole numbers.\n# You can assume that x, and n are valid fractions, and do not have zero as denominator.\n# >>> simplify('1/5', '5/1')\n# TRUE\n# >>> simplify('1/6', '2/1')\n# FALSE\n# >>> simplify('7/10', '10/2')\n# FALSE\nsimplify <- function(x, n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- simplify\n if(!identical(candidate('1/5', '5/1'), TRUE)){quit('no', 1)}\n if(!identical(candidate('1/6', '2/1'), FALSE)){quit('no', 1)}\n if(!identical(candidate('5/1', '3/1'), TRUE)){quit('no', 1)}\n if(!identical(candidate('7/10', '10/2'), FALSE)){quit('no', 1)}\n if(!identical(candidate('2/10', '50/10'), TRUE)){quit('no', 1)}\n if(!identical(candidate('7/2', '4/2'), TRUE)){quit('no', 1)}\n if(!identical(candidate('11/6', '6/1'), TRUE)){quit('no', 1)}\n if(!identical(candidate('2/3', '5/2'), FALSE)){quit('no', 1)}\n if(!identical(candidate('5/2', '3/5'), FALSE)){quit('no', 1)}\n if(!identical(candidate('2/4', '8/4'), TRUE)){quit('no', 1)}\n if(!identical(candidate('2/4', '4/2'), TRUE)){quit('no', 1)}\n if(!identical(candidate('1/5', '5/1'), TRUE)){quit('no', 1)}\n if(!identical(candidate('1/5', '1/5'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "r", - "prompt": "# Given a string s, count the number of uppercase vowels in even indices.\n# For example:\n# >>> count_upper('aBCdEf')\n# 1\n# >>> count_upper('abcdefg')\n# 0\n# >>> count_upper('dBBE')\n# 0\ncount_upper <- function(s) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- count_upper\n if(!identical(candidate('aBCdEf'), 1)){quit('no', 1)}\n if(!identical(candidate('abcdefg'), 0)){quit('no', 1)}\n if(!identical(candidate('dBBE'), 0)){quit('no', 1)}\n if(!identical(candidate('B'), 0)){quit('no', 1)}\n if(!identical(candidate('U'), 1)){quit('no', 1)}\n if(!identical(candidate(''), 0)){quit('no', 1)}\n if(!identical(candidate('EEEE'), 2)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "r", - "prompt": "# You are given a rectangular grid of wells. Each row represents a single well,\n# and each 1 in a row represents a single unit of water.\n# Each well has a corresponding bucket that can be used to extract water from it, \n# and all buckets have the same capacity.\n# Your task is to use the buckets to empty the wells.\n# Output the number of times you need to lower the buckets.\n# Example 1:\n# >>> max_fill(list(list(0, 0, 1, 0), list(0, 1, 0, 0), list(1, 1, 1, 1)), 1)\n# 6\n# Example 2:\n# >>> max_fill(list(list(0, 0, 1, 1), list(0, 0, 0, 0), list(1, 1, 1, 1), list(0, 1, 1, 1)), 2)\n# 5\n# Example 3:\n# >>> max_fill(list(list(0, 0, 0), list(0, 0, 0)), 5)\n# 0\n# Constraints:\n# * all wells have the same length\n# * 1 <= grid.length <= 10^2\n# * 1 <= grid[:,1].length <= 10^2\n# * grid[i][j] -> 0 | 1\n# * 1 <= capacity <= 10\nmax_fill <- function(grid, capacity) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- max_fill\n if(!identical(candidate(list(list(0, 0, 1, 0), list(0, 1, 0, 0), list(1, 1, 1, 1)), 1), 6)){quit('no', 1)}\n if(!identical(candidate(list(list(0, 0, 1, 1), list(0, 0, 0, 0), list(1, 1, 1, 1), list(0, 1, 1, 1)), 2), 5)){quit('no', 1)}\n if(!identical(candidate(list(list(0, 0, 0), list(0, 0, 0)), 5), 0)){quit('no', 1)}\n if(!identical(candidate(list(list(1, 1, 1, 1), list(1, 1, 1, 1)), 2), 4)){quit('no', 1)}\n if(!identical(candidate(list(list(1, 1, 1, 1), list(1, 1, 1, 1)), 9), 2)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "r", - "prompt": "# Given a vector arr of integers and a positive integer k, return a sorted list \n# of length k with the maximum k numbers in arr.\n# Example 1:\n# >>> maximum(c(-3, -4, 5), 3)\n# list(-4, -3, 5)\n# Example 2:\n# >>> maximum(c(4, -4, 4), 2)\n# list(4, 4)\n# Example 3:\n# >>> maximum(c(-3, 2, 1, 2, -1, -2, 1), 1)\n# list(2)\n# Note:\n# 1. The length of the vector will be in the range of [1, 1000].\n# 2. The elements in the vector will be in the range of [-1000, 1000].\n# 3. 0 <= k <= len(arr)\nmaximum <- function(arr, k) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- maximum\n if(!identical(candidate(c(-3, -4, 5), 3), list(-4, -3, 5))){quit('no', 1)}\n if(!identical(candidate(c(4, -4, 4), 2), list(4, 4))){quit('no', 1)}\n if(!identical(candidate(c(-3, 2, 1, 2, -1, -2, 1), 1), list(2))){quit('no', 1)}\n if(!identical(candidate(c(123, -123, 20, 0, 1, 2, -3), 3), list(2, 20, 123))){quit('no', 1)}\n if(!identical(candidate(c(-123, 20, 0, 1, 2, -3), 4), list(0, 1, 2, 20))){quit('no', 1)}\n if(!identical(candidate(c(5, 15, 0, 3, -13, -8, 0), 7), list(-13, -8, 0, 0, 3, 5, 15))){quit('no', 1)}\n if(!identical(candidate(c(-1, 0, 2, 5, 3, -10), 2), list(3, 5))){quit('no', 1)}\n if(!identical(candidate(c(1, 0, 5, -7), 1), list(5))){quit('no', 1)}\n if(!identical(candidate(c(4, -4), 2), list(-4, 4))){quit('no', 1)}\n if(!identical(candidate(c(-10, 10), 2), list(-10, 10))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, -23, 243, -400, 0), 0), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "r", - "prompt": "# Write a function that takes a message, and encodes in such a \n# way that it swaps case of all letters, replaces all vowels in \n# the message with the letter that appears 2 places ahead of that \n# vowel in the english alphabet. \n# Assume only letters. \n# Examples:\n# >>> encode('test')\n# 'TGST'\n# >>> encode('This is a message')\n# 'tHKS KS C MGSSCGG'\nencode <- function(message) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- encode\n if(!identical(candidate('TEST'), 'tgst')){quit('no', 1)}\n if(!identical(candidate('Mudasir'), 'mWDCSKR')){quit('no', 1)}\n if(!identical(candidate('YES'), 'ygs')){quit('no', 1)}\n if(!identical(candidate('This is a message'), 'tHKS KS C MGSSCGG')){quit('no', 1)}\n if(!identical(candidate('I DoNt KnOw WhAt tO WrItE'), 'k dQnT kNqW wHcT Tq wRkTg')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "r", - "prompt": "# remove_vowels is a function that takes string and returns string without vowels.\n# >>> remove_vowels('')\n# ''\n# >>> remove_vowels('abcdef')\n# 'bcdf'\n# >>> remove_vowels('aaaaa')\n# ''\n# >>> remove_vowels('aaBAA')\n# 'B'\n# >>> remove_vowels('zbcd')\n# 'zbcd'\nremove_vowels <- function(text) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- remove_vowels\n if(!identical(candidate(''), '')){quit('no', 1)}\n if(!identical(candidate('abcdef\\nghijklm'), 'bcdf\\nghjklm')){quit('no', 1)}\n if(!identical(candidate('fedcba'), 'fdcb')){quit('no', 1)}\n if(!identical(candidate('eeeee'), '')){quit('no', 1)}\n if(!identical(candidate('acBAA'), 'cB')){quit('no', 1)}\n if(!identical(candidate('EcBOO'), 'cB')){quit('no', 1)}\n if(!identical(candidate('ybcd'), 'ybcd')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "r", - "prompt": "# Return only positive numbers in the list.\n# >>> get_positive(c(-1, 2, -4, 5, 6))\n# list(2, 5, 6)\n# >>> get_positive(c(5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10))\n# list(5, 3, 2, 3, 9, 123, 1)\nget_positive <- function(l) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- get_positive\n if(!identical(candidate(c(-1, -2, 4, 5, 6)), list(4, 5, 6))){quit('no', 1)}\n if(!identical(candidate(c(5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10)), list(5, 3, 2, 3, 3, 9, 123, 1))){quit('no', 1)}\n if(!identical(candidate(c(-1, -2)), list())){quit('no', 1)}\n if(!identical(candidate(c()), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "r", - "prompt": "# Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n# >>> string_sequence(0)\n# '0'\n# >>> string_sequence(5)\n# '0 1 2 3 4 5'\nstring_sequence <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- string_sequence\n if(!identical(candidate(0), '0')){quit('no', 1)}\n if(!identical(candidate(3), '0 1 2 3')){quit('no', 1)}\n if(!identical(candidate(10), '0 1 2 3 4 5 6 7 8 9 10')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "r", - "prompt": "# Given a positive integer n, you have to make a pile of n levels of stones.\n# The first level has n stones.\n# The number of stones in the next level is:\n# - the next odd number if n is odd.\n# - the next even number if n is even.\n# Return the number of stones in each level in a list, where element at index\n# i represents the number of stones in the level (i+1).\n# Examples:\n# >>> make_a_pile(3)\n# list(3, 5, 7)\nmake_a_pile <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- make_a_pile\n if(!identical(candidate(3), list(3, 5, 7))){quit('no', 1)}\n if(!identical(candidate(4), list(4, 6, 8, 10))){quit('no', 1)}\n if(!identical(candidate(5), list(5, 7, 9, 11, 13))){quit('no', 1)}\n if(!identical(candidate(6), list(6, 8, 10, 12, 14, 16))){quit('no', 1)}\n if(!identical(candidate(8), list(8, 10, 12, 14, 16, 18, 20, 22))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "r", - "prompt": "# Task\n# 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\n# then check if the result string is palindrome.\n# A string is called palindrome if it reads the same backward as forward.\n# You should return a list containing the result string and TRUE/FALSE for the check.\n# Example\n# >>> reverse_delete('abcde', 'ae')\n# list('bcd', FALSE)\n# >>> reverse_delete('abcdef', 'b')\n# list('acdef', FALSE)\n# >>> reverse_delete('abcdedcba', 'ab')\n# list('cdedc', TRUE)\nreverse_delete <- function(s, c) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- reverse_delete\n if(!identical(candidate('abcde', 'ae'), list('bcd', FALSE))){quit('no', 1)}\n if(!identical(candidate('abcdef', 'b'), list('acdef', FALSE))){quit('no', 1)}\n if(!identical(candidate('abcdedcba', 'ab'), list('cdedc', TRUE))){quit('no', 1)}\n if(!identical(candidate('dwik', 'w'), list('dik', FALSE))){quit('no', 1)}\n if(!identical(candidate('a', 'a'), list('', TRUE))){quit('no', 1)}\n if(!identical(candidate('abcdedcba', ''), list('abcdedcba', TRUE))){quit('no', 1)}\n if(!identical(candidate('abcdedcba', 'v'), list('abcdedcba', TRUE))){quit('no', 1)}\n if(!identical(candidate('vabba', 'v'), list('abba', TRUE))){quit('no', 1)}\n if(!identical(candidate('mamma', 'mia'), list('', TRUE))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "r", - "prompt": "# For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n# >>> flip_case('Hello')\n# 'hELLO'\nflip_case <- function(string) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- flip_case\n if(!identical(candidate(''), '')){quit('no', 1)}\n if(!identical(candidate('Hello!'), 'hELLO!')){quit('no', 1)}\n if(!identical(candidate('These violent delights have violent ends'), 'tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "r", - "prompt": "# You are given a string s.\n# if s[i] is a letter, reverse its case from lower to upper or vise versa, \n# otherwise keep it as it is.\n# If the string contains no letters, reverse the string.\n# The function should return the resulted string.\n# Examples\n# >>> solve('1234')\n# '4321'\n# >>> solve('ab')\n# 'AB'\n# >>> solve('#a@C')\n# '#A@c'\nsolve <- function(s) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- solve\n if(!identical(candidate('AsDf'), 'aSdF')){quit('no', 1)}\n if(!identical(candidate('1234'), '4321')){quit('no', 1)}\n if(!identical(candidate('ab'), 'AB')){quit('no', 1)}\n if(!identical(candidate('#a@C'), '#A@c')){quit('no', 1)}\n if(!identical(candidate('#AsdfW^45'), '#aSDFw^45')){quit('no', 1)}\n if(!identical(candidate('#6@2'), '2@6#')){quit('no', 1)}\n if(!identical(candidate('#$a^D'), '#$A^d')){quit('no', 1)}\n if(!identical(candidate('#ccc'), '#CCC')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "r", - "prompt": "# Filter an input list of strings only for ones that start with a given prefix.\n# >>> filter_by_prefix(c(), 'a')\n# list()\n# >>> filter_by_prefix(c('abc', 'bcd', 'cde', 'array'), 'a')\n# list('abc', 'array')\nfilter_by_prefix <- function(strings, prefix) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- filter_by_prefix\n if(!identical(candidate(c(), 'john'), list())){quit('no', 1)}\n if(!identical(candidate(c('xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'), 'xxx'), list('xxx', 'xxxAAA', 'xxx'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "r", - "prompt": "# This function takes two positive numbers x and y and returns the\n# biggest even integer number that is in the range [x, y] inclusive. If \n# there's no such number, then the function should return -1.\n# For example:\n# >>> choose_num(12, 15)\n# 14\n# >>> choose_num(13, 12)\n# -1\nchoose_num <- function(x, y) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- choose_num\n if(!identical(candidate(12, 15), 14)){quit('no', 1)}\n if(!identical(candidate(13, 12), -1)){quit('no', 1)}\n if(!identical(candidate(33, 12354), 12354)){quit('no', 1)}\n if(!identical(candidate(5234, 5233), -1)){quit('no', 1)}\n if(!identical(candidate(6, 29), 28)){quit('no', 1)}\n if(!identical(candidate(27, 10), -1)){quit('no', 1)}\n if(!identical(candidate(7, 7), -1)){quit('no', 1)}\n if(!identical(candidate(546, 546), 546)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "r", - "prompt": "# You are given a string representing a sentence,\n# the sentence contains some words separated by a space,\n# and you have to return a string that contains the words from the original sentence,\n# whose lengths are prime numbers,\n# the order of the words in the new string should be the same as the original one.\n# Example 1:\n# >>> words_in_sentence('This is a test')\n# 'is'\n# Example 2:\n# >>> words_in_sentence('lets go for swimming')\n# 'go for'\n# Constraints:\n# * 1 <= len(sentence) <= 100\n# * sentence contains only letters\nwords_in_sentence <- function(sentence) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- words_in_sentence\n if(!identical(candidate('This is a test'), 'is')){quit('no', 1)}\n if(!identical(candidate('lets go for swimming'), 'go for')){quit('no', 1)}\n if(!identical(candidate('there is no place available here'), 'there is no place')){quit('no', 1)}\n if(!identical(candidate('Hi I am Hussein'), 'Hi am Hussein')){quit('no', 1)}\n if(!identical(candidate('go for it'), 'go for it')){quit('no', 1)}\n if(!identical(candidate('here'), '')){quit('no', 1)}\n if(!identical(candidate('here is'), 'is')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "r", - "prompt": "# Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n# >>> intersperse(c(), 4)\n# list()\n# >>> intersperse(c(1, 2, 3), 4)\n# list(1, 4, 2, 4, 3)\nintersperse <- function(numbers, delimeter) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- intersperse\n if(!identical(candidate(c(), 7), list())){quit('no', 1)}\n if(!identical(candidate(c(5, 6, 3, 2), 8), list(5, 8, 6, 8, 3, 8, 2))){quit('no', 1)}\n if(!identical(candidate(c(2, 2, 2), 2), list(2, 2, 2, 2, 2))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "r", - "prompt": "# Your task is to write a function that returns true if a number x is a simple\n# power of n and false in other cases.\n# x is a simple power of n if n**int=x\n# For example:\n# >>> is_simple_power(1, 4)\n# TRUE\n# >>> is_simple_power(2, 2)\n# TRUE\n# >>> is_simple_power(8, 2)\n# TRUE\n# >>> is_simple_power(3, 2)\n# FALSE\n# >>> is_simple_power(3, 1)\n# FALSE\n# >>> is_simple_power(5, 3)\n# FALSE\nis_simple_power <- function(x, n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- is_simple_power\n if(!identical(candidate(16, 2), TRUE)){quit('no', 1)}\n if(!identical(candidate(143214, 16), FALSE)){quit('no', 1)}\n if(!identical(candidate(4, 2), TRUE)){quit('no', 1)}\n if(!identical(candidate(9, 3), TRUE)){quit('no', 1)}\n if(!identical(candidate(16, 4), TRUE)){quit('no', 1)}\n if(!identical(candidate(24, 2), FALSE)){quit('no', 1)}\n if(!identical(candidate(128, 4), FALSE)){quit('no', 1)}\n if(!identical(candidate(12, 6), FALSE)){quit('no', 1)}\n if(!identical(candidate(1, 1), TRUE)){quit('no', 1)}\n if(!identical(candidate(1, 12), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "r", - "prompt": "# Write a function that returns true if the given number is the multiplication of 3 prime numbers\n# and false otherwise.\n# Knowing that (a) is less then 100. \n# Example:\n# >>> is_multiply_prime(30)\n# TRUE\n# 30 = 2 * 3 * 5\nis_multiply_prime <- function(a) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- is_multiply_prime\n if(!identical(candidate(5), FALSE)){quit('no', 1)}\n if(!identical(candidate(30), TRUE)){quit('no', 1)}\n if(!identical(candidate(8), TRUE)){quit('no', 1)}\n if(!identical(candidate(10), FALSE)){quit('no', 1)}\n if(!identical(candidate(125), TRUE)){quit('no', 1)}\n if(!identical(candidate(105), TRUE)){quit('no', 1)}\n if(!identical(candidate(126), FALSE)){quit('no', 1)}\n if(!identical(candidate(729), FALSE)){quit('no', 1)}\n if(!identical(candidate(891), FALSE)){quit('no', 1)}\n if(!identical(candidate(1001), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "r", - "prompt": "# Given the lengths of the three sides of a triangle. Return TRUE if the three\n# sides form a right-angled triangle, FALSE otherwise.\n# A right-angled triangle is a triangle in which one angle is right angle or \n# 90 degree.\n# Example:\n# >>> right_angle_triangle(3, 4, 5)\n# TRUE\n# >>> right_angle_triangle(1, 2, 3)\n# FALSE\nright_angle_triangle <- function(a, b, c) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- right_angle_triangle\n if(!identical(candidate(3, 4, 5), TRUE)){quit('no', 1)}\n if(!identical(candidate(1, 2, 3), FALSE)){quit('no', 1)}\n if(!identical(candidate(10, 6, 8), TRUE)){quit('no', 1)}\n if(!identical(candidate(2, 2, 2), FALSE)){quit('no', 1)}\n if(!identical(candidate(7, 24, 25), TRUE)){quit('no', 1)}\n if(!identical(candidate(10, 5, 7), FALSE)){quit('no', 1)}\n if(!identical(candidate(5, 12, 13), TRUE)){quit('no', 1)}\n if(!identical(candidate(15, 8, 17), TRUE)){quit('no', 1)}\n if(!identical(candidate(48, 55, 73), TRUE)){quit('no', 1)}\n if(!identical(candidate(1, 1, 1), FALSE)){quit('no', 1)}\n if(!identical(candidate(2, 2, 10), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "r", - "prompt": "# Create a function that takes 3 numbers.\n# Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n# Returns false in any other cases.\n# Examples\n# >>> any_int(5, 2, 7)\n# TRUE\n# >>> any_int(3, 2, 2)\n# FALSE\n# >>> any_int(3, -2, 1)\n# TRUE\n# >>> any_int(3.6, -2.2, 2)\n# FALSE\nany_int <- function(x, y, z) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- any_int\n if(!identical(candidate(2, 3, 1), TRUE)){quit('no', 1)}\n if(!identical(candidate(2.5, 2, 3), FALSE)){quit('no', 1)}\n if(!identical(candidate(1.5, 5, 3.5), FALSE)){quit('no', 1)}\n if(!identical(candidate(2, 6, 2), FALSE)){quit('no', 1)}\n if(!identical(candidate(4, 2, 2), TRUE)){quit('no', 1)}\n if(!identical(candidate(2.2, 2.2, 2.2), FALSE)){quit('no', 1)}\n if(!identical(candidate(-4, 6, 2), TRUE)){quit('no', 1)}\n if(!identical(candidate(2, 1, 1), TRUE)){quit('no', 1)}\n if(!identical(candidate(3, 4, 7), TRUE)){quit('no', 1)}\n if(!identical(candidate(3.0, 4, 7), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "r", - "prompt": "# This function takes a list l and returns a list l' such that\n# l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n# to the values of the corresponding indicies of l, but sorted.\n# >>> sort_third(c(1, 2, 3))\n# list(1, 2, 3)\n# >>> sort_third(c(5, 6, 3, 4, 8, 9, 2))\n# list(2, 6, 3, 4, 8, 9, 5)\nsort_third <- function(l) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- sort_third\n if(!identical(candidate(c(5, 6, 3, 4, 8, 9, 2)), list(2, 6, 3, 4, 8, 9, 5))){quit('no', 1)}\n if(!identical(candidate(c(5, 8, 3, 4, 6, 9, 2)), list(2, 8, 3, 4, 6, 9, 5))){quit('no', 1)}\n if(!identical(candidate(c(5, 6, 9, 4, 8, 3, 2)), list(2, 6, 9, 4, 8, 3, 5))){quit('no', 1)}\n if(!identical(candidate(c(5, 6, 3, 4, 8, 9, 2, 1)), list(2, 6, 3, 4, 8, 9, 5, 1))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_53_add", - "language": "r", - "prompt": "# Add two numbers x and y\n# >>> add(2, 3)\n# 5\n# >>> add(5, 7)\n# 12\nadd <- function(x, y) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- add\n if(!identical(candidate(0, 1), 1)){quit('no', 1)}\n if(!identical(candidate(1, 0), 1)){quit('no', 1)}\n if(!identical(candidate(2, 3), 5)){quit('no', 1)}\n if(!identical(candidate(5, 7), 12)){quit('no', 1)}\n if(!identical(candidate(7, 5), 12)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_69_search", - "language": "r", - "prompt": "# You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n# zero, and has a frequency greater than or equal to the value of the integer itself. \n# The frequency of an integer is the number of times it appears in the list.\n# If no such a value exist, return -1.\n# Examples:\n# >>> search(c(4, 1, 2, 2, 3, 1))\n# 2\n# >>> search(c(1, 2, 2, 3, 3, 3, 4, 4, 4))\n# 3\n# >>> search(c(5, 5, 4, 4, 4))\n# -1\nsearch <- function(lst) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- search\n if(!identical(candidate(c(5, 5, 5, 5, 1)), 1)){quit('no', 1)}\n if(!identical(candidate(c(4, 1, 4, 1, 4, 4)), 4)){quit('no', 1)}\n if(!identical(candidate(c(3, 3)), -1)){quit('no', 1)}\n if(!identical(candidate(c(8, 8, 8, 8, 8, 8, 8, 8)), 8)){quit('no', 1)}\n if(!identical(candidate(c(2, 3, 3, 2, 2)), 2)){quit('no', 1)}\n if(!identical(candidate(c(2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1)), 1)){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 8, 2)), 2)){quit('no', 1)}\n if(!identical(candidate(c(6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10)), 1)){quit('no', 1)}\n if(!identical(candidate(c(8, 8, 3, 6, 5, 6, 4)), -1)){quit('no', 1)}\n if(!identical(candidate(c(6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9)), 1)){quit('no', 1)}\n if(!identical(candidate(c(1, 9, 10, 1, 3)), 1)){quit('no', 1)}\n if(!identical(candidate(c(6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10)), 5)){quit('no', 1)}\n if(!identical(candidate(c(1)), 1)){quit('no', 1)}\n if(!identical(candidate(c(8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5)), 4)){quit('no', 1)}\n if(!identical(candidate(c(2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10)), 2)){quit('no', 1)}\n if(!identical(candidate(c(1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3)), 1)){quit('no', 1)}\n if(!identical(candidate(c(9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4)), 4)){quit('no', 1)}\n if(!identical(candidate(c(2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7)), 4)){quit('no', 1)}\n if(!identical(candidate(c(9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1)), 2)){quit('no', 1)}\n if(!identical(candidate(c(5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8)), -1)){quit('no', 1)}\n if(!identical(candidate(c(10)), -1)){quit('no', 1)}\n if(!identical(candidate(c(9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2)), 2)){quit('no', 1)}\n if(!identical(candidate(c(5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8)), 1)){quit('no', 1)}\n if(!identical(candidate(c(7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6)), 1)){quit('no', 1)}\n if(!identical(candidate(c(3, 10, 10, 9, 2)), -1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "r", - "prompt": "# Write a function that takes a string and returns TRUE if the string\n# length is a prime number or FALSE otherwise\n# Examples\n# >>> prime_length('Hello')\n# TRUE\n# >>> prime_length('abcdcba')\n# TRUE\n# >>> prime_length('kittens')\n# TRUE\n# >>> prime_length('orange')\n# FALSE\nprime_length <- function(string) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- prime_length\n if(!identical(candidate('Hello'), TRUE)){quit('no', 1)}\n if(!identical(candidate('abcdcba'), TRUE)){quit('no', 1)}\n if(!identical(candidate('kittens'), TRUE)){quit('no', 1)}\n if(!identical(candidate('orange'), FALSE)){quit('no', 1)}\n if(!identical(candidate('wow'), TRUE)){quit('no', 1)}\n if(!identical(candidate('world'), TRUE)){quit('no', 1)}\n if(!identical(candidate('MadaM'), TRUE)){quit('no', 1)}\n if(!identical(candidate('Wow'), TRUE)){quit('no', 1)}\n if(!identical(candidate(''), FALSE)){quit('no', 1)}\n if(!identical(candidate('HI'), TRUE)){quit('no', 1)}\n if(!identical(candidate('go'), TRUE)){quit('no', 1)}\n if(!identical(candidate('gogo'), FALSE)){quit('no', 1)}\n if(!identical(candidate('aaaaaaaaaaaaaaa'), FALSE)){quit('no', 1)}\n if(!identical(candidate('Madam'), TRUE)){quit('no', 1)}\n if(!identical(candidate('M'), FALSE)){quit('no', 1)}\n if(!identical(candidate('0'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_58_common", - "language": "r", - "prompt": "# Return sorted unique common elements for two lists.\n# >>> common(c(1, 4, 3, 34, 653, 2, 5), c(5, 7, 1, 5, 9, 653, 121))\n# list(1, 5, 653)\n# >>> common(c(5, 3, 2, 8), c(3, 2))\n# list(2, 3)\ncommon <- function(l1, l2) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- common\n if(!identical(candidate(c(1, 4, 3, 34, 653, 2, 5), c(5, 7, 1, 5, 9, 653, 121)), list(1, 5, 653))){quit('no', 1)}\n if(!identical(candidate(c(5, 3, 2, 8), c(3, 2)), list(2, 3))){quit('no', 1)}\n if(!identical(candidate(c(4, 3, 2, 8), c(3, 2, 4)), list(2, 3, 4))){quit('no', 1)}\n if(!identical(candidate(c(4, 3, 2, 8), c()), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "r", - "prompt": "# The Brazilian factorial is defined as:\n# brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n# where n > 0\n# For example:\n# >>> special_factorial(4)\n# 288\n# The function will receive an integer as input and should return the special\n# factorial of this integer.\nspecial_factorial <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- special_factorial\n if(!identical(candidate(4), 288)){quit('no', 1)}\n if(!identical(candidate(5), 34560)){quit('no', 1)}\n if(!identical(candidate(7), 125411328000)){quit('no', 1)}\n if(!identical(candidate(1), 1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "r", - "prompt": "# In this problem, you will implement a function that takes two lists of numbers,\n# and determines whether it is possible to perform an exchange of elements\n# between them to make lst1 a list of only even numbers.\n# There is no limit on the number of exchanged elements between lst1 and lst2.\n# If it is possible to exchange elements between the lst1 and lst2 to make\n# all the elements of lst1 to be even, return \"YES\".\n# Otherwise, return \"NO\".\n# For example:\n# >>> exchange(c(1, 2, 3, 4), c(1, 2, 3, 4))\n# 'YES'\n# >>> exchange(c(1, 2, 3, 4), c(1, 5, 3, 4))\n# 'NO'\n# It is assumed that the input lists will be non-empty.\nexchange <- function(lst1, lst2) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- exchange\n if(!identical(candidate(c(1, 2, 3, 4), c(1, 2, 3, 4)), 'YES')){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4), c(1, 5, 3, 4)), 'NO')){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4), c(2, 1, 4, 3)), 'YES')){quit('no', 1)}\n if(!identical(candidate(c(5, 7, 3), c(2, 6, 4)), 'YES')){quit('no', 1)}\n if(!identical(candidate(c(5, 7, 3), c(2, 6, 3)), 'NO')){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 6, 1, 8, 9), c(3, 5, 5, 1, 1, 1)), 'NO')){quit('no', 1)}\n if(!identical(candidate(c(100, 200), c(200, 200)), 'YES')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "r", - "prompt": "# Given a non-empty vector of integers arr and an integer k, return\n# the sum of the elements with at most two digits from the first k elements of arr.\n# Example:\n# >>> add_elements(c(111, 21, 3, 4000, 5, 6, 7, 8, 9), 4)\n# 24\n# Constraints:\n# 1. 1 <= len(arr) <= 100\n# 2. 1 <= k <= len(arr)\nadd_elements <- function(arr, k) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- add_elements\n if(!identical(candidate(c(1, -2, -3, 41, 57, 76, 87, 88, 99), 3), -4)){quit('no', 1)}\n if(!identical(candidate(c(111, 121, 3, 4000, 5, 6), 2), 0)){quit('no', 1)}\n if(!identical(candidate(c(11, 21, 3, 90, 5, 6, 7, 8, 9), 4), 125)){quit('no', 1)}\n if(!identical(candidate(c(111, 21, 3, 4000, 5, 6, 7, 8, 9), 4), 24)){quit('no', 1)}\n if(!identical(candidate(c(1), 1), 1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "r", - "prompt": "# A simple program which should return the value of x if n is \n# a prime number and should return the value of y otherwise.\n# Examples:\n# >>> x_or_y(7, 34, 12)\n# 34\n# >>> x_or_y(15, 8, 5)\n# 5\nx_or_y <- function(n, x, y) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- x_or_y\n if(!identical(candidate(7, 34, 12), 34)){quit('no', 1)}\n if(!identical(candidate(15, 8, 5), 5)){quit('no', 1)}\n if(!identical(candidate(3, 33, 5212), 33)){quit('no', 1)}\n if(!identical(candidate(1259, 3, 52), 3)){quit('no', 1)}\n if(!identical(candidate(7919, -1, 12), -1)){quit('no', 1)}\n if(!identical(candidate(3609, 1245, 583), 583)){quit('no', 1)}\n if(!identical(candidate(91, 56, 129), 129)){quit('no', 1)}\n if(!identical(candidate(6, 34, 1234), 1234)){quit('no', 1)}\n if(!identical(candidate(1, 2, 0), 0)){quit('no', 1)}\n if(!identical(candidate(2, 2, 0), 2)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "r", - "prompt": "# Given length of a side and high return area for a triangle.\n# >>> triangle_area(5, 3)\n# 7.5\ntriangle_area <- function(a, h) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- triangle_area\n if(!identical(candidate(5, 3), 7.5)){quit('no', 1)}\n if(!identical(candidate(2, 2), 2.0)){quit('no', 1)}\n if(!identical(candidate(10, 8), 40.0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "r", - "prompt": "# Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n# the last couple centuries. However, what people don't know is Tribonacci sequence.\n# Tribonacci sequence is defined by the recurrence:\n# tri(1) = 3\n# tri(n) = 1 + n / 2, if n is even.\n# tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n# For example:\n# tri(2) = 1 + (2 / 2) = 2\n# tri(4) = 3\n# tri(3) = tri(2) + tri(1) + tri(4)\n# = 2 + 3 + 3 = 8 \n# You are given a non-negative integer number n, you have to a return a list of the \n# first n + 1 numbers of the Tribonacci sequence.\n# Examples:\n# >>> tri(3)\n# list(1, 3, 2, 8)\ntri <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- tri\n if(!identical(candidate(3), list(1, 3, 2, 8))){quit('no', 1)}\n if(!identical(candidate(4), list(1, 3, 2, 8, 3))){quit('no', 1)}\n if(!identical(candidate(5), list(1, 3, 2, 8, 3, 15))){quit('no', 1)}\n if(!identical(candidate(6), list(1, 3, 2, 8, 3, 15, 4))){quit('no', 1)}\n if(!identical(candidate(7), list(1, 3, 2, 8, 3, 15, 4, 24))){quit('no', 1)}\n if(!identical(candidate(8), list(1, 3, 2, 8, 3, 15, 4, 24, 5))){quit('no', 1)}\n if(!identical(candidate(9), list(1, 3, 2, 8, 3, 15, 4, 24, 5, 35))){quit('no', 1)}\n if(!identical(candidate(20), list(1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11))){quit('no', 1)}\n if(!identical(candidate(0), list(1))){quit('no', 1)}\n if(!identical(candidate(1), list(1, 3))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "r", - "prompt": "# You are given a list of two strings, both strings consist of open\n# parentheses '(' or close parentheses ')' only.\n# Your job is to check if it is possible to concatenate the two strings in\n# some order, that the resulting string will be good.\n# A string S is considered to be good if and only if all parentheses in S\n# are balanced. For example: the string '(())()' is good, while the string\n# '())' is not.\n# Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n# Examples:\n# >>> match_parens(c('()(', ')'))\n# 'Yes'\n# >>> match_parens(c(')', ')'))\n# 'No'\nmatch_parens <- function(lst) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- match_parens\n if(!identical(candidate(c('()(', ')')), 'Yes')){quit('no', 1)}\n if(!identical(candidate(c(')', ')')), 'No')){quit('no', 1)}\n if(!identical(candidate(c('(()(())', '())())')), 'No')){quit('no', 1)}\n if(!identical(candidate(c(')())', '(()()(')), 'Yes')){quit('no', 1)}\n if(!identical(candidate(c('(())))', '(()())((')), 'Yes')){quit('no', 1)}\n if(!identical(candidate(c('()', '())')), 'No')){quit('no', 1)}\n if(!identical(candidate(c('(()(', '()))()')), 'Yes')){quit('no', 1)}\n if(!identical(candidate(c('((((', '((())')), 'No')){quit('no', 1)}\n if(!identical(candidate(c(')(()', '(()(')), 'No')){quit('no', 1)}\n if(!identical(candidate(c(')(', ')(')), 'No')){quit('no', 1)}\n if(!identical(candidate(c('(', ')')), 'Yes')){quit('no', 1)}\n if(!identical(candidate(c(')', '(')), 'Yes')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "r", - "prompt": "# From a list of integers, remove all elements that occur more than once.\n# Keep order of elements left the same as in the input.\n# >>> remove_duplicates(c(1, 2, 3, 2, 4))\n# list(1, 3, 4)\nremove_duplicates <- function(numbers) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- remove_duplicates\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4)), list(1, 2, 3, 4))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 2, 4, 3, 5)), list(1, 4, 5))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "r", - "prompt": "# Return a greatest common divisor of two integers a and b\n# >>> greatest_common_divisor(3, 5)\n# 1\n# >>> greatest_common_divisor(25, 15)\n# 5\ngreatest_common_divisor <- function(a, b) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- greatest_common_divisor\n if(!identical(candidate(3, 7), 1)){quit('no', 1)}\n if(!identical(candidate(10, 15), 5)){quit('no', 1)}\n if(!identical(candidate(49, 14), 7)){quit('no', 1)}\n if(!identical(candidate(144, 60), 12)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "r", - "prompt": "# Checks if given string is a palindrome\n# >>> is_palindrome('')\n# TRUE\n# >>> is_palindrome('aba')\n# TRUE\n# >>> is_palindrome('aaaaa')\n# TRUE\n# >>> is_palindrome('zbcd')\n# FALSE\nis_palindrome <- function(text) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- is_palindrome\n if(!identical(candidate(''), TRUE)){quit('no', 1)}\n if(!identical(candidate('aba'), TRUE)){quit('no', 1)}\n if(!identical(candidate('aaaaa'), TRUE)){quit('no', 1)}\n if(!identical(candidate('zbcd'), FALSE)){quit('no', 1)}\n if(!identical(candidate('xywyx'), TRUE)){quit('no', 1)}\n if(!identical(candidate('xywyz'), FALSE)){quit('no', 1)}\n if(!identical(candidate('xywzx'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "r", - "prompt": "# xs represent coefficients of a polynomial.\n# xs[0] + xs[1] * x + xs[2] * x^2 + ....\n# Return derivative of this polynomial in the same form.\n# >>> derivative(c(3, 1, 2, 4, 5))\n# list(1, 4, 12, 20)\n# >>> derivative(c(1, 2, 3))\n# list(2, 6)\nderivative <- function(xs) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- derivative\n if(!identical(candidate(c(3, 1, 2, 4, 5)), list(1, 4, 12, 20))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3)), list(2, 6))){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 1)), list(2, 2))){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 1, 0, 4)), list(2, 2, 0, 16))){quit('no', 1)}\n if(!identical(candidate(c(1)), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "r", - "prompt": "# In this task, you will be given a string that represents a number of apples and oranges \n# that are distributed in a basket of fruit this basket contains \n# apples, oranges, and mango fruits. Given the string that represents the total number of \n# the oranges and apples and an integer that represent the total number of the fruits \n# in the basket return the number of the mango fruits in the basket.\n# for examble:\n# >>> fruit_distribution('5 apples and 6 oranges', 19)\n# 8\n# >>> fruit_distribution('0 apples and 1 oranges', 3)\n# 2\n# >>> fruit_distribution('2 apples and 3 oranges', 100)\n# 95\n# >>> fruit_distribution('100 apples and 1 oranges', 120)\n# 19\nfruit_distribution <- function(s, n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- fruit_distribution\n if(!identical(candidate('5 apples and 6 oranges', 19), 8)){quit('no', 1)}\n if(!identical(candidate('5 apples and 6 oranges', 21), 10)){quit('no', 1)}\n if(!identical(candidate('0 apples and 1 oranges', 3), 2)){quit('no', 1)}\n if(!identical(candidate('1 apples and 0 oranges', 3), 2)){quit('no', 1)}\n if(!identical(candidate('2 apples and 3 oranges', 100), 95)){quit('no', 1)}\n if(!identical(candidate('2 apples and 3 oranges', 5), 0)){quit('no', 1)}\n if(!identical(candidate('1 apples and 100 oranges', 120), 19)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "r", - "prompt": "# Write a function that takes an integer a and returns TRUE \n# if this ingeger is a cube of some integer number.\n# Note: you may assume the input is always valid.\n# Examples:\n# >>> iscube(1)\n# TRUE\n# >>> iscube(2)\n# FALSE\n# >>> iscube(-1)\n# TRUE\n# >>> iscube(64)\n# TRUE\n# >>> iscube(0)\n# TRUE\n# >>> iscube(180)\n# FALSE\niscube <- function(a) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- iscube\n if(!identical(candidate(1), TRUE)){quit('no', 1)}\n if(!identical(candidate(2), FALSE)){quit('no', 1)}\n if(!identical(candidate(-1), TRUE)){quit('no', 1)}\n if(!identical(candidate(64), TRUE)){quit('no', 1)}\n if(!identical(candidate(180), FALSE)){quit('no', 1)}\n if(!identical(candidate(1000), TRUE)){quit('no', 1)}\n if(!identical(candidate(0), TRUE)){quit('no', 1)}\n if(!identical(candidate(1729), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "r", - "prompt": "# In this Kata, you have to sort a vector of non-negative integers according to\n# number of ones in their binary representation in ascending order.\n# For similar number of ones, sort based on decimal value.\n# It must be implemented like this:\n# >>> sort_array(c(1, 5, 2, 3, 4))\n# list(1, 2, 3, 4, 5)\n# >>> sort_array(c(-2, -3, -4, -5, -6))\n# list(-6, -5, -4, -3, -2)\n# >>> sort_array(c(1, 0, 2, 3, 4))\n# list(0, 1, 2, 3, 4)\nsort_array <- function(arr) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- sort_array\n if(!identical(candidate(c(1, 5, 2, 3, 4)), list(1, 2, 4, 3, 5))){quit('no', 1)}\n if(!identical(candidate(c(-2, -3, -4, -5, -6)), list(-4, -2, -6, -5, -3))){quit('no', 1)}\n if(!identical(candidate(c(1, 0, 2, 3, 4)), list(0, 1, 2, 4, 3))){quit('no', 1)}\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4)), list(2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77))){quit('no', 1)}\n if(!identical(candidate(c(3, 6, 44, 12, 32, 5)), list(32, 3, 5, 6, 12, 44))){quit('no', 1)}\n if(!identical(candidate(c(2, 4, 8, 16, 32)), list(2, 4, 8, 16, 32))){quit('no', 1)}\n if(!identical(candidate(c(2, 4, 8, 16, 32)), list(2, 4, 8, 16, 32))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "r", - "prompt": "# Given a list of strings, where each string consists of only digits, return a list.\n# Each element i of the output should be \"the number of odd elements in the\n# string i of the input.\" where all the i's should be replaced by the number\n# of odd digits in the i'th string of the input.\n# >>> odd_count(c('1234567'))\n# list('the number of odd elements 4n the str4ng 4 of the 4nput.')\n# >>> odd_count(c('3', '11111111'))\n# list('the number of odd elements 1n the str1ng 1 of the 1nput.', 'the number of odd elements 8n the str8ng 8 of the 8nput.')\nodd_count <- function(lst) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- odd_count\n if(!identical(candidate(c('1234567')), list('the number of odd elements 4n the str4ng 4 of the 4nput.'))){quit('no', 1)}\n if(!identical(candidate(c('3', '11111111')), list('the number of odd elements 1n the str1ng 1 of the 1nput.', 'the number of odd elements 8n the str8ng 8 of the 8nput.'))){quit('no', 1)}\n if(!identical(candidate(c('271', '137', '314')), list('the number of odd elements 2n the str2ng 2 of the 2nput.', 'the number of odd elements 3n the str3ng 3 of the 3nput.', 'the number of odd elements 2n the str2ng 2 of the 2nput.'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "r", - "prompt": "# brackets is a string of \"(\" and \")\".\n# return TRUE if every opening bracket has a corresponding closing bracket.\n# >>> correct_bracketing('(')\n# FALSE\n# >>> correct_bracketing('()')\n# TRUE\n# >>> correct_bracketing('(()())')\n# TRUE\n# >>> correct_bracketing(')(()')\n# FALSE\ncorrect_bracketing <- function(brackets) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- correct_bracketing\n if(!identical(candidate('()'), TRUE)){quit('no', 1)}\n if(!identical(candidate('(()())'), TRUE)){quit('no', 1)}\n if(!identical(candidate('()()(()())()'), TRUE)){quit('no', 1)}\n if(!identical(candidate('()()((()()())())(()()(()))'), TRUE)){quit('no', 1)}\n if(!identical(candidate('((()())))'), FALSE)){quit('no', 1)}\n if(!identical(candidate(')(()'), FALSE)){quit('no', 1)}\n if(!identical(candidate('('), FALSE)){quit('no', 1)}\n if(!identical(candidate('(((('), FALSE)){quit('no', 1)}\n if(!identical(candidate(')'), FALSE)){quit('no', 1)}\n if(!identical(candidate('(()'), FALSE)){quit('no', 1)}\n if(!identical(candidate('()()(()())())(()'), FALSE)){quit('no', 1)}\n if(!identical(candidate('()()(()())()))()'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "r", - "prompt": "# Task\n# Write a function that takes a string as input and returns the sum of the upper characters only'\n# ASCII codes.\n# Examples:\n# >>> digitSum('')\n# 0\n# >>> digitSum('abAB')\n# 131\n# >>> digitSum('abcCd')\n# 67\n# >>> digitSum('helloE')\n# 69\n# >>> digitSum('woArBld')\n# 131\n# >>> digitSum('aAaaaXa')\n# 153\ndigitSum <- function(s) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- digitSum\n if(!identical(candidate(''), 0)){quit('no', 1)}\n if(!identical(candidate('abAB'), 131)){quit('no', 1)}\n if(!identical(candidate('abcCd'), 67)){quit('no', 1)}\n if(!identical(candidate('helloE'), 69)){quit('no', 1)}\n if(!identical(candidate('woArBld'), 131)){quit('no', 1)}\n if(!identical(candidate('aAaaaXa'), 153)){quit('no', 1)}\n if(!identical(candidate(' How are yOu?'), 151)){quit('no', 1)}\n if(!identical(candidate('You arE Very Smart'), 327)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "r", - "prompt": "# Write a function that accepts a list of strings as a parameter,\n# deletes the strings that have odd lengths from it,\n# and returns the resulted list with a sorted order,\n# The list is always a list of strings and never a vector of numbers,\n# and it may contain duplicates.\n# The order of the list should be ascending by length of each word, and you\n# should return the list sorted by that rule.\n# If two words have the same length, sort the list alphabetically.\n# The function should return a list of strings in sorted order.\n# You may assume that all words will have the same length.\n# For example:\n# >>> list_sort(c('aa', 'a', 'aaa'))\n# list('aa')\n# >>> list_sort(c('ab', 'a', 'aaa', 'cd'))\n# list('ab', 'cd')\nsorted_list_sum <- function(lst) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- sorted_list_sum\n if(!identical(candidate(c('aa', 'a', 'aaa')), list('aa'))){quit('no', 1)}\n if(!identical(candidate(c('school', 'AI', 'asdf', 'b')), list('AI', 'asdf', 'school'))){quit('no', 1)}\n if(!identical(candidate(c('d', 'b', 'c', 'a')), list())){quit('no', 1)}\n if(!identical(candidate(c('d', 'dcba', 'abcd', 'a')), list('abcd', 'dcba'))){quit('no', 1)}\n if(!identical(candidate(c('AI', 'ai', 'au')), list('AI', 'ai', 'au'))){quit('no', 1)}\n if(!identical(candidate(c('a', 'b', 'b', 'c', 'c', 'a')), list())){quit('no', 1)}\n if(!identical(candidate(c('aaaa', 'bbbb', 'dd', 'cc')), list('cc', 'dd', 'aaaa', 'bbbb'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "r", - "prompt": "# You are given a vector arr of integers and you need to return\n# sum of magnitudes of integers multiplied by product of all signs\n# of each number in the vector, represented by 1, -1 or 0.\n# Note: return NULL for empty arr.\n# Example:\n# >>> prod_signs(c(1, 2, 2, -4))\n# 9\n# >>> prod_signs(c(0, 1))\n# 0\n# >>> prod_signs(c())\n# NULL\nprod_signs <- function(arr) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- prod_signs\n if(!identical(candidate(c(1, 2, 2, -4)), -9)){quit('no', 1)}\n if(!identical(candidate(c(0, 1)), 0)){quit('no', 1)}\n if(!identical(candidate(c(1, 1, 1, 2, 3, -1, 1)), -10)){quit('no', 1)}\n if(!identical(candidate(c()), NULL)){quit('no', 1)}\n if(!identical(candidate(c(2, 4, 1, 2, -1, -1, 9)), 20)){quit('no', 1)}\n if(!identical(candidate(c(-1, 1, -1, 1)), 4)){quit('no', 1)}\n if(!identical(candidate(c(-1, 1, 1, 1)), -4)){quit('no', 1)}\n if(!identical(candidate(c(-1, 1, 1, 0)), 0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "r", - "prompt": "# Return list with elements incremented by 1.\n# >>> incr_list(c(1, 2, 3))\n# list(2, 3, 4)\n# >>> incr_list(c(5, 3, 5, 2, 3, 3, 9, 0, 123))\n# list(6, 4, 6, 3, 4, 4, 10, 1, 124)\nincr_list <- function(l) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- incr_list\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 1)), list(4, 3, 2))){quit('no', 1)}\n if(!identical(candidate(c(5, 2, 5, 2, 3, 3, 9, 0, 123)), list(6, 3, 6, 3, 4, 4, 10, 1, 124))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "r", - "prompt": "# From a given list of integers, generate a list of rolling maximum element found until given moment\n# in the sequence.\n# >>> rolling_max(c(1, 2, 3, 2, 3, 4, 2))\n# list(1, 2, 3, 3, 3, 4, 4)\nrolling_max <- function(numbers) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- rolling_max\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4)), list(1, 2, 3, 4))){quit('no', 1)}\n if(!identical(candidate(c(4, 3, 2, 1)), list(4, 4, 4, 4))){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 3, 100, 3)), list(3, 3, 3, 100, 100))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "r", - "prompt": "# Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n# separate those group into separate strings and return the list of those.\n# Separate groups are balanced (each open brace is properly closed) and not nested within each other\n# Ignore any spaces in the input string.\n# >>> separate_paren_groups('( ) (( )) (( )( ))')\n# list('()', '(())', '(()())')\nseparate_paren_groups <- function(paren_string) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- separate_paren_groups\n if(!identical(candidate('(()()) ((())) () ((())()())'), list('(()())', '((()))', '()', '((())()())'))){quit('no', 1)}\n if(!identical(candidate('() (()) ((())) (((())))'), list('()', '(())', '((()))', '(((())))'))){quit('no', 1)}\n if(!identical(candidate('(()(())((())))'), list('(()(())((())))'))){quit('no', 1)}\n if(!identical(candidate('( ) (( )) (( )( ))'), list('()', '(())', '(()())'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "r", - "prompt": "# You will be given a string of words separated by commas or spaces. Your task is\n# to split the string into words and return a vector of the words.\n# For example:\n# >>> words_string('Hi, my name is John')\n# list('Hi', 'my', 'name', 'is', 'John')\n# >>> words_string('One, two, three, four, five, six')\n# list('One', 'two', 'three', 'four', 'five', 'six')\nwords_string <- function(s) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- words_string\n if(!identical(candidate('Hi, my name is John'), list('Hi', 'my', 'name', 'is', 'John'))){quit('no', 1)}\n if(!identical(candidate('One, two, three, four, five, six'), list('One', 'two', 'three', 'four', 'five', 'six'))){quit('no', 1)}\n if(!identical(candidate('Hi, my name'), list('Hi', 'my', 'name'))){quit('no', 1)}\n if(!identical(candidate('One,, two, three, four, five, six,'), list('One', 'two', 'three', 'four', 'five', 'six'))){quit('no', 1)}\n if(!identical(candidate(''), list())){quit('no', 1)}\n if(!identical(candidate('ahmed , gamal'), list('ahmed', 'gamal'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "r", - "prompt": "# Create a function that takes integers, floats, or strings representing\n# real numbers, and returns the larger variable in its given variable type.\n# Return NULL if the values are equal.\n# Note: If a real number is represented as a string, the floating point might be . or ,\n# >>> compare_one(1, 2.5)\n# 2.5\n# >>> compare_one(1, '2,3')\n# '2,3'\n# >>> compare_one('5,1', '6')\n# '6'\n# >>> compare_one('1', 1)\n# NULL\ncompare_one <- function(a, b) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- compare_one\n if(!identical(candidate(1, 2), 2)){quit('no', 1)}\n if(!identical(candidate(1, 2.5), 2.5)){quit('no', 1)}\n if(!identical(candidate(2, 3), 3)){quit('no', 1)}\n if(!identical(candidate(5, 6), 6)){quit('no', 1)}\n if(!identical(candidate(1, '2,3'), '2,3')){quit('no', 1)}\n if(!identical(candidate('5,1', '6'), '6')){quit('no', 1)}\n if(!identical(candidate('1', '2'), '2')){quit('no', 1)}\n if(!identical(candidate('1', 1), NULL)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "r", - "prompt": "# Filter given list of any rthon values only for integers\n# >>> filter_integers(list('a', 3.14, 5))\n# list(5)\n# >>> filter_integers(list(1, 2, 3, 'abc', list(), list()))\n# list(1, 2, 3)\nfilter_integers <- function(values) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- filter_integers\n if(!identical(candidate(list()), list())){quit('no', 1)}\n if(!identical(candidate(list(4, list(), list(), 23.2, 9, 'adasd')), list(4, 9))){quit('no', 1)}\n if(!identical(candidate(list(3, 'c', 3, 3, 'a', 'b')), list(3, 3, 3))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "r", - "prompt": "# This function takes a list l and returns a list l' such that\n# l' is identical to l in the odd indicies, while its values at the even indicies are equal\n# to the values of the even indicies of l, but sorted.\n# >>> sort_even(c(1, 2, 3))\n# list(1, 2, 3)\n# >>> sort_even(c(5, 6, 3, 4))\n# list(3, 6, 5, 4)\nsort_even <- function(l) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- sort_even\n if(!identical(candidate(c(1, 2, 3)), list(1, 2, 3))){quit('no', 1)}\n if(!identical(candidate(c(5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10)), list(-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123))){quit('no', 1)}\n if(!identical(candidate(c(5, 8, -12, 4, 23, 2, 3, 11, 12, -10)), list(-12, 8, 3, 4, 5, 2, 12, 11, 23, -10))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "r", - "prompt": "# I think we all remember that feeling when the result of some long-awaited\n# event is finally known. The feelings and thoughts you have at that moment are\n# definitely worth noting down and comparing.\n# Your task is to determine if a person correctly guessed the results of a number of matches.\n# You are given two vectors of scores and guesses of equal length, where each index shows a match. \n# Return a vector of the same length denoting how far off each guess was. If they have guessed correctly,\n# the value is 0, and if not, the value is the absolute difference between the guess and the score.\n# example:\n# >>> compare(c(1, 2, 3, 4, 5, 1), c(1, 2, 3, 4, 2, -2))\n# list(0, 0, 0, 0, 3, 3)\n# >>> compare(c(0, 5, 0, 0, 0, 4), c(4, 1, 1, 0, 0, -2))\n# list(4, 4, 1, 0, 0, 6)\ncompare <- function(game, guess) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- compare\n if(!identical(candidate(c(1, 2, 3, 4, 5, 1), c(1, 2, 3, 4, 2, -2)), list(0, 0, 0, 0, 3, 3))){quit('no', 1)}\n if(!identical(candidate(c(0, 0, 0, 0, 0, 0), c(0, 0, 0, 0, 0, 0)), list(0, 0, 0, 0, 0, 0))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3), c(-1, -2, -3)), list(2, 4, 6))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 5), c(-1, 2, 3, 4)), list(2, 0, 0, 1))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "r", - "prompt": "# Given a positive integer n, return a list that has the number of even and odd\n# integer palindromes that fall within the range(1, n), inclusive.\n# Example 1:\n# >>> even_odd_palindrome(3)\n# list(1, 2)\n# Explanation:\n# Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n# Example 2:\n# >>> even_odd_palindrome(12)\n# list(4, 6)\n# Explanation:\n# Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n# Note:\n# 1. 1 <= n <= 10^3\n# 2. returned list has the number of even and odd integer palindromes respectively.\neven_odd_palindrome <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- even_odd_palindrome\n if(!identical(candidate(123), list(8, 13))){quit('no', 1)}\n if(!identical(candidate(12), list(4, 6))){quit('no', 1)}\n if(!identical(candidate(3), list(1, 2))){quit('no', 1)}\n if(!identical(candidate(63), list(6, 8))){quit('no', 1)}\n if(!identical(candidate(25), list(5, 6))){quit('no', 1)}\n if(!identical(candidate(19), list(4, 6))){quit('no', 1)}\n if(!identical(candidate(9), list(4, 5))){quit('no', 1)}\n if(!identical(candidate(1), list(0, 1))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "r", - "prompt": "# The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fib4(0) -> 0\n# fib4(1) -> 0\n# fib4(2) -> 2\n# fib4(3) -> 0\n# fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n# Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n# >>> fib4(5)\n# 4\n# >>> fib4(6)\n# 8\n# >>> fib4(7)\n# 14\nfib4 <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- fib4\n if(!identical(candidate(5), 4)){quit('no', 1)}\n if(!identical(candidate(8), 28)){quit('no', 1)}\n if(!identical(candidate(10), 104)){quit('no', 1)}\n if(!identical(candidate(12), 386)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "r", - "prompt": "# Given two positive integers a and b, return the even digits between a\n# and b, in ascending order.\n# For example:\n# >>> generate_integers(2, 8)\n# list(2, 4, 6, 8)\n# >>> generate_integers(8, 2)\n# list(2, 4, 6, 8)\n# >>> generate_integers(10, 14)\n# list()\ngenerate_integers <- function(a, b) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- generate_integers\n if(!identical(candidate(2, 10), list(2, 4, 6, 8))){quit('no', 1)}\n if(!identical(candidate(10, 2), list(2, 4, 6, 8))){quit('no', 1)}\n if(!identical(candidate(132, 2), list(2, 4, 6, 8))){quit('no', 1)}\n if(!identical(candidate(17, 89), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "r", - "prompt": "# For a given list of input numbers, calculate Mean Absolute Deviation\n# around the mean of this dataset.\n# Mean Absolute Deviation is the average absolute difference between each\n# element and a centerpoint (mean in this case):\n# MAD = average | x - x_mean |\n# >>> mean_absolute_deviation(c(1.0, 2.0, 3.0, 4.0))\n# 1.0\nmean_absolute_deviation <- function(numbers) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- mean_absolute_deviation\n if(!identical(candidate(c(1.0, 2.0)), 0.5)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.0, 4.0)), 1.0)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.0, 4.0, 5.0)), 1.2)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "r", - "prompt": "# Create a function encrypt that takes a string as an argument and\n# returns a string encrypted with the alphabet being rotated. \n# The alphabet should be rotated in a manner such that the letters \n# shift down by two multiplied to two places.\n# For example:\n# >>> encrypt('hi')\n# 'lm'\n# >>> encrypt('asdfghjkl')\n# 'ewhjklnop'\n# >>> encrypt('gf')\n# 'kj'\n# >>> encrypt('et')\n# 'ix'\nencrypt <- function(s) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- encrypt\n if(!identical(candidate('hi'), 'lm')){quit('no', 1)}\n if(!identical(candidate('asdfghjkl'), 'ewhjklnop')){quit('no', 1)}\n if(!identical(candidate('gf'), 'kj')){quit('no', 1)}\n if(!identical(candidate('et'), 'ix')){quit('no', 1)}\n if(!identical(candidate('faewfawefaewg'), 'jeiajeaijeiak')){quit('no', 1)}\n if(!identical(candidate('hellomyfriend'), 'lippsqcjvmirh')){quit('no', 1)}\n if(!identical(candidate('dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh'), 'hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl')){quit('no', 1)}\n if(!identical(candidate('a'), 'e')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "r", - "prompt": "# Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n# The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n# as follows: start with any positive integer n. Then each term is obtained from the \n# previous term as follows: if the previous term is even, the next term is one half of \n# the previous term. If the previous term is odd, the next term is 3 times the previous\n# term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n# Note: \n# 1. Collatz(1) is [1].\n# 2. returned list sorted in increasing order.\n# For example:\n# get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n# >>> get_odd_collatz(5)\n# list(1, 5)\nget_odd_collatz <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- get_odd_collatz\n if(!identical(candidate(14), list(1, 5, 7, 11, 13, 17))){quit('no', 1)}\n if(!identical(candidate(5), list(1, 5))){quit('no', 1)}\n if(!identical(candidate(12), list(1, 3, 5))){quit('no', 1)}\n if(!identical(candidate(1), list(1))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "r", - "prompt": "# Find how many times a given substring can be found in the original string. Count overlaping cases.\n# >>> how_many_times('', 'a')\n# 0\n# >>> how_many_times('aaa', 'a')\n# 3\n# >>> how_many_times('aaaa', 'aa')\n# 3\nhow_many_times <- function(string, substring) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- how_many_times\n if(!identical(candidate('', 'x'), 0)){quit('no', 1)}\n if(!identical(candidate('xyxyxyx', 'x'), 4)){quit('no', 1)}\n if(!identical(candidate('cacacacac', 'cac'), 4)){quit('no', 1)}\n if(!identical(candidate('john doe', 'john'), 1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "r", - "prompt": "# We have a vector 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n# numbers in the vector will be randomly ordered. Your task is to determine if\n# it is possible to get a vector sorted in non-decreasing order by performing \n# the following operation on the given vector:\n# You are allowed to perform right shift operation any number of times.\n# One right shift operation means shifting all elements of the vector by one\n# position in the right direction. The last element of the vector will be moved to\n# the starting position in the vector i.e. 0th index. \n# If it is possible to obtain the sorted vector by performing the above operation\n# then return TRUE else return FALSE.\n# If the given vector is empty then return TRUE.\n# Note: The given list is guaranteed to have unique elements.\n# For Example:\n# >>> move_one_ball(c(3, 4, 5, 1, 2))\n# TRUE\n# Explanation: By performin 2 right shift operations, non-decreasing order can\n# be achieved for the given vector.\n# >>> move_one_ball(c(3, 5, 4, 1, 2))\n# FALSE\n# Explanation:It is not possible to get non-decreasing order for the given\n# vector by performing any number of right shift operations.\nmove_one_ball <- function(arr) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- move_one_ball\n if(!identical(candidate(c(3, 4, 5, 1, 2)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(3, 5, 10, 1, 2)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(4, 3, 1, 2)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(3, 5, 4, 1, 2)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c()), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "r", - "prompt": "# Write a function which sorts the given list of integers\n# in ascending order according to the sum of their digits.\n# Note: if there are several items with similar sum of their digits,\n# order them based on their index in original list.\n# For example:\n# >>> order_by_points(c(1, 11, -1, -11, -12))\n# list(-1, -11, 1, -12, 11)\n# >>> order_by_points(c())\n# list()\norder_by_points <- function(nums) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- order_by_points\n if(!identical(candidate(c(1, 11, -1, -11, -12)), list(-1, -11, 1, -12, 11))){quit('no', 1)}\n if(!identical(candidate(c(1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46)), list(0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457))){quit('no', 1)}\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(1, -11, -32, 43, 54, -98, 2, -3)), list(-3, -32, -98, -11, 1, 2, 43, 54))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)), list(1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9))){quit('no', 1)}\n if(!identical(candidate(c(0, 6, 6, -76, -21, 23, 4)), list(-76, -21, 0, 4, 23, 6, 6))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "r", - "prompt": "# Return list of prime factors of given integer in the order from smallest to largest.\n# Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n# Input number should be equal to the product of all factors\n# >>> factorize(8)\n# list(2, 2, 2)\n# >>> factorize(25)\n# list(5, 5)\n# >>> factorize(70)\n# list(2, 5, 7)\nfactorize <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- factorize\n if(!identical(candidate(2), list(2))){quit('no', 1)}\n if(!identical(candidate(4), list(2, 2))){quit('no', 1)}\n if(!identical(candidate(8), list(2, 2, 2))){quit('no', 1)}\n if(!identical(candidate(57), list(3, 19))){quit('no', 1)}\n if(!identical(candidate(3249), list(3, 3, 19, 19))){quit('no', 1)}\n if(!identical(candidate(185193), list(3, 3, 3, 19, 19, 19))){quit('no', 1)}\n if(!identical(candidate(20577), list(3, 19, 19, 19))){quit('no', 1)}\n if(!identical(candidate(18), list(2, 3, 3))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "r", - "prompt": "# Return TRUE if all numbers in the list l are below threshold t.\n# >>> below_threshold(c(1, 2, 4, 10), 100)\n# TRUE\n# >>> below_threshold(c(1, 20, 4, 10), 5)\n# FALSE\nbelow_threshold <- function(l, t) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- below_threshold\n if(!identical(candidate(c(1, 2, 4, 10), 100), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 20, 4, 10), 5), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 20, 4, 10), 21), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 20, 4, 10), 22), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 8, 4, 10), 11), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 8, 4, 10), 10), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "r", - "prompt": "# You are given two positive integers n and m, and your task is to compute the\n# average of the integers from n through m (including n and m). \n# Round the answer to the nearest integer and convert that to binary.\n# If n is greater than m, return -1.\n# Example:\n# >>> rounded_avg(1, 5)\n# '0b11'\n# >>> rounded_avg(7, 5)\n# -1\n# >>> rounded_avg(10, 20)\n# '0b1111'\n# >>> rounded_avg(20, 33)\n# '0b11010'\nrounded_avg <- function(n, m) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- rounded_avg\n if(!identical(candidate(1, 5), '0b11')){quit('no', 1)}\n if(!identical(candidate(7, 13), '0b1010')){quit('no', 1)}\n if(!identical(candidate(964, 977), '0b1111001010')){quit('no', 1)}\n if(!identical(candidate(996, 997), '0b1111100100')){quit('no', 1)}\n if(!identical(candidate(560, 851), '0b1011000010')){quit('no', 1)}\n if(!identical(candidate(185, 546), '0b101101110')){quit('no', 1)}\n if(!identical(candidate(362, 496), '0b110101101')){quit('no', 1)}\n if(!identical(candidate(350, 902), '0b1001110010')){quit('no', 1)}\n if(!identical(candidate(197, 233), '0b11010111')){quit('no', 1)}\n if(!identical(candidate(7, 5), -1)){quit('no', 1)}\n if(!identical(candidate(5, 1), -1)){quit('no', 1)}\n if(!identical(candidate(5, 5), '0b101')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "r", - "prompt": "# Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n# For each of the group, output the deepest level of nesting of parentheses.\n# E.g. (()()) has maximum two levels of nesting while ((())) has three.\n# >>> parse_nested_parens('(()()) ((())) () ((())()())')\n# list(2, 3, 1, 3)\nparse_nested_parens <- function(paren_string) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- parse_nested_parens\n if(!identical(candidate('(()()) ((())) () ((())()())'), list(2, 3, 1, 3))){quit('no', 1)}\n if(!identical(candidate('() (()) ((())) (((())))'), list(1, 2, 3, 4))){quit('no', 1)}\n if(!identical(candidate('(()(())((())))'), list(4))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "r", - "prompt": "# Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n# Examples\n# >>> solution(c(5, 8, 7, 1))\n# 12\n# >>> solution(c(3, 3, 3, 3, 3))\n# 9\n# >>> solution(c(30, 13, 24, 321))\n# 0\nsolution <- function(lst) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- solution\n if(!identical(candidate(c(5, 8, 7, 1)), 12)){quit('no', 1)}\n if(!identical(candidate(c(3, 3, 3, 3, 3)), 9)){quit('no', 1)}\n if(!identical(candidate(c(30, 13, 24, 321)), 0)){quit('no', 1)}\n if(!identical(candidate(c(5, 9)), 5)){quit('no', 1)}\n if(!identical(candidate(c(2, 4, 8)), 0)){quit('no', 1)}\n if(!identical(candidate(c(30, 13, 23, 32)), 23)){quit('no', 1)}\n if(!identical(candidate(c(3, 13, 2, 9)), 3)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "r", - "prompt": "# You are given a positive integer n. You have to create an integer vector a of length n.\n# For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n# Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n# and a[i] + a[j] + a[k] is a multiple of 3.\n# Example :\n# >>> get_max_triples(5)\n# 1\n# Explanation: \n# a = [1, 3, 7, 13, 21]\n# The only valid triple is (1, 7, 13).\nget_max_triples <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- get_max_triples\n if(!identical(candidate(5), 1)){quit('no', 1)}\n if(!identical(candidate(6), 4)){quit('no', 1)}\n if(!identical(candidate(10), 36)){quit('no', 1)}\n if(!identical(candidate(100), 53361)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "r", - "prompt": "# There are eight planets in our solar system: the closerst to the Sun \n# is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n# Uranus, Neptune.\n# Write a function that takes two planet names as strings planet1 and planet2. \n# The function should return a list containing all planets whose orbits are \n# located between the orbit of planet1 and the orbit of planet2, sorted by \n# the proximity to the sun. \n# The function should return an empty list if planet1 or planet2\n# are not correct planet names. \n# Examples\n# >>> bf('Jupiter', 'Neptune')\n# list('Saturn', 'Uranus')\n# >>> bf('Earth', 'Mercury')\n# 'Venus'\n# >>> bf('Mercury', 'Uranus')\n# list('Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn')\nbf <- function(planet1, planet2) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- bf\n if(!identical(candidate('Jupiter', 'Neptune'), list('Saturn', 'Uranus'))){quit('no', 1)}\n if(!identical(candidate('Earth', 'Mercury'), list('Venus'))){quit('no', 1)}\n if(!identical(candidate('Mercury', 'Uranus'), list('Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn'))){quit('no', 1)}\n if(!identical(candidate('Neptune', 'Venus'), list('Earth', 'Mars', 'Jupiter', 'Saturn', 'Uranus'))){quit('no', 1)}\n if(!identical(candidate('Earth', 'Earth'), list())){quit('no', 1)}\n if(!identical(candidate('Mars', 'Earth'), list())){quit('no', 1)}\n if(!identical(candidate('Jupiter', 'Makemake'), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "r", - "prompt": "# You are given a list of integers.\n# Write a function next_smallest() that returns the 2nd smallest element of the list.\n# Return NULL if there is no such element.\n# >>> next_smallest(c(1, 2, 3, 4, 5))\n# 2\n# >>> next_smallest(c(5, 1, 4, 3, 2))\n# 2\n# >>> next_smallest(c())\n# NULL\n# >>> next_smallest(c(1, 1))\n# NULL\nnext_smallest <- function(lst) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- next_smallest\n if(!identical(candidate(c(1, 2, 3, 4, 5)), 2)){quit('no', 1)}\n if(!identical(candidate(c(5, 1, 4, 3, 2)), 2)){quit('no', 1)}\n if(!identical(candidate(c()), NULL)){quit('no', 1)}\n if(!identical(candidate(c(1, 1)), NULL)){quit('no', 1)}\n if(!identical(candidate(c(1, 1, 1, 1, 0)), 1)){quit('no', 1)}\n if(!identical(candidate(c(1, 1)), NULL)){quit('no', 1)}\n if(!identical(candidate(c(-35, 34, 12, -45)), -35)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "r", - "prompt": "# Input is a space-delimited string of numberals from 'zero' to 'nine'.\n# Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n# Return the string with numbers sorted from smallest to largest\n# >>> sort_numbers('three one five')\n# 'one three five'\nsort_numbers <- function(numbers) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- sort_numbers\n if(!identical(candidate(''), '')){quit('no', 1)}\n if(!identical(candidate('three'), 'three')){quit('no', 1)}\n if(!identical(candidate('three five nine'), 'three five nine')){quit('no', 1)}\n if(!identical(candidate('five zero four seven nine eight'), 'zero four five seven eight nine')){quit('no', 1)}\n if(!identical(candidate('six five four three two one zero'), 'zero one two three four five six')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "r", - "prompt": "# You are given 2 words. You need to return TRUE if the second word or any of its rotations is a substring in the first word\n# >>> cycpattern_check('abcd', 'abd')\n# FALSE\n# >>> cycpattern_check('hello', 'ell')\n# TRUE\n# >>> cycpattern_check('whassup', 'psus')\n# FALSE\n# >>> cycpattern_check('abab', 'baa')\n# TRUE\n# >>> cycpattern_check('efef', 'eeff')\n# FALSE\n# >>> cycpattern_check('himenss', 'simen')\n# TRUE\ncycpattern_check <- function(a, b) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- cycpattern_check\n if(!identical(candidate('xyzw', 'xyw'), FALSE)){quit('no', 1)}\n if(!identical(candidate('yello', 'ell'), TRUE)){quit('no', 1)}\n if(!identical(candidate('whattup', 'ptut'), FALSE)){quit('no', 1)}\n if(!identical(candidate('efef', 'fee'), TRUE)){quit('no', 1)}\n if(!identical(candidate('abab', 'aabb'), FALSE)){quit('no', 1)}\n if(!identical(candidate('winemtt', 'tinem'), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "r", - "prompt": "# You will be given a number in decimal form and your task is to convert it to\n# binary format. The function should return a string, with each character representing a binary\n# number. Each character in the string will be '0' or '1'.\n# There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n# The extra characters are there to help with the format.\n# Examples:\n# >>> decimal_to_binary(15)\n# 'db1111db'\n# >>> decimal_to_binary(32)\n# 'db100000db'\ndecimal_to_binary <- function(decimal) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- decimal_to_binary\n if(!identical(candidate(0), 'db0db')){quit('no', 1)}\n if(!identical(candidate(32), 'db100000db')){quit('no', 1)}\n if(!identical(candidate(103), 'db1100111db')){quit('no', 1)}\n if(!identical(candidate(15), 'db1111db')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "r", - "prompt": "# Filter an input list of strings only for ones that contain given substring\n# >>> filter_by_substring(c(), 'a')\n# list()\n# >>> filter_by_substring(c('abc', 'bacd', 'cde', 'array'), 'a')\n# list('abc', 'bacd', 'array')\nfilter_by_substring <- function(strings, substring) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- filter_by_substring\n if(!identical(candidate(c(), 'john'), list())){quit('no', 1)}\n if(!identical(candidate(c('xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'), 'xxx'), list('xxx', 'xxxAAA', 'xxx'))){quit('no', 1)}\n if(!identical(candidate(c('xxx', 'asd', 'aaaxxy', 'john doe', 'xxxAAA', 'xxx'), 'xx'), list('xxx', 'aaaxxy', 'xxxAAA', 'xxx'))){quit('no', 1)}\n if(!identical(candidate(c('grunt', 'trumpet', 'prune', 'gruesome'), 'run'), list('grunt', 'prune'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "r", - "prompt": "# Given an integer. return a list that has the number of even and odd digits respectively.\n# Example:\n# >>> even_odd_count(-12)\n# list(1, 1)\n# >>> even_odd_count(123)\n# list(1, 2)\neven_odd_count <- function(num) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- even_odd_count\n if(!identical(candidate(7), list(0, 1))){quit('no', 1)}\n if(!identical(candidate(-78), list(1, 1))){quit('no', 1)}\n if(!identical(candidate(3452), list(2, 2))){quit('no', 1)}\n if(!identical(candidate(346211), list(3, 3))){quit('no', 1)}\n if(!identical(candidate(-345821), list(3, 3))){quit('no', 1)}\n if(!identical(candidate(-2), list(1, 0))){quit('no', 1)}\n if(!identical(candidate(-45347), list(2, 3))){quit('no', 1)}\n if(!identical(candidate(0), list(1, 0))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "r", - "prompt": "# Write a function that accepts a list of strings.\n# The list contains different words. Return the word with maximum number\n# of unique characters. If multiple strings have maximum number of unique\n# characters, return the one which comes first in lexicographical order.\n# >>> find_max(c('name', 'of', 'string'))\n# 'string'\n# >>> find_max(c('name', 'enam', 'game'))\n# 'enam'\n# >>> find_max(c('aaaaaaa', 'bb', 'cc'))\n# 'aaaaaaa'\nfind_max <- function(words) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- find_max\n if(!identical(candidate(c('name', 'of', 'string')), 'string')){quit('no', 1)}\n if(!identical(candidate(c('name', 'enam', 'game')), 'enam')){quit('no', 1)}\n if(!identical(candidate(c('aaaaaaa', 'bb', 'cc')), 'aaaaaaa')){quit('no', 1)}\n if(!identical(candidate(c('abc', 'cba')), 'abc')){quit('no', 1)}\n if(!identical(candidate(c('play', 'this', 'game', 'of', 'footbott')), 'footbott')){quit('no', 1)}\n if(!identical(candidate(c('we', 'are', 'gonna', 'rock')), 'gonna')){quit('no', 1)}\n if(!identical(candidate(c('we', 'are', 'a', 'mad', 'nation')), 'nation')){quit('no', 1)}\n if(!identical(candidate(c('this', 'is', 'a', 'prrk')), 'this')){quit('no', 1)}\n if(!identical(candidate(c('b')), 'b')){quit('no', 1)}\n if(!identical(candidate(c('play', 'play', 'play')), 'play')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "r", - "prompt": "# Given a positive integer n, return the count of the numbers of n-digit\n# positive integers that start or end with 1.\nstarts_one_ends <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- starts_one_ends\n if(!identical(candidate(1), 1)){quit('no', 1)}\n if(!identical(candidate(2), 18)){quit('no', 1)}\n if(!identical(candidate(3), 180)){quit('no', 1)}\n if(!identical(candidate(4), 1800)){quit('no', 1)}\n if(!identical(candidate(5), 18000)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "r", - "prompt": "# Create a function that returns a list (a, b), where 'a' is\n# the largest of negative integers, and 'b' is the smallest\n# of positive integers in a list.\n# If there is no negative or positive integers, return them as NULL.\n# Examples:\n# >>> largest_smallest_integers(c(2, 4, 1, 3, 5, 7))\n# list(NULL, 1)\n# >>> largest_smallest_integers(c())\n# list(NULL, NULL)\n# >>> largest_smallest_integers(c(0))\n# list(NULL, NULL)\nlargest_smallest_integers <- function(lst) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- largest_smallest_integers\n if(!identical(candidate(c(2, 4, 1, 3, 5, 7)), list(NULL, 1))){quit('no', 1)}\n if(!identical(candidate(c(2, 4, 1, 3, 5, 7, 0)), list(NULL, 1))){quit('no', 1)}\n if(!identical(candidate(c(1, 3, 2, 4, 5, 6, -2)), list(-2, 1))){quit('no', 1)}\n if(!identical(candidate(c(4, 5, 3, 6, 2, 7, -7)), list(-7, 2))){quit('no', 1)}\n if(!identical(candidate(c(7, 3, 8, 4, 9, 2, 5, -9)), list(-9, 2))){quit('no', 1)}\n if(!identical(candidate(c()), list(NULL, NULL))){quit('no', 1)}\n if(!identical(candidate(c(0)), list(NULL, NULL))){quit('no', 1)}\n if(!identical(candidate(c(-1, -3, -5, -6)), list(-1, NULL))){quit('no', 1)}\n if(!identical(candidate(c(-1, -3, -5, -6, 0)), list(-1, NULL))){quit('no', 1)}\n if(!identical(candidate(c(-6, -4, -4, -3, 1)), list(-3, 1))){quit('no', 1)}\n if(!identical(candidate(c(-6, -4, -4, -3, -100, 1)), list(-3, 1))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "r", - "prompt": "# \"Given a vector representing a branch of a tree that has non-negative integer nodes\n# your task is to pluck one of the nodes and return it.\n# The plucked node should be the node with the smallest even value.\n# If multiple nodes with the same smallest even value are found return the node that has smallest index.\n# The plucked node should be returned in a list, [ smalest_value, its index ],\n# If there are no even values or the given vector is empty, return [].\n# Example 1:\n# >>> pluck(c(4, 2, 3))\n# list(2, 1)\n# Explanation: 2 has the smallest even value, and 2 has the smallest index.\n# Example 2:\n# >>> pluck(c(1, 2, 3))\n# list(2, 1)\n# Explanation: 2 has the smallest even value, and 2 has the smallest index.\n# Example 3:\n# >>> pluck(c())\n# list()\n# Example 4:\n# >>> pluck(c(5, 0, 3, 0, 4, 2))\n# list(0, 1)\n# Explanation: 0 is the smallest value, but there are two zeros,\n# so we will choose the first zero, which has the smallest index.\n# Constraints:\n# * 1 <= nodes.length <= 10000\n# * 0 <= node.value\npluck <- function(arr) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- pluck\n if(!identical(candidate(c(4, 2, 3)), list(2, 1))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3)), list(2, 1))){quit('no', 1)}\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(5, 0, 3, 0, 4, 2)), list(0, 1))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 0, 5, 3)), list(0, 3))){quit('no', 1)}\n if(!identical(candidate(c(5, 4, 8, 4, 8)), list(4, 1))){quit('no', 1)}\n if(!identical(candidate(c(7, 6, 7, 1)), list(6, 1))){quit('no', 1)}\n if(!identical(candidate(c(7, 9, 7, 1)), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "r", - "prompt": "# Write a function count_nums which takes a vector of integers and returns\n# the number of elements which has a sum of digits > 0.\n# If a number is negative, then its first signed digit will be negative:\n# e.g. -123 has signed digits -1, 2, and 3.\n# >>> count_nums(c())\n# 0\n# >>> count_nums(c(-1, 11, -11))\n# 1\n# >>> count_nums(c(1, 1, 2))\n# 3\ncount_nums <- function(arr) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- count_nums\n if(!identical(candidate(c()), 0)){quit('no', 1)}\n if(!identical(candidate(c(-1, -2, 0)), 0)){quit('no', 1)}\n if(!identical(candidate(c(1, 1, 2, -2, 3, 4, 5)), 6)){quit('no', 1)}\n if(!identical(candidate(c(1, 6, 9, -6, 0, 1, 5)), 5)){quit('no', 1)}\n if(!identical(candidate(c(1, 100, 98, -7, 1, -1)), 4)){quit('no', 1)}\n if(!identical(candidate(c(12, 23, 34, -45, -56, 0)), 5)){quit('no', 1)}\n if(!identical(candidate(c(0, 1)), 1)){quit('no', 1)}\n if(!identical(candidate(c(1)), 1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "r", - "prompt": "# Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n# each cell of the grid contains a value. Every integer in the range [1, N * N]\n# inclusive appears exactly once on the cells of the grid.\n# You have to find the minimum path of length k in the grid. You can start\n# from any cell, and in each step you can move to any of the neighbor cells,\n# in other words, you can go to cells which share an edge with you current\n# cell.\n# Please note that a path of length k means visiting exactly k cells (not\n# necessarily distinct).\n# You CANNOT go off the grid.\n# A path A (of length k) is considered less than a path B (of length k) if\n# after making the ordered lists of the values on the cells that A and B go\n# through (let's call them lst_A and lst_B), lst_A is lexicographically less\n# than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n# such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n# lst_A[j] = lst_B[j].\n# It is guaranteed that the answer is unique.\n# Return an ordered list of the values on the cells that the minimum path go through.\n# Examples: \n# >>> minPath(list(list(1, 2, 3), list(4, 5, 6), list(7, 8, 9)), 3)\n# list(1, 2, 1)\n# >>> minPath(list(list(5, 9, 3), list(4, 1, 6), list(7, 8, 2)), 1)\n# list(1)\nminPath <- function(grid, k) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- minPath\n if(!identical(candidate(list(list(1, 2, 3), list(4, 5, 6), list(7, 8, 9)), 3), list(1, 2, 1))){quit('no', 1)}\n if(!identical(candidate(list(list(5, 9, 3), list(4, 1, 6), list(7, 8, 2)), 1), list(1))){quit('no', 1)}\n if(!identical(candidate(list(list(1, 2, 3, 4), list(5, 6, 7, 8), list(9, 10, 11, 12), list(13, 14, 15, 16)), 4), list(1, 2, 1, 2))){quit('no', 1)}\n if(!identical(candidate(list(list(6, 4, 13, 10), list(5, 7, 12, 1), list(3, 16, 11, 15), list(8, 14, 9, 2)), 7), list(1, 10, 1, 10, 1, 10, 1))){quit('no', 1)}\n if(!identical(candidate(list(list(8, 14, 9, 2), list(6, 4, 13, 15), list(5, 7, 1, 12), list(3, 10, 11, 16)), 5), list(1, 7, 1, 7, 1))){quit('no', 1)}\n if(!identical(candidate(list(list(11, 8, 7, 2), list(5, 16, 14, 4), list(9, 3, 15, 6), list(12, 13, 10, 1)), 9), list(1, 6, 1, 6, 1, 6, 1, 6, 1))){quit('no', 1)}\n if(!identical(candidate(list(list(12, 13, 10, 1), list(9, 3, 15, 6), list(5, 16, 14, 4), list(11, 8, 7, 2)), 12), list(1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6))){quit('no', 1)}\n if(!identical(candidate(list(list(2, 7, 4), list(3, 1, 5), list(6, 8, 9)), 8), list(1, 3, 1, 3, 1, 3, 1, 3))){quit('no', 1)}\n if(!identical(candidate(list(list(6, 1, 5), list(3, 8, 9), list(2, 7, 4)), 8), list(1, 5, 1, 5, 1, 5, 1, 5))){quit('no', 1)}\n if(!identical(candidate(list(list(1, 2), list(3, 4)), 10), list(1, 2, 1, 2, 1, 2, 1, 2, 1, 2))){quit('no', 1)}\n if(!identical(candidate(list(list(1, 3), list(3, 2)), 10), list(1, 3, 1, 3, 1, 3, 1, 3, 1, 3))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "r", - "prompt": "# Given list of integers, return list in strange order.\n# Strange sorting, is when you start with the minimum value,\n# then maximum of the remaining integers, then minimum and so on.\n# Examples:\n# >>> strange_sort_list(c(1, 2, 3, 4))\n# list(1, 4, 2, 3)\n# >>> strange_sort_list(c(5, 5, 5, 5))\n# list(5, 5, 5, 5)\n# >>> strange_sort_list(c())\n# list()\nstrange_sort_list <- function(lst) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- strange_sort_list\n if(!identical(candidate(c(1, 2, 3, 4)), list(1, 4, 2, 3))){quit('no', 1)}\n if(!identical(candidate(c(5, 6, 7, 8, 9)), list(5, 9, 6, 8, 7))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 5)), list(1, 5, 2, 4, 3))){quit('no', 1)}\n if(!identical(candidate(c(5, 6, 7, 8, 9, 1)), list(1, 9, 5, 8, 6, 7))){quit('no', 1)}\n if(!identical(candidate(c(5, 5, 5, 5)), list(5, 5, 5, 5))){quit('no', 1)}\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 5, 6, 7, 8)), list(1, 8, 2, 7, 3, 6, 4, 5))){quit('no', 1)}\n if(!identical(candidate(c(0, 2, 2, 2, 5, 5, -5, -5)), list(-5, 5, -5, 5, 0, 2, 2, 2))){quit('no', 1)}\n if(!identical(candidate(c(111111)), list(111111))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "r", - "prompt": "# Given a string 'text', return its md5 hash equivalent string.\n# If 'text' is an empty string, return NULL.\n# >>> string_to_md5('Hello world')\n# '3e25960a79dbc69b674cd4ec67a72c62'\nstring_to_md5 <- function(text) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- string_to_md5\n if(!identical(candidate('Hello world'), '3e25960a79dbc69b674cd4ec67a72c62')){quit('no', 1)}\n if(!identical(candidate(''), NULL)){quit('no', 1)}\n if(!identical(candidate('A B C'), '0ef78513b0cb8cef12743f5aeb35f888')){quit('no', 1)}\n if(!identical(candidate('password'), '5f4dcc3b5aa765d61d8327deb882cf99')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "r", - "prompt": "# You are given a word. Your task is to find the closest vowel that stands between \n# two consonants from the right side of the word (case sensitive).\n# Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n# find any vowel met the above condition. \n# You may assume that the given string contains English letter only.\n# Example:\n# >>> get_closest_vowel('yogurt')\n# 'u'\n# >>> get_closest_vowel('FULL')\n# 'U'\n# >>> get_closest_vowel('quick')\n# ''\n# >>> get_closest_vowel('ab')\n# ''\nget_closest_vowel <- function(word) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- get_closest_vowel\n if(!identical(candidate('yogurt'), 'u')){quit('no', 1)}\n if(!identical(candidate('full'), 'u')){quit('no', 1)}\n if(!identical(candidate('easy'), '')){quit('no', 1)}\n if(!identical(candidate('eAsy'), '')){quit('no', 1)}\n if(!identical(candidate('ali'), '')){quit('no', 1)}\n if(!identical(candidate('bad'), 'a')){quit('no', 1)}\n if(!identical(candidate('most'), 'o')){quit('no', 1)}\n if(!identical(candidate('ab'), '')){quit('no', 1)}\n if(!identical(candidate('ba'), '')){quit('no', 1)}\n if(!identical(candidate('quick'), '')){quit('no', 1)}\n if(!identical(candidate('anime'), 'i')){quit('no', 1)}\n if(!identical(candidate('Asia'), '')){quit('no', 1)}\n if(!identical(candidate('Above'), 'o')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "r", - "prompt": "# Change numerical base of input number x to base.\n# return string representation after the conversion.\n# base numbers are less than 10.\n# >>> change_base(8, 3)\n# '22'\n# >>> change_base(8, 2)\n# '1000'\n# >>> change_base(7, 2)\n# '111'\nchange_base <- function(x, base) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- change_base\n if(!identical(candidate(8, 3), '22')){quit('no', 1)}\n if(!identical(candidate(9, 3), '100')){quit('no', 1)}\n if(!identical(candidate(234, 2), '11101010')){quit('no', 1)}\n if(!identical(candidate(16, 2), '10000')){quit('no', 1)}\n if(!identical(candidate(8, 2), '1000')){quit('no', 1)}\n if(!identical(candidate(7, 2), '111')){quit('no', 1)}\n if(!identical(candidate(2, 3), '2')){quit('no', 1)}\n if(!identical(candidate(3, 4), '3')){quit('no', 1)}\n if(!identical(candidate(4, 5), '4')){quit('no', 1)}\n if(!identical(candidate(5, 6), '5')){quit('no', 1)}\n if(!identical(candidate(6, 7), '6')){quit('no', 1)}\n if(!identical(candidate(7, 8), '7')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "r", - "prompt": "# Check if in given list of numbers, are any two numbers closer to each other than\n# given threshold.\n# >>> has_close_elements(c(1.0, 2.0, 3.0), 0.5)\n# FALSE\n# >>> has_close_elements(c(1.0, 2.8, 3.0, 4.0, 5.0, 2.0), 0.3)\n# TRUE\nhas_close_elements <- function(numbers, threshold) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- has_close_elements\n if(!identical(candidate(c(1.0, 2.0, 3.9, 4.0, 5.0, 2.2), 0.3), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.9, 4.0, 5.0, 2.2), 0.05), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 5.9, 4.0, 5.0), 0.95), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 5.9, 4.0, 5.0), 0.8), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.0, 4.0, 5.0, 2.0), 0.1), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1.1, 2.2, 3.1, 4.1, 5.1), 1.0), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1.1, 2.2, 3.1, 4.1, 5.1), 0.5), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "r", - "prompt": "# Create a function that takes a string as input which contains only square brackets.\n# The function should return TRUE if and only if there is a valid subsequence of brackets \n# where at least one bracket in the subsequence is nested.\n# >>> is_nested('[[]]')\n# TRUE\n# >>> is_nested('[]]]]]]][[[[[]')\n# FALSE\n# >>> is_nested('[][]')\n# FALSE\n# >>> is_nested('[]')\n# FALSE\n# >>> is_nested('[[][]]')\n# TRUE\n# >>> is_nested('[[]][[')\n# TRUE\nis_nested <- function(string) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- is_nested\n if(!identical(candidate('[[]]'), TRUE)){quit('no', 1)}\n if(!identical(candidate('[]]]]]]][[[[[]'), FALSE)){quit('no', 1)}\n if(!identical(candidate('[][]'), FALSE)){quit('no', 1)}\n if(!identical(candidate('[]'), FALSE)){quit('no', 1)}\n if(!identical(candidate('[[[[]]]]'), TRUE)){quit('no', 1)}\n if(!identical(candidate('[]]]]]]]]]]'), FALSE)){quit('no', 1)}\n if(!identical(candidate('[][][[]]'), TRUE)){quit('no', 1)}\n if(!identical(candidate('[[]'), FALSE)){quit('no', 1)}\n if(!identical(candidate('[]]'), FALSE)){quit('no', 1)}\n if(!identical(candidate('[[]][['), TRUE)){quit('no', 1)}\n if(!identical(candidate('[[][]]'), TRUE)){quit('no', 1)}\n if(!identical(candidate(''), FALSE)){quit('no', 1)}\n if(!identical(candidate('[[[[[[[['), FALSE)){quit('no', 1)}\n if(!identical(candidate(']]]]]]]]'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "r", - "prompt": "# Concatenate list of strings into a single string\n# >>> concatenate(c())\n# ''\n# >>> concatenate(c('a', 'b', 'c'))\n# 'abc'\nconcatenate <- function(strings) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- concatenate\n if(!identical(candidate(c()), '')){quit('no', 1)}\n if(!identical(candidate(c('x', 'y', 'z')), 'xyz')){quit('no', 1)}\n if(!identical(candidate(c('x', 'y', 'z', 'w', 'k')), 'xyzwk')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "r", - "prompt": "# prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n# >>> prime_fib(1)\n# 2\n# >>> prime_fib(2)\n# 3\n# >>> prime_fib(3)\n# 5\n# >>> prime_fib(4)\n# 13\n# >>> prime_fib(5)\n# 89\nprime_fib <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- prime_fib\n if(!identical(candidate(1), 2)){quit('no', 1)}\n if(!identical(candidate(2), 3)){quit('no', 1)}\n if(!identical(candidate(3), 5)){quit('no', 1)}\n if(!identical(candidate(4), 13)){quit('no', 1)}\n if(!identical(candidate(5), 89)){quit('no', 1)}\n if(!identical(candidate(6), 233)){quit('no', 1)}\n if(!identical(candidate(7), 1597)){quit('no', 1)}\n if(!identical(candidate(8), 28657)){quit('no', 1)}\n if(!identical(candidate(9), 514229)){quit('no', 1)}\n if(!identical(candidate(10), 433494437)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "r", - "prompt": "# From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n# other and return them in order (smaller number, larger number).\n# >>> find_closest_elements(c(1.0, 2.0, 3.0, 4.0, 5.0, 2.2))\n# list(2.0, 2.2)\n# >>> find_closest_elements(c(1.0, 2.0, 3.0, 4.0, 5.0, 2.0))\n# list(2.0, 2.0)\nfind_closest_elements <- function(numbers) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- find_closest_elements\n if(!identical(candidate(c(1.0, 2.0, 3.9, 4.0, 5.0, 2.2)), list(3.9, 4.0))){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 5.9, 4.0, 5.0)), list(5.0, 5.9))){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.0, 4.0, 5.0, 2.2)), list(2.0, 2.2))){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.0, 4.0, 5.0, 2.0)), list(2.0, 2.0))){quit('no', 1)}\n if(!identical(candidate(c(1.1, 2.2, 3.1, 4.1, 5.1)), list(2.2, 3.1))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "r", - "prompt": "# You have been tasked to write a function that receives \n# a hexadecimal number as a string and counts the number of hexadecimal \n# digits that are primes (prime number, or a prime, is a natural number \n# greater than 1 that is not a product of two smaller natural numbers).\n# Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n# Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n# So you have to determine a number of the following digits: 2, 3, 5, 7, \n# B (=decimal 11), D (=decimal 13).\n# Note: you may assume the input is always correct or empty string, \n# and symbols A,B,C,D,E,F are always uppercase.\n# Examples:\n# >>> hex_key('AB')\n# 1\n# >>> hex_key('1077E')\n# 2\n# >>> hex_key('ABED1A33')\n# 4\n# >>> hex_key('123456789ABCDEF0')\n# 6\n# >>> hex_key('2020')\n# 2\nhex_key <- function(num) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- hex_key\n if(!identical(candidate('AB'), 1)){quit('no', 1)}\n if(!identical(candidate('1077E'), 2)){quit('no', 1)}\n if(!identical(candidate('ABED1A33'), 4)){quit('no', 1)}\n if(!identical(candidate('2020'), 2)){quit('no', 1)}\n if(!identical(candidate('123456789ABCDEF0'), 6)){quit('no', 1)}\n if(!identical(candidate('112233445566778899AABBCCDDEEFF00'), 12)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "r", - "prompt": "# Complete the function that takes two integers and returns \n# the product of their unit digits.\n# Assume the input is always valid.\n# Examples:\n# >>> multiply(148, 412)\n# 16\n# >>> multiply(19, 28)\n# 72\n# >>> multiply(2020, 1851)\n# 0\n# >>> multiply(14, -15)\n# 20\nmultiply <- function(a, b) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- multiply\n if(!identical(candidate(148, 412), 16)){quit('no', 1)}\n if(!identical(candidate(19, 28), 72)){quit('no', 1)}\n if(!identical(candidate(2020, 1851), 0)){quit('no', 1)}\n if(!identical(candidate(14, -15), 20)){quit('no', 1)}\n if(!identical(candidate(76, 67), 42)){quit('no', 1)}\n if(!identical(candidate(17, 27), 49)){quit('no', 1)}\n if(!identical(candidate(0, 1), 0)){quit('no', 1)}\n if(!identical(candidate(0, 0), 0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "r", - "prompt": "# Given list of numbers (of at least two elements), apply a linear transform to that list,\n# such that the smallest number will become 0 and the largest will become 1\n# >>> rescale_to_unit(c(1.0, 2.0, 3.0, 4.0, 5.0))\n# list(0.0, 0.25, 0.5, 0.75, 1.0)\nrescale_to_unit <- function(numbers) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- rescale_to_unit\n if(!identical(candidate(c(2.0, 49.9)), list(0.0, 1.0))){quit('no', 1)}\n if(!identical(candidate(c(100.0, 49.9)), list(1.0, 0.0))){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.0, 4.0, 5.0)), list(0.0, 0.25, 0.5, 0.75, 1.0))){quit('no', 1)}\n if(!identical(candidate(c(2.0, 1.0, 5.0, 3.0, 4.0)), list(0.25, 0.0, 1.0, 0.5, 0.75))){quit('no', 1)}\n if(!identical(candidate(c(12.0, 11.0, 15.0, 13.0, 14.0)), list(0.25, 0.0, 1.0, 0.5, 0.75))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "r", - "prompt": "# Given a positive integer n, return the product of the odd digits.\n# Return 0 if all digits are even.\n# For example:\n# >>> digits(1)\n# 1\n# >>> digits(4)\n# 0\n# >>> digits(235)\n# 15\ndigits <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- digits\n if(!identical(candidate(5), 5)){quit('no', 1)}\n if(!identical(candidate(54), 5)){quit('no', 1)}\n if(!identical(candidate(120), 1)){quit('no', 1)}\n if(!identical(candidate(5014), 5)){quit('no', 1)}\n if(!identical(candidate(98765), 315)){quit('no', 1)}\n if(!identical(candidate(5576543), 2625)){quit('no', 1)}\n if(!identical(candidate(2468), 0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "r", - "prompt": "# You will be given the name of a class (a string) and a list of extensions.\n# The extensions are to be used to load additional classes to the class. The\n# strength of the extension is as follows: Let CAP be the number of the uppercase\n# letters in the extension's name, and let SM be the number of lowercase letters \n# in the extension's name, the strength is given by the fraction CAP - SM. \n# You should find the strongest extension and return a string in this \n# format: ClassName.StrongestExtensionName.\n# If there are two or more extensions with the same strength, you should\n# choose the one that comes first in the list.\n# For example, if you are given \"Slices\" as the class and a list of the\n# extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n# return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n# (its strength is -1).\n# Example:\n# >>> Strongest_Extension('my_class', c('AA', 'Be', 'CC'))\n# 'my_class.AA'\nStrongest_Extension <- function(class_name, extensions) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- Strongest_Extension\n if(!identical(candidate('Watashi', c('tEN', 'niNE', 'eIGHt8OKe')), 'Watashi.eIGHt8OKe')){quit('no', 1)}\n if(!identical(candidate('Boku123', c('nani', 'NazeDa', 'YEs.WeCaNe', '32145tggg')), 'Boku123.YEs.WeCaNe')){quit('no', 1)}\n if(!identical(candidate('__YESIMHERE', c('t', 'eMptY', 'nothing', 'zeR00', 'NuLl__', '123NoooneB321')), '__YESIMHERE.NuLl__')){quit('no', 1)}\n if(!identical(candidate('K', c('Ta', 'TAR', 't234An', 'cosSo')), 'K.TAR')){quit('no', 1)}\n if(!identical(candidate('__HAHA', c('Tab', '123', '781345', '-_-')), '__HAHA.123')){quit('no', 1)}\n if(!identical(candidate('YameRore', c('HhAas', 'okIWILL123', 'WorkOut', 'Fails', '-_-')), 'YameRore.okIWILL123')){quit('no', 1)}\n if(!identical(candidate('finNNalLLly', c('Die', 'NowW', 'Wow', 'WoW')), 'finNNalLLly.WoW')){quit('no', 1)}\n if(!identical(candidate('_', c('Bb', '91245')), '_.Bb')){quit('no', 1)}\n if(!identical(candidate('Sp', c('671235', 'Bb')), 'Sp.671235')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "r", - "prompt": "# Given a string representing a space separated lowercase letters, return a named list\n# of the letter with the most repetition and containing the corresponding count.\n# If several letters have the same occurrence, return all of them.\n# Example:\n# >>> histogram('a b c')\n# list('a' = 1, 'b' = 1, 'c' = 1)\n# >>> histogram('a b b a')\n# list('a' = 2, 'b' = 2)\n# >>> histogram('a b c a b')\n# list('a' = 2, 'b' = 2)\n# >>> histogram('b b b b a')\n# list('b' = 4)\n# >>> histogram('')\n# list()\nhistogram <- function(test) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- histogram\n if(!identical(candidate('a b b a'), list('a' = 2, 'b' = 2))){quit('no', 1)}\n if(!identical(candidate('a b c a b'), list('a' = 2, 'b' = 2))){quit('no', 1)}\n if(!identical(candidate('a b c d g'), list('a' = 1, 'b' = 1, 'c' = 1, 'd' = 1, 'g' = 1))){quit('no', 1)}\n if(!identical(candidate('r t g'), list('r' = 1, 't' = 1, 'g' = 1))){quit('no', 1)}\n if(!identical(candidate('b b b b a'), list('b' = 4))){quit('no', 1)}\n if(!identical(candidate('r t g'), list('r' = 1, 't' = 1, 'g' = 1))){quit('no', 1)}\n if(!identical(candidate(''), list())){quit('no', 1)}\n if(!identical(candidate('a'), list('a' = 1))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "r", - "prompt": "# pairs_sum_to_zero takes a list of integers as an input.\n# it returns TRUE if there are two distinct elements in the list that\n# sum to zero, and FALSE otherwise.\n# >>> pairs_sum_to_zero(c(1, 3, 5, 0))\n# FALSE\n# >>> pairs_sum_to_zero(c(1, 3, -2, 1))\n# FALSE\n# >>> pairs_sum_to_zero(c(1, 2, 3, 7))\n# FALSE\n# >>> pairs_sum_to_zero(c(2, 4, -5, 3, 5, 7))\n# TRUE\n# >>> pairs_sum_to_zero(c(1))\n# FALSE\npairs_sum_to_zero <- function(l) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- pairs_sum_to_zero\n if(!identical(candidate(c(1, 3, 5, 0)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 3, -2, 1)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 7)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(2, 4, -5, 3, 5, 7)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(-3, 9, -1, 3, 2, 30)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(-3, 9, -1, 3, 2, 31)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(-3, 9, -1, 4, 2, 30)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(-3, 9, -1, 4, 2, 31)), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "r", - "prompt": "# Write a function that accepts two lists of strings and returns the list that has \n# total number of chars in the all strings of the list less than the other list.\n# if the two lists have the same number of chars, return the first list.\n# Examples\n# >>> total_match(c(), c())\n# list()\n# >>> total_match(c('hi', 'admin'), c('hI', 'Hi'))\n# list('hI', 'Hi')\n# >>> total_match(c('hi', 'admin'), c('hi', 'hi', 'admin', 'project'))\n# list('hi', 'admin')\n# >>> total_match(c('hi', 'admin'), c('hI', 'hi', 'hi'))\n# list('hI', 'hi', 'hi')\n# >>> total_match(c('4'), c('1', '2', '3', '4', '5'))\n# list('4')\ntotal_match <- function(lst1, lst2) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- total_match\n if(!identical(candidate(c(), c()), list())){quit('no', 1)}\n if(!identical(candidate(c('hi', 'admin'), c('hi', 'hi')), list('hi', 'hi'))){quit('no', 1)}\n if(!identical(candidate(c('hi', 'admin'), c('hi', 'hi', 'admin', 'project')), list('hi', 'admin'))){quit('no', 1)}\n if(!identical(candidate(c('4'), c('1', '2', '3', '4', '5')), list('4'))){quit('no', 1)}\n if(!identical(candidate(c('hi', 'admin'), c('hI', 'Hi')), list('hI', 'Hi'))){quit('no', 1)}\n if(!identical(candidate(c('hi', 'admin'), c('hI', 'hi', 'hi')), list('hI', 'hi', 'hi'))){quit('no', 1)}\n if(!identical(candidate(c('hi', 'admin'), c('hI', 'hi', 'hii')), list('hi', 'admin'))){quit('no', 1)}\n if(!identical(candidate(c(), c('this')), list())){quit('no', 1)}\n if(!identical(candidate(c('this'), c()), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "r", - "prompt": "# Circular shift the digits of the integer x, shift the digits right by shift\n# and return the result as a string.\n# If shift > number of digits, return digits reversed.\n# >>> circular_shift(12, 1)\n# '21'\n# >>> circular_shift(12, 2)\n# '12'\ncircular_shift <- function(x, shift) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- circular_shift\n if(!identical(candidate(100, 2), '001')){quit('no', 1)}\n if(!identical(candidate(12, 2), '12')){quit('no', 1)}\n if(!identical(candidate(97, 8), '79')){quit('no', 1)}\n if(!identical(candidate(12, 1), '21')){quit('no', 1)}\n if(!identical(candidate(11, 101), '11')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "r", - "prompt": "# Return TRUE is list elements are monotonically increasing or decreasing.\n# >>> monotonic(c(1, 2, 4, 20))\n# TRUE\n# >>> monotonic(c(1, 20, 4, 10))\n# FALSE\n# >>> monotonic(c(4, 1, 0, -10))\n# TRUE\nmonotonic <- function(l) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- monotonic\n if(!identical(candidate(c(1, 2, 4, 10)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 4, 20)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 20, 4, 10)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(4, 1, 0, -10)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(4, 1, 1, 0)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 2, 5, 60)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 5, 60)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(9, 9, 9, 9)), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "r", - "prompt": "# Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n# Example\n# >>> is_equal_to_sum_even(4)\n# FALSE\n# >>> is_equal_to_sum_even(6)\n# FALSE\n# >>> is_equal_to_sum_even(8)\n# TRUE\nis_equal_to_sum_even <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- is_equal_to_sum_even\n if(!identical(candidate(4), FALSE)){quit('no', 1)}\n if(!identical(candidate(6), FALSE)){quit('no', 1)}\n if(!identical(candidate(8), TRUE)){quit('no', 1)}\n if(!identical(candidate(10), TRUE)){quit('no', 1)}\n if(!identical(candidate(11), FALSE)){quit('no', 1)}\n if(!identical(candidate(12), TRUE)){quit('no', 1)}\n if(!identical(candidate(13), FALSE)){quit('no', 1)}\n if(!identical(candidate(16), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "r", - "prompt": "# Input to this function is a string representing musical notes in a special ASCII format.\n# Your task is to parse this string and return list of integers corresponding to how many beats does each\n# not last.\n# Here is a legend:\n# 'o' - whole note, lasts four beats\n# 'o|' - half note, lasts two beats\n# '.|' - quater note, lasts one beat\n# >>> parse_music('o o| .| o| o| .| .| .| .| o o')\n# list(4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4)\nparse_music <- function(music_string) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- parse_music\n if(!identical(candidate(''), list())){quit('no', 1)}\n if(!identical(candidate('o o o o'), list(4, 4, 4, 4))){quit('no', 1)}\n if(!identical(candidate('.| .| .| .|'), list(1, 1, 1, 1))){quit('no', 1)}\n if(!identical(candidate('o| o| .| .| o o o o'), list(2, 2, 1, 1, 4, 4, 4, 4))){quit('no', 1)}\n if(!identical(candidate('o| .| o| .| o o| o o|'), list(2, 1, 2, 1, 4, 2, 4, 2))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "r", - "prompt": "# \"\n# This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n# multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n# change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n# Examples:\n# >>> lst\n# list(1, 2, 3)\n# >>> lst\n# list()\n# >>> lst\n# list(-1, -5, 2, -1, -5)\nsum_squares <- function(lst) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- sum_squares\n if(!identical(candidate(c(1, 2, 3)), 6)){quit('no', 1)}\n if(!identical(candidate(c(1, 4, 9)), 14)){quit('no', 1)}\n if(!identical(candidate(c()), 0)){quit('no', 1)}\n if(!identical(candidate(c(1, 1, 1, 1, 1, 1, 1, 1, 1)), 9)){quit('no', 1)}\n if(!identical(candidate(c(-1, -1, -1, -1, -1, -1, -1, -1, -1)), -3)){quit('no', 1)}\n if(!identical(candidate(c(0)), 0)){quit('no', 1)}\n if(!identical(candidate(c(-1, -5, 2, -1, -5)), -126)){quit('no', 1)}\n if(!identical(candidate(c(-56, -99, 1, 0, -2)), 3030)){quit('no', 1)}\n if(!identical(candidate(c(-1, 0, 0, 0, 0, 0, 0, 0, -1)), 0)){quit('no', 1)}\n if(!identical(candidate(c(-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37)), -14196)){quit('no', 1)}\n if(!identical(candidate(c(-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10)), -1448)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "r", - "prompt": "# triples_sum_to_zero takes a list of integers as an input.\n# it returns TRUE if there are three distinct elements in the list that\n# sum to zero, and FALSE otherwise.\n# >>> triples_sum_to_zero(c(1, 3, 5, 0))\n# FALSE\n# >>> triples_sum_to_zero(c(1, 3, -2, 1))\n# TRUE\n# >>> triples_sum_to_zero(c(1, 2, 3, 7))\n# FALSE\n# >>> triples_sum_to_zero(c(2, 4, -5, 3, 9, 7))\n# TRUE\n# >>> triples_sum_to_zero(c(1))\n# FALSE\ntriples_sum_to_zero <- function(l) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- triples_sum_to_zero\n if(!identical(candidate(c(1, 3, 5, 0)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 3, 5, -1)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 3, -2, 1)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 7)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 5, 7)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(2, 4, -5, 3, 9, 7)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 3, 5, -100)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(100, 3, 5, -100)), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "r", - "prompt": "# brackets is a string of \"<\" and \">\".\n# return TRUE if every opening bracket has a corresponding closing bracket.\n# >>> correct_bracketing('<')\n# FALSE\n# >>> correct_bracketing('<>')\n# TRUE\n# >>> correct_bracketing('<<><>>')\n# TRUE\n# >>> correct_bracketing('><<>')\n# FALSE\ncorrect_bracketing <- function(brackets) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- correct_bracketing\n if(!identical(candidate('<>'), TRUE)){quit('no', 1)}\n if(!identical(candidate('<<><>>'), TRUE)){quit('no', 1)}\n if(!identical(candidate('<><><<><>><>'), TRUE)){quit('no', 1)}\n if(!identical(candidate('<><><<<><><>><>><<><><<>>>'), TRUE)){quit('no', 1)}\n if(!identical(candidate('<<<><>>>>'), FALSE)){quit('no', 1)}\n if(!identical(candidate('><<>'), FALSE)){quit('no', 1)}\n if(!identical(candidate('<'), FALSE)){quit('no', 1)}\n if(!identical(candidate('<<<<'), FALSE)){quit('no', 1)}\n if(!identical(candidate('>'), FALSE)){quit('no', 1)}\n if(!identical(candidate('<<>'), FALSE)){quit('no', 1)}\n if(!identical(candidate('<><><<><>><>><<>'), FALSE)){quit('no', 1)}\n if(!identical(candidate('<><><<><>><>>><>'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "r", - "prompt": "# Write a function that takes a vector of numbers as input and returns \n# the number of elements in the vector that are greater than 10 and both \n# first and last digits of a number are odd (1, 3, 5, 7, 9).\n# For example:\n# >>> specialFilter(c(15, -73, 14, -15))\n# 1\n# >>> specialFilter(c(33, -2, -3, 45, 21, 109))\n# 2\nspecialFilter <- function(nums) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- specialFilter\n if(!identical(candidate(c(5, -2, 1, -5)), 0)){quit('no', 1)}\n if(!identical(candidate(c(15, -73, 14, -15)), 1)){quit('no', 1)}\n if(!identical(candidate(c(33, -2, -3, 45, 21, 109)), 2)){quit('no', 1)}\n if(!identical(candidate(c(43, -12, 93, 125, 121, 109)), 4)){quit('no', 1)}\n if(!identical(candidate(c(71, -2, -33, 75, 21, 19)), 3)){quit('no', 1)}\n if(!identical(candidate(c(1)), 0)){quit('no', 1)}\n if(!identical(candidate(c()), 0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "r", - "prompt": "# Given a named list, return TRUE if all keys are strings in lower \n# case or all keys are strings in upper case, else return FALSE.\n# The function should return FALSE is the given named list is empty.\n# Examples:\n# >>> check_dict_case(list('a' = 'apple', 'b' = 'banana'))\n# TRUE\n# >>> check_dict_case(list('a' = 'apple', 'A' = 'banana', 'B' = 'banana'))\n# FALSE\n# >>> check_dict_case(list('a' = 'apple', 8 = 'banana', 'a' = 'apple'))\n# FALSE\n# >>> check_dict_case(list('Name' = 'John', 'Age' = '36', 'City' = 'Houston'))\n# FALSE\n# >>> check_dict_case(list('STATE' = 'NC', 'ZIP' = '12345'))\n# TRUE\ncheck_dict_case <- function(dict) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- check_dict_case\n if(!identical(candidate(list('p' = 'pineapple', 'b' = 'banana')), TRUE)){quit('no', 1)}\n if(!identical(candidate(list('p' = 'pineapple', 'A' = 'banana', 'B' = 'banana')), FALSE)){quit('no', 1)}\n if(!identical(candidate(list('p' = 'pineapple', '5' = 'banana', 'a' = 'apple')), FALSE)){quit('no', 1)}\n if(!identical(candidate(list('Name' = 'John', 'Age' = '36', 'City' = 'Houston')), FALSE)){quit('no', 1)}\n if(!identical(candidate(list('STATE' = 'NC', 'ZIP' = '12345')), TRUE)){quit('no', 1)}\n if(!identical(candidate(list('fruit' = 'Orange', 'taste' = 'Sweet')), TRUE)){quit('no', 1)}\n if(!identical(candidate(list()), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "r", - "prompt": "# Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n# should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n# alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n# Examples\n# >>> split_words('Hello world!')\n# list('Hello', 'world!')\n# >>> split_words('Hello,world!')\n# list('Hello', 'world!')\n# >>> split_words('abcdef')\n# 3\nsplit_words <- function(txt) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- split_words\n if(!identical(candidate('Hello world!'), list('Hello', 'world!'))){quit('no', 1)}\n if(!identical(candidate('Hello,world!'), list('Hello', 'world!'))){quit('no', 1)}\n if(!identical(candidate('Hello world,!'), list('Hello', 'world,!'))){quit('no', 1)}\n if(!identical(candidate('Hello,Hello,world !'), list('Hello,Hello,world', '!'))){quit('no', 1)}\n if(!identical(candidate('abcdef'), 3)){quit('no', 1)}\n if(!identical(candidate('aaabb'), 2)){quit('no', 1)}\n if(!identical(candidate('aaaBb'), 1)){quit('no', 1)}\n if(!identical(candidate(''), 0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "r", - "prompt": "# The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fibfib(0) == 0\n# fibfib(1) == 0\n# fibfib(2) == 1\n# fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n# Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n# >>> fibfib(1)\n# 0\n# >>> fibfib(5)\n# 4\n# >>> fibfib(8)\n# 24\nfibfib <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- fibfib\n if(!identical(candidate(2), 1)){quit('no', 1)}\n if(!identical(candidate(1), 0)){quit('no', 1)}\n if(!identical(candidate(5), 4)){quit('no', 1)}\n if(!identical(candidate(8), 24)){quit('no', 1)}\n if(!identical(candidate(10), 81)){quit('no', 1)}\n if(!identical(candidate(12), 274)){quit('no', 1)}\n if(!identical(candidate(14), 927)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "r", - "prompt": "# You are given a list of numbers.\n# You need to return the sum of squared numbers in the given list,\n# round each element in the list to the upper int(Ceiling) first.\n# Examples:\n# >>> lst(c(1.0, 2.0, 3.0))\n# 14\n# >>> lst(c(1.0, 4.0, 9.0))\n# 98\n# >>> lst(c(1.0, 3.0, 5.0, 7.0))\n# 84\n# >>> lst(c(1.4, 4.2, 0.0))\n# 29\n# >>> lst(c(-2.4, 1.0, 1.0))\n# 6\nsum_squares <- function(lst) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- sum_squares\n if(!identical(candidate(c(1.0, 2.0, 3.0)), 14)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.0)), 14)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 3.0, 5.0, 7.0)), 84)){quit('no', 1)}\n if(!identical(candidate(c(1.4, 4.2, 0.0)), 29)){quit('no', 1)}\n if(!identical(candidate(c(-2.4, 1.0, 1.0)), 6)){quit('no', 1)}\n if(!identical(candidate(c(100.0, 1.0, 15.0, 2.0)), 10230)){quit('no', 1)}\n if(!identical(candidate(c(10000.0, 10000.0)), 200000000)){quit('no', 1)}\n if(!identical(candidate(c(-1.4, 4.6, 6.3)), 75)){quit('no', 1)}\n if(!identical(candidate(c(-1.4, 17.9, 18.9, 19.9)), 1086)){quit('no', 1)}\n if(!identical(candidate(c(0.0)), 0)){quit('no', 1)}\n if(!identical(candidate(c(-1.0)), 1)){quit('no', 1)}\n if(!identical(candidate(c(-1.0, 1.0, 0.0)), 2)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_85_add", - "language": "r", - "prompt": "# Given a non-empty list of integers lst. add the even elements that are at odd indices..\n# Examples:\n# >>> add(c(4, 2, 6, 7))\n# 2\nadd <- function(lst) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- add\n if(!identical(candidate(c(4, 88)), 88)){quit('no', 1)}\n if(!identical(candidate(c(4, 5, 6, 7, 2, 122)), 122)){quit('no', 1)}\n if(!identical(candidate(c(4, 0, 6, 7)), 0)){quit('no', 1)}\n if(!identical(candidate(c(4, 4, 6, 8)), 12)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "r", - "prompt": "# Return sorted unique elements in a list\n# >>> unique(c(5, 3, 5, 2, 3, 3, 9, 0, 123))\n# list(0, 2, 3, 5, 9, 123)\nunique <- function(l) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- unique\n if(!identical(candidate(c(5, 3, 5, 2, 3, 3, 9, 0, 123)), list(0, 2, 3, 5, 9, 123))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "r", - "prompt": "# Given a string text, replace all spaces in it with underscores, \n# and if a string has more than 2 consecutive spaces, \n# then replace all consecutive spaces with - \n# >>> fix_spaces(' Example')\n# 'Example'\n# >>> fix_spaces(' Example 1')\n# 'Example_1'\n# >>> fix_spaces(' Example 2')\n# '_Example_2'\n# >>> fix_spaces(' Example 3')\n# '_Example-3'\nfix_spaces <- function(text) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- fix_spaces\n if(!identical(candidate('Example'), 'Example')){quit('no', 1)}\n if(!identical(candidate('Mudasir Hanif '), 'Mudasir_Hanif_')){quit('no', 1)}\n if(!identical(candidate('Yellow Yellow Dirty Fellow'), 'Yellow_Yellow__Dirty__Fellow')){quit('no', 1)}\n if(!identical(candidate('Exa mple'), 'Exa-mple')){quit('no', 1)}\n if(!identical(candidate(' Exa 1 2 2 mple'), '-Exa_1_2_2_mple')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "r", - "prompt": "# Return 2^n modulo p (be aware of numerics).\n# >>> modp(3, 5)\n# 3\n# >>> modp(1101, 101)\n# 2\n# >>> modp(0, 101)\n# 1\n# >>> modp(3, 11)\n# 8\n# >>> modp(100, 101)\n# 1\nmodp <- function(n, p) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- modp\n if(!identical(candidate(3, 5), 3)){quit('no', 1)}\n if(!identical(candidate(1101, 101), 2)){quit('no', 1)}\n if(!identical(candidate(0, 101), 1)){quit('no', 1)}\n if(!identical(candidate(3, 11), 8)){quit('no', 1)}\n if(!identical(candidate(100, 101), 1)){quit('no', 1)}\n if(!identical(candidate(30, 5), 4)){quit('no', 1)}\n if(!identical(candidate(31, 5), 3)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "r", - "prompt": "# You have to write a function which validates a given date string and\n# returns TRUE if the date is valid otherwise FALSE.\n# The date is valid if all of the following rules are satisfied:\n# 1. The date string is not empty.\n# 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n# 3. The months should not be less than 1 or higher than 12.\n# 4. The date should be in the format: mm-dd-yyyy\n# >>> valid_date('03-11-2000')\n# TRUE\n# >>> valid_date('15-01-2012')\n# FALSE\n# >>> valid_date('04-0-2040')\n# FALSE\n# >>> valid_date('06-04-2020')\n# TRUE\n# >>> valid_date('06/04/2020')\n# FALSE\nvalid_date <- function(date) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- valid_date\n if(!identical(candidate('03-11-2000'), TRUE)){quit('no', 1)}\n if(!identical(candidate('15-01-2012'), FALSE)){quit('no', 1)}\n if(!identical(candidate('04-0-2040'), FALSE)){quit('no', 1)}\n if(!identical(candidate('06-04-2020'), TRUE)){quit('no', 1)}\n if(!identical(candidate('01-01-2007'), TRUE)){quit('no', 1)}\n if(!identical(candidate('03-32-2011'), FALSE)){quit('no', 1)}\n if(!identical(candidate(''), FALSE)){quit('no', 1)}\n if(!identical(candidate('04-31-3000'), FALSE)){quit('no', 1)}\n if(!identical(candidate('06-06-2005'), TRUE)){quit('no', 1)}\n if(!identical(candidate('21-31-2000'), FALSE)){quit('no', 1)}\n if(!identical(candidate('04-12-2003'), TRUE)){quit('no', 1)}\n if(!identical(candidate('04122003'), FALSE)){quit('no', 1)}\n if(!identical(candidate('20030412'), FALSE)){quit('no', 1)}\n if(!identical(candidate('2003-04'), FALSE)){quit('no', 1)}\n if(!identical(candidate('2003-04-12'), FALSE)){quit('no', 1)}\n if(!identical(candidate('04-2003'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "r", - "prompt": "# Write a function that takes a string and returns an ordered version of it.\n# Ordered version of string, is a string where all words (separated by space)\n# are replaced by a new word where all the characters arranged in\n# ascending order based on ascii value.\n# Note: You should keep the order of words and blank spaces in the sentence.\n# For example:\n# >>> anti_shuffle('Hi')\n# 'Hi'\n# >>> anti_shuffle('hello')\n# 'ehllo'\n# >>> anti_shuffle('Hello World!!!')\n# 'Hello !!!Wdlor'\nanti_shuffle <- function(s) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- anti_shuffle\n if(!identical(candidate('Hi'), 'Hi')){quit('no', 1)}\n if(!identical(candidate('hello'), 'ehllo')){quit('no', 1)}\n if(!identical(candidate('number'), 'bemnru')){quit('no', 1)}\n if(!identical(candidate('abcd'), 'abcd')){quit('no', 1)}\n if(!identical(candidate('Hello World!!!'), 'Hello !!!Wdlor')){quit('no', 1)}\n if(!identical(candidate(''), '')){quit('no', 1)}\n if(!identical(candidate('Hi. My name is Mister Robot. How are you?'), '.Hi My aemn is Meirst .Rboot How aer ?ouy')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "r", - "prompt": "# Given a list of numbers, return whether or not they are sorted\n# in ascending order. If list has more than 1 duplicate of the same\n# number, return FALSE. Assume no negative numbers and only integers.\n# Examples\n# >>> is_sorted(c(5))\n# TRUE\n# >>> is_sorted(c(1, 2, 3, 4, 5))\n# TRUE\n# >>> is_sorted(c(1, 3, 2, 4, 5))\n# FALSE\n# >>> is_sorted(c(1, 2, 3, 4, 5, 6))\n# TRUE\n# >>> is_sorted(c(1, 2, 3, 4, 5, 6, 7))\n# TRUE\n# >>> is_sorted(c(1, 3, 2, 4, 5, 6, 7))\n# FALSE\n# >>> is_sorted(c(1, 2, 2, 3, 3, 4))\n# TRUE\n# >>> is_sorted(c(1, 2, 2, 2, 3, 4))\n# FALSE\nis_sorted <- function(lst) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- is_sorted\n if(!identical(candidate(c(5)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 5)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 3, 2, 4, 5)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 5, 6)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 5, 6, 7)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 3, 2, 4, 5, 6, 7)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c()), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 1)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 2, 2, 3, 4)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 3, 3, 4)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 2, 3, 3, 4)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4)), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "r", - "prompt": "# You are given a string s.\n# Your task is to check if the string is hapr or not.\n# A string is hapr if its length is at least 3 and every 3 consecutive letters are distinct\n# For example:\n# >>> is_happy('a')\n# FALSE\n# >>> is_happy('aa')\n# FALSE\n# >>> is_happy('abcd')\n# TRUE\n# >>> is_happy('aabb')\n# FALSE\n# >>> is_happy('adb')\n# TRUE\n# >>> is_happy('xyy')\n# FALSE\nis_happy <- function(s) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- is_happy\n if(!identical(candidate('a'), FALSE)){quit('no', 1)}\n if(!identical(candidate('aa'), FALSE)){quit('no', 1)}\n if(!identical(candidate('abcd'), TRUE)){quit('no', 1)}\n if(!identical(candidate('aabb'), FALSE)){quit('no', 1)}\n if(!identical(candidate('adb'), TRUE)){quit('no', 1)}\n if(!identical(candidate('xyy'), FALSE)){quit('no', 1)}\n if(!identical(candidate('iopaxpoi'), TRUE)){quit('no', 1)}\n if(!identical(candidate('iopaxioi'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "r", - "prompt": "# Write a function that returns TRUE if the object q will fly, and FALSE otherwise.\n# The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n# Example:\n# >>> will_it_fly(c(1, 2), 5)\n# FALSE\n# # 1+2 is less than the maximum possible weight, but it's unbalanced.\n# >>> will_it_fly(c(3, 2, 3), 1)\n# FALSE\n# # it's balanced, but 3+2+3 is more than the maximum possible weight.\n# >>> will_it_fly(c(3, 2, 3), 9)\n# TRUE\n# # 3+2+3 is less than the maximum possible weight, and it's balanced.\n# >>> will_it_fly(c(3), 5)\n# TRUE\n# # 3 is less than the maximum possible weight, and it's balanced.\nwill_it_fly <- function(q, w) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- will_it_fly\n if(!identical(candidate(c(3, 2, 3), 9), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2), 5), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(3), 5), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 3), 1), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3), 6), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(5), 5), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "r", - "prompt": "# Given a vector of non-negative integers, return a cor of the given vector after sorting,\n# you will sort the given vector in ascending order if the sum( first index value, last index value) is odd,\n# or sort it in descending order if the sum( first index value, last index value) is even.\n# Note:\n# * don't change the given vector.\n# Examples:\n# >>> sort_array(c())\n# list()\n# >>> sort_array(c(5))\n# list(5)\n# >>> sort_array(c(2, 4, 3, 0, 1, 5))\n# list(0, 1, 2, 3, 4, 5)\n# >>> sort_array(c(2, 4, 3, 0, 1, 5, 6))\n# list(6, 5, 4, 3, 2, 1, 0)\nsort_array <- function(array) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- sort_array\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(5)), list(5))){quit('no', 1)}\n if(!identical(candidate(c(2, 4, 3, 0, 1, 5)), list(0, 1, 2, 3, 4, 5))){quit('no', 1)}\n if(!identical(candidate(c(2, 4, 3, 0, 1, 5, 6)), list(6, 5, 4, 3, 2, 1, 0))){quit('no', 1)}\n if(!identical(candidate(c(2, 1)), list(1, 2))){quit('no', 1)}\n if(!identical(candidate(c(15, 42, 87, 32, 11, 0)), list(0, 11, 15, 32, 42, 87))){quit('no', 1)}\n if(!identical(candidate(c(21, 14, 23, 11)), list(23, 21, 14, 11))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "r", - "prompt": "# Implement a function that takes an non-negative integer and returns a vector of the first n\n# integers that are prime numbers and less than n.\n# for example:\n# >>> count_up_to(5)\n# list(2, 3)\n# >>> count_up_to(11)\n# list(2, 3, 5, 7)\n# >>> count_up_to(0)\n# list()\n# >>> count_up_to(20)\n# list(2, 3, 5, 7, 11, 13, 17, 19)\n# >>> count_up_to(1)\n# list()\n# >>> count_up_to(18)\n# list(2, 3, 5, 7, 11, 13, 17)\ncount_up_to <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- count_up_to\n if(!identical(candidate(5), list(2, 3))){quit('no', 1)}\n if(!identical(candidate(6), list(2, 3, 5))){quit('no', 1)}\n if(!identical(candidate(7), list(2, 3, 5))){quit('no', 1)}\n if(!identical(candidate(10), list(2, 3, 5, 7))){quit('no', 1)}\n if(!identical(candidate(0), list())){quit('no', 1)}\n if(!identical(candidate(22), list(2, 3, 5, 7, 11, 13, 17, 19))){quit('no', 1)}\n if(!identical(candidate(1), list())){quit('no', 1)}\n if(!identical(candidate(18), list(2, 3, 5, 7, 11, 13, 17))){quit('no', 1)}\n if(!identical(candidate(47), list(2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43))){quit('no', 1)}\n if(!identical(candidate(101), list(2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "r", - "prompt": "# Out of list of strings, return the longest one. Return the first one in case of multiple\n# strings of the same length. Return NULL in case the input list is empty.\n# >>> longest(c())\n# NULL\n# >>> longest(c('a', 'b', 'c'))\n# 'a'\n# >>> longest(c('a', 'bb', 'ccc'))\n# 'ccc'\nlongest <- function(strings) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- longest\n if(!identical(candidate(c()), NULL)){quit('no', 1)}\n if(!identical(candidate(c('x', 'y', 'z')), 'x')){quit('no', 1)}\n if(!identical(candidate(c('x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc')), 'zzzz')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "r", - "prompt": "# Given a vector of integers, sort the integers that are between 1 and 9 inclusive,\n# reverse the resulting vector, and then replace each digit by its corresponding name from\n# \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n# For example:\n# >>> by_length(c(2, 1, 1, 4, 5, 8, 2, 3))\n# list('Eight', 'Five', 'Four', 'Three', 'Two', 'Two', 'One', 'One')\n# If the vector is empty, return an empty vector:\n# >>> by_length(c())\n# list()\n# If the vector has any strange number ignore it:\n# >>> by_length(c(1, -1, 55))\n# list('One')\nby_length <- function(arr) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- by_length\n if(!identical(candidate(c(2, 1, 1, 4, 5, 8, 2, 3)), list('Eight', 'Five', 'Four', 'Three', 'Two', 'Two', 'One', 'One'))){quit('no', 1)}\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(1, -1, 55)), list('One'))){quit('no', 1)}\n if(!identical(candidate(c(1, -1, 3, 2)), list('Three', 'Two', 'One'))){quit('no', 1)}\n if(!identical(candidate(c(9, 4, 8)), list('Nine', 'Eight', 'Four'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_106_f", - "language": "r", - "prompt": "# Implement the function f that takes n as a parameter,\n# 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\n# or the sum of numbers from 1 to i otherwise.\n# i starts from 1.\n# the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n# Example:\n# >>> f(5)\n# list(1, 2, 6, 24, 15)\nf <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- f\n if(!identical(candidate(5), list(1, 2, 6, 24, 15))){quit('no', 1)}\n if(!identical(candidate(7), list(1, 2, 6, 24, 15, 720, 28))){quit('no', 1)}\n if(!identical(candidate(1), list(1))){quit('no', 1)}\n if(!identical(candidate(3), list(1, 2, 6))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "r", - "prompt": "# Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n# >>> fizz_buzz(50)\n# 0\n# >>> fizz_buzz(78)\n# 2\n# >>> fizz_buzz(79)\n# 3\nfizz_buzz <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- fizz_buzz\n if(!identical(candidate(50), 0)){quit('no', 1)}\n if(!identical(candidate(78), 2)){quit('no', 1)}\n if(!identical(candidate(79), 3)){quit('no', 1)}\n if(!identical(candidate(100), 3)){quit('no', 1)}\n if(!identical(candidate(200), 6)){quit('no', 1)}\n if(!identical(candidate(4000), 192)){quit('no', 1)}\n if(!identical(candidate(10000), 639)){quit('no', 1)}\n if(!identical(candidate(100000), 8026)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "r", - "prompt": "# Given a positive floating point number, it can be decomposed into\n# and integer part (largest integer smaller than given number) and decimals\n# (leftover part always smaller than 1).\n# Return the decimal part of the number.\n# >>> truncate_number(3.5)\n# 0.5\ntruncate_number <- function(number) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- truncate_number\n if(!identical(candidate(3.5), 0.5)){quit('no', 1)}\n if(!identical(candidate(1.25), 0.25)){quit('no', 1)}\n if(!identical(candidate(123.0), 0.0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "r", - "prompt": "# For a given list of integers, return a list consisting of a sum and a product of all the integers in a list.\n# Empty sum should be equal to 0 and empty product should be equal to 1.\n# >>> sum_product(c())\n# list(0, 1)\n# >>> sum_product(c(1, 2, 3, 4))\n# list(10, 24)\nsum_product <- function(numbers) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- sum_product\n if(!identical(candidate(c()), list(0, 1))){quit('no', 1)}\n if(!identical(candidate(c(1, 1, 1)), list(3, 1))){quit('no', 1)}\n if(!identical(candidate(c(100, 0)), list(100, 0))){quit('no', 1)}\n if(!identical(candidate(c(3, 5, 7)), list(15, 105))){quit('no', 1)}\n if(!identical(candidate(c(10)), list(10, 10))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "r", - "prompt": "# You are given a 2 dimensional data, as a nested lists,\n# which is similar to matrix, however, unlike matrices,\n# each row may contain a different number of columns.\n# Given lst, and integer x, find integers x in the list,\n# and return list of lists, [(x1, y1), (x2, y2) ...] such that\n# each list is a coordinate - (row, columns), starting with 0.\n# Sort coordinates initially by rows in ascending order.\n# Also, sort coordinates of the row by columns in descending order.\n# Examples:\n# >>> get_row(list(list(1, 2, 3, 4, 5, 6), list(1, 2, 3, 4, 1, 6), list(1, 2, 3, 4, 5, 1)), 1)\n# list(list(0, 0), list(1, 4), list(1, 0), list(2, 5), list(2, 0))\n# >>> get_row(list(), 1)\n# list()\n# >>> get_row(list(list(), list(1), list(1, 2, 3)), 3)\n# list(list(2, 2))\nget_row <- function(lst, x) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- get_row\n if(!identical(candidate(list(list(1, 2, 3, 4, 5, 6), list(1, 2, 3, 4, 1, 6), list(1, 2, 3, 4, 5, 1)), 1), list(list(0, 0), list(1, 4), list(1, 0), list(2, 5), list(2, 0)))){quit('no', 1)}\n if(!identical(candidate(list(list(1, 2, 3, 4, 5, 6), list(1, 2, 3, 4, 5, 6), list(1, 2, 3, 4, 5, 6), list(1, 2, 3, 4, 5, 6), list(1, 2, 3, 4, 5, 6), list(1, 2, 3, 4, 5, 6)), 2), list(list(0, 1), list(1, 1), list(2, 1), list(3, 1), list(4, 1), list(5, 1)))){quit('no', 1)}\n if(!identical(candidate(list(list(1, 2, 3, 4, 5, 6), list(1, 2, 3, 4, 5, 6), list(1, 1, 3, 4, 5, 6), list(1, 2, 1, 4, 5, 6), list(1, 2, 3, 1, 5, 6), list(1, 2, 3, 4, 1, 6), list(1, 2, 3, 4, 5, 1)), 1), list(list(0, 0), list(1, 0), list(2, 1), list(2, 0), list(3, 2), list(3, 0), list(4, 3), list(4, 0), list(5, 4), list(5, 0), list(6, 5), list(6, 0)))){quit('no', 1)}\n if(!identical(candidate(list(), 1), list())){quit('no', 1)}\n if(!identical(candidate(list(list(1)), 2), list())){quit('no', 1)}\n if(!identical(candidate(list(list(), list(1), list(1, 2, 3)), 3), list(list(2, 2)))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "r", - "prompt": "# You're a hungry rabbit, and you already have eaten a certain number of carrots,\n# but now you need to eat more carrots to complete the day's meals.\n# you should return a vector of [ total number of eaten carrots after your meals,\n# the number of carrots left after your meals ]\n# if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n# Example:\n# >>> eat(5, 6, 10)\n# list(11, 4)\n# >>> eat(4, 8, 9)\n# list(12, 1)\n# >>> eat(1, 10, 10)\n# list(11, 0)\n# >>> eat(2, 11, 5)\n# list(7, 0)\n# Variables:\n# @number : integer\n# the number of carrots that you have eaten.\n# @need : integer\n# the number of carrots that you need to eat.\n# @remaining : integer\n# the number of remaining carrots thet exist in stock\n# Constrain:\n# * 0 <= number <= 1000\n# * 0 <= need <= 1000\n# * 0 <= remaining <= 1000\n# Have fun :)\neat <- function(number, need, remaining) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- eat\n if(!identical(candidate(5, 6, 10), list(11, 4))){quit('no', 1)}\n if(!identical(candidate(4, 8, 9), list(12, 1))){quit('no', 1)}\n if(!identical(candidate(1, 10, 10), list(11, 0))){quit('no', 1)}\n if(!identical(candidate(2, 11, 5), list(7, 0))){quit('no', 1)}\n if(!identical(candidate(4, 5, 7), list(9, 2))){quit('no', 1)}\n if(!identical(candidate(4, 5, 1), list(5, 0))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "r", - "prompt": "# Given a positive integer N, return the total sum of its digits in binary.\n# Example\n# >>> solve(1000)\n# '1'\n# >>> solve(150)\n# '110'\n# >>> solve(147)\n# '1100'\n# Variables:\n# @N integer\n# Constraints: 0 \u2264 N \u2264 10000.\n# Output:\n# a string of binary number\nsolve <- function(N) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- solve\n if(!identical(candidate(1000), '1')){quit('no', 1)}\n if(!identical(candidate(150), '110')){quit('no', 1)}\n if(!identical(candidate(147), '1100')){quit('no', 1)}\n if(!identical(candidate(333), '1001')){quit('no', 1)}\n if(!identical(candidate(963), '10010')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "r", - "prompt": "# You are given a list of integers.\n# You need to find the largest prime value and return the sum of its digits.\n# Examples:\n# >>> skjkasdkd(c(0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3))\n# 10\n# >>> skjkasdkd(c(1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1))\n# 25\n# >>> skjkasdkd(c(1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3))\n# 13\n# >>> skjkasdkd(c(0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6))\n# 11\n# >>> skjkasdkd(c(0, 81, 12, 3, 1, 21))\n# 3\n# >>> skjkasdkd(c(0, 8, 1, 2, 1, 7))\n# 7\nskjkasdkd <- function(lst) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- skjkasdkd\n if(!identical(candidate(c(0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3)), 10)){quit('no', 1)}\n if(!identical(candidate(c(1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1)), 25)){quit('no', 1)}\n if(!identical(candidate(c(1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3)), 13)){quit('no', 1)}\n if(!identical(candidate(c(0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6)), 11)){quit('no', 1)}\n if(!identical(candidate(c(0, 81, 12, 3, 1, 21)), 3)){quit('no', 1)}\n if(!identical(candidate(c(0, 8, 1, 2, 1, 7)), 7)){quit('no', 1)}\n if(!identical(candidate(c(8191)), 19)){quit('no', 1)}\n if(!identical(candidate(c(8191, 123456, 127, 7)), 19)){quit('no', 1)}\n if(!identical(candidate(c(127, 97, 8192)), 10)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "r", - "prompt": "# Given a vector arr of integers, find the minimum number of elements that\n# need to be changed to make the vector palindromic. A palindromic vector is a vector that\n# is read the same backwards and forwards. In one change, you can change one element to any other element.\n# For example:\n# >>> smallest_change(c(1, 2, 3, 5, 4, 7, 9, 6))\n# 4\n# >>> smallest_change(c(1, 2, 3, 4, 3, 2, 2))\n# 1\n# >>> smallest_change(c(1, 2, 3, 2, 1))\n# 0\nsmallest_change <- function(arr) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- smallest_change\n if(!identical(candidate(c(1, 2, 3, 5, 4, 7, 9, 6)), 4)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 3, 2, 2)), 1)){quit('no', 1)}\n if(!identical(candidate(c(1, 4, 2)), 1)){quit('no', 1)}\n if(!identical(candidate(c(1, 4, 4, 2)), 1)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 2, 1)), 0)){quit('no', 1)}\n if(!identical(candidate(c(3, 1, 1, 3)), 0)){quit('no', 1)}\n if(!identical(candidate(c(1)), 0)){quit('no', 1)}\n if(!identical(candidate(c(0, 1)), 1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "r", - "prompt": "# It is the last week of the semester and the teacher has to give the grades\n# to students. The teacher has been making her own algorithm for grading.\n# The only problem is, she has lost the code she used for grading.\n# She has given you a list of GPAs for some students and you have to write \n# a function that can output a list of letter grades using the following table:\n# GPA | Letter grade\n# 4.0 A+\n# > 3.7 A \n# > 3.3 A- \n# > 3.0 B+\n# > 2.7 B \n# > 2.3 B-\n# > 2.0 C+\n# > 1.7 C\n# > 1.3 C-\n# > 1.0 D+ \n# > 0.7 D \n# > 0.0 D-\n# 0.0 E\n# Example:\n# >>> grade_equation(c(4.0, 3, 1.7, 2, 3.5))\n# list('A+', 'B', 'C-', 'C', 'A-')\nnumerical_letter_grade <- function(grades) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- numerical_letter_grade\n if(!identical(candidate(c(4.0, 3, 1.7, 2, 3.5)), list('A+', 'B', 'C-', 'C', 'A-'))){quit('no', 1)}\n if(!identical(candidate(c(1.2)), list('D+'))){quit('no', 1)}\n if(!identical(candidate(c(0.5)), list('D-'))){quit('no', 1)}\n if(!identical(candidate(c(0.0)), list('E'))){quit('no', 1)}\n if(!identical(candidate(c(1.0, 0.3, 1.5, 2.8, 3.3)), list('D', 'D-', 'C-', 'B', 'B+'))){quit('no', 1)}\n if(!identical(candidate(c(0.0, 0.7)), list('E', 'D-'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "r", - "prompt": "# Given the lengths of the three sides of a triangle. Return the area of\n# the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n# Otherwise return -1\n# Three sides make a valid triangle when the sum of any two sides is greater \n# than the third side.\n# Example:\n# >>> triangle_area(3, 4, 5)\n# 6.0\n# >>> triangle_area(1, 2, 10)\n# -1\ntriangle_area <- function(a, b, c) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- triangle_area\n if(!identical(candidate(3, 4, 5), 6.0)){quit('no', 1)}\n if(!identical(candidate(1, 2, 10), -1)){quit('no', 1)}\n if(!identical(candidate(4, 8, 5), 8.18)){quit('no', 1)}\n if(!identical(candidate(2, 2, 2), 1.73)){quit('no', 1)}\n if(!identical(candidate(1, 2, 3), -1)){quit('no', 1)}\n if(!identical(candidate(10, 5, 7), 16.25)){quit('no', 1)}\n if(!identical(candidate(2, 6, 3), -1)){quit('no', 1)}\n if(!identical(candidate(1, 1, 1), 0.43)){quit('no', 1)}\n if(!identical(candidate(2, 2, 10), -1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "r", - "prompt": "# Check if two words have the same characters.\n# >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n# TRUE\n# >>> same_chars('abcd', 'dddddddabc')\n# TRUE\n# >>> same_chars('dddddddabc', 'abcd')\n# TRUE\n# >>> same_chars('eabcd', 'dddddddabc')\n# FALSE\n# >>> same_chars('abcd', 'dddddddabce')\n# FALSE\n# >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc')\n# FALSE\nsame_chars <- function(s0, s1) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- same_chars\n if(!identical(candidate('eabcdzzzz', 'dddzzzzzzzddeddabc'), TRUE)){quit('no', 1)}\n if(!identical(candidate('abcd', 'dddddddabc'), TRUE)){quit('no', 1)}\n if(!identical(candidate('dddddddabc', 'abcd'), TRUE)){quit('no', 1)}\n if(!identical(candidate('eabcd', 'dddddddabc'), FALSE)){quit('no', 1)}\n if(!identical(candidate('abcd', 'dddddddabcf'), FALSE)){quit('no', 1)}\n if(!identical(candidate('eabcdzzzz', 'dddzzzzzzzddddabc'), FALSE)){quit('no', 1)}\n if(!identical(candidate('aabb', 'aaccc'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "r", - "prompt": "# Given a vector of integers nums, find the minimum sum of any non-empty sub-vector\n# of nums.\n# Example\n# >>> minSubArraySum(c(2, 3, 4, 1, 2, 4))\n# 1\n# >>> minSubArraySum(c(-1, -2, -3))\n# -6\nminSubArraySum <- function(nums) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- minSubArraySum\n if(!identical(candidate(c(2, 3, 4, 1, 2, 4)), 1)){quit('no', 1)}\n if(!identical(candidate(c(-1, -2, -3)), -6)){quit('no', 1)}\n if(!identical(candidate(c(-1, -2, -3, 2, -10)), -14)){quit('no', 1)}\n if(!identical(candidate(c(-9999999999999999)), -9999999999999999)){quit('no', 1)}\n if(!identical(candidate(c(0, 10, 20, 1000000)), 0)){quit('no', 1)}\n if(!identical(candidate(c(-1, -2, -3, 10, -5)), -6)){quit('no', 1)}\n if(!identical(candidate(c(100, -1, -2, -3, 10, -5)), -6)){quit('no', 1)}\n if(!identical(candidate(c(10, 11, 13, 8, 3, 4)), 3)){quit('no', 1)}\n if(!identical(candidate(c(100, -33, 32, -1, 0, -2)), -33)){quit('no', 1)}\n if(!identical(candidate(c(-10)), -10)){quit('no', 1)}\n if(!identical(candidate(c(7)), 7)){quit('no', 1)}\n if(!identical(candidate(c(1, -1)), -1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "r", - "prompt": "# Given a string s and a natural number n, you have been tasked to implement \n# a function that returns a list of all words from string s that contain exactly \n# n consonants, in order these words appear in the string s.\n# If the string s is empty then the function should return an empty list.\n# Note: you may assume the input string contains only letters and spaces.\n# Examples:\n# >>> select_words('Mary had a little lamb', 4)\n# list('little')\n# >>> select_words('Mary had a little lamb', 3)\n# list('Mary', 'lamb')\n# >>> select_words('simple white space', 2)\n# list()\n# >>> select_words('Hello world', 4)\n# list('world')\n# >>> select_words('Uncle sam', 3)\n# list('Uncle')\nselect_words <- function(s, n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- select_words\n if(!identical(candidate('Mary had a little lamb', 4), list('little'))){quit('no', 1)}\n if(!identical(candidate('Mary had a little lamb', 3), list('Mary', 'lamb'))){quit('no', 1)}\n if(!identical(candidate('simple white space', 2), list())){quit('no', 1)}\n if(!identical(candidate('Hello world', 4), list('world'))){quit('no', 1)}\n if(!identical(candidate('Uncle sam', 3), list('Uncle'))){quit('no', 1)}\n if(!identical(candidate('', 4), list())){quit('no', 1)}\n if(!identical(candidate('a b c d e f', 1), list('b', 'c', 'd', 'f'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "r", - "prompt": "# Return list of all prefixes from shortest to longest of the input string\n# >>> all_prefixes('abc')\n# list('a', 'ab', 'abc')\nall_prefixes <- function(string) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- all_prefixes\n if(!identical(candidate(''), list())){quit('no', 1)}\n if(!identical(candidate('asdfgh'), list('a', 'as', 'asd', 'asdf', 'asdfg', 'asdfgh'))){quit('no', 1)}\n if(!identical(candidate('WWW'), list('W', 'WW', 'WWW'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "r", - "prompt": "# Create a function that takes a value (string) representing a number\n# and returns the closest integer to it. If the number is equidistant\n# from two integers, round it away from zero.\n# Examples\n# >>> closest_integer('10')\n# 10\n# >>> closest_integer('15.3')\n# 15\n# Note:\n# Rounding away from zero means that if the given number is equidistant\n# from two integers, the one you should return is the one that is the\n# farthest from zero. For example closest_integer(\"14.5\") should\n# return 15 and closest_integer(\"-14.5\") should return -15.\nclosest_integer <- function(value) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- closest_integer\n if(!identical(candidate('10'), 10)){quit('no', 1)}\n if(!identical(candidate('14.5'), 15)){quit('no', 1)}\n if(!identical(candidate('-15.5'), -16)){quit('no', 1)}\n if(!identical(candidate('15.3'), 15)){quit('no', 1)}\n if(!identical(candidate('0'), 0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "r", - "prompt": "# Create a function which takes a string representing a file's name, and returns\n# 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n# A file's name is considered to be valid if and only if all the following conditions \n# are met:\n# - There should not be more than three digits ('0'-'9') in the file's name.\n# - The file's name contains exactly one dot '.'\n# - The substring before the dot should not be empty, and it starts with a letter from \n# the latin alphapet ('a'-'z' and 'A'-'Z').\n# - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n# Examples:\n# >>> file_name_check('example.txt')\n# 'Yes'\n# >>> file_name_check('1example.dll')\n# 'No'\nfile_name_check <- function(file_name) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- file_name_check\n if(!identical(candidate('example.txt'), 'Yes')){quit('no', 1)}\n if(!identical(candidate('1example.dll'), 'No')){quit('no', 1)}\n if(!identical(candidate('s1sdf3.asd'), 'No')){quit('no', 1)}\n if(!identical(candidate('K.dll'), 'Yes')){quit('no', 1)}\n if(!identical(candidate('MY16FILE3.exe'), 'Yes')){quit('no', 1)}\n if(!identical(candidate('His12FILE94.exe'), 'No')){quit('no', 1)}\n if(!identical(candidate('_Y.txt'), 'No')){quit('no', 1)}\n if(!identical(candidate('?aREYA.exe'), 'No')){quit('no', 1)}\n if(!identical(candidate('/this_is_valid.dll'), 'No')){quit('no', 1)}\n if(!identical(candidate('this_is_valid.wow'), 'No')){quit('no', 1)}\n if(!identical(candidate('this_is_valid.txt'), 'Yes')){quit('no', 1)}\n if(!identical(candidate('this_is_valid.txtexe'), 'No')){quit('no', 1)}\n if(!identical(candidate('#this2_i4s_5valid.ten'), 'No')){quit('no', 1)}\n if(!identical(candidate('@this1_is6_valid.exe'), 'No')){quit('no', 1)}\n if(!identical(candidate('this_is_12valid.6exe4.txt'), 'No')){quit('no', 1)}\n if(!identical(candidate('all.exe.txt'), 'No')){quit('no', 1)}\n if(!identical(candidate('I563_No.exe'), 'Yes')){quit('no', 1)}\n if(!identical(candidate('Is3youfault.txt'), 'Yes')){quit('no', 1)}\n if(!identical(candidate('no_one#knows.dll'), 'Yes')){quit('no', 1)}\n if(!identical(candidate('1I563_Yes3.exe'), 'No')){quit('no', 1)}\n if(!identical(candidate('I563_Yes3.txtt'), 'No')){quit('no', 1)}\n if(!identical(candidate('final..txt'), 'No')){quit('no', 1)}\n if(!identical(candidate('final132'), 'No')){quit('no', 1)}\n if(!identical(candidate('_f4indsartal132.'), 'No')){quit('no', 1)}\n if(!identical(candidate('.txt'), 'No')){quit('no', 1)}\n if(!identical(candidate('s.'), 'No')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "r", - "prompt": "# You are given two intervals,\n# where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n# The given intervals are closed which means that the interval (start, end)\n# includes both start and end.\n# For each given interval, it is assumed that its start is less or equal its end.\n# Your task is to determine whether the length of intersection of these two \n# intervals is a prime number.\n# Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n# which its length is 1, which not a prime number.\n# If the length of the intersection is a prime number, return \"YES\",\n# otherwise, return \"NO\".\n# If the two intervals don't intersect, return \"NO\".\n# [input/output] samples:\n# >>> intersection(list(1, 2), list(2, 3))\n# 'NO'\n# >>> intersection(list(-1, 1), list(0, 4))\n# 'NO'\n# >>> intersection(list(-3, -1), list(-5, 5))\n# 'YES'\nintersection <- function(interval1, interval2) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- intersection\n if(!identical(candidate(list(1, 2), list(2, 3)), 'NO')){quit('no', 1)}\n if(!identical(candidate(list(-1, 1), list(0, 4)), 'NO')){quit('no', 1)}\n if(!identical(candidate(list(-3, -1), list(-5, 5)), 'YES')){quit('no', 1)}\n if(!identical(candidate(list(-2, 2), list(-4, 0)), 'YES')){quit('no', 1)}\n if(!identical(candidate(list(-11, 2), list(-1, -1)), 'NO')){quit('no', 1)}\n if(!identical(candidate(list(1, 2), list(3, 5)), 'NO')){quit('no', 1)}\n if(!identical(candidate(list(1, 2), list(1, 2)), 'NO')){quit('no', 1)}\n if(!identical(candidate(list(-2, -2), list(-3, -2)), 'NO')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "r", - "prompt": "# Return the largest prime factor of n. Assume n > 1 and is not a prime.\n# >>> largest_prime_factor(13195)\n# 29\n# >>> largest_prime_factor(2048)\n# 2\nlargest_prime_factor <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- largest_prime_factor\n if(!identical(candidate(15), 5)){quit('no', 1)}\n if(!identical(candidate(27), 3)){quit('no', 1)}\n if(!identical(candidate(63), 7)){quit('no', 1)}\n if(!identical(candidate(330), 11)){quit('no', 1)}\n if(!identical(candidate(13195), 29)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "r", - "prompt": "# Given a string, find out how many distinct characters (regardless of case) does it consist of\n# >>> count_distinct_characters('xyzXYZ')\n# 3\n# >>> count_distinct_characters('Jerry')\n# 4\ncount_distinct_characters <- function(string) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- count_distinct_characters\n if(!identical(candidate(''), 0)){quit('no', 1)}\n if(!identical(candidate('abcde'), 5)){quit('no', 1)}\n if(!identical(candidate('abcdecadeCADE'), 5)){quit('no', 1)}\n if(!identical(candidate('aaaaAAAAaaaa'), 1)){quit('no', 1)}\n if(!identical(candidate('Jerry jERRY JeRRRY'), 5)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "r", - "prompt": "# You're given a list of deposit and withdrawal operations on a bank account that starts with\n# zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n# at that point function should return TRUE. Otherwise it should return FALSE.\n# >>> below_zero(c(1, 2, 3))\n# FALSE\n# >>> below_zero(c(1, 2, -4, 5))\n# TRUE\nbelow_zero <- function(operations) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- below_zero\n if(!identical(candidate(c()), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, -3, 1, 2, -3)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, -4, 5, 6)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, -1, 2, -2, 5, -5, 4, -4)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, -1, 2, -2, 5, -5, 4, -5)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, -2, 2, -2, 5, -5, 4, -4)), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "r", - "prompt": "# Find the shortest palindrome that begins with a supplied string.\n# Algorithm idea is simple:\n# - Find the longest postfix of supplied string that is a palindrome.\n# - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n# >>> make_palindrome('')\n# ''\n# >>> make_palindrome('cat')\n# 'catac'\n# >>> make_palindrome('cata')\n# 'catac'\nmake_palindrome <- function(string) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- make_palindrome\n if(!identical(candidate(''), '')){quit('no', 1)}\n if(!identical(candidate('x'), 'x')){quit('no', 1)}\n if(!identical(candidate('xyz'), 'xyzyx')){quit('no', 1)}\n if(!identical(candidate('xyx'), 'xyx')){quit('no', 1)}\n if(!identical(candidate('jerry'), 'jerryrrej')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "r", - "prompt": "# Given a positive integer, obtain its roman numeral equivalent as a string,\n# and return it in lowercase.\n# Restrictions: 1 <= num <= 1000\n# Examples:\n# >>> int_to_mini_roman(19)\n# 'xix'\n# >>> int_to_mini_roman(152)\n# 'clii'\n# >>> int_to_mini_roman(426)\n# 'cdxxvi'\nint_to_mini_roman <- function(number) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "reworded", - "tests": "test_humaneval <- function() {\ncandidate <- int_to_mini_roman\n if(!identical(candidate(19), 'xix')){quit('no', 1)}\n if(!identical(candidate(152), 'clii')){quit('no', 1)}\n if(!identical(candidate(251), 'ccli')){quit('no', 1)}\n if(!identical(candidate(426), 'cdxxvi')){quit('no', 1)}\n if(!identical(candidate(500), 'd')){quit('no', 1)}\n if(!identical(candidate(1), 'i')){quit('no', 1)}\n if(!identical(candidate(4), 'iv')){quit('no', 1)}\n if(!identical(candidate(43), 'xliii')){quit('no', 1)}\n if(!identical(candidate(90), 'xc')){quit('no', 1)}\n if(!identical(candidate(94), 'xciv')){quit('no', 1)}\n if(!identical(candidate(532), 'dxxxii')){quit('no', 1)}\n if(!identical(candidate(900), 'cm')){quit('no', 1)}\n if(!identical(candidate(994), 'cmxciv')){quit('no', 1)}\n if(!identical(candidate(1000), 'm')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - } -] \ No newline at end of file diff --git a/data/r-transform.json b/data/r-transform.json deleted file mode 100644 index abfb4e4eb2789c8443d2ec94cfb2d584bcafa5d8..0000000000000000000000000000000000000000 --- a/data/r-transform.json +++ /dev/null @@ -1,2095 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "r", - "prompt": "# For a given number n, find the largest number that divides n evenly, smaller than n\n# >>> largest_divisor(15)\n# 5\nlargest_divisor <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- largest_divisor\n if(!identical(candidate(3), 1)){quit('no', 1)}\n if(!identical(candidate(7), 1)){quit('no', 1)}\n if(!identical(candidate(10), 5)){quit('no', 1)}\n if(!identical(candidate(100), 50)){quit('no', 1)}\n if(!identical(candidate(49), 7)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_47_median", - "language": "r", - "prompt": "# Return median of elements in the list l.\n# >>> median(c(3, 1, 2, 4, 5))\n# 3\n# >>> median(c(-10, 4, 6, 1000, 10, 20))\n# 15.0\nmedian <- function(l) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- median\n if(!identical(candidate(c(3, 1, 2, 4, 5)), 3)){quit('no', 1)}\n if(!identical(candidate(c(-10, 4, 6, 1000, 10, 20)), 8.0)){quit('no', 1)}\n if(!identical(candidate(c(5)), 5)){quit('no', 1)}\n if(!identical(candidate(c(6, 5)), 5.5)){quit('no', 1)}\n if(!identical(candidate(c(8, 1, 3, 9, 9, 2, 7)), 7)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "r", - "prompt": "# Given two lists operator, and operand. The first list has basic algebra operations, and \n# the second list is a list of integers. Use the two given lists to build the algebric \n# expression and return the evaluation of this expression.\n# The basic algebra operations:\n# Addition ( + ) \n# Subtraction ( - ) \n# Multiplication ( * ) \n# Floor division ( // ) \n# Exponentiation ( ** ) \n# Example:\n# operator['+', '*', '-']\n# array = [2, 3, 4, 5]\n# result = 2 + 3 * 4 - 5\n# => result = 9\n# Note:\n# The length of operator list is equal to the length of operand list minus one.\n# Operand is a list of of non-negative integers.\n# Operator list has at least one operator, and operand list has at least two operands.\ndo_algebra <- function(operator, operand) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- do_algebra\n if(!identical(candidate(c('**', '*', '+'), c(2, 3, 4, 5)), 37)){quit('no', 1)}\n if(!identical(candidate(c('+', '*', '-'), c(2, 3, 4, 5)), 9)){quit('no', 1)}\n if(!identical(candidate(c('//', '*'), c(7, 3, 4)), 8)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "r", - "prompt": "# Return maximum element in the list.\n# >>> max_element(c(1, 2, 3))\n# 3\n# >>> max_element(c(5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10))\n# 123\nmax_element <- function(l) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- max_element\n if(!identical(candidate(c(1, 2, 3)), 3)){quit('no', 1)}\n if(!identical(candidate(c(5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10)), 124)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "r", - "prompt": "# Create a function which returns the largest index of an element which\n# is not greater than or equal to the element immediately preceding it. If\n# no such element exists then return -1. The given array will not contain\n# duplicate values.\n# Examples:\n# >>> can_arrange(c(1, 2, 4, 3, 5))\n# 3\n# >>> can_arrange(c(1, 2, 3))\n# -1\ncan_arrange <- function(arr) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- can_arrange\n if(!identical(candidate(c(1, 2, 4, 3, 5)), 3)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 4, 5)), -1)){quit('no', 1)}\n if(!identical(candidate(c(1, 4, 2, 5, 6, 7, 8, 9, 10)), 2)){quit('no', 1)}\n if(!identical(candidate(c(4, 8, 5, 7, 3)), 4)){quit('no', 1)}\n if(!identical(candidate(c()), -1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "r", - "prompt": "# Imagine a road that's a perfectly straight infinitely long line.\n# n cars are driving left to right; simultaneously, a different set of n cars\n# are driving right to left. The two sets of cars start out being very far from\n# each other. All cars move in the same speed. Two cars are said to collide\n# when a car that's moving left to right hits a car that's moving right to left.\n# However, the cars are infinitely sturdy and strong; as a result, they continue moving\n# in their trajectory as if they did not collide.\n# This function outputs the number of such collisions.\ncar_race_collision <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- car_race_collision\n if(!identical(candidate(2), 4)){quit('no', 1)}\n if(!identical(candidate(3), 9)){quit('no', 1)}\n if(!identical(candidate(4), 16)){quit('no', 1)}\n if(!identical(candidate(8), 64)){quit('no', 1)}\n if(!identical(candidate(10), 100)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "r", - "prompt": "# Create a function that returns True if the last character\n# of a given string is an alphabetical character and is not\n# a part of a word, and False otherwise.\n# Note: \"word\" is a group of characters separated by space.\n# Examples:\n# >>> check_if_last_char_is_a_letter('apple pie')\n# FALSE\n# >>> check_if_last_char_is_a_letter('apple pi e')\n# TRUE\n# >>> check_if_last_char_is_a_letter('apple pi e ')\n# FALSE\n# >>> check_if_last_char_is_a_letter('')\n# FALSE\ncheck_if_last_char_is_a_letter <- function(txt) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- check_if_last_char_is_a_letter\n if(!identical(candidate('apple'), FALSE)){quit('no', 1)}\n if(!identical(candidate('apple pi e'), TRUE)){quit('no', 1)}\n if(!identical(candidate('eeeee'), FALSE)){quit('no', 1)}\n if(!identical(candidate('A'), TRUE)){quit('no', 1)}\n if(!identical(candidate('Pumpkin pie '), FALSE)){quit('no', 1)}\n if(!identical(candidate('Pumpkin pie 1'), FALSE)){quit('no', 1)}\n if(!identical(candidate(''), FALSE)){quit('no', 1)}\n if(!identical(candidate('eeeee e '), FALSE)){quit('no', 1)}\n if(!identical(candidate('apple pie'), FALSE)){quit('no', 1)}\n if(!identical(candidate('apple pi e '), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "r", - "prompt": "# Return true if a given number is prime, and false otherwise.\n# >>> is_prime(6)\n# FALSE\n# >>> is_prime(101)\n# TRUE\n# >>> is_prime(11)\n# TRUE\n# >>> is_prime(13441)\n# TRUE\n# >>> is_prime(61)\n# TRUE\n# >>> is_prime(4)\n# FALSE\n# >>> is_prime(1)\n# FALSE\nis_prime <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- is_prime\n if(!identical(candidate(6), FALSE)){quit('no', 1)}\n if(!identical(candidate(101), TRUE)){quit('no', 1)}\n if(!identical(candidate(11), TRUE)){quit('no', 1)}\n if(!identical(candidate(13441), TRUE)){quit('no', 1)}\n if(!identical(candidate(61), TRUE)){quit('no', 1)}\n if(!identical(candidate(4), FALSE)){quit('no', 1)}\n if(!identical(candidate(1), FALSE)){quit('no', 1)}\n if(!identical(candidate(5), TRUE)){quit('no', 1)}\n if(!identical(candidate(11), TRUE)){quit('no', 1)}\n if(!identical(candidate(17), TRUE)){quit('no', 1)}\n if(!identical(candidate(85), FALSE)){quit('no', 1)}\n if(!identical(candidate(77), FALSE)){quit('no', 1)}\n if(!identical(candidate(255379), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "r", - "prompt": "# Given a list of positive integers x. return a sorted list of all \n# elements that hasn't any even digit.\n# Note: Returned list should be sorted in increasing order.\n# For example:\n# >>> unique_digits(c(15, 33, 1422, 1))\n# list(1, 15, 33)\n# >>> unique_digits(c(152, 323, 1422, 10))\n# list()\nunique_digits <- function(x) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- unique_digits\n if(!identical(candidate(c(15, 33, 1422, 1)), list(1, 15, 33))){quit('no', 1)}\n if(!identical(candidate(c(152, 323, 1422, 10)), list())){quit('no', 1)}\n if(!identical(candidate(c(12345, 2033, 111, 151)), list(111, 151))){quit('no', 1)}\n if(!identical(candidate(c(135, 103, 31)), list(31, 135))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "r", - "prompt": "# Input are two strings a and b consisting only of 1s and 0s.\n# Perform binary XOR on these inputs and return result also as a string.\n# >>> string_xor('010', '110')\n# '100'\nstring_xor <- function(a, b) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- string_xor\n if(!identical(candidate('111000', '101010'), '010010')){quit('no', 1)}\n if(!identical(candidate('1', '1'), '0')){quit('no', 1)}\n if(!identical(candidate('0101', '0000'), '0101')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "r", - "prompt": "# sum_to_n is a function that sums numbers from 1 to n.\n# >>> sum_to_n(30)\n# 465\n# >>> sum_to_n(100)\n# 5050\n# >>> sum_to_n(5)\n# 15\n# >>> sum_to_n(10)\n# 55\n# >>> sum_to_n(1)\n# 1\nsum_to_n <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- sum_to_n\n if(!identical(candidate(1), 1)){quit('no', 1)}\n if(!identical(candidate(6), 21)){quit('no', 1)}\n if(!identical(candidate(11), 66)){quit('no', 1)}\n if(!identical(candidate(30), 465)){quit('no', 1)}\n if(!identical(candidate(100), 5050)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "r", - "prompt": "# Given a list of numbers, return the sum of squares of the numbers\n# in the list that are odd. Ignore numbers that are negative or not integers.\n# >>> double_the_difference(c(1, 3, 2, 0))\n# 10\n# >>> double_the_difference(c(-1, -2, 0))\n# 0\n# >>> double_the_difference(c(9, -2))\n# 81\n# >>> double_the_difference(c(0))\n# 0\n# If the input list is empty, return 0.\ndouble_the_difference <- function(lst) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- double_the_difference\n if(!identical(candidate(c()), 0)){quit('no', 1)}\n if(!identical(candidate(c(5.0, 4.0)), 25)){quit('no', 1)}\n if(!identical(candidate(c(0.1, 0.2, 0.3)), 0)){quit('no', 1)}\n if(!identical(candidate(c(-10.0, -20.0, -30.0)), 0)){quit('no', 1)}\n if(!identical(candidate(c(-1.0, -2.0, 8.0)), 0)){quit('no', 1)}\n if(!identical(candidate(c(0.2, 3.0, 5.0)), 34)){quit('no', 1)}\n if(!identical(candidate(c(-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0)), 165)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "r", - "prompt": "# Return length of given string\n# >>> strlen('')\n# 0\n# >>> strlen('abc')\n# 3\nstrlen <- function(string) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- strlen\n if(!identical(candidate(''), 0)){quit('no', 1)}\n if(!identical(candidate('x'), 1)){quit('no', 1)}\n if(!identical(candidate('asdasnakj'), 9)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "r", - "prompt": "# You'll be given a string of words, and your task is to count the number\n# of boredoms. A boredom is a sentence that starts with the word \"I\".\n# Sentences are delimited by '.', '?' or '!'.\n# For example:\n# >>> is_bored('Hello world')\n# 0\n# >>> is_bored('The sky is blue. The sun is shining. I love this weather')\n# 1\nis_bored <- function(S) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- is_bored\n if(!identical(candidate('Hello world'), 0)){quit('no', 1)}\n if(!identical(candidate('Is the sky blue?'), 0)){quit('no', 1)}\n if(!identical(candidate('I love It !'), 1)){quit('no', 1)}\n if(!identical(candidate('bIt'), 0)){quit('no', 1)}\n if(!identical(candidate('I feel good today. I will be productive. will kill It'), 2)){quit('no', 1)}\n if(!identical(candidate('You and I are going for a walk'), 0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "r", - "prompt": "# Write a function vowels_count which takes a string representing\n# a word as input and returns the number of vowels in the string.\n# Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n# vowel, but only when it is at the end of the given word.\n# Example:\n# >>> vowels_count('abcde')\n# 2\n# >>> vowels_count('ACEDY')\n# 3\nvowels_count <- function(s) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- vowels_count\n if(!identical(candidate('abcde'), 2)){quit('no', 1)}\n if(!identical(candidate('Alone'), 3)){quit('no', 1)}\n if(!identical(candidate('key'), 2)){quit('no', 1)}\n if(!identical(candidate('bye'), 1)){quit('no', 1)}\n if(!identical(candidate('keY'), 2)){quit('no', 1)}\n if(!identical(candidate('bYe'), 1)){quit('no', 1)}\n if(!identical(candidate('ACEDY'), 3)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "r", - "prompt": "# Return n-th Fibonacci number.\n# >>> fib(10)\n# 55\n# >>> fib(1)\n# 1\n# >>> fib(8)\n# 21\nfib <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- fib\n if(!identical(candidate(10), 55)){quit('no', 1)}\n if(!identical(candidate(1), 1)){quit('no', 1)}\n if(!identical(candidate(8), 21)){quit('no', 1)}\n if(!identical(candidate(11), 89)){quit('no', 1)}\n if(!identical(candidate(12), 144)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "r", - "prompt": "# Your task is to implement a function that will simplify the expression\n# x * n. The function returns True if x * n evaluates to a whole number and False\n# otherwise. Both x and n, are string representation of a fraction, and have the following format,\n# / where both numerator and denominator are positive whole numbers.\n# You can assume that x, and n are valid fractions, and do not have zero as denominator.\n# >>> simplify('1/5', '5/1')\n# TRUE\n# >>> simplify('1/6', '2/1')\n# FALSE\n# >>> simplify('7/10', '10/2')\n# FALSE\nsimplify <- function(x, n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- simplify\n if(!identical(candidate('1/5', '5/1'), TRUE)){quit('no', 1)}\n if(!identical(candidate('1/6', '2/1'), FALSE)){quit('no', 1)}\n if(!identical(candidate('5/1', '3/1'), TRUE)){quit('no', 1)}\n if(!identical(candidate('7/10', '10/2'), FALSE)){quit('no', 1)}\n if(!identical(candidate('2/10', '50/10'), TRUE)){quit('no', 1)}\n if(!identical(candidate('7/2', '4/2'), TRUE)){quit('no', 1)}\n if(!identical(candidate('11/6', '6/1'), TRUE)){quit('no', 1)}\n if(!identical(candidate('2/3', '5/2'), FALSE)){quit('no', 1)}\n if(!identical(candidate('5/2', '3/5'), FALSE)){quit('no', 1)}\n if(!identical(candidate('2/4', '8/4'), TRUE)){quit('no', 1)}\n if(!identical(candidate('2/4', '4/2'), TRUE)){quit('no', 1)}\n if(!identical(candidate('1/5', '5/1'), TRUE)){quit('no', 1)}\n if(!identical(candidate('1/5', '1/5'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "r", - "prompt": "# Given a string s, count the number of uppercase vowels in even indices.\n# For example:\n# >>> count_upper('aBCdEf')\n# 1\n# >>> count_upper('abcdefg')\n# 0\n# >>> count_upper('dBBE')\n# 0\ncount_upper <- function(s) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- count_upper\n if(!identical(candidate('aBCdEf'), 1)){quit('no', 1)}\n if(!identical(candidate('abcdefg'), 0)){quit('no', 1)}\n if(!identical(candidate('dBBE'), 0)){quit('no', 1)}\n if(!identical(candidate('B'), 0)){quit('no', 1)}\n if(!identical(candidate('U'), 1)){quit('no', 1)}\n if(!identical(candidate(''), 0)){quit('no', 1)}\n if(!identical(candidate('EEEE'), 2)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "r", - "prompt": "# You are given a rectangular grid of wells. Each row represents a single well,\n# and each 1 in a row represents a single unit of water.\n# Each well has a corresponding bucket that can be used to extract water from it, \n# and all buckets have the same capacity.\n# Your task is to use the buckets to empty the wells.\n# Output the number of times you need to lower the buckets.\n# Example 1:\n# >>> max_fill(list(list(0, 0, 1, 0), list(0, 1, 0, 0), list(1, 1, 1, 1)), 1)\n# 6\n# Example 2:\n# >>> max_fill(list(list(0, 0, 1, 1), list(0, 0, 0, 0), list(1, 1, 1, 1), list(0, 1, 1, 1)), 2)\n# 5\n# Example 3:\n# >>> max_fill(list(list(0, 0, 0), list(0, 0, 0)), 5)\n# 0\n# Constraints:\n# * all wells have the same length\n# * 1 <= grid.length <= 10^2\n# * 1 <= grid[:,1].length <= 10^2\n# * grid[i][j] -> 0 | 1\n# * 1 <= capacity <= 10\nmax_fill <- function(grid, capacity) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- max_fill\n if(!identical(candidate(list(list(0, 0, 1, 0), list(0, 1, 0, 0), list(1, 1, 1, 1)), 1), 6)){quit('no', 1)}\n if(!identical(candidate(list(list(0, 0, 1, 1), list(0, 0, 0, 0), list(1, 1, 1, 1), list(0, 1, 1, 1)), 2), 5)){quit('no', 1)}\n if(!identical(candidate(list(list(0, 0, 0), list(0, 0, 0)), 5), 0)){quit('no', 1)}\n if(!identical(candidate(list(list(1, 1, 1, 1), list(1, 1, 1, 1)), 2), 4)){quit('no', 1)}\n if(!identical(candidate(list(list(1, 1, 1, 1), list(1, 1, 1, 1)), 9), 2)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "r", - "prompt": "# Given an array arr of integers and a positive integer k, return a sorted list \n# of length k with the maximum k numbers in arr.\n# Example 1:\n# >>> maximum(c(-3, -4, 5), 3)\n# list(-4, -3, 5)\n# Example 2:\n# >>> maximum(c(4, -4, 4), 2)\n# list(4, 4)\n# Example 3:\n# >>> maximum(c(-3, 2, 1, 2, -1, -2, 1), 1)\n# list(2)\n# Note:\n# 1. The length of the array will be in the range of [1, 1000].\n# 2. The elements in the array will be in the range of [-1000, 1000].\n# 3. 0 <= k <= len(arr)\nmaximum <- function(arr, k) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- maximum\n if(!identical(candidate(c(-3, -4, 5), 3), list(-4, -3, 5))){quit('no', 1)}\n if(!identical(candidate(c(4, -4, 4), 2), list(4, 4))){quit('no', 1)}\n if(!identical(candidate(c(-3, 2, 1, 2, -1, -2, 1), 1), list(2))){quit('no', 1)}\n if(!identical(candidate(c(123, -123, 20, 0, 1, 2, -3), 3), list(2, 20, 123))){quit('no', 1)}\n if(!identical(candidate(c(-123, 20, 0, 1, 2, -3), 4), list(0, 1, 2, 20))){quit('no', 1)}\n if(!identical(candidate(c(5, 15, 0, 3, -13, -8, 0), 7), list(-13, -8, 0, 0, 3, 5, 15))){quit('no', 1)}\n if(!identical(candidate(c(-1, 0, 2, 5, 3, -10), 2), list(3, 5))){quit('no', 1)}\n if(!identical(candidate(c(1, 0, 5, -7), 1), list(5))){quit('no', 1)}\n if(!identical(candidate(c(4, -4), 2), list(-4, 4))){quit('no', 1)}\n if(!identical(candidate(c(-10, 10), 2), list(-10, 10))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, -23, 243, -400, 0), 0), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "r", - "prompt": "# Write a function that takes a message, and encodes in such a \n# way that it swaps case of all letters, replaces all vowels in \n# the message with the letter that appears 2 places ahead of that \n# vowel in the english alphabet. \n# Assume only letters. \n# Examples:\n# >>> encode('test')\n# 'TGST'\n# >>> encode('This is a message')\n# 'tHKS KS C MGSSCGG'\nencode <- function(message) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- encode\n if(!identical(candidate('TEST'), 'tgst')){quit('no', 1)}\n if(!identical(candidate('Mudasir'), 'mWDCSKR')){quit('no', 1)}\n if(!identical(candidate('YES'), 'ygs')){quit('no', 1)}\n if(!identical(candidate('This is a message'), 'tHKS KS C MGSSCGG')){quit('no', 1)}\n if(!identical(candidate('I DoNt KnOw WhAt tO WrItE'), 'k dQnT kNqW wHcT Tq wRkTg')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "r", - "prompt": "# remove_vowels is a function that takes string and returns string without vowels.\n# >>> remove_vowels('')\n# ''\n# >>> remove_vowels('abcdef')\n# 'bcdf'\n# >>> remove_vowels('aaaaa')\n# ''\n# >>> remove_vowels('aaBAA')\n# 'B'\n# >>> remove_vowels('zbcd')\n# 'zbcd'\nremove_vowels <- function(text) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- remove_vowels\n if(!identical(candidate(''), '')){quit('no', 1)}\n if(!identical(candidate('abcdef\\nghijklm'), 'bcdf\\nghjklm')){quit('no', 1)}\n if(!identical(candidate('fedcba'), 'fdcb')){quit('no', 1)}\n if(!identical(candidate('eeeee'), '')){quit('no', 1)}\n if(!identical(candidate('acBAA'), 'cB')){quit('no', 1)}\n if(!identical(candidate('EcBOO'), 'cB')){quit('no', 1)}\n if(!identical(candidate('ybcd'), 'ybcd')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "r", - "prompt": "# Return only positive numbers in the list.\n# >>> get_positive(c(-1, 2, -4, 5, 6))\n# list(2, 5, 6)\n# >>> get_positive(c(5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10))\n# list(5, 3, 2, 3, 9, 123, 1)\nget_positive <- function(l) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- get_positive\n if(!identical(candidate(c(-1, -2, 4, 5, 6)), list(4, 5, 6))){quit('no', 1)}\n if(!identical(candidate(c(5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10)), list(5, 3, 2, 3, 3, 9, 123, 1))){quit('no', 1)}\n if(!identical(candidate(c(-1, -2)), list())){quit('no', 1)}\n if(!identical(candidate(c()), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "r", - "prompt": "# Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n# >>> string_sequence(0)\n# '0'\n# >>> string_sequence(5)\n# '0 1 2 3 4 5'\nstring_sequence <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- string_sequence\n if(!identical(candidate(0), '0')){quit('no', 1)}\n if(!identical(candidate(3), '0 1 2 3')){quit('no', 1)}\n if(!identical(candidate(10), '0 1 2 3 4 5 6 7 8 9 10')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "r", - "prompt": "# Given a positive integer n, you have to make a pile of n levels of stones.\n# The first level has n stones.\n# The number of stones in the next level is:\n# - the next odd number if n is odd.\n# - the next even number if n is even.\n# Return the number of stones in each level in a list, where element at index\n# i represents the number of stones in the level (i+1).\n# Examples:\n# >>> make_a_pile(3)\n# list(3, 5, 7)\nmake_a_pile <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- make_a_pile\n if(!identical(candidate(3), list(3, 5, 7))){quit('no', 1)}\n if(!identical(candidate(4), list(4, 6, 8, 10))){quit('no', 1)}\n if(!identical(candidate(5), list(5, 7, 9, 11, 13))){quit('no', 1)}\n if(!identical(candidate(6), list(6, 8, 10, 12, 14, 16))){quit('no', 1)}\n if(!identical(candidate(8), list(8, 10, 12, 14, 16, 18, 20, 22))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "r", - "prompt": "# Task\n# 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\n# then check if the result string is palindrome.\n# A string is called palindrome if it reads the same backward as forward.\n# You should return a tuple containing the result string and True/False for the check.\n# Example\n# >>> reverse_delete('abcde', 'ae')\n# list('bcd', FALSE)\n# >>> reverse_delete('abcdef', 'b')\n# list('acdef', FALSE)\n# >>> reverse_delete('abcdedcba', 'ab')\n# list('cdedc', TRUE)\nreverse_delete <- function(s, c) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- reverse_delete\n if(!identical(candidate('abcde', 'ae'), list('bcd', FALSE))){quit('no', 1)}\n if(!identical(candidate('abcdef', 'b'), list('acdef', FALSE))){quit('no', 1)}\n if(!identical(candidate('abcdedcba', 'ab'), list('cdedc', TRUE))){quit('no', 1)}\n if(!identical(candidate('dwik', 'w'), list('dik', FALSE))){quit('no', 1)}\n if(!identical(candidate('a', 'a'), list('', TRUE))){quit('no', 1)}\n if(!identical(candidate('abcdedcba', ''), list('abcdedcba', TRUE))){quit('no', 1)}\n if(!identical(candidate('abcdedcba', 'v'), list('abcdedcba', TRUE))){quit('no', 1)}\n if(!identical(candidate('vabba', 'v'), list('abba', TRUE))){quit('no', 1)}\n if(!identical(candidate('mamma', 'mia'), list('', TRUE))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "r", - "prompt": "# For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n# >>> flip_case('Hello')\n# 'hELLO'\nflip_case <- function(string) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- flip_case\n if(!identical(candidate(''), '')){quit('no', 1)}\n if(!identical(candidate('Hello!'), 'hELLO!')){quit('no', 1)}\n if(!identical(candidate('These violent delights have violent ends'), 'tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "r", - "prompt": "# You are given a string s.\n# if s[i] is a letter, reverse its case from lower to upper or vise versa, \n# otherwise keep it as it is.\n# If the string contains no letters, reverse the string.\n# The function should return the resulted string.\n# Examples\n# >>> solve('1234')\n# '4321'\n# >>> solve('ab')\n# 'AB'\n# >>> solve('#a@C')\n# '#A@c'\nsolve <- function(s) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- solve\n if(!identical(candidate('AsDf'), 'aSdF')){quit('no', 1)}\n if(!identical(candidate('1234'), '4321')){quit('no', 1)}\n if(!identical(candidate('ab'), 'AB')){quit('no', 1)}\n if(!identical(candidate('#a@C'), '#A@c')){quit('no', 1)}\n if(!identical(candidate('#AsdfW^45'), '#aSDFw^45')){quit('no', 1)}\n if(!identical(candidate('#6@2'), '2@6#')){quit('no', 1)}\n if(!identical(candidate('#$a^D'), '#$A^d')){quit('no', 1)}\n if(!identical(candidate('#ccc'), '#CCC')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "r", - "prompt": "# Filter an input list of strings only for ones that start with a given prefix.\n# >>> filter_by_prefix(c(), 'a')\n# list()\n# >>> filter_by_prefix(c('abc', 'bcd', 'cde', 'array'), 'a')\n# list('abc', 'array')\nfilter_by_prefix <- function(strings, prefix) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- filter_by_prefix\n if(!identical(candidate(c(), 'john'), list())){quit('no', 1)}\n if(!identical(candidate(c('xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'), 'xxx'), list('xxx', 'xxxAAA', 'xxx'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "r", - "prompt": "# This function takes two positive numbers x and y and returns the\n# biggest even integer number that is in the range [x, y] inclusive. If \n# there's no such number, then the function should return -1.\n# For example:\n# >>> choose_num(12, 15)\n# 14\n# >>> choose_num(13, 12)\n# -1\nchoose_num <- function(x, y) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- choose_num\n if(!identical(candidate(12, 15), 14)){quit('no', 1)}\n if(!identical(candidate(13, 12), -1)){quit('no', 1)}\n if(!identical(candidate(33, 12354), 12354)){quit('no', 1)}\n if(!identical(candidate(5234, 5233), -1)){quit('no', 1)}\n if(!identical(candidate(6, 29), 28)){quit('no', 1)}\n if(!identical(candidate(27, 10), -1)){quit('no', 1)}\n if(!identical(candidate(7, 7), -1)){quit('no', 1)}\n if(!identical(candidate(546, 546), 546)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "r", - "prompt": "# You are given a string representing a sentence,\n# the sentence contains some words separated by a space,\n# and you have to return a string that contains the words from the original sentence,\n# whose lengths are prime numbers,\n# the order of the words in the new string should be the same as the original one.\n# Example 1:\n# >>> words_in_sentence('This is a test')\n# 'is'\n# Example 2:\n# >>> words_in_sentence('lets go for swimming')\n# 'go for'\n# Constraints:\n# * 1 <= len(sentence) <= 100\n# * sentence contains only letters\nwords_in_sentence <- function(sentence) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- words_in_sentence\n if(!identical(candidate('This is a test'), 'is')){quit('no', 1)}\n if(!identical(candidate('lets go for swimming'), 'go for')){quit('no', 1)}\n if(!identical(candidate('there is no place available here'), 'there is no place')){quit('no', 1)}\n if(!identical(candidate('Hi I am Hussein'), 'Hi am Hussein')){quit('no', 1)}\n if(!identical(candidate('go for it'), 'go for it')){quit('no', 1)}\n if(!identical(candidate('here'), '')){quit('no', 1)}\n if(!identical(candidate('here is'), 'is')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "r", - "prompt": "# Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n# >>> intersperse(c(), 4)\n# list()\n# >>> intersperse(c(1, 2, 3), 4)\n# list(1, 4, 2, 4, 3)\nintersperse <- function(numbers, delimeter) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- intersperse\n if(!identical(candidate(c(), 7), list())){quit('no', 1)}\n if(!identical(candidate(c(5, 6, 3, 2), 8), list(5, 8, 6, 8, 3, 8, 2))){quit('no', 1)}\n if(!identical(candidate(c(2, 2, 2), 2), list(2, 2, 2, 2, 2))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "r", - "prompt": "# Your task is to write a function that returns true if a number x is a simple\n# power of n and false in other cases.\n# x is a simple power of n if n**int=x\n# For example:\n# >>> is_simple_power(1, 4)\n# TRUE\n# >>> is_simple_power(2, 2)\n# TRUE\n# >>> is_simple_power(8, 2)\n# TRUE\n# >>> is_simple_power(3, 2)\n# FALSE\n# >>> is_simple_power(3, 1)\n# FALSE\n# >>> is_simple_power(5, 3)\n# FALSE\nis_simple_power <- function(x, n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- is_simple_power\n if(!identical(candidate(16, 2), TRUE)){quit('no', 1)}\n if(!identical(candidate(143214, 16), FALSE)){quit('no', 1)}\n if(!identical(candidate(4, 2), TRUE)){quit('no', 1)}\n if(!identical(candidate(9, 3), TRUE)){quit('no', 1)}\n if(!identical(candidate(16, 4), TRUE)){quit('no', 1)}\n if(!identical(candidate(24, 2), FALSE)){quit('no', 1)}\n if(!identical(candidate(128, 4), FALSE)){quit('no', 1)}\n if(!identical(candidate(12, 6), FALSE)){quit('no', 1)}\n if(!identical(candidate(1, 1), TRUE)){quit('no', 1)}\n if(!identical(candidate(1, 12), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "r", - "prompt": "# Write a function that returns true if the given number is the multiplication of 3 prime numbers\n# and false otherwise.\n# Knowing that (a) is less then 100. \n# Example:\n# >>> is_multiply_prime(30)\n# TRUE\n# 30 = 2 * 3 * 5\nis_multiply_prime <- function(a) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- is_multiply_prime\n if(!identical(candidate(5), FALSE)){quit('no', 1)}\n if(!identical(candidate(30), TRUE)){quit('no', 1)}\n if(!identical(candidate(8), TRUE)){quit('no', 1)}\n if(!identical(candidate(10), FALSE)){quit('no', 1)}\n if(!identical(candidate(125), TRUE)){quit('no', 1)}\n if(!identical(candidate(105), TRUE)){quit('no', 1)}\n if(!identical(candidate(126), FALSE)){quit('no', 1)}\n if(!identical(candidate(729), FALSE)){quit('no', 1)}\n if(!identical(candidate(891), FALSE)){quit('no', 1)}\n if(!identical(candidate(1001), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "r", - "prompt": "# Given the lengths of the three sides of a triangle. Return True if the three\n# sides form a right-angled triangle, False otherwise.\n# A right-angled triangle is a triangle in which one angle is right angle or \n# 90 degree.\n# Example:\n# >>> right_angle_triangle(3, 4, 5)\n# TRUE\n# >>> right_angle_triangle(1, 2, 3)\n# FALSE\nright_angle_triangle <- function(a, b, c) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- right_angle_triangle\n if(!identical(candidate(3, 4, 5), TRUE)){quit('no', 1)}\n if(!identical(candidate(1, 2, 3), FALSE)){quit('no', 1)}\n if(!identical(candidate(10, 6, 8), TRUE)){quit('no', 1)}\n if(!identical(candidate(2, 2, 2), FALSE)){quit('no', 1)}\n if(!identical(candidate(7, 24, 25), TRUE)){quit('no', 1)}\n if(!identical(candidate(10, 5, 7), FALSE)){quit('no', 1)}\n if(!identical(candidate(5, 12, 13), TRUE)){quit('no', 1)}\n if(!identical(candidate(15, 8, 17), TRUE)){quit('no', 1)}\n if(!identical(candidate(48, 55, 73), TRUE)){quit('no', 1)}\n if(!identical(candidate(1, 1, 1), FALSE)){quit('no', 1)}\n if(!identical(candidate(2, 2, 10), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "r", - "prompt": "# Create a function that takes 3 numbers.\n# Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n# Returns false in any other cases.\n# Examples\n# >>> any_int(5, 2, 7)\n# TRUE\n# >>> any_int(3, 2, 2)\n# FALSE\n# >>> any_int(3, -2, 1)\n# TRUE\n# >>> any_int(3.6, -2.2, 2)\n# FALSE\nany_int <- function(x, y, z) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- any_int\n if(!identical(candidate(2, 3, 1), TRUE)){quit('no', 1)}\n if(!identical(candidate(2.5, 2, 3), FALSE)){quit('no', 1)}\n if(!identical(candidate(1.5, 5, 3.5), FALSE)){quit('no', 1)}\n if(!identical(candidate(2, 6, 2), FALSE)){quit('no', 1)}\n if(!identical(candidate(4, 2, 2), TRUE)){quit('no', 1)}\n if(!identical(candidate(2.2, 2.2, 2.2), FALSE)){quit('no', 1)}\n if(!identical(candidate(-4, 6, 2), TRUE)){quit('no', 1)}\n if(!identical(candidate(2, 1, 1), TRUE)){quit('no', 1)}\n if(!identical(candidate(3, 4, 7), TRUE)){quit('no', 1)}\n if(!identical(candidate(3.0, 4, 7), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "r", - "prompt": "# This function takes a list l and returns a list l' such that\n# l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n# to the values of the corresponding indicies of l, but sorted.\n# >>> sort_third(c(1, 2, 3))\n# list(1, 2, 3)\n# >>> sort_third(c(5, 6, 3, 4, 8, 9, 2))\n# list(2, 6, 3, 4, 8, 9, 5)\nsort_third <- function(l) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- sort_third\n if(!identical(candidate(c(5, 6, 3, 4, 8, 9, 2)), list(2, 6, 3, 4, 8, 9, 5))){quit('no', 1)}\n if(!identical(candidate(c(5, 8, 3, 4, 6, 9, 2)), list(2, 8, 3, 4, 6, 9, 5))){quit('no', 1)}\n if(!identical(candidate(c(5, 6, 9, 4, 8, 3, 2)), list(2, 6, 9, 4, 8, 3, 5))){quit('no', 1)}\n if(!identical(candidate(c(5, 6, 3, 4, 8, 9, 2, 1)), list(2, 6, 3, 4, 8, 9, 5, 1))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_53_add", - "language": "r", - "prompt": "# Add two numbers x and y\n# >>> add(2, 3)\n# 5\n# >>> add(5, 7)\n# 12\nadd <- function(x, y) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- add\n if(!identical(candidate(0, 1), 1)){quit('no', 1)}\n if(!identical(candidate(1, 0), 1)){quit('no', 1)}\n if(!identical(candidate(2, 3), 5)){quit('no', 1)}\n if(!identical(candidate(5, 7), 12)){quit('no', 1)}\n if(!identical(candidate(7, 5), 12)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_69_search", - "language": "r", - "prompt": "# You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n# zero, and has a frequency greater than or equal to the value of the integer itself. \n# The frequency of an integer is the number of times it appears in the list.\n# If no such a value exist, return -1.\n# Examples:\n# >>> search(c(4, 1, 2, 2, 3, 1))\n# 2\n# >>> search(c(1, 2, 2, 3, 3, 3, 4, 4, 4))\n# 3\n# >>> search(c(5, 5, 4, 4, 4))\n# -1\nsearch <- function(lst) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- search\n if(!identical(candidate(c(5, 5, 5, 5, 1)), 1)){quit('no', 1)}\n if(!identical(candidate(c(4, 1, 4, 1, 4, 4)), 4)){quit('no', 1)}\n if(!identical(candidate(c(3, 3)), -1)){quit('no', 1)}\n if(!identical(candidate(c(8, 8, 8, 8, 8, 8, 8, 8)), 8)){quit('no', 1)}\n if(!identical(candidate(c(2, 3, 3, 2, 2)), 2)){quit('no', 1)}\n if(!identical(candidate(c(2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1)), 1)){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 8, 2)), 2)){quit('no', 1)}\n if(!identical(candidate(c(6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10)), 1)){quit('no', 1)}\n if(!identical(candidate(c(8, 8, 3, 6, 5, 6, 4)), -1)){quit('no', 1)}\n if(!identical(candidate(c(6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9)), 1)){quit('no', 1)}\n if(!identical(candidate(c(1, 9, 10, 1, 3)), 1)){quit('no', 1)}\n if(!identical(candidate(c(6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10)), 5)){quit('no', 1)}\n if(!identical(candidate(c(1)), 1)){quit('no', 1)}\n if(!identical(candidate(c(8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5)), 4)){quit('no', 1)}\n if(!identical(candidate(c(2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10)), 2)){quit('no', 1)}\n if(!identical(candidate(c(1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3)), 1)){quit('no', 1)}\n if(!identical(candidate(c(9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4)), 4)){quit('no', 1)}\n if(!identical(candidate(c(2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7)), 4)){quit('no', 1)}\n if(!identical(candidate(c(9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1)), 2)){quit('no', 1)}\n if(!identical(candidate(c(5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8)), -1)){quit('no', 1)}\n if(!identical(candidate(c(10)), -1)){quit('no', 1)}\n if(!identical(candidate(c(9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2)), 2)){quit('no', 1)}\n if(!identical(candidate(c(5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8)), 1)){quit('no', 1)}\n if(!identical(candidate(c(7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6)), 1)){quit('no', 1)}\n if(!identical(candidate(c(3, 10, 10, 9, 2)), -1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "r", - "prompt": "# Write a function that takes a string and returns True if the string\n# length is a prime number or False otherwise\n# Examples\n# >>> prime_length('Hello')\n# TRUE\n# >>> prime_length('abcdcba')\n# TRUE\n# >>> prime_length('kittens')\n# TRUE\n# >>> prime_length('orange')\n# FALSE\nprime_length <- function(string) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- prime_length\n if(!identical(candidate('Hello'), TRUE)){quit('no', 1)}\n if(!identical(candidate('abcdcba'), TRUE)){quit('no', 1)}\n if(!identical(candidate('kittens'), TRUE)){quit('no', 1)}\n if(!identical(candidate('orange'), FALSE)){quit('no', 1)}\n if(!identical(candidate('wow'), TRUE)){quit('no', 1)}\n if(!identical(candidate('world'), TRUE)){quit('no', 1)}\n if(!identical(candidate('MadaM'), TRUE)){quit('no', 1)}\n if(!identical(candidate('Wow'), TRUE)){quit('no', 1)}\n if(!identical(candidate(''), FALSE)){quit('no', 1)}\n if(!identical(candidate('HI'), TRUE)){quit('no', 1)}\n if(!identical(candidate('go'), TRUE)){quit('no', 1)}\n if(!identical(candidate('gogo'), FALSE)){quit('no', 1)}\n if(!identical(candidate('aaaaaaaaaaaaaaa'), FALSE)){quit('no', 1)}\n if(!identical(candidate('Madam'), TRUE)){quit('no', 1)}\n if(!identical(candidate('M'), FALSE)){quit('no', 1)}\n if(!identical(candidate('0'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_58_common", - "language": "r", - "prompt": "# Return sorted unique common elements for two lists.\n# >>> common(c(1, 4, 3, 34, 653, 2, 5), c(5, 7, 1, 5, 9, 653, 121))\n# list(1, 5, 653)\n# >>> common(c(5, 3, 2, 8), c(3, 2))\n# list(2, 3)\ncommon <- function(l1, l2) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- common\n if(!identical(candidate(c(1, 4, 3, 34, 653, 2, 5), c(5, 7, 1, 5, 9, 653, 121)), list(1, 5, 653))){quit('no', 1)}\n if(!identical(candidate(c(5, 3, 2, 8), c(3, 2)), list(2, 3))){quit('no', 1)}\n if(!identical(candidate(c(4, 3, 2, 8), c(3, 2, 4)), list(2, 3, 4))){quit('no', 1)}\n if(!identical(candidate(c(4, 3, 2, 8), c()), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "r", - "prompt": "# The Brazilian factorial is defined as:\n# brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n# where n > 0\n# For example:\n# >>> special_factorial(4)\n# 288\n# The function will receive an integer as input and should return the special\n# factorial of this integer.\nspecial_factorial <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- special_factorial\n if(!identical(candidate(4), 288)){quit('no', 1)}\n if(!identical(candidate(5), 34560)){quit('no', 1)}\n if(!identical(candidate(7), 125411328000)){quit('no', 1)}\n if(!identical(candidate(1), 1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "r", - "prompt": "# In this problem, you will implement a function that takes two lists of numbers,\n# and determines whether it is possible to perform an exchange of elements\n# between them to make lst1 a list of only even numbers.\n# There is no limit on the number of exchanged elements between lst1 and lst2.\n# If it is possible to exchange elements between the lst1 and lst2 to make\n# all the elements of lst1 to be even, return \"YES\".\n# Otherwise, return \"NO\".\n# For example:\n# >>> exchange(c(1, 2, 3, 4), c(1, 2, 3, 4))\n# 'YES'\n# >>> exchange(c(1, 2, 3, 4), c(1, 5, 3, 4))\n# 'NO'\n# It is assumed that the input lists will be non-empty.\nexchange <- function(lst1, lst2) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- exchange\n if(!identical(candidate(c(1, 2, 3, 4), c(1, 2, 3, 4)), 'YES')){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4), c(1, 5, 3, 4)), 'NO')){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4), c(2, 1, 4, 3)), 'YES')){quit('no', 1)}\n if(!identical(candidate(c(5, 7, 3), c(2, 6, 4)), 'YES')){quit('no', 1)}\n if(!identical(candidate(c(5, 7, 3), c(2, 6, 3)), 'NO')){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 6, 1, 8, 9), c(3, 5, 5, 1, 1, 1)), 'NO')){quit('no', 1)}\n if(!identical(candidate(c(100, 200), c(200, 200)), 'YES')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "r", - "prompt": "# Given a non-empty array of integers arr and an integer k, return\n# the sum of the elements with at most two digits from the first k elements of arr.\n# Example:\n# >>> add_elements(c(111, 21, 3, 4000, 5, 6, 7, 8, 9), 4)\n# 24\n# Constraints:\n# 1. 1 <= len(arr) <= 100\n# 2. 1 <= k <= len(arr)\nadd_elements <- function(arr, k) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- add_elements\n if(!identical(candidate(c(1, -2, -3, 41, 57, 76, 87, 88, 99), 3), -4)){quit('no', 1)}\n if(!identical(candidate(c(111, 121, 3, 4000, 5, 6), 2), 0)){quit('no', 1)}\n if(!identical(candidate(c(11, 21, 3, 90, 5, 6, 7, 8, 9), 4), 125)){quit('no', 1)}\n if(!identical(candidate(c(111, 21, 3, 4000, 5, 6, 7, 8, 9), 4), 24)){quit('no', 1)}\n if(!identical(candidate(c(1), 1), 1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "r", - "prompt": "# A simple program which should return the value of x if n is \n# a prime number and should return the value of y otherwise.\n# Examples:\n# >>> x_or_y(7, 34, 12)\n# 34\n# >>> x_or_y(15, 8, 5)\n# 5\nx_or_y <- function(n, x, y) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- x_or_y\n if(!identical(candidate(7, 34, 12), 34)){quit('no', 1)}\n if(!identical(candidate(15, 8, 5), 5)){quit('no', 1)}\n if(!identical(candidate(3, 33, 5212), 33)){quit('no', 1)}\n if(!identical(candidate(1259, 3, 52), 3)){quit('no', 1)}\n if(!identical(candidate(7919, -1, 12), -1)){quit('no', 1)}\n if(!identical(candidate(3609, 1245, 583), 583)){quit('no', 1)}\n if(!identical(candidate(91, 56, 129), 129)){quit('no', 1)}\n if(!identical(candidate(6, 34, 1234), 1234)){quit('no', 1)}\n if(!identical(candidate(1, 2, 0), 0)){quit('no', 1)}\n if(!identical(candidate(2, 2, 0), 2)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "r", - "prompt": "# Given length of a side and high return area for a triangle.\n# >>> triangle_area(5, 3)\n# 7.5\ntriangle_area <- function(a, h) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- triangle_area\n if(!identical(candidate(5, 3), 7.5)){quit('no', 1)}\n if(!identical(candidate(2, 2), 2.0)){quit('no', 1)}\n if(!identical(candidate(10, 8), 40.0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "r", - "prompt": "# Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n# the last couple centuries. However, what people don't know is Tribonacci sequence.\n# Tribonacci sequence is defined by the recurrence:\n# tri(1) = 3\n# tri(n) = 1 + n / 2, if n is even.\n# tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n# For example:\n# tri(2) = 1 + (2 / 2) = 2\n# tri(4) = 3\n# tri(3) = tri(2) + tri(1) + tri(4)\n# = 2 + 3 + 3 = 8 \n# You are given a non-negative integer number n, you have to a return a list of the \n# first n + 1 numbers of the Tribonacci sequence.\n# Examples:\n# >>> tri(3)\n# list(1, 3, 2, 8)\ntri <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- tri\n if(!identical(candidate(3), list(1, 3, 2, 8))){quit('no', 1)}\n if(!identical(candidate(4), list(1, 3, 2, 8, 3))){quit('no', 1)}\n if(!identical(candidate(5), list(1, 3, 2, 8, 3, 15))){quit('no', 1)}\n if(!identical(candidate(6), list(1, 3, 2, 8, 3, 15, 4))){quit('no', 1)}\n if(!identical(candidate(7), list(1, 3, 2, 8, 3, 15, 4, 24))){quit('no', 1)}\n if(!identical(candidate(8), list(1, 3, 2, 8, 3, 15, 4, 24, 5))){quit('no', 1)}\n if(!identical(candidate(9), list(1, 3, 2, 8, 3, 15, 4, 24, 5, 35))){quit('no', 1)}\n if(!identical(candidate(20), list(1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11))){quit('no', 1)}\n if(!identical(candidate(0), list(1))){quit('no', 1)}\n if(!identical(candidate(1), list(1, 3))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "r", - "prompt": "# You are given a list of two strings, both strings consist of open\n# parentheses '(' or close parentheses ')' only.\n# Your job is to check if it is possible to concatenate the two strings in\n# some order, that the resulting string will be good.\n# A string S is considered to be good if and only if all parentheses in S\n# are balanced. For example: the string '(())()' is good, while the string\n# '())' is not.\n# Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n# Examples:\n# >>> match_parens(c('()(', ')'))\n# 'Yes'\n# >>> match_parens(c(')', ')'))\n# 'No'\nmatch_parens <- function(lst) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- match_parens\n if(!identical(candidate(c('()(', ')')), 'Yes')){quit('no', 1)}\n if(!identical(candidate(c(')', ')')), 'No')){quit('no', 1)}\n if(!identical(candidate(c('(()(())', '())())')), 'No')){quit('no', 1)}\n if(!identical(candidate(c(')())', '(()()(')), 'Yes')){quit('no', 1)}\n if(!identical(candidate(c('(())))', '(()())((')), 'Yes')){quit('no', 1)}\n if(!identical(candidate(c('()', '())')), 'No')){quit('no', 1)}\n if(!identical(candidate(c('(()(', '()))()')), 'Yes')){quit('no', 1)}\n if(!identical(candidate(c('((((', '((())')), 'No')){quit('no', 1)}\n if(!identical(candidate(c(')(()', '(()(')), 'No')){quit('no', 1)}\n if(!identical(candidate(c(')(', ')(')), 'No')){quit('no', 1)}\n if(!identical(candidate(c('(', ')')), 'Yes')){quit('no', 1)}\n if(!identical(candidate(c(')', '(')), 'Yes')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "r", - "prompt": "# From a list of integers, remove all elements that occur more than once.\n# Keep order of elements left the same as in the input.\n# >>> remove_duplicates(c(1, 2, 3, 2, 4))\n# list(1, 3, 4)\nremove_duplicates <- function(numbers) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- remove_duplicates\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4)), list(1, 2, 3, 4))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 2, 4, 3, 5)), list(1, 4, 5))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "r", - "prompt": "# Return a greatest common divisor of two integers a and b\n# >>> greatest_common_divisor(3, 5)\n# 1\n# >>> greatest_common_divisor(25, 15)\n# 5\ngreatest_common_divisor <- function(a, b) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- greatest_common_divisor\n if(!identical(candidate(3, 7), 1)){quit('no', 1)}\n if(!identical(candidate(10, 15), 5)){quit('no', 1)}\n if(!identical(candidate(49, 14), 7)){quit('no', 1)}\n if(!identical(candidate(144, 60), 12)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "r", - "prompt": "# Checks if given string is a palindrome\n# >>> is_palindrome('')\n# TRUE\n# >>> is_palindrome('aba')\n# TRUE\n# >>> is_palindrome('aaaaa')\n# TRUE\n# >>> is_palindrome('zbcd')\n# FALSE\nis_palindrome <- function(text) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- is_palindrome\n if(!identical(candidate(''), TRUE)){quit('no', 1)}\n if(!identical(candidate('aba'), TRUE)){quit('no', 1)}\n if(!identical(candidate('aaaaa'), TRUE)){quit('no', 1)}\n if(!identical(candidate('zbcd'), FALSE)){quit('no', 1)}\n if(!identical(candidate('xywyx'), TRUE)){quit('no', 1)}\n if(!identical(candidate('xywyz'), FALSE)){quit('no', 1)}\n if(!identical(candidate('xywzx'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "r", - "prompt": "# xs represent coefficients of a polynomial.\n# xs[0] + xs[1] * x + xs[2] * x^2 + ....\n# Return derivative of this polynomial in the same form.\n# >>> derivative(c(3, 1, 2, 4, 5))\n# list(1, 4, 12, 20)\n# >>> derivative(c(1, 2, 3))\n# list(2, 6)\nderivative <- function(xs) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- derivative\n if(!identical(candidate(c(3, 1, 2, 4, 5)), list(1, 4, 12, 20))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3)), list(2, 6))){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 1)), list(2, 2))){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 1, 0, 4)), list(2, 2, 0, 16))){quit('no', 1)}\n if(!identical(candidate(c(1)), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "r", - "prompt": "# In this task, you will be given a string that represents a number of apples and oranges \n# that are distributed in a basket of fruit this basket contains \n# apples, oranges, and mango fruits. Given the string that represents the total number of \n# the oranges and apples and an integer that represent the total number of the fruits \n# in the basket return the number of the mango fruits in the basket.\n# for examble:\n# >>> fruit_distribution('5 apples and 6 oranges', 19)\n# 8\n# >>> fruit_distribution('0 apples and 1 oranges', 3)\n# 2\n# >>> fruit_distribution('2 apples and 3 oranges', 100)\n# 95\n# >>> fruit_distribution('100 apples and 1 oranges', 120)\n# 19\nfruit_distribution <- function(s, n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- fruit_distribution\n if(!identical(candidate('5 apples and 6 oranges', 19), 8)){quit('no', 1)}\n if(!identical(candidate('5 apples and 6 oranges', 21), 10)){quit('no', 1)}\n if(!identical(candidate('0 apples and 1 oranges', 3), 2)){quit('no', 1)}\n if(!identical(candidate('1 apples and 0 oranges', 3), 2)){quit('no', 1)}\n if(!identical(candidate('2 apples and 3 oranges', 100), 95)){quit('no', 1)}\n if(!identical(candidate('2 apples and 3 oranges', 5), 0)){quit('no', 1)}\n if(!identical(candidate('1 apples and 100 oranges', 120), 19)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "r", - "prompt": "# Write a function that takes an integer a and returns True \n# if this ingeger is a cube of some integer number.\n# Note: you may assume the input is always valid.\n# Examples:\n# >>> iscube(1)\n# TRUE\n# >>> iscube(2)\n# FALSE\n# >>> iscube(-1)\n# TRUE\n# >>> iscube(64)\n# TRUE\n# >>> iscube(0)\n# TRUE\n# >>> iscube(180)\n# FALSE\niscube <- function(a) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- iscube\n if(!identical(candidate(1), TRUE)){quit('no', 1)}\n if(!identical(candidate(2), FALSE)){quit('no', 1)}\n if(!identical(candidate(-1), TRUE)){quit('no', 1)}\n if(!identical(candidate(64), TRUE)){quit('no', 1)}\n if(!identical(candidate(180), FALSE)){quit('no', 1)}\n if(!identical(candidate(1000), TRUE)){quit('no', 1)}\n if(!identical(candidate(0), TRUE)){quit('no', 1)}\n if(!identical(candidate(1729), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "r", - "prompt": "# In this Kata, you have to sort an array of non-negative integers according to\n# number of ones in their binary representation in ascending order.\n# For similar number of ones, sort based on decimal value.\n# It must be implemented like this:\n# >>> sort_array(c(1, 5, 2, 3, 4))\n# list(1, 2, 3, 4, 5)\n# >>> sort_array(c(-2, -3, -4, -5, -6))\n# list(-6, -5, -4, -3, -2)\n# >>> sort_array(c(1, 0, 2, 3, 4))\n# list(0, 1, 2, 3, 4)\nsort_array <- function(arr) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- sort_array\n if(!identical(candidate(c(1, 5, 2, 3, 4)), list(1, 2, 4, 3, 5))){quit('no', 1)}\n if(!identical(candidate(c(-2, -3, -4, -5, -6)), list(-4, -2, -6, -5, -3))){quit('no', 1)}\n if(!identical(candidate(c(1, 0, 2, 3, 4)), list(0, 1, 2, 4, 3))){quit('no', 1)}\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4)), list(2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77))){quit('no', 1)}\n if(!identical(candidate(c(3, 6, 44, 12, 32, 5)), list(32, 3, 5, 6, 12, 44))){quit('no', 1)}\n if(!identical(candidate(c(2, 4, 8, 16, 32)), list(2, 4, 8, 16, 32))){quit('no', 1)}\n if(!identical(candidate(c(2, 4, 8, 16, 32)), list(2, 4, 8, 16, 32))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "r", - "prompt": "# Given a list of strings, where each string consists of only digits, return a list.\n# Each element i of the output should be \"the number of odd elements in the\n# string i of the input.\" where all the i's should be replaced by the number\n# of odd digits in the i'th string of the input.\n# >>> odd_count(c('1234567'))\n# list('the number of odd elements 4n the str4ng 4 of the 4nput.')\n# >>> odd_count(c('3', '11111111'))\n# list('the number of odd elements 1n the str1ng 1 of the 1nput.', 'the number of odd elements 8n the str8ng 8 of the 8nput.')\nodd_count <- function(lst) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- odd_count\n if(!identical(candidate(c('1234567')), list('the number of odd elements 4n the str4ng 4 of the 4nput.'))){quit('no', 1)}\n if(!identical(candidate(c('3', '11111111')), list('the number of odd elements 1n the str1ng 1 of the 1nput.', 'the number of odd elements 8n the str8ng 8 of the 8nput.'))){quit('no', 1)}\n if(!identical(candidate(c('271', '137', '314')), list('the number of odd elements 2n the str2ng 2 of the 2nput.', 'the number of odd elements 3n the str3ng 3 of the 3nput.', 'the number of odd elements 2n the str2ng 2 of the 2nput.'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "r", - "prompt": "# brackets is a string of \"(\" and \")\".\n# return True if every opening bracket has a corresponding closing bracket.\n# >>> correct_bracketing('(')\n# FALSE\n# >>> correct_bracketing('()')\n# TRUE\n# >>> correct_bracketing('(()())')\n# TRUE\n# >>> correct_bracketing(')(()')\n# FALSE\ncorrect_bracketing <- function(brackets) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- correct_bracketing\n if(!identical(candidate('()'), TRUE)){quit('no', 1)}\n if(!identical(candidate('(()())'), TRUE)){quit('no', 1)}\n if(!identical(candidate('()()(()())()'), TRUE)){quit('no', 1)}\n if(!identical(candidate('()()((()()())())(()()(()))'), TRUE)){quit('no', 1)}\n if(!identical(candidate('((()())))'), FALSE)){quit('no', 1)}\n if(!identical(candidate(')(()'), FALSE)){quit('no', 1)}\n if(!identical(candidate('('), FALSE)){quit('no', 1)}\n if(!identical(candidate('(((('), FALSE)){quit('no', 1)}\n if(!identical(candidate(')'), FALSE)){quit('no', 1)}\n if(!identical(candidate('(()'), FALSE)){quit('no', 1)}\n if(!identical(candidate('()()(()())())(()'), FALSE)){quit('no', 1)}\n if(!identical(candidate('()()(()())()))()'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "r", - "prompt": "# Task\n# Write a function that takes a string as input and returns the sum of the upper characters only'\n# ASCII codes.\n# Examples:\n# >>> digitSum('')\n# 0\n# >>> digitSum('abAB')\n# 131\n# >>> digitSum('abcCd')\n# 67\n# >>> digitSum('helloE')\n# 69\n# >>> digitSum('woArBld')\n# 131\n# >>> digitSum('aAaaaXa')\n# 153\ndigitSum <- function(s) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- digitSum\n if(!identical(candidate(''), 0)){quit('no', 1)}\n if(!identical(candidate('abAB'), 131)){quit('no', 1)}\n if(!identical(candidate('abcCd'), 67)){quit('no', 1)}\n if(!identical(candidate('helloE'), 69)){quit('no', 1)}\n if(!identical(candidate('woArBld'), 131)){quit('no', 1)}\n if(!identical(candidate('aAaaaXa'), 153)){quit('no', 1)}\n if(!identical(candidate(' How are yOu?'), 151)){quit('no', 1)}\n if(!identical(candidate('You arE Very Smart'), 327)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "r", - "prompt": "# Write a function that accepts a list of strings as a parameter,\n# deletes the strings that have odd lengths from it,\n# and returns the resulted list with a sorted order,\n# The list is always a list of strings and never an array of numbers,\n# and it may contain duplicates.\n# The order of the list should be ascending by length of each word, and you\n# should return the list sorted by that rule.\n# If two words have the same length, sort the list alphabetically.\n# The function should return a list of strings in sorted order.\n# You may assume that all words will have the same length.\n# For example:\n# >>> list_sort(c('aa', 'a', 'aaa'))\n# list('aa')\n# >>> list_sort(c('ab', 'a', 'aaa', 'cd'))\n# list('ab', 'cd')\nsorted_list_sum <- function(lst) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- sorted_list_sum\n if(!identical(candidate(c('aa', 'a', 'aaa')), list('aa'))){quit('no', 1)}\n if(!identical(candidate(c('school', 'AI', 'asdf', 'b')), list('AI', 'asdf', 'school'))){quit('no', 1)}\n if(!identical(candidate(c('d', 'b', 'c', 'a')), list())){quit('no', 1)}\n if(!identical(candidate(c('d', 'dcba', 'abcd', 'a')), list('abcd', 'dcba'))){quit('no', 1)}\n if(!identical(candidate(c('AI', 'ai', 'au')), list('AI', 'ai', 'au'))){quit('no', 1)}\n if(!identical(candidate(c('a', 'b', 'b', 'c', 'c', 'a')), list())){quit('no', 1)}\n if(!identical(candidate(c('aaaa', 'bbbb', 'dd', 'cc')), list('cc', 'dd', 'aaaa', 'bbbb'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "r", - "prompt": "# You are given an array arr of integers and you need to return\n# sum of magnitudes of integers multiplied by product of all signs\n# of each number in the array, represented by 1, -1 or 0.\n# Note: return None for empty arr.\n# Example:\n# >>> prod_signs(c(1, 2, 2, -4))\n# 9\n# >>> prod_signs(c(0, 1))\n# 0\n# >>> prod_signs(c())\n# NULL\nprod_signs <- function(arr) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- prod_signs\n if(!identical(candidate(c(1, 2, 2, -4)), -9)){quit('no', 1)}\n if(!identical(candidate(c(0, 1)), 0)){quit('no', 1)}\n if(!identical(candidate(c(1, 1, 1, 2, 3, -1, 1)), -10)){quit('no', 1)}\n if(!identical(candidate(c()), NULL)){quit('no', 1)}\n if(!identical(candidate(c(2, 4, 1, 2, -1, -1, 9)), 20)){quit('no', 1)}\n if(!identical(candidate(c(-1, 1, -1, 1)), 4)){quit('no', 1)}\n if(!identical(candidate(c(-1, 1, 1, 1)), -4)){quit('no', 1)}\n if(!identical(candidate(c(-1, 1, 1, 0)), 0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "r", - "prompt": "# Return list with elements incremented by 1.\n# >>> incr_list(c(1, 2, 3))\n# list(2, 3, 4)\n# >>> incr_list(c(5, 3, 5, 2, 3, 3, 9, 0, 123))\n# list(6, 4, 6, 3, 4, 4, 10, 1, 124)\nincr_list <- function(l) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- incr_list\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 1)), list(4, 3, 2))){quit('no', 1)}\n if(!identical(candidate(c(5, 2, 5, 2, 3, 3, 9, 0, 123)), list(6, 3, 6, 3, 4, 4, 10, 1, 124))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "r", - "prompt": "# From a given list of integers, generate a list of rolling maximum element found until given moment\n# in the sequence.\n# >>> rolling_max(c(1, 2, 3, 2, 3, 4, 2))\n# list(1, 2, 3, 3, 3, 4, 4)\nrolling_max <- function(numbers) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- rolling_max\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4)), list(1, 2, 3, 4))){quit('no', 1)}\n if(!identical(candidate(c(4, 3, 2, 1)), list(4, 4, 4, 4))){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 3, 100, 3)), list(3, 3, 3, 100, 100))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "r", - "prompt": "# Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n# separate those group into separate strings and return the list of those.\n# Separate groups are balanced (each open brace is properly closed) and not nested within each other\n# Ignore any spaces in the input string.\n# >>> separate_paren_groups('( ) (( )) (( )( ))')\n# list('()', '(())', '(()())')\nseparate_paren_groups <- function(paren_string) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- separate_paren_groups\n if(!identical(candidate('(()()) ((())) () ((())()())'), list('(()())', '((()))', '()', '((())()())'))){quit('no', 1)}\n if(!identical(candidate('() (()) ((())) (((())))'), list('()', '(())', '((()))', '(((())))'))){quit('no', 1)}\n if(!identical(candidate('(()(())((())))'), list('(()(())((())))'))){quit('no', 1)}\n if(!identical(candidate('( ) (( )) (( )( ))'), list('()', '(())', '(()())'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "r", - "prompt": "# You will be given a string of words separated by commas or spaces. Your task is\n# to split the string into words and return an array of the words.\n# For example:\n# >>> words_string('Hi, my name is John')\n# list('Hi', 'my', 'name', 'is', 'John')\n# >>> words_string('One, two, three, four, five, six')\n# list('One', 'two', 'three', 'four', 'five', 'six')\nwords_string <- function(s) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- words_string\n if(!identical(candidate('Hi, my name is John'), list('Hi', 'my', 'name', 'is', 'John'))){quit('no', 1)}\n if(!identical(candidate('One, two, three, four, five, six'), list('One', 'two', 'three', 'four', 'five', 'six'))){quit('no', 1)}\n if(!identical(candidate('Hi, my name'), list('Hi', 'my', 'name'))){quit('no', 1)}\n if(!identical(candidate('One,, two, three, four, five, six,'), list('One', 'two', 'three', 'four', 'five', 'six'))){quit('no', 1)}\n if(!identical(candidate(''), list())){quit('no', 1)}\n if(!identical(candidate('ahmed , gamal'), list('ahmed', 'gamal'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "r", - "prompt": "# Create a function that takes integers, floats, or strings representing\n# real numbers, and returns the larger variable in its given variable type.\n# Return None if the values are equal.\n# Note: If a real number is represented as a string, the floating point might be . or ,\n# >>> compare_one(1, 2.5)\n# 2.5\n# >>> compare_one(1, '2,3')\n# '2,3'\n# >>> compare_one('5,1', '6')\n# '6'\n# >>> compare_one('1', 1)\n# NULL\ncompare_one <- function(a, b) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- compare_one\n if(!identical(candidate(1, 2), 2)){quit('no', 1)}\n if(!identical(candidate(1, 2.5), 2.5)){quit('no', 1)}\n if(!identical(candidate(2, 3), 3)){quit('no', 1)}\n if(!identical(candidate(5, 6), 6)){quit('no', 1)}\n if(!identical(candidate(1, '2,3'), '2,3')){quit('no', 1)}\n if(!identical(candidate('5,1', '6'), '6')){quit('no', 1)}\n if(!identical(candidate('1', '2'), '2')){quit('no', 1)}\n if(!identical(candidate('1', 1), NULL)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "r", - "prompt": "# Filter given list of any python values only for integers\n# >>> filter_integers(list('a', 3.14, 5))\n# list(5)\n# >>> filter_integers(list(1, 2, 3, 'abc', list(), list()))\n# list(1, 2, 3)\nfilter_integers <- function(values) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- filter_integers\n if(!identical(candidate(list()), list())){quit('no', 1)}\n if(!identical(candidate(list(4, list(), list(), 23.2, 9, 'adasd')), list(4, 9))){quit('no', 1)}\n if(!identical(candidate(list(3, 'c', 3, 3, 'a', 'b')), list(3, 3, 3))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "r", - "prompt": "# This function takes a list l and returns a list l' such that\n# l' is identical to l in the odd indicies, while its values at the even indicies are equal\n# to the values of the even indicies of l, but sorted.\n# >>> sort_even(c(1, 2, 3))\n# list(1, 2, 3)\n# >>> sort_even(c(5, 6, 3, 4))\n# list(3, 6, 5, 4)\nsort_even <- function(l) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- sort_even\n if(!identical(candidate(c(1, 2, 3)), list(1, 2, 3))){quit('no', 1)}\n if(!identical(candidate(c(5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10)), list(-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123))){quit('no', 1)}\n if(!identical(candidate(c(5, 8, -12, 4, 23, 2, 3, 11, 12, -10)), list(-12, 8, 3, 4, 5, 2, 12, 11, 23, -10))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "r", - "prompt": "# I think we all remember that feeling when the result of some long-awaited\n# event is finally known. The feelings and thoughts you have at that moment are\n# definitely worth noting down and comparing.\n# Your task is to determine if a person correctly guessed the results of a number of matches.\n# You are given two arrays of scores and guesses of equal length, where each index shows a match. \n# Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n# the value is 0, and if not, the value is the absolute difference between the guess and the score.\n# example:\n# >>> compare(c(1, 2, 3, 4, 5, 1), c(1, 2, 3, 4, 2, -2))\n# list(0, 0, 0, 0, 3, 3)\n# >>> compare(c(0, 5, 0, 0, 0, 4), c(4, 1, 1, 0, 0, -2))\n# list(4, 4, 1, 0, 0, 6)\ncompare <- function(game, guess) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- compare\n if(!identical(candidate(c(1, 2, 3, 4, 5, 1), c(1, 2, 3, 4, 2, -2)), list(0, 0, 0, 0, 3, 3))){quit('no', 1)}\n if(!identical(candidate(c(0, 0, 0, 0, 0, 0), c(0, 0, 0, 0, 0, 0)), list(0, 0, 0, 0, 0, 0))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3), c(-1, -2, -3)), list(2, 4, 6))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 5), c(-1, 2, 3, 4)), list(2, 0, 0, 1))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "r", - "prompt": "# Given a positive integer n, return a tuple that has the number of even and odd\n# integer palindromes that fall within the range(1, n), inclusive.\n# Example 1:\n# >>> even_odd_palindrome(3)\n# list(1, 2)\n# Explanation:\n# Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n# Example 2:\n# >>> even_odd_palindrome(12)\n# list(4, 6)\n# Explanation:\n# Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n# Note:\n# 1. 1 <= n <= 10^3\n# 2. returned tuple has the number of even and odd integer palindromes respectively.\neven_odd_palindrome <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- even_odd_palindrome\n if(!identical(candidate(123), list(8, 13))){quit('no', 1)}\n if(!identical(candidate(12), list(4, 6))){quit('no', 1)}\n if(!identical(candidate(3), list(1, 2))){quit('no', 1)}\n if(!identical(candidate(63), list(6, 8))){quit('no', 1)}\n if(!identical(candidate(25), list(5, 6))){quit('no', 1)}\n if(!identical(candidate(19), list(4, 6))){quit('no', 1)}\n if(!identical(candidate(9), list(4, 5))){quit('no', 1)}\n if(!identical(candidate(1), list(0, 1))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "r", - "prompt": "# The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fib4(0) -> 0\n# fib4(1) -> 0\n# fib4(2) -> 2\n# fib4(3) -> 0\n# fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n# Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n# >>> fib4(5)\n# 4\n# >>> fib4(6)\n# 8\n# >>> fib4(7)\n# 14\nfib4 <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- fib4\n if(!identical(candidate(5), 4)){quit('no', 1)}\n if(!identical(candidate(8), 28)){quit('no', 1)}\n if(!identical(candidate(10), 104)){quit('no', 1)}\n if(!identical(candidate(12), 386)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "r", - "prompt": "# Given two positive integers a and b, return the even digits between a\n# and b, in ascending order.\n# For example:\n# >>> generate_integers(2, 8)\n# list(2, 4, 6, 8)\n# >>> generate_integers(8, 2)\n# list(2, 4, 6, 8)\n# >>> generate_integers(10, 14)\n# list()\ngenerate_integers <- function(a, b) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- generate_integers\n if(!identical(candidate(2, 10), list(2, 4, 6, 8))){quit('no', 1)}\n if(!identical(candidate(10, 2), list(2, 4, 6, 8))){quit('no', 1)}\n if(!identical(candidate(132, 2), list(2, 4, 6, 8))){quit('no', 1)}\n if(!identical(candidate(17, 89), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "r", - "prompt": "# For a given list of input numbers, calculate Mean Absolute Deviation\n# around the mean of this dataset.\n# Mean Absolute Deviation is the average absolute difference between each\n# element and a centerpoint (mean in this case):\n# MAD = average | x - x_mean |\n# >>> mean_absolute_deviation(c(1.0, 2.0, 3.0, 4.0))\n# 1.0\nmean_absolute_deviation <- function(numbers) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- mean_absolute_deviation\n if(!identical(candidate(c(1.0, 2.0)), 0.5)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.0, 4.0)), 1.0)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.0, 4.0, 5.0)), 1.2)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "r", - "prompt": "# Create a function encrypt that takes a string as an argument and\n# returns a string encrypted with the alphabet being rotated. \n# The alphabet should be rotated in a manner such that the letters \n# shift down by two multiplied to two places.\n# For example:\n# >>> encrypt('hi')\n# 'lm'\n# >>> encrypt('asdfghjkl')\n# 'ewhjklnop'\n# >>> encrypt('gf')\n# 'kj'\n# >>> encrypt('et')\n# 'ix'\nencrypt <- function(s) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- encrypt\n if(!identical(candidate('hi'), 'lm')){quit('no', 1)}\n if(!identical(candidate('asdfghjkl'), 'ewhjklnop')){quit('no', 1)}\n if(!identical(candidate('gf'), 'kj')){quit('no', 1)}\n if(!identical(candidate('et'), 'ix')){quit('no', 1)}\n if(!identical(candidate('faewfawefaewg'), 'jeiajeaijeiak')){quit('no', 1)}\n if(!identical(candidate('hellomyfriend'), 'lippsqcjvmirh')){quit('no', 1)}\n if(!identical(candidate('dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh'), 'hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl')){quit('no', 1)}\n if(!identical(candidate('a'), 'e')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "r", - "prompt": "# Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n# The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n# as follows: start with any positive integer n. Then each term is obtained from the \n# previous term as follows: if the previous term is even, the next term is one half of \n# the previous term. If the previous term is odd, the next term is 3 times the previous\n# term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n# Note: \n# 1. Collatz(1) is [1].\n# 2. returned list sorted in increasing order.\n# For example:\n# get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n# >>> get_odd_collatz(5)\n# list(1, 5)\nget_odd_collatz <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- get_odd_collatz\n if(!identical(candidate(14), list(1, 5, 7, 11, 13, 17))){quit('no', 1)}\n if(!identical(candidate(5), list(1, 5))){quit('no', 1)}\n if(!identical(candidate(12), list(1, 3, 5))){quit('no', 1)}\n if(!identical(candidate(1), list(1))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "r", - "prompt": "# Find how many times a given substring can be found in the original string. Count overlaping cases.\n# >>> how_many_times('', 'a')\n# 0\n# >>> how_many_times('aaa', 'a')\n# 3\n# >>> how_many_times('aaaa', 'aa')\n# 3\nhow_many_times <- function(string, substring) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- how_many_times\n if(!identical(candidate('', 'x'), 0)){quit('no', 1)}\n if(!identical(candidate('xyxyxyx', 'x'), 4)){quit('no', 1)}\n if(!identical(candidate('cacacacac', 'cac'), 4)){quit('no', 1)}\n if(!identical(candidate('john doe', 'john'), 1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "r", - "prompt": "# We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n# numbers in the array will be randomly ordered. Your task is to determine if\n# it is possible to get an array sorted in non-decreasing order by performing \n# the following operation on the given array:\n# You are allowed to perform right shift operation any number of times.\n# One right shift operation means shifting all elements of the array by one\n# position in the right direction. The last element of the array will be moved to\n# the starting position in the array i.e. 0th index. \n# If it is possible to obtain the sorted array by performing the above operation\n# then return True else return False.\n# If the given array is empty then return True.\n# Note: The given list is guaranteed to have unique elements.\n# For Example:\n# >>> move_one_ball(c(3, 4, 5, 1, 2))\n# TRUE\n# Explanation: By performin 2 right shift operations, non-decreasing order can\n# be achieved for the given array.\n# >>> move_one_ball(c(3, 5, 4, 1, 2))\n# FALSE\n# Explanation:It is not possible to get non-decreasing order for the given\n# array by performing any number of right shift operations.\nmove_one_ball <- function(arr) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- move_one_ball\n if(!identical(candidate(c(3, 4, 5, 1, 2)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(3, 5, 10, 1, 2)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(4, 3, 1, 2)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(3, 5, 4, 1, 2)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c()), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "r", - "prompt": "# Write a function which sorts the given list of integers\n# in ascending order according to the sum of their digits.\n# Note: if there are several items with similar sum of their digits,\n# order them based on their index in original list.\n# For example:\n# >>> order_by_points(c(1, 11, -1, -11, -12))\n# list(-1, -11, 1, -12, 11)\n# >>> order_by_points(c())\n# list()\norder_by_points <- function(nums) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- order_by_points\n if(!identical(candidate(c(1, 11, -1, -11, -12)), list(-1, -11, 1, -12, 11))){quit('no', 1)}\n if(!identical(candidate(c(1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46)), list(0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457))){quit('no', 1)}\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(1, -11, -32, 43, 54, -98, 2, -3)), list(-3, -32, -98, -11, 1, 2, 43, 54))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)), list(1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9))){quit('no', 1)}\n if(!identical(candidate(c(0, 6, 6, -76, -21, 23, 4)), list(-76, -21, 0, 4, 23, 6, 6))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "r", - "prompt": "# Return list of prime factors of given integer in the order from smallest to largest.\n# Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n# Input number should be equal to the product of all factors\n# >>> factorize(8)\n# list(2, 2, 2)\n# >>> factorize(25)\n# list(5, 5)\n# >>> factorize(70)\n# list(2, 5, 7)\nfactorize <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- factorize\n if(!identical(candidate(2), list(2))){quit('no', 1)}\n if(!identical(candidate(4), list(2, 2))){quit('no', 1)}\n if(!identical(candidate(8), list(2, 2, 2))){quit('no', 1)}\n if(!identical(candidate(57), list(3, 19))){quit('no', 1)}\n if(!identical(candidate(3249), list(3, 3, 19, 19))){quit('no', 1)}\n if(!identical(candidate(185193), list(3, 3, 3, 19, 19, 19))){quit('no', 1)}\n if(!identical(candidate(20577), list(3, 19, 19, 19))){quit('no', 1)}\n if(!identical(candidate(18), list(2, 3, 3))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "r", - "prompt": "# Return True if all numbers in the list l are below threshold t.\n# >>> below_threshold(c(1, 2, 4, 10), 100)\n# TRUE\n# >>> below_threshold(c(1, 20, 4, 10), 5)\n# FALSE\nbelow_threshold <- function(l, t) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- below_threshold\n if(!identical(candidate(c(1, 2, 4, 10), 100), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 20, 4, 10), 5), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 20, 4, 10), 21), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 20, 4, 10), 22), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 8, 4, 10), 11), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 8, 4, 10), 10), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "r", - "prompt": "# You are given two positive integers n and m, and your task is to compute the\n# average of the integers from n through m (including n and m). \n# Round the answer to the nearest integer and convert that to binary.\n# If n is greater than m, return -1.\n# Example:\n# >>> rounded_avg(1, 5)\n# '0b11'\n# >>> rounded_avg(7, 5)\n# -1\n# >>> rounded_avg(10, 20)\n# '0b1111'\n# >>> rounded_avg(20, 33)\n# '0b11010'\nrounded_avg <- function(n, m) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- rounded_avg\n if(!identical(candidate(1, 5), '0b11')){quit('no', 1)}\n if(!identical(candidate(7, 13), '0b1010')){quit('no', 1)}\n if(!identical(candidate(964, 977), '0b1111001010')){quit('no', 1)}\n if(!identical(candidate(996, 997), '0b1111100100')){quit('no', 1)}\n if(!identical(candidate(560, 851), '0b1011000010')){quit('no', 1)}\n if(!identical(candidate(185, 546), '0b101101110')){quit('no', 1)}\n if(!identical(candidate(362, 496), '0b110101101')){quit('no', 1)}\n if(!identical(candidate(350, 902), '0b1001110010')){quit('no', 1)}\n if(!identical(candidate(197, 233), '0b11010111')){quit('no', 1)}\n if(!identical(candidate(7, 5), -1)){quit('no', 1)}\n if(!identical(candidate(5, 1), -1)){quit('no', 1)}\n if(!identical(candidate(5, 5), '0b101')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "r", - "prompt": "# Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n# For each of the group, output the deepest level of nesting of parentheses.\n# E.g. (()()) has maximum two levels of nesting while ((())) has three.\n# >>> parse_nested_parens('(()()) ((())) () ((())()())')\n# list(2, 3, 1, 3)\nparse_nested_parens <- function(paren_string) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- parse_nested_parens\n if(!identical(candidate('(()()) ((())) () ((())()())'), list(2, 3, 1, 3))){quit('no', 1)}\n if(!identical(candidate('() (()) ((())) (((())))'), list(1, 2, 3, 4))){quit('no', 1)}\n if(!identical(candidate('(()(())((())))'), list(4))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "r", - "prompt": "# Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n# Examples\n# >>> solution(c(5, 8, 7, 1))\n# 12\n# >>> solution(c(3, 3, 3, 3, 3))\n# 9\n# >>> solution(c(30, 13, 24, 321))\n# 0\nsolution <- function(lst) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- solution\n if(!identical(candidate(c(5, 8, 7, 1)), 12)){quit('no', 1)}\n if(!identical(candidate(c(3, 3, 3, 3, 3)), 9)){quit('no', 1)}\n if(!identical(candidate(c(30, 13, 24, 321)), 0)){quit('no', 1)}\n if(!identical(candidate(c(5, 9)), 5)){quit('no', 1)}\n if(!identical(candidate(c(2, 4, 8)), 0)){quit('no', 1)}\n if(!identical(candidate(c(30, 13, 23, 32)), 23)){quit('no', 1)}\n if(!identical(candidate(c(3, 13, 2, 9)), 3)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "r", - "prompt": "# You are given a positive integer n. You have to create an integer array a of length n.\n# For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n# Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n# and a[i] + a[j] + a[k] is a multiple of 3.\n# Example :\n# >>> get_max_triples(5)\n# 1\n# Explanation: \n# a = [1, 3, 7, 13, 21]\n# The only valid triple is (1, 7, 13).\nget_max_triples <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- get_max_triples\n if(!identical(candidate(5), 1)){quit('no', 1)}\n if(!identical(candidate(6), 4)){quit('no', 1)}\n if(!identical(candidate(10), 36)){quit('no', 1)}\n if(!identical(candidate(100), 53361)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "r", - "prompt": "# There are eight planets in our solar system: the closerst to the Sun \n# is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n# Uranus, Neptune.\n# Write a function that takes two planet names as strings planet1 and planet2. \n# The function should return a tuple containing all planets whose orbits are \n# located between the orbit of planet1 and the orbit of planet2, sorted by \n# the proximity to the sun. \n# The function should return an empty tuple if planet1 or planet2\n# are not correct planet names. \n# Examples\n# >>> bf('Jupiter', 'Neptune')\n# list('Saturn', 'Uranus')\n# >>> bf('Earth', 'Mercury')\n# 'Venus'\n# >>> bf('Mercury', 'Uranus')\n# list('Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn')\nbf <- function(planet1, planet2) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- bf\n if(!identical(candidate('Jupiter', 'Neptune'), list('Saturn', 'Uranus'))){quit('no', 1)}\n if(!identical(candidate('Earth', 'Mercury'), list('Venus'))){quit('no', 1)}\n if(!identical(candidate('Mercury', 'Uranus'), list('Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn'))){quit('no', 1)}\n if(!identical(candidate('Neptune', 'Venus'), list('Earth', 'Mars', 'Jupiter', 'Saturn', 'Uranus'))){quit('no', 1)}\n if(!identical(candidate('Earth', 'Earth'), list())){quit('no', 1)}\n if(!identical(candidate('Mars', 'Earth'), list())){quit('no', 1)}\n if(!identical(candidate('Jupiter', 'Makemake'), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "r", - "prompt": "# You are given a list of integers.\n# Write a function next_smallest() that returns the 2nd smallest element of the list.\n# Return None if there is no such element.\n# >>> next_smallest(c(1, 2, 3, 4, 5))\n# 2\n# >>> next_smallest(c(5, 1, 4, 3, 2))\n# 2\n# >>> next_smallest(c())\n# NULL\n# >>> next_smallest(c(1, 1))\n# NULL\nnext_smallest <- function(lst) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- next_smallest\n if(!identical(candidate(c(1, 2, 3, 4, 5)), 2)){quit('no', 1)}\n if(!identical(candidate(c(5, 1, 4, 3, 2)), 2)){quit('no', 1)}\n if(!identical(candidate(c()), NULL)){quit('no', 1)}\n if(!identical(candidate(c(1, 1)), NULL)){quit('no', 1)}\n if(!identical(candidate(c(1, 1, 1, 1, 0)), 1)){quit('no', 1)}\n if(!identical(candidate(c(1, 1)), NULL)){quit('no', 1)}\n if(!identical(candidate(c(-35, 34, 12, -45)), -35)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "r", - "prompt": "# Input is a space-delimited string of numberals from 'zero' to 'nine'.\n# Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n# Return the string with numbers sorted from smallest to largest\n# >>> sort_numbers('three one five')\n# 'one three five'\nsort_numbers <- function(numbers) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- sort_numbers\n if(!identical(candidate(''), '')){quit('no', 1)}\n if(!identical(candidate('three'), 'three')){quit('no', 1)}\n if(!identical(candidate('three five nine'), 'three five nine')){quit('no', 1)}\n if(!identical(candidate('five zero four seven nine eight'), 'zero four five seven eight nine')){quit('no', 1)}\n if(!identical(candidate('six five four three two one zero'), 'zero one two three four five six')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "r", - "prompt": "# You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n# >>> cycpattern_check('abcd', 'abd')\n# FALSE\n# >>> cycpattern_check('hello', 'ell')\n# TRUE\n# >>> cycpattern_check('whassup', 'psus')\n# FALSE\n# >>> cycpattern_check('abab', 'baa')\n# TRUE\n# >>> cycpattern_check('efef', 'eeff')\n# FALSE\n# >>> cycpattern_check('himenss', 'simen')\n# TRUE\ncycpattern_check <- function(a, b) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- cycpattern_check\n if(!identical(candidate('xyzw', 'xyw'), FALSE)){quit('no', 1)}\n if(!identical(candidate('yello', 'ell'), TRUE)){quit('no', 1)}\n if(!identical(candidate('whattup', 'ptut'), FALSE)){quit('no', 1)}\n if(!identical(candidate('efef', 'fee'), TRUE)){quit('no', 1)}\n if(!identical(candidate('abab', 'aabb'), FALSE)){quit('no', 1)}\n if(!identical(candidate('winemtt', 'tinem'), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "r", - "prompt": "# You will be given a number in decimal form and your task is to convert it to\n# binary format. The function should return a string, with each character representing a binary\n# number. Each character in the string will be '0' or '1'.\n# There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n# The extra characters are there to help with the format.\n# Examples:\n# >>> decimal_to_binary(15)\n# 'db1111db'\n# >>> decimal_to_binary(32)\n# 'db100000db'\ndecimal_to_binary <- function(decimal) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- decimal_to_binary\n if(!identical(candidate(0), 'db0db')){quit('no', 1)}\n if(!identical(candidate(32), 'db100000db')){quit('no', 1)}\n if(!identical(candidate(103), 'db1100111db')){quit('no', 1)}\n if(!identical(candidate(15), 'db1111db')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "r", - "prompt": "# Filter an input list of strings only for ones that contain given substring\n# >>> filter_by_substring(c(), 'a')\n# list()\n# >>> filter_by_substring(c('abc', 'bacd', 'cde', 'array'), 'a')\n# list('abc', 'bacd', 'array')\nfilter_by_substring <- function(strings, substring) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- filter_by_substring\n if(!identical(candidate(c(), 'john'), list())){quit('no', 1)}\n if(!identical(candidate(c('xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'), 'xxx'), list('xxx', 'xxxAAA', 'xxx'))){quit('no', 1)}\n if(!identical(candidate(c('xxx', 'asd', 'aaaxxy', 'john doe', 'xxxAAA', 'xxx'), 'xx'), list('xxx', 'aaaxxy', 'xxxAAA', 'xxx'))){quit('no', 1)}\n if(!identical(candidate(c('grunt', 'trumpet', 'prune', 'gruesome'), 'run'), list('grunt', 'prune'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "r", - "prompt": "# Given an integer. return a tuple that has the number of even and odd digits respectively.\n# Example:\n# >>> even_odd_count(-12)\n# list(1, 1)\n# >>> even_odd_count(123)\n# list(1, 2)\neven_odd_count <- function(num) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- even_odd_count\n if(!identical(candidate(7), list(0, 1))){quit('no', 1)}\n if(!identical(candidate(-78), list(1, 1))){quit('no', 1)}\n if(!identical(candidate(3452), list(2, 2))){quit('no', 1)}\n if(!identical(candidate(346211), list(3, 3))){quit('no', 1)}\n if(!identical(candidate(-345821), list(3, 3))){quit('no', 1)}\n if(!identical(candidate(-2), list(1, 0))){quit('no', 1)}\n if(!identical(candidate(-45347), list(2, 3))){quit('no', 1)}\n if(!identical(candidate(0), list(1, 0))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "r", - "prompt": "# Write a function that accepts a list of strings.\n# The list contains different words. Return the word with maximum number\n# of unique characters. If multiple strings have maximum number of unique\n# characters, return the one which comes first in lexicographical order.\n# >>> find_max(c('name', 'of', 'string'))\n# 'string'\n# >>> find_max(c('name', 'enam', 'game'))\n# 'enam'\n# >>> find_max(c('aaaaaaa', 'bb', 'cc'))\n# 'aaaaaaa'\nfind_max <- function(words) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- find_max\n if(!identical(candidate(c('name', 'of', 'string')), 'string')){quit('no', 1)}\n if(!identical(candidate(c('name', 'enam', 'game')), 'enam')){quit('no', 1)}\n if(!identical(candidate(c('aaaaaaa', 'bb', 'cc')), 'aaaaaaa')){quit('no', 1)}\n if(!identical(candidate(c('abc', 'cba')), 'abc')){quit('no', 1)}\n if(!identical(candidate(c('play', 'this', 'game', 'of', 'footbott')), 'footbott')){quit('no', 1)}\n if(!identical(candidate(c('we', 'are', 'gonna', 'rock')), 'gonna')){quit('no', 1)}\n if(!identical(candidate(c('we', 'are', 'a', 'mad', 'nation')), 'nation')){quit('no', 1)}\n if(!identical(candidate(c('this', 'is', 'a', 'prrk')), 'this')){quit('no', 1)}\n if(!identical(candidate(c('b')), 'b')){quit('no', 1)}\n if(!identical(candidate(c('play', 'play', 'play')), 'play')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "r", - "prompt": "# Given a positive integer n, return the count of the numbers of n-digit\n# positive integers that start or end with 1.\nstarts_one_ends <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- starts_one_ends\n if(!identical(candidate(1), 1)){quit('no', 1)}\n if(!identical(candidate(2), 18)){quit('no', 1)}\n if(!identical(candidate(3), 180)){quit('no', 1)}\n if(!identical(candidate(4), 1800)){quit('no', 1)}\n if(!identical(candidate(5), 18000)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "r", - "prompt": "# Create a function that returns a tuple (a, b), where 'a' is\n# the largest of negative integers, and 'b' is the smallest\n# of positive integers in a list.\n# If there is no negative or positive integers, return them as None.\n# Examples:\n# >>> largest_smallest_integers(c(2, 4, 1, 3, 5, 7))\n# list(NULL, 1)\n# >>> largest_smallest_integers(c())\n# list(NULL, NULL)\n# >>> largest_smallest_integers(c(0))\n# list(NULL, NULL)\nlargest_smallest_integers <- function(lst) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- largest_smallest_integers\n if(!identical(candidate(c(2, 4, 1, 3, 5, 7)), list(NULL, 1))){quit('no', 1)}\n if(!identical(candidate(c(2, 4, 1, 3, 5, 7, 0)), list(NULL, 1))){quit('no', 1)}\n if(!identical(candidate(c(1, 3, 2, 4, 5, 6, -2)), list(-2, 1))){quit('no', 1)}\n if(!identical(candidate(c(4, 5, 3, 6, 2, 7, -7)), list(-7, 2))){quit('no', 1)}\n if(!identical(candidate(c(7, 3, 8, 4, 9, 2, 5, -9)), list(-9, 2))){quit('no', 1)}\n if(!identical(candidate(c()), list(NULL, NULL))){quit('no', 1)}\n if(!identical(candidate(c(0)), list(NULL, NULL))){quit('no', 1)}\n if(!identical(candidate(c(-1, -3, -5, -6)), list(-1, NULL))){quit('no', 1)}\n if(!identical(candidate(c(-1, -3, -5, -6, 0)), list(-1, NULL))){quit('no', 1)}\n if(!identical(candidate(c(-6, -4, -4, -3, 1)), list(-3, 1))){quit('no', 1)}\n if(!identical(candidate(c(-6, -4, -4, -3, -100, 1)), list(-3, 1))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "r", - "prompt": "# \"Given an array representing a branch of a tree that has non-negative integer nodes\n# your task is to pluck one of the nodes and return it.\n# The plucked node should be the node with the smallest even value.\n# If multiple nodes with the same smallest even value are found return the node that has smallest index.\n# The plucked node should be returned in a list, [ smalest_value, its index ],\n# If there are no even values or the given array is empty, return [].\n# Example 1:\n# >>> pluck(c(4, 2, 3))\n# list(2, 1)\n# Explanation: 2 has the smallest even value, and 2 has the smallest index.\n# Example 2:\n# >>> pluck(c(1, 2, 3))\n# list(2, 1)\n# Explanation: 2 has the smallest even value, and 2 has the smallest index.\n# Example 3:\n# >>> pluck(c())\n# list()\n# Example 4:\n# >>> pluck(c(5, 0, 3, 0, 4, 2))\n# list(0, 1)\n# Explanation: 0 is the smallest value, but there are two zeros,\n# so we will choose the first zero, which has the smallest index.\n# Constraints:\n# * 1 <= nodes.length <= 10000\n# * 0 <= node.value\npluck <- function(arr) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- pluck\n if(!identical(candidate(c(4, 2, 3)), list(2, 1))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3)), list(2, 1))){quit('no', 1)}\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(5, 0, 3, 0, 4, 2)), list(0, 1))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 0, 5, 3)), list(0, 3))){quit('no', 1)}\n if(!identical(candidate(c(5, 4, 8, 4, 8)), list(4, 1))){quit('no', 1)}\n if(!identical(candidate(c(7, 6, 7, 1)), list(6, 1))){quit('no', 1)}\n if(!identical(candidate(c(7, 9, 7, 1)), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "r", - "prompt": "# Write a function count_nums which takes an array of integers and returns\n# the number of elements which has a sum of digits > 0.\n# If a number is negative, then its first signed digit will be negative:\n# e.g. -123 has signed digits -1, 2, and 3.\n# >>> count_nums(c())\n# 0\n# >>> count_nums(c(-1, 11, -11))\n# 1\n# >>> count_nums(c(1, 1, 2))\n# 3\ncount_nums <- function(arr) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- count_nums\n if(!identical(candidate(c()), 0)){quit('no', 1)}\n if(!identical(candidate(c(-1, -2, 0)), 0)){quit('no', 1)}\n if(!identical(candidate(c(1, 1, 2, -2, 3, 4, 5)), 6)){quit('no', 1)}\n if(!identical(candidate(c(1, 6, 9, -6, 0, 1, 5)), 5)){quit('no', 1)}\n if(!identical(candidate(c(1, 100, 98, -7, 1, -1)), 4)){quit('no', 1)}\n if(!identical(candidate(c(12, 23, 34, -45, -56, 0)), 5)){quit('no', 1)}\n if(!identical(candidate(c(0, 1)), 1)){quit('no', 1)}\n if(!identical(candidate(c(1)), 1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "r", - "prompt": "# Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n# each cell of the grid contains a value. Every integer in the range [1, N * N]\n# inclusive appears exactly once on the cells of the grid.\n# You have to find the minimum path of length k in the grid. You can start\n# from any cell, and in each step you can move to any of the neighbor cells,\n# in other words, you can go to cells which share an edge with you current\n# cell.\n# Please note that a path of length k means visiting exactly k cells (not\n# necessarily distinct).\n# You CANNOT go off the grid.\n# A path A (of length k) is considered less than a path B (of length k) if\n# after making the ordered lists of the values on the cells that A and B go\n# through (let's call them lst_A and lst_B), lst_A is lexicographically less\n# than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n# such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n# lst_A[j] = lst_B[j].\n# It is guaranteed that the answer is unique.\n# Return an ordered list of the values on the cells that the minimum path go through.\n# Examples: \n# >>> minPath(list(list(1, 2, 3), list(4, 5, 6), list(7, 8, 9)), 3)\n# list(1, 2, 1)\n# >>> minPath(list(list(5, 9, 3), list(4, 1, 6), list(7, 8, 2)), 1)\n# list(1)\nminPath <- function(grid, k) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- minPath\n if(!identical(candidate(list(list(1, 2, 3), list(4, 5, 6), list(7, 8, 9)), 3), list(1, 2, 1))){quit('no', 1)}\n if(!identical(candidate(list(list(5, 9, 3), list(4, 1, 6), list(7, 8, 2)), 1), list(1))){quit('no', 1)}\n if(!identical(candidate(list(list(1, 2, 3, 4), list(5, 6, 7, 8), list(9, 10, 11, 12), list(13, 14, 15, 16)), 4), list(1, 2, 1, 2))){quit('no', 1)}\n if(!identical(candidate(list(list(6, 4, 13, 10), list(5, 7, 12, 1), list(3, 16, 11, 15), list(8, 14, 9, 2)), 7), list(1, 10, 1, 10, 1, 10, 1))){quit('no', 1)}\n if(!identical(candidate(list(list(8, 14, 9, 2), list(6, 4, 13, 15), list(5, 7, 1, 12), list(3, 10, 11, 16)), 5), list(1, 7, 1, 7, 1))){quit('no', 1)}\n if(!identical(candidate(list(list(11, 8, 7, 2), list(5, 16, 14, 4), list(9, 3, 15, 6), list(12, 13, 10, 1)), 9), list(1, 6, 1, 6, 1, 6, 1, 6, 1))){quit('no', 1)}\n if(!identical(candidate(list(list(12, 13, 10, 1), list(9, 3, 15, 6), list(5, 16, 14, 4), list(11, 8, 7, 2)), 12), list(1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6))){quit('no', 1)}\n if(!identical(candidate(list(list(2, 7, 4), list(3, 1, 5), list(6, 8, 9)), 8), list(1, 3, 1, 3, 1, 3, 1, 3))){quit('no', 1)}\n if(!identical(candidate(list(list(6, 1, 5), list(3, 8, 9), list(2, 7, 4)), 8), list(1, 5, 1, 5, 1, 5, 1, 5))){quit('no', 1)}\n if(!identical(candidate(list(list(1, 2), list(3, 4)), 10), list(1, 2, 1, 2, 1, 2, 1, 2, 1, 2))){quit('no', 1)}\n if(!identical(candidate(list(list(1, 3), list(3, 2)), 10), list(1, 3, 1, 3, 1, 3, 1, 3, 1, 3))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "r", - "prompt": "# Given list of integers, return list in strange order.\n# Strange sorting, is when you start with the minimum value,\n# then maximum of the remaining integers, then minimum and so on.\n# Examples:\n# >>> strange_sort_list(c(1, 2, 3, 4))\n# list(1, 4, 2, 3)\n# >>> strange_sort_list(c(5, 5, 5, 5))\n# list(5, 5, 5, 5)\n# >>> strange_sort_list(c())\n# list()\nstrange_sort_list <- function(lst) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- strange_sort_list\n if(!identical(candidate(c(1, 2, 3, 4)), list(1, 4, 2, 3))){quit('no', 1)}\n if(!identical(candidate(c(5, 6, 7, 8, 9)), list(5, 9, 6, 8, 7))){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 5)), list(1, 5, 2, 4, 3))){quit('no', 1)}\n if(!identical(candidate(c(5, 6, 7, 8, 9, 1)), list(1, 9, 5, 8, 6, 7))){quit('no', 1)}\n if(!identical(candidate(c(5, 5, 5, 5)), list(5, 5, 5, 5))){quit('no', 1)}\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 5, 6, 7, 8)), list(1, 8, 2, 7, 3, 6, 4, 5))){quit('no', 1)}\n if(!identical(candidate(c(0, 2, 2, 2, 5, 5, -5, -5)), list(-5, 5, -5, 5, 0, 2, 2, 2))){quit('no', 1)}\n if(!identical(candidate(c(111111)), list(111111))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "r", - "prompt": "# Given a string 'text', return its md5 hash equivalent string.\n# If 'text' is an empty string, return None.\n# >>> string_to_md5('Hello world')\n# '3e25960a79dbc69b674cd4ec67a72c62'\nstring_to_md5 <- function(text) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- string_to_md5\n if(!identical(candidate('Hello world'), '3e25960a79dbc69b674cd4ec67a72c62')){quit('no', 1)}\n if(!identical(candidate(''), NULL)){quit('no', 1)}\n if(!identical(candidate('A B C'), '0ef78513b0cb8cef12743f5aeb35f888')){quit('no', 1)}\n if(!identical(candidate('password'), '5f4dcc3b5aa765d61d8327deb882cf99')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "r", - "prompt": "# You are given a word. Your task is to find the closest vowel that stands between \n# two consonants from the right side of the word (case sensitive).\n# Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n# find any vowel met the above condition. \n# You may assume that the given string contains English letter only.\n# Example:\n# >>> get_closest_vowel('yogurt')\n# 'u'\n# >>> get_closest_vowel('FULL')\n# 'U'\n# >>> get_closest_vowel('quick')\n# ''\n# >>> get_closest_vowel('ab')\n# ''\nget_closest_vowel <- function(word) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- get_closest_vowel\n if(!identical(candidate('yogurt'), 'u')){quit('no', 1)}\n if(!identical(candidate('full'), 'u')){quit('no', 1)}\n if(!identical(candidate('easy'), '')){quit('no', 1)}\n if(!identical(candidate('eAsy'), '')){quit('no', 1)}\n if(!identical(candidate('ali'), '')){quit('no', 1)}\n if(!identical(candidate('bad'), 'a')){quit('no', 1)}\n if(!identical(candidate('most'), 'o')){quit('no', 1)}\n if(!identical(candidate('ab'), '')){quit('no', 1)}\n if(!identical(candidate('ba'), '')){quit('no', 1)}\n if(!identical(candidate('quick'), '')){quit('no', 1)}\n if(!identical(candidate('anime'), 'i')){quit('no', 1)}\n if(!identical(candidate('Asia'), '')){quit('no', 1)}\n if(!identical(candidate('Above'), 'o')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "r", - "prompt": "# Change numerical base of input number x to base.\n# return string representation after the conversion.\n# base numbers are less than 10.\n# >>> change_base(8, 3)\n# '22'\n# >>> change_base(8, 2)\n# '1000'\n# >>> change_base(7, 2)\n# '111'\nchange_base <- function(x, base) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- change_base\n if(!identical(candidate(8, 3), '22')){quit('no', 1)}\n if(!identical(candidate(9, 3), '100')){quit('no', 1)}\n if(!identical(candidate(234, 2), '11101010')){quit('no', 1)}\n if(!identical(candidate(16, 2), '10000')){quit('no', 1)}\n if(!identical(candidate(8, 2), '1000')){quit('no', 1)}\n if(!identical(candidate(7, 2), '111')){quit('no', 1)}\n if(!identical(candidate(2, 3), '2')){quit('no', 1)}\n if(!identical(candidate(3, 4), '3')){quit('no', 1)}\n if(!identical(candidate(4, 5), '4')){quit('no', 1)}\n if(!identical(candidate(5, 6), '5')){quit('no', 1)}\n if(!identical(candidate(6, 7), '6')){quit('no', 1)}\n if(!identical(candidate(7, 8), '7')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "r", - "prompt": "# Check if in given list of numbers, are any two numbers closer to each other than\n# given threshold.\n# >>> has_close_elements(c(1.0, 2.0, 3.0), 0.5)\n# FALSE\n# >>> has_close_elements(c(1.0, 2.8, 3.0, 4.0, 5.0, 2.0), 0.3)\n# TRUE\nhas_close_elements <- function(numbers, threshold) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- has_close_elements\n if(!identical(candidate(c(1.0, 2.0, 3.9, 4.0, 5.0, 2.2), 0.3), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.9, 4.0, 5.0, 2.2), 0.05), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 5.9, 4.0, 5.0), 0.95), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 5.9, 4.0, 5.0), 0.8), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.0, 4.0, 5.0, 2.0), 0.1), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1.1, 2.2, 3.1, 4.1, 5.1), 1.0), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1.1, 2.2, 3.1, 4.1, 5.1), 0.5), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "r", - "prompt": "# Create a function that takes a string as input which contains only square brackets.\n# The function should return True if and only if there is a valid subsequence of brackets \n# where at least one bracket in the subsequence is nested.\n# >>> is_nested('[[]]')\n# TRUE\n# >>> is_nested('[]]]]]]][[[[[]')\n# FALSE\n# >>> is_nested('[][]')\n# FALSE\n# >>> is_nested('[]')\n# FALSE\n# >>> is_nested('[[][]]')\n# TRUE\n# >>> is_nested('[[]][[')\n# TRUE\nis_nested <- function(string) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- is_nested\n if(!identical(candidate('[[]]'), TRUE)){quit('no', 1)}\n if(!identical(candidate('[]]]]]]][[[[[]'), FALSE)){quit('no', 1)}\n if(!identical(candidate('[][]'), FALSE)){quit('no', 1)}\n if(!identical(candidate('[]'), FALSE)){quit('no', 1)}\n if(!identical(candidate('[[[[]]]]'), TRUE)){quit('no', 1)}\n if(!identical(candidate('[]]]]]]]]]]'), FALSE)){quit('no', 1)}\n if(!identical(candidate('[][][[]]'), TRUE)){quit('no', 1)}\n if(!identical(candidate('[[]'), FALSE)){quit('no', 1)}\n if(!identical(candidate('[]]'), FALSE)){quit('no', 1)}\n if(!identical(candidate('[[]][['), TRUE)){quit('no', 1)}\n if(!identical(candidate('[[][]]'), TRUE)){quit('no', 1)}\n if(!identical(candidate(''), FALSE)){quit('no', 1)}\n if(!identical(candidate('[[[[[[[['), FALSE)){quit('no', 1)}\n if(!identical(candidate(']]]]]]]]'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "r", - "prompt": "# Concatenate list of strings into a single string\n# >>> concatenate(c())\n# ''\n# >>> concatenate(c('a', 'b', 'c'))\n# 'abc'\nconcatenate <- function(strings) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- concatenate\n if(!identical(candidate(c()), '')){quit('no', 1)}\n if(!identical(candidate(c('x', 'y', 'z')), 'xyz')){quit('no', 1)}\n if(!identical(candidate(c('x', 'y', 'z', 'w', 'k')), 'xyzwk')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "r", - "prompt": "# prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n# >>> prime_fib(1)\n# 2\n# >>> prime_fib(2)\n# 3\n# >>> prime_fib(3)\n# 5\n# >>> prime_fib(4)\n# 13\n# >>> prime_fib(5)\n# 89\nprime_fib <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- prime_fib\n if(!identical(candidate(1), 2)){quit('no', 1)}\n if(!identical(candidate(2), 3)){quit('no', 1)}\n if(!identical(candidate(3), 5)){quit('no', 1)}\n if(!identical(candidate(4), 13)){quit('no', 1)}\n if(!identical(candidate(5), 89)){quit('no', 1)}\n if(!identical(candidate(6), 233)){quit('no', 1)}\n if(!identical(candidate(7), 1597)){quit('no', 1)}\n if(!identical(candidate(8), 28657)){quit('no', 1)}\n if(!identical(candidate(9), 514229)){quit('no', 1)}\n if(!identical(candidate(10), 433494437)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "r", - "prompt": "# From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n# other and return them in order (smaller number, larger number).\n# >>> find_closest_elements(c(1.0, 2.0, 3.0, 4.0, 5.0, 2.2))\n# list(2.0, 2.2)\n# >>> find_closest_elements(c(1.0, 2.0, 3.0, 4.0, 5.0, 2.0))\n# list(2.0, 2.0)\nfind_closest_elements <- function(numbers) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- find_closest_elements\n if(!identical(candidate(c(1.0, 2.0, 3.9, 4.0, 5.0, 2.2)), list(3.9, 4.0))){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 5.9, 4.0, 5.0)), list(5.0, 5.9))){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.0, 4.0, 5.0, 2.2)), list(2.0, 2.2))){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.0, 4.0, 5.0, 2.0)), list(2.0, 2.0))){quit('no', 1)}\n if(!identical(candidate(c(1.1, 2.2, 3.1, 4.1, 5.1)), list(2.2, 3.1))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "r", - "prompt": "# You have been tasked to write a function that receives \n# a hexadecimal number as a string and counts the number of hexadecimal \n# digits that are primes (prime number, or a prime, is a natural number \n# greater than 1 that is not a product of two smaller natural numbers).\n# Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n# Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n# So you have to determine a number of the following digits: 2, 3, 5, 7, \n# B (=decimal 11), D (=decimal 13).\n# Note: you may assume the input is always correct or empty string, \n# and symbols A,B,C,D,E,F are always uppercase.\n# Examples:\n# >>> hex_key('AB')\n# 1\n# >>> hex_key('1077E')\n# 2\n# >>> hex_key('ABED1A33')\n# 4\n# >>> hex_key('123456789ABCDEF0')\n# 6\n# >>> hex_key('2020')\n# 2\nhex_key <- function(num) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- hex_key\n if(!identical(candidate('AB'), 1)){quit('no', 1)}\n if(!identical(candidate('1077E'), 2)){quit('no', 1)}\n if(!identical(candidate('ABED1A33'), 4)){quit('no', 1)}\n if(!identical(candidate('2020'), 2)){quit('no', 1)}\n if(!identical(candidate('123456789ABCDEF0'), 6)){quit('no', 1)}\n if(!identical(candidate('112233445566778899AABBCCDDEEFF00'), 12)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "r", - "prompt": "# Complete the function that takes two integers and returns \n# the product of their unit digits.\n# Assume the input is always valid.\n# Examples:\n# >>> multiply(148, 412)\n# 16\n# >>> multiply(19, 28)\n# 72\n# >>> multiply(2020, 1851)\n# 0\n# >>> multiply(14, -15)\n# 20\nmultiply <- function(a, b) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- multiply\n if(!identical(candidate(148, 412), 16)){quit('no', 1)}\n if(!identical(candidate(19, 28), 72)){quit('no', 1)}\n if(!identical(candidate(2020, 1851), 0)){quit('no', 1)}\n if(!identical(candidate(14, -15), 20)){quit('no', 1)}\n if(!identical(candidate(76, 67), 42)){quit('no', 1)}\n if(!identical(candidate(17, 27), 49)){quit('no', 1)}\n if(!identical(candidate(0, 1), 0)){quit('no', 1)}\n if(!identical(candidate(0, 0), 0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "r", - "prompt": "# Given list of numbers (of at least two elements), apply a linear transform to that list,\n# such that the smallest number will become 0 and the largest will become 1\n# >>> rescale_to_unit(c(1.0, 2.0, 3.0, 4.0, 5.0))\n# list(0.0, 0.25, 0.5, 0.75, 1.0)\nrescale_to_unit <- function(numbers) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- rescale_to_unit\n if(!identical(candidate(c(2.0, 49.9)), list(0.0, 1.0))){quit('no', 1)}\n if(!identical(candidate(c(100.0, 49.9)), list(1.0, 0.0))){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.0, 4.0, 5.0)), list(0.0, 0.25, 0.5, 0.75, 1.0))){quit('no', 1)}\n if(!identical(candidate(c(2.0, 1.0, 5.0, 3.0, 4.0)), list(0.25, 0.0, 1.0, 0.5, 0.75))){quit('no', 1)}\n if(!identical(candidate(c(12.0, 11.0, 15.0, 13.0, 14.0)), list(0.25, 0.0, 1.0, 0.5, 0.75))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "r", - "prompt": "# Given a positive integer n, return the product of the odd digits.\n# Return 0 if all digits are even.\n# For example:\n# >>> digits(1)\n# 1\n# >>> digits(4)\n# 0\n# >>> digits(235)\n# 15\ndigits <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- digits\n if(!identical(candidate(5), 5)){quit('no', 1)}\n if(!identical(candidate(54), 5)){quit('no', 1)}\n if(!identical(candidate(120), 1)){quit('no', 1)}\n if(!identical(candidate(5014), 5)){quit('no', 1)}\n if(!identical(candidate(98765), 315)){quit('no', 1)}\n if(!identical(candidate(5576543), 2625)){quit('no', 1)}\n if(!identical(candidate(2468), 0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "r", - "prompt": "# You will be given the name of a class (a string) and a list of extensions.\n# The extensions are to be used to load additional classes to the class. The\n# strength of the extension is as follows: Let CAP be the number of the uppercase\n# letters in the extension's name, and let SM be the number of lowercase letters \n# in the extension's name, the strength is given by the fraction CAP - SM. \n# You should find the strongest extension and return a string in this \n# format: ClassName.StrongestExtensionName.\n# If there are two or more extensions with the same strength, you should\n# choose the one that comes first in the list.\n# For example, if you are given \"Slices\" as the class and a list of the\n# extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n# return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n# (its strength is -1).\n# Example:\n# >>> Strongest_Extension('my_class', c('AA', 'Be', 'CC'))\n# 'my_class.AA'\nStrongest_Extension <- function(class_name, extensions) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- Strongest_Extension\n if(!identical(candidate('Watashi', c('tEN', 'niNE', 'eIGHt8OKe')), 'Watashi.eIGHt8OKe')){quit('no', 1)}\n if(!identical(candidate('Boku123', c('nani', 'NazeDa', 'YEs.WeCaNe', '32145tggg')), 'Boku123.YEs.WeCaNe')){quit('no', 1)}\n if(!identical(candidate('__YESIMHERE', c('t', 'eMptY', 'nothing', 'zeR00', 'NuLl__', '123NoooneB321')), '__YESIMHERE.NuLl__')){quit('no', 1)}\n if(!identical(candidate('K', c('Ta', 'TAR', 't234An', 'cosSo')), 'K.TAR')){quit('no', 1)}\n if(!identical(candidate('__HAHA', c('Tab', '123', '781345', '-_-')), '__HAHA.123')){quit('no', 1)}\n if(!identical(candidate('YameRore', c('HhAas', 'okIWILL123', 'WorkOut', 'Fails', '-_-')), 'YameRore.okIWILL123')){quit('no', 1)}\n if(!identical(candidate('finNNalLLly', c('Die', 'NowW', 'Wow', 'WoW')), 'finNNalLLly.WoW')){quit('no', 1)}\n if(!identical(candidate('_', c('Bb', '91245')), '_.Bb')){quit('no', 1)}\n if(!identical(candidate('Sp', c('671235', 'Bb')), 'Sp.671235')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "r", - "prompt": "# Given a string representing a space separated lowercase letters, return a dictionary\n# of the letter with the most repetition and containing the corresponding count.\n# If several letters have the same occurrence, return all of them.\n# Example:\n# >>> histogram('a b c')\n# list('a' = 1, 'b' = 1, 'c' = 1)\n# >>> histogram('a b b a')\n# list('a' = 2, 'b' = 2)\n# >>> histogram('a b c a b')\n# list('a' = 2, 'b' = 2)\n# >>> histogram('b b b b a')\n# list('b' = 4)\n# >>> histogram('')\n# list()\nhistogram <- function(test) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- histogram\n if(!identical(candidate('a b b a'), list('a' = 2, 'b' = 2))){quit('no', 1)}\n if(!identical(candidate('a b c a b'), list('a' = 2, 'b' = 2))){quit('no', 1)}\n if(!identical(candidate('a b c d g'), list('a' = 1, 'b' = 1, 'c' = 1, 'd' = 1, 'g' = 1))){quit('no', 1)}\n if(!identical(candidate('r t g'), list('r' = 1, 't' = 1, 'g' = 1))){quit('no', 1)}\n if(!identical(candidate('b b b b a'), list('b' = 4))){quit('no', 1)}\n if(!identical(candidate('r t g'), list('r' = 1, 't' = 1, 'g' = 1))){quit('no', 1)}\n if(!identical(candidate(''), list())){quit('no', 1)}\n if(!identical(candidate('a'), list('a' = 1))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "r", - "prompt": "# pairs_sum_to_zero takes a list of integers as an input.\n# it returns True if there are two distinct elements in the list that\n# sum to zero, and False otherwise.\n# >>> pairs_sum_to_zero(c(1, 3, 5, 0))\n# FALSE\n# >>> pairs_sum_to_zero(c(1, 3, -2, 1))\n# FALSE\n# >>> pairs_sum_to_zero(c(1, 2, 3, 7))\n# FALSE\n# >>> pairs_sum_to_zero(c(2, 4, -5, 3, 5, 7))\n# TRUE\n# >>> pairs_sum_to_zero(c(1))\n# FALSE\npairs_sum_to_zero <- function(l) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- pairs_sum_to_zero\n if(!identical(candidate(c(1, 3, 5, 0)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 3, -2, 1)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 7)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(2, 4, -5, 3, 5, 7)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(-3, 9, -1, 3, 2, 30)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(-3, 9, -1, 3, 2, 31)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(-3, 9, -1, 4, 2, 30)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(-3, 9, -1, 4, 2, 31)), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "r", - "prompt": "# Write a function that accepts two lists of strings and returns the list that has \n# total number of chars in the all strings of the list less than the other list.\n# if the two lists have the same number of chars, return the first list.\n# Examples\n# >>> total_match(c(), c())\n# list()\n# >>> total_match(c('hi', 'admin'), c('hI', 'Hi'))\n# list('hI', 'Hi')\n# >>> total_match(c('hi', 'admin'), c('hi', 'hi', 'admin', 'project'))\n# list('hi', 'admin')\n# >>> total_match(c('hi', 'admin'), c('hI', 'hi', 'hi'))\n# list('hI', 'hi', 'hi')\n# >>> total_match(c('4'), c('1', '2', '3', '4', '5'))\n# list('4')\ntotal_match <- function(lst1, lst2) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- total_match\n if(!identical(candidate(c(), c()), list())){quit('no', 1)}\n if(!identical(candidate(c('hi', 'admin'), c('hi', 'hi')), list('hi', 'hi'))){quit('no', 1)}\n if(!identical(candidate(c('hi', 'admin'), c('hi', 'hi', 'admin', 'project')), list('hi', 'admin'))){quit('no', 1)}\n if(!identical(candidate(c('4'), c('1', '2', '3', '4', '5')), list('4'))){quit('no', 1)}\n if(!identical(candidate(c('hi', 'admin'), c('hI', 'Hi')), list('hI', 'Hi'))){quit('no', 1)}\n if(!identical(candidate(c('hi', 'admin'), c('hI', 'hi', 'hi')), list('hI', 'hi', 'hi'))){quit('no', 1)}\n if(!identical(candidate(c('hi', 'admin'), c('hI', 'hi', 'hii')), list('hi', 'admin'))){quit('no', 1)}\n if(!identical(candidate(c(), c('this')), list())){quit('no', 1)}\n if(!identical(candidate(c('this'), c()), list())){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "r", - "prompt": "# Circular shift the digits of the integer x, shift the digits right by shift\n# and return the result as a string.\n# If shift > number of digits, return digits reversed.\n# >>> circular_shift(12, 1)\n# '21'\n# >>> circular_shift(12, 2)\n# '12'\ncircular_shift <- function(x, shift) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- circular_shift\n if(!identical(candidate(100, 2), '001')){quit('no', 1)}\n if(!identical(candidate(12, 2), '12')){quit('no', 1)}\n if(!identical(candidate(97, 8), '79')){quit('no', 1)}\n if(!identical(candidate(12, 1), '21')){quit('no', 1)}\n if(!identical(candidate(11, 101), '11')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "r", - "prompt": "# Return True is list elements are monotonically increasing or decreasing.\n# >>> monotonic(c(1, 2, 4, 20))\n# TRUE\n# >>> monotonic(c(1, 20, 4, 10))\n# FALSE\n# >>> monotonic(c(4, 1, 0, -10))\n# TRUE\nmonotonic <- function(l) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- monotonic\n if(!identical(candidate(c(1, 2, 4, 10)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 4, 20)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 20, 4, 10)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(4, 1, 0, -10)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(4, 1, 1, 0)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 2, 5, 60)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 5, 60)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(9, 9, 9, 9)), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "r", - "prompt": "# Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n# Example\n# >>> is_equal_to_sum_even(4)\n# FALSE\n# >>> is_equal_to_sum_even(6)\n# FALSE\n# >>> is_equal_to_sum_even(8)\n# TRUE\nis_equal_to_sum_even <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- is_equal_to_sum_even\n if(!identical(candidate(4), FALSE)){quit('no', 1)}\n if(!identical(candidate(6), FALSE)){quit('no', 1)}\n if(!identical(candidate(8), TRUE)){quit('no', 1)}\n if(!identical(candidate(10), TRUE)){quit('no', 1)}\n if(!identical(candidate(11), FALSE)){quit('no', 1)}\n if(!identical(candidate(12), TRUE)){quit('no', 1)}\n if(!identical(candidate(13), FALSE)){quit('no', 1)}\n if(!identical(candidate(16), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "r", - "prompt": "# Input to this function is a string representing musical notes in a special ASCII format.\n# Your task is to parse this string and return list of integers corresponding to how many beats does each\n# not last.\n# Here is a legend:\n# 'o' - whole note, lasts four beats\n# 'o|' - half note, lasts two beats\n# '.|' - quater note, lasts one beat\n# >>> parse_music('o o| .| o| o| .| .| .| .| o o')\n# list(4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4)\nparse_music <- function(music_string) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- parse_music\n if(!identical(candidate(''), list())){quit('no', 1)}\n if(!identical(candidate('o o o o'), list(4, 4, 4, 4))){quit('no', 1)}\n if(!identical(candidate('.| .| .| .|'), list(1, 1, 1, 1))){quit('no', 1)}\n if(!identical(candidate('o| o| .| .| o o o o'), list(2, 2, 1, 1, 4, 4, 4, 4))){quit('no', 1)}\n if(!identical(candidate('o| .| o| .| o o| o o|'), list(2, 1, 2, 1, 4, 2, 4, 2))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "r", - "prompt": "# \"\n# This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n# multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n# change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n# Examples:\n# >>> lst\n# list(1, 2, 3)\n# >>> lst\n# list()\n# >>> lst\n# list(-1, -5, 2, -1, -5)\nsum_squares <- function(lst) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- sum_squares\n if(!identical(candidate(c(1, 2, 3)), 6)){quit('no', 1)}\n if(!identical(candidate(c(1, 4, 9)), 14)){quit('no', 1)}\n if(!identical(candidate(c()), 0)){quit('no', 1)}\n if(!identical(candidate(c(1, 1, 1, 1, 1, 1, 1, 1, 1)), 9)){quit('no', 1)}\n if(!identical(candidate(c(-1, -1, -1, -1, -1, -1, -1, -1, -1)), -3)){quit('no', 1)}\n if(!identical(candidate(c(0)), 0)){quit('no', 1)}\n if(!identical(candidate(c(-1, -5, 2, -1, -5)), -126)){quit('no', 1)}\n if(!identical(candidate(c(-56, -99, 1, 0, -2)), 3030)){quit('no', 1)}\n if(!identical(candidate(c(-1, 0, 0, 0, 0, 0, 0, 0, -1)), 0)){quit('no', 1)}\n if(!identical(candidate(c(-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37)), -14196)){quit('no', 1)}\n if(!identical(candidate(c(-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10)), -1448)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "r", - "prompt": "# triples_sum_to_zero takes a list of integers as an input.\n# it returns True if there are three distinct elements in the list that\n# sum to zero, and False otherwise.\n# >>> triples_sum_to_zero(c(1, 3, 5, 0))\n# FALSE\n# >>> triples_sum_to_zero(c(1, 3, -2, 1))\n# TRUE\n# >>> triples_sum_to_zero(c(1, 2, 3, 7))\n# FALSE\n# >>> triples_sum_to_zero(c(2, 4, -5, 3, 9, 7))\n# TRUE\n# >>> triples_sum_to_zero(c(1))\n# FALSE\ntriples_sum_to_zero <- function(l) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- triples_sum_to_zero\n if(!identical(candidate(c(1, 3, 5, 0)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 3, 5, -1)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 3, -2, 1)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 7)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 5, 7)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(2, 4, -5, 3, 9, 7)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 3, 5, -100)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(100, 3, 5, -100)), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "r", - "prompt": "# brackets is a string of \"<\" and \">\".\n# return True if every opening bracket has a corresponding closing bracket.\n# >>> correct_bracketing('<')\n# FALSE\n# >>> correct_bracketing('<>')\n# TRUE\n# >>> correct_bracketing('<<><>>')\n# TRUE\n# >>> correct_bracketing('><<>')\n# FALSE\ncorrect_bracketing <- function(brackets) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- correct_bracketing\n if(!identical(candidate('<>'), TRUE)){quit('no', 1)}\n if(!identical(candidate('<<><>>'), TRUE)){quit('no', 1)}\n if(!identical(candidate('<><><<><>><>'), TRUE)){quit('no', 1)}\n if(!identical(candidate('<><><<<><><>><>><<><><<>>>'), TRUE)){quit('no', 1)}\n if(!identical(candidate('<<<><>>>>'), FALSE)){quit('no', 1)}\n if(!identical(candidate('><<>'), FALSE)){quit('no', 1)}\n if(!identical(candidate('<'), FALSE)){quit('no', 1)}\n if(!identical(candidate('<<<<'), FALSE)){quit('no', 1)}\n if(!identical(candidate('>'), FALSE)){quit('no', 1)}\n if(!identical(candidate('<<>'), FALSE)){quit('no', 1)}\n if(!identical(candidate('<><><<><>><>><<>'), FALSE)){quit('no', 1)}\n if(!identical(candidate('<><><<><>><>>><>'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "r", - "prompt": "# Write a function that takes an array of numbers as input and returns \n# the number of elements in the array that are greater than 10 and both \n# first and last digits of a number are odd (1, 3, 5, 7, 9).\n# For example:\n# >>> specialFilter(c(15, -73, 14, -15))\n# 1\n# >>> specialFilter(c(33, -2, -3, 45, 21, 109))\n# 2\nspecialFilter <- function(nums) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- specialFilter\n if(!identical(candidate(c(5, -2, 1, -5)), 0)){quit('no', 1)}\n if(!identical(candidate(c(15, -73, 14, -15)), 1)){quit('no', 1)}\n if(!identical(candidate(c(33, -2, -3, 45, 21, 109)), 2)){quit('no', 1)}\n if(!identical(candidate(c(43, -12, 93, 125, 121, 109)), 4)){quit('no', 1)}\n if(!identical(candidate(c(71, -2, -33, 75, 21, 19)), 3)){quit('no', 1)}\n if(!identical(candidate(c(1)), 0)){quit('no', 1)}\n if(!identical(candidate(c()), 0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "r", - "prompt": "# Given a dictionary, return True if all keys are strings in lower \n# case or all keys are strings in upper case, else return False.\n# The function should return False is the given dictionary is empty.\n# Examples:\n# >>> check_dict_case(list('a' = 'apple', 'b' = 'banana'))\n# TRUE\n# >>> check_dict_case(list('a' = 'apple', 'A' = 'banana', 'B' = 'banana'))\n# FALSE\n# >>> check_dict_case(list('a' = 'apple', 8 = 'banana', 'a' = 'apple'))\n# FALSE\n# >>> check_dict_case(list('Name' = 'John', 'Age' = '36', 'City' = 'Houston'))\n# FALSE\n# >>> check_dict_case(list('STATE' = 'NC', 'ZIP' = '12345'))\n# TRUE\ncheck_dict_case <- function(dict) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- check_dict_case\n if(!identical(candidate(list('p' = 'pineapple', 'b' = 'banana')), TRUE)){quit('no', 1)}\n if(!identical(candidate(list('p' = 'pineapple', 'A' = 'banana', 'B' = 'banana')), FALSE)){quit('no', 1)}\n if(!identical(candidate(list('p' = 'pineapple', '5' = 'banana', 'a' = 'apple')), FALSE)){quit('no', 1)}\n if(!identical(candidate(list('Name' = 'John', 'Age' = '36', 'City' = 'Houston')), FALSE)){quit('no', 1)}\n if(!identical(candidate(list('STATE' = 'NC', 'ZIP' = '12345')), TRUE)){quit('no', 1)}\n if(!identical(candidate(list('fruit' = 'Orange', 'taste' = 'Sweet')), TRUE)){quit('no', 1)}\n if(!identical(candidate(list()), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "r", - "prompt": "# Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n# should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n# alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n# Examples\n# >>> split_words('Hello world!')\n# list('Hello', 'world!')\n# >>> split_words('Hello,world!')\n# list('Hello', 'world!')\n# >>> split_words('abcdef')\n# 3\nsplit_words <- function(txt) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- split_words\n if(!identical(candidate('Hello world!'), list('Hello', 'world!'))){quit('no', 1)}\n if(!identical(candidate('Hello,world!'), list('Hello', 'world!'))){quit('no', 1)}\n if(!identical(candidate('Hello world,!'), list('Hello', 'world,!'))){quit('no', 1)}\n if(!identical(candidate('Hello,Hello,world !'), list('Hello,Hello,world', '!'))){quit('no', 1)}\n if(!identical(candidate('abcdef'), 3)){quit('no', 1)}\n if(!identical(candidate('aaabb'), 2)){quit('no', 1)}\n if(!identical(candidate('aaaBb'), 1)){quit('no', 1)}\n if(!identical(candidate(''), 0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "r", - "prompt": "# The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fibfib(0) == 0\n# fibfib(1) == 0\n# fibfib(2) == 1\n# fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n# Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n# >>> fibfib(1)\n# 0\n# >>> fibfib(5)\n# 4\n# >>> fibfib(8)\n# 24\nfibfib <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- fibfib\n if(!identical(candidate(2), 1)){quit('no', 1)}\n if(!identical(candidate(1), 0)){quit('no', 1)}\n if(!identical(candidate(5), 4)){quit('no', 1)}\n if(!identical(candidate(8), 24)){quit('no', 1)}\n if(!identical(candidate(10), 81)){quit('no', 1)}\n if(!identical(candidate(12), 274)){quit('no', 1)}\n if(!identical(candidate(14), 927)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "r", - "prompt": "# You are given a list of numbers.\n# You need to return the sum of squared numbers in the given list,\n# round each element in the list to the upper int(Ceiling) first.\n# Examples:\n# >>> lst(c(1.0, 2.0, 3.0))\n# 14\n# >>> lst(c(1.0, 4.0, 9.0))\n# 98\n# >>> lst(c(1.0, 3.0, 5.0, 7.0))\n# 84\n# >>> lst(c(1.4, 4.2, 0.0))\n# 29\n# >>> lst(c(-2.4, 1.0, 1.0))\n# 6\nsum_squares <- function(lst) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- sum_squares\n if(!identical(candidate(c(1.0, 2.0, 3.0)), 14)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 2.0, 3.0)), 14)){quit('no', 1)}\n if(!identical(candidate(c(1.0, 3.0, 5.0, 7.0)), 84)){quit('no', 1)}\n if(!identical(candidate(c(1.4, 4.2, 0.0)), 29)){quit('no', 1)}\n if(!identical(candidate(c(-2.4, 1.0, 1.0)), 6)){quit('no', 1)}\n if(!identical(candidate(c(100.0, 1.0, 15.0, 2.0)), 10230)){quit('no', 1)}\n if(!identical(candidate(c(10000.0, 10000.0)), 200000000)){quit('no', 1)}\n if(!identical(candidate(c(-1.4, 4.6, 6.3)), 75)){quit('no', 1)}\n if(!identical(candidate(c(-1.4, 17.9, 18.9, 19.9)), 1086)){quit('no', 1)}\n if(!identical(candidate(c(0.0)), 0)){quit('no', 1)}\n if(!identical(candidate(c(-1.0)), 1)){quit('no', 1)}\n if(!identical(candidate(c(-1.0, 1.0, 0.0)), 2)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_85_add", - "language": "r", - "prompt": "# Given a non-empty list of integers lst. add the even elements that are at odd indices..\n# Examples:\n# >>> add(c(4, 2, 6, 7))\n# 2\nadd <- function(lst) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- add\n if(!identical(candidate(c(4, 88)), 88)){quit('no', 1)}\n if(!identical(candidate(c(4, 5, 6, 7, 2, 122)), 122)){quit('no', 1)}\n if(!identical(candidate(c(4, 0, 6, 7)), 0)){quit('no', 1)}\n if(!identical(candidate(c(4, 4, 6, 8)), 12)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "r", - "prompt": "# Return sorted unique elements in a list\n# >>> unique(c(5, 3, 5, 2, 3, 3, 9, 0, 123))\n# list(0, 2, 3, 5, 9, 123)\nunique <- function(l) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- unique\n if(!identical(candidate(c(5, 3, 5, 2, 3, 3, 9, 0, 123)), list(0, 2, 3, 5, 9, 123))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "r", - "prompt": "# Given a string text, replace all spaces in it with underscores, \n# and if a string has more than 2 consecutive spaces, \n# then replace all consecutive spaces with - \n# >>> fix_spaces(' Example')\n# 'Example'\n# >>> fix_spaces(' Example 1')\n# 'Example_1'\n# >>> fix_spaces(' Example 2')\n# '_Example_2'\n# >>> fix_spaces(' Example 3')\n# '_Example-3'\nfix_spaces <- function(text) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- fix_spaces\n if(!identical(candidate('Example'), 'Example')){quit('no', 1)}\n if(!identical(candidate('Mudasir Hanif '), 'Mudasir_Hanif_')){quit('no', 1)}\n if(!identical(candidate('Yellow Yellow Dirty Fellow'), 'Yellow_Yellow__Dirty__Fellow')){quit('no', 1)}\n if(!identical(candidate('Exa mple'), 'Exa-mple')){quit('no', 1)}\n if(!identical(candidate(' Exa 1 2 2 mple'), '-Exa_1_2_2_mple')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "r", - "prompt": "# Return 2^n modulo p (be aware of numerics).\n# >>> modp(3, 5)\n# 3\n# >>> modp(1101, 101)\n# 2\n# >>> modp(0, 101)\n# 1\n# >>> modp(3, 11)\n# 8\n# >>> modp(100, 101)\n# 1\nmodp <- function(n, p) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- modp\n if(!identical(candidate(3, 5), 3)){quit('no', 1)}\n if(!identical(candidate(1101, 101), 2)){quit('no', 1)}\n if(!identical(candidate(0, 101), 1)){quit('no', 1)}\n if(!identical(candidate(3, 11), 8)){quit('no', 1)}\n if(!identical(candidate(100, 101), 1)){quit('no', 1)}\n if(!identical(candidate(30, 5), 4)){quit('no', 1)}\n if(!identical(candidate(31, 5), 3)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "r", - "prompt": "# You have to write a function which validates a given date string and\n# returns True if the date is valid otherwise False.\n# The date is valid if all of the following rules are satisfied:\n# 1. The date string is not empty.\n# 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n# 3. The months should not be less than 1 or higher than 12.\n# 4. The date should be in the format: mm-dd-yyyy\n# >>> valid_date('03-11-2000')\n# TRUE\n# >>> valid_date('15-01-2012')\n# FALSE\n# >>> valid_date('04-0-2040')\n# FALSE\n# >>> valid_date('06-04-2020')\n# TRUE\n# >>> valid_date('06/04/2020')\n# FALSE\nvalid_date <- function(date) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- valid_date\n if(!identical(candidate('03-11-2000'), TRUE)){quit('no', 1)}\n if(!identical(candidate('15-01-2012'), FALSE)){quit('no', 1)}\n if(!identical(candidate('04-0-2040'), FALSE)){quit('no', 1)}\n if(!identical(candidate('06-04-2020'), TRUE)){quit('no', 1)}\n if(!identical(candidate('01-01-2007'), TRUE)){quit('no', 1)}\n if(!identical(candidate('03-32-2011'), FALSE)){quit('no', 1)}\n if(!identical(candidate(''), FALSE)){quit('no', 1)}\n if(!identical(candidate('04-31-3000'), FALSE)){quit('no', 1)}\n if(!identical(candidate('06-06-2005'), TRUE)){quit('no', 1)}\n if(!identical(candidate('21-31-2000'), FALSE)){quit('no', 1)}\n if(!identical(candidate('04-12-2003'), TRUE)){quit('no', 1)}\n if(!identical(candidate('04122003'), FALSE)){quit('no', 1)}\n if(!identical(candidate('20030412'), FALSE)){quit('no', 1)}\n if(!identical(candidate('2003-04'), FALSE)){quit('no', 1)}\n if(!identical(candidate('2003-04-12'), FALSE)){quit('no', 1)}\n if(!identical(candidate('04-2003'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "r", - "prompt": "# Write a function that takes a string and returns an ordered version of it.\n# Ordered version of string, is a string where all words (separated by space)\n# are replaced by a new word where all the characters arranged in\n# ascending order based on ascii value.\n# Note: You should keep the order of words and blank spaces in the sentence.\n# For example:\n# >>> anti_shuffle('Hi')\n# 'Hi'\n# >>> anti_shuffle('hello')\n# 'ehllo'\n# >>> anti_shuffle('Hello World!!!')\n# 'Hello !!!Wdlor'\nanti_shuffle <- function(s) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- anti_shuffle\n if(!identical(candidate('Hi'), 'Hi')){quit('no', 1)}\n if(!identical(candidate('hello'), 'ehllo')){quit('no', 1)}\n if(!identical(candidate('number'), 'bemnru')){quit('no', 1)}\n if(!identical(candidate('abcd'), 'abcd')){quit('no', 1)}\n if(!identical(candidate('Hello World!!!'), 'Hello !!!Wdlor')){quit('no', 1)}\n if(!identical(candidate(''), '')){quit('no', 1)}\n if(!identical(candidate('Hi. My name is Mister Robot. How are you?'), '.Hi My aemn is Meirst .Rboot How aer ?ouy')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "r", - "prompt": "# Given a list of numbers, return whether or not they are sorted\n# in ascending order. If list has more than 1 duplicate of the same\n# number, return False. Assume no negative numbers and only integers.\n# Examples\n# >>> is_sorted(c(5))\n# TRUE\n# >>> is_sorted(c(1, 2, 3, 4, 5))\n# TRUE\n# >>> is_sorted(c(1, 3, 2, 4, 5))\n# FALSE\n# >>> is_sorted(c(1, 2, 3, 4, 5, 6))\n# TRUE\n# >>> is_sorted(c(1, 2, 3, 4, 5, 6, 7))\n# TRUE\n# >>> is_sorted(c(1, 3, 2, 4, 5, 6, 7))\n# FALSE\n# >>> is_sorted(c(1, 2, 2, 3, 3, 4))\n# TRUE\n# >>> is_sorted(c(1, 2, 2, 2, 3, 4))\n# FALSE\nis_sorted <- function(lst) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- is_sorted\n if(!identical(candidate(c(5)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 5)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 3, 2, 4, 5)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 5, 6)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 5, 6, 7)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 3, 2, 4, 5, 6, 7)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c()), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 1)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 2, 2, 3, 4)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 3, 3, 4)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 2, 3, 3, 4)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4)), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "r", - "prompt": "# You are given a string s.\n# Your task is to check if the string is happy or not.\n# A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n# For example:\n# >>> is_happy('a')\n# FALSE\n# >>> is_happy('aa')\n# FALSE\n# >>> is_happy('abcd')\n# TRUE\n# >>> is_happy('aabb')\n# FALSE\n# >>> is_happy('adb')\n# TRUE\n# >>> is_happy('xyy')\n# FALSE\nis_happy <- function(s) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- is_happy\n if(!identical(candidate('a'), FALSE)){quit('no', 1)}\n if(!identical(candidate('aa'), FALSE)){quit('no', 1)}\n if(!identical(candidate('abcd'), TRUE)){quit('no', 1)}\n if(!identical(candidate('aabb'), FALSE)){quit('no', 1)}\n if(!identical(candidate('adb'), TRUE)){quit('no', 1)}\n if(!identical(candidate('xyy'), FALSE)){quit('no', 1)}\n if(!identical(candidate('iopaxpoi'), TRUE)){quit('no', 1)}\n if(!identical(candidate('iopaxioi'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "r", - "prompt": "# Write a function that returns True if the object q will fly, and False otherwise.\n# The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n# Example:\n# >>> will_it_fly(c(1, 2), 5)\n# FALSE\n# # 1+2 is less than the maximum possible weight, but it's unbalanced.\n# >>> will_it_fly(c(3, 2, 3), 1)\n# FALSE\n# # it's balanced, but 3+2+3 is more than the maximum possible weight.\n# >>> will_it_fly(c(3, 2, 3), 9)\n# TRUE\n# # 3+2+3 is less than the maximum possible weight, and it's balanced.\n# >>> will_it_fly(c(3), 5)\n# TRUE\n# # 3 is less than the maximum possible weight, and it's balanced.\nwill_it_fly <- function(q, w) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- will_it_fly\n if(!identical(candidate(c(3, 2, 3), 9), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2), 5), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(3), 5), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(3, 2, 3), 1), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3), 6), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(5), 5), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "r", - "prompt": "# Given an array of non-negative integers, return a copy of the given array after sorting,\n# you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n# or sort it in descending order if the sum( first index value, last index value) is even.\n# Note:\n# * don't change the given array.\n# Examples:\n# >>> sort_array(c())\n# list()\n# >>> sort_array(c(5))\n# list(5)\n# >>> sort_array(c(2, 4, 3, 0, 1, 5))\n# list(0, 1, 2, 3, 4, 5)\n# >>> sort_array(c(2, 4, 3, 0, 1, 5, 6))\n# list(6, 5, 4, 3, 2, 1, 0)\nsort_array <- function(array) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- sort_array\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(5)), list(5))){quit('no', 1)}\n if(!identical(candidate(c(2, 4, 3, 0, 1, 5)), list(0, 1, 2, 3, 4, 5))){quit('no', 1)}\n if(!identical(candidate(c(2, 4, 3, 0, 1, 5, 6)), list(6, 5, 4, 3, 2, 1, 0))){quit('no', 1)}\n if(!identical(candidate(c(2, 1)), list(1, 2))){quit('no', 1)}\n if(!identical(candidate(c(15, 42, 87, 32, 11, 0)), list(0, 11, 15, 32, 42, 87))){quit('no', 1)}\n if(!identical(candidate(c(21, 14, 23, 11)), list(23, 21, 14, 11))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "r", - "prompt": "# Implement a function that takes an non-negative integer and returns an array of the first n\n# integers that are prime numbers and less than n.\n# for example:\n# >>> count_up_to(5)\n# list(2, 3)\n# >>> count_up_to(11)\n# list(2, 3, 5, 7)\n# >>> count_up_to(0)\n# list()\n# >>> count_up_to(20)\n# list(2, 3, 5, 7, 11, 13, 17, 19)\n# >>> count_up_to(1)\n# list()\n# >>> count_up_to(18)\n# list(2, 3, 5, 7, 11, 13, 17)\ncount_up_to <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- count_up_to\n if(!identical(candidate(5), list(2, 3))){quit('no', 1)}\n if(!identical(candidate(6), list(2, 3, 5))){quit('no', 1)}\n if(!identical(candidate(7), list(2, 3, 5))){quit('no', 1)}\n if(!identical(candidate(10), list(2, 3, 5, 7))){quit('no', 1)}\n if(!identical(candidate(0), list())){quit('no', 1)}\n if(!identical(candidate(22), list(2, 3, 5, 7, 11, 13, 17, 19))){quit('no', 1)}\n if(!identical(candidate(1), list())){quit('no', 1)}\n if(!identical(candidate(18), list(2, 3, 5, 7, 11, 13, 17))){quit('no', 1)}\n if(!identical(candidate(47), list(2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43))){quit('no', 1)}\n if(!identical(candidate(101), list(2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "r", - "prompt": "# Out of list of strings, return the longest one. Return the first one in case of multiple\n# strings of the same length. Return None in case the input list is empty.\n# >>> longest(c())\n# NULL\n# >>> longest(c('a', 'b', 'c'))\n# 'a'\n# >>> longest(c('a', 'bb', 'ccc'))\n# 'ccc'\nlongest <- function(strings) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- longest\n if(!identical(candidate(c()), NULL)){quit('no', 1)}\n if(!identical(candidate(c('x', 'y', 'z')), 'x')){quit('no', 1)}\n if(!identical(candidate(c('x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc')), 'zzzz')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "r", - "prompt": "# Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n# reverse the resulting array, and then replace each digit by its corresponding name from\n# \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n# For example:\n# >>> by_length(c(2, 1, 1, 4, 5, 8, 2, 3))\n# list('Eight', 'Five', 'Four', 'Three', 'Two', 'Two', 'One', 'One')\n# If the array is empty, return an empty array:\n# >>> by_length(c())\n# list()\n# If the array has any strange number ignore it:\n# >>> by_length(c(1, -1, 55))\n# list('One')\nby_length <- function(arr) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- by_length\n if(!identical(candidate(c(2, 1, 1, 4, 5, 8, 2, 3)), list('Eight', 'Five', 'Four', 'Three', 'Two', 'Two', 'One', 'One'))){quit('no', 1)}\n if(!identical(candidate(c()), list())){quit('no', 1)}\n if(!identical(candidate(c(1, -1, 55)), list('One'))){quit('no', 1)}\n if(!identical(candidate(c(1, -1, 3, 2)), list('Three', 'Two', 'One'))){quit('no', 1)}\n if(!identical(candidate(c(9, 4, 8)), list('Nine', 'Eight', 'Four'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_106_f", - "language": "r", - "prompt": "# Implement the function f that takes n as a parameter,\n# 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\n# or the sum of numbers from 1 to i otherwise.\n# i starts from 1.\n# the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n# Example:\n# >>> f(5)\n# list(1, 2, 6, 24, 15)\nf <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- f\n if(!identical(candidate(5), list(1, 2, 6, 24, 15))){quit('no', 1)}\n if(!identical(candidate(7), list(1, 2, 6, 24, 15, 720, 28))){quit('no', 1)}\n if(!identical(candidate(1), list(1))){quit('no', 1)}\n if(!identical(candidate(3), list(1, 2, 6))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "r", - "prompt": "# Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n# >>> fizz_buzz(50)\n# 0\n# >>> fizz_buzz(78)\n# 2\n# >>> fizz_buzz(79)\n# 3\nfizz_buzz <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- fizz_buzz\n if(!identical(candidate(50), 0)){quit('no', 1)}\n if(!identical(candidate(78), 2)){quit('no', 1)}\n if(!identical(candidate(79), 3)){quit('no', 1)}\n if(!identical(candidate(100), 3)){quit('no', 1)}\n if(!identical(candidate(200), 6)){quit('no', 1)}\n if(!identical(candidate(4000), 192)){quit('no', 1)}\n if(!identical(candidate(10000), 639)){quit('no', 1)}\n if(!identical(candidate(100000), 8026)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "r", - "prompt": "# Given a positive floating point number, it can be decomposed into\n# and integer part (largest integer smaller than given number) and decimals\n# (leftover part always smaller than 1).\n# Return the decimal part of the number.\n# >>> truncate_number(3.5)\n# 0.5\ntruncate_number <- function(number) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- truncate_number\n if(!identical(candidate(3.5), 0.5)){quit('no', 1)}\n if(!identical(candidate(1.25), 0.25)){quit('no', 1)}\n if(!identical(candidate(123.0), 0.0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "r", - "prompt": "# For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n# Empty sum should be equal to 0 and empty product should be equal to 1.\n# >>> sum_product(c())\n# list(0, 1)\n# >>> sum_product(c(1, 2, 3, 4))\n# list(10, 24)\nsum_product <- function(numbers) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- sum_product\n if(!identical(candidate(c()), list(0, 1))){quit('no', 1)}\n if(!identical(candidate(c(1, 1, 1)), list(3, 1))){quit('no', 1)}\n if(!identical(candidate(c(100, 0)), list(100, 0))){quit('no', 1)}\n if(!identical(candidate(c(3, 5, 7)), list(15, 105))){quit('no', 1)}\n if(!identical(candidate(c(10)), list(10, 10))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "r", - "prompt": "# You are given a 2 dimensional data, as a nested lists,\n# which is similar to matrix, however, unlike matrices,\n# each row may contain a different number of columns.\n# Given lst, and integer x, find integers x in the list,\n# and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n# each tuple is a coordinate - (row, columns), starting with 0.\n# Sort coordinates initially by rows in ascending order.\n# Also, sort coordinates of the row by columns in descending order.\n# Examples:\n# >>> get_row(list(list(1, 2, 3, 4, 5, 6), list(1, 2, 3, 4, 1, 6), list(1, 2, 3, 4, 5, 1)), 1)\n# list(list(0, 0), list(1, 4), list(1, 0), list(2, 5), list(2, 0))\n# >>> get_row(list(), 1)\n# list()\n# >>> get_row(list(list(), list(1), list(1, 2, 3)), 3)\n# list(list(2, 2))\nget_row <- function(lst, x) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- get_row\n if(!identical(candidate(list(list(1, 2, 3, 4, 5, 6), list(1, 2, 3, 4, 1, 6), list(1, 2, 3, 4, 5, 1)), 1), list(list(0, 0), list(1, 4), list(1, 0), list(2, 5), list(2, 0)))){quit('no', 1)}\n if(!identical(candidate(list(list(1, 2, 3, 4, 5, 6), list(1, 2, 3, 4, 5, 6), list(1, 2, 3, 4, 5, 6), list(1, 2, 3, 4, 5, 6), list(1, 2, 3, 4, 5, 6), list(1, 2, 3, 4, 5, 6)), 2), list(list(0, 1), list(1, 1), list(2, 1), list(3, 1), list(4, 1), list(5, 1)))){quit('no', 1)}\n if(!identical(candidate(list(list(1, 2, 3, 4, 5, 6), list(1, 2, 3, 4, 5, 6), list(1, 1, 3, 4, 5, 6), list(1, 2, 1, 4, 5, 6), list(1, 2, 3, 1, 5, 6), list(1, 2, 3, 4, 1, 6), list(1, 2, 3, 4, 5, 1)), 1), list(list(0, 0), list(1, 0), list(2, 1), list(2, 0), list(3, 2), list(3, 0), list(4, 3), list(4, 0), list(5, 4), list(5, 0), list(6, 5), list(6, 0)))){quit('no', 1)}\n if(!identical(candidate(list(), 1), list())){quit('no', 1)}\n if(!identical(candidate(list(list(1)), 2), list())){quit('no', 1)}\n if(!identical(candidate(list(list(), list(1), list(1, 2, 3)), 3), list(list(2, 2)))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "r", - "prompt": "# You're a hungry rabbit, and you already have eaten a certain number of carrots,\n# but now you need to eat more carrots to complete the day's meals.\n# you should return an array of [ total number of eaten carrots after your meals,\n# the number of carrots left after your meals ]\n# if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n# Example:\n# >>> eat(5, 6, 10)\n# list(11, 4)\n# >>> eat(4, 8, 9)\n# list(12, 1)\n# >>> eat(1, 10, 10)\n# list(11, 0)\n# >>> eat(2, 11, 5)\n# list(7, 0)\n# Variables:\n# @number : integer\n# the number of carrots that you have eaten.\n# @need : integer\n# the number of carrots that you need to eat.\n# @remaining : integer\n# the number of remaining carrots thet exist in stock\n# Constrain:\n# * 0 <= number <= 1000\n# * 0 <= need <= 1000\n# * 0 <= remaining <= 1000\n# Have fun :)\neat <- function(number, need, remaining) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- eat\n if(!identical(candidate(5, 6, 10), list(11, 4))){quit('no', 1)}\n if(!identical(candidate(4, 8, 9), list(12, 1))){quit('no', 1)}\n if(!identical(candidate(1, 10, 10), list(11, 0))){quit('no', 1)}\n if(!identical(candidate(2, 11, 5), list(7, 0))){quit('no', 1)}\n if(!identical(candidate(4, 5, 7), list(9, 2))){quit('no', 1)}\n if(!identical(candidate(4, 5, 1), list(5, 0))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "r", - "prompt": "# Given a positive integer N, return the total sum of its digits in binary.\n# Example\n# >>> solve(1000)\n# '1'\n# >>> solve(150)\n# '110'\n# >>> solve(147)\n# '1100'\n# Variables:\n# @N integer\n# Constraints: 0 \u2264 N \u2264 10000.\n# Output:\n# a string of binary number\nsolve <- function(N) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- solve\n if(!identical(candidate(1000), '1')){quit('no', 1)}\n if(!identical(candidate(150), '110')){quit('no', 1)}\n if(!identical(candidate(147), '1100')){quit('no', 1)}\n if(!identical(candidate(333), '1001')){quit('no', 1)}\n if(!identical(candidate(963), '10010')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "r", - "prompt": "# You are given a list of integers.\n# You need to find the largest prime value and return the sum of its digits.\n# Examples:\n# >>> skjkasdkd(c(0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3))\n# 10\n# >>> skjkasdkd(c(1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1))\n# 25\n# >>> skjkasdkd(c(1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3))\n# 13\n# >>> skjkasdkd(c(0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6))\n# 11\n# >>> skjkasdkd(c(0, 81, 12, 3, 1, 21))\n# 3\n# >>> skjkasdkd(c(0, 8, 1, 2, 1, 7))\n# 7\nskjkasdkd <- function(lst) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- skjkasdkd\n if(!identical(candidate(c(0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3)), 10)){quit('no', 1)}\n if(!identical(candidate(c(1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1)), 25)){quit('no', 1)}\n if(!identical(candidate(c(1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3)), 13)){quit('no', 1)}\n if(!identical(candidate(c(0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6)), 11)){quit('no', 1)}\n if(!identical(candidate(c(0, 81, 12, 3, 1, 21)), 3)){quit('no', 1)}\n if(!identical(candidate(c(0, 8, 1, 2, 1, 7)), 7)){quit('no', 1)}\n if(!identical(candidate(c(8191)), 19)){quit('no', 1)}\n if(!identical(candidate(c(8191, 123456, 127, 7)), 19)){quit('no', 1)}\n if(!identical(candidate(c(127, 97, 8192)), 10)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "r", - "prompt": "# Given an array arr of integers, find the minimum number of elements that\n# need to be changed to make the array palindromic. A palindromic array is an array that\n# is read the same backwards and forwards. In one change, you can change one element to any other element.\n# For example:\n# >>> smallest_change(c(1, 2, 3, 5, 4, 7, 9, 6))\n# 4\n# >>> smallest_change(c(1, 2, 3, 4, 3, 2, 2))\n# 1\n# >>> smallest_change(c(1, 2, 3, 2, 1))\n# 0\nsmallest_change <- function(arr) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- smallest_change\n if(!identical(candidate(c(1, 2, 3, 5, 4, 7, 9, 6)), 4)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 4, 3, 2, 2)), 1)){quit('no', 1)}\n if(!identical(candidate(c(1, 4, 2)), 1)){quit('no', 1)}\n if(!identical(candidate(c(1, 4, 4, 2)), 1)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, 3, 2, 1)), 0)){quit('no', 1)}\n if(!identical(candidate(c(3, 1, 1, 3)), 0)){quit('no', 1)}\n if(!identical(candidate(c(1)), 0)){quit('no', 1)}\n if(!identical(candidate(c(0, 1)), 1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "r", - "prompt": "# It is the last week of the semester and the teacher has to give the grades\n# to students. The teacher has been making her own algorithm for grading.\n# The only problem is, she has lost the code she used for grading.\n# She has given you a list of GPAs for some students and you have to write \n# a function that can output a list of letter grades using the following table:\n# GPA | Letter grade\n# 4.0 A+\n# > 3.7 A \n# > 3.3 A- \n# > 3.0 B+\n# > 2.7 B \n# > 2.3 B-\n# > 2.0 C+\n# > 1.7 C\n# > 1.3 C-\n# > 1.0 D+ \n# > 0.7 D \n# > 0.0 D-\n# 0.0 E\n# Example:\n# >>> grade_equation(c(4.0, 3, 1.7, 2, 3.5))\n# list('A+', 'B', 'C-', 'C', 'A-')\nnumerical_letter_grade <- function(grades) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- numerical_letter_grade\n if(!identical(candidate(c(4.0, 3, 1.7, 2, 3.5)), list('A+', 'B', 'C-', 'C', 'A-'))){quit('no', 1)}\n if(!identical(candidate(c(1.2)), list('D+'))){quit('no', 1)}\n if(!identical(candidate(c(0.5)), list('D-'))){quit('no', 1)}\n if(!identical(candidate(c(0.0)), list('E'))){quit('no', 1)}\n if(!identical(candidate(c(1.0, 0.3, 1.5, 2.8, 3.3)), list('D', 'D-', 'C-', 'B', 'B+'))){quit('no', 1)}\n if(!identical(candidate(c(0.0, 0.7)), list('E', 'D-'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "r", - "prompt": "# Given the lengths of the three sides of a triangle. Return the area of\n# the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n# Otherwise return -1\n# Three sides make a valid triangle when the sum of any two sides is greater \n# than the third side.\n# Example:\n# >>> triangle_area(3, 4, 5)\n# 6.0\n# >>> triangle_area(1, 2, 10)\n# -1\ntriangle_area <- function(a, b, c) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- triangle_area\n if(!identical(candidate(3, 4, 5), 6.0)){quit('no', 1)}\n if(!identical(candidate(1, 2, 10), -1)){quit('no', 1)}\n if(!identical(candidate(4, 8, 5), 8.18)){quit('no', 1)}\n if(!identical(candidate(2, 2, 2), 1.73)){quit('no', 1)}\n if(!identical(candidate(1, 2, 3), -1)){quit('no', 1)}\n if(!identical(candidate(10, 5, 7), 16.25)){quit('no', 1)}\n if(!identical(candidate(2, 6, 3), -1)){quit('no', 1)}\n if(!identical(candidate(1, 1, 1), 0.43)){quit('no', 1)}\n if(!identical(candidate(2, 2, 10), -1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "r", - "prompt": "# Check if two words have the same characters.\n# >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n# TRUE\n# >>> same_chars('abcd', 'dddddddabc')\n# TRUE\n# >>> same_chars('dddddddabc', 'abcd')\n# TRUE\n# >>> same_chars('eabcd', 'dddddddabc')\n# FALSE\n# >>> same_chars('abcd', 'dddddddabce')\n# FALSE\n# >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc')\n# FALSE\nsame_chars <- function(s0, s1) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- same_chars\n if(!identical(candidate('eabcdzzzz', 'dddzzzzzzzddeddabc'), TRUE)){quit('no', 1)}\n if(!identical(candidate('abcd', 'dddddddabc'), TRUE)){quit('no', 1)}\n if(!identical(candidate('dddddddabc', 'abcd'), TRUE)){quit('no', 1)}\n if(!identical(candidate('eabcd', 'dddddddabc'), FALSE)){quit('no', 1)}\n if(!identical(candidate('abcd', 'dddddddabcf'), FALSE)){quit('no', 1)}\n if(!identical(candidate('eabcdzzzz', 'dddzzzzzzzddddabc'), FALSE)){quit('no', 1)}\n if(!identical(candidate('aabb', 'aaccc'), FALSE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "r", - "prompt": "# Given an array of integers nums, find the minimum sum of any non-empty sub-array\n# of nums.\n# Example\n# >>> minSubArraySum(c(2, 3, 4, 1, 2, 4))\n# 1\n# >>> minSubArraySum(c(-1, -2, -3))\n# -6\nminSubArraySum <- function(nums) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- minSubArraySum\n if(!identical(candidate(c(2, 3, 4, 1, 2, 4)), 1)){quit('no', 1)}\n if(!identical(candidate(c(-1, -2, -3)), -6)){quit('no', 1)}\n if(!identical(candidate(c(-1, -2, -3, 2, -10)), -14)){quit('no', 1)}\n if(!identical(candidate(c(-9999999999999999)), -9999999999999999)){quit('no', 1)}\n if(!identical(candidate(c(0, 10, 20, 1000000)), 0)){quit('no', 1)}\n if(!identical(candidate(c(-1, -2, -3, 10, -5)), -6)){quit('no', 1)}\n if(!identical(candidate(c(100, -1, -2, -3, 10, -5)), -6)){quit('no', 1)}\n if(!identical(candidate(c(10, 11, 13, 8, 3, 4)), 3)){quit('no', 1)}\n if(!identical(candidate(c(100, -33, 32, -1, 0, -2)), -33)){quit('no', 1)}\n if(!identical(candidate(c(-10)), -10)){quit('no', 1)}\n if(!identical(candidate(c(7)), 7)){quit('no', 1)}\n if(!identical(candidate(c(1, -1)), -1)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "r", - "prompt": "# Given a string s and a natural number n, you have been tasked to implement \n# a function that returns a list of all words from string s that contain exactly \n# n consonants, in order these words appear in the string s.\n# If the string s is empty then the function should return an empty list.\n# Note: you may assume the input string contains only letters and spaces.\n# Examples:\n# >>> select_words('Mary had a little lamb', 4)\n# list('little')\n# >>> select_words('Mary had a little lamb', 3)\n# list('Mary', 'lamb')\n# >>> select_words('simple white space', 2)\n# list()\n# >>> select_words('Hello world', 4)\n# list('world')\n# >>> select_words('Uncle sam', 3)\n# list('Uncle')\nselect_words <- function(s, n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- select_words\n if(!identical(candidate('Mary had a little lamb', 4), list('little'))){quit('no', 1)}\n if(!identical(candidate('Mary had a little lamb', 3), list('Mary', 'lamb'))){quit('no', 1)}\n if(!identical(candidate('simple white space', 2), list())){quit('no', 1)}\n if(!identical(candidate('Hello world', 4), list('world'))){quit('no', 1)}\n if(!identical(candidate('Uncle sam', 3), list('Uncle'))){quit('no', 1)}\n if(!identical(candidate('', 4), list())){quit('no', 1)}\n if(!identical(candidate('a b c d e f', 1), list('b', 'c', 'd', 'f'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "r", - "prompt": "# Return list of all prefixes from shortest to longest of the input string\n# >>> all_prefixes('abc')\n# list('a', 'ab', 'abc')\nall_prefixes <- function(string) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- all_prefixes\n if(!identical(candidate(''), list())){quit('no', 1)}\n if(!identical(candidate('asdfgh'), list('a', 'as', 'asd', 'asdf', 'asdfg', 'asdfgh'))){quit('no', 1)}\n if(!identical(candidate('WWW'), list('W', 'WW', 'WWW'))){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "r", - "prompt": "# Create a function that takes a value (string) representing a number\n# and returns the closest integer to it. If the number is equidistant\n# from two integers, round it away from zero.\n# Examples\n# >>> closest_integer('10')\n# 10\n# >>> closest_integer('15.3')\n# 15\n# Note:\n# Rounding away from zero means that if the given number is equidistant\n# from two integers, the one you should return is the one that is the\n# farthest from zero. For example closest_integer(\"14.5\") should\n# return 15 and closest_integer(\"-14.5\") should return -15.\nclosest_integer <- function(value) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- closest_integer\n if(!identical(candidate('10'), 10)){quit('no', 1)}\n if(!identical(candidate('14.5'), 15)){quit('no', 1)}\n if(!identical(candidate('-15.5'), -16)){quit('no', 1)}\n if(!identical(candidate('15.3'), 15)){quit('no', 1)}\n if(!identical(candidate('0'), 0)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "r", - "prompt": "# Create a function which takes a string representing a file's name, and returns\n# 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n# A file's name is considered to be valid if and only if all the following conditions \n# are met:\n# - There should not be more than three digits ('0'-'9') in the file's name.\n# - The file's name contains exactly one dot '.'\n# - The substring before the dot should not be empty, and it starts with a letter from \n# the latin alphapet ('a'-'z' and 'A'-'Z').\n# - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n# Examples:\n# >>> file_name_check('example.txt')\n# 'Yes'\n# >>> file_name_check('1example.dll')\n# 'No'\nfile_name_check <- function(file_name) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- file_name_check\n if(!identical(candidate('example.txt'), 'Yes')){quit('no', 1)}\n if(!identical(candidate('1example.dll'), 'No')){quit('no', 1)}\n if(!identical(candidate('s1sdf3.asd'), 'No')){quit('no', 1)}\n if(!identical(candidate('K.dll'), 'Yes')){quit('no', 1)}\n if(!identical(candidate('MY16FILE3.exe'), 'Yes')){quit('no', 1)}\n if(!identical(candidate('His12FILE94.exe'), 'No')){quit('no', 1)}\n if(!identical(candidate('_Y.txt'), 'No')){quit('no', 1)}\n if(!identical(candidate('?aREYA.exe'), 'No')){quit('no', 1)}\n if(!identical(candidate('/this_is_valid.dll'), 'No')){quit('no', 1)}\n if(!identical(candidate('this_is_valid.wow'), 'No')){quit('no', 1)}\n if(!identical(candidate('this_is_valid.txt'), 'Yes')){quit('no', 1)}\n if(!identical(candidate('this_is_valid.txtexe'), 'No')){quit('no', 1)}\n if(!identical(candidate('#this2_i4s_5valid.ten'), 'No')){quit('no', 1)}\n if(!identical(candidate('@this1_is6_valid.exe'), 'No')){quit('no', 1)}\n if(!identical(candidate('this_is_12valid.6exe4.txt'), 'No')){quit('no', 1)}\n if(!identical(candidate('all.exe.txt'), 'No')){quit('no', 1)}\n if(!identical(candidate('I563_No.exe'), 'Yes')){quit('no', 1)}\n if(!identical(candidate('Is3youfault.txt'), 'Yes')){quit('no', 1)}\n if(!identical(candidate('no_one#knows.dll'), 'Yes')){quit('no', 1)}\n if(!identical(candidate('1I563_Yes3.exe'), 'No')){quit('no', 1)}\n if(!identical(candidate('I563_Yes3.txtt'), 'No')){quit('no', 1)}\n if(!identical(candidate('final..txt'), 'No')){quit('no', 1)}\n if(!identical(candidate('final132'), 'No')){quit('no', 1)}\n if(!identical(candidate('_f4indsartal132.'), 'No')){quit('no', 1)}\n if(!identical(candidate('.txt'), 'No')){quit('no', 1)}\n if(!identical(candidate('s.'), 'No')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "r", - "prompt": "# You are given two intervals,\n# where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n# The given intervals are closed which means that the interval (start, end)\n# includes both start and end.\n# For each given interval, it is assumed that its start is less or equal its end.\n# Your task is to determine whether the length of intersection of these two \n# intervals is a prime number.\n# Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n# which its length is 1, which not a prime number.\n# If the length of the intersection is a prime number, return \"YES\",\n# otherwise, return \"NO\".\n# If the two intervals don't intersect, return \"NO\".\n# [input/output] samples:\n# >>> intersection(list(1, 2), list(2, 3))\n# 'NO'\n# >>> intersection(list(-1, 1), list(0, 4))\n# 'NO'\n# >>> intersection(list(-3, -1), list(-5, 5))\n# 'YES'\nintersection <- function(interval1, interval2) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- intersection\n if(!identical(candidate(list(1, 2), list(2, 3)), 'NO')){quit('no', 1)}\n if(!identical(candidate(list(-1, 1), list(0, 4)), 'NO')){quit('no', 1)}\n if(!identical(candidate(list(-3, -1), list(-5, 5)), 'YES')){quit('no', 1)}\n if(!identical(candidate(list(-2, 2), list(-4, 0)), 'YES')){quit('no', 1)}\n if(!identical(candidate(list(-11, 2), list(-1, -1)), 'NO')){quit('no', 1)}\n if(!identical(candidate(list(1, 2), list(3, 5)), 'NO')){quit('no', 1)}\n if(!identical(candidate(list(1, 2), list(1, 2)), 'NO')){quit('no', 1)}\n if(!identical(candidate(list(-2, -2), list(-3, -2)), 'NO')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "r", - "prompt": "# Return the largest prime factor of n. Assume n > 1 and is not a prime.\n# >>> largest_prime_factor(13195)\n# 29\n# >>> largest_prime_factor(2048)\n# 2\nlargest_prime_factor <- function(n) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- largest_prime_factor\n if(!identical(candidate(15), 5)){quit('no', 1)}\n if(!identical(candidate(27), 3)){quit('no', 1)}\n if(!identical(candidate(63), 7)){quit('no', 1)}\n if(!identical(candidate(330), 11)){quit('no', 1)}\n if(!identical(candidate(13195), 29)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "r", - "prompt": "# Given a string, find out how many distinct characters (regardless of case) does it consist of\n# >>> count_distinct_characters('xyzXYZ')\n# 3\n# >>> count_distinct_characters('Jerry')\n# 4\ncount_distinct_characters <- function(string) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- count_distinct_characters\n if(!identical(candidate(''), 0)){quit('no', 1)}\n if(!identical(candidate('abcde'), 5)){quit('no', 1)}\n if(!identical(candidate('abcdecadeCADE'), 5)){quit('no', 1)}\n if(!identical(candidate('aaaaAAAAaaaa'), 1)){quit('no', 1)}\n if(!identical(candidate('Jerry jERRY JeRRRY'), 5)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "r", - "prompt": "# You're given a list of deposit and withdrawal operations on a bank account that starts with\n# zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n# at that point function should return True. Otherwise it should return False.\n# >>> below_zero(c(1, 2, 3))\n# FALSE\n# >>> below_zero(c(1, 2, -4, 5))\n# TRUE\nbelow_zero <- function(operations) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- below_zero\n if(!identical(candidate(c()), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, -3, 1, 2, -3)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, 2, -4, 5, 6)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, -1, 2, -2, 5, -5, 4, -4)), FALSE)){quit('no', 1)}\n if(!identical(candidate(c(1, -1, 2, -2, 5, -5, 4, -5)), TRUE)){quit('no', 1)}\n if(!identical(candidate(c(1, -2, 2, -2, 5, -5, 4, -4)), TRUE)){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "r", - "prompt": "# Find the shortest palindrome that begins with a supplied string.\n# Algorithm idea is simple:\n# - Find the longest postfix of supplied string that is a palindrome.\n# - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n# >>> make_palindrome('')\n# ''\n# >>> make_palindrome('cat')\n# 'catac'\n# >>> make_palindrome('cata')\n# 'catac'\nmake_palindrome <- function(string) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- make_palindrome\n if(!identical(candidate(''), '')){quit('no', 1)}\n if(!identical(candidate('x'), 'x')){quit('no', 1)}\n if(!identical(candidate('xyz'), 'xyzyx')){quit('no', 1)}\n if(!identical(candidate('xyx'), 'xyx')){quit('no', 1)}\n if(!identical(candidate('jerry'), 'jerryrrej')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "r", - "prompt": "# Given a positive integer, obtain its roman numeral equivalent as a string,\n# and return it in lowercase.\n# Restrictions: 1 <= num <= 1000\n# Examples:\n# >>> int_to_mini_roman(19)\n# 'xix'\n# >>> int_to_mini_roman(152)\n# 'clii'\n# >>> int_to_mini_roman(426)\n# 'cdxxvi'\nint_to_mini_roman <- function(number) {", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "test_humaneval <- function() {\ncandidate <- int_to_mini_roman\n if(!identical(candidate(19), 'xix')){quit('no', 1)}\n if(!identical(candidate(152), 'clii')){quit('no', 1)}\n if(!identical(candidate(251), 'ccli')){quit('no', 1)}\n if(!identical(candidate(426), 'cdxxvi')){quit('no', 1)}\n if(!identical(candidate(500), 'd')){quit('no', 1)}\n if(!identical(candidate(1), 'i')){quit('no', 1)}\n if(!identical(candidate(4), 'iv')){quit('no', 1)}\n if(!identical(candidate(43), 'xliii')){quit('no', 1)}\n if(!identical(candidate(90), 'xc')){quit('no', 1)}\n if(!identical(candidate(94), 'xciv')){quit('no', 1)}\n if(!identical(candidate(532), 'dxxxii')){quit('no', 1)}\n if(!identical(candidate(900), 'cm')){quit('no', 1)}\n if(!identical(candidate(994), 'cmxciv')){quit('no', 1)}\n if(!identical(candidate(1000), 'm')){quit('no', 1)}\n}\ntest_humaneval()", - "stop_tokens": [ - "\n#", - "\n```" - ] - } -] \ No newline at end of file diff --git a/data/rb-keep.json b/data/rb-keep.json deleted file mode 100644 index 4254a6342352de32002404a81aa31e86140ca884..0000000000000000000000000000000000000000 --- a/data/rb-keep.json +++ /dev/null @@ -1,2417 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "rb", - "prompt": "# For a given number n, find the largest number that divides n evenly, smaller than n\n# >>> largest_divisor(15)\n# 5\ndef largest_divisor(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_largest_divisor\n candidate = method(:largest_divisor)\n assert_equal(1, candidate.call(3))\n assert_equal(1, candidate.call(7))\n assert_equal(5, candidate.call(10))\n assert_equal(50, candidate.call(100))\n assert_equal(7, candidate.call(49))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_47_median", - "language": "rb", - "prompt": "# Return median of elements in the list l.\n# >>> median([3, 1, 2, 4, 5])\n# 3\n# >>> median([-10, 4, 6, 1000, 10, 20])\n# 15.0\ndef median(l)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_median\n candidate = method(:median)\n assert_equal(3, candidate.call([3, 1, 2, 4, 5]))\n assert_equal(8.0, candidate.call([-10, 4, 6, 1000, 10, 20]))\n assert_equal(5, candidate.call([5]))\n assert_equal(5.5, candidate.call([6, 5]))\n assert_equal(7, candidate.call([8, 1, 3, 9, 9, 2, 7]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "rb", - "prompt": "# Given two lists operator, and operand. The first list has basic algebra operations, and \n# the second list is a list of integers. Use the two given lists to build the algebric \n# expression and return the evaluation of this expression.\n# The basic algebra operations:\n# Addition ( + ) \n# Subtraction ( - ) \n# Multiplication ( * ) \n# Floor division ( // ) \n# Exponentiation ( ** ) \n# Example:\n# operator['+', '*', '-']\n# array = [2, 3, 4, 5]\n# result = 2 + 3 * 4 - 5\n# => result = 9\n# Note:\n# The length of operator list is equal to the length of operand list minus one.\n# Operand is a list of of non-negative integers.\n# Operator list has at least one operator, and operand list has at least two operands.\ndef do_algebra(operator, operand)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_do_algebra\n candidate = method(:do_algebra)\n assert_equal(37, candidate.call([\"**\", \"*\", \"+\"], [2, 3, 4, 5]))\n assert_equal(9, candidate.call([\"+\", \"*\", \"-\"], [2, 3, 4, 5]))\n assert_equal(8, candidate.call([\"//\", \"*\"], [7, 3, 4]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "rb", - "prompt": "# Return maximum element in the list.\n# >>> max_element([1, 2, 3])\n# 3\n# >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n# 123\ndef max_element(l)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_max_element\n candidate = method(:max_element)\n assert_equal(3, candidate.call([1, 2, 3]))\n assert_equal(124, candidate.call([5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "rb", - "prompt": "# Create a function which returns the largest index of an element which\n# is not greater than or equal to the element immediately preceding it. If\n# no such element exists then return -1. The given array will not contain\n# duplicate values.\n# Examples:\n# can_arrange([1,2,4,3,5]) = 3\n# can_arrange([1,2,3]) = -1\ndef can_arrange(arr)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_can_arrange\n candidate = method(:can_arrange)\n assert_equal(3, candidate.call([1, 2, 4, 3, 5]))\n assert_equal(-1, candidate.call([1, 2, 4, 5]))\n assert_equal(2, candidate.call([1, 4, 2, 5, 6, 7, 8, 9, 10]))\n assert_equal(4, candidate.call([4, 8, 5, 7, 3]))\n assert_equal(-1, candidate.call([]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "rb", - "prompt": "# Imagine a road that's a perfectly straight infinitely long line.\n# n cars are driving left to right; simultaneously, a different set of n cars\n# are driving right to left. The two sets of cars start out being very far from\n# each other. All cars move in the same speed. Two cars are said to collide\n# when a car that's moving left to right hits a car that's moving right to left.\n# However, the cars are infinitely sturdy and strong; as a result, they continue moving\n# in their trajectory as if they did not collide.\n# This function outputs the number of such collisions.\ndef car_race_collision(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_car_race_collision\n candidate = method(:car_race_collision)\n assert_equal(4, candidate.call(2))\n assert_equal(9, candidate.call(3))\n assert_equal(16, candidate.call(4))\n assert_equal(64, candidate.call(8))\n assert_equal(100, candidate.call(10))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "rb", - "prompt": "# Create a function that returns True if the last character\n# of a given string is an alphabetical character and is not\n# a part of a word, and False otherwise.\n# Note: \"word\" is a group of characters separated by space.\n# Examples:\n# check_if_last_char_is_a_letter(\"apple pie\") \u279e False\n# check_if_last_char_is_a_letter(\"apple pi e\") \u279e True\n# check_if_last_char_is_a_letter(\"apple pi e \") \u279e False\n# check_if_last_char_is_a_letter(\"\") \u279e False\ndef check_if_last_char_is_a_letter(txt)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_check_if_last_char_is_a_letter\n candidate = method(:check_if_last_char_is_a_letter)\n assert_equal(false, candidate.call(\"apple\"))\n assert_equal(true, candidate.call(\"apple pi e\"))\n assert_equal(false, candidate.call(\"eeeee\"))\n assert_equal(true, candidate.call(\"A\"))\n assert_equal(false, candidate.call(\"Pumpkin pie \"))\n assert_equal(false, candidate.call(\"Pumpkin pie 1\"))\n assert_equal(false, candidate.call(\"\"))\n assert_equal(false, candidate.call(\"eeeee e \"))\n assert_equal(false, candidate.call(\"apple pie\"))\n assert_equal(false, candidate.call(\"apple pi e \"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "rb", - "prompt": "# Return true if a given number is prime, and false otherwise.\n# >>> is_prime(6)\n# False\n# >>> is_prime(101)\n# True\n# >>> is_prime(11)\n# True\n# >>> is_prime(13441)\n# True\n# >>> is_prime(61)\n# True\n# >>> is_prime(4)\n# False\n# >>> is_prime(1)\n# False\ndef is_prime(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_prime\n candidate = method(:is_prime)\n assert_equal(false, candidate.call(6))\n assert_equal(true, candidate.call(101))\n assert_equal(true, candidate.call(11))\n assert_equal(true, candidate.call(13441))\n assert_equal(true, candidate.call(61))\n assert_equal(false, candidate.call(4))\n assert_equal(false, candidate.call(1))\n assert_equal(true, candidate.call(5))\n assert_equal(true, candidate.call(11))\n assert_equal(true, candidate.call(17))\n assert_equal(false, candidate.call(85))\n assert_equal(false, candidate.call(77))\n assert_equal(false, candidate.call(255379))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "rb", - "prompt": "# Given a list of positive integers x. return a sorted list of all \n# elements that hasn't any even digit.\n# Note: Returned list should be sorted in increasing order.\n# For example:\n# >>> unique_digits([15, 33, 1422, 1])\n# [1, 15, 33]\n# >>> unique_digits([152, 323, 1422, 10])\n# []\ndef unique_digits(x)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_unique_digits\n candidate = method(:unique_digits)\n assert_equal([1, 15, 33], candidate.call([15, 33, 1422, 1]))\n assert_equal([], candidate.call([152, 323, 1422, 10]))\n assert_equal([111, 151], candidate.call([12345, 2033, 111, 151]))\n assert_equal([31, 135], candidate.call([135, 103, 31]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "rb", - "prompt": "# Input are two strings a and b consisting only of 1s and 0s.\n# Perform binary XOR on these inputs and return result also as a string.\n# >>> string_xor('010', '110')\n# '100'\ndef string_xor(a, b)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_string_xor\n candidate = method(:string_xor)\n assert_equal(\"010010\", candidate.call(\"111000\", \"101010\"))\n assert_equal(\"0\", candidate.call(\"1\", \"1\"))\n assert_equal(\"0101\", candidate.call(\"0101\", \"0000\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "rb", - "prompt": "# sum_to_n is a function that sums numbers from 1 to n.\n# >>> sum_to_n(30)\n# 465\n# >>> sum_to_n(100)\n# 5050\n# >>> sum_to_n(5)\n# 15\n# >>> sum_to_n(10)\n# 55\n# >>> sum_to_n(1)\n# 1\ndef sum_to_n(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sum_to_n\n candidate = method(:sum_to_n)\n assert_equal(1, candidate.call(1))\n assert_equal(21, candidate.call(6))\n assert_equal(66, candidate.call(11))\n assert_equal(465, candidate.call(30))\n assert_equal(5050, candidate.call(100))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "rb", - "prompt": "# Given a list of numbers, return the sum of squares of the numbers\n# in the list that are odd. Ignore numbers that are negative or not integers.\n# double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10\n# double_the_difference([-1, -2, 0]) == 0\n# double_the_difference([9, -2]) == 81\n# double_the_difference([0]) == 0 \n# If the input list is empty, return 0.\ndef double_the_difference(lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_double_the_difference\n candidate = method(:double_the_difference)\n assert_equal(0, candidate.call([]))\n assert_equal(25, candidate.call([5.0, 4.0]))\n assert_equal(0, candidate.call([0.1, 0.2, 0.3]))\n assert_equal(0, candidate.call([-10.0, -20.0, -30.0]))\n assert_equal(0, candidate.call([-1.0, -2.0, 8.0]))\n assert_equal(34, candidate.call([0.2, 3.0, 5.0]))\n assert_equal(165, candidate.call([-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "rb", - "prompt": "# Return length of given string\n# >>> strlen('')\n# 0\n# >>> strlen('abc')\n# 3\ndef strlen(string)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_strlen\n candidate = method(:strlen)\n assert_equal(0, candidate.call(\"\"))\n assert_equal(1, candidate.call(\"x\"))\n assert_equal(9, candidate.call(\"asdasnakj\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "rb", - "prompt": "# You'll be given a string of words, and your task is to count the number\n# of boredoms. A boredom is a sentence that starts with the word \"I\".\n# Sentences are delimited by '.', '?' or '!'.\n# For example:\n# >>> is_bored(\"Hello world\")\n# 0\n# >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n# 1\ndef is_bored(s)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_bored\n candidate = method(:is_bored)\n assert_equal(0, candidate.call(\"Hello world\"))\n assert_equal(0, candidate.call(\"Is the sky blue?\"))\n assert_equal(1, candidate.call(\"I love It !\"))\n assert_equal(0, candidate.call(\"bIt\"))\n assert_equal(2, candidate.call(\"I feel good today. I will be productive. will kill It\"))\n assert_equal(0, candidate.call(\"You and I are going for a walk\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "rb", - "prompt": "# Write a function vowels_count which takes a string representing\n# a word as input and returns the number of vowels in the string.\n# Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n# vowel, but only when it is at the end of the given word.\n# Example:\n# >>> vowels_count(\"abcde\")\n# 2\n# >>> vowels_count(\"ACEDY\")\n# 3\ndef vowels_count(s)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_vowels_count\n candidate = method(:vowels_count)\n assert_equal(2, candidate.call(\"abcde\"))\n assert_equal(3, candidate.call(\"Alone\"))\n assert_equal(2, candidate.call(\"key\"))\n assert_equal(1, candidate.call(\"bye\"))\n assert_equal(2, candidate.call(\"keY\"))\n assert_equal(1, candidate.call(\"bYe\"))\n assert_equal(3, candidate.call(\"ACEDY\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "rb", - "prompt": "# Return n-th Fibonacci number.\n# >>> fib(10)\n# 55\n# >>> fib(1)\n# 1\n# >>> fib(8)\n# 21\ndef fib(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_fib\n candidate = method(:fib)\n assert_equal(55, candidate.call(10))\n assert_equal(1, candidate.call(1))\n assert_equal(21, candidate.call(8))\n assert_equal(89, candidate.call(11))\n assert_equal(144, candidate.call(12))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "rb", - "prompt": "# Your task is to implement a function that will simplify the expression\n# x * n. The function returns True if x * n evaluates to a whole number and False\n# otherwise. Both x and n, are string representation of a fraction, and have the following format,\n# / where both numerator and denominator are positive whole numbers.\n# You can assume that x, and n are valid fractions, and do not have zero as denominator.\n# simplify(\"1/5\", \"5/1\") = True\n# simplify(\"1/6\", \"2/1\") = False\n# simplify(\"7/10\", \"10/2\") = False\ndef simplify(x, n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_simplify\n candidate = method(:simplify)\n assert_equal(true, candidate.call(\"1/5\", \"5/1\"))\n assert_equal(false, candidate.call(\"1/6\", \"2/1\"))\n assert_equal(true, candidate.call(\"5/1\", \"3/1\"))\n assert_equal(false, candidate.call(\"7/10\", \"10/2\"))\n assert_equal(true, candidate.call(\"2/10\", \"50/10\"))\n assert_equal(true, candidate.call(\"7/2\", \"4/2\"))\n assert_equal(true, candidate.call(\"11/6\", \"6/1\"))\n assert_equal(false, candidate.call(\"2/3\", \"5/2\"))\n assert_equal(false, candidate.call(\"5/2\", \"3/5\"))\n assert_equal(true, candidate.call(\"2/4\", \"8/4\"))\n assert_equal(true, candidate.call(\"2/4\", \"4/2\"))\n assert_equal(true, candidate.call(\"1/5\", \"5/1\"))\n assert_equal(false, candidate.call(\"1/5\", \"1/5\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "rb", - "prompt": "# Given a string s, count the number of uppercase vowels in even indices.\n# For example:\n# count_upper('aBCdEf') returns 1\n# count_upper('abcdefg') returns 0\n# count_upper('dBBE') returns 0\ndef count_upper(s)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_count_upper\n candidate = method(:count_upper)\n assert_equal(1, candidate.call(\"aBCdEf\"))\n assert_equal(0, candidate.call(\"abcdefg\"))\n assert_equal(0, candidate.call(\"dBBE\"))\n assert_equal(0, candidate.call(\"B\"))\n assert_equal(1, candidate.call(\"U\"))\n assert_equal(0, candidate.call(\"\"))\n assert_equal(2, candidate.call(\"EEEE\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "rb", - "prompt": "# You are given a rectangular grid of wells. Each row represents a single well,\n# and each 1 in a row represents a single unit of water.\n# Each well has a corresponding bucket that can be used to extract water from it, \n# and all buckets have the same capacity.\n# Your task is to use the buckets to empty the wells.\n# Output the number of times you need to lower the buckets.\n# Example 1:\n# Input: \n# grid : [[0,0,1,0], [0,1,0,0], [1,1,1,1]]\n# bucket_capacity : 1\n# Output: 6\n# Example 2:\n# Input: \n# grid : [[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]]\n# bucket_capacity : 2\n# Output: 5\n# Example 3:\n# Input: \n# grid : [[0,0,0], [0,0,0]]\n# bucket_capacity : 5\n# Output: 0\n# Constraints:\n# * all wells have the same length\n# * 1 <= grid.length <= 10^2\n# * 1 <= grid[:,1].length <= 10^2\n# * grid[i][j] -> 0 | 1\n# * 1 <= capacity <= 10\ndef max_fill(grid, capacity)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_max_fill\n candidate = method(:max_fill)\n assert_equal(6, candidate.call([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1))\n assert_equal(5, candidate.call([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2))\n assert_equal(0, candidate.call([[0, 0, 0], [0, 0, 0]], 5))\n assert_equal(4, candidate.call([[1, 1, 1, 1], [1, 1, 1, 1]], 2))\n assert_equal(2, candidate.call([[1, 1, 1, 1], [1, 1, 1, 1]], 9))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "rb", - "prompt": "# Given an array arr of integers and a positive integer k, return a sorted list \n# of length k with the maximum k numbers in arr.\n# Example 1:\n# Input: arr = [-3, -4, 5], k = 3\n# Output: [-4, -3, 5]\n# Example 2:\n# Input: arr = [4, -4, 4], k = 2\n# Output: [4, 4]\n# Example 3:\n# Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1\n# Output: [2]\n# Note:\n# 1. The length of the array will be in the range of [1, 1000].\n# 2. The elements in the array will be in the range of [-1000, 1000].\n# 3. 0 <= k <= len(arr)\ndef maximum(arr, k)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_maximum\n candidate = method(:maximum)\n assert_equal([-4, -3, 5], candidate.call([-3, -4, 5], 3))\n assert_equal([4, 4], candidate.call([4, -4, 4], 2))\n assert_equal([2], candidate.call([-3, 2, 1, 2, -1, -2, 1], 1))\n assert_equal([2, 20, 123], candidate.call([123, -123, 20, 0, 1, 2, -3], 3))\n assert_equal([0, 1, 2, 20], candidate.call([-123, 20, 0, 1, 2, -3], 4))\n assert_equal([-13, -8, 0, 0, 3, 5, 15], candidate.call([5, 15, 0, 3, -13, -8, 0], 7))\n assert_equal([3, 5], candidate.call([-1, 0, 2, 5, 3, -10], 2))\n assert_equal([5], candidate.call([1, 0, 5, -7], 1))\n assert_equal([-4, 4], candidate.call([4, -4], 2))\n assert_equal([-10, 10], candidate.call([-10, 10], 2))\n assert_equal([], candidate.call([1, 2, 3, -23, 243, -400, 0], 0))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "rb", - "prompt": "# Write a function that takes a message, and encodes in such a \n# way that it swaps case of all letters, replaces all vowels in \n# the message with the letter that appears 2 places ahead of that \n# vowel in the english alphabet. \n# Assume only letters. \n# Examples:\n# >>> encode('test')\n# 'TGST'\n# >>> encode('This is a message')\n# 'tHKS KS C MGSSCGG'\ndef encode(message)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_encode\n candidate = method(:encode)\n assert_equal(\"tgst\", candidate.call(\"TEST\"))\n assert_equal(\"mWDCSKR\", candidate.call(\"Mudasir\"))\n assert_equal(\"ygs\", candidate.call(\"YES\"))\n assert_equal(\"tHKS KS C MGSSCGG\", candidate.call(\"This is a message\"))\n assert_equal(\"k dQnT kNqW wHcT Tq wRkTg\", candidate.call(\"I DoNt KnOw WhAt tO WrItE\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "rb", - "prompt": "# remove_vowels is a function that takes string and returns string without vowels.\n# >>> remove_vowels('')\n# ''\n# >>> remove_vowels('abcdef')\n# 'bcdf'\n# >>> remove_vowels('aaaaa')\n# ''\n# >>> remove_vowels('aaBAA')\n# 'B'\n# >>> remove_vowels('zbcd')\n# 'zbcd'\ndef remove_vowels(text)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_remove_vowels\n candidate = method(:remove_vowels)\n assert_equal(\"\", candidate.call(\"\"))\n assert_equal(\"bcdf\nghjklm\", candidate.call(\"abcdef\nghijklm\"))\n assert_equal(\"fdcb\", candidate.call(\"fedcba\"))\n assert_equal(\"\", candidate.call(\"eeeee\"))\n assert_equal(\"cB\", candidate.call(\"acBAA\"))\n assert_equal(\"cB\", candidate.call(\"EcBOO\"))\n assert_equal(\"ybcd\", candidate.call(\"ybcd\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "rb", - "prompt": "# Return only positive numbers in the list.\n# >>> get_positive([-1, 2, -4, 5, 6])\n# [2, 5, 6]\n# >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n# [5, 3, 2, 3, 9, 123, 1]\ndef get_positive(l)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_get_positive\n candidate = method(:get_positive)\n assert_equal([4, 5, 6], candidate.call([-1, -2, 4, 5, 6]))\n assert_equal([5, 3, 2, 3, 3, 9, 123, 1], candidate.call([5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]))\n assert_equal([], candidate.call([-1, -2]))\n assert_equal([], candidate.call([]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "rb", - "prompt": "# Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n# >>> string_sequence(0)\n# '0'\n# >>> string_sequence(5)\n# '0 1 2 3 4 5'\ndef string_sequence(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_string_sequence\n candidate = method(:string_sequence)\n assert_equal(\"0\", candidate.call(0))\n assert_equal(\"0 1 2 3\", candidate.call(3))\n assert_equal(\"0 1 2 3 4 5 6 7 8 9 10\", candidate.call(10))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "rb", - "prompt": "# Given a positive integer n, you have to make a pile of n levels of stones.\n# The first level has n stones.\n# The number of stones in the next level is:\n# - the next odd number if n is odd.\n# - the next even number if n is even.\n# Return the number of stones in each level in a list, where element at index\n# i represents the number of stones in the level (i+1).\n# Examples:\n# >>> make_a_pile(3)\n# [3, 5, 7]\ndef make_a_pile(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_make_a_pile\n candidate = method(:make_a_pile)\n assert_equal([3, 5, 7], candidate.call(3))\n assert_equal([4, 6, 8, 10], candidate.call(4))\n assert_equal([5, 7, 9, 11, 13], candidate.call(5))\n assert_equal([6, 8, 10, 12, 14, 16], candidate.call(6))\n assert_equal([8, 10, 12, 14, 16, 18, 20, 22], candidate.call(8))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "rb", - "prompt": "# Task\n# 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\n# then check if the result string is palindrome.\n# A string is called palindrome if it reads the same backward as forward.\n# You should return a tuple containing the result string and True/False for the check.\n# Example\n# For s = \"abcde\", c = \"ae\", the result should be ('bcd',False)\n# For s = \"abcdef\", c = \"b\" the result should be ('acdef',False)\n# For s = \"abcdedcba\", c = \"ab\", the result should be ('cdedc',True)\ndef reverse_delete(s, c)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_reverse_delete\n candidate = method(:reverse_delete)\n assert_equal([\"bcd\", false], candidate.call(\"abcde\", \"ae\"))\n assert_equal([\"acdef\", false], candidate.call(\"abcdef\", \"b\"))\n assert_equal([\"cdedc\", true], candidate.call(\"abcdedcba\", \"ab\"))\n assert_equal([\"dik\", false], candidate.call(\"dwik\", \"w\"))\n assert_equal([\"\", true], candidate.call(\"a\", \"a\"))\n assert_equal([\"abcdedcba\", true], candidate.call(\"abcdedcba\", \"\"))\n assert_equal([\"abcdedcba\", true], candidate.call(\"abcdedcba\", \"v\"))\n assert_equal([\"abba\", true], candidate.call(\"vabba\", \"v\"))\n assert_equal([\"\", true], candidate.call(\"mamma\", \"mia\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "rb", - "prompt": "# For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n# >>> flip_case('Hello')\n# 'hELLO'\ndef flip_case(string)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_flip_case\n candidate = method(:flip_case)\n assert_equal(\"\", candidate.call(\"\"))\n assert_equal(\"hELLO!\", candidate.call(\"Hello!\"))\n assert_equal(\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\", candidate.call(\"These violent delights have violent ends\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "rb", - "prompt": "# You are given a string s.\n# if s[i] is a letter, reverse its case from lower to upper or vise versa, \n# otherwise keep it as it is.\n# If the string contains no letters, reverse the string.\n# The function should return the resulted string.\n# Examples\n# solve(\"1234\") = \"4321\"\n# solve(\"ab\") = \"AB\"\n# solve(\"#a@C\") = \"#A@c\"\ndef solve(s)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_solve\n candidate = method(:solve)\n assert_equal(\"aSdF\", candidate.call(\"AsDf\"))\n assert_equal(\"4321\", candidate.call(\"1234\"))\n assert_equal(\"AB\", candidate.call(\"ab\"))\n assert_equal(\"#A@c\", candidate.call(\"#a@C\"))\n assert_equal(\"#aSDFw^45\", candidate.call(\"#AsdfW^45\"))\n assert_equal(\"2@6#\", candidate.call(\"#6@2\"))\n assert_equal(\"#$A^d\", candidate.call(\"#$a^D\"))\n assert_equal(\"#CCC\", candidate.call(\"#ccc\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "rb", - "prompt": "# Filter an input list of strings only for ones that start with a given prefix.\n# >>> filter_by_prefix([], 'a')\n# []\n# >>> filter_by_prefix(['abc', 'bcd', 'cde', 'array'], 'a')\n# ['abc', 'array']\ndef filter_by_prefix(strings, prefix)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_filter_by_prefix\n candidate = method(:filter_by_prefix)\n assert_equal([], candidate.call([], \"john\"))\n assert_equal([\"xxx\", \"xxxAAA\", \"xxx\"], candidate.call([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "rb", - "prompt": "# This function takes two positive numbers x and y and returns the\n# biggest even integer number that is in the range [x, y] inclusive. If \n# there's no such number, then the function should return -1.\n# For example:\n# choose_num(12, 15) = 14\n# choose_num(13, 12) = -1\ndef choose_num(x, y)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_choose_num\n candidate = method(:choose_num)\n assert_equal(14, candidate.call(12, 15))\n assert_equal(-1, candidate.call(13, 12))\n assert_equal(12354, candidate.call(33, 12354))\n assert_equal(-1, candidate.call(5234, 5233))\n assert_equal(28, candidate.call(6, 29))\n assert_equal(-1, candidate.call(27, 10))\n assert_equal(-1, candidate.call(7, 7))\n assert_equal(546, candidate.call(546, 546))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "rb", - "prompt": "# You are given a string representing a sentence,\n# the sentence contains some words separated by a space,\n# and you have to return a string that contains the words from the original sentence,\n# whose lengths are prime numbers,\n# the order of the words in the new string should be the same as the original one.\n# Example 1:\n# Input: sentence = \"This is a test\"\n# Output: \"is\"\n# Example 2:\n# Input: sentence = \"lets go for swimming\"\n# Output: \"go for\"\n# Constraints:\n# * 1 <= len(sentence) <= 100\n# * sentence contains only letters\ndef words_in_sentence(sentence)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_words_in_sentence\n candidate = method(:words_in_sentence)\n assert_equal(\"is\", candidate.call(\"This is a test\"))\n assert_equal(\"go for\", candidate.call(\"lets go for swimming\"))\n assert_equal(\"there is no place\", candidate.call(\"there is no place available here\"))\n assert_equal(\"Hi am Hussein\", candidate.call(\"Hi I am Hussein\"))\n assert_equal(\"go for it\", candidate.call(\"go for it\"))\n assert_equal(\"\", candidate.call(\"here\"))\n assert_equal(\"is\", candidate.call(\"here is\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "rb", - "prompt": "# Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n# >>> intersperse([], 4)\n# []\n# >>> intersperse([1, 2, 3], 4)\n# [1, 4, 2, 4, 3]\ndef intersperse(numbers, delimeter)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_intersperse\n candidate = method(:intersperse)\n assert_equal([], candidate.call([], 7))\n assert_equal([5, 8, 6, 8, 3, 8, 2], candidate.call([5, 6, 3, 2], 8))\n assert_equal([2, 2, 2, 2, 2], candidate.call([2, 2, 2], 2))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "rb", - "prompt": "# Your task is to write a function that returns true if a number x is a simple\n# power of n and false in other cases.\n# x is a simple power of n if n**int=x\n# For example:\n# is_simple_power(1, 4) => true\n# is_simple_power(2, 2) => true\n# is_simple_power(8, 2) => true\n# is_simple_power(3, 2) => false\n# is_simple_power(3, 1) => false\n# is_simple_power(5, 3) => false\ndef is_simple_power(x, n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_simple_power\n candidate = method(:is_simple_power)\n assert_equal(true, candidate.call(16, 2))\n assert_equal(false, candidate.call(143214, 16))\n assert_equal(true, candidate.call(4, 2))\n assert_equal(true, candidate.call(9, 3))\n assert_equal(true, candidate.call(16, 4))\n assert_equal(false, candidate.call(24, 2))\n assert_equal(false, candidate.call(128, 4))\n assert_equal(false, candidate.call(12, 6))\n assert_equal(true, candidate.call(1, 1))\n assert_equal(true, candidate.call(1, 12))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "rb", - "prompt": "# Write a function that returns true if the given number is the multiplication of 3 prime numbers\n# and false otherwise.\n# Knowing that (a) is less then 100. \n# Example:\n# is_multiply_prime(30) == True\n# 30 = 2 * 3 * 5\ndef is_multiply_prime(a)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_multiply_prime\n candidate = method(:is_multiply_prime)\n assert_equal(false, candidate.call(5))\n assert_equal(true, candidate.call(30))\n assert_equal(true, candidate.call(8))\n assert_equal(false, candidate.call(10))\n assert_equal(true, candidate.call(125))\n assert_equal(true, candidate.call(105))\n assert_equal(false, candidate.call(126))\n assert_equal(false, candidate.call(729))\n assert_equal(false, candidate.call(891))\n assert_equal(true, candidate.call(1001))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "rb", - "prompt": "# Given the lengths of the three sides of a triangle. Return True if the three\n# sides form a right-angled triangle, False otherwise.\n# A right-angled triangle is a triangle in which one angle is right angle or \n# 90 degree.\n# Example:\n# right_angle_triangle(3, 4, 5) == True\n# right_angle_triangle(1, 2, 3) == False\ndef right_angle_triangle(a, b, c)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_right_angle_triangle\n candidate = method(:right_angle_triangle)\n assert_equal(true, candidate.call(3, 4, 5))\n assert_equal(false, candidate.call(1, 2, 3))\n assert_equal(true, candidate.call(10, 6, 8))\n assert_equal(false, candidate.call(2, 2, 2))\n assert_equal(true, candidate.call(7, 24, 25))\n assert_equal(false, candidate.call(10, 5, 7))\n assert_equal(true, candidate.call(5, 12, 13))\n assert_equal(true, candidate.call(15, 8, 17))\n assert_equal(true, candidate.call(48, 55, 73))\n assert_equal(false, candidate.call(1, 1, 1))\n assert_equal(false, candidate.call(2, 2, 10))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "rb", - "prompt": "# Create a function that takes 3 numbers.\n# Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n# Returns false in any other cases.\n# Examples\n# any_int(5, 2, 7) \u279e True\n# any_int(3, 2, 2) \u279e False\n# any_int(3, -2, 1) \u279e True\n# any_int(3.6, -2.2, 2) \u279e False\ndef any_int(x, y, z)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_any_int\n candidate = method(:any_int)\n assert_equal(true, candidate.call(2, 3, 1))\n assert_equal(false, candidate.call(2.5, 2, 3))\n assert_equal(false, candidate.call(1.5, 5, 3.5))\n assert_equal(false, candidate.call(2, 6, 2))\n assert_equal(true, candidate.call(4, 2, 2))\n assert_equal(false, candidate.call(2.2, 2.2, 2.2))\n assert_equal(true, candidate.call(-4, 6, 2))\n assert_equal(true, candidate.call(2, 1, 1))\n assert_equal(true, candidate.call(3, 4, 7))\n assert_equal(false, candidate.call(3.0, 4, 7))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "rb", - "prompt": "# This function takes a list l and returns a list l' such that\n# l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n# to the values of the corresponding indicies of l, but sorted.\n# >>> sort_third([1, 2, 3])\n# [1, 2, 3]\n# >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n# [2, 6, 3, 4, 8, 9, 5]\ndef sort_third(l)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sort_third\n candidate = method(:sort_third)\n assert_equal([2, 6, 3, 4, 8, 9, 5], candidate.call([5, 6, 3, 4, 8, 9, 2]))\n assert_equal([2, 8, 3, 4, 6, 9, 5], candidate.call([5, 8, 3, 4, 6, 9, 2]))\n assert_equal([2, 6, 9, 4, 8, 3, 5], candidate.call([5, 6, 9, 4, 8, 3, 2]))\n assert_equal([2, 6, 3, 4, 8, 9, 5, 1], candidate.call([5, 6, 3, 4, 8, 9, 2, 1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_53_add", - "language": "rb", - "prompt": "# Add two numbers x and y\n# >>> add(2, 3)\n# 5\n# >>> add(5, 7)\n# 12\ndef add(x, y)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_add\n candidate = method(:add)\n assert_equal(1, candidate.call(0, 1))\n assert_equal(1, candidate.call(1, 0))\n assert_equal(5, candidate.call(2, 3))\n assert_equal(12, candidate.call(5, 7))\n assert_equal(12, candidate.call(7, 5))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_69_search", - "language": "rb", - "prompt": "# You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n# zero, and has a frequency greater than or equal to the value of the integer itself. \n# The frequency of an integer is the number of times it appears in the list.\n# If no such a value exist, return -1.\n# Examples:\n# search([4, 1, 2, 2, 3, 1]) == 2\n# search([1, 2, 2, 3, 3, 3, 4, 4, 4]) == 3\n# search([5, 5, 4, 4, 4]) == -1\ndef search(lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_search\n candidate = method(:search)\n assert_equal(1, candidate.call([5, 5, 5, 5, 1]))\n assert_equal(4, candidate.call([4, 1, 4, 1, 4, 4]))\n assert_equal(-1, candidate.call([3, 3]))\n assert_equal(8, candidate.call([8, 8, 8, 8, 8, 8, 8, 8]))\n assert_equal(2, candidate.call([2, 3, 3, 2, 2]))\n assert_equal(1, candidate.call([2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]))\n assert_equal(2, candidate.call([3, 2, 8, 2]))\n assert_equal(1, candidate.call([6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]))\n assert_equal(-1, candidate.call([8, 8, 3, 6, 5, 6, 4]))\n assert_equal(1, candidate.call([6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]))\n assert_equal(1, candidate.call([1, 9, 10, 1, 3]))\n assert_equal(5, candidate.call([6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]))\n assert_equal(1, candidate.call([1]))\n assert_equal(4, candidate.call([8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]))\n assert_equal(2, candidate.call([2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]))\n assert_equal(1, candidate.call([1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]))\n assert_equal(4, candidate.call([9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]))\n assert_equal(4, candidate.call([2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]))\n assert_equal(2, candidate.call([9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]))\n assert_equal(-1, candidate.call([5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]))\n assert_equal(-1, candidate.call([10]))\n assert_equal(2, candidate.call([9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]))\n assert_equal(1, candidate.call([5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]))\n assert_equal(1, candidate.call([7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]))\n assert_equal(-1, candidate.call([3, 10, 10, 9, 2]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "rb", - "prompt": "# Write a function that takes a string and returns True if the string\n# length is a prime number or False otherwise\n# Examples\n# prime_length('Hello') == True\n# prime_length('abcdcba') == True\n# prime_length('kittens') == True\n# prime_length('orange') == False\ndef prime_length(string)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_prime_length\n candidate = method(:prime_length)\n assert_equal(true, candidate.call(\"Hello\"))\n assert_equal(true, candidate.call(\"abcdcba\"))\n assert_equal(true, candidate.call(\"kittens\"))\n assert_equal(false, candidate.call(\"orange\"))\n assert_equal(true, candidate.call(\"wow\"))\n assert_equal(true, candidate.call(\"world\"))\n assert_equal(true, candidate.call(\"MadaM\"))\n assert_equal(true, candidate.call(\"Wow\"))\n assert_equal(false, candidate.call(\"\"))\n assert_equal(true, candidate.call(\"HI\"))\n assert_equal(true, candidate.call(\"go\"))\n assert_equal(false, candidate.call(\"gogo\"))\n assert_equal(false, candidate.call(\"aaaaaaaaaaaaaaa\"))\n assert_equal(true, candidate.call(\"Madam\"))\n assert_equal(false, candidate.call(\"M\"))\n assert_equal(false, candidate.call(\"0\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_58_common", - "language": "rb", - "prompt": "# Return sorted unique common elements for two lists.\n# >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n# [1, 5, 653]\n# >>> common([5, 3, 2, 8], [3, 2])\n# [2, 3]\ndef common(l1, l2)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_common\n candidate = method(:common)\n assert_equal([1, 5, 653], candidate.call([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]))\n assert_equal([2, 3], candidate.call([5, 3, 2, 8], [3, 2]))\n assert_equal([2, 3, 4], candidate.call([4, 3, 2, 8], [3, 2, 4]))\n assert_equal([], candidate.call([4, 3, 2, 8], []))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "rb", - "prompt": "# The Brazilian factorial is defined as:\n# brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n# where n > 0\n# For example:\n# >>> special_factorial(4)\n# 288\n# The function will receive an integer as input and should return the special\n# factorial of this integer.\ndef special_factorial(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_special_factorial\n candidate = method(:special_factorial)\n assert_equal(288, candidate.call(4))\n assert_equal(34560, candidate.call(5))\n assert_equal(125411328000, candidate.call(7))\n assert_equal(1, candidate.call(1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "rb", - "prompt": "# In this problem, you will implement a function that takes two lists of numbers,\n# and determines whether it is possible to perform an exchange of elements\n# between them to make lst1 a list of only even numbers.\n# There is no limit on the number of exchanged elements between lst1 and lst2.\n# If it is possible to exchange elements between the lst1 and lst2 to make\n# all the elements of lst1 to be even, return \"YES\".\n# Otherwise, return \"NO\".\n# For example:\n# exchange([1, 2, 3, 4], [1, 2, 3, 4]) => \"YES\"\n# exchange([1, 2, 3, 4], [1, 5, 3, 4]) => \"NO\"\n# It is assumed that the input lists will be non-empty.\ndef exchange(lst1, lst2)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_exchange\n candidate = method(:exchange)\n assert_equal(\"YES\", candidate.call([1, 2, 3, 4], [1, 2, 3, 4]))\n assert_equal(\"NO\", candidate.call([1, 2, 3, 4], [1, 5, 3, 4]))\n assert_equal(\"YES\", candidate.call([1, 2, 3, 4], [2, 1, 4, 3]))\n assert_equal(\"YES\", candidate.call([5, 7, 3], [2, 6, 4]))\n assert_equal(\"NO\", candidate.call([5, 7, 3], [2, 6, 3]))\n assert_equal(\"NO\", candidate.call([3, 2, 6, 1, 8, 9], [3, 5, 5, 1, 1, 1]))\n assert_equal(\"YES\", candidate.call([100, 200], [200, 200]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "rb", - "prompt": "# Given a non-empty array of integers arr and an integer k, return\n# the sum of the elements with at most two digits from the first k elements of arr.\n# Example:\n# Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4\n# Output: 24 # sum of 21 + 3\n# Constraints:\n# 1. 1 <= len(arr) <= 100\n# 2. 1 <= k <= len(arr)\ndef add_elements(arr, k)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_add_elements\n candidate = method(:add_elements)\n assert_equal(-4, candidate.call([1, -2, -3, 41, 57, 76, 87, 88, 99], 3))\n assert_equal(0, candidate.call([111, 121, 3, 4000, 5, 6], 2))\n assert_equal(125, candidate.call([11, 21, 3, 90, 5, 6, 7, 8, 9], 4))\n assert_equal(24, candidate.call([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4))\n assert_equal(1, candidate.call([1], 1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "rb", - "prompt": "# A simple program which should return the value of x if n is \n# a prime number and should return the value of y otherwise.\n# Examples:\n# for x_or_y(7, 34, 12) == 34\n# for x_or_y(15, 8, 5) == 5\ndef x_or_y(n, x, y)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_x_or_y\n candidate = method(:x_or_y)\n assert_equal(34, candidate.call(7, 34, 12))\n assert_equal(5, candidate.call(15, 8, 5))\n assert_equal(33, candidate.call(3, 33, 5212))\n assert_equal(3, candidate.call(1259, 3, 52))\n assert_equal(-1, candidate.call(7919, -1, 12))\n assert_equal(583, candidate.call(3609, 1245, 583))\n assert_equal(129, candidate.call(91, 56, 129))\n assert_equal(1234, candidate.call(6, 34, 1234))\n assert_equal(0, candidate.call(1, 2, 0))\n assert_equal(2, candidate.call(2, 2, 0))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "rb", - "prompt": "# Given length of a side and high return area for a triangle.\n# >>> triangle_area(5, 3)\n# 7.5\ndef triangle_area(a, h)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_triangle_area\n candidate = method(:triangle_area)\n assert_equal(7.5, candidate.call(5, 3))\n assert_equal(2.0, candidate.call(2, 2))\n assert_equal(40.0, candidate.call(10, 8))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "rb", - "prompt": "# Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n# the last couple centuries. However, what people don't know is Tribonacci sequence.\n# Tribonacci sequence is defined by the recurrence:\n# tri(1) = 3\n# tri(n) = 1 + n / 2, if n is even.\n# tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n# For example:\n# tri(2) = 1 + (2 / 2) = 2\n# tri(4) = 3\n# tri(3) = tri(2) + tri(1) + tri(4)\n# = 2 + 3 + 3 = 8 \n# You are given a non-negative integer number n, you have to a return a list of the \n# first n + 1 numbers of the Tribonacci sequence.\n# Examples:\n# tri(3) = [1, 3, 2, 8]\ndef tri(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_tri\n candidate = method(:tri)\n assert_equal([1, 3, 2, 8], candidate.call(3))\n assert_equal([1, 3, 2, 8, 3], candidate.call(4))\n assert_equal([1, 3, 2, 8, 3, 15], candidate.call(5))\n assert_equal([1, 3, 2, 8, 3, 15, 4], candidate.call(6))\n assert_equal([1, 3, 2, 8, 3, 15, 4, 24], candidate.call(7))\n assert_equal([1, 3, 2, 8, 3, 15, 4, 24, 5], candidate.call(8))\n assert_equal([1, 3, 2, 8, 3, 15, 4, 24, 5, 35], candidate.call(9))\n assert_equal([1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11], candidate.call(20))\n assert_equal([1], candidate.call(0))\n assert_equal([1, 3], candidate.call(1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "rb", - "prompt": "# You are given a list of two strings, both strings consist of open\n# parentheses '(' or close parentheses ')' only.\n# Your job is to check if it is possible to concatenate the two strings in\n# some order, that the resulting string will be good.\n# A string S is considered to be good if and only if all parentheses in S\n# are balanced. For example: the string '(())()' is good, while the string\n# '())' is not.\n# Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n# Examples:\n# match_parens(['()(', ')']) == 'Yes'\n# match_parens([')', ')']) == 'No'\ndef match_parens(lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_match_parens\n candidate = method(:match_parens)\n assert_equal(\"Yes\", candidate.call([\"()(\", \")\"]))\n assert_equal(\"No\", candidate.call([\")\", \")\"]))\n assert_equal(\"No\", candidate.call([\"(()(())\", \"())())\"]))\n assert_equal(\"Yes\", candidate.call([\")())\", \"(()()(\"]))\n assert_equal(\"Yes\", candidate.call([\"(())))\", \"(()())((\"]))\n assert_equal(\"No\", candidate.call([\"()\", \"())\"]))\n assert_equal(\"Yes\", candidate.call([\"(()(\", \"()))()\"]))\n assert_equal(\"No\", candidate.call([\"((((\", \"((())\"]))\n assert_equal(\"No\", candidate.call([\")(()\", \"(()(\"]))\n assert_equal(\"No\", candidate.call([\")(\", \")(\"]))\n assert_equal(\"Yes\", candidate.call([\"(\", \")\"]))\n assert_equal(\"Yes\", candidate.call([\")\", \"(\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "rb", - "prompt": "# From a list of integers, remove all elements that occur more than once.\n# Keep order of elements left the same as in the input.\n# >>> remove_duplicates([1, 2, 3, 2, 4])\n# [1, 3, 4]\ndef remove_duplicates(numbers)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_remove_duplicates\n candidate = method(:remove_duplicates)\n assert_equal([], candidate.call([]))\n assert_equal([1, 2, 3, 4], candidate.call([1, 2, 3, 4]))\n assert_equal([1, 4, 5], candidate.call([1, 2, 3, 2, 4, 3, 5]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "rb", - "prompt": "# Return a greatest common divisor of two integers a and b\n# >>> greatest_common_divisor(3, 5)\n# 1\n# >>> greatest_common_divisor(25, 15)\n# 5\ndef greatest_common_divisor(a, b)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_greatest_common_divisor\n candidate = method(:greatest_common_divisor)\n assert_equal(1, candidate.call(3, 7))\n assert_equal(5, candidate.call(10, 15))\n assert_equal(7, candidate.call(49, 14))\n assert_equal(12, candidate.call(144, 60))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "rb", - "prompt": "# Checks if given string is a palindrome\n# >>> is_palindrome('')\n# True\n# >>> is_palindrome('aba')\n# True\n# >>> is_palindrome('aaaaa')\n# True\n# >>> is_palindrome('zbcd')\n# False\ndef is_palindrome(text)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_palindrome\n candidate = method(:is_palindrome)\n assert_equal(true, candidate.call(\"\"))\n assert_equal(true, candidate.call(\"aba\"))\n assert_equal(true, candidate.call(\"aaaaa\"))\n assert_equal(false, candidate.call(\"zbcd\"))\n assert_equal(true, candidate.call(\"xywyx\"))\n assert_equal(false, candidate.call(\"xywyz\"))\n assert_equal(false, candidate.call(\"xywzx\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "rb", - "prompt": "# xs represent coefficients of a polynomial.\n# xs[0] + xs[1] * x + xs[2] * x^2 + ....\n# Return derivative of this polynomial in the same form.\n# >>> derivative([3, 1, 2, 4, 5])\n# [1, 4, 12, 20]\n# >>> derivative([1, 2, 3])\n# [2, 6]\ndef derivative(xs)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_derivative\n candidate = method(:derivative)\n assert_equal([1, 4, 12, 20], candidate.call([3, 1, 2, 4, 5]))\n assert_equal([2, 6], candidate.call([1, 2, 3]))\n assert_equal([2, 2], candidate.call([3, 2, 1]))\n assert_equal([2, 2, 0, 16], candidate.call([3, 2, 1, 0, 4]))\n assert_equal([], candidate.call([1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "rb", - "prompt": "# In this task, you will be given a string that represents a number of apples and oranges \n# that are distributed in a basket of fruit this basket contains \n# apples, oranges, and mango fruits. Given the string that represents the total number of \n# the oranges and apples and an integer that represent the total number of the fruits \n# in the basket return the number of the mango fruits in the basket.\n# for examble:\n# fruit_distribution(\"5 apples and 6 oranges\", 19) ->19 - 5 - 6 = 8\n# fruit_distribution(\"0 apples and 1 oranges\",3) -> 3 - 0 - 1 = 2\n# fruit_distribution(\"2 apples and 3 oranges\", 100) -> 100 - 2 - 3 = 95\n# fruit_distribution(\"100 apples and 1 oranges\",120) -> 120 - 100 - 1 = 19\ndef fruit_distribution(s, n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_fruit_distribution\n candidate = method(:fruit_distribution)\n assert_equal(8, candidate.call(\"5 apples and 6 oranges\", 19))\n assert_equal(10, candidate.call(\"5 apples and 6 oranges\", 21))\n assert_equal(2, candidate.call(\"0 apples and 1 oranges\", 3))\n assert_equal(2, candidate.call(\"1 apples and 0 oranges\", 3))\n assert_equal(95, candidate.call(\"2 apples and 3 oranges\", 100))\n assert_equal(0, candidate.call(\"2 apples and 3 oranges\", 5))\n assert_equal(19, candidate.call(\"1 apples and 100 oranges\", 120))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "rb", - "prompt": "# Write a function that takes an integer a and returns True \n# if this ingeger is a cube of some integer number.\n# Note: you may assume the input is always valid.\n# Examples:\n# iscube(1) ==> True\n# iscube(2) ==> False\n# iscube(-1) ==> True\n# iscube(64) ==> True\n# iscube(0) ==> True\n# iscube(180) ==> False\ndef iscube(a)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_iscube\n candidate = method(:iscube)\n assert_equal(true, candidate.call(1))\n assert_equal(false, candidate.call(2))\n assert_equal(true, candidate.call(-1))\n assert_equal(true, candidate.call(64))\n assert_equal(false, candidate.call(180))\n assert_equal(true, candidate.call(1000))\n assert_equal(true, candidate.call(0))\n assert_equal(false, candidate.call(1729))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "rb", - "prompt": "# In this Kata, you have to sort an array of non-negative integers according to\n# number of ones in their binary representation in ascending order.\n# For similar number of ones, sort based on decimal value.\n# It must be implemented like this:\n# >>> sort_array([1, 5, 2, 3, 4]) == [1, 2, 3, 4, 5]\n# >>> sort_array([-2, -3, -4, -5, -6]) == [-6, -5, -4, -3, -2]\n# >>> sort_array([1, 0, 2, 3, 4]) [0, 1, 2, 3, 4]\ndef sort_array(arr)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sort_array\n candidate = method(:sort_array)\n assert_equal([1, 2, 4, 3, 5], candidate.call([1, 5, 2, 3, 4]))\n assert_equal([-4, -2, -6, -5, -3], candidate.call([-2, -3, -4, -5, -6]))\n assert_equal([0, 1, 2, 4, 3], candidate.call([1, 0, 2, 3, 4]))\n assert_equal([], candidate.call([]))\n assert_equal([2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77], candidate.call([2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]))\n assert_equal([32, 3, 5, 6, 12, 44], candidate.call([3, 6, 44, 12, 32, 5]))\n assert_equal([2, 4, 8, 16, 32], candidate.call([2, 4, 8, 16, 32]))\n assert_equal([2, 4, 8, 16, 32], candidate.call([2, 4, 8, 16, 32]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "rb", - "prompt": "# Given a list of strings, where each string consists of only digits, return a list.\n# Each element i of the output should be \"the number of odd elements in the\n# string i of the input.\" where all the i's should be replaced by the number\n# of odd digits in the i'th string of the input.\n# >>> odd_count(['1234567'])\n# [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n# >>> odd_count(['3',\"11111111\"])\n# [\"the number of odd elements 1n the str1ng 1 of the 1nput.\",\n# \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\ndef odd_count(lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_odd_count\n candidate = method(:odd_count)\n assert_equal([\"the number of odd elements 4n the str4ng 4 of the 4nput.\"], candidate.call([\"1234567\"]))\n assert_equal([\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\"], candidate.call([\"3\", \"11111111\"]))\n assert_equal([\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"], candidate.call([\"271\", \"137\", \"314\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "rb", - "prompt": "# brackets is a string of \"(\" and \")\".\n# return True if every opening bracket has a corresponding closing bracket.\n# >>> correct_bracketing(\"(\")\n# False\n# >>> correct_bracketing(\"()\")\n# True\n# >>> correct_bracketing(\"(()())\")\n# True\n# >>> correct_bracketing(\")(()\")\n# False\ndef correct_bracketing(brackets)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_correct_bracketing\n candidate = method(:correct_bracketing)\n assert_equal(true, candidate.call(\"()\"))\n assert_equal(true, candidate.call(\"(()())\"))\n assert_equal(true, candidate.call(\"()()(()())()\"))\n assert_equal(true, candidate.call(\"()()((()()())())(()()(()))\"))\n assert_equal(false, candidate.call(\"((()())))\"))\n assert_equal(false, candidate.call(\")(()\"))\n assert_equal(false, candidate.call(\"(\"))\n assert_equal(false, candidate.call(\"((((\"))\n assert_equal(false, candidate.call(\")\"))\n assert_equal(false, candidate.call(\"(()\"))\n assert_equal(false, candidate.call(\"()()(()())())(()\"))\n assert_equal(false, candidate.call(\"()()(()())()))()\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "rb", - "prompt": "# Task\n# Write a function that takes a string as input and returns the sum of the upper characters only'\n# ASCII codes.\n# Examples:\n# digitSum(\"\") => 0\n# digitSum(\"abAB\") => 131\n# digitSum(\"abcCd\") => 67\n# digitSum(\"helloE\") => 69\n# digitSum(\"woArBld\") => 131\n# digitSum(\"aAaaaXa\") => 153\ndef digitSum(s)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_digitSum\n candidate = method(:digitSum)\n assert_equal(0, candidate.call(\"\"))\n assert_equal(131, candidate.call(\"abAB\"))\n assert_equal(67, candidate.call(\"abcCd\"))\n assert_equal(69, candidate.call(\"helloE\"))\n assert_equal(131, candidate.call(\"woArBld\"))\n assert_equal(153, candidate.call(\"aAaaaXa\"))\n assert_equal(151, candidate.call(\" How are yOu?\"))\n assert_equal(327, candidate.call(\"You arE Very Smart\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "rb", - "prompt": "# Write a function that accepts a list of strings as a parameter,\n# deletes the strings that have odd lengths from it,\n# and returns the resulted list with a sorted order,\n# The list is always a list of strings and never an array of numbers,\n# and it may contain duplicates.\n# The order of the list should be ascending by length of each word, and you\n# should return the list sorted by that rule.\n# If two words have the same length, sort the list alphabetically.\n# The function should return a list of strings in sorted order.\n# You may assume that all words will have the same length.\n# For example:\n# assert list_sort([\"aa\", \"a\", \"aaa\"]) => [\"aa\"]\n# assert list_sort([\"ab\", \"a\", \"aaa\", \"cd\"]) => [\"ab\", \"cd\"]\ndef sorted_list_sum(lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sorted_list_sum\n candidate = method(:sorted_list_sum)\n assert_equal([\"aa\"], candidate.call([\"aa\", \"a\", \"aaa\"]))\n assert_equal([\"AI\", \"asdf\", \"school\"], candidate.call([\"school\", \"AI\", \"asdf\", \"b\"]))\n assert_equal([], candidate.call([\"d\", \"b\", \"c\", \"a\"]))\n assert_equal([\"abcd\", \"dcba\"], candidate.call([\"d\", \"dcba\", \"abcd\", \"a\"]))\n assert_equal([\"AI\", \"ai\", \"au\"], candidate.call([\"AI\", \"ai\", \"au\"]))\n assert_equal([], candidate.call([\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"]))\n assert_equal([\"cc\", \"dd\", \"aaaa\", \"bbbb\"], candidate.call([\"aaaa\", \"bbbb\", \"dd\", \"cc\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "rb", - "prompt": "# You are given an array arr of integers and you need to return\n# sum of magnitudes of integers multiplied by product of all signs\n# of each number in the array, represented by 1, -1 or 0.\n# Note: return None for empty arr.\n# Example:\n# >>> prod_signs([1, 2, 2, -4]) == -9\n# >>> prod_signs([0, 1]) == 0\n# >>> prod_signs([]) == None\ndef prod_signs(arr)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_prod_signs\n candidate = method(:prod_signs)\n assert_equal(-9, candidate.call([1, 2, 2, -4]))\n assert_equal(0, candidate.call([0, 1]))\n assert_equal(-10, candidate.call([1, 1, 1, 2, 3, -1, 1]))\n assert_equal(nil, candidate.call([]))\n assert_equal(20, candidate.call([2, 4, 1, 2, -1, -1, 9]))\n assert_equal(4, candidate.call([-1, 1, -1, 1]))\n assert_equal(-4, candidate.call([-1, 1, 1, 1]))\n assert_equal(0, candidate.call([-1, 1, 1, 0]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "rb", - "prompt": "# Return list with elements incremented by 1.\n# >>> incr_list([1, 2, 3])\n# [2, 3, 4]\n# >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123])\n# [6, 4, 6, 3, 4, 4, 10, 1, 124]\ndef incr_list(l)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_incr_list\n candidate = method(:incr_list)\n assert_equal([], candidate.call([]))\n assert_equal([4, 3, 2], candidate.call([3, 2, 1]))\n assert_equal([6, 3, 6, 3, 4, 4, 10, 1, 124], candidate.call([5, 2, 5, 2, 3, 3, 9, 0, 123]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "rb", - "prompt": "# From a given list of integers, generate a list of rolling maximum element found until given moment\n# in the sequence.\n# >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n# [1, 2, 3, 3, 3, 4, 4]\ndef rolling_max(numbers)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_rolling_max\n candidate = method(:rolling_max)\n assert_equal([], candidate.call([]))\n assert_equal([1, 2, 3, 4], candidate.call([1, 2, 3, 4]))\n assert_equal([4, 4, 4, 4], candidate.call([4, 3, 2, 1]))\n assert_equal([3, 3, 3, 100, 100], candidate.call([3, 2, 3, 100, 3]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "rb", - "prompt": "# Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n# separate those group into separate strings and return the list of those.\n# Separate groups are balanced (each open brace is properly closed) and not nested within each other\n# Ignore any spaces in the input string.\n# >>> separate_paren_groups('( ) (( )) (( )( ))')\n# ['()', '(())', '(()())']\ndef separate_paren_groups(paren_string)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_separate_paren_groups\n candidate = method(:separate_paren_groups)\n assert_equal([\"(()())\", \"((()))\", \"()\", \"((())()())\"], candidate.call(\"(()()) ((())) () ((())()())\"))\n assert_equal([\"()\", \"(())\", \"((()))\", \"(((())))\"], candidate.call(\"() (()) ((())) (((())))\"))\n assert_equal([\"(()(())((())))\"], candidate.call(\"(()(())((())))\"))\n assert_equal([\"()\", \"(())\", \"(()())\"], candidate.call(\"( ) (( )) (( )( ))\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "rb", - "prompt": "# You will be given a string of words separated by commas or spaces. Your task is\n# to split the string into words and return an array of the words.\n# For example:\n# words_string(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n# words_string(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\ndef words_string(s)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_words_string\n candidate = method(:words_string)\n assert_equal([\"Hi\", \"my\", \"name\", \"is\", \"John\"], candidate.call(\"Hi, my name is John\"))\n assert_equal([\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"], candidate.call(\"One, two, three, four, five, six\"))\n assert_equal([\"Hi\", \"my\", \"name\"], candidate.call(\"Hi, my name\"))\n assert_equal([\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"], candidate.call(\"One,, two, three, four, five, six,\"))\n assert_equal([], candidate.call(\"\"))\n assert_equal([\"ahmed\", \"gamal\"], candidate.call(\"ahmed , gamal\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "rb", - "prompt": "# Create a function that takes integers, floats, or strings representing\n# real numbers, and returns the larger variable in its given variable type.\n# Return None if the values are equal.\n# Note: If a real number is represented as a string, the floating point might be . or ,\n# compare_one(1, 2.5) \u279e 2.5\n# compare_one(1, \"2,3\") \u279e \"2,3\"\n# compare_one(\"5,1\", \"6\") \u279e \"6\"\n# compare_one(\"1\", 1) \u279e None\ndef compare_one(a, b)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_137_compare_one.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_compare_one\n candidate = method(:compare_one)\n assert_equal(2, candidate.call(1, 2))\n assert_equal(2.5, candidate.call(1, 2.5))\n assert_equal(3, candidate.call(2, 3))\n assert_equal(6, candidate.call(5, 6))\n assert_equal(\"2,3\", candidate.call(1, \"2,3\"))\n assert_equal(\"6\", candidate.call(\"5,1\", \"6\"))\n assert_equal(\"2\", candidate.call(\"1\", \"2\"))\n assert_equal(nil, candidate.call(\"1\", 1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "rb", - "prompt": "# Filter given list of any python values only for integers\n# >>> filter_integers(['a', 3.14, 5])\n# [5]\n# >>> filter_integers([1, 2, 3, 'abc', {}, []])\n# [1, 2, 3]\ndef filter_integers(values)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_filter_integers\n candidate = method(:filter_integers)\n assert_equal([], candidate.call([]))\n assert_equal([4, 9], candidate.call([4, {}, [], 23.2, 9, \"adasd\"]))\n assert_equal([3, 3, 3], candidate.call([3, \"c\", 3, 3, \"a\", \"b\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "rb", - "prompt": "# This function takes a list l and returns a list l' such that\n# l' is identical to l in the odd indicies, while its values at the even indicies are equal\n# to the values of the even indicies of l, but sorted.\n# >>> sort_even([1, 2, 3])\n# [1, 2, 3]\n# >>> sort_even([5, 6, 3, 4])\n# [3, 6, 5, 4]\ndef sort_even(l)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sort_even\n candidate = method(:sort_even)\n assert_equal([1, 2, 3], candidate.call([1, 2, 3]))\n assert_equal([-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123], candidate.call([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]))\n assert_equal([-12, 8, 3, 4, 5, 2, 12, 11, 23, -10], candidate.call([5, 8, -12, 4, 23, 2, 3, 11, 12, -10]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "rb", - "prompt": "# I think we all remember that feeling when the result of some long-awaited\n# event is finally known. The feelings and thoughts you have at that moment are\n# definitely worth noting down and comparing.\n# Your task is to determine if a person correctly guessed the results of a number of matches.\n# You are given two arrays of scores and guesses of equal length, where each index shows a match. \n# Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n# the value is 0, and if not, the value is the absolute difference between the guess and the score.\n# example:\n# compare([1,2,3,4,5,1],[1,2,3,4,2,-2]) -> [0,0,0,0,3,3]\n# compare([0,5,0,0,0,4],[4,1,1,0,0,-2]) -> [4,4,1,0,0,6]\ndef compare(game, guess)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_compare\n candidate = method(:compare)\n assert_equal([0, 0, 0, 0, 3, 3], candidate.call([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2]))\n assert_equal([0, 0, 0, 0, 0, 0], candidate.call([0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]))\n assert_equal([2, 4, 6], candidate.call([1, 2, 3], [-1, -2, -3]))\n assert_equal([2, 0, 0, 1], candidate.call([1, 2, 3, 5], [-1, 2, 3, 4]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "rb", - "prompt": "# Given a positive integer n, return a tuple that has the number of even and odd\n# integer palindromes that fall within the range(1, n), inclusive.\n# Example 1:\n# Input: 3\n# Output: (1, 2)\n# Explanation:\n# Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n# Example 2:\n# Input: 12\n# Output: (4, 6)\n# Explanation:\n# Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n# Note:\n# 1. 1 <= n <= 10^3\n# 2. returned tuple has the number of even and odd integer palindromes respectively.\ndef even_odd_palindrome(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_even_odd_palindrome\n candidate = method(:even_odd_palindrome)\n assert_equal([8, 13], candidate.call(123))\n assert_equal([4, 6], candidate.call(12))\n assert_equal([1, 2], candidate.call(3))\n assert_equal([6, 8], candidate.call(63))\n assert_equal([5, 6], candidate.call(25))\n assert_equal([4, 6], candidate.call(19))\n assert_equal([4, 5], candidate.call(9))\n assert_equal([0, 1], candidate.call(1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "rb", - "prompt": "# The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fib4(0) -> 0\n# fib4(1) -> 0\n# fib4(2) -> 2\n# fib4(3) -> 0\n# fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n# Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n# >>> fib4(5)\n# 4\n# >>> fib4(6)\n# 8\n# >>> fib4(7)\n# 14\ndef fib4(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_fib4\n candidate = method(:fib4)\n assert_equal(4, candidate.call(5))\n assert_equal(28, candidate.call(8))\n assert_equal(104, candidate.call(10))\n assert_equal(386, candidate.call(12))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "rb", - "prompt": "# Given two positive integers a and b, return the even digits between a\n# and b, in ascending order.\n# For example:\n# generate_integers(2, 8) => [2, 4, 6, 8]\n# generate_integers(8, 2) => [2, 4, 6, 8]\n# generate_integers(10, 14) => []\ndef generate_integers(a, b)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_generate_integers\n candidate = method(:generate_integers)\n assert_equal([2, 4, 6, 8], candidate.call(2, 10))\n assert_equal([2, 4, 6, 8], candidate.call(10, 2))\n assert_equal([2, 4, 6, 8], candidate.call(132, 2))\n assert_equal([], candidate.call(17, 89))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "rb", - "prompt": "# For a given list of input numbers, calculate Mean Absolute Deviation\n# around the mean of this dataset.\n# Mean Absolute Deviation is the average absolute difference between each\n# element and a centerpoint (mean in this case):\n# MAD = average | x - x_mean |\n# >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n# 1.0\ndef mean_absolute_deviation(numbers)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_mean_absolute_deviation\n candidate = method(:mean_absolute_deviation)\n assert_equal(0.5, candidate.call([1.0, 2.0]))\n assert_equal(1.0, candidate.call([1.0, 2.0, 3.0, 4.0]))\n assert_equal(1.2, candidate.call([1.0, 2.0, 3.0, 4.0, 5.0]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "rb", - "prompt": "# Create a function encrypt that takes a string as an argument and\n# returns a string encrypted with the alphabet being rotated. \n# The alphabet should be rotated in a manner such that the letters \n# shift down by two multiplied to two places.\n# For example:\n# encrypt('hi') returns 'lm'\n# encrypt('asdfghjkl') returns 'ewhjklnop'\n# encrypt('gf') returns 'kj'\n# encrypt('et') returns 'ix'\ndef encrypt(s)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_encrypt\n candidate = method(:encrypt)\n assert_equal(\"lm\", candidate.call(\"hi\"))\n assert_equal(\"ewhjklnop\", candidate.call(\"asdfghjkl\"))\n assert_equal(\"kj\", candidate.call(\"gf\"))\n assert_equal(\"ix\", candidate.call(\"et\"))\n assert_equal(\"jeiajeaijeiak\", candidate.call(\"faewfawefaewg\"))\n assert_equal(\"lippsqcjvmirh\", candidate.call(\"hellomyfriend\"))\n assert_equal(\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\", candidate.call(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\"))\n assert_equal(\"e\", candidate.call(\"a\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "rb", - "prompt": "# Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n# The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n# as follows: start with any positive integer n. Then each term is obtained from the \n# previous term as follows: if the previous term is even, the next term is one half of \n# the previous term. If the previous term is odd, the next term is 3 times the previous\n# term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n# Note: \n# 1. Collatz(1) is [1].\n# 2. returned list sorted in increasing order.\n# For example:\n# get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\ndef get_odd_collatz(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_get_odd_collatz\n candidate = method(:get_odd_collatz)\n assert_equal([1, 5, 7, 11, 13, 17], candidate.call(14))\n assert_equal([1, 5], candidate.call(5))\n assert_equal([1, 3, 5], candidate.call(12))\n assert_equal([1], candidate.call(1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "rb", - "prompt": "# Find how many times a given substring can be found in the original string. Count overlaping cases.\n# >>> how_many_times('', 'a')\n# 0\n# >>> how_many_times('aaa', 'a')\n# 3\n# >>> how_many_times('aaaa', 'aa')\n# 3\ndef how_many_times(string, substring)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_how_many_times\n candidate = method(:how_many_times)\n assert_equal(0, candidate.call(\"\", \"x\"))\n assert_equal(4, candidate.call(\"xyxyxyx\", \"x\"))\n assert_equal(4, candidate.call(\"cacacacac\", \"cac\"))\n assert_equal(1, candidate.call(\"john doe\", \"john\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "rb", - "prompt": "# We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n# numbers in the array will be randomly ordered. Your task is to determine if\n# it is possible to get an array sorted in non-decreasing order by performing \n# the following operation on the given array:\n# You are allowed to perform right shift operation any number of times.\n# One right shift operation means shifting all elements of the array by one\n# position in the right direction. The last element of the array will be moved to\n# the starting position in the array i.e. 0th index. \n# If it is possible to obtain the sorted array by performing the above operation\n# then return True else return False.\n# If the given array is empty then return True.\n# Note: The given list is guaranteed to have unique elements.\n# For Example:\n# move_one_ball([3, 4, 5, 1, 2])==>True\n# Explanation: By performin 2 right shift operations, non-decreasing order can\n# be achieved for the given array.\n# move_one_ball([3, 5, 4, 1, 2])==>False\n# Explanation:It is not possible to get non-decreasing order for the given\n# array by performing any number of right shift operations.\ndef move_one_ball(arr)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_move_one_ball\n candidate = method(:move_one_ball)\n assert_equal(true, candidate.call([3, 4, 5, 1, 2]))\n assert_equal(true, candidate.call([3, 5, 10, 1, 2]))\n assert_equal(false, candidate.call([4, 3, 1, 2]))\n assert_equal(false, candidate.call([3, 5, 4, 1, 2]))\n assert_equal(true, candidate.call([]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "rb", - "prompt": "# Write a function which sorts the given list of integers\n# in ascending order according to the sum of their digits.\n# Note: if there are several items with similar sum of their digits,\n# order them based on their index in original list.\n# For example:\n# >>> order_by_points([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]\n# >>> order_by_points([]) == []\ndef order_by_points(nums)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_order_by_points\n candidate = method(:order_by_points)\n assert_equal([-1, -11, 1, -12, 11], candidate.call([1, 11, -1, -11, -12]))\n assert_equal([0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457], candidate.call([1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]))\n assert_equal([], candidate.call([]))\n assert_equal([-3, -32, -98, -11, 1, 2, 43, 54], candidate.call([1, -11, -32, 43, 54, -98, 2, -3]))\n assert_equal([1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9], candidate.call([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]))\n assert_equal([-76, -21, 0, 4, 23, 6, 6], candidate.call([0, 6, 6, -76, -21, 23, 4]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "rb", - "prompt": "# Return list of prime factors of given integer in the order from smallest to largest.\n# Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n# Input number should be equal to the product of all factors\n# >>> factorize(8)\n# [2, 2, 2]\n# >>> factorize(25)\n# [5, 5]\n# >>> factorize(70)\n# [2, 5, 7]\ndef factorize(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_factorize\n candidate = method(:factorize)\n assert_equal([2], candidate.call(2))\n assert_equal([2, 2], candidate.call(4))\n assert_equal([2, 2, 2], candidate.call(8))\n assert_equal([3, 19], candidate.call(57))\n assert_equal([3, 3, 19, 19], candidate.call(3249))\n assert_equal([3, 3, 3, 19, 19, 19], candidate.call(185193))\n assert_equal([3, 19, 19, 19], candidate.call(20577))\n assert_equal([2, 3, 3], candidate.call(18))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "rb", - "prompt": "# Return True if all numbers in the list l are below threshold t.\n# >>> below_threshold([1, 2, 4, 10], 100)\n# True\n# >>> below_threshold([1, 20, 4, 10], 5)\n# False\ndef below_threshold(l, t)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_below_threshold\n candidate = method(:below_threshold)\n assert_equal(true, candidate.call([1, 2, 4, 10], 100))\n assert_equal(false, candidate.call([1, 20, 4, 10], 5))\n assert_equal(true, candidate.call([1, 20, 4, 10], 21))\n assert_equal(true, candidate.call([1, 20, 4, 10], 22))\n assert_equal(true, candidate.call([1, 8, 4, 10], 11))\n assert_equal(false, candidate.call([1, 8, 4, 10], 10))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "rb", - "prompt": "# You are given two positive integers n and m, and your task is to compute the\n# average of the integers from n through m (including n and m). \n# Round the answer to the nearest integer and convert that to binary.\n# If n is greater than m, return -1.\n# Example:\n# rounded_avg(1, 5) => \"0b11\"\n# rounded_avg(7, 5) => -1\n# rounded_avg(10, 20) => \"0b1111\"\n# rounded_avg(20, 33) => \"0b11010\"\ndef rounded_avg(n, m)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_rounded_avg\n candidate = method(:rounded_avg)\n assert_equal(\"0b11\", candidate.call(1, 5))\n assert_equal(\"0b1010\", candidate.call(7, 13))\n assert_equal(\"0b1111001010\", candidate.call(964, 977))\n assert_equal(\"0b1111100100\", candidate.call(996, 997))\n assert_equal(\"0b1011000010\", candidate.call(560, 851))\n assert_equal(\"0b101101110\", candidate.call(185, 546))\n assert_equal(\"0b110101101\", candidate.call(362, 496))\n assert_equal(\"0b1001110010\", candidate.call(350, 902))\n assert_equal(\"0b11010111\", candidate.call(197, 233))\n assert_equal(-1, candidate.call(7, 5))\n assert_equal(-1, candidate.call(5, 1))\n assert_equal(\"0b101\", candidate.call(5, 5))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "rb", - "prompt": "# Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n# For each of the group, output the deepest level of nesting of parentheses.\n# E.g. (()()) has maximum two levels of nesting while ((())) has three.\n# >>> parse_nested_parens('(()()) ((())) () ((())()())')\n# [2, 3, 1, 3]\ndef parse_nested_parens(paren_string)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_parse_nested_parens\n candidate = method(:parse_nested_parens)\n assert_equal([2, 3, 1, 3], candidate.call(\"(()()) ((())) () ((())()())\"))\n assert_equal([1, 2, 3, 4], candidate.call(\"() (()) ((())) (((())))\"))\n assert_equal([4], candidate.call(\"(()(())((())))\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "rb", - "prompt": "# Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n# Examples\n# solution([5, 8, 7, 1]) ==> 12\n# solution([3, 3, 3, 3, 3]) ==> 9\n# solution([30, 13, 24, 321]) ==>0\ndef solution(lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_solution\n candidate = method(:solution)\n assert_equal(12, candidate.call([5, 8, 7, 1]))\n assert_equal(9, candidate.call([3, 3, 3, 3, 3]))\n assert_equal(0, candidate.call([30, 13, 24, 321]))\n assert_equal(5, candidate.call([5, 9]))\n assert_equal(0, candidate.call([2, 4, 8]))\n assert_equal(23, candidate.call([30, 13, 23, 32]))\n assert_equal(3, candidate.call([3, 13, 2, 9]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "rb", - "prompt": "# You are given a positive integer n. You have to create an integer array a of length n.\n# For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n# Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n# and a[i] + a[j] + a[k] is a multiple of 3.\n# Example :\n# Input: n = 5\n# Output: 1\n# Explanation: \n# a = [1, 3, 7, 13, 21]\n# The only valid triple is (1, 7, 13).\ndef get_max_triples(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_get_max_triples\n candidate = method(:get_max_triples)\n assert_equal(1, candidate.call(5))\n assert_equal(4, candidate.call(6))\n assert_equal(36, candidate.call(10))\n assert_equal(53361, candidate.call(100))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "rb", - "prompt": "# There are eight planets in our solar system: the closerst to the Sun \n# is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n# Uranus, Neptune.\n# Write a function that takes two planet names as strings planet1 and planet2. \n# The function should return a tuple containing all planets whose orbits are \n# located between the orbit of planet1 and the orbit of planet2, sorted by \n# the proximity to the sun. \n# The function should return an empty tuple if planet1 or planet2\n# are not correct planet names. \n# Examples\n# bf(\"Jupiter\", \"Neptune\") ==> (\"Saturn\", \"Uranus\")\n# bf(\"Earth\", \"Mercury\") ==> (\"Venus\")\n# bf(\"Mercury\", \"Uranus\") ==> (\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\")\ndef bf(planet1, planet2)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_bf\n candidate = method(:bf)\n assert_equal([\"Saturn\", \"Uranus\"], candidate.call(\"Jupiter\", \"Neptune\"))\n assert_equal([\"Venus\"], candidate.call(\"Earth\", \"Mercury\"))\n assert_equal([\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"], candidate.call(\"Mercury\", \"Uranus\"))\n assert_equal([\"Earth\", \"Mars\", \"Jupiter\", \"Saturn\", \"Uranus\"], candidate.call(\"Neptune\", \"Venus\"))\n assert_equal([], candidate.call(\"Earth\", \"Earth\"))\n assert_equal([], candidate.call(\"Mars\", \"Earth\"))\n assert_equal([], candidate.call(\"Jupiter\", \"Makemake\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "rb", - "prompt": "# You are given a list of integers.\n# Write a function next_smallest() that returns the 2nd smallest element of the list.\n# Return None if there is no such element.\n# next_smallest([1, 2, 3, 4, 5]) == 2\n# next_smallest([5, 1, 4, 3, 2]) == 2\n# next_smallest([]) == None\n# next_smallest([1, 1]) == None\ndef next_smallest(lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_next_smallest\n candidate = method(:next_smallest)\n assert_equal(2, candidate.call([1, 2, 3, 4, 5]))\n assert_equal(2, candidate.call([5, 1, 4, 3, 2]))\n assert_equal(nil, candidate.call([]))\n assert_equal(nil, candidate.call([1, 1]))\n assert_equal(1, candidate.call([1, 1, 1, 1, 0]))\n assert_equal(nil, candidate.call([1, 1]))\n assert_equal(-35, candidate.call([-35, 34, 12, -45]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "rb", - "prompt": "# Input is a space-delimited string of numberals from 'zero' to 'nine'.\n# Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n# Return the string with numbers sorted from smallest to largest\n# >>> sort_numbers('three one five')\n# 'one three five'\ndef sort_numbers(numbers)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sort_numbers\n candidate = method(:sort_numbers)\n assert_equal(\"\", candidate.call(\"\"))\n assert_equal(\"three\", candidate.call(\"three\"))\n assert_equal(\"three five nine\", candidate.call(\"three five nine\"))\n assert_equal(\"zero four five seven eight nine\", candidate.call(\"five zero four seven nine eight\"))\n assert_equal(\"zero one two three four five six\", candidate.call(\"six five four three two one zero\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "rb", - "prompt": "# You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n# cycpattern_check(\"abcd\",\"abd\") => False\n# cycpattern_check(\"hello\",\"ell\") => True\n# cycpattern_check(\"whassup\",\"psus\") => False\n# cycpattern_check(\"abab\",\"baa\") => True\n# cycpattern_check(\"efef\",\"eeff\") => False\n# cycpattern_check(\"himenss\",\"simen\") => True\ndef cycpattern_check(a, b)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_cycpattern_check\n candidate = method(:cycpattern_check)\n assert_equal(false, candidate.call(\"xyzw\", \"xyw\"))\n assert_equal(true, candidate.call(\"yello\", \"ell\"))\n assert_equal(false, candidate.call(\"whattup\", \"ptut\"))\n assert_equal(true, candidate.call(\"efef\", \"fee\"))\n assert_equal(false, candidate.call(\"abab\", \"aabb\"))\n assert_equal(true, candidate.call(\"winemtt\", \"tinem\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "rb", - "prompt": "# You will be given a number in decimal form and your task is to convert it to\n# binary format. The function should return a string, with each character representing a binary\n# number. Each character in the string will be '0' or '1'.\n# There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n# The extra characters are there to help with the format.\n# Examples:\n# decimal_to_binary(15) # returns \"db1111db\"\n# decimal_to_binary(32) # returns \"db100000db\"\ndef decimal_to_binary(decimal)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_decimal_to_binary\n candidate = method(:decimal_to_binary)\n assert_equal(\"db0db\", candidate.call(0))\n assert_equal(\"db100000db\", candidate.call(32))\n assert_equal(\"db1100111db\", candidate.call(103))\n assert_equal(\"db1111db\", candidate.call(15))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "rb", - "prompt": "# Filter an input list of strings only for ones that contain given substring\n# >>> filter_by_substring([], 'a')\n# []\n# >>> filter_by_substring(['abc', 'bacd', 'cde', 'array'], 'a')\n# ['abc', 'bacd', 'array']\ndef filter_by_substring(strings, substring)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_filter_by_substring\n candidate = method(:filter_by_substring)\n assert_equal([], candidate.call([], \"john\"))\n assert_equal([\"xxx\", \"xxxAAA\", \"xxx\"], candidate.call([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"))\n assert_equal([\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"], candidate.call([\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xx\"))\n assert_equal([\"grunt\", \"prune\"], candidate.call([\"grunt\", \"trumpet\", \"prune\", \"gruesome\"], \"run\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "rb", - "prompt": "# Given an integer. return a tuple that has the number of even and odd digits respectively.\n# Example:\n# even_odd_count(-12) ==> (1, 1)\n# even_odd_count(123) ==> (1, 2)\ndef even_odd_count(num)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_even_odd_count\n candidate = method(:even_odd_count)\n assert_equal([0, 1], candidate.call(7))\n assert_equal([1, 1], candidate.call(-78))\n assert_equal([2, 2], candidate.call(3452))\n assert_equal([3, 3], candidate.call(346211))\n assert_equal([3, 3], candidate.call(-345821))\n assert_equal([1, 0], candidate.call(-2))\n assert_equal([2, 3], candidate.call(-45347))\n assert_equal([1, 0], candidate.call(0))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "rb", - "prompt": "# Write a function that accepts a list of strings.\n# The list contains different words. Return the word with maximum number\n# of unique characters. If multiple strings have maximum number of unique\n# characters, return the one which comes first in lexicographical order.\n# find_max([\"name\", \"of\", \"string\"]) == \"string\"\n# find_max([\"name\", \"enam\", \"game\"]) == \"enam\"\n# find_max([\"aaaaaaa\", \"bb\" ,\"cc\"]) == \"\"aaaaaaa\"\ndef find_max(words)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_find_max\n candidate = method(:find_max)\n assert_equal(\"string\", candidate.call([\"name\", \"of\", \"string\"]))\n assert_equal(\"enam\", candidate.call([\"name\", \"enam\", \"game\"]))\n assert_equal(\"aaaaaaa\", candidate.call([\"aaaaaaa\", \"bb\", \"cc\"]))\n assert_equal(\"abc\", candidate.call([\"abc\", \"cba\"]))\n assert_equal(\"footbott\", candidate.call([\"play\", \"this\", \"game\", \"of\", \"footbott\"]))\n assert_equal(\"gonna\", candidate.call([\"we\", \"are\", \"gonna\", \"rock\"]))\n assert_equal(\"nation\", candidate.call([\"we\", \"are\", \"a\", \"mad\", \"nation\"]))\n assert_equal(\"this\", candidate.call([\"this\", \"is\", \"a\", \"prrk\"]))\n assert_equal(\"b\", candidate.call([\"b\"]))\n assert_equal(\"play\", candidate.call([\"play\", \"play\", \"play\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "rb", - "prompt": "# Given a positive integer n, return the count of the numbers of n-digit\n# positive integers that start or end with 1.\ndef starts_one_ends(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_starts_one_ends\n candidate = method(:starts_one_ends)\n assert_equal(1, candidate.call(1))\n assert_equal(18, candidate.call(2))\n assert_equal(180, candidate.call(3))\n assert_equal(1800, candidate.call(4))\n assert_equal(18000, candidate.call(5))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "rb", - "prompt": "# Create a function that returns a tuple (a, b), where 'a' is\n# the largest of negative integers, and 'b' is the smallest\n# of positive integers in a list.\n# If there is no negative or positive integers, return them as None.\n# Examples:\n# largest_smallest_integers([2, 4, 1, 3, 5, 7]) == (None, 1)\n# largest_smallest_integers([]) == (None, None)\n# largest_smallest_integers([0]) == (None, None)\ndef largest_smallest_integers(lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_largest_smallest_integers\n candidate = method(:largest_smallest_integers)\n assert_equal([nil, 1], candidate.call([2, 4, 1, 3, 5, 7]))\n assert_equal([nil, 1], candidate.call([2, 4, 1, 3, 5, 7, 0]))\n assert_equal([-2, 1], candidate.call([1, 3, 2, 4, 5, 6, -2]))\n assert_equal([-7, 2], candidate.call([4, 5, 3, 6, 2, 7, -7]))\n assert_equal([-9, 2], candidate.call([7, 3, 8, 4, 9, 2, 5, -9]))\n assert_equal([nil, nil], candidate.call([]))\n assert_equal([nil, nil], candidate.call([0]))\n assert_equal([-1, nil], candidate.call([-1, -3, -5, -6]))\n assert_equal([-1, nil], candidate.call([-1, -3, -5, -6, 0]))\n assert_equal([-3, 1], candidate.call([-6, -4, -4, -3, 1]))\n assert_equal([-3, 1], candidate.call([-6, -4, -4, -3, -100, 1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "rb", - "prompt": "# \"Given an array representing a branch of a tree that has non-negative integer nodes\n# your task is to pluck one of the nodes and return it.\n# The plucked node should be the node with the smallest even value.\n# If multiple nodes with the same smallest even value are found return the node that has smallest index.\n# The plucked node should be returned in a list, [ smalest_value, its index ],\n# If there are no even values or the given array is empty, return [].\n# Example 1:\n# Input: [4,2,3]\n# Output: [2, 1]\n# Explanation: 2 has the smallest even value, and 2 has the smallest index.\n# Example 2:\n# Input: [1,2,3]\n# Output: [2, 1]\n# Explanation: 2 has the smallest even value, and 2 has the smallest index. \n# Example 3:\n# Input: []\n# Output: []\n# Example 4:\n# Input: [5, 0, 3, 0, 4, 2]\n# Output: [0, 1]\n# Explanation: 0 is the smallest value, but there are two zeros,\n# so we will choose the first zero, which has the smallest index.\n# Constraints:\n# * 1 <= nodes.length <= 10000\n# * 0 <= node.value\ndef pluck(arr)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_pluck\n candidate = method(:pluck)\n assert_equal([2, 1], candidate.call([4, 2, 3]))\n assert_equal([2, 1], candidate.call([1, 2, 3]))\n assert_equal([], candidate.call([]))\n assert_equal([0, 1], candidate.call([5, 0, 3, 0, 4, 2]))\n assert_equal([0, 3], candidate.call([1, 2, 3, 0, 5, 3]))\n assert_equal([4, 1], candidate.call([5, 4, 8, 4, 8]))\n assert_equal([6, 1], candidate.call([7, 6, 7, 1]))\n assert_equal([], candidate.call([7, 9, 7, 1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "rb", - "prompt": "# Write a function count_nums which takes an array of integers and returns\n# the number of elements which has a sum of digits > 0.\n# If a number is negative, then its first signed digit will be negative:\n# e.g. -123 has signed digits -1, 2, and 3.\n# >>> count_nums([]) == 0\n# >>> count_nums([-1, 11, -11]) == 1\n# >>> count_nums([1, 1, 2]) == 3\ndef count_nums(arr)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_count_nums\n candidate = method(:count_nums)\n assert_equal(0, candidate.call([]))\n assert_equal(0, candidate.call([-1, -2, 0]))\n assert_equal(6, candidate.call([1, 1, 2, -2, 3, 4, 5]))\n assert_equal(5, candidate.call([1, 6, 9, -6, 0, 1, 5]))\n assert_equal(4, candidate.call([1, 100, 98, -7, 1, -1]))\n assert_equal(5, candidate.call([12, 23, 34, -45, -56, 0]))\n assert_equal(1, candidate.call([0, 1]))\n assert_equal(1, candidate.call([1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "rb", - "prompt": "# Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n# each cell of the grid contains a value. Every integer in the range [1, N * N]\n# inclusive appears exactly once on the cells of the grid.\n# You have to find the minimum path of length k in the grid. You can start\n# from any cell, and in each step you can move to any of the neighbor cells,\n# in other words, you can go to cells which share an edge with you current\n# cell.\n# Please note that a path of length k means visiting exactly k cells (not\n# necessarily distinct).\n# You CANNOT go off the grid.\n# A path A (of length k) is considered less than a path B (of length k) if\n# after making the ordered lists of the values on the cells that A and B go\n# through (let's call them lst_A and lst_B), lst_A is lexicographically less\n# than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n# such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n# lst_A[j] = lst_B[j].\n# It is guaranteed that the answer is unique.\n# Return an ordered list of the values on the cells that the minimum path go through.\n# Examples:\n# Input: grid = [ [1,2,3], [4,5,6], [7,8,9]], k = 3\n# Output: [1, 2, 1]\n# Input: grid = [ [5,9,3], [4,1,6], [7,8,2]], k = 1\n# Output: [1]\ndef minPath(grid, k)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_minPath\n candidate = method(:minPath)\n assert_equal([1, 2, 1], candidate.call([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3))\n assert_equal([1], candidate.call([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1))\n assert_equal([1, 2, 1, 2], candidate.call([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], 4))\n assert_equal([1, 10, 1, 10, 1, 10, 1], candidate.call([[6, 4, 13, 10], [5, 7, 12, 1], [3, 16, 11, 15], [8, 14, 9, 2]], 7))\n assert_equal([1, 7, 1, 7, 1], candidate.call([[8, 14, 9, 2], [6, 4, 13, 15], [5, 7, 1, 12], [3, 10, 11, 16]], 5))\n assert_equal([1, 6, 1, 6, 1, 6, 1, 6, 1], candidate.call([[11, 8, 7, 2], [5, 16, 14, 4], [9, 3, 15, 6], [12, 13, 10, 1]], 9))\n assert_equal([1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6], candidate.call([[12, 13, 10, 1], [9, 3, 15, 6], [5, 16, 14, 4], [11, 8, 7, 2]], 12))\n assert_equal([1, 3, 1, 3, 1, 3, 1, 3], candidate.call([[2, 7, 4], [3, 1, 5], [6, 8, 9]], 8))\n assert_equal([1, 5, 1, 5, 1, 5, 1, 5], candidate.call([[6, 1, 5], [3, 8, 9], [2, 7, 4]], 8))\n assert_equal([1, 2, 1, 2, 1, 2, 1, 2, 1, 2], candidate.call([[1, 2], [3, 4]], 10))\n assert_equal([1, 3, 1, 3, 1, 3, 1, 3, 1, 3], candidate.call([[1, 3], [3, 2]], 10))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "rb", - "prompt": "# Given list of integers, return list in strange order.\n# Strange sorting, is when you start with the minimum value,\n# then maximum of the remaining integers, then minimum and so on.\n# Examples:\n# strange_sort_list([1, 2, 3, 4]) == [1, 4, 2, 3]\n# strange_sort_list([5, 5, 5, 5]) == [5, 5, 5, 5]\n# strange_sort_list([]) == []\ndef strange_sort_list(lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_strange_sort_list\n candidate = method(:strange_sort_list)\n assert_equal([1, 4, 2, 3], candidate.call([1, 2, 3, 4]))\n assert_equal([5, 9, 6, 8, 7], candidate.call([5, 6, 7, 8, 9]))\n assert_equal([1, 5, 2, 4, 3], candidate.call([1, 2, 3, 4, 5]))\n assert_equal([1, 9, 5, 8, 6, 7], candidate.call([5, 6, 7, 8, 9, 1]))\n assert_equal([5, 5, 5, 5], candidate.call([5, 5, 5, 5]))\n assert_equal([], candidate.call([]))\n assert_equal([1, 8, 2, 7, 3, 6, 4, 5], candidate.call([1, 2, 3, 4, 5, 6, 7, 8]))\n assert_equal([-5, 5, -5, 5, 0, 2, 2, 2], candidate.call([0, 2, 2, 2, 5, 5, -5, -5]))\n assert_equal([111111], candidate.call([111111]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "rb", - "prompt": "# Given a string 'text', return its md5 hash equivalent string.\n# If 'text' is an empty string, return None.\n# >>> string_to_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'\ndef string_to_md5(text)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_string_to_md5\n candidate = method(:string_to_md5)\n assert_equal(\"3e25960a79dbc69b674cd4ec67a72c62\", candidate.call(\"Hello world\"))\n assert_equal(nil, candidate.call(\"\"))\n assert_equal(\"0ef78513b0cb8cef12743f5aeb35f888\", candidate.call(\"A B C\"))\n assert_equal(\"5f4dcc3b5aa765d61d8327deb882cf99\", candidate.call(\"password\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "rb", - "prompt": "# You are given a word. Your task is to find the closest vowel that stands between \n# two consonants from the right side of the word (case sensitive).\n# Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n# find any vowel met the above condition. \n# You may assume that the given string contains English letter only.\n# Example:\n# get_closest_vowel(\"yogurt\") ==> \"u\"\n# get_closest_vowel(\"FULL\") ==> \"U\"\n# get_closest_vowel(\"quick\") ==> \"\"\n# get_closest_vowel(\"ab\") ==> \"\"\ndef get_closest_vowel(word)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_get_closest_vowel\n candidate = method(:get_closest_vowel)\n assert_equal(\"u\", candidate.call(\"yogurt\"))\n assert_equal(\"u\", candidate.call(\"full\"))\n assert_equal(\"\", candidate.call(\"easy\"))\n assert_equal(\"\", candidate.call(\"eAsy\"))\n assert_equal(\"\", candidate.call(\"ali\"))\n assert_equal(\"a\", candidate.call(\"bad\"))\n assert_equal(\"o\", candidate.call(\"most\"))\n assert_equal(\"\", candidate.call(\"ab\"))\n assert_equal(\"\", candidate.call(\"ba\"))\n assert_equal(\"\", candidate.call(\"quick\"))\n assert_equal(\"i\", candidate.call(\"anime\"))\n assert_equal(\"\", candidate.call(\"Asia\"))\n assert_equal(\"o\", candidate.call(\"Above\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "rb", - "prompt": "# Change numerical base of input number x to base.\n# return string representation after the conversion.\n# base numbers are less than 10.\n# >>> change_base(8, 3)\n# '22'\n# >>> change_base(8, 2)\n# '1000'\n# >>> change_base(7, 2)\n# '111'\ndef change_base(x, base)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_change_base\n candidate = method(:change_base)\n assert_equal(\"22\", candidate.call(8, 3))\n assert_equal(\"100\", candidate.call(9, 3))\n assert_equal(\"11101010\", candidate.call(234, 2))\n assert_equal(\"10000\", candidate.call(16, 2))\n assert_equal(\"1000\", candidate.call(8, 2))\n assert_equal(\"111\", candidate.call(7, 2))\n assert_equal(\"2\", candidate.call(2, 3))\n assert_equal(\"3\", candidate.call(3, 4))\n assert_equal(\"4\", candidate.call(4, 5))\n assert_equal(\"5\", candidate.call(5, 6))\n assert_equal(\"6\", candidate.call(6, 7))\n assert_equal(\"7\", candidate.call(7, 8))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "rb", - "prompt": "# Check if in given list of numbers, are any two numbers closer to each other than\n# given threshold.\n# >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n# False\n# >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n# True\ndef has_close_elements(numbers, threshold)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_has_close_elements\n candidate = method(:has_close_elements)\n assert_equal(true, candidate.call([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3))\n assert_equal(false, candidate.call([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05))\n assert_equal(true, candidate.call([1.0, 2.0, 5.9, 4.0, 5.0], 0.95))\n assert_equal(false, candidate.call([1.0, 2.0, 5.9, 4.0, 5.0], 0.8))\n assert_equal(true, candidate.call([1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1))\n assert_equal(true, candidate.call([1.1, 2.2, 3.1, 4.1, 5.1], 1.0))\n assert_equal(false, candidate.call([1.1, 2.2, 3.1, 4.1, 5.1], 0.5))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "rb", - "prompt": "# Create a function that takes a string as input which contains only square brackets.\n# The function should return True if and only if there is a valid subsequence of brackets \n# where at least one bracket in the subsequence is nested.\n# is_nested('[[]]') \u279e True\n# is_nested('[]]]]]]][[[[[]') \u279e False\n# is_nested('[][]') \u279e False\n# is_nested('[]') \u279e False\n# is_nested('[[][]]') \u279e True\n# is_nested('[[]][[') \u279e True\ndef is_nested(string)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_nested\n candidate = method(:is_nested)\n assert_equal(true, candidate.call(\"[[]]\"))\n assert_equal(false, candidate.call(\"[]]]]]]][[[[[]\"))\n assert_equal(false, candidate.call(\"[][]\"))\n assert_equal(false, candidate.call(\"[]\"))\n assert_equal(true, candidate.call(\"[[[[]]]]\"))\n assert_equal(false, candidate.call(\"[]]]]]]]]]]\"))\n assert_equal(true, candidate.call(\"[][][[]]\"))\n assert_equal(false, candidate.call(\"[[]\"))\n assert_equal(false, candidate.call(\"[]]\"))\n assert_equal(true, candidate.call(\"[[]][[\"))\n assert_equal(true, candidate.call(\"[[][]]\"))\n assert_equal(false, candidate.call(\"\"))\n assert_equal(false, candidate.call(\"[[[[[[[[\"))\n assert_equal(false, candidate.call(\"]]]]]]]]\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "rb", - "prompt": "# Concatenate list of strings into a single string\n# >>> concatenate([])\n# ''\n# >>> concatenate(['a', 'b', 'c'])\n# 'abc'\ndef concatenate(strings)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_concatenate\n candidate = method(:concatenate)\n assert_equal(\"\", candidate.call([]))\n assert_equal(\"xyz\", candidate.call([\"x\", \"y\", \"z\"]))\n assert_equal(\"xyzwk\", candidate.call([\"x\", \"y\", \"z\", \"w\", \"k\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "rb", - "prompt": "# prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n# >>> prime_fib(1)\n# 2\n# >>> prime_fib(2)\n# 3\n# >>> prime_fib(3)\n# 5\n# >>> prime_fib(4)\n# 13\n# >>> prime_fib(5)\n# 89\ndef prime_fib(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_prime_fib\n candidate = method(:prime_fib)\n assert_equal(2, candidate.call(1))\n assert_equal(3, candidate.call(2))\n assert_equal(5, candidate.call(3))\n assert_equal(13, candidate.call(4))\n assert_equal(89, candidate.call(5))\n assert_equal(233, candidate.call(6))\n assert_equal(1597, candidate.call(7))\n assert_equal(28657, candidate.call(8))\n assert_equal(514229, candidate.call(9))\n assert_equal(433494437, candidate.call(10))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "rb", - "prompt": "# From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n# other and return them in order (smaller number, larger number).\n# >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n# (2.0, 2.2)\n# >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n# (2.0, 2.0)\ndef find_closest_elements(numbers)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_find_closest_elements\n candidate = method(:find_closest_elements)\n assert_equal([3.9, 4.0], candidate.call([1.0, 2.0, 3.9, 4.0, 5.0, 2.2]))\n assert_equal([5.0, 5.9], candidate.call([1.0, 2.0, 5.9, 4.0, 5.0]))\n assert_equal([2.0, 2.2], candidate.call([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]))\n assert_equal([2.0, 2.0], candidate.call([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]))\n assert_equal([2.2, 3.1], candidate.call([1.1, 2.2, 3.1, 4.1, 5.1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "rb", - "prompt": "# You have been tasked to write a function that receives \n# a hexadecimal number as a string and counts the number of hexadecimal \n# digits that are primes (prime number, or a prime, is a natural number \n# greater than 1 that is not a product of two smaller natural numbers).\n# Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n# Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n# So you have to determine a number of the following digits: 2, 3, 5, 7, \n# B (=decimal 11), D (=decimal 13).\n# Note: you may assume the input is always correct or empty string, \n# and symbols A,B,C,D,E,F are always uppercase.\n# Examples:\n# For num = \"AB\" the output should be 1.\n# For num = \"1077E\" the output should be 2.\n# For num = \"ABED1A33\" the output should be 4.\n# For num = \"123456789ABCDEF0\" the output should be 6.\n# For num = \"2020\" the output should be 2.\ndef hex_key(num)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_hex_key\n candidate = method(:hex_key)\n assert_equal(1, candidate.call(\"AB\"))\n assert_equal(2, candidate.call(\"1077E\"))\n assert_equal(4, candidate.call(\"ABED1A33\"))\n assert_equal(2, candidate.call(\"2020\"))\n assert_equal(6, candidate.call(\"123456789ABCDEF0\"))\n assert_equal(12, candidate.call(\"112233445566778899AABBCCDDEEFF00\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "rb", - "prompt": "# Complete the function that takes two integers and returns \n# the product of their unit digits.\n# Assume the input is always valid.\n# Examples:\n# multiply(148, 412) should return 16.\n# multiply(19, 28) should return 72.\n# multiply(2020, 1851) should return 0.\n# multiply(14,-15) should return 20.\ndef multiply(a, b)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_multiply\n candidate = method(:multiply)\n assert_equal(16, candidate.call(148, 412))\n assert_equal(72, candidate.call(19, 28))\n assert_equal(0, candidate.call(2020, 1851))\n assert_equal(20, candidate.call(14, -15))\n assert_equal(42, candidate.call(76, 67))\n assert_equal(49, candidate.call(17, 27))\n assert_equal(0, candidate.call(0, 1))\n assert_equal(0, candidate.call(0, 0))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "rb", - "prompt": "# Given list of numbers (of at least two elements), apply a linear transform to that list,\n# such that the smallest number will become 0 and the largest will become 1\n# >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n# [0.0, 0.25, 0.5, 0.75, 1.0]\ndef rescale_to_unit(numbers)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_rescale_to_unit\n candidate = method(:rescale_to_unit)\n assert_equal([0.0, 1.0], candidate.call([2.0, 49.9]))\n assert_equal([1.0, 0.0], candidate.call([100.0, 49.9]))\n assert_equal([0.0, 0.25, 0.5, 0.75, 1.0], candidate.call([1.0, 2.0, 3.0, 4.0, 5.0]))\n assert_equal([0.25, 0.0, 1.0, 0.5, 0.75], candidate.call([2.0, 1.0, 5.0, 3.0, 4.0]))\n assert_equal([0.25, 0.0, 1.0, 0.5, 0.75], candidate.call([12.0, 11.0, 15.0, 13.0, 14.0]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "rb", - "prompt": "# Given a positive integer n, return the product of the odd digits.\n# Return 0 if all digits are even.\n# For example:\n# digits(1) == 1\n# digits(4) == 0\n# digits(235) == 15\ndef digits(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_digits\n candidate = method(:digits)\n assert_equal(5, candidate.call(5))\n assert_equal(5, candidate.call(54))\n assert_equal(1, candidate.call(120))\n assert_equal(5, candidate.call(5014))\n assert_equal(315, candidate.call(98765))\n assert_equal(2625, candidate.call(5576543))\n assert_equal(0, candidate.call(2468))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "rb", - "prompt": "# You will be given the name of a class (a string) and a list of extensions.\n# The extensions are to be used to load additional classes to the class. The\n# strength of the extension is as follows: Let CAP be the number of the uppercase\n# letters in the extension's name, and let SM be the number of lowercase letters \n# in the extension's name, the strength is given by the fraction CAP - SM. \n# You should find the strongest extension and return a string in this \n# format: ClassName.StrongestExtensionName.\n# If there are two or more extensions with the same strength, you should\n# choose the one that comes first in the list.\n# For example, if you are given \"Slices\" as the class and a list of the\n# extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n# return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n# (its strength is -1).\n# Example:\n# for Strongest_Extension('my_class', ['AA', 'Be', 'CC']) == 'my_class.AA'\ndef Strongest_Extension(class_name, extensions)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_Strongest_Extension\n candidate = method(:Strongest_Extension)\n assert_equal(\"Watashi.eIGHt8OKe\", candidate.call(\"Watashi\", [\"tEN\", \"niNE\", \"eIGHt8OKe\"]))\n assert_equal(\"Boku123.YEs.WeCaNe\", candidate.call(\"Boku123\", [\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"]))\n assert_equal(\"__YESIMHERE.NuLl__\", candidate.call(\"__YESIMHERE\", [\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"]))\n assert_equal(\"K.TAR\", candidate.call(\"K\", [\"Ta\", \"TAR\", \"t234An\", \"cosSo\"]))\n assert_equal(\"__HAHA.123\", candidate.call(\"__HAHA\", [\"Tab\", \"123\", \"781345\", \"-_-\"]))\n assert_equal(\"YameRore.okIWILL123\", candidate.call(\"YameRore\", [\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"]))\n assert_equal(\"finNNalLLly.WoW\", candidate.call(\"finNNalLLly\", [\"Die\", \"NowW\", \"Wow\", \"WoW\"]))\n assert_equal(\"_.Bb\", candidate.call(\"_\", [\"Bb\", \"91245\"]))\n assert_equal(\"Sp.671235\", candidate.call(\"Sp\", [\"671235\", \"Bb\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "rb", - "prompt": "# Given a string representing a space separated lowercase letters, return a dictionary\n# of the letter with the most repetition and containing the corresponding count.\n# If several letters have the same occurrence, return all of them.\n# Example:\n# histogram('a b c') == {'a': 1, 'b': 1, 'c': 1}\n# histogram('a b b a') == {'a': 2, 'b': 2}\n# histogram('a b c a b') == {'a': 2, 'b': 2}\n# histogram('b b b b a') == {'b': 4}\n# histogram('') == {}\ndef histogram(test)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_histogram\n candidate = method(:histogram)\n assert_equal({\"a\" => 2, \"b\" => 2}, candidate.call(\"a b b a\"))\n assert_equal({\"a\" => 2, \"b\" => 2}, candidate.call(\"a b c a b\"))\n assert_equal({\"a\" => 1, \"b\" => 1, \"c\" => 1, \"d\" => 1, \"g\" => 1}, candidate.call(\"a b c d g\"))\n assert_equal({\"r\" => 1, \"t\" => 1, \"g\" => 1}, candidate.call(\"r t g\"))\n assert_equal({\"b\" => 4}, candidate.call(\"b b b b a\"))\n assert_equal({\"r\" => 1, \"t\" => 1, \"g\" => 1}, candidate.call(\"r t g\"))\n assert_equal({}, candidate.call(\"\"))\n assert_equal({\"a\" => 1}, candidate.call(\"a\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "rb", - "prompt": "# pairs_sum_to_zero takes a list of integers as an input.\n# it returns True if there are two distinct elements in the list that\n# sum to zero, and False otherwise.\n# >>> pairs_sum_to_zero([1, 3, 5, 0])\n# False\n# >>> pairs_sum_to_zero([1, 3, -2, 1])\n# False\n# >>> pairs_sum_to_zero([1, 2, 3, 7])\n# False\n# >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7])\n# True\n# >>> pairs_sum_to_zero([1])\n# False\ndef pairs_sum_to_zero(l)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_pairs_sum_to_zero\n candidate = method(:pairs_sum_to_zero)\n assert_equal(false, candidate.call([1, 3, 5, 0]))\n assert_equal(false, candidate.call([1, 3, -2, 1]))\n assert_equal(false, candidate.call([1, 2, 3, 7]))\n assert_equal(true, candidate.call([2, 4, -5, 3, 5, 7]))\n assert_equal(false, candidate.call([1]))\n assert_equal(true, candidate.call([-3, 9, -1, 3, 2, 30]))\n assert_equal(true, candidate.call([-3, 9, -1, 3, 2, 31]))\n assert_equal(false, candidate.call([-3, 9, -1, 4, 2, 30]))\n assert_equal(false, candidate.call([-3, 9, -1, 4, 2, 31]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "rb", - "prompt": "# Write a function that accepts two lists of strings and returns the list that has \n# total number of chars in the all strings of the list less than the other list.\n# if the two lists have the same number of chars, return the first list.\n# Examples\n# total_match([], []) \u279e []\n# total_match(['hi', 'admin'], ['hI', 'Hi']) \u279e ['hI', 'Hi']\n# total_match(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) \u279e ['hi', 'admin']\n# total_match(['hi', 'admin'], ['hI', 'hi', 'hi']) \u279e ['hI', 'hi', 'hi']\n# total_match(['4'], ['1', '2', '3', '4', '5']) \u279e ['4']\ndef total_match(lst1, lst2)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_total_match\n candidate = method(:total_match)\n assert_equal([], candidate.call([], []))\n assert_equal([\"hi\", \"hi\"], candidate.call([\"hi\", \"admin\"], [\"hi\", \"hi\"]))\n assert_equal([\"hi\", \"admin\"], candidate.call([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"]))\n assert_equal([\"4\"], candidate.call([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"]))\n assert_equal([\"hI\", \"Hi\"], candidate.call([\"hi\", \"admin\"], [\"hI\", \"Hi\"]))\n assert_equal([\"hI\", \"hi\", \"hi\"], candidate.call([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"]))\n assert_equal([\"hi\", \"admin\"], candidate.call([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hii\"]))\n assert_equal([], candidate.call([], [\"this\"]))\n assert_equal([], candidate.call([\"this\"], []))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "rb", - "prompt": "# Circular shift the digits of the integer x, shift the digits right by shift\n# and return the result as a string.\n# If shift > number of digits, return digits reversed.\n# >>> circular_shift(12, 1)\n# \"21\"\n# >>> circular_shift(12, 2)\n# \"12\"\ndef circular_shift(x, shift)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_circular_shift\n candidate = method(:circular_shift)\n assert_equal(\"001\", candidate.call(100, 2))\n assert_equal(\"12\", candidate.call(12, 2))\n assert_equal(\"79\", candidate.call(97, 8))\n assert_equal(\"21\", candidate.call(12, 1))\n assert_equal(\"11\", candidate.call(11, 101))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "rb", - "prompt": "# Return True is list elements are monotonically increasing or decreasing.\n# >>> monotonic([1, 2, 4, 20])\n# True\n# >>> monotonic([1, 20, 4, 10])\n# False\n# >>> monotonic([4, 1, 0, -10])\n# True\ndef monotonic(l)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_monotonic\n candidate = method(:monotonic)\n assert_equal(true, candidate.call([1, 2, 4, 10]))\n assert_equal(true, candidate.call([1, 2, 4, 20]))\n assert_equal(false, candidate.call([1, 20, 4, 10]))\n assert_equal(true, candidate.call([4, 1, 0, -10]))\n assert_equal(true, candidate.call([4, 1, 1, 0]))\n assert_equal(false, candidate.call([1, 2, 3, 2, 5, 60]))\n assert_equal(true, candidate.call([1, 2, 3, 4, 5, 60]))\n assert_equal(true, candidate.call([9, 9, 9, 9]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "rb", - "prompt": "# Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n# Example\n# is_equal_to_sum_even(4) == False\n# is_equal_to_sum_even(6) == False\n# is_equal_to_sum_even(8) == True\ndef is_equal_to_sum_even(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_equal_to_sum_even\n candidate = method(:is_equal_to_sum_even)\n assert_equal(false, candidate.call(4))\n assert_equal(false, candidate.call(6))\n assert_equal(true, candidate.call(8))\n assert_equal(true, candidate.call(10))\n assert_equal(false, candidate.call(11))\n assert_equal(true, candidate.call(12))\n assert_equal(false, candidate.call(13))\n assert_equal(true, candidate.call(16))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "rb", - "prompt": "# Input to this function is a string representing musical notes in a special ASCII format.\n# Your task is to parse this string and return list of integers corresponding to how many beats does each\n# not last.\n# Here is a legend:\n# 'o' - whole note, lasts four beats\n# 'o|' - half note, lasts two beats\n# '.|' - quater note, lasts one beat\n# >>> parse_music('o o| .| o| o| .| .| .| .| o o')\n# [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\ndef parse_music(music_string)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_parse_music\n candidate = method(:parse_music)\n assert_equal([], candidate.call(\"\"))\n assert_equal([4, 4, 4, 4], candidate.call(\"o o o o\"))\n assert_equal([1, 1, 1, 1], candidate.call(\".| .| .| .|\"))\n assert_equal([2, 2, 1, 1, 4, 4, 4, 4], candidate.call(\"o| o| .| .| o o o o\"))\n assert_equal([2, 1, 2, 1, 4, 2, 4, 2], candidate.call(\"o| .| o| .| o o| o o|\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "rb", - "prompt": "# \"\n# This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n# multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n# change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n# Examples:\n# For lst = [1,2,3] the output should be 6\n# For lst = [] the output should be 0\n# For lst = [-1,-5,2,-1,-5] the output should be -126\ndef sum_squares(lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sum_squares\n candidate = method(:sum_squares)\n assert_equal(6, candidate.call([1, 2, 3]))\n assert_equal(14, candidate.call([1, 4, 9]))\n assert_equal(0, candidate.call([]))\n assert_equal(9, candidate.call([1, 1, 1, 1, 1, 1, 1, 1, 1]))\n assert_equal(-3, candidate.call([-1, -1, -1, -1, -1, -1, -1, -1, -1]))\n assert_equal(0, candidate.call([0]))\n assert_equal(-126, candidate.call([-1, -5, 2, -1, -5]))\n assert_equal(3030, candidate.call([-56, -99, 1, 0, -2]))\n assert_equal(0, candidate.call([-1, 0, 0, 0, 0, 0, 0, 0, -1]))\n assert_equal(-14196, candidate.call([-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37]))\n assert_equal(-1448, candidate.call([-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "rb", - "prompt": "# triples_sum_to_zero takes a list of integers as an input.\n# it returns True if there are three distinct elements in the list that\n# sum to zero, and False otherwise.\n# >>> triples_sum_to_zero([1, 3, 5, 0])\n# False\n# >>> triples_sum_to_zero([1, 3, -2, 1])\n# True\n# >>> triples_sum_to_zero([1, 2, 3, 7])\n# False\n# >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n# True\n# >>> triples_sum_to_zero([1])\n# False\ndef triples_sum_to_zero(l)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_triples_sum_to_zero\n candidate = method(:triples_sum_to_zero)\n assert_equal(false, candidate.call([1, 3, 5, 0]))\n assert_equal(false, candidate.call([1, 3, 5, -1]))\n assert_equal(true, candidate.call([1, 3, -2, 1]))\n assert_equal(false, candidate.call([1, 2, 3, 7]))\n assert_equal(false, candidate.call([1, 2, 5, 7]))\n assert_equal(true, candidate.call([2, 4, -5, 3, 9, 7]))\n assert_equal(false, candidate.call([1]))\n assert_equal(false, candidate.call([1, 3, 5, -100]))\n assert_equal(false, candidate.call([100, 3, 5, -100]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "rb", - "prompt": "# brackets is a string of \"<\" and \">\".\n# return True if every opening bracket has a corresponding closing bracket.\n# >>> correct_bracketing(\"<\")\n# False\n# >>> correct_bracketing(\"<>\")\n# True\n# >>> correct_bracketing(\"<<><>>\")\n# True\n# >>> correct_bracketing(\"><<>\")\n# False\ndef correct_bracketing(brackets)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_correct_bracketing\n candidate = method(:correct_bracketing)\n assert_equal(true, candidate.call(\"<>\"))\n assert_equal(true, candidate.call(\"<<><>>\"))\n assert_equal(true, candidate.call(\"<><><<><>><>\"))\n assert_equal(true, candidate.call(\"<><><<<><><>><>><<><><<>>>\"))\n assert_equal(false, candidate.call(\"<<<><>>>>\"))\n assert_equal(false, candidate.call(\"><<>\"))\n assert_equal(false, candidate.call(\"<\"))\n assert_equal(false, candidate.call(\"<<<<\"))\n assert_equal(false, candidate.call(\">\"))\n assert_equal(false, candidate.call(\"<<>\"))\n assert_equal(false, candidate.call(\"<><><<><>><>><<>\"))\n assert_equal(false, candidate.call(\"<><><<><>><>>><>\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "rb", - "prompt": "# Write a function that takes an array of numbers as input and returns \n# the number of elements in the array that are greater than 10 and both \n# first and last digits of a number are odd (1, 3, 5, 7, 9).\n# For example:\n# specialFilter([15, -73, 14, -15]) => 1 \n# specialFilter([33, -2, -3, 45, 21, 109]) => 2\ndef specialFilter(nums)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_specialFilter\n candidate = method(:specialFilter)\n assert_equal(0, candidate.call([5, -2, 1, -5]))\n assert_equal(1, candidate.call([15, -73, 14, -15]))\n assert_equal(2, candidate.call([33, -2, -3, 45, 21, 109]))\n assert_equal(4, candidate.call([43, -12, 93, 125, 121, 109]))\n assert_equal(3, candidate.call([71, -2, -33, 75, 21, 19]))\n assert_equal(0, candidate.call([1]))\n assert_equal(0, candidate.call([]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "rb", - "prompt": "# Given a dictionary, return True if all keys are strings in lower \n# case or all keys are strings in upper case, else return False.\n# The function should return False is the given dictionary is empty.\n# Examples:\n# check_dict_case({\"a\":\"apple\", \"b\":\"banana\"}) should return True.\n# check_dict_case({\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}) should return False.\n# check_dict_case({\"a\":\"apple\", \"8\":\"banana\", \"a\":\"apple\"}) should return False.\n# check_dict_case({\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}) should return False.\n# check_dict_case({\"STATE\":\"NC\", \"ZIP\":\"12345\" }) should return True.\ndef check_dict_case(dict)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_check_dict_case\n candidate = method(:check_dict_case)\n assert_equal(true, candidate.call({\"p\" => \"pineapple\", \"b\" => \"banana\"}))\n assert_equal(false, candidate.call({\"p\" => \"pineapple\", \"A\" => \"banana\", \"B\" => \"banana\"}))\n assert_equal(false, candidate.call({\"p\" => \"pineapple\", \"5\" => \"banana\", \"a\" => \"apple\"}))\n assert_equal(false, candidate.call({\"Name\" => \"John\", \"Age\" => \"36\", \"City\" => \"Houston\"}))\n assert_equal(true, candidate.call({\"STATE\" => \"NC\", \"ZIP\" => \"12345\"}))\n assert_equal(true, candidate.call({\"fruit\" => \"Orange\", \"taste\" => \"Sweet\"}))\n assert_equal(false, candidate.call({}))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "rb", - "prompt": "# Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n# should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n# alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n# Examples\n# split_words(\"Hello world!\") \u279e [\"Hello\", \"world!\"]\n# split_words(\"Hello,world!\") \u279e [\"Hello\", \"world!\"]\n# split_words(\"abcdef\") == 3\ndef split_words(txt)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_split_words\n candidate = method(:split_words)\n assert_equal([\"Hello\", \"world!\"], candidate.call(\"Hello world!\"))\n assert_equal([\"Hello\", \"world!\"], candidate.call(\"Hello,world!\"))\n assert_equal([\"Hello\", \"world,!\"], candidate.call(\"Hello world,!\"))\n assert_equal([\"Hello,Hello,world\", \"!\"], candidate.call(\"Hello,Hello,world !\"))\n assert_equal(3, candidate.call(\"abcdef\"))\n assert_equal(2, candidate.call(\"aaabb\"))\n assert_equal(1, candidate.call(\"aaaBb\"))\n assert_equal(0, candidate.call(\"\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "rb", - "prompt": "# The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fibfib(0) == 0\n# fibfib(1) == 0\n# fibfib(2) == 1\n# fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n# Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n# >>> fibfib(1)\n# 0\n# >>> fibfib(5)\n# 4\n# >>> fibfib(8)\n# 24\ndef fibfib(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_fibfib\n candidate = method(:fibfib)\n assert_equal(1, candidate.call(2))\n assert_equal(0, candidate.call(1))\n assert_equal(4, candidate.call(5))\n assert_equal(24, candidate.call(8))\n assert_equal(81, candidate.call(10))\n assert_equal(274, candidate.call(12))\n assert_equal(927, candidate.call(14))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "rb", - "prompt": "# You are given a list of numbers.\n# You need to return the sum of squared numbers in the given list,\n# round each element in the list to the upper int(Ceiling) first.\n# Examples:\n# For lst = [1,2,3] the output should be 14\n# For lst = [1,4,9] the output should be 98\n# For lst = [1,3,5,7] the output should be 84\n# For lst = [1.4,4.2,0] the output should be 29\n# For lst = [-2.4,1,1] the output should be 6\ndef sum_squares(lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sum_squares\n candidate = method(:sum_squares)\n assert_equal(14, candidate.call([1.0, 2.0, 3.0]))\n assert_equal(14, candidate.call([1.0, 2.0, 3.0]))\n assert_equal(84, candidate.call([1.0, 3.0, 5.0, 7.0]))\n assert_equal(29, candidate.call([1.4, 4.2, 0.0]))\n assert_equal(6, candidate.call([-2.4, 1.0, 1.0]))\n assert_equal(10230, candidate.call([100.0, 1.0, 15.0, 2.0]))\n assert_equal(200000000, candidate.call([10000.0, 10000.0]))\n assert_equal(75, candidate.call([-1.4, 4.6, 6.3]))\n assert_equal(1086, candidate.call([-1.4, 17.9, 18.9, 19.9]))\n assert_equal(0, candidate.call([0.0]))\n assert_equal(1, candidate.call([-1.0]))\n assert_equal(2, candidate.call([-1.0, 1.0, 0.0]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_85_add", - "language": "rb", - "prompt": "# Given a non-empty list of integers lst. add the even elements that are at odd indices..\n# Examples:\n# add([4, 2, 6, 7]) ==> 2\ndef add(lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_add\n candidate = method(:add)\n assert_equal(88, candidate.call([4, 88]))\n assert_equal(122, candidate.call([4, 5, 6, 7, 2, 122]))\n assert_equal(0, candidate.call([4, 0, 6, 7]))\n assert_equal(12, candidate.call([4, 4, 6, 8]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "rb", - "prompt": "# Return sorted unique elements in a list\n# >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123])\n# [0, 2, 3, 5, 9, 123]\ndef unique(l)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_unique\n candidate = method(:unique)\n assert_equal([0, 2, 3, 5, 9, 123], candidate.call([5, 3, 5, 2, 3, 3, 9, 0, 123]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "rb", - "prompt": "# Given a string text, replace all spaces in it with underscores, \n# and if a string has more than 2 consecutive spaces, \n# then replace all consecutive spaces with - \n# fix_spaces(\"Example\") == \"Example\"\n# fix_spaces(\"Example 1\") == \"Example_1\"\n# fix_spaces(\" Example 2\") == \"_Example_2\"\n# fix_spaces(\" Example 3\") == \"_Example-3\"\ndef fix_spaces(text)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_fix_spaces\n candidate = method(:fix_spaces)\n assert_equal(\"Example\", candidate.call(\"Example\"))\n assert_equal(\"Mudasir_Hanif_\", candidate.call(\"Mudasir Hanif \"))\n assert_equal(\"Yellow_Yellow__Dirty__Fellow\", candidate.call(\"Yellow Yellow Dirty Fellow\"))\n assert_equal(\"Exa-mple\", candidate.call(\"Exa mple\"))\n assert_equal(\"-Exa_1_2_2_mple\", candidate.call(\" Exa 1 2 2 mple\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "rb", - "prompt": "# Return 2^n modulo p (be aware of numerics).\n# >>> modp(3, 5)\n# 3\n# >>> modp(1101, 101)\n# 2\n# >>> modp(0, 101)\n# 1\n# >>> modp(3, 11)\n# 8\n# >>> modp(100, 101)\n# 1\ndef modp(n, p)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_modp\n candidate = method(:modp)\n assert_equal(3, candidate.call(3, 5))\n assert_equal(2, candidate.call(1101, 101))\n assert_equal(1, candidate.call(0, 101))\n assert_equal(8, candidate.call(3, 11))\n assert_equal(1, candidate.call(100, 101))\n assert_equal(4, candidate.call(30, 5))\n assert_equal(3, candidate.call(31, 5))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "rb", - "prompt": "# You have to write a function which validates a given date string and\n# returns True if the date is valid otherwise False.\n# The date is valid if all of the following rules are satisfied:\n# 1. The date string is not empty.\n# 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n# 3. The months should not be less than 1 or higher than 12.\n# 4. The date should be in the format: mm-dd-yyyy\n# for example: \n# valid_date('03-11-2000') => True\n# valid_date('15-01-2012') => False\n# valid_date('04-0-2040') => False\n# valid_date('06-04-2020') => True\n# valid_date('06/04/2020') => False\ndef valid_date(date)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_valid_date\n candidate = method(:valid_date)\n assert_equal(true, candidate.call(\"03-11-2000\"))\n assert_equal(false, candidate.call(\"15-01-2012\"))\n assert_equal(false, candidate.call(\"04-0-2040\"))\n assert_equal(true, candidate.call(\"06-04-2020\"))\n assert_equal(true, candidate.call(\"01-01-2007\"))\n assert_equal(false, candidate.call(\"03-32-2011\"))\n assert_equal(false, candidate.call(\"\"))\n assert_equal(false, candidate.call(\"04-31-3000\"))\n assert_equal(true, candidate.call(\"06-06-2005\"))\n assert_equal(false, candidate.call(\"21-31-2000\"))\n assert_equal(true, candidate.call(\"04-12-2003\"))\n assert_equal(false, candidate.call(\"04122003\"))\n assert_equal(false, candidate.call(\"20030412\"))\n assert_equal(false, candidate.call(\"2003-04\"))\n assert_equal(false, candidate.call(\"2003-04-12\"))\n assert_equal(false, candidate.call(\"04-2003\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "rb", - "prompt": "# Write a function that takes a string and returns an ordered version of it.\n# Ordered version of string, is a string where all words (separated by space)\n# are replaced by a new word where all the characters arranged in\n# ascending order based on ascii value.\n# Note: You should keep the order of words and blank spaces in the sentence.\n# For example:\n# anti_shuffle('Hi') returns 'Hi'\n# anti_shuffle('hello') returns 'ehllo'\n# anti_shuffle('Hello World!!!') returns 'Hello !!!Wdlor'\ndef anti_shuffle(s)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_anti_shuffle\n candidate = method(:anti_shuffle)\n assert_equal(\"Hi\", candidate.call(\"Hi\"))\n assert_equal(\"ehllo\", candidate.call(\"hello\"))\n assert_equal(\"bemnru\", candidate.call(\"number\"))\n assert_equal(\"abcd\", candidate.call(\"abcd\"))\n assert_equal(\"Hello !!!Wdlor\", candidate.call(\"Hello World!!!\"))\n assert_equal(\"\", candidate.call(\"\"))\n assert_equal(\".Hi My aemn is Meirst .Rboot How aer ?ouy\", candidate.call(\"Hi. My name is Mister Robot. How are you?\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "rb", - "prompt": "# Given a list of numbers, return whether or not they are sorted\n# in ascending order. If list has more than 1 duplicate of the same\n# number, return False. Assume no negative numbers and only integers.\n# Examples\n# is_sorted([5]) \u279e True\n# is_sorted([1, 2, 3, 4, 5]) \u279e True\n# is_sorted([1, 3, 2, 4, 5]) \u279e False\n# is_sorted([1, 2, 3, 4, 5, 6]) \u279e True\n# is_sorted([1, 2, 3, 4, 5, 6, 7]) \u279e True\n# is_sorted([1, 3, 2, 4, 5, 6, 7]) \u279e False\n# is_sorted([1, 2, 2, 3, 3, 4]) \u279e True\n# is_sorted([1, 2, 2, 2, 3, 4]) \u279e False\ndef is_sorted(lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_sorted\n candidate = method(:is_sorted)\n assert_equal(true, candidate.call([5]))\n assert_equal(true, candidate.call([1, 2, 3, 4, 5]))\n assert_equal(false, candidate.call([1, 3, 2, 4, 5]))\n assert_equal(true, candidate.call([1, 2, 3, 4, 5, 6]))\n assert_equal(true, candidate.call([1, 2, 3, 4, 5, 6, 7]))\n assert_equal(false, candidate.call([1, 3, 2, 4, 5, 6, 7]))\n assert_equal(true, candidate.call([]))\n assert_equal(true, candidate.call([1]))\n assert_equal(false, candidate.call([3, 2, 1]))\n assert_equal(false, candidate.call([1, 2, 2, 2, 3, 4]))\n assert_equal(false, candidate.call([1, 2, 3, 3, 3, 4]))\n assert_equal(true, candidate.call([1, 2, 2, 3, 3, 4]))\n assert_equal(true, candidate.call([1, 2, 3, 4]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "rb", - "prompt": "# You are given a string s.\n# Your task is to check if the string is happy or not.\n# A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n# For example:\n# is_happy(a) => False\n# is_happy(aa) => False\n# is_happy(abcd) => True\n# is_happy(aabb) => False\n# is_happy(adb) => True\n# is_happy(xyy) => False\ndef is_happy(s)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_happy\n candidate = method(:is_happy)\n assert_equal(false, candidate.call(\"a\"))\n assert_equal(false, candidate.call(\"aa\"))\n assert_equal(true, candidate.call(\"abcd\"))\n assert_equal(false, candidate.call(\"aabb\"))\n assert_equal(true, candidate.call(\"adb\"))\n assert_equal(false, candidate.call(\"xyy\"))\n assert_equal(true, candidate.call(\"iopaxpoi\"))\n assert_equal(false, candidate.call(\"iopaxioi\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "rb", - "prompt": "# Write a function that returns True if the object q will fly, and False otherwise.\n# The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n# Example:\n# will_it_fly([1, 2], 5) \u279e False \n# # 1+2 is less than the maximum possible weight, but it's unbalanced.\n# will_it_fly([3, 2, 3], 1) \u279e False\n# # it's balanced, but 3+2+3 is more than the maximum possible weight.\n# will_it_fly([3, 2, 3], 9) \u279e True\n# # 3+2+3 is less than the maximum possible weight, and it's balanced.\n# will_it_fly([3], 5) \u279e True\n# # 3 is less than the maximum possible weight, and it's balanced.\ndef will_it_fly(q, w)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_will_it_fly\n candidate = method(:will_it_fly)\n assert_equal(true, candidate.call([3, 2, 3], 9))\n assert_equal(false, candidate.call([1, 2], 5))\n assert_equal(true, candidate.call([3], 5))\n assert_equal(false, candidate.call([3, 2, 3], 1))\n assert_equal(false, candidate.call([1, 2, 3], 6))\n assert_equal(true, candidate.call([5], 5))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "rb", - "prompt": "# Given an array of non-negative integers, return a copy of the given array after sorting,\n# you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n# or sort it in descending order if the sum( first index value, last index value) is even.\n# Note:\n# * don't change the given array.\n# Examples:\n# * sort_array([]) => []\n# * sort_array([5]) => [5]\n# * sort_array([2, 4, 3, 0, 1, 5]) => [0, 1, 2, 3, 4, 5]\n# * sort_array([2, 4, 3, 0, 1, 5, 6]) => [6, 5, 4, 3, 2, 1, 0]\ndef sort_array(array)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sort_array\n candidate = method(:sort_array)\n assert_equal([], candidate.call([]))\n assert_equal([5], candidate.call([5]))\n assert_equal([0, 1, 2, 3, 4, 5], candidate.call([2, 4, 3, 0, 1, 5]))\n assert_equal([6, 5, 4, 3, 2, 1, 0], candidate.call([2, 4, 3, 0, 1, 5, 6]))\n assert_equal([1, 2], candidate.call([2, 1]))\n assert_equal([0, 11, 15, 32, 42, 87], candidate.call([15, 42, 87, 32, 11, 0]))\n assert_equal([23, 21, 14, 11], candidate.call([21, 14, 23, 11]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "rb", - "prompt": "# Implement a function that takes an non-negative integer and returns an array of the first n\n# integers that are prime numbers and less than n.\n# for example:\n# count_up_to(5) => [2,3]\n# count_up_to(11) => [2,3,5,7]\n# count_up_to(0) => []\n# count_up_to(20) => [2,3,5,7,11,13,17,19]\n# count_up_to(1) => []\n# count_up_to(18) => [2,3,5,7,11,13,17]\ndef count_up_to(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_count_up_to\n candidate = method(:count_up_to)\n assert_equal([2, 3], candidate.call(5))\n assert_equal([2, 3, 5], candidate.call(6))\n assert_equal([2, 3, 5], candidate.call(7))\n assert_equal([2, 3, 5, 7], candidate.call(10))\n assert_equal([], candidate.call(0))\n assert_equal([2, 3, 5, 7, 11, 13, 17, 19], candidate.call(22))\n assert_equal([], candidate.call(1))\n assert_equal([2, 3, 5, 7, 11, 13, 17], candidate.call(18))\n assert_equal([2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43], candidate.call(47))\n assert_equal([2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97], candidate.call(101))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "rb", - "prompt": "# Out of list of strings, return the longest one. Return the first one in case of multiple\n# strings of the same length. Return None in case the input list is empty.\n# >>> longest([])\n# >>> longest(['a', 'b', 'c'])\n# 'a'\n# >>> longest(['a', 'bb', 'ccc'])\n# 'ccc'\ndef longest(strings)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_longest\n candidate = method(:longest)\n assert_equal(nil, candidate.call([]))\n assert_equal(\"x\", candidate.call([\"x\", \"y\", \"z\"]))\n assert_equal(\"zzzz\", candidate.call([\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "rb", - "prompt": "# Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n# reverse the resulting array, and then replace each digit by its corresponding name from\n# \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n# For example:\n# arr = [2, 1, 1, 4, 5, 8, 2, 3] \n# -> sort arr -> [1, 1, 2, 2, 3, 4, 5, 8] \n# -> reverse arr -> [8, 5, 4, 3, 2, 2, 1, 1]\n# return [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n# If the array is empty, return an empty array:\n# arr = []\n# return []\n# If the array has any strange number ignore it:\n# arr = [1, -1 , 55] \n# -> sort arr -> [-1, 1, 55]\n# -> reverse arr -> [55, 1, -1]\n# return = ['One']\ndef by_length(arr)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_by_length\n candidate = method(:by_length)\n assert_equal([\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"], candidate.call([2, 1, 1, 4, 5, 8, 2, 3]))\n assert_equal([], candidate.call([]))\n assert_equal([\"One\"], candidate.call([1, -1, 55]))\n assert_equal([\"Three\", \"Two\", \"One\"], candidate.call([1, -1, 3, 2]))\n assert_equal([\"Nine\", \"Eight\", \"Four\"], candidate.call([9, 4, 8]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_106_f", - "language": "rb", - "prompt": "# Implement the function f that takes n as a parameter,\n# 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\n# or the sum of numbers from 1 to i otherwise.\n# i starts from 1.\n# the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n# Example:\n# f(5) == [1, 2, 6, 24, 15]\ndef f(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_f\n candidate = method(:f)\n assert_equal([1, 2, 6, 24, 15], candidate.call(5))\n assert_equal([1, 2, 6, 24, 15, 720, 28], candidate.call(7))\n assert_equal([1], candidate.call(1))\n assert_equal([1, 2, 6], candidate.call(3))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "rb", - "prompt": "# Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n# >>> fizz_buzz(50)\n# 0\n# >>> fizz_buzz(78)\n# 2\n# >>> fizz_buzz(79)\n# 3\ndef fizz_buzz(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_fizz_buzz\n candidate = method(:fizz_buzz)\n assert_equal(0, candidate.call(50))\n assert_equal(2, candidate.call(78))\n assert_equal(3, candidate.call(79))\n assert_equal(3, candidate.call(100))\n assert_equal(6, candidate.call(200))\n assert_equal(192, candidate.call(4000))\n assert_equal(639, candidate.call(10000))\n assert_equal(8026, candidate.call(100000))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "rb", - "prompt": "# Given a positive floating point number, it can be decomposed into\n# and integer part (largest integer smaller than given number) and decimals\n# (leftover part always smaller than 1).\n# Return the decimal part of the number.\n# >>> truncate_number(3.5)\n# 0.5\ndef truncate_number(number)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_truncate_number\n candidate = method(:truncate_number)\n assert_equal(0.5, candidate.call(3.5))\n assert_equal(0.25, candidate.call(1.25))\n assert_equal(0.0, candidate.call(123.0))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "rb", - "prompt": "# For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n# Empty sum should be equal to 0 and empty product should be equal to 1.\n# >>> sum_product([])\n# (0, 1)\n# >>> sum_product([1, 2, 3, 4])\n# (10, 24)\ndef sum_product(numbers)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sum_product\n candidate = method(:sum_product)\n assert_equal([0, 1], candidate.call([]))\n assert_equal([3, 1], candidate.call([1, 1, 1]))\n assert_equal([100, 0], candidate.call([100, 0]))\n assert_equal([15, 105], candidate.call([3, 5, 7]))\n assert_equal([10, 10], candidate.call([10]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "rb", - "prompt": "# You are given a 2 dimensional data, as a nested lists,\n# which is similar to matrix, however, unlike matrices,\n# each row may contain a different number of columns.\n# Given lst, and integer x, find integers x in the list,\n# and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n# each tuple is a coordinate - (row, columns), starting with 0.\n# Sort coordinates initially by rows in ascending order.\n# Also, sort coordinates of the row by columns in descending order.\n# Examples:\n# get_row([\n# [1,2,3,4,5,6],\n# [1,2,3,4,1,6],\n# [1,2,3,4,5,1]\n# ], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n# get_row([], 1) == []\n# get_row([[], [1], [1, 2, 3]], 3) == [(2, 2)]\ndef get_row(lst, x)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_get_row\n candidate = method(:get_row)\n assert_equal([[0, 0], [1, 4], [1, 0], [2, 5], [2, 0]], candidate.call([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1))\n assert_equal([[0, 1], [1, 1], [2, 1], [3, 1], [4, 1], [5, 1]], candidate.call([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6]], 2))\n assert_equal([[0, 0], [1, 0], [2, 1], [2, 0], [3, 2], [3, 0], [4, 3], [4, 0], [5, 4], [5, 0], [6, 5], [6, 0]], candidate.call([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 1, 3, 4, 5, 6], [1, 2, 1, 4, 5, 6], [1, 2, 3, 1, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1))\n assert_equal([], candidate.call([], 1))\n assert_equal([], candidate.call([[1]], 2))\n assert_equal([[2, 2]], candidate.call([[], [1], [1, 2, 3]], 3))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "rb", - "prompt": "# You're a hungry rabbit, and you already have eaten a certain number of carrots,\n# but now you need to eat more carrots to complete the day's meals.\n# you should return an array of [ total number of eaten carrots after your meals,\n# the number of carrots left after your meals ]\n# if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n# Example:\n# * eat(5, 6, 10) -> [11, 4]\n# * eat(4, 8, 9) -> [12, 1]\n# * eat(1, 10, 10) -> [11, 0]\n# * eat(2, 11, 5) -> [7, 0]\n# Variables:\n# @number : integer\n# the number of carrots that you have eaten.\n# @need : integer\n# the number of carrots that you need to eat.\n# @remaining : integer\n# the number of remaining carrots thet exist in stock\n# Constrain:\n# * 0 <= number <= 1000\n# * 0 <= need <= 1000\n# * 0 <= remaining <= 1000\n# Have fun :)\ndef eat(number, need, remaining)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_eat\n candidate = method(:eat)\n assert_equal([11, 4], candidate.call(5, 6, 10))\n assert_equal([12, 1], candidate.call(4, 8, 9))\n assert_equal([11, 0], candidate.call(1, 10, 10))\n assert_equal([7, 0], candidate.call(2, 11, 5))\n assert_equal([9, 2], candidate.call(4, 5, 7))\n assert_equal([5, 0], candidate.call(4, 5, 1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "rb", - "prompt": "# Given a positive integer N, return the total sum of its digits in binary.\n# Example\n# For N = 1000, the sum of digits will be 1 the output should be \"1\".\n# For N = 150, the sum of digits will be 6 the output should be \"110\".\n# For N = 147, the sum of digits will be 12 the output should be \"1100\".\n# Variables:\n# @N integer\n# Constraints: 0 \u2264 N \u2264 10000.\n# Output:\n# a string of binary number\ndef solve(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_solve\n candidate = method(:solve)\n assert_equal(\"1\", candidate.call(1000))\n assert_equal(\"110\", candidate.call(150))\n assert_equal(\"1100\", candidate.call(147))\n assert_equal(\"1001\", candidate.call(333))\n assert_equal(\"10010\", candidate.call(963))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "rb", - "prompt": "# You are given a list of integers.\n# You need to find the largest prime value and return the sum of its digits.\n# Examples:\n# For lst = [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] the output should be 10\n# For lst = [1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1] the output should be 25\n# For lst = [1,3,1,32,5107,34,83278,109,163,23,2323,32,30,1,9,3] the output should be 13\n# For lst = [0,724,32,71,99,32,6,0,5,91,83,0,5,6] the output should be 11\n# For lst = [0,81,12,3,1,21] the output should be 3\n# For lst = [0,8,1,2,1,7] the output should be 7\ndef skjkasdkd(lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_skjkasdkd\n candidate = method(:skjkasdkd)\n assert_equal(10, candidate.call([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]))\n assert_equal(25, candidate.call([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]))\n assert_equal(13, candidate.call([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]))\n assert_equal(11, candidate.call([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]))\n assert_equal(3, candidate.call([0, 81, 12, 3, 1, 21]))\n assert_equal(7, candidate.call([0, 8, 1, 2, 1, 7]))\n assert_equal(19, candidate.call([8191]))\n assert_equal(19, candidate.call([8191, 123456, 127, 7]))\n assert_equal(10, candidate.call([127, 97, 8192]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "rb", - "prompt": "# Given an array arr of integers, find the minimum number of elements that\n# need to be changed to make the array palindromic. A palindromic array is an array that\n# is read the same backwards and forwards. In one change, you can change one element to any other element.\n# For example:\n# smallest_change([1,2,3,5,4,7,9,6]) == 4\n# smallest_change([1, 2, 3, 4, 3, 2, 2]) == 1\n# smallest_change([1, 2, 3, 2, 1]) == 0\ndef smallest_change(arr)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_smallest_change\n candidate = method(:smallest_change)\n assert_equal(4, candidate.call([1, 2, 3, 5, 4, 7, 9, 6]))\n assert_equal(1, candidate.call([1, 2, 3, 4, 3, 2, 2]))\n assert_equal(1, candidate.call([1, 4, 2]))\n assert_equal(1, candidate.call([1, 4, 4, 2]))\n assert_equal(0, candidate.call([1, 2, 3, 2, 1]))\n assert_equal(0, candidate.call([3, 1, 1, 3]))\n assert_equal(0, candidate.call([1]))\n assert_equal(1, candidate.call([0, 1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "rb", - "prompt": "# It is the last week of the semester and the teacher has to give the grades\n# to students. The teacher has been making her own algorithm for grading.\n# The only problem is, she has lost the code she used for grading.\n# She has given you a list of GPAs for some students and you have to write \n# a function that can output a list of letter grades using the following table:\n# GPA | Letter grade\n# 4.0 A+\n# > 3.7 A \n# > 3.3 A- \n# > 3.0 B+\n# > 2.7 B \n# > 2.3 B-\n# > 2.0 C+\n# > 1.7 C\n# > 1.3 C-\n# > 1.0 D+ \n# > 0.7 D \n# > 0.0 D-\n# 0.0 E\n# Example:\n# grade_equation([4.0, 3, 1.7, 2, 3.5]) ==> ['A+', 'B', 'C-', 'C', 'A-']\ndef numerical_letter_grade(grades)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_numerical_letter_grade\n candidate = method(:numerical_letter_grade)\n assert_equal([\"A+\", \"B\", \"C-\", \"C\", \"A-\"], candidate.call([4.0, 3, 1.7, 2, 3.5]))\n assert_equal([\"D+\"], candidate.call([1.2]))\n assert_equal([\"D-\"], candidate.call([0.5]))\n assert_equal([\"E\"], candidate.call([0.0]))\n assert_equal([\"D\", \"D-\", \"C-\", \"B\", \"B+\"], candidate.call([1.0, 0.3, 1.5, 2.8, 3.3]))\n assert_equal([\"E\", \"D-\"], candidate.call([0.0, 0.7]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "rb", - "prompt": "# Given the lengths of the three sides of a triangle. Return the area of\n# the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n# Otherwise return -1\n# Three sides make a valid triangle when the sum of any two sides is greater \n# than the third side.\n# Example:\n# triangle_area(3, 4, 5) == 6.00\n# triangle_area(1, 2, 10) == -1\ndef triangle_area(a, b, c)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_triangle_area\n candidate = method(:triangle_area)\n assert_equal(6.0, candidate.call(3, 4, 5))\n assert_equal(-1, candidate.call(1, 2, 10))\n assert_equal(8.18, candidate.call(4, 8, 5))\n assert_equal(1.73, candidate.call(2, 2, 2))\n assert_equal(-1, candidate.call(1, 2, 3))\n assert_equal(16.25, candidate.call(10, 5, 7))\n assert_equal(-1, candidate.call(2, 6, 3))\n assert_equal(0.43, candidate.call(1, 1, 1))\n assert_equal(-1, candidate.call(2, 2, 10))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "rb", - "prompt": "# Check if two words have the same characters.\n# >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n# True\n# >>> same_chars('abcd', 'dddddddabc')\n# True\n# >>> same_chars('dddddddabc', 'abcd')\n# True\n# >>> same_chars('eabcd', 'dddddddabc')\n# False\n# >>> same_chars('abcd', 'dddddddabce')\n# False\n# >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc')\n# False\ndef same_chars(s0, s1)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_same_chars\n candidate = method(:same_chars)\n assert_equal(true, candidate.call(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\"))\n assert_equal(true, candidate.call(\"abcd\", \"dddddddabc\"))\n assert_equal(true, candidate.call(\"dddddddabc\", \"abcd\"))\n assert_equal(false, candidate.call(\"eabcd\", \"dddddddabc\"))\n assert_equal(false, candidate.call(\"abcd\", \"dddddddabcf\"))\n assert_equal(false, candidate.call(\"eabcdzzzz\", \"dddzzzzzzzddddabc\"))\n assert_equal(false, candidate.call(\"aabb\", \"aaccc\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "rb", - "prompt": "# Given an array of integers nums, find the minimum sum of any non-empty sub-array\n# of nums.\n# Example\n# minSubArraySum([2, 3, 4, 1, 2, 4]) == 1\n# minSubArraySum([-1, -2, -3]) == -6\ndef minSubArraySum(nums)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_minSubArraySum\n candidate = method(:minSubArraySum)\n assert_equal(1, candidate.call([2, 3, 4, 1, 2, 4]))\n assert_equal(-6, candidate.call([-1, -2, -3]))\n assert_equal(-14, candidate.call([-1, -2, -3, 2, -10]))\n assert_equal(-9999999999999999, candidate.call([-9999999999999999]))\n assert_equal(0, candidate.call([0, 10, 20, 1000000]))\n assert_equal(-6, candidate.call([-1, -2, -3, 10, -5]))\n assert_equal(-6, candidate.call([100, -1, -2, -3, 10, -5]))\n assert_equal(3, candidate.call([10, 11, 13, 8, 3, 4]))\n assert_equal(-33, candidate.call([100, -33, 32, -1, 0, -2]))\n assert_equal(-10, candidate.call([-10]))\n assert_equal(7, candidate.call([7]))\n assert_equal(-1, candidate.call([1, -1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "rb", - "prompt": "# Given a string s and a natural number n, you have been tasked to implement \n# a function that returns a list of all words from string s that contain exactly \n# n consonants, in order these words appear in the string s.\n# If the string s is empty then the function should return an empty list.\n# Note: you may assume the input string contains only letters and spaces.\n# Examples:\n# select_words(\"Mary had a little lamb\", 4) ==> [\"little\"]\n# select_words(\"Mary had a little lamb\", 3) ==> [\"Mary\", \"lamb\"]\n# select_words(\"simple white space\", 2) ==> []\n# select_words(\"Hello world\", 4) ==> [\"world\"]\n# select_words(\"Uncle sam\", 3) ==> [\"Uncle\"]\ndef select_words(s, n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_select_words\n candidate = method(:select_words)\n assert_equal([\"little\"], candidate.call(\"Mary had a little lamb\", 4))\n assert_equal([\"Mary\", \"lamb\"], candidate.call(\"Mary had a little lamb\", 3))\n assert_equal([], candidate.call(\"simple white space\", 2))\n assert_equal([\"world\"], candidate.call(\"Hello world\", 4))\n assert_equal([\"Uncle\"], candidate.call(\"Uncle sam\", 3))\n assert_equal([], candidate.call(\"\", 4))\n assert_equal([\"b\", \"c\", \"d\", \"f\"], candidate.call(\"a b c d e f\", 1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "rb", - "prompt": "# Return list of all prefixes from shortest to longest of the input string\n# >>> all_prefixes('abc')\n# ['a', 'ab', 'abc']\ndef all_prefixes(string)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_all_prefixes\n candidate = method(:all_prefixes)\n assert_equal([], candidate.call(\"\"))\n assert_equal([\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"], candidate.call(\"asdfgh\"))\n assert_equal([\"W\", \"WW\", \"WWW\"], candidate.call(\"WWW\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "rb", - "prompt": "# Create a function that takes a value (string) representing a number\n# and returns the closest integer to it. If the number is equidistant\n# from two integers, round it away from zero.\n# Examples\n# >>> closest_integer(\"10\")\n# 10\n# >>> closest_integer(\"15.3\")\n# 15\n# Note:\n# Rounding away from zero means that if the given number is equidistant\n# from two integers, the one you should return is the one that is the\n# farthest from zero. For example closest_integer(\"14.5\") should\n# return 15 and closest_integer(\"-14.5\") should return -15.\ndef closest_integer(value)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_closest_integer\n candidate = method(:closest_integer)\n assert_equal(10, candidate.call(\"10\"))\n assert_equal(15, candidate.call(\"14.5\"))\n assert_equal(-16, candidate.call(\"-15.5\"))\n assert_equal(15, candidate.call(\"15.3\"))\n assert_equal(0, candidate.call(\"0\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "rb", - "prompt": "# Create a function which takes a string representing a file's name, and returns\n# 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n# A file's name is considered to be valid if and only if all the following conditions \n# are met:\n# - There should not be more than three digits ('0'-'9') in the file's name.\n# - The file's name contains exactly one dot '.'\n# - The substring before the dot should not be empty, and it starts with a letter from \n# the latin alphapet ('a'-'z' and 'A'-'Z').\n# - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n# Examples:\n# file_name_check(\"example.txt\") # => 'Yes'\n# file_name_check(\"1example.dll\") # => 'No' (the name should start with a latin alphapet letter)\ndef file_name_check(file_name)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_file_name_check\n candidate = method(:file_name_check)\n assert_equal(\"Yes\", candidate.call(\"example.txt\"))\n assert_equal(\"No\", candidate.call(\"1example.dll\"))\n assert_equal(\"No\", candidate.call(\"s1sdf3.asd\"))\n assert_equal(\"Yes\", candidate.call(\"K.dll\"))\n assert_equal(\"Yes\", candidate.call(\"MY16FILE3.exe\"))\n assert_equal(\"No\", candidate.call(\"His12FILE94.exe\"))\n assert_equal(\"No\", candidate.call(\"_Y.txt\"))\n assert_equal(\"No\", candidate.call(\"?aREYA.exe\"))\n assert_equal(\"No\", candidate.call(\"/this_is_valid.dll\"))\n assert_equal(\"No\", candidate.call(\"this_is_valid.wow\"))\n assert_equal(\"Yes\", candidate.call(\"this_is_valid.txt\"))\n assert_equal(\"No\", candidate.call(\"this_is_valid.txtexe\"))\n assert_equal(\"No\", candidate.call(\"#this2_i4s_5valid.ten\"))\n assert_equal(\"No\", candidate.call(\"@this1_is6_valid.exe\"))\n assert_equal(\"No\", candidate.call(\"this_is_12valid.6exe4.txt\"))\n assert_equal(\"No\", candidate.call(\"all.exe.txt\"))\n assert_equal(\"Yes\", candidate.call(\"I563_No.exe\"))\n assert_equal(\"Yes\", candidate.call(\"Is3youfault.txt\"))\n assert_equal(\"Yes\", candidate.call(\"no_one#knows.dll\"))\n assert_equal(\"No\", candidate.call(\"1I563_Yes3.exe\"))\n assert_equal(\"No\", candidate.call(\"I563_Yes3.txtt\"))\n assert_equal(\"No\", candidate.call(\"final..txt\"))\n assert_equal(\"No\", candidate.call(\"final132\"))\n assert_equal(\"No\", candidate.call(\"_f4indsartal132.\"))\n assert_equal(\"No\", candidate.call(\".txt\"))\n assert_equal(\"No\", candidate.call(\"s.\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "rb", - "prompt": "# You are given two intervals,\n# where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n# The given intervals are closed which means that the interval (start, end)\n# includes both start and end.\n# For each given interval, it is assumed that its start is less or equal its end.\n# Your task is to determine whether the length of intersection of these two \n# intervals is a prime number.\n# Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n# which its length is 1, which not a prime number.\n# If the length of the intersection is a prime number, return \"YES\",\n# otherwise, return \"NO\".\n# If the two intervals don't intersect, return \"NO\".\n# [input/output] samples:\n# intersection((1, 2), (2, 3)) ==> \"NO\"\n# intersection((-1, 1), (0, 4)) ==> \"NO\"\n# intersection((-3, -1), (-5, 5)) ==> \"YES\"\ndef intersection(interval1, interval2)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_intersection\n candidate = method(:intersection)\n assert_equal(\"NO\", candidate.call([1, 2], [2, 3]))\n assert_equal(\"NO\", candidate.call([-1, 1], [0, 4]))\n assert_equal(\"YES\", candidate.call([-3, -1], [-5, 5]))\n assert_equal(\"YES\", candidate.call([-2, 2], [-4, 0]))\n assert_equal(\"NO\", candidate.call([-11, 2], [-1, -1]))\n assert_equal(\"NO\", candidate.call([1, 2], [3, 5]))\n assert_equal(\"NO\", candidate.call([1, 2], [1, 2]))\n assert_equal(\"NO\", candidate.call([-2, -2], [-3, -2]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "rb", - "prompt": "# Return the largest prime factor of n. Assume n > 1 and is not a prime.\n# >>> largest_prime_factor(13195)\n# 29\n# >>> largest_prime_factor(2048)\n# 2\ndef largest_prime_factor(n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_largest_prime_factor\n candidate = method(:largest_prime_factor)\n assert_equal(5, candidate.call(15))\n assert_equal(3, candidate.call(27))\n assert_equal(7, candidate.call(63))\n assert_equal(11, candidate.call(330))\n assert_equal(29, candidate.call(13195))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "rb", - "prompt": "# Given a string, find out how many distinct characters (regardless of case) does it consist of\n# >>> count_distinct_characters('xyzXYZ')\n# 3\n# >>> count_distinct_characters('Jerry')\n# 4\ndef count_distinct_characters(string)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_count_distinct_characters\n candidate = method(:count_distinct_characters)\n assert_equal(0, candidate.call(\"\"))\n assert_equal(5, candidate.call(\"abcde\"))\n assert_equal(5, candidate.call(\"abcdecadeCADE\"))\n assert_equal(1, candidate.call(\"aaaaAAAAaaaa\"))\n assert_equal(5, candidate.call(\"Jerry jERRY JeRRRY\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "rb", - "prompt": "# You're given a list of deposit and withdrawal operations on a bank account that starts with\n# zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n# at that point function should return True. Otherwise it should return False.\n# >>> below_zero([1, 2, 3])\n# False\n# >>> below_zero([1, 2, -4, 5])\n# True\ndef below_zero(operations)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_below_zero\n candidate = method(:below_zero)\n assert_equal(false, candidate.call([]))\n assert_equal(false, candidate.call([1, 2, -3, 1, 2, -3]))\n assert_equal(true, candidate.call([1, 2, -4, 5, 6]))\n assert_equal(false, candidate.call([1, -1, 2, -2, 5, -5, 4, -4]))\n assert_equal(true, candidate.call([1, -1, 2, -2, 5, -5, 4, -5]))\n assert_equal(true, candidate.call([1, -2, 2, -2, 5, -5, 4, -4]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "rb", - "prompt": "# Find the shortest palindrome that begins with a supplied string.\n# Algorithm idea is simple:\n# - Find the longest postfix of supplied string that is a palindrome.\n# - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n# >>> make_palindrome('')\n# ''\n# >>> make_palindrome('cat')\n# 'catac'\n# >>> make_palindrome('cata')\n# 'catac'\ndef make_palindrome(string)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_make_palindrome\n candidate = method(:make_palindrome)\n assert_equal(\"\", candidate.call(\"\"))\n assert_equal(\"x\", candidate.call(\"x\"))\n assert_equal(\"xyzyx\", candidate.call(\"xyz\"))\n assert_equal(\"xyx\", candidate.call(\"xyx\"))\n assert_equal(\"jerryrrej\", candidate.call(\"jerry\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "rb", - "prompt": "# Given a positive integer, obtain its roman numeral equivalent as a string,\n# and return it in lowercase.\n# Restrictions: 1 <= num <= 1000\n# Examples:\n# >>> int_to_mini_roman(19) == 'xix'\n# >>> int_to_mini_roman(152) == 'clii'\n# >>> int_to_mini_roman(426) == 'cdxxvi'\ndef int_to_mini_roman(number)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_int_to_mini_roman\n candidate = method(:int_to_mini_roman)\n assert_equal(\"xix\", candidate.call(19))\n assert_equal(\"clii\", candidate.call(152))\n assert_equal(\"ccli\", candidate.call(251))\n assert_equal(\"cdxxvi\", candidate.call(426))\n assert_equal(\"d\", candidate.call(500))\n assert_equal(\"i\", candidate.call(1))\n assert_equal(\"iv\", candidate.call(4))\n assert_equal(\"xliii\", candidate.call(43))\n assert_equal(\"xc\", candidate.call(90))\n assert_equal(\"xciv\", candidate.call(94))\n assert_equal(\"dxxxii\", candidate.call(532))\n assert_equal(\"cm\", candidate.call(900))\n assert_equal(\"cmxciv\", candidate.call(994))\n assert_equal(\"m\", candidate.call(1000))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - } -] \ No newline at end of file diff --git a/data/rb-remove.json b/data/rb-remove.json deleted file mode 100644 index 4c89c034a2e38868a3e7b7aba50d0b81d159da81..0000000000000000000000000000000000000000 --- a/data/rb-remove.json +++ /dev/null @@ -1,2372 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "rb", - "prompt": "# For a given number n, find the largest number that divides n evenly, smaller than n\ndef largest_divisor(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_largest_divisor\n candidate = method(:largest_divisor)\n assert_equal(1, candidate.call(3))\n assert_equal(1, candidate.call(7))\n assert_equal(5, candidate.call(10))\n assert_equal(50, candidate.call(100))\n assert_equal(7, candidate.call(49))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_47_median", - "language": "rb", - "prompt": "# Return median of elements in the list l.\ndef median(l)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_median\n candidate = method(:median)\n assert_equal(3, candidate.call([3, 1, 2, 4, 5]))\n assert_equal(8.0, candidate.call([-10, 4, 6, 1000, 10, 20]))\n assert_equal(5, candidate.call([5]))\n assert_equal(5.5, candidate.call([6, 5]))\n assert_equal(7, candidate.call([8, 1, 3, 9, 9, 2, 7]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "rb", - "prompt": "# Return maximum element in the list.\ndef max_element(l)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_max_element\n candidate = method(:max_element)\n assert_equal(3, candidate.call([1, 2, 3]))\n assert_equal(124, candidate.call([5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "rb", - "prompt": "# Create a function which returns the largest index of an element which\n# is not greater than or equal to the element immediately preceding it. If\n# no such element exists then return -1. The given array will not contain\n# duplicate values.\n# Examples:\ndef can_arrange(arr)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_can_arrange\n candidate = method(:can_arrange)\n assert_equal(3, candidate.call([1, 2, 4, 3, 5]))\n assert_equal(-1, candidate.call([1, 2, 4, 5]))\n assert_equal(2, candidate.call([1, 4, 2, 5, 6, 7, 8, 9, 10]))\n assert_equal(4, candidate.call([4, 8, 5, 7, 3]))\n assert_equal(-1, candidate.call([]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "rb", - "prompt": "# Create a function that returns True if the last character\n# of a given string is an alphabetical character and is not\n# a part of a word, and False otherwise.\n# Note: \"word\" is a group of characters separated by space.\n# Examples:\ndef check_if_last_char_is_a_letter(txt)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_check_if_last_char_is_a_letter\n candidate = method(:check_if_last_char_is_a_letter)\n assert_equal(false, candidate.call(\"apple\"))\n assert_equal(true, candidate.call(\"apple pi e\"))\n assert_equal(false, candidate.call(\"eeeee\"))\n assert_equal(true, candidate.call(\"A\"))\n assert_equal(false, candidate.call(\"Pumpkin pie \"))\n assert_equal(false, candidate.call(\"Pumpkin pie 1\"))\n assert_equal(false, candidate.call(\"\"))\n assert_equal(false, candidate.call(\"eeeee e \"))\n assert_equal(false, candidate.call(\"apple pie\"))\n assert_equal(false, candidate.call(\"apple pi e \"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "rb", - "prompt": "# Return true if a given number is prime, and false otherwise.\ndef is_prime(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_prime\n candidate = method(:is_prime)\n assert_equal(false, candidate.call(6))\n assert_equal(true, candidate.call(101))\n assert_equal(true, candidate.call(11))\n assert_equal(true, candidate.call(13441))\n assert_equal(true, candidate.call(61))\n assert_equal(false, candidate.call(4))\n assert_equal(false, candidate.call(1))\n assert_equal(true, candidate.call(5))\n assert_equal(true, candidate.call(11))\n assert_equal(true, candidate.call(17))\n assert_equal(false, candidate.call(85))\n assert_equal(false, candidate.call(77))\n assert_equal(false, candidate.call(255379))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "rb", - "prompt": "# Given a list of positive integers x. return a sorted list of all \n# elements that hasn't any even digit.\n# Note: Returned list should be sorted in increasing order.\n# For example:\ndef unique_digits(x)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_unique_digits\n candidate = method(:unique_digits)\n assert_equal([1, 15, 33], candidate.call([15, 33, 1422, 1]))\n assert_equal([], candidate.call([152, 323, 1422, 10]))\n assert_equal([111, 151], candidate.call([12345, 2033, 111, 151]))\n assert_equal([31, 135], candidate.call([135, 103, 31]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "rb", - "prompt": "# Input are two strings a and b consisting only of 1s and 0s.\n# Perform binary XOR on these inputs and return result also as a string.\ndef string_xor(a, b)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_string_xor\n candidate = method(:string_xor)\n assert_equal(\"010010\", candidate.call(\"111000\", \"101010\"))\n assert_equal(\"0\", candidate.call(\"1\", \"1\"))\n assert_equal(\"0101\", candidate.call(\"0101\", \"0000\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "rb", - "prompt": "# sum_to_n is a function that sums numbers from 1 to n.\ndef sum_to_n(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sum_to_n\n candidate = method(:sum_to_n)\n assert_equal(1, candidate.call(1))\n assert_equal(21, candidate.call(6))\n assert_equal(66, candidate.call(11))\n assert_equal(465, candidate.call(30))\n assert_equal(5050, candidate.call(100))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "rb", - "prompt": "# Given a list of numbers, return the sum of squares of the numbers\n# in the list that are odd. Ignore numbers that are negative or not integers.\n# If the input list is empty, return 0.\ndef double_the_difference(lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_double_the_difference\n candidate = method(:double_the_difference)\n assert_equal(0, candidate.call([]))\n assert_equal(25, candidate.call([5.0, 4.0]))\n assert_equal(0, candidate.call([0.1, 0.2, 0.3]))\n assert_equal(0, candidate.call([-10.0, -20.0, -30.0]))\n assert_equal(0, candidate.call([-1.0, -2.0, 8.0]))\n assert_equal(34, candidate.call([0.2, 3.0, 5.0]))\n assert_equal(165, candidate.call([-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "rb", - "prompt": "# Return length of given string\ndef strlen(string)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_strlen\n candidate = method(:strlen)\n assert_equal(0, candidate.call(\"\"))\n assert_equal(1, candidate.call(\"x\"))\n assert_equal(9, candidate.call(\"asdasnakj\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "rb", - "prompt": "# You'll be given a string of words, and your task is to count the number\n# of boredoms. A boredom is a sentence that starts with the word \"I\".\n# Sentences are delimited by '.', '?' or '!'.\n# For example:\ndef is_bored(s)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_bored\n candidate = method(:is_bored)\n assert_equal(0, candidate.call(\"Hello world\"))\n assert_equal(0, candidate.call(\"Is the sky blue?\"))\n assert_equal(1, candidate.call(\"I love It !\"))\n assert_equal(0, candidate.call(\"bIt\"))\n assert_equal(2, candidate.call(\"I feel good today. I will be productive. will kill It\"))\n assert_equal(0, candidate.call(\"You and I are going for a walk\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "rb", - "prompt": "# Write a function vowels_count which takes a string representing\n# a word as input and returns the number of vowels in the string.\n# Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n# vowel, but only when it is at the end of the given word.\n# Example:\ndef vowels_count(s)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_vowels_count\n candidate = method(:vowels_count)\n assert_equal(2, candidate.call(\"abcde\"))\n assert_equal(3, candidate.call(\"Alone\"))\n assert_equal(2, candidate.call(\"key\"))\n assert_equal(1, candidate.call(\"bye\"))\n assert_equal(2, candidate.call(\"keY\"))\n assert_equal(1, candidate.call(\"bYe\"))\n assert_equal(3, candidate.call(\"ACEDY\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "rb", - "prompt": "# Return n-th Fibonacci number.\ndef fib(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_fib\n candidate = method(:fib)\n assert_equal(55, candidate.call(10))\n assert_equal(1, candidate.call(1))\n assert_equal(21, candidate.call(8))\n assert_equal(89, candidate.call(11))\n assert_equal(144, candidate.call(12))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "rb", - "prompt": "# Your task is to implement a function that will simplify the expression\n# x * n. The function returns True if x * n evaluates to a whole number and False\n# otherwise. Both x and n, are string representation of a fraction, and have the following format,\n# / where both numerator and denominator are positive whole numbers.\n# You can assume that x, and n are valid fractions, and do not have zero as denominator.\ndef simplify(x, n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_simplify\n candidate = method(:simplify)\n assert_equal(true, candidate.call(\"1/5\", \"5/1\"))\n assert_equal(false, candidate.call(\"1/6\", \"2/1\"))\n assert_equal(true, candidate.call(\"5/1\", \"3/1\"))\n assert_equal(false, candidate.call(\"7/10\", \"10/2\"))\n assert_equal(true, candidate.call(\"2/10\", \"50/10\"))\n assert_equal(true, candidate.call(\"7/2\", \"4/2\"))\n assert_equal(true, candidate.call(\"11/6\", \"6/1\"))\n assert_equal(false, candidate.call(\"2/3\", \"5/2\"))\n assert_equal(false, candidate.call(\"5/2\", \"3/5\"))\n assert_equal(true, candidate.call(\"2/4\", \"8/4\"))\n assert_equal(true, candidate.call(\"2/4\", \"4/2\"))\n assert_equal(true, candidate.call(\"1/5\", \"5/1\"))\n assert_equal(false, candidate.call(\"1/5\", \"1/5\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "rb", - "prompt": "# Given a string s, count the number of uppercase vowels in even indices.\n# For example:\ndef count_upper(s)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_count_upper\n candidate = method(:count_upper)\n assert_equal(1, candidate.call(\"aBCdEf\"))\n assert_equal(0, candidate.call(\"abcdefg\"))\n assert_equal(0, candidate.call(\"dBBE\"))\n assert_equal(0, candidate.call(\"B\"))\n assert_equal(1, candidate.call(\"U\"))\n assert_equal(0, candidate.call(\"\"))\n assert_equal(2, candidate.call(\"EEEE\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "rb", - "prompt": "# You are given a rectangular grid of wells. Each row represents a single well,\n# and each 1 in a row represents a single unit of water.\n# Each well has a corresponding bucket that can be used to extract water from it, \n# and all buckets have the same capacity.\n# Your task is to use the buckets to empty the wells.\n# Output the number of times you need to lower the buckets.\n# Example 1:\n# Example 2:\n# Example 3:\n# Constraints:\n# * all wells have the same length\n# * 1 <= grid.length <= 10^2\n# * 1 <= grid[:,1].length <= 10^2\n# * grid[i][j] -> 0 | 1\n# * 1 <= capacity <= 10\ndef max_fill(grid, capacity)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_max_fill\n candidate = method(:max_fill)\n assert_equal(6, candidate.call([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1))\n assert_equal(5, candidate.call([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2))\n assert_equal(0, candidate.call([[0, 0, 0], [0, 0, 0]], 5))\n assert_equal(4, candidate.call([[1, 1, 1, 1], [1, 1, 1, 1]], 2))\n assert_equal(2, candidate.call([[1, 1, 1, 1], [1, 1, 1, 1]], 9))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "rb", - "prompt": "# Given an array arr of integers and a positive integer k, return a sorted list \n# of length k with the maximum k numbers in arr.\n# Example 1:\n# Example 2:\n# Example 3:\n# Note:\n# 1. The length of the array will be in the range of [1, 1000].\n# 2. The elements in the array will be in the range of [-1000, 1000].\n# 3. 0 <= k <= len(arr)\ndef maximum(arr, k)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_maximum\n candidate = method(:maximum)\n assert_equal([-4, -3, 5], candidate.call([-3, -4, 5], 3))\n assert_equal([4, 4], candidate.call([4, -4, 4], 2))\n assert_equal([2], candidate.call([-3, 2, 1, 2, -1, -2, 1], 1))\n assert_equal([2, 20, 123], candidate.call([123, -123, 20, 0, 1, 2, -3], 3))\n assert_equal([0, 1, 2, 20], candidate.call([-123, 20, 0, 1, 2, -3], 4))\n assert_equal([-13, -8, 0, 0, 3, 5, 15], candidate.call([5, 15, 0, 3, -13, -8, 0], 7))\n assert_equal([3, 5], candidate.call([-1, 0, 2, 5, 3, -10], 2))\n assert_equal([5], candidate.call([1, 0, 5, -7], 1))\n assert_equal([-4, 4], candidate.call([4, -4], 2))\n assert_equal([-10, 10], candidate.call([-10, 10], 2))\n assert_equal([], candidate.call([1, 2, 3, -23, 243, -400, 0], 0))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "rb", - "prompt": "# Write a function that takes a message, and encodes in such a \n# way that it swaps case of all letters, replaces all vowels in \n# the message with the letter that appears 2 places ahead of that \n# vowel in the english alphabet. \n# Assume only letters. \n# Examples:\ndef encode(message)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_encode\n candidate = method(:encode)\n assert_equal(\"tgst\", candidate.call(\"TEST\"))\n assert_equal(\"mWDCSKR\", candidate.call(\"Mudasir\"))\n assert_equal(\"ygs\", candidate.call(\"YES\"))\n assert_equal(\"tHKS KS C MGSSCGG\", candidate.call(\"This is a message\"))\n assert_equal(\"k dQnT kNqW wHcT Tq wRkTg\", candidate.call(\"I DoNt KnOw WhAt tO WrItE\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "rb", - "prompt": "# remove_vowels is a function that takes string and returns string without vowels.\ndef remove_vowels(text)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_remove_vowels\n candidate = method(:remove_vowels)\n assert_equal(\"\", candidate.call(\"\"))\n assert_equal(\"bcdf\nghjklm\", candidate.call(\"abcdef\nghijklm\"))\n assert_equal(\"fdcb\", candidate.call(\"fedcba\"))\n assert_equal(\"\", candidate.call(\"eeeee\"))\n assert_equal(\"cB\", candidate.call(\"acBAA\"))\n assert_equal(\"cB\", candidate.call(\"EcBOO\"))\n assert_equal(\"ybcd\", candidate.call(\"ybcd\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "rb", - "prompt": "# Return only positive numbers in the list.\ndef get_positive(l)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_get_positive\n candidate = method(:get_positive)\n assert_equal([4, 5, 6], candidate.call([-1, -2, 4, 5, 6]))\n assert_equal([5, 3, 2, 3, 3, 9, 123, 1], candidate.call([5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]))\n assert_equal([], candidate.call([-1, -2]))\n assert_equal([], candidate.call([]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "rb", - "prompt": "# Return a string containing space-delimited numbers starting from 0 upto n inclusive.\ndef string_sequence(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_string_sequence\n candidate = method(:string_sequence)\n assert_equal(\"0\", candidate.call(0))\n assert_equal(\"0 1 2 3\", candidate.call(3))\n assert_equal(\"0 1 2 3 4 5 6 7 8 9 10\", candidate.call(10))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "rb", - "prompt": "# Given a positive integer n, you have to make a pile of n levels of stones.\n# The first level has n stones.\n# The number of stones in the next level is:\n# - the next odd number if n is odd.\n# - the next even number if n is even.\n# Return the number of stones in each level in a list, where element at index\n# i represents the number of stones in the level (i+1).\n# Examples:\ndef make_a_pile(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_make_a_pile\n candidate = method(:make_a_pile)\n assert_equal([3, 5, 7], candidate.call(3))\n assert_equal([4, 6, 8, 10], candidate.call(4))\n assert_equal([5, 7, 9, 11, 13], candidate.call(5))\n assert_equal([6, 8, 10, 12, 14, 16], candidate.call(6))\n assert_equal([8, 10, 12, 14, 16, 18, 20, 22], candidate.call(8))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "rb", - "prompt": "# Task\n# 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\n# then check if the result string is palindrome.\n# A string is called palindrome if it reads the same backward as forward.\n# You should return a tuple containing the result string and True/False for the check.\n# Example\ndef reverse_delete(s, c)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_reverse_delete\n candidate = method(:reverse_delete)\n assert_equal([\"bcd\", false], candidate.call(\"abcde\", \"ae\"))\n assert_equal([\"acdef\", false], candidate.call(\"abcdef\", \"b\"))\n assert_equal([\"cdedc\", true], candidate.call(\"abcdedcba\", \"ab\"))\n assert_equal([\"dik\", false], candidate.call(\"dwik\", \"w\"))\n assert_equal([\"\", true], candidate.call(\"a\", \"a\"))\n assert_equal([\"abcdedcba\", true], candidate.call(\"abcdedcba\", \"\"))\n assert_equal([\"abcdedcba\", true], candidate.call(\"abcdedcba\", \"v\"))\n assert_equal([\"abba\", true], candidate.call(\"vabba\", \"v\"))\n assert_equal([\"\", true], candidate.call(\"mamma\", \"mia\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "rb", - "prompt": "# For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\ndef flip_case(string)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_flip_case\n candidate = method(:flip_case)\n assert_equal(\"\", candidate.call(\"\"))\n assert_equal(\"hELLO!\", candidate.call(\"Hello!\"))\n assert_equal(\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\", candidate.call(\"These violent delights have violent ends\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "rb", - "prompt": "# You are given a string s.\n# if s[i] is a letter, reverse its case from lower to upper or vise versa, \n# otherwise keep it as it is.\n# If the string contains no letters, reverse the string.\n# The function should return the resulted string.\n# Examples\ndef solve(s)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_solve\n candidate = method(:solve)\n assert_equal(\"aSdF\", candidate.call(\"AsDf\"))\n assert_equal(\"4321\", candidate.call(\"1234\"))\n assert_equal(\"AB\", candidate.call(\"ab\"))\n assert_equal(\"#A@c\", candidate.call(\"#a@C\"))\n assert_equal(\"#aSDFw^45\", candidate.call(\"#AsdfW^45\"))\n assert_equal(\"2@6#\", candidate.call(\"#6@2\"))\n assert_equal(\"#$A^d\", candidate.call(\"#$a^D\"))\n assert_equal(\"#CCC\", candidate.call(\"#ccc\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "rb", - "prompt": "# Filter an input list of strings only for ones that start with a given prefix.\ndef filter_by_prefix(strings, prefix)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_filter_by_prefix\n candidate = method(:filter_by_prefix)\n assert_equal([], candidate.call([], \"john\"))\n assert_equal([\"xxx\", \"xxxAAA\", \"xxx\"], candidate.call([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "rb", - "prompt": "# This function takes two positive numbers x and y and returns the\n# biggest even integer number that is in the range [x, y] inclusive. If \n# there's no such number, then the function should return -1.\n# For example:\ndef choose_num(x, y)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_choose_num\n candidate = method(:choose_num)\n assert_equal(14, candidate.call(12, 15))\n assert_equal(-1, candidate.call(13, 12))\n assert_equal(12354, candidate.call(33, 12354))\n assert_equal(-1, candidate.call(5234, 5233))\n assert_equal(28, candidate.call(6, 29))\n assert_equal(-1, candidate.call(27, 10))\n assert_equal(-1, candidate.call(7, 7))\n assert_equal(546, candidate.call(546, 546))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "rb", - "prompt": "# You are given a string representing a sentence,\n# the sentence contains some words separated by a space,\n# and you have to return a string that contains the words from the original sentence,\n# whose lengths are prime numbers,\n# the order of the words in the new string should be the same as the original one.\n# Example 1:\n# Example 2:\n# Constraints:\n# * 1 <= len(sentence) <= 100\n# * sentence contains only letters\ndef words_in_sentence(sentence)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_words_in_sentence\n candidate = method(:words_in_sentence)\n assert_equal(\"is\", candidate.call(\"This is a test\"))\n assert_equal(\"go for\", candidate.call(\"lets go for swimming\"))\n assert_equal(\"there is no place\", candidate.call(\"there is no place available here\"))\n assert_equal(\"Hi am Hussein\", candidate.call(\"Hi I am Hussein\"))\n assert_equal(\"go for it\", candidate.call(\"go for it\"))\n assert_equal(\"\", candidate.call(\"here\"))\n assert_equal(\"is\", candidate.call(\"here is\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "rb", - "prompt": "# Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\ndef intersperse(numbers, delimeter)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_intersperse\n candidate = method(:intersperse)\n assert_equal([], candidate.call([], 7))\n assert_equal([5, 8, 6, 8, 3, 8, 2], candidate.call([5, 6, 3, 2], 8))\n assert_equal([2, 2, 2, 2, 2], candidate.call([2, 2, 2], 2))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "rb", - "prompt": "# Your task is to write a function that returns true if a number x is a simple\n# power of n and false in other cases.\n# x is a simple power of n if n**int=x\n# For example:\ndef is_simple_power(x, n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_simple_power\n candidate = method(:is_simple_power)\n assert_equal(true, candidate.call(16, 2))\n assert_equal(false, candidate.call(143214, 16))\n assert_equal(true, candidate.call(4, 2))\n assert_equal(true, candidate.call(9, 3))\n assert_equal(true, candidate.call(16, 4))\n assert_equal(false, candidate.call(24, 2))\n assert_equal(false, candidate.call(128, 4))\n assert_equal(false, candidate.call(12, 6))\n assert_equal(true, candidate.call(1, 1))\n assert_equal(true, candidate.call(1, 12))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "rb", - "prompt": "# Write a function that returns true if the given number is the multiplication of 3 prime numbers\n# and false otherwise.\n# Knowing that (a) is less then 100. \n# Example:\n# 30 = 2 * 3 * 5\ndef is_multiply_prime(a)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_multiply_prime\n candidate = method(:is_multiply_prime)\n assert_equal(false, candidate.call(5))\n assert_equal(true, candidate.call(30))\n assert_equal(true, candidate.call(8))\n assert_equal(false, candidate.call(10))\n assert_equal(true, candidate.call(125))\n assert_equal(true, candidate.call(105))\n assert_equal(false, candidate.call(126))\n assert_equal(false, candidate.call(729))\n assert_equal(false, candidate.call(891))\n assert_equal(true, candidate.call(1001))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "rb", - "prompt": "# Given the lengths of the three sides of a triangle. Return True if the three\n# sides form a right-angled triangle, False otherwise.\n# A right-angled triangle is a triangle in which one angle is right angle or \n# 90 degree.\n# Example:\ndef right_angle_triangle(a, b, c)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_right_angle_triangle\n candidate = method(:right_angle_triangle)\n assert_equal(true, candidate.call(3, 4, 5))\n assert_equal(false, candidate.call(1, 2, 3))\n assert_equal(true, candidate.call(10, 6, 8))\n assert_equal(false, candidate.call(2, 2, 2))\n assert_equal(true, candidate.call(7, 24, 25))\n assert_equal(false, candidate.call(10, 5, 7))\n assert_equal(true, candidate.call(5, 12, 13))\n assert_equal(true, candidate.call(15, 8, 17))\n assert_equal(true, candidate.call(48, 55, 73))\n assert_equal(false, candidate.call(1, 1, 1))\n assert_equal(false, candidate.call(2, 2, 10))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "rb", - "prompt": "# Create a function that takes 3 numbers.\n# Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n# Returns false in any other cases.\n# Examples\ndef any_int(x, y, z)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_any_int\n candidate = method(:any_int)\n assert_equal(true, candidate.call(2, 3, 1))\n assert_equal(false, candidate.call(2.5, 2, 3))\n assert_equal(false, candidate.call(1.5, 5, 3.5))\n assert_equal(false, candidate.call(2, 6, 2))\n assert_equal(true, candidate.call(4, 2, 2))\n assert_equal(false, candidate.call(2.2, 2.2, 2.2))\n assert_equal(true, candidate.call(-4, 6, 2))\n assert_equal(true, candidate.call(2, 1, 1))\n assert_equal(true, candidate.call(3, 4, 7))\n assert_equal(false, candidate.call(3.0, 4, 7))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "rb", - "prompt": "# This function takes a list l and returns a list l' such that\n# l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n# to the values of the corresponding indicies of l, but sorted.\ndef sort_third(l)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sort_third\n candidate = method(:sort_third)\n assert_equal([2, 6, 3, 4, 8, 9, 5], candidate.call([5, 6, 3, 4, 8, 9, 2]))\n assert_equal([2, 8, 3, 4, 6, 9, 5], candidate.call([5, 8, 3, 4, 6, 9, 2]))\n assert_equal([2, 6, 9, 4, 8, 3, 5], candidate.call([5, 6, 9, 4, 8, 3, 2]))\n assert_equal([2, 6, 3, 4, 8, 9, 5, 1], candidate.call([5, 6, 3, 4, 8, 9, 2, 1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_53_add", - "language": "rb", - "prompt": "# Add two numbers x and y\ndef add(x, y)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_add\n candidate = method(:add)\n assert_equal(1, candidate.call(0, 1))\n assert_equal(1, candidate.call(1, 0))\n assert_equal(5, candidate.call(2, 3))\n assert_equal(12, candidate.call(5, 7))\n assert_equal(12, candidate.call(7, 5))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_69_search", - "language": "rb", - "prompt": "# You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n# zero, and has a frequency greater than or equal to the value of the integer itself. \n# The frequency of an integer is the number of times it appears in the list.\n# If no such a value exist, return -1.\n# Examples:\ndef search(lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_search\n candidate = method(:search)\n assert_equal(1, candidate.call([5, 5, 5, 5, 1]))\n assert_equal(4, candidate.call([4, 1, 4, 1, 4, 4]))\n assert_equal(-1, candidate.call([3, 3]))\n assert_equal(8, candidate.call([8, 8, 8, 8, 8, 8, 8, 8]))\n assert_equal(2, candidate.call([2, 3, 3, 2, 2]))\n assert_equal(1, candidate.call([2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]))\n assert_equal(2, candidate.call([3, 2, 8, 2]))\n assert_equal(1, candidate.call([6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]))\n assert_equal(-1, candidate.call([8, 8, 3, 6, 5, 6, 4]))\n assert_equal(1, candidate.call([6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]))\n assert_equal(1, candidate.call([1, 9, 10, 1, 3]))\n assert_equal(5, candidate.call([6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]))\n assert_equal(1, candidate.call([1]))\n assert_equal(4, candidate.call([8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]))\n assert_equal(2, candidate.call([2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]))\n assert_equal(1, candidate.call([1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]))\n assert_equal(4, candidate.call([9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]))\n assert_equal(4, candidate.call([2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]))\n assert_equal(2, candidate.call([9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]))\n assert_equal(-1, candidate.call([5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]))\n assert_equal(-1, candidate.call([10]))\n assert_equal(2, candidate.call([9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]))\n assert_equal(1, candidate.call([5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]))\n assert_equal(1, candidate.call([7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]))\n assert_equal(-1, candidate.call([3, 10, 10, 9, 2]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "rb", - "prompt": "# Write a function that takes a string and returns True if the string\n# length is a prime number or False otherwise\n# Examples\ndef prime_length(string)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_prime_length\n candidate = method(:prime_length)\n assert_equal(true, candidate.call(\"Hello\"))\n assert_equal(true, candidate.call(\"abcdcba\"))\n assert_equal(true, candidate.call(\"kittens\"))\n assert_equal(false, candidate.call(\"orange\"))\n assert_equal(true, candidate.call(\"wow\"))\n assert_equal(true, candidate.call(\"world\"))\n assert_equal(true, candidate.call(\"MadaM\"))\n assert_equal(true, candidate.call(\"Wow\"))\n assert_equal(false, candidate.call(\"\"))\n assert_equal(true, candidate.call(\"HI\"))\n assert_equal(true, candidate.call(\"go\"))\n assert_equal(false, candidate.call(\"gogo\"))\n assert_equal(false, candidate.call(\"aaaaaaaaaaaaaaa\"))\n assert_equal(true, candidate.call(\"Madam\"))\n assert_equal(false, candidate.call(\"M\"))\n assert_equal(false, candidate.call(\"0\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_58_common", - "language": "rb", - "prompt": "# Return sorted unique common elements for two lists.\ndef common(l1, l2)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_common\n candidate = method(:common)\n assert_equal([1, 5, 653], candidate.call([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]))\n assert_equal([2, 3], candidate.call([5, 3, 2, 8], [3, 2]))\n assert_equal([2, 3, 4], candidate.call([4, 3, 2, 8], [3, 2, 4]))\n assert_equal([], candidate.call([4, 3, 2, 8], []))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "rb", - "prompt": "# The Brazilian factorial is defined as:\n# brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n# where n > 0\n# For example:\n# The function will receive an integer as input and should return the special\n# factorial of this integer.\ndef special_factorial(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_special_factorial\n candidate = method(:special_factorial)\n assert_equal(288, candidate.call(4))\n assert_equal(34560, candidate.call(5))\n assert_equal(125411328000, candidate.call(7))\n assert_equal(1, candidate.call(1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "rb", - "prompt": "# In this problem, you will implement a function that takes two lists of numbers,\n# and determines whether it is possible to perform an exchange of elements\n# between them to make lst1 a list of only even numbers.\n# There is no limit on the number of exchanged elements between lst1 and lst2.\n# If it is possible to exchange elements between the lst1 and lst2 to make\n# all the elements of lst1 to be even, return \"YES\".\n# Otherwise, return \"NO\".\n# For example:\n# It is assumed that the input lists will be non-empty.\ndef exchange(lst1, lst2)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_exchange\n candidate = method(:exchange)\n assert_equal(\"YES\", candidate.call([1, 2, 3, 4], [1, 2, 3, 4]))\n assert_equal(\"NO\", candidate.call([1, 2, 3, 4], [1, 5, 3, 4]))\n assert_equal(\"YES\", candidate.call([1, 2, 3, 4], [2, 1, 4, 3]))\n assert_equal(\"YES\", candidate.call([5, 7, 3], [2, 6, 4]))\n assert_equal(\"NO\", candidate.call([5, 7, 3], [2, 6, 3]))\n assert_equal(\"NO\", candidate.call([3, 2, 6, 1, 8, 9], [3, 5, 5, 1, 1, 1]))\n assert_equal(\"YES\", candidate.call([100, 200], [200, 200]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "rb", - "prompt": "# Given a non-empty array of integers arr and an integer k, return\n# the sum of the elements with at most two digits from the first k elements of arr.\n# Example:\n# Constraints:\n# 1. 1 <= len(arr) <= 100\n# 2. 1 <= k <= len(arr)\ndef add_elements(arr, k)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_add_elements\n candidate = method(:add_elements)\n assert_equal(-4, candidate.call([1, -2, -3, 41, 57, 76, 87, 88, 99], 3))\n assert_equal(0, candidate.call([111, 121, 3, 4000, 5, 6], 2))\n assert_equal(125, candidate.call([11, 21, 3, 90, 5, 6, 7, 8, 9], 4))\n assert_equal(24, candidate.call([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4))\n assert_equal(1, candidate.call([1], 1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "rb", - "prompt": "# A simple program which should return the value of x if n is \n# a prime number and should return the value of y otherwise.\n# Examples:\ndef x_or_y(n, x, y)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_x_or_y\n candidate = method(:x_or_y)\n assert_equal(34, candidate.call(7, 34, 12))\n assert_equal(5, candidate.call(15, 8, 5))\n assert_equal(33, candidate.call(3, 33, 5212))\n assert_equal(3, candidate.call(1259, 3, 52))\n assert_equal(-1, candidate.call(7919, -1, 12))\n assert_equal(583, candidate.call(3609, 1245, 583))\n assert_equal(129, candidate.call(91, 56, 129))\n assert_equal(1234, candidate.call(6, 34, 1234))\n assert_equal(0, candidate.call(1, 2, 0))\n assert_equal(2, candidate.call(2, 2, 0))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "rb", - "prompt": "# Given length of a side and high return area for a triangle.\ndef triangle_area(a, h)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_triangle_area\n candidate = method(:triangle_area)\n assert_equal(7.5, candidate.call(5, 3))\n assert_equal(2.0, candidate.call(2, 2))\n assert_equal(40.0, candidate.call(10, 8))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "rb", - "prompt": "# Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n# the last couple centuries. However, what people don't know is Tribonacci sequence.\n# Tribonacci sequence is defined by the recurrence:\n# tri(1) = 3\n# tri(n) = 1 + n / 2, if n is even.\n# tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n# For example:\n# tri(2) = 1 + (2 / 2) = 2\n# tri(4) = 3\n# tri(3) = tri(2) + tri(1) + tri(4)\n# = 2 + 3 + 3 = 8 \n# You are given a non-negative integer number n, you have to a return a list of the \n# first n + 1 numbers of the Tribonacci sequence.\n# Examples:\ndef tri(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_tri\n candidate = method(:tri)\n assert_equal([1, 3, 2, 8], candidate.call(3))\n assert_equal([1, 3, 2, 8, 3], candidate.call(4))\n assert_equal([1, 3, 2, 8, 3, 15], candidate.call(5))\n assert_equal([1, 3, 2, 8, 3, 15, 4], candidate.call(6))\n assert_equal([1, 3, 2, 8, 3, 15, 4, 24], candidate.call(7))\n assert_equal([1, 3, 2, 8, 3, 15, 4, 24, 5], candidate.call(8))\n assert_equal([1, 3, 2, 8, 3, 15, 4, 24, 5, 35], candidate.call(9))\n assert_equal([1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11], candidate.call(20))\n assert_equal([1], candidate.call(0))\n assert_equal([1, 3], candidate.call(1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "rb", - "prompt": "# You are given a list of two strings, both strings consist of open\n# parentheses '(' or close parentheses ')' only.\n# Your job is to check if it is possible to concatenate the two strings in\n# some order, that the resulting string will be good.\n# A string S is considered to be good if and only if all parentheses in S\n# are balanced. For example: the string '(())()' is good, while the string\n# '())' is not.\n# Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n# Examples:\ndef match_parens(lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_match_parens\n candidate = method(:match_parens)\n assert_equal(\"Yes\", candidate.call([\"()(\", \")\"]))\n assert_equal(\"No\", candidate.call([\")\", \")\"]))\n assert_equal(\"No\", candidate.call([\"(()(())\", \"())())\"]))\n assert_equal(\"Yes\", candidate.call([\")())\", \"(()()(\"]))\n assert_equal(\"Yes\", candidate.call([\"(())))\", \"(()())((\"]))\n assert_equal(\"No\", candidate.call([\"()\", \"())\"]))\n assert_equal(\"Yes\", candidate.call([\"(()(\", \"()))()\"]))\n assert_equal(\"No\", candidate.call([\"((((\", \"((())\"]))\n assert_equal(\"No\", candidate.call([\")(()\", \"(()(\"]))\n assert_equal(\"No\", candidate.call([\")(\", \")(\"]))\n assert_equal(\"Yes\", candidate.call([\"(\", \")\"]))\n assert_equal(\"Yes\", candidate.call([\")\", \"(\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "rb", - "prompt": "# From a list of integers, remove all elements that occur more than once.\n# Keep order of elements left the same as in the input.\ndef remove_duplicates(numbers)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_remove_duplicates\n candidate = method(:remove_duplicates)\n assert_equal([], candidate.call([]))\n assert_equal([1, 2, 3, 4], candidate.call([1, 2, 3, 4]))\n assert_equal([1, 4, 5], candidate.call([1, 2, 3, 2, 4, 3, 5]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "rb", - "prompt": "# Return a greatest common divisor of two integers a and b\ndef greatest_common_divisor(a, b)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_greatest_common_divisor\n candidate = method(:greatest_common_divisor)\n assert_equal(1, candidate.call(3, 7))\n assert_equal(5, candidate.call(10, 15))\n assert_equal(7, candidate.call(49, 14))\n assert_equal(12, candidate.call(144, 60))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "rb", - "prompt": "# Checks if given string is a palindrome\ndef is_palindrome(text)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_palindrome\n candidate = method(:is_palindrome)\n assert_equal(true, candidate.call(\"\"))\n assert_equal(true, candidate.call(\"aba\"))\n assert_equal(true, candidate.call(\"aaaaa\"))\n assert_equal(false, candidate.call(\"zbcd\"))\n assert_equal(true, candidate.call(\"xywyx\"))\n assert_equal(false, candidate.call(\"xywyz\"))\n assert_equal(false, candidate.call(\"xywzx\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "rb", - "prompt": "# xs represent coefficients of a polynomial.\n# xs[0] + xs[1] * x + xs[2] * x^2 + ....\n# Return derivative of this polynomial in the same form.\ndef derivative(xs)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_derivative\n candidate = method(:derivative)\n assert_equal([1, 4, 12, 20], candidate.call([3, 1, 2, 4, 5]))\n assert_equal([2, 6], candidate.call([1, 2, 3]))\n assert_equal([2, 2], candidate.call([3, 2, 1]))\n assert_equal([2, 2, 0, 16], candidate.call([3, 2, 1, 0, 4]))\n assert_equal([], candidate.call([1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "rb", - "prompt": "# In this task, you will be given a string that represents a number of apples and oranges \n# that are distributed in a basket of fruit this basket contains \n# apples, oranges, and mango fruits. Given the string that represents the total number of \n# the oranges and apples and an integer that represent the total number of the fruits \n# in the basket return the number of the mango fruits in the basket.\n# for examble:\ndef fruit_distribution(s, n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_fruit_distribution\n candidate = method(:fruit_distribution)\n assert_equal(8, candidate.call(\"5 apples and 6 oranges\", 19))\n assert_equal(10, candidate.call(\"5 apples and 6 oranges\", 21))\n assert_equal(2, candidate.call(\"0 apples and 1 oranges\", 3))\n assert_equal(2, candidate.call(\"1 apples and 0 oranges\", 3))\n assert_equal(95, candidate.call(\"2 apples and 3 oranges\", 100))\n assert_equal(0, candidate.call(\"2 apples and 3 oranges\", 5))\n assert_equal(19, candidate.call(\"1 apples and 100 oranges\", 120))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "rb", - "prompt": "# Write a function that takes an integer a and returns True \n# if this ingeger is a cube of some integer number.\n# Note: you may assume the input is always valid.\n# Examples:\ndef iscube(a)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_iscube\n candidate = method(:iscube)\n assert_equal(true, candidate.call(1))\n assert_equal(false, candidate.call(2))\n assert_equal(true, candidate.call(-1))\n assert_equal(true, candidate.call(64))\n assert_equal(false, candidate.call(180))\n assert_equal(true, candidate.call(1000))\n assert_equal(true, candidate.call(0))\n assert_equal(false, candidate.call(1729))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "rb", - "prompt": "# In this Kata, you have to sort an array of non-negative integers according to\n# number of ones in their binary representation in ascending order.\n# For similar number of ones, sort based on decimal value.\n# It must be implemented like this:\ndef sort_array(arr)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sort_array\n candidate = method(:sort_array)\n assert_equal([1, 2, 4, 3, 5], candidate.call([1, 5, 2, 3, 4]))\n assert_equal([-4, -2, -6, -5, -3], candidate.call([-2, -3, -4, -5, -6]))\n assert_equal([0, 1, 2, 4, 3], candidate.call([1, 0, 2, 3, 4]))\n assert_equal([], candidate.call([]))\n assert_equal([2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77], candidate.call([2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]))\n assert_equal([32, 3, 5, 6, 12, 44], candidate.call([3, 6, 44, 12, 32, 5]))\n assert_equal([2, 4, 8, 16, 32], candidate.call([2, 4, 8, 16, 32]))\n assert_equal([2, 4, 8, 16, 32], candidate.call([2, 4, 8, 16, 32]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "rb", - "prompt": "# Given a list of strings, where each string consists of only digits, return a list.\n# Each element i of the output should be \"the number of odd elements in the\n# string i of the input.\" where all the i's should be replaced by the number\n# of odd digits in the i'th string of the input.\ndef odd_count(lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_odd_count\n candidate = method(:odd_count)\n assert_equal([\"the number of odd elements 4n the str4ng 4 of the 4nput.\"], candidate.call([\"1234567\"]))\n assert_equal([\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\"], candidate.call([\"3\", \"11111111\"]))\n assert_equal([\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"], candidate.call([\"271\", \"137\", \"314\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "rb", - "prompt": "# brackets is a string of \"(\" and \")\".\n# return True if every opening bracket has a corresponding closing bracket.\ndef correct_bracketing(brackets)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_correct_bracketing\n candidate = method(:correct_bracketing)\n assert_equal(true, candidate.call(\"()\"))\n assert_equal(true, candidate.call(\"(()())\"))\n assert_equal(true, candidate.call(\"()()(()())()\"))\n assert_equal(true, candidate.call(\"()()((()()())())(()()(()))\"))\n assert_equal(false, candidate.call(\"((()())))\"))\n assert_equal(false, candidate.call(\")(()\"))\n assert_equal(false, candidate.call(\"(\"))\n assert_equal(false, candidate.call(\"((((\"))\n assert_equal(false, candidate.call(\")\"))\n assert_equal(false, candidate.call(\"(()\"))\n assert_equal(false, candidate.call(\"()()(()())())(()\"))\n assert_equal(false, candidate.call(\"()()(()())()))()\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "rb", - "prompt": "# Task\n# Write a function that takes a string as input and returns the sum of the upper characters only'\n# ASCII codes.\n# Examples:\ndef digitSum(s)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_digitSum\n candidate = method(:digitSum)\n assert_equal(0, candidate.call(\"\"))\n assert_equal(131, candidate.call(\"abAB\"))\n assert_equal(67, candidate.call(\"abcCd\"))\n assert_equal(69, candidate.call(\"helloE\"))\n assert_equal(131, candidate.call(\"woArBld\"))\n assert_equal(153, candidate.call(\"aAaaaXa\"))\n assert_equal(151, candidate.call(\" How are yOu?\"))\n assert_equal(327, candidate.call(\"You arE Very Smart\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "rb", - "prompt": "# Write a function that accepts a list of strings as a parameter,\n# deletes the strings that have odd lengths from it,\n# and returns the resulted list with a sorted order,\n# The list is always a list of strings and never an array of numbers,\n# and it may contain duplicates.\n# The order of the list should be ascending by length of each word, and you\n# should return the list sorted by that rule.\n# If two words have the same length, sort the list alphabetically.\n# The function should return a list of strings in sorted order.\n# You may assume that all words will have the same length.\n# For example:\ndef sorted_list_sum(lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sorted_list_sum\n candidate = method(:sorted_list_sum)\n assert_equal([\"aa\"], candidate.call([\"aa\", \"a\", \"aaa\"]))\n assert_equal([\"AI\", \"asdf\", \"school\"], candidate.call([\"school\", \"AI\", \"asdf\", \"b\"]))\n assert_equal([], candidate.call([\"d\", \"b\", \"c\", \"a\"]))\n assert_equal([\"abcd\", \"dcba\"], candidate.call([\"d\", \"dcba\", \"abcd\", \"a\"]))\n assert_equal([\"AI\", \"ai\", \"au\"], candidate.call([\"AI\", \"ai\", \"au\"]))\n assert_equal([], candidate.call([\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"]))\n assert_equal([\"cc\", \"dd\", \"aaaa\", \"bbbb\"], candidate.call([\"aaaa\", \"bbbb\", \"dd\", \"cc\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "rb", - "prompt": "# You are given an array arr of integers and you need to return\n# sum of magnitudes of integers multiplied by product of all signs\n# of each number in the array, represented by 1, -1 or 0.\n# Note: return None for empty arr.\n# Example:\ndef prod_signs(arr)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_prod_signs\n candidate = method(:prod_signs)\n assert_equal(-9, candidate.call([1, 2, 2, -4]))\n assert_equal(0, candidate.call([0, 1]))\n assert_equal(-10, candidate.call([1, 1, 1, 2, 3, -1, 1]))\n assert_equal(nil, candidate.call([]))\n assert_equal(20, candidate.call([2, 4, 1, 2, -1, -1, 9]))\n assert_equal(4, candidate.call([-1, 1, -1, 1]))\n assert_equal(-4, candidate.call([-1, 1, 1, 1]))\n assert_equal(0, candidate.call([-1, 1, 1, 0]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "rb", - "prompt": "# Return list with elements incremented by 1.\ndef incr_list(l)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_incr_list\n candidate = method(:incr_list)\n assert_equal([], candidate.call([]))\n assert_equal([4, 3, 2], candidate.call([3, 2, 1]))\n assert_equal([6, 3, 6, 3, 4, 4, 10, 1, 124], candidate.call([5, 2, 5, 2, 3, 3, 9, 0, 123]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "rb", - "prompt": "# From a given list of integers, generate a list of rolling maximum element found until given moment\n# in the sequence.\ndef rolling_max(numbers)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_rolling_max\n candidate = method(:rolling_max)\n assert_equal([], candidate.call([]))\n assert_equal([1, 2, 3, 4], candidate.call([1, 2, 3, 4]))\n assert_equal([4, 4, 4, 4], candidate.call([4, 3, 2, 1]))\n assert_equal([3, 3, 3, 100, 100], candidate.call([3, 2, 3, 100, 3]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "rb", - "prompt": "# Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n# separate those group into separate strings and return the list of those.\n# Separate groups are balanced (each open brace is properly closed) and not nested within each other\n# Ignore any spaces in the input string.\ndef separate_paren_groups(paren_string)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_separate_paren_groups\n candidate = method(:separate_paren_groups)\n assert_equal([\"(()())\", \"((()))\", \"()\", \"((())()())\"], candidate.call(\"(()()) ((())) () ((())()())\"))\n assert_equal([\"()\", \"(())\", \"((()))\", \"(((())))\"], candidate.call(\"() (()) ((())) (((())))\"))\n assert_equal([\"(()(())((())))\"], candidate.call(\"(()(())((())))\"))\n assert_equal([\"()\", \"(())\", \"(()())\"], candidate.call(\"( ) (( )) (( )( ))\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "rb", - "prompt": "# You will be given a string of words separated by commas or spaces. Your task is\n# to split the string into words and return an array of the words.\n# For example:\ndef words_string(s)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_words_string\n candidate = method(:words_string)\n assert_equal([\"Hi\", \"my\", \"name\", \"is\", \"John\"], candidate.call(\"Hi, my name is John\"))\n assert_equal([\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"], candidate.call(\"One, two, three, four, five, six\"))\n assert_equal([\"Hi\", \"my\", \"name\"], candidate.call(\"Hi, my name\"))\n assert_equal([\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"], candidate.call(\"One,, two, three, four, five, six,\"))\n assert_equal([], candidate.call(\"\"))\n assert_equal([\"ahmed\", \"gamal\"], candidate.call(\"ahmed , gamal\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "rb", - "prompt": "# Create a function that takes integers, floats, or strings representing\n# real numbers, and returns the larger variable in its given variable type.\n# Return None if the values are equal.\n# Note: If a real number is represented as a string, the floating point might be . or ,\ndef compare_one(a, b)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_compare_one\n candidate = method(:compare_one)\n assert_equal(2, candidate.call(1, 2))\n assert_equal(2.5, candidate.call(1, 2.5))\n assert_equal(3, candidate.call(2, 3))\n assert_equal(6, candidate.call(5, 6))\n assert_equal(\"2,3\", candidate.call(1, \"2,3\"))\n assert_equal(\"6\", candidate.call(\"5,1\", \"6\"))\n assert_equal(\"2\", candidate.call(\"1\", \"2\"))\n assert_equal(nil, candidate.call(\"1\", 1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "rb", - "prompt": "# Filter given list of any python values only for integers\ndef filter_integers(values)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_filter_integers\n candidate = method(:filter_integers)\n assert_equal([], candidate.call([]))\n assert_equal([4, 9], candidate.call([4, {}, [], 23.2, 9, \"adasd\"]))\n assert_equal([3, 3, 3], candidate.call([3, \"c\", 3, 3, \"a\", \"b\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "rb", - "prompt": "# This function takes a list l and returns a list l' such that\n# l' is identical to l in the odd indicies, while its values at the even indicies are equal\n# to the values of the even indicies of l, but sorted.\ndef sort_even(l)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sort_even\n candidate = method(:sort_even)\n assert_equal([1, 2, 3], candidate.call([1, 2, 3]))\n assert_equal([-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123], candidate.call([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]))\n assert_equal([-12, 8, 3, 4, 5, 2, 12, 11, 23, -10], candidate.call([5, 8, -12, 4, 23, 2, 3, 11, 12, -10]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "rb", - "prompt": "# I think we all remember that feeling when the result of some long-awaited\n# event is finally known. The feelings and thoughts you have at that moment are\n# definitely worth noting down and comparing.\n# Your task is to determine if a person correctly guessed the results of a number of matches.\n# You are given two arrays of scores and guesses of equal length, where each index shows a match. \n# Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n# the value is 0, and if not, the value is the absolute difference between the guess and the score.\n# example:\ndef compare(game, guess)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_compare\n candidate = method(:compare)\n assert_equal([0, 0, 0, 0, 3, 3], candidate.call([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2]))\n assert_equal([0, 0, 0, 0, 0, 0], candidate.call([0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]))\n assert_equal([2, 4, 6], candidate.call([1, 2, 3], [-1, -2, -3]))\n assert_equal([2, 0, 0, 1], candidate.call([1, 2, 3, 5], [-1, 2, 3, 4]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "rb", - "prompt": "# Given a positive integer n, return a tuple that has the number of even and odd\n# integer palindromes that fall within the range(1, n), inclusive.\n# Example 1:\n# Explanation:\n# Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n# Example 2:\n# Explanation:\n# Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n# Note:\n# 1. 1 <= n <= 10^3\n# 2. returned tuple has the number of even and odd integer palindromes respectively.\ndef even_odd_palindrome(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_even_odd_palindrome\n candidate = method(:even_odd_palindrome)\n assert_equal([8, 13], candidate.call(123))\n assert_equal([4, 6], candidate.call(12))\n assert_equal([1, 2], candidate.call(3))\n assert_equal([6, 8], candidate.call(63))\n assert_equal([5, 6], candidate.call(25))\n assert_equal([4, 6], candidate.call(19))\n assert_equal([4, 5], candidate.call(9))\n assert_equal([0, 1], candidate.call(1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "rb", - "prompt": "# The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fib4(0) -> 0\n# fib4(1) -> 0\n# fib4(2) -> 2\n# fib4(3) -> 0\n# fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n# Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\ndef fib4(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_fib4\n candidate = method(:fib4)\n assert_equal(4, candidate.call(5))\n assert_equal(28, candidate.call(8))\n assert_equal(104, candidate.call(10))\n assert_equal(386, candidate.call(12))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "rb", - "prompt": "# Given two positive integers a and b, return the even digits between a\n# and b, in ascending order.\n# For example:\ndef generate_integers(a, b)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_generate_integers\n candidate = method(:generate_integers)\n assert_equal([2, 4, 6, 8], candidate.call(2, 10))\n assert_equal([2, 4, 6, 8], candidate.call(10, 2))\n assert_equal([2, 4, 6, 8], candidate.call(132, 2))\n assert_equal([], candidate.call(17, 89))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "rb", - "prompt": "# For a given list of input numbers, calculate Mean Absolute Deviation\n# around the mean of this dataset.\n# Mean Absolute Deviation is the average absolute difference between each\n# element and a centerpoint (mean in this case):\n# MAD = average | x - x_mean |\ndef mean_absolute_deviation(numbers)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_mean_absolute_deviation\n candidate = method(:mean_absolute_deviation)\n assert_equal(0.5, candidate.call([1.0, 2.0]))\n assert_equal(1.0, candidate.call([1.0, 2.0, 3.0, 4.0]))\n assert_equal(1.2, candidate.call([1.0, 2.0, 3.0, 4.0, 5.0]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "rb", - "prompt": "# Create a function encrypt that takes a string as an argument and\n# returns a string encrypted with the alphabet being rotated. \n# The alphabet should be rotated in a manner such that the letters \n# shift down by two multiplied to two places.\n# For example:\ndef encrypt(s)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_encrypt\n candidate = method(:encrypt)\n assert_equal(\"lm\", candidate.call(\"hi\"))\n assert_equal(\"ewhjklnop\", candidate.call(\"asdfghjkl\"))\n assert_equal(\"kj\", candidate.call(\"gf\"))\n assert_equal(\"ix\", candidate.call(\"et\"))\n assert_equal(\"jeiajeaijeiak\", candidate.call(\"faewfawefaewg\"))\n assert_equal(\"lippsqcjvmirh\", candidate.call(\"hellomyfriend\"))\n assert_equal(\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\", candidate.call(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\"))\n assert_equal(\"e\", candidate.call(\"a\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "rb", - "prompt": "# Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n# The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n# as follows: start with any positive integer n. Then each term is obtained from the \n# previous term as follows: if the previous term is even, the next term is one half of \n# the previous term. If the previous term is odd, the next term is 3 times the previous\n# term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n# Note: \n# 1. Collatz(1) is [1].\n# 2. returned list sorted in increasing order.\n# For example:\n# get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\ndef get_odd_collatz(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_get_odd_collatz\n candidate = method(:get_odd_collatz)\n assert_equal([1, 5, 7, 11, 13, 17], candidate.call(14))\n assert_equal([1, 5], candidate.call(5))\n assert_equal([1, 3, 5], candidate.call(12))\n assert_equal([1], candidate.call(1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "rb", - "prompt": "# Find how many times a given substring can be found in the original string. Count overlaping cases.\ndef how_many_times(string, substring)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_how_many_times\n candidate = method(:how_many_times)\n assert_equal(0, candidate.call(\"\", \"x\"))\n assert_equal(4, candidate.call(\"xyxyxyx\", \"x\"))\n assert_equal(4, candidate.call(\"cacacacac\", \"cac\"))\n assert_equal(1, candidate.call(\"john doe\", \"john\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "rb", - "prompt": "# We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n# numbers in the array will be randomly ordered. Your task is to determine if\n# it is possible to get an array sorted in non-decreasing order by performing \n# the following operation on the given array:\n# You are allowed to perform right shift operation any number of times.\n# One right shift operation means shifting all elements of the array by one\n# position in the right direction. The last element of the array will be moved to\n# the starting position in the array i.e. 0th index. \n# If it is possible to obtain the sorted array by performing the above operation\n# then return True else return False.\n# If the given array is empty then return True.\n# Note: The given list is guaranteed to have unique elements.\n# For Example:\n# Explanation: By performin 2 right shift operations, non-decreasing order can\n# be achieved for the given array.\n# Explanation:It is not possible to get non-decreasing order for the given\n# array by performing any number of right shift operations.\ndef move_one_ball(arr)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_move_one_ball\n candidate = method(:move_one_ball)\n assert_equal(true, candidate.call([3, 4, 5, 1, 2]))\n assert_equal(true, candidate.call([3, 5, 10, 1, 2]))\n assert_equal(false, candidate.call([4, 3, 1, 2]))\n assert_equal(false, candidate.call([3, 5, 4, 1, 2]))\n assert_equal(true, candidate.call([]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "rb", - "prompt": "# Write a function which sorts the given list of integers\n# in ascending order according to the sum of their digits.\n# Note: if there are several items with similar sum of their digits,\n# order them based on their index in original list.\n# For example:\ndef order_by_points(nums)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_order_by_points\n candidate = method(:order_by_points)\n assert_equal([-1, -11, 1, -12, 11], candidate.call([1, 11, -1, -11, -12]))\n assert_equal([0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457], candidate.call([1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]))\n assert_equal([], candidate.call([]))\n assert_equal([-3, -32, -98, -11, 1, 2, 43, 54], candidate.call([1, -11, -32, 43, 54, -98, 2, -3]))\n assert_equal([1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9], candidate.call([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]))\n assert_equal([-76, -21, 0, 4, 23, 6, 6], candidate.call([0, 6, 6, -76, -21, 23, 4]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "rb", - "prompt": "# Return list of prime factors of given integer in the order from smallest to largest.\n# Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n# Input number should be equal to the product of all factors\ndef factorize(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_factorize\n candidate = method(:factorize)\n assert_equal([2], candidate.call(2))\n assert_equal([2, 2], candidate.call(4))\n assert_equal([2, 2, 2], candidate.call(8))\n assert_equal([3, 19], candidate.call(57))\n assert_equal([3, 3, 19, 19], candidate.call(3249))\n assert_equal([3, 3, 3, 19, 19, 19], candidate.call(185193))\n assert_equal([3, 19, 19, 19], candidate.call(20577))\n assert_equal([2, 3, 3], candidate.call(18))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "rb", - "prompt": "# Return True if all numbers in the list l are below threshold t.\ndef below_threshold(l, t)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_below_threshold\n candidate = method(:below_threshold)\n assert_equal(true, candidate.call([1, 2, 4, 10], 100))\n assert_equal(false, candidate.call([1, 20, 4, 10], 5))\n assert_equal(true, candidate.call([1, 20, 4, 10], 21))\n assert_equal(true, candidate.call([1, 20, 4, 10], 22))\n assert_equal(true, candidate.call([1, 8, 4, 10], 11))\n assert_equal(false, candidate.call([1, 8, 4, 10], 10))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "rb", - "prompt": "# You are given two positive integers n and m, and your task is to compute the\n# average of the integers from n through m (including n and m). \n# Round the answer to the nearest integer and convert that to binary.\n# If n is greater than m, return -1.\n# Example:\ndef rounded_avg(n, m)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_rounded_avg\n candidate = method(:rounded_avg)\n assert_equal(\"0b11\", candidate.call(1, 5))\n assert_equal(\"0b1010\", candidate.call(7, 13))\n assert_equal(\"0b1111001010\", candidate.call(964, 977))\n assert_equal(\"0b1111100100\", candidate.call(996, 997))\n assert_equal(\"0b1011000010\", candidate.call(560, 851))\n assert_equal(\"0b101101110\", candidate.call(185, 546))\n assert_equal(\"0b110101101\", candidate.call(362, 496))\n assert_equal(\"0b1001110010\", candidate.call(350, 902))\n assert_equal(\"0b11010111\", candidate.call(197, 233))\n assert_equal(-1, candidate.call(7, 5))\n assert_equal(-1, candidate.call(5, 1))\n assert_equal(\"0b101\", candidate.call(5, 5))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "rb", - "prompt": "# Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n# For each of the group, output the deepest level of nesting of parentheses.\n# E.g. (()()) has maximum two levels of nesting while ((())) has three.\ndef parse_nested_parens(paren_string)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_parse_nested_parens\n candidate = method(:parse_nested_parens)\n assert_equal([2, 3, 1, 3], candidate.call(\"(()()) ((())) () ((())()())\"))\n assert_equal([1, 2, 3, 4], candidate.call(\"() (()) ((())) (((())))\"))\n assert_equal([4], candidate.call(\"(()(())((())))\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "rb", - "prompt": "# Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n# Examples\ndef solution(lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_solution\n candidate = method(:solution)\n assert_equal(12, candidate.call([5, 8, 7, 1]))\n assert_equal(9, candidate.call([3, 3, 3, 3, 3]))\n assert_equal(0, candidate.call([30, 13, 24, 321]))\n assert_equal(5, candidate.call([5, 9]))\n assert_equal(0, candidate.call([2, 4, 8]))\n assert_equal(23, candidate.call([30, 13, 23, 32]))\n assert_equal(3, candidate.call([3, 13, 2, 9]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "rb", - "prompt": "# You are given a positive integer n. You have to create an integer array a of length n.\n# For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n# Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n# and a[i] + a[j] + a[k] is a multiple of 3.\n# Example :\n# Explanation: \n# a = [1, 3, 7, 13, 21]\n# The only valid triple is (1, 7, 13).\ndef get_max_triples(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_get_max_triples\n candidate = method(:get_max_triples)\n assert_equal(1, candidate.call(5))\n assert_equal(4, candidate.call(6))\n assert_equal(36, candidate.call(10))\n assert_equal(53361, candidate.call(100))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "rb", - "prompt": "# There are eight planets in our solar system: the closerst to the Sun \n# is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n# Uranus, Neptune.\n# Write a function that takes two planet names as strings planet1 and planet2. \n# The function should return a tuple containing all planets whose orbits are \n# located between the orbit of planet1 and the orbit of planet2, sorted by \n# the proximity to the sun. \n# The function should return an empty tuple if planet1 or planet2\n# are not correct planet names. \n# Examples\ndef bf(planet1, planet2)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_bf\n candidate = method(:bf)\n assert_equal([\"Saturn\", \"Uranus\"], candidate.call(\"Jupiter\", \"Neptune\"))\n assert_equal([\"Venus\"], candidate.call(\"Earth\", \"Mercury\"))\n assert_equal([\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"], candidate.call(\"Mercury\", \"Uranus\"))\n assert_equal([\"Earth\", \"Mars\", \"Jupiter\", \"Saturn\", \"Uranus\"], candidate.call(\"Neptune\", \"Venus\"))\n assert_equal([], candidate.call(\"Earth\", \"Earth\"))\n assert_equal([], candidate.call(\"Mars\", \"Earth\"))\n assert_equal([], candidate.call(\"Jupiter\", \"Makemake\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "rb", - "prompt": "# You are given a list of integers.\n# Write a function next_smallest() that returns the 2nd smallest element of the list.\n# Return None if there is no such element.\ndef next_smallest(lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_next_smallest\n candidate = method(:next_smallest)\n assert_equal(2, candidate.call([1, 2, 3, 4, 5]))\n assert_equal(2, candidate.call([5, 1, 4, 3, 2]))\n assert_equal(nil, candidate.call([]))\n assert_equal(nil, candidate.call([1, 1]))\n assert_equal(1, candidate.call([1, 1, 1, 1, 0]))\n assert_equal(nil, candidate.call([1, 1]))\n assert_equal(-35, candidate.call([-35, 34, 12, -45]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "rb", - "prompt": "# Input is a space-delimited string of numberals from 'zero' to 'nine'.\n# Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n# Return the string with numbers sorted from smallest to largest\ndef sort_numbers(numbers)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sort_numbers\n candidate = method(:sort_numbers)\n assert_equal(\"\", candidate.call(\"\"))\n assert_equal(\"three\", candidate.call(\"three\"))\n assert_equal(\"three five nine\", candidate.call(\"three five nine\"))\n assert_equal(\"zero four five seven eight nine\", candidate.call(\"five zero four seven nine eight\"))\n assert_equal(\"zero one two three four five six\", candidate.call(\"six five four three two one zero\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "rb", - "prompt": "# You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\ndef cycpattern_check(a, b)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_cycpattern_check\n candidate = method(:cycpattern_check)\n assert_equal(false, candidate.call(\"xyzw\", \"xyw\"))\n assert_equal(true, candidate.call(\"yello\", \"ell\"))\n assert_equal(false, candidate.call(\"whattup\", \"ptut\"))\n assert_equal(true, candidate.call(\"efef\", \"fee\"))\n assert_equal(false, candidate.call(\"abab\", \"aabb\"))\n assert_equal(true, candidate.call(\"winemtt\", \"tinem\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "rb", - "prompt": "# You will be given a number in decimal form and your task is to convert it to\n# binary format. The function should return a string, with each character representing a binary\n# number. Each character in the string will be '0' or '1'.\n# There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n# The extra characters are there to help with the format.\n# Examples:\ndef decimal_to_binary(decimal)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_decimal_to_binary\n candidate = method(:decimal_to_binary)\n assert_equal(\"db0db\", candidate.call(0))\n assert_equal(\"db100000db\", candidate.call(32))\n assert_equal(\"db1100111db\", candidate.call(103))\n assert_equal(\"db1111db\", candidate.call(15))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "rb", - "prompt": "# Filter an input list of strings only for ones that contain given substring\ndef filter_by_substring(strings, substring)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_filter_by_substring\n candidate = method(:filter_by_substring)\n assert_equal([], candidate.call([], \"john\"))\n assert_equal([\"xxx\", \"xxxAAA\", \"xxx\"], candidate.call([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"))\n assert_equal([\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"], candidate.call([\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xx\"))\n assert_equal([\"grunt\", \"prune\"], candidate.call([\"grunt\", \"trumpet\", \"prune\", \"gruesome\"], \"run\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "rb", - "prompt": "# Given an integer. return a tuple that has the number of even and odd digits respectively.\n# Example:\ndef even_odd_count(num)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_even_odd_count\n candidate = method(:even_odd_count)\n assert_equal([0, 1], candidate.call(7))\n assert_equal([1, 1], candidate.call(-78))\n assert_equal([2, 2], candidate.call(3452))\n assert_equal([3, 3], candidate.call(346211))\n assert_equal([3, 3], candidate.call(-345821))\n assert_equal([1, 0], candidate.call(-2))\n assert_equal([2, 3], candidate.call(-45347))\n assert_equal([1, 0], candidate.call(0))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "rb", - "prompt": "# Write a function that accepts a list of strings.\n# The list contains different words. Return the word with maximum number\n# of unique characters. If multiple strings have maximum number of unique\n# characters, return the one which comes first in lexicographical order.\ndef find_max(words)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_find_max\n candidate = method(:find_max)\n assert_equal(\"string\", candidate.call([\"name\", \"of\", \"string\"]))\n assert_equal(\"enam\", candidate.call([\"name\", \"enam\", \"game\"]))\n assert_equal(\"aaaaaaa\", candidate.call([\"aaaaaaa\", \"bb\", \"cc\"]))\n assert_equal(\"abc\", candidate.call([\"abc\", \"cba\"]))\n assert_equal(\"footbott\", candidate.call([\"play\", \"this\", \"game\", \"of\", \"footbott\"]))\n assert_equal(\"gonna\", candidate.call([\"we\", \"are\", \"gonna\", \"rock\"]))\n assert_equal(\"nation\", candidate.call([\"we\", \"are\", \"a\", \"mad\", \"nation\"]))\n assert_equal(\"this\", candidate.call([\"this\", \"is\", \"a\", \"prrk\"]))\n assert_equal(\"b\", candidate.call([\"b\"]))\n assert_equal(\"play\", candidate.call([\"play\", \"play\", \"play\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "rb", - "prompt": "# Create a function that returns a tuple (a, b), where 'a' is\n# the largest of negative integers, and 'b' is the smallest\n# of positive integers in a list.\n# If there is no negative or positive integers, return them as None.\n# Examples:\ndef largest_smallest_integers(lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_largest_smallest_integers\n candidate = method(:largest_smallest_integers)\n assert_equal([nil, 1], candidate.call([2, 4, 1, 3, 5, 7]))\n assert_equal([nil, 1], candidate.call([2, 4, 1, 3, 5, 7, 0]))\n assert_equal([-2, 1], candidate.call([1, 3, 2, 4, 5, 6, -2]))\n assert_equal([-7, 2], candidate.call([4, 5, 3, 6, 2, 7, -7]))\n assert_equal([-9, 2], candidate.call([7, 3, 8, 4, 9, 2, 5, -9]))\n assert_equal([nil, nil], candidate.call([]))\n assert_equal([nil, nil], candidate.call([0]))\n assert_equal([-1, nil], candidate.call([-1, -3, -5, -6]))\n assert_equal([-1, nil], candidate.call([-1, -3, -5, -6, 0]))\n assert_equal([-3, 1], candidate.call([-6, -4, -4, -3, 1]))\n assert_equal([-3, 1], candidate.call([-6, -4, -4, -3, -100, 1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "rb", - "prompt": "# \"Given an array representing a branch of a tree that has non-negative integer nodes\n# your task is to pluck one of the nodes and return it.\n# The plucked node should be the node with the smallest even value.\n# If multiple nodes with the same smallest even value are found return the node that has smallest index.\n# The plucked node should be returned in a list, [ smalest_value, its index ],\n# If there are no even values or the given array is empty, return [].\n# Example 1:\n# Explanation: 2 has the smallest even value, and 2 has the smallest index.\n# Example 2:\n# Explanation: 2 has the smallest even value, and 2 has the smallest index.\n# Example 3:\n# Example 4:\n# Explanation: 0 is the smallest value, but there are two zeros,\n# so we will choose the first zero, which has the smallest index.\n# Constraints:\n# * 1 <= nodes.length <= 10000\n# * 0 <= node.value\ndef pluck(arr)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_pluck\n candidate = method(:pluck)\n assert_equal([2, 1], candidate.call([4, 2, 3]))\n assert_equal([2, 1], candidate.call([1, 2, 3]))\n assert_equal([], candidate.call([]))\n assert_equal([0, 1], candidate.call([5, 0, 3, 0, 4, 2]))\n assert_equal([0, 3], candidate.call([1, 2, 3, 0, 5, 3]))\n assert_equal([4, 1], candidate.call([5, 4, 8, 4, 8]))\n assert_equal([6, 1], candidate.call([7, 6, 7, 1]))\n assert_equal([], candidate.call([7, 9, 7, 1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "rb", - "prompt": "# Write a function count_nums which takes an array of integers and returns\n# the number of elements which has a sum of digits > 0.\n# If a number is negative, then its first signed digit will be negative:\n# e.g. -123 has signed digits -1, 2, and 3.\ndef count_nums(arr)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_count_nums\n candidate = method(:count_nums)\n assert_equal(0, candidate.call([]))\n assert_equal(0, candidate.call([-1, -2, 0]))\n assert_equal(6, candidate.call([1, 1, 2, -2, 3, 4, 5]))\n assert_equal(5, candidate.call([1, 6, 9, -6, 0, 1, 5]))\n assert_equal(4, candidate.call([1, 100, 98, -7, 1, -1]))\n assert_equal(5, candidate.call([12, 23, 34, -45, -56, 0]))\n assert_equal(1, candidate.call([0, 1]))\n assert_equal(1, candidate.call([1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "rb", - "prompt": "# Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n# each cell of the grid contains a value. Every integer in the range [1, N * N]\n# inclusive appears exactly once on the cells of the grid.\n# You have to find the minimum path of length k in the grid. You can start\n# from any cell, and in each step you can move to any of the neighbor cells,\n# in other words, you can go to cells which share an edge with you current\n# cell.\n# Please note that a path of length k means visiting exactly k cells (not\n# necessarily distinct).\n# You CANNOT go off the grid.\n# A path A (of length k) is considered less than a path B (of length k) if\n# after making the ordered lists of the values on the cells that A and B go\n# through (let's call them lst_A and lst_B), lst_A is lexicographically less\n# than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n# such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n# lst_A[j] = lst_B[j].\n# It is guaranteed that the answer is unique.\n# Return an ordered list of the values on the cells that the minimum path go through.\n# Examples:\ndef minPath(grid, k)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_minPath\n candidate = method(:minPath)\n assert_equal([1, 2, 1], candidate.call([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3))\n assert_equal([1], candidate.call([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1))\n assert_equal([1, 2, 1, 2], candidate.call([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], 4))\n assert_equal([1, 10, 1, 10, 1, 10, 1], candidate.call([[6, 4, 13, 10], [5, 7, 12, 1], [3, 16, 11, 15], [8, 14, 9, 2]], 7))\n assert_equal([1, 7, 1, 7, 1], candidate.call([[8, 14, 9, 2], [6, 4, 13, 15], [5, 7, 1, 12], [3, 10, 11, 16]], 5))\n assert_equal([1, 6, 1, 6, 1, 6, 1, 6, 1], candidate.call([[11, 8, 7, 2], [5, 16, 14, 4], [9, 3, 15, 6], [12, 13, 10, 1]], 9))\n assert_equal([1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6], candidate.call([[12, 13, 10, 1], [9, 3, 15, 6], [5, 16, 14, 4], [11, 8, 7, 2]], 12))\n assert_equal([1, 3, 1, 3, 1, 3, 1, 3], candidate.call([[2, 7, 4], [3, 1, 5], [6, 8, 9]], 8))\n assert_equal([1, 5, 1, 5, 1, 5, 1, 5], candidate.call([[6, 1, 5], [3, 8, 9], [2, 7, 4]], 8))\n assert_equal([1, 2, 1, 2, 1, 2, 1, 2, 1, 2], candidate.call([[1, 2], [3, 4]], 10))\n assert_equal([1, 3, 1, 3, 1, 3, 1, 3, 1, 3], candidate.call([[1, 3], [3, 2]], 10))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "rb", - "prompt": "# Given list of integers, return list in strange order.\n# Strange sorting, is when you start with the minimum value,\n# then maximum of the remaining integers, then minimum and so on.\n# Examples:\ndef strange_sort_list(lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_strange_sort_list\n candidate = method(:strange_sort_list)\n assert_equal([1, 4, 2, 3], candidate.call([1, 2, 3, 4]))\n assert_equal([5, 9, 6, 8, 7], candidate.call([5, 6, 7, 8, 9]))\n assert_equal([1, 5, 2, 4, 3], candidate.call([1, 2, 3, 4, 5]))\n assert_equal([1, 9, 5, 8, 6, 7], candidate.call([5, 6, 7, 8, 9, 1]))\n assert_equal([5, 5, 5, 5], candidate.call([5, 5, 5, 5]))\n assert_equal([], candidate.call([]))\n assert_equal([1, 8, 2, 7, 3, 6, 4, 5], candidate.call([1, 2, 3, 4, 5, 6, 7, 8]))\n assert_equal([-5, 5, -5, 5, 0, 2, 2, 2], candidate.call([0, 2, 2, 2, 5, 5, -5, -5]))\n assert_equal([111111], candidate.call([111111]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "rb", - "prompt": "# Given a string 'text', return its md5 hash equivalent string.\n# If 'text' is an empty string, return None.\ndef string_to_md5(text)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_string_to_md5\n candidate = method(:string_to_md5)\n assert_equal(\"3e25960a79dbc69b674cd4ec67a72c62\", candidate.call(\"Hello world\"))\n assert_equal(nil, candidate.call(\"\"))\n assert_equal(\"0ef78513b0cb8cef12743f5aeb35f888\", candidate.call(\"A B C\"))\n assert_equal(\"5f4dcc3b5aa765d61d8327deb882cf99\", candidate.call(\"password\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "rb", - "prompt": "# You are given a word. Your task is to find the closest vowel that stands between \n# two consonants from the right side of the word (case sensitive).\n# Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n# find any vowel met the above condition. \n# You may assume that the given string contains English letter only.\n# Example:\ndef get_closest_vowel(word)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_get_closest_vowel\n candidate = method(:get_closest_vowel)\n assert_equal(\"u\", candidate.call(\"yogurt\"))\n assert_equal(\"u\", candidate.call(\"full\"))\n assert_equal(\"\", candidate.call(\"easy\"))\n assert_equal(\"\", candidate.call(\"eAsy\"))\n assert_equal(\"\", candidate.call(\"ali\"))\n assert_equal(\"a\", candidate.call(\"bad\"))\n assert_equal(\"o\", candidate.call(\"most\"))\n assert_equal(\"\", candidate.call(\"ab\"))\n assert_equal(\"\", candidate.call(\"ba\"))\n assert_equal(\"\", candidate.call(\"quick\"))\n assert_equal(\"i\", candidate.call(\"anime\"))\n assert_equal(\"\", candidate.call(\"Asia\"))\n assert_equal(\"o\", candidate.call(\"Above\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "rb", - "prompt": "# Change numerical base of input number x to base.\n# return string representation after the conversion.\n# base numbers are less than 10.\ndef change_base(x, base)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_change_base\n candidate = method(:change_base)\n assert_equal(\"22\", candidate.call(8, 3))\n assert_equal(\"100\", candidate.call(9, 3))\n assert_equal(\"11101010\", candidate.call(234, 2))\n assert_equal(\"10000\", candidate.call(16, 2))\n assert_equal(\"1000\", candidate.call(8, 2))\n assert_equal(\"111\", candidate.call(7, 2))\n assert_equal(\"2\", candidate.call(2, 3))\n assert_equal(\"3\", candidate.call(3, 4))\n assert_equal(\"4\", candidate.call(4, 5))\n assert_equal(\"5\", candidate.call(5, 6))\n assert_equal(\"6\", candidate.call(6, 7))\n assert_equal(\"7\", candidate.call(7, 8))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "rb", - "prompt": "# Check if in given list of numbers, are any two numbers closer to each other than\n# given threshold.\ndef has_close_elements(numbers, threshold)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_has_close_elements\n candidate = method(:has_close_elements)\n assert_equal(true, candidate.call([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3))\n assert_equal(false, candidate.call([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05))\n assert_equal(true, candidate.call([1.0, 2.0, 5.9, 4.0, 5.0], 0.95))\n assert_equal(false, candidate.call([1.0, 2.0, 5.9, 4.0, 5.0], 0.8))\n assert_equal(true, candidate.call([1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1))\n assert_equal(true, candidate.call([1.1, 2.2, 3.1, 4.1, 5.1], 1.0))\n assert_equal(false, candidate.call([1.1, 2.2, 3.1, 4.1, 5.1], 0.5))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "rb", - "prompt": "# Create a function that takes a string as input which contains only square brackets.\n# The function should return True if and only if there is a valid subsequence of brackets \n# where at least one bracket in the subsequence is nested.\ndef is_nested(string)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_nested\n candidate = method(:is_nested)\n assert_equal(true, candidate.call(\"[[]]\"))\n assert_equal(false, candidate.call(\"[]]]]]]][[[[[]\"))\n assert_equal(false, candidate.call(\"[][]\"))\n assert_equal(false, candidate.call(\"[]\"))\n assert_equal(true, candidate.call(\"[[[[]]]]\"))\n assert_equal(false, candidate.call(\"[]]]]]]]]]]\"))\n assert_equal(true, candidate.call(\"[][][[]]\"))\n assert_equal(false, candidate.call(\"[[]\"))\n assert_equal(false, candidate.call(\"[]]\"))\n assert_equal(true, candidate.call(\"[[]][[\"))\n assert_equal(true, candidate.call(\"[[][]]\"))\n assert_equal(false, candidate.call(\"\"))\n assert_equal(false, candidate.call(\"[[[[[[[[\"))\n assert_equal(false, candidate.call(\"]]]]]]]]\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "rb", - "prompt": "# Concatenate list of strings into a single string\ndef concatenate(strings)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_concatenate\n candidate = method(:concatenate)\n assert_equal(\"\", candidate.call([]))\n assert_equal(\"xyz\", candidate.call([\"x\", \"y\", \"z\"]))\n assert_equal(\"xyzwk\", candidate.call([\"x\", \"y\", \"z\", \"w\", \"k\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "rb", - "prompt": "# prime_fib returns n-th number that is a Fibonacci number and it's also prime.\ndef prime_fib(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_prime_fib\n candidate = method(:prime_fib)\n assert_equal(2, candidate.call(1))\n assert_equal(3, candidate.call(2))\n assert_equal(5, candidate.call(3))\n assert_equal(13, candidate.call(4))\n assert_equal(89, candidate.call(5))\n assert_equal(233, candidate.call(6))\n assert_equal(1597, candidate.call(7))\n assert_equal(28657, candidate.call(8))\n assert_equal(514229, candidate.call(9))\n assert_equal(433494437, candidate.call(10))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "rb", - "prompt": "# From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n# other and return them in order (smaller number, larger number).\ndef find_closest_elements(numbers)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_find_closest_elements\n candidate = method(:find_closest_elements)\n assert_equal([3.9, 4.0], candidate.call([1.0, 2.0, 3.9, 4.0, 5.0, 2.2]))\n assert_equal([5.0, 5.9], candidate.call([1.0, 2.0, 5.9, 4.0, 5.0]))\n assert_equal([2.0, 2.2], candidate.call([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]))\n assert_equal([2.0, 2.0], candidate.call([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]))\n assert_equal([2.2, 3.1], candidate.call([1.1, 2.2, 3.1, 4.1, 5.1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "rb", - "prompt": "# You have been tasked to write a function that receives \n# a hexadecimal number as a string and counts the number of hexadecimal \n# digits that are primes (prime number, or a prime, is a natural number \n# greater than 1 that is not a product of two smaller natural numbers).\n# Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n# Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n# So you have to determine a number of the following digits: 2, 3, 5, 7, \n# B (=decimal 11), D (=decimal 13).\n# Note: you may assume the input is always correct or empty string, \n# and symbols A,B,C,D,E,F are always uppercase.\n# Examples:\ndef hex_key(num)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_hex_key\n candidate = method(:hex_key)\n assert_equal(1, candidate.call(\"AB\"))\n assert_equal(2, candidate.call(\"1077E\"))\n assert_equal(4, candidate.call(\"ABED1A33\"))\n assert_equal(2, candidate.call(\"2020\"))\n assert_equal(6, candidate.call(\"123456789ABCDEF0\"))\n assert_equal(12, candidate.call(\"112233445566778899AABBCCDDEEFF00\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "rb", - "prompt": "# Complete the function that takes two integers and returns \n# the product of their unit digits.\n# Assume the input is always valid.\n# Examples:\ndef multiply(a, b)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_multiply\n candidate = method(:multiply)\n assert_equal(16, candidate.call(148, 412))\n assert_equal(72, candidate.call(19, 28))\n assert_equal(0, candidate.call(2020, 1851))\n assert_equal(20, candidate.call(14, -15))\n assert_equal(42, candidate.call(76, 67))\n assert_equal(49, candidate.call(17, 27))\n assert_equal(0, candidate.call(0, 1))\n assert_equal(0, candidate.call(0, 0))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "rb", - "prompt": "# Given list of numbers (of at least two elements), apply a linear transform to that list,\n# such that the smallest number will become 0 and the largest will become 1\ndef rescale_to_unit(numbers)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_rescale_to_unit\n candidate = method(:rescale_to_unit)\n assert_equal([0.0, 1.0], candidate.call([2.0, 49.9]))\n assert_equal([1.0, 0.0], candidate.call([100.0, 49.9]))\n assert_equal([0.0, 0.25, 0.5, 0.75, 1.0], candidate.call([1.0, 2.0, 3.0, 4.0, 5.0]))\n assert_equal([0.25, 0.0, 1.0, 0.5, 0.75], candidate.call([2.0, 1.0, 5.0, 3.0, 4.0]))\n assert_equal([0.25, 0.0, 1.0, 0.5, 0.75], candidate.call([12.0, 11.0, 15.0, 13.0, 14.0]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "rb", - "prompt": "# Given a positive integer n, return the product of the odd digits.\n# Return 0 if all digits are even.\n# For example:\ndef digits(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_digits\n candidate = method(:digits)\n assert_equal(5, candidate.call(5))\n assert_equal(5, candidate.call(54))\n assert_equal(1, candidate.call(120))\n assert_equal(5, candidate.call(5014))\n assert_equal(315, candidate.call(98765))\n assert_equal(2625, candidate.call(5576543))\n assert_equal(0, candidate.call(2468))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "rb", - "prompt": "# You will be given the name of a class (a string) and a list of extensions.\n# The extensions are to be used to load additional classes to the class. The\n# strength of the extension is as follows: Let CAP be the number of the uppercase\n# letters in the extension's name, and let SM be the number of lowercase letters \n# in the extension's name, the strength is given by the fraction CAP - SM. \n# You should find the strongest extension and return a string in this \n# format: ClassName.StrongestExtensionName.\n# If there are two or more extensions with the same strength, you should\n# choose the one that comes first in the list.\n# For example, if you are given \"Slices\" as the class and a list of the\n# extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n# return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n# (its strength is -1).\n# Example:\ndef Strongest_Extension(class_name, extensions)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_Strongest_Extension\n candidate = method(:Strongest_Extension)\n assert_equal(\"Watashi.eIGHt8OKe\", candidate.call(\"Watashi\", [\"tEN\", \"niNE\", \"eIGHt8OKe\"]))\n assert_equal(\"Boku123.YEs.WeCaNe\", candidate.call(\"Boku123\", [\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"]))\n assert_equal(\"__YESIMHERE.NuLl__\", candidate.call(\"__YESIMHERE\", [\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"]))\n assert_equal(\"K.TAR\", candidate.call(\"K\", [\"Ta\", \"TAR\", \"t234An\", \"cosSo\"]))\n assert_equal(\"__HAHA.123\", candidate.call(\"__HAHA\", [\"Tab\", \"123\", \"781345\", \"-_-\"]))\n assert_equal(\"YameRore.okIWILL123\", candidate.call(\"YameRore\", [\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"]))\n assert_equal(\"finNNalLLly.WoW\", candidate.call(\"finNNalLLly\", [\"Die\", \"NowW\", \"Wow\", \"WoW\"]))\n assert_equal(\"_.Bb\", candidate.call(\"_\", [\"Bb\", \"91245\"]))\n assert_equal(\"Sp.671235\", candidate.call(\"Sp\", [\"671235\", \"Bb\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "rb", - "prompt": "# Given a string representing a space separated lowercase letters, return a dictionary\n# of the letter with the most repetition and containing the corresponding count.\n# If several letters have the same occurrence, return all of them.\n# Example:\ndef histogram(test)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_histogram\n candidate = method(:histogram)\n assert_equal({\"a\" => 2, \"b\" => 2}, candidate.call(\"a b b a\"))\n assert_equal({\"a\" => 2, \"b\" => 2}, candidate.call(\"a b c a b\"))\n assert_equal({\"a\" => 1, \"b\" => 1, \"c\" => 1, \"d\" => 1, \"g\" => 1}, candidate.call(\"a b c d g\"))\n assert_equal({\"r\" => 1, \"t\" => 1, \"g\" => 1}, candidate.call(\"r t g\"))\n assert_equal({\"b\" => 4}, candidate.call(\"b b b b a\"))\n assert_equal({\"r\" => 1, \"t\" => 1, \"g\" => 1}, candidate.call(\"r t g\"))\n assert_equal({}, candidate.call(\"\"))\n assert_equal({\"a\" => 1}, candidate.call(\"a\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "rb", - "prompt": "# pairs_sum_to_zero takes a list of integers as an input.\n# it returns True if there are two distinct elements in the list that\n# sum to zero, and False otherwise.\ndef pairs_sum_to_zero(l)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_pairs_sum_to_zero\n candidate = method(:pairs_sum_to_zero)\n assert_equal(false, candidate.call([1, 3, 5, 0]))\n assert_equal(false, candidate.call([1, 3, -2, 1]))\n assert_equal(false, candidate.call([1, 2, 3, 7]))\n assert_equal(true, candidate.call([2, 4, -5, 3, 5, 7]))\n assert_equal(false, candidate.call([1]))\n assert_equal(true, candidate.call([-3, 9, -1, 3, 2, 30]))\n assert_equal(true, candidate.call([-3, 9, -1, 3, 2, 31]))\n assert_equal(false, candidate.call([-3, 9, -1, 4, 2, 30]))\n assert_equal(false, candidate.call([-3, 9, -1, 4, 2, 31]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "rb", - "prompt": "# Write a function that accepts two lists of strings and returns the list that has \n# total number of chars in the all strings of the list less than the other list.\n# if the two lists have the same number of chars, return the first list.\n# Examples\ndef total_match(lst1, lst2)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_total_match\n candidate = method(:total_match)\n assert_equal([], candidate.call([], []))\n assert_equal([\"hi\", \"hi\"], candidate.call([\"hi\", \"admin\"], [\"hi\", \"hi\"]))\n assert_equal([\"hi\", \"admin\"], candidate.call([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"]))\n assert_equal([\"4\"], candidate.call([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"]))\n assert_equal([\"hI\", \"Hi\"], candidate.call([\"hi\", \"admin\"], [\"hI\", \"Hi\"]))\n assert_equal([\"hI\", \"hi\", \"hi\"], candidate.call([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"]))\n assert_equal([\"hi\", \"admin\"], candidate.call([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hii\"]))\n assert_equal([], candidate.call([], [\"this\"]))\n assert_equal([], candidate.call([\"this\"], []))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "rb", - "prompt": "# Circular shift the digits of the integer x, shift the digits right by shift\n# and return the result as a string.\n# If shift > number of digits, return digits reversed.\ndef circular_shift(x, shift)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_circular_shift\n candidate = method(:circular_shift)\n assert_equal(\"001\", candidate.call(100, 2))\n assert_equal(\"12\", candidate.call(12, 2))\n assert_equal(\"79\", candidate.call(97, 8))\n assert_equal(\"21\", candidate.call(12, 1))\n assert_equal(\"11\", candidate.call(11, 101))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "rb", - "prompt": "# Return True is list elements are monotonically increasing or decreasing.\ndef monotonic(l)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_monotonic\n candidate = method(:monotonic)\n assert_equal(true, candidate.call([1, 2, 4, 10]))\n assert_equal(true, candidate.call([1, 2, 4, 20]))\n assert_equal(false, candidate.call([1, 20, 4, 10]))\n assert_equal(true, candidate.call([4, 1, 0, -10]))\n assert_equal(true, candidate.call([4, 1, 1, 0]))\n assert_equal(false, candidate.call([1, 2, 3, 2, 5, 60]))\n assert_equal(true, candidate.call([1, 2, 3, 4, 5, 60]))\n assert_equal(true, candidate.call([9, 9, 9, 9]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "rb", - "prompt": "# Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n# Example\ndef is_equal_to_sum_even(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_equal_to_sum_even\n candidate = method(:is_equal_to_sum_even)\n assert_equal(false, candidate.call(4))\n assert_equal(false, candidate.call(6))\n assert_equal(true, candidate.call(8))\n assert_equal(true, candidate.call(10))\n assert_equal(false, candidate.call(11))\n assert_equal(true, candidate.call(12))\n assert_equal(false, candidate.call(13))\n assert_equal(true, candidate.call(16))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "rb", - "prompt": "# Input to this function is a string representing musical notes in a special ASCII format.\n# Your task is to parse this string and return list of integers corresponding to how many beats does each\n# not last.\n# Here is a legend:\n# 'o' - whole note, lasts four beats\n# 'o|' - half note, lasts two beats\n# '.|' - quater note, lasts one beat\ndef parse_music(music_string)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_parse_music\n candidate = method(:parse_music)\n assert_equal([], candidate.call(\"\"))\n assert_equal([4, 4, 4, 4], candidate.call(\"o o o o\"))\n assert_equal([1, 1, 1, 1], candidate.call(\".| .| .| .|\"))\n assert_equal([2, 2, 1, 1, 4, 4, 4, 4], candidate.call(\"o| o| .| .| o o o o\"))\n assert_equal([2, 1, 2, 1, 4, 2, 4, 2], candidate.call(\"o| .| o| .| o o| o o|\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "rb", - "prompt": "# \"\n# This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n# multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n# change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n# Examples:\ndef sum_squares(lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sum_squares\n candidate = method(:sum_squares)\n assert_equal(6, candidate.call([1, 2, 3]))\n assert_equal(14, candidate.call([1, 4, 9]))\n assert_equal(0, candidate.call([]))\n assert_equal(9, candidate.call([1, 1, 1, 1, 1, 1, 1, 1, 1]))\n assert_equal(-3, candidate.call([-1, -1, -1, -1, -1, -1, -1, -1, -1]))\n assert_equal(0, candidate.call([0]))\n assert_equal(-126, candidate.call([-1, -5, 2, -1, -5]))\n assert_equal(3030, candidate.call([-56, -99, 1, 0, -2]))\n assert_equal(0, candidate.call([-1, 0, 0, 0, 0, 0, 0, 0, -1]))\n assert_equal(-14196, candidate.call([-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37]))\n assert_equal(-1448, candidate.call([-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "rb", - "prompt": "# triples_sum_to_zero takes a list of integers as an input.\n# it returns True if there are three distinct elements in the list that\n# sum to zero, and False otherwise.\ndef triples_sum_to_zero(l)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_triples_sum_to_zero\n candidate = method(:triples_sum_to_zero)\n assert_equal(false, candidate.call([1, 3, 5, 0]))\n assert_equal(false, candidate.call([1, 3, 5, -1]))\n assert_equal(true, candidate.call([1, 3, -2, 1]))\n assert_equal(false, candidate.call([1, 2, 3, 7]))\n assert_equal(false, candidate.call([1, 2, 5, 7]))\n assert_equal(true, candidate.call([2, 4, -5, 3, 9, 7]))\n assert_equal(false, candidate.call([1]))\n assert_equal(false, candidate.call([1, 3, 5, -100]))\n assert_equal(false, candidate.call([100, 3, 5, -100]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "rb", - "prompt": "# brackets is a string of \"<\" and \">\".\n# return True if every opening bracket has a corresponding closing bracket.\ndef correct_bracketing(brackets)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_correct_bracketing\n candidate = method(:correct_bracketing)\n assert_equal(true, candidate.call(\"<>\"))\n assert_equal(true, candidate.call(\"<<><>>\"))\n assert_equal(true, candidate.call(\"<><><<><>><>\"))\n assert_equal(true, candidate.call(\"<><><<<><><>><>><<><><<>>>\"))\n assert_equal(false, candidate.call(\"<<<><>>>>\"))\n assert_equal(false, candidate.call(\"><<>\"))\n assert_equal(false, candidate.call(\"<\"))\n assert_equal(false, candidate.call(\"<<<<\"))\n assert_equal(false, candidate.call(\">\"))\n assert_equal(false, candidate.call(\"<<>\"))\n assert_equal(false, candidate.call(\"<><><<><>><>><<>\"))\n assert_equal(false, candidate.call(\"<><><<><>><>>><>\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "rb", - "prompt": "# Write a function that takes an array of numbers as input and returns \n# the number of elements in the array that are greater than 10 and both \n# first and last digits of a number are odd (1, 3, 5, 7, 9).\n# For example:\ndef specialFilter(nums)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_specialFilter\n candidate = method(:specialFilter)\n assert_equal(0, candidate.call([5, -2, 1, -5]))\n assert_equal(1, candidate.call([15, -73, 14, -15]))\n assert_equal(2, candidate.call([33, -2, -3, 45, 21, 109]))\n assert_equal(4, candidate.call([43, -12, 93, 125, 121, 109]))\n assert_equal(3, candidate.call([71, -2, -33, 75, 21, 19]))\n assert_equal(0, candidate.call([1]))\n assert_equal(0, candidate.call([]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "rb", - "prompt": "# Given a dictionary, return True if all keys are strings in lower \n# case or all keys are strings in upper case, else return False.\n# The function should return False is the given dictionary is empty.\n# Examples:\ndef check_dict_case(dict)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_check_dict_case\n candidate = method(:check_dict_case)\n assert_equal(true, candidate.call({\"p\" => \"pineapple\", \"b\" => \"banana\"}))\n assert_equal(false, candidate.call({\"p\" => \"pineapple\", \"A\" => \"banana\", \"B\" => \"banana\"}))\n assert_equal(false, candidate.call({\"p\" => \"pineapple\", \"5\" => \"banana\", \"a\" => \"apple\"}))\n assert_equal(false, candidate.call({\"Name\" => \"John\", \"Age\" => \"36\", \"City\" => \"Houston\"}))\n assert_equal(true, candidate.call({\"STATE\" => \"NC\", \"ZIP\" => \"12345\"}))\n assert_equal(true, candidate.call({\"fruit\" => \"Orange\", \"taste\" => \"Sweet\"}))\n assert_equal(false, candidate.call({}))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "rb", - "prompt": "# Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n# should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n# alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n# Examples\ndef split_words(txt)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_split_words\n candidate = method(:split_words)\n assert_equal([\"Hello\", \"world!\"], candidate.call(\"Hello world!\"))\n assert_equal([\"Hello\", \"world!\"], candidate.call(\"Hello,world!\"))\n assert_equal([\"Hello\", \"world,!\"], candidate.call(\"Hello world,!\"))\n assert_equal([\"Hello,Hello,world\", \"!\"], candidate.call(\"Hello,Hello,world !\"))\n assert_equal(3, candidate.call(\"abcdef\"))\n assert_equal(2, candidate.call(\"aaabb\"))\n assert_equal(1, candidate.call(\"aaaBb\"))\n assert_equal(0, candidate.call(\"\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "rb", - "prompt": "# The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fibfib(0) == 0\n# fibfib(1) == 0\n# fibfib(2) == 1\n# fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n# Please write a function to efficiently compute the n-th element of the fibfib number sequence.\ndef fibfib(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_fibfib\n candidate = method(:fibfib)\n assert_equal(1, candidate.call(2))\n assert_equal(0, candidate.call(1))\n assert_equal(4, candidate.call(5))\n assert_equal(24, candidate.call(8))\n assert_equal(81, candidate.call(10))\n assert_equal(274, candidate.call(12))\n assert_equal(927, candidate.call(14))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "rb", - "prompt": "# You are given a list of numbers.\n# You need to return the sum of squared numbers in the given list,\n# round each element in the list to the upper int(Ceiling) first.\n# Examples:\ndef sum_squares(lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sum_squares\n candidate = method(:sum_squares)\n assert_equal(14, candidate.call([1.0, 2.0, 3.0]))\n assert_equal(14, candidate.call([1.0, 2.0, 3.0]))\n assert_equal(84, candidate.call([1.0, 3.0, 5.0, 7.0]))\n assert_equal(29, candidate.call([1.4, 4.2, 0.0]))\n assert_equal(6, candidate.call([-2.4, 1.0, 1.0]))\n assert_equal(10230, candidate.call([100.0, 1.0, 15.0, 2.0]))\n assert_equal(200000000, candidate.call([10000.0, 10000.0]))\n assert_equal(75, candidate.call([-1.4, 4.6, 6.3]))\n assert_equal(1086, candidate.call([-1.4, 17.9, 18.9, 19.9]))\n assert_equal(0, candidate.call([0.0]))\n assert_equal(1, candidate.call([-1.0]))\n assert_equal(2, candidate.call([-1.0, 1.0, 0.0]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_85_add", - "language": "rb", - "prompt": "# Given a non-empty list of integers lst. add the even elements that are at odd indices..\n# Examples:\ndef add(lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_add\n candidate = method(:add)\n assert_equal(88, candidate.call([4, 88]))\n assert_equal(122, candidate.call([4, 5, 6, 7, 2, 122]))\n assert_equal(0, candidate.call([4, 0, 6, 7]))\n assert_equal(12, candidate.call([4, 4, 6, 8]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "rb", - "prompt": "# Return sorted unique elements in a list\ndef unique(l)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_unique\n candidate = method(:unique)\n assert_equal([0, 2, 3, 5, 9, 123], candidate.call([5, 3, 5, 2, 3, 3, 9, 0, 123]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "rb", - "prompt": "# Given a string text, replace all spaces in it with underscores, \n# and if a string has more than 2 consecutive spaces, \n# then replace all consecutive spaces with -\ndef fix_spaces(text)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_fix_spaces\n candidate = method(:fix_spaces)\n assert_equal(\"Example\", candidate.call(\"Example\"))\n assert_equal(\"Mudasir_Hanif_\", candidate.call(\"Mudasir Hanif \"))\n assert_equal(\"Yellow_Yellow__Dirty__Fellow\", candidate.call(\"Yellow Yellow Dirty Fellow\"))\n assert_equal(\"Exa-mple\", candidate.call(\"Exa mple\"))\n assert_equal(\"-Exa_1_2_2_mple\", candidate.call(\" Exa 1 2 2 mple\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "rb", - "prompt": "# Return 2^n modulo p (be aware of numerics).\ndef modp(n, p)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_modp\n candidate = method(:modp)\n assert_equal(3, candidate.call(3, 5))\n assert_equal(2, candidate.call(1101, 101))\n assert_equal(1, candidate.call(0, 101))\n assert_equal(8, candidate.call(3, 11))\n assert_equal(1, candidate.call(100, 101))\n assert_equal(4, candidate.call(30, 5))\n assert_equal(3, candidate.call(31, 5))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "rb", - "prompt": "# You have to write a function which validates a given date string and\n# returns True if the date is valid otherwise False.\n# The date is valid if all of the following rules are satisfied:\n# 1. The date string is not empty.\n# 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n# 3. The months should not be less than 1 or higher than 12.\n# 4. The date should be in the format: mm-dd-yyyy\ndef valid_date(date)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_valid_date\n candidate = method(:valid_date)\n assert_equal(true, candidate.call(\"03-11-2000\"))\n assert_equal(false, candidate.call(\"15-01-2012\"))\n assert_equal(false, candidate.call(\"04-0-2040\"))\n assert_equal(true, candidate.call(\"06-04-2020\"))\n assert_equal(true, candidate.call(\"01-01-2007\"))\n assert_equal(false, candidate.call(\"03-32-2011\"))\n assert_equal(false, candidate.call(\"\"))\n assert_equal(false, candidate.call(\"04-31-3000\"))\n assert_equal(true, candidate.call(\"06-06-2005\"))\n assert_equal(false, candidate.call(\"21-31-2000\"))\n assert_equal(true, candidate.call(\"04-12-2003\"))\n assert_equal(false, candidate.call(\"04122003\"))\n assert_equal(false, candidate.call(\"20030412\"))\n assert_equal(false, candidate.call(\"2003-04\"))\n assert_equal(false, candidate.call(\"2003-04-12\"))\n assert_equal(false, candidate.call(\"04-2003\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "rb", - "prompt": "# Write a function that takes a string and returns an ordered version of it.\n# Ordered version of string, is a string where all words (separated by space)\n# are replaced by a new word where all the characters arranged in\n# ascending order based on ascii value.\n# Note: You should keep the order of words and blank spaces in the sentence.\n# For example:\ndef anti_shuffle(s)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_anti_shuffle\n candidate = method(:anti_shuffle)\n assert_equal(\"Hi\", candidate.call(\"Hi\"))\n assert_equal(\"ehllo\", candidate.call(\"hello\"))\n assert_equal(\"bemnru\", candidate.call(\"number\"))\n assert_equal(\"abcd\", candidate.call(\"abcd\"))\n assert_equal(\"Hello !!!Wdlor\", candidate.call(\"Hello World!!!\"))\n assert_equal(\"\", candidate.call(\"\"))\n assert_equal(\".Hi My aemn is Meirst .Rboot How aer ?ouy\", candidate.call(\"Hi. My name is Mister Robot. How are you?\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "rb", - "prompt": "# Given a list of numbers, return whether or not they are sorted\n# in ascending order. If list has more than 1 duplicate of the same\n# number, return False. Assume no negative numbers and only integers.\n# Examples\ndef is_sorted(lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_sorted\n candidate = method(:is_sorted)\n assert_equal(true, candidate.call([5]))\n assert_equal(true, candidate.call([1, 2, 3, 4, 5]))\n assert_equal(false, candidate.call([1, 3, 2, 4, 5]))\n assert_equal(true, candidate.call([1, 2, 3, 4, 5, 6]))\n assert_equal(true, candidate.call([1, 2, 3, 4, 5, 6, 7]))\n assert_equal(false, candidate.call([1, 3, 2, 4, 5, 6, 7]))\n assert_equal(true, candidate.call([]))\n assert_equal(true, candidate.call([1]))\n assert_equal(false, candidate.call([3, 2, 1]))\n assert_equal(false, candidate.call([1, 2, 2, 2, 3, 4]))\n assert_equal(false, candidate.call([1, 2, 3, 3, 3, 4]))\n assert_equal(true, candidate.call([1, 2, 2, 3, 3, 4]))\n assert_equal(true, candidate.call([1, 2, 3, 4]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "rb", - "prompt": "# You are given a string s.\n# Your task is to check if the string is happy or not.\n# A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n# For example:\ndef is_happy(s)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_happy\n candidate = method(:is_happy)\n assert_equal(false, candidate.call(\"a\"))\n assert_equal(false, candidate.call(\"aa\"))\n assert_equal(true, candidate.call(\"abcd\"))\n assert_equal(false, candidate.call(\"aabb\"))\n assert_equal(true, candidate.call(\"adb\"))\n assert_equal(false, candidate.call(\"xyy\"))\n assert_equal(true, candidate.call(\"iopaxpoi\"))\n assert_equal(false, candidate.call(\"iopaxioi\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "rb", - "prompt": "# Write a function that returns True if the object q will fly, and False otherwise.\n# The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n# Example:\n# # 1+2 is less than the maximum possible weight, but it's unbalanced.\n# # it's balanced, but 3+2+3 is more than the maximum possible weight.\n# # 3+2+3 is less than the maximum possible weight, and it's balanced.\n# # 3 is less than the maximum possible weight, and it's balanced.\ndef will_it_fly(q, w)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_will_it_fly\n candidate = method(:will_it_fly)\n assert_equal(true, candidate.call([3, 2, 3], 9))\n assert_equal(false, candidate.call([1, 2], 5))\n assert_equal(true, candidate.call([3], 5))\n assert_equal(false, candidate.call([3, 2, 3], 1))\n assert_equal(false, candidate.call([1, 2, 3], 6))\n assert_equal(true, candidate.call([5], 5))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "rb", - "prompt": "# Given an array of non-negative integers, return a copy of the given array after sorting,\n# you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n# or sort it in descending order if the sum( first index value, last index value) is even.\n# Note:\n# * don't change the given array.\n# Examples:\ndef sort_array(array)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sort_array\n candidate = method(:sort_array)\n assert_equal([], candidate.call([]))\n assert_equal([5], candidate.call([5]))\n assert_equal([0, 1, 2, 3, 4, 5], candidate.call([2, 4, 3, 0, 1, 5]))\n assert_equal([6, 5, 4, 3, 2, 1, 0], candidate.call([2, 4, 3, 0, 1, 5, 6]))\n assert_equal([1, 2], candidate.call([2, 1]))\n assert_equal([0, 11, 15, 32, 42, 87], candidate.call([15, 42, 87, 32, 11, 0]))\n assert_equal([23, 21, 14, 11], candidate.call([21, 14, 23, 11]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "rb", - "prompt": "# Implement a function that takes an non-negative integer and returns an array of the first n\n# integers that are prime numbers and less than n.\n# for example:\ndef count_up_to(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_count_up_to\n candidate = method(:count_up_to)\n assert_equal([2, 3], candidate.call(5))\n assert_equal([2, 3, 5], candidate.call(6))\n assert_equal([2, 3, 5], candidate.call(7))\n assert_equal([2, 3, 5, 7], candidate.call(10))\n assert_equal([], candidate.call(0))\n assert_equal([2, 3, 5, 7, 11, 13, 17, 19], candidate.call(22))\n assert_equal([], candidate.call(1))\n assert_equal([2, 3, 5, 7, 11, 13, 17], candidate.call(18))\n assert_equal([2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43], candidate.call(47))\n assert_equal([2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97], candidate.call(101))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "rb", - "prompt": "# Out of list of strings, return the longest one. Return the first one in case of multiple\n# strings of the same length. Return None in case the input list is empty.\ndef longest(strings)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_longest\n candidate = method(:longest)\n assert_equal(nil, candidate.call([]))\n assert_equal(\"x\", candidate.call([\"x\", \"y\", \"z\"]))\n assert_equal(\"zzzz\", candidate.call([\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "rb", - "prompt": "# Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n# reverse the resulting array, and then replace each digit by its corresponding name from\n# \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n# For example:\n# If the array is empty, return an empty array:\n# If the array has any strange number ignore it:\ndef by_length(arr)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_by_length\n candidate = method(:by_length)\n assert_equal([\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"], candidate.call([2, 1, 1, 4, 5, 8, 2, 3]))\n assert_equal([], candidate.call([]))\n assert_equal([\"One\"], candidate.call([1, -1, 55]))\n assert_equal([\"Three\", \"Two\", \"One\"], candidate.call([1, -1, 3, 2]))\n assert_equal([\"Nine\", \"Eight\", \"Four\"], candidate.call([9, 4, 8]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_106_f", - "language": "rb", - "prompt": "# Implement the function f that takes n as a parameter,\n# 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\n# or the sum of numbers from 1 to i otherwise.\n# i starts from 1.\n# the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n# Example:\ndef f(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_f\n candidate = method(:f)\n assert_equal([1, 2, 6, 24, 15], candidate.call(5))\n assert_equal([1, 2, 6, 24, 15, 720, 28], candidate.call(7))\n assert_equal([1], candidate.call(1))\n assert_equal([1, 2, 6], candidate.call(3))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "rb", - "prompt": "# Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\ndef fizz_buzz(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_fizz_buzz\n candidate = method(:fizz_buzz)\n assert_equal(0, candidate.call(50))\n assert_equal(2, candidate.call(78))\n assert_equal(3, candidate.call(79))\n assert_equal(3, candidate.call(100))\n assert_equal(6, candidate.call(200))\n assert_equal(192, candidate.call(4000))\n assert_equal(639, candidate.call(10000))\n assert_equal(8026, candidate.call(100000))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "rb", - "prompt": "# Given a positive floating point number, it can be decomposed into\n# and integer part (largest integer smaller than given number) and decimals\n# (leftover part always smaller than 1).\n# Return the decimal part of the number.\ndef truncate_number(number)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_truncate_number\n candidate = method(:truncate_number)\n assert_equal(0.5, candidate.call(3.5))\n assert_equal(0.25, candidate.call(1.25))\n assert_equal(0.0, candidate.call(123.0))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "rb", - "prompt": "# For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n# Empty sum should be equal to 0 and empty product should be equal to 1.\ndef sum_product(numbers)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sum_product\n candidate = method(:sum_product)\n assert_equal([0, 1], candidate.call([]))\n assert_equal([3, 1], candidate.call([1, 1, 1]))\n assert_equal([100, 0], candidate.call([100, 0]))\n assert_equal([15, 105], candidate.call([3, 5, 7]))\n assert_equal([10, 10], candidate.call([10]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "rb", - "prompt": "# You are given a 2 dimensional data, as a nested lists,\n# which is similar to matrix, however, unlike matrices,\n# each row may contain a different number of columns.\n# Given lst, and integer x, find integers x in the list,\n# and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n# each tuple is a coordinate - (row, columns), starting with 0.\n# Sort coordinates initially by rows in ascending order.\n# Also, sort coordinates of the row by columns in descending order.\n# Examples:\ndef get_row(lst, x)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_get_row\n candidate = method(:get_row)\n assert_equal([[0, 0], [1, 4], [1, 0], [2, 5], [2, 0]], candidate.call([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1))\n assert_equal([[0, 1], [1, 1], [2, 1], [3, 1], [4, 1], [5, 1]], candidate.call([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6]], 2))\n assert_equal([[0, 0], [1, 0], [2, 1], [2, 0], [3, 2], [3, 0], [4, 3], [4, 0], [5, 4], [5, 0], [6, 5], [6, 0]], candidate.call([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 1, 3, 4, 5, 6], [1, 2, 1, 4, 5, 6], [1, 2, 3, 1, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1))\n assert_equal([], candidate.call([], 1))\n assert_equal([], candidate.call([[1]], 2))\n assert_equal([[2, 2]], candidate.call([[], [1], [1, 2, 3]], 3))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "rb", - "prompt": "# You're a hungry rabbit, and you already have eaten a certain number of carrots,\n# but now you need to eat more carrots to complete the day's meals.\n# you should return an array of [ total number of eaten carrots after your meals,\n# the number of carrots left after your meals ]\n# if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n# Example:\n# Variables:\n# @number : integer\n# the number of carrots that you have eaten.\n# @need : integer\n# the number of carrots that you need to eat.\n# @remaining : integer\n# the number of remaining carrots thet exist in stock\n# Constrain:\n# * 0 <= number <= 1000\n# * 0 <= need <= 1000\n# * 0 <= remaining <= 1000\n# Have fun :)\ndef eat(number, need, remaining)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_eat\n candidate = method(:eat)\n assert_equal([11, 4], candidate.call(5, 6, 10))\n assert_equal([12, 1], candidate.call(4, 8, 9))\n assert_equal([11, 0], candidate.call(1, 10, 10))\n assert_equal([7, 0], candidate.call(2, 11, 5))\n assert_equal([9, 2], candidate.call(4, 5, 7))\n assert_equal([5, 0], candidate.call(4, 5, 1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "rb", - "prompt": "# Given a positive integer N, return the total sum of its digits in binary.\n# Example\n# Variables:\n# @N integer\n# Constraints: 0 \u2264 N \u2264 10000.\n# Output:\n# a string of binary number\ndef solve(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_solve\n candidate = method(:solve)\n assert_equal(\"1\", candidate.call(1000))\n assert_equal(\"110\", candidate.call(150))\n assert_equal(\"1100\", candidate.call(147))\n assert_equal(\"1001\", candidate.call(333))\n assert_equal(\"10010\", candidate.call(963))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "rb", - "prompt": "# You are given a list of integers.\n# You need to find the largest prime value and return the sum of its digits.\n# Examples:\ndef skjkasdkd(lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_skjkasdkd\n candidate = method(:skjkasdkd)\n assert_equal(10, candidate.call([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]))\n assert_equal(25, candidate.call([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]))\n assert_equal(13, candidate.call([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]))\n assert_equal(11, candidate.call([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]))\n assert_equal(3, candidate.call([0, 81, 12, 3, 1, 21]))\n assert_equal(7, candidate.call([0, 8, 1, 2, 1, 7]))\n assert_equal(19, candidate.call([8191]))\n assert_equal(19, candidate.call([8191, 123456, 127, 7]))\n assert_equal(10, candidate.call([127, 97, 8192]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "rb", - "prompt": "# Given an array arr of integers, find the minimum number of elements that\n# need to be changed to make the array palindromic. A palindromic array is an array that\n# is read the same backwards and forwards. In one change, you can change one element to any other element.\n# For example:\ndef smallest_change(arr)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_smallest_change\n candidate = method(:smallest_change)\n assert_equal(4, candidate.call([1, 2, 3, 5, 4, 7, 9, 6]))\n assert_equal(1, candidate.call([1, 2, 3, 4, 3, 2, 2]))\n assert_equal(1, candidate.call([1, 4, 2]))\n assert_equal(1, candidate.call([1, 4, 4, 2]))\n assert_equal(0, candidate.call([1, 2, 3, 2, 1]))\n assert_equal(0, candidate.call([3, 1, 1, 3]))\n assert_equal(0, candidate.call([1]))\n assert_equal(1, candidate.call([0, 1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "rb", - "prompt": "# It is the last week of the semester and the teacher has to give the grades\n# to students. The teacher has been making her own algorithm for grading.\n# The only problem is, she has lost the code she used for grading.\n# She has given you a list of GPAs for some students and you have to write \n# a function that can output a list of letter grades using the following table:\n# GPA | Letter grade\n# 4.0 A+\n# > 3.7 A \n# > 3.3 A- \n# > 3.0 B+\n# > 2.7 B \n# > 2.3 B-\n# > 2.0 C+\n# > 1.7 C\n# > 1.3 C-\n# > 1.0 D+ \n# > 0.7 D \n# > 0.0 D-\n# 0.0 E\n# Example:\ndef numerical_letter_grade(grades)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_numerical_letter_grade\n candidate = method(:numerical_letter_grade)\n assert_equal([\"A+\", \"B\", \"C-\", \"C\", \"A-\"], candidate.call([4.0, 3, 1.7, 2, 3.5]))\n assert_equal([\"D+\"], candidate.call([1.2]))\n assert_equal([\"D-\"], candidate.call([0.5]))\n assert_equal([\"E\"], candidate.call([0.0]))\n assert_equal([\"D\", \"D-\", \"C-\", \"B\", \"B+\"], candidate.call([1.0, 0.3, 1.5, 2.8, 3.3]))\n assert_equal([\"E\", \"D-\"], candidate.call([0.0, 0.7]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "rb", - "prompt": "# Given the lengths of the three sides of a triangle. Return the area of\n# the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n# Otherwise return -1\n# Three sides make a valid triangle when the sum of any two sides is greater \n# than the third side.\n# Example:\ndef triangle_area(a, b, c)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_triangle_area\n candidate = method(:triangle_area)\n assert_equal(6.0, candidate.call(3, 4, 5))\n assert_equal(-1, candidate.call(1, 2, 10))\n assert_equal(8.18, candidate.call(4, 8, 5))\n assert_equal(1.73, candidate.call(2, 2, 2))\n assert_equal(-1, candidate.call(1, 2, 3))\n assert_equal(16.25, candidate.call(10, 5, 7))\n assert_equal(-1, candidate.call(2, 6, 3))\n assert_equal(0.43, candidate.call(1, 1, 1))\n assert_equal(-1, candidate.call(2, 2, 10))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "rb", - "prompt": "# Check if two words have the same characters.\ndef same_chars(s0, s1)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_same_chars\n candidate = method(:same_chars)\n assert_equal(true, candidate.call(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\"))\n assert_equal(true, candidate.call(\"abcd\", \"dddddddabc\"))\n assert_equal(true, candidate.call(\"dddddddabc\", \"abcd\"))\n assert_equal(false, candidate.call(\"eabcd\", \"dddddddabc\"))\n assert_equal(false, candidate.call(\"abcd\", \"dddddddabcf\"))\n assert_equal(false, candidate.call(\"eabcdzzzz\", \"dddzzzzzzzddddabc\"))\n assert_equal(false, candidate.call(\"aabb\", \"aaccc\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "rb", - "prompt": "# Given an array of integers nums, find the minimum sum of any non-empty sub-array\n# of nums.\n# Example\ndef minSubArraySum(nums)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_minSubArraySum\n candidate = method(:minSubArraySum)\n assert_equal(1, candidate.call([2, 3, 4, 1, 2, 4]))\n assert_equal(-6, candidate.call([-1, -2, -3]))\n assert_equal(-14, candidate.call([-1, -2, -3, 2, -10]))\n assert_equal(-9999999999999999, candidate.call([-9999999999999999]))\n assert_equal(0, candidate.call([0, 10, 20, 1000000]))\n assert_equal(-6, candidate.call([-1, -2, -3, 10, -5]))\n assert_equal(-6, candidate.call([100, -1, -2, -3, 10, -5]))\n assert_equal(3, candidate.call([10, 11, 13, 8, 3, 4]))\n assert_equal(-33, candidate.call([100, -33, 32, -1, 0, -2]))\n assert_equal(-10, candidate.call([-10]))\n assert_equal(7, candidate.call([7]))\n assert_equal(-1, candidate.call([1, -1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "rb", - "prompt": "# Given a string s and a natural number n, you have been tasked to implement \n# a function that returns a list of all words from string s that contain exactly \n# n consonants, in order these words appear in the string s.\n# If the string s is empty then the function should return an empty list.\n# Note: you may assume the input string contains only letters and spaces.\n# Examples:\ndef select_words(s, n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_select_words\n candidate = method(:select_words)\n assert_equal([\"little\"], candidate.call(\"Mary had a little lamb\", 4))\n assert_equal([\"Mary\", \"lamb\"], candidate.call(\"Mary had a little lamb\", 3))\n assert_equal([], candidate.call(\"simple white space\", 2))\n assert_equal([\"world\"], candidate.call(\"Hello world\", 4))\n assert_equal([\"Uncle\"], candidate.call(\"Uncle sam\", 3))\n assert_equal([], candidate.call(\"\", 4))\n assert_equal([\"b\", \"c\", \"d\", \"f\"], candidate.call(\"a b c d e f\", 1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "rb", - "prompt": "# Return list of all prefixes from shortest to longest of the input string\ndef all_prefixes(string)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_all_prefixes\n candidate = method(:all_prefixes)\n assert_equal([], candidate.call(\"\"))\n assert_equal([\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"], candidate.call(\"asdfgh\"))\n assert_equal([\"W\", \"WW\", \"WWW\"], candidate.call(\"WWW\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "rb", - "prompt": "# Create a function that takes a value (string) representing a number\n# and returns the closest integer to it. If the number is equidistant\n# from two integers, round it away from zero.\n# Examples\n# Note:\n# Rounding away from zero means that if the given number is equidistant\n# from two integers, the one you should return is the one that is the\n# farthest from zero. For example closest_integer(\"14.5\") should\n# return 15 and closest_integer(\"-14.5\") should return -15.\ndef closest_integer(value)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_closest_integer\n candidate = method(:closest_integer)\n assert_equal(10, candidate.call(\"10\"))\n assert_equal(15, candidate.call(\"14.5\"))\n assert_equal(-16, candidate.call(\"-15.5\"))\n assert_equal(15, candidate.call(\"15.3\"))\n assert_equal(0, candidate.call(\"0\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "rb", - "prompt": "# Create a function which takes a string representing a file's name, and returns\n# 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n# A file's name is considered to be valid if and only if all the following conditions \n# are met:\n# - There should not be more than three digits ('0'-'9') in the file's name.\n# - The file's name contains exactly one dot '.'\n# - The substring before the dot should not be empty, and it starts with a letter from \n# the latin alphapet ('a'-'z' and 'A'-'Z').\n# - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n# Examples:\ndef file_name_check(file_name)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_file_name_check\n candidate = method(:file_name_check)\n assert_equal(\"Yes\", candidate.call(\"example.txt\"))\n assert_equal(\"No\", candidate.call(\"1example.dll\"))\n assert_equal(\"No\", candidate.call(\"s1sdf3.asd\"))\n assert_equal(\"Yes\", candidate.call(\"K.dll\"))\n assert_equal(\"Yes\", candidate.call(\"MY16FILE3.exe\"))\n assert_equal(\"No\", candidate.call(\"His12FILE94.exe\"))\n assert_equal(\"No\", candidate.call(\"_Y.txt\"))\n assert_equal(\"No\", candidate.call(\"?aREYA.exe\"))\n assert_equal(\"No\", candidate.call(\"/this_is_valid.dll\"))\n assert_equal(\"No\", candidate.call(\"this_is_valid.wow\"))\n assert_equal(\"Yes\", candidate.call(\"this_is_valid.txt\"))\n assert_equal(\"No\", candidate.call(\"this_is_valid.txtexe\"))\n assert_equal(\"No\", candidate.call(\"#this2_i4s_5valid.ten\"))\n assert_equal(\"No\", candidate.call(\"@this1_is6_valid.exe\"))\n assert_equal(\"No\", candidate.call(\"this_is_12valid.6exe4.txt\"))\n assert_equal(\"No\", candidate.call(\"all.exe.txt\"))\n assert_equal(\"Yes\", candidate.call(\"I563_No.exe\"))\n assert_equal(\"Yes\", candidate.call(\"Is3youfault.txt\"))\n assert_equal(\"Yes\", candidate.call(\"no_one#knows.dll\"))\n assert_equal(\"No\", candidate.call(\"1I563_Yes3.exe\"))\n assert_equal(\"No\", candidate.call(\"I563_Yes3.txtt\"))\n assert_equal(\"No\", candidate.call(\"final..txt\"))\n assert_equal(\"No\", candidate.call(\"final132\"))\n assert_equal(\"No\", candidate.call(\"_f4indsartal132.\"))\n assert_equal(\"No\", candidate.call(\".txt\"))\n assert_equal(\"No\", candidate.call(\"s.\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "rb", - "prompt": "# You are given two intervals,\n# where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n# The given intervals are closed which means that the interval (start, end)\n# includes both start and end.\n# For each given interval, it is assumed that its start is less or equal its end.\n# Your task is to determine whether the length of intersection of these two \n# intervals is a prime number.\n# Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n# which its length is 1, which not a prime number.\n# If the length of the intersection is a prime number, return \"YES\",\n# otherwise, return \"NO\".\n# If the two intervals don't intersect, return \"NO\".\n# [input/output] samples:\ndef intersection(interval1, interval2)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_intersection\n candidate = method(:intersection)\n assert_equal(\"NO\", candidate.call([1, 2], [2, 3]))\n assert_equal(\"NO\", candidate.call([-1, 1], [0, 4]))\n assert_equal(\"YES\", candidate.call([-3, -1], [-5, 5]))\n assert_equal(\"YES\", candidate.call([-2, 2], [-4, 0]))\n assert_equal(\"NO\", candidate.call([-11, 2], [-1, -1]))\n assert_equal(\"NO\", candidate.call([1, 2], [3, 5]))\n assert_equal(\"NO\", candidate.call([1, 2], [1, 2]))\n assert_equal(\"NO\", candidate.call([-2, -2], [-3, -2]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "rb", - "prompt": "# Return the largest prime factor of n. Assume n > 1 and is not a prime.\ndef largest_prime_factor(n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_largest_prime_factor\n candidate = method(:largest_prime_factor)\n assert_equal(5, candidate.call(15))\n assert_equal(3, candidate.call(27))\n assert_equal(7, candidate.call(63))\n assert_equal(11, candidate.call(330))\n assert_equal(29, candidate.call(13195))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "rb", - "prompt": "# Given a string, find out how many distinct characters (regardless of case) does it consist of\ndef count_distinct_characters(string)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_count_distinct_characters\n candidate = method(:count_distinct_characters)\n assert_equal(0, candidate.call(\"\"))\n assert_equal(5, candidate.call(\"abcde\"))\n assert_equal(5, candidate.call(\"abcdecadeCADE\"))\n assert_equal(1, candidate.call(\"aaaaAAAAaaaa\"))\n assert_equal(5, candidate.call(\"Jerry jERRY JeRRRY\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "rb", - "prompt": "# You're given a list of deposit and withdrawal operations on a bank account that starts with\n# zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n# at that point function should return True. Otherwise it should return False.\ndef below_zero(operations)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_below_zero\n candidate = method(:below_zero)\n assert_equal(false, candidate.call([]))\n assert_equal(false, candidate.call([1, 2, -3, 1, 2, -3]))\n assert_equal(true, candidate.call([1, 2, -4, 5, 6]))\n assert_equal(false, candidate.call([1, -1, 2, -2, 5, -5, 4, -4]))\n assert_equal(true, candidate.call([1, -1, 2, -2, 5, -5, 4, -5]))\n assert_equal(true, candidate.call([1, -2, 2, -2, 5, -5, 4, -4]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "rb", - "prompt": "# Find the shortest palindrome that begins with a supplied string.\n# Algorithm idea is simple:\n# - Find the longest postfix of supplied string that is a palindrome.\n# - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\ndef make_palindrome(string)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_make_palindrome\n candidate = method(:make_palindrome)\n assert_equal(\"\", candidate.call(\"\"))\n assert_equal(\"x\", candidate.call(\"x\"))\n assert_equal(\"xyzyx\", candidate.call(\"xyz\"))\n assert_equal(\"xyx\", candidate.call(\"xyx\"))\n assert_equal(\"jerryrrej\", candidate.call(\"jerry\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "rb", - "prompt": "# Given a positive integer, obtain its roman numeral equivalent as a string,\n# and return it in lowercase.\n# Restrictions: 1 <= num <= 1000\n# Examples:\ndef int_to_mini_roman(number)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_int_to_mini_roman\n candidate = method(:int_to_mini_roman)\n assert_equal(\"xix\", candidate.call(19))\n assert_equal(\"clii\", candidate.call(152))\n assert_equal(\"ccli\", candidate.call(251))\n assert_equal(\"cdxxvi\", candidate.call(426))\n assert_equal(\"d\", candidate.call(500))\n assert_equal(\"i\", candidate.call(1))\n assert_equal(\"iv\", candidate.call(4))\n assert_equal(\"xliii\", candidate.call(43))\n assert_equal(\"xc\", candidate.call(90))\n assert_equal(\"xciv\", candidate.call(94))\n assert_equal(\"dxxxii\", candidate.call(532))\n assert_equal(\"cm\", candidate.call(900))\n assert_equal(\"cmxciv\", candidate.call(994))\n assert_equal(\"m\", candidate.call(1000))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - } -] \ No newline at end of file diff --git a/data/rb-reworded.json b/data/rb-reworded.json deleted file mode 100644 index d888c6954f3f47bf328166f1d6c33d2f075239d2..0000000000000000000000000000000000000000 --- a/data/rb-reworded.json +++ /dev/null @@ -1,2417 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "rb", - "prompt": "# For a given number n, find the largest number that divides n evenly, smaller than n\n# >>> largest_divisor.call(15)\n# 5\ndef largest_divisor(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_largest_divisor\n candidate = method(:largest_divisor)\n assert_equal(1, candidate.call(3))\n assert_equal(1, candidate.call(7))\n assert_equal(5, candidate.call(10))\n assert_equal(50, candidate.call(100))\n assert_equal(7, candidate.call(49))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_47_median", - "language": "rb", - "prompt": "# Return median of elements in the array l.\n# >>> median.call([3, 1, 2, 4, 5])\n# 3\n# >>> median.call([-10, 4, 6, 1000, 10, 20])\n# 15.0\ndef median(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_median\n candidate = method(:median)\n assert_equal(3, candidate.call([3, 1, 2, 4, 5]))\n assert_equal(8.0, candidate.call([-10, 4, 6, 1000, 10, 20]))\n assert_equal(5, candidate.call([5]))\n assert_equal(5.5, candidate.call([6, 5]))\n assert_equal(7, candidate.call([8, 1, 3, 9, 9, 2, 7]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "rb", - "prompt": "# Given two arrays operator, and operand. The first array has basic algebra operations, and \n# the second array is an array of integers. Use the two given arrays to build the algebric \n# expression and return the evaluation of this expression.\n# The basic algebra operations:\n# Addition ( + ) \n# Subtraction ( - ) \n# Multiplication ( * ) \n# Floor division ( // ) \n# Exponentiation ( ** ) \n# Example:\n# operator['+', '*', '-']\n# array = [2, 3, 4, 5]\n# result = 2 + 3 * 4 - 5\n# => result = 9\n# Note:\n# The length of operator array is equal to the length of operand array minus one.\n# Operand is an array of of non-negative integers.\n# Operator array has at least one operator, and operand array has at least two operands.\ndef do_algebra(operator, operand)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_do_algebra\n candidate = method(:do_algebra)\n assert_equal(37, candidate.call([\"**\", \"*\", \"+\"], [2, 3, 4, 5]))\n assert_equal(9, candidate.call([\"+\", \"*\", \"-\"], [2, 3, 4, 5]))\n assert_equal(8, candidate.call([\"//\", \"*\"], [7, 3, 4]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "rb", - "prompt": "# Return maximum element in the array.\n# >>> max_element.call([1, 2, 3])\n# 3\n# >>> max_element.call([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n# 123\ndef max_element(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_max_element\n candidate = method(:max_element)\n assert_equal(3, candidate.call([1, 2, 3]))\n assert_equal(124, candidate.call([5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "rb", - "prompt": "# Create a function which returns the largest index of an element which\n# is not greater than or equal to the element immediately preceding it. If\n# no such element exists then return -1. The given array will not contain\n# duplicate values.\n# Examples:\n# >>> can_arrange.call([1, 2, 4, 3, 5])\n# 3\n# >>> can_arrange.call([1, 2, 3])\n# -1\ndef can_arrange(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_can_arrange\n candidate = method(:can_arrange)\n assert_equal(3, candidate.call([1, 2, 4, 3, 5]))\n assert_equal(-1, candidate.call([1, 2, 4, 5]))\n assert_equal(2, candidate.call([1, 4, 2, 5, 6, 7, 8, 9, 10]))\n assert_equal(4, candidate.call([4, 8, 5, 7, 3]))\n assert_equal(-1, candidate.call([]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "rb", - "prompt": "# Imagine a road that's a perfectly straight infinitely long line.\n# n cars are driving left to right; simultaneously, a different set of n cars\n# are driving right to left. The two sets of cars start out being very far from\n# each other. All cars move in the same speed. Two cars are said to collide\n# when a car that's moving left to right hits a car that's moving right to left.\n# However, the cars are infinitely sturdy and strong; as a result, they continue moving\n# in their trajectory as if they did not collide.\n# This function outputs the number of such collisions.\ndef car_race_collision(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_car_race_collision\n candidate = method(:car_race_collision)\n assert_equal(4, candidate.call(2))\n assert_equal(9, candidate.call(3))\n assert_equal(16, candidate.call(4))\n assert_equal(64, candidate.call(8))\n assert_equal(100, candidate.call(10))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "rb", - "prompt": "# Create a function that returns true if the last character\n# of a given string is an alphabetical character and is not\n# a part of a word, and false otherwise.\n# Note: \"word\" is a group of characters separated by space.\n# Examples:\n# >>> check_if_last_char_is_a_letter.call(\"apple pie\")\n# false\n# >>> check_if_last_char_is_a_letter.call(\"apple pi e\")\n# true\n# >>> check_if_last_char_is_a_letter.call(\"apple pi e \")\n# false\n# >>> check_if_last_char_is_a_letter.call(\"\")\n# false\ndef check_if_last_char_is_a_letter(txt)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_check_if_last_char_is_a_letter\n candidate = method(:check_if_last_char_is_a_letter)\n assert_equal(false, candidate.call(\"apple\"))\n assert_equal(true, candidate.call(\"apple pi e\"))\n assert_equal(false, candidate.call(\"eeeee\"))\n assert_equal(true, candidate.call(\"A\"))\n assert_equal(false, candidate.call(\"Pumpkin pie \"))\n assert_equal(false, candidate.call(\"Pumpkin pie 1\"))\n assert_equal(false, candidate.call(\"\"))\n assert_equal(false, candidate.call(\"eeeee e \"))\n assert_equal(false, candidate.call(\"apple pie\"))\n assert_equal(false, candidate.call(\"apple pi e \"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "rb", - "prompt": "# Return true if a given number is prime, and false otherwise.\n# >>> is_prime.call(6)\n# false\n# >>> is_prime.call(101)\n# true\n# >>> is_prime.call(11)\n# true\n# >>> is_prime.call(13441)\n# true\n# >>> is_prime.call(61)\n# true\n# >>> is_prime.call(4)\n# false\n# >>> is_prime.call(1)\n# false\ndef is_prime(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_prime\n candidate = method(:is_prime)\n assert_equal(false, candidate.call(6))\n assert_equal(true, candidate.call(101))\n assert_equal(true, candidate.call(11))\n assert_equal(true, candidate.call(13441))\n assert_equal(true, candidate.call(61))\n assert_equal(false, candidate.call(4))\n assert_equal(false, candidate.call(1))\n assert_equal(true, candidate.call(5))\n assert_equal(true, candidate.call(11))\n assert_equal(true, candidate.call(17))\n assert_equal(false, candidate.call(85))\n assert_equal(false, candidate.call(77))\n assert_equal(false, candidate.call(255379))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "rb", - "prompt": "# Given an array of positive integers x. return a sorted array of all \n# elements that hasn't any even digit.\n# Note: Returned array should be sorted in increasing order.\n# For example:\n# >>> unique_digits.call([15, 33, 1422, 1])\n# [1, 15, 33]\n# >>> unique_digits.call([152, 323, 1422, 10])\n# []\ndef unique_digits(x)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_unique_digits\n candidate = method(:unique_digits)\n assert_equal([1, 15, 33], candidate.call([15, 33, 1422, 1]))\n assert_equal([], candidate.call([152, 323, 1422, 10]))\n assert_equal([111, 151], candidate.call([12345, 2033, 111, 151]))\n assert_equal([31, 135], candidate.call([135, 103, 31]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "rb", - "prompt": "# Input are two strings a and b consisting only of 1s and 0s.\n# Perform binary XOR on these inputs and return result also as a string.\n# >>> string_xor.call(\"010\", \"110\")\n# \"100\"\ndef string_xor(a, b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_string_xor\n candidate = method(:string_xor)\n assert_equal(\"010010\", candidate.call(\"111000\", \"101010\"))\n assert_equal(\"0\", candidate.call(\"1\", \"1\"))\n assert_equal(\"0101\", candidate.call(\"0101\", \"0000\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "rb", - "prompt": "# sum_to_n is a function that sums numbers from 1 to n.\n# >>> sum_to_n.call(30)\n# 465\n# >>> sum_to_n.call(100)\n# 5050\n# >>> sum_to_n.call(5)\n# 15\n# >>> sum_to_n.call(10)\n# 55\n# >>> sum_to_n.call(1)\n# 1\ndef sum_to_n(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sum_to_n\n candidate = method(:sum_to_n)\n assert_equal(1, candidate.call(1))\n assert_equal(21, candidate.call(6))\n assert_equal(66, candidate.call(11))\n assert_equal(465, candidate.call(30))\n assert_equal(5050, candidate.call(100))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "rb", - "prompt": "# Given an array of numbers, return the sum of squares of the numbers\n# in the array that are odd. Ignore numbers that are negative or not integers.\n# >>> double_the_difference.call([1, 3, 2, 0])\n# 10\n# >>> double_the_difference.call([-1, -2, 0])\n# 0\n# >>> double_the_difference.call([9, -2])\n# 81\n# >>> double_the_difference.call([0])\n# 0\n# If the input array is empty, return 0.\ndef double_the_difference(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_double_the_difference\n candidate = method(:double_the_difference)\n assert_equal(0, candidate.call([]))\n assert_equal(25, candidate.call([5.0, 4.0]))\n assert_equal(0, candidate.call([0.1, 0.2, 0.3]))\n assert_equal(0, candidate.call([-10.0, -20.0, -30.0]))\n assert_equal(0, candidate.call([-1.0, -2.0, 8.0]))\n assert_equal(34, candidate.call([0.2, 3.0, 5.0]))\n assert_equal(165, candidate.call([-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "rb", - "prompt": "# Return length of given string\n# >>> strlen.call(\"\")\n# 0\n# >>> strlen.call(\"abc\")\n# 3\ndef strlen(string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_strlen\n candidate = method(:strlen)\n assert_equal(0, candidate.call(\"\"))\n assert_equal(1, candidate.call(\"x\"))\n assert_equal(9, candidate.call(\"asdasnakj\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "rb", - "prompt": "# You'll be given a string of words, and your task is to count the number\n# of boredoms. A boredom is a sentence that starts with the word \"I\".\n# Sentences are delimited by '.', '?' or '!'.\n# For example:\n# >>> is_bored.call(\"Hello world\")\n# 0\n# >>> is_bored.call(\"The sky is blue. The sun is shining. I love this weather\")\n# 1\ndef is_bored(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_bored\n candidate = method(:is_bored)\n assert_equal(0, candidate.call(\"Hello world\"))\n assert_equal(0, candidate.call(\"Is the sky blue?\"))\n assert_equal(1, candidate.call(\"I love It !\"))\n assert_equal(0, candidate.call(\"bIt\"))\n assert_equal(2, candidate.call(\"I feel good today. I will be productive. will kill It\"))\n assert_equal(0, candidate.call(\"You and I are going for a walk\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "rb", - "prompt": "# Write a function vowels_count which takes a string representing\n# a word as input and returns the number of vowels in the string.\n# Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n# vowel, but only when it is at the end of the given word.\n# Example:\n# >>> vowels_count.call(\"abcde\")\n# 2\n# >>> vowels_count.call(\"ACEDY\")\n# 3\ndef vowels_count(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_vowels_count\n candidate = method(:vowels_count)\n assert_equal(2, candidate.call(\"abcde\"))\n assert_equal(3, candidate.call(\"Alone\"))\n assert_equal(2, candidate.call(\"key\"))\n assert_equal(1, candidate.call(\"bye\"))\n assert_equal(2, candidate.call(\"keY\"))\n assert_equal(1, candidate.call(\"bYe\"))\n assert_equal(3, candidate.call(\"ACEDY\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "rb", - "prompt": "# Return n-th Fibonacci number.\n# >>> fib.call(10)\n# 55\n# >>> fib.call(1)\n# 1\n# >>> fib.call(8)\n# 21\ndef fib(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_fib\n candidate = method(:fib)\n assert_equal(55, candidate.call(10))\n assert_equal(1, candidate.call(1))\n assert_equal(21, candidate.call(8))\n assert_equal(89, candidate.call(11))\n assert_equal(144, candidate.call(12))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "rb", - "prompt": "# Your task is to implement a function that will simplify the expression\n# x * n. The function returns true if x * n evaluates to a whole number and false\n# otherwise. Both x and n, are string representation of a fraction, and have the following format,\n# / where both numerator and denominator are positive whole numbers.\n# You can assume that x, and n are valid fractions, and do not have zero as denominator.\n# >>> simplify.call(\"1/5\", \"5/1\")\n# true\n# >>> simplify.call(\"1/6\", \"2/1\")\n# false\n# >>> simplify.call(\"7/10\", \"10/2\")\n# false\ndef simplify(x, n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_simplify\n candidate = method(:simplify)\n assert_equal(true, candidate.call(\"1/5\", \"5/1\"))\n assert_equal(false, candidate.call(\"1/6\", \"2/1\"))\n assert_equal(true, candidate.call(\"5/1\", \"3/1\"))\n assert_equal(false, candidate.call(\"7/10\", \"10/2\"))\n assert_equal(true, candidate.call(\"2/10\", \"50/10\"))\n assert_equal(true, candidate.call(\"7/2\", \"4/2\"))\n assert_equal(true, candidate.call(\"11/6\", \"6/1\"))\n assert_equal(false, candidate.call(\"2/3\", \"5/2\"))\n assert_equal(false, candidate.call(\"5/2\", \"3/5\"))\n assert_equal(true, candidate.call(\"2/4\", \"8/4\"))\n assert_equal(true, candidate.call(\"2/4\", \"4/2\"))\n assert_equal(true, candidate.call(\"1/5\", \"5/1\"))\n assert_equal(false, candidate.call(\"1/5\", \"1/5\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "rb", - "prompt": "# Given a string s, count the number of uppercase vowels in even indices.\n# For example:\n# >>> count_upper.call(\"aBCdEf\")\n# 1\n# >>> count_upper.call(\"abcdefg\")\n# 0\n# >>> count_upper.call(\"dBBE\")\n# 0\ndef count_upper(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_count_upper\n candidate = method(:count_upper)\n assert_equal(1, candidate.call(\"aBCdEf\"))\n assert_equal(0, candidate.call(\"abcdefg\"))\n assert_equal(0, candidate.call(\"dBBE\"))\n assert_equal(0, candidate.call(\"B\"))\n assert_equal(1, candidate.call(\"U\"))\n assert_equal(0, candidate.call(\"\"))\n assert_equal(2, candidate.call(\"EEEE\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "rb", - "prompt": "# You are given a rectangular grid of wells. Each row represents a single well,\n# and each 1 in a row represents a single unit of water.\n# Each well has a corresponding bucket that can be used to extract water from it, \n# and all buckets have the same capacity.\n# Your task is to use the buckets to empty the wells.\n# Output the number of times you need to lower the buckets.\n# Example 1:\n# >>> max_fill.call([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1)\n# 6\n# Example 2:\n# >>> max_fill.call([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2)\n# 5\n# Example 3:\n# >>> max_fill.call([[0, 0, 0], [0, 0, 0]], 5)\n# 0\n# Constraints:\n# * all wells have the same length\n# * 1 <= grid.length <= 10^2\n# * 1 <= grid[:,1].length <= 10^2\n# * grid[i][j] -> 0 | 1\n# * 1 <= capacity <= 10\ndef max_fill(grid, capacity)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_max_fill\n candidate = method(:max_fill)\n assert_equal(6, candidate.call([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1))\n assert_equal(5, candidate.call([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2))\n assert_equal(0, candidate.call([[0, 0, 0], [0, 0, 0]], 5))\n assert_equal(4, candidate.call([[1, 1, 1, 1], [1, 1, 1, 1]], 2))\n assert_equal(2, candidate.call([[1, 1, 1, 1], [1, 1, 1, 1]], 9))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "rb", - "prompt": "# Given an array arr of integers and a positive integer k, return a sorted array \n# of length k with the maximum k numbers in arr.\n# Example 1:\n# >>> maximum.call([-3, -4, 5], 3)\n# [-4, -3, 5]\n# Example 2:\n# >>> maximum.call([4, -4, 4], 2)\n# [4, 4]\n# Example 3:\n# >>> maximum.call([-3, 2, 1, 2, -1, -2, 1], 1)\n# [2]\n# Note:\n# 1. The length of the array will be in the range of [1, 1000].\n# 2. The elements in the array will be in the range of [-1000, 1000].\n# 3. 0 <= k <= len(arr)\ndef maximum(arr, k)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_maximum\n candidate = method(:maximum)\n assert_equal([-4, -3, 5], candidate.call([-3, -4, 5], 3))\n assert_equal([4, 4], candidate.call([4, -4, 4], 2))\n assert_equal([2], candidate.call([-3, 2, 1, 2, -1, -2, 1], 1))\n assert_equal([2, 20, 123], candidate.call([123, -123, 20, 0, 1, 2, -3], 3))\n assert_equal([0, 1, 2, 20], candidate.call([-123, 20, 0, 1, 2, -3], 4))\n assert_equal([-13, -8, 0, 0, 3, 5, 15], candidate.call([5, 15, 0, 3, -13, -8, 0], 7))\n assert_equal([3, 5], candidate.call([-1, 0, 2, 5, 3, -10], 2))\n assert_equal([5], candidate.call([1, 0, 5, -7], 1))\n assert_equal([-4, 4], candidate.call([4, -4], 2))\n assert_equal([-10, 10], candidate.call([-10, 10], 2))\n assert_equal([], candidate.call([1, 2, 3, -23, 243, -400, 0], 0))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "rb", - "prompt": "# Write a function that takes a message, and encodes in such a \n# way that it swaps case of all letters, replaces all vowels in \n# the message with the letter that appears 2 places ahead of that \n# vowel in the english alphabet. \n# Assume only letters. \n# Examples:\n# >>> encode.call(\"test\")\n# \"TGST\"\n# >>> encode.call(\"This is a message\")\n# \"tHKS KS C MGSSCGG\"\ndef encode(message)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_encode\n candidate = method(:encode)\n assert_equal(\"tgst\", candidate.call(\"TEST\"))\n assert_equal(\"mWDCSKR\", candidate.call(\"Mudasir\"))\n assert_equal(\"ygs\", candidate.call(\"YES\"))\n assert_equal(\"tHKS KS C MGSSCGG\", candidate.call(\"This is a message\"))\n assert_equal(\"k dQnT kNqW wHcT Tq wRkTg\", candidate.call(\"I DoNt KnOw WhAt tO WrItE\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "rb", - "prompt": "# remove_vowels is a function that takes string and returns string without vowels.\n# >>> remove_vowels.call(\"\")\n# \"\"\n# >>> remove_vowels.call(\"abcdef\")\n# \"bcdf\"\n# >>> remove_vowels.call(\"aaaaa\")\n# \"\"\n# >>> remove_vowels.call(\"aaBAA\")\n# \"B\"\n# >>> remove_vowels.call(\"zbcd\")\n# \"zbcd\"\ndef remove_vowels(text)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_remove_vowels\n candidate = method(:remove_vowels)\n assert_equal(\"\", candidate.call(\"\"))\n assert_equal(\"bcdf\nghjklm\", candidate.call(\"abcdef\nghijklm\"))\n assert_equal(\"fdcb\", candidate.call(\"fedcba\"))\n assert_equal(\"\", candidate.call(\"eeeee\"))\n assert_equal(\"cB\", candidate.call(\"acBAA\"))\n assert_equal(\"cB\", candidate.call(\"EcBOO\"))\n assert_equal(\"ybcd\", candidate.call(\"ybcd\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "rb", - "prompt": "# Return only positive numbers in the array.\n# >>> get_positive.call([-1, 2, -4, 5, 6])\n# [2, 5, 6]\n# >>> get_positive.call([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n# [5, 3, 2, 3, 9, 123, 1]\ndef get_positive(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_get_positive\n candidate = method(:get_positive)\n assert_equal([4, 5, 6], candidate.call([-1, -2, 4, 5, 6]))\n assert_equal([5, 3, 2, 3, 3, 9, 123, 1], candidate.call([5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]))\n assert_equal([], candidate.call([-1, -2]))\n assert_equal([], candidate.call([]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "rb", - "prompt": "# Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n# >>> string_sequence.call(0)\n# \"0\"\n# >>> string_sequence.call(5)\n# \"0 1 2 3 4 5\"\ndef string_sequence(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_string_sequence\n candidate = method(:string_sequence)\n assert_equal(\"0\", candidate.call(0))\n assert_equal(\"0 1 2 3\", candidate.call(3))\n assert_equal(\"0 1 2 3 4 5 6 7 8 9 10\", candidate.call(10))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "rb", - "prompt": "# Given a positive integer n, you have to make a pile of n levels of stones.\n# The first level has n stones.\n# The number of stones in the next level is:\n# - the next odd number if n is odd.\n# - the next even number if n is even.\n# Return the number of stones in each level in an array, where element at index\n# i represents the number of stones in the level (i+1).\n# Examples:\n# >>> make_a_pile.call(3)\n# [3, 5, 7]\ndef make_a_pile(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_make_a_pile\n candidate = method(:make_a_pile)\n assert_equal([3, 5, 7], candidate.call(3))\n assert_equal([4, 6, 8, 10], candidate.call(4))\n assert_equal([5, 7, 9, 11, 13], candidate.call(5))\n assert_equal([6, 8, 10, 12, 14, 16], candidate.call(6))\n assert_equal([8, 10, 12, 14, 16, 18, 20, 22], candidate.call(8))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "rb", - "prompt": "# Task\n# 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\n# then check if the result string is palindrome.\n# A string is called palindrome if it reads the same backward as forward.\n# You should return an array containing the result string and true/false for the check.\n# Example\n# >>> reverse_delete.call(\"abcde\", \"ae\")\n# [\"bcd\", false]\n# >>> reverse_delete.call(\"abcdef\", \"b\")\n# [\"acdef\", false]\n# >>> reverse_delete.call(\"abcdedcba\", \"ab\")\n# [\"cdedc\", true]\ndef reverse_delete(s, c)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_reverse_delete\n candidate = method(:reverse_delete)\n assert_equal([\"bcd\", false], candidate.call(\"abcde\", \"ae\"))\n assert_equal([\"acdef\", false], candidate.call(\"abcdef\", \"b\"))\n assert_equal([\"cdedc\", true], candidate.call(\"abcdedcba\", \"ab\"))\n assert_equal([\"dik\", false], candidate.call(\"dwik\", \"w\"))\n assert_equal([\"\", true], candidate.call(\"a\", \"a\"))\n assert_equal([\"abcdedcba\", true], candidate.call(\"abcdedcba\", \"\"))\n assert_equal([\"abcdedcba\", true], candidate.call(\"abcdedcba\", \"v\"))\n assert_equal([\"abba\", true], candidate.call(\"vabba\", \"v\"))\n assert_equal([\"\", true], candidate.call(\"mamma\", \"mia\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "rb", - "prompt": "# For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n# >>> flip_case.call(\"Hello\")\n# \"hELLO\"\ndef flip_case(string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_flip_case\n candidate = method(:flip_case)\n assert_equal(\"\", candidate.call(\"\"))\n assert_equal(\"hELLO!\", candidate.call(\"Hello!\"))\n assert_equal(\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\", candidate.call(\"These violent delights have violent ends\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "rb", - "prompt": "# You are given a string s.\n# if s[i] is a letter, reverse its case from lower to upper or vise versa, \n# otherwise keep it as it is.\n# If the string contains no letters, reverse the string.\n# The function should return the resulted string.\n# Examples\n# >>> solve.call(\"1234\")\n# \"4321\"\n# >>> solve.call(\"ab\")\n# \"AB\"\n# >>> solve.call(\"#a@C\")\n# \"#A@c\"\ndef solve(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_solve\n candidate = method(:solve)\n assert_equal(\"aSdF\", candidate.call(\"AsDf\"))\n assert_equal(\"4321\", candidate.call(\"1234\"))\n assert_equal(\"AB\", candidate.call(\"ab\"))\n assert_equal(\"#A@c\", candidate.call(\"#a@C\"))\n assert_equal(\"#aSDFw^45\", candidate.call(\"#AsdfW^45\"))\n assert_equal(\"2@6#\", candidate.call(\"#6@2\"))\n assert_equal(\"#$A^d\", candidate.call(\"#$a^D\"))\n assert_equal(\"#CCC\", candidate.call(\"#ccc\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "rb", - "prompt": "# Filter an input array of strings only for ones that start with a given prefix.\n# >>> filter_by_prefix.call([], \"a\")\n# []\n# >>> filter_by_prefix.call([\"abc\", \"bcd\", \"cde\", \"array\"], \"a\")\n# [\"abc\", \"array\"]\ndef filter_by_prefix(strings, prefix)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_filter_by_prefix\n candidate = method(:filter_by_prefix)\n assert_equal([], candidate.call([], \"john\"))\n assert_equal([\"xxx\", \"xxxAAA\", \"xxx\"], candidate.call([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "rb", - "prompt": "# This function takes two positive numbers x and y and returns the\n# biggest even integer number that is in the range [x, y] inclusive. If \n# there's no such number, then the function should return -1.\n# For example:\n# >>> choose_num.call(12, 15)\n# 14\n# >>> choose_num.call(13, 12)\n# -1\ndef choose_num(x, y)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_choose_num\n candidate = method(:choose_num)\n assert_equal(14, candidate.call(12, 15))\n assert_equal(-1, candidate.call(13, 12))\n assert_equal(12354, candidate.call(33, 12354))\n assert_equal(-1, candidate.call(5234, 5233))\n assert_equal(28, candidate.call(6, 29))\n assert_equal(-1, candidate.call(27, 10))\n assert_equal(-1, candidate.call(7, 7))\n assert_equal(546, candidate.call(546, 546))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "rb", - "prompt": "# You are given a string representing a sentence,\n# the sentence contains some words separated by a space,\n# and you have to return a string that contains the words from the original sentence,\n# whose lengths are prime numbers,\n# the order of the words in the new string should be the same as the original one.\n# Example 1:\n# >>> words_in_sentence.call(\"This is a test\")\n# \"is\"\n# Example 2:\n# >>> words_in_sentence.call(\"lets go for swimming\")\n# \"go for\"\n# Constraints:\n# * 1 <= len(sentence) <= 100\n# * sentence contains only letters\ndef words_in_sentence(sentence)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_words_in_sentence\n candidate = method(:words_in_sentence)\n assert_equal(\"is\", candidate.call(\"This is a test\"))\n assert_equal(\"go for\", candidate.call(\"lets go for swimming\"))\n assert_equal(\"there is no place\", candidate.call(\"there is no place available here\"))\n assert_equal(\"Hi am Hussein\", candidate.call(\"Hi I am Hussein\"))\n assert_equal(\"go for it\", candidate.call(\"go for it\"))\n assert_equal(\"\", candidate.call(\"here\"))\n assert_equal(\"is\", candidate.call(\"here is\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "rb", - "prompt": "# Insert a number 'delimeter' between every two consecutive elements of input array `numbers'\n# >>> intersperse.call([], 4)\n# []\n# >>> intersperse.call([1, 2, 3], 4)\n# [1, 4, 2, 4, 3]\ndef intersperse(numbers, delimeter)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_intersperse\n candidate = method(:intersperse)\n assert_equal([], candidate.call([], 7))\n assert_equal([5, 8, 6, 8, 3, 8, 2], candidate.call([5, 6, 3, 2], 8))\n assert_equal([2, 2, 2, 2, 2], candidate.call([2, 2, 2], 2))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "rb", - "prompt": "# Your task is to write a function that returns true if a number x is a simple\n# power of n and false in other cases.\n# x is a simple power of n if n**int=x\n# For example:\n# >>> is_simple_power.call(1, 4)\n# true\n# >>> is_simple_power.call(2, 2)\n# true\n# >>> is_simple_power.call(8, 2)\n# true\n# >>> is_simple_power.call(3, 2)\n# false\n# >>> is_simple_power.call(3, 1)\n# false\n# >>> is_simple_power.call(5, 3)\n# false\ndef is_simple_power(x, n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_simple_power\n candidate = method(:is_simple_power)\n assert_equal(true, candidate.call(16, 2))\n assert_equal(false, candidate.call(143214, 16))\n assert_equal(true, candidate.call(4, 2))\n assert_equal(true, candidate.call(9, 3))\n assert_equal(true, candidate.call(16, 4))\n assert_equal(false, candidate.call(24, 2))\n assert_equal(false, candidate.call(128, 4))\n assert_equal(false, candidate.call(12, 6))\n assert_equal(true, candidate.call(1, 1))\n assert_equal(true, candidate.call(1, 12))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "rb", - "prompt": "# Write a function that returns true if the given number is the multiplication of 3 prime numbers\n# and false otherwise.\n# Knowing that (a) is less then 100. \n# Example:\n# >>> is_multiply_prime.call(30)\n# true\n# 30 = 2 * 3 * 5\ndef is_multiply_prime(a)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_multiply_prime\n candidate = method(:is_multiply_prime)\n assert_equal(false, candidate.call(5))\n assert_equal(true, candidate.call(30))\n assert_equal(true, candidate.call(8))\n assert_equal(false, candidate.call(10))\n assert_equal(true, candidate.call(125))\n assert_equal(true, candidate.call(105))\n assert_equal(false, candidate.call(126))\n assert_equal(false, candidate.call(729))\n assert_equal(false, candidate.call(891))\n assert_equal(true, candidate.call(1001))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "rb", - "prompt": "# Given the lengths of the three sides of a triangle. Return true if the three\n# sides form a right-angled triangle, false otherwise.\n# A right-angled triangle is a triangle in which one angle is right angle or \n# 90 degree.\n# Example:\n# >>> right_angle_triangle.call(3, 4, 5)\n# true\n# >>> right_angle_triangle.call(1, 2, 3)\n# false\ndef right_angle_triangle(a, b, c)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_right_angle_triangle\n candidate = method(:right_angle_triangle)\n assert_equal(true, candidate.call(3, 4, 5))\n assert_equal(false, candidate.call(1, 2, 3))\n assert_equal(true, candidate.call(10, 6, 8))\n assert_equal(false, candidate.call(2, 2, 2))\n assert_equal(true, candidate.call(7, 24, 25))\n assert_equal(false, candidate.call(10, 5, 7))\n assert_equal(true, candidate.call(5, 12, 13))\n assert_equal(true, candidate.call(15, 8, 17))\n assert_equal(true, candidate.call(48, 55, 73))\n assert_equal(false, candidate.call(1, 1, 1))\n assert_equal(false, candidate.call(2, 2, 10))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "rb", - "prompt": "# Create a function that takes 3 numbers.\n# Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n# Returns false in any other cases.\n# Examples\n# >>> any_int.call(5, 2, 7)\n# true\n# >>> any_int.call(3, 2, 2)\n# false\n# >>> any_int.call(3, -2, 1)\n# true\n# >>> any_int.call(3.6, -2.2, 2)\n# false\ndef any_int(x, y, z)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_any_int\n candidate = method(:any_int)\n assert_equal(true, candidate.call(2, 3, 1))\n assert_equal(false, candidate.call(2.5, 2, 3))\n assert_equal(false, candidate.call(1.5, 5, 3.5))\n assert_equal(false, candidate.call(2, 6, 2))\n assert_equal(true, candidate.call(4, 2, 2))\n assert_equal(false, candidate.call(2.2, 2.2, 2.2))\n assert_equal(true, candidate.call(-4, 6, 2))\n assert_equal(true, candidate.call(2, 1, 1))\n assert_equal(true, candidate.call(3, 4, 7))\n assert_equal(false, candidate.call(3.0, 4, 7))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "rb", - "prompt": "# This function takes an array l and returns an array l' such that\n# l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n# to the values of the corresponding indicies of l, but sorted.\n# >>> sort_third.call([1, 2, 3])\n# [1, 2, 3]\n# >>> sort_third.call([5, 6, 3, 4, 8, 9, 2])\n# [2, 6, 3, 4, 8, 9, 5]\ndef sort_third(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sort_third\n candidate = method(:sort_third)\n assert_equal([2, 6, 3, 4, 8, 9, 5], candidate.call([5, 6, 3, 4, 8, 9, 2]))\n assert_equal([2, 8, 3, 4, 6, 9, 5], candidate.call([5, 8, 3, 4, 6, 9, 2]))\n assert_equal([2, 6, 9, 4, 8, 3, 5], candidate.call([5, 6, 9, 4, 8, 3, 2]))\n assert_equal([2, 6, 3, 4, 8, 9, 5, 1], candidate.call([5, 6, 3, 4, 8, 9, 2, 1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_53_add", - "language": "rb", - "prompt": "# Add two numbers x and y\n# >>> add.call(2, 3)\n# 5\n# >>> add.call(5, 7)\n# 12\ndef add(x, y)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_add\n candidate = method(:add)\n assert_equal(1, candidate.call(0, 1))\n assert_equal(1, candidate.call(1, 0))\n assert_equal(5, candidate.call(2, 3))\n assert_equal(12, candidate.call(5, 7))\n assert_equal(12, candidate.call(7, 5))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_69_search", - "language": "rb", - "prompt": "# You are given a non-empty array of positive integers. Return the greatest integer that is greater than \n# zero, and has a frequency greater than or equal to the value of the integer itself. \n# The frequency of an integer is the number of times it appears in the array.\n# If no such a value exist, return -1.\n# Examples:\n# >>> search.call([4, 1, 2, 2, 3, 1])\n# 2\n# >>> search.call([1, 2, 2, 3, 3, 3, 4, 4, 4])\n# 3\n# >>> search.call([5, 5, 4, 4, 4])\n# -1\ndef search(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_search\n candidate = method(:search)\n assert_equal(1, candidate.call([5, 5, 5, 5, 1]))\n assert_equal(4, candidate.call([4, 1, 4, 1, 4, 4]))\n assert_equal(-1, candidate.call([3, 3]))\n assert_equal(8, candidate.call([8, 8, 8, 8, 8, 8, 8, 8]))\n assert_equal(2, candidate.call([2, 3, 3, 2, 2]))\n assert_equal(1, candidate.call([2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]))\n assert_equal(2, candidate.call([3, 2, 8, 2]))\n assert_equal(1, candidate.call([6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]))\n assert_equal(-1, candidate.call([8, 8, 3, 6, 5, 6, 4]))\n assert_equal(1, candidate.call([6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]))\n assert_equal(1, candidate.call([1, 9, 10, 1, 3]))\n assert_equal(5, candidate.call([6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]))\n assert_equal(1, candidate.call([1]))\n assert_equal(4, candidate.call([8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]))\n assert_equal(2, candidate.call([2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]))\n assert_equal(1, candidate.call([1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]))\n assert_equal(4, candidate.call([9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]))\n assert_equal(4, candidate.call([2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]))\n assert_equal(2, candidate.call([9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]))\n assert_equal(-1, candidate.call([5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]))\n assert_equal(-1, candidate.call([10]))\n assert_equal(2, candidate.call([9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]))\n assert_equal(1, candidate.call([5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]))\n assert_equal(1, candidate.call([7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]))\n assert_equal(-1, candidate.call([3, 10, 10, 9, 2]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "rb", - "prompt": "# Write a function that takes a string and returns true if the string\n# length is a prime number or false otherwise\n# Examples\n# >>> prime_length.call(\"Hello\")\n# true\n# >>> prime_length.call(\"abcdcba\")\n# true\n# >>> prime_length.call(\"kittens\")\n# true\n# >>> prime_length.call(\"orange\")\n# false\ndef prime_length(string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_prime_length\n candidate = method(:prime_length)\n assert_equal(true, candidate.call(\"Hello\"))\n assert_equal(true, candidate.call(\"abcdcba\"))\n assert_equal(true, candidate.call(\"kittens\"))\n assert_equal(false, candidate.call(\"orange\"))\n assert_equal(true, candidate.call(\"wow\"))\n assert_equal(true, candidate.call(\"world\"))\n assert_equal(true, candidate.call(\"MadaM\"))\n assert_equal(true, candidate.call(\"Wow\"))\n assert_equal(false, candidate.call(\"\"))\n assert_equal(true, candidate.call(\"HI\"))\n assert_equal(true, candidate.call(\"go\"))\n assert_equal(false, candidate.call(\"gogo\"))\n assert_equal(false, candidate.call(\"aaaaaaaaaaaaaaa\"))\n assert_equal(true, candidate.call(\"Madam\"))\n assert_equal(false, candidate.call(\"M\"))\n assert_equal(false, candidate.call(\"0\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_58_common", - "language": "rb", - "prompt": "# Return sorted unique common elements for two arrays.\n# >>> common.call([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n# [1, 5, 653]\n# >>> common.call([5, 3, 2, 8], [3, 2])\n# [2, 3]\ndef common(l1, l2)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_common\n candidate = method(:common)\n assert_equal([1, 5, 653], candidate.call([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]))\n assert_equal([2, 3], candidate.call([5, 3, 2, 8], [3, 2]))\n assert_equal([2, 3, 4], candidate.call([4, 3, 2, 8], [3, 2, 4]))\n assert_equal([], candidate.call([4, 3, 2, 8], []))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "rb", - "prompt": "# The Brazilian factorial is defined as:\n# brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n# where n > 0\n# For example:\n# >>> special_factorial.call(4)\n# 288\n# The function will receive an integer as input and should return the special\n# factorial of this integer.\ndef special_factorial(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_special_factorial\n candidate = method(:special_factorial)\n assert_equal(288, candidate.call(4))\n assert_equal(34560, candidate.call(5))\n assert_equal(125411328000, candidate.call(7))\n assert_equal(1, candidate.call(1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "rb", - "prompt": "# In this problem, you will implement a function that takes two arrays of numbers,\n# and determines whether it is possible to perform an exchange of elements\n# between them to make lst1 an array of only even numbers.\n# There is no limit on the number of exchanged elements between lst1 and lst2.\n# If it is possible to exchange elements between the lst1 and lst2 to make\n# all the elements of lst1 to be even, return \"YES\".\n# Otherwise, return \"NO\".\n# For example:\n# >>> exchange.call([1, 2, 3, 4], [1, 2, 3, 4])\n# \"YES\"\n# >>> exchange.call([1, 2, 3, 4], [1, 5, 3, 4])\n# \"NO\"\n# It is assumed that the input arrays will be non-empty.\ndef exchange(lst1, lst2)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_exchange\n candidate = method(:exchange)\n assert_equal(\"YES\", candidate.call([1, 2, 3, 4], [1, 2, 3, 4]))\n assert_equal(\"NO\", candidate.call([1, 2, 3, 4], [1, 5, 3, 4]))\n assert_equal(\"YES\", candidate.call([1, 2, 3, 4], [2, 1, 4, 3]))\n assert_equal(\"YES\", candidate.call([5, 7, 3], [2, 6, 4]))\n assert_equal(\"NO\", candidate.call([5, 7, 3], [2, 6, 3]))\n assert_equal(\"NO\", candidate.call([3, 2, 6, 1, 8, 9], [3, 5, 5, 1, 1, 1]))\n assert_equal(\"YES\", candidate.call([100, 200], [200, 200]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "rb", - "prompt": "# Given a non-empty array of integers arr and an integer k, return\n# the sum of the elements with at most two digits from the first k elements of arr.\n# Example:\n# >>> add_elements.call([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4)\n# 24\n# Constraints:\n# 1. 1 <= len(arr) <= 100\n# 2. 1 <= k <= len(arr)\ndef add_elements(arr, k)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_add_elements\n candidate = method(:add_elements)\n assert_equal(-4, candidate.call([1, -2, -3, 41, 57, 76, 87, 88, 99], 3))\n assert_equal(0, candidate.call([111, 121, 3, 4000, 5, 6], 2))\n assert_equal(125, candidate.call([11, 21, 3, 90, 5, 6, 7, 8, 9], 4))\n assert_equal(24, candidate.call([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4))\n assert_equal(1, candidate.call([1], 1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "rb", - "prompt": "# A simple program which should return the value of x if n is \n# a prime number and should return the value of y otherwise.\n# Examples:\n# >>> x_or_y.call(7, 34, 12)\n# 34\n# >>> x_or_y.call(15, 8, 5)\n# 5\ndef x_or_y(n, x, y)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_x_or_y\n candidate = method(:x_or_y)\n assert_equal(34, candidate.call(7, 34, 12))\n assert_equal(5, candidate.call(15, 8, 5))\n assert_equal(33, candidate.call(3, 33, 5212))\n assert_equal(3, candidate.call(1259, 3, 52))\n assert_equal(-1, candidate.call(7919, -1, 12))\n assert_equal(583, candidate.call(3609, 1245, 583))\n assert_equal(129, candidate.call(91, 56, 129))\n assert_equal(1234, candidate.call(6, 34, 1234))\n assert_equal(0, candidate.call(1, 2, 0))\n assert_equal(2, candidate.call(2, 2, 0))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "rb", - "prompt": "# Given length of a side and high return area for a triangle.\n# >>> triangle_area.call(5, 3)\n# 7.5\ndef triangle_area(a, h)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_triangle_area\n candidate = method(:triangle_area)\n assert_equal(7.5, candidate.call(5, 3))\n assert_equal(2.0, candidate.call(2, 2))\n assert_equal(40.0, candidate.call(10, 8))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "rb", - "prompt": "# Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n# the last couple centuries. However, what people don't know is Tribonacci sequence.\n# Tribonacci sequence is defined by the recurrence:\n# tri(1) = 3\n# tri(n) = 1 + n / 2, if n is even.\n# tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n# For example:\n# tri(2) = 1 + (2 / 2) = 2\n# tri(4) = 3\n# tri(3) = tri(2) + tri(1) + tri(4)\n# = 2 + 3 + 3 = 8 \n# You are given a non-negative integer number n, you have to a return an array of the \n# first n + 1 numbers of the Tribonacci sequence.\n# Examples:\n# >>> tri.call(3)\n# [1, 3, 2, 8]\ndef tri(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_tri\n candidate = method(:tri)\n assert_equal([1, 3, 2, 8], candidate.call(3))\n assert_equal([1, 3, 2, 8, 3], candidate.call(4))\n assert_equal([1, 3, 2, 8, 3, 15], candidate.call(5))\n assert_equal([1, 3, 2, 8, 3, 15, 4], candidate.call(6))\n assert_equal([1, 3, 2, 8, 3, 15, 4, 24], candidate.call(7))\n assert_equal([1, 3, 2, 8, 3, 15, 4, 24, 5], candidate.call(8))\n assert_equal([1, 3, 2, 8, 3, 15, 4, 24, 5, 35], candidate.call(9))\n assert_equal([1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11], candidate.call(20))\n assert_equal([1], candidate.call(0))\n assert_equal([1, 3], candidate.call(1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "rb", - "prompt": "# You are given an array of two strings, both strings consist of open\n# parentheses '(' or close parentheses ')' only.\n# Your job is to check if it is possible to concatenate the two strings in\n# some order, that the resulting string will be good.\n# A string S is considered to be good if and only if all parentheses in S\n# are balanced. For example: the string '(())()' is good, while the string\n# '())' is not.\n# Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n# Examples:\n# >>> match_parens.call([\"()(\", \")\"])\n# \"Yes\"\n# >>> match_parens.call([\")\", \")\"])\n# \"No\"\ndef match_parens(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_match_parens\n candidate = method(:match_parens)\n assert_equal(\"Yes\", candidate.call([\"()(\", \")\"]))\n assert_equal(\"No\", candidate.call([\")\", \")\"]))\n assert_equal(\"No\", candidate.call([\"(()(())\", \"())())\"]))\n assert_equal(\"Yes\", candidate.call([\")())\", \"(()()(\"]))\n assert_equal(\"Yes\", candidate.call([\"(())))\", \"(()())((\"]))\n assert_equal(\"No\", candidate.call([\"()\", \"())\"]))\n assert_equal(\"Yes\", candidate.call([\"(()(\", \"()))()\"]))\n assert_equal(\"No\", candidate.call([\"((((\", \"((())\"]))\n assert_equal(\"No\", candidate.call([\")(()\", \"(()(\"]))\n assert_equal(\"No\", candidate.call([\")(\", \")(\"]))\n assert_equal(\"Yes\", candidate.call([\"(\", \")\"]))\n assert_equal(\"Yes\", candidate.call([\")\", \"(\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "rb", - "prompt": "# From an array of integers, remove all elements that occur more than once.\n# Keep order of elements left the same as in the input.\n# >>> remove_duplicates.call([1, 2, 3, 2, 4])\n# [1, 3, 4]\ndef remove_duplicates(numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_remove_duplicates\n candidate = method(:remove_duplicates)\n assert_equal([], candidate.call([]))\n assert_equal([1, 2, 3, 4], candidate.call([1, 2, 3, 4]))\n assert_equal([1, 4, 5], candidate.call([1, 2, 3, 2, 4, 3, 5]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "rb", - "prompt": "# Return a greatest common divisor of two integers a and b\n# >>> greatest_common_divisor.call(3, 5)\n# 1\n# >>> greatest_common_divisor.call(25, 15)\n# 5\ndef greatest_common_divisor(a, b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_greatest_common_divisor\n candidate = method(:greatest_common_divisor)\n assert_equal(1, candidate.call(3, 7))\n assert_equal(5, candidate.call(10, 15))\n assert_equal(7, candidate.call(49, 14))\n assert_equal(12, candidate.call(144, 60))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "rb", - "prompt": "# Checks if given string is a palindrome\n# >>> is_palindrome.call(\"\")\n# true\n# >>> is_palindrome.call(\"aba\")\n# true\n# >>> is_palindrome.call(\"aaaaa\")\n# true\n# >>> is_palindrome.call(\"zbcd\")\n# false\ndef is_palindrome(text)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_palindrome\n candidate = method(:is_palindrome)\n assert_equal(true, candidate.call(\"\"))\n assert_equal(true, candidate.call(\"aba\"))\n assert_equal(true, candidate.call(\"aaaaa\"))\n assert_equal(false, candidate.call(\"zbcd\"))\n assert_equal(true, candidate.call(\"xywyx\"))\n assert_equal(false, candidate.call(\"xywyz\"))\n assert_equal(false, candidate.call(\"xywzx\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "rb", - "prompt": "# xs represent coefficients of a polynomial.\n# xs[0] + xs[1] * x + xs[2] * x^2 + ....\n# Return derivative of this polynomial in the same form.\n# >>> derivative.call([3, 1, 2, 4, 5])\n# [1, 4, 12, 20]\n# >>> derivative.call([1, 2, 3])\n# [2, 6]\ndef derivative(xs)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_derivative\n candidate = method(:derivative)\n assert_equal([1, 4, 12, 20], candidate.call([3, 1, 2, 4, 5]))\n assert_equal([2, 6], candidate.call([1, 2, 3]))\n assert_equal([2, 2], candidate.call([3, 2, 1]))\n assert_equal([2, 2, 0, 16], candidate.call([3, 2, 1, 0, 4]))\n assert_equal([], candidate.call([1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "rb", - "prompt": "# In this task, you will be given a string that represents a number of apples and oranges \n# that are distributed in a basket of fruit this basket contains \n# apples, oranges, and mango fruits. Given the string that represents the total number of \n# the oranges and apples and an integer that represent the total number of the fruits \n# in the basket return the number of the mango fruits in the basket.\n# for examble:\n# >>> fruit_distribution.call(\"5 apples and 6 oranges\", 19)\n# 8\n# >>> fruit_distribution.call(\"0 apples and 1 oranges\", 3)\n# 2\n# >>> fruit_distribution.call(\"2 apples and 3 oranges\", 100)\n# 95\n# >>> fruit_distribution.call(\"100 apples and 1 oranges\", 120)\n# 19\ndef fruit_distribution(s, n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_fruit_distribution\n candidate = method(:fruit_distribution)\n assert_equal(8, candidate.call(\"5 apples and 6 oranges\", 19))\n assert_equal(10, candidate.call(\"5 apples and 6 oranges\", 21))\n assert_equal(2, candidate.call(\"0 apples and 1 oranges\", 3))\n assert_equal(2, candidate.call(\"1 apples and 0 oranges\", 3))\n assert_equal(95, candidate.call(\"2 apples and 3 oranges\", 100))\n assert_equal(0, candidate.call(\"2 apples and 3 oranges\", 5))\n assert_equal(19, candidate.call(\"1 apples and 100 oranges\", 120))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "rb", - "prompt": "# Write a function that takes an integer a and returns true \n# if this ingeger is a cube of some integer number.\n# Note: you may assume the input is always valid.\n# Examples:\n# >>> iscube.call(1)\n# true\n# >>> iscube.call(2)\n# false\n# >>> iscube.call(-1)\n# true\n# >>> iscube.call(64)\n# true\n# >>> iscube.call(0)\n# true\n# >>> iscube.call(180)\n# false\ndef iscube(a)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_iscube\n candidate = method(:iscube)\n assert_equal(true, candidate.call(1))\n assert_equal(false, candidate.call(2))\n assert_equal(true, candidate.call(-1))\n assert_equal(true, candidate.call(64))\n assert_equal(false, candidate.call(180))\n assert_equal(true, candidate.call(1000))\n assert_equal(true, candidate.call(0))\n assert_equal(false, candidate.call(1729))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "rb", - "prompt": "# In this Kata, you have to sort an array of non-negative integers according to\n# number of ones in their binary representation in ascending order.\n# For similar number of ones, sort based on decimal value.\n# It must be implemented like this:\n# >>> sort_array.call([1, 5, 2, 3, 4])\n# [1, 2, 3, 4, 5]\n# >>> sort_array.call([-2, -3, -4, -5, -6])\n# [-6, -5, -4, -3, -2]\n# >>> sort_array.call([1, 0, 2, 3, 4])\n# [0, 1, 2, 3, 4]\ndef sort_array(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sort_array\n candidate = method(:sort_array)\n assert_equal([1, 2, 4, 3, 5], candidate.call([1, 5, 2, 3, 4]))\n assert_equal([-4, -2, -6, -5, -3], candidate.call([-2, -3, -4, -5, -6]))\n assert_equal([0, 1, 2, 4, 3], candidate.call([1, 0, 2, 3, 4]))\n assert_equal([], candidate.call([]))\n assert_equal([2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77], candidate.call([2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]))\n assert_equal([32, 3, 5, 6, 12, 44], candidate.call([3, 6, 44, 12, 32, 5]))\n assert_equal([2, 4, 8, 16, 32], candidate.call([2, 4, 8, 16, 32]))\n assert_equal([2, 4, 8, 16, 32], candidate.call([2, 4, 8, 16, 32]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "rb", - "prompt": "# Given an array of strings, where each string consists of only digits, return an array.\n# Each element i of the output should be \"the number of odd elements in the\n# string i of the input.\" where all the i's should be replaced by the number\n# of odd digits in the i'th string of the input.\n# >>> odd_count.call([\"1234567\"])\n# [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n# >>> odd_count.call([\"3\", \"11111111\"])\n# [\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\ndef odd_count(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_odd_count\n candidate = method(:odd_count)\n assert_equal([\"the number of odd elements 4n the str4ng 4 of the 4nput.\"], candidate.call([\"1234567\"]))\n assert_equal([\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\"], candidate.call([\"3\", \"11111111\"]))\n assert_equal([\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"], candidate.call([\"271\", \"137\", \"314\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "rb", - "prompt": "# brackets is a string of \"(\" and \")\".\n# return true if every opening bracket has a corresponding closing bracket.\n# >>> correct_bracketing.call(\"(\")\n# false\n# >>> correct_bracketing.call(\"()\")\n# true\n# >>> correct_bracketing.call(\"(()())\")\n# true\n# >>> correct_bracketing.call(\")(()\")\n# false\ndef correct_bracketing(brackets)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_correct_bracketing\n candidate = method(:correct_bracketing)\n assert_equal(true, candidate.call(\"()\"))\n assert_equal(true, candidate.call(\"(()())\"))\n assert_equal(true, candidate.call(\"()()(()())()\"))\n assert_equal(true, candidate.call(\"()()((()()())())(()()(()))\"))\n assert_equal(false, candidate.call(\"((()())))\"))\n assert_equal(false, candidate.call(\")(()\"))\n assert_equal(false, candidate.call(\"(\"))\n assert_equal(false, candidate.call(\"((((\"))\n assert_equal(false, candidate.call(\")\"))\n assert_equal(false, candidate.call(\"(()\"))\n assert_equal(false, candidate.call(\"()()(()())())(()\"))\n assert_equal(false, candidate.call(\"()()(()())()))()\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "rb", - "prompt": "# Task\n# Write a function that takes a string as input and returns the sum of the upper characters only'\n# ASCII codes.\n# Examples:\n# >>> digitSum.call(\"\")\n# 0\n# >>> digitSum.call(\"abAB\")\n# 131\n# >>> digitSum.call(\"abcCd\")\n# 67\n# >>> digitSum.call(\"helloE\")\n# 69\n# >>> digitSum.call(\"woArBld\")\n# 131\n# >>> digitSum.call(\"aAaaaXa\")\n# 153\ndef digitSum(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_digitSum\n candidate = method(:digitSum)\n assert_equal(0, candidate.call(\"\"))\n assert_equal(131, candidate.call(\"abAB\"))\n assert_equal(67, candidate.call(\"abcCd\"))\n assert_equal(69, candidate.call(\"helloE\"))\n assert_equal(131, candidate.call(\"woArBld\"))\n assert_equal(153, candidate.call(\"aAaaaXa\"))\n assert_equal(151, candidate.call(\" How are yOu?\"))\n assert_equal(327, candidate.call(\"You arE Very Smart\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "rb", - "prompt": "# Write a function that accepts an array of strings as a parameter,\n# deletes the strings that have odd lengths from it,\n# and returns the resulted array with a sorted order,\n# The array is always an array of strings and never an array of numbers,\n# and it may contain duplicates.\n# The order of the array should be ascending by length of each word, and you\n# should return the array sorted by that rule.\n# If two words have the same length, sort the array alphabetically.\n# The function should return an array of strings in sorted order.\n# You may assume that all words will have the same length.\n# For example:\n# >>> list_sort.call([\"aa\", \"a\", \"aaa\"])\n# [\"aa\"]\n# >>> list_sort.call([\"ab\", \"a\", \"aaa\", \"cd\"])\n# [\"ab\", \"cd\"]\ndef sorted_list_sum(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sorted_list_sum\n candidate = method(:sorted_list_sum)\n assert_equal([\"aa\"], candidate.call([\"aa\", \"a\", \"aaa\"]))\n assert_equal([\"AI\", \"asdf\", \"school\"], candidate.call([\"school\", \"AI\", \"asdf\", \"b\"]))\n assert_equal([], candidate.call([\"d\", \"b\", \"c\", \"a\"]))\n assert_equal([\"abcd\", \"dcba\"], candidate.call([\"d\", \"dcba\", \"abcd\", \"a\"]))\n assert_equal([\"AI\", \"ai\", \"au\"], candidate.call([\"AI\", \"ai\", \"au\"]))\n assert_equal([], candidate.call([\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"]))\n assert_equal([\"cc\", \"dd\", \"aaaa\", \"bbbb\"], candidate.call([\"aaaa\", \"bbbb\", \"dd\", \"cc\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "rb", - "prompt": "# You are given an array arr of integers and you need to return\n# sum of magnitudes of integers multiplied by product of all signs\n# of each number in the array, represented by 1, -1 or 0.\n# Note: return nil for empty arr.\n# Example:\n# >>> prod_signs.call([1, 2, 2, -4])\n# 9\n# >>> prod_signs.call([0, 1])\n# 0\n# >>> prod_signs.call([])\n# nil\ndef prod_signs(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_prod_signs\n candidate = method(:prod_signs)\n assert_equal(-9, candidate.call([1, 2, 2, -4]))\n assert_equal(0, candidate.call([0, 1]))\n assert_equal(-10, candidate.call([1, 1, 1, 2, 3, -1, 1]))\n assert_equal(nil, candidate.call([]))\n assert_equal(20, candidate.call([2, 4, 1, 2, -1, -1, 9]))\n assert_equal(4, candidate.call([-1, 1, -1, 1]))\n assert_equal(-4, candidate.call([-1, 1, 1, 1]))\n assert_equal(0, candidate.call([-1, 1, 1, 0]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "rb", - "prompt": "# Return array with elements incremented by 1.\n# >>> incr_list.call([1, 2, 3])\n# [2, 3, 4]\n# >>> incr_list.call([5, 3, 5, 2, 3, 3, 9, 0, 123])\n# [6, 4, 6, 3, 4, 4, 10, 1, 124]\ndef incr_list(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_incr_list\n candidate = method(:incr_list)\n assert_equal([], candidate.call([]))\n assert_equal([4, 3, 2], candidate.call([3, 2, 1]))\n assert_equal([6, 3, 6, 3, 4, 4, 10, 1, 124], candidate.call([5, 2, 5, 2, 3, 3, 9, 0, 123]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "rb", - "prompt": "# From a given array of integers, generate an array of rolling maximum element found until given moment\n# in the sequence.\n# >>> rolling_max.call([1, 2, 3, 2, 3, 4, 2])\n# [1, 2, 3, 3, 3, 4, 4]\ndef rolling_max(numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_rolling_max\n candidate = method(:rolling_max)\n assert_equal([], candidate.call([]))\n assert_equal([1, 2, 3, 4], candidate.call([1, 2, 3, 4]))\n assert_equal([4, 4, 4, 4], candidate.call([4, 3, 2, 1]))\n assert_equal([3, 3, 3, 100, 100], candidate.call([3, 2, 3, 100, 3]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "rb", - "prompt": "# Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n# separate those group into separate strings and return the array of those.\n# Separate groups are balanced (each open brace is properly closed) and not nested within each other\n# Ignore any spaces in the input string.\n# >>> separate_paren_groups.call(\"( ) (( )) (( )( ))\")\n# [\"()\", \"(())\", \"(()())\"]\ndef separate_paren_groups(paren_string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_separate_paren_groups\n candidate = method(:separate_paren_groups)\n assert_equal([\"(()())\", \"((()))\", \"()\", \"((())()())\"], candidate.call(\"(()()) ((())) () ((())()())\"))\n assert_equal([\"()\", \"(())\", \"((()))\", \"(((())))\"], candidate.call(\"() (()) ((())) (((())))\"))\n assert_equal([\"(()(())((())))\"], candidate.call(\"(()(())((())))\"))\n assert_equal([\"()\", \"(())\", \"(()())\"], candidate.call(\"( ) (( )) (( )( ))\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "rb", - "prompt": "# You will be given a string of words separated by commas or spaces. Your task is\n# to split the string into words and return an array of the words.\n# For example:\n# >>> words_string.call(\"Hi, my name is John\")\n# [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n# >>> words_string.call(\"One, two, three, four, five, six\")\n# [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\ndef words_string(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_words_string\n candidate = method(:words_string)\n assert_equal([\"Hi\", \"my\", \"name\", \"is\", \"John\"], candidate.call(\"Hi, my name is John\"))\n assert_equal([\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"], candidate.call(\"One, two, three, four, five, six\"))\n assert_equal([\"Hi\", \"my\", \"name\"], candidate.call(\"Hi, my name\"))\n assert_equal([\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"], candidate.call(\"One,, two, three, four, five, six,\"))\n assert_equal([], candidate.call(\"\"))\n assert_equal([\"ahmed\", \"gamal\"], candidate.call(\"ahmed , gamal\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "rb", - "prompt": "# Create a function that takes integers, floats, or strings representing\n# real numbers, and returns the larger variable in its given variable type.\n# Return nil if the values are equal.\n# Note: If a real number is represented as a string, the floating point might be . or ,\n# >>> compare_one.call(1, 2.5)\n# 2.5\n# >>> compare_one.call(1, \"2,3\")\n# \"2,3\"\n# >>> compare_one.call(\"5,1\", \"6\")\n# \"6\"\n# >>> compare_one.call(\"1\", 1)\n# nil\ndef compare_one(a, b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_compare_one\n candidate = method(:compare_one)\n assert_equal(2, candidate.call(1, 2))\n assert_equal(2.5, candidate.call(1, 2.5))\n assert_equal(3, candidate.call(2, 3))\n assert_equal(6, candidate.call(5, 6))\n assert_equal(\"2,3\", candidate.call(1, \"2,3\"))\n assert_equal(\"6\", candidate.call(\"5,1\", \"6\"))\n assert_equal(\"2\", candidate.call(\"1\", \"2\"))\n assert_equal(nil, candidate.call(\"1\", 1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "rb", - "prompt": "# Filter given array of any rbthon values only for integers\n# >>> filter_integers.call([\"a\", 3.14, 5])\n# [5]\n# >>> filter_integers.call([1, 2, 3, \"abc\", {}, []])\n# [1, 2, 3]\ndef filter_integers(values)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_filter_integers\n candidate = method(:filter_integers)\n assert_equal([], candidate.call([]))\n assert_equal([4, 9], candidate.call([4, {}, [], 23.2, 9, \"adasd\"]))\n assert_equal([3, 3, 3], candidate.call([3, \"c\", 3, 3, \"a\", \"b\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "rb", - "prompt": "# This function takes an array l and returns an array l' such that\n# l' is identical to l in the odd indicies, while its values at the even indicies are equal\n# to the values of the even indicies of l, but sorted.\n# >>> sort_even.call([1, 2, 3])\n# [1, 2, 3]\n# >>> sort_even.call([5, 6, 3, 4])\n# [3, 6, 5, 4]\ndef sort_even(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sort_even\n candidate = method(:sort_even)\n assert_equal([1, 2, 3], candidate.call([1, 2, 3]))\n assert_equal([-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123], candidate.call([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]))\n assert_equal([-12, 8, 3, 4, 5, 2, 12, 11, 23, -10], candidate.call([5, 8, -12, 4, 23, 2, 3, 11, 12, -10]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "rb", - "prompt": "# I think we all remember that feeling when the result of some long-awaited\n# event is finally known. The feelings and thoughts you have at that moment are\n# definitely worth noting down and comparing.\n# Your task is to determine if a person correctly guessed the results of a number of matches.\n# You are given two arrays of scores and guesses of equal length, where each index shows a match. \n# Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n# the value is 0, and if not, the value is the absolute difference between the guess and the score.\n# example:\n# >>> compare.call([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2])\n# [0, 0, 0, 0, 3, 3]\n# >>> compare.call([0, 5, 0, 0, 0, 4], [4, 1, 1, 0, 0, -2])\n# [4, 4, 1, 0, 0, 6]\ndef compare(game, guess)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_compare\n candidate = method(:compare)\n assert_equal([0, 0, 0, 0, 3, 3], candidate.call([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2]))\n assert_equal([0, 0, 0, 0, 0, 0], candidate.call([0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]))\n assert_equal([2, 4, 6], candidate.call([1, 2, 3], [-1, -2, -3]))\n assert_equal([2, 0, 0, 1], candidate.call([1, 2, 3, 5], [-1, 2, 3, 4]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "rb", - "prompt": "# Given a positive integer n, return an array that has the number of even and odd\n# integer palindromes that fall within the range(1, n), inclusive.\n# Example 1:\n# >>> even_odd_palindrome.call(3)\n# [1, 2]\n# Explanation:\n# Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n# Example 2:\n# >>> even_odd_palindrome.call(12)\n# [4, 6]\n# Explanation:\n# Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n# Note:\n# 1. 1 <= n <= 10^3\n# 2. returned array has the number of even and odd integer palindromes respectively.\ndef even_odd_palindrome(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_even_odd_palindrome\n candidate = method(:even_odd_palindrome)\n assert_equal([8, 13], candidate.call(123))\n assert_equal([4, 6], candidate.call(12))\n assert_equal([1, 2], candidate.call(3))\n assert_equal([6, 8], candidate.call(63))\n assert_equal([5, 6], candidate.call(25))\n assert_equal([4, 6], candidate.call(19))\n assert_equal([4, 5], candidate.call(9))\n assert_equal([0, 1], candidate.call(1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "rb", - "prompt": "# The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fib4(0) -> 0\n# fib4(1) -> 0\n# fib4(2) -> 2\n# fib4(3) -> 0\n# fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n# Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n# >>> fib4.call(5)\n# 4\n# >>> fib4.call(6)\n# 8\n# >>> fib4.call(7)\n# 14\ndef fib4(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_fib4\n candidate = method(:fib4)\n assert_equal(4, candidate.call(5))\n assert_equal(28, candidate.call(8))\n assert_equal(104, candidate.call(10))\n assert_equal(386, candidate.call(12))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "rb", - "prompt": "# Given two positive integers a and b, return the even digits between a\n# and b, in ascending order.\n# For example:\n# >>> generate_integers.call(2, 8)\n# [2, 4, 6, 8]\n# >>> generate_integers.call(8, 2)\n# [2, 4, 6, 8]\n# >>> generate_integers.call(10, 14)\n# []\ndef generate_integers(a, b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_generate_integers\n candidate = method(:generate_integers)\n assert_equal([2, 4, 6, 8], candidate.call(2, 10))\n assert_equal([2, 4, 6, 8], candidate.call(10, 2))\n assert_equal([2, 4, 6, 8], candidate.call(132, 2))\n assert_equal([], candidate.call(17, 89))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "rb", - "prompt": "# For a given array of input numbers, calculate Mean Absolute Deviation\n# around the mean of this dataset.\n# Mean Absolute Deviation is the average absolute difference between each\n# element and a centerpoint (mean in this case):\n# MAD = average | x - x_mean |\n# >>> mean_absolute_deviation.call([1.0, 2.0, 3.0, 4.0])\n# 1.0\ndef mean_absolute_deviation(numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_mean_absolute_deviation\n candidate = method(:mean_absolute_deviation)\n assert_equal(0.5, candidate.call([1.0, 2.0]))\n assert_equal(1.0, candidate.call([1.0, 2.0, 3.0, 4.0]))\n assert_equal(1.2, candidate.call([1.0, 2.0, 3.0, 4.0, 5.0]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "rb", - "prompt": "# Create a function encrypt that takes a string as an argument and\n# returns a string encrypted with the alphabet being rotated. \n# The alphabet should be rotated in a manner such that the letters \n# shift down by two multiplied to two places.\n# For example:\n# >>> encrypt.call(\"hi\")\n# \"lm\"\n# >>> encrypt.call(\"asdfghjkl\")\n# \"ewhjklnop\"\n# >>> encrypt.call(\"gf\")\n# \"kj\"\n# >>> encrypt.call(\"et\")\n# \"ix\"\ndef encrypt(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_encrypt\n candidate = method(:encrypt)\n assert_equal(\"lm\", candidate.call(\"hi\"))\n assert_equal(\"ewhjklnop\", candidate.call(\"asdfghjkl\"))\n assert_equal(\"kj\", candidate.call(\"gf\"))\n assert_equal(\"ix\", candidate.call(\"et\"))\n assert_equal(\"jeiajeaijeiak\", candidate.call(\"faewfawefaewg\"))\n assert_equal(\"lippsqcjvmirh\", candidate.call(\"hellomyfriend\"))\n assert_equal(\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\", candidate.call(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\"))\n assert_equal(\"e\", candidate.call(\"a\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "rb", - "prompt": "# Given a positive integer n, return a sorted array that has the odd numbers in collatz sequence.\n# The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n# as follows: start with any positive integer n. Then each term is obtained from the \n# previous term as follows: if the previous term is even, the next term is one half of \n# the previous term. If the previous term is odd, the next term is 3 times the previous\n# term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n# Note: \n# 1. Collatz(1) is [1].\n# 2. returned array sorted in increasing order.\n# For example:\n# get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n# >>> get_odd_collatz.call(5)\n# [1, 5]\ndef get_odd_collatz(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_get_odd_collatz\n candidate = method(:get_odd_collatz)\n assert_equal([1, 5, 7, 11, 13, 17], candidate.call(14))\n assert_equal([1, 5], candidate.call(5))\n assert_equal([1, 3, 5], candidate.call(12))\n assert_equal([1], candidate.call(1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "rb", - "prompt": "# Find how many times a given substring can be found in the original string. Count overlaping cases.\n# >>> how_many_times.call(\"\", \"a\")\n# 0\n# >>> how_many_times.call(\"aaa\", \"a\")\n# 3\n# >>> how_many_times.call(\"aaaa\", \"aa\")\n# 3\ndef how_many_times(string, substring)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_how_many_times\n candidate = method(:how_many_times)\n assert_equal(0, candidate.call(\"\", \"x\"))\n assert_equal(4, candidate.call(\"xyxyxyx\", \"x\"))\n assert_equal(4, candidate.call(\"cacacacac\", \"cac\"))\n assert_equal(1, candidate.call(\"john doe\", \"john\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "rb", - "prompt": "# We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n# numbers in the array will be randomly ordered. Your task is to determine if\n# it is possible to get an array sorted in non-decreasing order by performing \n# the following operation on the given array:\n# You are allowed to perform right shift operation any number of times.\n# One right shift operation means shifting all elements of the array by one\n# position in the right direction. The last element of the array will be moved to\n# the starting position in the array i.e. 0th index. \n# If it is possible to obtain the sorted array by performing the above operation\n# then return true else return false.\n# If the given array is empty then return true.\n# Note: The given array is guaranteed to have unique elements.\n# For Example:\n# >>> move_one_ball.call([3, 4, 5, 1, 2])\n# true\n# Explanation: By performin 2 right shift operations, non-decreasing order can\n# be achieved for the given array.\n# >>> move_one_ball.call([3, 5, 4, 1, 2])\n# false\n# Explanation:It is not possible to get non-decreasing order for the given\n# array by performing any number of right shift operations.\ndef move_one_ball(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_move_one_ball\n candidate = method(:move_one_ball)\n assert_equal(true, candidate.call([3, 4, 5, 1, 2]))\n assert_equal(true, candidate.call([3, 5, 10, 1, 2]))\n assert_equal(false, candidate.call([4, 3, 1, 2]))\n assert_equal(false, candidate.call([3, 5, 4, 1, 2]))\n assert_equal(true, candidate.call([]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "rb", - "prompt": "# Write a function which sorts the given array of integers\n# in ascending order according to the sum of their digits.\n# Note: if there are several items with similar sum of their digits,\n# order them based on their index in original array.\n# For example:\n# >>> order_by_points.call([1, 11, -1, -11, -12])\n# [-1, -11, 1, -12, 11]\n# >>> order_by_points.call([])\n# []\ndef order_by_points(nums)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_order_by_points\n candidate = method(:order_by_points)\n assert_equal([-1, -11, 1, -12, 11], candidate.call([1, 11, -1, -11, -12]))\n assert_equal([0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457], candidate.call([1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]))\n assert_equal([], candidate.call([]))\n assert_equal([-3, -32, -98, -11, 1, 2, 43, 54], candidate.call([1, -11, -32, 43, 54, -98, 2, -3]))\n assert_equal([1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9], candidate.call([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]))\n assert_equal([-76, -21, 0, 4, 23, 6, 6], candidate.call([0, 6, 6, -76, -21, 23, 4]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "rb", - "prompt": "# Return array of prime factors of given integer in the order from smallest to largest.\n# Each of the factors should be arrayed number of times corresponding to how many times it appeares in factorization.\n# Input number should be equal to the product of all factors\n# >>> factorize.call(8)\n# [2, 2, 2]\n# >>> factorize.call(25)\n# [5, 5]\n# >>> factorize.call(70)\n# [2, 5, 7]\ndef factorize(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_factorize\n candidate = method(:factorize)\n assert_equal([2], candidate.call(2))\n assert_equal([2, 2], candidate.call(4))\n assert_equal([2, 2, 2], candidate.call(8))\n assert_equal([3, 19], candidate.call(57))\n assert_equal([3, 3, 19, 19], candidate.call(3249))\n assert_equal([3, 3, 3, 19, 19, 19], candidate.call(185193))\n assert_equal([3, 19, 19, 19], candidate.call(20577))\n assert_equal([2, 3, 3], candidate.call(18))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "rb", - "prompt": "# Return true if all numbers in the array l are below threshold t.\n# >>> below_threshold.call([1, 2, 4, 10], 100)\n# true\n# >>> below_threshold.call([1, 20, 4, 10], 5)\n# false\ndef below_threshold(l, t)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_below_threshold\n candidate = method(:below_threshold)\n assert_equal(true, candidate.call([1, 2, 4, 10], 100))\n assert_equal(false, candidate.call([1, 20, 4, 10], 5))\n assert_equal(true, candidate.call([1, 20, 4, 10], 21))\n assert_equal(true, candidate.call([1, 20, 4, 10], 22))\n assert_equal(true, candidate.call([1, 8, 4, 10], 11))\n assert_equal(false, candidate.call([1, 8, 4, 10], 10))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "rb", - "prompt": "# You are given two positive integers n and m, and your task is to compute the\n# average of the integers from n through m (including n and m). \n# Round the answer to the nearest integer and convert that to binary.\n# If n is greater than m, return -1.\n# Example:\n# >>> rounded_avg.call(1, 5)\n# \"0b11\"\n# >>> rounded_avg.call(7, 5)\n# -1\n# >>> rounded_avg.call(10, 20)\n# \"0b1111\"\n# >>> rounded_avg.call(20, 33)\n# \"0b11010\"\ndef rounded_avg(n, m)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_rounded_avg\n candidate = method(:rounded_avg)\n assert_equal(\"0b11\", candidate.call(1, 5))\n assert_equal(\"0b1010\", candidate.call(7, 13))\n assert_equal(\"0b1111001010\", candidate.call(964, 977))\n assert_equal(\"0b1111100100\", candidate.call(996, 997))\n assert_equal(\"0b1011000010\", candidate.call(560, 851))\n assert_equal(\"0b101101110\", candidate.call(185, 546))\n assert_equal(\"0b110101101\", candidate.call(362, 496))\n assert_equal(\"0b1001110010\", candidate.call(350, 902))\n assert_equal(\"0b11010111\", candidate.call(197, 233))\n assert_equal(-1, candidate.call(7, 5))\n assert_equal(-1, candidate.call(5, 1))\n assert_equal(\"0b101\", candidate.call(5, 5))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "rb", - "prompt": "# Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n# For each of the group, output the deepest level of nesting of parentheses.\n# E.g. (()()) has maximum two levels of nesting while ((())) has three.\n# >>> parse_nested_parens.call(\"(()()) ((())) () ((())()())\")\n# [2, 3, 1, 3]\ndef parse_nested_parens(paren_string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_parse_nested_parens\n candidate = method(:parse_nested_parens)\n assert_equal([2, 3, 1, 3], candidate.call(\"(()()) ((())) () ((())()())\"))\n assert_equal([1, 2, 3, 4], candidate.call(\"() (()) ((())) (((())))\"))\n assert_equal([4], candidate.call(\"(()(())((())))\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "rb", - "prompt": "# Given a non-empty array of integers, return the sum of all of the odd elements that are in even positions.\n# Examples\n# >>> solution.call([5, 8, 7, 1])\n# 12\n# >>> solution.call([3, 3, 3, 3, 3])\n# 9\n# >>> solution.call([30, 13, 24, 321])\n# 0\ndef solution(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_solution\n candidate = method(:solution)\n assert_equal(12, candidate.call([5, 8, 7, 1]))\n assert_equal(9, candidate.call([3, 3, 3, 3, 3]))\n assert_equal(0, candidate.call([30, 13, 24, 321]))\n assert_equal(5, candidate.call([5, 9]))\n assert_equal(0, candidate.call([2, 4, 8]))\n assert_equal(23, candidate.call([30, 13, 23, 32]))\n assert_equal(3, candidate.call([3, 13, 2, 9]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "rb", - "prompt": "# You are given a positive integer n. You have to create an integer array a of length n.\n# For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n# Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n# and a[i] + a[j] + a[k] is a multiple of 3.\n# Example :\n# >>> get_max_triples.call(5)\n# 1\n# Explanation: \n# a = [1, 3, 7, 13, 21]\n# The only valid triple is (1, 7, 13).\ndef get_max_triples(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_get_max_triples\n candidate = method(:get_max_triples)\n assert_equal(1, candidate.call(5))\n assert_equal(4, candidate.call(6))\n assert_equal(36, candidate.call(10))\n assert_equal(53361, candidate.call(100))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "rb", - "prompt": "# There are eight planets in our solar system: the closerst to the Sun \n# is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n# Uranus, Neptune.\n# Write a function that takes two planet names as strings planet1 and planet2. \n# The function should return an array containing all planets whose orbits are \n# located between the orbit of planet1 and the orbit of planet2, sorted by \n# the proximity to the sun. \n# The function should return an empty array if planet1 or planet2\n# are not correct planet names. \n# Examples\n# >>> bf.call(\"Jupiter\", \"Neptune\")\n# [\"Saturn\", \"Uranus\"]\n# >>> bf.call(\"Earth\", \"Mercury\")\n# \"Venus\"\n# >>> bf.call(\"Mercury\", \"Uranus\")\n# [\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"]\ndef bf(planet1, planet2)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_bf\n candidate = method(:bf)\n assert_equal([\"Saturn\", \"Uranus\"], candidate.call(\"Jupiter\", \"Neptune\"))\n assert_equal([\"Venus\"], candidate.call(\"Earth\", \"Mercury\"))\n assert_equal([\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"], candidate.call(\"Mercury\", \"Uranus\"))\n assert_equal([\"Earth\", \"Mars\", \"Jupiter\", \"Saturn\", \"Uranus\"], candidate.call(\"Neptune\", \"Venus\"))\n assert_equal([], candidate.call(\"Earth\", \"Earth\"))\n assert_equal([], candidate.call(\"Mars\", \"Earth\"))\n assert_equal([], candidate.call(\"Jupiter\", \"Makemake\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "rb", - "prompt": "# You are given an array of integers.\n# Write a function next_smallest() that returns the 2nd smallest element of the array.\n# Return nil if there is no such element.\n# >>> next_smallest.call([1, 2, 3, 4, 5])\n# 2\n# >>> next_smallest.call([5, 1, 4, 3, 2])\n# 2\n# >>> next_smallest.call([])\n# nil\n# >>> next_smallest.call([1, 1])\n# nil\ndef next_smallest(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_next_smallest\n candidate = method(:next_smallest)\n assert_equal(2, candidate.call([1, 2, 3, 4, 5]))\n assert_equal(2, candidate.call([5, 1, 4, 3, 2]))\n assert_equal(nil, candidate.call([]))\n assert_equal(nil, candidate.call([1, 1]))\n assert_equal(1, candidate.call([1, 1, 1, 1, 0]))\n assert_equal(nil, candidate.call([1, 1]))\n assert_equal(-35, candidate.call([-35, 34, 12, -45]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "rb", - "prompt": "# Input is a space-delimited string of numberals from 'zero' to 'nine'.\n# Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n# Return the string with numbers sorted from smallest to largest\n# >>> sort_numbers.call(\"three one five\")\n# \"one three five\"\ndef sort_numbers(numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sort_numbers\n candidate = method(:sort_numbers)\n assert_equal(\"\", candidate.call(\"\"))\n assert_equal(\"three\", candidate.call(\"three\"))\n assert_equal(\"three five nine\", candidate.call(\"three five nine\"))\n assert_equal(\"zero four five seven eight nine\", candidate.call(\"five zero four seven nine eight\"))\n assert_equal(\"zero one two three four five six\", candidate.call(\"six five four three two one zero\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "rb", - "prompt": "# You are given 2 words. You need to return true if the second word or any of its rotations is a substring in the first word\n# >>> cycpattern_check.call(\"abcd\", \"abd\")\n# false\n# >>> cycpattern_check.call(\"hello\", \"ell\")\n# true\n# >>> cycpattern_check.call(\"whassup\", \"psus\")\n# false\n# >>> cycpattern_check.call(\"abab\", \"baa\")\n# true\n# >>> cycpattern_check.call(\"efef\", \"eeff\")\n# false\n# >>> cycpattern_check.call(\"himenss\", \"simen\")\n# true\ndef cycpattern_check(a, b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_cycpattern_check\n candidate = method(:cycpattern_check)\n assert_equal(false, candidate.call(\"xyzw\", \"xyw\"))\n assert_equal(true, candidate.call(\"yello\", \"ell\"))\n assert_equal(false, candidate.call(\"whattup\", \"ptut\"))\n assert_equal(true, candidate.call(\"efef\", \"fee\"))\n assert_equal(false, candidate.call(\"abab\", \"aabb\"))\n assert_equal(true, candidate.call(\"winemtt\", \"tinem\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "rb", - "prompt": "# You will be given a number in decimal form and your task is to convert it to\n# binary format. The function should return a string, with each character representing a binary\n# number. Each character in the string will be '0' or '1'.\n# There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n# The extra characters are there to help with the format.\n# Examples:\n# >>> decimal_to_binary.call(15)\n# \"db1111db\"\n# >>> decimal_to_binary.call(32)\n# \"db100000db\"\ndef decimal_to_binary(decimal)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_decimal_to_binary\n candidate = method(:decimal_to_binary)\n assert_equal(\"db0db\", candidate.call(0))\n assert_equal(\"db100000db\", candidate.call(32))\n assert_equal(\"db1100111db\", candidate.call(103))\n assert_equal(\"db1111db\", candidate.call(15))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "rb", - "prompt": "# Filter an input array of strings only for ones that contain given substring\n# >>> filter_by_substring.call([], \"a\")\n# []\n# >>> filter_by_substring.call([\"abc\", \"bacd\", \"cde\", \"array\"], \"a\")\n# [\"abc\", \"bacd\", \"array\"]\ndef filter_by_substring(strings, substring)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_filter_by_substring\n candidate = method(:filter_by_substring)\n assert_equal([], candidate.call([], \"john\"))\n assert_equal([\"xxx\", \"xxxAAA\", \"xxx\"], candidate.call([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"))\n assert_equal([\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"], candidate.call([\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xx\"))\n assert_equal([\"grunt\", \"prune\"], candidate.call([\"grunt\", \"trumpet\", \"prune\", \"gruesome\"], \"run\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "rb", - "prompt": "# Given an integer. return an array that has the number of even and odd digits respectively.\n# Example:\n# >>> even_odd_count.call(-12)\n# [1, 1]\n# >>> even_odd_count.call(123)\n# [1, 2]\ndef even_odd_count(num)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_even_odd_count\n candidate = method(:even_odd_count)\n assert_equal([0, 1], candidate.call(7))\n assert_equal([1, 1], candidate.call(-78))\n assert_equal([2, 2], candidate.call(3452))\n assert_equal([3, 3], candidate.call(346211))\n assert_equal([3, 3], candidate.call(-345821))\n assert_equal([1, 0], candidate.call(-2))\n assert_equal([2, 3], candidate.call(-45347))\n assert_equal([1, 0], candidate.call(0))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "rb", - "prompt": "# Write a function that accepts an array of strings.\n# The array contains different words. Return the word with maximum number\n# of unique characters. If multiple strings have maximum number of unique\n# characters, return the one which comes first in lexicographical order.\n# >>> find_max.call([\"name\", \"of\", \"string\"])\n# \"string\"\n# >>> find_max.call([\"name\", \"enam\", \"game\"])\n# \"enam\"\n# >>> find_max.call([\"aaaaaaa\", \"bb\", \"cc\"])\n# \"aaaaaaa\"\ndef find_max(words)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_find_max\n candidate = method(:find_max)\n assert_equal(\"string\", candidate.call([\"name\", \"of\", \"string\"]))\n assert_equal(\"enam\", candidate.call([\"name\", \"enam\", \"game\"]))\n assert_equal(\"aaaaaaa\", candidate.call([\"aaaaaaa\", \"bb\", \"cc\"]))\n assert_equal(\"abc\", candidate.call([\"abc\", \"cba\"]))\n assert_equal(\"footbott\", candidate.call([\"play\", \"this\", \"game\", \"of\", \"footbott\"]))\n assert_equal(\"gonna\", candidate.call([\"we\", \"are\", \"gonna\", \"rock\"]))\n assert_equal(\"nation\", candidate.call([\"we\", \"are\", \"a\", \"mad\", \"nation\"]))\n assert_equal(\"this\", candidate.call([\"this\", \"is\", \"a\", \"prrk\"]))\n assert_equal(\"b\", candidate.call([\"b\"]))\n assert_equal(\"play\", candidate.call([\"play\", \"play\", \"play\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "rb", - "prompt": "# Given a positive integer n, return the count of the numbers of n-digit\n# positive integers that start or end with 1.\ndef starts_one_ends(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_starts_one_ends\n candidate = method(:starts_one_ends)\n assert_equal(1, candidate.call(1))\n assert_equal(18, candidate.call(2))\n assert_equal(180, candidate.call(3))\n assert_equal(1800, candidate.call(4))\n assert_equal(18000, candidate.call(5))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "rb", - "prompt": "# Create a function that returns an array (a, b), where 'a' is\n# the largest of negative integers, and 'b' is the smallest\n# of positive integers in an array.\n# If there is no negative or positive integers, return them as nil.\n# Examples:\n# >>> largest_smallest_integers.call([2, 4, 1, 3, 5, 7])\n# [nil, 1]\n# >>> largest_smallest_integers.call([])\n# [nil, nil]\n# >>> largest_smallest_integers.call([0])\n# [nil, nil]\ndef largest_smallest_integers(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_largest_smallest_integers\n candidate = method(:largest_smallest_integers)\n assert_equal([nil, 1], candidate.call([2, 4, 1, 3, 5, 7]))\n assert_equal([nil, 1], candidate.call([2, 4, 1, 3, 5, 7, 0]))\n assert_equal([-2, 1], candidate.call([1, 3, 2, 4, 5, 6, -2]))\n assert_equal([-7, 2], candidate.call([4, 5, 3, 6, 2, 7, -7]))\n assert_equal([-9, 2], candidate.call([7, 3, 8, 4, 9, 2, 5, -9]))\n assert_equal([nil, nil], candidate.call([]))\n assert_equal([nil, nil], candidate.call([0]))\n assert_equal([-1, nil], candidate.call([-1, -3, -5, -6]))\n assert_equal([-1, nil], candidate.call([-1, -3, -5, -6, 0]))\n assert_equal([-3, 1], candidate.call([-6, -4, -4, -3, 1]))\n assert_equal([-3, 1], candidate.call([-6, -4, -4, -3, -100, 1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "rb", - "prompt": "# \"Given an array representing a branch of a tree that has non-negative integer nodes\n# your task is to pluck one of the nodes and return it.\n# The plucked node should be the node with the smallest even value.\n# If multiple nodes with the same smallest even value are found return the node that has smallest index.\n# The plucked node should be returned in an array, [ smalest_value, its index ],\n# If there are no even values or the given array is empty, return [].\n# Example 1:\n# >>> pluck.call([4, 2, 3])\n# [2, 1]\n# Explanation: 2 has the smallest even value, and 2 has the smallest index.\n# Example 2:\n# >>> pluck.call([1, 2, 3])\n# [2, 1]\n# Explanation: 2 has the smallest even value, and 2 has the smallest index.\n# Example 3:\n# >>> pluck.call([])\n# []\n# Example 4:\n# >>> pluck.call([5, 0, 3, 0, 4, 2])\n# [0, 1]\n# Explanation: 0 is the smallest value, but there are two zeros,\n# so we will choose the first zero, which has the smallest index.\n# Constraints:\n# * 1 <= nodes.length <= 10000\n# * 0 <= node.value\ndef pluck(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_pluck\n candidate = method(:pluck)\n assert_equal([2, 1], candidate.call([4, 2, 3]))\n assert_equal([2, 1], candidate.call([1, 2, 3]))\n assert_equal([], candidate.call([]))\n assert_equal([0, 1], candidate.call([5, 0, 3, 0, 4, 2]))\n assert_equal([0, 3], candidate.call([1, 2, 3, 0, 5, 3]))\n assert_equal([4, 1], candidate.call([5, 4, 8, 4, 8]))\n assert_equal([6, 1], candidate.call([7, 6, 7, 1]))\n assert_equal([], candidate.call([7, 9, 7, 1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "rb", - "prompt": "# Write a function count_nums which takes an array of integers and returns\n# the number of elements which has a sum of digits > 0.\n# If a number is negative, then its first signed digit will be negative:\n# e.g. -123 has signed digits -1, 2, and 3.\n# >>> count_nums.call([])\n# 0\n# >>> count_nums.call([-1, 11, -11])\n# 1\n# >>> count_nums.call([1, 1, 2])\n# 3\ndef count_nums(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_count_nums\n candidate = method(:count_nums)\n assert_equal(0, candidate.call([]))\n assert_equal(0, candidate.call([-1, -2, 0]))\n assert_equal(6, candidate.call([1, 1, 2, -2, 3, 4, 5]))\n assert_equal(5, candidate.call([1, 6, 9, -6, 0, 1, 5]))\n assert_equal(4, candidate.call([1, 100, 98, -7, 1, -1]))\n assert_equal(5, candidate.call([12, 23, 34, -45, -56, 0]))\n assert_equal(1, candidate.call([0, 1]))\n assert_equal(1, candidate.call([1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "rb", - "prompt": "# Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n# each cell of the grid contains a value. Every integer in the range [1, N * N]\n# inclusive appears exactly once on the cells of the grid.\n# You have to find the minimum path of length k in the grid. You can start\n# from any cell, and in each step you can move to any of the neighbor cells,\n# in other words, you can go to cells which share an edge with you current\n# cell.\n# Please note that a path of length k means visiting exactly k cells (not\n# necessarily distinct).\n# You CANNOT go off the grid.\n# A path A (of length k) is considered less than a path B (of length k) if\n# after making the ordered arrays of the values on the cells that A and B go\n# through (let's call them lst_A and lst_B), lst_A is lexicographically less\n# than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n# such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n# lst_A[j] = lst_B[j].\n# It is guaranteed that the answer is unique.\n# Return an ordered array of the values on the cells that the minimum path go through.\n# Examples: \n# >>> minPath.call([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3)\n# [1, 2, 1]\n# >>> minPath.call([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1)\n# [1]\ndef minPath(grid, k)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_minPath\n candidate = method(:minPath)\n assert_equal([1, 2, 1], candidate.call([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3))\n assert_equal([1], candidate.call([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1))\n assert_equal([1, 2, 1, 2], candidate.call([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], 4))\n assert_equal([1, 10, 1, 10, 1, 10, 1], candidate.call([[6, 4, 13, 10], [5, 7, 12, 1], [3, 16, 11, 15], [8, 14, 9, 2]], 7))\n assert_equal([1, 7, 1, 7, 1], candidate.call([[8, 14, 9, 2], [6, 4, 13, 15], [5, 7, 1, 12], [3, 10, 11, 16]], 5))\n assert_equal([1, 6, 1, 6, 1, 6, 1, 6, 1], candidate.call([[11, 8, 7, 2], [5, 16, 14, 4], [9, 3, 15, 6], [12, 13, 10, 1]], 9))\n assert_equal([1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6], candidate.call([[12, 13, 10, 1], [9, 3, 15, 6], [5, 16, 14, 4], [11, 8, 7, 2]], 12))\n assert_equal([1, 3, 1, 3, 1, 3, 1, 3], candidate.call([[2, 7, 4], [3, 1, 5], [6, 8, 9]], 8))\n assert_equal([1, 5, 1, 5, 1, 5, 1, 5], candidate.call([[6, 1, 5], [3, 8, 9], [2, 7, 4]], 8))\n assert_equal([1, 2, 1, 2, 1, 2, 1, 2, 1, 2], candidate.call([[1, 2], [3, 4]], 10))\n assert_equal([1, 3, 1, 3, 1, 3, 1, 3, 1, 3], candidate.call([[1, 3], [3, 2]], 10))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "rb", - "prompt": "# Given array of integers, return array in strange order.\n# Strange sorting, is when you start with the minimum value,\n# then maximum of the remaining integers, then minimum and so on.\n# Examples:\n# >>> strange_sort_list.call([1, 2, 3, 4])\n# [1, 4, 2, 3]\n# >>> strange_sort_list.call([5, 5, 5, 5])\n# [5, 5, 5, 5]\n# >>> strange_sort_list.call([])\n# []\ndef strange_sort_list(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_strange_sort_list\n candidate = method(:strange_sort_list)\n assert_equal([1, 4, 2, 3], candidate.call([1, 2, 3, 4]))\n assert_equal([5, 9, 6, 8, 7], candidate.call([5, 6, 7, 8, 9]))\n assert_equal([1, 5, 2, 4, 3], candidate.call([1, 2, 3, 4, 5]))\n assert_equal([1, 9, 5, 8, 6, 7], candidate.call([5, 6, 7, 8, 9, 1]))\n assert_equal([5, 5, 5, 5], candidate.call([5, 5, 5, 5]))\n assert_equal([], candidate.call([]))\n assert_equal([1, 8, 2, 7, 3, 6, 4, 5], candidate.call([1, 2, 3, 4, 5, 6, 7, 8]))\n assert_equal([-5, 5, -5, 5, 0, 2, 2, 2], candidate.call([0, 2, 2, 2, 5, 5, -5, -5]))\n assert_equal([111111], candidate.call([111111]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "rb", - "prompt": "# Given a string 'text', return its md5 hash equivalent string.\n# If 'text' is an empty string, return nil.\n# >>> string_to_md5.call(\"Hello world\")\n# \"3e25960a79dbc69b674cd4ec67a72c62\"\ndef string_to_md5(text)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_string_to_md5\n candidate = method(:string_to_md5)\n assert_equal(\"3e25960a79dbc69b674cd4ec67a72c62\", candidate.call(\"Hello world\"))\n assert_equal(nil, candidate.call(\"\"))\n assert_equal(\"0ef78513b0cb8cef12743f5aeb35f888\", candidate.call(\"A B C\"))\n assert_equal(\"5f4dcc3b5aa765d61d8327deb882cf99\", candidate.call(\"password\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "rb", - "prompt": "# You are given a word. Your task is to find the closest vowel that stands between \n# two consonants from the right side of the word (case sensitive).\n# Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n# find any vowel met the above condition. \n# You may assume that the given string contains English letter only.\n# Example:\n# >>> get_closest_vowel.call(\"yogurt\")\n# \"u\"\n# >>> get_closest_vowel.call(\"FULL\")\n# \"U\"\n# >>> get_closest_vowel.call(\"quick\")\n# \"\"\n# >>> get_closest_vowel.call(\"ab\")\n# \"\"\ndef get_closest_vowel(word)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_get_closest_vowel\n candidate = method(:get_closest_vowel)\n assert_equal(\"u\", candidate.call(\"yogurt\"))\n assert_equal(\"u\", candidate.call(\"full\"))\n assert_equal(\"\", candidate.call(\"easy\"))\n assert_equal(\"\", candidate.call(\"eAsy\"))\n assert_equal(\"\", candidate.call(\"ali\"))\n assert_equal(\"a\", candidate.call(\"bad\"))\n assert_equal(\"o\", candidate.call(\"most\"))\n assert_equal(\"\", candidate.call(\"ab\"))\n assert_equal(\"\", candidate.call(\"ba\"))\n assert_equal(\"\", candidate.call(\"quick\"))\n assert_equal(\"i\", candidate.call(\"anime\"))\n assert_equal(\"\", candidate.call(\"Asia\"))\n assert_equal(\"o\", candidate.call(\"Above\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "rb", - "prompt": "# Change numerical base of input number x to base.\n# return string representation after the conversion.\n# base numbers are less than 10.\n# >>> change_base.call(8, 3)\n# \"22\"\n# >>> change_base.call(8, 2)\n# \"1000\"\n# >>> change_base.call(7, 2)\n# \"111\"\ndef change_base(x, base)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_change_base\n candidate = method(:change_base)\n assert_equal(\"22\", candidate.call(8, 3))\n assert_equal(\"100\", candidate.call(9, 3))\n assert_equal(\"11101010\", candidate.call(234, 2))\n assert_equal(\"10000\", candidate.call(16, 2))\n assert_equal(\"1000\", candidate.call(8, 2))\n assert_equal(\"111\", candidate.call(7, 2))\n assert_equal(\"2\", candidate.call(2, 3))\n assert_equal(\"3\", candidate.call(3, 4))\n assert_equal(\"4\", candidate.call(4, 5))\n assert_equal(\"5\", candidate.call(5, 6))\n assert_equal(\"6\", candidate.call(6, 7))\n assert_equal(\"7\", candidate.call(7, 8))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "rb", - "prompt": "# Check if in given array of numbers, are any two numbers closer to each other than\n# given threshold.\n# >>> has_close_elements.call([1.0, 2.0, 3.0], 0.5)\n# false\n# >>> has_close_elements.call([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n# true\ndef has_close_elements(numbers, threshold)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_has_close_elements\n candidate = method(:has_close_elements)\n assert_equal(true, candidate.call([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3))\n assert_equal(false, candidate.call([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05))\n assert_equal(true, candidate.call([1.0, 2.0, 5.9, 4.0, 5.0], 0.95))\n assert_equal(false, candidate.call([1.0, 2.0, 5.9, 4.0, 5.0], 0.8))\n assert_equal(true, candidate.call([1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1))\n assert_equal(true, candidate.call([1.1, 2.2, 3.1, 4.1, 5.1], 1.0))\n assert_equal(false, candidate.call([1.1, 2.2, 3.1, 4.1, 5.1], 0.5))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "rb", - "prompt": "# Create a function that takes a string as input which contains only square brackets.\n# The function should return true if and only if there is a valid subsequence of brackets \n# where at least one bracket in the subsequence is nested.\n# >>> is_nested.call(\"[[]]\")\n# true\n# >>> is_nested.call(\"[]]]]]]][[[[[]\")\n# false\n# >>> is_nested.call(\"[][]\")\n# false\n# >>> is_nested.call(\"[]\")\n# false\n# >>> is_nested.call(\"[[][]]\")\n# true\n# >>> is_nested.call(\"[[]][[\")\n# true\ndef is_nested(string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_nested\n candidate = method(:is_nested)\n assert_equal(true, candidate.call(\"[[]]\"))\n assert_equal(false, candidate.call(\"[]]]]]]][[[[[]\"))\n assert_equal(false, candidate.call(\"[][]\"))\n assert_equal(false, candidate.call(\"[]\"))\n assert_equal(true, candidate.call(\"[[[[]]]]\"))\n assert_equal(false, candidate.call(\"[]]]]]]]]]]\"))\n assert_equal(true, candidate.call(\"[][][[]]\"))\n assert_equal(false, candidate.call(\"[[]\"))\n assert_equal(false, candidate.call(\"[]]\"))\n assert_equal(true, candidate.call(\"[[]][[\"))\n assert_equal(true, candidate.call(\"[[][]]\"))\n assert_equal(false, candidate.call(\"\"))\n assert_equal(false, candidate.call(\"[[[[[[[[\"))\n assert_equal(false, candidate.call(\"]]]]]]]]\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "rb", - "prompt": "# Concatenate array of strings into a single string\n# >>> concatenate.call([])\n# \"\"\n# >>> concatenate.call([\"a\", \"b\", \"c\"])\n# \"abc\"\ndef concatenate(strings)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_concatenate\n candidate = method(:concatenate)\n assert_equal(\"\", candidate.call([]))\n assert_equal(\"xyz\", candidate.call([\"x\", \"y\", \"z\"]))\n assert_equal(\"xyzwk\", candidate.call([\"x\", \"y\", \"z\", \"w\", \"k\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "rb", - "prompt": "# prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n# >>> prime_fib.call(1)\n# 2\n# >>> prime_fib.call(2)\n# 3\n# >>> prime_fib.call(3)\n# 5\n# >>> prime_fib.call(4)\n# 13\n# >>> prime_fib.call(5)\n# 89\ndef prime_fib(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_prime_fib\n candidate = method(:prime_fib)\n assert_equal(2, candidate.call(1))\n assert_equal(3, candidate.call(2))\n assert_equal(5, candidate.call(3))\n assert_equal(13, candidate.call(4))\n assert_equal(89, candidate.call(5))\n assert_equal(233, candidate.call(6))\n assert_equal(1597, candidate.call(7))\n assert_equal(28657, candidate.call(8))\n assert_equal(514229, candidate.call(9))\n assert_equal(433494437, candidate.call(10))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "rb", - "prompt": "# From a supplied array of numbers (of length at least two) select and return two that are the closest to each\n# other and return them in order (smaller number, larger number).\n# >>> find_closest_elements.call([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n# [2.0, 2.2]\n# >>> find_closest_elements.call([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n# [2.0, 2.0]\ndef find_closest_elements(numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_find_closest_elements\n candidate = method(:find_closest_elements)\n assert_equal([3.9, 4.0], candidate.call([1.0, 2.0, 3.9, 4.0, 5.0, 2.2]))\n assert_equal([5.0, 5.9], candidate.call([1.0, 2.0, 5.9, 4.0, 5.0]))\n assert_equal([2.0, 2.2], candidate.call([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]))\n assert_equal([2.0, 2.0], candidate.call([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]))\n assert_equal([2.2, 3.1], candidate.call([1.1, 2.2, 3.1, 4.1, 5.1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "rb", - "prompt": "# You have been tasked to write a function that receives \n# a hexadecimal number as a string and counts the number of hexadecimal \n# digits that are primes (prime number, or a prime, is a natural number \n# greater than 1 that is not a product of two smaller natural numbers).\n# Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n# Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n# So you have to determine a number of the following digits: 2, 3, 5, 7, \n# B (=decimal 11), D (=decimal 13).\n# Note: you may assume the input is always correct or empty string, \n# and symbols A,B,C,D,E,F are always uppercase.\n# Examples:\n# >>> hex_key.call(\"AB\")\n# 1\n# >>> hex_key.call(\"1077E\")\n# 2\n# >>> hex_key.call(\"ABED1A33\")\n# 4\n# >>> hex_key.call(\"123456789ABCDEF0\")\n# 6\n# >>> hex_key.call(\"2020\")\n# 2\ndef hex_key(num)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_hex_key\n candidate = method(:hex_key)\n assert_equal(1, candidate.call(\"AB\"))\n assert_equal(2, candidate.call(\"1077E\"))\n assert_equal(4, candidate.call(\"ABED1A33\"))\n assert_equal(2, candidate.call(\"2020\"))\n assert_equal(6, candidate.call(\"123456789ABCDEF0\"))\n assert_equal(12, candidate.call(\"112233445566778899AABBCCDDEEFF00\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "rb", - "prompt": "# Complete the function that takes two integers and returns \n# the product of their unit digits.\n# Assume the input is always valid.\n# Examples:\n# >>> multiply.call(148, 412)\n# 16\n# >>> multiply.call(19, 28)\n# 72\n# >>> multiply.call(2020, 1851)\n# 0\n# >>> multiply.call(14, -15)\n# 20\ndef multiply(a, b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_multiply\n candidate = method(:multiply)\n assert_equal(16, candidate.call(148, 412))\n assert_equal(72, candidate.call(19, 28))\n assert_equal(0, candidate.call(2020, 1851))\n assert_equal(20, candidate.call(14, -15))\n assert_equal(42, candidate.call(76, 67))\n assert_equal(49, candidate.call(17, 27))\n assert_equal(0, candidate.call(0, 1))\n assert_equal(0, candidate.call(0, 0))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "rb", - "prompt": "# Given array of numbers (of at least two elements), apply a linear transform to that array,\n# such that the smallest number will become 0 and the largest will become 1\n# >>> rescale_to_unit.call([1.0, 2.0, 3.0, 4.0, 5.0])\n# [0.0, 0.25, 0.5, 0.75, 1.0]\ndef rescale_to_unit(numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_rescale_to_unit\n candidate = method(:rescale_to_unit)\n assert_equal([0.0, 1.0], candidate.call([2.0, 49.9]))\n assert_equal([1.0, 0.0], candidate.call([100.0, 49.9]))\n assert_equal([0.0, 0.25, 0.5, 0.75, 1.0], candidate.call([1.0, 2.0, 3.0, 4.0, 5.0]))\n assert_equal([0.25, 0.0, 1.0, 0.5, 0.75], candidate.call([2.0, 1.0, 5.0, 3.0, 4.0]))\n assert_equal([0.25, 0.0, 1.0, 0.5, 0.75], candidate.call([12.0, 11.0, 15.0, 13.0, 14.0]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "rb", - "prompt": "# Given a positive integer n, return the product of the odd digits.\n# Return 0 if all digits are even.\n# For example:\n# >>> digits.call(1)\n# 1\n# >>> digits.call(4)\n# 0\n# >>> digits.call(235)\n# 15\ndef digits(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_digits\n candidate = method(:digits)\n assert_equal(5, candidate.call(5))\n assert_equal(5, candidate.call(54))\n assert_equal(1, candidate.call(120))\n assert_equal(5, candidate.call(5014))\n assert_equal(315, candidate.call(98765))\n assert_equal(2625, candidate.call(5576543))\n assert_equal(0, candidate.call(2468))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "rb", - "prompt": "# You will be given the name of a class (a string) and an array of extensions.\n# The extensions are to be used to load additional classes to the class. The\n# strength of the extension is as follows: Let CAP be the number of the uppercase\n# letters in the extension's name, and let SM be the number of lowercase letters \n# in the extension's name, the strength is given by the fraction CAP - SM. \n# You should find the strongest extension and return a string in this \n# format: ClassName.StrongestExtensionName.\n# If there are two or more extensions with the same strength, you should\n# choose the one that comes first in the array.\n# For example, if you are given \"Slices\" as the class and an array of the\n# extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n# return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n# (its strength is -1).\n# Example:\n# >>> Strongest_Extension.call(\"my_class\", [\"AA\", \"Be\", \"CC\"])\n# \"my_class.AA\"\ndef Strongest_Extension(class_name, extensions)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_Strongest_Extension\n candidate = method(:Strongest_Extension)\n assert_equal(\"Watashi.eIGHt8OKe\", candidate.call(\"Watashi\", [\"tEN\", \"niNE\", \"eIGHt8OKe\"]))\n assert_equal(\"Boku123.YEs.WeCaNe\", candidate.call(\"Boku123\", [\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"]))\n assert_equal(\"__YESIMHERE.NuLl__\", candidate.call(\"__YESIMHERE\", [\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"]))\n assert_equal(\"K.TAR\", candidate.call(\"K\", [\"Ta\", \"TAR\", \"t234An\", \"cosSo\"]))\n assert_equal(\"__HAHA.123\", candidate.call(\"__HAHA\", [\"Tab\", \"123\", \"781345\", \"-_-\"]))\n assert_equal(\"YameRore.okIWILL123\", candidate.call(\"YameRore\", [\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"]))\n assert_equal(\"finNNalLLly.WoW\", candidate.call(\"finNNalLLly\", [\"Die\", \"NowW\", \"Wow\", \"WoW\"]))\n assert_equal(\"_.Bb\", candidate.call(\"_\", [\"Bb\", \"91245\"]))\n assert_equal(\"Sp.671235\", candidate.call(\"Sp\", [\"671235\", \"Bb\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "rb", - "prompt": "# Given a string representing a space separated lowercase letters, return a hash\n# of the letter with the most repetition and containing the corresponding count.\n# If several letters have the same occurrence, return all of them.\n# Example:\n# >>> histogram.call(\"a b c\")\n# {\"a\" => 1, \"b\" => 1, \"c\" => 1}\n# >>> histogram.call(\"a b b a\")\n# {\"a\" => 2, \"b\" => 2}\n# >>> histogram.call(\"a b c a b\")\n# {\"a\" => 2, \"b\" => 2}\n# >>> histogram.call(\"b b b b a\")\n# {\"b\" => 4}\n# >>> histogram.call(\"\")\n# {}\ndef histogram(test)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_histogram\n candidate = method(:histogram)\n assert_equal({\"a\" => 2, \"b\" => 2}, candidate.call(\"a b b a\"))\n assert_equal({\"a\" => 2, \"b\" => 2}, candidate.call(\"a b c a b\"))\n assert_equal({\"a\" => 1, \"b\" => 1, \"c\" => 1, \"d\" => 1, \"g\" => 1}, candidate.call(\"a b c d g\"))\n assert_equal({\"r\" => 1, \"t\" => 1, \"g\" => 1}, candidate.call(\"r t g\"))\n assert_equal({\"b\" => 4}, candidate.call(\"b b b b a\"))\n assert_equal({\"r\" => 1, \"t\" => 1, \"g\" => 1}, candidate.call(\"r t g\"))\n assert_equal({}, candidate.call(\"\"))\n assert_equal({\"a\" => 1}, candidate.call(\"a\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "rb", - "prompt": "# pairs_sum_to_zero takes an array of integers as an input.\n# it returns true if there are two distinct elements in the array that\n# sum to zero, and false otherwise.\n# >>> pairs_sum_to_zero.call([1, 3, 5, 0])\n# false\n# >>> pairs_sum_to_zero.call([1, 3, -2, 1])\n# false\n# >>> pairs_sum_to_zero.call([1, 2, 3, 7])\n# false\n# >>> pairs_sum_to_zero.call([2, 4, -5, 3, 5, 7])\n# true\n# >>> pairs_sum_to_zero.call([1])\n# false\ndef pairs_sum_to_zero(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_pairs_sum_to_zero\n candidate = method(:pairs_sum_to_zero)\n assert_equal(false, candidate.call([1, 3, 5, 0]))\n assert_equal(false, candidate.call([1, 3, -2, 1]))\n assert_equal(false, candidate.call([1, 2, 3, 7]))\n assert_equal(true, candidate.call([2, 4, -5, 3, 5, 7]))\n assert_equal(false, candidate.call([1]))\n assert_equal(true, candidate.call([-3, 9, -1, 3, 2, 30]))\n assert_equal(true, candidate.call([-3, 9, -1, 3, 2, 31]))\n assert_equal(false, candidate.call([-3, 9, -1, 4, 2, 30]))\n assert_equal(false, candidate.call([-3, 9, -1, 4, 2, 31]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "rb", - "prompt": "# Write a function that accepts two arrays of strings and returns the array that has \n# total number of chars in the all strings of the array less than the other array.\n# if the two arrays have the same number of chars, return the first array.\n# Examples\n# >>> total_match.call([], [])\n# []\n# >>> total_match.call([\"hi\", \"admin\"], [\"hI\", \"Hi\"])\n# [\"hI\", \"Hi\"]\n# >>> total_match.call([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"])\n# [\"hi\", \"admin\"]\n# >>> total_match.call([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"])\n# [\"hI\", \"hi\", \"hi\"]\n# >>> total_match.call([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"])\n# [\"4\"]\ndef total_match(lst1, lst2)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_total_match\n candidate = method(:total_match)\n assert_equal([], candidate.call([], []))\n assert_equal([\"hi\", \"hi\"], candidate.call([\"hi\", \"admin\"], [\"hi\", \"hi\"]))\n assert_equal([\"hi\", \"admin\"], candidate.call([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"]))\n assert_equal([\"4\"], candidate.call([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"]))\n assert_equal([\"hI\", \"Hi\"], candidate.call([\"hi\", \"admin\"], [\"hI\", \"Hi\"]))\n assert_equal([\"hI\", \"hi\", \"hi\"], candidate.call([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"]))\n assert_equal([\"hi\", \"admin\"], candidate.call([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hii\"]))\n assert_equal([], candidate.call([], [\"this\"]))\n assert_equal([], candidate.call([\"this\"], []))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "rb", - "prompt": "# Circular shift the digits of the integer x, shift the digits right by shift\n# and return the result as a string.\n# If shift > number of digits, return digits reversed.\n# >>> circular_shift.call(12, 1)\n# \"21\"\n# >>> circular_shift.call(12, 2)\n# \"12\"\ndef circular_shift(x, shift)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_circular_shift\n candidate = method(:circular_shift)\n assert_equal(\"001\", candidate.call(100, 2))\n assert_equal(\"12\", candidate.call(12, 2))\n assert_equal(\"79\", candidate.call(97, 8))\n assert_equal(\"21\", candidate.call(12, 1))\n assert_equal(\"11\", candidate.call(11, 101))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "rb", - "prompt": "# Return true is array elements are monotonically increasing or decreasing.\n# >>> monotonic.call([1, 2, 4, 20])\n# true\n# >>> monotonic.call([1, 20, 4, 10])\n# false\n# >>> monotonic.call([4, 1, 0, -10])\n# true\ndef monotonic(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_monotonic\n candidate = method(:monotonic)\n assert_equal(true, candidate.call([1, 2, 4, 10]))\n assert_equal(true, candidate.call([1, 2, 4, 20]))\n assert_equal(false, candidate.call([1, 20, 4, 10]))\n assert_equal(true, candidate.call([4, 1, 0, -10]))\n assert_equal(true, candidate.call([4, 1, 1, 0]))\n assert_equal(false, candidate.call([1, 2, 3, 2, 5, 60]))\n assert_equal(true, candidate.call([1, 2, 3, 4, 5, 60]))\n assert_equal(true, candidate.call([9, 9, 9, 9]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "rb", - "prompt": "# Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n# Example\n# >>> is_equal_to_sum_even.call(4)\n# false\n# >>> is_equal_to_sum_even.call(6)\n# false\n# >>> is_equal_to_sum_even.call(8)\n# true\ndef is_equal_to_sum_even(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_equal_to_sum_even\n candidate = method(:is_equal_to_sum_even)\n assert_equal(false, candidate.call(4))\n assert_equal(false, candidate.call(6))\n assert_equal(true, candidate.call(8))\n assert_equal(true, candidate.call(10))\n assert_equal(false, candidate.call(11))\n assert_equal(true, candidate.call(12))\n assert_equal(false, candidate.call(13))\n assert_equal(true, candidate.call(16))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "rb", - "prompt": "# Input to this function is a string representing musical notes in a special ASCII format.\n# Your task is to parse this string and return array of integers corresponding to how many beats does each\n# not last.\n# Here is a legend:\n# 'o' - whole note, lasts four beats\n# 'o|' - half note, lasts two beats\n# '.|' - quater note, lasts one beat\n# >>> parse_music.call(\"o o| .| o| o| .| .| .| .| o o\")\n# [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\ndef parse_music(music_string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_parse_music\n candidate = method(:parse_music)\n assert_equal([], candidate.call(\"\"))\n assert_equal([4, 4, 4, 4], candidate.call(\"o o o o\"))\n assert_equal([1, 1, 1, 1], candidate.call(\".| .| .| .|\"))\n assert_equal([2, 2, 1, 1, 4, 4, 4, 4], candidate.call(\"o| o| .| .| o o o o\"))\n assert_equal([2, 1, 2, 1, 4, 2, 4, 2], candidate.call(\"o| .| o| .| o o| o o|\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "rb", - "prompt": "# \"\n# This function will take an array of integers. For all entries in the array, the function shall square the integer entry if its index is a \n# multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n# change the entries in the array whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n# Examples:\n# >>> lst\n# [1, 2, 3]\n# >>> lst\n# []\n# >>> lst\n# [-1, -5, 2, -1, -5]\ndef sum_squares(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sum_squares\n candidate = method(:sum_squares)\n assert_equal(6, candidate.call([1, 2, 3]))\n assert_equal(14, candidate.call([1, 4, 9]))\n assert_equal(0, candidate.call([]))\n assert_equal(9, candidate.call([1, 1, 1, 1, 1, 1, 1, 1, 1]))\n assert_equal(-3, candidate.call([-1, -1, -1, -1, -1, -1, -1, -1, -1]))\n assert_equal(0, candidate.call([0]))\n assert_equal(-126, candidate.call([-1, -5, 2, -1, -5]))\n assert_equal(3030, candidate.call([-56, -99, 1, 0, -2]))\n assert_equal(0, candidate.call([-1, 0, 0, 0, 0, 0, 0, 0, -1]))\n assert_equal(-14196, candidate.call([-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37]))\n assert_equal(-1448, candidate.call([-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "rb", - "prompt": "# triples_sum_to_zero takes an array of integers as an input.\n# it returns true if there are three distinct elements in the array that\n# sum to zero, and false otherwise.\n# >>> triples_sum_to_zero.call([1, 3, 5, 0])\n# false\n# >>> triples_sum_to_zero.call([1, 3, -2, 1])\n# true\n# >>> triples_sum_to_zero.call([1, 2, 3, 7])\n# false\n# >>> triples_sum_to_zero.call([2, 4, -5, 3, 9, 7])\n# true\n# >>> triples_sum_to_zero.call([1])\n# false\ndef triples_sum_to_zero(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_triples_sum_to_zero\n candidate = method(:triples_sum_to_zero)\n assert_equal(false, candidate.call([1, 3, 5, 0]))\n assert_equal(false, candidate.call([1, 3, 5, -1]))\n assert_equal(true, candidate.call([1, 3, -2, 1]))\n assert_equal(false, candidate.call([1, 2, 3, 7]))\n assert_equal(false, candidate.call([1, 2, 5, 7]))\n assert_equal(true, candidate.call([2, 4, -5, 3, 9, 7]))\n assert_equal(false, candidate.call([1]))\n assert_equal(false, candidate.call([1, 3, 5, -100]))\n assert_equal(false, candidate.call([100, 3, 5, -100]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "rb", - "prompt": "# brackets is a string of \"<\" and \">\".\n# return true if every opening bracket has a corresponding closing bracket.\n# >>> correct_bracketing.call(\"<\")\n# false\n# >>> correct_bracketing.call(\"<>\")\n# true\n# >>> correct_bracketing.call(\"<<><>>\")\n# true\n# >>> correct_bracketing.call(\"><<>\")\n# false\ndef correct_bracketing(brackets)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_correct_bracketing\n candidate = method(:correct_bracketing)\n assert_equal(true, candidate.call(\"<>\"))\n assert_equal(true, candidate.call(\"<<><>>\"))\n assert_equal(true, candidate.call(\"<><><<><>><>\"))\n assert_equal(true, candidate.call(\"<><><<<><><>><>><<><><<>>>\"))\n assert_equal(false, candidate.call(\"<<<><>>>>\"))\n assert_equal(false, candidate.call(\"><<>\"))\n assert_equal(false, candidate.call(\"<\"))\n assert_equal(false, candidate.call(\"<<<<\"))\n assert_equal(false, candidate.call(\">\"))\n assert_equal(false, candidate.call(\"<<>\"))\n assert_equal(false, candidate.call(\"<><><<><>><>><<>\"))\n assert_equal(false, candidate.call(\"<><><<><>><>>><>\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "rb", - "prompt": "# Write a function that takes an array of numbers as input and returns \n# the number of elements in the array that are greater than 10 and both \n# first and last digits of a number are odd (1, 3, 5, 7, 9).\n# For example:\n# >>> specialFilter.call([15, -73, 14, -15])\n# 1\n# >>> specialFilter.call([33, -2, -3, 45, 21, 109])\n# 2\ndef specialFilter(nums)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_specialFilter\n candidate = method(:specialFilter)\n assert_equal(0, candidate.call([5, -2, 1, -5]))\n assert_equal(1, candidate.call([15, -73, 14, -15]))\n assert_equal(2, candidate.call([33, -2, -3, 45, 21, 109]))\n assert_equal(4, candidate.call([43, -12, 93, 125, 121, 109]))\n assert_equal(3, candidate.call([71, -2, -33, 75, 21, 19]))\n assert_equal(0, candidate.call([1]))\n assert_equal(0, candidate.call([]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "rb", - "prompt": "# Given a hash, return true if all keys are strings in lower \n# case or all keys are strings in upper case, else return false.\n# The function should return false is the given hash is empty.\n# Examples:\n# >>> check_dict_case.call({\"a\" => \"apple\", \"b\" => \"banana\"})\n# true\n# >>> check_dict_case.call({\"a\" => \"apple\", \"A\" => \"banana\", \"B\" => \"banana\"})\n# false\n# >>> check_dict_case.call({\"a\" => \"apple\", 8 => \"banana\", \"a\" => \"apple\"})\n# false\n# >>> check_dict_case.call({\"Name\" => \"John\", \"Age\" => \"36\", \"City\" => \"Houston\"})\n# false\n# >>> check_dict_case.call({\"STATE\" => \"NC\", \"ZIP\" => \"12345\"})\n# true\ndef check_dict_case(dict)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_check_dict_case\n candidate = method(:check_dict_case)\n assert_equal(true, candidate.call({\"p\" => \"pineapple\", \"b\" => \"banana\"}))\n assert_equal(false, candidate.call({\"p\" => \"pineapple\", \"A\" => \"banana\", \"B\" => \"banana\"}))\n assert_equal(false, candidate.call({\"p\" => \"pineapple\", \"5\" => \"banana\", \"a\" => \"apple\"}))\n assert_equal(false, candidate.call({\"Name\" => \"John\", \"Age\" => \"36\", \"City\" => \"Houston\"}))\n assert_equal(true, candidate.call({\"STATE\" => \"NC\", \"ZIP\" => \"12345\"}))\n assert_equal(true, candidate.call({\"fruit\" => \"Orange\", \"taste\" => \"Sweet\"}))\n assert_equal(false, candidate.call({}))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "rb", - "prompt": "# Given a string of words, return an array of words split on whitespace, if no whitespaces exists in the text you\n# should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n# alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n# Examples\n# >>> split_words.call(\"Hello world!\")\n# [\"Hello\", \"world!\"]\n# >>> split_words.call(\"Hello,world!\")\n# [\"Hello\", \"world!\"]\n# >>> split_words.call(\"abcdef\")\n# 3\ndef split_words(txt)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_split_words\n candidate = method(:split_words)\n assert_equal([\"Hello\", \"world!\"], candidate.call(\"Hello world!\"))\n assert_equal([\"Hello\", \"world!\"], candidate.call(\"Hello,world!\"))\n assert_equal([\"Hello\", \"world,!\"], candidate.call(\"Hello world,!\"))\n assert_equal([\"Hello,Hello,world\", \"!\"], candidate.call(\"Hello,Hello,world !\"))\n assert_equal(3, candidate.call(\"abcdef\"))\n assert_equal(2, candidate.call(\"aaabb\"))\n assert_equal(1, candidate.call(\"aaaBb\"))\n assert_equal(0, candidate.call(\"\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "rb", - "prompt": "# The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fibfib(0) == 0\n# fibfib(1) == 0\n# fibfib(2) == 1\n# fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n# Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n# >>> fibfib.call(1)\n# 0\n# >>> fibfib.call(5)\n# 4\n# >>> fibfib.call(8)\n# 24\ndef fibfib(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_fibfib\n candidate = method(:fibfib)\n assert_equal(1, candidate.call(2))\n assert_equal(0, candidate.call(1))\n assert_equal(4, candidate.call(5))\n assert_equal(24, candidate.call(8))\n assert_equal(81, candidate.call(10))\n assert_equal(274, candidate.call(12))\n assert_equal(927, candidate.call(14))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "rb", - "prompt": "# You are given an array of numbers.\n# You need to return the sum of squared numbers in the given array,\n# round each element in the array to the upper int(Ceiling) first.\n# Examples:\n# >>> lst.call([1.0, 2.0, 3.0])\n# 14\n# >>> lst.call([1.0, 4.0, 9.0])\n# 98\n# >>> lst.call([1.0, 3.0, 5.0, 7.0])\n# 84\n# >>> lst.call([1.4, 4.2, 0.0])\n# 29\n# >>> lst.call([-2.4, 1.0, 1.0])\n# 6\ndef sum_squares(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sum_squares\n candidate = method(:sum_squares)\n assert_equal(14, candidate.call([1.0, 2.0, 3.0]))\n assert_equal(14, candidate.call([1.0, 2.0, 3.0]))\n assert_equal(84, candidate.call([1.0, 3.0, 5.0, 7.0]))\n assert_equal(29, candidate.call([1.4, 4.2, 0.0]))\n assert_equal(6, candidate.call([-2.4, 1.0, 1.0]))\n assert_equal(10230, candidate.call([100.0, 1.0, 15.0, 2.0]))\n assert_equal(200000000, candidate.call([10000.0, 10000.0]))\n assert_equal(75, candidate.call([-1.4, 4.6, 6.3]))\n assert_equal(1086, candidate.call([-1.4, 17.9, 18.9, 19.9]))\n assert_equal(0, candidate.call([0.0]))\n assert_equal(1, candidate.call([-1.0]))\n assert_equal(2, candidate.call([-1.0, 1.0, 0.0]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_85_add", - "language": "rb", - "prompt": "# Given a non-empty array of integers lst. add the even elements that are at odd indices..\n# Examples:\n# >>> add.call([4, 2, 6, 7])\n# 2\ndef add(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_add\n candidate = method(:add)\n assert_equal(88, candidate.call([4, 88]))\n assert_equal(122, candidate.call([4, 5, 6, 7, 2, 122]))\n assert_equal(0, candidate.call([4, 0, 6, 7]))\n assert_equal(12, candidate.call([4, 4, 6, 8]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "rb", - "prompt": "# Return sorted unique elements in an array\n# >>> unique.call([5, 3, 5, 2, 3, 3, 9, 0, 123])\n# [0, 2, 3, 5, 9, 123]\ndef unique(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_unique\n candidate = method(:unique)\n assert_equal([0, 2, 3, 5, 9, 123], candidate.call([5, 3, 5, 2, 3, 3, 9, 0, 123]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "rb", - "prompt": "# Given a string text, replace all spaces in it with underscores, \n# and if a string has more than 2 consecutive spaces, \n# then replace all consecutive spaces with - \n# >>> fix_spaces.call(\" Example\")\n# \"Example\"\n# >>> fix_spaces.call(\" Example 1\")\n# \"Example_1\"\n# >>> fix_spaces.call(\" Example 2\")\n# \"_Example_2\"\n# >>> fix_spaces.call(\" Example 3\")\n# \"_Example-3\"\ndef fix_spaces(text)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_fix_spaces\n candidate = method(:fix_spaces)\n assert_equal(\"Example\", candidate.call(\"Example\"))\n assert_equal(\"Mudasir_Hanif_\", candidate.call(\"Mudasir Hanif \"))\n assert_equal(\"Yellow_Yellow__Dirty__Fellow\", candidate.call(\"Yellow Yellow Dirty Fellow\"))\n assert_equal(\"Exa-mple\", candidate.call(\"Exa mple\"))\n assert_equal(\"-Exa_1_2_2_mple\", candidate.call(\" Exa 1 2 2 mple\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "rb", - "prompt": "# Return 2^n modulo p (be aware of numerics).\n# >>> modp.call(3, 5)\n# 3\n# >>> modp.call(1101, 101)\n# 2\n# >>> modp.call(0, 101)\n# 1\n# >>> modp.call(3, 11)\n# 8\n# >>> modp.call(100, 101)\n# 1\ndef modp(n, p)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_modp\n candidate = method(:modp)\n assert_equal(3, candidate.call(3, 5))\n assert_equal(2, candidate.call(1101, 101))\n assert_equal(1, candidate.call(0, 101))\n assert_equal(8, candidate.call(3, 11))\n assert_equal(1, candidate.call(100, 101))\n assert_equal(4, candidate.call(30, 5))\n assert_equal(3, candidate.call(31, 5))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "rb", - "prompt": "# You have to write a function which validates a given date string and\n# returns true if the date is valid otherwise false.\n# The date is valid if all of the following rules are satisfied:\n# 1. The date string is not empty.\n# 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n# 3. The months should not be less than 1 or higher than 12.\n# 4. The date should be in the format: mm-dd-yyyy\n# >>> valid_date.call(\"03-11-2000\")\n# true\n# >>> valid_date.call(\"15-01-2012\")\n# false\n# >>> valid_date.call(\"04-0-2040\")\n# false\n# >>> valid_date.call(\"06-04-2020\")\n# true\n# >>> valid_date.call(\"06/04/2020\")\n# false\ndef valid_date(date)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_valid_date\n candidate = method(:valid_date)\n assert_equal(true, candidate.call(\"03-11-2000\"))\n assert_equal(false, candidate.call(\"15-01-2012\"))\n assert_equal(false, candidate.call(\"04-0-2040\"))\n assert_equal(true, candidate.call(\"06-04-2020\"))\n assert_equal(true, candidate.call(\"01-01-2007\"))\n assert_equal(false, candidate.call(\"03-32-2011\"))\n assert_equal(false, candidate.call(\"\"))\n assert_equal(false, candidate.call(\"04-31-3000\"))\n assert_equal(true, candidate.call(\"06-06-2005\"))\n assert_equal(false, candidate.call(\"21-31-2000\"))\n assert_equal(true, candidate.call(\"04-12-2003\"))\n assert_equal(false, candidate.call(\"04122003\"))\n assert_equal(false, candidate.call(\"20030412\"))\n assert_equal(false, candidate.call(\"2003-04\"))\n assert_equal(false, candidate.call(\"2003-04-12\"))\n assert_equal(false, candidate.call(\"04-2003\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "rb", - "prompt": "# Write a function that takes a string and returns an ordered version of it.\n# Ordered version of string, is a string where all words (separated by space)\n# are replaced by a new word where all the characters arranged in\n# ascending order based on ascii value.\n# Note: You should keep the order of words and blank spaces in the sentence.\n# For example:\n# >>> anti_shuffle.call(\"Hi\")\n# \"Hi\"\n# >>> anti_shuffle.call(\"hello\")\n# \"ehllo\"\n# >>> anti_shuffle.call(\"Hello World!!!\")\n# \"Hello !!!Wdlor\"\ndef anti_shuffle(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_anti_shuffle\n candidate = method(:anti_shuffle)\n assert_equal(\"Hi\", candidate.call(\"Hi\"))\n assert_equal(\"ehllo\", candidate.call(\"hello\"))\n assert_equal(\"bemnru\", candidate.call(\"number\"))\n assert_equal(\"abcd\", candidate.call(\"abcd\"))\n assert_equal(\"Hello !!!Wdlor\", candidate.call(\"Hello World!!!\"))\n assert_equal(\"\", candidate.call(\"\"))\n assert_equal(\".Hi My aemn is Meirst .Rboot How aer ?ouy\", candidate.call(\"Hi. My name is Mister Robot. How are you?\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "rb", - "prompt": "# Given an array of numbers, return whether or not they are sorted\n# in ascending order. If array has more than 1 duplicate of the same\n# number, return false. Assume no negative numbers and only integers.\n# Examples\n# >>> is_sorted.call([5])\n# true\n# >>> is_sorted.call([1, 2, 3, 4, 5])\n# true\n# >>> is_sorted.call([1, 3, 2, 4, 5])\n# false\n# >>> is_sorted.call([1, 2, 3, 4, 5, 6])\n# true\n# >>> is_sorted.call([1, 2, 3, 4, 5, 6, 7])\n# true\n# >>> is_sorted.call([1, 3, 2, 4, 5, 6, 7])\n# false\n# >>> is_sorted.call([1, 2, 2, 3, 3, 4])\n# true\n# >>> is_sorted.call([1, 2, 2, 2, 3, 4])\n# false\ndef is_sorted(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_sorted\n candidate = method(:is_sorted)\n assert_equal(true, candidate.call([5]))\n assert_equal(true, candidate.call([1, 2, 3, 4, 5]))\n assert_equal(false, candidate.call([1, 3, 2, 4, 5]))\n assert_equal(true, candidate.call([1, 2, 3, 4, 5, 6]))\n assert_equal(true, candidate.call([1, 2, 3, 4, 5, 6, 7]))\n assert_equal(false, candidate.call([1, 3, 2, 4, 5, 6, 7]))\n assert_equal(true, candidate.call([]))\n assert_equal(true, candidate.call([1]))\n assert_equal(false, candidate.call([3, 2, 1]))\n assert_equal(false, candidate.call([1, 2, 2, 2, 3, 4]))\n assert_equal(false, candidate.call([1, 2, 3, 3, 3, 4]))\n assert_equal(true, candidate.call([1, 2, 2, 3, 3, 4]))\n assert_equal(true, candidate.call([1, 2, 3, 4]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "rb", - "prompt": "# You are given a string s.\n# Your task is to check if the string is haprb or not.\n# A string is haprb if its length is at least 3 and every 3 consecutive letters are distinct\n# For example:\n# >>> is_happy.call(\"a\")\n# false\n# >>> is_happy.call(\"aa\")\n# false\n# >>> is_happy.call(\"abcd\")\n# true\n# >>> is_happy.call(\"aabb\")\n# false\n# >>> is_happy.call(\"adb\")\n# true\n# >>> is_happy.call(\"xyy\")\n# false\ndef is_happy(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_happy\n candidate = method(:is_happy)\n assert_equal(false, candidate.call(\"a\"))\n assert_equal(false, candidate.call(\"aa\"))\n assert_equal(true, candidate.call(\"abcd\"))\n assert_equal(false, candidate.call(\"aabb\"))\n assert_equal(true, candidate.call(\"adb\"))\n assert_equal(false, candidate.call(\"xyy\"))\n assert_equal(true, candidate.call(\"iopaxpoi\"))\n assert_equal(false, candidate.call(\"iopaxioi\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "rb", - "prompt": "# Write a function that returns true if the object q will fly, and false otherwise.\n# The object q will fly if it's balanced (it is a palindromic array) and the sum of its elements is less than or equal the maximum possible weight w.\n# Example:\n# >>> will_it_fly.call([1, 2], 5)\n# false\n# # 1+2 is less than the maximum possible weight, but it's unbalanced.\n# >>> will_it_fly.call([3, 2, 3], 1)\n# false\n# # it's balanced, but 3+2+3 is more than the maximum possible weight.\n# >>> will_it_fly.call([3, 2, 3], 9)\n# true\n# # 3+2+3 is less than the maximum possible weight, and it's balanced.\n# >>> will_it_fly.call([3], 5)\n# true\n# # 3 is less than the maximum possible weight, and it's balanced.\ndef will_it_fly(q, w)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_will_it_fly\n candidate = method(:will_it_fly)\n assert_equal(true, candidate.call([3, 2, 3], 9))\n assert_equal(false, candidate.call([1, 2], 5))\n assert_equal(true, candidate.call([3], 5))\n assert_equal(false, candidate.call([3, 2, 3], 1))\n assert_equal(false, candidate.call([1, 2, 3], 6))\n assert_equal(true, candidate.call([5], 5))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "rb", - "prompt": "# Given an array of non-negative integers, return a corb of the given array after sorting,\n# you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n# or sort it in descending order if the sum( first index value, last index value) is even.\n# Note:\n# * don't change the given array.\n# Examples:\n# >>> sort_array.call([])\n# []\n# >>> sort_array.call([5])\n# [5]\n# >>> sort_array.call([2, 4, 3, 0, 1, 5])\n# [0, 1, 2, 3, 4, 5]\n# >>> sort_array.call([2, 4, 3, 0, 1, 5, 6])\n# [6, 5, 4, 3, 2, 1, 0]\ndef sort_array(array)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sort_array\n candidate = method(:sort_array)\n assert_equal([], candidate.call([]))\n assert_equal([5], candidate.call([5]))\n assert_equal([0, 1, 2, 3, 4, 5], candidate.call([2, 4, 3, 0, 1, 5]))\n assert_equal([6, 5, 4, 3, 2, 1, 0], candidate.call([2, 4, 3, 0, 1, 5, 6]))\n assert_equal([1, 2], candidate.call([2, 1]))\n assert_equal([0, 11, 15, 32, 42, 87], candidate.call([15, 42, 87, 32, 11, 0]))\n assert_equal([23, 21, 14, 11], candidate.call([21, 14, 23, 11]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "rb", - "prompt": "# Implement a function that takes an non-negative integer and returns an array of the first n\n# integers that are prime numbers and less than n.\n# for example:\n# >>> count_up_to.call(5)\n# [2, 3]\n# >>> count_up_to.call(11)\n# [2, 3, 5, 7]\n# >>> count_up_to.call(0)\n# []\n# >>> count_up_to.call(20)\n# [2, 3, 5, 7, 11, 13, 17, 19]\n# >>> count_up_to.call(1)\n# []\n# >>> count_up_to.call(18)\n# [2, 3, 5, 7, 11, 13, 17]\ndef count_up_to(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_count_up_to\n candidate = method(:count_up_to)\n assert_equal([2, 3], candidate.call(5))\n assert_equal([2, 3, 5], candidate.call(6))\n assert_equal([2, 3, 5], candidate.call(7))\n assert_equal([2, 3, 5, 7], candidate.call(10))\n assert_equal([], candidate.call(0))\n assert_equal([2, 3, 5, 7, 11, 13, 17, 19], candidate.call(22))\n assert_equal([], candidate.call(1))\n assert_equal([2, 3, 5, 7, 11, 13, 17], candidate.call(18))\n assert_equal([2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43], candidate.call(47))\n assert_equal([2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97], candidate.call(101))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "rb", - "prompt": "# Out of array of strings, return the longest one. Return the first one in case of multiple\n# strings of the same length. Return nil in case the input array is empty.\n# >>> longest.call([])\n# nil\n# >>> longest.call([\"a\", \"b\", \"c\"])\n# \"a\"\n# >>> longest.call([\"a\", \"bb\", \"ccc\"])\n# \"ccc\"\ndef longest(strings)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_longest\n candidate = method(:longest)\n assert_equal(nil, candidate.call([]))\n assert_equal(\"x\", candidate.call([\"x\", \"y\", \"z\"]))\n assert_equal(\"zzzz\", candidate.call([\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "rb", - "prompt": "# Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n# reverse the resulting array, and then replace each digit by its corresponding name from\n# \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n# For example:\n# >>> by_length.call([2, 1, 1, 4, 5, 8, 2, 3])\n# [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n# If the array is empty, return an empty array:\n# >>> by_length.call([])\n# []\n# If the array has any strange number ignore it:\n# >>> by_length.call([1, -1, 55])\n# [\"One\"]\ndef by_length(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_by_length\n candidate = method(:by_length)\n assert_equal([\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"], candidate.call([2, 1, 1, 4, 5, 8, 2, 3]))\n assert_equal([], candidate.call([]))\n assert_equal([\"One\"], candidate.call([1, -1, 55]))\n assert_equal([\"Three\", \"Two\", \"One\"], candidate.call([1, -1, 3, 2]))\n assert_equal([\"Nine\", \"Eight\", \"Four\"], candidate.call([9, 4, 8]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_106_f", - "language": "rb", - "prompt": "# Implement the function f that takes n as a parameter,\n# and returns an array of size n, such that the value of the element at index i is the factorial of i if i is even\n# or the sum of numbers from 1 to i otherwise.\n# i starts from 1.\n# the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n# Example:\n# >>> f.call(5)\n# [1, 2, 6, 24, 15]\ndef f(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_f\n candidate = method(:f)\n assert_equal([1, 2, 6, 24, 15], candidate.call(5))\n assert_equal([1, 2, 6, 24, 15, 720, 28], candidate.call(7))\n assert_equal([1], candidate.call(1))\n assert_equal([1, 2, 6], candidate.call(3))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "rb", - "prompt": "# Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n# >>> fizz_buzz.call(50)\n# 0\n# >>> fizz_buzz.call(78)\n# 2\n# >>> fizz_buzz.call(79)\n# 3\ndef fizz_buzz(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_fizz_buzz\n candidate = method(:fizz_buzz)\n assert_equal(0, candidate.call(50))\n assert_equal(2, candidate.call(78))\n assert_equal(3, candidate.call(79))\n assert_equal(3, candidate.call(100))\n assert_equal(6, candidate.call(200))\n assert_equal(192, candidate.call(4000))\n assert_equal(639, candidate.call(10000))\n assert_equal(8026, candidate.call(100000))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "rb", - "prompt": "# Given a positive floating point number, it can be decomposed into\n# and integer part (largest integer smaller than given number) and decimals\n# (leftover part always smaller than 1).\n# Return the decimal part of the number.\n# >>> truncate_number.call(3.5)\n# 0.5\ndef truncate_number(number)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_truncate_number\n candidate = method(:truncate_number)\n assert_equal(0.5, candidate.call(3.5))\n assert_equal(0.25, candidate.call(1.25))\n assert_equal(0.0, candidate.call(123.0))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "rb", - "prompt": "# For a given array of integers, return an array consisting of a sum and a product of all the integers in an array.\n# Empty sum should be equal to 0 and empty product should be equal to 1.\n# >>> sum_product.call([])\n# [0, 1]\n# >>> sum_product.call([1, 2, 3, 4])\n# [10, 24]\ndef sum_product(numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sum_product\n candidate = method(:sum_product)\n assert_equal([0, 1], candidate.call([]))\n assert_equal([3, 1], candidate.call([1, 1, 1]))\n assert_equal([100, 0], candidate.call([100, 0]))\n assert_equal([15, 105], candidate.call([3, 5, 7]))\n assert_equal([10, 10], candidate.call([10]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "rb", - "prompt": "# You are given a 2 dimensional data, as a nested arrays,\n# which is similar to matrix, however, unlike matrices,\n# each row may contain a different number of columns.\n# Given lst, and integer x, find integers x in the array,\n# and return array of arrays, [(x1, y1), (x2, y2) ...] such that\n# each array is a coordinate - (row, columns), starting with 0.\n# Sort coordinates initially by rows in ascending order.\n# Also, sort coordinates of the row by columns in descending order.\n# Examples:\n# >>> get_row.call([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1)\n# [[0, 0], [1, 4], [1, 0], [2, 5], [2, 0]]\n# >>> get_row.call([], 1)\n# []\n# >>> get_row.call([[], [1], [1, 2, 3]], 3)\n# [[2, 2]]\ndef get_row(lst, x)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_get_row\n candidate = method(:get_row)\n assert_equal([[0, 0], [1, 4], [1, 0], [2, 5], [2, 0]], candidate.call([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1))\n assert_equal([[0, 1], [1, 1], [2, 1], [3, 1], [4, 1], [5, 1]], candidate.call([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6]], 2))\n assert_equal([[0, 0], [1, 0], [2, 1], [2, 0], [3, 2], [3, 0], [4, 3], [4, 0], [5, 4], [5, 0], [6, 5], [6, 0]], candidate.call([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 1, 3, 4, 5, 6], [1, 2, 1, 4, 5, 6], [1, 2, 3, 1, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1))\n assert_equal([], candidate.call([], 1))\n assert_equal([], candidate.call([[1]], 2))\n assert_equal([[2, 2]], candidate.call([[], [1], [1, 2, 3]], 3))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "rb", - "prompt": "# You're a hungry rabbit, and you already have eaten a certain number of carrots,\n# but now you need to eat more carrots to complete the day's meals.\n# you should return an array of [ total number of eaten carrots after your meals,\n# the number of carrots left after your meals ]\n# if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n# Example:\n# >>> eat.call(5, 6, 10)\n# [11, 4]\n# >>> eat.call(4, 8, 9)\n# [12, 1]\n# >>> eat.call(1, 10, 10)\n# [11, 0]\n# >>> eat.call(2, 11, 5)\n# [7, 0]\n# Variables:\n# @number : integer\n# the number of carrots that you have eaten.\n# @need : integer\n# the number of carrots that you need to eat.\n# @remaining : integer\n# the number of remaining carrots thet exist in stock\n# Constrain:\n# * 0 <= number <= 1000\n# * 0 <= need <= 1000\n# * 0 <= remaining <= 1000\n# Have fun :)\ndef eat(number, need, remaining)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_eat\n candidate = method(:eat)\n assert_equal([11, 4], candidate.call(5, 6, 10))\n assert_equal([12, 1], candidate.call(4, 8, 9))\n assert_equal([11, 0], candidate.call(1, 10, 10))\n assert_equal([7, 0], candidate.call(2, 11, 5))\n assert_equal([9, 2], candidate.call(4, 5, 7))\n assert_equal([5, 0], candidate.call(4, 5, 1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "rb", - "prompt": "# Given a positive integer N, return the total sum of its digits in binary.\n# Example\n# >>> solve.call(1000)\n# \"1\"\n# >>> solve.call(150)\n# \"110\"\n# >>> solve.call(147)\n# \"1100\"\n# Variables:\n# @N integer\n# Constraints: 0 \u2264 N \u2264 10000.\n# Output:\n# a string of binary number\ndef solve(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_solve\n candidate = method(:solve)\n assert_equal(\"1\", candidate.call(1000))\n assert_equal(\"110\", candidate.call(150))\n assert_equal(\"1100\", candidate.call(147))\n assert_equal(\"1001\", candidate.call(333))\n assert_equal(\"10010\", candidate.call(963))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "rb", - "prompt": "# You are given an array of integers.\n# You need to find the largest prime value and return the sum of its digits.\n# Examples:\n# >>> skjkasdkd.call([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3])\n# 10\n# >>> skjkasdkd.call([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1])\n# 25\n# >>> skjkasdkd.call([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3])\n# 13\n# >>> skjkasdkd.call([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6])\n# 11\n# >>> skjkasdkd.call([0, 81, 12, 3, 1, 21])\n# 3\n# >>> skjkasdkd.call([0, 8, 1, 2, 1, 7])\n# 7\ndef skjkasdkd(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_skjkasdkd\n candidate = method(:skjkasdkd)\n assert_equal(10, candidate.call([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]))\n assert_equal(25, candidate.call([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]))\n assert_equal(13, candidate.call([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]))\n assert_equal(11, candidate.call([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]))\n assert_equal(3, candidate.call([0, 81, 12, 3, 1, 21]))\n assert_equal(7, candidate.call([0, 8, 1, 2, 1, 7]))\n assert_equal(19, candidate.call([8191]))\n assert_equal(19, candidate.call([8191, 123456, 127, 7]))\n assert_equal(10, candidate.call([127, 97, 8192]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "rb", - "prompt": "# Given an array arr of integers, find the minimum number of elements that\n# need to be changed to make the array palindromic. A palindromic array is an array that\n# is read the same backwards and forwards. In one change, you can change one element to any other element.\n# For example:\n# >>> smallest_change.call([1, 2, 3, 5, 4, 7, 9, 6])\n# 4\n# >>> smallest_change.call([1, 2, 3, 4, 3, 2, 2])\n# 1\n# >>> smallest_change.call([1, 2, 3, 2, 1])\n# 0\ndef smallest_change(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_smallest_change\n candidate = method(:smallest_change)\n assert_equal(4, candidate.call([1, 2, 3, 5, 4, 7, 9, 6]))\n assert_equal(1, candidate.call([1, 2, 3, 4, 3, 2, 2]))\n assert_equal(1, candidate.call([1, 4, 2]))\n assert_equal(1, candidate.call([1, 4, 4, 2]))\n assert_equal(0, candidate.call([1, 2, 3, 2, 1]))\n assert_equal(0, candidate.call([3, 1, 1, 3]))\n assert_equal(0, candidate.call([1]))\n assert_equal(1, candidate.call([0, 1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "rb", - "prompt": "# It is the last week of the semester and the teacher has to give the grades\n# to students. The teacher has been making her own algorithm for grading.\n# The only problem is, she has lost the code she used for grading.\n# She has given you an array of GPAs for some students and you have to write \n# a function that can output an array of letter grades using the following table:\n# GPA | Letter grade\n# 4.0 A+\n# > 3.7 A \n# > 3.3 A- \n# > 3.0 B+\n# > 2.7 B \n# > 2.3 B-\n# > 2.0 C+\n# > 1.7 C\n# > 1.3 C-\n# > 1.0 D+ \n# > 0.7 D \n# > 0.0 D-\n# 0.0 E\n# Example:\n# >>> grade_equation.call([4.0, 3, 1.7, 2, 3.5])\n# [\"A+\", \"B\", \"C-\", \"C\", \"A-\"]\ndef numerical_letter_grade(grades)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_numerical_letter_grade\n candidate = method(:numerical_letter_grade)\n assert_equal([\"A+\", \"B\", \"C-\", \"C\", \"A-\"], candidate.call([4.0, 3, 1.7, 2, 3.5]))\n assert_equal([\"D+\"], candidate.call([1.2]))\n assert_equal([\"D-\"], candidate.call([0.5]))\n assert_equal([\"E\"], candidate.call([0.0]))\n assert_equal([\"D\", \"D-\", \"C-\", \"B\", \"B+\"], candidate.call([1.0, 0.3, 1.5, 2.8, 3.3]))\n assert_equal([\"E\", \"D-\"], candidate.call([0.0, 0.7]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "rb", - "prompt": "# Given the lengths of the three sides of a triangle. Return the area of\n# the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n# Otherwise return -1\n# Three sides make a valid triangle when the sum of any two sides is greater \n# than the third side.\n# Example:\n# >>> triangle_area.call(3, 4, 5)\n# 6.0\n# >>> triangle_area.call(1, 2, 10)\n# -1\ndef triangle_area(a, b, c)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_triangle_area\n candidate = method(:triangle_area)\n assert_equal(6.0, candidate.call(3, 4, 5))\n assert_equal(-1, candidate.call(1, 2, 10))\n assert_equal(8.18, candidate.call(4, 8, 5))\n assert_equal(1.73, candidate.call(2, 2, 2))\n assert_equal(-1, candidate.call(1, 2, 3))\n assert_equal(16.25, candidate.call(10, 5, 7))\n assert_equal(-1, candidate.call(2, 6, 3))\n assert_equal(0.43, candidate.call(1, 1, 1))\n assert_equal(-1, candidate.call(2, 2, 10))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "rb", - "prompt": "# Check if two words have the same characters.\n# >>> same_chars.call(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\")\n# true\n# >>> same_chars.call(\"abcd\", \"dddddddabc\")\n# true\n# >>> same_chars.call(\"dddddddabc\", \"abcd\")\n# true\n# >>> same_chars.call(\"eabcd\", \"dddddddabc\")\n# false\n# >>> same_chars.call(\"abcd\", \"dddddddabce\")\n# false\n# >>> same_chars.call(\"eabcdzzzz\", \"dddzzzzzzzddddabc\")\n# false\ndef same_chars(s0, s1)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_same_chars\n candidate = method(:same_chars)\n assert_equal(true, candidate.call(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\"))\n assert_equal(true, candidate.call(\"abcd\", \"dddddddabc\"))\n assert_equal(true, candidate.call(\"dddddddabc\", \"abcd\"))\n assert_equal(false, candidate.call(\"eabcd\", \"dddddddabc\"))\n assert_equal(false, candidate.call(\"abcd\", \"dddddddabcf\"))\n assert_equal(false, candidate.call(\"eabcdzzzz\", \"dddzzzzzzzddddabc\"))\n assert_equal(false, candidate.call(\"aabb\", \"aaccc\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "rb", - "prompt": "# Given an array of integers nums, find the minimum sum of any non-empty sub-array\n# of nums.\n# Example\n# >>> minSubArraySum.call([2, 3, 4, 1, 2, 4])\n# 1\n# >>> minSubArraySum.call([-1, -2, -3])\n# -6\ndef minSubArraySum(nums)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_minSubArraySum\n candidate = method(:minSubArraySum)\n assert_equal(1, candidate.call([2, 3, 4, 1, 2, 4]))\n assert_equal(-6, candidate.call([-1, -2, -3]))\n assert_equal(-14, candidate.call([-1, -2, -3, 2, -10]))\n assert_equal(-9999999999999999, candidate.call([-9999999999999999]))\n assert_equal(0, candidate.call([0, 10, 20, 1000000]))\n assert_equal(-6, candidate.call([-1, -2, -3, 10, -5]))\n assert_equal(-6, candidate.call([100, -1, -2, -3, 10, -5]))\n assert_equal(3, candidate.call([10, 11, 13, 8, 3, 4]))\n assert_equal(-33, candidate.call([100, -33, 32, -1, 0, -2]))\n assert_equal(-10, candidate.call([-10]))\n assert_equal(7, candidate.call([7]))\n assert_equal(-1, candidate.call([1, -1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "rb", - "prompt": "# Given a string s and a natural number n, you have been tasked to implement \n# a function that returns an array of all words from string s that contain exactly \n# n consonants, in order these words appear in the string s.\n# If the string s is empty then the function should return an empty array.\n# Note: you may assume the input string contains only letters and spaces.\n# Examples:\n# >>> select_words.call(\"Mary had a little lamb\", 4)\n# [\"little\"]\n# >>> select_words.call(\"Mary had a little lamb\", 3)\n# [\"Mary\", \"lamb\"]\n# >>> select_words.call(\"simple white space\", 2)\n# []\n# >>> select_words.call(\"Hello world\", 4)\n# [\"world\"]\n# >>> select_words.call(\"Uncle sam\", 3)\n# [\"Uncle\"]\ndef select_words(s, n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_select_words\n candidate = method(:select_words)\n assert_equal([\"little\"], candidate.call(\"Mary had a little lamb\", 4))\n assert_equal([\"Mary\", \"lamb\"], candidate.call(\"Mary had a little lamb\", 3))\n assert_equal([], candidate.call(\"simple white space\", 2))\n assert_equal([\"world\"], candidate.call(\"Hello world\", 4))\n assert_equal([\"Uncle\"], candidate.call(\"Uncle sam\", 3))\n assert_equal([], candidate.call(\"\", 4))\n assert_equal([\"b\", \"c\", \"d\", \"f\"], candidate.call(\"a b c d e f\", 1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "rb", - "prompt": "# Return array of all prefixes from shortest to longest of the input string\n# >>> all_prefixes.call(\"abc\")\n# [\"a\", \"ab\", \"abc\"]\ndef all_prefixes(string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_all_prefixes\n candidate = method(:all_prefixes)\n assert_equal([], candidate.call(\"\"))\n assert_equal([\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"], candidate.call(\"asdfgh\"))\n assert_equal([\"W\", \"WW\", \"WWW\"], candidate.call(\"WWW\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "rb", - "prompt": "# Create a function that takes a value (string) representing a number\n# and returns the closest integer to it. If the number is equidistant\n# from two integers, round it away from zero.\n# Examples\n# >>> closest_integer.call(\"10\")\n# 10\n# >>> closest_integer.call(\"15.3\")\n# 15\n# Note:\n# Rounding away from zero means that if the given number is equidistant\n# from two integers, the one you should return is the one that is the\n# farthest from zero. For example closest_integer(\"14.5\") should\n# return 15 and closest_integer(\"-14.5\") should return -15.\ndef closest_integer(value)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_closest_integer\n candidate = method(:closest_integer)\n assert_equal(10, candidate.call(\"10\"))\n assert_equal(15, candidate.call(\"14.5\"))\n assert_equal(-16, candidate.call(\"-15.5\"))\n assert_equal(15, candidate.call(\"15.3\"))\n assert_equal(0, candidate.call(\"0\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "rb", - "prompt": "# Create a function which takes a string representing a file's name, and returns\n# 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n# A file's name is considered to be valid if and only if all the following conditions \n# are met:\n# - There should not be more than three digits ('0'-'9') in the file's name.\n# - The file's name contains exactly one dot '.'\n# - The substring before the dot should not be empty, and it starts with a letter from \n# the latin alphapet ('a'-'z' and 'A'-'Z').\n# - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n# Examples:\n# >>> file_name_check.call(\"example.txt\")\n# \"Yes\"\n# >>> file_name_check.call(\"1example.dll\")\n# \"No\"\ndef file_name_check(file_name)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_file_name_check\n candidate = method(:file_name_check)\n assert_equal(\"Yes\", candidate.call(\"example.txt\"))\n assert_equal(\"No\", candidate.call(\"1example.dll\"))\n assert_equal(\"No\", candidate.call(\"s1sdf3.asd\"))\n assert_equal(\"Yes\", candidate.call(\"K.dll\"))\n assert_equal(\"Yes\", candidate.call(\"MY16FILE3.exe\"))\n assert_equal(\"No\", candidate.call(\"His12FILE94.exe\"))\n assert_equal(\"No\", candidate.call(\"_Y.txt\"))\n assert_equal(\"No\", candidate.call(\"?aREYA.exe\"))\n assert_equal(\"No\", candidate.call(\"/this_is_valid.dll\"))\n assert_equal(\"No\", candidate.call(\"this_is_valid.wow\"))\n assert_equal(\"Yes\", candidate.call(\"this_is_valid.txt\"))\n assert_equal(\"No\", candidate.call(\"this_is_valid.txtexe\"))\n assert_equal(\"No\", candidate.call(\"#this2_i4s_5valid.ten\"))\n assert_equal(\"No\", candidate.call(\"@this1_is6_valid.exe\"))\n assert_equal(\"No\", candidate.call(\"this_is_12valid.6exe4.txt\"))\n assert_equal(\"No\", candidate.call(\"all.exe.txt\"))\n assert_equal(\"Yes\", candidate.call(\"I563_No.exe\"))\n assert_equal(\"Yes\", candidate.call(\"Is3youfault.txt\"))\n assert_equal(\"Yes\", candidate.call(\"no_one#knows.dll\"))\n assert_equal(\"No\", candidate.call(\"1I563_Yes3.exe\"))\n assert_equal(\"No\", candidate.call(\"I563_Yes3.txtt\"))\n assert_equal(\"No\", candidate.call(\"final..txt\"))\n assert_equal(\"No\", candidate.call(\"final132\"))\n assert_equal(\"No\", candidate.call(\"_f4indsartal132.\"))\n assert_equal(\"No\", candidate.call(\".txt\"))\n assert_equal(\"No\", candidate.call(\"s.\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "rb", - "prompt": "# You are given two intervals,\n# where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n# The given intervals are closed which means that the interval (start, end)\n# includes both start and end.\n# For each given interval, it is assumed that its start is less or equal its end.\n# Your task is to determine whether the length of intersection of these two \n# intervals is a prime number.\n# Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n# which its length is 1, which not a prime number.\n# If the length of the intersection is a prime number, return \"YES\",\n# otherwise, return \"NO\".\n# If the two intervals don't intersect, return \"NO\".\n# [input/output] samples:\n# >>> intersection.call([1, 2], [2, 3])\n# \"NO\"\n# >>> intersection.call([-1, 1], [0, 4])\n# \"NO\"\n# >>> intersection.call([-3, -1], [-5, 5])\n# \"YES\"\ndef intersection(interval1, interval2)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_intersection\n candidate = method(:intersection)\n assert_equal(\"NO\", candidate.call([1, 2], [2, 3]))\n assert_equal(\"NO\", candidate.call([-1, 1], [0, 4]))\n assert_equal(\"YES\", candidate.call([-3, -1], [-5, 5]))\n assert_equal(\"YES\", candidate.call([-2, 2], [-4, 0]))\n assert_equal(\"NO\", candidate.call([-11, 2], [-1, -1]))\n assert_equal(\"NO\", candidate.call([1, 2], [3, 5]))\n assert_equal(\"NO\", candidate.call([1, 2], [1, 2]))\n assert_equal(\"NO\", candidate.call([-2, -2], [-3, -2]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "rb", - "prompt": "# Return the largest prime factor of n. Assume n > 1 and is not a prime.\n# >>> largest_prime_factor.call(13195)\n# 29\n# >>> largest_prime_factor.call(2048)\n# 2\ndef largest_prime_factor(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_largest_prime_factor\n candidate = method(:largest_prime_factor)\n assert_equal(5, candidate.call(15))\n assert_equal(3, candidate.call(27))\n assert_equal(7, candidate.call(63))\n assert_equal(11, candidate.call(330))\n assert_equal(29, candidate.call(13195))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "rb", - "prompt": "# Given a string, find out how many distinct characters (regardless of case) does it consist of\n# >>> count_distinct_characters.call(\"xyzXYZ\")\n# 3\n# >>> count_distinct_characters.call(\"Jerry\")\n# 4\ndef count_distinct_characters(string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_count_distinct_characters\n candidate = method(:count_distinct_characters)\n assert_equal(0, candidate.call(\"\"))\n assert_equal(5, candidate.call(\"abcde\"))\n assert_equal(5, candidate.call(\"abcdecadeCADE\"))\n assert_equal(1, candidate.call(\"aaaaAAAAaaaa\"))\n assert_equal(5, candidate.call(\"Jerry jERRY JeRRRY\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "rb", - "prompt": "# You're given an array of deposit and withdrawal operations on a bank account that starts with\n# zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n# at that point function should return true. Otherwise it should return false.\n# >>> below_zero.call([1, 2, 3])\n# false\n# >>> below_zero.call([1, 2, -4, 5])\n# true\ndef below_zero(operations)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_below_zero\n candidate = method(:below_zero)\n assert_equal(false, candidate.call([]))\n assert_equal(false, candidate.call([1, 2, -3, 1, 2, -3]))\n assert_equal(true, candidate.call([1, 2, -4, 5, 6]))\n assert_equal(false, candidate.call([1, -1, 2, -2, 5, -5, 4, -4]))\n assert_equal(true, candidate.call([1, -1, 2, -2, 5, -5, 4, -5]))\n assert_equal(true, candidate.call([1, -2, 2, -2, 5, -5, 4, -4]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "rb", - "prompt": "# Find the shortest palindrome that begins with a supplied string.\n# Algorithm idea is simple:\n# - Find the longest postfix of supplied string that is a palindrome.\n# - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n# >>> make_palindrome.call(\"\")\n# \"\"\n# >>> make_palindrome.call(\"cat\")\n# \"catac\"\n# >>> make_palindrome.call(\"cata\")\n# \"catac\"\ndef make_palindrome(string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_make_palindrome\n candidate = method(:make_palindrome)\n assert_equal(\"\", candidate.call(\"\"))\n assert_equal(\"x\", candidate.call(\"x\"))\n assert_equal(\"xyzyx\", candidate.call(\"xyz\"))\n assert_equal(\"xyx\", candidate.call(\"xyx\"))\n assert_equal(\"jerryrrej\", candidate.call(\"jerry\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "rb", - "prompt": "# Given a positive integer, obtain its roman numeral equivalent as a string,\n# and return it in lowercase.\n# Restrictions: 1 <= num <= 1000\n# Examples:\n# >>> int_to_mini_roman.call(19)\n# \"xix\"\n# >>> int_to_mini_roman.call(152)\n# \"clii\"\n# >>> int_to_mini_roman.call(426)\n# \"cdxxvi\"\ndef int_to_mini_roman(number)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "reworded", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_int_to_mini_roman\n candidate = method(:int_to_mini_roman)\n assert_equal(\"xix\", candidate.call(19))\n assert_equal(\"clii\", candidate.call(152))\n assert_equal(\"ccli\", candidate.call(251))\n assert_equal(\"cdxxvi\", candidate.call(426))\n assert_equal(\"d\", candidate.call(500))\n assert_equal(\"i\", candidate.call(1))\n assert_equal(\"iv\", candidate.call(4))\n assert_equal(\"xliii\", candidate.call(43))\n assert_equal(\"xc\", candidate.call(90))\n assert_equal(\"xciv\", candidate.call(94))\n assert_equal(\"dxxxii\", candidate.call(532))\n assert_equal(\"cm\", candidate.call(900))\n assert_equal(\"cmxciv\", candidate.call(994))\n assert_equal(\"m\", candidate.call(1000))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - } -] \ No newline at end of file diff --git a/data/rb-transform.json b/data/rb-transform.json deleted file mode 100644 index 4fdb7d81f2d81461871b8d5361baefc0569fdcc8..0000000000000000000000000000000000000000 --- a/data/rb-transform.json +++ /dev/null @@ -1,2417 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "rb", - "prompt": "# For a given number n, find the largest number that divides n evenly, smaller than n\n# >>> largest_divisor.call(15)\n# 5\ndef largest_divisor(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_largest_divisor\n candidate = method(:largest_divisor)\n assert_equal(1, candidate.call(3))\n assert_equal(1, candidate.call(7))\n assert_equal(5, candidate.call(10))\n assert_equal(50, candidate.call(100))\n assert_equal(7, candidate.call(49))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_47_median", - "language": "rb", - "prompt": "# Return median of elements in the list l.\n# >>> median.call([3, 1, 2, 4, 5])\n# 3\n# >>> median.call([-10, 4, 6, 1000, 10, 20])\n# 15.0\ndef median(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_median\n candidate = method(:median)\n assert_equal(3, candidate.call([3, 1, 2, 4, 5]))\n assert_equal(8.0, candidate.call([-10, 4, 6, 1000, 10, 20]))\n assert_equal(5, candidate.call([5]))\n assert_equal(5.5, candidate.call([6, 5]))\n assert_equal(7, candidate.call([8, 1, 3, 9, 9, 2, 7]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "rb", - "prompt": "# Given two lists operator, and operand. The first list has basic algebra operations, and \n# the second list is a list of integers. Use the two given lists to build the algebric \n# expression and return the evaluation of this expression.\n# The basic algebra operations:\n# Addition ( + ) \n# Subtraction ( - ) \n# Multiplication ( * ) \n# Floor division ( // ) \n# Exponentiation ( ** ) \n# Example:\n# operator['+', '*', '-']\n# array = [2, 3, 4, 5]\n# result = 2 + 3 * 4 - 5\n# => result = 9\n# Note:\n# The length of operator list is equal to the length of operand list minus one.\n# Operand is a list of of non-negative integers.\n# Operator list has at least one operator, and operand list has at least two operands.\ndef do_algebra(operator, operand)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_do_algebra\n candidate = method(:do_algebra)\n assert_equal(37, candidate.call([\"**\", \"*\", \"+\"], [2, 3, 4, 5]))\n assert_equal(9, candidate.call([\"+\", \"*\", \"-\"], [2, 3, 4, 5]))\n assert_equal(8, candidate.call([\"//\", \"*\"], [7, 3, 4]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "rb", - "prompt": "# Return maximum element in the list.\n# >>> max_element.call([1, 2, 3])\n# 3\n# >>> max_element.call([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n# 123\ndef max_element(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_max_element\n candidate = method(:max_element)\n assert_equal(3, candidate.call([1, 2, 3]))\n assert_equal(124, candidate.call([5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "rb", - "prompt": "# Create a function which returns the largest index of an element which\n# is not greater than or equal to the element immediately preceding it. If\n# no such element exists then return -1. The given array will not contain\n# duplicate values.\n# Examples:\n# >>> can_arrange.call([1, 2, 4, 3, 5])\n# 3\n# >>> can_arrange.call([1, 2, 3])\n# -1\ndef can_arrange(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_can_arrange\n candidate = method(:can_arrange)\n assert_equal(3, candidate.call([1, 2, 4, 3, 5]))\n assert_equal(-1, candidate.call([1, 2, 4, 5]))\n assert_equal(2, candidate.call([1, 4, 2, 5, 6, 7, 8, 9, 10]))\n assert_equal(4, candidate.call([4, 8, 5, 7, 3]))\n assert_equal(-1, candidate.call([]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "rb", - "prompt": "# Imagine a road that's a perfectly straight infinitely long line.\n# n cars are driving left to right; simultaneously, a different set of n cars\n# are driving right to left. The two sets of cars start out being very far from\n# each other. All cars move in the same speed. Two cars are said to collide\n# when a car that's moving left to right hits a car that's moving right to left.\n# However, the cars are infinitely sturdy and strong; as a result, they continue moving\n# in their trajectory as if they did not collide.\n# This function outputs the number of such collisions.\ndef car_race_collision(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_car_race_collision\n candidate = method(:car_race_collision)\n assert_equal(4, candidate.call(2))\n assert_equal(9, candidate.call(3))\n assert_equal(16, candidate.call(4))\n assert_equal(64, candidate.call(8))\n assert_equal(100, candidate.call(10))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "rb", - "prompt": "# Create a function that returns True if the last character\n# of a given string is an alphabetical character and is not\n# a part of a word, and False otherwise.\n# Note: \"word\" is a group of characters separated by space.\n# Examples:\n# >>> check_if_last_char_is_a_letter.call(\"apple pie\")\n# false\n# >>> check_if_last_char_is_a_letter.call(\"apple pi e\")\n# true\n# >>> check_if_last_char_is_a_letter.call(\"apple pi e \")\n# false\n# >>> check_if_last_char_is_a_letter.call(\"\")\n# false\ndef check_if_last_char_is_a_letter(txt)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_check_if_last_char_is_a_letter\n candidate = method(:check_if_last_char_is_a_letter)\n assert_equal(false, candidate.call(\"apple\"))\n assert_equal(true, candidate.call(\"apple pi e\"))\n assert_equal(false, candidate.call(\"eeeee\"))\n assert_equal(true, candidate.call(\"A\"))\n assert_equal(false, candidate.call(\"Pumpkin pie \"))\n assert_equal(false, candidate.call(\"Pumpkin pie 1\"))\n assert_equal(false, candidate.call(\"\"))\n assert_equal(false, candidate.call(\"eeeee e \"))\n assert_equal(false, candidate.call(\"apple pie\"))\n assert_equal(false, candidate.call(\"apple pi e \"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "rb", - "prompt": "# Return true if a given number is prime, and false otherwise.\n# >>> is_prime.call(6)\n# false\n# >>> is_prime.call(101)\n# true\n# >>> is_prime.call(11)\n# true\n# >>> is_prime.call(13441)\n# true\n# >>> is_prime.call(61)\n# true\n# >>> is_prime.call(4)\n# false\n# >>> is_prime.call(1)\n# false\ndef is_prime(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_prime\n candidate = method(:is_prime)\n assert_equal(false, candidate.call(6))\n assert_equal(true, candidate.call(101))\n assert_equal(true, candidate.call(11))\n assert_equal(true, candidate.call(13441))\n assert_equal(true, candidate.call(61))\n assert_equal(false, candidate.call(4))\n assert_equal(false, candidate.call(1))\n assert_equal(true, candidate.call(5))\n assert_equal(true, candidate.call(11))\n assert_equal(true, candidate.call(17))\n assert_equal(false, candidate.call(85))\n assert_equal(false, candidate.call(77))\n assert_equal(false, candidate.call(255379))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "rb", - "prompt": "# Given a list of positive integers x. return a sorted list of all \n# elements that hasn't any even digit.\n# Note: Returned list should be sorted in increasing order.\n# For example:\n# >>> unique_digits.call([15, 33, 1422, 1])\n# [1, 15, 33]\n# >>> unique_digits.call([152, 323, 1422, 10])\n# []\ndef unique_digits(x)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_unique_digits\n candidate = method(:unique_digits)\n assert_equal([1, 15, 33], candidate.call([15, 33, 1422, 1]))\n assert_equal([], candidate.call([152, 323, 1422, 10]))\n assert_equal([111, 151], candidate.call([12345, 2033, 111, 151]))\n assert_equal([31, 135], candidate.call([135, 103, 31]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "rb", - "prompt": "# Input are two strings a and b consisting only of 1s and 0s.\n# Perform binary XOR on these inputs and return result also as a string.\n# >>> string_xor.call(\"010\", \"110\")\n# \"100\"\ndef string_xor(a, b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_string_xor\n candidate = method(:string_xor)\n assert_equal(\"010010\", candidate.call(\"111000\", \"101010\"))\n assert_equal(\"0\", candidate.call(\"1\", \"1\"))\n assert_equal(\"0101\", candidate.call(\"0101\", \"0000\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "rb", - "prompt": "# sum_to_n is a function that sums numbers from 1 to n.\n# >>> sum_to_n.call(30)\n# 465\n# >>> sum_to_n.call(100)\n# 5050\n# >>> sum_to_n.call(5)\n# 15\n# >>> sum_to_n.call(10)\n# 55\n# >>> sum_to_n.call(1)\n# 1\ndef sum_to_n(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sum_to_n\n candidate = method(:sum_to_n)\n assert_equal(1, candidate.call(1))\n assert_equal(21, candidate.call(6))\n assert_equal(66, candidate.call(11))\n assert_equal(465, candidate.call(30))\n assert_equal(5050, candidate.call(100))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "rb", - "prompt": "# Given a list of numbers, return the sum of squares of the numbers\n# in the list that are odd. Ignore numbers that are negative or not integers.\n# >>> double_the_difference.call([1, 3, 2, 0])\n# 10\n# >>> double_the_difference.call([-1, -2, 0])\n# 0\n# >>> double_the_difference.call([9, -2])\n# 81\n# >>> double_the_difference.call([0])\n# 0\n# If the input list is empty, return 0.\ndef double_the_difference(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_double_the_difference\n candidate = method(:double_the_difference)\n assert_equal(0, candidate.call([]))\n assert_equal(25, candidate.call([5.0, 4.0]))\n assert_equal(0, candidate.call([0.1, 0.2, 0.3]))\n assert_equal(0, candidate.call([-10.0, -20.0, -30.0]))\n assert_equal(0, candidate.call([-1.0, -2.0, 8.0]))\n assert_equal(34, candidate.call([0.2, 3.0, 5.0]))\n assert_equal(165, candidate.call([-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "rb", - "prompt": "# Return length of given string\n# >>> strlen.call(\"\")\n# 0\n# >>> strlen.call(\"abc\")\n# 3\ndef strlen(string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_strlen\n candidate = method(:strlen)\n assert_equal(0, candidate.call(\"\"))\n assert_equal(1, candidate.call(\"x\"))\n assert_equal(9, candidate.call(\"asdasnakj\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "rb", - "prompt": "# You'll be given a string of words, and your task is to count the number\n# of boredoms. A boredom is a sentence that starts with the word \"I\".\n# Sentences are delimited by '.', '?' or '!'.\n# For example:\n# >>> is_bored.call(\"Hello world\")\n# 0\n# >>> is_bored.call(\"The sky is blue. The sun is shining. I love this weather\")\n# 1\ndef is_bored(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_bored\n candidate = method(:is_bored)\n assert_equal(0, candidate.call(\"Hello world\"))\n assert_equal(0, candidate.call(\"Is the sky blue?\"))\n assert_equal(1, candidate.call(\"I love It !\"))\n assert_equal(0, candidate.call(\"bIt\"))\n assert_equal(2, candidate.call(\"I feel good today. I will be productive. will kill It\"))\n assert_equal(0, candidate.call(\"You and I are going for a walk\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "rb", - "prompt": "# Write a function vowels_count which takes a string representing\n# a word as input and returns the number of vowels in the string.\n# Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n# vowel, but only when it is at the end of the given word.\n# Example:\n# >>> vowels_count.call(\"abcde\")\n# 2\n# >>> vowels_count.call(\"ACEDY\")\n# 3\ndef vowels_count(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_vowels_count\n candidate = method(:vowels_count)\n assert_equal(2, candidate.call(\"abcde\"))\n assert_equal(3, candidate.call(\"Alone\"))\n assert_equal(2, candidate.call(\"key\"))\n assert_equal(1, candidate.call(\"bye\"))\n assert_equal(2, candidate.call(\"keY\"))\n assert_equal(1, candidate.call(\"bYe\"))\n assert_equal(3, candidate.call(\"ACEDY\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "rb", - "prompt": "# Return n-th Fibonacci number.\n# >>> fib.call(10)\n# 55\n# >>> fib.call(1)\n# 1\n# >>> fib.call(8)\n# 21\ndef fib(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_fib\n candidate = method(:fib)\n assert_equal(55, candidate.call(10))\n assert_equal(1, candidate.call(1))\n assert_equal(21, candidate.call(8))\n assert_equal(89, candidate.call(11))\n assert_equal(144, candidate.call(12))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "rb", - "prompt": "# Your task is to implement a function that will simplify the expression\n# x * n. The function returns True if x * n evaluates to a whole number and False\n# otherwise. Both x and n, are string representation of a fraction, and have the following format,\n# / where both numerator and denominator are positive whole numbers.\n# You can assume that x, and n are valid fractions, and do not have zero as denominator.\n# >>> simplify.call(\"1/5\", \"5/1\")\n# true\n# >>> simplify.call(\"1/6\", \"2/1\")\n# false\n# >>> simplify.call(\"7/10\", \"10/2\")\n# false\ndef simplify(x, n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_simplify\n candidate = method(:simplify)\n assert_equal(true, candidate.call(\"1/5\", \"5/1\"))\n assert_equal(false, candidate.call(\"1/6\", \"2/1\"))\n assert_equal(true, candidate.call(\"5/1\", \"3/1\"))\n assert_equal(false, candidate.call(\"7/10\", \"10/2\"))\n assert_equal(true, candidate.call(\"2/10\", \"50/10\"))\n assert_equal(true, candidate.call(\"7/2\", \"4/2\"))\n assert_equal(true, candidate.call(\"11/6\", \"6/1\"))\n assert_equal(false, candidate.call(\"2/3\", \"5/2\"))\n assert_equal(false, candidate.call(\"5/2\", \"3/5\"))\n assert_equal(true, candidate.call(\"2/4\", \"8/4\"))\n assert_equal(true, candidate.call(\"2/4\", \"4/2\"))\n assert_equal(true, candidate.call(\"1/5\", \"5/1\"))\n assert_equal(false, candidate.call(\"1/5\", \"1/5\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "rb", - "prompt": "# Given a string s, count the number of uppercase vowels in even indices.\n# For example:\n# >>> count_upper.call(\"aBCdEf\")\n# 1\n# >>> count_upper.call(\"abcdefg\")\n# 0\n# >>> count_upper.call(\"dBBE\")\n# 0\ndef count_upper(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_count_upper\n candidate = method(:count_upper)\n assert_equal(1, candidate.call(\"aBCdEf\"))\n assert_equal(0, candidate.call(\"abcdefg\"))\n assert_equal(0, candidate.call(\"dBBE\"))\n assert_equal(0, candidate.call(\"B\"))\n assert_equal(1, candidate.call(\"U\"))\n assert_equal(0, candidate.call(\"\"))\n assert_equal(2, candidate.call(\"EEEE\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "rb", - "prompt": "# You are given a rectangular grid of wells. Each row represents a single well,\n# and each 1 in a row represents a single unit of water.\n# Each well has a corresponding bucket that can be used to extract water from it, \n# and all buckets have the same capacity.\n# Your task is to use the buckets to empty the wells.\n# Output the number of times you need to lower the buckets.\n# Example 1:\n# >>> max_fill.call([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1)\n# 6\n# Example 2:\n# >>> max_fill.call([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2)\n# 5\n# Example 3:\n# >>> max_fill.call([[0, 0, 0], [0, 0, 0]], 5)\n# 0\n# Constraints:\n# * all wells have the same length\n# * 1 <= grid.length <= 10^2\n# * 1 <= grid[:,1].length <= 10^2\n# * grid[i][j] -> 0 | 1\n# * 1 <= capacity <= 10\ndef max_fill(grid, capacity)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_max_fill\n candidate = method(:max_fill)\n assert_equal(6, candidate.call([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1))\n assert_equal(5, candidate.call([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2))\n assert_equal(0, candidate.call([[0, 0, 0], [0, 0, 0]], 5))\n assert_equal(4, candidate.call([[1, 1, 1, 1], [1, 1, 1, 1]], 2))\n assert_equal(2, candidate.call([[1, 1, 1, 1], [1, 1, 1, 1]], 9))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "rb", - "prompt": "# Given an array arr of integers and a positive integer k, return a sorted list \n# of length k with the maximum k numbers in arr.\n# Example 1:\n# >>> maximum.call([-3, -4, 5], 3)\n# [-4, -3, 5]\n# Example 2:\n# >>> maximum.call([4, -4, 4], 2)\n# [4, 4]\n# Example 3:\n# >>> maximum.call([-3, 2, 1, 2, -1, -2, 1], 1)\n# [2]\n# Note:\n# 1. The length of the array will be in the range of [1, 1000].\n# 2. The elements in the array will be in the range of [-1000, 1000].\n# 3. 0 <= k <= len(arr)\ndef maximum(arr, k)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_maximum\n candidate = method(:maximum)\n assert_equal([-4, -3, 5], candidate.call([-3, -4, 5], 3))\n assert_equal([4, 4], candidate.call([4, -4, 4], 2))\n assert_equal([2], candidate.call([-3, 2, 1, 2, -1, -2, 1], 1))\n assert_equal([2, 20, 123], candidate.call([123, -123, 20, 0, 1, 2, -3], 3))\n assert_equal([0, 1, 2, 20], candidate.call([-123, 20, 0, 1, 2, -3], 4))\n assert_equal([-13, -8, 0, 0, 3, 5, 15], candidate.call([5, 15, 0, 3, -13, -8, 0], 7))\n assert_equal([3, 5], candidate.call([-1, 0, 2, 5, 3, -10], 2))\n assert_equal([5], candidate.call([1, 0, 5, -7], 1))\n assert_equal([-4, 4], candidate.call([4, -4], 2))\n assert_equal([-10, 10], candidate.call([-10, 10], 2))\n assert_equal([], candidate.call([1, 2, 3, -23, 243, -400, 0], 0))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "rb", - "prompt": "# Write a function that takes a message, and encodes in such a \n# way that it swaps case of all letters, replaces all vowels in \n# the message with the letter that appears 2 places ahead of that \n# vowel in the english alphabet. \n# Assume only letters. \n# Examples:\n# >>> encode.call(\"test\")\n# \"TGST\"\n# >>> encode.call(\"This is a message\")\n# \"tHKS KS C MGSSCGG\"\ndef encode(message)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_encode\n candidate = method(:encode)\n assert_equal(\"tgst\", candidate.call(\"TEST\"))\n assert_equal(\"mWDCSKR\", candidate.call(\"Mudasir\"))\n assert_equal(\"ygs\", candidate.call(\"YES\"))\n assert_equal(\"tHKS KS C MGSSCGG\", candidate.call(\"This is a message\"))\n assert_equal(\"k dQnT kNqW wHcT Tq wRkTg\", candidate.call(\"I DoNt KnOw WhAt tO WrItE\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "rb", - "prompt": "# remove_vowels is a function that takes string and returns string without vowels.\n# >>> remove_vowels.call(\"\")\n# \"\"\n# >>> remove_vowels.call(\"abcdef\")\n# \"bcdf\"\n# >>> remove_vowels.call(\"aaaaa\")\n# \"\"\n# >>> remove_vowels.call(\"aaBAA\")\n# \"B\"\n# >>> remove_vowels.call(\"zbcd\")\n# \"zbcd\"\ndef remove_vowels(text)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_remove_vowels\n candidate = method(:remove_vowels)\n assert_equal(\"\", candidate.call(\"\"))\n assert_equal(\"bcdf\nghjklm\", candidate.call(\"abcdef\nghijklm\"))\n assert_equal(\"fdcb\", candidate.call(\"fedcba\"))\n assert_equal(\"\", candidate.call(\"eeeee\"))\n assert_equal(\"cB\", candidate.call(\"acBAA\"))\n assert_equal(\"cB\", candidate.call(\"EcBOO\"))\n assert_equal(\"ybcd\", candidate.call(\"ybcd\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "rb", - "prompt": "# Return only positive numbers in the list.\n# >>> get_positive.call([-1, 2, -4, 5, 6])\n# [2, 5, 6]\n# >>> get_positive.call([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n# [5, 3, 2, 3, 9, 123, 1]\ndef get_positive(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_get_positive\n candidate = method(:get_positive)\n assert_equal([4, 5, 6], candidate.call([-1, -2, 4, 5, 6]))\n assert_equal([5, 3, 2, 3, 3, 9, 123, 1], candidate.call([5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]))\n assert_equal([], candidate.call([-1, -2]))\n assert_equal([], candidate.call([]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "rb", - "prompt": "# Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n# >>> string_sequence.call(0)\n# \"0\"\n# >>> string_sequence.call(5)\n# \"0 1 2 3 4 5\"\ndef string_sequence(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_string_sequence\n candidate = method(:string_sequence)\n assert_equal(\"0\", candidate.call(0))\n assert_equal(\"0 1 2 3\", candidate.call(3))\n assert_equal(\"0 1 2 3 4 5 6 7 8 9 10\", candidate.call(10))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "rb", - "prompt": "# Given a positive integer n, you have to make a pile of n levels of stones.\n# The first level has n stones.\n# The number of stones in the next level is:\n# - the next odd number if n is odd.\n# - the next even number if n is even.\n# Return the number of stones in each level in a list, where element at index\n# i represents the number of stones in the level (i+1).\n# Examples:\n# >>> make_a_pile.call(3)\n# [3, 5, 7]\ndef make_a_pile(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_make_a_pile\n candidate = method(:make_a_pile)\n assert_equal([3, 5, 7], candidate.call(3))\n assert_equal([4, 6, 8, 10], candidate.call(4))\n assert_equal([5, 7, 9, 11, 13], candidate.call(5))\n assert_equal([6, 8, 10, 12, 14, 16], candidate.call(6))\n assert_equal([8, 10, 12, 14, 16, 18, 20, 22], candidate.call(8))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "rb", - "prompt": "# Task\n# 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\n# then check if the result string is palindrome.\n# A string is called palindrome if it reads the same backward as forward.\n# You should return a tuple containing the result string and True/False for the check.\n# Example\n# >>> reverse_delete.call(\"abcde\", \"ae\")\n# [\"bcd\", false]\n# >>> reverse_delete.call(\"abcdef\", \"b\")\n# [\"acdef\", false]\n# >>> reverse_delete.call(\"abcdedcba\", \"ab\")\n# [\"cdedc\", true]\ndef reverse_delete(s, c)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_reverse_delete\n candidate = method(:reverse_delete)\n assert_equal([\"bcd\", false], candidate.call(\"abcde\", \"ae\"))\n assert_equal([\"acdef\", false], candidate.call(\"abcdef\", \"b\"))\n assert_equal([\"cdedc\", true], candidate.call(\"abcdedcba\", \"ab\"))\n assert_equal([\"dik\", false], candidate.call(\"dwik\", \"w\"))\n assert_equal([\"\", true], candidate.call(\"a\", \"a\"))\n assert_equal([\"abcdedcba\", true], candidate.call(\"abcdedcba\", \"\"))\n assert_equal([\"abcdedcba\", true], candidate.call(\"abcdedcba\", \"v\"))\n assert_equal([\"abba\", true], candidate.call(\"vabba\", \"v\"))\n assert_equal([\"\", true], candidate.call(\"mamma\", \"mia\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "rb", - "prompt": "# For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n# >>> flip_case.call(\"Hello\")\n# \"hELLO\"\ndef flip_case(string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_flip_case\n candidate = method(:flip_case)\n assert_equal(\"\", candidate.call(\"\"))\n assert_equal(\"hELLO!\", candidate.call(\"Hello!\"))\n assert_equal(\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\", candidate.call(\"These violent delights have violent ends\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "rb", - "prompt": "# You are given a string s.\n# if s[i] is a letter, reverse its case from lower to upper or vise versa, \n# otherwise keep it as it is.\n# If the string contains no letters, reverse the string.\n# The function should return the resulted string.\n# Examples\n# >>> solve.call(\"1234\")\n# \"4321\"\n# >>> solve.call(\"ab\")\n# \"AB\"\n# >>> solve.call(\"#a@C\")\n# \"#A@c\"\ndef solve(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_solve\n candidate = method(:solve)\n assert_equal(\"aSdF\", candidate.call(\"AsDf\"))\n assert_equal(\"4321\", candidate.call(\"1234\"))\n assert_equal(\"AB\", candidate.call(\"ab\"))\n assert_equal(\"#A@c\", candidate.call(\"#a@C\"))\n assert_equal(\"#aSDFw^45\", candidate.call(\"#AsdfW^45\"))\n assert_equal(\"2@6#\", candidate.call(\"#6@2\"))\n assert_equal(\"#$A^d\", candidate.call(\"#$a^D\"))\n assert_equal(\"#CCC\", candidate.call(\"#ccc\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "rb", - "prompt": "# Filter an input list of strings only for ones that start with a given prefix.\n# >>> filter_by_prefix.call([], \"a\")\n# []\n# >>> filter_by_prefix.call([\"abc\", \"bcd\", \"cde\", \"array\"], \"a\")\n# [\"abc\", \"array\"]\ndef filter_by_prefix(strings, prefix)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_filter_by_prefix\n candidate = method(:filter_by_prefix)\n assert_equal([], candidate.call([], \"john\"))\n assert_equal([\"xxx\", \"xxxAAA\", \"xxx\"], candidate.call([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "rb", - "prompt": "# This function takes two positive numbers x and y and returns the\n# biggest even integer number that is in the range [x, y] inclusive. If \n# there's no such number, then the function should return -1.\n# For example:\n# >>> choose_num.call(12, 15)\n# 14\n# >>> choose_num.call(13, 12)\n# -1\ndef choose_num(x, y)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_choose_num\n candidate = method(:choose_num)\n assert_equal(14, candidate.call(12, 15))\n assert_equal(-1, candidate.call(13, 12))\n assert_equal(12354, candidate.call(33, 12354))\n assert_equal(-1, candidate.call(5234, 5233))\n assert_equal(28, candidate.call(6, 29))\n assert_equal(-1, candidate.call(27, 10))\n assert_equal(-1, candidate.call(7, 7))\n assert_equal(546, candidate.call(546, 546))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "rb", - "prompt": "# You are given a string representing a sentence,\n# the sentence contains some words separated by a space,\n# and you have to return a string that contains the words from the original sentence,\n# whose lengths are prime numbers,\n# the order of the words in the new string should be the same as the original one.\n# Example 1:\n# >>> words_in_sentence.call(\"This is a test\")\n# \"is\"\n# Example 2:\n# >>> words_in_sentence.call(\"lets go for swimming\")\n# \"go for\"\n# Constraints:\n# * 1 <= len(sentence) <= 100\n# * sentence contains only letters\ndef words_in_sentence(sentence)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_words_in_sentence\n candidate = method(:words_in_sentence)\n assert_equal(\"is\", candidate.call(\"This is a test\"))\n assert_equal(\"go for\", candidate.call(\"lets go for swimming\"))\n assert_equal(\"there is no place\", candidate.call(\"there is no place available here\"))\n assert_equal(\"Hi am Hussein\", candidate.call(\"Hi I am Hussein\"))\n assert_equal(\"go for it\", candidate.call(\"go for it\"))\n assert_equal(\"\", candidate.call(\"here\"))\n assert_equal(\"is\", candidate.call(\"here is\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "rb", - "prompt": "# Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n# >>> intersperse.call([], 4)\n# []\n# >>> intersperse.call([1, 2, 3], 4)\n# [1, 4, 2, 4, 3]\ndef intersperse(numbers, delimeter)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_intersperse\n candidate = method(:intersperse)\n assert_equal([], candidate.call([], 7))\n assert_equal([5, 8, 6, 8, 3, 8, 2], candidate.call([5, 6, 3, 2], 8))\n assert_equal([2, 2, 2, 2, 2], candidate.call([2, 2, 2], 2))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "rb", - "prompt": "# Your task is to write a function that returns true if a number x is a simple\n# power of n and false in other cases.\n# x is a simple power of n if n**int=x\n# For example:\n# >>> is_simple_power.call(1, 4)\n# true\n# >>> is_simple_power.call(2, 2)\n# true\n# >>> is_simple_power.call(8, 2)\n# true\n# >>> is_simple_power.call(3, 2)\n# false\n# >>> is_simple_power.call(3, 1)\n# false\n# >>> is_simple_power.call(5, 3)\n# false\ndef is_simple_power(x, n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_simple_power\n candidate = method(:is_simple_power)\n assert_equal(true, candidate.call(16, 2))\n assert_equal(false, candidate.call(143214, 16))\n assert_equal(true, candidate.call(4, 2))\n assert_equal(true, candidate.call(9, 3))\n assert_equal(true, candidate.call(16, 4))\n assert_equal(false, candidate.call(24, 2))\n assert_equal(false, candidate.call(128, 4))\n assert_equal(false, candidate.call(12, 6))\n assert_equal(true, candidate.call(1, 1))\n assert_equal(true, candidate.call(1, 12))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "rb", - "prompt": "# Write a function that returns true if the given number is the multiplication of 3 prime numbers\n# and false otherwise.\n# Knowing that (a) is less then 100. \n# Example:\n# >>> is_multiply_prime.call(30)\n# true\n# 30 = 2 * 3 * 5\ndef is_multiply_prime(a)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_multiply_prime\n candidate = method(:is_multiply_prime)\n assert_equal(false, candidate.call(5))\n assert_equal(true, candidate.call(30))\n assert_equal(true, candidate.call(8))\n assert_equal(false, candidate.call(10))\n assert_equal(true, candidate.call(125))\n assert_equal(true, candidate.call(105))\n assert_equal(false, candidate.call(126))\n assert_equal(false, candidate.call(729))\n assert_equal(false, candidate.call(891))\n assert_equal(true, candidate.call(1001))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "rb", - "prompt": "# Given the lengths of the three sides of a triangle. Return True if the three\n# sides form a right-angled triangle, False otherwise.\n# A right-angled triangle is a triangle in which one angle is right angle or \n# 90 degree.\n# Example:\n# >>> right_angle_triangle.call(3, 4, 5)\n# true\n# >>> right_angle_triangle.call(1, 2, 3)\n# false\ndef right_angle_triangle(a, b, c)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_right_angle_triangle\n candidate = method(:right_angle_triangle)\n assert_equal(true, candidate.call(3, 4, 5))\n assert_equal(false, candidate.call(1, 2, 3))\n assert_equal(true, candidate.call(10, 6, 8))\n assert_equal(false, candidate.call(2, 2, 2))\n assert_equal(true, candidate.call(7, 24, 25))\n assert_equal(false, candidate.call(10, 5, 7))\n assert_equal(true, candidate.call(5, 12, 13))\n assert_equal(true, candidate.call(15, 8, 17))\n assert_equal(true, candidate.call(48, 55, 73))\n assert_equal(false, candidate.call(1, 1, 1))\n assert_equal(false, candidate.call(2, 2, 10))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "rb", - "prompt": "# Create a function that takes 3 numbers.\n# Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n# Returns false in any other cases.\n# Examples\n# >>> any_int.call(5, 2, 7)\n# true\n# >>> any_int.call(3, 2, 2)\n# false\n# >>> any_int.call(3, -2, 1)\n# true\n# >>> any_int.call(3.6, -2.2, 2)\n# false\ndef any_int(x, y, z)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_any_int\n candidate = method(:any_int)\n assert_equal(true, candidate.call(2, 3, 1))\n assert_equal(false, candidate.call(2.5, 2, 3))\n assert_equal(false, candidate.call(1.5, 5, 3.5))\n assert_equal(false, candidate.call(2, 6, 2))\n assert_equal(true, candidate.call(4, 2, 2))\n assert_equal(false, candidate.call(2.2, 2.2, 2.2))\n assert_equal(true, candidate.call(-4, 6, 2))\n assert_equal(true, candidate.call(2, 1, 1))\n assert_equal(true, candidate.call(3, 4, 7))\n assert_equal(false, candidate.call(3.0, 4, 7))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "rb", - "prompt": "# This function takes a list l and returns a list l' such that\n# l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n# to the values of the corresponding indicies of l, but sorted.\n# >>> sort_third.call([1, 2, 3])\n# [1, 2, 3]\n# >>> sort_third.call([5, 6, 3, 4, 8, 9, 2])\n# [2, 6, 3, 4, 8, 9, 5]\ndef sort_third(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sort_third\n candidate = method(:sort_third)\n assert_equal([2, 6, 3, 4, 8, 9, 5], candidate.call([5, 6, 3, 4, 8, 9, 2]))\n assert_equal([2, 8, 3, 4, 6, 9, 5], candidate.call([5, 8, 3, 4, 6, 9, 2]))\n assert_equal([2, 6, 9, 4, 8, 3, 5], candidate.call([5, 6, 9, 4, 8, 3, 2]))\n assert_equal([2, 6, 3, 4, 8, 9, 5, 1], candidate.call([5, 6, 3, 4, 8, 9, 2, 1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_53_add", - "language": "rb", - "prompt": "# Add two numbers x and y\n# >>> add.call(2, 3)\n# 5\n# >>> add.call(5, 7)\n# 12\ndef add(x, y)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_add\n candidate = method(:add)\n assert_equal(1, candidate.call(0, 1))\n assert_equal(1, candidate.call(1, 0))\n assert_equal(5, candidate.call(2, 3))\n assert_equal(12, candidate.call(5, 7))\n assert_equal(12, candidate.call(7, 5))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_69_search", - "language": "rb", - "prompt": "# You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n# zero, and has a frequency greater than or equal to the value of the integer itself. \n# The frequency of an integer is the number of times it appears in the list.\n# If no such a value exist, return -1.\n# Examples:\n# >>> search.call([4, 1, 2, 2, 3, 1])\n# 2\n# >>> search.call([1, 2, 2, 3, 3, 3, 4, 4, 4])\n# 3\n# >>> search.call([5, 5, 4, 4, 4])\n# -1\ndef search(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_search\n candidate = method(:search)\n assert_equal(1, candidate.call([5, 5, 5, 5, 1]))\n assert_equal(4, candidate.call([4, 1, 4, 1, 4, 4]))\n assert_equal(-1, candidate.call([3, 3]))\n assert_equal(8, candidate.call([8, 8, 8, 8, 8, 8, 8, 8]))\n assert_equal(2, candidate.call([2, 3, 3, 2, 2]))\n assert_equal(1, candidate.call([2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]))\n assert_equal(2, candidate.call([3, 2, 8, 2]))\n assert_equal(1, candidate.call([6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]))\n assert_equal(-1, candidate.call([8, 8, 3, 6, 5, 6, 4]))\n assert_equal(1, candidate.call([6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]))\n assert_equal(1, candidate.call([1, 9, 10, 1, 3]))\n assert_equal(5, candidate.call([6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]))\n assert_equal(1, candidate.call([1]))\n assert_equal(4, candidate.call([8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]))\n assert_equal(2, candidate.call([2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]))\n assert_equal(1, candidate.call([1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]))\n assert_equal(4, candidate.call([9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]))\n assert_equal(4, candidate.call([2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]))\n assert_equal(2, candidate.call([9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]))\n assert_equal(-1, candidate.call([5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]))\n assert_equal(-1, candidate.call([10]))\n assert_equal(2, candidate.call([9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]))\n assert_equal(1, candidate.call([5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]))\n assert_equal(1, candidate.call([7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]))\n assert_equal(-1, candidate.call([3, 10, 10, 9, 2]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "rb", - "prompt": "# Write a function that takes a string and returns True if the string\n# length is a prime number or False otherwise\n# Examples\n# >>> prime_length.call(\"Hello\")\n# true\n# >>> prime_length.call(\"abcdcba\")\n# true\n# >>> prime_length.call(\"kittens\")\n# true\n# >>> prime_length.call(\"orange\")\n# false\ndef prime_length(string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_prime_length\n candidate = method(:prime_length)\n assert_equal(true, candidate.call(\"Hello\"))\n assert_equal(true, candidate.call(\"abcdcba\"))\n assert_equal(true, candidate.call(\"kittens\"))\n assert_equal(false, candidate.call(\"orange\"))\n assert_equal(true, candidate.call(\"wow\"))\n assert_equal(true, candidate.call(\"world\"))\n assert_equal(true, candidate.call(\"MadaM\"))\n assert_equal(true, candidate.call(\"Wow\"))\n assert_equal(false, candidate.call(\"\"))\n assert_equal(true, candidate.call(\"HI\"))\n assert_equal(true, candidate.call(\"go\"))\n assert_equal(false, candidate.call(\"gogo\"))\n assert_equal(false, candidate.call(\"aaaaaaaaaaaaaaa\"))\n assert_equal(true, candidate.call(\"Madam\"))\n assert_equal(false, candidate.call(\"M\"))\n assert_equal(false, candidate.call(\"0\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_58_common", - "language": "rb", - "prompt": "# Return sorted unique common elements for two lists.\n# >>> common.call([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n# [1, 5, 653]\n# >>> common.call([5, 3, 2, 8], [3, 2])\n# [2, 3]\ndef common(l1, l2)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_common\n candidate = method(:common)\n assert_equal([1, 5, 653], candidate.call([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]))\n assert_equal([2, 3], candidate.call([5, 3, 2, 8], [3, 2]))\n assert_equal([2, 3, 4], candidate.call([4, 3, 2, 8], [3, 2, 4]))\n assert_equal([], candidate.call([4, 3, 2, 8], []))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "rb", - "prompt": "# The Brazilian factorial is defined as:\n# brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n# where n > 0\n# For example:\n# >>> special_factorial.call(4)\n# 288\n# The function will receive an integer as input and should return the special\n# factorial of this integer.\ndef special_factorial(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_special_factorial\n candidate = method(:special_factorial)\n assert_equal(288, candidate.call(4))\n assert_equal(34560, candidate.call(5))\n assert_equal(125411328000, candidate.call(7))\n assert_equal(1, candidate.call(1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "rb", - "prompt": "# In this problem, you will implement a function that takes two lists of numbers,\n# and determines whether it is possible to perform an exchange of elements\n# between them to make lst1 a list of only even numbers.\n# There is no limit on the number of exchanged elements between lst1 and lst2.\n# If it is possible to exchange elements between the lst1 and lst2 to make\n# all the elements of lst1 to be even, return \"YES\".\n# Otherwise, return \"NO\".\n# For example:\n# >>> exchange.call([1, 2, 3, 4], [1, 2, 3, 4])\n# \"YES\"\n# >>> exchange.call([1, 2, 3, 4], [1, 5, 3, 4])\n# \"NO\"\n# It is assumed that the input lists will be non-empty.\ndef exchange(lst1, lst2)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_exchange\n candidate = method(:exchange)\n assert_equal(\"YES\", candidate.call([1, 2, 3, 4], [1, 2, 3, 4]))\n assert_equal(\"NO\", candidate.call([1, 2, 3, 4], [1, 5, 3, 4]))\n assert_equal(\"YES\", candidate.call([1, 2, 3, 4], [2, 1, 4, 3]))\n assert_equal(\"YES\", candidate.call([5, 7, 3], [2, 6, 4]))\n assert_equal(\"NO\", candidate.call([5, 7, 3], [2, 6, 3]))\n assert_equal(\"NO\", candidate.call([3, 2, 6, 1, 8, 9], [3, 5, 5, 1, 1, 1]))\n assert_equal(\"YES\", candidate.call([100, 200], [200, 200]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "rb", - "prompt": "# Given a non-empty array of integers arr and an integer k, return\n# the sum of the elements with at most two digits from the first k elements of arr.\n# Example:\n# >>> add_elements.call([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4)\n# 24\n# Constraints:\n# 1. 1 <= len(arr) <= 100\n# 2. 1 <= k <= len(arr)\ndef add_elements(arr, k)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_add_elements\n candidate = method(:add_elements)\n assert_equal(-4, candidate.call([1, -2, -3, 41, 57, 76, 87, 88, 99], 3))\n assert_equal(0, candidate.call([111, 121, 3, 4000, 5, 6], 2))\n assert_equal(125, candidate.call([11, 21, 3, 90, 5, 6, 7, 8, 9], 4))\n assert_equal(24, candidate.call([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4))\n assert_equal(1, candidate.call([1], 1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "rb", - "prompt": "# A simple program which should return the value of x if n is \n# a prime number and should return the value of y otherwise.\n# Examples:\n# >>> x_or_y.call(7, 34, 12)\n# 34\n# >>> x_or_y.call(15, 8, 5)\n# 5\ndef x_or_y(n, x, y)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_x_or_y\n candidate = method(:x_or_y)\n assert_equal(34, candidate.call(7, 34, 12))\n assert_equal(5, candidate.call(15, 8, 5))\n assert_equal(33, candidate.call(3, 33, 5212))\n assert_equal(3, candidate.call(1259, 3, 52))\n assert_equal(-1, candidate.call(7919, -1, 12))\n assert_equal(583, candidate.call(3609, 1245, 583))\n assert_equal(129, candidate.call(91, 56, 129))\n assert_equal(1234, candidate.call(6, 34, 1234))\n assert_equal(0, candidate.call(1, 2, 0))\n assert_equal(2, candidate.call(2, 2, 0))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "rb", - "prompt": "# Given length of a side and high return area for a triangle.\n# >>> triangle_area.call(5, 3)\n# 7.5\ndef triangle_area(a, h)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_triangle_area\n candidate = method(:triangle_area)\n assert_equal(7.5, candidate.call(5, 3))\n assert_equal(2.0, candidate.call(2, 2))\n assert_equal(40.0, candidate.call(10, 8))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "rb", - "prompt": "# Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n# the last couple centuries. However, what people don't know is Tribonacci sequence.\n# Tribonacci sequence is defined by the recurrence:\n# tri(1) = 3\n# tri(n) = 1 + n / 2, if n is even.\n# tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n# For example:\n# tri(2) = 1 + (2 / 2) = 2\n# tri(4) = 3\n# tri(3) = tri(2) + tri(1) + tri(4)\n# = 2 + 3 + 3 = 8 \n# You are given a non-negative integer number n, you have to a return a list of the \n# first n + 1 numbers of the Tribonacci sequence.\n# Examples:\n# >>> tri.call(3)\n# [1, 3, 2, 8]\ndef tri(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_tri\n candidate = method(:tri)\n assert_equal([1, 3, 2, 8], candidate.call(3))\n assert_equal([1, 3, 2, 8, 3], candidate.call(4))\n assert_equal([1, 3, 2, 8, 3, 15], candidate.call(5))\n assert_equal([1, 3, 2, 8, 3, 15, 4], candidate.call(6))\n assert_equal([1, 3, 2, 8, 3, 15, 4, 24], candidate.call(7))\n assert_equal([1, 3, 2, 8, 3, 15, 4, 24, 5], candidate.call(8))\n assert_equal([1, 3, 2, 8, 3, 15, 4, 24, 5, 35], candidate.call(9))\n assert_equal([1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11], candidate.call(20))\n assert_equal([1], candidate.call(0))\n assert_equal([1, 3], candidate.call(1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "rb", - "prompt": "# You are given a list of two strings, both strings consist of open\n# parentheses '(' or close parentheses ')' only.\n# Your job is to check if it is possible to concatenate the two strings in\n# some order, that the resulting string will be good.\n# A string S is considered to be good if and only if all parentheses in S\n# are balanced. For example: the string '(())()' is good, while the string\n# '())' is not.\n# Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n# Examples:\n# >>> match_parens.call([\"()(\", \")\"])\n# \"Yes\"\n# >>> match_parens.call([\")\", \")\"])\n# \"No\"\ndef match_parens(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_match_parens\n candidate = method(:match_parens)\n assert_equal(\"Yes\", candidate.call([\"()(\", \")\"]))\n assert_equal(\"No\", candidate.call([\")\", \")\"]))\n assert_equal(\"No\", candidate.call([\"(()(())\", \"())())\"]))\n assert_equal(\"Yes\", candidate.call([\")())\", \"(()()(\"]))\n assert_equal(\"Yes\", candidate.call([\"(())))\", \"(()())((\"]))\n assert_equal(\"No\", candidate.call([\"()\", \"())\"]))\n assert_equal(\"Yes\", candidate.call([\"(()(\", \"()))()\"]))\n assert_equal(\"No\", candidate.call([\"((((\", \"((())\"]))\n assert_equal(\"No\", candidate.call([\")(()\", \"(()(\"]))\n assert_equal(\"No\", candidate.call([\")(\", \")(\"]))\n assert_equal(\"Yes\", candidate.call([\"(\", \")\"]))\n assert_equal(\"Yes\", candidate.call([\")\", \"(\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "rb", - "prompt": "# From a list of integers, remove all elements that occur more than once.\n# Keep order of elements left the same as in the input.\n# >>> remove_duplicates.call([1, 2, 3, 2, 4])\n# [1, 3, 4]\ndef remove_duplicates(numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_remove_duplicates\n candidate = method(:remove_duplicates)\n assert_equal([], candidate.call([]))\n assert_equal([1, 2, 3, 4], candidate.call([1, 2, 3, 4]))\n assert_equal([1, 4, 5], candidate.call([1, 2, 3, 2, 4, 3, 5]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "rb", - "prompt": "# Return a greatest common divisor of two integers a and b\n# >>> greatest_common_divisor.call(3, 5)\n# 1\n# >>> greatest_common_divisor.call(25, 15)\n# 5\ndef greatest_common_divisor(a, b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_greatest_common_divisor\n candidate = method(:greatest_common_divisor)\n assert_equal(1, candidate.call(3, 7))\n assert_equal(5, candidate.call(10, 15))\n assert_equal(7, candidate.call(49, 14))\n assert_equal(12, candidate.call(144, 60))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "rb", - "prompt": "# Checks if given string is a palindrome\n# >>> is_palindrome.call(\"\")\n# true\n# >>> is_palindrome.call(\"aba\")\n# true\n# >>> is_palindrome.call(\"aaaaa\")\n# true\n# >>> is_palindrome.call(\"zbcd\")\n# false\ndef is_palindrome(text)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_palindrome\n candidate = method(:is_palindrome)\n assert_equal(true, candidate.call(\"\"))\n assert_equal(true, candidate.call(\"aba\"))\n assert_equal(true, candidate.call(\"aaaaa\"))\n assert_equal(false, candidate.call(\"zbcd\"))\n assert_equal(true, candidate.call(\"xywyx\"))\n assert_equal(false, candidate.call(\"xywyz\"))\n assert_equal(false, candidate.call(\"xywzx\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "rb", - "prompt": "# xs represent coefficients of a polynomial.\n# xs[0] + xs[1] * x + xs[2] * x^2 + ....\n# Return derivative of this polynomial in the same form.\n# >>> derivative.call([3, 1, 2, 4, 5])\n# [1, 4, 12, 20]\n# >>> derivative.call([1, 2, 3])\n# [2, 6]\ndef derivative(xs)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_derivative\n candidate = method(:derivative)\n assert_equal([1, 4, 12, 20], candidate.call([3, 1, 2, 4, 5]))\n assert_equal([2, 6], candidate.call([1, 2, 3]))\n assert_equal([2, 2], candidate.call([3, 2, 1]))\n assert_equal([2, 2, 0, 16], candidate.call([3, 2, 1, 0, 4]))\n assert_equal([], candidate.call([1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "rb", - "prompt": "# In this task, you will be given a string that represents a number of apples and oranges \n# that are distributed in a basket of fruit this basket contains \n# apples, oranges, and mango fruits. Given the string that represents the total number of \n# the oranges and apples and an integer that represent the total number of the fruits \n# in the basket return the number of the mango fruits in the basket.\n# for examble:\n# >>> fruit_distribution.call(\"5 apples and 6 oranges\", 19)\n# 8\n# >>> fruit_distribution.call(\"0 apples and 1 oranges\", 3)\n# 2\n# >>> fruit_distribution.call(\"2 apples and 3 oranges\", 100)\n# 95\n# >>> fruit_distribution.call(\"100 apples and 1 oranges\", 120)\n# 19\ndef fruit_distribution(s, n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_fruit_distribution\n candidate = method(:fruit_distribution)\n assert_equal(8, candidate.call(\"5 apples and 6 oranges\", 19))\n assert_equal(10, candidate.call(\"5 apples and 6 oranges\", 21))\n assert_equal(2, candidate.call(\"0 apples and 1 oranges\", 3))\n assert_equal(2, candidate.call(\"1 apples and 0 oranges\", 3))\n assert_equal(95, candidate.call(\"2 apples and 3 oranges\", 100))\n assert_equal(0, candidate.call(\"2 apples and 3 oranges\", 5))\n assert_equal(19, candidate.call(\"1 apples and 100 oranges\", 120))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "rb", - "prompt": "# Write a function that takes an integer a and returns True \n# if this ingeger is a cube of some integer number.\n# Note: you may assume the input is always valid.\n# Examples:\n# >>> iscube.call(1)\n# true\n# >>> iscube.call(2)\n# false\n# >>> iscube.call(-1)\n# true\n# >>> iscube.call(64)\n# true\n# >>> iscube.call(0)\n# true\n# >>> iscube.call(180)\n# false\ndef iscube(a)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_iscube\n candidate = method(:iscube)\n assert_equal(true, candidate.call(1))\n assert_equal(false, candidate.call(2))\n assert_equal(true, candidate.call(-1))\n assert_equal(true, candidate.call(64))\n assert_equal(false, candidate.call(180))\n assert_equal(true, candidate.call(1000))\n assert_equal(true, candidate.call(0))\n assert_equal(false, candidate.call(1729))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "rb", - "prompt": "# In this Kata, you have to sort an array of non-negative integers according to\n# number of ones in their binary representation in ascending order.\n# For similar number of ones, sort based on decimal value.\n# It must be implemented like this:\n# >>> sort_array.call([1, 5, 2, 3, 4])\n# [1, 2, 3, 4, 5]\n# >>> sort_array.call([-2, -3, -4, -5, -6])\n# [-6, -5, -4, -3, -2]\n# >>> sort_array.call([1, 0, 2, 3, 4])\n# [0, 1, 2, 3, 4]\ndef sort_array(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sort_array\n candidate = method(:sort_array)\n assert_equal([1, 2, 4, 3, 5], candidate.call([1, 5, 2, 3, 4]))\n assert_equal([-4, -2, -6, -5, -3], candidate.call([-2, -3, -4, -5, -6]))\n assert_equal([0, 1, 2, 4, 3], candidate.call([1, 0, 2, 3, 4]))\n assert_equal([], candidate.call([]))\n assert_equal([2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77], candidate.call([2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]))\n assert_equal([32, 3, 5, 6, 12, 44], candidate.call([3, 6, 44, 12, 32, 5]))\n assert_equal([2, 4, 8, 16, 32], candidate.call([2, 4, 8, 16, 32]))\n assert_equal([2, 4, 8, 16, 32], candidate.call([2, 4, 8, 16, 32]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "rb", - "prompt": "# Given a list of strings, where each string consists of only digits, return a list.\n# Each element i of the output should be \"the number of odd elements in the\n# string i of the input.\" where all the i's should be replaced by the number\n# of odd digits in the i'th string of the input.\n# >>> odd_count.call([\"1234567\"])\n# [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n# >>> odd_count.call([\"3\", \"11111111\"])\n# [\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\ndef odd_count(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_odd_count\n candidate = method(:odd_count)\n assert_equal([\"the number of odd elements 4n the str4ng 4 of the 4nput.\"], candidate.call([\"1234567\"]))\n assert_equal([\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\"], candidate.call([\"3\", \"11111111\"]))\n assert_equal([\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"], candidate.call([\"271\", \"137\", \"314\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "rb", - "prompt": "# brackets is a string of \"(\" and \")\".\n# return True if every opening bracket has a corresponding closing bracket.\n# >>> correct_bracketing.call(\"(\")\n# false\n# >>> correct_bracketing.call(\"()\")\n# true\n# >>> correct_bracketing.call(\"(()())\")\n# true\n# >>> correct_bracketing.call(\")(()\")\n# false\ndef correct_bracketing(brackets)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_correct_bracketing\n candidate = method(:correct_bracketing)\n assert_equal(true, candidate.call(\"()\"))\n assert_equal(true, candidate.call(\"(()())\"))\n assert_equal(true, candidate.call(\"()()(()())()\"))\n assert_equal(true, candidate.call(\"()()((()()())())(()()(()))\"))\n assert_equal(false, candidate.call(\"((()())))\"))\n assert_equal(false, candidate.call(\")(()\"))\n assert_equal(false, candidate.call(\"(\"))\n assert_equal(false, candidate.call(\"((((\"))\n assert_equal(false, candidate.call(\")\"))\n assert_equal(false, candidate.call(\"(()\"))\n assert_equal(false, candidate.call(\"()()(()())())(()\"))\n assert_equal(false, candidate.call(\"()()(()())()))()\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "rb", - "prompt": "# Task\n# Write a function that takes a string as input and returns the sum of the upper characters only'\n# ASCII codes.\n# Examples:\n# >>> digitSum.call(\"\")\n# 0\n# >>> digitSum.call(\"abAB\")\n# 131\n# >>> digitSum.call(\"abcCd\")\n# 67\n# >>> digitSum.call(\"helloE\")\n# 69\n# >>> digitSum.call(\"woArBld\")\n# 131\n# >>> digitSum.call(\"aAaaaXa\")\n# 153\ndef digitSum(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_digitSum\n candidate = method(:digitSum)\n assert_equal(0, candidate.call(\"\"))\n assert_equal(131, candidate.call(\"abAB\"))\n assert_equal(67, candidate.call(\"abcCd\"))\n assert_equal(69, candidate.call(\"helloE\"))\n assert_equal(131, candidate.call(\"woArBld\"))\n assert_equal(153, candidate.call(\"aAaaaXa\"))\n assert_equal(151, candidate.call(\" How are yOu?\"))\n assert_equal(327, candidate.call(\"You arE Very Smart\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "rb", - "prompt": "# Write a function that accepts a list of strings as a parameter,\n# deletes the strings that have odd lengths from it,\n# and returns the resulted list with a sorted order,\n# The list is always a list of strings and never an array of numbers,\n# and it may contain duplicates.\n# The order of the list should be ascending by length of each word, and you\n# should return the list sorted by that rule.\n# If two words have the same length, sort the list alphabetically.\n# The function should return a list of strings in sorted order.\n# You may assume that all words will have the same length.\n# For example:\n# >>> list_sort.call([\"aa\", \"a\", \"aaa\"])\n# [\"aa\"]\n# >>> list_sort.call([\"ab\", \"a\", \"aaa\", \"cd\"])\n# [\"ab\", \"cd\"]\ndef sorted_list_sum(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sorted_list_sum\n candidate = method(:sorted_list_sum)\n assert_equal([\"aa\"], candidate.call([\"aa\", \"a\", \"aaa\"]))\n assert_equal([\"AI\", \"asdf\", \"school\"], candidate.call([\"school\", \"AI\", \"asdf\", \"b\"]))\n assert_equal([], candidate.call([\"d\", \"b\", \"c\", \"a\"]))\n assert_equal([\"abcd\", \"dcba\"], candidate.call([\"d\", \"dcba\", \"abcd\", \"a\"]))\n assert_equal([\"AI\", \"ai\", \"au\"], candidate.call([\"AI\", \"ai\", \"au\"]))\n assert_equal([], candidate.call([\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"]))\n assert_equal([\"cc\", \"dd\", \"aaaa\", \"bbbb\"], candidate.call([\"aaaa\", \"bbbb\", \"dd\", \"cc\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "rb", - "prompt": "# You are given an array arr of integers and you need to return\n# sum of magnitudes of integers multiplied by product of all signs\n# of each number in the array, represented by 1, -1 or 0.\n# Note: return None for empty arr.\n# Example:\n# >>> prod_signs.call([1, 2, 2, -4])\n# 9\n# >>> prod_signs.call([0, 1])\n# 0\n# >>> prod_signs.call([])\n# nil\ndef prod_signs(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_prod_signs\n candidate = method(:prod_signs)\n assert_equal(-9, candidate.call([1, 2, 2, -4]))\n assert_equal(0, candidate.call([0, 1]))\n assert_equal(-10, candidate.call([1, 1, 1, 2, 3, -1, 1]))\n assert_equal(nil, candidate.call([]))\n assert_equal(20, candidate.call([2, 4, 1, 2, -1, -1, 9]))\n assert_equal(4, candidate.call([-1, 1, -1, 1]))\n assert_equal(-4, candidate.call([-1, 1, 1, 1]))\n assert_equal(0, candidate.call([-1, 1, 1, 0]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "rb", - "prompt": "# Return list with elements incremented by 1.\n# >>> incr_list.call([1, 2, 3])\n# [2, 3, 4]\n# >>> incr_list.call([5, 3, 5, 2, 3, 3, 9, 0, 123])\n# [6, 4, 6, 3, 4, 4, 10, 1, 124]\ndef incr_list(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_incr_list\n candidate = method(:incr_list)\n assert_equal([], candidate.call([]))\n assert_equal([4, 3, 2], candidate.call([3, 2, 1]))\n assert_equal([6, 3, 6, 3, 4, 4, 10, 1, 124], candidate.call([5, 2, 5, 2, 3, 3, 9, 0, 123]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "rb", - "prompt": "# From a given list of integers, generate a list of rolling maximum element found until given moment\n# in the sequence.\n# >>> rolling_max.call([1, 2, 3, 2, 3, 4, 2])\n# [1, 2, 3, 3, 3, 4, 4]\ndef rolling_max(numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_rolling_max\n candidate = method(:rolling_max)\n assert_equal([], candidate.call([]))\n assert_equal([1, 2, 3, 4], candidate.call([1, 2, 3, 4]))\n assert_equal([4, 4, 4, 4], candidate.call([4, 3, 2, 1]))\n assert_equal([3, 3, 3, 100, 100], candidate.call([3, 2, 3, 100, 3]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "rb", - "prompt": "# Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n# separate those group into separate strings and return the list of those.\n# Separate groups are balanced (each open brace is properly closed) and not nested within each other\n# Ignore any spaces in the input string.\n# >>> separate_paren_groups.call(\"( ) (( )) (( )( ))\")\n# [\"()\", \"(())\", \"(()())\"]\ndef separate_paren_groups(paren_string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_separate_paren_groups\n candidate = method(:separate_paren_groups)\n assert_equal([\"(()())\", \"((()))\", \"()\", \"((())()())\"], candidate.call(\"(()()) ((())) () ((())()())\"))\n assert_equal([\"()\", \"(())\", \"((()))\", \"(((())))\"], candidate.call(\"() (()) ((())) (((())))\"))\n assert_equal([\"(()(())((())))\"], candidate.call(\"(()(())((())))\"))\n assert_equal([\"()\", \"(())\", \"(()())\"], candidate.call(\"( ) (( )) (( )( ))\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "rb", - "prompt": "# You will be given a string of words separated by commas or spaces. Your task is\n# to split the string into words and return an array of the words.\n# For example:\n# >>> words_string.call(\"Hi, my name is John\")\n# [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n# >>> words_string.call(\"One, two, three, four, five, six\")\n# [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\ndef words_string(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_words_string\n candidate = method(:words_string)\n assert_equal([\"Hi\", \"my\", \"name\", \"is\", \"John\"], candidate.call(\"Hi, my name is John\"))\n assert_equal([\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"], candidate.call(\"One, two, three, four, five, six\"))\n assert_equal([\"Hi\", \"my\", \"name\"], candidate.call(\"Hi, my name\"))\n assert_equal([\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"], candidate.call(\"One,, two, three, four, five, six,\"))\n assert_equal([], candidate.call(\"\"))\n assert_equal([\"ahmed\", \"gamal\"], candidate.call(\"ahmed , gamal\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "rb", - "prompt": "# Create a function that takes integers, floats, or strings representing\n# real numbers, and returns the larger variable in its given variable type.\n# Return None if the values are equal.\n# Note: If a real number is represented as a string, the floating point might be . or ,\n# >>> compare_one.call(1, 2.5)\n# 2.5\n# >>> compare_one.call(1, \"2,3\")\n# \"2,3\"\n# >>> compare_one.call(\"5,1\", \"6\")\n# \"6\"\n# >>> compare_one.call(\"1\", 1)\n# nil\ndef compare_one(a, b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_compare_one\n candidate = method(:compare_one)\n assert_equal(2, candidate.call(1, 2))\n assert_equal(2.5, candidate.call(1, 2.5))\n assert_equal(3, candidate.call(2, 3))\n assert_equal(6, candidate.call(5, 6))\n assert_equal(\"2,3\", candidate.call(1, \"2,3\"))\n assert_equal(\"6\", candidate.call(\"5,1\", \"6\"))\n assert_equal(\"2\", candidate.call(\"1\", \"2\"))\n assert_equal(nil, candidate.call(\"1\", 1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "rb", - "prompt": "# Filter given list of any python values only for integers\n# >>> filter_integers.call([\"a\", 3.14, 5])\n# [5]\n# >>> filter_integers.call([1, 2, 3, \"abc\", {}, []])\n# [1, 2, 3]\ndef filter_integers(values)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_filter_integers\n candidate = method(:filter_integers)\n assert_equal([], candidate.call([]))\n assert_equal([4, 9], candidate.call([4, {}, [], 23.2, 9, \"adasd\"]))\n assert_equal([3, 3, 3], candidate.call([3, \"c\", 3, 3, \"a\", \"b\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "rb", - "prompt": "# This function takes a list l and returns a list l' such that\n# l' is identical to l in the odd indicies, while its values at the even indicies are equal\n# to the values of the even indicies of l, but sorted.\n# >>> sort_even.call([1, 2, 3])\n# [1, 2, 3]\n# >>> sort_even.call([5, 6, 3, 4])\n# [3, 6, 5, 4]\ndef sort_even(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sort_even\n candidate = method(:sort_even)\n assert_equal([1, 2, 3], candidate.call([1, 2, 3]))\n assert_equal([-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123], candidate.call([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]))\n assert_equal([-12, 8, 3, 4, 5, 2, 12, 11, 23, -10], candidate.call([5, 8, -12, 4, 23, 2, 3, 11, 12, -10]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "rb", - "prompt": "# I think we all remember that feeling when the result of some long-awaited\n# event is finally known. The feelings and thoughts you have at that moment are\n# definitely worth noting down and comparing.\n# Your task is to determine if a person correctly guessed the results of a number of matches.\n# You are given two arrays of scores and guesses of equal length, where each index shows a match. \n# Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n# the value is 0, and if not, the value is the absolute difference between the guess and the score.\n# example:\n# >>> compare.call([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2])\n# [0, 0, 0, 0, 3, 3]\n# >>> compare.call([0, 5, 0, 0, 0, 4], [4, 1, 1, 0, 0, -2])\n# [4, 4, 1, 0, 0, 6]\ndef compare(game, guess)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_compare\n candidate = method(:compare)\n assert_equal([0, 0, 0, 0, 3, 3], candidate.call([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2]))\n assert_equal([0, 0, 0, 0, 0, 0], candidate.call([0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]))\n assert_equal([2, 4, 6], candidate.call([1, 2, 3], [-1, -2, -3]))\n assert_equal([2, 0, 0, 1], candidate.call([1, 2, 3, 5], [-1, 2, 3, 4]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "rb", - "prompt": "# Given a positive integer n, return a tuple that has the number of even and odd\n# integer palindromes that fall within the range(1, n), inclusive.\n# Example 1:\n# >>> even_odd_palindrome.call(3)\n# [1, 2]\n# Explanation:\n# Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n# Example 2:\n# >>> even_odd_palindrome.call(12)\n# [4, 6]\n# Explanation:\n# Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n# Note:\n# 1. 1 <= n <= 10^3\n# 2. returned tuple has the number of even and odd integer palindromes respectively.\ndef even_odd_palindrome(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_even_odd_palindrome\n candidate = method(:even_odd_palindrome)\n assert_equal([8, 13], candidate.call(123))\n assert_equal([4, 6], candidate.call(12))\n assert_equal([1, 2], candidate.call(3))\n assert_equal([6, 8], candidate.call(63))\n assert_equal([5, 6], candidate.call(25))\n assert_equal([4, 6], candidate.call(19))\n assert_equal([4, 5], candidate.call(9))\n assert_equal([0, 1], candidate.call(1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "rb", - "prompt": "# The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fib4(0) -> 0\n# fib4(1) -> 0\n# fib4(2) -> 2\n# fib4(3) -> 0\n# fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n# Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n# >>> fib4.call(5)\n# 4\n# >>> fib4.call(6)\n# 8\n# >>> fib4.call(7)\n# 14\ndef fib4(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_fib4\n candidate = method(:fib4)\n assert_equal(4, candidate.call(5))\n assert_equal(28, candidate.call(8))\n assert_equal(104, candidate.call(10))\n assert_equal(386, candidate.call(12))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "rb", - "prompt": "# Given two positive integers a and b, return the even digits between a\n# and b, in ascending order.\n# For example:\n# >>> generate_integers.call(2, 8)\n# [2, 4, 6, 8]\n# >>> generate_integers.call(8, 2)\n# [2, 4, 6, 8]\n# >>> generate_integers.call(10, 14)\n# []\ndef generate_integers(a, b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_generate_integers\n candidate = method(:generate_integers)\n assert_equal([2, 4, 6, 8], candidate.call(2, 10))\n assert_equal([2, 4, 6, 8], candidate.call(10, 2))\n assert_equal([2, 4, 6, 8], candidate.call(132, 2))\n assert_equal([], candidate.call(17, 89))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "rb", - "prompt": "# For a given list of input numbers, calculate Mean Absolute Deviation\n# around the mean of this dataset.\n# Mean Absolute Deviation is the average absolute difference between each\n# element and a centerpoint (mean in this case):\n# MAD = average | x - x_mean |\n# >>> mean_absolute_deviation.call([1.0, 2.0, 3.0, 4.0])\n# 1.0\ndef mean_absolute_deviation(numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_mean_absolute_deviation\n candidate = method(:mean_absolute_deviation)\n assert_equal(0.5, candidate.call([1.0, 2.0]))\n assert_equal(1.0, candidate.call([1.0, 2.0, 3.0, 4.0]))\n assert_equal(1.2, candidate.call([1.0, 2.0, 3.0, 4.0, 5.0]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "rb", - "prompt": "# Create a function encrypt that takes a string as an argument and\n# returns a string encrypted with the alphabet being rotated. \n# The alphabet should be rotated in a manner such that the letters \n# shift down by two multiplied to two places.\n# For example:\n# >>> encrypt.call(\"hi\")\n# \"lm\"\n# >>> encrypt.call(\"asdfghjkl\")\n# \"ewhjklnop\"\n# >>> encrypt.call(\"gf\")\n# \"kj\"\n# >>> encrypt.call(\"et\")\n# \"ix\"\ndef encrypt(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_encrypt\n candidate = method(:encrypt)\n assert_equal(\"lm\", candidate.call(\"hi\"))\n assert_equal(\"ewhjklnop\", candidate.call(\"asdfghjkl\"))\n assert_equal(\"kj\", candidate.call(\"gf\"))\n assert_equal(\"ix\", candidate.call(\"et\"))\n assert_equal(\"jeiajeaijeiak\", candidate.call(\"faewfawefaewg\"))\n assert_equal(\"lippsqcjvmirh\", candidate.call(\"hellomyfriend\"))\n assert_equal(\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\", candidate.call(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\"))\n assert_equal(\"e\", candidate.call(\"a\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "rb", - "prompt": "# Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n# The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n# as follows: start with any positive integer n. Then each term is obtained from the \n# previous term as follows: if the previous term is even, the next term is one half of \n# the previous term. If the previous term is odd, the next term is 3 times the previous\n# term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n# Note: \n# 1. Collatz(1) is [1].\n# 2. returned list sorted in increasing order.\n# For example:\n# get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n# >>> get_odd_collatz.call(5)\n# [1, 5]\ndef get_odd_collatz(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_get_odd_collatz\n candidate = method(:get_odd_collatz)\n assert_equal([1, 5, 7, 11, 13, 17], candidate.call(14))\n assert_equal([1, 5], candidate.call(5))\n assert_equal([1, 3, 5], candidate.call(12))\n assert_equal([1], candidate.call(1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "rb", - "prompt": "# Find how many times a given substring can be found in the original string. Count overlaping cases.\n# >>> how_many_times.call(\"\", \"a\")\n# 0\n# >>> how_many_times.call(\"aaa\", \"a\")\n# 3\n# >>> how_many_times.call(\"aaaa\", \"aa\")\n# 3\ndef how_many_times(string, substring)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_how_many_times\n candidate = method(:how_many_times)\n assert_equal(0, candidate.call(\"\", \"x\"))\n assert_equal(4, candidate.call(\"xyxyxyx\", \"x\"))\n assert_equal(4, candidate.call(\"cacacacac\", \"cac\"))\n assert_equal(1, candidate.call(\"john doe\", \"john\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "rb", - "prompt": "# We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n# numbers in the array will be randomly ordered. Your task is to determine if\n# it is possible to get an array sorted in non-decreasing order by performing \n# the following operation on the given array:\n# You are allowed to perform right shift operation any number of times.\n# One right shift operation means shifting all elements of the array by one\n# position in the right direction. The last element of the array will be moved to\n# the starting position in the array i.e. 0th index. \n# If it is possible to obtain the sorted array by performing the above operation\n# then return True else return False.\n# If the given array is empty then return True.\n# Note: The given list is guaranteed to have unique elements.\n# For Example:\n# >>> move_one_ball.call([3, 4, 5, 1, 2])\n# true\n# Explanation: By performin 2 right shift operations, non-decreasing order can\n# be achieved for the given array.\n# >>> move_one_ball.call([3, 5, 4, 1, 2])\n# false\n# Explanation:It is not possible to get non-decreasing order for the given\n# array by performing any number of right shift operations.\ndef move_one_ball(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_move_one_ball\n candidate = method(:move_one_ball)\n assert_equal(true, candidate.call([3, 4, 5, 1, 2]))\n assert_equal(true, candidate.call([3, 5, 10, 1, 2]))\n assert_equal(false, candidate.call([4, 3, 1, 2]))\n assert_equal(false, candidate.call([3, 5, 4, 1, 2]))\n assert_equal(true, candidate.call([]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "rb", - "prompt": "# Write a function which sorts the given list of integers\n# in ascending order according to the sum of their digits.\n# Note: if there are several items with similar sum of their digits,\n# order them based on their index in original list.\n# For example:\n# >>> order_by_points.call([1, 11, -1, -11, -12])\n# [-1, -11, 1, -12, 11]\n# >>> order_by_points.call([])\n# []\ndef order_by_points(nums)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_order_by_points\n candidate = method(:order_by_points)\n assert_equal([-1, -11, 1, -12, 11], candidate.call([1, 11, -1, -11, -12]))\n assert_equal([0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457], candidate.call([1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]))\n assert_equal([], candidate.call([]))\n assert_equal([-3, -32, -98, -11, 1, 2, 43, 54], candidate.call([1, -11, -32, 43, 54, -98, 2, -3]))\n assert_equal([1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9], candidate.call([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]))\n assert_equal([-76, -21, 0, 4, 23, 6, 6], candidate.call([0, 6, 6, -76, -21, 23, 4]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "rb", - "prompt": "# Return list of prime factors of given integer in the order from smallest to largest.\n# Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n# Input number should be equal to the product of all factors\n# >>> factorize.call(8)\n# [2, 2, 2]\n# >>> factorize.call(25)\n# [5, 5]\n# >>> factorize.call(70)\n# [2, 5, 7]\ndef factorize(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_factorize\n candidate = method(:factorize)\n assert_equal([2], candidate.call(2))\n assert_equal([2, 2], candidate.call(4))\n assert_equal([2, 2, 2], candidate.call(8))\n assert_equal([3, 19], candidate.call(57))\n assert_equal([3, 3, 19, 19], candidate.call(3249))\n assert_equal([3, 3, 3, 19, 19, 19], candidate.call(185193))\n assert_equal([3, 19, 19, 19], candidate.call(20577))\n assert_equal([2, 3, 3], candidate.call(18))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "rb", - "prompt": "# Return True if all numbers in the list l are below threshold t.\n# >>> below_threshold.call([1, 2, 4, 10], 100)\n# true\n# >>> below_threshold.call([1, 20, 4, 10], 5)\n# false\ndef below_threshold(l, t)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_below_threshold\n candidate = method(:below_threshold)\n assert_equal(true, candidate.call([1, 2, 4, 10], 100))\n assert_equal(false, candidate.call([1, 20, 4, 10], 5))\n assert_equal(true, candidate.call([1, 20, 4, 10], 21))\n assert_equal(true, candidate.call([1, 20, 4, 10], 22))\n assert_equal(true, candidate.call([1, 8, 4, 10], 11))\n assert_equal(false, candidate.call([1, 8, 4, 10], 10))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "rb", - "prompt": "# You are given two positive integers n and m, and your task is to compute the\n# average of the integers from n through m (including n and m). \n# Round the answer to the nearest integer and convert that to binary.\n# If n is greater than m, return -1.\n# Example:\n# >>> rounded_avg.call(1, 5)\n# \"0b11\"\n# >>> rounded_avg.call(7, 5)\n# -1\n# >>> rounded_avg.call(10, 20)\n# \"0b1111\"\n# >>> rounded_avg.call(20, 33)\n# \"0b11010\"\ndef rounded_avg(n, m)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_rounded_avg\n candidate = method(:rounded_avg)\n assert_equal(\"0b11\", candidate.call(1, 5))\n assert_equal(\"0b1010\", candidate.call(7, 13))\n assert_equal(\"0b1111001010\", candidate.call(964, 977))\n assert_equal(\"0b1111100100\", candidate.call(996, 997))\n assert_equal(\"0b1011000010\", candidate.call(560, 851))\n assert_equal(\"0b101101110\", candidate.call(185, 546))\n assert_equal(\"0b110101101\", candidate.call(362, 496))\n assert_equal(\"0b1001110010\", candidate.call(350, 902))\n assert_equal(\"0b11010111\", candidate.call(197, 233))\n assert_equal(-1, candidate.call(7, 5))\n assert_equal(-1, candidate.call(5, 1))\n assert_equal(\"0b101\", candidate.call(5, 5))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "rb", - "prompt": "# Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n# For each of the group, output the deepest level of nesting of parentheses.\n# E.g. (()()) has maximum two levels of nesting while ((())) has three.\n# >>> parse_nested_parens.call(\"(()()) ((())) () ((())()())\")\n# [2, 3, 1, 3]\ndef parse_nested_parens(paren_string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_parse_nested_parens\n candidate = method(:parse_nested_parens)\n assert_equal([2, 3, 1, 3], candidate.call(\"(()()) ((())) () ((())()())\"))\n assert_equal([1, 2, 3, 4], candidate.call(\"() (()) ((())) (((())))\"))\n assert_equal([4], candidate.call(\"(()(())((())))\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "rb", - "prompt": "# Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n# Examples\n# >>> solution.call([5, 8, 7, 1])\n# 12\n# >>> solution.call([3, 3, 3, 3, 3])\n# 9\n# >>> solution.call([30, 13, 24, 321])\n# 0\ndef solution(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_solution\n candidate = method(:solution)\n assert_equal(12, candidate.call([5, 8, 7, 1]))\n assert_equal(9, candidate.call([3, 3, 3, 3, 3]))\n assert_equal(0, candidate.call([30, 13, 24, 321]))\n assert_equal(5, candidate.call([5, 9]))\n assert_equal(0, candidate.call([2, 4, 8]))\n assert_equal(23, candidate.call([30, 13, 23, 32]))\n assert_equal(3, candidate.call([3, 13, 2, 9]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "rb", - "prompt": "# You are given a positive integer n. You have to create an integer array a of length n.\n# For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n# Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n# and a[i] + a[j] + a[k] is a multiple of 3.\n# Example :\n# >>> get_max_triples.call(5)\n# 1\n# Explanation: \n# a = [1, 3, 7, 13, 21]\n# The only valid triple is (1, 7, 13).\ndef get_max_triples(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_get_max_triples\n candidate = method(:get_max_triples)\n assert_equal(1, candidate.call(5))\n assert_equal(4, candidate.call(6))\n assert_equal(36, candidate.call(10))\n assert_equal(53361, candidate.call(100))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "rb", - "prompt": "# There are eight planets in our solar system: the closerst to the Sun \n# is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n# Uranus, Neptune.\n# Write a function that takes two planet names as strings planet1 and planet2. \n# The function should return a tuple containing all planets whose orbits are \n# located between the orbit of planet1 and the orbit of planet2, sorted by \n# the proximity to the sun. \n# The function should return an empty tuple if planet1 or planet2\n# are not correct planet names. \n# Examples\n# >>> bf.call(\"Jupiter\", \"Neptune\")\n# [\"Saturn\", \"Uranus\"]\n# >>> bf.call(\"Earth\", \"Mercury\")\n# \"Venus\"\n# >>> bf.call(\"Mercury\", \"Uranus\")\n# [\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"]\ndef bf(planet1, planet2)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_bf\n candidate = method(:bf)\n assert_equal([\"Saturn\", \"Uranus\"], candidate.call(\"Jupiter\", \"Neptune\"))\n assert_equal([\"Venus\"], candidate.call(\"Earth\", \"Mercury\"))\n assert_equal([\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"], candidate.call(\"Mercury\", \"Uranus\"))\n assert_equal([\"Earth\", \"Mars\", \"Jupiter\", \"Saturn\", \"Uranus\"], candidate.call(\"Neptune\", \"Venus\"))\n assert_equal([], candidate.call(\"Earth\", \"Earth\"))\n assert_equal([], candidate.call(\"Mars\", \"Earth\"))\n assert_equal([], candidate.call(\"Jupiter\", \"Makemake\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "rb", - "prompt": "# You are given a list of integers.\n# Write a function next_smallest() that returns the 2nd smallest element of the list.\n# Return None if there is no such element.\n# >>> next_smallest.call([1, 2, 3, 4, 5])\n# 2\n# >>> next_smallest.call([5, 1, 4, 3, 2])\n# 2\n# >>> next_smallest.call([])\n# nil\n# >>> next_smallest.call([1, 1])\n# nil\ndef next_smallest(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_next_smallest\n candidate = method(:next_smallest)\n assert_equal(2, candidate.call([1, 2, 3, 4, 5]))\n assert_equal(2, candidate.call([5, 1, 4, 3, 2]))\n assert_equal(nil, candidate.call([]))\n assert_equal(nil, candidate.call([1, 1]))\n assert_equal(1, candidate.call([1, 1, 1, 1, 0]))\n assert_equal(nil, candidate.call([1, 1]))\n assert_equal(-35, candidate.call([-35, 34, 12, -45]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "rb", - "prompt": "# Input is a space-delimited string of numberals from 'zero' to 'nine'.\n# Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n# Return the string with numbers sorted from smallest to largest\n# >>> sort_numbers.call(\"three one five\")\n# \"one three five\"\ndef sort_numbers(numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sort_numbers\n candidate = method(:sort_numbers)\n assert_equal(\"\", candidate.call(\"\"))\n assert_equal(\"three\", candidate.call(\"three\"))\n assert_equal(\"three five nine\", candidate.call(\"three five nine\"))\n assert_equal(\"zero four five seven eight nine\", candidate.call(\"five zero four seven nine eight\"))\n assert_equal(\"zero one two three four five six\", candidate.call(\"six five four three two one zero\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "rb", - "prompt": "# You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n# >>> cycpattern_check.call(\"abcd\", \"abd\")\n# false\n# >>> cycpattern_check.call(\"hello\", \"ell\")\n# true\n# >>> cycpattern_check.call(\"whassup\", \"psus\")\n# false\n# >>> cycpattern_check.call(\"abab\", \"baa\")\n# true\n# >>> cycpattern_check.call(\"efef\", \"eeff\")\n# false\n# >>> cycpattern_check.call(\"himenss\", \"simen\")\n# true\ndef cycpattern_check(a, b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_cycpattern_check\n candidate = method(:cycpattern_check)\n assert_equal(false, candidate.call(\"xyzw\", \"xyw\"))\n assert_equal(true, candidate.call(\"yello\", \"ell\"))\n assert_equal(false, candidate.call(\"whattup\", \"ptut\"))\n assert_equal(true, candidate.call(\"efef\", \"fee\"))\n assert_equal(false, candidate.call(\"abab\", \"aabb\"))\n assert_equal(true, candidate.call(\"winemtt\", \"tinem\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "rb", - "prompt": "# You will be given a number in decimal form and your task is to convert it to\n# binary format. The function should return a string, with each character representing a binary\n# number. Each character in the string will be '0' or '1'.\n# There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n# The extra characters are there to help with the format.\n# Examples:\n# >>> decimal_to_binary.call(15)\n# \"db1111db\"\n# >>> decimal_to_binary.call(32)\n# \"db100000db\"\ndef decimal_to_binary(decimal)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_decimal_to_binary\n candidate = method(:decimal_to_binary)\n assert_equal(\"db0db\", candidate.call(0))\n assert_equal(\"db100000db\", candidate.call(32))\n assert_equal(\"db1100111db\", candidate.call(103))\n assert_equal(\"db1111db\", candidate.call(15))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "rb", - "prompt": "# Filter an input list of strings only for ones that contain given substring\n# >>> filter_by_substring.call([], \"a\")\n# []\n# >>> filter_by_substring.call([\"abc\", \"bacd\", \"cde\", \"array\"], \"a\")\n# [\"abc\", \"bacd\", \"array\"]\ndef filter_by_substring(strings, substring)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_filter_by_substring\n candidate = method(:filter_by_substring)\n assert_equal([], candidate.call([], \"john\"))\n assert_equal([\"xxx\", \"xxxAAA\", \"xxx\"], candidate.call([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"))\n assert_equal([\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"], candidate.call([\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xx\"))\n assert_equal([\"grunt\", \"prune\"], candidate.call([\"grunt\", \"trumpet\", \"prune\", \"gruesome\"], \"run\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "rb", - "prompt": "# Given an integer. return a tuple that has the number of even and odd digits respectively.\n# Example:\n# >>> even_odd_count.call(-12)\n# [1, 1]\n# >>> even_odd_count.call(123)\n# [1, 2]\ndef even_odd_count(num)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_even_odd_count\n candidate = method(:even_odd_count)\n assert_equal([0, 1], candidate.call(7))\n assert_equal([1, 1], candidate.call(-78))\n assert_equal([2, 2], candidate.call(3452))\n assert_equal([3, 3], candidate.call(346211))\n assert_equal([3, 3], candidate.call(-345821))\n assert_equal([1, 0], candidate.call(-2))\n assert_equal([2, 3], candidate.call(-45347))\n assert_equal([1, 0], candidate.call(0))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "rb", - "prompt": "# Write a function that accepts a list of strings.\n# The list contains different words. Return the word with maximum number\n# of unique characters. If multiple strings have maximum number of unique\n# characters, return the one which comes first in lexicographical order.\n# >>> find_max.call([\"name\", \"of\", \"string\"])\n# \"string\"\n# >>> find_max.call([\"name\", \"enam\", \"game\"])\n# \"enam\"\n# >>> find_max.call([\"aaaaaaa\", \"bb\", \"cc\"])\n# \"aaaaaaa\"\ndef find_max(words)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_find_max\n candidate = method(:find_max)\n assert_equal(\"string\", candidate.call([\"name\", \"of\", \"string\"]))\n assert_equal(\"enam\", candidate.call([\"name\", \"enam\", \"game\"]))\n assert_equal(\"aaaaaaa\", candidate.call([\"aaaaaaa\", \"bb\", \"cc\"]))\n assert_equal(\"abc\", candidate.call([\"abc\", \"cba\"]))\n assert_equal(\"footbott\", candidate.call([\"play\", \"this\", \"game\", \"of\", \"footbott\"]))\n assert_equal(\"gonna\", candidate.call([\"we\", \"are\", \"gonna\", \"rock\"]))\n assert_equal(\"nation\", candidate.call([\"we\", \"are\", \"a\", \"mad\", \"nation\"]))\n assert_equal(\"this\", candidate.call([\"this\", \"is\", \"a\", \"prrk\"]))\n assert_equal(\"b\", candidate.call([\"b\"]))\n assert_equal(\"play\", candidate.call([\"play\", \"play\", \"play\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "rb", - "prompt": "# Given a positive integer n, return the count of the numbers of n-digit\n# positive integers that start or end with 1.\ndef starts_one_ends(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_starts_one_ends\n candidate = method(:starts_one_ends)\n assert_equal(1, candidate.call(1))\n assert_equal(18, candidate.call(2))\n assert_equal(180, candidate.call(3))\n assert_equal(1800, candidate.call(4))\n assert_equal(18000, candidate.call(5))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "rb", - "prompt": "# Create a function that returns a tuple (a, b), where 'a' is\n# the largest of negative integers, and 'b' is the smallest\n# of positive integers in a list.\n# If there is no negative or positive integers, return them as None.\n# Examples:\n# >>> largest_smallest_integers.call([2, 4, 1, 3, 5, 7])\n# [nil, 1]\n# >>> largest_smallest_integers.call([])\n# [nil, nil]\n# >>> largest_smallest_integers.call([0])\n# [nil, nil]\ndef largest_smallest_integers(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_largest_smallest_integers\n candidate = method(:largest_smallest_integers)\n assert_equal([nil, 1], candidate.call([2, 4, 1, 3, 5, 7]))\n assert_equal([nil, 1], candidate.call([2, 4, 1, 3, 5, 7, 0]))\n assert_equal([-2, 1], candidate.call([1, 3, 2, 4, 5, 6, -2]))\n assert_equal([-7, 2], candidate.call([4, 5, 3, 6, 2, 7, -7]))\n assert_equal([-9, 2], candidate.call([7, 3, 8, 4, 9, 2, 5, -9]))\n assert_equal([nil, nil], candidate.call([]))\n assert_equal([nil, nil], candidate.call([0]))\n assert_equal([-1, nil], candidate.call([-1, -3, -5, -6]))\n assert_equal([-1, nil], candidate.call([-1, -3, -5, -6, 0]))\n assert_equal([-3, 1], candidate.call([-6, -4, -4, -3, 1]))\n assert_equal([-3, 1], candidate.call([-6, -4, -4, -3, -100, 1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "rb", - "prompt": "# \"Given an array representing a branch of a tree that has non-negative integer nodes\n# your task is to pluck one of the nodes and return it.\n# The plucked node should be the node with the smallest even value.\n# If multiple nodes with the same smallest even value are found return the node that has smallest index.\n# The plucked node should be returned in a list, [ smalest_value, its index ],\n# If there are no even values or the given array is empty, return [].\n# Example 1:\n# >>> pluck.call([4, 2, 3])\n# [2, 1]\n# Explanation: 2 has the smallest even value, and 2 has the smallest index.\n# Example 2:\n# >>> pluck.call([1, 2, 3])\n# [2, 1]\n# Explanation: 2 has the smallest even value, and 2 has the smallest index.\n# Example 3:\n# >>> pluck.call([])\n# []\n# Example 4:\n# >>> pluck.call([5, 0, 3, 0, 4, 2])\n# [0, 1]\n# Explanation: 0 is the smallest value, but there are two zeros,\n# so we will choose the first zero, which has the smallest index.\n# Constraints:\n# * 1 <= nodes.length <= 10000\n# * 0 <= node.value\ndef pluck(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_pluck\n candidate = method(:pluck)\n assert_equal([2, 1], candidate.call([4, 2, 3]))\n assert_equal([2, 1], candidate.call([1, 2, 3]))\n assert_equal([], candidate.call([]))\n assert_equal([0, 1], candidate.call([5, 0, 3, 0, 4, 2]))\n assert_equal([0, 3], candidate.call([1, 2, 3, 0, 5, 3]))\n assert_equal([4, 1], candidate.call([5, 4, 8, 4, 8]))\n assert_equal([6, 1], candidate.call([7, 6, 7, 1]))\n assert_equal([], candidate.call([7, 9, 7, 1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "rb", - "prompt": "# Write a function count_nums which takes an array of integers and returns\n# the number of elements which has a sum of digits > 0.\n# If a number is negative, then its first signed digit will be negative:\n# e.g. -123 has signed digits -1, 2, and 3.\n# >>> count_nums.call([])\n# 0\n# >>> count_nums.call([-1, 11, -11])\n# 1\n# >>> count_nums.call([1, 1, 2])\n# 3\ndef count_nums(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_count_nums\n candidate = method(:count_nums)\n assert_equal(0, candidate.call([]))\n assert_equal(0, candidate.call([-1, -2, 0]))\n assert_equal(6, candidate.call([1, 1, 2, -2, 3, 4, 5]))\n assert_equal(5, candidate.call([1, 6, 9, -6, 0, 1, 5]))\n assert_equal(4, candidate.call([1, 100, 98, -7, 1, -1]))\n assert_equal(5, candidate.call([12, 23, 34, -45, -56, 0]))\n assert_equal(1, candidate.call([0, 1]))\n assert_equal(1, candidate.call([1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "rb", - "prompt": "# Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n# each cell of the grid contains a value. Every integer in the range [1, N * N]\n# inclusive appears exactly once on the cells of the grid.\n# You have to find the minimum path of length k in the grid. You can start\n# from any cell, and in each step you can move to any of the neighbor cells,\n# in other words, you can go to cells which share an edge with you current\n# cell.\n# Please note that a path of length k means visiting exactly k cells (not\n# necessarily distinct).\n# You CANNOT go off the grid.\n# A path A (of length k) is considered less than a path B (of length k) if\n# after making the ordered lists of the values on the cells that A and B go\n# through (let's call them lst_A and lst_B), lst_A is lexicographically less\n# than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n# such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n# lst_A[j] = lst_B[j].\n# It is guaranteed that the answer is unique.\n# Return an ordered list of the values on the cells that the minimum path go through.\n# Examples: \n# >>> minPath.call([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3)\n# [1, 2, 1]\n# >>> minPath.call([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1)\n# [1]\ndef minPath(grid, k)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_minPath\n candidate = method(:minPath)\n assert_equal([1, 2, 1], candidate.call([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3))\n assert_equal([1], candidate.call([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1))\n assert_equal([1, 2, 1, 2], candidate.call([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], 4))\n assert_equal([1, 10, 1, 10, 1, 10, 1], candidate.call([[6, 4, 13, 10], [5, 7, 12, 1], [3, 16, 11, 15], [8, 14, 9, 2]], 7))\n assert_equal([1, 7, 1, 7, 1], candidate.call([[8, 14, 9, 2], [6, 4, 13, 15], [5, 7, 1, 12], [3, 10, 11, 16]], 5))\n assert_equal([1, 6, 1, 6, 1, 6, 1, 6, 1], candidate.call([[11, 8, 7, 2], [5, 16, 14, 4], [9, 3, 15, 6], [12, 13, 10, 1]], 9))\n assert_equal([1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6], candidate.call([[12, 13, 10, 1], [9, 3, 15, 6], [5, 16, 14, 4], [11, 8, 7, 2]], 12))\n assert_equal([1, 3, 1, 3, 1, 3, 1, 3], candidate.call([[2, 7, 4], [3, 1, 5], [6, 8, 9]], 8))\n assert_equal([1, 5, 1, 5, 1, 5, 1, 5], candidate.call([[6, 1, 5], [3, 8, 9], [2, 7, 4]], 8))\n assert_equal([1, 2, 1, 2, 1, 2, 1, 2, 1, 2], candidate.call([[1, 2], [3, 4]], 10))\n assert_equal([1, 3, 1, 3, 1, 3, 1, 3, 1, 3], candidate.call([[1, 3], [3, 2]], 10))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "rb", - "prompt": "# Given list of integers, return list in strange order.\n# Strange sorting, is when you start with the minimum value,\n# then maximum of the remaining integers, then minimum and so on.\n# Examples:\n# >>> strange_sort_list.call([1, 2, 3, 4])\n# [1, 4, 2, 3]\n# >>> strange_sort_list.call([5, 5, 5, 5])\n# [5, 5, 5, 5]\n# >>> strange_sort_list.call([])\n# []\ndef strange_sort_list(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_strange_sort_list\n candidate = method(:strange_sort_list)\n assert_equal([1, 4, 2, 3], candidate.call([1, 2, 3, 4]))\n assert_equal([5, 9, 6, 8, 7], candidate.call([5, 6, 7, 8, 9]))\n assert_equal([1, 5, 2, 4, 3], candidate.call([1, 2, 3, 4, 5]))\n assert_equal([1, 9, 5, 8, 6, 7], candidate.call([5, 6, 7, 8, 9, 1]))\n assert_equal([5, 5, 5, 5], candidate.call([5, 5, 5, 5]))\n assert_equal([], candidate.call([]))\n assert_equal([1, 8, 2, 7, 3, 6, 4, 5], candidate.call([1, 2, 3, 4, 5, 6, 7, 8]))\n assert_equal([-5, 5, -5, 5, 0, 2, 2, 2], candidate.call([0, 2, 2, 2, 5, 5, -5, -5]))\n assert_equal([111111], candidate.call([111111]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "rb", - "prompt": "# Given a string 'text', return its md5 hash equivalent string.\n# If 'text' is an empty string, return None.\n# >>> string_to_md5.call(\"Hello world\")\n# \"3e25960a79dbc69b674cd4ec67a72c62\"\ndef string_to_md5(text)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_string_to_md5\n candidate = method(:string_to_md5)\n assert_equal(\"3e25960a79dbc69b674cd4ec67a72c62\", candidate.call(\"Hello world\"))\n assert_equal(nil, candidate.call(\"\"))\n assert_equal(\"0ef78513b0cb8cef12743f5aeb35f888\", candidate.call(\"A B C\"))\n assert_equal(\"5f4dcc3b5aa765d61d8327deb882cf99\", candidate.call(\"password\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "rb", - "prompt": "# You are given a word. Your task is to find the closest vowel that stands between \n# two consonants from the right side of the word (case sensitive).\n# Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n# find any vowel met the above condition. \n# You may assume that the given string contains English letter only.\n# Example:\n# >>> get_closest_vowel.call(\"yogurt\")\n# \"u\"\n# >>> get_closest_vowel.call(\"FULL\")\n# \"U\"\n# >>> get_closest_vowel.call(\"quick\")\n# \"\"\n# >>> get_closest_vowel.call(\"ab\")\n# \"\"\ndef get_closest_vowel(word)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_get_closest_vowel\n candidate = method(:get_closest_vowel)\n assert_equal(\"u\", candidate.call(\"yogurt\"))\n assert_equal(\"u\", candidate.call(\"full\"))\n assert_equal(\"\", candidate.call(\"easy\"))\n assert_equal(\"\", candidate.call(\"eAsy\"))\n assert_equal(\"\", candidate.call(\"ali\"))\n assert_equal(\"a\", candidate.call(\"bad\"))\n assert_equal(\"o\", candidate.call(\"most\"))\n assert_equal(\"\", candidate.call(\"ab\"))\n assert_equal(\"\", candidate.call(\"ba\"))\n assert_equal(\"\", candidate.call(\"quick\"))\n assert_equal(\"i\", candidate.call(\"anime\"))\n assert_equal(\"\", candidate.call(\"Asia\"))\n assert_equal(\"o\", candidate.call(\"Above\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "rb", - "prompt": "# Change numerical base of input number x to base.\n# return string representation after the conversion.\n# base numbers are less than 10.\n# >>> change_base.call(8, 3)\n# \"22\"\n# >>> change_base.call(8, 2)\n# \"1000\"\n# >>> change_base.call(7, 2)\n# \"111\"\ndef change_base(x, base)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_change_base\n candidate = method(:change_base)\n assert_equal(\"22\", candidate.call(8, 3))\n assert_equal(\"100\", candidate.call(9, 3))\n assert_equal(\"11101010\", candidate.call(234, 2))\n assert_equal(\"10000\", candidate.call(16, 2))\n assert_equal(\"1000\", candidate.call(8, 2))\n assert_equal(\"111\", candidate.call(7, 2))\n assert_equal(\"2\", candidate.call(2, 3))\n assert_equal(\"3\", candidate.call(3, 4))\n assert_equal(\"4\", candidate.call(4, 5))\n assert_equal(\"5\", candidate.call(5, 6))\n assert_equal(\"6\", candidate.call(6, 7))\n assert_equal(\"7\", candidate.call(7, 8))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "rb", - "prompt": "# Check if in given list of numbers, are any two numbers closer to each other than\n# given threshold.\n# >>> has_close_elements.call([1.0, 2.0, 3.0], 0.5)\n# false\n# >>> has_close_elements.call([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n# true\ndef has_close_elements(numbers, threshold)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_has_close_elements\n candidate = method(:has_close_elements)\n assert_equal(true, candidate.call([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3))\n assert_equal(false, candidate.call([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05))\n assert_equal(true, candidate.call([1.0, 2.0, 5.9, 4.0, 5.0], 0.95))\n assert_equal(false, candidate.call([1.0, 2.0, 5.9, 4.0, 5.0], 0.8))\n assert_equal(true, candidate.call([1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1))\n assert_equal(true, candidate.call([1.1, 2.2, 3.1, 4.1, 5.1], 1.0))\n assert_equal(false, candidate.call([1.1, 2.2, 3.1, 4.1, 5.1], 0.5))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "rb", - "prompt": "# Create a function that takes a string as input which contains only square brackets.\n# The function should return True if and only if there is a valid subsequence of brackets \n# where at least one bracket in the subsequence is nested.\n# >>> is_nested.call(\"[[]]\")\n# true\n# >>> is_nested.call(\"[]]]]]]][[[[[]\")\n# false\n# >>> is_nested.call(\"[][]\")\n# false\n# >>> is_nested.call(\"[]\")\n# false\n# >>> is_nested.call(\"[[][]]\")\n# true\n# >>> is_nested.call(\"[[]][[\")\n# true\ndef is_nested(string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_nested\n candidate = method(:is_nested)\n assert_equal(true, candidate.call(\"[[]]\"))\n assert_equal(false, candidate.call(\"[]]]]]]][[[[[]\"))\n assert_equal(false, candidate.call(\"[][]\"))\n assert_equal(false, candidate.call(\"[]\"))\n assert_equal(true, candidate.call(\"[[[[]]]]\"))\n assert_equal(false, candidate.call(\"[]]]]]]]]]]\"))\n assert_equal(true, candidate.call(\"[][][[]]\"))\n assert_equal(false, candidate.call(\"[[]\"))\n assert_equal(false, candidate.call(\"[]]\"))\n assert_equal(true, candidate.call(\"[[]][[\"))\n assert_equal(true, candidate.call(\"[[][]]\"))\n assert_equal(false, candidate.call(\"\"))\n assert_equal(false, candidate.call(\"[[[[[[[[\"))\n assert_equal(false, candidate.call(\"]]]]]]]]\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "rb", - "prompt": "# Concatenate list of strings into a single string\n# >>> concatenate.call([])\n# \"\"\n# >>> concatenate.call([\"a\", \"b\", \"c\"])\n# \"abc\"\ndef concatenate(strings)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_concatenate\n candidate = method(:concatenate)\n assert_equal(\"\", candidate.call([]))\n assert_equal(\"xyz\", candidate.call([\"x\", \"y\", \"z\"]))\n assert_equal(\"xyzwk\", candidate.call([\"x\", \"y\", \"z\", \"w\", \"k\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "rb", - "prompt": "# prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n# >>> prime_fib.call(1)\n# 2\n# >>> prime_fib.call(2)\n# 3\n# >>> prime_fib.call(3)\n# 5\n# >>> prime_fib.call(4)\n# 13\n# >>> prime_fib.call(5)\n# 89\ndef prime_fib(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_prime_fib\n candidate = method(:prime_fib)\n assert_equal(2, candidate.call(1))\n assert_equal(3, candidate.call(2))\n assert_equal(5, candidate.call(3))\n assert_equal(13, candidate.call(4))\n assert_equal(89, candidate.call(5))\n assert_equal(233, candidate.call(6))\n assert_equal(1597, candidate.call(7))\n assert_equal(28657, candidate.call(8))\n assert_equal(514229, candidate.call(9))\n assert_equal(433494437, candidate.call(10))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "rb", - "prompt": "# From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n# other and return them in order (smaller number, larger number).\n# >>> find_closest_elements.call([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n# [2.0, 2.2]\n# >>> find_closest_elements.call([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n# [2.0, 2.0]\ndef find_closest_elements(numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_find_closest_elements\n candidate = method(:find_closest_elements)\n assert_equal([3.9, 4.0], candidate.call([1.0, 2.0, 3.9, 4.0, 5.0, 2.2]))\n assert_equal([5.0, 5.9], candidate.call([1.0, 2.0, 5.9, 4.0, 5.0]))\n assert_equal([2.0, 2.2], candidate.call([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]))\n assert_equal([2.0, 2.0], candidate.call([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]))\n assert_equal([2.2, 3.1], candidate.call([1.1, 2.2, 3.1, 4.1, 5.1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "rb", - "prompt": "# You have been tasked to write a function that receives \n# a hexadecimal number as a string and counts the number of hexadecimal \n# digits that are primes (prime number, or a prime, is a natural number \n# greater than 1 that is not a product of two smaller natural numbers).\n# Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n# Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n# So you have to determine a number of the following digits: 2, 3, 5, 7, \n# B (=decimal 11), D (=decimal 13).\n# Note: you may assume the input is always correct or empty string, \n# and symbols A,B,C,D,E,F are always uppercase.\n# Examples:\n# >>> hex_key.call(\"AB\")\n# 1\n# >>> hex_key.call(\"1077E\")\n# 2\n# >>> hex_key.call(\"ABED1A33\")\n# 4\n# >>> hex_key.call(\"123456789ABCDEF0\")\n# 6\n# >>> hex_key.call(\"2020\")\n# 2\ndef hex_key(num)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_hex_key\n candidate = method(:hex_key)\n assert_equal(1, candidate.call(\"AB\"))\n assert_equal(2, candidate.call(\"1077E\"))\n assert_equal(4, candidate.call(\"ABED1A33\"))\n assert_equal(2, candidate.call(\"2020\"))\n assert_equal(6, candidate.call(\"123456789ABCDEF0\"))\n assert_equal(12, candidate.call(\"112233445566778899AABBCCDDEEFF00\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "rb", - "prompt": "# Complete the function that takes two integers and returns \n# the product of their unit digits.\n# Assume the input is always valid.\n# Examples:\n# >>> multiply.call(148, 412)\n# 16\n# >>> multiply.call(19, 28)\n# 72\n# >>> multiply.call(2020, 1851)\n# 0\n# >>> multiply.call(14, -15)\n# 20\ndef multiply(a, b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_multiply\n candidate = method(:multiply)\n assert_equal(16, candidate.call(148, 412))\n assert_equal(72, candidate.call(19, 28))\n assert_equal(0, candidate.call(2020, 1851))\n assert_equal(20, candidate.call(14, -15))\n assert_equal(42, candidate.call(76, 67))\n assert_equal(49, candidate.call(17, 27))\n assert_equal(0, candidate.call(0, 1))\n assert_equal(0, candidate.call(0, 0))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "rb", - "prompt": "# Given list of numbers (of at least two elements), apply a linear transform to that list,\n# such that the smallest number will become 0 and the largest will become 1\n# >>> rescale_to_unit.call([1.0, 2.0, 3.0, 4.0, 5.0])\n# [0.0, 0.25, 0.5, 0.75, 1.0]\ndef rescale_to_unit(numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_rescale_to_unit\n candidate = method(:rescale_to_unit)\n assert_equal([0.0, 1.0], candidate.call([2.0, 49.9]))\n assert_equal([1.0, 0.0], candidate.call([100.0, 49.9]))\n assert_equal([0.0, 0.25, 0.5, 0.75, 1.0], candidate.call([1.0, 2.0, 3.0, 4.0, 5.0]))\n assert_equal([0.25, 0.0, 1.0, 0.5, 0.75], candidate.call([2.0, 1.0, 5.0, 3.0, 4.0]))\n assert_equal([0.25, 0.0, 1.0, 0.5, 0.75], candidate.call([12.0, 11.0, 15.0, 13.0, 14.0]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "rb", - "prompt": "# Given a positive integer n, return the product of the odd digits.\n# Return 0 if all digits are even.\n# For example:\n# >>> digits.call(1)\n# 1\n# >>> digits.call(4)\n# 0\n# >>> digits.call(235)\n# 15\ndef digits(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_digits\n candidate = method(:digits)\n assert_equal(5, candidate.call(5))\n assert_equal(5, candidate.call(54))\n assert_equal(1, candidate.call(120))\n assert_equal(5, candidate.call(5014))\n assert_equal(315, candidate.call(98765))\n assert_equal(2625, candidate.call(5576543))\n assert_equal(0, candidate.call(2468))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "rb", - "prompt": "# You will be given the name of a class (a string) and a list of extensions.\n# The extensions are to be used to load additional classes to the class. The\n# strength of the extension is as follows: Let CAP be the number of the uppercase\n# letters in the extension's name, and let SM be the number of lowercase letters \n# in the extension's name, the strength is given by the fraction CAP - SM. \n# You should find the strongest extension and return a string in this \n# format: ClassName.StrongestExtensionName.\n# If there are two or more extensions with the same strength, you should\n# choose the one that comes first in the list.\n# For example, if you are given \"Slices\" as the class and a list of the\n# extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n# return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n# (its strength is -1).\n# Example:\n# >>> Strongest_Extension.call(\"my_class\", [\"AA\", \"Be\", \"CC\"])\n# \"my_class.AA\"\ndef Strongest_Extension(class_name, extensions)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_Strongest_Extension\n candidate = method(:Strongest_Extension)\n assert_equal(\"Watashi.eIGHt8OKe\", candidate.call(\"Watashi\", [\"tEN\", \"niNE\", \"eIGHt8OKe\"]))\n assert_equal(\"Boku123.YEs.WeCaNe\", candidate.call(\"Boku123\", [\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"]))\n assert_equal(\"__YESIMHERE.NuLl__\", candidate.call(\"__YESIMHERE\", [\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"]))\n assert_equal(\"K.TAR\", candidate.call(\"K\", [\"Ta\", \"TAR\", \"t234An\", \"cosSo\"]))\n assert_equal(\"__HAHA.123\", candidate.call(\"__HAHA\", [\"Tab\", \"123\", \"781345\", \"-_-\"]))\n assert_equal(\"YameRore.okIWILL123\", candidate.call(\"YameRore\", [\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"]))\n assert_equal(\"finNNalLLly.WoW\", candidate.call(\"finNNalLLly\", [\"Die\", \"NowW\", \"Wow\", \"WoW\"]))\n assert_equal(\"_.Bb\", candidate.call(\"_\", [\"Bb\", \"91245\"]))\n assert_equal(\"Sp.671235\", candidate.call(\"Sp\", [\"671235\", \"Bb\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "rb", - "prompt": "# Given a string representing a space separated lowercase letters, return a dictionary\n# of the letter with the most repetition and containing the corresponding count.\n# If several letters have the same occurrence, return all of them.\n# Example:\n# >>> histogram.call(\"a b c\")\n# {\"a\" => 1, \"b\" => 1, \"c\" => 1}\n# >>> histogram.call(\"a b b a\")\n# {\"a\" => 2, \"b\" => 2}\n# >>> histogram.call(\"a b c a b\")\n# {\"a\" => 2, \"b\" => 2}\n# >>> histogram.call(\"b b b b a\")\n# {\"b\" => 4}\n# >>> histogram.call(\"\")\n# {}\ndef histogram(test)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_histogram\n candidate = method(:histogram)\n assert_equal({\"a\" => 2, \"b\" => 2}, candidate.call(\"a b b a\"))\n assert_equal({\"a\" => 2, \"b\" => 2}, candidate.call(\"a b c a b\"))\n assert_equal({\"a\" => 1, \"b\" => 1, \"c\" => 1, \"d\" => 1, \"g\" => 1}, candidate.call(\"a b c d g\"))\n assert_equal({\"r\" => 1, \"t\" => 1, \"g\" => 1}, candidate.call(\"r t g\"))\n assert_equal({\"b\" => 4}, candidate.call(\"b b b b a\"))\n assert_equal({\"r\" => 1, \"t\" => 1, \"g\" => 1}, candidate.call(\"r t g\"))\n assert_equal({}, candidate.call(\"\"))\n assert_equal({\"a\" => 1}, candidate.call(\"a\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "rb", - "prompt": "# pairs_sum_to_zero takes a list of integers as an input.\n# it returns True if there are two distinct elements in the list that\n# sum to zero, and False otherwise.\n# >>> pairs_sum_to_zero.call([1, 3, 5, 0])\n# false\n# >>> pairs_sum_to_zero.call([1, 3, -2, 1])\n# false\n# >>> pairs_sum_to_zero.call([1, 2, 3, 7])\n# false\n# >>> pairs_sum_to_zero.call([2, 4, -5, 3, 5, 7])\n# true\n# >>> pairs_sum_to_zero.call([1])\n# false\ndef pairs_sum_to_zero(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_pairs_sum_to_zero\n candidate = method(:pairs_sum_to_zero)\n assert_equal(false, candidate.call([1, 3, 5, 0]))\n assert_equal(false, candidate.call([1, 3, -2, 1]))\n assert_equal(false, candidate.call([1, 2, 3, 7]))\n assert_equal(true, candidate.call([2, 4, -5, 3, 5, 7]))\n assert_equal(false, candidate.call([1]))\n assert_equal(true, candidate.call([-3, 9, -1, 3, 2, 30]))\n assert_equal(true, candidate.call([-3, 9, -1, 3, 2, 31]))\n assert_equal(false, candidate.call([-3, 9, -1, 4, 2, 30]))\n assert_equal(false, candidate.call([-3, 9, -1, 4, 2, 31]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "rb", - "prompt": "# Write a function that accepts two lists of strings and returns the list that has \n# total number of chars in the all strings of the list less than the other list.\n# if the two lists have the same number of chars, return the first list.\n# Examples\n# >>> total_match.call([], [])\n# []\n# >>> total_match.call([\"hi\", \"admin\"], [\"hI\", \"Hi\"])\n# [\"hI\", \"Hi\"]\n# >>> total_match.call([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"])\n# [\"hi\", \"admin\"]\n# >>> total_match.call([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"])\n# [\"hI\", \"hi\", \"hi\"]\n# >>> total_match.call([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"])\n# [\"4\"]\ndef total_match(lst1, lst2)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_total_match\n candidate = method(:total_match)\n assert_equal([], candidate.call([], []))\n assert_equal([\"hi\", \"hi\"], candidate.call([\"hi\", \"admin\"], [\"hi\", \"hi\"]))\n assert_equal([\"hi\", \"admin\"], candidate.call([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"]))\n assert_equal([\"4\"], candidate.call([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"]))\n assert_equal([\"hI\", \"Hi\"], candidate.call([\"hi\", \"admin\"], [\"hI\", \"Hi\"]))\n assert_equal([\"hI\", \"hi\", \"hi\"], candidate.call([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"]))\n assert_equal([\"hi\", \"admin\"], candidate.call([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hii\"]))\n assert_equal([], candidate.call([], [\"this\"]))\n assert_equal([], candidate.call([\"this\"], []))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "rb", - "prompt": "# Circular shift the digits of the integer x, shift the digits right by shift\n# and return the result as a string.\n# If shift > number of digits, return digits reversed.\n# >>> circular_shift.call(12, 1)\n# \"21\"\n# >>> circular_shift.call(12, 2)\n# \"12\"\ndef circular_shift(x, shift)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_circular_shift\n candidate = method(:circular_shift)\n assert_equal(\"001\", candidate.call(100, 2))\n assert_equal(\"12\", candidate.call(12, 2))\n assert_equal(\"79\", candidate.call(97, 8))\n assert_equal(\"21\", candidate.call(12, 1))\n assert_equal(\"11\", candidate.call(11, 101))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "rb", - "prompt": "# Return True is list elements are monotonically increasing or decreasing.\n# >>> monotonic.call([1, 2, 4, 20])\n# true\n# >>> monotonic.call([1, 20, 4, 10])\n# false\n# >>> monotonic.call([4, 1, 0, -10])\n# true\ndef monotonic(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_monotonic\n candidate = method(:monotonic)\n assert_equal(true, candidate.call([1, 2, 4, 10]))\n assert_equal(true, candidate.call([1, 2, 4, 20]))\n assert_equal(false, candidate.call([1, 20, 4, 10]))\n assert_equal(true, candidate.call([4, 1, 0, -10]))\n assert_equal(true, candidate.call([4, 1, 1, 0]))\n assert_equal(false, candidate.call([1, 2, 3, 2, 5, 60]))\n assert_equal(true, candidate.call([1, 2, 3, 4, 5, 60]))\n assert_equal(true, candidate.call([9, 9, 9, 9]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "rb", - "prompt": "# Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n# Example\n# >>> is_equal_to_sum_even.call(4)\n# false\n# >>> is_equal_to_sum_even.call(6)\n# false\n# >>> is_equal_to_sum_even.call(8)\n# true\ndef is_equal_to_sum_even(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_equal_to_sum_even\n candidate = method(:is_equal_to_sum_even)\n assert_equal(false, candidate.call(4))\n assert_equal(false, candidate.call(6))\n assert_equal(true, candidate.call(8))\n assert_equal(true, candidate.call(10))\n assert_equal(false, candidate.call(11))\n assert_equal(true, candidate.call(12))\n assert_equal(false, candidate.call(13))\n assert_equal(true, candidate.call(16))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "rb", - "prompt": "# Input to this function is a string representing musical notes in a special ASCII format.\n# Your task is to parse this string and return list of integers corresponding to how many beats does each\n# not last.\n# Here is a legend:\n# 'o' - whole note, lasts four beats\n# 'o|' - half note, lasts two beats\n# '.|' - quater note, lasts one beat\n# >>> parse_music.call(\"o o| .| o| o| .| .| .| .| o o\")\n# [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\ndef parse_music(music_string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_parse_music\n candidate = method(:parse_music)\n assert_equal([], candidate.call(\"\"))\n assert_equal([4, 4, 4, 4], candidate.call(\"o o o o\"))\n assert_equal([1, 1, 1, 1], candidate.call(\".| .| .| .|\"))\n assert_equal([2, 2, 1, 1, 4, 4, 4, 4], candidate.call(\"o| o| .| .| o o o o\"))\n assert_equal([2, 1, 2, 1, 4, 2, 4, 2], candidate.call(\"o| .| o| .| o o| o o|\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "rb", - "prompt": "# \"\n# This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n# multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n# change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n# Examples:\n# >>> lst\n# [1, 2, 3]\n# >>> lst\n# []\n# >>> lst\n# [-1, -5, 2, -1, -5]\ndef sum_squares(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sum_squares\n candidate = method(:sum_squares)\n assert_equal(6, candidate.call([1, 2, 3]))\n assert_equal(14, candidate.call([1, 4, 9]))\n assert_equal(0, candidate.call([]))\n assert_equal(9, candidate.call([1, 1, 1, 1, 1, 1, 1, 1, 1]))\n assert_equal(-3, candidate.call([-1, -1, -1, -1, -1, -1, -1, -1, -1]))\n assert_equal(0, candidate.call([0]))\n assert_equal(-126, candidate.call([-1, -5, 2, -1, -5]))\n assert_equal(3030, candidate.call([-56, -99, 1, 0, -2]))\n assert_equal(0, candidate.call([-1, 0, 0, 0, 0, 0, 0, 0, -1]))\n assert_equal(-14196, candidate.call([-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37]))\n assert_equal(-1448, candidate.call([-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "rb", - "prompt": "# triples_sum_to_zero takes a list of integers as an input.\n# it returns True if there are three distinct elements in the list that\n# sum to zero, and False otherwise.\n# >>> triples_sum_to_zero.call([1, 3, 5, 0])\n# false\n# >>> triples_sum_to_zero.call([1, 3, -2, 1])\n# true\n# >>> triples_sum_to_zero.call([1, 2, 3, 7])\n# false\n# >>> triples_sum_to_zero.call([2, 4, -5, 3, 9, 7])\n# true\n# >>> triples_sum_to_zero.call([1])\n# false\ndef triples_sum_to_zero(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_triples_sum_to_zero\n candidate = method(:triples_sum_to_zero)\n assert_equal(false, candidate.call([1, 3, 5, 0]))\n assert_equal(false, candidate.call([1, 3, 5, -1]))\n assert_equal(true, candidate.call([1, 3, -2, 1]))\n assert_equal(false, candidate.call([1, 2, 3, 7]))\n assert_equal(false, candidate.call([1, 2, 5, 7]))\n assert_equal(true, candidate.call([2, 4, -5, 3, 9, 7]))\n assert_equal(false, candidate.call([1]))\n assert_equal(false, candidate.call([1, 3, 5, -100]))\n assert_equal(false, candidate.call([100, 3, 5, -100]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "rb", - "prompt": "# brackets is a string of \"<\" and \">\".\n# return True if every opening bracket has a corresponding closing bracket.\n# >>> correct_bracketing.call(\"<\")\n# false\n# >>> correct_bracketing.call(\"<>\")\n# true\n# >>> correct_bracketing.call(\"<<><>>\")\n# true\n# >>> correct_bracketing.call(\"><<>\")\n# false\ndef correct_bracketing(brackets)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_correct_bracketing\n candidate = method(:correct_bracketing)\n assert_equal(true, candidate.call(\"<>\"))\n assert_equal(true, candidate.call(\"<<><>>\"))\n assert_equal(true, candidate.call(\"<><><<><>><>\"))\n assert_equal(true, candidate.call(\"<><><<<><><>><>><<><><<>>>\"))\n assert_equal(false, candidate.call(\"<<<><>>>>\"))\n assert_equal(false, candidate.call(\"><<>\"))\n assert_equal(false, candidate.call(\"<\"))\n assert_equal(false, candidate.call(\"<<<<\"))\n assert_equal(false, candidate.call(\">\"))\n assert_equal(false, candidate.call(\"<<>\"))\n assert_equal(false, candidate.call(\"<><><<><>><>><<>\"))\n assert_equal(false, candidate.call(\"<><><<><>><>>><>\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "rb", - "prompt": "# Write a function that takes an array of numbers as input and returns \n# the number of elements in the array that are greater than 10 and both \n# first and last digits of a number are odd (1, 3, 5, 7, 9).\n# For example:\n# >>> specialFilter.call([15, -73, 14, -15])\n# 1\n# >>> specialFilter.call([33, -2, -3, 45, 21, 109])\n# 2\ndef specialFilter(nums)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_specialFilter\n candidate = method(:specialFilter)\n assert_equal(0, candidate.call([5, -2, 1, -5]))\n assert_equal(1, candidate.call([15, -73, 14, -15]))\n assert_equal(2, candidate.call([33, -2, -3, 45, 21, 109]))\n assert_equal(4, candidate.call([43, -12, 93, 125, 121, 109]))\n assert_equal(3, candidate.call([71, -2, -33, 75, 21, 19]))\n assert_equal(0, candidate.call([1]))\n assert_equal(0, candidate.call([]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "rb", - "prompt": "# Given a dictionary, return True if all keys are strings in lower \n# case or all keys are strings in upper case, else return False.\n# The function should return False is the given dictionary is empty.\n# Examples:\n# >>> check_dict_case.call({\"a\" => \"apple\", \"b\" => \"banana\"})\n# true\n# >>> check_dict_case.call({\"a\" => \"apple\", \"A\" => \"banana\", \"B\" => \"banana\"})\n# false\n# >>> check_dict_case.call({\"a\" => \"apple\", 8 => \"banana\", \"a\" => \"apple\"})\n# false\n# >>> check_dict_case.call({\"Name\" => \"John\", \"Age\" => \"36\", \"City\" => \"Houston\"})\n# false\n# >>> check_dict_case.call({\"STATE\" => \"NC\", \"ZIP\" => \"12345\"})\n# true\ndef check_dict_case(dict)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_check_dict_case\n candidate = method(:check_dict_case)\n assert_equal(true, candidate.call({\"p\" => \"pineapple\", \"b\" => \"banana\"}))\n assert_equal(false, candidate.call({\"p\" => \"pineapple\", \"A\" => \"banana\", \"B\" => \"banana\"}))\n assert_equal(false, candidate.call({\"p\" => \"pineapple\", \"5\" => \"banana\", \"a\" => \"apple\"}))\n assert_equal(false, candidate.call({\"Name\" => \"John\", \"Age\" => \"36\", \"City\" => \"Houston\"}))\n assert_equal(true, candidate.call({\"STATE\" => \"NC\", \"ZIP\" => \"12345\"}))\n assert_equal(true, candidate.call({\"fruit\" => \"Orange\", \"taste\" => \"Sweet\"}))\n assert_equal(false, candidate.call({}))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "rb", - "prompt": "# Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n# should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n# alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n# Examples\n# >>> split_words.call(\"Hello world!\")\n# [\"Hello\", \"world!\"]\n# >>> split_words.call(\"Hello,world!\")\n# [\"Hello\", \"world!\"]\n# >>> split_words.call(\"abcdef\")\n# 3\ndef split_words(txt)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_split_words\n candidate = method(:split_words)\n assert_equal([\"Hello\", \"world!\"], candidate.call(\"Hello world!\"))\n assert_equal([\"Hello\", \"world!\"], candidate.call(\"Hello,world!\"))\n assert_equal([\"Hello\", \"world,!\"], candidate.call(\"Hello world,!\"))\n assert_equal([\"Hello,Hello,world\", \"!\"], candidate.call(\"Hello,Hello,world !\"))\n assert_equal(3, candidate.call(\"abcdef\"))\n assert_equal(2, candidate.call(\"aaabb\"))\n assert_equal(1, candidate.call(\"aaaBb\"))\n assert_equal(0, candidate.call(\"\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "rb", - "prompt": "# The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fibfib(0) == 0\n# fibfib(1) == 0\n# fibfib(2) == 1\n# fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n# Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n# >>> fibfib.call(1)\n# 0\n# >>> fibfib.call(5)\n# 4\n# >>> fibfib.call(8)\n# 24\ndef fibfib(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_fibfib\n candidate = method(:fibfib)\n assert_equal(1, candidate.call(2))\n assert_equal(0, candidate.call(1))\n assert_equal(4, candidate.call(5))\n assert_equal(24, candidate.call(8))\n assert_equal(81, candidate.call(10))\n assert_equal(274, candidate.call(12))\n assert_equal(927, candidate.call(14))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "rb", - "prompt": "# You are given a list of numbers.\n# You need to return the sum of squared numbers in the given list,\n# round each element in the list to the upper int(Ceiling) first.\n# Examples:\n# >>> lst.call([1.0, 2.0, 3.0])\n# 14\n# >>> lst.call([1.0, 4.0, 9.0])\n# 98\n# >>> lst.call([1.0, 3.0, 5.0, 7.0])\n# 84\n# >>> lst.call([1.4, 4.2, 0.0])\n# 29\n# >>> lst.call([-2.4, 1.0, 1.0])\n# 6\ndef sum_squares(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sum_squares\n candidate = method(:sum_squares)\n assert_equal(14, candidate.call([1.0, 2.0, 3.0]))\n assert_equal(14, candidate.call([1.0, 2.0, 3.0]))\n assert_equal(84, candidate.call([1.0, 3.0, 5.0, 7.0]))\n assert_equal(29, candidate.call([1.4, 4.2, 0.0]))\n assert_equal(6, candidate.call([-2.4, 1.0, 1.0]))\n assert_equal(10230, candidate.call([100.0, 1.0, 15.0, 2.0]))\n assert_equal(200000000, candidate.call([10000.0, 10000.0]))\n assert_equal(75, candidate.call([-1.4, 4.6, 6.3]))\n assert_equal(1086, candidate.call([-1.4, 17.9, 18.9, 19.9]))\n assert_equal(0, candidate.call([0.0]))\n assert_equal(1, candidate.call([-1.0]))\n assert_equal(2, candidate.call([-1.0, 1.0, 0.0]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_85_add", - "language": "rb", - "prompt": "# Given a non-empty list of integers lst. add the even elements that are at odd indices..\n# Examples:\n# >>> add.call([4, 2, 6, 7])\n# 2\ndef add(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_add\n candidate = method(:add)\n assert_equal(88, candidate.call([4, 88]))\n assert_equal(122, candidate.call([4, 5, 6, 7, 2, 122]))\n assert_equal(0, candidate.call([4, 0, 6, 7]))\n assert_equal(12, candidate.call([4, 4, 6, 8]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "rb", - "prompt": "# Return sorted unique elements in a list\n# >>> unique.call([5, 3, 5, 2, 3, 3, 9, 0, 123])\n# [0, 2, 3, 5, 9, 123]\ndef unique(l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_unique\n candidate = method(:unique)\n assert_equal([0, 2, 3, 5, 9, 123], candidate.call([5, 3, 5, 2, 3, 3, 9, 0, 123]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "rb", - "prompt": "# Given a string text, replace all spaces in it with underscores, \n# and if a string has more than 2 consecutive spaces, \n# then replace all consecutive spaces with - \n# >>> fix_spaces.call(\" Example\")\n# \"Example\"\n# >>> fix_spaces.call(\" Example 1\")\n# \"Example_1\"\n# >>> fix_spaces.call(\" Example 2\")\n# \"_Example_2\"\n# >>> fix_spaces.call(\" Example 3\")\n# \"_Example-3\"\ndef fix_spaces(text)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_fix_spaces\n candidate = method(:fix_spaces)\n assert_equal(\"Example\", candidate.call(\"Example\"))\n assert_equal(\"Mudasir_Hanif_\", candidate.call(\"Mudasir Hanif \"))\n assert_equal(\"Yellow_Yellow__Dirty__Fellow\", candidate.call(\"Yellow Yellow Dirty Fellow\"))\n assert_equal(\"Exa-mple\", candidate.call(\"Exa mple\"))\n assert_equal(\"-Exa_1_2_2_mple\", candidate.call(\" Exa 1 2 2 mple\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "rb", - "prompt": "# Return 2^n modulo p (be aware of numerics).\n# >>> modp.call(3, 5)\n# 3\n# >>> modp.call(1101, 101)\n# 2\n# >>> modp.call(0, 101)\n# 1\n# >>> modp.call(3, 11)\n# 8\n# >>> modp.call(100, 101)\n# 1\ndef modp(n, p)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_modp\n candidate = method(:modp)\n assert_equal(3, candidate.call(3, 5))\n assert_equal(2, candidate.call(1101, 101))\n assert_equal(1, candidate.call(0, 101))\n assert_equal(8, candidate.call(3, 11))\n assert_equal(1, candidate.call(100, 101))\n assert_equal(4, candidate.call(30, 5))\n assert_equal(3, candidate.call(31, 5))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "rb", - "prompt": "# You have to write a function which validates a given date string and\n# returns True if the date is valid otherwise False.\n# The date is valid if all of the following rules are satisfied:\n# 1. The date string is not empty.\n# 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n# 3. The months should not be less than 1 or higher than 12.\n# 4. The date should be in the format: mm-dd-yyyy\n# >>> valid_date.call(\"03-11-2000\")\n# true\n# >>> valid_date.call(\"15-01-2012\")\n# false\n# >>> valid_date.call(\"04-0-2040\")\n# false\n# >>> valid_date.call(\"06-04-2020\")\n# true\n# >>> valid_date.call(\"06/04/2020\")\n# false\ndef valid_date(date)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_valid_date\n candidate = method(:valid_date)\n assert_equal(true, candidate.call(\"03-11-2000\"))\n assert_equal(false, candidate.call(\"15-01-2012\"))\n assert_equal(false, candidate.call(\"04-0-2040\"))\n assert_equal(true, candidate.call(\"06-04-2020\"))\n assert_equal(true, candidate.call(\"01-01-2007\"))\n assert_equal(false, candidate.call(\"03-32-2011\"))\n assert_equal(false, candidate.call(\"\"))\n assert_equal(false, candidate.call(\"04-31-3000\"))\n assert_equal(true, candidate.call(\"06-06-2005\"))\n assert_equal(false, candidate.call(\"21-31-2000\"))\n assert_equal(true, candidate.call(\"04-12-2003\"))\n assert_equal(false, candidate.call(\"04122003\"))\n assert_equal(false, candidate.call(\"20030412\"))\n assert_equal(false, candidate.call(\"2003-04\"))\n assert_equal(false, candidate.call(\"2003-04-12\"))\n assert_equal(false, candidate.call(\"04-2003\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "rb", - "prompt": "# Write a function that takes a string and returns an ordered version of it.\n# Ordered version of string, is a string where all words (separated by space)\n# are replaced by a new word where all the characters arranged in\n# ascending order based on ascii value.\n# Note: You should keep the order of words and blank spaces in the sentence.\n# For example:\n# >>> anti_shuffle.call(\"Hi\")\n# \"Hi\"\n# >>> anti_shuffle.call(\"hello\")\n# \"ehllo\"\n# >>> anti_shuffle.call(\"Hello World!!!\")\n# \"Hello !!!Wdlor\"\ndef anti_shuffle(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_anti_shuffle\n candidate = method(:anti_shuffle)\n assert_equal(\"Hi\", candidate.call(\"Hi\"))\n assert_equal(\"ehllo\", candidate.call(\"hello\"))\n assert_equal(\"bemnru\", candidate.call(\"number\"))\n assert_equal(\"abcd\", candidate.call(\"abcd\"))\n assert_equal(\"Hello !!!Wdlor\", candidate.call(\"Hello World!!!\"))\n assert_equal(\"\", candidate.call(\"\"))\n assert_equal(\".Hi My aemn is Meirst .Rboot How aer ?ouy\", candidate.call(\"Hi. My name is Mister Robot. How are you?\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "rb", - "prompt": "# Given a list of numbers, return whether or not they are sorted\n# in ascending order. If list has more than 1 duplicate of the same\n# number, return False. Assume no negative numbers and only integers.\n# Examples\n# >>> is_sorted.call([5])\n# true\n# >>> is_sorted.call([1, 2, 3, 4, 5])\n# true\n# >>> is_sorted.call([1, 3, 2, 4, 5])\n# false\n# >>> is_sorted.call([1, 2, 3, 4, 5, 6])\n# true\n# >>> is_sorted.call([1, 2, 3, 4, 5, 6, 7])\n# true\n# >>> is_sorted.call([1, 3, 2, 4, 5, 6, 7])\n# false\n# >>> is_sorted.call([1, 2, 2, 3, 3, 4])\n# true\n# >>> is_sorted.call([1, 2, 2, 2, 3, 4])\n# false\ndef is_sorted(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_sorted\n candidate = method(:is_sorted)\n assert_equal(true, candidate.call([5]))\n assert_equal(true, candidate.call([1, 2, 3, 4, 5]))\n assert_equal(false, candidate.call([1, 3, 2, 4, 5]))\n assert_equal(true, candidate.call([1, 2, 3, 4, 5, 6]))\n assert_equal(true, candidate.call([1, 2, 3, 4, 5, 6, 7]))\n assert_equal(false, candidate.call([1, 3, 2, 4, 5, 6, 7]))\n assert_equal(true, candidate.call([]))\n assert_equal(true, candidate.call([1]))\n assert_equal(false, candidate.call([3, 2, 1]))\n assert_equal(false, candidate.call([1, 2, 2, 2, 3, 4]))\n assert_equal(false, candidate.call([1, 2, 3, 3, 3, 4]))\n assert_equal(true, candidate.call([1, 2, 2, 3, 3, 4]))\n assert_equal(true, candidate.call([1, 2, 3, 4]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "rb", - "prompt": "# You are given a string s.\n# Your task is to check if the string is happy or not.\n# A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n# For example:\n# >>> is_happy.call(\"a\")\n# false\n# >>> is_happy.call(\"aa\")\n# false\n# >>> is_happy.call(\"abcd\")\n# true\n# >>> is_happy.call(\"aabb\")\n# false\n# >>> is_happy.call(\"adb\")\n# true\n# >>> is_happy.call(\"xyy\")\n# false\ndef is_happy(s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_is_happy\n candidate = method(:is_happy)\n assert_equal(false, candidate.call(\"a\"))\n assert_equal(false, candidate.call(\"aa\"))\n assert_equal(true, candidate.call(\"abcd\"))\n assert_equal(false, candidate.call(\"aabb\"))\n assert_equal(true, candidate.call(\"adb\"))\n assert_equal(false, candidate.call(\"xyy\"))\n assert_equal(true, candidate.call(\"iopaxpoi\"))\n assert_equal(false, candidate.call(\"iopaxioi\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "rb", - "prompt": "# Write a function that returns True if the object q will fly, and False otherwise.\n# The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n# Example:\n# >>> will_it_fly.call([1, 2], 5)\n# false\n# # 1+2 is less than the maximum possible weight, but it's unbalanced.\n# >>> will_it_fly.call([3, 2, 3], 1)\n# false\n# # it's balanced, but 3+2+3 is more than the maximum possible weight.\n# >>> will_it_fly.call([3, 2, 3], 9)\n# true\n# # 3+2+3 is less than the maximum possible weight, and it's balanced.\n# >>> will_it_fly.call([3], 5)\n# true\n# # 3 is less than the maximum possible weight, and it's balanced.\ndef will_it_fly(q, w)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_will_it_fly\n candidate = method(:will_it_fly)\n assert_equal(true, candidate.call([3, 2, 3], 9))\n assert_equal(false, candidate.call([1, 2], 5))\n assert_equal(true, candidate.call([3], 5))\n assert_equal(false, candidate.call([3, 2, 3], 1))\n assert_equal(false, candidate.call([1, 2, 3], 6))\n assert_equal(true, candidate.call([5], 5))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "rb", - "prompt": "# Given an array of non-negative integers, return a copy of the given array after sorting,\n# you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n# or sort it in descending order if the sum( first index value, last index value) is even.\n# Note:\n# * don't change the given array.\n# Examples:\n# >>> sort_array.call([])\n# []\n# >>> sort_array.call([5])\n# [5]\n# >>> sort_array.call([2, 4, 3, 0, 1, 5])\n# [0, 1, 2, 3, 4, 5]\n# >>> sort_array.call([2, 4, 3, 0, 1, 5, 6])\n# [6, 5, 4, 3, 2, 1, 0]\ndef sort_array(array)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sort_array\n candidate = method(:sort_array)\n assert_equal([], candidate.call([]))\n assert_equal([5], candidate.call([5]))\n assert_equal([0, 1, 2, 3, 4, 5], candidate.call([2, 4, 3, 0, 1, 5]))\n assert_equal([6, 5, 4, 3, 2, 1, 0], candidate.call([2, 4, 3, 0, 1, 5, 6]))\n assert_equal([1, 2], candidate.call([2, 1]))\n assert_equal([0, 11, 15, 32, 42, 87], candidate.call([15, 42, 87, 32, 11, 0]))\n assert_equal([23, 21, 14, 11], candidate.call([21, 14, 23, 11]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "rb", - "prompt": "# Implement a function that takes an non-negative integer and returns an array of the first n\n# integers that are prime numbers and less than n.\n# for example:\n# >>> count_up_to.call(5)\n# [2, 3]\n# >>> count_up_to.call(11)\n# [2, 3, 5, 7]\n# >>> count_up_to.call(0)\n# []\n# >>> count_up_to.call(20)\n# [2, 3, 5, 7, 11, 13, 17, 19]\n# >>> count_up_to.call(1)\n# []\n# >>> count_up_to.call(18)\n# [2, 3, 5, 7, 11, 13, 17]\ndef count_up_to(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_count_up_to\n candidate = method(:count_up_to)\n assert_equal([2, 3], candidate.call(5))\n assert_equal([2, 3, 5], candidate.call(6))\n assert_equal([2, 3, 5], candidate.call(7))\n assert_equal([2, 3, 5, 7], candidate.call(10))\n assert_equal([], candidate.call(0))\n assert_equal([2, 3, 5, 7, 11, 13, 17, 19], candidate.call(22))\n assert_equal([], candidate.call(1))\n assert_equal([2, 3, 5, 7, 11, 13, 17], candidate.call(18))\n assert_equal([2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43], candidate.call(47))\n assert_equal([2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97], candidate.call(101))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "rb", - "prompt": "# Out of list of strings, return the longest one. Return the first one in case of multiple\n# strings of the same length. Return None in case the input list is empty.\n# >>> longest.call([])\n# nil\n# >>> longest.call([\"a\", \"b\", \"c\"])\n# \"a\"\n# >>> longest.call([\"a\", \"bb\", \"ccc\"])\n# \"ccc\"\ndef longest(strings)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_longest\n candidate = method(:longest)\n assert_equal(nil, candidate.call([]))\n assert_equal(\"x\", candidate.call([\"x\", \"y\", \"z\"]))\n assert_equal(\"zzzz\", candidate.call([\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "rb", - "prompt": "# Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n# reverse the resulting array, and then replace each digit by its corresponding name from\n# \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n# For example:\n# >>> by_length.call([2, 1, 1, 4, 5, 8, 2, 3])\n# [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n# If the array is empty, return an empty array:\n# >>> by_length.call([])\n# []\n# If the array has any strange number ignore it:\n# >>> by_length.call([1, -1, 55])\n# [\"One\"]\ndef by_length(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_by_length\n candidate = method(:by_length)\n assert_equal([\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"], candidate.call([2, 1, 1, 4, 5, 8, 2, 3]))\n assert_equal([], candidate.call([]))\n assert_equal([\"One\"], candidate.call([1, -1, 55]))\n assert_equal([\"Three\", \"Two\", \"One\"], candidate.call([1, -1, 3, 2]))\n assert_equal([\"Nine\", \"Eight\", \"Four\"], candidate.call([9, 4, 8]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_106_f", - "language": "rb", - "prompt": "# Implement the function f that takes n as a parameter,\n# 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\n# or the sum of numbers from 1 to i otherwise.\n# i starts from 1.\n# the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n# Example:\n# >>> f.call(5)\n# [1, 2, 6, 24, 15]\ndef f(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_f\n candidate = method(:f)\n assert_equal([1, 2, 6, 24, 15], candidate.call(5))\n assert_equal([1, 2, 6, 24, 15, 720, 28], candidate.call(7))\n assert_equal([1], candidate.call(1))\n assert_equal([1, 2, 6], candidate.call(3))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "rb", - "prompt": "# Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n# >>> fizz_buzz.call(50)\n# 0\n# >>> fizz_buzz.call(78)\n# 2\n# >>> fizz_buzz.call(79)\n# 3\ndef fizz_buzz(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_fizz_buzz\n candidate = method(:fizz_buzz)\n assert_equal(0, candidate.call(50))\n assert_equal(2, candidate.call(78))\n assert_equal(3, candidate.call(79))\n assert_equal(3, candidate.call(100))\n assert_equal(6, candidate.call(200))\n assert_equal(192, candidate.call(4000))\n assert_equal(639, candidate.call(10000))\n assert_equal(8026, candidate.call(100000))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "rb", - "prompt": "# Given a positive floating point number, it can be decomposed into\n# and integer part (largest integer smaller than given number) and decimals\n# (leftover part always smaller than 1).\n# Return the decimal part of the number.\n# >>> truncate_number.call(3.5)\n# 0.5\ndef truncate_number(number)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_truncate_number\n candidate = method(:truncate_number)\n assert_equal(0.5, candidate.call(3.5))\n assert_equal(0.25, candidate.call(1.25))\n assert_equal(0.0, candidate.call(123.0))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "rb", - "prompt": "# For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n# Empty sum should be equal to 0 and empty product should be equal to 1.\n# >>> sum_product.call([])\n# [0, 1]\n# >>> sum_product.call([1, 2, 3, 4])\n# [10, 24]\ndef sum_product(numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_sum_product\n candidate = method(:sum_product)\n assert_equal([0, 1], candidate.call([]))\n assert_equal([3, 1], candidate.call([1, 1, 1]))\n assert_equal([100, 0], candidate.call([100, 0]))\n assert_equal([15, 105], candidate.call([3, 5, 7]))\n assert_equal([10, 10], candidate.call([10]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "rb", - "prompt": "# You are given a 2 dimensional data, as a nested lists,\n# which is similar to matrix, however, unlike matrices,\n# each row may contain a different number of columns.\n# Given lst, and integer x, find integers x in the list,\n# and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n# each tuple is a coordinate - (row, columns), starting with 0.\n# Sort coordinates initially by rows in ascending order.\n# Also, sort coordinates of the row by columns in descending order.\n# Examples:\n# >>> get_row.call([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1)\n# [[0, 0], [1, 4], [1, 0], [2, 5], [2, 0]]\n# >>> get_row.call([], 1)\n# []\n# >>> get_row.call([[], [1], [1, 2, 3]], 3)\n# [[2, 2]]\ndef get_row(lst, x)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_get_row\n candidate = method(:get_row)\n assert_equal([[0, 0], [1, 4], [1, 0], [2, 5], [2, 0]], candidate.call([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1))\n assert_equal([[0, 1], [1, 1], [2, 1], [3, 1], [4, 1], [5, 1]], candidate.call([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6]], 2))\n assert_equal([[0, 0], [1, 0], [2, 1], [2, 0], [3, 2], [3, 0], [4, 3], [4, 0], [5, 4], [5, 0], [6, 5], [6, 0]], candidate.call([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 1, 3, 4, 5, 6], [1, 2, 1, 4, 5, 6], [1, 2, 3, 1, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1))\n assert_equal([], candidate.call([], 1))\n assert_equal([], candidate.call([[1]], 2))\n assert_equal([[2, 2]], candidate.call([[], [1], [1, 2, 3]], 3))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "rb", - "prompt": "# You're a hungry rabbit, and you already have eaten a certain number of carrots,\n# but now you need to eat more carrots to complete the day's meals.\n# you should return an array of [ total number of eaten carrots after your meals,\n# the number of carrots left after your meals ]\n# if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n# Example:\n# >>> eat.call(5, 6, 10)\n# [11, 4]\n# >>> eat.call(4, 8, 9)\n# [12, 1]\n# >>> eat.call(1, 10, 10)\n# [11, 0]\n# >>> eat.call(2, 11, 5)\n# [7, 0]\n# Variables:\n# @number : integer\n# the number of carrots that you have eaten.\n# @need : integer\n# the number of carrots that you need to eat.\n# @remaining : integer\n# the number of remaining carrots thet exist in stock\n# Constrain:\n# * 0 <= number <= 1000\n# * 0 <= need <= 1000\n# * 0 <= remaining <= 1000\n# Have fun :)\ndef eat(number, need, remaining)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_eat\n candidate = method(:eat)\n assert_equal([11, 4], candidate.call(5, 6, 10))\n assert_equal([12, 1], candidate.call(4, 8, 9))\n assert_equal([11, 0], candidate.call(1, 10, 10))\n assert_equal([7, 0], candidate.call(2, 11, 5))\n assert_equal([9, 2], candidate.call(4, 5, 7))\n assert_equal([5, 0], candidate.call(4, 5, 1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "rb", - "prompt": "# Given a positive integer N, return the total sum of its digits in binary.\n# Example\n# >>> solve.call(1000)\n# \"1\"\n# >>> solve.call(150)\n# \"110\"\n# >>> solve.call(147)\n# \"1100\"\n# Variables:\n# @N integer\n# Constraints: 0 \u2264 N \u2264 10000.\n# Output:\n# a string of binary number\ndef solve(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_solve\n candidate = method(:solve)\n assert_equal(\"1\", candidate.call(1000))\n assert_equal(\"110\", candidate.call(150))\n assert_equal(\"1100\", candidate.call(147))\n assert_equal(\"1001\", candidate.call(333))\n assert_equal(\"10010\", candidate.call(963))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "rb", - "prompt": "# You are given a list of integers.\n# You need to find the largest prime value and return the sum of its digits.\n# Examples:\n# >>> skjkasdkd.call([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3])\n# 10\n# >>> skjkasdkd.call([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1])\n# 25\n# >>> skjkasdkd.call([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3])\n# 13\n# >>> skjkasdkd.call([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6])\n# 11\n# >>> skjkasdkd.call([0, 81, 12, 3, 1, 21])\n# 3\n# >>> skjkasdkd.call([0, 8, 1, 2, 1, 7])\n# 7\ndef skjkasdkd(lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_skjkasdkd\n candidate = method(:skjkasdkd)\n assert_equal(10, candidate.call([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]))\n assert_equal(25, candidate.call([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]))\n assert_equal(13, candidate.call([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]))\n assert_equal(11, candidate.call([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]))\n assert_equal(3, candidate.call([0, 81, 12, 3, 1, 21]))\n assert_equal(7, candidate.call([0, 8, 1, 2, 1, 7]))\n assert_equal(19, candidate.call([8191]))\n assert_equal(19, candidate.call([8191, 123456, 127, 7]))\n assert_equal(10, candidate.call([127, 97, 8192]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "rb", - "prompt": "# Given an array arr of integers, find the minimum number of elements that\n# need to be changed to make the array palindromic. A palindromic array is an array that\n# is read the same backwards and forwards. In one change, you can change one element to any other element.\n# For example:\n# >>> smallest_change.call([1, 2, 3, 5, 4, 7, 9, 6])\n# 4\n# >>> smallest_change.call([1, 2, 3, 4, 3, 2, 2])\n# 1\n# >>> smallest_change.call([1, 2, 3, 2, 1])\n# 0\ndef smallest_change(arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_smallest_change\n candidate = method(:smallest_change)\n assert_equal(4, candidate.call([1, 2, 3, 5, 4, 7, 9, 6]))\n assert_equal(1, candidate.call([1, 2, 3, 4, 3, 2, 2]))\n assert_equal(1, candidate.call([1, 4, 2]))\n assert_equal(1, candidate.call([1, 4, 4, 2]))\n assert_equal(0, candidate.call([1, 2, 3, 2, 1]))\n assert_equal(0, candidate.call([3, 1, 1, 3]))\n assert_equal(0, candidate.call([1]))\n assert_equal(1, candidate.call([0, 1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "rb", - "prompt": "# It is the last week of the semester and the teacher has to give the grades\n# to students. The teacher has been making her own algorithm for grading.\n# The only problem is, she has lost the code she used for grading.\n# She has given you a list of GPAs for some students and you have to write \n# a function that can output a list of letter grades using the following table:\n# GPA | Letter grade\n# 4.0 A+\n# > 3.7 A \n# > 3.3 A- \n# > 3.0 B+\n# > 2.7 B \n# > 2.3 B-\n# > 2.0 C+\n# > 1.7 C\n# > 1.3 C-\n# > 1.0 D+ \n# > 0.7 D \n# > 0.0 D-\n# 0.0 E\n# Example:\n# >>> grade_equation.call([4.0, 3, 1.7, 2, 3.5])\n# [\"A+\", \"B\", \"C-\", \"C\", \"A-\"]\ndef numerical_letter_grade(grades)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_numerical_letter_grade\n candidate = method(:numerical_letter_grade)\n assert_equal([\"A+\", \"B\", \"C-\", \"C\", \"A-\"], candidate.call([4.0, 3, 1.7, 2, 3.5]))\n assert_equal([\"D+\"], candidate.call([1.2]))\n assert_equal([\"D-\"], candidate.call([0.5]))\n assert_equal([\"E\"], candidate.call([0.0]))\n assert_equal([\"D\", \"D-\", \"C-\", \"B\", \"B+\"], candidate.call([1.0, 0.3, 1.5, 2.8, 3.3]))\n assert_equal([\"E\", \"D-\"], candidate.call([0.0, 0.7]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "rb", - "prompt": "# Given the lengths of the three sides of a triangle. Return the area of\n# the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n# Otherwise return -1\n# Three sides make a valid triangle when the sum of any two sides is greater \n# than the third side.\n# Example:\n# >>> triangle_area.call(3, 4, 5)\n# 6.0\n# >>> triangle_area.call(1, 2, 10)\n# -1\ndef triangle_area(a, b, c)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_triangle_area\n candidate = method(:triangle_area)\n assert_equal(6.0, candidate.call(3, 4, 5))\n assert_equal(-1, candidate.call(1, 2, 10))\n assert_equal(8.18, candidate.call(4, 8, 5))\n assert_equal(1.73, candidate.call(2, 2, 2))\n assert_equal(-1, candidate.call(1, 2, 3))\n assert_equal(16.25, candidate.call(10, 5, 7))\n assert_equal(-1, candidate.call(2, 6, 3))\n assert_equal(0.43, candidate.call(1, 1, 1))\n assert_equal(-1, candidate.call(2, 2, 10))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "rb", - "prompt": "# Check if two words have the same characters.\n# >>> same_chars.call(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\")\n# true\n# >>> same_chars.call(\"abcd\", \"dddddddabc\")\n# true\n# >>> same_chars.call(\"dddddddabc\", \"abcd\")\n# true\n# >>> same_chars.call(\"eabcd\", \"dddddddabc\")\n# false\n# >>> same_chars.call(\"abcd\", \"dddddddabce\")\n# false\n# >>> same_chars.call(\"eabcdzzzz\", \"dddzzzzzzzddddabc\")\n# false\ndef same_chars(s0, s1)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_same_chars\n candidate = method(:same_chars)\n assert_equal(true, candidate.call(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\"))\n assert_equal(true, candidate.call(\"abcd\", \"dddddddabc\"))\n assert_equal(true, candidate.call(\"dddddddabc\", \"abcd\"))\n assert_equal(false, candidate.call(\"eabcd\", \"dddddddabc\"))\n assert_equal(false, candidate.call(\"abcd\", \"dddddddabcf\"))\n assert_equal(false, candidate.call(\"eabcdzzzz\", \"dddzzzzzzzddddabc\"))\n assert_equal(false, candidate.call(\"aabb\", \"aaccc\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "rb", - "prompt": "# Given an array of integers nums, find the minimum sum of any non-empty sub-array\n# of nums.\n# Example\n# >>> minSubArraySum.call([2, 3, 4, 1, 2, 4])\n# 1\n# >>> minSubArraySum.call([-1, -2, -3])\n# -6\ndef minSubArraySum(nums)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_minSubArraySum\n candidate = method(:minSubArraySum)\n assert_equal(1, candidate.call([2, 3, 4, 1, 2, 4]))\n assert_equal(-6, candidate.call([-1, -2, -3]))\n assert_equal(-14, candidate.call([-1, -2, -3, 2, -10]))\n assert_equal(-9999999999999999, candidate.call([-9999999999999999]))\n assert_equal(0, candidate.call([0, 10, 20, 1000000]))\n assert_equal(-6, candidate.call([-1, -2, -3, 10, -5]))\n assert_equal(-6, candidate.call([100, -1, -2, -3, 10, -5]))\n assert_equal(3, candidate.call([10, 11, 13, 8, 3, 4]))\n assert_equal(-33, candidate.call([100, -33, 32, -1, 0, -2]))\n assert_equal(-10, candidate.call([-10]))\n assert_equal(7, candidate.call([7]))\n assert_equal(-1, candidate.call([1, -1]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "rb", - "prompt": "# Given a string s and a natural number n, you have been tasked to implement \n# a function that returns a list of all words from string s that contain exactly \n# n consonants, in order these words appear in the string s.\n# If the string s is empty then the function should return an empty list.\n# Note: you may assume the input string contains only letters and spaces.\n# Examples:\n# >>> select_words.call(\"Mary had a little lamb\", 4)\n# [\"little\"]\n# >>> select_words.call(\"Mary had a little lamb\", 3)\n# [\"Mary\", \"lamb\"]\n# >>> select_words.call(\"simple white space\", 2)\n# []\n# >>> select_words.call(\"Hello world\", 4)\n# [\"world\"]\n# >>> select_words.call(\"Uncle sam\", 3)\n# [\"Uncle\"]\ndef select_words(s, n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_select_words\n candidate = method(:select_words)\n assert_equal([\"little\"], candidate.call(\"Mary had a little lamb\", 4))\n assert_equal([\"Mary\", \"lamb\"], candidate.call(\"Mary had a little lamb\", 3))\n assert_equal([], candidate.call(\"simple white space\", 2))\n assert_equal([\"world\"], candidate.call(\"Hello world\", 4))\n assert_equal([\"Uncle\"], candidate.call(\"Uncle sam\", 3))\n assert_equal([], candidate.call(\"\", 4))\n assert_equal([\"b\", \"c\", \"d\", \"f\"], candidate.call(\"a b c d e f\", 1))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "rb", - "prompt": "# Return list of all prefixes from shortest to longest of the input string\n# >>> all_prefixes.call(\"abc\")\n# [\"a\", \"ab\", \"abc\"]\ndef all_prefixes(string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_all_prefixes\n candidate = method(:all_prefixes)\n assert_equal([], candidate.call(\"\"))\n assert_equal([\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"], candidate.call(\"asdfgh\"))\n assert_equal([\"W\", \"WW\", \"WWW\"], candidate.call(\"WWW\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "rb", - "prompt": "# Create a function that takes a value (string) representing a number\n# and returns the closest integer to it. If the number is equidistant\n# from two integers, round it away from zero.\n# Examples\n# >>> closest_integer.call(\"10\")\n# 10\n# >>> closest_integer.call(\"15.3\")\n# 15\n# Note:\n# Rounding away from zero means that if the given number is equidistant\n# from two integers, the one you should return is the one that is the\n# farthest from zero. For example closest_integer(\"14.5\") should\n# return 15 and closest_integer(\"-14.5\") should return -15.\ndef closest_integer(value)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_closest_integer\n candidate = method(:closest_integer)\n assert_equal(10, candidate.call(\"10\"))\n assert_equal(15, candidate.call(\"14.5\"))\n assert_equal(-16, candidate.call(\"-15.5\"))\n assert_equal(15, candidate.call(\"15.3\"))\n assert_equal(0, candidate.call(\"0\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "rb", - "prompt": "# Create a function which takes a string representing a file's name, and returns\n# 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n# A file's name is considered to be valid if and only if all the following conditions \n# are met:\n# - There should not be more than three digits ('0'-'9') in the file's name.\n# - The file's name contains exactly one dot '.'\n# - The substring before the dot should not be empty, and it starts with a letter from \n# the latin alphapet ('a'-'z' and 'A'-'Z').\n# - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n# Examples:\n# >>> file_name_check.call(\"example.txt\")\n# \"Yes\"\n# >>> file_name_check.call(\"1example.dll\")\n# \"No\"\ndef file_name_check(file_name)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_file_name_check\n candidate = method(:file_name_check)\n assert_equal(\"Yes\", candidate.call(\"example.txt\"))\n assert_equal(\"No\", candidate.call(\"1example.dll\"))\n assert_equal(\"No\", candidate.call(\"s1sdf3.asd\"))\n assert_equal(\"Yes\", candidate.call(\"K.dll\"))\n assert_equal(\"Yes\", candidate.call(\"MY16FILE3.exe\"))\n assert_equal(\"No\", candidate.call(\"His12FILE94.exe\"))\n assert_equal(\"No\", candidate.call(\"_Y.txt\"))\n assert_equal(\"No\", candidate.call(\"?aREYA.exe\"))\n assert_equal(\"No\", candidate.call(\"/this_is_valid.dll\"))\n assert_equal(\"No\", candidate.call(\"this_is_valid.wow\"))\n assert_equal(\"Yes\", candidate.call(\"this_is_valid.txt\"))\n assert_equal(\"No\", candidate.call(\"this_is_valid.txtexe\"))\n assert_equal(\"No\", candidate.call(\"#this2_i4s_5valid.ten\"))\n assert_equal(\"No\", candidate.call(\"@this1_is6_valid.exe\"))\n assert_equal(\"No\", candidate.call(\"this_is_12valid.6exe4.txt\"))\n assert_equal(\"No\", candidate.call(\"all.exe.txt\"))\n assert_equal(\"Yes\", candidate.call(\"I563_No.exe\"))\n assert_equal(\"Yes\", candidate.call(\"Is3youfault.txt\"))\n assert_equal(\"Yes\", candidate.call(\"no_one#knows.dll\"))\n assert_equal(\"No\", candidate.call(\"1I563_Yes3.exe\"))\n assert_equal(\"No\", candidate.call(\"I563_Yes3.txtt\"))\n assert_equal(\"No\", candidate.call(\"final..txt\"))\n assert_equal(\"No\", candidate.call(\"final132\"))\n assert_equal(\"No\", candidate.call(\"_f4indsartal132.\"))\n assert_equal(\"No\", candidate.call(\".txt\"))\n assert_equal(\"No\", candidate.call(\"s.\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "rb", - "prompt": "# You are given two intervals,\n# where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n# The given intervals are closed which means that the interval (start, end)\n# includes both start and end.\n# For each given interval, it is assumed that its start is less or equal its end.\n# Your task is to determine whether the length of intersection of these two \n# intervals is a prime number.\n# Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n# which its length is 1, which not a prime number.\n# If the length of the intersection is a prime number, return \"YES\",\n# otherwise, return \"NO\".\n# If the two intervals don't intersect, return \"NO\".\n# [input/output] samples:\n# >>> intersection.call([1, 2], [2, 3])\n# \"NO\"\n# >>> intersection.call([-1, 1], [0, 4])\n# \"NO\"\n# >>> intersection.call([-3, -1], [-5, 5])\n# \"YES\"\ndef intersection(interval1, interval2)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_intersection\n candidate = method(:intersection)\n assert_equal(\"NO\", candidate.call([1, 2], [2, 3]))\n assert_equal(\"NO\", candidate.call([-1, 1], [0, 4]))\n assert_equal(\"YES\", candidate.call([-3, -1], [-5, 5]))\n assert_equal(\"YES\", candidate.call([-2, 2], [-4, 0]))\n assert_equal(\"NO\", candidate.call([-11, 2], [-1, -1]))\n assert_equal(\"NO\", candidate.call([1, 2], [3, 5]))\n assert_equal(\"NO\", candidate.call([1, 2], [1, 2]))\n assert_equal(\"NO\", candidate.call([-2, -2], [-3, -2]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "rb", - "prompt": "# Return the largest prime factor of n. Assume n > 1 and is not a prime.\n# >>> largest_prime_factor.call(13195)\n# 29\n# >>> largest_prime_factor.call(2048)\n# 2\ndef largest_prime_factor(n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_largest_prime_factor\n candidate = method(:largest_prime_factor)\n assert_equal(5, candidate.call(15))\n assert_equal(3, candidate.call(27))\n assert_equal(7, candidate.call(63))\n assert_equal(11, candidate.call(330))\n assert_equal(29, candidate.call(13195))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "rb", - "prompt": "# Given a string, find out how many distinct characters (regardless of case) does it consist of\n# >>> count_distinct_characters.call(\"xyzXYZ\")\n# 3\n# >>> count_distinct_characters.call(\"Jerry\")\n# 4\ndef count_distinct_characters(string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_count_distinct_characters\n candidate = method(:count_distinct_characters)\n assert_equal(0, candidate.call(\"\"))\n assert_equal(5, candidate.call(\"abcde\"))\n assert_equal(5, candidate.call(\"abcdecadeCADE\"))\n assert_equal(1, candidate.call(\"aaaaAAAAaaaa\"))\n assert_equal(5, candidate.call(\"Jerry jERRY JeRRRY\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "rb", - "prompt": "# You're given a list of deposit and withdrawal operations on a bank account that starts with\n# zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n# at that point function should return True. Otherwise it should return False.\n# >>> below_zero.call([1, 2, 3])\n# false\n# >>> below_zero.call([1, 2, -4, 5])\n# true\ndef below_zero(operations)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_below_zero\n candidate = method(:below_zero)\n assert_equal(false, candidate.call([]))\n assert_equal(false, candidate.call([1, 2, -3, 1, 2, -3]))\n assert_equal(true, candidate.call([1, 2, -4, 5, 6]))\n assert_equal(false, candidate.call([1, -1, 2, -2, 5, -5, 4, -4]))\n assert_equal(true, candidate.call([1, -1, 2, -2, 5, -5, 4, -5]))\n assert_equal(true, candidate.call([1, -2, 2, -2, 5, -5, 4, -4]))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "rb", - "prompt": "# Find the shortest palindrome that begins with a supplied string.\n# Algorithm idea is simple:\n# - Find the longest postfix of supplied string that is a palindrome.\n# - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n# >>> make_palindrome.call(\"\")\n# \"\"\n# >>> make_palindrome.call(\"cat\")\n# \"catac\"\n# >>> make_palindrome.call(\"cata\")\n# \"catac\"\ndef make_palindrome(string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_make_palindrome\n candidate = method(:make_palindrome)\n assert_equal(\"\", candidate.call(\"\"))\n assert_equal(\"x\", candidate.call(\"x\"))\n assert_equal(\"xyzyx\", candidate.call(\"xyz\"))\n assert_equal(\"xyx\", candidate.call(\"xyx\"))\n assert_equal(\"jerryrrej\", candidate.call(\"jerry\"))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "rb", - "prompt": "# Given a positive integer, obtain its roman numeral equivalent as a string,\n# and return it in lowercase.\n# Restrictions: 1 <= num <= 1000\n# Examples:\n# >>> int_to_mini_roman.call(19)\n# \"xix\"\n# >>> int_to_mini_roman.call(152)\n# \"clii\"\n# >>> int_to_mini_roman.call(426)\n# \"cdxxvi\"\ndef int_to_mini_roman(number)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "require 'test/unit'\nclass TestHumanEval < Test::Unit::TestCase\n def test_int_to_mini_roman\n candidate = method(:int_to_mini_roman)\n assert_equal(\"xix\", candidate.call(19))\n assert_equal(\"clii\", candidate.call(152))\n assert_equal(\"ccli\", candidate.call(251))\n assert_equal(\"cdxxvi\", candidate.call(426))\n assert_equal(\"d\", candidate.call(500))\n assert_equal(\"i\", candidate.call(1))\n assert_equal(\"iv\", candidate.call(4))\n assert_equal(\"xliii\", candidate.call(43))\n assert_equal(\"xc\", candidate.call(90))\n assert_equal(\"xciv\", candidate.call(94))\n assert_equal(\"dxxxii\", candidate.call(532))\n assert_equal(\"cm\", candidate.call(900))\n assert_equal(\"cmxciv\", candidate.call(994))\n assert_equal(\"m\", candidate.call(1000))\n end\nend\n", - "stop_tokens": [ - "\nclass", - "\ndef", - "\n#", - "\n\n" - ] - } -] \ No newline at end of file diff --git a/data/rkt-keep.json b/data/rkt-keep.json deleted file mode 100644 index af666bac8f2a478f69816458458ffa40204c72f6..0000000000000000000000000000000000000000 --- a/data/rkt-keep.json +++ /dev/null @@ -1,2417 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "rkt", - "prompt": "#lang racket\n\n;; For a given number n, find the largest number that divides n evenly, smaller than n\n;; >>> largest_divisor(15)\n;; 5\n(define (largest_divisor n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate largest_divisor))\n (check-equal? (candidate 3) 1)\n (check-equal? (candidate 7) 1)\n (check-equal? (candidate 10) 5)\n (check-equal? (candidate 100) 50)\n (check-equal? (candidate 49) 7)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_47_median", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return median of elements in the list l.\n;; >>> median([3, 1, 2, 4, 5])\n;; 3\n;; >>> median([-10, 4, 6, 1000, 10, 20])\n;; 15.0\n(define (median l)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate median))\n (check-equal? (candidate (list 3 1 2 4 5)) 3)\n (check-equal? (candidate (list -10 4 6 1000 10 20)) 8.0)\n (check-equal? (candidate (list 5)) 5)\n (check-equal? (candidate (list 6 5)) 5.5)\n (check-equal? (candidate (list 8 1 3 9 9 2 7)) 7)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given two lists operator, and operand. The first list has basic algebra operations, and \n;; the second list is a list of integers. Use the two given lists to build the algebric \n;; expression and return the evaluation of this expression.\n;; The basic algebra operations:\n;; Addition ( + ) \n;; Subtraction ( - ) \n;; Multiplication ( * ) \n;; Floor division ( // ) \n;; Exponentiation ( ** ) \n;; Example:\n;; operator['+', '*', '-']\n;; array = [2, 3, 4, 5]\n;; result = 2 + 3 * 4 - 5\n;; => result = 9\n;; Note:\n;; The length of operator list is equal to the length of operand list minus one.\n;; Operand is a list of of non-negative integers.\n;; Operator list has at least one operator, and operand list has at least two operands.\n(define (do_algebra operator operand)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate do_algebra))\n (check-equal? (candidate (list \"**\" \"*\" \"+\") (list 2 3 4 5)) 37)\n (check-equal? (candidate (list \"+\" \"*\" \"-\") (list 2 3 4 5)) 9)\n (check-equal? (candidate (list \"//\" \"*\") (list 7 3 4)) 8)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return maximum element in the list.\n;; >>> max_element([1, 2, 3])\n;; 3\n;; >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n;; 123\n(define (max_element l)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate max_element))\n (check-equal? (candidate (list 1 2 3)) 3)\n (check-equal? (candidate (list 5 3 -5 2 -3 3 9 0 124 1 -10)) 124)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function which returns the largest index of an element which\n;; is not greater than or equal to the element immediately preceding it. If\n;; no such element exists then return -1. The given array will not contain\n;; duplicate values.\n;; Examples:\n;; can_arrange([1,2,4,3,5]) = 3\n;; can_arrange([1,2,3]) = -1\n(define (can_arrange arr)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate can_arrange))\n (check-equal? (candidate (list 1 2 4 3 5)) 3)\n (check-equal? (candidate (list 1 2 4 5)) -1)\n (check-equal? (candidate (list 1 4 2 5 6 7 8 9 10)) 2)\n (check-equal? (candidate (list 4 8 5 7 3)) 4)\n (check-equal? (candidate (list )) -1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "rkt", - "prompt": "#lang racket\n\n;; Imagine a road that's a perfectly straight infinitely long line.\n;; n cars are driving left to right; simultaneously, a different set of n cars\n;; are driving right to left. The two sets of cars start out being very far from\n;; each other. All cars move in the same speed. Two cars are said to collide\n;; when a car that's moving left to right hits a car that's moving right to left.\n;; However, the cars are infinitely sturdy and strong; as a result, they continue moving\n;; in their trajectory as if they did not collide.\n;; This function outputs the number of such collisions.\n(define (car_race_collision n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate car_race_collision))\n (check-equal? (candidate 2) 4)\n (check-equal? (candidate 3) 9)\n (check-equal? (candidate 4) 16)\n (check-equal? (candidate 8) 64)\n (check-equal? (candidate 10) 100)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function that returns True if the last character\n;; of a given string is an alphabetical character and is not\n;; a part of a word, and False otherwise.\n;; Note: \"word\" is a group of characters separated by space.\n;; Examples:\n;; check_if_last_char_is_a_letter(\"apple pie\") \u279e False\n;; check_if_last_char_is_a_letter(\"apple pi e\") \u279e True\n;; check_if_last_char_is_a_letter(\"apple pi e \") \u279e False\n;; check_if_last_char_is_a_letter(\"\") \u279e False\n(define (check_if_last_char_is_a_letter txt)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate check_if_last_char_is_a_letter))\n (check-equal? (candidate \"apple\") #f)\n (check-equal? (candidate \"apple pi e\") #t)\n (check-equal? (candidate \"eeeee\") #f)\n (check-equal? (candidate \"A\") #t)\n (check-equal? (candidate \"Pumpkin pie \") #f)\n (check-equal? (candidate \"Pumpkin pie 1\") #f)\n (check-equal? (candidate \"\") #f)\n (check-equal? (candidate \"eeeee e \") #f)\n (check-equal? (candidate \"apple pie\") #f)\n (check-equal? (candidate \"apple pi e \") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return true if a given number is prime, and false otherwise.\n;; >>> is_prime(6)\n;; False\n;; >>> is_prime(101)\n;; True\n;; >>> is_prime(11)\n;; True\n;; >>> is_prime(13441)\n;; True\n;; >>> is_prime(61)\n;; True\n;; >>> is_prime(4)\n;; False\n;; >>> is_prime(1)\n;; False\n(define (is_prime n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_prime))\n (check-equal? (candidate 6) #f)\n (check-equal? (candidate 101) #t)\n (check-equal? (candidate 11) #t)\n (check-equal? (candidate 13441) #t)\n (check-equal? (candidate 61) #t)\n (check-equal? (candidate 4) #f)\n (check-equal? (candidate 1) #f)\n (check-equal? (candidate 5) #t)\n (check-equal? (candidate 11) #t)\n (check-equal? (candidate 17) #t)\n (check-equal? (candidate 85) #f)\n (check-equal? (candidate 77) #f)\n (check-equal? (candidate 255379) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a list of positive integers x. return a sorted list of all \n;; elements that hasn't any even digit.\n;; Note: Returned list should be sorted in increasing order.\n;; For example:\n;; >>> unique_digits([15, 33, 1422, 1])\n;; [1, 15, 33]\n;; >>> unique_digits([152, 323, 1422, 10])\n;; []\n(define (unique_digits x)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate unique_digits))\n (check-equal? (candidate (list 15 33 1422 1)) (list 1 15 33))\n (check-equal? (candidate (list 152 323 1422 10)) (list ))\n (check-equal? (candidate (list 12345 2033 111 151)) (list 111 151))\n (check-equal? (candidate (list 135 103 31)) (list 31 135))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "rkt", - "prompt": "#lang racket\n\n;; Input are two strings a and b consisting only of 1s and 0s.\n;; Perform binary XOR on these inputs and return result also as a string.\n;; >>> string_xor('010', '110')\n;; '100'\n(define (string_xor a b)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate string_xor))\n (check-equal? (candidate \"111000\" \"101010\") \"010010\")\n (check-equal? (candidate \"1\" \"1\") \"0\")\n (check-equal? (candidate \"0101\" \"0000\") \"0101\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "rkt", - "prompt": "#lang racket\n\n;; sum_to_n is a function that sums numbers from 1 to n.\n;; >>> sum_to_n(30)\n;; 465\n;; >>> sum_to_n(100)\n;; 5050\n;; >>> sum_to_n(5)\n;; 15\n;; >>> sum_to_n(10)\n;; 55\n;; >>> sum_to_n(1)\n;; 1\n(define (sum_to_n n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sum_to_n))\n (check-equal? (candidate 1) 1)\n (check-equal? (candidate 6) 21)\n (check-equal? (candidate 11) 66)\n (check-equal? (candidate 30) 465)\n (check-equal? (candidate 100) 5050)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a list of numbers, return the sum of squares of the numbers\n;; in the list that are odd. Ignore numbers that are negative or not integers.\n;; double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10\n;; double_the_difference([-1, -2, 0]) == 0\n;; double_the_difference([9, -2]) == 81\n;; double_the_difference([0]) == 0 \n;; If the input list is empty, return 0.\n(define (double_the_difference lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate double_the_difference))\n (check-equal? (candidate (list )) 0)\n (check-equal? (candidate (list 5.0 4.0)) 25)\n (check-equal? (candidate (list 0.1 0.2 0.3)) 0)\n (check-equal? (candidate (list -10.0 -20.0 -30.0)) 0)\n (check-equal? (candidate (list -1.0 -2.0 8.0)) 0)\n (check-equal? (candidate (list 0.2 3.0 5.0)) 34)\n (check-equal? (candidate (list -9.0 -7.0 -5.0 -3.0 -1.0 1.0 3.0 5.0 7.0 9.0)) 165)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return length of given string\n;; >>> strlen('')\n;; 0\n;; >>> strlen('abc')\n;; 3\n(define (strlen string)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate strlen))\n (check-equal? (candidate \"\") 0)\n (check-equal? (candidate \"x\") 1)\n (check-equal? (candidate \"asdasnakj\") 9)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "rkt", - "prompt": "#lang racket\n\n;; You'll be given a string of words, and your task is to count the number\n;; of boredoms. A boredom is a sentence that starts with the word \"I\".\n;; Sentences are delimited by '.', '?' or '!'.\n;; For example:\n;; >>> is_bored(\"Hello world\")\n;; 0\n;; >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n;; 1\n(define (is_bored S)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_bored))\n (check-equal? (candidate \"Hello world\") 0)\n (check-equal? (candidate \"Is the sky blue?\") 0)\n (check-equal? (candidate \"I love It !\") 1)\n (check-equal? (candidate \"bIt\") 0)\n (check-equal? (candidate \"I feel good today. I will be productive. will kill It\") 2)\n (check-equal? (candidate \"You and I are going for a walk\") 0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function vowels_count which takes a string representing\n;; a word as input and returns the number of vowels in the string.\n;; Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n;; vowel, but only when it is at the end of the given word.\n;; Example:\n;; >>> vowels_count(\"abcde\")\n;; 2\n;; >>> vowels_count(\"ACEDY\")\n;; 3\n(define (vowels_count s)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate vowels_count))\n (check-equal? (candidate \"abcde\") 2)\n (check-equal? (candidate \"Alone\") 3)\n (check-equal? (candidate \"key\") 2)\n (check-equal? (candidate \"bye\") 1)\n (check-equal? (candidate \"keY\") 2)\n (check-equal? (candidate \"bYe\") 1)\n (check-equal? (candidate \"ACEDY\") 3)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return n-th Fibonacci number.\n;; >>> fib(10)\n;; 55\n;; >>> fib(1)\n;; 1\n;; >>> fib(8)\n;; 21\n(define (fib n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate fib))\n (check-equal? (candidate 10) 55)\n (check-equal? (candidate 1) 1)\n (check-equal? (candidate 8) 21)\n (check-equal? (candidate 11) 89)\n (check-equal? (candidate 12) 144)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "rkt", - "prompt": "#lang racket\n\n;; Your task is to implement a function that will simplify the expression\n;; x * n. The function returns True if x * n evaluates to a whole number and False\n;; otherwise. Both x and n, are string representation of a fraction, and have the following format,\n;; / where both numerator and denominator are positive whole numbers.\n;; You can assume that x, and n are valid fractions, and do not have zero as denominator.\n;; simplify(\"1/5\", \"5/1\") = True\n;; simplify(\"1/6\", \"2/1\") = False\n;; simplify(\"7/10\", \"10/2\") = False\n(define (simplify x n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate simplify))\n (check-equal? (candidate \"1/5\" \"5/1\") #t)\n (check-equal? (candidate \"1/6\" \"2/1\") #f)\n (check-equal? (candidate \"5/1\" \"3/1\") #t)\n (check-equal? (candidate \"7/10\" \"10/2\") #f)\n (check-equal? (candidate \"2/10\" \"50/10\") #t)\n (check-equal? (candidate \"7/2\" \"4/2\") #t)\n (check-equal? (candidate \"11/6\" \"6/1\") #t)\n (check-equal? (candidate \"2/3\" \"5/2\") #f)\n (check-equal? (candidate \"5/2\" \"3/5\") #f)\n (check-equal? (candidate \"2/4\" \"8/4\") #t)\n (check-equal? (candidate \"2/4\" \"4/2\") #t)\n (check-equal? (candidate \"1/5\" \"5/1\") #t)\n (check-equal? (candidate \"1/5\" \"1/5\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a string s, count the number of uppercase vowels in even indices.\n;; For example:\n;; count_upper('aBCdEf') returns 1\n;; count_upper('abcdefg') returns 0\n;; count_upper('dBBE') returns 0\n(define (count_upper s)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate count_upper))\n (check-equal? (candidate \"aBCdEf\") 1)\n (check-equal? (candidate \"abcdefg\") 0)\n (check-equal? (candidate \"dBBE\") 0)\n (check-equal? (candidate \"B\") 0)\n (check-equal? (candidate \"U\") 1)\n (check-equal? (candidate \"\") 0)\n (check-equal? (candidate \"EEEE\") 2)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a rectangular grid of wells. Each row represents a single well,\n;; and each 1 in a row represents a single unit of water.\n;; Each well has a corresponding bucket that can be used to extract water from it, \n;; and all buckets have the same capacity.\n;; Your task is to use the buckets to empty the wells.\n;; Output the number of times you need to lower the buckets.\n;; Example 1:\n;; Input: \n;; grid : [[0,0,1,0], [0,1,0,0], [1,1,1,1]]\n;; bucket_capacity : 1\n;; Output: 6\n;; Example 2:\n;; Input: \n;; grid : [[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]]\n;; bucket_capacity : 2\n;; Output: 5\n;; Example 3:\n;; Input: \n;; grid : [[0,0,0], [0,0,0]]\n;; bucket_capacity : 5\n;; Output: 0\n;; Constraints:\n;; * all wells have the same length\n;; * 1 <= grid.length <= 10^2\n;; * 1 <= grid[:,1].length <= 10^2\n;; * grid[i][j] -> 0 | 1\n;; * 1 <= capacity <= 10\n(define (max_fill grid capacity)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate max_fill))\n (check-equal? (candidate (list (list 0 0 1 0) (list 0 1 0 0) (list 1 1 1 1)) 1) 6)\n (check-equal? (candidate (list (list 0 0 1 1) (list 0 0 0 0) (list 1 1 1 1) (list 0 1 1 1)) 2) 5)\n (check-equal? (candidate (list (list 0 0 0) (list 0 0 0)) 5) 0)\n (check-equal? (candidate (list (list 1 1 1 1) (list 1 1 1 1)) 2) 4)\n (check-equal? (candidate (list (list 1 1 1 1) (list 1 1 1 1)) 9) 2)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given an array arr of integers and a positive integer k, return a sorted list \n;; of length k with the maximum k numbers in arr.\n;; Example 1:\n;; Input: arr = [-3, -4, 5], k = 3\n;; Output: [-4, -3, 5]\n;; Example 2:\n;; Input: arr = [4, -4, 4], k = 2\n;; Output: [4, 4]\n;; Example 3:\n;; Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1\n;; Output: [2]\n;; Note:\n;; 1. The length of the array will be in the range of [1, 1000].\n;; 2. The elements in the array will be in the range of [-1000, 1000].\n;; 3. 0 <= k <= len(arr)\n(define (maximum arr k)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate maximum))\n (check-equal? (candidate (list -3 -4 5) 3) (list -4 -3 5))\n (check-equal? (candidate (list 4 -4 4) 2) (list 4 4))\n (check-equal? (candidate (list -3 2 1 2 -1 -2 1) 1) (list 2))\n (check-equal? (candidate (list 123 -123 20 0 1 2 -3) 3) (list 2 20 123))\n (check-equal? (candidate (list -123 20 0 1 2 -3) 4) (list 0 1 2 20))\n (check-equal? (candidate (list 5 15 0 3 -13 -8 0) 7) (list -13 -8 0 0 3 5 15))\n (check-equal? (candidate (list -1 0 2 5 3 -10) 2) (list 3 5))\n (check-equal? (candidate (list 1 0 5 -7) 1) (list 5))\n (check-equal? (candidate (list 4 -4) 2) (list -4 4))\n (check-equal? (candidate (list -10 10) 2) (list -10 10))\n (check-equal? (candidate (list 1 2 3 -23 243 -400 0) 0) (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that takes a message, and encodes in such a \n;; way that it swaps case of all letters, replaces all vowels in \n;; the message with the letter that appears 2 places ahead of that \n;; vowel in the english alphabet. \n;; Assume only letters. \n;; Examples:\n;; >>> encode('test')\n;; 'TGST'\n;; >>> encode('This is a message')\n;; 'tHKS KS C MGSSCGG'\n(define (encode message)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate encode))\n (check-equal? (candidate \"TEST\") \"tgst\")\n (check-equal? (candidate \"Mudasir\") \"mWDCSKR\")\n (check-equal? (candidate \"YES\") \"ygs\")\n (check-equal? (candidate \"This is a message\") \"tHKS KS C MGSSCGG\")\n (check-equal? (candidate \"I DoNt KnOw WhAt tO WrItE\") \"k dQnT kNqW wHcT Tq wRkTg\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "rkt", - "prompt": "#lang racket\n\n;; remove_vowels is a function that takes string and returns string without vowels.\n;; >>> remove_vowels('')\n;; ''\n;; >>> remove_vowels('abcdef')\n;; 'bcdf'\n;; >>> remove_vowels('aaaaa')\n;; ''\n;; >>> remove_vowels('aaBAA')\n;; 'B'\n;; >>> remove_vowels('zbcd')\n;; 'zbcd'\n(define (remove_vowels text)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate remove_vowels))\n (check-equal? (candidate \"\") \"\")\n (check-equal? (candidate \"abcdef\nghijklm\") \"bcdf\nghjklm\")\n (check-equal? (candidate \"fedcba\") \"fdcb\")\n (check-equal? (candidate \"eeeee\") \"\")\n (check-equal? (candidate \"acBAA\") \"cB\")\n (check-equal? (candidate \"EcBOO\") \"cB\")\n (check-equal? (candidate \"ybcd\") \"ybcd\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return only positive numbers in the list.\n;; >>> get_positive([-1, 2, -4, 5, 6])\n;; [2, 5, 6]\n;; >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n;; [5, 3, 2, 3, 9, 123, 1]\n(define (get_positive l)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate get_positive))\n (check-equal? (candidate (list -1 -2 4 5 6)) (list 4 5 6))\n (check-equal? (candidate (list 5 3 -5 2 3 3 9 0 123 1 -10)) (list 5 3 2 3 3 9 123 1))\n (check-equal? (candidate (list -1 -2)) (list ))\n (check-equal? (candidate (list )) (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n;; >>> string_sequence(0)\n;; '0'\n;; >>> string_sequence(5)\n;; '0 1 2 3 4 5'\n(define (string_sequence n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate string_sequence))\n (check-equal? (candidate 0) \"0\")\n (check-equal? (candidate 3) \"0 1 2 3\")\n (check-equal? (candidate 10) \"0 1 2 3 4 5 6 7 8 9 10\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a positive integer n, you have to make a pile of n levels of stones.\n;; The first level has n stones.\n;; The number of stones in the next level is:\n;; - the next odd number if n is odd.\n;; - the next even number if n is even.\n;; Return the number of stones in each level in a list, where element at index\n;; i represents the number of stones in the level (i+1).\n;; Examples:\n;; >>> make_a_pile(3)\n;; [3, 5, 7]\n(define (make_a_pile n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate make_a_pile))\n (check-equal? (candidate 3) (list 3 5 7))\n (check-equal? (candidate 4) (list 4 6 8 10))\n (check-equal? (candidate 5) (list 5 7 9 11 13))\n (check-equal? (candidate 6) (list 6 8 10 12 14 16))\n (check-equal? (candidate 8) (list 8 10 12 14 16 18 20 22))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "rkt", - "prompt": "#lang racket\n\n;; Task\n;; 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\n;; then check if the result string is palindrome.\n;; A string is called palindrome if it reads the same backward as forward.\n;; You should return a tuple containing the result string and True/False for the check.\n;; Example\n;; For s = \"abcde\", c = \"ae\", the result should be ('bcd',False)\n;; For s = \"abcdef\", c = \"b\" the result should be ('acdef',False)\n;; For s = \"abcdedcba\", c = \"ab\", the result should be ('cdedc',True)\n(define (reverse_delete s c)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate reverse_delete))\n (check-equal? (candidate \"abcde\" \"ae\") (list \"bcd\" #f))\n (check-equal? (candidate \"abcdef\" \"b\") (list \"acdef\" #f))\n (check-equal? (candidate \"abcdedcba\" \"ab\") (list \"cdedc\" #t))\n (check-equal? (candidate \"dwik\" \"w\") (list \"dik\" #f))\n (check-equal? (candidate \"a\" \"a\") (list \"\" #t))\n (check-equal? (candidate \"abcdedcba\" \"\") (list \"abcdedcba\" #t))\n (check-equal? (candidate \"abcdedcba\" \"v\") (list \"abcdedcba\" #t))\n (check-equal? (candidate \"vabba\" \"v\") (list \"abba\" #t))\n (check-equal? (candidate \"mamma\" \"mia\") (list \"\" #t))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "rkt", - "prompt": "#lang racket\n\n;; For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n;; >>> flip_case('Hello')\n;; 'hELLO'\n(define (flip_case string)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate flip_case))\n (check-equal? (candidate \"\") \"\")\n (check-equal? (candidate \"Hello!\") \"hELLO!\")\n (check-equal? (candidate \"These violent delights have violent ends\") \"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a string s.\n;; if s[i] is a letter, reverse its case from lower to upper or vise versa, \n;; otherwise keep it as it is.\n;; If the string contains no letters, reverse the string.\n;; The function should return the resulted string.\n;; Examples\n;; solve(\"1234\") = \"4321\"\n;; solve(\"ab\") = \"AB\"\n;; solve(\"#a@C\") = \"#A@c\"\n(define (solve s)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate solve))\n (check-equal? (candidate \"AsDf\") \"aSdF\")\n (check-equal? (candidate \"1234\") \"4321\")\n (check-equal? (candidate \"ab\") \"AB\")\n (check-equal? (candidate \"#a@C\") \"#A@c\")\n (check-equal? (candidate \"#AsdfW^45\") \"#aSDFw^45\")\n (check-equal? (candidate \"#6@2\") \"2@6#\")\n (check-equal? (candidate \"#$a^D\") \"#$A^d\")\n (check-equal? (candidate \"#ccc\") \"#CCC\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "rkt", - "prompt": "#lang racket\n\n;; Filter an input list of strings only for ones that start with a given prefix.\n;; >>> filter_by_prefix([], 'a')\n;; []\n;; >>> filter_by_prefix(['abc', 'bcd', 'cde', 'array'], 'a')\n;; ['abc', 'array']\n(define (filter_by_prefix strings prefix)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate filter_by_prefix))\n (check-equal? (candidate (list ) \"john\") (list ))\n (check-equal? (candidate (list \"xxx\" \"asd\" \"xxy\" \"john doe\" \"xxxAAA\" \"xxx\") \"xxx\") (list \"xxx\" \"xxxAAA\" \"xxx\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "rkt", - "prompt": "#lang racket\n\n;; This function takes two positive numbers x and y and returns the\n;; biggest even integer number that is in the range [x, y] inclusive. If \n;; there's no such number, then the function should return -1.\n;; For example:\n;; choose_num(12, 15) = 14\n;; choose_num(13, 12) = -1\n(define (choose_num x y)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate choose_num))\n (check-equal? (candidate 12 15) 14)\n (check-equal? (candidate 13 12) -1)\n (check-equal? (candidate 33 12354) 12354)\n (check-equal? (candidate 5234 5233) -1)\n (check-equal? (candidate 6 29) 28)\n (check-equal? (candidate 27 10) -1)\n (check-equal? (candidate 7 7) -1)\n (check-equal? (candidate 546 546) 546)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a string representing a sentence,\n;; the sentence contains some words separated by a space,\n;; and you have to return a string that contains the words from the original sentence,\n;; whose lengths are prime numbers,\n;; the order of the words in the new string should be the same as the original one.\n;; Example 1:\n;; Input: sentence = \"This is a test\"\n;; Output: \"is\"\n;; Example 2:\n;; Input: sentence = \"lets go for swimming\"\n;; Output: \"go for\"\n;; Constraints:\n;; * 1 <= len(sentence) <= 100\n;; * sentence contains only letters\n(define (words_in_sentence sentence)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate words_in_sentence))\n (check-equal? (candidate \"This is a test\") \"is\")\n (check-equal? (candidate \"lets go for swimming\") \"go for\")\n (check-equal? (candidate \"there is no place available here\") \"there is no place\")\n (check-equal? (candidate \"Hi I am Hussein\") \"Hi am Hussein\")\n (check-equal? (candidate \"go for it\") \"go for it\")\n (check-equal? (candidate \"here\") \"\")\n (check-equal? (candidate \"here is\") \"is\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "rkt", - "prompt": "#lang racket\n\n;; Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n;; >>> intersperse([], 4)\n;; []\n;; >>> intersperse([1, 2, 3], 4)\n;; [1, 4, 2, 4, 3]\n(define (intersperse numbers delimeter)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate intersperse))\n (check-equal? (candidate (list ) 7) (list ))\n (check-equal? (candidate (list 5 6 3 2) 8) (list 5 8 6 8 3 8 2))\n (check-equal? (candidate (list 2 2 2) 2) (list 2 2 2 2 2))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "rkt", - "prompt": "#lang racket\n\n;; Your task is to write a function that returns true if a number x is a simple\n;; power of n and false in other cases.\n;; x is a simple power of n if n**int=x\n;; For example:\n;; is_simple_power(1, 4) => true\n;; is_simple_power(2, 2) => true\n;; is_simple_power(8, 2) => true\n;; is_simple_power(3, 2) => false\n;; is_simple_power(3, 1) => false\n;; is_simple_power(5, 3) => false\n(define (is_simple_power x n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_simple_power))\n (check-equal? (candidate 16 2) #t)\n (check-equal? (candidate 143214 16) #f)\n (check-equal? (candidate 4 2) #t)\n (check-equal? (candidate 9 3) #t)\n (check-equal? (candidate 16 4) #t)\n (check-equal? (candidate 24 2) #f)\n (check-equal? (candidate 128 4) #f)\n (check-equal? (candidate 12 6) #f)\n (check-equal? (candidate 1 1) #t)\n (check-equal? (candidate 1 12) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that returns true if the given number is the multiplication of 3 prime numbers\n;; and false otherwise.\n;; Knowing that (a) is less then 100. \n;; Example:\n;; is_multiply_prime(30) == True\n;; 30 = 2 * 3 * 5\n(define (is_multiply_prime a)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_multiply_prime))\n (check-equal? (candidate 5) #f)\n (check-equal? (candidate 30) #t)\n (check-equal? (candidate 8) #t)\n (check-equal? (candidate 10) #f)\n (check-equal? (candidate 125) #t)\n (check-equal? (candidate 105) #t)\n (check-equal? (candidate 126) #f)\n (check-equal? (candidate 729) #f)\n (check-equal? (candidate 891) #f)\n (check-equal? (candidate 1001) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given the lengths of the three sides of a triangle. Return True if the three\n;; sides form a right-angled triangle, False otherwise.\n;; A right-angled triangle is a triangle in which one angle is right angle or \n;; 90 degree.\n;; Example:\n;; right_angle_triangle(3, 4, 5) == True\n;; right_angle_triangle(1, 2, 3) == False\n(define (right_angle_triangle a b c)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate right_angle_triangle))\n (check-equal? (candidate 3 4 5) #t)\n (check-equal? (candidate 1 2 3) #f)\n (check-equal? (candidate 10 6 8) #t)\n (check-equal? (candidate 2 2 2) #f)\n (check-equal? (candidate 7 24 25) #t)\n (check-equal? (candidate 10 5 7) #f)\n (check-equal? (candidate 5 12 13) #t)\n (check-equal? (candidate 15 8 17) #t)\n (check-equal? (candidate 48 55 73) #t)\n (check-equal? (candidate 1 1 1) #f)\n (check-equal? (candidate 2 2 10) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function that takes 3 numbers.\n;; Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n;; Returns false in any other cases.\n;; Examples\n;; any_int(5, 2, 7) \u279e True\n;; any_int(3, 2, 2) \u279e False\n;; any_int(3, -2, 1) \u279e True\n;; any_int(3.6, -2.2, 2) \u279e False\n(define (any_int x y z)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate any_int))\n (check-equal? (candidate 2 3 1) #t)\n (check-equal? (candidate 2.5 2 3) #f)\n (check-equal? (candidate 1.5 5 3.5) #f)\n (check-equal? (candidate 2 6 2) #f)\n (check-equal? (candidate 4 2 2) #t)\n (check-equal? (candidate 2.2 2.2 2.2) #f)\n (check-equal? (candidate -4 6 2) #t)\n (check-equal? (candidate 2 1 1) #t)\n (check-equal? (candidate 3 4 7) #t)\n (check-equal? (candidate 3.0 4 7) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "rkt", - "prompt": "#lang racket\n\n;; This function takes a list l and returns a list l' such that\n;; l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n;; to the values of the corresponding indicies of l, but sorted.\n;; >>> sort_third([1, 2, 3])\n;; [1, 2, 3]\n;; >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n;; [2, 6, 3, 4, 8, 9, 5]\n(define (sort_third l)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sort_third))\n (check-equal? (candidate (list 5 6 3 4 8 9 2)) (list 2 6 3 4 8 9 5))\n (check-equal? (candidate (list 5 8 3 4 6 9 2)) (list 2 8 3 4 6 9 5))\n (check-equal? (candidate (list 5 6 9 4 8 3 2)) (list 2 6 9 4 8 3 5))\n (check-equal? (candidate (list 5 6 3 4 8 9 2 1)) (list 2 6 3 4 8 9 5 1))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_53_add", - "language": "rkt", - "prompt": "#lang racket\n\n;; Add two numbers x and y\n;; >>> add(2, 3)\n;; 5\n;; >>> add(5, 7)\n;; 12\n(define (add x y)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate add))\n (check-equal? (candidate 0 1) 1)\n (check-equal? (candidate 1 0) 1)\n (check-equal? (candidate 2 3) 5)\n (check-equal? (candidate 5 7) 12)\n (check-equal? (candidate 7 5) 12)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_69_search", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n;; zero, and has a frequency greater than or equal to the value of the integer itself. \n;; The frequency of an integer is the number of times it appears in the list.\n;; If no such a value exist, return -1.\n;; Examples:\n;; search([4, 1, 2, 2, 3, 1]) == 2\n;; search([1, 2, 2, 3, 3, 3, 4, 4, 4]) == 3\n;; search([5, 5, 4, 4, 4]) == -1\n(define (search lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate search))\n (check-equal? (candidate (list 5 5 5 5 1)) 1)\n (check-equal? (candidate (list 4 1 4 1 4 4)) 4)\n (check-equal? (candidate (list 3 3)) -1)\n (check-equal? (candidate (list 8 8 8 8 8 8 8 8)) 8)\n (check-equal? (candidate (list 2 3 3 2 2)) 2)\n (check-equal? (candidate (list 2 7 8 8 4 8 7 3 9 6 5 10 4 3 6 7 1 7 4 10 8 1)) 1)\n (check-equal? (candidate (list 3 2 8 2)) 2)\n (check-equal? (candidate (list 6 7 1 8 8 10 5 8 5 3 10)) 1)\n (check-equal? (candidate (list 8 8 3 6 5 6 4)) -1)\n (check-equal? (candidate (list 6 9 6 7 1 4 7 1 8 8 9 8 10 10 8 4 10 4 10 1 2 9 5 7 9)) 1)\n (check-equal? (candidate (list 1 9 10 1 3)) 1)\n (check-equal? (candidate (list 6 9 7 5 8 7 5 3 7 5 10 10 3 6 10 2 8 6 5 4 9 5 3 10)) 5)\n (check-equal? (candidate (list 1)) 1)\n (check-equal? (candidate (list 8 8 10 6 4 3 5 8 2 4 2 8 4 6 10 4 2 1 10 2 1 1 5)) 4)\n (check-equal? (candidate (list 2 10 4 8 2 10 5 1 2 9 5 5 6 3 8 6 4 10)) 2)\n (check-equal? (candidate (list 1 6 10 1 6 9 10 8 6 8 7 3)) 1)\n (check-equal? (candidate (list 9 2 4 1 5 1 5 2 5 7 7 7 3 10 1 5 4 2 8 4 1 9 10 7 10 2 8 10 9 4)) 4)\n (check-equal? (candidate (list 2 6 4 2 8 7 5 6 4 10 4 6 3 7 8 8 3 1 4 2 2 10 7)) 4)\n (check-equal? (candidate (list 9 8 6 10 2 6 10 2 7 8 10 3 8 2 6 2 3 1)) 2)\n (check-equal? (candidate (list 5 5 3 9 5 6 3 2 8 5 6 10 10 6 8 4 10 7 7 10 8)) -1)\n (check-equal? (candidate (list 10)) -1)\n (check-equal? (candidate (list 9 7 7 2 4 7 2 10 9 7 5 7 2)) 2)\n (check-equal? (candidate (list 5 4 10 2 1 1 10 3 6 1 8)) 1)\n (check-equal? (candidate (list 7 9 9 9 3 4 1 5 9 1 2 1 1 10 7 5 6 7 6 7 7 6)) 1)\n (check-equal? (candidate (list 3 10 10 9 2)) -1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that takes a string and returns True if the string\n;; length is a prime number or False otherwise\n;; Examples\n;; prime_length('Hello') == True\n;; prime_length('abcdcba') == True\n;; prime_length('kittens') == True\n;; prime_length('orange') == False\n(define (prime_length string)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate prime_length))\n (check-equal? (candidate \"Hello\") #t)\n (check-equal? (candidate \"abcdcba\") #t)\n (check-equal? (candidate \"kittens\") #t)\n (check-equal? (candidate \"orange\") #f)\n (check-equal? (candidate \"wow\") #t)\n (check-equal? (candidate \"world\") #t)\n (check-equal? (candidate \"MadaM\") #t)\n (check-equal? (candidate \"Wow\") #t)\n (check-equal? (candidate \"\") #f)\n (check-equal? (candidate \"HI\") #t)\n (check-equal? (candidate \"go\") #t)\n (check-equal? (candidate \"gogo\") #f)\n (check-equal? (candidate \"aaaaaaaaaaaaaaa\") #f)\n (check-equal? (candidate \"Madam\") #t)\n (check-equal? (candidate \"M\") #f)\n (check-equal? (candidate \"0\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_58_common", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return sorted unique common elements for two lists.\n;; >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n;; [1, 5, 653]\n;; >>> common([5, 3, 2, 8], [3, 2])\n;; [2, 3]\n(define (common l1 l2)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate common))\n (check-equal? (candidate (list 1 4 3 34 653 2 5) (list 5 7 1 5 9 653 121)) (list 1 5 653))\n (check-equal? (candidate (list 5 3 2 8) (list 3 2)) (list 2 3))\n (check-equal? (candidate (list 4 3 2 8) (list 3 2 4)) (list 2 3 4))\n (check-equal? (candidate (list 4 3 2 8) (list )) (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "rkt", - "prompt": "#lang racket\n\n;; The Brazilian factorial is defined as:\n;; brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n;; where n > 0\n;; For example:\n;; >>> special_factorial(4)\n;; 288\n;; The function will receive an integer as input and should return the special\n;; factorial of this integer.\n(define (special_factorial n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate special_factorial))\n (check-equal? (candidate 4) 288)\n (check-equal? (candidate 5) 34560)\n (check-equal? (candidate 7) 125411328000)\n (check-equal? (candidate 1) 1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "rkt", - "prompt": "#lang racket\n\n;; In this problem, you will implement a function that takes two lists of numbers,\n;; and determines whether it is possible to perform an exchange of elements\n;; between them to make lst1 a list of only even numbers.\n;; There is no limit on the number of exchanged elements between lst1 and lst2.\n;; If it is possible to exchange elements between the lst1 and lst2 to make\n;; all the elements of lst1 to be even, return \"YES\".\n;; Otherwise, return \"NO\".\n;; For example:\n;; exchange([1, 2, 3, 4], [1, 2, 3, 4]) => \"YES\"\n;; exchange([1, 2, 3, 4], [1, 5, 3, 4]) => \"NO\"\n;; It is assumed that the input lists will be non-empty.\n(define (exchange lst1 lst2)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate exchange))\n (check-equal? (candidate (list 1 2 3 4) (list 1 2 3 4)) \"YES\")\n (check-equal? (candidate (list 1 2 3 4) (list 1 5 3 4)) \"NO\")\n (check-equal? (candidate (list 1 2 3 4) (list 2 1 4 3)) \"YES\")\n (check-equal? (candidate (list 5 7 3) (list 2 6 4)) \"YES\")\n (check-equal? (candidate (list 5 7 3) (list 2 6 3)) \"NO\")\n (check-equal? (candidate (list 3 2 6 1 8 9) (list 3 5 5 1 1 1)) \"NO\")\n (check-equal? (candidate (list 100 200) (list 200 200)) \"YES\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a non-empty array of integers arr and an integer k, return\n;; the sum of the elements with at most two digits from the first k elements of arr.\n;; Example:\n;; Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4\n;; Output: 24 # sum of 21 + 3\n;; Constraints:\n;; 1. 1 <= len(arr) <= 100\n;; 2. 1 <= k <= len(arr)\n(define (add_elements arr k)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate add_elements))\n (check-equal? (candidate (list 1 -2 -3 41 57 76 87 88 99) 3) -4)\n (check-equal? (candidate (list 111 121 3 4000 5 6) 2) 0)\n (check-equal? (candidate (list 11 21 3 90 5 6 7 8 9) 4) 125)\n (check-equal? (candidate (list 111 21 3 4000 5 6 7 8 9) 4) 24)\n (check-equal? (candidate (list 1) 1) 1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "rkt", - "prompt": "#lang racket\n\n;; A simple program which should return the value of x if n is \n;; a prime number and should return the value of y otherwise.\n;; Examples:\n;; for x_or_y(7, 34, 12) == 34\n;; for x_or_y(15, 8, 5) == 5\n(define (x_or_y n x y)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate x_or_y))\n (check-equal? (candidate 7 34 12) 34)\n (check-equal? (candidate 15 8 5) 5)\n (check-equal? (candidate 3 33 5212) 33)\n (check-equal? (candidate 1259 3 52) 3)\n (check-equal? (candidate 7919 -1 12) -1)\n (check-equal? (candidate 3609 1245 583) 583)\n (check-equal? (candidate 91 56 129) 129)\n (check-equal? (candidate 6 34 1234) 1234)\n (check-equal? (candidate 1 2 0) 0)\n (check-equal? (candidate 2 2 0) 2)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given length of a side and high return area for a triangle.\n;; >>> triangle_area(5, 3)\n;; 7.5\n(define (triangle_area a h)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate triangle_area))\n (check-equal? (candidate 5 3) 7.5)\n (check-equal? (candidate 2 2) 2.0)\n (check-equal? (candidate 10 8) 40.0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "rkt", - "prompt": "#lang racket\n\n;; Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n;; the last couple centuries. However, what people don't know is Tribonacci sequence.\n;; Tribonacci sequence is defined by the recurrence:\n;; tri(1) = 3\n;; tri(n) = 1 + n / 2, if n is even.\n;; tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n;; For example:\n;; tri(2) = 1 + (2 / 2) = 2\n;; tri(4) = 3\n;; tri(3) = tri(2) + tri(1) + tri(4)\n;; = 2 + 3 + 3 = 8 \n;; You are given a non-negative integer number n, you have to a return a list of the \n;; first n + 1 numbers of the Tribonacci sequence.\n;; Examples:\n;; tri(3) = [1, 3, 2, 8]\n(define (tri n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate tri))\n (check-equal? (candidate 3) (list 1 3 2 8))\n (check-equal? (candidate 4) (list 1 3 2 8 3))\n (check-equal? (candidate 5) (list 1 3 2 8 3 15))\n (check-equal? (candidate 6) (list 1 3 2 8 3 15 4))\n (check-equal? (candidate 7) (list 1 3 2 8 3 15 4 24))\n (check-equal? (candidate 8) (list 1 3 2 8 3 15 4 24 5))\n (check-equal? (candidate 9) (list 1 3 2 8 3 15 4 24 5 35))\n (check-equal? (candidate 20) (list 1 3 2 8 3 15 4 24 5 35 6 48 7 63 8 80 9 99 10 120 11))\n (check-equal? (candidate 0) (list 1))\n (check-equal? (candidate 1) (list 1 3))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a list of two strings, both strings consist of open\n;; parentheses '(' or close parentheses ')' only.\n;; Your job is to check if it is possible to concatenate the two strings in\n;; some order, that the resulting string will be good.\n;; A string S is considered to be good if and only if all parentheses in S\n;; are balanced. For example: the string '(())()' is good, while the string\n;; '())' is not.\n;; Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n;; Examples:\n;; match_parens(['()(', ')']) == 'Yes'\n;; match_parens([')', ')']) == 'No'\n(define (match_parens lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate match_parens))\n (check-equal? (candidate (list \"()(\" \")\")) \"Yes\")\n (check-equal? (candidate (list \")\" \")\")) \"No\")\n (check-equal? (candidate (list \"(()(())\" \"())())\")) \"No\")\n (check-equal? (candidate (list \")())\" \"(()()(\")) \"Yes\")\n (check-equal? (candidate (list \"(())))\" \"(()())((\")) \"Yes\")\n (check-equal? (candidate (list \"()\" \"())\")) \"No\")\n (check-equal? (candidate (list \"(()(\" \"()))()\")) \"Yes\")\n (check-equal? (candidate (list \"((((\" \"((())\")) \"No\")\n (check-equal? (candidate (list \")(()\" \"(()(\")) \"No\")\n (check-equal? (candidate (list \")(\" \")(\")) \"No\")\n (check-equal? (candidate (list \"(\" \")\")) \"Yes\")\n (check-equal? (candidate (list \")\" \"(\")) \"Yes\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "rkt", - "prompt": "#lang racket\n\n;; From a list of integers, remove all elements that occur more than once.\n;; Keep order of elements left the same as in the input.\n;; >>> remove_duplicates([1, 2, 3, 2, 4])\n;; [1, 3, 4]\n(define (remove_duplicates numbers)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate remove_duplicates))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 1 2 3 4)) (list 1 2 3 4))\n (check-equal? (candidate (list 1 2 3 2 4 3 5)) (list 1 4 5))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return a greatest common divisor of two integers a and b\n;; >>> greatest_common_divisor(3, 5)\n;; 1\n;; >>> greatest_common_divisor(25, 15)\n;; 5\n(define (greatest_common_divisor a b)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate greatest_common_divisor))\n (check-equal? (candidate 3 7) 1)\n (check-equal? (candidate 10 15) 5)\n (check-equal? (candidate 49 14) 7)\n (check-equal? (candidate 144 60) 12)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "rkt", - "prompt": "#lang racket\n\n;; Checks if given string is a palindrome\n;; >>> is_palindrome('')\n;; True\n;; >>> is_palindrome('aba')\n;; True\n;; >>> is_palindrome('aaaaa')\n;; True\n;; >>> is_palindrome('zbcd')\n;; False\n(define (is_palindrome text)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_palindrome))\n (check-equal? (candidate \"\") #t)\n (check-equal? (candidate \"aba\") #t)\n (check-equal? (candidate \"aaaaa\") #t)\n (check-equal? (candidate \"zbcd\") #f)\n (check-equal? (candidate \"xywyx\") #t)\n (check-equal? (candidate \"xywyz\") #f)\n (check-equal? (candidate \"xywzx\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "rkt", - "prompt": "#lang racket\n\n;; xs represent coefficients of a polynomial.\n;; xs[0] + xs[1] * x + xs[2] * x^2 + ....\n;; Return derivative of this polynomial in the same form.\n;; >>> derivative([3, 1, 2, 4, 5])\n;; [1, 4, 12, 20]\n;; >>> derivative([1, 2, 3])\n;; [2, 6]\n(define (derivative xs)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate derivative))\n (check-equal? (candidate (list 3 1 2 4 5)) (list 1 4 12 20))\n (check-equal? (candidate (list 1 2 3)) (list 2 6))\n (check-equal? (candidate (list 3 2 1)) (list 2 2))\n (check-equal? (candidate (list 3 2 1 0 4)) (list 2 2 0 16))\n (check-equal? (candidate (list 1)) (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "rkt", - "prompt": "#lang racket\n\n;; In this task, you will be given a string that represents a number of apples and oranges \n;; that are distributed in a basket of fruit this basket contains \n;; apples, oranges, and mango fruits. Given the string that represents the total number of \n;; the oranges and apples and an integer that represent the total number of the fruits \n;; in the basket return the number of the mango fruits in the basket.\n;; for examble:\n;; fruit_distribution(\"5 apples and 6 oranges\", 19) ->19 - 5 - 6 = 8\n;; fruit_distribution(\"0 apples and 1 oranges\",3) -> 3 - 0 - 1 = 2\n;; fruit_distribution(\"2 apples and 3 oranges\", 100) -> 100 - 2 - 3 = 95\n;; fruit_distribution(\"100 apples and 1 oranges\",120) -> 120 - 100 - 1 = 19\n(define (fruit_distribution s n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate fruit_distribution))\n (check-equal? (candidate \"5 apples and 6 oranges\" 19) 8)\n (check-equal? (candidate \"5 apples and 6 oranges\" 21) 10)\n (check-equal? (candidate \"0 apples and 1 oranges\" 3) 2)\n (check-equal? (candidate \"1 apples and 0 oranges\" 3) 2)\n (check-equal? (candidate \"2 apples and 3 oranges\" 100) 95)\n (check-equal? (candidate \"2 apples and 3 oranges\" 5) 0)\n (check-equal? (candidate \"1 apples and 100 oranges\" 120) 19)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that takes an integer a and returns True \n;; if this ingeger is a cube of some integer number.\n;; Note: you may assume the input is always valid.\n;; Examples:\n;; iscube(1) ==> True\n;; iscube(2) ==> False\n;; iscube(-1) ==> True\n;; iscube(64) ==> True\n;; iscube(0) ==> True\n;; iscube(180) ==> False\n(define (iscube a)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate iscube))\n (check-equal? (candidate 1) #t)\n (check-equal? (candidate 2) #f)\n (check-equal? (candidate -1) #t)\n (check-equal? (candidate 64) #t)\n (check-equal? (candidate 180) #f)\n (check-equal? (candidate 1000) #t)\n (check-equal? (candidate 0) #t)\n (check-equal? (candidate 1729) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "rkt", - "prompt": "#lang racket\n\n;; In this Kata, you have to sort an array of non-negative integers according to\n;; number of ones in their binary representation in ascending order.\n;; For similar number of ones, sort based on decimal value.\n;; It must be implemented like this:\n;; >>> sort_array([1, 5, 2, 3, 4]) == [1, 2, 3, 4, 5]\n;; >>> sort_array([-2, -3, -4, -5, -6]) == [-6, -5, -4, -3, -2]\n;; >>> sort_array([1, 0, 2, 3, 4]) [0, 1, 2, 3, 4]\n(define (sort_array arr)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sort_array))\n (check-equal? (candidate (list 1 5 2 3 4)) (list 1 2 4 3 5))\n (check-equal? (candidate (list -2 -3 -4 -5 -6)) (list -4 -2 -6 -5 -3))\n (check-equal? (candidate (list 1 0 2 3 4)) (list 0 1 2 4 3))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 2 5 77 4 5 3 5 7 2 3 4)) (list 2 2 4 4 3 3 5 5 5 7 77))\n (check-equal? (candidate (list 3 6 44 12 32 5)) (list 32 3 5 6 12 44))\n (check-equal? (candidate (list 2 4 8 16 32)) (list 2 4 8 16 32))\n (check-equal? (candidate (list 2 4 8 16 32)) (list 2 4 8 16 32))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a list of strings, where each string consists of only digits, return a list.\n;; Each element i of the output should be \"the number of odd elements in the\n;; string i of the input.\" where all the i's should be replaced by the number\n;; of odd digits in the i'th string of the input.\n;; >>> odd_count(['1234567'])\n;; [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n;; >>> odd_count(['3',\"11111111\"])\n;; [\"the number of odd elements 1n the str1ng 1 of the 1nput.\",\n;; \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\n(define (odd_count lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate odd_count))\n (check-equal? (candidate (list \"1234567\")) (list \"the number of odd elements 4n the str4ng 4 of the 4nput.\"))\n (check-equal? (candidate (list \"3\" \"11111111\")) (list \"the number of odd elements 1n the str1ng 1 of the 1nput.\" \"the number of odd elements 8n the str8ng 8 of the 8nput.\"))\n (check-equal? (candidate (list \"271\" \"137\" \"314\")) (list \"the number of odd elements 2n the str2ng 2 of the 2nput.\" \"the number of odd elements 3n the str3ng 3 of the 3nput.\" \"the number of odd elements 2n the str2ng 2 of the 2nput.\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "rkt", - "prompt": "#lang racket\n\n;; brackets is a string of \"(\" and \")\".\n;; return True if every opening bracket has a corresponding closing bracket.\n;; >>> correct_bracketing(\"(\")\n;; False\n;; >>> correct_bracketing(\"()\")\n;; True\n;; >>> correct_bracketing(\"(()())\")\n;; True\n;; >>> correct_bracketing(\")(()\")\n;; False\n(define (correct_bracketing brackets)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate correct_bracketing))\n (check-equal? (candidate \"()\") #t)\n (check-equal? (candidate \"(()())\") #t)\n (check-equal? (candidate \"()()(()())()\") #t)\n (check-equal? (candidate \"()()((()()())())(()()(()))\") #t)\n (check-equal? (candidate \"((()())))\") #f)\n (check-equal? (candidate \")(()\") #f)\n (check-equal? (candidate \"(\") #f)\n (check-equal? (candidate \"((((\") #f)\n (check-equal? (candidate \")\") #f)\n (check-equal? (candidate \"(()\") #f)\n (check-equal? (candidate \"()()(()())())(()\") #f)\n (check-equal? (candidate \"()()(()())()))()\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "rkt", - "prompt": "#lang racket\n\n;; Task\n;; Write a function that takes a string as input and returns the sum of the upper characters only'\n;; ASCII codes.\n;; Examples:\n;; digitSum(\"\") => 0\n;; digitSum(\"abAB\") => 131\n;; digitSum(\"abcCd\") => 67\n;; digitSum(\"helloE\") => 69\n;; digitSum(\"woArBld\") => 131\n;; digitSum(\"aAaaaXa\") => 153\n(define (digitSum s)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate digitSum))\n (check-equal? (candidate \"\") 0)\n (check-equal? (candidate \"abAB\") 131)\n (check-equal? (candidate \"abcCd\") 67)\n (check-equal? (candidate \"helloE\") 69)\n (check-equal? (candidate \"woArBld\") 131)\n (check-equal? (candidate \"aAaaaXa\") 153)\n (check-equal? (candidate \" How are yOu?\") 151)\n (check-equal? (candidate \"You arE Very Smart\") 327)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that accepts a list of strings as a parameter,\n;; deletes the strings that have odd lengths from it,\n;; and returns the resulted list with a sorted order,\n;; The list is always a list of strings and never an array of numbers,\n;; and it may contain duplicates.\n;; The order of the list should be ascending by length of each word, and you\n;; should return the list sorted by that rule.\n;; If two words have the same length, sort the list alphabetically.\n;; The function should return a list of strings in sorted order.\n;; You may assume that all words will have the same length.\n;; For example:\n;; assert list_sort([\"aa\", \"a\", \"aaa\"]) => [\"aa\"]\n;; assert list_sort([\"ab\", \"a\", \"aaa\", \"cd\"]) => [\"ab\", \"cd\"]\n(define (sorted_list_sum lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sorted_list_sum))\n (check-equal? (candidate (list \"aa\" \"a\" \"aaa\")) (list \"aa\"))\n (check-equal? (candidate (list \"school\" \"AI\" \"asdf\" \"b\")) (list \"AI\" \"asdf\" \"school\"))\n (check-equal? (candidate (list \"d\" \"b\" \"c\" \"a\")) (list ))\n (check-equal? (candidate (list \"d\" \"dcba\" \"abcd\" \"a\")) (list \"abcd\" \"dcba\"))\n (check-equal? (candidate (list \"AI\" \"ai\" \"au\")) (list \"AI\" \"ai\" \"au\"))\n (check-equal? (candidate (list \"a\" \"b\" \"b\" \"c\" \"c\" \"a\")) (list ))\n (check-equal? (candidate (list \"aaaa\" \"bbbb\" \"dd\" \"cc\")) (list \"cc\" \"dd\" \"aaaa\" \"bbbb\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given an array arr of integers and you need to return\n;; sum of magnitudes of integers multiplied by product of all signs\n;; of each number in the array, represented by 1, -1 or 0.\n;; Note: return None for empty arr.\n;; Example:\n;; >>> prod_signs([1, 2, 2, -4]) == -9\n;; >>> prod_signs([0, 1]) == 0\n;; >>> prod_signs([]) == None\n(define (prod_signs arr)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate prod_signs))\n (check-equal? (candidate (list 1 2 2 -4)) -9)\n (check-equal? (candidate (list 0 1)) 0)\n (check-equal? (candidate (list 1 1 1 2 3 -1 1)) -10)\n (check-equal? (candidate (list )) #f)\n (check-equal? (candidate (list 2 4 1 2 -1 -1 9)) 20)\n (check-equal? (candidate (list -1 1 -1 1)) 4)\n (check-equal? (candidate (list -1 1 1 1)) -4)\n (check-equal? (candidate (list -1 1 1 0)) 0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return list with elements incremented by 1.\n;; >>> incr_list([1, 2, 3])\n;; [2, 3, 4]\n;; >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123])\n;; [6, 4, 6, 3, 4, 4, 10, 1, 124]\n(define (incr_list l)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate incr_list))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 3 2 1)) (list 4 3 2))\n (check-equal? (candidate (list 5 2 5 2 3 3 9 0 123)) (list 6 3 6 3 4 4 10 1 124))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "rkt", - "prompt": "#lang racket\n\n;; From a given list of integers, generate a list of rolling maximum element found until given moment\n;; in the sequence.\n;; >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n;; [1, 2, 3, 3, 3, 4, 4]\n(define (rolling_max numbers)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate rolling_max))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 1 2 3 4)) (list 1 2 3 4))\n (check-equal? (candidate (list 4 3 2 1)) (list 4 4 4 4))\n (check-equal? (candidate (list 3 2 3 100 3)) (list 3 3 3 100 100))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "rkt", - "prompt": "#lang racket\n\n;; Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n;; separate those group into separate strings and return the list of those.\n;; Separate groups are balanced (each open brace is properly closed) and not nested within each other\n;; Ignore any spaces in the input string.\n;; >>> separate_paren_groups('( ) (( )) (( )( ))')\n;; ['()', '(())', '(()())']\n(define (separate_paren_groups paren_string)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate separate_paren_groups))\n (check-equal? (candidate \"(()()) ((())) () ((())()())\") (list \"(()())\" \"((()))\" \"()\" \"((())()())\"))\n (check-equal? (candidate \"() (()) ((())) (((())))\") (list \"()\" \"(())\" \"((()))\" \"(((())))\"))\n (check-equal? (candidate \"(()(())((())))\") (list \"(()(())((())))\"))\n (check-equal? (candidate \"( ) (( )) (( )( ))\") (list \"()\" \"(())\" \"(()())\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "rkt", - "prompt": "#lang racket\n\n;; You will be given a string of words separated by commas or spaces. Your task is\n;; to split the string into words and return an array of the words.\n;; For example:\n;; words_string(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n;; words_string(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\n(define (words_string s)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate words_string))\n (check-equal? (candidate \"Hi, my name is John\") (list \"Hi\" \"my\" \"name\" \"is\" \"John\"))\n (check-equal? (candidate \"One, two, three, four, five, six\") (list \"One\" \"two\" \"three\" \"four\" \"five\" \"six\"))\n (check-equal? (candidate \"Hi, my name\") (list \"Hi\" \"my\" \"name\"))\n (check-equal? (candidate \"One,, two, three, four, five, six,\") (list \"One\" \"two\" \"three\" \"four\" \"five\" \"six\"))\n (check-equal? (candidate \"\") (list ))\n (check-equal? (candidate \"ahmed , gamal\") (list \"ahmed\" \"gamal\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function that takes integers, floats, or strings representing\n;; real numbers, and returns the larger variable in its given variable type.\n;; Return None if the values are equal.\n;; Note: If a real number is represented as a string, the floating point might be . or ,\n;; compare_one(1, 2.5) \u279e 2.5\n;; compare_one(1, \"2,3\") \u279e \"2,3\"\n;; compare_one(\"5,1\", \"6\") \u279e \"6\"\n;; compare_one(\"1\", 1) \u279e None\n(define (compare_one a b)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_137_compare_one.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate compare_one))\n (check-equal? (candidate 1 2) 2)\n (check-equal? (candidate 1 2.5) 2.5)\n (check-equal? (candidate 2 3) 3)\n (check-equal? (candidate 5 6) 6)\n (check-equal? (candidate 1 \"2,3\") \"2,3\")\n (check-equal? (candidate \"5,1\" \"6\") \"6\")\n (check-equal? (candidate \"1\" \"2\") \"2\")\n (check-equal? (candidate \"1\" 1) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "rkt", - "prompt": "#lang racket\n\n;; Filter given list of any python values only for integers\n;; >>> filter_integers(['a', 3.14, 5])\n;; [5]\n;; >>> filter_integers([1, 2, 3, 'abc', {}, []])\n;; [1, 2, 3]\n(define (filter_integers values)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate filter_integers))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 4 #hash() (list ) 23.2 9 \"adasd\")) (list 4 9))\n (check-equal? (candidate (list 3 \"c\" 3 3 \"a\" \"b\")) (list 3 3 3))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "rkt", - "prompt": "#lang racket\n\n;; This function takes a list l and returns a list l' such that\n;; l' is identical to l in the odd indicies, while its values at the even indicies are equal\n;; to the values of the even indicies of l, but sorted.\n;; >>> sort_even([1, 2, 3])\n;; [1, 2, 3]\n;; >>> sort_even([5, 6, 3, 4])\n;; [3, 6, 5, 4]\n(define (sort_even l)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sort_even))\n (check-equal? (candidate (list 1 2 3)) (list 1 2 3))\n (check-equal? (candidate (list 5 3 -5 2 -3 3 9 0 123 1 -10)) (list -10 3 -5 2 -3 3 5 0 9 1 123))\n (check-equal? (candidate (list 5 8 -12 4 23 2 3 11 12 -10)) (list -12 8 3 4 5 2 12 11 23 -10))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "rkt", - "prompt": "#lang racket\n\n;; I think we all remember that feeling when the result of some long-awaited\n;; event is finally known. The feelings and thoughts you have at that moment are\n;; definitely worth noting down and comparing.\n;; Your task is to determine if a person correctly guessed the results of a number of matches.\n;; You are given two arrays of scores and guesses of equal length, where each index shows a match. \n;; Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n;; the value is 0, and if not, the value is the absolute difference between the guess and the score.\n;; example:\n;; compare([1,2,3,4,5,1],[1,2,3,4,2,-2]) -> [0,0,0,0,3,3]\n;; compare([0,5,0,0,0,4],[4,1,1,0,0,-2]) -> [4,4,1,0,0,6]\n(define (compare game guess)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate compare))\n (check-equal? (candidate (list 1 2 3 4 5 1) (list 1 2 3 4 2 -2)) (list 0 0 0 0 3 3))\n (check-equal? (candidate (list 0 0 0 0 0 0) (list 0 0 0 0 0 0)) (list 0 0 0 0 0 0))\n (check-equal? (candidate (list 1 2 3) (list -1 -2 -3)) (list 2 4 6))\n (check-equal? (candidate (list 1 2 3 5) (list -1 2 3 4)) (list 2 0 0 1))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a positive integer n, return a tuple that has the number of even and odd\n;; integer palindromes that fall within the range(1, n), inclusive.\n;; Example 1:\n;; Input: 3\n;; Output: (1, 2)\n;; Explanation:\n;; Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n;; Example 2:\n;; Input: 12\n;; Output: (4, 6)\n;; Explanation:\n;; Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n;; Note:\n;; 1. 1 <= n <= 10^3\n;; 2. returned tuple has the number of even and odd integer palindromes respectively.\n(define (even_odd_palindrome n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate even_odd_palindrome))\n (check-equal? (candidate 123) (list 8 13))\n (check-equal? (candidate 12) (list 4 6))\n (check-equal? (candidate 3) (list 1 2))\n (check-equal? (candidate 63) (list 6 8))\n (check-equal? (candidate 25) (list 5 6))\n (check-equal? (candidate 19) (list 4 6))\n (check-equal? (candidate 9) (list 4 5))\n (check-equal? (candidate 1) (list 0 1))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "rkt", - "prompt": "#lang racket\n\n;; The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n;; fib4(0) -> 0\n;; fib4(1) -> 0\n;; fib4(2) -> 2\n;; fib4(3) -> 0\n;; fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n;; Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n;; >>> fib4(5)\n;; 4\n;; >>> fib4(6)\n;; 8\n;; >>> fib4(7)\n;; 14\n(define (fib4 n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate fib4))\n (check-equal? (candidate 5) 4)\n (check-equal? (candidate 8) 28)\n (check-equal? (candidate 10) 104)\n (check-equal? (candidate 12) 386)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given two positive integers a and b, return the even digits between a\n;; and b, in ascending order.\n;; For example:\n;; generate_integers(2, 8) => [2, 4, 6, 8]\n;; generate_integers(8, 2) => [2, 4, 6, 8]\n;; generate_integers(10, 14) => []\n(define (generate_integers a b)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate generate_integers))\n (check-equal? (candidate 2 10) (list 2 4 6 8))\n (check-equal? (candidate 10 2) (list 2 4 6 8))\n (check-equal? (candidate 132 2) (list 2 4 6 8))\n (check-equal? (candidate 17 89) (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "rkt", - "prompt": "#lang racket\n\n;; For a given list of input numbers, calculate Mean Absolute Deviation\n;; around the mean of this dataset.\n;; Mean Absolute Deviation is the average absolute difference between each\n;; element and a centerpoint (mean in this case):\n;; MAD = average | x - x_mean |\n;; >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n;; 1.0\n(define (mean_absolute_deviation numbers)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate mean_absolute_deviation))\n (check-equal? (candidate (list 1.0 2.0)) 0.5)\n (check-equal? (candidate (list 1.0 2.0 3.0 4.0)) 1.0)\n (check-equal? (candidate (list 1.0 2.0 3.0 4.0 5.0)) 1.2)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function encrypt that takes a string as an argument and\n;; returns a string encrypted with the alphabet being rotated. \n;; The alphabet should be rotated in a manner such that the letters \n;; shift down by two multiplied to two places.\n;; For example:\n;; encrypt('hi') returns 'lm'\n;; encrypt('asdfghjkl') returns 'ewhjklnop'\n;; encrypt('gf') returns 'kj'\n;; encrypt('et') returns 'ix'\n(define (encrypt s)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate encrypt))\n (check-equal? (candidate \"hi\") \"lm\")\n (check-equal? (candidate \"asdfghjkl\") \"ewhjklnop\")\n (check-equal? (candidate \"gf\") \"kj\")\n (check-equal? (candidate \"et\") \"ix\")\n (check-equal? (candidate \"faewfawefaewg\") \"jeiajeaijeiak\")\n (check-equal? (candidate \"hellomyfriend\") \"lippsqcjvmirh\")\n (check-equal? (candidate \"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\") \"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\")\n (check-equal? (candidate \"a\") \"e\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n;; The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n;; as follows: start with any positive integer n. Then each term is obtained from the \n;; previous term as follows: if the previous term is even, the next term is one half of \n;; the previous term. If the previous term is odd, the next term is 3 times the previous\n;; term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n;; Note: \n;; 1. Collatz(1) is [1].\n;; 2. returned list sorted in increasing order.\n;; For example:\n;; get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n(define (get_odd_collatz n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate get_odd_collatz))\n (check-equal? (candidate 14) (list 1 5 7 11 13 17))\n (check-equal? (candidate 5) (list 1 5))\n (check-equal? (candidate 12) (list 1 3 5))\n (check-equal? (candidate 1) (list 1))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "rkt", - "prompt": "#lang racket\n\n;; Find how many times a given substring can be found in the original string. Count overlaping cases.\n;; >>> how_many_times('', 'a')\n;; 0\n;; >>> how_many_times('aaa', 'a')\n;; 3\n;; >>> how_many_times('aaaa', 'aa')\n;; 3\n(define (how_many_times string substring)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate how_many_times))\n (check-equal? (candidate \"\" \"x\") 0)\n (check-equal? (candidate \"xyxyxyx\" \"x\") 4)\n (check-equal? (candidate \"cacacacac\" \"cac\") 4)\n (check-equal? (candidate \"john doe\" \"john\") 1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "rkt", - "prompt": "#lang racket\n\n;; We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n;; numbers in the array will be randomly ordered. Your task is to determine if\n;; it is possible to get an array sorted in non-decreasing order by performing \n;; the following operation on the given array:\n;; You are allowed to perform right shift operation any number of times.\n;; One right shift operation means shifting all elements of the array by one\n;; position in the right direction. The last element of the array will be moved to\n;; the starting position in the array i.e. 0th index. \n;; If it is possible to obtain the sorted array by performing the above operation\n;; then return True else return False.\n;; If the given array is empty then return True.\n;; Note: The given list is guaranteed to have unique elements.\n;; For Example:\n;; move_one_ball([3, 4, 5, 1, 2])==>True\n;; Explanation: By performin 2 right shift operations, non-decreasing order can\n;; be achieved for the given array.\n;; move_one_ball([3, 5, 4, 1, 2])==>False\n;; Explanation:It is not possible to get non-decreasing order for the given\n;; array by performing any number of right shift operations.\n(define (move_one_ball arr)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate move_one_ball))\n (check-equal? (candidate (list 3 4 5 1 2)) #t)\n (check-equal? (candidate (list 3 5 10 1 2)) #t)\n (check-equal? (candidate (list 4 3 1 2)) #f)\n (check-equal? (candidate (list 3 5 4 1 2)) #f)\n (check-equal? (candidate (list )) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function which sorts the given list of integers\n;; in ascending order according to the sum of their digits.\n;; Note: if there are several items with similar sum of their digits,\n;; order them based on their index in original list.\n;; For example:\n;; >>> order_by_points([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]\n;; >>> order_by_points([]) == []\n(define (order_by_points nums)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate order_by_points))\n (check-equal? (candidate (list 1 11 -1 -11 -12)) (list -1 -11 1 -12 11))\n (check-equal? (candidate (list 1234 423 463 145 2 423 423 53 6 37 3457 3 56 0 46)) (list 0 2 3 6 53 423 423 423 1234 145 37 46 56 463 3457))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 1 -11 -32 43 54 -98 2 -3)) (list -3 -32 -98 -11 1 2 43 54))\n (check-equal? (candidate (list 1 2 3 4 5 6 7 8 9 10 11)) (list 1 10 2 11 3 4 5 6 7 8 9))\n (check-equal? (candidate (list 0 6 6 -76 -21 23 4)) (list -76 -21 0 4 23 6 6))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return list of prime factors of given integer in the order from smallest to largest.\n;; Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n;; Input number should be equal to the product of all factors\n;; >>> factorize(8)\n;; [2, 2, 2]\n;; >>> factorize(25)\n;; [5, 5]\n;; >>> factorize(70)\n;; [2, 5, 7]\n(define (factorize n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate factorize))\n (check-equal? (candidate 2) (list 2))\n (check-equal? (candidate 4) (list 2 2))\n (check-equal? (candidate 8) (list 2 2 2))\n (check-equal? (candidate 57) (list 3 19))\n (check-equal? (candidate 3249) (list 3 3 19 19))\n (check-equal? (candidate 185193) (list 3 3 3 19 19 19))\n (check-equal? (candidate 20577) (list 3 19 19 19))\n (check-equal? (candidate 18) (list 2 3 3))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return True if all numbers in the list l are below threshold t.\n;; >>> below_threshold([1, 2, 4, 10], 100)\n;; True\n;; >>> below_threshold([1, 20, 4, 10], 5)\n;; False\n(define (below_threshold l t)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate below_threshold))\n (check-equal? (candidate (list 1 2 4 10) 100) #t)\n (check-equal? (candidate (list 1 20 4 10) 5) #f)\n (check-equal? (candidate (list 1 20 4 10) 21) #t)\n (check-equal? (candidate (list 1 20 4 10) 22) #t)\n (check-equal? (candidate (list 1 8 4 10) 11) #t)\n (check-equal? (candidate (list 1 8 4 10) 10) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given two positive integers n and m, and your task is to compute the\n;; average of the integers from n through m (including n and m). \n;; Round the answer to the nearest integer and convert that to binary.\n;; If n is greater than m, return -1.\n;; Example:\n;; rounded_avg(1, 5) => \"0b11\"\n;; rounded_avg(7, 5) => -1\n;; rounded_avg(10, 20) => \"0b1111\"\n;; rounded_avg(20, 33) => \"0b11010\"\n(define (rounded_avg n m)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate rounded_avg))\n (check-equal? (candidate 1 5) \"0b11\")\n (check-equal? (candidate 7 13) \"0b1010\")\n (check-equal? (candidate 964 977) \"0b1111001010\")\n (check-equal? (candidate 996 997) \"0b1111100100\")\n (check-equal? (candidate 560 851) \"0b1011000010\")\n (check-equal? (candidate 185 546) \"0b101101110\")\n (check-equal? (candidate 362 496) \"0b110101101\")\n (check-equal? (candidate 350 902) \"0b1001110010\")\n (check-equal? (candidate 197 233) \"0b11010111\")\n (check-equal? (candidate 7 5) -1)\n (check-equal? (candidate 5 1) -1)\n (check-equal? (candidate 5 5) \"0b101\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "rkt", - "prompt": "#lang racket\n\n;; Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n;; For each of the group, output the deepest level of nesting of parentheses.\n;; E.g. (()()) has maximum two levels of nesting while ((())) has three.\n;; >>> parse_nested_parens('(()()) ((())) () ((())()())')\n;; [2, 3, 1, 3]\n(define (parse_nested_parens paren_string)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate parse_nested_parens))\n (check-equal? (candidate \"(()()) ((())) () ((())()())\") (list 2 3 1 3))\n (check-equal? (candidate \"() (()) ((())) (((())))\") (list 1 2 3 4))\n (check-equal? (candidate \"(()(())((())))\") (list 4))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n;; Examples\n;; solution([5, 8, 7, 1]) ==> 12\n;; solution([3, 3, 3, 3, 3]) ==> 9\n;; solution([30, 13, 24, 321]) ==>0\n(define (solution lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate solution))\n (check-equal? (candidate (list 5 8 7 1)) 12)\n (check-equal? (candidate (list 3 3 3 3 3)) 9)\n (check-equal? (candidate (list 30 13 24 321)) 0)\n (check-equal? (candidate (list 5 9)) 5)\n (check-equal? (candidate (list 2 4 8)) 0)\n (check-equal? (candidate (list 30 13 23 32)) 23)\n (check-equal? (candidate (list 3 13 2 9)) 3)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a positive integer n. You have to create an integer array a of length n.\n;; For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n;; Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n;; and a[i] + a[j] + a[k] is a multiple of 3.\n;; Example :\n;; Input: n = 5\n;; Output: 1\n;; Explanation: \n;; a = [1, 3, 7, 13, 21]\n;; The only valid triple is (1, 7, 13).\n(define (get_max_triples n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate get_max_triples))\n (check-equal? (candidate 5) 1)\n (check-equal? (candidate 6) 4)\n (check-equal? (candidate 10) 36)\n (check-equal? (candidate 100) 53361)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "rkt", - "prompt": "#lang racket\n\n;; There are eight planets in our solar system: the closerst to the Sun \n;; is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n;; Uranus, Neptune.\n;; Write a function that takes two planet names as strings planet1 and planet2. \n;; The function should return a tuple containing all planets whose orbits are \n;; located between the orbit of planet1 and the orbit of planet2, sorted by \n;; the proximity to the sun. \n;; The function should return an empty tuple if planet1 or planet2\n;; are not correct planet names. \n;; Examples\n;; bf(\"Jupiter\", \"Neptune\") ==> (\"Saturn\", \"Uranus\")\n;; bf(\"Earth\", \"Mercury\") ==> (\"Venus\")\n;; bf(\"Mercury\", \"Uranus\") ==> (\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\")\n(define (bf planet1 planet2)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate bf))\n (check-equal? (candidate \"Jupiter\" \"Neptune\") (list \"Saturn\" \"Uranus\"))\n (check-equal? (candidate \"Earth\" \"Mercury\") (list \"Venus\"))\n (check-equal? (candidate \"Mercury\" \"Uranus\") (list \"Venus\" \"Earth\" \"Mars\" \"Jupiter\" \"Saturn\"))\n (check-equal? (candidate \"Neptune\" \"Venus\") (list \"Earth\" \"Mars\" \"Jupiter\" \"Saturn\" \"Uranus\"))\n (check-equal? (candidate \"Earth\" \"Earth\") (list ))\n (check-equal? (candidate \"Mars\" \"Earth\") (list ))\n (check-equal? (candidate \"Jupiter\" \"Makemake\") (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a list of integers.\n;; Write a function next_smallest() that returns the 2nd smallest element of the list.\n;; Return None if there is no such element.\n;; next_smallest([1, 2, 3, 4, 5]) == 2\n;; next_smallest([5, 1, 4, 3, 2]) == 2\n;; next_smallest([]) == None\n;; next_smallest([1, 1]) == None\n(define (next_smallest lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate next_smallest))\n (check-equal? (candidate (list 1 2 3 4 5)) 2)\n (check-equal? (candidate (list 5 1 4 3 2)) 2)\n (check-equal? (candidate (list )) #f)\n (check-equal? (candidate (list 1 1)) #f)\n (check-equal? (candidate (list 1 1 1 1 0)) 1)\n (check-equal? (candidate (list 1 1)) #f)\n (check-equal? (candidate (list -35 34 12 -45)) -35)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "rkt", - "prompt": "#lang racket\n\n;; Input is a space-delimited string of numberals from 'zero' to 'nine'.\n;; Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n;; Return the string with numbers sorted from smallest to largest\n;; >>> sort_numbers('three one five')\n;; 'one three five'\n(define (sort_numbers numbers)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sort_numbers))\n (check-equal? (candidate \"\") \"\")\n (check-equal? (candidate \"three\") \"three\")\n (check-equal? (candidate \"three five nine\") \"three five nine\")\n (check-equal? (candidate \"five zero four seven nine eight\") \"zero four five seven eight nine\")\n (check-equal? (candidate \"six five four three two one zero\") \"zero one two three four five six\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n;; cycpattern_check(\"abcd\",\"abd\") => False\n;; cycpattern_check(\"hello\",\"ell\") => True\n;; cycpattern_check(\"whassup\",\"psus\") => False\n;; cycpattern_check(\"abab\",\"baa\") => True\n;; cycpattern_check(\"efef\",\"eeff\") => False\n;; cycpattern_check(\"himenss\",\"simen\") => True\n(define (cycpattern_check a b)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate cycpattern_check))\n (check-equal? (candidate \"xyzw\" \"xyw\") #f)\n (check-equal? (candidate \"yello\" \"ell\") #t)\n (check-equal? (candidate \"whattup\" \"ptut\") #f)\n (check-equal? (candidate \"efef\" \"fee\") #t)\n (check-equal? (candidate \"abab\" \"aabb\") #f)\n (check-equal? (candidate \"winemtt\" \"tinem\") #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "rkt", - "prompt": "#lang racket\n\n;; You will be given a number in decimal form and your task is to convert it to\n;; binary format. The function should return a string, with each character representing a binary\n;; number. Each character in the string will be '0' or '1'.\n;; There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n;; The extra characters are there to help with the format.\n;; Examples:\n;; decimal_to_binary(15) # returns \"db1111db\"\n;; decimal_to_binary(32) # returns \"db100000db\"\n(define (decimal_to_binary decimal)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate decimal_to_binary))\n (check-equal? (candidate 0) \"db0db\")\n (check-equal? (candidate 32) \"db100000db\")\n (check-equal? (candidate 103) \"db1100111db\")\n (check-equal? (candidate 15) \"db1111db\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "rkt", - "prompt": "#lang racket\n\n;; Filter an input list of strings only for ones that contain given substring\n;; >>> filter_by_substring([], 'a')\n;; []\n;; >>> filter_by_substring(['abc', 'bacd', 'cde', 'array'], 'a')\n;; ['abc', 'bacd', 'array']\n(define (filter_by_substring strings substring)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate filter_by_substring))\n (check-equal? (candidate (list ) \"john\") (list ))\n (check-equal? (candidate (list \"xxx\" \"asd\" \"xxy\" \"john doe\" \"xxxAAA\" \"xxx\") \"xxx\") (list \"xxx\" \"xxxAAA\" \"xxx\"))\n (check-equal? (candidate (list \"xxx\" \"asd\" \"aaaxxy\" \"john doe\" \"xxxAAA\" \"xxx\") \"xx\") (list \"xxx\" \"aaaxxy\" \"xxxAAA\" \"xxx\"))\n (check-equal? (candidate (list \"grunt\" \"trumpet\" \"prune\" \"gruesome\") \"run\") (list \"grunt\" \"prune\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given an integer. return a tuple that has the number of even and odd digits respectively.\n;; Example:\n;; even_odd_count(-12) ==> (1, 1)\n;; even_odd_count(123) ==> (1, 2)\n(define (even_odd_count num)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate even_odd_count))\n (check-equal? (candidate 7) (list 0 1))\n (check-equal? (candidate -78) (list 1 1))\n (check-equal? (candidate 3452) (list 2 2))\n (check-equal? (candidate 346211) (list 3 3))\n (check-equal? (candidate -345821) (list 3 3))\n (check-equal? (candidate -2) (list 1 0))\n (check-equal? (candidate -45347) (list 2 3))\n (check-equal? (candidate 0) (list 1 0))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that accepts a list of strings.\n;; The list contains different words. Return the word with maximum number\n;; of unique characters. If multiple strings have maximum number of unique\n;; characters, return the one which comes first in lexicographical order.\n;; find_max([\"name\", \"of\", \"string\"]) == \"string\"\n;; find_max([\"name\", \"enam\", \"game\"]) == \"enam\"\n;; find_max([\"aaaaaaa\", \"bb\" ,\"cc\"]) == \"\"aaaaaaa\"\n(define (find_max words)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate find_max))\n (check-equal? (candidate (list \"name\" \"of\" \"string\")) \"string\")\n (check-equal? (candidate (list \"name\" \"enam\" \"game\")) \"enam\")\n (check-equal? (candidate (list \"aaaaaaa\" \"bb\" \"cc\")) \"aaaaaaa\")\n (check-equal? (candidate (list \"abc\" \"cba\")) \"abc\")\n (check-equal? (candidate (list \"play\" \"this\" \"game\" \"of\" \"footbott\")) \"footbott\")\n (check-equal? (candidate (list \"we\" \"are\" \"gonna\" \"rock\")) \"gonna\")\n (check-equal? (candidate (list \"we\" \"are\" \"a\" \"mad\" \"nation\")) \"nation\")\n (check-equal? (candidate (list \"this\" \"is\" \"a\" \"prrk\")) \"this\")\n (check-equal? (candidate (list \"b\")) \"b\")\n (check-equal? (candidate (list \"play\" \"play\" \"play\")) \"play\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a positive integer n, return the count of the numbers of n-digit\n;; positive integers that start or end with 1.\n(define (starts_one_ends n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate starts_one_ends))\n (check-equal? (candidate 1) 1)\n (check-equal? (candidate 2) 18)\n (check-equal? (candidate 3) 180)\n (check-equal? (candidate 4) 1800)\n (check-equal? (candidate 5) 18000)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function that returns a tuple (a, b), where 'a' is\n;; the largest of negative integers, and 'b' is the smallest\n;; of positive integers in a list.\n;; If there is no negative or positive integers, return them as None.\n;; Examples:\n;; largest_smallest_integers([2, 4, 1, 3, 5, 7]) == (None, 1)\n;; largest_smallest_integers([]) == (None, None)\n;; largest_smallest_integers([0]) == (None, None)\n(define (largest_smallest_integers lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate largest_smallest_integers))\n (check-equal? (candidate (list 2 4 1 3 5 7)) (list #f 1))\n (check-equal? (candidate (list 2 4 1 3 5 7 0)) (list #f 1))\n (check-equal? (candidate (list 1 3 2 4 5 6 -2)) (list -2 1))\n (check-equal? (candidate (list 4 5 3 6 2 7 -7)) (list -7 2))\n (check-equal? (candidate (list 7 3 8 4 9 2 5 -9)) (list -9 2))\n (check-equal? (candidate (list )) (list #f #f))\n (check-equal? (candidate (list 0)) (list #f #f))\n (check-equal? (candidate (list -1 -3 -5 -6)) (list -1 #f))\n (check-equal? (candidate (list -1 -3 -5 -6 0)) (list -1 #f))\n (check-equal? (candidate (list -6 -4 -4 -3 1)) (list -3 1))\n (check-equal? (candidate (list -6 -4 -4 -3 -100 1)) (list -3 1))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "rkt", - "prompt": "#lang racket\n\n;; \"Given an array representing a branch of a tree that has non-negative integer nodes\n;; your task is to pluck one of the nodes and return it.\n;; The plucked node should be the node with the smallest even value.\n;; If multiple nodes with the same smallest even value are found return the node that has smallest index.\n;; The plucked node should be returned in a list, [ smalest_value, its index ],\n;; If there are no even values or the given array is empty, return [].\n;; Example 1:\n;; Input: [4,2,3]\n;; Output: [2, 1]\n;; Explanation: 2 has the smallest even value, and 2 has the smallest index.\n;; Example 2:\n;; Input: [1,2,3]\n;; Output: [2, 1]\n;; Explanation: 2 has the smallest even value, and 2 has the smallest index. \n;; Example 3:\n;; Input: []\n;; Output: []\n;; Example 4:\n;; Input: [5, 0, 3, 0, 4, 2]\n;; Output: [0, 1]\n;; Explanation: 0 is the smallest value, but there are two zeros,\n;; so we will choose the first zero, which has the smallest index.\n;; Constraints:\n;; * 1 <= nodes.length <= 10000\n;; * 0 <= node.value\n(define (pluck arr)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate pluck))\n (check-equal? (candidate (list 4 2 3)) (list 2 1))\n (check-equal? (candidate (list 1 2 3)) (list 2 1))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 5 0 3 0 4 2)) (list 0 1))\n (check-equal? (candidate (list 1 2 3 0 5 3)) (list 0 3))\n (check-equal? (candidate (list 5 4 8 4 8)) (list 4 1))\n (check-equal? (candidate (list 7 6 7 1)) (list 6 1))\n (check-equal? (candidate (list 7 9 7 1)) (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function count_nums which takes an array of integers and returns\n;; the number of elements which has a sum of digits > 0.\n;; If a number is negative, then its first signed digit will be negative:\n;; e.g. -123 has signed digits -1, 2, and 3.\n;; >>> count_nums([]) == 0\n;; >>> count_nums([-1, 11, -11]) == 1\n;; >>> count_nums([1, 1, 2]) == 3\n(define (count_nums arr)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate count_nums))\n (check-equal? (candidate (list )) 0)\n (check-equal? (candidate (list -1 -2 0)) 0)\n (check-equal? (candidate (list 1 1 2 -2 3 4 5)) 6)\n (check-equal? (candidate (list 1 6 9 -6 0 1 5)) 5)\n (check-equal? (candidate (list 1 100 98 -7 1 -1)) 4)\n (check-equal? (candidate (list 12 23 34 -45 -56 0)) 5)\n (check-equal? (candidate (list 0 1)) 1)\n (check-equal? (candidate (list 1)) 1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n;; each cell of the grid contains a value. Every integer in the range [1, N * N]\n;; inclusive appears exactly once on the cells of the grid.\n;; You have to find the minimum path of length k in the grid. You can start\n;; from any cell, and in each step you can move to any of the neighbor cells,\n;; in other words, you can go to cells which share an edge with you current\n;; cell.\n;; Please note that a path of length k means visiting exactly k cells (not\n;; necessarily distinct).\n;; You CANNOT go off the grid.\n;; A path A (of length k) is considered less than a path B (of length k) if\n;; after making the ordered lists of the values on the cells that A and B go\n;; through (let's call them lst_A and lst_B), lst_A is lexicographically less\n;; than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n;; such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n;; lst_A[j] = lst_B[j].\n;; It is guaranteed that the answer is unique.\n;; Return an ordered list of the values on the cells that the minimum path go through.\n;; Examples:\n;; Input: grid = [ [1,2,3], [4,5,6], [7,8,9]], k = 3\n;; Output: [1, 2, 1]\n;; Input: grid = [ [5,9,3], [4,1,6], [7,8,2]], k = 1\n;; Output: [1]\n(define (minPath grid k)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate minPath))\n (check-equal? (candidate (list (list 1 2 3) (list 4 5 6) (list 7 8 9)) 3) (list 1 2 1))\n (check-equal? (candidate (list (list 5 9 3) (list 4 1 6) (list 7 8 2)) 1) (list 1))\n (check-equal? (candidate (list (list 1 2 3 4) (list 5 6 7 8) (list 9 10 11 12) (list 13 14 15 16)) 4) (list 1 2 1 2))\n (check-equal? (candidate (list (list 6 4 13 10) (list 5 7 12 1) (list 3 16 11 15) (list 8 14 9 2)) 7) (list 1 10 1 10 1 10 1))\n (check-equal? (candidate (list (list 8 14 9 2) (list 6 4 13 15) (list 5 7 1 12) (list 3 10 11 16)) 5) (list 1 7 1 7 1))\n (check-equal? (candidate (list (list 11 8 7 2) (list 5 16 14 4) (list 9 3 15 6) (list 12 13 10 1)) 9) (list 1 6 1 6 1 6 1 6 1))\n (check-equal? (candidate (list (list 12 13 10 1) (list 9 3 15 6) (list 5 16 14 4) (list 11 8 7 2)) 12) (list 1 6 1 6 1 6 1 6 1 6 1 6))\n (check-equal? (candidate (list (list 2 7 4) (list 3 1 5) (list 6 8 9)) 8) (list 1 3 1 3 1 3 1 3))\n (check-equal? (candidate (list (list 6 1 5) (list 3 8 9) (list 2 7 4)) 8) (list 1 5 1 5 1 5 1 5))\n (check-equal? (candidate (list (list 1 2) (list 3 4)) 10) (list 1 2 1 2 1 2 1 2 1 2))\n (check-equal? (candidate (list (list 1 3) (list 3 2)) 10) (list 1 3 1 3 1 3 1 3 1 3))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given list of integers, return list in strange order.\n;; Strange sorting, is when you start with the minimum value,\n;; then maximum of the remaining integers, then minimum and so on.\n;; Examples:\n;; strange_sort_list([1, 2, 3, 4]) == [1, 4, 2, 3]\n;; strange_sort_list([5, 5, 5, 5]) == [5, 5, 5, 5]\n;; strange_sort_list([]) == []\n(define (strange_sort_list lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate strange_sort_list))\n (check-equal? (candidate (list 1 2 3 4)) (list 1 4 2 3))\n (check-equal? (candidate (list 5 6 7 8 9)) (list 5 9 6 8 7))\n (check-equal? (candidate (list 1 2 3 4 5)) (list 1 5 2 4 3))\n (check-equal? (candidate (list 5 6 7 8 9 1)) (list 1 9 5 8 6 7))\n (check-equal? (candidate (list 5 5 5 5)) (list 5 5 5 5))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 1 2 3 4 5 6 7 8)) (list 1 8 2 7 3 6 4 5))\n (check-equal? (candidate (list 0 2 2 2 5 5 -5 -5)) (list -5 5 -5 5 0 2 2 2))\n (check-equal? (candidate (list 111111)) (list 111111))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a string 'text', return its md5 hash equivalent string.\n;; If 'text' is an empty string, return None.\n;; >>> string_to_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'\n(define (string_to_md5 text)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate string_to_md5))\n (check-equal? (candidate \"Hello world\") \"3e25960a79dbc69b674cd4ec67a72c62\")\n (check-equal? (candidate \"\") #f)\n (check-equal? (candidate \"A B C\") \"0ef78513b0cb8cef12743f5aeb35f888\")\n (check-equal? (candidate \"password\") \"5f4dcc3b5aa765d61d8327deb882cf99\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a word. Your task is to find the closest vowel that stands between \n;; two consonants from the right side of the word (case sensitive).\n;; Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n;; find any vowel met the above condition. \n;; You may assume that the given string contains English letter only.\n;; Example:\n;; get_closest_vowel(\"yogurt\") ==> \"u\"\n;; get_closest_vowel(\"FULL\") ==> \"U\"\n;; get_closest_vowel(\"quick\") ==> \"\"\n;; get_closest_vowel(\"ab\") ==> \"\"\n(define (get_closest_vowel word)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate get_closest_vowel))\n (check-equal? (candidate \"yogurt\") \"u\")\n (check-equal? (candidate \"full\") \"u\")\n (check-equal? (candidate \"easy\") \"\")\n (check-equal? (candidate \"eAsy\") \"\")\n (check-equal? (candidate \"ali\") \"\")\n (check-equal? (candidate \"bad\") \"a\")\n (check-equal? (candidate \"most\") \"o\")\n (check-equal? (candidate \"ab\") \"\")\n (check-equal? (candidate \"ba\") \"\")\n (check-equal? (candidate \"quick\") \"\")\n (check-equal? (candidate \"anime\") \"i\")\n (check-equal? (candidate \"Asia\") \"\")\n (check-equal? (candidate \"Above\") \"o\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "rkt", - "prompt": "#lang racket\n\n;; Change numerical base of input number x to base.\n;; return string representation after the conversion.\n;; base numbers are less than 10.\n;; >>> change_base(8, 3)\n;; '22'\n;; >>> change_base(8, 2)\n;; '1000'\n;; >>> change_base(7, 2)\n;; '111'\n(define (change_base x base)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate change_base))\n (check-equal? (candidate 8 3) \"22\")\n (check-equal? (candidate 9 3) \"100\")\n (check-equal? (candidate 234 2) \"11101010\")\n (check-equal? (candidate 16 2) \"10000\")\n (check-equal? (candidate 8 2) \"1000\")\n (check-equal? (candidate 7 2) \"111\")\n (check-equal? (candidate 2 3) \"2\")\n (check-equal? (candidate 3 4) \"3\")\n (check-equal? (candidate 4 5) \"4\")\n (check-equal? (candidate 5 6) \"5\")\n (check-equal? (candidate 6 7) \"6\")\n (check-equal? (candidate 7 8) \"7\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "rkt", - "prompt": "#lang racket\n\n;; Check if in given list of numbers, are any two numbers closer to each other than\n;; given threshold.\n;; >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n;; False\n;; >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n;; True\n(define (has_close_elements numbers threshold)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate has_close_elements))\n (check-equal? (candidate (list 1.0 2.0 3.9 4.0 5.0 2.2) 0.3) #t)\n (check-equal? (candidate (list 1.0 2.0 3.9 4.0 5.0 2.2) 0.05) #f)\n (check-equal? (candidate (list 1.0 2.0 5.9 4.0 5.0) 0.95) #t)\n (check-equal? (candidate (list 1.0 2.0 5.9 4.0 5.0) 0.8) #f)\n (check-equal? (candidate (list 1.0 2.0 3.0 4.0 5.0 2.0) 0.1) #t)\n (check-equal? (candidate (list 1.1 2.2 3.1 4.1 5.1) 1.0) #t)\n (check-equal? (candidate (list 1.1 2.2 3.1 4.1 5.1) 0.5) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function that takes a string as input which contains only square brackets.\n;; The function should return True if and only if there is a valid subsequence of brackets \n;; where at least one bracket in the subsequence is nested.\n;; is_nested('[[]]') \u279e True\n;; is_nested('[]]]]]]][[[[[]') \u279e False\n;; is_nested('[][]') \u279e False\n;; is_nested('[]') \u279e False\n;; is_nested('[[][]]') \u279e True\n;; is_nested('[[]][[') \u279e True\n(define (is_nested string)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_nested))\n (check-equal? (candidate \"[[]]\") #t)\n (check-equal? (candidate \"[]]]]]]][[[[[]\") #f)\n (check-equal? (candidate \"[][]\") #f)\n (check-equal? (candidate \"[]\") #f)\n (check-equal? (candidate \"[[[[]]]]\") #t)\n (check-equal? (candidate \"[]]]]]]]]]]\") #f)\n (check-equal? (candidate \"[][][[]]\") #t)\n (check-equal? (candidate \"[[]\") #f)\n (check-equal? (candidate \"[]]\") #f)\n (check-equal? (candidate \"[[]][[\") #t)\n (check-equal? (candidate \"[[][]]\") #t)\n (check-equal? (candidate \"\") #f)\n (check-equal? (candidate \"[[[[[[[[\") #f)\n (check-equal? (candidate \"]]]]]]]]\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "rkt", - "prompt": "#lang racket\n\n;; Concatenate list of strings into a single string\n;; >>> concatenate([])\n;; ''\n;; >>> concatenate(['a', 'b', 'c'])\n;; 'abc'\n(define (concatenate strings)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate concatenate))\n (check-equal? (candidate (list )) \"\")\n (check-equal? (candidate (list \"x\" \"y\" \"z\")) \"xyz\")\n (check-equal? (candidate (list \"x\" \"y\" \"z\" \"w\" \"k\")) \"xyzwk\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "rkt", - "prompt": "#lang racket\n\n;; prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n;; >>> prime_fib(1)\n;; 2\n;; >>> prime_fib(2)\n;; 3\n;; >>> prime_fib(3)\n;; 5\n;; >>> prime_fib(4)\n;; 13\n;; >>> prime_fib(5)\n;; 89\n(define (prime_fib n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate prime_fib))\n (check-equal? (candidate 1) 2)\n (check-equal? (candidate 2) 3)\n (check-equal? (candidate 3) 5)\n (check-equal? (candidate 4) 13)\n (check-equal? (candidate 5) 89)\n (check-equal? (candidate 6) 233)\n (check-equal? (candidate 7) 1597)\n (check-equal? (candidate 8) 28657)\n (check-equal? (candidate 9) 514229)\n (check-equal? (candidate 10) 433494437)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "rkt", - "prompt": "#lang racket\n\n;; From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n;; other and return them in order (smaller number, larger number).\n;; >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n;; (2.0, 2.2)\n;; >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n;; (2.0, 2.0)\n(define (find_closest_elements numbers)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate find_closest_elements))\n (check-equal? (candidate (list 1.0 2.0 3.9 4.0 5.0 2.2)) (list 3.9 4.0))\n (check-equal? (candidate (list 1.0 2.0 5.9 4.0 5.0)) (list 5.0 5.9))\n (check-equal? (candidate (list 1.0 2.0 3.0 4.0 5.0 2.2)) (list 2.0 2.2))\n (check-equal? (candidate (list 1.0 2.0 3.0 4.0 5.0 2.0)) (list 2.0 2.0))\n (check-equal? (candidate (list 1.1 2.2 3.1 4.1 5.1)) (list 2.2 3.1))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "rkt", - "prompt": "#lang racket\n\n;; You have been tasked to write a function that receives \n;; a hexadecimal number as a string and counts the number of hexadecimal \n;; digits that are primes (prime number, or a prime, is a natural number \n;; greater than 1 that is not a product of two smaller natural numbers).\n;; Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n;; Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n;; So you have to determine a number of the following digits: 2, 3, 5, 7, \n;; B (=decimal 11), D (=decimal 13).\n;; Note: you may assume the input is always correct or empty string, \n;; and symbols A,B,C,D,E,F are always uppercase.\n;; Examples:\n;; For num = \"AB\" the output should be 1.\n;; For num = \"1077E\" the output should be 2.\n;; For num = \"ABED1A33\" the output should be 4.\n;; For num = \"123456789ABCDEF0\" the output should be 6.\n;; For num = \"2020\" the output should be 2.\n(define (hex_key num)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate hex_key))\n (check-equal? (candidate \"AB\") 1)\n (check-equal? (candidate \"1077E\") 2)\n (check-equal? (candidate \"ABED1A33\") 4)\n (check-equal? (candidate \"2020\") 2)\n (check-equal? (candidate \"123456789ABCDEF0\") 6)\n (check-equal? (candidate \"112233445566778899AABBCCDDEEFF00\") 12)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "rkt", - "prompt": "#lang racket\n\n;; Complete the function that takes two integers and returns \n;; the product of their unit digits.\n;; Assume the input is always valid.\n;; Examples:\n;; multiply(148, 412) should return 16.\n;; multiply(19, 28) should return 72.\n;; multiply(2020, 1851) should return 0.\n;; multiply(14,-15) should return 20.\n(define (multiply a b)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate multiply))\n (check-equal? (candidate 148 412) 16)\n (check-equal? (candidate 19 28) 72)\n (check-equal? (candidate 2020 1851) 0)\n (check-equal? (candidate 14 -15) 20)\n (check-equal? (candidate 76 67) 42)\n (check-equal? (candidate 17 27) 49)\n (check-equal? (candidate 0 1) 0)\n (check-equal? (candidate 0 0) 0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given list of numbers (of at least two elements), apply a linear transform to that list,\n;; such that the smallest number will become 0 and the largest will become 1\n;; >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n;; [0.0, 0.25, 0.5, 0.75, 1.0]\n(define (rescale_to_unit numbers)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate rescale_to_unit))\n (check-equal? (candidate (list 2.0 49.9)) (list 0.0 1.0))\n (check-equal? (candidate (list 100.0 49.9)) (list 1.0 0.0))\n (check-equal? (candidate (list 1.0 2.0 3.0 4.0 5.0)) (list 0.0 0.25 0.5 0.75 1.0))\n (check-equal? (candidate (list 2.0 1.0 5.0 3.0 4.0)) (list 0.25 0.0 1.0 0.5 0.75))\n (check-equal? (candidate (list 12.0 11.0 15.0 13.0 14.0)) (list 0.25 0.0 1.0 0.5 0.75))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a positive integer n, return the product of the odd digits.\n;; Return 0 if all digits are even.\n;; For example:\n;; digits(1) == 1\n;; digits(4) == 0\n;; digits(235) == 15\n(define (digits n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate digits))\n (check-equal? (candidate 5) 5)\n (check-equal? (candidate 54) 5)\n (check-equal? (candidate 120) 1)\n (check-equal? (candidate 5014) 5)\n (check-equal? (candidate 98765) 315)\n (check-equal? (candidate 5576543) 2625)\n (check-equal? (candidate 2468) 0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "rkt", - "prompt": "#lang racket\n\n;; You will be given the name of a class (a string) and a list of extensions.\n;; The extensions are to be used to load additional classes to the class. The\n;; strength of the extension is as follows: Let CAP be the number of the uppercase\n;; letters in the extension's name, and let SM be the number of lowercase letters \n;; in the extension's name, the strength is given by the fraction CAP - SM. \n;; You should find the strongest extension and return a string in this \n;; format: ClassName.StrongestExtensionName.\n;; If there are two or more extensions with the same strength, you should\n;; choose the one that comes first in the list.\n;; For example, if you are given \"Slices\" as the class and a list of the\n;; extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n;; return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n;; (its strength is -1).\n;; Example:\n;; for Strongest_Extension('my_class', ['AA', 'Be', 'CC']) == 'my_class.AA'\n(define (Strongest_Extension class_name extensions)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate Strongest_Extension))\n (check-equal? (candidate \"Watashi\" (list \"tEN\" \"niNE\" \"eIGHt8OKe\")) \"Watashi.eIGHt8OKe\")\n (check-equal? (candidate \"Boku123\" (list \"nani\" \"NazeDa\" \"YEs.WeCaNe\" \"32145tggg\")) \"Boku123.YEs.WeCaNe\")\n (check-equal? (candidate \"__YESIMHERE\" (list \"t\" \"eMptY\" \"nothing\" \"zeR00\" \"NuLl__\" \"123NoooneB321\")) \"__YESIMHERE.NuLl__\")\n (check-equal? (candidate \"K\" (list \"Ta\" \"TAR\" \"t234An\" \"cosSo\")) \"K.TAR\")\n (check-equal? (candidate \"__HAHA\" (list \"Tab\" \"123\" \"781345\" \"-_-\")) \"__HAHA.123\")\n (check-equal? (candidate \"YameRore\" (list \"HhAas\" \"okIWILL123\" \"WorkOut\" \"Fails\" \"-_-\")) \"YameRore.okIWILL123\")\n (check-equal? (candidate \"finNNalLLly\" (list \"Die\" \"NowW\" \"Wow\" \"WoW\")) \"finNNalLLly.WoW\")\n (check-equal? (candidate \"_\" (list \"Bb\" \"91245\")) \"_.Bb\")\n (check-equal? (candidate \"Sp\" (list \"671235\" \"Bb\")) \"Sp.671235\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a string representing a space separated lowercase letters, return a dictionary\n;; of the letter with the most repetition and containing the corresponding count.\n;; If several letters have the same occurrence, return all of them.\n;; Example:\n;; histogram('a b c') == {'a': 1, 'b': 1, 'c': 1}\n;; histogram('a b b a') == {'a': 2, 'b': 2}\n;; histogram('a b c a b') == {'a': 2, 'b': 2}\n;; histogram('b b b b a') == {'b': 4}\n;; histogram('') == {}\n(define (histogram test)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate histogram))\n (check-equal? (candidate \"a b b a\") #hash((\"a\" . 2) (\"b\" . 2)))\n (check-equal? (candidate \"a b c a b\") #hash((\"a\" . 2) (\"b\" . 2)))\n (check-equal? (candidate \"a b c d g\") #hash((\"a\" . 1) (\"b\" . 1) (\"c\" . 1) (\"d\" . 1) (\"g\" . 1)))\n (check-equal? (candidate \"r t g\") #hash((\"r\" . 1) (\"t\" . 1) (\"g\" . 1)))\n (check-equal? (candidate \"b b b b a\") #hash((\"b\" . 4)))\n (check-equal? (candidate \"r t g\") #hash((\"r\" . 1) (\"t\" . 1) (\"g\" . 1)))\n (check-equal? (candidate \"\") #hash())\n (check-equal? (candidate \"a\") #hash((\"a\" . 1)))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "rkt", - "prompt": "#lang racket\n\n;; pairs_sum_to_zero takes a list of integers as an input.\n;; it returns True if there are two distinct elements in the list that\n;; sum to zero, and False otherwise.\n;; >>> pairs_sum_to_zero([1, 3, 5, 0])\n;; False\n;; >>> pairs_sum_to_zero([1, 3, -2, 1])\n;; False\n;; >>> pairs_sum_to_zero([1, 2, 3, 7])\n;; False\n;; >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7])\n;; True\n;; >>> pairs_sum_to_zero([1])\n;; False\n(define (pairs_sum_to_zero l)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate pairs_sum_to_zero))\n (check-equal? (candidate (list 1 3 5 0)) #f)\n (check-equal? (candidate (list 1 3 -2 1)) #f)\n (check-equal? (candidate (list 1 2 3 7)) #f)\n (check-equal? (candidate (list 2 4 -5 3 5 7)) #t)\n (check-equal? (candidate (list 1)) #f)\n (check-equal? (candidate (list -3 9 -1 3 2 30)) #t)\n (check-equal? (candidate (list -3 9 -1 3 2 31)) #t)\n (check-equal? (candidate (list -3 9 -1 4 2 30)) #f)\n (check-equal? (candidate (list -3 9 -1 4 2 31)) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that accepts two lists of strings and returns the list that has \n;; total number of chars in the all strings of the list less than the other list.\n;; if the two lists have the same number of chars, return the first list.\n;; Examples\n;; total_match([], []) \u279e []\n;; total_match(['hi', 'admin'], ['hI', 'Hi']) \u279e ['hI', 'Hi']\n;; total_match(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) \u279e ['hi', 'admin']\n;; total_match(['hi', 'admin'], ['hI', 'hi', 'hi']) \u279e ['hI', 'hi', 'hi']\n;; total_match(['4'], ['1', '2', '3', '4', '5']) \u279e ['4']\n(define (total_match lst1 lst2)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate total_match))\n (check-equal? (candidate (list ) (list )) (list ))\n (check-equal? (candidate (list \"hi\" \"admin\") (list \"hi\" \"hi\")) (list \"hi\" \"hi\"))\n (check-equal? (candidate (list \"hi\" \"admin\") (list \"hi\" \"hi\" \"admin\" \"project\")) (list \"hi\" \"admin\"))\n (check-equal? (candidate (list \"4\") (list \"1\" \"2\" \"3\" \"4\" \"5\")) (list \"4\"))\n (check-equal? (candidate (list \"hi\" \"admin\") (list \"hI\" \"Hi\")) (list \"hI\" \"Hi\"))\n (check-equal? (candidate (list \"hi\" \"admin\") (list \"hI\" \"hi\" \"hi\")) (list \"hI\" \"hi\" \"hi\"))\n (check-equal? (candidate (list \"hi\" \"admin\") (list \"hI\" \"hi\" \"hii\")) (list \"hi\" \"admin\"))\n (check-equal? (candidate (list ) (list \"this\")) (list ))\n (check-equal? (candidate (list \"this\") (list )) (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "rkt", - "prompt": "#lang racket\n\n;; Circular shift the digits of the integer x, shift the digits right by shift\n;; and return the result as a string.\n;; If shift > number of digits, return digits reversed.\n;; >>> circular_shift(12, 1)\n;; \"21\"\n;; >>> circular_shift(12, 2)\n;; \"12\"\n(define (circular_shift x shift)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate circular_shift))\n (check-equal? (candidate 100 2) \"001\")\n (check-equal? (candidate 12 2) \"12\")\n (check-equal? (candidate 97 8) \"79\")\n (check-equal? (candidate 12 1) \"21\")\n (check-equal? (candidate 11 101) \"11\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return True is list elements are monotonically increasing or decreasing.\n;; >>> monotonic([1, 2, 4, 20])\n;; True\n;; >>> monotonic([1, 20, 4, 10])\n;; False\n;; >>> monotonic([4, 1, 0, -10])\n;; True\n(define (monotonic l)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate monotonic))\n (check-equal? (candidate (list 1 2 4 10)) #t)\n (check-equal? (candidate (list 1 2 4 20)) #t)\n (check-equal? (candidate (list 1 20 4 10)) #f)\n (check-equal? (candidate (list 4 1 0 -10)) #t)\n (check-equal? (candidate (list 4 1 1 0)) #t)\n (check-equal? (candidate (list 1 2 3 2 5 60)) #f)\n (check-equal? (candidate (list 1 2 3 4 5 60)) #t)\n (check-equal? (candidate (list 9 9 9 9)) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "rkt", - "prompt": "#lang racket\n\n;; Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n;; Example\n;; is_equal_to_sum_even(4) == False\n;; is_equal_to_sum_even(6) == False\n;; is_equal_to_sum_even(8) == True\n(define (is_equal_to_sum_even n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_equal_to_sum_even))\n (check-equal? (candidate 4) #f)\n (check-equal? (candidate 6) #f)\n (check-equal? (candidate 8) #t)\n (check-equal? (candidate 10) #t)\n (check-equal? (candidate 11) #f)\n (check-equal? (candidate 12) #t)\n (check-equal? (candidate 13) #f)\n (check-equal? (candidate 16) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "rkt", - "prompt": "#lang racket\n\n;; Input to this function is a string representing musical notes in a special ASCII format.\n;; Your task is to parse this string and return list of integers corresponding to how many beats does each\n;; not last.\n;; Here is a legend:\n;; 'o' - whole note, lasts four beats\n;; 'o|' - half note, lasts two beats\n;; '.|' - quater note, lasts one beat\n;; >>> parse_music('o o| .| o| o| .| .| .| .| o o')\n;; [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\n(define (parse_music music_string)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate parse_music))\n (check-equal? (candidate \"\") (list ))\n (check-equal? (candidate \"o o o o\") (list 4 4 4 4))\n (check-equal? (candidate \".| .| .| .|\") (list 1 1 1 1))\n (check-equal? (candidate \"o| o| .| .| o o o o\") (list 2 2 1 1 4 4 4 4))\n (check-equal? (candidate \"o| .| o| .| o o| o o|\") (list 2 1 2 1 4 2 4 2))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "rkt", - "prompt": "#lang racket\n\n;; \"\n;; This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n;; multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n;; change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n;; Examples:\n;; For lst = [1,2,3] the output should be 6\n;; For lst = [] the output should be 0\n;; For lst = [-1,-5,2,-1,-5] the output should be -126\n(define (sum_squares lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sum_squares))\n (check-equal? (candidate (list 1 2 3)) 6)\n (check-equal? (candidate (list 1 4 9)) 14)\n (check-equal? (candidate (list )) 0)\n (check-equal? (candidate (list 1 1 1 1 1 1 1 1 1)) 9)\n (check-equal? (candidate (list -1 -1 -1 -1 -1 -1 -1 -1 -1)) -3)\n (check-equal? (candidate (list 0)) 0)\n (check-equal? (candidate (list -1 -5 2 -1 -5)) -126)\n (check-equal? (candidate (list -56 -99 1 0 -2)) 3030)\n (check-equal? (candidate (list -1 0 0 0 0 0 0 0 -1)) 0)\n (check-equal? (candidate (list -16 -9 -2 36 36 26 -20 25 -40 20 -4 12 -26 35 37)) -14196)\n (check-equal? (candidate (list -1 -3 17 -1 -15 13 -1 14 -14 -12 -5 14 -14 6 13 11 16 16 4 10)) -1448)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "rkt", - "prompt": "#lang racket\n\n;; triples_sum_to_zero takes a list of integers as an input.\n;; it returns True if there are three distinct elements in the list that\n;; sum to zero, and False otherwise.\n;; >>> triples_sum_to_zero([1, 3, 5, 0])\n;; False\n;; >>> triples_sum_to_zero([1, 3, -2, 1])\n;; True\n;; >>> triples_sum_to_zero([1, 2, 3, 7])\n;; False\n;; >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n;; True\n;; >>> triples_sum_to_zero([1])\n;; False\n(define (triples_sum_to_zero l)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate triples_sum_to_zero))\n (check-equal? (candidate (list 1 3 5 0)) #f)\n (check-equal? (candidate (list 1 3 5 -1)) #f)\n (check-equal? (candidate (list 1 3 -2 1)) #t)\n (check-equal? (candidate (list 1 2 3 7)) #f)\n (check-equal? (candidate (list 1 2 5 7)) #f)\n (check-equal? (candidate (list 2 4 -5 3 9 7)) #t)\n (check-equal? (candidate (list 1)) #f)\n (check-equal? (candidate (list 1 3 5 -100)) #f)\n (check-equal? (candidate (list 100 3 5 -100)) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "rkt", - "prompt": "#lang racket\n\n;; brackets is a string of \"<\" and \">\".\n;; return True if every opening bracket has a corresponding closing bracket.\n;; >>> correct_bracketing(\"<\")\n;; False\n;; >>> correct_bracketing(\"<>\")\n;; True\n;; >>> correct_bracketing(\"<<><>>\")\n;; True\n;; >>> correct_bracketing(\"><<>\")\n;; False\n(define (correct_bracketing brackets)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate correct_bracketing))\n (check-equal? (candidate \"<>\") #t)\n (check-equal? (candidate \"<<><>>\") #t)\n (check-equal? (candidate \"<><><<><>><>\") #t)\n (check-equal? (candidate \"<><><<<><><>><>><<><><<>>>\") #t)\n (check-equal? (candidate \"<<<><>>>>\") #f)\n (check-equal? (candidate \"><<>\") #f)\n (check-equal? (candidate \"<\") #f)\n (check-equal? (candidate \"<<<<\") #f)\n (check-equal? (candidate \">\") #f)\n (check-equal? (candidate \"<<>\") #f)\n (check-equal? (candidate \"<><><<><>><>><<>\") #f)\n (check-equal? (candidate \"<><><<><>><>>><>\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that takes an array of numbers as input and returns \n;; the number of elements in the array that are greater than 10 and both \n;; first and last digits of a number are odd (1, 3, 5, 7, 9).\n;; For example:\n;; specialFilter([15, -73, 14, -15]) => 1 \n;; specialFilter([33, -2, -3, 45, 21, 109]) => 2\n(define (specialFilter nums)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate specialFilter))\n (check-equal? (candidate (list 5 -2 1 -5)) 0)\n (check-equal? (candidate (list 15 -73 14 -15)) 1)\n (check-equal? (candidate (list 33 -2 -3 45 21 109)) 2)\n (check-equal? (candidate (list 43 -12 93 125 121 109)) 4)\n (check-equal? (candidate (list 71 -2 -33 75 21 19)) 3)\n (check-equal? (candidate (list 1)) 0)\n (check-equal? (candidate (list )) 0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a dictionary, return True if all keys are strings in lower \n;; case or all keys are strings in upper case, else return False.\n;; The function should return False is the given dictionary is empty.\n;; Examples:\n;; check_dict_case({\"a\":\"apple\", \"b\":\"banana\"}) should return True.\n;; check_dict_case({\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}) should return False.\n;; check_dict_case({\"a\":\"apple\", \"8\":\"banana\", \"a\":\"apple\"}) should return False.\n;; check_dict_case({\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}) should return False.\n;; check_dict_case({\"STATE\":\"NC\", \"ZIP\":\"12345\" }) should return True.\n(define (check_dict_case dict)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate check_dict_case))\n (check-equal? (candidate #hash((\"p\" . \"pineapple\") (\"b\" . \"banana\"))) #t)\n (check-equal? (candidate #hash((\"p\" . \"pineapple\") (\"A\" . \"banana\") (\"B\" . \"banana\"))) #f)\n (check-equal? (candidate #hash((\"p\" . \"pineapple\") (\"5\" . \"banana\") (\"a\" . \"apple\"))) #f)\n (check-equal? (candidate #hash((\"Name\" . \"John\") (\"Age\" . \"36\") (\"City\" . \"Houston\"))) #f)\n (check-equal? (candidate #hash((\"STATE\" . \"NC\") (\"ZIP\" . \"12345\"))) #t)\n (check-equal? (candidate #hash((\"fruit\" . \"Orange\") (\"taste\" . \"Sweet\"))) #t)\n (check-equal? (candidate #hash()) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n;; should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n;; alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n;; Examples\n;; split_words(\"Hello world!\") \u279e [\"Hello\", \"world!\"]\n;; split_words(\"Hello,world!\") \u279e [\"Hello\", \"world!\"]\n;; split_words(\"abcdef\") == 3\n(define (split_words txt)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate split_words))\n (check-equal? (candidate \"Hello world!\") (list \"Hello\" \"world!\"))\n (check-equal? (candidate \"Hello,world!\") (list \"Hello\" \"world!\"))\n (check-equal? (candidate \"Hello world,!\") (list \"Hello\" \"world,!\"))\n (check-equal? (candidate \"Hello,Hello,world !\") (list \"Hello,Hello,world\" \"!\"))\n (check-equal? (candidate \"abcdef\") 3)\n (check-equal? (candidate \"aaabb\") 2)\n (check-equal? (candidate \"aaaBb\") 1)\n (check-equal? (candidate \"\") 0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "rkt", - "prompt": "#lang racket\n\n;; The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n;; fibfib(0) == 0\n;; fibfib(1) == 0\n;; fibfib(2) == 1\n;; fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n;; Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n;; >>> fibfib(1)\n;; 0\n;; >>> fibfib(5)\n;; 4\n;; >>> fibfib(8)\n;; 24\n(define (fibfib n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate fibfib))\n (check-equal? (candidate 2) 1)\n (check-equal? (candidate 1) 0)\n (check-equal? (candidate 5) 4)\n (check-equal? (candidate 8) 24)\n (check-equal? (candidate 10) 81)\n (check-equal? (candidate 12) 274)\n (check-equal? (candidate 14) 927)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a list of numbers.\n;; You need to return the sum of squared numbers in the given list,\n;; round each element in the list to the upper int(Ceiling) first.\n;; Examples:\n;; For lst = [1,2,3] the output should be 14\n;; For lst = [1,4,9] the output should be 98\n;; For lst = [1,3,5,7] the output should be 84\n;; For lst = [1.4,4.2,0] the output should be 29\n;; For lst = [-2.4,1,1] the output should be 6\n(define (sum_squares lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sum_squares))\n (check-equal? (candidate (list 1.0 2.0 3.0)) 14)\n (check-equal? (candidate (list 1.0 2.0 3.0)) 14)\n (check-equal? (candidate (list 1.0 3.0 5.0 7.0)) 84)\n (check-equal? (candidate (list 1.4 4.2 0.0)) 29)\n (check-equal? (candidate (list -2.4 1.0 1.0)) 6)\n (check-equal? (candidate (list 100.0 1.0 15.0 2.0)) 10230)\n (check-equal? (candidate (list 10000.0 10000.0)) 200000000)\n (check-equal? (candidate (list -1.4 4.6 6.3)) 75)\n (check-equal? (candidate (list -1.4 17.9 18.9 19.9)) 1086)\n (check-equal? (candidate (list 0.0)) 0)\n (check-equal? (candidate (list -1.0)) 1)\n (check-equal? (candidate (list -1.0 1.0 0.0)) 2)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_85_add", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a non-empty list of integers lst. add the even elements that are at odd indices..\n;; Examples:\n;; add([4, 2, 6, 7]) ==> 2\n(define (add lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate add))\n (check-equal? (candidate (list 4 88)) 88)\n (check-equal? (candidate (list 4 5 6 7 2 122)) 122)\n (check-equal? (candidate (list 4 0 6 7)) 0)\n (check-equal? (candidate (list 4 4 6 8)) 12)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return sorted unique elements in a list\n;; >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123])\n;; [0, 2, 3, 5, 9, 123]\n(define (unique l)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate unique))\n (check-equal? (candidate (list 5 3 5 2 3 3 9 0 123)) (list 0 2 3 5 9 123))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a string text, replace all spaces in it with underscores, \n;; and if a string has more than 2 consecutive spaces, \n;; then replace all consecutive spaces with - \n;; fix_spaces(\"Example\") == \"Example\"\n;; fix_spaces(\"Example 1\") == \"Example_1\"\n;; fix_spaces(\" Example 2\") == \"_Example_2\"\n;; fix_spaces(\" Example 3\") == \"_Example-3\"\n(define (fix_spaces text)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate fix_spaces))\n (check-equal? (candidate \"Example\") \"Example\")\n (check-equal? (candidate \"Mudasir Hanif \") \"Mudasir_Hanif_\")\n (check-equal? (candidate \"Yellow Yellow Dirty Fellow\") \"Yellow_Yellow__Dirty__Fellow\")\n (check-equal? (candidate \"Exa mple\") \"Exa-mple\")\n (check-equal? (candidate \" Exa 1 2 2 mple\") \"-Exa_1_2_2_mple\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return 2^n modulo p (be aware of numerics).\n;; >>> modp(3, 5)\n;; 3\n;; >>> modp(1101, 101)\n;; 2\n;; >>> modp(0, 101)\n;; 1\n;; >>> modp(3, 11)\n;; 8\n;; >>> modp(100, 101)\n;; 1\n(define (modp n p)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate modp))\n (check-equal? (candidate 3 5) 3)\n (check-equal? (candidate 1101 101) 2)\n (check-equal? (candidate 0 101) 1)\n (check-equal? (candidate 3 11) 8)\n (check-equal? (candidate 100 101) 1)\n (check-equal? (candidate 30 5) 4)\n (check-equal? (candidate 31 5) 3)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "rkt", - "prompt": "#lang racket\n\n;; You have to write a function which validates a given date string and\n;; returns True if the date is valid otherwise False.\n;; The date is valid if all of the following rules are satisfied:\n;; 1. The date string is not empty.\n;; 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n;; 3. The months should not be less than 1 or higher than 12.\n;; 4. The date should be in the format: mm-dd-yyyy\n;; for example: \n;; valid_date('03-11-2000') => True\n;; valid_date('15-01-2012') => False\n;; valid_date('04-0-2040') => False\n;; valid_date('06-04-2020') => True\n;; valid_date('06/04/2020') => False\n(define (valid_date date)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate valid_date))\n (check-equal? (candidate \"03-11-2000\") #t)\n (check-equal? (candidate \"15-01-2012\") #f)\n (check-equal? (candidate \"04-0-2040\") #f)\n (check-equal? (candidate \"06-04-2020\") #t)\n (check-equal? (candidate \"01-01-2007\") #t)\n (check-equal? (candidate \"03-32-2011\") #f)\n (check-equal? (candidate \"\") #f)\n (check-equal? (candidate \"04-31-3000\") #f)\n (check-equal? (candidate \"06-06-2005\") #t)\n (check-equal? (candidate \"21-31-2000\") #f)\n (check-equal? (candidate \"04-12-2003\") #t)\n (check-equal? (candidate \"04122003\") #f)\n (check-equal? (candidate \"20030412\") #f)\n (check-equal? (candidate \"2003-04\") #f)\n (check-equal? (candidate \"2003-04-12\") #f)\n (check-equal? (candidate \"04-2003\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that takes a string and returns an ordered version of it.\n;; Ordered version of string, is a string where all words (separated by space)\n;; are replaced by a new word where all the characters arranged in\n;; ascending order based on ascii value.\n;; Note: You should keep the order of words and blank spaces in the sentence.\n;; For example:\n;; anti_shuffle('Hi') returns 'Hi'\n;; anti_shuffle('hello') returns 'ehllo'\n;; anti_shuffle('Hello World!!!') returns 'Hello !!!Wdlor'\n(define (anti_shuffle s)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate anti_shuffle))\n (check-equal? (candidate \"Hi\") \"Hi\")\n (check-equal? (candidate \"hello\") \"ehllo\")\n (check-equal? (candidate \"number\") \"bemnru\")\n (check-equal? (candidate \"abcd\") \"abcd\")\n (check-equal? (candidate \"Hello World!!!\") \"Hello !!!Wdlor\")\n (check-equal? (candidate \"\") \"\")\n (check-equal? (candidate \"Hi. My name is Mister Robot. How are you?\") \".Hi My aemn is Meirst .Rboot How aer ?ouy\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a list of numbers, return whether or not they are sorted\n;; in ascending order. If list has more than 1 duplicate of the same\n;; number, return False. Assume no negative numbers and only integers.\n;; Examples\n;; is_sorted([5]) \u279e True\n;; is_sorted([1, 2, 3, 4, 5]) \u279e True\n;; is_sorted([1, 3, 2, 4, 5]) \u279e False\n;; is_sorted([1, 2, 3, 4, 5, 6]) \u279e True\n;; is_sorted([1, 2, 3, 4, 5, 6, 7]) \u279e True\n;; is_sorted([1, 3, 2, 4, 5, 6, 7]) \u279e False\n;; is_sorted([1, 2, 2, 3, 3, 4]) \u279e True\n;; is_sorted([1, 2, 2, 2, 3, 4]) \u279e False\n(define (is_sorted lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_sorted))\n (check-equal? (candidate (list 5)) #t)\n (check-equal? (candidate (list 1 2 3 4 5)) #t)\n (check-equal? (candidate (list 1 3 2 4 5)) #f)\n (check-equal? (candidate (list 1 2 3 4 5 6)) #t)\n (check-equal? (candidate (list 1 2 3 4 5 6 7)) #t)\n (check-equal? (candidate (list 1 3 2 4 5 6 7)) #f)\n (check-equal? (candidate (list )) #t)\n (check-equal? (candidate (list 1)) #t)\n (check-equal? (candidate (list 3 2 1)) #f)\n (check-equal? (candidate (list 1 2 2 2 3 4)) #f)\n (check-equal? (candidate (list 1 2 3 3 3 4)) #f)\n (check-equal? (candidate (list 1 2 2 3 3 4)) #t)\n (check-equal? (candidate (list 1 2 3 4)) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a string s.\n;; Your task is to check if the string is happy or not.\n;; A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n;; For example:\n;; is_happy(a) => False\n;; is_happy(aa) => False\n;; is_happy(abcd) => True\n;; is_happy(aabb) => False\n;; is_happy(adb) => True\n;; is_happy(xyy) => False\n(define (is_happy s)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_happy))\n (check-equal? (candidate \"a\") #f)\n (check-equal? (candidate \"aa\") #f)\n (check-equal? (candidate \"abcd\") #t)\n (check-equal? (candidate \"aabb\") #f)\n (check-equal? (candidate \"adb\") #t)\n (check-equal? (candidate \"xyy\") #f)\n (check-equal? (candidate \"iopaxpoi\") #t)\n (check-equal? (candidate \"iopaxioi\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that returns True if the object q will fly, and False otherwise.\n;; The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n;; Example:\n;; will_it_fly([1, 2], 5) \u279e False \n;; # 1+2 is less than the maximum possible weight, but it's unbalanced.\n;; will_it_fly([3, 2, 3], 1) \u279e False\n;; # it's balanced, but 3+2+3 is more than the maximum possible weight.\n;; will_it_fly([3, 2, 3], 9) \u279e True\n;; # 3+2+3 is less than the maximum possible weight, and it's balanced.\n;; will_it_fly([3], 5) \u279e True\n;; # 3 is less than the maximum possible weight, and it's balanced.\n(define (will_it_fly q w)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate will_it_fly))\n (check-equal? (candidate (list 3 2 3) 9) #t)\n (check-equal? (candidate (list 1 2) 5) #f)\n (check-equal? (candidate (list 3) 5) #t)\n (check-equal? (candidate (list 3 2 3) 1) #f)\n (check-equal? (candidate (list 1 2 3) 6) #f)\n (check-equal? (candidate (list 5) 5) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given an array of non-negative integers, return a copy of the given array after sorting,\n;; you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n;; or sort it in descending order if the sum( first index value, last index value) is even.\n;; Note:\n;; * don't change the given array.\n;; Examples:\n;; * sort_array([]) => []\n;; * sort_array([5]) => [5]\n;; * sort_array([2, 4, 3, 0, 1, 5]) => [0, 1, 2, 3, 4, 5]\n;; * sort_array([2, 4, 3, 0, 1, 5, 6]) => [6, 5, 4, 3, 2, 1, 0]\n(define (sort_array array)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sort_array))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 5)) (list 5))\n (check-equal? (candidate (list 2 4 3 0 1 5)) (list 0 1 2 3 4 5))\n (check-equal? (candidate (list 2 4 3 0 1 5 6)) (list 6 5 4 3 2 1 0))\n (check-equal? (candidate (list 2 1)) (list 1 2))\n (check-equal? (candidate (list 15 42 87 32 11 0)) (list 0 11 15 32 42 87))\n (check-equal? (candidate (list 21 14 23 11)) (list 23 21 14 11))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "rkt", - "prompt": "#lang racket\n\n;; Implement a function that takes an non-negative integer and returns an array of the first n\n;; integers that are prime numbers and less than n.\n;; for example:\n;; count_up_to(5) => [2,3]\n;; count_up_to(11) => [2,3,5,7]\n;; count_up_to(0) => []\n;; count_up_to(20) => [2,3,5,7,11,13,17,19]\n;; count_up_to(1) => []\n;; count_up_to(18) => [2,3,5,7,11,13,17]\n(define (count_up_to n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate count_up_to))\n (check-equal? (candidate 5) (list 2 3))\n (check-equal? (candidate 6) (list 2 3 5))\n (check-equal? (candidate 7) (list 2 3 5))\n (check-equal? (candidate 10) (list 2 3 5 7))\n (check-equal? (candidate 0) (list ))\n (check-equal? (candidate 22) (list 2 3 5 7 11 13 17 19))\n (check-equal? (candidate 1) (list ))\n (check-equal? (candidate 18) (list 2 3 5 7 11 13 17))\n (check-equal? (candidate 47) (list 2 3 5 7 11 13 17 19 23 29 31 37 41 43))\n (check-equal? (candidate 101) (list 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "rkt", - "prompt": "#lang racket\n\n;; Out of list of strings, return the longest one. Return the first one in case of multiple\n;; strings of the same length. Return None in case the input list is empty.\n;; >>> longest([])\n;; >>> longest(['a', 'b', 'c'])\n;; 'a'\n;; >>> longest(['a', 'bb', 'ccc'])\n;; 'ccc'\n(define (longest strings)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate longest))\n (check-equal? (candidate (list )) #f)\n (check-equal? (candidate (list \"x\" \"y\" \"z\")) \"x\")\n (check-equal? (candidate (list \"x\" \"yyy\" \"zzzz\" \"www\" \"kkkk\" \"abc\")) \"zzzz\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n;; reverse the resulting array, and then replace each digit by its corresponding name from\n;; \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n;; For example:\n;; arr = [2, 1, 1, 4, 5, 8, 2, 3] \n;; -> sort arr -> [1, 1, 2, 2, 3, 4, 5, 8] \n;; -> reverse arr -> [8, 5, 4, 3, 2, 2, 1, 1]\n;; return [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n;; If the array is empty, return an empty array:\n;; arr = []\n;; return []\n;; If the array has any strange number ignore it:\n;; arr = [1, -1 , 55] \n;; -> sort arr -> [-1, 1, 55]\n;; -> reverse arr -> [55, 1, -1]\n;; return = ['One']\n(define (by_length arr)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate by_length))\n (check-equal? (candidate (list 2 1 1 4 5 8 2 3)) (list \"Eight\" \"Five\" \"Four\" \"Three\" \"Two\" \"Two\" \"One\" \"One\"))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 1 -1 55)) (list \"One\"))\n (check-equal? (candidate (list 1 -1 3 2)) (list \"Three\" \"Two\" \"One\"))\n (check-equal? (candidate (list 9 4 8)) (list \"Nine\" \"Eight\" \"Four\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_106_f", - "language": "rkt", - "prompt": "#lang racket\n\n;; Implement the function f that takes n as a parameter,\n;; 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\n;; or the sum of numbers from 1 to i otherwise.\n;; i starts from 1.\n;; the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n;; Example:\n;; f(5) == [1, 2, 6, 24, 15]\n(define (f n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate f))\n (check-equal? (candidate 5) (list 1 2 6 24 15))\n (check-equal? (candidate 7) (list 1 2 6 24 15 720 28))\n (check-equal? (candidate 1) (list 1))\n (check-equal? (candidate 3) (list 1 2 6))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n;; >>> fizz_buzz(50)\n;; 0\n;; >>> fizz_buzz(78)\n;; 2\n;; >>> fizz_buzz(79)\n;; 3\n(define (fizz_buzz n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate fizz_buzz))\n (check-equal? (candidate 50) 0)\n (check-equal? (candidate 78) 2)\n (check-equal? (candidate 79) 3)\n (check-equal? (candidate 100) 3)\n (check-equal? (candidate 200) 6)\n (check-equal? (candidate 4000) 192)\n (check-equal? (candidate 10000) 639)\n (check-equal? (candidate 100000) 8026)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a positive floating point number, it can be decomposed into\n;; and integer part (largest integer smaller than given number) and decimals\n;; (leftover part always smaller than 1).\n;; Return the decimal part of the number.\n;; >>> truncate_number(3.5)\n;; 0.5\n(define (truncate_number number)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate truncate_number))\n (check-equal? (candidate 3.5) 0.5)\n (check-equal? (candidate 1.25) 0.25)\n (check-equal? (candidate 123.0) 0.0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "rkt", - "prompt": "#lang racket\n\n;; For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n;; Empty sum should be equal to 0 and empty product should be equal to 1.\n;; >>> sum_product([])\n;; (0, 1)\n;; >>> sum_product([1, 2, 3, 4])\n;; (10, 24)\n(define (sum_product numbers)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sum_product))\n (check-equal? (candidate (list )) (list 0 1))\n (check-equal? (candidate (list 1 1 1)) (list 3 1))\n (check-equal? (candidate (list 100 0)) (list 100 0))\n (check-equal? (candidate (list 3 5 7)) (list 15 105))\n (check-equal? (candidate (list 10)) (list 10 10))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a 2 dimensional data, as a nested lists,\n;; which is similar to matrix, however, unlike matrices,\n;; each row may contain a different number of columns.\n;; Given lst, and integer x, find integers x in the list,\n;; and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n;; each tuple is a coordinate - (row, columns), starting with 0.\n;; Sort coordinates initially by rows in ascending order.\n;; Also, sort coordinates of the row by columns in descending order.\n;; Examples:\n;; get_row([\n;; [1,2,3,4,5,6],\n;; [1,2,3,4,1,6],\n;; [1,2,3,4,5,1]\n;; ], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n;; get_row([], 1) == []\n;; get_row([[], [1], [1, 2, 3]], 3) == [(2, 2)]\n(define (get_row lst x)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate get_row))\n (check-equal? (candidate (list (list 1 2 3 4 5 6) (list 1 2 3 4 1 6) (list 1 2 3 4 5 1)) 1) (list (list 0 0) (list 1 4) (list 1 0) (list 2 5) (list 2 0)))\n (check-equal? (candidate (list (list 1 2 3 4 5 6) (list 1 2 3 4 5 6) (list 1 2 3 4 5 6) (list 1 2 3 4 5 6) (list 1 2 3 4 5 6) (list 1 2 3 4 5 6)) 2) (list (list 0 1) (list 1 1) (list 2 1) (list 3 1) (list 4 1) (list 5 1)))\n (check-equal? (candidate (list (list 1 2 3 4 5 6) (list 1 2 3 4 5 6) (list 1 1 3 4 5 6) (list 1 2 1 4 5 6) (list 1 2 3 1 5 6) (list 1 2 3 4 1 6) (list 1 2 3 4 5 1)) 1) (list (list 0 0) (list 1 0) (list 2 1) (list 2 0) (list 3 2) (list 3 0) (list 4 3) (list 4 0) (list 5 4) (list 5 0) (list 6 5) (list 6 0)))\n (check-equal? (candidate (list ) 1) (list ))\n (check-equal? (candidate (list (list 1)) 2) (list ))\n (check-equal? (candidate (list (list ) (list 1) (list 1 2 3)) 3) (list (list 2 2)))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "rkt", - "prompt": "#lang racket\n\n;; You're a hungry rabbit, and you already have eaten a certain number of carrots,\n;; but now you need to eat more carrots to complete the day's meals.\n;; you should return an array of [ total number of eaten carrots after your meals,\n;; the number of carrots left after your meals ]\n;; if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n;; Example:\n;; * eat(5, 6, 10) -> [11, 4]\n;; * eat(4, 8, 9) -> [12, 1]\n;; * eat(1, 10, 10) -> [11, 0]\n;; * eat(2, 11, 5) -> [7, 0]\n;; Variables:\n;; @number : integer\n;; the number of carrots that you have eaten.\n;; @need : integer\n;; the number of carrots that you need to eat.\n;; @remaining : integer\n;; the number of remaining carrots thet exist in stock\n;; Constrain:\n;; * 0 <= number <= 1000\n;; * 0 <= need <= 1000\n;; * 0 <= remaining <= 1000\n;; Have fun :)\n(define (eat number need remaining)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate eat))\n (check-equal? (candidate 5 6 10) (list 11 4))\n (check-equal? (candidate 4 8 9) (list 12 1))\n (check-equal? (candidate 1 10 10) (list 11 0))\n (check-equal? (candidate 2 11 5) (list 7 0))\n (check-equal? (candidate 4 5 7) (list 9 2))\n (check-equal? (candidate 4 5 1) (list 5 0))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a positive integer N, return the total sum of its digits in binary.\n;; Example\n;; For N = 1000, the sum of digits will be 1 the output should be \"1\".\n;; For N = 150, the sum of digits will be 6 the output should be \"110\".\n;; For N = 147, the sum of digits will be 12 the output should be \"1100\".\n;; Variables:\n;; @N integer\n;; Constraints: 0 \u2264 N \u2264 10000.\n;; Output:\n;; a string of binary number\n(define (solve N)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate solve))\n (check-equal? (candidate 1000) \"1\")\n (check-equal? (candidate 150) \"110\")\n (check-equal? (candidate 147) \"1100\")\n (check-equal? (candidate 333) \"1001\")\n (check-equal? (candidate 963) \"10010\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a list of integers.\n;; You need to find the largest prime value and return the sum of its digits.\n;; Examples:\n;; For lst = [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] the output should be 10\n;; For lst = [1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1] the output should be 25\n;; For lst = [1,3,1,32,5107,34,83278,109,163,23,2323,32,30,1,9,3] the output should be 13\n;; For lst = [0,724,32,71,99,32,6,0,5,91,83,0,5,6] the output should be 11\n;; For lst = [0,81,12,3,1,21] the output should be 3\n;; For lst = [0,8,1,2,1,7] the output should be 7\n(define (skjkasdkd lst)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate skjkasdkd))\n (check-equal? (candidate (list 0 3 2 1 3 5 7 4 5 5 5 2 181 32 4 32 3 2 32 324 4 3)) 10)\n (check-equal? (candidate (list 1 0 1 8 2 4597 2 1 3 40 1 2 1 2 4 2 5 1)) 25)\n (check-equal? (candidate (list 1 3 1 32 5107 34 83278 109 163 23 2323 32 30 1 9 3)) 13)\n (check-equal? (candidate (list 0 724 32 71 99 32 6 0 5 91 83 0 5 6)) 11)\n (check-equal? (candidate (list 0 81 12 3 1 21)) 3)\n (check-equal? (candidate (list 0 8 1 2 1 7)) 7)\n (check-equal? (candidate (list 8191)) 19)\n (check-equal? (candidate (list 8191 123456 127 7)) 19)\n (check-equal? (candidate (list 127 97 8192)) 10)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given an array arr of integers, find the minimum number of elements that\n;; need to be changed to make the array palindromic. A palindromic array is an array that\n;; is read the same backwards and forwards. In one change, you can change one element to any other element.\n;; For example:\n;; smallest_change([1,2,3,5,4,7,9,6]) == 4\n;; smallest_change([1, 2, 3, 4, 3, 2, 2]) == 1\n;; smallest_change([1, 2, 3, 2, 1]) == 0\n(define (smallest_change arr)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate smallest_change))\n (check-equal? (candidate (list 1 2 3 5 4 7 9 6)) 4)\n (check-equal? (candidate (list 1 2 3 4 3 2 2)) 1)\n (check-equal? (candidate (list 1 4 2)) 1)\n (check-equal? (candidate (list 1 4 4 2)) 1)\n (check-equal? (candidate (list 1 2 3 2 1)) 0)\n (check-equal? (candidate (list 3 1 1 3)) 0)\n (check-equal? (candidate (list 1)) 0)\n (check-equal? (candidate (list 0 1)) 1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "rkt", - "prompt": "#lang racket\n\n;; It is the last week of the semester and the teacher has to give the grades\n;; to students. The teacher has been making her own algorithm for grading.\n;; The only problem is, she has lost the code she used for grading.\n;; She has given you a list of GPAs for some students and you have to write \n;; a function that can output a list of letter grades using the following table:\n;; GPA | Letter grade\n;; 4.0 A+\n;; > 3.7 A \n;; > 3.3 A- \n;; > 3.0 B+\n;; > 2.7 B \n;; > 2.3 B-\n;; > 2.0 C+\n;; > 1.7 C\n;; > 1.3 C-\n;; > 1.0 D+ \n;; > 0.7 D \n;; > 0.0 D-\n;; 0.0 E\n;; Example:\n;; grade_equation([4.0, 3, 1.7, 2, 3.5]) ==> ['A+', 'B', 'C-', 'C', 'A-']\n(define (numerical_letter_grade grades)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate numerical_letter_grade))\n (check-equal? (candidate (list 4.0 3 1.7 2 3.5)) (list \"A+\" \"B\" \"C-\" \"C\" \"A-\"))\n (check-equal? (candidate (list 1.2)) (list \"D+\"))\n (check-equal? (candidate (list 0.5)) (list \"D-\"))\n (check-equal? (candidate (list 0.0)) (list \"E\"))\n (check-equal? (candidate (list 1.0 0.3 1.5 2.8 3.3)) (list \"D\" \"D-\" \"C-\" \"B\" \"B+\"))\n (check-equal? (candidate (list 0.0 0.7)) (list \"E\" \"D-\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given the lengths of the three sides of a triangle. Return the area of\n;; the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n;; Otherwise return -1\n;; Three sides make a valid triangle when the sum of any two sides is greater \n;; than the third side.\n;; Example:\n;; triangle_area(3, 4, 5) == 6.00\n;; triangle_area(1, 2, 10) == -1\n(define (triangle_area a b c)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate triangle_area))\n (check-equal? (candidate 3 4 5) 6.0)\n (check-equal? (candidate 1 2 10) -1)\n (check-equal? (candidate 4 8 5) 8.18)\n (check-equal? (candidate 2 2 2) 1.73)\n (check-equal? (candidate 1 2 3) -1)\n (check-equal? (candidate 10 5 7) 16.25)\n (check-equal? (candidate 2 6 3) -1)\n (check-equal? (candidate 1 1 1) 0.43)\n (check-equal? (candidate 2 2 10) -1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "rkt", - "prompt": "#lang racket\n\n;; Check if two words have the same characters.\n;; >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n;; True\n;; >>> same_chars('abcd', 'dddddddabc')\n;; True\n;; >>> same_chars('dddddddabc', 'abcd')\n;; True\n;; >>> same_chars('eabcd', 'dddddddabc')\n;; False\n;; >>> same_chars('abcd', 'dddddddabce')\n;; False\n;; >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc')\n;; False\n(define (same_chars s0 s1)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate same_chars))\n (check-equal? (candidate \"eabcdzzzz\" \"dddzzzzzzzddeddabc\") #t)\n (check-equal? (candidate \"abcd\" \"dddddddabc\") #t)\n (check-equal? (candidate \"dddddddabc\" \"abcd\") #t)\n (check-equal? (candidate \"eabcd\" \"dddddddabc\") #f)\n (check-equal? (candidate \"abcd\" \"dddddddabcf\") #f)\n (check-equal? (candidate \"eabcdzzzz\" \"dddzzzzzzzddddabc\") #f)\n (check-equal? (candidate \"aabb\" \"aaccc\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given an array of integers nums, find the minimum sum of any non-empty sub-array\n;; of nums.\n;; Example\n;; minSubArraySum([2, 3, 4, 1, 2, 4]) == 1\n;; minSubArraySum([-1, -2, -3]) == -6\n(define (minSubArraySum nums)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate minSubArraySum))\n (check-equal? (candidate (list 2 3 4 1 2 4)) 1)\n (check-equal? (candidate (list -1 -2 -3)) -6)\n (check-equal? (candidate (list -1 -2 -3 2 -10)) -14)\n (check-equal? (candidate (list -9999999999999999)) -9999999999999999)\n (check-equal? (candidate (list 0 10 20 1000000)) 0)\n (check-equal? (candidate (list -1 -2 -3 10 -5)) -6)\n (check-equal? (candidate (list 100 -1 -2 -3 10 -5)) -6)\n (check-equal? (candidate (list 10 11 13 8 3 4)) 3)\n (check-equal? (candidate (list 100 -33 32 -1 0 -2)) -33)\n (check-equal? (candidate (list -10)) -10)\n (check-equal? (candidate (list 7)) 7)\n (check-equal? (candidate (list 1 -1)) -1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a string s and a natural number n, you have been tasked to implement \n;; a function that returns a list of all words from string s that contain exactly \n;; n consonants, in order these words appear in the string s.\n;; If the string s is empty then the function should return an empty list.\n;; Note: you may assume the input string contains only letters and spaces.\n;; Examples:\n;; select_words(\"Mary had a little lamb\", 4) ==> [\"little\"]\n;; select_words(\"Mary had a little lamb\", 3) ==> [\"Mary\", \"lamb\"]\n;; select_words(\"simple white space\", 2) ==> []\n;; select_words(\"Hello world\", 4) ==> [\"world\"]\n;; select_words(\"Uncle sam\", 3) ==> [\"Uncle\"]\n(define (select_words s n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate select_words))\n (check-equal? (candidate \"Mary had a little lamb\" 4) (list \"little\"))\n (check-equal? (candidate \"Mary had a little lamb\" 3) (list \"Mary\" \"lamb\"))\n (check-equal? (candidate \"simple white space\" 2) (list ))\n (check-equal? (candidate \"Hello world\" 4) (list \"world\"))\n (check-equal? (candidate \"Uncle sam\" 3) (list \"Uncle\"))\n (check-equal? (candidate \"\" 4) (list ))\n (check-equal? (candidate \"a b c d e f\" 1) (list \"b\" \"c\" \"d\" \"f\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return list of all prefixes from shortest to longest of the input string\n;; >>> all_prefixes('abc')\n;; ['a', 'ab', 'abc']\n(define (all_prefixes string)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate all_prefixes))\n (check-equal? (candidate \"\") (list ))\n (check-equal? (candidate \"asdfgh\") (list \"a\" \"as\" \"asd\" \"asdf\" \"asdfg\" \"asdfgh\"))\n (check-equal? (candidate \"WWW\") (list \"W\" \"WW\" \"WWW\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function that takes a value (string) representing a number\n;; and returns the closest integer to it. If the number is equidistant\n;; from two integers, round it away from zero.\n;; Examples\n;; >>> closest_integer(\"10\")\n;; 10\n;; >>> closest_integer(\"15.3\")\n;; 15\n;; Note:\n;; Rounding away from zero means that if the given number is equidistant\n;; from two integers, the one you should return is the one that is the\n;; farthest from zero. For example closest_integer(\"14.5\") should\n;; return 15 and closest_integer(\"-14.5\") should return -15.\n(define (closest_integer value)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate closest_integer))\n (check-equal? (candidate \"10\") 10)\n (check-equal? (candidate \"14.5\") 15)\n (check-equal? (candidate \"-15.5\") -16)\n (check-equal? (candidate \"15.3\") 15)\n (check-equal? (candidate \"0\") 0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function which takes a string representing a file's name, and returns\n;; 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n;; A file's name is considered to be valid if and only if all the following conditions \n;; are met:\n;; - There should not be more than three digits ('0'-'9') in the file's name.\n;; - The file's name contains exactly one dot '.'\n;; - The substring before the dot should not be empty, and it starts with a letter from \n;; the latin alphapet ('a'-'z' and 'A'-'Z').\n;; - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n;; Examples:\n;; file_name_check(\"example.txt\") # => 'Yes'\n;; file_name_check(\"1example.dll\") # => 'No' (the name should start with a latin alphapet letter)\n(define (file_name_check file_name)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate file_name_check))\n (check-equal? (candidate \"example.txt\") \"Yes\")\n (check-equal? (candidate \"1example.dll\") \"No\")\n (check-equal? (candidate \"s1sdf3.asd\") \"No\")\n (check-equal? (candidate \"K.dll\") \"Yes\")\n (check-equal? (candidate \"MY16FILE3.exe\") \"Yes\")\n (check-equal? (candidate \"His12FILE94.exe\") \"No\")\n (check-equal? (candidate \"_Y.txt\") \"No\")\n (check-equal? (candidate \"?aREYA.exe\") \"No\")\n (check-equal? (candidate \"/this_is_valid.dll\") \"No\")\n (check-equal? (candidate \"this_is_valid.wow\") \"No\")\n (check-equal? (candidate \"this_is_valid.txt\") \"Yes\")\n (check-equal? (candidate \"this_is_valid.txtexe\") \"No\")\n (check-equal? (candidate \"#this2_i4s_5valid.ten\") \"No\")\n (check-equal? (candidate \"@this1_is6_valid.exe\") \"No\")\n (check-equal? (candidate \"this_is_12valid.6exe4.txt\") \"No\")\n (check-equal? (candidate \"all.exe.txt\") \"No\")\n (check-equal? (candidate \"I563_No.exe\") \"Yes\")\n (check-equal? (candidate \"Is3youfault.txt\") \"Yes\")\n (check-equal? (candidate \"no_one#knows.dll\") \"Yes\")\n (check-equal? (candidate \"1I563_Yes3.exe\") \"No\")\n (check-equal? (candidate \"I563_Yes3.txtt\") \"No\")\n (check-equal? (candidate \"final..txt\") \"No\")\n (check-equal? (candidate \"final132\") \"No\")\n (check-equal? (candidate \"_f4indsartal132.\") \"No\")\n (check-equal? (candidate \".txt\") \"No\")\n (check-equal? (candidate \"s.\") \"No\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given two intervals,\n;; where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n;; The given intervals are closed which means that the interval (start, end)\n;; includes both start and end.\n;; For each given interval, it is assumed that its start is less or equal its end.\n;; Your task is to determine whether the length of intersection of these two \n;; intervals is a prime number.\n;; Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n;; which its length is 1, which not a prime number.\n;; If the length of the intersection is a prime number, return \"YES\",\n;; otherwise, return \"NO\".\n;; If the two intervals don't intersect, return \"NO\".\n;; [input/output] samples:\n;; intersection((1, 2), (2, 3)) ==> \"NO\"\n;; intersection((-1, 1), (0, 4)) ==> \"NO\"\n;; intersection((-3, -1), (-5, 5)) ==> \"YES\"\n(define (intersection interval1 interval2)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate intersection))\n (check-equal? (candidate (list 1 2) (list 2 3)) \"NO\")\n (check-equal? (candidate (list -1 1) (list 0 4)) \"NO\")\n (check-equal? (candidate (list -3 -1) (list -5 5)) \"YES\")\n (check-equal? (candidate (list -2 2) (list -4 0)) \"YES\")\n (check-equal? (candidate (list -11 2) (list -1 -1)) \"NO\")\n (check-equal? (candidate (list 1 2) (list 3 5)) \"NO\")\n (check-equal? (candidate (list 1 2) (list 1 2)) \"NO\")\n (check-equal? (candidate (list -2 -2) (list -3 -2)) \"NO\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return the largest prime factor of n. Assume n > 1 and is not a prime.\n;; >>> largest_prime_factor(13195)\n;; 29\n;; >>> largest_prime_factor(2048)\n;; 2\n(define (largest_prime_factor n)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate largest_prime_factor))\n (check-equal? (candidate 15) 5)\n (check-equal? (candidate 27) 3)\n (check-equal? (candidate 63) 7)\n (check-equal? (candidate 330) 11)\n (check-equal? (candidate 13195) 29)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a string, find out how many distinct characters (regardless of case) does it consist of\n;; >>> count_distinct_characters('xyzXYZ')\n;; 3\n;; >>> count_distinct_characters('Jerry')\n;; 4\n(define (count_distinct_characters string)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate count_distinct_characters))\n (check-equal? (candidate \"\") 0)\n (check-equal? (candidate \"abcde\") 5)\n (check-equal? (candidate \"abcdecadeCADE\") 5)\n (check-equal? (candidate \"aaaaAAAAaaaa\") 1)\n (check-equal? (candidate \"Jerry jERRY JeRRRY\") 5)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "rkt", - "prompt": "#lang racket\n\n;; You're given a list of deposit and withdrawal operations on a bank account that starts with\n;; zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n;; at that point function should return True. Otherwise it should return False.\n;; >>> below_zero([1, 2, 3])\n;; False\n;; >>> below_zero([1, 2, -4, 5])\n;; True\n(define (below_zero operations)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate below_zero))\n (check-equal? (candidate (list )) #f)\n (check-equal? (candidate (list 1 2 -3 1 2 -3)) #f)\n (check-equal? (candidate (list 1 2 -4 5 6)) #t)\n (check-equal? (candidate (list 1 -1 2 -2 5 -5 4 -4)) #f)\n (check-equal? (candidate (list 1 -1 2 -2 5 -5 4 -5)) #t)\n (check-equal? (candidate (list 1 -2 2 -2 5 -5 4 -4)) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "rkt", - "prompt": "#lang racket\n\n;; Find the shortest palindrome that begins with a supplied string.\n;; Algorithm idea is simple:\n;; - Find the longest postfix of supplied string that is a palindrome.\n;; - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n;; >>> make_palindrome('')\n;; ''\n;; >>> make_palindrome('cat')\n;; 'catac'\n;; >>> make_palindrome('cata')\n;; 'catac'\n(define (make_palindrome string)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate make_palindrome))\n (check-equal? (candidate \"\") \"\")\n (check-equal? (candidate \"x\") \"x\")\n (check-equal? (candidate \"xyz\") \"xyzyx\")\n (check-equal? (candidate \"xyx\") \"xyx\")\n (check-equal? (candidate \"jerry\") \"jerryrrej\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a positive integer, obtain its roman numeral equivalent as a string,\n;; and return it in lowercase.\n;; Restrictions: 1 <= num <= 1000\n;; Examples:\n;; >>> int_to_mini_roman(19) == 'xix'\n;; >>> int_to_mini_roman(152) == 'clii'\n;; >>> int_to_mini_roman(426) == 'cdxxvi'\n(define (int_to_mini_roman number)\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate int_to_mini_roman))\n (check-equal? (candidate 19) \"xix\")\n (check-equal? (candidate 152) \"clii\")\n (check-equal? (candidate 251) \"ccli\")\n (check-equal? (candidate 426) \"cdxxvi\")\n (check-equal? (candidate 500) \"d\")\n (check-equal? (candidate 1) \"i\")\n (check-equal? (candidate 4) \"iv\")\n (check-equal? (candidate 43) \"xliii\")\n (check-equal? (candidate 90) \"xc\")\n (check-equal? (candidate 94) \"xciv\")\n (check-equal? (candidate 532) \"dxxxii\")\n (check-equal? (candidate 900) \"cm\")\n (check-equal? (candidate 994) \"cmxciv\")\n (check-equal? (candidate 1000) \"m\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - } -] \ No newline at end of file diff --git a/data/rkt-remove.json b/data/rkt-remove.json deleted file mode 100644 index 87ae62622d341b9de853f25b550cae87a6816ad0..0000000000000000000000000000000000000000 --- a/data/rkt-remove.json +++ /dev/null @@ -1,2372 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "rkt", - "prompt": "#lang racket\n\n;; For a given number n, find the largest number that divides n evenly, smaller than n\n(define (largest_divisor n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate largest_divisor))\n (check-equal? (candidate 3) 1)\n (check-equal? (candidate 7) 1)\n (check-equal? (candidate 10) 5)\n (check-equal? (candidate 100) 50)\n (check-equal? (candidate 49) 7)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_47_median", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return median of elements in the list l.\n(define (median l)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate median))\n (check-equal? (candidate (list 3 1 2 4 5)) 3)\n (check-equal? (candidate (list -10 4 6 1000 10 20)) 8.0)\n (check-equal? (candidate (list 5)) 5)\n (check-equal? (candidate (list 6 5)) 5.5)\n (check-equal? (candidate (list 8 1 3 9 9 2 7)) 7)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return maximum element in the list.\n(define (max_element l)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate max_element))\n (check-equal? (candidate (list 1 2 3)) 3)\n (check-equal? (candidate (list 5 3 -5 2 -3 3 9 0 124 1 -10)) 124)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function which returns the largest index of an element which\n;; is not greater than or equal to the element immediately preceding it. If\n;; no such element exists then return -1. The given array will not contain\n;; duplicate values.\n;; Examples:\n(define (can_arrange arr)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate can_arrange))\n (check-equal? (candidate (list 1 2 4 3 5)) 3)\n (check-equal? (candidate (list 1 2 4 5)) -1)\n (check-equal? (candidate (list 1 4 2 5 6 7 8 9 10)) 2)\n (check-equal? (candidate (list 4 8 5 7 3)) 4)\n (check-equal? (candidate (list )) -1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function that returns True if the last character\n;; of a given string is an alphabetical character and is not\n;; a part of a word, and False otherwise.\n;; Note: \"word\" is a group of characters separated by space.\n;; Examples:\n(define (check_if_last_char_is_a_letter txt)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate check_if_last_char_is_a_letter))\n (check-equal? (candidate \"apple\") #f)\n (check-equal? (candidate \"apple pi e\") #t)\n (check-equal? (candidate \"eeeee\") #f)\n (check-equal? (candidate \"A\") #t)\n (check-equal? (candidate \"Pumpkin pie \") #f)\n (check-equal? (candidate \"Pumpkin pie 1\") #f)\n (check-equal? (candidate \"\") #f)\n (check-equal? (candidate \"eeeee e \") #f)\n (check-equal? (candidate \"apple pie\") #f)\n (check-equal? (candidate \"apple pi e \") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return true if a given number is prime, and false otherwise.\n(define (is_prime n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_prime))\n (check-equal? (candidate 6) #f)\n (check-equal? (candidate 101) #t)\n (check-equal? (candidate 11) #t)\n (check-equal? (candidate 13441) #t)\n (check-equal? (candidate 61) #t)\n (check-equal? (candidate 4) #f)\n (check-equal? (candidate 1) #f)\n (check-equal? (candidate 5) #t)\n (check-equal? (candidate 11) #t)\n (check-equal? (candidate 17) #t)\n (check-equal? (candidate 85) #f)\n (check-equal? (candidate 77) #f)\n (check-equal? (candidate 255379) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a list of positive integers x. return a sorted list of all \n;; elements that hasn't any even digit.\n;; Note: Returned list should be sorted in increasing order.\n;; For example:\n(define (unique_digits x)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate unique_digits))\n (check-equal? (candidate (list 15 33 1422 1)) (list 1 15 33))\n (check-equal? (candidate (list 152 323 1422 10)) (list ))\n (check-equal? (candidate (list 12345 2033 111 151)) (list 111 151))\n (check-equal? (candidate (list 135 103 31)) (list 31 135))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "rkt", - "prompt": "#lang racket\n\n;; Input are two strings a and b consisting only of 1s and 0s.\n;; Perform binary XOR on these inputs and return result also as a string.\n(define (string_xor a b)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate string_xor))\n (check-equal? (candidate \"111000\" \"101010\") \"010010\")\n (check-equal? (candidate \"1\" \"1\") \"0\")\n (check-equal? (candidate \"0101\" \"0000\") \"0101\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "rkt", - "prompt": "#lang racket\n\n;; sum_to_n is a function that sums numbers from 1 to n.\n(define (sum_to_n n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sum_to_n))\n (check-equal? (candidate 1) 1)\n (check-equal? (candidate 6) 21)\n (check-equal? (candidate 11) 66)\n (check-equal? (candidate 30) 465)\n (check-equal? (candidate 100) 5050)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a list of numbers, return the sum of squares of the numbers\n;; in the list that are odd. Ignore numbers that are negative or not integers.\n;; If the input list is empty, return 0.\n(define (double_the_difference lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate double_the_difference))\n (check-equal? (candidate (list )) 0)\n (check-equal? (candidate (list 5.0 4.0)) 25)\n (check-equal? (candidate (list 0.1 0.2 0.3)) 0)\n (check-equal? (candidate (list -10.0 -20.0 -30.0)) 0)\n (check-equal? (candidate (list -1.0 -2.0 8.0)) 0)\n (check-equal? (candidate (list 0.2 3.0 5.0)) 34)\n (check-equal? (candidate (list -9.0 -7.0 -5.0 -3.0 -1.0 1.0 3.0 5.0 7.0 9.0)) 165)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return length of given string\n(define (strlen string)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate strlen))\n (check-equal? (candidate \"\") 0)\n (check-equal? (candidate \"x\") 1)\n (check-equal? (candidate \"asdasnakj\") 9)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "rkt", - "prompt": "#lang racket\n\n;; You'll be given a string of words, and your task is to count the number\n;; of boredoms. A boredom is a sentence that starts with the word \"I\".\n;; Sentences are delimited by '.', '?' or '!'.\n;; For example:\n(define (is_bored S)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_bored))\n (check-equal? (candidate \"Hello world\") 0)\n (check-equal? (candidate \"Is the sky blue?\") 0)\n (check-equal? (candidate \"I love It !\") 1)\n (check-equal? (candidate \"bIt\") 0)\n (check-equal? (candidate \"I feel good today. I will be productive. will kill It\") 2)\n (check-equal? (candidate \"You and I are going for a walk\") 0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function vowels_count which takes a string representing\n;; a word as input and returns the number of vowels in the string.\n;; Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n;; vowel, but only when it is at the end of the given word.\n;; Example:\n(define (vowels_count s)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate vowels_count))\n (check-equal? (candidate \"abcde\") 2)\n (check-equal? (candidate \"Alone\") 3)\n (check-equal? (candidate \"key\") 2)\n (check-equal? (candidate \"bye\") 1)\n (check-equal? (candidate \"keY\") 2)\n (check-equal? (candidate \"bYe\") 1)\n (check-equal? (candidate \"ACEDY\") 3)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return n-th Fibonacci number.\n(define (fib n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate fib))\n (check-equal? (candidate 10) 55)\n (check-equal? (candidate 1) 1)\n (check-equal? (candidate 8) 21)\n (check-equal? (candidate 11) 89)\n (check-equal? (candidate 12) 144)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "rkt", - "prompt": "#lang racket\n\n;; Your task is to implement a function that will simplify the expression\n;; x * n. The function returns True if x * n evaluates to a whole number and False\n;; otherwise. Both x and n, are string representation of a fraction, and have the following format,\n;; / where both numerator and denominator are positive whole numbers.\n;; You can assume that x, and n are valid fractions, and do not have zero as denominator.\n(define (simplify x n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate simplify))\n (check-equal? (candidate \"1/5\" \"5/1\") #t)\n (check-equal? (candidate \"1/6\" \"2/1\") #f)\n (check-equal? (candidate \"5/1\" \"3/1\") #t)\n (check-equal? (candidate \"7/10\" \"10/2\") #f)\n (check-equal? (candidate \"2/10\" \"50/10\") #t)\n (check-equal? (candidate \"7/2\" \"4/2\") #t)\n (check-equal? (candidate \"11/6\" \"6/1\") #t)\n (check-equal? (candidate \"2/3\" \"5/2\") #f)\n (check-equal? (candidate \"5/2\" \"3/5\") #f)\n (check-equal? (candidate \"2/4\" \"8/4\") #t)\n (check-equal? (candidate \"2/4\" \"4/2\") #t)\n (check-equal? (candidate \"1/5\" \"5/1\") #t)\n (check-equal? (candidate \"1/5\" \"1/5\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a string s, count the number of uppercase vowels in even indices.\n;; For example:\n(define (count_upper s)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate count_upper))\n (check-equal? (candidate \"aBCdEf\") 1)\n (check-equal? (candidate \"abcdefg\") 0)\n (check-equal? (candidate \"dBBE\") 0)\n (check-equal? (candidate \"B\") 0)\n (check-equal? (candidate \"U\") 1)\n (check-equal? (candidate \"\") 0)\n (check-equal? (candidate \"EEEE\") 2)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a rectangular grid of wells. Each row represents a single well,\n;; and each 1 in a row represents a single unit of water.\n;; Each well has a corresponding bucket that can be used to extract water from it, \n;; and all buckets have the same capacity.\n;; Your task is to use the buckets to empty the wells.\n;; Output the number of times you need to lower the buckets.\n;; Example 1:\n;; Example 2:\n;; Example 3:\n;; Constraints:\n;; * all wells have the same length\n;; * 1 <= grid.length <= 10^2\n;; * 1 <= grid[:,1].length <= 10^2\n;; * grid[i][j] -> 0 | 1\n;; * 1 <= capacity <= 10\n(define (max_fill grid capacity)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate max_fill))\n (check-equal? (candidate (list (list 0 0 1 0) (list 0 1 0 0) (list 1 1 1 1)) 1) 6)\n (check-equal? (candidate (list (list 0 0 1 1) (list 0 0 0 0) (list 1 1 1 1) (list 0 1 1 1)) 2) 5)\n (check-equal? (candidate (list (list 0 0 0) (list 0 0 0)) 5) 0)\n (check-equal? (candidate (list (list 1 1 1 1) (list 1 1 1 1)) 2) 4)\n (check-equal? (candidate (list (list 1 1 1 1) (list 1 1 1 1)) 9) 2)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given an array arr of integers and a positive integer k, return a sorted list \n;; of length k with the maximum k numbers in arr.\n;; Example 1:\n;; Example 2:\n;; Example 3:\n;; Note:\n;; 1. The length of the array will be in the range of [1, 1000].\n;; 2. The elements in the array will be in the range of [-1000, 1000].\n;; 3. 0 <= k <= len(arr)\n(define (maximum arr k)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate maximum))\n (check-equal? (candidate (list -3 -4 5) 3) (list -4 -3 5))\n (check-equal? (candidate (list 4 -4 4) 2) (list 4 4))\n (check-equal? (candidate (list -3 2 1 2 -1 -2 1) 1) (list 2))\n (check-equal? (candidate (list 123 -123 20 0 1 2 -3) 3) (list 2 20 123))\n (check-equal? (candidate (list -123 20 0 1 2 -3) 4) (list 0 1 2 20))\n (check-equal? (candidate (list 5 15 0 3 -13 -8 0) 7) (list -13 -8 0 0 3 5 15))\n (check-equal? (candidate (list -1 0 2 5 3 -10) 2) (list 3 5))\n (check-equal? (candidate (list 1 0 5 -7) 1) (list 5))\n (check-equal? (candidate (list 4 -4) 2) (list -4 4))\n (check-equal? (candidate (list -10 10) 2) (list -10 10))\n (check-equal? (candidate (list 1 2 3 -23 243 -400 0) 0) (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that takes a message, and encodes in such a \n;; way that it swaps case of all letters, replaces all vowels in \n;; the message with the letter that appears 2 places ahead of that \n;; vowel in the english alphabet. \n;; Assume only letters. \n;; Examples:\n(define (encode message)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate encode))\n (check-equal? (candidate \"TEST\") \"tgst\")\n (check-equal? (candidate \"Mudasir\") \"mWDCSKR\")\n (check-equal? (candidate \"YES\") \"ygs\")\n (check-equal? (candidate \"This is a message\") \"tHKS KS C MGSSCGG\")\n (check-equal? (candidate \"I DoNt KnOw WhAt tO WrItE\") \"k dQnT kNqW wHcT Tq wRkTg\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "rkt", - "prompt": "#lang racket\n\n;; remove_vowels is a function that takes string and returns string without vowels.\n(define (remove_vowels text)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate remove_vowels))\n (check-equal? (candidate \"\") \"\")\n (check-equal? (candidate \"abcdef\nghijklm\") \"bcdf\nghjklm\")\n (check-equal? (candidate \"fedcba\") \"fdcb\")\n (check-equal? (candidate \"eeeee\") \"\")\n (check-equal? (candidate \"acBAA\") \"cB\")\n (check-equal? (candidate \"EcBOO\") \"cB\")\n (check-equal? (candidate \"ybcd\") \"ybcd\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return only positive numbers in the list.\n(define (get_positive l)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate get_positive))\n (check-equal? (candidate (list -1 -2 4 5 6)) (list 4 5 6))\n (check-equal? (candidate (list 5 3 -5 2 3 3 9 0 123 1 -10)) (list 5 3 2 3 3 9 123 1))\n (check-equal? (candidate (list -1 -2)) (list ))\n (check-equal? (candidate (list )) (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n(define (string_sequence n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate string_sequence))\n (check-equal? (candidate 0) \"0\")\n (check-equal? (candidate 3) \"0 1 2 3\")\n (check-equal? (candidate 10) \"0 1 2 3 4 5 6 7 8 9 10\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a positive integer n, you have to make a pile of n levels of stones.\n;; The first level has n stones.\n;; The number of stones in the next level is:\n;; - the next odd number if n is odd.\n;; - the next even number if n is even.\n;; Return the number of stones in each level in a list, where element at index\n;; i represents the number of stones in the level (i+1).\n;; Examples:\n(define (make_a_pile n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate make_a_pile))\n (check-equal? (candidate 3) (list 3 5 7))\n (check-equal? (candidate 4) (list 4 6 8 10))\n (check-equal? (candidate 5) (list 5 7 9 11 13))\n (check-equal? (candidate 6) (list 6 8 10 12 14 16))\n (check-equal? (candidate 8) (list 8 10 12 14 16 18 20 22))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "rkt", - "prompt": "#lang racket\n\n;; Task\n;; 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\n;; then check if the result string is palindrome.\n;; A string is called palindrome if it reads the same backward as forward.\n;; You should return a tuple containing the result string and True/False for the check.\n;; Example\n(define (reverse_delete s c)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate reverse_delete))\n (check-equal? (candidate \"abcde\" \"ae\") (list \"bcd\" #f))\n (check-equal? (candidate \"abcdef\" \"b\") (list \"acdef\" #f))\n (check-equal? (candidate \"abcdedcba\" \"ab\") (list \"cdedc\" #t))\n (check-equal? (candidate \"dwik\" \"w\") (list \"dik\" #f))\n (check-equal? (candidate \"a\" \"a\") (list \"\" #t))\n (check-equal? (candidate \"abcdedcba\" \"\") (list \"abcdedcba\" #t))\n (check-equal? (candidate \"abcdedcba\" \"v\") (list \"abcdedcba\" #t))\n (check-equal? (candidate \"vabba\" \"v\") (list \"abba\" #t))\n (check-equal? (candidate \"mamma\" \"mia\") (list \"\" #t))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "rkt", - "prompt": "#lang racket\n\n;; For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n(define (flip_case string)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate flip_case))\n (check-equal? (candidate \"\") \"\")\n (check-equal? (candidate \"Hello!\") \"hELLO!\")\n (check-equal? (candidate \"These violent delights have violent ends\") \"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a string s.\n;; if s[i] is a letter, reverse its case from lower to upper or vise versa, \n;; otherwise keep it as it is.\n;; If the string contains no letters, reverse the string.\n;; The function should return the resulted string.\n;; Examples\n(define (solve s)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate solve))\n (check-equal? (candidate \"AsDf\") \"aSdF\")\n (check-equal? (candidate \"1234\") \"4321\")\n (check-equal? (candidate \"ab\") \"AB\")\n (check-equal? (candidate \"#a@C\") \"#A@c\")\n (check-equal? (candidate \"#AsdfW^45\") \"#aSDFw^45\")\n (check-equal? (candidate \"#6@2\") \"2@6#\")\n (check-equal? (candidate \"#$a^D\") \"#$A^d\")\n (check-equal? (candidate \"#ccc\") \"#CCC\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "rkt", - "prompt": "#lang racket\n\n;; Filter an input list of strings only for ones that start with a given prefix.\n(define (filter_by_prefix strings prefix)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate filter_by_prefix))\n (check-equal? (candidate (list ) \"john\") (list ))\n (check-equal? (candidate (list \"xxx\" \"asd\" \"xxy\" \"john doe\" \"xxxAAA\" \"xxx\") \"xxx\") (list \"xxx\" \"xxxAAA\" \"xxx\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "rkt", - "prompt": "#lang racket\n\n;; This function takes two positive numbers x and y and returns the\n;; biggest even integer number that is in the range [x, y] inclusive. If \n;; there's no such number, then the function should return -1.\n;; For example:\n(define (choose_num x y)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate choose_num))\n (check-equal? (candidate 12 15) 14)\n (check-equal? (candidate 13 12) -1)\n (check-equal? (candidate 33 12354) 12354)\n (check-equal? (candidate 5234 5233) -1)\n (check-equal? (candidate 6 29) 28)\n (check-equal? (candidate 27 10) -1)\n (check-equal? (candidate 7 7) -1)\n (check-equal? (candidate 546 546) 546)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a string representing a sentence,\n;; the sentence contains some words separated by a space,\n;; and you have to return a string that contains the words from the original sentence,\n;; whose lengths are prime numbers,\n;; the order of the words in the new string should be the same as the original one.\n;; Example 1:\n;; Example 2:\n;; Constraints:\n;; * 1 <= len(sentence) <= 100\n;; * sentence contains only letters\n(define (words_in_sentence sentence)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate words_in_sentence))\n (check-equal? (candidate \"This is a test\") \"is\")\n (check-equal? (candidate \"lets go for swimming\") \"go for\")\n (check-equal? (candidate \"there is no place available here\") \"there is no place\")\n (check-equal? (candidate \"Hi I am Hussein\") \"Hi am Hussein\")\n (check-equal? (candidate \"go for it\") \"go for it\")\n (check-equal? (candidate \"here\") \"\")\n (check-equal? (candidate \"here is\") \"is\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "rkt", - "prompt": "#lang racket\n\n;; Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n(define (intersperse numbers delimeter)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate intersperse))\n (check-equal? (candidate (list ) 7) (list ))\n (check-equal? (candidate (list 5 6 3 2) 8) (list 5 8 6 8 3 8 2))\n (check-equal? (candidate (list 2 2 2) 2) (list 2 2 2 2 2))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "rkt", - "prompt": "#lang racket\n\n;; Your task is to write a function that returns true if a number x is a simple\n;; power of n and false in other cases.\n;; x is a simple power of n if n**int=x\n;; For example:\n(define (is_simple_power x n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_simple_power))\n (check-equal? (candidate 16 2) #t)\n (check-equal? (candidate 143214 16) #f)\n (check-equal? (candidate 4 2) #t)\n (check-equal? (candidate 9 3) #t)\n (check-equal? (candidate 16 4) #t)\n (check-equal? (candidate 24 2) #f)\n (check-equal? (candidate 128 4) #f)\n (check-equal? (candidate 12 6) #f)\n (check-equal? (candidate 1 1) #t)\n (check-equal? (candidate 1 12) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that returns true if the given number is the multiplication of 3 prime numbers\n;; and false otherwise.\n;; Knowing that (a) is less then 100. \n;; Example:\n;; 30 = 2 * 3 * 5\n(define (is_multiply_prime a)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_multiply_prime))\n (check-equal? (candidate 5) #f)\n (check-equal? (candidate 30) #t)\n (check-equal? (candidate 8) #t)\n (check-equal? (candidate 10) #f)\n (check-equal? (candidate 125) #t)\n (check-equal? (candidate 105) #t)\n (check-equal? (candidate 126) #f)\n (check-equal? (candidate 729) #f)\n (check-equal? (candidate 891) #f)\n (check-equal? (candidate 1001) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given the lengths of the three sides of a triangle. Return True if the three\n;; sides form a right-angled triangle, False otherwise.\n;; A right-angled triangle is a triangle in which one angle is right angle or \n;; 90 degree.\n;; Example:\n(define (right_angle_triangle a b c)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate right_angle_triangle))\n (check-equal? (candidate 3 4 5) #t)\n (check-equal? (candidate 1 2 3) #f)\n (check-equal? (candidate 10 6 8) #t)\n (check-equal? (candidate 2 2 2) #f)\n (check-equal? (candidate 7 24 25) #t)\n (check-equal? (candidate 10 5 7) #f)\n (check-equal? (candidate 5 12 13) #t)\n (check-equal? (candidate 15 8 17) #t)\n (check-equal? (candidate 48 55 73) #t)\n (check-equal? (candidate 1 1 1) #f)\n (check-equal? (candidate 2 2 10) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function that takes 3 numbers.\n;; Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n;; Returns false in any other cases.\n;; Examples\n(define (any_int x y z)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate any_int))\n (check-equal? (candidate 2 3 1) #t)\n (check-equal? (candidate 2.5 2 3) #f)\n (check-equal? (candidate 1.5 5 3.5) #f)\n (check-equal? (candidate 2 6 2) #f)\n (check-equal? (candidate 4 2 2) #t)\n (check-equal? (candidate 2.2 2.2 2.2) #f)\n (check-equal? (candidate -4 6 2) #t)\n (check-equal? (candidate 2 1 1) #t)\n (check-equal? (candidate 3 4 7) #t)\n (check-equal? (candidate 3.0 4 7) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "rkt", - "prompt": "#lang racket\n\n;; This function takes a list l and returns a list l' such that\n;; l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n;; to the values of the corresponding indicies of l, but sorted.\n(define (sort_third l)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sort_third))\n (check-equal? (candidate (list 5 6 3 4 8 9 2)) (list 2 6 3 4 8 9 5))\n (check-equal? (candidate (list 5 8 3 4 6 9 2)) (list 2 8 3 4 6 9 5))\n (check-equal? (candidate (list 5 6 9 4 8 3 2)) (list 2 6 9 4 8 3 5))\n (check-equal? (candidate (list 5 6 3 4 8 9 2 1)) (list 2 6 3 4 8 9 5 1))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_53_add", - "language": "rkt", - "prompt": "#lang racket\n\n;; Add two numbers x and y\n(define (add x y)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate add))\n (check-equal? (candidate 0 1) 1)\n (check-equal? (candidate 1 0) 1)\n (check-equal? (candidate 2 3) 5)\n (check-equal? (candidate 5 7) 12)\n (check-equal? (candidate 7 5) 12)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_69_search", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n;; zero, and has a frequency greater than or equal to the value of the integer itself. \n;; The frequency of an integer is the number of times it appears in the list.\n;; If no such a value exist, return -1.\n;; Examples:\n(define (search lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate search))\n (check-equal? (candidate (list 5 5 5 5 1)) 1)\n (check-equal? (candidate (list 4 1 4 1 4 4)) 4)\n (check-equal? (candidate (list 3 3)) -1)\n (check-equal? (candidate (list 8 8 8 8 8 8 8 8)) 8)\n (check-equal? (candidate (list 2 3 3 2 2)) 2)\n (check-equal? (candidate (list 2 7 8 8 4 8 7 3 9 6 5 10 4 3 6 7 1 7 4 10 8 1)) 1)\n (check-equal? (candidate (list 3 2 8 2)) 2)\n (check-equal? (candidate (list 6 7 1 8 8 10 5 8 5 3 10)) 1)\n (check-equal? (candidate (list 8 8 3 6 5 6 4)) -1)\n (check-equal? (candidate (list 6 9 6 7 1 4 7 1 8 8 9 8 10 10 8 4 10 4 10 1 2 9 5 7 9)) 1)\n (check-equal? (candidate (list 1 9 10 1 3)) 1)\n (check-equal? (candidate (list 6 9 7 5 8 7 5 3 7 5 10 10 3 6 10 2 8 6 5 4 9 5 3 10)) 5)\n (check-equal? (candidate (list 1)) 1)\n (check-equal? (candidate (list 8 8 10 6 4 3 5 8 2 4 2 8 4 6 10 4 2 1 10 2 1 1 5)) 4)\n (check-equal? (candidate (list 2 10 4 8 2 10 5 1 2 9 5 5 6 3 8 6 4 10)) 2)\n (check-equal? (candidate (list 1 6 10 1 6 9 10 8 6 8 7 3)) 1)\n (check-equal? (candidate (list 9 2 4 1 5 1 5 2 5 7 7 7 3 10 1 5 4 2 8 4 1 9 10 7 10 2 8 10 9 4)) 4)\n (check-equal? (candidate (list 2 6 4 2 8 7 5 6 4 10 4 6 3 7 8 8 3 1 4 2 2 10 7)) 4)\n (check-equal? (candidate (list 9 8 6 10 2 6 10 2 7 8 10 3 8 2 6 2 3 1)) 2)\n (check-equal? (candidate (list 5 5 3 9 5 6 3 2 8 5 6 10 10 6 8 4 10 7 7 10 8)) -1)\n (check-equal? (candidate (list 10)) -1)\n (check-equal? (candidate (list 9 7 7 2 4 7 2 10 9 7 5 7 2)) 2)\n (check-equal? (candidate (list 5 4 10 2 1 1 10 3 6 1 8)) 1)\n (check-equal? (candidate (list 7 9 9 9 3 4 1 5 9 1 2 1 1 10 7 5 6 7 6 7 7 6)) 1)\n (check-equal? (candidate (list 3 10 10 9 2)) -1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that takes a string and returns True if the string\n;; length is a prime number or False otherwise\n;; Examples\n(define (prime_length string)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate prime_length))\n (check-equal? (candidate \"Hello\") #t)\n (check-equal? (candidate \"abcdcba\") #t)\n (check-equal? (candidate \"kittens\") #t)\n (check-equal? (candidate \"orange\") #f)\n (check-equal? (candidate \"wow\") #t)\n (check-equal? (candidate \"world\") #t)\n (check-equal? (candidate \"MadaM\") #t)\n (check-equal? (candidate \"Wow\") #t)\n (check-equal? (candidate \"\") #f)\n (check-equal? (candidate \"HI\") #t)\n (check-equal? (candidate \"go\") #t)\n (check-equal? (candidate \"gogo\") #f)\n (check-equal? (candidate \"aaaaaaaaaaaaaaa\") #f)\n (check-equal? (candidate \"Madam\") #t)\n (check-equal? (candidate \"M\") #f)\n (check-equal? (candidate \"0\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_58_common", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return sorted unique common elements for two lists.\n(define (common l1 l2)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate common))\n (check-equal? (candidate (list 1 4 3 34 653 2 5) (list 5 7 1 5 9 653 121)) (list 1 5 653))\n (check-equal? (candidate (list 5 3 2 8) (list 3 2)) (list 2 3))\n (check-equal? (candidate (list 4 3 2 8) (list 3 2 4)) (list 2 3 4))\n (check-equal? (candidate (list 4 3 2 8) (list )) (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "rkt", - "prompt": "#lang racket\n\n;; The Brazilian factorial is defined as:\n;; brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n;; where n > 0\n;; For example:\n;; The function will receive an integer as input and should return the special\n;; factorial of this integer.\n(define (special_factorial n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate special_factorial))\n (check-equal? (candidate 4) 288)\n (check-equal? (candidate 5) 34560)\n (check-equal? (candidate 7) 125411328000)\n (check-equal? (candidate 1) 1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "rkt", - "prompt": "#lang racket\n\n;; In this problem, you will implement a function that takes two lists of numbers,\n;; and determines whether it is possible to perform an exchange of elements\n;; between them to make lst1 a list of only even numbers.\n;; There is no limit on the number of exchanged elements between lst1 and lst2.\n;; If it is possible to exchange elements between the lst1 and lst2 to make\n;; all the elements of lst1 to be even, return \"YES\".\n;; Otherwise, return \"NO\".\n;; For example:\n;; It is assumed that the input lists will be non-empty.\n(define (exchange lst1 lst2)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate exchange))\n (check-equal? (candidate (list 1 2 3 4) (list 1 2 3 4)) \"YES\")\n (check-equal? (candidate (list 1 2 3 4) (list 1 5 3 4)) \"NO\")\n (check-equal? (candidate (list 1 2 3 4) (list 2 1 4 3)) \"YES\")\n (check-equal? (candidate (list 5 7 3) (list 2 6 4)) \"YES\")\n (check-equal? (candidate (list 5 7 3) (list 2 6 3)) \"NO\")\n (check-equal? (candidate (list 3 2 6 1 8 9) (list 3 5 5 1 1 1)) \"NO\")\n (check-equal? (candidate (list 100 200) (list 200 200)) \"YES\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a non-empty array of integers arr and an integer k, return\n;; the sum of the elements with at most two digits from the first k elements of arr.\n;; Example:\n;; Constraints:\n;; 1. 1 <= len(arr) <= 100\n;; 2. 1 <= k <= len(arr)\n(define (add_elements arr k)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate add_elements))\n (check-equal? (candidate (list 1 -2 -3 41 57 76 87 88 99) 3) -4)\n (check-equal? (candidate (list 111 121 3 4000 5 6) 2) 0)\n (check-equal? (candidate (list 11 21 3 90 5 6 7 8 9) 4) 125)\n (check-equal? (candidate (list 111 21 3 4000 5 6 7 8 9) 4) 24)\n (check-equal? (candidate (list 1) 1) 1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "rkt", - "prompt": "#lang racket\n\n;; A simple program which should return the value of x if n is \n;; a prime number and should return the value of y otherwise.\n;; Examples:\n(define (x_or_y n x y)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate x_or_y))\n (check-equal? (candidate 7 34 12) 34)\n (check-equal? (candidate 15 8 5) 5)\n (check-equal? (candidate 3 33 5212) 33)\n (check-equal? (candidate 1259 3 52) 3)\n (check-equal? (candidate 7919 -1 12) -1)\n (check-equal? (candidate 3609 1245 583) 583)\n (check-equal? (candidate 91 56 129) 129)\n (check-equal? (candidate 6 34 1234) 1234)\n (check-equal? (candidate 1 2 0) 0)\n (check-equal? (candidate 2 2 0) 2)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given length of a side and high return area for a triangle.\n(define (triangle_area a h)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate triangle_area))\n (check-equal? (candidate 5 3) 7.5)\n (check-equal? (candidate 2 2) 2.0)\n (check-equal? (candidate 10 8) 40.0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "rkt", - "prompt": "#lang racket\n\n;; Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n;; the last couple centuries. However, what people don't know is Tribonacci sequence.\n;; Tribonacci sequence is defined by the recurrence:\n;; tri(1) = 3\n;; tri(n) = 1 + n / 2, if n is even.\n;; tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n;; For example:\n;; tri(2) = 1 + (2 / 2) = 2\n;; tri(4) = 3\n;; tri(3) = tri(2) + tri(1) + tri(4)\n;; = 2 + 3 + 3 = 8 \n;; You are given a non-negative integer number n, you have to a return a list of the \n;; first n + 1 numbers of the Tribonacci sequence.\n;; Examples:\n(define (tri n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate tri))\n (check-equal? (candidate 3) (list 1 3 2 8))\n (check-equal? (candidate 4) (list 1 3 2 8 3))\n (check-equal? (candidate 5) (list 1 3 2 8 3 15))\n (check-equal? (candidate 6) (list 1 3 2 8 3 15 4))\n (check-equal? (candidate 7) (list 1 3 2 8 3 15 4 24))\n (check-equal? (candidate 8) (list 1 3 2 8 3 15 4 24 5))\n (check-equal? (candidate 9) (list 1 3 2 8 3 15 4 24 5 35))\n (check-equal? (candidate 20) (list 1 3 2 8 3 15 4 24 5 35 6 48 7 63 8 80 9 99 10 120 11))\n (check-equal? (candidate 0) (list 1))\n (check-equal? (candidate 1) (list 1 3))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a list of two strings, both strings consist of open\n;; parentheses '(' or close parentheses ')' only.\n;; Your job is to check if it is possible to concatenate the two strings in\n;; some order, that the resulting string will be good.\n;; A string S is considered to be good if and only if all parentheses in S\n;; are balanced. For example: the string '(())()' is good, while the string\n;; '())' is not.\n;; Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n;; Examples:\n(define (match_parens lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate match_parens))\n (check-equal? (candidate (list \"()(\" \")\")) \"Yes\")\n (check-equal? (candidate (list \")\" \")\")) \"No\")\n (check-equal? (candidate (list \"(()(())\" \"())())\")) \"No\")\n (check-equal? (candidate (list \")())\" \"(()()(\")) \"Yes\")\n (check-equal? (candidate (list \"(())))\" \"(()())((\")) \"Yes\")\n (check-equal? (candidate (list \"()\" \"())\")) \"No\")\n (check-equal? (candidate (list \"(()(\" \"()))()\")) \"Yes\")\n (check-equal? (candidate (list \"((((\" \"((())\")) \"No\")\n (check-equal? (candidate (list \")(()\" \"(()(\")) \"No\")\n (check-equal? (candidate (list \")(\" \")(\")) \"No\")\n (check-equal? (candidate (list \"(\" \")\")) \"Yes\")\n (check-equal? (candidate (list \")\" \"(\")) \"Yes\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "rkt", - "prompt": "#lang racket\n\n;; From a list of integers, remove all elements that occur more than once.\n;; Keep order of elements left the same as in the input.\n(define (remove_duplicates numbers)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate remove_duplicates))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 1 2 3 4)) (list 1 2 3 4))\n (check-equal? (candidate (list 1 2 3 2 4 3 5)) (list 1 4 5))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return a greatest common divisor of two integers a and b\n(define (greatest_common_divisor a b)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate greatest_common_divisor))\n (check-equal? (candidate 3 7) 1)\n (check-equal? (candidate 10 15) 5)\n (check-equal? (candidate 49 14) 7)\n (check-equal? (candidate 144 60) 12)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "rkt", - "prompt": "#lang racket\n\n;; Checks if given string is a palindrome\n(define (is_palindrome text)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_palindrome))\n (check-equal? (candidate \"\") #t)\n (check-equal? (candidate \"aba\") #t)\n (check-equal? (candidate \"aaaaa\") #t)\n (check-equal? (candidate \"zbcd\") #f)\n (check-equal? (candidate \"xywyx\") #t)\n (check-equal? (candidate \"xywyz\") #f)\n (check-equal? (candidate \"xywzx\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "rkt", - "prompt": "#lang racket\n\n;; xs represent coefficients of a polynomial.\n;; xs[0] + xs[1] * x + xs[2] * x^2 + ....\n;; Return derivative of this polynomial in the same form.\n(define (derivative xs)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate derivative))\n (check-equal? (candidate (list 3 1 2 4 5)) (list 1 4 12 20))\n (check-equal? (candidate (list 1 2 3)) (list 2 6))\n (check-equal? (candidate (list 3 2 1)) (list 2 2))\n (check-equal? (candidate (list 3 2 1 0 4)) (list 2 2 0 16))\n (check-equal? (candidate (list 1)) (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "rkt", - "prompt": "#lang racket\n\n;; In this task, you will be given a string that represents a number of apples and oranges \n;; that are distributed in a basket of fruit this basket contains \n;; apples, oranges, and mango fruits. Given the string that represents the total number of \n;; the oranges and apples and an integer that represent the total number of the fruits \n;; in the basket return the number of the mango fruits in the basket.\n;; for examble:\n(define (fruit_distribution s n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate fruit_distribution))\n (check-equal? (candidate \"5 apples and 6 oranges\" 19) 8)\n (check-equal? (candidate \"5 apples and 6 oranges\" 21) 10)\n (check-equal? (candidate \"0 apples and 1 oranges\" 3) 2)\n (check-equal? (candidate \"1 apples and 0 oranges\" 3) 2)\n (check-equal? (candidate \"2 apples and 3 oranges\" 100) 95)\n (check-equal? (candidate \"2 apples and 3 oranges\" 5) 0)\n (check-equal? (candidate \"1 apples and 100 oranges\" 120) 19)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that takes an integer a and returns True \n;; if this ingeger is a cube of some integer number.\n;; Note: you may assume the input is always valid.\n;; Examples:\n(define (iscube a)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate iscube))\n (check-equal? (candidate 1) #t)\n (check-equal? (candidate 2) #f)\n (check-equal? (candidate -1) #t)\n (check-equal? (candidate 64) #t)\n (check-equal? (candidate 180) #f)\n (check-equal? (candidate 1000) #t)\n (check-equal? (candidate 0) #t)\n (check-equal? (candidate 1729) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "rkt", - "prompt": "#lang racket\n\n;; In this Kata, you have to sort an array of non-negative integers according to\n;; number of ones in their binary representation in ascending order.\n;; For similar number of ones, sort based on decimal value.\n;; It must be implemented like this:\n(define (sort_array arr)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sort_array))\n (check-equal? (candidate (list 1 5 2 3 4)) (list 1 2 4 3 5))\n (check-equal? (candidate (list -2 -3 -4 -5 -6)) (list -4 -2 -6 -5 -3))\n (check-equal? (candidate (list 1 0 2 3 4)) (list 0 1 2 4 3))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 2 5 77 4 5 3 5 7 2 3 4)) (list 2 2 4 4 3 3 5 5 5 7 77))\n (check-equal? (candidate (list 3 6 44 12 32 5)) (list 32 3 5 6 12 44))\n (check-equal? (candidate (list 2 4 8 16 32)) (list 2 4 8 16 32))\n (check-equal? (candidate (list 2 4 8 16 32)) (list 2 4 8 16 32))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a list of strings, where each string consists of only digits, return a list.\n;; Each element i of the output should be \"the number of odd elements in the\n;; string i of the input.\" where all the i's should be replaced by the number\n;; of odd digits in the i'th string of the input.\n(define (odd_count lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate odd_count))\n (check-equal? (candidate (list \"1234567\")) (list \"the number of odd elements 4n the str4ng 4 of the 4nput.\"))\n (check-equal? (candidate (list \"3\" \"11111111\")) (list \"the number of odd elements 1n the str1ng 1 of the 1nput.\" \"the number of odd elements 8n the str8ng 8 of the 8nput.\"))\n (check-equal? (candidate (list \"271\" \"137\" \"314\")) (list \"the number of odd elements 2n the str2ng 2 of the 2nput.\" \"the number of odd elements 3n the str3ng 3 of the 3nput.\" \"the number of odd elements 2n the str2ng 2 of the 2nput.\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "rkt", - "prompt": "#lang racket\n\n;; brackets is a string of \"(\" and \")\".\n;; return True if every opening bracket has a corresponding closing bracket.\n(define (correct_bracketing brackets)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate correct_bracketing))\n (check-equal? (candidate \"()\") #t)\n (check-equal? (candidate \"(()())\") #t)\n (check-equal? (candidate \"()()(()())()\") #t)\n (check-equal? (candidate \"()()((()()())())(()()(()))\") #t)\n (check-equal? (candidate \"((()())))\") #f)\n (check-equal? (candidate \")(()\") #f)\n (check-equal? (candidate \"(\") #f)\n (check-equal? (candidate \"((((\") #f)\n (check-equal? (candidate \")\") #f)\n (check-equal? (candidate \"(()\") #f)\n (check-equal? (candidate \"()()(()())())(()\") #f)\n (check-equal? (candidate \"()()(()())()))()\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "rkt", - "prompt": "#lang racket\n\n;; Task\n;; Write a function that takes a string as input and returns the sum of the upper characters only'\n;; ASCII codes.\n;; Examples:\n(define (digitSum s)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate digitSum))\n (check-equal? (candidate \"\") 0)\n (check-equal? (candidate \"abAB\") 131)\n (check-equal? (candidate \"abcCd\") 67)\n (check-equal? (candidate \"helloE\") 69)\n (check-equal? (candidate \"woArBld\") 131)\n (check-equal? (candidate \"aAaaaXa\") 153)\n (check-equal? (candidate \" How are yOu?\") 151)\n (check-equal? (candidate \"You arE Very Smart\") 327)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that accepts a list of strings as a parameter,\n;; deletes the strings that have odd lengths from it,\n;; and returns the resulted list with a sorted order,\n;; The list is always a list of strings and never an array of numbers,\n;; and it may contain duplicates.\n;; The order of the list should be ascending by length of each word, and you\n;; should return the list sorted by that rule.\n;; If two words have the same length, sort the list alphabetically.\n;; The function should return a list of strings in sorted order.\n;; You may assume that all words will have the same length.\n;; For example:\n(define (sorted_list_sum lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sorted_list_sum))\n (check-equal? (candidate (list \"aa\" \"a\" \"aaa\")) (list \"aa\"))\n (check-equal? (candidate (list \"school\" \"AI\" \"asdf\" \"b\")) (list \"AI\" \"asdf\" \"school\"))\n (check-equal? (candidate (list \"d\" \"b\" \"c\" \"a\")) (list ))\n (check-equal? (candidate (list \"d\" \"dcba\" \"abcd\" \"a\")) (list \"abcd\" \"dcba\"))\n (check-equal? (candidate (list \"AI\" \"ai\" \"au\")) (list \"AI\" \"ai\" \"au\"))\n (check-equal? (candidate (list \"a\" \"b\" \"b\" \"c\" \"c\" \"a\")) (list ))\n (check-equal? (candidate (list \"aaaa\" \"bbbb\" \"dd\" \"cc\")) (list \"cc\" \"dd\" \"aaaa\" \"bbbb\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given an array arr of integers and you need to return\n;; sum of magnitudes of integers multiplied by product of all signs\n;; of each number in the array, represented by 1, -1 or 0.\n;; Note: return None for empty arr.\n;; Example:\n(define (prod_signs arr)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate prod_signs))\n (check-equal? (candidate (list 1 2 2 -4)) -9)\n (check-equal? (candidate (list 0 1)) 0)\n (check-equal? (candidate (list 1 1 1 2 3 -1 1)) -10)\n (check-equal? (candidate (list )) #f)\n (check-equal? (candidate (list 2 4 1 2 -1 -1 9)) 20)\n (check-equal? (candidate (list -1 1 -1 1)) 4)\n (check-equal? (candidate (list -1 1 1 1)) -4)\n (check-equal? (candidate (list -1 1 1 0)) 0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return list with elements incremented by 1.\n(define (incr_list l)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate incr_list))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 3 2 1)) (list 4 3 2))\n (check-equal? (candidate (list 5 2 5 2 3 3 9 0 123)) (list 6 3 6 3 4 4 10 1 124))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "rkt", - "prompt": "#lang racket\n\n;; From a given list of integers, generate a list of rolling maximum element found until given moment\n;; in the sequence.\n(define (rolling_max numbers)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate rolling_max))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 1 2 3 4)) (list 1 2 3 4))\n (check-equal? (candidate (list 4 3 2 1)) (list 4 4 4 4))\n (check-equal? (candidate (list 3 2 3 100 3)) (list 3 3 3 100 100))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "rkt", - "prompt": "#lang racket\n\n;; Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n;; separate those group into separate strings and return the list of those.\n;; Separate groups are balanced (each open brace is properly closed) and not nested within each other\n;; Ignore any spaces in the input string.\n(define (separate_paren_groups paren_string)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate separate_paren_groups))\n (check-equal? (candidate \"(()()) ((())) () ((())()())\") (list \"(()())\" \"((()))\" \"()\" \"((())()())\"))\n (check-equal? (candidate \"() (()) ((())) (((())))\") (list \"()\" \"(())\" \"((()))\" \"(((())))\"))\n (check-equal? (candidate \"(()(())((())))\") (list \"(()(())((())))\"))\n (check-equal? (candidate \"( ) (( )) (( )( ))\") (list \"()\" \"(())\" \"(()())\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "rkt", - "prompt": "#lang racket\n\n;; You will be given a string of words separated by commas or spaces. Your task is\n;; to split the string into words and return an array of the words.\n;; For example:\n(define (words_string s)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate words_string))\n (check-equal? (candidate \"Hi, my name is John\") (list \"Hi\" \"my\" \"name\" \"is\" \"John\"))\n (check-equal? (candidate \"One, two, three, four, five, six\") (list \"One\" \"two\" \"three\" \"four\" \"five\" \"six\"))\n (check-equal? (candidate \"Hi, my name\") (list \"Hi\" \"my\" \"name\"))\n (check-equal? (candidate \"One,, two, three, four, five, six,\") (list \"One\" \"two\" \"three\" \"four\" \"five\" \"six\"))\n (check-equal? (candidate \"\") (list ))\n (check-equal? (candidate \"ahmed , gamal\") (list \"ahmed\" \"gamal\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function that takes integers, floats, or strings representing\n;; real numbers, and returns the larger variable in its given variable type.\n;; Return None if the values are equal.\n;; Note: If a real number is represented as a string, the floating point might be . or ,\n(define (compare_one a b)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate compare_one))\n (check-equal? (candidate 1 2) 2)\n (check-equal? (candidate 1 2.5) 2.5)\n (check-equal? (candidate 2 3) 3)\n (check-equal? (candidate 5 6) 6)\n (check-equal? (candidate 1 \"2,3\") \"2,3\")\n (check-equal? (candidate \"5,1\" \"6\") \"6\")\n (check-equal? (candidate \"1\" \"2\") \"2\")\n (check-equal? (candidate \"1\" 1) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "rkt", - "prompt": "#lang racket\n\n;; Filter given list of any python values only for integers\n(define (filter_integers values)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate filter_integers))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 4 #hash() (list ) 23.2 9 \"adasd\")) (list 4 9))\n (check-equal? (candidate (list 3 \"c\" 3 3 \"a\" \"b\")) (list 3 3 3))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "rkt", - "prompt": "#lang racket\n\n;; This function takes a list l and returns a list l' such that\n;; l' is identical to l in the odd indicies, while its values at the even indicies are equal\n;; to the values of the even indicies of l, but sorted.\n(define (sort_even l)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sort_even))\n (check-equal? (candidate (list 1 2 3)) (list 1 2 3))\n (check-equal? (candidate (list 5 3 -5 2 -3 3 9 0 123 1 -10)) (list -10 3 -5 2 -3 3 5 0 9 1 123))\n (check-equal? (candidate (list 5 8 -12 4 23 2 3 11 12 -10)) (list -12 8 3 4 5 2 12 11 23 -10))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "rkt", - "prompt": "#lang racket\n\n;; I think we all remember that feeling when the result of some long-awaited\n;; event is finally known. The feelings and thoughts you have at that moment are\n;; definitely worth noting down and comparing.\n;; Your task is to determine if a person correctly guessed the results of a number of matches.\n;; You are given two arrays of scores and guesses of equal length, where each index shows a match. \n;; Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n;; the value is 0, and if not, the value is the absolute difference between the guess and the score.\n;; example:\n(define (compare game guess)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate compare))\n (check-equal? (candidate (list 1 2 3 4 5 1) (list 1 2 3 4 2 -2)) (list 0 0 0 0 3 3))\n (check-equal? (candidate (list 0 0 0 0 0 0) (list 0 0 0 0 0 0)) (list 0 0 0 0 0 0))\n (check-equal? (candidate (list 1 2 3) (list -1 -2 -3)) (list 2 4 6))\n (check-equal? (candidate (list 1 2 3 5) (list -1 2 3 4)) (list 2 0 0 1))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a positive integer n, return a tuple that has the number of even and odd\n;; integer palindromes that fall within the range(1, n), inclusive.\n;; Example 1:\n;; Explanation:\n;; Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n;; Example 2:\n;; Explanation:\n;; Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n;; Note:\n;; 1. 1 <= n <= 10^3\n;; 2. returned tuple has the number of even and odd integer palindromes respectively.\n(define (even_odd_palindrome n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate even_odd_palindrome))\n (check-equal? (candidate 123) (list 8 13))\n (check-equal? (candidate 12) (list 4 6))\n (check-equal? (candidate 3) (list 1 2))\n (check-equal? (candidate 63) (list 6 8))\n (check-equal? (candidate 25) (list 5 6))\n (check-equal? (candidate 19) (list 4 6))\n (check-equal? (candidate 9) (list 4 5))\n (check-equal? (candidate 1) (list 0 1))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "rkt", - "prompt": "#lang racket\n\n;; The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n;; fib4(0) -> 0\n;; fib4(1) -> 0\n;; fib4(2) -> 2\n;; fib4(3) -> 0\n;; fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n;; Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n(define (fib4 n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate fib4))\n (check-equal? (candidate 5) 4)\n (check-equal? (candidate 8) 28)\n (check-equal? (candidate 10) 104)\n (check-equal? (candidate 12) 386)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given two positive integers a and b, return the even digits between a\n;; and b, in ascending order.\n;; For example:\n(define (generate_integers a b)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate generate_integers))\n (check-equal? (candidate 2 10) (list 2 4 6 8))\n (check-equal? (candidate 10 2) (list 2 4 6 8))\n (check-equal? (candidate 132 2) (list 2 4 6 8))\n (check-equal? (candidate 17 89) (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "rkt", - "prompt": "#lang racket\n\n;; For a given list of input numbers, calculate Mean Absolute Deviation\n;; around the mean of this dataset.\n;; Mean Absolute Deviation is the average absolute difference between each\n;; element and a centerpoint (mean in this case):\n;; MAD = average | x - x_mean |\n(define (mean_absolute_deviation numbers)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate mean_absolute_deviation))\n (check-equal? (candidate (list 1.0 2.0)) 0.5)\n (check-equal? (candidate (list 1.0 2.0 3.0 4.0)) 1.0)\n (check-equal? (candidate (list 1.0 2.0 3.0 4.0 5.0)) 1.2)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function encrypt that takes a string as an argument and\n;; returns a string encrypted with the alphabet being rotated. \n;; The alphabet should be rotated in a manner such that the letters \n;; shift down by two multiplied to two places.\n;; For example:\n(define (encrypt s)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate encrypt))\n (check-equal? (candidate \"hi\") \"lm\")\n (check-equal? (candidate \"asdfghjkl\") \"ewhjklnop\")\n (check-equal? (candidate \"gf\") \"kj\")\n (check-equal? (candidate \"et\") \"ix\")\n (check-equal? (candidate \"faewfawefaewg\") \"jeiajeaijeiak\")\n (check-equal? (candidate \"hellomyfriend\") \"lippsqcjvmirh\")\n (check-equal? (candidate \"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\") \"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\")\n (check-equal? (candidate \"a\") \"e\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n;; The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n;; as follows: start with any positive integer n. Then each term is obtained from the \n;; previous term as follows: if the previous term is even, the next term is one half of \n;; the previous term. If the previous term is odd, the next term is 3 times the previous\n;; term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n;; Note: \n;; 1. Collatz(1) is [1].\n;; 2. returned list sorted in increasing order.\n;; For example:\n;; get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n(define (get_odd_collatz n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate get_odd_collatz))\n (check-equal? (candidate 14) (list 1 5 7 11 13 17))\n (check-equal? (candidate 5) (list 1 5))\n (check-equal? (candidate 12) (list 1 3 5))\n (check-equal? (candidate 1) (list 1))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "rkt", - "prompt": "#lang racket\n\n;; Find how many times a given substring can be found in the original string. Count overlaping cases.\n(define (how_many_times string substring)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate how_many_times))\n (check-equal? (candidate \"\" \"x\") 0)\n (check-equal? (candidate \"xyxyxyx\" \"x\") 4)\n (check-equal? (candidate \"cacacacac\" \"cac\") 4)\n (check-equal? (candidate \"john doe\" \"john\") 1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "rkt", - "prompt": "#lang racket\n\n;; We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n;; numbers in the array will be randomly ordered. Your task is to determine if\n;; it is possible to get an array sorted in non-decreasing order by performing \n;; the following operation on the given array:\n;; You are allowed to perform right shift operation any number of times.\n;; One right shift operation means shifting all elements of the array by one\n;; position in the right direction. The last element of the array will be moved to\n;; the starting position in the array i.e. 0th index. \n;; If it is possible to obtain the sorted array by performing the above operation\n;; then return True else return False.\n;; If the given array is empty then return True.\n;; Note: The given list is guaranteed to have unique elements.\n;; For Example:\n;; Explanation: By performin 2 right shift operations, non-decreasing order can\n;; be achieved for the given array.\n;; Explanation:It is not possible to get non-decreasing order for the given\n;; array by performing any number of right shift operations.\n(define (move_one_ball arr)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate move_one_ball))\n (check-equal? (candidate (list 3 4 5 1 2)) #t)\n (check-equal? (candidate (list 3 5 10 1 2)) #t)\n (check-equal? (candidate (list 4 3 1 2)) #f)\n (check-equal? (candidate (list 3 5 4 1 2)) #f)\n (check-equal? (candidate (list )) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function which sorts the given list of integers\n;; in ascending order according to the sum of their digits.\n;; Note: if there are several items with similar sum of their digits,\n;; order them based on their index in original list.\n;; For example:\n(define (order_by_points nums)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate order_by_points))\n (check-equal? (candidate (list 1 11 -1 -11 -12)) (list -1 -11 1 -12 11))\n (check-equal? (candidate (list 1234 423 463 145 2 423 423 53 6 37 3457 3 56 0 46)) (list 0 2 3 6 53 423 423 423 1234 145 37 46 56 463 3457))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 1 -11 -32 43 54 -98 2 -3)) (list -3 -32 -98 -11 1 2 43 54))\n (check-equal? (candidate (list 1 2 3 4 5 6 7 8 9 10 11)) (list 1 10 2 11 3 4 5 6 7 8 9))\n (check-equal? (candidate (list 0 6 6 -76 -21 23 4)) (list -76 -21 0 4 23 6 6))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return list of prime factors of given integer in the order from smallest to largest.\n;; Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n;; Input number should be equal to the product of all factors\n(define (factorize n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate factorize))\n (check-equal? (candidate 2) (list 2))\n (check-equal? (candidate 4) (list 2 2))\n (check-equal? (candidate 8) (list 2 2 2))\n (check-equal? (candidate 57) (list 3 19))\n (check-equal? (candidate 3249) (list 3 3 19 19))\n (check-equal? (candidate 185193) (list 3 3 3 19 19 19))\n (check-equal? (candidate 20577) (list 3 19 19 19))\n (check-equal? (candidate 18) (list 2 3 3))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return True if all numbers in the list l are below threshold t.\n(define (below_threshold l t)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate below_threshold))\n (check-equal? (candidate (list 1 2 4 10) 100) #t)\n (check-equal? (candidate (list 1 20 4 10) 5) #f)\n (check-equal? (candidate (list 1 20 4 10) 21) #t)\n (check-equal? (candidate (list 1 20 4 10) 22) #t)\n (check-equal? (candidate (list 1 8 4 10) 11) #t)\n (check-equal? (candidate (list 1 8 4 10) 10) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given two positive integers n and m, and your task is to compute the\n;; average of the integers from n through m (including n and m). \n;; Round the answer to the nearest integer and convert that to binary.\n;; If n is greater than m, return -1.\n;; Example:\n(define (rounded_avg n m)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate rounded_avg))\n (check-equal? (candidate 1 5) \"0b11\")\n (check-equal? (candidate 7 13) \"0b1010\")\n (check-equal? (candidate 964 977) \"0b1111001010\")\n (check-equal? (candidate 996 997) \"0b1111100100\")\n (check-equal? (candidate 560 851) \"0b1011000010\")\n (check-equal? (candidate 185 546) \"0b101101110\")\n (check-equal? (candidate 362 496) \"0b110101101\")\n (check-equal? (candidate 350 902) \"0b1001110010\")\n (check-equal? (candidate 197 233) \"0b11010111\")\n (check-equal? (candidate 7 5) -1)\n (check-equal? (candidate 5 1) -1)\n (check-equal? (candidate 5 5) \"0b101\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "rkt", - "prompt": "#lang racket\n\n;; Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n;; For each of the group, output the deepest level of nesting of parentheses.\n;; E.g. (()()) has maximum two levels of nesting while ((())) has three.\n(define (parse_nested_parens paren_string)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate parse_nested_parens))\n (check-equal? (candidate \"(()()) ((())) () ((())()())\") (list 2 3 1 3))\n (check-equal? (candidate \"() (()) ((())) (((())))\") (list 1 2 3 4))\n (check-equal? (candidate \"(()(())((())))\") (list 4))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n;; Examples\n(define (solution lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate solution))\n (check-equal? (candidate (list 5 8 7 1)) 12)\n (check-equal? (candidate (list 3 3 3 3 3)) 9)\n (check-equal? (candidate (list 30 13 24 321)) 0)\n (check-equal? (candidate (list 5 9)) 5)\n (check-equal? (candidate (list 2 4 8)) 0)\n (check-equal? (candidate (list 30 13 23 32)) 23)\n (check-equal? (candidate (list 3 13 2 9)) 3)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a positive integer n. You have to create an integer array a of length n.\n;; For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n;; Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n;; and a[i] + a[j] + a[k] is a multiple of 3.\n;; Example :\n;; Explanation: \n;; a = [1, 3, 7, 13, 21]\n;; The only valid triple is (1, 7, 13).\n(define (get_max_triples n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate get_max_triples))\n (check-equal? (candidate 5) 1)\n (check-equal? (candidate 6) 4)\n (check-equal? (candidate 10) 36)\n (check-equal? (candidate 100) 53361)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "rkt", - "prompt": "#lang racket\n\n;; There are eight planets in our solar system: the closerst to the Sun \n;; is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n;; Uranus, Neptune.\n;; Write a function that takes two planet names as strings planet1 and planet2. \n;; The function should return a tuple containing all planets whose orbits are \n;; located between the orbit of planet1 and the orbit of planet2, sorted by \n;; the proximity to the sun. \n;; The function should return an empty tuple if planet1 or planet2\n;; are not correct planet names. \n;; Examples\n(define (bf planet1 planet2)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate bf))\n (check-equal? (candidate \"Jupiter\" \"Neptune\") (list \"Saturn\" \"Uranus\"))\n (check-equal? (candidate \"Earth\" \"Mercury\") (list \"Venus\"))\n (check-equal? (candidate \"Mercury\" \"Uranus\") (list \"Venus\" \"Earth\" \"Mars\" \"Jupiter\" \"Saturn\"))\n (check-equal? (candidate \"Neptune\" \"Venus\") (list \"Earth\" \"Mars\" \"Jupiter\" \"Saturn\" \"Uranus\"))\n (check-equal? (candidate \"Earth\" \"Earth\") (list ))\n (check-equal? (candidate \"Mars\" \"Earth\") (list ))\n (check-equal? (candidate \"Jupiter\" \"Makemake\") (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a list of integers.\n;; Write a function next_smallest() that returns the 2nd smallest element of the list.\n;; Return None if there is no such element.\n(define (next_smallest lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate next_smallest))\n (check-equal? (candidate (list 1 2 3 4 5)) 2)\n (check-equal? (candidate (list 5 1 4 3 2)) 2)\n (check-equal? (candidate (list )) #f)\n (check-equal? (candidate (list 1 1)) #f)\n (check-equal? (candidate (list 1 1 1 1 0)) 1)\n (check-equal? (candidate (list 1 1)) #f)\n (check-equal? (candidate (list -35 34 12 -45)) -35)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "rkt", - "prompt": "#lang racket\n\n;; Input is a space-delimited string of numberals from 'zero' to 'nine'.\n;; Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n;; Return the string with numbers sorted from smallest to largest\n(define (sort_numbers numbers)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sort_numbers))\n (check-equal? (candidate \"\") \"\")\n (check-equal? (candidate \"three\") \"three\")\n (check-equal? (candidate \"three five nine\") \"three five nine\")\n (check-equal? (candidate \"five zero four seven nine eight\") \"zero four five seven eight nine\")\n (check-equal? (candidate \"six five four three two one zero\") \"zero one two three four five six\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n(define (cycpattern_check a b)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate cycpattern_check))\n (check-equal? (candidate \"xyzw\" \"xyw\") #f)\n (check-equal? (candidate \"yello\" \"ell\") #t)\n (check-equal? (candidate \"whattup\" \"ptut\") #f)\n (check-equal? (candidate \"efef\" \"fee\") #t)\n (check-equal? (candidate \"abab\" \"aabb\") #f)\n (check-equal? (candidate \"winemtt\" \"tinem\") #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "rkt", - "prompt": "#lang racket\n\n;; You will be given a number in decimal form and your task is to convert it to\n;; binary format. The function should return a string, with each character representing a binary\n;; number. Each character in the string will be '0' or '1'.\n;; There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n;; The extra characters are there to help with the format.\n;; Examples:\n(define (decimal_to_binary decimal)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate decimal_to_binary))\n (check-equal? (candidate 0) \"db0db\")\n (check-equal? (candidate 32) \"db100000db\")\n (check-equal? (candidate 103) \"db1100111db\")\n (check-equal? (candidate 15) \"db1111db\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "rkt", - "prompt": "#lang racket\n\n;; Filter an input list of strings only for ones that contain given substring\n(define (filter_by_substring strings substring)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate filter_by_substring))\n (check-equal? (candidate (list ) \"john\") (list ))\n (check-equal? (candidate (list \"xxx\" \"asd\" \"xxy\" \"john doe\" \"xxxAAA\" \"xxx\") \"xxx\") (list \"xxx\" \"xxxAAA\" \"xxx\"))\n (check-equal? (candidate (list \"xxx\" \"asd\" \"aaaxxy\" \"john doe\" \"xxxAAA\" \"xxx\") \"xx\") (list \"xxx\" \"aaaxxy\" \"xxxAAA\" \"xxx\"))\n (check-equal? (candidate (list \"grunt\" \"trumpet\" \"prune\" \"gruesome\") \"run\") (list \"grunt\" \"prune\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given an integer. return a tuple that has the number of even and odd digits respectively.\n;; Example:\n(define (even_odd_count num)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate even_odd_count))\n (check-equal? (candidate 7) (list 0 1))\n (check-equal? (candidate -78) (list 1 1))\n (check-equal? (candidate 3452) (list 2 2))\n (check-equal? (candidate 346211) (list 3 3))\n (check-equal? (candidate -345821) (list 3 3))\n (check-equal? (candidate -2) (list 1 0))\n (check-equal? (candidate -45347) (list 2 3))\n (check-equal? (candidate 0) (list 1 0))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that accepts a list of strings.\n;; The list contains different words. Return the word with maximum number\n;; of unique characters. If multiple strings have maximum number of unique\n;; characters, return the one which comes first in lexicographical order.\n(define (find_max words)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate find_max))\n (check-equal? (candidate (list \"name\" \"of\" \"string\")) \"string\")\n (check-equal? (candidate (list \"name\" \"enam\" \"game\")) \"enam\")\n (check-equal? (candidate (list \"aaaaaaa\" \"bb\" \"cc\")) \"aaaaaaa\")\n (check-equal? (candidate (list \"abc\" \"cba\")) \"abc\")\n (check-equal? (candidate (list \"play\" \"this\" \"game\" \"of\" \"footbott\")) \"footbott\")\n (check-equal? (candidate (list \"we\" \"are\" \"gonna\" \"rock\")) \"gonna\")\n (check-equal? (candidate (list \"we\" \"are\" \"a\" \"mad\" \"nation\")) \"nation\")\n (check-equal? (candidate (list \"this\" \"is\" \"a\" \"prrk\")) \"this\")\n (check-equal? (candidate (list \"b\")) \"b\")\n (check-equal? (candidate (list \"play\" \"play\" \"play\")) \"play\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function that returns a tuple (a, b), where 'a' is\n;; the largest of negative integers, and 'b' is the smallest\n;; of positive integers in a list.\n;; If there is no negative or positive integers, return them as None.\n;; Examples:\n(define (largest_smallest_integers lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate largest_smallest_integers))\n (check-equal? (candidate (list 2 4 1 3 5 7)) (list #f 1))\n (check-equal? (candidate (list 2 4 1 3 5 7 0)) (list #f 1))\n (check-equal? (candidate (list 1 3 2 4 5 6 -2)) (list -2 1))\n (check-equal? (candidate (list 4 5 3 6 2 7 -7)) (list -7 2))\n (check-equal? (candidate (list 7 3 8 4 9 2 5 -9)) (list -9 2))\n (check-equal? (candidate (list )) (list #f #f))\n (check-equal? (candidate (list 0)) (list #f #f))\n (check-equal? (candidate (list -1 -3 -5 -6)) (list -1 #f))\n (check-equal? (candidate (list -1 -3 -5 -6 0)) (list -1 #f))\n (check-equal? (candidate (list -6 -4 -4 -3 1)) (list -3 1))\n (check-equal? (candidate (list -6 -4 -4 -3 -100 1)) (list -3 1))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "rkt", - "prompt": "#lang racket\n\n;; \"Given an array representing a branch of a tree that has non-negative integer nodes\n;; your task is to pluck one of the nodes and return it.\n;; The plucked node should be the node with the smallest even value.\n;; If multiple nodes with the same smallest even value are found return the node that has smallest index.\n;; The plucked node should be returned in a list, [ smalest_value, its index ],\n;; If there are no even values or the given array is empty, return [].\n;; Example 1:\n;; Explanation: 2 has the smallest even value, and 2 has the smallest index.\n;; Example 2:\n;; Explanation: 2 has the smallest even value, and 2 has the smallest index.\n;; Example 3:\n;; Example 4:\n;; Explanation: 0 is the smallest value, but there are two zeros,\n;; so we will choose the first zero, which has the smallest index.\n;; Constraints:\n;; * 1 <= nodes.length <= 10000\n;; * 0 <= node.value\n(define (pluck arr)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate pluck))\n (check-equal? (candidate (list 4 2 3)) (list 2 1))\n (check-equal? (candidate (list 1 2 3)) (list 2 1))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 5 0 3 0 4 2)) (list 0 1))\n (check-equal? (candidate (list 1 2 3 0 5 3)) (list 0 3))\n (check-equal? (candidate (list 5 4 8 4 8)) (list 4 1))\n (check-equal? (candidate (list 7 6 7 1)) (list 6 1))\n (check-equal? (candidate (list 7 9 7 1)) (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function count_nums which takes an array of integers and returns\n;; the number of elements which has a sum of digits > 0.\n;; If a number is negative, then its first signed digit will be negative:\n;; e.g. -123 has signed digits -1, 2, and 3.\n(define (count_nums arr)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate count_nums))\n (check-equal? (candidate (list )) 0)\n (check-equal? (candidate (list -1 -2 0)) 0)\n (check-equal? (candidate (list 1 1 2 -2 3 4 5)) 6)\n (check-equal? (candidate (list 1 6 9 -6 0 1 5)) 5)\n (check-equal? (candidate (list 1 100 98 -7 1 -1)) 4)\n (check-equal? (candidate (list 12 23 34 -45 -56 0)) 5)\n (check-equal? (candidate (list 0 1)) 1)\n (check-equal? (candidate (list 1)) 1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n;; each cell of the grid contains a value. Every integer in the range [1, N * N]\n;; inclusive appears exactly once on the cells of the grid.\n;; You have to find the minimum path of length k in the grid. You can start\n;; from any cell, and in each step you can move to any of the neighbor cells,\n;; in other words, you can go to cells which share an edge with you current\n;; cell.\n;; Please note that a path of length k means visiting exactly k cells (not\n;; necessarily distinct).\n;; You CANNOT go off the grid.\n;; A path A (of length k) is considered less than a path B (of length k) if\n;; after making the ordered lists of the values on the cells that A and B go\n;; through (let's call them lst_A and lst_B), lst_A is lexicographically less\n;; than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n;; such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n;; lst_A[j] = lst_B[j].\n;; It is guaranteed that the answer is unique.\n;; Return an ordered list of the values on the cells that the minimum path go through.\n;; Examples:\n(define (minPath grid k)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate minPath))\n (check-equal? (candidate (list (list 1 2 3) (list 4 5 6) (list 7 8 9)) 3) (list 1 2 1))\n (check-equal? (candidate (list (list 5 9 3) (list 4 1 6) (list 7 8 2)) 1) (list 1))\n (check-equal? (candidate (list (list 1 2 3 4) (list 5 6 7 8) (list 9 10 11 12) (list 13 14 15 16)) 4) (list 1 2 1 2))\n (check-equal? (candidate (list (list 6 4 13 10) (list 5 7 12 1) (list 3 16 11 15) (list 8 14 9 2)) 7) (list 1 10 1 10 1 10 1))\n (check-equal? (candidate (list (list 8 14 9 2) (list 6 4 13 15) (list 5 7 1 12) (list 3 10 11 16)) 5) (list 1 7 1 7 1))\n (check-equal? (candidate (list (list 11 8 7 2) (list 5 16 14 4) (list 9 3 15 6) (list 12 13 10 1)) 9) (list 1 6 1 6 1 6 1 6 1))\n (check-equal? (candidate (list (list 12 13 10 1) (list 9 3 15 6) (list 5 16 14 4) (list 11 8 7 2)) 12) (list 1 6 1 6 1 6 1 6 1 6 1 6))\n (check-equal? (candidate (list (list 2 7 4) (list 3 1 5) (list 6 8 9)) 8) (list 1 3 1 3 1 3 1 3))\n (check-equal? (candidate (list (list 6 1 5) (list 3 8 9) (list 2 7 4)) 8) (list 1 5 1 5 1 5 1 5))\n (check-equal? (candidate (list (list 1 2) (list 3 4)) 10) (list 1 2 1 2 1 2 1 2 1 2))\n (check-equal? (candidate (list (list 1 3) (list 3 2)) 10) (list 1 3 1 3 1 3 1 3 1 3))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given list of integers, return list in strange order.\n;; Strange sorting, is when you start with the minimum value,\n;; then maximum of the remaining integers, then minimum and so on.\n;; Examples:\n(define (strange_sort_list lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate strange_sort_list))\n (check-equal? (candidate (list 1 2 3 4)) (list 1 4 2 3))\n (check-equal? (candidate (list 5 6 7 8 9)) (list 5 9 6 8 7))\n (check-equal? (candidate (list 1 2 3 4 5)) (list 1 5 2 4 3))\n (check-equal? (candidate (list 5 6 7 8 9 1)) (list 1 9 5 8 6 7))\n (check-equal? (candidate (list 5 5 5 5)) (list 5 5 5 5))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 1 2 3 4 5 6 7 8)) (list 1 8 2 7 3 6 4 5))\n (check-equal? (candidate (list 0 2 2 2 5 5 -5 -5)) (list -5 5 -5 5 0 2 2 2))\n (check-equal? (candidate (list 111111)) (list 111111))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a string 'text', return its md5 hash equivalent string.\n;; If 'text' is an empty string, return None.\n(define (string_to_md5 text)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate string_to_md5))\n (check-equal? (candidate \"Hello world\") \"3e25960a79dbc69b674cd4ec67a72c62\")\n (check-equal? (candidate \"\") #f)\n (check-equal? (candidate \"A B C\") \"0ef78513b0cb8cef12743f5aeb35f888\")\n (check-equal? (candidate \"password\") \"5f4dcc3b5aa765d61d8327deb882cf99\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a word. Your task is to find the closest vowel that stands between \n;; two consonants from the right side of the word (case sensitive).\n;; Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n;; find any vowel met the above condition. \n;; You may assume that the given string contains English letter only.\n;; Example:\n(define (get_closest_vowel word)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate get_closest_vowel))\n (check-equal? (candidate \"yogurt\") \"u\")\n (check-equal? (candidate \"full\") \"u\")\n (check-equal? (candidate \"easy\") \"\")\n (check-equal? (candidate \"eAsy\") \"\")\n (check-equal? (candidate \"ali\") \"\")\n (check-equal? (candidate \"bad\") \"a\")\n (check-equal? (candidate \"most\") \"o\")\n (check-equal? (candidate \"ab\") \"\")\n (check-equal? (candidate \"ba\") \"\")\n (check-equal? (candidate \"quick\") \"\")\n (check-equal? (candidate \"anime\") \"i\")\n (check-equal? (candidate \"Asia\") \"\")\n (check-equal? (candidate \"Above\") \"o\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "rkt", - "prompt": "#lang racket\n\n;; Change numerical base of input number x to base.\n;; return string representation after the conversion.\n;; base numbers are less than 10.\n(define (change_base x base)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate change_base))\n (check-equal? (candidate 8 3) \"22\")\n (check-equal? (candidate 9 3) \"100\")\n (check-equal? (candidate 234 2) \"11101010\")\n (check-equal? (candidate 16 2) \"10000\")\n (check-equal? (candidate 8 2) \"1000\")\n (check-equal? (candidate 7 2) \"111\")\n (check-equal? (candidate 2 3) \"2\")\n (check-equal? (candidate 3 4) \"3\")\n (check-equal? (candidate 4 5) \"4\")\n (check-equal? (candidate 5 6) \"5\")\n (check-equal? (candidate 6 7) \"6\")\n (check-equal? (candidate 7 8) \"7\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "rkt", - "prompt": "#lang racket\n\n;; Check if in given list of numbers, are any two numbers closer to each other than\n;; given threshold.\n(define (has_close_elements numbers threshold)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate has_close_elements))\n (check-equal? (candidate (list 1.0 2.0 3.9 4.0 5.0 2.2) 0.3) #t)\n (check-equal? (candidate (list 1.0 2.0 3.9 4.0 5.0 2.2) 0.05) #f)\n (check-equal? (candidate (list 1.0 2.0 5.9 4.0 5.0) 0.95) #t)\n (check-equal? (candidate (list 1.0 2.0 5.9 4.0 5.0) 0.8) #f)\n (check-equal? (candidate (list 1.0 2.0 3.0 4.0 5.0 2.0) 0.1) #t)\n (check-equal? (candidate (list 1.1 2.2 3.1 4.1 5.1) 1.0) #t)\n (check-equal? (candidate (list 1.1 2.2 3.1 4.1 5.1) 0.5) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function that takes a string as input which contains only square brackets.\n;; The function should return True if and only if there is a valid subsequence of brackets \n;; where at least one bracket in the subsequence is nested.\n(define (is_nested string)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_nested))\n (check-equal? (candidate \"[[]]\") #t)\n (check-equal? (candidate \"[]]]]]]][[[[[]\") #f)\n (check-equal? (candidate \"[][]\") #f)\n (check-equal? (candidate \"[]\") #f)\n (check-equal? (candidate \"[[[[]]]]\") #t)\n (check-equal? (candidate \"[]]]]]]]]]]\") #f)\n (check-equal? (candidate \"[][][[]]\") #t)\n (check-equal? (candidate \"[[]\") #f)\n (check-equal? (candidate \"[]]\") #f)\n (check-equal? (candidate \"[[]][[\") #t)\n (check-equal? (candidate \"[[][]]\") #t)\n (check-equal? (candidate \"\") #f)\n (check-equal? (candidate \"[[[[[[[[\") #f)\n (check-equal? (candidate \"]]]]]]]]\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "rkt", - "prompt": "#lang racket\n\n;; Concatenate list of strings into a single string\n(define (concatenate strings)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate concatenate))\n (check-equal? (candidate (list )) \"\")\n (check-equal? (candidate (list \"x\" \"y\" \"z\")) \"xyz\")\n (check-equal? (candidate (list \"x\" \"y\" \"z\" \"w\" \"k\")) \"xyzwk\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "rkt", - "prompt": "#lang racket\n\n;; prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n(define (prime_fib n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate prime_fib))\n (check-equal? (candidate 1) 2)\n (check-equal? (candidate 2) 3)\n (check-equal? (candidate 3) 5)\n (check-equal? (candidate 4) 13)\n (check-equal? (candidate 5) 89)\n (check-equal? (candidate 6) 233)\n (check-equal? (candidate 7) 1597)\n (check-equal? (candidate 8) 28657)\n (check-equal? (candidate 9) 514229)\n (check-equal? (candidate 10) 433494437)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "rkt", - "prompt": "#lang racket\n\n;; From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n;; other and return them in order (smaller number, larger number).\n(define (find_closest_elements numbers)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate find_closest_elements))\n (check-equal? (candidate (list 1.0 2.0 3.9 4.0 5.0 2.2)) (list 3.9 4.0))\n (check-equal? (candidate (list 1.0 2.0 5.9 4.0 5.0)) (list 5.0 5.9))\n (check-equal? (candidate (list 1.0 2.0 3.0 4.0 5.0 2.2)) (list 2.0 2.2))\n (check-equal? (candidate (list 1.0 2.0 3.0 4.0 5.0 2.0)) (list 2.0 2.0))\n (check-equal? (candidate (list 1.1 2.2 3.1 4.1 5.1)) (list 2.2 3.1))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "rkt", - "prompt": "#lang racket\n\n;; You have been tasked to write a function that receives \n;; a hexadecimal number as a string and counts the number of hexadecimal \n;; digits that are primes (prime number, or a prime, is a natural number \n;; greater than 1 that is not a product of two smaller natural numbers).\n;; Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n;; Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n;; So you have to determine a number of the following digits: 2, 3, 5, 7, \n;; B (=decimal 11), D (=decimal 13).\n;; Note: you may assume the input is always correct or empty string, \n;; and symbols A,B,C,D,E,F are always uppercase.\n;; Examples:\n(define (hex_key num)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate hex_key))\n (check-equal? (candidate \"AB\") 1)\n (check-equal? (candidate \"1077E\") 2)\n (check-equal? (candidate \"ABED1A33\") 4)\n (check-equal? (candidate \"2020\") 2)\n (check-equal? (candidate \"123456789ABCDEF0\") 6)\n (check-equal? (candidate \"112233445566778899AABBCCDDEEFF00\") 12)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "rkt", - "prompt": "#lang racket\n\n;; Complete the function that takes two integers and returns \n;; the product of their unit digits.\n;; Assume the input is always valid.\n;; Examples:\n(define (multiply a b)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate multiply))\n (check-equal? (candidate 148 412) 16)\n (check-equal? (candidate 19 28) 72)\n (check-equal? (candidate 2020 1851) 0)\n (check-equal? (candidate 14 -15) 20)\n (check-equal? (candidate 76 67) 42)\n (check-equal? (candidate 17 27) 49)\n (check-equal? (candidate 0 1) 0)\n (check-equal? (candidate 0 0) 0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given list of numbers (of at least two elements), apply a linear transform to that list,\n;; such that the smallest number will become 0 and the largest will become 1\n(define (rescale_to_unit numbers)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate rescale_to_unit))\n (check-equal? (candidate (list 2.0 49.9)) (list 0.0 1.0))\n (check-equal? (candidate (list 100.0 49.9)) (list 1.0 0.0))\n (check-equal? (candidate (list 1.0 2.0 3.0 4.0 5.0)) (list 0.0 0.25 0.5 0.75 1.0))\n (check-equal? (candidate (list 2.0 1.0 5.0 3.0 4.0)) (list 0.25 0.0 1.0 0.5 0.75))\n (check-equal? (candidate (list 12.0 11.0 15.0 13.0 14.0)) (list 0.25 0.0 1.0 0.5 0.75))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a positive integer n, return the product of the odd digits.\n;; Return 0 if all digits are even.\n;; For example:\n(define (digits n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate digits))\n (check-equal? (candidate 5) 5)\n (check-equal? (candidate 54) 5)\n (check-equal? (candidate 120) 1)\n (check-equal? (candidate 5014) 5)\n (check-equal? (candidate 98765) 315)\n (check-equal? (candidate 5576543) 2625)\n (check-equal? (candidate 2468) 0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "rkt", - "prompt": "#lang racket\n\n;; You will be given the name of a class (a string) and a list of extensions.\n;; The extensions are to be used to load additional classes to the class. The\n;; strength of the extension is as follows: Let CAP be the number of the uppercase\n;; letters in the extension's name, and let SM be the number of lowercase letters \n;; in the extension's name, the strength is given by the fraction CAP - SM. \n;; You should find the strongest extension and return a string in this \n;; format: ClassName.StrongestExtensionName.\n;; If there are two or more extensions with the same strength, you should\n;; choose the one that comes first in the list.\n;; For example, if you are given \"Slices\" as the class and a list of the\n;; extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n;; return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n;; (its strength is -1).\n;; Example:\n(define (Strongest_Extension class_name extensions)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate Strongest_Extension))\n (check-equal? (candidate \"Watashi\" (list \"tEN\" \"niNE\" \"eIGHt8OKe\")) \"Watashi.eIGHt8OKe\")\n (check-equal? (candidate \"Boku123\" (list \"nani\" \"NazeDa\" \"YEs.WeCaNe\" \"32145tggg\")) \"Boku123.YEs.WeCaNe\")\n (check-equal? (candidate \"__YESIMHERE\" (list \"t\" \"eMptY\" \"nothing\" \"zeR00\" \"NuLl__\" \"123NoooneB321\")) \"__YESIMHERE.NuLl__\")\n (check-equal? (candidate \"K\" (list \"Ta\" \"TAR\" \"t234An\" \"cosSo\")) \"K.TAR\")\n (check-equal? (candidate \"__HAHA\" (list \"Tab\" \"123\" \"781345\" \"-_-\")) \"__HAHA.123\")\n (check-equal? (candidate \"YameRore\" (list \"HhAas\" \"okIWILL123\" \"WorkOut\" \"Fails\" \"-_-\")) \"YameRore.okIWILL123\")\n (check-equal? (candidate \"finNNalLLly\" (list \"Die\" \"NowW\" \"Wow\" \"WoW\")) \"finNNalLLly.WoW\")\n (check-equal? (candidate \"_\" (list \"Bb\" \"91245\")) \"_.Bb\")\n (check-equal? (candidate \"Sp\" (list \"671235\" \"Bb\")) \"Sp.671235\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a string representing a space separated lowercase letters, return a dictionary\n;; of the letter with the most repetition and containing the corresponding count.\n;; If several letters have the same occurrence, return all of them.\n;; Example:\n(define (histogram test)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate histogram))\n (check-equal? (candidate \"a b b a\") #hash((\"a\" . 2) (\"b\" . 2)))\n (check-equal? (candidate \"a b c a b\") #hash((\"a\" . 2) (\"b\" . 2)))\n (check-equal? (candidate \"a b c d g\") #hash((\"a\" . 1) (\"b\" . 1) (\"c\" . 1) (\"d\" . 1) (\"g\" . 1)))\n (check-equal? (candidate \"r t g\") #hash((\"r\" . 1) (\"t\" . 1) (\"g\" . 1)))\n (check-equal? (candidate \"b b b b a\") #hash((\"b\" . 4)))\n (check-equal? (candidate \"r t g\") #hash((\"r\" . 1) (\"t\" . 1) (\"g\" . 1)))\n (check-equal? (candidate \"\") #hash())\n (check-equal? (candidate \"a\") #hash((\"a\" . 1)))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "rkt", - "prompt": "#lang racket\n\n;; pairs_sum_to_zero takes a list of integers as an input.\n;; it returns True if there are two distinct elements in the list that\n;; sum to zero, and False otherwise.\n(define (pairs_sum_to_zero l)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate pairs_sum_to_zero))\n (check-equal? (candidate (list 1 3 5 0)) #f)\n (check-equal? (candidate (list 1 3 -2 1)) #f)\n (check-equal? (candidate (list 1 2 3 7)) #f)\n (check-equal? (candidate (list 2 4 -5 3 5 7)) #t)\n (check-equal? (candidate (list 1)) #f)\n (check-equal? (candidate (list -3 9 -1 3 2 30)) #t)\n (check-equal? (candidate (list -3 9 -1 3 2 31)) #t)\n (check-equal? (candidate (list -3 9 -1 4 2 30)) #f)\n (check-equal? (candidate (list -3 9 -1 4 2 31)) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that accepts two lists of strings and returns the list that has \n;; total number of chars in the all strings of the list less than the other list.\n;; if the two lists have the same number of chars, return the first list.\n;; Examples\n(define (total_match lst1 lst2)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate total_match))\n (check-equal? (candidate (list ) (list )) (list ))\n (check-equal? (candidate (list \"hi\" \"admin\") (list \"hi\" \"hi\")) (list \"hi\" \"hi\"))\n (check-equal? (candidate (list \"hi\" \"admin\") (list \"hi\" \"hi\" \"admin\" \"project\")) (list \"hi\" \"admin\"))\n (check-equal? (candidate (list \"4\") (list \"1\" \"2\" \"3\" \"4\" \"5\")) (list \"4\"))\n (check-equal? (candidate (list \"hi\" \"admin\") (list \"hI\" \"Hi\")) (list \"hI\" \"Hi\"))\n (check-equal? (candidate (list \"hi\" \"admin\") (list \"hI\" \"hi\" \"hi\")) (list \"hI\" \"hi\" \"hi\"))\n (check-equal? (candidate (list \"hi\" \"admin\") (list \"hI\" \"hi\" \"hii\")) (list \"hi\" \"admin\"))\n (check-equal? (candidate (list ) (list \"this\")) (list ))\n (check-equal? (candidate (list \"this\") (list )) (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "rkt", - "prompt": "#lang racket\n\n;; Circular shift the digits of the integer x, shift the digits right by shift\n;; and return the result as a string.\n;; If shift > number of digits, return digits reversed.\n(define (circular_shift x shift)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate circular_shift))\n (check-equal? (candidate 100 2) \"001\")\n (check-equal? (candidate 12 2) \"12\")\n (check-equal? (candidate 97 8) \"79\")\n (check-equal? (candidate 12 1) \"21\")\n (check-equal? (candidate 11 101) \"11\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return True is list elements are monotonically increasing or decreasing.\n(define (monotonic l)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate monotonic))\n (check-equal? (candidate (list 1 2 4 10)) #t)\n (check-equal? (candidate (list 1 2 4 20)) #t)\n (check-equal? (candidate (list 1 20 4 10)) #f)\n (check-equal? (candidate (list 4 1 0 -10)) #t)\n (check-equal? (candidate (list 4 1 1 0)) #t)\n (check-equal? (candidate (list 1 2 3 2 5 60)) #f)\n (check-equal? (candidate (list 1 2 3 4 5 60)) #t)\n (check-equal? (candidate (list 9 9 9 9)) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "rkt", - "prompt": "#lang racket\n\n;; Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n;; Example\n(define (is_equal_to_sum_even n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_equal_to_sum_even))\n (check-equal? (candidate 4) #f)\n (check-equal? (candidate 6) #f)\n (check-equal? (candidate 8) #t)\n (check-equal? (candidate 10) #t)\n (check-equal? (candidate 11) #f)\n (check-equal? (candidate 12) #t)\n (check-equal? (candidate 13) #f)\n (check-equal? (candidate 16) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "rkt", - "prompt": "#lang racket\n\n;; Input to this function is a string representing musical notes in a special ASCII format.\n;; Your task is to parse this string and return list of integers corresponding to how many beats does each\n;; not last.\n;; Here is a legend:\n;; 'o' - whole note, lasts four beats\n;; 'o|' - half note, lasts two beats\n;; '.|' - quater note, lasts one beat\n(define (parse_music music_string)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate parse_music))\n (check-equal? (candidate \"\") (list ))\n (check-equal? (candidate \"o o o o\") (list 4 4 4 4))\n (check-equal? (candidate \".| .| .| .|\") (list 1 1 1 1))\n (check-equal? (candidate \"o| o| .| .| o o o o\") (list 2 2 1 1 4 4 4 4))\n (check-equal? (candidate \"o| .| o| .| o o| o o|\") (list 2 1 2 1 4 2 4 2))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "rkt", - "prompt": "#lang racket\n\n;; \"\n;; This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n;; multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n;; change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n;; Examples:\n(define (sum_squares lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sum_squares))\n (check-equal? (candidate (list 1 2 3)) 6)\n (check-equal? (candidate (list 1 4 9)) 14)\n (check-equal? (candidate (list )) 0)\n (check-equal? (candidate (list 1 1 1 1 1 1 1 1 1)) 9)\n (check-equal? (candidate (list -1 -1 -1 -1 -1 -1 -1 -1 -1)) -3)\n (check-equal? (candidate (list 0)) 0)\n (check-equal? (candidate (list -1 -5 2 -1 -5)) -126)\n (check-equal? (candidate (list -56 -99 1 0 -2)) 3030)\n (check-equal? (candidate (list -1 0 0 0 0 0 0 0 -1)) 0)\n (check-equal? (candidate (list -16 -9 -2 36 36 26 -20 25 -40 20 -4 12 -26 35 37)) -14196)\n (check-equal? (candidate (list -1 -3 17 -1 -15 13 -1 14 -14 -12 -5 14 -14 6 13 11 16 16 4 10)) -1448)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "rkt", - "prompt": "#lang racket\n\n;; triples_sum_to_zero takes a list of integers as an input.\n;; it returns True if there are three distinct elements in the list that\n;; sum to zero, and False otherwise.\n(define (triples_sum_to_zero l)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate triples_sum_to_zero))\n (check-equal? (candidate (list 1 3 5 0)) #f)\n (check-equal? (candidate (list 1 3 5 -1)) #f)\n (check-equal? (candidate (list 1 3 -2 1)) #t)\n (check-equal? (candidate (list 1 2 3 7)) #f)\n (check-equal? (candidate (list 1 2 5 7)) #f)\n (check-equal? (candidate (list 2 4 -5 3 9 7)) #t)\n (check-equal? (candidate (list 1)) #f)\n (check-equal? (candidate (list 1 3 5 -100)) #f)\n (check-equal? (candidate (list 100 3 5 -100)) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "rkt", - "prompt": "#lang racket\n\n;; brackets is a string of \"<\" and \">\".\n;; return True if every opening bracket has a corresponding closing bracket.\n(define (correct_bracketing brackets)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate correct_bracketing))\n (check-equal? (candidate \"<>\") #t)\n (check-equal? (candidate \"<<><>>\") #t)\n (check-equal? (candidate \"<><><<><>><>\") #t)\n (check-equal? (candidate \"<><><<<><><>><>><<><><<>>>\") #t)\n (check-equal? (candidate \"<<<><>>>>\") #f)\n (check-equal? (candidate \"><<>\") #f)\n (check-equal? (candidate \"<\") #f)\n (check-equal? (candidate \"<<<<\") #f)\n (check-equal? (candidate \">\") #f)\n (check-equal? (candidate \"<<>\") #f)\n (check-equal? (candidate \"<><><<><>><>><<>\") #f)\n (check-equal? (candidate \"<><><<><>><>>><>\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that takes an array of numbers as input and returns \n;; the number of elements in the array that are greater than 10 and both \n;; first and last digits of a number are odd (1, 3, 5, 7, 9).\n;; For example:\n(define (specialFilter nums)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate specialFilter))\n (check-equal? (candidate (list 5 -2 1 -5)) 0)\n (check-equal? (candidate (list 15 -73 14 -15)) 1)\n (check-equal? (candidate (list 33 -2 -3 45 21 109)) 2)\n (check-equal? (candidate (list 43 -12 93 125 121 109)) 4)\n (check-equal? (candidate (list 71 -2 -33 75 21 19)) 3)\n (check-equal? (candidate (list 1)) 0)\n (check-equal? (candidate (list )) 0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a dictionary, return True if all keys are strings in lower \n;; case or all keys are strings in upper case, else return False.\n;; The function should return False is the given dictionary is empty.\n;; Examples:\n(define (check_dict_case dict)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate check_dict_case))\n (check-equal? (candidate #hash((\"p\" . \"pineapple\") (\"b\" . \"banana\"))) #t)\n (check-equal? (candidate #hash((\"p\" . \"pineapple\") (\"A\" . \"banana\") (\"B\" . \"banana\"))) #f)\n (check-equal? (candidate #hash((\"p\" . \"pineapple\") (\"5\" . \"banana\") (\"a\" . \"apple\"))) #f)\n (check-equal? (candidate #hash((\"Name\" . \"John\") (\"Age\" . \"36\") (\"City\" . \"Houston\"))) #f)\n (check-equal? (candidate #hash((\"STATE\" . \"NC\") (\"ZIP\" . \"12345\"))) #t)\n (check-equal? (candidate #hash((\"fruit\" . \"Orange\") (\"taste\" . \"Sweet\"))) #t)\n (check-equal? (candidate #hash()) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n;; should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n;; alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n;; Examples\n(define (split_words txt)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate split_words))\n (check-equal? (candidate \"Hello world!\") (list \"Hello\" \"world!\"))\n (check-equal? (candidate \"Hello,world!\") (list \"Hello\" \"world!\"))\n (check-equal? (candidate \"Hello world,!\") (list \"Hello\" \"world,!\"))\n (check-equal? (candidate \"Hello,Hello,world !\") (list \"Hello,Hello,world\" \"!\"))\n (check-equal? (candidate \"abcdef\") 3)\n (check-equal? (candidate \"aaabb\") 2)\n (check-equal? (candidate \"aaaBb\") 1)\n (check-equal? (candidate \"\") 0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "rkt", - "prompt": "#lang racket\n\n;; The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n;; fibfib(0) == 0\n;; fibfib(1) == 0\n;; fibfib(2) == 1\n;; fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n;; Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n(define (fibfib n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate fibfib))\n (check-equal? (candidate 2) 1)\n (check-equal? (candidate 1) 0)\n (check-equal? (candidate 5) 4)\n (check-equal? (candidate 8) 24)\n (check-equal? (candidate 10) 81)\n (check-equal? (candidate 12) 274)\n (check-equal? (candidate 14) 927)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a list of numbers.\n;; You need to return the sum of squared numbers in the given list,\n;; round each element in the list to the upper int(Ceiling) first.\n;; Examples:\n(define (sum_squares lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sum_squares))\n (check-equal? (candidate (list 1.0 2.0 3.0)) 14)\n (check-equal? (candidate (list 1.0 2.0 3.0)) 14)\n (check-equal? (candidate (list 1.0 3.0 5.0 7.0)) 84)\n (check-equal? (candidate (list 1.4 4.2 0.0)) 29)\n (check-equal? (candidate (list -2.4 1.0 1.0)) 6)\n (check-equal? (candidate (list 100.0 1.0 15.0 2.0)) 10230)\n (check-equal? (candidate (list 10000.0 10000.0)) 200000000)\n (check-equal? (candidate (list -1.4 4.6 6.3)) 75)\n (check-equal? (candidate (list -1.4 17.9 18.9 19.9)) 1086)\n (check-equal? (candidate (list 0.0)) 0)\n (check-equal? (candidate (list -1.0)) 1)\n (check-equal? (candidate (list -1.0 1.0 0.0)) 2)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_85_add", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a non-empty list of integers lst. add the even elements that are at odd indices..\n;; Examples:\n(define (add lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate add))\n (check-equal? (candidate (list 4 88)) 88)\n (check-equal? (candidate (list 4 5 6 7 2 122)) 122)\n (check-equal? (candidate (list 4 0 6 7)) 0)\n (check-equal? (candidate (list 4 4 6 8)) 12)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return sorted unique elements in a list\n(define (unique l)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate unique))\n (check-equal? (candidate (list 5 3 5 2 3 3 9 0 123)) (list 0 2 3 5 9 123))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a string text, replace all spaces in it with underscores, \n;; and if a string has more than 2 consecutive spaces, \n;; then replace all consecutive spaces with -\n(define (fix_spaces text)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate fix_spaces))\n (check-equal? (candidate \"Example\") \"Example\")\n (check-equal? (candidate \"Mudasir Hanif \") \"Mudasir_Hanif_\")\n (check-equal? (candidate \"Yellow Yellow Dirty Fellow\") \"Yellow_Yellow__Dirty__Fellow\")\n (check-equal? (candidate \"Exa mple\") \"Exa-mple\")\n (check-equal? (candidate \" Exa 1 2 2 mple\") \"-Exa_1_2_2_mple\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return 2^n modulo p (be aware of numerics).\n(define (modp n p)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate modp))\n (check-equal? (candidate 3 5) 3)\n (check-equal? (candidate 1101 101) 2)\n (check-equal? (candidate 0 101) 1)\n (check-equal? (candidate 3 11) 8)\n (check-equal? (candidate 100 101) 1)\n (check-equal? (candidate 30 5) 4)\n (check-equal? (candidate 31 5) 3)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "rkt", - "prompt": "#lang racket\n\n;; You have to write a function which validates a given date string and\n;; returns True if the date is valid otherwise False.\n;; The date is valid if all of the following rules are satisfied:\n;; 1. The date string is not empty.\n;; 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n;; 3. The months should not be less than 1 or higher than 12.\n;; 4. The date should be in the format: mm-dd-yyyy\n(define (valid_date date)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate valid_date))\n (check-equal? (candidate \"03-11-2000\") #t)\n (check-equal? (candidate \"15-01-2012\") #f)\n (check-equal? (candidate \"04-0-2040\") #f)\n (check-equal? (candidate \"06-04-2020\") #t)\n (check-equal? (candidate \"01-01-2007\") #t)\n (check-equal? (candidate \"03-32-2011\") #f)\n (check-equal? (candidate \"\") #f)\n (check-equal? (candidate \"04-31-3000\") #f)\n (check-equal? (candidate \"06-06-2005\") #t)\n (check-equal? (candidate \"21-31-2000\") #f)\n (check-equal? (candidate \"04-12-2003\") #t)\n (check-equal? (candidate \"04122003\") #f)\n (check-equal? (candidate \"20030412\") #f)\n (check-equal? (candidate \"2003-04\") #f)\n (check-equal? (candidate \"2003-04-12\") #f)\n (check-equal? (candidate \"04-2003\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that takes a string and returns an ordered version of it.\n;; Ordered version of string, is a string where all words (separated by space)\n;; are replaced by a new word where all the characters arranged in\n;; ascending order based on ascii value.\n;; Note: You should keep the order of words and blank spaces in the sentence.\n;; For example:\n(define (anti_shuffle s)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate anti_shuffle))\n (check-equal? (candidate \"Hi\") \"Hi\")\n (check-equal? (candidate \"hello\") \"ehllo\")\n (check-equal? (candidate \"number\") \"bemnru\")\n (check-equal? (candidate \"abcd\") \"abcd\")\n (check-equal? (candidate \"Hello World!!!\") \"Hello !!!Wdlor\")\n (check-equal? (candidate \"\") \"\")\n (check-equal? (candidate \"Hi. My name is Mister Robot. How are you?\") \".Hi My aemn is Meirst .Rboot How aer ?ouy\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a list of numbers, return whether or not they are sorted\n;; in ascending order. If list has more than 1 duplicate of the same\n;; number, return False. Assume no negative numbers and only integers.\n;; Examples\n(define (is_sorted lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_sorted))\n (check-equal? (candidate (list 5)) #t)\n (check-equal? (candidate (list 1 2 3 4 5)) #t)\n (check-equal? (candidate (list 1 3 2 4 5)) #f)\n (check-equal? (candidate (list 1 2 3 4 5 6)) #t)\n (check-equal? (candidate (list 1 2 3 4 5 6 7)) #t)\n (check-equal? (candidate (list 1 3 2 4 5 6 7)) #f)\n (check-equal? (candidate (list )) #t)\n (check-equal? (candidate (list 1)) #t)\n (check-equal? (candidate (list 3 2 1)) #f)\n (check-equal? (candidate (list 1 2 2 2 3 4)) #f)\n (check-equal? (candidate (list 1 2 3 3 3 4)) #f)\n (check-equal? (candidate (list 1 2 2 3 3 4)) #t)\n (check-equal? (candidate (list 1 2 3 4)) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a string s.\n;; Your task is to check if the string is happy or not.\n;; A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n;; For example:\n(define (is_happy s)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_happy))\n (check-equal? (candidate \"a\") #f)\n (check-equal? (candidate \"aa\") #f)\n (check-equal? (candidate \"abcd\") #t)\n (check-equal? (candidate \"aabb\") #f)\n (check-equal? (candidate \"adb\") #t)\n (check-equal? (candidate \"xyy\") #f)\n (check-equal? (candidate \"iopaxpoi\") #t)\n (check-equal? (candidate \"iopaxioi\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that returns True if the object q will fly, and False otherwise.\n;; The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n;; Example:\n;; # 1+2 is less than the maximum possible weight, but it's unbalanced.\n;; # it's balanced, but 3+2+3 is more than the maximum possible weight.\n;; # 3+2+3 is less than the maximum possible weight, and it's balanced.\n;; # 3 is less than the maximum possible weight, and it's balanced.\n(define (will_it_fly q w)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate will_it_fly))\n (check-equal? (candidate (list 3 2 3) 9) #t)\n (check-equal? (candidate (list 1 2) 5) #f)\n (check-equal? (candidate (list 3) 5) #t)\n (check-equal? (candidate (list 3 2 3) 1) #f)\n (check-equal? (candidate (list 1 2 3) 6) #f)\n (check-equal? (candidate (list 5) 5) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given an array of non-negative integers, return a copy of the given array after sorting,\n;; you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n;; or sort it in descending order if the sum( first index value, last index value) is even.\n;; Note:\n;; * don't change the given array.\n;; Examples:\n(define (sort_array array)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sort_array))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 5)) (list 5))\n (check-equal? (candidate (list 2 4 3 0 1 5)) (list 0 1 2 3 4 5))\n (check-equal? (candidate (list 2 4 3 0 1 5 6)) (list 6 5 4 3 2 1 0))\n (check-equal? (candidate (list 2 1)) (list 1 2))\n (check-equal? (candidate (list 15 42 87 32 11 0)) (list 0 11 15 32 42 87))\n (check-equal? (candidate (list 21 14 23 11)) (list 23 21 14 11))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "rkt", - "prompt": "#lang racket\n\n;; Implement a function that takes an non-negative integer and returns an array of the first n\n;; integers that are prime numbers and less than n.\n;; for example:\n(define (count_up_to n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate count_up_to))\n (check-equal? (candidate 5) (list 2 3))\n (check-equal? (candidate 6) (list 2 3 5))\n (check-equal? (candidate 7) (list 2 3 5))\n (check-equal? (candidate 10) (list 2 3 5 7))\n (check-equal? (candidate 0) (list ))\n (check-equal? (candidate 22) (list 2 3 5 7 11 13 17 19))\n (check-equal? (candidate 1) (list ))\n (check-equal? (candidate 18) (list 2 3 5 7 11 13 17))\n (check-equal? (candidate 47) (list 2 3 5 7 11 13 17 19 23 29 31 37 41 43))\n (check-equal? (candidate 101) (list 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "rkt", - "prompt": "#lang racket\n\n;; Out of list of strings, return the longest one. Return the first one in case of multiple\n;; strings of the same length. Return None in case the input list is empty.\n(define (longest strings)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate longest))\n (check-equal? (candidate (list )) #f)\n (check-equal? (candidate (list \"x\" \"y\" \"z\")) \"x\")\n (check-equal? (candidate (list \"x\" \"yyy\" \"zzzz\" \"www\" \"kkkk\" \"abc\")) \"zzzz\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n;; reverse the resulting array, and then replace each digit by its corresponding name from\n;; \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n;; For example:\n;; If the array is empty, return an empty array:\n;; If the array has any strange number ignore it:\n(define (by_length arr)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate by_length))\n (check-equal? (candidate (list 2 1 1 4 5 8 2 3)) (list \"Eight\" \"Five\" \"Four\" \"Three\" \"Two\" \"Two\" \"One\" \"One\"))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 1 -1 55)) (list \"One\"))\n (check-equal? (candidate (list 1 -1 3 2)) (list \"Three\" \"Two\" \"One\"))\n (check-equal? (candidate (list 9 4 8)) (list \"Nine\" \"Eight\" \"Four\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_106_f", - "language": "rkt", - "prompt": "#lang racket\n\n;; Implement the function f that takes n as a parameter,\n;; 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\n;; or the sum of numbers from 1 to i otherwise.\n;; i starts from 1.\n;; the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n;; Example:\n(define (f n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate f))\n (check-equal? (candidate 5) (list 1 2 6 24 15))\n (check-equal? (candidate 7) (list 1 2 6 24 15 720 28))\n (check-equal? (candidate 1) (list 1))\n (check-equal? (candidate 3) (list 1 2 6))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n(define (fizz_buzz n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate fizz_buzz))\n (check-equal? (candidate 50) 0)\n (check-equal? (candidate 78) 2)\n (check-equal? (candidate 79) 3)\n (check-equal? (candidate 100) 3)\n (check-equal? (candidate 200) 6)\n (check-equal? (candidate 4000) 192)\n (check-equal? (candidate 10000) 639)\n (check-equal? (candidate 100000) 8026)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a positive floating point number, it can be decomposed into\n;; and integer part (largest integer smaller than given number) and decimals\n;; (leftover part always smaller than 1).\n;; Return the decimal part of the number.\n(define (truncate_number number)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate truncate_number))\n (check-equal? (candidate 3.5) 0.5)\n (check-equal? (candidate 1.25) 0.25)\n (check-equal? (candidate 123.0) 0.0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "rkt", - "prompt": "#lang racket\n\n;; For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n;; Empty sum should be equal to 0 and empty product should be equal to 1.\n(define (sum_product numbers)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sum_product))\n (check-equal? (candidate (list )) (list 0 1))\n (check-equal? (candidate (list 1 1 1)) (list 3 1))\n (check-equal? (candidate (list 100 0)) (list 100 0))\n (check-equal? (candidate (list 3 5 7)) (list 15 105))\n (check-equal? (candidate (list 10)) (list 10 10))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a 2 dimensional data, as a nested lists,\n;; which is similar to matrix, however, unlike matrices,\n;; each row may contain a different number of columns.\n;; Given lst, and integer x, find integers x in the list,\n;; and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n;; each tuple is a coordinate - (row, columns), starting with 0.\n;; Sort coordinates initially by rows in ascending order.\n;; Also, sort coordinates of the row by columns in descending order.\n;; Examples:\n(define (get_row lst x)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate get_row))\n (check-equal? (candidate (list (list 1 2 3 4 5 6) (list 1 2 3 4 1 6) (list 1 2 3 4 5 1)) 1) (list (list 0 0) (list 1 4) (list 1 0) (list 2 5) (list 2 0)))\n (check-equal? (candidate (list (list 1 2 3 4 5 6) (list 1 2 3 4 5 6) (list 1 2 3 4 5 6) (list 1 2 3 4 5 6) (list 1 2 3 4 5 6) (list 1 2 3 4 5 6)) 2) (list (list 0 1) (list 1 1) (list 2 1) (list 3 1) (list 4 1) (list 5 1)))\n (check-equal? (candidate (list (list 1 2 3 4 5 6) (list 1 2 3 4 5 6) (list 1 1 3 4 5 6) (list 1 2 1 4 5 6) (list 1 2 3 1 5 6) (list 1 2 3 4 1 6) (list 1 2 3 4 5 1)) 1) (list (list 0 0) (list 1 0) (list 2 1) (list 2 0) (list 3 2) (list 3 0) (list 4 3) (list 4 0) (list 5 4) (list 5 0) (list 6 5) (list 6 0)))\n (check-equal? (candidate (list ) 1) (list ))\n (check-equal? (candidate (list (list 1)) 2) (list ))\n (check-equal? (candidate (list (list ) (list 1) (list 1 2 3)) 3) (list (list 2 2)))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "rkt", - "prompt": "#lang racket\n\n;; You're a hungry rabbit, and you already have eaten a certain number of carrots,\n;; but now you need to eat more carrots to complete the day's meals.\n;; you should return an array of [ total number of eaten carrots after your meals,\n;; the number of carrots left after your meals ]\n;; if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n;; Example:\n;; Variables:\n;; @number : integer\n;; the number of carrots that you have eaten.\n;; @need : integer\n;; the number of carrots that you need to eat.\n;; @remaining : integer\n;; the number of remaining carrots thet exist in stock\n;; Constrain:\n;; * 0 <= number <= 1000\n;; * 0 <= need <= 1000\n;; * 0 <= remaining <= 1000\n;; Have fun :)\n(define (eat number need remaining)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate eat))\n (check-equal? (candidate 5 6 10) (list 11 4))\n (check-equal? (candidate 4 8 9) (list 12 1))\n (check-equal? (candidate 1 10 10) (list 11 0))\n (check-equal? (candidate 2 11 5) (list 7 0))\n (check-equal? (candidate 4 5 7) (list 9 2))\n (check-equal? (candidate 4 5 1) (list 5 0))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a positive integer N, return the total sum of its digits in binary.\n;; Example\n;; Variables:\n;; @N integer\n;; Constraints: 0 \u2264 N \u2264 10000.\n;; Output:\n;; a string of binary number\n(define (solve N)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate solve))\n (check-equal? (candidate 1000) \"1\")\n (check-equal? (candidate 150) \"110\")\n (check-equal? (candidate 147) \"1100\")\n (check-equal? (candidate 333) \"1001\")\n (check-equal? (candidate 963) \"10010\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a list of integers.\n;; You need to find the largest prime value and return the sum of its digits.\n;; Examples:\n(define (skjkasdkd lst)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate skjkasdkd))\n (check-equal? (candidate (list 0 3 2 1 3 5 7 4 5 5 5 2 181 32 4 32 3 2 32 324 4 3)) 10)\n (check-equal? (candidate (list 1 0 1 8 2 4597 2 1 3 40 1 2 1 2 4 2 5 1)) 25)\n (check-equal? (candidate (list 1 3 1 32 5107 34 83278 109 163 23 2323 32 30 1 9 3)) 13)\n (check-equal? (candidate (list 0 724 32 71 99 32 6 0 5 91 83 0 5 6)) 11)\n (check-equal? (candidate (list 0 81 12 3 1 21)) 3)\n (check-equal? (candidate (list 0 8 1 2 1 7)) 7)\n (check-equal? (candidate (list 8191)) 19)\n (check-equal? (candidate (list 8191 123456 127 7)) 19)\n (check-equal? (candidate (list 127 97 8192)) 10)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given an array arr of integers, find the minimum number of elements that\n;; need to be changed to make the array palindromic. A palindromic array is an array that\n;; is read the same backwards and forwards. In one change, you can change one element to any other element.\n;; For example:\n(define (smallest_change arr)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate smallest_change))\n (check-equal? (candidate (list 1 2 3 5 4 7 9 6)) 4)\n (check-equal? (candidate (list 1 2 3 4 3 2 2)) 1)\n (check-equal? (candidate (list 1 4 2)) 1)\n (check-equal? (candidate (list 1 4 4 2)) 1)\n (check-equal? (candidate (list 1 2 3 2 1)) 0)\n (check-equal? (candidate (list 3 1 1 3)) 0)\n (check-equal? (candidate (list 1)) 0)\n (check-equal? (candidate (list 0 1)) 1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "rkt", - "prompt": "#lang racket\n\n;; It is the last week of the semester and the teacher has to give the grades\n;; to students. The teacher has been making her own algorithm for grading.\n;; The only problem is, she has lost the code she used for grading.\n;; She has given you a list of GPAs for some students and you have to write \n;; a function that can output a list of letter grades using the following table:\n;; GPA | Letter grade\n;; 4.0 A+\n;; > 3.7 A \n;; > 3.3 A- \n;; > 3.0 B+\n;; > 2.7 B \n;; > 2.3 B-\n;; > 2.0 C+\n;; > 1.7 C\n;; > 1.3 C-\n;; > 1.0 D+ \n;; > 0.7 D \n;; > 0.0 D-\n;; 0.0 E\n;; Example:\n(define (numerical_letter_grade grades)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate numerical_letter_grade))\n (check-equal? (candidate (list 4.0 3 1.7 2 3.5)) (list \"A+\" \"B\" \"C-\" \"C\" \"A-\"))\n (check-equal? (candidate (list 1.2)) (list \"D+\"))\n (check-equal? (candidate (list 0.5)) (list \"D-\"))\n (check-equal? (candidate (list 0.0)) (list \"E\"))\n (check-equal? (candidate (list 1.0 0.3 1.5 2.8 3.3)) (list \"D\" \"D-\" \"C-\" \"B\" \"B+\"))\n (check-equal? (candidate (list 0.0 0.7)) (list \"E\" \"D-\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given the lengths of the three sides of a triangle. Return the area of\n;; the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n;; Otherwise return -1\n;; Three sides make a valid triangle when the sum of any two sides is greater \n;; than the third side.\n;; Example:\n(define (triangle_area a b c)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate triangle_area))\n (check-equal? (candidate 3 4 5) 6.0)\n (check-equal? (candidate 1 2 10) -1)\n (check-equal? (candidate 4 8 5) 8.18)\n (check-equal? (candidate 2 2 2) 1.73)\n (check-equal? (candidate 1 2 3) -1)\n (check-equal? (candidate 10 5 7) 16.25)\n (check-equal? (candidate 2 6 3) -1)\n (check-equal? (candidate 1 1 1) 0.43)\n (check-equal? (candidate 2 2 10) -1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "rkt", - "prompt": "#lang racket\n\n;; Check if two words have the same characters.\n(define (same_chars s0 s1)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate same_chars))\n (check-equal? (candidate \"eabcdzzzz\" \"dddzzzzzzzddeddabc\") #t)\n (check-equal? (candidate \"abcd\" \"dddddddabc\") #t)\n (check-equal? (candidate \"dddddddabc\" \"abcd\") #t)\n (check-equal? (candidate \"eabcd\" \"dddddddabc\") #f)\n (check-equal? (candidate \"abcd\" \"dddddddabcf\") #f)\n (check-equal? (candidate \"eabcdzzzz\" \"dddzzzzzzzddddabc\") #f)\n (check-equal? (candidate \"aabb\" \"aaccc\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given an array of integers nums, find the minimum sum of any non-empty sub-array\n;; of nums.\n;; Example\n(define (minSubArraySum nums)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate minSubArraySum))\n (check-equal? (candidate (list 2 3 4 1 2 4)) 1)\n (check-equal? (candidate (list -1 -2 -3)) -6)\n (check-equal? (candidate (list -1 -2 -3 2 -10)) -14)\n (check-equal? (candidate (list -9999999999999999)) -9999999999999999)\n (check-equal? (candidate (list 0 10 20 1000000)) 0)\n (check-equal? (candidate (list -1 -2 -3 10 -5)) -6)\n (check-equal? (candidate (list 100 -1 -2 -3 10 -5)) -6)\n (check-equal? (candidate (list 10 11 13 8 3 4)) 3)\n (check-equal? (candidate (list 100 -33 32 -1 0 -2)) -33)\n (check-equal? (candidate (list -10)) -10)\n (check-equal? (candidate (list 7)) 7)\n (check-equal? (candidate (list 1 -1)) -1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a string s and a natural number n, you have been tasked to implement \n;; a function that returns a list of all words from string s that contain exactly \n;; n consonants, in order these words appear in the string s.\n;; If the string s is empty then the function should return an empty list.\n;; Note: you may assume the input string contains only letters and spaces.\n;; Examples:\n(define (select_words s n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate select_words))\n (check-equal? (candidate \"Mary had a little lamb\" 4) (list \"little\"))\n (check-equal? (candidate \"Mary had a little lamb\" 3) (list \"Mary\" \"lamb\"))\n (check-equal? (candidate \"simple white space\" 2) (list ))\n (check-equal? (candidate \"Hello world\" 4) (list \"world\"))\n (check-equal? (candidate \"Uncle sam\" 3) (list \"Uncle\"))\n (check-equal? (candidate \"\" 4) (list ))\n (check-equal? (candidate \"a b c d e f\" 1) (list \"b\" \"c\" \"d\" \"f\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return list of all prefixes from shortest to longest of the input string\n(define (all_prefixes string)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate all_prefixes))\n (check-equal? (candidate \"\") (list ))\n (check-equal? (candidate \"asdfgh\") (list \"a\" \"as\" \"asd\" \"asdf\" \"asdfg\" \"asdfgh\"))\n (check-equal? (candidate \"WWW\") (list \"W\" \"WW\" \"WWW\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function that takes a value (string) representing a number\n;; and returns the closest integer to it. If the number is equidistant\n;; from two integers, round it away from zero.\n;; Examples\n;; Note:\n;; Rounding away from zero means that if the given number is equidistant\n;; from two integers, the one you should return is the one that is the\n;; farthest from zero. For example closest_integer(\"14.5\") should\n;; return 15 and closest_integer(\"-14.5\") should return -15.\n(define (closest_integer value)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate closest_integer))\n (check-equal? (candidate \"10\") 10)\n (check-equal? (candidate \"14.5\") 15)\n (check-equal? (candidate \"-15.5\") -16)\n (check-equal? (candidate \"15.3\") 15)\n (check-equal? (candidate \"0\") 0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function which takes a string representing a file's name, and returns\n;; 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n;; A file's name is considered to be valid if and only if all the following conditions \n;; are met:\n;; - There should not be more than three digits ('0'-'9') in the file's name.\n;; - The file's name contains exactly one dot '.'\n;; - The substring before the dot should not be empty, and it starts with a letter from \n;; the latin alphapet ('a'-'z' and 'A'-'Z').\n;; - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n;; Examples:\n(define (file_name_check file_name)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate file_name_check))\n (check-equal? (candidate \"example.txt\") \"Yes\")\n (check-equal? (candidate \"1example.dll\") \"No\")\n (check-equal? (candidate \"s1sdf3.asd\") \"No\")\n (check-equal? (candidate \"K.dll\") \"Yes\")\n (check-equal? (candidate \"MY16FILE3.exe\") \"Yes\")\n (check-equal? (candidate \"His12FILE94.exe\") \"No\")\n (check-equal? (candidate \"_Y.txt\") \"No\")\n (check-equal? (candidate \"?aREYA.exe\") \"No\")\n (check-equal? (candidate \"/this_is_valid.dll\") \"No\")\n (check-equal? (candidate \"this_is_valid.wow\") \"No\")\n (check-equal? (candidate \"this_is_valid.txt\") \"Yes\")\n (check-equal? (candidate \"this_is_valid.txtexe\") \"No\")\n (check-equal? (candidate \"#this2_i4s_5valid.ten\") \"No\")\n (check-equal? (candidate \"@this1_is6_valid.exe\") \"No\")\n (check-equal? (candidate \"this_is_12valid.6exe4.txt\") \"No\")\n (check-equal? (candidate \"all.exe.txt\") \"No\")\n (check-equal? (candidate \"I563_No.exe\") \"Yes\")\n (check-equal? (candidate \"Is3youfault.txt\") \"Yes\")\n (check-equal? (candidate \"no_one#knows.dll\") \"Yes\")\n (check-equal? (candidate \"1I563_Yes3.exe\") \"No\")\n (check-equal? (candidate \"I563_Yes3.txtt\") \"No\")\n (check-equal? (candidate \"final..txt\") \"No\")\n (check-equal? (candidate \"final132\") \"No\")\n (check-equal? (candidate \"_f4indsartal132.\") \"No\")\n (check-equal? (candidate \".txt\") \"No\")\n (check-equal? (candidate \"s.\") \"No\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given two intervals,\n;; where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n;; The given intervals are closed which means that the interval (start, end)\n;; includes both start and end.\n;; For each given interval, it is assumed that its start is less or equal its end.\n;; Your task is to determine whether the length of intersection of these two \n;; intervals is a prime number.\n;; Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n;; which its length is 1, which not a prime number.\n;; If the length of the intersection is a prime number, return \"YES\",\n;; otherwise, return \"NO\".\n;; If the two intervals don't intersect, return \"NO\".\n;; [input/output] samples:\n(define (intersection interval1 interval2)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate intersection))\n (check-equal? (candidate (list 1 2) (list 2 3)) \"NO\")\n (check-equal? (candidate (list -1 1) (list 0 4)) \"NO\")\n (check-equal? (candidate (list -3 -1) (list -5 5)) \"YES\")\n (check-equal? (candidate (list -2 2) (list -4 0)) \"YES\")\n (check-equal? (candidate (list -11 2) (list -1 -1)) \"NO\")\n (check-equal? (candidate (list 1 2) (list 3 5)) \"NO\")\n (check-equal? (candidate (list 1 2) (list 1 2)) \"NO\")\n (check-equal? (candidate (list -2 -2) (list -3 -2)) \"NO\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return the largest prime factor of n. Assume n > 1 and is not a prime.\n(define (largest_prime_factor n)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate largest_prime_factor))\n (check-equal? (candidate 15) 5)\n (check-equal? (candidate 27) 3)\n (check-equal? (candidate 63) 7)\n (check-equal? (candidate 330) 11)\n (check-equal? (candidate 13195) 29)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a string, find out how many distinct characters (regardless of case) does it consist of\n(define (count_distinct_characters string)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate count_distinct_characters))\n (check-equal? (candidate \"\") 0)\n (check-equal? (candidate \"abcde\") 5)\n (check-equal? (candidate \"abcdecadeCADE\") 5)\n (check-equal? (candidate \"aaaaAAAAaaaa\") 1)\n (check-equal? (candidate \"Jerry jERRY JeRRRY\") 5)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "rkt", - "prompt": "#lang racket\n\n;; You're given a list of deposit and withdrawal operations on a bank account that starts with\n;; zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n;; at that point function should return True. Otherwise it should return False.\n(define (below_zero operations)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate below_zero))\n (check-equal? (candidate (list )) #f)\n (check-equal? (candidate (list 1 2 -3 1 2 -3)) #f)\n (check-equal? (candidate (list 1 2 -4 5 6)) #t)\n (check-equal? (candidate (list 1 -1 2 -2 5 -5 4 -4)) #f)\n (check-equal? (candidate (list 1 -1 2 -2 5 -5 4 -5)) #t)\n (check-equal? (candidate (list 1 -2 2 -2 5 -5 4 -4)) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "rkt", - "prompt": "#lang racket\n\n;; Find the shortest palindrome that begins with a supplied string.\n;; Algorithm idea is simple:\n;; - Find the longest postfix of supplied string that is a palindrome.\n;; - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n(define (make_palindrome string)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate make_palindrome))\n (check-equal? (candidate \"\") \"\")\n (check-equal? (candidate \"x\") \"x\")\n (check-equal? (candidate \"xyz\") \"xyzyx\")\n (check-equal? (candidate \"xyx\") \"xyx\")\n (check-equal? (candidate \"jerry\") \"jerryrrej\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a positive integer, obtain its roman numeral equivalent as a string,\n;; and return it in lowercase.\n;; Restrictions: 1 <= num <= 1000\n;; Examples:\n(define (int_to_mini_roman number)\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate int_to_mini_roman))\n (check-equal? (candidate 19) \"xix\")\n (check-equal? (candidate 152) \"clii\")\n (check-equal? (candidate 251) \"ccli\")\n (check-equal? (candidate 426) \"cdxxvi\")\n (check-equal? (candidate 500) \"d\")\n (check-equal? (candidate 1) \"i\")\n (check-equal? (candidate 4) \"iv\")\n (check-equal? (candidate 43) \"xliii\")\n (check-equal? (candidate 90) \"xc\")\n (check-equal? (candidate 94) \"xciv\")\n (check-equal? (candidate 532) \"dxxxii\")\n (check-equal? (candidate 900) \"cm\")\n (check-equal? (candidate 994) \"cmxciv\")\n (check-equal? (candidate 1000) \"m\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - } -] \ No newline at end of file diff --git a/data/rkt-reworded.json b/data/rkt-reworded.json deleted file mode 100644 index ecca51b1c7df9bc675c9980cdcc6377c8cd0ed11..0000000000000000000000000000000000000000 --- a/data/rkt-reworded.json +++ /dev/null @@ -1,2417 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "rkt", - "prompt": "#lang racket\n\n;; For a given number n, find the largest number that divides n evenly, smaller than n\n;; >>> (largest_divisor 15)\n;; 5\n(define (largest_divisor n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate largest_divisor))\n (check-equal? (candidate 3) 1)\n (check-equal? (candidate 7) 1)\n (check-equal? (candidate 10) 5)\n (check-equal? (candidate 100) 50)\n (check-equal? (candidate 49) 7)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_47_median", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return median of elements in the list l.\n;; >>> (median (list 3 1 2 4 5))\n;; 3\n;; >>> (median (list -10 4 6 1000 10 20))\n;; 15.0\n(define (median l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate median))\n (check-equal? (candidate (list 3 1 2 4 5)) 3)\n (check-equal? (candidate (list -10 4 6 1000 10 20)) 8.0)\n (check-equal? (candidate (list 5)) 5)\n (check-equal? (candidate (list 6 5)) 5.5)\n (check-equal? (candidate (list 8 1 3 9 9 2 7)) 7)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given two lists operator, and operand. The first list has basic algebra operations, and \n;; the second list is a list of integers. Use the two given lists to build the algebric \n;; expression and return the evaluation of this expression.\n;; The basic algebra operations:\n;; Addition ( + ) \n;; Subtraction ( - ) \n;; Multiplication ( * ) \n;; Floor division ( // ) \n;; Exponentiation ( ** ) \n;; Example:\n;; operator['+', '*', '-']\n;; list = [2, 3, 4, 5]\n;; result = 2 + 3 * 4 - 5\n;; => result = 9\n;; Note:\n;; The length of operator list is equal to the length of operand list minus one.\n;; Operand is a list of of non-negative integers.\n;; Operator list has at least one operator, and operand list has at least two operands.\n(define (do_algebra operator operand)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate do_algebra))\n (check-equal? (candidate (list \"**\" \"*\" \"+\") (list 2 3 4 5)) 37)\n (check-equal? (candidate (list \"+\" \"*\" \"-\") (list 2 3 4 5)) 9)\n (check-equal? (candidate (list \"//\" \"*\") (list 7 3 4)) 8)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return maximum element in the list.\n;; >>> (max_element (list 1 2 3))\n;; 3\n;; >>> (max_element (list 5 3 -5 2 -3 3 9 0 123 1 -10))\n;; 123\n(define (max_element l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate max_element))\n (check-equal? (candidate (list 1 2 3)) 3)\n (check-equal? (candidate (list 5 3 -5 2 -3 3 9 0 124 1 -10)) 124)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function which returns the largest index of an element which\n;; is not greater than or equal to the element immediately preceding it. If\n;; no such element exists then return -1. The given list will not contain\n;; duplicate values.\n;; Examples:\n;; >>> (can_arrange (list 1 2 4 3 5))\n;; 3\n;; >>> (can_arrange (list 1 2 3))\n;; -1\n(define (can_arrange arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate can_arrange))\n (check-equal? (candidate (list 1 2 4 3 5)) 3)\n (check-equal? (candidate (list 1 2 4 5)) -1)\n (check-equal? (candidate (list 1 4 2 5 6 7 8 9 10)) 2)\n (check-equal? (candidate (list 4 8 5 7 3)) 4)\n (check-equal? (candidate (list )) -1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "rkt", - "prompt": "#lang racket\n\n;; Imagine a road that's a perfectly straight infinitely long line.\n;; n cars are driving left to right; simultaneously, a different set of n cars\n;; are driving right to left. The two sets of cars start out being very far from\n;; each other. All cars move in the same speed. Two cars are said to collide\n;; when a car that's moving left to right hits a car that's moving right to left.\n;; However, the cars are infinitely sturdy and strong; as a result, they continue moving\n;; in their trajectory as if they did not collide.\n;; This function outputs the number of such collisions.\n(define (car_race_collision n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate car_race_collision))\n (check-equal? (candidate 2) 4)\n (check-equal? (candidate 3) 9)\n (check-equal? (candidate 4) 16)\n (check-equal? (candidate 8) 64)\n (check-equal? (candidate 10) 100)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function that returns #t if the last character\n;; of a given string is an alphabetical character and is not\n;; a part of a word, and #f otherwise.\n;; Note: \"word\" is a group of characters separated by space.\n;; Examples:\n;; >>> (check_if_last_char_is_a_letter \"apple pie\")\n;; #f\n;; >>> (check_if_last_char_is_a_letter \"apple pi e\")\n;; #t\n;; >>> (check_if_last_char_is_a_letter \"apple pi e \")\n;; #f\n;; >>> (check_if_last_char_is_a_letter \"\")\n;; #f\n(define (check_if_last_char_is_a_letter txt)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate check_if_last_char_is_a_letter))\n (check-equal? (candidate \"apple\") #f)\n (check-equal? (candidate \"apple pi e\") #t)\n (check-equal? (candidate \"eeeee\") #f)\n (check-equal? (candidate \"A\") #t)\n (check-equal? (candidate \"Pumpkin pie \") #f)\n (check-equal? (candidate \"Pumpkin pie 1\") #f)\n (check-equal? (candidate \"\") #f)\n (check-equal? (candidate \"eeeee e \") #f)\n (check-equal? (candidate \"apple pie\") #f)\n (check-equal? (candidate \"apple pi e \") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return true if a given number is prime, and false otherwise.\n;; >>> (is_prime 6)\n;; #f\n;; >>> (is_prime 101)\n;; #t\n;; >>> (is_prime 11)\n;; #t\n;; >>> (is_prime 13441)\n;; #t\n;; >>> (is_prime 61)\n;; #t\n;; >>> (is_prime 4)\n;; #f\n;; >>> (is_prime 1)\n;; #f\n(define (is_prime n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_prime))\n (check-equal? (candidate 6) #f)\n (check-equal? (candidate 101) #t)\n (check-equal? (candidate 11) #t)\n (check-equal? (candidate 13441) #t)\n (check-equal? (candidate 61) #t)\n (check-equal? (candidate 4) #f)\n (check-equal? (candidate 1) #f)\n (check-equal? (candidate 5) #t)\n (check-equal? (candidate 11) #t)\n (check-equal? (candidate 17) #t)\n (check-equal? (candidate 85) #f)\n (check-equal? (candidate 77) #f)\n (check-equal? (candidate 255379) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a list of positive integers x. return a sorted list of all \n;; elements that hasn't any even digit.\n;; Note: Returned list should be sorted in increasing order.\n;; For example:\n;; >>> (unique_digits (list 15 33 1422 1))\n;; (list 1 15 33)\n;; >>> (unique_digits (list 152 323 1422 10))\n;; (list )\n(define (unique_digits x)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate unique_digits))\n (check-equal? (candidate (list 15 33 1422 1)) (list 1 15 33))\n (check-equal? (candidate (list 152 323 1422 10)) (list ))\n (check-equal? (candidate (list 12345 2033 111 151)) (list 111 151))\n (check-equal? (candidate (list 135 103 31)) (list 31 135))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "rkt", - "prompt": "#lang racket\n\n;; Input are two strings a and b consisting only of 1s and 0s.\n;; Perform binary XOR on these inputs and return result also as a string.\n;; >>> (string_xor \"010\" \"110\")\n;; \"100\"\n(define (string_xor a b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate string_xor))\n (check-equal? (candidate \"111000\" \"101010\") \"010010\")\n (check-equal? (candidate \"1\" \"1\") \"0\")\n (check-equal? (candidate \"0101\" \"0000\") \"0101\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "rkt", - "prompt": "#lang racket\n\n;; sum_to_n is a function that sums numbers from 1 to n.\n;; >>> (sum_to_n 30)\n;; 465\n;; >>> (sum_to_n 100)\n;; 5050\n;; >>> (sum_to_n 5)\n;; 15\n;; >>> (sum_to_n 10)\n;; 55\n;; >>> (sum_to_n 1)\n;; 1\n(define (sum_to_n n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sum_to_n))\n (check-equal? (candidate 1) 1)\n (check-equal? (candidate 6) 21)\n (check-equal? (candidate 11) 66)\n (check-equal? (candidate 30) 465)\n (check-equal? (candidate 100) 5050)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a list of numbers, return the sum of squares of the numbers\n;; in the list that are odd. Ignore numbers that are negative or not integers.\n;; >>> (double_the_difference (list 1 3 2 0))\n;; 10\n;; >>> (double_the_difference (list -1 -2 0))\n;; 0\n;; >>> (double_the_difference (list 9 -2))\n;; 81\n;; >>> (double_the_difference (list 0))\n;; 0\n;; If the input list is empty, return 0.\n(define (double_the_difference lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate double_the_difference))\n (check-equal? (candidate (list )) 0)\n (check-equal? (candidate (list 5.0 4.0)) 25)\n (check-equal? (candidate (list 0.1 0.2 0.3)) 0)\n (check-equal? (candidate (list -10.0 -20.0 -30.0)) 0)\n (check-equal? (candidate (list -1.0 -2.0 8.0)) 0)\n (check-equal? (candidate (list 0.2 3.0 5.0)) 34)\n (check-equal? (candidate (list -9.0 -7.0 -5.0 -3.0 -1.0 1.0 3.0 5.0 7.0 9.0)) 165)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return length of given string\n;; >>> (strlen \"\")\n;; 0\n;; >>> (strlen \"abc\")\n;; 3\n(define (strlen string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate strlen))\n (check-equal? (candidate \"\") 0)\n (check-equal? (candidate \"x\") 1)\n (check-equal? (candidate \"asdasnakj\") 9)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "rkt", - "prompt": "#lang racket\n\n;; You'll be given a string of words, and your task is to count the number\n;; of boredoms. A boredom is a sentence that starts with the word \"I\".\n;; Sentences are delimited by '.', '?' or '!'.\n;; For example:\n;; >>> (is_bored \"Hello world\")\n;; 0\n;; >>> (is_bored \"The sky is blue. The sun is shining. I love this weather\")\n;; 1\n(define (is_bored S)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_bored))\n (check-equal? (candidate \"Hello world\") 0)\n (check-equal? (candidate \"Is the sky blue?\") 0)\n (check-equal? (candidate \"I love It !\") 1)\n (check-equal? (candidate \"bIt\") 0)\n (check-equal? (candidate \"I feel good today. I will be productive. will kill It\") 2)\n (check-equal? (candidate \"You and I are going for a walk\") 0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function vowels_count which takes a string representing\n;; a word as input and returns the number of vowels in the string.\n;; Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n;; vowel, but only when it is at the end of the given word.\n;; Example:\n;; >>> (vowels_count \"abcde\")\n;; 2\n;; >>> (vowels_count \"ACEDY\")\n;; 3\n(define (vowels_count s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate vowels_count))\n (check-equal? (candidate \"abcde\") 2)\n (check-equal? (candidate \"Alone\") 3)\n (check-equal? (candidate \"key\") 2)\n (check-equal? (candidate \"bye\") 1)\n (check-equal? (candidate \"keY\") 2)\n (check-equal? (candidate \"bYe\") 1)\n (check-equal? (candidate \"ACEDY\") 3)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return n-th Fibonacci number.\n;; >>> (fib 10)\n;; 55\n;; >>> (fib 1)\n;; 1\n;; >>> (fib 8)\n;; 21\n(define (fib n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate fib))\n (check-equal? (candidate 10) 55)\n (check-equal? (candidate 1) 1)\n (check-equal? (candidate 8) 21)\n (check-equal? (candidate 11) 89)\n (check-equal? (candidate 12) 144)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "rkt", - "prompt": "#lang racket\n\n;; Your task is to implement a function that will simplify the expression\n;; x * n. The function returns #t if x * n evaluates to a whole number and #f\n;; otherwise. Both x and n, are string representation of a fraction, and have the following format,\n;; / where both numerator and denominator are positive whole numbers.\n;; You can assume that x, and n are valid fractions, and do not have zero as denominator.\n;; >>> (simplify \"1/5\" \"5/1\")\n;; #t\n;; >>> (simplify \"1/6\" \"2/1\")\n;; #f\n;; >>> (simplify \"7/10\" \"10/2\")\n;; #f\n(define (simplify x n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate simplify))\n (check-equal? (candidate \"1/5\" \"5/1\") #t)\n (check-equal? (candidate \"1/6\" \"2/1\") #f)\n (check-equal? (candidate \"5/1\" \"3/1\") #t)\n (check-equal? (candidate \"7/10\" \"10/2\") #f)\n (check-equal? (candidate \"2/10\" \"50/10\") #t)\n (check-equal? (candidate \"7/2\" \"4/2\") #t)\n (check-equal? (candidate \"11/6\" \"6/1\") #t)\n (check-equal? (candidate \"2/3\" \"5/2\") #f)\n (check-equal? (candidate \"5/2\" \"3/5\") #f)\n (check-equal? (candidate \"2/4\" \"8/4\") #t)\n (check-equal? (candidate \"2/4\" \"4/2\") #t)\n (check-equal? (candidate \"1/5\" \"5/1\") #t)\n (check-equal? (candidate \"1/5\" \"1/5\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a string s, count the number of uppercase vowels in even indices.\n;; For example:\n;; >>> (count_upper \"aBCdEf\")\n;; 1\n;; >>> (count_upper \"abcdefg\")\n;; 0\n;; >>> (count_upper \"dBBE\")\n;; 0\n(define (count_upper s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate count_upper))\n (check-equal? (candidate \"aBCdEf\") 1)\n (check-equal? (candidate \"abcdefg\") 0)\n (check-equal? (candidate \"dBBE\") 0)\n (check-equal? (candidate \"B\") 0)\n (check-equal? (candidate \"U\") 1)\n (check-equal? (candidate \"\") 0)\n (check-equal? (candidate \"EEEE\") 2)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a rectangular grid of wells. Each row represents a single well,\n;; and each 1 in a row represents a single unit of water.\n;; Each well has a corresponding bucket that can be used to extract water from it, \n;; and all buckets have the same capacity.\n;; Your task is to use the buckets to empty the wells.\n;; Output the number of times you need to lower the buckets.\n;; Example 1:\n;; >>> (max_fill (list (list 0 0 1 0) (list 0 1 0 0) (list 1 1 1 1)) 1)\n;; 6\n;; Example 2:\n;; >>> (max_fill (list (list 0 0 1 1) (list 0 0 0 0) (list 1 1 1 1) (list 0 1 1 1)) 2)\n;; 5\n;; Example 3:\n;; >>> (max_fill (list (list 0 0 0) (list 0 0 0)) 5)\n;; 0\n;; Constraints:\n;; * all wells have the same length\n;; * 1 <= grid.length <= 10^2\n;; * 1 <= grid[:,1].length <= 10^2\n;; * grid[i][j] -> 0 | 1\n;; * 1 <= capacity <= 10\n(define (max_fill grid capacity)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate max_fill))\n (check-equal? (candidate (list (list 0 0 1 0) (list 0 1 0 0) (list 1 1 1 1)) 1) 6)\n (check-equal? (candidate (list (list 0 0 1 1) (list 0 0 0 0) (list 1 1 1 1) (list 0 1 1 1)) 2) 5)\n (check-equal? (candidate (list (list 0 0 0) (list 0 0 0)) 5) 0)\n (check-equal? (candidate (list (list 1 1 1 1) (list 1 1 1 1)) 2) 4)\n (check-equal? (candidate (list (list 1 1 1 1) (list 1 1 1 1)) 9) 2)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a list arr of integers and a positive integer k, return a sorted list \n;; of length k with the maximum k numbers in arr.\n;; Example 1:\n;; >>> (maximum (list -3 -4 5) 3)\n;; (list -4 -3 5)\n;; Example 2:\n;; >>> (maximum (list 4 -4 4) 2)\n;; (list 4 4)\n;; Example 3:\n;; >>> (maximum (list -3 2 1 2 -1 -2 1) 1)\n;; (list 2)\n;; Note:\n;; 1. The length of the list will be in the range of [1, 1000].\n;; 2. The elements in the list will be in the range of [-1000, 1000].\n;; 3. 0 <= k <= len(arr)\n(define (maximum arr k)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate maximum))\n (check-equal? (candidate (list -3 -4 5) 3) (list -4 -3 5))\n (check-equal? (candidate (list 4 -4 4) 2) (list 4 4))\n (check-equal? (candidate (list -3 2 1 2 -1 -2 1) 1) (list 2))\n (check-equal? (candidate (list 123 -123 20 0 1 2 -3) 3) (list 2 20 123))\n (check-equal? (candidate (list -123 20 0 1 2 -3) 4) (list 0 1 2 20))\n (check-equal? (candidate (list 5 15 0 3 -13 -8 0) 7) (list -13 -8 0 0 3 5 15))\n (check-equal? (candidate (list -1 0 2 5 3 -10) 2) (list 3 5))\n (check-equal? (candidate (list 1 0 5 -7) 1) (list 5))\n (check-equal? (candidate (list 4 -4) 2) (list -4 4))\n (check-equal? (candidate (list -10 10) 2) (list -10 10))\n (check-equal? (candidate (list 1 2 3 -23 243 -400 0) 0) (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that takes a message, and encodes in such a \n;; way that it swaps case of all letters, replaces all vowels in \n;; the message with the letter that appears 2 places ahead of that \n;; vowel in the english alphabet. \n;; Assume only letters. \n;; Examples:\n;; >>> (encode \"test\")\n;; \"TGST\"\n;; >>> (encode \"This is a message\")\n;; \"tHKS KS C MGSSCGG\"\n(define (encode message)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate encode))\n (check-equal? (candidate \"TEST\") \"tgst\")\n (check-equal? (candidate \"Mudasir\") \"mWDCSKR\")\n (check-equal? (candidate \"YES\") \"ygs\")\n (check-equal? (candidate \"This is a message\") \"tHKS KS C MGSSCGG\")\n (check-equal? (candidate \"I DoNt KnOw WhAt tO WrItE\") \"k dQnT kNqW wHcT Tq wRkTg\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "rkt", - "prompt": "#lang racket\n\n;; remove_vowels is a function that takes string and returns string without vowels.\n;; >>> (remove_vowels \"\")\n;; \"\"\n;; >>> (remove_vowels \"abcdef\")\n;; \"bcdf\"\n;; >>> (remove_vowels \"aaaaa\")\n;; \"\"\n;; >>> (remove_vowels \"aaBAA\")\n;; \"B\"\n;; >>> (remove_vowels \"zbcd\")\n;; \"zbcd\"\n(define (remove_vowels text)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate remove_vowels))\n (check-equal? (candidate \"\") \"\")\n (check-equal? (candidate \"abcdef\nghijklm\") \"bcdf\nghjklm\")\n (check-equal? (candidate \"fedcba\") \"fdcb\")\n (check-equal? (candidate \"eeeee\") \"\")\n (check-equal? (candidate \"acBAA\") \"cB\")\n (check-equal? (candidate \"EcBOO\") \"cB\")\n (check-equal? (candidate \"ybcd\") \"ybcd\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return only positive numbers in the list.\n;; >>> (get_positive (list -1 2 -4 5 6))\n;; (list 2 5 6)\n;; >>> (get_positive (list 5 3 -5 2 -3 3 9 0 123 1 -10))\n;; (list 5 3 2 3 9 123 1)\n(define (get_positive l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate get_positive))\n (check-equal? (candidate (list -1 -2 4 5 6)) (list 4 5 6))\n (check-equal? (candidate (list 5 3 -5 2 3 3 9 0 123 1 -10)) (list 5 3 2 3 3 9 123 1))\n (check-equal? (candidate (list -1 -2)) (list ))\n (check-equal? (candidate (list )) (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n;; >>> (string_sequence 0)\n;; \"0\"\n;; >>> (string_sequence 5)\n;; \"0 1 2 3 4 5\"\n(define (string_sequence n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate string_sequence))\n (check-equal? (candidate 0) \"0\")\n (check-equal? (candidate 3) \"0 1 2 3\")\n (check-equal? (candidate 10) \"0 1 2 3 4 5 6 7 8 9 10\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a positive integer n, you have to make a pile of n levels of stones.\n;; The first level has n stones.\n;; The number of stones in the next level is:\n;; - the next odd number if n is odd.\n;; - the next even number if n is even.\n;; Return the number of stones in each level in a list, where element at index\n;; i represents the number of stones in the level (i+1).\n;; Examples:\n;; >>> (make_a_pile 3)\n;; (list 3 5 7)\n(define (make_a_pile n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate make_a_pile))\n (check-equal? (candidate 3) (list 3 5 7))\n (check-equal? (candidate 4) (list 4 6 8 10))\n (check-equal? (candidate 5) (list 5 7 9 11 13))\n (check-equal? (candidate 6) (list 6 8 10 12 14 16))\n (check-equal? (candidate 8) (list 8 10 12 14 16 18 20 22))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "rkt", - "prompt": "#lang racket\n\n;; Task\n;; 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\n;; then check if the result string is palindrome.\n;; A string is called palindrome if it reads the same backward as forward.\n;; You should return a list containing the result string and #t/#f for the check.\n;; Example\n;; >>> (reverse_delete \"abcde\" \"ae\")\n;; (list \"bcd\" #f)\n;; >>> (reverse_delete \"abcdef\" \"b\")\n;; (list \"acdef\" #f)\n;; >>> (reverse_delete \"abcdedcba\" \"ab\")\n;; (list \"cdedc\" #t)\n(define (reverse_delete s c)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate reverse_delete))\n (check-equal? (candidate \"abcde\" \"ae\") (list \"bcd\" #f))\n (check-equal? (candidate \"abcdef\" \"b\") (list \"acdef\" #f))\n (check-equal? (candidate \"abcdedcba\" \"ab\") (list \"cdedc\" #t))\n (check-equal? (candidate \"dwik\" \"w\") (list \"dik\" #f))\n (check-equal? (candidate \"a\" \"a\") (list \"\" #t))\n (check-equal? (candidate \"abcdedcba\" \"\") (list \"abcdedcba\" #t))\n (check-equal? (candidate \"abcdedcba\" \"v\") (list \"abcdedcba\" #t))\n (check-equal? (candidate \"vabba\" \"v\") (list \"abba\" #t))\n (check-equal? (candidate \"mamma\" \"mia\") (list \"\" #t))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "rkt", - "prompt": "#lang racket\n\n;; For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n;; >>> (flip_case \"Hello\")\n;; \"hELLO\"\n(define (flip_case string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate flip_case))\n (check-equal? (candidate \"\") \"\")\n (check-equal? (candidate \"Hello!\") \"hELLO!\")\n (check-equal? (candidate \"These violent delights have violent ends\") \"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a string s.\n;; if s[i] is a letter, reverse its case from lower to upper or vise versa, \n;; otherwise keep it as it is.\n;; If the string contains no letters, reverse the string.\n;; The function should return the resulted string.\n;; Examples\n;; >>> (solve \"1234\")\n;; \"4321\"\n;; >>> (solve \"ab\")\n;; \"AB\"\n;; >>> (solve \"#a@C\")\n;; \"#A@c\"\n(define (solve s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate solve))\n (check-equal? (candidate \"AsDf\") \"aSdF\")\n (check-equal? (candidate \"1234\") \"4321\")\n (check-equal? (candidate \"ab\") \"AB\")\n (check-equal? (candidate \"#a@C\") \"#A@c\")\n (check-equal? (candidate \"#AsdfW^45\") \"#aSDFw^45\")\n (check-equal? (candidate \"#6@2\") \"2@6#\")\n (check-equal? (candidate \"#$a^D\") \"#$A^d\")\n (check-equal? (candidate \"#ccc\") \"#CCC\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "rkt", - "prompt": "#lang racket\n\n;; Filter an input list of strings only for ones that start with a given prefix.\n;; >>> (filter_by_prefix (list ) \"a\")\n;; (list )\n;; >>> (filter_by_prefix (list \"abc\" \"bcd\" \"cde\" \"array\") \"a\")\n;; (list \"abc\" \"array\")\n(define (filter_by_prefix strings prefix)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate filter_by_prefix))\n (check-equal? (candidate (list ) \"john\") (list ))\n (check-equal? (candidate (list \"xxx\" \"asd\" \"xxy\" \"john doe\" \"xxxAAA\" \"xxx\") \"xxx\") (list \"xxx\" \"xxxAAA\" \"xxx\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "rkt", - "prompt": "#lang racket\n\n;; This function takes two positive numbers x and y and returns the\n;; biggest even integer number that is in the range [x, y] inclusive. If \n;; there's no such number, then the function should return -1.\n;; For example:\n;; >>> (choose_num 12 15)\n;; 14\n;; >>> (choose_num 13 12)\n;; -1\n(define (choose_num x y)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate choose_num))\n (check-equal? (candidate 12 15) 14)\n (check-equal? (candidate 13 12) -1)\n (check-equal? (candidate 33 12354) 12354)\n (check-equal? (candidate 5234 5233) -1)\n (check-equal? (candidate 6 29) 28)\n (check-equal? (candidate 27 10) -1)\n (check-equal? (candidate 7 7) -1)\n (check-equal? (candidate 546 546) 546)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a string representing a sentence,\n;; the sentence contains some words separated by a space,\n;; and you have to return a string that contains the words from the original sentence,\n;; whose lengths are prime numbers,\n;; the order of the words in the new string should be the same as the original one.\n;; Example 1:\n;; >>> (words_in_sentence \"This is a test\")\n;; \"is\"\n;; Example 2:\n;; >>> (words_in_sentence \"lets go for swimming\")\n;; \"go for\"\n;; Constraints:\n;; * 1 <= len(sentence) <= 100\n;; * sentence contains only letters\n(define (words_in_sentence sentence)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate words_in_sentence))\n (check-equal? (candidate \"This is a test\") \"is\")\n (check-equal? (candidate \"lets go for swimming\") \"go for\")\n (check-equal? (candidate \"there is no place available here\") \"there is no place\")\n (check-equal? (candidate \"Hi I am Hussein\") \"Hi am Hussein\")\n (check-equal? (candidate \"go for it\") \"go for it\")\n (check-equal? (candidate \"here\") \"\")\n (check-equal? (candidate \"here is\") \"is\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "rkt", - "prompt": "#lang racket\n\n;; Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n;; >>> (intersperse (list ) 4)\n;; (list )\n;; >>> (intersperse (list 1 2 3) 4)\n;; (list 1 4 2 4 3)\n(define (intersperse numbers delimeter)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate intersperse))\n (check-equal? (candidate (list ) 7) (list ))\n (check-equal? (candidate (list 5 6 3 2) 8) (list 5 8 6 8 3 8 2))\n (check-equal? (candidate (list 2 2 2) 2) (list 2 2 2 2 2))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "rkt", - "prompt": "#lang racket\n\n;; Your task is to write a function that returns true if a number x is a simple\n;; power of n and false in other cases.\n;; x is a simple power of n if n**int=x\n;; For example:\n;; >>> (is_simple_power 1 4)\n;; #t\n;; >>> (is_simple_power 2 2)\n;; #t\n;; >>> (is_simple_power 8 2)\n;; #t\n;; >>> (is_simple_power 3 2)\n;; #f\n;; >>> (is_simple_power 3 1)\n;; #f\n;; >>> (is_simple_power 5 3)\n;; #f\n(define (is_simple_power x n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_simple_power))\n (check-equal? (candidate 16 2) #t)\n (check-equal? (candidate 143214 16) #f)\n (check-equal? (candidate 4 2) #t)\n (check-equal? (candidate 9 3) #t)\n (check-equal? (candidate 16 4) #t)\n (check-equal? (candidate 24 2) #f)\n (check-equal? (candidate 128 4) #f)\n (check-equal? (candidate 12 6) #f)\n (check-equal? (candidate 1 1) #t)\n (check-equal? (candidate 1 12) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that returns true if the given number is the multiplication of 3 prime numbers\n;; and false otherwise.\n;; Knowing that (a) is less then 100. \n;; Example:\n;; >>> (is_multiply_prime 30)\n;; #t\n;; 30 = 2 * 3 * 5\n(define (is_multiply_prime a)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_multiply_prime))\n (check-equal? (candidate 5) #f)\n (check-equal? (candidate 30) #t)\n (check-equal? (candidate 8) #t)\n (check-equal? (candidate 10) #f)\n (check-equal? (candidate 125) #t)\n (check-equal? (candidate 105) #t)\n (check-equal? (candidate 126) #f)\n (check-equal? (candidate 729) #f)\n (check-equal? (candidate 891) #f)\n (check-equal? (candidate 1001) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given the lengths of the three sides of a triangle. Return #t if the three\n;; sides form a right-angled triangle, #f otherwise.\n;; A right-angled triangle is a triangle in which one angle is right angle or \n;; 90 degree.\n;; Example:\n;; >>> (right_angle_triangle 3 4 5)\n;; #t\n;; >>> (right_angle_triangle 1 2 3)\n;; #f\n(define (right_angle_triangle a b c)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate right_angle_triangle))\n (check-equal? (candidate 3 4 5) #t)\n (check-equal? (candidate 1 2 3) #f)\n (check-equal? (candidate 10 6 8) #t)\n (check-equal? (candidate 2 2 2) #f)\n (check-equal? (candidate 7 24 25) #t)\n (check-equal? (candidate 10 5 7) #f)\n (check-equal? (candidate 5 12 13) #t)\n (check-equal? (candidate 15 8 17) #t)\n (check-equal? (candidate 48 55 73) #t)\n (check-equal? (candidate 1 1 1) #f)\n (check-equal? (candidate 2 2 10) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function that takes 3 numbers.\n;; Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n;; Returns false in any other cases.\n;; Examples\n;; >>> (any_int 5 2 7)\n;; #t\n;; >>> (any_int 3 2 2)\n;; #f\n;; >>> (any_int 3 -2 1)\n;; #t\n;; >>> (any_int 3.6 -2.2 2)\n;; #f\n(define (any_int x y z)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate any_int))\n (check-equal? (candidate 2 3 1) #t)\n (check-equal? (candidate 2.5 2 3) #f)\n (check-equal? (candidate 1.5 5 3.5) #f)\n (check-equal? (candidate 2 6 2) #f)\n (check-equal? (candidate 4 2 2) #t)\n (check-equal? (candidate 2.2 2.2 2.2) #f)\n (check-equal? (candidate -4 6 2) #t)\n (check-equal? (candidate 2 1 1) #t)\n (check-equal? (candidate 3 4 7) #t)\n (check-equal? (candidate 3.0 4 7) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "rkt", - "prompt": "#lang racket\n\n;; This function takes a list l and returns a list l' such that\n;; l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n;; to the values of the corresponding indicies of l, but sorted.\n;; >>> (sort_third (list 1 2 3))\n;; (list 1 2 3)\n;; >>> (sort_third (list 5 6 3 4 8 9 2))\n;; (list 2 6 3 4 8 9 5)\n(define (sort_third l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sort_third))\n (check-equal? (candidate (list 5 6 3 4 8 9 2)) (list 2 6 3 4 8 9 5))\n (check-equal? (candidate (list 5 8 3 4 6 9 2)) (list 2 8 3 4 6 9 5))\n (check-equal? (candidate (list 5 6 9 4 8 3 2)) (list 2 6 9 4 8 3 5))\n (check-equal? (candidate (list 5 6 3 4 8 9 2 1)) (list 2 6 3 4 8 9 5 1))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_53_add", - "language": "rkt", - "prompt": "#lang racket\n\n;; Add two numbers x and y\n;; >>> (add 2 3)\n;; 5\n;; >>> (add 5 7)\n;; 12\n(define (add x y)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate add))\n (check-equal? (candidate 0 1) 1)\n (check-equal? (candidate 1 0) 1)\n (check-equal? (candidate 2 3) 5)\n (check-equal? (candidate 5 7) 12)\n (check-equal? (candidate 7 5) 12)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_69_search", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n;; zero, and has a frequency greater than or equal to the value of the integer itself. \n;; The frequency of an integer is the number of times it appears in the list.\n;; If no such a value exist, return -1.\n;; Examples:\n;; >>> (search (list 4 1 2 2 3 1))\n;; 2\n;; >>> (search (list 1 2 2 3 3 3 4 4 4))\n;; 3\n;; >>> (search (list 5 5 4 4 4))\n;; -1\n(define (search lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate search))\n (check-equal? (candidate (list 5 5 5 5 1)) 1)\n (check-equal? (candidate (list 4 1 4 1 4 4)) 4)\n (check-equal? (candidate (list 3 3)) -1)\n (check-equal? (candidate (list 8 8 8 8 8 8 8 8)) 8)\n (check-equal? (candidate (list 2 3 3 2 2)) 2)\n (check-equal? (candidate (list 2 7 8 8 4 8 7 3 9 6 5 10 4 3 6 7 1 7 4 10 8 1)) 1)\n (check-equal? (candidate (list 3 2 8 2)) 2)\n (check-equal? (candidate (list 6 7 1 8 8 10 5 8 5 3 10)) 1)\n (check-equal? (candidate (list 8 8 3 6 5 6 4)) -1)\n (check-equal? (candidate (list 6 9 6 7 1 4 7 1 8 8 9 8 10 10 8 4 10 4 10 1 2 9 5 7 9)) 1)\n (check-equal? (candidate (list 1 9 10 1 3)) 1)\n (check-equal? (candidate (list 6 9 7 5 8 7 5 3 7 5 10 10 3 6 10 2 8 6 5 4 9 5 3 10)) 5)\n (check-equal? (candidate (list 1)) 1)\n (check-equal? (candidate (list 8 8 10 6 4 3 5 8 2 4 2 8 4 6 10 4 2 1 10 2 1 1 5)) 4)\n (check-equal? (candidate (list 2 10 4 8 2 10 5 1 2 9 5 5 6 3 8 6 4 10)) 2)\n (check-equal? (candidate (list 1 6 10 1 6 9 10 8 6 8 7 3)) 1)\n (check-equal? (candidate (list 9 2 4 1 5 1 5 2 5 7 7 7 3 10 1 5 4 2 8 4 1 9 10 7 10 2 8 10 9 4)) 4)\n (check-equal? (candidate (list 2 6 4 2 8 7 5 6 4 10 4 6 3 7 8 8 3 1 4 2 2 10 7)) 4)\n (check-equal? (candidate (list 9 8 6 10 2 6 10 2 7 8 10 3 8 2 6 2 3 1)) 2)\n (check-equal? (candidate (list 5 5 3 9 5 6 3 2 8 5 6 10 10 6 8 4 10 7 7 10 8)) -1)\n (check-equal? (candidate (list 10)) -1)\n (check-equal? (candidate (list 9 7 7 2 4 7 2 10 9 7 5 7 2)) 2)\n (check-equal? (candidate (list 5 4 10 2 1 1 10 3 6 1 8)) 1)\n (check-equal? (candidate (list 7 9 9 9 3 4 1 5 9 1 2 1 1 10 7 5 6 7 6 7 7 6)) 1)\n (check-equal? (candidate (list 3 10 10 9 2)) -1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that takes a string and returns #t if the string\n;; length is a prime number or #f otherwise\n;; Examples\n;; >>> (prime_length \"Hello\")\n;; #t\n;; >>> (prime_length \"abcdcba\")\n;; #t\n;; >>> (prime_length \"kittens\")\n;; #t\n;; >>> (prime_length \"orange\")\n;; #f\n(define (prime_length string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate prime_length))\n (check-equal? (candidate \"Hello\") #t)\n (check-equal? (candidate \"abcdcba\") #t)\n (check-equal? (candidate \"kittens\") #t)\n (check-equal? (candidate \"orange\") #f)\n (check-equal? (candidate \"wow\") #t)\n (check-equal? (candidate \"world\") #t)\n (check-equal? (candidate \"MadaM\") #t)\n (check-equal? (candidate \"Wow\") #t)\n (check-equal? (candidate \"\") #f)\n (check-equal? (candidate \"HI\") #t)\n (check-equal? (candidate \"go\") #t)\n (check-equal? (candidate \"gogo\") #f)\n (check-equal? (candidate \"aaaaaaaaaaaaaaa\") #f)\n (check-equal? (candidate \"Madam\") #t)\n (check-equal? (candidate \"M\") #f)\n (check-equal? (candidate \"0\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_58_common", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return sorted unique common elements for two lists.\n;; >>> (common (list 1 4 3 34 653 2 5) (list 5 7 1 5 9 653 121))\n;; (list 1 5 653)\n;; >>> (common (list 5 3 2 8) (list 3 2))\n;; (list 2 3)\n(define (common l1 l2)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate common))\n (check-equal? (candidate (list 1 4 3 34 653 2 5) (list 5 7 1 5 9 653 121)) (list 1 5 653))\n (check-equal? (candidate (list 5 3 2 8) (list 3 2)) (list 2 3))\n (check-equal? (candidate (list 4 3 2 8) (list 3 2 4)) (list 2 3 4))\n (check-equal? (candidate (list 4 3 2 8) (list )) (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "rkt", - "prompt": "#lang racket\n\n;; The Brazilian factorial is defined as:\n;; brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n;; where n > 0\n;; For example:\n;; >>> (special_factorial 4)\n;; 288\n;; The function will receive an integer as input and should return the special\n;; factorial of this integer.\n(define (special_factorial n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate special_factorial))\n (check-equal? (candidate 4) 288)\n (check-equal? (candidate 5) 34560)\n (check-equal? (candidate 7) 125411328000)\n (check-equal? (candidate 1) 1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "rkt", - "prompt": "#lang racket\n\n;; In this problem, you will implement a function that takes two lists of numbers,\n;; and determines whether it is possible to perform an exchange of elements\n;; between them to make lst1 a list of only even numbers.\n;; There is no limit on the number of exchanged elements between lst1 and lst2.\n;; If it is possible to exchange elements between the lst1 and lst2 to make\n;; all the elements of lst1 to be even, return \"YES\".\n;; Otherwise, return \"NO\".\n;; For example:\n;; >>> (exchange (list 1 2 3 4) (list 1 2 3 4))\n;; \"YES\"\n;; >>> (exchange (list 1 2 3 4) (list 1 5 3 4))\n;; \"NO\"\n;; It is assumed that the input lists will be non-empty.\n(define (exchange lst1 lst2)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate exchange))\n (check-equal? (candidate (list 1 2 3 4) (list 1 2 3 4)) \"YES\")\n (check-equal? (candidate (list 1 2 3 4) (list 1 5 3 4)) \"NO\")\n (check-equal? (candidate (list 1 2 3 4) (list 2 1 4 3)) \"YES\")\n (check-equal? (candidate (list 5 7 3) (list 2 6 4)) \"YES\")\n (check-equal? (candidate (list 5 7 3) (list 2 6 3)) \"NO\")\n (check-equal? (candidate (list 3 2 6 1 8 9) (list 3 5 5 1 1 1)) \"NO\")\n (check-equal? (candidate (list 100 200) (list 200 200)) \"YES\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a non-empty list of integers arr and an integer k, return\n;; the sum of the elements with at most two digits from the first k elements of arr.\n;; Example:\n;; >>> (add_elements (list 111 21 3 4000 5 6 7 8 9) 4)\n;; 24\n;; Constraints:\n;; 1. 1 <= len(arr) <= 100\n;; 2. 1 <= k <= len(arr)\n(define (add_elements arr k)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate add_elements))\n (check-equal? (candidate (list 1 -2 -3 41 57 76 87 88 99) 3) -4)\n (check-equal? (candidate (list 111 121 3 4000 5 6) 2) 0)\n (check-equal? (candidate (list 11 21 3 90 5 6 7 8 9) 4) 125)\n (check-equal? (candidate (list 111 21 3 4000 5 6 7 8 9) 4) 24)\n (check-equal? (candidate (list 1) 1) 1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "rkt", - "prompt": "#lang racket\n\n;; A simple program which should return the value of x if n is \n;; a prime number and should return the value of y otherwise.\n;; Examples:\n;; >>> (x_or_y 7 34 12)\n;; 34\n;; >>> (x_or_y 15 8 5)\n;; 5\n(define (x_or_y n x y)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate x_or_y))\n (check-equal? (candidate 7 34 12) 34)\n (check-equal? (candidate 15 8 5) 5)\n (check-equal? (candidate 3 33 5212) 33)\n (check-equal? (candidate 1259 3 52) 3)\n (check-equal? (candidate 7919 -1 12) -1)\n (check-equal? (candidate 3609 1245 583) 583)\n (check-equal? (candidate 91 56 129) 129)\n (check-equal? (candidate 6 34 1234) 1234)\n (check-equal? (candidate 1 2 0) 0)\n (check-equal? (candidate 2 2 0) 2)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given length of a side and high return area for a triangle.\n;; >>> (triangle_area 5 3)\n;; 7.5\n(define (triangle_area a h)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate triangle_area))\n (check-equal? (candidate 5 3) 7.5)\n (check-equal? (candidate 2 2) 2.0)\n (check-equal? (candidate 10 8) 40.0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "rkt", - "prompt": "#lang racket\n\n;; Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n;; the last couple centuries. However, what people don't know is Tribonacci sequence.\n;; Tribonacci sequence is defined by the recurrence:\n;; tri(1) = 3\n;; tri(n) = 1 + n / 2, if n is even.\n;; tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n;; For example:\n;; tri(2) = 1 + (2 / 2) = 2\n;; tri(4) = 3\n;; tri(3) = tri(2) + tri(1) + tri(4)\n;; = 2 + 3 + 3 = 8 \n;; You are given a non-negative integer number n, you have to a return a list of the \n;; first n + 1 numbers of the Tribonacci sequence.\n;; Examples:\n;; >>> (tri 3)\n;; (list 1 3 2 8)\n(define (tri n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate tri))\n (check-equal? (candidate 3) (list 1 3 2 8))\n (check-equal? (candidate 4) (list 1 3 2 8 3))\n (check-equal? (candidate 5) (list 1 3 2 8 3 15))\n (check-equal? (candidate 6) (list 1 3 2 8 3 15 4))\n (check-equal? (candidate 7) (list 1 3 2 8 3 15 4 24))\n (check-equal? (candidate 8) (list 1 3 2 8 3 15 4 24 5))\n (check-equal? (candidate 9) (list 1 3 2 8 3 15 4 24 5 35))\n (check-equal? (candidate 20) (list 1 3 2 8 3 15 4 24 5 35 6 48 7 63 8 80 9 99 10 120 11))\n (check-equal? (candidate 0) (list 1))\n (check-equal? (candidate 1) (list 1 3))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a list of two strings, both strings consist of open\n;; parentheses '(' or close parentheses ')' only.\n;; Your job is to check if it is possible to concatenate the two strings in\n;; some order, that the resulting string will be good.\n;; A string S is considered to be good if and only if all parentheses in S\n;; are balanced. For example: the string '(())()' is good, while the string\n;; '())' is not.\n;; Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n;; Examples:\n;; >>> (match_parens (list \"()(\" \")\"))\n;; \"Yes\"\n;; >>> (match_parens (list \")\" \")\"))\n;; \"No\"\n(define (match_parens lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate match_parens))\n (check-equal? (candidate (list \"()(\" \")\")) \"Yes\")\n (check-equal? (candidate (list \")\" \")\")) \"No\")\n (check-equal? (candidate (list \"(()(())\" \"())())\")) \"No\")\n (check-equal? (candidate (list \")())\" \"(()()(\")) \"Yes\")\n (check-equal? (candidate (list \"(())))\" \"(()())((\")) \"Yes\")\n (check-equal? (candidate (list \"()\" \"())\")) \"No\")\n (check-equal? (candidate (list \"(()(\" \"()))()\")) \"Yes\")\n (check-equal? (candidate (list \"((((\" \"((())\")) \"No\")\n (check-equal? (candidate (list \")(()\" \"(()(\")) \"No\")\n (check-equal? (candidate (list \")(\" \")(\")) \"No\")\n (check-equal? (candidate (list \"(\" \")\")) \"Yes\")\n (check-equal? (candidate (list \")\" \"(\")) \"Yes\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "rkt", - "prompt": "#lang racket\n\n;; From a list of integers, remove all elements that occur more than once.\n;; Keep order of elements left the same as in the input.\n;; >>> (remove_duplicates (list 1 2 3 2 4))\n;; (list 1 3 4)\n(define (remove_duplicates numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate remove_duplicates))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 1 2 3 4)) (list 1 2 3 4))\n (check-equal? (candidate (list 1 2 3 2 4 3 5)) (list 1 4 5))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return a greatest common divisor of two integers a and b\n;; >>> (greatest_common_divisor 3 5)\n;; 1\n;; >>> (greatest_common_divisor 25 15)\n;; 5\n(define (greatest_common_divisor a b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate greatest_common_divisor))\n (check-equal? (candidate 3 7) 1)\n (check-equal? (candidate 10 15) 5)\n (check-equal? (candidate 49 14) 7)\n (check-equal? (candidate 144 60) 12)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "rkt", - "prompt": "#lang racket\n\n;; Checks if given string is a palindrome\n;; >>> (is_palindrome \"\")\n;; #t\n;; >>> (is_palindrome \"aba\")\n;; #t\n;; >>> (is_palindrome \"aaaaa\")\n;; #t\n;; >>> (is_palindrome \"zbcd\")\n;; #f\n(define (is_palindrome text)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_palindrome))\n (check-equal? (candidate \"\") #t)\n (check-equal? (candidate \"aba\") #t)\n (check-equal? (candidate \"aaaaa\") #t)\n (check-equal? (candidate \"zbcd\") #f)\n (check-equal? (candidate \"xywyx\") #t)\n (check-equal? (candidate \"xywyz\") #f)\n (check-equal? (candidate \"xywzx\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "rkt", - "prompt": "#lang racket\n\n;; xs represent coefficients of a polynomial.\n;; xs[0] + xs[1] * x + xs[2] * x^2 + ....\n;; Return derivative of this polynomial in the same form.\n;; >>> (derivative (list 3 1 2 4 5))\n;; (list 1 4 12 20)\n;; >>> (derivative (list 1 2 3))\n;; (list 2 6)\n(define (derivative xs)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate derivative))\n (check-equal? (candidate (list 3 1 2 4 5)) (list 1 4 12 20))\n (check-equal? (candidate (list 1 2 3)) (list 2 6))\n (check-equal? (candidate (list 3 2 1)) (list 2 2))\n (check-equal? (candidate (list 3 2 1 0 4)) (list 2 2 0 16))\n (check-equal? (candidate (list 1)) (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "rkt", - "prompt": "#lang racket\n\n;; In this task, you will be given a string that represents a number of apples and oranges \n;; that are distributed in a basket of fruit this basket contains \n;; apples, oranges, and mango fruits. Given the string that represents the total number of \n;; the oranges and apples and an integer that represent the total number of the fruits \n;; in the basket return the number of the mango fruits in the basket.\n;; for examble:\n;; >>> (fruit_distribution \"5 apples and 6 oranges\" 19)\n;; 8\n;; >>> (fruit_distribution \"0 apples and 1 oranges\" 3)\n;; 2\n;; >>> (fruit_distribution \"2 apples and 3 oranges\" 100)\n;; 95\n;; >>> (fruit_distribution \"100 apples and 1 oranges\" 120)\n;; 19\n(define (fruit_distribution s n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate fruit_distribution))\n (check-equal? (candidate \"5 apples and 6 oranges\" 19) 8)\n (check-equal? (candidate \"5 apples and 6 oranges\" 21) 10)\n (check-equal? (candidate \"0 apples and 1 oranges\" 3) 2)\n (check-equal? (candidate \"1 apples and 0 oranges\" 3) 2)\n (check-equal? (candidate \"2 apples and 3 oranges\" 100) 95)\n (check-equal? (candidate \"2 apples and 3 oranges\" 5) 0)\n (check-equal? (candidate \"1 apples and 100 oranges\" 120) 19)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that takes an integer a and returns #t \n;; if this ingeger is a cube of some integer number.\n;; Note: you may assume the input is always valid.\n;; Examples:\n;; >>> (iscube 1)\n;; #t\n;; >>> (iscube 2)\n;; #f\n;; >>> (iscube -1)\n;; #t\n;; >>> (iscube 64)\n;; #t\n;; >>> (iscube 0)\n;; #t\n;; >>> (iscube 180)\n;; #f\n(define (iscube a)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate iscube))\n (check-equal? (candidate 1) #t)\n (check-equal? (candidate 2) #f)\n (check-equal? (candidate -1) #t)\n (check-equal? (candidate 64) #t)\n (check-equal? (candidate 180) #f)\n (check-equal? (candidate 1000) #t)\n (check-equal? (candidate 0) #t)\n (check-equal? (candidate 1729) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "rkt", - "prompt": "#lang racket\n\n;; In this Kata, you have to sort a list of non-negative integers according to\n;; number of ones in their binary representation in ascending order.\n;; For similar number of ones, sort based on decimal value.\n;; It must be implemented like this:\n;; >>> (sort_array (list 1 5 2 3 4))\n;; (list 1 2 3 4 5)\n;; >>> (sort_array (list -2 -3 -4 -5 -6))\n;; (list -6 -5 -4 -3 -2)\n;; >>> (sort_array (list 1 0 2 3 4))\n;; (list 0 1 2 3 4)\n(define (sort_array arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sort_array))\n (check-equal? (candidate (list 1 5 2 3 4)) (list 1 2 4 3 5))\n (check-equal? (candidate (list -2 -3 -4 -5 -6)) (list -4 -2 -6 -5 -3))\n (check-equal? (candidate (list 1 0 2 3 4)) (list 0 1 2 4 3))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 2 5 77 4 5 3 5 7 2 3 4)) (list 2 2 4 4 3 3 5 5 5 7 77))\n (check-equal? (candidate (list 3 6 44 12 32 5)) (list 32 3 5 6 12 44))\n (check-equal? (candidate (list 2 4 8 16 32)) (list 2 4 8 16 32))\n (check-equal? (candidate (list 2 4 8 16 32)) (list 2 4 8 16 32))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a list of strings, where each string consists of only digits, return a list.\n;; Each element i of the output should be \"the number of odd elements in the\n;; string i of the input.\" where all the i's should be replaced by the number\n;; of odd digits in the i'th string of the input.\n;; >>> (odd_count (list \"1234567\"))\n;; (list \"the number of odd elements 4n the str4ng 4 of the 4nput.\")\n;; >>> (odd_count (list \"3\" \"11111111\"))\n;; (list \"the number of odd elements 1n the str1ng 1 of the 1nput.\" \"the number of odd elements 8n the str8ng 8 of the 8nput.\")\n(define (odd_count lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate odd_count))\n (check-equal? (candidate (list \"1234567\")) (list \"the number of odd elements 4n the str4ng 4 of the 4nput.\"))\n (check-equal? (candidate (list \"3\" \"11111111\")) (list \"the number of odd elements 1n the str1ng 1 of the 1nput.\" \"the number of odd elements 8n the str8ng 8 of the 8nput.\"))\n (check-equal? (candidate (list \"271\" \"137\" \"314\")) (list \"the number of odd elements 2n the str2ng 2 of the 2nput.\" \"the number of odd elements 3n the str3ng 3 of the 3nput.\" \"the number of odd elements 2n the str2ng 2 of the 2nput.\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "rkt", - "prompt": "#lang racket\n\n;; brackets is a string of \"(\" and \")\".\n;; return #t if every opening bracket has a corresponding closing bracket.\n;; >>> (correct_bracketing \"(\")\n;; #f\n;; >>> (correct_bracketing \"()\")\n;; #t\n;; >>> (correct_bracketing \"(()())\")\n;; #t\n;; >>> (correct_bracketing \")(()\")\n;; #f\n(define (correct_bracketing brackets)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate correct_bracketing))\n (check-equal? (candidate \"()\") #t)\n (check-equal? (candidate \"(()())\") #t)\n (check-equal? (candidate \"()()(()())()\") #t)\n (check-equal? (candidate \"()()((()()())())(()()(()))\") #t)\n (check-equal? (candidate \"((()())))\") #f)\n (check-equal? (candidate \")(()\") #f)\n (check-equal? (candidate \"(\") #f)\n (check-equal? (candidate \"((((\") #f)\n (check-equal? (candidate \")\") #f)\n (check-equal? (candidate \"(()\") #f)\n (check-equal? (candidate \"()()(()())())(()\") #f)\n (check-equal? (candidate \"()()(()())()))()\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "rkt", - "prompt": "#lang racket\n\n;; Task\n;; Write a function that takes a string as input and returns the sum of the upper characters only'\n;; ASCII codes.\n;; Examples:\n;; >>> (digitSum \"\")\n;; 0\n;; >>> (digitSum \"abAB\")\n;; 131\n;; >>> (digitSum \"abcCd\")\n;; 67\n;; >>> (digitSum \"helloE\")\n;; 69\n;; >>> (digitSum \"woArBld\")\n;; 131\n;; >>> (digitSum \"aAaaaXa\")\n;; 153\n(define (digitSum s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate digitSum))\n (check-equal? (candidate \"\") 0)\n (check-equal? (candidate \"abAB\") 131)\n (check-equal? (candidate \"abcCd\") 67)\n (check-equal? (candidate \"helloE\") 69)\n (check-equal? (candidate \"woArBld\") 131)\n (check-equal? (candidate \"aAaaaXa\") 153)\n (check-equal? (candidate \" How are yOu?\") 151)\n (check-equal? (candidate \"You arE Very Smart\") 327)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that accepts a list of strings as a parameter,\n;; deletes the strings that have odd lengths from it,\n;; and returns the resulted list with a sorted order,\n;; The list is always a list of strings and never a list of numbers,\n;; and it may contain duplicates.\n;; The order of the list should be ascending by length of each word, and you\n;; should return the list sorted by that rule.\n;; If two words have the same length, sort the list alphabetically.\n;; The function should return a list of strings in sorted order.\n;; You may assume that all words will have the same length.\n;; For example:\n;; >>> (list_sort (list \"aa\" \"a\" \"aaa\"))\n;; (list \"aa\")\n;; >>> (list_sort (list \"ab\" \"a\" \"aaa\" \"cd\"))\n;; (list \"ab\" \"cd\")\n(define (sorted_list_sum lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sorted_list_sum))\n (check-equal? (candidate (list \"aa\" \"a\" \"aaa\")) (list \"aa\"))\n (check-equal? (candidate (list \"school\" \"AI\" \"asdf\" \"b\")) (list \"AI\" \"asdf\" \"school\"))\n (check-equal? (candidate (list \"d\" \"b\" \"c\" \"a\")) (list ))\n (check-equal? (candidate (list \"d\" \"dcba\" \"abcd\" \"a\")) (list \"abcd\" \"dcba\"))\n (check-equal? (candidate (list \"AI\" \"ai\" \"au\")) (list \"AI\" \"ai\" \"au\"))\n (check-equal? (candidate (list \"a\" \"b\" \"b\" \"c\" \"c\" \"a\")) (list ))\n (check-equal? (candidate (list \"aaaa\" \"bbbb\" \"dd\" \"cc\")) (list \"cc\" \"dd\" \"aaaa\" \"bbbb\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a list arr of integers and you need to return\n;; sum of magnitudes of integers multiplied by product of all signs\n;; of each number in the list, represented by 1, -1 or 0.\n;; Note: return #f for empty arr.\n;; Example:\n;; >>> (prod_signs (list 1 2 2 -4))\n;; 9\n;; >>> (prod_signs (list 0 1))\n;; 0\n;; >>> (prod_signs (list ))\n;; #f\n(define (prod_signs arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate prod_signs))\n (check-equal? (candidate (list 1 2 2 -4)) -9)\n (check-equal? (candidate (list 0 1)) 0)\n (check-equal? (candidate (list 1 1 1 2 3 -1 1)) -10)\n (check-equal? (candidate (list )) #f)\n (check-equal? (candidate (list 2 4 1 2 -1 -1 9)) 20)\n (check-equal? (candidate (list -1 1 -1 1)) 4)\n (check-equal? (candidate (list -1 1 1 1)) -4)\n (check-equal? (candidate (list -1 1 1 0)) 0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return list with elements incremented by 1.\n;; >>> (incr_list (list 1 2 3))\n;; (list 2 3 4)\n;; >>> (incr_list (list 5 3 5 2 3 3 9 0 123))\n;; (list 6 4 6 3 4 4 10 1 124)\n(define (incr_list l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate incr_list))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 3 2 1)) (list 4 3 2))\n (check-equal? (candidate (list 5 2 5 2 3 3 9 0 123)) (list 6 3 6 3 4 4 10 1 124))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "rkt", - "prompt": "#lang racket\n\n;; From a given list of integers, generate a list of rolling maximum element found until given moment\n;; in the sequence.\n;; >>> (rolling_max (list 1 2 3 2 3 4 2))\n;; (list 1 2 3 3 3 4 4)\n(define (rolling_max numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate rolling_max))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 1 2 3 4)) (list 1 2 3 4))\n (check-equal? (candidate (list 4 3 2 1)) (list 4 4 4 4))\n (check-equal? (candidate (list 3 2 3 100 3)) (list 3 3 3 100 100))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "rkt", - "prompt": "#lang racket\n\n;; Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n;; separate those group into separate strings and return the list of those.\n;; Separate groups are balanced (each open brace is properly closed) and not nested within each other\n;; Ignore any spaces in the input string.\n;; >>> (separate_paren_groups \"( ) (( )) (( )( ))\")\n;; (list \"()\" \"(())\" \"(()())\")\n(define (separate_paren_groups paren_string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate separate_paren_groups))\n (check-equal? (candidate \"(()()) ((())) () ((())()())\") (list \"(()())\" \"((()))\" \"()\" \"((())()())\"))\n (check-equal? (candidate \"() (()) ((())) (((())))\") (list \"()\" \"(())\" \"((()))\" \"(((())))\"))\n (check-equal? (candidate \"(()(())((())))\") (list \"(()(())((())))\"))\n (check-equal? (candidate \"( ) (( )) (( )( ))\") (list \"()\" \"(())\" \"(()())\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "rkt", - "prompt": "#lang racket\n\n;; You will be given a string of words separated by commas or spaces. Your task is\n;; to split the string into words and return a list of the words.\n;; For example:\n;; >>> (words_string \"Hi, my name is John\")\n;; (list \"Hi\" \"my\" \"name\" \"is\" \"John\")\n;; >>> (words_string \"One, two, three, four, five, six\")\n;; (list \"One\" \"two\" \"three\" \"four\" \"five\" \"six\")\n(define (words_string s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate words_string))\n (check-equal? (candidate \"Hi, my name is John\") (list \"Hi\" \"my\" \"name\" \"is\" \"John\"))\n (check-equal? (candidate \"One, two, three, four, five, six\") (list \"One\" \"two\" \"three\" \"four\" \"five\" \"six\"))\n (check-equal? (candidate \"Hi, my name\") (list \"Hi\" \"my\" \"name\"))\n (check-equal? (candidate \"One,, two, three, four, five, six,\") (list \"One\" \"two\" \"three\" \"four\" \"five\" \"six\"))\n (check-equal? (candidate \"\") (list ))\n (check-equal? (candidate \"ahmed , gamal\") (list \"ahmed\" \"gamal\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function that takes integers, floats, or strings representing\n;; real numbers, and returns the larger variable in its given variable type.\n;; Return #f if the values are equal.\n;; Note: If a real number is represented as a string, the floating point might be . or ,\n;; >>> (compare_one 1 2.5)\n;; 2.5\n;; >>> (compare_one 1 \"2,3\")\n;; \"2,3\"\n;; >>> (compare_one \"5,1\" \"6\")\n;; \"6\"\n;; >>> (compare_one \"1\" 1)\n;; #f\n(define (compare_one a b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate compare_one))\n (check-equal? (candidate 1 2) 2)\n (check-equal? (candidate 1 2.5) 2.5)\n (check-equal? (candidate 2 3) 3)\n (check-equal? (candidate 5 6) 6)\n (check-equal? (candidate 1 \"2,3\") \"2,3\")\n (check-equal? (candidate \"5,1\" \"6\") \"6\")\n (check-equal? (candidate \"1\" \"2\") \"2\")\n (check-equal? (candidate \"1\" 1) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "rkt", - "prompt": "#lang racket\n\n;; Filter given list of any rktthon values only for integers\n;; >>> (filter_integers (list \"a\" 3.14 5))\n;; (list 5)\n;; >>> (filter_integers (list 1 2 3 \"abc\" #hash() (list )))\n;; (list 1 2 3)\n(define (filter_integers values)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate filter_integers))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 4 #hash() (list ) 23.2 9 \"adasd\")) (list 4 9))\n (check-equal? (candidate (list 3 \"c\" 3 3 \"a\" \"b\")) (list 3 3 3))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "rkt", - "prompt": "#lang racket\n\n;; This function takes a list l and returns a list l' such that\n;; l' is identical to l in the odd indicies, while its values at the even indicies are equal\n;; to the values of the even indicies of l, but sorted.\n;; >>> (sort_even (list 1 2 3))\n;; (list 1 2 3)\n;; >>> (sort_even (list 5 6 3 4))\n;; (list 3 6 5 4)\n(define (sort_even l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sort_even))\n (check-equal? (candidate (list 1 2 3)) (list 1 2 3))\n (check-equal? (candidate (list 5 3 -5 2 -3 3 9 0 123 1 -10)) (list -10 3 -5 2 -3 3 5 0 9 1 123))\n (check-equal? (candidate (list 5 8 -12 4 23 2 3 11 12 -10)) (list -12 8 3 4 5 2 12 11 23 -10))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "rkt", - "prompt": "#lang racket\n\n;; I think we all remember that feeling when the result of some long-awaited\n;; event is finally known. The feelings and thoughts you have at that moment are\n;; definitely worth noting down and comparing.\n;; Your task is to determine if a person correctly guessed the results of a number of matches.\n;; You are given two lists of scores and guesses of equal length, where each index shows a match. \n;; Return a list of the same length denoting how far off each guess was. If they have guessed correctly,\n;; the value is 0, and if not, the value is the absolute difference between the guess and the score.\n;; example:\n;; >>> (compare (list 1 2 3 4 5 1) (list 1 2 3 4 2 -2))\n;; (list 0 0 0 0 3 3)\n;; >>> (compare (list 0 5 0 0 0 4) (list 4 1 1 0 0 -2))\n;; (list 4 4 1 0 0 6)\n(define (compare game guess)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate compare))\n (check-equal? (candidate (list 1 2 3 4 5 1) (list 1 2 3 4 2 -2)) (list 0 0 0 0 3 3))\n (check-equal? (candidate (list 0 0 0 0 0 0) (list 0 0 0 0 0 0)) (list 0 0 0 0 0 0))\n (check-equal? (candidate (list 1 2 3) (list -1 -2 -3)) (list 2 4 6))\n (check-equal? (candidate (list 1 2 3 5) (list -1 2 3 4)) (list 2 0 0 1))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a positive integer n, return a list that has the number of even and odd\n;; integer palindromes that fall within the range(1, n), inclusive.\n;; Example 1:\n;; >>> (even_odd_palindrome 3)\n;; (list 1 2)\n;; Explanation:\n;; Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n;; Example 2:\n;; >>> (even_odd_palindrome 12)\n;; (list 4 6)\n;; Explanation:\n;; Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n;; Note:\n;; 1. 1 <= n <= 10^3\n;; 2. returned list has the number of even and odd integer palindromes respectively.\n(define (even_odd_palindrome n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate even_odd_palindrome))\n (check-equal? (candidate 123) (list 8 13))\n (check-equal? (candidate 12) (list 4 6))\n (check-equal? (candidate 3) (list 1 2))\n (check-equal? (candidate 63) (list 6 8))\n (check-equal? (candidate 25) (list 5 6))\n (check-equal? (candidate 19) (list 4 6))\n (check-equal? (candidate 9) (list 4 5))\n (check-equal? (candidate 1) (list 0 1))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "rkt", - "prompt": "#lang racket\n\n;; The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n;; fib4(0) -> 0\n;; fib4(1) -> 0\n;; fib4(2) -> 2\n;; fib4(3) -> 0\n;; fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n;; Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n;; >>> (fib4 5)\n;; 4\n;; >>> (fib4 6)\n;; 8\n;; >>> (fib4 7)\n;; 14\n(define (fib4 n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate fib4))\n (check-equal? (candidate 5) 4)\n (check-equal? (candidate 8) 28)\n (check-equal? (candidate 10) 104)\n (check-equal? (candidate 12) 386)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given two positive integers a and b, return the even digits between a\n;; and b, in ascending order.\n;; For example:\n;; >>> (generate_integers 2 8)\n;; (list 2 4 6 8)\n;; >>> (generate_integers 8 2)\n;; (list 2 4 6 8)\n;; >>> (generate_integers 10 14)\n;; (list )\n(define (generate_integers a b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate generate_integers))\n (check-equal? (candidate 2 10) (list 2 4 6 8))\n (check-equal? (candidate 10 2) (list 2 4 6 8))\n (check-equal? (candidate 132 2) (list 2 4 6 8))\n (check-equal? (candidate 17 89) (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "rkt", - "prompt": "#lang racket\n\n;; For a given list of input numbers, calculate Mean Absolute Deviation\n;; around the mean of this dataset.\n;; Mean Absolute Deviation is the average absolute difference between each\n;; element and a centerpoint (mean in this case):\n;; MAD = average | x - x_mean |\n;; >>> (mean_absolute_deviation (list 1.0 2.0 3.0 4.0))\n;; 1.0\n(define (mean_absolute_deviation numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate mean_absolute_deviation))\n (check-equal? (candidate (list 1.0 2.0)) 0.5)\n (check-equal? (candidate (list 1.0 2.0 3.0 4.0)) 1.0)\n (check-equal? (candidate (list 1.0 2.0 3.0 4.0 5.0)) 1.2)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function encrypt that takes a string as an argument and\n;; returns a string encrypted with the alphabet being rotated. \n;; The alphabet should be rotated in a manner such that the letters \n;; shift down by two multiplied to two places.\n;; For example:\n;; >>> (encrypt \"hi\")\n;; \"lm\"\n;; >>> (encrypt \"asdfghjkl\")\n;; \"ewhjklnop\"\n;; >>> (encrypt \"gf\")\n;; \"kj\"\n;; >>> (encrypt \"et\")\n;; \"ix\"\n(define (encrypt s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate encrypt))\n (check-equal? (candidate \"hi\") \"lm\")\n (check-equal? (candidate \"asdfghjkl\") \"ewhjklnop\")\n (check-equal? (candidate \"gf\") \"kj\")\n (check-equal? (candidate \"et\") \"ix\")\n (check-equal? (candidate \"faewfawefaewg\") \"jeiajeaijeiak\")\n (check-equal? (candidate \"hellomyfriend\") \"lippsqcjvmirh\")\n (check-equal? (candidate \"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\") \"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\")\n (check-equal? (candidate \"a\") \"e\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n;; The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n;; as follows: start with any positive integer n. Then each term is obtained from the \n;; previous term as follows: if the previous term is even, the next term is one half of \n;; the previous term. If the previous term is odd, the next term is 3 times the previous\n;; term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n;; Note: \n;; 1. Collatz(1) is [1].\n;; 2. returned list sorted in increasing order.\n;; For example:\n;; get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n;; >>> (get_odd_collatz 5)\n;; (list 1 5)\n(define (get_odd_collatz n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate get_odd_collatz))\n (check-equal? (candidate 14) (list 1 5 7 11 13 17))\n (check-equal? (candidate 5) (list 1 5))\n (check-equal? (candidate 12) (list 1 3 5))\n (check-equal? (candidate 1) (list 1))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "rkt", - "prompt": "#lang racket\n\n;; Find how many times a given substring can be found in the original string. Count overlaping cases.\n;; >>> (how_many_times \"\" \"a\")\n;; 0\n;; >>> (how_many_times \"aaa\" \"a\")\n;; 3\n;; >>> (how_many_times \"aaaa\" \"aa\")\n;; 3\n(define (how_many_times string substring)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate how_many_times))\n (check-equal? (candidate \"\" \"x\") 0)\n (check-equal? (candidate \"xyxyxyx\" \"x\") 4)\n (check-equal? (candidate \"cacacacac\" \"cac\") 4)\n (check-equal? (candidate \"john doe\" \"john\") 1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "rkt", - "prompt": "#lang racket\n\n;; We have a list 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n;; numbers in the list will be randomly ordered. Your task is to determine if\n;; it is possible to get a list sorted in non-decreasing order by performing \n;; the following operation on the given list:\n;; You are allowed to perform right shift operation any number of times.\n;; One right shift operation means shifting all elements of the list by one\n;; position in the right direction. The last element of the list will be moved to\n;; the starting position in the list i.e. 0th index. \n;; If it is possible to obtain the sorted list by performing the above operation\n;; then return #t else return #f.\n;; If the given list is empty then return #t.\n;; Note: The given list is guaranteed to have unique elements.\n;; For Example:\n;; >>> (move_one_ball (list 3 4 5 1 2))\n;; #t\n;; Explanation: By performin 2 right shift operations, non-decreasing order can\n;; be achieved for the given list.\n;; >>> (move_one_ball (list 3 5 4 1 2))\n;; #f\n;; Explanation:It is not possible to get non-decreasing order for the given\n;; list by performing any number of right shift operations.\n(define (move_one_ball arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate move_one_ball))\n (check-equal? (candidate (list 3 4 5 1 2)) #t)\n (check-equal? (candidate (list 3 5 10 1 2)) #t)\n (check-equal? (candidate (list 4 3 1 2)) #f)\n (check-equal? (candidate (list 3 5 4 1 2)) #f)\n (check-equal? (candidate (list )) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function which sorts the given list of integers\n;; in ascending order according to the sum of their digits.\n;; Note: if there are several items with similar sum of their digits,\n;; order them based on their index in original list.\n;; For example:\n;; >>> (order_by_points (list 1 11 -1 -11 -12))\n;; (list -1 -11 1 -12 11)\n;; >>> (order_by_points (list ))\n;; (list )\n(define (order_by_points nums)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate order_by_points))\n (check-equal? (candidate (list 1 11 -1 -11 -12)) (list -1 -11 1 -12 11))\n (check-equal? (candidate (list 1234 423 463 145 2 423 423 53 6 37 3457 3 56 0 46)) (list 0 2 3 6 53 423 423 423 1234 145 37 46 56 463 3457))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 1 -11 -32 43 54 -98 2 -3)) (list -3 -32 -98 -11 1 2 43 54))\n (check-equal? (candidate (list 1 2 3 4 5 6 7 8 9 10 11)) (list 1 10 2 11 3 4 5 6 7 8 9))\n (check-equal? (candidate (list 0 6 6 -76 -21 23 4)) (list -76 -21 0 4 23 6 6))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return list of prime factors of given integer in the order from smallest to largest.\n;; Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n;; Input number should be equal to the product of all factors\n;; >>> (factorize 8)\n;; (list 2 2 2)\n;; >>> (factorize 25)\n;; (list 5 5)\n;; >>> (factorize 70)\n;; (list 2 5 7)\n(define (factorize n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate factorize))\n (check-equal? (candidate 2) (list 2))\n (check-equal? (candidate 4) (list 2 2))\n (check-equal? (candidate 8) (list 2 2 2))\n (check-equal? (candidate 57) (list 3 19))\n (check-equal? (candidate 3249) (list 3 3 19 19))\n (check-equal? (candidate 185193) (list 3 3 3 19 19 19))\n (check-equal? (candidate 20577) (list 3 19 19 19))\n (check-equal? (candidate 18) (list 2 3 3))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return #t if all numbers in the list l are below threshold t.\n;; >>> (below_threshold (list 1 2 4 10) 100)\n;; #t\n;; >>> (below_threshold (list 1 20 4 10) 5)\n;; #f\n(define (below_threshold l t)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate below_threshold))\n (check-equal? (candidate (list 1 2 4 10) 100) #t)\n (check-equal? (candidate (list 1 20 4 10) 5) #f)\n (check-equal? (candidate (list 1 20 4 10) 21) #t)\n (check-equal? (candidate (list 1 20 4 10) 22) #t)\n (check-equal? (candidate (list 1 8 4 10) 11) #t)\n (check-equal? (candidate (list 1 8 4 10) 10) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given two positive integers n and m, and your task is to compute the\n;; average of the integers from n through m (including n and m). \n;; Round the answer to the nearest integer and convert that to binary.\n;; If n is greater than m, return -1.\n;; Example:\n;; >>> (rounded_avg 1 5)\n;; \"0b11\"\n;; >>> (rounded_avg 7 5)\n;; -1\n;; >>> (rounded_avg 10 20)\n;; \"0b1111\"\n;; >>> (rounded_avg 20 33)\n;; \"0b11010\"\n(define (rounded_avg n m)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate rounded_avg))\n (check-equal? (candidate 1 5) \"0b11\")\n (check-equal? (candidate 7 13) \"0b1010\")\n (check-equal? (candidate 964 977) \"0b1111001010\")\n (check-equal? (candidate 996 997) \"0b1111100100\")\n (check-equal? (candidate 560 851) \"0b1011000010\")\n (check-equal? (candidate 185 546) \"0b101101110\")\n (check-equal? (candidate 362 496) \"0b110101101\")\n (check-equal? (candidate 350 902) \"0b1001110010\")\n (check-equal? (candidate 197 233) \"0b11010111\")\n (check-equal? (candidate 7 5) -1)\n (check-equal? (candidate 5 1) -1)\n (check-equal? (candidate 5 5) \"0b101\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "rkt", - "prompt": "#lang racket\n\n;; Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n;; For each of the group, output the deepest level of nesting of parentheses.\n;; E.g. (()()) has maximum two levels of nesting while ((())) has three.\n;; >>> (parse_nested_parens \"(()()) ((())) () ((())()())\")\n;; (list 2 3 1 3)\n(define (parse_nested_parens paren_string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate parse_nested_parens))\n (check-equal? (candidate \"(()()) ((())) () ((())()())\") (list 2 3 1 3))\n (check-equal? (candidate \"() (()) ((())) (((())))\") (list 1 2 3 4))\n (check-equal? (candidate \"(()(())((())))\") (list 4))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n;; Examples\n;; >>> (solution (list 5 8 7 1))\n;; 12\n;; >>> (solution (list 3 3 3 3 3))\n;; 9\n;; >>> (solution (list 30 13 24 321))\n;; 0\n(define (solution lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate solution))\n (check-equal? (candidate (list 5 8 7 1)) 12)\n (check-equal? (candidate (list 3 3 3 3 3)) 9)\n (check-equal? (candidate (list 30 13 24 321)) 0)\n (check-equal? (candidate (list 5 9)) 5)\n (check-equal? (candidate (list 2 4 8)) 0)\n (check-equal? (candidate (list 30 13 23 32)) 23)\n (check-equal? (candidate (list 3 13 2 9)) 3)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a positive integer n. You have to create an integer list a of length n.\n;; For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n;; Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n;; and a[i] + a[j] + a[k] is a multiple of 3.\n;; Example :\n;; >>> (get_max_triples 5)\n;; 1\n;; Explanation: \n;; a = [1, 3, 7, 13, 21]\n;; The only valid triple is (1, 7, 13).\n(define (get_max_triples n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate get_max_triples))\n (check-equal? (candidate 5) 1)\n (check-equal? (candidate 6) 4)\n (check-equal? (candidate 10) 36)\n (check-equal? (candidate 100) 53361)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "rkt", - "prompt": "#lang racket\n\n;; There are eight planets in our solar system: the closerst to the Sun \n;; is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n;; Uranus, Neptune.\n;; Write a function that takes two planet names as strings planet1 and planet2. \n;; The function should return a list containing all planets whose orbits are \n;; located between the orbit of planet1 and the orbit of planet2, sorted by \n;; the proximity to the sun. \n;; The function should return an empty list if planet1 or planet2\n;; are not correct planet names. \n;; Examples\n;; >>> (bf \"Jupiter\" \"Neptune\")\n;; (list \"Saturn\" \"Uranus\")\n;; >>> (bf \"Earth\" \"Mercury\")\n;; \"Venus\"\n;; >>> (bf \"Mercury\" \"Uranus\")\n;; (list \"Venus\" \"Earth\" \"Mars\" \"Jupiter\" \"Saturn\")\n(define (bf planet1 planet2)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate bf))\n (check-equal? (candidate \"Jupiter\" \"Neptune\") (list \"Saturn\" \"Uranus\"))\n (check-equal? (candidate \"Earth\" \"Mercury\") (list \"Venus\"))\n (check-equal? (candidate \"Mercury\" \"Uranus\") (list \"Venus\" \"Earth\" \"Mars\" \"Jupiter\" \"Saturn\"))\n (check-equal? (candidate \"Neptune\" \"Venus\") (list \"Earth\" \"Mars\" \"Jupiter\" \"Saturn\" \"Uranus\"))\n (check-equal? (candidate \"Earth\" \"Earth\") (list ))\n (check-equal? (candidate \"Mars\" \"Earth\") (list ))\n (check-equal? (candidate \"Jupiter\" \"Makemake\") (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a list of integers.\n;; Write a function next_smallest() that returns the 2nd smallest element of the list.\n;; Return #f if there is no such element.\n;; >>> (next_smallest (list 1 2 3 4 5))\n;; 2\n;; >>> (next_smallest (list 5 1 4 3 2))\n;; 2\n;; >>> (next_smallest (list ))\n;; #f\n;; >>> (next_smallest (list 1 1))\n;; #f\n(define (next_smallest lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate next_smallest))\n (check-equal? (candidate (list 1 2 3 4 5)) 2)\n (check-equal? (candidate (list 5 1 4 3 2)) 2)\n (check-equal? (candidate (list )) #f)\n (check-equal? (candidate (list 1 1)) #f)\n (check-equal? (candidate (list 1 1 1 1 0)) 1)\n (check-equal? (candidate (list 1 1)) #f)\n (check-equal? (candidate (list -35 34 12 -45)) -35)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "rkt", - "prompt": "#lang racket\n\n;; Input is a space-delimited string of numberals from 'zero' to 'nine'.\n;; Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n;; Return the string with numbers sorted from smallest to largest\n;; >>> (sort_numbers \"three one five\")\n;; \"one three five\"\n(define (sort_numbers numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sort_numbers))\n (check-equal? (candidate \"\") \"\")\n (check-equal? (candidate \"three\") \"three\")\n (check-equal? (candidate \"three five nine\") \"three five nine\")\n (check-equal? (candidate \"five zero four seven nine eight\") \"zero four five seven eight nine\")\n (check-equal? (candidate \"six five four three two one zero\") \"zero one two three four five six\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given 2 words. You need to return #t if the second word or any of its rotations is a substring in the first word\n;; >>> (cycpattern_check \"abcd\" \"abd\")\n;; #f\n;; >>> (cycpattern_check \"hello\" \"ell\")\n;; #t\n;; >>> (cycpattern_check \"whassup\" \"psus\")\n;; #f\n;; >>> (cycpattern_check \"abab\" \"baa\")\n;; #t\n;; >>> (cycpattern_check \"efef\" \"eeff\")\n;; #f\n;; >>> (cycpattern_check \"himenss\" \"simen\")\n;; #t\n(define (cycpattern_check a b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate cycpattern_check))\n (check-equal? (candidate \"xyzw\" \"xyw\") #f)\n (check-equal? (candidate \"yello\" \"ell\") #t)\n (check-equal? (candidate \"whattup\" \"ptut\") #f)\n (check-equal? (candidate \"efef\" \"fee\") #t)\n (check-equal? (candidate \"abab\" \"aabb\") #f)\n (check-equal? (candidate \"winemtt\" \"tinem\") #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "rkt", - "prompt": "#lang racket\n\n;; You will be given a number in decimal form and your task is to convert it to\n;; binary format. The function should return a string, with each character representing a binary\n;; number. Each character in the string will be '0' or '1'.\n;; There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n;; The extra characters are there to help with the format.\n;; Examples:\n;; >>> (decimal_to_binary 15)\n;; \"db1111db\"\n;; >>> (decimal_to_binary 32)\n;; \"db100000db\"\n(define (decimal_to_binary decimal)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate decimal_to_binary))\n (check-equal? (candidate 0) \"db0db\")\n (check-equal? (candidate 32) \"db100000db\")\n (check-equal? (candidate 103) \"db1100111db\")\n (check-equal? (candidate 15) \"db1111db\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "rkt", - "prompt": "#lang racket\n\n;; Filter an input list of strings only for ones that contain given substring\n;; >>> (filter_by_substring (list ) \"a\")\n;; (list )\n;; >>> (filter_by_substring (list \"abc\" \"bacd\" \"cde\" \"array\") \"a\")\n;; (list \"abc\" \"bacd\" \"array\")\n(define (filter_by_substring strings substring)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate filter_by_substring))\n (check-equal? (candidate (list ) \"john\") (list ))\n (check-equal? (candidate (list \"xxx\" \"asd\" \"xxy\" \"john doe\" \"xxxAAA\" \"xxx\") \"xxx\") (list \"xxx\" \"xxxAAA\" \"xxx\"))\n (check-equal? (candidate (list \"xxx\" \"asd\" \"aaaxxy\" \"john doe\" \"xxxAAA\" \"xxx\") \"xx\") (list \"xxx\" \"aaaxxy\" \"xxxAAA\" \"xxx\"))\n (check-equal? (candidate (list \"grunt\" \"trumpet\" \"prune\" \"gruesome\") \"run\") (list \"grunt\" \"prune\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given an integer. return a list that has the number of even and odd digits respectively.\n;; Example:\n;; >>> (even_odd_count -12)\n;; (list 1 1)\n;; >>> (even_odd_count 123)\n;; (list 1 2)\n(define (even_odd_count num)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate even_odd_count))\n (check-equal? (candidate 7) (list 0 1))\n (check-equal? (candidate -78) (list 1 1))\n (check-equal? (candidate 3452) (list 2 2))\n (check-equal? (candidate 346211) (list 3 3))\n (check-equal? (candidate -345821) (list 3 3))\n (check-equal? (candidate -2) (list 1 0))\n (check-equal? (candidate -45347) (list 2 3))\n (check-equal? (candidate 0) (list 1 0))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that accepts a list of strings.\n;; The list contains different words. Return the word with maximum number\n;; of unique characters. If multiple strings have maximum number of unique\n;; characters, return the one which comes first in lexicographical order.\n;; >>> (find_max (list \"name\" \"of\" \"string\"))\n;; \"string\"\n;; >>> (find_max (list \"name\" \"enam\" \"game\"))\n;; \"enam\"\n;; >>> (find_max (list \"aaaaaaa\" \"bb\" \"cc\"))\n;; \"aaaaaaa\"\n(define (find_max words)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate find_max))\n (check-equal? (candidate (list \"name\" \"of\" \"string\")) \"string\")\n (check-equal? (candidate (list \"name\" \"enam\" \"game\")) \"enam\")\n (check-equal? (candidate (list \"aaaaaaa\" \"bb\" \"cc\")) \"aaaaaaa\")\n (check-equal? (candidate (list \"abc\" \"cba\")) \"abc\")\n (check-equal? (candidate (list \"play\" \"this\" \"game\" \"of\" \"footbott\")) \"footbott\")\n (check-equal? (candidate (list \"we\" \"are\" \"gonna\" \"rock\")) \"gonna\")\n (check-equal? (candidate (list \"we\" \"are\" \"a\" \"mad\" \"nation\")) \"nation\")\n (check-equal? (candidate (list \"this\" \"is\" \"a\" \"prrk\")) \"this\")\n (check-equal? (candidate (list \"b\")) \"b\")\n (check-equal? (candidate (list \"play\" \"play\" \"play\")) \"play\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a positive integer n, return the count of the numbers of n-digit\n;; positive integers that start or end with 1.\n(define (starts_one_ends n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate starts_one_ends))\n (check-equal? (candidate 1) 1)\n (check-equal? (candidate 2) 18)\n (check-equal? (candidate 3) 180)\n (check-equal? (candidate 4) 1800)\n (check-equal? (candidate 5) 18000)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function that returns a list (a, b), where 'a' is\n;; the largest of negative integers, and 'b' is the smallest\n;; of positive integers in a list.\n;; If there is no negative or positive integers, return them as #f.\n;; Examples:\n;; >>> (largest_smallest_integers (list 2 4 1 3 5 7))\n;; (list #f 1)\n;; >>> (largest_smallest_integers (list ))\n;; (list #f #f)\n;; >>> (largest_smallest_integers (list 0))\n;; (list #f #f)\n(define (largest_smallest_integers lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate largest_smallest_integers))\n (check-equal? (candidate (list 2 4 1 3 5 7)) (list #f 1))\n (check-equal? (candidate (list 2 4 1 3 5 7 0)) (list #f 1))\n (check-equal? (candidate (list 1 3 2 4 5 6 -2)) (list -2 1))\n (check-equal? (candidate (list 4 5 3 6 2 7 -7)) (list -7 2))\n (check-equal? (candidate (list 7 3 8 4 9 2 5 -9)) (list -9 2))\n (check-equal? (candidate (list )) (list #f #f))\n (check-equal? (candidate (list 0)) (list #f #f))\n (check-equal? (candidate (list -1 -3 -5 -6)) (list -1 #f))\n (check-equal? (candidate (list -1 -3 -5 -6 0)) (list -1 #f))\n (check-equal? (candidate (list -6 -4 -4 -3 1)) (list -3 1))\n (check-equal? (candidate (list -6 -4 -4 -3 -100 1)) (list -3 1))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "rkt", - "prompt": "#lang racket\n\n;; \"Given a list representing a branch of a tree that has non-negative integer nodes\n;; your task is to pluck one of the nodes and return it.\n;; The plucked node should be the node with the smallest even value.\n;; If multiple nodes with the same smallest even value are found return the node that has smallest index.\n;; The plucked node should be returned in a list, [ smalest_value, its index ],\n;; If there are no even values or the given list is empty, return [].\n;; Example 1:\n;; >>> (pluck (list 4 2 3))\n;; (list 2 1)\n;; Explanation: 2 has the smallest even value, and 2 has the smallest index.\n;; Example 2:\n;; >>> (pluck (list 1 2 3))\n;; (list 2 1)\n;; Explanation: 2 has the smallest even value, and 2 has the smallest index.\n;; Example 3:\n;; >>> (pluck (list ))\n;; (list )\n;; Example 4:\n;; >>> (pluck (list 5 0 3 0 4 2))\n;; (list 0 1)\n;; Explanation: 0 is the smallest value, but there are two zeros,\n;; so we will choose the first zero, which has the smallest index.\n;; Constraints:\n;; * 1 <= nodes.length <= 10000\n;; * 0 <= node.value\n(define (pluck arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate pluck))\n (check-equal? (candidate (list 4 2 3)) (list 2 1))\n (check-equal? (candidate (list 1 2 3)) (list 2 1))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 5 0 3 0 4 2)) (list 0 1))\n (check-equal? (candidate (list 1 2 3 0 5 3)) (list 0 3))\n (check-equal? (candidate (list 5 4 8 4 8)) (list 4 1))\n (check-equal? (candidate (list 7 6 7 1)) (list 6 1))\n (check-equal? (candidate (list 7 9 7 1)) (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function count_nums which takes a list of integers and returns\n;; the number of elements which has a sum of digits > 0.\n;; If a number is negative, then its first signed digit will be negative:\n;; e.g. -123 has signed digits -1, 2, and 3.\n;; >>> (count_nums (list ))\n;; 0\n;; >>> (count_nums (list -1 11 -11))\n;; 1\n;; >>> (count_nums (list 1 1 2))\n;; 3\n(define (count_nums arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate count_nums))\n (check-equal? (candidate (list )) 0)\n (check-equal? (candidate (list -1 -2 0)) 0)\n (check-equal? (candidate (list 1 1 2 -2 3 4 5)) 6)\n (check-equal? (candidate (list 1 6 9 -6 0 1 5)) 5)\n (check-equal? (candidate (list 1 100 98 -7 1 -1)) 4)\n (check-equal? (candidate (list 12 23 34 -45 -56 0)) 5)\n (check-equal? (candidate (list 0 1)) 1)\n (check-equal? (candidate (list 1)) 1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n;; each cell of the grid contains a value. Every integer in the range [1, N * N]\n;; inclusive appears exactly once on the cells of the grid.\n;; You have to find the minimum path of length k in the grid. You can start\n;; from any cell, and in each step you can move to any of the neighbor cells,\n;; in other words, you can go to cells which share an edge with you current\n;; cell.\n;; Please note that a path of length k means visiting exactly k cells (not\n;; necessarily distinct).\n;; You CANNOT go off the grid.\n;; A path A (of length k) is considered less than a path B (of length k) if\n;; after making the ordered lists of the values on the cells that A and B go\n;; through (let's call them lst_A and lst_B), lst_A is lexicographically less\n;; than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n;; such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n;; lst_A[j] = lst_B[j].\n;; It is guaranteed that the answer is unique.\n;; Return an ordered list of the values on the cells that the minimum path go through.\n;; Examples: \n;; >>> (minPath (list (list 1 2 3) (list 4 5 6) (list 7 8 9)) 3)\n;; (list 1 2 1)\n;; >>> (minPath (list (list 5 9 3) (list 4 1 6) (list 7 8 2)) 1)\n;; (list 1)\n(define (minPath grid k)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate minPath))\n (check-equal? (candidate (list (list 1 2 3) (list 4 5 6) (list 7 8 9)) 3) (list 1 2 1))\n (check-equal? (candidate (list (list 5 9 3) (list 4 1 6) (list 7 8 2)) 1) (list 1))\n (check-equal? (candidate (list (list 1 2 3 4) (list 5 6 7 8) (list 9 10 11 12) (list 13 14 15 16)) 4) (list 1 2 1 2))\n (check-equal? (candidate (list (list 6 4 13 10) (list 5 7 12 1) (list 3 16 11 15) (list 8 14 9 2)) 7) (list 1 10 1 10 1 10 1))\n (check-equal? (candidate (list (list 8 14 9 2) (list 6 4 13 15) (list 5 7 1 12) (list 3 10 11 16)) 5) (list 1 7 1 7 1))\n (check-equal? (candidate (list (list 11 8 7 2) (list 5 16 14 4) (list 9 3 15 6) (list 12 13 10 1)) 9) (list 1 6 1 6 1 6 1 6 1))\n (check-equal? (candidate (list (list 12 13 10 1) (list 9 3 15 6) (list 5 16 14 4) (list 11 8 7 2)) 12) (list 1 6 1 6 1 6 1 6 1 6 1 6))\n (check-equal? (candidate (list (list 2 7 4) (list 3 1 5) (list 6 8 9)) 8) (list 1 3 1 3 1 3 1 3))\n (check-equal? (candidate (list (list 6 1 5) (list 3 8 9) (list 2 7 4)) 8) (list 1 5 1 5 1 5 1 5))\n (check-equal? (candidate (list (list 1 2) (list 3 4)) 10) (list 1 2 1 2 1 2 1 2 1 2))\n (check-equal? (candidate (list (list 1 3) (list 3 2)) 10) (list 1 3 1 3 1 3 1 3 1 3))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given list of integers, return list in strange order.\n;; Strange sorting, is when you start with the minimum value,\n;; then maximum of the remaining integers, then minimum and so on.\n;; Examples:\n;; >>> (strange_sort_list (list 1 2 3 4))\n;; (list 1 4 2 3)\n;; >>> (strange_sort_list (list 5 5 5 5))\n;; (list 5 5 5 5)\n;; >>> (strange_sort_list (list ))\n;; (list )\n(define (strange_sort_list lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate strange_sort_list))\n (check-equal? (candidate (list 1 2 3 4)) (list 1 4 2 3))\n (check-equal? (candidate (list 5 6 7 8 9)) (list 5 9 6 8 7))\n (check-equal? (candidate (list 1 2 3 4 5)) (list 1 5 2 4 3))\n (check-equal? (candidate (list 5 6 7 8 9 1)) (list 1 9 5 8 6 7))\n (check-equal? (candidate (list 5 5 5 5)) (list 5 5 5 5))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 1 2 3 4 5 6 7 8)) (list 1 8 2 7 3 6 4 5))\n (check-equal? (candidate (list 0 2 2 2 5 5 -5 -5)) (list -5 5 -5 5 0 2 2 2))\n (check-equal? (candidate (list 111111)) (list 111111))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a string 'text', return its md5 hash equivalent string.\n;; If 'text' is an empty string, return #f.\n;; >>> (string_to_md5 \"Hello world\")\n;; \"3e25960a79dbc69b674cd4ec67a72c62\"\n(define (string_to_md5 text)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate string_to_md5))\n (check-equal? (candidate \"Hello world\") \"3e25960a79dbc69b674cd4ec67a72c62\")\n (check-equal? (candidate \"\") #f)\n (check-equal? (candidate \"A B C\") \"0ef78513b0cb8cef12743f5aeb35f888\")\n (check-equal? (candidate \"password\") \"5f4dcc3b5aa765d61d8327deb882cf99\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a word. Your task is to find the closest vowel that stands between \n;; two consonants from the right side of the word (case sensitive).\n;; Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n;; find any vowel met the above condition. \n;; You may assume that the given string contains English letter only.\n;; Example:\n;; >>> (get_closest_vowel \"yogurt\")\n;; \"u\"\n;; >>> (get_closest_vowel \"FULL\")\n;; \"U\"\n;; >>> (get_closest_vowel \"quick\")\n;; \"\"\n;; >>> (get_closest_vowel \"ab\")\n;; \"\"\n(define (get_closest_vowel word)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate get_closest_vowel))\n (check-equal? (candidate \"yogurt\") \"u\")\n (check-equal? (candidate \"full\") \"u\")\n (check-equal? (candidate \"easy\") \"\")\n (check-equal? (candidate \"eAsy\") \"\")\n (check-equal? (candidate \"ali\") \"\")\n (check-equal? (candidate \"bad\") \"a\")\n (check-equal? (candidate \"most\") \"o\")\n (check-equal? (candidate \"ab\") \"\")\n (check-equal? (candidate \"ba\") \"\")\n (check-equal? (candidate \"quick\") \"\")\n (check-equal? (candidate \"anime\") \"i\")\n (check-equal? (candidate \"Asia\") \"\")\n (check-equal? (candidate \"Above\") \"o\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "rkt", - "prompt": "#lang racket\n\n;; Change numerical base of input number x to base.\n;; return string representation after the conversion.\n;; base numbers are less than 10.\n;; >>> (change_base 8 3)\n;; \"22\"\n;; >>> (change_base 8 2)\n;; \"1000\"\n;; >>> (change_base 7 2)\n;; \"111\"\n(define (change_base x base)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate change_base))\n (check-equal? (candidate 8 3) \"22\")\n (check-equal? (candidate 9 3) \"100\")\n (check-equal? (candidate 234 2) \"11101010\")\n (check-equal? (candidate 16 2) \"10000\")\n (check-equal? (candidate 8 2) \"1000\")\n (check-equal? (candidate 7 2) \"111\")\n (check-equal? (candidate 2 3) \"2\")\n (check-equal? (candidate 3 4) \"3\")\n (check-equal? (candidate 4 5) \"4\")\n (check-equal? (candidate 5 6) \"5\")\n (check-equal? (candidate 6 7) \"6\")\n (check-equal? (candidate 7 8) \"7\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "rkt", - "prompt": "#lang racket\n\n;; Check if in given list of numbers, are any two numbers closer to each other than\n;; given threshold.\n;; >>> (has_close_elements (list 1.0 2.0 3.0) 0.5)\n;; #f\n;; >>> (has_close_elements (list 1.0 2.8 3.0 4.0 5.0 2.0) 0.3)\n;; #t\n(define (has_close_elements numbers threshold)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate has_close_elements))\n (check-equal? (candidate (list 1.0 2.0 3.9 4.0 5.0 2.2) 0.3) #t)\n (check-equal? (candidate (list 1.0 2.0 3.9 4.0 5.0 2.2) 0.05) #f)\n (check-equal? (candidate (list 1.0 2.0 5.9 4.0 5.0) 0.95) #t)\n (check-equal? (candidate (list 1.0 2.0 5.9 4.0 5.0) 0.8) #f)\n (check-equal? (candidate (list 1.0 2.0 3.0 4.0 5.0 2.0) 0.1) #t)\n (check-equal? (candidate (list 1.1 2.2 3.1 4.1 5.1) 1.0) #t)\n (check-equal? (candidate (list 1.1 2.2 3.1 4.1 5.1) 0.5) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function that takes a string as input which contains only square brackets.\n;; The function should return #t if and only if there is a valid subsequence of brackets \n;; where at least one bracket in the subsequence is nested.\n;; >>> (is_nested \"[[]]\")\n;; #t\n;; >>> (is_nested \"[]]]]]]][[[[[]\")\n;; #f\n;; >>> (is_nested \"[][]\")\n;; #f\n;; >>> (is_nested \"[]\")\n;; #f\n;; >>> (is_nested \"[[][]]\")\n;; #t\n;; >>> (is_nested \"[[]][[\")\n;; #t\n(define (is_nested string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_nested))\n (check-equal? (candidate \"[[]]\") #t)\n (check-equal? (candidate \"[]]]]]]][[[[[]\") #f)\n (check-equal? (candidate \"[][]\") #f)\n (check-equal? (candidate \"[]\") #f)\n (check-equal? (candidate \"[[[[]]]]\") #t)\n (check-equal? (candidate \"[]]]]]]]]]]\") #f)\n (check-equal? (candidate \"[][][[]]\") #t)\n (check-equal? (candidate \"[[]\") #f)\n (check-equal? (candidate \"[]]\") #f)\n (check-equal? (candidate \"[[]][[\") #t)\n (check-equal? (candidate \"[[][]]\") #t)\n (check-equal? (candidate \"\") #f)\n (check-equal? (candidate \"[[[[[[[[\") #f)\n (check-equal? (candidate \"]]]]]]]]\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "rkt", - "prompt": "#lang racket\n\n;; Concatenate list of strings into a single string\n;; >>> (concatenate (list ))\n;; \"\"\n;; >>> (concatenate (list \"a\" \"b\" \"c\"))\n;; \"abc\"\n(define (concatenate strings)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate concatenate))\n (check-equal? (candidate (list )) \"\")\n (check-equal? (candidate (list \"x\" \"y\" \"z\")) \"xyz\")\n (check-equal? (candidate (list \"x\" \"y\" \"z\" \"w\" \"k\")) \"xyzwk\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "rkt", - "prompt": "#lang racket\n\n;; prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n;; >>> (prime_fib 1)\n;; 2\n;; >>> (prime_fib 2)\n;; 3\n;; >>> (prime_fib 3)\n;; 5\n;; >>> (prime_fib 4)\n;; 13\n;; >>> (prime_fib 5)\n;; 89\n(define (prime_fib n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate prime_fib))\n (check-equal? (candidate 1) 2)\n (check-equal? (candidate 2) 3)\n (check-equal? (candidate 3) 5)\n (check-equal? (candidate 4) 13)\n (check-equal? (candidate 5) 89)\n (check-equal? (candidate 6) 233)\n (check-equal? (candidate 7) 1597)\n (check-equal? (candidate 8) 28657)\n (check-equal? (candidate 9) 514229)\n (check-equal? (candidate 10) 433494437)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "rkt", - "prompt": "#lang racket\n\n;; From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n;; other and return them in order (smaller number, larger number).\n;; >>> (find_closest_elements (list 1.0 2.0 3.0 4.0 5.0 2.2))\n;; (list 2.0 2.2)\n;; >>> (find_closest_elements (list 1.0 2.0 3.0 4.0 5.0 2.0))\n;; (list 2.0 2.0)\n(define (find_closest_elements numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate find_closest_elements))\n (check-equal? (candidate (list 1.0 2.0 3.9 4.0 5.0 2.2)) (list 3.9 4.0))\n (check-equal? (candidate (list 1.0 2.0 5.9 4.0 5.0)) (list 5.0 5.9))\n (check-equal? (candidate (list 1.0 2.0 3.0 4.0 5.0 2.2)) (list 2.0 2.2))\n (check-equal? (candidate (list 1.0 2.0 3.0 4.0 5.0 2.0)) (list 2.0 2.0))\n (check-equal? (candidate (list 1.1 2.2 3.1 4.1 5.1)) (list 2.2 3.1))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "rkt", - "prompt": "#lang racket\n\n;; You have been tasked to write a function that receives \n;; a hexadecimal number as a string and counts the number of hexadecimal \n;; digits that are primes (prime number, or a prime, is a natural number \n;; greater than 1 that is not a product of two smaller natural numbers).\n;; Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n;; Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n;; So you have to determine a number of the following digits: 2, 3, 5, 7, \n;; B (=decimal 11), D (=decimal 13).\n;; Note: you may assume the input is always correct or empty string, \n;; and symbols A,B,C,D,E,F are always uppercase.\n;; Examples:\n;; >>> (hex_key \"AB\")\n;; 1\n;; >>> (hex_key \"1077E\")\n;; 2\n;; >>> (hex_key \"ABED1A33\")\n;; 4\n;; >>> (hex_key \"123456789ABCDEF0\")\n;; 6\n;; >>> (hex_key \"2020\")\n;; 2\n(define (hex_key num)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate hex_key))\n (check-equal? (candidate \"AB\") 1)\n (check-equal? (candidate \"1077E\") 2)\n (check-equal? (candidate \"ABED1A33\") 4)\n (check-equal? (candidate \"2020\") 2)\n (check-equal? (candidate \"123456789ABCDEF0\") 6)\n (check-equal? (candidate \"112233445566778899AABBCCDDEEFF00\") 12)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "rkt", - "prompt": "#lang racket\n\n;; Complete the function that takes two integers and returns \n;; the product of their unit digits.\n;; Assume the input is always valid.\n;; Examples:\n;; >>> (multiply 148 412)\n;; 16\n;; >>> (multiply 19 28)\n;; 72\n;; >>> (multiply 2020 1851)\n;; 0\n;; >>> (multiply 14 -15)\n;; 20\n(define (multiply a b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate multiply))\n (check-equal? (candidate 148 412) 16)\n (check-equal? (candidate 19 28) 72)\n (check-equal? (candidate 2020 1851) 0)\n (check-equal? (candidate 14 -15) 20)\n (check-equal? (candidate 76 67) 42)\n (check-equal? (candidate 17 27) 49)\n (check-equal? (candidate 0 1) 0)\n (check-equal? (candidate 0 0) 0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given list of numbers (of at least two elements), apply a linear transform to that list,\n;; such that the smallest number will become 0 and the largest will become 1\n;; >>> (rescale_to_unit (list 1.0 2.0 3.0 4.0 5.0))\n;; (list 0.0 0.25 0.5 0.75 1.0)\n(define (rescale_to_unit numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate rescale_to_unit))\n (check-equal? (candidate (list 2.0 49.9)) (list 0.0 1.0))\n (check-equal? (candidate (list 100.0 49.9)) (list 1.0 0.0))\n (check-equal? (candidate (list 1.0 2.0 3.0 4.0 5.0)) (list 0.0 0.25 0.5 0.75 1.0))\n (check-equal? (candidate (list 2.0 1.0 5.0 3.0 4.0)) (list 0.25 0.0 1.0 0.5 0.75))\n (check-equal? (candidate (list 12.0 11.0 15.0 13.0 14.0)) (list 0.25 0.0 1.0 0.5 0.75))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a positive integer n, return the product of the odd digits.\n;; Return 0 if all digits are even.\n;; For example:\n;; >>> (digits 1)\n;; 1\n;; >>> (digits 4)\n;; 0\n;; >>> (digits 235)\n;; 15\n(define (digits n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate digits))\n (check-equal? (candidate 5) 5)\n (check-equal? (candidate 54) 5)\n (check-equal? (candidate 120) 1)\n (check-equal? (candidate 5014) 5)\n (check-equal? (candidate 98765) 315)\n (check-equal? (candidate 5576543) 2625)\n (check-equal? (candidate 2468) 0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "rkt", - "prompt": "#lang racket\n\n;; You will be given the name of a class (a string) and a list of extensions.\n;; The extensions are to be used to load additional classes to the class. The\n;; strength of the extension is as follows: Let CAP be the number of the uppercase\n;; letters in the extension's name, and let SM be the number of lowercase letters \n;; in the extension's name, the strength is given by the fraction CAP - SM. \n;; You should find the strongest extension and return a string in this \n;; format: ClassName.StrongestExtensionName.\n;; If there are two or more extensions with the same strength, you should\n;; choose the one that comes first in the list.\n;; For example, if you are given \"Slices\" as the class and a list of the\n;; extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n;; return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n;; (its strength is -1).\n;; Example:\n;; >>> (Strongest_Extension \"my_class\" (list \"AA\" \"Be\" \"CC\"))\n;; \"my_class.AA\"\n(define (Strongest_Extension class_name extensions)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate Strongest_Extension))\n (check-equal? (candidate \"Watashi\" (list \"tEN\" \"niNE\" \"eIGHt8OKe\")) \"Watashi.eIGHt8OKe\")\n (check-equal? (candidate \"Boku123\" (list \"nani\" \"NazeDa\" \"YEs.WeCaNe\" \"32145tggg\")) \"Boku123.YEs.WeCaNe\")\n (check-equal? (candidate \"__YESIMHERE\" (list \"t\" \"eMptY\" \"nothing\" \"zeR00\" \"NuLl__\" \"123NoooneB321\")) \"__YESIMHERE.NuLl__\")\n (check-equal? (candidate \"K\" (list \"Ta\" \"TAR\" \"t234An\" \"cosSo\")) \"K.TAR\")\n (check-equal? (candidate \"__HAHA\" (list \"Tab\" \"123\" \"781345\" \"-_-\")) \"__HAHA.123\")\n (check-equal? (candidate \"YameRore\" (list \"HhAas\" \"okIWILL123\" \"WorkOut\" \"Fails\" \"-_-\")) \"YameRore.okIWILL123\")\n (check-equal? (candidate \"finNNalLLly\" (list \"Die\" \"NowW\" \"Wow\" \"WoW\")) \"finNNalLLly.WoW\")\n (check-equal? (candidate \"_\" (list \"Bb\" \"91245\")) \"_.Bb\")\n (check-equal? (candidate \"Sp\" (list \"671235\" \"Bb\")) \"Sp.671235\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a string representing a space separated lowercase letters, return a hash\n;; of the letter with the most repetition and containing the corresponding count.\n;; If several letters have the same occurrence, return all of them.\n;; Example:\n;; >>> (histogram \"a b c\")\n;; #hash((\"a\" . 1) (\"b\" . 1) (\"c\" . 1))\n;; >>> (histogram \"a b b a\")\n;; #hash((\"a\" . 2) (\"b\" . 2))\n;; >>> (histogram \"a b c a b\")\n;; #hash((\"a\" . 2) (\"b\" . 2))\n;; >>> (histogram \"b b b b a\")\n;; #hash((\"b\" . 4))\n;; >>> (histogram \"\")\n;; #hash()\n(define (histogram test)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate histogram))\n (check-equal? (candidate \"a b b a\") #hash((\"a\" . 2) (\"b\" . 2)))\n (check-equal? (candidate \"a b c a b\") #hash((\"a\" . 2) (\"b\" . 2)))\n (check-equal? (candidate \"a b c d g\") #hash((\"a\" . 1) (\"b\" . 1) (\"c\" . 1) (\"d\" . 1) (\"g\" . 1)))\n (check-equal? (candidate \"r t g\") #hash((\"r\" . 1) (\"t\" . 1) (\"g\" . 1)))\n (check-equal? (candidate \"b b b b a\") #hash((\"b\" . 4)))\n (check-equal? (candidate \"r t g\") #hash((\"r\" . 1) (\"t\" . 1) (\"g\" . 1)))\n (check-equal? (candidate \"\") #hash())\n (check-equal? (candidate \"a\") #hash((\"a\" . 1)))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "rkt", - "prompt": "#lang racket\n\n;; pairs_sum_to_zero takes a list of integers as an input.\n;; it returns #t if there are two distinct elements in the list that\n;; sum to zero, and #f otherwise.\n;; >>> (pairs_sum_to_zero (list 1 3 5 0))\n;; #f\n;; >>> (pairs_sum_to_zero (list 1 3 -2 1))\n;; #f\n;; >>> (pairs_sum_to_zero (list 1 2 3 7))\n;; #f\n;; >>> (pairs_sum_to_zero (list 2 4 -5 3 5 7))\n;; #t\n;; >>> (pairs_sum_to_zero (list 1))\n;; #f\n(define (pairs_sum_to_zero l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate pairs_sum_to_zero))\n (check-equal? (candidate (list 1 3 5 0)) #f)\n (check-equal? (candidate (list 1 3 -2 1)) #f)\n (check-equal? (candidate (list 1 2 3 7)) #f)\n (check-equal? (candidate (list 2 4 -5 3 5 7)) #t)\n (check-equal? (candidate (list 1)) #f)\n (check-equal? (candidate (list -3 9 -1 3 2 30)) #t)\n (check-equal? (candidate (list -3 9 -1 3 2 31)) #t)\n (check-equal? (candidate (list -3 9 -1 4 2 30)) #f)\n (check-equal? (candidate (list -3 9 -1 4 2 31)) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that accepts two lists of strings and returns the list that has \n;; total number of chars in the all strings of the list less than the other list.\n;; if the two lists have the same number of chars, return the first list.\n;; Examples\n;; >>> (total_match (list ) (list ))\n;; (list )\n;; >>> (total_match (list \"hi\" \"admin\") (list \"hI\" \"Hi\"))\n;; (list \"hI\" \"Hi\")\n;; >>> (total_match (list \"hi\" \"admin\") (list \"hi\" \"hi\" \"admin\" \"project\"))\n;; (list \"hi\" \"admin\")\n;; >>> (total_match (list \"hi\" \"admin\") (list \"hI\" \"hi\" \"hi\"))\n;; (list \"hI\" \"hi\" \"hi\")\n;; >>> (total_match (list \"4\") (list \"1\" \"2\" \"3\" \"4\" \"5\"))\n;; (list \"4\")\n(define (total_match lst1 lst2)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate total_match))\n (check-equal? (candidate (list ) (list )) (list ))\n (check-equal? (candidate (list \"hi\" \"admin\") (list \"hi\" \"hi\")) (list \"hi\" \"hi\"))\n (check-equal? (candidate (list \"hi\" \"admin\") (list \"hi\" \"hi\" \"admin\" \"project\")) (list \"hi\" \"admin\"))\n (check-equal? (candidate (list \"4\") (list \"1\" \"2\" \"3\" \"4\" \"5\")) (list \"4\"))\n (check-equal? (candidate (list \"hi\" \"admin\") (list \"hI\" \"Hi\")) (list \"hI\" \"Hi\"))\n (check-equal? (candidate (list \"hi\" \"admin\") (list \"hI\" \"hi\" \"hi\")) (list \"hI\" \"hi\" \"hi\"))\n (check-equal? (candidate (list \"hi\" \"admin\") (list \"hI\" \"hi\" \"hii\")) (list \"hi\" \"admin\"))\n (check-equal? (candidate (list ) (list \"this\")) (list ))\n (check-equal? (candidate (list \"this\") (list )) (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "rkt", - "prompt": "#lang racket\n\n;; Circular shift the digits of the integer x, shift the digits right by shift\n;; and return the result as a string.\n;; If shift > number of digits, return digits reversed.\n;; >>> (circular_shift 12 1)\n;; \"21\"\n;; >>> (circular_shift 12 2)\n;; \"12\"\n(define (circular_shift x shift)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate circular_shift))\n (check-equal? (candidate 100 2) \"001\")\n (check-equal? (candidate 12 2) \"12\")\n (check-equal? (candidate 97 8) \"79\")\n (check-equal? (candidate 12 1) \"21\")\n (check-equal? (candidate 11 101) \"11\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return #t is list elements are monotonically increasing or decreasing.\n;; >>> (monotonic (list 1 2 4 20))\n;; #t\n;; >>> (monotonic (list 1 20 4 10))\n;; #f\n;; >>> (monotonic (list 4 1 0 -10))\n;; #t\n(define (monotonic l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate monotonic))\n (check-equal? (candidate (list 1 2 4 10)) #t)\n (check-equal? (candidate (list 1 2 4 20)) #t)\n (check-equal? (candidate (list 1 20 4 10)) #f)\n (check-equal? (candidate (list 4 1 0 -10)) #t)\n (check-equal? (candidate (list 4 1 1 0)) #t)\n (check-equal? (candidate (list 1 2 3 2 5 60)) #f)\n (check-equal? (candidate (list 1 2 3 4 5 60)) #t)\n (check-equal? (candidate (list 9 9 9 9)) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "rkt", - "prompt": "#lang racket\n\n;; Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n;; Example\n;; >>> (is_equal_to_sum_even 4)\n;; #f\n;; >>> (is_equal_to_sum_even 6)\n;; #f\n;; >>> (is_equal_to_sum_even 8)\n;; #t\n(define (is_equal_to_sum_even n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_equal_to_sum_even))\n (check-equal? (candidate 4) #f)\n (check-equal? (candidate 6) #f)\n (check-equal? (candidate 8) #t)\n (check-equal? (candidate 10) #t)\n (check-equal? (candidate 11) #f)\n (check-equal? (candidate 12) #t)\n (check-equal? (candidate 13) #f)\n (check-equal? (candidate 16) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "rkt", - "prompt": "#lang racket\n\n;; Input to this function is a string representing musical notes in a special ASCII format.\n;; Your task is to parse this string and return list of integers corresponding to how many beats does each\n;; not last.\n;; Here is a legend:\n;; 'o' - whole note, lasts four beats\n;; 'o|' - half note, lasts two beats\n;; '.|' - quater note, lasts one beat\n;; >>> (parse_music \"o o| .| o| o| .| .| .| .| o o\")\n;; (list 4 2 1 2 2 1 1 1 1 4 4)\n(define (parse_music music_string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate parse_music))\n (check-equal? (candidate \"\") (list ))\n (check-equal? (candidate \"o o o o\") (list 4 4 4 4))\n (check-equal? (candidate \".| .| .| .|\") (list 1 1 1 1))\n (check-equal? (candidate \"o| o| .| .| o o o o\") (list 2 2 1 1 4 4 4 4))\n (check-equal? (candidate \"o| .| o| .| o o| o o|\") (list 2 1 2 1 4 2 4 2))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "rkt", - "prompt": "#lang racket\n\n;; \"\n;; This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n;; multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n;; change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n;; Examples:\n;; >>> lst\n;; (list 1 2 3)\n;; >>> lst\n;; (list )\n;; >>> lst\n;; (list -1 -5 2 -1 -5)\n(define (sum_squares lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sum_squares))\n (check-equal? (candidate (list 1 2 3)) 6)\n (check-equal? (candidate (list 1 4 9)) 14)\n (check-equal? (candidate (list )) 0)\n (check-equal? (candidate (list 1 1 1 1 1 1 1 1 1)) 9)\n (check-equal? (candidate (list -1 -1 -1 -1 -1 -1 -1 -1 -1)) -3)\n (check-equal? (candidate (list 0)) 0)\n (check-equal? (candidate (list -1 -5 2 -1 -5)) -126)\n (check-equal? (candidate (list -56 -99 1 0 -2)) 3030)\n (check-equal? (candidate (list -1 0 0 0 0 0 0 0 -1)) 0)\n (check-equal? (candidate (list -16 -9 -2 36 36 26 -20 25 -40 20 -4 12 -26 35 37)) -14196)\n (check-equal? (candidate (list -1 -3 17 -1 -15 13 -1 14 -14 -12 -5 14 -14 6 13 11 16 16 4 10)) -1448)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "rkt", - "prompt": "#lang racket\n\n;; triples_sum_to_zero takes a list of integers as an input.\n;; it returns #t if there are three distinct elements in the list that\n;; sum to zero, and #f otherwise.\n;; >>> (triples_sum_to_zero (list 1 3 5 0))\n;; #f\n;; >>> (triples_sum_to_zero (list 1 3 -2 1))\n;; #t\n;; >>> (triples_sum_to_zero (list 1 2 3 7))\n;; #f\n;; >>> (triples_sum_to_zero (list 2 4 -5 3 9 7))\n;; #t\n;; >>> (triples_sum_to_zero (list 1))\n;; #f\n(define (triples_sum_to_zero l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate triples_sum_to_zero))\n (check-equal? (candidate (list 1 3 5 0)) #f)\n (check-equal? (candidate (list 1 3 5 -1)) #f)\n (check-equal? (candidate (list 1 3 -2 1)) #t)\n (check-equal? (candidate (list 1 2 3 7)) #f)\n (check-equal? (candidate (list 1 2 5 7)) #f)\n (check-equal? (candidate (list 2 4 -5 3 9 7)) #t)\n (check-equal? (candidate (list 1)) #f)\n (check-equal? (candidate (list 1 3 5 -100)) #f)\n (check-equal? (candidate (list 100 3 5 -100)) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "rkt", - "prompt": "#lang racket\n\n;; brackets is a string of \"<\" and \">\".\n;; return #t if every opening bracket has a corresponding closing bracket.\n;; >>> (correct_bracketing \"<\")\n;; #f\n;; >>> (correct_bracketing \"<>\")\n;; #t\n;; >>> (correct_bracketing \"<<><>>\")\n;; #t\n;; >>> (correct_bracketing \"><<>\")\n;; #f\n(define (correct_bracketing brackets)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate correct_bracketing))\n (check-equal? (candidate \"<>\") #t)\n (check-equal? (candidate \"<<><>>\") #t)\n (check-equal? (candidate \"<><><<><>><>\") #t)\n (check-equal? (candidate \"<><><<<><><>><>><<><><<>>>\") #t)\n (check-equal? (candidate \"<<<><>>>>\") #f)\n (check-equal? (candidate \"><<>\") #f)\n (check-equal? (candidate \"<\") #f)\n (check-equal? (candidate \"<<<<\") #f)\n (check-equal? (candidate \">\") #f)\n (check-equal? (candidate \"<<>\") #f)\n (check-equal? (candidate \"<><><<><>><>><<>\") #f)\n (check-equal? (candidate \"<><><<><>><>>><>\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that takes a list of numbers as input and returns \n;; the number of elements in the list that are greater than 10 and both \n;; first and last digits of a number are odd (1, 3, 5, 7, 9).\n;; For example:\n;; >>> (specialFilter (list 15 -73 14 -15))\n;; 1\n;; >>> (specialFilter (list 33 -2 -3 45 21 109))\n;; 2\n(define (specialFilter nums)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate specialFilter))\n (check-equal? (candidate (list 5 -2 1 -5)) 0)\n (check-equal? (candidate (list 15 -73 14 -15)) 1)\n (check-equal? (candidate (list 33 -2 -3 45 21 109)) 2)\n (check-equal? (candidate (list 43 -12 93 125 121 109)) 4)\n (check-equal? (candidate (list 71 -2 -33 75 21 19)) 3)\n (check-equal? (candidate (list 1)) 0)\n (check-equal? (candidate (list )) 0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a hash, return #t if all keys are strings in lower \n;; case or all keys are strings in upper case, else return #f.\n;; The function should return #f is the given hash is empty.\n;; Examples:\n;; >>> (check_dict_case #hash((\"a\" . \"apple\") (\"b\" . \"banana\")))\n;; #t\n;; >>> (check_dict_case #hash((\"a\" . \"apple\") (\"A\" . \"banana\") (\"B\" . \"banana\")))\n;; #f\n;; >>> (check_dict_case #hash((\"a\" . \"apple\") (8 . \"banana\") (\"a\" . \"apple\")))\n;; #f\n;; >>> (check_dict_case #hash((\"Name\" . \"John\") (\"Age\" . \"36\") (\"City\" . \"Houston\")))\n;; #f\n;; >>> (check_dict_case #hash((\"STATE\" . \"NC\") (\"ZIP\" . \"12345\")))\n;; #t\n(define (check_dict_case dict)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate check_dict_case))\n (check-equal? (candidate #hash((\"p\" . \"pineapple\") (\"b\" . \"banana\"))) #t)\n (check-equal? (candidate #hash((\"p\" . \"pineapple\") (\"A\" . \"banana\") (\"B\" . \"banana\"))) #f)\n (check-equal? (candidate #hash((\"p\" . \"pineapple\") (\"5\" . \"banana\") (\"a\" . \"apple\"))) #f)\n (check-equal? (candidate #hash((\"Name\" . \"John\") (\"Age\" . \"36\") (\"City\" . \"Houston\"))) #f)\n (check-equal? (candidate #hash((\"STATE\" . \"NC\") (\"ZIP\" . \"12345\"))) #t)\n (check-equal? (candidate #hash((\"fruit\" . \"Orange\") (\"taste\" . \"Sweet\"))) #t)\n (check-equal? (candidate #hash()) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n;; should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n;; alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n;; Examples\n;; >>> (split_words \"Hello world!\")\n;; (list \"Hello\" \"world!\")\n;; >>> (split_words \"Hello,world!\")\n;; (list \"Hello\" \"world!\")\n;; >>> (split_words \"abcdef\")\n;; 3\n(define (split_words txt)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate split_words))\n (check-equal? (candidate \"Hello world!\") (list \"Hello\" \"world!\"))\n (check-equal? (candidate \"Hello,world!\") (list \"Hello\" \"world!\"))\n (check-equal? (candidate \"Hello world,!\") (list \"Hello\" \"world,!\"))\n (check-equal? (candidate \"Hello,Hello,world !\") (list \"Hello,Hello,world\" \"!\"))\n (check-equal? (candidate \"abcdef\") 3)\n (check-equal? (candidate \"aaabb\") 2)\n (check-equal? (candidate \"aaaBb\") 1)\n (check-equal? (candidate \"\") 0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "rkt", - "prompt": "#lang racket\n\n;; The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n;; fibfib(0) == 0\n;; fibfib(1) == 0\n;; fibfib(2) == 1\n;; fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n;; Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n;; >>> (fibfib 1)\n;; 0\n;; >>> (fibfib 5)\n;; 4\n;; >>> (fibfib 8)\n;; 24\n(define (fibfib n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate fibfib))\n (check-equal? (candidate 2) 1)\n (check-equal? (candidate 1) 0)\n (check-equal? (candidate 5) 4)\n (check-equal? (candidate 8) 24)\n (check-equal? (candidate 10) 81)\n (check-equal? (candidate 12) 274)\n (check-equal? (candidate 14) 927)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a list of numbers.\n;; You need to return the sum of squared numbers in the given list,\n;; round each element in the list to the upper int(Ceiling) first.\n;; Examples:\n;; >>> (lst (list 1.0 2.0 3.0))\n;; 14\n;; >>> (lst (list 1.0 4.0 9.0))\n;; 98\n;; >>> (lst (list 1.0 3.0 5.0 7.0))\n;; 84\n;; >>> (lst (list 1.4 4.2 0.0))\n;; 29\n;; >>> (lst (list -2.4 1.0 1.0))\n;; 6\n(define (sum_squares lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sum_squares))\n (check-equal? (candidate (list 1.0 2.0 3.0)) 14)\n (check-equal? (candidate (list 1.0 2.0 3.0)) 14)\n (check-equal? (candidate (list 1.0 3.0 5.0 7.0)) 84)\n (check-equal? (candidate (list 1.4 4.2 0.0)) 29)\n (check-equal? (candidate (list -2.4 1.0 1.0)) 6)\n (check-equal? (candidate (list 100.0 1.0 15.0 2.0)) 10230)\n (check-equal? (candidate (list 10000.0 10000.0)) 200000000)\n (check-equal? (candidate (list -1.4 4.6 6.3)) 75)\n (check-equal? (candidate (list -1.4 17.9 18.9 19.9)) 1086)\n (check-equal? (candidate (list 0.0)) 0)\n (check-equal? (candidate (list -1.0)) 1)\n (check-equal? (candidate (list -1.0 1.0 0.0)) 2)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_85_add", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a non-empty list of integers lst. add the even elements that are at odd indices..\n;; Examples:\n;; >>> (add (list 4 2 6 7))\n;; 2\n(define (add lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate add))\n (check-equal? (candidate (list 4 88)) 88)\n (check-equal? (candidate (list 4 5 6 7 2 122)) 122)\n (check-equal? (candidate (list 4 0 6 7)) 0)\n (check-equal? (candidate (list 4 4 6 8)) 12)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return sorted unique elements in a list\n;; >>> (unique (list 5 3 5 2 3 3 9 0 123))\n;; (list 0 2 3 5 9 123)\n(define (unique l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate unique))\n (check-equal? (candidate (list 5 3 5 2 3 3 9 0 123)) (list 0 2 3 5 9 123))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a string text, replace all spaces in it with underscores, \n;; and if a string has more than 2 consecutive spaces, \n;; then replace all consecutive spaces with - \n;; >>> (fix_spaces \" Example\")\n;; \"Example\"\n;; >>> (fix_spaces \" Example 1\")\n;; \"Example_1\"\n;; >>> (fix_spaces \" Example 2\")\n;; \"_Example_2\"\n;; >>> (fix_spaces \" Example 3\")\n;; \"_Example-3\"\n(define (fix_spaces text)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate fix_spaces))\n (check-equal? (candidate \"Example\") \"Example\")\n (check-equal? (candidate \"Mudasir Hanif \") \"Mudasir_Hanif_\")\n (check-equal? (candidate \"Yellow Yellow Dirty Fellow\") \"Yellow_Yellow__Dirty__Fellow\")\n (check-equal? (candidate \"Exa mple\") \"Exa-mple\")\n (check-equal? (candidate \" Exa 1 2 2 mple\") \"-Exa_1_2_2_mple\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return 2^n modulo p (be aware of numerics).\n;; >>> (modp 3 5)\n;; 3\n;; >>> (modp 1101 101)\n;; 2\n;; >>> (modp 0 101)\n;; 1\n;; >>> (modp 3 11)\n;; 8\n;; >>> (modp 100 101)\n;; 1\n(define (modp n p)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate modp))\n (check-equal? (candidate 3 5) 3)\n (check-equal? (candidate 1101 101) 2)\n (check-equal? (candidate 0 101) 1)\n (check-equal? (candidate 3 11) 8)\n (check-equal? (candidate 100 101) 1)\n (check-equal? (candidate 30 5) 4)\n (check-equal? (candidate 31 5) 3)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "rkt", - "prompt": "#lang racket\n\n;; You have to write a function which validates a given date string and\n;; returns #t if the date is valid otherwise #f.\n;; The date is valid if all of the following rules are satisfied:\n;; 1. The date string is not empty.\n;; 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n;; 3. The months should not be less than 1 or higher than 12.\n;; 4. The date should be in the format: mm-dd-yyyy\n;; >>> (valid_date \"03-11-2000\")\n;; #t\n;; >>> (valid_date \"15-01-2012\")\n;; #f\n;; >>> (valid_date \"04-0-2040\")\n;; #f\n;; >>> (valid_date \"06-04-2020\")\n;; #t\n;; >>> (valid_date \"06/04/2020\")\n;; #f\n(define (valid_date date)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate valid_date))\n (check-equal? (candidate \"03-11-2000\") #t)\n (check-equal? (candidate \"15-01-2012\") #f)\n (check-equal? (candidate \"04-0-2040\") #f)\n (check-equal? (candidate \"06-04-2020\") #t)\n (check-equal? (candidate \"01-01-2007\") #t)\n (check-equal? (candidate \"03-32-2011\") #f)\n (check-equal? (candidate \"\") #f)\n (check-equal? (candidate \"04-31-3000\") #f)\n (check-equal? (candidate \"06-06-2005\") #t)\n (check-equal? (candidate \"21-31-2000\") #f)\n (check-equal? (candidate \"04-12-2003\") #t)\n (check-equal? (candidate \"04122003\") #f)\n (check-equal? (candidate \"20030412\") #f)\n (check-equal? (candidate \"2003-04\") #f)\n (check-equal? (candidate \"2003-04-12\") #f)\n (check-equal? (candidate \"04-2003\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that takes a string and returns an ordered version of it.\n;; Ordered version of string, is a string where all words (separated by space)\n;; are replaced by a new word where all the characters arranged in\n;; ascending order based on ascii value.\n;; Note: You should keep the order of words and blank spaces in the sentence.\n;; For example:\n;; >>> (anti_shuffle \"Hi\")\n;; \"Hi\"\n;; >>> (anti_shuffle \"hello\")\n;; \"ehllo\"\n;; >>> (anti_shuffle \"Hello World!!!\")\n;; \"Hello !!!Wdlor\"\n(define (anti_shuffle s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate anti_shuffle))\n (check-equal? (candidate \"Hi\") \"Hi\")\n (check-equal? (candidate \"hello\") \"ehllo\")\n (check-equal? (candidate \"number\") \"bemnru\")\n (check-equal? (candidate \"abcd\") \"abcd\")\n (check-equal? (candidate \"Hello World!!!\") \"Hello !!!Wdlor\")\n (check-equal? (candidate \"\") \"\")\n (check-equal? (candidate \"Hi. My name is Mister Robot. How are you?\") \".Hi My aemn is Meirst .Rboot How aer ?ouy\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a list of numbers, return whether or not they are sorted\n;; in ascending order. If list has more than 1 duplicate of the same\n;; number, return #f. Assume no negative numbers and only integers.\n;; Examples\n;; >>> (is_sorted (list 5))\n;; #t\n;; >>> (is_sorted (list 1 2 3 4 5))\n;; #t\n;; >>> (is_sorted (list 1 3 2 4 5))\n;; #f\n;; >>> (is_sorted (list 1 2 3 4 5 6))\n;; #t\n;; >>> (is_sorted (list 1 2 3 4 5 6 7))\n;; #t\n;; >>> (is_sorted (list 1 3 2 4 5 6 7))\n;; #f\n;; >>> (is_sorted (list 1 2 2 3 3 4))\n;; #t\n;; >>> (is_sorted (list 1 2 2 2 3 4))\n;; #f\n(define (is_sorted lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_sorted))\n (check-equal? (candidate (list 5)) #t)\n (check-equal? (candidate (list 1 2 3 4 5)) #t)\n (check-equal? (candidate (list 1 3 2 4 5)) #f)\n (check-equal? (candidate (list 1 2 3 4 5 6)) #t)\n (check-equal? (candidate (list 1 2 3 4 5 6 7)) #t)\n (check-equal? (candidate (list 1 3 2 4 5 6 7)) #f)\n (check-equal? (candidate (list )) #t)\n (check-equal? (candidate (list 1)) #t)\n (check-equal? (candidate (list 3 2 1)) #f)\n (check-equal? (candidate (list 1 2 2 2 3 4)) #f)\n (check-equal? (candidate (list 1 2 3 3 3 4)) #f)\n (check-equal? (candidate (list 1 2 2 3 3 4)) #t)\n (check-equal? (candidate (list 1 2 3 4)) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a string s.\n;; Your task is to check if the string is haprkt or not.\n;; A string is haprkt if its length is at least 3 and every 3 consecutive letters are distinct\n;; For example:\n;; >>> (is_happy \"a\")\n;; #f\n;; >>> (is_happy \"aa\")\n;; #f\n;; >>> (is_happy \"abcd\")\n;; #t\n;; >>> (is_happy \"aabb\")\n;; #f\n;; >>> (is_happy \"adb\")\n;; #t\n;; >>> (is_happy \"xyy\")\n;; #f\n(define (is_happy s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_happy))\n (check-equal? (candidate \"a\") #f)\n (check-equal? (candidate \"aa\") #f)\n (check-equal? (candidate \"abcd\") #t)\n (check-equal? (candidate \"aabb\") #f)\n (check-equal? (candidate \"adb\") #t)\n (check-equal? (candidate \"xyy\") #f)\n (check-equal? (candidate \"iopaxpoi\") #t)\n (check-equal? (candidate \"iopaxioi\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that returns #t if the object q will fly, and #f otherwise.\n;; The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n;; Example:\n;; >>> (will_it_fly (list 1 2) 5)\n;; #f\n;; # 1+2 is less than the maximum possible weight, but it's unbalanced.\n;; >>> (will_it_fly (list 3 2 3) 1)\n;; #f\n;; # it's balanced, but 3+2+3 is more than the maximum possible weight.\n;; >>> (will_it_fly (list 3 2 3) 9)\n;; #t\n;; # 3+2+3 is less than the maximum possible weight, and it's balanced.\n;; >>> (will_it_fly (list 3) 5)\n;; #t\n;; # 3 is less than the maximum possible weight, and it's balanced.\n(define (will_it_fly q w)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate will_it_fly))\n (check-equal? (candidate (list 3 2 3) 9) #t)\n (check-equal? (candidate (list 1 2) 5) #f)\n (check-equal? (candidate (list 3) 5) #t)\n (check-equal? (candidate (list 3 2 3) 1) #f)\n (check-equal? (candidate (list 1 2 3) 6) #f)\n (check-equal? (candidate (list 5) 5) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a list of non-negative integers, return a corkt of the given list after sorting,\n;; you will sort the given list in ascending order if the sum( first index value, last index value) is odd,\n;; or sort it in descending order if the sum( first index value, last index value) is even.\n;; Note:\n;; * don't change the given list.\n;; Examples:\n;; >>> (sort_array (list ))\n;; (list )\n;; >>> (sort_array (list 5))\n;; (list 5)\n;; >>> (sort_array (list 2 4 3 0 1 5))\n;; (list 0 1 2 3 4 5)\n;; >>> (sort_array (list 2 4 3 0 1 5 6))\n;; (list 6 5 4 3 2 1 0)\n(define (sort_array array)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sort_array))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 5)) (list 5))\n (check-equal? (candidate (list 2 4 3 0 1 5)) (list 0 1 2 3 4 5))\n (check-equal? (candidate (list 2 4 3 0 1 5 6)) (list 6 5 4 3 2 1 0))\n (check-equal? (candidate (list 2 1)) (list 1 2))\n (check-equal? (candidate (list 15 42 87 32 11 0)) (list 0 11 15 32 42 87))\n (check-equal? (candidate (list 21 14 23 11)) (list 23 21 14 11))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "rkt", - "prompt": "#lang racket\n\n;; Implement a function that takes an non-negative integer and returns a list of the first n\n;; integers that are prime numbers and less than n.\n;; for example:\n;; >>> (count_up_to 5)\n;; (list 2 3)\n;; >>> (count_up_to 11)\n;; (list 2 3 5 7)\n;; >>> (count_up_to 0)\n;; (list )\n;; >>> (count_up_to 20)\n;; (list 2 3 5 7 11 13 17 19)\n;; >>> (count_up_to 1)\n;; (list )\n;; >>> (count_up_to 18)\n;; (list 2 3 5 7 11 13 17)\n(define (count_up_to n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate count_up_to))\n (check-equal? (candidate 5) (list 2 3))\n (check-equal? (candidate 6) (list 2 3 5))\n (check-equal? (candidate 7) (list 2 3 5))\n (check-equal? (candidate 10) (list 2 3 5 7))\n (check-equal? (candidate 0) (list ))\n (check-equal? (candidate 22) (list 2 3 5 7 11 13 17 19))\n (check-equal? (candidate 1) (list ))\n (check-equal? (candidate 18) (list 2 3 5 7 11 13 17))\n (check-equal? (candidate 47) (list 2 3 5 7 11 13 17 19 23 29 31 37 41 43))\n (check-equal? (candidate 101) (list 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "rkt", - "prompt": "#lang racket\n\n;; Out of list of strings, return the longest one. Return the first one in case of multiple\n;; strings of the same length. Return #f in case the input list is empty.\n;; >>> (longest (list ))\n;; #f\n;; >>> (longest (list \"a\" \"b\" \"c\"))\n;; \"a\"\n;; >>> (longest (list \"a\" \"bb\" \"ccc\"))\n;; \"ccc\"\n(define (longest strings)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate longest))\n (check-equal? (candidate (list )) #f)\n (check-equal? (candidate (list \"x\" \"y\" \"z\")) \"x\")\n (check-equal? (candidate (list \"x\" \"yyy\" \"zzzz\" \"www\" \"kkkk\" \"abc\")) \"zzzz\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a list of integers, sort the integers that are between 1 and 9 inclusive,\n;; reverse the resulting list, and then replace each digit by its corresponding name from\n;; \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n;; For example:\n;; >>> (by_length (list 2 1 1 4 5 8 2 3))\n;; (list \"Eight\" \"Five\" \"Four\" \"Three\" \"Two\" \"Two\" \"One\" \"One\")\n;; If the list is empty, return an empty list:\n;; >>> (by_length (list ))\n;; (list )\n;; If the list has any strange number ignore it:\n;; >>> (by_length (list 1 -1 55))\n;; (list \"One\")\n(define (by_length arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate by_length))\n (check-equal? (candidate (list 2 1 1 4 5 8 2 3)) (list \"Eight\" \"Five\" \"Four\" \"Three\" \"Two\" \"Two\" \"One\" \"One\"))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 1 -1 55)) (list \"One\"))\n (check-equal? (candidate (list 1 -1 3 2)) (list \"Three\" \"Two\" \"One\"))\n (check-equal? (candidate (list 9 4 8)) (list \"Nine\" \"Eight\" \"Four\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_106_f", - "language": "rkt", - "prompt": "#lang racket\n\n;; Implement the function f that takes n as a parameter,\n;; 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\n;; or the sum of numbers from 1 to i otherwise.\n;; i starts from 1.\n;; the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n;; Example:\n;; >>> (f 5)\n;; (list 1 2 6 24 15)\n(define (f n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate f))\n (check-equal? (candidate 5) (list 1 2 6 24 15))\n (check-equal? (candidate 7) (list 1 2 6 24 15 720 28))\n (check-equal? (candidate 1) (list 1))\n (check-equal? (candidate 3) (list 1 2 6))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n;; >>> (fizz_buzz 50)\n;; 0\n;; >>> (fizz_buzz 78)\n;; 2\n;; >>> (fizz_buzz 79)\n;; 3\n(define (fizz_buzz n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate fizz_buzz))\n (check-equal? (candidate 50) 0)\n (check-equal? (candidate 78) 2)\n (check-equal? (candidate 79) 3)\n (check-equal? (candidate 100) 3)\n (check-equal? (candidate 200) 6)\n (check-equal? (candidate 4000) 192)\n (check-equal? (candidate 10000) 639)\n (check-equal? (candidate 100000) 8026)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a positive floating point number, it can be decomposed into\n;; and integer part (largest integer smaller than given number) and decimals\n;; (leftover part always smaller than 1).\n;; Return the decimal part of the number.\n;; >>> (truncate_number 3.5)\n;; 0.5\n(define (truncate_number number)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate truncate_number))\n (check-equal? (candidate 3.5) 0.5)\n (check-equal? (candidate 1.25) 0.25)\n (check-equal? (candidate 123.0) 0.0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "rkt", - "prompt": "#lang racket\n\n;; For a given list of integers, return a list consisting of a sum and a product of all the integers in a list.\n;; Empty sum should be equal to 0 and empty product should be equal to 1.\n;; >>> (sum_product (list ))\n;; (list 0 1)\n;; >>> (sum_product (list 1 2 3 4))\n;; (list 10 24)\n(define (sum_product numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sum_product))\n (check-equal? (candidate (list )) (list 0 1))\n (check-equal? (candidate (list 1 1 1)) (list 3 1))\n (check-equal? (candidate (list 100 0)) (list 100 0))\n (check-equal? (candidate (list 3 5 7)) (list 15 105))\n (check-equal? (candidate (list 10)) (list 10 10))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a 2 dimensional data, as a nested lists,\n;; which is similar to matrix, however, unlike matrices,\n;; each row may contain a different number of columns.\n;; Given lst, and integer x, find integers x in the list,\n;; and return list of lists, [(x1, y1), (x2, y2) ...] such that\n;; each list is a coordinate - (row, columns), starting with 0.\n;; Sort coordinates initially by rows in ascending order.\n;; Also, sort coordinates of the row by columns in descending order.\n;; Examples:\n;; >>> (get_row (list (list 1 2 3 4 5 6) (list 1 2 3 4 1 6) (list 1 2 3 4 5 1)) 1)\n;; (list (list 0 0) (list 1 4) (list 1 0) (list 2 5) (list 2 0))\n;; >>> (get_row (list ) 1)\n;; (list )\n;; >>> (get_row (list (list ) (list 1) (list 1 2 3)) 3)\n;; (list (list 2 2))\n(define (get_row lst x)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate get_row))\n (check-equal? (candidate (list (list 1 2 3 4 5 6) (list 1 2 3 4 1 6) (list 1 2 3 4 5 1)) 1) (list (list 0 0) (list 1 4) (list 1 0) (list 2 5) (list 2 0)))\n (check-equal? (candidate (list (list 1 2 3 4 5 6) (list 1 2 3 4 5 6) (list 1 2 3 4 5 6) (list 1 2 3 4 5 6) (list 1 2 3 4 5 6) (list 1 2 3 4 5 6)) 2) (list (list 0 1) (list 1 1) (list 2 1) (list 3 1) (list 4 1) (list 5 1)))\n (check-equal? (candidate (list (list 1 2 3 4 5 6) (list 1 2 3 4 5 6) (list 1 1 3 4 5 6) (list 1 2 1 4 5 6) (list 1 2 3 1 5 6) (list 1 2 3 4 1 6) (list 1 2 3 4 5 1)) 1) (list (list 0 0) (list 1 0) (list 2 1) (list 2 0) (list 3 2) (list 3 0) (list 4 3) (list 4 0) (list 5 4) (list 5 0) (list 6 5) (list 6 0)))\n (check-equal? (candidate (list ) 1) (list ))\n (check-equal? (candidate (list (list 1)) 2) (list ))\n (check-equal? (candidate (list (list ) (list 1) (list 1 2 3)) 3) (list (list 2 2)))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "rkt", - "prompt": "#lang racket\n\n;; You're a hungry rabbit, and you already have eaten a certain number of carrots,\n;; but now you need to eat more carrots to complete the day's meals.\n;; you should return a list of [ total number of eaten carrots after your meals,\n;; the number of carrots left after your meals ]\n;; if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n;; Example:\n;; >>> (eat 5 6 10)\n;; (list 11 4)\n;; >>> (eat 4 8 9)\n;; (list 12 1)\n;; >>> (eat 1 10 10)\n;; (list 11 0)\n;; >>> (eat 2 11 5)\n;; (list 7 0)\n;; Variables:\n;; @number : integer\n;; the number of carrots that you have eaten.\n;; @need : integer\n;; the number of carrots that you need to eat.\n;; @remaining : integer\n;; the number of remaining carrots thet exist in stock\n;; Constrain:\n;; * 0 <= number <= 1000\n;; * 0 <= need <= 1000\n;; * 0 <= remaining <= 1000\n;; Have fun :)\n(define (eat number need remaining)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate eat))\n (check-equal? (candidate 5 6 10) (list 11 4))\n (check-equal? (candidate 4 8 9) (list 12 1))\n (check-equal? (candidate 1 10 10) (list 11 0))\n (check-equal? (candidate 2 11 5) (list 7 0))\n (check-equal? (candidate 4 5 7) (list 9 2))\n (check-equal? (candidate 4 5 1) (list 5 0))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a positive integer N, return the total sum of its digits in binary.\n;; Example\n;; >>> (solve 1000)\n;; \"1\"\n;; >>> (solve 150)\n;; \"110\"\n;; >>> (solve 147)\n;; \"1100\"\n;; Variables:\n;; @N integer\n;; Constraints: 0 \u2264 N \u2264 10000.\n;; Output:\n;; a string of binary number\n(define (solve N)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate solve))\n (check-equal? (candidate 1000) \"1\")\n (check-equal? (candidate 150) \"110\")\n (check-equal? (candidate 147) \"1100\")\n (check-equal? (candidate 333) \"1001\")\n (check-equal? (candidate 963) \"10010\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a list of integers.\n;; You need to find the largest prime value and return the sum of its digits.\n;; Examples:\n;; >>> (skjkasdkd (list 0 3 2 1 3 5 7 4 5 5 5 2 181 32 4 32 3 2 32 324 4 3))\n;; 10\n;; >>> (skjkasdkd (list 1 0 1 8 2 4597 2 1 3 40 1 2 1 2 4 2 5 1))\n;; 25\n;; >>> (skjkasdkd (list 1 3 1 32 5107 34 83278 109 163 23 2323 32 30 1 9 3))\n;; 13\n;; >>> (skjkasdkd (list 0 724 32 71 99 32 6 0 5 91 83 0 5 6))\n;; 11\n;; >>> (skjkasdkd (list 0 81 12 3 1 21))\n;; 3\n;; >>> (skjkasdkd (list 0 8 1 2 1 7))\n;; 7\n(define (skjkasdkd lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate skjkasdkd))\n (check-equal? (candidate (list 0 3 2 1 3 5 7 4 5 5 5 2 181 32 4 32 3 2 32 324 4 3)) 10)\n (check-equal? (candidate (list 1 0 1 8 2 4597 2 1 3 40 1 2 1 2 4 2 5 1)) 25)\n (check-equal? (candidate (list 1 3 1 32 5107 34 83278 109 163 23 2323 32 30 1 9 3)) 13)\n (check-equal? (candidate (list 0 724 32 71 99 32 6 0 5 91 83 0 5 6)) 11)\n (check-equal? (candidate (list 0 81 12 3 1 21)) 3)\n (check-equal? (candidate (list 0 8 1 2 1 7)) 7)\n (check-equal? (candidate (list 8191)) 19)\n (check-equal? (candidate (list 8191 123456 127 7)) 19)\n (check-equal? (candidate (list 127 97 8192)) 10)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a list arr of integers, find the minimum number of elements that\n;; need to be changed to make the list palindromic. A palindromic list is a list that\n;; is read the same backwards and forwards. In one change, you can change one element to any other element.\n;; For example:\n;; >>> (smallest_change (list 1 2 3 5 4 7 9 6))\n;; 4\n;; >>> (smallest_change (list 1 2 3 4 3 2 2))\n;; 1\n;; >>> (smallest_change (list 1 2 3 2 1))\n;; 0\n(define (smallest_change arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate smallest_change))\n (check-equal? (candidate (list 1 2 3 5 4 7 9 6)) 4)\n (check-equal? (candidate (list 1 2 3 4 3 2 2)) 1)\n (check-equal? (candidate (list 1 4 2)) 1)\n (check-equal? (candidate (list 1 4 4 2)) 1)\n (check-equal? (candidate (list 1 2 3 2 1)) 0)\n (check-equal? (candidate (list 3 1 1 3)) 0)\n (check-equal? (candidate (list 1)) 0)\n (check-equal? (candidate (list 0 1)) 1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "rkt", - "prompt": "#lang racket\n\n;; It is the last week of the semester and the teacher has to give the grades\n;; to students. The teacher has been making her own algorithm for grading.\n;; The only problem is, she has lost the code she used for grading.\n;; She has given you a list of GPAs for some students and you have to write \n;; a function that can output a list of letter grades using the following table:\n;; GPA | Letter grade\n;; 4.0 A+\n;; > 3.7 A \n;; > 3.3 A- \n;; > 3.0 B+\n;; > 2.7 B \n;; > 2.3 B-\n;; > 2.0 C+\n;; > 1.7 C\n;; > 1.3 C-\n;; > 1.0 D+ \n;; > 0.7 D \n;; > 0.0 D-\n;; 0.0 E\n;; Example:\n;; >>> (grade_equation (list 4.0 3 1.7 2 3.5))\n;; (list \"A+\" \"B\" \"C-\" \"C\" \"A-\")\n(define (numerical_letter_grade grades)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate numerical_letter_grade))\n (check-equal? (candidate (list 4.0 3 1.7 2 3.5)) (list \"A+\" \"B\" \"C-\" \"C\" \"A-\"))\n (check-equal? (candidate (list 1.2)) (list \"D+\"))\n (check-equal? (candidate (list 0.5)) (list \"D-\"))\n (check-equal? (candidate (list 0.0)) (list \"E\"))\n (check-equal? (candidate (list 1.0 0.3 1.5 2.8 3.3)) (list \"D\" \"D-\" \"C-\" \"B\" \"B+\"))\n (check-equal? (candidate (list 0.0 0.7)) (list \"E\" \"D-\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given the lengths of the three sides of a triangle. Return the area of\n;; the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n;; Otherwise return -1\n;; Three sides make a valid triangle when the sum of any two sides is greater \n;; than the third side.\n;; Example:\n;; >>> (triangle_area 3 4 5)\n;; 6.0\n;; >>> (triangle_area 1 2 10)\n;; -1\n(define (triangle_area a b c)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate triangle_area))\n (check-equal? (candidate 3 4 5) 6.0)\n (check-equal? (candidate 1 2 10) -1)\n (check-equal? (candidate 4 8 5) 8.18)\n (check-equal? (candidate 2 2 2) 1.73)\n (check-equal? (candidate 1 2 3) -1)\n (check-equal? (candidate 10 5 7) 16.25)\n (check-equal? (candidate 2 6 3) -1)\n (check-equal? (candidate 1 1 1) 0.43)\n (check-equal? (candidate 2 2 10) -1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "rkt", - "prompt": "#lang racket\n\n;; Check if two words have the same characters.\n;; >>> (same_chars \"eabcdzzzz\" \"dddzzzzzzzddeddabc\")\n;; #t\n;; >>> (same_chars \"abcd\" \"dddddddabc\")\n;; #t\n;; >>> (same_chars \"dddddddabc\" \"abcd\")\n;; #t\n;; >>> (same_chars \"eabcd\" \"dddddddabc\")\n;; #f\n;; >>> (same_chars \"abcd\" \"dddddddabce\")\n;; #f\n;; >>> (same_chars \"eabcdzzzz\" \"dddzzzzzzzddddabc\")\n;; #f\n(define (same_chars s0 s1)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate same_chars))\n (check-equal? (candidate \"eabcdzzzz\" \"dddzzzzzzzddeddabc\") #t)\n (check-equal? (candidate \"abcd\" \"dddddddabc\") #t)\n (check-equal? (candidate \"dddddddabc\" \"abcd\") #t)\n (check-equal? (candidate \"eabcd\" \"dddddddabc\") #f)\n (check-equal? (candidate \"abcd\" \"dddddddabcf\") #f)\n (check-equal? (candidate \"eabcdzzzz\" \"dddzzzzzzzddddabc\") #f)\n (check-equal? (candidate \"aabb\" \"aaccc\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a list of integers nums, find the minimum sum of any non-empty sub-list\n;; of nums.\n;; Example\n;; >>> (minSubArraySum (list 2 3 4 1 2 4))\n;; 1\n;; >>> (minSubArraySum (list -1 -2 -3))\n;; -6\n(define (minSubArraySum nums)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate minSubArraySum))\n (check-equal? (candidate (list 2 3 4 1 2 4)) 1)\n (check-equal? (candidate (list -1 -2 -3)) -6)\n (check-equal? (candidate (list -1 -2 -3 2 -10)) -14)\n (check-equal? (candidate (list -9999999999999999)) -9999999999999999)\n (check-equal? (candidate (list 0 10 20 1000000)) 0)\n (check-equal? (candidate (list -1 -2 -3 10 -5)) -6)\n (check-equal? (candidate (list 100 -1 -2 -3 10 -5)) -6)\n (check-equal? (candidate (list 10 11 13 8 3 4)) 3)\n (check-equal? (candidate (list 100 -33 32 -1 0 -2)) -33)\n (check-equal? (candidate (list -10)) -10)\n (check-equal? (candidate (list 7)) 7)\n (check-equal? (candidate (list 1 -1)) -1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a string s and a natural number n, you have been tasked to implement \n;; a function that returns a list of all words from string s that contain exactly \n;; n consonants, in order these words appear in the string s.\n;; If the string s is empty then the function should return an empty list.\n;; Note: you may assume the input string contains only letters and spaces.\n;; Examples:\n;; >>> (select_words \"Mary had a little lamb\" 4)\n;; (list \"little\")\n;; >>> (select_words \"Mary had a little lamb\" 3)\n;; (list \"Mary\" \"lamb\")\n;; >>> (select_words \"simple white space\" 2)\n;; (list )\n;; >>> (select_words \"Hello world\" 4)\n;; (list \"world\")\n;; >>> (select_words \"Uncle sam\" 3)\n;; (list \"Uncle\")\n(define (select_words s n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate select_words))\n (check-equal? (candidate \"Mary had a little lamb\" 4) (list \"little\"))\n (check-equal? (candidate \"Mary had a little lamb\" 3) (list \"Mary\" \"lamb\"))\n (check-equal? (candidate \"simple white space\" 2) (list ))\n (check-equal? (candidate \"Hello world\" 4) (list \"world\"))\n (check-equal? (candidate \"Uncle sam\" 3) (list \"Uncle\"))\n (check-equal? (candidate \"\" 4) (list ))\n (check-equal? (candidate \"a b c d e f\" 1) (list \"b\" \"c\" \"d\" \"f\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return list of all prefixes from shortest to longest of the input string\n;; >>> (all_prefixes \"abc\")\n;; (list \"a\" \"ab\" \"abc\")\n(define (all_prefixes string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate all_prefixes))\n (check-equal? (candidate \"\") (list ))\n (check-equal? (candidate \"asdfgh\") (list \"a\" \"as\" \"asd\" \"asdf\" \"asdfg\" \"asdfgh\"))\n (check-equal? (candidate \"WWW\") (list \"W\" \"WW\" \"WWW\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function that takes a value (string) representing a number\n;; and returns the closest integer to it. If the number is equidistant\n;; from two integers, round it away from zero.\n;; Examples\n;; >>> (closest_integer \"10\")\n;; 10\n;; >>> (closest_integer \"15.3\")\n;; 15\n;; Note:\n;; Rounding away from zero means that if the given number is equidistant\n;; from two integers, the one you should return is the one that is the\n;; farthest from zero. For example closest_integer(\"14.5\") should\n;; return 15 and closest_integer(\"-14.5\") should return -15.\n(define (closest_integer value)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate closest_integer))\n (check-equal? (candidate \"10\") 10)\n (check-equal? (candidate \"14.5\") 15)\n (check-equal? (candidate \"-15.5\") -16)\n (check-equal? (candidate \"15.3\") 15)\n (check-equal? (candidate \"0\") 0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function which takes a string representing a file's name, and returns\n;; 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n;; A file's name is considered to be valid if and only if all the following conditions \n;; are met:\n;; - There should not be more than three digits ('0'-'9') in the file's name.\n;; - The file's name contains exactly one dot '.'\n;; - The substring before the dot should not be empty, and it starts with a letter from \n;; the latin alphapet ('a'-'z' and 'A'-'Z').\n;; - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n;; Examples:\n;; >>> (file_name_check \"example.txt\")\n;; \"Yes\"\n;; >>> (file_name_check \"1example.dll\")\n;; \"No\"\n(define (file_name_check file_name)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate file_name_check))\n (check-equal? (candidate \"example.txt\") \"Yes\")\n (check-equal? (candidate \"1example.dll\") \"No\")\n (check-equal? (candidate \"s1sdf3.asd\") \"No\")\n (check-equal? (candidate \"K.dll\") \"Yes\")\n (check-equal? (candidate \"MY16FILE3.exe\") \"Yes\")\n (check-equal? (candidate \"His12FILE94.exe\") \"No\")\n (check-equal? (candidate \"_Y.txt\") \"No\")\n (check-equal? (candidate \"?aREYA.exe\") \"No\")\n (check-equal? (candidate \"/this_is_valid.dll\") \"No\")\n (check-equal? (candidate \"this_is_valid.wow\") \"No\")\n (check-equal? (candidate \"this_is_valid.txt\") \"Yes\")\n (check-equal? (candidate \"this_is_valid.txtexe\") \"No\")\n (check-equal? (candidate \"#this2_i4s_5valid.ten\") \"No\")\n (check-equal? (candidate \"@this1_is6_valid.exe\") \"No\")\n (check-equal? (candidate \"this_is_12valid.6exe4.txt\") \"No\")\n (check-equal? (candidate \"all.exe.txt\") \"No\")\n (check-equal? (candidate \"I563_No.exe\") \"Yes\")\n (check-equal? (candidate \"Is3youfault.txt\") \"Yes\")\n (check-equal? (candidate \"no_one#knows.dll\") \"Yes\")\n (check-equal? (candidate \"1I563_Yes3.exe\") \"No\")\n (check-equal? (candidate \"I563_Yes3.txtt\") \"No\")\n (check-equal? (candidate \"final..txt\") \"No\")\n (check-equal? (candidate \"final132\") \"No\")\n (check-equal? (candidate \"_f4indsartal132.\") \"No\")\n (check-equal? (candidate \".txt\") \"No\")\n (check-equal? (candidate \"s.\") \"No\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given two intervals,\n;; where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n;; The given intervals are closed which means that the interval (start, end)\n;; includes both start and end.\n;; For each given interval, it is assumed that its start is less or equal its end.\n;; Your task is to determine whether the length of intersection of these two \n;; intervals is a prime number.\n;; Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n;; which its length is 1, which not a prime number.\n;; If the length of the intersection is a prime number, return \"YES\",\n;; otherwise, return \"NO\".\n;; If the two intervals don't intersect, return \"NO\".\n;; [input/output] samples:\n;; >>> (intersection (list 1 2) (list 2 3))\n;; \"NO\"\n;; >>> (intersection (list -1 1) (list 0 4))\n;; \"NO\"\n;; >>> (intersection (list -3 -1) (list -5 5))\n;; \"YES\"\n(define (intersection interval1 interval2)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate intersection))\n (check-equal? (candidate (list 1 2) (list 2 3)) \"NO\")\n (check-equal? (candidate (list -1 1) (list 0 4)) \"NO\")\n (check-equal? (candidate (list -3 -1) (list -5 5)) \"YES\")\n (check-equal? (candidate (list -2 2) (list -4 0)) \"YES\")\n (check-equal? (candidate (list -11 2) (list -1 -1)) \"NO\")\n (check-equal? (candidate (list 1 2) (list 3 5)) \"NO\")\n (check-equal? (candidate (list 1 2) (list 1 2)) \"NO\")\n (check-equal? (candidate (list -2 -2) (list -3 -2)) \"NO\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return the largest prime factor of n. Assume n > 1 and is not a prime.\n;; >>> (largest_prime_factor 13195)\n;; 29\n;; >>> (largest_prime_factor 2048)\n;; 2\n(define (largest_prime_factor n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate largest_prime_factor))\n (check-equal? (candidate 15) 5)\n (check-equal? (candidate 27) 3)\n (check-equal? (candidate 63) 7)\n (check-equal? (candidate 330) 11)\n (check-equal? (candidate 13195) 29)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a string, find out how many distinct characters (regardless of case) does it consist of\n;; >>> (count_distinct_characters \"xyzXYZ\")\n;; 3\n;; >>> (count_distinct_characters \"Jerry\")\n;; 4\n(define (count_distinct_characters string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate count_distinct_characters))\n (check-equal? (candidate \"\") 0)\n (check-equal? (candidate \"abcde\") 5)\n (check-equal? (candidate \"abcdecadeCADE\") 5)\n (check-equal? (candidate \"aaaaAAAAaaaa\") 1)\n (check-equal? (candidate \"Jerry jERRY JeRRRY\") 5)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "rkt", - "prompt": "#lang racket\n\n;; You're given a list of deposit and withdrawal operations on a bank account that starts with\n;; zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n;; at that point function should return #t. Otherwise it should return #f.\n;; >>> (below_zero (list 1 2 3))\n;; #f\n;; >>> (below_zero (list 1 2 -4 5))\n;; #t\n(define (below_zero operations)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate below_zero))\n (check-equal? (candidate (list )) #f)\n (check-equal? (candidate (list 1 2 -3 1 2 -3)) #f)\n (check-equal? (candidate (list 1 2 -4 5 6)) #t)\n (check-equal? (candidate (list 1 -1 2 -2 5 -5 4 -4)) #f)\n (check-equal? (candidate (list 1 -1 2 -2 5 -5 4 -5)) #t)\n (check-equal? (candidate (list 1 -2 2 -2 5 -5 4 -4)) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "rkt", - "prompt": "#lang racket\n\n;; Find the shortest palindrome that begins with a supplied string.\n;; Algorithm idea is simple:\n;; - Find the longest postfix of supplied string that is a palindrome.\n;; - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n;; >>> (make_palindrome \"\")\n;; \"\"\n;; >>> (make_palindrome \"cat\")\n;; \"catac\"\n;; >>> (make_palindrome \"cata\")\n;; \"catac\"\n(define (make_palindrome string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate make_palindrome))\n (check-equal? (candidate \"\") \"\")\n (check-equal? (candidate \"x\") \"x\")\n (check-equal? (candidate \"xyz\") \"xyzyx\")\n (check-equal? (candidate \"xyx\") \"xyx\")\n (check-equal? (candidate \"jerry\") \"jerryrrej\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a positive integer, obtain its roman numeral equivalent as a string,\n;; and return it in lowercase.\n;; Restrictions: 1 <= num <= 1000\n;; Examples:\n;; >>> (int_to_mini_roman 19)\n;; \"xix\"\n;; >>> (int_to_mini_roman 152)\n;; \"clii\"\n;; >>> (int_to_mini_roman 426)\n;; \"cdxxvi\"\n(define (int_to_mini_roman number)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "reworded", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate int_to_mini_roman))\n (check-equal? (candidate 19) \"xix\")\n (check-equal? (candidate 152) \"clii\")\n (check-equal? (candidate 251) \"ccli\")\n (check-equal? (candidate 426) \"cdxxvi\")\n (check-equal? (candidate 500) \"d\")\n (check-equal? (candidate 1) \"i\")\n (check-equal? (candidate 4) \"iv\")\n (check-equal? (candidate 43) \"xliii\")\n (check-equal? (candidate 90) \"xc\")\n (check-equal? (candidate 94) \"xciv\")\n (check-equal? (candidate 532) \"dxxxii\")\n (check-equal? (candidate 900) \"cm\")\n (check-equal? (candidate 994) \"cmxciv\")\n (check-equal? (candidate 1000) \"m\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - } -] \ No newline at end of file diff --git a/data/rkt-transform.json b/data/rkt-transform.json deleted file mode 100644 index aff407e855c9d95fbb41369b2fc3af92b9c833b4..0000000000000000000000000000000000000000 --- a/data/rkt-transform.json +++ /dev/null @@ -1,2417 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "rkt", - "prompt": "#lang racket\n\n;; For a given number n, find the largest number that divides n evenly, smaller than n\n;; >>> (largest_divisor 15)\n;; 5\n(define (largest_divisor n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate largest_divisor))\n (check-equal? (candidate 3) 1)\n (check-equal? (candidate 7) 1)\n (check-equal? (candidate 10) 5)\n (check-equal? (candidate 100) 50)\n (check-equal? (candidate 49) 7)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_47_median", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return median of elements in the list l.\n;; >>> (median (list 3 1 2 4 5))\n;; 3\n;; >>> (median (list -10 4 6 1000 10 20))\n;; 15.0\n(define (median l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate median))\n (check-equal? (candidate (list 3 1 2 4 5)) 3)\n (check-equal? (candidate (list -10 4 6 1000 10 20)) 8.0)\n (check-equal? (candidate (list 5)) 5)\n (check-equal? (candidate (list 6 5)) 5.5)\n (check-equal? (candidate (list 8 1 3 9 9 2 7)) 7)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given two lists operator, and operand. The first list has basic algebra operations, and \n;; the second list is a list of integers. Use the two given lists to build the algebric \n;; expression and return the evaluation of this expression.\n;; The basic algebra operations:\n;; Addition ( + ) \n;; Subtraction ( - ) \n;; Multiplication ( * ) \n;; Floor division ( // ) \n;; Exponentiation ( ** ) \n;; Example:\n;; operator['+', '*', '-']\n;; array = [2, 3, 4, 5]\n;; result = 2 + 3 * 4 - 5\n;; => result = 9\n;; Note:\n;; The length of operator list is equal to the length of operand list minus one.\n;; Operand is a list of of non-negative integers.\n;; Operator list has at least one operator, and operand list has at least two operands.\n(define (do_algebra operator operand)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate do_algebra))\n (check-equal? (candidate (list \"**\" \"*\" \"+\") (list 2 3 4 5)) 37)\n (check-equal? (candidate (list \"+\" \"*\" \"-\") (list 2 3 4 5)) 9)\n (check-equal? (candidate (list \"//\" \"*\") (list 7 3 4)) 8)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return maximum element in the list.\n;; >>> (max_element (list 1 2 3))\n;; 3\n;; >>> (max_element (list 5 3 -5 2 -3 3 9 0 123 1 -10))\n;; 123\n(define (max_element l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate max_element))\n (check-equal? (candidate (list 1 2 3)) 3)\n (check-equal? (candidate (list 5 3 -5 2 -3 3 9 0 124 1 -10)) 124)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function which returns the largest index of an element which\n;; is not greater than or equal to the element immediately preceding it. If\n;; no such element exists then return -1. The given array will not contain\n;; duplicate values.\n;; Examples:\n;; >>> (can_arrange (list 1 2 4 3 5))\n;; 3\n;; >>> (can_arrange (list 1 2 3))\n;; -1\n(define (can_arrange arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate can_arrange))\n (check-equal? (candidate (list 1 2 4 3 5)) 3)\n (check-equal? (candidate (list 1 2 4 5)) -1)\n (check-equal? (candidate (list 1 4 2 5 6 7 8 9 10)) 2)\n (check-equal? (candidate (list 4 8 5 7 3)) 4)\n (check-equal? (candidate (list )) -1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "rkt", - "prompt": "#lang racket\n\n;; Imagine a road that's a perfectly straight infinitely long line.\n;; n cars are driving left to right; simultaneously, a different set of n cars\n;; are driving right to left. The two sets of cars start out being very far from\n;; each other. All cars move in the same speed. Two cars are said to collide\n;; when a car that's moving left to right hits a car that's moving right to left.\n;; However, the cars are infinitely sturdy and strong; as a result, they continue moving\n;; in their trajectory as if they did not collide.\n;; This function outputs the number of such collisions.\n(define (car_race_collision n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate car_race_collision))\n (check-equal? (candidate 2) 4)\n (check-equal? (candidate 3) 9)\n (check-equal? (candidate 4) 16)\n (check-equal? (candidate 8) 64)\n (check-equal? (candidate 10) 100)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function that returns True if the last character\n;; of a given string is an alphabetical character and is not\n;; a part of a word, and False otherwise.\n;; Note: \"word\" is a group of characters separated by space.\n;; Examples:\n;; >>> (check_if_last_char_is_a_letter \"apple pie\")\n;; #f\n;; >>> (check_if_last_char_is_a_letter \"apple pi e\")\n;; #t\n;; >>> (check_if_last_char_is_a_letter \"apple pi e \")\n;; #f\n;; >>> (check_if_last_char_is_a_letter \"\")\n;; #f\n(define (check_if_last_char_is_a_letter txt)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate check_if_last_char_is_a_letter))\n (check-equal? (candidate \"apple\") #f)\n (check-equal? (candidate \"apple pi e\") #t)\n (check-equal? (candidate \"eeeee\") #f)\n (check-equal? (candidate \"A\") #t)\n (check-equal? (candidate \"Pumpkin pie \") #f)\n (check-equal? (candidate \"Pumpkin pie 1\") #f)\n (check-equal? (candidate \"\") #f)\n (check-equal? (candidate \"eeeee e \") #f)\n (check-equal? (candidate \"apple pie\") #f)\n (check-equal? (candidate \"apple pi e \") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return true if a given number is prime, and false otherwise.\n;; >>> (is_prime 6)\n;; #f\n;; >>> (is_prime 101)\n;; #t\n;; >>> (is_prime 11)\n;; #t\n;; >>> (is_prime 13441)\n;; #t\n;; >>> (is_prime 61)\n;; #t\n;; >>> (is_prime 4)\n;; #f\n;; >>> (is_prime 1)\n;; #f\n(define (is_prime n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_prime))\n (check-equal? (candidate 6) #f)\n (check-equal? (candidate 101) #t)\n (check-equal? (candidate 11) #t)\n (check-equal? (candidate 13441) #t)\n (check-equal? (candidate 61) #t)\n (check-equal? (candidate 4) #f)\n (check-equal? (candidate 1) #f)\n (check-equal? (candidate 5) #t)\n (check-equal? (candidate 11) #t)\n (check-equal? (candidate 17) #t)\n (check-equal? (candidate 85) #f)\n (check-equal? (candidate 77) #f)\n (check-equal? (candidate 255379) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a list of positive integers x. return a sorted list of all \n;; elements that hasn't any even digit.\n;; Note: Returned list should be sorted in increasing order.\n;; For example:\n;; >>> (unique_digits (list 15 33 1422 1))\n;; (list 1 15 33)\n;; >>> (unique_digits (list 152 323 1422 10))\n;; (list )\n(define (unique_digits x)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate unique_digits))\n (check-equal? (candidate (list 15 33 1422 1)) (list 1 15 33))\n (check-equal? (candidate (list 152 323 1422 10)) (list ))\n (check-equal? (candidate (list 12345 2033 111 151)) (list 111 151))\n (check-equal? (candidate (list 135 103 31)) (list 31 135))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "rkt", - "prompt": "#lang racket\n\n;; Input are two strings a and b consisting only of 1s and 0s.\n;; Perform binary XOR on these inputs and return result also as a string.\n;; >>> (string_xor \"010\" \"110\")\n;; \"100\"\n(define (string_xor a b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate string_xor))\n (check-equal? (candidate \"111000\" \"101010\") \"010010\")\n (check-equal? (candidate \"1\" \"1\") \"0\")\n (check-equal? (candidate \"0101\" \"0000\") \"0101\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "rkt", - "prompt": "#lang racket\n\n;; sum_to_n is a function that sums numbers from 1 to n.\n;; >>> (sum_to_n 30)\n;; 465\n;; >>> (sum_to_n 100)\n;; 5050\n;; >>> (sum_to_n 5)\n;; 15\n;; >>> (sum_to_n 10)\n;; 55\n;; >>> (sum_to_n 1)\n;; 1\n(define (sum_to_n n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sum_to_n))\n (check-equal? (candidate 1) 1)\n (check-equal? (candidate 6) 21)\n (check-equal? (candidate 11) 66)\n (check-equal? (candidate 30) 465)\n (check-equal? (candidate 100) 5050)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a list of numbers, return the sum of squares of the numbers\n;; in the list that are odd. Ignore numbers that are negative or not integers.\n;; >>> (double_the_difference (list 1 3 2 0))\n;; 10\n;; >>> (double_the_difference (list -1 -2 0))\n;; 0\n;; >>> (double_the_difference (list 9 -2))\n;; 81\n;; >>> (double_the_difference (list 0))\n;; 0\n;; If the input list is empty, return 0.\n(define (double_the_difference lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate double_the_difference))\n (check-equal? (candidate (list )) 0)\n (check-equal? (candidate (list 5.0 4.0)) 25)\n (check-equal? (candidate (list 0.1 0.2 0.3)) 0)\n (check-equal? (candidate (list -10.0 -20.0 -30.0)) 0)\n (check-equal? (candidate (list -1.0 -2.0 8.0)) 0)\n (check-equal? (candidate (list 0.2 3.0 5.0)) 34)\n (check-equal? (candidate (list -9.0 -7.0 -5.0 -3.0 -1.0 1.0 3.0 5.0 7.0 9.0)) 165)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return length of given string\n;; >>> (strlen \"\")\n;; 0\n;; >>> (strlen \"abc\")\n;; 3\n(define (strlen string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate strlen))\n (check-equal? (candidate \"\") 0)\n (check-equal? (candidate \"x\") 1)\n (check-equal? (candidate \"asdasnakj\") 9)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "rkt", - "prompt": "#lang racket\n\n;; You'll be given a string of words, and your task is to count the number\n;; of boredoms. A boredom is a sentence that starts with the word \"I\".\n;; Sentences are delimited by '.', '?' or '!'.\n;; For example:\n;; >>> (is_bored \"Hello world\")\n;; 0\n;; >>> (is_bored \"The sky is blue. The sun is shining. I love this weather\")\n;; 1\n(define (is_bored S)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_bored))\n (check-equal? (candidate \"Hello world\") 0)\n (check-equal? (candidate \"Is the sky blue?\") 0)\n (check-equal? (candidate \"I love It !\") 1)\n (check-equal? (candidate \"bIt\") 0)\n (check-equal? (candidate \"I feel good today. I will be productive. will kill It\") 2)\n (check-equal? (candidate \"You and I are going for a walk\") 0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function vowels_count which takes a string representing\n;; a word as input and returns the number of vowels in the string.\n;; Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n;; vowel, but only when it is at the end of the given word.\n;; Example:\n;; >>> (vowels_count \"abcde\")\n;; 2\n;; >>> (vowels_count \"ACEDY\")\n;; 3\n(define (vowels_count s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate vowels_count))\n (check-equal? (candidate \"abcde\") 2)\n (check-equal? (candidate \"Alone\") 3)\n (check-equal? (candidate \"key\") 2)\n (check-equal? (candidate \"bye\") 1)\n (check-equal? (candidate \"keY\") 2)\n (check-equal? (candidate \"bYe\") 1)\n (check-equal? (candidate \"ACEDY\") 3)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return n-th Fibonacci number.\n;; >>> (fib 10)\n;; 55\n;; >>> (fib 1)\n;; 1\n;; >>> (fib 8)\n;; 21\n(define (fib n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate fib))\n (check-equal? (candidate 10) 55)\n (check-equal? (candidate 1) 1)\n (check-equal? (candidate 8) 21)\n (check-equal? (candidate 11) 89)\n (check-equal? (candidate 12) 144)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "rkt", - "prompt": "#lang racket\n\n;; Your task is to implement a function that will simplify the expression\n;; x * n. The function returns True if x * n evaluates to a whole number and False\n;; otherwise. Both x and n, are string representation of a fraction, and have the following format,\n;; / where both numerator and denominator are positive whole numbers.\n;; You can assume that x, and n are valid fractions, and do not have zero as denominator.\n;; >>> (simplify \"1/5\" \"5/1\")\n;; #t\n;; >>> (simplify \"1/6\" \"2/1\")\n;; #f\n;; >>> (simplify \"7/10\" \"10/2\")\n;; #f\n(define (simplify x n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate simplify))\n (check-equal? (candidate \"1/5\" \"5/1\") #t)\n (check-equal? (candidate \"1/6\" \"2/1\") #f)\n (check-equal? (candidate \"5/1\" \"3/1\") #t)\n (check-equal? (candidate \"7/10\" \"10/2\") #f)\n (check-equal? (candidate \"2/10\" \"50/10\") #t)\n (check-equal? (candidate \"7/2\" \"4/2\") #t)\n (check-equal? (candidate \"11/6\" \"6/1\") #t)\n (check-equal? (candidate \"2/3\" \"5/2\") #f)\n (check-equal? (candidate \"5/2\" \"3/5\") #f)\n (check-equal? (candidate \"2/4\" \"8/4\") #t)\n (check-equal? (candidate \"2/4\" \"4/2\") #t)\n (check-equal? (candidate \"1/5\" \"5/1\") #t)\n (check-equal? (candidate \"1/5\" \"1/5\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a string s, count the number of uppercase vowels in even indices.\n;; For example:\n;; >>> (count_upper \"aBCdEf\")\n;; 1\n;; >>> (count_upper \"abcdefg\")\n;; 0\n;; >>> (count_upper \"dBBE\")\n;; 0\n(define (count_upper s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate count_upper))\n (check-equal? (candidate \"aBCdEf\") 1)\n (check-equal? (candidate \"abcdefg\") 0)\n (check-equal? (candidate \"dBBE\") 0)\n (check-equal? (candidate \"B\") 0)\n (check-equal? (candidate \"U\") 1)\n (check-equal? (candidate \"\") 0)\n (check-equal? (candidate \"EEEE\") 2)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a rectangular grid of wells. Each row represents a single well,\n;; and each 1 in a row represents a single unit of water.\n;; Each well has a corresponding bucket that can be used to extract water from it, \n;; and all buckets have the same capacity.\n;; Your task is to use the buckets to empty the wells.\n;; Output the number of times you need to lower the buckets.\n;; Example 1:\n;; >>> (max_fill (list (list 0 0 1 0) (list 0 1 0 0) (list 1 1 1 1)) 1)\n;; 6\n;; Example 2:\n;; >>> (max_fill (list (list 0 0 1 1) (list 0 0 0 0) (list 1 1 1 1) (list 0 1 1 1)) 2)\n;; 5\n;; Example 3:\n;; >>> (max_fill (list (list 0 0 0) (list 0 0 0)) 5)\n;; 0\n;; Constraints:\n;; * all wells have the same length\n;; * 1 <= grid.length <= 10^2\n;; * 1 <= grid[:,1].length <= 10^2\n;; * grid[i][j] -> 0 | 1\n;; * 1 <= capacity <= 10\n(define (max_fill grid capacity)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate max_fill))\n (check-equal? (candidate (list (list 0 0 1 0) (list 0 1 0 0) (list 1 1 1 1)) 1) 6)\n (check-equal? (candidate (list (list 0 0 1 1) (list 0 0 0 0) (list 1 1 1 1) (list 0 1 1 1)) 2) 5)\n (check-equal? (candidate (list (list 0 0 0) (list 0 0 0)) 5) 0)\n (check-equal? (candidate (list (list 1 1 1 1) (list 1 1 1 1)) 2) 4)\n (check-equal? (candidate (list (list 1 1 1 1) (list 1 1 1 1)) 9) 2)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given an array arr of integers and a positive integer k, return a sorted list \n;; of length k with the maximum k numbers in arr.\n;; Example 1:\n;; >>> (maximum (list -3 -4 5) 3)\n;; (list -4 -3 5)\n;; Example 2:\n;; >>> (maximum (list 4 -4 4) 2)\n;; (list 4 4)\n;; Example 3:\n;; >>> (maximum (list -3 2 1 2 -1 -2 1) 1)\n;; (list 2)\n;; Note:\n;; 1. The length of the array will be in the range of [1, 1000].\n;; 2. The elements in the array will be in the range of [-1000, 1000].\n;; 3. 0 <= k <= len(arr)\n(define (maximum arr k)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate maximum))\n (check-equal? (candidate (list -3 -4 5) 3) (list -4 -3 5))\n (check-equal? (candidate (list 4 -4 4) 2) (list 4 4))\n (check-equal? (candidate (list -3 2 1 2 -1 -2 1) 1) (list 2))\n (check-equal? (candidate (list 123 -123 20 0 1 2 -3) 3) (list 2 20 123))\n (check-equal? (candidate (list -123 20 0 1 2 -3) 4) (list 0 1 2 20))\n (check-equal? (candidate (list 5 15 0 3 -13 -8 0) 7) (list -13 -8 0 0 3 5 15))\n (check-equal? (candidate (list -1 0 2 5 3 -10) 2) (list 3 5))\n (check-equal? (candidate (list 1 0 5 -7) 1) (list 5))\n (check-equal? (candidate (list 4 -4) 2) (list -4 4))\n (check-equal? (candidate (list -10 10) 2) (list -10 10))\n (check-equal? (candidate (list 1 2 3 -23 243 -400 0) 0) (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that takes a message, and encodes in such a \n;; way that it swaps case of all letters, replaces all vowels in \n;; the message with the letter that appears 2 places ahead of that \n;; vowel in the english alphabet. \n;; Assume only letters. \n;; Examples:\n;; >>> (encode \"test\")\n;; \"TGST\"\n;; >>> (encode \"This is a message\")\n;; \"tHKS KS C MGSSCGG\"\n(define (encode message)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate encode))\n (check-equal? (candidate \"TEST\") \"tgst\")\n (check-equal? (candidate \"Mudasir\") \"mWDCSKR\")\n (check-equal? (candidate \"YES\") \"ygs\")\n (check-equal? (candidate \"This is a message\") \"tHKS KS C MGSSCGG\")\n (check-equal? (candidate \"I DoNt KnOw WhAt tO WrItE\") \"k dQnT kNqW wHcT Tq wRkTg\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "rkt", - "prompt": "#lang racket\n\n;; remove_vowels is a function that takes string and returns string without vowels.\n;; >>> (remove_vowels \"\")\n;; \"\"\n;; >>> (remove_vowels \"abcdef\")\n;; \"bcdf\"\n;; >>> (remove_vowels \"aaaaa\")\n;; \"\"\n;; >>> (remove_vowels \"aaBAA\")\n;; \"B\"\n;; >>> (remove_vowels \"zbcd\")\n;; \"zbcd\"\n(define (remove_vowels text)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate remove_vowels))\n (check-equal? (candidate \"\") \"\")\n (check-equal? (candidate \"abcdef\nghijklm\") \"bcdf\nghjklm\")\n (check-equal? (candidate \"fedcba\") \"fdcb\")\n (check-equal? (candidate \"eeeee\") \"\")\n (check-equal? (candidate \"acBAA\") \"cB\")\n (check-equal? (candidate \"EcBOO\") \"cB\")\n (check-equal? (candidate \"ybcd\") \"ybcd\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return only positive numbers in the list.\n;; >>> (get_positive (list -1 2 -4 5 6))\n;; (list 2 5 6)\n;; >>> (get_positive (list 5 3 -5 2 -3 3 9 0 123 1 -10))\n;; (list 5 3 2 3 9 123 1)\n(define (get_positive l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate get_positive))\n (check-equal? (candidate (list -1 -2 4 5 6)) (list 4 5 6))\n (check-equal? (candidate (list 5 3 -5 2 3 3 9 0 123 1 -10)) (list 5 3 2 3 3 9 123 1))\n (check-equal? (candidate (list -1 -2)) (list ))\n (check-equal? (candidate (list )) (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n;; >>> (string_sequence 0)\n;; \"0\"\n;; >>> (string_sequence 5)\n;; \"0 1 2 3 4 5\"\n(define (string_sequence n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate string_sequence))\n (check-equal? (candidate 0) \"0\")\n (check-equal? (candidate 3) \"0 1 2 3\")\n (check-equal? (candidate 10) \"0 1 2 3 4 5 6 7 8 9 10\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a positive integer n, you have to make a pile of n levels of stones.\n;; The first level has n stones.\n;; The number of stones in the next level is:\n;; - the next odd number if n is odd.\n;; - the next even number if n is even.\n;; Return the number of stones in each level in a list, where element at index\n;; i represents the number of stones in the level (i+1).\n;; Examples:\n;; >>> (make_a_pile 3)\n;; (list 3 5 7)\n(define (make_a_pile n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate make_a_pile))\n (check-equal? (candidate 3) (list 3 5 7))\n (check-equal? (candidate 4) (list 4 6 8 10))\n (check-equal? (candidate 5) (list 5 7 9 11 13))\n (check-equal? (candidate 6) (list 6 8 10 12 14 16))\n (check-equal? (candidate 8) (list 8 10 12 14 16 18 20 22))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "rkt", - "prompt": "#lang racket\n\n;; Task\n;; 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\n;; then check if the result string is palindrome.\n;; A string is called palindrome if it reads the same backward as forward.\n;; You should return a tuple containing the result string and True/False for the check.\n;; Example\n;; >>> (reverse_delete \"abcde\" \"ae\")\n;; (list \"bcd\" #f)\n;; >>> (reverse_delete \"abcdef\" \"b\")\n;; (list \"acdef\" #f)\n;; >>> (reverse_delete \"abcdedcba\" \"ab\")\n;; (list \"cdedc\" #t)\n(define (reverse_delete s c)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate reverse_delete))\n (check-equal? (candidate \"abcde\" \"ae\") (list \"bcd\" #f))\n (check-equal? (candidate \"abcdef\" \"b\") (list \"acdef\" #f))\n (check-equal? (candidate \"abcdedcba\" \"ab\") (list \"cdedc\" #t))\n (check-equal? (candidate \"dwik\" \"w\") (list \"dik\" #f))\n (check-equal? (candidate \"a\" \"a\") (list \"\" #t))\n (check-equal? (candidate \"abcdedcba\" \"\") (list \"abcdedcba\" #t))\n (check-equal? (candidate \"abcdedcba\" \"v\") (list \"abcdedcba\" #t))\n (check-equal? (candidate \"vabba\" \"v\") (list \"abba\" #t))\n (check-equal? (candidate \"mamma\" \"mia\") (list \"\" #t))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "rkt", - "prompt": "#lang racket\n\n;; For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n;; >>> (flip_case \"Hello\")\n;; \"hELLO\"\n(define (flip_case string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate flip_case))\n (check-equal? (candidate \"\") \"\")\n (check-equal? (candidate \"Hello!\") \"hELLO!\")\n (check-equal? (candidate \"These violent delights have violent ends\") \"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a string s.\n;; if s[i] is a letter, reverse its case from lower to upper or vise versa, \n;; otherwise keep it as it is.\n;; If the string contains no letters, reverse the string.\n;; The function should return the resulted string.\n;; Examples\n;; >>> (solve \"1234\")\n;; \"4321\"\n;; >>> (solve \"ab\")\n;; \"AB\"\n;; >>> (solve \"#a@C\")\n;; \"#A@c\"\n(define (solve s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate solve))\n (check-equal? (candidate \"AsDf\") \"aSdF\")\n (check-equal? (candidate \"1234\") \"4321\")\n (check-equal? (candidate \"ab\") \"AB\")\n (check-equal? (candidate \"#a@C\") \"#A@c\")\n (check-equal? (candidate \"#AsdfW^45\") \"#aSDFw^45\")\n (check-equal? (candidate \"#6@2\") \"2@6#\")\n (check-equal? (candidate \"#$a^D\") \"#$A^d\")\n (check-equal? (candidate \"#ccc\") \"#CCC\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "rkt", - "prompt": "#lang racket\n\n;; Filter an input list of strings only for ones that start with a given prefix.\n;; >>> (filter_by_prefix (list ) \"a\")\n;; (list )\n;; >>> (filter_by_prefix (list \"abc\" \"bcd\" \"cde\" \"array\") \"a\")\n;; (list \"abc\" \"array\")\n(define (filter_by_prefix strings prefix)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate filter_by_prefix))\n (check-equal? (candidate (list ) \"john\") (list ))\n (check-equal? (candidate (list \"xxx\" \"asd\" \"xxy\" \"john doe\" \"xxxAAA\" \"xxx\") \"xxx\") (list \"xxx\" \"xxxAAA\" \"xxx\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "rkt", - "prompt": "#lang racket\n\n;; This function takes two positive numbers x and y and returns the\n;; biggest even integer number that is in the range [x, y] inclusive. If \n;; there's no such number, then the function should return -1.\n;; For example:\n;; >>> (choose_num 12 15)\n;; 14\n;; >>> (choose_num 13 12)\n;; -1\n(define (choose_num x y)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate choose_num))\n (check-equal? (candidate 12 15) 14)\n (check-equal? (candidate 13 12) -1)\n (check-equal? (candidate 33 12354) 12354)\n (check-equal? (candidate 5234 5233) -1)\n (check-equal? (candidate 6 29) 28)\n (check-equal? (candidate 27 10) -1)\n (check-equal? (candidate 7 7) -1)\n (check-equal? (candidate 546 546) 546)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a string representing a sentence,\n;; the sentence contains some words separated by a space,\n;; and you have to return a string that contains the words from the original sentence,\n;; whose lengths are prime numbers,\n;; the order of the words in the new string should be the same as the original one.\n;; Example 1:\n;; >>> (words_in_sentence \"This is a test\")\n;; \"is\"\n;; Example 2:\n;; >>> (words_in_sentence \"lets go for swimming\")\n;; \"go for\"\n;; Constraints:\n;; * 1 <= len(sentence) <= 100\n;; * sentence contains only letters\n(define (words_in_sentence sentence)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate words_in_sentence))\n (check-equal? (candidate \"This is a test\") \"is\")\n (check-equal? (candidate \"lets go for swimming\") \"go for\")\n (check-equal? (candidate \"there is no place available here\") \"there is no place\")\n (check-equal? (candidate \"Hi I am Hussein\") \"Hi am Hussein\")\n (check-equal? (candidate \"go for it\") \"go for it\")\n (check-equal? (candidate \"here\") \"\")\n (check-equal? (candidate \"here is\") \"is\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "rkt", - "prompt": "#lang racket\n\n;; Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n;; >>> (intersperse (list ) 4)\n;; (list )\n;; >>> (intersperse (list 1 2 3) 4)\n;; (list 1 4 2 4 3)\n(define (intersperse numbers delimeter)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate intersperse))\n (check-equal? (candidate (list ) 7) (list ))\n (check-equal? (candidate (list 5 6 3 2) 8) (list 5 8 6 8 3 8 2))\n (check-equal? (candidate (list 2 2 2) 2) (list 2 2 2 2 2))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "rkt", - "prompt": "#lang racket\n\n;; Your task is to write a function that returns true if a number x is a simple\n;; power of n and false in other cases.\n;; x is a simple power of n if n**int=x\n;; For example:\n;; >>> (is_simple_power 1 4)\n;; #t\n;; >>> (is_simple_power 2 2)\n;; #t\n;; >>> (is_simple_power 8 2)\n;; #t\n;; >>> (is_simple_power 3 2)\n;; #f\n;; >>> (is_simple_power 3 1)\n;; #f\n;; >>> (is_simple_power 5 3)\n;; #f\n(define (is_simple_power x n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_simple_power))\n (check-equal? (candidate 16 2) #t)\n (check-equal? (candidate 143214 16) #f)\n (check-equal? (candidate 4 2) #t)\n (check-equal? (candidate 9 3) #t)\n (check-equal? (candidate 16 4) #t)\n (check-equal? (candidate 24 2) #f)\n (check-equal? (candidate 128 4) #f)\n (check-equal? (candidate 12 6) #f)\n (check-equal? (candidate 1 1) #t)\n (check-equal? (candidate 1 12) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that returns true if the given number is the multiplication of 3 prime numbers\n;; and false otherwise.\n;; Knowing that (a) is less then 100. \n;; Example:\n;; >>> (is_multiply_prime 30)\n;; #t\n;; 30 = 2 * 3 * 5\n(define (is_multiply_prime a)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_multiply_prime))\n (check-equal? (candidate 5) #f)\n (check-equal? (candidate 30) #t)\n (check-equal? (candidate 8) #t)\n (check-equal? (candidate 10) #f)\n (check-equal? (candidate 125) #t)\n (check-equal? (candidate 105) #t)\n (check-equal? (candidate 126) #f)\n (check-equal? (candidate 729) #f)\n (check-equal? (candidate 891) #f)\n (check-equal? (candidate 1001) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given the lengths of the three sides of a triangle. Return True if the three\n;; sides form a right-angled triangle, False otherwise.\n;; A right-angled triangle is a triangle in which one angle is right angle or \n;; 90 degree.\n;; Example:\n;; >>> (right_angle_triangle 3 4 5)\n;; #t\n;; >>> (right_angle_triangle 1 2 3)\n;; #f\n(define (right_angle_triangle a b c)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate right_angle_triangle))\n (check-equal? (candidate 3 4 5) #t)\n (check-equal? (candidate 1 2 3) #f)\n (check-equal? (candidate 10 6 8) #t)\n (check-equal? (candidate 2 2 2) #f)\n (check-equal? (candidate 7 24 25) #t)\n (check-equal? (candidate 10 5 7) #f)\n (check-equal? (candidate 5 12 13) #t)\n (check-equal? (candidate 15 8 17) #t)\n (check-equal? (candidate 48 55 73) #t)\n (check-equal? (candidate 1 1 1) #f)\n (check-equal? (candidate 2 2 10) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function that takes 3 numbers.\n;; Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n;; Returns false in any other cases.\n;; Examples\n;; >>> (any_int 5 2 7)\n;; #t\n;; >>> (any_int 3 2 2)\n;; #f\n;; >>> (any_int 3 -2 1)\n;; #t\n;; >>> (any_int 3.6 -2.2 2)\n;; #f\n(define (any_int x y z)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate any_int))\n (check-equal? (candidate 2 3 1) #t)\n (check-equal? (candidate 2.5 2 3) #f)\n (check-equal? (candidate 1.5 5 3.5) #f)\n (check-equal? (candidate 2 6 2) #f)\n (check-equal? (candidate 4 2 2) #t)\n (check-equal? (candidate 2.2 2.2 2.2) #f)\n (check-equal? (candidate -4 6 2) #t)\n (check-equal? (candidate 2 1 1) #t)\n (check-equal? (candidate 3 4 7) #t)\n (check-equal? (candidate 3.0 4 7) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "rkt", - "prompt": "#lang racket\n\n;; This function takes a list l and returns a list l' such that\n;; l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n;; to the values of the corresponding indicies of l, but sorted.\n;; >>> (sort_third (list 1 2 3))\n;; (list 1 2 3)\n;; >>> (sort_third (list 5 6 3 4 8 9 2))\n;; (list 2 6 3 4 8 9 5)\n(define (sort_third l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sort_third))\n (check-equal? (candidate (list 5 6 3 4 8 9 2)) (list 2 6 3 4 8 9 5))\n (check-equal? (candidate (list 5 8 3 4 6 9 2)) (list 2 8 3 4 6 9 5))\n (check-equal? (candidate (list 5 6 9 4 8 3 2)) (list 2 6 9 4 8 3 5))\n (check-equal? (candidate (list 5 6 3 4 8 9 2 1)) (list 2 6 3 4 8 9 5 1))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_53_add", - "language": "rkt", - "prompt": "#lang racket\n\n;; Add two numbers x and y\n;; >>> (add 2 3)\n;; 5\n;; >>> (add 5 7)\n;; 12\n(define (add x y)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate add))\n (check-equal? (candidate 0 1) 1)\n (check-equal? (candidate 1 0) 1)\n (check-equal? (candidate 2 3) 5)\n (check-equal? (candidate 5 7) 12)\n (check-equal? (candidate 7 5) 12)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_69_search", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n;; zero, and has a frequency greater than or equal to the value of the integer itself. \n;; The frequency of an integer is the number of times it appears in the list.\n;; If no such a value exist, return -1.\n;; Examples:\n;; >>> (search (list 4 1 2 2 3 1))\n;; 2\n;; >>> (search (list 1 2 2 3 3 3 4 4 4))\n;; 3\n;; >>> (search (list 5 5 4 4 4))\n;; -1\n(define (search lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate search))\n (check-equal? (candidate (list 5 5 5 5 1)) 1)\n (check-equal? (candidate (list 4 1 4 1 4 4)) 4)\n (check-equal? (candidate (list 3 3)) -1)\n (check-equal? (candidate (list 8 8 8 8 8 8 8 8)) 8)\n (check-equal? (candidate (list 2 3 3 2 2)) 2)\n (check-equal? (candidate (list 2 7 8 8 4 8 7 3 9 6 5 10 4 3 6 7 1 7 4 10 8 1)) 1)\n (check-equal? (candidate (list 3 2 8 2)) 2)\n (check-equal? (candidate (list 6 7 1 8 8 10 5 8 5 3 10)) 1)\n (check-equal? (candidate (list 8 8 3 6 5 6 4)) -1)\n (check-equal? (candidate (list 6 9 6 7 1 4 7 1 8 8 9 8 10 10 8 4 10 4 10 1 2 9 5 7 9)) 1)\n (check-equal? (candidate (list 1 9 10 1 3)) 1)\n (check-equal? (candidate (list 6 9 7 5 8 7 5 3 7 5 10 10 3 6 10 2 8 6 5 4 9 5 3 10)) 5)\n (check-equal? (candidate (list 1)) 1)\n (check-equal? (candidate (list 8 8 10 6 4 3 5 8 2 4 2 8 4 6 10 4 2 1 10 2 1 1 5)) 4)\n (check-equal? (candidate (list 2 10 4 8 2 10 5 1 2 9 5 5 6 3 8 6 4 10)) 2)\n (check-equal? (candidate (list 1 6 10 1 6 9 10 8 6 8 7 3)) 1)\n (check-equal? (candidate (list 9 2 4 1 5 1 5 2 5 7 7 7 3 10 1 5 4 2 8 4 1 9 10 7 10 2 8 10 9 4)) 4)\n (check-equal? (candidate (list 2 6 4 2 8 7 5 6 4 10 4 6 3 7 8 8 3 1 4 2 2 10 7)) 4)\n (check-equal? (candidate (list 9 8 6 10 2 6 10 2 7 8 10 3 8 2 6 2 3 1)) 2)\n (check-equal? (candidate (list 5 5 3 9 5 6 3 2 8 5 6 10 10 6 8 4 10 7 7 10 8)) -1)\n (check-equal? (candidate (list 10)) -1)\n (check-equal? (candidate (list 9 7 7 2 4 7 2 10 9 7 5 7 2)) 2)\n (check-equal? (candidate (list 5 4 10 2 1 1 10 3 6 1 8)) 1)\n (check-equal? (candidate (list 7 9 9 9 3 4 1 5 9 1 2 1 1 10 7 5 6 7 6 7 7 6)) 1)\n (check-equal? (candidate (list 3 10 10 9 2)) -1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that takes a string and returns True if the string\n;; length is a prime number or False otherwise\n;; Examples\n;; >>> (prime_length \"Hello\")\n;; #t\n;; >>> (prime_length \"abcdcba\")\n;; #t\n;; >>> (prime_length \"kittens\")\n;; #t\n;; >>> (prime_length \"orange\")\n;; #f\n(define (prime_length string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate prime_length))\n (check-equal? (candidate \"Hello\") #t)\n (check-equal? (candidate \"abcdcba\") #t)\n (check-equal? (candidate \"kittens\") #t)\n (check-equal? (candidate \"orange\") #f)\n (check-equal? (candidate \"wow\") #t)\n (check-equal? (candidate \"world\") #t)\n (check-equal? (candidate \"MadaM\") #t)\n (check-equal? (candidate \"Wow\") #t)\n (check-equal? (candidate \"\") #f)\n (check-equal? (candidate \"HI\") #t)\n (check-equal? (candidate \"go\") #t)\n (check-equal? (candidate \"gogo\") #f)\n (check-equal? (candidate \"aaaaaaaaaaaaaaa\") #f)\n (check-equal? (candidate \"Madam\") #t)\n (check-equal? (candidate \"M\") #f)\n (check-equal? (candidate \"0\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_58_common", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return sorted unique common elements for two lists.\n;; >>> (common (list 1 4 3 34 653 2 5) (list 5 7 1 5 9 653 121))\n;; (list 1 5 653)\n;; >>> (common (list 5 3 2 8) (list 3 2))\n;; (list 2 3)\n(define (common l1 l2)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate common))\n (check-equal? (candidate (list 1 4 3 34 653 2 5) (list 5 7 1 5 9 653 121)) (list 1 5 653))\n (check-equal? (candidate (list 5 3 2 8) (list 3 2)) (list 2 3))\n (check-equal? (candidate (list 4 3 2 8) (list 3 2 4)) (list 2 3 4))\n (check-equal? (candidate (list 4 3 2 8) (list )) (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "rkt", - "prompt": "#lang racket\n\n;; The Brazilian factorial is defined as:\n;; brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n;; where n > 0\n;; For example:\n;; >>> (special_factorial 4)\n;; 288\n;; The function will receive an integer as input and should return the special\n;; factorial of this integer.\n(define (special_factorial n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate special_factorial))\n (check-equal? (candidate 4) 288)\n (check-equal? (candidate 5) 34560)\n (check-equal? (candidate 7) 125411328000)\n (check-equal? (candidate 1) 1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "rkt", - "prompt": "#lang racket\n\n;; In this problem, you will implement a function that takes two lists of numbers,\n;; and determines whether it is possible to perform an exchange of elements\n;; between them to make lst1 a list of only even numbers.\n;; There is no limit on the number of exchanged elements between lst1 and lst2.\n;; If it is possible to exchange elements between the lst1 and lst2 to make\n;; all the elements of lst1 to be even, return \"YES\".\n;; Otherwise, return \"NO\".\n;; For example:\n;; >>> (exchange (list 1 2 3 4) (list 1 2 3 4))\n;; \"YES\"\n;; >>> (exchange (list 1 2 3 4) (list 1 5 3 4))\n;; \"NO\"\n;; It is assumed that the input lists will be non-empty.\n(define (exchange lst1 lst2)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate exchange))\n (check-equal? (candidate (list 1 2 3 4) (list 1 2 3 4)) \"YES\")\n (check-equal? (candidate (list 1 2 3 4) (list 1 5 3 4)) \"NO\")\n (check-equal? (candidate (list 1 2 3 4) (list 2 1 4 3)) \"YES\")\n (check-equal? (candidate (list 5 7 3) (list 2 6 4)) \"YES\")\n (check-equal? (candidate (list 5 7 3) (list 2 6 3)) \"NO\")\n (check-equal? (candidate (list 3 2 6 1 8 9) (list 3 5 5 1 1 1)) \"NO\")\n (check-equal? (candidate (list 100 200) (list 200 200)) \"YES\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a non-empty array of integers arr and an integer k, return\n;; the sum of the elements with at most two digits from the first k elements of arr.\n;; Example:\n;; >>> (add_elements (list 111 21 3 4000 5 6 7 8 9) 4)\n;; 24\n;; Constraints:\n;; 1. 1 <= len(arr) <= 100\n;; 2. 1 <= k <= len(arr)\n(define (add_elements arr k)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate add_elements))\n (check-equal? (candidate (list 1 -2 -3 41 57 76 87 88 99) 3) -4)\n (check-equal? (candidate (list 111 121 3 4000 5 6) 2) 0)\n (check-equal? (candidate (list 11 21 3 90 5 6 7 8 9) 4) 125)\n (check-equal? (candidate (list 111 21 3 4000 5 6 7 8 9) 4) 24)\n (check-equal? (candidate (list 1) 1) 1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "rkt", - "prompt": "#lang racket\n\n;; A simple program which should return the value of x if n is \n;; a prime number and should return the value of y otherwise.\n;; Examples:\n;; >>> (x_or_y 7 34 12)\n;; 34\n;; >>> (x_or_y 15 8 5)\n;; 5\n(define (x_or_y n x y)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate x_or_y))\n (check-equal? (candidate 7 34 12) 34)\n (check-equal? (candidate 15 8 5) 5)\n (check-equal? (candidate 3 33 5212) 33)\n (check-equal? (candidate 1259 3 52) 3)\n (check-equal? (candidate 7919 -1 12) -1)\n (check-equal? (candidate 3609 1245 583) 583)\n (check-equal? (candidate 91 56 129) 129)\n (check-equal? (candidate 6 34 1234) 1234)\n (check-equal? (candidate 1 2 0) 0)\n (check-equal? (candidate 2 2 0) 2)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given length of a side and high return area for a triangle.\n;; >>> (triangle_area 5 3)\n;; 7.5\n(define (triangle_area a h)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate triangle_area))\n (check-equal? (candidate 5 3) 7.5)\n (check-equal? (candidate 2 2) 2.0)\n (check-equal? (candidate 10 8) 40.0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "rkt", - "prompt": "#lang racket\n\n;; Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n;; the last couple centuries. However, what people don't know is Tribonacci sequence.\n;; Tribonacci sequence is defined by the recurrence:\n;; tri(1) = 3\n;; tri(n) = 1 + n / 2, if n is even.\n;; tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n;; For example:\n;; tri(2) = 1 + (2 / 2) = 2\n;; tri(4) = 3\n;; tri(3) = tri(2) + tri(1) + tri(4)\n;; = 2 + 3 + 3 = 8 \n;; You are given a non-negative integer number n, you have to a return a list of the \n;; first n + 1 numbers of the Tribonacci sequence.\n;; Examples:\n;; >>> (tri 3)\n;; (list 1 3 2 8)\n(define (tri n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate tri))\n (check-equal? (candidate 3) (list 1 3 2 8))\n (check-equal? (candidate 4) (list 1 3 2 8 3))\n (check-equal? (candidate 5) (list 1 3 2 8 3 15))\n (check-equal? (candidate 6) (list 1 3 2 8 3 15 4))\n (check-equal? (candidate 7) (list 1 3 2 8 3 15 4 24))\n (check-equal? (candidate 8) (list 1 3 2 8 3 15 4 24 5))\n (check-equal? (candidate 9) (list 1 3 2 8 3 15 4 24 5 35))\n (check-equal? (candidate 20) (list 1 3 2 8 3 15 4 24 5 35 6 48 7 63 8 80 9 99 10 120 11))\n (check-equal? (candidate 0) (list 1))\n (check-equal? (candidate 1) (list 1 3))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a list of two strings, both strings consist of open\n;; parentheses '(' or close parentheses ')' only.\n;; Your job is to check if it is possible to concatenate the two strings in\n;; some order, that the resulting string will be good.\n;; A string S is considered to be good if and only if all parentheses in S\n;; are balanced. For example: the string '(())()' is good, while the string\n;; '())' is not.\n;; Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n;; Examples:\n;; >>> (match_parens (list \"()(\" \")\"))\n;; \"Yes\"\n;; >>> (match_parens (list \")\" \")\"))\n;; \"No\"\n(define (match_parens lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate match_parens))\n (check-equal? (candidate (list \"()(\" \")\")) \"Yes\")\n (check-equal? (candidate (list \")\" \")\")) \"No\")\n (check-equal? (candidate (list \"(()(())\" \"())())\")) \"No\")\n (check-equal? (candidate (list \")())\" \"(()()(\")) \"Yes\")\n (check-equal? (candidate (list \"(())))\" \"(()())((\")) \"Yes\")\n (check-equal? (candidate (list \"()\" \"())\")) \"No\")\n (check-equal? (candidate (list \"(()(\" \"()))()\")) \"Yes\")\n (check-equal? (candidate (list \"((((\" \"((())\")) \"No\")\n (check-equal? (candidate (list \")(()\" \"(()(\")) \"No\")\n (check-equal? (candidate (list \")(\" \")(\")) \"No\")\n (check-equal? (candidate (list \"(\" \")\")) \"Yes\")\n (check-equal? (candidate (list \")\" \"(\")) \"Yes\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "rkt", - "prompt": "#lang racket\n\n;; From a list of integers, remove all elements that occur more than once.\n;; Keep order of elements left the same as in the input.\n;; >>> (remove_duplicates (list 1 2 3 2 4))\n;; (list 1 3 4)\n(define (remove_duplicates numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate remove_duplicates))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 1 2 3 4)) (list 1 2 3 4))\n (check-equal? (candidate (list 1 2 3 2 4 3 5)) (list 1 4 5))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return a greatest common divisor of two integers a and b\n;; >>> (greatest_common_divisor 3 5)\n;; 1\n;; >>> (greatest_common_divisor 25 15)\n;; 5\n(define (greatest_common_divisor a b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate greatest_common_divisor))\n (check-equal? (candidate 3 7) 1)\n (check-equal? (candidate 10 15) 5)\n (check-equal? (candidate 49 14) 7)\n (check-equal? (candidate 144 60) 12)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "rkt", - "prompt": "#lang racket\n\n;; Checks if given string is a palindrome\n;; >>> (is_palindrome \"\")\n;; #t\n;; >>> (is_palindrome \"aba\")\n;; #t\n;; >>> (is_palindrome \"aaaaa\")\n;; #t\n;; >>> (is_palindrome \"zbcd\")\n;; #f\n(define (is_palindrome text)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_palindrome))\n (check-equal? (candidate \"\") #t)\n (check-equal? (candidate \"aba\") #t)\n (check-equal? (candidate \"aaaaa\") #t)\n (check-equal? (candidate \"zbcd\") #f)\n (check-equal? (candidate \"xywyx\") #t)\n (check-equal? (candidate \"xywyz\") #f)\n (check-equal? (candidate \"xywzx\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "rkt", - "prompt": "#lang racket\n\n;; xs represent coefficients of a polynomial.\n;; xs[0] + xs[1] * x + xs[2] * x^2 + ....\n;; Return derivative of this polynomial in the same form.\n;; >>> (derivative (list 3 1 2 4 5))\n;; (list 1 4 12 20)\n;; >>> (derivative (list 1 2 3))\n;; (list 2 6)\n(define (derivative xs)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate derivative))\n (check-equal? (candidate (list 3 1 2 4 5)) (list 1 4 12 20))\n (check-equal? (candidate (list 1 2 3)) (list 2 6))\n (check-equal? (candidate (list 3 2 1)) (list 2 2))\n (check-equal? (candidate (list 3 2 1 0 4)) (list 2 2 0 16))\n (check-equal? (candidate (list 1)) (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "rkt", - "prompt": "#lang racket\n\n;; In this task, you will be given a string that represents a number of apples and oranges \n;; that are distributed in a basket of fruit this basket contains \n;; apples, oranges, and mango fruits. Given the string that represents the total number of \n;; the oranges and apples and an integer that represent the total number of the fruits \n;; in the basket return the number of the mango fruits in the basket.\n;; for examble:\n;; >>> (fruit_distribution \"5 apples and 6 oranges\" 19)\n;; 8\n;; >>> (fruit_distribution \"0 apples and 1 oranges\" 3)\n;; 2\n;; >>> (fruit_distribution \"2 apples and 3 oranges\" 100)\n;; 95\n;; >>> (fruit_distribution \"100 apples and 1 oranges\" 120)\n;; 19\n(define (fruit_distribution s n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate fruit_distribution))\n (check-equal? (candidate \"5 apples and 6 oranges\" 19) 8)\n (check-equal? (candidate \"5 apples and 6 oranges\" 21) 10)\n (check-equal? (candidate \"0 apples and 1 oranges\" 3) 2)\n (check-equal? (candidate \"1 apples and 0 oranges\" 3) 2)\n (check-equal? (candidate \"2 apples and 3 oranges\" 100) 95)\n (check-equal? (candidate \"2 apples and 3 oranges\" 5) 0)\n (check-equal? (candidate \"1 apples and 100 oranges\" 120) 19)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that takes an integer a and returns True \n;; if this ingeger is a cube of some integer number.\n;; Note: you may assume the input is always valid.\n;; Examples:\n;; >>> (iscube 1)\n;; #t\n;; >>> (iscube 2)\n;; #f\n;; >>> (iscube -1)\n;; #t\n;; >>> (iscube 64)\n;; #t\n;; >>> (iscube 0)\n;; #t\n;; >>> (iscube 180)\n;; #f\n(define (iscube a)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate iscube))\n (check-equal? (candidate 1) #t)\n (check-equal? (candidate 2) #f)\n (check-equal? (candidate -1) #t)\n (check-equal? (candidate 64) #t)\n (check-equal? (candidate 180) #f)\n (check-equal? (candidate 1000) #t)\n (check-equal? (candidate 0) #t)\n (check-equal? (candidate 1729) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "rkt", - "prompt": "#lang racket\n\n;; In this Kata, you have to sort an array of non-negative integers according to\n;; number of ones in their binary representation in ascending order.\n;; For similar number of ones, sort based on decimal value.\n;; It must be implemented like this:\n;; >>> (sort_array (list 1 5 2 3 4))\n;; (list 1 2 3 4 5)\n;; >>> (sort_array (list -2 -3 -4 -5 -6))\n;; (list -6 -5 -4 -3 -2)\n;; >>> (sort_array (list 1 0 2 3 4))\n;; (list 0 1 2 3 4)\n(define (sort_array arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sort_array))\n (check-equal? (candidate (list 1 5 2 3 4)) (list 1 2 4 3 5))\n (check-equal? (candidate (list -2 -3 -4 -5 -6)) (list -4 -2 -6 -5 -3))\n (check-equal? (candidate (list 1 0 2 3 4)) (list 0 1 2 4 3))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 2 5 77 4 5 3 5 7 2 3 4)) (list 2 2 4 4 3 3 5 5 5 7 77))\n (check-equal? (candidate (list 3 6 44 12 32 5)) (list 32 3 5 6 12 44))\n (check-equal? (candidate (list 2 4 8 16 32)) (list 2 4 8 16 32))\n (check-equal? (candidate (list 2 4 8 16 32)) (list 2 4 8 16 32))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a list of strings, where each string consists of only digits, return a list.\n;; Each element i of the output should be \"the number of odd elements in the\n;; string i of the input.\" where all the i's should be replaced by the number\n;; of odd digits in the i'th string of the input.\n;; >>> (odd_count (list \"1234567\"))\n;; (list \"the number of odd elements 4n the str4ng 4 of the 4nput.\")\n;; >>> (odd_count (list \"3\" \"11111111\"))\n;; (list \"the number of odd elements 1n the str1ng 1 of the 1nput.\" \"the number of odd elements 8n the str8ng 8 of the 8nput.\")\n(define (odd_count lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate odd_count))\n (check-equal? (candidate (list \"1234567\")) (list \"the number of odd elements 4n the str4ng 4 of the 4nput.\"))\n (check-equal? (candidate (list \"3\" \"11111111\")) (list \"the number of odd elements 1n the str1ng 1 of the 1nput.\" \"the number of odd elements 8n the str8ng 8 of the 8nput.\"))\n (check-equal? (candidate (list \"271\" \"137\" \"314\")) (list \"the number of odd elements 2n the str2ng 2 of the 2nput.\" \"the number of odd elements 3n the str3ng 3 of the 3nput.\" \"the number of odd elements 2n the str2ng 2 of the 2nput.\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "rkt", - "prompt": "#lang racket\n\n;; brackets is a string of \"(\" and \")\".\n;; return True if every opening bracket has a corresponding closing bracket.\n;; >>> (correct_bracketing \"(\")\n;; #f\n;; >>> (correct_bracketing \"()\")\n;; #t\n;; >>> (correct_bracketing \"(()())\")\n;; #t\n;; >>> (correct_bracketing \")(()\")\n;; #f\n(define (correct_bracketing brackets)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate correct_bracketing))\n (check-equal? (candidate \"()\") #t)\n (check-equal? (candidate \"(()())\") #t)\n (check-equal? (candidate \"()()(()())()\") #t)\n (check-equal? (candidate \"()()((()()())())(()()(()))\") #t)\n (check-equal? (candidate \"((()())))\") #f)\n (check-equal? (candidate \")(()\") #f)\n (check-equal? (candidate \"(\") #f)\n (check-equal? (candidate \"((((\") #f)\n (check-equal? (candidate \")\") #f)\n (check-equal? (candidate \"(()\") #f)\n (check-equal? (candidate \"()()(()())())(()\") #f)\n (check-equal? (candidate \"()()(()())()))()\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "rkt", - "prompt": "#lang racket\n\n;; Task\n;; Write a function that takes a string as input and returns the sum of the upper characters only'\n;; ASCII codes.\n;; Examples:\n;; >>> (digitSum \"\")\n;; 0\n;; >>> (digitSum \"abAB\")\n;; 131\n;; >>> (digitSum \"abcCd\")\n;; 67\n;; >>> (digitSum \"helloE\")\n;; 69\n;; >>> (digitSum \"woArBld\")\n;; 131\n;; >>> (digitSum \"aAaaaXa\")\n;; 153\n(define (digitSum s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate digitSum))\n (check-equal? (candidate \"\") 0)\n (check-equal? (candidate \"abAB\") 131)\n (check-equal? (candidate \"abcCd\") 67)\n (check-equal? (candidate \"helloE\") 69)\n (check-equal? (candidate \"woArBld\") 131)\n (check-equal? (candidate \"aAaaaXa\") 153)\n (check-equal? (candidate \" How are yOu?\") 151)\n (check-equal? (candidate \"You arE Very Smart\") 327)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that accepts a list of strings as a parameter,\n;; deletes the strings that have odd lengths from it,\n;; and returns the resulted list with a sorted order,\n;; The list is always a list of strings and never an array of numbers,\n;; and it may contain duplicates.\n;; The order of the list should be ascending by length of each word, and you\n;; should return the list sorted by that rule.\n;; If two words have the same length, sort the list alphabetically.\n;; The function should return a list of strings in sorted order.\n;; You may assume that all words will have the same length.\n;; For example:\n;; >>> (list_sort (list \"aa\" \"a\" \"aaa\"))\n;; (list \"aa\")\n;; >>> (list_sort (list \"ab\" \"a\" \"aaa\" \"cd\"))\n;; (list \"ab\" \"cd\")\n(define (sorted_list_sum lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sorted_list_sum))\n (check-equal? (candidate (list \"aa\" \"a\" \"aaa\")) (list \"aa\"))\n (check-equal? (candidate (list \"school\" \"AI\" \"asdf\" \"b\")) (list \"AI\" \"asdf\" \"school\"))\n (check-equal? (candidate (list \"d\" \"b\" \"c\" \"a\")) (list ))\n (check-equal? (candidate (list \"d\" \"dcba\" \"abcd\" \"a\")) (list \"abcd\" \"dcba\"))\n (check-equal? (candidate (list \"AI\" \"ai\" \"au\")) (list \"AI\" \"ai\" \"au\"))\n (check-equal? (candidate (list \"a\" \"b\" \"b\" \"c\" \"c\" \"a\")) (list ))\n (check-equal? (candidate (list \"aaaa\" \"bbbb\" \"dd\" \"cc\")) (list \"cc\" \"dd\" \"aaaa\" \"bbbb\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given an array arr of integers and you need to return\n;; sum of magnitudes of integers multiplied by product of all signs\n;; of each number in the array, represented by 1, -1 or 0.\n;; Note: return None for empty arr.\n;; Example:\n;; >>> (prod_signs (list 1 2 2 -4))\n;; 9\n;; >>> (prod_signs (list 0 1))\n;; 0\n;; >>> (prod_signs (list ))\n;; #f\n(define (prod_signs arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate prod_signs))\n (check-equal? (candidate (list 1 2 2 -4)) -9)\n (check-equal? (candidate (list 0 1)) 0)\n (check-equal? (candidate (list 1 1 1 2 3 -1 1)) -10)\n (check-equal? (candidate (list )) #f)\n (check-equal? (candidate (list 2 4 1 2 -1 -1 9)) 20)\n (check-equal? (candidate (list -1 1 -1 1)) 4)\n (check-equal? (candidate (list -1 1 1 1)) -4)\n (check-equal? (candidate (list -1 1 1 0)) 0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return list with elements incremented by 1.\n;; >>> (incr_list (list 1 2 3))\n;; (list 2 3 4)\n;; >>> (incr_list (list 5 3 5 2 3 3 9 0 123))\n;; (list 6 4 6 3 4 4 10 1 124)\n(define (incr_list l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate incr_list))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 3 2 1)) (list 4 3 2))\n (check-equal? (candidate (list 5 2 5 2 3 3 9 0 123)) (list 6 3 6 3 4 4 10 1 124))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "rkt", - "prompt": "#lang racket\n\n;; From a given list of integers, generate a list of rolling maximum element found until given moment\n;; in the sequence.\n;; >>> (rolling_max (list 1 2 3 2 3 4 2))\n;; (list 1 2 3 3 3 4 4)\n(define (rolling_max numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate rolling_max))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 1 2 3 4)) (list 1 2 3 4))\n (check-equal? (candidate (list 4 3 2 1)) (list 4 4 4 4))\n (check-equal? (candidate (list 3 2 3 100 3)) (list 3 3 3 100 100))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "rkt", - "prompt": "#lang racket\n\n;; Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n;; separate those group into separate strings and return the list of those.\n;; Separate groups are balanced (each open brace is properly closed) and not nested within each other\n;; Ignore any spaces in the input string.\n;; >>> (separate_paren_groups \"( ) (( )) (( )( ))\")\n;; (list \"()\" \"(())\" \"(()())\")\n(define (separate_paren_groups paren_string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate separate_paren_groups))\n (check-equal? (candidate \"(()()) ((())) () ((())()())\") (list \"(()())\" \"((()))\" \"()\" \"((())()())\"))\n (check-equal? (candidate \"() (()) ((())) (((())))\") (list \"()\" \"(())\" \"((()))\" \"(((())))\"))\n (check-equal? (candidate \"(()(())((())))\") (list \"(()(())((())))\"))\n (check-equal? (candidate \"( ) (( )) (( )( ))\") (list \"()\" \"(())\" \"(()())\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "rkt", - "prompt": "#lang racket\n\n;; You will be given a string of words separated by commas or spaces. Your task is\n;; to split the string into words and return an array of the words.\n;; For example:\n;; >>> (words_string \"Hi, my name is John\")\n;; (list \"Hi\" \"my\" \"name\" \"is\" \"John\")\n;; >>> (words_string \"One, two, three, four, five, six\")\n;; (list \"One\" \"two\" \"three\" \"four\" \"five\" \"six\")\n(define (words_string s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate words_string))\n (check-equal? (candidate \"Hi, my name is John\") (list \"Hi\" \"my\" \"name\" \"is\" \"John\"))\n (check-equal? (candidate \"One, two, three, four, five, six\") (list \"One\" \"two\" \"three\" \"four\" \"five\" \"six\"))\n (check-equal? (candidate \"Hi, my name\") (list \"Hi\" \"my\" \"name\"))\n (check-equal? (candidate \"One,, two, three, four, five, six,\") (list \"One\" \"two\" \"three\" \"four\" \"five\" \"six\"))\n (check-equal? (candidate \"\") (list ))\n (check-equal? (candidate \"ahmed , gamal\") (list \"ahmed\" \"gamal\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function that takes integers, floats, or strings representing\n;; real numbers, and returns the larger variable in its given variable type.\n;; Return None if the values are equal.\n;; Note: If a real number is represented as a string, the floating point might be . or ,\n;; >>> (compare_one 1 2.5)\n;; 2.5\n;; >>> (compare_one 1 \"2,3\")\n;; \"2,3\"\n;; >>> (compare_one \"5,1\" \"6\")\n;; \"6\"\n;; >>> (compare_one \"1\" 1)\n;; #f\n(define (compare_one a b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate compare_one))\n (check-equal? (candidate 1 2) 2)\n (check-equal? (candidate 1 2.5) 2.5)\n (check-equal? (candidate 2 3) 3)\n (check-equal? (candidate 5 6) 6)\n (check-equal? (candidate 1 \"2,3\") \"2,3\")\n (check-equal? (candidate \"5,1\" \"6\") \"6\")\n (check-equal? (candidate \"1\" \"2\") \"2\")\n (check-equal? (candidate \"1\" 1) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "rkt", - "prompt": "#lang racket\n\n;; Filter given list of any python values only for integers\n;; >>> (filter_integers (list \"a\" 3.14 5))\n;; (list 5)\n;; >>> (filter_integers (list 1 2 3 \"abc\" #hash() (list )))\n;; (list 1 2 3)\n(define (filter_integers values)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate filter_integers))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 4 #hash() (list ) 23.2 9 \"adasd\")) (list 4 9))\n (check-equal? (candidate (list 3 \"c\" 3 3 \"a\" \"b\")) (list 3 3 3))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "rkt", - "prompt": "#lang racket\n\n;; This function takes a list l and returns a list l' such that\n;; l' is identical to l in the odd indicies, while its values at the even indicies are equal\n;; to the values of the even indicies of l, but sorted.\n;; >>> (sort_even (list 1 2 3))\n;; (list 1 2 3)\n;; >>> (sort_even (list 5 6 3 4))\n;; (list 3 6 5 4)\n(define (sort_even l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sort_even))\n (check-equal? (candidate (list 1 2 3)) (list 1 2 3))\n (check-equal? (candidate (list 5 3 -5 2 -3 3 9 0 123 1 -10)) (list -10 3 -5 2 -3 3 5 0 9 1 123))\n (check-equal? (candidate (list 5 8 -12 4 23 2 3 11 12 -10)) (list -12 8 3 4 5 2 12 11 23 -10))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "rkt", - "prompt": "#lang racket\n\n;; I think we all remember that feeling when the result of some long-awaited\n;; event is finally known. The feelings and thoughts you have at that moment are\n;; definitely worth noting down and comparing.\n;; Your task is to determine if a person correctly guessed the results of a number of matches.\n;; You are given two arrays of scores and guesses of equal length, where each index shows a match. \n;; Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n;; the value is 0, and if not, the value is the absolute difference between the guess and the score.\n;; example:\n;; >>> (compare (list 1 2 3 4 5 1) (list 1 2 3 4 2 -2))\n;; (list 0 0 0 0 3 3)\n;; >>> (compare (list 0 5 0 0 0 4) (list 4 1 1 0 0 -2))\n;; (list 4 4 1 0 0 6)\n(define (compare game guess)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate compare))\n (check-equal? (candidate (list 1 2 3 4 5 1) (list 1 2 3 4 2 -2)) (list 0 0 0 0 3 3))\n (check-equal? (candidate (list 0 0 0 0 0 0) (list 0 0 0 0 0 0)) (list 0 0 0 0 0 0))\n (check-equal? (candidate (list 1 2 3) (list -1 -2 -3)) (list 2 4 6))\n (check-equal? (candidate (list 1 2 3 5) (list -1 2 3 4)) (list 2 0 0 1))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a positive integer n, return a tuple that has the number of even and odd\n;; integer palindromes that fall within the range(1, n), inclusive.\n;; Example 1:\n;; >>> (even_odd_palindrome 3)\n;; (list 1 2)\n;; Explanation:\n;; Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n;; Example 2:\n;; >>> (even_odd_palindrome 12)\n;; (list 4 6)\n;; Explanation:\n;; Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n;; Note:\n;; 1. 1 <= n <= 10^3\n;; 2. returned tuple has the number of even and odd integer palindromes respectively.\n(define (even_odd_palindrome n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate even_odd_palindrome))\n (check-equal? (candidate 123) (list 8 13))\n (check-equal? (candidate 12) (list 4 6))\n (check-equal? (candidate 3) (list 1 2))\n (check-equal? (candidate 63) (list 6 8))\n (check-equal? (candidate 25) (list 5 6))\n (check-equal? (candidate 19) (list 4 6))\n (check-equal? (candidate 9) (list 4 5))\n (check-equal? (candidate 1) (list 0 1))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "rkt", - "prompt": "#lang racket\n\n;; The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n;; fib4(0) -> 0\n;; fib4(1) -> 0\n;; fib4(2) -> 2\n;; fib4(3) -> 0\n;; fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n;; Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n;; >>> (fib4 5)\n;; 4\n;; >>> (fib4 6)\n;; 8\n;; >>> (fib4 7)\n;; 14\n(define (fib4 n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate fib4))\n (check-equal? (candidate 5) 4)\n (check-equal? (candidate 8) 28)\n (check-equal? (candidate 10) 104)\n (check-equal? (candidate 12) 386)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given two positive integers a and b, return the even digits between a\n;; and b, in ascending order.\n;; For example:\n;; >>> (generate_integers 2 8)\n;; (list 2 4 6 8)\n;; >>> (generate_integers 8 2)\n;; (list 2 4 6 8)\n;; >>> (generate_integers 10 14)\n;; (list )\n(define (generate_integers a b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate generate_integers))\n (check-equal? (candidate 2 10) (list 2 4 6 8))\n (check-equal? (candidate 10 2) (list 2 4 6 8))\n (check-equal? (candidate 132 2) (list 2 4 6 8))\n (check-equal? (candidate 17 89) (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "rkt", - "prompt": "#lang racket\n\n;; For a given list of input numbers, calculate Mean Absolute Deviation\n;; around the mean of this dataset.\n;; Mean Absolute Deviation is the average absolute difference between each\n;; element and a centerpoint (mean in this case):\n;; MAD = average | x - x_mean |\n;; >>> (mean_absolute_deviation (list 1.0 2.0 3.0 4.0))\n;; 1.0\n(define (mean_absolute_deviation numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate mean_absolute_deviation))\n (check-equal? (candidate (list 1.0 2.0)) 0.5)\n (check-equal? (candidate (list 1.0 2.0 3.0 4.0)) 1.0)\n (check-equal? (candidate (list 1.0 2.0 3.0 4.0 5.0)) 1.2)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function encrypt that takes a string as an argument and\n;; returns a string encrypted with the alphabet being rotated. \n;; The alphabet should be rotated in a manner such that the letters \n;; shift down by two multiplied to two places.\n;; For example:\n;; >>> (encrypt \"hi\")\n;; \"lm\"\n;; >>> (encrypt \"asdfghjkl\")\n;; \"ewhjklnop\"\n;; >>> (encrypt \"gf\")\n;; \"kj\"\n;; >>> (encrypt \"et\")\n;; \"ix\"\n(define (encrypt s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate encrypt))\n (check-equal? (candidate \"hi\") \"lm\")\n (check-equal? (candidate \"asdfghjkl\") \"ewhjklnop\")\n (check-equal? (candidate \"gf\") \"kj\")\n (check-equal? (candidate \"et\") \"ix\")\n (check-equal? (candidate \"faewfawefaewg\") \"jeiajeaijeiak\")\n (check-equal? (candidate \"hellomyfriend\") \"lippsqcjvmirh\")\n (check-equal? (candidate \"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\") \"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\")\n (check-equal? (candidate \"a\") \"e\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n;; The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n;; as follows: start with any positive integer n. Then each term is obtained from the \n;; previous term as follows: if the previous term is even, the next term is one half of \n;; the previous term. If the previous term is odd, the next term is 3 times the previous\n;; term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n;; Note: \n;; 1. Collatz(1) is [1].\n;; 2. returned list sorted in increasing order.\n;; For example:\n;; get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n;; >>> (get_odd_collatz 5)\n;; (list 1 5)\n(define (get_odd_collatz n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate get_odd_collatz))\n (check-equal? (candidate 14) (list 1 5 7 11 13 17))\n (check-equal? (candidate 5) (list 1 5))\n (check-equal? (candidate 12) (list 1 3 5))\n (check-equal? (candidate 1) (list 1))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "rkt", - "prompt": "#lang racket\n\n;; Find how many times a given substring can be found in the original string. Count overlaping cases.\n;; >>> (how_many_times \"\" \"a\")\n;; 0\n;; >>> (how_many_times \"aaa\" \"a\")\n;; 3\n;; >>> (how_many_times \"aaaa\" \"aa\")\n;; 3\n(define (how_many_times string substring)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate how_many_times))\n (check-equal? (candidate \"\" \"x\") 0)\n (check-equal? (candidate \"xyxyxyx\" \"x\") 4)\n (check-equal? (candidate \"cacacacac\" \"cac\") 4)\n (check-equal? (candidate \"john doe\" \"john\") 1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "rkt", - "prompt": "#lang racket\n\n;; We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n;; numbers in the array will be randomly ordered. Your task is to determine if\n;; it is possible to get an array sorted in non-decreasing order by performing \n;; the following operation on the given array:\n;; You are allowed to perform right shift operation any number of times.\n;; One right shift operation means shifting all elements of the array by one\n;; position in the right direction. The last element of the array will be moved to\n;; the starting position in the array i.e. 0th index. \n;; If it is possible to obtain the sorted array by performing the above operation\n;; then return True else return False.\n;; If the given array is empty then return True.\n;; Note: The given list is guaranteed to have unique elements.\n;; For Example:\n;; >>> (move_one_ball (list 3 4 5 1 2))\n;; #t\n;; Explanation: By performin 2 right shift operations, non-decreasing order can\n;; be achieved for the given array.\n;; >>> (move_one_ball (list 3 5 4 1 2))\n;; #f\n;; Explanation:It is not possible to get non-decreasing order for the given\n;; array by performing any number of right shift operations.\n(define (move_one_ball arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate move_one_ball))\n (check-equal? (candidate (list 3 4 5 1 2)) #t)\n (check-equal? (candidate (list 3 5 10 1 2)) #t)\n (check-equal? (candidate (list 4 3 1 2)) #f)\n (check-equal? (candidate (list 3 5 4 1 2)) #f)\n (check-equal? (candidate (list )) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function which sorts the given list of integers\n;; in ascending order according to the sum of their digits.\n;; Note: if there are several items with similar sum of their digits,\n;; order them based on their index in original list.\n;; For example:\n;; >>> (order_by_points (list 1 11 -1 -11 -12))\n;; (list -1 -11 1 -12 11)\n;; >>> (order_by_points (list ))\n;; (list )\n(define (order_by_points nums)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate order_by_points))\n (check-equal? (candidate (list 1 11 -1 -11 -12)) (list -1 -11 1 -12 11))\n (check-equal? (candidate (list 1234 423 463 145 2 423 423 53 6 37 3457 3 56 0 46)) (list 0 2 3 6 53 423 423 423 1234 145 37 46 56 463 3457))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 1 -11 -32 43 54 -98 2 -3)) (list -3 -32 -98 -11 1 2 43 54))\n (check-equal? (candidate (list 1 2 3 4 5 6 7 8 9 10 11)) (list 1 10 2 11 3 4 5 6 7 8 9))\n (check-equal? (candidate (list 0 6 6 -76 -21 23 4)) (list -76 -21 0 4 23 6 6))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return list of prime factors of given integer in the order from smallest to largest.\n;; Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n;; Input number should be equal to the product of all factors\n;; >>> (factorize 8)\n;; (list 2 2 2)\n;; >>> (factorize 25)\n;; (list 5 5)\n;; >>> (factorize 70)\n;; (list 2 5 7)\n(define (factorize n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate factorize))\n (check-equal? (candidate 2) (list 2))\n (check-equal? (candidate 4) (list 2 2))\n (check-equal? (candidate 8) (list 2 2 2))\n (check-equal? (candidate 57) (list 3 19))\n (check-equal? (candidate 3249) (list 3 3 19 19))\n (check-equal? (candidate 185193) (list 3 3 3 19 19 19))\n (check-equal? (candidate 20577) (list 3 19 19 19))\n (check-equal? (candidate 18) (list 2 3 3))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return True if all numbers in the list l are below threshold t.\n;; >>> (below_threshold (list 1 2 4 10) 100)\n;; #t\n;; >>> (below_threshold (list 1 20 4 10) 5)\n;; #f\n(define (below_threshold l t)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate below_threshold))\n (check-equal? (candidate (list 1 2 4 10) 100) #t)\n (check-equal? (candidate (list 1 20 4 10) 5) #f)\n (check-equal? (candidate (list 1 20 4 10) 21) #t)\n (check-equal? (candidate (list 1 20 4 10) 22) #t)\n (check-equal? (candidate (list 1 8 4 10) 11) #t)\n (check-equal? (candidate (list 1 8 4 10) 10) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given two positive integers n and m, and your task is to compute the\n;; average of the integers from n through m (including n and m). \n;; Round the answer to the nearest integer and convert that to binary.\n;; If n is greater than m, return -1.\n;; Example:\n;; >>> (rounded_avg 1 5)\n;; \"0b11\"\n;; >>> (rounded_avg 7 5)\n;; -1\n;; >>> (rounded_avg 10 20)\n;; \"0b1111\"\n;; >>> (rounded_avg 20 33)\n;; \"0b11010\"\n(define (rounded_avg n m)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate rounded_avg))\n (check-equal? (candidate 1 5) \"0b11\")\n (check-equal? (candidate 7 13) \"0b1010\")\n (check-equal? (candidate 964 977) \"0b1111001010\")\n (check-equal? (candidate 996 997) \"0b1111100100\")\n (check-equal? (candidate 560 851) \"0b1011000010\")\n (check-equal? (candidate 185 546) \"0b101101110\")\n (check-equal? (candidate 362 496) \"0b110101101\")\n (check-equal? (candidate 350 902) \"0b1001110010\")\n (check-equal? (candidate 197 233) \"0b11010111\")\n (check-equal? (candidate 7 5) -1)\n (check-equal? (candidate 5 1) -1)\n (check-equal? (candidate 5 5) \"0b101\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "rkt", - "prompt": "#lang racket\n\n;; Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n;; For each of the group, output the deepest level of nesting of parentheses.\n;; E.g. (()()) has maximum two levels of nesting while ((())) has three.\n;; >>> (parse_nested_parens \"(()()) ((())) () ((())()())\")\n;; (list 2 3 1 3)\n(define (parse_nested_parens paren_string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate parse_nested_parens))\n (check-equal? (candidate \"(()()) ((())) () ((())()())\") (list 2 3 1 3))\n (check-equal? (candidate \"() (()) ((())) (((())))\") (list 1 2 3 4))\n (check-equal? (candidate \"(()(())((())))\") (list 4))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n;; Examples\n;; >>> (solution (list 5 8 7 1))\n;; 12\n;; >>> (solution (list 3 3 3 3 3))\n;; 9\n;; >>> (solution (list 30 13 24 321))\n;; 0\n(define (solution lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate solution))\n (check-equal? (candidate (list 5 8 7 1)) 12)\n (check-equal? (candidate (list 3 3 3 3 3)) 9)\n (check-equal? (candidate (list 30 13 24 321)) 0)\n (check-equal? (candidate (list 5 9)) 5)\n (check-equal? (candidate (list 2 4 8)) 0)\n (check-equal? (candidate (list 30 13 23 32)) 23)\n (check-equal? (candidate (list 3 13 2 9)) 3)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a positive integer n. You have to create an integer array a of length n.\n;; For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n;; Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n;; and a[i] + a[j] + a[k] is a multiple of 3.\n;; Example :\n;; >>> (get_max_triples 5)\n;; 1\n;; Explanation: \n;; a = [1, 3, 7, 13, 21]\n;; The only valid triple is (1, 7, 13).\n(define (get_max_triples n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate get_max_triples))\n (check-equal? (candidate 5) 1)\n (check-equal? (candidate 6) 4)\n (check-equal? (candidate 10) 36)\n (check-equal? (candidate 100) 53361)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "rkt", - "prompt": "#lang racket\n\n;; There are eight planets in our solar system: the closerst to the Sun \n;; is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n;; Uranus, Neptune.\n;; Write a function that takes two planet names as strings planet1 and planet2. \n;; The function should return a tuple containing all planets whose orbits are \n;; located between the orbit of planet1 and the orbit of planet2, sorted by \n;; the proximity to the sun. \n;; The function should return an empty tuple if planet1 or planet2\n;; are not correct planet names. \n;; Examples\n;; >>> (bf \"Jupiter\" \"Neptune\")\n;; (list \"Saturn\" \"Uranus\")\n;; >>> (bf \"Earth\" \"Mercury\")\n;; \"Venus\"\n;; >>> (bf \"Mercury\" \"Uranus\")\n;; (list \"Venus\" \"Earth\" \"Mars\" \"Jupiter\" \"Saturn\")\n(define (bf planet1 planet2)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate bf))\n (check-equal? (candidate \"Jupiter\" \"Neptune\") (list \"Saturn\" \"Uranus\"))\n (check-equal? (candidate \"Earth\" \"Mercury\") (list \"Venus\"))\n (check-equal? (candidate \"Mercury\" \"Uranus\") (list \"Venus\" \"Earth\" \"Mars\" \"Jupiter\" \"Saturn\"))\n (check-equal? (candidate \"Neptune\" \"Venus\") (list \"Earth\" \"Mars\" \"Jupiter\" \"Saturn\" \"Uranus\"))\n (check-equal? (candidate \"Earth\" \"Earth\") (list ))\n (check-equal? (candidate \"Mars\" \"Earth\") (list ))\n (check-equal? (candidate \"Jupiter\" \"Makemake\") (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a list of integers.\n;; Write a function next_smallest() that returns the 2nd smallest element of the list.\n;; Return None if there is no such element.\n;; >>> (next_smallest (list 1 2 3 4 5))\n;; 2\n;; >>> (next_smallest (list 5 1 4 3 2))\n;; 2\n;; >>> (next_smallest (list ))\n;; #f\n;; >>> (next_smallest (list 1 1))\n;; #f\n(define (next_smallest lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate next_smallest))\n (check-equal? (candidate (list 1 2 3 4 5)) 2)\n (check-equal? (candidate (list 5 1 4 3 2)) 2)\n (check-equal? (candidate (list )) #f)\n (check-equal? (candidate (list 1 1)) #f)\n (check-equal? (candidate (list 1 1 1 1 0)) 1)\n (check-equal? (candidate (list 1 1)) #f)\n (check-equal? (candidate (list -35 34 12 -45)) -35)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "rkt", - "prompt": "#lang racket\n\n;; Input is a space-delimited string of numberals from 'zero' to 'nine'.\n;; Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n;; Return the string with numbers sorted from smallest to largest\n;; >>> (sort_numbers \"three one five\")\n;; \"one three five\"\n(define (sort_numbers numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sort_numbers))\n (check-equal? (candidate \"\") \"\")\n (check-equal? (candidate \"three\") \"three\")\n (check-equal? (candidate \"three five nine\") \"three five nine\")\n (check-equal? (candidate \"five zero four seven nine eight\") \"zero four five seven eight nine\")\n (check-equal? (candidate \"six five four three two one zero\") \"zero one two three four five six\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n;; >>> (cycpattern_check \"abcd\" \"abd\")\n;; #f\n;; >>> (cycpattern_check \"hello\" \"ell\")\n;; #t\n;; >>> (cycpattern_check \"whassup\" \"psus\")\n;; #f\n;; >>> (cycpattern_check \"abab\" \"baa\")\n;; #t\n;; >>> (cycpattern_check \"efef\" \"eeff\")\n;; #f\n;; >>> (cycpattern_check \"himenss\" \"simen\")\n;; #t\n(define (cycpattern_check a b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate cycpattern_check))\n (check-equal? (candidate \"xyzw\" \"xyw\") #f)\n (check-equal? (candidate \"yello\" \"ell\") #t)\n (check-equal? (candidate \"whattup\" \"ptut\") #f)\n (check-equal? (candidate \"efef\" \"fee\") #t)\n (check-equal? (candidate \"abab\" \"aabb\") #f)\n (check-equal? (candidate \"winemtt\" \"tinem\") #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "rkt", - "prompt": "#lang racket\n\n;; You will be given a number in decimal form and your task is to convert it to\n;; binary format. The function should return a string, with each character representing a binary\n;; number. Each character in the string will be '0' or '1'.\n;; There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n;; The extra characters are there to help with the format.\n;; Examples:\n;; >>> (decimal_to_binary 15)\n;; \"db1111db\"\n;; >>> (decimal_to_binary 32)\n;; \"db100000db\"\n(define (decimal_to_binary decimal)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate decimal_to_binary))\n (check-equal? (candidate 0) \"db0db\")\n (check-equal? (candidate 32) \"db100000db\")\n (check-equal? (candidate 103) \"db1100111db\")\n (check-equal? (candidate 15) \"db1111db\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "rkt", - "prompt": "#lang racket\n\n;; Filter an input list of strings only for ones that contain given substring\n;; >>> (filter_by_substring (list ) \"a\")\n;; (list )\n;; >>> (filter_by_substring (list \"abc\" \"bacd\" \"cde\" \"array\") \"a\")\n;; (list \"abc\" \"bacd\" \"array\")\n(define (filter_by_substring strings substring)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate filter_by_substring))\n (check-equal? (candidate (list ) \"john\") (list ))\n (check-equal? (candidate (list \"xxx\" \"asd\" \"xxy\" \"john doe\" \"xxxAAA\" \"xxx\") \"xxx\") (list \"xxx\" \"xxxAAA\" \"xxx\"))\n (check-equal? (candidate (list \"xxx\" \"asd\" \"aaaxxy\" \"john doe\" \"xxxAAA\" \"xxx\") \"xx\") (list \"xxx\" \"aaaxxy\" \"xxxAAA\" \"xxx\"))\n (check-equal? (candidate (list \"grunt\" \"trumpet\" \"prune\" \"gruesome\") \"run\") (list \"grunt\" \"prune\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given an integer. return a tuple that has the number of even and odd digits respectively.\n;; Example:\n;; >>> (even_odd_count -12)\n;; (list 1 1)\n;; >>> (even_odd_count 123)\n;; (list 1 2)\n(define (even_odd_count num)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate even_odd_count))\n (check-equal? (candidate 7) (list 0 1))\n (check-equal? (candidate -78) (list 1 1))\n (check-equal? (candidate 3452) (list 2 2))\n (check-equal? (candidate 346211) (list 3 3))\n (check-equal? (candidate -345821) (list 3 3))\n (check-equal? (candidate -2) (list 1 0))\n (check-equal? (candidate -45347) (list 2 3))\n (check-equal? (candidate 0) (list 1 0))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that accepts a list of strings.\n;; The list contains different words. Return the word with maximum number\n;; of unique characters. If multiple strings have maximum number of unique\n;; characters, return the one which comes first in lexicographical order.\n;; >>> (find_max (list \"name\" \"of\" \"string\"))\n;; \"string\"\n;; >>> (find_max (list \"name\" \"enam\" \"game\"))\n;; \"enam\"\n;; >>> (find_max (list \"aaaaaaa\" \"bb\" \"cc\"))\n;; \"aaaaaaa\"\n(define (find_max words)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate find_max))\n (check-equal? (candidate (list \"name\" \"of\" \"string\")) \"string\")\n (check-equal? (candidate (list \"name\" \"enam\" \"game\")) \"enam\")\n (check-equal? (candidate (list \"aaaaaaa\" \"bb\" \"cc\")) \"aaaaaaa\")\n (check-equal? (candidate (list \"abc\" \"cba\")) \"abc\")\n (check-equal? (candidate (list \"play\" \"this\" \"game\" \"of\" \"footbott\")) \"footbott\")\n (check-equal? (candidate (list \"we\" \"are\" \"gonna\" \"rock\")) \"gonna\")\n (check-equal? (candidate (list \"we\" \"are\" \"a\" \"mad\" \"nation\")) \"nation\")\n (check-equal? (candidate (list \"this\" \"is\" \"a\" \"prrk\")) \"this\")\n (check-equal? (candidate (list \"b\")) \"b\")\n (check-equal? (candidate (list \"play\" \"play\" \"play\")) \"play\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a positive integer n, return the count of the numbers of n-digit\n;; positive integers that start or end with 1.\n(define (starts_one_ends n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate starts_one_ends))\n (check-equal? (candidate 1) 1)\n (check-equal? (candidate 2) 18)\n (check-equal? (candidate 3) 180)\n (check-equal? (candidate 4) 1800)\n (check-equal? (candidate 5) 18000)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function that returns a tuple (a, b), where 'a' is\n;; the largest of negative integers, and 'b' is the smallest\n;; of positive integers in a list.\n;; If there is no negative or positive integers, return them as None.\n;; Examples:\n;; >>> (largest_smallest_integers (list 2 4 1 3 5 7))\n;; (list #f 1)\n;; >>> (largest_smallest_integers (list ))\n;; (list #f #f)\n;; >>> (largest_smallest_integers (list 0))\n;; (list #f #f)\n(define (largest_smallest_integers lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate largest_smallest_integers))\n (check-equal? (candidate (list 2 4 1 3 5 7)) (list #f 1))\n (check-equal? (candidate (list 2 4 1 3 5 7 0)) (list #f 1))\n (check-equal? (candidate (list 1 3 2 4 5 6 -2)) (list -2 1))\n (check-equal? (candidate (list 4 5 3 6 2 7 -7)) (list -7 2))\n (check-equal? (candidate (list 7 3 8 4 9 2 5 -9)) (list -9 2))\n (check-equal? (candidate (list )) (list #f #f))\n (check-equal? (candidate (list 0)) (list #f #f))\n (check-equal? (candidate (list -1 -3 -5 -6)) (list -1 #f))\n (check-equal? (candidate (list -1 -3 -5 -6 0)) (list -1 #f))\n (check-equal? (candidate (list -6 -4 -4 -3 1)) (list -3 1))\n (check-equal? (candidate (list -6 -4 -4 -3 -100 1)) (list -3 1))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "rkt", - "prompt": "#lang racket\n\n;; \"Given an array representing a branch of a tree that has non-negative integer nodes\n;; your task is to pluck one of the nodes and return it.\n;; The plucked node should be the node with the smallest even value.\n;; If multiple nodes with the same smallest even value are found return the node that has smallest index.\n;; The plucked node should be returned in a list, [ smalest_value, its index ],\n;; If there are no even values or the given array is empty, return [].\n;; Example 1:\n;; >>> (pluck (list 4 2 3))\n;; (list 2 1)\n;; Explanation: 2 has the smallest even value, and 2 has the smallest index.\n;; Example 2:\n;; >>> (pluck (list 1 2 3))\n;; (list 2 1)\n;; Explanation: 2 has the smallest even value, and 2 has the smallest index.\n;; Example 3:\n;; >>> (pluck (list ))\n;; (list )\n;; Example 4:\n;; >>> (pluck (list 5 0 3 0 4 2))\n;; (list 0 1)\n;; Explanation: 0 is the smallest value, but there are two zeros,\n;; so we will choose the first zero, which has the smallest index.\n;; Constraints:\n;; * 1 <= nodes.length <= 10000\n;; * 0 <= node.value\n(define (pluck arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate pluck))\n (check-equal? (candidate (list 4 2 3)) (list 2 1))\n (check-equal? (candidate (list 1 2 3)) (list 2 1))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 5 0 3 0 4 2)) (list 0 1))\n (check-equal? (candidate (list 1 2 3 0 5 3)) (list 0 3))\n (check-equal? (candidate (list 5 4 8 4 8)) (list 4 1))\n (check-equal? (candidate (list 7 6 7 1)) (list 6 1))\n (check-equal? (candidate (list 7 9 7 1)) (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function count_nums which takes an array of integers and returns\n;; the number of elements which has a sum of digits > 0.\n;; If a number is negative, then its first signed digit will be negative:\n;; e.g. -123 has signed digits -1, 2, and 3.\n;; >>> (count_nums (list ))\n;; 0\n;; >>> (count_nums (list -1 11 -11))\n;; 1\n;; >>> (count_nums (list 1 1 2))\n;; 3\n(define (count_nums arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate count_nums))\n (check-equal? (candidate (list )) 0)\n (check-equal? (candidate (list -1 -2 0)) 0)\n (check-equal? (candidate (list 1 1 2 -2 3 4 5)) 6)\n (check-equal? (candidate (list 1 6 9 -6 0 1 5)) 5)\n (check-equal? (candidate (list 1 100 98 -7 1 -1)) 4)\n (check-equal? (candidate (list 12 23 34 -45 -56 0)) 5)\n (check-equal? (candidate (list 0 1)) 1)\n (check-equal? (candidate (list 1)) 1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n;; each cell of the grid contains a value. Every integer in the range [1, N * N]\n;; inclusive appears exactly once on the cells of the grid.\n;; You have to find the minimum path of length k in the grid. You can start\n;; from any cell, and in each step you can move to any of the neighbor cells,\n;; in other words, you can go to cells which share an edge with you current\n;; cell.\n;; Please note that a path of length k means visiting exactly k cells (not\n;; necessarily distinct).\n;; You CANNOT go off the grid.\n;; A path A (of length k) is considered less than a path B (of length k) if\n;; after making the ordered lists of the values on the cells that A and B go\n;; through (let's call them lst_A and lst_B), lst_A is lexicographically less\n;; than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n;; such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n;; lst_A[j] = lst_B[j].\n;; It is guaranteed that the answer is unique.\n;; Return an ordered list of the values on the cells that the minimum path go through.\n;; Examples: \n;; >>> (minPath (list (list 1 2 3) (list 4 5 6) (list 7 8 9)) 3)\n;; (list 1 2 1)\n;; >>> (minPath (list (list 5 9 3) (list 4 1 6) (list 7 8 2)) 1)\n;; (list 1)\n(define (minPath grid k)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate minPath))\n (check-equal? (candidate (list (list 1 2 3) (list 4 5 6) (list 7 8 9)) 3) (list 1 2 1))\n (check-equal? (candidate (list (list 5 9 3) (list 4 1 6) (list 7 8 2)) 1) (list 1))\n (check-equal? (candidate (list (list 1 2 3 4) (list 5 6 7 8) (list 9 10 11 12) (list 13 14 15 16)) 4) (list 1 2 1 2))\n (check-equal? (candidate (list (list 6 4 13 10) (list 5 7 12 1) (list 3 16 11 15) (list 8 14 9 2)) 7) (list 1 10 1 10 1 10 1))\n (check-equal? (candidate (list (list 8 14 9 2) (list 6 4 13 15) (list 5 7 1 12) (list 3 10 11 16)) 5) (list 1 7 1 7 1))\n (check-equal? (candidate (list (list 11 8 7 2) (list 5 16 14 4) (list 9 3 15 6) (list 12 13 10 1)) 9) (list 1 6 1 6 1 6 1 6 1))\n (check-equal? (candidate (list (list 12 13 10 1) (list 9 3 15 6) (list 5 16 14 4) (list 11 8 7 2)) 12) (list 1 6 1 6 1 6 1 6 1 6 1 6))\n (check-equal? (candidate (list (list 2 7 4) (list 3 1 5) (list 6 8 9)) 8) (list 1 3 1 3 1 3 1 3))\n (check-equal? (candidate (list (list 6 1 5) (list 3 8 9) (list 2 7 4)) 8) (list 1 5 1 5 1 5 1 5))\n (check-equal? (candidate (list (list 1 2) (list 3 4)) 10) (list 1 2 1 2 1 2 1 2 1 2))\n (check-equal? (candidate (list (list 1 3) (list 3 2)) 10) (list 1 3 1 3 1 3 1 3 1 3))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given list of integers, return list in strange order.\n;; Strange sorting, is when you start with the minimum value,\n;; then maximum of the remaining integers, then minimum and so on.\n;; Examples:\n;; >>> (strange_sort_list (list 1 2 3 4))\n;; (list 1 4 2 3)\n;; >>> (strange_sort_list (list 5 5 5 5))\n;; (list 5 5 5 5)\n;; >>> (strange_sort_list (list ))\n;; (list )\n(define (strange_sort_list lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate strange_sort_list))\n (check-equal? (candidate (list 1 2 3 4)) (list 1 4 2 3))\n (check-equal? (candidate (list 5 6 7 8 9)) (list 5 9 6 8 7))\n (check-equal? (candidate (list 1 2 3 4 5)) (list 1 5 2 4 3))\n (check-equal? (candidate (list 5 6 7 8 9 1)) (list 1 9 5 8 6 7))\n (check-equal? (candidate (list 5 5 5 5)) (list 5 5 5 5))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 1 2 3 4 5 6 7 8)) (list 1 8 2 7 3 6 4 5))\n (check-equal? (candidate (list 0 2 2 2 5 5 -5 -5)) (list -5 5 -5 5 0 2 2 2))\n (check-equal? (candidate (list 111111)) (list 111111))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a string 'text', return its md5 hash equivalent string.\n;; If 'text' is an empty string, return None.\n;; >>> (string_to_md5 \"Hello world\")\n;; \"3e25960a79dbc69b674cd4ec67a72c62\"\n(define (string_to_md5 text)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate string_to_md5))\n (check-equal? (candidate \"Hello world\") \"3e25960a79dbc69b674cd4ec67a72c62\")\n (check-equal? (candidate \"\") #f)\n (check-equal? (candidate \"A B C\") \"0ef78513b0cb8cef12743f5aeb35f888\")\n (check-equal? (candidate \"password\") \"5f4dcc3b5aa765d61d8327deb882cf99\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a word. Your task is to find the closest vowel that stands between \n;; two consonants from the right side of the word (case sensitive).\n;; Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n;; find any vowel met the above condition. \n;; You may assume that the given string contains English letter only.\n;; Example:\n;; >>> (get_closest_vowel \"yogurt\")\n;; \"u\"\n;; >>> (get_closest_vowel \"FULL\")\n;; \"U\"\n;; >>> (get_closest_vowel \"quick\")\n;; \"\"\n;; >>> (get_closest_vowel \"ab\")\n;; \"\"\n(define (get_closest_vowel word)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate get_closest_vowel))\n (check-equal? (candidate \"yogurt\") \"u\")\n (check-equal? (candidate \"full\") \"u\")\n (check-equal? (candidate \"easy\") \"\")\n (check-equal? (candidate \"eAsy\") \"\")\n (check-equal? (candidate \"ali\") \"\")\n (check-equal? (candidate \"bad\") \"a\")\n (check-equal? (candidate \"most\") \"o\")\n (check-equal? (candidate \"ab\") \"\")\n (check-equal? (candidate \"ba\") \"\")\n (check-equal? (candidate \"quick\") \"\")\n (check-equal? (candidate \"anime\") \"i\")\n (check-equal? (candidate \"Asia\") \"\")\n (check-equal? (candidate \"Above\") \"o\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "rkt", - "prompt": "#lang racket\n\n;; Change numerical base of input number x to base.\n;; return string representation after the conversion.\n;; base numbers are less than 10.\n;; >>> (change_base 8 3)\n;; \"22\"\n;; >>> (change_base 8 2)\n;; \"1000\"\n;; >>> (change_base 7 2)\n;; \"111\"\n(define (change_base x base)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate change_base))\n (check-equal? (candidate 8 3) \"22\")\n (check-equal? (candidate 9 3) \"100\")\n (check-equal? (candidate 234 2) \"11101010\")\n (check-equal? (candidate 16 2) \"10000\")\n (check-equal? (candidate 8 2) \"1000\")\n (check-equal? (candidate 7 2) \"111\")\n (check-equal? (candidate 2 3) \"2\")\n (check-equal? (candidate 3 4) \"3\")\n (check-equal? (candidate 4 5) \"4\")\n (check-equal? (candidate 5 6) \"5\")\n (check-equal? (candidate 6 7) \"6\")\n (check-equal? (candidate 7 8) \"7\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "rkt", - "prompt": "#lang racket\n\n;; Check if in given list of numbers, are any two numbers closer to each other than\n;; given threshold.\n;; >>> (has_close_elements (list 1.0 2.0 3.0) 0.5)\n;; #f\n;; >>> (has_close_elements (list 1.0 2.8 3.0 4.0 5.0 2.0) 0.3)\n;; #t\n(define (has_close_elements numbers threshold)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate has_close_elements))\n (check-equal? (candidate (list 1.0 2.0 3.9 4.0 5.0 2.2) 0.3) #t)\n (check-equal? (candidate (list 1.0 2.0 3.9 4.0 5.0 2.2) 0.05) #f)\n (check-equal? (candidate (list 1.0 2.0 5.9 4.0 5.0) 0.95) #t)\n (check-equal? (candidate (list 1.0 2.0 5.9 4.0 5.0) 0.8) #f)\n (check-equal? (candidate (list 1.0 2.0 3.0 4.0 5.0 2.0) 0.1) #t)\n (check-equal? (candidate (list 1.1 2.2 3.1 4.1 5.1) 1.0) #t)\n (check-equal? (candidate (list 1.1 2.2 3.1 4.1 5.1) 0.5) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function that takes a string as input which contains only square brackets.\n;; The function should return True if and only if there is a valid subsequence of brackets \n;; where at least one bracket in the subsequence is nested.\n;; >>> (is_nested \"[[]]\")\n;; #t\n;; >>> (is_nested \"[]]]]]]][[[[[]\")\n;; #f\n;; >>> (is_nested \"[][]\")\n;; #f\n;; >>> (is_nested \"[]\")\n;; #f\n;; >>> (is_nested \"[[][]]\")\n;; #t\n;; >>> (is_nested \"[[]][[\")\n;; #t\n(define (is_nested string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_nested))\n (check-equal? (candidate \"[[]]\") #t)\n (check-equal? (candidate \"[]]]]]]][[[[[]\") #f)\n (check-equal? (candidate \"[][]\") #f)\n (check-equal? (candidate \"[]\") #f)\n (check-equal? (candidate \"[[[[]]]]\") #t)\n (check-equal? (candidate \"[]]]]]]]]]]\") #f)\n (check-equal? (candidate \"[][][[]]\") #t)\n (check-equal? (candidate \"[[]\") #f)\n (check-equal? (candidate \"[]]\") #f)\n (check-equal? (candidate \"[[]][[\") #t)\n (check-equal? (candidate \"[[][]]\") #t)\n (check-equal? (candidate \"\") #f)\n (check-equal? (candidate \"[[[[[[[[\") #f)\n (check-equal? (candidate \"]]]]]]]]\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "rkt", - "prompt": "#lang racket\n\n;; Concatenate list of strings into a single string\n;; >>> (concatenate (list ))\n;; \"\"\n;; >>> (concatenate (list \"a\" \"b\" \"c\"))\n;; \"abc\"\n(define (concatenate strings)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate concatenate))\n (check-equal? (candidate (list )) \"\")\n (check-equal? (candidate (list \"x\" \"y\" \"z\")) \"xyz\")\n (check-equal? (candidate (list \"x\" \"y\" \"z\" \"w\" \"k\")) \"xyzwk\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "rkt", - "prompt": "#lang racket\n\n;; prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n;; >>> (prime_fib 1)\n;; 2\n;; >>> (prime_fib 2)\n;; 3\n;; >>> (prime_fib 3)\n;; 5\n;; >>> (prime_fib 4)\n;; 13\n;; >>> (prime_fib 5)\n;; 89\n(define (prime_fib n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate prime_fib))\n (check-equal? (candidate 1) 2)\n (check-equal? (candidate 2) 3)\n (check-equal? (candidate 3) 5)\n (check-equal? (candidate 4) 13)\n (check-equal? (candidate 5) 89)\n (check-equal? (candidate 6) 233)\n (check-equal? (candidate 7) 1597)\n (check-equal? (candidate 8) 28657)\n (check-equal? (candidate 9) 514229)\n (check-equal? (candidate 10) 433494437)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "rkt", - "prompt": "#lang racket\n\n;; From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n;; other and return them in order (smaller number, larger number).\n;; >>> (find_closest_elements (list 1.0 2.0 3.0 4.0 5.0 2.2))\n;; (list 2.0 2.2)\n;; >>> (find_closest_elements (list 1.0 2.0 3.0 4.0 5.0 2.0))\n;; (list 2.0 2.0)\n(define (find_closest_elements numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate find_closest_elements))\n (check-equal? (candidate (list 1.0 2.0 3.9 4.0 5.0 2.2)) (list 3.9 4.0))\n (check-equal? (candidate (list 1.0 2.0 5.9 4.0 5.0)) (list 5.0 5.9))\n (check-equal? (candidate (list 1.0 2.0 3.0 4.0 5.0 2.2)) (list 2.0 2.2))\n (check-equal? (candidate (list 1.0 2.0 3.0 4.0 5.0 2.0)) (list 2.0 2.0))\n (check-equal? (candidate (list 1.1 2.2 3.1 4.1 5.1)) (list 2.2 3.1))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "rkt", - "prompt": "#lang racket\n\n;; You have been tasked to write a function that receives \n;; a hexadecimal number as a string and counts the number of hexadecimal \n;; digits that are primes (prime number, or a prime, is a natural number \n;; greater than 1 that is not a product of two smaller natural numbers).\n;; Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n;; Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n;; So you have to determine a number of the following digits: 2, 3, 5, 7, \n;; B (=decimal 11), D (=decimal 13).\n;; Note: you may assume the input is always correct or empty string, \n;; and symbols A,B,C,D,E,F are always uppercase.\n;; Examples:\n;; >>> (hex_key \"AB\")\n;; 1\n;; >>> (hex_key \"1077E\")\n;; 2\n;; >>> (hex_key \"ABED1A33\")\n;; 4\n;; >>> (hex_key \"123456789ABCDEF0\")\n;; 6\n;; >>> (hex_key \"2020\")\n;; 2\n(define (hex_key num)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate hex_key))\n (check-equal? (candidate \"AB\") 1)\n (check-equal? (candidate \"1077E\") 2)\n (check-equal? (candidate \"ABED1A33\") 4)\n (check-equal? (candidate \"2020\") 2)\n (check-equal? (candidate \"123456789ABCDEF0\") 6)\n (check-equal? (candidate \"112233445566778899AABBCCDDEEFF00\") 12)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "rkt", - "prompt": "#lang racket\n\n;; Complete the function that takes two integers and returns \n;; the product of their unit digits.\n;; Assume the input is always valid.\n;; Examples:\n;; >>> (multiply 148 412)\n;; 16\n;; >>> (multiply 19 28)\n;; 72\n;; >>> (multiply 2020 1851)\n;; 0\n;; >>> (multiply 14 -15)\n;; 20\n(define (multiply a b)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate multiply))\n (check-equal? (candidate 148 412) 16)\n (check-equal? (candidate 19 28) 72)\n (check-equal? (candidate 2020 1851) 0)\n (check-equal? (candidate 14 -15) 20)\n (check-equal? (candidate 76 67) 42)\n (check-equal? (candidate 17 27) 49)\n (check-equal? (candidate 0 1) 0)\n (check-equal? (candidate 0 0) 0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given list of numbers (of at least two elements), apply a linear transform to that list,\n;; such that the smallest number will become 0 and the largest will become 1\n;; >>> (rescale_to_unit (list 1.0 2.0 3.0 4.0 5.0))\n;; (list 0.0 0.25 0.5 0.75 1.0)\n(define (rescale_to_unit numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate rescale_to_unit))\n (check-equal? (candidate (list 2.0 49.9)) (list 0.0 1.0))\n (check-equal? (candidate (list 100.0 49.9)) (list 1.0 0.0))\n (check-equal? (candidate (list 1.0 2.0 3.0 4.0 5.0)) (list 0.0 0.25 0.5 0.75 1.0))\n (check-equal? (candidate (list 2.0 1.0 5.0 3.0 4.0)) (list 0.25 0.0 1.0 0.5 0.75))\n (check-equal? (candidate (list 12.0 11.0 15.0 13.0 14.0)) (list 0.25 0.0 1.0 0.5 0.75))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a positive integer n, return the product of the odd digits.\n;; Return 0 if all digits are even.\n;; For example:\n;; >>> (digits 1)\n;; 1\n;; >>> (digits 4)\n;; 0\n;; >>> (digits 235)\n;; 15\n(define (digits n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate digits))\n (check-equal? (candidate 5) 5)\n (check-equal? (candidate 54) 5)\n (check-equal? (candidate 120) 1)\n (check-equal? (candidate 5014) 5)\n (check-equal? (candidate 98765) 315)\n (check-equal? (candidate 5576543) 2625)\n (check-equal? (candidate 2468) 0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "rkt", - "prompt": "#lang racket\n\n;; You will be given the name of a class (a string) and a list of extensions.\n;; The extensions are to be used to load additional classes to the class. The\n;; strength of the extension is as follows: Let CAP be the number of the uppercase\n;; letters in the extension's name, and let SM be the number of lowercase letters \n;; in the extension's name, the strength is given by the fraction CAP - SM. \n;; You should find the strongest extension and return a string in this \n;; format: ClassName.StrongestExtensionName.\n;; If there are two or more extensions with the same strength, you should\n;; choose the one that comes first in the list.\n;; For example, if you are given \"Slices\" as the class and a list of the\n;; extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n;; return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n;; (its strength is -1).\n;; Example:\n;; >>> (Strongest_Extension \"my_class\" (list \"AA\" \"Be\" \"CC\"))\n;; \"my_class.AA\"\n(define (Strongest_Extension class_name extensions)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate Strongest_Extension))\n (check-equal? (candidate \"Watashi\" (list \"tEN\" \"niNE\" \"eIGHt8OKe\")) \"Watashi.eIGHt8OKe\")\n (check-equal? (candidate \"Boku123\" (list \"nani\" \"NazeDa\" \"YEs.WeCaNe\" \"32145tggg\")) \"Boku123.YEs.WeCaNe\")\n (check-equal? (candidate \"__YESIMHERE\" (list \"t\" \"eMptY\" \"nothing\" \"zeR00\" \"NuLl__\" \"123NoooneB321\")) \"__YESIMHERE.NuLl__\")\n (check-equal? (candidate \"K\" (list \"Ta\" \"TAR\" \"t234An\" \"cosSo\")) \"K.TAR\")\n (check-equal? (candidate \"__HAHA\" (list \"Tab\" \"123\" \"781345\" \"-_-\")) \"__HAHA.123\")\n (check-equal? (candidate \"YameRore\" (list \"HhAas\" \"okIWILL123\" \"WorkOut\" \"Fails\" \"-_-\")) \"YameRore.okIWILL123\")\n (check-equal? (candidate \"finNNalLLly\" (list \"Die\" \"NowW\" \"Wow\" \"WoW\")) \"finNNalLLly.WoW\")\n (check-equal? (candidate \"_\" (list \"Bb\" \"91245\")) \"_.Bb\")\n (check-equal? (candidate \"Sp\" (list \"671235\" \"Bb\")) \"Sp.671235\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a string representing a space separated lowercase letters, return a dictionary\n;; of the letter with the most repetition and containing the corresponding count.\n;; If several letters have the same occurrence, return all of them.\n;; Example:\n;; >>> (histogram \"a b c\")\n;; #hash((\"a\" . 1) (\"b\" . 1) (\"c\" . 1))\n;; >>> (histogram \"a b b a\")\n;; #hash((\"a\" . 2) (\"b\" . 2))\n;; >>> (histogram \"a b c a b\")\n;; #hash((\"a\" . 2) (\"b\" . 2))\n;; >>> (histogram \"b b b b a\")\n;; #hash((\"b\" . 4))\n;; >>> (histogram \"\")\n;; #hash()\n(define (histogram test)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate histogram))\n (check-equal? (candidate \"a b b a\") #hash((\"a\" . 2) (\"b\" . 2)))\n (check-equal? (candidate \"a b c a b\") #hash((\"a\" . 2) (\"b\" . 2)))\n (check-equal? (candidate \"a b c d g\") #hash((\"a\" . 1) (\"b\" . 1) (\"c\" . 1) (\"d\" . 1) (\"g\" . 1)))\n (check-equal? (candidate \"r t g\") #hash((\"r\" . 1) (\"t\" . 1) (\"g\" . 1)))\n (check-equal? (candidate \"b b b b a\") #hash((\"b\" . 4)))\n (check-equal? (candidate \"r t g\") #hash((\"r\" . 1) (\"t\" . 1) (\"g\" . 1)))\n (check-equal? (candidate \"\") #hash())\n (check-equal? (candidate \"a\") #hash((\"a\" . 1)))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "rkt", - "prompt": "#lang racket\n\n;; pairs_sum_to_zero takes a list of integers as an input.\n;; it returns True if there are two distinct elements in the list that\n;; sum to zero, and False otherwise.\n;; >>> (pairs_sum_to_zero (list 1 3 5 0))\n;; #f\n;; >>> (pairs_sum_to_zero (list 1 3 -2 1))\n;; #f\n;; >>> (pairs_sum_to_zero (list 1 2 3 7))\n;; #f\n;; >>> (pairs_sum_to_zero (list 2 4 -5 3 5 7))\n;; #t\n;; >>> (pairs_sum_to_zero (list 1))\n;; #f\n(define (pairs_sum_to_zero l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate pairs_sum_to_zero))\n (check-equal? (candidate (list 1 3 5 0)) #f)\n (check-equal? (candidate (list 1 3 -2 1)) #f)\n (check-equal? (candidate (list 1 2 3 7)) #f)\n (check-equal? (candidate (list 2 4 -5 3 5 7)) #t)\n (check-equal? (candidate (list 1)) #f)\n (check-equal? (candidate (list -3 9 -1 3 2 30)) #t)\n (check-equal? (candidate (list -3 9 -1 3 2 31)) #t)\n (check-equal? (candidate (list -3 9 -1 4 2 30)) #f)\n (check-equal? (candidate (list -3 9 -1 4 2 31)) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that accepts two lists of strings and returns the list that has \n;; total number of chars in the all strings of the list less than the other list.\n;; if the two lists have the same number of chars, return the first list.\n;; Examples\n;; >>> (total_match (list ) (list ))\n;; (list )\n;; >>> (total_match (list \"hi\" \"admin\") (list \"hI\" \"Hi\"))\n;; (list \"hI\" \"Hi\")\n;; >>> (total_match (list \"hi\" \"admin\") (list \"hi\" \"hi\" \"admin\" \"project\"))\n;; (list \"hi\" \"admin\")\n;; >>> (total_match (list \"hi\" \"admin\") (list \"hI\" \"hi\" \"hi\"))\n;; (list \"hI\" \"hi\" \"hi\")\n;; >>> (total_match (list \"4\") (list \"1\" \"2\" \"3\" \"4\" \"5\"))\n;; (list \"4\")\n(define (total_match lst1 lst2)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate total_match))\n (check-equal? (candidate (list ) (list )) (list ))\n (check-equal? (candidate (list \"hi\" \"admin\") (list \"hi\" \"hi\")) (list \"hi\" \"hi\"))\n (check-equal? (candidate (list \"hi\" \"admin\") (list \"hi\" \"hi\" \"admin\" \"project\")) (list \"hi\" \"admin\"))\n (check-equal? (candidate (list \"4\") (list \"1\" \"2\" \"3\" \"4\" \"5\")) (list \"4\"))\n (check-equal? (candidate (list \"hi\" \"admin\") (list \"hI\" \"Hi\")) (list \"hI\" \"Hi\"))\n (check-equal? (candidate (list \"hi\" \"admin\") (list \"hI\" \"hi\" \"hi\")) (list \"hI\" \"hi\" \"hi\"))\n (check-equal? (candidate (list \"hi\" \"admin\") (list \"hI\" \"hi\" \"hii\")) (list \"hi\" \"admin\"))\n (check-equal? (candidate (list ) (list \"this\")) (list ))\n (check-equal? (candidate (list \"this\") (list )) (list ))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "rkt", - "prompt": "#lang racket\n\n;; Circular shift the digits of the integer x, shift the digits right by shift\n;; and return the result as a string.\n;; If shift > number of digits, return digits reversed.\n;; >>> (circular_shift 12 1)\n;; \"21\"\n;; >>> (circular_shift 12 2)\n;; \"12\"\n(define (circular_shift x shift)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate circular_shift))\n (check-equal? (candidate 100 2) \"001\")\n (check-equal? (candidate 12 2) \"12\")\n (check-equal? (candidate 97 8) \"79\")\n (check-equal? (candidate 12 1) \"21\")\n (check-equal? (candidate 11 101) \"11\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return True is list elements are monotonically increasing or decreasing.\n;; >>> (monotonic (list 1 2 4 20))\n;; #t\n;; >>> (monotonic (list 1 20 4 10))\n;; #f\n;; >>> (monotonic (list 4 1 0 -10))\n;; #t\n(define (monotonic l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate monotonic))\n (check-equal? (candidate (list 1 2 4 10)) #t)\n (check-equal? (candidate (list 1 2 4 20)) #t)\n (check-equal? (candidate (list 1 20 4 10)) #f)\n (check-equal? (candidate (list 4 1 0 -10)) #t)\n (check-equal? (candidate (list 4 1 1 0)) #t)\n (check-equal? (candidate (list 1 2 3 2 5 60)) #f)\n (check-equal? (candidate (list 1 2 3 4 5 60)) #t)\n (check-equal? (candidate (list 9 9 9 9)) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "rkt", - "prompt": "#lang racket\n\n;; Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n;; Example\n;; >>> (is_equal_to_sum_even 4)\n;; #f\n;; >>> (is_equal_to_sum_even 6)\n;; #f\n;; >>> (is_equal_to_sum_even 8)\n;; #t\n(define (is_equal_to_sum_even n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_equal_to_sum_even))\n (check-equal? (candidate 4) #f)\n (check-equal? (candidate 6) #f)\n (check-equal? (candidate 8) #t)\n (check-equal? (candidate 10) #t)\n (check-equal? (candidate 11) #f)\n (check-equal? (candidate 12) #t)\n (check-equal? (candidate 13) #f)\n (check-equal? (candidate 16) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "rkt", - "prompt": "#lang racket\n\n;; Input to this function is a string representing musical notes in a special ASCII format.\n;; Your task is to parse this string and return list of integers corresponding to how many beats does each\n;; not last.\n;; Here is a legend:\n;; 'o' - whole note, lasts four beats\n;; 'o|' - half note, lasts two beats\n;; '.|' - quater note, lasts one beat\n;; >>> (parse_music \"o o| .| o| o| .| .| .| .| o o\")\n;; (list 4 2 1 2 2 1 1 1 1 4 4)\n(define (parse_music music_string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate parse_music))\n (check-equal? (candidate \"\") (list ))\n (check-equal? (candidate \"o o o o\") (list 4 4 4 4))\n (check-equal? (candidate \".| .| .| .|\") (list 1 1 1 1))\n (check-equal? (candidate \"o| o| .| .| o o o o\") (list 2 2 1 1 4 4 4 4))\n (check-equal? (candidate \"o| .| o| .| o o| o o|\") (list 2 1 2 1 4 2 4 2))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "rkt", - "prompt": "#lang racket\n\n;; \"\n;; This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n;; multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n;; change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n;; Examples:\n;; >>> lst\n;; (list 1 2 3)\n;; >>> lst\n;; (list )\n;; >>> lst\n;; (list -1 -5 2 -1 -5)\n(define (sum_squares lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sum_squares))\n (check-equal? (candidate (list 1 2 3)) 6)\n (check-equal? (candidate (list 1 4 9)) 14)\n (check-equal? (candidate (list )) 0)\n (check-equal? (candidate (list 1 1 1 1 1 1 1 1 1)) 9)\n (check-equal? (candidate (list -1 -1 -1 -1 -1 -1 -1 -1 -1)) -3)\n (check-equal? (candidate (list 0)) 0)\n (check-equal? (candidate (list -1 -5 2 -1 -5)) -126)\n (check-equal? (candidate (list -56 -99 1 0 -2)) 3030)\n (check-equal? (candidate (list -1 0 0 0 0 0 0 0 -1)) 0)\n (check-equal? (candidate (list -16 -9 -2 36 36 26 -20 25 -40 20 -4 12 -26 35 37)) -14196)\n (check-equal? (candidate (list -1 -3 17 -1 -15 13 -1 14 -14 -12 -5 14 -14 6 13 11 16 16 4 10)) -1448)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "rkt", - "prompt": "#lang racket\n\n;; triples_sum_to_zero takes a list of integers as an input.\n;; it returns True if there are three distinct elements in the list that\n;; sum to zero, and False otherwise.\n;; >>> (triples_sum_to_zero (list 1 3 5 0))\n;; #f\n;; >>> (triples_sum_to_zero (list 1 3 -2 1))\n;; #t\n;; >>> (triples_sum_to_zero (list 1 2 3 7))\n;; #f\n;; >>> (triples_sum_to_zero (list 2 4 -5 3 9 7))\n;; #t\n;; >>> (triples_sum_to_zero (list 1))\n;; #f\n(define (triples_sum_to_zero l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate triples_sum_to_zero))\n (check-equal? (candidate (list 1 3 5 0)) #f)\n (check-equal? (candidate (list 1 3 5 -1)) #f)\n (check-equal? (candidate (list 1 3 -2 1)) #t)\n (check-equal? (candidate (list 1 2 3 7)) #f)\n (check-equal? (candidate (list 1 2 5 7)) #f)\n (check-equal? (candidate (list 2 4 -5 3 9 7)) #t)\n (check-equal? (candidate (list 1)) #f)\n (check-equal? (candidate (list 1 3 5 -100)) #f)\n (check-equal? (candidate (list 100 3 5 -100)) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "rkt", - "prompt": "#lang racket\n\n;; brackets is a string of \"<\" and \">\".\n;; return True if every opening bracket has a corresponding closing bracket.\n;; >>> (correct_bracketing \"<\")\n;; #f\n;; >>> (correct_bracketing \"<>\")\n;; #t\n;; >>> (correct_bracketing \"<<><>>\")\n;; #t\n;; >>> (correct_bracketing \"><<>\")\n;; #f\n(define (correct_bracketing brackets)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate correct_bracketing))\n (check-equal? (candidate \"<>\") #t)\n (check-equal? (candidate \"<<><>>\") #t)\n (check-equal? (candidate \"<><><<><>><>\") #t)\n (check-equal? (candidate \"<><><<<><><>><>><<><><<>>>\") #t)\n (check-equal? (candidate \"<<<><>>>>\") #f)\n (check-equal? (candidate \"><<>\") #f)\n (check-equal? (candidate \"<\") #f)\n (check-equal? (candidate \"<<<<\") #f)\n (check-equal? (candidate \">\") #f)\n (check-equal? (candidate \"<<>\") #f)\n (check-equal? (candidate \"<><><<><>><>><<>\") #f)\n (check-equal? (candidate \"<><><<><>><>>><>\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that takes an array of numbers as input and returns \n;; the number of elements in the array that are greater than 10 and both \n;; first and last digits of a number are odd (1, 3, 5, 7, 9).\n;; For example:\n;; >>> (specialFilter (list 15 -73 14 -15))\n;; 1\n;; >>> (specialFilter (list 33 -2 -3 45 21 109))\n;; 2\n(define (specialFilter nums)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate specialFilter))\n (check-equal? (candidate (list 5 -2 1 -5)) 0)\n (check-equal? (candidate (list 15 -73 14 -15)) 1)\n (check-equal? (candidate (list 33 -2 -3 45 21 109)) 2)\n (check-equal? (candidate (list 43 -12 93 125 121 109)) 4)\n (check-equal? (candidate (list 71 -2 -33 75 21 19)) 3)\n (check-equal? (candidate (list 1)) 0)\n (check-equal? (candidate (list )) 0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a dictionary, return True if all keys are strings in lower \n;; case or all keys are strings in upper case, else return False.\n;; The function should return False is the given dictionary is empty.\n;; Examples:\n;; >>> (check_dict_case #hash((\"a\" . \"apple\") (\"b\" . \"banana\")))\n;; #t\n;; >>> (check_dict_case #hash((\"a\" . \"apple\") (\"A\" . \"banana\") (\"B\" . \"banana\")))\n;; #f\n;; >>> (check_dict_case #hash((\"a\" . \"apple\") (8 . \"banana\") (\"a\" . \"apple\")))\n;; #f\n;; >>> (check_dict_case #hash((\"Name\" . \"John\") (\"Age\" . \"36\") (\"City\" . \"Houston\")))\n;; #f\n;; >>> (check_dict_case #hash((\"STATE\" . \"NC\") (\"ZIP\" . \"12345\")))\n;; #t\n(define (check_dict_case dict)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate check_dict_case))\n (check-equal? (candidate #hash((\"p\" . \"pineapple\") (\"b\" . \"banana\"))) #t)\n (check-equal? (candidate #hash((\"p\" . \"pineapple\") (\"A\" . \"banana\") (\"B\" . \"banana\"))) #f)\n (check-equal? (candidate #hash((\"p\" . \"pineapple\") (\"5\" . \"banana\") (\"a\" . \"apple\"))) #f)\n (check-equal? (candidate #hash((\"Name\" . \"John\") (\"Age\" . \"36\") (\"City\" . \"Houston\"))) #f)\n (check-equal? (candidate #hash((\"STATE\" . \"NC\") (\"ZIP\" . \"12345\"))) #t)\n (check-equal? (candidate #hash((\"fruit\" . \"Orange\") (\"taste\" . \"Sweet\"))) #t)\n (check-equal? (candidate #hash()) #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n;; should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n;; alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n;; Examples\n;; >>> (split_words \"Hello world!\")\n;; (list \"Hello\" \"world!\")\n;; >>> (split_words \"Hello,world!\")\n;; (list \"Hello\" \"world!\")\n;; >>> (split_words \"abcdef\")\n;; 3\n(define (split_words txt)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate split_words))\n (check-equal? (candidate \"Hello world!\") (list \"Hello\" \"world!\"))\n (check-equal? (candidate \"Hello,world!\") (list \"Hello\" \"world!\"))\n (check-equal? (candidate \"Hello world,!\") (list \"Hello\" \"world,!\"))\n (check-equal? (candidate \"Hello,Hello,world !\") (list \"Hello,Hello,world\" \"!\"))\n (check-equal? (candidate \"abcdef\") 3)\n (check-equal? (candidate \"aaabb\") 2)\n (check-equal? (candidate \"aaaBb\") 1)\n (check-equal? (candidate \"\") 0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "rkt", - "prompt": "#lang racket\n\n;; The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n;; fibfib(0) == 0\n;; fibfib(1) == 0\n;; fibfib(2) == 1\n;; fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n;; Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n;; >>> (fibfib 1)\n;; 0\n;; >>> (fibfib 5)\n;; 4\n;; >>> (fibfib 8)\n;; 24\n(define (fibfib n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate fibfib))\n (check-equal? (candidate 2) 1)\n (check-equal? (candidate 1) 0)\n (check-equal? (candidate 5) 4)\n (check-equal? (candidate 8) 24)\n (check-equal? (candidate 10) 81)\n (check-equal? (candidate 12) 274)\n (check-equal? (candidate 14) 927)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a list of numbers.\n;; You need to return the sum of squared numbers in the given list,\n;; round each element in the list to the upper int(Ceiling) first.\n;; Examples:\n;; >>> (lst (list 1.0 2.0 3.0))\n;; 14\n;; >>> (lst (list 1.0 4.0 9.0))\n;; 98\n;; >>> (lst (list 1.0 3.0 5.0 7.0))\n;; 84\n;; >>> (lst (list 1.4 4.2 0.0))\n;; 29\n;; >>> (lst (list -2.4 1.0 1.0))\n;; 6\n(define (sum_squares lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sum_squares))\n (check-equal? (candidate (list 1.0 2.0 3.0)) 14)\n (check-equal? (candidate (list 1.0 2.0 3.0)) 14)\n (check-equal? (candidate (list 1.0 3.0 5.0 7.0)) 84)\n (check-equal? (candidate (list 1.4 4.2 0.0)) 29)\n (check-equal? (candidate (list -2.4 1.0 1.0)) 6)\n (check-equal? (candidate (list 100.0 1.0 15.0 2.0)) 10230)\n (check-equal? (candidate (list 10000.0 10000.0)) 200000000)\n (check-equal? (candidate (list -1.4 4.6 6.3)) 75)\n (check-equal? (candidate (list -1.4 17.9 18.9 19.9)) 1086)\n (check-equal? (candidate (list 0.0)) 0)\n (check-equal? (candidate (list -1.0)) 1)\n (check-equal? (candidate (list -1.0 1.0 0.0)) 2)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_85_add", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a non-empty list of integers lst. add the even elements that are at odd indices..\n;; Examples:\n;; >>> (add (list 4 2 6 7))\n;; 2\n(define (add lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate add))\n (check-equal? (candidate (list 4 88)) 88)\n (check-equal? (candidate (list 4 5 6 7 2 122)) 122)\n (check-equal? (candidate (list 4 0 6 7)) 0)\n (check-equal? (candidate (list 4 4 6 8)) 12)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return sorted unique elements in a list\n;; >>> (unique (list 5 3 5 2 3 3 9 0 123))\n;; (list 0 2 3 5 9 123)\n(define (unique l)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate unique))\n (check-equal? (candidate (list 5 3 5 2 3 3 9 0 123)) (list 0 2 3 5 9 123))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a string text, replace all spaces in it with underscores, \n;; and if a string has more than 2 consecutive spaces, \n;; then replace all consecutive spaces with - \n;; >>> (fix_spaces \" Example\")\n;; \"Example\"\n;; >>> (fix_spaces \" Example 1\")\n;; \"Example_1\"\n;; >>> (fix_spaces \" Example 2\")\n;; \"_Example_2\"\n;; >>> (fix_spaces \" Example 3\")\n;; \"_Example-3\"\n(define (fix_spaces text)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate fix_spaces))\n (check-equal? (candidate \"Example\") \"Example\")\n (check-equal? (candidate \"Mudasir Hanif \") \"Mudasir_Hanif_\")\n (check-equal? (candidate \"Yellow Yellow Dirty Fellow\") \"Yellow_Yellow__Dirty__Fellow\")\n (check-equal? (candidate \"Exa mple\") \"Exa-mple\")\n (check-equal? (candidate \" Exa 1 2 2 mple\") \"-Exa_1_2_2_mple\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return 2^n modulo p (be aware of numerics).\n;; >>> (modp 3 5)\n;; 3\n;; >>> (modp 1101 101)\n;; 2\n;; >>> (modp 0 101)\n;; 1\n;; >>> (modp 3 11)\n;; 8\n;; >>> (modp 100 101)\n;; 1\n(define (modp n p)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate modp))\n (check-equal? (candidate 3 5) 3)\n (check-equal? (candidate 1101 101) 2)\n (check-equal? (candidate 0 101) 1)\n (check-equal? (candidate 3 11) 8)\n (check-equal? (candidate 100 101) 1)\n (check-equal? (candidate 30 5) 4)\n (check-equal? (candidate 31 5) 3)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "rkt", - "prompt": "#lang racket\n\n;; You have to write a function which validates a given date string and\n;; returns True if the date is valid otherwise False.\n;; The date is valid if all of the following rules are satisfied:\n;; 1. The date string is not empty.\n;; 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n;; 3. The months should not be less than 1 or higher than 12.\n;; 4. The date should be in the format: mm-dd-yyyy\n;; >>> (valid_date \"03-11-2000\")\n;; #t\n;; >>> (valid_date \"15-01-2012\")\n;; #f\n;; >>> (valid_date \"04-0-2040\")\n;; #f\n;; >>> (valid_date \"06-04-2020\")\n;; #t\n;; >>> (valid_date \"06/04/2020\")\n;; #f\n(define (valid_date date)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate valid_date))\n (check-equal? (candidate \"03-11-2000\") #t)\n (check-equal? (candidate \"15-01-2012\") #f)\n (check-equal? (candidate \"04-0-2040\") #f)\n (check-equal? (candidate \"06-04-2020\") #t)\n (check-equal? (candidate \"01-01-2007\") #t)\n (check-equal? (candidate \"03-32-2011\") #f)\n (check-equal? (candidate \"\") #f)\n (check-equal? (candidate \"04-31-3000\") #f)\n (check-equal? (candidate \"06-06-2005\") #t)\n (check-equal? (candidate \"21-31-2000\") #f)\n (check-equal? (candidate \"04-12-2003\") #t)\n (check-equal? (candidate \"04122003\") #f)\n (check-equal? (candidate \"20030412\") #f)\n (check-equal? (candidate \"2003-04\") #f)\n (check-equal? (candidate \"2003-04-12\") #f)\n (check-equal? (candidate \"04-2003\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that takes a string and returns an ordered version of it.\n;; Ordered version of string, is a string where all words (separated by space)\n;; are replaced by a new word where all the characters arranged in\n;; ascending order based on ascii value.\n;; Note: You should keep the order of words and blank spaces in the sentence.\n;; For example:\n;; >>> (anti_shuffle \"Hi\")\n;; \"Hi\"\n;; >>> (anti_shuffle \"hello\")\n;; \"ehllo\"\n;; >>> (anti_shuffle \"Hello World!!!\")\n;; \"Hello !!!Wdlor\"\n(define (anti_shuffle s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate anti_shuffle))\n (check-equal? (candidate \"Hi\") \"Hi\")\n (check-equal? (candidate \"hello\") \"ehllo\")\n (check-equal? (candidate \"number\") \"bemnru\")\n (check-equal? (candidate \"abcd\") \"abcd\")\n (check-equal? (candidate \"Hello World!!!\") \"Hello !!!Wdlor\")\n (check-equal? (candidate \"\") \"\")\n (check-equal? (candidate \"Hi. My name is Mister Robot. How are you?\") \".Hi My aemn is Meirst .Rboot How aer ?ouy\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a list of numbers, return whether or not they are sorted\n;; in ascending order. If list has more than 1 duplicate of the same\n;; number, return False. Assume no negative numbers and only integers.\n;; Examples\n;; >>> (is_sorted (list 5))\n;; #t\n;; >>> (is_sorted (list 1 2 3 4 5))\n;; #t\n;; >>> (is_sorted (list 1 3 2 4 5))\n;; #f\n;; >>> (is_sorted (list 1 2 3 4 5 6))\n;; #t\n;; >>> (is_sorted (list 1 2 3 4 5 6 7))\n;; #t\n;; >>> (is_sorted (list 1 3 2 4 5 6 7))\n;; #f\n;; >>> (is_sorted (list 1 2 2 3 3 4))\n;; #t\n;; >>> (is_sorted (list 1 2 2 2 3 4))\n;; #f\n(define (is_sorted lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_sorted))\n (check-equal? (candidate (list 5)) #t)\n (check-equal? (candidate (list 1 2 3 4 5)) #t)\n (check-equal? (candidate (list 1 3 2 4 5)) #f)\n (check-equal? (candidate (list 1 2 3 4 5 6)) #t)\n (check-equal? (candidate (list 1 2 3 4 5 6 7)) #t)\n (check-equal? (candidate (list 1 3 2 4 5 6 7)) #f)\n (check-equal? (candidate (list )) #t)\n (check-equal? (candidate (list 1)) #t)\n (check-equal? (candidate (list 3 2 1)) #f)\n (check-equal? (candidate (list 1 2 2 2 3 4)) #f)\n (check-equal? (candidate (list 1 2 3 3 3 4)) #f)\n (check-equal? (candidate (list 1 2 2 3 3 4)) #t)\n (check-equal? (candidate (list 1 2 3 4)) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a string s.\n;; Your task is to check if the string is happy or not.\n;; A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n;; For example:\n;; >>> (is_happy \"a\")\n;; #f\n;; >>> (is_happy \"aa\")\n;; #f\n;; >>> (is_happy \"abcd\")\n;; #t\n;; >>> (is_happy \"aabb\")\n;; #f\n;; >>> (is_happy \"adb\")\n;; #t\n;; >>> (is_happy \"xyy\")\n;; #f\n(define (is_happy s)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate is_happy))\n (check-equal? (candidate \"a\") #f)\n (check-equal? (candidate \"aa\") #f)\n (check-equal? (candidate \"abcd\") #t)\n (check-equal? (candidate \"aabb\") #f)\n (check-equal? (candidate \"adb\") #t)\n (check-equal? (candidate \"xyy\") #f)\n (check-equal? (candidate \"iopaxpoi\") #t)\n (check-equal? (candidate \"iopaxioi\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "rkt", - "prompt": "#lang racket\n\n;; Write a function that returns True if the object q will fly, and False otherwise.\n;; The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n;; Example:\n;; >>> (will_it_fly (list 1 2) 5)\n;; #f\n;; # 1+2 is less than the maximum possible weight, but it's unbalanced.\n;; >>> (will_it_fly (list 3 2 3) 1)\n;; #f\n;; # it's balanced, but 3+2+3 is more than the maximum possible weight.\n;; >>> (will_it_fly (list 3 2 3) 9)\n;; #t\n;; # 3+2+3 is less than the maximum possible weight, and it's balanced.\n;; >>> (will_it_fly (list 3) 5)\n;; #t\n;; # 3 is less than the maximum possible weight, and it's balanced.\n(define (will_it_fly q w)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate will_it_fly))\n (check-equal? (candidate (list 3 2 3) 9) #t)\n (check-equal? (candidate (list 1 2) 5) #f)\n (check-equal? (candidate (list 3) 5) #t)\n (check-equal? (candidate (list 3 2 3) 1) #f)\n (check-equal? (candidate (list 1 2 3) 6) #f)\n (check-equal? (candidate (list 5) 5) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given an array of non-negative integers, return a copy of the given array after sorting,\n;; you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n;; or sort it in descending order if the sum( first index value, last index value) is even.\n;; Note:\n;; * don't change the given array.\n;; Examples:\n;; >>> (sort_array (list ))\n;; (list )\n;; >>> (sort_array (list 5))\n;; (list 5)\n;; >>> (sort_array (list 2 4 3 0 1 5))\n;; (list 0 1 2 3 4 5)\n;; >>> (sort_array (list 2 4 3 0 1 5 6))\n;; (list 6 5 4 3 2 1 0)\n(define (sort_array array)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sort_array))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 5)) (list 5))\n (check-equal? (candidate (list 2 4 3 0 1 5)) (list 0 1 2 3 4 5))\n (check-equal? (candidate (list 2 4 3 0 1 5 6)) (list 6 5 4 3 2 1 0))\n (check-equal? (candidate (list 2 1)) (list 1 2))\n (check-equal? (candidate (list 15 42 87 32 11 0)) (list 0 11 15 32 42 87))\n (check-equal? (candidate (list 21 14 23 11)) (list 23 21 14 11))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "rkt", - "prompt": "#lang racket\n\n;; Implement a function that takes an non-negative integer and returns an array of the first n\n;; integers that are prime numbers and less than n.\n;; for example:\n;; >>> (count_up_to 5)\n;; (list 2 3)\n;; >>> (count_up_to 11)\n;; (list 2 3 5 7)\n;; >>> (count_up_to 0)\n;; (list )\n;; >>> (count_up_to 20)\n;; (list 2 3 5 7 11 13 17 19)\n;; >>> (count_up_to 1)\n;; (list )\n;; >>> (count_up_to 18)\n;; (list 2 3 5 7 11 13 17)\n(define (count_up_to n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate count_up_to))\n (check-equal? (candidate 5) (list 2 3))\n (check-equal? (candidate 6) (list 2 3 5))\n (check-equal? (candidate 7) (list 2 3 5))\n (check-equal? (candidate 10) (list 2 3 5 7))\n (check-equal? (candidate 0) (list ))\n (check-equal? (candidate 22) (list 2 3 5 7 11 13 17 19))\n (check-equal? (candidate 1) (list ))\n (check-equal? (candidate 18) (list 2 3 5 7 11 13 17))\n (check-equal? (candidate 47) (list 2 3 5 7 11 13 17 19 23 29 31 37 41 43))\n (check-equal? (candidate 101) (list 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "rkt", - "prompt": "#lang racket\n\n;; Out of list of strings, return the longest one. Return the first one in case of multiple\n;; strings of the same length. Return None in case the input list is empty.\n;; >>> (longest (list ))\n;; #f\n;; >>> (longest (list \"a\" \"b\" \"c\"))\n;; \"a\"\n;; >>> (longest (list \"a\" \"bb\" \"ccc\"))\n;; \"ccc\"\n(define (longest strings)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate longest))\n (check-equal? (candidate (list )) #f)\n (check-equal? (candidate (list \"x\" \"y\" \"z\")) \"x\")\n (check-equal? (candidate (list \"x\" \"yyy\" \"zzzz\" \"www\" \"kkkk\" \"abc\")) \"zzzz\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n;; reverse the resulting array, and then replace each digit by its corresponding name from\n;; \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n;; For example:\n;; >>> (by_length (list 2 1 1 4 5 8 2 3))\n;; (list \"Eight\" \"Five\" \"Four\" \"Three\" \"Two\" \"Two\" \"One\" \"One\")\n;; If the array is empty, return an empty array:\n;; >>> (by_length (list ))\n;; (list )\n;; If the array has any strange number ignore it:\n;; >>> (by_length (list 1 -1 55))\n;; (list \"One\")\n(define (by_length arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate by_length))\n (check-equal? (candidate (list 2 1 1 4 5 8 2 3)) (list \"Eight\" \"Five\" \"Four\" \"Three\" \"Two\" \"Two\" \"One\" \"One\"))\n (check-equal? (candidate (list )) (list ))\n (check-equal? (candidate (list 1 -1 55)) (list \"One\"))\n (check-equal? (candidate (list 1 -1 3 2)) (list \"Three\" \"Two\" \"One\"))\n (check-equal? (candidate (list 9 4 8)) (list \"Nine\" \"Eight\" \"Four\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_106_f", - "language": "rkt", - "prompt": "#lang racket\n\n;; Implement the function f that takes n as a parameter,\n;; 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\n;; or the sum of numbers from 1 to i otherwise.\n;; i starts from 1.\n;; the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n;; Example:\n;; >>> (f 5)\n;; (list 1 2 6 24 15)\n(define (f n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate f))\n (check-equal? (candidate 5) (list 1 2 6 24 15))\n (check-equal? (candidate 7) (list 1 2 6 24 15 720 28))\n (check-equal? (candidate 1) (list 1))\n (check-equal? (candidate 3) (list 1 2 6))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n;; >>> (fizz_buzz 50)\n;; 0\n;; >>> (fizz_buzz 78)\n;; 2\n;; >>> (fizz_buzz 79)\n;; 3\n(define (fizz_buzz n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate fizz_buzz))\n (check-equal? (candidate 50) 0)\n (check-equal? (candidate 78) 2)\n (check-equal? (candidate 79) 3)\n (check-equal? (candidate 100) 3)\n (check-equal? (candidate 200) 6)\n (check-equal? (candidate 4000) 192)\n (check-equal? (candidate 10000) 639)\n (check-equal? (candidate 100000) 8026)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a positive floating point number, it can be decomposed into\n;; and integer part (largest integer smaller than given number) and decimals\n;; (leftover part always smaller than 1).\n;; Return the decimal part of the number.\n;; >>> (truncate_number 3.5)\n;; 0.5\n(define (truncate_number number)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate truncate_number))\n (check-equal? (candidate 3.5) 0.5)\n (check-equal? (candidate 1.25) 0.25)\n (check-equal? (candidate 123.0) 0.0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "rkt", - "prompt": "#lang racket\n\n;; For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n;; Empty sum should be equal to 0 and empty product should be equal to 1.\n;; >>> (sum_product (list ))\n;; (list 0 1)\n;; >>> (sum_product (list 1 2 3 4))\n;; (list 10 24)\n(define (sum_product numbers)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate sum_product))\n (check-equal? (candidate (list )) (list 0 1))\n (check-equal? (candidate (list 1 1 1)) (list 3 1))\n (check-equal? (candidate (list 100 0)) (list 100 0))\n (check-equal? (candidate (list 3 5 7)) (list 15 105))\n (check-equal? (candidate (list 10)) (list 10 10))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a 2 dimensional data, as a nested lists,\n;; which is similar to matrix, however, unlike matrices,\n;; each row may contain a different number of columns.\n;; Given lst, and integer x, find integers x in the list,\n;; and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n;; each tuple is a coordinate - (row, columns), starting with 0.\n;; Sort coordinates initially by rows in ascending order.\n;; Also, sort coordinates of the row by columns in descending order.\n;; Examples:\n;; >>> (get_row (list (list 1 2 3 4 5 6) (list 1 2 3 4 1 6) (list 1 2 3 4 5 1)) 1)\n;; (list (list 0 0) (list 1 4) (list 1 0) (list 2 5) (list 2 0))\n;; >>> (get_row (list ) 1)\n;; (list )\n;; >>> (get_row (list (list ) (list 1) (list 1 2 3)) 3)\n;; (list (list 2 2))\n(define (get_row lst x)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate get_row))\n (check-equal? (candidate (list (list 1 2 3 4 5 6) (list 1 2 3 4 1 6) (list 1 2 3 4 5 1)) 1) (list (list 0 0) (list 1 4) (list 1 0) (list 2 5) (list 2 0)))\n (check-equal? (candidate (list (list 1 2 3 4 5 6) (list 1 2 3 4 5 6) (list 1 2 3 4 5 6) (list 1 2 3 4 5 6) (list 1 2 3 4 5 6) (list 1 2 3 4 5 6)) 2) (list (list 0 1) (list 1 1) (list 2 1) (list 3 1) (list 4 1) (list 5 1)))\n (check-equal? (candidate (list (list 1 2 3 4 5 6) (list 1 2 3 4 5 6) (list 1 1 3 4 5 6) (list 1 2 1 4 5 6) (list 1 2 3 1 5 6) (list 1 2 3 4 1 6) (list 1 2 3 4 5 1)) 1) (list (list 0 0) (list 1 0) (list 2 1) (list 2 0) (list 3 2) (list 3 0) (list 4 3) (list 4 0) (list 5 4) (list 5 0) (list 6 5) (list 6 0)))\n (check-equal? (candidate (list ) 1) (list ))\n (check-equal? (candidate (list (list 1)) 2) (list ))\n (check-equal? (candidate (list (list ) (list 1) (list 1 2 3)) 3) (list (list 2 2)))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "rkt", - "prompt": "#lang racket\n\n;; You're a hungry rabbit, and you already have eaten a certain number of carrots,\n;; but now you need to eat more carrots to complete the day's meals.\n;; you should return an array of [ total number of eaten carrots after your meals,\n;; the number of carrots left after your meals ]\n;; if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n;; Example:\n;; >>> (eat 5 6 10)\n;; (list 11 4)\n;; >>> (eat 4 8 9)\n;; (list 12 1)\n;; >>> (eat 1 10 10)\n;; (list 11 0)\n;; >>> (eat 2 11 5)\n;; (list 7 0)\n;; Variables:\n;; @number : integer\n;; the number of carrots that you have eaten.\n;; @need : integer\n;; the number of carrots that you need to eat.\n;; @remaining : integer\n;; the number of remaining carrots thet exist in stock\n;; Constrain:\n;; * 0 <= number <= 1000\n;; * 0 <= need <= 1000\n;; * 0 <= remaining <= 1000\n;; Have fun :)\n(define (eat number need remaining)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate eat))\n (check-equal? (candidate 5 6 10) (list 11 4))\n (check-equal? (candidate 4 8 9) (list 12 1))\n (check-equal? (candidate 1 10 10) (list 11 0))\n (check-equal? (candidate 2 11 5) (list 7 0))\n (check-equal? (candidate 4 5 7) (list 9 2))\n (check-equal? (candidate 4 5 1) (list 5 0))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a positive integer N, return the total sum of its digits in binary.\n;; Example\n;; >>> (solve 1000)\n;; \"1\"\n;; >>> (solve 150)\n;; \"110\"\n;; >>> (solve 147)\n;; \"1100\"\n;; Variables:\n;; @N integer\n;; Constraints: 0 \u2264 N \u2264 10000.\n;; Output:\n;; a string of binary number\n(define (solve N)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate solve))\n (check-equal? (candidate 1000) \"1\")\n (check-equal? (candidate 150) \"110\")\n (check-equal? (candidate 147) \"1100\")\n (check-equal? (candidate 333) \"1001\")\n (check-equal? (candidate 963) \"10010\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given a list of integers.\n;; You need to find the largest prime value and return the sum of its digits.\n;; Examples:\n;; >>> (skjkasdkd (list 0 3 2 1 3 5 7 4 5 5 5 2 181 32 4 32 3 2 32 324 4 3))\n;; 10\n;; >>> (skjkasdkd (list 1 0 1 8 2 4597 2 1 3 40 1 2 1 2 4 2 5 1))\n;; 25\n;; >>> (skjkasdkd (list 1 3 1 32 5107 34 83278 109 163 23 2323 32 30 1 9 3))\n;; 13\n;; >>> (skjkasdkd (list 0 724 32 71 99 32 6 0 5 91 83 0 5 6))\n;; 11\n;; >>> (skjkasdkd (list 0 81 12 3 1 21))\n;; 3\n;; >>> (skjkasdkd (list 0 8 1 2 1 7))\n;; 7\n(define (skjkasdkd lst)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate skjkasdkd))\n (check-equal? (candidate (list 0 3 2 1 3 5 7 4 5 5 5 2 181 32 4 32 3 2 32 324 4 3)) 10)\n (check-equal? (candidate (list 1 0 1 8 2 4597 2 1 3 40 1 2 1 2 4 2 5 1)) 25)\n (check-equal? (candidate (list 1 3 1 32 5107 34 83278 109 163 23 2323 32 30 1 9 3)) 13)\n (check-equal? (candidate (list 0 724 32 71 99 32 6 0 5 91 83 0 5 6)) 11)\n (check-equal? (candidate (list 0 81 12 3 1 21)) 3)\n (check-equal? (candidate (list 0 8 1 2 1 7)) 7)\n (check-equal? (candidate (list 8191)) 19)\n (check-equal? (candidate (list 8191 123456 127 7)) 19)\n (check-equal? (candidate (list 127 97 8192)) 10)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given an array arr of integers, find the minimum number of elements that\n;; need to be changed to make the array palindromic. A palindromic array is an array that\n;; is read the same backwards and forwards. In one change, you can change one element to any other element.\n;; For example:\n;; >>> (smallest_change (list 1 2 3 5 4 7 9 6))\n;; 4\n;; >>> (smallest_change (list 1 2 3 4 3 2 2))\n;; 1\n;; >>> (smallest_change (list 1 2 3 2 1))\n;; 0\n(define (smallest_change arr)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate smallest_change))\n (check-equal? (candidate (list 1 2 3 5 4 7 9 6)) 4)\n (check-equal? (candidate (list 1 2 3 4 3 2 2)) 1)\n (check-equal? (candidate (list 1 4 2)) 1)\n (check-equal? (candidate (list 1 4 4 2)) 1)\n (check-equal? (candidate (list 1 2 3 2 1)) 0)\n (check-equal? (candidate (list 3 1 1 3)) 0)\n (check-equal? (candidate (list 1)) 0)\n (check-equal? (candidate (list 0 1)) 1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "rkt", - "prompt": "#lang racket\n\n;; It is the last week of the semester and the teacher has to give the grades\n;; to students. The teacher has been making her own algorithm for grading.\n;; The only problem is, she has lost the code she used for grading.\n;; She has given you a list of GPAs for some students and you have to write \n;; a function that can output a list of letter grades using the following table:\n;; GPA | Letter grade\n;; 4.0 A+\n;; > 3.7 A \n;; > 3.3 A- \n;; > 3.0 B+\n;; > 2.7 B \n;; > 2.3 B-\n;; > 2.0 C+\n;; > 1.7 C\n;; > 1.3 C-\n;; > 1.0 D+ \n;; > 0.7 D \n;; > 0.0 D-\n;; 0.0 E\n;; Example:\n;; >>> (grade_equation (list 4.0 3 1.7 2 3.5))\n;; (list \"A+\" \"B\" \"C-\" \"C\" \"A-\")\n(define (numerical_letter_grade grades)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate numerical_letter_grade))\n (check-equal? (candidate (list 4.0 3 1.7 2 3.5)) (list \"A+\" \"B\" \"C-\" \"C\" \"A-\"))\n (check-equal? (candidate (list 1.2)) (list \"D+\"))\n (check-equal? (candidate (list 0.5)) (list \"D-\"))\n (check-equal? (candidate (list 0.0)) (list \"E\"))\n (check-equal? (candidate (list 1.0 0.3 1.5 2.8 3.3)) (list \"D\" \"D-\" \"C-\" \"B\" \"B+\"))\n (check-equal? (candidate (list 0.0 0.7)) (list \"E\" \"D-\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given the lengths of the three sides of a triangle. Return the area of\n;; the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n;; Otherwise return -1\n;; Three sides make a valid triangle when the sum of any two sides is greater \n;; than the third side.\n;; Example:\n;; >>> (triangle_area 3 4 5)\n;; 6.0\n;; >>> (triangle_area 1 2 10)\n;; -1\n(define (triangle_area a b c)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate triangle_area))\n (check-equal? (candidate 3 4 5) 6.0)\n (check-equal? (candidate 1 2 10) -1)\n (check-equal? (candidate 4 8 5) 8.18)\n (check-equal? (candidate 2 2 2) 1.73)\n (check-equal? (candidate 1 2 3) -1)\n (check-equal? (candidate 10 5 7) 16.25)\n (check-equal? (candidate 2 6 3) -1)\n (check-equal? (candidate 1 1 1) 0.43)\n (check-equal? (candidate 2 2 10) -1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "rkt", - "prompt": "#lang racket\n\n;; Check if two words have the same characters.\n;; >>> (same_chars \"eabcdzzzz\" \"dddzzzzzzzddeddabc\")\n;; #t\n;; >>> (same_chars \"abcd\" \"dddddddabc\")\n;; #t\n;; >>> (same_chars \"dddddddabc\" \"abcd\")\n;; #t\n;; >>> (same_chars \"eabcd\" \"dddddddabc\")\n;; #f\n;; >>> (same_chars \"abcd\" \"dddddddabce\")\n;; #f\n;; >>> (same_chars \"eabcdzzzz\" \"dddzzzzzzzddddabc\")\n;; #f\n(define (same_chars s0 s1)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate same_chars))\n (check-equal? (candidate \"eabcdzzzz\" \"dddzzzzzzzddeddabc\") #t)\n (check-equal? (candidate \"abcd\" \"dddddddabc\") #t)\n (check-equal? (candidate \"dddddddabc\" \"abcd\") #t)\n (check-equal? (candidate \"eabcd\" \"dddddddabc\") #f)\n (check-equal? (candidate \"abcd\" \"dddddddabcf\") #f)\n (check-equal? (candidate \"eabcdzzzz\" \"dddzzzzzzzddddabc\") #f)\n (check-equal? (candidate \"aabb\" \"aaccc\") #f)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given an array of integers nums, find the minimum sum of any non-empty sub-array\n;; of nums.\n;; Example\n;; >>> (minSubArraySum (list 2 3 4 1 2 4))\n;; 1\n;; >>> (minSubArraySum (list -1 -2 -3))\n;; -6\n(define (minSubArraySum nums)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate minSubArraySum))\n (check-equal? (candidate (list 2 3 4 1 2 4)) 1)\n (check-equal? (candidate (list -1 -2 -3)) -6)\n (check-equal? (candidate (list -1 -2 -3 2 -10)) -14)\n (check-equal? (candidate (list -9999999999999999)) -9999999999999999)\n (check-equal? (candidate (list 0 10 20 1000000)) 0)\n (check-equal? (candidate (list -1 -2 -3 10 -5)) -6)\n (check-equal? (candidate (list 100 -1 -2 -3 10 -5)) -6)\n (check-equal? (candidate (list 10 11 13 8 3 4)) 3)\n (check-equal? (candidate (list 100 -33 32 -1 0 -2)) -33)\n (check-equal? (candidate (list -10)) -10)\n (check-equal? (candidate (list 7)) 7)\n (check-equal? (candidate (list 1 -1)) -1)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a string s and a natural number n, you have been tasked to implement \n;; a function that returns a list of all words from string s that contain exactly \n;; n consonants, in order these words appear in the string s.\n;; If the string s is empty then the function should return an empty list.\n;; Note: you may assume the input string contains only letters and spaces.\n;; Examples:\n;; >>> (select_words \"Mary had a little lamb\" 4)\n;; (list \"little\")\n;; >>> (select_words \"Mary had a little lamb\" 3)\n;; (list \"Mary\" \"lamb\")\n;; >>> (select_words \"simple white space\" 2)\n;; (list )\n;; >>> (select_words \"Hello world\" 4)\n;; (list \"world\")\n;; >>> (select_words \"Uncle sam\" 3)\n;; (list \"Uncle\")\n(define (select_words s n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate select_words))\n (check-equal? (candidate \"Mary had a little lamb\" 4) (list \"little\"))\n (check-equal? (candidate \"Mary had a little lamb\" 3) (list \"Mary\" \"lamb\"))\n (check-equal? (candidate \"simple white space\" 2) (list ))\n (check-equal? (candidate \"Hello world\" 4) (list \"world\"))\n (check-equal? (candidate \"Uncle sam\" 3) (list \"Uncle\"))\n (check-equal? (candidate \"\" 4) (list ))\n (check-equal? (candidate \"a b c d e f\" 1) (list \"b\" \"c\" \"d\" \"f\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return list of all prefixes from shortest to longest of the input string\n;; >>> (all_prefixes \"abc\")\n;; (list \"a\" \"ab\" \"abc\")\n(define (all_prefixes string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate all_prefixes))\n (check-equal? (candidate \"\") (list ))\n (check-equal? (candidate \"asdfgh\") (list \"a\" \"as\" \"asd\" \"asdf\" \"asdfg\" \"asdfgh\"))\n (check-equal? (candidate \"WWW\") (list \"W\" \"WW\" \"WWW\"))\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function that takes a value (string) representing a number\n;; and returns the closest integer to it. If the number is equidistant\n;; from two integers, round it away from zero.\n;; Examples\n;; >>> (closest_integer \"10\")\n;; 10\n;; >>> (closest_integer \"15.3\")\n;; 15\n;; Note:\n;; Rounding away from zero means that if the given number is equidistant\n;; from two integers, the one you should return is the one that is the\n;; farthest from zero. For example closest_integer(\"14.5\") should\n;; return 15 and closest_integer(\"-14.5\") should return -15.\n(define (closest_integer value)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate closest_integer))\n (check-equal? (candidate \"10\") 10)\n (check-equal? (candidate \"14.5\") 15)\n (check-equal? (candidate \"-15.5\") -16)\n (check-equal? (candidate \"15.3\") 15)\n (check-equal? (candidate \"0\") 0)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "rkt", - "prompt": "#lang racket\n\n;; Create a function which takes a string representing a file's name, and returns\n;; 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n;; A file's name is considered to be valid if and only if all the following conditions \n;; are met:\n;; - There should not be more than three digits ('0'-'9') in the file's name.\n;; - The file's name contains exactly one dot '.'\n;; - The substring before the dot should not be empty, and it starts with a letter from \n;; the latin alphapet ('a'-'z' and 'A'-'Z').\n;; - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n;; Examples:\n;; >>> (file_name_check \"example.txt\")\n;; \"Yes\"\n;; >>> (file_name_check \"1example.dll\")\n;; \"No\"\n(define (file_name_check file_name)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate file_name_check))\n (check-equal? (candidate \"example.txt\") \"Yes\")\n (check-equal? (candidate \"1example.dll\") \"No\")\n (check-equal? (candidate \"s1sdf3.asd\") \"No\")\n (check-equal? (candidate \"K.dll\") \"Yes\")\n (check-equal? (candidate \"MY16FILE3.exe\") \"Yes\")\n (check-equal? (candidate \"His12FILE94.exe\") \"No\")\n (check-equal? (candidate \"_Y.txt\") \"No\")\n (check-equal? (candidate \"?aREYA.exe\") \"No\")\n (check-equal? (candidate \"/this_is_valid.dll\") \"No\")\n (check-equal? (candidate \"this_is_valid.wow\") \"No\")\n (check-equal? (candidate \"this_is_valid.txt\") \"Yes\")\n (check-equal? (candidate \"this_is_valid.txtexe\") \"No\")\n (check-equal? (candidate \"#this2_i4s_5valid.ten\") \"No\")\n (check-equal? (candidate \"@this1_is6_valid.exe\") \"No\")\n (check-equal? (candidate \"this_is_12valid.6exe4.txt\") \"No\")\n (check-equal? (candidate \"all.exe.txt\") \"No\")\n (check-equal? (candidate \"I563_No.exe\") \"Yes\")\n (check-equal? (candidate \"Is3youfault.txt\") \"Yes\")\n (check-equal? (candidate \"no_one#knows.dll\") \"Yes\")\n (check-equal? (candidate \"1I563_Yes3.exe\") \"No\")\n (check-equal? (candidate \"I563_Yes3.txtt\") \"No\")\n (check-equal? (candidate \"final..txt\") \"No\")\n (check-equal? (candidate \"final132\") \"No\")\n (check-equal? (candidate \"_f4indsartal132.\") \"No\")\n (check-equal? (candidate \".txt\") \"No\")\n (check-equal? (candidate \"s.\") \"No\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "rkt", - "prompt": "#lang racket\n\n;; You are given two intervals,\n;; where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n;; The given intervals are closed which means that the interval (start, end)\n;; includes both start and end.\n;; For each given interval, it is assumed that its start is less or equal its end.\n;; Your task is to determine whether the length of intersection of these two \n;; intervals is a prime number.\n;; Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n;; which its length is 1, which not a prime number.\n;; If the length of the intersection is a prime number, return \"YES\",\n;; otherwise, return \"NO\".\n;; If the two intervals don't intersect, return \"NO\".\n;; [input/output] samples:\n;; >>> (intersection (list 1 2) (list 2 3))\n;; \"NO\"\n;; >>> (intersection (list -1 1) (list 0 4))\n;; \"NO\"\n;; >>> (intersection (list -3 -1) (list -5 5))\n;; \"YES\"\n(define (intersection interval1 interval2)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate intersection))\n (check-equal? (candidate (list 1 2) (list 2 3)) \"NO\")\n (check-equal? (candidate (list -1 1) (list 0 4)) \"NO\")\n (check-equal? (candidate (list -3 -1) (list -5 5)) \"YES\")\n (check-equal? (candidate (list -2 2) (list -4 0)) \"YES\")\n (check-equal? (candidate (list -11 2) (list -1 -1)) \"NO\")\n (check-equal? (candidate (list 1 2) (list 3 5)) \"NO\")\n (check-equal? (candidate (list 1 2) (list 1 2)) \"NO\")\n (check-equal? (candidate (list -2 -2) (list -3 -2)) \"NO\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "rkt", - "prompt": "#lang racket\n\n;; Return the largest prime factor of n. Assume n > 1 and is not a prime.\n;; >>> (largest_prime_factor 13195)\n;; 29\n;; >>> (largest_prime_factor 2048)\n;; 2\n(define (largest_prime_factor n)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate largest_prime_factor))\n (check-equal? (candidate 15) 5)\n (check-equal? (candidate 27) 3)\n (check-equal? (candidate 63) 7)\n (check-equal? (candidate 330) 11)\n (check-equal? (candidate 13195) 29)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a string, find out how many distinct characters (regardless of case) does it consist of\n;; >>> (count_distinct_characters \"xyzXYZ\")\n;; 3\n;; >>> (count_distinct_characters \"Jerry\")\n;; 4\n(define (count_distinct_characters string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate count_distinct_characters))\n (check-equal? (candidate \"\") 0)\n (check-equal? (candidate \"abcde\") 5)\n (check-equal? (candidate \"abcdecadeCADE\") 5)\n (check-equal? (candidate \"aaaaAAAAaaaa\") 1)\n (check-equal? (candidate \"Jerry jERRY JeRRRY\") 5)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "rkt", - "prompt": "#lang racket\n\n;; You're given a list of deposit and withdrawal operations on a bank account that starts with\n;; zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n;; at that point function should return True. Otherwise it should return False.\n;; >>> (below_zero (list 1 2 3))\n;; #f\n;; >>> (below_zero (list 1 2 -4 5))\n;; #t\n(define (below_zero operations)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate below_zero))\n (check-equal? (candidate (list )) #f)\n (check-equal? (candidate (list 1 2 -3 1 2 -3)) #f)\n (check-equal? (candidate (list 1 2 -4 5 6)) #t)\n (check-equal? (candidate (list 1 -1 2 -2 5 -5 4 -4)) #f)\n (check-equal? (candidate (list 1 -1 2 -2 5 -5 4 -5)) #t)\n (check-equal? (candidate (list 1 -2 2 -2 5 -5 4 -4)) #t)\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "rkt", - "prompt": "#lang racket\n\n;; Find the shortest palindrome that begins with a supplied string.\n;; Algorithm idea is simple:\n;; - Find the longest postfix of supplied string that is a palindrome.\n;; - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n;; >>> (make_palindrome \"\")\n;; \"\"\n;; >>> (make_palindrome \"cat\")\n;; \"catac\"\n;; >>> (make_palindrome \"cata\")\n;; \"catac\"\n(define (make_palindrome string)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate make_palindrome))\n (check-equal? (candidate \"\") \"\")\n (check-equal? (candidate \"x\") \"x\")\n (check-equal? (candidate \"xyz\") \"xyzyx\")\n (check-equal? (candidate \"xyx\") \"xyx\")\n (check-equal? (candidate \"jerry\") \"jerryrrej\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "rkt", - "prompt": "#lang racket\n\n;; Given a positive integer, obtain its roman numeral equivalent as a string,\n;; and return it in lowercase.\n;; Restrictions: 1 <= num <= 1000\n;; Examples:\n;; >>> (int_to_mini_roman 19)\n;; \"xix\"\n;; >>> (int_to_mini_roman 152)\n;; \"clii\"\n;; >>> (int_to_mini_roman 426)\n;; \"cdxxvi\"\n(define (int_to_mini_roman number)\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "(require rackunit)\n\n(define (test-humaneval) \n\n (let (( candidate int_to_mini_roman))\n (check-equal? (candidate 19) \"xix\")\n (check-equal? (candidate 152) \"clii\")\n (check-equal? (candidate 251) \"ccli\")\n (check-equal? (candidate 426) \"cdxxvi\")\n (check-equal? (candidate 500) \"d\")\n (check-equal? (candidate 1) \"i\")\n (check-equal? (candidate 4) \"iv\")\n (check-equal? (candidate 43) \"xliii\")\n (check-equal? (candidate 90) \"xc\")\n (check-equal? (candidate 94) \"xciv\")\n (check-equal? (candidate 532) \"dxxxii\")\n (check-equal? (candidate 900) \"cm\")\n (check-equal? (candidate 994) \"cmxciv\")\n (check-equal? (candidate 1000) \"m\")\n))\n\n(test-humaneval)", - "stop_tokens": [ - "\n(define ", - "\n#|", - "\n;", - "\n(" - ] - } -] \ No newline at end of file diff --git a/data/rs-keep.json b/data/rs-keep.json deleted file mode 100644 index 1ff114bcd465df86fba2800cfa0a1a968b8ca766..0000000000000000000000000000000000000000 --- a/data/rs-keep.json +++ /dev/null @@ -1,1874 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "rs", - "prompt": "/// For a given number n, find the largest number that divides n evenly, smaller than n\n/// >>> largest_divisor(15)\n/// 5\nfn largest_divisor(n: isize) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = largest_divisor;\n assert_eq!(candidate(3), 1);\n assert_eq!(candidate(7), 1);\n assert_eq!(candidate(10), 5);\n assert_eq!(candidate(100), 50);\n assert_eq!(candidate(49), 7);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_47_median", - "language": "rs", - "prompt": "/// Return median of elements in the list l.\n/// >>> median([3, 1, 2, 4, 5])\n/// 3\n/// >>> median([-10, 4, 6, 1000, 10, 20])\n/// 15.0\nfn median(l: Vec) -> f64 {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = median;\n assert_eq!(candidate(vec![3, 1, 2, 4, 5]), 3.0);\n assert_eq!(candidate(vec![-10, 4, 6, 1000, 10, 20]), 8.0);\n assert_eq!(candidate(vec![5]), 5.0);\n assert_eq!(candidate(vec![6, 5]), 5.5);\n assert_eq!(candidate(vec![8, 1, 3, 9, 9, 2, 7]), 7.0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "rs", - "prompt": "/// Given two lists operator, and operand. The first list has basic algebra operations, and \n/// the second list is a list of integers. Use the two given lists to build the algebric \n/// expression and return the evaluation of this expression.\n/// The basic algebra operations:\n/// Addition ( + ) \n/// Subtraction ( - ) \n/// Multiplication ( * ) \n/// Floor division ( // ) \n/// Exponentiation ( ** ) \n/// Example:\n/// operator['+', '*', '-']\n/// array = [2, 3, 4, 5]\n/// result = 2 + 3 * 4 - 5\n/// => result = 9\n/// Note:\n/// The length of operator list is equal to the length of operand list minus one.\n/// Operand is a list of of non-negative integers.\n/// Operator list has at least one operator, and operand list has at least two operands.\nfn do_algebra(operator: Vec, operand: Vec) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = do_algebra;\n assert_eq!(candidate(vec![String::from(\"**\"), String::from(\"*\"), String::from(\"+\")], vec![2, 3, 4, 5]), 37);\n assert_eq!(candidate(vec![String::from(\"+\"), String::from(\"*\"), String::from(\"-\")], vec![2, 3, 4, 5]), 9);\n assert_eq!(candidate(vec![String::from(\"//\"), String::from(\"*\")], vec![7, 3, 4]), 8);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "rs", - "prompt": "/// Return maximum element in the list.\n/// >>> max_element([1, 2, 3])\n/// 3\n/// >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n/// 123\nfn max_element(l: Vec) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = max_element;\n assert_eq!(candidate(vec![1, 2, 3]), 3);\n assert_eq!(candidate(vec![5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]), 124);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "rs", - "prompt": "/// Create a function which returns the largest index of an element which\n/// is not greater than or equal to the element immediately preceding it. If\n/// no such element exists then return -1. The given array will not contain\n/// duplicate values.\n/// Examples:\n/// can_arrange([1,2,4,3,5]) = 3\n/// can_arrange([1,2,3]) = -1\nfn can_arrange(arr: Vec) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = can_arrange;\n assert_eq!(candidate(vec![1, 2, 4, 3, 5]), 3);\n assert_eq!(candidate(vec![1, 2, 4, 5]), -1);\n assert_eq!(candidate(vec![1, 4, 2, 5, 6, 7, 8, 9, 10]), 2);\n assert_eq!(candidate(vec![4, 8, 5, 7, 3]), 4);\n assert_eq!(candidate(Vec::::new()), -1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "rs", - "prompt": "/// Imagine a road that's a perfectly straight infinitely long line.\n/// n cars are driving left to right; simultaneously, a different set of n cars\n/// are driving right to left. The two sets of cars start out being very far from\n/// each other. All cars move in the same speed. Two cars are said to collide\n/// when a car that's moving left to right hits a car that's moving right to left.\n/// However, the cars are infinitely sturdy and strong; as a result, they continue moving\n/// in their trajectory as if they did not collide.\n/// This function outputs the number of such collisions.\nfn car_race_collision(n: isize) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = car_race_collision;\n assert_eq!(candidate(2), 4);\n assert_eq!(candidate(3), 9);\n assert_eq!(candidate(4), 16);\n assert_eq!(candidate(8), 64);\n assert_eq!(candidate(10), 100);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "rs", - "prompt": "/// Create a function that returns True if the last character\n/// of a given string is an alphabetical character and is not\n/// a part of a word, and False otherwise.\n/// Note: \"word\" is a group of characters separated by space.\n/// Examples:\n/// check_if_last_char_is_a_letter(\"apple pie\") \u279e False\n/// check_if_last_char_is_a_letter(\"apple pi e\") \u279e True\n/// check_if_last_char_is_a_letter(\"apple pi e \") \u279e False\n/// check_if_last_char_is_a_letter(\"\") \u279e False\nfn check_if_last_char_is_a_letter(txt: String) -> bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = check_if_last_char_is_a_letter;\n assert_eq!(candidate(String::from(\"apple\")), false);\n assert_eq!(candidate(String::from(\"apple pi e\")), true);\n assert_eq!(candidate(String::from(\"eeeee\")), false);\n assert_eq!(candidate(String::from(\"A\")), true);\n assert_eq!(candidate(String::from(\"Pumpkin pie \")), false);\n assert_eq!(candidate(String::from(\"Pumpkin pie 1\")), false);\n assert_eq!(candidate(String::from(\"\")), false);\n assert_eq!(candidate(String::from(\"eeeee e \")), false);\n assert_eq!(candidate(String::from(\"apple pie\")), false);\n assert_eq!(candidate(String::from(\"apple pi e \")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "rs", - "prompt": "/// Return true if a given number is prime, and false otherwise.\n/// >>> is_prime(6)\n/// False\n/// >>> is_prime(101)\n/// True\n/// >>> is_prime(11)\n/// True\n/// >>> is_prime(13441)\n/// True\n/// >>> is_prime(61)\n/// True\n/// >>> is_prime(4)\n/// False\n/// >>> is_prime(1)\n/// False\nfn is_prime(n: isize) -> bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = is_prime;\n assert_eq!(candidate(6), false);\n assert_eq!(candidate(101), true);\n assert_eq!(candidate(11), true);\n assert_eq!(candidate(13441), true);\n assert_eq!(candidate(61), true);\n assert_eq!(candidate(4), false);\n assert_eq!(candidate(1), false);\n assert_eq!(candidate(5), true);\n assert_eq!(candidate(11), true);\n assert_eq!(candidate(17), true);\n assert_eq!(candidate(85), false);\n assert_eq!(candidate(77), false);\n assert_eq!(candidate(255379), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "rs", - "prompt": "/// Given a list of positive integers x. return a sorted list of all \n/// elements that hasn't any even digit.\n/// Note: Returned list should be sorted in increasing order.\n/// For example:\n/// >>> unique_digits([15, 33, 1422, 1])\n/// [1, 15, 33]\n/// >>> unique_digits([152, 323, 1422, 10])\n/// []\nfn unique_digits(x: Vec) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = unique_digits;\n assert_eq!(candidate(vec![15, 33, 1422, 1]), vec![1, 15, 33]);\n assert_eq!(candidate(vec![152, 323, 1422, 10]), Vec::::new());\n assert_eq!(candidate(vec![12345, 2033, 111, 151]), vec![111, 151]);\n assert_eq!(candidate(vec![135, 103, 31]), vec![31, 135]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "rs", - "prompt": "/// Input are two strings a and b consisting only of 1s and 0s.\n/// Perform binary XOR on these inputs and return result also as a string.\n/// >>> string_xor('010', '110')\n/// '100'\nfn string_xor(a: String, b: String) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = string_xor;\n assert_eq!(candidate(String::from(\"111000\"), String::from(\"101010\")), String::from(\"010010\"));\n assert_eq!(candidate(String::from(\"1\"), String::from(\"1\")), String::from(\"0\"));\n assert_eq!(candidate(String::from(\"0101\"), String::from(\"0000\")), String::from(\"0101\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "rs", - "prompt": "/// sum_to_n is a function that sums numbers from 1 to n.\n/// >>> sum_to_n(30)\n/// 465\n/// >>> sum_to_n(100)\n/// 5050\n/// >>> sum_to_n(5)\n/// 15\n/// >>> sum_to_n(10)\n/// 55\n/// >>> sum_to_n(1)\n/// 1\nfn sum_to_n(n: isize) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = sum_to_n;\n assert_eq!(candidate(1), 1);\n assert_eq!(candidate(6), 21);\n assert_eq!(candidate(11), 66);\n assert_eq!(candidate(30), 465);\n assert_eq!(candidate(100), 5050);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "rs", - "prompt": "/// Given a list of numbers, return the sum of squares of the numbers\n/// in the list that are odd. Ignore numbers that are negative or not integers.\n/// double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10\n/// double_the_difference([-1, -2, 0]) == 0\n/// double_the_difference([9, -2]) == 81\n/// double_the_difference([0]) == 0 \n/// If the input list is empty, return 0.\nfn double_the_difference(lst: Vec) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = double_the_difference;\n assert_eq!(candidate(Vec::::new()), 0);\n assert_eq!(candidate(vec![5.0, 4.0]), 25);\n assert_eq!(candidate(vec![0.1, 0.2, 0.3]), 0);\n assert_eq!(candidate(vec![-10.0, -20.0, -30.0]), 0);\n assert_eq!(candidate(vec![-1.0, -2.0, 8.0]), 0);\n assert_eq!(candidate(vec![0.2, 3.0, 5.0]), 34);\n assert_eq!(candidate(vec![-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]), 165);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "rs", - "prompt": "/// Return length of given string\n/// >>> strlen('')\n/// 0\n/// >>> strlen('abc')\n/// 3\nfn strlen(string: String) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = strlen;\n assert_eq!(candidate(String::from(\"\")), 0);\n assert_eq!(candidate(String::from(\"x\")), 1);\n assert_eq!(candidate(String::from(\"asdasnakj\")), 9);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "rs", - "prompt": "/// You'll be given a string of words, and your task is to count the number\n/// of boredoms. A boredom is a sentence that starts with the word \"I\".\n/// Sentences are delimited by '.', '?' or '!'.\n/// For example:\n/// >>> is_bored(\"Hello world\")\n/// 0\n/// >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n/// 1\nfn is_bored(S: String) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = is_bored;\n assert_eq!(candidate(String::from(\"Hello world\")), 0);\n assert_eq!(candidate(String::from(\"Is the sky blue?\")), 0);\n assert_eq!(candidate(String::from(\"I love It !\")), 1);\n assert_eq!(candidate(String::from(\"bIt\")), 0);\n assert_eq!(candidate(String::from(\"I feel good today. I will be productive. will kill It\")), 2);\n assert_eq!(candidate(String::from(\"You and I are going for a walk\")), 0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "rs", - "prompt": "/// Write a function vowels_count which takes a string representing\n/// a word as input and returns the number of vowels in the string.\n/// Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n/// vowel, but only when it is at the end of the given word.\n/// Example:\n/// >>> vowels_count(\"abcde\")\n/// 2\n/// >>> vowels_count(\"ACEDY\")\n/// 3\nfn vowels_count(s: String) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = vowels_count;\n assert_eq!(candidate(String::from(\"abcde\")), 2);\n assert_eq!(candidate(String::from(\"Alone\")), 3);\n assert_eq!(candidate(String::from(\"key\")), 2);\n assert_eq!(candidate(String::from(\"bye\")), 1);\n assert_eq!(candidate(String::from(\"keY\")), 2);\n assert_eq!(candidate(String::from(\"bYe\")), 1);\n assert_eq!(candidate(String::from(\"ACEDY\")), 3);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "rs", - "prompt": "/// Return n-th Fibonacci number.\n/// >>> fib(10)\n/// 55\n/// >>> fib(1)\n/// 1\n/// >>> fib(8)\n/// 21\nfn fib(n: isize) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = fib;\n assert_eq!(candidate(10), 55);\n assert_eq!(candidate(1), 1);\n assert_eq!(candidate(8), 21);\n assert_eq!(candidate(11), 89);\n assert_eq!(candidate(12), 144);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "rs", - "prompt": "/// Your task is to implement a function that will simplify the expression\n/// x * n. The function returns True if x * n evaluates to a whole number and False\n/// otherwise. Both x and n, are string representation of a fraction, and have the following format,\n/// / where both numerator and denominator are positive whole numbers.\n/// You can assume that x, and n are valid fractions, and do not have zero as denominator.\n/// simplify(\"1/5\", \"5/1\") = True\n/// simplify(\"1/6\", \"2/1\") = False\n/// simplify(\"7/10\", \"10/2\") = False\nfn simplify(x: String, n: String) -> bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = simplify;\n assert_eq!(candidate(String::from(\"1/5\"), String::from(\"5/1\")), true);\n assert_eq!(candidate(String::from(\"1/6\"), String::from(\"2/1\")), false);\n assert_eq!(candidate(String::from(\"5/1\"), String::from(\"3/1\")), true);\n assert_eq!(candidate(String::from(\"7/10\"), String::from(\"10/2\")), false);\n assert_eq!(candidate(String::from(\"2/10\"), String::from(\"50/10\")), true);\n assert_eq!(candidate(String::from(\"7/2\"), String::from(\"4/2\")), true);\n assert_eq!(candidate(String::from(\"11/6\"), String::from(\"6/1\")), true);\n assert_eq!(candidate(String::from(\"2/3\"), String::from(\"5/2\")), false);\n assert_eq!(candidate(String::from(\"5/2\"), String::from(\"3/5\")), false);\n assert_eq!(candidate(String::from(\"2/4\"), String::from(\"8/4\")), true);\n assert_eq!(candidate(String::from(\"2/4\"), String::from(\"4/2\")), true);\n assert_eq!(candidate(String::from(\"1/5\"), String::from(\"5/1\")), true);\n assert_eq!(candidate(String::from(\"1/5\"), String::from(\"1/5\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "rs", - "prompt": "/// Given a string s, count the number of uppercase vowels in even indices.\n/// For example:\n/// count_upper('aBCdEf') returns 1\n/// count_upper('abcdefg') returns 0\n/// count_upper('dBBE') returns 0\nfn count_upper(s: String) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = count_upper;\n assert_eq!(candidate(String::from(\"aBCdEf\")), 1);\n assert_eq!(candidate(String::from(\"abcdefg\")), 0);\n assert_eq!(candidate(String::from(\"dBBE\")), 0);\n assert_eq!(candidate(String::from(\"B\")), 0);\n assert_eq!(candidate(String::from(\"U\")), 1);\n assert_eq!(candidate(String::from(\"\")), 0);\n assert_eq!(candidate(String::from(\"EEEE\")), 2);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "rs", - "prompt": "/// You are given a rectangular grid of wells. Each row represents a single well,\n/// and each 1 in a row represents a single unit of water.\n/// Each well has a corresponding bucket that can be used to extract water from it, \n/// and all buckets have the same capacity.\n/// Your task is to use the buckets to empty the wells.\n/// Output the number of times you need to lower the buckets.\n/// Example 1:\n/// Input: \n/// grid : [[0,0,1,0], [0,1,0,0], [1,1,1,1]]\n/// bucket_capacity : 1\n/// Output: 6\n/// Example 2:\n/// Input: \n/// grid : [[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]]\n/// bucket_capacity : 2\n/// Output: 5\n/// Example 3:\n/// Input: \n/// grid : [[0,0,0], [0,0,0]]\n/// bucket_capacity : 5\n/// Output: 0\n/// Constraints:\n/// * all wells have the same length\n/// * 1 <= grid.length <= 10^2\n/// * 1 <= grid[:,1].length <= 10^2\n/// * grid[i][j] -> 0 | 1\n/// * 1 <= capacity <= 10\nfn max_fill(grid: Vec>, capacity: isize) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = max_fill;\n assert_eq!(candidate(vec![vec![0, 0, 1, 0], vec![0, 1, 0, 0], vec![1, 1, 1, 1]], 1), 6);\n assert_eq!(candidate(vec![vec![0, 0, 1, 1], vec![0, 0, 0, 0], vec![1, 1, 1, 1], vec![0, 1, 1, 1]], 2), 5);\n assert_eq!(candidate(vec![vec![0, 0, 0], vec![0, 0, 0]], 5), 0);\n assert_eq!(candidate(vec![vec![1, 1, 1, 1], vec![1, 1, 1, 1]], 2), 4);\n assert_eq!(candidate(vec![vec![1, 1, 1, 1], vec![1, 1, 1, 1]], 9), 2);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "rs", - "prompt": "/// Given an array arr of integers and a positive integer k, return a sorted list \n/// of length k with the maximum k numbers in arr.\n/// Example 1:\n/// Input: arr = [-3, -4, 5], k = 3\n/// Output: [-4, -3, 5]\n/// Example 2:\n/// Input: arr = [4, -4, 4], k = 2\n/// Output: [4, 4]\n/// Example 3:\n/// Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1\n/// Output: [2]\n/// Note:\n/// 1. The length of the array will be in the range of [1, 1000].\n/// 2. The elements in the array will be in the range of [-1000, 1000].\n/// 3. 0 <= k <= len(arr)\nfn maximum(arr: Vec, k: isize) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = maximum;\n assert_eq!(candidate(vec![-3, -4, 5], 3), vec![-4, -3, 5]);\n assert_eq!(candidate(vec![4, -4, 4], 2), vec![4, 4]);\n assert_eq!(candidate(vec![-3, 2, 1, 2, -1, -2, 1], 1), vec![2]);\n assert_eq!(candidate(vec![123, -123, 20, 0, 1, 2, -3], 3), vec![2, 20, 123]);\n assert_eq!(candidate(vec![-123, 20, 0, 1, 2, -3], 4), vec![0, 1, 2, 20]);\n assert_eq!(candidate(vec![5, 15, 0, 3, -13, -8, 0], 7), vec![-13, -8, 0, 0, 3, 5, 15]);\n assert_eq!(candidate(vec![-1, 0, 2, 5, 3, -10], 2), vec![3, 5]);\n assert_eq!(candidate(vec![1, 0, 5, -7], 1), vec![5]);\n assert_eq!(candidate(vec![4, -4], 2), vec![-4, 4]);\n assert_eq!(candidate(vec![-10, 10], 2), vec![-10, 10]);\n assert_eq!(candidate(vec![1, 2, 3, -23, 243, -400, 0], 0), Vec::::new());\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "rs", - "prompt": "/// Write a function that takes a message, and encodes in such a \n/// way that it swaps case of all letters, replaces all vowels in \n/// the message with the letter that appears 2 places ahead of that \n/// vowel in the english alphabet. \n/// Assume only letters. \n/// Examples:\n/// >>> encode('test')\n/// 'TGST'\n/// >>> encode('This is a message')\n/// 'tHKS KS C MGSSCGG'\nfn encode(message: String) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = encode;\n assert_eq!(candidate(String::from(\"TEST\")), String::from(\"tgst\"));\n assert_eq!(candidate(String::from(\"Mudasir\")), String::from(\"mWDCSKR\"));\n assert_eq!(candidate(String::from(\"YES\")), String::from(\"ygs\"));\n assert_eq!(candidate(String::from(\"This is a message\")), String::from(\"tHKS KS C MGSSCGG\"));\n assert_eq!(candidate(String::from(\"I DoNt KnOw WhAt tO WrItE\")), String::from(\"k dQnT kNqW wHcT Tq wRkTg\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "rs", - "prompt": "/// remove_vowels is a function that takes string and returns string without vowels.\n/// >>> remove_vowels('')\n/// ''\n/// >>> remove_vowels('abcdef')\n/// 'bcdf'\n/// >>> remove_vowels('aaaaa')\n/// ''\n/// >>> remove_vowels('aaBAA')\n/// 'B'\n/// >>> remove_vowels('zbcd')\n/// 'zbcd'\nfn remove_vowels(text: String) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = remove_vowels;\n assert_eq!(candidate(String::from(\"\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"abcdef\nghijklm\")), String::from(\"bcdf\nghjklm\"));\n assert_eq!(candidate(String::from(\"fedcba\")), String::from(\"fdcb\"));\n assert_eq!(candidate(String::from(\"eeeee\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"acBAA\")), String::from(\"cB\"));\n assert_eq!(candidate(String::from(\"EcBOO\")), String::from(\"cB\"));\n assert_eq!(candidate(String::from(\"ybcd\")), String::from(\"ybcd\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "rs", - "prompt": "/// Return only positive numbers in the list.\n/// >>> get_positive([-1, 2, -4, 5, 6])\n/// [2, 5, 6]\n/// >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n/// [5, 3, 2, 3, 9, 123, 1]\nfn get_positive(l: Vec) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = get_positive;\n assert_eq!(candidate(vec![-1, -2, 4, 5, 6]), vec![4, 5, 6]);\n assert_eq!(candidate(vec![5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]), vec![5, 3, 2, 3, 3, 9, 123, 1]);\n assert_eq!(candidate(vec![-1, -2]), Vec::::new());\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "rs", - "prompt": "/// Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n/// >>> string_sequence(0)\n/// '0'\n/// >>> string_sequence(5)\n/// '0 1 2 3 4 5'\nfn string_sequence(n: isize) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = string_sequence;\n assert_eq!(candidate(0), String::from(\"0\"));\n assert_eq!(candidate(3), String::from(\"0 1 2 3\"));\n assert_eq!(candidate(10), String::from(\"0 1 2 3 4 5 6 7 8 9 10\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "rs", - "prompt": "/// Given a positive integer n, you have to make a pile of n levels of stones.\n/// The first level has n stones.\n/// The number of stones in the next level is:\n/// - the next odd number if n is odd.\n/// - the next even number if n is even.\n/// Return the number of stones in each level in a list, where element at index\n/// i represents the number of stones in the level (i+1).\n/// Examples:\n/// >>> make_a_pile(3)\n/// [3, 5, 7]\nfn make_a_pile(n: isize) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = make_a_pile;\n assert_eq!(candidate(3), vec![3, 5, 7]);\n assert_eq!(candidate(4), vec![4, 6, 8, 10]);\n assert_eq!(candidate(5), vec![5, 7, 9, 11, 13]);\n assert_eq!(candidate(6), vec![6, 8, 10, 12, 14, 16]);\n assert_eq!(candidate(8), vec![8, 10, 12, 14, 16, 18, 20, 22]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "rs", - "prompt": "/// Task\n/// 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\n/// then check if the result string is palindrome.\n/// A string is called palindrome if it reads the same backward as forward.\n/// You should return a tuple containing the result string and True/False for the check.\n/// Example\n/// For s = \"abcde\", c = \"ae\", the result should be ('bcd',False)\n/// For s = \"abcdef\", c = \"b\" the result should be ('acdef',False)\n/// For s = \"abcdedcba\", c = \"ab\", the result should be ('cdedc',True)\nfn reverse_delete(s: String, c: String) -> (String, bool) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = reverse_delete;\n assert_eq!(candidate(String::from(\"abcde\"), String::from(\"ae\")), (String::from(\"bcd\"), false));\n assert_eq!(candidate(String::from(\"abcdef\"), String::from(\"b\")), (String::from(\"acdef\"), false));\n assert_eq!(candidate(String::from(\"abcdedcba\"), String::from(\"ab\")), (String::from(\"cdedc\"), true));\n assert_eq!(candidate(String::from(\"dwik\"), String::from(\"w\")), (String::from(\"dik\"), false));\n assert_eq!(candidate(String::from(\"a\"), String::from(\"a\")), (String::from(\"\"), true));\n assert_eq!(candidate(String::from(\"abcdedcba\"), String::from(\"\")), (String::from(\"abcdedcba\"), true));\n assert_eq!(candidate(String::from(\"abcdedcba\"), String::from(\"v\")), (String::from(\"abcdedcba\"), true));\n assert_eq!(candidate(String::from(\"vabba\"), String::from(\"v\")), (String::from(\"abba\"), true));\n assert_eq!(candidate(String::from(\"mamma\"), String::from(\"mia\")), (String::from(\"\"), true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "rs", - "prompt": "/// For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n/// >>> flip_case('Hello')\n/// 'hELLO'\nfn flip_case(string: String) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = flip_case;\n assert_eq!(candidate(String::from(\"\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"Hello!\")), String::from(\"hELLO!\"));\n assert_eq!(candidate(String::from(\"These violent delights have violent ends\")), String::from(\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "rs", - "prompt": "/// You are given a string s.\n/// if s[i] is a letter, reverse its case from lower to upper or vise versa, \n/// otherwise keep it as it is.\n/// If the string contains no letters, reverse the string.\n/// The function should return the resulted string.\n/// Examples\n/// solve(\"1234\") = \"4321\"\n/// solve(\"ab\") = \"AB\"\n/// solve(\"#a@C\") = \"#A@c\"\nfn solve(s: String) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = solve;\n assert_eq!(candidate(String::from(\"AsDf\")), String::from(\"aSdF\"));\n assert_eq!(candidate(String::from(\"1234\")), String::from(\"4321\"));\n assert_eq!(candidate(String::from(\"ab\")), String::from(\"AB\"));\n assert_eq!(candidate(String::from(\"#a@C\")), String::from(\"#A@c\"));\n assert_eq!(candidate(String::from(\"#AsdfW^45\")), String::from(\"#aSDFw^45\"));\n assert_eq!(candidate(String::from(\"#6@2\")), String::from(\"2@6#\"));\n assert_eq!(candidate(String::from(\"#$a^D\")), String::from(\"#$A^d\"));\n assert_eq!(candidate(String::from(\"#ccc\")), String::from(\"#CCC\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "rs", - "prompt": "/// Filter an input list of strings only for ones that start with a given prefix.\n/// >>> filter_by_prefix([], 'a')\n/// []\n/// >>> filter_by_prefix(['abc', 'bcd', 'cde', 'array'], 'a')\n/// ['abc', 'array']\nfn filter_by_prefix(strings: Vec, prefix: String) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = filter_by_prefix;\n assert_eq!(candidate(Vec::::new(), String::from(\"john\")), Vec::::new());\n assert_eq!(candidate(vec![String::from(\"xxx\"), String::from(\"asd\"), String::from(\"xxy\"), String::from(\"john doe\"), String::from(\"xxxAAA\"), String::from(\"xxx\")], String::from(\"xxx\")), vec![String::from(\"xxx\"), String::from(\"xxxAAA\"), String::from(\"xxx\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "rs", - "prompt": "/// This function takes two positive numbers x and y and returns the\n/// biggest even integer number that is in the range [x, y] inclusive. If \n/// there's no such number, then the function should return -1.\n/// For example:\n/// choose_num(12, 15) = 14\n/// choose_num(13, 12) = -1\nfn choose_num(x: isize, y: isize) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = choose_num;\n assert_eq!(candidate(12, 15), 14);\n assert_eq!(candidate(13, 12), -1);\n assert_eq!(candidate(33, 12354), 12354);\n assert_eq!(candidate(5234, 5233), -1);\n assert_eq!(candidate(6, 29), 28);\n assert_eq!(candidate(27, 10), -1);\n assert_eq!(candidate(7, 7), -1);\n assert_eq!(candidate(546, 546), 546);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "rs", - "prompt": "/// You are given a string representing a sentence,\n/// the sentence contains some words separated by a space,\n/// and you have to return a string that contains the words from the original sentence,\n/// whose lengths are prime numbers,\n/// the order of the words in the new string should be the same as the original one.\n/// Example 1:\n/// Input: sentence = \"This is a test\"\n/// Output: \"is\"\n/// Example 2:\n/// Input: sentence = \"lets go for swimming\"\n/// Output: \"go for\"\n/// Constraints:\n/// * 1 <= len(sentence) <= 100\n/// * sentence contains only letters\nfn words_in_sentence(sentence: String) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = words_in_sentence;\n assert_eq!(candidate(String::from(\"This is a test\")), String::from(\"is\"));\n assert_eq!(candidate(String::from(\"lets go for swimming\")), String::from(\"go for\"));\n assert_eq!(candidate(String::from(\"there is no place available here\")), String::from(\"there is no place\"));\n assert_eq!(candidate(String::from(\"Hi I am Hussein\")), String::from(\"Hi am Hussein\"));\n assert_eq!(candidate(String::from(\"go for it\")), String::from(\"go for it\"));\n assert_eq!(candidate(String::from(\"here\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"here is\")), String::from(\"is\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "rs", - "prompt": "/// Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n/// >>> intersperse([], 4)\n/// []\n/// >>> intersperse([1, 2, 3], 4)\n/// [1, 4, 2, 4, 3]\nfn intersperse(numbers: Vec, delimeter: isize) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = intersperse;\n assert_eq!(candidate(Vec::::new(), 7), Vec::::new());\n assert_eq!(candidate(vec![5, 6, 3, 2], 8), vec![5, 8, 6, 8, 3, 8, 2]);\n assert_eq!(candidate(vec![2, 2, 2], 2), vec![2, 2, 2, 2, 2]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "rs", - "prompt": "/// Your task is to write a function that returns true if a number x is a simple\n/// power of n and false in other cases.\n/// x is a simple power of n if n**int=x\n/// For example:\n/// is_simple_power(1, 4) => true\n/// is_simple_power(2, 2) => true\n/// is_simple_power(8, 2) => true\n/// is_simple_power(3, 2) => false\n/// is_simple_power(3, 1) => false\n/// is_simple_power(5, 3) => false\nfn is_simple_power(x: isize, n: isize) -> bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = is_simple_power;\n assert_eq!(candidate(16, 2), true);\n assert_eq!(candidate(143214, 16), false);\n assert_eq!(candidate(4, 2), true);\n assert_eq!(candidate(9, 3), true);\n assert_eq!(candidate(16, 4), true);\n assert_eq!(candidate(24, 2), false);\n assert_eq!(candidate(128, 4), false);\n assert_eq!(candidate(12, 6), false);\n assert_eq!(candidate(1, 1), true);\n assert_eq!(candidate(1, 12), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "rs", - "prompt": "/// Write a function that returns true if the given number is the multiplication of 3 prime numbers\n/// and false otherwise.\n/// Knowing that (a) is less then 100. \n/// Example:\n/// is_multiply_prime(30) == True\n/// 30 = 2 * 3 * 5\nfn is_multiply_prime(a: isize) -> bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = is_multiply_prime;\n assert_eq!(candidate(5), false);\n assert_eq!(candidate(30), true);\n assert_eq!(candidate(8), true);\n assert_eq!(candidate(10), false);\n assert_eq!(candidate(125), true);\n assert_eq!(candidate(105), true);\n assert_eq!(candidate(126), false);\n assert_eq!(candidate(729), false);\n assert_eq!(candidate(891), false);\n assert_eq!(candidate(1001), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "rs", - "prompt": "/// Given the lengths of the three sides of a triangle. Return True if the three\n/// sides form a right-angled triangle, False otherwise.\n/// A right-angled triangle is a triangle in which one angle is right angle or \n/// 90 degree.\n/// Example:\n/// right_angle_triangle(3, 4, 5) == True\n/// right_angle_triangle(1, 2, 3) == False\nfn right_angle_triangle(a: isize, b: isize, c: isize) -> bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = right_angle_triangle;\n assert_eq!(candidate(3, 4, 5), true);\n assert_eq!(candidate(1, 2, 3), false);\n assert_eq!(candidate(10, 6, 8), true);\n assert_eq!(candidate(2, 2, 2), false);\n assert_eq!(candidate(7, 24, 25), true);\n assert_eq!(candidate(10, 5, 7), false);\n assert_eq!(candidate(5, 12, 13), true);\n assert_eq!(candidate(15, 8, 17), true);\n assert_eq!(candidate(48, 55, 73), true);\n assert_eq!(candidate(1, 1, 1), false);\n assert_eq!(candidate(2, 2, 10), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "rs", - "prompt": "/// Create a function that takes 3 numbers.\n/// Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n/// Returns false in any other cases.\n/// Examples\n/// any_int(5, 2, 7) \u279e True\n/// any_int(3, 2, 2) \u279e False\n/// any_int(3, -2, 1) \u279e True\n/// any_int(3.6, -2.2, 2) \u279e False\nfn any_int(x: f64, y: f64, z: f64) -> bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = any_int;\n assert_eq!(candidate(2.0, 3.0, 1.0), true);\n assert_eq!(candidate(2.5, 2.0, 3.0), false);\n assert_eq!(candidate(1.5, 5.0, 3.5), false);\n assert_eq!(candidate(2.0, 6.0, 2.0), false);\n assert_eq!(candidate(4.0, 2.0, 2.0), true);\n assert_eq!(candidate(2.2, 2.2, 2.2), false);\n assert_eq!(candidate(-4.0, 6.0, 2.0), true);\n assert_eq!(candidate(2.0, 1.0, 1.0), true);\n assert_eq!(candidate(3.0, 4.0, 7.0), true);\n assert_eq!(candidate(3.0, 4.0, 7.0), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "rs", - "prompt": "/// This function takes a list l and returns a list l' such that\n/// l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n/// to the values of the corresponding indicies of l, but sorted.\n/// >>> sort_third([1, 2, 3])\n/// [1, 2, 3]\n/// >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n/// [2, 6, 3, 4, 8, 9, 5]\nfn sort_third(l: Vec) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = sort_third;\n assert_eq!(candidate(vec![5, 6, 3, 4, 8, 9, 2]), vec![2, 6, 3, 4, 8, 9, 5]);\n assert_eq!(candidate(vec![5, 8, 3, 4, 6, 9, 2]), vec![2, 8, 3, 4, 6, 9, 5]);\n assert_eq!(candidate(vec![5, 6, 9, 4, 8, 3, 2]), vec![2, 6, 9, 4, 8, 3, 5]);\n assert_eq!(candidate(vec![5, 6, 3, 4, 8, 9, 2, 1]), vec![2, 6, 3, 4, 8, 9, 5, 1]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_53_add", - "language": "rs", - "prompt": "/// Add two numbers x and y\n/// >>> add(2, 3)\n/// 5\n/// >>> add(5, 7)\n/// 12\nfn add(x: isize, y: isize) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = add;\n assert_eq!(candidate(0, 1), 1);\n assert_eq!(candidate(1, 0), 1);\n assert_eq!(candidate(2, 3), 5);\n assert_eq!(candidate(5, 7), 12);\n assert_eq!(candidate(7, 5), 12);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_69_search", - "language": "rs", - "prompt": "/// You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n/// zero, and has a frequency greater than or equal to the value of the integer itself. \n/// The frequency of an integer is the number of times it appears in the list.\n/// If no such a value exist, return -1.\n/// Examples:\n/// search([4, 1, 2, 2, 3, 1]) == 2\n/// search([1, 2, 2, 3, 3, 3, 4, 4, 4]) == 3\n/// search([5, 5, 4, 4, 4]) == -1\nfn search(lst: Vec) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = search;\n assert_eq!(candidate(vec![5, 5, 5, 5, 1]), 1);\n assert_eq!(candidate(vec![4, 1, 4, 1, 4, 4]), 4);\n assert_eq!(candidate(vec![3, 3]), -1);\n assert_eq!(candidate(vec![8, 8, 8, 8, 8, 8, 8, 8]), 8);\n assert_eq!(candidate(vec![2, 3, 3, 2, 2]), 2);\n assert_eq!(candidate(vec![2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]), 1);\n assert_eq!(candidate(vec![3, 2, 8, 2]), 2);\n assert_eq!(candidate(vec![6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]), 1);\n assert_eq!(candidate(vec![8, 8, 3, 6, 5, 6, 4]), -1);\n assert_eq!(candidate(vec![6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]), 1);\n assert_eq!(candidate(vec![1, 9, 10, 1, 3]), 1);\n assert_eq!(candidate(vec![6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]), 5);\n assert_eq!(candidate(vec![1]), 1);\n assert_eq!(candidate(vec![8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]), 4);\n assert_eq!(candidate(vec![2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]), 2);\n assert_eq!(candidate(vec![1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]), 1);\n assert_eq!(candidate(vec![9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]), 4);\n assert_eq!(candidate(vec![2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]), 4);\n assert_eq!(candidate(vec![9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]), 2);\n assert_eq!(candidate(vec![5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]), -1);\n assert_eq!(candidate(vec![10]), -1);\n assert_eq!(candidate(vec![9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]), 2);\n assert_eq!(candidate(vec![5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]), 1);\n assert_eq!(candidate(vec![7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]), 1);\n assert_eq!(candidate(vec![3, 10, 10, 9, 2]), -1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "rs", - "prompt": "/// Write a function that takes a string and returns True if the string\n/// length is a prime number or False otherwise\n/// Examples\n/// prime_length('Hello') == True\n/// prime_length('abcdcba') == True\n/// prime_length('kittens') == True\n/// prime_length('orange') == False\nfn prime_length(string: String) -> bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = prime_length;\n assert_eq!(candidate(String::from(\"Hello\")), true);\n assert_eq!(candidate(String::from(\"abcdcba\")), true);\n assert_eq!(candidate(String::from(\"kittens\")), true);\n assert_eq!(candidate(String::from(\"orange\")), false);\n assert_eq!(candidate(String::from(\"wow\")), true);\n assert_eq!(candidate(String::from(\"world\")), true);\n assert_eq!(candidate(String::from(\"MadaM\")), true);\n assert_eq!(candidate(String::from(\"Wow\")), true);\n assert_eq!(candidate(String::from(\"\")), false);\n assert_eq!(candidate(String::from(\"HI\")), true);\n assert_eq!(candidate(String::from(\"go\")), true);\n assert_eq!(candidate(String::from(\"gogo\")), false);\n assert_eq!(candidate(String::from(\"aaaaaaaaaaaaaaa\")), false);\n assert_eq!(candidate(String::from(\"Madam\")), true);\n assert_eq!(candidate(String::from(\"M\")), false);\n assert_eq!(candidate(String::from(\"0\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_58_common", - "language": "rs", - "prompt": "/// Return sorted unique common elements for two lists.\n/// >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n/// [1, 5, 653]\n/// >>> common([5, 3, 2, 8], [3, 2])\n/// [2, 3]\nfn common(l1: Vec, l2: Vec) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = common;\n assert_eq!(candidate(vec![1, 4, 3, 34, 653, 2, 5], vec![5, 7, 1, 5, 9, 653, 121]), vec![1, 5, 653]);\n assert_eq!(candidate(vec![5, 3, 2, 8], vec![3, 2]), vec![2, 3]);\n assert_eq!(candidate(vec![4, 3, 2, 8], vec![3, 2, 4]), vec![2, 3, 4]);\n assert_eq!(candidate(vec![4, 3, 2, 8], Vec::::new()), Vec::::new());\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "rs", - "prompt": "/// The Brazilian factorial is defined as:\n/// brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n/// where n > 0\n/// For example:\n/// >>> special_factorial(4)\n/// 288\n/// The function will receive an integer as input and should return the special\n/// factorial of this integer.\nfn special_factorial(n: isize) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = special_factorial;\n assert_eq!(candidate(4), 288);\n assert_eq!(candidate(5), 34560);\n assert_eq!(candidate(7), 125411328000);\n assert_eq!(candidate(1), 1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "rs", - "prompt": "/// In this problem, you will implement a function that takes two lists of numbers,\n/// and determines whether it is possible to perform an exchange of elements\n/// between them to make lst1 a list of only even numbers.\n/// There is no limit on the number of exchanged elements between lst1 and lst2.\n/// If it is possible to exchange elements between the lst1 and lst2 to make\n/// all the elements of lst1 to be even, return \"YES\".\n/// Otherwise, return \"NO\".\n/// For example:\n/// exchange([1, 2, 3, 4], [1, 2, 3, 4]) => \"YES\"\n/// exchange([1, 2, 3, 4], [1, 5, 3, 4]) => \"NO\"\n/// It is assumed that the input lists will be non-empty.\nfn exchange(lst1: Vec, lst2: Vec) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = exchange;\n assert_eq!(candidate(vec![1, 2, 3, 4], vec![1, 2, 3, 4]), String::from(\"YES\"));\n assert_eq!(candidate(vec![1, 2, 3, 4], vec![1, 5, 3, 4]), String::from(\"NO\"));\n assert_eq!(candidate(vec![1, 2, 3, 4], vec![2, 1, 4, 3]), String::from(\"YES\"));\n assert_eq!(candidate(vec![5, 7, 3], vec![2, 6, 4]), String::from(\"YES\"));\n assert_eq!(candidate(vec![5, 7, 3], vec![2, 6, 3]), String::from(\"NO\"));\n assert_eq!(candidate(vec![3, 2, 6, 1, 8, 9], vec![3, 5, 5, 1, 1, 1]), String::from(\"NO\"));\n assert_eq!(candidate(vec![100, 200], vec![200, 200]), String::from(\"YES\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "rs", - "prompt": "/// Given a non-empty array of integers arr and an integer k, return\n/// the sum of the elements with at most two digits from the first k elements of arr.\n/// Example:\n/// Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4\n/// Output: 24 # sum of 21 + 3\n/// Constraints:\n/// 1. 1 <= len(arr) <= 100\n/// 2. 1 <= k <= len(arr)\nfn add_elements(arr: Vec, k: isize) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = add_elements;\n assert_eq!(candidate(vec![1, -2, -3, 41, 57, 76, 87, 88, 99], 3), -4);\n assert_eq!(candidate(vec![111, 121, 3, 4000, 5, 6], 2), 0);\n assert_eq!(candidate(vec![11, 21, 3, 90, 5, 6, 7, 8, 9], 4), 125);\n assert_eq!(candidate(vec![111, 21, 3, 4000, 5, 6, 7, 8, 9], 4), 24);\n assert_eq!(candidate(vec![1], 1), 1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "rs", - "prompt": "/// A simple program which should return the value of x if n is \n/// a prime number and should return the value of y otherwise.\n/// Examples:\n/// for x_or_y(7, 34, 12) == 34\n/// for x_or_y(15, 8, 5) == 5\nfn x_or_y(n: isize, x: isize, y: isize) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = x_or_y;\n assert_eq!(candidate(7, 34, 12), 34);\n assert_eq!(candidate(15, 8, 5), 5);\n assert_eq!(candidate(3, 33, 5212), 33);\n assert_eq!(candidate(1259, 3, 52), 3);\n assert_eq!(candidate(7919, -1, 12), -1);\n assert_eq!(candidate(3609, 1245, 583), 583);\n assert_eq!(candidate(91, 56, 129), 129);\n assert_eq!(candidate(6, 34, 1234), 1234);\n assert_eq!(candidate(1, 2, 0), 0);\n assert_eq!(candidate(2, 2, 0), 2);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "rs", - "prompt": "/// Given length of a side and high return area for a triangle.\n/// >>> triangle_area(5, 3)\n/// 7.5\nfn triangle_area(a: isize, h: isize) -> f64 {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = triangle_area;\n assert_eq!(candidate(5, 3), 7.5);\n assert_eq!(candidate(2, 2), 2.0);\n assert_eq!(candidate(10, 8), 40.0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "rs", - "prompt": "/// Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n/// the last couple centuries. However, what people don't know is Tribonacci sequence.\n/// Tribonacci sequence is defined by the recurrence:\n/// tri(1) = 3\n/// tri(n) = 1 + n / 2, if n is even.\n/// tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n/// For example:\n/// tri(2) = 1 + (2 / 2) = 2\n/// tri(4) = 3\n/// tri(3) = tri(2) + tri(1) + tri(4)\n/// = 2 + 3 + 3 = 8 \n/// You are given a non-negative integer number n, you have to a return a list of the \n/// first n + 1 numbers of the Tribonacci sequence.\n/// Examples:\n/// tri(3) = [1, 3, 2, 8]\nfn tri(n: isize) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = tri;\n assert_eq!(candidate(3), vec![1, 3, 2, 8]);\n assert_eq!(candidate(4), vec![1, 3, 2, 8, 3]);\n assert_eq!(candidate(5), vec![1, 3, 2, 8, 3, 15]);\n assert_eq!(candidate(6), vec![1, 3, 2, 8, 3, 15, 4]);\n assert_eq!(candidate(7), vec![1, 3, 2, 8, 3, 15, 4, 24]);\n assert_eq!(candidate(8), vec![1, 3, 2, 8, 3, 15, 4, 24, 5]);\n assert_eq!(candidate(9), vec![1, 3, 2, 8, 3, 15, 4, 24, 5, 35]);\n assert_eq!(candidate(20), vec![1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11]);\n assert_eq!(candidate(0), vec![1]);\n assert_eq!(candidate(1), vec![1, 3]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "rs", - "prompt": "/// You are given a list of two strings, both strings consist of open\n/// parentheses '(' or close parentheses ')' only.\n/// Your job is to check if it is possible to concatenate the two strings in\n/// some order, that the resulting string will be good.\n/// A string S is considered to be good if and only if all parentheses in S\n/// are balanced. For example: the string '(())()' is good, while the string\n/// '())' is not.\n/// Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n/// Examples:\n/// match_parens(['()(', ')']) == 'Yes'\n/// match_parens([')', ')']) == 'No'\nfn match_parens(lst: Vec) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = match_parens;\n assert_eq!(candidate(vec![String::from(\"()(\"), String::from(\")\")]), String::from(\"Yes\"));\n assert_eq!(candidate(vec![String::from(\")\"), String::from(\")\")]), String::from(\"No\"));\n assert_eq!(candidate(vec![String::from(\"(()(())\"), String::from(\"())())\")]), String::from(\"No\"));\n assert_eq!(candidate(vec![String::from(\")())\"), String::from(\"(()()(\")]), String::from(\"Yes\"));\n assert_eq!(candidate(vec![String::from(\"(())))\"), String::from(\"(()())((\")]), String::from(\"Yes\"));\n assert_eq!(candidate(vec![String::from(\"()\"), String::from(\"())\")]), String::from(\"No\"));\n assert_eq!(candidate(vec![String::from(\"(()(\"), String::from(\"()))()\")]), String::from(\"Yes\"));\n assert_eq!(candidate(vec![String::from(\"((((\"), String::from(\"((())\")]), String::from(\"No\"));\n assert_eq!(candidate(vec![String::from(\")(()\"), String::from(\"(()(\")]), String::from(\"No\"));\n assert_eq!(candidate(vec![String::from(\")(\"), String::from(\")(\")]), String::from(\"No\"));\n assert_eq!(candidate(vec![String::from(\"(\"), String::from(\")\")]), String::from(\"Yes\"));\n assert_eq!(candidate(vec![String::from(\")\"), String::from(\"(\")]), String::from(\"Yes\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "rs", - "prompt": "/// From a list of integers, remove all elements that occur more than once.\n/// Keep order of elements left the same as in the input.\n/// >>> remove_duplicates([1, 2, 3, 2, 4])\n/// [1, 3, 4]\nfn remove_duplicates(numbers: Vec) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = remove_duplicates;\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![1, 2, 3, 4]), vec![1, 2, 3, 4]);\n assert_eq!(candidate(vec![1, 2, 3, 2, 4, 3, 5]), vec![1, 4, 5]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "rs", - "prompt": "/// Return a greatest common divisor of two integers a and b\n/// >>> greatest_common_divisor(3, 5)\n/// 1\n/// >>> greatest_common_divisor(25, 15)\n/// 5\nfn greatest_common_divisor(a: isize, b: isize) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = greatest_common_divisor;\n assert_eq!(candidate(3, 7), 1);\n assert_eq!(candidate(10, 15), 5);\n assert_eq!(candidate(49, 14), 7);\n assert_eq!(candidate(144, 60), 12);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "rs", - "prompt": "/// Checks if given string is a palindrome\n/// >>> is_palindrome('')\n/// True\n/// >>> is_palindrome('aba')\n/// True\n/// >>> is_palindrome('aaaaa')\n/// True\n/// >>> is_palindrome('zbcd')\n/// False\nfn is_palindrome(text: String) -> bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = is_palindrome;\n assert_eq!(candidate(String::from(\"\")), true);\n assert_eq!(candidate(String::from(\"aba\")), true);\n assert_eq!(candidate(String::from(\"aaaaa\")), true);\n assert_eq!(candidate(String::from(\"zbcd\")), false);\n assert_eq!(candidate(String::from(\"xywyx\")), true);\n assert_eq!(candidate(String::from(\"xywyz\")), false);\n assert_eq!(candidate(String::from(\"xywzx\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "rs", - "prompt": "/// xs represent coefficients of a polynomial.\n/// xs[0] + xs[1] * x + xs[2] * x^2 + ....\n/// Return derivative of this polynomial in the same form.\n/// >>> derivative([3, 1, 2, 4, 5])\n/// [1, 4, 12, 20]\n/// >>> derivative([1, 2, 3])\n/// [2, 6]\nfn derivative(xs: Vec) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = derivative;\n assert_eq!(candidate(vec![3, 1, 2, 4, 5]), vec![1, 4, 12, 20]);\n assert_eq!(candidate(vec![1, 2, 3]), vec![2, 6]);\n assert_eq!(candidate(vec![3, 2, 1]), vec![2, 2]);\n assert_eq!(candidate(vec![3, 2, 1, 0, 4]), vec![2, 2, 0, 16]);\n assert_eq!(candidate(vec![1]), Vec::::new());\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "rs", - "prompt": "/// In this task, you will be given a string that represents a number of apples and oranges \n/// that are distributed in a basket of fruit this basket contains \n/// apples, oranges, and mango fruits. Given the string that represents the total number of \n/// the oranges and apples and an integer that represent the total number of the fruits \n/// in the basket return the number of the mango fruits in the basket.\n/// for examble:\n/// fruit_distribution(\"5 apples and 6 oranges\", 19) ->19 - 5 - 6 = 8\n/// fruit_distribution(\"0 apples and 1 oranges\",3) -> 3 - 0 - 1 = 2\n/// fruit_distribution(\"2 apples and 3 oranges\", 100) -> 100 - 2 - 3 = 95\n/// fruit_distribution(\"100 apples and 1 oranges\",120) -> 120 - 100 - 1 = 19\nfn fruit_distribution(s: String, n: isize) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = fruit_distribution;\n assert_eq!(candidate(String::from(\"5 apples and 6 oranges\"), 19), 8);\n assert_eq!(candidate(String::from(\"5 apples and 6 oranges\"), 21), 10);\n assert_eq!(candidate(String::from(\"0 apples and 1 oranges\"), 3), 2);\n assert_eq!(candidate(String::from(\"1 apples and 0 oranges\"), 3), 2);\n assert_eq!(candidate(String::from(\"2 apples and 3 oranges\"), 100), 95);\n assert_eq!(candidate(String::from(\"2 apples and 3 oranges\"), 5), 0);\n assert_eq!(candidate(String::from(\"1 apples and 100 oranges\"), 120), 19);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "rs", - "prompt": "/// Write a function that takes an integer a and returns True \n/// if this ingeger is a cube of some integer number.\n/// Note: you may assume the input is always valid.\n/// Examples:\n/// iscube(1) ==> True\n/// iscube(2) ==> False\n/// iscube(-1) ==> True\n/// iscube(64) ==> True\n/// iscube(0) ==> True\n/// iscube(180) ==> False\nfn iscube(a: isize) -> bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = iscube;\n assert_eq!(candidate(1), true);\n assert_eq!(candidate(2), false);\n assert_eq!(candidate(-1), true);\n assert_eq!(candidate(64), true);\n assert_eq!(candidate(180), false);\n assert_eq!(candidate(1000), true);\n assert_eq!(candidate(0), true);\n assert_eq!(candidate(1729), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "rs", - "prompt": "/// In this Kata, you have to sort an array of non-negative integers according to\n/// number of ones in their binary representation in ascending order.\n/// For similar number of ones, sort based on decimal value.\n/// It must be implemented like this:\n/// >>> sort_array([1, 5, 2, 3, 4]) == [1, 2, 3, 4, 5]\n/// >>> sort_array([-2, -3, -4, -5, -6]) == [-6, -5, -4, -3, -2]\n/// >>> sort_array([1, 0, 2, 3, 4]) [0, 1, 2, 3, 4]\nfn sort_array(arr: Vec) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = sort_array;\n assert_eq!(candidate(vec![1, 5, 2, 3, 4]), vec![1, 2, 4, 3, 5]);\n assert_eq!(candidate(vec![-2, -3, -4, -5, -6]), vec![-4, -2, -6, -5, -3]);\n assert_eq!(candidate(vec![1, 0, 2, 3, 4]), vec![0, 1, 2, 4, 3]);\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]), vec![2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77]);\n assert_eq!(candidate(vec![3, 6, 44, 12, 32, 5]), vec![32, 3, 5, 6, 12, 44]);\n assert_eq!(candidate(vec![2, 4, 8, 16, 32]), vec![2, 4, 8, 16, 32]);\n assert_eq!(candidate(vec![2, 4, 8, 16, 32]), vec![2, 4, 8, 16, 32]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "rs", - "prompt": "/// Given a list of strings, where each string consists of only digits, return a list.\n/// Each element i of the output should be \"the number of odd elements in the\n/// string i of the input.\" where all the i's should be replaced by the number\n/// of odd digits in the i'th string of the input.\n/// >>> odd_count(['1234567'])\n/// [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n/// >>> odd_count(['3',\"11111111\"])\n/// [\"the number of odd elements 1n the str1ng 1 of the 1nput.\",\n/// \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\nfn odd_count(lst: Vec) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = odd_count;\n assert_eq!(candidate(vec![String::from(\"1234567\")]), vec![String::from(\"the number of odd elements 4n the str4ng 4 of the 4nput.\")]);\n assert_eq!(candidate(vec![String::from(\"3\"), String::from(\"11111111\")]), vec![String::from(\"the number of odd elements 1n the str1ng 1 of the 1nput.\"), String::from(\"the number of odd elements 8n the str8ng 8 of the 8nput.\")]);\n assert_eq!(candidate(vec![String::from(\"271\"), String::from(\"137\"), String::from(\"314\")]), vec![String::from(\"the number of odd elements 2n the str2ng 2 of the 2nput.\"), String::from(\"the number of odd elements 3n the str3ng 3 of the 3nput.\"), String::from(\"the number of odd elements 2n the str2ng 2 of the 2nput.\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "rs", - "prompt": "/// brackets is a string of \"(\" and \")\".\n/// return True if every opening bracket has a corresponding closing bracket.\n/// >>> correct_bracketing(\"(\")\n/// False\n/// >>> correct_bracketing(\"()\")\n/// True\n/// >>> correct_bracketing(\"(()())\")\n/// True\n/// >>> correct_bracketing(\")(()\")\n/// False\nfn correct_bracketing(brackets: String) -> bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = correct_bracketing;\n assert_eq!(candidate(String::from(\"()\")), true);\n assert_eq!(candidate(String::from(\"(()())\")), true);\n assert_eq!(candidate(String::from(\"()()(()())()\")), true);\n assert_eq!(candidate(String::from(\"()()((()()())())(()()(()))\")), true);\n assert_eq!(candidate(String::from(\"((()())))\")), false);\n assert_eq!(candidate(String::from(\")(()\")), false);\n assert_eq!(candidate(String::from(\"(\")), false);\n assert_eq!(candidate(String::from(\"((((\")), false);\n assert_eq!(candidate(String::from(\")\")), false);\n assert_eq!(candidate(String::from(\"(()\")), false);\n assert_eq!(candidate(String::from(\"()()(()())())(()\")), false);\n assert_eq!(candidate(String::from(\"()()(()())()))()\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "rs", - "prompt": "/// Task\n/// Write a function that takes a string as input and returns the sum of the upper characters only'\n/// ASCII codes.\n/// Examples:\n/// digitSum(\"\") => 0\n/// digitSum(\"abAB\") => 131\n/// digitSum(\"abcCd\") => 67\n/// digitSum(\"helloE\") => 69\n/// digitSum(\"woArBld\") => 131\n/// digitSum(\"aAaaaXa\") => 153\nfn digitSum(s: String) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = digitSum;\n assert_eq!(candidate(String::from(\"\")), 0);\n assert_eq!(candidate(String::from(\"abAB\")), 131);\n assert_eq!(candidate(String::from(\"abcCd\")), 67);\n assert_eq!(candidate(String::from(\"helloE\")), 69);\n assert_eq!(candidate(String::from(\"woArBld\")), 131);\n assert_eq!(candidate(String::from(\"aAaaaXa\")), 153);\n assert_eq!(candidate(String::from(\" How are yOu?\")), 151);\n assert_eq!(candidate(String::from(\"You arE Very Smart\")), 327);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "rs", - "prompt": "/// Write a function that accepts a list of strings as a parameter,\n/// deletes the strings that have odd lengths from it,\n/// and returns the resulted list with a sorted order,\n/// The list is always a list of strings and never an array of numbers,\n/// and it may contain duplicates.\n/// The order of the list should be ascending by length of each word, and you\n/// should return the list sorted by that rule.\n/// If two words have the same length, sort the list alphabetically.\n/// The function should return a list of strings in sorted order.\n/// You may assume that all words will have the same length.\n/// For example:\n/// assert list_sort([\"aa\", \"a\", \"aaa\"]) => [\"aa\"]\n/// assert list_sort([\"ab\", \"a\", \"aaa\", \"cd\"]) => [\"ab\", \"cd\"]\nfn sorted_list_sum(lst: Vec) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = sorted_list_sum;\n assert_eq!(candidate(vec![String::from(\"aa\"), String::from(\"a\"), String::from(\"aaa\")]), vec![String::from(\"aa\")]);\n assert_eq!(candidate(vec![String::from(\"school\"), String::from(\"AI\"), String::from(\"asdf\"), String::from(\"b\")]), vec![String::from(\"AI\"), String::from(\"asdf\"), String::from(\"school\")]);\n assert_eq!(candidate(vec![String::from(\"d\"), String::from(\"b\"), String::from(\"c\"), String::from(\"a\")]), Vec::::new());\n assert_eq!(candidate(vec![String::from(\"d\"), String::from(\"dcba\"), String::from(\"abcd\"), String::from(\"a\")]), vec![String::from(\"abcd\"), String::from(\"dcba\")]);\n assert_eq!(candidate(vec![String::from(\"AI\"), String::from(\"ai\"), String::from(\"au\")]), vec![String::from(\"AI\"), String::from(\"ai\"), String::from(\"au\")]);\n assert_eq!(candidate(vec![String::from(\"a\"), String::from(\"b\"), String::from(\"b\"), String::from(\"c\"), String::from(\"c\"), String::from(\"a\")]), Vec::::new());\n assert_eq!(candidate(vec![String::from(\"aaaa\"), String::from(\"bbbb\"), String::from(\"dd\"), String::from(\"cc\")]), vec![String::from(\"cc\"), String::from(\"dd\"), String::from(\"aaaa\"), String::from(\"bbbb\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "rs", - "prompt": "/// You are given an array arr of integers and you need to return\n/// sum of magnitudes of integers multiplied by product of all signs\n/// of each number in the array, represented by 1, -1 or 0.\n/// Note: return None for empty arr.\n/// Example:\n/// >>> prod_signs([1, 2, 2, -4]) == -9\n/// >>> prod_signs([0, 1]) == 0\n/// >>> prod_signs([]) == None\nfn prod_signs(arr: Vec) -> Option {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = prod_signs;\n assert_eq!(candidate(vec![1, 2, 2, -4]), Some(-9));\n assert_eq!(candidate(vec![0, 1]), Some(0));\n assert_eq!(candidate(vec![1, 1, 1, 2, 3, -1, 1]), Some(-10));\n assert_eq!(candidate(Vec::::new()), None);\n assert_eq!(candidate(vec![2, 4, 1, 2, -1, -1, 9]), Some(20));\n assert_eq!(candidate(vec![-1, 1, -1, 1]), Some(4));\n assert_eq!(candidate(vec![-1, 1, 1, 1]), Some(-4));\n assert_eq!(candidate(vec![-1, 1, 1, 0]), Some(0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "rs", - "prompt": "/// Return list with elements incremented by 1.\n/// >>> incr_list([1, 2, 3])\n/// [2, 3, 4]\n/// >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123])\n/// [6, 4, 6, 3, 4, 4, 10, 1, 124]\nfn incr_list(l: Vec) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = incr_list;\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![3, 2, 1]), vec![4, 3, 2]);\n assert_eq!(candidate(vec![5, 2, 5, 2, 3, 3, 9, 0, 123]), vec![6, 3, 6, 3, 4, 4, 10, 1, 124]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "rs", - "prompt": "/// From a given list of integers, generate a list of rolling maximum element found until given moment\n/// in the sequence.\n/// >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n/// [1, 2, 3, 3, 3, 4, 4]\nfn rolling_max(numbers: Vec) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = rolling_max;\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![1, 2, 3, 4]), vec![1, 2, 3, 4]);\n assert_eq!(candidate(vec![4, 3, 2, 1]), vec![4, 4, 4, 4]);\n assert_eq!(candidate(vec![3, 2, 3, 100, 3]), vec![3, 3, 3, 100, 100]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "rs", - "prompt": "/// Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n/// separate those group into separate strings and return the list of those.\n/// Separate groups are balanced (each open brace is properly closed) and not nested within each other\n/// Ignore any spaces in the input string.\n/// >>> separate_paren_groups('( ) (( )) (( )( ))')\n/// ['()', '(())', '(()())']\nfn separate_paren_groups(paren_string: String) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = separate_paren_groups;\n assert_eq!(candidate(String::from(\"(()()) ((())) () ((())()())\")), vec![String::from(\"(()())\"), String::from(\"((()))\"), String::from(\"()\"), String::from(\"((())()())\")]);\n assert_eq!(candidate(String::from(\"() (()) ((())) (((())))\")), vec![String::from(\"()\"), String::from(\"(())\"), String::from(\"((()))\"), String::from(\"(((())))\")]);\n assert_eq!(candidate(String::from(\"(()(())((())))\")), vec![String::from(\"(()(())((())))\")]);\n assert_eq!(candidate(String::from(\"( ) (( )) (( )( ))\")), vec![String::from(\"()\"), String::from(\"(())\"), String::from(\"(()())\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "rs", - "prompt": "/// You will be given a string of words separated by commas or spaces. Your task is\n/// to split the string into words and return an array of the words.\n/// For example:\n/// words_string(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n/// words_string(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\nfn words_string(s: String) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = words_string;\n assert_eq!(candidate(String::from(\"Hi, my name is John\")), vec![String::from(\"Hi\"), String::from(\"my\"), String::from(\"name\"), String::from(\"is\"), String::from(\"John\")]);\n assert_eq!(candidate(String::from(\"One, two, three, four, five, six\")), vec![String::from(\"One\"), String::from(\"two\"), String::from(\"three\"), String::from(\"four\"), String::from(\"five\"), String::from(\"six\")]);\n assert_eq!(candidate(String::from(\"Hi, my name\")), vec![String::from(\"Hi\"), String::from(\"my\"), String::from(\"name\")]);\n assert_eq!(candidate(String::from(\"One,, two, three, four, five, six,\")), vec![String::from(\"One\"), String::from(\"two\"), String::from(\"three\"), String::from(\"four\"), String::from(\"five\"), String::from(\"six\")]);\n assert_eq!(candidate(String::from(\"\")), Vec::::new());\n assert_eq!(candidate(String::from(\"ahmed , gamal\")), vec![String::from(\"ahmed\"), String::from(\"gamal\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "rs", - "prompt": "/// This function takes a list l and returns a list l' such that\n/// l' is identical to l in the odd indicies, while its values at the even indicies are equal\n/// to the values of the even indicies of l, but sorted.\n/// >>> sort_even([1, 2, 3])\n/// [1, 2, 3]\n/// >>> sort_even([5, 6, 3, 4])\n/// [3, 6, 5, 4]\nfn sort_even(l: Vec) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = sort_even;\n assert_eq!(candidate(vec![1, 2, 3]), vec![1, 2, 3]);\n assert_eq!(candidate(vec![5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]), vec![-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123]);\n assert_eq!(candidate(vec![5, 8, -12, 4, 23, 2, 3, 11, 12, -10]), vec![-12, 8, 3, 4, 5, 2, 12, 11, 23, -10]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "rs", - "prompt": "/// I think we all remember that feeling when the result of some long-awaited\n/// event is finally known. The feelings and thoughts you have at that moment are\n/// definitely worth noting down and comparing.\n/// Your task is to determine if a person correctly guessed the results of a number of matches.\n/// You are given two arrays of scores and guesses of equal length, where each index shows a match. \n/// Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n/// the value is 0, and if not, the value is the absolute difference between the guess and the score.\n/// example:\n/// compare([1,2,3,4,5,1],[1,2,3,4,2,-2]) -> [0,0,0,0,3,3]\n/// compare([0,5,0,0,0,4],[4,1,1,0,0,-2]) -> [4,4,1,0,0,6]\nfn compare(game: Vec, guess: Vec) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = compare;\n assert_eq!(candidate(vec![1, 2, 3, 4, 5, 1], vec![1, 2, 3, 4, 2, -2]), vec![0, 0, 0, 0, 3, 3]);\n assert_eq!(candidate(vec![0, 0, 0, 0, 0, 0], vec![0, 0, 0, 0, 0, 0]), vec![0, 0, 0, 0, 0, 0]);\n assert_eq!(candidate(vec![1, 2, 3], vec![-1, -2, -3]), vec![2, 4, 6]);\n assert_eq!(candidate(vec![1, 2, 3, 5], vec![-1, 2, 3, 4]), vec![2, 0, 0, 1]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "rs", - "prompt": "/// Given a positive integer n, return a tuple that has the number of even and odd\n/// integer palindromes that fall within the range(1, n), inclusive.\n/// Example 1:\n/// Input: 3\n/// Output: (1, 2)\n/// Explanation:\n/// Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n/// Example 2:\n/// Input: 12\n/// Output: (4, 6)\n/// Explanation:\n/// Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n/// Note:\n/// 1. 1 <= n <= 10^3\n/// 2. returned tuple has the number of even and odd integer palindromes respectively.\nfn even_odd_palindrome(n: isize) -> (isize, isize) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = even_odd_palindrome;\n assert_eq!(candidate(123), (8, 13));\n assert_eq!(candidate(12), (4, 6));\n assert_eq!(candidate(3), (1, 2));\n assert_eq!(candidate(63), (6, 8));\n assert_eq!(candidate(25), (5, 6));\n assert_eq!(candidate(19), (4, 6));\n assert_eq!(candidate(9), (4, 5));\n assert_eq!(candidate(1), (0, 1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "rs", - "prompt": "/// The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n/// fib4(0) -> 0\n/// fib4(1) -> 0\n/// fib4(2) -> 2\n/// fib4(3) -> 0\n/// fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n/// Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n/// >>> fib4(5)\n/// 4\n/// >>> fib4(6)\n/// 8\n/// >>> fib4(7)\n/// 14\nfn fib4(n: isize) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = fib4;\n assert_eq!(candidate(5), 4);\n assert_eq!(candidate(8), 28);\n assert_eq!(candidate(10), 104);\n assert_eq!(candidate(12), 386);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "rs", - "prompt": "/// Given two positive integers a and b, return the even digits between a\n/// and b, in ascending order.\n/// For example:\n/// generate_integers(2, 8) => [2, 4, 6, 8]\n/// generate_integers(8, 2) => [2, 4, 6, 8]\n/// generate_integers(10, 14) => []\nfn generate_integers(a: isize, b: isize) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = generate_integers;\n assert_eq!(candidate(2, 10), vec![2, 4, 6, 8]);\n assert_eq!(candidate(10, 2), vec![2, 4, 6, 8]);\n assert_eq!(candidate(132, 2), vec![2, 4, 6, 8]);\n assert_eq!(candidate(17, 89), Vec::::new());\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "rs", - "prompt": "/// For a given list of input numbers, calculate Mean Absolute Deviation\n/// around the mean of this dataset.\n/// Mean Absolute Deviation is the average absolute difference between each\n/// element and a centerpoint (mean in this case):\n/// MAD = average | x - x_mean |\n/// >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n/// 1.0\nfn mean_absolute_deviation(numbers: Vec) -> f64 {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = mean_absolute_deviation;\n assert_eq!(candidate(vec![1.0, 2.0]), 0.5);\n assert_eq!(candidate(vec![1.0, 2.0, 3.0, 4.0]), 1.0);\n assert_eq!(candidate(vec![1.0, 2.0, 3.0, 4.0, 5.0]), 1.2);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "rs", - "prompt": "/// Create a function encrypt that takes a string as an argument and\n/// returns a string encrypted with the alphabet being rotated. \n/// The alphabet should be rotated in a manner such that the letters \n/// shift down by two multiplied to two places.\n/// For example:\n/// encrypt('hi') returns 'lm'\n/// encrypt('asdfghjkl') returns 'ewhjklnop'\n/// encrypt('gf') returns 'kj'\n/// encrypt('et') returns 'ix'\nfn encrypt(s: String) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = encrypt;\n assert_eq!(candidate(String::from(\"hi\")), String::from(\"lm\"));\n assert_eq!(candidate(String::from(\"asdfghjkl\")), String::from(\"ewhjklnop\"));\n assert_eq!(candidate(String::from(\"gf\")), String::from(\"kj\"));\n assert_eq!(candidate(String::from(\"et\")), String::from(\"ix\"));\n assert_eq!(candidate(String::from(\"faewfawefaewg\")), String::from(\"jeiajeaijeiak\"));\n assert_eq!(candidate(String::from(\"hellomyfriend\")), String::from(\"lippsqcjvmirh\"));\n assert_eq!(candidate(String::from(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\")), String::from(\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\"));\n assert_eq!(candidate(String::from(\"a\")), String::from(\"e\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "rs", - "prompt": "/// Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n/// The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n/// as follows: start with any positive integer n. Then each term is obtained from the \n/// previous term as follows: if the previous term is even, the next term is one half of \n/// the previous term. If the previous term is odd, the next term is 3 times the previous\n/// term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n/// Note: \n/// 1. Collatz(1) is [1].\n/// 2. returned list sorted in increasing order.\n/// For example:\n/// get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\nfn get_odd_collatz(n: isize) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = get_odd_collatz;\n assert_eq!(candidate(14), vec![1, 5, 7, 11, 13, 17]);\n assert_eq!(candidate(5), vec![1, 5]);\n assert_eq!(candidate(12), vec![1, 3, 5]);\n assert_eq!(candidate(1), vec![1]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "rs", - "prompt": "/// Find how many times a given substring can be found in the original string. Count overlaping cases.\n/// >>> how_many_times('', 'a')\n/// 0\n/// >>> how_many_times('aaa', 'a')\n/// 3\n/// >>> how_many_times('aaaa', 'aa')\n/// 3\nfn how_many_times(string: String, substring: String) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = how_many_times;\n assert_eq!(candidate(String::from(\"\"), String::from(\"x\")), 0);\n assert_eq!(candidate(String::from(\"xyxyxyx\"), String::from(\"x\")), 4);\n assert_eq!(candidate(String::from(\"cacacacac\"), String::from(\"cac\")), 4);\n assert_eq!(candidate(String::from(\"john doe\"), String::from(\"john\")), 1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "rs", - "prompt": "/// We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n/// numbers in the array will be randomly ordered. Your task is to determine if\n/// it is possible to get an array sorted in non-decreasing order by performing \n/// the following operation on the given array:\n/// You are allowed to perform right shift operation any number of times.\n/// One right shift operation means shifting all elements of the array by one\n/// position in the right direction. The last element of the array will be moved to\n/// the starting position in the array i.e. 0th index. \n/// If it is possible to obtain the sorted array by performing the above operation\n/// then return True else return False.\n/// If the given array is empty then return True.\n/// Note: The given list is guaranteed to have unique elements.\n/// For Example:\n/// move_one_ball([3, 4, 5, 1, 2])==>True\n/// Explanation: By performin 2 right shift operations, non-decreasing order can\n/// be achieved for the given array.\n/// move_one_ball([3, 5, 4, 1, 2])==>False\n/// Explanation:It is not possible to get non-decreasing order for the given\n/// array by performing any number of right shift operations.\nfn move_one_ball(arr: Vec) -> bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = move_one_ball;\n assert_eq!(candidate(vec![3, 4, 5, 1, 2]), true);\n assert_eq!(candidate(vec![3, 5, 10, 1, 2]), true);\n assert_eq!(candidate(vec![4, 3, 1, 2]), false);\n assert_eq!(candidate(vec![3, 5, 4, 1, 2]), false);\n assert_eq!(candidate(Vec::::new()), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "rs", - "prompt": "/// Write a function which sorts the given list of integers\n/// in ascending order according to the sum of their digits.\n/// Note: if there are several items with similar sum of their digits,\n/// order them based on their index in original list.\n/// For example:\n/// >>> order_by_points([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]\n/// >>> order_by_points([]) == []\nfn order_by_points(nums: Vec) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = order_by_points;\n assert_eq!(candidate(vec![1, 11, -1, -11, -12]), vec![-1, -11, 1, -12, 11]);\n assert_eq!(candidate(vec![1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]), vec![0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457]);\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![1, -11, -32, 43, 54, -98, 2, -3]), vec![-3, -32, -98, -11, 1, 2, 43, 54]);\n assert_eq!(candidate(vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]), vec![1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9]);\n assert_eq!(candidate(vec![0, 6, 6, -76, -21, 23, 4]), vec![-76, -21, 0, 4, 23, 6, 6]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "rs", - "prompt": "/// Return list of prime factors of given integer in the order from smallest to largest.\n/// Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n/// Input number should be equal to the product of all factors\n/// >>> factorize(8)\n/// [2, 2, 2]\n/// >>> factorize(25)\n/// [5, 5]\n/// >>> factorize(70)\n/// [2, 5, 7]\nfn factorize(n: isize) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = factorize;\n assert_eq!(candidate(2), vec![2]);\n assert_eq!(candidate(4), vec![2, 2]);\n assert_eq!(candidate(8), vec![2, 2, 2]);\n assert_eq!(candidate(57), vec![3, 19]);\n assert_eq!(candidate(3249), vec![3, 3, 19, 19]);\n assert_eq!(candidate(185193), vec![3, 3, 3, 19, 19, 19]);\n assert_eq!(candidate(20577), vec![3, 19, 19, 19]);\n assert_eq!(candidate(18), vec![2, 3, 3]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "rs", - "prompt": "/// Return True if all numbers in the list l are below threshold t.\n/// >>> below_threshold([1, 2, 4, 10], 100)\n/// True\n/// >>> below_threshold([1, 20, 4, 10], 5)\n/// False\nfn below_threshold(l: Vec, t: isize) -> bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = below_threshold;\n assert_eq!(candidate(vec![1, 2, 4, 10], 100), true);\n assert_eq!(candidate(vec![1, 20, 4, 10], 5), false);\n assert_eq!(candidate(vec![1, 20, 4, 10], 21), true);\n assert_eq!(candidate(vec![1, 20, 4, 10], 22), true);\n assert_eq!(candidate(vec![1, 8, 4, 10], 11), true);\n assert_eq!(candidate(vec![1, 8, 4, 10], 10), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "rs", - "prompt": "/// Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n/// For each of the group, output the deepest level of nesting of parentheses.\n/// E.g. (()()) has maximum two levels of nesting while ((())) has three.\n/// >>> parse_nested_parens('(()()) ((())) () ((())()())')\n/// [2, 3, 1, 3]\nfn parse_nested_parens(paren_string: String) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = parse_nested_parens;\n assert_eq!(candidate(String::from(\"(()()) ((())) () ((())()())\")), vec![2, 3, 1, 3]);\n assert_eq!(candidate(String::from(\"() (()) ((())) (((())))\")), vec![1, 2, 3, 4]);\n assert_eq!(candidate(String::from(\"(()(())((())))\")), vec![4]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "rs", - "prompt": "/// Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n/// Examples\n/// solution([5, 8, 7, 1]) ==> 12\n/// solution([3, 3, 3, 3, 3]) ==> 9\n/// solution([30, 13, 24, 321]) ==>0\nfn solution(lst: Vec) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = solution;\n assert_eq!(candidate(vec![5, 8, 7, 1]), 12);\n assert_eq!(candidate(vec![3, 3, 3, 3, 3]), 9);\n assert_eq!(candidate(vec![30, 13, 24, 321]), 0);\n assert_eq!(candidate(vec![5, 9]), 5);\n assert_eq!(candidate(vec![2, 4, 8]), 0);\n assert_eq!(candidate(vec![30, 13, 23, 32]), 23);\n assert_eq!(candidate(vec![3, 13, 2, 9]), 3);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "rs", - "prompt": "/// You are given a positive integer n. You have to create an integer array a of length n.\n/// For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n/// Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n/// and a[i] + a[j] + a[k] is a multiple of 3.\n/// Example :\n/// Input: n = 5\n/// Output: 1\n/// Explanation: \n/// a = [1, 3, 7, 13, 21]\n/// The only valid triple is (1, 7, 13).\nfn get_max_triples(n: isize) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = get_max_triples;\n assert_eq!(candidate(5), 1);\n assert_eq!(candidate(6), 4);\n assert_eq!(candidate(10), 36);\n assert_eq!(candidate(100), 53361);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "rs", - "prompt": "/// You are given a list of integers.\n/// Write a function next_smallest() that returns the 2nd smallest element of the list.\n/// Return None if there is no such element.\n/// next_smallest([1, 2, 3, 4, 5]) == 2\n/// next_smallest([5, 1, 4, 3, 2]) == 2\n/// next_smallest([]) == None\n/// next_smallest([1, 1]) == None\nfn next_smallest(lst: Vec) -> Option {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = next_smallest;\n assert_eq!(candidate(vec![1, 2, 3, 4, 5]), Some(2));\n assert_eq!(candidate(vec![5, 1, 4, 3, 2]), Some(2));\n assert_eq!(candidate(Vec::::new()), None);\n assert_eq!(candidate(vec![1, 1]), None);\n assert_eq!(candidate(vec![1, 1, 1, 1, 0]), Some(1));\n assert_eq!(candidate(vec![1, 1]), None);\n assert_eq!(candidate(vec![-35, 34, 12, -45]), Some(-35));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "rs", - "prompt": "/// Input is a space-delimited string of numberals from 'zero' to 'nine'.\n/// Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n/// Return the string with numbers sorted from smallest to largest\n/// >>> sort_numbers('three one five')\n/// 'one three five'\nfn sort_numbers(numbers: String) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = sort_numbers;\n assert_eq!(candidate(String::from(\"\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"three\")), String::from(\"three\"));\n assert_eq!(candidate(String::from(\"three five nine\")), String::from(\"three five nine\"));\n assert_eq!(candidate(String::from(\"five zero four seven nine eight\")), String::from(\"zero four five seven eight nine\"));\n assert_eq!(candidate(String::from(\"six five four three two one zero\")), String::from(\"zero one two three four five six\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "rs", - "prompt": "/// You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n/// cycpattern_check(\"abcd\",\"abd\") => False\n/// cycpattern_check(\"hello\",\"ell\") => True\n/// cycpattern_check(\"whassup\",\"psus\") => False\n/// cycpattern_check(\"abab\",\"baa\") => True\n/// cycpattern_check(\"efef\",\"eeff\") => False\n/// cycpattern_check(\"himenss\",\"simen\") => True\nfn cycpattern_check(a: String, b: String) -> bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = cycpattern_check;\n assert_eq!(candidate(String::from(\"xyzw\"), String::from(\"xyw\")), false);\n assert_eq!(candidate(String::from(\"yello\"), String::from(\"ell\")), true);\n assert_eq!(candidate(String::from(\"whattup\"), String::from(\"ptut\")), false);\n assert_eq!(candidate(String::from(\"efef\"), String::from(\"fee\")), true);\n assert_eq!(candidate(String::from(\"abab\"), String::from(\"aabb\")), false);\n assert_eq!(candidate(String::from(\"winemtt\"), String::from(\"tinem\")), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "rs", - "prompt": "/// You will be given a number in decimal form and your task is to convert it to\n/// binary format. The function should return a string, with each character representing a binary\n/// number. Each character in the string will be '0' or '1'.\n/// There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n/// The extra characters are there to help with the format.\n/// Examples:\n/// decimal_to_binary(15) # returns \"db1111db\"\n/// decimal_to_binary(32) # returns \"db100000db\"\nfn decimal_to_binary(decimal: isize) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = decimal_to_binary;\n assert_eq!(candidate(0), String::from(\"db0db\"));\n assert_eq!(candidate(32), String::from(\"db100000db\"));\n assert_eq!(candidate(103), String::from(\"db1100111db\"));\n assert_eq!(candidate(15), String::from(\"db1111db\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "rs", - "prompt": "/// Filter an input list of strings only for ones that contain given substring\n/// >>> filter_by_substring([], 'a')\n/// []\n/// >>> filter_by_substring(['abc', 'bacd', 'cde', 'array'], 'a')\n/// ['abc', 'bacd', 'array']\nfn filter_by_substring(strings: Vec, substring: String) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = filter_by_substring;\n assert_eq!(candidate(Vec::::new(), String::from(\"john\")), Vec::::new());\n assert_eq!(candidate(vec![String::from(\"xxx\"), String::from(\"asd\"), String::from(\"xxy\"), String::from(\"john doe\"), String::from(\"xxxAAA\"), String::from(\"xxx\")], String::from(\"xxx\")), vec![String::from(\"xxx\"), String::from(\"xxxAAA\"), String::from(\"xxx\")]);\n assert_eq!(candidate(vec![String::from(\"xxx\"), String::from(\"asd\"), String::from(\"aaaxxy\"), String::from(\"john doe\"), String::from(\"xxxAAA\"), String::from(\"xxx\")], String::from(\"xx\")), vec![String::from(\"xxx\"), String::from(\"aaaxxy\"), String::from(\"xxxAAA\"), String::from(\"xxx\")]);\n assert_eq!(candidate(vec![String::from(\"grunt\"), String::from(\"trumpet\"), String::from(\"prune\"), String::from(\"gruesome\")], String::from(\"run\")), vec![String::from(\"grunt\"), String::from(\"prune\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "rs", - "prompt": "/// Given an integer. return a tuple that has the number of even and odd digits respectively.\n/// Example:\n/// even_odd_count(-12) ==> (1, 1)\n/// even_odd_count(123) ==> (1, 2)\nfn even_odd_count(num: isize) -> (isize, isize) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = even_odd_count;\n assert_eq!(candidate(7), (0, 1));\n assert_eq!(candidate(-78), (1, 1));\n assert_eq!(candidate(3452), (2, 2));\n assert_eq!(candidate(346211), (3, 3));\n assert_eq!(candidate(-345821), (3, 3));\n assert_eq!(candidate(-2), (1, 0));\n assert_eq!(candidate(-45347), (2, 3));\n assert_eq!(candidate(0), (1, 0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "rs", - "prompt": "/// Write a function that accepts a list of strings.\n/// The list contains different words. Return the word with maximum number\n/// of unique characters. If multiple strings have maximum number of unique\n/// characters, return the one which comes first in lexicographical order.\n/// find_max([\"name\", \"of\", \"string\"]) == \"string\"\n/// find_max([\"name\", \"enam\", \"game\"]) == \"enam\"\n/// find_max([\"aaaaaaa\", \"bb\" ,\"cc\"]) == \"\"aaaaaaa\"\nfn find_max(words: Vec) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = find_max;\n assert_eq!(candidate(vec![String::from(\"name\"), String::from(\"of\"), String::from(\"string\")]), String::from(\"string\"));\n assert_eq!(candidate(vec![String::from(\"name\"), String::from(\"enam\"), String::from(\"game\")]), String::from(\"enam\"));\n assert_eq!(candidate(vec![String::from(\"aaaaaaa\"), String::from(\"bb\"), String::from(\"cc\")]), String::from(\"aaaaaaa\"));\n assert_eq!(candidate(vec![String::from(\"abc\"), String::from(\"cba\")]), String::from(\"abc\"));\n assert_eq!(candidate(vec![String::from(\"play\"), String::from(\"this\"), String::from(\"game\"), String::from(\"of\"), String::from(\"footbott\")]), String::from(\"footbott\"));\n assert_eq!(candidate(vec![String::from(\"we\"), String::from(\"are\"), String::from(\"gonna\"), String::from(\"rock\")]), String::from(\"gonna\"));\n assert_eq!(candidate(vec![String::from(\"we\"), String::from(\"are\"), String::from(\"a\"), String::from(\"mad\"), String::from(\"nation\")]), String::from(\"nation\"));\n assert_eq!(candidate(vec![String::from(\"this\"), String::from(\"is\"), String::from(\"a\"), String::from(\"prrk\")]), String::from(\"this\"));\n assert_eq!(candidate(vec![String::from(\"b\")]), String::from(\"b\"));\n assert_eq!(candidate(vec![String::from(\"play\"), String::from(\"play\"), String::from(\"play\")]), String::from(\"play\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "rs", - "prompt": "/// Given a positive integer n, return the count of the numbers of n-digit\n/// positive integers that start or end with 1.\nfn starts_one_ends(n: isize) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = starts_one_ends;\n assert_eq!(candidate(1), 1);\n assert_eq!(candidate(2), 18);\n assert_eq!(candidate(3), 180);\n assert_eq!(candidate(4), 1800);\n assert_eq!(candidate(5), 18000);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "rs", - "prompt": "/// Create a function that returns a tuple (a, b), where 'a' is\n/// the largest of negative integers, and 'b' is the smallest\n/// of positive integers in a list.\n/// If there is no negative or positive integers, return them as None.\n/// Examples:\n/// largest_smallest_integers([2, 4, 1, 3, 5, 7]) == (None, 1)\n/// largest_smallest_integers([]) == (None, None)\n/// largest_smallest_integers([0]) == (None, None)\nfn largest_smallest_integers(lst: Vec) -> (Option, Option) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = largest_smallest_integers;\n assert_eq!(candidate(vec![2, 4, 1, 3, 5, 7]), (None, Some(1)));\n assert_eq!(candidate(vec![2, 4, 1, 3, 5, 7, 0]), (None, Some(1)));\n assert_eq!(candidate(vec![1, 3, 2, 4, 5, 6, -2]), (Some(-2), Some(1)));\n assert_eq!(candidate(vec![4, 5, 3, 6, 2, 7, -7]), (Some(-7), Some(2)));\n assert_eq!(candidate(vec![7, 3, 8, 4, 9, 2, 5, -9]), (Some(-9), Some(2)));\n assert_eq!(candidate(Vec::::new()), (None, None));\n assert_eq!(candidate(vec![0]), (None, None));\n assert_eq!(candidate(vec![-1, -3, -5, -6]), (Some(-1), None));\n assert_eq!(candidate(vec![-1, -3, -5, -6, 0]), (Some(-1), None));\n assert_eq!(candidate(vec![-6, -4, -4, -3, 1]), (Some(-3), Some(1)));\n assert_eq!(candidate(vec![-6, -4, -4, -3, -100, 1]), (Some(-3), Some(1)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "rs", - "prompt": "/// \"Given an array representing a branch of a tree that has non-negative integer nodes\n/// your task is to pluck one of the nodes and return it.\n/// The plucked node should be the node with the smallest even value.\n/// If multiple nodes with the same smallest even value are found return the node that has smallest index.\n/// The plucked node should be returned in a list, [ smalest_value, its index ],\n/// If there are no even values or the given array is empty, return [].\n/// Example 1:\n/// Input: [4,2,3]\n/// Output: [2, 1]\n/// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n/// Example 2:\n/// Input: [1,2,3]\n/// Output: [2, 1]\n/// Explanation: 2 has the smallest even value, and 2 has the smallest index. \n/// Example 3:\n/// Input: []\n/// Output: []\n/// Example 4:\n/// Input: [5, 0, 3, 0, 4, 2]\n/// Output: [0, 1]\n/// Explanation: 0 is the smallest value, but there are two zeros,\n/// so we will choose the first zero, which has the smallest index.\n/// Constraints:\n/// * 1 <= nodes.length <= 10000\n/// * 0 <= node.value\nfn pluck(arr: Vec) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = pluck;\n assert_eq!(candidate(vec![4, 2, 3]), vec![2, 1]);\n assert_eq!(candidate(vec![1, 2, 3]), vec![2, 1]);\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![5, 0, 3, 0, 4, 2]), vec![0, 1]);\n assert_eq!(candidate(vec![1, 2, 3, 0, 5, 3]), vec![0, 3]);\n assert_eq!(candidate(vec![5, 4, 8, 4, 8]), vec![4, 1]);\n assert_eq!(candidate(vec![7, 6, 7, 1]), vec![6, 1]);\n assert_eq!(candidate(vec![7, 9, 7, 1]), Vec::::new());\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "rs", - "prompt": "/// Write a function count_nums which takes an array of integers and returns\n/// the number of elements which has a sum of digits > 0.\n/// If a number is negative, then its first signed digit will be negative:\n/// e.g. -123 has signed digits -1, 2, and 3.\n/// >>> count_nums([]) == 0\n/// >>> count_nums([-1, 11, -11]) == 1\n/// >>> count_nums([1, 1, 2]) == 3\nfn count_nums(arr: Vec) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = count_nums;\n assert_eq!(candidate(Vec::::new()), 0);\n assert_eq!(candidate(vec![-1, -2, 0]), 0);\n assert_eq!(candidate(vec![1, 1, 2, -2, 3, 4, 5]), 6);\n assert_eq!(candidate(vec![1, 6, 9, -6, 0, 1, 5]), 5);\n assert_eq!(candidate(vec![1, 100, 98, -7, 1, -1]), 4);\n assert_eq!(candidate(vec![12, 23, 34, -45, -56, 0]), 5);\n assert_eq!(candidate(vec![0, 1]), 1);\n assert_eq!(candidate(vec![1]), 1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "rs", - "prompt": "/// Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n/// each cell of the grid contains a value. Every integer in the range [1, N * N]\n/// inclusive appears exactly once on the cells of the grid.\n/// You have to find the minimum path of length k in the grid. You can start\n/// from any cell, and in each step you can move to any of the neighbor cells,\n/// in other words, you can go to cells which share an edge with you current\n/// cell.\n/// Please note that a path of length k means visiting exactly k cells (not\n/// necessarily distinct).\n/// You CANNOT go off the grid.\n/// A path A (of length k) is considered less than a path B (of length k) if\n/// after making the ordered lists of the values on the cells that A and B go\n/// through (let's call them lst_A and lst_B), lst_A is lexicographically less\n/// than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n/// such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n/// lst_A[j] = lst_B[j].\n/// It is guaranteed that the answer is unique.\n/// Return an ordered list of the values on the cells that the minimum path go through.\n/// Examples:\n/// Input: grid = [ [1,2,3], [4,5,6], [7,8,9]], k = 3\n/// Output: [1, 2, 1]\n/// Input: grid = [ [5,9,3], [4,1,6], [7,8,2]], k = 1\n/// Output: [1]\nfn minPath(grid: Vec>, k: isize) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = minPath;\n assert_eq!(candidate(vec![vec![1, 2, 3], vec![4, 5, 6], vec![7, 8, 9]], 3), vec![1, 2, 1]);\n assert_eq!(candidate(vec![vec![5, 9, 3], vec![4, 1, 6], vec![7, 8, 2]], 1), vec![1]);\n assert_eq!(candidate(vec![vec![1, 2, 3, 4], vec![5, 6, 7, 8], vec![9, 10, 11, 12], vec![13, 14, 15, 16]], 4), vec![1, 2, 1, 2]);\n assert_eq!(candidate(vec![vec![6, 4, 13, 10], vec![5, 7, 12, 1], vec![3, 16, 11, 15], vec![8, 14, 9, 2]], 7), vec![1, 10, 1, 10, 1, 10, 1]);\n assert_eq!(candidate(vec![vec![8, 14, 9, 2], vec![6, 4, 13, 15], vec![5, 7, 1, 12], vec![3, 10, 11, 16]], 5), vec![1, 7, 1, 7, 1]);\n assert_eq!(candidate(vec![vec![11, 8, 7, 2], vec![5, 16, 14, 4], vec![9, 3, 15, 6], vec![12, 13, 10, 1]], 9), vec![1, 6, 1, 6, 1, 6, 1, 6, 1]);\n assert_eq!(candidate(vec![vec![12, 13, 10, 1], vec![9, 3, 15, 6], vec![5, 16, 14, 4], vec![11, 8, 7, 2]], 12), vec![1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6]);\n assert_eq!(candidate(vec![vec![2, 7, 4], vec![3, 1, 5], vec![6, 8, 9]], 8), vec![1, 3, 1, 3, 1, 3, 1, 3]);\n assert_eq!(candidate(vec![vec![6, 1, 5], vec![3, 8, 9], vec![2, 7, 4]], 8), vec![1, 5, 1, 5, 1, 5, 1, 5]);\n assert_eq!(candidate(vec![vec![1, 2], vec![3, 4]], 10), vec![1, 2, 1, 2, 1, 2, 1, 2, 1, 2]);\n assert_eq!(candidate(vec![vec![1, 3], vec![3, 2]], 10), vec![1, 3, 1, 3, 1, 3, 1, 3, 1, 3]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "rs", - "prompt": "/// Given list of integers, return list in strange order.\n/// Strange sorting, is when you start with the minimum value,\n/// then maximum of the remaining integers, then minimum and so on.\n/// Examples:\n/// strange_sort_list([1, 2, 3, 4]) == [1, 4, 2, 3]\n/// strange_sort_list([5, 5, 5, 5]) == [5, 5, 5, 5]\n/// strange_sort_list([]) == []\nfn strange_sort_list(lst: Vec) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = strange_sort_list;\n assert_eq!(candidate(vec![1, 2, 3, 4]), vec![1, 4, 2, 3]);\n assert_eq!(candidate(vec![5, 6, 7, 8, 9]), vec![5, 9, 6, 8, 7]);\n assert_eq!(candidate(vec![1, 2, 3, 4, 5]), vec![1, 5, 2, 4, 3]);\n assert_eq!(candidate(vec![5, 6, 7, 8, 9, 1]), vec![1, 9, 5, 8, 6, 7]);\n assert_eq!(candidate(vec![5, 5, 5, 5]), vec![5, 5, 5, 5]);\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![1, 2, 3, 4, 5, 6, 7, 8]), vec![1, 8, 2, 7, 3, 6, 4, 5]);\n assert_eq!(candidate(vec![0, 2, 2, 2, 5, 5, -5, -5]), vec![-5, 5, -5, 5, 0, 2, 2, 2]);\n assert_eq!(candidate(vec![111111]), vec![111111]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "rs", - "prompt": "/// Given a string 'text', return its md5 hash equivalent string.\n/// If 'text' is an empty string, return None.\n/// >>> string_to_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'\nfn string_to_md5(text: String) -> Option {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = string_to_md5;\n assert_eq!(candidate(String::from(\"Hello world\")), Some(String::from(\"3e25960a79dbc69b674cd4ec67a72c62\")));\n assert_eq!(candidate(String::from(\"\")), None);\n assert_eq!(candidate(String::from(\"A B C\")), Some(String::from(\"0ef78513b0cb8cef12743f5aeb35f888\")));\n assert_eq!(candidate(String::from(\"password\")), Some(String::from(\"5f4dcc3b5aa765d61d8327deb882cf99\")));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "rs", - "prompt": "/// You are given a word. Your task is to find the closest vowel that stands between \n/// two consonants from the right side of the word (case sensitive).\n/// Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n/// find any vowel met the above condition. \n/// You may assume that the given string contains English letter only.\n/// Example:\n/// get_closest_vowel(\"yogurt\") ==> \"u\"\n/// get_closest_vowel(\"FULL\") ==> \"U\"\n/// get_closest_vowel(\"quick\") ==> \"\"\n/// get_closest_vowel(\"ab\") ==> \"\"\nfn get_closest_vowel(word: String) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = get_closest_vowel;\n assert_eq!(candidate(String::from(\"yogurt\")), String::from(\"u\"));\n assert_eq!(candidate(String::from(\"full\")), String::from(\"u\"));\n assert_eq!(candidate(String::from(\"easy\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"eAsy\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"ali\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"bad\")), String::from(\"a\"));\n assert_eq!(candidate(String::from(\"most\")), String::from(\"o\"));\n assert_eq!(candidate(String::from(\"ab\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"ba\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"quick\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"anime\")), String::from(\"i\"));\n assert_eq!(candidate(String::from(\"Asia\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"Above\")), String::from(\"o\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "rs", - "prompt": "/// Change numerical base of input number x to base.\n/// return string representation after the conversion.\n/// base numbers are less than 10.\n/// >>> change_base(8, 3)\n/// '22'\n/// >>> change_base(8, 2)\n/// '1000'\n/// >>> change_base(7, 2)\n/// '111'\nfn change_base(x: isize, base: isize) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = change_base;\n assert_eq!(candidate(8, 3), String::from(\"22\"));\n assert_eq!(candidate(9, 3), String::from(\"100\"));\n assert_eq!(candidate(234, 2), String::from(\"11101010\"));\n assert_eq!(candidate(16, 2), String::from(\"10000\"));\n assert_eq!(candidate(8, 2), String::from(\"1000\"));\n assert_eq!(candidate(7, 2), String::from(\"111\"));\n assert_eq!(candidate(2, 3), String::from(\"2\"));\n assert_eq!(candidate(3, 4), String::from(\"3\"));\n assert_eq!(candidate(4, 5), String::from(\"4\"));\n assert_eq!(candidate(5, 6), String::from(\"5\"));\n assert_eq!(candidate(6, 7), String::from(\"6\"));\n assert_eq!(candidate(7, 8), String::from(\"7\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "rs", - "prompt": "/// Check if in given list of numbers, are any two numbers closer to each other than\n/// given threshold.\n/// >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n/// False\n/// >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n/// True\nfn has_close_elements(numbers: Vec, threshold: f64) -> bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = has_close_elements;\n assert_eq!(candidate(vec![1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3), true);\n assert_eq!(candidate(vec![1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05), false);\n assert_eq!(candidate(vec![1.0, 2.0, 5.9, 4.0, 5.0], 0.95), true);\n assert_eq!(candidate(vec![1.0, 2.0, 5.9, 4.0, 5.0], 0.8), false);\n assert_eq!(candidate(vec![1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1), true);\n assert_eq!(candidate(vec![1.1, 2.2, 3.1, 4.1, 5.1], 1.0), true);\n assert_eq!(candidate(vec![1.1, 2.2, 3.1, 4.1, 5.1], 0.5), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "rs", - "prompt": "/// Create a function that takes a string as input which contains only square brackets.\n/// The function should return True if and only if there is a valid subsequence of brackets \n/// where at least one bracket in the subsequence is nested.\n/// is_nested('[[]]') \u279e True\n/// is_nested('[]]]]]]][[[[[]') \u279e False\n/// is_nested('[][]') \u279e False\n/// is_nested('[]') \u279e False\n/// is_nested('[[][]]') \u279e True\n/// is_nested('[[]][[') \u279e True\nfn is_nested(string: String) -> bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = is_nested;\n assert_eq!(candidate(String::from(\"[[]]\")), true);\n assert_eq!(candidate(String::from(\"[]]]]]]][[[[[]\")), false);\n assert_eq!(candidate(String::from(\"[][]\")), false);\n assert_eq!(candidate(String::from(\"[]\")), false);\n assert_eq!(candidate(String::from(\"[[[[]]]]\")), true);\n assert_eq!(candidate(String::from(\"[]]]]]]]]]]\")), false);\n assert_eq!(candidate(String::from(\"[][][[]]\")), true);\n assert_eq!(candidate(String::from(\"[[]\")), false);\n assert_eq!(candidate(String::from(\"[]]\")), false);\n assert_eq!(candidate(String::from(\"[[]][[\")), true);\n assert_eq!(candidate(String::from(\"[[][]]\")), true);\n assert_eq!(candidate(String::from(\"\")), false);\n assert_eq!(candidate(String::from(\"[[[[[[[[\")), false);\n assert_eq!(candidate(String::from(\"]]]]]]]]\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "rs", - "prompt": "/// Concatenate list of strings into a single string\n/// >>> concatenate([])\n/// ''\n/// >>> concatenate(['a', 'b', 'c'])\n/// 'abc'\nfn concatenate(strings: Vec) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = concatenate;\n assert_eq!(candidate(Vec::::new()), String::from(\"\"));\n assert_eq!(candidate(vec![String::from(\"x\"), String::from(\"y\"), String::from(\"z\")]), String::from(\"xyz\"));\n assert_eq!(candidate(vec![String::from(\"x\"), String::from(\"y\"), String::from(\"z\"), String::from(\"w\"), String::from(\"k\")]), String::from(\"xyzwk\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "rs", - "prompt": "/// prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n/// >>> prime_fib(1)\n/// 2\n/// >>> prime_fib(2)\n/// 3\n/// >>> prime_fib(3)\n/// 5\n/// >>> prime_fib(4)\n/// 13\n/// >>> prime_fib(5)\n/// 89\nfn prime_fib(n: isize) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = prime_fib;\n assert_eq!(candidate(1), 2);\n assert_eq!(candidate(2), 3);\n assert_eq!(candidate(3), 5);\n assert_eq!(candidate(4), 13);\n assert_eq!(candidate(5), 89);\n assert_eq!(candidate(6), 233);\n assert_eq!(candidate(7), 1597);\n assert_eq!(candidate(8), 28657);\n assert_eq!(candidate(9), 514229);\n assert_eq!(candidate(10), 433494437);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "rs", - "prompt": "/// From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n/// other and return them in order (smaller number, larger number).\n/// >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n/// (2.0, 2.2)\n/// >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n/// (2.0, 2.0)\nfn find_closest_elements(numbers: Vec) -> (f64, f64) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = find_closest_elements;\n assert_eq!(candidate(vec![1.0, 2.0, 3.9, 4.0, 5.0, 2.2]), (3.9, 4.0));\n assert_eq!(candidate(vec![1.0, 2.0, 5.9, 4.0, 5.0]), (5.0, 5.9));\n assert_eq!(candidate(vec![1.0, 2.0, 3.0, 4.0, 5.0, 2.2]), (2.0, 2.2));\n assert_eq!(candidate(vec![1.0, 2.0, 3.0, 4.0, 5.0, 2.0]), (2.0, 2.0));\n assert_eq!(candidate(vec![1.1, 2.2, 3.1, 4.1, 5.1]), (2.2, 3.1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "rs", - "prompt": "/// You have been tasked to write a function that receives \n/// a hexadecimal number as a string and counts the number of hexadecimal \n/// digits that are primes (prime number, or a prime, is a natural number \n/// greater than 1 that is not a product of two smaller natural numbers).\n/// Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n/// Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n/// So you have to determine a number of the following digits: 2, 3, 5, 7, \n/// B (=decimal 11), D (=decimal 13).\n/// Note: you may assume the input is always correct or empty string, \n/// and symbols A,B,C,D,E,F are always uppercase.\n/// Examples:\n/// For num = \"AB\" the output should be 1.\n/// For num = \"1077E\" the output should be 2.\n/// For num = \"ABED1A33\" the output should be 4.\n/// For num = \"123456789ABCDEF0\" the output should be 6.\n/// For num = \"2020\" the output should be 2.\nfn hex_key(num: String) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = hex_key;\n assert_eq!(candidate(String::from(\"AB\")), 1);\n assert_eq!(candidate(String::from(\"1077E\")), 2);\n assert_eq!(candidate(String::from(\"ABED1A33\")), 4);\n assert_eq!(candidate(String::from(\"2020\")), 2);\n assert_eq!(candidate(String::from(\"123456789ABCDEF0\")), 6);\n assert_eq!(candidate(String::from(\"112233445566778899AABBCCDDEEFF00\")), 12);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "rs", - "prompt": "/// Complete the function that takes two integers and returns \n/// the product of their unit digits.\n/// Assume the input is always valid.\n/// Examples:\n/// multiply(148, 412) should return 16.\n/// multiply(19, 28) should return 72.\n/// multiply(2020, 1851) should return 0.\n/// multiply(14,-15) should return 20.\nfn multiply(a: isize, b: isize) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = multiply;\n assert_eq!(candidate(148, 412), 16);\n assert_eq!(candidate(19, 28), 72);\n assert_eq!(candidate(2020, 1851), 0);\n assert_eq!(candidate(14, -15), 20);\n assert_eq!(candidate(76, 67), 42);\n assert_eq!(candidate(17, 27), 49);\n assert_eq!(candidate(0, 1), 0);\n assert_eq!(candidate(0, 0), 0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "rs", - "prompt": "/// Given list of numbers (of at least two elements), apply a linear transform to that list,\n/// such that the smallest number will become 0 and the largest will become 1\n/// >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n/// [0.0, 0.25, 0.5, 0.75, 1.0]\nfn rescale_to_unit(numbers: Vec) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = rescale_to_unit;\n assert_eq!(candidate(vec![2.0, 49.9]), vec![0.0, 1.0]);\n assert_eq!(candidate(vec![100.0, 49.9]), vec![1.0, 0.0]);\n assert_eq!(candidate(vec![1.0, 2.0, 3.0, 4.0, 5.0]), vec![0.0, 0.25, 0.5, 0.75, 1.0]);\n assert_eq!(candidate(vec![2.0, 1.0, 5.0, 3.0, 4.0]), vec![0.25, 0.0, 1.0, 0.5, 0.75]);\n assert_eq!(candidate(vec![12.0, 11.0, 15.0, 13.0, 14.0]), vec![0.25, 0.0, 1.0, 0.5, 0.75]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "rs", - "prompt": "/// Given a positive integer n, return the product of the odd digits.\n/// Return 0 if all digits are even.\n/// For example:\n/// digits(1) == 1\n/// digits(4) == 0\n/// digits(235) == 15\nfn digits(n: isize) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = digits;\n assert_eq!(candidate(5), 5);\n assert_eq!(candidate(54), 5);\n assert_eq!(candidate(120), 1);\n assert_eq!(candidate(5014), 5);\n assert_eq!(candidate(98765), 315);\n assert_eq!(candidate(5576543), 2625);\n assert_eq!(candidate(2468), 0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "rs", - "prompt": "/// You will be given the name of a class (a string) and a list of extensions.\n/// The extensions are to be used to load additional classes to the class. The\n/// strength of the extension is as follows: Let CAP be the number of the uppercase\n/// letters in the extension's name, and let SM be the number of lowercase letters \n/// in the extension's name, the strength is given by the fraction CAP - SM. \n/// You should find the strongest extension and return a string in this \n/// format: ClassName.StrongestExtensionName.\n/// If there are two or more extensions with the same strength, you should\n/// choose the one that comes first in the list.\n/// For example, if you are given \"Slices\" as the class and a list of the\n/// extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n/// return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n/// (its strength is -1).\n/// Example:\n/// for Strongest_Extension('my_class', ['AA', 'Be', 'CC']) == 'my_class.AA'\nfn Strongest_Extension(class_name: String, extensions: Vec) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = Strongest_Extension;\n assert_eq!(candidate(String::from(\"Watashi\"), vec![String::from(\"tEN\"), String::from(\"niNE\"), String::from(\"eIGHt8OKe\")]), String::from(\"Watashi.eIGHt8OKe\"));\n assert_eq!(candidate(String::from(\"Boku123\"), vec![String::from(\"nani\"), String::from(\"NazeDa\"), String::from(\"YEs.WeCaNe\"), String::from(\"32145tggg\")]), String::from(\"Boku123.YEs.WeCaNe\"));\n assert_eq!(candidate(String::from(\"__YESIMHERE\"), vec![String::from(\"t\"), String::from(\"eMptY\"), String::from(\"nothing\"), String::from(\"zeR00\"), String::from(\"NuLl__\"), String::from(\"123NoooneB321\")]), String::from(\"__YESIMHERE.NuLl__\"));\n assert_eq!(candidate(String::from(\"K\"), vec![String::from(\"Ta\"), String::from(\"TAR\"), String::from(\"t234An\"), String::from(\"cosSo\")]), String::from(\"K.TAR\"));\n assert_eq!(candidate(String::from(\"__HAHA\"), vec![String::from(\"Tab\"), String::from(\"123\"), String::from(\"781345\"), String::from(\"-_-\")]), String::from(\"__HAHA.123\"));\n assert_eq!(candidate(String::from(\"YameRore\"), vec![String::from(\"HhAas\"), String::from(\"okIWILL123\"), String::from(\"WorkOut\"), String::from(\"Fails\"), String::from(\"-_-\")]), String::from(\"YameRore.okIWILL123\"));\n assert_eq!(candidate(String::from(\"finNNalLLly\"), vec![String::from(\"Die\"), String::from(\"NowW\"), String::from(\"Wow\"), String::from(\"WoW\")]), String::from(\"finNNalLLly.WoW\"));\n assert_eq!(candidate(String::from(\"_\"), vec![String::from(\"Bb\"), String::from(\"91245\")]), String::from(\"_.Bb\"));\n assert_eq!(candidate(String::from(\"Sp\"), vec![String::from(\"671235\"), String::from(\"Bb\")]), String::from(\"Sp.671235\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "rs", - "prompt": "use std::collections::HashMap;\n\n/// Given a string representing a space separated lowercase letters, return a dictionary\n/// of the letter with the most repetition and containing the corresponding count.\n/// If several letters have the same occurrence, return all of them.\n/// Example:\n/// histogram('a b c') == {'a': 1, 'b': 1, 'c': 1}\n/// histogram('a b b a') == {'a': 2, 'b': 2}\n/// histogram('a b c a b') == {'a': 2, 'b': 2}\n/// histogram('b b b b a') == {'b': 4}\n/// histogram('') == {}\nfn histogram(test: String) -> HashMap {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = histogram;\n assert_eq!(candidate(String::from(\"a b b a\")), HashMap::from([(String::from(\"a\"), 2), (String::from(\"b\"), 2)]));\n assert_eq!(candidate(String::from(\"a b c a b\")), HashMap::from([(String::from(\"a\"), 2), (String::from(\"b\"), 2)]));\n assert_eq!(candidate(String::from(\"a b c d g\")), HashMap::from([(String::from(\"a\"), 1), (String::from(\"b\"), 1), (String::from(\"c\"), 1), (String::from(\"d\"), 1), (String::from(\"g\"), 1)]));\n assert_eq!(candidate(String::from(\"r t g\")), HashMap::from([(String::from(\"r\"), 1), (String::from(\"t\"), 1), (String::from(\"g\"), 1)]));\n assert_eq!(candidate(String::from(\"b b b b a\")), HashMap::from([(String::from(\"b\"), 4)]));\n assert_eq!(candidate(String::from(\"r t g\")), HashMap::from([(String::from(\"r\"), 1), (String::from(\"t\"), 1), (String::from(\"g\"), 1)]));\n assert_eq!(candidate(String::from(\"\")), HashMap::from([]));\n assert_eq!(candidate(String::from(\"a\")), HashMap::from([(String::from(\"a\"), 1)]));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "rs", - "prompt": "/// pairs_sum_to_zero takes a list of integers as an input.\n/// it returns True if there are two distinct elements in the list that\n/// sum to zero, and False otherwise.\n/// >>> pairs_sum_to_zero([1, 3, 5, 0])\n/// False\n/// >>> pairs_sum_to_zero([1, 3, -2, 1])\n/// False\n/// >>> pairs_sum_to_zero([1, 2, 3, 7])\n/// False\n/// >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7])\n/// True\n/// >>> pairs_sum_to_zero([1])\n/// False\nfn pairs_sum_to_zero(l: Vec) -> bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = pairs_sum_to_zero;\n assert_eq!(candidate(vec![1, 3, 5, 0]), false);\n assert_eq!(candidate(vec![1, 3, -2, 1]), false);\n assert_eq!(candidate(vec![1, 2, 3, 7]), false);\n assert_eq!(candidate(vec![2, 4, -5, 3, 5, 7]), true);\n assert_eq!(candidate(vec![1]), false);\n assert_eq!(candidate(vec![-3, 9, -1, 3, 2, 30]), true);\n assert_eq!(candidate(vec![-3, 9, -1, 3, 2, 31]), true);\n assert_eq!(candidate(vec![-3, 9, -1, 4, 2, 30]), false);\n assert_eq!(candidate(vec![-3, 9, -1, 4, 2, 31]), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "rs", - "prompt": "/// Write a function that accepts two lists of strings and returns the list that has \n/// total number of chars in the all strings of the list less than the other list.\n/// if the two lists have the same number of chars, return the first list.\n/// Examples\n/// total_match([], []) \u279e []\n/// total_match(['hi', 'admin'], ['hI', 'Hi']) \u279e ['hI', 'Hi']\n/// total_match(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) \u279e ['hi', 'admin']\n/// total_match(['hi', 'admin'], ['hI', 'hi', 'hi']) \u279e ['hI', 'hi', 'hi']\n/// total_match(['4'], ['1', '2', '3', '4', '5']) \u279e ['4']\nfn total_match(lst1: Vec, lst2: Vec) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = total_match;\n assert_eq!(candidate(Vec::::new(), Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![String::from(\"hi\"), String::from(\"admin\")], vec![String::from(\"hi\"), String::from(\"hi\")]), vec![String::from(\"hi\"), String::from(\"hi\")]);\n assert_eq!(candidate(vec![String::from(\"hi\"), String::from(\"admin\")], vec![String::from(\"hi\"), String::from(\"hi\"), String::from(\"admin\"), String::from(\"project\")]), vec![String::from(\"hi\"), String::from(\"admin\")]);\n assert_eq!(candidate(vec![String::from(\"4\")], vec![String::from(\"1\"), String::from(\"2\"), String::from(\"3\"), String::from(\"4\"), String::from(\"5\")]), vec![String::from(\"4\")]);\n assert_eq!(candidate(vec![String::from(\"hi\"), String::from(\"admin\")], vec![String::from(\"hI\"), String::from(\"Hi\")]), vec![String::from(\"hI\"), String::from(\"Hi\")]);\n assert_eq!(candidate(vec![String::from(\"hi\"), String::from(\"admin\")], vec![String::from(\"hI\"), String::from(\"hi\"), String::from(\"hi\")]), vec![String::from(\"hI\"), String::from(\"hi\"), String::from(\"hi\")]);\n assert_eq!(candidate(vec![String::from(\"hi\"), String::from(\"admin\")], vec![String::from(\"hI\"), String::from(\"hi\"), String::from(\"hii\")]), vec![String::from(\"hi\"), String::from(\"admin\")]);\n assert_eq!(candidate(Vec::::new(), vec![String::from(\"this\")]), Vec::::new());\n assert_eq!(candidate(vec![String::from(\"this\")], Vec::::new()), Vec::::new());\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "rs", - "prompt": "/// Circular shift the digits of the integer x, shift the digits right by shift\n/// and return the result as a string.\n/// If shift > number of digits, return digits reversed.\n/// >>> circular_shift(12, 1)\n/// \"21\"\n/// >>> circular_shift(12, 2)\n/// \"12\"\nfn circular_shift(x: isize, shift: isize) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = circular_shift;\n assert_eq!(candidate(100, 2), String::from(\"001\"));\n assert_eq!(candidate(12, 2), String::from(\"12\"));\n assert_eq!(candidate(97, 8), String::from(\"79\"));\n assert_eq!(candidate(12, 1), String::from(\"21\"));\n assert_eq!(candidate(11, 101), String::from(\"11\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "rs", - "prompt": "/// Return True is list elements are monotonically increasing or decreasing.\n/// >>> monotonic([1, 2, 4, 20])\n/// True\n/// >>> monotonic([1, 20, 4, 10])\n/// False\n/// >>> monotonic([4, 1, 0, -10])\n/// True\nfn monotonic(l: Vec) -> bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = monotonic;\n assert_eq!(candidate(vec![1, 2, 4, 10]), true);\n assert_eq!(candidate(vec![1, 2, 4, 20]), true);\n assert_eq!(candidate(vec![1, 20, 4, 10]), false);\n assert_eq!(candidate(vec![4, 1, 0, -10]), true);\n assert_eq!(candidate(vec![4, 1, 1, 0]), true);\n assert_eq!(candidate(vec![1, 2, 3, 2, 5, 60]), false);\n assert_eq!(candidate(vec![1, 2, 3, 4, 5, 60]), true);\n assert_eq!(candidate(vec![9, 9, 9, 9]), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "rs", - "prompt": "/// Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n/// Example\n/// is_equal_to_sum_even(4) == False\n/// is_equal_to_sum_even(6) == False\n/// is_equal_to_sum_even(8) == True\nfn is_equal_to_sum_even(n: isize) -> bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = is_equal_to_sum_even;\n assert_eq!(candidate(4), false);\n assert_eq!(candidate(6), false);\n assert_eq!(candidate(8), true);\n assert_eq!(candidate(10), true);\n assert_eq!(candidate(11), false);\n assert_eq!(candidate(12), true);\n assert_eq!(candidate(13), false);\n assert_eq!(candidate(16), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "rs", - "prompt": "/// Input to this function is a string representing musical notes in a special ASCII format.\n/// Your task is to parse this string and return list of integers corresponding to how many beats does each\n/// not last.\n/// Here is a legend:\n/// 'o' - whole note, lasts four beats\n/// 'o|' - half note, lasts two beats\n/// '.|' - quater note, lasts one beat\n/// >>> parse_music('o o| .| o| o| .| .| .| .| o o')\n/// [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\nfn parse_music(music_string: String) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = parse_music;\n assert_eq!(candidate(String::from(\"\")), Vec::::new());\n assert_eq!(candidate(String::from(\"o o o o\")), vec![4, 4, 4, 4]);\n assert_eq!(candidate(String::from(\".| .| .| .|\")), vec![1, 1, 1, 1]);\n assert_eq!(candidate(String::from(\"o| o| .| .| o o o o\")), vec![2, 2, 1, 1, 4, 4, 4, 4]);\n assert_eq!(candidate(String::from(\"o| .| o| .| o o| o o|\")), vec![2, 1, 2, 1, 4, 2, 4, 2]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "rs", - "prompt": "/// \"\n/// This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n/// multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n/// change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n/// Examples:\n/// For lst = [1,2,3] the output should be 6\n/// For lst = [] the output should be 0\n/// For lst = [-1,-5,2,-1,-5] the output should be -126\nfn sum_squares(lst: Vec) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = sum_squares;\n assert_eq!(candidate(vec![1, 2, 3]), 6);\n assert_eq!(candidate(vec![1, 4, 9]), 14);\n assert_eq!(candidate(Vec::::new()), 0);\n assert_eq!(candidate(vec![1, 1, 1, 1, 1, 1, 1, 1, 1]), 9);\n assert_eq!(candidate(vec![-1, -1, -1, -1, -1, -1, -1, -1, -1]), -3);\n assert_eq!(candidate(vec![0]), 0);\n assert_eq!(candidate(vec![-1, -5, 2, -1, -5]), -126);\n assert_eq!(candidate(vec![-56, -99, 1, 0, -2]), 3030);\n assert_eq!(candidate(vec![-1, 0, 0, 0, 0, 0, 0, 0, -1]), 0);\n assert_eq!(candidate(vec![-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37]), -14196);\n assert_eq!(candidate(vec![-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10]), -1448);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "rs", - "prompt": "/// triples_sum_to_zero takes a list of integers as an input.\n/// it returns True if there are three distinct elements in the list that\n/// sum to zero, and False otherwise.\n/// >>> triples_sum_to_zero([1, 3, 5, 0])\n/// False\n/// >>> triples_sum_to_zero([1, 3, -2, 1])\n/// True\n/// >>> triples_sum_to_zero([1, 2, 3, 7])\n/// False\n/// >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n/// True\n/// >>> triples_sum_to_zero([1])\n/// False\nfn triples_sum_to_zero(l: Vec) -> bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = triples_sum_to_zero;\n assert_eq!(candidate(vec![1, 3, 5, 0]), false);\n assert_eq!(candidate(vec![1, 3, 5, -1]), false);\n assert_eq!(candidate(vec![1, 3, -2, 1]), true);\n assert_eq!(candidate(vec![1, 2, 3, 7]), false);\n assert_eq!(candidate(vec![1, 2, 5, 7]), false);\n assert_eq!(candidate(vec![2, 4, -5, 3, 9, 7]), true);\n assert_eq!(candidate(vec![1]), false);\n assert_eq!(candidate(vec![1, 3, 5, -100]), false);\n assert_eq!(candidate(vec![100, 3, 5, -100]), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "rs", - "prompt": "/// brackets is a string of \"<\" and \">\".\n/// return True if every opening bracket has a corresponding closing bracket.\n/// >>> correct_bracketing(\"<\")\n/// False\n/// >>> correct_bracketing(\"<>\")\n/// True\n/// >>> correct_bracketing(\"<<><>>\")\n/// True\n/// >>> correct_bracketing(\"><<>\")\n/// False\nfn correct_bracketing(brackets: String) -> bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = correct_bracketing;\n assert_eq!(candidate(String::from(\"<>\")), true);\n assert_eq!(candidate(String::from(\"<<><>>\")), true);\n assert_eq!(candidate(String::from(\"<><><<><>><>\")), true);\n assert_eq!(candidate(String::from(\"<><><<<><><>><>><<><><<>>>\")), true);\n assert_eq!(candidate(String::from(\"<<<><>>>>\")), false);\n assert_eq!(candidate(String::from(\"><<>\")), false);\n assert_eq!(candidate(String::from(\"<\")), false);\n assert_eq!(candidate(String::from(\"<<<<\")), false);\n assert_eq!(candidate(String::from(\">\")), false);\n assert_eq!(candidate(String::from(\"<<>\")), false);\n assert_eq!(candidate(String::from(\"<><><<><>><>><<>\")), false);\n assert_eq!(candidate(String::from(\"<><><<><>><>>><>\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "rs", - "prompt": "/// Write a function that takes an array of numbers as input and returns \n/// the number of elements in the array that are greater than 10 and both \n/// first and last digits of a number are odd (1, 3, 5, 7, 9).\n/// For example:\n/// specialFilter([15, -73, 14, -15]) => 1 \n/// specialFilter([33, -2, -3, 45, 21, 109]) => 2\nfn specialFilter(nums: Vec) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = specialFilter;\n assert_eq!(candidate(vec![5, -2, 1, -5]), 0);\n assert_eq!(candidate(vec![15, -73, 14, -15]), 1);\n assert_eq!(candidate(vec![33, -2, -3, 45, 21, 109]), 2);\n assert_eq!(candidate(vec![43, -12, 93, 125, 121, 109]), 4);\n assert_eq!(candidate(vec![71, -2, -33, 75, 21, 19]), 3);\n assert_eq!(candidate(vec![1]), 0);\n assert_eq!(candidate(Vec::::new()), 0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "rs", - "prompt": "use std::collections::HashMap;\n\n/// Given a dictionary, return True if all keys are strings in lower \n/// case or all keys are strings in upper case, else return False.\n/// The function should return False is the given dictionary is empty.\n/// Examples:\n/// check_dict_case({\"a\":\"apple\", \"b\":\"banana\"}) should return True.\n/// check_dict_case({\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}) should return False.\n/// check_dict_case({\"a\":\"apple\", \"8\":\"banana\", \"a\":\"apple\"}) should return False.\n/// check_dict_case({\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}) should return False.\n/// check_dict_case({\"STATE\":\"NC\", \"ZIP\":\"12345\" }) should return True.\nfn check_dict_case(dict: HashMap) -> bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = check_dict_case;\n assert_eq!(candidate(HashMap::from([(String::from(\"p\"), String::from(\"pineapple\")), (String::from(\"b\"), String::from(\"banana\"))])), true);\n assert_eq!(candidate(HashMap::from([(String::from(\"p\"), String::from(\"pineapple\")), (String::from(\"A\"), String::from(\"banana\")), (String::from(\"B\"), String::from(\"banana\"))])), false);\n assert_eq!(candidate(HashMap::from([(String::from(\"p\"), String::from(\"pineapple\")), (String::from(\"5\"), String::from(\"banana\")), (String::from(\"a\"), String::from(\"apple\"))])), false);\n assert_eq!(candidate(HashMap::from([(String::from(\"Name\"), String::from(\"John\")), (String::from(\"Age\"), String::from(\"36\")), (String::from(\"City\"), String::from(\"Houston\"))])), false);\n assert_eq!(candidate(HashMap::from([(String::from(\"STATE\"), String::from(\"NC\")), (String::from(\"ZIP\"), String::from(\"12345\"))])), true);\n assert_eq!(candidate(HashMap::from([(String::from(\"fruit\"), String::from(\"Orange\")), (String::from(\"taste\"), String::from(\"Sweet\"))])), true);\n assert_eq!(candidate(HashMap::from([])), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "rs", - "prompt": "/// The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n/// fibfib(0) == 0\n/// fibfib(1) == 0\n/// fibfib(2) == 1\n/// fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n/// Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n/// >>> fibfib(1)\n/// 0\n/// >>> fibfib(5)\n/// 4\n/// >>> fibfib(8)\n/// 24\nfn fibfib(n: isize) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = fibfib;\n assert_eq!(candidate(2), 1);\n assert_eq!(candidate(1), 0);\n assert_eq!(candidate(5), 4);\n assert_eq!(candidate(8), 24);\n assert_eq!(candidate(10), 81);\n assert_eq!(candidate(12), 274);\n assert_eq!(candidate(14), 927);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "rs", - "prompt": "/// You are given a list of numbers.\n/// You need to return the sum of squared numbers in the given list,\n/// round each element in the list to the upper int(Ceiling) first.\n/// Examples:\n/// For lst = [1,2,3] the output should be 14\n/// For lst = [1,4,9] the output should be 98\n/// For lst = [1,3,5,7] the output should be 84\n/// For lst = [1.4,4.2,0] the output should be 29\n/// For lst = [-2.4,1,1] the output should be 6\nfn sum_squares(lst: Vec) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = sum_squares;\n assert_eq!(candidate(vec![1.0, 2.0, 3.0]), 14);\n assert_eq!(candidate(vec![1.0, 2.0, 3.0]), 14);\n assert_eq!(candidate(vec![1.0, 3.0, 5.0, 7.0]), 84);\n assert_eq!(candidate(vec![1.4, 4.2, 0.0]), 29);\n assert_eq!(candidate(vec![-2.4, 1.0, 1.0]), 6);\n assert_eq!(candidate(vec![100.0, 1.0, 15.0, 2.0]), 10230);\n assert_eq!(candidate(vec![10000.0, 10000.0]), 200000000);\n assert_eq!(candidate(vec![-1.4, 4.6, 6.3]), 75);\n assert_eq!(candidate(vec![-1.4, 17.9, 18.9, 19.9]), 1086);\n assert_eq!(candidate(vec![0.0]), 0);\n assert_eq!(candidate(vec![-1.0]), 1);\n assert_eq!(candidate(vec![-1.0, 1.0, 0.0]), 2);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_85_add", - "language": "rs", - "prompt": "/// Given a non-empty list of integers lst. add the even elements that are at odd indices..\n/// Examples:\n/// add([4, 2, 6, 7]) ==> 2\nfn add(lst: Vec) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = add;\n assert_eq!(candidate(vec![4, 88]), 88);\n assert_eq!(candidate(vec![4, 5, 6, 7, 2, 122]), 122);\n assert_eq!(candidate(vec![4, 0, 6, 7]), 0);\n assert_eq!(candidate(vec![4, 4, 6, 8]), 12);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "rs", - "prompt": "/// Return sorted unique elements in a list\n/// >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123])\n/// [0, 2, 3, 5, 9, 123]\nfn unique(l: Vec) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = unique;\n assert_eq!(candidate(vec![5, 3, 5, 2, 3, 3, 9, 0, 123]), vec![0, 2, 3, 5, 9, 123]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "rs", - "prompt": "/// Given a string text, replace all spaces in it with underscores, \n/// and if a string has more than 2 consecutive spaces, \n/// then replace all consecutive spaces with - \n/// fix_spaces(\"Example\") == \"Example\"\n/// fix_spaces(\"Example 1\") == \"Example_1\"\n/// fix_spaces(\" Example 2\") == \"_Example_2\"\n/// fix_spaces(\" Example 3\") == \"_Example-3\"\nfn fix_spaces(text: String) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = fix_spaces;\n assert_eq!(candidate(String::from(\"Example\")), String::from(\"Example\"));\n assert_eq!(candidate(String::from(\"Mudasir Hanif \")), String::from(\"Mudasir_Hanif_\"));\n assert_eq!(candidate(String::from(\"Yellow Yellow Dirty Fellow\")), String::from(\"Yellow_Yellow__Dirty__Fellow\"));\n assert_eq!(candidate(String::from(\"Exa mple\")), String::from(\"Exa-mple\"));\n assert_eq!(candidate(String::from(\" Exa 1 2 2 mple\")), String::from(\"-Exa_1_2_2_mple\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "rs", - "prompt": "/// Return 2^n modulo p (be aware of numerics).\n/// >>> modp(3, 5)\n/// 3\n/// >>> modp(1101, 101)\n/// 2\n/// >>> modp(0, 101)\n/// 1\n/// >>> modp(3, 11)\n/// 8\n/// >>> modp(100, 101)\n/// 1\nfn modp(n: isize, p: isize) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = modp;\n assert_eq!(candidate(3, 5), 3);\n assert_eq!(candidate(1101, 101), 2);\n assert_eq!(candidate(0, 101), 1);\n assert_eq!(candidate(3, 11), 8);\n assert_eq!(candidate(100, 101), 1);\n assert_eq!(candidate(30, 5), 4);\n assert_eq!(candidate(31, 5), 3);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "rs", - "prompt": "/// You have to write a function which validates a given date string and\n/// returns True if the date is valid otherwise False.\n/// The date is valid if all of the following rules are satisfied:\n/// 1. The date string is not empty.\n/// 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n/// 3. The months should not be less than 1 or higher than 12.\n/// 4. The date should be in the format: mm-dd-yyyy\n/// for example: \n/// valid_date('03-11-2000') => True\n/// valid_date('15-01-2012') => False\n/// valid_date('04-0-2040') => False\n/// valid_date('06-04-2020') => True\n/// valid_date('06/04/2020') => False\nfn valid_date(date: String) -> bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = valid_date;\n assert_eq!(candidate(String::from(\"03-11-2000\")), true);\n assert_eq!(candidate(String::from(\"15-01-2012\")), false);\n assert_eq!(candidate(String::from(\"04-0-2040\")), false);\n assert_eq!(candidate(String::from(\"06-04-2020\")), true);\n assert_eq!(candidate(String::from(\"01-01-2007\")), true);\n assert_eq!(candidate(String::from(\"03-32-2011\")), false);\n assert_eq!(candidate(String::from(\"\")), false);\n assert_eq!(candidate(String::from(\"04-31-3000\")), false);\n assert_eq!(candidate(String::from(\"06-06-2005\")), true);\n assert_eq!(candidate(String::from(\"21-31-2000\")), false);\n assert_eq!(candidate(String::from(\"04-12-2003\")), true);\n assert_eq!(candidate(String::from(\"04122003\")), false);\n assert_eq!(candidate(String::from(\"20030412\")), false);\n assert_eq!(candidate(String::from(\"2003-04\")), false);\n assert_eq!(candidate(String::from(\"2003-04-12\")), false);\n assert_eq!(candidate(String::from(\"04-2003\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "rs", - "prompt": "/// Write a function that takes a string and returns an ordered version of it.\n/// Ordered version of string, is a string where all words (separated by space)\n/// are replaced by a new word where all the characters arranged in\n/// ascending order based on ascii value.\n/// Note: You should keep the order of words and blank spaces in the sentence.\n/// For example:\n/// anti_shuffle('Hi') returns 'Hi'\n/// anti_shuffle('hello') returns 'ehllo'\n/// anti_shuffle('Hello World!!!') returns 'Hello !!!Wdlor'\nfn anti_shuffle(s: String) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = anti_shuffle;\n assert_eq!(candidate(String::from(\"Hi\")), String::from(\"Hi\"));\n assert_eq!(candidate(String::from(\"hello\")), String::from(\"ehllo\"));\n assert_eq!(candidate(String::from(\"number\")), String::from(\"bemnru\"));\n assert_eq!(candidate(String::from(\"abcd\")), String::from(\"abcd\"));\n assert_eq!(candidate(String::from(\"Hello World!!!\")), String::from(\"Hello !!!Wdlor\"));\n assert_eq!(candidate(String::from(\"\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"Hi. My name is Mister Robot. How are you?\")), String::from(\".Hi My aemn is Meirst .Rboot How aer ?ouy\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "rs", - "prompt": "/// Given a list of numbers, return whether or not they are sorted\n/// in ascending order. If list has more than 1 duplicate of the same\n/// number, return False. Assume no negative numbers and only integers.\n/// Examples\n/// is_sorted([5]) \u279e True\n/// is_sorted([1, 2, 3, 4, 5]) \u279e True\n/// is_sorted([1, 3, 2, 4, 5]) \u279e False\n/// is_sorted([1, 2, 3, 4, 5, 6]) \u279e True\n/// is_sorted([1, 2, 3, 4, 5, 6, 7]) \u279e True\n/// is_sorted([1, 3, 2, 4, 5, 6, 7]) \u279e False\n/// is_sorted([1, 2, 2, 3, 3, 4]) \u279e True\n/// is_sorted([1, 2, 2, 2, 3, 4]) \u279e False\nfn is_sorted(lst: Vec) -> bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = is_sorted;\n assert_eq!(candidate(vec![5]), true);\n assert_eq!(candidate(vec![1, 2, 3, 4, 5]), true);\n assert_eq!(candidate(vec![1, 3, 2, 4, 5]), false);\n assert_eq!(candidate(vec![1, 2, 3, 4, 5, 6]), true);\n assert_eq!(candidate(vec![1, 2, 3, 4, 5, 6, 7]), true);\n assert_eq!(candidate(vec![1, 3, 2, 4, 5, 6, 7]), false);\n assert_eq!(candidate(Vec::::new()), true);\n assert_eq!(candidate(vec![1]), true);\n assert_eq!(candidate(vec![3, 2, 1]), false);\n assert_eq!(candidate(vec![1, 2, 2, 2, 3, 4]), false);\n assert_eq!(candidate(vec![1, 2, 3, 3, 3, 4]), false);\n assert_eq!(candidate(vec![1, 2, 2, 3, 3, 4]), true);\n assert_eq!(candidate(vec![1, 2, 3, 4]), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "rs", - "prompt": "/// You are given a string s.\n/// Your task is to check if the string is happy or not.\n/// A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n/// For example:\n/// is_happy(a) => False\n/// is_happy(aa) => False\n/// is_happy(abcd) => True\n/// is_happy(aabb) => False\n/// is_happy(adb) => True\n/// is_happy(xyy) => False\nfn is_happy(s: String) -> bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = is_happy;\n assert_eq!(candidate(String::from(\"a\")), false);\n assert_eq!(candidate(String::from(\"aa\")), false);\n assert_eq!(candidate(String::from(\"abcd\")), true);\n assert_eq!(candidate(String::from(\"aabb\")), false);\n assert_eq!(candidate(String::from(\"adb\")), true);\n assert_eq!(candidate(String::from(\"xyy\")), false);\n assert_eq!(candidate(String::from(\"iopaxpoi\")), true);\n assert_eq!(candidate(String::from(\"iopaxioi\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "rs", - "prompt": "/// Write a function that returns True if the object q will fly, and False otherwise.\n/// The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n/// Example:\n/// will_it_fly([1, 2], 5) \u279e False \n/// # 1+2 is less than the maximum possible weight, but it's unbalanced.\n/// will_it_fly([3, 2, 3], 1) \u279e False\n/// # it's balanced, but 3+2+3 is more than the maximum possible weight.\n/// will_it_fly([3, 2, 3], 9) \u279e True\n/// # 3+2+3 is less than the maximum possible weight, and it's balanced.\n/// will_it_fly([3], 5) \u279e True\n/// # 3 is less than the maximum possible weight, and it's balanced.\nfn will_it_fly(q: Vec, w: isize) -> bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = will_it_fly;\n assert_eq!(candidate(vec![3, 2, 3], 9), true);\n assert_eq!(candidate(vec![1, 2], 5), false);\n assert_eq!(candidate(vec![3], 5), true);\n assert_eq!(candidate(vec![3, 2, 3], 1), false);\n assert_eq!(candidate(vec![1, 2, 3], 6), false);\n assert_eq!(candidate(vec![5], 5), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "rs", - "prompt": "/// Given an array of non-negative integers, return a copy of the given array after sorting,\n/// you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n/// or sort it in descending order if the sum( first index value, last index value) is even.\n/// Note:\n/// * don't change the given array.\n/// Examples:\n/// * sort_array([]) => []\n/// * sort_array([5]) => [5]\n/// * sort_array([2, 4, 3, 0, 1, 5]) => [0, 1, 2, 3, 4, 5]\n/// * sort_array([2, 4, 3, 0, 1, 5, 6]) => [6, 5, 4, 3, 2, 1, 0]\nfn sort_array(array: Vec) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = sort_array;\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![5]), vec![5]);\n assert_eq!(candidate(vec![2, 4, 3, 0, 1, 5]), vec![0, 1, 2, 3, 4, 5]);\n assert_eq!(candidate(vec![2, 4, 3, 0, 1, 5, 6]), vec![6, 5, 4, 3, 2, 1, 0]);\n assert_eq!(candidate(vec![2, 1]), vec![1, 2]);\n assert_eq!(candidate(vec![15, 42, 87, 32, 11, 0]), vec![0, 11, 15, 32, 42, 87]);\n assert_eq!(candidate(vec![21, 14, 23, 11]), vec![23, 21, 14, 11]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "rs", - "prompt": "/// Implement a function that takes an non-negative integer and returns an array of the first n\n/// integers that are prime numbers and less than n.\n/// for example:\n/// count_up_to(5) => [2,3]\n/// count_up_to(11) => [2,3,5,7]\n/// count_up_to(0) => []\n/// count_up_to(20) => [2,3,5,7,11,13,17,19]\n/// count_up_to(1) => []\n/// count_up_to(18) => [2,3,5,7,11,13,17]\nfn count_up_to(n: isize) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = count_up_to;\n assert_eq!(candidate(5), vec![2, 3]);\n assert_eq!(candidate(6), vec![2, 3, 5]);\n assert_eq!(candidate(7), vec![2, 3, 5]);\n assert_eq!(candidate(10), vec![2, 3, 5, 7]);\n assert_eq!(candidate(0), Vec::::new());\n assert_eq!(candidate(22), vec![2, 3, 5, 7, 11, 13, 17, 19]);\n assert_eq!(candidate(1), Vec::::new());\n assert_eq!(candidate(18), vec![2, 3, 5, 7, 11, 13, 17]);\n assert_eq!(candidate(47), vec![2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43]);\n assert_eq!(candidate(101), vec![2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "rs", - "prompt": "/// Out of list of strings, return the longest one. Return the first one in case of multiple\n/// strings of the same length. Return None in case the input list is empty.\n/// >>> longest([])\n/// >>> longest(['a', 'b', 'c'])\n/// 'a'\n/// >>> longest(['a', 'bb', 'ccc'])\n/// 'ccc'\nfn longest(strings: Vec) -> Option {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = longest;\n assert_eq!(candidate(Vec::::new()), None);\n assert_eq!(candidate(vec![String::from(\"x\"), String::from(\"y\"), String::from(\"z\")]), Some(String::from(\"x\")));\n assert_eq!(candidate(vec![String::from(\"x\"), String::from(\"yyy\"), String::from(\"zzzz\"), String::from(\"www\"), String::from(\"kkkk\"), String::from(\"abc\")]), Some(String::from(\"zzzz\")));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "rs", - "prompt": "/// Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n/// reverse the resulting array, and then replace each digit by its corresponding name from\n/// \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n/// For example:\n/// arr = [2, 1, 1, 4, 5, 8, 2, 3] \n/// -> sort arr -> [1, 1, 2, 2, 3, 4, 5, 8] \n/// -> reverse arr -> [8, 5, 4, 3, 2, 2, 1, 1]\n/// return [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n/// If the array is empty, return an empty array:\n/// arr = []\n/// return []\n/// If the array has any strange number ignore it:\n/// arr = [1, -1 , 55] \n/// -> sort arr -> [-1, 1, 55]\n/// -> reverse arr -> [55, 1, -1]\n/// return = ['One']\nfn by_length(arr: Vec) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = by_length;\n assert_eq!(candidate(vec![2, 1, 1, 4, 5, 8, 2, 3]), vec![String::from(\"Eight\"), String::from(\"Five\"), String::from(\"Four\"), String::from(\"Three\"), String::from(\"Two\"), String::from(\"Two\"), String::from(\"One\"), String::from(\"One\")]);\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![1, -1, 55]), vec![String::from(\"One\")]);\n assert_eq!(candidate(vec![1, -1, 3, 2]), vec![String::from(\"Three\"), String::from(\"Two\"), String::from(\"One\")]);\n assert_eq!(candidate(vec![9, 4, 8]), vec![String::from(\"Nine\"), String::from(\"Eight\"), String::from(\"Four\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_106_f", - "language": "rs", - "prompt": "/// Implement the function f that takes n as a parameter,\n/// 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\n/// or the sum of numbers from 1 to i otherwise.\n/// i starts from 1.\n/// the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n/// Example:\n/// f(5) == [1, 2, 6, 24, 15]\nfn f(n: isize) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = f;\n assert_eq!(candidate(5), vec![1, 2, 6, 24, 15]);\n assert_eq!(candidate(7), vec![1, 2, 6, 24, 15, 720, 28]);\n assert_eq!(candidate(1), vec![1]);\n assert_eq!(candidate(3), vec![1, 2, 6]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "rs", - "prompt": "/// Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n/// >>> fizz_buzz(50)\n/// 0\n/// >>> fizz_buzz(78)\n/// 2\n/// >>> fizz_buzz(79)\n/// 3\nfn fizz_buzz(n: isize) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = fizz_buzz;\n assert_eq!(candidate(50), 0);\n assert_eq!(candidate(78), 2);\n assert_eq!(candidate(79), 3);\n assert_eq!(candidate(100), 3);\n assert_eq!(candidate(200), 6);\n assert_eq!(candidate(4000), 192);\n assert_eq!(candidate(10000), 639);\n assert_eq!(candidate(100000), 8026);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "rs", - "prompt": "/// Given a positive floating point number, it can be decomposed into\n/// and integer part (largest integer smaller than given number) and decimals\n/// (leftover part always smaller than 1).\n/// Return the decimal part of the number.\n/// >>> truncate_number(3.5)\n/// 0.5\nfn truncate_number(number: f64) -> f64 {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = truncate_number;\n assert_eq!(candidate(3.5), 0.5);\n assert_eq!(candidate(1.25), 0.25);\n assert_eq!(candidate(123.0), 0.0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "rs", - "prompt": "/// For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n/// Empty sum should be equal to 0 and empty product should be equal to 1.\n/// >>> sum_product([])\n/// (0, 1)\n/// >>> sum_product([1, 2, 3, 4])\n/// (10, 24)\nfn sum_product(numbers: Vec) -> (isize, isize) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = sum_product;\n assert_eq!(candidate(Vec::::new()), (0, 1));\n assert_eq!(candidate(vec![1, 1, 1]), (3, 1));\n assert_eq!(candidate(vec![100, 0]), (100, 0));\n assert_eq!(candidate(vec![3, 5, 7]), (15, 105));\n assert_eq!(candidate(vec![10]), (10, 10));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "rs", - "prompt": "/// You are given a 2 dimensional data, as a nested lists,\n/// which is similar to matrix, however, unlike matrices,\n/// each row may contain a different number of columns.\n/// Given lst, and integer x, find integers x in the list,\n/// and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n/// each tuple is a coordinate - (row, columns), starting with 0.\n/// Sort coordinates initially by rows in ascending order.\n/// Also, sort coordinates of the row by columns in descending order.\n/// Examples:\n/// get_row([\n/// [1,2,3,4,5,6],\n/// [1,2,3,4,1,6],\n/// [1,2,3,4,5,1]\n/// ], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n/// get_row([], 1) == []\n/// get_row([[], [1], [1, 2, 3]], 3) == [(2, 2)]\nfn get_row(lst: Vec>, x: isize) -> Vec<(isize, isize)> {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = get_row;\n assert_eq!(candidate(vec![vec![1, 2, 3, 4, 5, 6], vec![1, 2, 3, 4, 1, 6], vec![1, 2, 3, 4, 5, 1]], 1), vec![(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]);\n assert_eq!(candidate(vec![vec![1, 2, 3, 4, 5, 6], vec![1, 2, 3, 4, 5, 6], vec![1, 2, 3, 4, 5, 6], vec![1, 2, 3, 4, 5, 6], vec![1, 2, 3, 4, 5, 6], vec![1, 2, 3, 4, 5, 6]], 2), vec![(0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1)]);\n assert_eq!(candidate(vec![vec![1, 2, 3, 4, 5, 6], vec![1, 2, 3, 4, 5, 6], vec![1, 1, 3, 4, 5, 6], vec![1, 2, 1, 4, 5, 6], vec![1, 2, 3, 1, 5, 6], vec![1, 2, 3, 4, 1, 6], vec![1, 2, 3, 4, 5, 1]], 1), vec![(0, 0), (1, 0), (2, 1), (2, 0), (3, 2), (3, 0), (4, 3), (4, 0), (5, 4), (5, 0), (6, 5), (6, 0)]);\n assert_eq!(candidate(Vec::>::new(), 1), Vec::<(isize, isize)>::new());\n assert_eq!(candidate(vec![vec![1]], 2), Vec::<(isize, isize)>::new());\n assert_eq!(candidate(vec![vec![], vec![1], vec![1, 2, 3]], 3), vec![(2, 2)]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "rs", - "prompt": "/// You're a hungry rabbit, and you already have eaten a certain number of carrots,\n/// but now you need to eat more carrots to complete the day's meals.\n/// you should return an array of [ total number of eaten carrots after your meals,\n/// the number of carrots left after your meals ]\n/// if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n/// Example:\n/// * eat(5, 6, 10) -> [11, 4]\n/// * eat(4, 8, 9) -> [12, 1]\n/// * eat(1, 10, 10) -> [11, 0]\n/// * eat(2, 11, 5) -> [7, 0]\n/// Variables:\n/// @number : integer\n/// the number of carrots that you have eaten.\n/// @need : integer\n/// the number of carrots that you need to eat.\n/// @remaining : integer\n/// the number of remaining carrots thet exist in stock\n/// Constrain:\n/// * 0 <= number <= 1000\n/// * 0 <= need <= 1000\n/// * 0 <= remaining <= 1000\n/// Have fun :)\nfn eat(number: isize, need: isize, remaining: isize) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = eat;\n assert_eq!(candidate(5, 6, 10), vec![11, 4]);\n assert_eq!(candidate(4, 8, 9), vec![12, 1]);\n assert_eq!(candidate(1, 10, 10), vec![11, 0]);\n assert_eq!(candidate(2, 11, 5), vec![7, 0]);\n assert_eq!(candidate(4, 5, 7), vec![9, 2]);\n assert_eq!(candidate(4, 5, 1), vec![5, 0]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "rs", - "prompt": "/// Given a positive integer N, return the total sum of its digits in binary.\n/// Example\n/// For N = 1000, the sum of digits will be 1 the output should be \"1\".\n/// For N = 150, the sum of digits will be 6 the output should be \"110\".\n/// For N = 147, the sum of digits will be 12 the output should be \"1100\".\n/// Variables:\n/// @N integer\n/// Constraints: 0 \u2264 N \u2264 10000.\n/// Output:\n/// a string of binary number\nfn solve(N: isize) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = solve;\n assert_eq!(candidate(1000), String::from(\"1\"));\n assert_eq!(candidate(150), String::from(\"110\"));\n assert_eq!(candidate(147), String::from(\"1100\"));\n assert_eq!(candidate(333), String::from(\"1001\"));\n assert_eq!(candidate(963), String::from(\"10010\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "rs", - "prompt": "/// You are given a list of integers.\n/// You need to find the largest prime value and return the sum of its digits.\n/// Examples:\n/// For lst = [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] the output should be 10\n/// For lst = [1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1] the output should be 25\n/// For lst = [1,3,1,32,5107,34,83278,109,163,23,2323,32,30,1,9,3] the output should be 13\n/// For lst = [0,724,32,71,99,32,6,0,5,91,83,0,5,6] the output should be 11\n/// For lst = [0,81,12,3,1,21] the output should be 3\n/// For lst = [0,8,1,2,1,7] the output should be 7\nfn skjkasdkd(lst: Vec) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = skjkasdkd;\n assert_eq!(candidate(vec![0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]), 10);\n assert_eq!(candidate(vec![1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]), 25);\n assert_eq!(candidate(vec![1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]), 13);\n assert_eq!(candidate(vec![0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]), 11);\n assert_eq!(candidate(vec![0, 81, 12, 3, 1, 21]), 3);\n assert_eq!(candidate(vec![0, 8, 1, 2, 1, 7]), 7);\n assert_eq!(candidate(vec![8191]), 19);\n assert_eq!(candidate(vec![8191, 123456, 127, 7]), 19);\n assert_eq!(candidate(vec![127, 97, 8192]), 10);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "rs", - "prompt": "/// Given an array arr of integers, find the minimum number of elements that\n/// need to be changed to make the array palindromic. A palindromic array is an array that\n/// is read the same backwards and forwards. In one change, you can change one element to any other element.\n/// For example:\n/// smallest_change([1,2,3,5,4,7,9,6]) == 4\n/// smallest_change([1, 2, 3, 4, 3, 2, 2]) == 1\n/// smallest_change([1, 2, 3, 2, 1]) == 0\nfn smallest_change(arr: Vec) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = smallest_change;\n assert_eq!(candidate(vec![1, 2, 3, 5, 4, 7, 9, 6]), 4);\n assert_eq!(candidate(vec![1, 2, 3, 4, 3, 2, 2]), 1);\n assert_eq!(candidate(vec![1, 4, 2]), 1);\n assert_eq!(candidate(vec![1, 4, 4, 2]), 1);\n assert_eq!(candidate(vec![1, 2, 3, 2, 1]), 0);\n assert_eq!(candidate(vec![3, 1, 1, 3]), 0);\n assert_eq!(candidate(vec![1]), 0);\n assert_eq!(candidate(vec![0, 1]), 1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "rs", - "prompt": "/// It is the last week of the semester and the teacher has to give the grades\n/// to students. The teacher has been making her own algorithm for grading.\n/// The only problem is, she has lost the code she used for grading.\n/// She has given you a list of GPAs for some students and you have to write \n/// a function that can output a list of letter grades using the following table:\n/// GPA | Letter grade\n/// 4.0 A+\n/// > 3.7 A \n/// > 3.3 A- \n/// > 3.0 B+\n/// > 2.7 B \n/// > 2.3 B-\n/// > 2.0 C+\n/// > 1.7 C\n/// > 1.3 C-\n/// > 1.0 D+ \n/// > 0.7 D \n/// > 0.0 D-\n/// 0.0 E\n/// Example:\n/// grade_equation([4.0, 3, 1.7, 2, 3.5]) ==> ['A+', 'B', 'C-', 'C', 'A-']\nfn numerical_letter_grade(grades: Vec) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = numerical_letter_grade;\n assert_eq!(candidate(vec![4.0, 3.0, 1.7, 2.0, 3.5]), vec![String::from(\"A+\"), String::from(\"B\"), String::from(\"C-\"), String::from(\"C\"), String::from(\"A-\")]);\n assert_eq!(candidate(vec![1.2]), vec![String::from(\"D+\")]);\n assert_eq!(candidate(vec![0.5]), vec![String::from(\"D-\")]);\n assert_eq!(candidate(vec![0.0]), vec![String::from(\"E\")]);\n assert_eq!(candidate(vec![1.0, 0.3, 1.5, 2.8, 3.3]), vec![String::from(\"D\"), String::from(\"D-\"), String::from(\"C-\"), String::from(\"B\"), String::from(\"B+\")]);\n assert_eq!(candidate(vec![0.0, 0.7]), vec![String::from(\"E\"), String::from(\"D-\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "rs", - "prompt": "/// Given the lengths of the three sides of a triangle. Return the area of\n/// the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n/// Otherwise return -1\n/// Three sides make a valid triangle when the sum of any two sides is greater \n/// than the third side.\n/// Example:\n/// triangle_area(3, 4, 5) == 6.00\n/// triangle_area(1, 2, 10) == -1\nfn triangle_area(a: isize, b: isize, c: isize) -> f64 {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = triangle_area;\n assert_eq!(candidate(3, 4, 5), 6.0);\n assert_eq!(candidate(1, 2, 10), -1.0);\n assert_eq!(candidate(4, 8, 5), 8.18);\n assert_eq!(candidate(2, 2, 2), 1.73);\n assert_eq!(candidate(1, 2, 3), -1.0);\n assert_eq!(candidate(10, 5, 7), 16.25);\n assert_eq!(candidate(2, 6, 3), -1.0);\n assert_eq!(candidate(1, 1, 1), 0.43);\n assert_eq!(candidate(2, 2, 10), -1.0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "rs", - "prompt": "/// Check if two words have the same characters.\n/// >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n/// True\n/// >>> same_chars('abcd', 'dddddddabc')\n/// True\n/// >>> same_chars('dddddddabc', 'abcd')\n/// True\n/// >>> same_chars('eabcd', 'dddddddabc')\n/// False\n/// >>> same_chars('abcd', 'dddddddabce')\n/// False\n/// >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc')\n/// False\nfn same_chars(s0: String, s1: String) -> bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = same_chars;\n assert_eq!(candidate(String::from(\"eabcdzzzz\"), String::from(\"dddzzzzzzzddeddabc\")), true);\n assert_eq!(candidate(String::from(\"abcd\"), String::from(\"dddddddabc\")), true);\n assert_eq!(candidate(String::from(\"dddddddabc\"), String::from(\"abcd\")), true);\n assert_eq!(candidate(String::from(\"eabcd\"), String::from(\"dddddddabc\")), false);\n assert_eq!(candidate(String::from(\"abcd\"), String::from(\"dddddddabcf\")), false);\n assert_eq!(candidate(String::from(\"eabcdzzzz\"), String::from(\"dddzzzzzzzddddabc\")), false);\n assert_eq!(candidate(String::from(\"aabb\"), String::from(\"aaccc\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "rs", - "prompt": "/// Given an array of integers nums, find the minimum sum of any non-empty sub-array\n/// of nums.\n/// Example\n/// minSubArraySum([2, 3, 4, 1, 2, 4]) == 1\n/// minSubArraySum([-1, -2, -3]) == -6\nfn minSubArraySum(nums: Vec) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = minSubArraySum;\n assert_eq!(candidate(vec![2, 3, 4, 1, 2, 4]), 1);\n assert_eq!(candidate(vec![-1, -2, -3]), -6);\n assert_eq!(candidate(vec![-1, -2, -3, 2, -10]), -14);\n assert_eq!(candidate(vec![-9999999999999999]), -9999999999999999);\n assert_eq!(candidate(vec![0, 10, 20, 1000000]), 0);\n assert_eq!(candidate(vec![-1, -2, -3, 10, -5]), -6);\n assert_eq!(candidate(vec![100, -1, -2, -3, 10, -5]), -6);\n assert_eq!(candidate(vec![10, 11, 13, 8, 3, 4]), 3);\n assert_eq!(candidate(vec![100, -33, 32, -1, 0, -2]), -33);\n assert_eq!(candidate(vec![-10]), -10);\n assert_eq!(candidate(vec![7]), 7);\n assert_eq!(candidate(vec![1, -1]), -1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "rs", - "prompt": "/// Given a string s and a natural number n, you have been tasked to implement \n/// a function that returns a list of all words from string s that contain exactly \n/// n consonants, in order these words appear in the string s.\n/// If the string s is empty then the function should return an empty list.\n/// Note: you may assume the input string contains only letters and spaces.\n/// Examples:\n/// select_words(\"Mary had a little lamb\", 4) ==> [\"little\"]\n/// select_words(\"Mary had a little lamb\", 3) ==> [\"Mary\", \"lamb\"]\n/// select_words(\"simple white space\", 2) ==> []\n/// select_words(\"Hello world\", 4) ==> [\"world\"]\n/// select_words(\"Uncle sam\", 3) ==> [\"Uncle\"]\nfn select_words(s: String, n: isize) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = select_words;\n assert_eq!(candidate(String::from(\"Mary had a little lamb\"), 4), vec![String::from(\"little\")]);\n assert_eq!(candidate(String::from(\"Mary had a little lamb\"), 3), vec![String::from(\"Mary\"), String::from(\"lamb\")]);\n assert_eq!(candidate(String::from(\"simple white space\"), 2), Vec::::new());\n assert_eq!(candidate(String::from(\"Hello world\"), 4), vec![String::from(\"world\")]);\n assert_eq!(candidate(String::from(\"Uncle sam\"), 3), vec![String::from(\"Uncle\")]);\n assert_eq!(candidate(String::from(\"\"), 4), Vec::::new());\n assert_eq!(candidate(String::from(\"a b c d e f\"), 1), vec![String::from(\"b\"), String::from(\"c\"), String::from(\"d\"), String::from(\"f\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "rs", - "prompt": "/// Return list of all prefixes from shortest to longest of the input string\n/// >>> all_prefixes('abc')\n/// ['a', 'ab', 'abc']\nfn all_prefixes(string: String) -> Vec {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = all_prefixes;\n assert_eq!(candidate(String::from(\"\")), Vec::::new());\n assert_eq!(candidate(String::from(\"asdfgh\")), vec![String::from(\"a\"), String::from(\"as\"), String::from(\"asd\"), String::from(\"asdf\"), String::from(\"asdfg\"), String::from(\"asdfgh\")]);\n assert_eq!(candidate(String::from(\"WWW\")), vec![String::from(\"W\"), String::from(\"WW\"), String::from(\"WWW\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "rs", - "prompt": "/// Create a function that takes a value (string) representing a number\n/// and returns the closest integer to it. If the number is equidistant\n/// from two integers, round it away from zero.\n/// Examples\n/// >>> closest_integer(\"10\")\n/// 10\n/// >>> closest_integer(\"15.3\")\n/// 15\n/// Note:\n/// Rounding away from zero means that if the given number is equidistant\n/// from two integers, the one you should return is the one that is the\n/// farthest from zero. For example closest_integer(\"14.5\") should\n/// return 15 and closest_integer(\"-14.5\") should return -15.\nfn closest_integer(value: String) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = closest_integer;\n assert_eq!(candidate(String::from(\"10\")), 10);\n assert_eq!(candidate(String::from(\"14.5\")), 15);\n assert_eq!(candidate(String::from(\"-15.5\")), -16);\n assert_eq!(candidate(String::from(\"15.3\")), 15);\n assert_eq!(candidate(String::from(\"0\")), 0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "rs", - "prompt": "/// Create a function which takes a string representing a file's name, and returns\n/// 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n/// A file's name is considered to be valid if and only if all the following conditions \n/// are met:\n/// - There should not be more than three digits ('0'-'9') in the file's name.\n/// - The file's name contains exactly one dot '.'\n/// - The substring before the dot should not be empty, and it starts with a letter from \n/// the latin alphapet ('a'-'z' and 'A'-'Z').\n/// - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n/// Examples:\n/// file_name_check(\"example.txt\") # => 'Yes'\n/// file_name_check(\"1example.dll\") # => 'No' (the name should start with a latin alphapet letter)\nfn file_name_check(file_name: String) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = file_name_check;\n assert_eq!(candidate(String::from(\"example.txt\")), String::from(\"Yes\"));\n assert_eq!(candidate(String::from(\"1example.dll\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"s1sdf3.asd\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"K.dll\")), String::from(\"Yes\"));\n assert_eq!(candidate(String::from(\"MY16FILE3.exe\")), String::from(\"Yes\"));\n assert_eq!(candidate(String::from(\"His12FILE94.exe\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"_Y.txt\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"?aREYA.exe\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"/this_is_valid.dll\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"this_is_valid.wow\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"this_is_valid.txt\")), String::from(\"Yes\"));\n assert_eq!(candidate(String::from(\"this_is_valid.txtexe\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"#this2_i4s_5valid.ten\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"@this1_is6_valid.exe\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"this_is_12valid.6exe4.txt\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"all.exe.txt\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"I563_No.exe\")), String::from(\"Yes\"));\n assert_eq!(candidate(String::from(\"Is3youfault.txt\")), String::from(\"Yes\"));\n assert_eq!(candidate(String::from(\"no_one#knows.dll\")), String::from(\"Yes\"));\n assert_eq!(candidate(String::from(\"1I563_Yes3.exe\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"I563_Yes3.txtt\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"final..txt\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"final132\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"_f4indsartal132.\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\".txt\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"s.\")), String::from(\"No\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "rs", - "prompt": "/// You are given two intervals,\n/// where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n/// The given intervals are closed which means that the interval (start, end)\n/// includes both start and end.\n/// For each given interval, it is assumed that its start is less or equal its end.\n/// Your task is to determine whether the length of intersection of these two \n/// intervals is a prime number.\n/// Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n/// which its length is 1, which not a prime number.\n/// If the length of the intersection is a prime number, return \"YES\",\n/// otherwise, return \"NO\".\n/// If the two intervals don't intersect, return \"NO\".\n/// [input/output] samples:\n/// intersection((1, 2), (2, 3)) ==> \"NO\"\n/// intersection((-1, 1), (0, 4)) ==> \"NO\"\n/// intersection((-3, -1), (-5, 5)) ==> \"YES\"\nfn intersection(interval1: (isize, isize), interval2: (isize, isize)) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = intersection;\n assert_eq!(candidate((1, 2), (2, 3)), String::from(\"NO\"));\n assert_eq!(candidate((-1, 1), (0, 4)), String::from(\"NO\"));\n assert_eq!(candidate((-3, -1), (-5, 5)), String::from(\"YES\"));\n assert_eq!(candidate((-2, 2), (-4, 0)), String::from(\"YES\"));\n assert_eq!(candidate((-11, 2), (-1, -1)), String::from(\"NO\"));\n assert_eq!(candidate((1, 2), (3, 5)), String::from(\"NO\"));\n assert_eq!(candidate((1, 2), (1, 2)), String::from(\"NO\"));\n assert_eq!(candidate((-2, -2), (-3, -2)), String::from(\"NO\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "rs", - "prompt": "/// Return the largest prime factor of n. Assume n > 1 and is not a prime.\n/// >>> largest_prime_factor(13195)\n/// 29\n/// >>> largest_prime_factor(2048)\n/// 2\nfn largest_prime_factor(n: isize) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = largest_prime_factor;\n assert_eq!(candidate(15), 5);\n assert_eq!(candidate(27), 3);\n assert_eq!(candidate(63), 7);\n assert_eq!(candidate(330), 11);\n assert_eq!(candidate(13195), 29);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "rs", - "prompt": "/// Given a string, find out how many distinct characters (regardless of case) does it consist of\n/// >>> count_distinct_characters('xyzXYZ')\n/// 3\n/// >>> count_distinct_characters('Jerry')\n/// 4\nfn count_distinct_characters(string: String) -> isize {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = count_distinct_characters;\n assert_eq!(candidate(String::from(\"\")), 0);\n assert_eq!(candidate(String::from(\"abcde\")), 5);\n assert_eq!(candidate(String::from(\"abcdecadeCADE\")), 5);\n assert_eq!(candidate(String::from(\"aaaaAAAAaaaa\")), 1);\n assert_eq!(candidate(String::from(\"Jerry jERRY JeRRRY\")), 5);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "rs", - "prompt": "/// You're given a list of deposit and withdrawal operations on a bank account that starts with\n/// zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n/// at that point function should return True. Otherwise it should return False.\n/// >>> below_zero([1, 2, 3])\n/// False\n/// >>> below_zero([1, 2, -4, 5])\n/// True\nfn below_zero(operations: Vec) -> bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = below_zero;\n assert_eq!(candidate(Vec::::new()), false);\n assert_eq!(candidate(vec![1, 2, -3, 1, 2, -3]), false);\n assert_eq!(candidate(vec![1, 2, -4, 5, 6]), true);\n assert_eq!(candidate(vec![1, -1, 2, -2, 5, -5, 4, -4]), false);\n assert_eq!(candidate(vec![1, -1, 2, -2, 5, -5, 4, -5]), true);\n assert_eq!(candidate(vec![1, -2, 2, -2, 5, -5, 4, -4]), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "rs", - "prompt": "/// Find the shortest palindrome that begins with a supplied string.\n/// Algorithm idea is simple:\n/// - Find the longest postfix of supplied string that is a palindrome.\n/// - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n/// >>> make_palindrome('')\n/// ''\n/// >>> make_palindrome('cat')\n/// 'catac'\n/// >>> make_palindrome('cata')\n/// 'catac'\nfn make_palindrome(string: String) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = make_palindrome;\n assert_eq!(candidate(String::from(\"\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"x\")), String::from(\"x\"));\n assert_eq!(candidate(String::from(\"xyz\")), String::from(\"xyzyx\"));\n assert_eq!(candidate(String::from(\"xyx\")), String::from(\"xyx\"));\n assert_eq!(candidate(String::from(\"jerry\")), String::from(\"jerryrrej\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "rs", - "prompt": "/// Given a positive integer, obtain its roman numeral equivalent as a string,\n/// and return it in lowercase.\n/// Restrictions: 1 <= num <= 1000\n/// Examples:\n/// >>> int_to_mini_roman(19) == 'xix'\n/// >>> int_to_mini_roman(152) == 'clii'\n/// >>> int_to_mini_roman(426) == 'cdxxvi'\nfn int_to_mini_roman(number: isize) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = int_to_mini_roman;\n assert_eq!(candidate(19), String::from(\"xix\"));\n assert_eq!(candidate(152), String::from(\"clii\"));\n assert_eq!(candidate(251), String::from(\"ccli\"));\n assert_eq!(candidate(426), String::from(\"cdxxvi\"));\n assert_eq!(candidate(500), String::from(\"d\"));\n assert_eq!(candidate(1), String::from(\"i\"));\n assert_eq!(candidate(4), String::from(\"iv\"));\n assert_eq!(candidate(43), String::from(\"xliii\"));\n assert_eq!(candidate(90), String::from(\"xc\"));\n assert_eq!(candidate(94), String::from(\"xciv\"));\n assert_eq!(candidate(532), String::from(\"dxxxii\"));\n assert_eq!(candidate(900), String::from(\"cm\"));\n assert_eq!(candidate(994), String::from(\"cmxciv\"));\n assert_eq!(candidate(1000), String::from(\"m\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - } -] \ No newline at end of file diff --git a/data/rs-remove.json b/data/rs-remove.json deleted file mode 100644 index 7c3aa4ab8ef608e86b346181bc823621106b9543..0000000000000000000000000000000000000000 --- a/data/rs-remove.json +++ /dev/null @@ -1,1838 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "rs", - "prompt": "/// For a given number n, find the largest number that divides n evenly, smaller than n\nfn largest_divisor(n: isize) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = largest_divisor;\n assert_eq!(candidate(3), 1);\n assert_eq!(candidate(7), 1);\n assert_eq!(candidate(10), 5);\n assert_eq!(candidate(100), 50);\n assert_eq!(candidate(49), 7);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_47_median", - "language": "rs", - "prompt": "/// Return median of elements in the list l.\nfn median(l: Vec) -> f64 {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = median;\n assert_eq!(candidate(vec![3, 1, 2, 4, 5]), 3.0);\n assert_eq!(candidate(vec![-10, 4, 6, 1000, 10, 20]), 8.0);\n assert_eq!(candidate(vec![5]), 5.0);\n assert_eq!(candidate(vec![6, 5]), 5.5);\n assert_eq!(candidate(vec![8, 1, 3, 9, 9, 2, 7]), 7.0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "rs", - "prompt": "/// Return maximum element in the list.\nfn max_element(l: Vec) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = max_element;\n assert_eq!(candidate(vec![1, 2, 3]), 3);\n assert_eq!(candidate(vec![5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]), 124);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "rs", - "prompt": "/// Create a function which returns the largest index of an element which\n/// is not greater than or equal to the element immediately preceding it. If\n/// no such element exists then return -1. The given array will not contain\n/// duplicate values.\n/// Examples:\nfn can_arrange(arr: Vec) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = can_arrange;\n assert_eq!(candidate(vec![1, 2, 4, 3, 5]), 3);\n assert_eq!(candidate(vec![1, 2, 4, 5]), -1);\n assert_eq!(candidate(vec![1, 4, 2, 5, 6, 7, 8, 9, 10]), 2);\n assert_eq!(candidate(vec![4, 8, 5, 7, 3]), 4);\n assert_eq!(candidate(Vec::::new()), -1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "rs", - "prompt": "/// Create a function that returns True if the last character\n/// of a given string is an alphabetical character and is not\n/// a part of a word, and False otherwise.\n/// Note: \"word\" is a group of characters separated by space.\n/// Examples:\nfn check_if_last_char_is_a_letter(txt: String) -> bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = check_if_last_char_is_a_letter;\n assert_eq!(candidate(String::from(\"apple\")), false);\n assert_eq!(candidate(String::from(\"apple pi e\")), true);\n assert_eq!(candidate(String::from(\"eeeee\")), false);\n assert_eq!(candidate(String::from(\"A\")), true);\n assert_eq!(candidate(String::from(\"Pumpkin pie \")), false);\n assert_eq!(candidate(String::from(\"Pumpkin pie 1\")), false);\n assert_eq!(candidate(String::from(\"\")), false);\n assert_eq!(candidate(String::from(\"eeeee e \")), false);\n assert_eq!(candidate(String::from(\"apple pie\")), false);\n assert_eq!(candidate(String::from(\"apple pi e \")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "rs", - "prompt": "/// Return true if a given number is prime, and false otherwise.\nfn is_prime(n: isize) -> bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = is_prime;\n assert_eq!(candidate(6), false);\n assert_eq!(candidate(101), true);\n assert_eq!(candidate(11), true);\n assert_eq!(candidate(13441), true);\n assert_eq!(candidate(61), true);\n assert_eq!(candidate(4), false);\n assert_eq!(candidate(1), false);\n assert_eq!(candidate(5), true);\n assert_eq!(candidate(11), true);\n assert_eq!(candidate(17), true);\n assert_eq!(candidate(85), false);\n assert_eq!(candidate(77), false);\n assert_eq!(candidate(255379), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "rs", - "prompt": "/// Given a list of positive integers x. return a sorted list of all \n/// elements that hasn't any even digit.\n/// Note: Returned list should be sorted in increasing order.\n/// For example:\nfn unique_digits(x: Vec) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = unique_digits;\n assert_eq!(candidate(vec![15, 33, 1422, 1]), vec![1, 15, 33]);\n assert_eq!(candidate(vec![152, 323, 1422, 10]), Vec::::new());\n assert_eq!(candidate(vec![12345, 2033, 111, 151]), vec![111, 151]);\n assert_eq!(candidate(vec![135, 103, 31]), vec![31, 135]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "rs", - "prompt": "/// Input are two strings a and b consisting only of 1s and 0s.\n/// Perform binary XOR on these inputs and return result also as a string.\nfn string_xor(a: String, b: String) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = string_xor;\n assert_eq!(candidate(String::from(\"111000\"), String::from(\"101010\")), String::from(\"010010\"));\n assert_eq!(candidate(String::from(\"1\"), String::from(\"1\")), String::from(\"0\"));\n assert_eq!(candidate(String::from(\"0101\"), String::from(\"0000\")), String::from(\"0101\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "rs", - "prompt": "/// sum_to_n is a function that sums numbers from 1 to n.\nfn sum_to_n(n: isize) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = sum_to_n;\n assert_eq!(candidate(1), 1);\n assert_eq!(candidate(6), 21);\n assert_eq!(candidate(11), 66);\n assert_eq!(candidate(30), 465);\n assert_eq!(candidate(100), 5050);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "rs", - "prompt": "/// Given a list of numbers, return the sum of squares of the numbers\n/// in the list that are odd. Ignore numbers that are negative or not integers.\n/// If the input list is empty, return 0.\nfn double_the_difference(lst: Vec) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = double_the_difference;\n assert_eq!(candidate(Vec::::new()), 0);\n assert_eq!(candidate(vec![5.0, 4.0]), 25);\n assert_eq!(candidate(vec![0.1, 0.2, 0.3]), 0);\n assert_eq!(candidate(vec![-10.0, -20.0, -30.0]), 0);\n assert_eq!(candidate(vec![-1.0, -2.0, 8.0]), 0);\n assert_eq!(candidate(vec![0.2, 3.0, 5.0]), 34);\n assert_eq!(candidate(vec![-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]), 165);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "rs", - "prompt": "/// Return length of given string\nfn strlen(string: String) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = strlen;\n assert_eq!(candidate(String::from(\"\")), 0);\n assert_eq!(candidate(String::from(\"x\")), 1);\n assert_eq!(candidate(String::from(\"asdasnakj\")), 9);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "rs", - "prompt": "/// You'll be given a string of words, and your task is to count the number\n/// of boredoms. A boredom is a sentence that starts with the word \"I\".\n/// Sentences are delimited by '.', '?' or '!'.\n/// For example:\nfn is_bored(S: String) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = is_bored;\n assert_eq!(candidate(String::from(\"Hello world\")), 0);\n assert_eq!(candidate(String::from(\"Is the sky blue?\")), 0);\n assert_eq!(candidate(String::from(\"I love It !\")), 1);\n assert_eq!(candidate(String::from(\"bIt\")), 0);\n assert_eq!(candidate(String::from(\"I feel good today. I will be productive. will kill It\")), 2);\n assert_eq!(candidate(String::from(\"You and I are going for a walk\")), 0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "rs", - "prompt": "/// Write a function vowels_count which takes a string representing\n/// a word as input and returns the number of vowels in the string.\n/// Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n/// vowel, but only when it is at the end of the given word.\n/// Example:\nfn vowels_count(s: String) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = vowels_count;\n assert_eq!(candidate(String::from(\"abcde\")), 2);\n assert_eq!(candidate(String::from(\"Alone\")), 3);\n assert_eq!(candidate(String::from(\"key\")), 2);\n assert_eq!(candidate(String::from(\"bye\")), 1);\n assert_eq!(candidate(String::from(\"keY\")), 2);\n assert_eq!(candidate(String::from(\"bYe\")), 1);\n assert_eq!(candidate(String::from(\"ACEDY\")), 3);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "rs", - "prompt": "/// Return n-th Fibonacci number.\nfn fib(n: isize) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = fib;\n assert_eq!(candidate(10), 55);\n assert_eq!(candidate(1), 1);\n assert_eq!(candidate(8), 21);\n assert_eq!(candidate(11), 89);\n assert_eq!(candidate(12), 144);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "rs", - "prompt": "/// Your task is to implement a function that will simplify the expression\n/// x * n. The function returns True if x * n evaluates to a whole number and False\n/// otherwise. Both x and n, are string representation of a fraction, and have the following format,\n/// / where both numerator and denominator are positive whole numbers.\n/// You can assume that x, and n are valid fractions, and do not have zero as denominator.\nfn simplify(x: String, n: String) -> bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = simplify;\n assert_eq!(candidate(String::from(\"1/5\"), String::from(\"5/1\")), true);\n assert_eq!(candidate(String::from(\"1/6\"), String::from(\"2/1\")), false);\n assert_eq!(candidate(String::from(\"5/1\"), String::from(\"3/1\")), true);\n assert_eq!(candidate(String::from(\"7/10\"), String::from(\"10/2\")), false);\n assert_eq!(candidate(String::from(\"2/10\"), String::from(\"50/10\")), true);\n assert_eq!(candidate(String::from(\"7/2\"), String::from(\"4/2\")), true);\n assert_eq!(candidate(String::from(\"11/6\"), String::from(\"6/1\")), true);\n assert_eq!(candidate(String::from(\"2/3\"), String::from(\"5/2\")), false);\n assert_eq!(candidate(String::from(\"5/2\"), String::from(\"3/5\")), false);\n assert_eq!(candidate(String::from(\"2/4\"), String::from(\"8/4\")), true);\n assert_eq!(candidate(String::from(\"2/4\"), String::from(\"4/2\")), true);\n assert_eq!(candidate(String::from(\"1/5\"), String::from(\"5/1\")), true);\n assert_eq!(candidate(String::from(\"1/5\"), String::from(\"1/5\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "rs", - "prompt": "/// Given a string s, count the number of uppercase vowels in even indices.\n/// For example:\nfn count_upper(s: String) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = count_upper;\n assert_eq!(candidate(String::from(\"aBCdEf\")), 1);\n assert_eq!(candidate(String::from(\"abcdefg\")), 0);\n assert_eq!(candidate(String::from(\"dBBE\")), 0);\n assert_eq!(candidate(String::from(\"B\")), 0);\n assert_eq!(candidate(String::from(\"U\")), 1);\n assert_eq!(candidate(String::from(\"\")), 0);\n assert_eq!(candidate(String::from(\"EEEE\")), 2);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "rs", - "prompt": "/// You are given a rectangular grid of wells. Each row represents a single well,\n/// and each 1 in a row represents a single unit of water.\n/// Each well has a corresponding bucket that can be used to extract water from it, \n/// and all buckets have the same capacity.\n/// Your task is to use the buckets to empty the wells.\n/// Output the number of times you need to lower the buckets.\n/// Example 1:\n/// Example 2:\n/// Example 3:\n/// Constraints:\n/// * all wells have the same length\n/// * 1 <= grid.length <= 10^2\n/// * 1 <= grid[:,1].length <= 10^2\n/// * grid[i][j] -> 0 | 1\n/// * 1 <= capacity <= 10\nfn max_fill(grid: Vec>, capacity: isize) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = max_fill;\n assert_eq!(candidate(vec![vec![0, 0, 1, 0], vec![0, 1, 0, 0], vec![1, 1, 1, 1]], 1), 6);\n assert_eq!(candidate(vec![vec![0, 0, 1, 1], vec![0, 0, 0, 0], vec![1, 1, 1, 1], vec![0, 1, 1, 1]], 2), 5);\n assert_eq!(candidate(vec![vec![0, 0, 0], vec![0, 0, 0]], 5), 0);\n assert_eq!(candidate(vec![vec![1, 1, 1, 1], vec![1, 1, 1, 1]], 2), 4);\n assert_eq!(candidate(vec![vec![1, 1, 1, 1], vec![1, 1, 1, 1]], 9), 2);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "rs", - "prompt": "/// Given an array arr of integers and a positive integer k, return a sorted list \n/// of length k with the maximum k numbers in arr.\n/// Example 1:\n/// Example 2:\n/// Example 3:\n/// Note:\n/// 1. The length of the array will be in the range of [1, 1000].\n/// 2. The elements in the array will be in the range of [-1000, 1000].\n/// 3. 0 <= k <= len(arr)\nfn maximum(arr: Vec, k: isize) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = maximum;\n assert_eq!(candidate(vec![-3, -4, 5], 3), vec![-4, -3, 5]);\n assert_eq!(candidate(vec![4, -4, 4], 2), vec![4, 4]);\n assert_eq!(candidate(vec![-3, 2, 1, 2, -1, -2, 1], 1), vec![2]);\n assert_eq!(candidate(vec![123, -123, 20, 0, 1, 2, -3], 3), vec![2, 20, 123]);\n assert_eq!(candidate(vec![-123, 20, 0, 1, 2, -3], 4), vec![0, 1, 2, 20]);\n assert_eq!(candidate(vec![5, 15, 0, 3, -13, -8, 0], 7), vec![-13, -8, 0, 0, 3, 5, 15]);\n assert_eq!(candidate(vec![-1, 0, 2, 5, 3, -10], 2), vec![3, 5]);\n assert_eq!(candidate(vec![1, 0, 5, -7], 1), vec![5]);\n assert_eq!(candidate(vec![4, -4], 2), vec![-4, 4]);\n assert_eq!(candidate(vec![-10, 10], 2), vec![-10, 10]);\n assert_eq!(candidate(vec![1, 2, 3, -23, 243, -400, 0], 0), Vec::::new());\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "rs", - "prompt": "/// Write a function that takes a message, and encodes in such a \n/// way that it swaps case of all letters, replaces all vowels in \n/// the message with the letter that appears 2 places ahead of that \n/// vowel in the english alphabet. \n/// Assume only letters. \n/// Examples:\nfn encode(message: String) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = encode;\n assert_eq!(candidate(String::from(\"TEST\")), String::from(\"tgst\"));\n assert_eq!(candidate(String::from(\"Mudasir\")), String::from(\"mWDCSKR\"));\n assert_eq!(candidate(String::from(\"YES\")), String::from(\"ygs\"));\n assert_eq!(candidate(String::from(\"This is a message\")), String::from(\"tHKS KS C MGSSCGG\"));\n assert_eq!(candidate(String::from(\"I DoNt KnOw WhAt tO WrItE\")), String::from(\"k dQnT kNqW wHcT Tq wRkTg\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "rs", - "prompt": "/// remove_vowels is a function that takes string and returns string without vowels.\nfn remove_vowels(text: String) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = remove_vowels;\n assert_eq!(candidate(String::from(\"\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"abcdef\nghijklm\")), String::from(\"bcdf\nghjklm\"));\n assert_eq!(candidate(String::from(\"fedcba\")), String::from(\"fdcb\"));\n assert_eq!(candidate(String::from(\"eeeee\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"acBAA\")), String::from(\"cB\"));\n assert_eq!(candidate(String::from(\"EcBOO\")), String::from(\"cB\"));\n assert_eq!(candidate(String::from(\"ybcd\")), String::from(\"ybcd\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "rs", - "prompt": "/// Return only positive numbers in the list.\nfn get_positive(l: Vec) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = get_positive;\n assert_eq!(candidate(vec![-1, -2, 4, 5, 6]), vec![4, 5, 6]);\n assert_eq!(candidate(vec![5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]), vec![5, 3, 2, 3, 3, 9, 123, 1]);\n assert_eq!(candidate(vec![-1, -2]), Vec::::new());\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "rs", - "prompt": "/// Return a string containing space-delimited numbers starting from 0 upto n inclusive.\nfn string_sequence(n: isize) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = string_sequence;\n assert_eq!(candidate(0), String::from(\"0\"));\n assert_eq!(candidate(3), String::from(\"0 1 2 3\"));\n assert_eq!(candidate(10), String::from(\"0 1 2 3 4 5 6 7 8 9 10\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "rs", - "prompt": "/// Given a positive integer n, you have to make a pile of n levels of stones.\n/// The first level has n stones.\n/// The number of stones in the next level is:\n/// - the next odd number if n is odd.\n/// - the next even number if n is even.\n/// Return the number of stones in each level in a list, where element at index\n/// i represents the number of stones in the level (i+1).\n/// Examples:\nfn make_a_pile(n: isize) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = make_a_pile;\n assert_eq!(candidate(3), vec![3, 5, 7]);\n assert_eq!(candidate(4), vec![4, 6, 8, 10]);\n assert_eq!(candidate(5), vec![5, 7, 9, 11, 13]);\n assert_eq!(candidate(6), vec![6, 8, 10, 12, 14, 16]);\n assert_eq!(candidate(8), vec![8, 10, 12, 14, 16, 18, 20, 22]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "rs", - "prompt": "/// Task\n/// 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\n/// then check if the result string is palindrome.\n/// A string is called palindrome if it reads the same backward as forward.\n/// You should return a tuple containing the result string and True/False for the check.\n/// Example\nfn reverse_delete(s: String, c: String) -> (String, bool) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = reverse_delete;\n assert_eq!(candidate(String::from(\"abcde\"), String::from(\"ae\")), (String::from(\"bcd\"), false));\n assert_eq!(candidate(String::from(\"abcdef\"), String::from(\"b\")), (String::from(\"acdef\"), false));\n assert_eq!(candidate(String::from(\"abcdedcba\"), String::from(\"ab\")), (String::from(\"cdedc\"), true));\n assert_eq!(candidate(String::from(\"dwik\"), String::from(\"w\")), (String::from(\"dik\"), false));\n assert_eq!(candidate(String::from(\"a\"), String::from(\"a\")), (String::from(\"\"), true));\n assert_eq!(candidate(String::from(\"abcdedcba\"), String::from(\"\")), (String::from(\"abcdedcba\"), true));\n assert_eq!(candidate(String::from(\"abcdedcba\"), String::from(\"v\")), (String::from(\"abcdedcba\"), true));\n assert_eq!(candidate(String::from(\"vabba\"), String::from(\"v\")), (String::from(\"abba\"), true));\n assert_eq!(candidate(String::from(\"mamma\"), String::from(\"mia\")), (String::from(\"\"), true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "rs", - "prompt": "/// For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\nfn flip_case(string: String) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = flip_case;\n assert_eq!(candidate(String::from(\"\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"Hello!\")), String::from(\"hELLO!\"));\n assert_eq!(candidate(String::from(\"These violent delights have violent ends\")), String::from(\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "rs", - "prompt": "/// You are given a string s.\n/// if s[i] is a letter, reverse its case from lower to upper or vise versa, \n/// otherwise keep it as it is.\n/// If the string contains no letters, reverse the string.\n/// The function should return the resulted string.\n/// Examples\nfn solve(s: String) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = solve;\n assert_eq!(candidate(String::from(\"AsDf\")), String::from(\"aSdF\"));\n assert_eq!(candidate(String::from(\"1234\")), String::from(\"4321\"));\n assert_eq!(candidate(String::from(\"ab\")), String::from(\"AB\"));\n assert_eq!(candidate(String::from(\"#a@C\")), String::from(\"#A@c\"));\n assert_eq!(candidate(String::from(\"#AsdfW^45\")), String::from(\"#aSDFw^45\"));\n assert_eq!(candidate(String::from(\"#6@2\")), String::from(\"2@6#\"));\n assert_eq!(candidate(String::from(\"#$a^D\")), String::from(\"#$A^d\"));\n assert_eq!(candidate(String::from(\"#ccc\")), String::from(\"#CCC\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "rs", - "prompt": "/// Filter an input list of strings only for ones that start with a given prefix.\nfn filter_by_prefix(strings: Vec, prefix: String) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = filter_by_prefix;\n assert_eq!(candidate(Vec::::new(), String::from(\"john\")), Vec::::new());\n assert_eq!(candidate(vec![String::from(\"xxx\"), String::from(\"asd\"), String::from(\"xxy\"), String::from(\"john doe\"), String::from(\"xxxAAA\"), String::from(\"xxx\")], String::from(\"xxx\")), vec![String::from(\"xxx\"), String::from(\"xxxAAA\"), String::from(\"xxx\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "rs", - "prompt": "/// This function takes two positive numbers x and y and returns the\n/// biggest even integer number that is in the range [x, y] inclusive. If \n/// there's no such number, then the function should return -1.\n/// For example:\nfn choose_num(x: isize, y: isize) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = choose_num;\n assert_eq!(candidate(12, 15), 14);\n assert_eq!(candidate(13, 12), -1);\n assert_eq!(candidate(33, 12354), 12354);\n assert_eq!(candidate(5234, 5233), -1);\n assert_eq!(candidate(6, 29), 28);\n assert_eq!(candidate(27, 10), -1);\n assert_eq!(candidate(7, 7), -1);\n assert_eq!(candidate(546, 546), 546);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "rs", - "prompt": "/// You are given a string representing a sentence,\n/// the sentence contains some words separated by a space,\n/// and you have to return a string that contains the words from the original sentence,\n/// whose lengths are prime numbers,\n/// the order of the words in the new string should be the same as the original one.\n/// Example 1:\n/// Example 2:\n/// Constraints:\n/// * 1 <= len(sentence) <= 100\n/// * sentence contains only letters\nfn words_in_sentence(sentence: String) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = words_in_sentence;\n assert_eq!(candidate(String::from(\"This is a test\")), String::from(\"is\"));\n assert_eq!(candidate(String::from(\"lets go for swimming\")), String::from(\"go for\"));\n assert_eq!(candidate(String::from(\"there is no place available here\")), String::from(\"there is no place\"));\n assert_eq!(candidate(String::from(\"Hi I am Hussein\")), String::from(\"Hi am Hussein\"));\n assert_eq!(candidate(String::from(\"go for it\")), String::from(\"go for it\"));\n assert_eq!(candidate(String::from(\"here\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"here is\")), String::from(\"is\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "rs", - "prompt": "/// Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\nfn intersperse(numbers: Vec, delimeter: isize) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = intersperse;\n assert_eq!(candidate(Vec::::new(), 7), Vec::::new());\n assert_eq!(candidate(vec![5, 6, 3, 2], 8), vec![5, 8, 6, 8, 3, 8, 2]);\n assert_eq!(candidate(vec![2, 2, 2], 2), vec![2, 2, 2, 2, 2]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "rs", - "prompt": "/// Your task is to write a function that returns true if a number x is a simple\n/// power of n and false in other cases.\n/// x is a simple power of n if n**int=x\n/// For example:\nfn is_simple_power(x: isize, n: isize) -> bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = is_simple_power;\n assert_eq!(candidate(16, 2), true);\n assert_eq!(candidate(143214, 16), false);\n assert_eq!(candidate(4, 2), true);\n assert_eq!(candidate(9, 3), true);\n assert_eq!(candidate(16, 4), true);\n assert_eq!(candidate(24, 2), false);\n assert_eq!(candidate(128, 4), false);\n assert_eq!(candidate(12, 6), false);\n assert_eq!(candidate(1, 1), true);\n assert_eq!(candidate(1, 12), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "rs", - "prompt": "/// Write a function that returns true if the given number is the multiplication of 3 prime numbers\n/// and false otherwise.\n/// Knowing that (a) is less then 100. \n/// Example:\n/// 30 = 2 * 3 * 5\nfn is_multiply_prime(a: isize) -> bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = is_multiply_prime;\n assert_eq!(candidate(5), false);\n assert_eq!(candidate(30), true);\n assert_eq!(candidate(8), true);\n assert_eq!(candidate(10), false);\n assert_eq!(candidate(125), true);\n assert_eq!(candidate(105), true);\n assert_eq!(candidate(126), false);\n assert_eq!(candidate(729), false);\n assert_eq!(candidate(891), false);\n assert_eq!(candidate(1001), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "rs", - "prompt": "/// Given the lengths of the three sides of a triangle. Return True if the three\n/// sides form a right-angled triangle, False otherwise.\n/// A right-angled triangle is a triangle in which one angle is right angle or \n/// 90 degree.\n/// Example:\nfn right_angle_triangle(a: isize, b: isize, c: isize) -> bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = right_angle_triangle;\n assert_eq!(candidate(3, 4, 5), true);\n assert_eq!(candidate(1, 2, 3), false);\n assert_eq!(candidate(10, 6, 8), true);\n assert_eq!(candidate(2, 2, 2), false);\n assert_eq!(candidate(7, 24, 25), true);\n assert_eq!(candidate(10, 5, 7), false);\n assert_eq!(candidate(5, 12, 13), true);\n assert_eq!(candidate(15, 8, 17), true);\n assert_eq!(candidate(48, 55, 73), true);\n assert_eq!(candidate(1, 1, 1), false);\n assert_eq!(candidate(2, 2, 10), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "rs", - "prompt": "/// Create a function that takes 3 numbers.\n/// Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n/// Returns false in any other cases.\n/// Examples\nfn any_int(x: f64, y: f64, z: f64) -> bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = any_int;\n assert_eq!(candidate(2.0, 3.0, 1.0), true);\n assert_eq!(candidate(2.5, 2.0, 3.0), false);\n assert_eq!(candidate(1.5, 5.0, 3.5), false);\n assert_eq!(candidate(2.0, 6.0, 2.0), false);\n assert_eq!(candidate(4.0, 2.0, 2.0), true);\n assert_eq!(candidate(2.2, 2.2, 2.2), false);\n assert_eq!(candidate(-4.0, 6.0, 2.0), true);\n assert_eq!(candidate(2.0, 1.0, 1.0), true);\n assert_eq!(candidate(3.0, 4.0, 7.0), true);\n assert_eq!(candidate(3.0, 4.0, 7.0), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "rs", - "prompt": "/// This function takes a list l and returns a list l' such that\n/// l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n/// to the values of the corresponding indicies of l, but sorted.\nfn sort_third(l: Vec) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = sort_third;\n assert_eq!(candidate(vec![5, 6, 3, 4, 8, 9, 2]), vec![2, 6, 3, 4, 8, 9, 5]);\n assert_eq!(candidate(vec![5, 8, 3, 4, 6, 9, 2]), vec![2, 8, 3, 4, 6, 9, 5]);\n assert_eq!(candidate(vec![5, 6, 9, 4, 8, 3, 2]), vec![2, 6, 9, 4, 8, 3, 5]);\n assert_eq!(candidate(vec![5, 6, 3, 4, 8, 9, 2, 1]), vec![2, 6, 3, 4, 8, 9, 5, 1]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_53_add", - "language": "rs", - "prompt": "/// Add two numbers x and y\nfn add(x: isize, y: isize) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = add;\n assert_eq!(candidate(0, 1), 1);\n assert_eq!(candidate(1, 0), 1);\n assert_eq!(candidate(2, 3), 5);\n assert_eq!(candidate(5, 7), 12);\n assert_eq!(candidate(7, 5), 12);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_69_search", - "language": "rs", - "prompt": "/// You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n/// zero, and has a frequency greater than or equal to the value of the integer itself. \n/// The frequency of an integer is the number of times it appears in the list.\n/// If no such a value exist, return -1.\n/// Examples:\nfn search(lst: Vec) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = search;\n assert_eq!(candidate(vec![5, 5, 5, 5, 1]), 1);\n assert_eq!(candidate(vec![4, 1, 4, 1, 4, 4]), 4);\n assert_eq!(candidate(vec![3, 3]), -1);\n assert_eq!(candidate(vec![8, 8, 8, 8, 8, 8, 8, 8]), 8);\n assert_eq!(candidate(vec![2, 3, 3, 2, 2]), 2);\n assert_eq!(candidate(vec![2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]), 1);\n assert_eq!(candidate(vec![3, 2, 8, 2]), 2);\n assert_eq!(candidate(vec![6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]), 1);\n assert_eq!(candidate(vec![8, 8, 3, 6, 5, 6, 4]), -1);\n assert_eq!(candidate(vec![6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]), 1);\n assert_eq!(candidate(vec![1, 9, 10, 1, 3]), 1);\n assert_eq!(candidate(vec![6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]), 5);\n assert_eq!(candidate(vec![1]), 1);\n assert_eq!(candidate(vec![8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]), 4);\n assert_eq!(candidate(vec![2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]), 2);\n assert_eq!(candidate(vec![1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]), 1);\n assert_eq!(candidate(vec![9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]), 4);\n assert_eq!(candidate(vec![2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]), 4);\n assert_eq!(candidate(vec![9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]), 2);\n assert_eq!(candidate(vec![5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]), -1);\n assert_eq!(candidate(vec![10]), -1);\n assert_eq!(candidate(vec![9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]), 2);\n assert_eq!(candidate(vec![5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]), 1);\n assert_eq!(candidate(vec![7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]), 1);\n assert_eq!(candidate(vec![3, 10, 10, 9, 2]), -1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "rs", - "prompt": "/// Write a function that takes a string and returns True if the string\n/// length is a prime number or False otherwise\n/// Examples\nfn prime_length(string: String) -> bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = prime_length;\n assert_eq!(candidate(String::from(\"Hello\")), true);\n assert_eq!(candidate(String::from(\"abcdcba\")), true);\n assert_eq!(candidate(String::from(\"kittens\")), true);\n assert_eq!(candidate(String::from(\"orange\")), false);\n assert_eq!(candidate(String::from(\"wow\")), true);\n assert_eq!(candidate(String::from(\"world\")), true);\n assert_eq!(candidate(String::from(\"MadaM\")), true);\n assert_eq!(candidate(String::from(\"Wow\")), true);\n assert_eq!(candidate(String::from(\"\")), false);\n assert_eq!(candidate(String::from(\"HI\")), true);\n assert_eq!(candidate(String::from(\"go\")), true);\n assert_eq!(candidate(String::from(\"gogo\")), false);\n assert_eq!(candidate(String::from(\"aaaaaaaaaaaaaaa\")), false);\n assert_eq!(candidate(String::from(\"Madam\")), true);\n assert_eq!(candidate(String::from(\"M\")), false);\n assert_eq!(candidate(String::from(\"0\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_58_common", - "language": "rs", - "prompt": "/// Return sorted unique common elements for two lists.\nfn common(l1: Vec, l2: Vec) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = common;\n assert_eq!(candidate(vec![1, 4, 3, 34, 653, 2, 5], vec![5, 7, 1, 5, 9, 653, 121]), vec![1, 5, 653]);\n assert_eq!(candidate(vec![5, 3, 2, 8], vec![3, 2]), vec![2, 3]);\n assert_eq!(candidate(vec![4, 3, 2, 8], vec![3, 2, 4]), vec![2, 3, 4]);\n assert_eq!(candidate(vec![4, 3, 2, 8], Vec::::new()), Vec::::new());\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "rs", - "prompt": "/// The Brazilian factorial is defined as:\n/// brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n/// where n > 0\n/// For example:\n/// The function will receive an integer as input and should return the special\n/// factorial of this integer.\nfn special_factorial(n: isize) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = special_factorial;\n assert_eq!(candidate(4), 288);\n assert_eq!(candidate(5), 34560);\n assert_eq!(candidate(7), 125411328000);\n assert_eq!(candidate(1), 1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "rs", - "prompt": "/// In this problem, you will implement a function that takes two lists of numbers,\n/// and determines whether it is possible to perform an exchange of elements\n/// between them to make lst1 a list of only even numbers.\n/// There is no limit on the number of exchanged elements between lst1 and lst2.\n/// If it is possible to exchange elements between the lst1 and lst2 to make\n/// all the elements of lst1 to be even, return \"YES\".\n/// Otherwise, return \"NO\".\n/// For example:\n/// It is assumed that the input lists will be non-empty.\nfn exchange(lst1: Vec, lst2: Vec) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = exchange;\n assert_eq!(candidate(vec![1, 2, 3, 4], vec![1, 2, 3, 4]), String::from(\"YES\"));\n assert_eq!(candidate(vec![1, 2, 3, 4], vec![1, 5, 3, 4]), String::from(\"NO\"));\n assert_eq!(candidate(vec![1, 2, 3, 4], vec![2, 1, 4, 3]), String::from(\"YES\"));\n assert_eq!(candidate(vec![5, 7, 3], vec![2, 6, 4]), String::from(\"YES\"));\n assert_eq!(candidate(vec![5, 7, 3], vec![2, 6, 3]), String::from(\"NO\"));\n assert_eq!(candidate(vec![3, 2, 6, 1, 8, 9], vec![3, 5, 5, 1, 1, 1]), String::from(\"NO\"));\n assert_eq!(candidate(vec![100, 200], vec![200, 200]), String::from(\"YES\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "rs", - "prompt": "/// Given a non-empty array of integers arr and an integer k, return\n/// the sum of the elements with at most two digits from the first k elements of arr.\n/// Example:\n/// Constraints:\n/// 1. 1 <= len(arr) <= 100\n/// 2. 1 <= k <= len(arr)\nfn add_elements(arr: Vec, k: isize) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = add_elements;\n assert_eq!(candidate(vec![1, -2, -3, 41, 57, 76, 87, 88, 99], 3), -4);\n assert_eq!(candidate(vec![111, 121, 3, 4000, 5, 6], 2), 0);\n assert_eq!(candidate(vec![11, 21, 3, 90, 5, 6, 7, 8, 9], 4), 125);\n assert_eq!(candidate(vec![111, 21, 3, 4000, 5, 6, 7, 8, 9], 4), 24);\n assert_eq!(candidate(vec![1], 1), 1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "rs", - "prompt": "/// A simple program which should return the value of x if n is \n/// a prime number and should return the value of y otherwise.\n/// Examples:\nfn x_or_y(n: isize, x: isize, y: isize) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = x_or_y;\n assert_eq!(candidate(7, 34, 12), 34);\n assert_eq!(candidate(15, 8, 5), 5);\n assert_eq!(candidate(3, 33, 5212), 33);\n assert_eq!(candidate(1259, 3, 52), 3);\n assert_eq!(candidate(7919, -1, 12), -1);\n assert_eq!(candidate(3609, 1245, 583), 583);\n assert_eq!(candidate(91, 56, 129), 129);\n assert_eq!(candidate(6, 34, 1234), 1234);\n assert_eq!(candidate(1, 2, 0), 0);\n assert_eq!(candidate(2, 2, 0), 2);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "rs", - "prompt": "/// Given length of a side and high return area for a triangle.\nfn triangle_area(a: isize, h: isize) -> f64 {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = triangle_area;\n assert_eq!(candidate(5, 3), 7.5);\n assert_eq!(candidate(2, 2), 2.0);\n assert_eq!(candidate(10, 8), 40.0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "rs", - "prompt": "/// Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n/// the last couple centuries. However, what people don't know is Tribonacci sequence.\n/// Tribonacci sequence is defined by the recurrence:\n/// tri(1) = 3\n/// tri(n) = 1 + n / 2, if n is even.\n/// tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n/// For example:\n/// tri(2) = 1 + (2 / 2) = 2\n/// tri(4) = 3\n/// tri(3) = tri(2) + tri(1) + tri(4)\n/// = 2 + 3 + 3 = 8 \n/// You are given a non-negative integer number n, you have to a return a list of the \n/// first n + 1 numbers of the Tribonacci sequence.\n/// Examples:\nfn tri(n: isize) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = tri;\n assert_eq!(candidate(3), vec![1, 3, 2, 8]);\n assert_eq!(candidate(4), vec![1, 3, 2, 8, 3]);\n assert_eq!(candidate(5), vec![1, 3, 2, 8, 3, 15]);\n assert_eq!(candidate(6), vec![1, 3, 2, 8, 3, 15, 4]);\n assert_eq!(candidate(7), vec![1, 3, 2, 8, 3, 15, 4, 24]);\n assert_eq!(candidate(8), vec![1, 3, 2, 8, 3, 15, 4, 24, 5]);\n assert_eq!(candidate(9), vec![1, 3, 2, 8, 3, 15, 4, 24, 5, 35]);\n assert_eq!(candidate(20), vec![1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11]);\n assert_eq!(candidate(0), vec![1]);\n assert_eq!(candidate(1), vec![1, 3]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "rs", - "prompt": "/// You are given a list of two strings, both strings consist of open\n/// parentheses '(' or close parentheses ')' only.\n/// Your job is to check if it is possible to concatenate the two strings in\n/// some order, that the resulting string will be good.\n/// A string S is considered to be good if and only if all parentheses in S\n/// are balanced. For example: the string '(())()' is good, while the string\n/// '())' is not.\n/// Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n/// Examples:\nfn match_parens(lst: Vec) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = match_parens;\n assert_eq!(candidate(vec![String::from(\"()(\"), String::from(\")\")]), String::from(\"Yes\"));\n assert_eq!(candidate(vec![String::from(\")\"), String::from(\")\")]), String::from(\"No\"));\n assert_eq!(candidate(vec![String::from(\"(()(())\"), String::from(\"())())\")]), String::from(\"No\"));\n assert_eq!(candidate(vec![String::from(\")())\"), String::from(\"(()()(\")]), String::from(\"Yes\"));\n assert_eq!(candidate(vec![String::from(\"(())))\"), String::from(\"(()())((\")]), String::from(\"Yes\"));\n assert_eq!(candidate(vec![String::from(\"()\"), String::from(\"())\")]), String::from(\"No\"));\n assert_eq!(candidate(vec![String::from(\"(()(\"), String::from(\"()))()\")]), String::from(\"Yes\"));\n assert_eq!(candidate(vec![String::from(\"((((\"), String::from(\"((())\")]), String::from(\"No\"));\n assert_eq!(candidate(vec![String::from(\")(()\"), String::from(\"(()(\")]), String::from(\"No\"));\n assert_eq!(candidate(vec![String::from(\")(\"), String::from(\")(\")]), String::from(\"No\"));\n assert_eq!(candidate(vec![String::from(\"(\"), String::from(\")\")]), String::from(\"Yes\"));\n assert_eq!(candidate(vec![String::from(\")\"), String::from(\"(\")]), String::from(\"Yes\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "rs", - "prompt": "/// From a list of integers, remove all elements that occur more than once.\n/// Keep order of elements left the same as in the input.\nfn remove_duplicates(numbers: Vec) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = remove_duplicates;\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![1, 2, 3, 4]), vec![1, 2, 3, 4]);\n assert_eq!(candidate(vec![1, 2, 3, 2, 4, 3, 5]), vec![1, 4, 5]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "rs", - "prompt": "/// Return a greatest common divisor of two integers a and b\nfn greatest_common_divisor(a: isize, b: isize) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = greatest_common_divisor;\n assert_eq!(candidate(3, 7), 1);\n assert_eq!(candidate(10, 15), 5);\n assert_eq!(candidate(49, 14), 7);\n assert_eq!(candidate(144, 60), 12);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "rs", - "prompt": "/// Checks if given string is a palindrome\nfn is_palindrome(text: String) -> bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = is_palindrome;\n assert_eq!(candidate(String::from(\"\")), true);\n assert_eq!(candidate(String::from(\"aba\")), true);\n assert_eq!(candidate(String::from(\"aaaaa\")), true);\n assert_eq!(candidate(String::from(\"zbcd\")), false);\n assert_eq!(candidate(String::from(\"xywyx\")), true);\n assert_eq!(candidate(String::from(\"xywyz\")), false);\n assert_eq!(candidate(String::from(\"xywzx\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "rs", - "prompt": "/// xs represent coefficients of a polynomial.\n/// xs[0] + xs[1] * x + xs[2] * x^2 + ....\n/// Return derivative of this polynomial in the same form.\nfn derivative(xs: Vec) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = derivative;\n assert_eq!(candidate(vec![3, 1, 2, 4, 5]), vec![1, 4, 12, 20]);\n assert_eq!(candidate(vec![1, 2, 3]), vec![2, 6]);\n assert_eq!(candidate(vec![3, 2, 1]), vec![2, 2]);\n assert_eq!(candidate(vec![3, 2, 1, 0, 4]), vec![2, 2, 0, 16]);\n assert_eq!(candidate(vec![1]), Vec::::new());\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "rs", - "prompt": "/// In this task, you will be given a string that represents a number of apples and oranges \n/// that are distributed in a basket of fruit this basket contains \n/// apples, oranges, and mango fruits. Given the string that represents the total number of \n/// the oranges and apples and an integer that represent the total number of the fruits \n/// in the basket return the number of the mango fruits in the basket.\n/// for examble:\nfn fruit_distribution(s: String, n: isize) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = fruit_distribution;\n assert_eq!(candidate(String::from(\"5 apples and 6 oranges\"), 19), 8);\n assert_eq!(candidate(String::from(\"5 apples and 6 oranges\"), 21), 10);\n assert_eq!(candidate(String::from(\"0 apples and 1 oranges\"), 3), 2);\n assert_eq!(candidate(String::from(\"1 apples and 0 oranges\"), 3), 2);\n assert_eq!(candidate(String::from(\"2 apples and 3 oranges\"), 100), 95);\n assert_eq!(candidate(String::from(\"2 apples and 3 oranges\"), 5), 0);\n assert_eq!(candidate(String::from(\"1 apples and 100 oranges\"), 120), 19);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "rs", - "prompt": "/// Write a function that takes an integer a and returns True \n/// if this ingeger is a cube of some integer number.\n/// Note: you may assume the input is always valid.\n/// Examples:\nfn iscube(a: isize) -> bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = iscube;\n assert_eq!(candidate(1), true);\n assert_eq!(candidate(2), false);\n assert_eq!(candidate(-1), true);\n assert_eq!(candidate(64), true);\n assert_eq!(candidate(180), false);\n assert_eq!(candidate(1000), true);\n assert_eq!(candidate(0), true);\n assert_eq!(candidate(1729), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "rs", - "prompt": "/// In this Kata, you have to sort an array of non-negative integers according to\n/// number of ones in their binary representation in ascending order.\n/// For similar number of ones, sort based on decimal value.\n/// It must be implemented like this:\nfn sort_array(arr: Vec) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = sort_array;\n assert_eq!(candidate(vec![1, 5, 2, 3, 4]), vec![1, 2, 4, 3, 5]);\n assert_eq!(candidate(vec![-2, -3, -4, -5, -6]), vec![-4, -2, -6, -5, -3]);\n assert_eq!(candidate(vec![1, 0, 2, 3, 4]), vec![0, 1, 2, 4, 3]);\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]), vec![2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77]);\n assert_eq!(candidate(vec![3, 6, 44, 12, 32, 5]), vec![32, 3, 5, 6, 12, 44]);\n assert_eq!(candidate(vec![2, 4, 8, 16, 32]), vec![2, 4, 8, 16, 32]);\n assert_eq!(candidate(vec![2, 4, 8, 16, 32]), vec![2, 4, 8, 16, 32]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "rs", - "prompt": "/// Given a list of strings, where each string consists of only digits, return a list.\n/// Each element i of the output should be \"the number of odd elements in the\n/// string i of the input.\" where all the i's should be replaced by the number\n/// of odd digits in the i'th string of the input.\nfn odd_count(lst: Vec) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = odd_count;\n assert_eq!(candidate(vec![String::from(\"1234567\")]), vec![String::from(\"the number of odd elements 4n the str4ng 4 of the 4nput.\")]);\n assert_eq!(candidate(vec![String::from(\"3\"), String::from(\"11111111\")]), vec![String::from(\"the number of odd elements 1n the str1ng 1 of the 1nput.\"), String::from(\"the number of odd elements 8n the str8ng 8 of the 8nput.\")]);\n assert_eq!(candidate(vec![String::from(\"271\"), String::from(\"137\"), String::from(\"314\")]), vec![String::from(\"the number of odd elements 2n the str2ng 2 of the 2nput.\"), String::from(\"the number of odd elements 3n the str3ng 3 of the 3nput.\"), String::from(\"the number of odd elements 2n the str2ng 2 of the 2nput.\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "rs", - "prompt": "/// brackets is a string of \"(\" and \")\".\n/// return True if every opening bracket has a corresponding closing bracket.\nfn correct_bracketing(brackets: String) -> bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = correct_bracketing;\n assert_eq!(candidate(String::from(\"()\")), true);\n assert_eq!(candidate(String::from(\"(()())\")), true);\n assert_eq!(candidate(String::from(\"()()(()())()\")), true);\n assert_eq!(candidate(String::from(\"()()((()()())())(()()(()))\")), true);\n assert_eq!(candidate(String::from(\"((()())))\")), false);\n assert_eq!(candidate(String::from(\")(()\")), false);\n assert_eq!(candidate(String::from(\"(\")), false);\n assert_eq!(candidate(String::from(\"((((\")), false);\n assert_eq!(candidate(String::from(\")\")), false);\n assert_eq!(candidate(String::from(\"(()\")), false);\n assert_eq!(candidate(String::from(\"()()(()())())(()\")), false);\n assert_eq!(candidate(String::from(\"()()(()())()))()\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "rs", - "prompt": "/// Task\n/// Write a function that takes a string as input and returns the sum of the upper characters only'\n/// ASCII codes.\n/// Examples:\nfn digitSum(s: String) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = digitSum;\n assert_eq!(candidate(String::from(\"\")), 0);\n assert_eq!(candidate(String::from(\"abAB\")), 131);\n assert_eq!(candidate(String::from(\"abcCd\")), 67);\n assert_eq!(candidate(String::from(\"helloE\")), 69);\n assert_eq!(candidate(String::from(\"woArBld\")), 131);\n assert_eq!(candidate(String::from(\"aAaaaXa\")), 153);\n assert_eq!(candidate(String::from(\" How are yOu?\")), 151);\n assert_eq!(candidate(String::from(\"You arE Very Smart\")), 327);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "rs", - "prompt": "/// Write a function that accepts a list of strings as a parameter,\n/// deletes the strings that have odd lengths from it,\n/// and returns the resulted list with a sorted order,\n/// The list is always a list of strings and never an array of numbers,\n/// and it may contain duplicates.\n/// The order of the list should be ascending by length of each word, and you\n/// should return the list sorted by that rule.\n/// If two words have the same length, sort the list alphabetically.\n/// The function should return a list of strings in sorted order.\n/// You may assume that all words will have the same length.\n/// For example:\nfn sorted_list_sum(lst: Vec) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = sorted_list_sum;\n assert_eq!(candidate(vec![String::from(\"aa\"), String::from(\"a\"), String::from(\"aaa\")]), vec![String::from(\"aa\")]);\n assert_eq!(candidate(vec![String::from(\"school\"), String::from(\"AI\"), String::from(\"asdf\"), String::from(\"b\")]), vec![String::from(\"AI\"), String::from(\"asdf\"), String::from(\"school\")]);\n assert_eq!(candidate(vec![String::from(\"d\"), String::from(\"b\"), String::from(\"c\"), String::from(\"a\")]), Vec::::new());\n assert_eq!(candidate(vec![String::from(\"d\"), String::from(\"dcba\"), String::from(\"abcd\"), String::from(\"a\")]), vec![String::from(\"abcd\"), String::from(\"dcba\")]);\n assert_eq!(candidate(vec![String::from(\"AI\"), String::from(\"ai\"), String::from(\"au\")]), vec![String::from(\"AI\"), String::from(\"ai\"), String::from(\"au\")]);\n assert_eq!(candidate(vec![String::from(\"a\"), String::from(\"b\"), String::from(\"b\"), String::from(\"c\"), String::from(\"c\"), String::from(\"a\")]), Vec::::new());\n assert_eq!(candidate(vec![String::from(\"aaaa\"), String::from(\"bbbb\"), String::from(\"dd\"), String::from(\"cc\")]), vec![String::from(\"cc\"), String::from(\"dd\"), String::from(\"aaaa\"), String::from(\"bbbb\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "rs", - "prompt": "/// You are given an array arr of integers and you need to return\n/// sum of magnitudes of integers multiplied by product of all signs\n/// of each number in the array, represented by 1, -1 or 0.\n/// Note: return None for empty arr.\n/// Example:\nfn prod_signs(arr: Vec) -> Option {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = prod_signs;\n assert_eq!(candidate(vec![1, 2, 2, -4]), Some(-9));\n assert_eq!(candidate(vec![0, 1]), Some(0));\n assert_eq!(candidate(vec![1, 1, 1, 2, 3, -1, 1]), Some(-10));\n assert_eq!(candidate(Vec::::new()), None);\n assert_eq!(candidate(vec![2, 4, 1, 2, -1, -1, 9]), Some(20));\n assert_eq!(candidate(vec![-1, 1, -1, 1]), Some(4));\n assert_eq!(candidate(vec![-1, 1, 1, 1]), Some(-4));\n assert_eq!(candidate(vec![-1, 1, 1, 0]), Some(0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "rs", - "prompt": "/// Return list with elements incremented by 1.\nfn incr_list(l: Vec) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = incr_list;\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![3, 2, 1]), vec![4, 3, 2]);\n assert_eq!(candidate(vec![5, 2, 5, 2, 3, 3, 9, 0, 123]), vec![6, 3, 6, 3, 4, 4, 10, 1, 124]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "rs", - "prompt": "/// From a given list of integers, generate a list of rolling maximum element found until given moment\n/// in the sequence.\nfn rolling_max(numbers: Vec) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = rolling_max;\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![1, 2, 3, 4]), vec![1, 2, 3, 4]);\n assert_eq!(candidate(vec![4, 3, 2, 1]), vec![4, 4, 4, 4]);\n assert_eq!(candidate(vec![3, 2, 3, 100, 3]), vec![3, 3, 3, 100, 100]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "rs", - "prompt": "/// Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n/// separate those group into separate strings and return the list of those.\n/// Separate groups are balanced (each open brace is properly closed) and not nested within each other\n/// Ignore any spaces in the input string.\nfn separate_paren_groups(paren_string: String) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = separate_paren_groups;\n assert_eq!(candidate(String::from(\"(()()) ((())) () ((())()())\")), vec![String::from(\"(()())\"), String::from(\"((()))\"), String::from(\"()\"), String::from(\"((())()())\")]);\n assert_eq!(candidate(String::from(\"() (()) ((())) (((())))\")), vec![String::from(\"()\"), String::from(\"(())\"), String::from(\"((()))\"), String::from(\"(((())))\")]);\n assert_eq!(candidate(String::from(\"(()(())((())))\")), vec![String::from(\"(()(())((())))\")]);\n assert_eq!(candidate(String::from(\"( ) (( )) (( )( ))\")), vec![String::from(\"()\"), String::from(\"(())\"), String::from(\"(()())\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "rs", - "prompt": "/// You will be given a string of words separated by commas or spaces. Your task is\n/// to split the string into words and return an array of the words.\n/// For example:\nfn words_string(s: String) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = words_string;\n assert_eq!(candidate(String::from(\"Hi, my name is John\")), vec![String::from(\"Hi\"), String::from(\"my\"), String::from(\"name\"), String::from(\"is\"), String::from(\"John\")]);\n assert_eq!(candidate(String::from(\"One, two, three, four, five, six\")), vec![String::from(\"One\"), String::from(\"two\"), String::from(\"three\"), String::from(\"four\"), String::from(\"five\"), String::from(\"six\")]);\n assert_eq!(candidate(String::from(\"Hi, my name\")), vec![String::from(\"Hi\"), String::from(\"my\"), String::from(\"name\")]);\n assert_eq!(candidate(String::from(\"One,, two, three, four, five, six,\")), vec![String::from(\"One\"), String::from(\"two\"), String::from(\"three\"), String::from(\"four\"), String::from(\"five\"), String::from(\"six\")]);\n assert_eq!(candidate(String::from(\"\")), Vec::::new());\n assert_eq!(candidate(String::from(\"ahmed , gamal\")), vec![String::from(\"ahmed\"), String::from(\"gamal\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "rs", - "prompt": "/// This function takes a list l and returns a list l' such that\n/// l' is identical to l in the odd indicies, while its values at the even indicies are equal\n/// to the values of the even indicies of l, but sorted.\nfn sort_even(l: Vec) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = sort_even;\n assert_eq!(candidate(vec![1, 2, 3]), vec![1, 2, 3]);\n assert_eq!(candidate(vec![5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]), vec![-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123]);\n assert_eq!(candidate(vec![5, 8, -12, 4, 23, 2, 3, 11, 12, -10]), vec![-12, 8, 3, 4, 5, 2, 12, 11, 23, -10]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "rs", - "prompt": "/// I think we all remember that feeling when the result of some long-awaited\n/// event is finally known. The feelings and thoughts you have at that moment are\n/// definitely worth noting down and comparing.\n/// Your task is to determine if a person correctly guessed the results of a number of matches.\n/// You are given two arrays of scores and guesses of equal length, where each index shows a match. \n/// Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n/// the value is 0, and if not, the value is the absolute difference between the guess and the score.\n/// example:\nfn compare(game: Vec, guess: Vec) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = compare;\n assert_eq!(candidate(vec![1, 2, 3, 4, 5, 1], vec![1, 2, 3, 4, 2, -2]), vec![0, 0, 0, 0, 3, 3]);\n assert_eq!(candidate(vec![0, 0, 0, 0, 0, 0], vec![0, 0, 0, 0, 0, 0]), vec![0, 0, 0, 0, 0, 0]);\n assert_eq!(candidate(vec![1, 2, 3], vec![-1, -2, -3]), vec![2, 4, 6]);\n assert_eq!(candidate(vec![1, 2, 3, 5], vec![-1, 2, 3, 4]), vec![2, 0, 0, 1]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "rs", - "prompt": "/// Given a positive integer n, return a tuple that has the number of even and odd\n/// integer palindromes that fall within the range(1, n), inclusive.\n/// Example 1:\n/// Explanation:\n/// Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n/// Example 2:\n/// Explanation:\n/// Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n/// Note:\n/// 1. 1 <= n <= 10^3\n/// 2. returned tuple has the number of even and odd integer palindromes respectively.\nfn even_odd_palindrome(n: isize) -> (isize, isize) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = even_odd_palindrome;\n assert_eq!(candidate(123), (8, 13));\n assert_eq!(candidate(12), (4, 6));\n assert_eq!(candidate(3), (1, 2));\n assert_eq!(candidate(63), (6, 8));\n assert_eq!(candidate(25), (5, 6));\n assert_eq!(candidate(19), (4, 6));\n assert_eq!(candidate(9), (4, 5));\n assert_eq!(candidate(1), (0, 1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "rs", - "prompt": "/// The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n/// fib4(0) -> 0\n/// fib4(1) -> 0\n/// fib4(2) -> 2\n/// fib4(3) -> 0\n/// fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n/// Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\nfn fib4(n: isize) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = fib4;\n assert_eq!(candidate(5), 4);\n assert_eq!(candidate(8), 28);\n assert_eq!(candidate(10), 104);\n assert_eq!(candidate(12), 386);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "rs", - "prompt": "/// Given two positive integers a and b, return the even digits between a\n/// and b, in ascending order.\n/// For example:\nfn generate_integers(a: isize, b: isize) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = generate_integers;\n assert_eq!(candidate(2, 10), vec![2, 4, 6, 8]);\n assert_eq!(candidate(10, 2), vec![2, 4, 6, 8]);\n assert_eq!(candidate(132, 2), vec![2, 4, 6, 8]);\n assert_eq!(candidate(17, 89), Vec::::new());\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "rs", - "prompt": "/// For a given list of input numbers, calculate Mean Absolute Deviation\n/// around the mean of this dataset.\n/// Mean Absolute Deviation is the average absolute difference between each\n/// element and a centerpoint (mean in this case):\n/// MAD = average | x - x_mean |\nfn mean_absolute_deviation(numbers: Vec) -> f64 {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = mean_absolute_deviation;\n assert_eq!(candidate(vec![1.0, 2.0]), 0.5);\n assert_eq!(candidate(vec![1.0, 2.0, 3.0, 4.0]), 1.0);\n assert_eq!(candidate(vec![1.0, 2.0, 3.0, 4.0, 5.0]), 1.2);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "rs", - "prompt": "/// Create a function encrypt that takes a string as an argument and\n/// returns a string encrypted with the alphabet being rotated. \n/// The alphabet should be rotated in a manner such that the letters \n/// shift down by two multiplied to two places.\n/// For example:\nfn encrypt(s: String) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = encrypt;\n assert_eq!(candidate(String::from(\"hi\")), String::from(\"lm\"));\n assert_eq!(candidate(String::from(\"asdfghjkl\")), String::from(\"ewhjklnop\"));\n assert_eq!(candidate(String::from(\"gf\")), String::from(\"kj\"));\n assert_eq!(candidate(String::from(\"et\")), String::from(\"ix\"));\n assert_eq!(candidate(String::from(\"faewfawefaewg\")), String::from(\"jeiajeaijeiak\"));\n assert_eq!(candidate(String::from(\"hellomyfriend\")), String::from(\"lippsqcjvmirh\"));\n assert_eq!(candidate(String::from(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\")), String::from(\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\"));\n assert_eq!(candidate(String::from(\"a\")), String::from(\"e\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "rs", - "prompt": "/// Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n/// The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n/// as follows: start with any positive integer n. Then each term is obtained from the \n/// previous term as follows: if the previous term is even, the next term is one half of \n/// the previous term. If the previous term is odd, the next term is 3 times the previous\n/// term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n/// Note: \n/// 1. Collatz(1) is [1].\n/// 2. returned list sorted in increasing order.\n/// For example:\n/// get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\nfn get_odd_collatz(n: isize) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = get_odd_collatz;\n assert_eq!(candidate(14), vec![1, 5, 7, 11, 13, 17]);\n assert_eq!(candidate(5), vec![1, 5]);\n assert_eq!(candidate(12), vec![1, 3, 5]);\n assert_eq!(candidate(1), vec![1]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "rs", - "prompt": "/// Find how many times a given substring can be found in the original string. Count overlaping cases.\nfn how_many_times(string: String, substring: String) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = how_many_times;\n assert_eq!(candidate(String::from(\"\"), String::from(\"x\")), 0);\n assert_eq!(candidate(String::from(\"xyxyxyx\"), String::from(\"x\")), 4);\n assert_eq!(candidate(String::from(\"cacacacac\"), String::from(\"cac\")), 4);\n assert_eq!(candidate(String::from(\"john doe\"), String::from(\"john\")), 1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "rs", - "prompt": "/// We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n/// numbers in the array will be randomly ordered. Your task is to determine if\n/// it is possible to get an array sorted in non-decreasing order by performing \n/// the following operation on the given array:\n/// You are allowed to perform right shift operation any number of times.\n/// One right shift operation means shifting all elements of the array by one\n/// position in the right direction. The last element of the array will be moved to\n/// the starting position in the array i.e. 0th index. \n/// If it is possible to obtain the sorted array by performing the above operation\n/// then return True else return False.\n/// If the given array is empty then return True.\n/// Note: The given list is guaranteed to have unique elements.\n/// For Example:\n/// Explanation: By performin 2 right shift operations, non-decreasing order can\n/// be achieved for the given array.\n/// Explanation:It is not possible to get non-decreasing order for the given\n/// array by performing any number of right shift operations.\nfn move_one_ball(arr: Vec) -> bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = move_one_ball;\n assert_eq!(candidate(vec![3, 4, 5, 1, 2]), true);\n assert_eq!(candidate(vec![3, 5, 10, 1, 2]), true);\n assert_eq!(candidate(vec![4, 3, 1, 2]), false);\n assert_eq!(candidate(vec![3, 5, 4, 1, 2]), false);\n assert_eq!(candidate(Vec::::new()), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "rs", - "prompt": "/// Write a function which sorts the given list of integers\n/// in ascending order according to the sum of their digits.\n/// Note: if there are several items with similar sum of their digits,\n/// order them based on their index in original list.\n/// For example:\nfn order_by_points(nums: Vec) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = order_by_points;\n assert_eq!(candidate(vec![1, 11, -1, -11, -12]), vec![-1, -11, 1, -12, 11]);\n assert_eq!(candidate(vec![1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]), vec![0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457]);\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![1, -11, -32, 43, 54, -98, 2, -3]), vec![-3, -32, -98, -11, 1, 2, 43, 54]);\n assert_eq!(candidate(vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]), vec![1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9]);\n assert_eq!(candidate(vec![0, 6, 6, -76, -21, 23, 4]), vec![-76, -21, 0, 4, 23, 6, 6]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "rs", - "prompt": "/// Return list of prime factors of given integer in the order from smallest to largest.\n/// Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n/// Input number should be equal to the product of all factors\nfn factorize(n: isize) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = factorize;\n assert_eq!(candidate(2), vec![2]);\n assert_eq!(candidate(4), vec![2, 2]);\n assert_eq!(candidate(8), vec![2, 2, 2]);\n assert_eq!(candidate(57), vec![3, 19]);\n assert_eq!(candidate(3249), vec![3, 3, 19, 19]);\n assert_eq!(candidate(185193), vec![3, 3, 3, 19, 19, 19]);\n assert_eq!(candidate(20577), vec![3, 19, 19, 19]);\n assert_eq!(candidate(18), vec![2, 3, 3]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "rs", - "prompt": "/// Return True if all numbers in the list l are below threshold t.\nfn below_threshold(l: Vec, t: isize) -> bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = below_threshold;\n assert_eq!(candidate(vec![1, 2, 4, 10], 100), true);\n assert_eq!(candidate(vec![1, 20, 4, 10], 5), false);\n assert_eq!(candidate(vec![1, 20, 4, 10], 21), true);\n assert_eq!(candidate(vec![1, 20, 4, 10], 22), true);\n assert_eq!(candidate(vec![1, 8, 4, 10], 11), true);\n assert_eq!(candidate(vec![1, 8, 4, 10], 10), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "rs", - "prompt": "/// Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n/// For each of the group, output the deepest level of nesting of parentheses.\n/// E.g. (()()) has maximum two levels of nesting while ((())) has three.\nfn parse_nested_parens(paren_string: String) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = parse_nested_parens;\n assert_eq!(candidate(String::from(\"(()()) ((())) () ((())()())\")), vec![2, 3, 1, 3]);\n assert_eq!(candidate(String::from(\"() (()) ((())) (((())))\")), vec![1, 2, 3, 4]);\n assert_eq!(candidate(String::from(\"(()(())((())))\")), vec![4]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "rs", - "prompt": "/// Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n/// Examples\nfn solution(lst: Vec) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = solution;\n assert_eq!(candidate(vec![5, 8, 7, 1]), 12);\n assert_eq!(candidate(vec![3, 3, 3, 3, 3]), 9);\n assert_eq!(candidate(vec![30, 13, 24, 321]), 0);\n assert_eq!(candidate(vec![5, 9]), 5);\n assert_eq!(candidate(vec![2, 4, 8]), 0);\n assert_eq!(candidate(vec![30, 13, 23, 32]), 23);\n assert_eq!(candidate(vec![3, 13, 2, 9]), 3);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "rs", - "prompt": "/// You are given a positive integer n. You have to create an integer array a of length n.\n/// For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n/// Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n/// and a[i] + a[j] + a[k] is a multiple of 3.\n/// Example :\n/// Explanation: \n/// a = [1, 3, 7, 13, 21]\n/// The only valid triple is (1, 7, 13).\nfn get_max_triples(n: isize) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = get_max_triples;\n assert_eq!(candidate(5), 1);\n assert_eq!(candidate(6), 4);\n assert_eq!(candidate(10), 36);\n assert_eq!(candidate(100), 53361);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "rs", - "prompt": "/// You are given a list of integers.\n/// Write a function next_smallest() that returns the 2nd smallest element of the list.\n/// Return None if there is no such element.\nfn next_smallest(lst: Vec) -> Option {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = next_smallest;\n assert_eq!(candidate(vec![1, 2, 3, 4, 5]), Some(2));\n assert_eq!(candidate(vec![5, 1, 4, 3, 2]), Some(2));\n assert_eq!(candidate(Vec::::new()), None);\n assert_eq!(candidate(vec![1, 1]), None);\n assert_eq!(candidate(vec![1, 1, 1, 1, 0]), Some(1));\n assert_eq!(candidate(vec![1, 1]), None);\n assert_eq!(candidate(vec![-35, 34, 12, -45]), Some(-35));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "rs", - "prompt": "/// Input is a space-delimited string of numberals from 'zero' to 'nine'.\n/// Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n/// Return the string with numbers sorted from smallest to largest\nfn sort_numbers(numbers: String) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = sort_numbers;\n assert_eq!(candidate(String::from(\"\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"three\")), String::from(\"three\"));\n assert_eq!(candidate(String::from(\"three five nine\")), String::from(\"three five nine\"));\n assert_eq!(candidate(String::from(\"five zero four seven nine eight\")), String::from(\"zero four five seven eight nine\"));\n assert_eq!(candidate(String::from(\"six five four three two one zero\")), String::from(\"zero one two three four five six\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "rs", - "prompt": "/// You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\nfn cycpattern_check(a: String, b: String) -> bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = cycpattern_check;\n assert_eq!(candidate(String::from(\"xyzw\"), String::from(\"xyw\")), false);\n assert_eq!(candidate(String::from(\"yello\"), String::from(\"ell\")), true);\n assert_eq!(candidate(String::from(\"whattup\"), String::from(\"ptut\")), false);\n assert_eq!(candidate(String::from(\"efef\"), String::from(\"fee\")), true);\n assert_eq!(candidate(String::from(\"abab\"), String::from(\"aabb\")), false);\n assert_eq!(candidate(String::from(\"winemtt\"), String::from(\"tinem\")), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "rs", - "prompt": "/// You will be given a number in decimal form and your task is to convert it to\n/// binary format. The function should return a string, with each character representing a binary\n/// number. Each character in the string will be '0' or '1'.\n/// There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n/// The extra characters are there to help with the format.\n/// Examples:\nfn decimal_to_binary(decimal: isize) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = decimal_to_binary;\n assert_eq!(candidate(0), String::from(\"db0db\"));\n assert_eq!(candidate(32), String::from(\"db100000db\"));\n assert_eq!(candidate(103), String::from(\"db1100111db\"));\n assert_eq!(candidate(15), String::from(\"db1111db\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "rs", - "prompt": "/// Filter an input list of strings only for ones that contain given substring\nfn filter_by_substring(strings: Vec, substring: String) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = filter_by_substring;\n assert_eq!(candidate(Vec::::new(), String::from(\"john\")), Vec::::new());\n assert_eq!(candidate(vec![String::from(\"xxx\"), String::from(\"asd\"), String::from(\"xxy\"), String::from(\"john doe\"), String::from(\"xxxAAA\"), String::from(\"xxx\")], String::from(\"xxx\")), vec![String::from(\"xxx\"), String::from(\"xxxAAA\"), String::from(\"xxx\")]);\n assert_eq!(candidate(vec![String::from(\"xxx\"), String::from(\"asd\"), String::from(\"aaaxxy\"), String::from(\"john doe\"), String::from(\"xxxAAA\"), String::from(\"xxx\")], String::from(\"xx\")), vec![String::from(\"xxx\"), String::from(\"aaaxxy\"), String::from(\"xxxAAA\"), String::from(\"xxx\")]);\n assert_eq!(candidate(vec![String::from(\"grunt\"), String::from(\"trumpet\"), String::from(\"prune\"), String::from(\"gruesome\")], String::from(\"run\")), vec![String::from(\"grunt\"), String::from(\"prune\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "rs", - "prompt": "/// Given an integer. return a tuple that has the number of even and odd digits respectively.\n/// Example:\nfn even_odd_count(num: isize) -> (isize, isize) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = even_odd_count;\n assert_eq!(candidate(7), (0, 1));\n assert_eq!(candidate(-78), (1, 1));\n assert_eq!(candidate(3452), (2, 2));\n assert_eq!(candidate(346211), (3, 3));\n assert_eq!(candidate(-345821), (3, 3));\n assert_eq!(candidate(-2), (1, 0));\n assert_eq!(candidate(-45347), (2, 3));\n assert_eq!(candidate(0), (1, 0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "rs", - "prompt": "/// Write a function that accepts a list of strings.\n/// The list contains different words. Return the word with maximum number\n/// of unique characters. If multiple strings have maximum number of unique\n/// characters, return the one which comes first in lexicographical order.\nfn find_max(words: Vec) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = find_max;\n assert_eq!(candidate(vec![String::from(\"name\"), String::from(\"of\"), String::from(\"string\")]), String::from(\"string\"));\n assert_eq!(candidate(vec![String::from(\"name\"), String::from(\"enam\"), String::from(\"game\")]), String::from(\"enam\"));\n assert_eq!(candidate(vec![String::from(\"aaaaaaa\"), String::from(\"bb\"), String::from(\"cc\")]), String::from(\"aaaaaaa\"));\n assert_eq!(candidate(vec![String::from(\"abc\"), String::from(\"cba\")]), String::from(\"abc\"));\n assert_eq!(candidate(vec![String::from(\"play\"), String::from(\"this\"), String::from(\"game\"), String::from(\"of\"), String::from(\"footbott\")]), String::from(\"footbott\"));\n assert_eq!(candidate(vec![String::from(\"we\"), String::from(\"are\"), String::from(\"gonna\"), String::from(\"rock\")]), String::from(\"gonna\"));\n assert_eq!(candidate(vec![String::from(\"we\"), String::from(\"are\"), String::from(\"a\"), String::from(\"mad\"), String::from(\"nation\")]), String::from(\"nation\"));\n assert_eq!(candidate(vec![String::from(\"this\"), String::from(\"is\"), String::from(\"a\"), String::from(\"prrk\")]), String::from(\"this\"));\n assert_eq!(candidate(vec![String::from(\"b\")]), String::from(\"b\"));\n assert_eq!(candidate(vec![String::from(\"play\"), String::from(\"play\"), String::from(\"play\")]), String::from(\"play\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "rs", - "prompt": "/// Create a function that returns a tuple (a, b), where 'a' is\n/// the largest of negative integers, and 'b' is the smallest\n/// of positive integers in a list.\n/// If there is no negative or positive integers, return them as None.\n/// Examples:\nfn largest_smallest_integers(lst: Vec) -> (Option, Option) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = largest_smallest_integers;\n assert_eq!(candidate(vec![2, 4, 1, 3, 5, 7]), (None, Some(1)));\n assert_eq!(candidate(vec![2, 4, 1, 3, 5, 7, 0]), (None, Some(1)));\n assert_eq!(candidate(vec![1, 3, 2, 4, 5, 6, -2]), (Some(-2), Some(1)));\n assert_eq!(candidate(vec![4, 5, 3, 6, 2, 7, -7]), (Some(-7), Some(2)));\n assert_eq!(candidate(vec![7, 3, 8, 4, 9, 2, 5, -9]), (Some(-9), Some(2)));\n assert_eq!(candidate(Vec::::new()), (None, None));\n assert_eq!(candidate(vec![0]), (None, None));\n assert_eq!(candidate(vec![-1, -3, -5, -6]), (Some(-1), None));\n assert_eq!(candidate(vec![-1, -3, -5, -6, 0]), (Some(-1), None));\n assert_eq!(candidate(vec![-6, -4, -4, -3, 1]), (Some(-3), Some(1)));\n assert_eq!(candidate(vec![-6, -4, -4, -3, -100, 1]), (Some(-3), Some(1)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "rs", - "prompt": "/// \"Given an array representing a branch of a tree that has non-negative integer nodes\n/// your task is to pluck one of the nodes and return it.\n/// The plucked node should be the node with the smallest even value.\n/// If multiple nodes with the same smallest even value are found return the node that has smallest index.\n/// The plucked node should be returned in a list, [ smalest_value, its index ],\n/// If there are no even values or the given array is empty, return [].\n/// Example 1:\n/// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n/// Example 2:\n/// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n/// Example 3:\n/// Example 4:\n/// Explanation: 0 is the smallest value, but there are two zeros,\n/// so we will choose the first zero, which has the smallest index.\n/// Constraints:\n/// * 1 <= nodes.length <= 10000\n/// * 0 <= node.value\nfn pluck(arr: Vec) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = pluck;\n assert_eq!(candidate(vec![4, 2, 3]), vec![2, 1]);\n assert_eq!(candidate(vec![1, 2, 3]), vec![2, 1]);\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![5, 0, 3, 0, 4, 2]), vec![0, 1]);\n assert_eq!(candidate(vec![1, 2, 3, 0, 5, 3]), vec![0, 3]);\n assert_eq!(candidate(vec![5, 4, 8, 4, 8]), vec![4, 1]);\n assert_eq!(candidate(vec![7, 6, 7, 1]), vec![6, 1]);\n assert_eq!(candidate(vec![7, 9, 7, 1]), Vec::::new());\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "rs", - "prompt": "/// Write a function count_nums which takes an array of integers and returns\n/// the number of elements which has a sum of digits > 0.\n/// If a number is negative, then its first signed digit will be negative:\n/// e.g. -123 has signed digits -1, 2, and 3.\nfn count_nums(arr: Vec) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = count_nums;\n assert_eq!(candidate(Vec::::new()), 0);\n assert_eq!(candidate(vec![-1, -2, 0]), 0);\n assert_eq!(candidate(vec![1, 1, 2, -2, 3, 4, 5]), 6);\n assert_eq!(candidate(vec![1, 6, 9, -6, 0, 1, 5]), 5);\n assert_eq!(candidate(vec![1, 100, 98, -7, 1, -1]), 4);\n assert_eq!(candidate(vec![12, 23, 34, -45, -56, 0]), 5);\n assert_eq!(candidate(vec![0, 1]), 1);\n assert_eq!(candidate(vec![1]), 1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "rs", - "prompt": "/// Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n/// each cell of the grid contains a value. Every integer in the range [1, N * N]\n/// inclusive appears exactly once on the cells of the grid.\n/// You have to find the minimum path of length k in the grid. You can start\n/// from any cell, and in each step you can move to any of the neighbor cells,\n/// in other words, you can go to cells which share an edge with you current\n/// cell.\n/// Please note that a path of length k means visiting exactly k cells (not\n/// necessarily distinct).\n/// You CANNOT go off the grid.\n/// A path A (of length k) is considered less than a path B (of length k) if\n/// after making the ordered lists of the values on the cells that A and B go\n/// through (let's call them lst_A and lst_B), lst_A is lexicographically less\n/// than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n/// such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n/// lst_A[j] = lst_B[j].\n/// It is guaranteed that the answer is unique.\n/// Return an ordered list of the values on the cells that the minimum path go through.\n/// Examples:\nfn minPath(grid: Vec>, k: isize) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = minPath;\n assert_eq!(candidate(vec![vec![1, 2, 3], vec![4, 5, 6], vec![7, 8, 9]], 3), vec![1, 2, 1]);\n assert_eq!(candidate(vec![vec![5, 9, 3], vec![4, 1, 6], vec![7, 8, 2]], 1), vec![1]);\n assert_eq!(candidate(vec![vec![1, 2, 3, 4], vec![5, 6, 7, 8], vec![9, 10, 11, 12], vec![13, 14, 15, 16]], 4), vec![1, 2, 1, 2]);\n assert_eq!(candidate(vec![vec![6, 4, 13, 10], vec![5, 7, 12, 1], vec![3, 16, 11, 15], vec![8, 14, 9, 2]], 7), vec![1, 10, 1, 10, 1, 10, 1]);\n assert_eq!(candidate(vec![vec![8, 14, 9, 2], vec![6, 4, 13, 15], vec![5, 7, 1, 12], vec![3, 10, 11, 16]], 5), vec![1, 7, 1, 7, 1]);\n assert_eq!(candidate(vec![vec![11, 8, 7, 2], vec![5, 16, 14, 4], vec![9, 3, 15, 6], vec![12, 13, 10, 1]], 9), vec![1, 6, 1, 6, 1, 6, 1, 6, 1]);\n assert_eq!(candidate(vec![vec![12, 13, 10, 1], vec![9, 3, 15, 6], vec![5, 16, 14, 4], vec![11, 8, 7, 2]], 12), vec![1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6]);\n assert_eq!(candidate(vec![vec![2, 7, 4], vec![3, 1, 5], vec![6, 8, 9]], 8), vec![1, 3, 1, 3, 1, 3, 1, 3]);\n assert_eq!(candidate(vec![vec![6, 1, 5], vec![3, 8, 9], vec![2, 7, 4]], 8), vec![1, 5, 1, 5, 1, 5, 1, 5]);\n assert_eq!(candidate(vec![vec![1, 2], vec![3, 4]], 10), vec![1, 2, 1, 2, 1, 2, 1, 2, 1, 2]);\n assert_eq!(candidate(vec![vec![1, 3], vec![3, 2]], 10), vec![1, 3, 1, 3, 1, 3, 1, 3, 1, 3]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "rs", - "prompt": "/// Given list of integers, return list in strange order.\n/// Strange sorting, is when you start with the minimum value,\n/// then maximum of the remaining integers, then minimum and so on.\n/// Examples:\nfn strange_sort_list(lst: Vec) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = strange_sort_list;\n assert_eq!(candidate(vec![1, 2, 3, 4]), vec![1, 4, 2, 3]);\n assert_eq!(candidate(vec![5, 6, 7, 8, 9]), vec![5, 9, 6, 8, 7]);\n assert_eq!(candidate(vec![1, 2, 3, 4, 5]), vec![1, 5, 2, 4, 3]);\n assert_eq!(candidate(vec![5, 6, 7, 8, 9, 1]), vec![1, 9, 5, 8, 6, 7]);\n assert_eq!(candidate(vec![5, 5, 5, 5]), vec![5, 5, 5, 5]);\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![1, 2, 3, 4, 5, 6, 7, 8]), vec![1, 8, 2, 7, 3, 6, 4, 5]);\n assert_eq!(candidate(vec![0, 2, 2, 2, 5, 5, -5, -5]), vec![-5, 5, -5, 5, 0, 2, 2, 2]);\n assert_eq!(candidate(vec![111111]), vec![111111]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "rs", - "prompt": "/// Given a string 'text', return its md5 hash equivalent string.\n/// If 'text' is an empty string, return None.\nfn string_to_md5(text: String) -> Option {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = string_to_md5;\n assert_eq!(candidate(String::from(\"Hello world\")), Some(String::from(\"3e25960a79dbc69b674cd4ec67a72c62\")));\n assert_eq!(candidate(String::from(\"\")), None);\n assert_eq!(candidate(String::from(\"A B C\")), Some(String::from(\"0ef78513b0cb8cef12743f5aeb35f888\")));\n assert_eq!(candidate(String::from(\"password\")), Some(String::from(\"5f4dcc3b5aa765d61d8327deb882cf99\")));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "rs", - "prompt": "/// You are given a word. Your task is to find the closest vowel that stands between \n/// two consonants from the right side of the word (case sensitive).\n/// Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n/// find any vowel met the above condition. \n/// You may assume that the given string contains English letter only.\n/// Example:\nfn get_closest_vowel(word: String) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = get_closest_vowel;\n assert_eq!(candidate(String::from(\"yogurt\")), String::from(\"u\"));\n assert_eq!(candidate(String::from(\"full\")), String::from(\"u\"));\n assert_eq!(candidate(String::from(\"easy\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"eAsy\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"ali\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"bad\")), String::from(\"a\"));\n assert_eq!(candidate(String::from(\"most\")), String::from(\"o\"));\n assert_eq!(candidate(String::from(\"ab\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"ba\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"quick\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"anime\")), String::from(\"i\"));\n assert_eq!(candidate(String::from(\"Asia\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"Above\")), String::from(\"o\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "rs", - "prompt": "/// Change numerical base of input number x to base.\n/// return string representation after the conversion.\n/// base numbers are less than 10.\nfn change_base(x: isize, base: isize) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = change_base;\n assert_eq!(candidate(8, 3), String::from(\"22\"));\n assert_eq!(candidate(9, 3), String::from(\"100\"));\n assert_eq!(candidate(234, 2), String::from(\"11101010\"));\n assert_eq!(candidate(16, 2), String::from(\"10000\"));\n assert_eq!(candidate(8, 2), String::from(\"1000\"));\n assert_eq!(candidate(7, 2), String::from(\"111\"));\n assert_eq!(candidate(2, 3), String::from(\"2\"));\n assert_eq!(candidate(3, 4), String::from(\"3\"));\n assert_eq!(candidate(4, 5), String::from(\"4\"));\n assert_eq!(candidate(5, 6), String::from(\"5\"));\n assert_eq!(candidate(6, 7), String::from(\"6\"));\n assert_eq!(candidate(7, 8), String::from(\"7\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "rs", - "prompt": "/// Check if in given list of numbers, are any two numbers closer to each other than\n/// given threshold.\nfn has_close_elements(numbers: Vec, threshold: f64) -> bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = has_close_elements;\n assert_eq!(candidate(vec![1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3), true);\n assert_eq!(candidate(vec![1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05), false);\n assert_eq!(candidate(vec![1.0, 2.0, 5.9, 4.0, 5.0], 0.95), true);\n assert_eq!(candidate(vec![1.0, 2.0, 5.9, 4.0, 5.0], 0.8), false);\n assert_eq!(candidate(vec![1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1), true);\n assert_eq!(candidate(vec![1.1, 2.2, 3.1, 4.1, 5.1], 1.0), true);\n assert_eq!(candidate(vec![1.1, 2.2, 3.1, 4.1, 5.1], 0.5), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "rs", - "prompt": "/// Create a function that takes a string as input which contains only square brackets.\n/// The function should return True if and only if there is a valid subsequence of brackets \n/// where at least one bracket in the subsequence is nested.\nfn is_nested(string: String) -> bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = is_nested;\n assert_eq!(candidate(String::from(\"[[]]\")), true);\n assert_eq!(candidate(String::from(\"[]]]]]]][[[[[]\")), false);\n assert_eq!(candidate(String::from(\"[][]\")), false);\n assert_eq!(candidate(String::from(\"[]\")), false);\n assert_eq!(candidate(String::from(\"[[[[]]]]\")), true);\n assert_eq!(candidate(String::from(\"[]]]]]]]]]]\")), false);\n assert_eq!(candidate(String::from(\"[][][[]]\")), true);\n assert_eq!(candidate(String::from(\"[[]\")), false);\n assert_eq!(candidate(String::from(\"[]]\")), false);\n assert_eq!(candidate(String::from(\"[[]][[\")), true);\n assert_eq!(candidate(String::from(\"[[][]]\")), true);\n assert_eq!(candidate(String::from(\"\")), false);\n assert_eq!(candidate(String::from(\"[[[[[[[[\")), false);\n assert_eq!(candidate(String::from(\"]]]]]]]]\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "rs", - "prompt": "/// Concatenate list of strings into a single string\nfn concatenate(strings: Vec) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = concatenate;\n assert_eq!(candidate(Vec::::new()), String::from(\"\"));\n assert_eq!(candidate(vec![String::from(\"x\"), String::from(\"y\"), String::from(\"z\")]), String::from(\"xyz\"));\n assert_eq!(candidate(vec![String::from(\"x\"), String::from(\"y\"), String::from(\"z\"), String::from(\"w\"), String::from(\"k\")]), String::from(\"xyzwk\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "rs", - "prompt": "/// prime_fib returns n-th number that is a Fibonacci number and it's also prime.\nfn prime_fib(n: isize) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = prime_fib;\n assert_eq!(candidate(1), 2);\n assert_eq!(candidate(2), 3);\n assert_eq!(candidate(3), 5);\n assert_eq!(candidate(4), 13);\n assert_eq!(candidate(5), 89);\n assert_eq!(candidate(6), 233);\n assert_eq!(candidate(7), 1597);\n assert_eq!(candidate(8), 28657);\n assert_eq!(candidate(9), 514229);\n assert_eq!(candidate(10), 433494437);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "rs", - "prompt": "/// From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n/// other and return them in order (smaller number, larger number).\nfn find_closest_elements(numbers: Vec) -> (f64, f64) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = find_closest_elements;\n assert_eq!(candidate(vec![1.0, 2.0, 3.9, 4.0, 5.0, 2.2]), (3.9, 4.0));\n assert_eq!(candidate(vec![1.0, 2.0, 5.9, 4.0, 5.0]), (5.0, 5.9));\n assert_eq!(candidate(vec![1.0, 2.0, 3.0, 4.0, 5.0, 2.2]), (2.0, 2.2));\n assert_eq!(candidate(vec![1.0, 2.0, 3.0, 4.0, 5.0, 2.0]), (2.0, 2.0));\n assert_eq!(candidate(vec![1.1, 2.2, 3.1, 4.1, 5.1]), (2.2, 3.1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "rs", - "prompt": "/// You have been tasked to write a function that receives \n/// a hexadecimal number as a string and counts the number of hexadecimal \n/// digits that are primes (prime number, or a prime, is a natural number \n/// greater than 1 that is not a product of two smaller natural numbers).\n/// Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n/// Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n/// So you have to determine a number of the following digits: 2, 3, 5, 7, \n/// B (=decimal 11), D (=decimal 13).\n/// Note: you may assume the input is always correct or empty string, \n/// and symbols A,B,C,D,E,F are always uppercase.\n/// Examples:\nfn hex_key(num: String) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = hex_key;\n assert_eq!(candidate(String::from(\"AB\")), 1);\n assert_eq!(candidate(String::from(\"1077E\")), 2);\n assert_eq!(candidate(String::from(\"ABED1A33\")), 4);\n assert_eq!(candidate(String::from(\"2020\")), 2);\n assert_eq!(candidate(String::from(\"123456789ABCDEF0\")), 6);\n assert_eq!(candidate(String::from(\"112233445566778899AABBCCDDEEFF00\")), 12);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "rs", - "prompt": "/// Complete the function that takes two integers and returns \n/// the product of their unit digits.\n/// Assume the input is always valid.\n/// Examples:\nfn multiply(a: isize, b: isize) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = multiply;\n assert_eq!(candidate(148, 412), 16);\n assert_eq!(candidate(19, 28), 72);\n assert_eq!(candidate(2020, 1851), 0);\n assert_eq!(candidate(14, -15), 20);\n assert_eq!(candidate(76, 67), 42);\n assert_eq!(candidate(17, 27), 49);\n assert_eq!(candidate(0, 1), 0);\n assert_eq!(candidate(0, 0), 0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "rs", - "prompt": "/// Given list of numbers (of at least two elements), apply a linear transform to that list,\n/// such that the smallest number will become 0 and the largest will become 1\nfn rescale_to_unit(numbers: Vec) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = rescale_to_unit;\n assert_eq!(candidate(vec![2.0, 49.9]), vec![0.0, 1.0]);\n assert_eq!(candidate(vec![100.0, 49.9]), vec![1.0, 0.0]);\n assert_eq!(candidate(vec![1.0, 2.0, 3.0, 4.0, 5.0]), vec![0.0, 0.25, 0.5, 0.75, 1.0]);\n assert_eq!(candidate(vec![2.0, 1.0, 5.0, 3.0, 4.0]), vec![0.25, 0.0, 1.0, 0.5, 0.75]);\n assert_eq!(candidate(vec![12.0, 11.0, 15.0, 13.0, 14.0]), vec![0.25, 0.0, 1.0, 0.5, 0.75]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "rs", - "prompt": "/// Given a positive integer n, return the product of the odd digits.\n/// Return 0 if all digits are even.\n/// For example:\nfn digits(n: isize) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = digits;\n assert_eq!(candidate(5), 5);\n assert_eq!(candidate(54), 5);\n assert_eq!(candidate(120), 1);\n assert_eq!(candidate(5014), 5);\n assert_eq!(candidate(98765), 315);\n assert_eq!(candidate(5576543), 2625);\n assert_eq!(candidate(2468), 0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "rs", - "prompt": "/// You will be given the name of a class (a string) and a list of extensions.\n/// The extensions are to be used to load additional classes to the class. The\n/// strength of the extension is as follows: Let CAP be the number of the uppercase\n/// letters in the extension's name, and let SM be the number of lowercase letters \n/// in the extension's name, the strength is given by the fraction CAP - SM. \n/// You should find the strongest extension and return a string in this \n/// format: ClassName.StrongestExtensionName.\n/// If there are two or more extensions with the same strength, you should\n/// choose the one that comes first in the list.\n/// For example, if you are given \"Slices\" as the class and a list of the\n/// extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n/// return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n/// (its strength is -1).\n/// Example:\nfn Strongest_Extension(class_name: String, extensions: Vec) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = Strongest_Extension;\n assert_eq!(candidate(String::from(\"Watashi\"), vec![String::from(\"tEN\"), String::from(\"niNE\"), String::from(\"eIGHt8OKe\")]), String::from(\"Watashi.eIGHt8OKe\"));\n assert_eq!(candidate(String::from(\"Boku123\"), vec![String::from(\"nani\"), String::from(\"NazeDa\"), String::from(\"YEs.WeCaNe\"), String::from(\"32145tggg\")]), String::from(\"Boku123.YEs.WeCaNe\"));\n assert_eq!(candidate(String::from(\"__YESIMHERE\"), vec![String::from(\"t\"), String::from(\"eMptY\"), String::from(\"nothing\"), String::from(\"zeR00\"), String::from(\"NuLl__\"), String::from(\"123NoooneB321\")]), String::from(\"__YESIMHERE.NuLl__\"));\n assert_eq!(candidate(String::from(\"K\"), vec![String::from(\"Ta\"), String::from(\"TAR\"), String::from(\"t234An\"), String::from(\"cosSo\")]), String::from(\"K.TAR\"));\n assert_eq!(candidate(String::from(\"__HAHA\"), vec![String::from(\"Tab\"), String::from(\"123\"), String::from(\"781345\"), String::from(\"-_-\")]), String::from(\"__HAHA.123\"));\n assert_eq!(candidate(String::from(\"YameRore\"), vec![String::from(\"HhAas\"), String::from(\"okIWILL123\"), String::from(\"WorkOut\"), String::from(\"Fails\"), String::from(\"-_-\")]), String::from(\"YameRore.okIWILL123\"));\n assert_eq!(candidate(String::from(\"finNNalLLly\"), vec![String::from(\"Die\"), String::from(\"NowW\"), String::from(\"Wow\"), String::from(\"WoW\")]), String::from(\"finNNalLLly.WoW\"));\n assert_eq!(candidate(String::from(\"_\"), vec![String::from(\"Bb\"), String::from(\"91245\")]), String::from(\"_.Bb\"));\n assert_eq!(candidate(String::from(\"Sp\"), vec![String::from(\"671235\"), String::from(\"Bb\")]), String::from(\"Sp.671235\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "rs", - "prompt": "use std::collections::HashMap;\n\n/// Given a string representing a space separated lowercase letters, return a dictionary\n/// of the letter with the most repetition and containing the corresponding count.\n/// If several letters have the same occurrence, return all of them.\n/// Example:\nfn histogram(test: String) -> HashMap {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = histogram;\n assert_eq!(candidate(String::from(\"a b b a\")), HashMap::from([(String::from(\"a\"), 2), (String::from(\"b\"), 2)]));\n assert_eq!(candidate(String::from(\"a b c a b\")), HashMap::from([(String::from(\"a\"), 2), (String::from(\"b\"), 2)]));\n assert_eq!(candidate(String::from(\"a b c d g\")), HashMap::from([(String::from(\"a\"), 1), (String::from(\"b\"), 1), (String::from(\"c\"), 1), (String::from(\"d\"), 1), (String::from(\"g\"), 1)]));\n assert_eq!(candidate(String::from(\"r t g\")), HashMap::from([(String::from(\"r\"), 1), (String::from(\"t\"), 1), (String::from(\"g\"), 1)]));\n assert_eq!(candidate(String::from(\"b b b b a\")), HashMap::from([(String::from(\"b\"), 4)]));\n assert_eq!(candidate(String::from(\"r t g\")), HashMap::from([(String::from(\"r\"), 1), (String::from(\"t\"), 1), (String::from(\"g\"), 1)]));\n assert_eq!(candidate(String::from(\"\")), HashMap::from([]));\n assert_eq!(candidate(String::from(\"a\")), HashMap::from([(String::from(\"a\"), 1)]));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "rs", - "prompt": "/// pairs_sum_to_zero takes a list of integers as an input.\n/// it returns True if there are two distinct elements in the list that\n/// sum to zero, and False otherwise.\nfn pairs_sum_to_zero(l: Vec) -> bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = pairs_sum_to_zero;\n assert_eq!(candidate(vec![1, 3, 5, 0]), false);\n assert_eq!(candidate(vec![1, 3, -2, 1]), false);\n assert_eq!(candidate(vec![1, 2, 3, 7]), false);\n assert_eq!(candidate(vec![2, 4, -5, 3, 5, 7]), true);\n assert_eq!(candidate(vec![1]), false);\n assert_eq!(candidate(vec![-3, 9, -1, 3, 2, 30]), true);\n assert_eq!(candidate(vec![-3, 9, -1, 3, 2, 31]), true);\n assert_eq!(candidate(vec![-3, 9, -1, 4, 2, 30]), false);\n assert_eq!(candidate(vec![-3, 9, -1, 4, 2, 31]), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "rs", - "prompt": "/// Write a function that accepts two lists of strings and returns the list that has \n/// total number of chars in the all strings of the list less than the other list.\n/// if the two lists have the same number of chars, return the first list.\n/// Examples\nfn total_match(lst1: Vec, lst2: Vec) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = total_match;\n assert_eq!(candidate(Vec::::new(), Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![String::from(\"hi\"), String::from(\"admin\")], vec![String::from(\"hi\"), String::from(\"hi\")]), vec![String::from(\"hi\"), String::from(\"hi\")]);\n assert_eq!(candidate(vec![String::from(\"hi\"), String::from(\"admin\")], vec![String::from(\"hi\"), String::from(\"hi\"), String::from(\"admin\"), String::from(\"project\")]), vec![String::from(\"hi\"), String::from(\"admin\")]);\n assert_eq!(candidate(vec![String::from(\"4\")], vec![String::from(\"1\"), String::from(\"2\"), String::from(\"3\"), String::from(\"4\"), String::from(\"5\")]), vec![String::from(\"4\")]);\n assert_eq!(candidate(vec![String::from(\"hi\"), String::from(\"admin\")], vec![String::from(\"hI\"), String::from(\"Hi\")]), vec![String::from(\"hI\"), String::from(\"Hi\")]);\n assert_eq!(candidate(vec![String::from(\"hi\"), String::from(\"admin\")], vec![String::from(\"hI\"), String::from(\"hi\"), String::from(\"hi\")]), vec![String::from(\"hI\"), String::from(\"hi\"), String::from(\"hi\")]);\n assert_eq!(candidate(vec![String::from(\"hi\"), String::from(\"admin\")], vec![String::from(\"hI\"), String::from(\"hi\"), String::from(\"hii\")]), vec![String::from(\"hi\"), String::from(\"admin\")]);\n assert_eq!(candidate(Vec::::new(), vec![String::from(\"this\")]), Vec::::new());\n assert_eq!(candidate(vec![String::from(\"this\")], Vec::::new()), Vec::::new());\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "rs", - "prompt": "/// Circular shift the digits of the integer x, shift the digits right by shift\n/// and return the result as a string.\n/// If shift > number of digits, return digits reversed.\nfn circular_shift(x: isize, shift: isize) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = circular_shift;\n assert_eq!(candidate(100, 2), String::from(\"001\"));\n assert_eq!(candidate(12, 2), String::from(\"12\"));\n assert_eq!(candidate(97, 8), String::from(\"79\"));\n assert_eq!(candidate(12, 1), String::from(\"21\"));\n assert_eq!(candidate(11, 101), String::from(\"11\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "rs", - "prompt": "/// Return True is list elements are monotonically increasing or decreasing.\nfn monotonic(l: Vec) -> bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = monotonic;\n assert_eq!(candidate(vec![1, 2, 4, 10]), true);\n assert_eq!(candidate(vec![1, 2, 4, 20]), true);\n assert_eq!(candidate(vec![1, 20, 4, 10]), false);\n assert_eq!(candidate(vec![4, 1, 0, -10]), true);\n assert_eq!(candidate(vec![4, 1, 1, 0]), true);\n assert_eq!(candidate(vec![1, 2, 3, 2, 5, 60]), false);\n assert_eq!(candidate(vec![1, 2, 3, 4, 5, 60]), true);\n assert_eq!(candidate(vec![9, 9, 9, 9]), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "rs", - "prompt": "/// Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n/// Example\nfn is_equal_to_sum_even(n: isize) -> bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = is_equal_to_sum_even;\n assert_eq!(candidate(4), false);\n assert_eq!(candidate(6), false);\n assert_eq!(candidate(8), true);\n assert_eq!(candidate(10), true);\n assert_eq!(candidate(11), false);\n assert_eq!(candidate(12), true);\n assert_eq!(candidate(13), false);\n assert_eq!(candidate(16), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "rs", - "prompt": "/// Input to this function is a string representing musical notes in a special ASCII format.\n/// Your task is to parse this string and return list of integers corresponding to how many beats does each\n/// not last.\n/// Here is a legend:\n/// 'o' - whole note, lasts four beats\n/// 'o|' - half note, lasts two beats\n/// '.|' - quater note, lasts one beat\nfn parse_music(music_string: String) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = parse_music;\n assert_eq!(candidate(String::from(\"\")), Vec::::new());\n assert_eq!(candidate(String::from(\"o o o o\")), vec![4, 4, 4, 4]);\n assert_eq!(candidate(String::from(\".| .| .| .|\")), vec![1, 1, 1, 1]);\n assert_eq!(candidate(String::from(\"o| o| .| .| o o o o\")), vec![2, 2, 1, 1, 4, 4, 4, 4]);\n assert_eq!(candidate(String::from(\"o| .| o| .| o o| o o|\")), vec![2, 1, 2, 1, 4, 2, 4, 2]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "rs", - "prompt": "/// \"\n/// This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n/// multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n/// change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n/// Examples:\nfn sum_squares(lst: Vec) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = sum_squares;\n assert_eq!(candidate(vec![1, 2, 3]), 6);\n assert_eq!(candidate(vec![1, 4, 9]), 14);\n assert_eq!(candidate(Vec::::new()), 0);\n assert_eq!(candidate(vec![1, 1, 1, 1, 1, 1, 1, 1, 1]), 9);\n assert_eq!(candidate(vec![-1, -1, -1, -1, -1, -1, -1, -1, -1]), -3);\n assert_eq!(candidate(vec![0]), 0);\n assert_eq!(candidate(vec![-1, -5, 2, -1, -5]), -126);\n assert_eq!(candidate(vec![-56, -99, 1, 0, -2]), 3030);\n assert_eq!(candidate(vec![-1, 0, 0, 0, 0, 0, 0, 0, -1]), 0);\n assert_eq!(candidate(vec![-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37]), -14196);\n assert_eq!(candidate(vec![-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10]), -1448);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "rs", - "prompt": "/// triples_sum_to_zero takes a list of integers as an input.\n/// it returns True if there are three distinct elements in the list that\n/// sum to zero, and False otherwise.\nfn triples_sum_to_zero(l: Vec) -> bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = triples_sum_to_zero;\n assert_eq!(candidate(vec![1, 3, 5, 0]), false);\n assert_eq!(candidate(vec![1, 3, 5, -1]), false);\n assert_eq!(candidate(vec![1, 3, -2, 1]), true);\n assert_eq!(candidate(vec![1, 2, 3, 7]), false);\n assert_eq!(candidate(vec![1, 2, 5, 7]), false);\n assert_eq!(candidate(vec![2, 4, -5, 3, 9, 7]), true);\n assert_eq!(candidate(vec![1]), false);\n assert_eq!(candidate(vec![1, 3, 5, -100]), false);\n assert_eq!(candidate(vec![100, 3, 5, -100]), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "rs", - "prompt": "/// brackets is a string of \"<\" and \">\".\n/// return True if every opening bracket has a corresponding closing bracket.\nfn correct_bracketing(brackets: String) -> bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = correct_bracketing;\n assert_eq!(candidate(String::from(\"<>\")), true);\n assert_eq!(candidate(String::from(\"<<><>>\")), true);\n assert_eq!(candidate(String::from(\"<><><<><>><>\")), true);\n assert_eq!(candidate(String::from(\"<><><<<><><>><>><<><><<>>>\")), true);\n assert_eq!(candidate(String::from(\"<<<><>>>>\")), false);\n assert_eq!(candidate(String::from(\"><<>\")), false);\n assert_eq!(candidate(String::from(\"<\")), false);\n assert_eq!(candidate(String::from(\"<<<<\")), false);\n assert_eq!(candidate(String::from(\">\")), false);\n assert_eq!(candidate(String::from(\"<<>\")), false);\n assert_eq!(candidate(String::from(\"<><><<><>><>><<>\")), false);\n assert_eq!(candidate(String::from(\"<><><<><>><>>><>\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "rs", - "prompt": "/// Write a function that takes an array of numbers as input and returns \n/// the number of elements in the array that are greater than 10 and both \n/// first and last digits of a number are odd (1, 3, 5, 7, 9).\n/// For example:\nfn specialFilter(nums: Vec) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = specialFilter;\n assert_eq!(candidate(vec![5, -2, 1, -5]), 0);\n assert_eq!(candidate(vec![15, -73, 14, -15]), 1);\n assert_eq!(candidate(vec![33, -2, -3, 45, 21, 109]), 2);\n assert_eq!(candidate(vec![43, -12, 93, 125, 121, 109]), 4);\n assert_eq!(candidate(vec![71, -2, -33, 75, 21, 19]), 3);\n assert_eq!(candidate(vec![1]), 0);\n assert_eq!(candidate(Vec::::new()), 0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "rs", - "prompt": "use std::collections::HashMap;\n\n/// Given a dictionary, return True if all keys are strings in lower \n/// case or all keys are strings in upper case, else return False.\n/// The function should return False is the given dictionary is empty.\n/// Examples:\nfn check_dict_case(dict: HashMap) -> bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = check_dict_case;\n assert_eq!(candidate(HashMap::from([(String::from(\"p\"), String::from(\"pineapple\")), (String::from(\"b\"), String::from(\"banana\"))])), true);\n assert_eq!(candidate(HashMap::from([(String::from(\"p\"), String::from(\"pineapple\")), (String::from(\"A\"), String::from(\"banana\")), (String::from(\"B\"), String::from(\"banana\"))])), false);\n assert_eq!(candidate(HashMap::from([(String::from(\"p\"), String::from(\"pineapple\")), (String::from(\"5\"), String::from(\"banana\")), (String::from(\"a\"), String::from(\"apple\"))])), false);\n assert_eq!(candidate(HashMap::from([(String::from(\"Name\"), String::from(\"John\")), (String::from(\"Age\"), String::from(\"36\")), (String::from(\"City\"), String::from(\"Houston\"))])), false);\n assert_eq!(candidate(HashMap::from([(String::from(\"STATE\"), String::from(\"NC\")), (String::from(\"ZIP\"), String::from(\"12345\"))])), true);\n assert_eq!(candidate(HashMap::from([(String::from(\"fruit\"), String::from(\"Orange\")), (String::from(\"taste\"), String::from(\"Sweet\"))])), true);\n assert_eq!(candidate(HashMap::from([])), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "rs", - "prompt": "/// The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n/// fibfib(0) == 0\n/// fibfib(1) == 0\n/// fibfib(2) == 1\n/// fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n/// Please write a function to efficiently compute the n-th element of the fibfib number sequence.\nfn fibfib(n: isize) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = fibfib;\n assert_eq!(candidate(2), 1);\n assert_eq!(candidate(1), 0);\n assert_eq!(candidate(5), 4);\n assert_eq!(candidate(8), 24);\n assert_eq!(candidate(10), 81);\n assert_eq!(candidate(12), 274);\n assert_eq!(candidate(14), 927);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "rs", - "prompt": "/// You are given a list of numbers.\n/// You need to return the sum of squared numbers in the given list,\n/// round each element in the list to the upper int(Ceiling) first.\n/// Examples:\nfn sum_squares(lst: Vec) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = sum_squares;\n assert_eq!(candidate(vec![1.0, 2.0, 3.0]), 14);\n assert_eq!(candidate(vec![1.0, 2.0, 3.0]), 14);\n assert_eq!(candidate(vec![1.0, 3.0, 5.0, 7.0]), 84);\n assert_eq!(candidate(vec![1.4, 4.2, 0.0]), 29);\n assert_eq!(candidate(vec![-2.4, 1.0, 1.0]), 6);\n assert_eq!(candidate(vec![100.0, 1.0, 15.0, 2.0]), 10230);\n assert_eq!(candidate(vec![10000.0, 10000.0]), 200000000);\n assert_eq!(candidate(vec![-1.4, 4.6, 6.3]), 75);\n assert_eq!(candidate(vec![-1.4, 17.9, 18.9, 19.9]), 1086);\n assert_eq!(candidate(vec![0.0]), 0);\n assert_eq!(candidate(vec![-1.0]), 1);\n assert_eq!(candidate(vec![-1.0, 1.0, 0.0]), 2);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_85_add", - "language": "rs", - "prompt": "/// Given a non-empty list of integers lst. add the even elements that are at odd indices..\n/// Examples:\nfn add(lst: Vec) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = add;\n assert_eq!(candidate(vec![4, 88]), 88);\n assert_eq!(candidate(vec![4, 5, 6, 7, 2, 122]), 122);\n assert_eq!(candidate(vec![4, 0, 6, 7]), 0);\n assert_eq!(candidate(vec![4, 4, 6, 8]), 12);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "rs", - "prompt": "/// Return sorted unique elements in a list\nfn unique(l: Vec) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = unique;\n assert_eq!(candidate(vec![5, 3, 5, 2, 3, 3, 9, 0, 123]), vec![0, 2, 3, 5, 9, 123]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "rs", - "prompt": "/// Given a string text, replace all spaces in it with underscores, \n/// and if a string has more than 2 consecutive spaces, \n/// then replace all consecutive spaces with -\nfn fix_spaces(text: String) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = fix_spaces;\n assert_eq!(candidate(String::from(\"Example\")), String::from(\"Example\"));\n assert_eq!(candidate(String::from(\"Mudasir Hanif \")), String::from(\"Mudasir_Hanif_\"));\n assert_eq!(candidate(String::from(\"Yellow Yellow Dirty Fellow\")), String::from(\"Yellow_Yellow__Dirty__Fellow\"));\n assert_eq!(candidate(String::from(\"Exa mple\")), String::from(\"Exa-mple\"));\n assert_eq!(candidate(String::from(\" Exa 1 2 2 mple\")), String::from(\"-Exa_1_2_2_mple\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "rs", - "prompt": "/// Return 2^n modulo p (be aware of numerics).\nfn modp(n: isize, p: isize) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = modp;\n assert_eq!(candidate(3, 5), 3);\n assert_eq!(candidate(1101, 101), 2);\n assert_eq!(candidate(0, 101), 1);\n assert_eq!(candidate(3, 11), 8);\n assert_eq!(candidate(100, 101), 1);\n assert_eq!(candidate(30, 5), 4);\n assert_eq!(candidate(31, 5), 3);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "rs", - "prompt": "/// You have to write a function which validates a given date string and\n/// returns True if the date is valid otherwise False.\n/// The date is valid if all of the following rules are satisfied:\n/// 1. The date string is not empty.\n/// 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n/// 3. The months should not be less than 1 or higher than 12.\n/// 4. The date should be in the format: mm-dd-yyyy\nfn valid_date(date: String) -> bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = valid_date;\n assert_eq!(candidate(String::from(\"03-11-2000\")), true);\n assert_eq!(candidate(String::from(\"15-01-2012\")), false);\n assert_eq!(candidate(String::from(\"04-0-2040\")), false);\n assert_eq!(candidate(String::from(\"06-04-2020\")), true);\n assert_eq!(candidate(String::from(\"01-01-2007\")), true);\n assert_eq!(candidate(String::from(\"03-32-2011\")), false);\n assert_eq!(candidate(String::from(\"\")), false);\n assert_eq!(candidate(String::from(\"04-31-3000\")), false);\n assert_eq!(candidate(String::from(\"06-06-2005\")), true);\n assert_eq!(candidate(String::from(\"21-31-2000\")), false);\n assert_eq!(candidate(String::from(\"04-12-2003\")), true);\n assert_eq!(candidate(String::from(\"04122003\")), false);\n assert_eq!(candidate(String::from(\"20030412\")), false);\n assert_eq!(candidate(String::from(\"2003-04\")), false);\n assert_eq!(candidate(String::from(\"2003-04-12\")), false);\n assert_eq!(candidate(String::from(\"04-2003\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "rs", - "prompt": "/// Write a function that takes a string and returns an ordered version of it.\n/// Ordered version of string, is a string where all words (separated by space)\n/// are replaced by a new word where all the characters arranged in\n/// ascending order based on ascii value.\n/// Note: You should keep the order of words and blank spaces in the sentence.\n/// For example:\nfn anti_shuffle(s: String) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = anti_shuffle;\n assert_eq!(candidate(String::from(\"Hi\")), String::from(\"Hi\"));\n assert_eq!(candidate(String::from(\"hello\")), String::from(\"ehllo\"));\n assert_eq!(candidate(String::from(\"number\")), String::from(\"bemnru\"));\n assert_eq!(candidate(String::from(\"abcd\")), String::from(\"abcd\"));\n assert_eq!(candidate(String::from(\"Hello World!!!\")), String::from(\"Hello !!!Wdlor\"));\n assert_eq!(candidate(String::from(\"\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"Hi. My name is Mister Robot. How are you?\")), String::from(\".Hi My aemn is Meirst .Rboot How aer ?ouy\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "rs", - "prompt": "/// Given a list of numbers, return whether or not they are sorted\n/// in ascending order. If list has more than 1 duplicate of the same\n/// number, return False. Assume no negative numbers and only integers.\n/// Examples\nfn is_sorted(lst: Vec) -> bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = is_sorted;\n assert_eq!(candidate(vec![5]), true);\n assert_eq!(candidate(vec![1, 2, 3, 4, 5]), true);\n assert_eq!(candidate(vec![1, 3, 2, 4, 5]), false);\n assert_eq!(candidate(vec![1, 2, 3, 4, 5, 6]), true);\n assert_eq!(candidate(vec![1, 2, 3, 4, 5, 6, 7]), true);\n assert_eq!(candidate(vec![1, 3, 2, 4, 5, 6, 7]), false);\n assert_eq!(candidate(Vec::::new()), true);\n assert_eq!(candidate(vec![1]), true);\n assert_eq!(candidate(vec![3, 2, 1]), false);\n assert_eq!(candidate(vec![1, 2, 2, 2, 3, 4]), false);\n assert_eq!(candidate(vec![1, 2, 3, 3, 3, 4]), false);\n assert_eq!(candidate(vec![1, 2, 2, 3, 3, 4]), true);\n assert_eq!(candidate(vec![1, 2, 3, 4]), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "rs", - "prompt": "/// You are given a string s.\n/// Your task is to check if the string is happy or not.\n/// A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n/// For example:\nfn is_happy(s: String) -> bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = is_happy;\n assert_eq!(candidate(String::from(\"a\")), false);\n assert_eq!(candidate(String::from(\"aa\")), false);\n assert_eq!(candidate(String::from(\"abcd\")), true);\n assert_eq!(candidate(String::from(\"aabb\")), false);\n assert_eq!(candidate(String::from(\"adb\")), true);\n assert_eq!(candidate(String::from(\"xyy\")), false);\n assert_eq!(candidate(String::from(\"iopaxpoi\")), true);\n assert_eq!(candidate(String::from(\"iopaxioi\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "rs", - "prompt": "/// Write a function that returns True if the object q will fly, and False otherwise.\n/// The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n/// Example:\n/// # 1+2 is less than the maximum possible weight, but it's unbalanced.\n/// # it's balanced, but 3+2+3 is more than the maximum possible weight.\n/// # 3+2+3 is less than the maximum possible weight, and it's balanced.\n/// # 3 is less than the maximum possible weight, and it's balanced.\nfn will_it_fly(q: Vec, w: isize) -> bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = will_it_fly;\n assert_eq!(candidate(vec![3, 2, 3], 9), true);\n assert_eq!(candidate(vec![1, 2], 5), false);\n assert_eq!(candidate(vec![3], 5), true);\n assert_eq!(candidate(vec![3, 2, 3], 1), false);\n assert_eq!(candidate(vec![1, 2, 3], 6), false);\n assert_eq!(candidate(vec![5], 5), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "rs", - "prompt": "/// Given an array of non-negative integers, return a copy of the given array after sorting,\n/// you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n/// or sort it in descending order if the sum( first index value, last index value) is even.\n/// Note:\n/// * don't change the given array.\n/// Examples:\nfn sort_array(array: Vec) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = sort_array;\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![5]), vec![5]);\n assert_eq!(candidate(vec![2, 4, 3, 0, 1, 5]), vec![0, 1, 2, 3, 4, 5]);\n assert_eq!(candidate(vec![2, 4, 3, 0, 1, 5, 6]), vec![6, 5, 4, 3, 2, 1, 0]);\n assert_eq!(candidate(vec![2, 1]), vec![1, 2]);\n assert_eq!(candidate(vec![15, 42, 87, 32, 11, 0]), vec![0, 11, 15, 32, 42, 87]);\n assert_eq!(candidate(vec![21, 14, 23, 11]), vec![23, 21, 14, 11]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "rs", - "prompt": "/// Implement a function that takes an non-negative integer and returns an array of the first n\n/// integers that are prime numbers and less than n.\n/// for example:\nfn count_up_to(n: isize) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = count_up_to;\n assert_eq!(candidate(5), vec![2, 3]);\n assert_eq!(candidate(6), vec![2, 3, 5]);\n assert_eq!(candidate(7), vec![2, 3, 5]);\n assert_eq!(candidate(10), vec![2, 3, 5, 7]);\n assert_eq!(candidate(0), Vec::::new());\n assert_eq!(candidate(22), vec![2, 3, 5, 7, 11, 13, 17, 19]);\n assert_eq!(candidate(1), Vec::::new());\n assert_eq!(candidate(18), vec![2, 3, 5, 7, 11, 13, 17]);\n assert_eq!(candidate(47), vec![2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43]);\n assert_eq!(candidate(101), vec![2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "rs", - "prompt": "/// Out of list of strings, return the longest one. Return the first one in case of multiple\n/// strings of the same length. Return None in case the input list is empty.\nfn longest(strings: Vec) -> Option {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = longest;\n assert_eq!(candidate(Vec::::new()), None);\n assert_eq!(candidate(vec![String::from(\"x\"), String::from(\"y\"), String::from(\"z\")]), Some(String::from(\"x\")));\n assert_eq!(candidate(vec![String::from(\"x\"), String::from(\"yyy\"), String::from(\"zzzz\"), String::from(\"www\"), String::from(\"kkkk\"), String::from(\"abc\")]), Some(String::from(\"zzzz\")));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "rs", - "prompt": "/// Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n/// reverse the resulting array, and then replace each digit by its corresponding name from\n/// \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n/// For example:\n/// If the array is empty, return an empty array:\n/// If the array has any strange number ignore it:\nfn by_length(arr: Vec) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = by_length;\n assert_eq!(candidate(vec![2, 1, 1, 4, 5, 8, 2, 3]), vec![String::from(\"Eight\"), String::from(\"Five\"), String::from(\"Four\"), String::from(\"Three\"), String::from(\"Two\"), String::from(\"Two\"), String::from(\"One\"), String::from(\"One\")]);\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![1, -1, 55]), vec![String::from(\"One\")]);\n assert_eq!(candidate(vec![1, -1, 3, 2]), vec![String::from(\"Three\"), String::from(\"Two\"), String::from(\"One\")]);\n assert_eq!(candidate(vec![9, 4, 8]), vec![String::from(\"Nine\"), String::from(\"Eight\"), String::from(\"Four\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_106_f", - "language": "rs", - "prompt": "/// Implement the function f that takes n as a parameter,\n/// 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\n/// or the sum of numbers from 1 to i otherwise.\n/// i starts from 1.\n/// the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n/// Example:\nfn f(n: isize) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = f;\n assert_eq!(candidate(5), vec![1, 2, 6, 24, 15]);\n assert_eq!(candidate(7), vec![1, 2, 6, 24, 15, 720, 28]);\n assert_eq!(candidate(1), vec![1]);\n assert_eq!(candidate(3), vec![1, 2, 6]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "rs", - "prompt": "/// Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\nfn fizz_buzz(n: isize) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = fizz_buzz;\n assert_eq!(candidate(50), 0);\n assert_eq!(candidate(78), 2);\n assert_eq!(candidate(79), 3);\n assert_eq!(candidate(100), 3);\n assert_eq!(candidate(200), 6);\n assert_eq!(candidate(4000), 192);\n assert_eq!(candidate(10000), 639);\n assert_eq!(candidate(100000), 8026);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "rs", - "prompt": "/// Given a positive floating point number, it can be decomposed into\n/// and integer part (largest integer smaller than given number) and decimals\n/// (leftover part always smaller than 1).\n/// Return the decimal part of the number.\nfn truncate_number(number: f64) -> f64 {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = truncate_number;\n assert_eq!(candidate(3.5), 0.5);\n assert_eq!(candidate(1.25), 0.25);\n assert_eq!(candidate(123.0), 0.0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "rs", - "prompt": "/// For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n/// Empty sum should be equal to 0 and empty product should be equal to 1.\nfn sum_product(numbers: Vec) -> (isize, isize) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = sum_product;\n assert_eq!(candidate(Vec::::new()), (0, 1));\n assert_eq!(candidate(vec![1, 1, 1]), (3, 1));\n assert_eq!(candidate(vec![100, 0]), (100, 0));\n assert_eq!(candidate(vec![3, 5, 7]), (15, 105));\n assert_eq!(candidate(vec![10]), (10, 10));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "rs", - "prompt": "/// You are given a 2 dimensional data, as a nested lists,\n/// which is similar to matrix, however, unlike matrices,\n/// each row may contain a different number of columns.\n/// Given lst, and integer x, find integers x in the list,\n/// and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n/// each tuple is a coordinate - (row, columns), starting with 0.\n/// Sort coordinates initially by rows in ascending order.\n/// Also, sort coordinates of the row by columns in descending order.\n/// Examples:\nfn get_row(lst: Vec>, x: isize) -> Vec<(isize, isize)> {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = get_row;\n assert_eq!(candidate(vec![vec![1, 2, 3, 4, 5, 6], vec![1, 2, 3, 4, 1, 6], vec![1, 2, 3, 4, 5, 1]], 1), vec![(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]);\n assert_eq!(candidate(vec![vec![1, 2, 3, 4, 5, 6], vec![1, 2, 3, 4, 5, 6], vec![1, 2, 3, 4, 5, 6], vec![1, 2, 3, 4, 5, 6], vec![1, 2, 3, 4, 5, 6], vec![1, 2, 3, 4, 5, 6]], 2), vec![(0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1)]);\n assert_eq!(candidate(vec![vec![1, 2, 3, 4, 5, 6], vec![1, 2, 3, 4, 5, 6], vec![1, 1, 3, 4, 5, 6], vec![1, 2, 1, 4, 5, 6], vec![1, 2, 3, 1, 5, 6], vec![1, 2, 3, 4, 1, 6], vec![1, 2, 3, 4, 5, 1]], 1), vec![(0, 0), (1, 0), (2, 1), (2, 0), (3, 2), (3, 0), (4, 3), (4, 0), (5, 4), (5, 0), (6, 5), (6, 0)]);\n assert_eq!(candidate(Vec::>::new(), 1), Vec::<(isize, isize)>::new());\n assert_eq!(candidate(vec![vec![1]], 2), Vec::<(isize, isize)>::new());\n assert_eq!(candidate(vec![vec![], vec![1], vec![1, 2, 3]], 3), vec![(2, 2)]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "rs", - "prompt": "/// You're a hungry rabbit, and you already have eaten a certain number of carrots,\n/// but now you need to eat more carrots to complete the day's meals.\n/// you should return an array of [ total number of eaten carrots after your meals,\n/// the number of carrots left after your meals ]\n/// if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n/// Example:\n/// Variables:\n/// @number : integer\n/// the number of carrots that you have eaten.\n/// @need : integer\n/// the number of carrots that you need to eat.\n/// @remaining : integer\n/// the number of remaining carrots thet exist in stock\n/// Constrain:\n/// * 0 <= number <= 1000\n/// * 0 <= need <= 1000\n/// * 0 <= remaining <= 1000\n/// Have fun :)\nfn eat(number: isize, need: isize, remaining: isize) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = eat;\n assert_eq!(candidate(5, 6, 10), vec![11, 4]);\n assert_eq!(candidate(4, 8, 9), vec![12, 1]);\n assert_eq!(candidate(1, 10, 10), vec![11, 0]);\n assert_eq!(candidate(2, 11, 5), vec![7, 0]);\n assert_eq!(candidate(4, 5, 7), vec![9, 2]);\n assert_eq!(candidate(4, 5, 1), vec![5, 0]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "rs", - "prompt": "/// Given a positive integer N, return the total sum of its digits in binary.\n/// Example\n/// Variables:\n/// @N integer\n/// Constraints: 0 \u2264 N \u2264 10000.\n/// Output:\n/// a string of binary number\nfn solve(N: isize) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = solve;\n assert_eq!(candidate(1000), String::from(\"1\"));\n assert_eq!(candidate(150), String::from(\"110\"));\n assert_eq!(candidate(147), String::from(\"1100\"));\n assert_eq!(candidate(333), String::from(\"1001\"));\n assert_eq!(candidate(963), String::from(\"10010\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "rs", - "prompt": "/// You are given a list of integers.\n/// You need to find the largest prime value and return the sum of its digits.\n/// Examples:\nfn skjkasdkd(lst: Vec) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = skjkasdkd;\n assert_eq!(candidate(vec![0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]), 10);\n assert_eq!(candidate(vec![1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]), 25);\n assert_eq!(candidate(vec![1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]), 13);\n assert_eq!(candidate(vec![0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]), 11);\n assert_eq!(candidate(vec![0, 81, 12, 3, 1, 21]), 3);\n assert_eq!(candidate(vec![0, 8, 1, 2, 1, 7]), 7);\n assert_eq!(candidate(vec![8191]), 19);\n assert_eq!(candidate(vec![8191, 123456, 127, 7]), 19);\n assert_eq!(candidate(vec![127, 97, 8192]), 10);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "rs", - "prompt": "/// Given an array arr of integers, find the minimum number of elements that\n/// need to be changed to make the array palindromic. A palindromic array is an array that\n/// is read the same backwards and forwards. In one change, you can change one element to any other element.\n/// For example:\nfn smallest_change(arr: Vec) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = smallest_change;\n assert_eq!(candidate(vec![1, 2, 3, 5, 4, 7, 9, 6]), 4);\n assert_eq!(candidate(vec![1, 2, 3, 4, 3, 2, 2]), 1);\n assert_eq!(candidate(vec![1, 4, 2]), 1);\n assert_eq!(candidate(vec![1, 4, 4, 2]), 1);\n assert_eq!(candidate(vec![1, 2, 3, 2, 1]), 0);\n assert_eq!(candidate(vec![3, 1, 1, 3]), 0);\n assert_eq!(candidate(vec![1]), 0);\n assert_eq!(candidate(vec![0, 1]), 1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "rs", - "prompt": "/// It is the last week of the semester and the teacher has to give the grades\n/// to students. The teacher has been making her own algorithm for grading.\n/// The only problem is, she has lost the code she used for grading.\n/// She has given you a list of GPAs for some students and you have to write \n/// a function that can output a list of letter grades using the following table:\n/// GPA | Letter grade\n/// 4.0 A+\n/// > 3.7 A \n/// > 3.3 A- \n/// > 3.0 B+\n/// > 2.7 B \n/// > 2.3 B-\n/// > 2.0 C+\n/// > 1.7 C\n/// > 1.3 C-\n/// > 1.0 D+ \n/// > 0.7 D \n/// > 0.0 D-\n/// 0.0 E\n/// Example:\nfn numerical_letter_grade(grades: Vec) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = numerical_letter_grade;\n assert_eq!(candidate(vec![4.0, 3.0, 1.7, 2.0, 3.5]), vec![String::from(\"A+\"), String::from(\"B\"), String::from(\"C-\"), String::from(\"C\"), String::from(\"A-\")]);\n assert_eq!(candidate(vec![1.2]), vec![String::from(\"D+\")]);\n assert_eq!(candidate(vec![0.5]), vec![String::from(\"D-\")]);\n assert_eq!(candidate(vec![0.0]), vec![String::from(\"E\")]);\n assert_eq!(candidate(vec![1.0, 0.3, 1.5, 2.8, 3.3]), vec![String::from(\"D\"), String::from(\"D-\"), String::from(\"C-\"), String::from(\"B\"), String::from(\"B+\")]);\n assert_eq!(candidate(vec![0.0, 0.7]), vec![String::from(\"E\"), String::from(\"D-\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "rs", - "prompt": "/// Given the lengths of the three sides of a triangle. Return the area of\n/// the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n/// Otherwise return -1\n/// Three sides make a valid triangle when the sum of any two sides is greater \n/// than the third side.\n/// Example:\nfn triangle_area(a: isize, b: isize, c: isize) -> f64 {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = triangle_area;\n assert_eq!(candidate(3, 4, 5), 6.0);\n assert_eq!(candidate(1, 2, 10), -1.0);\n assert_eq!(candidate(4, 8, 5), 8.18);\n assert_eq!(candidate(2, 2, 2), 1.73);\n assert_eq!(candidate(1, 2, 3), -1.0);\n assert_eq!(candidate(10, 5, 7), 16.25);\n assert_eq!(candidate(2, 6, 3), -1.0);\n assert_eq!(candidate(1, 1, 1), 0.43);\n assert_eq!(candidate(2, 2, 10), -1.0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "rs", - "prompt": "/// Check if two words have the same characters.\nfn same_chars(s0: String, s1: String) -> bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = same_chars;\n assert_eq!(candidate(String::from(\"eabcdzzzz\"), String::from(\"dddzzzzzzzddeddabc\")), true);\n assert_eq!(candidate(String::from(\"abcd\"), String::from(\"dddddddabc\")), true);\n assert_eq!(candidate(String::from(\"dddddddabc\"), String::from(\"abcd\")), true);\n assert_eq!(candidate(String::from(\"eabcd\"), String::from(\"dddddddabc\")), false);\n assert_eq!(candidate(String::from(\"abcd\"), String::from(\"dddddddabcf\")), false);\n assert_eq!(candidate(String::from(\"eabcdzzzz\"), String::from(\"dddzzzzzzzddddabc\")), false);\n assert_eq!(candidate(String::from(\"aabb\"), String::from(\"aaccc\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "rs", - "prompt": "/// Given an array of integers nums, find the minimum sum of any non-empty sub-array\n/// of nums.\n/// Example\nfn minSubArraySum(nums: Vec) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = minSubArraySum;\n assert_eq!(candidate(vec![2, 3, 4, 1, 2, 4]), 1);\n assert_eq!(candidate(vec![-1, -2, -3]), -6);\n assert_eq!(candidate(vec![-1, -2, -3, 2, -10]), -14);\n assert_eq!(candidate(vec![-9999999999999999]), -9999999999999999);\n assert_eq!(candidate(vec![0, 10, 20, 1000000]), 0);\n assert_eq!(candidate(vec![-1, -2, -3, 10, -5]), -6);\n assert_eq!(candidate(vec![100, -1, -2, -3, 10, -5]), -6);\n assert_eq!(candidate(vec![10, 11, 13, 8, 3, 4]), 3);\n assert_eq!(candidate(vec![100, -33, 32, -1, 0, -2]), -33);\n assert_eq!(candidate(vec![-10]), -10);\n assert_eq!(candidate(vec![7]), 7);\n assert_eq!(candidate(vec![1, -1]), -1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "rs", - "prompt": "/// Given a string s and a natural number n, you have been tasked to implement \n/// a function that returns a list of all words from string s that contain exactly \n/// n consonants, in order these words appear in the string s.\n/// If the string s is empty then the function should return an empty list.\n/// Note: you may assume the input string contains only letters and spaces.\n/// Examples:\nfn select_words(s: String, n: isize) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = select_words;\n assert_eq!(candidate(String::from(\"Mary had a little lamb\"), 4), vec![String::from(\"little\")]);\n assert_eq!(candidate(String::from(\"Mary had a little lamb\"), 3), vec![String::from(\"Mary\"), String::from(\"lamb\")]);\n assert_eq!(candidate(String::from(\"simple white space\"), 2), Vec::::new());\n assert_eq!(candidate(String::from(\"Hello world\"), 4), vec![String::from(\"world\")]);\n assert_eq!(candidate(String::from(\"Uncle sam\"), 3), vec![String::from(\"Uncle\")]);\n assert_eq!(candidate(String::from(\"\"), 4), Vec::::new());\n assert_eq!(candidate(String::from(\"a b c d e f\"), 1), vec![String::from(\"b\"), String::from(\"c\"), String::from(\"d\"), String::from(\"f\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "rs", - "prompt": "/// Return list of all prefixes from shortest to longest of the input string\nfn all_prefixes(string: String) -> Vec {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = all_prefixes;\n assert_eq!(candidate(String::from(\"\")), Vec::::new());\n assert_eq!(candidate(String::from(\"asdfgh\")), vec![String::from(\"a\"), String::from(\"as\"), String::from(\"asd\"), String::from(\"asdf\"), String::from(\"asdfg\"), String::from(\"asdfgh\")]);\n assert_eq!(candidate(String::from(\"WWW\")), vec![String::from(\"W\"), String::from(\"WW\"), String::from(\"WWW\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "rs", - "prompt": "/// Create a function that takes a value (string) representing a number\n/// and returns the closest integer to it. If the number is equidistant\n/// from two integers, round it away from zero.\n/// Examples\n/// Note:\n/// Rounding away from zero means that if the given number is equidistant\n/// from two integers, the one you should return is the one that is the\n/// farthest from zero. For example closest_integer(\"14.5\") should\n/// return 15 and closest_integer(\"-14.5\") should return -15.\nfn closest_integer(value: String) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = closest_integer;\n assert_eq!(candidate(String::from(\"10\")), 10);\n assert_eq!(candidate(String::from(\"14.5\")), 15);\n assert_eq!(candidate(String::from(\"-15.5\")), -16);\n assert_eq!(candidate(String::from(\"15.3\")), 15);\n assert_eq!(candidate(String::from(\"0\")), 0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "rs", - "prompt": "/// Create a function which takes a string representing a file's name, and returns\n/// 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n/// A file's name is considered to be valid if and only if all the following conditions \n/// are met:\n/// - There should not be more than three digits ('0'-'9') in the file's name.\n/// - The file's name contains exactly one dot '.'\n/// - The substring before the dot should not be empty, and it starts with a letter from \n/// the latin alphapet ('a'-'z' and 'A'-'Z').\n/// - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n/// Examples:\nfn file_name_check(file_name: String) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = file_name_check;\n assert_eq!(candidate(String::from(\"example.txt\")), String::from(\"Yes\"));\n assert_eq!(candidate(String::from(\"1example.dll\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"s1sdf3.asd\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"K.dll\")), String::from(\"Yes\"));\n assert_eq!(candidate(String::from(\"MY16FILE3.exe\")), String::from(\"Yes\"));\n assert_eq!(candidate(String::from(\"His12FILE94.exe\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"_Y.txt\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"?aREYA.exe\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"/this_is_valid.dll\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"this_is_valid.wow\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"this_is_valid.txt\")), String::from(\"Yes\"));\n assert_eq!(candidate(String::from(\"this_is_valid.txtexe\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"#this2_i4s_5valid.ten\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"@this1_is6_valid.exe\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"this_is_12valid.6exe4.txt\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"all.exe.txt\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"I563_No.exe\")), String::from(\"Yes\"));\n assert_eq!(candidate(String::from(\"Is3youfault.txt\")), String::from(\"Yes\"));\n assert_eq!(candidate(String::from(\"no_one#knows.dll\")), String::from(\"Yes\"));\n assert_eq!(candidate(String::from(\"1I563_Yes3.exe\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"I563_Yes3.txtt\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"final..txt\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"final132\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"_f4indsartal132.\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\".txt\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"s.\")), String::from(\"No\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "rs", - "prompt": "/// You are given two intervals,\n/// where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n/// The given intervals are closed which means that the interval (start, end)\n/// includes both start and end.\n/// For each given interval, it is assumed that its start is less or equal its end.\n/// Your task is to determine whether the length of intersection of these two \n/// intervals is a prime number.\n/// Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n/// which its length is 1, which not a prime number.\n/// If the length of the intersection is a prime number, return \"YES\",\n/// otherwise, return \"NO\".\n/// If the two intervals don't intersect, return \"NO\".\n/// [input/output] samples:\nfn intersection(interval1: (isize, isize), interval2: (isize, isize)) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = intersection;\n assert_eq!(candidate((1, 2), (2, 3)), String::from(\"NO\"));\n assert_eq!(candidate((-1, 1), (0, 4)), String::from(\"NO\"));\n assert_eq!(candidate((-3, -1), (-5, 5)), String::from(\"YES\"));\n assert_eq!(candidate((-2, 2), (-4, 0)), String::from(\"YES\"));\n assert_eq!(candidate((-11, 2), (-1, -1)), String::from(\"NO\"));\n assert_eq!(candidate((1, 2), (3, 5)), String::from(\"NO\"));\n assert_eq!(candidate((1, 2), (1, 2)), String::from(\"NO\"));\n assert_eq!(candidate((-2, -2), (-3, -2)), String::from(\"NO\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "rs", - "prompt": "/// Return the largest prime factor of n. Assume n > 1 and is not a prime.\nfn largest_prime_factor(n: isize) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = largest_prime_factor;\n assert_eq!(candidate(15), 5);\n assert_eq!(candidate(27), 3);\n assert_eq!(candidate(63), 7);\n assert_eq!(candidate(330), 11);\n assert_eq!(candidate(13195), 29);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "rs", - "prompt": "/// Given a string, find out how many distinct characters (regardless of case) does it consist of\nfn count_distinct_characters(string: String) -> isize {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = count_distinct_characters;\n assert_eq!(candidate(String::from(\"\")), 0);\n assert_eq!(candidate(String::from(\"abcde\")), 5);\n assert_eq!(candidate(String::from(\"abcdecadeCADE\")), 5);\n assert_eq!(candidate(String::from(\"aaaaAAAAaaaa\")), 1);\n assert_eq!(candidate(String::from(\"Jerry jERRY JeRRRY\")), 5);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "rs", - "prompt": "/// You're given a list of deposit and withdrawal operations on a bank account that starts with\n/// zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n/// at that point function should return True. Otherwise it should return False.\nfn below_zero(operations: Vec) -> bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = below_zero;\n assert_eq!(candidate(Vec::::new()), false);\n assert_eq!(candidate(vec![1, 2, -3, 1, 2, -3]), false);\n assert_eq!(candidate(vec![1, 2, -4, 5, 6]), true);\n assert_eq!(candidate(vec![1, -1, 2, -2, 5, -5, 4, -4]), false);\n assert_eq!(candidate(vec![1, -1, 2, -2, 5, -5, 4, -5]), true);\n assert_eq!(candidate(vec![1, -2, 2, -2, 5, -5, 4, -4]), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "rs", - "prompt": "/// Find the shortest palindrome that begins with a supplied string.\n/// Algorithm idea is simple:\n/// - Find the longest postfix of supplied string that is a palindrome.\n/// - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\nfn make_palindrome(string: String) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = make_palindrome;\n assert_eq!(candidate(String::from(\"\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"x\")), String::from(\"x\"));\n assert_eq!(candidate(String::from(\"xyz\")), String::from(\"xyzyx\"));\n assert_eq!(candidate(String::from(\"xyx\")), String::from(\"xyx\"));\n assert_eq!(candidate(String::from(\"jerry\")), String::from(\"jerryrrej\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "rs", - "prompt": "/// Given a positive integer, obtain its roman numeral equivalent as a string,\n/// and return it in lowercase.\n/// Restrictions: 1 <= num <= 1000\n/// Examples:\nfn int_to_mini_roman(number: isize) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = int_to_mini_roman;\n assert_eq!(candidate(19), String::from(\"xix\"));\n assert_eq!(candidate(152), String::from(\"clii\"));\n assert_eq!(candidate(251), String::from(\"ccli\"));\n assert_eq!(candidate(426), String::from(\"cdxxvi\"));\n assert_eq!(candidate(500), String::from(\"d\"));\n assert_eq!(candidate(1), String::from(\"i\"));\n assert_eq!(candidate(4), String::from(\"iv\"));\n assert_eq!(candidate(43), String::from(\"xliii\"));\n assert_eq!(candidate(90), String::from(\"xc\"));\n assert_eq!(candidate(94), String::from(\"xciv\"));\n assert_eq!(candidate(532), String::from(\"dxxxii\"));\n assert_eq!(candidate(900), String::from(\"cm\"));\n assert_eq!(candidate(994), String::from(\"cmxciv\"));\n assert_eq!(candidate(1000), String::from(\"m\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - } -] \ No newline at end of file diff --git a/data/rs-reworded.json b/data/rs-reworded.json deleted file mode 100644 index 132260c3e64bc4f25d07d0e4c6556415fe3ec75c..0000000000000000000000000000000000000000 --- a/data/rs-reworded.json +++ /dev/null @@ -1,1874 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "rs", - "prompt": "/// For a given number n, find the largest number that divides n evenly, smaller than n\n/// >>> largest_divisor(15)\n/// 5\nfn largest_divisor(n: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = largest_divisor;\n assert_eq!(candidate(3), 1);\n assert_eq!(candidate(7), 1);\n assert_eq!(candidate(10), 5);\n assert_eq!(candidate(100), 50);\n assert_eq!(candidate(49), 7);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_47_median", - "language": "rs", - "prompt": "/// Return median of elements in the vector l.\n/// >>> median(vec![3, 1, 2, 4, 5])\n/// 3.0\n/// >>> median(vec![-10, 4, 6, 1000, 10, 20])\n/// 15.0\nfn median(l: Vec) -> f64 {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = median;\n assert_eq!(candidate(vec![3, 1, 2, 4, 5]), 3.0);\n assert_eq!(candidate(vec![-10, 4, 6, 1000, 10, 20]), 8.0);\n assert_eq!(candidate(vec![5]), 5.0);\n assert_eq!(candidate(vec![6, 5]), 5.5);\n assert_eq!(candidate(vec![8, 1, 3, 9, 9, 2, 7]), 7.0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "rs", - "prompt": "/// Given two vectors operator, and operand. The first vector has basic algebra operations, and \n/// the second vector is a vector of integers. Use the two given vectors to build the algebric \n/// expression and return the evaluation of this expression.\n/// The basic algebra operations:\n/// Addition ( + ) \n/// Subtraction ( - ) \n/// Multiplication ( * ) \n/// Floor division ( // ) \n/// Exponentiation ( ** ) \n/// Example:\n/// operator['+', '*', '-']\n/// vector = [2, 3, 4, 5]\n/// result = 2 + 3 * 4 - 5\n/// => result = 9\n/// Note:\n/// The length of operator vector is equal to the length of operand vector minus one.\n/// Operand is a vector of of non-negative integers.\n/// Operator vector has at least one operator, and operand vector has at least two operands.\nfn do_algebra(operator: Vec, operand: Vec) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = do_algebra;\n assert_eq!(candidate(vec![String::from(\"**\"), String::from(\"*\"), String::from(\"+\")], vec![2, 3, 4, 5]), 37);\n assert_eq!(candidate(vec![String::from(\"+\"), String::from(\"*\"), String::from(\"-\")], vec![2, 3, 4, 5]), 9);\n assert_eq!(candidate(vec![String::from(\"//\"), String::from(\"*\")], vec![7, 3, 4]), 8);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "rs", - "prompt": "/// Return maximum element in the vector.\n/// >>> max_element(vec![1, 2, 3])\n/// 3\n/// >>> max_element(vec![5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n/// 123\nfn max_element(l: Vec) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = max_element;\n assert_eq!(candidate(vec![1, 2, 3]), 3);\n assert_eq!(candidate(vec![5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]), 124);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "rs", - "prompt": "/// Create a function which returns the largest index of an element which\n/// is not greater than or equal to the element immediately preceding it. If\n/// no such element exists then return -1. The given vector will not contain\n/// duplicate values.\n/// Examples:\n/// >>> can_arrange(vec![1, 2, 4, 3, 5])\n/// 3\n/// >>> can_arrange(vec![1, 2, 3])\n/// -1\nfn can_arrange(arr: Vec) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = can_arrange;\n assert_eq!(candidate(vec![1, 2, 4, 3, 5]), 3);\n assert_eq!(candidate(vec![1, 2, 4, 5]), -1);\n assert_eq!(candidate(vec![1, 4, 2, 5, 6, 7, 8, 9, 10]), 2);\n assert_eq!(candidate(vec![4, 8, 5, 7, 3]), 4);\n assert_eq!(candidate(Vec::::new()), -1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "rs", - "prompt": "/// Imagine a road that's a perfectly straight infinitely long line.\n/// n cars are driving left to right; simultaneously, a different set of n cars\n/// are driving right to left. The two sets of cars start out being very far from\n/// each other. All cars move in the same speed. Two cars are said to collide\n/// when a car that's moving left to right hits a car that's moving right to left.\n/// However, the cars are infinitely sturdy and strong; as a result, they continue moving\n/// in their trajectory as if they did not collide.\n/// This function outputs the number of such collisions.\nfn car_race_collision(n: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = car_race_collision;\n assert_eq!(candidate(2), 4);\n assert_eq!(candidate(3), 9);\n assert_eq!(candidate(4), 16);\n assert_eq!(candidate(8), 64);\n assert_eq!(candidate(10), 100);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "rs", - "prompt": "/// Create a function that returns true if the last character\n/// of a given string is an alphabetical character and is not\n/// a part of a word, and false otherwise.\n/// Note: \"word\" is a group of characters separated by space.\n/// Examples:\n/// >>> check_if_last_char_is_a_letter(String::from(\"apple pie\"))\n/// false\n/// >>> check_if_last_char_is_a_letter(String::from(\"apple pi e\"))\n/// true\n/// >>> check_if_last_char_is_a_letter(String::from(\"apple pi e \"))\n/// false\n/// >>> check_if_last_char_is_a_letter(String::from(\"\"))\n/// false\nfn check_if_last_char_is_a_letter(txt: String) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = check_if_last_char_is_a_letter;\n assert_eq!(candidate(String::from(\"apple\")), false);\n assert_eq!(candidate(String::from(\"apple pi e\")), true);\n assert_eq!(candidate(String::from(\"eeeee\")), false);\n assert_eq!(candidate(String::from(\"A\")), true);\n assert_eq!(candidate(String::from(\"Pumpkin pie \")), false);\n assert_eq!(candidate(String::from(\"Pumpkin pie 1\")), false);\n assert_eq!(candidate(String::from(\"\")), false);\n assert_eq!(candidate(String::from(\"eeeee e \")), false);\n assert_eq!(candidate(String::from(\"apple pie\")), false);\n assert_eq!(candidate(String::from(\"apple pi e \")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "rs", - "prompt": "/// Return true if a given number is prime, and false otherwise.\n/// >>> is_prime(6)\n/// false\n/// >>> is_prime(101)\n/// true\n/// >>> is_prime(11)\n/// true\n/// >>> is_prime(13441)\n/// true\n/// >>> is_prime(61)\n/// true\n/// >>> is_prime(4)\n/// false\n/// >>> is_prime(1)\n/// false\nfn is_prime(n: isize) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = is_prime;\n assert_eq!(candidate(6), false);\n assert_eq!(candidate(101), true);\n assert_eq!(candidate(11), true);\n assert_eq!(candidate(13441), true);\n assert_eq!(candidate(61), true);\n assert_eq!(candidate(4), false);\n assert_eq!(candidate(1), false);\n assert_eq!(candidate(5), true);\n assert_eq!(candidate(11), true);\n assert_eq!(candidate(17), true);\n assert_eq!(candidate(85), false);\n assert_eq!(candidate(77), false);\n assert_eq!(candidate(255379), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "rs", - "prompt": "/// Given a vector of positive integers x. return a sorted vector of all \n/// elements that hasn't any even digit.\n/// Note: Returned vector should be sorted in increasing order.\n/// For example:\n/// >>> unique_digits(vec![15, 33, 1422, 1])\n/// vec![1, 15, 33]\n/// >>> unique_digits(vec![152, 323, 1422, 10])\n/// Vec::::new()\nfn unique_digits(x: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = unique_digits;\n assert_eq!(candidate(vec![15, 33, 1422, 1]), vec![1, 15, 33]);\n assert_eq!(candidate(vec![152, 323, 1422, 10]), Vec::::new());\n assert_eq!(candidate(vec![12345, 2033, 111, 151]), vec![111, 151]);\n assert_eq!(candidate(vec![135, 103, 31]), vec![31, 135]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "rs", - "prompt": "/// Input are two strings a and b consisting only of 1s and 0s.\n/// Perform binary XOR on these inputs and return result also as a string.\n/// >>> string_xor(String::from(\"010\"), String::from(\"110\"))\n/// String::from(\"100\")\nfn string_xor(a: String, b: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = string_xor;\n assert_eq!(candidate(String::from(\"111000\"), String::from(\"101010\")), String::from(\"010010\"));\n assert_eq!(candidate(String::from(\"1\"), String::from(\"1\")), String::from(\"0\"));\n assert_eq!(candidate(String::from(\"0101\"), String::from(\"0000\")), String::from(\"0101\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "rs", - "prompt": "/// sum_to_n is a function that sums numbers from 1 to n.\n/// >>> sum_to_n(30)\n/// 465\n/// >>> sum_to_n(100)\n/// 5050\n/// >>> sum_to_n(5)\n/// 15\n/// >>> sum_to_n(10)\n/// 55\n/// >>> sum_to_n(1)\n/// 1\nfn sum_to_n(n: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = sum_to_n;\n assert_eq!(candidate(1), 1);\n assert_eq!(candidate(6), 21);\n assert_eq!(candidate(11), 66);\n assert_eq!(candidate(30), 465);\n assert_eq!(candidate(100), 5050);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "rs", - "prompt": "/// Given a vector of numbers, return the sum of squares of the numbers\n/// in the vector that are odd. Ignore numbers that are negative or not integers.\n/// >>> double_the_difference(vec![1, 3, 2, 0])\n/// 10\n/// >>> double_the_difference(vec![-1, -2, 0])\n/// 0\n/// >>> double_the_difference(vec![9, -2])\n/// 81\n/// >>> double_the_difference(vec![0])\n/// 0\n/// If the input vector is empty, return 0.\nfn double_the_difference(lst: Vec) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = double_the_difference;\n assert_eq!(candidate(Vec::::new()), 0);\n assert_eq!(candidate(vec![5.0, 4.0]), 25);\n assert_eq!(candidate(vec![0.1, 0.2, 0.3]), 0);\n assert_eq!(candidate(vec![-10.0, -20.0, -30.0]), 0);\n assert_eq!(candidate(vec![-1.0, -2.0, 8.0]), 0);\n assert_eq!(candidate(vec![0.2, 3.0, 5.0]), 34);\n assert_eq!(candidate(vec![-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]), 165);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "rs", - "prompt": "/// Return length of given string\n/// >>> strlen(String::from(\"\"))\n/// 0\n/// >>> strlen(String::from(\"abc\"))\n/// 3\nfn strlen(string: String) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = strlen;\n assert_eq!(candidate(String::from(\"\")), 0);\n assert_eq!(candidate(String::from(\"x\")), 1);\n assert_eq!(candidate(String::from(\"asdasnakj\")), 9);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "rs", - "prompt": "/// You'll be given a string of words, and your task is to count the number\n/// of boredoms. A boredom is a sentence that starts with the word \"I\".\n/// Sentences are delimited by '.', '?' or '!'.\n/// For example:\n/// >>> is_bored(String::from(\"Hello world\"))\n/// 0\n/// >>> is_bored(String::from(\"The sky is blue. The sun is shining. I love this weather\"))\n/// 1\nfn is_bored(S: String) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = is_bored;\n assert_eq!(candidate(String::from(\"Hello world\")), 0);\n assert_eq!(candidate(String::from(\"Is the sky blue?\")), 0);\n assert_eq!(candidate(String::from(\"I love It !\")), 1);\n assert_eq!(candidate(String::from(\"bIt\")), 0);\n assert_eq!(candidate(String::from(\"I feel good today. I will be productive. will kill It\")), 2);\n assert_eq!(candidate(String::from(\"You and I are going for a walk\")), 0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "rs", - "prompt": "/// Write a function vowels_count which takes a string representing\n/// a word as input and returns the number of vowels in the string.\n/// Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n/// vowel, but only when it is at the end of the given word.\n/// Example:\n/// >>> vowels_count(String::from(\"abcde\"))\n/// 2\n/// >>> vowels_count(String::from(\"ACEDY\"))\n/// 3\nfn vowels_count(s: String) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = vowels_count;\n assert_eq!(candidate(String::from(\"abcde\")), 2);\n assert_eq!(candidate(String::from(\"Alone\")), 3);\n assert_eq!(candidate(String::from(\"key\")), 2);\n assert_eq!(candidate(String::from(\"bye\")), 1);\n assert_eq!(candidate(String::from(\"keY\")), 2);\n assert_eq!(candidate(String::from(\"bYe\")), 1);\n assert_eq!(candidate(String::from(\"ACEDY\")), 3);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "rs", - "prompt": "/// Return n-th Fibonacci number.\n/// >>> fib(10)\n/// 55\n/// >>> fib(1)\n/// 1\n/// >>> fib(8)\n/// 21\nfn fib(n: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = fib;\n assert_eq!(candidate(10), 55);\n assert_eq!(candidate(1), 1);\n assert_eq!(candidate(8), 21);\n assert_eq!(candidate(11), 89);\n assert_eq!(candidate(12), 144);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "rs", - "prompt": "/// Your task is to implement a function that will simplify the expression\n/// x * n. The function returns true if x * n evaluates to a whole number and false\n/// otherwise. Both x and n, are string representation of a fraction, and have the following format,\n/// / where both numerator and denominator are positive whole numbers.\n/// You can assume that x, and n are valid fractions, and do not have zero as denominator.\n/// >>> simplify(String::from(\"1/5\"), String::from(\"5/1\"))\n/// true\n/// >>> simplify(String::from(\"1/6\"), String::from(\"2/1\"))\n/// false\n/// >>> simplify(String::from(\"7/10\"), String::from(\"10/2\"))\n/// false\nfn simplify(x: String, n: String) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = simplify;\n assert_eq!(candidate(String::from(\"1/5\"), String::from(\"5/1\")), true);\n assert_eq!(candidate(String::from(\"1/6\"), String::from(\"2/1\")), false);\n assert_eq!(candidate(String::from(\"5/1\"), String::from(\"3/1\")), true);\n assert_eq!(candidate(String::from(\"7/10\"), String::from(\"10/2\")), false);\n assert_eq!(candidate(String::from(\"2/10\"), String::from(\"50/10\")), true);\n assert_eq!(candidate(String::from(\"7/2\"), String::from(\"4/2\")), true);\n assert_eq!(candidate(String::from(\"11/6\"), String::from(\"6/1\")), true);\n assert_eq!(candidate(String::from(\"2/3\"), String::from(\"5/2\")), false);\n assert_eq!(candidate(String::from(\"5/2\"), String::from(\"3/5\")), false);\n assert_eq!(candidate(String::from(\"2/4\"), String::from(\"8/4\")), true);\n assert_eq!(candidate(String::from(\"2/4\"), String::from(\"4/2\")), true);\n assert_eq!(candidate(String::from(\"1/5\"), String::from(\"5/1\")), true);\n assert_eq!(candidate(String::from(\"1/5\"), String::from(\"1/5\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "rs", - "prompt": "/// Given a string s, count the number of uppercase vowels in even indices.\n/// For example:\n/// >>> count_upper(String::from(\"aBCdEf\"))\n/// 1\n/// >>> count_upper(String::from(\"abcdefg\"))\n/// 0\n/// >>> count_upper(String::from(\"dBBE\"))\n/// 0\nfn count_upper(s: String) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = count_upper;\n assert_eq!(candidate(String::from(\"aBCdEf\")), 1);\n assert_eq!(candidate(String::from(\"abcdefg\")), 0);\n assert_eq!(candidate(String::from(\"dBBE\")), 0);\n assert_eq!(candidate(String::from(\"B\")), 0);\n assert_eq!(candidate(String::from(\"U\")), 1);\n assert_eq!(candidate(String::from(\"\")), 0);\n assert_eq!(candidate(String::from(\"EEEE\")), 2);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "rs", - "prompt": "/// You are given a rectangular grid of wells. Each row represents a single well,\n/// and each 1 in a row represents a single unit of water.\n/// Each well has a corresponding bucket that can be used to extract water from it, \n/// and all buckets have the same capacity.\n/// Your task is to use the buckets to empty the wells.\n/// Output the number of times you need to lower the buckets.\n/// Example 1:\n/// >>> max_fill(vec![vec![0, 0, 1, 0], vec![0, 1, 0, 0], vec![1, 1, 1, 1]], 1)\n/// 6\n/// Example 2:\n/// >>> max_fill(vec![vec![0, 0, 1, 1], vec![0, 0, 0, 0], vec![1, 1, 1, 1], vec![0, 1, 1, 1]], 2)\n/// 5\n/// Example 3:\n/// >>> max_fill(vec![vec![0, 0, 0], vec![0, 0, 0]], 5)\n/// 0\n/// Constraints:\n/// * all wells have the same length\n/// * 1 <= grid.length <= 10^2\n/// * 1 <= grid[:,1].length <= 10^2\n/// * grid[i][j] -> 0 | 1\n/// * 1 <= capacity <= 10\nfn max_fill(grid: Vec>, capacity: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = max_fill;\n assert_eq!(candidate(vec![vec![0, 0, 1, 0], vec![0, 1, 0, 0], vec![1, 1, 1, 1]], 1), 6);\n assert_eq!(candidate(vec![vec![0, 0, 1, 1], vec![0, 0, 0, 0], vec![1, 1, 1, 1], vec![0, 1, 1, 1]], 2), 5);\n assert_eq!(candidate(vec![vec![0, 0, 0], vec![0, 0, 0]], 5), 0);\n assert_eq!(candidate(vec![vec![1, 1, 1, 1], vec![1, 1, 1, 1]], 2), 4);\n assert_eq!(candidate(vec![vec![1, 1, 1, 1], vec![1, 1, 1, 1]], 9), 2);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "rs", - "prompt": "/// Given a vector arr of integers and a positive integer k, return a sorted vector \n/// of length k with the maximum k numbers in arr.\n/// Example 1:\n/// >>> maximum(vec![-3, -4, 5], 3)\n/// vec![-4, -3, 5]\n/// Example 2:\n/// >>> maximum(vec![4, -4, 4], 2)\n/// vec![4, 4]\n/// Example 3:\n/// >>> maximum(vec![-3, 2, 1, 2, -1, -2, 1], 1)\n/// vec![2]\n/// Note:\n/// 1. The length of the vector will be in the range of [1, 1000].\n/// 2. The elements in the vector will be in the range of [-1000, 1000].\n/// 3. 0 <= k <= len(arr)\nfn maximum(arr: Vec, k: isize) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = maximum;\n assert_eq!(candidate(vec![-3, -4, 5], 3), vec![-4, -3, 5]);\n assert_eq!(candidate(vec![4, -4, 4], 2), vec![4, 4]);\n assert_eq!(candidate(vec![-3, 2, 1, 2, -1, -2, 1], 1), vec![2]);\n assert_eq!(candidate(vec![123, -123, 20, 0, 1, 2, -3], 3), vec![2, 20, 123]);\n assert_eq!(candidate(vec![-123, 20, 0, 1, 2, -3], 4), vec![0, 1, 2, 20]);\n assert_eq!(candidate(vec![5, 15, 0, 3, -13, -8, 0], 7), vec![-13, -8, 0, 0, 3, 5, 15]);\n assert_eq!(candidate(vec![-1, 0, 2, 5, 3, -10], 2), vec![3, 5]);\n assert_eq!(candidate(vec![1, 0, 5, -7], 1), vec![5]);\n assert_eq!(candidate(vec![4, -4], 2), vec![-4, 4]);\n assert_eq!(candidate(vec![-10, 10], 2), vec![-10, 10]);\n assert_eq!(candidate(vec![1, 2, 3, -23, 243, -400, 0], 0), Vec::::new());\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "rs", - "prompt": "/// Write a function that takes a message, and encodes in such a \n/// way that it swaps case of all letters, replaces all vowels in \n/// the message with the letter that appears 2 places ahead of that \n/// vowel in the english alphabet. \n/// Assume only letters. \n/// Examples:\n/// >>> encode(String::from(\"test\"))\n/// String::from(\"TGST\")\n/// >>> encode(String::from(\"This is a message\"))\n/// String::from(\"tHKS KS C MGSSCGG\")\nfn encode(message: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = encode;\n assert_eq!(candidate(String::from(\"TEST\")), String::from(\"tgst\"));\n assert_eq!(candidate(String::from(\"Mudasir\")), String::from(\"mWDCSKR\"));\n assert_eq!(candidate(String::from(\"YES\")), String::from(\"ygs\"));\n assert_eq!(candidate(String::from(\"This is a message\")), String::from(\"tHKS KS C MGSSCGG\"));\n assert_eq!(candidate(String::from(\"I DoNt KnOw WhAt tO WrItE\")), String::from(\"k dQnT kNqW wHcT Tq wRkTg\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "rs", - "prompt": "/// remove_vowels is a function that takes string and returns string without vowels.\n/// >>> remove_vowels(String::from(\"\"))\n/// String::from(\"\")\n/// >>> remove_vowels(String::from(\"abcdef\"))\n/// String::from(\"bcdf\")\n/// >>> remove_vowels(String::from(\"aaaaa\"))\n/// String::from(\"\")\n/// >>> remove_vowels(String::from(\"aaBAA\"))\n/// String::from(\"B\")\n/// >>> remove_vowels(String::from(\"zbcd\"))\n/// String::from(\"zbcd\")\nfn remove_vowels(text: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = remove_vowels;\n assert_eq!(candidate(String::from(\"\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"abcdef\nghijklm\")), String::from(\"bcdf\nghjklm\"));\n assert_eq!(candidate(String::from(\"fedcba\")), String::from(\"fdcb\"));\n assert_eq!(candidate(String::from(\"eeeee\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"acBAA\")), String::from(\"cB\"));\n assert_eq!(candidate(String::from(\"EcBOO\")), String::from(\"cB\"));\n assert_eq!(candidate(String::from(\"ybcd\")), String::from(\"ybcd\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "rs", - "prompt": "/// Return only positive numbers in the vector.\n/// >>> get_positive(vec![-1, 2, -4, 5, 6])\n/// vec![2, 5, 6]\n/// >>> get_positive(vec![5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n/// vec![5, 3, 2, 3, 9, 123, 1]\nfn get_positive(l: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = get_positive;\n assert_eq!(candidate(vec![-1, -2, 4, 5, 6]), vec![4, 5, 6]);\n assert_eq!(candidate(vec![5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]), vec![5, 3, 2, 3, 3, 9, 123, 1]);\n assert_eq!(candidate(vec![-1, -2]), Vec::::new());\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "rs", - "prompt": "/// Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n/// >>> string_sequence(0)\n/// String::from(\"0\")\n/// >>> string_sequence(5)\n/// String::from(\"0 1 2 3 4 5\")\nfn string_sequence(n: isize) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = string_sequence;\n assert_eq!(candidate(0), String::from(\"0\"));\n assert_eq!(candidate(3), String::from(\"0 1 2 3\"));\n assert_eq!(candidate(10), String::from(\"0 1 2 3 4 5 6 7 8 9 10\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "rs", - "prompt": "/// Given a positive integer n, you have to make a pile of n levels of stones.\n/// The first level has n stones.\n/// The number of stones in the next level is:\n/// - the next odd number if n is odd.\n/// - the next even number if n is even.\n/// Return the number of stones in each level in a vector, where element at index\n/// i represents the number of stones in the level (i+1).\n/// Examples:\n/// >>> make_a_pile(3)\n/// vec![3, 5, 7]\nfn make_a_pile(n: isize) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = make_a_pile;\n assert_eq!(candidate(3), vec![3, 5, 7]);\n assert_eq!(candidate(4), vec![4, 6, 8, 10]);\n assert_eq!(candidate(5), vec![5, 7, 9, 11, 13]);\n assert_eq!(candidate(6), vec![6, 8, 10, 12, 14, 16]);\n assert_eq!(candidate(8), vec![8, 10, 12, 14, 16, 18, 20, 22]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "rs", - "prompt": "/// Task\n/// 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\n/// then check if the result string is palindrome.\n/// A string is called palindrome if it reads the same backward as forward.\n/// You should return a tuple containing the result string and true/false for the check.\n/// Example\n/// >>> reverse_delete(String::from(\"abcde\"), String::from(\"ae\"))\n/// (String::from(\"bcd\"), false)\n/// >>> reverse_delete(String::from(\"abcdef\"), String::from(\"b\"))\n/// (String::from(\"acdef\"), false)\n/// >>> reverse_delete(String::from(\"abcdedcba\"), String::from(\"ab\"))\n/// (String::from(\"cdedc\"), true)\nfn reverse_delete(s: String, c: String) -> (String, bool) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = reverse_delete;\n assert_eq!(candidate(String::from(\"abcde\"), String::from(\"ae\")), (String::from(\"bcd\"), false));\n assert_eq!(candidate(String::from(\"abcdef\"), String::from(\"b\")), (String::from(\"acdef\"), false));\n assert_eq!(candidate(String::from(\"abcdedcba\"), String::from(\"ab\")), (String::from(\"cdedc\"), true));\n assert_eq!(candidate(String::from(\"dwik\"), String::from(\"w\")), (String::from(\"dik\"), false));\n assert_eq!(candidate(String::from(\"a\"), String::from(\"a\")), (String::from(\"\"), true));\n assert_eq!(candidate(String::from(\"abcdedcba\"), String::from(\"\")), (String::from(\"abcdedcba\"), true));\n assert_eq!(candidate(String::from(\"abcdedcba\"), String::from(\"v\")), (String::from(\"abcdedcba\"), true));\n assert_eq!(candidate(String::from(\"vabba\"), String::from(\"v\")), (String::from(\"abba\"), true));\n assert_eq!(candidate(String::from(\"mamma\"), String::from(\"mia\")), (String::from(\"\"), true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "rs", - "prompt": "/// For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n/// >>> flip_case(String::from(\"Hello\"))\n/// String::from(\"hELLO\")\nfn flip_case(string: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = flip_case;\n assert_eq!(candidate(String::from(\"\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"Hello!\")), String::from(\"hELLO!\"));\n assert_eq!(candidate(String::from(\"These violent delights have violent ends\")), String::from(\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "rs", - "prompt": "/// You are given a string s.\n/// if s[i] is a letter, reverse its case from lower to upper or vise versa, \n/// otherwise keep it as it is.\n/// If the string contains no letters, reverse the string.\n/// The function should return the resulted string.\n/// Examples\n/// >>> solve(String::from(\"1234\"))\n/// String::from(\"4321\")\n/// >>> solve(String::from(\"ab\"))\n/// String::from(\"AB\")\n/// >>> solve(String::from(\"#a@C\"))\n/// String::from(\"#A@c\")\nfn solve(s: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = solve;\n assert_eq!(candidate(String::from(\"AsDf\")), String::from(\"aSdF\"));\n assert_eq!(candidate(String::from(\"1234\")), String::from(\"4321\"));\n assert_eq!(candidate(String::from(\"ab\")), String::from(\"AB\"));\n assert_eq!(candidate(String::from(\"#a@C\")), String::from(\"#A@c\"));\n assert_eq!(candidate(String::from(\"#AsdfW^45\")), String::from(\"#aSDFw^45\"));\n assert_eq!(candidate(String::from(\"#6@2\")), String::from(\"2@6#\"));\n assert_eq!(candidate(String::from(\"#$a^D\")), String::from(\"#$A^d\"));\n assert_eq!(candidate(String::from(\"#ccc\")), String::from(\"#CCC\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "rs", - "prompt": "/// Filter an input vector of strings only for ones that start with a given prefix.\n/// >>> filter_by_prefix(vec![], String::from(\"a\"))\n/// Vec::::new()\n/// >>> filter_by_prefix(vec![String::from(\"abc\"), String::from(\"bcd\"), String::from(\"cde\"), String::from(\"array\")], String::from(\"a\"))\n/// vec![String::from(\"abc\"), String::from(\"array\")]\nfn filter_by_prefix(strings: Vec, prefix: String) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = filter_by_prefix;\n assert_eq!(candidate(Vec::::new(), String::from(\"john\")), Vec::::new());\n assert_eq!(candidate(vec![String::from(\"xxx\"), String::from(\"asd\"), String::from(\"xxy\"), String::from(\"john doe\"), String::from(\"xxxAAA\"), String::from(\"xxx\")], String::from(\"xxx\")), vec![String::from(\"xxx\"), String::from(\"xxxAAA\"), String::from(\"xxx\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "rs", - "prompt": "/// This function takes two positive numbers x and y and returns the\n/// biggest even integer number that is in the range [x, y] inclusive. If \n/// there's no such number, then the function should return -1.\n/// For example:\n/// >>> choose_num(12, 15)\n/// 14\n/// >>> choose_num(13, 12)\n/// -1\nfn choose_num(x: isize, y: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = choose_num;\n assert_eq!(candidate(12, 15), 14);\n assert_eq!(candidate(13, 12), -1);\n assert_eq!(candidate(33, 12354), 12354);\n assert_eq!(candidate(5234, 5233), -1);\n assert_eq!(candidate(6, 29), 28);\n assert_eq!(candidate(27, 10), -1);\n assert_eq!(candidate(7, 7), -1);\n assert_eq!(candidate(546, 546), 546);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "rs", - "prompt": "/// You are given a string representing a sentence,\n/// the sentence contains some words separated by a space,\n/// and you have to return a string that contains the words from the original sentence,\n/// whose lengths are prime numbers,\n/// the order of the words in the new string should be the same as the original one.\n/// Example 1:\n/// >>> words_in_sentence(String::from(\"This is a test\"))\n/// String::from(\"is\")\n/// Example 2:\n/// >>> words_in_sentence(String::from(\"lets go for swimming\"))\n/// String::from(\"go for\")\n/// Constraints:\n/// * 1 <= len(sentence) <= 100\n/// * sentence contains only letters\nfn words_in_sentence(sentence: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = words_in_sentence;\n assert_eq!(candidate(String::from(\"This is a test\")), String::from(\"is\"));\n assert_eq!(candidate(String::from(\"lets go for swimming\")), String::from(\"go for\"));\n assert_eq!(candidate(String::from(\"there is no place available here\")), String::from(\"there is no place\"));\n assert_eq!(candidate(String::from(\"Hi I am Hussein\")), String::from(\"Hi am Hussein\"));\n assert_eq!(candidate(String::from(\"go for it\")), String::from(\"go for it\"));\n assert_eq!(candidate(String::from(\"here\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"here is\")), String::from(\"is\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "rs", - "prompt": "/// Insert a number 'delimeter' between every two consecutive elements of input vector `numbers'\n/// >>> intersperse(vec![], 4)\n/// Vec::::new()\n/// >>> intersperse(vec![1, 2, 3], 4)\n/// vec![1, 4, 2, 4, 3]\nfn intersperse(numbers: Vec, delimeter: isize) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = intersperse;\n assert_eq!(candidate(Vec::::new(), 7), Vec::::new());\n assert_eq!(candidate(vec![5, 6, 3, 2], 8), vec![5, 8, 6, 8, 3, 8, 2]);\n assert_eq!(candidate(vec![2, 2, 2], 2), vec![2, 2, 2, 2, 2]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "rs", - "prompt": "/// Your task is to write a function that returns true if a number x is a simple\n/// power of n and false in other cases.\n/// x is a simple power of n if n**int=x\n/// For example:\n/// >>> is_simple_power(1, 4)\n/// true\n/// >>> is_simple_power(2, 2)\n/// true\n/// >>> is_simple_power(8, 2)\n/// true\n/// >>> is_simple_power(3, 2)\n/// false\n/// >>> is_simple_power(3, 1)\n/// false\n/// >>> is_simple_power(5, 3)\n/// false\nfn is_simple_power(x: isize, n: isize) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = is_simple_power;\n assert_eq!(candidate(16, 2), true);\n assert_eq!(candidate(143214, 16), false);\n assert_eq!(candidate(4, 2), true);\n assert_eq!(candidate(9, 3), true);\n assert_eq!(candidate(16, 4), true);\n assert_eq!(candidate(24, 2), false);\n assert_eq!(candidate(128, 4), false);\n assert_eq!(candidate(12, 6), false);\n assert_eq!(candidate(1, 1), true);\n assert_eq!(candidate(1, 12), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "rs", - "prompt": "/// Write a function that returns true if the given number is the multiplication of 3 prime numbers\n/// and false otherwise.\n/// Knowing that (a) is less then 100. \n/// Example:\n/// >>> is_multiply_prime(30)\n/// true\n/// 30 = 2 * 3 * 5\nfn is_multiply_prime(a: isize) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = is_multiply_prime;\n assert_eq!(candidate(5), false);\n assert_eq!(candidate(30), true);\n assert_eq!(candidate(8), true);\n assert_eq!(candidate(10), false);\n assert_eq!(candidate(125), true);\n assert_eq!(candidate(105), true);\n assert_eq!(candidate(126), false);\n assert_eq!(candidate(729), false);\n assert_eq!(candidate(891), false);\n assert_eq!(candidate(1001), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "rs", - "prompt": "/// Given the lengths of the three sides of a triangle. Return true if the three\n/// sides form a right-angled triangle, false otherwise.\n/// A right-angled triangle is a triangle in which one angle is right angle or \n/// 90 degree.\n/// Example:\n/// >>> right_angle_triangle(3, 4, 5)\n/// true\n/// >>> right_angle_triangle(1, 2, 3)\n/// false\nfn right_angle_triangle(a: isize, b: isize, c: isize) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = right_angle_triangle;\n assert_eq!(candidate(3, 4, 5), true);\n assert_eq!(candidate(1, 2, 3), false);\n assert_eq!(candidate(10, 6, 8), true);\n assert_eq!(candidate(2, 2, 2), false);\n assert_eq!(candidate(7, 24, 25), true);\n assert_eq!(candidate(10, 5, 7), false);\n assert_eq!(candidate(5, 12, 13), true);\n assert_eq!(candidate(15, 8, 17), true);\n assert_eq!(candidate(48, 55, 73), true);\n assert_eq!(candidate(1, 1, 1), false);\n assert_eq!(candidate(2, 2, 10), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "rs", - "prompt": "/// Create a function that takes 3 numbers.\n/// Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n/// Returns false in any other cases.\n/// Examples\n/// >>> any_int(5, 2, 7)\n/// true\n/// >>> any_int(3, 2, 2)\n/// false\n/// >>> any_int(3, -2, 1)\n/// true\n/// >>> any_int(3.6, -2.2, 2)\n/// false\nfn any_int(x: f64, y: f64, z: f64) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = any_int;\n assert_eq!(candidate(2.0, 3.0, 1.0), true);\n assert_eq!(candidate(2.5, 2.0, 3.0), false);\n assert_eq!(candidate(1.5, 5.0, 3.5), false);\n assert_eq!(candidate(2.0, 6.0, 2.0), false);\n assert_eq!(candidate(4.0, 2.0, 2.0), true);\n assert_eq!(candidate(2.2, 2.2, 2.2), false);\n assert_eq!(candidate(-4.0, 6.0, 2.0), true);\n assert_eq!(candidate(2.0, 1.0, 1.0), true);\n assert_eq!(candidate(3.0, 4.0, 7.0), true);\n assert_eq!(candidate(3.0, 4.0, 7.0), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "rs", - "prompt": "/// This function takes a vector l and returns a vector l' such that\n/// l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n/// to the values of the corresponding indicies of l, but sorted.\n/// >>> sort_third(vec![1, 2, 3])\n/// vec![1, 2, 3]\n/// >>> sort_third(vec![5, 6, 3, 4, 8, 9, 2])\n/// vec![2, 6, 3, 4, 8, 9, 5]\nfn sort_third(l: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = sort_third;\n assert_eq!(candidate(vec![5, 6, 3, 4, 8, 9, 2]), vec![2, 6, 3, 4, 8, 9, 5]);\n assert_eq!(candidate(vec![5, 8, 3, 4, 6, 9, 2]), vec![2, 8, 3, 4, 6, 9, 5]);\n assert_eq!(candidate(vec![5, 6, 9, 4, 8, 3, 2]), vec![2, 6, 9, 4, 8, 3, 5]);\n assert_eq!(candidate(vec![5, 6, 3, 4, 8, 9, 2, 1]), vec![2, 6, 3, 4, 8, 9, 5, 1]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_53_add", - "language": "rs", - "prompt": "/// Add two numbers x and y\n/// >>> add(2, 3)\n/// 5\n/// >>> add(5, 7)\n/// 12\nfn add(x: isize, y: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = add;\n assert_eq!(candidate(0, 1), 1);\n assert_eq!(candidate(1, 0), 1);\n assert_eq!(candidate(2, 3), 5);\n assert_eq!(candidate(5, 7), 12);\n assert_eq!(candidate(7, 5), 12);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_69_search", - "language": "rs", - "prompt": "/// You are given a non-empty vector of positive integers. Return the greatest integer that is greater than \n/// zero, and has a frequency greater than or equal to the value of the integer itself. \n/// The frequency of an integer is the number of times it appears in the vector.\n/// If no such a value exist, return -1.\n/// Examples:\n/// >>> search(vec![4, 1, 2, 2, 3, 1])\n/// 2\n/// >>> search(vec![1, 2, 2, 3, 3, 3, 4, 4, 4])\n/// 3\n/// >>> search(vec![5, 5, 4, 4, 4])\n/// -1\nfn search(lst: Vec) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = search;\n assert_eq!(candidate(vec![5, 5, 5, 5, 1]), 1);\n assert_eq!(candidate(vec![4, 1, 4, 1, 4, 4]), 4);\n assert_eq!(candidate(vec![3, 3]), -1);\n assert_eq!(candidate(vec![8, 8, 8, 8, 8, 8, 8, 8]), 8);\n assert_eq!(candidate(vec![2, 3, 3, 2, 2]), 2);\n assert_eq!(candidate(vec![2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]), 1);\n assert_eq!(candidate(vec![3, 2, 8, 2]), 2);\n assert_eq!(candidate(vec![6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]), 1);\n assert_eq!(candidate(vec![8, 8, 3, 6, 5, 6, 4]), -1);\n assert_eq!(candidate(vec![6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]), 1);\n assert_eq!(candidate(vec![1, 9, 10, 1, 3]), 1);\n assert_eq!(candidate(vec![6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]), 5);\n assert_eq!(candidate(vec![1]), 1);\n assert_eq!(candidate(vec![8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]), 4);\n assert_eq!(candidate(vec![2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]), 2);\n assert_eq!(candidate(vec![1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]), 1);\n assert_eq!(candidate(vec![9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]), 4);\n assert_eq!(candidate(vec![2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]), 4);\n assert_eq!(candidate(vec![9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]), 2);\n assert_eq!(candidate(vec![5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]), -1);\n assert_eq!(candidate(vec![10]), -1);\n assert_eq!(candidate(vec![9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]), 2);\n assert_eq!(candidate(vec![5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]), 1);\n assert_eq!(candidate(vec![7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]), 1);\n assert_eq!(candidate(vec![3, 10, 10, 9, 2]), -1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "rs", - "prompt": "/// Write a function that takes a string and returns true if the string\n/// length is a prime number or false otherwise\n/// Examples\n/// >>> prime_length(String::from(\"Hello\"))\n/// true\n/// >>> prime_length(String::from(\"abcdcba\"))\n/// true\n/// >>> prime_length(String::from(\"kittens\"))\n/// true\n/// >>> prime_length(String::from(\"orange\"))\n/// false\nfn prime_length(string: String) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = prime_length;\n assert_eq!(candidate(String::from(\"Hello\")), true);\n assert_eq!(candidate(String::from(\"abcdcba\")), true);\n assert_eq!(candidate(String::from(\"kittens\")), true);\n assert_eq!(candidate(String::from(\"orange\")), false);\n assert_eq!(candidate(String::from(\"wow\")), true);\n assert_eq!(candidate(String::from(\"world\")), true);\n assert_eq!(candidate(String::from(\"MadaM\")), true);\n assert_eq!(candidate(String::from(\"Wow\")), true);\n assert_eq!(candidate(String::from(\"\")), false);\n assert_eq!(candidate(String::from(\"HI\")), true);\n assert_eq!(candidate(String::from(\"go\")), true);\n assert_eq!(candidate(String::from(\"gogo\")), false);\n assert_eq!(candidate(String::from(\"aaaaaaaaaaaaaaa\")), false);\n assert_eq!(candidate(String::from(\"Madam\")), true);\n assert_eq!(candidate(String::from(\"M\")), false);\n assert_eq!(candidate(String::from(\"0\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_58_common", - "language": "rs", - "prompt": "/// Return sorted unique common elements for two vectors.\n/// >>> common(vec![1, 4, 3, 34, 653, 2, 5], vec![5, 7, 1, 5, 9, 653, 121])\n/// vec![1, 5, 653]\n/// >>> common(vec![5, 3, 2, 8], vec![3, 2])\n/// vec![2, 3]\nfn common(l1: Vec, l2: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = common;\n assert_eq!(candidate(vec![1, 4, 3, 34, 653, 2, 5], vec![5, 7, 1, 5, 9, 653, 121]), vec![1, 5, 653]);\n assert_eq!(candidate(vec![5, 3, 2, 8], vec![3, 2]), vec![2, 3]);\n assert_eq!(candidate(vec![4, 3, 2, 8], vec![3, 2, 4]), vec![2, 3, 4]);\n assert_eq!(candidate(vec![4, 3, 2, 8], Vec::::new()), Vec::::new());\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "rs", - "prompt": "/// The Brazilian factorial is defined as:\n/// brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n/// where n > 0\n/// For example:\n/// >>> special_factorial(4)\n/// 288\n/// The function will receive an integer as input and should return the special\n/// factorial of this integer.\nfn special_factorial(n: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = special_factorial;\n assert_eq!(candidate(4), 288);\n assert_eq!(candidate(5), 34560);\n assert_eq!(candidate(7), 125411328000);\n assert_eq!(candidate(1), 1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "rs", - "prompt": "/// In this problem, you will implement a function that takes two vectors of numbers,\n/// and determines whether it is possible to perform an exchange of elements\n/// between them to make lst1 a vector of only even numbers.\n/// There is no limit on the number of exchanged elements between lst1 and lst2.\n/// If it is possible to exchange elements between the lst1 and lst2 to make\n/// all the elements of lst1 to be even, return \"YES\".\n/// Otherwise, return \"NO\".\n/// For example:\n/// >>> exchange(vec![1, 2, 3, 4], vec![1, 2, 3, 4])\n/// String::from(\"YES\")\n/// >>> exchange(vec![1, 2, 3, 4], vec![1, 5, 3, 4])\n/// String::from(\"NO\")\n/// It is assumed that the input vectors will be non-empty.\nfn exchange(lst1: Vec, lst2: Vec) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = exchange;\n assert_eq!(candidate(vec![1, 2, 3, 4], vec![1, 2, 3, 4]), String::from(\"YES\"));\n assert_eq!(candidate(vec![1, 2, 3, 4], vec![1, 5, 3, 4]), String::from(\"NO\"));\n assert_eq!(candidate(vec![1, 2, 3, 4], vec![2, 1, 4, 3]), String::from(\"YES\"));\n assert_eq!(candidate(vec![5, 7, 3], vec![2, 6, 4]), String::from(\"YES\"));\n assert_eq!(candidate(vec![5, 7, 3], vec![2, 6, 3]), String::from(\"NO\"));\n assert_eq!(candidate(vec![3, 2, 6, 1, 8, 9], vec![3, 5, 5, 1, 1, 1]), String::from(\"NO\"));\n assert_eq!(candidate(vec![100, 200], vec![200, 200]), String::from(\"YES\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "rs", - "prompt": "/// Given a non-empty vector of integers arr and an integer k, return\n/// the sum of the elements with at most two digits from the first k elements of arr.\n/// Example:\n/// >>> add_elements(vec![111, 21, 3, 4000, 5, 6, 7, 8, 9], 4)\n/// 24\n/// Constraints:\n/// 1. 1 <= len(arr) <= 100\n/// 2. 1 <= k <= len(arr)\nfn add_elements(arr: Vec, k: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = add_elements;\n assert_eq!(candidate(vec![1, -2, -3, 41, 57, 76, 87, 88, 99], 3), -4);\n assert_eq!(candidate(vec![111, 121, 3, 4000, 5, 6], 2), 0);\n assert_eq!(candidate(vec![11, 21, 3, 90, 5, 6, 7, 8, 9], 4), 125);\n assert_eq!(candidate(vec![111, 21, 3, 4000, 5, 6, 7, 8, 9], 4), 24);\n assert_eq!(candidate(vec![1], 1), 1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "rs", - "prompt": "/// A simple program which should return the value of x if n is \n/// a prime number and should return the value of y otherwise.\n/// Examples:\n/// >>> x_or_y(7, 34, 12)\n/// 34\n/// >>> x_or_y(15, 8, 5)\n/// 5\nfn x_or_y(n: isize, x: isize, y: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = x_or_y;\n assert_eq!(candidate(7, 34, 12), 34);\n assert_eq!(candidate(15, 8, 5), 5);\n assert_eq!(candidate(3, 33, 5212), 33);\n assert_eq!(candidate(1259, 3, 52), 3);\n assert_eq!(candidate(7919, -1, 12), -1);\n assert_eq!(candidate(3609, 1245, 583), 583);\n assert_eq!(candidate(91, 56, 129), 129);\n assert_eq!(candidate(6, 34, 1234), 1234);\n assert_eq!(candidate(1, 2, 0), 0);\n assert_eq!(candidate(2, 2, 0), 2);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "rs", - "prompt": "/// Given length of a side and high return area for a triangle.\n/// >>> triangle_area(5, 3)\n/// 7.5\nfn triangle_area(a: isize, h: isize) -> f64 {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = triangle_area;\n assert_eq!(candidate(5, 3), 7.5);\n assert_eq!(candidate(2, 2), 2.0);\n assert_eq!(candidate(10, 8), 40.0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "rs", - "prompt": "/// Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n/// the last couple centuries. However, what people don't know is Tribonacci sequence.\n/// Tribonacci sequence is defined by the recurrence:\n/// tri(1) = 3\n/// tri(n) = 1 + n / 2, if n is even.\n/// tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n/// For example:\n/// tri(2) = 1 + (2 / 2) = 2\n/// tri(4) = 3\n/// tri(3) = tri(2) + tri(1) + tri(4)\n/// = 2 + 3 + 3 = 8 \n/// You are given a non-negative integer number n, you have to a return a vector of the \n/// first n + 1 numbers of the Tribonacci sequence.\n/// Examples:\n/// >>> tri(3)\n/// vec![1, 3, 2, 8]\nfn tri(n: isize) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = tri;\n assert_eq!(candidate(3), vec![1, 3, 2, 8]);\n assert_eq!(candidate(4), vec![1, 3, 2, 8, 3]);\n assert_eq!(candidate(5), vec![1, 3, 2, 8, 3, 15]);\n assert_eq!(candidate(6), vec![1, 3, 2, 8, 3, 15, 4]);\n assert_eq!(candidate(7), vec![1, 3, 2, 8, 3, 15, 4, 24]);\n assert_eq!(candidate(8), vec![1, 3, 2, 8, 3, 15, 4, 24, 5]);\n assert_eq!(candidate(9), vec![1, 3, 2, 8, 3, 15, 4, 24, 5, 35]);\n assert_eq!(candidate(20), vec![1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11]);\n assert_eq!(candidate(0), vec![1]);\n assert_eq!(candidate(1), vec![1, 3]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "rs", - "prompt": "/// You are given a vector of two strings, both strings consist of open\n/// parentheses '(' or close parentheses ')' only.\n/// Your job is to check if it is possible to concatenate the two strings in\n/// some order, that the resulting string will be good.\n/// A string S is considered to be good if and only if all parentheses in S\n/// are balanced. For example: the string '(())()' is good, while the string\n/// '())' is not.\n/// Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n/// Examples:\n/// >>> match_parens(vec![String::from(\"()(\"), String::from(\")\")])\n/// String::from(\"Yes\")\n/// >>> match_parens(vec![String::from(\")\"), String::from(\")\")])\n/// String::from(\"No\")\nfn match_parens(lst: Vec) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = match_parens;\n assert_eq!(candidate(vec![String::from(\"()(\"), String::from(\")\")]), String::from(\"Yes\"));\n assert_eq!(candidate(vec![String::from(\")\"), String::from(\")\")]), String::from(\"No\"));\n assert_eq!(candidate(vec![String::from(\"(()(())\"), String::from(\"())())\")]), String::from(\"No\"));\n assert_eq!(candidate(vec![String::from(\")())\"), String::from(\"(()()(\")]), String::from(\"Yes\"));\n assert_eq!(candidate(vec![String::from(\"(())))\"), String::from(\"(()())((\")]), String::from(\"Yes\"));\n assert_eq!(candidate(vec![String::from(\"()\"), String::from(\"())\")]), String::from(\"No\"));\n assert_eq!(candidate(vec![String::from(\"(()(\"), String::from(\"()))()\")]), String::from(\"Yes\"));\n assert_eq!(candidate(vec![String::from(\"((((\"), String::from(\"((())\")]), String::from(\"No\"));\n assert_eq!(candidate(vec![String::from(\")(()\"), String::from(\"(()(\")]), String::from(\"No\"));\n assert_eq!(candidate(vec![String::from(\")(\"), String::from(\")(\")]), String::from(\"No\"));\n assert_eq!(candidate(vec![String::from(\"(\"), String::from(\")\")]), String::from(\"Yes\"));\n assert_eq!(candidate(vec![String::from(\")\"), String::from(\"(\")]), String::from(\"Yes\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "rs", - "prompt": "/// From a vector of integers, remove all elements that occur more than once.\n/// Keep order of elements left the same as in the input.\n/// >>> remove_duplicates(vec![1, 2, 3, 2, 4])\n/// vec![1, 3, 4]\nfn remove_duplicates(numbers: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = remove_duplicates;\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![1, 2, 3, 4]), vec![1, 2, 3, 4]);\n assert_eq!(candidate(vec![1, 2, 3, 2, 4, 3, 5]), vec![1, 4, 5]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "rs", - "prompt": "/// Return a greatest common divisor of two integers a and b\n/// >>> greatest_common_divisor(3, 5)\n/// 1\n/// >>> greatest_common_divisor(25, 15)\n/// 5\nfn greatest_common_divisor(a: isize, b: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = greatest_common_divisor;\n assert_eq!(candidate(3, 7), 1);\n assert_eq!(candidate(10, 15), 5);\n assert_eq!(candidate(49, 14), 7);\n assert_eq!(candidate(144, 60), 12);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "rs", - "prompt": "/// Checks if given string is a palindrome\n/// >>> is_palindrome(String::from(\"\"))\n/// true\n/// >>> is_palindrome(String::from(\"aba\"))\n/// true\n/// >>> is_palindrome(String::from(\"aaaaa\"))\n/// true\n/// >>> is_palindrome(String::from(\"zbcd\"))\n/// false\nfn is_palindrome(text: String) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = is_palindrome;\n assert_eq!(candidate(String::from(\"\")), true);\n assert_eq!(candidate(String::from(\"aba\")), true);\n assert_eq!(candidate(String::from(\"aaaaa\")), true);\n assert_eq!(candidate(String::from(\"zbcd\")), false);\n assert_eq!(candidate(String::from(\"xywyx\")), true);\n assert_eq!(candidate(String::from(\"xywyz\")), false);\n assert_eq!(candidate(String::from(\"xywzx\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "rs", - "prompt": "/// xs represent coefficients of a polynomial.\n/// xs[0] + xs[1] * x + xs[2] * x^2 + ....\n/// Return derivative of this polynomial in the same form.\n/// >>> derivative(vec![3, 1, 2, 4, 5])\n/// vec![1, 4, 12, 20]\n/// >>> derivative(vec![1, 2, 3])\n/// vec![2, 6]\nfn derivative(xs: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = derivative;\n assert_eq!(candidate(vec![3, 1, 2, 4, 5]), vec![1, 4, 12, 20]);\n assert_eq!(candidate(vec![1, 2, 3]), vec![2, 6]);\n assert_eq!(candidate(vec![3, 2, 1]), vec![2, 2]);\n assert_eq!(candidate(vec![3, 2, 1, 0, 4]), vec![2, 2, 0, 16]);\n assert_eq!(candidate(vec![1]), Vec::::new());\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "rs", - "prompt": "/// In this task, you will be given a string that represents a number of apples and oranges \n/// that are distributed in a basket of fruit this basket contains \n/// apples, oranges, and mango fruits. Given the string that represents the total number of \n/// the oranges and apples and an integer that represent the total number of the fruits \n/// in the basket return the number of the mango fruits in the basket.\n/// for examble:\n/// >>> fruit_distribution(String::from(\"5 apples and 6 oranges\"), 19)\n/// 8\n/// >>> fruit_distribution(String::from(\"0 apples and 1 oranges\"), 3)\n/// 2\n/// >>> fruit_distribution(String::from(\"2 apples and 3 oranges\"), 100)\n/// 95\n/// >>> fruit_distribution(String::from(\"100 apples and 1 oranges\"), 120)\n/// 19\nfn fruit_distribution(s: String, n: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = fruit_distribution;\n assert_eq!(candidate(String::from(\"5 apples and 6 oranges\"), 19), 8);\n assert_eq!(candidate(String::from(\"5 apples and 6 oranges\"), 21), 10);\n assert_eq!(candidate(String::from(\"0 apples and 1 oranges\"), 3), 2);\n assert_eq!(candidate(String::from(\"1 apples and 0 oranges\"), 3), 2);\n assert_eq!(candidate(String::from(\"2 apples and 3 oranges\"), 100), 95);\n assert_eq!(candidate(String::from(\"2 apples and 3 oranges\"), 5), 0);\n assert_eq!(candidate(String::from(\"1 apples and 100 oranges\"), 120), 19);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "rs", - "prompt": "/// Write a function that takes an integer a and returns true \n/// if this ingeger is a cube of some integer number.\n/// Note: you may assume the input is always valid.\n/// Examples:\n/// >>> iscube(1)\n/// true\n/// >>> iscube(2)\n/// false\n/// >>> iscube(-1)\n/// true\n/// >>> iscube(64)\n/// true\n/// >>> iscube(0)\n/// true\n/// >>> iscube(180)\n/// false\nfn iscube(a: isize) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = iscube;\n assert_eq!(candidate(1), true);\n assert_eq!(candidate(2), false);\n assert_eq!(candidate(-1), true);\n assert_eq!(candidate(64), true);\n assert_eq!(candidate(180), false);\n assert_eq!(candidate(1000), true);\n assert_eq!(candidate(0), true);\n assert_eq!(candidate(1729), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "rs", - "prompt": "/// In this Kata, you have to sort a vector of non-negative integers according to\n/// number of ones in their binary representation in ascending order.\n/// For similar number of ones, sort based on decimal value.\n/// It must be implemented like this:\n/// >>> sort_array(vec![1, 5, 2, 3, 4])\n/// vec![1, 2, 3, 4, 5]\n/// >>> sort_array(vec![-2, -3, -4, -5, -6])\n/// vec![-6, -5, -4, -3, -2]\n/// >>> sort_array(vec![1, 0, 2, 3, 4])\n/// vec![0, 1, 2, 3, 4]\nfn sort_array(arr: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = sort_array;\n assert_eq!(candidate(vec![1, 5, 2, 3, 4]), vec![1, 2, 4, 3, 5]);\n assert_eq!(candidate(vec![-2, -3, -4, -5, -6]), vec![-4, -2, -6, -5, -3]);\n assert_eq!(candidate(vec![1, 0, 2, 3, 4]), vec![0, 1, 2, 4, 3]);\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]), vec![2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77]);\n assert_eq!(candidate(vec![3, 6, 44, 12, 32, 5]), vec![32, 3, 5, 6, 12, 44]);\n assert_eq!(candidate(vec![2, 4, 8, 16, 32]), vec![2, 4, 8, 16, 32]);\n assert_eq!(candidate(vec![2, 4, 8, 16, 32]), vec![2, 4, 8, 16, 32]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "rs", - "prompt": "/// Given a vector of strings, where each string consists of only digits, return a vector.\n/// Each element i of the output should be \"the number of odd elements in the\n/// string i of the input.\" where all the i's should be replaced by the number\n/// of odd digits in the i'th string of the input.\n/// >>> odd_count(vec![String::from(\"1234567\")])\n/// vec![String::from(\"the number of odd elements 4n the str4ng 4 of the 4nput.\")]\n/// >>> odd_count(vec![String::from(\"3\"), String::from(\"11111111\")])\n/// vec![String::from(\"the number of odd elements 1n the str1ng 1 of the 1nput.\"), String::from(\"the number of odd elements 8n the str8ng 8 of the 8nput.\")]\nfn odd_count(lst: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = odd_count;\n assert_eq!(candidate(vec![String::from(\"1234567\")]), vec![String::from(\"the number of odd elements 4n the str4ng 4 of the 4nput.\")]);\n assert_eq!(candidate(vec![String::from(\"3\"), String::from(\"11111111\")]), vec![String::from(\"the number of odd elements 1n the str1ng 1 of the 1nput.\"), String::from(\"the number of odd elements 8n the str8ng 8 of the 8nput.\")]);\n assert_eq!(candidate(vec![String::from(\"271\"), String::from(\"137\"), String::from(\"314\")]), vec![String::from(\"the number of odd elements 2n the str2ng 2 of the 2nput.\"), String::from(\"the number of odd elements 3n the str3ng 3 of the 3nput.\"), String::from(\"the number of odd elements 2n the str2ng 2 of the 2nput.\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "rs", - "prompt": "/// brackets is a string of \"(\" and \")\".\n/// return true if every opening bracket has a corresponding closing bracket.\n/// >>> correct_bracketing(String::from(\"(\"))\n/// false\n/// >>> correct_bracketing(String::from(\"()\"))\n/// true\n/// >>> correct_bracketing(String::from(\"(()())\"))\n/// true\n/// >>> correct_bracketing(String::from(\")(()\"))\n/// false\nfn correct_bracketing(brackets: String) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = correct_bracketing;\n assert_eq!(candidate(String::from(\"()\")), true);\n assert_eq!(candidate(String::from(\"(()())\")), true);\n assert_eq!(candidate(String::from(\"()()(()())()\")), true);\n assert_eq!(candidate(String::from(\"()()((()()())())(()()(()))\")), true);\n assert_eq!(candidate(String::from(\"((()())))\")), false);\n assert_eq!(candidate(String::from(\")(()\")), false);\n assert_eq!(candidate(String::from(\"(\")), false);\n assert_eq!(candidate(String::from(\"((((\")), false);\n assert_eq!(candidate(String::from(\")\")), false);\n assert_eq!(candidate(String::from(\"(()\")), false);\n assert_eq!(candidate(String::from(\"()()(()())())(()\")), false);\n assert_eq!(candidate(String::from(\"()()(()())()))()\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "rs", - "prompt": "/// Task\n/// Write a function that takes a string as input and returns the sum of the upper characters only'\n/// ASCII codes.\n/// Examples:\n/// >>> digitSum(String::from(\"\"))\n/// 0\n/// >>> digitSum(String::from(\"abAB\"))\n/// 131\n/// >>> digitSum(String::from(\"abcCd\"))\n/// 67\n/// >>> digitSum(String::from(\"helloE\"))\n/// 69\n/// >>> digitSum(String::from(\"woArBld\"))\n/// 131\n/// >>> digitSum(String::from(\"aAaaaXa\"))\n/// 153\nfn digitSum(s: String) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = digitSum;\n assert_eq!(candidate(String::from(\"\")), 0);\n assert_eq!(candidate(String::from(\"abAB\")), 131);\n assert_eq!(candidate(String::from(\"abcCd\")), 67);\n assert_eq!(candidate(String::from(\"helloE\")), 69);\n assert_eq!(candidate(String::from(\"woArBld\")), 131);\n assert_eq!(candidate(String::from(\"aAaaaXa\")), 153);\n assert_eq!(candidate(String::from(\" How are yOu?\")), 151);\n assert_eq!(candidate(String::from(\"You arE Very Smart\")), 327);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "rs", - "prompt": "/// Write a function that accepts a vector of strings as a parameter,\n/// deletes the strings that have odd lengths from it,\n/// and returns the resulted vector with a sorted order,\n/// The vector is always a vector of strings and never a vector of numbers,\n/// and it may contain duplicates.\n/// The order of the vector should be ascending by length of each word, and you\n/// should return the vector sorted by that rule.\n/// If two words have the same length, sort the vector alphabetically.\n/// The function should return a vector of strings in sorted order.\n/// You may assume that all words will have the same length.\n/// For example:\n/// >>> list_sort(vec![String::from(\"aa\"), String::from(\"a\"), String::from(\"aaa\")])\n/// vec![String::from(\"aa\")]\n/// >>> list_sort(vec![String::from(\"ab\"), String::from(\"a\"), String::from(\"aaa\"), String::from(\"cd\")])\n/// vec![String::from(\"ab\"), String::from(\"cd\")]\nfn sorted_list_sum(lst: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = sorted_list_sum;\n assert_eq!(candidate(vec![String::from(\"aa\"), String::from(\"a\"), String::from(\"aaa\")]), vec![String::from(\"aa\")]);\n assert_eq!(candidate(vec![String::from(\"school\"), String::from(\"AI\"), String::from(\"asdf\"), String::from(\"b\")]), vec![String::from(\"AI\"), String::from(\"asdf\"), String::from(\"school\")]);\n assert_eq!(candidate(vec![String::from(\"d\"), String::from(\"b\"), String::from(\"c\"), String::from(\"a\")]), Vec::::new());\n assert_eq!(candidate(vec![String::from(\"d\"), String::from(\"dcba\"), String::from(\"abcd\"), String::from(\"a\")]), vec![String::from(\"abcd\"), String::from(\"dcba\")]);\n assert_eq!(candidate(vec![String::from(\"AI\"), String::from(\"ai\"), String::from(\"au\")]), vec![String::from(\"AI\"), String::from(\"ai\"), String::from(\"au\")]);\n assert_eq!(candidate(vec![String::from(\"a\"), String::from(\"b\"), String::from(\"b\"), String::from(\"c\"), String::from(\"c\"), String::from(\"a\")]), Vec::::new());\n assert_eq!(candidate(vec![String::from(\"aaaa\"), String::from(\"bbbb\"), String::from(\"dd\"), String::from(\"cc\")]), vec![String::from(\"cc\"), String::from(\"dd\"), String::from(\"aaaa\"), String::from(\"bbbb\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "rs", - "prompt": "/// You are given a vector arr of integers and you need to return\n/// sum of magnitudes of integers multiplied by product of all signs\n/// of each number in the vector, represented by 1, -1 or 0.\n/// Note: return None for empty arr.\n/// Example:\n/// >>> prod_signs(vec![1, 2, 2, -4])\n/// Some(9)\n/// >>> prod_signs(vec![0, 1])\n/// Some(0)\n/// >>> prod_signs(vec![])\n/// None\nfn prod_signs(arr: Vec) -> Option {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = prod_signs;\n assert_eq!(candidate(vec![1, 2, 2, -4]), Some(-9));\n assert_eq!(candidate(vec![0, 1]), Some(0));\n assert_eq!(candidate(vec![1, 1, 1, 2, 3, -1, 1]), Some(-10));\n assert_eq!(candidate(Vec::::new()), None);\n assert_eq!(candidate(vec![2, 4, 1, 2, -1, -1, 9]), Some(20));\n assert_eq!(candidate(vec![-1, 1, -1, 1]), Some(4));\n assert_eq!(candidate(vec![-1, 1, 1, 1]), Some(-4));\n assert_eq!(candidate(vec![-1, 1, 1, 0]), Some(0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "rs", - "prompt": "/// Return vector with elements incremented by 1.\n/// >>> incr_list(vec![1, 2, 3])\n/// vec![2, 3, 4]\n/// >>> incr_list(vec![5, 3, 5, 2, 3, 3, 9, 0, 123])\n/// vec![6, 4, 6, 3, 4, 4, 10, 1, 124]\nfn incr_list(l: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = incr_list;\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![3, 2, 1]), vec![4, 3, 2]);\n assert_eq!(candidate(vec![5, 2, 5, 2, 3, 3, 9, 0, 123]), vec![6, 3, 6, 3, 4, 4, 10, 1, 124]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "rs", - "prompt": "/// From a given vector of integers, generate a vector of rolling maximum element found until given moment\n/// in the sequence.\n/// >>> rolling_max(vec![1, 2, 3, 2, 3, 4, 2])\n/// vec![1, 2, 3, 3, 3, 4, 4]\nfn rolling_max(numbers: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = rolling_max;\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![1, 2, 3, 4]), vec![1, 2, 3, 4]);\n assert_eq!(candidate(vec![4, 3, 2, 1]), vec![4, 4, 4, 4]);\n assert_eq!(candidate(vec![3, 2, 3, 100, 3]), vec![3, 3, 3, 100, 100]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "rs", - "prompt": "/// Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n/// separate those group into separate strings and return the vector of those.\n/// Separate groups are balanced (each open brace is properly closed) and not nested within each other\n/// Ignore any spaces in the input string.\n/// >>> separate_paren_groups(String::from(\"( ) (( )) (( )( ))\"))\n/// vec![String::from(\"()\"), String::from(\"(())\"), String::from(\"(()())\")]\nfn separate_paren_groups(paren_string: String) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = separate_paren_groups;\n assert_eq!(candidate(String::from(\"(()()) ((())) () ((())()())\")), vec![String::from(\"(()())\"), String::from(\"((()))\"), String::from(\"()\"), String::from(\"((())()())\")]);\n assert_eq!(candidate(String::from(\"() (()) ((())) (((())))\")), vec![String::from(\"()\"), String::from(\"(())\"), String::from(\"((()))\"), String::from(\"(((())))\")]);\n assert_eq!(candidate(String::from(\"(()(())((())))\")), vec![String::from(\"(()(())((())))\")]);\n assert_eq!(candidate(String::from(\"( ) (( )) (( )( ))\")), vec![String::from(\"()\"), String::from(\"(())\"), String::from(\"(()())\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "rs", - "prompt": "/// You will be given a string of words separated by commas or spaces. Your task is\n/// to split the string into words and return a vector of the words.\n/// For example:\n/// >>> words_string(String::from(\"Hi, my name is John\"))\n/// vec![String::from(\"Hi\"), String::from(\"my\"), String::from(\"name\"), String::from(\"is\"), String::from(\"John\")]\n/// >>> words_string(String::from(\"One, two, three, four, five, six\"))\n/// vec![String::from(\"One\"), String::from(\"two\"), String::from(\"three\"), String::from(\"four\"), String::from(\"five\"), String::from(\"six\")]\nfn words_string(s: String) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = words_string;\n assert_eq!(candidate(String::from(\"Hi, my name is John\")), vec![String::from(\"Hi\"), String::from(\"my\"), String::from(\"name\"), String::from(\"is\"), String::from(\"John\")]);\n assert_eq!(candidate(String::from(\"One, two, three, four, five, six\")), vec![String::from(\"One\"), String::from(\"two\"), String::from(\"three\"), String::from(\"four\"), String::from(\"five\"), String::from(\"six\")]);\n assert_eq!(candidate(String::from(\"Hi, my name\")), vec![String::from(\"Hi\"), String::from(\"my\"), String::from(\"name\")]);\n assert_eq!(candidate(String::from(\"One,, two, three, four, five, six,\")), vec![String::from(\"One\"), String::from(\"two\"), String::from(\"three\"), String::from(\"four\"), String::from(\"five\"), String::from(\"six\")]);\n assert_eq!(candidate(String::from(\"\")), Vec::::new());\n assert_eq!(candidate(String::from(\"ahmed , gamal\")), vec![String::from(\"ahmed\"), String::from(\"gamal\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "rs", - "prompt": "/// This function takes a vector l and returns a vector l' such that\n/// l' is identical to l in the odd indicies, while its values at the even indicies are equal\n/// to the values of the even indicies of l, but sorted.\n/// >>> sort_even(vec![1, 2, 3])\n/// vec![1, 2, 3]\n/// >>> sort_even(vec![5, 6, 3, 4])\n/// vec![3, 6, 5, 4]\nfn sort_even(l: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = sort_even;\n assert_eq!(candidate(vec![1, 2, 3]), vec![1, 2, 3]);\n assert_eq!(candidate(vec![5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]), vec![-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123]);\n assert_eq!(candidate(vec![5, 8, -12, 4, 23, 2, 3, 11, 12, -10]), vec![-12, 8, 3, 4, 5, 2, 12, 11, 23, -10]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "rs", - "prompt": "/// I think we all remember that feeling when the result of some long-awaited\n/// event is finally known. The feelings and thoughts you have at that moment are\n/// definitely worth noting down and comparing.\n/// Your task is to determine if a person correctly guessed the results of a number of matches.\n/// You are given two vectors of scores and guesses of equal length, where each index shows a match. \n/// Return a vector of the same length denoting how far off each guess was. If they have guessed correctly,\n/// the value is 0, and if not, the value is the absolute difference between the guess and the score.\n/// example:\n/// >>> compare(vec![1, 2, 3, 4, 5, 1], vec![1, 2, 3, 4, 2, -2])\n/// vec![0, 0, 0, 0, 3, 3]\n/// >>> compare(vec![0, 5, 0, 0, 0, 4], vec![4, 1, 1, 0, 0, -2])\n/// vec![4, 4, 1, 0, 0, 6]\nfn compare(game: Vec, guess: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = compare;\n assert_eq!(candidate(vec![1, 2, 3, 4, 5, 1], vec![1, 2, 3, 4, 2, -2]), vec![0, 0, 0, 0, 3, 3]);\n assert_eq!(candidate(vec![0, 0, 0, 0, 0, 0], vec![0, 0, 0, 0, 0, 0]), vec![0, 0, 0, 0, 0, 0]);\n assert_eq!(candidate(vec![1, 2, 3], vec![-1, -2, -3]), vec![2, 4, 6]);\n assert_eq!(candidate(vec![1, 2, 3, 5], vec![-1, 2, 3, 4]), vec![2, 0, 0, 1]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "rs", - "prompt": "/// Given a positive integer n, return a tuple that has the number of even and odd\n/// integer palindromes that fall within the range(1, n), inclusive.\n/// Example 1:\n/// >>> even_odd_palindrome(3)\n/// (1, 2)\n/// Explanation:\n/// Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n/// Example 2:\n/// >>> even_odd_palindrome(12)\n/// (4, 6)\n/// Explanation:\n/// Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n/// Note:\n/// 1. 1 <= n <= 10^3\n/// 2. returned tuple has the number of even and odd integer palindromes respectively.\nfn even_odd_palindrome(n: isize) -> (isize, isize) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = even_odd_palindrome;\n assert_eq!(candidate(123), (8, 13));\n assert_eq!(candidate(12), (4, 6));\n assert_eq!(candidate(3), (1, 2));\n assert_eq!(candidate(63), (6, 8));\n assert_eq!(candidate(25), (5, 6));\n assert_eq!(candidate(19), (4, 6));\n assert_eq!(candidate(9), (4, 5));\n assert_eq!(candidate(1), (0, 1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "rs", - "prompt": "/// The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n/// fib4(0) -> 0\n/// fib4(1) -> 0\n/// fib4(2) -> 2\n/// fib4(3) -> 0\n/// fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n/// Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n/// >>> fib4(5)\n/// 4\n/// >>> fib4(6)\n/// 8\n/// >>> fib4(7)\n/// 14\nfn fib4(n: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = fib4;\n assert_eq!(candidate(5), 4);\n assert_eq!(candidate(8), 28);\n assert_eq!(candidate(10), 104);\n assert_eq!(candidate(12), 386);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "rs", - "prompt": "/// Given two positive integers a and b, return the even digits between a\n/// and b, in ascending order.\n/// For example:\n/// >>> generate_integers(2, 8)\n/// vec![2, 4, 6, 8]\n/// >>> generate_integers(8, 2)\n/// vec![2, 4, 6, 8]\n/// >>> generate_integers(10, 14)\n/// Vec::::new()\nfn generate_integers(a: isize, b: isize) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = generate_integers;\n assert_eq!(candidate(2, 10), vec![2, 4, 6, 8]);\n assert_eq!(candidate(10, 2), vec![2, 4, 6, 8]);\n assert_eq!(candidate(132, 2), vec![2, 4, 6, 8]);\n assert_eq!(candidate(17, 89), Vec::::new());\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "rs", - "prompt": "/// For a given vector of input numbers, calculate Mean Absolute Deviation\n/// around the mean of this dataset.\n/// Mean Absolute Deviation is the average absolute difference between each\n/// element and a centerpoint (mean in this case):\n/// MAD = average | x - x_mean |\n/// >>> mean_absolute_deviation(vec![1.0, 2.0, 3.0, 4.0])\n/// 1.0\nfn mean_absolute_deviation(numbers: Vec) -> f64 {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = mean_absolute_deviation;\n assert_eq!(candidate(vec![1.0, 2.0]), 0.5);\n assert_eq!(candidate(vec![1.0, 2.0, 3.0, 4.0]), 1.0);\n assert_eq!(candidate(vec![1.0, 2.0, 3.0, 4.0, 5.0]), 1.2);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "rs", - "prompt": "/// Create a function encrypt that takes a string as an argument and\n/// returns a string encrypted with the alphabet being rotated. \n/// The alphabet should be rotated in a manner such that the letters \n/// shift down by two multiplied to two places.\n/// For example:\n/// >>> encrypt(String::from(\"hi\"))\n/// String::from(\"lm\")\n/// >>> encrypt(String::from(\"asdfghjkl\"))\n/// String::from(\"ewhjklnop\")\n/// >>> encrypt(String::from(\"gf\"))\n/// String::from(\"kj\")\n/// >>> encrypt(String::from(\"et\"))\n/// String::from(\"ix\")\nfn encrypt(s: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = encrypt;\n assert_eq!(candidate(String::from(\"hi\")), String::from(\"lm\"));\n assert_eq!(candidate(String::from(\"asdfghjkl\")), String::from(\"ewhjklnop\"));\n assert_eq!(candidate(String::from(\"gf\")), String::from(\"kj\"));\n assert_eq!(candidate(String::from(\"et\")), String::from(\"ix\"));\n assert_eq!(candidate(String::from(\"faewfawefaewg\")), String::from(\"jeiajeaijeiak\"));\n assert_eq!(candidate(String::from(\"hellomyfriend\")), String::from(\"lippsqcjvmirh\"));\n assert_eq!(candidate(String::from(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\")), String::from(\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\"));\n assert_eq!(candidate(String::from(\"a\")), String::from(\"e\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "rs", - "prompt": "/// Given a positive integer n, return a sorted vector that has the odd numbers in collatz sequence.\n/// The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n/// as follows: start with any positive integer n. Then each term is obtained from the \n/// previous term as follows: if the previous term is even, the next term is one half of \n/// the previous term. If the previous term is odd, the next term is 3 times the previous\n/// term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n/// Note: \n/// 1. Collatz(1) is [1].\n/// 2. returned vector sorted in increasing order.\n/// For example:\n/// get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n/// >>> get_odd_collatz(5)\n/// vec![1, 5]\nfn get_odd_collatz(n: isize) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = get_odd_collatz;\n assert_eq!(candidate(14), vec![1, 5, 7, 11, 13, 17]);\n assert_eq!(candidate(5), vec![1, 5]);\n assert_eq!(candidate(12), vec![1, 3, 5]);\n assert_eq!(candidate(1), vec![1]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "rs", - "prompt": "/// Find how many times a given substring can be found in the original string. Count overlaping cases.\n/// >>> how_many_times(String::from(\"\"), String::from(\"a\"))\n/// 0\n/// >>> how_many_times(String::from(\"aaa\"), String::from(\"a\"))\n/// 3\n/// >>> how_many_times(String::from(\"aaaa\"), String::from(\"aa\"))\n/// 3\nfn how_many_times(string: String, substring: String) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = how_many_times;\n assert_eq!(candidate(String::from(\"\"), String::from(\"x\")), 0);\n assert_eq!(candidate(String::from(\"xyxyxyx\"), String::from(\"x\")), 4);\n assert_eq!(candidate(String::from(\"cacacacac\"), String::from(\"cac\")), 4);\n assert_eq!(candidate(String::from(\"john doe\"), String::from(\"john\")), 1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "rs", - "prompt": "/// We have a vector 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n/// numbers in the vector will be randomly ordered. Your task is to determine if\n/// it is possible to get a vector sorted in non-decreasing order by performing \n/// the following operation on the given vector:\n/// You are allowed to perform right shift operation any number of times.\n/// One right shift operation means shifting all elements of the vector by one\n/// position in the right direction. The last element of the vector will be moved to\n/// the starting position in the vector i.e. 0th index. \n/// If it is possible to obtain the sorted vector by performing the above operation\n/// then return true else return false.\n/// If the given vector is empty then return true.\n/// Note: The given vector is guaranteed to have unique elements.\n/// For Example:\n/// >>> move_one_ball(vec![3, 4, 5, 1, 2])\n/// true\n/// Explanation: By performin 2 right shift operations, non-decreasing order can\n/// be achieved for the given vector.\n/// >>> move_one_ball(vec![3, 5, 4, 1, 2])\n/// false\n/// Explanation:It is not possible to get non-decreasing order for the given\n/// vector by performing any number of right shift operations.\nfn move_one_ball(arr: Vec) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = move_one_ball;\n assert_eq!(candidate(vec![3, 4, 5, 1, 2]), true);\n assert_eq!(candidate(vec![3, 5, 10, 1, 2]), true);\n assert_eq!(candidate(vec![4, 3, 1, 2]), false);\n assert_eq!(candidate(vec![3, 5, 4, 1, 2]), false);\n assert_eq!(candidate(Vec::::new()), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "rs", - "prompt": "/// Write a function which sorts the given vector of integers\n/// in ascending order according to the sum of their digits.\n/// Note: if there are several items with similar sum of their digits,\n/// order them based on their index in original vector.\n/// For example:\n/// >>> order_by_points(vec![1, 11, -1, -11, -12])\n/// vec![-1, -11, 1, -12, 11]\n/// >>> order_by_points(vec![])\n/// Vec::::new()\nfn order_by_points(nums: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = order_by_points;\n assert_eq!(candidate(vec![1, 11, -1, -11, -12]), vec![-1, -11, 1, -12, 11]);\n assert_eq!(candidate(vec![1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]), vec![0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457]);\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![1, -11, -32, 43, 54, -98, 2, -3]), vec![-3, -32, -98, -11, 1, 2, 43, 54]);\n assert_eq!(candidate(vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]), vec![1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9]);\n assert_eq!(candidate(vec![0, 6, 6, -76, -21, 23, 4]), vec![-76, -21, 0, 4, 23, 6, 6]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "rs", - "prompt": "/// Return vector of prime factors of given integer in the order from smallest to largest.\n/// Each of the factors should be vectored number of times corresponding to how many times it appeares in factorization.\n/// Input number should be equal to the product of all factors\n/// >>> factorize(8)\n/// vec![2, 2, 2]\n/// >>> factorize(25)\n/// vec![5, 5]\n/// >>> factorize(70)\n/// vec![2, 5, 7]\nfn factorize(n: isize) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = factorize;\n assert_eq!(candidate(2), vec![2]);\n assert_eq!(candidate(4), vec![2, 2]);\n assert_eq!(candidate(8), vec![2, 2, 2]);\n assert_eq!(candidate(57), vec![3, 19]);\n assert_eq!(candidate(3249), vec![3, 3, 19, 19]);\n assert_eq!(candidate(185193), vec![3, 3, 3, 19, 19, 19]);\n assert_eq!(candidate(20577), vec![3, 19, 19, 19]);\n assert_eq!(candidate(18), vec![2, 3, 3]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "rs", - "prompt": "/// Return true if all numbers in the vector l are below threshold t.\n/// >>> below_threshold(vec![1, 2, 4, 10], 100)\n/// true\n/// >>> below_threshold(vec![1, 20, 4, 10], 5)\n/// false\nfn below_threshold(l: Vec, t: isize) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = below_threshold;\n assert_eq!(candidate(vec![1, 2, 4, 10], 100), true);\n assert_eq!(candidate(vec![1, 20, 4, 10], 5), false);\n assert_eq!(candidate(vec![1, 20, 4, 10], 21), true);\n assert_eq!(candidate(vec![1, 20, 4, 10], 22), true);\n assert_eq!(candidate(vec![1, 8, 4, 10], 11), true);\n assert_eq!(candidate(vec![1, 8, 4, 10], 10), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "rs", - "prompt": "/// Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n/// For each of the group, output the deepest level of nesting of parentheses.\n/// E.g. (()()) has maximum two levels of nesting while ((())) has three.\n/// >>> parse_nested_parens(String::from(\"(()()) ((())) () ((())()())\"))\n/// vec![2, 3, 1, 3]\nfn parse_nested_parens(paren_string: String) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = parse_nested_parens;\n assert_eq!(candidate(String::from(\"(()()) ((())) () ((())()())\")), vec![2, 3, 1, 3]);\n assert_eq!(candidate(String::from(\"() (()) ((())) (((())))\")), vec![1, 2, 3, 4]);\n assert_eq!(candidate(String::from(\"(()(())((())))\")), vec![4]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "rs", - "prompt": "/// Given a non-empty vector of integers, return the sum of all of the odd elements that are in even positions.\n/// Examples\n/// >>> solution(vec![5, 8, 7, 1])\n/// 12\n/// >>> solution(vec![3, 3, 3, 3, 3])\n/// 9\n/// >>> solution(vec![30, 13, 24, 321])\n/// 0\nfn solution(lst: Vec) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = solution;\n assert_eq!(candidate(vec![5, 8, 7, 1]), 12);\n assert_eq!(candidate(vec![3, 3, 3, 3, 3]), 9);\n assert_eq!(candidate(vec![30, 13, 24, 321]), 0);\n assert_eq!(candidate(vec![5, 9]), 5);\n assert_eq!(candidate(vec![2, 4, 8]), 0);\n assert_eq!(candidate(vec![30, 13, 23, 32]), 23);\n assert_eq!(candidate(vec![3, 13, 2, 9]), 3);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "rs", - "prompt": "/// You are given a positive integer n. You have to create an integer vector a of length n.\n/// For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n/// Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n/// and a[i] + a[j] + a[k] is a multiple of 3.\n/// Example :\n/// >>> get_max_triples(5)\n/// 1\n/// Explanation: \n/// a = [1, 3, 7, 13, 21]\n/// The only valid triple is (1, 7, 13).\nfn get_max_triples(n: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = get_max_triples;\n assert_eq!(candidate(5), 1);\n assert_eq!(candidate(6), 4);\n assert_eq!(candidate(10), 36);\n assert_eq!(candidate(100), 53361);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "rs", - "prompt": "/// You are given a vector of integers.\n/// Write a function next_smallest() that returns the 2nd smallest element of the vector.\n/// Return None if there is no such element.\n/// >>> next_smallest(vec![1, 2, 3, 4, 5])\n/// Some(2)\n/// >>> next_smallest(vec![5, 1, 4, 3, 2])\n/// Some(2)\n/// >>> next_smallest(vec![])\n/// None\n/// >>> next_smallest(vec![1, 1])\n/// None\nfn next_smallest(lst: Vec) -> Option {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = next_smallest;\n assert_eq!(candidate(vec![1, 2, 3, 4, 5]), Some(2));\n assert_eq!(candidate(vec![5, 1, 4, 3, 2]), Some(2));\n assert_eq!(candidate(Vec::::new()), None);\n assert_eq!(candidate(vec![1, 1]), None);\n assert_eq!(candidate(vec![1, 1, 1, 1, 0]), Some(1));\n assert_eq!(candidate(vec![1, 1]), None);\n assert_eq!(candidate(vec![-35, 34, 12, -45]), Some(-35));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "rs", - "prompt": "/// Input is a space-delimited string of numberals from 'zero' to 'nine'.\n/// Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n/// Return the string with numbers sorted from smallest to largest\n/// >>> sort_numbers(String::from(\"three one five\"))\n/// String::from(\"one three five\")\nfn sort_numbers(numbers: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = sort_numbers;\n assert_eq!(candidate(String::from(\"\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"three\")), String::from(\"three\"));\n assert_eq!(candidate(String::from(\"three five nine\")), String::from(\"three five nine\"));\n assert_eq!(candidate(String::from(\"five zero four seven nine eight\")), String::from(\"zero four five seven eight nine\"));\n assert_eq!(candidate(String::from(\"six five four three two one zero\")), String::from(\"zero one two three four five six\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "rs", - "prompt": "/// You are given 2 words. You need to return true if the second word or any of its rotations is a substring in the first word\n/// >>> cycpattern_check(String::from(\"abcd\"), String::from(\"abd\"))\n/// false\n/// >>> cycpattern_check(String::from(\"hello\"), String::from(\"ell\"))\n/// true\n/// >>> cycpattern_check(String::from(\"whassup\"), String::from(\"psus\"))\n/// false\n/// >>> cycpattern_check(String::from(\"abab\"), String::from(\"baa\"))\n/// true\n/// >>> cycpattern_check(String::from(\"efef\"), String::from(\"eeff\"))\n/// false\n/// >>> cycpattern_check(String::from(\"himenss\"), String::from(\"simen\"))\n/// true\nfn cycpattern_check(a: String, b: String) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = cycpattern_check;\n assert_eq!(candidate(String::from(\"xyzw\"), String::from(\"xyw\")), false);\n assert_eq!(candidate(String::from(\"yello\"), String::from(\"ell\")), true);\n assert_eq!(candidate(String::from(\"whattup\"), String::from(\"ptut\")), false);\n assert_eq!(candidate(String::from(\"efef\"), String::from(\"fee\")), true);\n assert_eq!(candidate(String::from(\"abab\"), String::from(\"aabb\")), false);\n assert_eq!(candidate(String::from(\"winemtt\"), String::from(\"tinem\")), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "rs", - "prompt": "/// You will be given a number in decimal form and your task is to convert it to\n/// binary format. The function should return a string, with each character representing a binary\n/// number. Each character in the string will be '0' or '1'.\n/// There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n/// The extra characters are there to help with the format.\n/// Examples:\n/// >>> decimal_to_binary(15)\n/// String::from(\"db1111db\")\n/// >>> decimal_to_binary(32)\n/// String::from(\"db100000db\")\nfn decimal_to_binary(decimal: isize) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = decimal_to_binary;\n assert_eq!(candidate(0), String::from(\"db0db\"));\n assert_eq!(candidate(32), String::from(\"db100000db\"));\n assert_eq!(candidate(103), String::from(\"db1100111db\"));\n assert_eq!(candidate(15), String::from(\"db1111db\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "rs", - "prompt": "/// Filter an input vector of strings only for ones that contain given substring\n/// >>> filter_by_substring(vec![], String::from(\"a\"))\n/// Vec::::new()\n/// >>> filter_by_substring(vec![String::from(\"abc\"), String::from(\"bacd\"), String::from(\"cde\"), String::from(\"array\")], String::from(\"a\"))\n/// vec![String::from(\"abc\"), String::from(\"bacd\"), String::from(\"array\")]\nfn filter_by_substring(strings: Vec, substring: String) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = filter_by_substring;\n assert_eq!(candidate(Vec::::new(), String::from(\"john\")), Vec::::new());\n assert_eq!(candidate(vec![String::from(\"xxx\"), String::from(\"asd\"), String::from(\"xxy\"), String::from(\"john doe\"), String::from(\"xxxAAA\"), String::from(\"xxx\")], String::from(\"xxx\")), vec![String::from(\"xxx\"), String::from(\"xxxAAA\"), String::from(\"xxx\")]);\n assert_eq!(candidate(vec![String::from(\"xxx\"), String::from(\"asd\"), String::from(\"aaaxxy\"), String::from(\"john doe\"), String::from(\"xxxAAA\"), String::from(\"xxx\")], String::from(\"xx\")), vec![String::from(\"xxx\"), String::from(\"aaaxxy\"), String::from(\"xxxAAA\"), String::from(\"xxx\")]);\n assert_eq!(candidate(vec![String::from(\"grunt\"), String::from(\"trumpet\"), String::from(\"prune\"), String::from(\"gruesome\")], String::from(\"run\")), vec![String::from(\"grunt\"), String::from(\"prune\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "rs", - "prompt": "/// Given an integer. return a tuple that has the number of even and odd digits respectively.\n/// Example:\n/// >>> even_odd_count(-12)\n/// (1, 1)\n/// >>> even_odd_count(123)\n/// (1, 2)\nfn even_odd_count(num: isize) -> (isize, isize) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = even_odd_count;\n assert_eq!(candidate(7), (0, 1));\n assert_eq!(candidate(-78), (1, 1));\n assert_eq!(candidate(3452), (2, 2));\n assert_eq!(candidate(346211), (3, 3));\n assert_eq!(candidate(-345821), (3, 3));\n assert_eq!(candidate(-2), (1, 0));\n assert_eq!(candidate(-45347), (2, 3));\n assert_eq!(candidate(0), (1, 0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "rs", - "prompt": "/// Write a function that accepts a vector of strings.\n/// The vector contains different words. Return the word with maximum number\n/// of unique characters. If multiple strings have maximum number of unique\n/// characters, return the one which comes first in lexicographical order.\n/// >>> find_max(vec![String::from(\"name\"), String::from(\"of\"), String::from(\"string\")])\n/// String::from(\"string\")\n/// >>> find_max(vec![String::from(\"name\"), String::from(\"enam\"), String::from(\"game\")])\n/// String::from(\"enam\")\n/// >>> find_max(vec![String::from(\"aaaaaaa\"), String::from(\"bb\"), String::from(\"cc\")])\n/// String::from(\"aaaaaaa\")\nfn find_max(words: Vec) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = find_max;\n assert_eq!(candidate(vec![String::from(\"name\"), String::from(\"of\"), String::from(\"string\")]), String::from(\"string\"));\n assert_eq!(candidate(vec![String::from(\"name\"), String::from(\"enam\"), String::from(\"game\")]), String::from(\"enam\"));\n assert_eq!(candidate(vec![String::from(\"aaaaaaa\"), String::from(\"bb\"), String::from(\"cc\")]), String::from(\"aaaaaaa\"));\n assert_eq!(candidate(vec![String::from(\"abc\"), String::from(\"cba\")]), String::from(\"abc\"));\n assert_eq!(candidate(vec![String::from(\"play\"), String::from(\"this\"), String::from(\"game\"), String::from(\"of\"), String::from(\"footbott\")]), String::from(\"footbott\"));\n assert_eq!(candidate(vec![String::from(\"we\"), String::from(\"are\"), String::from(\"gonna\"), String::from(\"rock\")]), String::from(\"gonna\"));\n assert_eq!(candidate(vec![String::from(\"we\"), String::from(\"are\"), String::from(\"a\"), String::from(\"mad\"), String::from(\"nation\")]), String::from(\"nation\"));\n assert_eq!(candidate(vec![String::from(\"this\"), String::from(\"is\"), String::from(\"a\"), String::from(\"prrk\")]), String::from(\"this\"));\n assert_eq!(candidate(vec![String::from(\"b\")]), String::from(\"b\"));\n assert_eq!(candidate(vec![String::from(\"play\"), String::from(\"play\"), String::from(\"play\")]), String::from(\"play\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "rs", - "prompt": "/// Given a positive integer n, return the count of the numbers of n-digit\n/// positive integers that start or end with 1.\nfn starts_one_ends(n: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = starts_one_ends;\n assert_eq!(candidate(1), 1);\n assert_eq!(candidate(2), 18);\n assert_eq!(candidate(3), 180);\n assert_eq!(candidate(4), 1800);\n assert_eq!(candidate(5), 18000);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "rs", - "prompt": "/// Create a function that returns a tuple (a, b), where 'a' is\n/// the largest of negative integers, and 'b' is the smallest\n/// of positive integers in a vector.\n/// If there is no negative or positive integers, return them as None.\n/// Examples:\n/// >>> largest_smallest_integers(vec![2, 4, 1, 3, 5, 7])\n/// (None, Some(1))\n/// >>> largest_smallest_integers(vec![])\n/// (None, None)\n/// >>> largest_smallest_integers(vec![0])\n/// (None, None)\nfn largest_smallest_integers(lst: Vec) -> (Option, Option) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = largest_smallest_integers;\n assert_eq!(candidate(vec![2, 4, 1, 3, 5, 7]), (None, Some(1)));\n assert_eq!(candidate(vec![2, 4, 1, 3, 5, 7, 0]), (None, Some(1)));\n assert_eq!(candidate(vec![1, 3, 2, 4, 5, 6, -2]), (Some(-2), Some(1)));\n assert_eq!(candidate(vec![4, 5, 3, 6, 2, 7, -7]), (Some(-7), Some(2)));\n assert_eq!(candidate(vec![7, 3, 8, 4, 9, 2, 5, -9]), (Some(-9), Some(2)));\n assert_eq!(candidate(Vec::::new()), (None, None));\n assert_eq!(candidate(vec![0]), (None, None));\n assert_eq!(candidate(vec![-1, -3, -5, -6]), (Some(-1), None));\n assert_eq!(candidate(vec![-1, -3, -5, -6, 0]), (Some(-1), None));\n assert_eq!(candidate(vec![-6, -4, -4, -3, 1]), (Some(-3), Some(1)));\n assert_eq!(candidate(vec![-6, -4, -4, -3, -100, 1]), (Some(-3), Some(1)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "rs", - "prompt": "/// \"Given a vector representing a branch of a tree that has non-negative integer nodes\n/// your task is to pluck one of the nodes and return it.\n/// The plucked node should be the node with the smallest even value.\n/// If multiple nodes with the same smallest even value are found return the node that has smallest index.\n/// The plucked node should be returned in a vector, [ smalest_value, its index ],\n/// If there are no even values or the given vector is empty, return [].\n/// Example 1:\n/// >>> pluck(vec![4, 2, 3])\n/// vec![2, 1]\n/// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n/// Example 2:\n/// >>> pluck(vec![1, 2, 3])\n/// vec![2, 1]\n/// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n/// Example 3:\n/// >>> pluck(vec![])\n/// Vec::::new()\n/// Example 4:\n/// >>> pluck(vec![5, 0, 3, 0, 4, 2])\n/// vec![0, 1]\n/// Explanation: 0 is the smallest value, but there are two zeros,\n/// so we will choose the first zero, which has the smallest index.\n/// Constraints:\n/// * 1 <= nodes.length <= 10000\n/// * 0 <= node.value\nfn pluck(arr: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = pluck;\n assert_eq!(candidate(vec![4, 2, 3]), vec![2, 1]);\n assert_eq!(candidate(vec![1, 2, 3]), vec![2, 1]);\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![5, 0, 3, 0, 4, 2]), vec![0, 1]);\n assert_eq!(candidate(vec![1, 2, 3, 0, 5, 3]), vec![0, 3]);\n assert_eq!(candidate(vec![5, 4, 8, 4, 8]), vec![4, 1]);\n assert_eq!(candidate(vec![7, 6, 7, 1]), vec![6, 1]);\n assert_eq!(candidate(vec![7, 9, 7, 1]), Vec::::new());\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "rs", - "prompt": "/// Write a function count_nums which takes a vector of integers and returns\n/// the number of elements which has a sum of digits > 0.\n/// If a number is negative, then its first signed digit will be negative:\n/// e.g. -123 has signed digits -1, 2, and 3.\n/// >>> count_nums(vec![])\n/// 0\n/// >>> count_nums(vec![-1, 11, -11])\n/// 1\n/// >>> count_nums(vec![1, 1, 2])\n/// 3\nfn count_nums(arr: Vec) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = count_nums;\n assert_eq!(candidate(Vec::::new()), 0);\n assert_eq!(candidate(vec![-1, -2, 0]), 0);\n assert_eq!(candidate(vec![1, 1, 2, -2, 3, 4, 5]), 6);\n assert_eq!(candidate(vec![1, 6, 9, -6, 0, 1, 5]), 5);\n assert_eq!(candidate(vec![1, 100, 98, -7, 1, -1]), 4);\n assert_eq!(candidate(vec![12, 23, 34, -45, -56, 0]), 5);\n assert_eq!(candidate(vec![0, 1]), 1);\n assert_eq!(candidate(vec![1]), 1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "rs", - "prompt": "/// Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n/// each cell of the grid contains a value. Every integer in the range [1, N * N]\n/// inclusive appears exactly once on the cells of the grid.\n/// You have to find the minimum path of length k in the grid. You can start\n/// from any cell, and in each step you can move to any of the neighbor cells,\n/// in other words, you can go to cells which share an edge with you current\n/// cell.\n/// Please note that a path of length k means visiting exactly k cells (not\n/// necessarily distinct).\n/// You CANNOT go off the grid.\n/// A path A (of length k) is considered less than a path B (of length k) if\n/// after making the ordered vectors of the values on the cells that A and B go\n/// through (let's call them lst_A and lst_B), lst_A is lexicographically less\n/// than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n/// such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n/// lst_A[j] = lst_B[j].\n/// It is guaranteed that the answer is unique.\n/// Return an ordered vector of the values on the cells that the minimum path go through.\n/// Examples: \n/// >>> minPath(vec![vec![1, 2, 3], vec![4, 5, 6], vec![7, 8, 9]], 3)\n/// vec![1, 2, 1]\n/// >>> minPath(vec![vec![5, 9, 3], vec![4, 1, 6], vec![7, 8, 2]], 1)\n/// vec![1]\nfn minPath(grid: Vec>, k: isize) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = minPath;\n assert_eq!(candidate(vec![vec![1, 2, 3], vec![4, 5, 6], vec![7, 8, 9]], 3), vec![1, 2, 1]);\n assert_eq!(candidate(vec![vec![5, 9, 3], vec![4, 1, 6], vec![7, 8, 2]], 1), vec![1]);\n assert_eq!(candidate(vec![vec![1, 2, 3, 4], vec![5, 6, 7, 8], vec![9, 10, 11, 12], vec![13, 14, 15, 16]], 4), vec![1, 2, 1, 2]);\n assert_eq!(candidate(vec![vec![6, 4, 13, 10], vec![5, 7, 12, 1], vec![3, 16, 11, 15], vec![8, 14, 9, 2]], 7), vec![1, 10, 1, 10, 1, 10, 1]);\n assert_eq!(candidate(vec![vec![8, 14, 9, 2], vec![6, 4, 13, 15], vec![5, 7, 1, 12], vec![3, 10, 11, 16]], 5), vec![1, 7, 1, 7, 1]);\n assert_eq!(candidate(vec![vec![11, 8, 7, 2], vec![5, 16, 14, 4], vec![9, 3, 15, 6], vec![12, 13, 10, 1]], 9), vec![1, 6, 1, 6, 1, 6, 1, 6, 1]);\n assert_eq!(candidate(vec![vec![12, 13, 10, 1], vec![9, 3, 15, 6], vec![5, 16, 14, 4], vec![11, 8, 7, 2]], 12), vec![1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6]);\n assert_eq!(candidate(vec![vec![2, 7, 4], vec![3, 1, 5], vec![6, 8, 9]], 8), vec![1, 3, 1, 3, 1, 3, 1, 3]);\n assert_eq!(candidate(vec![vec![6, 1, 5], vec![3, 8, 9], vec![2, 7, 4]], 8), vec![1, 5, 1, 5, 1, 5, 1, 5]);\n assert_eq!(candidate(vec![vec![1, 2], vec![3, 4]], 10), vec![1, 2, 1, 2, 1, 2, 1, 2, 1, 2]);\n assert_eq!(candidate(vec![vec![1, 3], vec![3, 2]], 10), vec![1, 3, 1, 3, 1, 3, 1, 3, 1, 3]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "rs", - "prompt": "/// Given vector of integers, return vector in strange order.\n/// Strange sorting, is when you start with the minimum value,\n/// then maximum of the remaining integers, then minimum and so on.\n/// Examples:\n/// >>> strange_sort_list(vec![1, 2, 3, 4])\n/// vec![1, 4, 2, 3]\n/// >>> strange_sort_list(vec![5, 5, 5, 5])\n/// vec![5, 5, 5, 5]\n/// >>> strange_sort_list(vec![])\n/// Vec::::new()\nfn strange_sort_list(lst: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = strange_sort_list;\n assert_eq!(candidate(vec![1, 2, 3, 4]), vec![1, 4, 2, 3]);\n assert_eq!(candidate(vec![5, 6, 7, 8, 9]), vec![5, 9, 6, 8, 7]);\n assert_eq!(candidate(vec![1, 2, 3, 4, 5]), vec![1, 5, 2, 4, 3]);\n assert_eq!(candidate(vec![5, 6, 7, 8, 9, 1]), vec![1, 9, 5, 8, 6, 7]);\n assert_eq!(candidate(vec![5, 5, 5, 5]), vec![5, 5, 5, 5]);\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![1, 2, 3, 4, 5, 6, 7, 8]), vec![1, 8, 2, 7, 3, 6, 4, 5]);\n assert_eq!(candidate(vec![0, 2, 2, 2, 5, 5, -5, -5]), vec![-5, 5, -5, 5, 0, 2, 2, 2]);\n assert_eq!(candidate(vec![111111]), vec![111111]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "rs", - "prompt": "/// Given a string 'text', return its md5 hash equivalent string.\n/// If 'text' is an empty string, return None.\n/// >>> string_to_md5(String::from(\"Hello world\"))\n/// Some(String::from(\"3e25960a79dbc69b674cd4ec67a72c62\"))\nfn string_to_md5(text: String) -> Option {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = string_to_md5;\n assert_eq!(candidate(String::from(\"Hello world\")), Some(String::from(\"3e25960a79dbc69b674cd4ec67a72c62\")));\n assert_eq!(candidate(String::from(\"\")), None);\n assert_eq!(candidate(String::from(\"A B C\")), Some(String::from(\"0ef78513b0cb8cef12743f5aeb35f888\")));\n assert_eq!(candidate(String::from(\"password\")), Some(String::from(\"5f4dcc3b5aa765d61d8327deb882cf99\")));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "rs", - "prompt": "/// You are given a word. Your task is to find the closest vowel that stands between \n/// two consonants from the right side of the word (case sensitive).\n/// Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n/// find any vowel met the above condition. \n/// You may assume that the given string contains English letter only.\n/// Example:\n/// >>> get_closest_vowel(String::from(\"yogurt\"))\n/// String::from(\"u\")\n/// >>> get_closest_vowel(String::from(\"FULL\"))\n/// String::from(\"U\")\n/// >>> get_closest_vowel(String::from(\"quick\"))\n/// String::from(\"\")\n/// >>> get_closest_vowel(String::from(\"ab\"))\n/// String::from(\"\")\nfn get_closest_vowel(word: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = get_closest_vowel;\n assert_eq!(candidate(String::from(\"yogurt\")), String::from(\"u\"));\n assert_eq!(candidate(String::from(\"full\")), String::from(\"u\"));\n assert_eq!(candidate(String::from(\"easy\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"eAsy\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"ali\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"bad\")), String::from(\"a\"));\n assert_eq!(candidate(String::from(\"most\")), String::from(\"o\"));\n assert_eq!(candidate(String::from(\"ab\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"ba\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"quick\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"anime\")), String::from(\"i\"));\n assert_eq!(candidate(String::from(\"Asia\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"Above\")), String::from(\"o\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "rs", - "prompt": "/// Change numerical base of input number x to base.\n/// return string representation after the conversion.\n/// base numbers are less than 10.\n/// >>> change_base(8, 3)\n/// String::from(\"22\")\n/// >>> change_base(8, 2)\n/// String::from(\"1000\")\n/// >>> change_base(7, 2)\n/// String::from(\"111\")\nfn change_base(x: isize, base: isize) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = change_base;\n assert_eq!(candidate(8, 3), String::from(\"22\"));\n assert_eq!(candidate(9, 3), String::from(\"100\"));\n assert_eq!(candidate(234, 2), String::from(\"11101010\"));\n assert_eq!(candidate(16, 2), String::from(\"10000\"));\n assert_eq!(candidate(8, 2), String::from(\"1000\"));\n assert_eq!(candidate(7, 2), String::from(\"111\"));\n assert_eq!(candidate(2, 3), String::from(\"2\"));\n assert_eq!(candidate(3, 4), String::from(\"3\"));\n assert_eq!(candidate(4, 5), String::from(\"4\"));\n assert_eq!(candidate(5, 6), String::from(\"5\"));\n assert_eq!(candidate(6, 7), String::from(\"6\"));\n assert_eq!(candidate(7, 8), String::from(\"7\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "rs", - "prompt": "/// Check if in given vector of numbers, are any two numbers closer to each other than\n/// given threshold.\n/// >>> has_close_elements(vec![1.0, 2.0, 3.0], 0.5)\n/// false\n/// >>> has_close_elements(vec![1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n/// true\nfn has_close_elements(numbers: Vec, threshold: f64) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = has_close_elements;\n assert_eq!(candidate(vec![1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3), true);\n assert_eq!(candidate(vec![1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05), false);\n assert_eq!(candidate(vec![1.0, 2.0, 5.9, 4.0, 5.0], 0.95), true);\n assert_eq!(candidate(vec![1.0, 2.0, 5.9, 4.0, 5.0], 0.8), false);\n assert_eq!(candidate(vec![1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1), true);\n assert_eq!(candidate(vec![1.1, 2.2, 3.1, 4.1, 5.1], 1.0), true);\n assert_eq!(candidate(vec![1.1, 2.2, 3.1, 4.1, 5.1], 0.5), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "rs", - "prompt": "/// Create a function that takes a string as input which contains only square brackets.\n/// The function should return true if and only if there is a valid subsequence of brackets \n/// where at least one bracket in the subsequence is nested.\n/// >>> is_nested(String::from(\"[[]]\"))\n/// true\n/// >>> is_nested(String::from(\"[]]]]]]][[[[[]\"))\n/// false\n/// >>> is_nested(String::from(\"[][]\"))\n/// false\n/// >>> is_nested(String::from(\"[]\"))\n/// false\n/// >>> is_nested(String::from(\"[[][]]\"))\n/// true\n/// >>> is_nested(String::from(\"[[]][[\"))\n/// true\nfn is_nested(string: String) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = is_nested;\n assert_eq!(candidate(String::from(\"[[]]\")), true);\n assert_eq!(candidate(String::from(\"[]]]]]]][[[[[]\")), false);\n assert_eq!(candidate(String::from(\"[][]\")), false);\n assert_eq!(candidate(String::from(\"[]\")), false);\n assert_eq!(candidate(String::from(\"[[[[]]]]\")), true);\n assert_eq!(candidate(String::from(\"[]]]]]]]]]]\")), false);\n assert_eq!(candidate(String::from(\"[][][[]]\")), true);\n assert_eq!(candidate(String::from(\"[[]\")), false);\n assert_eq!(candidate(String::from(\"[]]\")), false);\n assert_eq!(candidate(String::from(\"[[]][[\")), true);\n assert_eq!(candidate(String::from(\"[[][]]\")), true);\n assert_eq!(candidate(String::from(\"\")), false);\n assert_eq!(candidate(String::from(\"[[[[[[[[\")), false);\n assert_eq!(candidate(String::from(\"]]]]]]]]\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "rs", - "prompt": "/// Concatenate vector of strings into a single string\n/// >>> concatenate(vec![])\n/// String::from(\"\")\n/// >>> concatenate(vec![String::from(\"a\"), String::from(\"b\"), String::from(\"c\")])\n/// String::from(\"abc\")\nfn concatenate(strings: Vec) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = concatenate;\n assert_eq!(candidate(Vec::::new()), String::from(\"\"));\n assert_eq!(candidate(vec![String::from(\"x\"), String::from(\"y\"), String::from(\"z\")]), String::from(\"xyz\"));\n assert_eq!(candidate(vec![String::from(\"x\"), String::from(\"y\"), String::from(\"z\"), String::from(\"w\"), String::from(\"k\")]), String::from(\"xyzwk\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "rs", - "prompt": "/// prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n/// >>> prime_fib(1)\n/// 2\n/// >>> prime_fib(2)\n/// 3\n/// >>> prime_fib(3)\n/// 5\n/// >>> prime_fib(4)\n/// 13\n/// >>> prime_fib(5)\n/// 89\nfn prime_fib(n: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = prime_fib;\n assert_eq!(candidate(1), 2);\n assert_eq!(candidate(2), 3);\n assert_eq!(candidate(3), 5);\n assert_eq!(candidate(4), 13);\n assert_eq!(candidate(5), 89);\n assert_eq!(candidate(6), 233);\n assert_eq!(candidate(7), 1597);\n assert_eq!(candidate(8), 28657);\n assert_eq!(candidate(9), 514229);\n assert_eq!(candidate(10), 433494437);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "rs", - "prompt": "/// From a supplied vector of numbers (of length at least two) select and return two that are the closest to each\n/// other and return them in order (smaller number, larger number).\n/// >>> find_closest_elements(vec![1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n/// (2.0, 2.2)\n/// >>> find_closest_elements(vec![1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n/// (2.0, 2.0)\nfn find_closest_elements(numbers: Vec) -> (f64, f64) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = find_closest_elements;\n assert_eq!(candidate(vec![1.0, 2.0, 3.9, 4.0, 5.0, 2.2]), (3.9, 4.0));\n assert_eq!(candidate(vec![1.0, 2.0, 5.9, 4.0, 5.0]), (5.0, 5.9));\n assert_eq!(candidate(vec![1.0, 2.0, 3.0, 4.0, 5.0, 2.2]), (2.0, 2.2));\n assert_eq!(candidate(vec![1.0, 2.0, 3.0, 4.0, 5.0, 2.0]), (2.0, 2.0));\n assert_eq!(candidate(vec![1.1, 2.2, 3.1, 4.1, 5.1]), (2.2, 3.1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "rs", - "prompt": "/// You have been tasked to write a function that receives \n/// a hexadecimal number as a string and counts the number of hexadecimal \n/// digits that are primes (prime number, or a prime, is a natural number \n/// greater than 1 that is not a product of two smaller natural numbers).\n/// Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n/// Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n/// So you have to determine a number of the following digits: 2, 3, 5, 7, \n/// B (=decimal 11), D (=decimal 13).\n/// Note: you may assume the input is always correct or empty string, \n/// and symbols A,B,C,D,E,F are always uppercase.\n/// Examples:\n/// >>> hex_key(String::from(\"AB\"))\n/// 1\n/// >>> hex_key(String::from(\"1077E\"))\n/// 2\n/// >>> hex_key(String::from(\"ABED1A33\"))\n/// 4\n/// >>> hex_key(String::from(\"123456789ABCDEF0\"))\n/// 6\n/// >>> hex_key(String::from(\"2020\"))\n/// 2\nfn hex_key(num: String) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = hex_key;\n assert_eq!(candidate(String::from(\"AB\")), 1);\n assert_eq!(candidate(String::from(\"1077E\")), 2);\n assert_eq!(candidate(String::from(\"ABED1A33\")), 4);\n assert_eq!(candidate(String::from(\"2020\")), 2);\n assert_eq!(candidate(String::from(\"123456789ABCDEF0\")), 6);\n assert_eq!(candidate(String::from(\"112233445566778899AABBCCDDEEFF00\")), 12);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "rs", - "prompt": "/// Complete the function that takes two integers and returns \n/// the product of their unit digits.\n/// Assume the input is always valid.\n/// Examples:\n/// >>> multiply(148, 412)\n/// 16\n/// >>> multiply(19, 28)\n/// 72\n/// >>> multiply(2020, 1851)\n/// 0\n/// >>> multiply(14, -15)\n/// 20\nfn multiply(a: isize, b: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = multiply;\n assert_eq!(candidate(148, 412), 16);\n assert_eq!(candidate(19, 28), 72);\n assert_eq!(candidate(2020, 1851), 0);\n assert_eq!(candidate(14, -15), 20);\n assert_eq!(candidate(76, 67), 42);\n assert_eq!(candidate(17, 27), 49);\n assert_eq!(candidate(0, 1), 0);\n assert_eq!(candidate(0, 0), 0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "rs", - "prompt": "/// Given vector of numbers (of at least two elements), apply a linear transform to that vector,\n/// such that the smallest number will become 0 and the largest will become 1\n/// >>> rescale_to_unit(vec![1.0, 2.0, 3.0, 4.0, 5.0])\n/// vec![0.0, 0.25, 0.5, 0.75, 1.0]\nfn rescale_to_unit(numbers: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = rescale_to_unit;\n assert_eq!(candidate(vec![2.0, 49.9]), vec![0.0, 1.0]);\n assert_eq!(candidate(vec![100.0, 49.9]), vec![1.0, 0.0]);\n assert_eq!(candidate(vec![1.0, 2.0, 3.0, 4.0, 5.0]), vec![0.0, 0.25, 0.5, 0.75, 1.0]);\n assert_eq!(candidate(vec![2.0, 1.0, 5.0, 3.0, 4.0]), vec![0.25, 0.0, 1.0, 0.5, 0.75]);\n assert_eq!(candidate(vec![12.0, 11.0, 15.0, 13.0, 14.0]), vec![0.25, 0.0, 1.0, 0.5, 0.75]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "rs", - "prompt": "/// Given a positive integer n, return the product of the odd digits.\n/// Return 0 if all digits are even.\n/// For example:\n/// >>> digits(1)\n/// 1\n/// >>> digits(4)\n/// 0\n/// >>> digits(235)\n/// 15\nfn digits(n: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = digits;\n assert_eq!(candidate(5), 5);\n assert_eq!(candidate(54), 5);\n assert_eq!(candidate(120), 1);\n assert_eq!(candidate(5014), 5);\n assert_eq!(candidate(98765), 315);\n assert_eq!(candidate(5576543), 2625);\n assert_eq!(candidate(2468), 0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "rs", - "prompt": "/// You will be given the name of a class (a string) and a vector of extensions.\n/// The extensions are to be used to load additional classes to the class. The\n/// strength of the extension is as follows: Let CAP be the number of the uppercase\n/// letters in the extension's name, and let SM be the number of lowercase letters \n/// in the extension's name, the strength is given by the fraction CAP - SM. \n/// You should find the strongest extension and return a string in this \n/// format: ClassName.StrongestExtensionName.\n/// If there are two or more extensions with the same strength, you should\n/// choose the one that comes first in the vector.\n/// For example, if you are given \"Slices\" as the class and a vector of the\n/// extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n/// return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n/// (its strength is -1).\n/// Example:\n/// >>> Strongest_Extension(String::from(\"my_class\"), vec![String::from(\"AA\"), String::from(\"Be\"), String::from(\"CC\")])\n/// String::from(\"my_class.AA\")\nfn Strongest_Extension(class_name: String, extensions: Vec) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = Strongest_Extension;\n assert_eq!(candidate(String::from(\"Watashi\"), vec![String::from(\"tEN\"), String::from(\"niNE\"), String::from(\"eIGHt8OKe\")]), String::from(\"Watashi.eIGHt8OKe\"));\n assert_eq!(candidate(String::from(\"Boku123\"), vec![String::from(\"nani\"), String::from(\"NazeDa\"), String::from(\"YEs.WeCaNe\"), String::from(\"32145tggg\")]), String::from(\"Boku123.YEs.WeCaNe\"));\n assert_eq!(candidate(String::from(\"__YESIMHERE\"), vec![String::from(\"t\"), String::from(\"eMptY\"), String::from(\"nothing\"), String::from(\"zeR00\"), String::from(\"NuLl__\"), String::from(\"123NoooneB321\")]), String::from(\"__YESIMHERE.NuLl__\"));\n assert_eq!(candidate(String::from(\"K\"), vec![String::from(\"Ta\"), String::from(\"TAR\"), String::from(\"t234An\"), String::from(\"cosSo\")]), String::from(\"K.TAR\"));\n assert_eq!(candidate(String::from(\"__HAHA\"), vec![String::from(\"Tab\"), String::from(\"123\"), String::from(\"781345\"), String::from(\"-_-\")]), String::from(\"__HAHA.123\"));\n assert_eq!(candidate(String::from(\"YameRore\"), vec![String::from(\"HhAas\"), String::from(\"okIWILL123\"), String::from(\"WorkOut\"), String::from(\"Fails\"), String::from(\"-_-\")]), String::from(\"YameRore.okIWILL123\"));\n assert_eq!(candidate(String::from(\"finNNalLLly\"), vec![String::from(\"Die\"), String::from(\"NowW\"), String::from(\"Wow\"), String::from(\"WoW\")]), String::from(\"finNNalLLly.WoW\"));\n assert_eq!(candidate(String::from(\"_\"), vec![String::from(\"Bb\"), String::from(\"91245\")]), String::from(\"_.Bb\"));\n assert_eq!(candidate(String::from(\"Sp\"), vec![String::from(\"671235\"), String::from(\"Bb\")]), String::from(\"Sp.671235\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "rs", - "prompt": "use std::collections::HashMap;\n\n/// Given a string representing a space separated lowercase letters, return a HashMap\n/// of the letter with the most repetition and containing the corresponding count.\n/// If several letters have the same occurrence, return all of them.\n/// Example:\n/// >>> histogram(String::from(\"a b c\"))\n/// HashMap::from([(String::from(\"a\"), 1), (String::from(\"b\"), 1), (String::from(\"c\"), 1)])\n/// >>> histogram(String::from(\"a b b a\"))\n/// HashMap::from([(String::from(\"a\"), 2), (String::from(\"b\"), 2)])\n/// >>> histogram(String::from(\"a b c a b\"))\n/// HashMap::from([(String::from(\"a\"), 2), (String::from(\"b\"), 2)])\n/// >>> histogram(String::from(\"b b b b a\"))\n/// HashMap::from([(String::from(\"b\"), 4)])\n/// >>> histogram(String::from(\"\"))\n/// HashMap::from([])\nfn histogram(test: String) -> HashMap {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = histogram;\n assert_eq!(candidate(String::from(\"a b b a\")), HashMap::from([(String::from(\"a\"), 2), (String::from(\"b\"), 2)]));\n assert_eq!(candidate(String::from(\"a b c a b\")), HashMap::from([(String::from(\"a\"), 2), (String::from(\"b\"), 2)]));\n assert_eq!(candidate(String::from(\"a b c d g\")), HashMap::from([(String::from(\"a\"), 1), (String::from(\"b\"), 1), (String::from(\"c\"), 1), (String::from(\"d\"), 1), (String::from(\"g\"), 1)]));\n assert_eq!(candidate(String::from(\"r t g\")), HashMap::from([(String::from(\"r\"), 1), (String::from(\"t\"), 1), (String::from(\"g\"), 1)]));\n assert_eq!(candidate(String::from(\"b b b b a\")), HashMap::from([(String::from(\"b\"), 4)]));\n assert_eq!(candidate(String::from(\"r t g\")), HashMap::from([(String::from(\"r\"), 1), (String::from(\"t\"), 1), (String::from(\"g\"), 1)]));\n assert_eq!(candidate(String::from(\"\")), HashMap::from([]));\n assert_eq!(candidate(String::from(\"a\")), HashMap::from([(String::from(\"a\"), 1)]));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "rs", - "prompt": "/// pairs_sum_to_zero takes a vector of integers as an input.\n/// it returns true if there are two distinct elements in the vector that\n/// sum to zero, and false otherwise.\n/// >>> pairs_sum_to_zero(vec![1, 3, 5, 0])\n/// false\n/// >>> pairs_sum_to_zero(vec![1, 3, -2, 1])\n/// false\n/// >>> pairs_sum_to_zero(vec![1, 2, 3, 7])\n/// false\n/// >>> pairs_sum_to_zero(vec![2, 4, -5, 3, 5, 7])\n/// true\n/// >>> pairs_sum_to_zero(vec![1])\n/// false\nfn pairs_sum_to_zero(l: Vec) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = pairs_sum_to_zero;\n assert_eq!(candidate(vec![1, 3, 5, 0]), false);\n assert_eq!(candidate(vec![1, 3, -2, 1]), false);\n assert_eq!(candidate(vec![1, 2, 3, 7]), false);\n assert_eq!(candidate(vec![2, 4, -5, 3, 5, 7]), true);\n assert_eq!(candidate(vec![1]), false);\n assert_eq!(candidate(vec![-3, 9, -1, 3, 2, 30]), true);\n assert_eq!(candidate(vec![-3, 9, -1, 3, 2, 31]), true);\n assert_eq!(candidate(vec![-3, 9, -1, 4, 2, 30]), false);\n assert_eq!(candidate(vec![-3, 9, -1, 4, 2, 31]), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "rs", - "prompt": "/// Write a function that accepts two vectors of strings and returns the vector that has \n/// total number of chars in the all strings of the vector less than the other vector.\n/// if the two vectors have the same number of chars, return the first vector.\n/// Examples\n/// >>> total_match(vec![], vec![])\n/// Vec::::new()\n/// >>> total_match(vec![String::from(\"hi\"), String::from(\"admin\")], vec![String::from(\"hI\"), String::from(\"Hi\")])\n/// vec![String::from(\"hI\"), String::from(\"Hi\")]\n/// >>> total_match(vec![String::from(\"hi\"), String::from(\"admin\")], vec![String::from(\"hi\"), String::from(\"hi\"), String::from(\"admin\"), String::from(\"project\")])\n/// vec![String::from(\"hi\"), String::from(\"admin\")]\n/// >>> total_match(vec![String::from(\"hi\"), String::from(\"admin\")], vec![String::from(\"hI\"), String::from(\"hi\"), String::from(\"hi\")])\n/// vec![String::from(\"hI\"), String::from(\"hi\"), String::from(\"hi\")]\n/// >>> total_match(vec![String::from(\"4\")], vec![String::from(\"1\"), String::from(\"2\"), String::from(\"3\"), String::from(\"4\"), String::from(\"5\")])\n/// vec![String::from(\"4\")]\nfn total_match(lst1: Vec, lst2: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = total_match;\n assert_eq!(candidate(Vec::::new(), Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![String::from(\"hi\"), String::from(\"admin\")], vec![String::from(\"hi\"), String::from(\"hi\")]), vec![String::from(\"hi\"), String::from(\"hi\")]);\n assert_eq!(candidate(vec![String::from(\"hi\"), String::from(\"admin\")], vec![String::from(\"hi\"), String::from(\"hi\"), String::from(\"admin\"), String::from(\"project\")]), vec![String::from(\"hi\"), String::from(\"admin\")]);\n assert_eq!(candidate(vec![String::from(\"4\")], vec![String::from(\"1\"), String::from(\"2\"), String::from(\"3\"), String::from(\"4\"), String::from(\"5\")]), vec![String::from(\"4\")]);\n assert_eq!(candidate(vec![String::from(\"hi\"), String::from(\"admin\")], vec![String::from(\"hI\"), String::from(\"Hi\")]), vec![String::from(\"hI\"), String::from(\"Hi\")]);\n assert_eq!(candidate(vec![String::from(\"hi\"), String::from(\"admin\")], vec![String::from(\"hI\"), String::from(\"hi\"), String::from(\"hi\")]), vec![String::from(\"hI\"), String::from(\"hi\"), String::from(\"hi\")]);\n assert_eq!(candidate(vec![String::from(\"hi\"), String::from(\"admin\")], vec![String::from(\"hI\"), String::from(\"hi\"), String::from(\"hii\")]), vec![String::from(\"hi\"), String::from(\"admin\")]);\n assert_eq!(candidate(Vec::::new(), vec![String::from(\"this\")]), Vec::::new());\n assert_eq!(candidate(vec![String::from(\"this\")], Vec::::new()), Vec::::new());\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "rs", - "prompt": "/// Circular shift the digits of the integer x, shift the digits right by shift\n/// and return the result as a string.\n/// If shift > number of digits, return digits reversed.\n/// >>> circular_shift(12, 1)\n/// String::from(\"21\")\n/// >>> circular_shift(12, 2)\n/// String::from(\"12\")\nfn circular_shift(x: isize, shift: isize) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = circular_shift;\n assert_eq!(candidate(100, 2), String::from(\"001\"));\n assert_eq!(candidate(12, 2), String::from(\"12\"));\n assert_eq!(candidate(97, 8), String::from(\"79\"));\n assert_eq!(candidate(12, 1), String::from(\"21\"));\n assert_eq!(candidate(11, 101), String::from(\"11\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "rs", - "prompt": "/// Return true is vector elements are monotonically increasing or decreasing.\n/// >>> monotonic(vec![1, 2, 4, 20])\n/// true\n/// >>> monotonic(vec![1, 20, 4, 10])\n/// false\n/// >>> monotonic(vec![4, 1, 0, -10])\n/// true\nfn monotonic(l: Vec) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = monotonic;\n assert_eq!(candidate(vec![1, 2, 4, 10]), true);\n assert_eq!(candidate(vec![1, 2, 4, 20]), true);\n assert_eq!(candidate(vec![1, 20, 4, 10]), false);\n assert_eq!(candidate(vec![4, 1, 0, -10]), true);\n assert_eq!(candidate(vec![4, 1, 1, 0]), true);\n assert_eq!(candidate(vec![1, 2, 3, 2, 5, 60]), false);\n assert_eq!(candidate(vec![1, 2, 3, 4, 5, 60]), true);\n assert_eq!(candidate(vec![9, 9, 9, 9]), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "rs", - "prompt": "/// Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n/// Example\n/// >>> is_equal_to_sum_even(4)\n/// false\n/// >>> is_equal_to_sum_even(6)\n/// false\n/// >>> is_equal_to_sum_even(8)\n/// true\nfn is_equal_to_sum_even(n: isize) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = is_equal_to_sum_even;\n assert_eq!(candidate(4), false);\n assert_eq!(candidate(6), false);\n assert_eq!(candidate(8), true);\n assert_eq!(candidate(10), true);\n assert_eq!(candidate(11), false);\n assert_eq!(candidate(12), true);\n assert_eq!(candidate(13), false);\n assert_eq!(candidate(16), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "rs", - "prompt": "/// Input to this function is a string representing musical notes in a special ASCII format.\n/// Your task is to parse this string and return vector of integers corresponding to how many beats does each\n/// not last.\n/// Here is a legend:\n/// 'o' - whole note, lasts four beats\n/// 'o|' - half note, lasts two beats\n/// '.|' - quater note, lasts one beat\n/// >>> parse_music(String::from(\"o o| .| o| o| .| .| .| .| o o\"))\n/// vec![4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\nfn parse_music(music_string: String) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = parse_music;\n assert_eq!(candidate(String::from(\"\")), Vec::::new());\n assert_eq!(candidate(String::from(\"o o o o\")), vec![4, 4, 4, 4]);\n assert_eq!(candidate(String::from(\".| .| .| .|\")), vec![1, 1, 1, 1]);\n assert_eq!(candidate(String::from(\"o| o| .| .| o o o o\")), vec![2, 2, 1, 1, 4, 4, 4, 4]);\n assert_eq!(candidate(String::from(\"o| .| o| .| o o| o o|\")), vec![2, 1, 2, 1, 4, 2, 4, 2]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "rs", - "prompt": "/// \"\n/// This function will take a vector of integers. For all entries in the vector, the function shall square the integer entry if its index is a \n/// multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n/// change the entries in the vector whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n/// Examples:\n/// >>> lst\n/// vec![1, 2, 3]\n/// >>> lst\n/// vec![]\n/// >>> lst\n/// vec![-1, -5, 2, -1, -5]\nfn sum_squares(lst: Vec) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = sum_squares;\n assert_eq!(candidate(vec![1, 2, 3]), 6);\n assert_eq!(candidate(vec![1, 4, 9]), 14);\n assert_eq!(candidate(Vec::::new()), 0);\n assert_eq!(candidate(vec![1, 1, 1, 1, 1, 1, 1, 1, 1]), 9);\n assert_eq!(candidate(vec![-1, -1, -1, -1, -1, -1, -1, -1, -1]), -3);\n assert_eq!(candidate(vec![0]), 0);\n assert_eq!(candidate(vec![-1, -5, 2, -1, -5]), -126);\n assert_eq!(candidate(vec![-56, -99, 1, 0, -2]), 3030);\n assert_eq!(candidate(vec![-1, 0, 0, 0, 0, 0, 0, 0, -1]), 0);\n assert_eq!(candidate(vec![-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37]), -14196);\n assert_eq!(candidate(vec![-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10]), -1448);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "rs", - "prompt": "/// triples_sum_to_zero takes a vector of integers as an input.\n/// it returns true if there are three distinct elements in the vector that\n/// sum to zero, and false otherwise.\n/// >>> triples_sum_to_zero(vec![1, 3, 5, 0])\n/// false\n/// >>> triples_sum_to_zero(vec![1, 3, -2, 1])\n/// true\n/// >>> triples_sum_to_zero(vec![1, 2, 3, 7])\n/// false\n/// >>> triples_sum_to_zero(vec![2, 4, -5, 3, 9, 7])\n/// true\n/// >>> triples_sum_to_zero(vec![1])\n/// false\nfn triples_sum_to_zero(l: Vec) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = triples_sum_to_zero;\n assert_eq!(candidate(vec![1, 3, 5, 0]), false);\n assert_eq!(candidate(vec![1, 3, 5, -1]), false);\n assert_eq!(candidate(vec![1, 3, -2, 1]), true);\n assert_eq!(candidate(vec![1, 2, 3, 7]), false);\n assert_eq!(candidate(vec![1, 2, 5, 7]), false);\n assert_eq!(candidate(vec![2, 4, -5, 3, 9, 7]), true);\n assert_eq!(candidate(vec![1]), false);\n assert_eq!(candidate(vec![1, 3, 5, -100]), false);\n assert_eq!(candidate(vec![100, 3, 5, -100]), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "rs", - "prompt": "/// brackets is a string of \"<\" and \">\".\n/// return true if every opening bracket has a corresponding closing bracket.\n/// >>> correct_bracketing(String::from(\"<\"))\n/// false\n/// >>> correct_bracketing(String::from(\"<>\"))\n/// true\n/// >>> correct_bracketing(String::from(\"<<><>>\"))\n/// true\n/// >>> correct_bracketing(String::from(\"><<>\"))\n/// false\nfn correct_bracketing(brackets: String) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = correct_bracketing;\n assert_eq!(candidate(String::from(\"<>\")), true);\n assert_eq!(candidate(String::from(\"<<><>>\")), true);\n assert_eq!(candidate(String::from(\"<><><<><>><>\")), true);\n assert_eq!(candidate(String::from(\"<><><<<><><>><>><<><><<>>>\")), true);\n assert_eq!(candidate(String::from(\"<<<><>>>>\")), false);\n assert_eq!(candidate(String::from(\"><<>\")), false);\n assert_eq!(candidate(String::from(\"<\")), false);\n assert_eq!(candidate(String::from(\"<<<<\")), false);\n assert_eq!(candidate(String::from(\">\")), false);\n assert_eq!(candidate(String::from(\"<<>\")), false);\n assert_eq!(candidate(String::from(\"<><><<><>><>><<>\")), false);\n assert_eq!(candidate(String::from(\"<><><<><>><>>><>\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "rs", - "prompt": "/// Write a function that takes a vector of numbers as input and returns \n/// the number of elements in the vector that are greater than 10 and both \n/// first and last digits of a number are odd (1, 3, 5, 7, 9).\n/// For example:\n/// >>> specialFilter(vec![15, -73, 14, -15])\n/// 1\n/// >>> specialFilter(vec![33, -2, -3, 45, 21, 109])\n/// 2\nfn specialFilter(nums: Vec) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = specialFilter;\n assert_eq!(candidate(vec![5, -2, 1, -5]), 0);\n assert_eq!(candidate(vec![15, -73, 14, -15]), 1);\n assert_eq!(candidate(vec![33, -2, -3, 45, 21, 109]), 2);\n assert_eq!(candidate(vec![43, -12, 93, 125, 121, 109]), 4);\n assert_eq!(candidate(vec![71, -2, -33, 75, 21, 19]), 3);\n assert_eq!(candidate(vec![1]), 0);\n assert_eq!(candidate(Vec::::new()), 0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "rs", - "prompt": "use std::collections::HashMap;\n\n/// Given a HashMap, return true if all keys are strings in lower \n/// case or all keys are strings in upper case, else return false.\n/// The function should return false is the given HashMap is empty.\n/// Examples:\n/// >>> check_dict_case(HashMap::from([(String::from(\"a\"), String::from(\"apple\")), (String::from(\"b\"), String::from(\"banana\"))]))\n/// true\n/// >>> check_dict_case(HashMap::from([(String::from(\"a\"), String::from(\"apple\")), (String::from(\"A\"), String::from(\"banana\")), (String::from(\"B\"), String::from(\"banana\"))]))\n/// false\n/// >>> check_dict_case(HashMap::from([(String::from(\"a\"), String::from(\"apple\")), (8, String::from(\"banana\")), (String::from(\"a\"), String::from(\"apple\"))]))\n/// false\n/// >>> check_dict_case(HashMap::from([(String::from(\"Name\"), String::from(\"John\")), (String::from(\"Age\"), String::from(\"36\")), (String::from(\"City\"), String::from(\"Houston\"))]))\n/// false\n/// >>> check_dict_case(HashMap::from([(String::from(\"STATE\"), String::from(\"NC\")), (String::from(\"ZIP\"), String::from(\"12345\"))]))\n/// true\nfn check_dict_case(dict: HashMap) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = check_dict_case;\n assert_eq!(candidate(HashMap::from([(String::from(\"p\"), String::from(\"pineapple\")), (String::from(\"b\"), String::from(\"banana\"))])), true);\n assert_eq!(candidate(HashMap::from([(String::from(\"p\"), String::from(\"pineapple\")), (String::from(\"A\"), String::from(\"banana\")), (String::from(\"B\"), String::from(\"banana\"))])), false);\n assert_eq!(candidate(HashMap::from([(String::from(\"p\"), String::from(\"pineapple\")), (String::from(\"5\"), String::from(\"banana\")), (String::from(\"a\"), String::from(\"apple\"))])), false);\n assert_eq!(candidate(HashMap::from([(String::from(\"Name\"), String::from(\"John\")), (String::from(\"Age\"), String::from(\"36\")), (String::from(\"City\"), String::from(\"Houston\"))])), false);\n assert_eq!(candidate(HashMap::from([(String::from(\"STATE\"), String::from(\"NC\")), (String::from(\"ZIP\"), String::from(\"12345\"))])), true);\n assert_eq!(candidate(HashMap::from([(String::from(\"fruit\"), String::from(\"Orange\")), (String::from(\"taste\"), String::from(\"Sweet\"))])), true);\n assert_eq!(candidate(HashMap::from([])), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "rs", - "prompt": "/// The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n/// fibfib(0) == 0\n/// fibfib(1) == 0\n/// fibfib(2) == 1\n/// fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n/// Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n/// >>> fibfib(1)\n/// 0\n/// >>> fibfib(5)\n/// 4\n/// >>> fibfib(8)\n/// 24\nfn fibfib(n: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = fibfib;\n assert_eq!(candidate(2), 1);\n assert_eq!(candidate(1), 0);\n assert_eq!(candidate(5), 4);\n assert_eq!(candidate(8), 24);\n assert_eq!(candidate(10), 81);\n assert_eq!(candidate(12), 274);\n assert_eq!(candidate(14), 927);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "rs", - "prompt": "/// You are given a vector of numbers.\n/// You need to return the sum of squared numbers in the given vector,\n/// round each element in the vector to the upper int(Ceiling) first.\n/// Examples:\n/// >>> lst(vec![1.0, 2.0, 3.0])\n/// 14\n/// >>> lst(vec![1.0, 4.0, 9.0])\n/// 98\n/// >>> lst(vec![1.0, 3.0, 5.0, 7.0])\n/// 84\n/// >>> lst(vec![1.4, 4.2, 0.0])\n/// 29\n/// >>> lst(vec![-2.4, 1.0, 1.0])\n/// 6\nfn sum_squares(lst: Vec) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = sum_squares;\n assert_eq!(candidate(vec![1.0, 2.0, 3.0]), 14);\n assert_eq!(candidate(vec![1.0, 2.0, 3.0]), 14);\n assert_eq!(candidate(vec![1.0, 3.0, 5.0, 7.0]), 84);\n assert_eq!(candidate(vec![1.4, 4.2, 0.0]), 29);\n assert_eq!(candidate(vec![-2.4, 1.0, 1.0]), 6);\n assert_eq!(candidate(vec![100.0, 1.0, 15.0, 2.0]), 10230);\n assert_eq!(candidate(vec![10000.0, 10000.0]), 200000000);\n assert_eq!(candidate(vec![-1.4, 4.6, 6.3]), 75);\n assert_eq!(candidate(vec![-1.4, 17.9, 18.9, 19.9]), 1086);\n assert_eq!(candidate(vec![0.0]), 0);\n assert_eq!(candidate(vec![-1.0]), 1);\n assert_eq!(candidate(vec![-1.0, 1.0, 0.0]), 2);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_85_add", - "language": "rs", - "prompt": "/// Given a non-empty vector of integers lst. add the even elements that are at odd indices..\n/// Examples:\n/// >>> add(vec![4, 2, 6, 7])\n/// 2\nfn add(lst: Vec) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = add;\n assert_eq!(candidate(vec![4, 88]), 88);\n assert_eq!(candidate(vec![4, 5, 6, 7, 2, 122]), 122);\n assert_eq!(candidate(vec![4, 0, 6, 7]), 0);\n assert_eq!(candidate(vec![4, 4, 6, 8]), 12);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "rs", - "prompt": "/// Return sorted unique elements in a vector\n/// >>> unique(vec![5, 3, 5, 2, 3, 3, 9, 0, 123])\n/// vec![0, 2, 3, 5, 9, 123]\nfn unique(l: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = unique;\n assert_eq!(candidate(vec![5, 3, 5, 2, 3, 3, 9, 0, 123]), vec![0, 2, 3, 5, 9, 123]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "rs", - "prompt": "/// Given a string text, replace all spaces in it with underscores, \n/// and if a string has more than 2 consecutive spaces, \n/// then replace all consecutive spaces with - \n/// >>> fix_spaces(String::from(\" Example\"))\n/// String::from(\"Example\")\n/// >>> fix_spaces(String::from(\" Example 1\"))\n/// String::from(\"Example_1\")\n/// >>> fix_spaces(String::from(\" Example 2\"))\n/// String::from(\"_Example_2\")\n/// >>> fix_spaces(String::from(\" Example 3\"))\n/// String::from(\"_Example-3\")\nfn fix_spaces(text: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = fix_spaces;\n assert_eq!(candidate(String::from(\"Example\")), String::from(\"Example\"));\n assert_eq!(candidate(String::from(\"Mudasir Hanif \")), String::from(\"Mudasir_Hanif_\"));\n assert_eq!(candidate(String::from(\"Yellow Yellow Dirty Fellow\")), String::from(\"Yellow_Yellow__Dirty__Fellow\"));\n assert_eq!(candidate(String::from(\"Exa mple\")), String::from(\"Exa-mple\"));\n assert_eq!(candidate(String::from(\" Exa 1 2 2 mple\")), String::from(\"-Exa_1_2_2_mple\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "rs", - "prompt": "/// Return 2^n modulo p (be aware of numerics).\n/// >>> modp(3, 5)\n/// 3\n/// >>> modp(1101, 101)\n/// 2\n/// >>> modp(0, 101)\n/// 1\n/// >>> modp(3, 11)\n/// 8\n/// >>> modp(100, 101)\n/// 1\nfn modp(n: isize, p: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = modp;\n assert_eq!(candidate(3, 5), 3);\n assert_eq!(candidate(1101, 101), 2);\n assert_eq!(candidate(0, 101), 1);\n assert_eq!(candidate(3, 11), 8);\n assert_eq!(candidate(100, 101), 1);\n assert_eq!(candidate(30, 5), 4);\n assert_eq!(candidate(31, 5), 3);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "rs", - "prompt": "/// You have to write a function which validates a given date string and\n/// returns true if the date is valid otherwise false.\n/// The date is valid if all of the following rules are satisfied:\n/// 1. The date string is not empty.\n/// 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n/// 3. The months should not be less than 1 or higher than 12.\n/// 4. The date should be in the format: mm-dd-yyyy\n/// >>> valid_date(String::from(\"03-11-2000\"))\n/// true\n/// >>> valid_date(String::from(\"15-01-2012\"))\n/// false\n/// >>> valid_date(String::from(\"04-0-2040\"))\n/// false\n/// >>> valid_date(String::from(\"06-04-2020\"))\n/// true\n/// >>> valid_date(String::from(\"06/04/2020\"))\n/// false\nfn valid_date(date: String) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = valid_date;\n assert_eq!(candidate(String::from(\"03-11-2000\")), true);\n assert_eq!(candidate(String::from(\"15-01-2012\")), false);\n assert_eq!(candidate(String::from(\"04-0-2040\")), false);\n assert_eq!(candidate(String::from(\"06-04-2020\")), true);\n assert_eq!(candidate(String::from(\"01-01-2007\")), true);\n assert_eq!(candidate(String::from(\"03-32-2011\")), false);\n assert_eq!(candidate(String::from(\"\")), false);\n assert_eq!(candidate(String::from(\"04-31-3000\")), false);\n assert_eq!(candidate(String::from(\"06-06-2005\")), true);\n assert_eq!(candidate(String::from(\"21-31-2000\")), false);\n assert_eq!(candidate(String::from(\"04-12-2003\")), true);\n assert_eq!(candidate(String::from(\"04122003\")), false);\n assert_eq!(candidate(String::from(\"20030412\")), false);\n assert_eq!(candidate(String::from(\"2003-04\")), false);\n assert_eq!(candidate(String::from(\"2003-04-12\")), false);\n assert_eq!(candidate(String::from(\"04-2003\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "rs", - "prompt": "/// Write a function that takes a string and returns an ordered version of it.\n/// Ordered version of string, is a string where all words (separated by space)\n/// are replaced by a new word where all the characters arranged in\n/// ascending order based on ascii value.\n/// Note: You should keep the order of words and blank spaces in the sentence.\n/// For example:\n/// >>> anti_shuffle(String::from(\"Hi\"))\n/// String::from(\"Hi\")\n/// >>> anti_shuffle(String::from(\"hello\"))\n/// String::from(\"ehllo\")\n/// >>> anti_shuffle(String::from(\"Hello World!!!\"))\n/// String::from(\"Hello !!!Wdlor\")\nfn anti_shuffle(s: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = anti_shuffle;\n assert_eq!(candidate(String::from(\"Hi\")), String::from(\"Hi\"));\n assert_eq!(candidate(String::from(\"hello\")), String::from(\"ehllo\"));\n assert_eq!(candidate(String::from(\"number\")), String::from(\"bemnru\"));\n assert_eq!(candidate(String::from(\"abcd\")), String::from(\"abcd\"));\n assert_eq!(candidate(String::from(\"Hello World!!!\")), String::from(\"Hello !!!Wdlor\"));\n assert_eq!(candidate(String::from(\"\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"Hi. My name is Mister Robot. How are you?\")), String::from(\".Hi My aemn is Meirst .Rboot How aer ?ouy\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "rs", - "prompt": "/// Given a vector of numbers, return whether or not they are sorted\n/// in ascending order. If vector has more than 1 duplicate of the same\n/// number, return false. Assume no negative numbers and only integers.\n/// Examples\n/// >>> is_sorted(vec![5])\n/// true\n/// >>> is_sorted(vec![1, 2, 3, 4, 5])\n/// true\n/// >>> is_sorted(vec![1, 3, 2, 4, 5])\n/// false\n/// >>> is_sorted(vec![1, 2, 3, 4, 5, 6])\n/// true\n/// >>> is_sorted(vec![1, 2, 3, 4, 5, 6, 7])\n/// true\n/// >>> is_sorted(vec![1, 3, 2, 4, 5, 6, 7])\n/// false\n/// >>> is_sorted(vec![1, 2, 2, 3, 3, 4])\n/// true\n/// >>> is_sorted(vec![1, 2, 2, 2, 3, 4])\n/// false\nfn is_sorted(lst: Vec) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = is_sorted;\n assert_eq!(candidate(vec![5]), true);\n assert_eq!(candidate(vec![1, 2, 3, 4, 5]), true);\n assert_eq!(candidate(vec![1, 3, 2, 4, 5]), false);\n assert_eq!(candidate(vec![1, 2, 3, 4, 5, 6]), true);\n assert_eq!(candidate(vec![1, 2, 3, 4, 5, 6, 7]), true);\n assert_eq!(candidate(vec![1, 3, 2, 4, 5, 6, 7]), false);\n assert_eq!(candidate(Vec::::new()), true);\n assert_eq!(candidate(vec![1]), true);\n assert_eq!(candidate(vec![3, 2, 1]), false);\n assert_eq!(candidate(vec![1, 2, 2, 2, 3, 4]), false);\n assert_eq!(candidate(vec![1, 2, 3, 3, 3, 4]), false);\n assert_eq!(candidate(vec![1, 2, 2, 3, 3, 4]), true);\n assert_eq!(candidate(vec![1, 2, 3, 4]), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "rs", - "prompt": "/// You are given a string s.\n/// Your task is to check if the string is haprs or not.\n/// A string is haprs if its length is at least 3 and every 3 consecutive letters are distinct\n/// For example:\n/// >>> is_happy(String::from(\"a\"))\n/// false\n/// >>> is_happy(String::from(\"aa\"))\n/// false\n/// >>> is_happy(String::from(\"abcd\"))\n/// true\n/// >>> is_happy(String::from(\"aabb\"))\n/// false\n/// >>> is_happy(String::from(\"adb\"))\n/// true\n/// >>> is_happy(String::from(\"xyy\"))\n/// false\nfn is_happy(s: String) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = is_happy;\n assert_eq!(candidate(String::from(\"a\")), false);\n assert_eq!(candidate(String::from(\"aa\")), false);\n assert_eq!(candidate(String::from(\"abcd\")), true);\n assert_eq!(candidate(String::from(\"aabb\")), false);\n assert_eq!(candidate(String::from(\"adb\")), true);\n assert_eq!(candidate(String::from(\"xyy\")), false);\n assert_eq!(candidate(String::from(\"iopaxpoi\")), true);\n assert_eq!(candidate(String::from(\"iopaxioi\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "rs", - "prompt": "/// Write a function that returns true if the object q will fly, and false otherwise.\n/// The object q will fly if it's balanced (it is a palindromic vector) and the sum of its elements is less than or equal the maximum possible weight w.\n/// Example:\n/// >>> will_it_fly(vec![1, 2], 5)\n/// false\n/// # 1+2 is less than the maximum possible weight, but it's unbalanced.\n/// >>> will_it_fly(vec![3, 2, 3], 1)\n/// false\n/// # it's balanced, but 3+2+3 is more than the maximum possible weight.\n/// >>> will_it_fly(vec![3, 2, 3], 9)\n/// true\n/// # 3+2+3 is less than the maximum possible weight, and it's balanced.\n/// >>> will_it_fly(vec![3], 5)\n/// true\n/// # 3 is less than the maximum possible weight, and it's balanced.\nfn will_it_fly(q: Vec, w: isize) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = will_it_fly;\n assert_eq!(candidate(vec![3, 2, 3], 9), true);\n assert_eq!(candidate(vec![1, 2], 5), false);\n assert_eq!(candidate(vec![3], 5), true);\n assert_eq!(candidate(vec![3, 2, 3], 1), false);\n assert_eq!(candidate(vec![1, 2, 3], 6), false);\n assert_eq!(candidate(vec![5], 5), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "rs", - "prompt": "/// Given a vector of non-negative integers, return a cors of the given vector after sorting,\n/// you will sort the given vector in ascending order if the sum( first index value, last index value) is odd,\n/// or sort it in descending order if the sum( first index value, last index value) is even.\n/// Note:\n/// * don't change the given vector.\n/// Examples:\n/// >>> sort_array(vec![])\n/// Vec::::new()\n/// >>> sort_array(vec![5])\n/// vec![5]\n/// >>> sort_array(vec![2, 4, 3, 0, 1, 5])\n/// vec![0, 1, 2, 3, 4, 5]\n/// >>> sort_array(vec![2, 4, 3, 0, 1, 5, 6])\n/// vec![6, 5, 4, 3, 2, 1, 0]\nfn sort_array(array: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = sort_array;\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![5]), vec![5]);\n assert_eq!(candidate(vec![2, 4, 3, 0, 1, 5]), vec![0, 1, 2, 3, 4, 5]);\n assert_eq!(candidate(vec![2, 4, 3, 0, 1, 5, 6]), vec![6, 5, 4, 3, 2, 1, 0]);\n assert_eq!(candidate(vec![2, 1]), vec![1, 2]);\n assert_eq!(candidate(vec![15, 42, 87, 32, 11, 0]), vec![0, 11, 15, 32, 42, 87]);\n assert_eq!(candidate(vec![21, 14, 23, 11]), vec![23, 21, 14, 11]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "rs", - "prompt": "/// Implement a function that takes an non-negative integer and returns a vector of the first n\n/// integers that are prime numbers and less than n.\n/// for example:\n/// >>> count_up_to(5)\n/// vec![2, 3]\n/// >>> count_up_to(11)\n/// vec![2, 3, 5, 7]\n/// >>> count_up_to(0)\n/// Vec::::new()\n/// >>> count_up_to(20)\n/// vec![2, 3, 5, 7, 11, 13, 17, 19]\n/// >>> count_up_to(1)\n/// Vec::::new()\n/// >>> count_up_to(18)\n/// vec![2, 3, 5, 7, 11, 13, 17]\nfn count_up_to(n: isize) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = count_up_to;\n assert_eq!(candidate(5), vec![2, 3]);\n assert_eq!(candidate(6), vec![2, 3, 5]);\n assert_eq!(candidate(7), vec![2, 3, 5]);\n assert_eq!(candidate(10), vec![2, 3, 5, 7]);\n assert_eq!(candidate(0), Vec::::new());\n assert_eq!(candidate(22), vec![2, 3, 5, 7, 11, 13, 17, 19]);\n assert_eq!(candidate(1), Vec::::new());\n assert_eq!(candidate(18), vec![2, 3, 5, 7, 11, 13, 17]);\n assert_eq!(candidate(47), vec![2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43]);\n assert_eq!(candidate(101), vec![2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "rs", - "prompt": "/// Out of vector of strings, return the longest one. Return the first one in case of multiple\n/// strings of the same length. Return None in case the input vector is empty.\n/// >>> longest(vec![])\n/// None\n/// >>> longest(vec![String::from(\"a\"), String::from(\"b\"), String::from(\"c\")])\n/// Some(String::from(\"a\"))\n/// >>> longest(vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")])\n/// Some(String::from(\"ccc\"))\nfn longest(strings: Vec) -> Option {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = longest;\n assert_eq!(candidate(Vec::::new()), None);\n assert_eq!(candidate(vec![String::from(\"x\"), String::from(\"y\"), String::from(\"z\")]), Some(String::from(\"x\")));\n assert_eq!(candidate(vec![String::from(\"x\"), String::from(\"yyy\"), String::from(\"zzzz\"), String::from(\"www\"), String::from(\"kkkk\"), String::from(\"abc\")]), Some(String::from(\"zzzz\")));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "rs", - "prompt": "/// Given a vector of integers, sort the integers that are between 1 and 9 inclusive,\n/// reverse the resulting vector, and then replace each digit by its corresponding name from\n/// \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n/// For example:\n/// >>> by_length(vec![2, 1, 1, 4, 5, 8, 2, 3])\n/// vec![String::from(\"Eight\"), String::from(\"Five\"), String::from(\"Four\"), String::from(\"Three\"), String::from(\"Two\"), String::from(\"Two\"), String::from(\"One\"), String::from(\"One\")]\n/// If the vector is empty, return an empty vector:\n/// >>> by_length(vec![])\n/// Vec::::new()\n/// If the vector has any strange number ignore it:\n/// >>> by_length(vec![1, -1, 55])\n/// vec![String::from(\"One\")]\nfn by_length(arr: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = by_length;\n assert_eq!(candidate(vec![2, 1, 1, 4, 5, 8, 2, 3]), vec![String::from(\"Eight\"), String::from(\"Five\"), String::from(\"Four\"), String::from(\"Three\"), String::from(\"Two\"), String::from(\"Two\"), String::from(\"One\"), String::from(\"One\")]);\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![1, -1, 55]), vec![String::from(\"One\")]);\n assert_eq!(candidate(vec![1, -1, 3, 2]), vec![String::from(\"Three\"), String::from(\"Two\"), String::from(\"One\")]);\n assert_eq!(candidate(vec![9, 4, 8]), vec![String::from(\"Nine\"), String::from(\"Eight\"), String::from(\"Four\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_106_f", - "language": "rs", - "prompt": "/// Implement the function f that takes n as a parameter,\n/// and returns a vector of size n, such that the value of the element at index i is the factorial of i if i is even\n/// or the sum of numbers from 1 to i otherwise.\n/// i starts from 1.\n/// the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n/// Example:\n/// >>> f(5)\n/// vec![1, 2, 6, 24, 15]\nfn f(n: isize) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = f;\n assert_eq!(candidate(5), vec![1, 2, 6, 24, 15]);\n assert_eq!(candidate(7), vec![1, 2, 6, 24, 15, 720, 28]);\n assert_eq!(candidate(1), vec![1]);\n assert_eq!(candidate(3), vec![1, 2, 6]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "rs", - "prompt": "/// Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n/// >>> fizz_buzz(50)\n/// 0\n/// >>> fizz_buzz(78)\n/// 2\n/// >>> fizz_buzz(79)\n/// 3\nfn fizz_buzz(n: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = fizz_buzz;\n assert_eq!(candidate(50), 0);\n assert_eq!(candidate(78), 2);\n assert_eq!(candidate(79), 3);\n assert_eq!(candidate(100), 3);\n assert_eq!(candidate(200), 6);\n assert_eq!(candidate(4000), 192);\n assert_eq!(candidate(10000), 639);\n assert_eq!(candidate(100000), 8026);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "rs", - "prompt": "/// Given a positive floating point number, it can be decomposed into\n/// and integer part (largest integer smaller than given number) and decimals\n/// (leftover part always smaller than 1).\n/// Return the decimal part of the number.\n/// >>> truncate_number(3.5)\n/// 0.5\nfn truncate_number(number: f64) -> f64 {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = truncate_number;\n assert_eq!(candidate(3.5), 0.5);\n assert_eq!(candidate(1.25), 0.25);\n assert_eq!(candidate(123.0), 0.0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "rs", - "prompt": "/// For a given vector of integers, return a tuple consisting of a sum and a product of all the integers in a vector.\n/// Empty sum should be equal to 0 and empty product should be equal to 1.\n/// >>> sum_product(vec![])\n/// (0, 1)\n/// >>> sum_product(vec![1, 2, 3, 4])\n/// (10, 24)\nfn sum_product(numbers: Vec) -> (isize, isize) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = sum_product;\n assert_eq!(candidate(Vec::::new()), (0, 1));\n assert_eq!(candidate(vec![1, 1, 1]), (3, 1));\n assert_eq!(candidate(vec![100, 0]), (100, 0));\n assert_eq!(candidate(vec![3, 5, 7]), (15, 105));\n assert_eq!(candidate(vec![10]), (10, 10));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "rs", - "prompt": "/// You are given a 2 dimensional data, as a nested vectors,\n/// which is similar to matrix, however, unlike matrices,\n/// each row may contain a different number of columns.\n/// Given lst, and integer x, find integers x in the vector,\n/// and return vector of tuples, [(x1, y1), (x2, y2) ...] such that\n/// each tuple is a coordinate - (row, columns), starting with 0.\n/// Sort coordinates initially by rows in ascending order.\n/// Also, sort coordinates of the row by columns in descending order.\n/// Examples:\n/// >>> get_row(vec![vec![1, 2, 3, 4, 5, 6], vec![1, 2, 3, 4, 1, 6], vec![1, 2, 3, 4, 5, 1]], 1)\n/// vec![(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n/// >>> get_row(vec![], 1)\n/// Vec::<(isize, isize)>::new()\n/// >>> get_row(vec![vec![], vec![1], vec![1, 2, 3]], 3)\n/// vec![(2, 2)]\nfn get_row(lst: Vec>, x: isize) -> Vec<(isize, isize)> {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = get_row;\n assert_eq!(candidate(vec![vec![1, 2, 3, 4, 5, 6], vec![1, 2, 3, 4, 1, 6], vec![1, 2, 3, 4, 5, 1]], 1), vec![(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]);\n assert_eq!(candidate(vec![vec![1, 2, 3, 4, 5, 6], vec![1, 2, 3, 4, 5, 6], vec![1, 2, 3, 4, 5, 6], vec![1, 2, 3, 4, 5, 6], vec![1, 2, 3, 4, 5, 6], vec![1, 2, 3, 4, 5, 6]], 2), vec![(0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1)]);\n assert_eq!(candidate(vec![vec![1, 2, 3, 4, 5, 6], vec![1, 2, 3, 4, 5, 6], vec![1, 1, 3, 4, 5, 6], vec![1, 2, 1, 4, 5, 6], vec![1, 2, 3, 1, 5, 6], vec![1, 2, 3, 4, 1, 6], vec![1, 2, 3, 4, 5, 1]], 1), vec![(0, 0), (1, 0), (2, 1), (2, 0), (3, 2), (3, 0), (4, 3), (4, 0), (5, 4), (5, 0), (6, 5), (6, 0)]);\n assert_eq!(candidate(Vec::>::new(), 1), Vec::<(isize, isize)>::new());\n assert_eq!(candidate(vec![vec![1]], 2), Vec::<(isize, isize)>::new());\n assert_eq!(candidate(vec![vec![], vec![1], vec![1, 2, 3]], 3), vec![(2, 2)]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "rs", - "prompt": "/// You're a hungry rabbit, and you already have eaten a certain number of carrots,\n/// but now you need to eat more carrots to complete the day's meals.\n/// you should return a vector of [ total number of eaten carrots after your meals,\n/// the number of carrots left after your meals ]\n/// if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n/// Example:\n/// >>> eat(5, 6, 10)\n/// vec![11, 4]\n/// >>> eat(4, 8, 9)\n/// vec![12, 1]\n/// >>> eat(1, 10, 10)\n/// vec![11, 0]\n/// >>> eat(2, 11, 5)\n/// vec![7, 0]\n/// Variables:\n/// @number : integer\n/// the number of carrots that you have eaten.\n/// @need : integer\n/// the number of carrots that you need to eat.\n/// @remaining : integer\n/// the number of remaining carrots thet exist in stock\n/// Constrain:\n/// * 0 <= number <= 1000\n/// * 0 <= need <= 1000\n/// * 0 <= remaining <= 1000\n/// Have fun :)\nfn eat(number: isize, need: isize, remaining: isize) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = eat;\n assert_eq!(candidate(5, 6, 10), vec![11, 4]);\n assert_eq!(candidate(4, 8, 9), vec![12, 1]);\n assert_eq!(candidate(1, 10, 10), vec![11, 0]);\n assert_eq!(candidate(2, 11, 5), vec![7, 0]);\n assert_eq!(candidate(4, 5, 7), vec![9, 2]);\n assert_eq!(candidate(4, 5, 1), vec![5, 0]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "rs", - "prompt": "/// Given a positive integer N, return the total sum of its digits in binary.\n/// Example\n/// >>> solve(1000)\n/// String::from(\"1\")\n/// >>> solve(150)\n/// String::from(\"110\")\n/// >>> solve(147)\n/// String::from(\"1100\")\n/// Variables:\n/// @N integer\n/// Constraints: 0 \u2264 N \u2264 10000.\n/// Output:\n/// a string of binary number\nfn solve(N: isize) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = solve;\n assert_eq!(candidate(1000), String::from(\"1\"));\n assert_eq!(candidate(150), String::from(\"110\"));\n assert_eq!(candidate(147), String::from(\"1100\"));\n assert_eq!(candidate(333), String::from(\"1001\"));\n assert_eq!(candidate(963), String::from(\"10010\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "rs", - "prompt": "/// You are given a vector of integers.\n/// You need to find the largest prime value and return the sum of its digits.\n/// Examples:\n/// >>> skjkasdkd(vec![0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3])\n/// 10\n/// >>> skjkasdkd(vec![1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1])\n/// 25\n/// >>> skjkasdkd(vec![1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3])\n/// 13\n/// >>> skjkasdkd(vec![0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6])\n/// 11\n/// >>> skjkasdkd(vec![0, 81, 12, 3, 1, 21])\n/// 3\n/// >>> skjkasdkd(vec![0, 8, 1, 2, 1, 7])\n/// 7\nfn skjkasdkd(lst: Vec) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = skjkasdkd;\n assert_eq!(candidate(vec![0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]), 10);\n assert_eq!(candidate(vec![1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]), 25);\n assert_eq!(candidate(vec![1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]), 13);\n assert_eq!(candidate(vec![0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]), 11);\n assert_eq!(candidate(vec![0, 81, 12, 3, 1, 21]), 3);\n assert_eq!(candidate(vec![0, 8, 1, 2, 1, 7]), 7);\n assert_eq!(candidate(vec![8191]), 19);\n assert_eq!(candidate(vec![8191, 123456, 127, 7]), 19);\n assert_eq!(candidate(vec![127, 97, 8192]), 10);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "rs", - "prompt": "/// Given a vector arr of integers, find the minimum number of elements that\n/// need to be changed to make the vector palindromic. A palindromic vector is a vector that\n/// is read the same backwards and forwards. In one change, you can change one element to any other element.\n/// For example:\n/// >>> smallest_change(vec![1, 2, 3, 5, 4, 7, 9, 6])\n/// 4\n/// >>> smallest_change(vec![1, 2, 3, 4, 3, 2, 2])\n/// 1\n/// >>> smallest_change(vec![1, 2, 3, 2, 1])\n/// 0\nfn smallest_change(arr: Vec) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = smallest_change;\n assert_eq!(candidate(vec![1, 2, 3, 5, 4, 7, 9, 6]), 4);\n assert_eq!(candidate(vec![1, 2, 3, 4, 3, 2, 2]), 1);\n assert_eq!(candidate(vec![1, 4, 2]), 1);\n assert_eq!(candidate(vec![1, 4, 4, 2]), 1);\n assert_eq!(candidate(vec![1, 2, 3, 2, 1]), 0);\n assert_eq!(candidate(vec![3, 1, 1, 3]), 0);\n assert_eq!(candidate(vec![1]), 0);\n assert_eq!(candidate(vec![0, 1]), 1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "rs", - "prompt": "/// It is the last week of the semester and the teacher has to give the grades\n/// to students. The teacher has been making her own algorithm for grading.\n/// The only problem is, she has lost the code she used for grading.\n/// She has given you a vector of GPAs for some students and you have to write \n/// a function that can output a vector of letter grades using the following table:\n/// GPA | Letter grade\n/// 4.0 A+\n/// > 3.7 A \n/// > 3.3 A- \n/// > 3.0 B+\n/// > 2.7 B \n/// > 2.3 B-\n/// > 2.0 C+\n/// > 1.7 C\n/// > 1.3 C-\n/// > 1.0 D+ \n/// > 0.7 D \n/// > 0.0 D-\n/// 0.0 E\n/// Example:\n/// >>> grade_equation(vec![4.0, 3, 1.7, 2, 3.5])\n/// vec![String::from(\"A+\"), String::from(\"B\"), String::from(\"C-\"), String::from(\"C\"), String::from(\"A-\")]\nfn numerical_letter_grade(grades: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = numerical_letter_grade;\n assert_eq!(candidate(vec![4.0, 3.0, 1.7, 2.0, 3.5]), vec![String::from(\"A+\"), String::from(\"B\"), String::from(\"C-\"), String::from(\"C\"), String::from(\"A-\")]);\n assert_eq!(candidate(vec![1.2]), vec![String::from(\"D+\")]);\n assert_eq!(candidate(vec![0.5]), vec![String::from(\"D-\")]);\n assert_eq!(candidate(vec![0.0]), vec![String::from(\"E\")]);\n assert_eq!(candidate(vec![1.0, 0.3, 1.5, 2.8, 3.3]), vec![String::from(\"D\"), String::from(\"D-\"), String::from(\"C-\"), String::from(\"B\"), String::from(\"B+\")]);\n assert_eq!(candidate(vec![0.0, 0.7]), vec![String::from(\"E\"), String::from(\"D-\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "rs", - "prompt": "/// Given the lengths of the three sides of a triangle. Return the area of\n/// the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n/// Otherwise return -1\n/// Three sides make a valid triangle when the sum of any two sides is greater \n/// than the third side.\n/// Example:\n/// >>> triangle_area(3, 4, 5)\n/// 6.0\n/// >>> triangle_area(1, 2, 10)\n/// -1.0\nfn triangle_area(a: isize, b: isize, c: isize) -> f64 {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = triangle_area;\n assert_eq!(candidate(3, 4, 5), 6.0);\n assert_eq!(candidate(1, 2, 10), -1.0);\n assert_eq!(candidate(4, 8, 5), 8.18);\n assert_eq!(candidate(2, 2, 2), 1.73);\n assert_eq!(candidate(1, 2, 3), -1.0);\n assert_eq!(candidate(10, 5, 7), 16.25);\n assert_eq!(candidate(2, 6, 3), -1.0);\n assert_eq!(candidate(1, 1, 1), 0.43);\n assert_eq!(candidate(2, 2, 10), -1.0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "rs", - "prompt": "/// Check if two words have the same characters.\n/// >>> same_chars(String::from(\"eabcdzzzz\"), String::from(\"dddzzzzzzzddeddabc\"))\n/// true\n/// >>> same_chars(String::from(\"abcd\"), String::from(\"dddddddabc\"))\n/// true\n/// >>> same_chars(String::from(\"dddddddabc\"), String::from(\"abcd\"))\n/// true\n/// >>> same_chars(String::from(\"eabcd\"), String::from(\"dddddddabc\"))\n/// false\n/// >>> same_chars(String::from(\"abcd\"), String::from(\"dddddddabce\"))\n/// false\n/// >>> same_chars(String::from(\"eabcdzzzz\"), String::from(\"dddzzzzzzzddddabc\"))\n/// false\nfn same_chars(s0: String, s1: String) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = same_chars;\n assert_eq!(candidate(String::from(\"eabcdzzzz\"), String::from(\"dddzzzzzzzddeddabc\")), true);\n assert_eq!(candidate(String::from(\"abcd\"), String::from(\"dddddddabc\")), true);\n assert_eq!(candidate(String::from(\"dddddddabc\"), String::from(\"abcd\")), true);\n assert_eq!(candidate(String::from(\"eabcd\"), String::from(\"dddddddabc\")), false);\n assert_eq!(candidate(String::from(\"abcd\"), String::from(\"dddddddabcf\")), false);\n assert_eq!(candidate(String::from(\"eabcdzzzz\"), String::from(\"dddzzzzzzzddddabc\")), false);\n assert_eq!(candidate(String::from(\"aabb\"), String::from(\"aaccc\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "rs", - "prompt": "/// Given a vector of integers nums, find the minimum sum of any non-empty sub-vector\n/// of nums.\n/// Example\n/// >>> minSubArraySum(vec![2, 3, 4, 1, 2, 4])\n/// 1\n/// >>> minSubArraySum(vec![-1, -2, -3])\n/// -6\nfn minSubArraySum(nums: Vec) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = minSubArraySum;\n assert_eq!(candidate(vec![2, 3, 4, 1, 2, 4]), 1);\n assert_eq!(candidate(vec![-1, -2, -3]), -6);\n assert_eq!(candidate(vec![-1, -2, -3, 2, -10]), -14);\n assert_eq!(candidate(vec![-9999999999999999]), -9999999999999999);\n assert_eq!(candidate(vec![0, 10, 20, 1000000]), 0);\n assert_eq!(candidate(vec![-1, -2, -3, 10, -5]), -6);\n assert_eq!(candidate(vec![100, -1, -2, -3, 10, -5]), -6);\n assert_eq!(candidate(vec![10, 11, 13, 8, 3, 4]), 3);\n assert_eq!(candidate(vec![100, -33, 32, -1, 0, -2]), -33);\n assert_eq!(candidate(vec![-10]), -10);\n assert_eq!(candidate(vec![7]), 7);\n assert_eq!(candidate(vec![1, -1]), -1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "rs", - "prompt": "/// Given a string s and a natural number n, you have been tasked to implement \n/// a function that returns a vector of all words from string s that contain exactly \n/// n consonants, in order these words appear in the string s.\n/// If the string s is empty then the function should return an empty vector.\n/// Note: you may assume the input string contains only letters and spaces.\n/// Examples:\n/// >>> select_words(String::from(\"Mary had a little lamb\"), 4)\n/// vec![String::from(\"little\")]\n/// >>> select_words(String::from(\"Mary had a little lamb\"), 3)\n/// vec![String::from(\"Mary\"), String::from(\"lamb\")]\n/// >>> select_words(String::from(\"simple white space\"), 2)\n/// Vec::::new()\n/// >>> select_words(String::from(\"Hello world\"), 4)\n/// vec![String::from(\"world\")]\n/// >>> select_words(String::from(\"Uncle sam\"), 3)\n/// vec![String::from(\"Uncle\")]\nfn select_words(s: String, n: isize) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = select_words;\n assert_eq!(candidate(String::from(\"Mary had a little lamb\"), 4), vec![String::from(\"little\")]);\n assert_eq!(candidate(String::from(\"Mary had a little lamb\"), 3), vec![String::from(\"Mary\"), String::from(\"lamb\")]);\n assert_eq!(candidate(String::from(\"simple white space\"), 2), Vec::::new());\n assert_eq!(candidate(String::from(\"Hello world\"), 4), vec![String::from(\"world\")]);\n assert_eq!(candidate(String::from(\"Uncle sam\"), 3), vec![String::from(\"Uncle\")]);\n assert_eq!(candidate(String::from(\"\"), 4), Vec::::new());\n assert_eq!(candidate(String::from(\"a b c d e f\"), 1), vec![String::from(\"b\"), String::from(\"c\"), String::from(\"d\"), String::from(\"f\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "rs", - "prompt": "/// Return vector of all prefixes from shortest to longest of the input string\n/// >>> all_prefixes(String::from(\"abc\"))\n/// vec![String::from(\"a\"), String::from(\"ab\"), String::from(\"abc\")]\nfn all_prefixes(string: String) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = all_prefixes;\n assert_eq!(candidate(String::from(\"\")), Vec::::new());\n assert_eq!(candidate(String::from(\"asdfgh\")), vec![String::from(\"a\"), String::from(\"as\"), String::from(\"asd\"), String::from(\"asdf\"), String::from(\"asdfg\"), String::from(\"asdfgh\")]);\n assert_eq!(candidate(String::from(\"WWW\")), vec![String::from(\"W\"), String::from(\"WW\"), String::from(\"WWW\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "rs", - "prompt": "/// Create a function that takes a value (string) representing a number\n/// and returns the closest integer to it. If the number is equidistant\n/// from two integers, round it away from zero.\n/// Examples\n/// >>> closest_integer(String::from(\"10\"))\n/// 10\n/// >>> closest_integer(String::from(\"15.3\"))\n/// 15\n/// Note:\n/// Rounding away from zero means that if the given number is equidistant\n/// from two integers, the one you should return is the one that is the\n/// farthest from zero. For example closest_integer(\"14.5\") should\n/// return 15 and closest_integer(\"-14.5\") should return -15.\nfn closest_integer(value: String) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = closest_integer;\n assert_eq!(candidate(String::from(\"10\")), 10);\n assert_eq!(candidate(String::from(\"14.5\")), 15);\n assert_eq!(candidate(String::from(\"-15.5\")), -16);\n assert_eq!(candidate(String::from(\"15.3\")), 15);\n assert_eq!(candidate(String::from(\"0\")), 0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "rs", - "prompt": "/// Create a function which takes a string representing a file's name, and returns\n/// 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n/// A file's name is considered to be valid if and only if all the following conditions \n/// are met:\n/// - There should not be more than three digits ('0'-'9') in the file's name.\n/// - The file's name contains exactly one dot '.'\n/// - The substring before the dot should not be empty, and it starts with a letter from \n/// the latin alphapet ('a'-'z' and 'A'-'Z').\n/// - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n/// Examples:\n/// >>> file_name_check(String::from(\"example.txt\"))\n/// String::from(\"Yes\")\n/// >>> file_name_check(String::from(\"1example.dll\"))\n/// String::from(\"No\")\nfn file_name_check(file_name: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = file_name_check;\n assert_eq!(candidate(String::from(\"example.txt\")), String::from(\"Yes\"));\n assert_eq!(candidate(String::from(\"1example.dll\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"s1sdf3.asd\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"K.dll\")), String::from(\"Yes\"));\n assert_eq!(candidate(String::from(\"MY16FILE3.exe\")), String::from(\"Yes\"));\n assert_eq!(candidate(String::from(\"His12FILE94.exe\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"_Y.txt\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"?aREYA.exe\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"/this_is_valid.dll\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"this_is_valid.wow\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"this_is_valid.txt\")), String::from(\"Yes\"));\n assert_eq!(candidate(String::from(\"this_is_valid.txtexe\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"#this2_i4s_5valid.ten\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"@this1_is6_valid.exe\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"this_is_12valid.6exe4.txt\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"all.exe.txt\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"I563_No.exe\")), String::from(\"Yes\"));\n assert_eq!(candidate(String::from(\"Is3youfault.txt\")), String::from(\"Yes\"));\n assert_eq!(candidate(String::from(\"no_one#knows.dll\")), String::from(\"Yes\"));\n assert_eq!(candidate(String::from(\"1I563_Yes3.exe\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"I563_Yes3.txtt\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"final..txt\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"final132\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"_f4indsartal132.\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\".txt\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"s.\")), String::from(\"No\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "rs", - "prompt": "/// You are given two intervals,\n/// where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n/// The given intervals are closed which means that the interval (start, end)\n/// includes both start and end.\n/// For each given interval, it is assumed that its start is less or equal its end.\n/// Your task is to determine whether the length of intersection of these two \n/// intervals is a prime number.\n/// Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n/// which its length is 1, which not a prime number.\n/// If the length of the intersection is a prime number, return \"YES\",\n/// otherwise, return \"NO\".\n/// If the two intervals don't intersect, return \"NO\".\n/// [input/output] samples:\n/// >>> intersection((1, 2), (2, 3))\n/// String::from(\"NO\")\n/// >>> intersection((-1, 1), (0, 4))\n/// String::from(\"NO\")\n/// >>> intersection((-3, -1), (-5, 5))\n/// String::from(\"YES\")\nfn intersection(interval1: (isize, isize), interval2: (isize, isize)) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = intersection;\n assert_eq!(candidate((1, 2), (2, 3)), String::from(\"NO\"));\n assert_eq!(candidate((-1, 1), (0, 4)), String::from(\"NO\"));\n assert_eq!(candidate((-3, -1), (-5, 5)), String::from(\"YES\"));\n assert_eq!(candidate((-2, 2), (-4, 0)), String::from(\"YES\"));\n assert_eq!(candidate((-11, 2), (-1, -1)), String::from(\"NO\"));\n assert_eq!(candidate((1, 2), (3, 5)), String::from(\"NO\"));\n assert_eq!(candidate((1, 2), (1, 2)), String::from(\"NO\"));\n assert_eq!(candidate((-2, -2), (-3, -2)), String::from(\"NO\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "rs", - "prompt": "/// Return the largest prime factor of n. Assume n > 1 and is not a prime.\n/// >>> largest_prime_factor(13195)\n/// 29\n/// >>> largest_prime_factor(2048)\n/// 2\nfn largest_prime_factor(n: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = largest_prime_factor;\n assert_eq!(candidate(15), 5);\n assert_eq!(candidate(27), 3);\n assert_eq!(candidate(63), 7);\n assert_eq!(candidate(330), 11);\n assert_eq!(candidate(13195), 29);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "rs", - "prompt": "/// Given a string, find out how many distinct characters (regardless of case) does it consist of\n/// >>> count_distinct_characters(String::from(\"xyzXYZ\"))\n/// 3\n/// >>> count_distinct_characters(String::from(\"Jerry\"))\n/// 4\nfn count_distinct_characters(string: String) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = count_distinct_characters;\n assert_eq!(candidate(String::from(\"\")), 0);\n assert_eq!(candidate(String::from(\"abcde\")), 5);\n assert_eq!(candidate(String::from(\"abcdecadeCADE\")), 5);\n assert_eq!(candidate(String::from(\"aaaaAAAAaaaa\")), 1);\n assert_eq!(candidate(String::from(\"Jerry jERRY JeRRRY\")), 5);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "rs", - "prompt": "/// You're given a vector of deposit and withdrawal operations on a bank account that starts with\n/// zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n/// at that point function should return true. Otherwise it should return false.\n/// >>> below_zero(vec![1, 2, 3])\n/// false\n/// >>> below_zero(vec![1, 2, -4, 5])\n/// true\nfn below_zero(operations: Vec) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = below_zero;\n assert_eq!(candidate(Vec::::new()), false);\n assert_eq!(candidate(vec![1, 2, -3, 1, 2, -3]), false);\n assert_eq!(candidate(vec![1, 2, -4, 5, 6]), true);\n assert_eq!(candidate(vec![1, -1, 2, -2, 5, -5, 4, -4]), false);\n assert_eq!(candidate(vec![1, -1, 2, -2, 5, -5, 4, -5]), true);\n assert_eq!(candidate(vec![1, -2, 2, -2, 5, -5, 4, -4]), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "rs", - "prompt": "/// Find the shortest palindrome that begins with a supplied string.\n/// Algorithm idea is simple:\n/// - Find the longest postfix of supplied string that is a palindrome.\n/// - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n/// >>> make_palindrome(String::from(\"\"))\n/// String::from(\"\")\n/// >>> make_palindrome(String::from(\"cat\"))\n/// String::from(\"catac\")\n/// >>> make_palindrome(String::from(\"cata\"))\n/// String::from(\"catac\")\nfn make_palindrome(string: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = make_palindrome;\n assert_eq!(candidate(String::from(\"\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"x\")), String::from(\"x\"));\n assert_eq!(candidate(String::from(\"xyz\")), String::from(\"xyzyx\"));\n assert_eq!(candidate(String::from(\"xyx\")), String::from(\"xyx\"));\n assert_eq!(candidate(String::from(\"jerry\")), String::from(\"jerryrrej\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "rs", - "prompt": "/// Given a positive integer, obtain its roman numeral equivalent as a string,\n/// and return it in lowercase.\n/// Restrictions: 1 <= num <= 1000\n/// Examples:\n/// >>> int_to_mini_roman(19)\n/// String::from(\"xix\")\n/// >>> int_to_mini_roman(152)\n/// String::from(\"clii\")\n/// >>> int_to_mini_roman(426)\n/// String::from(\"cdxxvi\")\nfn int_to_mini_roman(number: isize) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "reworded", - "tests": "}\n\nfn main() {\n let candidate = int_to_mini_roman;\n assert_eq!(candidate(19), String::from(\"xix\"));\n assert_eq!(candidate(152), String::from(\"clii\"));\n assert_eq!(candidate(251), String::from(\"ccli\"));\n assert_eq!(candidate(426), String::from(\"cdxxvi\"));\n assert_eq!(candidate(500), String::from(\"d\"));\n assert_eq!(candidate(1), String::from(\"i\"));\n assert_eq!(candidate(4), String::from(\"iv\"));\n assert_eq!(candidate(43), String::from(\"xliii\"));\n assert_eq!(candidate(90), String::from(\"xc\"));\n assert_eq!(candidate(94), String::from(\"xciv\"));\n assert_eq!(candidate(532), String::from(\"dxxxii\"));\n assert_eq!(candidate(900), String::from(\"cm\"));\n assert_eq!(candidate(994), String::from(\"cmxciv\"));\n assert_eq!(candidate(1000), String::from(\"m\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - } -] \ No newline at end of file diff --git a/data/rs-transform.json b/data/rs-transform.json deleted file mode 100644 index 422f77db3068c8fcd841fca941986fedd33ea1e5..0000000000000000000000000000000000000000 --- a/data/rs-transform.json +++ /dev/null @@ -1,1874 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "rs", - "prompt": "/// For a given number n, find the largest number that divides n evenly, smaller than n\n/// >>> largest_divisor(15)\n/// 5\nfn largest_divisor(n: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = largest_divisor;\n assert_eq!(candidate(3), 1);\n assert_eq!(candidate(7), 1);\n assert_eq!(candidate(10), 5);\n assert_eq!(candidate(100), 50);\n assert_eq!(candidate(49), 7);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_47_median", - "language": "rs", - "prompt": "/// Return median of elements in the list l.\n/// >>> median(vec![3, 1, 2, 4, 5])\n/// 3.0\n/// >>> median(vec![-10, 4, 6, 1000, 10, 20])\n/// 15.0\nfn median(l: Vec) -> f64 {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = median;\n assert_eq!(candidate(vec![3, 1, 2, 4, 5]), 3.0);\n assert_eq!(candidate(vec![-10, 4, 6, 1000, 10, 20]), 8.0);\n assert_eq!(candidate(vec![5]), 5.0);\n assert_eq!(candidate(vec![6, 5]), 5.5);\n assert_eq!(candidate(vec![8, 1, 3, 9, 9, 2, 7]), 7.0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "rs", - "prompt": "/// Given two lists operator, and operand. The first list has basic algebra operations, and \n/// the second list is a list of integers. Use the two given lists to build the algebric \n/// expression and return the evaluation of this expression.\n/// The basic algebra operations:\n/// Addition ( + ) \n/// Subtraction ( - ) \n/// Multiplication ( * ) \n/// Floor division ( // ) \n/// Exponentiation ( ** ) \n/// Example:\n/// operator['+', '*', '-']\n/// array = [2, 3, 4, 5]\n/// result = 2 + 3 * 4 - 5\n/// => result = 9\n/// Note:\n/// The length of operator list is equal to the length of operand list minus one.\n/// Operand is a list of of non-negative integers.\n/// Operator list has at least one operator, and operand list has at least two operands.\nfn do_algebra(operator: Vec, operand: Vec) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = do_algebra;\n assert_eq!(candidate(vec![String::from(\"**\"), String::from(\"*\"), String::from(\"+\")], vec![2, 3, 4, 5]), 37);\n assert_eq!(candidate(vec![String::from(\"+\"), String::from(\"*\"), String::from(\"-\")], vec![2, 3, 4, 5]), 9);\n assert_eq!(candidate(vec![String::from(\"//\"), String::from(\"*\")], vec![7, 3, 4]), 8);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "rs", - "prompt": "/// Return maximum element in the list.\n/// >>> max_element(vec![1, 2, 3])\n/// 3\n/// >>> max_element(vec![5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n/// 123\nfn max_element(l: Vec) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = max_element;\n assert_eq!(candidate(vec![1, 2, 3]), 3);\n assert_eq!(candidate(vec![5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]), 124);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "rs", - "prompt": "/// Create a function which returns the largest index of an element which\n/// is not greater than or equal to the element immediately preceding it. If\n/// no such element exists then return -1. The given array will not contain\n/// duplicate values.\n/// Examples:\n/// >>> can_arrange(vec![1, 2, 4, 3, 5])\n/// 3\n/// >>> can_arrange(vec![1, 2, 3])\n/// -1\nfn can_arrange(arr: Vec) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = can_arrange;\n assert_eq!(candidate(vec![1, 2, 4, 3, 5]), 3);\n assert_eq!(candidate(vec![1, 2, 4, 5]), -1);\n assert_eq!(candidate(vec![1, 4, 2, 5, 6, 7, 8, 9, 10]), 2);\n assert_eq!(candidate(vec![4, 8, 5, 7, 3]), 4);\n assert_eq!(candidate(Vec::::new()), -1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "rs", - "prompt": "/// Imagine a road that's a perfectly straight infinitely long line.\n/// n cars are driving left to right; simultaneously, a different set of n cars\n/// are driving right to left. The two sets of cars start out being very far from\n/// each other. All cars move in the same speed. Two cars are said to collide\n/// when a car that's moving left to right hits a car that's moving right to left.\n/// However, the cars are infinitely sturdy and strong; as a result, they continue moving\n/// in their trajectory as if they did not collide.\n/// This function outputs the number of such collisions.\nfn car_race_collision(n: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = car_race_collision;\n assert_eq!(candidate(2), 4);\n assert_eq!(candidate(3), 9);\n assert_eq!(candidate(4), 16);\n assert_eq!(candidate(8), 64);\n assert_eq!(candidate(10), 100);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "rs", - "prompt": "/// Create a function that returns True if the last character\n/// of a given string is an alphabetical character and is not\n/// a part of a word, and False otherwise.\n/// Note: \"word\" is a group of characters separated by space.\n/// Examples:\n/// >>> check_if_last_char_is_a_letter(String::from(\"apple pie\"))\n/// false\n/// >>> check_if_last_char_is_a_letter(String::from(\"apple pi e\"))\n/// true\n/// >>> check_if_last_char_is_a_letter(String::from(\"apple pi e \"))\n/// false\n/// >>> check_if_last_char_is_a_letter(String::from(\"\"))\n/// false\nfn check_if_last_char_is_a_letter(txt: String) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = check_if_last_char_is_a_letter;\n assert_eq!(candidate(String::from(\"apple\")), false);\n assert_eq!(candidate(String::from(\"apple pi e\")), true);\n assert_eq!(candidate(String::from(\"eeeee\")), false);\n assert_eq!(candidate(String::from(\"A\")), true);\n assert_eq!(candidate(String::from(\"Pumpkin pie \")), false);\n assert_eq!(candidate(String::from(\"Pumpkin pie 1\")), false);\n assert_eq!(candidate(String::from(\"\")), false);\n assert_eq!(candidate(String::from(\"eeeee e \")), false);\n assert_eq!(candidate(String::from(\"apple pie\")), false);\n assert_eq!(candidate(String::from(\"apple pi e \")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "rs", - "prompt": "/// Return true if a given number is prime, and false otherwise.\n/// >>> is_prime(6)\n/// false\n/// >>> is_prime(101)\n/// true\n/// >>> is_prime(11)\n/// true\n/// >>> is_prime(13441)\n/// true\n/// >>> is_prime(61)\n/// true\n/// >>> is_prime(4)\n/// false\n/// >>> is_prime(1)\n/// false\nfn is_prime(n: isize) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = is_prime;\n assert_eq!(candidate(6), false);\n assert_eq!(candidate(101), true);\n assert_eq!(candidate(11), true);\n assert_eq!(candidate(13441), true);\n assert_eq!(candidate(61), true);\n assert_eq!(candidate(4), false);\n assert_eq!(candidate(1), false);\n assert_eq!(candidate(5), true);\n assert_eq!(candidate(11), true);\n assert_eq!(candidate(17), true);\n assert_eq!(candidate(85), false);\n assert_eq!(candidate(77), false);\n assert_eq!(candidate(255379), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "rs", - "prompt": "/// Given a list of positive integers x. return a sorted list of all \n/// elements that hasn't any even digit.\n/// Note: Returned list should be sorted in increasing order.\n/// For example:\n/// >>> unique_digits(vec![15, 33, 1422, 1])\n/// vec![1, 15, 33]\n/// >>> unique_digits(vec![152, 323, 1422, 10])\n/// Vec::::new()\nfn unique_digits(x: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = unique_digits;\n assert_eq!(candidate(vec![15, 33, 1422, 1]), vec![1, 15, 33]);\n assert_eq!(candidate(vec![152, 323, 1422, 10]), Vec::::new());\n assert_eq!(candidate(vec![12345, 2033, 111, 151]), vec![111, 151]);\n assert_eq!(candidate(vec![135, 103, 31]), vec![31, 135]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "rs", - "prompt": "/// Input are two strings a and b consisting only of 1s and 0s.\n/// Perform binary XOR on these inputs and return result also as a string.\n/// >>> string_xor(String::from(\"010\"), String::from(\"110\"))\n/// String::from(\"100\")\nfn string_xor(a: String, b: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = string_xor;\n assert_eq!(candidate(String::from(\"111000\"), String::from(\"101010\")), String::from(\"010010\"));\n assert_eq!(candidate(String::from(\"1\"), String::from(\"1\")), String::from(\"0\"));\n assert_eq!(candidate(String::from(\"0101\"), String::from(\"0000\")), String::from(\"0101\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "rs", - "prompt": "/// sum_to_n is a function that sums numbers from 1 to n.\n/// >>> sum_to_n(30)\n/// 465\n/// >>> sum_to_n(100)\n/// 5050\n/// >>> sum_to_n(5)\n/// 15\n/// >>> sum_to_n(10)\n/// 55\n/// >>> sum_to_n(1)\n/// 1\nfn sum_to_n(n: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = sum_to_n;\n assert_eq!(candidate(1), 1);\n assert_eq!(candidate(6), 21);\n assert_eq!(candidate(11), 66);\n assert_eq!(candidate(30), 465);\n assert_eq!(candidate(100), 5050);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "rs", - "prompt": "/// Given a list of numbers, return the sum of squares of the numbers\n/// in the list that are odd. Ignore numbers that are negative or not integers.\n/// >>> double_the_difference(vec![1, 3, 2, 0])\n/// 10\n/// >>> double_the_difference(vec![-1, -2, 0])\n/// 0\n/// >>> double_the_difference(vec![9, -2])\n/// 81\n/// >>> double_the_difference(vec![0])\n/// 0\n/// If the input list is empty, return 0.\nfn double_the_difference(lst: Vec) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = double_the_difference;\n assert_eq!(candidate(Vec::::new()), 0);\n assert_eq!(candidate(vec![5.0, 4.0]), 25);\n assert_eq!(candidate(vec![0.1, 0.2, 0.3]), 0);\n assert_eq!(candidate(vec![-10.0, -20.0, -30.0]), 0);\n assert_eq!(candidate(vec![-1.0, -2.0, 8.0]), 0);\n assert_eq!(candidate(vec![0.2, 3.0, 5.0]), 34);\n assert_eq!(candidate(vec![-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]), 165);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "rs", - "prompt": "/// Return length of given string\n/// >>> strlen(String::from(\"\"))\n/// 0\n/// >>> strlen(String::from(\"abc\"))\n/// 3\nfn strlen(string: String) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = strlen;\n assert_eq!(candidate(String::from(\"\")), 0);\n assert_eq!(candidate(String::from(\"x\")), 1);\n assert_eq!(candidate(String::from(\"asdasnakj\")), 9);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "rs", - "prompt": "/// You'll be given a string of words, and your task is to count the number\n/// of boredoms. A boredom is a sentence that starts with the word \"I\".\n/// Sentences are delimited by '.', '?' or '!'.\n/// For example:\n/// >>> is_bored(String::from(\"Hello world\"))\n/// 0\n/// >>> is_bored(String::from(\"The sky is blue. The sun is shining. I love this weather\"))\n/// 1\nfn is_bored(S: String) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = is_bored;\n assert_eq!(candidate(String::from(\"Hello world\")), 0);\n assert_eq!(candidate(String::from(\"Is the sky blue?\")), 0);\n assert_eq!(candidate(String::from(\"I love It !\")), 1);\n assert_eq!(candidate(String::from(\"bIt\")), 0);\n assert_eq!(candidate(String::from(\"I feel good today. I will be productive. will kill It\")), 2);\n assert_eq!(candidate(String::from(\"You and I are going for a walk\")), 0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "rs", - "prompt": "/// Write a function vowels_count which takes a string representing\n/// a word as input and returns the number of vowels in the string.\n/// Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n/// vowel, but only when it is at the end of the given word.\n/// Example:\n/// >>> vowels_count(String::from(\"abcde\"))\n/// 2\n/// >>> vowels_count(String::from(\"ACEDY\"))\n/// 3\nfn vowels_count(s: String) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = vowels_count;\n assert_eq!(candidate(String::from(\"abcde\")), 2);\n assert_eq!(candidate(String::from(\"Alone\")), 3);\n assert_eq!(candidate(String::from(\"key\")), 2);\n assert_eq!(candidate(String::from(\"bye\")), 1);\n assert_eq!(candidate(String::from(\"keY\")), 2);\n assert_eq!(candidate(String::from(\"bYe\")), 1);\n assert_eq!(candidate(String::from(\"ACEDY\")), 3);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "rs", - "prompt": "/// Return n-th Fibonacci number.\n/// >>> fib(10)\n/// 55\n/// >>> fib(1)\n/// 1\n/// >>> fib(8)\n/// 21\nfn fib(n: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = fib;\n assert_eq!(candidate(10), 55);\n assert_eq!(candidate(1), 1);\n assert_eq!(candidate(8), 21);\n assert_eq!(candidate(11), 89);\n assert_eq!(candidate(12), 144);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "rs", - "prompt": "/// Your task is to implement a function that will simplify the expression\n/// x * n. The function returns True if x * n evaluates to a whole number and False\n/// otherwise. Both x and n, are string representation of a fraction, and have the following format,\n/// / where both numerator and denominator are positive whole numbers.\n/// You can assume that x, and n are valid fractions, and do not have zero as denominator.\n/// >>> simplify(String::from(\"1/5\"), String::from(\"5/1\"))\n/// true\n/// >>> simplify(String::from(\"1/6\"), String::from(\"2/1\"))\n/// false\n/// >>> simplify(String::from(\"7/10\"), String::from(\"10/2\"))\n/// false\nfn simplify(x: String, n: String) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = simplify;\n assert_eq!(candidate(String::from(\"1/5\"), String::from(\"5/1\")), true);\n assert_eq!(candidate(String::from(\"1/6\"), String::from(\"2/1\")), false);\n assert_eq!(candidate(String::from(\"5/1\"), String::from(\"3/1\")), true);\n assert_eq!(candidate(String::from(\"7/10\"), String::from(\"10/2\")), false);\n assert_eq!(candidate(String::from(\"2/10\"), String::from(\"50/10\")), true);\n assert_eq!(candidate(String::from(\"7/2\"), String::from(\"4/2\")), true);\n assert_eq!(candidate(String::from(\"11/6\"), String::from(\"6/1\")), true);\n assert_eq!(candidate(String::from(\"2/3\"), String::from(\"5/2\")), false);\n assert_eq!(candidate(String::from(\"5/2\"), String::from(\"3/5\")), false);\n assert_eq!(candidate(String::from(\"2/4\"), String::from(\"8/4\")), true);\n assert_eq!(candidate(String::from(\"2/4\"), String::from(\"4/2\")), true);\n assert_eq!(candidate(String::from(\"1/5\"), String::from(\"5/1\")), true);\n assert_eq!(candidate(String::from(\"1/5\"), String::from(\"1/5\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "rs", - "prompt": "/// Given a string s, count the number of uppercase vowels in even indices.\n/// For example:\n/// >>> count_upper(String::from(\"aBCdEf\"))\n/// 1\n/// >>> count_upper(String::from(\"abcdefg\"))\n/// 0\n/// >>> count_upper(String::from(\"dBBE\"))\n/// 0\nfn count_upper(s: String) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = count_upper;\n assert_eq!(candidate(String::from(\"aBCdEf\")), 1);\n assert_eq!(candidate(String::from(\"abcdefg\")), 0);\n assert_eq!(candidate(String::from(\"dBBE\")), 0);\n assert_eq!(candidate(String::from(\"B\")), 0);\n assert_eq!(candidate(String::from(\"U\")), 1);\n assert_eq!(candidate(String::from(\"\")), 0);\n assert_eq!(candidate(String::from(\"EEEE\")), 2);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "rs", - "prompt": "/// You are given a rectangular grid of wells. Each row represents a single well,\n/// and each 1 in a row represents a single unit of water.\n/// Each well has a corresponding bucket that can be used to extract water from it, \n/// and all buckets have the same capacity.\n/// Your task is to use the buckets to empty the wells.\n/// Output the number of times you need to lower the buckets.\n/// Example 1:\n/// >>> max_fill(vec![vec![0, 0, 1, 0], vec![0, 1, 0, 0], vec![1, 1, 1, 1]], 1)\n/// 6\n/// Example 2:\n/// >>> max_fill(vec![vec![0, 0, 1, 1], vec![0, 0, 0, 0], vec![1, 1, 1, 1], vec![0, 1, 1, 1]], 2)\n/// 5\n/// Example 3:\n/// >>> max_fill(vec![vec![0, 0, 0], vec![0, 0, 0]], 5)\n/// 0\n/// Constraints:\n/// * all wells have the same length\n/// * 1 <= grid.length <= 10^2\n/// * 1 <= grid[:,1].length <= 10^2\n/// * grid[i][j] -> 0 | 1\n/// * 1 <= capacity <= 10\nfn max_fill(grid: Vec>, capacity: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = max_fill;\n assert_eq!(candidate(vec![vec![0, 0, 1, 0], vec![0, 1, 0, 0], vec![1, 1, 1, 1]], 1), 6);\n assert_eq!(candidate(vec![vec![0, 0, 1, 1], vec![0, 0, 0, 0], vec![1, 1, 1, 1], vec![0, 1, 1, 1]], 2), 5);\n assert_eq!(candidate(vec![vec![0, 0, 0], vec![0, 0, 0]], 5), 0);\n assert_eq!(candidate(vec![vec![1, 1, 1, 1], vec![1, 1, 1, 1]], 2), 4);\n assert_eq!(candidate(vec![vec![1, 1, 1, 1], vec![1, 1, 1, 1]], 9), 2);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "rs", - "prompt": "/// Given an array arr of integers and a positive integer k, return a sorted list \n/// of length k with the maximum k numbers in arr.\n/// Example 1:\n/// >>> maximum(vec![-3, -4, 5], 3)\n/// vec![-4, -3, 5]\n/// Example 2:\n/// >>> maximum(vec![4, -4, 4], 2)\n/// vec![4, 4]\n/// Example 3:\n/// >>> maximum(vec![-3, 2, 1, 2, -1, -2, 1], 1)\n/// vec![2]\n/// Note:\n/// 1. The length of the array will be in the range of [1, 1000].\n/// 2. The elements in the array will be in the range of [-1000, 1000].\n/// 3. 0 <= k <= len(arr)\nfn maximum(arr: Vec, k: isize) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = maximum;\n assert_eq!(candidate(vec![-3, -4, 5], 3), vec![-4, -3, 5]);\n assert_eq!(candidate(vec![4, -4, 4], 2), vec![4, 4]);\n assert_eq!(candidate(vec![-3, 2, 1, 2, -1, -2, 1], 1), vec![2]);\n assert_eq!(candidate(vec![123, -123, 20, 0, 1, 2, -3], 3), vec![2, 20, 123]);\n assert_eq!(candidate(vec![-123, 20, 0, 1, 2, -3], 4), vec![0, 1, 2, 20]);\n assert_eq!(candidate(vec![5, 15, 0, 3, -13, -8, 0], 7), vec![-13, -8, 0, 0, 3, 5, 15]);\n assert_eq!(candidate(vec![-1, 0, 2, 5, 3, -10], 2), vec![3, 5]);\n assert_eq!(candidate(vec![1, 0, 5, -7], 1), vec![5]);\n assert_eq!(candidate(vec![4, -4], 2), vec![-4, 4]);\n assert_eq!(candidate(vec![-10, 10], 2), vec![-10, 10]);\n assert_eq!(candidate(vec![1, 2, 3, -23, 243, -400, 0], 0), Vec::::new());\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "rs", - "prompt": "/// Write a function that takes a message, and encodes in such a \n/// way that it swaps case of all letters, replaces all vowels in \n/// the message with the letter that appears 2 places ahead of that \n/// vowel in the english alphabet. \n/// Assume only letters. \n/// Examples:\n/// >>> encode(String::from(\"test\"))\n/// String::from(\"TGST\")\n/// >>> encode(String::from(\"This is a message\"))\n/// String::from(\"tHKS KS C MGSSCGG\")\nfn encode(message: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = encode;\n assert_eq!(candidate(String::from(\"TEST\")), String::from(\"tgst\"));\n assert_eq!(candidate(String::from(\"Mudasir\")), String::from(\"mWDCSKR\"));\n assert_eq!(candidate(String::from(\"YES\")), String::from(\"ygs\"));\n assert_eq!(candidate(String::from(\"This is a message\")), String::from(\"tHKS KS C MGSSCGG\"));\n assert_eq!(candidate(String::from(\"I DoNt KnOw WhAt tO WrItE\")), String::from(\"k dQnT kNqW wHcT Tq wRkTg\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "rs", - "prompt": "/// remove_vowels is a function that takes string and returns string without vowels.\n/// >>> remove_vowels(String::from(\"\"))\n/// String::from(\"\")\n/// >>> remove_vowels(String::from(\"abcdef\"))\n/// String::from(\"bcdf\")\n/// >>> remove_vowels(String::from(\"aaaaa\"))\n/// String::from(\"\")\n/// >>> remove_vowels(String::from(\"aaBAA\"))\n/// String::from(\"B\")\n/// >>> remove_vowels(String::from(\"zbcd\"))\n/// String::from(\"zbcd\")\nfn remove_vowels(text: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = remove_vowels;\n assert_eq!(candidate(String::from(\"\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"abcdef\nghijklm\")), String::from(\"bcdf\nghjklm\"));\n assert_eq!(candidate(String::from(\"fedcba\")), String::from(\"fdcb\"));\n assert_eq!(candidate(String::from(\"eeeee\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"acBAA\")), String::from(\"cB\"));\n assert_eq!(candidate(String::from(\"EcBOO\")), String::from(\"cB\"));\n assert_eq!(candidate(String::from(\"ybcd\")), String::from(\"ybcd\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "rs", - "prompt": "/// Return only positive numbers in the list.\n/// >>> get_positive(vec![-1, 2, -4, 5, 6])\n/// vec![2, 5, 6]\n/// >>> get_positive(vec![5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n/// vec![5, 3, 2, 3, 9, 123, 1]\nfn get_positive(l: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = get_positive;\n assert_eq!(candidate(vec![-1, -2, 4, 5, 6]), vec![4, 5, 6]);\n assert_eq!(candidate(vec![5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]), vec![5, 3, 2, 3, 3, 9, 123, 1]);\n assert_eq!(candidate(vec![-1, -2]), Vec::::new());\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "rs", - "prompt": "/// Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n/// >>> string_sequence(0)\n/// String::from(\"0\")\n/// >>> string_sequence(5)\n/// String::from(\"0 1 2 3 4 5\")\nfn string_sequence(n: isize) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = string_sequence;\n assert_eq!(candidate(0), String::from(\"0\"));\n assert_eq!(candidate(3), String::from(\"0 1 2 3\"));\n assert_eq!(candidate(10), String::from(\"0 1 2 3 4 5 6 7 8 9 10\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "rs", - "prompt": "/// Given a positive integer n, you have to make a pile of n levels of stones.\n/// The first level has n stones.\n/// The number of stones in the next level is:\n/// - the next odd number if n is odd.\n/// - the next even number if n is even.\n/// Return the number of stones in each level in a list, where element at index\n/// i represents the number of stones in the level (i+1).\n/// Examples:\n/// >>> make_a_pile(3)\n/// vec![3, 5, 7]\nfn make_a_pile(n: isize) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = make_a_pile;\n assert_eq!(candidate(3), vec![3, 5, 7]);\n assert_eq!(candidate(4), vec![4, 6, 8, 10]);\n assert_eq!(candidate(5), vec![5, 7, 9, 11, 13]);\n assert_eq!(candidate(6), vec![6, 8, 10, 12, 14, 16]);\n assert_eq!(candidate(8), vec![8, 10, 12, 14, 16, 18, 20, 22]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "rs", - "prompt": "/// Task\n/// 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\n/// then check if the result string is palindrome.\n/// A string is called palindrome if it reads the same backward as forward.\n/// You should return a tuple containing the result string and True/False for the check.\n/// Example\n/// >>> reverse_delete(String::from(\"abcde\"), String::from(\"ae\"))\n/// (String::from(\"bcd\"), false)\n/// >>> reverse_delete(String::from(\"abcdef\"), String::from(\"b\"))\n/// (String::from(\"acdef\"), false)\n/// >>> reverse_delete(String::from(\"abcdedcba\"), String::from(\"ab\"))\n/// (String::from(\"cdedc\"), true)\nfn reverse_delete(s: String, c: String) -> (String, bool) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = reverse_delete;\n assert_eq!(candidate(String::from(\"abcde\"), String::from(\"ae\")), (String::from(\"bcd\"), false));\n assert_eq!(candidate(String::from(\"abcdef\"), String::from(\"b\")), (String::from(\"acdef\"), false));\n assert_eq!(candidate(String::from(\"abcdedcba\"), String::from(\"ab\")), (String::from(\"cdedc\"), true));\n assert_eq!(candidate(String::from(\"dwik\"), String::from(\"w\")), (String::from(\"dik\"), false));\n assert_eq!(candidate(String::from(\"a\"), String::from(\"a\")), (String::from(\"\"), true));\n assert_eq!(candidate(String::from(\"abcdedcba\"), String::from(\"\")), (String::from(\"abcdedcba\"), true));\n assert_eq!(candidate(String::from(\"abcdedcba\"), String::from(\"v\")), (String::from(\"abcdedcba\"), true));\n assert_eq!(candidate(String::from(\"vabba\"), String::from(\"v\")), (String::from(\"abba\"), true));\n assert_eq!(candidate(String::from(\"mamma\"), String::from(\"mia\")), (String::from(\"\"), true));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "rs", - "prompt": "/// For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n/// >>> flip_case(String::from(\"Hello\"))\n/// String::from(\"hELLO\")\nfn flip_case(string: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = flip_case;\n assert_eq!(candidate(String::from(\"\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"Hello!\")), String::from(\"hELLO!\"));\n assert_eq!(candidate(String::from(\"These violent delights have violent ends\")), String::from(\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "rs", - "prompt": "/// You are given a string s.\n/// if s[i] is a letter, reverse its case from lower to upper or vise versa, \n/// otherwise keep it as it is.\n/// If the string contains no letters, reverse the string.\n/// The function should return the resulted string.\n/// Examples\n/// >>> solve(String::from(\"1234\"))\n/// String::from(\"4321\")\n/// >>> solve(String::from(\"ab\"))\n/// String::from(\"AB\")\n/// >>> solve(String::from(\"#a@C\"))\n/// String::from(\"#A@c\")\nfn solve(s: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = solve;\n assert_eq!(candidate(String::from(\"AsDf\")), String::from(\"aSdF\"));\n assert_eq!(candidate(String::from(\"1234\")), String::from(\"4321\"));\n assert_eq!(candidate(String::from(\"ab\")), String::from(\"AB\"));\n assert_eq!(candidate(String::from(\"#a@C\")), String::from(\"#A@c\"));\n assert_eq!(candidate(String::from(\"#AsdfW^45\")), String::from(\"#aSDFw^45\"));\n assert_eq!(candidate(String::from(\"#6@2\")), String::from(\"2@6#\"));\n assert_eq!(candidate(String::from(\"#$a^D\")), String::from(\"#$A^d\"));\n assert_eq!(candidate(String::from(\"#ccc\")), String::from(\"#CCC\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "rs", - "prompt": "/// Filter an input list of strings only for ones that start with a given prefix.\n/// >>> filter_by_prefix(vec![], String::from(\"a\"))\n/// Vec::::new()\n/// >>> filter_by_prefix(vec![String::from(\"abc\"), String::from(\"bcd\"), String::from(\"cde\"), String::from(\"array\")], String::from(\"a\"))\n/// vec![String::from(\"abc\"), String::from(\"array\")]\nfn filter_by_prefix(strings: Vec, prefix: String) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = filter_by_prefix;\n assert_eq!(candidate(Vec::::new(), String::from(\"john\")), Vec::::new());\n assert_eq!(candidate(vec![String::from(\"xxx\"), String::from(\"asd\"), String::from(\"xxy\"), String::from(\"john doe\"), String::from(\"xxxAAA\"), String::from(\"xxx\")], String::from(\"xxx\")), vec![String::from(\"xxx\"), String::from(\"xxxAAA\"), String::from(\"xxx\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "rs", - "prompt": "/// This function takes two positive numbers x and y and returns the\n/// biggest even integer number that is in the range [x, y] inclusive. If \n/// there's no such number, then the function should return -1.\n/// For example:\n/// >>> choose_num(12, 15)\n/// 14\n/// >>> choose_num(13, 12)\n/// -1\nfn choose_num(x: isize, y: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = choose_num;\n assert_eq!(candidate(12, 15), 14);\n assert_eq!(candidate(13, 12), -1);\n assert_eq!(candidate(33, 12354), 12354);\n assert_eq!(candidate(5234, 5233), -1);\n assert_eq!(candidate(6, 29), 28);\n assert_eq!(candidate(27, 10), -1);\n assert_eq!(candidate(7, 7), -1);\n assert_eq!(candidate(546, 546), 546);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "rs", - "prompt": "/// You are given a string representing a sentence,\n/// the sentence contains some words separated by a space,\n/// and you have to return a string that contains the words from the original sentence,\n/// whose lengths are prime numbers,\n/// the order of the words in the new string should be the same as the original one.\n/// Example 1:\n/// >>> words_in_sentence(String::from(\"This is a test\"))\n/// String::from(\"is\")\n/// Example 2:\n/// >>> words_in_sentence(String::from(\"lets go for swimming\"))\n/// String::from(\"go for\")\n/// Constraints:\n/// * 1 <= len(sentence) <= 100\n/// * sentence contains only letters\nfn words_in_sentence(sentence: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = words_in_sentence;\n assert_eq!(candidate(String::from(\"This is a test\")), String::from(\"is\"));\n assert_eq!(candidate(String::from(\"lets go for swimming\")), String::from(\"go for\"));\n assert_eq!(candidate(String::from(\"there is no place available here\")), String::from(\"there is no place\"));\n assert_eq!(candidate(String::from(\"Hi I am Hussein\")), String::from(\"Hi am Hussein\"));\n assert_eq!(candidate(String::from(\"go for it\")), String::from(\"go for it\"));\n assert_eq!(candidate(String::from(\"here\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"here is\")), String::from(\"is\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "rs", - "prompt": "/// Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n/// >>> intersperse(vec![], 4)\n/// Vec::::new()\n/// >>> intersperse(vec![1, 2, 3], 4)\n/// vec![1, 4, 2, 4, 3]\nfn intersperse(numbers: Vec, delimeter: isize) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = intersperse;\n assert_eq!(candidate(Vec::::new(), 7), Vec::::new());\n assert_eq!(candidate(vec![5, 6, 3, 2], 8), vec![5, 8, 6, 8, 3, 8, 2]);\n assert_eq!(candidate(vec![2, 2, 2], 2), vec![2, 2, 2, 2, 2]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "rs", - "prompt": "/// Your task is to write a function that returns true if a number x is a simple\n/// power of n and false in other cases.\n/// x is a simple power of n if n**int=x\n/// For example:\n/// >>> is_simple_power(1, 4)\n/// true\n/// >>> is_simple_power(2, 2)\n/// true\n/// >>> is_simple_power(8, 2)\n/// true\n/// >>> is_simple_power(3, 2)\n/// false\n/// >>> is_simple_power(3, 1)\n/// false\n/// >>> is_simple_power(5, 3)\n/// false\nfn is_simple_power(x: isize, n: isize) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = is_simple_power;\n assert_eq!(candidate(16, 2), true);\n assert_eq!(candidate(143214, 16), false);\n assert_eq!(candidate(4, 2), true);\n assert_eq!(candidate(9, 3), true);\n assert_eq!(candidate(16, 4), true);\n assert_eq!(candidate(24, 2), false);\n assert_eq!(candidate(128, 4), false);\n assert_eq!(candidate(12, 6), false);\n assert_eq!(candidate(1, 1), true);\n assert_eq!(candidate(1, 12), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "rs", - "prompt": "/// Write a function that returns true if the given number is the multiplication of 3 prime numbers\n/// and false otherwise.\n/// Knowing that (a) is less then 100. \n/// Example:\n/// >>> is_multiply_prime(30)\n/// true\n/// 30 = 2 * 3 * 5\nfn is_multiply_prime(a: isize) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = is_multiply_prime;\n assert_eq!(candidate(5), false);\n assert_eq!(candidate(30), true);\n assert_eq!(candidate(8), true);\n assert_eq!(candidate(10), false);\n assert_eq!(candidate(125), true);\n assert_eq!(candidate(105), true);\n assert_eq!(candidate(126), false);\n assert_eq!(candidate(729), false);\n assert_eq!(candidate(891), false);\n assert_eq!(candidate(1001), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "rs", - "prompt": "/// Given the lengths of the three sides of a triangle. Return True if the three\n/// sides form a right-angled triangle, False otherwise.\n/// A right-angled triangle is a triangle in which one angle is right angle or \n/// 90 degree.\n/// Example:\n/// >>> right_angle_triangle(3, 4, 5)\n/// true\n/// >>> right_angle_triangle(1, 2, 3)\n/// false\nfn right_angle_triangle(a: isize, b: isize, c: isize) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = right_angle_triangle;\n assert_eq!(candidate(3, 4, 5), true);\n assert_eq!(candidate(1, 2, 3), false);\n assert_eq!(candidate(10, 6, 8), true);\n assert_eq!(candidate(2, 2, 2), false);\n assert_eq!(candidate(7, 24, 25), true);\n assert_eq!(candidate(10, 5, 7), false);\n assert_eq!(candidate(5, 12, 13), true);\n assert_eq!(candidate(15, 8, 17), true);\n assert_eq!(candidate(48, 55, 73), true);\n assert_eq!(candidate(1, 1, 1), false);\n assert_eq!(candidate(2, 2, 10), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "rs", - "prompt": "/// Create a function that takes 3 numbers.\n/// Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n/// Returns false in any other cases.\n/// Examples\n/// >>> any_int(5, 2, 7)\n/// true\n/// >>> any_int(3, 2, 2)\n/// false\n/// >>> any_int(3, -2, 1)\n/// true\n/// >>> any_int(3.6, -2.2, 2)\n/// false\nfn any_int(x: f64, y: f64, z: f64) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = any_int;\n assert_eq!(candidate(2.0, 3.0, 1.0), true);\n assert_eq!(candidate(2.5, 2.0, 3.0), false);\n assert_eq!(candidate(1.5, 5.0, 3.5), false);\n assert_eq!(candidate(2.0, 6.0, 2.0), false);\n assert_eq!(candidate(4.0, 2.0, 2.0), true);\n assert_eq!(candidate(2.2, 2.2, 2.2), false);\n assert_eq!(candidate(-4.0, 6.0, 2.0), true);\n assert_eq!(candidate(2.0, 1.0, 1.0), true);\n assert_eq!(candidate(3.0, 4.0, 7.0), true);\n assert_eq!(candidate(3.0, 4.0, 7.0), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "rs", - "prompt": "/// This function takes a list l and returns a list l' such that\n/// l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n/// to the values of the corresponding indicies of l, but sorted.\n/// >>> sort_third(vec![1, 2, 3])\n/// vec![1, 2, 3]\n/// >>> sort_third(vec![5, 6, 3, 4, 8, 9, 2])\n/// vec![2, 6, 3, 4, 8, 9, 5]\nfn sort_third(l: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = sort_third;\n assert_eq!(candidate(vec![5, 6, 3, 4, 8, 9, 2]), vec![2, 6, 3, 4, 8, 9, 5]);\n assert_eq!(candidate(vec![5, 8, 3, 4, 6, 9, 2]), vec![2, 8, 3, 4, 6, 9, 5]);\n assert_eq!(candidate(vec![5, 6, 9, 4, 8, 3, 2]), vec![2, 6, 9, 4, 8, 3, 5]);\n assert_eq!(candidate(vec![5, 6, 3, 4, 8, 9, 2, 1]), vec![2, 6, 3, 4, 8, 9, 5, 1]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_53_add", - "language": "rs", - "prompt": "/// Add two numbers x and y\n/// >>> add(2, 3)\n/// 5\n/// >>> add(5, 7)\n/// 12\nfn add(x: isize, y: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = add;\n assert_eq!(candidate(0, 1), 1);\n assert_eq!(candidate(1, 0), 1);\n assert_eq!(candidate(2, 3), 5);\n assert_eq!(candidate(5, 7), 12);\n assert_eq!(candidate(7, 5), 12);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_69_search", - "language": "rs", - "prompt": "/// You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n/// zero, and has a frequency greater than or equal to the value of the integer itself. \n/// The frequency of an integer is the number of times it appears in the list.\n/// If no such a value exist, return -1.\n/// Examples:\n/// >>> search(vec![4, 1, 2, 2, 3, 1])\n/// 2\n/// >>> search(vec![1, 2, 2, 3, 3, 3, 4, 4, 4])\n/// 3\n/// >>> search(vec![5, 5, 4, 4, 4])\n/// -1\nfn search(lst: Vec) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = search;\n assert_eq!(candidate(vec![5, 5, 5, 5, 1]), 1);\n assert_eq!(candidate(vec![4, 1, 4, 1, 4, 4]), 4);\n assert_eq!(candidate(vec![3, 3]), -1);\n assert_eq!(candidate(vec![8, 8, 8, 8, 8, 8, 8, 8]), 8);\n assert_eq!(candidate(vec![2, 3, 3, 2, 2]), 2);\n assert_eq!(candidate(vec![2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]), 1);\n assert_eq!(candidate(vec![3, 2, 8, 2]), 2);\n assert_eq!(candidate(vec![6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]), 1);\n assert_eq!(candidate(vec![8, 8, 3, 6, 5, 6, 4]), -1);\n assert_eq!(candidate(vec![6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]), 1);\n assert_eq!(candidate(vec![1, 9, 10, 1, 3]), 1);\n assert_eq!(candidate(vec![6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]), 5);\n assert_eq!(candidate(vec![1]), 1);\n assert_eq!(candidate(vec![8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]), 4);\n assert_eq!(candidate(vec![2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]), 2);\n assert_eq!(candidate(vec![1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]), 1);\n assert_eq!(candidate(vec![9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]), 4);\n assert_eq!(candidate(vec![2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]), 4);\n assert_eq!(candidate(vec![9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]), 2);\n assert_eq!(candidate(vec![5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]), -1);\n assert_eq!(candidate(vec![10]), -1);\n assert_eq!(candidate(vec![9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]), 2);\n assert_eq!(candidate(vec![5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]), 1);\n assert_eq!(candidate(vec![7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]), 1);\n assert_eq!(candidate(vec![3, 10, 10, 9, 2]), -1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "rs", - "prompt": "/// Write a function that takes a string and returns True if the string\n/// length is a prime number or False otherwise\n/// Examples\n/// >>> prime_length(String::from(\"Hello\"))\n/// true\n/// >>> prime_length(String::from(\"abcdcba\"))\n/// true\n/// >>> prime_length(String::from(\"kittens\"))\n/// true\n/// >>> prime_length(String::from(\"orange\"))\n/// false\nfn prime_length(string: String) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = prime_length;\n assert_eq!(candidate(String::from(\"Hello\")), true);\n assert_eq!(candidate(String::from(\"abcdcba\")), true);\n assert_eq!(candidate(String::from(\"kittens\")), true);\n assert_eq!(candidate(String::from(\"orange\")), false);\n assert_eq!(candidate(String::from(\"wow\")), true);\n assert_eq!(candidate(String::from(\"world\")), true);\n assert_eq!(candidate(String::from(\"MadaM\")), true);\n assert_eq!(candidate(String::from(\"Wow\")), true);\n assert_eq!(candidate(String::from(\"\")), false);\n assert_eq!(candidate(String::from(\"HI\")), true);\n assert_eq!(candidate(String::from(\"go\")), true);\n assert_eq!(candidate(String::from(\"gogo\")), false);\n assert_eq!(candidate(String::from(\"aaaaaaaaaaaaaaa\")), false);\n assert_eq!(candidate(String::from(\"Madam\")), true);\n assert_eq!(candidate(String::from(\"M\")), false);\n assert_eq!(candidate(String::from(\"0\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_58_common", - "language": "rs", - "prompt": "/// Return sorted unique common elements for two lists.\n/// >>> common(vec![1, 4, 3, 34, 653, 2, 5], vec![5, 7, 1, 5, 9, 653, 121])\n/// vec![1, 5, 653]\n/// >>> common(vec![5, 3, 2, 8], vec![3, 2])\n/// vec![2, 3]\nfn common(l1: Vec, l2: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = common;\n assert_eq!(candidate(vec![1, 4, 3, 34, 653, 2, 5], vec![5, 7, 1, 5, 9, 653, 121]), vec![1, 5, 653]);\n assert_eq!(candidate(vec![5, 3, 2, 8], vec![3, 2]), vec![2, 3]);\n assert_eq!(candidate(vec![4, 3, 2, 8], vec![3, 2, 4]), vec![2, 3, 4]);\n assert_eq!(candidate(vec![4, 3, 2, 8], Vec::::new()), Vec::::new());\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "rs", - "prompt": "/// The Brazilian factorial is defined as:\n/// brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n/// where n > 0\n/// For example:\n/// >>> special_factorial(4)\n/// 288\n/// The function will receive an integer as input and should return the special\n/// factorial of this integer.\nfn special_factorial(n: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = special_factorial;\n assert_eq!(candidate(4), 288);\n assert_eq!(candidate(5), 34560);\n assert_eq!(candidate(7), 125411328000);\n assert_eq!(candidate(1), 1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "rs", - "prompt": "/// In this problem, you will implement a function that takes two lists of numbers,\n/// and determines whether it is possible to perform an exchange of elements\n/// between them to make lst1 a list of only even numbers.\n/// There is no limit on the number of exchanged elements between lst1 and lst2.\n/// If it is possible to exchange elements between the lst1 and lst2 to make\n/// all the elements of lst1 to be even, return \"YES\".\n/// Otherwise, return \"NO\".\n/// For example:\n/// >>> exchange(vec![1, 2, 3, 4], vec![1, 2, 3, 4])\n/// String::from(\"YES\")\n/// >>> exchange(vec![1, 2, 3, 4], vec![1, 5, 3, 4])\n/// String::from(\"NO\")\n/// It is assumed that the input lists will be non-empty.\nfn exchange(lst1: Vec, lst2: Vec) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = exchange;\n assert_eq!(candidate(vec![1, 2, 3, 4], vec![1, 2, 3, 4]), String::from(\"YES\"));\n assert_eq!(candidate(vec![1, 2, 3, 4], vec![1, 5, 3, 4]), String::from(\"NO\"));\n assert_eq!(candidate(vec![1, 2, 3, 4], vec![2, 1, 4, 3]), String::from(\"YES\"));\n assert_eq!(candidate(vec![5, 7, 3], vec![2, 6, 4]), String::from(\"YES\"));\n assert_eq!(candidate(vec![5, 7, 3], vec![2, 6, 3]), String::from(\"NO\"));\n assert_eq!(candidate(vec![3, 2, 6, 1, 8, 9], vec![3, 5, 5, 1, 1, 1]), String::from(\"NO\"));\n assert_eq!(candidate(vec![100, 200], vec![200, 200]), String::from(\"YES\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "rs", - "prompt": "/// Given a non-empty array of integers arr and an integer k, return\n/// the sum of the elements with at most two digits from the first k elements of arr.\n/// Example:\n/// >>> add_elements(vec![111, 21, 3, 4000, 5, 6, 7, 8, 9], 4)\n/// 24\n/// Constraints:\n/// 1. 1 <= len(arr) <= 100\n/// 2. 1 <= k <= len(arr)\nfn add_elements(arr: Vec, k: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = add_elements;\n assert_eq!(candidate(vec![1, -2, -3, 41, 57, 76, 87, 88, 99], 3), -4);\n assert_eq!(candidate(vec![111, 121, 3, 4000, 5, 6], 2), 0);\n assert_eq!(candidate(vec![11, 21, 3, 90, 5, 6, 7, 8, 9], 4), 125);\n assert_eq!(candidate(vec![111, 21, 3, 4000, 5, 6, 7, 8, 9], 4), 24);\n assert_eq!(candidate(vec![1], 1), 1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "rs", - "prompt": "/// A simple program which should return the value of x if n is \n/// a prime number and should return the value of y otherwise.\n/// Examples:\n/// >>> x_or_y(7, 34, 12)\n/// 34\n/// >>> x_or_y(15, 8, 5)\n/// 5\nfn x_or_y(n: isize, x: isize, y: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = x_or_y;\n assert_eq!(candidate(7, 34, 12), 34);\n assert_eq!(candidate(15, 8, 5), 5);\n assert_eq!(candidate(3, 33, 5212), 33);\n assert_eq!(candidate(1259, 3, 52), 3);\n assert_eq!(candidate(7919, -1, 12), -1);\n assert_eq!(candidate(3609, 1245, 583), 583);\n assert_eq!(candidate(91, 56, 129), 129);\n assert_eq!(candidate(6, 34, 1234), 1234);\n assert_eq!(candidate(1, 2, 0), 0);\n assert_eq!(candidate(2, 2, 0), 2);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "rs", - "prompt": "/// Given length of a side and high return area for a triangle.\n/// >>> triangle_area(5, 3)\n/// 7.5\nfn triangle_area(a: isize, h: isize) -> f64 {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = triangle_area;\n assert_eq!(candidate(5, 3), 7.5);\n assert_eq!(candidate(2, 2), 2.0);\n assert_eq!(candidate(10, 8), 40.0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "rs", - "prompt": "/// Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n/// the last couple centuries. However, what people don't know is Tribonacci sequence.\n/// Tribonacci sequence is defined by the recurrence:\n/// tri(1) = 3\n/// tri(n) = 1 + n / 2, if n is even.\n/// tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n/// For example:\n/// tri(2) = 1 + (2 / 2) = 2\n/// tri(4) = 3\n/// tri(3) = tri(2) + tri(1) + tri(4)\n/// = 2 + 3 + 3 = 8 \n/// You are given a non-negative integer number n, you have to a return a list of the \n/// first n + 1 numbers of the Tribonacci sequence.\n/// Examples:\n/// >>> tri(3)\n/// vec![1, 3, 2, 8]\nfn tri(n: isize) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = tri;\n assert_eq!(candidate(3), vec![1, 3, 2, 8]);\n assert_eq!(candidate(4), vec![1, 3, 2, 8, 3]);\n assert_eq!(candidate(5), vec![1, 3, 2, 8, 3, 15]);\n assert_eq!(candidate(6), vec![1, 3, 2, 8, 3, 15, 4]);\n assert_eq!(candidate(7), vec![1, 3, 2, 8, 3, 15, 4, 24]);\n assert_eq!(candidate(8), vec![1, 3, 2, 8, 3, 15, 4, 24, 5]);\n assert_eq!(candidate(9), vec![1, 3, 2, 8, 3, 15, 4, 24, 5, 35]);\n assert_eq!(candidate(20), vec![1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11]);\n assert_eq!(candidate(0), vec![1]);\n assert_eq!(candidate(1), vec![1, 3]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "rs", - "prompt": "/// You are given a list of two strings, both strings consist of open\n/// parentheses '(' or close parentheses ')' only.\n/// Your job is to check if it is possible to concatenate the two strings in\n/// some order, that the resulting string will be good.\n/// A string S is considered to be good if and only if all parentheses in S\n/// are balanced. For example: the string '(())()' is good, while the string\n/// '())' is not.\n/// Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n/// Examples:\n/// >>> match_parens(vec![String::from(\"()(\"), String::from(\")\")])\n/// String::from(\"Yes\")\n/// >>> match_parens(vec![String::from(\")\"), String::from(\")\")])\n/// String::from(\"No\")\nfn match_parens(lst: Vec) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = match_parens;\n assert_eq!(candidate(vec![String::from(\"()(\"), String::from(\")\")]), String::from(\"Yes\"));\n assert_eq!(candidate(vec![String::from(\")\"), String::from(\")\")]), String::from(\"No\"));\n assert_eq!(candidate(vec![String::from(\"(()(())\"), String::from(\"())())\")]), String::from(\"No\"));\n assert_eq!(candidate(vec![String::from(\")())\"), String::from(\"(()()(\")]), String::from(\"Yes\"));\n assert_eq!(candidate(vec![String::from(\"(())))\"), String::from(\"(()())((\")]), String::from(\"Yes\"));\n assert_eq!(candidate(vec![String::from(\"()\"), String::from(\"())\")]), String::from(\"No\"));\n assert_eq!(candidate(vec![String::from(\"(()(\"), String::from(\"()))()\")]), String::from(\"Yes\"));\n assert_eq!(candidate(vec![String::from(\"((((\"), String::from(\"((())\")]), String::from(\"No\"));\n assert_eq!(candidate(vec![String::from(\")(()\"), String::from(\"(()(\")]), String::from(\"No\"));\n assert_eq!(candidate(vec![String::from(\")(\"), String::from(\")(\")]), String::from(\"No\"));\n assert_eq!(candidate(vec![String::from(\"(\"), String::from(\")\")]), String::from(\"Yes\"));\n assert_eq!(candidate(vec![String::from(\")\"), String::from(\"(\")]), String::from(\"Yes\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "rs", - "prompt": "/// From a list of integers, remove all elements that occur more than once.\n/// Keep order of elements left the same as in the input.\n/// >>> remove_duplicates(vec![1, 2, 3, 2, 4])\n/// vec![1, 3, 4]\nfn remove_duplicates(numbers: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = remove_duplicates;\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![1, 2, 3, 4]), vec![1, 2, 3, 4]);\n assert_eq!(candidate(vec![1, 2, 3, 2, 4, 3, 5]), vec![1, 4, 5]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "rs", - "prompt": "/// Return a greatest common divisor of two integers a and b\n/// >>> greatest_common_divisor(3, 5)\n/// 1\n/// >>> greatest_common_divisor(25, 15)\n/// 5\nfn greatest_common_divisor(a: isize, b: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = greatest_common_divisor;\n assert_eq!(candidate(3, 7), 1);\n assert_eq!(candidate(10, 15), 5);\n assert_eq!(candidate(49, 14), 7);\n assert_eq!(candidate(144, 60), 12);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "rs", - "prompt": "/// Checks if given string is a palindrome\n/// >>> is_palindrome(String::from(\"\"))\n/// true\n/// >>> is_palindrome(String::from(\"aba\"))\n/// true\n/// >>> is_palindrome(String::from(\"aaaaa\"))\n/// true\n/// >>> is_palindrome(String::from(\"zbcd\"))\n/// false\nfn is_palindrome(text: String) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = is_palindrome;\n assert_eq!(candidate(String::from(\"\")), true);\n assert_eq!(candidate(String::from(\"aba\")), true);\n assert_eq!(candidate(String::from(\"aaaaa\")), true);\n assert_eq!(candidate(String::from(\"zbcd\")), false);\n assert_eq!(candidate(String::from(\"xywyx\")), true);\n assert_eq!(candidate(String::from(\"xywyz\")), false);\n assert_eq!(candidate(String::from(\"xywzx\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "rs", - "prompt": "/// xs represent coefficients of a polynomial.\n/// xs[0] + xs[1] * x + xs[2] * x^2 + ....\n/// Return derivative of this polynomial in the same form.\n/// >>> derivative(vec![3, 1, 2, 4, 5])\n/// vec![1, 4, 12, 20]\n/// >>> derivative(vec![1, 2, 3])\n/// vec![2, 6]\nfn derivative(xs: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = derivative;\n assert_eq!(candidate(vec![3, 1, 2, 4, 5]), vec![1, 4, 12, 20]);\n assert_eq!(candidate(vec![1, 2, 3]), vec![2, 6]);\n assert_eq!(candidate(vec![3, 2, 1]), vec![2, 2]);\n assert_eq!(candidate(vec![3, 2, 1, 0, 4]), vec![2, 2, 0, 16]);\n assert_eq!(candidate(vec![1]), Vec::::new());\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "rs", - "prompt": "/// In this task, you will be given a string that represents a number of apples and oranges \n/// that are distributed in a basket of fruit this basket contains \n/// apples, oranges, and mango fruits. Given the string that represents the total number of \n/// the oranges and apples and an integer that represent the total number of the fruits \n/// in the basket return the number of the mango fruits in the basket.\n/// for examble:\n/// >>> fruit_distribution(String::from(\"5 apples and 6 oranges\"), 19)\n/// 8\n/// >>> fruit_distribution(String::from(\"0 apples and 1 oranges\"), 3)\n/// 2\n/// >>> fruit_distribution(String::from(\"2 apples and 3 oranges\"), 100)\n/// 95\n/// >>> fruit_distribution(String::from(\"100 apples and 1 oranges\"), 120)\n/// 19\nfn fruit_distribution(s: String, n: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = fruit_distribution;\n assert_eq!(candidate(String::from(\"5 apples and 6 oranges\"), 19), 8);\n assert_eq!(candidate(String::from(\"5 apples and 6 oranges\"), 21), 10);\n assert_eq!(candidate(String::from(\"0 apples and 1 oranges\"), 3), 2);\n assert_eq!(candidate(String::from(\"1 apples and 0 oranges\"), 3), 2);\n assert_eq!(candidate(String::from(\"2 apples and 3 oranges\"), 100), 95);\n assert_eq!(candidate(String::from(\"2 apples and 3 oranges\"), 5), 0);\n assert_eq!(candidate(String::from(\"1 apples and 100 oranges\"), 120), 19);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "rs", - "prompt": "/// Write a function that takes an integer a and returns True \n/// if this ingeger is a cube of some integer number.\n/// Note: you may assume the input is always valid.\n/// Examples:\n/// >>> iscube(1)\n/// true\n/// >>> iscube(2)\n/// false\n/// >>> iscube(-1)\n/// true\n/// >>> iscube(64)\n/// true\n/// >>> iscube(0)\n/// true\n/// >>> iscube(180)\n/// false\nfn iscube(a: isize) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = iscube;\n assert_eq!(candidate(1), true);\n assert_eq!(candidate(2), false);\n assert_eq!(candidate(-1), true);\n assert_eq!(candidate(64), true);\n assert_eq!(candidate(180), false);\n assert_eq!(candidate(1000), true);\n assert_eq!(candidate(0), true);\n assert_eq!(candidate(1729), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "rs", - "prompt": "/// In this Kata, you have to sort an array of non-negative integers according to\n/// number of ones in their binary representation in ascending order.\n/// For similar number of ones, sort based on decimal value.\n/// It must be implemented like this:\n/// >>> sort_array(vec![1, 5, 2, 3, 4])\n/// vec![1, 2, 3, 4, 5]\n/// >>> sort_array(vec![-2, -3, -4, -5, -6])\n/// vec![-6, -5, -4, -3, -2]\n/// >>> sort_array(vec![1, 0, 2, 3, 4])\n/// vec![0, 1, 2, 3, 4]\nfn sort_array(arr: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = sort_array;\n assert_eq!(candidate(vec![1, 5, 2, 3, 4]), vec![1, 2, 4, 3, 5]);\n assert_eq!(candidate(vec![-2, -3, -4, -5, -6]), vec![-4, -2, -6, -5, -3]);\n assert_eq!(candidate(vec![1, 0, 2, 3, 4]), vec![0, 1, 2, 4, 3]);\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]), vec![2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77]);\n assert_eq!(candidate(vec![3, 6, 44, 12, 32, 5]), vec![32, 3, 5, 6, 12, 44]);\n assert_eq!(candidate(vec![2, 4, 8, 16, 32]), vec![2, 4, 8, 16, 32]);\n assert_eq!(candidate(vec![2, 4, 8, 16, 32]), vec![2, 4, 8, 16, 32]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "rs", - "prompt": "/// Given a list of strings, where each string consists of only digits, return a list.\n/// Each element i of the output should be \"the number of odd elements in the\n/// string i of the input.\" where all the i's should be replaced by the number\n/// of odd digits in the i'th string of the input.\n/// >>> odd_count(vec![String::from(\"1234567\")])\n/// vec![String::from(\"the number of odd elements 4n the str4ng 4 of the 4nput.\")]\n/// >>> odd_count(vec![String::from(\"3\"), String::from(\"11111111\")])\n/// vec![String::from(\"the number of odd elements 1n the str1ng 1 of the 1nput.\"), String::from(\"the number of odd elements 8n the str8ng 8 of the 8nput.\")]\nfn odd_count(lst: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = odd_count;\n assert_eq!(candidate(vec![String::from(\"1234567\")]), vec![String::from(\"the number of odd elements 4n the str4ng 4 of the 4nput.\")]);\n assert_eq!(candidate(vec![String::from(\"3\"), String::from(\"11111111\")]), vec![String::from(\"the number of odd elements 1n the str1ng 1 of the 1nput.\"), String::from(\"the number of odd elements 8n the str8ng 8 of the 8nput.\")]);\n assert_eq!(candidate(vec![String::from(\"271\"), String::from(\"137\"), String::from(\"314\")]), vec![String::from(\"the number of odd elements 2n the str2ng 2 of the 2nput.\"), String::from(\"the number of odd elements 3n the str3ng 3 of the 3nput.\"), String::from(\"the number of odd elements 2n the str2ng 2 of the 2nput.\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "rs", - "prompt": "/// brackets is a string of \"(\" and \")\".\n/// return True if every opening bracket has a corresponding closing bracket.\n/// >>> correct_bracketing(String::from(\"(\"))\n/// false\n/// >>> correct_bracketing(String::from(\"()\"))\n/// true\n/// >>> correct_bracketing(String::from(\"(()())\"))\n/// true\n/// >>> correct_bracketing(String::from(\")(()\"))\n/// false\nfn correct_bracketing(brackets: String) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = correct_bracketing;\n assert_eq!(candidate(String::from(\"()\")), true);\n assert_eq!(candidate(String::from(\"(()())\")), true);\n assert_eq!(candidate(String::from(\"()()(()())()\")), true);\n assert_eq!(candidate(String::from(\"()()((()()())())(()()(()))\")), true);\n assert_eq!(candidate(String::from(\"((()())))\")), false);\n assert_eq!(candidate(String::from(\")(()\")), false);\n assert_eq!(candidate(String::from(\"(\")), false);\n assert_eq!(candidate(String::from(\"((((\")), false);\n assert_eq!(candidate(String::from(\")\")), false);\n assert_eq!(candidate(String::from(\"(()\")), false);\n assert_eq!(candidate(String::from(\"()()(()())())(()\")), false);\n assert_eq!(candidate(String::from(\"()()(()())()))()\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "rs", - "prompt": "/// Task\n/// Write a function that takes a string as input and returns the sum of the upper characters only'\n/// ASCII codes.\n/// Examples:\n/// >>> digitSum(String::from(\"\"))\n/// 0\n/// >>> digitSum(String::from(\"abAB\"))\n/// 131\n/// >>> digitSum(String::from(\"abcCd\"))\n/// 67\n/// >>> digitSum(String::from(\"helloE\"))\n/// 69\n/// >>> digitSum(String::from(\"woArBld\"))\n/// 131\n/// >>> digitSum(String::from(\"aAaaaXa\"))\n/// 153\nfn digitSum(s: String) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = digitSum;\n assert_eq!(candidate(String::from(\"\")), 0);\n assert_eq!(candidate(String::from(\"abAB\")), 131);\n assert_eq!(candidate(String::from(\"abcCd\")), 67);\n assert_eq!(candidate(String::from(\"helloE\")), 69);\n assert_eq!(candidate(String::from(\"woArBld\")), 131);\n assert_eq!(candidate(String::from(\"aAaaaXa\")), 153);\n assert_eq!(candidate(String::from(\" How are yOu?\")), 151);\n assert_eq!(candidate(String::from(\"You arE Very Smart\")), 327);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "rs", - "prompt": "/// Write a function that accepts a list of strings as a parameter,\n/// deletes the strings that have odd lengths from it,\n/// and returns the resulted list with a sorted order,\n/// The list is always a list of strings and never an array of numbers,\n/// and it may contain duplicates.\n/// The order of the list should be ascending by length of each word, and you\n/// should return the list sorted by that rule.\n/// If two words have the same length, sort the list alphabetically.\n/// The function should return a list of strings in sorted order.\n/// You may assume that all words will have the same length.\n/// For example:\n/// >>> list_sort(vec![String::from(\"aa\"), String::from(\"a\"), String::from(\"aaa\")])\n/// vec![String::from(\"aa\")]\n/// >>> list_sort(vec![String::from(\"ab\"), String::from(\"a\"), String::from(\"aaa\"), String::from(\"cd\")])\n/// vec![String::from(\"ab\"), String::from(\"cd\")]\nfn sorted_list_sum(lst: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = sorted_list_sum;\n assert_eq!(candidate(vec![String::from(\"aa\"), String::from(\"a\"), String::from(\"aaa\")]), vec![String::from(\"aa\")]);\n assert_eq!(candidate(vec![String::from(\"school\"), String::from(\"AI\"), String::from(\"asdf\"), String::from(\"b\")]), vec![String::from(\"AI\"), String::from(\"asdf\"), String::from(\"school\")]);\n assert_eq!(candidate(vec![String::from(\"d\"), String::from(\"b\"), String::from(\"c\"), String::from(\"a\")]), Vec::::new());\n assert_eq!(candidate(vec![String::from(\"d\"), String::from(\"dcba\"), String::from(\"abcd\"), String::from(\"a\")]), vec![String::from(\"abcd\"), String::from(\"dcba\")]);\n assert_eq!(candidate(vec![String::from(\"AI\"), String::from(\"ai\"), String::from(\"au\")]), vec![String::from(\"AI\"), String::from(\"ai\"), String::from(\"au\")]);\n assert_eq!(candidate(vec![String::from(\"a\"), String::from(\"b\"), String::from(\"b\"), String::from(\"c\"), String::from(\"c\"), String::from(\"a\")]), Vec::::new());\n assert_eq!(candidate(vec![String::from(\"aaaa\"), String::from(\"bbbb\"), String::from(\"dd\"), String::from(\"cc\")]), vec![String::from(\"cc\"), String::from(\"dd\"), String::from(\"aaaa\"), String::from(\"bbbb\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "rs", - "prompt": "/// You are given an array arr of integers and you need to return\n/// sum of magnitudes of integers multiplied by product of all signs\n/// of each number in the array, represented by 1, -1 or 0.\n/// Note: return None for empty arr.\n/// Example:\n/// >>> prod_signs(vec![1, 2, 2, -4])\n/// Some(9)\n/// >>> prod_signs(vec![0, 1])\n/// Some(0)\n/// >>> prod_signs(vec![])\n/// None\nfn prod_signs(arr: Vec) -> Option {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = prod_signs;\n assert_eq!(candidate(vec![1, 2, 2, -4]), Some(-9));\n assert_eq!(candidate(vec![0, 1]), Some(0));\n assert_eq!(candidate(vec![1, 1, 1, 2, 3, -1, 1]), Some(-10));\n assert_eq!(candidate(Vec::::new()), None);\n assert_eq!(candidate(vec![2, 4, 1, 2, -1, -1, 9]), Some(20));\n assert_eq!(candidate(vec![-1, 1, -1, 1]), Some(4));\n assert_eq!(candidate(vec![-1, 1, 1, 1]), Some(-4));\n assert_eq!(candidate(vec![-1, 1, 1, 0]), Some(0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "rs", - "prompt": "/// Return list with elements incremented by 1.\n/// >>> incr_list(vec![1, 2, 3])\n/// vec![2, 3, 4]\n/// >>> incr_list(vec![5, 3, 5, 2, 3, 3, 9, 0, 123])\n/// vec![6, 4, 6, 3, 4, 4, 10, 1, 124]\nfn incr_list(l: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = incr_list;\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![3, 2, 1]), vec![4, 3, 2]);\n assert_eq!(candidate(vec![5, 2, 5, 2, 3, 3, 9, 0, 123]), vec![6, 3, 6, 3, 4, 4, 10, 1, 124]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "rs", - "prompt": "/// From a given list of integers, generate a list of rolling maximum element found until given moment\n/// in the sequence.\n/// >>> rolling_max(vec![1, 2, 3, 2, 3, 4, 2])\n/// vec![1, 2, 3, 3, 3, 4, 4]\nfn rolling_max(numbers: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = rolling_max;\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![1, 2, 3, 4]), vec![1, 2, 3, 4]);\n assert_eq!(candidate(vec![4, 3, 2, 1]), vec![4, 4, 4, 4]);\n assert_eq!(candidate(vec![3, 2, 3, 100, 3]), vec![3, 3, 3, 100, 100]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "rs", - "prompt": "/// Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n/// separate those group into separate strings and return the list of those.\n/// Separate groups are balanced (each open brace is properly closed) and not nested within each other\n/// Ignore any spaces in the input string.\n/// >>> separate_paren_groups(String::from(\"( ) (( )) (( )( ))\"))\n/// vec![String::from(\"()\"), String::from(\"(())\"), String::from(\"(()())\")]\nfn separate_paren_groups(paren_string: String) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = separate_paren_groups;\n assert_eq!(candidate(String::from(\"(()()) ((())) () ((())()())\")), vec![String::from(\"(()())\"), String::from(\"((()))\"), String::from(\"()\"), String::from(\"((())()())\")]);\n assert_eq!(candidate(String::from(\"() (()) ((())) (((())))\")), vec![String::from(\"()\"), String::from(\"(())\"), String::from(\"((()))\"), String::from(\"(((())))\")]);\n assert_eq!(candidate(String::from(\"(()(())((())))\")), vec![String::from(\"(()(())((())))\")]);\n assert_eq!(candidate(String::from(\"( ) (( )) (( )( ))\")), vec![String::from(\"()\"), String::from(\"(())\"), String::from(\"(()())\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "rs", - "prompt": "/// You will be given a string of words separated by commas or spaces. Your task is\n/// to split the string into words and return an array of the words.\n/// For example:\n/// >>> words_string(String::from(\"Hi, my name is John\"))\n/// vec![String::from(\"Hi\"), String::from(\"my\"), String::from(\"name\"), String::from(\"is\"), String::from(\"John\")]\n/// >>> words_string(String::from(\"One, two, three, four, five, six\"))\n/// vec![String::from(\"One\"), String::from(\"two\"), String::from(\"three\"), String::from(\"four\"), String::from(\"five\"), String::from(\"six\")]\nfn words_string(s: String) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = words_string;\n assert_eq!(candidate(String::from(\"Hi, my name is John\")), vec![String::from(\"Hi\"), String::from(\"my\"), String::from(\"name\"), String::from(\"is\"), String::from(\"John\")]);\n assert_eq!(candidate(String::from(\"One, two, three, four, five, six\")), vec![String::from(\"One\"), String::from(\"two\"), String::from(\"three\"), String::from(\"four\"), String::from(\"five\"), String::from(\"six\")]);\n assert_eq!(candidate(String::from(\"Hi, my name\")), vec![String::from(\"Hi\"), String::from(\"my\"), String::from(\"name\")]);\n assert_eq!(candidate(String::from(\"One,, two, three, four, five, six,\")), vec![String::from(\"One\"), String::from(\"two\"), String::from(\"three\"), String::from(\"four\"), String::from(\"five\"), String::from(\"six\")]);\n assert_eq!(candidate(String::from(\"\")), Vec::::new());\n assert_eq!(candidate(String::from(\"ahmed , gamal\")), vec![String::from(\"ahmed\"), String::from(\"gamal\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "rs", - "prompt": "/// This function takes a list l and returns a list l' such that\n/// l' is identical to l in the odd indicies, while its values at the even indicies are equal\n/// to the values of the even indicies of l, but sorted.\n/// >>> sort_even(vec![1, 2, 3])\n/// vec![1, 2, 3]\n/// >>> sort_even(vec![5, 6, 3, 4])\n/// vec![3, 6, 5, 4]\nfn sort_even(l: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = sort_even;\n assert_eq!(candidate(vec![1, 2, 3]), vec![1, 2, 3]);\n assert_eq!(candidate(vec![5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]), vec![-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123]);\n assert_eq!(candidate(vec![5, 8, -12, 4, 23, 2, 3, 11, 12, -10]), vec![-12, 8, 3, 4, 5, 2, 12, 11, 23, -10]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "rs", - "prompt": "/// I think we all remember that feeling when the result of some long-awaited\n/// event is finally known. The feelings and thoughts you have at that moment are\n/// definitely worth noting down and comparing.\n/// Your task is to determine if a person correctly guessed the results of a number of matches.\n/// You are given two arrays of scores and guesses of equal length, where each index shows a match. \n/// Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n/// the value is 0, and if not, the value is the absolute difference between the guess and the score.\n/// example:\n/// >>> compare(vec![1, 2, 3, 4, 5, 1], vec![1, 2, 3, 4, 2, -2])\n/// vec![0, 0, 0, 0, 3, 3]\n/// >>> compare(vec![0, 5, 0, 0, 0, 4], vec![4, 1, 1, 0, 0, -2])\n/// vec![4, 4, 1, 0, 0, 6]\nfn compare(game: Vec, guess: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = compare;\n assert_eq!(candidate(vec![1, 2, 3, 4, 5, 1], vec![1, 2, 3, 4, 2, -2]), vec![0, 0, 0, 0, 3, 3]);\n assert_eq!(candidate(vec![0, 0, 0, 0, 0, 0], vec![0, 0, 0, 0, 0, 0]), vec![0, 0, 0, 0, 0, 0]);\n assert_eq!(candidate(vec![1, 2, 3], vec![-1, -2, -3]), vec![2, 4, 6]);\n assert_eq!(candidate(vec![1, 2, 3, 5], vec![-1, 2, 3, 4]), vec![2, 0, 0, 1]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "rs", - "prompt": "/// Given a positive integer n, return a tuple that has the number of even and odd\n/// integer palindromes that fall within the range(1, n), inclusive.\n/// Example 1:\n/// >>> even_odd_palindrome(3)\n/// (1, 2)\n/// Explanation:\n/// Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n/// Example 2:\n/// >>> even_odd_palindrome(12)\n/// (4, 6)\n/// Explanation:\n/// Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n/// Note:\n/// 1. 1 <= n <= 10^3\n/// 2. returned tuple has the number of even and odd integer palindromes respectively.\nfn even_odd_palindrome(n: isize) -> (isize, isize) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = even_odd_palindrome;\n assert_eq!(candidate(123), (8, 13));\n assert_eq!(candidate(12), (4, 6));\n assert_eq!(candidate(3), (1, 2));\n assert_eq!(candidate(63), (6, 8));\n assert_eq!(candidate(25), (5, 6));\n assert_eq!(candidate(19), (4, 6));\n assert_eq!(candidate(9), (4, 5));\n assert_eq!(candidate(1), (0, 1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "rs", - "prompt": "/// The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n/// fib4(0) -> 0\n/// fib4(1) -> 0\n/// fib4(2) -> 2\n/// fib4(3) -> 0\n/// fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n/// Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n/// >>> fib4(5)\n/// 4\n/// >>> fib4(6)\n/// 8\n/// >>> fib4(7)\n/// 14\nfn fib4(n: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = fib4;\n assert_eq!(candidate(5), 4);\n assert_eq!(candidate(8), 28);\n assert_eq!(candidate(10), 104);\n assert_eq!(candidate(12), 386);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "rs", - "prompt": "/// Given two positive integers a and b, return the even digits between a\n/// and b, in ascending order.\n/// For example:\n/// >>> generate_integers(2, 8)\n/// vec![2, 4, 6, 8]\n/// >>> generate_integers(8, 2)\n/// vec![2, 4, 6, 8]\n/// >>> generate_integers(10, 14)\n/// Vec::::new()\nfn generate_integers(a: isize, b: isize) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = generate_integers;\n assert_eq!(candidate(2, 10), vec![2, 4, 6, 8]);\n assert_eq!(candidate(10, 2), vec![2, 4, 6, 8]);\n assert_eq!(candidate(132, 2), vec![2, 4, 6, 8]);\n assert_eq!(candidate(17, 89), Vec::::new());\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "rs", - "prompt": "/// For a given list of input numbers, calculate Mean Absolute Deviation\n/// around the mean of this dataset.\n/// Mean Absolute Deviation is the average absolute difference between each\n/// element and a centerpoint (mean in this case):\n/// MAD = average | x - x_mean |\n/// >>> mean_absolute_deviation(vec![1.0, 2.0, 3.0, 4.0])\n/// 1.0\nfn mean_absolute_deviation(numbers: Vec) -> f64 {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = mean_absolute_deviation;\n assert_eq!(candidate(vec![1.0, 2.0]), 0.5);\n assert_eq!(candidate(vec![1.0, 2.0, 3.0, 4.0]), 1.0);\n assert_eq!(candidate(vec![1.0, 2.0, 3.0, 4.0, 5.0]), 1.2);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "rs", - "prompt": "/// Create a function encrypt that takes a string as an argument and\n/// returns a string encrypted with the alphabet being rotated. \n/// The alphabet should be rotated in a manner such that the letters \n/// shift down by two multiplied to two places.\n/// For example:\n/// >>> encrypt(String::from(\"hi\"))\n/// String::from(\"lm\")\n/// >>> encrypt(String::from(\"asdfghjkl\"))\n/// String::from(\"ewhjklnop\")\n/// >>> encrypt(String::from(\"gf\"))\n/// String::from(\"kj\")\n/// >>> encrypt(String::from(\"et\"))\n/// String::from(\"ix\")\nfn encrypt(s: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = encrypt;\n assert_eq!(candidate(String::from(\"hi\")), String::from(\"lm\"));\n assert_eq!(candidate(String::from(\"asdfghjkl\")), String::from(\"ewhjklnop\"));\n assert_eq!(candidate(String::from(\"gf\")), String::from(\"kj\"));\n assert_eq!(candidate(String::from(\"et\")), String::from(\"ix\"));\n assert_eq!(candidate(String::from(\"faewfawefaewg\")), String::from(\"jeiajeaijeiak\"));\n assert_eq!(candidate(String::from(\"hellomyfriend\")), String::from(\"lippsqcjvmirh\"));\n assert_eq!(candidate(String::from(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\")), String::from(\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\"));\n assert_eq!(candidate(String::from(\"a\")), String::from(\"e\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "rs", - "prompt": "/// Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n/// The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n/// as follows: start with any positive integer n. Then each term is obtained from the \n/// previous term as follows: if the previous term is even, the next term is one half of \n/// the previous term. If the previous term is odd, the next term is 3 times the previous\n/// term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n/// Note: \n/// 1. Collatz(1) is [1].\n/// 2. returned list sorted in increasing order.\n/// For example:\n/// get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n/// >>> get_odd_collatz(5)\n/// vec![1, 5]\nfn get_odd_collatz(n: isize) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = get_odd_collatz;\n assert_eq!(candidate(14), vec![1, 5, 7, 11, 13, 17]);\n assert_eq!(candidate(5), vec![1, 5]);\n assert_eq!(candidate(12), vec![1, 3, 5]);\n assert_eq!(candidate(1), vec![1]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "rs", - "prompt": "/// Find how many times a given substring can be found in the original string. Count overlaping cases.\n/// >>> how_many_times(String::from(\"\"), String::from(\"a\"))\n/// 0\n/// >>> how_many_times(String::from(\"aaa\"), String::from(\"a\"))\n/// 3\n/// >>> how_many_times(String::from(\"aaaa\"), String::from(\"aa\"))\n/// 3\nfn how_many_times(string: String, substring: String) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = how_many_times;\n assert_eq!(candidate(String::from(\"\"), String::from(\"x\")), 0);\n assert_eq!(candidate(String::from(\"xyxyxyx\"), String::from(\"x\")), 4);\n assert_eq!(candidate(String::from(\"cacacacac\"), String::from(\"cac\")), 4);\n assert_eq!(candidate(String::from(\"john doe\"), String::from(\"john\")), 1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "rs", - "prompt": "/// We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n/// numbers in the array will be randomly ordered. Your task is to determine if\n/// it is possible to get an array sorted in non-decreasing order by performing \n/// the following operation on the given array:\n/// You are allowed to perform right shift operation any number of times.\n/// One right shift operation means shifting all elements of the array by one\n/// position in the right direction. The last element of the array will be moved to\n/// the starting position in the array i.e. 0th index. \n/// If it is possible to obtain the sorted array by performing the above operation\n/// then return True else return False.\n/// If the given array is empty then return True.\n/// Note: The given list is guaranteed to have unique elements.\n/// For Example:\n/// >>> move_one_ball(vec![3, 4, 5, 1, 2])\n/// true\n/// Explanation: By performin 2 right shift operations, non-decreasing order can\n/// be achieved for the given array.\n/// >>> move_one_ball(vec![3, 5, 4, 1, 2])\n/// false\n/// Explanation:It is not possible to get non-decreasing order for the given\n/// array by performing any number of right shift operations.\nfn move_one_ball(arr: Vec) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = move_one_ball;\n assert_eq!(candidate(vec![3, 4, 5, 1, 2]), true);\n assert_eq!(candidate(vec![3, 5, 10, 1, 2]), true);\n assert_eq!(candidate(vec![4, 3, 1, 2]), false);\n assert_eq!(candidate(vec![3, 5, 4, 1, 2]), false);\n assert_eq!(candidate(Vec::::new()), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "rs", - "prompt": "/// Write a function which sorts the given list of integers\n/// in ascending order according to the sum of their digits.\n/// Note: if there are several items with similar sum of their digits,\n/// order them based on their index in original list.\n/// For example:\n/// >>> order_by_points(vec![1, 11, -1, -11, -12])\n/// vec![-1, -11, 1, -12, 11]\n/// >>> order_by_points(vec![])\n/// Vec::::new()\nfn order_by_points(nums: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = order_by_points;\n assert_eq!(candidate(vec![1, 11, -1, -11, -12]), vec![-1, -11, 1, -12, 11]);\n assert_eq!(candidate(vec![1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]), vec![0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457]);\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![1, -11, -32, 43, 54, -98, 2, -3]), vec![-3, -32, -98, -11, 1, 2, 43, 54]);\n assert_eq!(candidate(vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]), vec![1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9]);\n assert_eq!(candidate(vec![0, 6, 6, -76, -21, 23, 4]), vec![-76, -21, 0, 4, 23, 6, 6]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "rs", - "prompt": "/// Return list of prime factors of given integer in the order from smallest to largest.\n/// Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n/// Input number should be equal to the product of all factors\n/// >>> factorize(8)\n/// vec![2, 2, 2]\n/// >>> factorize(25)\n/// vec![5, 5]\n/// >>> factorize(70)\n/// vec![2, 5, 7]\nfn factorize(n: isize) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = factorize;\n assert_eq!(candidate(2), vec![2]);\n assert_eq!(candidate(4), vec![2, 2]);\n assert_eq!(candidate(8), vec![2, 2, 2]);\n assert_eq!(candidate(57), vec![3, 19]);\n assert_eq!(candidate(3249), vec![3, 3, 19, 19]);\n assert_eq!(candidate(185193), vec![3, 3, 3, 19, 19, 19]);\n assert_eq!(candidate(20577), vec![3, 19, 19, 19]);\n assert_eq!(candidate(18), vec![2, 3, 3]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "rs", - "prompt": "/// Return True if all numbers in the list l are below threshold t.\n/// >>> below_threshold(vec![1, 2, 4, 10], 100)\n/// true\n/// >>> below_threshold(vec![1, 20, 4, 10], 5)\n/// false\nfn below_threshold(l: Vec, t: isize) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = below_threshold;\n assert_eq!(candidate(vec![1, 2, 4, 10], 100), true);\n assert_eq!(candidate(vec![1, 20, 4, 10], 5), false);\n assert_eq!(candidate(vec![1, 20, 4, 10], 21), true);\n assert_eq!(candidate(vec![1, 20, 4, 10], 22), true);\n assert_eq!(candidate(vec![1, 8, 4, 10], 11), true);\n assert_eq!(candidate(vec![1, 8, 4, 10], 10), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "rs", - "prompt": "/// Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n/// For each of the group, output the deepest level of nesting of parentheses.\n/// E.g. (()()) has maximum two levels of nesting while ((())) has three.\n/// >>> parse_nested_parens(String::from(\"(()()) ((())) () ((())()())\"))\n/// vec![2, 3, 1, 3]\nfn parse_nested_parens(paren_string: String) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = parse_nested_parens;\n assert_eq!(candidate(String::from(\"(()()) ((())) () ((())()())\")), vec![2, 3, 1, 3]);\n assert_eq!(candidate(String::from(\"() (()) ((())) (((())))\")), vec![1, 2, 3, 4]);\n assert_eq!(candidate(String::from(\"(()(())((())))\")), vec![4]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "rs", - "prompt": "/// Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n/// Examples\n/// >>> solution(vec![5, 8, 7, 1])\n/// 12\n/// >>> solution(vec![3, 3, 3, 3, 3])\n/// 9\n/// >>> solution(vec![30, 13, 24, 321])\n/// 0\nfn solution(lst: Vec) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = solution;\n assert_eq!(candidate(vec![5, 8, 7, 1]), 12);\n assert_eq!(candidate(vec![3, 3, 3, 3, 3]), 9);\n assert_eq!(candidate(vec![30, 13, 24, 321]), 0);\n assert_eq!(candidate(vec![5, 9]), 5);\n assert_eq!(candidate(vec![2, 4, 8]), 0);\n assert_eq!(candidate(vec![30, 13, 23, 32]), 23);\n assert_eq!(candidate(vec![3, 13, 2, 9]), 3);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "rs", - "prompt": "/// You are given a positive integer n. You have to create an integer array a of length n.\n/// For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n/// Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n/// and a[i] + a[j] + a[k] is a multiple of 3.\n/// Example :\n/// >>> get_max_triples(5)\n/// 1\n/// Explanation: \n/// a = [1, 3, 7, 13, 21]\n/// The only valid triple is (1, 7, 13).\nfn get_max_triples(n: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = get_max_triples;\n assert_eq!(candidate(5), 1);\n assert_eq!(candidate(6), 4);\n assert_eq!(candidate(10), 36);\n assert_eq!(candidate(100), 53361);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "rs", - "prompt": "/// You are given a list of integers.\n/// Write a function next_smallest() that returns the 2nd smallest element of the list.\n/// Return None if there is no such element.\n/// >>> next_smallest(vec![1, 2, 3, 4, 5])\n/// Some(2)\n/// >>> next_smallest(vec![5, 1, 4, 3, 2])\n/// Some(2)\n/// >>> next_smallest(vec![])\n/// None\n/// >>> next_smallest(vec![1, 1])\n/// None\nfn next_smallest(lst: Vec) -> Option {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = next_smallest;\n assert_eq!(candidate(vec![1, 2, 3, 4, 5]), Some(2));\n assert_eq!(candidate(vec![5, 1, 4, 3, 2]), Some(2));\n assert_eq!(candidate(Vec::::new()), None);\n assert_eq!(candidate(vec![1, 1]), None);\n assert_eq!(candidate(vec![1, 1, 1, 1, 0]), Some(1));\n assert_eq!(candidate(vec![1, 1]), None);\n assert_eq!(candidate(vec![-35, 34, 12, -45]), Some(-35));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "rs", - "prompt": "/// Input is a space-delimited string of numberals from 'zero' to 'nine'.\n/// Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n/// Return the string with numbers sorted from smallest to largest\n/// >>> sort_numbers(String::from(\"three one five\"))\n/// String::from(\"one three five\")\nfn sort_numbers(numbers: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = sort_numbers;\n assert_eq!(candidate(String::from(\"\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"three\")), String::from(\"three\"));\n assert_eq!(candidate(String::from(\"three five nine\")), String::from(\"three five nine\"));\n assert_eq!(candidate(String::from(\"five zero four seven nine eight\")), String::from(\"zero four five seven eight nine\"));\n assert_eq!(candidate(String::from(\"six five four three two one zero\")), String::from(\"zero one two three four five six\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "rs", - "prompt": "/// You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n/// >>> cycpattern_check(String::from(\"abcd\"), String::from(\"abd\"))\n/// false\n/// >>> cycpattern_check(String::from(\"hello\"), String::from(\"ell\"))\n/// true\n/// >>> cycpattern_check(String::from(\"whassup\"), String::from(\"psus\"))\n/// false\n/// >>> cycpattern_check(String::from(\"abab\"), String::from(\"baa\"))\n/// true\n/// >>> cycpattern_check(String::from(\"efef\"), String::from(\"eeff\"))\n/// false\n/// >>> cycpattern_check(String::from(\"himenss\"), String::from(\"simen\"))\n/// true\nfn cycpattern_check(a: String, b: String) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = cycpattern_check;\n assert_eq!(candidate(String::from(\"xyzw\"), String::from(\"xyw\")), false);\n assert_eq!(candidate(String::from(\"yello\"), String::from(\"ell\")), true);\n assert_eq!(candidate(String::from(\"whattup\"), String::from(\"ptut\")), false);\n assert_eq!(candidate(String::from(\"efef\"), String::from(\"fee\")), true);\n assert_eq!(candidate(String::from(\"abab\"), String::from(\"aabb\")), false);\n assert_eq!(candidate(String::from(\"winemtt\"), String::from(\"tinem\")), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "rs", - "prompt": "/// You will be given a number in decimal form and your task is to convert it to\n/// binary format. The function should return a string, with each character representing a binary\n/// number. Each character in the string will be '0' or '1'.\n/// There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n/// The extra characters are there to help with the format.\n/// Examples:\n/// >>> decimal_to_binary(15)\n/// String::from(\"db1111db\")\n/// >>> decimal_to_binary(32)\n/// String::from(\"db100000db\")\nfn decimal_to_binary(decimal: isize) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = decimal_to_binary;\n assert_eq!(candidate(0), String::from(\"db0db\"));\n assert_eq!(candidate(32), String::from(\"db100000db\"));\n assert_eq!(candidate(103), String::from(\"db1100111db\"));\n assert_eq!(candidate(15), String::from(\"db1111db\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "rs", - "prompt": "/// Filter an input list of strings only for ones that contain given substring\n/// >>> filter_by_substring(vec![], String::from(\"a\"))\n/// Vec::::new()\n/// >>> filter_by_substring(vec![String::from(\"abc\"), String::from(\"bacd\"), String::from(\"cde\"), String::from(\"array\")], String::from(\"a\"))\n/// vec![String::from(\"abc\"), String::from(\"bacd\"), String::from(\"array\")]\nfn filter_by_substring(strings: Vec, substring: String) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = filter_by_substring;\n assert_eq!(candidate(Vec::::new(), String::from(\"john\")), Vec::::new());\n assert_eq!(candidate(vec![String::from(\"xxx\"), String::from(\"asd\"), String::from(\"xxy\"), String::from(\"john doe\"), String::from(\"xxxAAA\"), String::from(\"xxx\")], String::from(\"xxx\")), vec![String::from(\"xxx\"), String::from(\"xxxAAA\"), String::from(\"xxx\")]);\n assert_eq!(candidate(vec![String::from(\"xxx\"), String::from(\"asd\"), String::from(\"aaaxxy\"), String::from(\"john doe\"), String::from(\"xxxAAA\"), String::from(\"xxx\")], String::from(\"xx\")), vec![String::from(\"xxx\"), String::from(\"aaaxxy\"), String::from(\"xxxAAA\"), String::from(\"xxx\")]);\n assert_eq!(candidate(vec![String::from(\"grunt\"), String::from(\"trumpet\"), String::from(\"prune\"), String::from(\"gruesome\")], String::from(\"run\")), vec![String::from(\"grunt\"), String::from(\"prune\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "rs", - "prompt": "/// Given an integer. return a tuple that has the number of even and odd digits respectively.\n/// Example:\n/// >>> even_odd_count(-12)\n/// (1, 1)\n/// >>> even_odd_count(123)\n/// (1, 2)\nfn even_odd_count(num: isize) -> (isize, isize) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = even_odd_count;\n assert_eq!(candidate(7), (0, 1));\n assert_eq!(candidate(-78), (1, 1));\n assert_eq!(candidate(3452), (2, 2));\n assert_eq!(candidate(346211), (3, 3));\n assert_eq!(candidate(-345821), (3, 3));\n assert_eq!(candidate(-2), (1, 0));\n assert_eq!(candidate(-45347), (2, 3));\n assert_eq!(candidate(0), (1, 0));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "rs", - "prompt": "/// Write a function that accepts a list of strings.\n/// The list contains different words. Return the word with maximum number\n/// of unique characters. If multiple strings have maximum number of unique\n/// characters, return the one which comes first in lexicographical order.\n/// >>> find_max(vec![String::from(\"name\"), String::from(\"of\"), String::from(\"string\")])\n/// String::from(\"string\")\n/// >>> find_max(vec![String::from(\"name\"), String::from(\"enam\"), String::from(\"game\")])\n/// String::from(\"enam\")\n/// >>> find_max(vec![String::from(\"aaaaaaa\"), String::from(\"bb\"), String::from(\"cc\")])\n/// String::from(\"aaaaaaa\")\nfn find_max(words: Vec) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = find_max;\n assert_eq!(candidate(vec![String::from(\"name\"), String::from(\"of\"), String::from(\"string\")]), String::from(\"string\"));\n assert_eq!(candidate(vec![String::from(\"name\"), String::from(\"enam\"), String::from(\"game\")]), String::from(\"enam\"));\n assert_eq!(candidate(vec![String::from(\"aaaaaaa\"), String::from(\"bb\"), String::from(\"cc\")]), String::from(\"aaaaaaa\"));\n assert_eq!(candidate(vec![String::from(\"abc\"), String::from(\"cba\")]), String::from(\"abc\"));\n assert_eq!(candidate(vec![String::from(\"play\"), String::from(\"this\"), String::from(\"game\"), String::from(\"of\"), String::from(\"footbott\")]), String::from(\"footbott\"));\n assert_eq!(candidate(vec![String::from(\"we\"), String::from(\"are\"), String::from(\"gonna\"), String::from(\"rock\")]), String::from(\"gonna\"));\n assert_eq!(candidate(vec![String::from(\"we\"), String::from(\"are\"), String::from(\"a\"), String::from(\"mad\"), String::from(\"nation\")]), String::from(\"nation\"));\n assert_eq!(candidate(vec![String::from(\"this\"), String::from(\"is\"), String::from(\"a\"), String::from(\"prrk\")]), String::from(\"this\"));\n assert_eq!(candidate(vec![String::from(\"b\")]), String::from(\"b\"));\n assert_eq!(candidate(vec![String::from(\"play\"), String::from(\"play\"), String::from(\"play\")]), String::from(\"play\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "rs", - "prompt": "/// Given a positive integer n, return the count of the numbers of n-digit\n/// positive integers that start or end with 1.\nfn starts_one_ends(n: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = starts_one_ends;\n assert_eq!(candidate(1), 1);\n assert_eq!(candidate(2), 18);\n assert_eq!(candidate(3), 180);\n assert_eq!(candidate(4), 1800);\n assert_eq!(candidate(5), 18000);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "rs", - "prompt": "/// Create a function that returns a tuple (a, b), where 'a' is\n/// the largest of negative integers, and 'b' is the smallest\n/// of positive integers in a list.\n/// If there is no negative or positive integers, return them as None.\n/// Examples:\n/// >>> largest_smallest_integers(vec![2, 4, 1, 3, 5, 7])\n/// (None, Some(1))\n/// >>> largest_smallest_integers(vec![])\n/// (None, None)\n/// >>> largest_smallest_integers(vec![0])\n/// (None, None)\nfn largest_smallest_integers(lst: Vec) -> (Option, Option) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = largest_smallest_integers;\n assert_eq!(candidate(vec![2, 4, 1, 3, 5, 7]), (None, Some(1)));\n assert_eq!(candidate(vec![2, 4, 1, 3, 5, 7, 0]), (None, Some(1)));\n assert_eq!(candidate(vec![1, 3, 2, 4, 5, 6, -2]), (Some(-2), Some(1)));\n assert_eq!(candidate(vec![4, 5, 3, 6, 2, 7, -7]), (Some(-7), Some(2)));\n assert_eq!(candidate(vec![7, 3, 8, 4, 9, 2, 5, -9]), (Some(-9), Some(2)));\n assert_eq!(candidate(Vec::::new()), (None, None));\n assert_eq!(candidate(vec![0]), (None, None));\n assert_eq!(candidate(vec![-1, -3, -5, -6]), (Some(-1), None));\n assert_eq!(candidate(vec![-1, -3, -5, -6, 0]), (Some(-1), None));\n assert_eq!(candidate(vec![-6, -4, -4, -3, 1]), (Some(-3), Some(1)));\n assert_eq!(candidate(vec![-6, -4, -4, -3, -100, 1]), (Some(-3), Some(1)));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "rs", - "prompt": "/// \"Given an array representing a branch of a tree that has non-negative integer nodes\n/// your task is to pluck one of the nodes and return it.\n/// The plucked node should be the node with the smallest even value.\n/// If multiple nodes with the same smallest even value are found return the node that has smallest index.\n/// The plucked node should be returned in a list, [ smalest_value, its index ],\n/// If there are no even values or the given array is empty, return [].\n/// Example 1:\n/// >>> pluck(vec![4, 2, 3])\n/// vec![2, 1]\n/// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n/// Example 2:\n/// >>> pluck(vec![1, 2, 3])\n/// vec![2, 1]\n/// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n/// Example 3:\n/// >>> pluck(vec![])\n/// Vec::::new()\n/// Example 4:\n/// >>> pluck(vec![5, 0, 3, 0, 4, 2])\n/// vec![0, 1]\n/// Explanation: 0 is the smallest value, but there are two zeros,\n/// so we will choose the first zero, which has the smallest index.\n/// Constraints:\n/// * 1 <= nodes.length <= 10000\n/// * 0 <= node.value\nfn pluck(arr: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = pluck;\n assert_eq!(candidate(vec![4, 2, 3]), vec![2, 1]);\n assert_eq!(candidate(vec![1, 2, 3]), vec![2, 1]);\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![5, 0, 3, 0, 4, 2]), vec![0, 1]);\n assert_eq!(candidate(vec![1, 2, 3, 0, 5, 3]), vec![0, 3]);\n assert_eq!(candidate(vec![5, 4, 8, 4, 8]), vec![4, 1]);\n assert_eq!(candidate(vec![7, 6, 7, 1]), vec![6, 1]);\n assert_eq!(candidate(vec![7, 9, 7, 1]), Vec::::new());\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "rs", - "prompt": "/// Write a function count_nums which takes an array of integers and returns\n/// the number of elements which has a sum of digits > 0.\n/// If a number is negative, then its first signed digit will be negative:\n/// e.g. -123 has signed digits -1, 2, and 3.\n/// >>> count_nums(vec![])\n/// 0\n/// >>> count_nums(vec![-1, 11, -11])\n/// 1\n/// >>> count_nums(vec![1, 1, 2])\n/// 3\nfn count_nums(arr: Vec) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = count_nums;\n assert_eq!(candidate(Vec::::new()), 0);\n assert_eq!(candidate(vec![-1, -2, 0]), 0);\n assert_eq!(candidate(vec![1, 1, 2, -2, 3, 4, 5]), 6);\n assert_eq!(candidate(vec![1, 6, 9, -6, 0, 1, 5]), 5);\n assert_eq!(candidate(vec![1, 100, 98, -7, 1, -1]), 4);\n assert_eq!(candidate(vec![12, 23, 34, -45, -56, 0]), 5);\n assert_eq!(candidate(vec![0, 1]), 1);\n assert_eq!(candidate(vec![1]), 1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "rs", - "prompt": "/// Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n/// each cell of the grid contains a value. Every integer in the range [1, N * N]\n/// inclusive appears exactly once on the cells of the grid.\n/// You have to find the minimum path of length k in the grid. You can start\n/// from any cell, and in each step you can move to any of the neighbor cells,\n/// in other words, you can go to cells which share an edge with you current\n/// cell.\n/// Please note that a path of length k means visiting exactly k cells (not\n/// necessarily distinct).\n/// You CANNOT go off the grid.\n/// A path A (of length k) is considered less than a path B (of length k) if\n/// after making the ordered lists of the values on the cells that A and B go\n/// through (let's call them lst_A and lst_B), lst_A is lexicographically less\n/// than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n/// such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n/// lst_A[j] = lst_B[j].\n/// It is guaranteed that the answer is unique.\n/// Return an ordered list of the values on the cells that the minimum path go through.\n/// Examples: \n/// >>> minPath(vec![vec![1, 2, 3], vec![4, 5, 6], vec![7, 8, 9]], 3)\n/// vec![1, 2, 1]\n/// >>> minPath(vec![vec![5, 9, 3], vec![4, 1, 6], vec![7, 8, 2]], 1)\n/// vec![1]\nfn minPath(grid: Vec>, k: isize) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = minPath;\n assert_eq!(candidate(vec![vec![1, 2, 3], vec![4, 5, 6], vec![7, 8, 9]], 3), vec![1, 2, 1]);\n assert_eq!(candidate(vec![vec![5, 9, 3], vec![4, 1, 6], vec![7, 8, 2]], 1), vec![1]);\n assert_eq!(candidate(vec![vec![1, 2, 3, 4], vec![5, 6, 7, 8], vec![9, 10, 11, 12], vec![13, 14, 15, 16]], 4), vec![1, 2, 1, 2]);\n assert_eq!(candidate(vec![vec![6, 4, 13, 10], vec![5, 7, 12, 1], vec![3, 16, 11, 15], vec![8, 14, 9, 2]], 7), vec![1, 10, 1, 10, 1, 10, 1]);\n assert_eq!(candidate(vec![vec![8, 14, 9, 2], vec![6, 4, 13, 15], vec![5, 7, 1, 12], vec![3, 10, 11, 16]], 5), vec![1, 7, 1, 7, 1]);\n assert_eq!(candidate(vec![vec![11, 8, 7, 2], vec![5, 16, 14, 4], vec![9, 3, 15, 6], vec![12, 13, 10, 1]], 9), vec![1, 6, 1, 6, 1, 6, 1, 6, 1]);\n assert_eq!(candidate(vec![vec![12, 13, 10, 1], vec![9, 3, 15, 6], vec![5, 16, 14, 4], vec![11, 8, 7, 2]], 12), vec![1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6]);\n assert_eq!(candidate(vec![vec![2, 7, 4], vec![3, 1, 5], vec![6, 8, 9]], 8), vec![1, 3, 1, 3, 1, 3, 1, 3]);\n assert_eq!(candidate(vec![vec![6, 1, 5], vec![3, 8, 9], vec![2, 7, 4]], 8), vec![1, 5, 1, 5, 1, 5, 1, 5]);\n assert_eq!(candidate(vec![vec![1, 2], vec![3, 4]], 10), vec![1, 2, 1, 2, 1, 2, 1, 2, 1, 2]);\n assert_eq!(candidate(vec![vec![1, 3], vec![3, 2]], 10), vec![1, 3, 1, 3, 1, 3, 1, 3, 1, 3]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "rs", - "prompt": "/// Given list of integers, return list in strange order.\n/// Strange sorting, is when you start with the minimum value,\n/// then maximum of the remaining integers, then minimum and so on.\n/// Examples:\n/// >>> strange_sort_list(vec![1, 2, 3, 4])\n/// vec![1, 4, 2, 3]\n/// >>> strange_sort_list(vec![5, 5, 5, 5])\n/// vec![5, 5, 5, 5]\n/// >>> strange_sort_list(vec![])\n/// Vec::::new()\nfn strange_sort_list(lst: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = strange_sort_list;\n assert_eq!(candidate(vec![1, 2, 3, 4]), vec![1, 4, 2, 3]);\n assert_eq!(candidate(vec![5, 6, 7, 8, 9]), vec![5, 9, 6, 8, 7]);\n assert_eq!(candidate(vec![1, 2, 3, 4, 5]), vec![1, 5, 2, 4, 3]);\n assert_eq!(candidate(vec![5, 6, 7, 8, 9, 1]), vec![1, 9, 5, 8, 6, 7]);\n assert_eq!(candidate(vec![5, 5, 5, 5]), vec![5, 5, 5, 5]);\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![1, 2, 3, 4, 5, 6, 7, 8]), vec![1, 8, 2, 7, 3, 6, 4, 5]);\n assert_eq!(candidate(vec![0, 2, 2, 2, 5, 5, -5, -5]), vec![-5, 5, -5, 5, 0, 2, 2, 2]);\n assert_eq!(candidate(vec![111111]), vec![111111]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "rs", - "prompt": "/// Given a string 'text', return its md5 hash equivalent string.\n/// If 'text' is an empty string, return None.\n/// >>> string_to_md5(String::from(\"Hello world\"))\n/// Some(String::from(\"3e25960a79dbc69b674cd4ec67a72c62\"))\nfn string_to_md5(text: String) -> Option {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = string_to_md5;\n assert_eq!(candidate(String::from(\"Hello world\")), Some(String::from(\"3e25960a79dbc69b674cd4ec67a72c62\")));\n assert_eq!(candidate(String::from(\"\")), None);\n assert_eq!(candidate(String::from(\"A B C\")), Some(String::from(\"0ef78513b0cb8cef12743f5aeb35f888\")));\n assert_eq!(candidate(String::from(\"password\")), Some(String::from(\"5f4dcc3b5aa765d61d8327deb882cf99\")));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "rs", - "prompt": "/// You are given a word. Your task is to find the closest vowel that stands between \n/// two consonants from the right side of the word (case sensitive).\n/// Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n/// find any vowel met the above condition. \n/// You may assume that the given string contains English letter only.\n/// Example:\n/// >>> get_closest_vowel(String::from(\"yogurt\"))\n/// String::from(\"u\")\n/// >>> get_closest_vowel(String::from(\"FULL\"))\n/// String::from(\"U\")\n/// >>> get_closest_vowel(String::from(\"quick\"))\n/// String::from(\"\")\n/// >>> get_closest_vowel(String::from(\"ab\"))\n/// String::from(\"\")\nfn get_closest_vowel(word: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = get_closest_vowel;\n assert_eq!(candidate(String::from(\"yogurt\")), String::from(\"u\"));\n assert_eq!(candidate(String::from(\"full\")), String::from(\"u\"));\n assert_eq!(candidate(String::from(\"easy\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"eAsy\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"ali\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"bad\")), String::from(\"a\"));\n assert_eq!(candidate(String::from(\"most\")), String::from(\"o\"));\n assert_eq!(candidate(String::from(\"ab\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"ba\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"quick\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"anime\")), String::from(\"i\"));\n assert_eq!(candidate(String::from(\"Asia\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"Above\")), String::from(\"o\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "rs", - "prompt": "/// Change numerical base of input number x to base.\n/// return string representation after the conversion.\n/// base numbers are less than 10.\n/// >>> change_base(8, 3)\n/// String::from(\"22\")\n/// >>> change_base(8, 2)\n/// String::from(\"1000\")\n/// >>> change_base(7, 2)\n/// String::from(\"111\")\nfn change_base(x: isize, base: isize) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = change_base;\n assert_eq!(candidate(8, 3), String::from(\"22\"));\n assert_eq!(candidate(9, 3), String::from(\"100\"));\n assert_eq!(candidate(234, 2), String::from(\"11101010\"));\n assert_eq!(candidate(16, 2), String::from(\"10000\"));\n assert_eq!(candidate(8, 2), String::from(\"1000\"));\n assert_eq!(candidate(7, 2), String::from(\"111\"));\n assert_eq!(candidate(2, 3), String::from(\"2\"));\n assert_eq!(candidate(3, 4), String::from(\"3\"));\n assert_eq!(candidate(4, 5), String::from(\"4\"));\n assert_eq!(candidate(5, 6), String::from(\"5\"));\n assert_eq!(candidate(6, 7), String::from(\"6\"));\n assert_eq!(candidate(7, 8), String::from(\"7\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "rs", - "prompt": "/// Check if in given list of numbers, are any two numbers closer to each other than\n/// given threshold.\n/// >>> has_close_elements(vec![1.0, 2.0, 3.0], 0.5)\n/// false\n/// >>> has_close_elements(vec![1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n/// true\nfn has_close_elements(numbers: Vec, threshold: f64) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = has_close_elements;\n assert_eq!(candidate(vec![1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3), true);\n assert_eq!(candidate(vec![1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05), false);\n assert_eq!(candidate(vec![1.0, 2.0, 5.9, 4.0, 5.0], 0.95), true);\n assert_eq!(candidate(vec![1.0, 2.0, 5.9, 4.0, 5.0], 0.8), false);\n assert_eq!(candidate(vec![1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1), true);\n assert_eq!(candidate(vec![1.1, 2.2, 3.1, 4.1, 5.1], 1.0), true);\n assert_eq!(candidate(vec![1.1, 2.2, 3.1, 4.1, 5.1], 0.5), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "rs", - "prompt": "/// Create a function that takes a string as input which contains only square brackets.\n/// The function should return True if and only if there is a valid subsequence of brackets \n/// where at least one bracket in the subsequence is nested.\n/// >>> is_nested(String::from(\"[[]]\"))\n/// true\n/// >>> is_nested(String::from(\"[]]]]]]][[[[[]\"))\n/// false\n/// >>> is_nested(String::from(\"[][]\"))\n/// false\n/// >>> is_nested(String::from(\"[]\"))\n/// false\n/// >>> is_nested(String::from(\"[[][]]\"))\n/// true\n/// >>> is_nested(String::from(\"[[]][[\"))\n/// true\nfn is_nested(string: String) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = is_nested;\n assert_eq!(candidate(String::from(\"[[]]\")), true);\n assert_eq!(candidate(String::from(\"[]]]]]]][[[[[]\")), false);\n assert_eq!(candidate(String::from(\"[][]\")), false);\n assert_eq!(candidate(String::from(\"[]\")), false);\n assert_eq!(candidate(String::from(\"[[[[]]]]\")), true);\n assert_eq!(candidate(String::from(\"[]]]]]]]]]]\")), false);\n assert_eq!(candidate(String::from(\"[][][[]]\")), true);\n assert_eq!(candidate(String::from(\"[[]\")), false);\n assert_eq!(candidate(String::from(\"[]]\")), false);\n assert_eq!(candidate(String::from(\"[[]][[\")), true);\n assert_eq!(candidate(String::from(\"[[][]]\")), true);\n assert_eq!(candidate(String::from(\"\")), false);\n assert_eq!(candidate(String::from(\"[[[[[[[[\")), false);\n assert_eq!(candidate(String::from(\"]]]]]]]]\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "rs", - "prompt": "/// Concatenate list of strings into a single string\n/// >>> concatenate(vec![])\n/// String::from(\"\")\n/// >>> concatenate(vec![String::from(\"a\"), String::from(\"b\"), String::from(\"c\")])\n/// String::from(\"abc\")\nfn concatenate(strings: Vec) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = concatenate;\n assert_eq!(candidate(Vec::::new()), String::from(\"\"));\n assert_eq!(candidate(vec![String::from(\"x\"), String::from(\"y\"), String::from(\"z\")]), String::from(\"xyz\"));\n assert_eq!(candidate(vec![String::from(\"x\"), String::from(\"y\"), String::from(\"z\"), String::from(\"w\"), String::from(\"k\")]), String::from(\"xyzwk\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "rs", - "prompt": "/// prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n/// >>> prime_fib(1)\n/// 2\n/// >>> prime_fib(2)\n/// 3\n/// >>> prime_fib(3)\n/// 5\n/// >>> prime_fib(4)\n/// 13\n/// >>> prime_fib(5)\n/// 89\nfn prime_fib(n: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = prime_fib;\n assert_eq!(candidate(1), 2);\n assert_eq!(candidate(2), 3);\n assert_eq!(candidate(3), 5);\n assert_eq!(candidate(4), 13);\n assert_eq!(candidate(5), 89);\n assert_eq!(candidate(6), 233);\n assert_eq!(candidate(7), 1597);\n assert_eq!(candidate(8), 28657);\n assert_eq!(candidate(9), 514229);\n assert_eq!(candidate(10), 433494437);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "rs", - "prompt": "/// From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n/// other and return them in order (smaller number, larger number).\n/// >>> find_closest_elements(vec![1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n/// (2.0, 2.2)\n/// >>> find_closest_elements(vec![1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n/// (2.0, 2.0)\nfn find_closest_elements(numbers: Vec) -> (f64, f64) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = find_closest_elements;\n assert_eq!(candidate(vec![1.0, 2.0, 3.9, 4.0, 5.0, 2.2]), (3.9, 4.0));\n assert_eq!(candidate(vec![1.0, 2.0, 5.9, 4.0, 5.0]), (5.0, 5.9));\n assert_eq!(candidate(vec![1.0, 2.0, 3.0, 4.0, 5.0, 2.2]), (2.0, 2.2));\n assert_eq!(candidate(vec![1.0, 2.0, 3.0, 4.0, 5.0, 2.0]), (2.0, 2.0));\n assert_eq!(candidate(vec![1.1, 2.2, 3.1, 4.1, 5.1]), (2.2, 3.1));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "rs", - "prompt": "/// You have been tasked to write a function that receives \n/// a hexadecimal number as a string and counts the number of hexadecimal \n/// digits that are primes (prime number, or a prime, is a natural number \n/// greater than 1 that is not a product of two smaller natural numbers).\n/// Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n/// Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n/// So you have to determine a number of the following digits: 2, 3, 5, 7, \n/// B (=decimal 11), D (=decimal 13).\n/// Note: you may assume the input is always correct or empty string, \n/// and symbols A,B,C,D,E,F are always uppercase.\n/// Examples:\n/// >>> hex_key(String::from(\"AB\"))\n/// 1\n/// >>> hex_key(String::from(\"1077E\"))\n/// 2\n/// >>> hex_key(String::from(\"ABED1A33\"))\n/// 4\n/// >>> hex_key(String::from(\"123456789ABCDEF0\"))\n/// 6\n/// >>> hex_key(String::from(\"2020\"))\n/// 2\nfn hex_key(num: String) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = hex_key;\n assert_eq!(candidate(String::from(\"AB\")), 1);\n assert_eq!(candidate(String::from(\"1077E\")), 2);\n assert_eq!(candidate(String::from(\"ABED1A33\")), 4);\n assert_eq!(candidate(String::from(\"2020\")), 2);\n assert_eq!(candidate(String::from(\"123456789ABCDEF0\")), 6);\n assert_eq!(candidate(String::from(\"112233445566778899AABBCCDDEEFF00\")), 12);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "rs", - "prompt": "/// Complete the function that takes two integers and returns \n/// the product of their unit digits.\n/// Assume the input is always valid.\n/// Examples:\n/// >>> multiply(148, 412)\n/// 16\n/// >>> multiply(19, 28)\n/// 72\n/// >>> multiply(2020, 1851)\n/// 0\n/// >>> multiply(14, -15)\n/// 20\nfn multiply(a: isize, b: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = multiply;\n assert_eq!(candidate(148, 412), 16);\n assert_eq!(candidate(19, 28), 72);\n assert_eq!(candidate(2020, 1851), 0);\n assert_eq!(candidate(14, -15), 20);\n assert_eq!(candidate(76, 67), 42);\n assert_eq!(candidate(17, 27), 49);\n assert_eq!(candidate(0, 1), 0);\n assert_eq!(candidate(0, 0), 0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "rs", - "prompt": "/// Given list of numbers (of at least two elements), apply a linear transform to that list,\n/// such that the smallest number will become 0 and the largest will become 1\n/// >>> rescale_to_unit(vec![1.0, 2.0, 3.0, 4.0, 5.0])\n/// vec![0.0, 0.25, 0.5, 0.75, 1.0]\nfn rescale_to_unit(numbers: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = rescale_to_unit;\n assert_eq!(candidate(vec![2.0, 49.9]), vec![0.0, 1.0]);\n assert_eq!(candidate(vec![100.0, 49.9]), vec![1.0, 0.0]);\n assert_eq!(candidate(vec![1.0, 2.0, 3.0, 4.0, 5.0]), vec![0.0, 0.25, 0.5, 0.75, 1.0]);\n assert_eq!(candidate(vec![2.0, 1.0, 5.0, 3.0, 4.0]), vec![0.25, 0.0, 1.0, 0.5, 0.75]);\n assert_eq!(candidate(vec![12.0, 11.0, 15.0, 13.0, 14.0]), vec![0.25, 0.0, 1.0, 0.5, 0.75]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "rs", - "prompt": "/// Given a positive integer n, return the product of the odd digits.\n/// Return 0 if all digits are even.\n/// For example:\n/// >>> digits(1)\n/// 1\n/// >>> digits(4)\n/// 0\n/// >>> digits(235)\n/// 15\nfn digits(n: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = digits;\n assert_eq!(candidate(5), 5);\n assert_eq!(candidate(54), 5);\n assert_eq!(candidate(120), 1);\n assert_eq!(candidate(5014), 5);\n assert_eq!(candidate(98765), 315);\n assert_eq!(candidate(5576543), 2625);\n assert_eq!(candidate(2468), 0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "rs", - "prompt": "/// You will be given the name of a class (a string) and a list of extensions.\n/// The extensions are to be used to load additional classes to the class. The\n/// strength of the extension is as follows: Let CAP be the number of the uppercase\n/// letters in the extension's name, and let SM be the number of lowercase letters \n/// in the extension's name, the strength is given by the fraction CAP - SM. \n/// You should find the strongest extension and return a string in this \n/// format: ClassName.StrongestExtensionName.\n/// If there are two or more extensions with the same strength, you should\n/// choose the one that comes first in the list.\n/// For example, if you are given \"Slices\" as the class and a list of the\n/// extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n/// return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n/// (its strength is -1).\n/// Example:\n/// >>> Strongest_Extension(String::from(\"my_class\"), vec![String::from(\"AA\"), String::from(\"Be\"), String::from(\"CC\")])\n/// String::from(\"my_class.AA\")\nfn Strongest_Extension(class_name: String, extensions: Vec) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = Strongest_Extension;\n assert_eq!(candidate(String::from(\"Watashi\"), vec![String::from(\"tEN\"), String::from(\"niNE\"), String::from(\"eIGHt8OKe\")]), String::from(\"Watashi.eIGHt8OKe\"));\n assert_eq!(candidate(String::from(\"Boku123\"), vec![String::from(\"nani\"), String::from(\"NazeDa\"), String::from(\"YEs.WeCaNe\"), String::from(\"32145tggg\")]), String::from(\"Boku123.YEs.WeCaNe\"));\n assert_eq!(candidate(String::from(\"__YESIMHERE\"), vec![String::from(\"t\"), String::from(\"eMptY\"), String::from(\"nothing\"), String::from(\"zeR00\"), String::from(\"NuLl__\"), String::from(\"123NoooneB321\")]), String::from(\"__YESIMHERE.NuLl__\"));\n assert_eq!(candidate(String::from(\"K\"), vec![String::from(\"Ta\"), String::from(\"TAR\"), String::from(\"t234An\"), String::from(\"cosSo\")]), String::from(\"K.TAR\"));\n assert_eq!(candidate(String::from(\"__HAHA\"), vec![String::from(\"Tab\"), String::from(\"123\"), String::from(\"781345\"), String::from(\"-_-\")]), String::from(\"__HAHA.123\"));\n assert_eq!(candidate(String::from(\"YameRore\"), vec![String::from(\"HhAas\"), String::from(\"okIWILL123\"), String::from(\"WorkOut\"), String::from(\"Fails\"), String::from(\"-_-\")]), String::from(\"YameRore.okIWILL123\"));\n assert_eq!(candidate(String::from(\"finNNalLLly\"), vec![String::from(\"Die\"), String::from(\"NowW\"), String::from(\"Wow\"), String::from(\"WoW\")]), String::from(\"finNNalLLly.WoW\"));\n assert_eq!(candidate(String::from(\"_\"), vec![String::from(\"Bb\"), String::from(\"91245\")]), String::from(\"_.Bb\"));\n assert_eq!(candidate(String::from(\"Sp\"), vec![String::from(\"671235\"), String::from(\"Bb\")]), String::from(\"Sp.671235\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "rs", - "prompt": "use std::collections::HashMap;\n\n/// Given a string representing a space separated lowercase letters, return a dictionary\n/// of the letter with the most repetition and containing the corresponding count.\n/// If several letters have the same occurrence, return all of them.\n/// Example:\n/// >>> histogram(String::from(\"a b c\"))\n/// HashMap::from([(String::from(\"a\"), 1), (String::from(\"b\"), 1), (String::from(\"c\"), 1)])\n/// >>> histogram(String::from(\"a b b a\"))\n/// HashMap::from([(String::from(\"a\"), 2), (String::from(\"b\"), 2)])\n/// >>> histogram(String::from(\"a b c a b\"))\n/// HashMap::from([(String::from(\"a\"), 2), (String::from(\"b\"), 2)])\n/// >>> histogram(String::from(\"b b b b a\"))\n/// HashMap::from([(String::from(\"b\"), 4)])\n/// >>> histogram(String::from(\"\"))\n/// HashMap::from([])\nfn histogram(test: String) -> HashMap {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = histogram;\n assert_eq!(candidate(String::from(\"a b b a\")), HashMap::from([(String::from(\"a\"), 2), (String::from(\"b\"), 2)]));\n assert_eq!(candidate(String::from(\"a b c a b\")), HashMap::from([(String::from(\"a\"), 2), (String::from(\"b\"), 2)]));\n assert_eq!(candidate(String::from(\"a b c d g\")), HashMap::from([(String::from(\"a\"), 1), (String::from(\"b\"), 1), (String::from(\"c\"), 1), (String::from(\"d\"), 1), (String::from(\"g\"), 1)]));\n assert_eq!(candidate(String::from(\"r t g\")), HashMap::from([(String::from(\"r\"), 1), (String::from(\"t\"), 1), (String::from(\"g\"), 1)]));\n assert_eq!(candidate(String::from(\"b b b b a\")), HashMap::from([(String::from(\"b\"), 4)]));\n assert_eq!(candidate(String::from(\"r t g\")), HashMap::from([(String::from(\"r\"), 1), (String::from(\"t\"), 1), (String::from(\"g\"), 1)]));\n assert_eq!(candidate(String::from(\"\")), HashMap::from([]));\n assert_eq!(candidate(String::from(\"a\")), HashMap::from([(String::from(\"a\"), 1)]));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "rs", - "prompt": "/// pairs_sum_to_zero takes a list of integers as an input.\n/// it returns True if there are two distinct elements in the list that\n/// sum to zero, and False otherwise.\n/// >>> pairs_sum_to_zero(vec![1, 3, 5, 0])\n/// false\n/// >>> pairs_sum_to_zero(vec![1, 3, -2, 1])\n/// false\n/// >>> pairs_sum_to_zero(vec![1, 2, 3, 7])\n/// false\n/// >>> pairs_sum_to_zero(vec![2, 4, -5, 3, 5, 7])\n/// true\n/// >>> pairs_sum_to_zero(vec![1])\n/// false\nfn pairs_sum_to_zero(l: Vec) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = pairs_sum_to_zero;\n assert_eq!(candidate(vec![1, 3, 5, 0]), false);\n assert_eq!(candidate(vec![1, 3, -2, 1]), false);\n assert_eq!(candidate(vec![1, 2, 3, 7]), false);\n assert_eq!(candidate(vec![2, 4, -5, 3, 5, 7]), true);\n assert_eq!(candidate(vec![1]), false);\n assert_eq!(candidate(vec![-3, 9, -1, 3, 2, 30]), true);\n assert_eq!(candidate(vec![-3, 9, -1, 3, 2, 31]), true);\n assert_eq!(candidate(vec![-3, 9, -1, 4, 2, 30]), false);\n assert_eq!(candidate(vec![-3, 9, -1, 4, 2, 31]), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "rs", - "prompt": "/// Write a function that accepts two lists of strings and returns the list that has \n/// total number of chars in the all strings of the list less than the other list.\n/// if the two lists have the same number of chars, return the first list.\n/// Examples\n/// >>> total_match(vec![], vec![])\n/// Vec::::new()\n/// >>> total_match(vec![String::from(\"hi\"), String::from(\"admin\")], vec![String::from(\"hI\"), String::from(\"Hi\")])\n/// vec![String::from(\"hI\"), String::from(\"Hi\")]\n/// >>> total_match(vec![String::from(\"hi\"), String::from(\"admin\")], vec![String::from(\"hi\"), String::from(\"hi\"), String::from(\"admin\"), String::from(\"project\")])\n/// vec![String::from(\"hi\"), String::from(\"admin\")]\n/// >>> total_match(vec![String::from(\"hi\"), String::from(\"admin\")], vec![String::from(\"hI\"), String::from(\"hi\"), String::from(\"hi\")])\n/// vec![String::from(\"hI\"), String::from(\"hi\"), String::from(\"hi\")]\n/// >>> total_match(vec![String::from(\"4\")], vec![String::from(\"1\"), String::from(\"2\"), String::from(\"3\"), String::from(\"4\"), String::from(\"5\")])\n/// vec![String::from(\"4\")]\nfn total_match(lst1: Vec, lst2: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = total_match;\n assert_eq!(candidate(Vec::::new(), Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![String::from(\"hi\"), String::from(\"admin\")], vec![String::from(\"hi\"), String::from(\"hi\")]), vec![String::from(\"hi\"), String::from(\"hi\")]);\n assert_eq!(candidate(vec![String::from(\"hi\"), String::from(\"admin\")], vec![String::from(\"hi\"), String::from(\"hi\"), String::from(\"admin\"), String::from(\"project\")]), vec![String::from(\"hi\"), String::from(\"admin\")]);\n assert_eq!(candidate(vec![String::from(\"4\")], vec![String::from(\"1\"), String::from(\"2\"), String::from(\"3\"), String::from(\"4\"), String::from(\"5\")]), vec![String::from(\"4\")]);\n assert_eq!(candidate(vec![String::from(\"hi\"), String::from(\"admin\")], vec![String::from(\"hI\"), String::from(\"Hi\")]), vec![String::from(\"hI\"), String::from(\"Hi\")]);\n assert_eq!(candidate(vec![String::from(\"hi\"), String::from(\"admin\")], vec![String::from(\"hI\"), String::from(\"hi\"), String::from(\"hi\")]), vec![String::from(\"hI\"), String::from(\"hi\"), String::from(\"hi\")]);\n assert_eq!(candidate(vec![String::from(\"hi\"), String::from(\"admin\")], vec![String::from(\"hI\"), String::from(\"hi\"), String::from(\"hii\")]), vec![String::from(\"hi\"), String::from(\"admin\")]);\n assert_eq!(candidate(Vec::::new(), vec![String::from(\"this\")]), Vec::::new());\n assert_eq!(candidate(vec![String::from(\"this\")], Vec::::new()), Vec::::new());\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "rs", - "prompt": "/// Circular shift the digits of the integer x, shift the digits right by shift\n/// and return the result as a string.\n/// If shift > number of digits, return digits reversed.\n/// >>> circular_shift(12, 1)\n/// String::from(\"21\")\n/// >>> circular_shift(12, 2)\n/// String::from(\"12\")\nfn circular_shift(x: isize, shift: isize) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = circular_shift;\n assert_eq!(candidate(100, 2), String::from(\"001\"));\n assert_eq!(candidate(12, 2), String::from(\"12\"));\n assert_eq!(candidate(97, 8), String::from(\"79\"));\n assert_eq!(candidate(12, 1), String::from(\"21\"));\n assert_eq!(candidate(11, 101), String::from(\"11\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "rs", - "prompt": "/// Return True is list elements are monotonically increasing or decreasing.\n/// >>> monotonic(vec![1, 2, 4, 20])\n/// true\n/// >>> monotonic(vec![1, 20, 4, 10])\n/// false\n/// >>> monotonic(vec![4, 1, 0, -10])\n/// true\nfn monotonic(l: Vec) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = monotonic;\n assert_eq!(candidate(vec![1, 2, 4, 10]), true);\n assert_eq!(candidate(vec![1, 2, 4, 20]), true);\n assert_eq!(candidate(vec![1, 20, 4, 10]), false);\n assert_eq!(candidate(vec![4, 1, 0, -10]), true);\n assert_eq!(candidate(vec![4, 1, 1, 0]), true);\n assert_eq!(candidate(vec![1, 2, 3, 2, 5, 60]), false);\n assert_eq!(candidate(vec![1, 2, 3, 4, 5, 60]), true);\n assert_eq!(candidate(vec![9, 9, 9, 9]), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "rs", - "prompt": "/// Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n/// Example\n/// >>> is_equal_to_sum_even(4)\n/// false\n/// >>> is_equal_to_sum_even(6)\n/// false\n/// >>> is_equal_to_sum_even(8)\n/// true\nfn is_equal_to_sum_even(n: isize) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = is_equal_to_sum_even;\n assert_eq!(candidate(4), false);\n assert_eq!(candidate(6), false);\n assert_eq!(candidate(8), true);\n assert_eq!(candidate(10), true);\n assert_eq!(candidate(11), false);\n assert_eq!(candidate(12), true);\n assert_eq!(candidate(13), false);\n assert_eq!(candidate(16), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "rs", - "prompt": "/// Input to this function is a string representing musical notes in a special ASCII format.\n/// Your task is to parse this string and return list of integers corresponding to how many beats does each\n/// not last.\n/// Here is a legend:\n/// 'o' - whole note, lasts four beats\n/// 'o|' - half note, lasts two beats\n/// '.|' - quater note, lasts one beat\n/// >>> parse_music(String::from(\"o o| .| o| o| .| .| .| .| o o\"))\n/// vec![4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\nfn parse_music(music_string: String) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = parse_music;\n assert_eq!(candidate(String::from(\"\")), Vec::::new());\n assert_eq!(candidate(String::from(\"o o o o\")), vec![4, 4, 4, 4]);\n assert_eq!(candidate(String::from(\".| .| .| .|\")), vec![1, 1, 1, 1]);\n assert_eq!(candidate(String::from(\"o| o| .| .| o o o o\")), vec![2, 2, 1, 1, 4, 4, 4, 4]);\n assert_eq!(candidate(String::from(\"o| .| o| .| o o| o o|\")), vec![2, 1, 2, 1, 4, 2, 4, 2]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "rs", - "prompt": "/// \"\n/// This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n/// multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n/// change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n/// Examples:\n/// >>> lst\n/// vec![1, 2, 3]\n/// >>> lst\n/// vec![]\n/// >>> lst\n/// vec![-1, -5, 2, -1, -5]\nfn sum_squares(lst: Vec) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = sum_squares;\n assert_eq!(candidate(vec![1, 2, 3]), 6);\n assert_eq!(candidate(vec![1, 4, 9]), 14);\n assert_eq!(candidate(Vec::::new()), 0);\n assert_eq!(candidate(vec![1, 1, 1, 1, 1, 1, 1, 1, 1]), 9);\n assert_eq!(candidate(vec![-1, -1, -1, -1, -1, -1, -1, -1, -1]), -3);\n assert_eq!(candidate(vec![0]), 0);\n assert_eq!(candidate(vec![-1, -5, 2, -1, -5]), -126);\n assert_eq!(candidate(vec![-56, -99, 1, 0, -2]), 3030);\n assert_eq!(candidate(vec![-1, 0, 0, 0, 0, 0, 0, 0, -1]), 0);\n assert_eq!(candidate(vec![-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37]), -14196);\n assert_eq!(candidate(vec![-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10]), -1448);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "rs", - "prompt": "/// triples_sum_to_zero takes a list of integers as an input.\n/// it returns True if there are three distinct elements in the list that\n/// sum to zero, and False otherwise.\n/// >>> triples_sum_to_zero(vec![1, 3, 5, 0])\n/// false\n/// >>> triples_sum_to_zero(vec![1, 3, -2, 1])\n/// true\n/// >>> triples_sum_to_zero(vec![1, 2, 3, 7])\n/// false\n/// >>> triples_sum_to_zero(vec![2, 4, -5, 3, 9, 7])\n/// true\n/// >>> triples_sum_to_zero(vec![1])\n/// false\nfn triples_sum_to_zero(l: Vec) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = triples_sum_to_zero;\n assert_eq!(candidate(vec![1, 3, 5, 0]), false);\n assert_eq!(candidate(vec![1, 3, 5, -1]), false);\n assert_eq!(candidate(vec![1, 3, -2, 1]), true);\n assert_eq!(candidate(vec![1, 2, 3, 7]), false);\n assert_eq!(candidate(vec![1, 2, 5, 7]), false);\n assert_eq!(candidate(vec![2, 4, -5, 3, 9, 7]), true);\n assert_eq!(candidate(vec![1]), false);\n assert_eq!(candidate(vec![1, 3, 5, -100]), false);\n assert_eq!(candidate(vec![100, 3, 5, -100]), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "rs", - "prompt": "/// brackets is a string of \"<\" and \">\".\n/// return True if every opening bracket has a corresponding closing bracket.\n/// >>> correct_bracketing(String::from(\"<\"))\n/// false\n/// >>> correct_bracketing(String::from(\"<>\"))\n/// true\n/// >>> correct_bracketing(String::from(\"<<><>>\"))\n/// true\n/// >>> correct_bracketing(String::from(\"><<>\"))\n/// false\nfn correct_bracketing(brackets: String) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = correct_bracketing;\n assert_eq!(candidate(String::from(\"<>\")), true);\n assert_eq!(candidate(String::from(\"<<><>>\")), true);\n assert_eq!(candidate(String::from(\"<><><<><>><>\")), true);\n assert_eq!(candidate(String::from(\"<><><<<><><>><>><<><><<>>>\")), true);\n assert_eq!(candidate(String::from(\"<<<><>>>>\")), false);\n assert_eq!(candidate(String::from(\"><<>\")), false);\n assert_eq!(candidate(String::from(\"<\")), false);\n assert_eq!(candidate(String::from(\"<<<<\")), false);\n assert_eq!(candidate(String::from(\">\")), false);\n assert_eq!(candidate(String::from(\"<<>\")), false);\n assert_eq!(candidate(String::from(\"<><><<><>><>><<>\")), false);\n assert_eq!(candidate(String::from(\"<><><<><>><>>><>\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "rs", - "prompt": "/// Write a function that takes an array of numbers as input and returns \n/// the number of elements in the array that are greater than 10 and both \n/// first and last digits of a number are odd (1, 3, 5, 7, 9).\n/// For example:\n/// >>> specialFilter(vec![15, -73, 14, -15])\n/// 1\n/// >>> specialFilter(vec![33, -2, -3, 45, 21, 109])\n/// 2\nfn specialFilter(nums: Vec) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = specialFilter;\n assert_eq!(candidate(vec![5, -2, 1, -5]), 0);\n assert_eq!(candidate(vec![15, -73, 14, -15]), 1);\n assert_eq!(candidate(vec![33, -2, -3, 45, 21, 109]), 2);\n assert_eq!(candidate(vec![43, -12, 93, 125, 121, 109]), 4);\n assert_eq!(candidate(vec![71, -2, -33, 75, 21, 19]), 3);\n assert_eq!(candidate(vec![1]), 0);\n assert_eq!(candidate(Vec::::new()), 0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "rs", - "prompt": "use std::collections::HashMap;\n\n/// Given a dictionary, return True if all keys are strings in lower \n/// case or all keys are strings in upper case, else return False.\n/// The function should return False is the given dictionary is empty.\n/// Examples:\n/// >>> check_dict_case(HashMap::from([(String::from(\"a\"), String::from(\"apple\")), (String::from(\"b\"), String::from(\"banana\"))]))\n/// true\n/// >>> check_dict_case(HashMap::from([(String::from(\"a\"), String::from(\"apple\")), (String::from(\"A\"), String::from(\"banana\")), (String::from(\"B\"), String::from(\"banana\"))]))\n/// false\n/// >>> check_dict_case(HashMap::from([(String::from(\"a\"), String::from(\"apple\")), (8, String::from(\"banana\")), (String::from(\"a\"), String::from(\"apple\"))]))\n/// false\n/// >>> check_dict_case(HashMap::from([(String::from(\"Name\"), String::from(\"John\")), (String::from(\"Age\"), String::from(\"36\")), (String::from(\"City\"), String::from(\"Houston\"))]))\n/// false\n/// >>> check_dict_case(HashMap::from([(String::from(\"STATE\"), String::from(\"NC\")), (String::from(\"ZIP\"), String::from(\"12345\"))]))\n/// true\nfn check_dict_case(dict: HashMap) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = check_dict_case;\n assert_eq!(candidate(HashMap::from([(String::from(\"p\"), String::from(\"pineapple\")), (String::from(\"b\"), String::from(\"banana\"))])), true);\n assert_eq!(candidate(HashMap::from([(String::from(\"p\"), String::from(\"pineapple\")), (String::from(\"A\"), String::from(\"banana\")), (String::from(\"B\"), String::from(\"banana\"))])), false);\n assert_eq!(candidate(HashMap::from([(String::from(\"p\"), String::from(\"pineapple\")), (String::from(\"5\"), String::from(\"banana\")), (String::from(\"a\"), String::from(\"apple\"))])), false);\n assert_eq!(candidate(HashMap::from([(String::from(\"Name\"), String::from(\"John\")), (String::from(\"Age\"), String::from(\"36\")), (String::from(\"City\"), String::from(\"Houston\"))])), false);\n assert_eq!(candidate(HashMap::from([(String::from(\"STATE\"), String::from(\"NC\")), (String::from(\"ZIP\"), String::from(\"12345\"))])), true);\n assert_eq!(candidate(HashMap::from([(String::from(\"fruit\"), String::from(\"Orange\")), (String::from(\"taste\"), String::from(\"Sweet\"))])), true);\n assert_eq!(candidate(HashMap::from([])), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "rs", - "prompt": "/// The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n/// fibfib(0) == 0\n/// fibfib(1) == 0\n/// fibfib(2) == 1\n/// fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n/// Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n/// >>> fibfib(1)\n/// 0\n/// >>> fibfib(5)\n/// 4\n/// >>> fibfib(8)\n/// 24\nfn fibfib(n: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = fibfib;\n assert_eq!(candidate(2), 1);\n assert_eq!(candidate(1), 0);\n assert_eq!(candidate(5), 4);\n assert_eq!(candidate(8), 24);\n assert_eq!(candidate(10), 81);\n assert_eq!(candidate(12), 274);\n assert_eq!(candidate(14), 927);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "rs", - "prompt": "/// You are given a list of numbers.\n/// You need to return the sum of squared numbers in the given list,\n/// round each element in the list to the upper int(Ceiling) first.\n/// Examples:\n/// >>> lst(vec![1.0, 2.0, 3.0])\n/// 14\n/// >>> lst(vec![1.0, 4.0, 9.0])\n/// 98\n/// >>> lst(vec![1.0, 3.0, 5.0, 7.0])\n/// 84\n/// >>> lst(vec![1.4, 4.2, 0.0])\n/// 29\n/// >>> lst(vec![-2.4, 1.0, 1.0])\n/// 6\nfn sum_squares(lst: Vec) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = sum_squares;\n assert_eq!(candidate(vec![1.0, 2.0, 3.0]), 14);\n assert_eq!(candidate(vec![1.0, 2.0, 3.0]), 14);\n assert_eq!(candidate(vec![1.0, 3.0, 5.0, 7.0]), 84);\n assert_eq!(candidate(vec![1.4, 4.2, 0.0]), 29);\n assert_eq!(candidate(vec![-2.4, 1.0, 1.0]), 6);\n assert_eq!(candidate(vec![100.0, 1.0, 15.0, 2.0]), 10230);\n assert_eq!(candidate(vec![10000.0, 10000.0]), 200000000);\n assert_eq!(candidate(vec![-1.4, 4.6, 6.3]), 75);\n assert_eq!(candidate(vec![-1.4, 17.9, 18.9, 19.9]), 1086);\n assert_eq!(candidate(vec![0.0]), 0);\n assert_eq!(candidate(vec![-1.0]), 1);\n assert_eq!(candidate(vec![-1.0, 1.0, 0.0]), 2);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_85_add", - "language": "rs", - "prompt": "/// Given a non-empty list of integers lst. add the even elements that are at odd indices..\n/// Examples:\n/// >>> add(vec![4, 2, 6, 7])\n/// 2\nfn add(lst: Vec) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = add;\n assert_eq!(candidate(vec![4, 88]), 88);\n assert_eq!(candidate(vec![4, 5, 6, 7, 2, 122]), 122);\n assert_eq!(candidate(vec![4, 0, 6, 7]), 0);\n assert_eq!(candidate(vec![4, 4, 6, 8]), 12);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "rs", - "prompt": "/// Return sorted unique elements in a list\n/// >>> unique(vec![5, 3, 5, 2, 3, 3, 9, 0, 123])\n/// vec![0, 2, 3, 5, 9, 123]\nfn unique(l: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = unique;\n assert_eq!(candidate(vec![5, 3, 5, 2, 3, 3, 9, 0, 123]), vec![0, 2, 3, 5, 9, 123]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "rs", - "prompt": "/// Given a string text, replace all spaces in it with underscores, \n/// and if a string has more than 2 consecutive spaces, \n/// then replace all consecutive spaces with - \n/// >>> fix_spaces(String::from(\" Example\"))\n/// String::from(\"Example\")\n/// >>> fix_spaces(String::from(\" Example 1\"))\n/// String::from(\"Example_1\")\n/// >>> fix_spaces(String::from(\" Example 2\"))\n/// String::from(\"_Example_2\")\n/// >>> fix_spaces(String::from(\" Example 3\"))\n/// String::from(\"_Example-3\")\nfn fix_spaces(text: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = fix_spaces;\n assert_eq!(candidate(String::from(\"Example\")), String::from(\"Example\"));\n assert_eq!(candidate(String::from(\"Mudasir Hanif \")), String::from(\"Mudasir_Hanif_\"));\n assert_eq!(candidate(String::from(\"Yellow Yellow Dirty Fellow\")), String::from(\"Yellow_Yellow__Dirty__Fellow\"));\n assert_eq!(candidate(String::from(\"Exa mple\")), String::from(\"Exa-mple\"));\n assert_eq!(candidate(String::from(\" Exa 1 2 2 mple\")), String::from(\"-Exa_1_2_2_mple\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "rs", - "prompt": "/// Return 2^n modulo p (be aware of numerics).\n/// >>> modp(3, 5)\n/// 3\n/// >>> modp(1101, 101)\n/// 2\n/// >>> modp(0, 101)\n/// 1\n/// >>> modp(3, 11)\n/// 8\n/// >>> modp(100, 101)\n/// 1\nfn modp(n: isize, p: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = modp;\n assert_eq!(candidate(3, 5), 3);\n assert_eq!(candidate(1101, 101), 2);\n assert_eq!(candidate(0, 101), 1);\n assert_eq!(candidate(3, 11), 8);\n assert_eq!(candidate(100, 101), 1);\n assert_eq!(candidate(30, 5), 4);\n assert_eq!(candidate(31, 5), 3);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "rs", - "prompt": "/// You have to write a function which validates a given date string and\n/// returns True if the date is valid otherwise False.\n/// The date is valid if all of the following rules are satisfied:\n/// 1. The date string is not empty.\n/// 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n/// 3. The months should not be less than 1 or higher than 12.\n/// 4. The date should be in the format: mm-dd-yyyy\n/// >>> valid_date(String::from(\"03-11-2000\"))\n/// true\n/// >>> valid_date(String::from(\"15-01-2012\"))\n/// false\n/// >>> valid_date(String::from(\"04-0-2040\"))\n/// false\n/// >>> valid_date(String::from(\"06-04-2020\"))\n/// true\n/// >>> valid_date(String::from(\"06/04/2020\"))\n/// false\nfn valid_date(date: String) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = valid_date;\n assert_eq!(candidate(String::from(\"03-11-2000\")), true);\n assert_eq!(candidate(String::from(\"15-01-2012\")), false);\n assert_eq!(candidate(String::from(\"04-0-2040\")), false);\n assert_eq!(candidate(String::from(\"06-04-2020\")), true);\n assert_eq!(candidate(String::from(\"01-01-2007\")), true);\n assert_eq!(candidate(String::from(\"03-32-2011\")), false);\n assert_eq!(candidate(String::from(\"\")), false);\n assert_eq!(candidate(String::from(\"04-31-3000\")), false);\n assert_eq!(candidate(String::from(\"06-06-2005\")), true);\n assert_eq!(candidate(String::from(\"21-31-2000\")), false);\n assert_eq!(candidate(String::from(\"04-12-2003\")), true);\n assert_eq!(candidate(String::from(\"04122003\")), false);\n assert_eq!(candidate(String::from(\"20030412\")), false);\n assert_eq!(candidate(String::from(\"2003-04\")), false);\n assert_eq!(candidate(String::from(\"2003-04-12\")), false);\n assert_eq!(candidate(String::from(\"04-2003\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "rs", - "prompt": "/// Write a function that takes a string and returns an ordered version of it.\n/// Ordered version of string, is a string where all words (separated by space)\n/// are replaced by a new word where all the characters arranged in\n/// ascending order based on ascii value.\n/// Note: You should keep the order of words and blank spaces in the sentence.\n/// For example:\n/// >>> anti_shuffle(String::from(\"Hi\"))\n/// String::from(\"Hi\")\n/// >>> anti_shuffle(String::from(\"hello\"))\n/// String::from(\"ehllo\")\n/// >>> anti_shuffle(String::from(\"Hello World!!!\"))\n/// String::from(\"Hello !!!Wdlor\")\nfn anti_shuffle(s: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = anti_shuffle;\n assert_eq!(candidate(String::from(\"Hi\")), String::from(\"Hi\"));\n assert_eq!(candidate(String::from(\"hello\")), String::from(\"ehllo\"));\n assert_eq!(candidate(String::from(\"number\")), String::from(\"bemnru\"));\n assert_eq!(candidate(String::from(\"abcd\")), String::from(\"abcd\"));\n assert_eq!(candidate(String::from(\"Hello World!!!\")), String::from(\"Hello !!!Wdlor\"));\n assert_eq!(candidate(String::from(\"\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"Hi. My name is Mister Robot. How are you?\")), String::from(\".Hi My aemn is Meirst .Rboot How aer ?ouy\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "rs", - "prompt": "/// Given a list of numbers, return whether or not they are sorted\n/// in ascending order. If list has more than 1 duplicate of the same\n/// number, return False. Assume no negative numbers and only integers.\n/// Examples\n/// >>> is_sorted(vec![5])\n/// true\n/// >>> is_sorted(vec![1, 2, 3, 4, 5])\n/// true\n/// >>> is_sorted(vec![1, 3, 2, 4, 5])\n/// false\n/// >>> is_sorted(vec![1, 2, 3, 4, 5, 6])\n/// true\n/// >>> is_sorted(vec![1, 2, 3, 4, 5, 6, 7])\n/// true\n/// >>> is_sorted(vec![1, 3, 2, 4, 5, 6, 7])\n/// false\n/// >>> is_sorted(vec![1, 2, 2, 3, 3, 4])\n/// true\n/// >>> is_sorted(vec![1, 2, 2, 2, 3, 4])\n/// false\nfn is_sorted(lst: Vec) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = is_sorted;\n assert_eq!(candidate(vec![5]), true);\n assert_eq!(candidate(vec![1, 2, 3, 4, 5]), true);\n assert_eq!(candidate(vec![1, 3, 2, 4, 5]), false);\n assert_eq!(candidate(vec![1, 2, 3, 4, 5, 6]), true);\n assert_eq!(candidate(vec![1, 2, 3, 4, 5, 6, 7]), true);\n assert_eq!(candidate(vec![1, 3, 2, 4, 5, 6, 7]), false);\n assert_eq!(candidate(Vec::::new()), true);\n assert_eq!(candidate(vec![1]), true);\n assert_eq!(candidate(vec![3, 2, 1]), false);\n assert_eq!(candidate(vec![1, 2, 2, 2, 3, 4]), false);\n assert_eq!(candidate(vec![1, 2, 3, 3, 3, 4]), false);\n assert_eq!(candidate(vec![1, 2, 2, 3, 3, 4]), true);\n assert_eq!(candidate(vec![1, 2, 3, 4]), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "rs", - "prompt": "/// You are given a string s.\n/// Your task is to check if the string is happy or not.\n/// A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n/// For example:\n/// >>> is_happy(String::from(\"a\"))\n/// false\n/// >>> is_happy(String::from(\"aa\"))\n/// false\n/// >>> is_happy(String::from(\"abcd\"))\n/// true\n/// >>> is_happy(String::from(\"aabb\"))\n/// false\n/// >>> is_happy(String::from(\"adb\"))\n/// true\n/// >>> is_happy(String::from(\"xyy\"))\n/// false\nfn is_happy(s: String) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = is_happy;\n assert_eq!(candidate(String::from(\"a\")), false);\n assert_eq!(candidate(String::from(\"aa\")), false);\n assert_eq!(candidate(String::from(\"abcd\")), true);\n assert_eq!(candidate(String::from(\"aabb\")), false);\n assert_eq!(candidate(String::from(\"adb\")), true);\n assert_eq!(candidate(String::from(\"xyy\")), false);\n assert_eq!(candidate(String::from(\"iopaxpoi\")), true);\n assert_eq!(candidate(String::from(\"iopaxioi\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "rs", - "prompt": "/// Write a function that returns True if the object q will fly, and False otherwise.\n/// The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n/// Example:\n/// >>> will_it_fly(vec![1, 2], 5)\n/// false\n/// # 1+2 is less than the maximum possible weight, but it's unbalanced.\n/// >>> will_it_fly(vec![3, 2, 3], 1)\n/// false\n/// # it's balanced, but 3+2+3 is more than the maximum possible weight.\n/// >>> will_it_fly(vec![3, 2, 3], 9)\n/// true\n/// # 3+2+3 is less than the maximum possible weight, and it's balanced.\n/// >>> will_it_fly(vec![3], 5)\n/// true\n/// # 3 is less than the maximum possible weight, and it's balanced.\nfn will_it_fly(q: Vec, w: isize) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = will_it_fly;\n assert_eq!(candidate(vec![3, 2, 3], 9), true);\n assert_eq!(candidate(vec![1, 2], 5), false);\n assert_eq!(candidate(vec![3], 5), true);\n assert_eq!(candidate(vec![3, 2, 3], 1), false);\n assert_eq!(candidate(vec![1, 2, 3], 6), false);\n assert_eq!(candidate(vec![5], 5), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "rs", - "prompt": "/// Given an array of non-negative integers, return a copy of the given array after sorting,\n/// you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n/// or sort it in descending order if the sum( first index value, last index value) is even.\n/// Note:\n/// * don't change the given array.\n/// Examples:\n/// >>> sort_array(vec![])\n/// Vec::::new()\n/// >>> sort_array(vec![5])\n/// vec![5]\n/// >>> sort_array(vec![2, 4, 3, 0, 1, 5])\n/// vec![0, 1, 2, 3, 4, 5]\n/// >>> sort_array(vec![2, 4, 3, 0, 1, 5, 6])\n/// vec![6, 5, 4, 3, 2, 1, 0]\nfn sort_array(array: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = sort_array;\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![5]), vec![5]);\n assert_eq!(candidate(vec![2, 4, 3, 0, 1, 5]), vec![0, 1, 2, 3, 4, 5]);\n assert_eq!(candidate(vec![2, 4, 3, 0, 1, 5, 6]), vec![6, 5, 4, 3, 2, 1, 0]);\n assert_eq!(candidate(vec![2, 1]), vec![1, 2]);\n assert_eq!(candidate(vec![15, 42, 87, 32, 11, 0]), vec![0, 11, 15, 32, 42, 87]);\n assert_eq!(candidate(vec![21, 14, 23, 11]), vec![23, 21, 14, 11]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "rs", - "prompt": "/// Implement a function that takes an non-negative integer and returns an array of the first n\n/// integers that are prime numbers and less than n.\n/// for example:\n/// >>> count_up_to(5)\n/// vec![2, 3]\n/// >>> count_up_to(11)\n/// vec![2, 3, 5, 7]\n/// >>> count_up_to(0)\n/// Vec::::new()\n/// >>> count_up_to(20)\n/// vec![2, 3, 5, 7, 11, 13, 17, 19]\n/// >>> count_up_to(1)\n/// Vec::::new()\n/// >>> count_up_to(18)\n/// vec![2, 3, 5, 7, 11, 13, 17]\nfn count_up_to(n: isize) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = count_up_to;\n assert_eq!(candidate(5), vec![2, 3]);\n assert_eq!(candidate(6), vec![2, 3, 5]);\n assert_eq!(candidate(7), vec![2, 3, 5]);\n assert_eq!(candidate(10), vec![2, 3, 5, 7]);\n assert_eq!(candidate(0), Vec::::new());\n assert_eq!(candidate(22), vec![2, 3, 5, 7, 11, 13, 17, 19]);\n assert_eq!(candidate(1), Vec::::new());\n assert_eq!(candidate(18), vec![2, 3, 5, 7, 11, 13, 17]);\n assert_eq!(candidate(47), vec![2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43]);\n assert_eq!(candidate(101), vec![2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "rs", - "prompt": "/// Out of list of strings, return the longest one. Return the first one in case of multiple\n/// strings of the same length. Return None in case the input list is empty.\n/// >>> longest(vec![])\n/// None\n/// >>> longest(vec![String::from(\"a\"), String::from(\"b\"), String::from(\"c\")])\n/// Some(String::from(\"a\"))\n/// >>> longest(vec![String::from(\"a\"), String::from(\"bb\"), String::from(\"ccc\")])\n/// Some(String::from(\"ccc\"))\nfn longest(strings: Vec) -> Option {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = longest;\n assert_eq!(candidate(Vec::::new()), None);\n assert_eq!(candidate(vec![String::from(\"x\"), String::from(\"y\"), String::from(\"z\")]), Some(String::from(\"x\")));\n assert_eq!(candidate(vec![String::from(\"x\"), String::from(\"yyy\"), String::from(\"zzzz\"), String::from(\"www\"), String::from(\"kkkk\"), String::from(\"abc\")]), Some(String::from(\"zzzz\")));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "rs", - "prompt": "/// Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n/// reverse the resulting array, and then replace each digit by its corresponding name from\n/// \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n/// For example:\n/// >>> by_length(vec![2, 1, 1, 4, 5, 8, 2, 3])\n/// vec![String::from(\"Eight\"), String::from(\"Five\"), String::from(\"Four\"), String::from(\"Three\"), String::from(\"Two\"), String::from(\"Two\"), String::from(\"One\"), String::from(\"One\")]\n/// If the array is empty, return an empty array:\n/// >>> by_length(vec![])\n/// Vec::::new()\n/// If the array has any strange number ignore it:\n/// >>> by_length(vec![1, -1, 55])\n/// vec![String::from(\"One\")]\nfn by_length(arr: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = by_length;\n assert_eq!(candidate(vec![2, 1, 1, 4, 5, 8, 2, 3]), vec![String::from(\"Eight\"), String::from(\"Five\"), String::from(\"Four\"), String::from(\"Three\"), String::from(\"Two\"), String::from(\"Two\"), String::from(\"One\"), String::from(\"One\")]);\n assert_eq!(candidate(Vec::::new()), Vec::::new());\n assert_eq!(candidate(vec![1, -1, 55]), vec![String::from(\"One\")]);\n assert_eq!(candidate(vec![1, -1, 3, 2]), vec![String::from(\"Three\"), String::from(\"Two\"), String::from(\"One\")]);\n assert_eq!(candidate(vec![9, 4, 8]), vec![String::from(\"Nine\"), String::from(\"Eight\"), String::from(\"Four\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_106_f", - "language": "rs", - "prompt": "/// Implement the function f that takes n as a parameter,\n/// 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\n/// or the sum of numbers from 1 to i otherwise.\n/// i starts from 1.\n/// the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n/// Example:\n/// >>> f(5)\n/// vec![1, 2, 6, 24, 15]\nfn f(n: isize) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = f;\n assert_eq!(candidate(5), vec![1, 2, 6, 24, 15]);\n assert_eq!(candidate(7), vec![1, 2, 6, 24, 15, 720, 28]);\n assert_eq!(candidate(1), vec![1]);\n assert_eq!(candidate(3), vec![1, 2, 6]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "rs", - "prompt": "/// Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n/// >>> fizz_buzz(50)\n/// 0\n/// >>> fizz_buzz(78)\n/// 2\n/// >>> fizz_buzz(79)\n/// 3\nfn fizz_buzz(n: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = fizz_buzz;\n assert_eq!(candidate(50), 0);\n assert_eq!(candidate(78), 2);\n assert_eq!(candidate(79), 3);\n assert_eq!(candidate(100), 3);\n assert_eq!(candidate(200), 6);\n assert_eq!(candidate(4000), 192);\n assert_eq!(candidate(10000), 639);\n assert_eq!(candidate(100000), 8026);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "rs", - "prompt": "/// Given a positive floating point number, it can be decomposed into\n/// and integer part (largest integer smaller than given number) and decimals\n/// (leftover part always smaller than 1).\n/// Return the decimal part of the number.\n/// >>> truncate_number(3.5)\n/// 0.5\nfn truncate_number(number: f64) -> f64 {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = truncate_number;\n assert_eq!(candidate(3.5), 0.5);\n assert_eq!(candidate(1.25), 0.25);\n assert_eq!(candidate(123.0), 0.0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "rs", - "prompt": "/// For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n/// Empty sum should be equal to 0 and empty product should be equal to 1.\n/// >>> sum_product(vec![])\n/// (0, 1)\n/// >>> sum_product(vec![1, 2, 3, 4])\n/// (10, 24)\nfn sum_product(numbers: Vec) -> (isize, isize) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = sum_product;\n assert_eq!(candidate(Vec::::new()), (0, 1));\n assert_eq!(candidate(vec![1, 1, 1]), (3, 1));\n assert_eq!(candidate(vec![100, 0]), (100, 0));\n assert_eq!(candidate(vec![3, 5, 7]), (15, 105));\n assert_eq!(candidate(vec![10]), (10, 10));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "rs", - "prompt": "/// You are given a 2 dimensional data, as a nested lists,\n/// which is similar to matrix, however, unlike matrices,\n/// each row may contain a different number of columns.\n/// Given lst, and integer x, find integers x in the list,\n/// and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n/// each tuple is a coordinate - (row, columns), starting with 0.\n/// Sort coordinates initially by rows in ascending order.\n/// Also, sort coordinates of the row by columns in descending order.\n/// Examples:\n/// >>> get_row(vec![vec![1, 2, 3, 4, 5, 6], vec![1, 2, 3, 4, 1, 6], vec![1, 2, 3, 4, 5, 1]], 1)\n/// vec![(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n/// >>> get_row(vec![], 1)\n/// Vec::<(isize, isize)>::new()\n/// >>> get_row(vec![vec![], vec![1], vec![1, 2, 3]], 3)\n/// vec![(2, 2)]\nfn get_row(lst: Vec>, x: isize) -> Vec<(isize, isize)> {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = get_row;\n assert_eq!(candidate(vec![vec![1, 2, 3, 4, 5, 6], vec![1, 2, 3, 4, 1, 6], vec![1, 2, 3, 4, 5, 1]], 1), vec![(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]);\n assert_eq!(candidate(vec![vec![1, 2, 3, 4, 5, 6], vec![1, 2, 3, 4, 5, 6], vec![1, 2, 3, 4, 5, 6], vec![1, 2, 3, 4, 5, 6], vec![1, 2, 3, 4, 5, 6], vec![1, 2, 3, 4, 5, 6]], 2), vec![(0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1)]);\n assert_eq!(candidate(vec![vec![1, 2, 3, 4, 5, 6], vec![1, 2, 3, 4, 5, 6], vec![1, 1, 3, 4, 5, 6], vec![1, 2, 1, 4, 5, 6], vec![1, 2, 3, 1, 5, 6], vec![1, 2, 3, 4, 1, 6], vec![1, 2, 3, 4, 5, 1]], 1), vec![(0, 0), (1, 0), (2, 1), (2, 0), (3, 2), (3, 0), (4, 3), (4, 0), (5, 4), (5, 0), (6, 5), (6, 0)]);\n assert_eq!(candidate(Vec::>::new(), 1), Vec::<(isize, isize)>::new());\n assert_eq!(candidate(vec![vec![1]], 2), Vec::<(isize, isize)>::new());\n assert_eq!(candidate(vec![vec![], vec![1], vec![1, 2, 3]], 3), vec![(2, 2)]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "rs", - "prompt": "/// You're a hungry rabbit, and you already have eaten a certain number of carrots,\n/// but now you need to eat more carrots to complete the day's meals.\n/// you should return an array of [ total number of eaten carrots after your meals,\n/// the number of carrots left after your meals ]\n/// if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n/// Example:\n/// >>> eat(5, 6, 10)\n/// vec![11, 4]\n/// >>> eat(4, 8, 9)\n/// vec![12, 1]\n/// >>> eat(1, 10, 10)\n/// vec![11, 0]\n/// >>> eat(2, 11, 5)\n/// vec![7, 0]\n/// Variables:\n/// @number : integer\n/// the number of carrots that you have eaten.\n/// @need : integer\n/// the number of carrots that you need to eat.\n/// @remaining : integer\n/// the number of remaining carrots thet exist in stock\n/// Constrain:\n/// * 0 <= number <= 1000\n/// * 0 <= need <= 1000\n/// * 0 <= remaining <= 1000\n/// Have fun :)\nfn eat(number: isize, need: isize, remaining: isize) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = eat;\n assert_eq!(candidate(5, 6, 10), vec![11, 4]);\n assert_eq!(candidate(4, 8, 9), vec![12, 1]);\n assert_eq!(candidate(1, 10, 10), vec![11, 0]);\n assert_eq!(candidate(2, 11, 5), vec![7, 0]);\n assert_eq!(candidate(4, 5, 7), vec![9, 2]);\n assert_eq!(candidate(4, 5, 1), vec![5, 0]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "rs", - "prompt": "/// Given a positive integer N, return the total sum of its digits in binary.\n/// Example\n/// >>> solve(1000)\n/// String::from(\"1\")\n/// >>> solve(150)\n/// String::from(\"110\")\n/// >>> solve(147)\n/// String::from(\"1100\")\n/// Variables:\n/// @N integer\n/// Constraints: 0 \u2264 N \u2264 10000.\n/// Output:\n/// a string of binary number\nfn solve(N: isize) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = solve;\n assert_eq!(candidate(1000), String::from(\"1\"));\n assert_eq!(candidate(150), String::from(\"110\"));\n assert_eq!(candidate(147), String::from(\"1100\"));\n assert_eq!(candidate(333), String::from(\"1001\"));\n assert_eq!(candidate(963), String::from(\"10010\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "rs", - "prompt": "/// You are given a list of integers.\n/// You need to find the largest prime value and return the sum of its digits.\n/// Examples:\n/// >>> skjkasdkd(vec![0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3])\n/// 10\n/// >>> skjkasdkd(vec![1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1])\n/// 25\n/// >>> skjkasdkd(vec![1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3])\n/// 13\n/// >>> skjkasdkd(vec![0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6])\n/// 11\n/// >>> skjkasdkd(vec![0, 81, 12, 3, 1, 21])\n/// 3\n/// >>> skjkasdkd(vec![0, 8, 1, 2, 1, 7])\n/// 7\nfn skjkasdkd(lst: Vec) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = skjkasdkd;\n assert_eq!(candidate(vec![0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]), 10);\n assert_eq!(candidate(vec![1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]), 25);\n assert_eq!(candidate(vec![1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]), 13);\n assert_eq!(candidate(vec![0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]), 11);\n assert_eq!(candidate(vec![0, 81, 12, 3, 1, 21]), 3);\n assert_eq!(candidate(vec![0, 8, 1, 2, 1, 7]), 7);\n assert_eq!(candidate(vec![8191]), 19);\n assert_eq!(candidate(vec![8191, 123456, 127, 7]), 19);\n assert_eq!(candidate(vec![127, 97, 8192]), 10);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "rs", - "prompt": "/// Given an array arr of integers, find the minimum number of elements that\n/// need to be changed to make the array palindromic. A palindromic array is an array that\n/// is read the same backwards and forwards. In one change, you can change one element to any other element.\n/// For example:\n/// >>> smallest_change(vec![1, 2, 3, 5, 4, 7, 9, 6])\n/// 4\n/// >>> smallest_change(vec![1, 2, 3, 4, 3, 2, 2])\n/// 1\n/// >>> smallest_change(vec![1, 2, 3, 2, 1])\n/// 0\nfn smallest_change(arr: Vec) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = smallest_change;\n assert_eq!(candidate(vec![1, 2, 3, 5, 4, 7, 9, 6]), 4);\n assert_eq!(candidate(vec![1, 2, 3, 4, 3, 2, 2]), 1);\n assert_eq!(candidate(vec![1, 4, 2]), 1);\n assert_eq!(candidate(vec![1, 4, 4, 2]), 1);\n assert_eq!(candidate(vec![1, 2, 3, 2, 1]), 0);\n assert_eq!(candidate(vec![3, 1, 1, 3]), 0);\n assert_eq!(candidate(vec![1]), 0);\n assert_eq!(candidate(vec![0, 1]), 1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "rs", - "prompt": "/// It is the last week of the semester and the teacher has to give the grades\n/// to students. The teacher has been making her own algorithm for grading.\n/// The only problem is, she has lost the code she used for grading.\n/// She has given you a list of GPAs for some students and you have to write \n/// a function that can output a list of letter grades using the following table:\n/// GPA | Letter grade\n/// 4.0 A+\n/// > 3.7 A \n/// > 3.3 A- \n/// > 3.0 B+\n/// > 2.7 B \n/// > 2.3 B-\n/// > 2.0 C+\n/// > 1.7 C\n/// > 1.3 C-\n/// > 1.0 D+ \n/// > 0.7 D \n/// > 0.0 D-\n/// 0.0 E\n/// Example:\n/// >>> grade_equation(vec![4.0, 3, 1.7, 2, 3.5])\n/// vec![String::from(\"A+\"), String::from(\"B\"), String::from(\"C-\"), String::from(\"C\"), String::from(\"A-\")]\nfn numerical_letter_grade(grades: Vec) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = numerical_letter_grade;\n assert_eq!(candidate(vec![4.0, 3.0, 1.7, 2.0, 3.5]), vec![String::from(\"A+\"), String::from(\"B\"), String::from(\"C-\"), String::from(\"C\"), String::from(\"A-\")]);\n assert_eq!(candidate(vec![1.2]), vec![String::from(\"D+\")]);\n assert_eq!(candidate(vec![0.5]), vec![String::from(\"D-\")]);\n assert_eq!(candidate(vec![0.0]), vec![String::from(\"E\")]);\n assert_eq!(candidate(vec![1.0, 0.3, 1.5, 2.8, 3.3]), vec![String::from(\"D\"), String::from(\"D-\"), String::from(\"C-\"), String::from(\"B\"), String::from(\"B+\")]);\n assert_eq!(candidate(vec![0.0, 0.7]), vec![String::from(\"E\"), String::from(\"D-\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "rs", - "prompt": "/// Given the lengths of the three sides of a triangle. Return the area of\n/// the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n/// Otherwise return -1\n/// Three sides make a valid triangle when the sum of any two sides is greater \n/// than the third side.\n/// Example:\n/// >>> triangle_area(3, 4, 5)\n/// 6.0\n/// >>> triangle_area(1, 2, 10)\n/// -1.0\nfn triangle_area(a: isize, b: isize, c: isize) -> f64 {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = triangle_area;\n assert_eq!(candidate(3, 4, 5), 6.0);\n assert_eq!(candidate(1, 2, 10), -1.0);\n assert_eq!(candidate(4, 8, 5), 8.18);\n assert_eq!(candidate(2, 2, 2), 1.73);\n assert_eq!(candidate(1, 2, 3), -1.0);\n assert_eq!(candidate(10, 5, 7), 16.25);\n assert_eq!(candidate(2, 6, 3), -1.0);\n assert_eq!(candidate(1, 1, 1), 0.43);\n assert_eq!(candidate(2, 2, 10), -1.0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "rs", - "prompt": "/// Check if two words have the same characters.\n/// >>> same_chars(String::from(\"eabcdzzzz\"), String::from(\"dddzzzzzzzddeddabc\"))\n/// true\n/// >>> same_chars(String::from(\"abcd\"), String::from(\"dddddddabc\"))\n/// true\n/// >>> same_chars(String::from(\"dddddddabc\"), String::from(\"abcd\"))\n/// true\n/// >>> same_chars(String::from(\"eabcd\"), String::from(\"dddddddabc\"))\n/// false\n/// >>> same_chars(String::from(\"abcd\"), String::from(\"dddddddabce\"))\n/// false\n/// >>> same_chars(String::from(\"eabcdzzzz\"), String::from(\"dddzzzzzzzddddabc\"))\n/// false\nfn same_chars(s0: String, s1: String) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = same_chars;\n assert_eq!(candidate(String::from(\"eabcdzzzz\"), String::from(\"dddzzzzzzzddeddabc\")), true);\n assert_eq!(candidate(String::from(\"abcd\"), String::from(\"dddddddabc\")), true);\n assert_eq!(candidate(String::from(\"dddddddabc\"), String::from(\"abcd\")), true);\n assert_eq!(candidate(String::from(\"eabcd\"), String::from(\"dddddddabc\")), false);\n assert_eq!(candidate(String::from(\"abcd\"), String::from(\"dddddddabcf\")), false);\n assert_eq!(candidate(String::from(\"eabcdzzzz\"), String::from(\"dddzzzzzzzddddabc\")), false);\n assert_eq!(candidate(String::from(\"aabb\"), String::from(\"aaccc\")), false);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "rs", - "prompt": "/// Given an array of integers nums, find the minimum sum of any non-empty sub-array\n/// of nums.\n/// Example\n/// >>> minSubArraySum(vec![2, 3, 4, 1, 2, 4])\n/// 1\n/// >>> minSubArraySum(vec![-1, -2, -3])\n/// -6\nfn minSubArraySum(nums: Vec) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = minSubArraySum;\n assert_eq!(candidate(vec![2, 3, 4, 1, 2, 4]), 1);\n assert_eq!(candidate(vec![-1, -2, -3]), -6);\n assert_eq!(candidate(vec![-1, -2, -3, 2, -10]), -14);\n assert_eq!(candidate(vec![-9999999999999999]), -9999999999999999);\n assert_eq!(candidate(vec![0, 10, 20, 1000000]), 0);\n assert_eq!(candidate(vec![-1, -2, -3, 10, -5]), -6);\n assert_eq!(candidate(vec![100, -1, -2, -3, 10, -5]), -6);\n assert_eq!(candidate(vec![10, 11, 13, 8, 3, 4]), 3);\n assert_eq!(candidate(vec![100, -33, 32, -1, 0, -2]), -33);\n assert_eq!(candidate(vec![-10]), -10);\n assert_eq!(candidate(vec![7]), 7);\n assert_eq!(candidate(vec![1, -1]), -1);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "rs", - "prompt": "/// Given a string s and a natural number n, you have been tasked to implement \n/// a function that returns a list of all words from string s that contain exactly \n/// n consonants, in order these words appear in the string s.\n/// If the string s is empty then the function should return an empty list.\n/// Note: you may assume the input string contains only letters and spaces.\n/// Examples:\n/// >>> select_words(String::from(\"Mary had a little lamb\"), 4)\n/// vec![String::from(\"little\")]\n/// >>> select_words(String::from(\"Mary had a little lamb\"), 3)\n/// vec![String::from(\"Mary\"), String::from(\"lamb\")]\n/// >>> select_words(String::from(\"simple white space\"), 2)\n/// Vec::::new()\n/// >>> select_words(String::from(\"Hello world\"), 4)\n/// vec![String::from(\"world\")]\n/// >>> select_words(String::from(\"Uncle sam\"), 3)\n/// vec![String::from(\"Uncle\")]\nfn select_words(s: String, n: isize) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = select_words;\n assert_eq!(candidate(String::from(\"Mary had a little lamb\"), 4), vec![String::from(\"little\")]);\n assert_eq!(candidate(String::from(\"Mary had a little lamb\"), 3), vec![String::from(\"Mary\"), String::from(\"lamb\")]);\n assert_eq!(candidate(String::from(\"simple white space\"), 2), Vec::::new());\n assert_eq!(candidate(String::from(\"Hello world\"), 4), vec![String::from(\"world\")]);\n assert_eq!(candidate(String::from(\"Uncle sam\"), 3), vec![String::from(\"Uncle\")]);\n assert_eq!(candidate(String::from(\"\"), 4), Vec::::new());\n assert_eq!(candidate(String::from(\"a b c d e f\"), 1), vec![String::from(\"b\"), String::from(\"c\"), String::from(\"d\"), String::from(\"f\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "rs", - "prompt": "/// Return list of all prefixes from shortest to longest of the input string\n/// >>> all_prefixes(String::from(\"abc\"))\n/// vec![String::from(\"a\"), String::from(\"ab\"), String::from(\"abc\")]\nfn all_prefixes(string: String) -> Vec {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = all_prefixes;\n assert_eq!(candidate(String::from(\"\")), Vec::::new());\n assert_eq!(candidate(String::from(\"asdfgh\")), vec![String::from(\"a\"), String::from(\"as\"), String::from(\"asd\"), String::from(\"asdf\"), String::from(\"asdfg\"), String::from(\"asdfgh\")]);\n assert_eq!(candidate(String::from(\"WWW\")), vec![String::from(\"W\"), String::from(\"WW\"), String::from(\"WWW\")]);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "rs", - "prompt": "/// Create a function that takes a value (string) representing a number\n/// and returns the closest integer to it. If the number is equidistant\n/// from two integers, round it away from zero.\n/// Examples\n/// >>> closest_integer(String::from(\"10\"))\n/// 10\n/// >>> closest_integer(String::from(\"15.3\"))\n/// 15\n/// Note:\n/// Rounding away from zero means that if the given number is equidistant\n/// from two integers, the one you should return is the one that is the\n/// farthest from zero. For example closest_integer(\"14.5\") should\n/// return 15 and closest_integer(\"-14.5\") should return -15.\nfn closest_integer(value: String) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = closest_integer;\n assert_eq!(candidate(String::from(\"10\")), 10);\n assert_eq!(candidate(String::from(\"14.5\")), 15);\n assert_eq!(candidate(String::from(\"-15.5\")), -16);\n assert_eq!(candidate(String::from(\"15.3\")), 15);\n assert_eq!(candidate(String::from(\"0\")), 0);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "rs", - "prompt": "/// Create a function which takes a string representing a file's name, and returns\n/// 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n/// A file's name is considered to be valid if and only if all the following conditions \n/// are met:\n/// - There should not be more than three digits ('0'-'9') in the file's name.\n/// - The file's name contains exactly one dot '.'\n/// - The substring before the dot should not be empty, and it starts with a letter from \n/// the latin alphapet ('a'-'z' and 'A'-'Z').\n/// - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n/// Examples:\n/// >>> file_name_check(String::from(\"example.txt\"))\n/// String::from(\"Yes\")\n/// >>> file_name_check(String::from(\"1example.dll\"))\n/// String::from(\"No\")\nfn file_name_check(file_name: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = file_name_check;\n assert_eq!(candidate(String::from(\"example.txt\")), String::from(\"Yes\"));\n assert_eq!(candidate(String::from(\"1example.dll\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"s1sdf3.asd\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"K.dll\")), String::from(\"Yes\"));\n assert_eq!(candidate(String::from(\"MY16FILE3.exe\")), String::from(\"Yes\"));\n assert_eq!(candidate(String::from(\"His12FILE94.exe\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"_Y.txt\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"?aREYA.exe\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"/this_is_valid.dll\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"this_is_valid.wow\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"this_is_valid.txt\")), String::from(\"Yes\"));\n assert_eq!(candidate(String::from(\"this_is_valid.txtexe\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"#this2_i4s_5valid.ten\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"@this1_is6_valid.exe\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"this_is_12valid.6exe4.txt\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"all.exe.txt\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"I563_No.exe\")), String::from(\"Yes\"));\n assert_eq!(candidate(String::from(\"Is3youfault.txt\")), String::from(\"Yes\"));\n assert_eq!(candidate(String::from(\"no_one#knows.dll\")), String::from(\"Yes\"));\n assert_eq!(candidate(String::from(\"1I563_Yes3.exe\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"I563_Yes3.txtt\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"final..txt\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"final132\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"_f4indsartal132.\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\".txt\")), String::from(\"No\"));\n assert_eq!(candidate(String::from(\"s.\")), String::from(\"No\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "rs", - "prompt": "/// You are given two intervals,\n/// where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n/// The given intervals are closed which means that the interval (start, end)\n/// includes both start and end.\n/// For each given interval, it is assumed that its start is less or equal its end.\n/// Your task is to determine whether the length of intersection of these two \n/// intervals is a prime number.\n/// Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n/// which its length is 1, which not a prime number.\n/// If the length of the intersection is a prime number, return \"YES\",\n/// otherwise, return \"NO\".\n/// If the two intervals don't intersect, return \"NO\".\n/// [input/output] samples:\n/// >>> intersection((1, 2), (2, 3))\n/// String::from(\"NO\")\n/// >>> intersection((-1, 1), (0, 4))\n/// String::from(\"NO\")\n/// >>> intersection((-3, -1), (-5, 5))\n/// String::from(\"YES\")\nfn intersection(interval1: (isize, isize), interval2: (isize, isize)) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = intersection;\n assert_eq!(candidate((1, 2), (2, 3)), String::from(\"NO\"));\n assert_eq!(candidate((-1, 1), (0, 4)), String::from(\"NO\"));\n assert_eq!(candidate((-3, -1), (-5, 5)), String::from(\"YES\"));\n assert_eq!(candidate((-2, 2), (-4, 0)), String::from(\"YES\"));\n assert_eq!(candidate((-11, 2), (-1, -1)), String::from(\"NO\"));\n assert_eq!(candidate((1, 2), (3, 5)), String::from(\"NO\"));\n assert_eq!(candidate((1, 2), (1, 2)), String::from(\"NO\"));\n assert_eq!(candidate((-2, -2), (-3, -2)), String::from(\"NO\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "rs", - "prompt": "/// Return the largest prime factor of n. Assume n > 1 and is not a prime.\n/// >>> largest_prime_factor(13195)\n/// 29\n/// >>> largest_prime_factor(2048)\n/// 2\nfn largest_prime_factor(n: isize) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = largest_prime_factor;\n assert_eq!(candidate(15), 5);\n assert_eq!(candidate(27), 3);\n assert_eq!(candidate(63), 7);\n assert_eq!(candidate(330), 11);\n assert_eq!(candidate(13195), 29);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "rs", - "prompt": "/// Given a string, find out how many distinct characters (regardless of case) does it consist of\n/// >>> count_distinct_characters(String::from(\"xyzXYZ\"))\n/// 3\n/// >>> count_distinct_characters(String::from(\"Jerry\"))\n/// 4\nfn count_distinct_characters(string: String) -> isize {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = count_distinct_characters;\n assert_eq!(candidate(String::from(\"\")), 0);\n assert_eq!(candidate(String::from(\"abcde\")), 5);\n assert_eq!(candidate(String::from(\"abcdecadeCADE\")), 5);\n assert_eq!(candidate(String::from(\"aaaaAAAAaaaa\")), 1);\n assert_eq!(candidate(String::from(\"Jerry jERRY JeRRRY\")), 5);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "rs", - "prompt": "/// You're given a list of deposit and withdrawal operations on a bank account that starts with\n/// zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n/// at that point function should return True. Otherwise it should return False.\n/// >>> below_zero(vec![1, 2, 3])\n/// false\n/// >>> below_zero(vec![1, 2, -4, 5])\n/// true\nfn below_zero(operations: Vec) -> bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = below_zero;\n assert_eq!(candidate(Vec::::new()), false);\n assert_eq!(candidate(vec![1, 2, -3, 1, 2, -3]), false);\n assert_eq!(candidate(vec![1, 2, -4, 5, 6]), true);\n assert_eq!(candidate(vec![1, -1, 2, -2, 5, -5, 4, -4]), false);\n assert_eq!(candidate(vec![1, -1, 2, -2, 5, -5, 4, -5]), true);\n assert_eq!(candidate(vec![1, -2, 2, -2, 5, -5, 4, -4]), true);\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "rs", - "prompt": "/// Find the shortest palindrome that begins with a supplied string.\n/// Algorithm idea is simple:\n/// - Find the longest postfix of supplied string that is a palindrome.\n/// - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n/// >>> make_palindrome(String::from(\"\"))\n/// String::from(\"\")\n/// >>> make_palindrome(String::from(\"cat\"))\n/// String::from(\"catac\")\n/// >>> make_palindrome(String::from(\"cata\"))\n/// String::from(\"catac\")\nfn make_palindrome(string: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = make_palindrome;\n assert_eq!(candidate(String::from(\"\")), String::from(\"\"));\n assert_eq!(candidate(String::from(\"x\")), String::from(\"x\"));\n assert_eq!(candidate(String::from(\"xyz\")), String::from(\"xyzyx\"));\n assert_eq!(candidate(String::from(\"xyx\")), String::from(\"xyx\"));\n assert_eq!(candidate(String::from(\"jerry\")), String::from(\"jerryrrej\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "rs", - "prompt": "/// Given a positive integer, obtain its roman numeral equivalent as a string,\n/// and return it in lowercase.\n/// Restrictions: 1 <= num <= 1000\n/// Examples:\n/// >>> int_to_mini_roman(19)\n/// String::from(\"xix\")\n/// >>> int_to_mini_roman(152)\n/// String::from(\"clii\")\n/// >>> int_to_mini_roman(426)\n/// String::from(\"cdxxvi\")\nfn int_to_mini_roman(number: isize) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "}\n\nfn main() {\n let candidate = int_to_mini_roman;\n assert_eq!(candidate(19), String::from(\"xix\"));\n assert_eq!(candidate(152), String::from(\"clii\"));\n assert_eq!(candidate(251), String::from(\"ccli\"));\n assert_eq!(candidate(426), String::from(\"cdxxvi\"));\n assert_eq!(candidate(500), String::from(\"d\"));\n assert_eq!(candidate(1), String::from(\"i\"));\n assert_eq!(candidate(4), String::from(\"iv\"));\n assert_eq!(candidate(43), String::from(\"xliii\"));\n assert_eq!(candidate(90), String::from(\"xc\"));\n assert_eq!(candidate(94), String::from(\"xciv\"));\n assert_eq!(candidate(532), String::from(\"dxxxii\"));\n assert_eq!(candidate(900), String::from(\"cm\"));\n assert_eq!(candidate(994), String::from(\"cmxciv\"));\n assert_eq!(candidate(1000), String::from(\"m\"));\n}\n", - "stop_tokens": [ - "\n}" - ] - } -] \ No newline at end of file diff --git a/data/scala-keep.json b/data/scala-keep.json deleted file mode 100644 index 66c6f1075691fd4f141060f26f8933f8c8650129..0000000000000000000000000000000000000000 --- a/data/scala-keep.json +++ /dev/null @@ -1,1922 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // For a given number n, find the largest number that divides n evenly, smaller than n\n // >>> largest_divisor(15)\n // 5\n def largestDivisor(n : Long) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(largestDivisor((3l)) == (1l));\n assert(largestDivisor((7l)) == (1l));\n assert(largestDivisor((10l)) == (5l));\n assert(largestDivisor((100l)) == (50l));\n assert(largestDivisor((49l)) == (7l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_47_median", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return median of elements in the list l.\n // >>> median([3, 1, 2, 4, 5])\n // 3\n // >>> median([-10, 4, 6, 1000, 10, 20])\n // 15.0\n def median(l : List[Long]) : Float = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(median((List[Long](3l.toLong, 1l.toLong, 2l.toLong, 4l.toLong, 5l.toLong))) == 3l);\n assert(median((List[Long](-10l.toLong, 4l.toLong, 6l.toLong, 1000l.toLong, 10l.toLong, 20l.toLong))) == (8.0f));\n assert(median((List[Long](5l.toLong))) == 5l);\n assert(median((List[Long](6l.toLong, 5l.toLong))) == (5.5f));\n assert(median((List[Long](8l.toLong, 1l.toLong, 3l.toLong, 9l.toLong, 9l.toLong, 2l.toLong, 7l.toLong))) == 7l);\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given two lists operator, and operand. The first list has basic algebra operations, and \n // the second list is a list of integers. Use the two given lists to build the algebric \n // expression and return the evaluation of this expression.\n // The basic algebra operations:\n // Addition ( + ) \n // Subtraction ( - ) \n // Multiplication ( * ) \n // Floor division ( // ) \n // Exponentiation ( ** ) \n // Example:\n // operator['+', '*', '-']\n // array = [2, 3, 4, 5]\n // result = 2 + 3 * 4 - 5\n // => result = 9\n // Note:\n // The length of operator list is equal to the length of operand list minus one.\n // Operand is a list of of non-negative integers.\n // Operator list has at least one operator, and operand list has at least two operands.\n def doAlgebra(op : List[String], operand : List[Long]) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(doAlgebra((List[String](\"**\", \"*\", \"+\")), (List[Long](2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong))) == (37l));\n assert(doAlgebra((List[String](\"+\", \"*\", \"-\")), (List[Long](2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong))) == (9l));\n assert(doAlgebra((List[String](\"//\", \"*\")), (List[Long](7l.toLong, 3l.toLong, 4l.toLong))) == (8l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return maximum element in the list.\n // >>> max_element([1, 2, 3])\n // 3\n // >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n // 123\n def maxElement(l : List[Long]) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(maxElement((List[Long](1l.toLong, 2l.toLong, 3l.toLong))) == (3l));\n assert(maxElement((List[Long](5l.toLong, 3l.toLong, -5l.toLong, 2l.toLong, -3l.toLong, 3l.toLong, 9l.toLong, 0l.toLong, 124l.toLong, 1l.toLong, -10l.toLong))) == (124l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function which returns the largest index of an element which\n // is not greater than or equal to the element immediately preceding it. If\n // no such element exists then return -1. The given array will not contain\n // duplicate values.\n // Examples:\n // can_arrange([1,2,4,3,5]) = 3\n // can_arrange([1,2,3]) = -1\n def canArrange(arr : List[Long]) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(canArrange((List[Long](1l.toLong, 2l.toLong, 4l.toLong, 3l.toLong, 5l.toLong))) == (3l));\n assert(canArrange((List[Long](1l.toLong, 2l.toLong, 4l.toLong, 5l.toLong))) == (-1l));\n assert(canArrange((List[Long](1l.toLong, 4l.toLong, 2l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong, 9l.toLong, 10l.toLong))) == (2l));\n assert(canArrange((List[Long](4l.toLong, 8l.toLong, 5l.toLong, 7l.toLong, 3l.toLong))) == (4l));\n assert(canArrange((List[Long]())) == (-1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Imagine a road that's a perfectly straight infinitely long line.\n // n cars are driving left to right; simultaneously, a different set of n cars\n // are driving right to left. The two sets of cars start out being very far from\n // each other. All cars move in the same speed. Two cars are said to collide\n // when a car that's moving left to right hits a car that's moving right to left.\n // However, the cars are infinitely sturdy and strong; as a result, they continue moving\n // in their trajectory as if they did not collide.\n // This function outputs the number of such collisions.\n def carRaceCollision(n : Long) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(carRaceCollision((2l)) == (4l));\n assert(carRaceCollision((3l)) == (9l));\n assert(carRaceCollision((4l)) == (16l));\n assert(carRaceCollision((8l)) == (64l));\n assert(carRaceCollision((10l)) == (100l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function that returns True if the last character\n // of a given string is an alphabetical character and is not\n // a part of a word, and False otherwise.\n // Note: \"word\" is a group of characters separated by space.\n // Examples:\n // check_if_last_char_is_a_letter(\"apple pie\") \u279e False\n // check_if_last_char_is_a_letter(\"apple pi e\") \u279e True\n // check_if_last_char_is_a_letter(\"apple pi e \") \u279e False\n // check_if_last_char_is_a_letter(\"\") \u279e False\n def checkIfLastCharIsALetter(txt : String) : Boolean = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(checkIfLastCharIsALetter((\"apple\")) == (false));\n assert(checkIfLastCharIsALetter((\"apple pi e\")) == (true));\n assert(checkIfLastCharIsALetter((\"eeeee\")) == (false));\n assert(checkIfLastCharIsALetter((\"A\")) == (true));\n assert(checkIfLastCharIsALetter((\"Pumpkin pie \")) == (false));\n assert(checkIfLastCharIsALetter((\"Pumpkin pie 1\")) == (false));\n assert(checkIfLastCharIsALetter((\"\")) == (false));\n assert(checkIfLastCharIsALetter((\"eeeee e \")) == (false));\n assert(checkIfLastCharIsALetter((\"apple pie\")) == (false));\n assert(checkIfLastCharIsALetter((\"apple pi e \")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return true if a given number is prime, and false otherwise.\n // >>> is_prime(6)\n // False\n // >>> is_prime(101)\n // True\n // >>> is_prime(11)\n // True\n // >>> is_prime(13441)\n // True\n // >>> is_prime(61)\n // True\n // >>> is_prime(4)\n // False\n // >>> is_prime(1)\n // False\n def isPrime(n : Long) : Boolean = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(isPrime((6l)) == (false));\n assert(isPrime((101l)) == (true));\n assert(isPrime((11l)) == (true));\n assert(isPrime((13441l)) == (true));\n assert(isPrime((61l)) == (true));\n assert(isPrime((4l)) == (false));\n assert(isPrime((1l)) == (false));\n assert(isPrime((5l)) == (true));\n assert(isPrime((11l)) == (true));\n assert(isPrime((17l)) == (true));\n assert(isPrime((85l)) == (false));\n assert(isPrime((77l)) == (false));\n assert(isPrime((255379l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a list of positive integers x. return a sorted list of all \n // elements that hasn't any even digit.\n // Note: Returned list should be sorted in increasing order.\n // For example:\n // >>> unique_digits([15, 33, 1422, 1])\n // [1, 15, 33]\n // >>> unique_digits([152, 323, 1422, 10])\n // []\n def uniqueDigits(x : List[Long]) : List[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(uniqueDigits((List[Long](15l.toLong, 33l.toLong, 1422l.toLong, 1l.toLong))).equals((List[Long](1l.toLong, 15l.toLong, 33l.toLong))));\n assert(uniqueDigits((List[Long](152l.toLong, 323l.toLong, 1422l.toLong, 10l.toLong))).equals((List[Long]())));\n assert(uniqueDigits((List[Long](12345l.toLong, 2033l.toLong, 111l.toLong, 151l.toLong))).equals((List[Long](111l.toLong, 151l.toLong))));\n assert(uniqueDigits((List[Long](135l.toLong, 103l.toLong, 31l.toLong))).equals((List[Long](31l.toLong, 135l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Input are two strings a and b consisting only of 1s and 0s.\n // Perform binary XOR on these inputs and return result also as a string.\n // >>> string_xor('010', '110')\n // '100'\n def stringXor(a : String, b : String) : String = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(stringXor((\"111000\"), (\"101010\")).equals((\"010010\")));\n assert(stringXor((\"1\"), (\"1\")).equals((\"0\")));\n assert(stringXor((\"0101\"), (\"0000\")).equals((\"0101\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // sum_to_n is a function that sums numbers from 1 to n.\n // >>> sum_to_n(30)\n // 465\n // >>> sum_to_n(100)\n // 5050\n // >>> sum_to_n(5)\n // 15\n // >>> sum_to_n(10)\n // 55\n // >>> sum_to_n(1)\n // 1\n def sumToN(n : Long) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sumToN((1l)) == (1l));\n assert(sumToN((6l)) == (21l));\n assert(sumToN((11l)) == (66l));\n assert(sumToN((30l)) == (465l));\n assert(sumToN((100l)) == (5050l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a list of numbers, return the sum of squares of the numbers\n // in the list that are odd. Ignore numbers that are negative or not integers.\n // double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10\n // double_the_difference([-1, -2, 0]) == 0\n // double_the_difference([9, -2]) == 81\n // double_the_difference([0]) == 0 \n // If the input list is empty, return 0.\n def doubleTheDifference(lst : List[Float]) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(doubleTheDifference((List[Float]())) == (0l));\n assert(doubleTheDifference((List[Float](5.0f.toFloat, 4.0f.toFloat))) == (25l));\n assert(doubleTheDifference((List[Float](0.1f.toFloat, 0.2f.toFloat, 0.3f.toFloat))) == (0l));\n assert(doubleTheDifference((List[Float](-10.0f.toFloat, -20.0f.toFloat, -30.0f.toFloat))) == (0l));\n assert(doubleTheDifference((List[Float](-1.0f.toFloat, -2.0f.toFloat, 8.0f.toFloat))) == (0l));\n assert(doubleTheDifference((List[Float](0.2f.toFloat, 3.0f.toFloat, 5.0f.toFloat))) == (34l));\n assert(doubleTheDifference((List[Float](-9.0f.toFloat, -7.0f.toFloat, -5.0f.toFloat, -3.0f.toFloat, -1.0f.toFloat, 1.0f.toFloat, 3.0f.toFloat, 5.0f.toFloat, 7.0f.toFloat, 9.0f.toFloat))) == (165l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return length of given string\n // >>> strlen('')\n // 0\n // >>> strlen('abc')\n // 3\n def strlen(string : String) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(strlen((\"\")) == (0l));\n assert(strlen((\"x\")) == (1l));\n assert(strlen((\"asdasnakj\")) == (9l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You'll be given a string of words, and your task is to count the number\n // of boredoms. A boredom is a sentence that starts with the word \"I\".\n // Sentences are delimited by '.', '?' or '!'.\n // For example:\n // >>> is_bored(\"Hello world\")\n // 0\n // >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n // 1\n def isBored(S : String) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(isBored((\"Hello world\")) == (0l));\n assert(isBored((\"Is the sky blue?\")) == (0l));\n assert(isBored((\"I love It !\")) == (1l));\n assert(isBored((\"bIt\")) == (0l));\n assert(isBored((\"I feel good today. I will be productive. will kill It\")) == (2l));\n assert(isBored((\"You and I are going for a walk\")) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function vowels_count which takes a string representing\n // a word as input and returns the number of vowels in the string.\n // Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n // vowel, but only when it is at the end of the given word.\n // Example:\n // >>> vowels_count(\"abcde\")\n // 2\n // >>> vowels_count(\"ACEDY\")\n // 3\n def vowelsCount(s : String) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(vowelsCount((\"abcde\")) == (2l));\n assert(vowelsCount((\"Alone\")) == (3l));\n assert(vowelsCount((\"key\")) == (2l));\n assert(vowelsCount((\"bye\")) == (1l));\n assert(vowelsCount((\"keY\")) == (2l));\n assert(vowelsCount((\"bYe\")) == (1l));\n assert(vowelsCount((\"ACEDY\")) == (3l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return n-th Fibonacci number.\n // >>> fib(10)\n // 55\n // >>> fib(1)\n // 1\n // >>> fib(8)\n // 21\n def fib(n : Long) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(fib((10l)) == (55l));\n assert(fib((1l)) == (1l));\n assert(fib((8l)) == (21l));\n assert(fib((11l)) == (89l));\n assert(fib((12l)) == (144l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Your task is to implement a function that will simplify the expression\n // x * n. The function returns True if x * n evaluates to a whole number and False\n // otherwise. Both x and n, are string representation of a fraction, and have the following format,\n // / where both numerator and denominator are positive whole numbers.\n // You can assume that x, and n are valid fractions, and do not have zero as denominator.\n // simplify(\"1/5\", \"5/1\") = True\n // simplify(\"1/6\", \"2/1\") = False\n // simplify(\"7/10\", \"10/2\") = False\n def simplify(x : String, n : String) : Boolean = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(simplify((\"1/5\"), (\"5/1\")) == (true));\n assert(simplify((\"1/6\"), (\"2/1\")) == (false));\n assert(simplify((\"5/1\"), (\"3/1\")) == (true));\n assert(simplify((\"7/10\"), (\"10/2\")) == (false));\n assert(simplify((\"2/10\"), (\"50/10\")) == (true));\n assert(simplify((\"7/2\"), (\"4/2\")) == (true));\n assert(simplify((\"11/6\"), (\"6/1\")) == (true));\n assert(simplify((\"2/3\"), (\"5/2\")) == (false));\n assert(simplify((\"5/2\"), (\"3/5\")) == (false));\n assert(simplify((\"2/4\"), (\"8/4\")) == (true));\n assert(simplify((\"2/4\"), (\"4/2\")) == (true));\n assert(simplify((\"1/5\"), (\"5/1\")) == (true));\n assert(simplify((\"1/5\"), (\"1/5\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a string s, count the number of uppercase vowels in even indices.\n // For example:\n // count_upper('aBCdEf') returns 1\n // count_upper('abcdefg') returns 0\n // count_upper('dBBE') returns 0\n def countUpper(s : String) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(countUpper((\"aBCdEf\")) == (1l));\n assert(countUpper((\"abcdefg\")) == (0l));\n assert(countUpper((\"dBBE\")) == (0l));\n assert(countUpper((\"B\")) == (0l));\n assert(countUpper((\"U\")) == (1l));\n assert(countUpper((\"\")) == (0l));\n assert(countUpper((\"EEEE\")) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a rectangular grid of wells. Each row represents a single well,\n // and each 1 in a row represents a single unit of water.\n // Each well has a corresponding bucket that can be used to extract water from it, \n // and all buckets have the same capacity.\n // Your task is to use the buckets to empty the wells.\n // Output the number of times you need to lower the buckets.\n // Example 1:\n // Input: \n // grid : [[0,0,1,0], [0,1,0,0], [1,1,1,1]]\n // bucket_capacity : 1\n // Output: 6\n // Example 2:\n // Input: \n // grid : [[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]]\n // bucket_capacity : 2\n // Output: 5\n // Example 3:\n // Input: \n // grid : [[0,0,0], [0,0,0]]\n // bucket_capacity : 5\n // Output: 0\n // Constraints:\n // * all wells have the same length\n // * 1 <= grid.length <= 10^2\n // * 1 <= grid[:,1].length <= 10^2\n // * grid[i][j] -> 0 | 1\n // * 1 <= capacity <= 10\n def maxFill(grid : List[List[Long]], capacity : Long) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(maxFill((List[List[Long]](List[Long](0l.toLong, 0l.toLong, 1l.toLong, 0l.toLong), List[Long](0l.toLong, 1l.toLong, 0l.toLong, 0l.toLong), List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))), (1l)) == (6l));\n assert(maxFill((List[List[Long]](List[Long](0l.toLong, 0l.toLong, 1l.toLong, 1l.toLong), List[Long](0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong), List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong), List[Long](0l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))), (2l)) == (5l));\n assert(maxFill((List[List[Long]](List[Long](0l.toLong, 0l.toLong, 0l.toLong), List[Long](0l.toLong, 0l.toLong, 0l.toLong))), (5l)) == (0l));\n assert(maxFill((List[List[Long]](List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong), List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))), (2l)) == (4l));\n assert(maxFill((List[List[Long]](List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong), List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))), (9l)) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given an array arr of integers and a positive integer k, return a sorted list \n // of length k with the maximum k numbers in arr.\n // Example 1:\n // Input: arr = [-3, -4, 5], k = 3\n // Output: [-4, -3, 5]\n // Example 2:\n // Input: arr = [4, -4, 4], k = 2\n // Output: [4, 4]\n // Example 3:\n // Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1\n // Output: [2]\n // Note:\n // 1. The length of the array will be in the range of [1, 1000].\n // 2. The elements in the array will be in the range of [-1000, 1000].\n // 3. 0 <= k <= len(arr)\n def maximum(arr : List[Long], k : Long) : List[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(maximum((List[Long](-3l.toLong, -4l.toLong, 5l.toLong)), (3l)).equals((List[Long](-4l.toLong, -3l.toLong, 5l.toLong))));\n assert(maximum((List[Long](4l.toLong, -4l.toLong, 4l.toLong)), (2l)).equals((List[Long](4l.toLong, 4l.toLong))));\n assert(maximum((List[Long](-3l.toLong, 2l.toLong, 1l.toLong, 2l.toLong, -1l.toLong, -2l.toLong, 1l.toLong)), (1l)).equals((List[Long](2l.toLong))));\n assert(maximum((List[Long](123l.toLong, -123l.toLong, 20l.toLong, 0l.toLong, 1l.toLong, 2l.toLong, -3l.toLong)), (3l)).equals((List[Long](2l.toLong, 20l.toLong, 123l.toLong))));\n assert(maximum((List[Long](-123l.toLong, 20l.toLong, 0l.toLong, 1l.toLong, 2l.toLong, -3l.toLong)), (4l)).equals((List[Long](0l.toLong, 1l.toLong, 2l.toLong, 20l.toLong))));\n assert(maximum((List[Long](5l.toLong, 15l.toLong, 0l.toLong, 3l.toLong, -13l.toLong, -8l.toLong, 0l.toLong)), (7l)).equals((List[Long](-13l.toLong, -8l.toLong, 0l.toLong, 0l.toLong, 3l.toLong, 5l.toLong, 15l.toLong))));\n assert(maximum((List[Long](-1l.toLong, 0l.toLong, 2l.toLong, 5l.toLong, 3l.toLong, -10l.toLong)), (2l)).equals((List[Long](3l.toLong, 5l.toLong))));\n assert(maximum((List[Long](1l.toLong, 0l.toLong, 5l.toLong, -7l.toLong)), (1l)).equals((List[Long](5l.toLong))));\n assert(maximum((List[Long](4l.toLong, -4l.toLong)), (2l)).equals((List[Long](-4l.toLong, 4l.toLong))));\n assert(maximum((List[Long](-10l.toLong, 10l.toLong)), (2l)).equals((List[Long](-10l.toLong, 10l.toLong))));\n assert(maximum((List[Long](1l.toLong, 2l.toLong, 3l.toLong, -23l.toLong, 243l.toLong, -400l.toLong, 0l.toLong)), (0l)).equals((List[Long]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that takes a message, and encodes in such a \n // way that it swaps case of all letters, replaces all vowels in \n // the message with the letter that appears 2 places ahead of that \n // vowel in the english alphabet. \n // Assume only letters. \n // Examples:\n // >>> encode('test')\n // 'TGST'\n // >>> encode('This is a message')\n // 'tHKS KS C MGSSCGG'\n def encode(message : String) : String = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(encode((\"TEST\")).equals((\"tgst\")));\n assert(encode((\"Mudasir\")).equals((\"mWDCSKR\")));\n assert(encode((\"YES\")).equals((\"ygs\")));\n assert(encode((\"This is a message\")).equals((\"tHKS KS C MGSSCGG\")));\n assert(encode((\"I DoNt KnOw WhAt tO WrItE\")).equals((\"k dQnT kNqW wHcT Tq wRkTg\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // remove_vowels is a function that takes string and returns string without vowels.\n // >>> remove_vowels('')\n // ''\n // >>> remove_vowels('abcdef')\n // 'bcdf'\n // >>> remove_vowels('aaaaa')\n // ''\n // >>> remove_vowels('aaBAA')\n // 'B'\n // >>> remove_vowels('zbcd')\n // 'zbcd'\n def removeVowels(text : String) : String = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(removeVowels((\"\")).equals((\"\")));\n assert(removeVowels((\"abcdef\\nghijklm\")).equals((\"bcdf\\nghjklm\")));\n assert(removeVowels((\"fedcba\")).equals((\"fdcb\")));\n assert(removeVowels((\"eeeee\")).equals((\"\")));\n assert(removeVowels((\"acBAA\")).equals((\"cB\")));\n assert(removeVowels((\"EcBOO\")).equals((\"cB\")));\n assert(removeVowels((\"ybcd\")).equals((\"ybcd\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return only positive numbers in the list.\n // >>> get_positive([-1, 2, -4, 5, 6])\n // [2, 5, 6]\n // >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n // [5, 3, 2, 3, 9, 123, 1]\n def getPositive(l : List[Long]) : List[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(getPositive((List[Long](-1l.toLong, -2l.toLong, 4l.toLong, 5l.toLong, 6l.toLong))).equals((List[Long](4l.toLong, 5l.toLong, 6l.toLong))));\n assert(getPositive((List[Long](5l.toLong, 3l.toLong, -5l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 9l.toLong, 0l.toLong, 123l.toLong, 1l.toLong, -10l.toLong))).equals((List[Long](5l.toLong, 3l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 9l.toLong, 123l.toLong, 1l.toLong))));\n assert(getPositive((List[Long](-1l.toLong, -2l.toLong))).equals((List[Long]())));\n assert(getPositive((List[Long]())).equals((List[Long]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n // >>> string_sequence(0)\n // '0'\n // >>> string_sequence(5)\n // '0 1 2 3 4 5'\n def stringSequence(n : Long) : String = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(stringSequence((0l)).equals((\"0\")));\n assert(stringSequence((3l)).equals((\"0 1 2 3\")));\n assert(stringSequence((10l)).equals((\"0 1 2 3 4 5 6 7 8 9 10\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a positive integer n, you have to make a pile of n levels of stones.\n // The first level has n stones.\n // The number of stones in the next level is:\n // - the next odd number if n is odd.\n // - the next even number if n is even.\n // Return the number of stones in each level in a list, where element at index\n // i represents the number of stones in the level (i+1).\n // Examples:\n // >>> make_a_pile(3)\n // [3, 5, 7]\n def makeAPile(n : Long) : List[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(makeAPile((3l)).equals((List[Long](3l.toLong, 5l.toLong, 7l.toLong))));\n assert(makeAPile((4l)).equals((List[Long](4l.toLong, 6l.toLong, 8l.toLong, 10l.toLong))));\n assert(makeAPile((5l)).equals((List[Long](5l.toLong, 7l.toLong, 9l.toLong, 11l.toLong, 13l.toLong))));\n assert(makeAPile((6l)).equals((List[Long](6l.toLong, 8l.toLong, 10l.toLong, 12l.toLong, 14l.toLong, 16l.toLong))));\n assert(makeAPile((8l)).equals((List[Long](8l.toLong, 10l.toLong, 12l.toLong, 14l.toLong, 16l.toLong, 18l.toLong, 20l.toLong, 22l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Task\n // 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\n // then check if the result string is palindrome.\n // A string is called palindrome if it reads the same backward as forward.\n // You should return a tuple containing the result string and True/False for the check.\n // Example\n // For s = \"abcde\", c = \"ae\", the result should be ('bcd',False)\n // For s = \"abcdef\", c = \"b\" the result should be ('acdef',False)\n // For s = \"abcdedcba\", c = \"ab\", the result should be ('cdedc',True)\n def reverseDelete(s : String, c : String) : Tuple2[String, Boolean] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(reverseDelete((\"abcde\"), (\"ae\")).equals(((\"bcd\", false))));\n assert(reverseDelete((\"abcdef\"), (\"b\")).equals(((\"acdef\", false))));\n assert(reverseDelete((\"abcdedcba\"), (\"ab\")).equals(((\"cdedc\", true))));\n assert(reverseDelete((\"dwik\"), (\"w\")).equals(((\"dik\", false))));\n assert(reverseDelete((\"a\"), (\"a\")).equals(((\"\", true))));\n assert(reverseDelete((\"abcdedcba\"), (\"\")).equals(((\"abcdedcba\", true))));\n assert(reverseDelete((\"abcdedcba\"), (\"v\")).equals(((\"abcdedcba\", true))));\n assert(reverseDelete((\"vabba\"), (\"v\")).equals(((\"abba\", true))));\n assert(reverseDelete((\"mamma\"), (\"mia\")).equals(((\"\", true))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n // >>> flip_case('Hello')\n // 'hELLO'\n def flipCase(string : String) : String = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(flipCase((\"\")).equals((\"\")));\n assert(flipCase((\"Hello!\")).equals((\"hELLO!\")));\n assert(flipCase((\"These violent delights have violent ends\")).equals((\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a string s.\n // if s[i] is a letter, reverse its case from lower to upper or vise versa, \n // otherwise keep it as it is.\n // If the string contains no letters, reverse the string.\n // The function should return the resulted string.\n // Examples\n // solve(\"1234\") = \"4321\"\n // solve(\"ab\") = \"AB\"\n // solve(\"#a@C\") = \"#A@c\"\n def solve(s : String) : String = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(solve((\"AsDf\")).equals((\"aSdF\")));\n assert(solve((\"1234\")).equals((\"4321\")));\n assert(solve((\"ab\")).equals((\"AB\")));\n assert(solve((\"#a@C\")).equals((\"#A@c\")));\n assert(solve((\"#AsdfW^45\")).equals((\"#aSDFw^45\")));\n assert(solve((\"#6@2\")).equals((\"2@6#\")));\n assert(solve((\"#$a^D\")).equals((\"#$A^d\")));\n assert(solve((\"#ccc\")).equals((\"#CCC\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Filter an input list of strings only for ones that start with a given prefix.\n // >>> filter_by_prefix([], 'a')\n // []\n // >>> filter_by_prefix(['abc', 'bcd', 'cde', 'array'], 'a')\n // ['abc', 'array']\n def filterByPrefix(strings : List[String], prefix : String) : List[String] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(filterByPrefix((List[String]()), (\"john\")).equals((List[String]())));\n assert(filterByPrefix((List[String](\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\")), (\"xxx\")).equals((List[String](\"xxx\", \"xxxAAA\", \"xxx\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // This function takes two positive numbers x and y and returns the\n // biggest even integer number that is in the range [x, y] inclusive. If \n // there's no such number, then the function should return -1.\n // For example:\n // choose_num(12, 15) = 14\n // choose_num(13, 12) = -1\n def chooseNum(x : Long, y : Long) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(chooseNum((12l), (15l)) == (14l));\n assert(chooseNum((13l), (12l)) == (-1l));\n assert(chooseNum((33l), (12354l)) == (12354l));\n assert(chooseNum((5234l), (5233l)) == (-1l));\n assert(chooseNum((6l), (29l)) == (28l));\n assert(chooseNum((27l), (10l)) == (-1l));\n assert(chooseNum((7l), (7l)) == (-1l));\n assert(chooseNum((546l), (546l)) == (546l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a string representing a sentence,\n // the sentence contains some words separated by a space,\n // and you have to return a string that contains the words from the original sentence,\n // whose lengths are prime numbers,\n // the order of the words in the new string should be the same as the original one.\n // Example 1:\n // Input: sentence = \"This is a test\"\n // Output: \"is\"\n // Example 2:\n // Input: sentence = \"lets go for swimming\"\n // Output: \"go for\"\n // Constraints:\n // * 1 <= len(sentence) <= 100\n // * sentence contains only letters\n def wordsInSentence(sentence : String) : String = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(wordsInSentence((\"This is a test\")).equals((\"is\")));\n assert(wordsInSentence((\"lets go for swimming\")).equals((\"go for\")));\n assert(wordsInSentence((\"there is no place available here\")).equals((\"there is no place\")));\n assert(wordsInSentence((\"Hi I am Hussein\")).equals((\"Hi am Hussein\")));\n assert(wordsInSentence((\"go for it\")).equals((\"go for it\")));\n assert(wordsInSentence((\"here\")).equals((\"\")));\n assert(wordsInSentence((\"here is\")).equals((\"is\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n // >>> intersperse([], 4)\n // []\n // >>> intersperse([1, 2, 3], 4)\n // [1, 4, 2, 4, 3]\n def intersperse(numbers : List[Long], delimeter : Long) : List[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(intersperse((List[Long]()), (7l)).equals((List[Long]())));\n assert(intersperse((List[Long](5l.toLong, 6l.toLong, 3l.toLong, 2l.toLong)), (8l)).equals((List[Long](5l.toLong, 8l.toLong, 6l.toLong, 8l.toLong, 3l.toLong, 8l.toLong, 2l.toLong))));\n assert(intersperse((List[Long](2l.toLong, 2l.toLong, 2l.toLong)), (2l)).equals((List[Long](2l.toLong, 2l.toLong, 2l.toLong, 2l.toLong, 2l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Your task is to write a function that returns true if a number x is a simple\n // power of n and false in other cases.\n // x is a simple power of n if n**int=x\n // For example:\n // is_simple_power(1, 4) => true\n // is_simple_power(2, 2) => true\n // is_simple_power(8, 2) => true\n // is_simple_power(3, 2) => false\n // is_simple_power(3, 1) => false\n // is_simple_power(5, 3) => false\n def isSimplePower(x : Long, n : Long) : Boolean = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(isSimplePower((16l), (2l)) == (true));\n assert(isSimplePower((143214l), (16l)) == (false));\n assert(isSimplePower((4l), (2l)) == (true));\n assert(isSimplePower((9l), (3l)) == (true));\n assert(isSimplePower((16l), (4l)) == (true));\n assert(isSimplePower((24l), (2l)) == (false));\n assert(isSimplePower((128l), (4l)) == (false));\n assert(isSimplePower((12l), (6l)) == (false));\n assert(isSimplePower((1l), (1l)) == (true));\n assert(isSimplePower((1l), (12l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that returns true if the given number is the multiplication of 3 prime numbers\n // and false otherwise.\n // Knowing that (a) is less then 100. \n // Example:\n // is_multiply_prime(30) == True\n // 30 = 2 * 3 * 5\n def isMultiplyPrime(a : Long) : Boolean = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(isMultiplyPrime((5l)) == (false));\n assert(isMultiplyPrime((30l)) == (true));\n assert(isMultiplyPrime((8l)) == (true));\n assert(isMultiplyPrime((10l)) == (false));\n assert(isMultiplyPrime((125l)) == (true));\n assert(isMultiplyPrime((105l)) == (true));\n assert(isMultiplyPrime((126l)) == (false));\n assert(isMultiplyPrime((729l)) == (false));\n assert(isMultiplyPrime((891l)) == (false));\n assert(isMultiplyPrime((1001l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given the lengths of the three sides of a triangle. Return True if the three\n // sides form a right-angled triangle, False otherwise.\n // A right-angled triangle is a triangle in which one angle is right angle or \n // 90 degree.\n // Example:\n // right_angle_triangle(3, 4, 5) == True\n // right_angle_triangle(1, 2, 3) == False\n def rightAngleTriangle(a : Long, b : Long, c : Long) : Boolean = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(rightAngleTriangle((3l), (4l), (5l)) == (true));\n assert(rightAngleTriangle((1l), (2l), (3l)) == (false));\n assert(rightAngleTriangle((10l), (6l), (8l)) == (true));\n assert(rightAngleTriangle((2l), (2l), (2l)) == (false));\n assert(rightAngleTriangle((7l), (24l), (25l)) == (true));\n assert(rightAngleTriangle((10l), (5l), (7l)) == (false));\n assert(rightAngleTriangle((5l), (12l), (13l)) == (true));\n assert(rightAngleTriangle((15l), (8l), (17l)) == (true));\n assert(rightAngleTriangle((48l), (55l), (73l)) == (true));\n assert(rightAngleTriangle((1l), (1l), (1l)) == (false));\n assert(rightAngleTriangle((2l), (2l), (10l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function that takes 3 numbers.\n // Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n // Returns false in any other cases.\n // Examples\n // any_int(5, 2, 7) \u279e True\n // any_int(3, 2, 2) \u279e False\n // any_int(3, -2, 1) \u279e True\n // any_int(3.6, -2.2, 2) \u279e False\n def anyInt(x : Float, y : Float, z : Float) : Boolean = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(anyInt(2l, 3l, 1l) == (true));\n assert(anyInt((2.5f), 2l, 3l) == (false));\n assert(anyInt((1.5f), 5l, (3.5f)) == (false));\n assert(anyInt(2l, 6l, 2l) == (false));\n assert(anyInt(4l, 2l, 2l) == (true));\n assert(anyInt((2.2f), (2.2f), (2.2f)) == (false));\n assert(anyInt(-4l, 6l, 2l) == (true));\n assert(anyInt(2l, 1l, 1l) == (true));\n assert(anyInt(3l, 4l, 7l) == (true));\n assert(anyInt((3.0f), 4l, 7l) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // This function takes a list l and returns a list l' such that\n // l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n // to the values of the corresponding indicies of l, but sorted.\n // >>> sort_third([1, 2, 3])\n // [1, 2, 3]\n // >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n // [2, 6, 3, 4, 8, 9, 5]\n def sortThird(l : List[Long]) : List[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sortThird((List[Long](5l.toLong, 6l.toLong, 3l.toLong, 4l.toLong, 8l.toLong, 9l.toLong, 2l.toLong))).equals((List[Long](2l.toLong, 6l.toLong, 3l.toLong, 4l.toLong, 8l.toLong, 9l.toLong, 5l.toLong))));\n assert(sortThird((List[Long](5l.toLong, 8l.toLong, 3l.toLong, 4l.toLong, 6l.toLong, 9l.toLong, 2l.toLong))).equals((List[Long](2l.toLong, 8l.toLong, 3l.toLong, 4l.toLong, 6l.toLong, 9l.toLong, 5l.toLong))));\n assert(sortThird((List[Long](5l.toLong, 6l.toLong, 9l.toLong, 4l.toLong, 8l.toLong, 3l.toLong, 2l.toLong))).equals((List[Long](2l.toLong, 6l.toLong, 9l.toLong, 4l.toLong, 8l.toLong, 3l.toLong, 5l.toLong))));\n assert(sortThird((List[Long](5l.toLong, 6l.toLong, 3l.toLong, 4l.toLong, 8l.toLong, 9l.toLong, 2l.toLong, 1l.toLong))).equals((List[Long](2l.toLong, 6l.toLong, 3l.toLong, 4l.toLong, 8l.toLong, 9l.toLong, 5l.toLong, 1l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_53_add", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Add two numbers x and y\n // >>> add(2, 3)\n // 5\n // >>> add(5, 7)\n // 12\n def add(x : Long, y : Long) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(add((0l), (1l)) == (1l));\n assert(add((1l), (0l)) == (1l));\n assert(add((2l), (3l)) == (5l));\n assert(add((5l), (7l)) == (12l));\n assert(add((7l), (5l)) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_69_search", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n // zero, and has a frequency greater than or equal to the value of the integer itself. \n // The frequency of an integer is the number of times it appears in the list.\n // If no such a value exist, return -1.\n // Examples:\n // search([4, 1, 2, 2, 3, 1]) == 2\n // search([1, 2, 2, 3, 3, 3, 4, 4, 4]) == 3\n // search([5, 5, 4, 4, 4]) == -1\n def search(lst : List[Long]) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(search((List[Long](5l.toLong, 5l.toLong, 5l.toLong, 5l.toLong, 1l.toLong))) == (1l));\n assert(search((List[Long](4l.toLong, 1l.toLong, 4l.toLong, 1l.toLong, 4l.toLong, 4l.toLong))) == (4l));\n assert(search((List[Long](3l.toLong, 3l.toLong))) == (-1l));\n assert(search((List[Long](8l.toLong, 8l.toLong, 8l.toLong, 8l.toLong, 8l.toLong, 8l.toLong, 8l.toLong, 8l.toLong))) == (8l));\n assert(search((List[Long](2l.toLong, 3l.toLong, 3l.toLong, 2l.toLong, 2l.toLong))) == (2l));\n assert(search((List[Long](2l.toLong, 7l.toLong, 8l.toLong, 8l.toLong, 4l.toLong, 8l.toLong, 7l.toLong, 3l.toLong, 9l.toLong, 6l.toLong, 5l.toLong, 10l.toLong, 4l.toLong, 3l.toLong, 6l.toLong, 7l.toLong, 1l.toLong, 7l.toLong, 4l.toLong, 10l.toLong, 8l.toLong, 1l.toLong))) == (1l));\n assert(search((List[Long](3l.toLong, 2l.toLong, 8l.toLong, 2l.toLong))) == (2l));\n assert(search((List[Long](6l.toLong, 7l.toLong, 1l.toLong, 8l.toLong, 8l.toLong, 10l.toLong, 5l.toLong, 8l.toLong, 5l.toLong, 3l.toLong, 10l.toLong))) == (1l));\n assert(search((List[Long](8l.toLong, 8l.toLong, 3l.toLong, 6l.toLong, 5l.toLong, 6l.toLong, 4l.toLong))) == (-1l));\n assert(search((List[Long](6l.toLong, 9l.toLong, 6l.toLong, 7l.toLong, 1l.toLong, 4l.toLong, 7l.toLong, 1l.toLong, 8l.toLong, 8l.toLong, 9l.toLong, 8l.toLong, 10l.toLong, 10l.toLong, 8l.toLong, 4l.toLong, 10l.toLong, 4l.toLong, 10l.toLong, 1l.toLong, 2l.toLong, 9l.toLong, 5l.toLong, 7l.toLong, 9l.toLong))) == (1l));\n assert(search((List[Long](1l.toLong, 9l.toLong, 10l.toLong, 1l.toLong, 3l.toLong))) == (1l));\n assert(search((List[Long](6l.toLong, 9l.toLong, 7l.toLong, 5l.toLong, 8l.toLong, 7l.toLong, 5l.toLong, 3l.toLong, 7l.toLong, 5l.toLong, 10l.toLong, 10l.toLong, 3l.toLong, 6l.toLong, 10l.toLong, 2l.toLong, 8l.toLong, 6l.toLong, 5l.toLong, 4l.toLong, 9l.toLong, 5l.toLong, 3l.toLong, 10l.toLong))) == (5l));\n assert(search((List[Long](1l.toLong))) == (1l));\n assert(search((List[Long](8l.toLong, 8l.toLong, 10l.toLong, 6l.toLong, 4l.toLong, 3l.toLong, 5l.toLong, 8l.toLong, 2l.toLong, 4l.toLong, 2l.toLong, 8l.toLong, 4l.toLong, 6l.toLong, 10l.toLong, 4l.toLong, 2l.toLong, 1l.toLong, 10l.toLong, 2l.toLong, 1l.toLong, 1l.toLong, 5l.toLong))) == (4l));\n assert(search((List[Long](2l.toLong, 10l.toLong, 4l.toLong, 8l.toLong, 2l.toLong, 10l.toLong, 5l.toLong, 1l.toLong, 2l.toLong, 9l.toLong, 5l.toLong, 5l.toLong, 6l.toLong, 3l.toLong, 8l.toLong, 6l.toLong, 4l.toLong, 10l.toLong))) == (2l));\n assert(search((List[Long](1l.toLong, 6l.toLong, 10l.toLong, 1l.toLong, 6l.toLong, 9l.toLong, 10l.toLong, 8l.toLong, 6l.toLong, 8l.toLong, 7l.toLong, 3l.toLong))) == (1l));\n assert(search((List[Long](9l.toLong, 2l.toLong, 4l.toLong, 1l.toLong, 5l.toLong, 1l.toLong, 5l.toLong, 2l.toLong, 5l.toLong, 7l.toLong, 7l.toLong, 7l.toLong, 3l.toLong, 10l.toLong, 1l.toLong, 5l.toLong, 4l.toLong, 2l.toLong, 8l.toLong, 4l.toLong, 1l.toLong, 9l.toLong, 10l.toLong, 7l.toLong, 10l.toLong, 2l.toLong, 8l.toLong, 10l.toLong, 9l.toLong, 4l.toLong))) == (4l));\n assert(search((List[Long](2l.toLong, 6l.toLong, 4l.toLong, 2l.toLong, 8l.toLong, 7l.toLong, 5l.toLong, 6l.toLong, 4l.toLong, 10l.toLong, 4l.toLong, 6l.toLong, 3l.toLong, 7l.toLong, 8l.toLong, 8l.toLong, 3l.toLong, 1l.toLong, 4l.toLong, 2l.toLong, 2l.toLong, 10l.toLong, 7l.toLong))) == (4l));\n assert(search((List[Long](9l.toLong, 8l.toLong, 6l.toLong, 10l.toLong, 2l.toLong, 6l.toLong, 10l.toLong, 2l.toLong, 7l.toLong, 8l.toLong, 10l.toLong, 3l.toLong, 8l.toLong, 2l.toLong, 6l.toLong, 2l.toLong, 3l.toLong, 1l.toLong))) == (2l));\n assert(search((List[Long](5l.toLong, 5l.toLong, 3l.toLong, 9l.toLong, 5l.toLong, 6l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 5l.toLong, 6l.toLong, 10l.toLong, 10l.toLong, 6l.toLong, 8l.toLong, 4l.toLong, 10l.toLong, 7l.toLong, 7l.toLong, 10l.toLong, 8l.toLong))) == (-1l));\n assert(search((List[Long](10l.toLong))) == (-1l));\n assert(search((List[Long](9l.toLong, 7l.toLong, 7l.toLong, 2l.toLong, 4l.toLong, 7l.toLong, 2l.toLong, 10l.toLong, 9l.toLong, 7l.toLong, 5l.toLong, 7l.toLong, 2l.toLong))) == (2l));\n assert(search((List[Long](5l.toLong, 4l.toLong, 10l.toLong, 2l.toLong, 1l.toLong, 1l.toLong, 10l.toLong, 3l.toLong, 6l.toLong, 1l.toLong, 8l.toLong))) == (1l));\n assert(search((List[Long](7l.toLong, 9l.toLong, 9l.toLong, 9l.toLong, 3l.toLong, 4l.toLong, 1l.toLong, 5l.toLong, 9l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 1l.toLong, 10l.toLong, 7l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 6l.toLong, 7l.toLong, 7l.toLong, 6l.toLong))) == (1l));\n assert(search((List[Long](3l.toLong, 10l.toLong, 10l.toLong, 9l.toLong, 2l.toLong))) == (-1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that takes a string and returns True if the string\n // length is a prime number or False otherwise\n // Examples\n // prime_length('Hello') == True\n // prime_length('abcdcba') == True\n // prime_length('kittens') == True\n // prime_length('orange') == False\n def primeLength(string : String) : Boolean = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(primeLength((\"Hello\")) == (true));\n assert(primeLength((\"abcdcba\")) == (true));\n assert(primeLength((\"kittens\")) == (true));\n assert(primeLength((\"orange\")) == (false));\n assert(primeLength((\"wow\")) == (true));\n assert(primeLength((\"world\")) == (true));\n assert(primeLength((\"MadaM\")) == (true));\n assert(primeLength((\"Wow\")) == (true));\n assert(primeLength((\"\")) == (false));\n assert(primeLength((\"HI\")) == (true));\n assert(primeLength((\"go\")) == (true));\n assert(primeLength((\"gogo\")) == (false));\n assert(primeLength((\"aaaaaaaaaaaaaaa\")) == (false));\n assert(primeLength((\"Madam\")) == (true));\n assert(primeLength((\"M\")) == (false));\n assert(primeLength((\"0\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_58_common", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return sorted unique common elements for two lists.\n // >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n // [1, 5, 653]\n // >>> common([5, 3, 2, 8], [3, 2])\n // [2, 3]\n def common(l1 : List[Long], l2 : List[Long]) : List[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(common((List[Long](1l.toLong, 4l.toLong, 3l.toLong, 34l.toLong, 653l.toLong, 2l.toLong, 5l.toLong)), (List[Long](5l.toLong, 7l.toLong, 1l.toLong, 5l.toLong, 9l.toLong, 653l.toLong, 121l.toLong))).equals((List[Long](1l.toLong, 5l.toLong, 653l.toLong))));\n assert(common((List[Long](5l.toLong, 3l.toLong, 2l.toLong, 8l.toLong)), (List[Long](3l.toLong, 2l.toLong))).equals((List[Long](2l.toLong, 3l.toLong))));\n assert(common((List[Long](4l.toLong, 3l.toLong, 2l.toLong, 8l.toLong)), (List[Long](3l.toLong, 2l.toLong, 4l.toLong))).equals((List[Long](2l.toLong, 3l.toLong, 4l.toLong))));\n assert(common((List[Long](4l.toLong, 3l.toLong, 2l.toLong, 8l.toLong)), (List[Long]())).equals((List[Long]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // The Brazilian factorial is defined as:\n // brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n // where n > 0\n // For example:\n // >>> special_factorial(4)\n // 288\n // The function will receive an integer as input and should return the special\n // factorial of this integer.\n def specialFactorial(n : Long) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(specialFactorial((4l)) == (288l));\n assert(specialFactorial((5l)) == (34560l));\n assert(specialFactorial((7l)) == (125411328000l));\n assert(specialFactorial((1l)) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // In this problem, you will implement a function that takes two lists of numbers,\n // and determines whether it is possible to perform an exchange of elements\n // between them to make lst1 a list of only even numbers.\n // There is no limit on the number of exchanged elements between lst1 and lst2.\n // If it is possible to exchange elements between the lst1 and lst2 to make\n // all the elements of lst1 to be even, return \"YES\".\n // Otherwise, return \"NO\".\n // For example:\n // exchange([1, 2, 3, 4], [1, 2, 3, 4]) => \"YES\"\n // exchange([1, 2, 3, 4], [1, 5, 3, 4]) => \"NO\"\n // It is assumed that the input lists will be non-empty.\n def exchange(lst1 : List[Long], lst2 : List[Long]) : String = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(exchange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong)), (List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((\"YES\")));\n assert(exchange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong)), (List[Long](1l.toLong, 5l.toLong, 3l.toLong, 4l.toLong))).equals((\"NO\")));\n assert(exchange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong)), (List[Long](2l.toLong, 1l.toLong, 4l.toLong, 3l.toLong))).equals((\"YES\")));\n assert(exchange((List[Long](5l.toLong, 7l.toLong, 3l.toLong)), (List[Long](2l.toLong, 6l.toLong, 4l.toLong))).equals((\"YES\")));\n assert(exchange((List[Long](5l.toLong, 7l.toLong, 3l.toLong)), (List[Long](2l.toLong, 6l.toLong, 3l.toLong))).equals((\"NO\")));\n assert(exchange((List[Long](3l.toLong, 2l.toLong, 6l.toLong, 1l.toLong, 8l.toLong, 9l.toLong)), (List[Long](3l.toLong, 5l.toLong, 5l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))).equals((\"NO\")));\n assert(exchange((List[Long](100l.toLong, 200l.toLong)), (List[Long](200l.toLong, 200l.toLong))).equals((\"YES\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a non-empty array of integers arr and an integer k, return\n // the sum of the elements with at most two digits from the first k elements of arr.\n // Example:\n // Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4\n // Output: 24 # sum of 21 + 3\n // Constraints:\n // 1. 1 <= len(arr) <= 100\n // 2. 1 <= k <= len(arr)\n def addElements(arr : List[Long], k : Long) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(addElements((List[Long](1l.toLong, -2l.toLong, -3l.toLong, 41l.toLong, 57l.toLong, 76l.toLong, 87l.toLong, 88l.toLong, 99l.toLong)), (3l)) == (-4l));\n assert(addElements((List[Long](111l.toLong, 121l.toLong, 3l.toLong, 4000l.toLong, 5l.toLong, 6l.toLong)), (2l)) == (0l));\n assert(addElements((List[Long](11l.toLong, 21l.toLong, 3l.toLong, 90l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong, 9l.toLong)), (4l)) == (125l));\n assert(addElements((List[Long](111l.toLong, 21l.toLong, 3l.toLong, 4000l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong, 9l.toLong)), (4l)) == (24l));\n assert(addElements((List[Long](1l.toLong)), (1l)) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // A simple program which should return the value of x if n is \n // a prime number and should return the value of y otherwise.\n // Examples:\n // for x_or_y(7, 34, 12) == 34\n // for x_or_y(15, 8, 5) == 5\n def xOrY(n : Long, x : Long, y : Long) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(xOrY((7l), (34l), (12l)) == (34l));\n assert(xOrY((15l), (8l), (5l)) == (5l));\n assert(xOrY((3l), (33l), (5212l)) == (33l));\n assert(xOrY((1259l), (3l), (52l)) == (3l));\n assert(xOrY((7919l), (-1l), (12l)) == (-1l));\n assert(xOrY((3609l), (1245l), (583l)) == (583l));\n assert(xOrY((91l), (56l), (129l)) == (129l));\n assert(xOrY((6l), (34l), (1234l)) == (1234l));\n assert(xOrY((1l), (2l), (0l)) == (0l));\n assert(xOrY((2l), (2l), (0l)) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given length of a side and high return area for a triangle.\n // >>> triangle_area(5, 3)\n // 7.5\n def triangleArea(a : Long, h : Long) : Float = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(triangleArea((5l), (3l)) == (7.5f));\n assert(triangleArea((2l), (2l)) == (2.0f));\n assert(triangleArea((10l), (8l)) == (40.0f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n // the last couple centuries. However, what people don't know is Tribonacci sequence.\n // Tribonacci sequence is defined by the recurrence:\n // tri(1) = 3\n // tri(n) = 1 + n / 2, if n is even.\n // tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n // For example:\n // tri(2) = 1 + (2 / 2) = 2\n // tri(4) = 3\n // tri(3) = tri(2) + tri(1) + tri(4)\n // = 2 + 3 + 3 = 8 \n // You are given a non-negative integer number n, you have to a return a list of the \n // first n + 1 numbers of the Tribonacci sequence.\n // Examples:\n // tri(3) = [1, 3, 2, 8]\n def tri(n : Long) : List[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(tri((3l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong))));\n assert(tri((4l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 3l.toLong))));\n assert(tri((5l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 3l.toLong, 15l.toLong))));\n assert(tri((6l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 3l.toLong, 15l.toLong, 4l.toLong))));\n assert(tri((7l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 3l.toLong, 15l.toLong, 4l.toLong, 24l.toLong))));\n assert(tri((8l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 3l.toLong, 15l.toLong, 4l.toLong, 24l.toLong, 5l.toLong))));\n assert(tri((9l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 3l.toLong, 15l.toLong, 4l.toLong, 24l.toLong, 5l.toLong, 35l.toLong))));\n assert(tri((20l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 3l.toLong, 15l.toLong, 4l.toLong, 24l.toLong, 5l.toLong, 35l.toLong, 6l.toLong, 48l.toLong, 7l.toLong, 63l.toLong, 8l.toLong, 80l.toLong, 9l.toLong, 99l.toLong, 10l.toLong, 120l.toLong, 11l.toLong))));\n assert(tri((0l)).equals((List[Long](1l.toLong))));\n assert(tri((1l)).equals((List[Long](1l.toLong, 3l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a list of two strings, both strings consist of open\n // parentheses '(' or close parentheses ')' only.\n // Your job is to check if it is possible to concatenate the two strings in\n // some order, that the resulting string will be good.\n // A string S is considered to be good if and only if all parentheses in S\n // are balanced. For example: the string '(())()' is good, while the string\n // '())' is not.\n // Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n // Examples:\n // match_parens(['()(', ')']) == 'Yes'\n // match_parens([')', ')']) == 'No'\n def matchParens(lst : List[String]) : String = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(matchParens((List[String](\"()(\", \")\"))).equals((\"Yes\")));\n assert(matchParens((List[String](\")\", \")\"))).equals((\"No\")));\n assert(matchParens((List[String](\"(()(())\", \"())())\"))).equals((\"No\")));\n assert(matchParens((List[String](\")())\", \"(()()(\"))).equals((\"Yes\")));\n assert(matchParens((List[String](\"(())))\", \"(()())((\"))).equals((\"Yes\")));\n assert(matchParens((List[String](\"()\", \"())\"))).equals((\"No\")));\n assert(matchParens((List[String](\"(()(\", \"()))()\"))).equals((\"Yes\")));\n assert(matchParens((List[String](\"((((\", \"((())\"))).equals((\"No\")));\n assert(matchParens((List[String](\")(()\", \"(()(\"))).equals((\"No\")));\n assert(matchParens((List[String](\")(\", \")(\"))).equals((\"No\")));\n assert(matchParens((List[String](\"(\", \")\"))).equals((\"Yes\")));\n assert(matchParens((List[String](\")\", \"(\"))).equals((\"Yes\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // From a list of integers, remove all elements that occur more than once.\n // Keep order of elements left the same as in the input.\n // >>> remove_duplicates([1, 2, 3, 2, 4])\n // [1, 3, 4]\n def removeDuplicates(numbers : List[Long]) : List[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(removeDuplicates((List[Long]())).equals((List[Long]())));\n assert(removeDuplicates((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))));\n assert(removeDuplicates((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 2l.toLong, 4l.toLong, 3l.toLong, 5l.toLong))).equals((List[Long](1l.toLong, 4l.toLong, 5l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return a greatest common divisor of two integers a and b\n // >>> greatest_common_divisor(3, 5)\n // 1\n // >>> greatest_common_divisor(25, 15)\n // 5\n def greatestCommonDivisor(a : Long, b : Long) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(greatestCommonDivisor((3l), (7l)) == (1l));\n assert(greatestCommonDivisor((10l), (15l)) == (5l));\n assert(greatestCommonDivisor((49l), (14l)) == (7l));\n assert(greatestCommonDivisor((144l), (60l)) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Checks if given string is a palindrome\n // >>> is_palindrome('')\n // True\n // >>> is_palindrome('aba')\n // True\n // >>> is_palindrome('aaaaa')\n // True\n // >>> is_palindrome('zbcd')\n // False\n def isPalindrome(text : String) : Boolean = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(isPalindrome((\"\")) == (true));\n assert(isPalindrome((\"aba\")) == (true));\n assert(isPalindrome((\"aaaaa\")) == (true));\n assert(isPalindrome((\"zbcd\")) == (false));\n assert(isPalindrome((\"xywyx\")) == (true));\n assert(isPalindrome((\"xywyz\")) == (false));\n assert(isPalindrome((\"xywzx\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // xs represent coefficients of a polynomial.\n // xs[0] + xs[1] * x + xs[2] * x^2 + ....\n // Return derivative of this polynomial in the same form.\n // >>> derivative([3, 1, 2, 4, 5])\n // [1, 4, 12, 20]\n // >>> derivative([1, 2, 3])\n // [2, 6]\n def derivative(xs : List[Long]) : List[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(derivative((List[Long](3l.toLong, 1l.toLong, 2l.toLong, 4l.toLong, 5l.toLong))).equals((List[Long](1l.toLong, 4l.toLong, 12l.toLong, 20l.toLong))));\n assert(derivative((List[Long](1l.toLong, 2l.toLong, 3l.toLong))).equals((List[Long](2l.toLong, 6l.toLong))));\n assert(derivative((List[Long](3l.toLong, 2l.toLong, 1l.toLong))).equals((List[Long](2l.toLong, 2l.toLong))));\n assert(derivative((List[Long](3l.toLong, 2l.toLong, 1l.toLong, 0l.toLong, 4l.toLong))).equals((List[Long](2l.toLong, 2l.toLong, 0l.toLong, 16l.toLong))));\n assert(derivative((List[Long](1l.toLong))).equals((List[Long]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // In this task, you will be given a string that represents a number of apples and oranges \n // that are distributed in a basket of fruit this basket contains \n // apples, oranges, and mango fruits. Given the string that represents the total number of \n // the oranges and apples and an integer that represent the total number of the fruits \n // in the basket return the number of the mango fruits in the basket.\n // for examble:\n // fruit_distribution(\"5 apples and 6 oranges\", 19) ->19 - 5 - 6 = 8\n // fruit_distribution(\"0 apples and 1 oranges\",3) -> 3 - 0 - 1 = 2\n // fruit_distribution(\"2 apples and 3 oranges\", 100) -> 100 - 2 - 3 = 95\n // fruit_distribution(\"100 apples and 1 oranges\",120) -> 120 - 100 - 1 = 19\n def fruitDistribution(s : String, n : Long) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(fruitDistribution((\"5 apples and 6 oranges\"), (19l)) == (8l));\n assert(fruitDistribution((\"5 apples and 6 oranges\"), (21l)) == (10l));\n assert(fruitDistribution((\"0 apples and 1 oranges\"), (3l)) == (2l));\n assert(fruitDistribution((\"1 apples and 0 oranges\"), (3l)) == (2l));\n assert(fruitDistribution((\"2 apples and 3 oranges\"), (100l)) == (95l));\n assert(fruitDistribution((\"2 apples and 3 oranges\"), (5l)) == (0l));\n assert(fruitDistribution((\"1 apples and 100 oranges\"), (120l)) == (19l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that takes an integer a and returns True \n // if this ingeger is a cube of some integer number.\n // Note: you may assume the input is always valid.\n // Examples:\n // iscube(1) ==> True\n // iscube(2) ==> False\n // iscube(-1) ==> True\n // iscube(64) ==> True\n // iscube(0) ==> True\n // iscube(180) ==> False\n def iscube(a : Long) : Boolean = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(iscube((1l)) == (true));\n assert(iscube((2l)) == (false));\n assert(iscube((-1l)) == (true));\n assert(iscube((64l)) == (true));\n assert(iscube((180l)) == (false));\n assert(iscube((1000l)) == (true));\n assert(iscube((0l)) == (true));\n assert(iscube((1729l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // In this Kata, you have to sort an array of non-negative integers according to\n // number of ones in their binary representation in ascending order.\n // For similar number of ones, sort based on decimal value.\n // It must be implemented like this:\n // >>> sort_array([1, 5, 2, 3, 4]) == [1, 2, 3, 4, 5]\n // >>> sort_array([-2, -3, -4, -5, -6]) == [-6, -5, -4, -3, -2]\n // >>> sort_array([1, 0, 2, 3, 4]) [0, 1, 2, 3, 4]\n def sortArray(arr : List[Long]) : List[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sortArray((List[Long](1l.toLong, 5l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((List[Long](1l.toLong, 2l.toLong, 4l.toLong, 3l.toLong, 5l.toLong))));\n assert(sortArray((List[Long](-2l.toLong, -3l.toLong, -4l.toLong, -5l.toLong, -6l.toLong))).equals((List[Long](-4l.toLong, -2l.toLong, -6l.toLong, -5l.toLong, -3l.toLong))));\n assert(sortArray((List[Long](1l.toLong, 0l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((List[Long](0l.toLong, 1l.toLong, 2l.toLong, 4l.toLong, 3l.toLong))));\n assert(sortArray((List[Long]())).equals((List[Long]())));\n assert(sortArray((List[Long](2l.toLong, 5l.toLong, 77l.toLong, 4l.toLong, 5l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((List[Long](2l.toLong, 2l.toLong, 4l.toLong, 4l.toLong, 3l.toLong, 3l.toLong, 5l.toLong, 5l.toLong, 5l.toLong, 7l.toLong, 77l.toLong))));\n assert(sortArray((List[Long](3l.toLong, 6l.toLong, 44l.toLong, 12l.toLong, 32l.toLong, 5l.toLong))).equals((List[Long](32l.toLong, 3l.toLong, 5l.toLong, 6l.toLong, 12l.toLong, 44l.toLong))));\n assert(sortArray((List[Long](2l.toLong, 4l.toLong, 8l.toLong, 16l.toLong, 32l.toLong))).equals((List[Long](2l.toLong, 4l.toLong, 8l.toLong, 16l.toLong, 32l.toLong))));\n assert(sortArray((List[Long](2l.toLong, 4l.toLong, 8l.toLong, 16l.toLong, 32l.toLong))).equals((List[Long](2l.toLong, 4l.toLong, 8l.toLong, 16l.toLong, 32l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a list of strings, where each string consists of only digits, return a list.\n // Each element i of the output should be \"the number of odd elements in the\n // string i of the input.\" where all the i's should be replaced by the number\n // of odd digits in the i'th string of the input.\n // >>> odd_count(['1234567'])\n // [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n // >>> odd_count(['3',\"11111111\"])\n // [\"the number of odd elements 1n the str1ng 1 of the 1nput.\",\n // \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\n def oddCount(lst : List[String]) : List[String] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(oddCount((List[String](\"1234567\"))).equals((List[String](\"the number of odd elements 4n the str4ng 4 of the 4nput.\"))));\n assert(oddCount((List[String](\"3\", \"11111111\"))).equals((List[String](\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\"))));\n assert(oddCount((List[String](\"271\", \"137\", \"314\"))).equals((List[String](\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // brackets is a string of \"(\" and \")\".\n // return True if every opening bracket has a corresponding closing bracket.\n // >>> correct_bracketing(\"(\")\n // False\n // >>> correct_bracketing(\"()\")\n // True\n // >>> correct_bracketing(\"(()())\")\n // True\n // >>> correct_bracketing(\")(()\")\n // False\n def correctBracketing(brackets : String) : Boolean = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(correctBracketing((\"()\")) == (true));\n assert(correctBracketing((\"(()())\")) == (true));\n assert(correctBracketing((\"()()(()())()\")) == (true));\n assert(correctBracketing((\"()()((()()())())(()()(()))\")) == (true));\n assert(correctBracketing((\"((()())))\")) == (false));\n assert(correctBracketing((\")(()\")) == (false));\n assert(correctBracketing((\"(\")) == (false));\n assert(correctBracketing((\"((((\")) == (false));\n assert(correctBracketing((\")\")) == (false));\n assert(correctBracketing((\"(()\")) == (false));\n assert(correctBracketing((\"()()(()())())(()\")) == (false));\n assert(correctBracketing((\"()()(()())()))()\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Task\n // Write a function that takes a string as input and returns the sum of the upper characters only'\n // ASCII codes.\n // Examples:\n // digitSum(\"\") => 0\n // digitSum(\"abAB\") => 131\n // digitSum(\"abcCd\") => 67\n // digitSum(\"helloE\") => 69\n // digitSum(\"woArBld\") => 131\n // digitSum(\"aAaaaXa\") => 153\n def digitSum(s : String) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(digitSum((\"\")) == (0l));\n assert(digitSum((\"abAB\")) == (131l));\n assert(digitSum((\"abcCd\")) == (67l));\n assert(digitSum((\"helloE\")) == (69l));\n assert(digitSum((\"woArBld\")) == (131l));\n assert(digitSum((\"aAaaaXa\")) == (153l));\n assert(digitSum((\" How are yOu?\")) == (151l));\n assert(digitSum((\"You arE Very Smart\")) == (327l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that accepts a list of strings as a parameter,\n // deletes the strings that have odd lengths from it,\n // and returns the resulted list with a sorted order,\n // The list is always a list of strings and never an array of numbers,\n // and it may contain duplicates.\n // The order of the list should be ascending by length of each word, and you\n // should return the list sorted by that rule.\n // If two words have the same length, sort the list alphabetically.\n // The function should return a list of strings in sorted order.\n // You may assume that all words will have the same length.\n // For example:\n // assert list_sort([\"aa\", \"a\", \"aaa\"]) => [\"aa\"]\n // assert list_sort([\"ab\", \"a\", \"aaa\", \"cd\"]) => [\"ab\", \"cd\"]\n def sortedListSum(lst : List[String]) : List[String] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sortedListSum((List[String](\"aa\", \"a\", \"aaa\"))).equals((List[String](\"aa\"))));\n assert(sortedListSum((List[String](\"school\", \"AI\", \"asdf\", \"b\"))).equals((List[String](\"AI\", \"asdf\", \"school\"))));\n assert(sortedListSum((List[String](\"d\", \"b\", \"c\", \"a\"))).equals((List[String]())));\n assert(sortedListSum((List[String](\"d\", \"dcba\", \"abcd\", \"a\"))).equals((List[String](\"abcd\", \"dcba\"))));\n assert(sortedListSum((List[String](\"AI\", \"ai\", \"au\"))).equals((List[String](\"AI\", \"ai\", \"au\"))));\n assert(sortedListSum((List[String](\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"))).equals((List[String]())));\n assert(sortedListSum((List[String](\"aaaa\", \"bbbb\", \"dd\", \"cc\"))).equals((List[String](\"cc\", \"dd\", \"aaaa\", \"bbbb\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given an array arr of integers and you need to return\n // sum of magnitudes of integers multiplied by product of all signs\n // of each number in the array, represented by 1, -1 or 0.\n // Note: return None for empty arr.\n // Example:\n // >>> prod_signs([1, 2, 2, -4]) == -9\n // >>> prod_signs([0, 1]) == 0\n // >>> prod_signs([]) == None\n def prodSigns(arr : List[Long]) : Option[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(prodSigns((List[Long](1l.toLong, 2l.toLong, 2l.toLong, -4l.toLong))).equals(-9l));\n assert(prodSigns((List[Long](0l.toLong, 1l.toLong))).equals(0l));\n assert(prodSigns((List[Long](1l.toLong, 1l.toLong, 1l.toLong, 2l.toLong, 3l.toLong, -1l.toLong, 1l.toLong))).equals(-10l));\n assert(prodSigns((List[Long]())).equals(None));\n assert(prodSigns((List[Long](2l.toLong, 4l.toLong, 1l.toLong, 2l.toLong, -1l.toLong, -1l.toLong, 9l.toLong))).equals(20l));\n assert(prodSigns((List[Long](-1l.toLong, 1l.toLong, -1l.toLong, 1l.toLong))).equals(4l));\n assert(prodSigns((List[Long](-1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))).equals(-4l));\n assert(prodSigns((List[Long](-1l.toLong, 1l.toLong, 1l.toLong, 0l.toLong))).equals(0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return list with elements incremented by 1.\n // >>> incr_list([1, 2, 3])\n // [2, 3, 4]\n // >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123])\n // [6, 4, 6, 3, 4, 4, 10, 1, 124]\n def incrList(l : List[Long]) : List[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(incrList((List[Long]())).equals((List[Long]())));\n assert(incrList((List[Long](3l.toLong, 2l.toLong, 1l.toLong))).equals((List[Long](4l.toLong, 3l.toLong, 2l.toLong))));\n assert(incrList((List[Long](5l.toLong, 2l.toLong, 5l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 9l.toLong, 0l.toLong, 123l.toLong))).equals((List[Long](6l.toLong, 3l.toLong, 6l.toLong, 3l.toLong, 4l.toLong, 4l.toLong, 10l.toLong, 1l.toLong, 124l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // From a given list of integers, generate a list of rolling maximum element found until given moment\n // in the sequence.\n // >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n // [1, 2, 3, 3, 3, 4, 4]\n def rollingMax(numbers : List[Long]) : List[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(rollingMax((List[Long]())).equals((List[Long]())));\n assert(rollingMax((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))));\n assert(rollingMax((List[Long](4l.toLong, 3l.toLong, 2l.toLong, 1l.toLong))).equals((List[Long](4l.toLong, 4l.toLong, 4l.toLong, 4l.toLong))));\n assert(rollingMax((List[Long](3l.toLong, 2l.toLong, 3l.toLong, 100l.toLong, 3l.toLong))).equals((List[Long](3l.toLong, 3l.toLong, 3l.toLong, 100l.toLong, 100l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n // separate those group into separate strings and return the list of those.\n // Separate groups are balanced (each open brace is properly closed) and not nested within each other\n // Ignore any spaces in the input string.\n // >>> separate_paren_groups('( ) (( )) (( )( ))')\n // ['()', '(())', '(()())']\n def separateParenGroups(paren_string : String) : List[String] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(separateParenGroups((\"(()()) ((())) () ((())()())\")).equals((List[String](\"(()())\", \"((()))\", \"()\", \"((())()())\"))));\n assert(separateParenGroups((\"() (()) ((())) (((())))\")).equals((List[String](\"()\", \"(())\", \"((()))\", \"(((())))\"))));\n assert(separateParenGroups((\"(()(())((())))\")).equals((List[String](\"(()(())((())))\"))));\n assert(separateParenGroups((\"( ) (( )) (( )( ))\")).equals((List[String](\"()\", \"(())\", \"(()())\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You will be given a string of words separated by commas or spaces. Your task is\n // to split the string into words and return an array of the words.\n // For example:\n // words_string(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n // words_string(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\n def wordsString(s : String) : List[String] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(wordsString((\"Hi, my name is John\")).equals((List[String](\"Hi\", \"my\", \"name\", \"is\", \"John\"))));\n assert(wordsString((\"One, two, three, four, five, six\")).equals((List[String](\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"))));\n assert(wordsString((\"Hi, my name\")).equals((List[String](\"Hi\", \"my\", \"name\"))));\n assert(wordsString((\"One,, two, three, four, five, six,\")).equals((List[String](\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"))));\n assert(wordsString((\"\")).equals((List[String]())));\n assert(wordsString((\"ahmed , gamal\")).equals((List[String](\"ahmed\", \"gamal\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Filter given list of any python values only for integers\n // >>> filter_integers(['a', 3.14, 5])\n // [5]\n // >>> filter_integers([1, 2, 3, 'abc', {}, []])\n // [1, 2, 3]\n def filterIntegers(values : List[Any]) : List[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(filterIntegers((List[Any]())).equals((List[Long]())));\n assert(filterIntegers((List[Any](4l, Map[Long,Long](), List[Long](), 23.2f, 9l, \"adasd\"))).equals((List[Long](4l.toLong, 9l.toLong))));\n assert(filterIntegers((List[Any](3l, \"c\", 3l, 3l, \"a\", \"b\"))).equals((List[Long](3l.toLong, 3l.toLong, 3l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // This function takes a list l and returns a list l' such that\n // l' is identical to l in the odd indicies, while its values at the even indicies are equal\n // to the values of the even indicies of l, but sorted.\n // >>> sort_even([1, 2, 3])\n // [1, 2, 3]\n // >>> sort_even([5, 6, 3, 4])\n // [3, 6, 5, 4]\n def sortEven(l : List[Long]) : List[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sortEven((List[Long](1l.toLong, 2l.toLong, 3l.toLong))).equals((List[Long](1l.toLong, 2l.toLong, 3l.toLong))));\n assert(sortEven((List[Long](5l.toLong, 3l.toLong, -5l.toLong, 2l.toLong, -3l.toLong, 3l.toLong, 9l.toLong, 0l.toLong, 123l.toLong, 1l.toLong, -10l.toLong))).equals((List[Long](-10l.toLong, 3l.toLong, -5l.toLong, 2l.toLong, -3l.toLong, 3l.toLong, 5l.toLong, 0l.toLong, 9l.toLong, 1l.toLong, 123l.toLong))));\n assert(sortEven((List[Long](5l.toLong, 8l.toLong, -12l.toLong, 4l.toLong, 23l.toLong, 2l.toLong, 3l.toLong, 11l.toLong, 12l.toLong, -10l.toLong))).equals((List[Long](-12l.toLong, 8l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 2l.toLong, 12l.toLong, 11l.toLong, 23l.toLong, -10l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // I think we all remember that feeling when the result of some long-awaited\n // event is finally known. The feelings and thoughts you have at that moment are\n // definitely worth noting down and comparing.\n // Your task is to determine if a person correctly guessed the results of a number of matches.\n // You are given two arrays of scores and guesses of equal length, where each index shows a match. \n // Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n // the value is 0, and if not, the value is the absolute difference between the guess and the score.\n // example:\n // compare([1,2,3,4,5,1],[1,2,3,4,2,-2]) -> [0,0,0,0,3,3]\n // compare([0,5,0,0,0,4],[4,1,1,0,0,-2]) -> [4,4,1,0,0,6]\n def compare(game : List[Long], guess : List[Long]) : List[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(compare((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 1l.toLong)), (List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 2l.toLong, -2l.toLong))).equals((List[Long](0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 3l.toLong, 3l.toLong))));\n assert(compare((List[Long](0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong)), (List[Long](0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong))).equals((List[Long](0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong))));\n assert(compare((List[Long](1l.toLong, 2l.toLong, 3l.toLong)), (List[Long](-1l.toLong, -2l.toLong, -3l.toLong))).equals((List[Long](2l.toLong, 4l.toLong, 6l.toLong))));\n assert(compare((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 5l.toLong)), (List[Long](-1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((List[Long](2l.toLong, 0l.toLong, 0l.toLong, 1l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a positive integer n, return a tuple that has the number of even and odd\n // integer palindromes that fall within the range(1, n), inclusive.\n // Example 1:\n // Input: 3\n // Output: (1, 2)\n // Explanation:\n // Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n // Example 2:\n // Input: 12\n // Output: (4, 6)\n // Explanation:\n // Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n // Note:\n // 1. 1 <= n <= 10^3\n // 2. returned tuple has the number of even and odd integer palindromes respectively.\n def evenOddPalindrome(n : Long) : Tuple2[Long, Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(evenOddPalindrome((123l)).equals(((8l, 13l))));\n assert(evenOddPalindrome((12l)).equals(((4l, 6l))));\n assert(evenOddPalindrome((3l)).equals(((1l, 2l))));\n assert(evenOddPalindrome((63l)).equals(((6l, 8l))));\n assert(evenOddPalindrome((25l)).equals(((5l, 6l))));\n assert(evenOddPalindrome((19l)).equals(((4l, 6l))));\n assert(evenOddPalindrome((9l)).equals(((4l, 5l))));\n assert(evenOddPalindrome((1l)).equals(((0l, 1l))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n // fib4(0) -> 0\n // fib4(1) -> 0\n // fib4(2) -> 2\n // fib4(3) -> 0\n // fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n // Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n // >>> fib4(5)\n // 4\n // >>> fib4(6)\n // 8\n // >>> fib4(7)\n // 14\n def fib4(n : Long) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(fib4((5l)) == (4l));\n assert(fib4((8l)) == (28l));\n assert(fib4((10l)) == (104l));\n assert(fib4((12l)) == (386l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given two positive integers a and b, return the even digits between a\n // and b, in ascending order.\n // For example:\n // generate_integers(2, 8) => [2, 4, 6, 8]\n // generate_integers(8, 2) => [2, 4, 6, 8]\n // generate_integers(10, 14) => []\n def generateIntegers(a : Long, b : Long) : List[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(generateIntegers((2l), (10l)).equals((List[Long](2l.toLong, 4l.toLong, 6l.toLong, 8l.toLong))));\n assert(generateIntegers((10l), (2l)).equals((List[Long](2l.toLong, 4l.toLong, 6l.toLong, 8l.toLong))));\n assert(generateIntegers((132l), (2l)).equals((List[Long](2l.toLong, 4l.toLong, 6l.toLong, 8l.toLong))));\n assert(generateIntegers((17l), (89l)).equals((List[Long]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // For a given list of input numbers, calculate Mean Absolute Deviation\n // around the mean of this dataset.\n // Mean Absolute Deviation is the average absolute difference between each\n // element and a centerpoint (mean in this case):\n // MAD = average | x - x_mean |\n // >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n // 1.0\n def meanAbsoluteDeviation(numbers : List[Float]) : Float = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(meanAbsoluteDeviation((List[Float](1.0f.toFloat, 2.0f.toFloat))) == (0.5f));\n assert(meanAbsoluteDeviation((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat))) == (1.0f));\n assert(meanAbsoluteDeviation((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat, 5.0f.toFloat))) == (1.2f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function encrypt that takes a string as an argument and\n // returns a string encrypted with the alphabet being rotated. \n // The alphabet should be rotated in a manner such that the letters \n // shift down by two multiplied to two places.\n // For example:\n // encrypt('hi') returns 'lm'\n // encrypt('asdfghjkl') returns 'ewhjklnop'\n // encrypt('gf') returns 'kj'\n // encrypt('et') returns 'ix'\n def encrypt(s : String) : String = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(encrypt((\"hi\")).equals((\"lm\")));\n assert(encrypt((\"asdfghjkl\")).equals((\"ewhjklnop\")));\n assert(encrypt((\"gf\")).equals((\"kj\")));\n assert(encrypt((\"et\")).equals((\"ix\")));\n assert(encrypt((\"faewfawefaewg\")).equals((\"jeiajeaijeiak\")));\n assert(encrypt((\"hellomyfriend\")).equals((\"lippsqcjvmirh\")));\n assert(encrypt((\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\")).equals((\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\")));\n assert(encrypt((\"a\")).equals((\"e\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n // The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n // as follows: start with any positive integer n. Then each term is obtained from the \n // previous term as follows: if the previous term is even, the next term is one half of \n // the previous term. If the previous term is odd, the next term is 3 times the previous\n // term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n // Note: \n // 1. Collatz(1) is [1].\n // 2. returned list sorted in increasing order.\n // For example:\n // get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n def getOddCollatz(n : Long) : List[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(getOddCollatz((14l)).equals((List[Long](1l.toLong, 5l.toLong, 7l.toLong, 11l.toLong, 13l.toLong, 17l.toLong))));\n assert(getOddCollatz((5l)).equals((List[Long](1l.toLong, 5l.toLong))));\n assert(getOddCollatz((12l)).equals((List[Long](1l.toLong, 3l.toLong, 5l.toLong))));\n assert(getOddCollatz((1l)).equals((List[Long](1l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Find how many times a given substring can be found in the original string. Count overlaping cases.\n // >>> how_many_times('', 'a')\n // 0\n // >>> how_many_times('aaa', 'a')\n // 3\n // >>> how_many_times('aaaa', 'aa')\n // 3\n def howManyTimes(string : String, substring : String) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(howManyTimes((\"\"), (\"x\")) == (0l));\n assert(howManyTimes((\"xyxyxyx\"), (\"x\")) == (4l));\n assert(howManyTimes((\"cacacacac\"), (\"cac\")) == (4l));\n assert(howManyTimes((\"john doe\"), (\"john\")) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n // numbers in the array will be randomly ordered. Your task is to determine if\n // it is possible to get an array sorted in non-decreasing order by performing \n // the following operation on the given array:\n // You are allowed to perform right shift operation any number of times.\n // One right shift operation means shifting all elements of the array by one\n // position in the right direction. The last element of the array will be moved to\n // the starting position in the array i.e. 0th index. \n // If it is possible to obtain the sorted array by performing the above operation\n // then return True else return False.\n // If the given array is empty then return True.\n // Note: The given list is guaranteed to have unique elements.\n // For Example:\n // move_one_ball([3, 4, 5, 1, 2])==>True\n // Explanation: By performin 2 right shift operations, non-decreasing order can\n // be achieved for the given array.\n // move_one_ball([3, 5, 4, 1, 2])==>False\n // Explanation:It is not possible to get non-decreasing order for the given\n // array by performing any number of right shift operations.\n def moveOneBall(arr : List[Long]) : Boolean = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(moveOneBall((List[Long](3l.toLong, 4l.toLong, 5l.toLong, 1l.toLong, 2l.toLong))) == (true));\n assert(moveOneBall((List[Long](3l.toLong, 5l.toLong, 10l.toLong, 1l.toLong, 2l.toLong))) == (true));\n assert(moveOneBall((List[Long](4l.toLong, 3l.toLong, 1l.toLong, 2l.toLong))) == (false));\n assert(moveOneBall((List[Long](3l.toLong, 5l.toLong, 4l.toLong, 1l.toLong, 2l.toLong))) == (false));\n assert(moveOneBall((List[Long]())) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function which sorts the given list of integers\n // in ascending order according to the sum of their digits.\n // Note: if there are several items with similar sum of their digits,\n // order them based on their index in original list.\n // For example:\n // >>> order_by_points([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]\n // >>> order_by_points([]) == []\n def orderByPoints(nums : List[Long]) : List[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(orderByPoints((List[Long](1l.toLong, 11l.toLong, -1l.toLong, -11l.toLong, -12l.toLong))).equals((List[Long](-1l.toLong, -11l.toLong, 1l.toLong, -12l.toLong, 11l.toLong))));\n assert(orderByPoints((List[Long](1234l.toLong, 423l.toLong, 463l.toLong, 145l.toLong, 2l.toLong, 423l.toLong, 423l.toLong, 53l.toLong, 6l.toLong, 37l.toLong, 3457l.toLong, 3l.toLong, 56l.toLong, 0l.toLong, 46l.toLong))).equals((List[Long](0l.toLong, 2l.toLong, 3l.toLong, 6l.toLong, 53l.toLong, 423l.toLong, 423l.toLong, 423l.toLong, 1234l.toLong, 145l.toLong, 37l.toLong, 46l.toLong, 56l.toLong, 463l.toLong, 3457l.toLong))));\n assert(orderByPoints((List[Long]())).equals((List[Long]())));\n assert(orderByPoints((List[Long](1l.toLong, -11l.toLong, -32l.toLong, 43l.toLong, 54l.toLong, -98l.toLong, 2l.toLong, -3l.toLong))).equals((List[Long](-3l.toLong, -32l.toLong, -98l.toLong, -11l.toLong, 1l.toLong, 2l.toLong, 43l.toLong, 54l.toLong))));\n assert(orderByPoints((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong, 9l.toLong, 10l.toLong, 11l.toLong))).equals((List[Long](1l.toLong, 10l.toLong, 2l.toLong, 11l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong, 9l.toLong))));\n assert(orderByPoints((List[Long](0l.toLong, 6l.toLong, 6l.toLong, -76l.toLong, -21l.toLong, 23l.toLong, 4l.toLong))).equals((List[Long](-76l.toLong, -21l.toLong, 0l.toLong, 4l.toLong, 23l.toLong, 6l.toLong, 6l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return list of prime factors of given integer in the order from smallest to largest.\n // Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n // Input number should be equal to the product of all factors\n // >>> factorize(8)\n // [2, 2, 2]\n // >>> factorize(25)\n // [5, 5]\n // >>> factorize(70)\n // [2, 5, 7]\n def factorize(n : Long) : List[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(factorize((2l)).equals((List[Long](2l.toLong))));\n assert(factorize((4l)).equals((List[Long](2l.toLong, 2l.toLong))));\n assert(factorize((8l)).equals((List[Long](2l.toLong, 2l.toLong, 2l.toLong))));\n assert(factorize((57l)).equals((List[Long](3l.toLong, 19l.toLong))));\n assert(factorize((3249l)).equals((List[Long](3l.toLong, 3l.toLong, 19l.toLong, 19l.toLong))));\n assert(factorize((185193l)).equals((List[Long](3l.toLong, 3l.toLong, 3l.toLong, 19l.toLong, 19l.toLong, 19l.toLong))));\n assert(factorize((20577l)).equals((List[Long](3l.toLong, 19l.toLong, 19l.toLong, 19l.toLong))));\n assert(factorize((18l)).equals((List[Long](2l.toLong, 3l.toLong, 3l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return True if all numbers in the list l are below threshold t.\n // >>> below_threshold([1, 2, 4, 10], 100)\n // True\n // >>> below_threshold([1, 20, 4, 10], 5)\n // False\n def belowThreshold(l : List[Long], t : Long) : Boolean = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(belowThreshold((List[Long](1l.toLong, 2l.toLong, 4l.toLong, 10l.toLong)), (100l)) == (true));\n assert(belowThreshold((List[Long](1l.toLong, 20l.toLong, 4l.toLong, 10l.toLong)), (5l)) == (false));\n assert(belowThreshold((List[Long](1l.toLong, 20l.toLong, 4l.toLong, 10l.toLong)), (21l)) == (true));\n assert(belowThreshold((List[Long](1l.toLong, 20l.toLong, 4l.toLong, 10l.toLong)), (22l)) == (true));\n assert(belowThreshold((List[Long](1l.toLong, 8l.toLong, 4l.toLong, 10l.toLong)), (11l)) == (true));\n assert(belowThreshold((List[Long](1l.toLong, 8l.toLong, 4l.toLong, 10l.toLong)), (10l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given two positive integers n and m, and your task is to compute the\n // average of the integers from n through m (including n and m). \n // Round the answer to the nearest integer and convert that to binary.\n // If n is greater than m, return -1.\n // Example:\n // rounded_avg(1, 5) => \"0b11\"\n // rounded_avg(7, 5) => -1\n // rounded_avg(10, 20) => \"0b1111\"\n // rounded_avg(20, 33) => \"0b11010\"\n def roundedAvg(n : Long, m : Long) : Either[String, Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(roundedAvg((1l), (5l)).equals(\"0b11\"));\n assert(roundedAvg((7l), (13l)).equals(\"0b1010\"));\n assert(roundedAvg((964l), (977l)).equals(\"0b1111001010\"));\n assert(roundedAvg((996l), (997l)).equals(\"0b1111100100\"));\n assert(roundedAvg((560l), (851l)).equals(\"0b1011000010\"));\n assert(roundedAvg((185l), (546l)).equals(\"0b101101110\"));\n assert(roundedAvg((362l), (496l)).equals(\"0b110101101\"));\n assert(roundedAvg((350l), (902l)).equals(\"0b1001110010\"));\n assert(roundedAvg((197l), (233l)).equals(\"0b11010111\"));\n assert(roundedAvg((7l), (5l)).equals(-1l));\n assert(roundedAvg((5l), (1l)).equals(-1l));\n assert(roundedAvg((5l), (5l)).equals(\"0b101\"));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n // For each of the group, output the deepest level of nesting of parentheses.\n // E.g. (()()) has maximum two levels of nesting while ((())) has three.\n // >>> parse_nested_parens('(()()) ((())) () ((())()())')\n // [2, 3, 1, 3]\n def parseNestedParens(paren_string : String) : List[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(parseNestedParens((\"(()()) ((())) () ((())()())\")).equals((List[Long](2l.toLong, 3l.toLong, 1l.toLong, 3l.toLong))));\n assert(parseNestedParens((\"() (()) ((())) (((())))\")).equals((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))));\n assert(parseNestedParens((\"(()(())((())))\")).equals((List[Long](4l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n // Examples\n // solution([5, 8, 7, 1]) ==> 12\n // solution([3, 3, 3, 3, 3]) ==> 9\n // solution([30, 13, 24, 321]) ==>0\n def solution(lst : List[Long]) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(solution((List[Long](5l.toLong, 8l.toLong, 7l.toLong, 1l.toLong))) == (12l));\n assert(solution((List[Long](3l.toLong, 3l.toLong, 3l.toLong, 3l.toLong, 3l.toLong))) == (9l));\n assert(solution((List[Long](30l.toLong, 13l.toLong, 24l.toLong, 321l.toLong))) == (0l));\n assert(solution((List[Long](5l.toLong, 9l.toLong))) == (5l));\n assert(solution((List[Long](2l.toLong, 4l.toLong, 8l.toLong))) == (0l));\n assert(solution((List[Long](30l.toLong, 13l.toLong, 23l.toLong, 32l.toLong))) == (23l));\n assert(solution((List[Long](3l.toLong, 13l.toLong, 2l.toLong, 9l.toLong))) == (3l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a positive integer n. You have to create an integer array a of length n.\n // For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n // Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n // and a[i] + a[j] + a[k] is a multiple of 3.\n // Example :\n // Input: n = 5\n // Output: 1\n // Explanation: \n // a = [1, 3, 7, 13, 21]\n // The only valid triple is (1, 7, 13).\n def getMaxTriples(n : Long) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(getMaxTriples((5l)) == (1l));\n assert(getMaxTriples((6l)) == (4l));\n assert(getMaxTriples((10l)) == (36l));\n assert(getMaxTriples((100l)) == (53361l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // There are eight planets in our solar system: the closerst to the Sun \n // is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n // Uranus, Neptune.\n // Write a function that takes two planet names as strings planet1 and planet2. \n // The function should return a tuple containing all planets whose orbits are \n // located between the orbit of planet1 and the orbit of planet2, sorted by \n // the proximity to the sun. \n // The function should return an empty tuple if planet1 or planet2\n // are not correct planet names. \n // Examples\n // bf(\"Jupiter\", \"Neptune\") ==> (\"Saturn\", \"Uranus\")\n // bf(\"Earth\", \"Mercury\") ==> (\"Venus\")\n // bf(\"Mercury\", \"Uranus\") ==> (\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\")\n def bf(planet1 : String, planet2 : String) : List[String] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(bf((\"Jupiter\"), (\"Neptune\")).equals((List[String](\"Saturn\", \"Uranus\"))));\n assert(bf((\"Earth\"), (\"Mercury\")).equals((List[String](\"Venus\"))));\n assert(bf((\"Mercury\"), (\"Uranus\")).equals((List[String](\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"))));\n assert(bf((\"Neptune\"), (\"Venus\")).equals((List[String](\"Earth\", \"Mars\", \"Jupiter\", \"Saturn\", \"Uranus\"))));\n assert(bf((\"Earth\"), (\"Earth\")).equals((List[String]())));\n assert(bf((\"Mars\"), (\"Earth\")).equals((List[String]())));\n assert(bf((\"Jupiter\"), (\"Makemake\")).equals((List[String]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a list of integers.\n // Write a function next_smallest() that returns the 2nd smallest element of the list.\n // Return None if there is no such element.\n // next_smallest([1, 2, 3, 4, 5]) == 2\n // next_smallest([5, 1, 4, 3, 2]) == 2\n // next_smallest([]) == None\n // next_smallest([1, 1]) == None\n def nextSmallest(lst : List[Long]) : Option[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(nextSmallest((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong))).equals(2l));\n assert(nextSmallest((List[Long](5l.toLong, 1l.toLong, 4l.toLong, 3l.toLong, 2l.toLong))).equals(2l));\n assert(nextSmallest((List[Long]())).equals(None));\n assert(nextSmallest((List[Long](1l.toLong, 1l.toLong))).equals(None));\n assert(nextSmallest((List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong, 0l.toLong))).equals(1l));\n assert(nextSmallest((List[Long](1l.toLong, 1l.toLong))).equals(None));\n assert(nextSmallest((List[Long](-35l.toLong, 34l.toLong, 12l.toLong, -45l.toLong))).equals(-35l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Input is a space-delimited string of numberals from 'zero' to 'nine'.\n // Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n // Return the string with numbers sorted from smallest to largest\n // >>> sort_numbers('three one five')\n // 'one three five'\n def sortNumbers(numbers : String) : String = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sortNumbers((\"\")).equals((\"\")));\n assert(sortNumbers((\"three\")).equals((\"three\")));\n assert(sortNumbers((\"three five nine\")).equals((\"three five nine\")));\n assert(sortNumbers((\"five zero four seven nine eight\")).equals((\"zero four five seven eight nine\")));\n assert(sortNumbers((\"six five four three two one zero\")).equals((\"zero one two three four five six\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n // cycpattern_check(\"abcd\",\"abd\") => False\n // cycpattern_check(\"hello\",\"ell\") => True\n // cycpattern_check(\"whassup\",\"psus\") => False\n // cycpattern_check(\"abab\",\"baa\") => True\n // cycpattern_check(\"efef\",\"eeff\") => False\n // cycpattern_check(\"himenss\",\"simen\") => True\n def cycpatternCheck(a : String, b : String) : Boolean = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(cycpatternCheck((\"xyzw\"), (\"xyw\")) == (false));\n assert(cycpatternCheck((\"yello\"), (\"ell\")) == (true));\n assert(cycpatternCheck((\"whattup\"), (\"ptut\")) == (false));\n assert(cycpatternCheck((\"efef\"), (\"fee\")) == (true));\n assert(cycpatternCheck((\"abab\"), (\"aabb\")) == (false));\n assert(cycpatternCheck((\"winemtt\"), (\"tinem\")) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You will be given a number in decimal form and your task is to convert it to\n // binary format. The function should return a string, with each character representing a binary\n // number. Each character in the string will be '0' or '1'.\n // There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n // The extra characters are there to help with the format.\n // Examples:\n // decimal_to_binary(15) # returns \"db1111db\"\n // decimal_to_binary(32) # returns \"db100000db\"\n def decimalToBinary(decimal : Long) : String = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(decimalToBinary((0l)).equals((\"db0db\")));\n assert(decimalToBinary((32l)).equals((\"db100000db\")));\n assert(decimalToBinary((103l)).equals((\"db1100111db\")));\n assert(decimalToBinary((15l)).equals((\"db1111db\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Filter an input list of strings only for ones that contain given substring\n // >>> filter_by_substring([], 'a')\n // []\n // >>> filter_by_substring(['abc', 'bacd', 'cde', 'array'], 'a')\n // ['abc', 'bacd', 'array']\n def filterBySubstring(strings : List[String], substring : String) : List[String] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(filterBySubstring((List[String]()), (\"john\")).equals((List[String]())));\n assert(filterBySubstring((List[String](\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\")), (\"xxx\")).equals((List[String](\"xxx\", \"xxxAAA\", \"xxx\"))));\n assert(filterBySubstring((List[String](\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\")), (\"xx\")).equals((List[String](\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"))));\n assert(filterBySubstring((List[String](\"grunt\", \"trumpet\", \"prune\", \"gruesome\")), (\"run\")).equals((List[String](\"grunt\", \"prune\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given an integer. return a tuple that has the number of even and odd digits respectively.\n // Example:\n // even_odd_count(-12) ==> (1, 1)\n // even_odd_count(123) ==> (1, 2)\n def evenOddCount(num : Long) : Tuple2[Long, Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(evenOddCount((7l)).equals(((0l, 1l))));\n assert(evenOddCount((-78l)).equals(((1l, 1l))));\n assert(evenOddCount((3452l)).equals(((2l, 2l))));\n assert(evenOddCount((346211l)).equals(((3l, 3l))));\n assert(evenOddCount((-345821l)).equals(((3l, 3l))));\n assert(evenOddCount((-2l)).equals(((1l, 0l))));\n assert(evenOddCount((-45347l)).equals(((2l, 3l))));\n assert(evenOddCount((0l)).equals(((1l, 0l))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that accepts a list of strings.\n // The list contains different words. Return the word with maximum number\n // of unique characters. If multiple strings have maximum number of unique\n // characters, return the one which comes first in lexicographical order.\n // find_max([\"name\", \"of\", \"string\"]) == \"string\"\n // find_max([\"name\", \"enam\", \"game\"]) == \"enam\"\n // find_max([\"aaaaaaa\", \"bb\" ,\"cc\"]) == \"\"aaaaaaa\"\n def findMax(words : List[String]) : String = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(findMax((List[String](\"name\", \"of\", \"string\"))).equals((\"string\")));\n assert(findMax((List[String](\"name\", \"enam\", \"game\"))).equals((\"enam\")));\n assert(findMax((List[String](\"aaaaaaa\", \"bb\", \"cc\"))).equals((\"aaaaaaa\")));\n assert(findMax((List[String](\"abc\", \"cba\"))).equals((\"abc\")));\n assert(findMax((List[String](\"play\", \"this\", \"game\", \"of\", \"footbott\"))).equals((\"footbott\")));\n assert(findMax((List[String](\"we\", \"are\", \"gonna\", \"rock\"))).equals((\"gonna\")));\n assert(findMax((List[String](\"we\", \"are\", \"a\", \"mad\", \"nation\"))).equals((\"nation\")));\n assert(findMax((List[String](\"this\", \"is\", \"a\", \"prrk\"))).equals((\"this\")));\n assert(findMax((List[String](\"b\"))).equals((\"b\")));\n assert(findMax((List[String](\"play\", \"play\", \"play\"))).equals((\"play\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a positive integer n, return the count of the numbers of n-digit\n // positive integers that start or end with 1.\n def startsOneEnds(n : Long) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(startsOneEnds((1l)) == (1l));\n assert(startsOneEnds((2l)) == (18l));\n assert(startsOneEnds((3l)) == (180l));\n assert(startsOneEnds((4l)) == (1800l));\n assert(startsOneEnds((5l)) == (18000l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function that returns a tuple (a, b), where 'a' is\n // the largest of negative integers, and 'b' is the smallest\n // of positive integers in a list.\n // If there is no negative or positive integers, return them as None.\n // Examples:\n // largest_smallest_integers([2, 4, 1, 3, 5, 7]) == (None, 1)\n // largest_smallest_integers([]) == (None, None)\n // largest_smallest_integers([0]) == (None, None)\n def largestSmallestIntegers(lst : List[Long]) : Tuple2[Option[Long], Option[Long]] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(largestSmallestIntegers((List[Long](2l.toLong, 4l.toLong, 1l.toLong, 3l.toLong, 5l.toLong, 7l.toLong))).equals((Some(None), Some(1l))));\n assert(largestSmallestIntegers((List[Long](2l.toLong, 4l.toLong, 1l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 0l.toLong))).equals((Some(None), Some(1l))));\n assert(largestSmallestIntegers((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 4l.toLong, 5l.toLong, 6l.toLong, -2l.toLong))).equals((-2l, 1l)));\n assert(largestSmallestIntegers((List[Long](4l.toLong, 5l.toLong, 3l.toLong, 6l.toLong, 2l.toLong, 7l.toLong, -7l.toLong))).equals((-7l, 2l)));\n assert(largestSmallestIntegers((List[Long](7l.toLong, 3l.toLong, 8l.toLong, 4l.toLong, 9l.toLong, 2l.toLong, 5l.toLong, -9l.toLong))).equals((-9l, 2l)));\n assert(largestSmallestIntegers((List[Long]())).equals((Some(None), Some(None))));\n assert(largestSmallestIntegers((List[Long](0l.toLong))).equals((Some(None), Some(None))));\n assert(largestSmallestIntegers((List[Long](-1l.toLong, -3l.toLong, -5l.toLong, -6l.toLong))).equals((Some(-1l), Some(None))));\n assert(largestSmallestIntegers((List[Long](-1l.toLong, -3l.toLong, -5l.toLong, -6l.toLong, 0l.toLong))).equals((Some(-1l), Some(None))));\n assert(largestSmallestIntegers((List[Long](-6l.toLong, -4l.toLong, -4l.toLong, -3l.toLong, 1l.toLong))).equals((-3l, 1l)));\n assert(largestSmallestIntegers((List[Long](-6l.toLong, -4l.toLong, -4l.toLong, -3l.toLong, -100l.toLong, 1l.toLong))).equals((-3l, 1l)));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // \"Given an array representing a branch of a tree that has non-negative integer nodes\n // your task is to pluck one of the nodes and return it.\n // The plucked node should be the node with the smallest even value.\n // If multiple nodes with the same smallest even value are found return the node that has smallest index.\n // The plucked node should be returned in a list, [ smalest_value, its index ],\n // If there are no even values or the given array is empty, return [].\n // Example 1:\n // Input: [4,2,3]\n // Output: [2, 1]\n // Explanation: 2 has the smallest even value, and 2 has the smallest index.\n // Example 2:\n // Input: [1,2,3]\n // Output: [2, 1]\n // Explanation: 2 has the smallest even value, and 2 has the smallest index. \n // Example 3:\n // Input: []\n // Output: []\n // Example 4:\n // Input: [5, 0, 3, 0, 4, 2]\n // Output: [0, 1]\n // Explanation: 0 is the smallest value, but there are two zeros,\n // so we will choose the first zero, which has the smallest index.\n // Constraints:\n // * 1 <= nodes.length <= 10000\n // * 0 <= node.value\n def pluck(arr : List[Long]) : List[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(pluck((List[Long](4l.toLong, 2l.toLong, 3l.toLong))).equals((List[Long](2l.toLong, 1l.toLong))));\n assert(pluck((List[Long](1l.toLong, 2l.toLong, 3l.toLong))).equals((List[Long](2l.toLong, 1l.toLong))));\n assert(pluck((List[Long]())).equals((List[Long]())));\n assert(pluck((List[Long](5l.toLong, 0l.toLong, 3l.toLong, 0l.toLong, 4l.toLong, 2l.toLong))).equals((List[Long](0l.toLong, 1l.toLong))));\n assert(pluck((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 0l.toLong, 5l.toLong, 3l.toLong))).equals((List[Long](0l.toLong, 3l.toLong))));\n assert(pluck((List[Long](5l.toLong, 4l.toLong, 8l.toLong, 4l.toLong, 8l.toLong))).equals((List[Long](4l.toLong, 1l.toLong))));\n assert(pluck((List[Long](7l.toLong, 6l.toLong, 7l.toLong, 1l.toLong))).equals((List[Long](6l.toLong, 1l.toLong))));\n assert(pluck((List[Long](7l.toLong, 9l.toLong, 7l.toLong, 1l.toLong))).equals((List[Long]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function count_nums which takes an array of integers and returns\n // the number of elements which has a sum of digits > 0.\n // If a number is negative, then its first signed digit will be negative:\n // e.g. -123 has signed digits -1, 2, and 3.\n // >>> count_nums([]) == 0\n // >>> count_nums([-1, 11, -11]) == 1\n // >>> count_nums([1, 1, 2]) == 3\n def countNums(arr : List[Long]) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(countNums((List[Long]())) == (0l));\n assert(countNums((List[Long](-1l.toLong, -2l.toLong, 0l.toLong))) == (0l));\n assert(countNums((List[Long](1l.toLong, 1l.toLong, 2l.toLong, -2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong))) == (6l));\n assert(countNums((List[Long](1l.toLong, 6l.toLong, 9l.toLong, -6l.toLong, 0l.toLong, 1l.toLong, 5l.toLong))) == (5l));\n assert(countNums((List[Long](1l.toLong, 100l.toLong, 98l.toLong, -7l.toLong, 1l.toLong, -1l.toLong))) == (4l));\n assert(countNums((List[Long](12l.toLong, 23l.toLong, 34l.toLong, -45l.toLong, -56l.toLong, 0l.toLong))) == (5l));\n assert(countNums((List[Long](0l.toLong, 1l.toLong))) == (1l));\n assert(countNums((List[Long](1l.toLong))) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n // each cell of the grid contains a value. Every integer in the range [1, N * N]\n // inclusive appears exactly once on the cells of the grid.\n // You have to find the minimum path of length k in the grid. You can start\n // from any cell, and in each step you can move to any of the neighbor cells,\n // in other words, you can go to cells which share an edge with you current\n // cell.\n // Please note that a path of length k means visiting exactly k cells (not\n // necessarily distinct).\n // You CANNOT go off the grid.\n // A path A (of length k) is considered less than a path B (of length k) if\n // after making the ordered lists of the values on the cells that A and B go\n // through (let's call them lst_A and lst_B), lst_A is lexicographically less\n // than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n // such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n // lst_A[j] = lst_B[j].\n // It is guaranteed that the answer is unique.\n // Return an ordered list of the values on the cells that the minimum path go through.\n // Examples:\n // Input: grid = [ [1,2,3], [4,5,6], [7,8,9]], k = 3\n // Output: [1, 2, 1]\n // Input: grid = [ [5,9,3], [4,1,6], [7,8,2]], k = 1\n // Output: [1]\n def minPath(grid : List[List[Long]], k : Long) : List[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(minPath((List[List[Long]](List[Long](1l.toLong, 2l.toLong, 3l.toLong), List[Long](4l.toLong, 5l.toLong, 6l.toLong), List[Long](7l.toLong, 8l.toLong, 9l.toLong))), (3l)).equals((List[Long](1l.toLong, 2l.toLong, 1l.toLong))));\n assert(minPath((List[List[Long]](List[Long](5l.toLong, 9l.toLong, 3l.toLong), List[Long](4l.toLong, 1l.toLong, 6l.toLong), List[Long](7l.toLong, 8l.toLong, 2l.toLong))), (1l)).equals((List[Long](1l.toLong))));\n assert(minPath((List[List[Long]](List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong), List[Long](5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong), List[Long](9l.toLong, 10l.toLong, 11l.toLong, 12l.toLong), List[Long](13l.toLong, 14l.toLong, 15l.toLong, 16l.toLong))), (4l)).equals((List[Long](1l.toLong, 2l.toLong, 1l.toLong, 2l.toLong))));\n assert(minPath((List[List[Long]](List[Long](6l.toLong, 4l.toLong, 13l.toLong, 10l.toLong), List[Long](5l.toLong, 7l.toLong, 12l.toLong, 1l.toLong), List[Long](3l.toLong, 16l.toLong, 11l.toLong, 15l.toLong), List[Long](8l.toLong, 14l.toLong, 9l.toLong, 2l.toLong))), (7l)).equals((List[Long](1l.toLong, 10l.toLong, 1l.toLong, 10l.toLong, 1l.toLong, 10l.toLong, 1l.toLong))));\n assert(minPath((List[List[Long]](List[Long](8l.toLong, 14l.toLong, 9l.toLong, 2l.toLong), List[Long](6l.toLong, 4l.toLong, 13l.toLong, 15l.toLong), List[Long](5l.toLong, 7l.toLong, 1l.toLong, 12l.toLong), List[Long](3l.toLong, 10l.toLong, 11l.toLong, 16l.toLong))), (5l)).equals((List[Long](1l.toLong, 7l.toLong, 1l.toLong, 7l.toLong, 1l.toLong))));\n assert(minPath((List[List[Long]](List[Long](11l.toLong, 8l.toLong, 7l.toLong, 2l.toLong), List[Long](5l.toLong, 16l.toLong, 14l.toLong, 4l.toLong), List[Long](9l.toLong, 3l.toLong, 15l.toLong, 6l.toLong), List[Long](12l.toLong, 13l.toLong, 10l.toLong, 1l.toLong))), (9l)).equals((List[Long](1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong, 1l.toLong))));\n assert(minPath((List[List[Long]](List[Long](12l.toLong, 13l.toLong, 10l.toLong, 1l.toLong), List[Long](9l.toLong, 3l.toLong, 15l.toLong, 6l.toLong), List[Long](5l.toLong, 16l.toLong, 14l.toLong, 4l.toLong), List[Long](11l.toLong, 8l.toLong, 7l.toLong, 2l.toLong))), (12l)).equals((List[Long](1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong))));\n assert(minPath((List[List[Long]](List[Long](2l.toLong, 7l.toLong, 4l.toLong), List[Long](3l.toLong, 1l.toLong, 5l.toLong), List[Long](6l.toLong, 8l.toLong, 9l.toLong))), (8l)).equals((List[Long](1l.toLong, 3l.toLong, 1l.toLong, 3l.toLong, 1l.toLong, 3l.toLong, 1l.toLong, 3l.toLong))));\n assert(minPath((List[List[Long]](List[Long](6l.toLong, 1l.toLong, 5l.toLong), List[Long](3l.toLong, 8l.toLong, 9l.toLong), List[Long](2l.toLong, 7l.toLong, 4l.toLong))), (8l)).equals((List[Long](1l.toLong, 5l.toLong, 1l.toLong, 5l.toLong, 1l.toLong, 5l.toLong, 1l.toLong, 5l.toLong))));\n assert(minPath((List[List[Long]](List[Long](1l.toLong, 2l.toLong), List[Long](3l.toLong, 4l.toLong))), (10l)).equals((List[Long](1l.toLong, 2l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 2l.toLong))));\n assert(minPath((List[List[Long]](List[Long](1l.toLong, 3l.toLong), List[Long](3l.toLong, 2l.toLong))), (10l)).equals((List[Long](1l.toLong, 3l.toLong, 1l.toLong, 3l.toLong, 1l.toLong, 3l.toLong, 1l.toLong, 3l.toLong, 1l.toLong, 3l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given list of integers, return list in strange order.\n // Strange sorting, is when you start with the minimum value,\n // then maximum of the remaining integers, then minimum and so on.\n // Examples:\n // strange_sort_list([1, 2, 3, 4]) == [1, 4, 2, 3]\n // strange_sort_list([5, 5, 5, 5]) == [5, 5, 5, 5]\n // strange_sort_list([]) == []\n def strangeSortList(lst : List[Long]) : List[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(strangeSortList((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((List[Long](1l.toLong, 4l.toLong, 2l.toLong, 3l.toLong))));\n assert(strangeSortList((List[Long](5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong, 9l.toLong))).equals((List[Long](5l.toLong, 9l.toLong, 6l.toLong, 8l.toLong, 7l.toLong))));\n assert(strangeSortList((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong))).equals((List[Long](1l.toLong, 5l.toLong, 2l.toLong, 4l.toLong, 3l.toLong))));\n assert(strangeSortList((List[Long](5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong, 9l.toLong, 1l.toLong))).equals((List[Long](1l.toLong, 9l.toLong, 5l.toLong, 8l.toLong, 6l.toLong, 7l.toLong))));\n assert(strangeSortList((List[Long](5l.toLong, 5l.toLong, 5l.toLong, 5l.toLong))).equals((List[Long](5l.toLong, 5l.toLong, 5l.toLong, 5l.toLong))));\n assert(strangeSortList((List[Long]())).equals((List[Long]())));\n assert(strangeSortList((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong))).equals((List[Long](1l.toLong, 8l.toLong, 2l.toLong, 7l.toLong, 3l.toLong, 6l.toLong, 4l.toLong, 5l.toLong))));\n assert(strangeSortList((List[Long](0l.toLong, 2l.toLong, 2l.toLong, 2l.toLong, 5l.toLong, 5l.toLong, -5l.toLong, -5l.toLong))).equals((List[Long](-5l.toLong, 5l.toLong, -5l.toLong, 5l.toLong, 0l.toLong, 2l.toLong, 2l.toLong, 2l.toLong))));\n assert(strangeSortList((List[Long](111111l.toLong))).equals((List[Long](111111l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a string 'text', return its md5 hash equivalent string.\n // If 'text' is an empty string, return None.\n // >>> string_to_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'\n def stringToMd5(text : String) : Option[String] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(stringToMd5((\"Hello world\")).equals(\"3e25960a79dbc69b674cd4ec67a72c62\"));\n assert(stringToMd5((\"\")).equals(None));\n assert(stringToMd5((\"A B C\")).equals(\"0ef78513b0cb8cef12743f5aeb35f888\"));\n assert(stringToMd5((\"password\")).equals(\"5f4dcc3b5aa765d61d8327deb882cf99\"));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a word. Your task is to find the closest vowel that stands between \n // two consonants from the right side of the word (case sensitive).\n // Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n // find any vowel met the above condition. \n // You may assume that the given string contains English letter only.\n // Example:\n // get_closest_vowel(\"yogurt\") ==> \"u\"\n // get_closest_vowel(\"FULL\") ==> \"U\"\n // get_closest_vowel(\"quick\") ==> \"\"\n // get_closest_vowel(\"ab\") ==> \"\"\n def getClosestVowel(word : String) : String = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(getClosestVowel((\"yogurt\")).equals((\"u\")));\n assert(getClosestVowel((\"full\")).equals((\"u\")));\n assert(getClosestVowel((\"easy\")).equals((\"\")));\n assert(getClosestVowel((\"eAsy\")).equals((\"\")));\n assert(getClosestVowel((\"ali\")).equals((\"\")));\n assert(getClosestVowel((\"bad\")).equals((\"a\")));\n assert(getClosestVowel((\"most\")).equals((\"o\")));\n assert(getClosestVowel((\"ab\")).equals((\"\")));\n assert(getClosestVowel((\"ba\")).equals((\"\")));\n assert(getClosestVowel((\"quick\")).equals((\"\")));\n assert(getClosestVowel((\"anime\")).equals((\"i\")));\n assert(getClosestVowel((\"Asia\")).equals((\"\")));\n assert(getClosestVowel((\"Above\")).equals((\"o\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Change numerical base of input number x to base.\n // return string representation after the conversion.\n // base numbers are less than 10.\n // >>> change_base(8, 3)\n // '22'\n // >>> change_base(8, 2)\n // '1000'\n // >>> change_base(7, 2)\n // '111'\n def changeBase(x : Long, base : Long) : String = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(changeBase((8l), (3l)).equals((\"22\")));\n assert(changeBase((9l), (3l)).equals((\"100\")));\n assert(changeBase((234l), (2l)).equals((\"11101010\")));\n assert(changeBase((16l), (2l)).equals((\"10000\")));\n assert(changeBase((8l), (2l)).equals((\"1000\")));\n assert(changeBase((7l), (2l)).equals((\"111\")));\n assert(changeBase((2l), (3l)).equals((\"2\")));\n assert(changeBase((3l), (4l)).equals((\"3\")));\n assert(changeBase((4l), (5l)).equals((\"4\")));\n assert(changeBase((5l), (6l)).equals((\"5\")));\n assert(changeBase((6l), (7l)).equals((\"6\")));\n assert(changeBase((7l), (8l)).equals((\"7\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Check if in given list of numbers, are any two numbers closer to each other than\n // given threshold.\n // >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n // False\n // >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n // True\n def hasCloseElements(numbers : List[Float], threshold : Float) : Boolean = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(hasCloseElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.9f.toFloat, 4.0f.toFloat, 5.0f.toFloat, 2.2f.toFloat)), (0.3f)) == (true));\n assert(hasCloseElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.9f.toFloat, 4.0f.toFloat, 5.0f.toFloat, 2.2f.toFloat)), (0.05f)) == (false));\n assert(hasCloseElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 5.9f.toFloat, 4.0f.toFloat, 5.0f.toFloat)), (0.95f)) == (true));\n assert(hasCloseElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 5.9f.toFloat, 4.0f.toFloat, 5.0f.toFloat)), (0.8f)) == (false));\n assert(hasCloseElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat, 5.0f.toFloat, 2.0f.toFloat)), (0.1f)) == (true));\n assert(hasCloseElements((List[Float](1.1f.toFloat, 2.2f.toFloat, 3.1f.toFloat, 4.1f.toFloat, 5.1f.toFloat)), (1.0f)) == (true));\n assert(hasCloseElements((List[Float](1.1f.toFloat, 2.2f.toFloat, 3.1f.toFloat, 4.1f.toFloat, 5.1f.toFloat)), (0.5f)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function that takes a string as input which contains only square brackets.\n // The function should return True if and only if there is a valid subsequence of brackets \n // where at least one bracket in the subsequence is nested.\n // is_nested('[[]]') \u279e True\n // is_nested('[]]]]]]][[[[[]') \u279e False\n // is_nested('[][]') \u279e False\n // is_nested('[]') \u279e False\n // is_nested('[[][]]') \u279e True\n // is_nested('[[]][[') \u279e True\n def isNested(string : String) : Boolean = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(isNested((\"[[]]\")) == (true));\n assert(isNested((\"[]]]]]]][[[[[]\")) == (false));\n assert(isNested((\"[][]\")) == (false));\n assert(isNested((\"[]\")) == (false));\n assert(isNested((\"[[[[]]]]\")) == (true));\n assert(isNested((\"[]]]]]]]]]]\")) == (false));\n assert(isNested((\"[][][[]]\")) == (true));\n assert(isNested((\"[[]\")) == (false));\n assert(isNested((\"[]]\")) == (false));\n assert(isNested((\"[[]][[\")) == (true));\n assert(isNested((\"[[][]]\")) == (true));\n assert(isNested((\"\")) == (false));\n assert(isNested((\"[[[[[[[[\")) == (false));\n assert(isNested((\"]]]]]]]]\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Concatenate list of strings into a single string\n // >>> concatenate([])\n // ''\n // >>> concatenate(['a', 'b', 'c'])\n // 'abc'\n def concatenate(strings : List[String]) : String = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(concatenate((List[String]())).equals((\"\")));\n assert(concatenate((List[String](\"x\", \"y\", \"z\"))).equals((\"xyz\")));\n assert(concatenate((List[String](\"x\", \"y\", \"z\", \"w\", \"k\"))).equals((\"xyzwk\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n // >>> prime_fib(1)\n // 2\n // >>> prime_fib(2)\n // 3\n // >>> prime_fib(3)\n // 5\n // >>> prime_fib(4)\n // 13\n // >>> prime_fib(5)\n // 89\n def primeFib(n : Long) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(primeFib((1l)) == (2l));\n assert(primeFib((2l)) == (3l));\n assert(primeFib((3l)) == (5l));\n assert(primeFib((4l)) == (13l));\n assert(primeFib((5l)) == (89l));\n assert(primeFib((6l)) == (233l));\n assert(primeFib((7l)) == (1597l));\n assert(primeFib((8l)) == (28657l));\n assert(primeFib((9l)) == (514229l));\n assert(primeFib((10l)) == (433494437l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n // other and return them in order (smaller number, larger number).\n // >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n // (2.0, 2.2)\n // >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n // (2.0, 2.0)\n def findClosestElements(numbers : List[Float]) : Tuple2[Float, Float] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(findClosestElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.9f.toFloat, 4.0f.toFloat, 5.0f.toFloat, 2.2f.toFloat))).equals(((3.9f, 4.0f))));\n assert(findClosestElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 5.9f.toFloat, 4.0f.toFloat, 5.0f.toFloat))).equals(((5.0f, 5.9f))));\n assert(findClosestElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat, 5.0f.toFloat, 2.2f.toFloat))).equals(((2.0f, 2.2f))));\n assert(findClosestElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat, 5.0f.toFloat, 2.0f.toFloat))).equals(((2.0f, 2.0f))));\n assert(findClosestElements((List[Float](1.1f.toFloat, 2.2f.toFloat, 3.1f.toFloat, 4.1f.toFloat, 5.1f.toFloat))).equals(((2.2f, 3.1f))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You have been tasked to write a function that receives \n // a hexadecimal number as a string and counts the number of hexadecimal \n // digits that are primes (prime number, or a prime, is a natural number \n // greater than 1 that is not a product of two smaller natural numbers).\n // Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n // Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n // So you have to determine a number of the following digits: 2, 3, 5, 7, \n // B (=decimal 11), D (=decimal 13).\n // Note: you may assume the input is always correct or empty string, \n // and symbols A,B,C,D,E,F are always uppercase.\n // Examples:\n // For num = \"AB\" the output should be 1.\n // For num = \"1077E\" the output should be 2.\n // For num = \"ABED1A33\" the output should be 4.\n // For num = \"123456789ABCDEF0\" the output should be 6.\n // For num = \"2020\" the output should be 2.\n def hexKey(num : String) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(hexKey((\"AB\")) == (1l));\n assert(hexKey((\"1077E\")) == (2l));\n assert(hexKey((\"ABED1A33\")) == (4l));\n assert(hexKey((\"2020\")) == (2l));\n assert(hexKey((\"123456789ABCDEF0\")) == (6l));\n assert(hexKey((\"112233445566778899AABBCCDDEEFF00\")) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Complete the function that takes two integers and returns \n // the product of their unit digits.\n // Assume the input is always valid.\n // Examples:\n // multiply(148, 412) should return 16.\n // multiply(19, 28) should return 72.\n // multiply(2020, 1851) should return 0.\n // multiply(14,-15) should return 20.\n def multiply(a : Long, b : Long) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(multiply((148l), (412l)) == (16l));\n assert(multiply((19l), (28l)) == (72l));\n assert(multiply((2020l), (1851l)) == (0l));\n assert(multiply((14l), (-15l)) == (20l));\n assert(multiply((76l), (67l)) == (42l));\n assert(multiply((17l), (27l)) == (49l));\n assert(multiply((0l), (1l)) == (0l));\n assert(multiply((0l), (0l)) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given list of numbers (of at least two elements), apply a linear transform to that list,\n // such that the smallest number will become 0 and the largest will become 1\n // >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n // [0.0, 0.25, 0.5, 0.75, 1.0]\n def rescaleToUnit(numbers : List[Float]) : List[Float] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(rescaleToUnit((List[Float](2.0f.toFloat, 49.9f.toFloat))).equals((List[Float](0.0f.toFloat, 1.0f.toFloat))));\n assert(rescaleToUnit((List[Float](100.0f.toFloat, 49.9f.toFloat))).equals((List[Float](1.0f.toFloat, 0.0f.toFloat))));\n assert(rescaleToUnit((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat, 5.0f.toFloat))).equals((List[Float](0.0f.toFloat, 0.25f.toFloat, 0.5f.toFloat, 0.75f.toFloat, 1.0f.toFloat))));\n assert(rescaleToUnit((List[Float](2.0f.toFloat, 1.0f.toFloat, 5.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat))).equals((List[Float](0.25f.toFloat, 0.0f.toFloat, 1.0f.toFloat, 0.5f.toFloat, 0.75f.toFloat))));\n assert(rescaleToUnit((List[Float](12.0f.toFloat, 11.0f.toFloat, 15.0f.toFloat, 13.0f.toFloat, 14.0f.toFloat))).equals((List[Float](0.25f.toFloat, 0.0f.toFloat, 1.0f.toFloat, 0.5f.toFloat, 0.75f.toFloat))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a positive integer n, return the product of the odd digits.\n // Return 0 if all digits are even.\n // For example:\n // digits(1) == 1\n // digits(4) == 0\n // digits(235) == 15\n def digits(n : Long) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(digits((5l)) == (5l));\n assert(digits((54l)) == (5l));\n assert(digits((120l)) == (1l));\n assert(digits((5014l)) == (5l));\n assert(digits((98765l)) == (315l));\n assert(digits((5576543l)) == (2625l));\n assert(digits((2468l)) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You will be given the name of a class (a string) and a list of extensions.\n // The extensions are to be used to load additional classes to the class. The\n // strength of the extension is as follows: Let CAP be the number of the uppercase\n // letters in the extension's name, and let SM be the number of lowercase letters \n // in the extension's name, the strength is given by the fraction CAP - SM. \n // You should find the strongest extension and return a string in this \n // format: ClassName.StrongestExtensionName.\n // If there are two or more extensions with the same strength, you should\n // choose the one that comes first in the list.\n // For example, if you are given \"Slices\" as the class and a list of the\n // extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n // return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n // (its strength is -1).\n // Example:\n // for Strongest_Extension('my_class', ['AA', 'Be', 'CC']) == 'my_class.AA'\n def StrongestExtension(class_name : String, extensions : List[String]) : String = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(StrongestExtension((\"Watashi\"), (List[String](\"tEN\", \"niNE\", \"eIGHt8OKe\"))).equals((\"Watashi.eIGHt8OKe\")));\n assert(StrongestExtension((\"Boku123\"), (List[String](\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"))).equals((\"Boku123.YEs.WeCaNe\")));\n assert(StrongestExtension((\"__YESIMHERE\"), (List[String](\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"))).equals((\"__YESIMHERE.NuLl__\")));\n assert(StrongestExtension((\"K\"), (List[String](\"Ta\", \"TAR\", \"t234An\", \"cosSo\"))).equals((\"K.TAR\")));\n assert(StrongestExtension((\"__HAHA\"), (List[String](\"Tab\", \"123\", \"781345\", \"-_-\"))).equals((\"__HAHA.123\")));\n assert(StrongestExtension((\"YameRore\"), (List[String](\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"))).equals((\"YameRore.okIWILL123\")));\n assert(StrongestExtension((\"finNNalLLly\"), (List[String](\"Die\", \"NowW\", \"Wow\", \"WoW\"))).equals((\"finNNalLLly.WoW\")));\n assert(StrongestExtension((\"_\"), (List[String](\"Bb\", \"91245\"))).equals((\"_.Bb\")));\n assert(StrongestExtension((\"Sp\"), (List[String](\"671235\", \"Bb\"))).equals((\"Sp.671235\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a string representing a space separated lowercase letters, return a dictionary\n // of the letter with the most repetition and containing the corresponding count.\n // If several letters have the same occurrence, return all of them.\n // Example:\n // histogram('a b c') == {'a': 1, 'b': 1, 'c': 1}\n // histogram('a b b a') == {'a': 2, 'b': 2}\n // histogram('a b c a b') == {'a': 2, 'b': 2}\n // histogram('b b b b a') == {'b': 4}\n // histogram('') == {}\n def histogram(test : String) : Map[String,Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(histogram((\"a b b a\")).equals((Map[String,Long](\"a\" -> 2l, \"b\" -> 2l))));\n assert(histogram((\"a b c a b\")).equals((Map[String,Long](\"a\" -> 2l, \"b\" -> 2l))));\n assert(histogram((\"a b c d g\")).equals((Map[String,Long](\"a\" -> 1l, \"b\" -> 1l, \"c\" -> 1l, \"d\" -> 1l, \"g\" -> 1l))));\n assert(histogram((\"r t g\")).equals((Map[String,Long](\"r\" -> 1l, \"t\" -> 1l, \"g\" -> 1l))));\n assert(histogram((\"b b b b a\")).equals((Map[String,Long](\"b\" -> 4l))));\n assert(histogram((\"r t g\")).equals((Map[String,Long](\"r\" -> 1l, \"t\" -> 1l, \"g\" -> 1l))));\n assert(histogram((\"\")).equals((Map[String,Long]())));\n assert(histogram((\"a\")).equals((Map[String,Long](\"a\" -> 1l))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // pairs_sum_to_zero takes a list of integers as an input.\n // it returns True if there are two distinct elements in the list that\n // sum to zero, and False otherwise.\n // >>> pairs_sum_to_zero([1, 3, 5, 0])\n // False\n // >>> pairs_sum_to_zero([1, 3, -2, 1])\n // False\n // >>> pairs_sum_to_zero([1, 2, 3, 7])\n // False\n // >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7])\n // True\n // >>> pairs_sum_to_zero([1])\n // False\n def pairsSumToZero(l : List[Long]) : Boolean = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(pairsSumToZero((List[Long](1l.toLong, 3l.toLong, 5l.toLong, 0l.toLong))) == (false));\n assert(pairsSumToZero((List[Long](1l.toLong, 3l.toLong, -2l.toLong, 1l.toLong))) == (false));\n assert(pairsSumToZero((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 7l.toLong))) == (false));\n assert(pairsSumToZero((List[Long](2l.toLong, 4l.toLong, -5l.toLong, 3l.toLong, 5l.toLong, 7l.toLong))) == (true));\n assert(pairsSumToZero((List[Long](1l.toLong))) == (false));\n assert(pairsSumToZero((List[Long](-3l.toLong, 9l.toLong, -1l.toLong, 3l.toLong, 2l.toLong, 30l.toLong))) == (true));\n assert(pairsSumToZero((List[Long](-3l.toLong, 9l.toLong, -1l.toLong, 3l.toLong, 2l.toLong, 31l.toLong))) == (true));\n assert(pairsSumToZero((List[Long](-3l.toLong, 9l.toLong, -1l.toLong, 4l.toLong, 2l.toLong, 30l.toLong))) == (false));\n assert(pairsSumToZero((List[Long](-3l.toLong, 9l.toLong, -1l.toLong, 4l.toLong, 2l.toLong, 31l.toLong))) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that accepts two lists of strings and returns the list that has \n // total number of chars in the all strings of the list less than the other list.\n // if the two lists have the same number of chars, return the first list.\n // Examples\n // total_match([], []) \u279e []\n // total_match(['hi', 'admin'], ['hI', 'Hi']) \u279e ['hI', 'Hi']\n // total_match(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) \u279e ['hi', 'admin']\n // total_match(['hi', 'admin'], ['hI', 'hi', 'hi']) \u279e ['hI', 'hi', 'hi']\n // total_match(['4'], ['1', '2', '3', '4', '5']) \u279e ['4']\n def totalMatch(lst1 : List[String], lst2 : List[String]) : List[String] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(totalMatch((List[String]()), (List[String]())).equals((List[String]())));\n assert(totalMatch((List[String](\"hi\", \"admin\")), (List[String](\"hi\", \"hi\"))).equals((List[String](\"hi\", \"hi\"))));\n assert(totalMatch((List[String](\"hi\", \"admin\")), (List[String](\"hi\", \"hi\", \"admin\", \"project\"))).equals((List[String](\"hi\", \"admin\"))));\n assert(totalMatch((List[String](\"4\")), (List[String](\"1\", \"2\", \"3\", \"4\", \"5\"))).equals((List[String](\"4\"))));\n assert(totalMatch((List[String](\"hi\", \"admin\")), (List[String](\"hI\", \"Hi\"))).equals((List[String](\"hI\", \"Hi\"))));\n assert(totalMatch((List[String](\"hi\", \"admin\")), (List[String](\"hI\", \"hi\", \"hi\"))).equals((List[String](\"hI\", \"hi\", \"hi\"))));\n assert(totalMatch((List[String](\"hi\", \"admin\")), (List[String](\"hI\", \"hi\", \"hii\"))).equals((List[String](\"hi\", \"admin\"))));\n assert(totalMatch((List[String]()), (List[String](\"this\"))).equals((List[String]())));\n assert(totalMatch((List[String](\"this\")), (List[String]())).equals((List[String]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Circular shift the digits of the integer x, shift the digits right by shift\n // and return the result as a string.\n // If shift > number of digits, return digits reversed.\n // >>> circular_shift(12, 1)\n // \"21\"\n // >>> circular_shift(12, 2)\n // \"12\"\n def circularShift(x : Long, shift : Long) : String = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(circularShift((100l), (2l)).equals((\"001\")));\n assert(circularShift((12l), (2l)).equals((\"12\")));\n assert(circularShift((97l), (8l)).equals((\"79\")));\n assert(circularShift((12l), (1l)).equals((\"21\")));\n assert(circularShift((11l), (101l)).equals((\"11\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return True is list elements are monotonically increasing or decreasing.\n // >>> monotonic([1, 2, 4, 20])\n // True\n // >>> monotonic([1, 20, 4, 10])\n // False\n // >>> monotonic([4, 1, 0, -10])\n // True\n def monotonic(l : List[Long]) : Boolean = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(monotonic((List[Long](1l.toLong, 2l.toLong, 4l.toLong, 10l.toLong))) == (true));\n assert(monotonic((List[Long](1l.toLong, 2l.toLong, 4l.toLong, 20l.toLong))) == (true));\n assert(monotonic((List[Long](1l.toLong, 20l.toLong, 4l.toLong, 10l.toLong))) == (false));\n assert(monotonic((List[Long](4l.toLong, 1l.toLong, 0l.toLong, -10l.toLong))) == (true));\n assert(monotonic((List[Long](4l.toLong, 1l.toLong, 1l.toLong, 0l.toLong))) == (true));\n assert(monotonic((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 2l.toLong, 5l.toLong, 60l.toLong))) == (false));\n assert(monotonic((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 60l.toLong))) == (true));\n assert(monotonic((List[Long](9l.toLong, 9l.toLong, 9l.toLong, 9l.toLong))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n // Example\n // is_equal_to_sum_even(4) == False\n // is_equal_to_sum_even(6) == False\n // is_equal_to_sum_even(8) == True\n def isEqualToSumEven(n : Long) : Boolean = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(isEqualToSumEven((4l)) == (false));\n assert(isEqualToSumEven((6l)) == (false));\n assert(isEqualToSumEven((8l)) == (true));\n assert(isEqualToSumEven((10l)) == (true));\n assert(isEqualToSumEven((11l)) == (false));\n assert(isEqualToSumEven((12l)) == (true));\n assert(isEqualToSumEven((13l)) == (false));\n assert(isEqualToSumEven((16l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Input to this function is a string representing musical notes in a special ASCII format.\n // Your task is to parse this string and return list of integers corresponding to how many beats does each\n // not last.\n // Here is a legend:\n // 'o' - whole note, lasts four beats\n // 'o|' - half note, lasts two beats\n // '.|' - quater note, lasts one beat\n // >>> parse_music('o o| .| o| o| .| .| .| .| o o')\n // [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\n def parseMusic(music_string : String) : List[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(parseMusic((\"\")).equals((List[Long]())));\n assert(parseMusic((\"o o o o\")).equals((List[Long](4l.toLong, 4l.toLong, 4l.toLong, 4l.toLong))));\n assert(parseMusic((\".| .| .| .|\")).equals((List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))));\n assert(parseMusic((\"o| o| .| .| o o o o\")).equals((List[Long](2l.toLong, 2l.toLong, 1l.toLong, 1l.toLong, 4l.toLong, 4l.toLong, 4l.toLong, 4l.toLong))));\n assert(parseMusic((\"o| .| o| .| o o| o o|\")).equals((List[Long](2l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 4l.toLong, 2l.toLong, 4l.toLong, 2l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // \"\n // This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n // multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n // change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n // Examples:\n // For lst = [1,2,3] the output should be 6\n // For lst = [] the output should be 0\n // For lst = [-1,-5,2,-1,-5] the output should be -126\n def sumSquares(lst : List[Long]) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sumSquares((List[Long](1l.toLong, 2l.toLong, 3l.toLong))) == (6l));\n assert(sumSquares((List[Long](1l.toLong, 4l.toLong, 9l.toLong))) == (14l));\n assert(sumSquares((List[Long]())) == (0l));\n assert(sumSquares((List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))) == (9l));\n assert(sumSquares((List[Long](-1l.toLong, -1l.toLong, -1l.toLong, -1l.toLong, -1l.toLong, -1l.toLong, -1l.toLong, -1l.toLong, -1l.toLong))) == (-3l));\n assert(sumSquares((List[Long](0l.toLong))) == (0l));\n assert(sumSquares((List[Long](-1l.toLong, -5l.toLong, 2l.toLong, -1l.toLong, -5l.toLong))) == (-126l));\n assert(sumSquares((List[Long](-56l.toLong, -99l.toLong, 1l.toLong, 0l.toLong, -2l.toLong))) == (3030l));\n assert(sumSquares((List[Long](-1l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, -1l.toLong))) == (0l));\n assert(sumSquares((List[Long](-16l.toLong, -9l.toLong, -2l.toLong, 36l.toLong, 36l.toLong, 26l.toLong, -20l.toLong, 25l.toLong, -40l.toLong, 20l.toLong, -4l.toLong, 12l.toLong, -26l.toLong, 35l.toLong, 37l.toLong))) == (-14196l));\n assert(sumSquares((List[Long](-1l.toLong, -3l.toLong, 17l.toLong, -1l.toLong, -15l.toLong, 13l.toLong, -1l.toLong, 14l.toLong, -14l.toLong, -12l.toLong, -5l.toLong, 14l.toLong, -14l.toLong, 6l.toLong, 13l.toLong, 11l.toLong, 16l.toLong, 16l.toLong, 4l.toLong, 10l.toLong))) == (-1448l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // triples_sum_to_zero takes a list of integers as an input.\n // it returns True if there are three distinct elements in the list that\n // sum to zero, and False otherwise.\n // >>> triples_sum_to_zero([1, 3, 5, 0])\n // False\n // >>> triples_sum_to_zero([1, 3, -2, 1])\n // True\n // >>> triples_sum_to_zero([1, 2, 3, 7])\n // False\n // >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n // True\n // >>> triples_sum_to_zero([1])\n // False\n def triplesSumToZero(l : List[Long]) : Boolean = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(triplesSumToZero((List[Long](1l.toLong, 3l.toLong, 5l.toLong, 0l.toLong))) == (false));\n assert(triplesSumToZero((List[Long](1l.toLong, 3l.toLong, 5l.toLong, -1l.toLong))) == (false));\n assert(triplesSumToZero((List[Long](1l.toLong, 3l.toLong, -2l.toLong, 1l.toLong))) == (true));\n assert(triplesSumToZero((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 7l.toLong))) == (false));\n assert(triplesSumToZero((List[Long](1l.toLong, 2l.toLong, 5l.toLong, 7l.toLong))) == (false));\n assert(triplesSumToZero((List[Long](2l.toLong, 4l.toLong, -5l.toLong, 3l.toLong, 9l.toLong, 7l.toLong))) == (true));\n assert(triplesSumToZero((List[Long](1l.toLong))) == (false));\n assert(triplesSumToZero((List[Long](1l.toLong, 3l.toLong, 5l.toLong, -100l.toLong))) == (false));\n assert(triplesSumToZero((List[Long](100l.toLong, 3l.toLong, 5l.toLong, -100l.toLong))) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // brackets is a string of \"<\" and \">\".\n // return True if every opening bracket has a corresponding closing bracket.\n // >>> correct_bracketing(\"<\")\n // False\n // >>> correct_bracketing(\"<>\")\n // True\n // >>> correct_bracketing(\"<<><>>\")\n // True\n // >>> correct_bracketing(\"><<>\")\n // False\n def correctBracketing(brackets : String) : Boolean = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(correctBracketing((\"<>\")) == (true));\n assert(correctBracketing((\"<<><>>\")) == (true));\n assert(correctBracketing((\"<><><<><>><>\")) == (true));\n assert(correctBracketing((\"<><><<<><><>><>><<><><<>>>\")) == (true));\n assert(correctBracketing((\"<<<><>>>>\")) == (false));\n assert(correctBracketing((\"><<>\")) == (false));\n assert(correctBracketing((\"<\")) == (false));\n assert(correctBracketing((\"<<<<\")) == (false));\n assert(correctBracketing((\">\")) == (false));\n assert(correctBracketing((\"<<>\")) == (false));\n assert(correctBracketing((\"<><><<><>><>><<>\")) == (false));\n assert(correctBracketing((\"<><><<><>><>>><>\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that takes an array of numbers as input and returns \n // the number of elements in the array that are greater than 10 and both \n // first and last digits of a number are odd (1, 3, 5, 7, 9).\n // For example:\n // specialFilter([15, -73, 14, -15]) => 1 \n // specialFilter([33, -2, -3, 45, 21, 109]) => 2\n def specialFilter(nums : List[Long]) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(specialFilter((List[Long](5l.toLong, -2l.toLong, 1l.toLong, -5l.toLong))) == (0l));\n assert(specialFilter((List[Long](15l.toLong, -73l.toLong, 14l.toLong, -15l.toLong))) == (1l));\n assert(specialFilter((List[Long](33l.toLong, -2l.toLong, -3l.toLong, 45l.toLong, 21l.toLong, 109l.toLong))) == (2l));\n assert(specialFilter((List[Long](43l.toLong, -12l.toLong, 93l.toLong, 125l.toLong, 121l.toLong, 109l.toLong))) == (4l));\n assert(specialFilter((List[Long](71l.toLong, -2l.toLong, -33l.toLong, 75l.toLong, 21l.toLong, 19l.toLong))) == (3l));\n assert(specialFilter((List[Long](1l.toLong))) == (0l));\n assert(specialFilter((List[Long]())) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a dictionary, return True if all keys are strings in lower \n // case or all keys are strings in upper case, else return False.\n // The function should return False is the given dictionary is empty.\n // Examples:\n // check_dict_case({\"a\":\"apple\", \"b\":\"banana\"}) should return True.\n // check_dict_case({\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}) should return False.\n // check_dict_case({\"a\":\"apple\", \"8\":\"banana\", \"a\":\"apple\"}) should return False.\n // check_dict_case({\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}) should return False.\n // check_dict_case({\"STATE\":\"NC\", \"ZIP\":\"12345\" }) should return True.\n def checkDictCase(dict : Map[String,String]) : Boolean = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(checkDictCase((Map[String,String](\"p\" -> \"pineapple\", \"b\" -> \"banana\"))) == (true));\n assert(checkDictCase((Map[String,String](\"p\" -> \"pineapple\", \"A\" -> \"banana\", \"B\" -> \"banana\"))) == (false));\n assert(checkDictCase((Map[String,String](\"p\" -> \"pineapple\", \"5\" -> \"banana\", \"a\" -> \"apple\"))) == (false));\n assert(checkDictCase((Map[String,String](\"Name\" -> \"John\", \"Age\" -> \"36\", \"City\" -> \"Houston\"))) == (false));\n assert(checkDictCase((Map[String,String](\"STATE\" -> \"NC\", \"ZIP\" -> \"12345\"))) == (true));\n assert(checkDictCase((Map[String,String](\"fruit\" -> \"Orange\", \"taste\" -> \"Sweet\"))) == (true));\n assert(checkDictCase((Map[String,String]())) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n // should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n // alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n // Examples\n // split_words(\"Hello world!\") \u279e [\"Hello\", \"world!\"]\n // split_words(\"Hello,world!\") \u279e [\"Hello\", \"world!\"]\n // split_words(\"abcdef\") == 3\n def splitWords(txt : String) : Either[List[String], Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(splitWords((\"Hello world!\")).equals(List[String](\"Hello\", \"world!\")));\n assert(splitWords((\"Hello,world!\")).equals(List[String](\"Hello\", \"world!\")));\n assert(splitWords((\"Hello world,!\")).equals(List[String](\"Hello\", \"world,!\")));\n assert(splitWords((\"Hello,Hello,world !\")).equals(List[String](\"Hello,Hello,world\", \"!\")));\n assert(splitWords((\"abcdef\")).equals(3l));\n assert(splitWords((\"aaabb\")).equals(2l));\n assert(splitWords((\"aaaBb\")).equals(1l));\n assert(splitWords((\"\")).equals(0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n // fibfib(0) == 0\n // fibfib(1) == 0\n // fibfib(2) == 1\n // fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n // Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n // >>> fibfib(1)\n // 0\n // >>> fibfib(5)\n // 4\n // >>> fibfib(8)\n // 24\n def fibfib(n : Long) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(fibfib((2l)) == (1l));\n assert(fibfib((1l)) == (0l));\n assert(fibfib((5l)) == (4l));\n assert(fibfib((8l)) == (24l));\n assert(fibfib((10l)) == (81l));\n assert(fibfib((12l)) == (274l));\n assert(fibfib((14l)) == (927l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a list of numbers.\n // You need to return the sum of squared numbers in the given list,\n // round each element in the list to the upper int(Ceiling) first.\n // Examples:\n // For lst = [1,2,3] the output should be 14\n // For lst = [1,4,9] the output should be 98\n // For lst = [1,3,5,7] the output should be 84\n // For lst = [1.4,4.2,0] the output should be 29\n // For lst = [-2.4,1,1] the output should be 6\n def sumSquares(lst : List[Float]) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sumSquares((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat))) == (14l));\n assert(sumSquares((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat))) == (14l));\n assert(sumSquares((List[Float](1.0f.toFloat, 3.0f.toFloat, 5.0f.toFloat, 7.0f.toFloat))) == (84l));\n assert(sumSquares((List[Float](1.4f.toFloat, 4.2f.toFloat, 0.0f.toFloat))) == (29l));\n assert(sumSquares((List[Float](-2.4f.toFloat, 1.0f.toFloat, 1.0f.toFloat))) == (6l));\n assert(sumSquares((List[Float](100.0f.toFloat, 1.0f.toFloat, 15.0f.toFloat, 2.0f.toFloat))) == (10230l));\n assert(sumSquares((List[Float](10000.0f.toFloat, 10000.0f.toFloat))) == (200000000l));\n assert(sumSquares((List[Float](-1.4f.toFloat, 4.6f.toFloat, 6.3f.toFloat))) == (75l));\n assert(sumSquares((List[Float](-1.4f.toFloat, 17.9f.toFloat, 18.9f.toFloat, 19.9f.toFloat))) == (1086l));\n assert(sumSquares((List[Float](0.0f.toFloat))) == (0l));\n assert(sumSquares((List[Float](-1.0f.toFloat))) == (1l));\n assert(sumSquares((List[Float](-1.0f.toFloat, 1.0f.toFloat, 0.0f.toFloat))) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_85_add", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a non-empty list of integers lst. add the even elements that are at odd indices..\n // Examples:\n // add([4, 2, 6, 7]) ==> 2\n def add(lst : List[Long]) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(add((List[Long](4l.toLong, 88l.toLong))) == (88l));\n assert(add((List[Long](4l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 2l.toLong, 122l.toLong))) == (122l));\n assert(add((List[Long](4l.toLong, 0l.toLong, 6l.toLong, 7l.toLong))) == (0l));\n assert(add((List[Long](4l.toLong, 4l.toLong, 6l.toLong, 8l.toLong))) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return sorted unique elements in a list\n // >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123])\n // [0, 2, 3, 5, 9, 123]\n def unique(l : List[Long]) : List[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(unique((List[Long](5l.toLong, 3l.toLong, 5l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 9l.toLong, 0l.toLong, 123l.toLong))).equals((List[Long](0l.toLong, 2l.toLong, 3l.toLong, 5l.toLong, 9l.toLong, 123l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a string text, replace all spaces in it with underscores, \n // and if a string has more than 2 consecutive spaces, \n // then replace all consecutive spaces with - \n // fix_spaces(\"Example\") == \"Example\"\n // fix_spaces(\"Example 1\") == \"Example_1\"\n // fix_spaces(\" Example 2\") == \"_Example_2\"\n // fix_spaces(\" Example 3\") == \"_Example-3\"\n def fixSpaces(text : String) : String = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(fixSpaces((\"Example\")).equals((\"Example\")));\n assert(fixSpaces((\"Mudasir Hanif \")).equals((\"Mudasir_Hanif_\")));\n assert(fixSpaces((\"Yellow Yellow Dirty Fellow\")).equals((\"Yellow_Yellow__Dirty__Fellow\")));\n assert(fixSpaces((\"Exa mple\")).equals((\"Exa-mple\")));\n assert(fixSpaces((\" Exa 1 2 2 mple\")).equals((\"-Exa_1_2_2_mple\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return 2^n modulo p (be aware of numerics).\n // >>> modp(3, 5)\n // 3\n // >>> modp(1101, 101)\n // 2\n // >>> modp(0, 101)\n // 1\n // >>> modp(3, 11)\n // 8\n // >>> modp(100, 101)\n // 1\n def modp(n : Long, p : Long) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(modp((3l), (5l)) == (3l));\n assert(modp((1101l), (101l)) == (2l));\n assert(modp((0l), (101l)) == (1l));\n assert(modp((3l), (11l)) == (8l));\n assert(modp((100l), (101l)) == (1l));\n assert(modp((30l), (5l)) == (4l));\n assert(modp((31l), (5l)) == (3l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You have to write a function which validates a given date string and\n // returns True if the date is valid otherwise False.\n // The date is valid if all of the following rules are satisfied:\n // 1. The date string is not empty.\n // 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n // 3. The months should not be less than 1 or higher than 12.\n // 4. The date should be in the format: mm-dd-yyyy\n // for example: \n // valid_date('03-11-2000') => True\n // valid_date('15-01-2012') => False\n // valid_date('04-0-2040') => False\n // valid_date('06-04-2020') => True\n // valid_date('06/04/2020') => False\n def validDate(date : String) : Boolean = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(validDate((\"03-11-2000\")) == (true));\n assert(validDate((\"15-01-2012\")) == (false));\n assert(validDate((\"04-0-2040\")) == (false));\n assert(validDate((\"06-04-2020\")) == (true));\n assert(validDate((\"01-01-2007\")) == (true));\n assert(validDate((\"03-32-2011\")) == (false));\n assert(validDate((\"\")) == (false));\n assert(validDate((\"04-31-3000\")) == (false));\n assert(validDate((\"06-06-2005\")) == (true));\n assert(validDate((\"21-31-2000\")) == (false));\n assert(validDate((\"04-12-2003\")) == (true));\n assert(validDate((\"04122003\")) == (false));\n assert(validDate((\"20030412\")) == (false));\n assert(validDate((\"2003-04\")) == (false));\n assert(validDate((\"2003-04-12\")) == (false));\n assert(validDate((\"04-2003\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that takes a string and returns an ordered version of it.\n // Ordered version of string, is a string where all words (separated by space)\n // are replaced by a new word where all the characters arranged in\n // ascending order based on ascii value.\n // Note: You should keep the order of words and blank spaces in the sentence.\n // For example:\n // anti_shuffle('Hi') returns 'Hi'\n // anti_shuffle('hello') returns 'ehllo'\n // anti_shuffle('Hello World!!!') returns 'Hello !!!Wdlor'\n def antiShuffle(s : String) : String = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(antiShuffle((\"Hi\")).equals((\"Hi\")));\n assert(antiShuffle((\"hello\")).equals((\"ehllo\")));\n assert(antiShuffle((\"number\")).equals((\"bemnru\")));\n assert(antiShuffle((\"abcd\")).equals((\"abcd\")));\n assert(antiShuffle((\"Hello World!!!\")).equals((\"Hello !!!Wdlor\")));\n assert(antiShuffle((\"\")).equals((\"\")));\n assert(antiShuffle((\"Hi. My name is Mister Robot. How are you?\")).equals((\".Hi My aemn is Meirst .Rboot How aer ?ouy\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a list of numbers, return whether or not they are sorted\n // in ascending order. If list has more than 1 duplicate of the same\n // number, return False. Assume no negative numbers and only integers.\n // Examples\n // is_sorted([5]) \u279e True\n // is_sorted([1, 2, 3, 4, 5]) \u279e True\n // is_sorted([1, 3, 2, 4, 5]) \u279e False\n // is_sorted([1, 2, 3, 4, 5, 6]) \u279e True\n // is_sorted([1, 2, 3, 4, 5, 6, 7]) \u279e True\n // is_sorted([1, 3, 2, 4, 5, 6, 7]) \u279e False\n // is_sorted([1, 2, 2, 3, 3, 4]) \u279e True\n // is_sorted([1, 2, 2, 2, 3, 4]) \u279e False\n def isSorted(lst : List[Long]) : Boolean = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(isSorted((List[Long](5l.toLong))) == (true));\n assert(isSorted((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong))) == (true));\n assert(isSorted((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 4l.toLong, 5l.toLong))) == (false));\n assert(isSorted((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong))) == (true));\n assert(isSorted((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong, 7l.toLong))) == (true));\n assert(isSorted((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 4l.toLong, 5l.toLong, 6l.toLong, 7l.toLong))) == (false));\n assert(isSorted((List[Long]())) == (true));\n assert(isSorted((List[Long](1l.toLong))) == (true));\n assert(isSorted((List[Long](3l.toLong, 2l.toLong, 1l.toLong))) == (false));\n assert(isSorted((List[Long](1l.toLong, 2l.toLong, 2l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))) == (false));\n assert(isSorted((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 3l.toLong, 4l.toLong))) == (false));\n assert(isSorted((List[Long](1l.toLong, 2l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 4l.toLong))) == (true));\n assert(isSorted((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a string s.\n // Your task is to check if the string is happy or not.\n // A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n // For example:\n // is_happy(a) => False\n // is_happy(aa) => False\n // is_happy(abcd) => True\n // is_happy(aabb) => False\n // is_happy(adb) => True\n // is_happy(xyy) => False\n def isHappy(s : String) : Boolean = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(isHappy((\"a\")) == (false));\n assert(isHappy((\"aa\")) == (false));\n assert(isHappy((\"abcd\")) == (true));\n assert(isHappy((\"aabb\")) == (false));\n assert(isHappy((\"adb\")) == (true));\n assert(isHappy((\"xyy\")) == (false));\n assert(isHappy((\"iopaxpoi\")) == (true));\n assert(isHappy((\"iopaxioi\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that returns True if the object q will fly, and False otherwise.\n // The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n // Example:\n // will_it_fly([1, 2], 5) \u279e False \n // # 1+2 is less than the maximum possible weight, but it's unbalanced.\n // will_it_fly([3, 2, 3], 1) \u279e False\n // # it's balanced, but 3+2+3 is more than the maximum possible weight.\n // will_it_fly([3, 2, 3], 9) \u279e True\n // # 3+2+3 is less than the maximum possible weight, and it's balanced.\n // will_it_fly([3], 5) \u279e True\n // # 3 is less than the maximum possible weight, and it's balanced.\n def willItFly(q : List[Long], w : Long) : Boolean = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(willItFly((List[Long](3l.toLong, 2l.toLong, 3l.toLong)), (9l)) == (true));\n assert(willItFly((List[Long](1l.toLong, 2l.toLong)), (5l)) == (false));\n assert(willItFly((List[Long](3l.toLong)), (5l)) == (true));\n assert(willItFly((List[Long](3l.toLong, 2l.toLong, 3l.toLong)), (1l)) == (false));\n assert(willItFly((List[Long](1l.toLong, 2l.toLong, 3l.toLong)), (6l)) == (false));\n assert(willItFly((List[Long](5l.toLong)), (5l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given an array of non-negative integers, return a copy of the given array after sorting,\n // you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n // or sort it in descending order if the sum( first index value, last index value) is even.\n // Note:\n // * don't change the given array.\n // Examples:\n // * sort_array([]) => []\n // * sort_array([5]) => [5]\n // * sort_array([2, 4, 3, 0, 1, 5]) => [0, 1, 2, 3, 4, 5]\n // * sort_array([2, 4, 3, 0, 1, 5, 6]) => [6, 5, 4, 3, 2, 1, 0]\n def sortArray(array : List[Long]) : List[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sortArray((List[Long]())).equals((List[Long]())));\n assert(sortArray((List[Long](5l.toLong))).equals((List[Long](5l.toLong))));\n assert(sortArray((List[Long](2l.toLong, 4l.toLong, 3l.toLong, 0l.toLong, 1l.toLong, 5l.toLong))).equals((List[Long](0l.toLong, 1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong))));\n assert(sortArray((List[Long](2l.toLong, 4l.toLong, 3l.toLong, 0l.toLong, 1l.toLong, 5l.toLong, 6l.toLong))).equals((List[Long](6l.toLong, 5l.toLong, 4l.toLong, 3l.toLong, 2l.toLong, 1l.toLong, 0l.toLong))));\n assert(sortArray((List[Long](2l.toLong, 1l.toLong))).equals((List[Long](1l.toLong, 2l.toLong))));\n assert(sortArray((List[Long](15l.toLong, 42l.toLong, 87l.toLong, 32l.toLong, 11l.toLong, 0l.toLong))).equals((List[Long](0l.toLong, 11l.toLong, 15l.toLong, 32l.toLong, 42l.toLong, 87l.toLong))));\n assert(sortArray((List[Long](21l.toLong, 14l.toLong, 23l.toLong, 11l.toLong))).equals((List[Long](23l.toLong, 21l.toLong, 14l.toLong, 11l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Implement a function that takes an non-negative integer and returns an array of the first n\n // integers that are prime numbers and less than n.\n // for example:\n // count_up_to(5) => [2,3]\n // count_up_to(11) => [2,3,5,7]\n // count_up_to(0) => []\n // count_up_to(20) => [2,3,5,7,11,13,17,19]\n // count_up_to(1) => []\n // count_up_to(18) => [2,3,5,7,11,13,17]\n def countUpTo(n : Long) : List[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(countUpTo((5l)).equals((List[Long](2l.toLong, 3l.toLong))));\n assert(countUpTo((6l)).equals((List[Long](2l.toLong, 3l.toLong, 5l.toLong))));\n assert(countUpTo((7l)).equals((List[Long](2l.toLong, 3l.toLong, 5l.toLong))));\n assert(countUpTo((10l)).equals((List[Long](2l.toLong, 3l.toLong, 5l.toLong, 7l.toLong))));\n assert(countUpTo((0l)).equals((List[Long]())));\n assert(countUpTo((22l)).equals((List[Long](2l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 11l.toLong, 13l.toLong, 17l.toLong, 19l.toLong))));\n assert(countUpTo((1l)).equals((List[Long]())));\n assert(countUpTo((18l)).equals((List[Long](2l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 11l.toLong, 13l.toLong, 17l.toLong))));\n assert(countUpTo((47l)).equals((List[Long](2l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 11l.toLong, 13l.toLong, 17l.toLong, 19l.toLong, 23l.toLong, 29l.toLong, 31l.toLong, 37l.toLong, 41l.toLong, 43l.toLong))));\n assert(countUpTo((101l)).equals((List[Long](2l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 11l.toLong, 13l.toLong, 17l.toLong, 19l.toLong, 23l.toLong, 29l.toLong, 31l.toLong, 37l.toLong, 41l.toLong, 43l.toLong, 47l.toLong, 53l.toLong, 59l.toLong, 61l.toLong, 67l.toLong, 71l.toLong, 73l.toLong, 79l.toLong, 83l.toLong, 89l.toLong, 97l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Out of list of strings, return the longest one. Return the first one in case of multiple\n // strings of the same length. Return None in case the input list is empty.\n // >>> longest([])\n // >>> longest(['a', 'b', 'c'])\n // 'a'\n // >>> longest(['a', 'bb', 'ccc'])\n // 'ccc'\n def longest(strings : List[String]) : Option[String] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(longest((List[String]())).equals(None));\n assert(longest((List[String](\"x\", \"y\", \"z\"))).equals(\"x\"));\n assert(longest((List[String](\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"))).equals(\"zzzz\"));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n // reverse the resulting array, and then replace each digit by its corresponding name from\n // \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n // For example:\n // arr = [2, 1, 1, 4, 5, 8, 2, 3] \n // -> sort arr -> [1, 1, 2, 2, 3, 4, 5, 8] \n // -> reverse arr -> [8, 5, 4, 3, 2, 2, 1, 1]\n // return [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n // If the array is empty, return an empty array:\n // arr = []\n // return []\n // If the array has any strange number ignore it:\n // arr = [1, -1 , 55] \n // -> sort arr -> [-1, 1, 55]\n // -> reverse arr -> [55, 1, -1]\n // return = ['One']\n def byLength(arr : List[Long]) : List[String] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(byLength((List[Long](2l.toLong, 1l.toLong, 1l.toLong, 4l.toLong, 5l.toLong, 8l.toLong, 2l.toLong, 3l.toLong))).equals((List[String](\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"))));\n assert(byLength((List[Long]())).equals((List[String]())));\n assert(byLength((List[Long](1l.toLong, -1l.toLong, 55l.toLong))).equals((List[String](\"One\"))));\n assert(byLength((List[Long](1l.toLong, -1l.toLong, 3l.toLong, 2l.toLong))).equals((List[String](\"Three\", \"Two\", \"One\"))));\n assert(byLength((List[Long](9l.toLong, 4l.toLong, 8l.toLong))).equals((List[String](\"Nine\", \"Eight\", \"Four\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_106_f", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Implement the function f that takes n as a parameter,\n // 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\n // or the sum of numbers from 1 to i otherwise.\n // i starts from 1.\n // the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n // Example:\n // f(5) == [1, 2, 6, 24, 15]\n def f(n : Long) : List[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(f((5l)).equals((List[Long](1l.toLong, 2l.toLong, 6l.toLong, 24l.toLong, 15l.toLong))));\n assert(f((7l)).equals((List[Long](1l.toLong, 2l.toLong, 6l.toLong, 24l.toLong, 15l.toLong, 720l.toLong, 28l.toLong))));\n assert(f((1l)).equals((List[Long](1l.toLong))));\n assert(f((3l)).equals((List[Long](1l.toLong, 2l.toLong, 6l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n // >>> fizz_buzz(50)\n // 0\n // >>> fizz_buzz(78)\n // 2\n // >>> fizz_buzz(79)\n // 3\n def fizzBuzz(n : Long) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(fizzBuzz((50l)) == (0l));\n assert(fizzBuzz((78l)) == (2l));\n assert(fizzBuzz((79l)) == (3l));\n assert(fizzBuzz((100l)) == (3l));\n assert(fizzBuzz((200l)) == (6l));\n assert(fizzBuzz((4000l)) == (192l));\n assert(fizzBuzz((10000l)) == (639l));\n assert(fizzBuzz((100000l)) == (8026l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a positive floating point number, it can be decomposed into\n // and integer part (largest integer smaller than given number) and decimals\n // (leftover part always smaller than 1).\n // Return the decimal part of the number.\n // >>> truncate_number(3.5)\n // 0.5\n def truncateNumber(number : Float) : Float = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(truncateNumber((3.5f)) == (0.5f));\n assert(truncateNumber((1.25f)) == (0.25f));\n assert(truncateNumber((123.0f)) == (0.0f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n // Empty sum should be equal to 0 and empty product should be equal to 1.\n // >>> sum_product([])\n // (0, 1)\n // >>> sum_product([1, 2, 3, 4])\n // (10, 24)\n def sumProduct(numbers : List[Long]) : Tuple2[Long, Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sumProduct((List[Long]())).equals(((0l, 1l))));\n assert(sumProduct((List[Long](1l.toLong, 1l.toLong, 1l.toLong))).equals(((3l, 1l))));\n assert(sumProduct((List[Long](100l.toLong, 0l.toLong))).equals(((100l, 0l))));\n assert(sumProduct((List[Long](3l.toLong, 5l.toLong, 7l.toLong))).equals(((15l, 105l))));\n assert(sumProduct((List[Long](10l.toLong))).equals(((10l, 10l))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a 2 dimensional data, as a nested lists,\n // which is similar to matrix, however, unlike matrices,\n // each row may contain a different number of columns.\n // Given lst, and integer x, find integers x in the list,\n // and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n // each tuple is a coordinate - (row, columns), starting with 0.\n // Sort coordinates initially by rows in ascending order.\n // Also, sort coordinates of the row by columns in descending order.\n // Examples:\n // get_row([\n // [1,2,3,4,5,6],\n // [1,2,3,4,1,6],\n // [1,2,3,4,5,1]\n // ], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n // get_row([], 1) == []\n // get_row([[], [1], [1, 2, 3]], 3) == [(2, 2)]\n def getRow(lst : List[List[Long]], x : Long) : List[Tuple2[Long, Long]] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(getRow((List[List[Long]](List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 1l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 1l.toLong))), (1l)).equals((List[Tuple2[Long, Long]]((0l, 0l), (1l, 4l), (1l, 0l), (2l, 5l), (2l, 0l)))));\n assert(getRow((List[List[Long]](List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong))), (2l)).equals((List[Tuple2[Long, Long]]((0l, 1l), (1l, 1l), (2l, 1l), (3l, 1l), (4l, 1l), (5l, 1l)))));\n assert(getRow((List[List[Long]](List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 1l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 1l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 1l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 1l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 1l.toLong))), (1l)).equals((List[Tuple2[Long, Long]]((0l, 0l), (1l, 0l), (2l, 1l), (2l, 0l), (3l, 2l), (3l, 0l), (4l, 3l), (4l, 0l), (5l, 4l), (5l, 0l), (6l, 5l), (6l, 0l)))));\n assert(getRow((List[List[Long]]()), (1l)).equals((List[Tuple2[Long, Long]]())));\n assert(getRow((List[List[Long]](List[Long](1l.toLong))), (2l)).equals((List[Tuple2[Long, Long]]())));\n assert(getRow((List[List[Long]](List[Long](), List[Long](1l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong))), (3l)).equals((List[Tuple2[Long, Long]]((2l, 2l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You're a hungry rabbit, and you already have eaten a certain number of carrots,\n // but now you need to eat more carrots to complete the day's meals.\n // you should return an array of [ total number of eaten carrots after your meals,\n // the number of carrots left after your meals ]\n // if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n // Example:\n // * eat(5, 6, 10) -> [11, 4]\n // * eat(4, 8, 9) -> [12, 1]\n // * eat(1, 10, 10) -> [11, 0]\n // * eat(2, 11, 5) -> [7, 0]\n // Variables:\n // @number : integer\n // the number of carrots that you have eaten.\n // @need : integer\n // the number of carrots that you need to eat.\n // @remaining : integer\n // the number of remaining carrots thet exist in stock\n // Constrain:\n // * 0 <= number <= 1000\n // * 0 <= need <= 1000\n // * 0 <= remaining <= 1000\n // Have fun :)\n def eat(number : Long, need : Long, remaining : Long) : List[Long] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(eat((5l), (6l), (10l)).equals((List[Long](11l.toLong, 4l.toLong))));\n assert(eat((4l), (8l), (9l)).equals((List[Long](12l.toLong, 1l.toLong))));\n assert(eat((1l), (10l), (10l)).equals((List[Long](11l.toLong, 0l.toLong))));\n assert(eat((2l), (11l), (5l)).equals((List[Long](7l.toLong, 0l.toLong))));\n assert(eat((4l), (5l), (7l)).equals((List[Long](9l.toLong, 2l.toLong))));\n assert(eat((4l), (5l), (1l)).equals((List[Long](5l.toLong, 0l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a positive integer N, return the total sum of its digits in binary.\n // Example\n // For N = 1000, the sum of digits will be 1 the output should be \"1\".\n // For N = 150, the sum of digits will be 6 the output should be \"110\".\n // For N = 147, the sum of digits will be 12 the output should be \"1100\".\n // Variables:\n // @N integer\n // Constraints: 0 \u2264 N \u2264 10000.\n // Output:\n // a string of binary number\n def solve(N : Long) : String = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(solve((1000l)).equals((\"1\")));\n assert(solve((150l)).equals((\"110\")));\n assert(solve((147l)).equals((\"1100\")));\n assert(solve((333l)).equals((\"1001\")));\n assert(solve((963l)).equals((\"10010\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a list of integers.\n // You need to find the largest prime value and return the sum of its digits.\n // Examples:\n // For lst = [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] the output should be 10\n // For lst = [1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1] the output should be 25\n // For lst = [1,3,1,32,5107,34,83278,109,163,23,2323,32,30,1,9,3] the output should be 13\n // For lst = [0,724,32,71,99,32,6,0,5,91,83,0,5,6] the output should be 11\n // For lst = [0,81,12,3,1,21] the output should be 3\n // For lst = [0,8,1,2,1,7] the output should be 7\n def skjkasdkd(lst : List[Long]) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(skjkasdkd((List[Long](0l.toLong, 3l.toLong, 2l.toLong, 1l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 4l.toLong, 5l.toLong, 5l.toLong, 5l.toLong, 2l.toLong, 181l.toLong, 32l.toLong, 4l.toLong, 32l.toLong, 3l.toLong, 2l.toLong, 32l.toLong, 324l.toLong, 4l.toLong, 3l.toLong))) == (10l));\n assert(skjkasdkd((List[Long](1l.toLong, 0l.toLong, 1l.toLong, 8l.toLong, 2l.toLong, 4597l.toLong, 2l.toLong, 1l.toLong, 3l.toLong, 40l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 2l.toLong, 4l.toLong, 2l.toLong, 5l.toLong, 1l.toLong))) == (25l));\n assert(skjkasdkd((List[Long](1l.toLong, 3l.toLong, 1l.toLong, 32l.toLong, 5107l.toLong, 34l.toLong, 83278l.toLong, 109l.toLong, 163l.toLong, 23l.toLong, 2323l.toLong, 32l.toLong, 30l.toLong, 1l.toLong, 9l.toLong, 3l.toLong))) == (13l));\n assert(skjkasdkd((List[Long](0l.toLong, 724l.toLong, 32l.toLong, 71l.toLong, 99l.toLong, 32l.toLong, 6l.toLong, 0l.toLong, 5l.toLong, 91l.toLong, 83l.toLong, 0l.toLong, 5l.toLong, 6l.toLong))) == (11l));\n assert(skjkasdkd((List[Long](0l.toLong, 81l.toLong, 12l.toLong, 3l.toLong, 1l.toLong, 21l.toLong))) == (3l));\n assert(skjkasdkd((List[Long](0l.toLong, 8l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 7l.toLong))) == (7l));\n assert(skjkasdkd((List[Long](8191l.toLong))) == (19l));\n assert(skjkasdkd((List[Long](8191l.toLong, 123456l.toLong, 127l.toLong, 7l.toLong))) == (19l));\n assert(skjkasdkd((List[Long](127l.toLong, 97l.toLong, 8192l.toLong))) == (10l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given an array arr of integers, find the minimum number of elements that\n // need to be changed to make the array palindromic. A palindromic array is an array that\n // is read the same backwards and forwards. In one change, you can change one element to any other element.\n // For example:\n // smallest_change([1,2,3,5,4,7,9,6]) == 4\n // smallest_change([1, 2, 3, 4, 3, 2, 2]) == 1\n // smallest_change([1, 2, 3, 2, 1]) == 0\n def smallestChange(arr : List[Long]) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(smallestChange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 5l.toLong, 4l.toLong, 7l.toLong, 9l.toLong, 6l.toLong))) == (4l));\n assert(smallestChange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 3l.toLong, 2l.toLong, 2l.toLong))) == (1l));\n assert(smallestChange((List[Long](1l.toLong, 4l.toLong, 2l.toLong))) == (1l));\n assert(smallestChange((List[Long](1l.toLong, 4l.toLong, 4l.toLong, 2l.toLong))) == (1l));\n assert(smallestChange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 2l.toLong, 1l.toLong))) == (0l));\n assert(smallestChange((List[Long](3l.toLong, 1l.toLong, 1l.toLong, 3l.toLong))) == (0l));\n assert(smallestChange((List[Long](1l.toLong))) == (0l));\n assert(smallestChange((List[Long](0l.toLong, 1l.toLong))) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // It is the last week of the semester and the teacher has to give the grades\n // to students. The teacher has been making her own algorithm for grading.\n // The only problem is, she has lost the code she used for grading.\n // She has given you a list of GPAs for some students and you have to write \n // a function that can output a list of letter grades using the following table:\n // GPA | Letter grade\n // 4.0 A+\n // > 3.7 A \n // > 3.3 A- \n // > 3.0 B+\n // > 2.7 B \n // > 2.3 B-\n // > 2.0 C+\n // > 1.7 C\n // > 1.3 C-\n // > 1.0 D+ \n // > 0.7 D \n // > 0.0 D-\n // 0.0 E\n // Example:\n // grade_equation([4.0, 3, 1.7, 2, 3.5]) ==> ['A+', 'B', 'C-', 'C', 'A-']\n def numericalLetterGrade(grades : List[Float]) : List[String] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(numericalLetterGrade((List[Float](4.0f.toFloat, 3l.toFloat, 1.7f.toFloat, 2l.toFloat, 3.5f.toFloat))).equals((List[String](\"A+\", \"B\", \"C-\", \"C\", \"A-\"))));\n assert(numericalLetterGrade((List[Float](1.2f.toFloat))).equals((List[String](\"D+\"))));\n assert(numericalLetterGrade((List[Float](0.5f.toFloat))).equals((List[String](\"D-\"))));\n assert(numericalLetterGrade((List[Float](0.0f.toFloat))).equals((List[String](\"E\"))));\n assert(numericalLetterGrade((List[Float](1.0f.toFloat, 0.3f.toFloat, 1.5f.toFloat, 2.8f.toFloat, 3.3f.toFloat))).equals((List[String](\"D\", \"D-\", \"C-\", \"B\", \"B+\"))));\n assert(numericalLetterGrade((List[Float](0.0f.toFloat, 0.7f.toFloat))).equals((List[String](\"E\", \"D-\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given the lengths of the three sides of a triangle. Return the area of\n // the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n // Otherwise return -1\n // Three sides make a valid triangle when the sum of any two sides is greater \n // than the third side.\n // Example:\n // triangle_area(3, 4, 5) == 6.00\n // triangle_area(1, 2, 10) == -1\n def triangleArea(a : Long, b : Long, c : Long) : Float = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(triangleArea((3l), (4l), (5l)) == (6.0f));\n assert(triangleArea((1l), (2l), (10l)) == -1l);\n assert(triangleArea((4l), (8l), (5l)) == (8.18f));\n assert(triangleArea((2l), (2l), (2l)) == (1.73f));\n assert(triangleArea((1l), (2l), (3l)) == -1l);\n assert(triangleArea((10l), (5l), (7l)) == (16.25f));\n assert(triangleArea((2l), (6l), (3l)) == -1l);\n assert(triangleArea((1l), (1l), (1l)) == (0.43f));\n assert(triangleArea((2l), (2l), (10l)) == -1l);\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Check if two words have the same characters.\n // >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n // True\n // >>> same_chars('abcd', 'dddddddabc')\n // True\n // >>> same_chars('dddddddabc', 'abcd')\n // True\n // >>> same_chars('eabcd', 'dddddddabc')\n // False\n // >>> same_chars('abcd', 'dddddddabce')\n // False\n // >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc')\n // False\n def sameChars(s0 : String, s1 : String) : Boolean = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddeddabc\")) == (true));\n assert(sameChars((\"abcd\"), (\"dddddddabc\")) == (true));\n assert(sameChars((\"dddddddabc\"), (\"abcd\")) == (true));\n assert(sameChars((\"eabcd\"), (\"dddddddabc\")) == (false));\n assert(sameChars((\"abcd\"), (\"dddddddabcf\")) == (false));\n assert(sameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddddabc\")) == (false));\n assert(sameChars((\"aabb\"), (\"aaccc\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given an array of integers nums, find the minimum sum of any non-empty sub-array\n // of nums.\n // Example\n // minSubArraySum([2, 3, 4, 1, 2, 4]) == 1\n // minSubArraySum([-1, -2, -3]) == -6\n def minSubArraySum(nums : List[Long]) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(minSubArraySum((List[Long](2l.toLong, 3l.toLong, 4l.toLong, 1l.toLong, 2l.toLong, 4l.toLong))) == (1l));\n assert(minSubArraySum((List[Long](-1l.toLong, -2l.toLong, -3l.toLong))) == (-6l));\n assert(minSubArraySum((List[Long](-1l.toLong, -2l.toLong, -3l.toLong, 2l.toLong, -10l.toLong))) == (-14l));\n assert(minSubArraySum((List[Long](-9999999999999999l.toLong))) == (-9999999999999999l));\n assert(minSubArraySum((List[Long](0l.toLong, 10l.toLong, 20l.toLong, 1000000l.toLong))) == (0l));\n assert(minSubArraySum((List[Long](-1l.toLong, -2l.toLong, -3l.toLong, 10l.toLong, -5l.toLong))) == (-6l));\n assert(minSubArraySum((List[Long](100l.toLong, -1l.toLong, -2l.toLong, -3l.toLong, 10l.toLong, -5l.toLong))) == (-6l));\n assert(minSubArraySum((List[Long](10l.toLong, 11l.toLong, 13l.toLong, 8l.toLong, 3l.toLong, 4l.toLong))) == (3l));\n assert(minSubArraySum((List[Long](100l.toLong, -33l.toLong, 32l.toLong, -1l.toLong, 0l.toLong, -2l.toLong))) == (-33l));\n assert(minSubArraySum((List[Long](-10l.toLong))) == (-10l));\n assert(minSubArraySum((List[Long](7l.toLong))) == (7l));\n assert(minSubArraySum((List[Long](1l.toLong, -1l.toLong))) == (-1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a string s and a natural number n, you have been tasked to implement \n // a function that returns a list of all words from string s that contain exactly \n // n consonants, in order these words appear in the string s.\n // If the string s is empty then the function should return an empty list.\n // Note: you may assume the input string contains only letters and spaces.\n // Examples:\n // select_words(\"Mary had a little lamb\", 4) ==> [\"little\"]\n // select_words(\"Mary had a little lamb\", 3) ==> [\"Mary\", \"lamb\"]\n // select_words(\"simple white space\", 2) ==> []\n // select_words(\"Hello world\", 4) ==> [\"world\"]\n // select_words(\"Uncle sam\", 3) ==> [\"Uncle\"]\n def selectWords(s : String, n : Long) : List[String] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(selectWords((\"Mary had a little lamb\"), (4l)).equals((List[String](\"little\"))));\n assert(selectWords((\"Mary had a little lamb\"), (3l)).equals((List[String](\"Mary\", \"lamb\"))));\n assert(selectWords((\"simple white space\"), (2l)).equals((List[String]())));\n assert(selectWords((\"Hello world\"), (4l)).equals((List[String](\"world\"))));\n assert(selectWords((\"Uncle sam\"), (3l)).equals((List[String](\"Uncle\"))));\n assert(selectWords((\"\"), (4l)).equals((List[String]())));\n assert(selectWords((\"a b c d e f\"), (1l)).equals((List[String](\"b\", \"c\", \"d\", \"f\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return list of all prefixes from shortest to longest of the input string\n // >>> all_prefixes('abc')\n // ['a', 'ab', 'abc']\n def allPrefixes(string : String) : List[String] = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(allPrefixes((\"\")).equals((List[String]())));\n assert(allPrefixes((\"asdfgh\")).equals((List[String](\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"))));\n assert(allPrefixes((\"WWW\")).equals((List[String](\"W\", \"WW\", \"WWW\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function that takes a value (string) representing a number\n // and returns the closest integer to it. If the number is equidistant\n // from two integers, round it away from zero.\n // Examples\n // >>> closest_integer(\"10\")\n // 10\n // >>> closest_integer(\"15.3\")\n // 15\n // Note:\n // Rounding away from zero means that if the given number is equidistant\n // from two integers, the one you should return is the one that is the\n // farthest from zero. For example closest_integer(\"14.5\") should\n // return 15 and closest_integer(\"-14.5\") should return -15.\n def closestInteger(value : String) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(closestInteger((\"10\")) == (10l));\n assert(closestInteger((\"14.5\")) == (15l));\n assert(closestInteger((\"-15.5\")) == (-16l));\n assert(closestInteger((\"15.3\")) == (15l));\n assert(closestInteger((\"0\")) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function which takes a string representing a file's name, and returns\n // 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n // A file's name is considered to be valid if and only if all the following conditions \n // are met:\n // - There should not be more than three digits ('0'-'9') in the file's name.\n // - The file's name contains exactly one dot '.'\n // - The substring before the dot should not be empty, and it starts with a letter from \n // the latin alphapet ('a'-'z' and 'A'-'Z').\n // - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n // Examples:\n // file_name_check(\"example.txt\") # => 'Yes'\n // file_name_check(\"1example.dll\") # => 'No' (the name should start with a latin alphapet letter)\n def fileNameCheck(file_name : String) : String = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(fileNameCheck((\"example.txt\")).equals((\"Yes\")));\n assert(fileNameCheck((\"1example.dll\")).equals((\"No\")));\n assert(fileNameCheck((\"s1sdf3.asd\")).equals((\"No\")));\n assert(fileNameCheck((\"K.dll\")).equals((\"Yes\")));\n assert(fileNameCheck((\"MY16FILE3.exe\")).equals((\"Yes\")));\n assert(fileNameCheck((\"His12FILE94.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"_Y.txt\")).equals((\"No\")));\n assert(fileNameCheck((\"?aREYA.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"/this_is_valid.dll\")).equals((\"No\")));\n assert(fileNameCheck((\"this_is_valid.wow\")).equals((\"No\")));\n assert(fileNameCheck((\"this_is_valid.txt\")).equals((\"Yes\")));\n assert(fileNameCheck((\"this_is_valid.txtexe\")).equals((\"No\")));\n assert(fileNameCheck((\"#this2_i4s_5valid.ten\")).equals((\"No\")));\n assert(fileNameCheck((\"@this1_is6_valid.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"this_is_12valid.6exe4.txt\")).equals((\"No\")));\n assert(fileNameCheck((\"all.exe.txt\")).equals((\"No\")));\n assert(fileNameCheck((\"I563_No.exe\")).equals((\"Yes\")));\n assert(fileNameCheck((\"Is3youfault.txt\")).equals((\"Yes\")));\n assert(fileNameCheck((\"no_one#knows.dll\")).equals((\"Yes\")));\n assert(fileNameCheck((\"1I563_Yes3.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"I563_Yes3.txtt\")).equals((\"No\")));\n assert(fileNameCheck((\"final..txt\")).equals((\"No\")));\n assert(fileNameCheck((\"final132\")).equals((\"No\")));\n assert(fileNameCheck((\"_f4indsartal132.\")).equals((\"No\")));\n assert(fileNameCheck((\".txt\")).equals((\"No\")));\n assert(fileNameCheck((\"s.\")).equals((\"No\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given two intervals,\n // where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n // The given intervals are closed which means that the interval (start, end)\n // includes both start and end.\n // For each given interval, it is assumed that its start is less or equal its end.\n // Your task is to determine whether the length of intersection of these two \n // intervals is a prime number.\n // Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n // which its length is 1, which not a prime number.\n // If the length of the intersection is a prime number, return \"YES\",\n // otherwise, return \"NO\".\n // If the two intervals don't intersect, return \"NO\".\n // [input/output] samples:\n // intersection((1, 2), (2, 3)) ==> \"NO\"\n // intersection((-1, 1), (0, 4)) ==> \"NO\"\n // intersection((-3, -1), (-5, 5)) ==> \"YES\"\n def intersection(interval1 : Tuple2[Long, Long], interval2 : Tuple2[Long, Long]) : String = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(intersection(((1l, 2l)), ((2l, 3l))).equals((\"NO\")));\n assert(intersection(((-1l, 1l)), ((0l, 4l))).equals((\"NO\")));\n assert(intersection(((-3l, -1l)), ((-5l, 5l))).equals((\"YES\")));\n assert(intersection(((-2l, 2l)), ((-4l, 0l))).equals((\"YES\")));\n assert(intersection(((-11l, 2l)), ((-1l, -1l))).equals((\"NO\")));\n assert(intersection(((1l, 2l)), ((3l, 5l))).equals((\"NO\")));\n assert(intersection(((1l, 2l)), ((1l, 2l))).equals((\"NO\")));\n assert(intersection(((-2l, -2l)), ((-3l, -2l))).equals((\"NO\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return the largest prime factor of n. Assume n > 1 and is not a prime.\n // >>> largest_prime_factor(13195)\n // 29\n // >>> largest_prime_factor(2048)\n // 2\n def largestPrimeFactor(n : Long) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(largestPrimeFactor((15l)) == (5l));\n assert(largestPrimeFactor((27l)) == (3l));\n assert(largestPrimeFactor((63l)) == (7l));\n assert(largestPrimeFactor((330l)) == (11l));\n assert(largestPrimeFactor((13195l)) == (29l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a string, find out how many distinct characters (regardless of case) does it consist of\n // >>> count_distinct_characters('xyzXYZ')\n // 3\n // >>> count_distinct_characters('Jerry')\n // 4\n def countDistinctCharacters(string : String) : Long = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(countDistinctCharacters((\"\")) == (0l));\n assert(countDistinctCharacters((\"abcde\")) == (5l));\n assert(countDistinctCharacters((\"abcdecadeCADE\")) == (5l));\n assert(countDistinctCharacters((\"aaaaAAAAaaaa\")) == (1l));\n assert(countDistinctCharacters((\"Jerry jERRY JeRRRY\")) == (5l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You're given a list of deposit and withdrawal operations on a bank account that starts with\n // zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n // at that point function should return True. Otherwise it should return False.\n // >>> below_zero([1, 2, 3])\n // False\n // >>> below_zero([1, 2, -4, 5])\n // True\n def belowZero(operations : List[Long]) : Boolean = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(belowZero((List[Long]())) == (false));\n assert(belowZero((List[Long](1l.toLong, 2l.toLong, -3l.toLong, 1l.toLong, 2l.toLong, -3l.toLong))) == (false));\n assert(belowZero((List[Long](1l.toLong, 2l.toLong, -4l.toLong, 5l.toLong, 6l.toLong))) == (true));\n assert(belowZero((List[Long](1l.toLong, -1l.toLong, 2l.toLong, -2l.toLong, 5l.toLong, -5l.toLong, 4l.toLong, -4l.toLong))) == (false));\n assert(belowZero((List[Long](1l.toLong, -1l.toLong, 2l.toLong, -2l.toLong, 5l.toLong, -5l.toLong, 4l.toLong, -5l.toLong))) == (true));\n assert(belowZero((List[Long](1l.toLong, -2l.toLong, 2l.toLong, -2l.toLong, 5l.toLong, -5l.toLong, 4l.toLong, -4l.toLong))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Find the shortest palindrome that begins with a supplied string.\n // Algorithm idea is simple:\n // - Find the longest postfix of supplied string that is a palindrome.\n // - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n // >>> make_palindrome('')\n // ''\n // >>> make_palindrome('cat')\n // 'catac'\n // >>> make_palindrome('cata')\n // 'catac'\n def makePalindrome(string : String) : String = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(makePalindrome((\"\")).equals((\"\")));\n assert(makePalindrome((\"x\")).equals((\"x\")));\n assert(makePalindrome((\"xyz\")).equals((\"xyzyx\")));\n assert(makePalindrome((\"xyx\")).equals((\"xyx\")));\n assert(makePalindrome((\"jerry\")).equals((\"jerryrrej\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a positive integer, obtain its roman numeral equivalent as a string,\n // and return it in lowercase.\n // Restrictions: 1 <= num <= 1000\n // Examples:\n // >>> int_to_mini_roman(19) == 'xix'\n // >>> int_to_mini_roman(152) == 'clii'\n // >>> int_to_mini_roman(426) == 'cdxxvi'\n def intToMiniRoman(number : Long) : String = {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(intToMiniRoman((19l)).equals((\"xix\")));\n assert(intToMiniRoman((152l)).equals((\"clii\")));\n assert(intToMiniRoman((251l)).equals((\"ccli\")));\n assert(intToMiniRoman((426l)).equals((\"cdxxvi\")));\n assert(intToMiniRoman((500l)).equals((\"d\")));\n assert(intToMiniRoman((1l)).equals((\"i\")));\n assert(intToMiniRoman((4l)).equals((\"iv\")));\n assert(intToMiniRoman((43l)).equals((\"xliii\")));\n assert(intToMiniRoman((90l)).equals((\"xc\")));\n assert(intToMiniRoman((94l)).equals((\"xciv\")));\n assert(intToMiniRoman((532l)).equals((\"dxxxii\")));\n assert(intToMiniRoman((900l)).equals((\"cm\")));\n assert(intToMiniRoman((994l)).equals((\"cmxciv\")));\n assert(intToMiniRoman((1000l)).equals((\"m\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - } -] \ No newline at end of file diff --git a/data/scala-remove.json b/data/scala-remove.json deleted file mode 100644 index 742f52fe412dd124b0b94cd91613612f0365169e..0000000000000000000000000000000000000000 --- a/data/scala-remove.json +++ /dev/null @@ -1,1886 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // For a given number n, find the largest number that divides n evenly, smaller than n\n def largestDivisor(n : Long) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(largestDivisor((3l)) == (1l));\n assert(largestDivisor((7l)) == (1l));\n assert(largestDivisor((10l)) == (5l));\n assert(largestDivisor((100l)) == (50l));\n assert(largestDivisor((49l)) == (7l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_47_median", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return median of elements in the list l.\n def median(l : List[Long]) : Float = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(median((List[Long](3l.toLong, 1l.toLong, 2l.toLong, 4l.toLong, 5l.toLong))) == 3l);\n assert(median((List[Long](-10l.toLong, 4l.toLong, 6l.toLong, 1000l.toLong, 10l.toLong, 20l.toLong))) == (8.0f));\n assert(median((List[Long](5l.toLong))) == 5l);\n assert(median((List[Long](6l.toLong, 5l.toLong))) == (5.5f));\n assert(median((List[Long](8l.toLong, 1l.toLong, 3l.toLong, 9l.toLong, 9l.toLong, 2l.toLong, 7l.toLong))) == 7l);\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return maximum element in the list.\n def maxElement(l : List[Long]) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(maxElement((List[Long](1l.toLong, 2l.toLong, 3l.toLong))) == (3l));\n assert(maxElement((List[Long](5l.toLong, 3l.toLong, -5l.toLong, 2l.toLong, -3l.toLong, 3l.toLong, 9l.toLong, 0l.toLong, 124l.toLong, 1l.toLong, -10l.toLong))) == (124l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function which returns the largest index of an element which\n // is not greater than or equal to the element immediately preceding it. If\n // no such element exists then return -1. The given array will not contain\n // duplicate values.\n // Examples:\n def canArrange(arr : List[Long]) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(canArrange((List[Long](1l.toLong, 2l.toLong, 4l.toLong, 3l.toLong, 5l.toLong))) == (3l));\n assert(canArrange((List[Long](1l.toLong, 2l.toLong, 4l.toLong, 5l.toLong))) == (-1l));\n assert(canArrange((List[Long](1l.toLong, 4l.toLong, 2l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong, 9l.toLong, 10l.toLong))) == (2l));\n assert(canArrange((List[Long](4l.toLong, 8l.toLong, 5l.toLong, 7l.toLong, 3l.toLong))) == (4l));\n assert(canArrange((List[Long]())) == (-1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function that returns True if the last character\n // of a given string is an alphabetical character and is not\n // a part of a word, and False otherwise.\n // Note: \"word\" is a group of characters separated by space.\n // Examples:\n def checkIfLastCharIsALetter(txt : String) : Boolean = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(checkIfLastCharIsALetter((\"apple\")) == (false));\n assert(checkIfLastCharIsALetter((\"apple pi e\")) == (true));\n assert(checkIfLastCharIsALetter((\"eeeee\")) == (false));\n assert(checkIfLastCharIsALetter((\"A\")) == (true));\n assert(checkIfLastCharIsALetter((\"Pumpkin pie \")) == (false));\n assert(checkIfLastCharIsALetter((\"Pumpkin pie 1\")) == (false));\n assert(checkIfLastCharIsALetter((\"\")) == (false));\n assert(checkIfLastCharIsALetter((\"eeeee e \")) == (false));\n assert(checkIfLastCharIsALetter((\"apple pie\")) == (false));\n assert(checkIfLastCharIsALetter((\"apple pi e \")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return true if a given number is prime, and false otherwise.\n def isPrime(n : Long) : Boolean = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(isPrime((6l)) == (false));\n assert(isPrime((101l)) == (true));\n assert(isPrime((11l)) == (true));\n assert(isPrime((13441l)) == (true));\n assert(isPrime((61l)) == (true));\n assert(isPrime((4l)) == (false));\n assert(isPrime((1l)) == (false));\n assert(isPrime((5l)) == (true));\n assert(isPrime((11l)) == (true));\n assert(isPrime((17l)) == (true));\n assert(isPrime((85l)) == (false));\n assert(isPrime((77l)) == (false));\n assert(isPrime((255379l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a list of positive integers x. return a sorted list of all \n // elements that hasn't any even digit.\n // Note: Returned list should be sorted in increasing order.\n // For example:\n def uniqueDigits(x : List[Long]) : List[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(uniqueDigits((List[Long](15l.toLong, 33l.toLong, 1422l.toLong, 1l.toLong))).equals((List[Long](1l.toLong, 15l.toLong, 33l.toLong))));\n assert(uniqueDigits((List[Long](152l.toLong, 323l.toLong, 1422l.toLong, 10l.toLong))).equals((List[Long]())));\n assert(uniqueDigits((List[Long](12345l.toLong, 2033l.toLong, 111l.toLong, 151l.toLong))).equals((List[Long](111l.toLong, 151l.toLong))));\n assert(uniqueDigits((List[Long](135l.toLong, 103l.toLong, 31l.toLong))).equals((List[Long](31l.toLong, 135l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Input are two strings a and b consisting only of 1s and 0s.\n // Perform binary XOR on these inputs and return result also as a string.\n def stringXor(a : String, b : String) : String = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(stringXor((\"111000\"), (\"101010\")).equals((\"010010\")));\n assert(stringXor((\"1\"), (\"1\")).equals((\"0\")));\n assert(stringXor((\"0101\"), (\"0000\")).equals((\"0101\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // sum_to_n is a function that sums numbers from 1 to n.\n def sumToN(n : Long) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sumToN((1l)) == (1l));\n assert(sumToN((6l)) == (21l));\n assert(sumToN((11l)) == (66l));\n assert(sumToN((30l)) == (465l));\n assert(sumToN((100l)) == (5050l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a list of numbers, return the sum of squares of the numbers\n // in the list that are odd. Ignore numbers that are negative or not integers.\n // If the input list is empty, return 0.\n def doubleTheDifference(lst : List[Float]) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(doubleTheDifference((List[Float]())) == (0l));\n assert(doubleTheDifference((List[Float](5.0f.toFloat, 4.0f.toFloat))) == (25l));\n assert(doubleTheDifference((List[Float](0.1f.toFloat, 0.2f.toFloat, 0.3f.toFloat))) == (0l));\n assert(doubleTheDifference((List[Float](-10.0f.toFloat, -20.0f.toFloat, -30.0f.toFloat))) == (0l));\n assert(doubleTheDifference((List[Float](-1.0f.toFloat, -2.0f.toFloat, 8.0f.toFloat))) == (0l));\n assert(doubleTheDifference((List[Float](0.2f.toFloat, 3.0f.toFloat, 5.0f.toFloat))) == (34l));\n assert(doubleTheDifference((List[Float](-9.0f.toFloat, -7.0f.toFloat, -5.0f.toFloat, -3.0f.toFloat, -1.0f.toFloat, 1.0f.toFloat, 3.0f.toFloat, 5.0f.toFloat, 7.0f.toFloat, 9.0f.toFloat))) == (165l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return length of given string\n def strlen(string : String) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(strlen((\"\")) == (0l));\n assert(strlen((\"x\")) == (1l));\n assert(strlen((\"asdasnakj\")) == (9l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You'll be given a string of words, and your task is to count the number\n // of boredoms. A boredom is a sentence that starts with the word \"I\".\n // Sentences are delimited by '.', '?' or '!'.\n // For example:\n def isBored(S : String) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(isBored((\"Hello world\")) == (0l));\n assert(isBored((\"Is the sky blue?\")) == (0l));\n assert(isBored((\"I love It !\")) == (1l));\n assert(isBored((\"bIt\")) == (0l));\n assert(isBored((\"I feel good today. I will be productive. will kill It\")) == (2l));\n assert(isBored((\"You and I are going for a walk\")) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function vowels_count which takes a string representing\n // a word as input and returns the number of vowels in the string.\n // Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n // vowel, but only when it is at the end of the given word.\n // Example:\n def vowelsCount(s : String) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(vowelsCount((\"abcde\")) == (2l));\n assert(vowelsCount((\"Alone\")) == (3l));\n assert(vowelsCount((\"key\")) == (2l));\n assert(vowelsCount((\"bye\")) == (1l));\n assert(vowelsCount((\"keY\")) == (2l));\n assert(vowelsCount((\"bYe\")) == (1l));\n assert(vowelsCount((\"ACEDY\")) == (3l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return n-th Fibonacci number.\n def fib(n : Long) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(fib((10l)) == (55l));\n assert(fib((1l)) == (1l));\n assert(fib((8l)) == (21l));\n assert(fib((11l)) == (89l));\n assert(fib((12l)) == (144l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Your task is to implement a function that will simplify the expression\n // x * n. The function returns True if x * n evaluates to a whole number and False\n // otherwise. Both x and n, are string representation of a fraction, and have the following format,\n // / where both numerator and denominator are positive whole numbers.\n // You can assume that x, and n are valid fractions, and do not have zero as denominator.\n def simplify(x : String, n : String) : Boolean = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(simplify((\"1/5\"), (\"5/1\")) == (true));\n assert(simplify((\"1/6\"), (\"2/1\")) == (false));\n assert(simplify((\"5/1\"), (\"3/1\")) == (true));\n assert(simplify((\"7/10\"), (\"10/2\")) == (false));\n assert(simplify((\"2/10\"), (\"50/10\")) == (true));\n assert(simplify((\"7/2\"), (\"4/2\")) == (true));\n assert(simplify((\"11/6\"), (\"6/1\")) == (true));\n assert(simplify((\"2/3\"), (\"5/2\")) == (false));\n assert(simplify((\"5/2\"), (\"3/5\")) == (false));\n assert(simplify((\"2/4\"), (\"8/4\")) == (true));\n assert(simplify((\"2/4\"), (\"4/2\")) == (true));\n assert(simplify((\"1/5\"), (\"5/1\")) == (true));\n assert(simplify((\"1/5\"), (\"1/5\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a string s, count the number of uppercase vowels in even indices.\n // For example:\n def countUpper(s : String) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(countUpper((\"aBCdEf\")) == (1l));\n assert(countUpper((\"abcdefg\")) == (0l));\n assert(countUpper((\"dBBE\")) == (0l));\n assert(countUpper((\"B\")) == (0l));\n assert(countUpper((\"U\")) == (1l));\n assert(countUpper((\"\")) == (0l));\n assert(countUpper((\"EEEE\")) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a rectangular grid of wells. Each row represents a single well,\n // and each 1 in a row represents a single unit of water.\n // Each well has a corresponding bucket that can be used to extract water from it, \n // and all buckets have the same capacity.\n // Your task is to use the buckets to empty the wells.\n // Output the number of times you need to lower the buckets.\n // Example 1:\n // Example 2:\n // Example 3:\n // Constraints:\n // * all wells have the same length\n // * 1 <= grid.length <= 10^2\n // * 1 <= grid[:,1].length <= 10^2\n // * grid[i][j] -> 0 | 1\n // * 1 <= capacity <= 10\n def maxFill(grid : List[List[Long]], capacity : Long) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(maxFill((List[List[Long]](List[Long](0l.toLong, 0l.toLong, 1l.toLong, 0l.toLong), List[Long](0l.toLong, 1l.toLong, 0l.toLong, 0l.toLong), List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))), (1l)) == (6l));\n assert(maxFill((List[List[Long]](List[Long](0l.toLong, 0l.toLong, 1l.toLong, 1l.toLong), List[Long](0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong), List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong), List[Long](0l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))), (2l)) == (5l));\n assert(maxFill((List[List[Long]](List[Long](0l.toLong, 0l.toLong, 0l.toLong), List[Long](0l.toLong, 0l.toLong, 0l.toLong))), (5l)) == (0l));\n assert(maxFill((List[List[Long]](List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong), List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))), (2l)) == (4l));\n assert(maxFill((List[List[Long]](List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong), List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))), (9l)) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given an array arr of integers and a positive integer k, return a sorted list \n // of length k with the maximum k numbers in arr.\n // Example 1:\n // Example 2:\n // Example 3:\n // Note:\n // 1. The length of the array will be in the range of [1, 1000].\n // 2. The elements in the array will be in the range of [-1000, 1000].\n // 3. 0 <= k <= len(arr)\n def maximum(arr : List[Long], k : Long) : List[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(maximum((List[Long](-3l.toLong, -4l.toLong, 5l.toLong)), (3l)).equals((List[Long](-4l.toLong, -3l.toLong, 5l.toLong))));\n assert(maximum((List[Long](4l.toLong, -4l.toLong, 4l.toLong)), (2l)).equals((List[Long](4l.toLong, 4l.toLong))));\n assert(maximum((List[Long](-3l.toLong, 2l.toLong, 1l.toLong, 2l.toLong, -1l.toLong, -2l.toLong, 1l.toLong)), (1l)).equals((List[Long](2l.toLong))));\n assert(maximum((List[Long](123l.toLong, -123l.toLong, 20l.toLong, 0l.toLong, 1l.toLong, 2l.toLong, -3l.toLong)), (3l)).equals((List[Long](2l.toLong, 20l.toLong, 123l.toLong))));\n assert(maximum((List[Long](-123l.toLong, 20l.toLong, 0l.toLong, 1l.toLong, 2l.toLong, -3l.toLong)), (4l)).equals((List[Long](0l.toLong, 1l.toLong, 2l.toLong, 20l.toLong))));\n assert(maximum((List[Long](5l.toLong, 15l.toLong, 0l.toLong, 3l.toLong, -13l.toLong, -8l.toLong, 0l.toLong)), (7l)).equals((List[Long](-13l.toLong, -8l.toLong, 0l.toLong, 0l.toLong, 3l.toLong, 5l.toLong, 15l.toLong))));\n assert(maximum((List[Long](-1l.toLong, 0l.toLong, 2l.toLong, 5l.toLong, 3l.toLong, -10l.toLong)), (2l)).equals((List[Long](3l.toLong, 5l.toLong))));\n assert(maximum((List[Long](1l.toLong, 0l.toLong, 5l.toLong, -7l.toLong)), (1l)).equals((List[Long](5l.toLong))));\n assert(maximum((List[Long](4l.toLong, -4l.toLong)), (2l)).equals((List[Long](-4l.toLong, 4l.toLong))));\n assert(maximum((List[Long](-10l.toLong, 10l.toLong)), (2l)).equals((List[Long](-10l.toLong, 10l.toLong))));\n assert(maximum((List[Long](1l.toLong, 2l.toLong, 3l.toLong, -23l.toLong, 243l.toLong, -400l.toLong, 0l.toLong)), (0l)).equals((List[Long]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that takes a message, and encodes in such a \n // way that it swaps case of all letters, replaces all vowels in \n // the message with the letter that appears 2 places ahead of that \n // vowel in the english alphabet. \n // Assume only letters. \n // Examples:\n def encode(message : String) : String = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(encode((\"TEST\")).equals((\"tgst\")));\n assert(encode((\"Mudasir\")).equals((\"mWDCSKR\")));\n assert(encode((\"YES\")).equals((\"ygs\")));\n assert(encode((\"This is a message\")).equals((\"tHKS KS C MGSSCGG\")));\n assert(encode((\"I DoNt KnOw WhAt tO WrItE\")).equals((\"k dQnT kNqW wHcT Tq wRkTg\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // remove_vowels is a function that takes string and returns string without vowels.\n def removeVowels(text : String) : String = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(removeVowels((\"\")).equals((\"\")));\n assert(removeVowels((\"abcdef\\nghijklm\")).equals((\"bcdf\\nghjklm\")));\n assert(removeVowels((\"fedcba\")).equals((\"fdcb\")));\n assert(removeVowels((\"eeeee\")).equals((\"\")));\n assert(removeVowels((\"acBAA\")).equals((\"cB\")));\n assert(removeVowels((\"EcBOO\")).equals((\"cB\")));\n assert(removeVowels((\"ybcd\")).equals((\"ybcd\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return only positive numbers in the list.\n def getPositive(l : List[Long]) : List[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(getPositive((List[Long](-1l.toLong, -2l.toLong, 4l.toLong, 5l.toLong, 6l.toLong))).equals((List[Long](4l.toLong, 5l.toLong, 6l.toLong))));\n assert(getPositive((List[Long](5l.toLong, 3l.toLong, -5l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 9l.toLong, 0l.toLong, 123l.toLong, 1l.toLong, -10l.toLong))).equals((List[Long](5l.toLong, 3l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 9l.toLong, 123l.toLong, 1l.toLong))));\n assert(getPositive((List[Long](-1l.toLong, -2l.toLong))).equals((List[Long]())));\n assert(getPositive((List[Long]())).equals((List[Long]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n def stringSequence(n : Long) : String = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(stringSequence((0l)).equals((\"0\")));\n assert(stringSequence((3l)).equals((\"0 1 2 3\")));\n assert(stringSequence((10l)).equals((\"0 1 2 3 4 5 6 7 8 9 10\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a positive integer n, you have to make a pile of n levels of stones.\n // The first level has n stones.\n // The number of stones in the next level is:\n // - the next odd number if n is odd.\n // - the next even number if n is even.\n // Return the number of stones in each level in a list, where element at index\n // i represents the number of stones in the level (i+1).\n // Examples:\n def makeAPile(n : Long) : List[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(makeAPile((3l)).equals((List[Long](3l.toLong, 5l.toLong, 7l.toLong))));\n assert(makeAPile((4l)).equals((List[Long](4l.toLong, 6l.toLong, 8l.toLong, 10l.toLong))));\n assert(makeAPile((5l)).equals((List[Long](5l.toLong, 7l.toLong, 9l.toLong, 11l.toLong, 13l.toLong))));\n assert(makeAPile((6l)).equals((List[Long](6l.toLong, 8l.toLong, 10l.toLong, 12l.toLong, 14l.toLong, 16l.toLong))));\n assert(makeAPile((8l)).equals((List[Long](8l.toLong, 10l.toLong, 12l.toLong, 14l.toLong, 16l.toLong, 18l.toLong, 20l.toLong, 22l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Task\n // 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\n // then check if the result string is palindrome.\n // A string is called palindrome if it reads the same backward as forward.\n // You should return a tuple containing the result string and True/False for the check.\n // Example\n def reverseDelete(s : String, c : String) : Tuple2[String, Boolean] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(reverseDelete((\"abcde\"), (\"ae\")).equals(((\"bcd\", false))));\n assert(reverseDelete((\"abcdef\"), (\"b\")).equals(((\"acdef\", false))));\n assert(reverseDelete((\"abcdedcba\"), (\"ab\")).equals(((\"cdedc\", true))));\n assert(reverseDelete((\"dwik\"), (\"w\")).equals(((\"dik\", false))));\n assert(reverseDelete((\"a\"), (\"a\")).equals(((\"\", true))));\n assert(reverseDelete((\"abcdedcba\"), (\"\")).equals(((\"abcdedcba\", true))));\n assert(reverseDelete((\"abcdedcba\"), (\"v\")).equals(((\"abcdedcba\", true))));\n assert(reverseDelete((\"vabba\"), (\"v\")).equals(((\"abba\", true))));\n assert(reverseDelete((\"mamma\"), (\"mia\")).equals(((\"\", true))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n def flipCase(string : String) : String = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(flipCase((\"\")).equals((\"\")));\n assert(flipCase((\"Hello!\")).equals((\"hELLO!\")));\n assert(flipCase((\"These violent delights have violent ends\")).equals((\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a string s.\n // if s[i] is a letter, reverse its case from lower to upper or vise versa, \n // otherwise keep it as it is.\n // If the string contains no letters, reverse the string.\n // The function should return the resulted string.\n // Examples\n def solve(s : String) : String = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(solve((\"AsDf\")).equals((\"aSdF\")));\n assert(solve((\"1234\")).equals((\"4321\")));\n assert(solve((\"ab\")).equals((\"AB\")));\n assert(solve((\"#a@C\")).equals((\"#A@c\")));\n assert(solve((\"#AsdfW^45\")).equals((\"#aSDFw^45\")));\n assert(solve((\"#6@2\")).equals((\"2@6#\")));\n assert(solve((\"#$a^D\")).equals((\"#$A^d\")));\n assert(solve((\"#ccc\")).equals((\"#CCC\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Filter an input list of strings only for ones that start with a given prefix.\n def filterByPrefix(strings : List[String], prefix : String) : List[String] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(filterByPrefix((List[String]()), (\"john\")).equals((List[String]())));\n assert(filterByPrefix((List[String](\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\")), (\"xxx\")).equals((List[String](\"xxx\", \"xxxAAA\", \"xxx\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // This function takes two positive numbers x and y and returns the\n // biggest even integer number that is in the range [x, y] inclusive. If \n // there's no such number, then the function should return -1.\n // For example:\n def chooseNum(x : Long, y : Long) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(chooseNum((12l), (15l)) == (14l));\n assert(chooseNum((13l), (12l)) == (-1l));\n assert(chooseNum((33l), (12354l)) == (12354l));\n assert(chooseNum((5234l), (5233l)) == (-1l));\n assert(chooseNum((6l), (29l)) == (28l));\n assert(chooseNum((27l), (10l)) == (-1l));\n assert(chooseNum((7l), (7l)) == (-1l));\n assert(chooseNum((546l), (546l)) == (546l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a string representing a sentence,\n // the sentence contains some words separated by a space,\n // and you have to return a string that contains the words from the original sentence,\n // whose lengths are prime numbers,\n // the order of the words in the new string should be the same as the original one.\n // Example 1:\n // Example 2:\n // Constraints:\n // * 1 <= len(sentence) <= 100\n // * sentence contains only letters\n def wordsInSentence(sentence : String) : String = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(wordsInSentence((\"This is a test\")).equals((\"is\")));\n assert(wordsInSentence((\"lets go for swimming\")).equals((\"go for\")));\n assert(wordsInSentence((\"there is no place available here\")).equals((\"there is no place\")));\n assert(wordsInSentence((\"Hi I am Hussein\")).equals((\"Hi am Hussein\")));\n assert(wordsInSentence((\"go for it\")).equals((\"go for it\")));\n assert(wordsInSentence((\"here\")).equals((\"\")));\n assert(wordsInSentence((\"here is\")).equals((\"is\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n def intersperse(numbers : List[Long], delimeter : Long) : List[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(intersperse((List[Long]()), (7l)).equals((List[Long]())));\n assert(intersperse((List[Long](5l.toLong, 6l.toLong, 3l.toLong, 2l.toLong)), (8l)).equals((List[Long](5l.toLong, 8l.toLong, 6l.toLong, 8l.toLong, 3l.toLong, 8l.toLong, 2l.toLong))));\n assert(intersperse((List[Long](2l.toLong, 2l.toLong, 2l.toLong)), (2l)).equals((List[Long](2l.toLong, 2l.toLong, 2l.toLong, 2l.toLong, 2l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Your task is to write a function that returns true if a number x is a simple\n // power of n and false in other cases.\n // x is a simple power of n if n**int=x\n // For example:\n def isSimplePower(x : Long, n : Long) : Boolean = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(isSimplePower((16l), (2l)) == (true));\n assert(isSimplePower((143214l), (16l)) == (false));\n assert(isSimplePower((4l), (2l)) == (true));\n assert(isSimplePower((9l), (3l)) == (true));\n assert(isSimplePower((16l), (4l)) == (true));\n assert(isSimplePower((24l), (2l)) == (false));\n assert(isSimplePower((128l), (4l)) == (false));\n assert(isSimplePower((12l), (6l)) == (false));\n assert(isSimplePower((1l), (1l)) == (true));\n assert(isSimplePower((1l), (12l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that returns true if the given number is the multiplication of 3 prime numbers\n // and false otherwise.\n // Knowing that (a) is less then 100. \n // Example:\n // 30 = 2 * 3 * 5\n def isMultiplyPrime(a : Long) : Boolean = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(isMultiplyPrime((5l)) == (false));\n assert(isMultiplyPrime((30l)) == (true));\n assert(isMultiplyPrime((8l)) == (true));\n assert(isMultiplyPrime((10l)) == (false));\n assert(isMultiplyPrime((125l)) == (true));\n assert(isMultiplyPrime((105l)) == (true));\n assert(isMultiplyPrime((126l)) == (false));\n assert(isMultiplyPrime((729l)) == (false));\n assert(isMultiplyPrime((891l)) == (false));\n assert(isMultiplyPrime((1001l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given the lengths of the three sides of a triangle. Return True if the three\n // sides form a right-angled triangle, False otherwise.\n // A right-angled triangle is a triangle in which one angle is right angle or \n // 90 degree.\n // Example:\n def rightAngleTriangle(a : Long, b : Long, c : Long) : Boolean = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(rightAngleTriangle((3l), (4l), (5l)) == (true));\n assert(rightAngleTriangle((1l), (2l), (3l)) == (false));\n assert(rightAngleTriangle((10l), (6l), (8l)) == (true));\n assert(rightAngleTriangle((2l), (2l), (2l)) == (false));\n assert(rightAngleTriangle((7l), (24l), (25l)) == (true));\n assert(rightAngleTriangle((10l), (5l), (7l)) == (false));\n assert(rightAngleTriangle((5l), (12l), (13l)) == (true));\n assert(rightAngleTriangle((15l), (8l), (17l)) == (true));\n assert(rightAngleTriangle((48l), (55l), (73l)) == (true));\n assert(rightAngleTriangle((1l), (1l), (1l)) == (false));\n assert(rightAngleTriangle((2l), (2l), (10l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function that takes 3 numbers.\n // Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n // Returns false in any other cases.\n // Examples\n def anyInt(x : Float, y : Float, z : Float) : Boolean = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(anyInt(2l, 3l, 1l) == (true));\n assert(anyInt((2.5f), 2l, 3l) == (false));\n assert(anyInt((1.5f), 5l, (3.5f)) == (false));\n assert(anyInt(2l, 6l, 2l) == (false));\n assert(anyInt(4l, 2l, 2l) == (true));\n assert(anyInt((2.2f), (2.2f), (2.2f)) == (false));\n assert(anyInt(-4l, 6l, 2l) == (true));\n assert(anyInt(2l, 1l, 1l) == (true));\n assert(anyInt(3l, 4l, 7l) == (true));\n assert(anyInt((3.0f), 4l, 7l) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // This function takes a list l and returns a list l' such that\n // l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n // to the values of the corresponding indicies of l, but sorted.\n def sortThird(l : List[Long]) : List[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sortThird((List[Long](5l.toLong, 6l.toLong, 3l.toLong, 4l.toLong, 8l.toLong, 9l.toLong, 2l.toLong))).equals((List[Long](2l.toLong, 6l.toLong, 3l.toLong, 4l.toLong, 8l.toLong, 9l.toLong, 5l.toLong))));\n assert(sortThird((List[Long](5l.toLong, 8l.toLong, 3l.toLong, 4l.toLong, 6l.toLong, 9l.toLong, 2l.toLong))).equals((List[Long](2l.toLong, 8l.toLong, 3l.toLong, 4l.toLong, 6l.toLong, 9l.toLong, 5l.toLong))));\n assert(sortThird((List[Long](5l.toLong, 6l.toLong, 9l.toLong, 4l.toLong, 8l.toLong, 3l.toLong, 2l.toLong))).equals((List[Long](2l.toLong, 6l.toLong, 9l.toLong, 4l.toLong, 8l.toLong, 3l.toLong, 5l.toLong))));\n assert(sortThird((List[Long](5l.toLong, 6l.toLong, 3l.toLong, 4l.toLong, 8l.toLong, 9l.toLong, 2l.toLong, 1l.toLong))).equals((List[Long](2l.toLong, 6l.toLong, 3l.toLong, 4l.toLong, 8l.toLong, 9l.toLong, 5l.toLong, 1l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_53_add", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Add two numbers x and y\n def add(x : Long, y : Long) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(add((0l), (1l)) == (1l));\n assert(add((1l), (0l)) == (1l));\n assert(add((2l), (3l)) == (5l));\n assert(add((5l), (7l)) == (12l));\n assert(add((7l), (5l)) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_69_search", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n // zero, and has a frequency greater than or equal to the value of the integer itself. \n // The frequency of an integer is the number of times it appears in the list.\n // If no such a value exist, return -1.\n // Examples:\n def search(lst : List[Long]) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(search((List[Long](5l.toLong, 5l.toLong, 5l.toLong, 5l.toLong, 1l.toLong))) == (1l));\n assert(search((List[Long](4l.toLong, 1l.toLong, 4l.toLong, 1l.toLong, 4l.toLong, 4l.toLong))) == (4l));\n assert(search((List[Long](3l.toLong, 3l.toLong))) == (-1l));\n assert(search((List[Long](8l.toLong, 8l.toLong, 8l.toLong, 8l.toLong, 8l.toLong, 8l.toLong, 8l.toLong, 8l.toLong))) == (8l));\n assert(search((List[Long](2l.toLong, 3l.toLong, 3l.toLong, 2l.toLong, 2l.toLong))) == (2l));\n assert(search((List[Long](2l.toLong, 7l.toLong, 8l.toLong, 8l.toLong, 4l.toLong, 8l.toLong, 7l.toLong, 3l.toLong, 9l.toLong, 6l.toLong, 5l.toLong, 10l.toLong, 4l.toLong, 3l.toLong, 6l.toLong, 7l.toLong, 1l.toLong, 7l.toLong, 4l.toLong, 10l.toLong, 8l.toLong, 1l.toLong))) == (1l));\n assert(search((List[Long](3l.toLong, 2l.toLong, 8l.toLong, 2l.toLong))) == (2l));\n assert(search((List[Long](6l.toLong, 7l.toLong, 1l.toLong, 8l.toLong, 8l.toLong, 10l.toLong, 5l.toLong, 8l.toLong, 5l.toLong, 3l.toLong, 10l.toLong))) == (1l));\n assert(search((List[Long](8l.toLong, 8l.toLong, 3l.toLong, 6l.toLong, 5l.toLong, 6l.toLong, 4l.toLong))) == (-1l));\n assert(search((List[Long](6l.toLong, 9l.toLong, 6l.toLong, 7l.toLong, 1l.toLong, 4l.toLong, 7l.toLong, 1l.toLong, 8l.toLong, 8l.toLong, 9l.toLong, 8l.toLong, 10l.toLong, 10l.toLong, 8l.toLong, 4l.toLong, 10l.toLong, 4l.toLong, 10l.toLong, 1l.toLong, 2l.toLong, 9l.toLong, 5l.toLong, 7l.toLong, 9l.toLong))) == (1l));\n assert(search((List[Long](1l.toLong, 9l.toLong, 10l.toLong, 1l.toLong, 3l.toLong))) == (1l));\n assert(search((List[Long](6l.toLong, 9l.toLong, 7l.toLong, 5l.toLong, 8l.toLong, 7l.toLong, 5l.toLong, 3l.toLong, 7l.toLong, 5l.toLong, 10l.toLong, 10l.toLong, 3l.toLong, 6l.toLong, 10l.toLong, 2l.toLong, 8l.toLong, 6l.toLong, 5l.toLong, 4l.toLong, 9l.toLong, 5l.toLong, 3l.toLong, 10l.toLong))) == (5l));\n assert(search((List[Long](1l.toLong))) == (1l));\n assert(search((List[Long](8l.toLong, 8l.toLong, 10l.toLong, 6l.toLong, 4l.toLong, 3l.toLong, 5l.toLong, 8l.toLong, 2l.toLong, 4l.toLong, 2l.toLong, 8l.toLong, 4l.toLong, 6l.toLong, 10l.toLong, 4l.toLong, 2l.toLong, 1l.toLong, 10l.toLong, 2l.toLong, 1l.toLong, 1l.toLong, 5l.toLong))) == (4l));\n assert(search((List[Long](2l.toLong, 10l.toLong, 4l.toLong, 8l.toLong, 2l.toLong, 10l.toLong, 5l.toLong, 1l.toLong, 2l.toLong, 9l.toLong, 5l.toLong, 5l.toLong, 6l.toLong, 3l.toLong, 8l.toLong, 6l.toLong, 4l.toLong, 10l.toLong))) == (2l));\n assert(search((List[Long](1l.toLong, 6l.toLong, 10l.toLong, 1l.toLong, 6l.toLong, 9l.toLong, 10l.toLong, 8l.toLong, 6l.toLong, 8l.toLong, 7l.toLong, 3l.toLong))) == (1l));\n assert(search((List[Long](9l.toLong, 2l.toLong, 4l.toLong, 1l.toLong, 5l.toLong, 1l.toLong, 5l.toLong, 2l.toLong, 5l.toLong, 7l.toLong, 7l.toLong, 7l.toLong, 3l.toLong, 10l.toLong, 1l.toLong, 5l.toLong, 4l.toLong, 2l.toLong, 8l.toLong, 4l.toLong, 1l.toLong, 9l.toLong, 10l.toLong, 7l.toLong, 10l.toLong, 2l.toLong, 8l.toLong, 10l.toLong, 9l.toLong, 4l.toLong))) == (4l));\n assert(search((List[Long](2l.toLong, 6l.toLong, 4l.toLong, 2l.toLong, 8l.toLong, 7l.toLong, 5l.toLong, 6l.toLong, 4l.toLong, 10l.toLong, 4l.toLong, 6l.toLong, 3l.toLong, 7l.toLong, 8l.toLong, 8l.toLong, 3l.toLong, 1l.toLong, 4l.toLong, 2l.toLong, 2l.toLong, 10l.toLong, 7l.toLong))) == (4l));\n assert(search((List[Long](9l.toLong, 8l.toLong, 6l.toLong, 10l.toLong, 2l.toLong, 6l.toLong, 10l.toLong, 2l.toLong, 7l.toLong, 8l.toLong, 10l.toLong, 3l.toLong, 8l.toLong, 2l.toLong, 6l.toLong, 2l.toLong, 3l.toLong, 1l.toLong))) == (2l));\n assert(search((List[Long](5l.toLong, 5l.toLong, 3l.toLong, 9l.toLong, 5l.toLong, 6l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 5l.toLong, 6l.toLong, 10l.toLong, 10l.toLong, 6l.toLong, 8l.toLong, 4l.toLong, 10l.toLong, 7l.toLong, 7l.toLong, 10l.toLong, 8l.toLong))) == (-1l));\n assert(search((List[Long](10l.toLong))) == (-1l));\n assert(search((List[Long](9l.toLong, 7l.toLong, 7l.toLong, 2l.toLong, 4l.toLong, 7l.toLong, 2l.toLong, 10l.toLong, 9l.toLong, 7l.toLong, 5l.toLong, 7l.toLong, 2l.toLong))) == (2l));\n assert(search((List[Long](5l.toLong, 4l.toLong, 10l.toLong, 2l.toLong, 1l.toLong, 1l.toLong, 10l.toLong, 3l.toLong, 6l.toLong, 1l.toLong, 8l.toLong))) == (1l));\n assert(search((List[Long](7l.toLong, 9l.toLong, 9l.toLong, 9l.toLong, 3l.toLong, 4l.toLong, 1l.toLong, 5l.toLong, 9l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 1l.toLong, 10l.toLong, 7l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 6l.toLong, 7l.toLong, 7l.toLong, 6l.toLong))) == (1l));\n assert(search((List[Long](3l.toLong, 10l.toLong, 10l.toLong, 9l.toLong, 2l.toLong))) == (-1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that takes a string and returns True if the string\n // length is a prime number or False otherwise\n // Examples\n def primeLength(string : String) : Boolean = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(primeLength((\"Hello\")) == (true));\n assert(primeLength((\"abcdcba\")) == (true));\n assert(primeLength((\"kittens\")) == (true));\n assert(primeLength((\"orange\")) == (false));\n assert(primeLength((\"wow\")) == (true));\n assert(primeLength((\"world\")) == (true));\n assert(primeLength((\"MadaM\")) == (true));\n assert(primeLength((\"Wow\")) == (true));\n assert(primeLength((\"\")) == (false));\n assert(primeLength((\"HI\")) == (true));\n assert(primeLength((\"go\")) == (true));\n assert(primeLength((\"gogo\")) == (false));\n assert(primeLength((\"aaaaaaaaaaaaaaa\")) == (false));\n assert(primeLength((\"Madam\")) == (true));\n assert(primeLength((\"M\")) == (false));\n assert(primeLength((\"0\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_58_common", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return sorted unique common elements for two lists.\n def common(l1 : List[Long], l2 : List[Long]) : List[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(common((List[Long](1l.toLong, 4l.toLong, 3l.toLong, 34l.toLong, 653l.toLong, 2l.toLong, 5l.toLong)), (List[Long](5l.toLong, 7l.toLong, 1l.toLong, 5l.toLong, 9l.toLong, 653l.toLong, 121l.toLong))).equals((List[Long](1l.toLong, 5l.toLong, 653l.toLong))));\n assert(common((List[Long](5l.toLong, 3l.toLong, 2l.toLong, 8l.toLong)), (List[Long](3l.toLong, 2l.toLong))).equals((List[Long](2l.toLong, 3l.toLong))));\n assert(common((List[Long](4l.toLong, 3l.toLong, 2l.toLong, 8l.toLong)), (List[Long](3l.toLong, 2l.toLong, 4l.toLong))).equals((List[Long](2l.toLong, 3l.toLong, 4l.toLong))));\n assert(common((List[Long](4l.toLong, 3l.toLong, 2l.toLong, 8l.toLong)), (List[Long]())).equals((List[Long]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // The Brazilian factorial is defined as:\n // brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n // where n > 0\n // For example:\n // The function will receive an integer as input and should return the special\n // factorial of this integer.\n def specialFactorial(n : Long) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(specialFactorial((4l)) == (288l));\n assert(specialFactorial((5l)) == (34560l));\n assert(specialFactorial((7l)) == (125411328000l));\n assert(specialFactorial((1l)) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // In this problem, you will implement a function that takes two lists of numbers,\n // and determines whether it is possible to perform an exchange of elements\n // between them to make lst1 a list of only even numbers.\n // There is no limit on the number of exchanged elements between lst1 and lst2.\n // If it is possible to exchange elements between the lst1 and lst2 to make\n // all the elements of lst1 to be even, return \"YES\".\n // Otherwise, return \"NO\".\n // For example:\n // It is assumed that the input lists will be non-empty.\n def exchange(lst1 : List[Long], lst2 : List[Long]) : String = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(exchange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong)), (List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((\"YES\")));\n assert(exchange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong)), (List[Long](1l.toLong, 5l.toLong, 3l.toLong, 4l.toLong))).equals((\"NO\")));\n assert(exchange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong)), (List[Long](2l.toLong, 1l.toLong, 4l.toLong, 3l.toLong))).equals((\"YES\")));\n assert(exchange((List[Long](5l.toLong, 7l.toLong, 3l.toLong)), (List[Long](2l.toLong, 6l.toLong, 4l.toLong))).equals((\"YES\")));\n assert(exchange((List[Long](5l.toLong, 7l.toLong, 3l.toLong)), (List[Long](2l.toLong, 6l.toLong, 3l.toLong))).equals((\"NO\")));\n assert(exchange((List[Long](3l.toLong, 2l.toLong, 6l.toLong, 1l.toLong, 8l.toLong, 9l.toLong)), (List[Long](3l.toLong, 5l.toLong, 5l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))).equals((\"NO\")));\n assert(exchange((List[Long](100l.toLong, 200l.toLong)), (List[Long](200l.toLong, 200l.toLong))).equals((\"YES\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a non-empty array of integers arr and an integer k, return\n // the sum of the elements with at most two digits from the first k elements of arr.\n // Example:\n // Constraints:\n // 1. 1 <= len(arr) <= 100\n // 2. 1 <= k <= len(arr)\n def addElements(arr : List[Long], k : Long) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(addElements((List[Long](1l.toLong, -2l.toLong, -3l.toLong, 41l.toLong, 57l.toLong, 76l.toLong, 87l.toLong, 88l.toLong, 99l.toLong)), (3l)) == (-4l));\n assert(addElements((List[Long](111l.toLong, 121l.toLong, 3l.toLong, 4000l.toLong, 5l.toLong, 6l.toLong)), (2l)) == (0l));\n assert(addElements((List[Long](11l.toLong, 21l.toLong, 3l.toLong, 90l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong, 9l.toLong)), (4l)) == (125l));\n assert(addElements((List[Long](111l.toLong, 21l.toLong, 3l.toLong, 4000l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong, 9l.toLong)), (4l)) == (24l));\n assert(addElements((List[Long](1l.toLong)), (1l)) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // A simple program which should return the value of x if n is \n // a prime number and should return the value of y otherwise.\n // Examples:\n def xOrY(n : Long, x : Long, y : Long) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(xOrY((7l), (34l), (12l)) == (34l));\n assert(xOrY((15l), (8l), (5l)) == (5l));\n assert(xOrY((3l), (33l), (5212l)) == (33l));\n assert(xOrY((1259l), (3l), (52l)) == (3l));\n assert(xOrY((7919l), (-1l), (12l)) == (-1l));\n assert(xOrY((3609l), (1245l), (583l)) == (583l));\n assert(xOrY((91l), (56l), (129l)) == (129l));\n assert(xOrY((6l), (34l), (1234l)) == (1234l));\n assert(xOrY((1l), (2l), (0l)) == (0l));\n assert(xOrY((2l), (2l), (0l)) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given length of a side and high return area for a triangle.\n def triangleArea(a : Long, h : Long) : Float = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(triangleArea((5l), (3l)) == (7.5f));\n assert(triangleArea((2l), (2l)) == (2.0f));\n assert(triangleArea((10l), (8l)) == (40.0f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n // the last couple centuries. However, what people don't know is Tribonacci sequence.\n // Tribonacci sequence is defined by the recurrence:\n // tri(1) = 3\n // tri(n) = 1 + n / 2, if n is even.\n // tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n // For example:\n // tri(2) = 1 + (2 / 2) = 2\n // tri(4) = 3\n // tri(3) = tri(2) + tri(1) + tri(4)\n // = 2 + 3 + 3 = 8 \n // You are given a non-negative integer number n, you have to a return a list of the \n // first n + 1 numbers of the Tribonacci sequence.\n // Examples:\n def tri(n : Long) : List[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(tri((3l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong))));\n assert(tri((4l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 3l.toLong))));\n assert(tri((5l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 3l.toLong, 15l.toLong))));\n assert(tri((6l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 3l.toLong, 15l.toLong, 4l.toLong))));\n assert(tri((7l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 3l.toLong, 15l.toLong, 4l.toLong, 24l.toLong))));\n assert(tri((8l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 3l.toLong, 15l.toLong, 4l.toLong, 24l.toLong, 5l.toLong))));\n assert(tri((9l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 3l.toLong, 15l.toLong, 4l.toLong, 24l.toLong, 5l.toLong, 35l.toLong))));\n assert(tri((20l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 3l.toLong, 15l.toLong, 4l.toLong, 24l.toLong, 5l.toLong, 35l.toLong, 6l.toLong, 48l.toLong, 7l.toLong, 63l.toLong, 8l.toLong, 80l.toLong, 9l.toLong, 99l.toLong, 10l.toLong, 120l.toLong, 11l.toLong))));\n assert(tri((0l)).equals((List[Long](1l.toLong))));\n assert(tri((1l)).equals((List[Long](1l.toLong, 3l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a list of two strings, both strings consist of open\n // parentheses '(' or close parentheses ')' only.\n // Your job is to check if it is possible to concatenate the two strings in\n // some order, that the resulting string will be good.\n // A string S is considered to be good if and only if all parentheses in S\n // are balanced. For example: the string '(())()' is good, while the string\n // '())' is not.\n // Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n // Examples:\n def matchParens(lst : List[String]) : String = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(matchParens((List[String](\"()(\", \")\"))).equals((\"Yes\")));\n assert(matchParens((List[String](\")\", \")\"))).equals((\"No\")));\n assert(matchParens((List[String](\"(()(())\", \"())())\"))).equals((\"No\")));\n assert(matchParens((List[String](\")())\", \"(()()(\"))).equals((\"Yes\")));\n assert(matchParens((List[String](\"(())))\", \"(()())((\"))).equals((\"Yes\")));\n assert(matchParens((List[String](\"()\", \"())\"))).equals((\"No\")));\n assert(matchParens((List[String](\"(()(\", \"()))()\"))).equals((\"Yes\")));\n assert(matchParens((List[String](\"((((\", \"((())\"))).equals((\"No\")));\n assert(matchParens((List[String](\")(()\", \"(()(\"))).equals((\"No\")));\n assert(matchParens((List[String](\")(\", \")(\"))).equals((\"No\")));\n assert(matchParens((List[String](\"(\", \")\"))).equals((\"Yes\")));\n assert(matchParens((List[String](\")\", \"(\"))).equals((\"Yes\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // From a list of integers, remove all elements that occur more than once.\n // Keep order of elements left the same as in the input.\n def removeDuplicates(numbers : List[Long]) : List[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(removeDuplicates((List[Long]())).equals((List[Long]())));\n assert(removeDuplicates((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))));\n assert(removeDuplicates((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 2l.toLong, 4l.toLong, 3l.toLong, 5l.toLong))).equals((List[Long](1l.toLong, 4l.toLong, 5l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return a greatest common divisor of two integers a and b\n def greatestCommonDivisor(a : Long, b : Long) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(greatestCommonDivisor((3l), (7l)) == (1l));\n assert(greatestCommonDivisor((10l), (15l)) == (5l));\n assert(greatestCommonDivisor((49l), (14l)) == (7l));\n assert(greatestCommonDivisor((144l), (60l)) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Checks if given string is a palindrome\n def isPalindrome(text : String) : Boolean = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(isPalindrome((\"\")) == (true));\n assert(isPalindrome((\"aba\")) == (true));\n assert(isPalindrome((\"aaaaa\")) == (true));\n assert(isPalindrome((\"zbcd\")) == (false));\n assert(isPalindrome((\"xywyx\")) == (true));\n assert(isPalindrome((\"xywyz\")) == (false));\n assert(isPalindrome((\"xywzx\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // xs represent coefficients of a polynomial.\n // xs[0] + xs[1] * x + xs[2] * x^2 + ....\n // Return derivative of this polynomial in the same form.\n def derivative(xs : List[Long]) : List[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(derivative((List[Long](3l.toLong, 1l.toLong, 2l.toLong, 4l.toLong, 5l.toLong))).equals((List[Long](1l.toLong, 4l.toLong, 12l.toLong, 20l.toLong))));\n assert(derivative((List[Long](1l.toLong, 2l.toLong, 3l.toLong))).equals((List[Long](2l.toLong, 6l.toLong))));\n assert(derivative((List[Long](3l.toLong, 2l.toLong, 1l.toLong))).equals((List[Long](2l.toLong, 2l.toLong))));\n assert(derivative((List[Long](3l.toLong, 2l.toLong, 1l.toLong, 0l.toLong, 4l.toLong))).equals((List[Long](2l.toLong, 2l.toLong, 0l.toLong, 16l.toLong))));\n assert(derivative((List[Long](1l.toLong))).equals((List[Long]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // In this task, you will be given a string that represents a number of apples and oranges \n // that are distributed in a basket of fruit this basket contains \n // apples, oranges, and mango fruits. Given the string that represents the total number of \n // the oranges and apples and an integer that represent the total number of the fruits \n // in the basket return the number of the mango fruits in the basket.\n // for examble:\n def fruitDistribution(s : String, n : Long) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(fruitDistribution((\"5 apples and 6 oranges\"), (19l)) == (8l));\n assert(fruitDistribution((\"5 apples and 6 oranges\"), (21l)) == (10l));\n assert(fruitDistribution((\"0 apples and 1 oranges\"), (3l)) == (2l));\n assert(fruitDistribution((\"1 apples and 0 oranges\"), (3l)) == (2l));\n assert(fruitDistribution((\"2 apples and 3 oranges\"), (100l)) == (95l));\n assert(fruitDistribution((\"2 apples and 3 oranges\"), (5l)) == (0l));\n assert(fruitDistribution((\"1 apples and 100 oranges\"), (120l)) == (19l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that takes an integer a and returns True \n // if this ingeger is a cube of some integer number.\n // Note: you may assume the input is always valid.\n // Examples:\n def iscube(a : Long) : Boolean = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(iscube((1l)) == (true));\n assert(iscube((2l)) == (false));\n assert(iscube((-1l)) == (true));\n assert(iscube((64l)) == (true));\n assert(iscube((180l)) == (false));\n assert(iscube((1000l)) == (true));\n assert(iscube((0l)) == (true));\n assert(iscube((1729l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // In this Kata, you have to sort an array of non-negative integers according to\n // number of ones in their binary representation in ascending order.\n // For similar number of ones, sort based on decimal value.\n // It must be implemented like this:\n def sortArray(arr : List[Long]) : List[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sortArray((List[Long](1l.toLong, 5l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((List[Long](1l.toLong, 2l.toLong, 4l.toLong, 3l.toLong, 5l.toLong))));\n assert(sortArray((List[Long](-2l.toLong, -3l.toLong, -4l.toLong, -5l.toLong, -6l.toLong))).equals((List[Long](-4l.toLong, -2l.toLong, -6l.toLong, -5l.toLong, -3l.toLong))));\n assert(sortArray((List[Long](1l.toLong, 0l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((List[Long](0l.toLong, 1l.toLong, 2l.toLong, 4l.toLong, 3l.toLong))));\n assert(sortArray((List[Long]())).equals((List[Long]())));\n assert(sortArray((List[Long](2l.toLong, 5l.toLong, 77l.toLong, 4l.toLong, 5l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((List[Long](2l.toLong, 2l.toLong, 4l.toLong, 4l.toLong, 3l.toLong, 3l.toLong, 5l.toLong, 5l.toLong, 5l.toLong, 7l.toLong, 77l.toLong))));\n assert(sortArray((List[Long](3l.toLong, 6l.toLong, 44l.toLong, 12l.toLong, 32l.toLong, 5l.toLong))).equals((List[Long](32l.toLong, 3l.toLong, 5l.toLong, 6l.toLong, 12l.toLong, 44l.toLong))));\n assert(sortArray((List[Long](2l.toLong, 4l.toLong, 8l.toLong, 16l.toLong, 32l.toLong))).equals((List[Long](2l.toLong, 4l.toLong, 8l.toLong, 16l.toLong, 32l.toLong))));\n assert(sortArray((List[Long](2l.toLong, 4l.toLong, 8l.toLong, 16l.toLong, 32l.toLong))).equals((List[Long](2l.toLong, 4l.toLong, 8l.toLong, 16l.toLong, 32l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a list of strings, where each string consists of only digits, return a list.\n // Each element i of the output should be \"the number of odd elements in the\n // string i of the input.\" where all the i's should be replaced by the number\n // of odd digits in the i'th string of the input.\n def oddCount(lst : List[String]) : List[String] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(oddCount((List[String](\"1234567\"))).equals((List[String](\"the number of odd elements 4n the str4ng 4 of the 4nput.\"))));\n assert(oddCount((List[String](\"3\", \"11111111\"))).equals((List[String](\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\"))));\n assert(oddCount((List[String](\"271\", \"137\", \"314\"))).equals((List[String](\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // brackets is a string of \"(\" and \")\".\n // return True if every opening bracket has a corresponding closing bracket.\n def correctBracketing(brackets : String) : Boolean = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(correctBracketing((\"()\")) == (true));\n assert(correctBracketing((\"(()())\")) == (true));\n assert(correctBracketing((\"()()(()())()\")) == (true));\n assert(correctBracketing((\"()()((()()())())(()()(()))\")) == (true));\n assert(correctBracketing((\"((()())))\")) == (false));\n assert(correctBracketing((\")(()\")) == (false));\n assert(correctBracketing((\"(\")) == (false));\n assert(correctBracketing((\"((((\")) == (false));\n assert(correctBracketing((\")\")) == (false));\n assert(correctBracketing((\"(()\")) == (false));\n assert(correctBracketing((\"()()(()())())(()\")) == (false));\n assert(correctBracketing((\"()()(()())()))()\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Task\n // Write a function that takes a string as input and returns the sum of the upper characters only'\n // ASCII codes.\n // Examples:\n def digitSum(s : String) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(digitSum((\"\")) == (0l));\n assert(digitSum((\"abAB\")) == (131l));\n assert(digitSum((\"abcCd\")) == (67l));\n assert(digitSum((\"helloE\")) == (69l));\n assert(digitSum((\"woArBld\")) == (131l));\n assert(digitSum((\"aAaaaXa\")) == (153l));\n assert(digitSum((\" How are yOu?\")) == (151l));\n assert(digitSum((\"You arE Very Smart\")) == (327l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that accepts a list of strings as a parameter,\n // deletes the strings that have odd lengths from it,\n // and returns the resulted list with a sorted order,\n // The list is always a list of strings and never an array of numbers,\n // and it may contain duplicates.\n // The order of the list should be ascending by length of each word, and you\n // should return the list sorted by that rule.\n // If two words have the same length, sort the list alphabetically.\n // The function should return a list of strings in sorted order.\n // You may assume that all words will have the same length.\n // For example:\n def sortedListSum(lst : List[String]) : List[String] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sortedListSum((List[String](\"aa\", \"a\", \"aaa\"))).equals((List[String](\"aa\"))));\n assert(sortedListSum((List[String](\"school\", \"AI\", \"asdf\", \"b\"))).equals((List[String](\"AI\", \"asdf\", \"school\"))));\n assert(sortedListSum((List[String](\"d\", \"b\", \"c\", \"a\"))).equals((List[String]())));\n assert(sortedListSum((List[String](\"d\", \"dcba\", \"abcd\", \"a\"))).equals((List[String](\"abcd\", \"dcba\"))));\n assert(sortedListSum((List[String](\"AI\", \"ai\", \"au\"))).equals((List[String](\"AI\", \"ai\", \"au\"))));\n assert(sortedListSum((List[String](\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"))).equals((List[String]())));\n assert(sortedListSum((List[String](\"aaaa\", \"bbbb\", \"dd\", \"cc\"))).equals((List[String](\"cc\", \"dd\", \"aaaa\", \"bbbb\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given an array arr of integers and you need to return\n // sum of magnitudes of integers multiplied by product of all signs\n // of each number in the array, represented by 1, -1 or 0.\n // Note: return None for empty arr.\n // Example:\n def prodSigns(arr : List[Long]) : Option[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(prodSigns((List[Long](1l.toLong, 2l.toLong, 2l.toLong, -4l.toLong))).equals(-9l));\n assert(prodSigns((List[Long](0l.toLong, 1l.toLong))).equals(0l));\n assert(prodSigns((List[Long](1l.toLong, 1l.toLong, 1l.toLong, 2l.toLong, 3l.toLong, -1l.toLong, 1l.toLong))).equals(-10l));\n assert(prodSigns((List[Long]())).equals(None));\n assert(prodSigns((List[Long](2l.toLong, 4l.toLong, 1l.toLong, 2l.toLong, -1l.toLong, -1l.toLong, 9l.toLong))).equals(20l));\n assert(prodSigns((List[Long](-1l.toLong, 1l.toLong, -1l.toLong, 1l.toLong))).equals(4l));\n assert(prodSigns((List[Long](-1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))).equals(-4l));\n assert(prodSigns((List[Long](-1l.toLong, 1l.toLong, 1l.toLong, 0l.toLong))).equals(0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return list with elements incremented by 1.\n def incrList(l : List[Long]) : List[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(incrList((List[Long]())).equals((List[Long]())));\n assert(incrList((List[Long](3l.toLong, 2l.toLong, 1l.toLong))).equals((List[Long](4l.toLong, 3l.toLong, 2l.toLong))));\n assert(incrList((List[Long](5l.toLong, 2l.toLong, 5l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 9l.toLong, 0l.toLong, 123l.toLong))).equals((List[Long](6l.toLong, 3l.toLong, 6l.toLong, 3l.toLong, 4l.toLong, 4l.toLong, 10l.toLong, 1l.toLong, 124l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // From a given list of integers, generate a list of rolling maximum element found until given moment\n // in the sequence.\n def rollingMax(numbers : List[Long]) : List[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(rollingMax((List[Long]())).equals((List[Long]())));\n assert(rollingMax((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))));\n assert(rollingMax((List[Long](4l.toLong, 3l.toLong, 2l.toLong, 1l.toLong))).equals((List[Long](4l.toLong, 4l.toLong, 4l.toLong, 4l.toLong))));\n assert(rollingMax((List[Long](3l.toLong, 2l.toLong, 3l.toLong, 100l.toLong, 3l.toLong))).equals((List[Long](3l.toLong, 3l.toLong, 3l.toLong, 100l.toLong, 100l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n // separate those group into separate strings and return the list of those.\n // Separate groups are balanced (each open brace is properly closed) and not nested within each other\n // Ignore any spaces in the input string.\n def separateParenGroups(paren_string : String) : List[String] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(separateParenGroups((\"(()()) ((())) () ((())()())\")).equals((List[String](\"(()())\", \"((()))\", \"()\", \"((())()())\"))));\n assert(separateParenGroups((\"() (()) ((())) (((())))\")).equals((List[String](\"()\", \"(())\", \"((()))\", \"(((())))\"))));\n assert(separateParenGroups((\"(()(())((())))\")).equals((List[String](\"(()(())((())))\"))));\n assert(separateParenGroups((\"( ) (( )) (( )( ))\")).equals((List[String](\"()\", \"(())\", \"(()())\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You will be given a string of words separated by commas or spaces. Your task is\n // to split the string into words and return an array of the words.\n // For example:\n def wordsString(s : String) : List[String] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(wordsString((\"Hi, my name is John\")).equals((List[String](\"Hi\", \"my\", \"name\", \"is\", \"John\"))));\n assert(wordsString((\"One, two, three, four, five, six\")).equals((List[String](\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"))));\n assert(wordsString((\"Hi, my name\")).equals((List[String](\"Hi\", \"my\", \"name\"))));\n assert(wordsString((\"One,, two, three, four, five, six,\")).equals((List[String](\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"))));\n assert(wordsString((\"\")).equals((List[String]())));\n assert(wordsString((\"ahmed , gamal\")).equals((List[String](\"ahmed\", \"gamal\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Filter given list of any python values only for integers\n def filterIntegers(values : List[Any]) : List[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(filterIntegers((List[Any]())).equals((List[Long]())));\n assert(filterIntegers((List[Any](4l, Map[Long,Long](), List[Long](), 23.2f, 9l, \"adasd\"))).equals((List[Long](4l.toLong, 9l.toLong))));\n assert(filterIntegers((List[Any](3l, \"c\", 3l, 3l, \"a\", \"b\"))).equals((List[Long](3l.toLong, 3l.toLong, 3l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // This function takes a list l and returns a list l' such that\n // l' is identical to l in the odd indicies, while its values at the even indicies are equal\n // to the values of the even indicies of l, but sorted.\n def sortEven(l : List[Long]) : List[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sortEven((List[Long](1l.toLong, 2l.toLong, 3l.toLong))).equals((List[Long](1l.toLong, 2l.toLong, 3l.toLong))));\n assert(sortEven((List[Long](5l.toLong, 3l.toLong, -5l.toLong, 2l.toLong, -3l.toLong, 3l.toLong, 9l.toLong, 0l.toLong, 123l.toLong, 1l.toLong, -10l.toLong))).equals((List[Long](-10l.toLong, 3l.toLong, -5l.toLong, 2l.toLong, -3l.toLong, 3l.toLong, 5l.toLong, 0l.toLong, 9l.toLong, 1l.toLong, 123l.toLong))));\n assert(sortEven((List[Long](5l.toLong, 8l.toLong, -12l.toLong, 4l.toLong, 23l.toLong, 2l.toLong, 3l.toLong, 11l.toLong, 12l.toLong, -10l.toLong))).equals((List[Long](-12l.toLong, 8l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 2l.toLong, 12l.toLong, 11l.toLong, 23l.toLong, -10l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // I think we all remember that feeling when the result of some long-awaited\n // event is finally known. The feelings and thoughts you have at that moment are\n // definitely worth noting down and comparing.\n // Your task is to determine if a person correctly guessed the results of a number of matches.\n // You are given two arrays of scores and guesses of equal length, where each index shows a match. \n // Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n // the value is 0, and if not, the value is the absolute difference between the guess and the score.\n // example:\n def compare(game : List[Long], guess : List[Long]) : List[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(compare((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 1l.toLong)), (List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 2l.toLong, -2l.toLong))).equals((List[Long](0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 3l.toLong, 3l.toLong))));\n assert(compare((List[Long](0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong)), (List[Long](0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong))).equals((List[Long](0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong))));\n assert(compare((List[Long](1l.toLong, 2l.toLong, 3l.toLong)), (List[Long](-1l.toLong, -2l.toLong, -3l.toLong))).equals((List[Long](2l.toLong, 4l.toLong, 6l.toLong))));\n assert(compare((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 5l.toLong)), (List[Long](-1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((List[Long](2l.toLong, 0l.toLong, 0l.toLong, 1l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a positive integer n, return a tuple that has the number of even and odd\n // integer palindromes that fall within the range(1, n), inclusive.\n // Example 1:\n // Explanation:\n // Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n // Example 2:\n // Explanation:\n // Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n // Note:\n // 1. 1 <= n <= 10^3\n // 2. returned tuple has the number of even and odd integer palindromes respectively.\n def evenOddPalindrome(n : Long) : Tuple2[Long, Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(evenOddPalindrome((123l)).equals(((8l, 13l))));\n assert(evenOddPalindrome((12l)).equals(((4l, 6l))));\n assert(evenOddPalindrome((3l)).equals(((1l, 2l))));\n assert(evenOddPalindrome((63l)).equals(((6l, 8l))));\n assert(evenOddPalindrome((25l)).equals(((5l, 6l))));\n assert(evenOddPalindrome((19l)).equals(((4l, 6l))));\n assert(evenOddPalindrome((9l)).equals(((4l, 5l))));\n assert(evenOddPalindrome((1l)).equals(((0l, 1l))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n // fib4(0) -> 0\n // fib4(1) -> 0\n // fib4(2) -> 2\n // fib4(3) -> 0\n // fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n // Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n def fib4(n : Long) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(fib4((5l)) == (4l));\n assert(fib4((8l)) == (28l));\n assert(fib4((10l)) == (104l));\n assert(fib4((12l)) == (386l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given two positive integers a and b, return the even digits between a\n // and b, in ascending order.\n // For example:\n def generateIntegers(a : Long, b : Long) : List[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(generateIntegers((2l), (10l)).equals((List[Long](2l.toLong, 4l.toLong, 6l.toLong, 8l.toLong))));\n assert(generateIntegers((10l), (2l)).equals((List[Long](2l.toLong, 4l.toLong, 6l.toLong, 8l.toLong))));\n assert(generateIntegers((132l), (2l)).equals((List[Long](2l.toLong, 4l.toLong, 6l.toLong, 8l.toLong))));\n assert(generateIntegers((17l), (89l)).equals((List[Long]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // For a given list of input numbers, calculate Mean Absolute Deviation\n // around the mean of this dataset.\n // Mean Absolute Deviation is the average absolute difference between each\n // element and a centerpoint (mean in this case):\n // MAD = average | x - x_mean |\n def meanAbsoluteDeviation(numbers : List[Float]) : Float = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(meanAbsoluteDeviation((List[Float](1.0f.toFloat, 2.0f.toFloat))) == (0.5f));\n assert(meanAbsoluteDeviation((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat))) == (1.0f));\n assert(meanAbsoluteDeviation((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat, 5.0f.toFloat))) == (1.2f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function encrypt that takes a string as an argument and\n // returns a string encrypted with the alphabet being rotated. \n // The alphabet should be rotated in a manner such that the letters \n // shift down by two multiplied to two places.\n // For example:\n def encrypt(s : String) : String = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(encrypt((\"hi\")).equals((\"lm\")));\n assert(encrypt((\"asdfghjkl\")).equals((\"ewhjklnop\")));\n assert(encrypt((\"gf\")).equals((\"kj\")));\n assert(encrypt((\"et\")).equals((\"ix\")));\n assert(encrypt((\"faewfawefaewg\")).equals((\"jeiajeaijeiak\")));\n assert(encrypt((\"hellomyfriend\")).equals((\"lippsqcjvmirh\")));\n assert(encrypt((\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\")).equals((\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\")));\n assert(encrypt((\"a\")).equals((\"e\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n // The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n // as follows: start with any positive integer n. Then each term is obtained from the \n // previous term as follows: if the previous term is even, the next term is one half of \n // the previous term. If the previous term is odd, the next term is 3 times the previous\n // term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n // Note: \n // 1. Collatz(1) is [1].\n // 2. returned list sorted in increasing order.\n // For example:\n // get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n def getOddCollatz(n : Long) : List[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(getOddCollatz((14l)).equals((List[Long](1l.toLong, 5l.toLong, 7l.toLong, 11l.toLong, 13l.toLong, 17l.toLong))));\n assert(getOddCollatz((5l)).equals((List[Long](1l.toLong, 5l.toLong))));\n assert(getOddCollatz((12l)).equals((List[Long](1l.toLong, 3l.toLong, 5l.toLong))));\n assert(getOddCollatz((1l)).equals((List[Long](1l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Find how many times a given substring can be found in the original string. Count overlaping cases.\n def howManyTimes(string : String, substring : String) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(howManyTimes((\"\"), (\"x\")) == (0l));\n assert(howManyTimes((\"xyxyxyx\"), (\"x\")) == (4l));\n assert(howManyTimes((\"cacacacac\"), (\"cac\")) == (4l));\n assert(howManyTimes((\"john doe\"), (\"john\")) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n // numbers in the array will be randomly ordered. Your task is to determine if\n // it is possible to get an array sorted in non-decreasing order by performing \n // the following operation on the given array:\n // You are allowed to perform right shift operation any number of times.\n // One right shift operation means shifting all elements of the array by one\n // position in the right direction. The last element of the array will be moved to\n // the starting position in the array i.e. 0th index. \n // If it is possible to obtain the sorted array by performing the above operation\n // then return True else return False.\n // If the given array is empty then return True.\n // Note: The given list is guaranteed to have unique elements.\n // For Example:\n // Explanation: By performin 2 right shift operations, non-decreasing order can\n // be achieved for the given array.\n // Explanation:It is not possible to get non-decreasing order for the given\n // array by performing any number of right shift operations.\n def moveOneBall(arr : List[Long]) : Boolean = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(moveOneBall((List[Long](3l.toLong, 4l.toLong, 5l.toLong, 1l.toLong, 2l.toLong))) == (true));\n assert(moveOneBall((List[Long](3l.toLong, 5l.toLong, 10l.toLong, 1l.toLong, 2l.toLong))) == (true));\n assert(moveOneBall((List[Long](4l.toLong, 3l.toLong, 1l.toLong, 2l.toLong))) == (false));\n assert(moveOneBall((List[Long](3l.toLong, 5l.toLong, 4l.toLong, 1l.toLong, 2l.toLong))) == (false));\n assert(moveOneBall((List[Long]())) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function which sorts the given list of integers\n // in ascending order according to the sum of their digits.\n // Note: if there are several items with similar sum of their digits,\n // order them based on their index in original list.\n // For example:\n def orderByPoints(nums : List[Long]) : List[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(orderByPoints((List[Long](1l.toLong, 11l.toLong, -1l.toLong, -11l.toLong, -12l.toLong))).equals((List[Long](-1l.toLong, -11l.toLong, 1l.toLong, -12l.toLong, 11l.toLong))));\n assert(orderByPoints((List[Long](1234l.toLong, 423l.toLong, 463l.toLong, 145l.toLong, 2l.toLong, 423l.toLong, 423l.toLong, 53l.toLong, 6l.toLong, 37l.toLong, 3457l.toLong, 3l.toLong, 56l.toLong, 0l.toLong, 46l.toLong))).equals((List[Long](0l.toLong, 2l.toLong, 3l.toLong, 6l.toLong, 53l.toLong, 423l.toLong, 423l.toLong, 423l.toLong, 1234l.toLong, 145l.toLong, 37l.toLong, 46l.toLong, 56l.toLong, 463l.toLong, 3457l.toLong))));\n assert(orderByPoints((List[Long]())).equals((List[Long]())));\n assert(orderByPoints((List[Long](1l.toLong, -11l.toLong, -32l.toLong, 43l.toLong, 54l.toLong, -98l.toLong, 2l.toLong, -3l.toLong))).equals((List[Long](-3l.toLong, -32l.toLong, -98l.toLong, -11l.toLong, 1l.toLong, 2l.toLong, 43l.toLong, 54l.toLong))));\n assert(orderByPoints((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong, 9l.toLong, 10l.toLong, 11l.toLong))).equals((List[Long](1l.toLong, 10l.toLong, 2l.toLong, 11l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong, 9l.toLong))));\n assert(orderByPoints((List[Long](0l.toLong, 6l.toLong, 6l.toLong, -76l.toLong, -21l.toLong, 23l.toLong, 4l.toLong))).equals((List[Long](-76l.toLong, -21l.toLong, 0l.toLong, 4l.toLong, 23l.toLong, 6l.toLong, 6l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return list of prime factors of given integer in the order from smallest to largest.\n // Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n // Input number should be equal to the product of all factors\n def factorize(n : Long) : List[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(factorize((2l)).equals((List[Long](2l.toLong))));\n assert(factorize((4l)).equals((List[Long](2l.toLong, 2l.toLong))));\n assert(factorize((8l)).equals((List[Long](2l.toLong, 2l.toLong, 2l.toLong))));\n assert(factorize((57l)).equals((List[Long](3l.toLong, 19l.toLong))));\n assert(factorize((3249l)).equals((List[Long](3l.toLong, 3l.toLong, 19l.toLong, 19l.toLong))));\n assert(factorize((185193l)).equals((List[Long](3l.toLong, 3l.toLong, 3l.toLong, 19l.toLong, 19l.toLong, 19l.toLong))));\n assert(factorize((20577l)).equals((List[Long](3l.toLong, 19l.toLong, 19l.toLong, 19l.toLong))));\n assert(factorize((18l)).equals((List[Long](2l.toLong, 3l.toLong, 3l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return True if all numbers in the list l are below threshold t.\n def belowThreshold(l : List[Long], t : Long) : Boolean = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(belowThreshold((List[Long](1l.toLong, 2l.toLong, 4l.toLong, 10l.toLong)), (100l)) == (true));\n assert(belowThreshold((List[Long](1l.toLong, 20l.toLong, 4l.toLong, 10l.toLong)), (5l)) == (false));\n assert(belowThreshold((List[Long](1l.toLong, 20l.toLong, 4l.toLong, 10l.toLong)), (21l)) == (true));\n assert(belowThreshold((List[Long](1l.toLong, 20l.toLong, 4l.toLong, 10l.toLong)), (22l)) == (true));\n assert(belowThreshold((List[Long](1l.toLong, 8l.toLong, 4l.toLong, 10l.toLong)), (11l)) == (true));\n assert(belowThreshold((List[Long](1l.toLong, 8l.toLong, 4l.toLong, 10l.toLong)), (10l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given two positive integers n and m, and your task is to compute the\n // average of the integers from n through m (including n and m). \n // Round the answer to the nearest integer and convert that to binary.\n // If n is greater than m, return -1.\n // Example:\n def roundedAvg(n : Long, m : Long) : Either[String, Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(roundedAvg((1l), (5l)).equals(\"0b11\"));\n assert(roundedAvg((7l), (13l)).equals(\"0b1010\"));\n assert(roundedAvg((964l), (977l)).equals(\"0b1111001010\"));\n assert(roundedAvg((996l), (997l)).equals(\"0b1111100100\"));\n assert(roundedAvg((560l), (851l)).equals(\"0b1011000010\"));\n assert(roundedAvg((185l), (546l)).equals(\"0b101101110\"));\n assert(roundedAvg((362l), (496l)).equals(\"0b110101101\"));\n assert(roundedAvg((350l), (902l)).equals(\"0b1001110010\"));\n assert(roundedAvg((197l), (233l)).equals(\"0b11010111\"));\n assert(roundedAvg((7l), (5l)).equals(-1l));\n assert(roundedAvg((5l), (1l)).equals(-1l));\n assert(roundedAvg((5l), (5l)).equals(\"0b101\"));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n // For each of the group, output the deepest level of nesting of parentheses.\n // E.g. (()()) has maximum two levels of nesting while ((())) has three.\n def parseNestedParens(paren_string : String) : List[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(parseNestedParens((\"(()()) ((())) () ((())()())\")).equals((List[Long](2l.toLong, 3l.toLong, 1l.toLong, 3l.toLong))));\n assert(parseNestedParens((\"() (()) ((())) (((())))\")).equals((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))));\n assert(parseNestedParens((\"(()(())((())))\")).equals((List[Long](4l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n // Examples\n def solution(lst : List[Long]) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(solution((List[Long](5l.toLong, 8l.toLong, 7l.toLong, 1l.toLong))) == (12l));\n assert(solution((List[Long](3l.toLong, 3l.toLong, 3l.toLong, 3l.toLong, 3l.toLong))) == (9l));\n assert(solution((List[Long](30l.toLong, 13l.toLong, 24l.toLong, 321l.toLong))) == (0l));\n assert(solution((List[Long](5l.toLong, 9l.toLong))) == (5l));\n assert(solution((List[Long](2l.toLong, 4l.toLong, 8l.toLong))) == (0l));\n assert(solution((List[Long](30l.toLong, 13l.toLong, 23l.toLong, 32l.toLong))) == (23l));\n assert(solution((List[Long](3l.toLong, 13l.toLong, 2l.toLong, 9l.toLong))) == (3l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a positive integer n. You have to create an integer array a of length n.\n // For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n // Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n // and a[i] + a[j] + a[k] is a multiple of 3.\n // Example :\n // Explanation: \n // a = [1, 3, 7, 13, 21]\n // The only valid triple is (1, 7, 13).\n def getMaxTriples(n : Long) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(getMaxTriples((5l)) == (1l));\n assert(getMaxTriples((6l)) == (4l));\n assert(getMaxTriples((10l)) == (36l));\n assert(getMaxTriples((100l)) == (53361l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // There are eight planets in our solar system: the closerst to the Sun \n // is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n // Uranus, Neptune.\n // Write a function that takes two planet names as strings planet1 and planet2. \n // The function should return a tuple containing all planets whose orbits are \n // located between the orbit of planet1 and the orbit of planet2, sorted by \n // the proximity to the sun. \n // The function should return an empty tuple if planet1 or planet2\n // are not correct planet names. \n // Examples\n def bf(planet1 : String, planet2 : String) : List[String] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(bf((\"Jupiter\"), (\"Neptune\")).equals((List[String](\"Saturn\", \"Uranus\"))));\n assert(bf((\"Earth\"), (\"Mercury\")).equals((List[String](\"Venus\"))));\n assert(bf((\"Mercury\"), (\"Uranus\")).equals((List[String](\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"))));\n assert(bf((\"Neptune\"), (\"Venus\")).equals((List[String](\"Earth\", \"Mars\", \"Jupiter\", \"Saturn\", \"Uranus\"))));\n assert(bf((\"Earth\"), (\"Earth\")).equals((List[String]())));\n assert(bf((\"Mars\"), (\"Earth\")).equals((List[String]())));\n assert(bf((\"Jupiter\"), (\"Makemake\")).equals((List[String]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a list of integers.\n // Write a function next_smallest() that returns the 2nd smallest element of the list.\n // Return None if there is no such element.\n def nextSmallest(lst : List[Long]) : Option[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(nextSmallest((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong))).equals(2l));\n assert(nextSmallest((List[Long](5l.toLong, 1l.toLong, 4l.toLong, 3l.toLong, 2l.toLong))).equals(2l));\n assert(nextSmallest((List[Long]())).equals(None));\n assert(nextSmallest((List[Long](1l.toLong, 1l.toLong))).equals(None));\n assert(nextSmallest((List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong, 0l.toLong))).equals(1l));\n assert(nextSmallest((List[Long](1l.toLong, 1l.toLong))).equals(None));\n assert(nextSmallest((List[Long](-35l.toLong, 34l.toLong, 12l.toLong, -45l.toLong))).equals(-35l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Input is a space-delimited string of numberals from 'zero' to 'nine'.\n // Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n // Return the string with numbers sorted from smallest to largest\n def sortNumbers(numbers : String) : String = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sortNumbers((\"\")).equals((\"\")));\n assert(sortNumbers((\"three\")).equals((\"three\")));\n assert(sortNumbers((\"three five nine\")).equals((\"three five nine\")));\n assert(sortNumbers((\"five zero four seven nine eight\")).equals((\"zero four five seven eight nine\")));\n assert(sortNumbers((\"six five four three two one zero\")).equals((\"zero one two three four five six\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n def cycpatternCheck(a : String, b : String) : Boolean = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(cycpatternCheck((\"xyzw\"), (\"xyw\")) == (false));\n assert(cycpatternCheck((\"yello\"), (\"ell\")) == (true));\n assert(cycpatternCheck((\"whattup\"), (\"ptut\")) == (false));\n assert(cycpatternCheck((\"efef\"), (\"fee\")) == (true));\n assert(cycpatternCheck((\"abab\"), (\"aabb\")) == (false));\n assert(cycpatternCheck((\"winemtt\"), (\"tinem\")) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You will be given a number in decimal form and your task is to convert it to\n // binary format. The function should return a string, with each character representing a binary\n // number. Each character in the string will be '0' or '1'.\n // There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n // The extra characters are there to help with the format.\n // Examples:\n def decimalToBinary(decimal : Long) : String = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(decimalToBinary((0l)).equals((\"db0db\")));\n assert(decimalToBinary((32l)).equals((\"db100000db\")));\n assert(decimalToBinary((103l)).equals((\"db1100111db\")));\n assert(decimalToBinary((15l)).equals((\"db1111db\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Filter an input list of strings only for ones that contain given substring\n def filterBySubstring(strings : List[String], substring : String) : List[String] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(filterBySubstring((List[String]()), (\"john\")).equals((List[String]())));\n assert(filterBySubstring((List[String](\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\")), (\"xxx\")).equals((List[String](\"xxx\", \"xxxAAA\", \"xxx\"))));\n assert(filterBySubstring((List[String](\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\")), (\"xx\")).equals((List[String](\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"))));\n assert(filterBySubstring((List[String](\"grunt\", \"trumpet\", \"prune\", \"gruesome\")), (\"run\")).equals((List[String](\"grunt\", \"prune\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given an integer. return a tuple that has the number of even and odd digits respectively.\n // Example:\n def evenOddCount(num : Long) : Tuple2[Long, Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(evenOddCount((7l)).equals(((0l, 1l))));\n assert(evenOddCount((-78l)).equals(((1l, 1l))));\n assert(evenOddCount((3452l)).equals(((2l, 2l))));\n assert(evenOddCount((346211l)).equals(((3l, 3l))));\n assert(evenOddCount((-345821l)).equals(((3l, 3l))));\n assert(evenOddCount((-2l)).equals(((1l, 0l))));\n assert(evenOddCount((-45347l)).equals(((2l, 3l))));\n assert(evenOddCount((0l)).equals(((1l, 0l))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that accepts a list of strings.\n // The list contains different words. Return the word with maximum number\n // of unique characters. If multiple strings have maximum number of unique\n // characters, return the one which comes first in lexicographical order.\n def findMax(words : List[String]) : String = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(findMax((List[String](\"name\", \"of\", \"string\"))).equals((\"string\")));\n assert(findMax((List[String](\"name\", \"enam\", \"game\"))).equals((\"enam\")));\n assert(findMax((List[String](\"aaaaaaa\", \"bb\", \"cc\"))).equals((\"aaaaaaa\")));\n assert(findMax((List[String](\"abc\", \"cba\"))).equals((\"abc\")));\n assert(findMax((List[String](\"play\", \"this\", \"game\", \"of\", \"footbott\"))).equals((\"footbott\")));\n assert(findMax((List[String](\"we\", \"are\", \"gonna\", \"rock\"))).equals((\"gonna\")));\n assert(findMax((List[String](\"we\", \"are\", \"a\", \"mad\", \"nation\"))).equals((\"nation\")));\n assert(findMax((List[String](\"this\", \"is\", \"a\", \"prrk\"))).equals((\"this\")));\n assert(findMax((List[String](\"b\"))).equals((\"b\")));\n assert(findMax((List[String](\"play\", \"play\", \"play\"))).equals((\"play\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function that returns a tuple (a, b), where 'a' is\n // the largest of negative integers, and 'b' is the smallest\n // of positive integers in a list.\n // If there is no negative or positive integers, return them as None.\n // Examples:\n def largestSmallestIntegers(lst : List[Long]) : Tuple2[Option[Long], Option[Long]] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(largestSmallestIntegers((List[Long](2l.toLong, 4l.toLong, 1l.toLong, 3l.toLong, 5l.toLong, 7l.toLong))).equals((Some(None), Some(1l))));\n assert(largestSmallestIntegers((List[Long](2l.toLong, 4l.toLong, 1l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 0l.toLong))).equals((Some(None), Some(1l))));\n assert(largestSmallestIntegers((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 4l.toLong, 5l.toLong, 6l.toLong, -2l.toLong))).equals((-2l, 1l)));\n assert(largestSmallestIntegers((List[Long](4l.toLong, 5l.toLong, 3l.toLong, 6l.toLong, 2l.toLong, 7l.toLong, -7l.toLong))).equals((-7l, 2l)));\n assert(largestSmallestIntegers((List[Long](7l.toLong, 3l.toLong, 8l.toLong, 4l.toLong, 9l.toLong, 2l.toLong, 5l.toLong, -9l.toLong))).equals((-9l, 2l)));\n assert(largestSmallestIntegers((List[Long]())).equals((Some(None), Some(None))));\n assert(largestSmallestIntegers((List[Long](0l.toLong))).equals((Some(None), Some(None))));\n assert(largestSmallestIntegers((List[Long](-1l.toLong, -3l.toLong, -5l.toLong, -6l.toLong))).equals((Some(-1l), Some(None))));\n assert(largestSmallestIntegers((List[Long](-1l.toLong, -3l.toLong, -5l.toLong, -6l.toLong, 0l.toLong))).equals((Some(-1l), Some(None))));\n assert(largestSmallestIntegers((List[Long](-6l.toLong, -4l.toLong, -4l.toLong, -3l.toLong, 1l.toLong))).equals((-3l, 1l)));\n assert(largestSmallestIntegers((List[Long](-6l.toLong, -4l.toLong, -4l.toLong, -3l.toLong, -100l.toLong, 1l.toLong))).equals((-3l, 1l)));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // \"Given an array representing a branch of a tree that has non-negative integer nodes\n // your task is to pluck one of the nodes and return it.\n // The plucked node should be the node with the smallest even value.\n // If multiple nodes with the same smallest even value are found return the node that has smallest index.\n // The plucked node should be returned in a list, [ smalest_value, its index ],\n // If there are no even values or the given array is empty, return [].\n // Example 1:\n // Explanation: 2 has the smallest even value, and 2 has the smallest index.\n // Example 2:\n // Explanation: 2 has the smallest even value, and 2 has the smallest index.\n // Example 3:\n // Example 4:\n // Explanation: 0 is the smallest value, but there are two zeros,\n // so we will choose the first zero, which has the smallest index.\n // Constraints:\n // * 1 <= nodes.length <= 10000\n // * 0 <= node.value\n def pluck(arr : List[Long]) : List[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(pluck((List[Long](4l.toLong, 2l.toLong, 3l.toLong))).equals((List[Long](2l.toLong, 1l.toLong))));\n assert(pluck((List[Long](1l.toLong, 2l.toLong, 3l.toLong))).equals((List[Long](2l.toLong, 1l.toLong))));\n assert(pluck((List[Long]())).equals((List[Long]())));\n assert(pluck((List[Long](5l.toLong, 0l.toLong, 3l.toLong, 0l.toLong, 4l.toLong, 2l.toLong))).equals((List[Long](0l.toLong, 1l.toLong))));\n assert(pluck((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 0l.toLong, 5l.toLong, 3l.toLong))).equals((List[Long](0l.toLong, 3l.toLong))));\n assert(pluck((List[Long](5l.toLong, 4l.toLong, 8l.toLong, 4l.toLong, 8l.toLong))).equals((List[Long](4l.toLong, 1l.toLong))));\n assert(pluck((List[Long](7l.toLong, 6l.toLong, 7l.toLong, 1l.toLong))).equals((List[Long](6l.toLong, 1l.toLong))));\n assert(pluck((List[Long](7l.toLong, 9l.toLong, 7l.toLong, 1l.toLong))).equals((List[Long]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function count_nums which takes an array of integers and returns\n // the number of elements which has a sum of digits > 0.\n // If a number is negative, then its first signed digit will be negative:\n // e.g. -123 has signed digits -1, 2, and 3.\n def countNums(arr : List[Long]) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(countNums((List[Long]())) == (0l));\n assert(countNums((List[Long](-1l.toLong, -2l.toLong, 0l.toLong))) == (0l));\n assert(countNums((List[Long](1l.toLong, 1l.toLong, 2l.toLong, -2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong))) == (6l));\n assert(countNums((List[Long](1l.toLong, 6l.toLong, 9l.toLong, -6l.toLong, 0l.toLong, 1l.toLong, 5l.toLong))) == (5l));\n assert(countNums((List[Long](1l.toLong, 100l.toLong, 98l.toLong, -7l.toLong, 1l.toLong, -1l.toLong))) == (4l));\n assert(countNums((List[Long](12l.toLong, 23l.toLong, 34l.toLong, -45l.toLong, -56l.toLong, 0l.toLong))) == (5l));\n assert(countNums((List[Long](0l.toLong, 1l.toLong))) == (1l));\n assert(countNums((List[Long](1l.toLong))) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n // each cell of the grid contains a value. Every integer in the range [1, N * N]\n // inclusive appears exactly once on the cells of the grid.\n // You have to find the minimum path of length k in the grid. You can start\n // from any cell, and in each step you can move to any of the neighbor cells,\n // in other words, you can go to cells which share an edge with you current\n // cell.\n // Please note that a path of length k means visiting exactly k cells (not\n // necessarily distinct).\n // You CANNOT go off the grid.\n // A path A (of length k) is considered less than a path B (of length k) if\n // after making the ordered lists of the values on the cells that A and B go\n // through (let's call them lst_A and lst_B), lst_A is lexicographically less\n // than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n // such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n // lst_A[j] = lst_B[j].\n // It is guaranteed that the answer is unique.\n // Return an ordered list of the values on the cells that the minimum path go through.\n // Examples:\n def minPath(grid : List[List[Long]], k : Long) : List[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(minPath((List[List[Long]](List[Long](1l.toLong, 2l.toLong, 3l.toLong), List[Long](4l.toLong, 5l.toLong, 6l.toLong), List[Long](7l.toLong, 8l.toLong, 9l.toLong))), (3l)).equals((List[Long](1l.toLong, 2l.toLong, 1l.toLong))));\n assert(minPath((List[List[Long]](List[Long](5l.toLong, 9l.toLong, 3l.toLong), List[Long](4l.toLong, 1l.toLong, 6l.toLong), List[Long](7l.toLong, 8l.toLong, 2l.toLong))), (1l)).equals((List[Long](1l.toLong))));\n assert(minPath((List[List[Long]](List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong), List[Long](5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong), List[Long](9l.toLong, 10l.toLong, 11l.toLong, 12l.toLong), List[Long](13l.toLong, 14l.toLong, 15l.toLong, 16l.toLong))), (4l)).equals((List[Long](1l.toLong, 2l.toLong, 1l.toLong, 2l.toLong))));\n assert(minPath((List[List[Long]](List[Long](6l.toLong, 4l.toLong, 13l.toLong, 10l.toLong), List[Long](5l.toLong, 7l.toLong, 12l.toLong, 1l.toLong), List[Long](3l.toLong, 16l.toLong, 11l.toLong, 15l.toLong), List[Long](8l.toLong, 14l.toLong, 9l.toLong, 2l.toLong))), (7l)).equals((List[Long](1l.toLong, 10l.toLong, 1l.toLong, 10l.toLong, 1l.toLong, 10l.toLong, 1l.toLong))));\n assert(minPath((List[List[Long]](List[Long](8l.toLong, 14l.toLong, 9l.toLong, 2l.toLong), List[Long](6l.toLong, 4l.toLong, 13l.toLong, 15l.toLong), List[Long](5l.toLong, 7l.toLong, 1l.toLong, 12l.toLong), List[Long](3l.toLong, 10l.toLong, 11l.toLong, 16l.toLong))), (5l)).equals((List[Long](1l.toLong, 7l.toLong, 1l.toLong, 7l.toLong, 1l.toLong))));\n assert(minPath((List[List[Long]](List[Long](11l.toLong, 8l.toLong, 7l.toLong, 2l.toLong), List[Long](5l.toLong, 16l.toLong, 14l.toLong, 4l.toLong), List[Long](9l.toLong, 3l.toLong, 15l.toLong, 6l.toLong), List[Long](12l.toLong, 13l.toLong, 10l.toLong, 1l.toLong))), (9l)).equals((List[Long](1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong, 1l.toLong))));\n assert(minPath((List[List[Long]](List[Long](12l.toLong, 13l.toLong, 10l.toLong, 1l.toLong), List[Long](9l.toLong, 3l.toLong, 15l.toLong, 6l.toLong), List[Long](5l.toLong, 16l.toLong, 14l.toLong, 4l.toLong), List[Long](11l.toLong, 8l.toLong, 7l.toLong, 2l.toLong))), (12l)).equals((List[Long](1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong))));\n assert(minPath((List[List[Long]](List[Long](2l.toLong, 7l.toLong, 4l.toLong), List[Long](3l.toLong, 1l.toLong, 5l.toLong), List[Long](6l.toLong, 8l.toLong, 9l.toLong))), (8l)).equals((List[Long](1l.toLong, 3l.toLong, 1l.toLong, 3l.toLong, 1l.toLong, 3l.toLong, 1l.toLong, 3l.toLong))));\n assert(minPath((List[List[Long]](List[Long](6l.toLong, 1l.toLong, 5l.toLong), List[Long](3l.toLong, 8l.toLong, 9l.toLong), List[Long](2l.toLong, 7l.toLong, 4l.toLong))), (8l)).equals((List[Long](1l.toLong, 5l.toLong, 1l.toLong, 5l.toLong, 1l.toLong, 5l.toLong, 1l.toLong, 5l.toLong))));\n assert(minPath((List[List[Long]](List[Long](1l.toLong, 2l.toLong), List[Long](3l.toLong, 4l.toLong))), (10l)).equals((List[Long](1l.toLong, 2l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 2l.toLong))));\n assert(minPath((List[List[Long]](List[Long](1l.toLong, 3l.toLong), List[Long](3l.toLong, 2l.toLong))), (10l)).equals((List[Long](1l.toLong, 3l.toLong, 1l.toLong, 3l.toLong, 1l.toLong, 3l.toLong, 1l.toLong, 3l.toLong, 1l.toLong, 3l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given list of integers, return list in strange order.\n // Strange sorting, is when you start with the minimum value,\n // then maximum of the remaining integers, then minimum and so on.\n // Examples:\n def strangeSortList(lst : List[Long]) : List[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(strangeSortList((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((List[Long](1l.toLong, 4l.toLong, 2l.toLong, 3l.toLong))));\n assert(strangeSortList((List[Long](5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong, 9l.toLong))).equals((List[Long](5l.toLong, 9l.toLong, 6l.toLong, 8l.toLong, 7l.toLong))));\n assert(strangeSortList((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong))).equals((List[Long](1l.toLong, 5l.toLong, 2l.toLong, 4l.toLong, 3l.toLong))));\n assert(strangeSortList((List[Long](5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong, 9l.toLong, 1l.toLong))).equals((List[Long](1l.toLong, 9l.toLong, 5l.toLong, 8l.toLong, 6l.toLong, 7l.toLong))));\n assert(strangeSortList((List[Long](5l.toLong, 5l.toLong, 5l.toLong, 5l.toLong))).equals((List[Long](5l.toLong, 5l.toLong, 5l.toLong, 5l.toLong))));\n assert(strangeSortList((List[Long]())).equals((List[Long]())));\n assert(strangeSortList((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong))).equals((List[Long](1l.toLong, 8l.toLong, 2l.toLong, 7l.toLong, 3l.toLong, 6l.toLong, 4l.toLong, 5l.toLong))));\n assert(strangeSortList((List[Long](0l.toLong, 2l.toLong, 2l.toLong, 2l.toLong, 5l.toLong, 5l.toLong, -5l.toLong, -5l.toLong))).equals((List[Long](-5l.toLong, 5l.toLong, -5l.toLong, 5l.toLong, 0l.toLong, 2l.toLong, 2l.toLong, 2l.toLong))));\n assert(strangeSortList((List[Long](111111l.toLong))).equals((List[Long](111111l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a string 'text', return its md5 hash equivalent string.\n // If 'text' is an empty string, return None.\n def stringToMd5(text : String) : Option[String] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(stringToMd5((\"Hello world\")).equals(\"3e25960a79dbc69b674cd4ec67a72c62\"));\n assert(stringToMd5((\"\")).equals(None));\n assert(stringToMd5((\"A B C\")).equals(\"0ef78513b0cb8cef12743f5aeb35f888\"));\n assert(stringToMd5((\"password\")).equals(\"5f4dcc3b5aa765d61d8327deb882cf99\"));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a word. Your task is to find the closest vowel that stands between \n // two consonants from the right side of the word (case sensitive).\n // Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n // find any vowel met the above condition. \n // You may assume that the given string contains English letter only.\n // Example:\n def getClosestVowel(word : String) : String = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(getClosestVowel((\"yogurt\")).equals((\"u\")));\n assert(getClosestVowel((\"full\")).equals((\"u\")));\n assert(getClosestVowel((\"easy\")).equals((\"\")));\n assert(getClosestVowel((\"eAsy\")).equals((\"\")));\n assert(getClosestVowel((\"ali\")).equals((\"\")));\n assert(getClosestVowel((\"bad\")).equals((\"a\")));\n assert(getClosestVowel((\"most\")).equals((\"o\")));\n assert(getClosestVowel((\"ab\")).equals((\"\")));\n assert(getClosestVowel((\"ba\")).equals((\"\")));\n assert(getClosestVowel((\"quick\")).equals((\"\")));\n assert(getClosestVowel((\"anime\")).equals((\"i\")));\n assert(getClosestVowel((\"Asia\")).equals((\"\")));\n assert(getClosestVowel((\"Above\")).equals((\"o\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Change numerical base of input number x to base.\n // return string representation after the conversion.\n // base numbers are less than 10.\n def changeBase(x : Long, base : Long) : String = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(changeBase((8l), (3l)).equals((\"22\")));\n assert(changeBase((9l), (3l)).equals((\"100\")));\n assert(changeBase((234l), (2l)).equals((\"11101010\")));\n assert(changeBase((16l), (2l)).equals((\"10000\")));\n assert(changeBase((8l), (2l)).equals((\"1000\")));\n assert(changeBase((7l), (2l)).equals((\"111\")));\n assert(changeBase((2l), (3l)).equals((\"2\")));\n assert(changeBase((3l), (4l)).equals((\"3\")));\n assert(changeBase((4l), (5l)).equals((\"4\")));\n assert(changeBase((5l), (6l)).equals((\"5\")));\n assert(changeBase((6l), (7l)).equals((\"6\")));\n assert(changeBase((7l), (8l)).equals((\"7\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Check if in given list of numbers, are any two numbers closer to each other than\n // given threshold.\n def hasCloseElements(numbers : List[Float], threshold : Float) : Boolean = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(hasCloseElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.9f.toFloat, 4.0f.toFloat, 5.0f.toFloat, 2.2f.toFloat)), (0.3f)) == (true));\n assert(hasCloseElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.9f.toFloat, 4.0f.toFloat, 5.0f.toFloat, 2.2f.toFloat)), (0.05f)) == (false));\n assert(hasCloseElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 5.9f.toFloat, 4.0f.toFloat, 5.0f.toFloat)), (0.95f)) == (true));\n assert(hasCloseElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 5.9f.toFloat, 4.0f.toFloat, 5.0f.toFloat)), (0.8f)) == (false));\n assert(hasCloseElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat, 5.0f.toFloat, 2.0f.toFloat)), (0.1f)) == (true));\n assert(hasCloseElements((List[Float](1.1f.toFloat, 2.2f.toFloat, 3.1f.toFloat, 4.1f.toFloat, 5.1f.toFloat)), (1.0f)) == (true));\n assert(hasCloseElements((List[Float](1.1f.toFloat, 2.2f.toFloat, 3.1f.toFloat, 4.1f.toFloat, 5.1f.toFloat)), (0.5f)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function that takes a string as input which contains only square brackets.\n // The function should return True if and only if there is a valid subsequence of brackets \n // where at least one bracket in the subsequence is nested.\n def isNested(string : String) : Boolean = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(isNested((\"[[]]\")) == (true));\n assert(isNested((\"[]]]]]]][[[[[]\")) == (false));\n assert(isNested((\"[][]\")) == (false));\n assert(isNested((\"[]\")) == (false));\n assert(isNested((\"[[[[]]]]\")) == (true));\n assert(isNested((\"[]]]]]]]]]]\")) == (false));\n assert(isNested((\"[][][[]]\")) == (true));\n assert(isNested((\"[[]\")) == (false));\n assert(isNested((\"[]]\")) == (false));\n assert(isNested((\"[[]][[\")) == (true));\n assert(isNested((\"[[][]]\")) == (true));\n assert(isNested((\"\")) == (false));\n assert(isNested((\"[[[[[[[[\")) == (false));\n assert(isNested((\"]]]]]]]]\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Concatenate list of strings into a single string\n def concatenate(strings : List[String]) : String = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(concatenate((List[String]())).equals((\"\")));\n assert(concatenate((List[String](\"x\", \"y\", \"z\"))).equals((\"xyz\")));\n assert(concatenate((List[String](\"x\", \"y\", \"z\", \"w\", \"k\"))).equals((\"xyzwk\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n def primeFib(n : Long) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(primeFib((1l)) == (2l));\n assert(primeFib((2l)) == (3l));\n assert(primeFib((3l)) == (5l));\n assert(primeFib((4l)) == (13l));\n assert(primeFib((5l)) == (89l));\n assert(primeFib((6l)) == (233l));\n assert(primeFib((7l)) == (1597l));\n assert(primeFib((8l)) == (28657l));\n assert(primeFib((9l)) == (514229l));\n assert(primeFib((10l)) == (433494437l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n // other and return them in order (smaller number, larger number).\n def findClosestElements(numbers : List[Float]) : Tuple2[Float, Float] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(findClosestElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.9f.toFloat, 4.0f.toFloat, 5.0f.toFloat, 2.2f.toFloat))).equals(((3.9f, 4.0f))));\n assert(findClosestElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 5.9f.toFloat, 4.0f.toFloat, 5.0f.toFloat))).equals(((5.0f, 5.9f))));\n assert(findClosestElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat, 5.0f.toFloat, 2.2f.toFloat))).equals(((2.0f, 2.2f))));\n assert(findClosestElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat, 5.0f.toFloat, 2.0f.toFloat))).equals(((2.0f, 2.0f))));\n assert(findClosestElements((List[Float](1.1f.toFloat, 2.2f.toFloat, 3.1f.toFloat, 4.1f.toFloat, 5.1f.toFloat))).equals(((2.2f, 3.1f))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You have been tasked to write a function that receives \n // a hexadecimal number as a string and counts the number of hexadecimal \n // digits that are primes (prime number, or a prime, is a natural number \n // greater than 1 that is not a product of two smaller natural numbers).\n // Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n // Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n // So you have to determine a number of the following digits: 2, 3, 5, 7, \n // B (=decimal 11), D (=decimal 13).\n // Note: you may assume the input is always correct or empty string, \n // and symbols A,B,C,D,E,F are always uppercase.\n // Examples:\n def hexKey(num : String) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(hexKey((\"AB\")) == (1l));\n assert(hexKey((\"1077E\")) == (2l));\n assert(hexKey((\"ABED1A33\")) == (4l));\n assert(hexKey((\"2020\")) == (2l));\n assert(hexKey((\"123456789ABCDEF0\")) == (6l));\n assert(hexKey((\"112233445566778899AABBCCDDEEFF00\")) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Complete the function that takes two integers and returns \n // the product of their unit digits.\n // Assume the input is always valid.\n // Examples:\n def multiply(a : Long, b : Long) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(multiply((148l), (412l)) == (16l));\n assert(multiply((19l), (28l)) == (72l));\n assert(multiply((2020l), (1851l)) == (0l));\n assert(multiply((14l), (-15l)) == (20l));\n assert(multiply((76l), (67l)) == (42l));\n assert(multiply((17l), (27l)) == (49l));\n assert(multiply((0l), (1l)) == (0l));\n assert(multiply((0l), (0l)) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given list of numbers (of at least two elements), apply a linear transform to that list,\n // such that the smallest number will become 0 and the largest will become 1\n def rescaleToUnit(numbers : List[Float]) : List[Float] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(rescaleToUnit((List[Float](2.0f.toFloat, 49.9f.toFloat))).equals((List[Float](0.0f.toFloat, 1.0f.toFloat))));\n assert(rescaleToUnit((List[Float](100.0f.toFloat, 49.9f.toFloat))).equals((List[Float](1.0f.toFloat, 0.0f.toFloat))));\n assert(rescaleToUnit((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat, 5.0f.toFloat))).equals((List[Float](0.0f.toFloat, 0.25f.toFloat, 0.5f.toFloat, 0.75f.toFloat, 1.0f.toFloat))));\n assert(rescaleToUnit((List[Float](2.0f.toFloat, 1.0f.toFloat, 5.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat))).equals((List[Float](0.25f.toFloat, 0.0f.toFloat, 1.0f.toFloat, 0.5f.toFloat, 0.75f.toFloat))));\n assert(rescaleToUnit((List[Float](12.0f.toFloat, 11.0f.toFloat, 15.0f.toFloat, 13.0f.toFloat, 14.0f.toFloat))).equals((List[Float](0.25f.toFloat, 0.0f.toFloat, 1.0f.toFloat, 0.5f.toFloat, 0.75f.toFloat))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a positive integer n, return the product of the odd digits.\n // Return 0 if all digits are even.\n // For example:\n def digits(n : Long) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(digits((5l)) == (5l));\n assert(digits((54l)) == (5l));\n assert(digits((120l)) == (1l));\n assert(digits((5014l)) == (5l));\n assert(digits((98765l)) == (315l));\n assert(digits((5576543l)) == (2625l));\n assert(digits((2468l)) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You will be given the name of a class (a string) and a list of extensions.\n // The extensions are to be used to load additional classes to the class. The\n // strength of the extension is as follows: Let CAP be the number of the uppercase\n // letters in the extension's name, and let SM be the number of lowercase letters \n // in the extension's name, the strength is given by the fraction CAP - SM. \n // You should find the strongest extension and return a string in this \n // format: ClassName.StrongestExtensionName.\n // If there are two or more extensions with the same strength, you should\n // choose the one that comes first in the list.\n // For example, if you are given \"Slices\" as the class and a list of the\n // extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n // return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n // (its strength is -1).\n // Example:\n def StrongestExtension(class_name : String, extensions : List[String]) : String = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(StrongestExtension((\"Watashi\"), (List[String](\"tEN\", \"niNE\", \"eIGHt8OKe\"))).equals((\"Watashi.eIGHt8OKe\")));\n assert(StrongestExtension((\"Boku123\"), (List[String](\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"))).equals((\"Boku123.YEs.WeCaNe\")));\n assert(StrongestExtension((\"__YESIMHERE\"), (List[String](\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"))).equals((\"__YESIMHERE.NuLl__\")));\n assert(StrongestExtension((\"K\"), (List[String](\"Ta\", \"TAR\", \"t234An\", \"cosSo\"))).equals((\"K.TAR\")));\n assert(StrongestExtension((\"__HAHA\"), (List[String](\"Tab\", \"123\", \"781345\", \"-_-\"))).equals((\"__HAHA.123\")));\n assert(StrongestExtension((\"YameRore\"), (List[String](\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"))).equals((\"YameRore.okIWILL123\")));\n assert(StrongestExtension((\"finNNalLLly\"), (List[String](\"Die\", \"NowW\", \"Wow\", \"WoW\"))).equals((\"finNNalLLly.WoW\")));\n assert(StrongestExtension((\"_\"), (List[String](\"Bb\", \"91245\"))).equals((\"_.Bb\")));\n assert(StrongestExtension((\"Sp\"), (List[String](\"671235\", \"Bb\"))).equals((\"Sp.671235\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a string representing a space separated lowercase letters, return a dictionary\n // of the letter with the most repetition and containing the corresponding count.\n // If several letters have the same occurrence, return all of them.\n // Example:\n def histogram(test : String) : Map[String,Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(histogram((\"a b b a\")).equals((Map[String,Long](\"a\" -> 2l, \"b\" -> 2l))));\n assert(histogram((\"a b c a b\")).equals((Map[String,Long](\"a\" -> 2l, \"b\" -> 2l))));\n assert(histogram((\"a b c d g\")).equals((Map[String,Long](\"a\" -> 1l, \"b\" -> 1l, \"c\" -> 1l, \"d\" -> 1l, \"g\" -> 1l))));\n assert(histogram((\"r t g\")).equals((Map[String,Long](\"r\" -> 1l, \"t\" -> 1l, \"g\" -> 1l))));\n assert(histogram((\"b b b b a\")).equals((Map[String,Long](\"b\" -> 4l))));\n assert(histogram((\"r t g\")).equals((Map[String,Long](\"r\" -> 1l, \"t\" -> 1l, \"g\" -> 1l))));\n assert(histogram((\"\")).equals((Map[String,Long]())));\n assert(histogram((\"a\")).equals((Map[String,Long](\"a\" -> 1l))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // pairs_sum_to_zero takes a list of integers as an input.\n // it returns True if there are two distinct elements in the list that\n // sum to zero, and False otherwise.\n def pairsSumToZero(l : List[Long]) : Boolean = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(pairsSumToZero((List[Long](1l.toLong, 3l.toLong, 5l.toLong, 0l.toLong))) == (false));\n assert(pairsSumToZero((List[Long](1l.toLong, 3l.toLong, -2l.toLong, 1l.toLong))) == (false));\n assert(pairsSumToZero((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 7l.toLong))) == (false));\n assert(pairsSumToZero((List[Long](2l.toLong, 4l.toLong, -5l.toLong, 3l.toLong, 5l.toLong, 7l.toLong))) == (true));\n assert(pairsSumToZero((List[Long](1l.toLong))) == (false));\n assert(pairsSumToZero((List[Long](-3l.toLong, 9l.toLong, -1l.toLong, 3l.toLong, 2l.toLong, 30l.toLong))) == (true));\n assert(pairsSumToZero((List[Long](-3l.toLong, 9l.toLong, -1l.toLong, 3l.toLong, 2l.toLong, 31l.toLong))) == (true));\n assert(pairsSumToZero((List[Long](-3l.toLong, 9l.toLong, -1l.toLong, 4l.toLong, 2l.toLong, 30l.toLong))) == (false));\n assert(pairsSumToZero((List[Long](-3l.toLong, 9l.toLong, -1l.toLong, 4l.toLong, 2l.toLong, 31l.toLong))) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that accepts two lists of strings and returns the list that has \n // total number of chars in the all strings of the list less than the other list.\n // if the two lists have the same number of chars, return the first list.\n // Examples\n def totalMatch(lst1 : List[String], lst2 : List[String]) : List[String] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(totalMatch((List[String]()), (List[String]())).equals((List[String]())));\n assert(totalMatch((List[String](\"hi\", \"admin\")), (List[String](\"hi\", \"hi\"))).equals((List[String](\"hi\", \"hi\"))));\n assert(totalMatch((List[String](\"hi\", \"admin\")), (List[String](\"hi\", \"hi\", \"admin\", \"project\"))).equals((List[String](\"hi\", \"admin\"))));\n assert(totalMatch((List[String](\"4\")), (List[String](\"1\", \"2\", \"3\", \"4\", \"5\"))).equals((List[String](\"4\"))));\n assert(totalMatch((List[String](\"hi\", \"admin\")), (List[String](\"hI\", \"Hi\"))).equals((List[String](\"hI\", \"Hi\"))));\n assert(totalMatch((List[String](\"hi\", \"admin\")), (List[String](\"hI\", \"hi\", \"hi\"))).equals((List[String](\"hI\", \"hi\", \"hi\"))));\n assert(totalMatch((List[String](\"hi\", \"admin\")), (List[String](\"hI\", \"hi\", \"hii\"))).equals((List[String](\"hi\", \"admin\"))));\n assert(totalMatch((List[String]()), (List[String](\"this\"))).equals((List[String]())));\n assert(totalMatch((List[String](\"this\")), (List[String]())).equals((List[String]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Circular shift the digits of the integer x, shift the digits right by shift\n // and return the result as a string.\n // If shift > number of digits, return digits reversed.\n def circularShift(x : Long, shift : Long) : String = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(circularShift((100l), (2l)).equals((\"001\")));\n assert(circularShift((12l), (2l)).equals((\"12\")));\n assert(circularShift((97l), (8l)).equals((\"79\")));\n assert(circularShift((12l), (1l)).equals((\"21\")));\n assert(circularShift((11l), (101l)).equals((\"11\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return True is list elements are monotonically increasing or decreasing.\n def monotonic(l : List[Long]) : Boolean = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(monotonic((List[Long](1l.toLong, 2l.toLong, 4l.toLong, 10l.toLong))) == (true));\n assert(monotonic((List[Long](1l.toLong, 2l.toLong, 4l.toLong, 20l.toLong))) == (true));\n assert(monotonic((List[Long](1l.toLong, 20l.toLong, 4l.toLong, 10l.toLong))) == (false));\n assert(monotonic((List[Long](4l.toLong, 1l.toLong, 0l.toLong, -10l.toLong))) == (true));\n assert(monotonic((List[Long](4l.toLong, 1l.toLong, 1l.toLong, 0l.toLong))) == (true));\n assert(monotonic((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 2l.toLong, 5l.toLong, 60l.toLong))) == (false));\n assert(monotonic((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 60l.toLong))) == (true));\n assert(monotonic((List[Long](9l.toLong, 9l.toLong, 9l.toLong, 9l.toLong))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n // Example\n def isEqualToSumEven(n : Long) : Boolean = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(isEqualToSumEven((4l)) == (false));\n assert(isEqualToSumEven((6l)) == (false));\n assert(isEqualToSumEven((8l)) == (true));\n assert(isEqualToSumEven((10l)) == (true));\n assert(isEqualToSumEven((11l)) == (false));\n assert(isEqualToSumEven((12l)) == (true));\n assert(isEqualToSumEven((13l)) == (false));\n assert(isEqualToSumEven((16l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Input to this function is a string representing musical notes in a special ASCII format.\n // Your task is to parse this string and return list of integers corresponding to how many beats does each\n // not last.\n // Here is a legend:\n // 'o' - whole note, lasts four beats\n // 'o|' - half note, lasts two beats\n // '.|' - quater note, lasts one beat\n def parseMusic(music_string : String) : List[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(parseMusic((\"\")).equals((List[Long]())));\n assert(parseMusic((\"o o o o\")).equals((List[Long](4l.toLong, 4l.toLong, 4l.toLong, 4l.toLong))));\n assert(parseMusic((\".| .| .| .|\")).equals((List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))));\n assert(parseMusic((\"o| o| .| .| o o o o\")).equals((List[Long](2l.toLong, 2l.toLong, 1l.toLong, 1l.toLong, 4l.toLong, 4l.toLong, 4l.toLong, 4l.toLong))));\n assert(parseMusic((\"o| .| o| .| o o| o o|\")).equals((List[Long](2l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 4l.toLong, 2l.toLong, 4l.toLong, 2l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // \"\n // This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n // multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n // change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n // Examples:\n def sumSquares(lst : List[Long]) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sumSquares((List[Long](1l.toLong, 2l.toLong, 3l.toLong))) == (6l));\n assert(sumSquares((List[Long](1l.toLong, 4l.toLong, 9l.toLong))) == (14l));\n assert(sumSquares((List[Long]())) == (0l));\n assert(sumSquares((List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))) == (9l));\n assert(sumSquares((List[Long](-1l.toLong, -1l.toLong, -1l.toLong, -1l.toLong, -1l.toLong, -1l.toLong, -1l.toLong, -1l.toLong, -1l.toLong))) == (-3l));\n assert(sumSquares((List[Long](0l.toLong))) == (0l));\n assert(sumSquares((List[Long](-1l.toLong, -5l.toLong, 2l.toLong, -1l.toLong, -5l.toLong))) == (-126l));\n assert(sumSquares((List[Long](-56l.toLong, -99l.toLong, 1l.toLong, 0l.toLong, -2l.toLong))) == (3030l));\n assert(sumSquares((List[Long](-1l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, -1l.toLong))) == (0l));\n assert(sumSquares((List[Long](-16l.toLong, -9l.toLong, -2l.toLong, 36l.toLong, 36l.toLong, 26l.toLong, -20l.toLong, 25l.toLong, -40l.toLong, 20l.toLong, -4l.toLong, 12l.toLong, -26l.toLong, 35l.toLong, 37l.toLong))) == (-14196l));\n assert(sumSquares((List[Long](-1l.toLong, -3l.toLong, 17l.toLong, -1l.toLong, -15l.toLong, 13l.toLong, -1l.toLong, 14l.toLong, -14l.toLong, -12l.toLong, -5l.toLong, 14l.toLong, -14l.toLong, 6l.toLong, 13l.toLong, 11l.toLong, 16l.toLong, 16l.toLong, 4l.toLong, 10l.toLong))) == (-1448l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // triples_sum_to_zero takes a list of integers as an input.\n // it returns True if there are three distinct elements in the list that\n // sum to zero, and False otherwise.\n def triplesSumToZero(l : List[Long]) : Boolean = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(triplesSumToZero((List[Long](1l.toLong, 3l.toLong, 5l.toLong, 0l.toLong))) == (false));\n assert(triplesSumToZero((List[Long](1l.toLong, 3l.toLong, 5l.toLong, -1l.toLong))) == (false));\n assert(triplesSumToZero((List[Long](1l.toLong, 3l.toLong, -2l.toLong, 1l.toLong))) == (true));\n assert(triplesSumToZero((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 7l.toLong))) == (false));\n assert(triplesSumToZero((List[Long](1l.toLong, 2l.toLong, 5l.toLong, 7l.toLong))) == (false));\n assert(triplesSumToZero((List[Long](2l.toLong, 4l.toLong, -5l.toLong, 3l.toLong, 9l.toLong, 7l.toLong))) == (true));\n assert(triplesSumToZero((List[Long](1l.toLong))) == (false));\n assert(triplesSumToZero((List[Long](1l.toLong, 3l.toLong, 5l.toLong, -100l.toLong))) == (false));\n assert(triplesSumToZero((List[Long](100l.toLong, 3l.toLong, 5l.toLong, -100l.toLong))) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // brackets is a string of \"<\" and \">\".\n // return True if every opening bracket has a corresponding closing bracket.\n def correctBracketing(brackets : String) : Boolean = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(correctBracketing((\"<>\")) == (true));\n assert(correctBracketing((\"<<><>>\")) == (true));\n assert(correctBracketing((\"<><><<><>><>\")) == (true));\n assert(correctBracketing((\"<><><<<><><>><>><<><><<>>>\")) == (true));\n assert(correctBracketing((\"<<<><>>>>\")) == (false));\n assert(correctBracketing((\"><<>\")) == (false));\n assert(correctBracketing((\"<\")) == (false));\n assert(correctBracketing((\"<<<<\")) == (false));\n assert(correctBracketing((\">\")) == (false));\n assert(correctBracketing((\"<<>\")) == (false));\n assert(correctBracketing((\"<><><<><>><>><<>\")) == (false));\n assert(correctBracketing((\"<><><<><>><>>><>\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that takes an array of numbers as input and returns \n // the number of elements in the array that are greater than 10 and both \n // first and last digits of a number are odd (1, 3, 5, 7, 9).\n // For example:\n def specialFilter(nums : List[Long]) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(specialFilter((List[Long](5l.toLong, -2l.toLong, 1l.toLong, -5l.toLong))) == (0l));\n assert(specialFilter((List[Long](15l.toLong, -73l.toLong, 14l.toLong, -15l.toLong))) == (1l));\n assert(specialFilter((List[Long](33l.toLong, -2l.toLong, -3l.toLong, 45l.toLong, 21l.toLong, 109l.toLong))) == (2l));\n assert(specialFilter((List[Long](43l.toLong, -12l.toLong, 93l.toLong, 125l.toLong, 121l.toLong, 109l.toLong))) == (4l));\n assert(specialFilter((List[Long](71l.toLong, -2l.toLong, -33l.toLong, 75l.toLong, 21l.toLong, 19l.toLong))) == (3l));\n assert(specialFilter((List[Long](1l.toLong))) == (0l));\n assert(specialFilter((List[Long]())) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a dictionary, return True if all keys are strings in lower \n // case or all keys are strings in upper case, else return False.\n // The function should return False is the given dictionary is empty.\n // Examples:\n def checkDictCase(dict : Map[String,String]) : Boolean = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(checkDictCase((Map[String,String](\"p\" -> \"pineapple\", \"b\" -> \"banana\"))) == (true));\n assert(checkDictCase((Map[String,String](\"p\" -> \"pineapple\", \"A\" -> \"banana\", \"B\" -> \"banana\"))) == (false));\n assert(checkDictCase((Map[String,String](\"p\" -> \"pineapple\", \"5\" -> \"banana\", \"a\" -> \"apple\"))) == (false));\n assert(checkDictCase((Map[String,String](\"Name\" -> \"John\", \"Age\" -> \"36\", \"City\" -> \"Houston\"))) == (false));\n assert(checkDictCase((Map[String,String](\"STATE\" -> \"NC\", \"ZIP\" -> \"12345\"))) == (true));\n assert(checkDictCase((Map[String,String](\"fruit\" -> \"Orange\", \"taste\" -> \"Sweet\"))) == (true));\n assert(checkDictCase((Map[String,String]())) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n // should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n // alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n // Examples\n def splitWords(txt : String) : Either[List[String], Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(splitWords((\"Hello world!\")).equals(List[String](\"Hello\", \"world!\")));\n assert(splitWords((\"Hello,world!\")).equals(List[String](\"Hello\", \"world!\")));\n assert(splitWords((\"Hello world,!\")).equals(List[String](\"Hello\", \"world,!\")));\n assert(splitWords((\"Hello,Hello,world !\")).equals(List[String](\"Hello,Hello,world\", \"!\")));\n assert(splitWords((\"abcdef\")).equals(3l));\n assert(splitWords((\"aaabb\")).equals(2l));\n assert(splitWords((\"aaaBb\")).equals(1l));\n assert(splitWords((\"\")).equals(0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n // fibfib(0) == 0\n // fibfib(1) == 0\n // fibfib(2) == 1\n // fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n // Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n def fibfib(n : Long) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(fibfib((2l)) == (1l));\n assert(fibfib((1l)) == (0l));\n assert(fibfib((5l)) == (4l));\n assert(fibfib((8l)) == (24l));\n assert(fibfib((10l)) == (81l));\n assert(fibfib((12l)) == (274l));\n assert(fibfib((14l)) == (927l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a list of numbers.\n // You need to return the sum of squared numbers in the given list,\n // round each element in the list to the upper int(Ceiling) first.\n // Examples:\n def sumSquares(lst : List[Float]) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sumSquares((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat))) == (14l));\n assert(sumSquares((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat))) == (14l));\n assert(sumSquares((List[Float](1.0f.toFloat, 3.0f.toFloat, 5.0f.toFloat, 7.0f.toFloat))) == (84l));\n assert(sumSquares((List[Float](1.4f.toFloat, 4.2f.toFloat, 0.0f.toFloat))) == (29l));\n assert(sumSquares((List[Float](-2.4f.toFloat, 1.0f.toFloat, 1.0f.toFloat))) == (6l));\n assert(sumSquares((List[Float](100.0f.toFloat, 1.0f.toFloat, 15.0f.toFloat, 2.0f.toFloat))) == (10230l));\n assert(sumSquares((List[Float](10000.0f.toFloat, 10000.0f.toFloat))) == (200000000l));\n assert(sumSquares((List[Float](-1.4f.toFloat, 4.6f.toFloat, 6.3f.toFloat))) == (75l));\n assert(sumSquares((List[Float](-1.4f.toFloat, 17.9f.toFloat, 18.9f.toFloat, 19.9f.toFloat))) == (1086l));\n assert(sumSquares((List[Float](0.0f.toFloat))) == (0l));\n assert(sumSquares((List[Float](-1.0f.toFloat))) == (1l));\n assert(sumSquares((List[Float](-1.0f.toFloat, 1.0f.toFloat, 0.0f.toFloat))) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_85_add", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a non-empty list of integers lst. add the even elements that are at odd indices..\n // Examples:\n def add(lst : List[Long]) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(add((List[Long](4l.toLong, 88l.toLong))) == (88l));\n assert(add((List[Long](4l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 2l.toLong, 122l.toLong))) == (122l));\n assert(add((List[Long](4l.toLong, 0l.toLong, 6l.toLong, 7l.toLong))) == (0l));\n assert(add((List[Long](4l.toLong, 4l.toLong, 6l.toLong, 8l.toLong))) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return sorted unique elements in a list\n def unique(l : List[Long]) : List[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(unique((List[Long](5l.toLong, 3l.toLong, 5l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 9l.toLong, 0l.toLong, 123l.toLong))).equals((List[Long](0l.toLong, 2l.toLong, 3l.toLong, 5l.toLong, 9l.toLong, 123l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a string text, replace all spaces in it with underscores, \n // and if a string has more than 2 consecutive spaces, \n // then replace all consecutive spaces with -\n def fixSpaces(text : String) : String = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(fixSpaces((\"Example\")).equals((\"Example\")));\n assert(fixSpaces((\"Mudasir Hanif \")).equals((\"Mudasir_Hanif_\")));\n assert(fixSpaces((\"Yellow Yellow Dirty Fellow\")).equals((\"Yellow_Yellow__Dirty__Fellow\")));\n assert(fixSpaces((\"Exa mple\")).equals((\"Exa-mple\")));\n assert(fixSpaces((\" Exa 1 2 2 mple\")).equals((\"-Exa_1_2_2_mple\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return 2^n modulo p (be aware of numerics).\n def modp(n : Long, p : Long) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(modp((3l), (5l)) == (3l));\n assert(modp((1101l), (101l)) == (2l));\n assert(modp((0l), (101l)) == (1l));\n assert(modp((3l), (11l)) == (8l));\n assert(modp((100l), (101l)) == (1l));\n assert(modp((30l), (5l)) == (4l));\n assert(modp((31l), (5l)) == (3l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You have to write a function which validates a given date string and\n // returns True if the date is valid otherwise False.\n // The date is valid if all of the following rules are satisfied:\n // 1. The date string is not empty.\n // 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n // 3. The months should not be less than 1 or higher than 12.\n // 4. The date should be in the format: mm-dd-yyyy\n def validDate(date : String) : Boolean = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(validDate((\"03-11-2000\")) == (true));\n assert(validDate((\"15-01-2012\")) == (false));\n assert(validDate((\"04-0-2040\")) == (false));\n assert(validDate((\"06-04-2020\")) == (true));\n assert(validDate((\"01-01-2007\")) == (true));\n assert(validDate((\"03-32-2011\")) == (false));\n assert(validDate((\"\")) == (false));\n assert(validDate((\"04-31-3000\")) == (false));\n assert(validDate((\"06-06-2005\")) == (true));\n assert(validDate((\"21-31-2000\")) == (false));\n assert(validDate((\"04-12-2003\")) == (true));\n assert(validDate((\"04122003\")) == (false));\n assert(validDate((\"20030412\")) == (false));\n assert(validDate((\"2003-04\")) == (false));\n assert(validDate((\"2003-04-12\")) == (false));\n assert(validDate((\"04-2003\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that takes a string and returns an ordered version of it.\n // Ordered version of string, is a string where all words (separated by space)\n // are replaced by a new word where all the characters arranged in\n // ascending order based on ascii value.\n // Note: You should keep the order of words and blank spaces in the sentence.\n // For example:\n def antiShuffle(s : String) : String = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(antiShuffle((\"Hi\")).equals((\"Hi\")));\n assert(antiShuffle((\"hello\")).equals((\"ehllo\")));\n assert(antiShuffle((\"number\")).equals((\"bemnru\")));\n assert(antiShuffle((\"abcd\")).equals((\"abcd\")));\n assert(antiShuffle((\"Hello World!!!\")).equals((\"Hello !!!Wdlor\")));\n assert(antiShuffle((\"\")).equals((\"\")));\n assert(antiShuffle((\"Hi. My name is Mister Robot. How are you?\")).equals((\".Hi My aemn is Meirst .Rboot How aer ?ouy\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a list of numbers, return whether or not they are sorted\n // in ascending order. If list has more than 1 duplicate of the same\n // number, return False. Assume no negative numbers and only integers.\n // Examples\n def isSorted(lst : List[Long]) : Boolean = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(isSorted((List[Long](5l.toLong))) == (true));\n assert(isSorted((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong))) == (true));\n assert(isSorted((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 4l.toLong, 5l.toLong))) == (false));\n assert(isSorted((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong))) == (true));\n assert(isSorted((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong, 7l.toLong))) == (true));\n assert(isSorted((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 4l.toLong, 5l.toLong, 6l.toLong, 7l.toLong))) == (false));\n assert(isSorted((List[Long]())) == (true));\n assert(isSorted((List[Long](1l.toLong))) == (true));\n assert(isSorted((List[Long](3l.toLong, 2l.toLong, 1l.toLong))) == (false));\n assert(isSorted((List[Long](1l.toLong, 2l.toLong, 2l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))) == (false));\n assert(isSorted((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 3l.toLong, 4l.toLong))) == (false));\n assert(isSorted((List[Long](1l.toLong, 2l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 4l.toLong))) == (true));\n assert(isSorted((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a string s.\n // Your task is to check if the string is happy or not.\n // A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n // For example:\n def isHappy(s : String) : Boolean = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(isHappy((\"a\")) == (false));\n assert(isHappy((\"aa\")) == (false));\n assert(isHappy((\"abcd\")) == (true));\n assert(isHappy((\"aabb\")) == (false));\n assert(isHappy((\"adb\")) == (true));\n assert(isHappy((\"xyy\")) == (false));\n assert(isHappy((\"iopaxpoi\")) == (true));\n assert(isHappy((\"iopaxioi\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that returns True if the object q will fly, and False otherwise.\n // The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n // Example:\n // # 1+2 is less than the maximum possible weight, but it's unbalanced.\n // # it's balanced, but 3+2+3 is more than the maximum possible weight.\n // # 3+2+3 is less than the maximum possible weight, and it's balanced.\n // # 3 is less than the maximum possible weight, and it's balanced.\n def willItFly(q : List[Long], w : Long) : Boolean = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(willItFly((List[Long](3l.toLong, 2l.toLong, 3l.toLong)), (9l)) == (true));\n assert(willItFly((List[Long](1l.toLong, 2l.toLong)), (5l)) == (false));\n assert(willItFly((List[Long](3l.toLong)), (5l)) == (true));\n assert(willItFly((List[Long](3l.toLong, 2l.toLong, 3l.toLong)), (1l)) == (false));\n assert(willItFly((List[Long](1l.toLong, 2l.toLong, 3l.toLong)), (6l)) == (false));\n assert(willItFly((List[Long](5l.toLong)), (5l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given an array of non-negative integers, return a copy of the given array after sorting,\n // you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n // or sort it in descending order if the sum( first index value, last index value) is even.\n // Note:\n // * don't change the given array.\n // Examples:\n def sortArray(array : List[Long]) : List[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sortArray((List[Long]())).equals((List[Long]())));\n assert(sortArray((List[Long](5l.toLong))).equals((List[Long](5l.toLong))));\n assert(sortArray((List[Long](2l.toLong, 4l.toLong, 3l.toLong, 0l.toLong, 1l.toLong, 5l.toLong))).equals((List[Long](0l.toLong, 1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong))));\n assert(sortArray((List[Long](2l.toLong, 4l.toLong, 3l.toLong, 0l.toLong, 1l.toLong, 5l.toLong, 6l.toLong))).equals((List[Long](6l.toLong, 5l.toLong, 4l.toLong, 3l.toLong, 2l.toLong, 1l.toLong, 0l.toLong))));\n assert(sortArray((List[Long](2l.toLong, 1l.toLong))).equals((List[Long](1l.toLong, 2l.toLong))));\n assert(sortArray((List[Long](15l.toLong, 42l.toLong, 87l.toLong, 32l.toLong, 11l.toLong, 0l.toLong))).equals((List[Long](0l.toLong, 11l.toLong, 15l.toLong, 32l.toLong, 42l.toLong, 87l.toLong))));\n assert(sortArray((List[Long](21l.toLong, 14l.toLong, 23l.toLong, 11l.toLong))).equals((List[Long](23l.toLong, 21l.toLong, 14l.toLong, 11l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Implement a function that takes an non-negative integer and returns an array of the first n\n // integers that are prime numbers and less than n.\n // for example:\n def countUpTo(n : Long) : List[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(countUpTo((5l)).equals((List[Long](2l.toLong, 3l.toLong))));\n assert(countUpTo((6l)).equals((List[Long](2l.toLong, 3l.toLong, 5l.toLong))));\n assert(countUpTo((7l)).equals((List[Long](2l.toLong, 3l.toLong, 5l.toLong))));\n assert(countUpTo((10l)).equals((List[Long](2l.toLong, 3l.toLong, 5l.toLong, 7l.toLong))));\n assert(countUpTo((0l)).equals((List[Long]())));\n assert(countUpTo((22l)).equals((List[Long](2l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 11l.toLong, 13l.toLong, 17l.toLong, 19l.toLong))));\n assert(countUpTo((1l)).equals((List[Long]())));\n assert(countUpTo((18l)).equals((List[Long](2l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 11l.toLong, 13l.toLong, 17l.toLong))));\n assert(countUpTo((47l)).equals((List[Long](2l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 11l.toLong, 13l.toLong, 17l.toLong, 19l.toLong, 23l.toLong, 29l.toLong, 31l.toLong, 37l.toLong, 41l.toLong, 43l.toLong))));\n assert(countUpTo((101l)).equals((List[Long](2l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 11l.toLong, 13l.toLong, 17l.toLong, 19l.toLong, 23l.toLong, 29l.toLong, 31l.toLong, 37l.toLong, 41l.toLong, 43l.toLong, 47l.toLong, 53l.toLong, 59l.toLong, 61l.toLong, 67l.toLong, 71l.toLong, 73l.toLong, 79l.toLong, 83l.toLong, 89l.toLong, 97l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Out of list of strings, return the longest one. Return the first one in case of multiple\n // strings of the same length. Return None in case the input list is empty.\n def longest(strings : List[String]) : Option[String] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(longest((List[String]())).equals(None));\n assert(longest((List[String](\"x\", \"y\", \"z\"))).equals(\"x\"));\n assert(longest((List[String](\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"))).equals(\"zzzz\"));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n // reverse the resulting array, and then replace each digit by its corresponding name from\n // \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n // For example:\n // If the array is empty, return an empty array:\n // If the array has any strange number ignore it:\n def byLength(arr : List[Long]) : List[String] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(byLength((List[Long](2l.toLong, 1l.toLong, 1l.toLong, 4l.toLong, 5l.toLong, 8l.toLong, 2l.toLong, 3l.toLong))).equals((List[String](\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"))));\n assert(byLength((List[Long]())).equals((List[String]())));\n assert(byLength((List[Long](1l.toLong, -1l.toLong, 55l.toLong))).equals((List[String](\"One\"))));\n assert(byLength((List[Long](1l.toLong, -1l.toLong, 3l.toLong, 2l.toLong))).equals((List[String](\"Three\", \"Two\", \"One\"))));\n assert(byLength((List[Long](9l.toLong, 4l.toLong, 8l.toLong))).equals((List[String](\"Nine\", \"Eight\", \"Four\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_106_f", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Implement the function f that takes n as a parameter,\n // 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\n // or the sum of numbers from 1 to i otherwise.\n // i starts from 1.\n // the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n // Example:\n def f(n : Long) : List[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(f((5l)).equals((List[Long](1l.toLong, 2l.toLong, 6l.toLong, 24l.toLong, 15l.toLong))));\n assert(f((7l)).equals((List[Long](1l.toLong, 2l.toLong, 6l.toLong, 24l.toLong, 15l.toLong, 720l.toLong, 28l.toLong))));\n assert(f((1l)).equals((List[Long](1l.toLong))));\n assert(f((3l)).equals((List[Long](1l.toLong, 2l.toLong, 6l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n def fizzBuzz(n : Long) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(fizzBuzz((50l)) == (0l));\n assert(fizzBuzz((78l)) == (2l));\n assert(fizzBuzz((79l)) == (3l));\n assert(fizzBuzz((100l)) == (3l));\n assert(fizzBuzz((200l)) == (6l));\n assert(fizzBuzz((4000l)) == (192l));\n assert(fizzBuzz((10000l)) == (639l));\n assert(fizzBuzz((100000l)) == (8026l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a positive floating point number, it can be decomposed into\n // and integer part (largest integer smaller than given number) and decimals\n // (leftover part always smaller than 1).\n // Return the decimal part of the number.\n def truncateNumber(number : Float) : Float = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(truncateNumber((3.5f)) == (0.5f));\n assert(truncateNumber((1.25f)) == (0.25f));\n assert(truncateNumber((123.0f)) == (0.0f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n // Empty sum should be equal to 0 and empty product should be equal to 1.\n def sumProduct(numbers : List[Long]) : Tuple2[Long, Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sumProduct((List[Long]())).equals(((0l, 1l))));\n assert(sumProduct((List[Long](1l.toLong, 1l.toLong, 1l.toLong))).equals(((3l, 1l))));\n assert(sumProduct((List[Long](100l.toLong, 0l.toLong))).equals(((100l, 0l))));\n assert(sumProduct((List[Long](3l.toLong, 5l.toLong, 7l.toLong))).equals(((15l, 105l))));\n assert(sumProduct((List[Long](10l.toLong))).equals(((10l, 10l))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a 2 dimensional data, as a nested lists,\n // which is similar to matrix, however, unlike matrices,\n // each row may contain a different number of columns.\n // Given lst, and integer x, find integers x in the list,\n // and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n // each tuple is a coordinate - (row, columns), starting with 0.\n // Sort coordinates initially by rows in ascending order.\n // Also, sort coordinates of the row by columns in descending order.\n // Examples:\n def getRow(lst : List[List[Long]], x : Long) : List[Tuple2[Long, Long]] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(getRow((List[List[Long]](List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 1l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 1l.toLong))), (1l)).equals((List[Tuple2[Long, Long]]((0l, 0l), (1l, 4l), (1l, 0l), (2l, 5l), (2l, 0l)))));\n assert(getRow((List[List[Long]](List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong))), (2l)).equals((List[Tuple2[Long, Long]]((0l, 1l), (1l, 1l), (2l, 1l), (3l, 1l), (4l, 1l), (5l, 1l)))));\n assert(getRow((List[List[Long]](List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 1l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 1l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 1l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 1l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 1l.toLong))), (1l)).equals((List[Tuple2[Long, Long]]((0l, 0l), (1l, 0l), (2l, 1l), (2l, 0l), (3l, 2l), (3l, 0l), (4l, 3l), (4l, 0l), (5l, 4l), (5l, 0l), (6l, 5l), (6l, 0l)))));\n assert(getRow((List[List[Long]]()), (1l)).equals((List[Tuple2[Long, Long]]())));\n assert(getRow((List[List[Long]](List[Long](1l.toLong))), (2l)).equals((List[Tuple2[Long, Long]]())));\n assert(getRow((List[List[Long]](List[Long](), List[Long](1l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong))), (3l)).equals((List[Tuple2[Long, Long]]((2l, 2l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You're a hungry rabbit, and you already have eaten a certain number of carrots,\n // but now you need to eat more carrots to complete the day's meals.\n // you should return an array of [ total number of eaten carrots after your meals,\n // the number of carrots left after your meals ]\n // if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n // Example:\n // Variables:\n // @number : integer\n // the number of carrots that you have eaten.\n // @need : integer\n // the number of carrots that you need to eat.\n // @remaining : integer\n // the number of remaining carrots thet exist in stock\n // Constrain:\n // * 0 <= number <= 1000\n // * 0 <= need <= 1000\n // * 0 <= remaining <= 1000\n // Have fun :)\n def eat(number : Long, need : Long, remaining : Long) : List[Long] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(eat((5l), (6l), (10l)).equals((List[Long](11l.toLong, 4l.toLong))));\n assert(eat((4l), (8l), (9l)).equals((List[Long](12l.toLong, 1l.toLong))));\n assert(eat((1l), (10l), (10l)).equals((List[Long](11l.toLong, 0l.toLong))));\n assert(eat((2l), (11l), (5l)).equals((List[Long](7l.toLong, 0l.toLong))));\n assert(eat((4l), (5l), (7l)).equals((List[Long](9l.toLong, 2l.toLong))));\n assert(eat((4l), (5l), (1l)).equals((List[Long](5l.toLong, 0l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a positive integer N, return the total sum of its digits in binary.\n // Example\n // Variables:\n // @N integer\n // Constraints: 0 \u2264 N \u2264 10000.\n // Output:\n // a string of binary number\n def solve(N : Long) : String = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(solve((1000l)).equals((\"1\")));\n assert(solve((150l)).equals((\"110\")));\n assert(solve((147l)).equals((\"1100\")));\n assert(solve((333l)).equals((\"1001\")));\n assert(solve((963l)).equals((\"10010\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a list of integers.\n // You need to find the largest prime value and return the sum of its digits.\n // Examples:\n def skjkasdkd(lst : List[Long]) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(skjkasdkd((List[Long](0l.toLong, 3l.toLong, 2l.toLong, 1l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 4l.toLong, 5l.toLong, 5l.toLong, 5l.toLong, 2l.toLong, 181l.toLong, 32l.toLong, 4l.toLong, 32l.toLong, 3l.toLong, 2l.toLong, 32l.toLong, 324l.toLong, 4l.toLong, 3l.toLong))) == (10l));\n assert(skjkasdkd((List[Long](1l.toLong, 0l.toLong, 1l.toLong, 8l.toLong, 2l.toLong, 4597l.toLong, 2l.toLong, 1l.toLong, 3l.toLong, 40l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 2l.toLong, 4l.toLong, 2l.toLong, 5l.toLong, 1l.toLong))) == (25l));\n assert(skjkasdkd((List[Long](1l.toLong, 3l.toLong, 1l.toLong, 32l.toLong, 5107l.toLong, 34l.toLong, 83278l.toLong, 109l.toLong, 163l.toLong, 23l.toLong, 2323l.toLong, 32l.toLong, 30l.toLong, 1l.toLong, 9l.toLong, 3l.toLong))) == (13l));\n assert(skjkasdkd((List[Long](0l.toLong, 724l.toLong, 32l.toLong, 71l.toLong, 99l.toLong, 32l.toLong, 6l.toLong, 0l.toLong, 5l.toLong, 91l.toLong, 83l.toLong, 0l.toLong, 5l.toLong, 6l.toLong))) == (11l));\n assert(skjkasdkd((List[Long](0l.toLong, 81l.toLong, 12l.toLong, 3l.toLong, 1l.toLong, 21l.toLong))) == (3l));\n assert(skjkasdkd((List[Long](0l.toLong, 8l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 7l.toLong))) == (7l));\n assert(skjkasdkd((List[Long](8191l.toLong))) == (19l));\n assert(skjkasdkd((List[Long](8191l.toLong, 123456l.toLong, 127l.toLong, 7l.toLong))) == (19l));\n assert(skjkasdkd((List[Long](127l.toLong, 97l.toLong, 8192l.toLong))) == (10l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given an array arr of integers, find the minimum number of elements that\n // need to be changed to make the array palindromic. A palindromic array is an array that\n // is read the same backwards and forwards. In one change, you can change one element to any other element.\n // For example:\n def smallestChange(arr : List[Long]) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(smallestChange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 5l.toLong, 4l.toLong, 7l.toLong, 9l.toLong, 6l.toLong))) == (4l));\n assert(smallestChange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 3l.toLong, 2l.toLong, 2l.toLong))) == (1l));\n assert(smallestChange((List[Long](1l.toLong, 4l.toLong, 2l.toLong))) == (1l));\n assert(smallestChange((List[Long](1l.toLong, 4l.toLong, 4l.toLong, 2l.toLong))) == (1l));\n assert(smallestChange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 2l.toLong, 1l.toLong))) == (0l));\n assert(smallestChange((List[Long](3l.toLong, 1l.toLong, 1l.toLong, 3l.toLong))) == (0l));\n assert(smallestChange((List[Long](1l.toLong))) == (0l));\n assert(smallestChange((List[Long](0l.toLong, 1l.toLong))) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // It is the last week of the semester and the teacher has to give the grades\n // to students. The teacher has been making her own algorithm for grading.\n // The only problem is, she has lost the code she used for grading.\n // She has given you a list of GPAs for some students and you have to write \n // a function that can output a list of letter grades using the following table:\n // GPA | Letter grade\n // 4.0 A+\n // > 3.7 A \n // > 3.3 A- \n // > 3.0 B+\n // > 2.7 B \n // > 2.3 B-\n // > 2.0 C+\n // > 1.7 C\n // > 1.3 C-\n // > 1.0 D+ \n // > 0.7 D \n // > 0.0 D-\n // 0.0 E\n // Example:\n def numericalLetterGrade(grades : List[Float]) : List[String] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(numericalLetterGrade((List[Float](4.0f.toFloat, 3l.toFloat, 1.7f.toFloat, 2l.toFloat, 3.5f.toFloat))).equals((List[String](\"A+\", \"B\", \"C-\", \"C\", \"A-\"))));\n assert(numericalLetterGrade((List[Float](1.2f.toFloat))).equals((List[String](\"D+\"))));\n assert(numericalLetterGrade((List[Float](0.5f.toFloat))).equals((List[String](\"D-\"))));\n assert(numericalLetterGrade((List[Float](0.0f.toFloat))).equals((List[String](\"E\"))));\n assert(numericalLetterGrade((List[Float](1.0f.toFloat, 0.3f.toFloat, 1.5f.toFloat, 2.8f.toFloat, 3.3f.toFloat))).equals((List[String](\"D\", \"D-\", \"C-\", \"B\", \"B+\"))));\n assert(numericalLetterGrade((List[Float](0.0f.toFloat, 0.7f.toFloat))).equals((List[String](\"E\", \"D-\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given the lengths of the three sides of a triangle. Return the area of\n // the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n // Otherwise return -1\n // Three sides make a valid triangle when the sum of any two sides is greater \n // than the third side.\n // Example:\n def triangleArea(a : Long, b : Long, c : Long) : Float = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(triangleArea((3l), (4l), (5l)) == (6.0f));\n assert(triangleArea((1l), (2l), (10l)) == -1l);\n assert(triangleArea((4l), (8l), (5l)) == (8.18f));\n assert(triangleArea((2l), (2l), (2l)) == (1.73f));\n assert(triangleArea((1l), (2l), (3l)) == -1l);\n assert(triangleArea((10l), (5l), (7l)) == (16.25f));\n assert(triangleArea((2l), (6l), (3l)) == -1l);\n assert(triangleArea((1l), (1l), (1l)) == (0.43f));\n assert(triangleArea((2l), (2l), (10l)) == -1l);\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Check if two words have the same characters.\n def sameChars(s0 : String, s1 : String) : Boolean = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddeddabc\")) == (true));\n assert(sameChars((\"abcd\"), (\"dddddddabc\")) == (true));\n assert(sameChars((\"dddddddabc\"), (\"abcd\")) == (true));\n assert(sameChars((\"eabcd\"), (\"dddddddabc\")) == (false));\n assert(sameChars((\"abcd\"), (\"dddddddabcf\")) == (false));\n assert(sameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddddabc\")) == (false));\n assert(sameChars((\"aabb\"), (\"aaccc\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given an array of integers nums, find the minimum sum of any non-empty sub-array\n // of nums.\n // Example\n def minSubArraySum(nums : List[Long]) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(minSubArraySum((List[Long](2l.toLong, 3l.toLong, 4l.toLong, 1l.toLong, 2l.toLong, 4l.toLong))) == (1l));\n assert(minSubArraySum((List[Long](-1l.toLong, -2l.toLong, -3l.toLong))) == (-6l));\n assert(minSubArraySum((List[Long](-1l.toLong, -2l.toLong, -3l.toLong, 2l.toLong, -10l.toLong))) == (-14l));\n assert(minSubArraySum((List[Long](-9999999999999999l.toLong))) == (-9999999999999999l));\n assert(minSubArraySum((List[Long](0l.toLong, 10l.toLong, 20l.toLong, 1000000l.toLong))) == (0l));\n assert(minSubArraySum((List[Long](-1l.toLong, -2l.toLong, -3l.toLong, 10l.toLong, -5l.toLong))) == (-6l));\n assert(minSubArraySum((List[Long](100l.toLong, -1l.toLong, -2l.toLong, -3l.toLong, 10l.toLong, -5l.toLong))) == (-6l));\n assert(minSubArraySum((List[Long](10l.toLong, 11l.toLong, 13l.toLong, 8l.toLong, 3l.toLong, 4l.toLong))) == (3l));\n assert(minSubArraySum((List[Long](100l.toLong, -33l.toLong, 32l.toLong, -1l.toLong, 0l.toLong, -2l.toLong))) == (-33l));\n assert(minSubArraySum((List[Long](-10l.toLong))) == (-10l));\n assert(minSubArraySum((List[Long](7l.toLong))) == (7l));\n assert(minSubArraySum((List[Long](1l.toLong, -1l.toLong))) == (-1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a string s and a natural number n, you have been tasked to implement \n // a function that returns a list of all words from string s that contain exactly \n // n consonants, in order these words appear in the string s.\n // If the string s is empty then the function should return an empty list.\n // Note: you may assume the input string contains only letters and spaces.\n // Examples:\n def selectWords(s : String, n : Long) : List[String] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(selectWords((\"Mary had a little lamb\"), (4l)).equals((List[String](\"little\"))));\n assert(selectWords((\"Mary had a little lamb\"), (3l)).equals((List[String](\"Mary\", \"lamb\"))));\n assert(selectWords((\"simple white space\"), (2l)).equals((List[String]())));\n assert(selectWords((\"Hello world\"), (4l)).equals((List[String](\"world\"))));\n assert(selectWords((\"Uncle sam\"), (3l)).equals((List[String](\"Uncle\"))));\n assert(selectWords((\"\"), (4l)).equals((List[String]())));\n assert(selectWords((\"a b c d e f\"), (1l)).equals((List[String](\"b\", \"c\", \"d\", \"f\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return list of all prefixes from shortest to longest of the input string\n def allPrefixes(string : String) : List[String] = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(allPrefixes((\"\")).equals((List[String]())));\n assert(allPrefixes((\"asdfgh\")).equals((List[String](\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"))));\n assert(allPrefixes((\"WWW\")).equals((List[String](\"W\", \"WW\", \"WWW\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function that takes a value (string) representing a number\n // and returns the closest integer to it. If the number is equidistant\n // from two integers, round it away from zero.\n // Examples\n // Note:\n // Rounding away from zero means that if the given number is equidistant\n // from two integers, the one you should return is the one that is the\n // farthest from zero. For example closest_integer(\"14.5\") should\n // return 15 and closest_integer(\"-14.5\") should return -15.\n def closestInteger(value : String) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(closestInteger((\"10\")) == (10l));\n assert(closestInteger((\"14.5\")) == (15l));\n assert(closestInteger((\"-15.5\")) == (-16l));\n assert(closestInteger((\"15.3\")) == (15l));\n assert(closestInteger((\"0\")) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function which takes a string representing a file's name, and returns\n // 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n // A file's name is considered to be valid if and only if all the following conditions \n // are met:\n // - There should not be more than three digits ('0'-'9') in the file's name.\n // - The file's name contains exactly one dot '.'\n // - The substring before the dot should not be empty, and it starts with a letter from \n // the latin alphapet ('a'-'z' and 'A'-'Z').\n // - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n // Examples:\n def fileNameCheck(file_name : String) : String = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(fileNameCheck((\"example.txt\")).equals((\"Yes\")));\n assert(fileNameCheck((\"1example.dll\")).equals((\"No\")));\n assert(fileNameCheck((\"s1sdf3.asd\")).equals((\"No\")));\n assert(fileNameCheck((\"K.dll\")).equals((\"Yes\")));\n assert(fileNameCheck((\"MY16FILE3.exe\")).equals((\"Yes\")));\n assert(fileNameCheck((\"His12FILE94.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"_Y.txt\")).equals((\"No\")));\n assert(fileNameCheck((\"?aREYA.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"/this_is_valid.dll\")).equals((\"No\")));\n assert(fileNameCheck((\"this_is_valid.wow\")).equals((\"No\")));\n assert(fileNameCheck((\"this_is_valid.txt\")).equals((\"Yes\")));\n assert(fileNameCheck((\"this_is_valid.txtexe\")).equals((\"No\")));\n assert(fileNameCheck((\"#this2_i4s_5valid.ten\")).equals((\"No\")));\n assert(fileNameCheck((\"@this1_is6_valid.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"this_is_12valid.6exe4.txt\")).equals((\"No\")));\n assert(fileNameCheck((\"all.exe.txt\")).equals((\"No\")));\n assert(fileNameCheck((\"I563_No.exe\")).equals((\"Yes\")));\n assert(fileNameCheck((\"Is3youfault.txt\")).equals((\"Yes\")));\n assert(fileNameCheck((\"no_one#knows.dll\")).equals((\"Yes\")));\n assert(fileNameCheck((\"1I563_Yes3.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"I563_Yes3.txtt\")).equals((\"No\")));\n assert(fileNameCheck((\"final..txt\")).equals((\"No\")));\n assert(fileNameCheck((\"final132\")).equals((\"No\")));\n assert(fileNameCheck((\"_f4indsartal132.\")).equals((\"No\")));\n assert(fileNameCheck((\".txt\")).equals((\"No\")));\n assert(fileNameCheck((\"s.\")).equals((\"No\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given two intervals,\n // where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n // The given intervals are closed which means that the interval (start, end)\n // includes both start and end.\n // For each given interval, it is assumed that its start is less or equal its end.\n // Your task is to determine whether the length of intersection of these two \n // intervals is a prime number.\n // Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n // which its length is 1, which not a prime number.\n // If the length of the intersection is a prime number, return \"YES\",\n // otherwise, return \"NO\".\n // If the two intervals don't intersect, return \"NO\".\n // [input/output] samples:\n def intersection(interval1 : Tuple2[Long, Long], interval2 : Tuple2[Long, Long]) : String = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(intersection(((1l, 2l)), ((2l, 3l))).equals((\"NO\")));\n assert(intersection(((-1l, 1l)), ((0l, 4l))).equals((\"NO\")));\n assert(intersection(((-3l, -1l)), ((-5l, 5l))).equals((\"YES\")));\n assert(intersection(((-2l, 2l)), ((-4l, 0l))).equals((\"YES\")));\n assert(intersection(((-11l, 2l)), ((-1l, -1l))).equals((\"NO\")));\n assert(intersection(((1l, 2l)), ((3l, 5l))).equals((\"NO\")));\n assert(intersection(((1l, 2l)), ((1l, 2l))).equals((\"NO\")));\n assert(intersection(((-2l, -2l)), ((-3l, -2l))).equals((\"NO\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return the largest prime factor of n. Assume n > 1 and is not a prime.\n def largestPrimeFactor(n : Long) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(largestPrimeFactor((15l)) == (5l));\n assert(largestPrimeFactor((27l)) == (3l));\n assert(largestPrimeFactor((63l)) == (7l));\n assert(largestPrimeFactor((330l)) == (11l));\n assert(largestPrimeFactor((13195l)) == (29l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a string, find out how many distinct characters (regardless of case) does it consist of\n def countDistinctCharacters(string : String) : Long = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(countDistinctCharacters((\"\")) == (0l));\n assert(countDistinctCharacters((\"abcde\")) == (5l));\n assert(countDistinctCharacters((\"abcdecadeCADE\")) == (5l));\n assert(countDistinctCharacters((\"aaaaAAAAaaaa\")) == (1l));\n assert(countDistinctCharacters((\"Jerry jERRY JeRRRY\")) == (5l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You're given a list of deposit and withdrawal operations on a bank account that starts with\n // zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n // at that point function should return True. Otherwise it should return False.\n def belowZero(operations : List[Long]) : Boolean = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(belowZero((List[Long]())) == (false));\n assert(belowZero((List[Long](1l.toLong, 2l.toLong, -3l.toLong, 1l.toLong, 2l.toLong, -3l.toLong))) == (false));\n assert(belowZero((List[Long](1l.toLong, 2l.toLong, -4l.toLong, 5l.toLong, 6l.toLong))) == (true));\n assert(belowZero((List[Long](1l.toLong, -1l.toLong, 2l.toLong, -2l.toLong, 5l.toLong, -5l.toLong, 4l.toLong, -4l.toLong))) == (false));\n assert(belowZero((List[Long](1l.toLong, -1l.toLong, 2l.toLong, -2l.toLong, 5l.toLong, -5l.toLong, 4l.toLong, -5l.toLong))) == (true));\n assert(belowZero((List[Long](1l.toLong, -2l.toLong, 2l.toLong, -2l.toLong, 5l.toLong, -5l.toLong, 4l.toLong, -4l.toLong))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Find the shortest palindrome that begins with a supplied string.\n // Algorithm idea is simple:\n // - Find the longest postfix of supplied string that is a palindrome.\n // - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n def makePalindrome(string : String) : String = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(makePalindrome((\"\")).equals((\"\")));\n assert(makePalindrome((\"x\")).equals((\"x\")));\n assert(makePalindrome((\"xyz\")).equals((\"xyzyx\")));\n assert(makePalindrome((\"xyx\")).equals((\"xyx\")));\n assert(makePalindrome((\"jerry\")).equals((\"jerryrrej\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a positive integer, obtain its roman numeral equivalent as a string,\n // and return it in lowercase.\n // Restrictions: 1 <= num <= 1000\n // Examples:\n def intToMiniRoman(number : Long) : String = {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(intToMiniRoman((19l)).equals((\"xix\")));\n assert(intToMiniRoman((152l)).equals((\"clii\")));\n assert(intToMiniRoman((251l)).equals((\"ccli\")));\n assert(intToMiniRoman((426l)).equals((\"cdxxvi\")));\n assert(intToMiniRoman((500l)).equals((\"d\")));\n assert(intToMiniRoman((1l)).equals((\"i\")));\n assert(intToMiniRoman((4l)).equals((\"iv\")));\n assert(intToMiniRoman((43l)).equals((\"xliii\")));\n assert(intToMiniRoman((90l)).equals((\"xc\")));\n assert(intToMiniRoman((94l)).equals((\"xciv\")));\n assert(intToMiniRoman((532l)).equals((\"dxxxii\")));\n assert(intToMiniRoman((900l)).equals((\"cm\")));\n assert(intToMiniRoman((994l)).equals((\"cmxciv\")));\n assert(intToMiniRoman((1000l)).equals((\"m\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - } -] \ No newline at end of file diff --git a/data/scala-reworded.json b/data/scala-reworded.json deleted file mode 100644 index ed2b25c946ca69d01ed8d60d762d9b2bc75f93af..0000000000000000000000000000000000000000 --- a/data/scala-reworded.json +++ /dev/null @@ -1,1922 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // For a given number n, find the largest number that divides n evenly, smaller than n\n // >>> largestDivisor((15l))\n // (5l)\n def largestDivisor(n : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(largestDivisor((3l)) == (1l));\n assert(largestDivisor((7l)) == (1l));\n assert(largestDivisor((10l)) == (5l));\n assert(largestDivisor((100l)) == (50l));\n assert(largestDivisor((49l)) == (7l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_47_median", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return median of elements in the list l.\n // >>> median((List[Long](3l.toLong, 1l.toLong, 2l.toLong, 4l.toLong, 5l.toLong)))\n // 3l\n // >>> median((List[Long](-10l.toLong, 4l.toLong, 6l.toLong, 1000l.toLong, 10l.toLong, 20l.toLong)))\n // (15.0f)\n def median(l : List[Long]) : Float = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(median((List[Long](3l.toLong, 1l.toLong, 2l.toLong, 4l.toLong, 5l.toLong))) == 3l);\n assert(median((List[Long](-10l.toLong, 4l.toLong, 6l.toLong, 1000l.toLong, 10l.toLong, 20l.toLong))) == (8.0f));\n assert(median((List[Long](5l.toLong))) == 5l);\n assert(median((List[Long](6l.toLong, 5l.toLong))) == (5.5f));\n assert(median((List[Long](8l.toLong, 1l.toLong, 3l.toLong, 9l.toLong, 9l.toLong, 2l.toLong, 7l.toLong))) == 7l);\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given two lists operator, and operand. The first list has basic algebra operations, and \n // the second list is a list of integers. Use the two given lists to build the algebric \n // expression and return the evaluation of this expression.\n // The basic algebra operations:\n // Addition ( + ) \n // Subtraction ( - ) \n // Multiplication ( * ) \n // Floor division ( // ) \n // Exponentiation ( ** ) \n // Example:\n // operator['+', '*', '-']\n // list = [2, 3, 4, 5]\n // result = 2 + 3 * 4 - 5\n // => result = 9\n // Note:\n // The length of operator list is equal to the length of operand list minus one.\n // Operand is a list of of non-negative integers.\n // Operator list has at least one operator, and operand list has at least two operands.\n def doAlgebra(op : List[String], operand : List[Long]) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(doAlgebra((List[String](\"**\", \"*\", \"+\")), (List[Long](2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong))) == (37l));\n assert(doAlgebra((List[String](\"+\", \"*\", \"-\")), (List[Long](2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong))) == (9l));\n assert(doAlgebra((List[String](\"//\", \"*\")), (List[Long](7l.toLong, 3l.toLong, 4l.toLong))) == (8l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return maximum element in the list.\n // >>> maxElement((List[Long](1l.toLong, 2l.toLong, 3l.toLong)))\n // (3l)\n // >>> maxElement((List[Long](5l.toLong, 3l.toLong, -5l.toLong, 2l.toLong, -3l.toLong, 3l.toLong, 9l.toLong, 0l.toLong, 123l.toLong, 1l.toLong, -10l.toLong)))\n // (123l)\n def maxElement(l : List[Long]) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(maxElement((List[Long](1l.toLong, 2l.toLong, 3l.toLong))) == (3l));\n assert(maxElement((List[Long](5l.toLong, 3l.toLong, -5l.toLong, 2l.toLong, -3l.toLong, 3l.toLong, 9l.toLong, 0l.toLong, 124l.toLong, 1l.toLong, -10l.toLong))) == (124l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function which returns the largest index of an element which\n // is not greater than or equal to the element immediately preceding it. If\n // no such element exists then return -1. The given list will not contain\n // duplicate values.\n // Examples:\n // >>> canArrange((List[Long](1l.toLong, 2l.toLong, 4l.toLong, 3l.toLong, 5l.toLong)))\n // (3l)\n // >>> canArrange((List[Long](1l.toLong, 2l.toLong, 3l.toLong)))\n // (-1l)\n def canArrange(arr : List[Long]) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(canArrange((List[Long](1l.toLong, 2l.toLong, 4l.toLong, 3l.toLong, 5l.toLong))) == (3l));\n assert(canArrange((List[Long](1l.toLong, 2l.toLong, 4l.toLong, 5l.toLong))) == (-1l));\n assert(canArrange((List[Long](1l.toLong, 4l.toLong, 2l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong, 9l.toLong, 10l.toLong))) == (2l));\n assert(canArrange((List[Long](4l.toLong, 8l.toLong, 5l.toLong, 7l.toLong, 3l.toLong))) == (4l));\n assert(canArrange((List[Long]())) == (-1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Imagine a road that's a perfectly straight infinitely long line.\n // n cars are driving left to right; simultaneously, a different set of n cars\n // are driving right to left. The two sets of cars start out being very far from\n // each other. All cars move in the same speed. Two cars are said to collide\n // when a car that's moving left to right hits a car that's moving right to left.\n // However, the cars are infinitely sturdy and strong; as a result, they continue moving\n // in their trajectory as if they did not collide.\n // This function outputs the number of such collisions.\n def carRaceCollision(n : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(carRaceCollision((2l)) == (4l));\n assert(carRaceCollision((3l)) == (9l));\n assert(carRaceCollision((4l)) == (16l));\n assert(carRaceCollision((8l)) == (64l));\n assert(carRaceCollision((10l)) == (100l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function that returns true if the last character\n // of a given string is an alphabetical character and is not\n // a part of a word, and false otherwise.\n // Note: \"word\" is a group of characters separated by space.\n // Examples:\n // >>> checkIfLastCharIsALetter((\"apple pie\"))\n // (false)\n // >>> checkIfLastCharIsALetter((\"apple pi e\"))\n // (true)\n // >>> checkIfLastCharIsALetter((\"apple pi e \"))\n // (false)\n // >>> checkIfLastCharIsALetter((\"\"))\n // (false)\n def checkIfLastCharIsALetter(txt : String) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(checkIfLastCharIsALetter((\"apple\")) == (false));\n assert(checkIfLastCharIsALetter((\"apple pi e\")) == (true));\n assert(checkIfLastCharIsALetter((\"eeeee\")) == (false));\n assert(checkIfLastCharIsALetter((\"A\")) == (true));\n assert(checkIfLastCharIsALetter((\"Pumpkin pie \")) == (false));\n assert(checkIfLastCharIsALetter((\"Pumpkin pie 1\")) == (false));\n assert(checkIfLastCharIsALetter((\"\")) == (false));\n assert(checkIfLastCharIsALetter((\"eeeee e \")) == (false));\n assert(checkIfLastCharIsALetter((\"apple pie\")) == (false));\n assert(checkIfLastCharIsALetter((\"apple pi e \")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return true if a given number is prime, and false otherwise.\n // >>> isPrime((6l))\n // (false)\n // >>> isPrime((101l))\n // (true)\n // >>> isPrime((11l))\n // (true)\n // >>> isPrime((13441l))\n // (true)\n // >>> isPrime((61l))\n // (true)\n // >>> isPrime((4l))\n // (false)\n // >>> isPrime((1l))\n // (false)\n def isPrime(n : Long) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(isPrime((6l)) == (false));\n assert(isPrime((101l)) == (true));\n assert(isPrime((11l)) == (true));\n assert(isPrime((13441l)) == (true));\n assert(isPrime((61l)) == (true));\n assert(isPrime((4l)) == (false));\n assert(isPrime((1l)) == (false));\n assert(isPrime((5l)) == (true));\n assert(isPrime((11l)) == (true));\n assert(isPrime((17l)) == (true));\n assert(isPrime((85l)) == (false));\n assert(isPrime((77l)) == (false));\n assert(isPrime((255379l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a list of positive integers x. return a sorted list of all \n // elements that hasn't any even digit.\n // Note: Returned list should be sorted in increasing order.\n // For example:\n // >>> uniqueDigits((List[Long](15l.toLong, 33l.toLong, 1422l.toLong, 1l.toLong)))\n // (List[Long](1l.toLong, 15l.toLong, 33l.toLong))\n // >>> uniqueDigits((List[Long](152l.toLong, 323l.toLong, 1422l.toLong, 10l.toLong)))\n // (List[Long]())\n def uniqueDigits(x : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(uniqueDigits((List[Long](15l.toLong, 33l.toLong, 1422l.toLong, 1l.toLong))).equals((List[Long](1l.toLong, 15l.toLong, 33l.toLong))));\n assert(uniqueDigits((List[Long](152l.toLong, 323l.toLong, 1422l.toLong, 10l.toLong))).equals((List[Long]())));\n assert(uniqueDigits((List[Long](12345l.toLong, 2033l.toLong, 111l.toLong, 151l.toLong))).equals((List[Long](111l.toLong, 151l.toLong))));\n assert(uniqueDigits((List[Long](135l.toLong, 103l.toLong, 31l.toLong))).equals((List[Long](31l.toLong, 135l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Input are two strings a and b consisting only of 1s and 0s.\n // Perform binary XOR on these inputs and return result also as a string.\n // >>> stringXor((\"010\"), (\"110\"))\n // (\"100\")\n def stringXor(a : String, b : String) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(stringXor((\"111000\"), (\"101010\")).equals((\"010010\")));\n assert(stringXor((\"1\"), (\"1\")).equals((\"0\")));\n assert(stringXor((\"0101\"), (\"0000\")).equals((\"0101\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // sum_to_n is a function that sums numbers from 1 to n.\n // >>> sumToN((30l))\n // (465l)\n // >>> sumToN((100l))\n // (5050l)\n // >>> sumToN((5l))\n // (15l)\n // >>> sumToN((10l))\n // (55l)\n // >>> sumToN((1l))\n // (1l)\n def sumToN(n : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(sumToN((1l)) == (1l));\n assert(sumToN((6l)) == (21l));\n assert(sumToN((11l)) == (66l));\n assert(sumToN((30l)) == (465l));\n assert(sumToN((100l)) == (5050l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a list of numbers, return the sum of squares of the numbers\n // in the list that are odd. Ignore numbers that are negative or not integers.\n // >>> doubleTheDifference((List[Float](1l.toLong, 3l.toLong, 2l.toLong, 0l.toLong)))\n // (10l)\n // >>> doubleTheDifference((List[Float](-1l.toLong, -2l.toLong, 0l.toLong)))\n // (0l)\n // >>> doubleTheDifference((List[Float](9l.toLong, -2l.toLong)))\n // (81l)\n // >>> doubleTheDifference((List[Float](0l.toLong)))\n // (0l)\n // If the input list is empty, return 0.\n def doubleTheDifference(lst : List[Float]) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(doubleTheDifference((List[Float]())) == (0l));\n assert(doubleTheDifference((List[Float](5.0f.toFloat, 4.0f.toFloat))) == (25l));\n assert(doubleTheDifference((List[Float](0.1f.toFloat, 0.2f.toFloat, 0.3f.toFloat))) == (0l));\n assert(doubleTheDifference((List[Float](-10.0f.toFloat, -20.0f.toFloat, -30.0f.toFloat))) == (0l));\n assert(doubleTheDifference((List[Float](-1.0f.toFloat, -2.0f.toFloat, 8.0f.toFloat))) == (0l));\n assert(doubleTheDifference((List[Float](0.2f.toFloat, 3.0f.toFloat, 5.0f.toFloat))) == (34l));\n assert(doubleTheDifference((List[Float](-9.0f.toFloat, -7.0f.toFloat, -5.0f.toFloat, -3.0f.toFloat, -1.0f.toFloat, 1.0f.toFloat, 3.0f.toFloat, 5.0f.toFloat, 7.0f.toFloat, 9.0f.toFloat))) == (165l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return length of given string\n // >>> stringLength((\"\"))\n // (0l)\n // >>> stringLength((\"abc\"))\n // (3l)\n def strlen(string : String) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(strlen((\"\")) == (0l));\n assert(strlen((\"x\")) == (1l));\n assert(strlen((\"asdasnakj\")) == (9l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You'll be given a string of words, and your task is to count the number\n // of boredoms. A boredom is a sentence that starts with the word \"I\".\n // Sentences are delimited by '.', '?' or '!'.\n // For example:\n // >>> isBored((\"Hello world\"))\n // (0l)\n // >>> isBored((\"The sky is blue. The sun is shining. I love this weather\"))\n // (1l)\n def isBored(S : String) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(isBored((\"Hello world\")) == (0l));\n assert(isBored((\"Is the sky blue?\")) == (0l));\n assert(isBored((\"I love It !\")) == (1l));\n assert(isBored((\"bIt\")) == (0l));\n assert(isBored((\"I feel good today. I will be productive. will kill It\")) == (2l));\n assert(isBored((\"You and I are going for a walk\")) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function vowels_count which takes a string representing\n // a word as input and returns the number of vowels in the string.\n // Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n // vowel, but only when it is at the end of the given word.\n // Example:\n // >>> vowelsCount((\"abcde\"))\n // (2l)\n // >>> vowelsCount((\"ACEDY\"))\n // (3l)\n def vowelsCount(s : String) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(vowelsCount((\"abcde\")) == (2l));\n assert(vowelsCount((\"Alone\")) == (3l));\n assert(vowelsCount((\"key\")) == (2l));\n assert(vowelsCount((\"bye\")) == (1l));\n assert(vowelsCount((\"keY\")) == (2l));\n assert(vowelsCount((\"bYe\")) == (1l));\n assert(vowelsCount((\"ACEDY\")) == (3l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return n-th Fibonacci number.\n // >>> fib((10l))\n // (55l)\n // >>> fib((1l))\n // (1l)\n // >>> fib((8l))\n // (21l)\n def fib(n : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(fib((10l)) == (55l));\n assert(fib((1l)) == (1l));\n assert(fib((8l)) == (21l));\n assert(fib((11l)) == (89l));\n assert(fib((12l)) == (144l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Your task is to implement a function that will simplify the expression\n // x * n. The function returns true if x * n evaluates to a whole number and false\n // otherwise. Both x and n, are string representation of a fraction, and have the following format,\n // / where both numerator and denominator are positive whole numbers.\n // You can assume that x, and n are valid fractions, and do not have zero as denominator.\n // >>> simplify((\"1/5\"), (\"5/1\"))\n // (true)\n // >>> simplify((\"1/6\"), (\"2/1\"))\n // (false)\n // >>> simplify((\"7/10\"), (\"10/2\"))\n // (false)\n def simplify(x : String, n : String) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(simplify((\"1/5\"), (\"5/1\")) == (true));\n assert(simplify((\"1/6\"), (\"2/1\")) == (false));\n assert(simplify((\"5/1\"), (\"3/1\")) == (true));\n assert(simplify((\"7/10\"), (\"10/2\")) == (false));\n assert(simplify((\"2/10\"), (\"50/10\")) == (true));\n assert(simplify((\"7/2\"), (\"4/2\")) == (true));\n assert(simplify((\"11/6\"), (\"6/1\")) == (true));\n assert(simplify((\"2/3\"), (\"5/2\")) == (false));\n assert(simplify((\"5/2\"), (\"3/5\")) == (false));\n assert(simplify((\"2/4\"), (\"8/4\")) == (true));\n assert(simplify((\"2/4\"), (\"4/2\")) == (true));\n assert(simplify((\"1/5\"), (\"5/1\")) == (true));\n assert(simplify((\"1/5\"), (\"1/5\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a string s, count the number of uppercase vowels in even indices.\n // For example:\n // >>> countUpper((\"aBCdEf\"))\n // (1l)\n // >>> countUpper((\"abcdefg\"))\n // (0l)\n // >>> countUpper((\"dBBE\"))\n // (0l)\n def countUpper(s : String) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(countUpper((\"aBCdEf\")) == (1l));\n assert(countUpper((\"abcdefg\")) == (0l));\n assert(countUpper((\"dBBE\")) == (0l));\n assert(countUpper((\"B\")) == (0l));\n assert(countUpper((\"U\")) == (1l));\n assert(countUpper((\"\")) == (0l));\n assert(countUpper((\"EEEE\")) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a rectangular grid of wells. Each row represents a single well,\n // and each 1 in a row represents a single unit of water.\n // Each well has a corresponding bucket that can be used to extract water from it, \n // and all buckets have the same capacity.\n // Your task is to use the buckets to empty the wells.\n // Output the number of times you need to lower the buckets.\n // Example 1:\n // >>> maxFill((List[List[Long]](List[Long](0l.toLong, 0l.toLong, 1l.toLong, 0l.toLong), List[Long](0l.toLong, 1l.toLong, 0l.toLong, 0l.toLong), List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))), (1l))\n // (6l)\n // Example 2:\n // >>> maxFill((List[List[Long]](List[Long](0l.toLong, 0l.toLong, 1l.toLong, 1l.toLong), List[Long](0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong), List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong), List[Long](0l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))), (2l))\n // (5l)\n // Example 3:\n // >>> maxFill((List[List[Long]](List[Long](0l.toLong, 0l.toLong, 0l.toLong), List[Long](0l.toLong, 0l.toLong, 0l.toLong))), (5l))\n // (0l)\n // Constraints:\n // * all wells have the same length\n // * 1 <= grid.length <= 10^2\n // * 1 <= grid[:,1].length <= 10^2\n // * grid[i][j] -> 0 | 1\n // * 1 <= capacity <= 10\n def maxFill(grid : List[List[Long]], capacity : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(maxFill((List[List[Long]](List[Long](0l.toLong, 0l.toLong, 1l.toLong, 0l.toLong), List[Long](0l.toLong, 1l.toLong, 0l.toLong, 0l.toLong), List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))), (1l)) == (6l));\n assert(maxFill((List[List[Long]](List[Long](0l.toLong, 0l.toLong, 1l.toLong, 1l.toLong), List[Long](0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong), List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong), List[Long](0l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))), (2l)) == (5l));\n assert(maxFill((List[List[Long]](List[Long](0l.toLong, 0l.toLong, 0l.toLong), List[Long](0l.toLong, 0l.toLong, 0l.toLong))), (5l)) == (0l));\n assert(maxFill((List[List[Long]](List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong), List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))), (2l)) == (4l));\n assert(maxFill((List[List[Long]](List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong), List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))), (9l)) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a list arr of integers and a positive integer k, return a sorted list \n // of length k with the maximum k numbers in arr.\n // Example 1:\n // >>> maximum((List[Long](-3l.toLong, -4l.toLong, 5l.toLong)), (3l))\n // (List[Long](-4l.toLong, -3l.toLong, 5l.toLong))\n // Example 2:\n // >>> maximum((List[Long](4l.toLong, -4l.toLong, 4l.toLong)), (2l))\n // (List[Long](4l.toLong, 4l.toLong))\n // Example 3:\n // >>> maximum((List[Long](-3l.toLong, 2l.toLong, 1l.toLong, 2l.toLong, -1l.toLong, -2l.toLong, 1l.toLong)), (1l))\n // (List[Long](2l.toLong))\n // Note:\n // 1. The length of the list will be in the range of [1, 1000].\n // 2. The elements in the list will be in the range of [-1000, 1000].\n // 3. 0 <= k <= len(arr)\n def maximum(arr : List[Long], k : Long) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(maximum((List[Long](-3l.toLong, -4l.toLong, 5l.toLong)), (3l)).equals((List[Long](-4l.toLong, -3l.toLong, 5l.toLong))));\n assert(maximum((List[Long](4l.toLong, -4l.toLong, 4l.toLong)), (2l)).equals((List[Long](4l.toLong, 4l.toLong))));\n assert(maximum((List[Long](-3l.toLong, 2l.toLong, 1l.toLong, 2l.toLong, -1l.toLong, -2l.toLong, 1l.toLong)), (1l)).equals((List[Long](2l.toLong))));\n assert(maximum((List[Long](123l.toLong, -123l.toLong, 20l.toLong, 0l.toLong, 1l.toLong, 2l.toLong, -3l.toLong)), (3l)).equals((List[Long](2l.toLong, 20l.toLong, 123l.toLong))));\n assert(maximum((List[Long](-123l.toLong, 20l.toLong, 0l.toLong, 1l.toLong, 2l.toLong, -3l.toLong)), (4l)).equals((List[Long](0l.toLong, 1l.toLong, 2l.toLong, 20l.toLong))));\n assert(maximum((List[Long](5l.toLong, 15l.toLong, 0l.toLong, 3l.toLong, -13l.toLong, -8l.toLong, 0l.toLong)), (7l)).equals((List[Long](-13l.toLong, -8l.toLong, 0l.toLong, 0l.toLong, 3l.toLong, 5l.toLong, 15l.toLong))));\n assert(maximum((List[Long](-1l.toLong, 0l.toLong, 2l.toLong, 5l.toLong, 3l.toLong, -10l.toLong)), (2l)).equals((List[Long](3l.toLong, 5l.toLong))));\n assert(maximum((List[Long](1l.toLong, 0l.toLong, 5l.toLong, -7l.toLong)), (1l)).equals((List[Long](5l.toLong))));\n assert(maximum((List[Long](4l.toLong, -4l.toLong)), (2l)).equals((List[Long](-4l.toLong, 4l.toLong))));\n assert(maximum((List[Long](-10l.toLong, 10l.toLong)), (2l)).equals((List[Long](-10l.toLong, 10l.toLong))));\n assert(maximum((List[Long](1l.toLong, 2l.toLong, 3l.toLong, -23l.toLong, 243l.toLong, -400l.toLong, 0l.toLong)), (0l)).equals((List[Long]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that takes a message, and encodes in such a \n // way that it swaps case of all letters, replaces all vowels in \n // the message with the letter that appears 2 places ahead of that \n // vowel in the english alphabet. \n // Assume only letters. \n // Examples:\n // >>> encode((\"test\"))\n // (\"TGST\")\n // >>> encode((\"This is a message\"))\n // (\"tHKS KS C MGSSCGG\")\n def encode(message : String) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(encode((\"TEST\")).equals((\"tgst\")));\n assert(encode((\"Mudasir\")).equals((\"mWDCSKR\")));\n assert(encode((\"YES\")).equals((\"ygs\")));\n assert(encode((\"This is a message\")).equals((\"tHKS KS C MGSSCGG\")));\n assert(encode((\"I DoNt KnOw WhAt tO WrItE\")).equals((\"k dQnT kNqW wHcT Tq wRkTg\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // remove_vowels is a function that takes string and returns string without vowels.\n // >>> removeVowels((\"\"))\n // (\"\")\n // >>> removeVowels((\"abcdef\"))\n // (\"bcdf\")\n // >>> removeVowels((\"aaaaa\"))\n // (\"\")\n // >>> removeVowels((\"aaBAA\"))\n // (\"B\")\n // >>> removeVowels((\"zbcd\"))\n // (\"zbcd\")\n def removeVowels(text : String) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(removeVowels((\"\")).equals((\"\")));\n assert(removeVowels((\"abcdef\\nghijklm\")).equals((\"bcdf\\nghjklm\")));\n assert(removeVowels((\"fedcba\")).equals((\"fdcb\")));\n assert(removeVowels((\"eeeee\")).equals((\"\")));\n assert(removeVowels((\"acBAA\")).equals((\"cB\")));\n assert(removeVowels((\"EcBOO\")).equals((\"cB\")));\n assert(removeVowels((\"ybcd\")).equals((\"ybcd\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return only positive numbers in the list.\n // >>> getPositive((List[Long](-1l.toLong, 2l.toLong, -4l.toLong, 5l.toLong, 6l.toLong)))\n // (List[Long](2l.toLong, 5l.toLong, 6l.toLong))\n // >>> getPositive((List[Long](5l.toLong, 3l.toLong, -5l.toLong, 2l.toLong, -3l.toLong, 3l.toLong, 9l.toLong, 0l.toLong, 123l.toLong, 1l.toLong, -10l.toLong)))\n // (List[Long](5l.toLong, 3l.toLong, 2l.toLong, 3l.toLong, 9l.toLong, 123l.toLong, 1l.toLong))\n def getPositive(l : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(getPositive((List[Long](-1l.toLong, -2l.toLong, 4l.toLong, 5l.toLong, 6l.toLong))).equals((List[Long](4l.toLong, 5l.toLong, 6l.toLong))));\n assert(getPositive((List[Long](5l.toLong, 3l.toLong, -5l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 9l.toLong, 0l.toLong, 123l.toLong, 1l.toLong, -10l.toLong))).equals((List[Long](5l.toLong, 3l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 9l.toLong, 123l.toLong, 1l.toLong))));\n assert(getPositive((List[Long](-1l.toLong, -2l.toLong))).equals((List[Long]())));\n assert(getPositive((List[Long]())).equals((List[Long]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n // >>> stringSequence((0l))\n // (\"0\")\n // >>> stringSequence((5l))\n // (\"0 1 2 3 4 5\")\n def stringSequence(n : Long) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(stringSequence((0l)).equals((\"0\")));\n assert(stringSequence((3l)).equals((\"0 1 2 3\")));\n assert(stringSequence((10l)).equals((\"0 1 2 3 4 5 6 7 8 9 10\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a positive integer n, you have to make a pile of n levels of stones.\n // The first level has n stones.\n // The number of stones in the next level is:\n // - the next odd number if n is odd.\n // - the next even number if n is even.\n // Return the number of stones in each level in a list, where element at index\n // i represents the number of stones in the level (i+1).\n // Examples:\n // >>> makeAPile((3l))\n // (List[Long](3l.toLong, 5l.toLong, 7l.toLong))\n def makeAPile(n : Long) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(makeAPile((3l)).equals((List[Long](3l.toLong, 5l.toLong, 7l.toLong))));\n assert(makeAPile((4l)).equals((List[Long](4l.toLong, 6l.toLong, 8l.toLong, 10l.toLong))));\n assert(makeAPile((5l)).equals((List[Long](5l.toLong, 7l.toLong, 9l.toLong, 11l.toLong, 13l.toLong))));\n assert(makeAPile((6l)).equals((List[Long](6l.toLong, 8l.toLong, 10l.toLong, 12l.toLong, 14l.toLong, 16l.toLong))));\n assert(makeAPile((8l)).equals((List[Long](8l.toLong, 10l.toLong, 12l.toLong, 14l.toLong, 16l.toLong, 18l.toLong, 20l.toLong, 22l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Task\n // 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\n // then check if the result string is palindrome.\n // A string is called palindrome if it reads the same backward as forward.\n // You should return a tuple containing the result string and true/false for the check.\n // Example\n // >>> reverseDelete((\"abcde\"), (\"ae\"))\n // ((\"bcd\", false))\n // >>> reverseDelete((\"abcdef\"), (\"b\"))\n // ((\"acdef\", false))\n // >>> reverseDelete((\"abcdedcba\"), (\"ab\"))\n // ((\"cdedc\", true))\n def reverseDelete(s : String, c : String) : Tuple2[String, Boolean] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(reverseDelete((\"abcde\"), (\"ae\")).equals(((\"bcd\", false))));\n assert(reverseDelete((\"abcdef\"), (\"b\")).equals(((\"acdef\", false))));\n assert(reverseDelete((\"abcdedcba\"), (\"ab\")).equals(((\"cdedc\", true))));\n assert(reverseDelete((\"dwik\"), (\"w\")).equals(((\"dik\", false))));\n assert(reverseDelete((\"a\"), (\"a\")).equals(((\"\", true))));\n assert(reverseDelete((\"abcdedcba\"), (\"\")).equals(((\"abcdedcba\", true))));\n assert(reverseDelete((\"abcdedcba\"), (\"v\")).equals(((\"abcdedcba\", true))));\n assert(reverseDelete((\"vabba\"), (\"v\")).equals(((\"abba\", true))));\n assert(reverseDelete((\"mamma\"), (\"mia\")).equals(((\"\", true))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n // >>> flipCase((\"Hello\"))\n // (\"hELLO\")\n def flipCase(string : String) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(flipCase((\"\")).equals((\"\")));\n assert(flipCase((\"Hello!\")).equals((\"hELLO!\")));\n assert(flipCase((\"These violent delights have violent ends\")).equals((\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a string s.\n // if s[i] is a letter, reverse its case from lower to upper or vise versa, \n // otherwise keep it as it is.\n // If the string contains no letters, reverse the string.\n // The function should return the resulted string.\n // Examples\n // >>> solve((\"1234\"))\n // (\"4321\")\n // >>> solve((\"ab\"))\n // (\"AB\")\n // >>> solve((\"#a@C\"))\n // (\"#A@c\")\n def solve(s : String) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(solve((\"AsDf\")).equals((\"aSdF\")));\n assert(solve((\"1234\")).equals((\"4321\")));\n assert(solve((\"ab\")).equals((\"AB\")));\n assert(solve((\"#a@C\")).equals((\"#A@c\")));\n assert(solve((\"#AsdfW^45\")).equals((\"#aSDFw^45\")));\n assert(solve((\"#6@2\")).equals((\"2@6#\")));\n assert(solve((\"#$a^D\")).equals((\"#$A^d\")));\n assert(solve((\"#ccc\")).equals((\"#CCC\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Filter an input list of strings only for ones that start with a given prefix.\n // >>> filterByPrefix((List[String]()), (\"a\"))\n // (List[String]())\n // >>> filterByPrefix((List[String](\"abc\", \"bcd\", \"cde\", \"array\")), (\"a\"))\n // (List[String](\"abc\", \"array\"))\n def filterByPrefix(strings : List[String], prefix : String) : List[String] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(filterByPrefix((List[String]()), (\"john\")).equals((List[String]())));\n assert(filterByPrefix((List[String](\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\")), (\"xxx\")).equals((List[String](\"xxx\", \"xxxAAA\", \"xxx\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // This function takes two positive numbers x and y and returns the\n // biggest even integer number that is in the range [x, y] inclusive. If \n // there's no such number, then the function should return -1.\n // For example:\n // >>> chooseNum((12l), (15l))\n // (14l)\n // >>> chooseNum((13l), (12l))\n // (-1l)\n def chooseNum(x : Long, y : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(chooseNum((12l), (15l)) == (14l));\n assert(chooseNum((13l), (12l)) == (-1l));\n assert(chooseNum((33l), (12354l)) == (12354l));\n assert(chooseNum((5234l), (5233l)) == (-1l));\n assert(chooseNum((6l), (29l)) == (28l));\n assert(chooseNum((27l), (10l)) == (-1l));\n assert(chooseNum((7l), (7l)) == (-1l));\n assert(chooseNum((546l), (546l)) == (546l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a string representing a sentence,\n // the sentence contains some words separated by a space,\n // and you have to return a string that contains the words from the original sentence,\n // whose lengths are prime numbers,\n // the order of the words in the new string should be the same as the original one.\n // Example 1:\n // >>> wordsInSentence((\"This is a test\"))\n // (\"is\")\n // Example 2:\n // >>> wordsInSentence((\"lets go for swimming\"))\n // (\"go for\")\n // Constraints:\n // * 1 <= len(sentence) <= 100\n // * sentence contains only letters\n def wordsInSentence(sentence : String) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(wordsInSentence((\"This is a test\")).equals((\"is\")));\n assert(wordsInSentence((\"lets go for swimming\")).equals((\"go for\")));\n assert(wordsInSentence((\"there is no place available here\")).equals((\"there is no place\")));\n assert(wordsInSentence((\"Hi I am Hussein\")).equals((\"Hi am Hussein\")));\n assert(wordsInSentence((\"go for it\")).equals((\"go for it\")));\n assert(wordsInSentence((\"here\")).equals((\"\")));\n assert(wordsInSentence((\"here is\")).equals((\"is\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n // >>> intersperse((List[Long]()), (4l))\n // (List[Long]())\n // >>> intersperse((List[Long](1l.toLong, 2l.toLong, 3l.toLong)), (4l))\n // (List[Long](1l.toLong, 4l.toLong, 2l.toLong, 4l.toLong, 3l.toLong))\n def intersperse(numbers : List[Long], delimeter : Long) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(intersperse((List[Long]()), (7l)).equals((List[Long]())));\n assert(intersperse((List[Long](5l.toLong, 6l.toLong, 3l.toLong, 2l.toLong)), (8l)).equals((List[Long](5l.toLong, 8l.toLong, 6l.toLong, 8l.toLong, 3l.toLong, 8l.toLong, 2l.toLong))));\n assert(intersperse((List[Long](2l.toLong, 2l.toLong, 2l.toLong)), (2l)).equals((List[Long](2l.toLong, 2l.toLong, 2l.toLong, 2l.toLong, 2l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Your task is to write a function that returns true if a number x is a simple\n // power of n and false in other cases.\n // x is a simple power of n if n**int=x\n // For example:\n // >>> isSimplePower((1l), (4l))\n // (true)\n // >>> isSimplePower((2l), (2l))\n // (true)\n // >>> isSimplePower((8l), (2l))\n // (true)\n // >>> isSimplePower((3l), (2l))\n // (false)\n // >>> isSimplePower((3l), (1l))\n // (false)\n // >>> isSimplePower((5l), (3l))\n // (false)\n def isSimplePower(x : Long, n : Long) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(isSimplePower((16l), (2l)) == (true));\n assert(isSimplePower((143214l), (16l)) == (false));\n assert(isSimplePower((4l), (2l)) == (true));\n assert(isSimplePower((9l), (3l)) == (true));\n assert(isSimplePower((16l), (4l)) == (true));\n assert(isSimplePower((24l), (2l)) == (false));\n assert(isSimplePower((128l), (4l)) == (false));\n assert(isSimplePower((12l), (6l)) == (false));\n assert(isSimplePower((1l), (1l)) == (true));\n assert(isSimplePower((1l), (12l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that returns true if the given number is the multiplication of 3 prime numbers\n // and false otherwise.\n // Knowing that (a) is less then 100. \n // Example:\n // >>> isMultiplyPrime((30l))\n // (true)\n // 30 = 2 * 3 * 5\n def isMultiplyPrime(a : Long) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(isMultiplyPrime((5l)) == (false));\n assert(isMultiplyPrime((30l)) == (true));\n assert(isMultiplyPrime((8l)) == (true));\n assert(isMultiplyPrime((10l)) == (false));\n assert(isMultiplyPrime((125l)) == (true));\n assert(isMultiplyPrime((105l)) == (true));\n assert(isMultiplyPrime((126l)) == (false));\n assert(isMultiplyPrime((729l)) == (false));\n assert(isMultiplyPrime((891l)) == (false));\n assert(isMultiplyPrime((1001l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given the lengths of the three sides of a triangle. Return true if the three\n // sides form a right-angled triangle, false otherwise.\n // A right-angled triangle is a triangle in which one angle is right angle or \n // 90 degree.\n // Example:\n // >>> rightAngleTriangle((3l), (4l), (5l))\n // (true)\n // >>> rightAngleTriangle((1l), (2l), (3l))\n // (false)\n def rightAngleTriangle(a : Long, b : Long, c : Long) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(rightAngleTriangle((3l), (4l), (5l)) == (true));\n assert(rightAngleTriangle((1l), (2l), (3l)) == (false));\n assert(rightAngleTriangle((10l), (6l), (8l)) == (true));\n assert(rightAngleTriangle((2l), (2l), (2l)) == (false));\n assert(rightAngleTriangle((7l), (24l), (25l)) == (true));\n assert(rightAngleTriangle((10l), (5l), (7l)) == (false));\n assert(rightAngleTriangle((5l), (12l), (13l)) == (true));\n assert(rightAngleTriangle((15l), (8l), (17l)) == (true));\n assert(rightAngleTriangle((48l), (55l), (73l)) == (true));\n assert(rightAngleTriangle((1l), (1l), (1l)) == (false));\n assert(rightAngleTriangle((2l), (2l), (10l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function that takes 3 numbers.\n // Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n // Returns false in any other cases.\n // Examples\n // >>> anyInt(5l, 2l, 7l)\n // (true)\n // >>> anyInt(3l, 2l, 2l)\n // (false)\n // >>> anyInt(3l, -2l, 1l)\n // (true)\n // >>> anyInt((3.6f), (-2.2f), 2l)\n // (false)\n def anyInt(x : Float, y : Float, z : Float) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(anyInt(2l, 3l, 1l) == (true));\n assert(anyInt((2.5f), 2l, 3l) == (false));\n assert(anyInt((1.5f), 5l, (3.5f)) == (false));\n assert(anyInt(2l, 6l, 2l) == (false));\n assert(anyInt(4l, 2l, 2l) == (true));\n assert(anyInt((2.2f), (2.2f), (2.2f)) == (false));\n assert(anyInt(-4l, 6l, 2l) == (true));\n assert(anyInt(2l, 1l, 1l) == (true));\n assert(anyInt(3l, 4l, 7l) == (true));\n assert(anyInt((3.0f), 4l, 7l) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // This function takes a list l and returns a list l' such that\n // l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n // to the values of the corresponding indicies of l, but sorted.\n // >>> sortThird((List[Long](1l.toLong, 2l.toLong, 3l.toLong)))\n // (List[Long](1l.toLong, 2l.toLong, 3l.toLong))\n // >>> sortThird((List[Long](5l.toLong, 6l.toLong, 3l.toLong, 4l.toLong, 8l.toLong, 9l.toLong, 2l.toLong)))\n // (List[Long](2l.toLong, 6l.toLong, 3l.toLong, 4l.toLong, 8l.toLong, 9l.toLong, 5l.toLong))\n def sortThird(l : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(sortThird((List[Long](5l.toLong, 6l.toLong, 3l.toLong, 4l.toLong, 8l.toLong, 9l.toLong, 2l.toLong))).equals((List[Long](2l.toLong, 6l.toLong, 3l.toLong, 4l.toLong, 8l.toLong, 9l.toLong, 5l.toLong))));\n assert(sortThird((List[Long](5l.toLong, 8l.toLong, 3l.toLong, 4l.toLong, 6l.toLong, 9l.toLong, 2l.toLong))).equals((List[Long](2l.toLong, 8l.toLong, 3l.toLong, 4l.toLong, 6l.toLong, 9l.toLong, 5l.toLong))));\n assert(sortThird((List[Long](5l.toLong, 6l.toLong, 9l.toLong, 4l.toLong, 8l.toLong, 3l.toLong, 2l.toLong))).equals((List[Long](2l.toLong, 6l.toLong, 9l.toLong, 4l.toLong, 8l.toLong, 3l.toLong, 5l.toLong))));\n assert(sortThird((List[Long](5l.toLong, 6l.toLong, 3l.toLong, 4l.toLong, 8l.toLong, 9l.toLong, 2l.toLong, 1l.toLong))).equals((List[Long](2l.toLong, 6l.toLong, 3l.toLong, 4l.toLong, 8l.toLong, 9l.toLong, 5l.toLong, 1l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_53_add", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Add two numbers x and y\n // >>> add((2l), (3l))\n // (5l)\n // >>> add((5l), (7l))\n // (12l)\n def add(x : Long, y : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(add((0l), (1l)) == (1l));\n assert(add((1l), (0l)) == (1l));\n assert(add((2l), (3l)) == (5l));\n assert(add((5l), (7l)) == (12l));\n assert(add((7l), (5l)) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_69_search", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n // zero, and has a frequency greater than or equal to the value of the integer itself. \n // The frequency of an integer is the number of times it appears in the list.\n // If no such a value exist, return -1.\n // Examples:\n // >>> search((List[Long](4l.toLong, 1l.toLong, 2l.toLong, 2l.toLong, 3l.toLong, 1l.toLong)))\n // (2l)\n // >>> search((List[Long](1l.toLong, 2l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 3l.toLong, 4l.toLong, 4l.toLong, 4l.toLong)))\n // (3l)\n // >>> search((List[Long](5l.toLong, 5l.toLong, 4l.toLong, 4l.toLong, 4l.toLong)))\n // (-1l)\n def search(lst : List[Long]) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(search((List[Long](5l.toLong, 5l.toLong, 5l.toLong, 5l.toLong, 1l.toLong))) == (1l));\n assert(search((List[Long](4l.toLong, 1l.toLong, 4l.toLong, 1l.toLong, 4l.toLong, 4l.toLong))) == (4l));\n assert(search((List[Long](3l.toLong, 3l.toLong))) == (-1l));\n assert(search((List[Long](8l.toLong, 8l.toLong, 8l.toLong, 8l.toLong, 8l.toLong, 8l.toLong, 8l.toLong, 8l.toLong))) == (8l));\n assert(search((List[Long](2l.toLong, 3l.toLong, 3l.toLong, 2l.toLong, 2l.toLong))) == (2l));\n assert(search((List[Long](2l.toLong, 7l.toLong, 8l.toLong, 8l.toLong, 4l.toLong, 8l.toLong, 7l.toLong, 3l.toLong, 9l.toLong, 6l.toLong, 5l.toLong, 10l.toLong, 4l.toLong, 3l.toLong, 6l.toLong, 7l.toLong, 1l.toLong, 7l.toLong, 4l.toLong, 10l.toLong, 8l.toLong, 1l.toLong))) == (1l));\n assert(search((List[Long](3l.toLong, 2l.toLong, 8l.toLong, 2l.toLong))) == (2l));\n assert(search((List[Long](6l.toLong, 7l.toLong, 1l.toLong, 8l.toLong, 8l.toLong, 10l.toLong, 5l.toLong, 8l.toLong, 5l.toLong, 3l.toLong, 10l.toLong))) == (1l));\n assert(search((List[Long](8l.toLong, 8l.toLong, 3l.toLong, 6l.toLong, 5l.toLong, 6l.toLong, 4l.toLong))) == (-1l));\n assert(search((List[Long](6l.toLong, 9l.toLong, 6l.toLong, 7l.toLong, 1l.toLong, 4l.toLong, 7l.toLong, 1l.toLong, 8l.toLong, 8l.toLong, 9l.toLong, 8l.toLong, 10l.toLong, 10l.toLong, 8l.toLong, 4l.toLong, 10l.toLong, 4l.toLong, 10l.toLong, 1l.toLong, 2l.toLong, 9l.toLong, 5l.toLong, 7l.toLong, 9l.toLong))) == (1l));\n assert(search((List[Long](1l.toLong, 9l.toLong, 10l.toLong, 1l.toLong, 3l.toLong))) == (1l));\n assert(search((List[Long](6l.toLong, 9l.toLong, 7l.toLong, 5l.toLong, 8l.toLong, 7l.toLong, 5l.toLong, 3l.toLong, 7l.toLong, 5l.toLong, 10l.toLong, 10l.toLong, 3l.toLong, 6l.toLong, 10l.toLong, 2l.toLong, 8l.toLong, 6l.toLong, 5l.toLong, 4l.toLong, 9l.toLong, 5l.toLong, 3l.toLong, 10l.toLong))) == (5l));\n assert(search((List[Long](1l.toLong))) == (1l));\n assert(search((List[Long](8l.toLong, 8l.toLong, 10l.toLong, 6l.toLong, 4l.toLong, 3l.toLong, 5l.toLong, 8l.toLong, 2l.toLong, 4l.toLong, 2l.toLong, 8l.toLong, 4l.toLong, 6l.toLong, 10l.toLong, 4l.toLong, 2l.toLong, 1l.toLong, 10l.toLong, 2l.toLong, 1l.toLong, 1l.toLong, 5l.toLong))) == (4l));\n assert(search((List[Long](2l.toLong, 10l.toLong, 4l.toLong, 8l.toLong, 2l.toLong, 10l.toLong, 5l.toLong, 1l.toLong, 2l.toLong, 9l.toLong, 5l.toLong, 5l.toLong, 6l.toLong, 3l.toLong, 8l.toLong, 6l.toLong, 4l.toLong, 10l.toLong))) == (2l));\n assert(search((List[Long](1l.toLong, 6l.toLong, 10l.toLong, 1l.toLong, 6l.toLong, 9l.toLong, 10l.toLong, 8l.toLong, 6l.toLong, 8l.toLong, 7l.toLong, 3l.toLong))) == (1l));\n assert(search((List[Long](9l.toLong, 2l.toLong, 4l.toLong, 1l.toLong, 5l.toLong, 1l.toLong, 5l.toLong, 2l.toLong, 5l.toLong, 7l.toLong, 7l.toLong, 7l.toLong, 3l.toLong, 10l.toLong, 1l.toLong, 5l.toLong, 4l.toLong, 2l.toLong, 8l.toLong, 4l.toLong, 1l.toLong, 9l.toLong, 10l.toLong, 7l.toLong, 10l.toLong, 2l.toLong, 8l.toLong, 10l.toLong, 9l.toLong, 4l.toLong))) == (4l));\n assert(search((List[Long](2l.toLong, 6l.toLong, 4l.toLong, 2l.toLong, 8l.toLong, 7l.toLong, 5l.toLong, 6l.toLong, 4l.toLong, 10l.toLong, 4l.toLong, 6l.toLong, 3l.toLong, 7l.toLong, 8l.toLong, 8l.toLong, 3l.toLong, 1l.toLong, 4l.toLong, 2l.toLong, 2l.toLong, 10l.toLong, 7l.toLong))) == (4l));\n assert(search((List[Long](9l.toLong, 8l.toLong, 6l.toLong, 10l.toLong, 2l.toLong, 6l.toLong, 10l.toLong, 2l.toLong, 7l.toLong, 8l.toLong, 10l.toLong, 3l.toLong, 8l.toLong, 2l.toLong, 6l.toLong, 2l.toLong, 3l.toLong, 1l.toLong))) == (2l));\n assert(search((List[Long](5l.toLong, 5l.toLong, 3l.toLong, 9l.toLong, 5l.toLong, 6l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 5l.toLong, 6l.toLong, 10l.toLong, 10l.toLong, 6l.toLong, 8l.toLong, 4l.toLong, 10l.toLong, 7l.toLong, 7l.toLong, 10l.toLong, 8l.toLong))) == (-1l));\n assert(search((List[Long](10l.toLong))) == (-1l));\n assert(search((List[Long](9l.toLong, 7l.toLong, 7l.toLong, 2l.toLong, 4l.toLong, 7l.toLong, 2l.toLong, 10l.toLong, 9l.toLong, 7l.toLong, 5l.toLong, 7l.toLong, 2l.toLong))) == (2l));\n assert(search((List[Long](5l.toLong, 4l.toLong, 10l.toLong, 2l.toLong, 1l.toLong, 1l.toLong, 10l.toLong, 3l.toLong, 6l.toLong, 1l.toLong, 8l.toLong))) == (1l));\n assert(search((List[Long](7l.toLong, 9l.toLong, 9l.toLong, 9l.toLong, 3l.toLong, 4l.toLong, 1l.toLong, 5l.toLong, 9l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 1l.toLong, 10l.toLong, 7l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 6l.toLong, 7l.toLong, 7l.toLong, 6l.toLong))) == (1l));\n assert(search((List[Long](3l.toLong, 10l.toLong, 10l.toLong, 9l.toLong, 2l.toLong))) == (-1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that takes a string and returns true if the string\n // length is a prime number or false otherwise\n // Examples\n // >>> primeLength((\"Hello\"))\n // (true)\n // >>> primeLength((\"abcdcba\"))\n // (true)\n // >>> primeLength((\"kittens\"))\n // (true)\n // >>> primeLength((\"orange\"))\n // (false)\n def primeLength(string : String) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(primeLength((\"Hello\")) == (true));\n assert(primeLength((\"abcdcba\")) == (true));\n assert(primeLength((\"kittens\")) == (true));\n assert(primeLength((\"orange\")) == (false));\n assert(primeLength((\"wow\")) == (true));\n assert(primeLength((\"world\")) == (true));\n assert(primeLength((\"MadaM\")) == (true));\n assert(primeLength((\"Wow\")) == (true));\n assert(primeLength((\"\")) == (false));\n assert(primeLength((\"HI\")) == (true));\n assert(primeLength((\"go\")) == (true));\n assert(primeLength((\"gogo\")) == (false));\n assert(primeLength((\"aaaaaaaaaaaaaaa\")) == (false));\n assert(primeLength((\"Madam\")) == (true));\n assert(primeLength((\"M\")) == (false));\n assert(primeLength((\"0\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_58_common", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return sorted unique common elements for two lists.\n // >>> common((List[Long](1l.toLong, 4l.toLong, 3l.toLong, 34l.toLong, 653l.toLong, 2l.toLong, 5l.toLong)), (List[Long](5l.toLong, 7l.toLong, 1l.toLong, 5l.toLong, 9l.toLong, 653l.toLong, 121l.toLong)))\n // (List[Long](1l.toLong, 5l.toLong, 653l.toLong))\n // >>> common((List[Long](5l.toLong, 3l.toLong, 2l.toLong, 8l.toLong)), (List[Long](3l.toLong, 2l.toLong)))\n // (List[Long](2l.toLong, 3l.toLong))\n def common(l1 : List[Long], l2 : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(common((List[Long](1l.toLong, 4l.toLong, 3l.toLong, 34l.toLong, 653l.toLong, 2l.toLong, 5l.toLong)), (List[Long](5l.toLong, 7l.toLong, 1l.toLong, 5l.toLong, 9l.toLong, 653l.toLong, 121l.toLong))).equals((List[Long](1l.toLong, 5l.toLong, 653l.toLong))));\n assert(common((List[Long](5l.toLong, 3l.toLong, 2l.toLong, 8l.toLong)), (List[Long](3l.toLong, 2l.toLong))).equals((List[Long](2l.toLong, 3l.toLong))));\n assert(common((List[Long](4l.toLong, 3l.toLong, 2l.toLong, 8l.toLong)), (List[Long](3l.toLong, 2l.toLong, 4l.toLong))).equals((List[Long](2l.toLong, 3l.toLong, 4l.toLong))));\n assert(common((List[Long](4l.toLong, 3l.toLong, 2l.toLong, 8l.toLong)), (List[Long]())).equals((List[Long]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // The Brazilian factorial is defined as:\n // brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n // where n > 0\n // For example:\n // >>> specialFactorial((4l))\n // (288l)\n // The function will receive an integer as input and should return the special\n // factorial of this integer.\n def specialFactorial(n : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(specialFactorial((4l)) == (288l));\n assert(specialFactorial((5l)) == (34560l));\n assert(specialFactorial((7l)) == (125411328000l));\n assert(specialFactorial((1l)) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // In this problem, you will implement a function that takes two lists of numbers,\n // and determines whether it is possible to perform an exchange of elements\n // between them to make lst1 a list of only even numbers.\n // There is no limit on the number of exchanged elements between lst1 and lst2.\n // If it is possible to exchange elements between the lst1 and lst2 to make\n // all the elements of lst1 to be even, return \"YES\".\n // Otherwise, return \"NO\".\n // For example:\n // >>> exchange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong)), (List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong)))\n // (\"YES\")\n // >>> exchange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong)), (List[Long](1l.toLong, 5l.toLong, 3l.toLong, 4l.toLong)))\n // (\"NO\")\n // It is assumed that the input lists will be non-empty.\n def exchange(lst1 : List[Long], lst2 : List[Long]) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(exchange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong)), (List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((\"YES\")));\n assert(exchange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong)), (List[Long](1l.toLong, 5l.toLong, 3l.toLong, 4l.toLong))).equals((\"NO\")));\n assert(exchange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong)), (List[Long](2l.toLong, 1l.toLong, 4l.toLong, 3l.toLong))).equals((\"YES\")));\n assert(exchange((List[Long](5l.toLong, 7l.toLong, 3l.toLong)), (List[Long](2l.toLong, 6l.toLong, 4l.toLong))).equals((\"YES\")));\n assert(exchange((List[Long](5l.toLong, 7l.toLong, 3l.toLong)), (List[Long](2l.toLong, 6l.toLong, 3l.toLong))).equals((\"NO\")));\n assert(exchange((List[Long](3l.toLong, 2l.toLong, 6l.toLong, 1l.toLong, 8l.toLong, 9l.toLong)), (List[Long](3l.toLong, 5l.toLong, 5l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))).equals((\"NO\")));\n assert(exchange((List[Long](100l.toLong, 200l.toLong)), (List[Long](200l.toLong, 200l.toLong))).equals((\"YES\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a non-empty list of integers arr and an integer k, return\n // the sum of the elements with at most two digits from the first k elements of arr.\n // Example:\n // >>> addElements((List[Long](111l.toLong, 21l.toLong, 3l.toLong, 4000l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong, 9l.toLong)), (4l))\n // (24l)\n // Constraints:\n // 1. 1 <= len(arr) <= 100\n // 2. 1 <= k <= len(arr)\n def addElements(arr : List[Long], k : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(addElements((List[Long](1l.toLong, -2l.toLong, -3l.toLong, 41l.toLong, 57l.toLong, 76l.toLong, 87l.toLong, 88l.toLong, 99l.toLong)), (3l)) == (-4l));\n assert(addElements((List[Long](111l.toLong, 121l.toLong, 3l.toLong, 4000l.toLong, 5l.toLong, 6l.toLong)), (2l)) == (0l));\n assert(addElements((List[Long](11l.toLong, 21l.toLong, 3l.toLong, 90l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong, 9l.toLong)), (4l)) == (125l));\n assert(addElements((List[Long](111l.toLong, 21l.toLong, 3l.toLong, 4000l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong, 9l.toLong)), (4l)) == (24l));\n assert(addElements((List[Long](1l.toLong)), (1l)) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // A simple program which should return the value of x if n is \n // a prime number and should return the value of y otherwise.\n // Examples:\n // >>> xOrY((7l), (34l), (12l))\n // (34l)\n // >>> xOrY((15l), (8l), (5l))\n // (5l)\n def xOrY(n : Long, x : Long, y : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(xOrY((7l), (34l), (12l)) == (34l));\n assert(xOrY((15l), (8l), (5l)) == (5l));\n assert(xOrY((3l), (33l), (5212l)) == (33l));\n assert(xOrY((1259l), (3l), (52l)) == (3l));\n assert(xOrY((7919l), (-1l), (12l)) == (-1l));\n assert(xOrY((3609l), (1245l), (583l)) == (583l));\n assert(xOrY((91l), (56l), (129l)) == (129l));\n assert(xOrY((6l), (34l), (1234l)) == (1234l));\n assert(xOrY((1l), (2l), (0l)) == (0l));\n assert(xOrY((2l), (2l), (0l)) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given length of a side and high return area for a triangle.\n // >>> triangleArea((5l), (3l))\n // (7.5f)\n def triangleArea(a : Long, h : Long) : Float = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(triangleArea((5l), (3l)) == (7.5f));\n assert(triangleArea((2l), (2l)) == (2.0f));\n assert(triangleArea((10l), (8l)) == (40.0f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n // the last couple centuries. However, what people don't know is Tribonacci sequence.\n // Tribonacci sequence is defined by the recurrence:\n // tri(1) = 3\n // tri(n) = 1 + n / 2, if n is even.\n // tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n // For example:\n // tri(2) = 1 + (2 / 2) = 2\n // tri(4) = 3\n // tri(3) = tri(2) + tri(1) + tri(4)\n // = 2 + 3 + 3 = 8 \n // You are given a non-negative integer number n, you have to a return a list of the \n // first n + 1 numbers of the Tribonacci sequence.\n // Examples:\n // >>> tri((3l))\n // (List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong))\n def tri(n : Long) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(tri((3l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong))));\n assert(tri((4l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 3l.toLong))));\n assert(tri((5l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 3l.toLong, 15l.toLong))));\n assert(tri((6l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 3l.toLong, 15l.toLong, 4l.toLong))));\n assert(tri((7l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 3l.toLong, 15l.toLong, 4l.toLong, 24l.toLong))));\n assert(tri((8l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 3l.toLong, 15l.toLong, 4l.toLong, 24l.toLong, 5l.toLong))));\n assert(tri((9l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 3l.toLong, 15l.toLong, 4l.toLong, 24l.toLong, 5l.toLong, 35l.toLong))));\n assert(tri((20l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 3l.toLong, 15l.toLong, 4l.toLong, 24l.toLong, 5l.toLong, 35l.toLong, 6l.toLong, 48l.toLong, 7l.toLong, 63l.toLong, 8l.toLong, 80l.toLong, 9l.toLong, 99l.toLong, 10l.toLong, 120l.toLong, 11l.toLong))));\n assert(tri((0l)).equals((List[Long](1l.toLong))));\n assert(tri((1l)).equals((List[Long](1l.toLong, 3l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a list of two strings, both strings consist of open\n // parentheses '(' or close parentheses ')' only.\n // Your job is to check if it is possible to concatenate the two strings in\n // some order, that the resulting string will be good.\n // A string S is considered to be good if and only if all parentheses in S\n // are balanced. For example: the string '(())()' is good, while the string\n // '())' is not.\n // Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n // Examples:\n // >>> matchParens((List[String](\"()(\", \")\")))\n // (\"Yes\")\n // >>> matchParens((List[String](\")\", \")\")))\n // (\"No\")\n def matchParens(lst : List[String]) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(matchParens((List[String](\"()(\", \")\"))).equals((\"Yes\")));\n assert(matchParens((List[String](\")\", \")\"))).equals((\"No\")));\n assert(matchParens((List[String](\"(()(())\", \"())())\"))).equals((\"No\")));\n assert(matchParens((List[String](\")())\", \"(()()(\"))).equals((\"Yes\")));\n assert(matchParens((List[String](\"(())))\", \"(()())((\"))).equals((\"Yes\")));\n assert(matchParens((List[String](\"()\", \"())\"))).equals((\"No\")));\n assert(matchParens((List[String](\"(()(\", \"()))()\"))).equals((\"Yes\")));\n assert(matchParens((List[String](\"((((\", \"((())\"))).equals((\"No\")));\n assert(matchParens((List[String](\")(()\", \"(()(\"))).equals((\"No\")));\n assert(matchParens((List[String](\")(\", \")(\"))).equals((\"No\")));\n assert(matchParens((List[String](\"(\", \")\"))).equals((\"Yes\")));\n assert(matchParens((List[String](\")\", \"(\"))).equals((\"Yes\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // From a list of integers, remove all elements that occur more than once.\n // Keep order of elements left the same as in the input.\n // >>> removeDuplicates((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 2l.toLong, 4l.toLong)))\n // (List[Long](1l.toLong, 3l.toLong, 4l.toLong))\n def removeDuplicates(numbers : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(removeDuplicates((List[Long]())).equals((List[Long]())));\n assert(removeDuplicates((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))));\n assert(removeDuplicates((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 2l.toLong, 4l.toLong, 3l.toLong, 5l.toLong))).equals((List[Long](1l.toLong, 4l.toLong, 5l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return a greatest common divisor of two integers a and b\n // >>> greatestCommonDivisor((3l), (5l))\n // (1l)\n // >>> greatestCommonDivisor((25l), (15l))\n // (5l)\n def greatestCommonDivisor(a : Long, b : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(greatestCommonDivisor((3l), (7l)) == (1l));\n assert(greatestCommonDivisor((10l), (15l)) == (5l));\n assert(greatestCommonDivisor((49l), (14l)) == (7l));\n assert(greatestCommonDivisor((144l), (60l)) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Checks if given string is a palindrome\n // >>> isPalindrome((\"\"))\n // (true)\n // >>> isPalindrome((\"aba\"))\n // (true)\n // >>> isPalindrome((\"aaaaa\"))\n // (true)\n // >>> isPalindrome((\"zbcd\"))\n // (false)\n def isPalindrome(text : String) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(isPalindrome((\"\")) == (true));\n assert(isPalindrome((\"aba\")) == (true));\n assert(isPalindrome((\"aaaaa\")) == (true));\n assert(isPalindrome((\"zbcd\")) == (false));\n assert(isPalindrome((\"xywyx\")) == (true));\n assert(isPalindrome((\"xywyz\")) == (false));\n assert(isPalindrome((\"xywzx\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // xs represent coefficients of a polynomial.\n // xs[0] + xs[1] * x + xs[2] * x^2 + ....\n // Return derivative of this polynomial in the same form.\n // >>> derivative((List[Long](3l.toLong, 1l.toLong, 2l.toLong, 4l.toLong, 5l.toLong)))\n // (List[Long](1l.toLong, 4l.toLong, 12l.toLong, 20l.toLong))\n // >>> derivative((List[Long](1l.toLong, 2l.toLong, 3l.toLong)))\n // (List[Long](2l.toLong, 6l.toLong))\n def derivative(xs : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(derivative((List[Long](3l.toLong, 1l.toLong, 2l.toLong, 4l.toLong, 5l.toLong))).equals((List[Long](1l.toLong, 4l.toLong, 12l.toLong, 20l.toLong))));\n assert(derivative((List[Long](1l.toLong, 2l.toLong, 3l.toLong))).equals((List[Long](2l.toLong, 6l.toLong))));\n assert(derivative((List[Long](3l.toLong, 2l.toLong, 1l.toLong))).equals((List[Long](2l.toLong, 2l.toLong))));\n assert(derivative((List[Long](3l.toLong, 2l.toLong, 1l.toLong, 0l.toLong, 4l.toLong))).equals((List[Long](2l.toLong, 2l.toLong, 0l.toLong, 16l.toLong))));\n assert(derivative((List[Long](1l.toLong))).equals((List[Long]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // In this task, you will be given a string that represents a number of apples and oranges \n // that are distributed in a basket of fruit this basket contains \n // apples, oranges, and mango fruits. Given the string that represents the total number of \n // the oranges and apples and an integer that represent the total number of the fruits \n // in the basket return the number of the mango fruits in the basket.\n // for examble:\n // >>> fruitDistribution((\"5 apples and 6 oranges\"), (19l))\n // (8l)\n // >>> fruitDistribution((\"0 apples and 1 oranges\"), (3l))\n // (2l)\n // >>> fruitDistribution((\"2 apples and 3 oranges\"), (100l))\n // (95l)\n // >>> fruitDistribution((\"100 apples and 1 oranges\"), (120l))\n // (19l)\n def fruitDistribution(s : String, n : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(fruitDistribution((\"5 apples and 6 oranges\"), (19l)) == (8l));\n assert(fruitDistribution((\"5 apples and 6 oranges\"), (21l)) == (10l));\n assert(fruitDistribution((\"0 apples and 1 oranges\"), (3l)) == (2l));\n assert(fruitDistribution((\"1 apples and 0 oranges\"), (3l)) == (2l));\n assert(fruitDistribution((\"2 apples and 3 oranges\"), (100l)) == (95l));\n assert(fruitDistribution((\"2 apples and 3 oranges\"), (5l)) == (0l));\n assert(fruitDistribution((\"1 apples and 100 oranges\"), (120l)) == (19l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that takes an integer a and returns true \n // if this ingeger is a cube of some integer number.\n // Note: you may assume the input is always valid.\n // Examples:\n // >>> iscube((1l))\n // (true)\n // >>> iscube((2l))\n // (false)\n // >>> iscube((-1l))\n // (true)\n // >>> iscube((64l))\n // (true)\n // >>> iscube((0l))\n // (true)\n // >>> iscube((180l))\n // (false)\n def iscube(a : Long) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(iscube((1l)) == (true));\n assert(iscube((2l)) == (false));\n assert(iscube((-1l)) == (true));\n assert(iscube((64l)) == (true));\n assert(iscube((180l)) == (false));\n assert(iscube((1000l)) == (true));\n assert(iscube((0l)) == (true));\n assert(iscube((1729l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // In this Kata, you have to sort a list of non-negative integers according to\n // number of ones in their binary representation in ascending order.\n // For similar number of ones, sort based on decimal value.\n // It must be implemented like this:\n // >>> sortArray((List[Long](1l.toLong, 5l.toLong, 2l.toLong, 3l.toLong, 4l.toLong)))\n // (List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong))\n // >>> sortArray((List[Long](-2l.toLong, -3l.toLong, -4l.toLong, -5l.toLong, -6l.toLong)))\n // (List[Long](-6l.toLong, -5l.toLong, -4l.toLong, -3l.toLong, -2l.toLong))\n // >>> sortArray((List[Long](1l.toLong, 0l.toLong, 2l.toLong, 3l.toLong, 4l.toLong)))\n // (List[Long](0l.toLong, 1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))\n def sortArray(arr : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(sortArray((List[Long](1l.toLong, 5l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((List[Long](1l.toLong, 2l.toLong, 4l.toLong, 3l.toLong, 5l.toLong))));\n assert(sortArray((List[Long](-2l.toLong, -3l.toLong, -4l.toLong, -5l.toLong, -6l.toLong))).equals((List[Long](-4l.toLong, -2l.toLong, -6l.toLong, -5l.toLong, -3l.toLong))));\n assert(sortArray((List[Long](1l.toLong, 0l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((List[Long](0l.toLong, 1l.toLong, 2l.toLong, 4l.toLong, 3l.toLong))));\n assert(sortArray((List[Long]())).equals((List[Long]())));\n assert(sortArray((List[Long](2l.toLong, 5l.toLong, 77l.toLong, 4l.toLong, 5l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((List[Long](2l.toLong, 2l.toLong, 4l.toLong, 4l.toLong, 3l.toLong, 3l.toLong, 5l.toLong, 5l.toLong, 5l.toLong, 7l.toLong, 77l.toLong))));\n assert(sortArray((List[Long](3l.toLong, 6l.toLong, 44l.toLong, 12l.toLong, 32l.toLong, 5l.toLong))).equals((List[Long](32l.toLong, 3l.toLong, 5l.toLong, 6l.toLong, 12l.toLong, 44l.toLong))));\n assert(sortArray((List[Long](2l.toLong, 4l.toLong, 8l.toLong, 16l.toLong, 32l.toLong))).equals((List[Long](2l.toLong, 4l.toLong, 8l.toLong, 16l.toLong, 32l.toLong))));\n assert(sortArray((List[Long](2l.toLong, 4l.toLong, 8l.toLong, 16l.toLong, 32l.toLong))).equals((List[Long](2l.toLong, 4l.toLong, 8l.toLong, 16l.toLong, 32l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a list of strings, where each string consists of only digits, return a list.\n // Each element i of the output should be \"the number of odd elements in the\n // string i of the input.\" where all the i's should be replaced by the number\n // of odd digits in the i'th string of the input.\n // >>> oddCount((List[String](\"1234567\")))\n // (List[String](\"the number of odd elements 4n the str4ng 4 of the 4nput.\"))\n // >>> oddCount((List[String](\"3\", \"11111111\")))\n // (List[String](\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\"))\n def oddCount(lst : List[String]) : List[String] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(oddCount((List[String](\"1234567\"))).equals((List[String](\"the number of odd elements 4n the str4ng 4 of the 4nput.\"))));\n assert(oddCount((List[String](\"3\", \"11111111\"))).equals((List[String](\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\"))));\n assert(oddCount((List[String](\"271\", \"137\", \"314\"))).equals((List[String](\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // brackets is a string of \"(\" and \")\".\n // return true if every opening bracket has a corresponding closing bracket.\n // >>> correctBracketing((\"(\"))\n // (false)\n // >>> correctBracketing((\"()\"))\n // (true)\n // >>> correctBracketing((\"(()())\"))\n // (true)\n // >>> correctBracketing((\")(()\"))\n // (false)\n def correctBracketing(brackets : String) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(correctBracketing((\"()\")) == (true));\n assert(correctBracketing((\"(()())\")) == (true));\n assert(correctBracketing((\"()()(()())()\")) == (true));\n assert(correctBracketing((\"()()((()()())())(()()(()))\")) == (true));\n assert(correctBracketing((\"((()())))\")) == (false));\n assert(correctBracketing((\")(()\")) == (false));\n assert(correctBracketing((\"(\")) == (false));\n assert(correctBracketing((\"((((\")) == (false));\n assert(correctBracketing((\")\")) == (false));\n assert(correctBracketing((\"(()\")) == (false));\n assert(correctBracketing((\"()()(()())())(()\")) == (false));\n assert(correctBracketing((\"()()(()())()))()\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Task\n // Write a function that takes a string as input and returns the sum of the upper characters only'\n // ASCII codes.\n // Examples:\n // >>> digitSum((\"\"))\n // (0l)\n // >>> digitSum((\"abAB\"))\n // (131l)\n // >>> digitSum((\"abcCd\"))\n // (67l)\n // >>> digitSum((\"helloE\"))\n // (69l)\n // >>> digitSum((\"woArBld\"))\n // (131l)\n // >>> digitSum((\"aAaaaXa\"))\n // (153l)\n def digitSum(s : String) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(digitSum((\"\")) == (0l));\n assert(digitSum((\"abAB\")) == (131l));\n assert(digitSum((\"abcCd\")) == (67l));\n assert(digitSum((\"helloE\")) == (69l));\n assert(digitSum((\"woArBld\")) == (131l));\n assert(digitSum((\"aAaaaXa\")) == (153l));\n assert(digitSum((\" How are yOu?\")) == (151l));\n assert(digitSum((\"You arE Very Smart\")) == (327l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that accepts a list of strings as a parameter,\n // deletes the strings that have odd lengths from it,\n // and returns the resulted list with a sorted order,\n // The list is always a list of strings and never a list of numbers,\n // and it may contain duplicates.\n // The order of the list should be ascending by length of each word, and you\n // should return the list sorted by that rule.\n // If two words have the same length, sort the list alphabetically.\n // The function should return a list of strings in sorted order.\n // You may assume that all words will have the same length.\n // For example:\n // >>> listSort((List[String](\"aa\", \"a\", \"aaa\")))\n // (List[String](\"aa\"))\n // >>> listSort((List[String](\"ab\", \"a\", \"aaa\", \"cd\")))\n // (List[String](\"ab\", \"cd\"))\n def sortedListSum(lst : List[String]) : List[String] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(sortedListSum((List[String](\"aa\", \"a\", \"aaa\"))).equals((List[String](\"aa\"))));\n assert(sortedListSum((List[String](\"school\", \"AI\", \"asdf\", \"b\"))).equals((List[String](\"AI\", \"asdf\", \"school\"))));\n assert(sortedListSum((List[String](\"d\", \"b\", \"c\", \"a\"))).equals((List[String]())));\n assert(sortedListSum((List[String](\"d\", \"dcba\", \"abcd\", \"a\"))).equals((List[String](\"abcd\", \"dcba\"))));\n assert(sortedListSum((List[String](\"AI\", \"ai\", \"au\"))).equals((List[String](\"AI\", \"ai\", \"au\"))));\n assert(sortedListSum((List[String](\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"))).equals((List[String]())));\n assert(sortedListSum((List[String](\"aaaa\", \"bbbb\", \"dd\", \"cc\"))).equals((List[String](\"cc\", \"dd\", \"aaaa\", \"bbbb\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a list arr of integers and you need to return\n // sum of magnitudes of integers multiplied by product of all signs\n // of each number in the list, represented by 1, -1 or 0.\n // Note: return None for empty arr.\n // Example:\n // >>> prodSigns((List[Long](1l.toLong, 2l.toLong, 2l.toLong, -4l.toLong)))\n // 9l\n // >>> prodSigns((List[Long](0l.toLong, 1l.toLong)))\n // 0l\n // >>> prodSigns((List[Long]()))\n // None\n def prodSigns(arr : List[Long]) : Option[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(prodSigns((List[Long](1l.toLong, 2l.toLong, 2l.toLong, -4l.toLong))).equals(-9l));\n assert(prodSigns((List[Long](0l.toLong, 1l.toLong))).equals(0l));\n assert(prodSigns((List[Long](1l.toLong, 1l.toLong, 1l.toLong, 2l.toLong, 3l.toLong, -1l.toLong, 1l.toLong))).equals(-10l));\n assert(prodSigns((List[Long]())).equals(None));\n assert(prodSigns((List[Long](2l.toLong, 4l.toLong, 1l.toLong, 2l.toLong, -1l.toLong, -1l.toLong, 9l.toLong))).equals(20l));\n assert(prodSigns((List[Long](-1l.toLong, 1l.toLong, -1l.toLong, 1l.toLong))).equals(4l));\n assert(prodSigns((List[Long](-1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))).equals(-4l));\n assert(prodSigns((List[Long](-1l.toLong, 1l.toLong, 1l.toLong, 0l.toLong))).equals(0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return list with elements incremented by 1.\n // >>> incrList((List[Long](1l.toLong, 2l.toLong, 3l.toLong)))\n // (List[Long](2l.toLong, 3l.toLong, 4l.toLong))\n // >>> incrList((List[Long](5l.toLong, 3l.toLong, 5l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 9l.toLong, 0l.toLong, 123l.toLong)))\n // (List[Long](6l.toLong, 4l.toLong, 6l.toLong, 3l.toLong, 4l.toLong, 4l.toLong, 10l.toLong, 1l.toLong, 124l.toLong))\n def incrList(l : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(incrList((List[Long]())).equals((List[Long]())));\n assert(incrList((List[Long](3l.toLong, 2l.toLong, 1l.toLong))).equals((List[Long](4l.toLong, 3l.toLong, 2l.toLong))));\n assert(incrList((List[Long](5l.toLong, 2l.toLong, 5l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 9l.toLong, 0l.toLong, 123l.toLong))).equals((List[Long](6l.toLong, 3l.toLong, 6l.toLong, 3l.toLong, 4l.toLong, 4l.toLong, 10l.toLong, 1l.toLong, 124l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // From a given list of integers, generate a list of rolling maximum element found until given moment\n // in the sequence.\n // >>> rollingMax((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 2l.toLong)))\n // (List[Long](1l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 3l.toLong, 4l.toLong, 4l.toLong))\n def rollingMax(numbers : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(rollingMax((List[Long]())).equals((List[Long]())));\n assert(rollingMax((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))));\n assert(rollingMax((List[Long](4l.toLong, 3l.toLong, 2l.toLong, 1l.toLong))).equals((List[Long](4l.toLong, 4l.toLong, 4l.toLong, 4l.toLong))));\n assert(rollingMax((List[Long](3l.toLong, 2l.toLong, 3l.toLong, 100l.toLong, 3l.toLong))).equals((List[Long](3l.toLong, 3l.toLong, 3l.toLong, 100l.toLong, 100l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n // separate those group into separate strings and return the list of those.\n // Separate groups are balanced (each open brace is properly closed) and not nested within each other\n // Ignore any spaces in the input string.\n // >>> separateParenGroups((\"( ) (( )) (( )( ))\"))\n // (List[String](\"()\", \"(())\", \"(()())\"))\n def separateParenGroups(paren_string : String) : List[String] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(separateParenGroups((\"(()()) ((())) () ((())()())\")).equals((List[String](\"(()())\", \"((()))\", \"()\", \"((())()())\"))));\n assert(separateParenGroups((\"() (()) ((())) (((())))\")).equals((List[String](\"()\", \"(())\", \"((()))\", \"(((())))\"))));\n assert(separateParenGroups((\"(()(())((())))\")).equals((List[String](\"(()(())((())))\"))));\n assert(separateParenGroups((\"( ) (( )) (( )( ))\")).equals((List[String](\"()\", \"(())\", \"(()())\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You will be given a string of words separated by commas or spaces. Your task is\n // to split the string into words and return a list of the words.\n // For example:\n // >>> wordsString((\"Hi, my name is John\"))\n // (List[String](\"Hi\", \"my\", \"name\", \"is\", \"John\"))\n // >>> wordsString((\"One, two, three, four, five, six\"))\n // (List[String](\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"))\n def wordsString(s : String) : List[String] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(wordsString((\"Hi, my name is John\")).equals((List[String](\"Hi\", \"my\", \"name\", \"is\", \"John\"))));\n assert(wordsString((\"One, two, three, four, five, six\")).equals((List[String](\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"))));\n assert(wordsString((\"Hi, my name\")).equals((List[String](\"Hi\", \"my\", \"name\"))));\n assert(wordsString((\"One,, two, three, four, five, six,\")).equals((List[String](\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"))));\n assert(wordsString((\"\")).equals((List[String]())));\n assert(wordsString((\"ahmed , gamal\")).equals((List[String](\"ahmed\", \"gamal\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Filter given list of any scalathon values only for integers\n // >>> filterIntegers((List[Any](\"a\", 3.14f, 5l)))\n // (List[Long](5l.toLong))\n // >>> filterIntegers((List[Any](1l, 2l, 3l, \"abc\", Map[Long,Long](), List[Long]())))\n // (List[Long](1l.toLong, 2l.toLong, 3l.toLong))\n def filterIntegers(values : List[Any]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(filterIntegers((List[Any]())).equals((List[Long]())));\n assert(filterIntegers((List[Any](4l, Map[Long,Long](), List[Long](), 23.2f, 9l, \"adasd\"))).equals((List[Long](4l.toLong, 9l.toLong))));\n assert(filterIntegers((List[Any](3l, \"c\", 3l, 3l, \"a\", \"b\"))).equals((List[Long](3l.toLong, 3l.toLong, 3l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // This function takes a list l and returns a list l' such that\n // l' is identical to l in the odd indicies, while its values at the even indicies are equal\n // to the values of the even indicies of l, but sorted.\n // >>> sortEven((List[Long](1l.toLong, 2l.toLong, 3l.toLong)))\n // (List[Long](1l.toLong, 2l.toLong, 3l.toLong))\n // >>> sortEven((List[Long](5l.toLong, 6l.toLong, 3l.toLong, 4l.toLong)))\n // (List[Long](3l.toLong, 6l.toLong, 5l.toLong, 4l.toLong))\n def sortEven(l : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(sortEven((List[Long](1l.toLong, 2l.toLong, 3l.toLong))).equals((List[Long](1l.toLong, 2l.toLong, 3l.toLong))));\n assert(sortEven((List[Long](5l.toLong, 3l.toLong, -5l.toLong, 2l.toLong, -3l.toLong, 3l.toLong, 9l.toLong, 0l.toLong, 123l.toLong, 1l.toLong, -10l.toLong))).equals((List[Long](-10l.toLong, 3l.toLong, -5l.toLong, 2l.toLong, -3l.toLong, 3l.toLong, 5l.toLong, 0l.toLong, 9l.toLong, 1l.toLong, 123l.toLong))));\n assert(sortEven((List[Long](5l.toLong, 8l.toLong, -12l.toLong, 4l.toLong, 23l.toLong, 2l.toLong, 3l.toLong, 11l.toLong, 12l.toLong, -10l.toLong))).equals((List[Long](-12l.toLong, 8l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 2l.toLong, 12l.toLong, 11l.toLong, 23l.toLong, -10l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // I think we all remember that feeling when the result of some long-awaited\n // event is finally known. The feelings and thoughts you have at that moment are\n // definitely worth noting down and comparing.\n // Your task is to determine if a person correctly guessed the results of a number of matches.\n // You are given two lists of scores and guesses of equal length, where each index shows a match. \n // Return a list of the same length denoting how far off each guess was. If they have guessed correctly,\n // the value is 0, and if not, the value is the absolute difference between the guess and the score.\n // example:\n // >>> compare((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 1l.toLong)), (List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 2l.toLong, -2l.toLong)))\n // (List[Long](0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 3l.toLong, 3l.toLong))\n // >>> compare((List[Long](0l.toLong, 5l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 4l.toLong)), (List[Long](4l.toLong, 1l.toLong, 1l.toLong, 0l.toLong, 0l.toLong, -2l.toLong)))\n // (List[Long](4l.toLong, 4l.toLong, 1l.toLong, 0l.toLong, 0l.toLong, 6l.toLong))\n def compare(game : List[Long], guess : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(compare((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 1l.toLong)), (List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 2l.toLong, -2l.toLong))).equals((List[Long](0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 3l.toLong, 3l.toLong))));\n assert(compare((List[Long](0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong)), (List[Long](0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong))).equals((List[Long](0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong))));\n assert(compare((List[Long](1l.toLong, 2l.toLong, 3l.toLong)), (List[Long](-1l.toLong, -2l.toLong, -3l.toLong))).equals((List[Long](2l.toLong, 4l.toLong, 6l.toLong))));\n assert(compare((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 5l.toLong)), (List[Long](-1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((List[Long](2l.toLong, 0l.toLong, 0l.toLong, 1l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a positive integer n, return a tuple that has the number of even and odd\n // integer palindromes that fall within the range(1, n), inclusive.\n // Example 1:\n // >>> evenOddPalindrome((3l))\n // ((1l, 2l))\n // Explanation:\n // Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n // Example 2:\n // >>> evenOddPalindrome((12l))\n // ((4l, 6l))\n // Explanation:\n // Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n // Note:\n // 1. 1 <= n <= 10^3\n // 2. returned tuple has the number of even and odd integer palindromes respectively.\n def evenOddPalindrome(n : Long) : Tuple2[Long, Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(evenOddPalindrome((123l)).equals(((8l, 13l))));\n assert(evenOddPalindrome((12l)).equals(((4l, 6l))));\n assert(evenOddPalindrome((3l)).equals(((1l, 2l))));\n assert(evenOddPalindrome((63l)).equals(((6l, 8l))));\n assert(evenOddPalindrome((25l)).equals(((5l, 6l))));\n assert(evenOddPalindrome((19l)).equals(((4l, 6l))));\n assert(evenOddPalindrome((9l)).equals(((4l, 5l))));\n assert(evenOddPalindrome((1l)).equals(((0l, 1l))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n // fib4(0) -> 0\n // fib4(1) -> 0\n // fib4(2) -> 2\n // fib4(3) -> 0\n // fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n // Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n // >>> fib4((5l))\n // (4l)\n // >>> fib4((6l))\n // (8l)\n // >>> fib4((7l))\n // (14l)\n def fib4(n : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(fib4((5l)) == (4l));\n assert(fib4((8l)) == (28l));\n assert(fib4((10l)) == (104l));\n assert(fib4((12l)) == (386l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given two positive integers a and b, return the even digits between a\n // and b, in ascending order.\n // For example:\n // >>> generateIntegers((2l), (8l))\n // (List[Long](2l.toLong, 4l.toLong, 6l.toLong, 8l.toLong))\n // >>> generateIntegers((8l), (2l))\n // (List[Long](2l.toLong, 4l.toLong, 6l.toLong, 8l.toLong))\n // >>> generateIntegers((10l), (14l))\n // (List[Long]())\n def generateIntegers(a : Long, b : Long) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(generateIntegers((2l), (10l)).equals((List[Long](2l.toLong, 4l.toLong, 6l.toLong, 8l.toLong))));\n assert(generateIntegers((10l), (2l)).equals((List[Long](2l.toLong, 4l.toLong, 6l.toLong, 8l.toLong))));\n assert(generateIntegers((132l), (2l)).equals((List[Long](2l.toLong, 4l.toLong, 6l.toLong, 8l.toLong))));\n assert(generateIntegers((17l), (89l)).equals((List[Long]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // For a given list of input numbers, calculate Mean Absolute Deviation\n // around the mean of this dataset.\n // Mean Absolute Deviation is the average absolute difference between each\n // element and a centerpoint (mean in this case):\n // MAD = average | x - x_mean |\n // >>> meanAbsoluteDeviation((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat)))\n // (1.0f)\n def meanAbsoluteDeviation(numbers : List[Float]) : Float = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(meanAbsoluteDeviation((List[Float](1.0f.toFloat, 2.0f.toFloat))) == (0.5f));\n assert(meanAbsoluteDeviation((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat))) == (1.0f));\n assert(meanAbsoluteDeviation((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat, 5.0f.toFloat))) == (1.2f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function encrypt that takes a string as an argument and\n // returns a string encrypted with the alphabet being rotated. \n // The alphabet should be rotated in a manner such that the letters \n // shift down by two multiplied to two places.\n // For example:\n // >>> encrypt((\"hi\"))\n // (\"lm\")\n // >>> encrypt((\"asdfghjkl\"))\n // (\"ewhjklnop\")\n // >>> encrypt((\"gf\"))\n // (\"kj\")\n // >>> encrypt((\"et\"))\n // (\"ix\")\n def encrypt(s : String) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(encrypt((\"hi\")).equals((\"lm\")));\n assert(encrypt((\"asdfghjkl\")).equals((\"ewhjklnop\")));\n assert(encrypt((\"gf\")).equals((\"kj\")));\n assert(encrypt((\"et\")).equals((\"ix\")));\n assert(encrypt((\"faewfawefaewg\")).equals((\"jeiajeaijeiak\")));\n assert(encrypt((\"hellomyfriend\")).equals((\"lippsqcjvmirh\")));\n assert(encrypt((\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\")).equals((\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\")));\n assert(encrypt((\"a\")).equals((\"e\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n // The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n // as follows: start with any positive integer n. Then each term is obtained from the \n // previous term as follows: if the previous term is even, the next term is one half of \n // the previous term. If the previous term is odd, the next term is 3 times the previous\n // term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n // Note: \n // 1. Collatz(1) is [1].\n // 2. returned list sorted in increasing order.\n // For example:\n // get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n // >>> getOddCollatz((5l))\n // (List[Long](1l.toLong, 5l.toLong))\n def getOddCollatz(n : Long) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(getOddCollatz((14l)).equals((List[Long](1l.toLong, 5l.toLong, 7l.toLong, 11l.toLong, 13l.toLong, 17l.toLong))));\n assert(getOddCollatz((5l)).equals((List[Long](1l.toLong, 5l.toLong))));\n assert(getOddCollatz((12l)).equals((List[Long](1l.toLong, 3l.toLong, 5l.toLong))));\n assert(getOddCollatz((1l)).equals((List[Long](1l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Find how many times a given substring can be found in the original string. Count overlaping cases.\n // >>> howManyTimes((\"\"), (\"a\"))\n // (0l)\n // >>> howManyTimes((\"aaa\"), (\"a\"))\n // (3l)\n // >>> howManyTimes((\"aaaa\"), (\"aa\"))\n // (3l)\n def howManyTimes(string : String, substring : String) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(howManyTimes((\"\"), (\"x\")) == (0l));\n assert(howManyTimes((\"xyxyxyx\"), (\"x\")) == (4l));\n assert(howManyTimes((\"cacacacac\"), (\"cac\")) == (4l));\n assert(howManyTimes((\"john doe\"), (\"john\")) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // We have a list 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n // numbers in the list will be randomly ordered. Your task is to determine if\n // it is possible to get a list sorted in non-decreasing order by performing \n // the following operation on the given list:\n // You are allowed to perform right shift operation any number of times.\n // One right shift operation means shifting all elements of the list by one\n // position in the right direction. The last element of the list will be moved to\n // the starting position in the list i.e. 0th index. \n // If it is possible to obtain the sorted list by performing the above operation\n // then return true else return false.\n // If the given list is empty then return true.\n // Note: The given list is guaranteed to have unique elements.\n // For Example:\n // >>> moveOneBall((List[Long](3l.toLong, 4l.toLong, 5l.toLong, 1l.toLong, 2l.toLong)))\n // (true)\n // Explanation: By performin 2 right shift operations, non-decreasing order can\n // be achieved for the given list.\n // >>> moveOneBall((List[Long](3l.toLong, 5l.toLong, 4l.toLong, 1l.toLong, 2l.toLong)))\n // (false)\n // Explanation:It is not possible to get non-decreasing order for the given\n // list by performing any number of right shift operations.\n def moveOneBall(arr : List[Long]) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(moveOneBall((List[Long](3l.toLong, 4l.toLong, 5l.toLong, 1l.toLong, 2l.toLong))) == (true));\n assert(moveOneBall((List[Long](3l.toLong, 5l.toLong, 10l.toLong, 1l.toLong, 2l.toLong))) == (true));\n assert(moveOneBall((List[Long](4l.toLong, 3l.toLong, 1l.toLong, 2l.toLong))) == (false));\n assert(moveOneBall((List[Long](3l.toLong, 5l.toLong, 4l.toLong, 1l.toLong, 2l.toLong))) == (false));\n assert(moveOneBall((List[Long]())) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function which sorts the given list of integers\n // in ascending order according to the sum of their digits.\n // Note: if there are several items with similar sum of their digits,\n // order them based on their index in original list.\n // For example:\n // >>> orderByPoints((List[Long](1l.toLong, 11l.toLong, -1l.toLong, -11l.toLong, -12l.toLong)))\n // (List[Long](-1l.toLong, -11l.toLong, 1l.toLong, -12l.toLong, 11l.toLong))\n // >>> orderByPoints((List[Long]()))\n // (List[Long]())\n def orderByPoints(nums : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(orderByPoints((List[Long](1l.toLong, 11l.toLong, -1l.toLong, -11l.toLong, -12l.toLong))).equals((List[Long](-1l.toLong, -11l.toLong, 1l.toLong, -12l.toLong, 11l.toLong))));\n assert(orderByPoints((List[Long](1234l.toLong, 423l.toLong, 463l.toLong, 145l.toLong, 2l.toLong, 423l.toLong, 423l.toLong, 53l.toLong, 6l.toLong, 37l.toLong, 3457l.toLong, 3l.toLong, 56l.toLong, 0l.toLong, 46l.toLong))).equals((List[Long](0l.toLong, 2l.toLong, 3l.toLong, 6l.toLong, 53l.toLong, 423l.toLong, 423l.toLong, 423l.toLong, 1234l.toLong, 145l.toLong, 37l.toLong, 46l.toLong, 56l.toLong, 463l.toLong, 3457l.toLong))));\n assert(orderByPoints((List[Long]())).equals((List[Long]())));\n assert(orderByPoints((List[Long](1l.toLong, -11l.toLong, -32l.toLong, 43l.toLong, 54l.toLong, -98l.toLong, 2l.toLong, -3l.toLong))).equals((List[Long](-3l.toLong, -32l.toLong, -98l.toLong, -11l.toLong, 1l.toLong, 2l.toLong, 43l.toLong, 54l.toLong))));\n assert(orderByPoints((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong, 9l.toLong, 10l.toLong, 11l.toLong))).equals((List[Long](1l.toLong, 10l.toLong, 2l.toLong, 11l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong, 9l.toLong))));\n assert(orderByPoints((List[Long](0l.toLong, 6l.toLong, 6l.toLong, -76l.toLong, -21l.toLong, 23l.toLong, 4l.toLong))).equals((List[Long](-76l.toLong, -21l.toLong, 0l.toLong, 4l.toLong, 23l.toLong, 6l.toLong, 6l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return list of prime factors of given integer in the order from smallest to largest.\n // Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n // Input number should be equal to the product of all factors\n // >>> factorize((8l))\n // (List[Long](2l.toLong, 2l.toLong, 2l.toLong))\n // >>> factorize((25l))\n // (List[Long](5l.toLong, 5l.toLong))\n // >>> factorize((70l))\n // (List[Long](2l.toLong, 5l.toLong, 7l.toLong))\n def factorize(n : Long) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(factorize((2l)).equals((List[Long](2l.toLong))));\n assert(factorize((4l)).equals((List[Long](2l.toLong, 2l.toLong))));\n assert(factorize((8l)).equals((List[Long](2l.toLong, 2l.toLong, 2l.toLong))));\n assert(factorize((57l)).equals((List[Long](3l.toLong, 19l.toLong))));\n assert(factorize((3249l)).equals((List[Long](3l.toLong, 3l.toLong, 19l.toLong, 19l.toLong))));\n assert(factorize((185193l)).equals((List[Long](3l.toLong, 3l.toLong, 3l.toLong, 19l.toLong, 19l.toLong, 19l.toLong))));\n assert(factorize((20577l)).equals((List[Long](3l.toLong, 19l.toLong, 19l.toLong, 19l.toLong))));\n assert(factorize((18l)).equals((List[Long](2l.toLong, 3l.toLong, 3l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return true if all numbers in the list l are below threshold t.\n // >>> belowThreshold((List[Long](1l.toLong, 2l.toLong, 4l.toLong, 10l.toLong)), (100l))\n // (true)\n // >>> belowThreshold((List[Long](1l.toLong, 20l.toLong, 4l.toLong, 10l.toLong)), (5l))\n // (false)\n def belowThreshold(l : List[Long], t : Long) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(belowThreshold((List[Long](1l.toLong, 2l.toLong, 4l.toLong, 10l.toLong)), (100l)) == (true));\n assert(belowThreshold((List[Long](1l.toLong, 20l.toLong, 4l.toLong, 10l.toLong)), (5l)) == (false));\n assert(belowThreshold((List[Long](1l.toLong, 20l.toLong, 4l.toLong, 10l.toLong)), (21l)) == (true));\n assert(belowThreshold((List[Long](1l.toLong, 20l.toLong, 4l.toLong, 10l.toLong)), (22l)) == (true));\n assert(belowThreshold((List[Long](1l.toLong, 8l.toLong, 4l.toLong, 10l.toLong)), (11l)) == (true));\n assert(belowThreshold((List[Long](1l.toLong, 8l.toLong, 4l.toLong, 10l.toLong)), (10l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given two positive integers n and m, and your task is to compute the\n // average of the integers from n through m (including n and m). \n // Round the answer to the nearest integer and convert that to binary.\n // If n is greater than m, return -1.\n // Example:\n // >>> roundedAvg((1l), (5l))\n // \"0b11\"\n // >>> roundedAvg((7l), (5l))\n // -1l\n // >>> roundedAvg((10l), (20l))\n // \"0b1111\"\n // >>> roundedAvg((20l), (33l))\n // \"0b11010\"\n def roundedAvg(n : Long, m : Long) : Either[String, Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(roundedAvg((1l), (5l)).equals(\"0b11\"));\n assert(roundedAvg((7l), (13l)).equals(\"0b1010\"));\n assert(roundedAvg((964l), (977l)).equals(\"0b1111001010\"));\n assert(roundedAvg((996l), (997l)).equals(\"0b1111100100\"));\n assert(roundedAvg((560l), (851l)).equals(\"0b1011000010\"));\n assert(roundedAvg((185l), (546l)).equals(\"0b101101110\"));\n assert(roundedAvg((362l), (496l)).equals(\"0b110101101\"));\n assert(roundedAvg((350l), (902l)).equals(\"0b1001110010\"));\n assert(roundedAvg((197l), (233l)).equals(\"0b11010111\"));\n assert(roundedAvg((7l), (5l)).equals(-1l));\n assert(roundedAvg((5l), (1l)).equals(-1l));\n assert(roundedAvg((5l), (5l)).equals(\"0b101\"));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n // For each of the group, output the deepest level of nesting of parentheses.\n // E.g. (()()) has maximum two levels of nesting while ((())) has three.\n // >>> parseNestedParens((\"(()()) ((())) () ((())()())\"))\n // (List[Long](2l.toLong, 3l.toLong, 1l.toLong, 3l.toLong))\n def parseNestedParens(paren_string : String) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(parseNestedParens((\"(()()) ((())) () ((())()())\")).equals((List[Long](2l.toLong, 3l.toLong, 1l.toLong, 3l.toLong))));\n assert(parseNestedParens((\"() (()) ((())) (((())))\")).equals((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))));\n assert(parseNestedParens((\"(()(())((())))\")).equals((List[Long](4l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n // Examples\n // >>> solution((List[Long](5l.toLong, 8l.toLong, 7l.toLong, 1l.toLong)))\n // (12l)\n // >>> solution((List[Long](3l.toLong, 3l.toLong, 3l.toLong, 3l.toLong, 3l.toLong)))\n // (9l)\n // >>> solution((List[Long](30l.toLong, 13l.toLong, 24l.toLong, 321l.toLong)))\n // (0l)\n def solution(lst : List[Long]) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(solution((List[Long](5l.toLong, 8l.toLong, 7l.toLong, 1l.toLong))) == (12l));\n assert(solution((List[Long](3l.toLong, 3l.toLong, 3l.toLong, 3l.toLong, 3l.toLong))) == (9l));\n assert(solution((List[Long](30l.toLong, 13l.toLong, 24l.toLong, 321l.toLong))) == (0l));\n assert(solution((List[Long](5l.toLong, 9l.toLong))) == (5l));\n assert(solution((List[Long](2l.toLong, 4l.toLong, 8l.toLong))) == (0l));\n assert(solution((List[Long](30l.toLong, 13l.toLong, 23l.toLong, 32l.toLong))) == (23l));\n assert(solution((List[Long](3l.toLong, 13l.toLong, 2l.toLong, 9l.toLong))) == (3l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a positive integer n. You have to create an integer list a of length n.\n // For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n // Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n // and a[i] + a[j] + a[k] is a multiple of 3.\n // Example :\n // >>> getMaxTriples((5l))\n // (1l)\n // Explanation: \n // a = [1, 3, 7, 13, 21]\n // The only valid triple is (1, 7, 13).\n def getMaxTriples(n : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(getMaxTriples((5l)) == (1l));\n assert(getMaxTriples((6l)) == (4l));\n assert(getMaxTriples((10l)) == (36l));\n assert(getMaxTriples((100l)) == (53361l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // There are eight planets in our solar system: the closerst to the Sun \n // is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n // Uranus, Neptune.\n // Write a function that takes two planet names as strings planet1 and planet2. \n // The function should return a tuple containing all planets whose orbits are \n // located between the orbit of planet1 and the orbit of planet2, sorted by \n // the proximity to the sun. \n // The function should return an empty tuple if planet1 or planet2\n // are not correct planet names. \n // Examples\n // >>> bf((\"Jupiter\"), (\"Neptune\"))\n // (List[String](\"Saturn\", \"Uranus\"))\n // >>> bf((\"Earth\"), (\"Mercury\"))\n // (List[String](\"Venus\"))\n // >>> bf((\"Mercury\"), (\"Uranus\"))\n // (List[String](\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"))\n def bf(planet1 : String, planet2 : String) : List[String] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(bf((\"Jupiter\"), (\"Neptune\")).equals((List[String](\"Saturn\", \"Uranus\"))));\n assert(bf((\"Earth\"), (\"Mercury\")).equals((List[String](\"Venus\"))));\n assert(bf((\"Mercury\"), (\"Uranus\")).equals((List[String](\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"))));\n assert(bf((\"Neptune\"), (\"Venus\")).equals((List[String](\"Earth\", \"Mars\", \"Jupiter\", \"Saturn\", \"Uranus\"))));\n assert(bf((\"Earth\"), (\"Earth\")).equals((List[String]())));\n assert(bf((\"Mars\"), (\"Earth\")).equals((List[String]())));\n assert(bf((\"Jupiter\"), (\"Makemake\")).equals((List[String]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a list of integers.\n // Write a function next_smallest() that returns the 2nd smallest element of the list.\n // Return None if there is no such element.\n // >>> nextSmallest((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong)))\n // 2l\n // >>> nextSmallest((List[Long](5l.toLong, 1l.toLong, 4l.toLong, 3l.toLong, 2l.toLong)))\n // 2l\n // >>> nextSmallest((List[Long]()))\n // None\n // >>> nextSmallest((List[Long](1l.toLong, 1l.toLong)))\n // None\n def nextSmallest(lst : List[Long]) : Option[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(nextSmallest((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong))).equals(2l));\n assert(nextSmallest((List[Long](5l.toLong, 1l.toLong, 4l.toLong, 3l.toLong, 2l.toLong))).equals(2l));\n assert(nextSmallest((List[Long]())).equals(None));\n assert(nextSmallest((List[Long](1l.toLong, 1l.toLong))).equals(None));\n assert(nextSmallest((List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong, 0l.toLong))).equals(1l));\n assert(nextSmallest((List[Long](1l.toLong, 1l.toLong))).equals(None));\n assert(nextSmallest((List[Long](-35l.toLong, 34l.toLong, 12l.toLong, -45l.toLong))).equals(-35l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Input is a space-delimited string of numberals from 'zero' to 'nine'.\n // Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n // Return the string with numbers sorted from smallest to largest\n // >>> sortNumbers((\"three one five\"))\n // (\"one three five\")\n def sortNumbers(numbers : String) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(sortNumbers((\"\")).equals((\"\")));\n assert(sortNumbers((\"three\")).equals((\"three\")));\n assert(sortNumbers((\"three five nine\")).equals((\"three five nine\")));\n assert(sortNumbers((\"five zero four seven nine eight\")).equals((\"zero four five seven eight nine\")));\n assert(sortNumbers((\"six five four three two one zero\")).equals((\"zero one two three four five six\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given 2 words. You need to return true if the second word or any of its rotations is a substring in the first word\n // >>> cycpatternCheck((\"abcd\"), (\"abd\"))\n // (false)\n // >>> cycpatternCheck((\"hello\"), (\"ell\"))\n // (true)\n // >>> cycpatternCheck((\"whassup\"), (\"psus\"))\n // (false)\n // >>> cycpatternCheck((\"abab\"), (\"baa\"))\n // (true)\n // >>> cycpatternCheck((\"efef\"), (\"eeff\"))\n // (false)\n // >>> cycpatternCheck((\"himenss\"), (\"simen\"))\n // (true)\n def cycpatternCheck(a : String, b : String) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(cycpatternCheck((\"xyzw\"), (\"xyw\")) == (false));\n assert(cycpatternCheck((\"yello\"), (\"ell\")) == (true));\n assert(cycpatternCheck((\"whattup\"), (\"ptut\")) == (false));\n assert(cycpatternCheck((\"efef\"), (\"fee\")) == (true));\n assert(cycpatternCheck((\"abab\"), (\"aabb\")) == (false));\n assert(cycpatternCheck((\"winemtt\"), (\"tinem\")) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You will be given a number in decimal form and your task is to convert it to\n // binary format. The function should return a string, with each character representing a binary\n // number. Each character in the string will be '0' or '1'.\n // There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n // The extra characters are there to help with the format.\n // Examples:\n // >>> decimalToBinary((15l))\n // (\"db1111db\")\n // >>> decimalToBinary((32l))\n // (\"db100000db\")\n def decimalToBinary(decimal : Long) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(decimalToBinary((0l)).equals((\"db0db\")));\n assert(decimalToBinary((32l)).equals((\"db100000db\")));\n assert(decimalToBinary((103l)).equals((\"db1100111db\")));\n assert(decimalToBinary((15l)).equals((\"db1111db\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Filter an input list of strings only for ones that contain given substring\n // >>> filterBySubstring((List[String]()), (\"a\"))\n // (List[String]())\n // >>> filterBySubstring((List[String](\"abc\", \"bacd\", \"cde\", \"array\")), (\"a\"))\n // (List[String](\"abc\", \"bacd\", \"array\"))\n def filterBySubstring(strings : List[String], substring : String) : List[String] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(filterBySubstring((List[String]()), (\"john\")).equals((List[String]())));\n assert(filterBySubstring((List[String](\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\")), (\"xxx\")).equals((List[String](\"xxx\", \"xxxAAA\", \"xxx\"))));\n assert(filterBySubstring((List[String](\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\")), (\"xx\")).equals((List[String](\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"))));\n assert(filterBySubstring((List[String](\"grunt\", \"trumpet\", \"prune\", \"gruesome\")), (\"run\")).equals((List[String](\"grunt\", \"prune\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given an integer. return a tuple that has the number of even and odd digits respectively.\n // Example:\n // >>> evenOddCount((-12l))\n // ((1l, 1l))\n // >>> evenOddCount((123l))\n // ((1l, 2l))\n def evenOddCount(num : Long) : Tuple2[Long, Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(evenOddCount((7l)).equals(((0l, 1l))));\n assert(evenOddCount((-78l)).equals(((1l, 1l))));\n assert(evenOddCount((3452l)).equals(((2l, 2l))));\n assert(evenOddCount((346211l)).equals(((3l, 3l))));\n assert(evenOddCount((-345821l)).equals(((3l, 3l))));\n assert(evenOddCount((-2l)).equals(((1l, 0l))));\n assert(evenOddCount((-45347l)).equals(((2l, 3l))));\n assert(evenOddCount((0l)).equals(((1l, 0l))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that accepts a list of strings.\n // The list contains different words. Return the word with maximum number\n // of unique characters. If multiple strings have maximum number of unique\n // characters, return the one which comes first in lexicographical order.\n // >>> findMax((List[String](\"name\", \"of\", \"string\")))\n // (\"string\")\n // >>> findMax((List[String](\"name\", \"enam\", \"game\")))\n // (\"enam\")\n // >>> findMax((List[String](\"aaaaaaa\", \"bb\", \"cc\")))\n // (\"aaaaaaa\")\n def findMax(words : List[String]) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(findMax((List[String](\"name\", \"of\", \"string\"))).equals((\"string\")));\n assert(findMax((List[String](\"name\", \"enam\", \"game\"))).equals((\"enam\")));\n assert(findMax((List[String](\"aaaaaaa\", \"bb\", \"cc\"))).equals((\"aaaaaaa\")));\n assert(findMax((List[String](\"abc\", \"cba\"))).equals((\"abc\")));\n assert(findMax((List[String](\"play\", \"this\", \"game\", \"of\", \"footbott\"))).equals((\"footbott\")));\n assert(findMax((List[String](\"we\", \"are\", \"gonna\", \"rock\"))).equals((\"gonna\")));\n assert(findMax((List[String](\"we\", \"are\", \"a\", \"mad\", \"nation\"))).equals((\"nation\")));\n assert(findMax((List[String](\"this\", \"is\", \"a\", \"prrk\"))).equals((\"this\")));\n assert(findMax((List[String](\"b\"))).equals((\"b\")));\n assert(findMax((List[String](\"play\", \"play\", \"play\"))).equals((\"play\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a positive integer n, return the count of the numbers of n-digit\n // positive integers that start or end with 1.\n def startsOneEnds(n : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(startsOneEnds((1l)) == (1l));\n assert(startsOneEnds((2l)) == (18l));\n assert(startsOneEnds((3l)) == (180l));\n assert(startsOneEnds((4l)) == (1800l));\n assert(startsOneEnds((5l)) == (18000l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function that returns a tuple (a, b), where 'a' is\n // the largest of negative integers, and 'b' is the smallest\n // of positive integers in a list.\n // If there is no negative or positive integers, return them as None.\n // Examples:\n // >>> largestSmallestIntegers((List[Long](2l.toLong, 4l.toLong, 1l.toLong, 3l.toLong, 5l.toLong, 7l.toLong)))\n // (Some(None), Some(1l))\n // >>> largestSmallestIntegers((List[Long]()))\n // (Some(None), Some(None))\n // >>> largestSmallestIntegers((List[Long](0l.toLong)))\n // (Some(None), Some(None))\n def largestSmallestIntegers(lst : List[Long]) : Tuple2[Option[Long], Option[Long]] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(largestSmallestIntegers((List[Long](2l.toLong, 4l.toLong, 1l.toLong, 3l.toLong, 5l.toLong, 7l.toLong))).equals((Some(None), Some(1l))));\n assert(largestSmallestIntegers((List[Long](2l.toLong, 4l.toLong, 1l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 0l.toLong))).equals((Some(None), Some(1l))));\n assert(largestSmallestIntegers((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 4l.toLong, 5l.toLong, 6l.toLong, -2l.toLong))).equals((-2l, 1l)));\n assert(largestSmallestIntegers((List[Long](4l.toLong, 5l.toLong, 3l.toLong, 6l.toLong, 2l.toLong, 7l.toLong, -7l.toLong))).equals((-7l, 2l)));\n assert(largestSmallestIntegers((List[Long](7l.toLong, 3l.toLong, 8l.toLong, 4l.toLong, 9l.toLong, 2l.toLong, 5l.toLong, -9l.toLong))).equals((-9l, 2l)));\n assert(largestSmallestIntegers((List[Long]())).equals((Some(None), Some(None))));\n assert(largestSmallestIntegers((List[Long](0l.toLong))).equals((Some(None), Some(None))));\n assert(largestSmallestIntegers((List[Long](-1l.toLong, -3l.toLong, -5l.toLong, -6l.toLong))).equals((Some(-1l), Some(None))));\n assert(largestSmallestIntegers((List[Long](-1l.toLong, -3l.toLong, -5l.toLong, -6l.toLong, 0l.toLong))).equals((Some(-1l), Some(None))));\n assert(largestSmallestIntegers((List[Long](-6l.toLong, -4l.toLong, -4l.toLong, -3l.toLong, 1l.toLong))).equals((-3l, 1l)));\n assert(largestSmallestIntegers((List[Long](-6l.toLong, -4l.toLong, -4l.toLong, -3l.toLong, -100l.toLong, 1l.toLong))).equals((-3l, 1l)));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // \"Given a list representing a branch of a tree that has non-negative integer nodes\n // your task is to pluck one of the nodes and return it.\n // The plucked node should be the node with the smallest even value.\n // If multiple nodes with the same smallest even value are found return the node that has smallest index.\n // The plucked node should be returned in a list, [ smalest_value, its index ],\n // If there are no even values or the given list is empty, return [].\n // Example 1:\n // >>> pluck((List[Long](4l.toLong, 2l.toLong, 3l.toLong)))\n // (List[Long](2l.toLong, 1l.toLong))\n // Explanation: 2 has the smallest even value, and 2 has the smallest index.\n // Example 2:\n // >>> pluck((List[Long](1l.toLong, 2l.toLong, 3l.toLong)))\n // (List[Long](2l.toLong, 1l.toLong))\n // Explanation: 2 has the smallest even value, and 2 has the smallest index.\n // Example 3:\n // >>> pluck((List[Long]()))\n // (List[Long]())\n // Example 4:\n // >>> pluck((List[Long](5l.toLong, 0l.toLong, 3l.toLong, 0l.toLong, 4l.toLong, 2l.toLong)))\n // (List[Long](0l.toLong, 1l.toLong))\n // Explanation: 0 is the smallest value, but there are two zeros,\n // so we will choose the first zero, which has the smallest index.\n // Constraints:\n // * 1 <= nodes.length <= 10000\n // * 0 <= node.value\n def pluck(arr : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(pluck((List[Long](4l.toLong, 2l.toLong, 3l.toLong))).equals((List[Long](2l.toLong, 1l.toLong))));\n assert(pluck((List[Long](1l.toLong, 2l.toLong, 3l.toLong))).equals((List[Long](2l.toLong, 1l.toLong))));\n assert(pluck((List[Long]())).equals((List[Long]())));\n assert(pluck((List[Long](5l.toLong, 0l.toLong, 3l.toLong, 0l.toLong, 4l.toLong, 2l.toLong))).equals((List[Long](0l.toLong, 1l.toLong))));\n assert(pluck((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 0l.toLong, 5l.toLong, 3l.toLong))).equals((List[Long](0l.toLong, 3l.toLong))));\n assert(pluck((List[Long](5l.toLong, 4l.toLong, 8l.toLong, 4l.toLong, 8l.toLong))).equals((List[Long](4l.toLong, 1l.toLong))));\n assert(pluck((List[Long](7l.toLong, 6l.toLong, 7l.toLong, 1l.toLong))).equals((List[Long](6l.toLong, 1l.toLong))));\n assert(pluck((List[Long](7l.toLong, 9l.toLong, 7l.toLong, 1l.toLong))).equals((List[Long]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function count_nums which takes a list of integers and returns\n // the number of elements which has a sum of digits > 0.\n // If a number is negative, then its first signed digit will be negative:\n // e.g. -123 has signed digits -1, 2, and 3.\n // >>> countNums((List[Long]()))\n // (0l)\n // >>> countNums((List[Long](-1l.toLong, 11l.toLong, -11l.toLong)))\n // (1l)\n // >>> countNums((List[Long](1l.toLong, 1l.toLong, 2l.toLong)))\n // (3l)\n def countNums(arr : List[Long]) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(countNums((List[Long]())) == (0l));\n assert(countNums((List[Long](-1l.toLong, -2l.toLong, 0l.toLong))) == (0l));\n assert(countNums((List[Long](1l.toLong, 1l.toLong, 2l.toLong, -2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong))) == (6l));\n assert(countNums((List[Long](1l.toLong, 6l.toLong, 9l.toLong, -6l.toLong, 0l.toLong, 1l.toLong, 5l.toLong))) == (5l));\n assert(countNums((List[Long](1l.toLong, 100l.toLong, 98l.toLong, -7l.toLong, 1l.toLong, -1l.toLong))) == (4l));\n assert(countNums((List[Long](12l.toLong, 23l.toLong, 34l.toLong, -45l.toLong, -56l.toLong, 0l.toLong))) == (5l));\n assert(countNums((List[Long](0l.toLong, 1l.toLong))) == (1l));\n assert(countNums((List[Long](1l.toLong))) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n // each cell of the grid contains a value. Every integer in the range [1, N * N]\n // inclusive appears exactly once on the cells of the grid.\n // You have to find the minimum path of length k in the grid. You can start\n // from any cell, and in each step you can move to any of the neighbor cells,\n // in other words, you can go to cells which share an edge with you current\n // cell.\n // Please note that a path of length k means visiting exactly k cells (not\n // necessarily distinct).\n // You CANNOT go off the grid.\n // A path A (of length k) is considered less than a path B (of length k) if\n // after making the ordered lists of the values on the cells that A and B go\n // through (let's call them lst_A and lst_B), lst_A is lexicographically less\n // than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n // such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n // lst_A[j] = lst_B[j].\n // It is guaranteed that the answer is unique.\n // Return an ordered list of the values on the cells that the minimum path go through.\n // Examples: \n // >>> minPath((List[List[Long]](List[Long](1l.toLong, 2l.toLong, 3l.toLong), List[Long](4l.toLong, 5l.toLong, 6l.toLong), List[Long](7l.toLong, 8l.toLong, 9l.toLong))), (3l))\n // (List[Long](1l.toLong, 2l.toLong, 1l.toLong))\n // >>> minPath((List[List[Long]](List[Long](5l.toLong, 9l.toLong, 3l.toLong), List[Long](4l.toLong, 1l.toLong, 6l.toLong), List[Long](7l.toLong, 8l.toLong, 2l.toLong))), (1l))\n // (List[Long](1l.toLong))\n def minPath(grid : List[List[Long]], k : Long) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(minPath((List[List[Long]](List[Long](1l.toLong, 2l.toLong, 3l.toLong), List[Long](4l.toLong, 5l.toLong, 6l.toLong), List[Long](7l.toLong, 8l.toLong, 9l.toLong))), (3l)).equals((List[Long](1l.toLong, 2l.toLong, 1l.toLong))));\n assert(minPath((List[List[Long]](List[Long](5l.toLong, 9l.toLong, 3l.toLong), List[Long](4l.toLong, 1l.toLong, 6l.toLong), List[Long](7l.toLong, 8l.toLong, 2l.toLong))), (1l)).equals((List[Long](1l.toLong))));\n assert(minPath((List[List[Long]](List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong), List[Long](5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong), List[Long](9l.toLong, 10l.toLong, 11l.toLong, 12l.toLong), List[Long](13l.toLong, 14l.toLong, 15l.toLong, 16l.toLong))), (4l)).equals((List[Long](1l.toLong, 2l.toLong, 1l.toLong, 2l.toLong))));\n assert(minPath((List[List[Long]](List[Long](6l.toLong, 4l.toLong, 13l.toLong, 10l.toLong), List[Long](5l.toLong, 7l.toLong, 12l.toLong, 1l.toLong), List[Long](3l.toLong, 16l.toLong, 11l.toLong, 15l.toLong), List[Long](8l.toLong, 14l.toLong, 9l.toLong, 2l.toLong))), (7l)).equals((List[Long](1l.toLong, 10l.toLong, 1l.toLong, 10l.toLong, 1l.toLong, 10l.toLong, 1l.toLong))));\n assert(minPath((List[List[Long]](List[Long](8l.toLong, 14l.toLong, 9l.toLong, 2l.toLong), List[Long](6l.toLong, 4l.toLong, 13l.toLong, 15l.toLong), List[Long](5l.toLong, 7l.toLong, 1l.toLong, 12l.toLong), List[Long](3l.toLong, 10l.toLong, 11l.toLong, 16l.toLong))), (5l)).equals((List[Long](1l.toLong, 7l.toLong, 1l.toLong, 7l.toLong, 1l.toLong))));\n assert(minPath((List[List[Long]](List[Long](11l.toLong, 8l.toLong, 7l.toLong, 2l.toLong), List[Long](5l.toLong, 16l.toLong, 14l.toLong, 4l.toLong), List[Long](9l.toLong, 3l.toLong, 15l.toLong, 6l.toLong), List[Long](12l.toLong, 13l.toLong, 10l.toLong, 1l.toLong))), (9l)).equals((List[Long](1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong, 1l.toLong))));\n assert(minPath((List[List[Long]](List[Long](12l.toLong, 13l.toLong, 10l.toLong, 1l.toLong), List[Long](9l.toLong, 3l.toLong, 15l.toLong, 6l.toLong), List[Long](5l.toLong, 16l.toLong, 14l.toLong, 4l.toLong), List[Long](11l.toLong, 8l.toLong, 7l.toLong, 2l.toLong))), (12l)).equals((List[Long](1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong))));\n assert(minPath((List[List[Long]](List[Long](2l.toLong, 7l.toLong, 4l.toLong), List[Long](3l.toLong, 1l.toLong, 5l.toLong), List[Long](6l.toLong, 8l.toLong, 9l.toLong))), (8l)).equals((List[Long](1l.toLong, 3l.toLong, 1l.toLong, 3l.toLong, 1l.toLong, 3l.toLong, 1l.toLong, 3l.toLong))));\n assert(minPath((List[List[Long]](List[Long](6l.toLong, 1l.toLong, 5l.toLong), List[Long](3l.toLong, 8l.toLong, 9l.toLong), List[Long](2l.toLong, 7l.toLong, 4l.toLong))), (8l)).equals((List[Long](1l.toLong, 5l.toLong, 1l.toLong, 5l.toLong, 1l.toLong, 5l.toLong, 1l.toLong, 5l.toLong))));\n assert(minPath((List[List[Long]](List[Long](1l.toLong, 2l.toLong), List[Long](3l.toLong, 4l.toLong))), (10l)).equals((List[Long](1l.toLong, 2l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 2l.toLong))));\n assert(minPath((List[List[Long]](List[Long](1l.toLong, 3l.toLong), List[Long](3l.toLong, 2l.toLong))), (10l)).equals((List[Long](1l.toLong, 3l.toLong, 1l.toLong, 3l.toLong, 1l.toLong, 3l.toLong, 1l.toLong, 3l.toLong, 1l.toLong, 3l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given list of integers, return list in strange order.\n // Strange sorting, is when you start with the minimum value,\n // then maximum of the remaining integers, then minimum and so on.\n // Examples:\n // >>> strangeSortList((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong)))\n // (List[Long](1l.toLong, 4l.toLong, 2l.toLong, 3l.toLong))\n // >>> strangeSortList((List[Long](5l.toLong, 5l.toLong, 5l.toLong, 5l.toLong)))\n // (List[Long](5l.toLong, 5l.toLong, 5l.toLong, 5l.toLong))\n // >>> strangeSortList((List[Long]()))\n // (List[Long]())\n def strangeSortList(lst : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(strangeSortList((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((List[Long](1l.toLong, 4l.toLong, 2l.toLong, 3l.toLong))));\n assert(strangeSortList((List[Long](5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong, 9l.toLong))).equals((List[Long](5l.toLong, 9l.toLong, 6l.toLong, 8l.toLong, 7l.toLong))));\n assert(strangeSortList((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong))).equals((List[Long](1l.toLong, 5l.toLong, 2l.toLong, 4l.toLong, 3l.toLong))));\n assert(strangeSortList((List[Long](5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong, 9l.toLong, 1l.toLong))).equals((List[Long](1l.toLong, 9l.toLong, 5l.toLong, 8l.toLong, 6l.toLong, 7l.toLong))));\n assert(strangeSortList((List[Long](5l.toLong, 5l.toLong, 5l.toLong, 5l.toLong))).equals((List[Long](5l.toLong, 5l.toLong, 5l.toLong, 5l.toLong))));\n assert(strangeSortList((List[Long]())).equals((List[Long]())));\n assert(strangeSortList((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong))).equals((List[Long](1l.toLong, 8l.toLong, 2l.toLong, 7l.toLong, 3l.toLong, 6l.toLong, 4l.toLong, 5l.toLong))));\n assert(strangeSortList((List[Long](0l.toLong, 2l.toLong, 2l.toLong, 2l.toLong, 5l.toLong, 5l.toLong, -5l.toLong, -5l.toLong))).equals((List[Long](-5l.toLong, 5l.toLong, -5l.toLong, 5l.toLong, 0l.toLong, 2l.toLong, 2l.toLong, 2l.toLong))));\n assert(strangeSortList((List[Long](111111l.toLong))).equals((List[Long](111111l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a string 'text', return its md5 hash equivalent string.\n // If 'text' is an empty string, return None.\n // >>> stringToMd5((\"Hello world\"))\n // \"3e25960a79dbc69b674cd4ec67a72c62\"\n def stringToMd5(text : String) : Option[String] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(stringToMd5((\"Hello world\")).equals(\"3e25960a79dbc69b674cd4ec67a72c62\"));\n assert(stringToMd5((\"\")).equals(None));\n assert(stringToMd5((\"A B C\")).equals(\"0ef78513b0cb8cef12743f5aeb35f888\"));\n assert(stringToMd5((\"password\")).equals(\"5f4dcc3b5aa765d61d8327deb882cf99\"));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a word. Your task is to find the closest vowel that stands between \n // two consonants from the right side of the word (case sensitive).\n // Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n // find any vowel met the above condition. \n // You may assume that the given string contains English letter only.\n // Example:\n // >>> getClosestVowel((\"yogurt\"))\n // (\"u\")\n // >>> getClosestVowel((\"FULL\"))\n // (\"U\")\n // >>> getClosestVowel((\"quick\"))\n // (\"\")\n // >>> getClosestVowel((\"ab\"))\n // (\"\")\n def getClosestVowel(word : String) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(getClosestVowel((\"yogurt\")).equals((\"u\")));\n assert(getClosestVowel((\"full\")).equals((\"u\")));\n assert(getClosestVowel((\"easy\")).equals((\"\")));\n assert(getClosestVowel((\"eAsy\")).equals((\"\")));\n assert(getClosestVowel((\"ali\")).equals((\"\")));\n assert(getClosestVowel((\"bad\")).equals((\"a\")));\n assert(getClosestVowel((\"most\")).equals((\"o\")));\n assert(getClosestVowel((\"ab\")).equals((\"\")));\n assert(getClosestVowel((\"ba\")).equals((\"\")));\n assert(getClosestVowel((\"quick\")).equals((\"\")));\n assert(getClosestVowel((\"anime\")).equals((\"i\")));\n assert(getClosestVowel((\"Asia\")).equals((\"\")));\n assert(getClosestVowel((\"Above\")).equals((\"o\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Change numerical base of input number x to base.\n // return string representation after the conversion.\n // base numbers are less than 10.\n // >>> changeBase((8l), (3l))\n // (\"22\")\n // >>> changeBase((8l), (2l))\n // (\"1000\")\n // >>> changeBase((7l), (2l))\n // (\"111\")\n def changeBase(x : Long, base : Long) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(changeBase((8l), (3l)).equals((\"22\")));\n assert(changeBase((9l), (3l)).equals((\"100\")));\n assert(changeBase((234l), (2l)).equals((\"11101010\")));\n assert(changeBase((16l), (2l)).equals((\"10000\")));\n assert(changeBase((8l), (2l)).equals((\"1000\")));\n assert(changeBase((7l), (2l)).equals((\"111\")));\n assert(changeBase((2l), (3l)).equals((\"2\")));\n assert(changeBase((3l), (4l)).equals((\"3\")));\n assert(changeBase((4l), (5l)).equals((\"4\")));\n assert(changeBase((5l), (6l)).equals((\"5\")));\n assert(changeBase((6l), (7l)).equals((\"6\")));\n assert(changeBase((7l), (8l)).equals((\"7\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Check if in given list of numbers, are any two numbers closer to each other than\n // given threshold.\n // >>> hasCloseElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat)), (0.5f))\n // (false)\n // >>> hasCloseElements((List[Float](1.0f.toFloat, 2.8f.toFloat, 3.0f.toFloat, 4.0f.toFloat, 5.0f.toFloat, 2.0f.toFloat)), (0.3f))\n // (true)\n def hasCloseElements(numbers : List[Float], threshold : Float) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(hasCloseElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.9f.toFloat, 4.0f.toFloat, 5.0f.toFloat, 2.2f.toFloat)), (0.3f)) == (true));\n assert(hasCloseElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.9f.toFloat, 4.0f.toFloat, 5.0f.toFloat, 2.2f.toFloat)), (0.05f)) == (false));\n assert(hasCloseElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 5.9f.toFloat, 4.0f.toFloat, 5.0f.toFloat)), (0.95f)) == (true));\n assert(hasCloseElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 5.9f.toFloat, 4.0f.toFloat, 5.0f.toFloat)), (0.8f)) == (false));\n assert(hasCloseElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat, 5.0f.toFloat, 2.0f.toFloat)), (0.1f)) == (true));\n assert(hasCloseElements((List[Float](1.1f.toFloat, 2.2f.toFloat, 3.1f.toFloat, 4.1f.toFloat, 5.1f.toFloat)), (1.0f)) == (true));\n assert(hasCloseElements((List[Float](1.1f.toFloat, 2.2f.toFloat, 3.1f.toFloat, 4.1f.toFloat, 5.1f.toFloat)), (0.5f)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function that takes a string as input which contains only square brackets.\n // The function should return true if and only if there is a valid subsequence of brackets \n // where at least one bracket in the subsequence is nested.\n // >>> isNested((\"[[]]\"))\n // (true)\n // >>> isNested((\"[]]]]]]][[[[[]\"))\n // (false)\n // >>> isNested((\"[][]\"))\n // (false)\n // >>> isNested((\"[]\"))\n // (false)\n // >>> isNested((\"[[][]]\"))\n // (true)\n // >>> isNested((\"[[]][[\"))\n // (true)\n def isNested(string : String) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(isNested((\"[[]]\")) == (true));\n assert(isNested((\"[]]]]]]][[[[[]\")) == (false));\n assert(isNested((\"[][]\")) == (false));\n assert(isNested((\"[]\")) == (false));\n assert(isNested((\"[[[[]]]]\")) == (true));\n assert(isNested((\"[]]]]]]]]]]\")) == (false));\n assert(isNested((\"[][][[]]\")) == (true));\n assert(isNested((\"[[]\")) == (false));\n assert(isNested((\"[]]\")) == (false));\n assert(isNested((\"[[]][[\")) == (true));\n assert(isNested((\"[[][]]\")) == (true));\n assert(isNested((\"\")) == (false));\n assert(isNested((\"[[[[[[[[\")) == (false));\n assert(isNested((\"]]]]]]]]\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Concatenate list of strings into a single string\n // >>> concatenate((List[String]()))\n // (\"\")\n // >>> concatenate((List[String](\"a\", \"b\", \"c\")))\n // (\"abc\")\n def concatenate(strings : List[String]) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(concatenate((List[String]())).equals((\"\")));\n assert(concatenate((List[String](\"x\", \"y\", \"z\"))).equals((\"xyz\")));\n assert(concatenate((List[String](\"x\", \"y\", \"z\", \"w\", \"k\"))).equals((\"xyzwk\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n // >>> primeFib((1l))\n // (2l)\n // >>> primeFib((2l))\n // (3l)\n // >>> primeFib((3l))\n // (5l)\n // >>> primeFib((4l))\n // (13l)\n // >>> primeFib((5l))\n // (89l)\n def primeFib(n : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(primeFib((1l)) == (2l));\n assert(primeFib((2l)) == (3l));\n assert(primeFib((3l)) == (5l));\n assert(primeFib((4l)) == (13l));\n assert(primeFib((5l)) == (89l));\n assert(primeFib((6l)) == (233l));\n assert(primeFib((7l)) == (1597l));\n assert(primeFib((8l)) == (28657l));\n assert(primeFib((9l)) == (514229l));\n assert(primeFib((10l)) == (433494437l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n // other and return them in order (smaller number, larger number).\n // >>> findClosestElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat, 5.0f.toFloat, 2.2f.toFloat)))\n // ((2.0f, 2.2f))\n // >>> findClosestElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat, 5.0f.toFloat, 2.0f.toFloat)))\n // ((2.0f, 2.0f))\n def findClosestElements(numbers : List[Float]) : Tuple2[Float, Float] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(findClosestElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.9f.toFloat, 4.0f.toFloat, 5.0f.toFloat, 2.2f.toFloat))).equals(((3.9f, 4.0f))));\n assert(findClosestElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 5.9f.toFloat, 4.0f.toFloat, 5.0f.toFloat))).equals(((5.0f, 5.9f))));\n assert(findClosestElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat, 5.0f.toFloat, 2.2f.toFloat))).equals(((2.0f, 2.2f))));\n assert(findClosestElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat, 5.0f.toFloat, 2.0f.toFloat))).equals(((2.0f, 2.0f))));\n assert(findClosestElements((List[Float](1.1f.toFloat, 2.2f.toFloat, 3.1f.toFloat, 4.1f.toFloat, 5.1f.toFloat))).equals(((2.2f, 3.1f))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You have been tasked to write a function that receives \n // a hexadecimal number as a string and counts the number of hexadecimal \n // digits that are primes (prime number, or a prime, is a natural number \n // greater than 1 that is not a product of two smaller natural numbers).\n // Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n // Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n // So you have to determine a number of the following digits: 2, 3, 5, 7, \n // B (=decimal 11), D (=decimal 13).\n // Note: you may assume the input is always correct or empty string, \n // and symbols A,B,C,D,E,F are always uppercase.\n // Examples:\n // >>> hexKey((\"AB\"))\n // (1l)\n // >>> hexKey((\"1077E\"))\n // (2l)\n // >>> hexKey((\"ABED1A33\"))\n // (4l)\n // >>> hexKey((\"123456789ABCDEF0\"))\n // (6l)\n // >>> hexKey((\"2020\"))\n // (2l)\n def hexKey(num : String) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(hexKey((\"AB\")) == (1l));\n assert(hexKey((\"1077E\")) == (2l));\n assert(hexKey((\"ABED1A33\")) == (4l));\n assert(hexKey((\"2020\")) == (2l));\n assert(hexKey((\"123456789ABCDEF0\")) == (6l));\n assert(hexKey((\"112233445566778899AABBCCDDEEFF00\")) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Complete the function that takes two integers and returns \n // the product of their unit digits.\n // Assume the input is always valid.\n // Examples:\n // >>> multiply((148l), (412l))\n // (16l)\n // >>> multiply((19l), (28l))\n // (72l)\n // >>> multiply((2020l), (1851l))\n // (0l)\n // >>> multiply((14l), (-15l))\n // (20l)\n def multiply(a : Long, b : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(multiply((148l), (412l)) == (16l));\n assert(multiply((19l), (28l)) == (72l));\n assert(multiply((2020l), (1851l)) == (0l));\n assert(multiply((14l), (-15l)) == (20l));\n assert(multiply((76l), (67l)) == (42l));\n assert(multiply((17l), (27l)) == (49l));\n assert(multiply((0l), (1l)) == (0l));\n assert(multiply((0l), (0l)) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given list of numbers (of at least two elements), apply a linear transform to that list,\n // such that the smallest number will become 0 and the largest will become 1\n // >>> rescaleToUnit((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat, 5.0f.toFloat)))\n // (List[Float](0.0f.toFloat, 0.25f.toFloat, 0.5f.toFloat, 0.75f.toFloat, 1.0f.toFloat))\n def rescaleToUnit(numbers : List[Float]) : List[Float] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(rescaleToUnit((List[Float](2.0f.toFloat, 49.9f.toFloat))).equals((List[Float](0.0f.toFloat, 1.0f.toFloat))));\n assert(rescaleToUnit((List[Float](100.0f.toFloat, 49.9f.toFloat))).equals((List[Float](1.0f.toFloat, 0.0f.toFloat))));\n assert(rescaleToUnit((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat, 5.0f.toFloat))).equals((List[Float](0.0f.toFloat, 0.25f.toFloat, 0.5f.toFloat, 0.75f.toFloat, 1.0f.toFloat))));\n assert(rescaleToUnit((List[Float](2.0f.toFloat, 1.0f.toFloat, 5.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat))).equals((List[Float](0.25f.toFloat, 0.0f.toFloat, 1.0f.toFloat, 0.5f.toFloat, 0.75f.toFloat))));\n assert(rescaleToUnit((List[Float](12.0f.toFloat, 11.0f.toFloat, 15.0f.toFloat, 13.0f.toFloat, 14.0f.toFloat))).equals((List[Float](0.25f.toFloat, 0.0f.toFloat, 1.0f.toFloat, 0.5f.toFloat, 0.75f.toFloat))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a positive integer n, return the product of the odd digits.\n // Return 0 if all digits are even.\n // For example:\n // >>> digits((1l))\n // (1l)\n // >>> digits((4l))\n // (0l)\n // >>> digits((235l))\n // (15l)\n def digits(n : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(digits((5l)) == (5l));\n assert(digits((54l)) == (5l));\n assert(digits((120l)) == (1l));\n assert(digits((5014l)) == (5l));\n assert(digits((98765l)) == (315l));\n assert(digits((5576543l)) == (2625l));\n assert(digits((2468l)) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You will be given the name of a class (a string) and a list of extensions.\n // The extensions are to be used to load additional classes to the class. The\n // strength of the extension is as follows: Let CAP be the number of the uppercase\n // letters in the extension's name, and let SM be the number of lowercase letters \n // in the extension's name, the strength is given by the fraction CAP - SM. \n // You should find the strongest extension and return a string in this \n // format: ClassName.StrongestExtensionName.\n // If there are two or more extensions with the same strength, you should\n // choose the one that comes first in the list.\n // For example, if you are given \"Slices\" as the class and a list of the\n // extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n // return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n // (its strength is -1).\n // Example:\n // >>> StrongestExtension((\"my_class\"), (List[String](\"AA\", \"Be\", \"CC\")))\n // (\"my_class.AA\")\n def StrongestExtension(class_name : String, extensions : List[String]) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(StrongestExtension((\"Watashi\"), (List[String](\"tEN\", \"niNE\", \"eIGHt8OKe\"))).equals((\"Watashi.eIGHt8OKe\")));\n assert(StrongestExtension((\"Boku123\"), (List[String](\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"))).equals((\"Boku123.YEs.WeCaNe\")));\n assert(StrongestExtension((\"__YESIMHERE\"), (List[String](\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"))).equals((\"__YESIMHERE.NuLl__\")));\n assert(StrongestExtension((\"K\"), (List[String](\"Ta\", \"TAR\", \"t234An\", \"cosSo\"))).equals((\"K.TAR\")));\n assert(StrongestExtension((\"__HAHA\"), (List[String](\"Tab\", \"123\", \"781345\", \"-_-\"))).equals((\"__HAHA.123\")));\n assert(StrongestExtension((\"YameRore\"), (List[String](\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"))).equals((\"YameRore.okIWILL123\")));\n assert(StrongestExtension((\"finNNalLLly\"), (List[String](\"Die\", \"NowW\", \"Wow\", \"WoW\"))).equals((\"finNNalLLly.WoW\")));\n assert(StrongestExtension((\"_\"), (List[String](\"Bb\", \"91245\"))).equals((\"_.Bb\")));\n assert(StrongestExtension((\"Sp\"), (List[String](\"671235\", \"Bb\"))).equals((\"Sp.671235\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a string representing a space separated lowercase letters, return a map\n // of the letter with the most repetition and containing the corresponding count.\n // If several letters have the same occurrence, return all of them.\n // Example:\n // >>> histogram((\"a b c\"))\n // (Map[String,Long](\"a\" -> 1l, \"b\" -> 1l, \"c\" -> 1l))\n // >>> histogram((\"a b b a\"))\n // (Map[String,Long](\"a\" -> 2l, \"b\" -> 2l))\n // >>> histogram((\"a b c a b\"))\n // (Map[String,Long](\"a\" -> 2l, \"b\" -> 2l))\n // >>> histogram((\"b b b b a\"))\n // (Map[String,Long](\"b\" -> 4l))\n // >>> histogram((\"\"))\n // (Map[String,Long]())\n def histogram(test : String) : Map[String,Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(histogram((\"a b b a\")).equals((Map[String,Long](\"a\" -> 2l, \"b\" -> 2l))));\n assert(histogram((\"a b c a b\")).equals((Map[String,Long](\"a\" -> 2l, \"b\" -> 2l))));\n assert(histogram((\"a b c d g\")).equals((Map[String,Long](\"a\" -> 1l, \"b\" -> 1l, \"c\" -> 1l, \"d\" -> 1l, \"g\" -> 1l))));\n assert(histogram((\"r t g\")).equals((Map[String,Long](\"r\" -> 1l, \"t\" -> 1l, \"g\" -> 1l))));\n assert(histogram((\"b b b b a\")).equals((Map[String,Long](\"b\" -> 4l))));\n assert(histogram((\"r t g\")).equals((Map[String,Long](\"r\" -> 1l, \"t\" -> 1l, \"g\" -> 1l))));\n assert(histogram((\"\")).equals((Map[String,Long]())));\n assert(histogram((\"a\")).equals((Map[String,Long](\"a\" -> 1l))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // pairs_sum_to_zero takes a list of integers as an input.\n // it returns true if there are two distinct elements in the list that\n // sum to zero, and false otherwise.\n // >>> pairsSumToZero((List[Long](1l.toLong, 3l.toLong, 5l.toLong, 0l.toLong)))\n // (false)\n // >>> pairsSumToZero((List[Long](1l.toLong, 3l.toLong, -2l.toLong, 1l.toLong)))\n // (false)\n // >>> pairsSumToZero((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 7l.toLong)))\n // (false)\n // >>> pairsSumToZero((List[Long](2l.toLong, 4l.toLong, -5l.toLong, 3l.toLong, 5l.toLong, 7l.toLong)))\n // (true)\n // >>> pairsSumToZero((List[Long](1l.toLong)))\n // (false)\n def pairsSumToZero(l : List[Long]) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(pairsSumToZero((List[Long](1l.toLong, 3l.toLong, 5l.toLong, 0l.toLong))) == (false));\n assert(pairsSumToZero((List[Long](1l.toLong, 3l.toLong, -2l.toLong, 1l.toLong))) == (false));\n assert(pairsSumToZero((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 7l.toLong))) == (false));\n assert(pairsSumToZero((List[Long](2l.toLong, 4l.toLong, -5l.toLong, 3l.toLong, 5l.toLong, 7l.toLong))) == (true));\n assert(pairsSumToZero((List[Long](1l.toLong))) == (false));\n assert(pairsSumToZero((List[Long](-3l.toLong, 9l.toLong, -1l.toLong, 3l.toLong, 2l.toLong, 30l.toLong))) == (true));\n assert(pairsSumToZero((List[Long](-3l.toLong, 9l.toLong, -1l.toLong, 3l.toLong, 2l.toLong, 31l.toLong))) == (true));\n assert(pairsSumToZero((List[Long](-3l.toLong, 9l.toLong, -1l.toLong, 4l.toLong, 2l.toLong, 30l.toLong))) == (false));\n assert(pairsSumToZero((List[Long](-3l.toLong, 9l.toLong, -1l.toLong, 4l.toLong, 2l.toLong, 31l.toLong))) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that accepts two lists of strings and returns the list that has \n // total number of chars in the all strings of the list less than the other list.\n // if the two lists have the same number of chars, return the first list.\n // Examples\n // >>> totalMatch((List[String]()), (List[String]()))\n // (List[String]())\n // >>> totalMatch((List[String](\"hi\", \"admin\")), (List[String](\"hI\", \"Hi\")))\n // (List[String](\"hI\", \"Hi\"))\n // >>> totalMatch((List[String](\"hi\", \"admin\")), (List[String](\"hi\", \"hi\", \"admin\", \"project\")))\n // (List[String](\"hi\", \"admin\"))\n // >>> totalMatch((List[String](\"hi\", \"admin\")), (List[String](\"hI\", \"hi\", \"hi\")))\n // (List[String](\"hI\", \"hi\", \"hi\"))\n // >>> totalMatch((List[String](\"4\")), (List[String](\"1\", \"2\", \"3\", \"4\", \"5\")))\n // (List[String](\"4\"))\n def totalMatch(lst1 : List[String], lst2 : List[String]) : List[String] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(totalMatch((List[String]()), (List[String]())).equals((List[String]())));\n assert(totalMatch((List[String](\"hi\", \"admin\")), (List[String](\"hi\", \"hi\"))).equals((List[String](\"hi\", \"hi\"))));\n assert(totalMatch((List[String](\"hi\", \"admin\")), (List[String](\"hi\", \"hi\", \"admin\", \"project\"))).equals((List[String](\"hi\", \"admin\"))));\n assert(totalMatch((List[String](\"4\")), (List[String](\"1\", \"2\", \"3\", \"4\", \"5\"))).equals((List[String](\"4\"))));\n assert(totalMatch((List[String](\"hi\", \"admin\")), (List[String](\"hI\", \"Hi\"))).equals((List[String](\"hI\", \"Hi\"))));\n assert(totalMatch((List[String](\"hi\", \"admin\")), (List[String](\"hI\", \"hi\", \"hi\"))).equals((List[String](\"hI\", \"hi\", \"hi\"))));\n assert(totalMatch((List[String](\"hi\", \"admin\")), (List[String](\"hI\", \"hi\", \"hii\"))).equals((List[String](\"hi\", \"admin\"))));\n assert(totalMatch((List[String]()), (List[String](\"this\"))).equals((List[String]())));\n assert(totalMatch((List[String](\"this\")), (List[String]())).equals((List[String]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Circular shift the digits of the integer x, shift the digits right by shift\n // and return the result as a string.\n // If shift > number of digits, return digits reversed.\n // >>> circularShift((12l), (1l))\n // (\"21\")\n // >>> circularShift((12l), (2l))\n // (\"12\")\n def circularShift(x : Long, shift : Long) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(circularShift((100l), (2l)).equals((\"001\")));\n assert(circularShift((12l), (2l)).equals((\"12\")));\n assert(circularShift((97l), (8l)).equals((\"79\")));\n assert(circularShift((12l), (1l)).equals((\"21\")));\n assert(circularShift((11l), (101l)).equals((\"11\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return true is list elements are monotonically increasing or decreasing.\n // >>> monotonic((List[Long](1l.toLong, 2l.toLong, 4l.toLong, 20l.toLong)))\n // (true)\n // >>> monotonic((List[Long](1l.toLong, 20l.toLong, 4l.toLong, 10l.toLong)))\n // (false)\n // >>> monotonic((List[Long](4l.toLong, 1l.toLong, 0l.toLong, -10l.toLong)))\n // (true)\n def monotonic(l : List[Long]) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(monotonic((List[Long](1l.toLong, 2l.toLong, 4l.toLong, 10l.toLong))) == (true));\n assert(monotonic((List[Long](1l.toLong, 2l.toLong, 4l.toLong, 20l.toLong))) == (true));\n assert(monotonic((List[Long](1l.toLong, 20l.toLong, 4l.toLong, 10l.toLong))) == (false));\n assert(monotonic((List[Long](4l.toLong, 1l.toLong, 0l.toLong, -10l.toLong))) == (true));\n assert(monotonic((List[Long](4l.toLong, 1l.toLong, 1l.toLong, 0l.toLong))) == (true));\n assert(monotonic((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 2l.toLong, 5l.toLong, 60l.toLong))) == (false));\n assert(monotonic((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 60l.toLong))) == (true));\n assert(monotonic((List[Long](9l.toLong, 9l.toLong, 9l.toLong, 9l.toLong))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n // Example\n // >>> isEqualToSumEven((4l))\n // (false)\n // >>> isEqualToSumEven((6l))\n // (false)\n // >>> isEqualToSumEven((8l))\n // (true)\n def isEqualToSumEven(n : Long) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(isEqualToSumEven((4l)) == (false));\n assert(isEqualToSumEven((6l)) == (false));\n assert(isEqualToSumEven((8l)) == (true));\n assert(isEqualToSumEven((10l)) == (true));\n assert(isEqualToSumEven((11l)) == (false));\n assert(isEqualToSumEven((12l)) == (true));\n assert(isEqualToSumEven((13l)) == (false));\n assert(isEqualToSumEven((16l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Input to this function is a string representing musical notes in a special ASCII format.\n // Your task is to parse this string and return list of integers corresponding to how many beats does each\n // not last.\n // Here is a legend:\n // 'o' - whole note, lasts four beats\n // 'o|' - half note, lasts two beats\n // '.|' - quater note, lasts one beat\n // >>> parseMusic((\"o o| .| o| o| .| .| .| .| o o\"))\n // (List[Long](4l.toLong, 2l.toLong, 1l.toLong, 2l.toLong, 2l.toLong, 1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong, 4l.toLong, 4l.toLong))\n def parseMusic(music_string : String) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(parseMusic((\"\")).equals((List[Long]())));\n assert(parseMusic((\"o o o o\")).equals((List[Long](4l.toLong, 4l.toLong, 4l.toLong, 4l.toLong))));\n assert(parseMusic((\".| .| .| .|\")).equals((List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))));\n assert(parseMusic((\"o| o| .| .| o o o o\")).equals((List[Long](2l.toLong, 2l.toLong, 1l.toLong, 1l.toLong, 4l.toLong, 4l.toLong, 4l.toLong, 4l.toLong))));\n assert(parseMusic((\"o| .| o| .| o o| o o|\")).equals((List[Long](2l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 4l.toLong, 2l.toLong, 4l.toLong, 2l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // \"\n // This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n // multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n // change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n // Examples:\n // >>> lst\n // List[Long](1l.toLong, 2l.toLong, 3l.toLong)\n // >>> lst\n // List[Long]()\n // >>> lst\n // List[Long](-1l.toLong, -5l.toLong, 2l.toLong, -1l.toLong, -5l.toLong)\n def sumSquares(lst : List[Long]) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(sumSquares((List[Long](1l.toLong, 2l.toLong, 3l.toLong))) == (6l));\n assert(sumSquares((List[Long](1l.toLong, 4l.toLong, 9l.toLong))) == (14l));\n assert(sumSquares((List[Long]())) == (0l));\n assert(sumSquares((List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))) == (9l));\n assert(sumSquares((List[Long](-1l.toLong, -1l.toLong, -1l.toLong, -1l.toLong, -1l.toLong, -1l.toLong, -1l.toLong, -1l.toLong, -1l.toLong))) == (-3l));\n assert(sumSquares((List[Long](0l.toLong))) == (0l));\n assert(sumSquares((List[Long](-1l.toLong, -5l.toLong, 2l.toLong, -1l.toLong, -5l.toLong))) == (-126l));\n assert(sumSquares((List[Long](-56l.toLong, -99l.toLong, 1l.toLong, 0l.toLong, -2l.toLong))) == (3030l));\n assert(sumSquares((List[Long](-1l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, -1l.toLong))) == (0l));\n assert(sumSquares((List[Long](-16l.toLong, -9l.toLong, -2l.toLong, 36l.toLong, 36l.toLong, 26l.toLong, -20l.toLong, 25l.toLong, -40l.toLong, 20l.toLong, -4l.toLong, 12l.toLong, -26l.toLong, 35l.toLong, 37l.toLong))) == (-14196l));\n assert(sumSquares((List[Long](-1l.toLong, -3l.toLong, 17l.toLong, -1l.toLong, -15l.toLong, 13l.toLong, -1l.toLong, 14l.toLong, -14l.toLong, -12l.toLong, -5l.toLong, 14l.toLong, -14l.toLong, 6l.toLong, 13l.toLong, 11l.toLong, 16l.toLong, 16l.toLong, 4l.toLong, 10l.toLong))) == (-1448l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // triples_sum_to_zero takes a list of integers as an input.\n // it returns true if there are three distinct elements in the list that\n // sum to zero, and false otherwise.\n // >>> triplesSumToZero((List[Long](1l.toLong, 3l.toLong, 5l.toLong, 0l.toLong)))\n // (false)\n // >>> triplesSumToZero((List[Long](1l.toLong, 3l.toLong, -2l.toLong, 1l.toLong)))\n // (true)\n // >>> triplesSumToZero((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 7l.toLong)))\n // (false)\n // >>> triplesSumToZero((List[Long](2l.toLong, 4l.toLong, -5l.toLong, 3l.toLong, 9l.toLong, 7l.toLong)))\n // (true)\n // >>> triplesSumToZero((List[Long](1l.toLong)))\n // (false)\n def triplesSumToZero(l : List[Long]) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(triplesSumToZero((List[Long](1l.toLong, 3l.toLong, 5l.toLong, 0l.toLong))) == (false));\n assert(triplesSumToZero((List[Long](1l.toLong, 3l.toLong, 5l.toLong, -1l.toLong))) == (false));\n assert(triplesSumToZero((List[Long](1l.toLong, 3l.toLong, -2l.toLong, 1l.toLong))) == (true));\n assert(triplesSumToZero((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 7l.toLong))) == (false));\n assert(triplesSumToZero((List[Long](1l.toLong, 2l.toLong, 5l.toLong, 7l.toLong))) == (false));\n assert(triplesSumToZero((List[Long](2l.toLong, 4l.toLong, -5l.toLong, 3l.toLong, 9l.toLong, 7l.toLong))) == (true));\n assert(triplesSumToZero((List[Long](1l.toLong))) == (false));\n assert(triplesSumToZero((List[Long](1l.toLong, 3l.toLong, 5l.toLong, -100l.toLong))) == (false));\n assert(triplesSumToZero((List[Long](100l.toLong, 3l.toLong, 5l.toLong, -100l.toLong))) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // brackets is a string of \"<\" and \">\".\n // return true if every opening bracket has a corresponding closing bracket.\n // >>> correctBracketing((\"<\"))\n // (false)\n // >>> correctBracketing((\"<>\"))\n // (true)\n // >>> correctBracketing((\"<<><>>\"))\n // (true)\n // >>> correctBracketing((\"><<>\"))\n // (false)\n def correctBracketing(brackets : String) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(correctBracketing((\"<>\")) == (true));\n assert(correctBracketing((\"<<><>>\")) == (true));\n assert(correctBracketing((\"<><><<><>><>\")) == (true));\n assert(correctBracketing((\"<><><<<><><>><>><<><><<>>>\")) == (true));\n assert(correctBracketing((\"<<<><>>>>\")) == (false));\n assert(correctBracketing((\"><<>\")) == (false));\n assert(correctBracketing((\"<\")) == (false));\n assert(correctBracketing((\"<<<<\")) == (false));\n assert(correctBracketing((\">\")) == (false));\n assert(correctBracketing((\"<<>\")) == (false));\n assert(correctBracketing((\"<><><<><>><>><<>\")) == (false));\n assert(correctBracketing((\"<><><<><>><>>><>\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that takes a list of numbers as input and returns \n // the number of elements in the list that are greater than 10 and both \n // first and last digits of a number are odd (1, 3, 5, 7, 9).\n // For example:\n // >>> specialFilter((List[Long](15l.toLong, -73l.toLong, 14l.toLong, -15l.toLong)))\n // (1l)\n // >>> specialFilter((List[Long](33l.toLong, -2l.toLong, -3l.toLong, 45l.toLong, 21l.toLong, 109l.toLong)))\n // (2l)\n def specialFilter(nums : List[Long]) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(specialFilter((List[Long](5l.toLong, -2l.toLong, 1l.toLong, -5l.toLong))) == (0l));\n assert(specialFilter((List[Long](15l.toLong, -73l.toLong, 14l.toLong, -15l.toLong))) == (1l));\n assert(specialFilter((List[Long](33l.toLong, -2l.toLong, -3l.toLong, 45l.toLong, 21l.toLong, 109l.toLong))) == (2l));\n assert(specialFilter((List[Long](43l.toLong, -12l.toLong, 93l.toLong, 125l.toLong, 121l.toLong, 109l.toLong))) == (4l));\n assert(specialFilter((List[Long](71l.toLong, -2l.toLong, -33l.toLong, 75l.toLong, 21l.toLong, 19l.toLong))) == (3l));\n assert(specialFilter((List[Long](1l.toLong))) == (0l));\n assert(specialFilter((List[Long]())) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a map, return true if all keys are strings in lower \n // case or all keys are strings in upper case, else return false.\n // The function should return false is the given map is empty.\n // Examples:\n // >>> checkDictCase((Map[String,String](\"a\" -> \"apple\", \"b\" -> \"banana\")))\n // (true)\n // >>> checkDictCase((Map[String,String](\"a\" -> \"apple\", \"A\" -> \"banana\", \"B\" -> \"banana\")))\n // (false)\n // >>> checkDictCase((Map[String,String](\"a\" -> \"apple\", 8l -> \"banana\", \"a\" -> \"apple\")))\n // (false)\n // >>> checkDictCase((Map[String,String](\"Name\" -> \"John\", \"Age\" -> \"36\", \"City\" -> \"Houston\")))\n // (false)\n // >>> checkDictCase((Map[String,String](\"STATE\" -> \"NC\", \"ZIP\" -> \"12345\")))\n // (true)\n def checkDictCase(dict : Map[String,String]) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(checkDictCase((Map[String,String](\"p\" -> \"pineapple\", \"b\" -> \"banana\"))) == (true));\n assert(checkDictCase((Map[String,String](\"p\" -> \"pineapple\", \"A\" -> \"banana\", \"B\" -> \"banana\"))) == (false));\n assert(checkDictCase((Map[String,String](\"p\" -> \"pineapple\", \"5\" -> \"banana\", \"a\" -> \"apple\"))) == (false));\n assert(checkDictCase((Map[String,String](\"Name\" -> \"John\", \"Age\" -> \"36\", \"City\" -> \"Houston\"))) == (false));\n assert(checkDictCase((Map[String,String](\"STATE\" -> \"NC\", \"ZIP\" -> \"12345\"))) == (true));\n assert(checkDictCase((Map[String,String](\"fruit\" -> \"Orange\", \"taste\" -> \"Sweet\"))) == (true));\n assert(checkDictCase((Map[String,String]())) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n // should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n // alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n // Examples\n // >>> splitWords((\"Hello world!\"))\n // List[String](\"Hello\", \"world!\")\n // >>> splitWords((\"Hello,world!\"))\n // List[String](\"Hello\", \"world!\")\n // >>> splitWords((\"abcdef\"))\n // 3l\n def splitWords(txt : String) : Either[List[String], Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(splitWords((\"Hello world!\")).equals(List[String](\"Hello\", \"world!\")));\n assert(splitWords((\"Hello,world!\")).equals(List[String](\"Hello\", \"world!\")));\n assert(splitWords((\"Hello world,!\")).equals(List[String](\"Hello\", \"world,!\")));\n assert(splitWords((\"Hello,Hello,world !\")).equals(List[String](\"Hello,Hello,world\", \"!\")));\n assert(splitWords((\"abcdef\")).equals(3l));\n assert(splitWords((\"aaabb\")).equals(2l));\n assert(splitWords((\"aaaBb\")).equals(1l));\n assert(splitWords((\"\")).equals(0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n // fibfib(0) == 0\n // fibfib(1) == 0\n // fibfib(2) == 1\n // fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n // Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n // >>> fibfib((1l))\n // (0l)\n // >>> fibfib((5l))\n // (4l)\n // >>> fibfib((8l))\n // (24l)\n def fibfib(n : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(fibfib((2l)) == (1l));\n assert(fibfib((1l)) == (0l));\n assert(fibfib((5l)) == (4l));\n assert(fibfib((8l)) == (24l));\n assert(fibfib((10l)) == (81l));\n assert(fibfib((12l)) == (274l));\n assert(fibfib((14l)) == (927l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a list of numbers.\n // You need to return the sum of squared numbers in the given list,\n // round each element in the list to the upper int(Ceiling) first.\n // Examples:\n // >>> lst((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat)))\n // (14l)\n // >>> lst((List[Float](1.0f.toFloat, 4.0f.toFloat, 9.0f.toFloat)))\n // (98l)\n // >>> lst((List[Float](1.0f.toFloat, 3.0f.toFloat, 5.0f.toFloat, 7.0f.toFloat)))\n // (84l)\n // >>> lst((List[Float](1.4f.toFloat, 4.2f.toFloat, 0.0f.toFloat)))\n // (29l)\n // >>> lst((List[Float](-2.4f.toFloat, 1.0f.toFloat, 1.0f.toFloat)))\n // (6l)\n def sumSquares(lst : List[Float]) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(sumSquares((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat))) == (14l));\n assert(sumSquares((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat))) == (14l));\n assert(sumSquares((List[Float](1.0f.toFloat, 3.0f.toFloat, 5.0f.toFloat, 7.0f.toFloat))) == (84l));\n assert(sumSquares((List[Float](1.4f.toFloat, 4.2f.toFloat, 0.0f.toFloat))) == (29l));\n assert(sumSquares((List[Float](-2.4f.toFloat, 1.0f.toFloat, 1.0f.toFloat))) == (6l));\n assert(sumSquares((List[Float](100.0f.toFloat, 1.0f.toFloat, 15.0f.toFloat, 2.0f.toFloat))) == (10230l));\n assert(sumSquares((List[Float](10000.0f.toFloat, 10000.0f.toFloat))) == (200000000l));\n assert(sumSquares((List[Float](-1.4f.toFloat, 4.6f.toFloat, 6.3f.toFloat))) == (75l));\n assert(sumSquares((List[Float](-1.4f.toFloat, 17.9f.toFloat, 18.9f.toFloat, 19.9f.toFloat))) == (1086l));\n assert(sumSquares((List[Float](0.0f.toFloat))) == (0l));\n assert(sumSquares((List[Float](-1.0f.toFloat))) == (1l));\n assert(sumSquares((List[Float](-1.0f.toFloat, 1.0f.toFloat, 0.0f.toFloat))) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_85_add", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a non-empty list of integers lst. add the even elements that are at odd indices..\n // Examples:\n // >>> add((List[Long](4l.toLong, 2l.toLong, 6l.toLong, 7l.toLong)))\n // (2l)\n def add(lst : List[Long]) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(add((List[Long](4l.toLong, 88l.toLong))) == (88l));\n assert(add((List[Long](4l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 2l.toLong, 122l.toLong))) == (122l));\n assert(add((List[Long](4l.toLong, 0l.toLong, 6l.toLong, 7l.toLong))) == (0l));\n assert(add((List[Long](4l.toLong, 4l.toLong, 6l.toLong, 8l.toLong))) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return sorted unique elements in a list\n // >>> unique((List[Long](5l.toLong, 3l.toLong, 5l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 9l.toLong, 0l.toLong, 123l.toLong)))\n // (List[Long](0l.toLong, 2l.toLong, 3l.toLong, 5l.toLong, 9l.toLong, 123l.toLong))\n def unique(l : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(unique((List[Long](5l.toLong, 3l.toLong, 5l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 9l.toLong, 0l.toLong, 123l.toLong))).equals((List[Long](0l.toLong, 2l.toLong, 3l.toLong, 5l.toLong, 9l.toLong, 123l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a string text, replace all spaces in it with underscores, \n // and if a string has more than 2 consecutive spaces, \n // then replace all consecutive spaces with - \n // >>> fixSpaces((\" Example\"))\n // (\"Example\")\n // >>> fixSpaces((\" Example 1\"))\n // (\"Example_1\")\n // >>> fixSpaces((\" Example 2\"))\n // (\"_Example_2\")\n // >>> fixSpaces((\" Example 3\"))\n // (\"_Example-3\")\n def fixSpaces(text : String) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(fixSpaces((\"Example\")).equals((\"Example\")));\n assert(fixSpaces((\"Mudasir Hanif \")).equals((\"Mudasir_Hanif_\")));\n assert(fixSpaces((\"Yellow Yellow Dirty Fellow\")).equals((\"Yellow_Yellow__Dirty__Fellow\")));\n assert(fixSpaces((\"Exa mple\")).equals((\"Exa-mple\")));\n assert(fixSpaces((\" Exa 1 2 2 mple\")).equals((\"-Exa_1_2_2_mple\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return 2^n modulo p (be aware of numerics).\n // >>> modp((3l), (5l))\n // (3l)\n // >>> modp((1101l), (101l))\n // (2l)\n // >>> modp((0l), (101l))\n // (1l)\n // >>> modp((3l), (11l))\n // (8l)\n // >>> modp((100l), (101l))\n // (1l)\n def modp(n : Long, p : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(modp((3l), (5l)) == (3l));\n assert(modp((1101l), (101l)) == (2l));\n assert(modp((0l), (101l)) == (1l));\n assert(modp((3l), (11l)) == (8l));\n assert(modp((100l), (101l)) == (1l));\n assert(modp((30l), (5l)) == (4l));\n assert(modp((31l), (5l)) == (3l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You have to write a function which validates a given date string and\n // returns true if the date is valid otherwise false.\n // The date is valid if all of the following rules are satisfied:\n // 1. The date string is not empty.\n // 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n // 3. The months should not be less than 1 or higher than 12.\n // 4. The date should be in the format: mm-dd-yyyy\n // >>> validDate((\"03-11-2000\"))\n // (true)\n // >>> validDate((\"15-01-2012\"))\n // (false)\n // >>> validDate((\"04-0-2040\"))\n // (false)\n // >>> validDate((\"06-04-2020\"))\n // (true)\n // >>> validDate((\"06/04/2020\"))\n // (false)\n def validDate(date : String) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(validDate((\"03-11-2000\")) == (true));\n assert(validDate((\"15-01-2012\")) == (false));\n assert(validDate((\"04-0-2040\")) == (false));\n assert(validDate((\"06-04-2020\")) == (true));\n assert(validDate((\"01-01-2007\")) == (true));\n assert(validDate((\"03-32-2011\")) == (false));\n assert(validDate((\"\")) == (false));\n assert(validDate((\"04-31-3000\")) == (false));\n assert(validDate((\"06-06-2005\")) == (true));\n assert(validDate((\"21-31-2000\")) == (false));\n assert(validDate((\"04-12-2003\")) == (true));\n assert(validDate((\"04122003\")) == (false));\n assert(validDate((\"20030412\")) == (false));\n assert(validDate((\"2003-04\")) == (false));\n assert(validDate((\"2003-04-12\")) == (false));\n assert(validDate((\"04-2003\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that takes a string and returns an ordered version of it.\n // Ordered version of string, is a string where all words (separated by space)\n // are replaced by a new word where all the characters arranged in\n // ascending order based on ascii value.\n // Note: You should keep the order of words and blank spaces in the sentence.\n // For example:\n // >>> antiShuffle((\"Hi\"))\n // (\"Hi\")\n // >>> antiShuffle((\"hello\"))\n // (\"ehllo\")\n // >>> antiShuffle((\"Hello World!!!\"))\n // (\"Hello !!!Wdlor\")\n def antiShuffle(s : String) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(antiShuffle((\"Hi\")).equals((\"Hi\")));\n assert(antiShuffle((\"hello\")).equals((\"ehllo\")));\n assert(antiShuffle((\"number\")).equals((\"bemnru\")));\n assert(antiShuffle((\"abcd\")).equals((\"abcd\")));\n assert(antiShuffle((\"Hello World!!!\")).equals((\"Hello !!!Wdlor\")));\n assert(antiShuffle((\"\")).equals((\"\")));\n assert(antiShuffle((\"Hi. My name is Mister Robot. How are you?\")).equals((\".Hi My aemn is Meirst .Rboot How aer ?ouy\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a list of numbers, return whether or not they are sorted\n // in ascending order. If list has more than 1 duplicate of the same\n // number, return false. Assume no negative numbers and only integers.\n // Examples\n // >>> isSorted((List[Long](5l.toLong)))\n // (true)\n // >>> isSorted((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong)))\n // (true)\n // >>> isSorted((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 4l.toLong, 5l.toLong)))\n // (false)\n // >>> isSorted((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong)))\n // (true)\n // >>> isSorted((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong, 7l.toLong)))\n // (true)\n // >>> isSorted((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 4l.toLong, 5l.toLong, 6l.toLong, 7l.toLong)))\n // (false)\n // >>> isSorted((List[Long](1l.toLong, 2l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 4l.toLong)))\n // (true)\n // >>> isSorted((List[Long](1l.toLong, 2l.toLong, 2l.toLong, 2l.toLong, 3l.toLong, 4l.toLong)))\n // (false)\n def isSorted(lst : List[Long]) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(isSorted((List[Long](5l.toLong))) == (true));\n assert(isSorted((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong))) == (true));\n assert(isSorted((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 4l.toLong, 5l.toLong))) == (false));\n assert(isSorted((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong))) == (true));\n assert(isSorted((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong, 7l.toLong))) == (true));\n assert(isSorted((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 4l.toLong, 5l.toLong, 6l.toLong, 7l.toLong))) == (false));\n assert(isSorted((List[Long]())) == (true));\n assert(isSorted((List[Long](1l.toLong))) == (true));\n assert(isSorted((List[Long](3l.toLong, 2l.toLong, 1l.toLong))) == (false));\n assert(isSorted((List[Long](1l.toLong, 2l.toLong, 2l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))) == (false));\n assert(isSorted((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 3l.toLong, 4l.toLong))) == (false));\n assert(isSorted((List[Long](1l.toLong, 2l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 4l.toLong))) == (true));\n assert(isSorted((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a string s.\n // Your task is to check if the string is hapscala or not.\n // A string is hapscala if its length is at least 3 and every 3 consecutive letters are distinct\n // For example:\n // >>> isHappy((\"a\"))\n // (false)\n // >>> isHappy((\"aa\"))\n // (false)\n // >>> isHappy((\"abcd\"))\n // (true)\n // >>> isHappy((\"aabb\"))\n // (false)\n // >>> isHappy((\"adb\"))\n // (true)\n // >>> isHappy((\"xyy\"))\n // (false)\n def isHappy(s : String) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(isHappy((\"a\")) == (false));\n assert(isHappy((\"aa\")) == (false));\n assert(isHappy((\"abcd\")) == (true));\n assert(isHappy((\"aabb\")) == (false));\n assert(isHappy((\"adb\")) == (true));\n assert(isHappy((\"xyy\")) == (false));\n assert(isHappy((\"iopaxpoi\")) == (true));\n assert(isHappy((\"iopaxioi\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that returns true if the object q will fly, and false otherwise.\n // The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n // Example:\n // >>> willItFly((List[Long](1l.toLong, 2l.toLong)), (5l))\n // (false)\n // # 1+2 is less than the maximum possible weight, but it's unbalanced.\n // >>> willItFly((List[Long](3l.toLong, 2l.toLong, 3l.toLong)), (1l))\n // (false)\n // # it's balanced, but 3+2+3 is more than the maximum possible weight.\n // >>> willItFly((List[Long](3l.toLong, 2l.toLong, 3l.toLong)), (9l))\n // (true)\n // # 3+2+3 is less than the maximum possible weight, and it's balanced.\n // >>> willItFly((List[Long](3l.toLong)), (5l))\n // (true)\n // # 3 is less than the maximum possible weight, and it's balanced.\n def willItFly(q : List[Long], w : Long) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(willItFly((List[Long](3l.toLong, 2l.toLong, 3l.toLong)), (9l)) == (true));\n assert(willItFly((List[Long](1l.toLong, 2l.toLong)), (5l)) == (false));\n assert(willItFly((List[Long](3l.toLong)), (5l)) == (true));\n assert(willItFly((List[Long](3l.toLong, 2l.toLong, 3l.toLong)), (1l)) == (false));\n assert(willItFly((List[Long](1l.toLong, 2l.toLong, 3l.toLong)), (6l)) == (false));\n assert(willItFly((List[Long](5l.toLong)), (5l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a list of non-negative integers, return a coscala of the given list after sorting,\n // you will sort the given list in ascending order if the sum( first index value, last index value) is odd,\n // or sort it in descending order if the sum( first index value, last index value) is even.\n // Note:\n // * don't change the given list.\n // Examples:\n // >>> sortArray((List[Long]()))\n // (List[Long]())\n // >>> sortArray((List[Long](5l.toLong)))\n // (List[Long](5l.toLong))\n // >>> sortArray((List[Long](2l.toLong, 4l.toLong, 3l.toLong, 0l.toLong, 1l.toLong, 5l.toLong)))\n // (List[Long](0l.toLong, 1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong))\n // >>> sortArray((List[Long](2l.toLong, 4l.toLong, 3l.toLong, 0l.toLong, 1l.toLong, 5l.toLong, 6l.toLong)))\n // (List[Long](6l.toLong, 5l.toLong, 4l.toLong, 3l.toLong, 2l.toLong, 1l.toLong, 0l.toLong))\n def sortArray(array : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(sortArray((List[Long]())).equals((List[Long]())));\n assert(sortArray((List[Long](5l.toLong))).equals((List[Long](5l.toLong))));\n assert(sortArray((List[Long](2l.toLong, 4l.toLong, 3l.toLong, 0l.toLong, 1l.toLong, 5l.toLong))).equals((List[Long](0l.toLong, 1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong))));\n assert(sortArray((List[Long](2l.toLong, 4l.toLong, 3l.toLong, 0l.toLong, 1l.toLong, 5l.toLong, 6l.toLong))).equals((List[Long](6l.toLong, 5l.toLong, 4l.toLong, 3l.toLong, 2l.toLong, 1l.toLong, 0l.toLong))));\n assert(sortArray((List[Long](2l.toLong, 1l.toLong))).equals((List[Long](1l.toLong, 2l.toLong))));\n assert(sortArray((List[Long](15l.toLong, 42l.toLong, 87l.toLong, 32l.toLong, 11l.toLong, 0l.toLong))).equals((List[Long](0l.toLong, 11l.toLong, 15l.toLong, 32l.toLong, 42l.toLong, 87l.toLong))));\n assert(sortArray((List[Long](21l.toLong, 14l.toLong, 23l.toLong, 11l.toLong))).equals((List[Long](23l.toLong, 21l.toLong, 14l.toLong, 11l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Implement a function that takes an non-negative integer and returns a list of the first n\n // integers that are prime numbers and less than n.\n // for example:\n // >>> countUpTo((5l))\n // (List[Long](2l.toLong, 3l.toLong))\n // >>> countUpTo((11l))\n // (List[Long](2l.toLong, 3l.toLong, 5l.toLong, 7l.toLong))\n // >>> countUpTo((0l))\n // (List[Long]())\n // >>> countUpTo((20l))\n // (List[Long](2l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 11l.toLong, 13l.toLong, 17l.toLong, 19l.toLong))\n // >>> countUpTo((1l))\n // (List[Long]())\n // >>> countUpTo((18l))\n // (List[Long](2l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 11l.toLong, 13l.toLong, 17l.toLong))\n def countUpTo(n : Long) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(countUpTo((5l)).equals((List[Long](2l.toLong, 3l.toLong))));\n assert(countUpTo((6l)).equals((List[Long](2l.toLong, 3l.toLong, 5l.toLong))));\n assert(countUpTo((7l)).equals((List[Long](2l.toLong, 3l.toLong, 5l.toLong))));\n assert(countUpTo((10l)).equals((List[Long](2l.toLong, 3l.toLong, 5l.toLong, 7l.toLong))));\n assert(countUpTo((0l)).equals((List[Long]())));\n assert(countUpTo((22l)).equals((List[Long](2l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 11l.toLong, 13l.toLong, 17l.toLong, 19l.toLong))));\n assert(countUpTo((1l)).equals((List[Long]())));\n assert(countUpTo((18l)).equals((List[Long](2l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 11l.toLong, 13l.toLong, 17l.toLong))));\n assert(countUpTo((47l)).equals((List[Long](2l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 11l.toLong, 13l.toLong, 17l.toLong, 19l.toLong, 23l.toLong, 29l.toLong, 31l.toLong, 37l.toLong, 41l.toLong, 43l.toLong))));\n assert(countUpTo((101l)).equals((List[Long](2l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 11l.toLong, 13l.toLong, 17l.toLong, 19l.toLong, 23l.toLong, 29l.toLong, 31l.toLong, 37l.toLong, 41l.toLong, 43l.toLong, 47l.toLong, 53l.toLong, 59l.toLong, 61l.toLong, 67l.toLong, 71l.toLong, 73l.toLong, 79l.toLong, 83l.toLong, 89l.toLong, 97l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Out of list of strings, return the longest one. Return the first one in case of multiple\n // strings of the same length. Return None in case the input list is empty.\n // >>> longest((List[String]()))\n // None\n // >>> longest((List[String](\"a\", \"b\", \"c\")))\n // \"a\"\n // >>> longest((List[String](\"a\", \"bb\", \"ccc\")))\n // \"ccc\"\n def longest(strings : List[String]) : Option[String] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(longest((List[String]())).equals(None));\n assert(longest((List[String](\"x\", \"y\", \"z\"))).equals(\"x\"));\n assert(longest((List[String](\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"))).equals(\"zzzz\"));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a list of integers, sort the integers that are between 1 and 9 inclusive,\n // reverse the resulting list, and then replace each digit by its corresponding name from\n // \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n // For example:\n // >>> byLength((List[Long](2l.toLong, 1l.toLong, 1l.toLong, 4l.toLong, 5l.toLong, 8l.toLong, 2l.toLong, 3l.toLong)))\n // (List[String](\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"))\n // If the list is empty, return an empty list:\n // >>> byLength((List[Long]()))\n // (List[String]())\n // If the list has any strange number ignore it:\n // >>> byLength((List[Long](1l.toLong, -1l.toLong, 55l.toLong)))\n // (List[String](\"One\"))\n def byLength(arr : List[Long]) : List[String] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(byLength((List[Long](2l.toLong, 1l.toLong, 1l.toLong, 4l.toLong, 5l.toLong, 8l.toLong, 2l.toLong, 3l.toLong))).equals((List[String](\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"))));\n assert(byLength((List[Long]())).equals((List[String]())));\n assert(byLength((List[Long](1l.toLong, -1l.toLong, 55l.toLong))).equals((List[String](\"One\"))));\n assert(byLength((List[Long](1l.toLong, -1l.toLong, 3l.toLong, 2l.toLong))).equals((List[String](\"Three\", \"Two\", \"One\"))));\n assert(byLength((List[Long](9l.toLong, 4l.toLong, 8l.toLong))).equals((List[String](\"Nine\", \"Eight\", \"Four\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_106_f", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Implement the function f that takes n as a parameter,\n // 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\n // or the sum of numbers from 1 to i otherwise.\n // i starts from 1.\n // the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n // Example:\n // >>> f((5l))\n // (List[Long](1l.toLong, 2l.toLong, 6l.toLong, 24l.toLong, 15l.toLong))\n def f(n : Long) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(f((5l)).equals((List[Long](1l.toLong, 2l.toLong, 6l.toLong, 24l.toLong, 15l.toLong))));\n assert(f((7l)).equals((List[Long](1l.toLong, 2l.toLong, 6l.toLong, 24l.toLong, 15l.toLong, 720l.toLong, 28l.toLong))));\n assert(f((1l)).equals((List[Long](1l.toLong))));\n assert(f((3l)).equals((List[Long](1l.toLong, 2l.toLong, 6l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n // >>> fizzBuzz((50l))\n // (0l)\n // >>> fizzBuzz((78l))\n // (2l)\n // >>> fizzBuzz((79l))\n // (3l)\n def fizzBuzz(n : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(fizzBuzz((50l)) == (0l));\n assert(fizzBuzz((78l)) == (2l));\n assert(fizzBuzz((79l)) == (3l));\n assert(fizzBuzz((100l)) == (3l));\n assert(fizzBuzz((200l)) == (6l));\n assert(fizzBuzz((4000l)) == (192l));\n assert(fizzBuzz((10000l)) == (639l));\n assert(fizzBuzz((100000l)) == (8026l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a positive floating point number, it can be decomposed into\n // and integer part (largest integer smaller than given number) and decimals\n // (leftover part always smaller than 1).\n // Return the decimal part of the number.\n // >>> truncateNumber((3.5f))\n // (0.5f)\n def truncateNumber(number : Float) : Float = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(truncateNumber((3.5f)) == (0.5f));\n assert(truncateNumber((1.25f)) == (0.25f));\n assert(truncateNumber((123.0f)) == (0.0f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n // Empty sum should be equal to 0 and empty product should be equal to 1.\n // >>> sumProduct((List[Long]()))\n // ((0l, 1l))\n // >>> sumProduct((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong)))\n // ((10l, 24l))\n def sumProduct(numbers : List[Long]) : Tuple2[Long, Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(sumProduct((List[Long]())).equals(((0l, 1l))));\n assert(sumProduct((List[Long](1l.toLong, 1l.toLong, 1l.toLong))).equals(((3l, 1l))));\n assert(sumProduct((List[Long](100l.toLong, 0l.toLong))).equals(((100l, 0l))));\n assert(sumProduct((List[Long](3l.toLong, 5l.toLong, 7l.toLong))).equals(((15l, 105l))));\n assert(sumProduct((List[Long](10l.toLong))).equals(((10l, 10l))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a 2 dimensional data, as a nested lists,\n // which is similar to matrix, however, unlike matrices,\n // each row may contain a different number of columns.\n // Given lst, and integer x, find integers x in the list,\n // and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n // each tuple is a coordinate - (row, columns), starting with 0.\n // Sort coordinates initially by rows in ascending order.\n // Also, sort coordinates of the row by columns in descending order.\n // Examples:\n // >>> getRow((List[List[Long]](List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 1l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 1l.toLong))), (1l))\n // (List[Tuple2[Long, Long]]((0l, 0l), (1l, 4l), (1l, 0l), (2l, 5l), (2l, 0l)))\n // >>> getRow((List[List[Long]]()), (1l))\n // (List[Tuple2[Long, Long]]())\n // >>> getRow((List[List[Long]](List[Long](), List[Long](1l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong))), (3l))\n // (List[Tuple2[Long, Long]]((2l, 2l)))\n def getRow(lst : List[List[Long]], x : Long) : List[Tuple2[Long, Long]] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(getRow((List[List[Long]](List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 1l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 1l.toLong))), (1l)).equals((List[Tuple2[Long, Long]]((0l, 0l), (1l, 4l), (1l, 0l), (2l, 5l), (2l, 0l)))));\n assert(getRow((List[List[Long]](List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong))), (2l)).equals((List[Tuple2[Long, Long]]((0l, 1l), (1l, 1l), (2l, 1l), (3l, 1l), (4l, 1l), (5l, 1l)))));\n assert(getRow((List[List[Long]](List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 1l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 1l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 1l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 1l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 1l.toLong))), (1l)).equals((List[Tuple2[Long, Long]]((0l, 0l), (1l, 0l), (2l, 1l), (2l, 0l), (3l, 2l), (3l, 0l), (4l, 3l), (4l, 0l), (5l, 4l), (5l, 0l), (6l, 5l), (6l, 0l)))));\n assert(getRow((List[List[Long]]()), (1l)).equals((List[Tuple2[Long, Long]]())));\n assert(getRow((List[List[Long]](List[Long](1l.toLong))), (2l)).equals((List[Tuple2[Long, Long]]())));\n assert(getRow((List[List[Long]](List[Long](), List[Long](1l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong))), (3l)).equals((List[Tuple2[Long, Long]]((2l, 2l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You're a hungry rabbit, and you already have eaten a certain number of carrots,\n // but now you need to eat more carrots to complete the day's meals.\n // you should return a list of [ total number of eaten carrots after your meals,\n // the number of carrots left after your meals ]\n // if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n // Example:\n // >>> eat((5l), (6l), (10l))\n // (List[Long](11l.toLong, 4l.toLong))\n // >>> eat((4l), (8l), (9l))\n // (List[Long](12l.toLong, 1l.toLong))\n // >>> eat((1l), (10l), (10l))\n // (List[Long](11l.toLong, 0l.toLong))\n // >>> eat((2l), (11l), (5l))\n // (List[Long](7l.toLong, 0l.toLong))\n // Variables:\n // @number : integer\n // the number of carrots that you have eaten.\n // @need : integer\n // the number of carrots that you need to eat.\n // @remaining : integer\n // the number of remaining carrots thet exist in stock\n // Constrain:\n // * 0 <= number <= 1000\n // * 0 <= need <= 1000\n // * 0 <= remaining <= 1000\n // Have fun :)\n def eat(number : Long, need : Long, remaining : Long) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(eat((5l), (6l), (10l)).equals((List[Long](11l.toLong, 4l.toLong))));\n assert(eat((4l), (8l), (9l)).equals((List[Long](12l.toLong, 1l.toLong))));\n assert(eat((1l), (10l), (10l)).equals((List[Long](11l.toLong, 0l.toLong))));\n assert(eat((2l), (11l), (5l)).equals((List[Long](7l.toLong, 0l.toLong))));\n assert(eat((4l), (5l), (7l)).equals((List[Long](9l.toLong, 2l.toLong))));\n assert(eat((4l), (5l), (1l)).equals((List[Long](5l.toLong, 0l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a positive integer N, return the total sum of its digits in binary.\n // Example\n // >>> solve((1000l))\n // (\"1\")\n // >>> solve((150l))\n // (\"110\")\n // >>> solve((147l))\n // (\"1100\")\n // Variables:\n // @N integer\n // Constraints: 0 \u2264 N \u2264 10000.\n // Output:\n // a string of binary number\n def solve(N : Long) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(solve((1000l)).equals((\"1\")));\n assert(solve((150l)).equals((\"110\")));\n assert(solve((147l)).equals((\"1100\")));\n assert(solve((333l)).equals((\"1001\")));\n assert(solve((963l)).equals((\"10010\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a list of integers.\n // You need to find the largest prime value and return the sum of its digits.\n // Examples:\n // >>> skjkasdkd((List[Long](0l.toLong, 3l.toLong, 2l.toLong, 1l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 4l.toLong, 5l.toLong, 5l.toLong, 5l.toLong, 2l.toLong, 181l.toLong, 32l.toLong, 4l.toLong, 32l.toLong, 3l.toLong, 2l.toLong, 32l.toLong, 324l.toLong, 4l.toLong, 3l.toLong)))\n // (10l)\n // >>> skjkasdkd((List[Long](1l.toLong, 0l.toLong, 1l.toLong, 8l.toLong, 2l.toLong, 4597l.toLong, 2l.toLong, 1l.toLong, 3l.toLong, 40l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 2l.toLong, 4l.toLong, 2l.toLong, 5l.toLong, 1l.toLong)))\n // (25l)\n // >>> skjkasdkd((List[Long](1l.toLong, 3l.toLong, 1l.toLong, 32l.toLong, 5107l.toLong, 34l.toLong, 83278l.toLong, 109l.toLong, 163l.toLong, 23l.toLong, 2323l.toLong, 32l.toLong, 30l.toLong, 1l.toLong, 9l.toLong, 3l.toLong)))\n // (13l)\n // >>> skjkasdkd((List[Long](0l.toLong, 724l.toLong, 32l.toLong, 71l.toLong, 99l.toLong, 32l.toLong, 6l.toLong, 0l.toLong, 5l.toLong, 91l.toLong, 83l.toLong, 0l.toLong, 5l.toLong, 6l.toLong)))\n // (11l)\n // >>> skjkasdkd((List[Long](0l.toLong, 81l.toLong, 12l.toLong, 3l.toLong, 1l.toLong, 21l.toLong)))\n // (3l)\n // >>> skjkasdkd((List[Long](0l.toLong, 8l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 7l.toLong)))\n // (7l)\n def skjkasdkd(lst : List[Long]) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(skjkasdkd((List[Long](0l.toLong, 3l.toLong, 2l.toLong, 1l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 4l.toLong, 5l.toLong, 5l.toLong, 5l.toLong, 2l.toLong, 181l.toLong, 32l.toLong, 4l.toLong, 32l.toLong, 3l.toLong, 2l.toLong, 32l.toLong, 324l.toLong, 4l.toLong, 3l.toLong))) == (10l));\n assert(skjkasdkd((List[Long](1l.toLong, 0l.toLong, 1l.toLong, 8l.toLong, 2l.toLong, 4597l.toLong, 2l.toLong, 1l.toLong, 3l.toLong, 40l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 2l.toLong, 4l.toLong, 2l.toLong, 5l.toLong, 1l.toLong))) == (25l));\n assert(skjkasdkd((List[Long](1l.toLong, 3l.toLong, 1l.toLong, 32l.toLong, 5107l.toLong, 34l.toLong, 83278l.toLong, 109l.toLong, 163l.toLong, 23l.toLong, 2323l.toLong, 32l.toLong, 30l.toLong, 1l.toLong, 9l.toLong, 3l.toLong))) == (13l));\n assert(skjkasdkd((List[Long](0l.toLong, 724l.toLong, 32l.toLong, 71l.toLong, 99l.toLong, 32l.toLong, 6l.toLong, 0l.toLong, 5l.toLong, 91l.toLong, 83l.toLong, 0l.toLong, 5l.toLong, 6l.toLong))) == (11l));\n assert(skjkasdkd((List[Long](0l.toLong, 81l.toLong, 12l.toLong, 3l.toLong, 1l.toLong, 21l.toLong))) == (3l));\n assert(skjkasdkd((List[Long](0l.toLong, 8l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 7l.toLong))) == (7l));\n assert(skjkasdkd((List[Long](8191l.toLong))) == (19l));\n assert(skjkasdkd((List[Long](8191l.toLong, 123456l.toLong, 127l.toLong, 7l.toLong))) == (19l));\n assert(skjkasdkd((List[Long](127l.toLong, 97l.toLong, 8192l.toLong))) == (10l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a list arr of integers, find the minimum number of elements that\n // need to be changed to make the list palindromic. A palindromic list is a list that\n // is read the same backwards and forwards. In one change, you can change one element to any other element.\n // For example:\n // >>> smallestChange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 5l.toLong, 4l.toLong, 7l.toLong, 9l.toLong, 6l.toLong)))\n // (4l)\n // >>> smallestChange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 3l.toLong, 2l.toLong, 2l.toLong)))\n // (1l)\n // >>> smallestChange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 2l.toLong, 1l.toLong)))\n // (0l)\n def smallestChange(arr : List[Long]) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(smallestChange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 5l.toLong, 4l.toLong, 7l.toLong, 9l.toLong, 6l.toLong))) == (4l));\n assert(smallestChange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 3l.toLong, 2l.toLong, 2l.toLong))) == (1l));\n assert(smallestChange((List[Long](1l.toLong, 4l.toLong, 2l.toLong))) == (1l));\n assert(smallestChange((List[Long](1l.toLong, 4l.toLong, 4l.toLong, 2l.toLong))) == (1l));\n assert(smallestChange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 2l.toLong, 1l.toLong))) == (0l));\n assert(smallestChange((List[Long](3l.toLong, 1l.toLong, 1l.toLong, 3l.toLong))) == (0l));\n assert(smallestChange((List[Long](1l.toLong))) == (0l));\n assert(smallestChange((List[Long](0l.toLong, 1l.toLong))) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // It is the last week of the semester and the teacher has to give the grades\n // to students. The teacher has been making her own algorithm for grading.\n // The only problem is, she has lost the code she used for grading.\n // She has given you a list of GPAs for some students and you have to write \n // a function that can output a list of letter grades using the following table:\n // GPA | Letter grade\n // 4.0 A+\n // > 3.7 A \n // > 3.3 A- \n // > 3.0 B+\n // > 2.7 B \n // > 2.3 B-\n // > 2.0 C+\n // > 1.7 C\n // > 1.3 C-\n // > 1.0 D+ \n // > 0.7 D \n // > 0.0 D-\n // 0.0 E\n // Example:\n // >>> gradeEquation((List[Float](4.0f.toFloat, 3l.toFloat, 1.7f.toFloat, 2l.toFloat, 3.5f.toFloat)))\n // (List[String](\"A+\", \"B\", \"C-\", \"C\", \"A-\"))\n def numericalLetterGrade(grades : List[Float]) : List[String] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(numericalLetterGrade((List[Float](4.0f.toFloat, 3l.toFloat, 1.7f.toFloat, 2l.toFloat, 3.5f.toFloat))).equals((List[String](\"A+\", \"B\", \"C-\", \"C\", \"A-\"))));\n assert(numericalLetterGrade((List[Float](1.2f.toFloat))).equals((List[String](\"D+\"))));\n assert(numericalLetterGrade((List[Float](0.5f.toFloat))).equals((List[String](\"D-\"))));\n assert(numericalLetterGrade((List[Float](0.0f.toFloat))).equals((List[String](\"E\"))));\n assert(numericalLetterGrade((List[Float](1.0f.toFloat, 0.3f.toFloat, 1.5f.toFloat, 2.8f.toFloat, 3.3f.toFloat))).equals((List[String](\"D\", \"D-\", \"C-\", \"B\", \"B+\"))));\n assert(numericalLetterGrade((List[Float](0.0f.toFloat, 0.7f.toFloat))).equals((List[String](\"E\", \"D-\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given the lengths of the three sides of a triangle. Return the area of\n // the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n // Otherwise return -1\n // Three sides make a valid triangle when the sum of any two sides is greater \n // than the third side.\n // Example:\n // >>> triangleArea((3l), (4l), (5l))\n // (6.0f)\n // >>> triangleArea((1l), (2l), (10l))\n // -1l\n def triangleArea(a : Long, b : Long, c : Long) : Float = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(triangleArea((3l), (4l), (5l)) == (6.0f));\n assert(triangleArea((1l), (2l), (10l)) == -1l);\n assert(triangleArea((4l), (8l), (5l)) == (8.18f));\n assert(triangleArea((2l), (2l), (2l)) == (1.73f));\n assert(triangleArea((1l), (2l), (3l)) == -1l);\n assert(triangleArea((10l), (5l), (7l)) == (16.25f));\n assert(triangleArea((2l), (6l), (3l)) == -1l);\n assert(triangleArea((1l), (1l), (1l)) == (0.43f));\n assert(triangleArea((2l), (2l), (10l)) == -1l);\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Check if two words have the same characters.\n // >>> sameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddeddabc\"))\n // (true)\n // >>> sameChars((\"abcd\"), (\"dddddddabc\"))\n // (true)\n // >>> sameChars((\"dddddddabc\"), (\"abcd\"))\n // (true)\n // >>> sameChars((\"eabcd\"), (\"dddddddabc\"))\n // (false)\n // >>> sameChars((\"abcd\"), (\"dddddddabce\"))\n // (false)\n // >>> sameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddddabc\"))\n // (false)\n def sameChars(s0 : String, s1 : String) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(sameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddeddabc\")) == (true));\n assert(sameChars((\"abcd\"), (\"dddddddabc\")) == (true));\n assert(sameChars((\"dddddddabc\"), (\"abcd\")) == (true));\n assert(sameChars((\"eabcd\"), (\"dddddddabc\")) == (false));\n assert(sameChars((\"abcd\"), (\"dddddddabcf\")) == (false));\n assert(sameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddddabc\")) == (false));\n assert(sameChars((\"aabb\"), (\"aaccc\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a list of integers nums, find the minimum sum of any non-empty sub-list\n // of nums.\n // Example\n // >>> minSubArraySum((List[Long](2l.toLong, 3l.toLong, 4l.toLong, 1l.toLong, 2l.toLong, 4l.toLong)))\n // (1l)\n // >>> minSubArraySum((List[Long](-1l.toLong, -2l.toLong, -3l.toLong)))\n // (-6l)\n def minSubArraySum(nums : List[Long]) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(minSubArraySum((List[Long](2l.toLong, 3l.toLong, 4l.toLong, 1l.toLong, 2l.toLong, 4l.toLong))) == (1l));\n assert(minSubArraySum((List[Long](-1l.toLong, -2l.toLong, -3l.toLong))) == (-6l));\n assert(minSubArraySum((List[Long](-1l.toLong, -2l.toLong, -3l.toLong, 2l.toLong, -10l.toLong))) == (-14l));\n assert(minSubArraySum((List[Long](-9999999999999999l.toLong))) == (-9999999999999999l));\n assert(minSubArraySum((List[Long](0l.toLong, 10l.toLong, 20l.toLong, 1000000l.toLong))) == (0l));\n assert(minSubArraySum((List[Long](-1l.toLong, -2l.toLong, -3l.toLong, 10l.toLong, -5l.toLong))) == (-6l));\n assert(minSubArraySum((List[Long](100l.toLong, -1l.toLong, -2l.toLong, -3l.toLong, 10l.toLong, -5l.toLong))) == (-6l));\n assert(minSubArraySum((List[Long](10l.toLong, 11l.toLong, 13l.toLong, 8l.toLong, 3l.toLong, 4l.toLong))) == (3l));\n assert(minSubArraySum((List[Long](100l.toLong, -33l.toLong, 32l.toLong, -1l.toLong, 0l.toLong, -2l.toLong))) == (-33l));\n assert(minSubArraySum((List[Long](-10l.toLong))) == (-10l));\n assert(minSubArraySum((List[Long](7l.toLong))) == (7l));\n assert(minSubArraySum((List[Long](1l.toLong, -1l.toLong))) == (-1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a string s and a natural number n, you have been tasked to implement \n // a function that returns a list of all words from string s that contain exactly \n // n consonants, in order these words appear in the string s.\n // If the string s is empty then the function should return an empty list.\n // Note: you may assume the input string contains only letters and spaces.\n // Examples:\n // >>> selectWords((\"Mary had a little lamb\"), (4l))\n // (List[String](\"little\"))\n // >>> selectWords((\"Mary had a little lamb\"), (3l))\n // (List[String](\"Mary\", \"lamb\"))\n // >>> selectWords((\"simple white space\"), (2l))\n // (List[String]())\n // >>> selectWords((\"Hello world\"), (4l))\n // (List[String](\"world\"))\n // >>> selectWords((\"Uncle sam\"), (3l))\n // (List[String](\"Uncle\"))\n def selectWords(s : String, n : Long) : List[String] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(selectWords((\"Mary had a little lamb\"), (4l)).equals((List[String](\"little\"))));\n assert(selectWords((\"Mary had a little lamb\"), (3l)).equals((List[String](\"Mary\", \"lamb\"))));\n assert(selectWords((\"simple white space\"), (2l)).equals((List[String]())));\n assert(selectWords((\"Hello world\"), (4l)).equals((List[String](\"world\"))));\n assert(selectWords((\"Uncle sam\"), (3l)).equals((List[String](\"Uncle\"))));\n assert(selectWords((\"\"), (4l)).equals((List[String]())));\n assert(selectWords((\"a b c d e f\"), (1l)).equals((List[String](\"b\", \"c\", \"d\", \"f\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return list of all prefixes from shortest to longest of the input string\n // >>> allPrefixes((\"abc\"))\n // (List[String](\"a\", \"ab\", \"abc\"))\n def allPrefixes(string : String) : List[String] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(allPrefixes((\"\")).equals((List[String]())));\n assert(allPrefixes((\"asdfgh\")).equals((List[String](\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"))));\n assert(allPrefixes((\"WWW\")).equals((List[String](\"W\", \"WW\", \"WWW\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function that takes a value (string) representing a number\n // and returns the closest integer to it. If the number is equidistant\n // from two integers, round it away from zero.\n // Examples\n // >>> closestInteger((\"10\"))\n // (10l)\n // >>> closestInteger((\"15.3\"))\n // (15l)\n // Note:\n // Rounding away from zero means that if the given number is equidistant\n // from two integers, the one you should return is the one that is the\n // farthest from zero. For example closest_integer(\"14.5\") should\n // return 15 and closest_integer(\"-14.5\") should return -15.\n def closestInteger(value : String) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(closestInteger((\"10\")) == (10l));\n assert(closestInteger((\"14.5\")) == (15l));\n assert(closestInteger((\"-15.5\")) == (-16l));\n assert(closestInteger((\"15.3\")) == (15l));\n assert(closestInteger((\"0\")) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function which takes a string representing a file's name, and returns\n // 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n // A file's name is considered to be valid if and only if all the following conditions \n // are met:\n // - There should not be more than three digits ('0'-'9') in the file's name.\n // - The file's name contains exactly one dot '.'\n // - The substring before the dot should not be empty, and it starts with a letter from \n // the latin alphapet ('a'-'z' and 'A'-'Z').\n // - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n // Examples:\n // >>> fileNameCheck((\"example.txt\"))\n // (\"Yes\")\n // >>> fileNameCheck((\"1example.dll\"))\n // (\"No\")\n def fileNameCheck(file_name : String) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(fileNameCheck((\"example.txt\")).equals((\"Yes\")));\n assert(fileNameCheck((\"1example.dll\")).equals((\"No\")));\n assert(fileNameCheck((\"s1sdf3.asd\")).equals((\"No\")));\n assert(fileNameCheck((\"K.dll\")).equals((\"Yes\")));\n assert(fileNameCheck((\"MY16FILE3.exe\")).equals((\"Yes\")));\n assert(fileNameCheck((\"His12FILE94.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"_Y.txt\")).equals((\"No\")));\n assert(fileNameCheck((\"?aREYA.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"/this_is_valid.dll\")).equals((\"No\")));\n assert(fileNameCheck((\"this_is_valid.wow\")).equals((\"No\")));\n assert(fileNameCheck((\"this_is_valid.txt\")).equals((\"Yes\")));\n assert(fileNameCheck((\"this_is_valid.txtexe\")).equals((\"No\")));\n assert(fileNameCheck((\"#this2_i4s_5valid.ten\")).equals((\"No\")));\n assert(fileNameCheck((\"@this1_is6_valid.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"this_is_12valid.6exe4.txt\")).equals((\"No\")));\n assert(fileNameCheck((\"all.exe.txt\")).equals((\"No\")));\n assert(fileNameCheck((\"I563_No.exe\")).equals((\"Yes\")));\n assert(fileNameCheck((\"Is3youfault.txt\")).equals((\"Yes\")));\n assert(fileNameCheck((\"no_one#knows.dll\")).equals((\"Yes\")));\n assert(fileNameCheck((\"1I563_Yes3.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"I563_Yes3.txtt\")).equals((\"No\")));\n assert(fileNameCheck((\"final..txt\")).equals((\"No\")));\n assert(fileNameCheck((\"final132\")).equals((\"No\")));\n assert(fileNameCheck((\"_f4indsartal132.\")).equals((\"No\")));\n assert(fileNameCheck((\".txt\")).equals((\"No\")));\n assert(fileNameCheck((\"s.\")).equals((\"No\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given two intervals,\n // where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n // The given intervals are closed which means that the interval (start, end)\n // includes both start and end.\n // For each given interval, it is assumed that its start is less or equal its end.\n // Your task is to determine whether the length of intersection of these two \n // intervals is a prime number.\n // Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n // which its length is 1, which not a prime number.\n // If the length of the intersection is a prime number, return \"YES\",\n // otherwise, return \"NO\".\n // If the two intervals don't intersect, return \"NO\".\n // [input/output] samples:\n // >>> intersection(((1l, 2l)), ((2l, 3l)))\n // (\"NO\")\n // >>> intersection(((-1l, 1l)), ((0l, 4l)))\n // (\"NO\")\n // >>> intersection(((-3l, -1l)), ((-5l, 5l)))\n // (\"YES\")\n def intersection(interval1 : Tuple2[Long, Long], interval2 : Tuple2[Long, Long]) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(intersection(((1l, 2l)), ((2l, 3l))).equals((\"NO\")));\n assert(intersection(((-1l, 1l)), ((0l, 4l))).equals((\"NO\")));\n assert(intersection(((-3l, -1l)), ((-5l, 5l))).equals((\"YES\")));\n assert(intersection(((-2l, 2l)), ((-4l, 0l))).equals((\"YES\")));\n assert(intersection(((-11l, 2l)), ((-1l, -1l))).equals((\"NO\")));\n assert(intersection(((1l, 2l)), ((3l, 5l))).equals((\"NO\")));\n assert(intersection(((1l, 2l)), ((1l, 2l))).equals((\"NO\")));\n assert(intersection(((-2l, -2l)), ((-3l, -2l))).equals((\"NO\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return the largest prime factor of n. Assume n > 1 and is not a prime.\n // >>> largestPrimeFactor((13195l))\n // (29l)\n // >>> largestPrimeFactor((2048l))\n // (2l)\n def largestPrimeFactor(n : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(largestPrimeFactor((15l)) == (5l));\n assert(largestPrimeFactor((27l)) == (3l));\n assert(largestPrimeFactor((63l)) == (7l));\n assert(largestPrimeFactor((330l)) == (11l));\n assert(largestPrimeFactor((13195l)) == (29l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a string, find out how many distinct characters (regardless of case) does it consist of\n // >>> countDistinctCharacters((\"xyzXYZ\"))\n // (3l)\n // >>> countDistinctCharacters((\"Jerry\"))\n // (4l)\n def countDistinctCharacters(string : String) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(countDistinctCharacters((\"\")) == (0l));\n assert(countDistinctCharacters((\"abcde\")) == (5l));\n assert(countDistinctCharacters((\"abcdecadeCADE\")) == (5l));\n assert(countDistinctCharacters((\"aaaaAAAAaaaa\")) == (1l));\n assert(countDistinctCharacters((\"Jerry jERRY JeRRRY\")) == (5l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You're given a list of deposit and withdrawal operations on a bank account that starts with\n // zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n // at that point function should return true. Otherwise it should return false.\n // >>> belowZero((List[Long](1l.toLong, 2l.toLong, 3l.toLong)))\n // (false)\n // >>> belowZero((List[Long](1l.toLong, 2l.toLong, -4l.toLong, 5l.toLong)))\n // (true)\n def belowZero(operations : List[Long]) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(belowZero((List[Long]())) == (false));\n assert(belowZero((List[Long](1l.toLong, 2l.toLong, -3l.toLong, 1l.toLong, 2l.toLong, -3l.toLong))) == (false));\n assert(belowZero((List[Long](1l.toLong, 2l.toLong, -4l.toLong, 5l.toLong, 6l.toLong))) == (true));\n assert(belowZero((List[Long](1l.toLong, -1l.toLong, 2l.toLong, -2l.toLong, 5l.toLong, -5l.toLong, 4l.toLong, -4l.toLong))) == (false));\n assert(belowZero((List[Long](1l.toLong, -1l.toLong, 2l.toLong, -2l.toLong, 5l.toLong, -5l.toLong, 4l.toLong, -5l.toLong))) == (true));\n assert(belowZero((List[Long](1l.toLong, -2l.toLong, 2l.toLong, -2l.toLong, 5l.toLong, -5l.toLong, 4l.toLong, -4l.toLong))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Find the shortest palindrome that begins with a supplied string.\n // Algorithm idea is simple:\n // - Find the longest postfix of supplied string that is a palindrome.\n // - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n // >>> makePalindrome((\"\"))\n // (\"\")\n // >>> makePalindrome((\"cat\"))\n // (\"catac\")\n // >>> makePalindrome((\"cata\"))\n // (\"catac\")\n def makePalindrome(string : String) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(makePalindrome((\"\")).equals((\"\")));\n assert(makePalindrome((\"x\")).equals((\"x\")));\n assert(makePalindrome((\"xyz\")).equals((\"xyzyx\")));\n assert(makePalindrome((\"xyx\")).equals((\"xyx\")));\n assert(makePalindrome((\"jerry\")).equals((\"jerryrrej\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a positive integer, obtain its roman numeral equivalent as a string,\n // and return it in lowercase.\n // Restrictions: 1 <= num <= 1000\n // Examples:\n // >>> intToMiniRoman((19l))\n // (\"xix\")\n // >>> intToMiniRoman((152l))\n // (\"clii\")\n // >>> intToMiniRoman((426l))\n // (\"cdxxvi\")\n def intToMiniRoman(number : Long) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "reworded", - "tests": " }\n def main(args: Array[String]) = {\n assert(intToMiniRoman((19l)).equals((\"xix\")));\n assert(intToMiniRoman((152l)).equals((\"clii\")));\n assert(intToMiniRoman((251l)).equals((\"ccli\")));\n assert(intToMiniRoman((426l)).equals((\"cdxxvi\")));\n assert(intToMiniRoman((500l)).equals((\"d\")));\n assert(intToMiniRoman((1l)).equals((\"i\")));\n assert(intToMiniRoman((4l)).equals((\"iv\")));\n assert(intToMiniRoman((43l)).equals((\"xliii\")));\n assert(intToMiniRoman((90l)).equals((\"xc\")));\n assert(intToMiniRoman((94l)).equals((\"xciv\")));\n assert(intToMiniRoman((532l)).equals((\"dxxxii\")));\n assert(intToMiniRoman((900l)).equals((\"cm\")));\n assert(intToMiniRoman((994l)).equals((\"cmxciv\")));\n assert(intToMiniRoman((1000l)).equals((\"m\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - } -] \ No newline at end of file diff --git a/data/scala-transform.json b/data/scala-transform.json deleted file mode 100644 index 241e0c6b6866178a14cdac9b0ab63e3f098d0159..0000000000000000000000000000000000000000 --- a/data/scala-transform.json +++ /dev/null @@ -1,1922 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // For a given number n, find the largest number that divides n evenly, smaller than n\n // >>> largestDivisor((15l))\n // (5l)\n def largestDivisor(n : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(largestDivisor((3l)) == (1l));\n assert(largestDivisor((7l)) == (1l));\n assert(largestDivisor((10l)) == (5l));\n assert(largestDivisor((100l)) == (50l));\n assert(largestDivisor((49l)) == (7l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_47_median", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return median of elements in the list l.\n // >>> median((List[Long](3l.toLong, 1l.toLong, 2l.toLong, 4l.toLong, 5l.toLong)))\n // 3l\n // >>> median((List[Long](-10l.toLong, 4l.toLong, 6l.toLong, 1000l.toLong, 10l.toLong, 20l.toLong)))\n // (15.0f)\n def median(l : List[Long]) : Float = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(median((List[Long](3l.toLong, 1l.toLong, 2l.toLong, 4l.toLong, 5l.toLong))) == 3l);\n assert(median((List[Long](-10l.toLong, 4l.toLong, 6l.toLong, 1000l.toLong, 10l.toLong, 20l.toLong))) == (8.0f));\n assert(median((List[Long](5l.toLong))) == 5l);\n assert(median((List[Long](6l.toLong, 5l.toLong))) == (5.5f));\n assert(median((List[Long](8l.toLong, 1l.toLong, 3l.toLong, 9l.toLong, 9l.toLong, 2l.toLong, 7l.toLong))) == 7l);\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given two lists operator, and operand. The first list has basic algebra operations, and \n // the second list is a list of integers. Use the two given lists to build the algebric \n // expression and return the evaluation of this expression.\n // The basic algebra operations:\n // Addition ( + ) \n // Subtraction ( - ) \n // Multiplication ( * ) \n // Floor division ( // ) \n // Exponentiation ( ** ) \n // Example:\n // operator['+', '*', '-']\n // array = [2, 3, 4, 5]\n // result = 2 + 3 * 4 - 5\n // => result = 9\n // Note:\n // The length of operator list is equal to the length of operand list minus one.\n // Operand is a list of of non-negative integers.\n // Operator list has at least one operator, and operand list has at least two operands.\n def doAlgebra(op : List[String], operand : List[Long]) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(doAlgebra((List[String](\"**\", \"*\", \"+\")), (List[Long](2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong))) == (37l));\n assert(doAlgebra((List[String](\"+\", \"*\", \"-\")), (List[Long](2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong))) == (9l));\n assert(doAlgebra((List[String](\"//\", \"*\")), (List[Long](7l.toLong, 3l.toLong, 4l.toLong))) == (8l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return maximum element in the list.\n // >>> maxElement((List[Long](1l.toLong, 2l.toLong, 3l.toLong)))\n // (3l)\n // >>> maxElement((List[Long](5l.toLong, 3l.toLong, -5l.toLong, 2l.toLong, -3l.toLong, 3l.toLong, 9l.toLong, 0l.toLong, 123l.toLong, 1l.toLong, -10l.toLong)))\n // (123l)\n def maxElement(l : List[Long]) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(maxElement((List[Long](1l.toLong, 2l.toLong, 3l.toLong))) == (3l));\n assert(maxElement((List[Long](5l.toLong, 3l.toLong, -5l.toLong, 2l.toLong, -3l.toLong, 3l.toLong, 9l.toLong, 0l.toLong, 124l.toLong, 1l.toLong, -10l.toLong))) == (124l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function which returns the largest index of an element which\n // is not greater than or equal to the element immediately preceding it. If\n // no such element exists then return -1. The given array will not contain\n // duplicate values.\n // Examples:\n // >>> canArrange((List[Long](1l.toLong, 2l.toLong, 4l.toLong, 3l.toLong, 5l.toLong)))\n // (3l)\n // >>> canArrange((List[Long](1l.toLong, 2l.toLong, 3l.toLong)))\n // (-1l)\n def canArrange(arr : List[Long]) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(canArrange((List[Long](1l.toLong, 2l.toLong, 4l.toLong, 3l.toLong, 5l.toLong))) == (3l));\n assert(canArrange((List[Long](1l.toLong, 2l.toLong, 4l.toLong, 5l.toLong))) == (-1l));\n assert(canArrange((List[Long](1l.toLong, 4l.toLong, 2l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong, 9l.toLong, 10l.toLong))) == (2l));\n assert(canArrange((List[Long](4l.toLong, 8l.toLong, 5l.toLong, 7l.toLong, 3l.toLong))) == (4l));\n assert(canArrange((List[Long]())) == (-1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Imagine a road that's a perfectly straight infinitely long line.\n // n cars are driving left to right; simultaneously, a different set of n cars\n // are driving right to left. The two sets of cars start out being very far from\n // each other. All cars move in the same speed. Two cars are said to collide\n // when a car that's moving left to right hits a car that's moving right to left.\n // However, the cars are infinitely sturdy and strong; as a result, they continue moving\n // in their trajectory as if they did not collide.\n // This function outputs the number of such collisions.\n def carRaceCollision(n : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(carRaceCollision((2l)) == (4l));\n assert(carRaceCollision((3l)) == (9l));\n assert(carRaceCollision((4l)) == (16l));\n assert(carRaceCollision((8l)) == (64l));\n assert(carRaceCollision((10l)) == (100l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function that returns True if the last character\n // of a given string is an alphabetical character and is not\n // a part of a word, and False otherwise.\n // Note: \"word\" is a group of characters separated by space.\n // Examples:\n // >>> checkIfLastCharIsALetter((\"apple pie\"))\n // (false)\n // >>> checkIfLastCharIsALetter((\"apple pi e\"))\n // (true)\n // >>> checkIfLastCharIsALetter((\"apple pi e \"))\n // (false)\n // >>> checkIfLastCharIsALetter((\"\"))\n // (false)\n def checkIfLastCharIsALetter(txt : String) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(checkIfLastCharIsALetter((\"apple\")) == (false));\n assert(checkIfLastCharIsALetter((\"apple pi e\")) == (true));\n assert(checkIfLastCharIsALetter((\"eeeee\")) == (false));\n assert(checkIfLastCharIsALetter((\"A\")) == (true));\n assert(checkIfLastCharIsALetter((\"Pumpkin pie \")) == (false));\n assert(checkIfLastCharIsALetter((\"Pumpkin pie 1\")) == (false));\n assert(checkIfLastCharIsALetter((\"\")) == (false));\n assert(checkIfLastCharIsALetter((\"eeeee e \")) == (false));\n assert(checkIfLastCharIsALetter((\"apple pie\")) == (false));\n assert(checkIfLastCharIsALetter((\"apple pi e \")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return true if a given number is prime, and false otherwise.\n // >>> isPrime((6l))\n // (false)\n // >>> isPrime((101l))\n // (true)\n // >>> isPrime((11l))\n // (true)\n // >>> isPrime((13441l))\n // (true)\n // >>> isPrime((61l))\n // (true)\n // >>> isPrime((4l))\n // (false)\n // >>> isPrime((1l))\n // (false)\n def isPrime(n : Long) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(isPrime((6l)) == (false));\n assert(isPrime((101l)) == (true));\n assert(isPrime((11l)) == (true));\n assert(isPrime((13441l)) == (true));\n assert(isPrime((61l)) == (true));\n assert(isPrime((4l)) == (false));\n assert(isPrime((1l)) == (false));\n assert(isPrime((5l)) == (true));\n assert(isPrime((11l)) == (true));\n assert(isPrime((17l)) == (true));\n assert(isPrime((85l)) == (false));\n assert(isPrime((77l)) == (false));\n assert(isPrime((255379l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a list of positive integers x. return a sorted list of all \n // elements that hasn't any even digit.\n // Note: Returned list should be sorted in increasing order.\n // For example:\n // >>> uniqueDigits((List[Long](15l.toLong, 33l.toLong, 1422l.toLong, 1l.toLong)))\n // (List[Long](1l.toLong, 15l.toLong, 33l.toLong))\n // >>> uniqueDigits((List[Long](152l.toLong, 323l.toLong, 1422l.toLong, 10l.toLong)))\n // (List[Long]())\n def uniqueDigits(x : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(uniqueDigits((List[Long](15l.toLong, 33l.toLong, 1422l.toLong, 1l.toLong))).equals((List[Long](1l.toLong, 15l.toLong, 33l.toLong))));\n assert(uniqueDigits((List[Long](152l.toLong, 323l.toLong, 1422l.toLong, 10l.toLong))).equals((List[Long]())));\n assert(uniqueDigits((List[Long](12345l.toLong, 2033l.toLong, 111l.toLong, 151l.toLong))).equals((List[Long](111l.toLong, 151l.toLong))));\n assert(uniqueDigits((List[Long](135l.toLong, 103l.toLong, 31l.toLong))).equals((List[Long](31l.toLong, 135l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Input are two strings a and b consisting only of 1s and 0s.\n // Perform binary XOR on these inputs and return result also as a string.\n // >>> stringXor((\"010\"), (\"110\"))\n // (\"100\")\n def stringXor(a : String, b : String) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(stringXor((\"111000\"), (\"101010\")).equals((\"010010\")));\n assert(stringXor((\"1\"), (\"1\")).equals((\"0\")));\n assert(stringXor((\"0101\"), (\"0000\")).equals((\"0101\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // sum_to_n is a function that sums numbers from 1 to n.\n // >>> sumToN((30l))\n // (465l)\n // >>> sumToN((100l))\n // (5050l)\n // >>> sumToN((5l))\n // (15l)\n // >>> sumToN((10l))\n // (55l)\n // >>> sumToN((1l))\n // (1l)\n def sumToN(n : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sumToN((1l)) == (1l));\n assert(sumToN((6l)) == (21l));\n assert(sumToN((11l)) == (66l));\n assert(sumToN((30l)) == (465l));\n assert(sumToN((100l)) == (5050l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a list of numbers, return the sum of squares of the numbers\n // in the list that are odd. Ignore numbers that are negative or not integers.\n // >>> doubleTheDifference((List[Float](1l.toLong, 3l.toLong, 2l.toLong, 0l.toLong)))\n // (10l)\n // >>> doubleTheDifference((List[Float](-1l.toLong, -2l.toLong, 0l.toLong)))\n // (0l)\n // >>> doubleTheDifference((List[Float](9l.toLong, -2l.toLong)))\n // (81l)\n // >>> doubleTheDifference((List[Float](0l.toLong)))\n // (0l)\n // If the input list is empty, return 0.\n def doubleTheDifference(lst : List[Float]) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(doubleTheDifference((List[Float]())) == (0l));\n assert(doubleTheDifference((List[Float](5.0f.toFloat, 4.0f.toFloat))) == (25l));\n assert(doubleTheDifference((List[Float](0.1f.toFloat, 0.2f.toFloat, 0.3f.toFloat))) == (0l));\n assert(doubleTheDifference((List[Float](-10.0f.toFloat, -20.0f.toFloat, -30.0f.toFloat))) == (0l));\n assert(doubleTheDifference((List[Float](-1.0f.toFloat, -2.0f.toFloat, 8.0f.toFloat))) == (0l));\n assert(doubleTheDifference((List[Float](0.2f.toFloat, 3.0f.toFloat, 5.0f.toFloat))) == (34l));\n assert(doubleTheDifference((List[Float](-9.0f.toFloat, -7.0f.toFloat, -5.0f.toFloat, -3.0f.toFloat, -1.0f.toFloat, 1.0f.toFloat, 3.0f.toFloat, 5.0f.toFloat, 7.0f.toFloat, 9.0f.toFloat))) == (165l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return length of given string\n // >>> stringLength((\"\"))\n // (0l)\n // >>> stringLength((\"abc\"))\n // (3l)\n def strlen(string : String) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(strlen((\"\")) == (0l));\n assert(strlen((\"x\")) == (1l));\n assert(strlen((\"asdasnakj\")) == (9l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You'll be given a string of words, and your task is to count the number\n // of boredoms. A boredom is a sentence that starts with the word \"I\".\n // Sentences are delimited by '.', '?' or '!'.\n // For example:\n // >>> isBored((\"Hello world\"))\n // (0l)\n // >>> isBored((\"The sky is blue. The sun is shining. I love this weather\"))\n // (1l)\n def isBored(S : String) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(isBored((\"Hello world\")) == (0l));\n assert(isBored((\"Is the sky blue?\")) == (0l));\n assert(isBored((\"I love It !\")) == (1l));\n assert(isBored((\"bIt\")) == (0l));\n assert(isBored((\"I feel good today. I will be productive. will kill It\")) == (2l));\n assert(isBored((\"You and I are going for a walk\")) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function vowels_count which takes a string representing\n // a word as input and returns the number of vowels in the string.\n // Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n // vowel, but only when it is at the end of the given word.\n // Example:\n // >>> vowelsCount((\"abcde\"))\n // (2l)\n // >>> vowelsCount((\"ACEDY\"))\n // (3l)\n def vowelsCount(s : String) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(vowelsCount((\"abcde\")) == (2l));\n assert(vowelsCount((\"Alone\")) == (3l));\n assert(vowelsCount((\"key\")) == (2l));\n assert(vowelsCount((\"bye\")) == (1l));\n assert(vowelsCount((\"keY\")) == (2l));\n assert(vowelsCount((\"bYe\")) == (1l));\n assert(vowelsCount((\"ACEDY\")) == (3l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return n-th Fibonacci number.\n // >>> fib((10l))\n // (55l)\n // >>> fib((1l))\n // (1l)\n // >>> fib((8l))\n // (21l)\n def fib(n : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(fib((10l)) == (55l));\n assert(fib((1l)) == (1l));\n assert(fib((8l)) == (21l));\n assert(fib((11l)) == (89l));\n assert(fib((12l)) == (144l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Your task is to implement a function that will simplify the expression\n // x * n. The function returns True if x * n evaluates to a whole number and False\n // otherwise. Both x and n, are string representation of a fraction, and have the following format,\n // / where both numerator and denominator are positive whole numbers.\n // You can assume that x, and n are valid fractions, and do not have zero as denominator.\n // >>> simplify((\"1/5\"), (\"5/1\"))\n // (true)\n // >>> simplify((\"1/6\"), (\"2/1\"))\n // (false)\n // >>> simplify((\"7/10\"), (\"10/2\"))\n // (false)\n def simplify(x : String, n : String) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(simplify((\"1/5\"), (\"5/1\")) == (true));\n assert(simplify((\"1/6\"), (\"2/1\")) == (false));\n assert(simplify((\"5/1\"), (\"3/1\")) == (true));\n assert(simplify((\"7/10\"), (\"10/2\")) == (false));\n assert(simplify((\"2/10\"), (\"50/10\")) == (true));\n assert(simplify((\"7/2\"), (\"4/2\")) == (true));\n assert(simplify((\"11/6\"), (\"6/1\")) == (true));\n assert(simplify((\"2/3\"), (\"5/2\")) == (false));\n assert(simplify((\"5/2\"), (\"3/5\")) == (false));\n assert(simplify((\"2/4\"), (\"8/4\")) == (true));\n assert(simplify((\"2/4\"), (\"4/2\")) == (true));\n assert(simplify((\"1/5\"), (\"5/1\")) == (true));\n assert(simplify((\"1/5\"), (\"1/5\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a string s, count the number of uppercase vowels in even indices.\n // For example:\n // >>> countUpper((\"aBCdEf\"))\n // (1l)\n // >>> countUpper((\"abcdefg\"))\n // (0l)\n // >>> countUpper((\"dBBE\"))\n // (0l)\n def countUpper(s : String) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(countUpper((\"aBCdEf\")) == (1l));\n assert(countUpper((\"abcdefg\")) == (0l));\n assert(countUpper((\"dBBE\")) == (0l));\n assert(countUpper((\"B\")) == (0l));\n assert(countUpper((\"U\")) == (1l));\n assert(countUpper((\"\")) == (0l));\n assert(countUpper((\"EEEE\")) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a rectangular grid of wells. Each row represents a single well,\n // and each 1 in a row represents a single unit of water.\n // Each well has a corresponding bucket that can be used to extract water from it, \n // and all buckets have the same capacity.\n // Your task is to use the buckets to empty the wells.\n // Output the number of times you need to lower the buckets.\n // Example 1:\n // >>> maxFill((List[List[Long]](List[Long](0l.toLong, 0l.toLong, 1l.toLong, 0l.toLong), List[Long](0l.toLong, 1l.toLong, 0l.toLong, 0l.toLong), List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))), (1l))\n // (6l)\n // Example 2:\n // >>> maxFill((List[List[Long]](List[Long](0l.toLong, 0l.toLong, 1l.toLong, 1l.toLong), List[Long](0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong), List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong), List[Long](0l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))), (2l))\n // (5l)\n // Example 3:\n // >>> maxFill((List[List[Long]](List[Long](0l.toLong, 0l.toLong, 0l.toLong), List[Long](0l.toLong, 0l.toLong, 0l.toLong))), (5l))\n // (0l)\n // Constraints:\n // * all wells have the same length\n // * 1 <= grid.length <= 10^2\n // * 1 <= grid[:,1].length <= 10^2\n // * grid[i][j] -> 0 | 1\n // * 1 <= capacity <= 10\n def maxFill(grid : List[List[Long]], capacity : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(maxFill((List[List[Long]](List[Long](0l.toLong, 0l.toLong, 1l.toLong, 0l.toLong), List[Long](0l.toLong, 1l.toLong, 0l.toLong, 0l.toLong), List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))), (1l)) == (6l));\n assert(maxFill((List[List[Long]](List[Long](0l.toLong, 0l.toLong, 1l.toLong, 1l.toLong), List[Long](0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong), List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong), List[Long](0l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))), (2l)) == (5l));\n assert(maxFill((List[List[Long]](List[Long](0l.toLong, 0l.toLong, 0l.toLong), List[Long](0l.toLong, 0l.toLong, 0l.toLong))), (5l)) == (0l));\n assert(maxFill((List[List[Long]](List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong), List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))), (2l)) == (4l));\n assert(maxFill((List[List[Long]](List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong), List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))), (9l)) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given an array arr of integers and a positive integer k, return a sorted list \n // of length k with the maximum k numbers in arr.\n // Example 1:\n // >>> maximum((List[Long](-3l.toLong, -4l.toLong, 5l.toLong)), (3l))\n // (List[Long](-4l.toLong, -3l.toLong, 5l.toLong))\n // Example 2:\n // >>> maximum((List[Long](4l.toLong, -4l.toLong, 4l.toLong)), (2l))\n // (List[Long](4l.toLong, 4l.toLong))\n // Example 3:\n // >>> maximum((List[Long](-3l.toLong, 2l.toLong, 1l.toLong, 2l.toLong, -1l.toLong, -2l.toLong, 1l.toLong)), (1l))\n // (List[Long](2l.toLong))\n // Note:\n // 1. The length of the array will be in the range of [1, 1000].\n // 2. The elements in the array will be in the range of [-1000, 1000].\n // 3. 0 <= k <= len(arr)\n def maximum(arr : List[Long], k : Long) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(maximum((List[Long](-3l.toLong, -4l.toLong, 5l.toLong)), (3l)).equals((List[Long](-4l.toLong, -3l.toLong, 5l.toLong))));\n assert(maximum((List[Long](4l.toLong, -4l.toLong, 4l.toLong)), (2l)).equals((List[Long](4l.toLong, 4l.toLong))));\n assert(maximum((List[Long](-3l.toLong, 2l.toLong, 1l.toLong, 2l.toLong, -1l.toLong, -2l.toLong, 1l.toLong)), (1l)).equals((List[Long](2l.toLong))));\n assert(maximum((List[Long](123l.toLong, -123l.toLong, 20l.toLong, 0l.toLong, 1l.toLong, 2l.toLong, -3l.toLong)), (3l)).equals((List[Long](2l.toLong, 20l.toLong, 123l.toLong))));\n assert(maximum((List[Long](-123l.toLong, 20l.toLong, 0l.toLong, 1l.toLong, 2l.toLong, -3l.toLong)), (4l)).equals((List[Long](0l.toLong, 1l.toLong, 2l.toLong, 20l.toLong))));\n assert(maximum((List[Long](5l.toLong, 15l.toLong, 0l.toLong, 3l.toLong, -13l.toLong, -8l.toLong, 0l.toLong)), (7l)).equals((List[Long](-13l.toLong, -8l.toLong, 0l.toLong, 0l.toLong, 3l.toLong, 5l.toLong, 15l.toLong))));\n assert(maximum((List[Long](-1l.toLong, 0l.toLong, 2l.toLong, 5l.toLong, 3l.toLong, -10l.toLong)), (2l)).equals((List[Long](3l.toLong, 5l.toLong))));\n assert(maximum((List[Long](1l.toLong, 0l.toLong, 5l.toLong, -7l.toLong)), (1l)).equals((List[Long](5l.toLong))));\n assert(maximum((List[Long](4l.toLong, -4l.toLong)), (2l)).equals((List[Long](-4l.toLong, 4l.toLong))));\n assert(maximum((List[Long](-10l.toLong, 10l.toLong)), (2l)).equals((List[Long](-10l.toLong, 10l.toLong))));\n assert(maximum((List[Long](1l.toLong, 2l.toLong, 3l.toLong, -23l.toLong, 243l.toLong, -400l.toLong, 0l.toLong)), (0l)).equals((List[Long]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that takes a message, and encodes in such a \n // way that it swaps case of all letters, replaces all vowels in \n // the message with the letter that appears 2 places ahead of that \n // vowel in the english alphabet. \n // Assume only letters. \n // Examples:\n // >>> encode((\"test\"))\n // (\"TGST\")\n // >>> encode((\"This is a message\"))\n // (\"tHKS KS C MGSSCGG\")\n def encode(message : String) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(encode((\"TEST\")).equals((\"tgst\")));\n assert(encode((\"Mudasir\")).equals((\"mWDCSKR\")));\n assert(encode((\"YES\")).equals((\"ygs\")));\n assert(encode((\"This is a message\")).equals((\"tHKS KS C MGSSCGG\")));\n assert(encode((\"I DoNt KnOw WhAt tO WrItE\")).equals((\"k dQnT kNqW wHcT Tq wRkTg\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // remove_vowels is a function that takes string and returns string without vowels.\n // >>> removeVowels((\"\"))\n // (\"\")\n // >>> removeVowels((\"abcdef\"))\n // (\"bcdf\")\n // >>> removeVowels((\"aaaaa\"))\n // (\"\")\n // >>> removeVowels((\"aaBAA\"))\n // (\"B\")\n // >>> removeVowels((\"zbcd\"))\n // (\"zbcd\")\n def removeVowels(text : String) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(removeVowels((\"\")).equals((\"\")));\n assert(removeVowels((\"abcdef\\nghijklm\")).equals((\"bcdf\\nghjklm\")));\n assert(removeVowels((\"fedcba\")).equals((\"fdcb\")));\n assert(removeVowels((\"eeeee\")).equals((\"\")));\n assert(removeVowels((\"acBAA\")).equals((\"cB\")));\n assert(removeVowels((\"EcBOO\")).equals((\"cB\")));\n assert(removeVowels((\"ybcd\")).equals((\"ybcd\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return only positive numbers in the list.\n // >>> getPositive((List[Long](-1l.toLong, 2l.toLong, -4l.toLong, 5l.toLong, 6l.toLong)))\n // (List[Long](2l.toLong, 5l.toLong, 6l.toLong))\n // >>> getPositive((List[Long](5l.toLong, 3l.toLong, -5l.toLong, 2l.toLong, -3l.toLong, 3l.toLong, 9l.toLong, 0l.toLong, 123l.toLong, 1l.toLong, -10l.toLong)))\n // (List[Long](5l.toLong, 3l.toLong, 2l.toLong, 3l.toLong, 9l.toLong, 123l.toLong, 1l.toLong))\n def getPositive(l : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(getPositive((List[Long](-1l.toLong, -2l.toLong, 4l.toLong, 5l.toLong, 6l.toLong))).equals((List[Long](4l.toLong, 5l.toLong, 6l.toLong))));\n assert(getPositive((List[Long](5l.toLong, 3l.toLong, -5l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 9l.toLong, 0l.toLong, 123l.toLong, 1l.toLong, -10l.toLong))).equals((List[Long](5l.toLong, 3l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 9l.toLong, 123l.toLong, 1l.toLong))));\n assert(getPositive((List[Long](-1l.toLong, -2l.toLong))).equals((List[Long]())));\n assert(getPositive((List[Long]())).equals((List[Long]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n // >>> stringSequence((0l))\n // (\"0\")\n // >>> stringSequence((5l))\n // (\"0 1 2 3 4 5\")\n def stringSequence(n : Long) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(stringSequence((0l)).equals((\"0\")));\n assert(stringSequence((3l)).equals((\"0 1 2 3\")));\n assert(stringSequence((10l)).equals((\"0 1 2 3 4 5 6 7 8 9 10\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a positive integer n, you have to make a pile of n levels of stones.\n // The first level has n stones.\n // The number of stones in the next level is:\n // - the next odd number if n is odd.\n // - the next even number if n is even.\n // Return the number of stones in each level in a list, where element at index\n // i represents the number of stones in the level (i+1).\n // Examples:\n // >>> makeAPile((3l))\n // (List[Long](3l.toLong, 5l.toLong, 7l.toLong))\n def makeAPile(n : Long) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(makeAPile((3l)).equals((List[Long](3l.toLong, 5l.toLong, 7l.toLong))));\n assert(makeAPile((4l)).equals((List[Long](4l.toLong, 6l.toLong, 8l.toLong, 10l.toLong))));\n assert(makeAPile((5l)).equals((List[Long](5l.toLong, 7l.toLong, 9l.toLong, 11l.toLong, 13l.toLong))));\n assert(makeAPile((6l)).equals((List[Long](6l.toLong, 8l.toLong, 10l.toLong, 12l.toLong, 14l.toLong, 16l.toLong))));\n assert(makeAPile((8l)).equals((List[Long](8l.toLong, 10l.toLong, 12l.toLong, 14l.toLong, 16l.toLong, 18l.toLong, 20l.toLong, 22l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Task\n // 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\n // then check if the result string is palindrome.\n // A string is called palindrome if it reads the same backward as forward.\n // You should return a tuple containing the result string and True/False for the check.\n // Example\n // >>> reverseDelete((\"abcde\"), (\"ae\"))\n // ((\"bcd\", false))\n // >>> reverseDelete((\"abcdef\"), (\"b\"))\n // ((\"acdef\", false))\n // >>> reverseDelete((\"abcdedcba\"), (\"ab\"))\n // ((\"cdedc\", true))\n def reverseDelete(s : String, c : String) : Tuple2[String, Boolean] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(reverseDelete((\"abcde\"), (\"ae\")).equals(((\"bcd\", false))));\n assert(reverseDelete((\"abcdef\"), (\"b\")).equals(((\"acdef\", false))));\n assert(reverseDelete((\"abcdedcba\"), (\"ab\")).equals(((\"cdedc\", true))));\n assert(reverseDelete((\"dwik\"), (\"w\")).equals(((\"dik\", false))));\n assert(reverseDelete((\"a\"), (\"a\")).equals(((\"\", true))));\n assert(reverseDelete((\"abcdedcba\"), (\"\")).equals(((\"abcdedcba\", true))));\n assert(reverseDelete((\"abcdedcba\"), (\"v\")).equals(((\"abcdedcba\", true))));\n assert(reverseDelete((\"vabba\"), (\"v\")).equals(((\"abba\", true))));\n assert(reverseDelete((\"mamma\"), (\"mia\")).equals(((\"\", true))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n // >>> flipCase((\"Hello\"))\n // (\"hELLO\")\n def flipCase(string : String) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(flipCase((\"\")).equals((\"\")));\n assert(flipCase((\"Hello!\")).equals((\"hELLO!\")));\n assert(flipCase((\"These violent delights have violent ends\")).equals((\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a string s.\n // if s[i] is a letter, reverse its case from lower to upper or vise versa, \n // otherwise keep it as it is.\n // If the string contains no letters, reverse the string.\n // The function should return the resulted string.\n // Examples\n // >>> solve((\"1234\"))\n // (\"4321\")\n // >>> solve((\"ab\"))\n // (\"AB\")\n // >>> solve((\"#a@C\"))\n // (\"#A@c\")\n def solve(s : String) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(solve((\"AsDf\")).equals((\"aSdF\")));\n assert(solve((\"1234\")).equals((\"4321\")));\n assert(solve((\"ab\")).equals((\"AB\")));\n assert(solve((\"#a@C\")).equals((\"#A@c\")));\n assert(solve((\"#AsdfW^45\")).equals((\"#aSDFw^45\")));\n assert(solve((\"#6@2\")).equals((\"2@6#\")));\n assert(solve((\"#$a^D\")).equals((\"#$A^d\")));\n assert(solve((\"#ccc\")).equals((\"#CCC\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Filter an input list of strings only for ones that start with a given prefix.\n // >>> filterByPrefix((List[String]()), (\"a\"))\n // (List[String]())\n // >>> filterByPrefix((List[String](\"abc\", \"bcd\", \"cde\", \"array\")), (\"a\"))\n // (List[String](\"abc\", \"array\"))\n def filterByPrefix(strings : List[String], prefix : String) : List[String] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(filterByPrefix((List[String]()), (\"john\")).equals((List[String]())));\n assert(filterByPrefix((List[String](\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\")), (\"xxx\")).equals((List[String](\"xxx\", \"xxxAAA\", \"xxx\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // This function takes two positive numbers x and y and returns the\n // biggest even integer number that is in the range [x, y] inclusive. If \n // there's no such number, then the function should return -1.\n // For example:\n // >>> chooseNum((12l), (15l))\n // (14l)\n // >>> chooseNum((13l), (12l))\n // (-1l)\n def chooseNum(x : Long, y : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(chooseNum((12l), (15l)) == (14l));\n assert(chooseNum((13l), (12l)) == (-1l));\n assert(chooseNum((33l), (12354l)) == (12354l));\n assert(chooseNum((5234l), (5233l)) == (-1l));\n assert(chooseNum((6l), (29l)) == (28l));\n assert(chooseNum((27l), (10l)) == (-1l));\n assert(chooseNum((7l), (7l)) == (-1l));\n assert(chooseNum((546l), (546l)) == (546l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a string representing a sentence,\n // the sentence contains some words separated by a space,\n // and you have to return a string that contains the words from the original sentence,\n // whose lengths are prime numbers,\n // the order of the words in the new string should be the same as the original one.\n // Example 1:\n // >>> wordsInSentence((\"This is a test\"))\n // (\"is\")\n // Example 2:\n // >>> wordsInSentence((\"lets go for swimming\"))\n // (\"go for\")\n // Constraints:\n // * 1 <= len(sentence) <= 100\n // * sentence contains only letters\n def wordsInSentence(sentence : String) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(wordsInSentence((\"This is a test\")).equals((\"is\")));\n assert(wordsInSentence((\"lets go for swimming\")).equals((\"go for\")));\n assert(wordsInSentence((\"there is no place available here\")).equals((\"there is no place\")));\n assert(wordsInSentence((\"Hi I am Hussein\")).equals((\"Hi am Hussein\")));\n assert(wordsInSentence((\"go for it\")).equals((\"go for it\")));\n assert(wordsInSentence((\"here\")).equals((\"\")));\n assert(wordsInSentence((\"here is\")).equals((\"is\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n // >>> intersperse((List[Long]()), (4l))\n // (List[Long]())\n // >>> intersperse((List[Long](1l.toLong, 2l.toLong, 3l.toLong)), (4l))\n // (List[Long](1l.toLong, 4l.toLong, 2l.toLong, 4l.toLong, 3l.toLong))\n def intersperse(numbers : List[Long], delimeter : Long) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(intersperse((List[Long]()), (7l)).equals((List[Long]())));\n assert(intersperse((List[Long](5l.toLong, 6l.toLong, 3l.toLong, 2l.toLong)), (8l)).equals((List[Long](5l.toLong, 8l.toLong, 6l.toLong, 8l.toLong, 3l.toLong, 8l.toLong, 2l.toLong))));\n assert(intersperse((List[Long](2l.toLong, 2l.toLong, 2l.toLong)), (2l)).equals((List[Long](2l.toLong, 2l.toLong, 2l.toLong, 2l.toLong, 2l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Your task is to write a function that returns true if a number x is a simple\n // power of n and false in other cases.\n // x is a simple power of n if n**int=x\n // For example:\n // >>> isSimplePower((1l), (4l))\n // (true)\n // >>> isSimplePower((2l), (2l))\n // (true)\n // >>> isSimplePower((8l), (2l))\n // (true)\n // >>> isSimplePower((3l), (2l))\n // (false)\n // >>> isSimplePower((3l), (1l))\n // (false)\n // >>> isSimplePower((5l), (3l))\n // (false)\n def isSimplePower(x : Long, n : Long) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(isSimplePower((16l), (2l)) == (true));\n assert(isSimplePower((143214l), (16l)) == (false));\n assert(isSimplePower((4l), (2l)) == (true));\n assert(isSimplePower((9l), (3l)) == (true));\n assert(isSimplePower((16l), (4l)) == (true));\n assert(isSimplePower((24l), (2l)) == (false));\n assert(isSimplePower((128l), (4l)) == (false));\n assert(isSimplePower((12l), (6l)) == (false));\n assert(isSimplePower((1l), (1l)) == (true));\n assert(isSimplePower((1l), (12l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that returns true if the given number is the multiplication of 3 prime numbers\n // and false otherwise.\n // Knowing that (a) is less then 100. \n // Example:\n // >>> isMultiplyPrime((30l))\n // (true)\n // 30 = 2 * 3 * 5\n def isMultiplyPrime(a : Long) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(isMultiplyPrime((5l)) == (false));\n assert(isMultiplyPrime((30l)) == (true));\n assert(isMultiplyPrime((8l)) == (true));\n assert(isMultiplyPrime((10l)) == (false));\n assert(isMultiplyPrime((125l)) == (true));\n assert(isMultiplyPrime((105l)) == (true));\n assert(isMultiplyPrime((126l)) == (false));\n assert(isMultiplyPrime((729l)) == (false));\n assert(isMultiplyPrime((891l)) == (false));\n assert(isMultiplyPrime((1001l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given the lengths of the three sides of a triangle. Return True if the three\n // sides form a right-angled triangle, False otherwise.\n // A right-angled triangle is a triangle in which one angle is right angle or \n // 90 degree.\n // Example:\n // >>> rightAngleTriangle((3l), (4l), (5l))\n // (true)\n // >>> rightAngleTriangle((1l), (2l), (3l))\n // (false)\n def rightAngleTriangle(a : Long, b : Long, c : Long) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(rightAngleTriangle((3l), (4l), (5l)) == (true));\n assert(rightAngleTriangle((1l), (2l), (3l)) == (false));\n assert(rightAngleTriangle((10l), (6l), (8l)) == (true));\n assert(rightAngleTriangle((2l), (2l), (2l)) == (false));\n assert(rightAngleTriangle((7l), (24l), (25l)) == (true));\n assert(rightAngleTriangle((10l), (5l), (7l)) == (false));\n assert(rightAngleTriangle((5l), (12l), (13l)) == (true));\n assert(rightAngleTriangle((15l), (8l), (17l)) == (true));\n assert(rightAngleTriangle((48l), (55l), (73l)) == (true));\n assert(rightAngleTriangle((1l), (1l), (1l)) == (false));\n assert(rightAngleTriangle((2l), (2l), (10l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function that takes 3 numbers.\n // Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n // Returns false in any other cases.\n // Examples\n // >>> anyInt(5l, 2l, 7l)\n // (true)\n // >>> anyInt(3l, 2l, 2l)\n // (false)\n // >>> anyInt(3l, -2l, 1l)\n // (true)\n // >>> anyInt((3.6f), (-2.2f), 2l)\n // (false)\n def anyInt(x : Float, y : Float, z : Float) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(anyInt(2l, 3l, 1l) == (true));\n assert(anyInt((2.5f), 2l, 3l) == (false));\n assert(anyInt((1.5f), 5l, (3.5f)) == (false));\n assert(anyInt(2l, 6l, 2l) == (false));\n assert(anyInt(4l, 2l, 2l) == (true));\n assert(anyInt((2.2f), (2.2f), (2.2f)) == (false));\n assert(anyInt(-4l, 6l, 2l) == (true));\n assert(anyInt(2l, 1l, 1l) == (true));\n assert(anyInt(3l, 4l, 7l) == (true));\n assert(anyInt((3.0f), 4l, 7l) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // This function takes a list l and returns a list l' such that\n // l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n // to the values of the corresponding indicies of l, but sorted.\n // >>> sortThird((List[Long](1l.toLong, 2l.toLong, 3l.toLong)))\n // (List[Long](1l.toLong, 2l.toLong, 3l.toLong))\n // >>> sortThird((List[Long](5l.toLong, 6l.toLong, 3l.toLong, 4l.toLong, 8l.toLong, 9l.toLong, 2l.toLong)))\n // (List[Long](2l.toLong, 6l.toLong, 3l.toLong, 4l.toLong, 8l.toLong, 9l.toLong, 5l.toLong))\n def sortThird(l : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sortThird((List[Long](5l.toLong, 6l.toLong, 3l.toLong, 4l.toLong, 8l.toLong, 9l.toLong, 2l.toLong))).equals((List[Long](2l.toLong, 6l.toLong, 3l.toLong, 4l.toLong, 8l.toLong, 9l.toLong, 5l.toLong))));\n assert(sortThird((List[Long](5l.toLong, 8l.toLong, 3l.toLong, 4l.toLong, 6l.toLong, 9l.toLong, 2l.toLong))).equals((List[Long](2l.toLong, 8l.toLong, 3l.toLong, 4l.toLong, 6l.toLong, 9l.toLong, 5l.toLong))));\n assert(sortThird((List[Long](5l.toLong, 6l.toLong, 9l.toLong, 4l.toLong, 8l.toLong, 3l.toLong, 2l.toLong))).equals((List[Long](2l.toLong, 6l.toLong, 9l.toLong, 4l.toLong, 8l.toLong, 3l.toLong, 5l.toLong))));\n assert(sortThird((List[Long](5l.toLong, 6l.toLong, 3l.toLong, 4l.toLong, 8l.toLong, 9l.toLong, 2l.toLong, 1l.toLong))).equals((List[Long](2l.toLong, 6l.toLong, 3l.toLong, 4l.toLong, 8l.toLong, 9l.toLong, 5l.toLong, 1l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_53_add", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Add two numbers x and y\n // >>> add((2l), (3l))\n // (5l)\n // >>> add((5l), (7l))\n // (12l)\n def add(x : Long, y : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(add((0l), (1l)) == (1l));\n assert(add((1l), (0l)) == (1l));\n assert(add((2l), (3l)) == (5l));\n assert(add((5l), (7l)) == (12l));\n assert(add((7l), (5l)) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_69_search", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n // zero, and has a frequency greater than or equal to the value of the integer itself. \n // The frequency of an integer is the number of times it appears in the list.\n // If no such a value exist, return -1.\n // Examples:\n // >>> search((List[Long](4l.toLong, 1l.toLong, 2l.toLong, 2l.toLong, 3l.toLong, 1l.toLong)))\n // (2l)\n // >>> search((List[Long](1l.toLong, 2l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 3l.toLong, 4l.toLong, 4l.toLong, 4l.toLong)))\n // (3l)\n // >>> search((List[Long](5l.toLong, 5l.toLong, 4l.toLong, 4l.toLong, 4l.toLong)))\n // (-1l)\n def search(lst : List[Long]) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(search((List[Long](5l.toLong, 5l.toLong, 5l.toLong, 5l.toLong, 1l.toLong))) == (1l));\n assert(search((List[Long](4l.toLong, 1l.toLong, 4l.toLong, 1l.toLong, 4l.toLong, 4l.toLong))) == (4l));\n assert(search((List[Long](3l.toLong, 3l.toLong))) == (-1l));\n assert(search((List[Long](8l.toLong, 8l.toLong, 8l.toLong, 8l.toLong, 8l.toLong, 8l.toLong, 8l.toLong, 8l.toLong))) == (8l));\n assert(search((List[Long](2l.toLong, 3l.toLong, 3l.toLong, 2l.toLong, 2l.toLong))) == (2l));\n assert(search((List[Long](2l.toLong, 7l.toLong, 8l.toLong, 8l.toLong, 4l.toLong, 8l.toLong, 7l.toLong, 3l.toLong, 9l.toLong, 6l.toLong, 5l.toLong, 10l.toLong, 4l.toLong, 3l.toLong, 6l.toLong, 7l.toLong, 1l.toLong, 7l.toLong, 4l.toLong, 10l.toLong, 8l.toLong, 1l.toLong))) == (1l));\n assert(search((List[Long](3l.toLong, 2l.toLong, 8l.toLong, 2l.toLong))) == (2l));\n assert(search((List[Long](6l.toLong, 7l.toLong, 1l.toLong, 8l.toLong, 8l.toLong, 10l.toLong, 5l.toLong, 8l.toLong, 5l.toLong, 3l.toLong, 10l.toLong))) == (1l));\n assert(search((List[Long](8l.toLong, 8l.toLong, 3l.toLong, 6l.toLong, 5l.toLong, 6l.toLong, 4l.toLong))) == (-1l));\n assert(search((List[Long](6l.toLong, 9l.toLong, 6l.toLong, 7l.toLong, 1l.toLong, 4l.toLong, 7l.toLong, 1l.toLong, 8l.toLong, 8l.toLong, 9l.toLong, 8l.toLong, 10l.toLong, 10l.toLong, 8l.toLong, 4l.toLong, 10l.toLong, 4l.toLong, 10l.toLong, 1l.toLong, 2l.toLong, 9l.toLong, 5l.toLong, 7l.toLong, 9l.toLong))) == (1l));\n assert(search((List[Long](1l.toLong, 9l.toLong, 10l.toLong, 1l.toLong, 3l.toLong))) == (1l));\n assert(search((List[Long](6l.toLong, 9l.toLong, 7l.toLong, 5l.toLong, 8l.toLong, 7l.toLong, 5l.toLong, 3l.toLong, 7l.toLong, 5l.toLong, 10l.toLong, 10l.toLong, 3l.toLong, 6l.toLong, 10l.toLong, 2l.toLong, 8l.toLong, 6l.toLong, 5l.toLong, 4l.toLong, 9l.toLong, 5l.toLong, 3l.toLong, 10l.toLong))) == (5l));\n assert(search((List[Long](1l.toLong))) == (1l));\n assert(search((List[Long](8l.toLong, 8l.toLong, 10l.toLong, 6l.toLong, 4l.toLong, 3l.toLong, 5l.toLong, 8l.toLong, 2l.toLong, 4l.toLong, 2l.toLong, 8l.toLong, 4l.toLong, 6l.toLong, 10l.toLong, 4l.toLong, 2l.toLong, 1l.toLong, 10l.toLong, 2l.toLong, 1l.toLong, 1l.toLong, 5l.toLong))) == (4l));\n assert(search((List[Long](2l.toLong, 10l.toLong, 4l.toLong, 8l.toLong, 2l.toLong, 10l.toLong, 5l.toLong, 1l.toLong, 2l.toLong, 9l.toLong, 5l.toLong, 5l.toLong, 6l.toLong, 3l.toLong, 8l.toLong, 6l.toLong, 4l.toLong, 10l.toLong))) == (2l));\n assert(search((List[Long](1l.toLong, 6l.toLong, 10l.toLong, 1l.toLong, 6l.toLong, 9l.toLong, 10l.toLong, 8l.toLong, 6l.toLong, 8l.toLong, 7l.toLong, 3l.toLong))) == (1l));\n assert(search((List[Long](9l.toLong, 2l.toLong, 4l.toLong, 1l.toLong, 5l.toLong, 1l.toLong, 5l.toLong, 2l.toLong, 5l.toLong, 7l.toLong, 7l.toLong, 7l.toLong, 3l.toLong, 10l.toLong, 1l.toLong, 5l.toLong, 4l.toLong, 2l.toLong, 8l.toLong, 4l.toLong, 1l.toLong, 9l.toLong, 10l.toLong, 7l.toLong, 10l.toLong, 2l.toLong, 8l.toLong, 10l.toLong, 9l.toLong, 4l.toLong))) == (4l));\n assert(search((List[Long](2l.toLong, 6l.toLong, 4l.toLong, 2l.toLong, 8l.toLong, 7l.toLong, 5l.toLong, 6l.toLong, 4l.toLong, 10l.toLong, 4l.toLong, 6l.toLong, 3l.toLong, 7l.toLong, 8l.toLong, 8l.toLong, 3l.toLong, 1l.toLong, 4l.toLong, 2l.toLong, 2l.toLong, 10l.toLong, 7l.toLong))) == (4l));\n assert(search((List[Long](9l.toLong, 8l.toLong, 6l.toLong, 10l.toLong, 2l.toLong, 6l.toLong, 10l.toLong, 2l.toLong, 7l.toLong, 8l.toLong, 10l.toLong, 3l.toLong, 8l.toLong, 2l.toLong, 6l.toLong, 2l.toLong, 3l.toLong, 1l.toLong))) == (2l));\n assert(search((List[Long](5l.toLong, 5l.toLong, 3l.toLong, 9l.toLong, 5l.toLong, 6l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 5l.toLong, 6l.toLong, 10l.toLong, 10l.toLong, 6l.toLong, 8l.toLong, 4l.toLong, 10l.toLong, 7l.toLong, 7l.toLong, 10l.toLong, 8l.toLong))) == (-1l));\n assert(search((List[Long](10l.toLong))) == (-1l));\n assert(search((List[Long](9l.toLong, 7l.toLong, 7l.toLong, 2l.toLong, 4l.toLong, 7l.toLong, 2l.toLong, 10l.toLong, 9l.toLong, 7l.toLong, 5l.toLong, 7l.toLong, 2l.toLong))) == (2l));\n assert(search((List[Long](5l.toLong, 4l.toLong, 10l.toLong, 2l.toLong, 1l.toLong, 1l.toLong, 10l.toLong, 3l.toLong, 6l.toLong, 1l.toLong, 8l.toLong))) == (1l));\n assert(search((List[Long](7l.toLong, 9l.toLong, 9l.toLong, 9l.toLong, 3l.toLong, 4l.toLong, 1l.toLong, 5l.toLong, 9l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 1l.toLong, 10l.toLong, 7l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 6l.toLong, 7l.toLong, 7l.toLong, 6l.toLong))) == (1l));\n assert(search((List[Long](3l.toLong, 10l.toLong, 10l.toLong, 9l.toLong, 2l.toLong))) == (-1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that takes a string and returns True if the string\n // length is a prime number or False otherwise\n // Examples\n // >>> primeLength((\"Hello\"))\n // (true)\n // >>> primeLength((\"abcdcba\"))\n // (true)\n // >>> primeLength((\"kittens\"))\n // (true)\n // >>> primeLength((\"orange\"))\n // (false)\n def primeLength(string : String) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(primeLength((\"Hello\")) == (true));\n assert(primeLength((\"abcdcba\")) == (true));\n assert(primeLength((\"kittens\")) == (true));\n assert(primeLength((\"orange\")) == (false));\n assert(primeLength((\"wow\")) == (true));\n assert(primeLength((\"world\")) == (true));\n assert(primeLength((\"MadaM\")) == (true));\n assert(primeLength((\"Wow\")) == (true));\n assert(primeLength((\"\")) == (false));\n assert(primeLength((\"HI\")) == (true));\n assert(primeLength((\"go\")) == (true));\n assert(primeLength((\"gogo\")) == (false));\n assert(primeLength((\"aaaaaaaaaaaaaaa\")) == (false));\n assert(primeLength((\"Madam\")) == (true));\n assert(primeLength((\"M\")) == (false));\n assert(primeLength((\"0\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_58_common", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return sorted unique common elements for two lists.\n // >>> common((List[Long](1l.toLong, 4l.toLong, 3l.toLong, 34l.toLong, 653l.toLong, 2l.toLong, 5l.toLong)), (List[Long](5l.toLong, 7l.toLong, 1l.toLong, 5l.toLong, 9l.toLong, 653l.toLong, 121l.toLong)))\n // (List[Long](1l.toLong, 5l.toLong, 653l.toLong))\n // >>> common((List[Long](5l.toLong, 3l.toLong, 2l.toLong, 8l.toLong)), (List[Long](3l.toLong, 2l.toLong)))\n // (List[Long](2l.toLong, 3l.toLong))\n def common(l1 : List[Long], l2 : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(common((List[Long](1l.toLong, 4l.toLong, 3l.toLong, 34l.toLong, 653l.toLong, 2l.toLong, 5l.toLong)), (List[Long](5l.toLong, 7l.toLong, 1l.toLong, 5l.toLong, 9l.toLong, 653l.toLong, 121l.toLong))).equals((List[Long](1l.toLong, 5l.toLong, 653l.toLong))));\n assert(common((List[Long](5l.toLong, 3l.toLong, 2l.toLong, 8l.toLong)), (List[Long](3l.toLong, 2l.toLong))).equals((List[Long](2l.toLong, 3l.toLong))));\n assert(common((List[Long](4l.toLong, 3l.toLong, 2l.toLong, 8l.toLong)), (List[Long](3l.toLong, 2l.toLong, 4l.toLong))).equals((List[Long](2l.toLong, 3l.toLong, 4l.toLong))));\n assert(common((List[Long](4l.toLong, 3l.toLong, 2l.toLong, 8l.toLong)), (List[Long]())).equals((List[Long]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // The Brazilian factorial is defined as:\n // brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n // where n > 0\n // For example:\n // >>> specialFactorial((4l))\n // (288l)\n // The function will receive an integer as input and should return the special\n // factorial of this integer.\n def specialFactorial(n : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(specialFactorial((4l)) == (288l));\n assert(specialFactorial((5l)) == (34560l));\n assert(specialFactorial((7l)) == (125411328000l));\n assert(specialFactorial((1l)) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // In this problem, you will implement a function that takes two lists of numbers,\n // and determines whether it is possible to perform an exchange of elements\n // between them to make lst1 a list of only even numbers.\n // There is no limit on the number of exchanged elements between lst1 and lst2.\n // If it is possible to exchange elements between the lst1 and lst2 to make\n // all the elements of lst1 to be even, return \"YES\".\n // Otherwise, return \"NO\".\n // For example:\n // >>> exchange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong)), (List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong)))\n // (\"YES\")\n // >>> exchange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong)), (List[Long](1l.toLong, 5l.toLong, 3l.toLong, 4l.toLong)))\n // (\"NO\")\n // It is assumed that the input lists will be non-empty.\n def exchange(lst1 : List[Long], lst2 : List[Long]) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(exchange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong)), (List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((\"YES\")));\n assert(exchange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong)), (List[Long](1l.toLong, 5l.toLong, 3l.toLong, 4l.toLong))).equals((\"NO\")));\n assert(exchange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong)), (List[Long](2l.toLong, 1l.toLong, 4l.toLong, 3l.toLong))).equals((\"YES\")));\n assert(exchange((List[Long](5l.toLong, 7l.toLong, 3l.toLong)), (List[Long](2l.toLong, 6l.toLong, 4l.toLong))).equals((\"YES\")));\n assert(exchange((List[Long](5l.toLong, 7l.toLong, 3l.toLong)), (List[Long](2l.toLong, 6l.toLong, 3l.toLong))).equals((\"NO\")));\n assert(exchange((List[Long](3l.toLong, 2l.toLong, 6l.toLong, 1l.toLong, 8l.toLong, 9l.toLong)), (List[Long](3l.toLong, 5l.toLong, 5l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))).equals((\"NO\")));\n assert(exchange((List[Long](100l.toLong, 200l.toLong)), (List[Long](200l.toLong, 200l.toLong))).equals((\"YES\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a non-empty array of integers arr and an integer k, return\n // the sum of the elements with at most two digits from the first k elements of arr.\n // Example:\n // >>> addElements((List[Long](111l.toLong, 21l.toLong, 3l.toLong, 4000l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong, 9l.toLong)), (4l))\n // (24l)\n // Constraints:\n // 1. 1 <= len(arr) <= 100\n // 2. 1 <= k <= len(arr)\n def addElements(arr : List[Long], k : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(addElements((List[Long](1l.toLong, -2l.toLong, -3l.toLong, 41l.toLong, 57l.toLong, 76l.toLong, 87l.toLong, 88l.toLong, 99l.toLong)), (3l)) == (-4l));\n assert(addElements((List[Long](111l.toLong, 121l.toLong, 3l.toLong, 4000l.toLong, 5l.toLong, 6l.toLong)), (2l)) == (0l));\n assert(addElements((List[Long](11l.toLong, 21l.toLong, 3l.toLong, 90l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong, 9l.toLong)), (4l)) == (125l));\n assert(addElements((List[Long](111l.toLong, 21l.toLong, 3l.toLong, 4000l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong, 9l.toLong)), (4l)) == (24l));\n assert(addElements((List[Long](1l.toLong)), (1l)) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // A simple program which should return the value of x if n is \n // a prime number and should return the value of y otherwise.\n // Examples:\n // >>> xOrY((7l), (34l), (12l))\n // (34l)\n // >>> xOrY((15l), (8l), (5l))\n // (5l)\n def xOrY(n : Long, x : Long, y : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(xOrY((7l), (34l), (12l)) == (34l));\n assert(xOrY((15l), (8l), (5l)) == (5l));\n assert(xOrY((3l), (33l), (5212l)) == (33l));\n assert(xOrY((1259l), (3l), (52l)) == (3l));\n assert(xOrY((7919l), (-1l), (12l)) == (-1l));\n assert(xOrY((3609l), (1245l), (583l)) == (583l));\n assert(xOrY((91l), (56l), (129l)) == (129l));\n assert(xOrY((6l), (34l), (1234l)) == (1234l));\n assert(xOrY((1l), (2l), (0l)) == (0l));\n assert(xOrY((2l), (2l), (0l)) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given length of a side and high return area for a triangle.\n // >>> triangleArea((5l), (3l))\n // (7.5f)\n def triangleArea(a : Long, h : Long) : Float = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(triangleArea((5l), (3l)) == (7.5f));\n assert(triangleArea((2l), (2l)) == (2.0f));\n assert(triangleArea((10l), (8l)) == (40.0f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n // the last couple centuries. However, what people don't know is Tribonacci sequence.\n // Tribonacci sequence is defined by the recurrence:\n // tri(1) = 3\n // tri(n) = 1 + n / 2, if n is even.\n // tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n // For example:\n // tri(2) = 1 + (2 / 2) = 2\n // tri(4) = 3\n // tri(3) = tri(2) + tri(1) + tri(4)\n // = 2 + 3 + 3 = 8 \n // You are given a non-negative integer number n, you have to a return a list of the \n // first n + 1 numbers of the Tribonacci sequence.\n // Examples:\n // >>> tri((3l))\n // (List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong))\n def tri(n : Long) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(tri((3l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong))));\n assert(tri((4l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 3l.toLong))));\n assert(tri((5l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 3l.toLong, 15l.toLong))));\n assert(tri((6l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 3l.toLong, 15l.toLong, 4l.toLong))));\n assert(tri((7l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 3l.toLong, 15l.toLong, 4l.toLong, 24l.toLong))));\n assert(tri((8l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 3l.toLong, 15l.toLong, 4l.toLong, 24l.toLong, 5l.toLong))));\n assert(tri((9l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 3l.toLong, 15l.toLong, 4l.toLong, 24l.toLong, 5l.toLong, 35l.toLong))));\n assert(tri((20l)).equals((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 8l.toLong, 3l.toLong, 15l.toLong, 4l.toLong, 24l.toLong, 5l.toLong, 35l.toLong, 6l.toLong, 48l.toLong, 7l.toLong, 63l.toLong, 8l.toLong, 80l.toLong, 9l.toLong, 99l.toLong, 10l.toLong, 120l.toLong, 11l.toLong))));\n assert(tri((0l)).equals((List[Long](1l.toLong))));\n assert(tri((1l)).equals((List[Long](1l.toLong, 3l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a list of two strings, both strings consist of open\n // parentheses '(' or close parentheses ')' only.\n // Your job is to check if it is possible to concatenate the two strings in\n // some order, that the resulting string will be good.\n // A string S is considered to be good if and only if all parentheses in S\n // are balanced. For example: the string '(())()' is good, while the string\n // '())' is not.\n // Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n // Examples:\n // >>> matchParens((List[String](\"()(\", \")\")))\n // (\"Yes\")\n // >>> matchParens((List[String](\")\", \")\")))\n // (\"No\")\n def matchParens(lst : List[String]) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(matchParens((List[String](\"()(\", \")\"))).equals((\"Yes\")));\n assert(matchParens((List[String](\")\", \")\"))).equals((\"No\")));\n assert(matchParens((List[String](\"(()(())\", \"())())\"))).equals((\"No\")));\n assert(matchParens((List[String](\")())\", \"(()()(\"))).equals((\"Yes\")));\n assert(matchParens((List[String](\"(())))\", \"(()())((\"))).equals((\"Yes\")));\n assert(matchParens((List[String](\"()\", \"())\"))).equals((\"No\")));\n assert(matchParens((List[String](\"(()(\", \"()))()\"))).equals((\"Yes\")));\n assert(matchParens((List[String](\"((((\", \"((())\"))).equals((\"No\")));\n assert(matchParens((List[String](\")(()\", \"(()(\"))).equals((\"No\")));\n assert(matchParens((List[String](\")(\", \")(\"))).equals((\"No\")));\n assert(matchParens((List[String](\"(\", \")\"))).equals((\"Yes\")));\n assert(matchParens((List[String](\")\", \"(\"))).equals((\"Yes\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // From a list of integers, remove all elements that occur more than once.\n // Keep order of elements left the same as in the input.\n // >>> removeDuplicates((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 2l.toLong, 4l.toLong)))\n // (List[Long](1l.toLong, 3l.toLong, 4l.toLong))\n def removeDuplicates(numbers : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(removeDuplicates((List[Long]())).equals((List[Long]())));\n assert(removeDuplicates((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))));\n assert(removeDuplicates((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 2l.toLong, 4l.toLong, 3l.toLong, 5l.toLong))).equals((List[Long](1l.toLong, 4l.toLong, 5l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return a greatest common divisor of two integers a and b\n // >>> greatestCommonDivisor((3l), (5l))\n // (1l)\n // >>> greatestCommonDivisor((25l), (15l))\n // (5l)\n def greatestCommonDivisor(a : Long, b : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(greatestCommonDivisor((3l), (7l)) == (1l));\n assert(greatestCommonDivisor((10l), (15l)) == (5l));\n assert(greatestCommonDivisor((49l), (14l)) == (7l));\n assert(greatestCommonDivisor((144l), (60l)) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Checks if given string is a palindrome\n // >>> isPalindrome((\"\"))\n // (true)\n // >>> isPalindrome((\"aba\"))\n // (true)\n // >>> isPalindrome((\"aaaaa\"))\n // (true)\n // >>> isPalindrome((\"zbcd\"))\n // (false)\n def isPalindrome(text : String) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(isPalindrome((\"\")) == (true));\n assert(isPalindrome((\"aba\")) == (true));\n assert(isPalindrome((\"aaaaa\")) == (true));\n assert(isPalindrome((\"zbcd\")) == (false));\n assert(isPalindrome((\"xywyx\")) == (true));\n assert(isPalindrome((\"xywyz\")) == (false));\n assert(isPalindrome((\"xywzx\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // xs represent coefficients of a polynomial.\n // xs[0] + xs[1] * x + xs[2] * x^2 + ....\n // Return derivative of this polynomial in the same form.\n // >>> derivative((List[Long](3l.toLong, 1l.toLong, 2l.toLong, 4l.toLong, 5l.toLong)))\n // (List[Long](1l.toLong, 4l.toLong, 12l.toLong, 20l.toLong))\n // >>> derivative((List[Long](1l.toLong, 2l.toLong, 3l.toLong)))\n // (List[Long](2l.toLong, 6l.toLong))\n def derivative(xs : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(derivative((List[Long](3l.toLong, 1l.toLong, 2l.toLong, 4l.toLong, 5l.toLong))).equals((List[Long](1l.toLong, 4l.toLong, 12l.toLong, 20l.toLong))));\n assert(derivative((List[Long](1l.toLong, 2l.toLong, 3l.toLong))).equals((List[Long](2l.toLong, 6l.toLong))));\n assert(derivative((List[Long](3l.toLong, 2l.toLong, 1l.toLong))).equals((List[Long](2l.toLong, 2l.toLong))));\n assert(derivative((List[Long](3l.toLong, 2l.toLong, 1l.toLong, 0l.toLong, 4l.toLong))).equals((List[Long](2l.toLong, 2l.toLong, 0l.toLong, 16l.toLong))));\n assert(derivative((List[Long](1l.toLong))).equals((List[Long]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // In this task, you will be given a string that represents a number of apples and oranges \n // that are distributed in a basket of fruit this basket contains \n // apples, oranges, and mango fruits. Given the string that represents the total number of \n // the oranges and apples and an integer that represent the total number of the fruits \n // in the basket return the number of the mango fruits in the basket.\n // for examble:\n // >>> fruitDistribution((\"5 apples and 6 oranges\"), (19l))\n // (8l)\n // >>> fruitDistribution((\"0 apples and 1 oranges\"), (3l))\n // (2l)\n // >>> fruitDistribution((\"2 apples and 3 oranges\"), (100l))\n // (95l)\n // >>> fruitDistribution((\"100 apples and 1 oranges\"), (120l))\n // (19l)\n def fruitDistribution(s : String, n : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(fruitDistribution((\"5 apples and 6 oranges\"), (19l)) == (8l));\n assert(fruitDistribution((\"5 apples and 6 oranges\"), (21l)) == (10l));\n assert(fruitDistribution((\"0 apples and 1 oranges\"), (3l)) == (2l));\n assert(fruitDistribution((\"1 apples and 0 oranges\"), (3l)) == (2l));\n assert(fruitDistribution((\"2 apples and 3 oranges\"), (100l)) == (95l));\n assert(fruitDistribution((\"2 apples and 3 oranges\"), (5l)) == (0l));\n assert(fruitDistribution((\"1 apples and 100 oranges\"), (120l)) == (19l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that takes an integer a and returns True \n // if this ingeger is a cube of some integer number.\n // Note: you may assume the input is always valid.\n // Examples:\n // >>> iscube((1l))\n // (true)\n // >>> iscube((2l))\n // (false)\n // >>> iscube((-1l))\n // (true)\n // >>> iscube((64l))\n // (true)\n // >>> iscube((0l))\n // (true)\n // >>> iscube((180l))\n // (false)\n def iscube(a : Long) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(iscube((1l)) == (true));\n assert(iscube((2l)) == (false));\n assert(iscube((-1l)) == (true));\n assert(iscube((64l)) == (true));\n assert(iscube((180l)) == (false));\n assert(iscube((1000l)) == (true));\n assert(iscube((0l)) == (true));\n assert(iscube((1729l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // In this Kata, you have to sort an array of non-negative integers according to\n // number of ones in their binary representation in ascending order.\n // For similar number of ones, sort based on decimal value.\n // It must be implemented like this:\n // >>> sortArray((List[Long](1l.toLong, 5l.toLong, 2l.toLong, 3l.toLong, 4l.toLong)))\n // (List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong))\n // >>> sortArray((List[Long](-2l.toLong, -3l.toLong, -4l.toLong, -5l.toLong, -6l.toLong)))\n // (List[Long](-6l.toLong, -5l.toLong, -4l.toLong, -3l.toLong, -2l.toLong))\n // >>> sortArray((List[Long](1l.toLong, 0l.toLong, 2l.toLong, 3l.toLong, 4l.toLong)))\n // (List[Long](0l.toLong, 1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))\n def sortArray(arr : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sortArray((List[Long](1l.toLong, 5l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((List[Long](1l.toLong, 2l.toLong, 4l.toLong, 3l.toLong, 5l.toLong))));\n assert(sortArray((List[Long](-2l.toLong, -3l.toLong, -4l.toLong, -5l.toLong, -6l.toLong))).equals((List[Long](-4l.toLong, -2l.toLong, -6l.toLong, -5l.toLong, -3l.toLong))));\n assert(sortArray((List[Long](1l.toLong, 0l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((List[Long](0l.toLong, 1l.toLong, 2l.toLong, 4l.toLong, 3l.toLong))));\n assert(sortArray((List[Long]())).equals((List[Long]())));\n assert(sortArray((List[Long](2l.toLong, 5l.toLong, 77l.toLong, 4l.toLong, 5l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((List[Long](2l.toLong, 2l.toLong, 4l.toLong, 4l.toLong, 3l.toLong, 3l.toLong, 5l.toLong, 5l.toLong, 5l.toLong, 7l.toLong, 77l.toLong))));\n assert(sortArray((List[Long](3l.toLong, 6l.toLong, 44l.toLong, 12l.toLong, 32l.toLong, 5l.toLong))).equals((List[Long](32l.toLong, 3l.toLong, 5l.toLong, 6l.toLong, 12l.toLong, 44l.toLong))));\n assert(sortArray((List[Long](2l.toLong, 4l.toLong, 8l.toLong, 16l.toLong, 32l.toLong))).equals((List[Long](2l.toLong, 4l.toLong, 8l.toLong, 16l.toLong, 32l.toLong))));\n assert(sortArray((List[Long](2l.toLong, 4l.toLong, 8l.toLong, 16l.toLong, 32l.toLong))).equals((List[Long](2l.toLong, 4l.toLong, 8l.toLong, 16l.toLong, 32l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a list of strings, where each string consists of only digits, return a list.\n // Each element i of the output should be \"the number of odd elements in the\n // string i of the input.\" where all the i's should be replaced by the number\n // of odd digits in the i'th string of the input.\n // >>> oddCount((List[String](\"1234567\")))\n // (List[String](\"the number of odd elements 4n the str4ng 4 of the 4nput.\"))\n // >>> oddCount((List[String](\"3\", \"11111111\")))\n // (List[String](\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\"))\n def oddCount(lst : List[String]) : List[String] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(oddCount((List[String](\"1234567\"))).equals((List[String](\"the number of odd elements 4n the str4ng 4 of the 4nput.\"))));\n assert(oddCount((List[String](\"3\", \"11111111\"))).equals((List[String](\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\"))));\n assert(oddCount((List[String](\"271\", \"137\", \"314\"))).equals((List[String](\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // brackets is a string of \"(\" and \")\".\n // return True if every opening bracket has a corresponding closing bracket.\n // >>> correctBracketing((\"(\"))\n // (false)\n // >>> correctBracketing((\"()\"))\n // (true)\n // >>> correctBracketing((\"(()())\"))\n // (true)\n // >>> correctBracketing((\")(()\"))\n // (false)\n def correctBracketing(brackets : String) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(correctBracketing((\"()\")) == (true));\n assert(correctBracketing((\"(()())\")) == (true));\n assert(correctBracketing((\"()()(()())()\")) == (true));\n assert(correctBracketing((\"()()((()()())())(()()(()))\")) == (true));\n assert(correctBracketing((\"((()())))\")) == (false));\n assert(correctBracketing((\")(()\")) == (false));\n assert(correctBracketing((\"(\")) == (false));\n assert(correctBracketing((\"((((\")) == (false));\n assert(correctBracketing((\")\")) == (false));\n assert(correctBracketing((\"(()\")) == (false));\n assert(correctBracketing((\"()()(()())())(()\")) == (false));\n assert(correctBracketing((\"()()(()())()))()\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Task\n // Write a function that takes a string as input and returns the sum of the upper characters only'\n // ASCII codes.\n // Examples:\n // >>> digitSum((\"\"))\n // (0l)\n // >>> digitSum((\"abAB\"))\n // (131l)\n // >>> digitSum((\"abcCd\"))\n // (67l)\n // >>> digitSum((\"helloE\"))\n // (69l)\n // >>> digitSum((\"woArBld\"))\n // (131l)\n // >>> digitSum((\"aAaaaXa\"))\n // (153l)\n def digitSum(s : String) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(digitSum((\"\")) == (0l));\n assert(digitSum((\"abAB\")) == (131l));\n assert(digitSum((\"abcCd\")) == (67l));\n assert(digitSum((\"helloE\")) == (69l));\n assert(digitSum((\"woArBld\")) == (131l));\n assert(digitSum((\"aAaaaXa\")) == (153l));\n assert(digitSum((\" How are yOu?\")) == (151l));\n assert(digitSum((\"You arE Very Smart\")) == (327l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that accepts a list of strings as a parameter,\n // deletes the strings that have odd lengths from it,\n // and returns the resulted list with a sorted order,\n // The list is always a list of strings and never an array of numbers,\n // and it may contain duplicates.\n // The order of the list should be ascending by length of each word, and you\n // should return the list sorted by that rule.\n // If two words have the same length, sort the list alphabetically.\n // The function should return a list of strings in sorted order.\n // You may assume that all words will have the same length.\n // For example:\n // >>> listSort((List[String](\"aa\", \"a\", \"aaa\")))\n // (List[String](\"aa\"))\n // >>> listSort((List[String](\"ab\", \"a\", \"aaa\", \"cd\")))\n // (List[String](\"ab\", \"cd\"))\n def sortedListSum(lst : List[String]) : List[String] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sortedListSum((List[String](\"aa\", \"a\", \"aaa\"))).equals((List[String](\"aa\"))));\n assert(sortedListSum((List[String](\"school\", \"AI\", \"asdf\", \"b\"))).equals((List[String](\"AI\", \"asdf\", \"school\"))));\n assert(sortedListSum((List[String](\"d\", \"b\", \"c\", \"a\"))).equals((List[String]())));\n assert(sortedListSum((List[String](\"d\", \"dcba\", \"abcd\", \"a\"))).equals((List[String](\"abcd\", \"dcba\"))));\n assert(sortedListSum((List[String](\"AI\", \"ai\", \"au\"))).equals((List[String](\"AI\", \"ai\", \"au\"))));\n assert(sortedListSum((List[String](\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"))).equals((List[String]())));\n assert(sortedListSum((List[String](\"aaaa\", \"bbbb\", \"dd\", \"cc\"))).equals((List[String](\"cc\", \"dd\", \"aaaa\", \"bbbb\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given an array arr of integers and you need to return\n // sum of magnitudes of integers multiplied by product of all signs\n // of each number in the array, represented by 1, -1 or 0.\n // Note: return None for empty arr.\n // Example:\n // >>> prodSigns((List[Long](1l.toLong, 2l.toLong, 2l.toLong, -4l.toLong)))\n // 9l\n // >>> prodSigns((List[Long](0l.toLong, 1l.toLong)))\n // 0l\n // >>> prodSigns((List[Long]()))\n // None\n def prodSigns(arr : List[Long]) : Option[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(prodSigns((List[Long](1l.toLong, 2l.toLong, 2l.toLong, -4l.toLong))).equals(-9l));\n assert(prodSigns((List[Long](0l.toLong, 1l.toLong))).equals(0l));\n assert(prodSigns((List[Long](1l.toLong, 1l.toLong, 1l.toLong, 2l.toLong, 3l.toLong, -1l.toLong, 1l.toLong))).equals(-10l));\n assert(prodSigns((List[Long]())).equals(None));\n assert(prodSigns((List[Long](2l.toLong, 4l.toLong, 1l.toLong, 2l.toLong, -1l.toLong, -1l.toLong, 9l.toLong))).equals(20l));\n assert(prodSigns((List[Long](-1l.toLong, 1l.toLong, -1l.toLong, 1l.toLong))).equals(4l));\n assert(prodSigns((List[Long](-1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))).equals(-4l));\n assert(prodSigns((List[Long](-1l.toLong, 1l.toLong, 1l.toLong, 0l.toLong))).equals(0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return list with elements incremented by 1.\n // >>> incrList((List[Long](1l.toLong, 2l.toLong, 3l.toLong)))\n // (List[Long](2l.toLong, 3l.toLong, 4l.toLong))\n // >>> incrList((List[Long](5l.toLong, 3l.toLong, 5l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 9l.toLong, 0l.toLong, 123l.toLong)))\n // (List[Long](6l.toLong, 4l.toLong, 6l.toLong, 3l.toLong, 4l.toLong, 4l.toLong, 10l.toLong, 1l.toLong, 124l.toLong))\n def incrList(l : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(incrList((List[Long]())).equals((List[Long]())));\n assert(incrList((List[Long](3l.toLong, 2l.toLong, 1l.toLong))).equals((List[Long](4l.toLong, 3l.toLong, 2l.toLong))));\n assert(incrList((List[Long](5l.toLong, 2l.toLong, 5l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 9l.toLong, 0l.toLong, 123l.toLong))).equals((List[Long](6l.toLong, 3l.toLong, 6l.toLong, 3l.toLong, 4l.toLong, 4l.toLong, 10l.toLong, 1l.toLong, 124l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // From a given list of integers, generate a list of rolling maximum element found until given moment\n // in the sequence.\n // >>> rollingMax((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 2l.toLong)))\n // (List[Long](1l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 3l.toLong, 4l.toLong, 4l.toLong))\n def rollingMax(numbers : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(rollingMax((List[Long]())).equals((List[Long]())));\n assert(rollingMax((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))));\n assert(rollingMax((List[Long](4l.toLong, 3l.toLong, 2l.toLong, 1l.toLong))).equals((List[Long](4l.toLong, 4l.toLong, 4l.toLong, 4l.toLong))));\n assert(rollingMax((List[Long](3l.toLong, 2l.toLong, 3l.toLong, 100l.toLong, 3l.toLong))).equals((List[Long](3l.toLong, 3l.toLong, 3l.toLong, 100l.toLong, 100l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n // separate those group into separate strings and return the list of those.\n // Separate groups are balanced (each open brace is properly closed) and not nested within each other\n // Ignore any spaces in the input string.\n // >>> separateParenGroups((\"( ) (( )) (( )( ))\"))\n // (List[String](\"()\", \"(())\", \"(()())\"))\n def separateParenGroups(paren_string : String) : List[String] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(separateParenGroups((\"(()()) ((())) () ((())()())\")).equals((List[String](\"(()())\", \"((()))\", \"()\", \"((())()())\"))));\n assert(separateParenGroups((\"() (()) ((())) (((())))\")).equals((List[String](\"()\", \"(())\", \"((()))\", \"(((())))\"))));\n assert(separateParenGroups((\"(()(())((())))\")).equals((List[String](\"(()(())((())))\"))));\n assert(separateParenGroups((\"( ) (( )) (( )( ))\")).equals((List[String](\"()\", \"(())\", \"(()())\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You will be given a string of words separated by commas or spaces. Your task is\n // to split the string into words and return an array of the words.\n // For example:\n // >>> wordsString((\"Hi, my name is John\"))\n // (List[String](\"Hi\", \"my\", \"name\", \"is\", \"John\"))\n // >>> wordsString((\"One, two, three, four, five, six\"))\n // (List[String](\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"))\n def wordsString(s : String) : List[String] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(wordsString((\"Hi, my name is John\")).equals((List[String](\"Hi\", \"my\", \"name\", \"is\", \"John\"))));\n assert(wordsString((\"One, two, three, four, five, six\")).equals((List[String](\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"))));\n assert(wordsString((\"Hi, my name\")).equals((List[String](\"Hi\", \"my\", \"name\"))));\n assert(wordsString((\"One,, two, three, four, five, six,\")).equals((List[String](\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"))));\n assert(wordsString((\"\")).equals((List[String]())));\n assert(wordsString((\"ahmed , gamal\")).equals((List[String](\"ahmed\", \"gamal\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Filter given list of any python values only for integers\n // >>> filterIntegers((List[Any](\"a\", 3.14f, 5l)))\n // (List[Long](5l.toLong))\n // >>> filterIntegers((List[Any](1l, 2l, 3l, \"abc\", Map[Long,Long](), List[Long]())))\n // (List[Long](1l.toLong, 2l.toLong, 3l.toLong))\n def filterIntegers(values : List[Any]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(filterIntegers((List[Any]())).equals((List[Long]())));\n assert(filterIntegers((List[Any](4l, Map[Long,Long](), List[Long](), 23.2f, 9l, \"adasd\"))).equals((List[Long](4l.toLong, 9l.toLong))));\n assert(filterIntegers((List[Any](3l, \"c\", 3l, 3l, \"a\", \"b\"))).equals((List[Long](3l.toLong, 3l.toLong, 3l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // This function takes a list l and returns a list l' such that\n // l' is identical to l in the odd indicies, while its values at the even indicies are equal\n // to the values of the even indicies of l, but sorted.\n // >>> sortEven((List[Long](1l.toLong, 2l.toLong, 3l.toLong)))\n // (List[Long](1l.toLong, 2l.toLong, 3l.toLong))\n // >>> sortEven((List[Long](5l.toLong, 6l.toLong, 3l.toLong, 4l.toLong)))\n // (List[Long](3l.toLong, 6l.toLong, 5l.toLong, 4l.toLong))\n def sortEven(l : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sortEven((List[Long](1l.toLong, 2l.toLong, 3l.toLong))).equals((List[Long](1l.toLong, 2l.toLong, 3l.toLong))));\n assert(sortEven((List[Long](5l.toLong, 3l.toLong, -5l.toLong, 2l.toLong, -3l.toLong, 3l.toLong, 9l.toLong, 0l.toLong, 123l.toLong, 1l.toLong, -10l.toLong))).equals((List[Long](-10l.toLong, 3l.toLong, -5l.toLong, 2l.toLong, -3l.toLong, 3l.toLong, 5l.toLong, 0l.toLong, 9l.toLong, 1l.toLong, 123l.toLong))));\n assert(sortEven((List[Long](5l.toLong, 8l.toLong, -12l.toLong, 4l.toLong, 23l.toLong, 2l.toLong, 3l.toLong, 11l.toLong, 12l.toLong, -10l.toLong))).equals((List[Long](-12l.toLong, 8l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 2l.toLong, 12l.toLong, 11l.toLong, 23l.toLong, -10l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // I think we all remember that feeling when the result of some long-awaited\n // event is finally known. The feelings and thoughts you have at that moment are\n // definitely worth noting down and comparing.\n // Your task is to determine if a person correctly guessed the results of a number of matches.\n // You are given two arrays of scores and guesses of equal length, where each index shows a match. \n // Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n // the value is 0, and if not, the value is the absolute difference between the guess and the score.\n // example:\n // >>> compare((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 1l.toLong)), (List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 2l.toLong, -2l.toLong)))\n // (List[Long](0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 3l.toLong, 3l.toLong))\n // >>> compare((List[Long](0l.toLong, 5l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 4l.toLong)), (List[Long](4l.toLong, 1l.toLong, 1l.toLong, 0l.toLong, 0l.toLong, -2l.toLong)))\n // (List[Long](4l.toLong, 4l.toLong, 1l.toLong, 0l.toLong, 0l.toLong, 6l.toLong))\n def compare(game : List[Long], guess : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(compare((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 1l.toLong)), (List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 2l.toLong, -2l.toLong))).equals((List[Long](0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 3l.toLong, 3l.toLong))));\n assert(compare((List[Long](0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong)), (List[Long](0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong))).equals((List[Long](0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong))));\n assert(compare((List[Long](1l.toLong, 2l.toLong, 3l.toLong)), (List[Long](-1l.toLong, -2l.toLong, -3l.toLong))).equals((List[Long](2l.toLong, 4l.toLong, 6l.toLong))));\n assert(compare((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 5l.toLong)), (List[Long](-1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((List[Long](2l.toLong, 0l.toLong, 0l.toLong, 1l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a positive integer n, return a tuple that has the number of even and odd\n // integer palindromes that fall within the range(1, n), inclusive.\n // Example 1:\n // >>> evenOddPalindrome((3l))\n // ((1l, 2l))\n // Explanation:\n // Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n // Example 2:\n // >>> evenOddPalindrome((12l))\n // ((4l, 6l))\n // Explanation:\n // Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n // Note:\n // 1. 1 <= n <= 10^3\n // 2. returned tuple has the number of even and odd integer palindromes respectively.\n def evenOddPalindrome(n : Long) : Tuple2[Long, Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(evenOddPalindrome((123l)).equals(((8l, 13l))));\n assert(evenOddPalindrome((12l)).equals(((4l, 6l))));\n assert(evenOddPalindrome((3l)).equals(((1l, 2l))));\n assert(evenOddPalindrome((63l)).equals(((6l, 8l))));\n assert(evenOddPalindrome((25l)).equals(((5l, 6l))));\n assert(evenOddPalindrome((19l)).equals(((4l, 6l))));\n assert(evenOddPalindrome((9l)).equals(((4l, 5l))));\n assert(evenOddPalindrome((1l)).equals(((0l, 1l))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n // fib4(0) -> 0\n // fib4(1) -> 0\n // fib4(2) -> 2\n // fib4(3) -> 0\n // fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n // Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n // >>> fib4((5l))\n // (4l)\n // >>> fib4((6l))\n // (8l)\n // >>> fib4((7l))\n // (14l)\n def fib4(n : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(fib4((5l)) == (4l));\n assert(fib4((8l)) == (28l));\n assert(fib4((10l)) == (104l));\n assert(fib4((12l)) == (386l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given two positive integers a and b, return the even digits between a\n // and b, in ascending order.\n // For example:\n // >>> generateIntegers((2l), (8l))\n // (List[Long](2l.toLong, 4l.toLong, 6l.toLong, 8l.toLong))\n // >>> generateIntegers((8l), (2l))\n // (List[Long](2l.toLong, 4l.toLong, 6l.toLong, 8l.toLong))\n // >>> generateIntegers((10l), (14l))\n // (List[Long]())\n def generateIntegers(a : Long, b : Long) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(generateIntegers((2l), (10l)).equals((List[Long](2l.toLong, 4l.toLong, 6l.toLong, 8l.toLong))));\n assert(generateIntegers((10l), (2l)).equals((List[Long](2l.toLong, 4l.toLong, 6l.toLong, 8l.toLong))));\n assert(generateIntegers((132l), (2l)).equals((List[Long](2l.toLong, 4l.toLong, 6l.toLong, 8l.toLong))));\n assert(generateIntegers((17l), (89l)).equals((List[Long]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // For a given list of input numbers, calculate Mean Absolute Deviation\n // around the mean of this dataset.\n // Mean Absolute Deviation is the average absolute difference between each\n // element and a centerpoint (mean in this case):\n // MAD = average | x - x_mean |\n // >>> meanAbsoluteDeviation((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat)))\n // (1.0f)\n def meanAbsoluteDeviation(numbers : List[Float]) : Float = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(meanAbsoluteDeviation((List[Float](1.0f.toFloat, 2.0f.toFloat))) == (0.5f));\n assert(meanAbsoluteDeviation((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat))) == (1.0f));\n assert(meanAbsoluteDeviation((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat, 5.0f.toFloat))) == (1.2f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function encrypt that takes a string as an argument and\n // returns a string encrypted with the alphabet being rotated. \n // The alphabet should be rotated in a manner such that the letters \n // shift down by two multiplied to two places.\n // For example:\n // >>> encrypt((\"hi\"))\n // (\"lm\")\n // >>> encrypt((\"asdfghjkl\"))\n // (\"ewhjklnop\")\n // >>> encrypt((\"gf\"))\n // (\"kj\")\n // >>> encrypt((\"et\"))\n // (\"ix\")\n def encrypt(s : String) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(encrypt((\"hi\")).equals((\"lm\")));\n assert(encrypt((\"asdfghjkl\")).equals((\"ewhjklnop\")));\n assert(encrypt((\"gf\")).equals((\"kj\")));\n assert(encrypt((\"et\")).equals((\"ix\")));\n assert(encrypt((\"faewfawefaewg\")).equals((\"jeiajeaijeiak\")));\n assert(encrypt((\"hellomyfriend\")).equals((\"lippsqcjvmirh\")));\n assert(encrypt((\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\")).equals((\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\")));\n assert(encrypt((\"a\")).equals((\"e\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n // The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n // as follows: start with any positive integer n. Then each term is obtained from the \n // previous term as follows: if the previous term is even, the next term is one half of \n // the previous term. If the previous term is odd, the next term is 3 times the previous\n // term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n // Note: \n // 1. Collatz(1) is [1].\n // 2. returned list sorted in increasing order.\n // For example:\n // get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n // >>> getOddCollatz((5l))\n // (List[Long](1l.toLong, 5l.toLong))\n def getOddCollatz(n : Long) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(getOddCollatz((14l)).equals((List[Long](1l.toLong, 5l.toLong, 7l.toLong, 11l.toLong, 13l.toLong, 17l.toLong))));\n assert(getOddCollatz((5l)).equals((List[Long](1l.toLong, 5l.toLong))));\n assert(getOddCollatz((12l)).equals((List[Long](1l.toLong, 3l.toLong, 5l.toLong))));\n assert(getOddCollatz((1l)).equals((List[Long](1l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Find how many times a given substring can be found in the original string. Count overlaping cases.\n // >>> howManyTimes((\"\"), (\"a\"))\n // (0l)\n // >>> howManyTimes((\"aaa\"), (\"a\"))\n // (3l)\n // >>> howManyTimes((\"aaaa\"), (\"aa\"))\n // (3l)\n def howManyTimes(string : String, substring : String) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(howManyTimes((\"\"), (\"x\")) == (0l));\n assert(howManyTimes((\"xyxyxyx\"), (\"x\")) == (4l));\n assert(howManyTimes((\"cacacacac\"), (\"cac\")) == (4l));\n assert(howManyTimes((\"john doe\"), (\"john\")) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n // numbers in the array will be randomly ordered. Your task is to determine if\n // it is possible to get an array sorted in non-decreasing order by performing \n // the following operation on the given array:\n // You are allowed to perform right shift operation any number of times.\n // One right shift operation means shifting all elements of the array by one\n // position in the right direction. The last element of the array will be moved to\n // the starting position in the array i.e. 0th index. \n // If it is possible to obtain the sorted array by performing the above operation\n // then return True else return False.\n // If the given array is empty then return True.\n // Note: The given list is guaranteed to have unique elements.\n // For Example:\n // >>> moveOneBall((List[Long](3l.toLong, 4l.toLong, 5l.toLong, 1l.toLong, 2l.toLong)))\n // (true)\n // Explanation: By performin 2 right shift operations, non-decreasing order can\n // be achieved for the given array.\n // >>> moveOneBall((List[Long](3l.toLong, 5l.toLong, 4l.toLong, 1l.toLong, 2l.toLong)))\n // (false)\n // Explanation:It is not possible to get non-decreasing order for the given\n // array by performing any number of right shift operations.\n def moveOneBall(arr : List[Long]) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(moveOneBall((List[Long](3l.toLong, 4l.toLong, 5l.toLong, 1l.toLong, 2l.toLong))) == (true));\n assert(moveOneBall((List[Long](3l.toLong, 5l.toLong, 10l.toLong, 1l.toLong, 2l.toLong))) == (true));\n assert(moveOneBall((List[Long](4l.toLong, 3l.toLong, 1l.toLong, 2l.toLong))) == (false));\n assert(moveOneBall((List[Long](3l.toLong, 5l.toLong, 4l.toLong, 1l.toLong, 2l.toLong))) == (false));\n assert(moveOneBall((List[Long]())) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function which sorts the given list of integers\n // in ascending order according to the sum of their digits.\n // Note: if there are several items with similar sum of their digits,\n // order them based on their index in original list.\n // For example:\n // >>> orderByPoints((List[Long](1l.toLong, 11l.toLong, -1l.toLong, -11l.toLong, -12l.toLong)))\n // (List[Long](-1l.toLong, -11l.toLong, 1l.toLong, -12l.toLong, 11l.toLong))\n // >>> orderByPoints((List[Long]()))\n // (List[Long]())\n def orderByPoints(nums : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(orderByPoints((List[Long](1l.toLong, 11l.toLong, -1l.toLong, -11l.toLong, -12l.toLong))).equals((List[Long](-1l.toLong, -11l.toLong, 1l.toLong, -12l.toLong, 11l.toLong))));\n assert(orderByPoints((List[Long](1234l.toLong, 423l.toLong, 463l.toLong, 145l.toLong, 2l.toLong, 423l.toLong, 423l.toLong, 53l.toLong, 6l.toLong, 37l.toLong, 3457l.toLong, 3l.toLong, 56l.toLong, 0l.toLong, 46l.toLong))).equals((List[Long](0l.toLong, 2l.toLong, 3l.toLong, 6l.toLong, 53l.toLong, 423l.toLong, 423l.toLong, 423l.toLong, 1234l.toLong, 145l.toLong, 37l.toLong, 46l.toLong, 56l.toLong, 463l.toLong, 3457l.toLong))));\n assert(orderByPoints((List[Long]())).equals((List[Long]())));\n assert(orderByPoints((List[Long](1l.toLong, -11l.toLong, -32l.toLong, 43l.toLong, 54l.toLong, -98l.toLong, 2l.toLong, -3l.toLong))).equals((List[Long](-3l.toLong, -32l.toLong, -98l.toLong, -11l.toLong, 1l.toLong, 2l.toLong, 43l.toLong, 54l.toLong))));\n assert(orderByPoints((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong, 9l.toLong, 10l.toLong, 11l.toLong))).equals((List[Long](1l.toLong, 10l.toLong, 2l.toLong, 11l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong, 9l.toLong))));\n assert(orderByPoints((List[Long](0l.toLong, 6l.toLong, 6l.toLong, -76l.toLong, -21l.toLong, 23l.toLong, 4l.toLong))).equals((List[Long](-76l.toLong, -21l.toLong, 0l.toLong, 4l.toLong, 23l.toLong, 6l.toLong, 6l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return list of prime factors of given integer in the order from smallest to largest.\n // Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n // Input number should be equal to the product of all factors\n // >>> factorize((8l))\n // (List[Long](2l.toLong, 2l.toLong, 2l.toLong))\n // >>> factorize((25l))\n // (List[Long](5l.toLong, 5l.toLong))\n // >>> factorize((70l))\n // (List[Long](2l.toLong, 5l.toLong, 7l.toLong))\n def factorize(n : Long) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(factorize((2l)).equals((List[Long](2l.toLong))));\n assert(factorize((4l)).equals((List[Long](2l.toLong, 2l.toLong))));\n assert(factorize((8l)).equals((List[Long](2l.toLong, 2l.toLong, 2l.toLong))));\n assert(factorize((57l)).equals((List[Long](3l.toLong, 19l.toLong))));\n assert(factorize((3249l)).equals((List[Long](3l.toLong, 3l.toLong, 19l.toLong, 19l.toLong))));\n assert(factorize((185193l)).equals((List[Long](3l.toLong, 3l.toLong, 3l.toLong, 19l.toLong, 19l.toLong, 19l.toLong))));\n assert(factorize((20577l)).equals((List[Long](3l.toLong, 19l.toLong, 19l.toLong, 19l.toLong))));\n assert(factorize((18l)).equals((List[Long](2l.toLong, 3l.toLong, 3l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return True if all numbers in the list l are below threshold t.\n // >>> belowThreshold((List[Long](1l.toLong, 2l.toLong, 4l.toLong, 10l.toLong)), (100l))\n // (true)\n // >>> belowThreshold((List[Long](1l.toLong, 20l.toLong, 4l.toLong, 10l.toLong)), (5l))\n // (false)\n def belowThreshold(l : List[Long], t : Long) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(belowThreshold((List[Long](1l.toLong, 2l.toLong, 4l.toLong, 10l.toLong)), (100l)) == (true));\n assert(belowThreshold((List[Long](1l.toLong, 20l.toLong, 4l.toLong, 10l.toLong)), (5l)) == (false));\n assert(belowThreshold((List[Long](1l.toLong, 20l.toLong, 4l.toLong, 10l.toLong)), (21l)) == (true));\n assert(belowThreshold((List[Long](1l.toLong, 20l.toLong, 4l.toLong, 10l.toLong)), (22l)) == (true));\n assert(belowThreshold((List[Long](1l.toLong, 8l.toLong, 4l.toLong, 10l.toLong)), (11l)) == (true));\n assert(belowThreshold((List[Long](1l.toLong, 8l.toLong, 4l.toLong, 10l.toLong)), (10l)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given two positive integers n and m, and your task is to compute the\n // average of the integers from n through m (including n and m). \n // Round the answer to the nearest integer and convert that to binary.\n // If n is greater than m, return -1.\n // Example:\n // >>> roundedAvg((1l), (5l))\n // \"0b11\"\n // >>> roundedAvg((7l), (5l))\n // -1l\n // >>> roundedAvg((10l), (20l))\n // \"0b1111\"\n // >>> roundedAvg((20l), (33l))\n // \"0b11010\"\n def roundedAvg(n : Long, m : Long) : Either[String, Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(roundedAvg((1l), (5l)).equals(\"0b11\"));\n assert(roundedAvg((7l), (13l)).equals(\"0b1010\"));\n assert(roundedAvg((964l), (977l)).equals(\"0b1111001010\"));\n assert(roundedAvg((996l), (997l)).equals(\"0b1111100100\"));\n assert(roundedAvg((560l), (851l)).equals(\"0b1011000010\"));\n assert(roundedAvg((185l), (546l)).equals(\"0b101101110\"));\n assert(roundedAvg((362l), (496l)).equals(\"0b110101101\"));\n assert(roundedAvg((350l), (902l)).equals(\"0b1001110010\"));\n assert(roundedAvg((197l), (233l)).equals(\"0b11010111\"));\n assert(roundedAvg((7l), (5l)).equals(-1l));\n assert(roundedAvg((5l), (1l)).equals(-1l));\n assert(roundedAvg((5l), (5l)).equals(\"0b101\"));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n // For each of the group, output the deepest level of nesting of parentheses.\n // E.g. (()()) has maximum two levels of nesting while ((())) has three.\n // >>> parseNestedParens((\"(()()) ((())) () ((())()())\"))\n // (List[Long](2l.toLong, 3l.toLong, 1l.toLong, 3l.toLong))\n def parseNestedParens(paren_string : String) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(parseNestedParens((\"(()()) ((())) () ((())()())\")).equals((List[Long](2l.toLong, 3l.toLong, 1l.toLong, 3l.toLong))));\n assert(parseNestedParens((\"() (()) ((())) (((())))\")).equals((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))));\n assert(parseNestedParens((\"(()(())((())))\")).equals((List[Long](4l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n // Examples\n // >>> solution((List[Long](5l.toLong, 8l.toLong, 7l.toLong, 1l.toLong)))\n // (12l)\n // >>> solution((List[Long](3l.toLong, 3l.toLong, 3l.toLong, 3l.toLong, 3l.toLong)))\n // (9l)\n // >>> solution((List[Long](30l.toLong, 13l.toLong, 24l.toLong, 321l.toLong)))\n // (0l)\n def solution(lst : List[Long]) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(solution((List[Long](5l.toLong, 8l.toLong, 7l.toLong, 1l.toLong))) == (12l));\n assert(solution((List[Long](3l.toLong, 3l.toLong, 3l.toLong, 3l.toLong, 3l.toLong))) == (9l));\n assert(solution((List[Long](30l.toLong, 13l.toLong, 24l.toLong, 321l.toLong))) == (0l));\n assert(solution((List[Long](5l.toLong, 9l.toLong))) == (5l));\n assert(solution((List[Long](2l.toLong, 4l.toLong, 8l.toLong))) == (0l));\n assert(solution((List[Long](30l.toLong, 13l.toLong, 23l.toLong, 32l.toLong))) == (23l));\n assert(solution((List[Long](3l.toLong, 13l.toLong, 2l.toLong, 9l.toLong))) == (3l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a positive integer n. You have to create an integer array a of length n.\n // For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n // Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n // and a[i] + a[j] + a[k] is a multiple of 3.\n // Example :\n // >>> getMaxTriples((5l))\n // (1l)\n // Explanation: \n // a = [1, 3, 7, 13, 21]\n // The only valid triple is (1, 7, 13).\n def getMaxTriples(n : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(getMaxTriples((5l)) == (1l));\n assert(getMaxTriples((6l)) == (4l));\n assert(getMaxTriples((10l)) == (36l));\n assert(getMaxTriples((100l)) == (53361l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // There are eight planets in our solar system: the closerst to the Sun \n // is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n // Uranus, Neptune.\n // Write a function that takes two planet names as strings planet1 and planet2. \n // The function should return a tuple containing all planets whose orbits are \n // located between the orbit of planet1 and the orbit of planet2, sorted by \n // the proximity to the sun. \n // The function should return an empty tuple if planet1 or planet2\n // are not correct planet names. \n // Examples\n // >>> bf((\"Jupiter\"), (\"Neptune\"))\n // (List[String](\"Saturn\", \"Uranus\"))\n // >>> bf((\"Earth\"), (\"Mercury\"))\n // (List[String](\"Venus\"))\n // >>> bf((\"Mercury\"), (\"Uranus\"))\n // (List[String](\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"))\n def bf(planet1 : String, planet2 : String) : List[String] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(bf((\"Jupiter\"), (\"Neptune\")).equals((List[String](\"Saturn\", \"Uranus\"))));\n assert(bf((\"Earth\"), (\"Mercury\")).equals((List[String](\"Venus\"))));\n assert(bf((\"Mercury\"), (\"Uranus\")).equals((List[String](\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"))));\n assert(bf((\"Neptune\"), (\"Venus\")).equals((List[String](\"Earth\", \"Mars\", \"Jupiter\", \"Saturn\", \"Uranus\"))));\n assert(bf((\"Earth\"), (\"Earth\")).equals((List[String]())));\n assert(bf((\"Mars\"), (\"Earth\")).equals((List[String]())));\n assert(bf((\"Jupiter\"), (\"Makemake\")).equals((List[String]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a list of integers.\n // Write a function next_smallest() that returns the 2nd smallest element of the list.\n // Return None if there is no such element.\n // >>> nextSmallest((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong)))\n // 2l\n // >>> nextSmallest((List[Long](5l.toLong, 1l.toLong, 4l.toLong, 3l.toLong, 2l.toLong)))\n // 2l\n // >>> nextSmallest((List[Long]()))\n // None\n // >>> nextSmallest((List[Long](1l.toLong, 1l.toLong)))\n // None\n def nextSmallest(lst : List[Long]) : Option[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(nextSmallest((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong))).equals(2l));\n assert(nextSmallest((List[Long](5l.toLong, 1l.toLong, 4l.toLong, 3l.toLong, 2l.toLong))).equals(2l));\n assert(nextSmallest((List[Long]())).equals(None));\n assert(nextSmallest((List[Long](1l.toLong, 1l.toLong))).equals(None));\n assert(nextSmallest((List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong, 0l.toLong))).equals(1l));\n assert(nextSmallest((List[Long](1l.toLong, 1l.toLong))).equals(None));\n assert(nextSmallest((List[Long](-35l.toLong, 34l.toLong, 12l.toLong, -45l.toLong))).equals(-35l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Input is a space-delimited string of numberals from 'zero' to 'nine'.\n // Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n // Return the string with numbers sorted from smallest to largest\n // >>> sortNumbers((\"three one five\"))\n // (\"one three five\")\n def sortNumbers(numbers : String) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sortNumbers((\"\")).equals((\"\")));\n assert(sortNumbers((\"three\")).equals((\"three\")));\n assert(sortNumbers((\"three five nine\")).equals((\"three five nine\")));\n assert(sortNumbers((\"five zero four seven nine eight\")).equals((\"zero four five seven eight nine\")));\n assert(sortNumbers((\"six five four three two one zero\")).equals((\"zero one two three four five six\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n // >>> cycpatternCheck((\"abcd\"), (\"abd\"))\n // (false)\n // >>> cycpatternCheck((\"hello\"), (\"ell\"))\n // (true)\n // >>> cycpatternCheck((\"whassup\"), (\"psus\"))\n // (false)\n // >>> cycpatternCheck((\"abab\"), (\"baa\"))\n // (true)\n // >>> cycpatternCheck((\"efef\"), (\"eeff\"))\n // (false)\n // >>> cycpatternCheck((\"himenss\"), (\"simen\"))\n // (true)\n def cycpatternCheck(a : String, b : String) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(cycpatternCheck((\"xyzw\"), (\"xyw\")) == (false));\n assert(cycpatternCheck((\"yello\"), (\"ell\")) == (true));\n assert(cycpatternCheck((\"whattup\"), (\"ptut\")) == (false));\n assert(cycpatternCheck((\"efef\"), (\"fee\")) == (true));\n assert(cycpatternCheck((\"abab\"), (\"aabb\")) == (false));\n assert(cycpatternCheck((\"winemtt\"), (\"tinem\")) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You will be given a number in decimal form and your task is to convert it to\n // binary format. The function should return a string, with each character representing a binary\n // number. Each character in the string will be '0' or '1'.\n // There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n // The extra characters are there to help with the format.\n // Examples:\n // >>> decimalToBinary((15l))\n // (\"db1111db\")\n // >>> decimalToBinary((32l))\n // (\"db100000db\")\n def decimalToBinary(decimal : Long) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(decimalToBinary((0l)).equals((\"db0db\")));\n assert(decimalToBinary((32l)).equals((\"db100000db\")));\n assert(decimalToBinary((103l)).equals((\"db1100111db\")));\n assert(decimalToBinary((15l)).equals((\"db1111db\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Filter an input list of strings only for ones that contain given substring\n // >>> filterBySubstring((List[String]()), (\"a\"))\n // (List[String]())\n // >>> filterBySubstring((List[String](\"abc\", \"bacd\", \"cde\", \"array\")), (\"a\"))\n // (List[String](\"abc\", \"bacd\", \"array\"))\n def filterBySubstring(strings : List[String], substring : String) : List[String] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(filterBySubstring((List[String]()), (\"john\")).equals((List[String]())));\n assert(filterBySubstring((List[String](\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\")), (\"xxx\")).equals((List[String](\"xxx\", \"xxxAAA\", \"xxx\"))));\n assert(filterBySubstring((List[String](\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\")), (\"xx\")).equals((List[String](\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"))));\n assert(filterBySubstring((List[String](\"grunt\", \"trumpet\", \"prune\", \"gruesome\")), (\"run\")).equals((List[String](\"grunt\", \"prune\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given an integer. return a tuple that has the number of even and odd digits respectively.\n // Example:\n // >>> evenOddCount((-12l))\n // ((1l, 1l))\n // >>> evenOddCount((123l))\n // ((1l, 2l))\n def evenOddCount(num : Long) : Tuple2[Long, Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(evenOddCount((7l)).equals(((0l, 1l))));\n assert(evenOddCount((-78l)).equals(((1l, 1l))));\n assert(evenOddCount((3452l)).equals(((2l, 2l))));\n assert(evenOddCount((346211l)).equals(((3l, 3l))));\n assert(evenOddCount((-345821l)).equals(((3l, 3l))));\n assert(evenOddCount((-2l)).equals(((1l, 0l))));\n assert(evenOddCount((-45347l)).equals(((2l, 3l))));\n assert(evenOddCount((0l)).equals(((1l, 0l))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that accepts a list of strings.\n // The list contains different words. Return the word with maximum number\n // of unique characters. If multiple strings have maximum number of unique\n // characters, return the one which comes first in lexicographical order.\n // >>> findMax((List[String](\"name\", \"of\", \"string\")))\n // (\"string\")\n // >>> findMax((List[String](\"name\", \"enam\", \"game\")))\n // (\"enam\")\n // >>> findMax((List[String](\"aaaaaaa\", \"bb\", \"cc\")))\n // (\"aaaaaaa\")\n def findMax(words : List[String]) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(findMax((List[String](\"name\", \"of\", \"string\"))).equals((\"string\")));\n assert(findMax((List[String](\"name\", \"enam\", \"game\"))).equals((\"enam\")));\n assert(findMax((List[String](\"aaaaaaa\", \"bb\", \"cc\"))).equals((\"aaaaaaa\")));\n assert(findMax((List[String](\"abc\", \"cba\"))).equals((\"abc\")));\n assert(findMax((List[String](\"play\", \"this\", \"game\", \"of\", \"footbott\"))).equals((\"footbott\")));\n assert(findMax((List[String](\"we\", \"are\", \"gonna\", \"rock\"))).equals((\"gonna\")));\n assert(findMax((List[String](\"we\", \"are\", \"a\", \"mad\", \"nation\"))).equals((\"nation\")));\n assert(findMax((List[String](\"this\", \"is\", \"a\", \"prrk\"))).equals((\"this\")));\n assert(findMax((List[String](\"b\"))).equals((\"b\")));\n assert(findMax((List[String](\"play\", \"play\", \"play\"))).equals((\"play\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a positive integer n, return the count of the numbers of n-digit\n // positive integers that start or end with 1.\n def startsOneEnds(n : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(startsOneEnds((1l)) == (1l));\n assert(startsOneEnds((2l)) == (18l));\n assert(startsOneEnds((3l)) == (180l));\n assert(startsOneEnds((4l)) == (1800l));\n assert(startsOneEnds((5l)) == (18000l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function that returns a tuple (a, b), where 'a' is\n // the largest of negative integers, and 'b' is the smallest\n // of positive integers in a list.\n // If there is no negative or positive integers, return them as None.\n // Examples:\n // >>> largestSmallestIntegers((List[Long](2l.toLong, 4l.toLong, 1l.toLong, 3l.toLong, 5l.toLong, 7l.toLong)))\n // (Some(None), Some(1l))\n // >>> largestSmallestIntegers((List[Long]()))\n // (Some(None), Some(None))\n // >>> largestSmallestIntegers((List[Long](0l.toLong)))\n // (Some(None), Some(None))\n def largestSmallestIntegers(lst : List[Long]) : Tuple2[Option[Long], Option[Long]] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(largestSmallestIntegers((List[Long](2l.toLong, 4l.toLong, 1l.toLong, 3l.toLong, 5l.toLong, 7l.toLong))).equals((Some(None), Some(1l))));\n assert(largestSmallestIntegers((List[Long](2l.toLong, 4l.toLong, 1l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 0l.toLong))).equals((Some(None), Some(1l))));\n assert(largestSmallestIntegers((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 4l.toLong, 5l.toLong, 6l.toLong, -2l.toLong))).equals((-2l, 1l)));\n assert(largestSmallestIntegers((List[Long](4l.toLong, 5l.toLong, 3l.toLong, 6l.toLong, 2l.toLong, 7l.toLong, -7l.toLong))).equals((-7l, 2l)));\n assert(largestSmallestIntegers((List[Long](7l.toLong, 3l.toLong, 8l.toLong, 4l.toLong, 9l.toLong, 2l.toLong, 5l.toLong, -9l.toLong))).equals((-9l, 2l)));\n assert(largestSmallestIntegers((List[Long]())).equals((Some(None), Some(None))));\n assert(largestSmallestIntegers((List[Long](0l.toLong))).equals((Some(None), Some(None))));\n assert(largestSmallestIntegers((List[Long](-1l.toLong, -3l.toLong, -5l.toLong, -6l.toLong))).equals((Some(-1l), Some(None))));\n assert(largestSmallestIntegers((List[Long](-1l.toLong, -3l.toLong, -5l.toLong, -6l.toLong, 0l.toLong))).equals((Some(-1l), Some(None))));\n assert(largestSmallestIntegers((List[Long](-6l.toLong, -4l.toLong, -4l.toLong, -3l.toLong, 1l.toLong))).equals((-3l, 1l)));\n assert(largestSmallestIntegers((List[Long](-6l.toLong, -4l.toLong, -4l.toLong, -3l.toLong, -100l.toLong, 1l.toLong))).equals((-3l, 1l)));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // \"Given an array representing a branch of a tree that has non-negative integer nodes\n // your task is to pluck one of the nodes and return it.\n // The plucked node should be the node with the smallest even value.\n // If multiple nodes with the same smallest even value are found return the node that has smallest index.\n // The plucked node should be returned in a list, [ smalest_value, its index ],\n // If there are no even values or the given array is empty, return [].\n // Example 1:\n // >>> pluck((List[Long](4l.toLong, 2l.toLong, 3l.toLong)))\n // (List[Long](2l.toLong, 1l.toLong))\n // Explanation: 2 has the smallest even value, and 2 has the smallest index.\n // Example 2:\n // >>> pluck((List[Long](1l.toLong, 2l.toLong, 3l.toLong)))\n // (List[Long](2l.toLong, 1l.toLong))\n // Explanation: 2 has the smallest even value, and 2 has the smallest index.\n // Example 3:\n // >>> pluck((List[Long]()))\n // (List[Long]())\n // Example 4:\n // >>> pluck((List[Long](5l.toLong, 0l.toLong, 3l.toLong, 0l.toLong, 4l.toLong, 2l.toLong)))\n // (List[Long](0l.toLong, 1l.toLong))\n // Explanation: 0 is the smallest value, but there are two zeros,\n // so we will choose the first zero, which has the smallest index.\n // Constraints:\n // * 1 <= nodes.length <= 10000\n // * 0 <= node.value\n def pluck(arr : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(pluck((List[Long](4l.toLong, 2l.toLong, 3l.toLong))).equals((List[Long](2l.toLong, 1l.toLong))));\n assert(pluck((List[Long](1l.toLong, 2l.toLong, 3l.toLong))).equals((List[Long](2l.toLong, 1l.toLong))));\n assert(pluck((List[Long]())).equals((List[Long]())));\n assert(pluck((List[Long](5l.toLong, 0l.toLong, 3l.toLong, 0l.toLong, 4l.toLong, 2l.toLong))).equals((List[Long](0l.toLong, 1l.toLong))));\n assert(pluck((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 0l.toLong, 5l.toLong, 3l.toLong))).equals((List[Long](0l.toLong, 3l.toLong))));\n assert(pluck((List[Long](5l.toLong, 4l.toLong, 8l.toLong, 4l.toLong, 8l.toLong))).equals((List[Long](4l.toLong, 1l.toLong))));\n assert(pluck((List[Long](7l.toLong, 6l.toLong, 7l.toLong, 1l.toLong))).equals((List[Long](6l.toLong, 1l.toLong))));\n assert(pluck((List[Long](7l.toLong, 9l.toLong, 7l.toLong, 1l.toLong))).equals((List[Long]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function count_nums which takes an array of integers and returns\n // the number of elements which has a sum of digits > 0.\n // If a number is negative, then its first signed digit will be negative:\n // e.g. -123 has signed digits -1, 2, and 3.\n // >>> countNums((List[Long]()))\n // (0l)\n // >>> countNums((List[Long](-1l.toLong, 11l.toLong, -11l.toLong)))\n // (1l)\n // >>> countNums((List[Long](1l.toLong, 1l.toLong, 2l.toLong)))\n // (3l)\n def countNums(arr : List[Long]) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(countNums((List[Long]())) == (0l));\n assert(countNums((List[Long](-1l.toLong, -2l.toLong, 0l.toLong))) == (0l));\n assert(countNums((List[Long](1l.toLong, 1l.toLong, 2l.toLong, -2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong))) == (6l));\n assert(countNums((List[Long](1l.toLong, 6l.toLong, 9l.toLong, -6l.toLong, 0l.toLong, 1l.toLong, 5l.toLong))) == (5l));\n assert(countNums((List[Long](1l.toLong, 100l.toLong, 98l.toLong, -7l.toLong, 1l.toLong, -1l.toLong))) == (4l));\n assert(countNums((List[Long](12l.toLong, 23l.toLong, 34l.toLong, -45l.toLong, -56l.toLong, 0l.toLong))) == (5l));\n assert(countNums((List[Long](0l.toLong, 1l.toLong))) == (1l));\n assert(countNums((List[Long](1l.toLong))) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n // each cell of the grid contains a value. Every integer in the range [1, N * N]\n // inclusive appears exactly once on the cells of the grid.\n // You have to find the minimum path of length k in the grid. You can start\n // from any cell, and in each step you can move to any of the neighbor cells,\n // in other words, you can go to cells which share an edge with you current\n // cell.\n // Please note that a path of length k means visiting exactly k cells (not\n // necessarily distinct).\n // You CANNOT go off the grid.\n // A path A (of length k) is considered less than a path B (of length k) if\n // after making the ordered lists of the values on the cells that A and B go\n // through (let's call them lst_A and lst_B), lst_A is lexicographically less\n // than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n // such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n // lst_A[j] = lst_B[j].\n // It is guaranteed that the answer is unique.\n // Return an ordered list of the values on the cells that the minimum path go through.\n // Examples: \n // >>> minPath((List[List[Long]](List[Long](1l.toLong, 2l.toLong, 3l.toLong), List[Long](4l.toLong, 5l.toLong, 6l.toLong), List[Long](7l.toLong, 8l.toLong, 9l.toLong))), (3l))\n // (List[Long](1l.toLong, 2l.toLong, 1l.toLong))\n // >>> minPath((List[List[Long]](List[Long](5l.toLong, 9l.toLong, 3l.toLong), List[Long](4l.toLong, 1l.toLong, 6l.toLong), List[Long](7l.toLong, 8l.toLong, 2l.toLong))), (1l))\n // (List[Long](1l.toLong))\n def minPath(grid : List[List[Long]], k : Long) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(minPath((List[List[Long]](List[Long](1l.toLong, 2l.toLong, 3l.toLong), List[Long](4l.toLong, 5l.toLong, 6l.toLong), List[Long](7l.toLong, 8l.toLong, 9l.toLong))), (3l)).equals((List[Long](1l.toLong, 2l.toLong, 1l.toLong))));\n assert(minPath((List[List[Long]](List[Long](5l.toLong, 9l.toLong, 3l.toLong), List[Long](4l.toLong, 1l.toLong, 6l.toLong), List[Long](7l.toLong, 8l.toLong, 2l.toLong))), (1l)).equals((List[Long](1l.toLong))));\n assert(minPath((List[List[Long]](List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong), List[Long](5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong), List[Long](9l.toLong, 10l.toLong, 11l.toLong, 12l.toLong), List[Long](13l.toLong, 14l.toLong, 15l.toLong, 16l.toLong))), (4l)).equals((List[Long](1l.toLong, 2l.toLong, 1l.toLong, 2l.toLong))));\n assert(minPath((List[List[Long]](List[Long](6l.toLong, 4l.toLong, 13l.toLong, 10l.toLong), List[Long](5l.toLong, 7l.toLong, 12l.toLong, 1l.toLong), List[Long](3l.toLong, 16l.toLong, 11l.toLong, 15l.toLong), List[Long](8l.toLong, 14l.toLong, 9l.toLong, 2l.toLong))), (7l)).equals((List[Long](1l.toLong, 10l.toLong, 1l.toLong, 10l.toLong, 1l.toLong, 10l.toLong, 1l.toLong))));\n assert(minPath((List[List[Long]](List[Long](8l.toLong, 14l.toLong, 9l.toLong, 2l.toLong), List[Long](6l.toLong, 4l.toLong, 13l.toLong, 15l.toLong), List[Long](5l.toLong, 7l.toLong, 1l.toLong, 12l.toLong), List[Long](3l.toLong, 10l.toLong, 11l.toLong, 16l.toLong))), (5l)).equals((List[Long](1l.toLong, 7l.toLong, 1l.toLong, 7l.toLong, 1l.toLong))));\n assert(minPath((List[List[Long]](List[Long](11l.toLong, 8l.toLong, 7l.toLong, 2l.toLong), List[Long](5l.toLong, 16l.toLong, 14l.toLong, 4l.toLong), List[Long](9l.toLong, 3l.toLong, 15l.toLong, 6l.toLong), List[Long](12l.toLong, 13l.toLong, 10l.toLong, 1l.toLong))), (9l)).equals((List[Long](1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong, 1l.toLong))));\n assert(minPath((List[List[Long]](List[Long](12l.toLong, 13l.toLong, 10l.toLong, 1l.toLong), List[Long](9l.toLong, 3l.toLong, 15l.toLong, 6l.toLong), List[Long](5l.toLong, 16l.toLong, 14l.toLong, 4l.toLong), List[Long](11l.toLong, 8l.toLong, 7l.toLong, 2l.toLong))), (12l)).equals((List[Long](1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong, 1l.toLong, 6l.toLong))));\n assert(minPath((List[List[Long]](List[Long](2l.toLong, 7l.toLong, 4l.toLong), List[Long](3l.toLong, 1l.toLong, 5l.toLong), List[Long](6l.toLong, 8l.toLong, 9l.toLong))), (8l)).equals((List[Long](1l.toLong, 3l.toLong, 1l.toLong, 3l.toLong, 1l.toLong, 3l.toLong, 1l.toLong, 3l.toLong))));\n assert(minPath((List[List[Long]](List[Long](6l.toLong, 1l.toLong, 5l.toLong), List[Long](3l.toLong, 8l.toLong, 9l.toLong), List[Long](2l.toLong, 7l.toLong, 4l.toLong))), (8l)).equals((List[Long](1l.toLong, 5l.toLong, 1l.toLong, 5l.toLong, 1l.toLong, 5l.toLong, 1l.toLong, 5l.toLong))));\n assert(minPath((List[List[Long]](List[Long](1l.toLong, 2l.toLong), List[Long](3l.toLong, 4l.toLong))), (10l)).equals((List[Long](1l.toLong, 2l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 2l.toLong))));\n assert(minPath((List[List[Long]](List[Long](1l.toLong, 3l.toLong), List[Long](3l.toLong, 2l.toLong))), (10l)).equals((List[Long](1l.toLong, 3l.toLong, 1l.toLong, 3l.toLong, 1l.toLong, 3l.toLong, 1l.toLong, 3l.toLong, 1l.toLong, 3l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given list of integers, return list in strange order.\n // Strange sorting, is when you start with the minimum value,\n // then maximum of the remaining integers, then minimum and so on.\n // Examples:\n // >>> strangeSortList((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong)))\n // (List[Long](1l.toLong, 4l.toLong, 2l.toLong, 3l.toLong))\n // >>> strangeSortList((List[Long](5l.toLong, 5l.toLong, 5l.toLong, 5l.toLong)))\n // (List[Long](5l.toLong, 5l.toLong, 5l.toLong, 5l.toLong))\n // >>> strangeSortList((List[Long]()))\n // (List[Long]())\n def strangeSortList(lst : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(strangeSortList((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))).equals((List[Long](1l.toLong, 4l.toLong, 2l.toLong, 3l.toLong))));\n assert(strangeSortList((List[Long](5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong, 9l.toLong))).equals((List[Long](5l.toLong, 9l.toLong, 6l.toLong, 8l.toLong, 7l.toLong))));\n assert(strangeSortList((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong))).equals((List[Long](1l.toLong, 5l.toLong, 2l.toLong, 4l.toLong, 3l.toLong))));\n assert(strangeSortList((List[Long](5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong, 9l.toLong, 1l.toLong))).equals((List[Long](1l.toLong, 9l.toLong, 5l.toLong, 8l.toLong, 6l.toLong, 7l.toLong))));\n assert(strangeSortList((List[Long](5l.toLong, 5l.toLong, 5l.toLong, 5l.toLong))).equals((List[Long](5l.toLong, 5l.toLong, 5l.toLong, 5l.toLong))));\n assert(strangeSortList((List[Long]())).equals((List[Long]())));\n assert(strangeSortList((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 8l.toLong))).equals((List[Long](1l.toLong, 8l.toLong, 2l.toLong, 7l.toLong, 3l.toLong, 6l.toLong, 4l.toLong, 5l.toLong))));\n assert(strangeSortList((List[Long](0l.toLong, 2l.toLong, 2l.toLong, 2l.toLong, 5l.toLong, 5l.toLong, -5l.toLong, -5l.toLong))).equals((List[Long](-5l.toLong, 5l.toLong, -5l.toLong, 5l.toLong, 0l.toLong, 2l.toLong, 2l.toLong, 2l.toLong))));\n assert(strangeSortList((List[Long](111111l.toLong))).equals((List[Long](111111l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a string 'text', return its md5 hash equivalent string.\n // If 'text' is an empty string, return None.\n // >>> stringToMd5((\"Hello world\"))\n // \"3e25960a79dbc69b674cd4ec67a72c62\"\n def stringToMd5(text : String) : Option[String] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(stringToMd5((\"Hello world\")).equals(\"3e25960a79dbc69b674cd4ec67a72c62\"));\n assert(stringToMd5((\"\")).equals(None));\n assert(stringToMd5((\"A B C\")).equals(\"0ef78513b0cb8cef12743f5aeb35f888\"));\n assert(stringToMd5((\"password\")).equals(\"5f4dcc3b5aa765d61d8327deb882cf99\"));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a word. Your task is to find the closest vowel that stands between \n // two consonants from the right side of the word (case sensitive).\n // Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n // find any vowel met the above condition. \n // You may assume that the given string contains English letter only.\n // Example:\n // >>> getClosestVowel((\"yogurt\"))\n // (\"u\")\n // >>> getClosestVowel((\"FULL\"))\n // (\"U\")\n // >>> getClosestVowel((\"quick\"))\n // (\"\")\n // >>> getClosestVowel((\"ab\"))\n // (\"\")\n def getClosestVowel(word : String) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(getClosestVowel((\"yogurt\")).equals((\"u\")));\n assert(getClosestVowel((\"full\")).equals((\"u\")));\n assert(getClosestVowel((\"easy\")).equals((\"\")));\n assert(getClosestVowel((\"eAsy\")).equals((\"\")));\n assert(getClosestVowel((\"ali\")).equals((\"\")));\n assert(getClosestVowel((\"bad\")).equals((\"a\")));\n assert(getClosestVowel((\"most\")).equals((\"o\")));\n assert(getClosestVowel((\"ab\")).equals((\"\")));\n assert(getClosestVowel((\"ba\")).equals((\"\")));\n assert(getClosestVowel((\"quick\")).equals((\"\")));\n assert(getClosestVowel((\"anime\")).equals((\"i\")));\n assert(getClosestVowel((\"Asia\")).equals((\"\")));\n assert(getClosestVowel((\"Above\")).equals((\"o\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Change numerical base of input number x to base.\n // return string representation after the conversion.\n // base numbers are less than 10.\n // >>> changeBase((8l), (3l))\n // (\"22\")\n // >>> changeBase((8l), (2l))\n // (\"1000\")\n // >>> changeBase((7l), (2l))\n // (\"111\")\n def changeBase(x : Long, base : Long) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(changeBase((8l), (3l)).equals((\"22\")));\n assert(changeBase((9l), (3l)).equals((\"100\")));\n assert(changeBase((234l), (2l)).equals((\"11101010\")));\n assert(changeBase((16l), (2l)).equals((\"10000\")));\n assert(changeBase((8l), (2l)).equals((\"1000\")));\n assert(changeBase((7l), (2l)).equals((\"111\")));\n assert(changeBase((2l), (3l)).equals((\"2\")));\n assert(changeBase((3l), (4l)).equals((\"3\")));\n assert(changeBase((4l), (5l)).equals((\"4\")));\n assert(changeBase((5l), (6l)).equals((\"5\")));\n assert(changeBase((6l), (7l)).equals((\"6\")));\n assert(changeBase((7l), (8l)).equals((\"7\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Check if in given list of numbers, are any two numbers closer to each other than\n // given threshold.\n // >>> hasCloseElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat)), (0.5f))\n // (false)\n // >>> hasCloseElements((List[Float](1.0f.toFloat, 2.8f.toFloat, 3.0f.toFloat, 4.0f.toFloat, 5.0f.toFloat, 2.0f.toFloat)), (0.3f))\n // (true)\n def hasCloseElements(numbers : List[Float], threshold : Float) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(hasCloseElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.9f.toFloat, 4.0f.toFloat, 5.0f.toFloat, 2.2f.toFloat)), (0.3f)) == (true));\n assert(hasCloseElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.9f.toFloat, 4.0f.toFloat, 5.0f.toFloat, 2.2f.toFloat)), (0.05f)) == (false));\n assert(hasCloseElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 5.9f.toFloat, 4.0f.toFloat, 5.0f.toFloat)), (0.95f)) == (true));\n assert(hasCloseElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 5.9f.toFloat, 4.0f.toFloat, 5.0f.toFloat)), (0.8f)) == (false));\n assert(hasCloseElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat, 5.0f.toFloat, 2.0f.toFloat)), (0.1f)) == (true));\n assert(hasCloseElements((List[Float](1.1f.toFloat, 2.2f.toFloat, 3.1f.toFloat, 4.1f.toFloat, 5.1f.toFloat)), (1.0f)) == (true));\n assert(hasCloseElements((List[Float](1.1f.toFloat, 2.2f.toFloat, 3.1f.toFloat, 4.1f.toFloat, 5.1f.toFloat)), (0.5f)) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function that takes a string as input which contains only square brackets.\n // The function should return True if and only if there is a valid subsequence of brackets \n // where at least one bracket in the subsequence is nested.\n // >>> isNested((\"[[]]\"))\n // (true)\n // >>> isNested((\"[]]]]]]][[[[[]\"))\n // (false)\n // >>> isNested((\"[][]\"))\n // (false)\n // >>> isNested((\"[]\"))\n // (false)\n // >>> isNested((\"[[][]]\"))\n // (true)\n // >>> isNested((\"[[]][[\"))\n // (true)\n def isNested(string : String) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(isNested((\"[[]]\")) == (true));\n assert(isNested((\"[]]]]]]][[[[[]\")) == (false));\n assert(isNested((\"[][]\")) == (false));\n assert(isNested((\"[]\")) == (false));\n assert(isNested((\"[[[[]]]]\")) == (true));\n assert(isNested((\"[]]]]]]]]]]\")) == (false));\n assert(isNested((\"[][][[]]\")) == (true));\n assert(isNested((\"[[]\")) == (false));\n assert(isNested((\"[]]\")) == (false));\n assert(isNested((\"[[]][[\")) == (true));\n assert(isNested((\"[[][]]\")) == (true));\n assert(isNested((\"\")) == (false));\n assert(isNested((\"[[[[[[[[\")) == (false));\n assert(isNested((\"]]]]]]]]\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Concatenate list of strings into a single string\n // >>> concatenate((List[String]()))\n // (\"\")\n // >>> concatenate((List[String](\"a\", \"b\", \"c\")))\n // (\"abc\")\n def concatenate(strings : List[String]) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(concatenate((List[String]())).equals((\"\")));\n assert(concatenate((List[String](\"x\", \"y\", \"z\"))).equals((\"xyz\")));\n assert(concatenate((List[String](\"x\", \"y\", \"z\", \"w\", \"k\"))).equals((\"xyzwk\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n // >>> primeFib((1l))\n // (2l)\n // >>> primeFib((2l))\n // (3l)\n // >>> primeFib((3l))\n // (5l)\n // >>> primeFib((4l))\n // (13l)\n // >>> primeFib((5l))\n // (89l)\n def primeFib(n : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(primeFib((1l)) == (2l));\n assert(primeFib((2l)) == (3l));\n assert(primeFib((3l)) == (5l));\n assert(primeFib((4l)) == (13l));\n assert(primeFib((5l)) == (89l));\n assert(primeFib((6l)) == (233l));\n assert(primeFib((7l)) == (1597l));\n assert(primeFib((8l)) == (28657l));\n assert(primeFib((9l)) == (514229l));\n assert(primeFib((10l)) == (433494437l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n // other and return them in order (smaller number, larger number).\n // >>> findClosestElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat, 5.0f.toFloat, 2.2f.toFloat)))\n // ((2.0f, 2.2f))\n // >>> findClosestElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat, 5.0f.toFloat, 2.0f.toFloat)))\n // ((2.0f, 2.0f))\n def findClosestElements(numbers : List[Float]) : Tuple2[Float, Float] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(findClosestElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.9f.toFloat, 4.0f.toFloat, 5.0f.toFloat, 2.2f.toFloat))).equals(((3.9f, 4.0f))));\n assert(findClosestElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 5.9f.toFloat, 4.0f.toFloat, 5.0f.toFloat))).equals(((5.0f, 5.9f))));\n assert(findClosestElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat, 5.0f.toFloat, 2.2f.toFloat))).equals(((2.0f, 2.2f))));\n assert(findClosestElements((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat, 5.0f.toFloat, 2.0f.toFloat))).equals(((2.0f, 2.0f))));\n assert(findClosestElements((List[Float](1.1f.toFloat, 2.2f.toFloat, 3.1f.toFloat, 4.1f.toFloat, 5.1f.toFloat))).equals(((2.2f, 3.1f))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You have been tasked to write a function that receives \n // a hexadecimal number as a string and counts the number of hexadecimal \n // digits that are primes (prime number, or a prime, is a natural number \n // greater than 1 that is not a product of two smaller natural numbers).\n // Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n // Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n // So you have to determine a number of the following digits: 2, 3, 5, 7, \n // B (=decimal 11), D (=decimal 13).\n // Note: you may assume the input is always correct or empty string, \n // and symbols A,B,C,D,E,F are always uppercase.\n // Examples:\n // >>> hexKey((\"AB\"))\n // (1l)\n // >>> hexKey((\"1077E\"))\n // (2l)\n // >>> hexKey((\"ABED1A33\"))\n // (4l)\n // >>> hexKey((\"123456789ABCDEF0\"))\n // (6l)\n // >>> hexKey((\"2020\"))\n // (2l)\n def hexKey(num : String) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(hexKey((\"AB\")) == (1l));\n assert(hexKey((\"1077E\")) == (2l));\n assert(hexKey((\"ABED1A33\")) == (4l));\n assert(hexKey((\"2020\")) == (2l));\n assert(hexKey((\"123456789ABCDEF0\")) == (6l));\n assert(hexKey((\"112233445566778899AABBCCDDEEFF00\")) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Complete the function that takes two integers and returns \n // the product of their unit digits.\n // Assume the input is always valid.\n // Examples:\n // >>> multiply((148l), (412l))\n // (16l)\n // >>> multiply((19l), (28l))\n // (72l)\n // >>> multiply((2020l), (1851l))\n // (0l)\n // >>> multiply((14l), (-15l))\n // (20l)\n def multiply(a : Long, b : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(multiply((148l), (412l)) == (16l));\n assert(multiply((19l), (28l)) == (72l));\n assert(multiply((2020l), (1851l)) == (0l));\n assert(multiply((14l), (-15l)) == (20l));\n assert(multiply((76l), (67l)) == (42l));\n assert(multiply((17l), (27l)) == (49l));\n assert(multiply((0l), (1l)) == (0l));\n assert(multiply((0l), (0l)) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given list of numbers (of at least two elements), apply a linear transform to that list,\n // such that the smallest number will become 0 and the largest will become 1\n // >>> rescaleToUnit((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat, 5.0f.toFloat)))\n // (List[Float](0.0f.toFloat, 0.25f.toFloat, 0.5f.toFloat, 0.75f.toFloat, 1.0f.toFloat))\n def rescaleToUnit(numbers : List[Float]) : List[Float] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(rescaleToUnit((List[Float](2.0f.toFloat, 49.9f.toFloat))).equals((List[Float](0.0f.toFloat, 1.0f.toFloat))));\n assert(rescaleToUnit((List[Float](100.0f.toFloat, 49.9f.toFloat))).equals((List[Float](1.0f.toFloat, 0.0f.toFloat))));\n assert(rescaleToUnit((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat, 5.0f.toFloat))).equals((List[Float](0.0f.toFloat, 0.25f.toFloat, 0.5f.toFloat, 0.75f.toFloat, 1.0f.toFloat))));\n assert(rescaleToUnit((List[Float](2.0f.toFloat, 1.0f.toFloat, 5.0f.toFloat, 3.0f.toFloat, 4.0f.toFloat))).equals((List[Float](0.25f.toFloat, 0.0f.toFloat, 1.0f.toFloat, 0.5f.toFloat, 0.75f.toFloat))));\n assert(rescaleToUnit((List[Float](12.0f.toFloat, 11.0f.toFloat, 15.0f.toFloat, 13.0f.toFloat, 14.0f.toFloat))).equals((List[Float](0.25f.toFloat, 0.0f.toFloat, 1.0f.toFloat, 0.5f.toFloat, 0.75f.toFloat))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a positive integer n, return the product of the odd digits.\n // Return 0 if all digits are even.\n // For example:\n // >>> digits((1l))\n // (1l)\n // >>> digits((4l))\n // (0l)\n // >>> digits((235l))\n // (15l)\n def digits(n : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(digits((5l)) == (5l));\n assert(digits((54l)) == (5l));\n assert(digits((120l)) == (1l));\n assert(digits((5014l)) == (5l));\n assert(digits((98765l)) == (315l));\n assert(digits((5576543l)) == (2625l));\n assert(digits((2468l)) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You will be given the name of a class (a string) and a list of extensions.\n // The extensions are to be used to load additional classes to the class. The\n // strength of the extension is as follows: Let CAP be the number of the uppercase\n // letters in the extension's name, and let SM be the number of lowercase letters \n // in the extension's name, the strength is given by the fraction CAP - SM. \n // You should find the strongest extension and return a string in this \n // format: ClassName.StrongestExtensionName.\n // If there are two or more extensions with the same strength, you should\n // choose the one that comes first in the list.\n // For example, if you are given \"Slices\" as the class and a list of the\n // extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n // return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n // (its strength is -1).\n // Example:\n // >>> StrongestExtension((\"my_class\"), (List[String](\"AA\", \"Be\", \"CC\")))\n // (\"my_class.AA\")\n def StrongestExtension(class_name : String, extensions : List[String]) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(StrongestExtension((\"Watashi\"), (List[String](\"tEN\", \"niNE\", \"eIGHt8OKe\"))).equals((\"Watashi.eIGHt8OKe\")));\n assert(StrongestExtension((\"Boku123\"), (List[String](\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"))).equals((\"Boku123.YEs.WeCaNe\")));\n assert(StrongestExtension((\"__YESIMHERE\"), (List[String](\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"))).equals((\"__YESIMHERE.NuLl__\")));\n assert(StrongestExtension((\"K\"), (List[String](\"Ta\", \"TAR\", \"t234An\", \"cosSo\"))).equals((\"K.TAR\")));\n assert(StrongestExtension((\"__HAHA\"), (List[String](\"Tab\", \"123\", \"781345\", \"-_-\"))).equals((\"__HAHA.123\")));\n assert(StrongestExtension((\"YameRore\"), (List[String](\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"))).equals((\"YameRore.okIWILL123\")));\n assert(StrongestExtension((\"finNNalLLly\"), (List[String](\"Die\", \"NowW\", \"Wow\", \"WoW\"))).equals((\"finNNalLLly.WoW\")));\n assert(StrongestExtension((\"_\"), (List[String](\"Bb\", \"91245\"))).equals((\"_.Bb\")));\n assert(StrongestExtension((\"Sp\"), (List[String](\"671235\", \"Bb\"))).equals((\"Sp.671235\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a string representing a space separated lowercase letters, return a dictionary\n // of the letter with the most repetition and containing the corresponding count.\n // If several letters have the same occurrence, return all of them.\n // Example:\n // >>> histogram((\"a b c\"))\n // (Map[String,Long](\"a\" -> 1l, \"b\" -> 1l, \"c\" -> 1l))\n // >>> histogram((\"a b b a\"))\n // (Map[String,Long](\"a\" -> 2l, \"b\" -> 2l))\n // >>> histogram((\"a b c a b\"))\n // (Map[String,Long](\"a\" -> 2l, \"b\" -> 2l))\n // >>> histogram((\"b b b b a\"))\n // (Map[String,Long](\"b\" -> 4l))\n // >>> histogram((\"\"))\n // (Map[String,Long]())\n def histogram(test : String) : Map[String,Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(histogram((\"a b b a\")).equals((Map[String,Long](\"a\" -> 2l, \"b\" -> 2l))));\n assert(histogram((\"a b c a b\")).equals((Map[String,Long](\"a\" -> 2l, \"b\" -> 2l))));\n assert(histogram((\"a b c d g\")).equals((Map[String,Long](\"a\" -> 1l, \"b\" -> 1l, \"c\" -> 1l, \"d\" -> 1l, \"g\" -> 1l))));\n assert(histogram((\"r t g\")).equals((Map[String,Long](\"r\" -> 1l, \"t\" -> 1l, \"g\" -> 1l))));\n assert(histogram((\"b b b b a\")).equals((Map[String,Long](\"b\" -> 4l))));\n assert(histogram((\"r t g\")).equals((Map[String,Long](\"r\" -> 1l, \"t\" -> 1l, \"g\" -> 1l))));\n assert(histogram((\"\")).equals((Map[String,Long]())));\n assert(histogram((\"a\")).equals((Map[String,Long](\"a\" -> 1l))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // pairs_sum_to_zero takes a list of integers as an input.\n // it returns True if there are two distinct elements in the list that\n // sum to zero, and False otherwise.\n // >>> pairsSumToZero((List[Long](1l.toLong, 3l.toLong, 5l.toLong, 0l.toLong)))\n // (false)\n // >>> pairsSumToZero((List[Long](1l.toLong, 3l.toLong, -2l.toLong, 1l.toLong)))\n // (false)\n // >>> pairsSumToZero((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 7l.toLong)))\n // (false)\n // >>> pairsSumToZero((List[Long](2l.toLong, 4l.toLong, -5l.toLong, 3l.toLong, 5l.toLong, 7l.toLong)))\n // (true)\n // >>> pairsSumToZero((List[Long](1l.toLong)))\n // (false)\n def pairsSumToZero(l : List[Long]) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(pairsSumToZero((List[Long](1l.toLong, 3l.toLong, 5l.toLong, 0l.toLong))) == (false));\n assert(pairsSumToZero((List[Long](1l.toLong, 3l.toLong, -2l.toLong, 1l.toLong))) == (false));\n assert(pairsSumToZero((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 7l.toLong))) == (false));\n assert(pairsSumToZero((List[Long](2l.toLong, 4l.toLong, -5l.toLong, 3l.toLong, 5l.toLong, 7l.toLong))) == (true));\n assert(pairsSumToZero((List[Long](1l.toLong))) == (false));\n assert(pairsSumToZero((List[Long](-3l.toLong, 9l.toLong, -1l.toLong, 3l.toLong, 2l.toLong, 30l.toLong))) == (true));\n assert(pairsSumToZero((List[Long](-3l.toLong, 9l.toLong, -1l.toLong, 3l.toLong, 2l.toLong, 31l.toLong))) == (true));\n assert(pairsSumToZero((List[Long](-3l.toLong, 9l.toLong, -1l.toLong, 4l.toLong, 2l.toLong, 30l.toLong))) == (false));\n assert(pairsSumToZero((List[Long](-3l.toLong, 9l.toLong, -1l.toLong, 4l.toLong, 2l.toLong, 31l.toLong))) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that accepts two lists of strings and returns the list that has \n // total number of chars in the all strings of the list less than the other list.\n // if the two lists have the same number of chars, return the first list.\n // Examples\n // >>> totalMatch((List[String]()), (List[String]()))\n // (List[String]())\n // >>> totalMatch((List[String](\"hi\", \"admin\")), (List[String](\"hI\", \"Hi\")))\n // (List[String](\"hI\", \"Hi\"))\n // >>> totalMatch((List[String](\"hi\", \"admin\")), (List[String](\"hi\", \"hi\", \"admin\", \"project\")))\n // (List[String](\"hi\", \"admin\"))\n // >>> totalMatch((List[String](\"hi\", \"admin\")), (List[String](\"hI\", \"hi\", \"hi\")))\n // (List[String](\"hI\", \"hi\", \"hi\"))\n // >>> totalMatch((List[String](\"4\")), (List[String](\"1\", \"2\", \"3\", \"4\", \"5\")))\n // (List[String](\"4\"))\n def totalMatch(lst1 : List[String], lst2 : List[String]) : List[String] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(totalMatch((List[String]()), (List[String]())).equals((List[String]())));\n assert(totalMatch((List[String](\"hi\", \"admin\")), (List[String](\"hi\", \"hi\"))).equals((List[String](\"hi\", \"hi\"))));\n assert(totalMatch((List[String](\"hi\", \"admin\")), (List[String](\"hi\", \"hi\", \"admin\", \"project\"))).equals((List[String](\"hi\", \"admin\"))));\n assert(totalMatch((List[String](\"4\")), (List[String](\"1\", \"2\", \"3\", \"4\", \"5\"))).equals((List[String](\"4\"))));\n assert(totalMatch((List[String](\"hi\", \"admin\")), (List[String](\"hI\", \"Hi\"))).equals((List[String](\"hI\", \"Hi\"))));\n assert(totalMatch((List[String](\"hi\", \"admin\")), (List[String](\"hI\", \"hi\", \"hi\"))).equals((List[String](\"hI\", \"hi\", \"hi\"))));\n assert(totalMatch((List[String](\"hi\", \"admin\")), (List[String](\"hI\", \"hi\", \"hii\"))).equals((List[String](\"hi\", \"admin\"))));\n assert(totalMatch((List[String]()), (List[String](\"this\"))).equals((List[String]())));\n assert(totalMatch((List[String](\"this\")), (List[String]())).equals((List[String]())));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Circular shift the digits of the integer x, shift the digits right by shift\n // and return the result as a string.\n // If shift > number of digits, return digits reversed.\n // >>> circularShift((12l), (1l))\n // (\"21\")\n // >>> circularShift((12l), (2l))\n // (\"12\")\n def circularShift(x : Long, shift : Long) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(circularShift((100l), (2l)).equals((\"001\")));\n assert(circularShift((12l), (2l)).equals((\"12\")));\n assert(circularShift((97l), (8l)).equals((\"79\")));\n assert(circularShift((12l), (1l)).equals((\"21\")));\n assert(circularShift((11l), (101l)).equals((\"11\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return True is list elements are monotonically increasing or decreasing.\n // >>> monotonic((List[Long](1l.toLong, 2l.toLong, 4l.toLong, 20l.toLong)))\n // (true)\n // >>> monotonic((List[Long](1l.toLong, 20l.toLong, 4l.toLong, 10l.toLong)))\n // (false)\n // >>> monotonic((List[Long](4l.toLong, 1l.toLong, 0l.toLong, -10l.toLong)))\n // (true)\n def monotonic(l : List[Long]) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(monotonic((List[Long](1l.toLong, 2l.toLong, 4l.toLong, 10l.toLong))) == (true));\n assert(monotonic((List[Long](1l.toLong, 2l.toLong, 4l.toLong, 20l.toLong))) == (true));\n assert(monotonic((List[Long](1l.toLong, 20l.toLong, 4l.toLong, 10l.toLong))) == (false));\n assert(monotonic((List[Long](4l.toLong, 1l.toLong, 0l.toLong, -10l.toLong))) == (true));\n assert(monotonic((List[Long](4l.toLong, 1l.toLong, 1l.toLong, 0l.toLong))) == (true));\n assert(monotonic((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 2l.toLong, 5l.toLong, 60l.toLong))) == (false));\n assert(monotonic((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 60l.toLong))) == (true));\n assert(monotonic((List[Long](9l.toLong, 9l.toLong, 9l.toLong, 9l.toLong))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n // Example\n // >>> isEqualToSumEven((4l))\n // (false)\n // >>> isEqualToSumEven((6l))\n // (false)\n // >>> isEqualToSumEven((8l))\n // (true)\n def isEqualToSumEven(n : Long) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(isEqualToSumEven((4l)) == (false));\n assert(isEqualToSumEven((6l)) == (false));\n assert(isEqualToSumEven((8l)) == (true));\n assert(isEqualToSumEven((10l)) == (true));\n assert(isEqualToSumEven((11l)) == (false));\n assert(isEqualToSumEven((12l)) == (true));\n assert(isEqualToSumEven((13l)) == (false));\n assert(isEqualToSumEven((16l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Input to this function is a string representing musical notes in a special ASCII format.\n // Your task is to parse this string and return list of integers corresponding to how many beats does each\n // not last.\n // Here is a legend:\n // 'o' - whole note, lasts four beats\n // 'o|' - half note, lasts two beats\n // '.|' - quater note, lasts one beat\n // >>> parseMusic((\"o o| .| o| o| .| .| .| .| o o\"))\n // (List[Long](4l.toLong, 2l.toLong, 1l.toLong, 2l.toLong, 2l.toLong, 1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong, 4l.toLong, 4l.toLong))\n def parseMusic(music_string : String) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(parseMusic((\"\")).equals((List[Long]())));\n assert(parseMusic((\"o o o o\")).equals((List[Long](4l.toLong, 4l.toLong, 4l.toLong, 4l.toLong))));\n assert(parseMusic((\".| .| .| .|\")).equals((List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))));\n assert(parseMusic((\"o| o| .| .| o o o o\")).equals((List[Long](2l.toLong, 2l.toLong, 1l.toLong, 1l.toLong, 4l.toLong, 4l.toLong, 4l.toLong, 4l.toLong))));\n assert(parseMusic((\"o| .| o| .| o o| o o|\")).equals((List[Long](2l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 4l.toLong, 2l.toLong, 4l.toLong, 2l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // \"\n // This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n // multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n // change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n // Examples:\n // >>> lst\n // List[Long](1l.toLong, 2l.toLong, 3l.toLong)\n // >>> lst\n // List[Long]()\n // >>> lst\n // List[Long](-1l.toLong, -5l.toLong, 2l.toLong, -1l.toLong, -5l.toLong)\n def sumSquares(lst : List[Long]) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sumSquares((List[Long](1l.toLong, 2l.toLong, 3l.toLong))) == (6l));\n assert(sumSquares((List[Long](1l.toLong, 4l.toLong, 9l.toLong))) == (14l));\n assert(sumSquares((List[Long]())) == (0l));\n assert(sumSquares((List[Long](1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong, 1l.toLong))) == (9l));\n assert(sumSquares((List[Long](-1l.toLong, -1l.toLong, -1l.toLong, -1l.toLong, -1l.toLong, -1l.toLong, -1l.toLong, -1l.toLong, -1l.toLong))) == (-3l));\n assert(sumSquares((List[Long](0l.toLong))) == (0l));\n assert(sumSquares((List[Long](-1l.toLong, -5l.toLong, 2l.toLong, -1l.toLong, -5l.toLong))) == (-126l));\n assert(sumSquares((List[Long](-56l.toLong, -99l.toLong, 1l.toLong, 0l.toLong, -2l.toLong))) == (3030l));\n assert(sumSquares((List[Long](-1l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, 0l.toLong, -1l.toLong))) == (0l));\n assert(sumSquares((List[Long](-16l.toLong, -9l.toLong, -2l.toLong, 36l.toLong, 36l.toLong, 26l.toLong, -20l.toLong, 25l.toLong, -40l.toLong, 20l.toLong, -4l.toLong, 12l.toLong, -26l.toLong, 35l.toLong, 37l.toLong))) == (-14196l));\n assert(sumSquares((List[Long](-1l.toLong, -3l.toLong, 17l.toLong, -1l.toLong, -15l.toLong, 13l.toLong, -1l.toLong, 14l.toLong, -14l.toLong, -12l.toLong, -5l.toLong, 14l.toLong, -14l.toLong, 6l.toLong, 13l.toLong, 11l.toLong, 16l.toLong, 16l.toLong, 4l.toLong, 10l.toLong))) == (-1448l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // triples_sum_to_zero takes a list of integers as an input.\n // it returns True if there are three distinct elements in the list that\n // sum to zero, and False otherwise.\n // >>> triplesSumToZero((List[Long](1l.toLong, 3l.toLong, 5l.toLong, 0l.toLong)))\n // (false)\n // >>> triplesSumToZero((List[Long](1l.toLong, 3l.toLong, -2l.toLong, 1l.toLong)))\n // (true)\n // >>> triplesSumToZero((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 7l.toLong)))\n // (false)\n // >>> triplesSumToZero((List[Long](2l.toLong, 4l.toLong, -5l.toLong, 3l.toLong, 9l.toLong, 7l.toLong)))\n // (true)\n // >>> triplesSumToZero((List[Long](1l.toLong)))\n // (false)\n def triplesSumToZero(l : List[Long]) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(triplesSumToZero((List[Long](1l.toLong, 3l.toLong, 5l.toLong, 0l.toLong))) == (false));\n assert(triplesSumToZero((List[Long](1l.toLong, 3l.toLong, 5l.toLong, -1l.toLong))) == (false));\n assert(triplesSumToZero((List[Long](1l.toLong, 3l.toLong, -2l.toLong, 1l.toLong))) == (true));\n assert(triplesSumToZero((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 7l.toLong))) == (false));\n assert(triplesSumToZero((List[Long](1l.toLong, 2l.toLong, 5l.toLong, 7l.toLong))) == (false));\n assert(triplesSumToZero((List[Long](2l.toLong, 4l.toLong, -5l.toLong, 3l.toLong, 9l.toLong, 7l.toLong))) == (true));\n assert(triplesSumToZero((List[Long](1l.toLong))) == (false));\n assert(triplesSumToZero((List[Long](1l.toLong, 3l.toLong, 5l.toLong, -100l.toLong))) == (false));\n assert(triplesSumToZero((List[Long](100l.toLong, 3l.toLong, 5l.toLong, -100l.toLong))) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // brackets is a string of \"<\" and \">\".\n // return True if every opening bracket has a corresponding closing bracket.\n // >>> correctBracketing((\"<\"))\n // (false)\n // >>> correctBracketing((\"<>\"))\n // (true)\n // >>> correctBracketing((\"<<><>>\"))\n // (true)\n // >>> correctBracketing((\"><<>\"))\n // (false)\n def correctBracketing(brackets : String) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(correctBracketing((\"<>\")) == (true));\n assert(correctBracketing((\"<<><>>\")) == (true));\n assert(correctBracketing((\"<><><<><>><>\")) == (true));\n assert(correctBracketing((\"<><><<<><><>><>><<><><<>>>\")) == (true));\n assert(correctBracketing((\"<<<><>>>>\")) == (false));\n assert(correctBracketing((\"><<>\")) == (false));\n assert(correctBracketing((\"<\")) == (false));\n assert(correctBracketing((\"<<<<\")) == (false));\n assert(correctBracketing((\">\")) == (false));\n assert(correctBracketing((\"<<>\")) == (false));\n assert(correctBracketing((\"<><><<><>><>><<>\")) == (false));\n assert(correctBracketing((\"<><><<><>><>>><>\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that takes an array of numbers as input and returns \n // the number of elements in the array that are greater than 10 and both \n // first and last digits of a number are odd (1, 3, 5, 7, 9).\n // For example:\n // >>> specialFilter((List[Long](15l.toLong, -73l.toLong, 14l.toLong, -15l.toLong)))\n // (1l)\n // >>> specialFilter((List[Long](33l.toLong, -2l.toLong, -3l.toLong, 45l.toLong, 21l.toLong, 109l.toLong)))\n // (2l)\n def specialFilter(nums : List[Long]) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(specialFilter((List[Long](5l.toLong, -2l.toLong, 1l.toLong, -5l.toLong))) == (0l));\n assert(specialFilter((List[Long](15l.toLong, -73l.toLong, 14l.toLong, -15l.toLong))) == (1l));\n assert(specialFilter((List[Long](33l.toLong, -2l.toLong, -3l.toLong, 45l.toLong, 21l.toLong, 109l.toLong))) == (2l));\n assert(specialFilter((List[Long](43l.toLong, -12l.toLong, 93l.toLong, 125l.toLong, 121l.toLong, 109l.toLong))) == (4l));\n assert(specialFilter((List[Long](71l.toLong, -2l.toLong, -33l.toLong, 75l.toLong, 21l.toLong, 19l.toLong))) == (3l));\n assert(specialFilter((List[Long](1l.toLong))) == (0l));\n assert(specialFilter((List[Long]())) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a dictionary, return True if all keys are strings in lower \n // case or all keys are strings in upper case, else return False.\n // The function should return False is the given dictionary is empty.\n // Examples:\n // >>> checkDictCase((Map[String,String](\"a\" -> \"apple\", \"b\" -> \"banana\")))\n // (true)\n // >>> checkDictCase((Map[String,String](\"a\" -> \"apple\", \"A\" -> \"banana\", \"B\" -> \"banana\")))\n // (false)\n // >>> checkDictCase((Map[String,String](\"a\" -> \"apple\", 8l -> \"banana\", \"a\" -> \"apple\")))\n // (false)\n // >>> checkDictCase((Map[String,String](\"Name\" -> \"John\", \"Age\" -> \"36\", \"City\" -> \"Houston\")))\n // (false)\n // >>> checkDictCase((Map[String,String](\"STATE\" -> \"NC\", \"ZIP\" -> \"12345\")))\n // (true)\n def checkDictCase(dict : Map[String,String]) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(checkDictCase((Map[String,String](\"p\" -> \"pineapple\", \"b\" -> \"banana\"))) == (true));\n assert(checkDictCase((Map[String,String](\"p\" -> \"pineapple\", \"A\" -> \"banana\", \"B\" -> \"banana\"))) == (false));\n assert(checkDictCase((Map[String,String](\"p\" -> \"pineapple\", \"5\" -> \"banana\", \"a\" -> \"apple\"))) == (false));\n assert(checkDictCase((Map[String,String](\"Name\" -> \"John\", \"Age\" -> \"36\", \"City\" -> \"Houston\"))) == (false));\n assert(checkDictCase((Map[String,String](\"STATE\" -> \"NC\", \"ZIP\" -> \"12345\"))) == (true));\n assert(checkDictCase((Map[String,String](\"fruit\" -> \"Orange\", \"taste\" -> \"Sweet\"))) == (true));\n assert(checkDictCase((Map[String,String]())) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n // should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n // alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n // Examples\n // >>> splitWords((\"Hello world!\"))\n // List[String](\"Hello\", \"world!\")\n // >>> splitWords((\"Hello,world!\"))\n // List[String](\"Hello\", \"world!\")\n // >>> splitWords((\"abcdef\"))\n // 3l\n def splitWords(txt : String) : Either[List[String], Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(splitWords((\"Hello world!\")).equals(List[String](\"Hello\", \"world!\")));\n assert(splitWords((\"Hello,world!\")).equals(List[String](\"Hello\", \"world!\")));\n assert(splitWords((\"Hello world,!\")).equals(List[String](\"Hello\", \"world,!\")));\n assert(splitWords((\"Hello,Hello,world !\")).equals(List[String](\"Hello,Hello,world\", \"!\")));\n assert(splitWords((\"abcdef\")).equals(3l));\n assert(splitWords((\"aaabb\")).equals(2l));\n assert(splitWords((\"aaaBb\")).equals(1l));\n assert(splitWords((\"\")).equals(0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n // fibfib(0) == 0\n // fibfib(1) == 0\n // fibfib(2) == 1\n // fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n // Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n // >>> fibfib((1l))\n // (0l)\n // >>> fibfib((5l))\n // (4l)\n // >>> fibfib((8l))\n // (24l)\n def fibfib(n : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(fibfib((2l)) == (1l));\n assert(fibfib((1l)) == (0l));\n assert(fibfib((5l)) == (4l));\n assert(fibfib((8l)) == (24l));\n assert(fibfib((10l)) == (81l));\n assert(fibfib((12l)) == (274l));\n assert(fibfib((14l)) == (927l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a list of numbers.\n // You need to return the sum of squared numbers in the given list,\n // round each element in the list to the upper int(Ceiling) first.\n // Examples:\n // >>> lst((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat)))\n // (14l)\n // >>> lst((List[Float](1.0f.toFloat, 4.0f.toFloat, 9.0f.toFloat)))\n // (98l)\n // >>> lst((List[Float](1.0f.toFloat, 3.0f.toFloat, 5.0f.toFloat, 7.0f.toFloat)))\n // (84l)\n // >>> lst((List[Float](1.4f.toFloat, 4.2f.toFloat, 0.0f.toFloat)))\n // (29l)\n // >>> lst((List[Float](-2.4f.toFloat, 1.0f.toFloat, 1.0f.toFloat)))\n // (6l)\n def sumSquares(lst : List[Float]) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sumSquares((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat))) == (14l));\n assert(sumSquares((List[Float](1.0f.toFloat, 2.0f.toFloat, 3.0f.toFloat))) == (14l));\n assert(sumSquares((List[Float](1.0f.toFloat, 3.0f.toFloat, 5.0f.toFloat, 7.0f.toFloat))) == (84l));\n assert(sumSquares((List[Float](1.4f.toFloat, 4.2f.toFloat, 0.0f.toFloat))) == (29l));\n assert(sumSquares((List[Float](-2.4f.toFloat, 1.0f.toFloat, 1.0f.toFloat))) == (6l));\n assert(sumSquares((List[Float](100.0f.toFloat, 1.0f.toFloat, 15.0f.toFloat, 2.0f.toFloat))) == (10230l));\n assert(sumSquares((List[Float](10000.0f.toFloat, 10000.0f.toFloat))) == (200000000l));\n assert(sumSquares((List[Float](-1.4f.toFloat, 4.6f.toFloat, 6.3f.toFloat))) == (75l));\n assert(sumSquares((List[Float](-1.4f.toFloat, 17.9f.toFloat, 18.9f.toFloat, 19.9f.toFloat))) == (1086l));\n assert(sumSquares((List[Float](0.0f.toFloat))) == (0l));\n assert(sumSquares((List[Float](-1.0f.toFloat))) == (1l));\n assert(sumSquares((List[Float](-1.0f.toFloat, 1.0f.toFloat, 0.0f.toFloat))) == (2l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_85_add", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a non-empty list of integers lst. add the even elements that are at odd indices..\n // Examples:\n // >>> add((List[Long](4l.toLong, 2l.toLong, 6l.toLong, 7l.toLong)))\n // (2l)\n def add(lst : List[Long]) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(add((List[Long](4l.toLong, 88l.toLong))) == (88l));\n assert(add((List[Long](4l.toLong, 5l.toLong, 6l.toLong, 7l.toLong, 2l.toLong, 122l.toLong))) == (122l));\n assert(add((List[Long](4l.toLong, 0l.toLong, 6l.toLong, 7l.toLong))) == (0l));\n assert(add((List[Long](4l.toLong, 4l.toLong, 6l.toLong, 8l.toLong))) == (12l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return sorted unique elements in a list\n // >>> unique((List[Long](5l.toLong, 3l.toLong, 5l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 9l.toLong, 0l.toLong, 123l.toLong)))\n // (List[Long](0l.toLong, 2l.toLong, 3l.toLong, 5l.toLong, 9l.toLong, 123l.toLong))\n def unique(l : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(unique((List[Long](5l.toLong, 3l.toLong, 5l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 9l.toLong, 0l.toLong, 123l.toLong))).equals((List[Long](0l.toLong, 2l.toLong, 3l.toLong, 5l.toLong, 9l.toLong, 123l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a string text, replace all spaces in it with underscores, \n // and if a string has more than 2 consecutive spaces, \n // then replace all consecutive spaces with - \n // >>> fixSpaces((\" Example\"))\n // (\"Example\")\n // >>> fixSpaces((\" Example 1\"))\n // (\"Example_1\")\n // >>> fixSpaces((\" Example 2\"))\n // (\"_Example_2\")\n // >>> fixSpaces((\" Example 3\"))\n // (\"_Example-3\")\n def fixSpaces(text : String) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(fixSpaces((\"Example\")).equals((\"Example\")));\n assert(fixSpaces((\"Mudasir Hanif \")).equals((\"Mudasir_Hanif_\")));\n assert(fixSpaces((\"Yellow Yellow Dirty Fellow\")).equals((\"Yellow_Yellow__Dirty__Fellow\")));\n assert(fixSpaces((\"Exa mple\")).equals((\"Exa-mple\")));\n assert(fixSpaces((\" Exa 1 2 2 mple\")).equals((\"-Exa_1_2_2_mple\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return 2^n modulo p (be aware of numerics).\n // >>> modp((3l), (5l))\n // (3l)\n // >>> modp((1101l), (101l))\n // (2l)\n // >>> modp((0l), (101l))\n // (1l)\n // >>> modp((3l), (11l))\n // (8l)\n // >>> modp((100l), (101l))\n // (1l)\n def modp(n : Long, p : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(modp((3l), (5l)) == (3l));\n assert(modp((1101l), (101l)) == (2l));\n assert(modp((0l), (101l)) == (1l));\n assert(modp((3l), (11l)) == (8l));\n assert(modp((100l), (101l)) == (1l));\n assert(modp((30l), (5l)) == (4l));\n assert(modp((31l), (5l)) == (3l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You have to write a function which validates a given date string and\n // returns True if the date is valid otherwise False.\n // The date is valid if all of the following rules are satisfied:\n // 1. The date string is not empty.\n // 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n // 3. The months should not be less than 1 or higher than 12.\n // 4. The date should be in the format: mm-dd-yyyy\n // >>> validDate((\"03-11-2000\"))\n // (true)\n // >>> validDate((\"15-01-2012\"))\n // (false)\n // >>> validDate((\"04-0-2040\"))\n // (false)\n // >>> validDate((\"06-04-2020\"))\n // (true)\n // >>> validDate((\"06/04/2020\"))\n // (false)\n def validDate(date : String) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(validDate((\"03-11-2000\")) == (true));\n assert(validDate((\"15-01-2012\")) == (false));\n assert(validDate((\"04-0-2040\")) == (false));\n assert(validDate((\"06-04-2020\")) == (true));\n assert(validDate((\"01-01-2007\")) == (true));\n assert(validDate((\"03-32-2011\")) == (false));\n assert(validDate((\"\")) == (false));\n assert(validDate((\"04-31-3000\")) == (false));\n assert(validDate((\"06-06-2005\")) == (true));\n assert(validDate((\"21-31-2000\")) == (false));\n assert(validDate((\"04-12-2003\")) == (true));\n assert(validDate((\"04122003\")) == (false));\n assert(validDate((\"20030412\")) == (false));\n assert(validDate((\"2003-04\")) == (false));\n assert(validDate((\"2003-04-12\")) == (false));\n assert(validDate((\"04-2003\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that takes a string and returns an ordered version of it.\n // Ordered version of string, is a string where all words (separated by space)\n // are replaced by a new word where all the characters arranged in\n // ascending order based on ascii value.\n // Note: You should keep the order of words and blank spaces in the sentence.\n // For example:\n // >>> antiShuffle((\"Hi\"))\n // (\"Hi\")\n // >>> antiShuffle((\"hello\"))\n // (\"ehllo\")\n // >>> antiShuffle((\"Hello World!!!\"))\n // (\"Hello !!!Wdlor\")\n def antiShuffle(s : String) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(antiShuffle((\"Hi\")).equals((\"Hi\")));\n assert(antiShuffle((\"hello\")).equals((\"ehllo\")));\n assert(antiShuffle((\"number\")).equals((\"bemnru\")));\n assert(antiShuffle((\"abcd\")).equals((\"abcd\")));\n assert(antiShuffle((\"Hello World!!!\")).equals((\"Hello !!!Wdlor\")));\n assert(antiShuffle((\"\")).equals((\"\")));\n assert(antiShuffle((\"Hi. My name is Mister Robot. How are you?\")).equals((\".Hi My aemn is Meirst .Rboot How aer ?ouy\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a list of numbers, return whether or not they are sorted\n // in ascending order. If list has more than 1 duplicate of the same\n // number, return False. Assume no negative numbers and only integers.\n // Examples\n // >>> isSorted((List[Long](5l.toLong)))\n // (true)\n // >>> isSorted((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong)))\n // (true)\n // >>> isSorted((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 4l.toLong, 5l.toLong)))\n // (false)\n // >>> isSorted((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong)))\n // (true)\n // >>> isSorted((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong, 7l.toLong)))\n // (true)\n // >>> isSorted((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 4l.toLong, 5l.toLong, 6l.toLong, 7l.toLong)))\n // (false)\n // >>> isSorted((List[Long](1l.toLong, 2l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 4l.toLong)))\n // (true)\n // >>> isSorted((List[Long](1l.toLong, 2l.toLong, 2l.toLong, 2l.toLong, 3l.toLong, 4l.toLong)))\n // (false)\n def isSorted(lst : List[Long]) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(isSorted((List[Long](5l.toLong))) == (true));\n assert(isSorted((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong))) == (true));\n assert(isSorted((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 4l.toLong, 5l.toLong))) == (false));\n assert(isSorted((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong))) == (true));\n assert(isSorted((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong, 7l.toLong))) == (true));\n assert(isSorted((List[Long](1l.toLong, 3l.toLong, 2l.toLong, 4l.toLong, 5l.toLong, 6l.toLong, 7l.toLong))) == (false));\n assert(isSorted((List[Long]())) == (true));\n assert(isSorted((List[Long](1l.toLong))) == (true));\n assert(isSorted((List[Long](3l.toLong, 2l.toLong, 1l.toLong))) == (false));\n assert(isSorted((List[Long](1l.toLong, 2l.toLong, 2l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))) == (false));\n assert(isSorted((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 3l.toLong, 4l.toLong))) == (false));\n assert(isSorted((List[Long](1l.toLong, 2l.toLong, 2l.toLong, 3l.toLong, 3l.toLong, 4l.toLong))) == (true));\n assert(isSorted((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a string s.\n // Your task is to check if the string is happy or not.\n // A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n // For example:\n // >>> isHappy((\"a\"))\n // (false)\n // >>> isHappy((\"aa\"))\n // (false)\n // >>> isHappy((\"abcd\"))\n // (true)\n // >>> isHappy((\"aabb\"))\n // (false)\n // >>> isHappy((\"adb\"))\n // (true)\n // >>> isHappy((\"xyy\"))\n // (false)\n def isHappy(s : String) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(isHappy((\"a\")) == (false));\n assert(isHappy((\"aa\")) == (false));\n assert(isHappy((\"abcd\")) == (true));\n assert(isHappy((\"aabb\")) == (false));\n assert(isHappy((\"adb\")) == (true));\n assert(isHappy((\"xyy\")) == (false));\n assert(isHappy((\"iopaxpoi\")) == (true));\n assert(isHappy((\"iopaxioi\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Write a function that returns True if the object q will fly, and False otherwise.\n // The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n // Example:\n // >>> willItFly((List[Long](1l.toLong, 2l.toLong)), (5l))\n // (false)\n // # 1+2 is less than the maximum possible weight, but it's unbalanced.\n // >>> willItFly((List[Long](3l.toLong, 2l.toLong, 3l.toLong)), (1l))\n // (false)\n // # it's balanced, but 3+2+3 is more than the maximum possible weight.\n // >>> willItFly((List[Long](3l.toLong, 2l.toLong, 3l.toLong)), (9l))\n // (true)\n // # 3+2+3 is less than the maximum possible weight, and it's balanced.\n // >>> willItFly((List[Long](3l.toLong)), (5l))\n // (true)\n // # 3 is less than the maximum possible weight, and it's balanced.\n def willItFly(q : List[Long], w : Long) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(willItFly((List[Long](3l.toLong, 2l.toLong, 3l.toLong)), (9l)) == (true));\n assert(willItFly((List[Long](1l.toLong, 2l.toLong)), (5l)) == (false));\n assert(willItFly((List[Long](3l.toLong)), (5l)) == (true));\n assert(willItFly((List[Long](3l.toLong, 2l.toLong, 3l.toLong)), (1l)) == (false));\n assert(willItFly((List[Long](1l.toLong, 2l.toLong, 3l.toLong)), (6l)) == (false));\n assert(willItFly((List[Long](5l.toLong)), (5l)) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given an array of non-negative integers, return a copy of the given array after sorting,\n // you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n // or sort it in descending order if the sum( first index value, last index value) is even.\n // Note:\n // * don't change the given array.\n // Examples:\n // >>> sortArray((List[Long]()))\n // (List[Long]())\n // >>> sortArray((List[Long](5l.toLong)))\n // (List[Long](5l.toLong))\n // >>> sortArray((List[Long](2l.toLong, 4l.toLong, 3l.toLong, 0l.toLong, 1l.toLong, 5l.toLong)))\n // (List[Long](0l.toLong, 1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong))\n // >>> sortArray((List[Long](2l.toLong, 4l.toLong, 3l.toLong, 0l.toLong, 1l.toLong, 5l.toLong, 6l.toLong)))\n // (List[Long](6l.toLong, 5l.toLong, 4l.toLong, 3l.toLong, 2l.toLong, 1l.toLong, 0l.toLong))\n def sortArray(array : List[Long]) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sortArray((List[Long]())).equals((List[Long]())));\n assert(sortArray((List[Long](5l.toLong))).equals((List[Long](5l.toLong))));\n assert(sortArray((List[Long](2l.toLong, 4l.toLong, 3l.toLong, 0l.toLong, 1l.toLong, 5l.toLong))).equals((List[Long](0l.toLong, 1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong))));\n assert(sortArray((List[Long](2l.toLong, 4l.toLong, 3l.toLong, 0l.toLong, 1l.toLong, 5l.toLong, 6l.toLong))).equals((List[Long](6l.toLong, 5l.toLong, 4l.toLong, 3l.toLong, 2l.toLong, 1l.toLong, 0l.toLong))));\n assert(sortArray((List[Long](2l.toLong, 1l.toLong))).equals((List[Long](1l.toLong, 2l.toLong))));\n assert(sortArray((List[Long](15l.toLong, 42l.toLong, 87l.toLong, 32l.toLong, 11l.toLong, 0l.toLong))).equals((List[Long](0l.toLong, 11l.toLong, 15l.toLong, 32l.toLong, 42l.toLong, 87l.toLong))));\n assert(sortArray((List[Long](21l.toLong, 14l.toLong, 23l.toLong, 11l.toLong))).equals((List[Long](23l.toLong, 21l.toLong, 14l.toLong, 11l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Implement a function that takes an non-negative integer and returns an array of the first n\n // integers that are prime numbers and less than n.\n // for example:\n // >>> countUpTo((5l))\n // (List[Long](2l.toLong, 3l.toLong))\n // >>> countUpTo((11l))\n // (List[Long](2l.toLong, 3l.toLong, 5l.toLong, 7l.toLong))\n // >>> countUpTo((0l))\n // (List[Long]())\n // >>> countUpTo((20l))\n // (List[Long](2l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 11l.toLong, 13l.toLong, 17l.toLong, 19l.toLong))\n // >>> countUpTo((1l))\n // (List[Long]())\n // >>> countUpTo((18l))\n // (List[Long](2l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 11l.toLong, 13l.toLong, 17l.toLong))\n def countUpTo(n : Long) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(countUpTo((5l)).equals((List[Long](2l.toLong, 3l.toLong))));\n assert(countUpTo((6l)).equals((List[Long](2l.toLong, 3l.toLong, 5l.toLong))));\n assert(countUpTo((7l)).equals((List[Long](2l.toLong, 3l.toLong, 5l.toLong))));\n assert(countUpTo((10l)).equals((List[Long](2l.toLong, 3l.toLong, 5l.toLong, 7l.toLong))));\n assert(countUpTo((0l)).equals((List[Long]())));\n assert(countUpTo((22l)).equals((List[Long](2l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 11l.toLong, 13l.toLong, 17l.toLong, 19l.toLong))));\n assert(countUpTo((1l)).equals((List[Long]())));\n assert(countUpTo((18l)).equals((List[Long](2l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 11l.toLong, 13l.toLong, 17l.toLong))));\n assert(countUpTo((47l)).equals((List[Long](2l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 11l.toLong, 13l.toLong, 17l.toLong, 19l.toLong, 23l.toLong, 29l.toLong, 31l.toLong, 37l.toLong, 41l.toLong, 43l.toLong))));\n assert(countUpTo((101l)).equals((List[Long](2l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 11l.toLong, 13l.toLong, 17l.toLong, 19l.toLong, 23l.toLong, 29l.toLong, 31l.toLong, 37l.toLong, 41l.toLong, 43l.toLong, 47l.toLong, 53l.toLong, 59l.toLong, 61l.toLong, 67l.toLong, 71l.toLong, 73l.toLong, 79l.toLong, 83l.toLong, 89l.toLong, 97l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Out of list of strings, return the longest one. Return the first one in case of multiple\n // strings of the same length. Return None in case the input list is empty.\n // >>> longest((List[String]()))\n // None\n // >>> longest((List[String](\"a\", \"b\", \"c\")))\n // \"a\"\n // >>> longest((List[String](\"a\", \"bb\", \"ccc\")))\n // \"ccc\"\n def longest(strings : List[String]) : Option[String] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(longest((List[String]())).equals(None));\n assert(longest((List[String](\"x\", \"y\", \"z\"))).equals(\"x\"));\n assert(longest((List[String](\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"))).equals(\"zzzz\"));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n // reverse the resulting array, and then replace each digit by its corresponding name from\n // \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n // For example:\n // >>> byLength((List[Long](2l.toLong, 1l.toLong, 1l.toLong, 4l.toLong, 5l.toLong, 8l.toLong, 2l.toLong, 3l.toLong)))\n // (List[String](\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"))\n // If the array is empty, return an empty array:\n // >>> byLength((List[Long]()))\n // (List[String]())\n // If the array has any strange number ignore it:\n // >>> byLength((List[Long](1l.toLong, -1l.toLong, 55l.toLong)))\n // (List[String](\"One\"))\n def byLength(arr : List[Long]) : List[String] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(byLength((List[Long](2l.toLong, 1l.toLong, 1l.toLong, 4l.toLong, 5l.toLong, 8l.toLong, 2l.toLong, 3l.toLong))).equals((List[String](\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"))));\n assert(byLength((List[Long]())).equals((List[String]())));\n assert(byLength((List[Long](1l.toLong, -1l.toLong, 55l.toLong))).equals((List[String](\"One\"))));\n assert(byLength((List[Long](1l.toLong, -1l.toLong, 3l.toLong, 2l.toLong))).equals((List[String](\"Three\", \"Two\", \"One\"))));\n assert(byLength((List[Long](9l.toLong, 4l.toLong, 8l.toLong))).equals((List[String](\"Nine\", \"Eight\", \"Four\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_106_f", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Implement the function f that takes n as a parameter,\n // 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\n // or the sum of numbers from 1 to i otherwise.\n // i starts from 1.\n // the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n // Example:\n // >>> f((5l))\n // (List[Long](1l.toLong, 2l.toLong, 6l.toLong, 24l.toLong, 15l.toLong))\n def f(n : Long) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(f((5l)).equals((List[Long](1l.toLong, 2l.toLong, 6l.toLong, 24l.toLong, 15l.toLong))));\n assert(f((7l)).equals((List[Long](1l.toLong, 2l.toLong, 6l.toLong, 24l.toLong, 15l.toLong, 720l.toLong, 28l.toLong))));\n assert(f((1l)).equals((List[Long](1l.toLong))));\n assert(f((3l)).equals((List[Long](1l.toLong, 2l.toLong, 6l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n // >>> fizzBuzz((50l))\n // (0l)\n // >>> fizzBuzz((78l))\n // (2l)\n // >>> fizzBuzz((79l))\n // (3l)\n def fizzBuzz(n : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(fizzBuzz((50l)) == (0l));\n assert(fizzBuzz((78l)) == (2l));\n assert(fizzBuzz((79l)) == (3l));\n assert(fizzBuzz((100l)) == (3l));\n assert(fizzBuzz((200l)) == (6l));\n assert(fizzBuzz((4000l)) == (192l));\n assert(fizzBuzz((10000l)) == (639l));\n assert(fizzBuzz((100000l)) == (8026l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a positive floating point number, it can be decomposed into\n // and integer part (largest integer smaller than given number) and decimals\n // (leftover part always smaller than 1).\n // Return the decimal part of the number.\n // >>> truncateNumber((3.5f))\n // (0.5f)\n def truncateNumber(number : Float) : Float = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(truncateNumber((3.5f)) == (0.5f));\n assert(truncateNumber((1.25f)) == (0.25f));\n assert(truncateNumber((123.0f)) == (0.0f));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n // Empty sum should be equal to 0 and empty product should be equal to 1.\n // >>> sumProduct((List[Long]()))\n // ((0l, 1l))\n // >>> sumProduct((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong)))\n // ((10l, 24l))\n def sumProduct(numbers : List[Long]) : Tuple2[Long, Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sumProduct((List[Long]())).equals(((0l, 1l))));\n assert(sumProduct((List[Long](1l.toLong, 1l.toLong, 1l.toLong))).equals(((3l, 1l))));\n assert(sumProduct((List[Long](100l.toLong, 0l.toLong))).equals(((100l, 0l))));\n assert(sumProduct((List[Long](3l.toLong, 5l.toLong, 7l.toLong))).equals(((15l, 105l))));\n assert(sumProduct((List[Long](10l.toLong))).equals(((10l, 10l))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a 2 dimensional data, as a nested lists,\n // which is similar to matrix, however, unlike matrices,\n // each row may contain a different number of columns.\n // Given lst, and integer x, find integers x in the list,\n // and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n // each tuple is a coordinate - (row, columns), starting with 0.\n // Sort coordinates initially by rows in ascending order.\n // Also, sort coordinates of the row by columns in descending order.\n // Examples:\n // >>> getRow((List[List[Long]](List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 1l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 1l.toLong))), (1l))\n // (List[Tuple2[Long, Long]]((0l, 0l), (1l, 4l), (1l, 0l), (2l, 5l), (2l, 0l)))\n // >>> getRow((List[List[Long]]()), (1l))\n // (List[Tuple2[Long, Long]]())\n // >>> getRow((List[List[Long]](List[Long](), List[Long](1l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong))), (3l))\n // (List[Tuple2[Long, Long]]((2l, 2l)))\n def getRow(lst : List[List[Long]], x : Long) : List[Tuple2[Long, Long]] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(getRow((List[List[Long]](List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 1l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 1l.toLong))), (1l)).equals((List[Tuple2[Long, Long]]((0l, 0l), (1l, 4l), (1l, 0l), (2l, 5l), (2l, 0l)))));\n assert(getRow((List[List[Long]](List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong))), (2l)).equals((List[Tuple2[Long, Long]]((0l, 1l), (1l, 1l), (2l, 1l), (3l, 1l), (4l, 1l), (5l, 1l)))));\n assert(getRow((List[List[Long]](List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 1l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 1l.toLong, 4l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 1l.toLong, 5l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 1l.toLong, 6l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 5l.toLong, 1l.toLong))), (1l)).equals((List[Tuple2[Long, Long]]((0l, 0l), (1l, 0l), (2l, 1l), (2l, 0l), (3l, 2l), (3l, 0l), (4l, 3l), (4l, 0l), (5l, 4l), (5l, 0l), (6l, 5l), (6l, 0l)))));\n assert(getRow((List[List[Long]]()), (1l)).equals((List[Tuple2[Long, Long]]())));\n assert(getRow((List[List[Long]](List[Long](1l.toLong))), (2l)).equals((List[Tuple2[Long, Long]]())));\n assert(getRow((List[List[Long]](List[Long](), List[Long](1l.toLong), List[Long](1l.toLong, 2l.toLong, 3l.toLong))), (3l)).equals((List[Tuple2[Long, Long]]((2l, 2l)))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You're a hungry rabbit, and you already have eaten a certain number of carrots,\n // but now you need to eat more carrots to complete the day's meals.\n // you should return an array of [ total number of eaten carrots after your meals,\n // the number of carrots left after your meals ]\n // if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n // Example:\n // >>> eat((5l), (6l), (10l))\n // (List[Long](11l.toLong, 4l.toLong))\n // >>> eat((4l), (8l), (9l))\n // (List[Long](12l.toLong, 1l.toLong))\n // >>> eat((1l), (10l), (10l))\n // (List[Long](11l.toLong, 0l.toLong))\n // >>> eat((2l), (11l), (5l))\n // (List[Long](7l.toLong, 0l.toLong))\n // Variables:\n // @number : integer\n // the number of carrots that you have eaten.\n // @need : integer\n // the number of carrots that you need to eat.\n // @remaining : integer\n // the number of remaining carrots thet exist in stock\n // Constrain:\n // * 0 <= number <= 1000\n // * 0 <= need <= 1000\n // * 0 <= remaining <= 1000\n // Have fun :)\n def eat(number : Long, need : Long, remaining : Long) : List[Long] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(eat((5l), (6l), (10l)).equals((List[Long](11l.toLong, 4l.toLong))));\n assert(eat((4l), (8l), (9l)).equals((List[Long](12l.toLong, 1l.toLong))));\n assert(eat((1l), (10l), (10l)).equals((List[Long](11l.toLong, 0l.toLong))));\n assert(eat((2l), (11l), (5l)).equals((List[Long](7l.toLong, 0l.toLong))));\n assert(eat((4l), (5l), (7l)).equals((List[Long](9l.toLong, 2l.toLong))));\n assert(eat((4l), (5l), (1l)).equals((List[Long](5l.toLong, 0l.toLong))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a positive integer N, return the total sum of its digits in binary.\n // Example\n // >>> solve((1000l))\n // (\"1\")\n // >>> solve((150l))\n // (\"110\")\n // >>> solve((147l))\n // (\"1100\")\n // Variables:\n // @N integer\n // Constraints: 0 \u2264 N \u2264 10000.\n // Output:\n // a string of binary number\n def solve(N : Long) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(solve((1000l)).equals((\"1\")));\n assert(solve((150l)).equals((\"110\")));\n assert(solve((147l)).equals((\"1100\")));\n assert(solve((333l)).equals((\"1001\")));\n assert(solve((963l)).equals((\"10010\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given a list of integers.\n // You need to find the largest prime value and return the sum of its digits.\n // Examples:\n // >>> skjkasdkd((List[Long](0l.toLong, 3l.toLong, 2l.toLong, 1l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 4l.toLong, 5l.toLong, 5l.toLong, 5l.toLong, 2l.toLong, 181l.toLong, 32l.toLong, 4l.toLong, 32l.toLong, 3l.toLong, 2l.toLong, 32l.toLong, 324l.toLong, 4l.toLong, 3l.toLong)))\n // (10l)\n // >>> skjkasdkd((List[Long](1l.toLong, 0l.toLong, 1l.toLong, 8l.toLong, 2l.toLong, 4597l.toLong, 2l.toLong, 1l.toLong, 3l.toLong, 40l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 2l.toLong, 4l.toLong, 2l.toLong, 5l.toLong, 1l.toLong)))\n // (25l)\n // >>> skjkasdkd((List[Long](1l.toLong, 3l.toLong, 1l.toLong, 32l.toLong, 5107l.toLong, 34l.toLong, 83278l.toLong, 109l.toLong, 163l.toLong, 23l.toLong, 2323l.toLong, 32l.toLong, 30l.toLong, 1l.toLong, 9l.toLong, 3l.toLong)))\n // (13l)\n // >>> skjkasdkd((List[Long](0l.toLong, 724l.toLong, 32l.toLong, 71l.toLong, 99l.toLong, 32l.toLong, 6l.toLong, 0l.toLong, 5l.toLong, 91l.toLong, 83l.toLong, 0l.toLong, 5l.toLong, 6l.toLong)))\n // (11l)\n // >>> skjkasdkd((List[Long](0l.toLong, 81l.toLong, 12l.toLong, 3l.toLong, 1l.toLong, 21l.toLong)))\n // (3l)\n // >>> skjkasdkd((List[Long](0l.toLong, 8l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 7l.toLong)))\n // (7l)\n def skjkasdkd(lst : List[Long]) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(skjkasdkd((List[Long](0l.toLong, 3l.toLong, 2l.toLong, 1l.toLong, 3l.toLong, 5l.toLong, 7l.toLong, 4l.toLong, 5l.toLong, 5l.toLong, 5l.toLong, 2l.toLong, 181l.toLong, 32l.toLong, 4l.toLong, 32l.toLong, 3l.toLong, 2l.toLong, 32l.toLong, 324l.toLong, 4l.toLong, 3l.toLong))) == (10l));\n assert(skjkasdkd((List[Long](1l.toLong, 0l.toLong, 1l.toLong, 8l.toLong, 2l.toLong, 4597l.toLong, 2l.toLong, 1l.toLong, 3l.toLong, 40l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 2l.toLong, 4l.toLong, 2l.toLong, 5l.toLong, 1l.toLong))) == (25l));\n assert(skjkasdkd((List[Long](1l.toLong, 3l.toLong, 1l.toLong, 32l.toLong, 5107l.toLong, 34l.toLong, 83278l.toLong, 109l.toLong, 163l.toLong, 23l.toLong, 2323l.toLong, 32l.toLong, 30l.toLong, 1l.toLong, 9l.toLong, 3l.toLong))) == (13l));\n assert(skjkasdkd((List[Long](0l.toLong, 724l.toLong, 32l.toLong, 71l.toLong, 99l.toLong, 32l.toLong, 6l.toLong, 0l.toLong, 5l.toLong, 91l.toLong, 83l.toLong, 0l.toLong, 5l.toLong, 6l.toLong))) == (11l));\n assert(skjkasdkd((List[Long](0l.toLong, 81l.toLong, 12l.toLong, 3l.toLong, 1l.toLong, 21l.toLong))) == (3l));\n assert(skjkasdkd((List[Long](0l.toLong, 8l.toLong, 1l.toLong, 2l.toLong, 1l.toLong, 7l.toLong))) == (7l));\n assert(skjkasdkd((List[Long](8191l.toLong))) == (19l));\n assert(skjkasdkd((List[Long](8191l.toLong, 123456l.toLong, 127l.toLong, 7l.toLong))) == (19l));\n assert(skjkasdkd((List[Long](127l.toLong, 97l.toLong, 8192l.toLong))) == (10l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given an array arr of integers, find the minimum number of elements that\n // need to be changed to make the array palindromic. A palindromic array is an array that\n // is read the same backwards and forwards. In one change, you can change one element to any other element.\n // For example:\n // >>> smallestChange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 5l.toLong, 4l.toLong, 7l.toLong, 9l.toLong, 6l.toLong)))\n // (4l)\n // >>> smallestChange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 3l.toLong, 2l.toLong, 2l.toLong)))\n // (1l)\n // >>> smallestChange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 2l.toLong, 1l.toLong)))\n // (0l)\n def smallestChange(arr : List[Long]) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(smallestChange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 5l.toLong, 4l.toLong, 7l.toLong, 9l.toLong, 6l.toLong))) == (4l));\n assert(smallestChange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 4l.toLong, 3l.toLong, 2l.toLong, 2l.toLong))) == (1l));\n assert(smallestChange((List[Long](1l.toLong, 4l.toLong, 2l.toLong))) == (1l));\n assert(smallestChange((List[Long](1l.toLong, 4l.toLong, 4l.toLong, 2l.toLong))) == (1l));\n assert(smallestChange((List[Long](1l.toLong, 2l.toLong, 3l.toLong, 2l.toLong, 1l.toLong))) == (0l));\n assert(smallestChange((List[Long](3l.toLong, 1l.toLong, 1l.toLong, 3l.toLong))) == (0l));\n assert(smallestChange((List[Long](1l.toLong))) == (0l));\n assert(smallestChange((List[Long](0l.toLong, 1l.toLong))) == (1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // It is the last week of the semester and the teacher has to give the grades\n // to students. The teacher has been making her own algorithm for grading.\n // The only problem is, she has lost the code she used for grading.\n // She has given you a list of GPAs for some students and you have to write \n // a function that can output a list of letter grades using the following table:\n // GPA | Letter grade\n // 4.0 A+\n // > 3.7 A \n // > 3.3 A- \n // > 3.0 B+\n // > 2.7 B \n // > 2.3 B-\n // > 2.0 C+\n // > 1.7 C\n // > 1.3 C-\n // > 1.0 D+ \n // > 0.7 D \n // > 0.0 D-\n // 0.0 E\n // Example:\n // >>> gradeEquation((List[Float](4.0f.toFloat, 3l.toFloat, 1.7f.toFloat, 2l.toFloat, 3.5f.toFloat)))\n // (List[String](\"A+\", \"B\", \"C-\", \"C\", \"A-\"))\n def numericalLetterGrade(grades : List[Float]) : List[String] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(numericalLetterGrade((List[Float](4.0f.toFloat, 3l.toFloat, 1.7f.toFloat, 2l.toFloat, 3.5f.toFloat))).equals((List[String](\"A+\", \"B\", \"C-\", \"C\", \"A-\"))));\n assert(numericalLetterGrade((List[Float](1.2f.toFloat))).equals((List[String](\"D+\"))));\n assert(numericalLetterGrade((List[Float](0.5f.toFloat))).equals((List[String](\"D-\"))));\n assert(numericalLetterGrade((List[Float](0.0f.toFloat))).equals((List[String](\"E\"))));\n assert(numericalLetterGrade((List[Float](1.0f.toFloat, 0.3f.toFloat, 1.5f.toFloat, 2.8f.toFloat, 3.3f.toFloat))).equals((List[String](\"D\", \"D-\", \"C-\", \"B\", \"B+\"))));\n assert(numericalLetterGrade((List[Float](0.0f.toFloat, 0.7f.toFloat))).equals((List[String](\"E\", \"D-\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given the lengths of the three sides of a triangle. Return the area of\n // the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n // Otherwise return -1\n // Three sides make a valid triangle when the sum of any two sides is greater \n // than the third side.\n // Example:\n // >>> triangleArea((3l), (4l), (5l))\n // (6.0f)\n // >>> triangleArea((1l), (2l), (10l))\n // -1l\n def triangleArea(a : Long, b : Long, c : Long) : Float = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(triangleArea((3l), (4l), (5l)) == (6.0f));\n assert(triangleArea((1l), (2l), (10l)) == -1l);\n assert(triangleArea((4l), (8l), (5l)) == (8.18f));\n assert(triangleArea((2l), (2l), (2l)) == (1.73f));\n assert(triangleArea((1l), (2l), (3l)) == -1l);\n assert(triangleArea((10l), (5l), (7l)) == (16.25f));\n assert(triangleArea((2l), (6l), (3l)) == -1l);\n assert(triangleArea((1l), (1l), (1l)) == (0.43f));\n assert(triangleArea((2l), (2l), (10l)) == -1l);\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Check if two words have the same characters.\n // >>> sameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddeddabc\"))\n // (true)\n // >>> sameChars((\"abcd\"), (\"dddddddabc\"))\n // (true)\n // >>> sameChars((\"dddddddabc\"), (\"abcd\"))\n // (true)\n // >>> sameChars((\"eabcd\"), (\"dddddddabc\"))\n // (false)\n // >>> sameChars((\"abcd\"), (\"dddddddabce\"))\n // (false)\n // >>> sameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddddabc\"))\n // (false)\n def sameChars(s0 : String, s1 : String) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(sameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddeddabc\")) == (true));\n assert(sameChars((\"abcd\"), (\"dddddddabc\")) == (true));\n assert(sameChars((\"dddddddabc\"), (\"abcd\")) == (true));\n assert(sameChars((\"eabcd\"), (\"dddddddabc\")) == (false));\n assert(sameChars((\"abcd\"), (\"dddddddabcf\")) == (false));\n assert(sameChars((\"eabcdzzzz\"), (\"dddzzzzzzzddddabc\")) == (false));\n assert(sameChars((\"aabb\"), (\"aaccc\")) == (false));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given an array of integers nums, find the minimum sum of any non-empty sub-array\n // of nums.\n // Example\n // >>> minSubArraySum((List[Long](2l.toLong, 3l.toLong, 4l.toLong, 1l.toLong, 2l.toLong, 4l.toLong)))\n // (1l)\n // >>> minSubArraySum((List[Long](-1l.toLong, -2l.toLong, -3l.toLong)))\n // (-6l)\n def minSubArraySum(nums : List[Long]) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(minSubArraySum((List[Long](2l.toLong, 3l.toLong, 4l.toLong, 1l.toLong, 2l.toLong, 4l.toLong))) == (1l));\n assert(minSubArraySum((List[Long](-1l.toLong, -2l.toLong, -3l.toLong))) == (-6l));\n assert(minSubArraySum((List[Long](-1l.toLong, -2l.toLong, -3l.toLong, 2l.toLong, -10l.toLong))) == (-14l));\n assert(minSubArraySum((List[Long](-9999999999999999l.toLong))) == (-9999999999999999l));\n assert(minSubArraySum((List[Long](0l.toLong, 10l.toLong, 20l.toLong, 1000000l.toLong))) == (0l));\n assert(minSubArraySum((List[Long](-1l.toLong, -2l.toLong, -3l.toLong, 10l.toLong, -5l.toLong))) == (-6l));\n assert(minSubArraySum((List[Long](100l.toLong, -1l.toLong, -2l.toLong, -3l.toLong, 10l.toLong, -5l.toLong))) == (-6l));\n assert(minSubArraySum((List[Long](10l.toLong, 11l.toLong, 13l.toLong, 8l.toLong, 3l.toLong, 4l.toLong))) == (3l));\n assert(minSubArraySum((List[Long](100l.toLong, -33l.toLong, 32l.toLong, -1l.toLong, 0l.toLong, -2l.toLong))) == (-33l));\n assert(minSubArraySum((List[Long](-10l.toLong))) == (-10l));\n assert(minSubArraySum((List[Long](7l.toLong))) == (7l));\n assert(minSubArraySum((List[Long](1l.toLong, -1l.toLong))) == (-1l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a string s and a natural number n, you have been tasked to implement \n // a function that returns a list of all words from string s that contain exactly \n // n consonants, in order these words appear in the string s.\n // If the string s is empty then the function should return an empty list.\n // Note: you may assume the input string contains only letters and spaces.\n // Examples:\n // >>> selectWords((\"Mary had a little lamb\"), (4l))\n // (List[String](\"little\"))\n // >>> selectWords((\"Mary had a little lamb\"), (3l))\n // (List[String](\"Mary\", \"lamb\"))\n // >>> selectWords((\"simple white space\"), (2l))\n // (List[String]())\n // >>> selectWords((\"Hello world\"), (4l))\n // (List[String](\"world\"))\n // >>> selectWords((\"Uncle sam\"), (3l))\n // (List[String](\"Uncle\"))\n def selectWords(s : String, n : Long) : List[String] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(selectWords((\"Mary had a little lamb\"), (4l)).equals((List[String](\"little\"))));\n assert(selectWords((\"Mary had a little lamb\"), (3l)).equals((List[String](\"Mary\", \"lamb\"))));\n assert(selectWords((\"simple white space\"), (2l)).equals((List[String]())));\n assert(selectWords((\"Hello world\"), (4l)).equals((List[String](\"world\"))));\n assert(selectWords((\"Uncle sam\"), (3l)).equals((List[String](\"Uncle\"))));\n assert(selectWords((\"\"), (4l)).equals((List[String]())));\n assert(selectWords((\"a b c d e f\"), (1l)).equals((List[String](\"b\", \"c\", \"d\", \"f\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return list of all prefixes from shortest to longest of the input string\n // >>> allPrefixes((\"abc\"))\n // (List[String](\"a\", \"ab\", \"abc\"))\n def allPrefixes(string : String) : List[String] = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(allPrefixes((\"\")).equals((List[String]())));\n assert(allPrefixes((\"asdfgh\")).equals((List[String](\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"))));\n assert(allPrefixes((\"WWW\")).equals((List[String](\"W\", \"WW\", \"WWW\"))));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function that takes a value (string) representing a number\n // and returns the closest integer to it. If the number is equidistant\n // from two integers, round it away from zero.\n // Examples\n // >>> closestInteger((\"10\"))\n // (10l)\n // >>> closestInteger((\"15.3\"))\n // (15l)\n // Note:\n // Rounding away from zero means that if the given number is equidistant\n // from two integers, the one you should return is the one that is the\n // farthest from zero. For example closest_integer(\"14.5\") should\n // return 15 and closest_integer(\"-14.5\") should return -15.\n def closestInteger(value : String) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(closestInteger((\"10\")) == (10l));\n assert(closestInteger((\"14.5\")) == (15l));\n assert(closestInteger((\"-15.5\")) == (-16l));\n assert(closestInteger((\"15.3\")) == (15l));\n assert(closestInteger((\"0\")) == (0l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Create a function which takes a string representing a file's name, and returns\n // 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n // A file's name is considered to be valid if and only if all the following conditions \n // are met:\n // - There should not be more than three digits ('0'-'9') in the file's name.\n // - The file's name contains exactly one dot '.'\n // - The substring before the dot should not be empty, and it starts with a letter from \n // the latin alphapet ('a'-'z' and 'A'-'Z').\n // - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n // Examples:\n // >>> fileNameCheck((\"example.txt\"))\n // (\"Yes\")\n // >>> fileNameCheck((\"1example.dll\"))\n // (\"No\")\n def fileNameCheck(file_name : String) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(fileNameCheck((\"example.txt\")).equals((\"Yes\")));\n assert(fileNameCheck((\"1example.dll\")).equals((\"No\")));\n assert(fileNameCheck((\"s1sdf3.asd\")).equals((\"No\")));\n assert(fileNameCheck((\"K.dll\")).equals((\"Yes\")));\n assert(fileNameCheck((\"MY16FILE3.exe\")).equals((\"Yes\")));\n assert(fileNameCheck((\"His12FILE94.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"_Y.txt\")).equals((\"No\")));\n assert(fileNameCheck((\"?aREYA.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"/this_is_valid.dll\")).equals((\"No\")));\n assert(fileNameCheck((\"this_is_valid.wow\")).equals((\"No\")));\n assert(fileNameCheck((\"this_is_valid.txt\")).equals((\"Yes\")));\n assert(fileNameCheck((\"this_is_valid.txtexe\")).equals((\"No\")));\n assert(fileNameCheck((\"#this2_i4s_5valid.ten\")).equals((\"No\")));\n assert(fileNameCheck((\"@this1_is6_valid.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"this_is_12valid.6exe4.txt\")).equals((\"No\")));\n assert(fileNameCheck((\"all.exe.txt\")).equals((\"No\")));\n assert(fileNameCheck((\"I563_No.exe\")).equals((\"Yes\")));\n assert(fileNameCheck((\"Is3youfault.txt\")).equals((\"Yes\")));\n assert(fileNameCheck((\"no_one#knows.dll\")).equals((\"Yes\")));\n assert(fileNameCheck((\"1I563_Yes3.exe\")).equals((\"No\")));\n assert(fileNameCheck((\"I563_Yes3.txtt\")).equals((\"No\")));\n assert(fileNameCheck((\"final..txt\")).equals((\"No\")));\n assert(fileNameCheck((\"final132\")).equals((\"No\")));\n assert(fileNameCheck((\"_f4indsartal132.\")).equals((\"No\")));\n assert(fileNameCheck((\".txt\")).equals((\"No\")));\n assert(fileNameCheck((\"s.\")).equals((\"No\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You are given two intervals,\n // where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n // The given intervals are closed which means that the interval (start, end)\n // includes both start and end.\n // For each given interval, it is assumed that its start is less or equal its end.\n // Your task is to determine whether the length of intersection of these two \n // intervals is a prime number.\n // Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n // which its length is 1, which not a prime number.\n // If the length of the intersection is a prime number, return \"YES\",\n // otherwise, return \"NO\".\n // If the two intervals don't intersect, return \"NO\".\n // [input/output] samples:\n // >>> intersection(((1l, 2l)), ((2l, 3l)))\n // (\"NO\")\n // >>> intersection(((-1l, 1l)), ((0l, 4l)))\n // (\"NO\")\n // >>> intersection(((-3l, -1l)), ((-5l, 5l)))\n // (\"YES\")\n def intersection(interval1 : Tuple2[Long, Long], interval2 : Tuple2[Long, Long]) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(intersection(((1l, 2l)), ((2l, 3l))).equals((\"NO\")));\n assert(intersection(((-1l, 1l)), ((0l, 4l))).equals((\"NO\")));\n assert(intersection(((-3l, -1l)), ((-5l, 5l))).equals((\"YES\")));\n assert(intersection(((-2l, 2l)), ((-4l, 0l))).equals((\"YES\")));\n assert(intersection(((-11l, 2l)), ((-1l, -1l))).equals((\"NO\")));\n assert(intersection(((1l, 2l)), ((3l, 5l))).equals((\"NO\")));\n assert(intersection(((1l, 2l)), ((1l, 2l))).equals((\"NO\")));\n assert(intersection(((-2l, -2l)), ((-3l, -2l))).equals((\"NO\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Return the largest prime factor of n. Assume n > 1 and is not a prime.\n // >>> largestPrimeFactor((13195l))\n // (29l)\n // >>> largestPrimeFactor((2048l))\n // (2l)\n def largestPrimeFactor(n : Long) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(largestPrimeFactor((15l)) == (5l));\n assert(largestPrimeFactor((27l)) == (3l));\n assert(largestPrimeFactor((63l)) == (7l));\n assert(largestPrimeFactor((330l)) == (11l));\n assert(largestPrimeFactor((13195l)) == (29l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a string, find out how many distinct characters (regardless of case) does it consist of\n // >>> countDistinctCharacters((\"xyzXYZ\"))\n // (3l)\n // >>> countDistinctCharacters((\"Jerry\"))\n // (4l)\n def countDistinctCharacters(string : String) : Long = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(countDistinctCharacters((\"\")) == (0l));\n assert(countDistinctCharacters((\"abcde\")) == (5l));\n assert(countDistinctCharacters((\"abcdecadeCADE\")) == (5l));\n assert(countDistinctCharacters((\"aaaaAAAAaaaa\")) == (1l));\n assert(countDistinctCharacters((\"Jerry jERRY JeRRRY\")) == (5l));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // You're given a list of deposit and withdrawal operations on a bank account that starts with\n // zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n // at that point function should return True. Otherwise it should return False.\n // >>> belowZero((List[Long](1l.toLong, 2l.toLong, 3l.toLong)))\n // (false)\n // >>> belowZero((List[Long](1l.toLong, 2l.toLong, -4l.toLong, 5l.toLong)))\n // (true)\n def belowZero(operations : List[Long]) : Boolean = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(belowZero((List[Long]())) == (false));\n assert(belowZero((List[Long](1l.toLong, 2l.toLong, -3l.toLong, 1l.toLong, 2l.toLong, -3l.toLong))) == (false));\n assert(belowZero((List[Long](1l.toLong, 2l.toLong, -4l.toLong, 5l.toLong, 6l.toLong))) == (true));\n assert(belowZero((List[Long](1l.toLong, -1l.toLong, 2l.toLong, -2l.toLong, 5l.toLong, -5l.toLong, 4l.toLong, -4l.toLong))) == (false));\n assert(belowZero((List[Long](1l.toLong, -1l.toLong, 2l.toLong, -2l.toLong, 5l.toLong, -5l.toLong, 4l.toLong, -5l.toLong))) == (true));\n assert(belowZero((List[Long](1l.toLong, -2l.toLong, 2l.toLong, -2l.toLong, 5l.toLong, -5l.toLong, 4l.toLong, -4l.toLong))) == (true));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Find the shortest palindrome that begins with a supplied string.\n // Algorithm idea is simple:\n // - Find the longest postfix of supplied string that is a palindrome.\n // - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n // >>> makePalindrome((\"\"))\n // (\"\")\n // >>> makePalindrome((\"cat\"))\n // (\"catac\")\n // >>> makePalindrome((\"cata\"))\n // (\"catac\")\n def makePalindrome(string : String) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(makePalindrome((\"\")).equals((\"\")));\n assert(makePalindrome((\"x\")).equals((\"x\")));\n assert(makePalindrome((\"xyz\")).equals((\"xyzyx\")));\n assert(makePalindrome((\"xyx\")).equals((\"xyx\")));\n assert(makePalindrome((\"jerry\")).equals((\"jerryrrej\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "scala", - "prompt": "import scala.math._\nimport scala.collection.mutable._\nobject Problem {\n // Given a positive integer, obtain its roman numeral equivalent as a string,\n // and return it in lowercase.\n // Restrictions: 1 <= num <= 1000\n // Examples:\n // >>> intToMiniRoman((19l))\n // (\"xix\")\n // >>> intToMiniRoman((152l))\n // (\"clii\")\n // >>> intToMiniRoman((426l))\n // (\"cdxxvi\")\n def intToMiniRoman(number : Long) : String = {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": " }\n def main(args: Array[String]) = {\n assert(intToMiniRoman((19l)).equals((\"xix\")));\n assert(intToMiniRoman((152l)).equals((\"clii\")));\n assert(intToMiniRoman((251l)).equals((\"ccli\")));\n assert(intToMiniRoman((426l)).equals((\"cdxxvi\")));\n assert(intToMiniRoman((500l)).equals((\"d\")));\n assert(intToMiniRoman((1l)).equals((\"i\")));\n assert(intToMiniRoman((4l)).equals((\"iv\")));\n assert(intToMiniRoman((43l)).equals((\"xliii\")));\n assert(intToMiniRoman((90l)).equals((\"xc\")));\n assert(intToMiniRoman((94l)).equals((\"xciv\")));\n assert(intToMiniRoman((532l)).equals((\"dxxxii\")));\n assert(intToMiniRoman((900l)).equals((\"cm\")));\n assert(intToMiniRoman((994l)).equals((\"cmxciv\")));\n assert(intToMiniRoman((1000l)).equals((\"m\")));\n }\n\n}\n", - "stop_tokens": [ - "\n }\n" - ] - } -] \ No newline at end of file diff --git a/data/sh-keep.json b/data/sh-keep.json deleted file mode 100644 index 246f8e5cda2015534a82f7720a1c27b8f7e26471..0000000000000000000000000000000000000000 --- a/data/sh-keep.json +++ /dev/null @@ -1,1898 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "sh", - "prompt": "#!/bin/bash\n# For a given number n, find the largest number that divides n evenly, smaller than n\n# >>> largest_divisor(15)\n# 5\n#\n# $1 is an integer\nlargest_divisor() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n largest_divisor \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3\") = \"1\" ]]\n [[ $(candidate \"7\") = \"1\" ]]\n [[ $(candidate \"10\") = \"5\" ]]\n [[ $(candidate \"100\") = \"50\" ]]\n [[ $(candidate \"49\") = \"7\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_47_median", - "language": "sh", - "prompt": "#!/bin/bash\n# Return median of elements in the list l.\n# >>> median([3, 1, 2, 4, 5])\n# 3\n# >>> median([-10, 4, 6, 1000, 10, 20])\n# 15.0\n#\n# $1 is a space-separated list\nmedian() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n median \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3 1 2 4 5\") = \"3\" ]]\n [[ $(candidate \"-10 4 6 1000 10 20\") = \"8.0\" ]]\n [[ $(candidate \"5\") = \"5\" ]]\n [[ $(candidate \"6 5\") = \"5.5\" ]]\n [[ $(candidate \"8 1 3 9 9 2 7\") = \"7\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "sh", - "prompt": "#!/bin/bash\n# Given two lists operator, and operand. The first list has basic algebra operations, and \n# the second list is a list of integers. Use the two given lists to build the algebric \n# expression and return the evaluation of this expression.\n# The basic algebra operations:\n# Addition ( + ) \n# Subtraction ( - ) \n# Multiplication ( * ) \n# Floor division ( // ) \n# Exponentiation ( ** ) \n# Example:\n# operator['+', '*', '-']\n# array = [2, 3, 4, 5]\n# result = 2 + 3 * 4 - 5\n# => result = 9\n# Note:\n# The length of operator list is equal to the length of operand list minus one.\n# Operand is a list of of non-negative integers.\n# Operator list has at least one operator, and operand list has at least two operands.\n#\n# $1 is a space-separated list\n# $2 is a space-separated list\ndo_algebra() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n do_algebra \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"** * +\" \"2 3 4 5\") = \"37\" ]]\n [[ $(candidate \"+ * -\" \"2 3 4 5\") = \"9\" ]]\n [[ $(candidate \"// *\" \"7 3 4\") = \"8\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "sh", - "prompt": "#!/bin/bash\n# Return maximum element in the list.\n# >>> max_element([1, 2, 3])\n# 3\n# >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n# 123\n#\n# $1 is a space-separated list\nmax_element() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n max_element \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3\") = \"3\" ]]\n [[ $(candidate \"5 3 -5 2 -3 3 9 0 124 1 -10\") = \"124\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function which returns the largest index of an element which\n# is not greater than or equal to the element immediately preceding it. If\n# no such element exists then return -1. The given array will not contain\n# duplicate values.\n# Examples:\n# can_arrange([1,2,4,3,5]) = 3\n# can_arrange([1,2,3]) = -1\n#\n# $1 is a space-separated list\ncan_arrange() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n can_arrange \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 4 3 5\") = \"3\" ]]\n [[ $(candidate \"1 2 4 5\") = \"-1\" ]]\n [[ $(candidate \"1 4 2 5 6 7 8 9 10\") = \"2\" ]]\n [[ $(candidate \"4 8 5 7 3\") = \"4\" ]]\n [[ $(candidate \"\") = \"-1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "sh", - "prompt": "#!/bin/bash\n# Imagine a road that's a perfectly straight infinitely long line.\n# n cars are driving left to right; simultaneously, a different set of n cars\n# are driving right to left. The two sets of cars start out being very far from\n# each other. All cars move in the same speed. Two cars are said to collide\n# when a car that's moving left to right hits a car that's moving right to left.\n# However, the cars are infinitely sturdy and strong; as a result, they continue moving\n# in their trajectory as if they did not collide.\n# This function outputs the number of such collisions.\n#\n# $1 is an integer\ncar_race_collision() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n car_race_collision \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2\") = \"4\" ]]\n [[ $(candidate \"3\") = \"9\" ]]\n [[ $(candidate \"4\") = \"16\" ]]\n [[ $(candidate \"8\") = \"64\" ]]\n [[ $(candidate \"10\") = \"100\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function that returns True if the last character\n# of a given string is an alphabetical character and is not\n# a part of a word, and False otherwise.\n# Note: \"word\" is a group of characters separated by space.\n# Examples:\n# check_if_last_char_is_a_letter(\"apple pie\") \u279e False\n# check_if_last_char_is_a_letter(\"apple pi e\") \u279e True\n# check_if_last_char_is_a_letter(\"apple pi e \") \u279e False\n# check_if_last_char_is_a_letter(\"\") \u279e False\n#\n# $1 is a string\ncheck_if_last_char_is_a_letter() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n check_if_last_char_is_a_letter \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"apple\") = \"false\" ]]\n [[ $(candidate \"apple pi e\") = \"true\" ]]\n [[ $(candidate \"eeeee\") = \"false\" ]]\n [[ $(candidate \"A\") = \"true\" ]]\n [[ $(candidate \"Pumpkin pie \") = \"false\" ]]\n [[ $(candidate \"Pumpkin pie 1\") = \"false\" ]]\n [[ $(candidate \"\") = \"false\" ]]\n [[ $(candidate \"eeeee e \") = \"false\" ]]\n [[ $(candidate \"apple pie\") = \"false\" ]]\n [[ $(candidate \"apple pi e \") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "sh", - "prompt": "#!/bin/bash\n# Return true if a given number is prime, and false otherwise.\n# >>> is_prime(6)\n# False\n# >>> is_prime(101)\n# True\n# >>> is_prime(11)\n# True\n# >>> is_prime(13441)\n# True\n# >>> is_prime(61)\n# True\n# >>> is_prime(4)\n# False\n# >>> is_prime(1)\n# False\n#\n# $1 is an integer\nis_prime() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n is_prime \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"6\") = \"false\" ]]\n [[ $(candidate \"101\") = \"true\" ]]\n [[ $(candidate \"11\") = \"true\" ]]\n [[ $(candidate \"13441\") = \"true\" ]]\n [[ $(candidate \"61\") = \"true\" ]]\n [[ $(candidate \"4\") = \"false\" ]]\n [[ $(candidate \"1\") = \"false\" ]]\n [[ $(candidate \"5\") = \"true\" ]]\n [[ $(candidate \"11\") = \"true\" ]]\n [[ $(candidate \"17\") = \"true\" ]]\n [[ $(candidate \"85\") = \"false\" ]]\n [[ $(candidate \"77\") = \"false\" ]]\n [[ $(candidate \"255379\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a list of positive integers x. return a sorted list of all \n# elements that hasn't any even digit.\n# Note: Returned list should be sorted in increasing order.\n# For example:\n# >>> unique_digits([15, 33, 1422, 1])\n# [1, 15, 33]\n# >>> unique_digits([152, 323, 1422, 10])\n# []\n#\n# $1 is a space-separated list\nunique_digits() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n unique_digits \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"15 33 1422 1\") = \"1 15 33\" ]]\n [[ $(candidate \"152 323 1422 10\") = \"\" ]]\n [[ $(candidate \"12345 2033 111 151\") = \"111 151\" ]]\n [[ $(candidate \"135 103 31\") = \"31 135\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "sh", - "prompt": "#!/bin/bash\n# Input are two strings a and b consisting only of 1s and 0s.\n# Perform binary XOR on these inputs and return result also as a string.\n# >>> string_xor('010', '110')\n# '100'\n#\n# $1 is a string\n# $2 is a string\nstring_xor() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n string_xor \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"111000\" \"101010\") = \"010010\" ]]\n [[ $(candidate \"1\" \"1\") = \"0\" ]]\n [[ $(candidate \"0101\" \"0000\") = \"0101\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "sh", - "prompt": "#!/bin/bash\n# sum_to_n is a function that sums numbers from 1 to n.\n# >>> sum_to_n(30)\n# 465\n# >>> sum_to_n(100)\n# 5050\n# >>> sum_to_n(5)\n# 15\n# >>> sum_to_n(10)\n# 55\n# >>> sum_to_n(1)\n# 1\n#\n# $1 is an integer\nsum_to_n() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n sum_to_n \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1\") = \"1\" ]]\n [[ $(candidate \"6\") = \"21\" ]]\n [[ $(candidate \"11\") = \"66\" ]]\n [[ $(candidate \"30\") = \"465\" ]]\n [[ $(candidate \"100\") = \"5050\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a list of numbers, return the sum of squares of the numbers\n# in the list that are odd. Ignore numbers that are negative or not integers.\n# double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10\n# double_the_difference([-1, -2, 0]) == 0\n# double_the_difference([9, -2]) == 81\n# double_the_difference([0]) == 0 \n# If the input list is empty, return 0.\n#\n# $1 is a space-separated list\ndouble_the_difference() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n double_the_difference \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"0\" ]]\n [[ $(candidate \"5.0 4.0\") = \"25\" ]]\n [[ $(candidate \"0.1 0.2 0.3\") = \"0\" ]]\n [[ $(candidate \"-10.0 -20.0 -30.0\") = \"0\" ]]\n [[ $(candidate \"-1.0 -2.0 8.0\") = \"0\" ]]\n [[ $(candidate \"0.2 3.0 5.0\") = \"34\" ]]\n [[ $(candidate \"-9.0 -7.0 -5.0 -3.0 -1.0 1.0 3.0 5.0 7.0 9.0\") = \"165\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "sh", - "prompt": "#!/bin/bash\n# Return length of given string\n# >>> strlen('')\n# 0\n# >>> strlen('abc')\n# 3\n#\n# $1 is a string\nstrlen() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n strlen \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"0\" ]]\n [[ $(candidate \"x\") = \"1\" ]]\n [[ $(candidate \"asdasnakj\") = \"9\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "sh", - "prompt": "#!/bin/bash\n# You'll be given a string of words, and your task is to count the number\n# of boredoms. A boredom is a sentence that starts with the word \"I\".\n# Sentences are delimited by '.', '?' or '!'.\n# For example:\n# >>> is_bored(\"Hello world\")\n# 0\n# >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n# 1\n#\n# $1 is a string\nis_bored() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n is_bored \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Hello world\") = \"0\" ]]\n [[ $(candidate \"Is the sky blue?\") = \"0\" ]]\n [[ $(candidate \"I love It \\!\") = \"1\" ]]\n [[ $(candidate \"bIt\") = \"0\" ]]\n [[ $(candidate \"I feel good today. I will be productive. will kill It\") = \"2\" ]]\n [[ $(candidate \"You and I are going for a walk\") = \"0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function vowels_count which takes a string representing\n# a word as input and returns the number of vowels in the string.\n# Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n# vowel, but only when it is at the end of the given word.\n# Example:\n# >>> vowels_count(\"abcde\")\n# 2\n# >>> vowels_count(\"ACEDY\")\n# 3\n#\n# $1 is a string\nvowels_count() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n vowels_count \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"abcde\") = \"2\" ]]\n [[ $(candidate \"Alone\") = \"3\" ]]\n [[ $(candidate \"key\") = \"2\" ]]\n [[ $(candidate \"bye\") = \"1\" ]]\n [[ $(candidate \"keY\") = \"2\" ]]\n [[ $(candidate \"bYe\") = \"1\" ]]\n [[ $(candidate \"ACEDY\") = \"3\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "sh", - "prompt": "#!/bin/bash\n# Return n-th Fibonacci number.\n# >>> fib(10)\n# 55\n# >>> fib(1)\n# 1\n# >>> fib(8)\n# 21\n#\n# $1 is an integer\nfib() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n fib \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"10\") = \"55\" ]]\n [[ $(candidate \"1\") = \"1\" ]]\n [[ $(candidate \"8\") = \"21\" ]]\n [[ $(candidate \"11\") = \"89\" ]]\n [[ $(candidate \"12\") = \"144\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "sh", - "prompt": "#!/bin/bash\n# Your task is to implement a function that will simplify the expression\n# x * n. The function returns True if x * n evaluates to a whole number and False\n# otherwise. Both x and n, are string representation of a fraction, and have the following format,\n# / where both numerator and denominator are positive whole numbers.\n# You can assume that x, and n are valid fractions, and do not have zero as denominator.\n# simplify(\"1/5\", \"5/1\") = True\n# simplify(\"1/6\", \"2/1\") = False\n# simplify(\"7/10\", \"10/2\") = False\n#\n# $1 is a string\n# $2 is a string\nsimplify() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n simplify \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1/5\" \"5/1\") = \"true\" ]]\n [[ $(candidate \"1/6\" \"2/1\") = \"false\" ]]\n [[ $(candidate \"5/1\" \"3/1\") = \"true\" ]]\n [[ $(candidate \"7/10\" \"10/2\") = \"false\" ]]\n [[ $(candidate \"2/10\" \"50/10\") = \"true\" ]]\n [[ $(candidate \"7/2\" \"4/2\") = \"true\" ]]\n [[ $(candidate \"11/6\" \"6/1\") = \"true\" ]]\n [[ $(candidate \"2/3\" \"5/2\") = \"false\" ]]\n [[ $(candidate \"5/2\" \"3/5\") = \"false\" ]]\n [[ $(candidate \"2/4\" \"8/4\") = \"true\" ]]\n [[ $(candidate \"2/4\" \"4/2\") = \"true\" ]]\n [[ $(candidate \"1/5\" \"5/1\") = \"true\" ]]\n [[ $(candidate \"1/5\" \"1/5\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a string s, count the number of uppercase vowels in even indices.\n# For example:\n# count_upper('aBCdEf') returns 1\n# count_upper('abcdefg') returns 0\n# count_upper('dBBE') returns 0\n#\n# $1 is a string\ncount_upper() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n count_upper \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"aBCdEf\") = \"1\" ]]\n [[ $(candidate \"abcdefg\") = \"0\" ]]\n [[ $(candidate \"dBBE\") = \"0\" ]]\n [[ $(candidate \"B\") = \"0\" ]]\n [[ $(candidate \"U\") = \"1\" ]]\n [[ $(candidate \"\") = \"0\" ]]\n [[ $(candidate \"EEEE\") = \"2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a rectangular grid of wells. Each row represents a single well,\n# and each 1 in a row represents a single unit of water.\n# Each well has a corresponding bucket that can be used to extract water from it, \n# and all buckets have the same capacity.\n# Your task is to use the buckets to empty the wells.\n# Output the number of times you need to lower the buckets.\n# Example 1:\n# Input: \n# grid : [[0,0,1,0], [0,1,0,0], [1,1,1,1]]\n# bucket_capacity : 1\n# Output: 6\n# Example 2:\n# Input: \n# grid : [[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]]\n# bucket_capacity : 2\n# Output: 5\n# Example 3:\n# Input: \n# grid : [[0,0,0], [0,0,0]]\n# bucket_capacity : 5\n# Output: 0\n# Constraints:\n# * all wells have the same length\n# * 1 <= grid.length <= 10^2\n# * 1 <= grid[:,1].length <= 10^2\n# * grid[i][j] -> 0 | 1\n# * 1 <= capacity <= 10\n#\n# $1 is a newline-separated, space-separated list\n# $2 is an integer\nmax_fill() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n max_fill \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"0 0 1 0\\n0 1 0 0\\n1 1 1 1\" \"1\") = \"6\" ]]\n [[ $(candidate \"0 0 1 1\\n0 0 0 0\\n1 1 1 1\\n0 1 1 1\" \"2\") = \"5\" ]]\n [[ $(candidate \"0 0 0\\n0 0 0\" \"5\") = \"0\" ]]\n [[ $(candidate \"1 1 1 1\\n1 1 1 1\" \"2\") = \"4\" ]]\n [[ $(candidate \"1 1 1 1\\n1 1 1 1\" \"9\") = \"2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "sh", - "prompt": "#!/bin/bash\n# Given an array arr of integers and a positive integer k, return a sorted list \n# of length k with the maximum k numbers in arr.\n# Example 1:\n# Input: arr = [-3, -4, 5], k = 3\n# Output: [-4, -3, 5]\n# Example 2:\n# Input: arr = [4, -4, 4], k = 2\n# Output: [4, 4]\n# Example 3:\n# Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1\n# Output: [2]\n# Note:\n# 1. The length of the array will be in the range of [1, 1000].\n# 2. The elements in the array will be in the range of [-1000, 1000].\n# 3. 0 <= k <= len(arr)\n#\n# $1 is a space-separated list\n# $2 is an integer\nmaximum() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n maximum \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"-3 -4 5\" \"3\") = \"-4 -3 5\" ]]\n [[ $(candidate \"4 -4 4\" \"2\") = \"4 4\" ]]\n [[ $(candidate \"-3 2 1 2 -1 -2 1\" \"1\") = \"2\" ]]\n [[ $(candidate \"123 -123 20 0 1 2 -3\" \"3\") = \"2 20 123\" ]]\n [[ $(candidate \"-123 20 0 1 2 -3\" \"4\") = \"0 1 2 20\" ]]\n [[ $(candidate \"5 15 0 3 -13 -8 0\" \"7\") = \"-13 -8 0 0 3 5 15\" ]]\n [[ $(candidate \"-1 0 2 5 3 -10\" \"2\") = \"3 5\" ]]\n [[ $(candidate \"1 0 5 -7\" \"1\") = \"5\" ]]\n [[ $(candidate \"4 -4\" \"2\") = \"-4 4\" ]]\n [[ $(candidate \"-10 10\" \"2\") = \"-10 10\" ]]\n [[ $(candidate \"1 2 3 -23 243 -400 0\" \"0\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that takes a message, and encodes in such a \n# way that it swaps case of all letters, replaces all vowels in \n# the message with the letter that appears 2 places ahead of that \n# vowel in the english alphabet. \n# Assume only letters. \n# Examples:\n# >>> encode('test')\n# 'TGST'\n# >>> encode('This is a message')\n# 'tHKS KS C MGSSCGG'\n#\n# $1 is a string\nencode() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n encode \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"TEST\") = \"tgst\" ]]\n [[ $(candidate \"Mudasir\") = \"mWDCSKR\" ]]\n [[ $(candidate \"YES\") = \"ygs\" ]]\n [[ $(candidate \"This is a message\") = \"tHKS KS C MGSSCGG\" ]]\n [[ $(candidate \"I DoNt KnOw WhAt tO WrItE\") = \"k dQnT kNqW wHcT Tq wRkTg\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "sh", - "prompt": "#!/bin/bash\n# remove_vowels is a function that takes string and returns string without vowels.\n# >>> remove_vowels('')\n# ''\n# >>> remove_vowels('abcdef')\n# 'bcdf'\n# >>> remove_vowels('aaaaa')\n# ''\n# >>> remove_vowels('aaBAA')\n# 'B'\n# >>> remove_vowels('zbcd')\n# 'zbcd'\n#\n# $1 is a string\nremove_vowels() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n remove_vowels \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"abcdef\\nghijklm\") = \"bcdf\\nghjklm\" ]]\n [[ $(candidate \"fedcba\") = \"fdcb\" ]]\n [[ $(candidate \"eeeee\") = \"\" ]]\n [[ $(candidate \"acBAA\") = \"cB\" ]]\n [[ $(candidate \"EcBOO\") = \"cB\" ]]\n [[ $(candidate \"ybcd\") = \"ybcd\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "sh", - "prompt": "#!/bin/bash\n# Return only positive numbers in the list.\n# >>> get_positive([-1, 2, -4, 5, 6])\n# [2, 5, 6]\n# >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n# [5, 3, 2, 3, 9, 123, 1]\n#\n# $1 is a space-separated list\nget_positive() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n get_positive \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"-1 -2 4 5 6\") = \"4 5 6\" ]]\n [[ $(candidate \"5 3 -5 2 3 3 9 0 123 1 -10\") = \"5 3 2 3 3 9 123 1\" ]]\n [[ $(candidate \"-1 -2\") = \"\" ]]\n [[ $(candidate \"\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "sh", - "prompt": "#!/bin/bash\n# Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n# >>> string_sequence(0)\n# '0'\n# >>> string_sequence(5)\n# '0 1 2 3 4 5'\n#\n# $1 is an integer\nstring_sequence() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n string_sequence \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"0\") = \"0\" ]]\n [[ $(candidate \"3\") = \"0 1 2 3\" ]]\n [[ $(candidate \"10\") = \"0 1 2 3 4 5 6 7 8 9 10\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a positive integer n, you have to make a pile of n levels of stones.\n# The first level has n stones.\n# The number of stones in the next level is:\n# - the next odd number if n is odd.\n# - the next even number if n is even.\n# Return the number of stones in each level in a list, where element at index\n# i represents the number of stones in the level (i+1).\n# Examples:\n# >>> make_a_pile(3)\n# [3, 5, 7]\n#\n# $1 is an integer\nmake_a_pile() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n make_a_pile \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3\") = \"3 5 7\" ]]\n [[ $(candidate \"4\") = \"4 6 8 10\" ]]\n [[ $(candidate \"5\") = \"5 7 9 11 13\" ]]\n [[ $(candidate \"6\") = \"6 8 10 12 14 16\" ]]\n [[ $(candidate \"8\") = \"8 10 12 14 16 18 20 22\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "sh", - "prompt": "#!/bin/bash\n# Task\n# 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\n# then check if the result string is palindrome.\n# A string is called palindrome if it reads the same backward as forward.\n# You should return a tuple containing the result string and True/False for the check.\n# Example\n# For s = \"abcde\", c = \"ae\", the result should be ('bcd',False)\n# For s = \"abcdef\", c = \"b\" the result should be ('acdef',False)\n# For s = \"abcdedcba\", c = \"ab\", the result should be ('cdedc',True)\n#\n# $1 is a string\n# $2 is a string\nreverse_delete() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n reverse_delete \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"abcde\" \"ae\") = \"bcd false\" ]]\n [[ $(candidate \"abcdef\" \"b\") = \"acdef false\" ]]\n [[ $(candidate \"abcdedcba\" \"ab\") = \"cdedc true\" ]]\n [[ $(candidate \"dwik\" \"w\") = \"dik false\" ]]\n [[ $(candidate \"a\" \"a\") = \" true\" ]]\n [[ $(candidate \"abcdedcba\" \"\") = \"abcdedcba true\" ]]\n [[ $(candidate \"abcdedcba\" \"v\") = \"abcdedcba true\" ]]\n [[ $(candidate \"vabba\" \"v\") = \"abba true\" ]]\n [[ $(candidate \"mamma\" \"mia\") = \" true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "sh", - "prompt": "#!/bin/bash\n# For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n# >>> flip_case('Hello')\n# 'hELLO'\n#\n# $1 is a string\nflip_case() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n flip_case \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"Hello\\!\") = \"hELLO\\!\" ]]\n [[ $(candidate \"These violent delights have violent ends\") = \"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a string s.\n# if s[i] is a letter, reverse its case from lower to upper or vise versa, \n# otherwise keep it as it is.\n# If the string contains no letters, reverse the string.\n# The function should return the resulted string.\n# Examples\n# solve(\"1234\") = \"4321\"\n# solve(\"ab\") = \"AB\"\n# solve(\"#a@C\") = \"#A@c\"\n#\n# $1 is a string\nsolve() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n solve \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"AsDf\") = \"aSdF\" ]]\n [[ $(candidate \"1234\") = \"4321\" ]]\n [[ $(candidate \"ab\") = \"AB\" ]]\n [[ $(candidate \"#a@C\") = \"#A@c\" ]]\n [[ $(candidate \"#AsdfW^45\") = \"#aSDFw^45\" ]]\n [[ $(candidate \"#6@2\") = \"2@6#\" ]]\n [[ $(candidate \"#\\$a^D\") = \"#\\$A^d\" ]]\n [[ $(candidate \"#ccc\") = \"#CCC\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "sh", - "prompt": "#!/bin/bash\n# This function takes two positive numbers x and y and returns the\n# biggest even integer number that is in the range [x, y] inclusive. If \n# there's no such number, then the function should return -1.\n# For example:\n# choose_num(12, 15) = 14\n# choose_num(13, 12) = -1\n#\n# $1 is an integer\n# $2 is an integer\nchoose_num() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n choose_num \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"12\" \"15\") = \"14\" ]]\n [[ $(candidate \"13\" \"12\") = \"-1\" ]]\n [[ $(candidate \"33\" \"12354\") = \"12354\" ]]\n [[ $(candidate \"5234\" \"5233\") = \"-1\" ]]\n [[ $(candidate \"6\" \"29\") = \"28\" ]]\n [[ $(candidate \"27\" \"10\") = \"-1\" ]]\n [[ $(candidate \"7\" \"7\") = \"-1\" ]]\n [[ $(candidate \"546\" \"546\") = \"546\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a string representing a sentence,\n# the sentence contains some words separated by a space,\n# and you have to return a string that contains the words from the original sentence,\n# whose lengths are prime numbers,\n# the order of the words in the new string should be the same as the original one.\n# Example 1:\n# Input: sentence = \"This is a test\"\n# Output: \"is\"\n# Example 2:\n# Input: sentence = \"lets go for swimming\"\n# Output: \"go for\"\n# Constraints:\n# * 1 <= len(sentence) <= 100\n# * sentence contains only letters\n#\n# $1 is a string\nwords_in_sentence() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n words_in_sentence \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"This is a test\") = \"is\" ]]\n [[ $(candidate \"lets go for swimming\") = \"go for\" ]]\n [[ $(candidate \"there is no place available here\") = \"there is no place\" ]]\n [[ $(candidate \"Hi I am Hussein\") = \"Hi am Hussein\" ]]\n [[ $(candidate \"go for it\") = \"go for it\" ]]\n [[ $(candidate \"here\") = \"\" ]]\n [[ $(candidate \"here is\") = \"is\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "sh", - "prompt": "#!/bin/bash\n# Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n# >>> intersperse([], 4)\n# []\n# >>> intersperse([1, 2, 3], 4)\n# [1, 4, 2, 4, 3]\n#\n# $1 is a space-separated list\n# $2 is an integer\nintersperse() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n intersperse \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\" \"7\") = \"\" ]]\n [[ $(candidate \"5 6 3 2\" \"8\") = \"5 8 6 8 3 8 2\" ]]\n [[ $(candidate \"2 2 2\" \"2\") = \"2 2 2 2 2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "sh", - "prompt": "#!/bin/bash\n# Your task is to write a function that returns true if a number x is a simple\n# power of n and false in other cases.\n# x is a simple power of n if n**int=x\n# For example:\n# is_simple_power(1, 4) => true\n# is_simple_power(2, 2) => true\n# is_simple_power(8, 2) => true\n# is_simple_power(3, 2) => false\n# is_simple_power(3, 1) => false\n# is_simple_power(5, 3) => false\n#\n# $1 is an integer\n# $2 is an integer\nis_simple_power() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n is_simple_power \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"16\" \"2\") = \"true\" ]]\n [[ $(candidate \"143214\" \"16\") = \"false\" ]]\n [[ $(candidate \"4\" \"2\") = \"true\" ]]\n [[ $(candidate \"9\" \"3\") = \"true\" ]]\n [[ $(candidate \"16\" \"4\") = \"true\" ]]\n [[ $(candidate \"24\" \"2\") = \"false\" ]]\n [[ $(candidate \"128\" \"4\") = \"false\" ]]\n [[ $(candidate \"12\" \"6\") = \"false\" ]]\n [[ $(candidate \"1\" \"1\") = \"true\" ]]\n [[ $(candidate \"1\" \"12\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that returns true if the given number is the multiplication of 3 prime numbers\n# and false otherwise.\n# Knowing that (a) is less then 100. \n# Example:\n# is_multiply_prime(30) == True\n# 30 = 2 * 3 * 5\n#\n# $1 is an integer\nis_multiply_prime() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n is_multiply_prime \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\") = \"false\" ]]\n [[ $(candidate \"30\") = \"true\" ]]\n [[ $(candidate \"8\") = \"true\" ]]\n [[ $(candidate \"10\") = \"false\" ]]\n [[ $(candidate \"125\") = \"true\" ]]\n [[ $(candidate \"105\") = \"true\" ]]\n [[ $(candidate \"126\") = \"false\" ]]\n [[ $(candidate \"729\") = \"false\" ]]\n [[ $(candidate \"891\") = \"false\" ]]\n [[ $(candidate \"1001\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "sh", - "prompt": "#!/bin/bash\n# Given the lengths of the three sides of a triangle. Return True if the three\n# sides form a right-angled triangle, False otherwise.\n# A right-angled triangle is a triangle in which one angle is right angle or \n# 90 degree.\n# Example:\n# right_angle_triangle(3, 4, 5) == True\n# right_angle_triangle(1, 2, 3) == False\n#\n# $1 is an integer\n# $2 is an integer\n# $3 is an integer\nright_angle_triangle() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n right_angle_triangle \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3\" \"4\" \"5\") = \"true\" ]]\n [[ $(candidate \"1\" \"2\" \"3\") = \"false\" ]]\n [[ $(candidate \"10\" \"6\" \"8\") = \"true\" ]]\n [[ $(candidate \"2\" \"2\" \"2\") = \"false\" ]]\n [[ $(candidate \"7\" \"24\" \"25\") = \"true\" ]]\n [[ $(candidate \"10\" \"5\" \"7\") = \"false\" ]]\n [[ $(candidate \"5\" \"12\" \"13\") = \"true\" ]]\n [[ $(candidate \"15\" \"8\" \"17\") = \"true\" ]]\n [[ $(candidate \"48\" \"55\" \"73\") = \"true\" ]]\n [[ $(candidate \"1\" \"1\" \"1\") = \"false\" ]]\n [[ $(candidate \"2\" \"2\" \"10\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function that takes 3 numbers.\n# Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n# Returns false in any other cases.\n# Examples\n# any_int(5, 2, 7) \u279e True\n# any_int(3, 2, 2) \u279e False\n# any_int(3, -2, 1) \u279e True\n# any_int(3.6, -2.2, 2) \u279e False\n#\n# $1 is a floating point\n# $2 is a floating point\n# $3 is a floating point\nany_int() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n any_int \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2\" \"3\" \"1\") = \"true\" ]]\n [[ $(candidate \"2.5\" \"2\" \"3\") = \"false\" ]]\n [[ $(candidate \"1.5\" \"5\" \"3.5\") = \"false\" ]]\n [[ $(candidate \"2\" \"6\" \"2\") = \"false\" ]]\n [[ $(candidate \"4\" \"2\" \"2\") = \"true\" ]]\n [[ $(candidate \"2.2\" \"2.2\" \"2.2\") = \"false\" ]]\n [[ $(candidate \"-4\" \"6\" \"2\") = \"true\" ]]\n [[ $(candidate \"2\" \"1\" \"1\") = \"true\" ]]\n [[ $(candidate \"3\" \"4\" \"7\") = \"true\" ]]\n [[ $(candidate \"3.0\" \"4\" \"7\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "sh", - "prompt": "#!/bin/bash\n# This function takes a list l and returns a list l' such that\n# l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n# to the values of the corresponding indicies of l, but sorted.\n# >>> sort_third([1, 2, 3])\n# [1, 2, 3]\n# >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n# [2, 6, 3, 4, 8, 9, 5]\n#\n# $1 is a space-separated list\nsort_third() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n sort_third \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5 6 3 4 8 9 2\") = \"2 6 3 4 8 9 5\" ]]\n [[ $(candidate \"5 8 3 4 6 9 2\") = \"2 8 3 4 6 9 5\" ]]\n [[ $(candidate \"5 6 9 4 8 3 2\") = \"2 6 9 4 8 3 5\" ]]\n [[ $(candidate \"5 6 3 4 8 9 2 1\") = \"2 6 3 4 8 9 5 1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_53_add", - "language": "sh", - "prompt": "#!/bin/bash\n# Add two numbers x and y\n# >>> add(2, 3)\n# 5\n# >>> add(5, 7)\n# 12\n#\n# $1 is an integer\n# $2 is an integer\nadd() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n add \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"0\" \"1\") = \"1\" ]]\n [[ $(candidate \"1\" \"0\") = \"1\" ]]\n [[ $(candidate \"2\" \"3\") = \"5\" ]]\n [[ $(candidate \"5\" \"7\") = \"12\" ]]\n [[ $(candidate \"7\" \"5\") = \"12\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_69_search", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n# zero, and has a frequency greater than or equal to the value of the integer itself. \n# The frequency of an integer is the number of times it appears in the list.\n# If no such a value exist, return -1.\n# Examples:\n# search([4, 1, 2, 2, 3, 1]) == 2\n# search([1, 2, 2, 3, 3, 3, 4, 4, 4]) == 3\n# search([5, 5, 4, 4, 4]) == -1\n#\n# $1 is a space-separated list\nsearch() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n search \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5 5 5 5 1\") = \"1\" ]]\n [[ $(candidate \"4 1 4 1 4 4\") = \"4\" ]]\n [[ $(candidate \"3 3\") = \"-1\" ]]\n [[ $(candidate \"8 8 8 8 8 8 8 8\") = \"8\" ]]\n [[ $(candidate \"2 3 3 2 2\") = \"2\" ]]\n [[ $(candidate \"2 7 8 8 4 8 7 3 9 6 5 10 4 3 6 7 1 7 4 10 8 1\") = \"1\" ]]\n [[ $(candidate \"3 2 8 2\") = \"2\" ]]\n [[ $(candidate \"6 7 1 8 8 10 5 8 5 3 10\") = \"1\" ]]\n [[ $(candidate \"8 8 3 6 5 6 4\") = \"-1\" ]]\n [[ $(candidate \"6 9 6 7 1 4 7 1 8 8 9 8 10 10 8 4 10 4 10 1 2 9 5 7 9\") = \"1\" ]]\n [[ $(candidate \"1 9 10 1 3\") = \"1\" ]]\n [[ $(candidate \"6 9 7 5 8 7 5 3 7 5 10 10 3 6 10 2 8 6 5 4 9 5 3 10\") = \"5\" ]]\n [[ $(candidate \"1\") = \"1\" ]]\n [[ $(candidate \"8 8 10 6 4 3 5 8 2 4 2 8 4 6 10 4 2 1 10 2 1 1 5\") = \"4\" ]]\n [[ $(candidate \"2 10 4 8 2 10 5 1 2 9 5 5 6 3 8 6 4 10\") = \"2\" ]]\n [[ $(candidate \"1 6 10 1 6 9 10 8 6 8 7 3\") = \"1\" ]]\n [[ $(candidate \"9 2 4 1 5 1 5 2 5 7 7 7 3 10 1 5 4 2 8 4 1 9 10 7 10 2 8 10 9 4\") = \"4\" ]]\n [[ $(candidate \"2 6 4 2 8 7 5 6 4 10 4 6 3 7 8 8 3 1 4 2 2 10 7\") = \"4\" ]]\n [[ $(candidate \"9 8 6 10 2 6 10 2 7 8 10 3 8 2 6 2 3 1\") = \"2\" ]]\n [[ $(candidate \"5 5 3 9 5 6 3 2 8 5 6 10 10 6 8 4 10 7 7 10 8\") = \"-1\" ]]\n [[ $(candidate \"10\") = \"-1\" ]]\n [[ $(candidate \"9 7 7 2 4 7 2 10 9 7 5 7 2\") = \"2\" ]]\n [[ $(candidate \"5 4 10 2 1 1 10 3 6 1 8\") = \"1\" ]]\n [[ $(candidate \"7 9 9 9 3 4 1 5 9 1 2 1 1 10 7 5 6 7 6 7 7 6\") = \"1\" ]]\n [[ $(candidate \"3 10 10 9 2\") = \"-1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that takes a string and returns True if the string\n# length is a prime number or False otherwise\n# Examples\n# prime_length('Hello') == True\n# prime_length('abcdcba') == True\n# prime_length('kittens') == True\n# prime_length('orange') == False\n#\n# $1 is a string\nprime_length() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n prime_length \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Hello\") = \"true\" ]]\n [[ $(candidate \"abcdcba\") = \"true\" ]]\n [[ $(candidate \"kittens\") = \"true\" ]]\n [[ $(candidate \"orange\") = \"false\" ]]\n [[ $(candidate \"wow\") = \"true\" ]]\n [[ $(candidate \"world\") = \"true\" ]]\n [[ $(candidate \"MadaM\") = \"true\" ]]\n [[ $(candidate \"Wow\") = \"true\" ]]\n [[ $(candidate \"\") = \"false\" ]]\n [[ $(candidate \"HI\") = \"true\" ]]\n [[ $(candidate \"go\") = \"true\" ]]\n [[ $(candidate \"gogo\") = \"false\" ]]\n [[ $(candidate \"aaaaaaaaaaaaaaa\") = \"false\" ]]\n [[ $(candidate \"Madam\") = \"true\" ]]\n [[ $(candidate \"M\") = \"false\" ]]\n [[ $(candidate \"0\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_58_common", - "language": "sh", - "prompt": "#!/bin/bash\n# Return sorted unique common elements for two lists.\n# >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n# [1, 5, 653]\n# >>> common([5, 3, 2, 8], [3, 2])\n# [2, 3]\n#\n# $1 is a space-separated list\n# $2 is a space-separated list\ncommon() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n common \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 4 3 34 653 2 5\" \"5 7 1 5 9 653 121\") = \"1 5 653\" ]]\n [[ $(candidate \"5 3 2 8\" \"3 2\") = \"2 3\" ]]\n [[ $(candidate \"4 3 2 8\" \"3 2 4\") = \"2 3 4\" ]]\n [[ $(candidate \"4 3 2 8\" \"\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "sh", - "prompt": "#!/bin/bash\n# The Brazilian factorial is defined as:\n# brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n# where n > 0\n# For example:\n# >>> special_factorial(4)\n# 288\n# The function will receive an integer as input and should return the special\n# factorial of this integer.\n#\n# $1 is an integer\nspecial_factorial() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n special_factorial \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"4\") = \"288\" ]]\n [[ $(candidate \"5\") = \"34560\" ]]\n [[ $(candidate \"7\") = \"125411328000\" ]]\n [[ $(candidate \"1\") = \"1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "sh", - "prompt": "#!/bin/bash\n# In this problem, you will implement a function that takes two lists of numbers,\n# and determines whether it is possible to perform an exchange of elements\n# between them to make lst1 a list of only even numbers.\n# There is no limit on the number of exchanged elements between lst1 and lst2.\n# If it is possible to exchange elements between the lst1 and lst2 to make\n# all the elements of lst1 to be even, return \"YES\".\n# Otherwise, return \"NO\".\n# For example:\n# exchange([1, 2, 3, 4], [1, 2, 3, 4]) => \"YES\"\n# exchange([1, 2, 3, 4], [1, 5, 3, 4]) => \"NO\"\n# It is assumed that the input lists will be non-empty.\n#\n# $1 is a space-separated list\n# $2 is a space-separated list\nexchange() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n exchange \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3 4\" \"1 2 3 4\") = \"YES\" ]]\n [[ $(candidate \"1 2 3 4\" \"1 5 3 4\") = \"NO\" ]]\n [[ $(candidate \"1 2 3 4\" \"2 1 4 3\") = \"YES\" ]]\n [[ $(candidate \"5 7 3\" \"2 6 4\") = \"YES\" ]]\n [[ $(candidate \"5 7 3\" \"2 6 3\") = \"NO\" ]]\n [[ $(candidate \"3 2 6 1 8 9\" \"3 5 5 1 1 1\") = \"NO\" ]]\n [[ $(candidate \"100 200\" \"200 200\") = \"YES\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a non-empty array of integers arr and an integer k, return\n# the sum of the elements with at most two digits from the first k elements of arr.\n# Example:\n# Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4\n# Output: 24 # sum of 21 + 3\n# Constraints:\n# 1. 1 <= len(arr) <= 100\n# 2. 1 <= k <= len(arr)\n#\n# $1 is a space-separated list\n# $2 is an integer\nadd_elements() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n add_elements \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 -2 -3 41 57 76 87 88 99\" \"3\") = \"-4\" ]]\n [[ $(candidate \"111 121 3 4000 5 6\" \"2\") = \"0\" ]]\n [[ $(candidate \"11 21 3 90 5 6 7 8 9\" \"4\") = \"125\" ]]\n [[ $(candidate \"111 21 3 4000 5 6 7 8 9\" \"4\") = \"24\" ]]\n [[ $(candidate \"1\" \"1\") = \"1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "sh", - "prompt": "#!/bin/bash\n# A simple program which should return the value of x if n is \n# a prime number and should return the value of y otherwise.\n# Examples:\n# for x_or_y(7, 34, 12) == 34\n# for x_or_y(15, 8, 5) == 5\n#\n# $1 is an integer\n# $2 is an integer\n# $3 is an integer\nx_or_y() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n x_or_y \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"7\" \"34\" \"12\") = \"34\" ]]\n [[ $(candidate \"15\" \"8\" \"5\") = \"5\" ]]\n [[ $(candidate \"3\" \"33\" \"5212\") = \"33\" ]]\n [[ $(candidate \"1259\" \"3\" \"52\") = \"3\" ]]\n [[ $(candidate \"7919\" \"-1\" \"12\") = \"-1\" ]]\n [[ $(candidate \"3609\" \"1245\" \"583\") = \"583\" ]]\n [[ $(candidate \"91\" \"56\" \"129\") = \"129\" ]]\n [[ $(candidate \"6\" \"34\" \"1234\") = \"1234\" ]]\n [[ $(candidate \"1\" \"2\" \"0\") = \"0\" ]]\n [[ $(candidate \"2\" \"2\" \"0\") = \"2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "sh", - "prompt": "#!/bin/bash\n# Given length of a side and high return area for a triangle.\n# >>> triangle_area(5, 3)\n# 7.5\n#\n# $1 is an integer\n# $2 is an integer\ntriangle_area() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n triangle_area \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\" \"3\") = \"7.5\" ]]\n [[ $(candidate \"2\" \"2\") = \"2.0\" ]]\n [[ $(candidate \"10\" \"8\") = \"40.0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "sh", - "prompt": "#!/bin/bash\n# Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n# the last couple centuries. However, what people don't know is Tribonacci sequence.\n# Tribonacci sequence is defined by the recurrence:\n# tri(1) = 3\n# tri(n) = 1 + n / 2, if n is even.\n# tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n# For example:\n# tri(2) = 1 + (2 / 2) = 2\n# tri(4) = 3\n# tri(3) = tri(2) + tri(1) + tri(4)\n# = 2 + 3 + 3 = 8 \n# You are given a non-negative integer number n, you have to a return a list of the \n# first n + 1 numbers of the Tribonacci sequence.\n# Examples:\n# tri(3) = [1, 3, 2, 8]\n#\n# $1 is an integer\ntri() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n tri \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3\") = \"1 3 2 8\" ]]\n [[ $(candidate \"4\") = \"1 3 2 8 3\" ]]\n [[ $(candidate \"5\") = \"1 3 2 8 3 15\" ]]\n [[ $(candidate \"6\") = \"1 3 2 8 3 15 4\" ]]\n [[ $(candidate \"7\") = \"1 3 2 8 3 15 4 24\" ]]\n [[ $(candidate \"8\") = \"1 3 2 8 3 15 4 24 5\" ]]\n [[ $(candidate \"9\") = \"1 3 2 8 3 15 4 24 5 35\" ]]\n [[ $(candidate \"20\") = \"1 3 2 8 3 15 4 24 5 35 6 48 7 63 8 80 9 99 10 120 11\" ]]\n [[ $(candidate \"0\") = \"1\" ]]\n [[ $(candidate \"1\") = \"1 3\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a list of two strings, both strings consist of open\n# parentheses '(' or close parentheses ')' only.\n# Your job is to check if it is possible to concatenate the two strings in\n# some order, that the resulting string will be good.\n# A string S is considered to be good if and only if all parentheses in S\n# are balanced. For example: the string '(())()' is good, while the string\n# '())' is not.\n# Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n# Examples:\n# match_parens(['()(', ')']) == 'Yes'\n# match_parens([')', ')']) == 'No'\n#\n# $1 is a space-separated list\nmatch_parens() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n match_parens \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"()( )\") = \"Yes\" ]]\n [[ $(candidate \") )\") = \"No\" ]]\n [[ $(candidate \"(()(()) ())())\") = \"No\" ]]\n [[ $(candidate \")()) (()()(\") = \"Yes\" ]]\n [[ $(candidate \"(()))) (()())((\") = \"Yes\" ]]\n [[ $(candidate \"() ())\") = \"No\" ]]\n [[ $(candidate \"(()( ()))()\") = \"Yes\" ]]\n [[ $(candidate \"(((( ((())\") = \"No\" ]]\n [[ $(candidate \")(() (()(\") = \"No\" ]]\n [[ $(candidate \")( )(\") = \"No\" ]]\n [[ $(candidate \"( )\") = \"Yes\" ]]\n [[ $(candidate \") (\") = \"Yes\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "sh", - "prompt": "#!/bin/bash\n# From a list of integers, remove all elements that occur more than once.\n# Keep order of elements left the same as in the input.\n# >>> remove_duplicates([1, 2, 3, 2, 4])\n# [1, 3, 4]\n#\n# $1 is a space-separated list\nremove_duplicates() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n remove_duplicates \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"1 2 3 4\") = \"1 2 3 4\" ]]\n [[ $(candidate \"1 2 3 2 4 3 5\") = \"1 4 5\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "sh", - "prompt": "#!/bin/bash\n# Return a greatest common divisor of two integers a and b\n# >>> greatest_common_divisor(3, 5)\n# 1\n# >>> greatest_common_divisor(25, 15)\n# 5\n#\n# $1 is an integer\n# $2 is an integer\ngreatest_common_divisor() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n greatest_common_divisor \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3\" \"7\") = \"1\" ]]\n [[ $(candidate \"10\" \"15\") = \"5\" ]]\n [[ $(candidate \"49\" \"14\") = \"7\" ]]\n [[ $(candidate \"144\" \"60\") = \"12\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "sh", - "prompt": "#!/bin/bash\n# Checks if given string is a palindrome\n# >>> is_palindrome('')\n# True\n# >>> is_palindrome('aba')\n# True\n# >>> is_palindrome('aaaaa')\n# True\n# >>> is_palindrome('zbcd')\n# False\n#\n# $1 is a string\nis_palindrome() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n is_palindrome \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"true\" ]]\n [[ $(candidate \"aba\") = \"true\" ]]\n [[ $(candidate \"aaaaa\") = \"true\" ]]\n [[ $(candidate \"zbcd\") = \"false\" ]]\n [[ $(candidate \"xywyx\") = \"true\" ]]\n [[ $(candidate \"xywyz\") = \"false\" ]]\n [[ $(candidate \"xywzx\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "sh", - "prompt": "#!/bin/bash\n# xs represent coefficients of a polynomial.\n# xs[0] + xs[1] * x + xs[2] * x^2 + ....\n# Return derivative of this polynomial in the same form.\n# >>> derivative([3, 1, 2, 4, 5])\n# [1, 4, 12, 20]\n# >>> derivative([1, 2, 3])\n# [2, 6]\n#\n# $1 is a space-separated list\nderivative() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n derivative \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3 1 2 4 5\") = \"1 4 12 20\" ]]\n [[ $(candidate \"1 2 3\") = \"2 6\" ]]\n [[ $(candidate \"3 2 1\") = \"2 2\" ]]\n [[ $(candidate \"3 2 1 0 4\") = \"2 2 0 16\" ]]\n [[ $(candidate \"1\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "sh", - "prompt": "#!/bin/bash\n# In this task, you will be given a string that represents a number of apples and oranges \n# that are distributed in a basket of fruit this basket contains \n# apples, oranges, and mango fruits. Given the string that represents the total number of \n# the oranges and apples and an integer that represent the total number of the fruits \n# in the basket return the number of the mango fruits in the basket.\n# for examble:\n# fruit_distribution(\"5 apples and 6 oranges\", 19) ->19 - 5 - 6 = 8\n# fruit_distribution(\"0 apples and 1 oranges\",3) -> 3 - 0 - 1 = 2\n# fruit_distribution(\"2 apples and 3 oranges\", 100) -> 100 - 2 - 3 = 95\n# fruit_distribution(\"100 apples and 1 oranges\",120) -> 120 - 100 - 1 = 19\n#\n# $1 is a string\n# $2 is an integer\nfruit_distribution() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n fruit_distribution \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5 apples and 6 oranges\" \"19\") = \"8\" ]]\n [[ $(candidate \"5 apples and 6 oranges\" \"21\") = \"10\" ]]\n [[ $(candidate \"0 apples and 1 oranges\" \"3\") = \"2\" ]]\n [[ $(candidate \"1 apples and 0 oranges\" \"3\") = \"2\" ]]\n [[ $(candidate \"2 apples and 3 oranges\" \"100\") = \"95\" ]]\n [[ $(candidate \"2 apples and 3 oranges\" \"5\") = \"0\" ]]\n [[ $(candidate \"1 apples and 100 oranges\" \"120\") = \"19\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that takes an integer a and returns True \n# if this ingeger is a cube of some integer number.\n# Note: you may assume the input is always valid.\n# Examples:\n# iscube(1) ==> True\n# iscube(2) ==> False\n# iscube(-1) ==> True\n# iscube(64) ==> True\n# iscube(0) ==> True\n# iscube(180) ==> False\n#\n# $1 is an integer\niscube() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n iscube \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1\") = \"true\" ]]\n [[ $(candidate \"2\") = \"false\" ]]\n [[ $(candidate \"-1\") = \"true\" ]]\n [[ $(candidate \"64\") = \"true\" ]]\n [[ $(candidate \"180\") = \"false\" ]]\n [[ $(candidate \"1000\") = \"true\" ]]\n [[ $(candidate \"0\") = \"true\" ]]\n [[ $(candidate \"1729\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "sh", - "prompt": "#!/bin/bash\n# In this Kata, you have to sort an array of non-negative integers according to\n# number of ones in their binary representation in ascending order.\n# For similar number of ones, sort based on decimal value.\n# It must be implemented like this:\n# >>> sort_array([1, 5, 2, 3, 4]) == [1, 2, 3, 4, 5]\n# >>> sort_array([-2, -3, -4, -5, -6]) == [-6, -5, -4, -3, -2]\n# >>> sort_array([1, 0, 2, 3, 4]) [0, 1, 2, 3, 4]\n#\n# $1 is a space-separated list\nsort_array() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n sort_array \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 5 2 3 4\") = \"1 2 4 3 5\" ]]\n [[ $(candidate \"-2 -3 -4 -5 -6\") = \"-4 -2 -6 -5 -3\" ]]\n [[ $(candidate \"1 0 2 3 4\") = \"0 1 2 4 3\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"2 5 77 4 5 3 5 7 2 3 4\") = \"2 2 4 4 3 3 5 5 5 7 77\" ]]\n [[ $(candidate \"3 6 44 12 32 5\") = \"32 3 5 6 12 44\" ]]\n [[ $(candidate \"2 4 8 16 32\") = \"2 4 8 16 32\" ]]\n [[ $(candidate \"2 4 8 16 32\") = \"2 4 8 16 32\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "sh", - "prompt": "#!/bin/bash\n# brackets is a string of \"(\" and \")\".\n# return True if every opening bracket has a corresponding closing bracket.\n# >>> correct_bracketing(\"(\")\n# False\n# >>> correct_bracketing(\"()\")\n# True\n# >>> correct_bracketing(\"(()())\")\n# True\n# >>> correct_bracketing(\")(()\")\n# False\n#\n# $1 is a string\ncorrect_bracketing() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n correct_bracketing \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"()\") = \"true\" ]]\n [[ $(candidate \"(()())\") = \"true\" ]]\n [[ $(candidate \"()()(()())()\") = \"true\" ]]\n [[ $(candidate \"()()((()()())())(()()(()))\") = \"true\" ]]\n [[ $(candidate \"((()())))\") = \"false\" ]]\n [[ $(candidate \")(()\") = \"false\" ]]\n [[ $(candidate \"(\") = \"false\" ]]\n [[ $(candidate \"((((\") = \"false\" ]]\n [[ $(candidate \")\") = \"false\" ]]\n [[ $(candidate \"(()\") = \"false\" ]]\n [[ $(candidate \"()()(()())())(()\") = \"false\" ]]\n [[ $(candidate \"()()(()())()))()\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "sh", - "prompt": "#!/bin/bash\n# Task\n# Write a function that takes a string as input and returns the sum of the upper characters only'\n# ASCII codes.\n# Examples:\n# digitSum(\"\") => 0\n# digitSum(\"abAB\") => 131\n# digitSum(\"abcCd\") => 67\n# digitSum(\"helloE\") => 69\n# digitSum(\"woArBld\") => 131\n# digitSum(\"aAaaaXa\") => 153\n#\n# $1 is a string\ndigitSum() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n digitSum \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"0\" ]]\n [[ $(candidate \"abAB\") = \"131\" ]]\n [[ $(candidate \"abcCd\") = \"67\" ]]\n [[ $(candidate \"helloE\") = \"69\" ]]\n [[ $(candidate \"woArBld\") = \"131\" ]]\n [[ $(candidate \"aAaaaXa\") = \"153\" ]]\n [[ $(candidate \" How are yOu?\") = \"151\" ]]\n [[ $(candidate \"You arE Very Smart\") = \"327\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that accepts a list of strings as a parameter,\n# deletes the strings that have odd lengths from it,\n# and returns the resulted list with a sorted order,\n# The list is always a list of strings and never an array of numbers,\n# and it may contain duplicates.\n# The order of the list should be ascending by length of each word, and you\n# should return the list sorted by that rule.\n# If two words have the same length, sort the list alphabetically.\n# The function should return a list of strings in sorted order.\n# You may assume that all words will have the same length.\n# For example:\n# assert list_sort([\"aa\", \"a\", \"aaa\"]) => [\"aa\"]\n# assert list_sort([\"ab\", \"a\", \"aaa\", \"cd\"]) => [\"ab\", \"cd\"]\n#\n# $1 is a space-separated list\nsorted_list_sum() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n sorted_list_sum \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"aa a aaa\") = \"aa\" ]]\n [[ $(candidate \"school AI asdf b\") = \"AI asdf school\" ]]\n [[ $(candidate \"d b c a\") = \"\" ]]\n [[ $(candidate \"d dcba abcd a\") = \"abcd dcba\" ]]\n [[ $(candidate \"AI ai au\") = \"AI ai au\" ]]\n [[ $(candidate \"a b b c c a\") = \"\" ]]\n [[ $(candidate \"aaaa bbbb dd cc\") = \"cc dd aaaa bbbb\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given an array arr of integers and you need to return\n# sum of magnitudes of integers multiplied by product of all signs\n# of each number in the array, represented by 1, -1 or 0.\n# Note: return None for empty arr.\n# Example:\n# >>> prod_signs([1, 2, 2, -4]) == -9\n# >>> prod_signs([0, 1]) == 0\n# >>> prod_signs([]) == None\n#\n# $1 is a space-separated list\nprod_signs() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n prod_signs \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 2 -4\") = \"-9\" ]]\n [[ $(candidate \"0 1\") = \"0\" ]]\n [[ $(candidate \"1 1 1 2 3 -1 1\") = \"-10\" ]]\n [[ $(candidate \"\") = \"None\" ]]\n [[ $(candidate \"2 4 1 2 -1 -1 9\") = \"20\" ]]\n [[ $(candidate \"-1 1 -1 1\") = \"4\" ]]\n [[ $(candidate \"-1 1 1 1\") = \"-4\" ]]\n [[ $(candidate \"-1 1 1 0\") = \"0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "sh", - "prompt": "#!/bin/bash\n# Return list with elements incremented by 1.\n# >>> incr_list([1, 2, 3])\n# [2, 3, 4]\n# >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123])\n# [6, 4, 6, 3, 4, 4, 10, 1, 124]\n#\n# $1 is a space-separated list\nincr_list() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n incr_list \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"3 2 1\") = \"4 3 2\" ]]\n [[ $(candidate \"5 2 5 2 3 3 9 0 123\") = \"6 3 6 3 4 4 10 1 124\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "sh", - "prompt": "#!/bin/bash\n# From a given list of integers, generate a list of rolling maximum element found until given moment\n# in the sequence.\n# >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n# [1, 2, 3, 3, 3, 4, 4]\n#\n# $1 is a space-separated list\nrolling_max() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n rolling_max \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"1 2 3 4\") = \"1 2 3 4\" ]]\n [[ $(candidate \"4 3 2 1\") = \"4 4 4 4\" ]]\n [[ $(candidate \"3 2 3 100 3\") = \"3 3 3 100 100\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "sh", - "prompt": "#!/bin/bash\n# Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n# separate those group into separate strings and return the list of those.\n# Separate groups are balanced (each open brace is properly closed) and not nested within each other\n# Ignore any spaces in the input string.\n# >>> separate_paren_groups('( ) (( )) (( )( ))')\n# ['()', '(())', '(()())']\n#\n# $1 is a string\nseparate_paren_groups() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n separate_paren_groups \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"(()()) ((())) () ((())()())\") = \"(()()) ((())) () ((())()())\" ]]\n [[ $(candidate \"() (()) ((())) (((())))\") = \"() (()) ((())) (((())))\" ]]\n [[ $(candidate \"(()(())((())))\") = \"(()(())((())))\" ]]\n [[ $(candidate \"( ) (( )) (( )( ))\") = \"() (()) (()())\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "sh", - "prompt": "#!/bin/bash\n# You will be given a string of words separated by commas or spaces. Your task is\n# to split the string into words and return an array of the words.\n# For example:\n# words_string(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n# words_string(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\n#\n# $1 is a string\nwords_string() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n words_string \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Hi, my name is John\") = \"Hi my name is John\" ]]\n [[ $(candidate \"One, two, three, four, five, six\") = \"One two three four five six\" ]]\n [[ $(candidate \"Hi, my name\") = \"Hi my name\" ]]\n [[ $(candidate \"One,, two, three, four, five, six,\") = \"One two three four five six\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"ahmed , gamal\") = \"ahmed gamal\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function that takes integers, floats, or strings representing\n# real numbers, and returns the larger variable in its given variable type.\n# Return None if the values are equal.\n# Note: If a real number is represented as a string, the floating point might be . or ,\n# compare_one(1, 2.5) \u279e 2.5\n# compare_one(1, \"2,3\") \u279e \"2,3\"\n# compare_one(\"5,1\", \"6\") \u279e \"6\"\n# compare_one(\"1\", 1) \u279e None\n#\n# $1 is an argument\n# $2 is an argument\ncompare_one() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_137_compare_one.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n compare_one \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1\" \"2\") = \"2\" ]]\n [[ $(candidate \"1\" \"2.5\") = \"2.5\" ]]\n [[ $(candidate \"2\" \"3\") = \"3\" ]]\n [[ $(candidate \"5\" \"6\") = \"6\" ]]\n [[ $(candidate \"1\" \"2,3\") = \"2,3\" ]]\n [[ $(candidate \"5,1\" \"6\") = \"6\" ]]\n [[ $(candidate \"1\" \"2\") = \"2\" ]]\n [[ $(candidate \"1\" \"1\") = \"None\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "sh", - "prompt": "#!/bin/bash\n# Filter given list of any python values only for integers\n# >>> filter_integers(['a', 3.14, 5])\n# [5]\n# >>> filter_integers([1, 2, 3, 'abc', {}, []])\n# [1, 2, 3]\n#\n# $1 is a space-separated list\nfilter_integers() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n filter_integers \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"4 23.2 9 adasd\") = \"4 9\" ]]\n [[ $(candidate \"3 c 3 3 a b\") = \"3 3 3\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "sh", - "prompt": "#!/bin/bash\n# This function takes a list l and returns a list l' such that\n# l' is identical to l in the odd indicies, while its values at the even indicies are equal\n# to the values of the even indicies of l, but sorted.\n# >>> sort_even([1, 2, 3])\n# [1, 2, 3]\n# >>> sort_even([5, 6, 3, 4])\n# [3, 6, 5, 4]\n#\n# $1 is a space-separated list\nsort_even() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n sort_even \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3\") = \"1 2 3\" ]]\n [[ $(candidate \"5 3 -5 2 -3 3 9 0 123 1 -10\") = \"-10 3 -5 2 -3 3 5 0 9 1 123\" ]]\n [[ $(candidate \"5 8 -12 4 23 2 3 11 12 -10\") = \"-12 8 3 4 5 2 12 11 23 -10\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "sh", - "prompt": "#!/bin/bash\n# I think we all remember that feeling when the result of some long-awaited\n# event is finally known. The feelings and thoughts you have at that moment are\n# definitely worth noting down and comparing.\n# Your task is to determine if a person correctly guessed the results of a number of matches.\n# You are given two arrays of scores and guesses of equal length, where each index shows a match. \n# Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n# the value is 0, and if not, the value is the absolute difference between the guess and the score.\n# example:\n# compare([1,2,3,4,5,1],[1,2,3,4,2,-2]) -> [0,0,0,0,3,3]\n# compare([0,5,0,0,0,4],[4,1,1,0,0,-2]) -> [4,4,1,0,0,6]\n#\n# $1 is a space-separated list\n# $2 is a space-separated list\ncompare() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n compare \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3 4 5 1\" \"1 2 3 4 2 -2\") = \"0 0 0 0 3 3\" ]]\n [[ $(candidate \"0 0 0 0 0 0\" \"0 0 0 0 0 0\") = \"0 0 0 0 0 0\" ]]\n [[ $(candidate \"1 2 3\" \"-1 -2 -3\") = \"2 4 6\" ]]\n [[ $(candidate \"1 2 3 5\" \"-1 2 3 4\") = \"2 0 0 1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a positive integer n, return a tuple that has the number of even and odd\n# integer palindromes that fall within the range(1, n), inclusive.\n# Example 1:\n# Input: 3\n# Output: (1, 2)\n# Explanation:\n# Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n# Example 2:\n# Input: 12\n# Output: (4, 6)\n# Explanation:\n# Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n# Note:\n# 1. 1 <= n <= 10^3\n# 2. returned tuple has the number of even and odd integer palindromes respectively.\n#\n# $1 is an integer\neven_odd_palindrome() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n even_odd_palindrome \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"123\") = \"8 13\" ]]\n [[ $(candidate \"12\") = \"4 6\" ]]\n [[ $(candidate \"3\") = \"1 2\" ]]\n [[ $(candidate \"63\") = \"6 8\" ]]\n [[ $(candidate \"25\") = \"5 6\" ]]\n [[ $(candidate \"19\") = \"4 6\" ]]\n [[ $(candidate \"9\") = \"4 5\" ]]\n [[ $(candidate \"1\") = \"0 1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "sh", - "prompt": "#!/bin/bash\n# The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fib4(0) -> 0\n# fib4(1) -> 0\n# fib4(2) -> 2\n# fib4(3) -> 0\n# fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n# Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n# >>> fib4(5)\n# 4\n# >>> fib4(6)\n# 8\n# >>> fib4(7)\n# 14\n#\n# $1 is an integer\nfib4() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n fib4 \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\") = \"4\" ]]\n [[ $(candidate \"8\") = \"28\" ]]\n [[ $(candidate \"10\") = \"104\" ]]\n [[ $(candidate \"12\") = \"386\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "sh", - "prompt": "#!/bin/bash\n# Given two positive integers a and b, return the even digits between a\n# and b, in ascending order.\n# For example:\n# generate_integers(2, 8) => [2, 4, 6, 8]\n# generate_integers(8, 2) => [2, 4, 6, 8]\n# generate_integers(10, 14) => []\n#\n# $1 is an integer\n# $2 is an integer\ngenerate_integers() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n generate_integers \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2\" \"10\") = \"2 4 6 8\" ]]\n [[ $(candidate \"10\" \"2\") = \"2 4 6 8\" ]]\n [[ $(candidate \"132\" \"2\") = \"2 4 6 8\" ]]\n [[ $(candidate \"17\" \"89\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "sh", - "prompt": "#!/bin/bash\n# For a given list of input numbers, calculate Mean Absolute Deviation\n# around the mean of this dataset.\n# Mean Absolute Deviation is the average absolute difference between each\n# element and a centerpoint (mean in this case):\n# MAD = average | x - x_mean |\n# >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n# 1.0\n#\n# $1 is a space-separated list\nmean_absolute_deviation() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n mean_absolute_deviation \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1.0 2.0\") = \"0.5\" ]]\n [[ $(candidate \"1.0 2.0 3.0 4.0\") = \"1.0\" ]]\n [[ $(candidate \"1.0 2.0 3.0 4.0 5.0\") = \"1.2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function encrypt that takes a string as an argument and\n# returns a string encrypted with the alphabet being rotated. \n# The alphabet should be rotated in a manner such that the letters \n# shift down by two multiplied to two places.\n# For example:\n# encrypt('hi') returns 'lm'\n# encrypt('asdfghjkl') returns 'ewhjklnop'\n# encrypt('gf') returns 'kj'\n# encrypt('et') returns 'ix'\n#\n# $1 is a string\nencrypt() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n encrypt \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"hi\") = \"lm\" ]]\n [[ $(candidate \"asdfghjkl\") = \"ewhjklnop\" ]]\n [[ $(candidate \"gf\") = \"kj\" ]]\n [[ $(candidate \"et\") = \"ix\" ]]\n [[ $(candidate \"faewfawefaewg\") = \"jeiajeaijeiak\" ]]\n [[ $(candidate \"hellomyfriend\") = \"lippsqcjvmirh\" ]]\n [[ $(candidate \"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\") = \"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\" ]]\n [[ $(candidate \"a\") = \"e\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n# The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n# as follows: start with any positive integer n. Then each term is obtained from the \n# previous term as follows: if the previous term is even, the next term is one half of \n# the previous term. If the previous term is odd, the next term is 3 times the previous\n# term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n# Note: \n# 1. Collatz(1) is [1].\n# 2. returned list sorted in increasing order.\n# For example:\n# get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n#\n# $1 is an integer\nget_odd_collatz() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n get_odd_collatz \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"14\") = \"1 5 7 11 13 17\" ]]\n [[ $(candidate \"5\") = \"1 5\" ]]\n [[ $(candidate \"12\") = \"1 3 5\" ]]\n [[ $(candidate \"1\") = \"1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "sh", - "prompt": "#!/bin/bash\n# Find how many times a given substring can be found in the original string. Count overlaping cases.\n# >>> how_many_times('', 'a')\n# 0\n# >>> how_many_times('aaa', 'a')\n# 3\n# >>> how_many_times('aaaa', 'aa')\n# 3\n#\n# $1 is a string\n# $2 is a string\nhow_many_times() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n how_many_times \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\" \"x\") = \"0\" ]]\n [[ $(candidate \"xyxyxyx\" \"x\") = \"4\" ]]\n [[ $(candidate \"cacacacac\" \"cac\") = \"4\" ]]\n [[ $(candidate \"john doe\" \"john\") = \"1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "sh", - "prompt": "#!/bin/bash\n# We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n# numbers in the array will be randomly ordered. Your task is to determine if\n# it is possible to get an array sorted in non-decreasing order by performing \n# the following operation on the given array:\n# You are allowed to perform right shift operation any number of times.\n# One right shift operation means shifting all elements of the array by one\n# position in the right direction. The last element of the array will be moved to\n# the starting position in the array i.e. 0th index. \n# If it is possible to obtain the sorted array by performing the above operation\n# then return True else return False.\n# If the given array is empty then return True.\n# Note: The given list is guaranteed to have unique elements.\n# For Example:\n# move_one_ball([3, 4, 5, 1, 2])==>True\n# Explanation: By performin 2 right shift operations, non-decreasing order can\n# be achieved for the given array.\n# move_one_ball([3, 5, 4, 1, 2])==>False\n# Explanation:It is not possible to get non-decreasing order for the given\n# array by performing any number of right shift operations.\n#\n# $1 is a space-separated list\nmove_one_ball() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n move_one_ball \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3 4 5 1 2\") = \"true\" ]]\n [[ $(candidate \"3 5 10 1 2\") = \"true\" ]]\n [[ $(candidate \"4 3 1 2\") = \"false\" ]]\n [[ $(candidate \"3 5 4 1 2\") = \"false\" ]]\n [[ $(candidate \"\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function which sorts the given list of integers\n# in ascending order according to the sum of their digits.\n# Note: if there are several items with similar sum of their digits,\n# order them based on their index in original list.\n# For example:\n# >>> order_by_points([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]\n# >>> order_by_points([]) == []\n#\n# $1 is a space-separated list\norder_by_points() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n order_by_points \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 11 -1 -11 -12\") = \"-1 -11 1 -12 11\" ]]\n [[ $(candidate \"1234 423 463 145 2 423 423 53 6 37 3457 3 56 0 46\") = \"0 2 3 6 53 423 423 423 1234 145 37 46 56 463 3457\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"1 -11 -32 43 54 -98 2 -3\") = \"-3 -32 -98 -11 1 2 43 54\" ]]\n [[ $(candidate \"1 2 3 4 5 6 7 8 9 10 11\") = \"1 10 2 11 3 4 5 6 7 8 9\" ]]\n [[ $(candidate \"0 6 6 -76 -21 23 4\") = \"-76 -21 0 4 23 6 6\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "sh", - "prompt": "#!/bin/bash\n# Return list of prime factors of given integer in the order from smallest to largest.\n# Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n# Input number should be equal to the product of all factors\n# >>> factorize(8)\n# [2, 2, 2]\n# >>> factorize(25)\n# [5, 5]\n# >>> factorize(70)\n# [2, 5, 7]\n#\n# $1 is an integer\nfactorize() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n factorize \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2\") = \"2\" ]]\n [[ $(candidate \"4\") = \"2 2\" ]]\n [[ $(candidate \"8\") = \"2 2 2\" ]]\n [[ $(candidate \"57\") = \"3 19\" ]]\n [[ $(candidate \"3249\") = \"3 3 19 19\" ]]\n [[ $(candidate \"185193\") = \"3 3 3 19 19 19\" ]]\n [[ $(candidate \"20577\") = \"3 19 19 19\" ]]\n [[ $(candidate \"18\") = \"2 3 3\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "sh", - "prompt": "#!/bin/bash\n# Return True if all numbers in the list l are below threshold t.\n# >>> below_threshold([1, 2, 4, 10], 100)\n# True\n# >>> below_threshold([1, 20, 4, 10], 5)\n# False\n#\n# $1 is a space-separated list\n# $2 is an integer\nbelow_threshold() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n below_threshold \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 4 10\" \"100\") = \"true\" ]]\n [[ $(candidate \"1 20 4 10\" \"5\") = \"false\" ]]\n [[ $(candidate \"1 20 4 10\" \"21\") = \"true\" ]]\n [[ $(candidate \"1 20 4 10\" \"22\") = \"true\" ]]\n [[ $(candidate \"1 8 4 10\" \"11\") = \"true\" ]]\n [[ $(candidate \"1 8 4 10\" \"10\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given two positive integers n and m, and your task is to compute the\n# average of the integers from n through m (including n and m). \n# Round the answer to the nearest integer and convert that to binary.\n# If n is greater than m, return -1.\n# Example:\n# rounded_avg(1, 5) => \"0b11\"\n# rounded_avg(7, 5) => -1\n# rounded_avg(10, 20) => \"0b1111\"\n# rounded_avg(20, 33) => \"0b11010\"\n#\n# $1 is an integer\n# $2 is an integer\nrounded_avg() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n rounded_avg \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1\" \"5\") = \"0b11\" ]]\n [[ $(candidate \"7\" \"13\") = \"0b1010\" ]]\n [[ $(candidate \"964\" \"977\") = \"0b1111001010\" ]]\n [[ $(candidate \"996\" \"997\") = \"0b1111100100\" ]]\n [[ $(candidate \"560\" \"851\") = \"0b1011000010\" ]]\n [[ $(candidate \"185\" \"546\") = \"0b101101110\" ]]\n [[ $(candidate \"362\" \"496\") = \"0b110101101\" ]]\n [[ $(candidate \"350\" \"902\") = \"0b1001110010\" ]]\n [[ $(candidate \"197\" \"233\") = \"0b11010111\" ]]\n [[ $(candidate \"7\" \"5\") = \"-1\" ]]\n [[ $(candidate \"5\" \"1\") = \"-1\" ]]\n [[ $(candidate \"5\" \"5\") = \"0b101\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "sh", - "prompt": "#!/bin/bash\n# Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n# For each of the group, output the deepest level of nesting of parentheses.\n# E.g. (()()) has maximum two levels of nesting while ((())) has three.\n# >>> parse_nested_parens('(()()) ((())) () ((())()())')\n# [2, 3, 1, 3]\n#\n# $1 is a string\nparse_nested_parens() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n parse_nested_parens \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"(()()) ((())) () ((())()())\") = \"2 3 1 3\" ]]\n [[ $(candidate \"() (()) ((())) (((())))\") = \"1 2 3 4\" ]]\n [[ $(candidate \"(()(())((())))\") = \"4\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n# Examples\n# solution([5, 8, 7, 1]) ==> 12\n# solution([3, 3, 3, 3, 3]) ==> 9\n# solution([30, 13, 24, 321]) ==>0\n#\n# $1 is a space-separated list\nsolution() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n solution \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5 8 7 1\") = \"12\" ]]\n [[ $(candidate \"3 3 3 3 3\") = \"9\" ]]\n [[ $(candidate \"30 13 24 321\") = \"0\" ]]\n [[ $(candidate \"5 9\") = \"5\" ]]\n [[ $(candidate \"2 4 8\") = \"0\" ]]\n [[ $(candidate \"30 13 23 32\") = \"23\" ]]\n [[ $(candidate \"3 13 2 9\") = \"3\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a positive integer n. You have to create an integer array a of length n.\n# For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n# Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n# and a[i] + a[j] + a[k] is a multiple of 3.\n# Example :\n# Input: n = 5\n# Output: 1\n# Explanation: \n# a = [1, 3, 7, 13, 21]\n# The only valid triple is (1, 7, 13).\n#\n# $1 is an integer\nget_max_triples() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n get_max_triples \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\") = \"1\" ]]\n [[ $(candidate \"6\") = \"4\" ]]\n [[ $(candidate \"10\") = \"36\" ]]\n [[ $(candidate \"100\") = \"53361\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "sh", - "prompt": "#!/bin/bash\n# There are eight planets in our solar system: the closerst to the Sun \n# is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n# Uranus, Neptune.\n# Write a function that takes two planet names as strings planet1 and planet2. \n# The function should return a tuple containing all planets whose orbits are \n# located between the orbit of planet1 and the orbit of planet2, sorted by \n# the proximity to the sun. \n# The function should return an empty tuple if planet1 or planet2\n# are not correct planet names. \n# Examples\n# bf(\"Jupiter\", \"Neptune\") ==> (\"Saturn\", \"Uranus\")\n# bf(\"Earth\", \"Mercury\") ==> (\"Venus\")\n# bf(\"Mercury\", \"Uranus\") ==> (\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\")\n#\n# $1 is a string\n# $2 is a string\nbf() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n bf \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Jupiter\" \"Neptune\") = \"Saturn Uranus\" ]]\n [[ $(candidate \"Earth\" \"Mercury\") = \"Venus\" ]]\n [[ $(candidate \"Mercury\" \"Uranus\") = \"Venus Earth Mars Jupiter Saturn\" ]]\n [[ $(candidate \"Neptune\" \"Venus\") = \"Earth Mars Jupiter Saturn Uranus\" ]]\n [[ $(candidate \"Earth\" \"Earth\") = \"\" ]]\n [[ $(candidate \"Mars\" \"Earth\") = \"\" ]]\n [[ $(candidate \"Jupiter\" \"Makemake\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a list of integers.\n# Write a function next_smallest() that returns the 2nd smallest element of the list.\n# Return None if there is no such element.\n# next_smallest([1, 2, 3, 4, 5]) == 2\n# next_smallest([5, 1, 4, 3, 2]) == 2\n# next_smallest([]) == None\n# next_smallest([1, 1]) == None\n#\n# $1 is a space-separated list\nnext_smallest() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n next_smallest \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3 4 5\") = \"2\" ]]\n [[ $(candidate \"5 1 4 3 2\") = \"2\" ]]\n [[ $(candidate \"\") = \"None\" ]]\n [[ $(candidate \"1 1\") = \"None\" ]]\n [[ $(candidate \"1 1 1 1 0\") = \"1\" ]]\n [[ $(candidate \"1 1\") = \"None\" ]]\n [[ $(candidate \"-35 34 12 -45\") = \"-35\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "sh", - "prompt": "#!/bin/bash\n# Input is a space-delimited string of numberals from 'zero' to 'nine'.\n# Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n# Return the string with numbers sorted from smallest to largest\n# >>> sort_numbers('three one five')\n# 'one three five'\n#\n# $1 is a string\nsort_numbers() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n sort_numbers \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"three\") = \"three\" ]]\n [[ $(candidate \"three five nine\") = \"three five nine\" ]]\n [[ $(candidate \"five zero four seven nine eight\") = \"zero four five seven eight nine\" ]]\n [[ $(candidate \"six five four three two one zero\") = \"zero one two three four five six\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n# cycpattern_check(\"abcd\",\"abd\") => False\n# cycpattern_check(\"hello\",\"ell\") => True\n# cycpattern_check(\"whassup\",\"psus\") => False\n# cycpattern_check(\"abab\",\"baa\") => True\n# cycpattern_check(\"efef\",\"eeff\") => False\n# cycpattern_check(\"himenss\",\"simen\") => True\n#\n# $1 is a string\n# $2 is a string\ncycpattern_check() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n cycpattern_check \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"xyzw\" \"xyw\") = \"false\" ]]\n [[ $(candidate \"yello\" \"ell\") = \"true\" ]]\n [[ $(candidate \"whattup\" \"ptut\") = \"false\" ]]\n [[ $(candidate \"efef\" \"fee\") = \"true\" ]]\n [[ $(candidate \"abab\" \"aabb\") = \"false\" ]]\n [[ $(candidate \"winemtt\" \"tinem\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "sh", - "prompt": "#!/bin/bash\n# You will be given a number in decimal form and your task is to convert it to\n# binary format. The function should return a string, with each character representing a binary\n# number. Each character in the string will be '0' or '1'.\n# There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n# The extra characters are there to help with the format.\n# Examples:\n# decimal_to_binary(15) # returns \"db1111db\"\n# decimal_to_binary(32) # returns \"db100000db\"\n#\n# $1 is an integer\ndecimal_to_binary() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n decimal_to_binary \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"0\") = \"db0db\" ]]\n [[ $(candidate \"32\") = \"db100000db\" ]]\n [[ $(candidate \"103\") = \"db1100111db\" ]]\n [[ $(candidate \"15\") = \"db1111db\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "sh", - "prompt": "#!/bin/bash\n# Given an integer. return a tuple that has the number of even and odd digits respectively.\n# Example:\n# even_odd_count(-12) ==> (1, 1)\n# even_odd_count(123) ==> (1, 2)\n#\n# $1 is an integer\neven_odd_count() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n even_odd_count \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"7\") = \"0 1\" ]]\n [[ $(candidate \"-78\") = \"1 1\" ]]\n [[ $(candidate \"3452\") = \"2 2\" ]]\n [[ $(candidate \"346211\") = \"3 3\" ]]\n [[ $(candidate \"-345821\") = \"3 3\" ]]\n [[ $(candidate \"-2\") = \"1 0\" ]]\n [[ $(candidate \"-45347\") = \"2 3\" ]]\n [[ $(candidate \"0\") = \"1 0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that accepts a list of strings.\n# The list contains different words. Return the word with maximum number\n# of unique characters. If multiple strings have maximum number of unique\n# characters, return the one which comes first in lexicographical order.\n# find_max([\"name\", \"of\", \"string\"]) == \"string\"\n# find_max([\"name\", \"enam\", \"game\"]) == \"enam\"\n# find_max([\"aaaaaaa\", \"bb\" ,\"cc\"]) == \"\"aaaaaaa\"\n#\n# $1 is a space-separated list\nfind_max() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n find_max \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"name of string\") = \"string\" ]]\n [[ $(candidate \"name enam game\") = \"enam\" ]]\n [[ $(candidate \"aaaaaaa bb cc\") = \"aaaaaaa\" ]]\n [[ $(candidate \"abc cba\") = \"abc\" ]]\n [[ $(candidate \"play this game of footbott\") = \"footbott\" ]]\n [[ $(candidate \"we are gonna rock\") = \"gonna\" ]]\n [[ $(candidate \"we are a mad nation\") = \"nation\" ]]\n [[ $(candidate \"this is a prrk\") = \"this\" ]]\n [[ $(candidate \"b\") = \"b\" ]]\n [[ $(candidate \"play play play\") = \"play\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a positive integer n, return the count of the numbers of n-digit\n# positive integers that start or end with 1.\n#\n# $1 is an integer\nstarts_one_ends() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n starts_one_ends \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1\") = \"1\" ]]\n [[ $(candidate \"2\") = \"18\" ]]\n [[ $(candidate \"3\") = \"180\" ]]\n [[ $(candidate \"4\") = \"1800\" ]]\n [[ $(candidate \"5\") = \"18000\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function that returns a tuple (a, b), where 'a' is\n# the largest of negative integers, and 'b' is the smallest\n# of positive integers in a list.\n# If there is no negative or positive integers, return them as None.\n# Examples:\n# largest_smallest_integers([2, 4, 1, 3, 5, 7]) == (None, 1)\n# largest_smallest_integers([]) == (None, None)\n# largest_smallest_integers([0]) == (None, None)\n#\n# $1 is a space-separated list\nlargest_smallest_integers() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n largest_smallest_integers \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2 4 1 3 5 7\") = \"None 1\" ]]\n [[ $(candidate \"2 4 1 3 5 7 0\") = \"None 1\" ]]\n [[ $(candidate \"1 3 2 4 5 6 -2\") = \"-2 1\" ]]\n [[ $(candidate \"4 5 3 6 2 7 -7\") = \"-7 2\" ]]\n [[ $(candidate \"7 3 8 4 9 2 5 -9\") = \"-9 2\" ]]\n [[ $(candidate \"\") = \"None None\" ]]\n [[ $(candidate \"0\") = \"None None\" ]]\n [[ $(candidate \"-1 -3 -5 -6\") = \"-1 None\" ]]\n [[ $(candidate \"-1 -3 -5 -6 0\") = \"-1 None\" ]]\n [[ $(candidate \"-6 -4 -4 -3 1\") = \"-3 1\" ]]\n [[ $(candidate \"-6 -4 -4 -3 -100 1\") = \"-3 1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "sh", - "prompt": "#!/bin/bash\n# \"Given an array representing a branch of a tree that has non-negative integer nodes\n# your task is to pluck one of the nodes and return it.\n# The plucked node should be the node with the smallest even value.\n# If multiple nodes with the same smallest even value are found return the node that has smallest index.\n# The plucked node should be returned in a list, [ smalest_value, its index ],\n# If there are no even values or the given array is empty, return [].\n# Example 1:\n# Input: [4,2,3]\n# Output: [2, 1]\n# Explanation: 2 has the smallest even value, and 2 has the smallest index.\n# Example 2:\n# Input: [1,2,3]\n# Output: [2, 1]\n# Explanation: 2 has the smallest even value, and 2 has the smallest index. \n# Example 3:\n# Input: []\n# Output: []\n# Example 4:\n# Input: [5, 0, 3, 0, 4, 2]\n# Output: [0, 1]\n# Explanation: 0 is the smallest value, but there are two zeros,\n# so we will choose the first zero, which has the smallest index.\n# Constraints:\n# * 1 <= nodes.length <= 10000\n# * 0 <= node.value\n#\n# $1 is a space-separated list\npluck() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n pluck \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"4 2 3\") = \"2 1\" ]]\n [[ $(candidate \"1 2 3\") = \"2 1\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"5 0 3 0 4 2\") = \"0 1\" ]]\n [[ $(candidate \"1 2 3 0 5 3\") = \"0 3\" ]]\n [[ $(candidate \"5 4 8 4 8\") = \"4 1\" ]]\n [[ $(candidate \"7 6 7 1\") = \"6 1\" ]]\n [[ $(candidate \"7 9 7 1\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function count_nums which takes an array of integers and returns\n# the number of elements which has a sum of digits > 0.\n# If a number is negative, then its first signed digit will be negative:\n# e.g. -123 has signed digits -1, 2, and 3.\n# >>> count_nums([]) == 0\n# >>> count_nums([-1, 11, -11]) == 1\n# >>> count_nums([1, 1, 2]) == 3\n#\n# $1 is a space-separated list\ncount_nums() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n count_nums \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"0\" ]]\n [[ $(candidate \"-1 -2 0\") = \"0\" ]]\n [[ $(candidate \"1 1 2 -2 3 4 5\") = \"6\" ]]\n [[ $(candidate \"1 6 9 -6 0 1 5\") = \"5\" ]]\n [[ $(candidate \"1 100 98 -7 1 -1\") = \"4\" ]]\n [[ $(candidate \"12 23 34 -45 -56 0\") = \"5\" ]]\n [[ $(candidate \"0 1\") = \"1\" ]]\n [[ $(candidate \"1\") = \"1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n# each cell of the grid contains a value. Every integer in the range [1, N * N]\n# inclusive appears exactly once on the cells of the grid.\n# You have to find the minimum path of length k in the grid. You can start\n# from any cell, and in each step you can move to any of the neighbor cells,\n# in other words, you can go to cells which share an edge with you current\n# cell.\n# Please note that a path of length k means visiting exactly k cells (not\n# necessarily distinct).\n# You CANNOT go off the grid.\n# A path A (of length k) is considered less than a path B (of length k) if\n# after making the ordered lists of the values on the cells that A and B go\n# through (let's call them lst_A and lst_B), lst_A is lexicographically less\n# than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n# such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n# lst_A[j] = lst_B[j].\n# It is guaranteed that the answer is unique.\n# Return an ordered list of the values on the cells that the minimum path go through.\n# Examples:\n# Input: grid = [ [1,2,3], [4,5,6], [7,8,9]], k = 3\n# Output: [1, 2, 1]\n# Input: grid = [ [5,9,3], [4,1,6], [7,8,2]], k = 1\n# Output: [1]\n#\n# $1 is a newline-separated, space-separated list\n# $2 is an integer\nminPath() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n minPath \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3\\n4 5 6\\n7 8 9\" \"3\") = \"1 2 1\" ]]\n [[ $(candidate \"5 9 3\\n4 1 6\\n7 8 2\" \"1\") = \"1\" ]]\n [[ $(candidate \"1 2 3 4\\n5 6 7 8\\n9 10 11 12\\n13 14 15 16\" \"4\") = \"1 2 1 2\" ]]\n [[ $(candidate \"6 4 13 10\\n5 7 12 1\\n3 16 11 15\\n8 14 9 2\" \"7\") = \"1 10 1 10 1 10 1\" ]]\n [[ $(candidate \"8 14 9 2\\n6 4 13 15\\n5 7 1 12\\n3 10 11 16\" \"5\") = \"1 7 1 7 1\" ]]\n [[ $(candidate \"11 8 7 2\\n5 16 14 4\\n9 3 15 6\\n12 13 10 1\" \"9\") = \"1 6 1 6 1 6 1 6 1\" ]]\n [[ $(candidate \"12 13 10 1\\n9 3 15 6\\n5 16 14 4\\n11 8 7 2\" \"12\") = \"1 6 1 6 1 6 1 6 1 6 1 6\" ]]\n [[ $(candidate \"2 7 4\\n3 1 5\\n6 8 9\" \"8\") = \"1 3 1 3 1 3 1 3\" ]]\n [[ $(candidate \"6 1 5\\n3 8 9\\n2 7 4\" \"8\") = \"1 5 1 5 1 5 1 5\" ]]\n [[ $(candidate \"1 2\\n3 4\" \"10\") = \"1 2 1 2 1 2 1 2 1 2\" ]]\n [[ $(candidate \"1 3\\n3 2\" \"10\") = \"1 3 1 3 1 3 1 3 1 3\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "sh", - "prompt": "#!/bin/bash\n# Given list of integers, return list in strange order.\n# Strange sorting, is when you start with the minimum value,\n# then maximum of the remaining integers, then minimum and so on.\n# Examples:\n# strange_sort_list([1, 2, 3, 4]) == [1, 4, 2, 3]\n# strange_sort_list([5, 5, 5, 5]) == [5, 5, 5, 5]\n# strange_sort_list([]) == []\n#\n# $1 is a space-separated list\nstrange_sort_list() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n strange_sort_list \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3 4\") = \"1 4 2 3\" ]]\n [[ $(candidate \"5 6 7 8 9\") = \"5 9 6 8 7\" ]]\n [[ $(candidate \"1 2 3 4 5\") = \"1 5 2 4 3\" ]]\n [[ $(candidate \"5 6 7 8 9 1\") = \"1 9 5 8 6 7\" ]]\n [[ $(candidate \"5 5 5 5\") = \"5 5 5 5\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"1 2 3 4 5 6 7 8\") = \"1 8 2 7 3 6 4 5\" ]]\n [[ $(candidate \"0 2 2 2 5 5 -5 -5\") = \"-5 5 -5 5 0 2 2 2\" ]]\n [[ $(candidate \"111111\") = \"111111\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a string 'text', return its md5 hash equivalent string.\n# If 'text' is an empty string, return None.\n# >>> string_to_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'\n#\n# $1 is a string\nstring_to_md5() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n string_to_md5 \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Hello world\") = \"3e25960a79dbc69b674cd4ec67a72c62\" ]]\n [[ $(candidate \"\") = \"None\" ]]\n [[ $(candidate \"A B C\") = \"0ef78513b0cb8cef12743f5aeb35f888\" ]]\n [[ $(candidate \"password\") = \"5f4dcc3b5aa765d61d8327deb882cf99\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a word. Your task is to find the closest vowel that stands between \n# two consonants from the right side of the word (case sensitive).\n# Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n# find any vowel met the above condition. \n# You may assume that the given string contains English letter only.\n# Example:\n# get_closest_vowel(\"yogurt\") ==> \"u\"\n# get_closest_vowel(\"FULL\") ==> \"U\"\n# get_closest_vowel(\"quick\") ==> \"\"\n# get_closest_vowel(\"ab\") ==> \"\"\n#\n# $1 is a string\nget_closest_vowel() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n get_closest_vowel \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"yogurt\") = \"u\" ]]\n [[ $(candidate \"full\") = \"u\" ]]\n [[ $(candidate \"easy\") = \"\" ]]\n [[ $(candidate \"eAsy\") = \"\" ]]\n [[ $(candidate \"ali\") = \"\" ]]\n [[ $(candidate \"bad\") = \"a\" ]]\n [[ $(candidate \"most\") = \"o\" ]]\n [[ $(candidate \"ab\") = \"\" ]]\n [[ $(candidate \"ba\") = \"\" ]]\n [[ $(candidate \"quick\") = \"\" ]]\n [[ $(candidate \"anime\") = \"i\" ]]\n [[ $(candidate \"Asia\") = \"\" ]]\n [[ $(candidate \"Above\") = \"o\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "sh", - "prompt": "#!/bin/bash\n# Change numerical base of input number x to base.\n# return string representation after the conversion.\n# base numbers are less than 10.\n# >>> change_base(8, 3)\n# '22'\n# >>> change_base(8, 2)\n# '1000'\n# >>> change_base(7, 2)\n# '111'\n#\n# $1 is an integer\n# $2 is an integer\nchange_base() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n change_base \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"8\" \"3\") = \"22\" ]]\n [[ $(candidate \"9\" \"3\") = \"100\" ]]\n [[ $(candidate \"234\" \"2\") = \"11101010\" ]]\n [[ $(candidate \"16\" \"2\") = \"10000\" ]]\n [[ $(candidate \"8\" \"2\") = \"1000\" ]]\n [[ $(candidate \"7\" \"2\") = \"111\" ]]\n [[ $(candidate \"2\" \"3\") = \"2\" ]]\n [[ $(candidate \"3\" \"4\") = \"3\" ]]\n [[ $(candidate \"4\" \"5\") = \"4\" ]]\n [[ $(candidate \"5\" \"6\") = \"5\" ]]\n [[ $(candidate \"6\" \"7\") = \"6\" ]]\n [[ $(candidate \"7\" \"8\") = \"7\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "sh", - "prompt": "#!/bin/bash\n# Check if in given list of numbers, are any two numbers closer to each other than\n# given threshold.\n# >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n# False\n# >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n# True\n#\n# $1 is a space-separated list\n# $2 is a floating point\nhas_close_elements() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n has_close_elements \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1.0 2.0 3.9 4.0 5.0 2.2\" \"0.3\") = \"true\" ]]\n [[ $(candidate \"1.0 2.0 3.9 4.0 5.0 2.2\" \"0.05\") = \"false\" ]]\n [[ $(candidate \"1.0 2.0 5.9 4.0 5.0\" \"0.95\") = \"true\" ]]\n [[ $(candidate \"1.0 2.0 5.9 4.0 5.0\" \"0.8\") = \"false\" ]]\n [[ $(candidate \"1.0 2.0 3.0 4.0 5.0 2.0\" \"0.1\") = \"true\" ]]\n [[ $(candidate \"1.1 2.2 3.1 4.1 5.1\" \"1.0\") = \"true\" ]]\n [[ $(candidate \"1.1 2.2 3.1 4.1 5.1\" \"0.5\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function that takes a string as input which contains only square brackets.\n# The function should return True if and only if there is a valid subsequence of brackets \n# where at least one bracket in the subsequence is nested.\n# is_nested('[[]]') \u279e True\n# is_nested('[]]]]]]][[[[[]') \u279e False\n# is_nested('[][]') \u279e False\n# is_nested('[]') \u279e False\n# is_nested('[[][]]') \u279e True\n# is_nested('[[]][[') \u279e True\n#\n# $1 is a string\nis_nested() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n is_nested \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"[[]]\") = \"true\" ]]\n [[ $(candidate \"[]]]]]]][[[[[]\") = \"false\" ]]\n [[ $(candidate \"[][]\") = \"false\" ]]\n [[ $(candidate \"[]\") = \"false\" ]]\n [[ $(candidate \"[[[[]]]]\") = \"true\" ]]\n [[ $(candidate \"[]]]]]]]]]]\") = \"false\" ]]\n [[ $(candidate \"[][][[]]\") = \"true\" ]]\n [[ $(candidate \"[[]\") = \"false\" ]]\n [[ $(candidate \"[]]\") = \"false\" ]]\n [[ $(candidate \"[[]][[\") = \"true\" ]]\n [[ $(candidate \"[[][]]\") = \"true\" ]]\n [[ $(candidate \"\") = \"false\" ]]\n [[ $(candidate \"[[[[[[[[\") = \"false\" ]]\n [[ $(candidate \"]]]]]]]]\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "sh", - "prompt": "#!/bin/bash\n# Concatenate list of strings into a single string\n# >>> concatenate([])\n# ''\n# >>> concatenate(['a', 'b', 'c'])\n# 'abc'\n#\n# $1 is a space-separated list\nconcatenate() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n concatenate \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"x y z\") = \"xyz\" ]]\n [[ $(candidate \"x y z w k\") = \"xyzwk\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "sh", - "prompt": "#!/bin/bash\n# prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n# >>> prime_fib(1)\n# 2\n# >>> prime_fib(2)\n# 3\n# >>> prime_fib(3)\n# 5\n# >>> prime_fib(4)\n# 13\n# >>> prime_fib(5)\n# 89\n#\n# $1 is an integer\nprime_fib() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n prime_fib \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1\") = \"2\" ]]\n [[ $(candidate \"2\") = \"3\" ]]\n [[ $(candidate \"3\") = \"5\" ]]\n [[ $(candidate \"4\") = \"13\" ]]\n [[ $(candidate \"5\") = \"89\" ]]\n [[ $(candidate \"6\") = \"233\" ]]\n [[ $(candidate \"7\") = \"1597\" ]]\n [[ $(candidate \"8\") = \"28657\" ]]\n [[ $(candidate \"9\") = \"514229\" ]]\n [[ $(candidate \"10\") = \"433494437\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "sh", - "prompt": "#!/bin/bash\n# From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n# other and return them in order (smaller number, larger number).\n# >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n# (2.0, 2.2)\n# >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n# (2.0, 2.0)\n#\n# $1 is a space-separated list\nfind_closest_elements() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n find_closest_elements \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1.0 2.0 3.9 4.0 5.0 2.2\") = \"3.9 4.0\" ]]\n [[ $(candidate \"1.0 2.0 5.9 4.0 5.0\") = \"5.0 5.9\" ]]\n [[ $(candidate \"1.0 2.0 3.0 4.0 5.0 2.2\") = \"2.0 2.2\" ]]\n [[ $(candidate \"1.0 2.0 3.0 4.0 5.0 2.0\") = \"2.0 2.0\" ]]\n [[ $(candidate \"1.1 2.2 3.1 4.1 5.1\") = \"2.2 3.1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "sh", - "prompt": "#!/bin/bash\n# You have been tasked to write a function that receives \n# a hexadecimal number as a string and counts the number of hexadecimal \n# digits that are primes (prime number, or a prime, is a natural number \n# greater than 1 that is not a product of two smaller natural numbers).\n# Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n# Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n# So you have to determine a number of the following digits: 2, 3, 5, 7, \n# B (=decimal 11), D (=decimal 13).\n# Note: you may assume the input is always correct or empty string, \n# and symbols A,B,C,D,E,F are always uppercase.\n# Examples:\n# For num = \"AB\" the output should be 1.\n# For num = \"1077E\" the output should be 2.\n# For num = \"ABED1A33\" the output should be 4.\n# For num = \"123456789ABCDEF0\" the output should be 6.\n# For num = \"2020\" the output should be 2.\n#\n# $1 is a string\nhex_key() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n hex_key \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"AB\") = \"1\" ]]\n [[ $(candidate \"1077E\") = \"2\" ]]\n [[ $(candidate \"ABED1A33\") = \"4\" ]]\n [[ $(candidate \"2020\") = \"2\" ]]\n [[ $(candidate \"123456789ABCDEF0\") = \"6\" ]]\n [[ $(candidate \"112233445566778899AABBCCDDEEFF00\") = \"12\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "sh", - "prompt": "#!/bin/bash\n# Complete the function that takes two integers and returns \n# the product of their unit digits.\n# Assume the input is always valid.\n# Examples:\n# multiply(148, 412) should return 16.\n# multiply(19, 28) should return 72.\n# multiply(2020, 1851) should return 0.\n# multiply(14,-15) should return 20.\n#\n# $1 is an integer\n# $2 is an integer\nmultiply() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n multiply \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"148\" \"412\") = \"16\" ]]\n [[ $(candidate \"19\" \"28\") = \"72\" ]]\n [[ $(candidate \"2020\" \"1851\") = \"0\" ]]\n [[ $(candidate \"14\" \"-15\") = \"20\" ]]\n [[ $(candidate \"76\" \"67\") = \"42\" ]]\n [[ $(candidate \"17\" \"27\") = \"49\" ]]\n [[ $(candidate \"0\" \"1\") = \"0\" ]]\n [[ $(candidate \"0\" \"0\") = \"0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "sh", - "prompt": "#!/bin/bash\n# Given list of numbers (of at least two elements), apply a linear transform to that list,\n# such that the smallest number will become 0 and the largest will become 1\n# >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n# [0.0, 0.25, 0.5, 0.75, 1.0]\n#\n# $1 is a space-separated list\nrescale_to_unit() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n rescale_to_unit \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2.0 49.9\") = \"0.0 1.0\" ]]\n [[ $(candidate \"100.0 49.9\") = \"1.0 0.0\" ]]\n [[ $(candidate \"1.0 2.0 3.0 4.0 5.0\") = \"0.0 0.25 0.5 0.75 1.0\" ]]\n [[ $(candidate \"2.0 1.0 5.0 3.0 4.0\") = \"0.25 0.0 1.0 0.5 0.75\" ]]\n [[ $(candidate \"12.0 11.0 15.0 13.0 14.0\") = \"0.25 0.0 1.0 0.5 0.75\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a positive integer n, return the product of the odd digits.\n# Return 0 if all digits are even.\n# For example:\n# digits(1) == 1\n# digits(4) == 0\n# digits(235) == 15\n#\n# $1 is an integer\ndigits() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n digits \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\") = \"5\" ]]\n [[ $(candidate \"54\") = \"5\" ]]\n [[ $(candidate \"120\") = \"1\" ]]\n [[ $(candidate \"5014\") = \"5\" ]]\n [[ $(candidate \"98765\") = \"315\" ]]\n [[ $(candidate \"5576543\") = \"2625\" ]]\n [[ $(candidate \"2468\") = \"0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "sh", - "prompt": "#!/bin/bash\n# You will be given the name of a class (a string) and a list of extensions.\n# The extensions are to be used to load additional classes to the class. The\n# strength of the extension is as follows: Let CAP be the number of the uppercase\n# letters in the extension's name, and let SM be the number of lowercase letters \n# in the extension's name, the strength is given by the fraction CAP - SM. \n# You should find the strongest extension and return a string in this \n# format: ClassName.StrongestExtensionName.\n# If there are two or more extensions with the same strength, you should\n# choose the one that comes first in the list.\n# For example, if you are given \"Slices\" as the class and a list of the\n# extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n# return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n# (its strength is -1).\n# Example:\n# for Strongest_Extension('my_class', ['AA', 'Be', 'CC']) == 'my_class.AA'\n#\n# $1 is a string\n# $2 is a space-separated list\nStrongest_Extension() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n Strongest_Extension \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Watashi\" \"tEN niNE eIGHt8OKe\") = \"Watashi.eIGHt8OKe\" ]]\n [[ $(candidate \"Boku123\" \"nani NazeDa YEs.WeCaNe 32145tggg\") = \"Boku123.YEs.WeCaNe\" ]]\n [[ $(candidate \"__YESIMHERE\" \"t eMptY nothing zeR00 NuLl__ 123NoooneB321\") = \"__YESIMHERE.NuLl__\" ]]\n [[ $(candidate \"K\" \"Ta TAR t234An cosSo\") = \"K.TAR\" ]]\n [[ $(candidate \"__HAHA\" \"Tab 123 781345 -_-\") = \"__HAHA.123\" ]]\n [[ $(candidate \"YameRore\" \"HhAas okIWILL123 WorkOut Fails -_-\") = \"YameRore.okIWILL123\" ]]\n [[ $(candidate \"finNNalLLly\" \"Die NowW Wow WoW\") = \"finNNalLLly.WoW\" ]]\n [[ $(candidate \"_\" \"Bb 91245\") = \"_.Bb\" ]]\n [[ $(candidate \"Sp\" \"671235 Bb\") = \"Sp.671235\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a string representing a space separated lowercase letters, return a dictionary\n# of the letter with the most repetition and containing the corresponding count.\n# If several letters have the same occurrence, return all of them.\n# Example:\n# histogram('a b c') == {'a': 1, 'b': 1, 'c': 1}\n# histogram('a b b a') == {'a': 2, 'b': 2}\n# histogram('a b c a b') == {'a': 2, 'b': 2}\n# histogram('b b b b a') == {'b': 4}\n# histogram('') == {}\n#\n# $1 is a string\nhistogram() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n histogram \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"a b b a\") = \"a,2\\nb,2\" ]]\n [[ $(candidate \"a b c a b\") = \"a,2\\nb,2\" ]]\n [[ $(candidate \"a b c d g\") = \"a,1\\nb,1\\nc,1\\nd,1\\ng,1\" ]]\n [[ $(candidate \"r t g\") = \"r,1\\nt,1\\ng,1\" ]]\n [[ $(candidate \"b b b b a\") = \"b,4\" ]]\n [[ $(candidate \"r t g\") = \"r,1\\nt,1\\ng,1\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"a\") = \"a,1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "sh", - "prompt": "#!/bin/bash\n# pairs_sum_to_zero takes a list of integers as an input.\n# it returns True if there are two distinct elements in the list that\n# sum to zero, and False otherwise.\n# >>> pairs_sum_to_zero([1, 3, 5, 0])\n# False\n# >>> pairs_sum_to_zero([1, 3, -2, 1])\n# False\n# >>> pairs_sum_to_zero([1, 2, 3, 7])\n# False\n# >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7])\n# True\n# >>> pairs_sum_to_zero([1])\n# False\n#\n# $1 is a space-separated list\npairs_sum_to_zero() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n pairs_sum_to_zero \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 3 5 0\") = \"false\" ]]\n [[ $(candidate \"1 3 -2 1\") = \"false\" ]]\n [[ $(candidate \"1 2 3 7\") = \"false\" ]]\n [[ $(candidate \"2 4 -5 3 5 7\") = \"true\" ]]\n [[ $(candidate \"1\") = \"false\" ]]\n [[ $(candidate \"-3 9 -1 3 2 30\") = \"true\" ]]\n [[ $(candidate \"-3 9 -1 3 2 31\") = \"true\" ]]\n [[ $(candidate \"-3 9 -1 4 2 30\") = \"false\" ]]\n [[ $(candidate \"-3 9 -1 4 2 31\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that accepts two lists of strings and returns the list that has \n# total number of chars in the all strings of the list less than the other list.\n# if the two lists have the same number of chars, return the first list.\n# Examples\n# total_match([], []) \u279e []\n# total_match(['hi', 'admin'], ['hI', 'Hi']) \u279e ['hI', 'Hi']\n# total_match(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) \u279e ['hi', 'admin']\n# total_match(['hi', 'admin'], ['hI', 'hi', 'hi']) \u279e ['hI', 'hi', 'hi']\n# total_match(['4'], ['1', '2', '3', '4', '5']) \u279e ['4']\n#\n# $1 is a space-separated list\n# $2 is a space-separated list\ntotal_match() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n total_match \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\" \"\") = \"\" ]]\n [[ $(candidate \"hi admin\" \"hi hi\") = \"hi hi\" ]]\n [[ $(candidate \"hi admin\" \"hi hi admin project\") = \"hi admin\" ]]\n [[ $(candidate \"4\" \"1 2 3 4 5\") = \"4\" ]]\n [[ $(candidate \"hi admin\" \"hI Hi\") = \"hI Hi\" ]]\n [[ $(candidate \"hi admin\" \"hI hi hi\") = \"hI hi hi\" ]]\n [[ $(candidate \"hi admin\" \"hI hi hii\") = \"hi admin\" ]]\n [[ $(candidate \"\" \"this\") = \"\" ]]\n [[ $(candidate \"this\" \"\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "sh", - "prompt": "#!/bin/bash\n# Circular shift the digits of the integer x, shift the digits right by shift\n# and return the result as a string.\n# If shift > number of digits, return digits reversed.\n# >>> circular_shift(12, 1)\n# \"21\"\n# >>> circular_shift(12, 2)\n# \"12\"\n#\n# $1 is an integer\n# $2 is an integer\ncircular_shift() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n circular_shift \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"100\" \"2\") = \"001\" ]]\n [[ $(candidate \"12\" \"2\") = \"12\" ]]\n [[ $(candidate \"97\" \"8\") = \"79\" ]]\n [[ $(candidate \"12\" \"1\") = \"21\" ]]\n [[ $(candidate \"11\" \"101\") = \"11\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "sh", - "prompt": "#!/bin/bash\n# Return True is list elements are monotonically increasing or decreasing.\n# >>> monotonic([1, 2, 4, 20])\n# True\n# >>> monotonic([1, 20, 4, 10])\n# False\n# >>> monotonic([4, 1, 0, -10])\n# True\n#\n# $1 is a space-separated list\nmonotonic() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n monotonic \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 4 10\") = \"true\" ]]\n [[ $(candidate \"1 2 4 20\") = \"true\" ]]\n [[ $(candidate \"1 20 4 10\") = \"false\" ]]\n [[ $(candidate \"4 1 0 -10\") = \"true\" ]]\n [[ $(candidate \"4 1 1 0\") = \"true\" ]]\n [[ $(candidate \"1 2 3 2 5 60\") = \"false\" ]]\n [[ $(candidate \"1 2 3 4 5 60\") = \"true\" ]]\n [[ $(candidate \"9 9 9 9\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "sh", - "prompt": "#!/bin/bash\n# Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n# Example\n# is_equal_to_sum_even(4) == False\n# is_equal_to_sum_even(6) == False\n# is_equal_to_sum_even(8) == True\n#\n# $1 is an integer\nis_equal_to_sum_even() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n is_equal_to_sum_even \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"4\") = \"false\" ]]\n [[ $(candidate \"6\") = \"false\" ]]\n [[ $(candidate \"8\") = \"true\" ]]\n [[ $(candidate \"10\") = \"true\" ]]\n [[ $(candidate \"11\") = \"false\" ]]\n [[ $(candidate \"12\") = \"true\" ]]\n [[ $(candidate \"13\") = \"false\" ]]\n [[ $(candidate \"16\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "sh", - "prompt": "#!/bin/bash\n# Input to this function is a string representing musical notes in a special ASCII format.\n# Your task is to parse this string and return list of integers corresponding to how many beats does each\n# not last.\n# Here is a legend:\n# 'o' - whole note, lasts four beats\n# 'o|' - half note, lasts two beats\n# '.|' - quater note, lasts one beat\n# >>> parse_music('o o| .| o| o| .| .| .| .| o o')\n# [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\n#\n# $1 is a string\nparse_music() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n parse_music \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"o o o o\") = \"4 4 4 4\" ]]\n [[ $(candidate \".| .| .| .|\") = \"1 1 1 1\" ]]\n [[ $(candidate \"o| o| .| .| o o o o\") = \"2 2 1 1 4 4 4 4\" ]]\n [[ $(candidate \"o| .| o| .| o o| o o|\") = \"2 1 2 1 4 2 4 2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "sh", - "prompt": "#!/bin/bash\n# \"\n# This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n# multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n# change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n# Examples:\n# For lst = [1,2,3] the output should be 6\n# For lst = [] the output should be 0\n# For lst = [-1,-5,2,-1,-5] the output should be -126\n#\n# $1 is a space-separated list\nsum_squares() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n sum_squares \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3\") = \"6\" ]]\n [[ $(candidate \"1 4 9\") = \"14\" ]]\n [[ $(candidate \"\") = \"0\" ]]\n [[ $(candidate \"1 1 1 1 1 1 1 1 1\") = \"9\" ]]\n [[ $(candidate \"-1 -1 -1 -1 -1 -1 -1 -1 -1\") = \"-3\" ]]\n [[ $(candidate \"0\") = \"0\" ]]\n [[ $(candidate \"-1 -5 2 -1 -5\") = \"-126\" ]]\n [[ $(candidate \"-56 -99 1 0 -2\") = \"3030\" ]]\n [[ $(candidate \"-1 0 0 0 0 0 0 0 -1\") = \"0\" ]]\n [[ $(candidate \"-16 -9 -2 36 36 26 -20 25 -40 20 -4 12 -26 35 37\") = \"-14196\" ]]\n [[ $(candidate \"-1 -3 17 -1 -15 13 -1 14 -14 -12 -5 14 -14 6 13 11 16 16 4 10\") = \"-1448\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "sh", - "prompt": "#!/bin/bash\n# triples_sum_to_zero takes a list of integers as an input.\n# it returns True if there are three distinct elements in the list that\n# sum to zero, and False otherwise.\n# >>> triples_sum_to_zero([1, 3, 5, 0])\n# False\n# >>> triples_sum_to_zero([1, 3, -2, 1])\n# True\n# >>> triples_sum_to_zero([1, 2, 3, 7])\n# False\n# >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n# True\n# >>> triples_sum_to_zero([1])\n# False\n#\n# $1 is a space-separated list\ntriples_sum_to_zero() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n triples_sum_to_zero \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 3 5 0\") = \"false\" ]]\n [[ $(candidate \"1 3 5 -1\") = \"false\" ]]\n [[ $(candidate \"1 3 -2 1\") = \"true\" ]]\n [[ $(candidate \"1 2 3 7\") = \"false\" ]]\n [[ $(candidate \"1 2 5 7\") = \"false\" ]]\n [[ $(candidate \"2 4 -5 3 9 7\") = \"true\" ]]\n [[ $(candidate \"1\") = \"false\" ]]\n [[ $(candidate \"1 3 5 -100\") = \"false\" ]]\n [[ $(candidate \"100 3 5 -100\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "sh", - "prompt": "#!/bin/bash\n# brackets is a string of \"<\" and \">\".\n# return True if every opening bracket has a corresponding closing bracket.\n# >>> correct_bracketing(\"<\")\n# False\n# >>> correct_bracketing(\"<>\")\n# True\n# >>> correct_bracketing(\"<<><>>\")\n# True\n# >>> correct_bracketing(\"><<>\")\n# False\n#\n# $1 is a string\ncorrect_bracketing() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n correct_bracketing \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"<>\") = \"true\" ]]\n [[ $(candidate \"<<><>>\") = \"true\" ]]\n [[ $(candidate \"<><><<><>><>\") = \"true\" ]]\n [[ $(candidate \"<><><<<><><>><>><<><><<>>>\") = \"true\" ]]\n [[ $(candidate \"<<<><>>>>\") = \"false\" ]]\n [[ $(candidate \"><<>\") = \"false\" ]]\n [[ $(candidate \"<\") = \"false\" ]]\n [[ $(candidate \"<<<<\") = \"false\" ]]\n [[ $(candidate \">\") = \"false\" ]]\n [[ $(candidate \"<<>\") = \"false\" ]]\n [[ $(candidate \"<><><<><>><>><<>\") = \"false\" ]]\n [[ $(candidate \"<><><<><>><>>><>\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that takes an array of numbers as input and returns \n# the number of elements in the array that are greater than 10 and both \n# first and last digits of a number are odd (1, 3, 5, 7, 9).\n# For example:\n# specialFilter([15, -73, 14, -15]) => 1 \n# specialFilter([33, -2, -3, 45, 21, 109]) => 2\n#\n# $1 is a space-separated list\nspecialFilter() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n specialFilter \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5 -2 1 -5\") = \"0\" ]]\n [[ $(candidate \"15 -73 14 -15\") = \"1\" ]]\n [[ $(candidate \"33 -2 -3 45 21 109\") = \"2\" ]]\n [[ $(candidate \"43 -12 93 125 121 109\") = \"4\" ]]\n [[ $(candidate \"71 -2 -33 75 21 19\") = \"3\" ]]\n [[ $(candidate \"1\") = \"0\" ]]\n [[ $(candidate \"\") = \"0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a dictionary, return True if all keys are strings in lower \n# case or all keys are strings in upper case, else return False.\n# The function should return False is the given dictionary is empty.\n# Examples:\n# check_dict_case({\"a\":\"apple\", \"b\":\"banana\"}) should return True.\n# check_dict_case({\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}) should return False.\n# check_dict_case({\"a\":\"apple\", \"8\":\"banana\", \"a\":\"apple\"}) should return False.\n# check_dict_case({\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}) should return False.\n# check_dict_case({\"STATE\":\"NC\", \"ZIP\":\"12345\" }) should return True.\n#\n# $1 is a two column CSV in key,value order\ncheck_dict_case() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n check_dict_case \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"p,pineapple\\nb,banana\") = \"true\" ]]\n [[ $(candidate \"p,pineapple\\nA,banana\\nB,banana\") = \"false\" ]]\n [[ $(candidate \"p,pineapple\\n5,banana\\na,apple\") = \"false\" ]]\n [[ $(candidate \"Name,John\\nAge,36\\nCity,Houston\") = \"false\" ]]\n [[ $(candidate \"STATE,NC\\nZIP,12345\") = \"true\" ]]\n [[ $(candidate \"fruit,Orange\\ntaste,Sweet\") = \"true\" ]]\n [[ $(candidate \"\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n# should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n# alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n# Examples\n# split_words(\"Hello world!\") \u279e [\"Hello\", \"world!\"]\n# split_words(\"Hello,world!\") \u279e [\"Hello\", \"world!\"]\n# split_words(\"abcdef\") == 3\n#\n# $1 is a string\nsplit_words() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n split_words \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Hello world\\!\") = \"Hello world\\!\" ]]\n [[ $(candidate \"Hello,world\\!\") = \"Hello world\\!\" ]]\n [[ $(candidate \"Hello world,\\!\") = \"Hello world,\\!\" ]]\n [[ $(candidate \"Hello,Hello,world \\!\") = \"Hello,Hello,world \\!\" ]]\n [[ $(candidate \"abcdef\") = \"3\" ]]\n [[ $(candidate \"aaabb\") = \"2\" ]]\n [[ $(candidate \"aaaBb\") = \"1\" ]]\n [[ $(candidate \"\") = \"0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "sh", - "prompt": "#!/bin/bash\n# The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fibfib(0) == 0\n# fibfib(1) == 0\n# fibfib(2) == 1\n# fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n# Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n# >>> fibfib(1)\n# 0\n# >>> fibfib(5)\n# 4\n# >>> fibfib(8)\n# 24\n#\n# $1 is an integer\nfibfib() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n fibfib \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2\") = \"1\" ]]\n [[ $(candidate \"1\") = \"0\" ]]\n [[ $(candidate \"5\") = \"4\" ]]\n [[ $(candidate \"8\") = \"24\" ]]\n [[ $(candidate \"10\") = \"81\" ]]\n [[ $(candidate \"12\") = \"274\" ]]\n [[ $(candidate \"14\") = \"927\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a list of numbers.\n# You need to return the sum of squared numbers in the given list,\n# round each element in the list to the upper int(Ceiling) first.\n# Examples:\n# For lst = [1,2,3] the output should be 14\n# For lst = [1,4,9] the output should be 98\n# For lst = [1,3,5,7] the output should be 84\n# For lst = [1.4,4.2,0] the output should be 29\n# For lst = [-2.4,1,1] the output should be 6\n#\n# $1 is a space-separated list\nsum_squares() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n sum_squares \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1.0 2.0 3.0\") = \"14\" ]]\n [[ $(candidate \"1.0 2.0 3.0\") = \"14\" ]]\n [[ $(candidate \"1.0 3.0 5.0 7.0\") = \"84\" ]]\n [[ $(candidate \"1.4 4.2 0.0\") = \"29\" ]]\n [[ $(candidate \"-2.4 1.0 1.0\") = \"6\" ]]\n [[ $(candidate \"100.0 1.0 15.0 2.0\") = \"10230\" ]]\n [[ $(candidate \"10000.0 10000.0\") = \"200000000\" ]]\n [[ $(candidate \"-1.4 4.6 6.3\") = \"75\" ]]\n [[ $(candidate \"-1.4 17.9 18.9 19.9\") = \"1086\" ]]\n [[ $(candidate \"0.0\") = \"0\" ]]\n [[ $(candidate \"-1.0\") = \"1\" ]]\n [[ $(candidate \"-1.0 1.0 0.0\") = \"2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_85_add", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a non-empty list of integers lst. add the even elements that are at odd indices..\n# Examples:\n# add([4, 2, 6, 7]) ==> 2\n#\n# $1 is a space-separated list\nadd() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n add \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"4 88\") = \"88\" ]]\n [[ $(candidate \"4 5 6 7 2 122\") = \"122\" ]]\n [[ $(candidate \"4 0 6 7\") = \"0\" ]]\n [[ $(candidate \"4 4 6 8\") = \"12\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "sh", - "prompt": "#!/bin/bash\n# Return sorted unique elements in a list\n# >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123])\n# [0, 2, 3, 5, 9, 123]\n#\n# $1 is a space-separated list\nunique() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n unique \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5 3 5 2 3 3 9 0 123\") = \"0 2 3 5 9 123\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a string text, replace all spaces in it with underscores, \n# and if a string has more than 2 consecutive spaces, \n# then replace all consecutive spaces with - \n# fix_spaces(\"Example\") == \"Example\"\n# fix_spaces(\"Example 1\") == \"Example_1\"\n# fix_spaces(\" Example 2\") == \"_Example_2\"\n# fix_spaces(\" Example 3\") == \"_Example-3\"\n#\n# $1 is a string\nfix_spaces() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n fix_spaces \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Example\") = \"Example\" ]]\n [[ $(candidate \"Mudasir Hanif \") = \"Mudasir_Hanif_\" ]]\n [[ $(candidate \"Yellow Yellow Dirty Fellow\") = \"Yellow_Yellow__Dirty__Fellow\" ]]\n [[ $(candidate \"Exa mple\") = \"Exa-mple\" ]]\n [[ $(candidate \" Exa 1 2 2 mple\") = \"-Exa_1_2_2_mple\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "sh", - "prompt": "#!/bin/bash\n# Return 2^n modulo p (be aware of numerics).\n# >>> modp(3, 5)\n# 3\n# >>> modp(1101, 101)\n# 2\n# >>> modp(0, 101)\n# 1\n# >>> modp(3, 11)\n# 8\n# >>> modp(100, 101)\n# 1\n#\n# $1 is an integer\n# $2 is an integer\nmodp() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n modp \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3\" \"5\") = \"3\" ]]\n [[ $(candidate \"1101\" \"101\") = \"2\" ]]\n [[ $(candidate \"0\" \"101\") = \"1\" ]]\n [[ $(candidate \"3\" \"11\") = \"8\" ]]\n [[ $(candidate \"100\" \"101\") = \"1\" ]]\n [[ $(candidate \"30\" \"5\") = \"4\" ]]\n [[ $(candidate \"31\" \"5\") = \"3\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "sh", - "prompt": "#!/bin/bash\n# You have to write a function which validates a given date string and\n# returns True if the date is valid otherwise False.\n# The date is valid if all of the following rules are satisfied:\n# 1. The date string is not empty.\n# 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n# 3. The months should not be less than 1 or higher than 12.\n# 4. The date should be in the format: mm-dd-yyyy\n# for example: \n# valid_date('03-11-2000') => True\n# valid_date('15-01-2012') => False\n# valid_date('04-0-2040') => False\n# valid_date('06-04-2020') => True\n# valid_date('06/04/2020') => False\n#\n# $1 is a string\nvalid_date() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n valid_date \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"03-11-2000\") = \"true\" ]]\n [[ $(candidate \"15-01-2012\") = \"false\" ]]\n [[ $(candidate \"04-0-2040\") = \"false\" ]]\n [[ $(candidate \"06-04-2020\") = \"true\" ]]\n [[ $(candidate \"01-01-2007\") = \"true\" ]]\n [[ $(candidate \"03-32-2011\") = \"false\" ]]\n [[ $(candidate \"\") = \"false\" ]]\n [[ $(candidate \"04-31-3000\") = \"false\" ]]\n [[ $(candidate \"06-06-2005\") = \"true\" ]]\n [[ $(candidate \"21-31-2000\") = \"false\" ]]\n [[ $(candidate \"04-12-2003\") = \"true\" ]]\n [[ $(candidate \"04122003\") = \"false\" ]]\n [[ $(candidate \"20030412\") = \"false\" ]]\n [[ $(candidate \"2003-04\") = \"false\" ]]\n [[ $(candidate \"2003-04-12\") = \"false\" ]]\n [[ $(candidate \"04-2003\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that takes a string and returns an ordered version of it.\n# Ordered version of string, is a string where all words (separated by space)\n# are replaced by a new word where all the characters arranged in\n# ascending order based on ascii value.\n# Note: You should keep the order of words and blank spaces in the sentence.\n# For example:\n# anti_shuffle('Hi') returns 'Hi'\n# anti_shuffle('hello') returns 'ehllo'\n# anti_shuffle('Hello World!!!') returns 'Hello !!!Wdlor'\n#\n# $1 is a string\nanti_shuffle() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n anti_shuffle \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Hi\") = \"Hi\" ]]\n [[ $(candidate \"hello\") = \"ehllo\" ]]\n [[ $(candidate \"number\") = \"bemnru\" ]]\n [[ $(candidate \"abcd\") = \"abcd\" ]]\n [[ $(candidate \"Hello World\\!\\!\\!\") = \"Hello \\!\\!\\!Wdlor\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"Hi. My name is Mister Robot. How are you?\") = \".Hi My aemn is Meirst .Rboot How aer ?ouy\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a list of numbers, return whether or not they are sorted\n# in ascending order. If list has more than 1 duplicate of the same\n# number, return False. Assume no negative numbers and only integers.\n# Examples\n# is_sorted([5]) \u279e True\n# is_sorted([1, 2, 3, 4, 5]) \u279e True\n# is_sorted([1, 3, 2, 4, 5]) \u279e False\n# is_sorted([1, 2, 3, 4, 5, 6]) \u279e True\n# is_sorted([1, 2, 3, 4, 5, 6, 7]) \u279e True\n# is_sorted([1, 3, 2, 4, 5, 6, 7]) \u279e False\n# is_sorted([1, 2, 2, 3, 3, 4]) \u279e True\n# is_sorted([1, 2, 2, 2, 3, 4]) \u279e False\n#\n# $1 is a space-separated list\nis_sorted() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n is_sorted \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\") = \"true\" ]]\n [[ $(candidate \"1 2 3 4 5\") = \"true\" ]]\n [[ $(candidate \"1 3 2 4 5\") = \"false\" ]]\n [[ $(candidate \"1 2 3 4 5 6\") = \"true\" ]]\n [[ $(candidate \"1 2 3 4 5 6 7\") = \"true\" ]]\n [[ $(candidate \"1 3 2 4 5 6 7\") = \"false\" ]]\n [[ $(candidate \"\") = \"true\" ]]\n [[ $(candidate \"1\") = \"true\" ]]\n [[ $(candidate \"3 2 1\") = \"false\" ]]\n [[ $(candidate \"1 2 2 2 3 4\") = \"false\" ]]\n [[ $(candidate \"1 2 3 3 3 4\") = \"false\" ]]\n [[ $(candidate \"1 2 2 3 3 4\") = \"true\" ]]\n [[ $(candidate \"1 2 3 4\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a string s.\n# Your task is to check if the string is happy or not.\n# A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n# For example:\n# is_happy(a) => False\n# is_happy(aa) => False\n# is_happy(abcd) => True\n# is_happy(aabb) => False\n# is_happy(adb) => True\n# is_happy(xyy) => False\n#\n# $1 is a string\nis_happy() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n is_happy \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"a\") = \"false\" ]]\n [[ $(candidate \"aa\") = \"false\" ]]\n [[ $(candidate \"abcd\") = \"true\" ]]\n [[ $(candidate \"aabb\") = \"false\" ]]\n [[ $(candidate \"adb\") = \"true\" ]]\n [[ $(candidate \"xyy\") = \"false\" ]]\n [[ $(candidate \"iopaxpoi\") = \"true\" ]]\n [[ $(candidate \"iopaxioi\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that returns True if the object q will fly, and False otherwise.\n# The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n# Example:\n# will_it_fly([1, 2], 5) \u279e False \n# # 1+2 is less than the maximum possible weight, but it's unbalanced.\n# will_it_fly([3, 2, 3], 1) \u279e False\n# # it's balanced, but 3+2+3 is more than the maximum possible weight.\n# will_it_fly([3, 2, 3], 9) \u279e True\n# # 3+2+3 is less than the maximum possible weight, and it's balanced.\n# will_it_fly([3], 5) \u279e True\n# # 3 is less than the maximum possible weight, and it's balanced.\n#\n# $1 is a space-separated list\n# $2 is an integer\nwill_it_fly() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n will_it_fly \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3 2 3\" \"9\") = \"true\" ]]\n [[ $(candidate \"1 2\" \"5\") = \"false\" ]]\n [[ $(candidate \"3\" \"5\") = \"true\" ]]\n [[ $(candidate \"3 2 3\" \"1\") = \"false\" ]]\n [[ $(candidate \"1 2 3\" \"6\") = \"false\" ]]\n [[ $(candidate \"5\" \"5\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "sh", - "prompt": "#!/bin/bash\n# Given an array of non-negative integers, return a copy of the given array after sorting,\n# you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n# or sort it in descending order if the sum( first index value, last index value) is even.\n# Note:\n# * don't change the given array.\n# Examples:\n# * sort_array([]) => []\n# * sort_array([5]) => [5]\n# * sort_array([2, 4, 3, 0, 1, 5]) => [0, 1, 2, 3, 4, 5]\n# * sort_array([2, 4, 3, 0, 1, 5, 6]) => [6, 5, 4, 3, 2, 1, 0]\n#\n# $1 is a space-separated list\nsort_array() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n sort_array \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"5\") = \"5\" ]]\n [[ $(candidate \"2 4 3 0 1 5\") = \"0 1 2 3 4 5\" ]]\n [[ $(candidate \"2 4 3 0 1 5 6\") = \"6 5 4 3 2 1 0\" ]]\n [[ $(candidate \"2 1\") = \"1 2\" ]]\n [[ $(candidate \"15 42 87 32 11 0\") = \"0 11 15 32 42 87\" ]]\n [[ $(candidate \"21 14 23 11\") = \"23 21 14 11\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "sh", - "prompt": "#!/bin/bash\n# Implement a function that takes an non-negative integer and returns an array of the first n\n# integers that are prime numbers and less than n.\n# for example:\n# count_up_to(5) => [2,3]\n# count_up_to(11) => [2,3,5,7]\n# count_up_to(0) => []\n# count_up_to(20) => [2,3,5,7,11,13,17,19]\n# count_up_to(1) => []\n# count_up_to(18) => [2,3,5,7,11,13,17]\n#\n# $1 is an integer\ncount_up_to() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n count_up_to \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\") = \"2 3\" ]]\n [[ $(candidate \"6\") = \"2 3 5\" ]]\n [[ $(candidate \"7\") = \"2 3 5\" ]]\n [[ $(candidate \"10\") = \"2 3 5 7\" ]]\n [[ $(candidate \"0\") = \"\" ]]\n [[ $(candidate \"22\") = \"2 3 5 7 11 13 17 19\" ]]\n [[ $(candidate \"1\") = \"\" ]]\n [[ $(candidate \"18\") = \"2 3 5 7 11 13 17\" ]]\n [[ $(candidate \"47\") = \"2 3 5 7 11 13 17 19 23 29 31 37 41 43\" ]]\n [[ $(candidate \"101\") = \"2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "sh", - "prompt": "#!/bin/bash\n# Out of list of strings, return the longest one. Return the first one in case of multiple\n# strings of the same length. Return None in case the input list is empty.\n# >>> longest([])\n# >>> longest(['a', 'b', 'c'])\n# 'a'\n# >>> longest(['a', 'bb', 'ccc'])\n# 'ccc'\n#\n# $1 is a space-separated list\nlongest() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n longest \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"None\" ]]\n [[ $(candidate \"x y z\") = \"x\" ]]\n [[ $(candidate \"x yyy zzzz www kkkk abc\") = \"zzzz\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "sh", - "prompt": "#!/bin/bash\n# Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n# reverse the resulting array, and then replace each digit by its corresponding name from\n# \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n# For example:\n# arr = [2, 1, 1, 4, 5, 8, 2, 3] \n# -> sort arr -> [1, 1, 2, 2, 3, 4, 5, 8] \n# -> reverse arr -> [8, 5, 4, 3, 2, 2, 1, 1]\n# return [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n# If the array is empty, return an empty array:\n# arr = []\n# return []\n# If the array has any strange number ignore it:\n# arr = [1, -1 , 55] \n# -> sort arr -> [-1, 1, 55]\n# -> reverse arr -> [55, 1, -1]\n# return = ['One']\n#\n# $1 is a space-separated list\nby_length() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n by_length \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2 1 1 4 5 8 2 3\") = \"Eight Five Four Three Two Two One One\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"1 -1 55\") = \"One\" ]]\n [[ $(candidate \"1 -1 3 2\") = \"Three Two One\" ]]\n [[ $(candidate \"9 4 8\") = \"Nine Eight Four\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_106_f", - "language": "sh", - "prompt": "#!/bin/bash\n# Implement the function f that takes n as a parameter,\n# 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\n# or the sum of numbers from 1 to i otherwise.\n# i starts from 1.\n# the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n# Example:\n# f(5) == [1, 2, 6, 24, 15]\n#\n# $1 is an integer\nf() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n f \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\") = \"1 2 6 24 15\" ]]\n [[ $(candidate \"7\") = \"1 2 6 24 15 720 28\" ]]\n [[ $(candidate \"1\") = \"1\" ]]\n [[ $(candidate \"3\") = \"1 2 6\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "sh", - "prompt": "#!/bin/bash\n# Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n# >>> fizz_buzz(50)\n# 0\n# >>> fizz_buzz(78)\n# 2\n# >>> fizz_buzz(79)\n# 3\n#\n# $1 is an integer\nfizz_buzz() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n fizz_buzz \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"50\") = \"0\" ]]\n [[ $(candidate \"78\") = \"2\" ]]\n [[ $(candidate \"79\") = \"3\" ]]\n [[ $(candidate \"100\") = \"3\" ]]\n [[ $(candidate \"200\") = \"6\" ]]\n [[ $(candidate \"4000\") = \"192\" ]]\n [[ $(candidate \"10000\") = \"639\" ]]\n [[ $(candidate \"100000\") = \"8026\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a positive floating point number, it can be decomposed into\n# and integer part (largest integer smaller than given number) and decimals\n# (leftover part always smaller than 1).\n# Return the decimal part of the number.\n# >>> truncate_number(3.5)\n# 0.5\n#\n# $1 is a floating point\ntruncate_number() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n truncate_number \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3.5\") = \"0.5\" ]]\n [[ $(candidate \"1.25\") = \"0.25\" ]]\n [[ $(candidate \"123.0\") = \"0.0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "sh", - "prompt": "#!/bin/bash\n# For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n# Empty sum should be equal to 0 and empty product should be equal to 1.\n# >>> sum_product([])\n# (0, 1)\n# >>> sum_product([1, 2, 3, 4])\n# (10, 24)\n#\n# $1 is a space-separated list\nsum_product() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n sum_product \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"0 1\" ]]\n [[ $(candidate \"1 1 1\") = \"3 1\" ]]\n [[ $(candidate \"100 0\") = \"100 0\" ]]\n [[ $(candidate \"3 5 7\") = \"15 105\" ]]\n [[ $(candidate \"10\") = \"10 10\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a 2 dimensional data, as a nested lists,\n# which is similar to matrix, however, unlike matrices,\n# each row may contain a different number of columns.\n# Given lst, and integer x, find integers x in the list,\n# and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n# each tuple is a coordinate - (row, columns), starting with 0.\n# Sort coordinates initially by rows in ascending order.\n# Also, sort coordinates of the row by columns in descending order.\n# Examples:\n# get_row([\n# [1,2,3,4,5,6],\n# [1,2,3,4,1,6],\n# [1,2,3,4,5,1]\n# ], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n# get_row([], 1) == []\n# get_row([[], [1], [1, 2, 3]], 3) == [(2, 2)]\n#\n# $1 is a newline-separated, space-separated list\n# $2 is an integer\nget_row() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n get_row \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3 4 5 6\\n1 2 3 4 1 6\\n1 2 3 4 5 1\" \"1\") = \"0 0\\n1 4\\n1 0\\n2 5\\n2 0\" ]]\n [[ $(candidate \"1 2 3 4 5 6\\n1 2 3 4 5 6\\n1 2 3 4 5 6\\n1 2 3 4 5 6\\n1 2 3 4 5 6\\n1 2 3 4 5 6\" \"2\") = \"0 1\\n1 1\\n2 1\\n3 1\\n4 1\\n5 1\" ]]\n [[ $(candidate \"1 2 3 4 5 6\\n1 2 3 4 5 6\\n1 1 3 4 5 6\\n1 2 1 4 5 6\\n1 2 3 1 5 6\\n1 2 3 4 1 6\\n1 2 3 4 5 1\" \"1\") = \"0 0\\n1 0\\n2 1\\n2 0\\n3 2\\n3 0\\n4 3\\n4 0\\n5 4\\n5 0\\n6 5\\n6 0\" ]]\n [[ $(candidate \"\" \"1\") = \"\" ]]\n [[ $(candidate \"1\" \"2\") = \"\" ]]\n [[ $(candidate \"\\n1\\n1 2 3\" \"3\") = \"2 2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "sh", - "prompt": "#!/bin/bash\n# You're a hungry rabbit, and you already have eaten a certain number of carrots,\n# but now you need to eat more carrots to complete the day's meals.\n# you should return an array of [ total number of eaten carrots after your meals,\n# the number of carrots left after your meals ]\n# if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n# Example:\n# * eat(5, 6, 10) -> [11, 4]\n# * eat(4, 8, 9) -> [12, 1]\n# * eat(1, 10, 10) -> [11, 0]\n# * eat(2, 11, 5) -> [7, 0]\n# Variables:\n# @number : integer\n# the number of carrots that you have eaten.\n# @need : integer\n# the number of carrots that you need to eat.\n# @remaining : integer\n# the number of remaining carrots thet exist in stock\n# Constrain:\n# * 0 <= number <= 1000\n# * 0 <= need <= 1000\n# * 0 <= remaining <= 1000\n# Have fun :)\n#\n# $1 is an integer\n# $2 is an integer\n# $3 is an integer\neat() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n eat \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\" \"6\" \"10\") = \"11 4\" ]]\n [[ $(candidate \"4\" \"8\" \"9\") = \"12 1\" ]]\n [[ $(candidate \"1\" \"10\" \"10\") = \"11 0\" ]]\n [[ $(candidate \"2\" \"11\" \"5\") = \"7 0\" ]]\n [[ $(candidate \"4\" \"5\" \"7\") = \"9 2\" ]]\n [[ $(candidate \"4\" \"5\" \"1\") = \"5 0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a positive integer N, return the total sum of its digits in binary.\n# Example\n# For N = 1000, the sum of digits will be 1 the output should be \"1\".\n# For N = 150, the sum of digits will be 6 the output should be \"110\".\n# For N = 147, the sum of digits will be 12 the output should be \"1100\".\n# Variables:\n# @N integer\n# Constraints: 0 \u2264 N \u2264 10000.\n# Output:\n# a string of binary number\n#\n# $1 is an integer\nsolve() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n solve \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1000\") = \"1\" ]]\n [[ $(candidate \"150\") = \"110\" ]]\n [[ $(candidate \"147\") = \"1100\" ]]\n [[ $(candidate \"333\") = \"1001\" ]]\n [[ $(candidate \"963\") = \"10010\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a list of integers.\n# You need to find the largest prime value and return the sum of its digits.\n# Examples:\n# For lst = [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] the output should be 10\n# For lst = [1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1] the output should be 25\n# For lst = [1,3,1,32,5107,34,83278,109,163,23,2323,32,30,1,9,3] the output should be 13\n# For lst = [0,724,32,71,99,32,6,0,5,91,83,0,5,6] the output should be 11\n# For lst = [0,81,12,3,1,21] the output should be 3\n# For lst = [0,8,1,2,1,7] the output should be 7\n#\n# $1 is a space-separated list\nskjkasdkd() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n skjkasdkd \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"0 3 2 1 3 5 7 4 5 5 5 2 181 32 4 32 3 2 32 324 4 3\") = \"10\" ]]\n [[ $(candidate \"1 0 1 8 2 4597 2 1 3 40 1 2 1 2 4 2 5 1\") = \"25\" ]]\n [[ $(candidate \"1 3 1 32 5107 34 83278 109 163 23 2323 32 30 1 9 3\") = \"13\" ]]\n [[ $(candidate \"0 724 32 71 99 32 6 0 5 91 83 0 5 6\") = \"11\" ]]\n [[ $(candidate \"0 81 12 3 1 21\") = \"3\" ]]\n [[ $(candidate \"0 8 1 2 1 7\") = \"7\" ]]\n [[ $(candidate \"8191\") = \"19\" ]]\n [[ $(candidate \"8191 123456 127 7\") = \"19\" ]]\n [[ $(candidate \"127 97 8192\") = \"10\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "sh", - "prompt": "#!/bin/bash\n# Given an array arr of integers, find the minimum number of elements that\n# need to be changed to make the array palindromic. A palindromic array is an array that\n# is read the same backwards and forwards. In one change, you can change one element to any other element.\n# For example:\n# smallest_change([1,2,3,5,4,7,9,6]) == 4\n# smallest_change([1, 2, 3, 4, 3, 2, 2]) == 1\n# smallest_change([1, 2, 3, 2, 1]) == 0\n#\n# $1 is a space-separated list\nsmallest_change() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n smallest_change \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3 5 4 7 9 6\") = \"4\" ]]\n [[ $(candidate \"1 2 3 4 3 2 2\") = \"1\" ]]\n [[ $(candidate \"1 4 2\") = \"1\" ]]\n [[ $(candidate \"1 4 4 2\") = \"1\" ]]\n [[ $(candidate \"1 2 3 2 1\") = \"0\" ]]\n [[ $(candidate \"3 1 1 3\") = \"0\" ]]\n [[ $(candidate \"1\") = \"0\" ]]\n [[ $(candidate \"0 1\") = \"1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "sh", - "prompt": "#!/bin/bash\n# It is the last week of the semester and the teacher has to give the grades\n# to students. The teacher has been making her own algorithm for grading.\n# The only problem is, she has lost the code she used for grading.\n# She has given you a list of GPAs for some students and you have to write \n# a function that can output a list of letter grades using the following table:\n# GPA | Letter grade\n# 4.0 A+\n# > 3.7 A \n# > 3.3 A- \n# > 3.0 B+\n# > 2.7 B \n# > 2.3 B-\n# > 2.0 C+\n# > 1.7 C\n# > 1.3 C-\n# > 1.0 D+ \n# > 0.7 D \n# > 0.0 D-\n# 0.0 E\n# Example:\n# grade_equation([4.0, 3, 1.7, 2, 3.5]) ==> ['A+', 'B', 'C-', 'C', 'A-']\n#\n# $1 is a space-separated list\nnumerical_letter_grade() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n numerical_letter_grade \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"4.0 3 1.7 2 3.5\") = \"A+ B C- C A-\" ]]\n [[ $(candidate \"1.2\") = \"D+\" ]]\n [[ $(candidate \"0.5\") = \"D-\" ]]\n [[ $(candidate \"0.0\") = \"E\" ]]\n [[ $(candidate \"1.0 0.3 1.5 2.8 3.3\") = \"D D- C- B B+\" ]]\n [[ $(candidate \"0.0 0.7\") = \"E D-\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "sh", - "prompt": "#!/bin/bash\n# Given the lengths of the three sides of a triangle. Return the area of\n# the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n# Otherwise return -1\n# Three sides make a valid triangle when the sum of any two sides is greater \n# than the third side.\n# Example:\n# triangle_area(3, 4, 5) == 6.00\n# triangle_area(1, 2, 10) == -1\n#\n# $1 is an integer\n# $2 is an integer\n# $3 is an integer\ntriangle_area() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n triangle_area \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3\" \"4\" \"5\") = \"6.0\" ]]\n [[ $(candidate \"1\" \"2\" \"10\") = \"-1\" ]]\n [[ $(candidate \"4\" \"8\" \"5\") = \"8.18\" ]]\n [[ $(candidate \"2\" \"2\" \"2\") = \"1.73\" ]]\n [[ $(candidate \"1\" \"2\" \"3\") = \"-1\" ]]\n [[ $(candidate \"10\" \"5\" \"7\") = \"16.25\" ]]\n [[ $(candidate \"2\" \"6\" \"3\") = \"-1\" ]]\n [[ $(candidate \"1\" \"1\" \"1\") = \"0.43\" ]]\n [[ $(candidate \"2\" \"2\" \"10\") = \"-1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "sh", - "prompt": "#!/bin/bash\n# Check if two words have the same characters.\n# >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n# True\n# >>> same_chars('abcd', 'dddddddabc')\n# True\n# >>> same_chars('dddddddabc', 'abcd')\n# True\n# >>> same_chars('eabcd', 'dddddddabc')\n# False\n# >>> same_chars('abcd', 'dddddddabce')\n# False\n# >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc')\n# False\n#\n# $1 is a string\n# $2 is a string\nsame_chars() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n same_chars \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"eabcdzzzz\" \"dddzzzzzzzddeddabc\") = \"true\" ]]\n [[ $(candidate \"abcd\" \"dddddddabc\") = \"true\" ]]\n [[ $(candidate \"dddddddabc\" \"abcd\") = \"true\" ]]\n [[ $(candidate \"eabcd\" \"dddddddabc\") = \"false\" ]]\n [[ $(candidate \"abcd\" \"dddddddabcf\") = \"false\" ]]\n [[ $(candidate \"eabcdzzzz\" \"dddzzzzzzzddddabc\") = \"false\" ]]\n [[ $(candidate \"aabb\" \"aaccc\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "sh", - "prompt": "#!/bin/bash\n# Given an array of integers nums, find the minimum sum of any non-empty sub-array\n# of nums.\n# Example\n# minSubArraySum([2, 3, 4, 1, 2, 4]) == 1\n# minSubArraySum([-1, -2, -3]) == -6\n#\n# $1 is a space-separated list\nminSubArraySum() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n minSubArraySum \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2 3 4 1 2 4\") = \"1\" ]]\n [[ $(candidate \"-1 -2 -3\") = \"-6\" ]]\n [[ $(candidate \"-1 -2 -3 2 -10\") = \"-14\" ]]\n [[ $(candidate \"-9999999999999999\") = \"-9999999999999999\" ]]\n [[ $(candidate \"0 10 20 1000000\") = \"0\" ]]\n [[ $(candidate \"-1 -2 -3 10 -5\") = \"-6\" ]]\n [[ $(candidate \"100 -1 -2 -3 10 -5\") = \"-6\" ]]\n [[ $(candidate \"10 11 13 8 3 4\") = \"3\" ]]\n [[ $(candidate \"100 -33 32 -1 0 -2\") = \"-33\" ]]\n [[ $(candidate \"-10\") = \"-10\" ]]\n [[ $(candidate \"7\") = \"7\" ]]\n [[ $(candidate \"1 -1\") = \"-1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a string s and a natural number n, you have been tasked to implement \n# a function that returns a list of all words from string s that contain exactly \n# n consonants, in order these words appear in the string s.\n# If the string s is empty then the function should return an empty list.\n# Note: you may assume the input string contains only letters and spaces.\n# Examples:\n# select_words(\"Mary had a little lamb\", 4) ==> [\"little\"]\n# select_words(\"Mary had a little lamb\", 3) ==> [\"Mary\", \"lamb\"]\n# select_words(\"simple white space\", 2) ==> []\n# select_words(\"Hello world\", 4) ==> [\"world\"]\n# select_words(\"Uncle sam\", 3) ==> [\"Uncle\"]\n#\n# $1 is a string\n# $2 is an integer\nselect_words() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n select_words \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Mary had a little lamb\" \"4\") = \"little\" ]]\n [[ $(candidate \"Mary had a little lamb\" \"3\") = \"Mary lamb\" ]]\n [[ $(candidate \"simple white space\" \"2\") = \"\" ]]\n [[ $(candidate \"Hello world\" \"4\") = \"world\" ]]\n [[ $(candidate \"Uncle sam\" \"3\") = \"Uncle\" ]]\n [[ $(candidate \"\" \"4\") = \"\" ]]\n [[ $(candidate \"a b c d e f\" \"1\") = \"b c d f\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "sh", - "prompt": "#!/bin/bash\n# Return list of all prefixes from shortest to longest of the input string\n# >>> all_prefixes('abc')\n# ['a', 'ab', 'abc']\n#\n# $1 is a string\nall_prefixes() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n all_prefixes \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"asdfgh\") = \"a as asd asdf asdfg asdfgh\" ]]\n [[ $(candidate \"WWW\") = \"W WW WWW\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function that takes a value (string) representing a number\n# and returns the closest integer to it. If the number is equidistant\n# from two integers, round it away from zero.\n# Examples\n# >>> closest_integer(\"10\")\n# 10\n# >>> closest_integer(\"15.3\")\n# 15\n# Note:\n# Rounding away from zero means that if the given number is equidistant\n# from two integers, the one you should return is the one that is the\n# farthest from zero. For example closest_integer(\"14.5\") should\n# return 15 and closest_integer(\"-14.5\") should return -15.\n#\n# $1 is a string\nclosest_integer() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n closest_integer \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"10\") = \"10\" ]]\n [[ $(candidate \"14.5\") = \"15\" ]]\n [[ $(candidate \"-15.5\") = \"-16\" ]]\n [[ $(candidate \"15.3\") = \"15\" ]]\n [[ $(candidate \"0\") = \"0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function which takes a string representing a file's name, and returns\n# 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n# A file's name is considered to be valid if and only if all the following conditions \n# are met:\n# - There should not be more than three digits ('0'-'9') in the file's name.\n# - The file's name contains exactly one dot '.'\n# - The substring before the dot should not be empty, and it starts with a letter from \n# the latin alphapet ('a'-'z' and 'A'-'Z').\n# - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n# Examples:\n# file_name_check(\"example.txt\") # => 'Yes'\n# file_name_check(\"1example.dll\") # => 'No' (the name should start with a latin alphapet letter)\n#\n# $1 is a string\nfile_name_check() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n file_name_check \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"example.txt\") = \"Yes\" ]]\n [[ $(candidate \"1example.dll\") = \"No\" ]]\n [[ $(candidate \"s1sdf3.asd\") = \"No\" ]]\n [[ $(candidate \"K.dll\") = \"Yes\" ]]\n [[ $(candidate \"MY16FILE3.exe\") = \"Yes\" ]]\n [[ $(candidate \"His12FILE94.exe\") = \"No\" ]]\n [[ $(candidate \"_Y.txt\") = \"No\" ]]\n [[ $(candidate \"?aREYA.exe\") = \"No\" ]]\n [[ $(candidate \"/this_is_valid.dll\") = \"No\" ]]\n [[ $(candidate \"this_is_valid.wow\") = \"No\" ]]\n [[ $(candidate \"this_is_valid.txt\") = \"Yes\" ]]\n [[ $(candidate \"this_is_valid.txtexe\") = \"No\" ]]\n [[ $(candidate \"#this2_i4s_5valid.ten\") = \"No\" ]]\n [[ $(candidate \"@this1_is6_valid.exe\") = \"No\" ]]\n [[ $(candidate \"this_is_12valid.6exe4.txt\") = \"No\" ]]\n [[ $(candidate \"all.exe.txt\") = \"No\" ]]\n [[ $(candidate \"I563_No.exe\") = \"Yes\" ]]\n [[ $(candidate \"Is3youfault.txt\") = \"Yes\" ]]\n [[ $(candidate \"no_one#knows.dll\") = \"Yes\" ]]\n [[ $(candidate \"1I563_Yes3.exe\") = \"No\" ]]\n [[ $(candidate \"I563_Yes3.txtt\") = \"No\" ]]\n [[ $(candidate \"final..txt\") = \"No\" ]]\n [[ $(candidate \"final132\") = \"No\" ]]\n [[ $(candidate \"_f4indsartal132.\") = \"No\" ]]\n [[ $(candidate \".txt\") = \"No\" ]]\n [[ $(candidate \"s.\") = \"No\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given two intervals,\n# where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n# The given intervals are closed which means that the interval (start, end)\n# includes both start and end.\n# For each given interval, it is assumed that its start is less or equal its end.\n# Your task is to determine whether the length of intersection of these two \n# intervals is a prime number.\n# Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n# which its length is 1, which not a prime number.\n# If the length of the intersection is a prime number, return \"YES\",\n# otherwise, return \"NO\".\n# If the two intervals don't intersect, return \"NO\".\n# [input/output] samples:\n# intersection((1, 2), (2, 3)) ==> \"NO\"\n# intersection((-1, 1), (0, 4)) ==> \"NO\"\n# intersection((-3, -1), (-5, 5)) ==> \"YES\"\n#\n# $1 is a space-separated list\n# $2 is a space-separated list\nintersection() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n intersection \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2\" \"2 3\") = \"NO\" ]]\n [[ $(candidate \"-1 1\" \"0 4\") = \"NO\" ]]\n [[ $(candidate \"-3 -1\" \"-5 5\") = \"YES\" ]]\n [[ $(candidate \"-2 2\" \"-4 0\") = \"YES\" ]]\n [[ $(candidate \"-11 2\" \"-1 -1\") = \"NO\" ]]\n [[ $(candidate \"1 2\" \"3 5\") = \"NO\" ]]\n [[ $(candidate \"1 2\" \"1 2\") = \"NO\" ]]\n [[ $(candidate \"-2 -2\" \"-3 -2\") = \"NO\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "sh", - "prompt": "#!/bin/bash\n# Return the largest prime factor of n. Assume n > 1 and is not a prime.\n# >>> largest_prime_factor(13195)\n# 29\n# >>> largest_prime_factor(2048)\n# 2\n#\n# $1 is an integer\nlargest_prime_factor() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n largest_prime_factor \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"15\") = \"5\" ]]\n [[ $(candidate \"27\") = \"3\" ]]\n [[ $(candidate \"63\") = \"7\" ]]\n [[ $(candidate \"330\") = \"11\" ]]\n [[ $(candidate \"13195\") = \"29\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a string, find out how many distinct characters (regardless of case) does it consist of\n# >>> count_distinct_characters('xyzXYZ')\n# 3\n# >>> count_distinct_characters('Jerry')\n# 4\n#\n# $1 is a string\ncount_distinct_characters() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n count_distinct_characters \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"0\" ]]\n [[ $(candidate \"abcde\") = \"5\" ]]\n [[ $(candidate \"abcdecadeCADE\") = \"5\" ]]\n [[ $(candidate \"aaaaAAAAaaaa\") = \"1\" ]]\n [[ $(candidate \"Jerry jERRY JeRRRY\") = \"5\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "sh", - "prompt": "#!/bin/bash\n# You're given a list of deposit and withdrawal operations on a bank account that starts with\n# zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n# at that point function should return True. Otherwise it should return False.\n# >>> below_zero([1, 2, 3])\n# False\n# >>> below_zero([1, 2, -4, 5])\n# True\n#\n# $1 is a space-separated list\nbelow_zero() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n below_zero \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"false\" ]]\n [[ $(candidate \"1 2 -3 1 2 -3\") = \"false\" ]]\n [[ $(candidate \"1 2 -4 5 6\") = \"true\" ]]\n [[ $(candidate \"1 -1 2 -2 5 -5 4 -4\") = \"false\" ]]\n [[ $(candidate \"1 -1 2 -2 5 -5 4 -5\") = \"true\" ]]\n [[ $(candidate \"1 -2 2 -2 5 -5 4 -4\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "sh", - "prompt": "#!/bin/bash\n# Find the shortest palindrome that begins with a supplied string.\n# Algorithm idea is simple:\n# - Find the longest postfix of supplied string that is a palindrome.\n# - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n# >>> make_palindrome('')\n# ''\n# >>> make_palindrome('cat')\n# 'catac'\n# >>> make_palindrome('cata')\n# 'catac'\n#\n# $1 is a string\nmake_palindrome() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n make_palindrome \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"x\") = \"x\" ]]\n [[ $(candidate \"xyz\") = \"xyzyx\" ]]\n [[ $(candidate \"xyx\") = \"xyx\" ]]\n [[ $(candidate \"jerry\") = \"jerryrrej\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a positive integer, obtain its roman numeral equivalent as a string,\n# and return it in lowercase.\n# Restrictions: 1 <= num <= 1000\n# Examples:\n# >>> int_to_mini_roman(19) == 'xix'\n# >>> int_to_mini_roman(152) == 'clii'\n# >>> int_to_mini_roman(426) == 'cdxxvi'\n#\n# $1 is an integer\nint_to_mini_roman() {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n int_to_mini_roman \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"19\") = \"xix\" ]]\n [[ $(candidate \"152\") = \"clii\" ]]\n [[ $(candidate \"251\") = \"ccli\" ]]\n [[ $(candidate \"426\") = \"cdxxvi\" ]]\n [[ $(candidate \"500\") = \"d\" ]]\n [[ $(candidate \"1\") = \"i\" ]]\n [[ $(candidate \"4\") = \"iv\" ]]\n [[ $(candidate \"43\") = \"xliii\" ]]\n [[ $(candidate \"90\") = \"xc\" ]]\n [[ $(candidate \"94\") = \"xciv\" ]]\n [[ $(candidate \"532\") = \"dxxxii\" ]]\n [[ $(candidate \"900\") = \"cm\" ]]\n [[ $(candidate \"994\") = \"cmxciv\" ]]\n [[ $(candidate \"1000\") = \"m\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - } -] \ No newline at end of file diff --git a/data/sh-remove.json b/data/sh-remove.json deleted file mode 100644 index 49b6ca362a94943f7cc9588a6ead624a35fd9fe6..0000000000000000000000000000000000000000 --- a/data/sh-remove.json +++ /dev/null @@ -1,1862 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "sh", - "prompt": "#!/bin/bash\n# For a given number n, find the largest number that divides n evenly, smaller than n\n#\n# $1 is an integer\nlargest_divisor() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n largest_divisor \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3\") = \"1\" ]]\n [[ $(candidate \"7\") = \"1\" ]]\n [[ $(candidate \"10\") = \"5\" ]]\n [[ $(candidate \"100\") = \"50\" ]]\n [[ $(candidate \"49\") = \"7\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_47_median", - "language": "sh", - "prompt": "#!/bin/bash\n# Return median of elements in the list l.\n#\n# $1 is a space-separated list\nmedian() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n median \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3 1 2 4 5\") = \"3\" ]]\n [[ $(candidate \"-10 4 6 1000 10 20\") = \"8.0\" ]]\n [[ $(candidate \"5\") = \"5\" ]]\n [[ $(candidate \"6 5\") = \"5.5\" ]]\n [[ $(candidate \"8 1 3 9 9 2 7\") = \"7\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "sh", - "prompt": "#!/bin/bash\n# Return maximum element in the list.\n#\n# $1 is a space-separated list\nmax_element() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n max_element \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3\") = \"3\" ]]\n [[ $(candidate \"5 3 -5 2 -3 3 9 0 124 1 -10\") = \"124\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function which returns the largest index of an element which\n# is not greater than or equal to the element immediately preceding it. If\n# no such element exists then return -1. The given array will not contain\n# duplicate values.\n# Examples:\n#\n# $1 is a space-separated list\ncan_arrange() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n can_arrange \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 4 3 5\") = \"3\" ]]\n [[ $(candidate \"1 2 4 5\") = \"-1\" ]]\n [[ $(candidate \"1 4 2 5 6 7 8 9 10\") = \"2\" ]]\n [[ $(candidate \"4 8 5 7 3\") = \"4\" ]]\n [[ $(candidate \"\") = \"-1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function that returns True if the last character\n# of a given string is an alphabetical character and is not\n# a part of a word, and False otherwise.\n# Note: \"word\" is a group of characters separated by space.\n# Examples:\n#\n# $1 is a string\ncheck_if_last_char_is_a_letter() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n check_if_last_char_is_a_letter \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"apple\") = \"false\" ]]\n [[ $(candidate \"apple pi e\") = \"true\" ]]\n [[ $(candidate \"eeeee\") = \"false\" ]]\n [[ $(candidate \"A\") = \"true\" ]]\n [[ $(candidate \"Pumpkin pie \") = \"false\" ]]\n [[ $(candidate \"Pumpkin pie 1\") = \"false\" ]]\n [[ $(candidate \"\") = \"false\" ]]\n [[ $(candidate \"eeeee e \") = \"false\" ]]\n [[ $(candidate \"apple pie\") = \"false\" ]]\n [[ $(candidate \"apple pi e \") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "sh", - "prompt": "#!/bin/bash\n# Return true if a given number is prime, and false otherwise.\n#\n# $1 is an integer\nis_prime() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n is_prime \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"6\") = \"false\" ]]\n [[ $(candidate \"101\") = \"true\" ]]\n [[ $(candidate \"11\") = \"true\" ]]\n [[ $(candidate \"13441\") = \"true\" ]]\n [[ $(candidate \"61\") = \"true\" ]]\n [[ $(candidate \"4\") = \"false\" ]]\n [[ $(candidate \"1\") = \"false\" ]]\n [[ $(candidate \"5\") = \"true\" ]]\n [[ $(candidate \"11\") = \"true\" ]]\n [[ $(candidate \"17\") = \"true\" ]]\n [[ $(candidate \"85\") = \"false\" ]]\n [[ $(candidate \"77\") = \"false\" ]]\n [[ $(candidate \"255379\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a list of positive integers x. return a sorted list of all \n# elements that hasn't any even digit.\n# Note: Returned list should be sorted in increasing order.\n# For example:\n#\n# $1 is a space-separated list\nunique_digits() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n unique_digits \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"15 33 1422 1\") = \"1 15 33\" ]]\n [[ $(candidate \"152 323 1422 10\") = \"\" ]]\n [[ $(candidate \"12345 2033 111 151\") = \"111 151\" ]]\n [[ $(candidate \"135 103 31\") = \"31 135\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "sh", - "prompt": "#!/bin/bash\n# Input are two strings a and b consisting only of 1s and 0s.\n# Perform binary XOR on these inputs and return result also as a string.\n#\n# $1 is a string\n# $2 is a string\nstring_xor() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n string_xor \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"111000\" \"101010\") = \"010010\" ]]\n [[ $(candidate \"1\" \"1\") = \"0\" ]]\n [[ $(candidate \"0101\" \"0000\") = \"0101\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "sh", - "prompt": "#!/bin/bash\n# sum_to_n is a function that sums numbers from 1 to n.\n#\n# $1 is an integer\nsum_to_n() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n sum_to_n \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1\") = \"1\" ]]\n [[ $(candidate \"6\") = \"21\" ]]\n [[ $(candidate \"11\") = \"66\" ]]\n [[ $(candidate \"30\") = \"465\" ]]\n [[ $(candidate \"100\") = \"5050\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a list of numbers, return the sum of squares of the numbers\n# in the list that are odd. Ignore numbers that are negative or not integers.\n# If the input list is empty, return 0.\n#\n# $1 is a space-separated list\ndouble_the_difference() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n double_the_difference \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"0\" ]]\n [[ $(candidate \"5.0 4.0\") = \"25\" ]]\n [[ $(candidate \"0.1 0.2 0.3\") = \"0\" ]]\n [[ $(candidate \"-10.0 -20.0 -30.0\") = \"0\" ]]\n [[ $(candidate \"-1.0 -2.0 8.0\") = \"0\" ]]\n [[ $(candidate \"0.2 3.0 5.0\") = \"34\" ]]\n [[ $(candidate \"-9.0 -7.0 -5.0 -3.0 -1.0 1.0 3.0 5.0 7.0 9.0\") = \"165\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "sh", - "prompt": "#!/bin/bash\n# Return length of given string\n#\n# $1 is a string\nstrlen() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n strlen \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"0\" ]]\n [[ $(candidate \"x\") = \"1\" ]]\n [[ $(candidate \"asdasnakj\") = \"9\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "sh", - "prompt": "#!/bin/bash\n# You'll be given a string of words, and your task is to count the number\n# of boredoms. A boredom is a sentence that starts with the word \"I\".\n# Sentences are delimited by '.', '?' or '!'.\n# For example:\n#\n# $1 is a string\nis_bored() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n is_bored \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Hello world\") = \"0\" ]]\n [[ $(candidate \"Is the sky blue?\") = \"0\" ]]\n [[ $(candidate \"I love It \\!\") = \"1\" ]]\n [[ $(candidate \"bIt\") = \"0\" ]]\n [[ $(candidate \"I feel good today. I will be productive. will kill It\") = \"2\" ]]\n [[ $(candidate \"You and I are going for a walk\") = \"0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function vowels_count which takes a string representing\n# a word as input and returns the number of vowels in the string.\n# Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n# vowel, but only when it is at the end of the given word.\n# Example:\n#\n# $1 is a string\nvowels_count() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n vowels_count \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"abcde\") = \"2\" ]]\n [[ $(candidate \"Alone\") = \"3\" ]]\n [[ $(candidate \"key\") = \"2\" ]]\n [[ $(candidate \"bye\") = \"1\" ]]\n [[ $(candidate \"keY\") = \"2\" ]]\n [[ $(candidate \"bYe\") = \"1\" ]]\n [[ $(candidate \"ACEDY\") = \"3\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "sh", - "prompt": "#!/bin/bash\n# Return n-th Fibonacci number.\n#\n# $1 is an integer\nfib() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n fib \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"10\") = \"55\" ]]\n [[ $(candidate \"1\") = \"1\" ]]\n [[ $(candidate \"8\") = \"21\" ]]\n [[ $(candidate \"11\") = \"89\" ]]\n [[ $(candidate \"12\") = \"144\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "sh", - "prompt": "#!/bin/bash\n# Your task is to implement a function that will simplify the expression\n# x * n. The function returns True if x * n evaluates to a whole number and False\n# otherwise. Both x and n, are string representation of a fraction, and have the following format,\n# / where both numerator and denominator are positive whole numbers.\n# You can assume that x, and n are valid fractions, and do not have zero as denominator.\n#\n# $1 is a string\n# $2 is a string\nsimplify() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n simplify \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1/5\" \"5/1\") = \"true\" ]]\n [[ $(candidate \"1/6\" \"2/1\") = \"false\" ]]\n [[ $(candidate \"5/1\" \"3/1\") = \"true\" ]]\n [[ $(candidate \"7/10\" \"10/2\") = \"false\" ]]\n [[ $(candidate \"2/10\" \"50/10\") = \"true\" ]]\n [[ $(candidate \"7/2\" \"4/2\") = \"true\" ]]\n [[ $(candidate \"11/6\" \"6/1\") = \"true\" ]]\n [[ $(candidate \"2/3\" \"5/2\") = \"false\" ]]\n [[ $(candidate \"5/2\" \"3/5\") = \"false\" ]]\n [[ $(candidate \"2/4\" \"8/4\") = \"true\" ]]\n [[ $(candidate \"2/4\" \"4/2\") = \"true\" ]]\n [[ $(candidate \"1/5\" \"5/1\") = \"true\" ]]\n [[ $(candidate \"1/5\" \"1/5\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a string s, count the number of uppercase vowels in even indices.\n# For example:\n#\n# $1 is a string\ncount_upper() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n count_upper \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"aBCdEf\") = \"1\" ]]\n [[ $(candidate \"abcdefg\") = \"0\" ]]\n [[ $(candidate \"dBBE\") = \"0\" ]]\n [[ $(candidate \"B\") = \"0\" ]]\n [[ $(candidate \"U\") = \"1\" ]]\n [[ $(candidate \"\") = \"0\" ]]\n [[ $(candidate \"EEEE\") = \"2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a rectangular grid of wells. Each row represents a single well,\n# and each 1 in a row represents a single unit of water.\n# Each well has a corresponding bucket that can be used to extract water from it, \n# and all buckets have the same capacity.\n# Your task is to use the buckets to empty the wells.\n# Output the number of times you need to lower the buckets.\n# Example 1:\n# Example 2:\n# Example 3:\n# Constraints:\n# * all wells have the same length\n# * 1 <= grid.length <= 10^2\n# * 1 <= grid[:,1].length <= 10^2\n# * grid[i][j] -> 0 | 1\n# * 1 <= capacity <= 10\n#\n# $1 is a newline-separated, space-separated list\n# $2 is an integer\nmax_fill() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n max_fill \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"0 0 1 0\\n0 1 0 0\\n1 1 1 1\" \"1\") = \"6\" ]]\n [[ $(candidate \"0 0 1 1\\n0 0 0 0\\n1 1 1 1\\n0 1 1 1\" \"2\") = \"5\" ]]\n [[ $(candidate \"0 0 0\\n0 0 0\" \"5\") = \"0\" ]]\n [[ $(candidate \"1 1 1 1\\n1 1 1 1\" \"2\") = \"4\" ]]\n [[ $(candidate \"1 1 1 1\\n1 1 1 1\" \"9\") = \"2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "sh", - "prompt": "#!/bin/bash\n# Given an array arr of integers and a positive integer k, return a sorted list \n# of length k with the maximum k numbers in arr.\n# Example 1:\n# Example 2:\n# Example 3:\n# Note:\n# 1. The length of the array will be in the range of [1, 1000].\n# 2. The elements in the array will be in the range of [-1000, 1000].\n# 3. 0 <= k <= len(arr)\n#\n# $1 is a space-separated list\n# $2 is an integer\nmaximum() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n maximum \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"-3 -4 5\" \"3\") = \"-4 -3 5\" ]]\n [[ $(candidate \"4 -4 4\" \"2\") = \"4 4\" ]]\n [[ $(candidate \"-3 2 1 2 -1 -2 1\" \"1\") = \"2\" ]]\n [[ $(candidate \"123 -123 20 0 1 2 -3\" \"3\") = \"2 20 123\" ]]\n [[ $(candidate \"-123 20 0 1 2 -3\" \"4\") = \"0 1 2 20\" ]]\n [[ $(candidate \"5 15 0 3 -13 -8 0\" \"7\") = \"-13 -8 0 0 3 5 15\" ]]\n [[ $(candidate \"-1 0 2 5 3 -10\" \"2\") = \"3 5\" ]]\n [[ $(candidate \"1 0 5 -7\" \"1\") = \"5\" ]]\n [[ $(candidate \"4 -4\" \"2\") = \"-4 4\" ]]\n [[ $(candidate \"-10 10\" \"2\") = \"-10 10\" ]]\n [[ $(candidate \"1 2 3 -23 243 -400 0\" \"0\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that takes a message, and encodes in such a \n# way that it swaps case of all letters, replaces all vowels in \n# the message with the letter that appears 2 places ahead of that \n# vowel in the english alphabet. \n# Assume only letters. \n# Examples:\n#\n# $1 is a string\nencode() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n encode \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"TEST\") = \"tgst\" ]]\n [[ $(candidate \"Mudasir\") = \"mWDCSKR\" ]]\n [[ $(candidate \"YES\") = \"ygs\" ]]\n [[ $(candidate \"This is a message\") = \"tHKS KS C MGSSCGG\" ]]\n [[ $(candidate \"I DoNt KnOw WhAt tO WrItE\") = \"k dQnT kNqW wHcT Tq wRkTg\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "sh", - "prompt": "#!/bin/bash\n# remove_vowels is a function that takes string and returns string without vowels.\n#\n# $1 is a string\nremove_vowels() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n remove_vowels \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"abcdef\\nghijklm\") = \"bcdf\\nghjklm\" ]]\n [[ $(candidate \"fedcba\") = \"fdcb\" ]]\n [[ $(candidate \"eeeee\") = \"\" ]]\n [[ $(candidate \"acBAA\") = \"cB\" ]]\n [[ $(candidate \"EcBOO\") = \"cB\" ]]\n [[ $(candidate \"ybcd\") = \"ybcd\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "sh", - "prompt": "#!/bin/bash\n# Return only positive numbers in the list.\n#\n# $1 is a space-separated list\nget_positive() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n get_positive \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"-1 -2 4 5 6\") = \"4 5 6\" ]]\n [[ $(candidate \"5 3 -5 2 3 3 9 0 123 1 -10\") = \"5 3 2 3 3 9 123 1\" ]]\n [[ $(candidate \"-1 -2\") = \"\" ]]\n [[ $(candidate \"\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "sh", - "prompt": "#!/bin/bash\n# Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n#\n# $1 is an integer\nstring_sequence() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n string_sequence \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"0\") = \"0\" ]]\n [[ $(candidate \"3\") = \"0 1 2 3\" ]]\n [[ $(candidate \"10\") = \"0 1 2 3 4 5 6 7 8 9 10\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a positive integer n, you have to make a pile of n levels of stones.\n# The first level has n stones.\n# The number of stones in the next level is:\n# - the next odd number if n is odd.\n# - the next even number if n is even.\n# Return the number of stones in each level in a list, where element at index\n# i represents the number of stones in the level (i+1).\n# Examples:\n#\n# $1 is an integer\nmake_a_pile() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n make_a_pile \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3\") = \"3 5 7\" ]]\n [[ $(candidate \"4\") = \"4 6 8 10\" ]]\n [[ $(candidate \"5\") = \"5 7 9 11 13\" ]]\n [[ $(candidate \"6\") = \"6 8 10 12 14 16\" ]]\n [[ $(candidate \"8\") = \"8 10 12 14 16 18 20 22\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "sh", - "prompt": "#!/bin/bash\n# Task\n# 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\n# then check if the result string is palindrome.\n# A string is called palindrome if it reads the same backward as forward.\n# You should return a tuple containing the result string and True/False for the check.\n# Example\n#\n# $1 is a string\n# $2 is a string\nreverse_delete() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n reverse_delete \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"abcde\" \"ae\") = \"bcd false\" ]]\n [[ $(candidate \"abcdef\" \"b\") = \"acdef false\" ]]\n [[ $(candidate \"abcdedcba\" \"ab\") = \"cdedc true\" ]]\n [[ $(candidate \"dwik\" \"w\") = \"dik false\" ]]\n [[ $(candidate \"a\" \"a\") = \" true\" ]]\n [[ $(candidate \"abcdedcba\" \"\") = \"abcdedcba true\" ]]\n [[ $(candidate \"abcdedcba\" \"v\") = \"abcdedcba true\" ]]\n [[ $(candidate \"vabba\" \"v\") = \"abba true\" ]]\n [[ $(candidate \"mamma\" \"mia\") = \" true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "sh", - "prompt": "#!/bin/bash\n# For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n#\n# $1 is a string\nflip_case() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n flip_case \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"Hello\\!\") = \"hELLO\\!\" ]]\n [[ $(candidate \"These violent delights have violent ends\") = \"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a string s.\n# if s[i] is a letter, reverse its case from lower to upper or vise versa, \n# otherwise keep it as it is.\n# If the string contains no letters, reverse the string.\n# The function should return the resulted string.\n# Examples\n#\n# $1 is a string\nsolve() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n solve \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"AsDf\") = \"aSdF\" ]]\n [[ $(candidate \"1234\") = \"4321\" ]]\n [[ $(candidate \"ab\") = \"AB\" ]]\n [[ $(candidate \"#a@C\") = \"#A@c\" ]]\n [[ $(candidate \"#AsdfW^45\") = \"#aSDFw^45\" ]]\n [[ $(candidate \"#6@2\") = \"2@6#\" ]]\n [[ $(candidate \"#\\$a^D\") = \"#\\$A^d\" ]]\n [[ $(candidate \"#ccc\") = \"#CCC\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "sh", - "prompt": "#!/bin/bash\n# This function takes two positive numbers x and y and returns the\n# biggest even integer number that is in the range [x, y] inclusive. If \n# there's no such number, then the function should return -1.\n# For example:\n#\n# $1 is an integer\n# $2 is an integer\nchoose_num() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n choose_num \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"12\" \"15\") = \"14\" ]]\n [[ $(candidate \"13\" \"12\") = \"-1\" ]]\n [[ $(candidate \"33\" \"12354\") = \"12354\" ]]\n [[ $(candidate \"5234\" \"5233\") = \"-1\" ]]\n [[ $(candidate \"6\" \"29\") = \"28\" ]]\n [[ $(candidate \"27\" \"10\") = \"-1\" ]]\n [[ $(candidate \"7\" \"7\") = \"-1\" ]]\n [[ $(candidate \"546\" \"546\") = \"546\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a string representing a sentence,\n# the sentence contains some words separated by a space,\n# and you have to return a string that contains the words from the original sentence,\n# whose lengths are prime numbers,\n# the order of the words in the new string should be the same as the original one.\n# Example 1:\n# Example 2:\n# Constraints:\n# * 1 <= len(sentence) <= 100\n# * sentence contains only letters\n#\n# $1 is a string\nwords_in_sentence() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n words_in_sentence \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"This is a test\") = \"is\" ]]\n [[ $(candidate \"lets go for swimming\") = \"go for\" ]]\n [[ $(candidate \"there is no place available here\") = \"there is no place\" ]]\n [[ $(candidate \"Hi I am Hussein\") = \"Hi am Hussein\" ]]\n [[ $(candidate \"go for it\") = \"go for it\" ]]\n [[ $(candidate \"here\") = \"\" ]]\n [[ $(candidate \"here is\") = \"is\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "sh", - "prompt": "#!/bin/bash\n# Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n#\n# $1 is a space-separated list\n# $2 is an integer\nintersperse() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n intersperse \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\" \"7\") = \"\" ]]\n [[ $(candidate \"5 6 3 2\" \"8\") = \"5 8 6 8 3 8 2\" ]]\n [[ $(candidate \"2 2 2\" \"2\") = \"2 2 2 2 2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "sh", - "prompt": "#!/bin/bash\n# Your task is to write a function that returns true if a number x is a simple\n# power of n and false in other cases.\n# x is a simple power of n if n**int=x\n# For example:\n#\n# $1 is an integer\n# $2 is an integer\nis_simple_power() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n is_simple_power \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"16\" \"2\") = \"true\" ]]\n [[ $(candidate \"143214\" \"16\") = \"false\" ]]\n [[ $(candidate \"4\" \"2\") = \"true\" ]]\n [[ $(candidate \"9\" \"3\") = \"true\" ]]\n [[ $(candidate \"16\" \"4\") = \"true\" ]]\n [[ $(candidate \"24\" \"2\") = \"false\" ]]\n [[ $(candidate \"128\" \"4\") = \"false\" ]]\n [[ $(candidate \"12\" \"6\") = \"false\" ]]\n [[ $(candidate \"1\" \"1\") = \"true\" ]]\n [[ $(candidate \"1\" \"12\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that returns true if the given number is the multiplication of 3 prime numbers\n# and false otherwise.\n# Knowing that (a) is less then 100. \n# Example:\n# 30 = 2 * 3 * 5\n#\n# $1 is an integer\nis_multiply_prime() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n is_multiply_prime \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\") = \"false\" ]]\n [[ $(candidate \"30\") = \"true\" ]]\n [[ $(candidate \"8\") = \"true\" ]]\n [[ $(candidate \"10\") = \"false\" ]]\n [[ $(candidate \"125\") = \"true\" ]]\n [[ $(candidate \"105\") = \"true\" ]]\n [[ $(candidate \"126\") = \"false\" ]]\n [[ $(candidate \"729\") = \"false\" ]]\n [[ $(candidate \"891\") = \"false\" ]]\n [[ $(candidate \"1001\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "sh", - "prompt": "#!/bin/bash\n# Given the lengths of the three sides of a triangle. Return True if the three\n# sides form a right-angled triangle, False otherwise.\n# A right-angled triangle is a triangle in which one angle is right angle or \n# 90 degree.\n# Example:\n#\n# $1 is an integer\n# $2 is an integer\n# $3 is an integer\nright_angle_triangle() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n right_angle_triangle \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3\" \"4\" \"5\") = \"true\" ]]\n [[ $(candidate \"1\" \"2\" \"3\") = \"false\" ]]\n [[ $(candidate \"10\" \"6\" \"8\") = \"true\" ]]\n [[ $(candidate \"2\" \"2\" \"2\") = \"false\" ]]\n [[ $(candidate \"7\" \"24\" \"25\") = \"true\" ]]\n [[ $(candidate \"10\" \"5\" \"7\") = \"false\" ]]\n [[ $(candidate \"5\" \"12\" \"13\") = \"true\" ]]\n [[ $(candidate \"15\" \"8\" \"17\") = \"true\" ]]\n [[ $(candidate \"48\" \"55\" \"73\") = \"true\" ]]\n [[ $(candidate \"1\" \"1\" \"1\") = \"false\" ]]\n [[ $(candidate \"2\" \"2\" \"10\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function that takes 3 numbers.\n# Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n# Returns false in any other cases.\n# Examples\n#\n# $1 is a floating point\n# $2 is a floating point\n# $3 is a floating point\nany_int() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n any_int \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2\" \"3\" \"1\") = \"true\" ]]\n [[ $(candidate \"2.5\" \"2\" \"3\") = \"false\" ]]\n [[ $(candidate \"1.5\" \"5\" \"3.5\") = \"false\" ]]\n [[ $(candidate \"2\" \"6\" \"2\") = \"false\" ]]\n [[ $(candidate \"4\" \"2\" \"2\") = \"true\" ]]\n [[ $(candidate \"2.2\" \"2.2\" \"2.2\") = \"false\" ]]\n [[ $(candidate \"-4\" \"6\" \"2\") = \"true\" ]]\n [[ $(candidate \"2\" \"1\" \"1\") = \"true\" ]]\n [[ $(candidate \"3\" \"4\" \"7\") = \"true\" ]]\n [[ $(candidate \"3.0\" \"4\" \"7\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "sh", - "prompt": "#!/bin/bash\n# This function takes a list l and returns a list l' such that\n# l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n# to the values of the corresponding indicies of l, but sorted.\n#\n# $1 is a space-separated list\nsort_third() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n sort_third \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5 6 3 4 8 9 2\") = \"2 6 3 4 8 9 5\" ]]\n [[ $(candidate \"5 8 3 4 6 9 2\") = \"2 8 3 4 6 9 5\" ]]\n [[ $(candidate \"5 6 9 4 8 3 2\") = \"2 6 9 4 8 3 5\" ]]\n [[ $(candidate \"5 6 3 4 8 9 2 1\") = \"2 6 3 4 8 9 5 1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_53_add", - "language": "sh", - "prompt": "#!/bin/bash\n# Add two numbers x and y\n#\n# $1 is an integer\n# $2 is an integer\nadd() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n add \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"0\" \"1\") = \"1\" ]]\n [[ $(candidate \"1\" \"0\") = \"1\" ]]\n [[ $(candidate \"2\" \"3\") = \"5\" ]]\n [[ $(candidate \"5\" \"7\") = \"12\" ]]\n [[ $(candidate \"7\" \"5\") = \"12\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_69_search", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n# zero, and has a frequency greater than or equal to the value of the integer itself. \n# The frequency of an integer is the number of times it appears in the list.\n# If no such a value exist, return -1.\n# Examples:\n#\n# $1 is a space-separated list\nsearch() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n search \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5 5 5 5 1\") = \"1\" ]]\n [[ $(candidate \"4 1 4 1 4 4\") = \"4\" ]]\n [[ $(candidate \"3 3\") = \"-1\" ]]\n [[ $(candidate \"8 8 8 8 8 8 8 8\") = \"8\" ]]\n [[ $(candidate \"2 3 3 2 2\") = \"2\" ]]\n [[ $(candidate \"2 7 8 8 4 8 7 3 9 6 5 10 4 3 6 7 1 7 4 10 8 1\") = \"1\" ]]\n [[ $(candidate \"3 2 8 2\") = \"2\" ]]\n [[ $(candidate \"6 7 1 8 8 10 5 8 5 3 10\") = \"1\" ]]\n [[ $(candidate \"8 8 3 6 5 6 4\") = \"-1\" ]]\n [[ $(candidate \"6 9 6 7 1 4 7 1 8 8 9 8 10 10 8 4 10 4 10 1 2 9 5 7 9\") = \"1\" ]]\n [[ $(candidate \"1 9 10 1 3\") = \"1\" ]]\n [[ $(candidate \"6 9 7 5 8 7 5 3 7 5 10 10 3 6 10 2 8 6 5 4 9 5 3 10\") = \"5\" ]]\n [[ $(candidate \"1\") = \"1\" ]]\n [[ $(candidate \"8 8 10 6 4 3 5 8 2 4 2 8 4 6 10 4 2 1 10 2 1 1 5\") = \"4\" ]]\n [[ $(candidate \"2 10 4 8 2 10 5 1 2 9 5 5 6 3 8 6 4 10\") = \"2\" ]]\n [[ $(candidate \"1 6 10 1 6 9 10 8 6 8 7 3\") = \"1\" ]]\n [[ $(candidate \"9 2 4 1 5 1 5 2 5 7 7 7 3 10 1 5 4 2 8 4 1 9 10 7 10 2 8 10 9 4\") = \"4\" ]]\n [[ $(candidate \"2 6 4 2 8 7 5 6 4 10 4 6 3 7 8 8 3 1 4 2 2 10 7\") = \"4\" ]]\n [[ $(candidate \"9 8 6 10 2 6 10 2 7 8 10 3 8 2 6 2 3 1\") = \"2\" ]]\n [[ $(candidate \"5 5 3 9 5 6 3 2 8 5 6 10 10 6 8 4 10 7 7 10 8\") = \"-1\" ]]\n [[ $(candidate \"10\") = \"-1\" ]]\n [[ $(candidate \"9 7 7 2 4 7 2 10 9 7 5 7 2\") = \"2\" ]]\n [[ $(candidate \"5 4 10 2 1 1 10 3 6 1 8\") = \"1\" ]]\n [[ $(candidate \"7 9 9 9 3 4 1 5 9 1 2 1 1 10 7 5 6 7 6 7 7 6\") = \"1\" ]]\n [[ $(candidate \"3 10 10 9 2\") = \"-1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that takes a string and returns True if the string\n# length is a prime number or False otherwise\n# Examples\n#\n# $1 is a string\nprime_length() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n prime_length \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Hello\") = \"true\" ]]\n [[ $(candidate \"abcdcba\") = \"true\" ]]\n [[ $(candidate \"kittens\") = \"true\" ]]\n [[ $(candidate \"orange\") = \"false\" ]]\n [[ $(candidate \"wow\") = \"true\" ]]\n [[ $(candidate \"world\") = \"true\" ]]\n [[ $(candidate \"MadaM\") = \"true\" ]]\n [[ $(candidate \"Wow\") = \"true\" ]]\n [[ $(candidate \"\") = \"false\" ]]\n [[ $(candidate \"HI\") = \"true\" ]]\n [[ $(candidate \"go\") = \"true\" ]]\n [[ $(candidate \"gogo\") = \"false\" ]]\n [[ $(candidate \"aaaaaaaaaaaaaaa\") = \"false\" ]]\n [[ $(candidate \"Madam\") = \"true\" ]]\n [[ $(candidate \"M\") = \"false\" ]]\n [[ $(candidate \"0\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_58_common", - "language": "sh", - "prompt": "#!/bin/bash\n# Return sorted unique common elements for two lists.\n#\n# $1 is a space-separated list\n# $2 is a space-separated list\ncommon() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n common \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 4 3 34 653 2 5\" \"5 7 1 5 9 653 121\") = \"1 5 653\" ]]\n [[ $(candidate \"5 3 2 8\" \"3 2\") = \"2 3\" ]]\n [[ $(candidate \"4 3 2 8\" \"3 2 4\") = \"2 3 4\" ]]\n [[ $(candidate \"4 3 2 8\" \"\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "sh", - "prompt": "#!/bin/bash\n# The Brazilian factorial is defined as:\n# brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n# where n > 0\n# For example:\n# The function will receive an integer as input and should return the special\n# factorial of this integer.\n#\n# $1 is an integer\nspecial_factorial() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n special_factorial \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"4\") = \"288\" ]]\n [[ $(candidate \"5\") = \"34560\" ]]\n [[ $(candidate \"7\") = \"125411328000\" ]]\n [[ $(candidate \"1\") = \"1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "sh", - "prompt": "#!/bin/bash\n# In this problem, you will implement a function that takes two lists of numbers,\n# and determines whether it is possible to perform an exchange of elements\n# between them to make lst1 a list of only even numbers.\n# There is no limit on the number of exchanged elements between lst1 and lst2.\n# If it is possible to exchange elements between the lst1 and lst2 to make\n# all the elements of lst1 to be even, return \"YES\".\n# Otherwise, return \"NO\".\n# For example:\n# It is assumed that the input lists will be non-empty.\n#\n# $1 is a space-separated list\n# $2 is a space-separated list\nexchange() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n exchange \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3 4\" \"1 2 3 4\") = \"YES\" ]]\n [[ $(candidate \"1 2 3 4\" \"1 5 3 4\") = \"NO\" ]]\n [[ $(candidate \"1 2 3 4\" \"2 1 4 3\") = \"YES\" ]]\n [[ $(candidate \"5 7 3\" \"2 6 4\") = \"YES\" ]]\n [[ $(candidate \"5 7 3\" \"2 6 3\") = \"NO\" ]]\n [[ $(candidate \"3 2 6 1 8 9\" \"3 5 5 1 1 1\") = \"NO\" ]]\n [[ $(candidate \"100 200\" \"200 200\") = \"YES\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a non-empty array of integers arr and an integer k, return\n# the sum of the elements with at most two digits from the first k elements of arr.\n# Example:\n# Constraints:\n# 1. 1 <= len(arr) <= 100\n# 2. 1 <= k <= len(arr)\n#\n# $1 is a space-separated list\n# $2 is an integer\nadd_elements() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n add_elements \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 -2 -3 41 57 76 87 88 99\" \"3\") = \"-4\" ]]\n [[ $(candidate \"111 121 3 4000 5 6\" \"2\") = \"0\" ]]\n [[ $(candidate \"11 21 3 90 5 6 7 8 9\" \"4\") = \"125\" ]]\n [[ $(candidate \"111 21 3 4000 5 6 7 8 9\" \"4\") = \"24\" ]]\n [[ $(candidate \"1\" \"1\") = \"1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "sh", - "prompt": "#!/bin/bash\n# A simple program which should return the value of x if n is \n# a prime number and should return the value of y otherwise.\n# Examples:\n#\n# $1 is an integer\n# $2 is an integer\n# $3 is an integer\nx_or_y() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n x_or_y \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"7\" \"34\" \"12\") = \"34\" ]]\n [[ $(candidate \"15\" \"8\" \"5\") = \"5\" ]]\n [[ $(candidate \"3\" \"33\" \"5212\") = \"33\" ]]\n [[ $(candidate \"1259\" \"3\" \"52\") = \"3\" ]]\n [[ $(candidate \"7919\" \"-1\" \"12\") = \"-1\" ]]\n [[ $(candidate \"3609\" \"1245\" \"583\") = \"583\" ]]\n [[ $(candidate \"91\" \"56\" \"129\") = \"129\" ]]\n [[ $(candidate \"6\" \"34\" \"1234\") = \"1234\" ]]\n [[ $(candidate \"1\" \"2\" \"0\") = \"0\" ]]\n [[ $(candidate \"2\" \"2\" \"0\") = \"2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "sh", - "prompt": "#!/bin/bash\n# Given length of a side and high return area for a triangle.\n#\n# $1 is an integer\n# $2 is an integer\ntriangle_area() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n triangle_area \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\" \"3\") = \"7.5\" ]]\n [[ $(candidate \"2\" \"2\") = \"2.0\" ]]\n [[ $(candidate \"10\" \"8\") = \"40.0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "sh", - "prompt": "#!/bin/bash\n# Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n# the last couple centuries. However, what people don't know is Tribonacci sequence.\n# Tribonacci sequence is defined by the recurrence:\n# tri(1) = 3\n# tri(n) = 1 + n / 2, if n is even.\n# tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n# For example:\n# tri(2) = 1 + (2 / 2) = 2\n# tri(4) = 3\n# tri(3) = tri(2) + tri(1) + tri(4)\n# = 2 + 3 + 3 = 8 \n# You are given a non-negative integer number n, you have to a return a list of the \n# first n + 1 numbers of the Tribonacci sequence.\n# Examples:\n#\n# $1 is an integer\ntri() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n tri \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3\") = \"1 3 2 8\" ]]\n [[ $(candidate \"4\") = \"1 3 2 8 3\" ]]\n [[ $(candidate \"5\") = \"1 3 2 8 3 15\" ]]\n [[ $(candidate \"6\") = \"1 3 2 8 3 15 4\" ]]\n [[ $(candidate \"7\") = \"1 3 2 8 3 15 4 24\" ]]\n [[ $(candidate \"8\") = \"1 3 2 8 3 15 4 24 5\" ]]\n [[ $(candidate \"9\") = \"1 3 2 8 3 15 4 24 5 35\" ]]\n [[ $(candidate \"20\") = \"1 3 2 8 3 15 4 24 5 35 6 48 7 63 8 80 9 99 10 120 11\" ]]\n [[ $(candidate \"0\") = \"1\" ]]\n [[ $(candidate \"1\") = \"1 3\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a list of two strings, both strings consist of open\n# parentheses '(' or close parentheses ')' only.\n# Your job is to check if it is possible to concatenate the two strings in\n# some order, that the resulting string will be good.\n# A string S is considered to be good if and only if all parentheses in S\n# are balanced. For example: the string '(())()' is good, while the string\n# '())' is not.\n# Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n# Examples:\n#\n# $1 is a space-separated list\nmatch_parens() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n match_parens \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"()( )\") = \"Yes\" ]]\n [[ $(candidate \") )\") = \"No\" ]]\n [[ $(candidate \"(()(()) ())())\") = \"No\" ]]\n [[ $(candidate \")()) (()()(\") = \"Yes\" ]]\n [[ $(candidate \"(()))) (()())((\") = \"Yes\" ]]\n [[ $(candidate \"() ())\") = \"No\" ]]\n [[ $(candidate \"(()( ()))()\") = \"Yes\" ]]\n [[ $(candidate \"(((( ((())\") = \"No\" ]]\n [[ $(candidate \")(() (()(\") = \"No\" ]]\n [[ $(candidate \")( )(\") = \"No\" ]]\n [[ $(candidate \"( )\") = \"Yes\" ]]\n [[ $(candidate \") (\") = \"Yes\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "sh", - "prompt": "#!/bin/bash\n# From a list of integers, remove all elements that occur more than once.\n# Keep order of elements left the same as in the input.\n#\n# $1 is a space-separated list\nremove_duplicates() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n remove_duplicates \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"1 2 3 4\") = \"1 2 3 4\" ]]\n [[ $(candidate \"1 2 3 2 4 3 5\") = \"1 4 5\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "sh", - "prompt": "#!/bin/bash\n# Return a greatest common divisor of two integers a and b\n#\n# $1 is an integer\n# $2 is an integer\ngreatest_common_divisor() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n greatest_common_divisor \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3\" \"7\") = \"1\" ]]\n [[ $(candidate \"10\" \"15\") = \"5\" ]]\n [[ $(candidate \"49\" \"14\") = \"7\" ]]\n [[ $(candidate \"144\" \"60\") = \"12\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "sh", - "prompt": "#!/bin/bash\n# Checks if given string is a palindrome\n#\n# $1 is a string\nis_palindrome() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n is_palindrome \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"true\" ]]\n [[ $(candidate \"aba\") = \"true\" ]]\n [[ $(candidate \"aaaaa\") = \"true\" ]]\n [[ $(candidate \"zbcd\") = \"false\" ]]\n [[ $(candidate \"xywyx\") = \"true\" ]]\n [[ $(candidate \"xywyz\") = \"false\" ]]\n [[ $(candidate \"xywzx\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "sh", - "prompt": "#!/bin/bash\n# xs represent coefficients of a polynomial.\n# xs[0] + xs[1] * x + xs[2] * x^2 + ....\n# Return derivative of this polynomial in the same form.\n#\n# $1 is a space-separated list\nderivative() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n derivative \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3 1 2 4 5\") = \"1 4 12 20\" ]]\n [[ $(candidate \"1 2 3\") = \"2 6\" ]]\n [[ $(candidate \"3 2 1\") = \"2 2\" ]]\n [[ $(candidate \"3 2 1 0 4\") = \"2 2 0 16\" ]]\n [[ $(candidate \"1\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "sh", - "prompt": "#!/bin/bash\n# In this task, you will be given a string that represents a number of apples and oranges \n# that are distributed in a basket of fruit this basket contains \n# apples, oranges, and mango fruits. Given the string that represents the total number of \n# the oranges and apples and an integer that represent the total number of the fruits \n# in the basket return the number of the mango fruits in the basket.\n# for examble:\n#\n# $1 is a string\n# $2 is an integer\nfruit_distribution() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n fruit_distribution \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5 apples and 6 oranges\" \"19\") = \"8\" ]]\n [[ $(candidate \"5 apples and 6 oranges\" \"21\") = \"10\" ]]\n [[ $(candidate \"0 apples and 1 oranges\" \"3\") = \"2\" ]]\n [[ $(candidate \"1 apples and 0 oranges\" \"3\") = \"2\" ]]\n [[ $(candidate \"2 apples and 3 oranges\" \"100\") = \"95\" ]]\n [[ $(candidate \"2 apples and 3 oranges\" \"5\") = \"0\" ]]\n [[ $(candidate \"1 apples and 100 oranges\" \"120\") = \"19\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that takes an integer a and returns True \n# if this ingeger is a cube of some integer number.\n# Note: you may assume the input is always valid.\n# Examples:\n#\n# $1 is an integer\niscube() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n iscube \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1\") = \"true\" ]]\n [[ $(candidate \"2\") = \"false\" ]]\n [[ $(candidate \"-1\") = \"true\" ]]\n [[ $(candidate \"64\") = \"true\" ]]\n [[ $(candidate \"180\") = \"false\" ]]\n [[ $(candidate \"1000\") = \"true\" ]]\n [[ $(candidate \"0\") = \"true\" ]]\n [[ $(candidate \"1729\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "sh", - "prompt": "#!/bin/bash\n# In this Kata, you have to sort an array of non-negative integers according to\n# number of ones in their binary representation in ascending order.\n# For similar number of ones, sort based on decimal value.\n# It must be implemented like this:\n#\n# $1 is a space-separated list\nsort_array() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n sort_array \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 5 2 3 4\") = \"1 2 4 3 5\" ]]\n [[ $(candidate \"-2 -3 -4 -5 -6\") = \"-4 -2 -6 -5 -3\" ]]\n [[ $(candidate \"1 0 2 3 4\") = \"0 1 2 4 3\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"2 5 77 4 5 3 5 7 2 3 4\") = \"2 2 4 4 3 3 5 5 5 7 77\" ]]\n [[ $(candidate \"3 6 44 12 32 5\") = \"32 3 5 6 12 44\" ]]\n [[ $(candidate \"2 4 8 16 32\") = \"2 4 8 16 32\" ]]\n [[ $(candidate \"2 4 8 16 32\") = \"2 4 8 16 32\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "sh", - "prompt": "#!/bin/bash\n# brackets is a string of \"(\" and \")\".\n# return True if every opening bracket has a corresponding closing bracket.\n#\n# $1 is a string\ncorrect_bracketing() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n correct_bracketing \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"()\") = \"true\" ]]\n [[ $(candidate \"(()())\") = \"true\" ]]\n [[ $(candidate \"()()(()())()\") = \"true\" ]]\n [[ $(candidate \"()()((()()())())(()()(()))\") = \"true\" ]]\n [[ $(candidate \"((()())))\") = \"false\" ]]\n [[ $(candidate \")(()\") = \"false\" ]]\n [[ $(candidate \"(\") = \"false\" ]]\n [[ $(candidate \"((((\") = \"false\" ]]\n [[ $(candidate \")\") = \"false\" ]]\n [[ $(candidate \"(()\") = \"false\" ]]\n [[ $(candidate \"()()(()())())(()\") = \"false\" ]]\n [[ $(candidate \"()()(()())()))()\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "sh", - "prompt": "#!/bin/bash\n# Task\n# Write a function that takes a string as input and returns the sum of the upper characters only'\n# ASCII codes.\n# Examples:\n#\n# $1 is a string\ndigitSum() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n digitSum \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"0\" ]]\n [[ $(candidate \"abAB\") = \"131\" ]]\n [[ $(candidate \"abcCd\") = \"67\" ]]\n [[ $(candidate \"helloE\") = \"69\" ]]\n [[ $(candidate \"woArBld\") = \"131\" ]]\n [[ $(candidate \"aAaaaXa\") = \"153\" ]]\n [[ $(candidate \" How are yOu?\") = \"151\" ]]\n [[ $(candidate \"You arE Very Smart\") = \"327\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that accepts a list of strings as a parameter,\n# deletes the strings that have odd lengths from it,\n# and returns the resulted list with a sorted order,\n# The list is always a list of strings and never an array of numbers,\n# and it may contain duplicates.\n# The order of the list should be ascending by length of each word, and you\n# should return the list sorted by that rule.\n# If two words have the same length, sort the list alphabetically.\n# The function should return a list of strings in sorted order.\n# You may assume that all words will have the same length.\n# For example:\n#\n# $1 is a space-separated list\nsorted_list_sum() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n sorted_list_sum \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"aa a aaa\") = \"aa\" ]]\n [[ $(candidate \"school AI asdf b\") = \"AI asdf school\" ]]\n [[ $(candidate \"d b c a\") = \"\" ]]\n [[ $(candidate \"d dcba abcd a\") = \"abcd dcba\" ]]\n [[ $(candidate \"AI ai au\") = \"AI ai au\" ]]\n [[ $(candidate \"a b b c c a\") = \"\" ]]\n [[ $(candidate \"aaaa bbbb dd cc\") = \"cc dd aaaa bbbb\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given an array arr of integers and you need to return\n# sum of magnitudes of integers multiplied by product of all signs\n# of each number in the array, represented by 1, -1 or 0.\n# Note: return None for empty arr.\n# Example:\n#\n# $1 is a space-separated list\nprod_signs() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n prod_signs \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 2 -4\") = \"-9\" ]]\n [[ $(candidate \"0 1\") = \"0\" ]]\n [[ $(candidate \"1 1 1 2 3 -1 1\") = \"-10\" ]]\n [[ $(candidate \"\") = \"None\" ]]\n [[ $(candidate \"2 4 1 2 -1 -1 9\") = \"20\" ]]\n [[ $(candidate \"-1 1 -1 1\") = \"4\" ]]\n [[ $(candidate \"-1 1 1 1\") = \"-4\" ]]\n [[ $(candidate \"-1 1 1 0\") = \"0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "sh", - "prompt": "#!/bin/bash\n# Return list with elements incremented by 1.\n#\n# $1 is a space-separated list\nincr_list() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n incr_list \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"3 2 1\") = \"4 3 2\" ]]\n [[ $(candidate \"5 2 5 2 3 3 9 0 123\") = \"6 3 6 3 4 4 10 1 124\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "sh", - "prompt": "#!/bin/bash\n# From a given list of integers, generate a list of rolling maximum element found until given moment\n# in the sequence.\n#\n# $1 is a space-separated list\nrolling_max() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n rolling_max \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"1 2 3 4\") = \"1 2 3 4\" ]]\n [[ $(candidate \"4 3 2 1\") = \"4 4 4 4\" ]]\n [[ $(candidate \"3 2 3 100 3\") = \"3 3 3 100 100\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "sh", - "prompt": "#!/bin/bash\n# Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n# separate those group into separate strings and return the list of those.\n# Separate groups are balanced (each open brace is properly closed) and not nested within each other\n# Ignore any spaces in the input string.\n#\n# $1 is a string\nseparate_paren_groups() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n separate_paren_groups \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"(()()) ((())) () ((())()())\") = \"(()()) ((())) () ((())()())\" ]]\n [[ $(candidate \"() (()) ((())) (((())))\") = \"() (()) ((())) (((())))\" ]]\n [[ $(candidate \"(()(())((())))\") = \"(()(())((())))\" ]]\n [[ $(candidate \"( ) (( )) (( )( ))\") = \"() (()) (()())\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "sh", - "prompt": "#!/bin/bash\n# You will be given a string of words separated by commas or spaces. Your task is\n# to split the string into words and return an array of the words.\n# For example:\n#\n# $1 is a string\nwords_string() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n words_string \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Hi, my name is John\") = \"Hi my name is John\" ]]\n [[ $(candidate \"One, two, three, four, five, six\") = \"One two three four five six\" ]]\n [[ $(candidate \"Hi, my name\") = \"Hi my name\" ]]\n [[ $(candidate \"One,, two, three, four, five, six,\") = \"One two three four five six\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"ahmed , gamal\") = \"ahmed gamal\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function that takes integers, floats, or strings representing\n# real numbers, and returns the larger variable in its given variable type.\n# Return None if the values are equal.\n# Note: If a real number is represented as a string, the floating point might be . or ,\n#\n# $1 is an argument\n# $2 is an argument\ncompare_one() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n compare_one \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1\" \"2\") = \"2\" ]]\n [[ $(candidate \"1\" \"2.5\") = \"2.5\" ]]\n [[ $(candidate \"2\" \"3\") = \"3\" ]]\n [[ $(candidate \"5\" \"6\") = \"6\" ]]\n [[ $(candidate \"1\" \"2,3\") = \"2,3\" ]]\n [[ $(candidate \"5,1\" \"6\") = \"6\" ]]\n [[ $(candidate \"1\" \"2\") = \"2\" ]]\n [[ $(candidate \"1\" \"1\") = \"None\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "sh", - "prompt": "#!/bin/bash\n# Filter given list of any python values only for integers\n#\n# $1 is a space-separated list\nfilter_integers() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n filter_integers \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"4 23.2 9 adasd\") = \"4 9\" ]]\n [[ $(candidate \"3 c 3 3 a b\") = \"3 3 3\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "sh", - "prompt": "#!/bin/bash\n# This function takes a list l and returns a list l' such that\n# l' is identical to l in the odd indicies, while its values at the even indicies are equal\n# to the values of the even indicies of l, but sorted.\n#\n# $1 is a space-separated list\nsort_even() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n sort_even \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3\") = \"1 2 3\" ]]\n [[ $(candidate \"5 3 -5 2 -3 3 9 0 123 1 -10\") = \"-10 3 -5 2 -3 3 5 0 9 1 123\" ]]\n [[ $(candidate \"5 8 -12 4 23 2 3 11 12 -10\") = \"-12 8 3 4 5 2 12 11 23 -10\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "sh", - "prompt": "#!/bin/bash\n# I think we all remember that feeling when the result of some long-awaited\n# event is finally known. The feelings and thoughts you have at that moment are\n# definitely worth noting down and comparing.\n# Your task is to determine if a person correctly guessed the results of a number of matches.\n# You are given two arrays of scores and guesses of equal length, where each index shows a match. \n# Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n# the value is 0, and if not, the value is the absolute difference between the guess and the score.\n# example:\n#\n# $1 is a space-separated list\n# $2 is a space-separated list\ncompare() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n compare \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3 4 5 1\" \"1 2 3 4 2 -2\") = \"0 0 0 0 3 3\" ]]\n [[ $(candidate \"0 0 0 0 0 0\" \"0 0 0 0 0 0\") = \"0 0 0 0 0 0\" ]]\n [[ $(candidate \"1 2 3\" \"-1 -2 -3\") = \"2 4 6\" ]]\n [[ $(candidate \"1 2 3 5\" \"-1 2 3 4\") = \"2 0 0 1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a positive integer n, return a tuple that has the number of even and odd\n# integer palindromes that fall within the range(1, n), inclusive.\n# Example 1:\n# Explanation:\n# Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n# Example 2:\n# Explanation:\n# Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n# Note:\n# 1. 1 <= n <= 10^3\n# 2. returned tuple has the number of even and odd integer palindromes respectively.\n#\n# $1 is an integer\neven_odd_palindrome() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n even_odd_palindrome \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"123\") = \"8 13\" ]]\n [[ $(candidate \"12\") = \"4 6\" ]]\n [[ $(candidate \"3\") = \"1 2\" ]]\n [[ $(candidate \"63\") = \"6 8\" ]]\n [[ $(candidate \"25\") = \"5 6\" ]]\n [[ $(candidate \"19\") = \"4 6\" ]]\n [[ $(candidate \"9\") = \"4 5\" ]]\n [[ $(candidate \"1\") = \"0 1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "sh", - "prompt": "#!/bin/bash\n# The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fib4(0) -> 0\n# fib4(1) -> 0\n# fib4(2) -> 2\n# fib4(3) -> 0\n# fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n# Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n#\n# $1 is an integer\nfib4() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n fib4 \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\") = \"4\" ]]\n [[ $(candidate \"8\") = \"28\" ]]\n [[ $(candidate \"10\") = \"104\" ]]\n [[ $(candidate \"12\") = \"386\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "sh", - "prompt": "#!/bin/bash\n# Given two positive integers a and b, return the even digits between a\n# and b, in ascending order.\n# For example:\n#\n# $1 is an integer\n# $2 is an integer\ngenerate_integers() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n generate_integers \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2\" \"10\") = \"2 4 6 8\" ]]\n [[ $(candidate \"10\" \"2\") = \"2 4 6 8\" ]]\n [[ $(candidate \"132\" \"2\") = \"2 4 6 8\" ]]\n [[ $(candidate \"17\" \"89\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "sh", - "prompt": "#!/bin/bash\n# For a given list of input numbers, calculate Mean Absolute Deviation\n# around the mean of this dataset.\n# Mean Absolute Deviation is the average absolute difference between each\n# element and a centerpoint (mean in this case):\n# MAD = average | x - x_mean |\n#\n# $1 is a space-separated list\nmean_absolute_deviation() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n mean_absolute_deviation \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1.0 2.0\") = \"0.5\" ]]\n [[ $(candidate \"1.0 2.0 3.0 4.0\") = \"1.0\" ]]\n [[ $(candidate \"1.0 2.0 3.0 4.0 5.0\") = \"1.2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function encrypt that takes a string as an argument and\n# returns a string encrypted with the alphabet being rotated. \n# The alphabet should be rotated in a manner such that the letters \n# shift down by two multiplied to two places.\n# For example:\n#\n# $1 is a string\nencrypt() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n encrypt \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"hi\") = \"lm\" ]]\n [[ $(candidate \"asdfghjkl\") = \"ewhjklnop\" ]]\n [[ $(candidate \"gf\") = \"kj\" ]]\n [[ $(candidate \"et\") = \"ix\" ]]\n [[ $(candidate \"faewfawefaewg\") = \"jeiajeaijeiak\" ]]\n [[ $(candidate \"hellomyfriend\") = \"lippsqcjvmirh\" ]]\n [[ $(candidate \"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\") = \"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\" ]]\n [[ $(candidate \"a\") = \"e\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n# The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n# as follows: start with any positive integer n. Then each term is obtained from the \n# previous term as follows: if the previous term is even, the next term is one half of \n# the previous term. If the previous term is odd, the next term is 3 times the previous\n# term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n# Note: \n# 1. Collatz(1) is [1].\n# 2. returned list sorted in increasing order.\n# For example:\n# get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n#\n# $1 is an integer\nget_odd_collatz() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n get_odd_collatz \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"14\") = \"1 5 7 11 13 17\" ]]\n [[ $(candidate \"5\") = \"1 5\" ]]\n [[ $(candidate \"12\") = \"1 3 5\" ]]\n [[ $(candidate \"1\") = \"1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "sh", - "prompt": "#!/bin/bash\n# Find how many times a given substring can be found in the original string. Count overlaping cases.\n#\n# $1 is a string\n# $2 is a string\nhow_many_times() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n how_many_times \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\" \"x\") = \"0\" ]]\n [[ $(candidate \"xyxyxyx\" \"x\") = \"4\" ]]\n [[ $(candidate \"cacacacac\" \"cac\") = \"4\" ]]\n [[ $(candidate \"john doe\" \"john\") = \"1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "sh", - "prompt": "#!/bin/bash\n# We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n# numbers in the array will be randomly ordered. Your task is to determine if\n# it is possible to get an array sorted in non-decreasing order by performing \n# the following operation on the given array:\n# You are allowed to perform right shift operation any number of times.\n# One right shift operation means shifting all elements of the array by one\n# position in the right direction. The last element of the array will be moved to\n# the starting position in the array i.e. 0th index. \n# If it is possible to obtain the sorted array by performing the above operation\n# then return True else return False.\n# If the given array is empty then return True.\n# Note: The given list is guaranteed to have unique elements.\n# For Example:\n# Explanation: By performin 2 right shift operations, non-decreasing order can\n# be achieved for the given array.\n# Explanation:It is not possible to get non-decreasing order for the given\n# array by performing any number of right shift operations.\n#\n# $1 is a space-separated list\nmove_one_ball() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n move_one_ball \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3 4 5 1 2\") = \"true\" ]]\n [[ $(candidate \"3 5 10 1 2\") = \"true\" ]]\n [[ $(candidate \"4 3 1 2\") = \"false\" ]]\n [[ $(candidate \"3 5 4 1 2\") = \"false\" ]]\n [[ $(candidate \"\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function which sorts the given list of integers\n# in ascending order according to the sum of their digits.\n# Note: if there are several items with similar sum of their digits,\n# order them based on their index in original list.\n# For example:\n#\n# $1 is a space-separated list\norder_by_points() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n order_by_points \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 11 -1 -11 -12\") = \"-1 -11 1 -12 11\" ]]\n [[ $(candidate \"1234 423 463 145 2 423 423 53 6 37 3457 3 56 0 46\") = \"0 2 3 6 53 423 423 423 1234 145 37 46 56 463 3457\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"1 -11 -32 43 54 -98 2 -3\") = \"-3 -32 -98 -11 1 2 43 54\" ]]\n [[ $(candidate \"1 2 3 4 5 6 7 8 9 10 11\") = \"1 10 2 11 3 4 5 6 7 8 9\" ]]\n [[ $(candidate \"0 6 6 -76 -21 23 4\") = \"-76 -21 0 4 23 6 6\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "sh", - "prompt": "#!/bin/bash\n# Return list of prime factors of given integer in the order from smallest to largest.\n# Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n# Input number should be equal to the product of all factors\n#\n# $1 is an integer\nfactorize() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n factorize \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2\") = \"2\" ]]\n [[ $(candidate \"4\") = \"2 2\" ]]\n [[ $(candidate \"8\") = \"2 2 2\" ]]\n [[ $(candidate \"57\") = \"3 19\" ]]\n [[ $(candidate \"3249\") = \"3 3 19 19\" ]]\n [[ $(candidate \"185193\") = \"3 3 3 19 19 19\" ]]\n [[ $(candidate \"20577\") = \"3 19 19 19\" ]]\n [[ $(candidate \"18\") = \"2 3 3\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "sh", - "prompt": "#!/bin/bash\n# Return True if all numbers in the list l are below threshold t.\n#\n# $1 is a space-separated list\n# $2 is an integer\nbelow_threshold() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n below_threshold \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 4 10\" \"100\") = \"true\" ]]\n [[ $(candidate \"1 20 4 10\" \"5\") = \"false\" ]]\n [[ $(candidate \"1 20 4 10\" \"21\") = \"true\" ]]\n [[ $(candidate \"1 20 4 10\" \"22\") = \"true\" ]]\n [[ $(candidate \"1 8 4 10\" \"11\") = \"true\" ]]\n [[ $(candidate \"1 8 4 10\" \"10\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given two positive integers n and m, and your task is to compute the\n# average of the integers from n through m (including n and m). \n# Round the answer to the nearest integer and convert that to binary.\n# If n is greater than m, return -1.\n# Example:\n#\n# $1 is an integer\n# $2 is an integer\nrounded_avg() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n rounded_avg \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1\" \"5\") = \"0b11\" ]]\n [[ $(candidate \"7\" \"13\") = \"0b1010\" ]]\n [[ $(candidate \"964\" \"977\") = \"0b1111001010\" ]]\n [[ $(candidate \"996\" \"997\") = \"0b1111100100\" ]]\n [[ $(candidate \"560\" \"851\") = \"0b1011000010\" ]]\n [[ $(candidate \"185\" \"546\") = \"0b101101110\" ]]\n [[ $(candidate \"362\" \"496\") = \"0b110101101\" ]]\n [[ $(candidate \"350\" \"902\") = \"0b1001110010\" ]]\n [[ $(candidate \"197\" \"233\") = \"0b11010111\" ]]\n [[ $(candidate \"7\" \"5\") = \"-1\" ]]\n [[ $(candidate \"5\" \"1\") = \"-1\" ]]\n [[ $(candidate \"5\" \"5\") = \"0b101\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "sh", - "prompt": "#!/bin/bash\n# Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n# For each of the group, output the deepest level of nesting of parentheses.\n# E.g. (()()) has maximum two levels of nesting while ((())) has three.\n#\n# $1 is a string\nparse_nested_parens() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n parse_nested_parens \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"(()()) ((())) () ((())()())\") = \"2 3 1 3\" ]]\n [[ $(candidate \"() (()) ((())) (((())))\") = \"1 2 3 4\" ]]\n [[ $(candidate \"(()(())((())))\") = \"4\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n# Examples\n#\n# $1 is a space-separated list\nsolution() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n solution \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5 8 7 1\") = \"12\" ]]\n [[ $(candidate \"3 3 3 3 3\") = \"9\" ]]\n [[ $(candidate \"30 13 24 321\") = \"0\" ]]\n [[ $(candidate \"5 9\") = \"5\" ]]\n [[ $(candidate \"2 4 8\") = \"0\" ]]\n [[ $(candidate \"30 13 23 32\") = \"23\" ]]\n [[ $(candidate \"3 13 2 9\") = \"3\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a positive integer n. You have to create an integer array a of length n.\n# For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n# Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n# and a[i] + a[j] + a[k] is a multiple of 3.\n# Example :\n# Explanation: \n# a = [1, 3, 7, 13, 21]\n# The only valid triple is (1, 7, 13).\n#\n# $1 is an integer\nget_max_triples() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n get_max_triples \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\") = \"1\" ]]\n [[ $(candidate \"6\") = \"4\" ]]\n [[ $(candidate \"10\") = \"36\" ]]\n [[ $(candidate \"100\") = \"53361\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "sh", - "prompt": "#!/bin/bash\n# There are eight planets in our solar system: the closerst to the Sun \n# is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n# Uranus, Neptune.\n# Write a function that takes two planet names as strings planet1 and planet2. \n# The function should return a tuple containing all planets whose orbits are \n# located between the orbit of planet1 and the orbit of planet2, sorted by \n# the proximity to the sun. \n# The function should return an empty tuple if planet1 or planet2\n# are not correct planet names. \n# Examples\n#\n# $1 is a string\n# $2 is a string\nbf() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n bf \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Jupiter\" \"Neptune\") = \"Saturn Uranus\" ]]\n [[ $(candidate \"Earth\" \"Mercury\") = \"Venus\" ]]\n [[ $(candidate \"Mercury\" \"Uranus\") = \"Venus Earth Mars Jupiter Saturn\" ]]\n [[ $(candidate \"Neptune\" \"Venus\") = \"Earth Mars Jupiter Saturn Uranus\" ]]\n [[ $(candidate \"Earth\" \"Earth\") = \"\" ]]\n [[ $(candidate \"Mars\" \"Earth\") = \"\" ]]\n [[ $(candidate \"Jupiter\" \"Makemake\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a list of integers.\n# Write a function next_smallest() that returns the 2nd smallest element of the list.\n# Return None if there is no such element.\n#\n# $1 is a space-separated list\nnext_smallest() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n next_smallest \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3 4 5\") = \"2\" ]]\n [[ $(candidate \"5 1 4 3 2\") = \"2\" ]]\n [[ $(candidate \"\") = \"None\" ]]\n [[ $(candidate \"1 1\") = \"None\" ]]\n [[ $(candidate \"1 1 1 1 0\") = \"1\" ]]\n [[ $(candidate \"1 1\") = \"None\" ]]\n [[ $(candidate \"-35 34 12 -45\") = \"-35\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "sh", - "prompt": "#!/bin/bash\n# Input is a space-delimited string of numberals from 'zero' to 'nine'.\n# Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n# Return the string with numbers sorted from smallest to largest\n#\n# $1 is a string\nsort_numbers() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n sort_numbers \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"three\") = \"three\" ]]\n [[ $(candidate \"three five nine\") = \"three five nine\" ]]\n [[ $(candidate \"five zero four seven nine eight\") = \"zero four five seven eight nine\" ]]\n [[ $(candidate \"six five four three two one zero\") = \"zero one two three four five six\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n#\n# $1 is a string\n# $2 is a string\ncycpattern_check() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n cycpattern_check \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"xyzw\" \"xyw\") = \"false\" ]]\n [[ $(candidate \"yello\" \"ell\") = \"true\" ]]\n [[ $(candidate \"whattup\" \"ptut\") = \"false\" ]]\n [[ $(candidate \"efef\" \"fee\") = \"true\" ]]\n [[ $(candidate \"abab\" \"aabb\") = \"false\" ]]\n [[ $(candidate \"winemtt\" \"tinem\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "sh", - "prompt": "#!/bin/bash\n# You will be given a number in decimal form and your task is to convert it to\n# binary format. The function should return a string, with each character representing a binary\n# number. Each character in the string will be '0' or '1'.\n# There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n# The extra characters are there to help with the format.\n# Examples:\n#\n# $1 is an integer\ndecimal_to_binary() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n decimal_to_binary \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"0\") = \"db0db\" ]]\n [[ $(candidate \"32\") = \"db100000db\" ]]\n [[ $(candidate \"103\") = \"db1100111db\" ]]\n [[ $(candidate \"15\") = \"db1111db\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "sh", - "prompt": "#!/bin/bash\n# Given an integer. return a tuple that has the number of even and odd digits respectively.\n# Example:\n#\n# $1 is an integer\neven_odd_count() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n even_odd_count \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"7\") = \"0 1\" ]]\n [[ $(candidate \"-78\") = \"1 1\" ]]\n [[ $(candidate \"3452\") = \"2 2\" ]]\n [[ $(candidate \"346211\") = \"3 3\" ]]\n [[ $(candidate \"-345821\") = \"3 3\" ]]\n [[ $(candidate \"-2\") = \"1 0\" ]]\n [[ $(candidate \"-45347\") = \"2 3\" ]]\n [[ $(candidate \"0\") = \"1 0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that accepts a list of strings.\n# The list contains different words. Return the word with maximum number\n# of unique characters. If multiple strings have maximum number of unique\n# characters, return the one which comes first in lexicographical order.\n#\n# $1 is a space-separated list\nfind_max() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n find_max \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"name of string\") = \"string\" ]]\n [[ $(candidate \"name enam game\") = \"enam\" ]]\n [[ $(candidate \"aaaaaaa bb cc\") = \"aaaaaaa\" ]]\n [[ $(candidate \"abc cba\") = \"abc\" ]]\n [[ $(candidate \"play this game of footbott\") = \"footbott\" ]]\n [[ $(candidate \"we are gonna rock\") = \"gonna\" ]]\n [[ $(candidate \"we are a mad nation\") = \"nation\" ]]\n [[ $(candidate \"this is a prrk\") = \"this\" ]]\n [[ $(candidate \"b\") = \"b\" ]]\n [[ $(candidate \"play play play\") = \"play\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function that returns a tuple (a, b), where 'a' is\n# the largest of negative integers, and 'b' is the smallest\n# of positive integers in a list.\n# If there is no negative or positive integers, return them as None.\n# Examples:\n#\n# $1 is a space-separated list\nlargest_smallest_integers() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n largest_smallest_integers \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2 4 1 3 5 7\") = \"None 1\" ]]\n [[ $(candidate \"2 4 1 3 5 7 0\") = \"None 1\" ]]\n [[ $(candidate \"1 3 2 4 5 6 -2\") = \"-2 1\" ]]\n [[ $(candidate \"4 5 3 6 2 7 -7\") = \"-7 2\" ]]\n [[ $(candidate \"7 3 8 4 9 2 5 -9\") = \"-9 2\" ]]\n [[ $(candidate \"\") = \"None None\" ]]\n [[ $(candidate \"0\") = \"None None\" ]]\n [[ $(candidate \"-1 -3 -5 -6\") = \"-1 None\" ]]\n [[ $(candidate \"-1 -3 -5 -6 0\") = \"-1 None\" ]]\n [[ $(candidate \"-6 -4 -4 -3 1\") = \"-3 1\" ]]\n [[ $(candidate \"-6 -4 -4 -3 -100 1\") = \"-3 1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "sh", - "prompt": "#!/bin/bash\n# \"Given an array representing a branch of a tree that has non-negative integer nodes\n# your task is to pluck one of the nodes and return it.\n# The plucked node should be the node with the smallest even value.\n# If multiple nodes with the same smallest even value are found return the node that has smallest index.\n# The plucked node should be returned in a list, [ smalest_value, its index ],\n# If there are no even values or the given array is empty, return [].\n# Example 1:\n# Explanation: 2 has the smallest even value, and 2 has the smallest index.\n# Example 2:\n# Explanation: 2 has the smallest even value, and 2 has the smallest index.\n# Example 3:\n# Example 4:\n# Explanation: 0 is the smallest value, but there are two zeros,\n# so we will choose the first zero, which has the smallest index.\n# Constraints:\n# * 1 <= nodes.length <= 10000\n# * 0 <= node.value\n#\n# $1 is a space-separated list\npluck() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n pluck \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"4 2 3\") = \"2 1\" ]]\n [[ $(candidate \"1 2 3\") = \"2 1\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"5 0 3 0 4 2\") = \"0 1\" ]]\n [[ $(candidate \"1 2 3 0 5 3\") = \"0 3\" ]]\n [[ $(candidate \"5 4 8 4 8\") = \"4 1\" ]]\n [[ $(candidate \"7 6 7 1\") = \"6 1\" ]]\n [[ $(candidate \"7 9 7 1\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function count_nums which takes an array of integers and returns\n# the number of elements which has a sum of digits > 0.\n# If a number is negative, then its first signed digit will be negative:\n# e.g. -123 has signed digits -1, 2, and 3.\n#\n# $1 is a space-separated list\ncount_nums() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n count_nums \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"0\" ]]\n [[ $(candidate \"-1 -2 0\") = \"0\" ]]\n [[ $(candidate \"1 1 2 -2 3 4 5\") = \"6\" ]]\n [[ $(candidate \"1 6 9 -6 0 1 5\") = \"5\" ]]\n [[ $(candidate \"1 100 98 -7 1 -1\") = \"4\" ]]\n [[ $(candidate \"12 23 34 -45 -56 0\") = \"5\" ]]\n [[ $(candidate \"0 1\") = \"1\" ]]\n [[ $(candidate \"1\") = \"1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n# each cell of the grid contains a value. Every integer in the range [1, N * N]\n# inclusive appears exactly once on the cells of the grid.\n# You have to find the minimum path of length k in the grid. You can start\n# from any cell, and in each step you can move to any of the neighbor cells,\n# in other words, you can go to cells which share an edge with you current\n# cell.\n# Please note that a path of length k means visiting exactly k cells (not\n# necessarily distinct).\n# You CANNOT go off the grid.\n# A path A (of length k) is considered less than a path B (of length k) if\n# after making the ordered lists of the values on the cells that A and B go\n# through (let's call them lst_A and lst_B), lst_A is lexicographically less\n# than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n# such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n# lst_A[j] = lst_B[j].\n# It is guaranteed that the answer is unique.\n# Return an ordered list of the values on the cells that the minimum path go through.\n# Examples:\n#\n# $1 is a newline-separated, space-separated list\n# $2 is an integer\nminPath() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n minPath \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3\\n4 5 6\\n7 8 9\" \"3\") = \"1 2 1\" ]]\n [[ $(candidate \"5 9 3\\n4 1 6\\n7 8 2\" \"1\") = \"1\" ]]\n [[ $(candidate \"1 2 3 4\\n5 6 7 8\\n9 10 11 12\\n13 14 15 16\" \"4\") = \"1 2 1 2\" ]]\n [[ $(candidate \"6 4 13 10\\n5 7 12 1\\n3 16 11 15\\n8 14 9 2\" \"7\") = \"1 10 1 10 1 10 1\" ]]\n [[ $(candidate \"8 14 9 2\\n6 4 13 15\\n5 7 1 12\\n3 10 11 16\" \"5\") = \"1 7 1 7 1\" ]]\n [[ $(candidate \"11 8 7 2\\n5 16 14 4\\n9 3 15 6\\n12 13 10 1\" \"9\") = \"1 6 1 6 1 6 1 6 1\" ]]\n [[ $(candidate \"12 13 10 1\\n9 3 15 6\\n5 16 14 4\\n11 8 7 2\" \"12\") = \"1 6 1 6 1 6 1 6 1 6 1 6\" ]]\n [[ $(candidate \"2 7 4\\n3 1 5\\n6 8 9\" \"8\") = \"1 3 1 3 1 3 1 3\" ]]\n [[ $(candidate \"6 1 5\\n3 8 9\\n2 7 4\" \"8\") = \"1 5 1 5 1 5 1 5\" ]]\n [[ $(candidate \"1 2\\n3 4\" \"10\") = \"1 2 1 2 1 2 1 2 1 2\" ]]\n [[ $(candidate \"1 3\\n3 2\" \"10\") = \"1 3 1 3 1 3 1 3 1 3\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "sh", - "prompt": "#!/bin/bash\n# Given list of integers, return list in strange order.\n# Strange sorting, is when you start with the minimum value,\n# then maximum of the remaining integers, then minimum and so on.\n# Examples:\n#\n# $1 is a space-separated list\nstrange_sort_list() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n strange_sort_list \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3 4\") = \"1 4 2 3\" ]]\n [[ $(candidate \"5 6 7 8 9\") = \"5 9 6 8 7\" ]]\n [[ $(candidate \"1 2 3 4 5\") = \"1 5 2 4 3\" ]]\n [[ $(candidate \"5 6 7 8 9 1\") = \"1 9 5 8 6 7\" ]]\n [[ $(candidate \"5 5 5 5\") = \"5 5 5 5\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"1 2 3 4 5 6 7 8\") = \"1 8 2 7 3 6 4 5\" ]]\n [[ $(candidate \"0 2 2 2 5 5 -5 -5\") = \"-5 5 -5 5 0 2 2 2\" ]]\n [[ $(candidate \"111111\") = \"111111\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a string 'text', return its md5 hash equivalent string.\n# If 'text' is an empty string, return None.\n#\n# $1 is a string\nstring_to_md5() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n string_to_md5 \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Hello world\") = \"3e25960a79dbc69b674cd4ec67a72c62\" ]]\n [[ $(candidate \"\") = \"None\" ]]\n [[ $(candidate \"A B C\") = \"0ef78513b0cb8cef12743f5aeb35f888\" ]]\n [[ $(candidate \"password\") = \"5f4dcc3b5aa765d61d8327deb882cf99\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a word. Your task is to find the closest vowel that stands between \n# two consonants from the right side of the word (case sensitive).\n# Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n# find any vowel met the above condition. \n# You may assume that the given string contains English letter only.\n# Example:\n#\n# $1 is a string\nget_closest_vowel() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n get_closest_vowel \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"yogurt\") = \"u\" ]]\n [[ $(candidate \"full\") = \"u\" ]]\n [[ $(candidate \"easy\") = \"\" ]]\n [[ $(candidate \"eAsy\") = \"\" ]]\n [[ $(candidate \"ali\") = \"\" ]]\n [[ $(candidate \"bad\") = \"a\" ]]\n [[ $(candidate \"most\") = \"o\" ]]\n [[ $(candidate \"ab\") = \"\" ]]\n [[ $(candidate \"ba\") = \"\" ]]\n [[ $(candidate \"quick\") = \"\" ]]\n [[ $(candidate \"anime\") = \"i\" ]]\n [[ $(candidate \"Asia\") = \"\" ]]\n [[ $(candidate \"Above\") = \"o\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "sh", - "prompt": "#!/bin/bash\n# Change numerical base of input number x to base.\n# return string representation after the conversion.\n# base numbers are less than 10.\n#\n# $1 is an integer\n# $2 is an integer\nchange_base() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n change_base \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"8\" \"3\") = \"22\" ]]\n [[ $(candidate \"9\" \"3\") = \"100\" ]]\n [[ $(candidate \"234\" \"2\") = \"11101010\" ]]\n [[ $(candidate \"16\" \"2\") = \"10000\" ]]\n [[ $(candidate \"8\" \"2\") = \"1000\" ]]\n [[ $(candidate \"7\" \"2\") = \"111\" ]]\n [[ $(candidate \"2\" \"3\") = \"2\" ]]\n [[ $(candidate \"3\" \"4\") = \"3\" ]]\n [[ $(candidate \"4\" \"5\") = \"4\" ]]\n [[ $(candidate \"5\" \"6\") = \"5\" ]]\n [[ $(candidate \"6\" \"7\") = \"6\" ]]\n [[ $(candidate \"7\" \"8\") = \"7\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "sh", - "prompt": "#!/bin/bash\n# Check if in given list of numbers, are any two numbers closer to each other than\n# given threshold.\n#\n# $1 is a space-separated list\n# $2 is a floating point\nhas_close_elements() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n has_close_elements \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1.0 2.0 3.9 4.0 5.0 2.2\" \"0.3\") = \"true\" ]]\n [[ $(candidate \"1.0 2.0 3.9 4.0 5.0 2.2\" \"0.05\") = \"false\" ]]\n [[ $(candidate \"1.0 2.0 5.9 4.0 5.0\" \"0.95\") = \"true\" ]]\n [[ $(candidate \"1.0 2.0 5.9 4.0 5.0\" \"0.8\") = \"false\" ]]\n [[ $(candidate \"1.0 2.0 3.0 4.0 5.0 2.0\" \"0.1\") = \"true\" ]]\n [[ $(candidate \"1.1 2.2 3.1 4.1 5.1\" \"1.0\") = \"true\" ]]\n [[ $(candidate \"1.1 2.2 3.1 4.1 5.1\" \"0.5\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function that takes a string as input which contains only square brackets.\n# The function should return True if and only if there is a valid subsequence of brackets \n# where at least one bracket in the subsequence is nested.\n#\n# $1 is a string\nis_nested() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n is_nested \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"[[]]\") = \"true\" ]]\n [[ $(candidate \"[]]]]]]][[[[[]\") = \"false\" ]]\n [[ $(candidate \"[][]\") = \"false\" ]]\n [[ $(candidate \"[]\") = \"false\" ]]\n [[ $(candidate \"[[[[]]]]\") = \"true\" ]]\n [[ $(candidate \"[]]]]]]]]]]\") = \"false\" ]]\n [[ $(candidate \"[][][[]]\") = \"true\" ]]\n [[ $(candidate \"[[]\") = \"false\" ]]\n [[ $(candidate \"[]]\") = \"false\" ]]\n [[ $(candidate \"[[]][[\") = \"true\" ]]\n [[ $(candidate \"[[][]]\") = \"true\" ]]\n [[ $(candidate \"\") = \"false\" ]]\n [[ $(candidate \"[[[[[[[[\") = \"false\" ]]\n [[ $(candidate \"]]]]]]]]\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "sh", - "prompt": "#!/bin/bash\n# Concatenate list of strings into a single string\n#\n# $1 is a space-separated list\nconcatenate() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n concatenate \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"x y z\") = \"xyz\" ]]\n [[ $(candidate \"x y z w k\") = \"xyzwk\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "sh", - "prompt": "#!/bin/bash\n# prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n#\n# $1 is an integer\nprime_fib() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n prime_fib \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1\") = \"2\" ]]\n [[ $(candidate \"2\") = \"3\" ]]\n [[ $(candidate \"3\") = \"5\" ]]\n [[ $(candidate \"4\") = \"13\" ]]\n [[ $(candidate \"5\") = \"89\" ]]\n [[ $(candidate \"6\") = \"233\" ]]\n [[ $(candidate \"7\") = \"1597\" ]]\n [[ $(candidate \"8\") = \"28657\" ]]\n [[ $(candidate \"9\") = \"514229\" ]]\n [[ $(candidate \"10\") = \"433494437\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "sh", - "prompt": "#!/bin/bash\n# From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n# other and return them in order (smaller number, larger number).\n#\n# $1 is a space-separated list\nfind_closest_elements() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n find_closest_elements \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1.0 2.0 3.9 4.0 5.0 2.2\") = \"3.9 4.0\" ]]\n [[ $(candidate \"1.0 2.0 5.9 4.0 5.0\") = \"5.0 5.9\" ]]\n [[ $(candidate \"1.0 2.0 3.0 4.0 5.0 2.2\") = \"2.0 2.2\" ]]\n [[ $(candidate \"1.0 2.0 3.0 4.0 5.0 2.0\") = \"2.0 2.0\" ]]\n [[ $(candidate \"1.1 2.2 3.1 4.1 5.1\") = \"2.2 3.1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "sh", - "prompt": "#!/bin/bash\n# You have been tasked to write a function that receives \n# a hexadecimal number as a string and counts the number of hexadecimal \n# digits that are primes (prime number, or a prime, is a natural number \n# greater than 1 that is not a product of two smaller natural numbers).\n# Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n# Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n# So you have to determine a number of the following digits: 2, 3, 5, 7, \n# B (=decimal 11), D (=decimal 13).\n# Note: you may assume the input is always correct or empty string, \n# and symbols A,B,C,D,E,F are always uppercase.\n# Examples:\n#\n# $1 is a string\nhex_key() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n hex_key \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"AB\") = \"1\" ]]\n [[ $(candidate \"1077E\") = \"2\" ]]\n [[ $(candidate \"ABED1A33\") = \"4\" ]]\n [[ $(candidate \"2020\") = \"2\" ]]\n [[ $(candidate \"123456789ABCDEF0\") = \"6\" ]]\n [[ $(candidate \"112233445566778899AABBCCDDEEFF00\") = \"12\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "sh", - "prompt": "#!/bin/bash\n# Complete the function that takes two integers and returns \n# the product of their unit digits.\n# Assume the input is always valid.\n# Examples:\n#\n# $1 is an integer\n# $2 is an integer\nmultiply() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n multiply \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"148\" \"412\") = \"16\" ]]\n [[ $(candidate \"19\" \"28\") = \"72\" ]]\n [[ $(candidate \"2020\" \"1851\") = \"0\" ]]\n [[ $(candidate \"14\" \"-15\") = \"20\" ]]\n [[ $(candidate \"76\" \"67\") = \"42\" ]]\n [[ $(candidate \"17\" \"27\") = \"49\" ]]\n [[ $(candidate \"0\" \"1\") = \"0\" ]]\n [[ $(candidate \"0\" \"0\") = \"0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "sh", - "prompt": "#!/bin/bash\n# Given list of numbers (of at least two elements), apply a linear transform to that list,\n# such that the smallest number will become 0 and the largest will become 1\n#\n# $1 is a space-separated list\nrescale_to_unit() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n rescale_to_unit \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2.0 49.9\") = \"0.0 1.0\" ]]\n [[ $(candidate \"100.0 49.9\") = \"1.0 0.0\" ]]\n [[ $(candidate \"1.0 2.0 3.0 4.0 5.0\") = \"0.0 0.25 0.5 0.75 1.0\" ]]\n [[ $(candidate \"2.0 1.0 5.0 3.0 4.0\") = \"0.25 0.0 1.0 0.5 0.75\" ]]\n [[ $(candidate \"12.0 11.0 15.0 13.0 14.0\") = \"0.25 0.0 1.0 0.5 0.75\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a positive integer n, return the product of the odd digits.\n# Return 0 if all digits are even.\n# For example:\n#\n# $1 is an integer\ndigits() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n digits \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\") = \"5\" ]]\n [[ $(candidate \"54\") = \"5\" ]]\n [[ $(candidate \"120\") = \"1\" ]]\n [[ $(candidate \"5014\") = \"5\" ]]\n [[ $(candidate \"98765\") = \"315\" ]]\n [[ $(candidate \"5576543\") = \"2625\" ]]\n [[ $(candidate \"2468\") = \"0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "sh", - "prompt": "#!/bin/bash\n# You will be given the name of a class (a string) and a list of extensions.\n# The extensions are to be used to load additional classes to the class. The\n# strength of the extension is as follows: Let CAP be the number of the uppercase\n# letters in the extension's name, and let SM be the number of lowercase letters \n# in the extension's name, the strength is given by the fraction CAP - SM. \n# You should find the strongest extension and return a string in this \n# format: ClassName.StrongestExtensionName.\n# If there are two or more extensions with the same strength, you should\n# choose the one that comes first in the list.\n# For example, if you are given \"Slices\" as the class and a list of the\n# extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n# return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n# (its strength is -1).\n# Example:\n#\n# $1 is a string\n# $2 is a space-separated list\nStrongest_Extension() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n Strongest_Extension \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Watashi\" \"tEN niNE eIGHt8OKe\") = \"Watashi.eIGHt8OKe\" ]]\n [[ $(candidate \"Boku123\" \"nani NazeDa YEs.WeCaNe 32145tggg\") = \"Boku123.YEs.WeCaNe\" ]]\n [[ $(candidate \"__YESIMHERE\" \"t eMptY nothing zeR00 NuLl__ 123NoooneB321\") = \"__YESIMHERE.NuLl__\" ]]\n [[ $(candidate \"K\" \"Ta TAR t234An cosSo\") = \"K.TAR\" ]]\n [[ $(candidate \"__HAHA\" \"Tab 123 781345 -_-\") = \"__HAHA.123\" ]]\n [[ $(candidate \"YameRore\" \"HhAas okIWILL123 WorkOut Fails -_-\") = \"YameRore.okIWILL123\" ]]\n [[ $(candidate \"finNNalLLly\" \"Die NowW Wow WoW\") = \"finNNalLLly.WoW\" ]]\n [[ $(candidate \"_\" \"Bb 91245\") = \"_.Bb\" ]]\n [[ $(candidate \"Sp\" \"671235 Bb\") = \"Sp.671235\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a string representing a space separated lowercase letters, return a dictionary\n# of the letter with the most repetition and containing the corresponding count.\n# If several letters have the same occurrence, return all of them.\n# Example:\n#\n# $1 is a string\nhistogram() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n histogram \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"a b b a\") = \"a,2\\nb,2\" ]]\n [[ $(candidate \"a b c a b\") = \"a,2\\nb,2\" ]]\n [[ $(candidate \"a b c d g\") = \"a,1\\nb,1\\nc,1\\nd,1\\ng,1\" ]]\n [[ $(candidate \"r t g\") = \"r,1\\nt,1\\ng,1\" ]]\n [[ $(candidate \"b b b b a\") = \"b,4\" ]]\n [[ $(candidate \"r t g\") = \"r,1\\nt,1\\ng,1\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"a\") = \"a,1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "sh", - "prompt": "#!/bin/bash\n# pairs_sum_to_zero takes a list of integers as an input.\n# it returns True if there are two distinct elements in the list that\n# sum to zero, and False otherwise.\n#\n# $1 is a space-separated list\npairs_sum_to_zero() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n pairs_sum_to_zero \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 3 5 0\") = \"false\" ]]\n [[ $(candidate \"1 3 -2 1\") = \"false\" ]]\n [[ $(candidate \"1 2 3 7\") = \"false\" ]]\n [[ $(candidate \"2 4 -5 3 5 7\") = \"true\" ]]\n [[ $(candidate \"1\") = \"false\" ]]\n [[ $(candidate \"-3 9 -1 3 2 30\") = \"true\" ]]\n [[ $(candidate \"-3 9 -1 3 2 31\") = \"true\" ]]\n [[ $(candidate \"-3 9 -1 4 2 30\") = \"false\" ]]\n [[ $(candidate \"-3 9 -1 4 2 31\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that accepts two lists of strings and returns the list that has \n# total number of chars in the all strings of the list less than the other list.\n# if the two lists have the same number of chars, return the first list.\n# Examples\n#\n# $1 is a space-separated list\n# $2 is a space-separated list\ntotal_match() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n total_match \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\" \"\") = \"\" ]]\n [[ $(candidate \"hi admin\" \"hi hi\") = \"hi hi\" ]]\n [[ $(candidate \"hi admin\" \"hi hi admin project\") = \"hi admin\" ]]\n [[ $(candidate \"4\" \"1 2 3 4 5\") = \"4\" ]]\n [[ $(candidate \"hi admin\" \"hI Hi\") = \"hI Hi\" ]]\n [[ $(candidate \"hi admin\" \"hI hi hi\") = \"hI hi hi\" ]]\n [[ $(candidate \"hi admin\" \"hI hi hii\") = \"hi admin\" ]]\n [[ $(candidate \"\" \"this\") = \"\" ]]\n [[ $(candidate \"this\" \"\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "sh", - "prompt": "#!/bin/bash\n# Circular shift the digits of the integer x, shift the digits right by shift\n# and return the result as a string.\n# If shift > number of digits, return digits reversed.\n#\n# $1 is an integer\n# $2 is an integer\ncircular_shift() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n circular_shift \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"100\" \"2\") = \"001\" ]]\n [[ $(candidate \"12\" \"2\") = \"12\" ]]\n [[ $(candidate \"97\" \"8\") = \"79\" ]]\n [[ $(candidate \"12\" \"1\") = \"21\" ]]\n [[ $(candidate \"11\" \"101\") = \"11\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "sh", - "prompt": "#!/bin/bash\n# Return True is list elements are monotonically increasing or decreasing.\n#\n# $1 is a space-separated list\nmonotonic() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n monotonic \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 4 10\") = \"true\" ]]\n [[ $(candidate \"1 2 4 20\") = \"true\" ]]\n [[ $(candidate \"1 20 4 10\") = \"false\" ]]\n [[ $(candidate \"4 1 0 -10\") = \"true\" ]]\n [[ $(candidate \"4 1 1 0\") = \"true\" ]]\n [[ $(candidate \"1 2 3 2 5 60\") = \"false\" ]]\n [[ $(candidate \"1 2 3 4 5 60\") = \"true\" ]]\n [[ $(candidate \"9 9 9 9\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "sh", - "prompt": "#!/bin/bash\n# Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n# Example\n#\n# $1 is an integer\nis_equal_to_sum_even() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n is_equal_to_sum_even \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"4\") = \"false\" ]]\n [[ $(candidate \"6\") = \"false\" ]]\n [[ $(candidate \"8\") = \"true\" ]]\n [[ $(candidate \"10\") = \"true\" ]]\n [[ $(candidate \"11\") = \"false\" ]]\n [[ $(candidate \"12\") = \"true\" ]]\n [[ $(candidate \"13\") = \"false\" ]]\n [[ $(candidate \"16\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "sh", - "prompt": "#!/bin/bash\n# Input to this function is a string representing musical notes in a special ASCII format.\n# Your task is to parse this string and return list of integers corresponding to how many beats does each\n# not last.\n# Here is a legend:\n# 'o' - whole note, lasts four beats\n# 'o|' - half note, lasts two beats\n# '.|' - quater note, lasts one beat\n#\n# $1 is a string\nparse_music() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n parse_music \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"o o o o\") = \"4 4 4 4\" ]]\n [[ $(candidate \".| .| .| .|\") = \"1 1 1 1\" ]]\n [[ $(candidate \"o| o| .| .| o o o o\") = \"2 2 1 1 4 4 4 4\" ]]\n [[ $(candidate \"o| .| o| .| o o| o o|\") = \"2 1 2 1 4 2 4 2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "sh", - "prompt": "#!/bin/bash\n# \"\n# This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n# multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n# change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n# Examples:\n#\n# $1 is a space-separated list\nsum_squares() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n sum_squares \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3\") = \"6\" ]]\n [[ $(candidate \"1 4 9\") = \"14\" ]]\n [[ $(candidate \"\") = \"0\" ]]\n [[ $(candidate \"1 1 1 1 1 1 1 1 1\") = \"9\" ]]\n [[ $(candidate \"-1 -1 -1 -1 -1 -1 -1 -1 -1\") = \"-3\" ]]\n [[ $(candidate \"0\") = \"0\" ]]\n [[ $(candidate \"-1 -5 2 -1 -5\") = \"-126\" ]]\n [[ $(candidate \"-56 -99 1 0 -2\") = \"3030\" ]]\n [[ $(candidate \"-1 0 0 0 0 0 0 0 -1\") = \"0\" ]]\n [[ $(candidate \"-16 -9 -2 36 36 26 -20 25 -40 20 -4 12 -26 35 37\") = \"-14196\" ]]\n [[ $(candidate \"-1 -3 17 -1 -15 13 -1 14 -14 -12 -5 14 -14 6 13 11 16 16 4 10\") = \"-1448\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "sh", - "prompt": "#!/bin/bash\n# triples_sum_to_zero takes a list of integers as an input.\n# it returns True if there are three distinct elements in the list that\n# sum to zero, and False otherwise.\n#\n# $1 is a space-separated list\ntriples_sum_to_zero() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n triples_sum_to_zero \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 3 5 0\") = \"false\" ]]\n [[ $(candidate \"1 3 5 -1\") = \"false\" ]]\n [[ $(candidate \"1 3 -2 1\") = \"true\" ]]\n [[ $(candidate \"1 2 3 7\") = \"false\" ]]\n [[ $(candidate \"1 2 5 7\") = \"false\" ]]\n [[ $(candidate \"2 4 -5 3 9 7\") = \"true\" ]]\n [[ $(candidate \"1\") = \"false\" ]]\n [[ $(candidate \"1 3 5 -100\") = \"false\" ]]\n [[ $(candidate \"100 3 5 -100\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "sh", - "prompt": "#!/bin/bash\n# brackets is a string of \"<\" and \">\".\n# return True if every opening bracket has a corresponding closing bracket.\n#\n# $1 is a string\ncorrect_bracketing() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n correct_bracketing \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"<>\") = \"true\" ]]\n [[ $(candidate \"<<><>>\") = \"true\" ]]\n [[ $(candidate \"<><><<><>><>\") = \"true\" ]]\n [[ $(candidate \"<><><<<><><>><>><<><><<>>>\") = \"true\" ]]\n [[ $(candidate \"<<<><>>>>\") = \"false\" ]]\n [[ $(candidate \"><<>\") = \"false\" ]]\n [[ $(candidate \"<\") = \"false\" ]]\n [[ $(candidate \"<<<<\") = \"false\" ]]\n [[ $(candidate \">\") = \"false\" ]]\n [[ $(candidate \"<<>\") = \"false\" ]]\n [[ $(candidate \"<><><<><>><>><<>\") = \"false\" ]]\n [[ $(candidate \"<><><<><>><>>><>\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that takes an array of numbers as input and returns \n# the number of elements in the array that are greater than 10 and both \n# first and last digits of a number are odd (1, 3, 5, 7, 9).\n# For example:\n#\n# $1 is a space-separated list\nspecialFilter() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n specialFilter \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5 -2 1 -5\") = \"0\" ]]\n [[ $(candidate \"15 -73 14 -15\") = \"1\" ]]\n [[ $(candidate \"33 -2 -3 45 21 109\") = \"2\" ]]\n [[ $(candidate \"43 -12 93 125 121 109\") = \"4\" ]]\n [[ $(candidate \"71 -2 -33 75 21 19\") = \"3\" ]]\n [[ $(candidate \"1\") = \"0\" ]]\n [[ $(candidate \"\") = \"0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a dictionary, return True if all keys are strings in lower \n# case or all keys are strings in upper case, else return False.\n# The function should return False is the given dictionary is empty.\n# Examples:\n#\n# $1 is a two column CSV in key,value order\ncheck_dict_case() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n check_dict_case \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"p,pineapple\\nb,banana\") = \"true\" ]]\n [[ $(candidate \"p,pineapple\\nA,banana\\nB,banana\") = \"false\" ]]\n [[ $(candidate \"p,pineapple\\n5,banana\\na,apple\") = \"false\" ]]\n [[ $(candidate \"Name,John\\nAge,36\\nCity,Houston\") = \"false\" ]]\n [[ $(candidate \"STATE,NC\\nZIP,12345\") = \"true\" ]]\n [[ $(candidate \"fruit,Orange\\ntaste,Sweet\") = \"true\" ]]\n [[ $(candidate \"\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n# should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n# alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n# Examples\n#\n# $1 is a string\nsplit_words() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n split_words \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Hello world\\!\") = \"Hello world\\!\" ]]\n [[ $(candidate \"Hello,world\\!\") = \"Hello world\\!\" ]]\n [[ $(candidate \"Hello world,\\!\") = \"Hello world,\\!\" ]]\n [[ $(candidate \"Hello,Hello,world \\!\") = \"Hello,Hello,world \\!\" ]]\n [[ $(candidate \"abcdef\") = \"3\" ]]\n [[ $(candidate \"aaabb\") = \"2\" ]]\n [[ $(candidate \"aaaBb\") = \"1\" ]]\n [[ $(candidate \"\") = \"0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "sh", - "prompt": "#!/bin/bash\n# The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fibfib(0) == 0\n# fibfib(1) == 0\n# fibfib(2) == 1\n# fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n# Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n#\n# $1 is an integer\nfibfib() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n fibfib \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2\") = \"1\" ]]\n [[ $(candidate \"1\") = \"0\" ]]\n [[ $(candidate \"5\") = \"4\" ]]\n [[ $(candidate \"8\") = \"24\" ]]\n [[ $(candidate \"10\") = \"81\" ]]\n [[ $(candidate \"12\") = \"274\" ]]\n [[ $(candidate \"14\") = \"927\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a list of numbers.\n# You need to return the sum of squared numbers in the given list,\n# round each element in the list to the upper int(Ceiling) first.\n# Examples:\n#\n# $1 is a space-separated list\nsum_squares() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n sum_squares \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1.0 2.0 3.0\") = \"14\" ]]\n [[ $(candidate \"1.0 2.0 3.0\") = \"14\" ]]\n [[ $(candidate \"1.0 3.0 5.0 7.0\") = \"84\" ]]\n [[ $(candidate \"1.4 4.2 0.0\") = \"29\" ]]\n [[ $(candidate \"-2.4 1.0 1.0\") = \"6\" ]]\n [[ $(candidate \"100.0 1.0 15.0 2.0\") = \"10230\" ]]\n [[ $(candidate \"10000.0 10000.0\") = \"200000000\" ]]\n [[ $(candidate \"-1.4 4.6 6.3\") = \"75\" ]]\n [[ $(candidate \"-1.4 17.9 18.9 19.9\") = \"1086\" ]]\n [[ $(candidate \"0.0\") = \"0\" ]]\n [[ $(candidate \"-1.0\") = \"1\" ]]\n [[ $(candidate \"-1.0 1.0 0.0\") = \"2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_85_add", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a non-empty list of integers lst. add the even elements that are at odd indices..\n# Examples:\n#\n# $1 is a space-separated list\nadd() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n add \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"4 88\") = \"88\" ]]\n [[ $(candidate \"4 5 6 7 2 122\") = \"122\" ]]\n [[ $(candidate \"4 0 6 7\") = \"0\" ]]\n [[ $(candidate \"4 4 6 8\") = \"12\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "sh", - "prompt": "#!/bin/bash\n# Return sorted unique elements in a list\n#\n# $1 is a space-separated list\nunique() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n unique \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5 3 5 2 3 3 9 0 123\") = \"0 2 3 5 9 123\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a string text, replace all spaces in it with underscores, \n# and if a string has more than 2 consecutive spaces, \n# then replace all consecutive spaces with -\n#\n# $1 is a string\nfix_spaces() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n fix_spaces \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Example\") = \"Example\" ]]\n [[ $(candidate \"Mudasir Hanif \") = \"Mudasir_Hanif_\" ]]\n [[ $(candidate \"Yellow Yellow Dirty Fellow\") = \"Yellow_Yellow__Dirty__Fellow\" ]]\n [[ $(candidate \"Exa mple\") = \"Exa-mple\" ]]\n [[ $(candidate \" Exa 1 2 2 mple\") = \"-Exa_1_2_2_mple\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "sh", - "prompt": "#!/bin/bash\n# Return 2^n modulo p (be aware of numerics).\n#\n# $1 is an integer\n# $2 is an integer\nmodp() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n modp \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3\" \"5\") = \"3\" ]]\n [[ $(candidate \"1101\" \"101\") = \"2\" ]]\n [[ $(candidate \"0\" \"101\") = \"1\" ]]\n [[ $(candidate \"3\" \"11\") = \"8\" ]]\n [[ $(candidate \"100\" \"101\") = \"1\" ]]\n [[ $(candidate \"30\" \"5\") = \"4\" ]]\n [[ $(candidate \"31\" \"5\") = \"3\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "sh", - "prompt": "#!/bin/bash\n# You have to write a function which validates a given date string and\n# returns True if the date is valid otherwise False.\n# The date is valid if all of the following rules are satisfied:\n# 1. The date string is not empty.\n# 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n# 3. The months should not be less than 1 or higher than 12.\n# 4. The date should be in the format: mm-dd-yyyy\n#\n# $1 is a string\nvalid_date() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n valid_date \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"03-11-2000\") = \"true\" ]]\n [[ $(candidate \"15-01-2012\") = \"false\" ]]\n [[ $(candidate \"04-0-2040\") = \"false\" ]]\n [[ $(candidate \"06-04-2020\") = \"true\" ]]\n [[ $(candidate \"01-01-2007\") = \"true\" ]]\n [[ $(candidate \"03-32-2011\") = \"false\" ]]\n [[ $(candidate \"\") = \"false\" ]]\n [[ $(candidate \"04-31-3000\") = \"false\" ]]\n [[ $(candidate \"06-06-2005\") = \"true\" ]]\n [[ $(candidate \"21-31-2000\") = \"false\" ]]\n [[ $(candidate \"04-12-2003\") = \"true\" ]]\n [[ $(candidate \"04122003\") = \"false\" ]]\n [[ $(candidate \"20030412\") = \"false\" ]]\n [[ $(candidate \"2003-04\") = \"false\" ]]\n [[ $(candidate \"2003-04-12\") = \"false\" ]]\n [[ $(candidate \"04-2003\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that takes a string and returns an ordered version of it.\n# Ordered version of string, is a string where all words (separated by space)\n# are replaced by a new word where all the characters arranged in\n# ascending order based on ascii value.\n# Note: You should keep the order of words and blank spaces in the sentence.\n# For example:\n#\n# $1 is a string\nanti_shuffle() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n anti_shuffle \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Hi\") = \"Hi\" ]]\n [[ $(candidate \"hello\") = \"ehllo\" ]]\n [[ $(candidate \"number\") = \"bemnru\" ]]\n [[ $(candidate \"abcd\") = \"abcd\" ]]\n [[ $(candidate \"Hello World\\!\\!\\!\") = \"Hello \\!\\!\\!Wdlor\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"Hi. My name is Mister Robot. How are you?\") = \".Hi My aemn is Meirst .Rboot How aer ?ouy\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a list of numbers, return whether or not they are sorted\n# in ascending order. If list has more than 1 duplicate of the same\n# number, return False. Assume no negative numbers and only integers.\n# Examples\n#\n# $1 is a space-separated list\nis_sorted() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n is_sorted \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\") = \"true\" ]]\n [[ $(candidate \"1 2 3 4 5\") = \"true\" ]]\n [[ $(candidate \"1 3 2 4 5\") = \"false\" ]]\n [[ $(candidate \"1 2 3 4 5 6\") = \"true\" ]]\n [[ $(candidate \"1 2 3 4 5 6 7\") = \"true\" ]]\n [[ $(candidate \"1 3 2 4 5 6 7\") = \"false\" ]]\n [[ $(candidate \"\") = \"true\" ]]\n [[ $(candidate \"1\") = \"true\" ]]\n [[ $(candidate \"3 2 1\") = \"false\" ]]\n [[ $(candidate \"1 2 2 2 3 4\") = \"false\" ]]\n [[ $(candidate \"1 2 3 3 3 4\") = \"false\" ]]\n [[ $(candidate \"1 2 2 3 3 4\") = \"true\" ]]\n [[ $(candidate \"1 2 3 4\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a string s.\n# Your task is to check if the string is happy or not.\n# A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n# For example:\n#\n# $1 is a string\nis_happy() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n is_happy \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"a\") = \"false\" ]]\n [[ $(candidate \"aa\") = \"false\" ]]\n [[ $(candidate \"abcd\") = \"true\" ]]\n [[ $(candidate \"aabb\") = \"false\" ]]\n [[ $(candidate \"adb\") = \"true\" ]]\n [[ $(candidate \"xyy\") = \"false\" ]]\n [[ $(candidate \"iopaxpoi\") = \"true\" ]]\n [[ $(candidate \"iopaxioi\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that returns True if the object q will fly, and False otherwise.\n# The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n# Example:\n# # 1+2 is less than the maximum possible weight, but it's unbalanced.\n# # it's balanced, but 3+2+3 is more than the maximum possible weight.\n# # 3+2+3 is less than the maximum possible weight, and it's balanced.\n# # 3 is less than the maximum possible weight, and it's balanced.\n#\n# $1 is a space-separated list\n# $2 is an integer\nwill_it_fly() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n will_it_fly \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3 2 3\" \"9\") = \"true\" ]]\n [[ $(candidate \"1 2\" \"5\") = \"false\" ]]\n [[ $(candidate \"3\" \"5\") = \"true\" ]]\n [[ $(candidate \"3 2 3\" \"1\") = \"false\" ]]\n [[ $(candidate \"1 2 3\" \"6\") = \"false\" ]]\n [[ $(candidate \"5\" \"5\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "sh", - "prompt": "#!/bin/bash\n# Given an array of non-negative integers, return a copy of the given array after sorting,\n# you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n# or sort it in descending order if the sum( first index value, last index value) is even.\n# Note:\n# * don't change the given array.\n# Examples:\n#\n# $1 is a space-separated list\nsort_array() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n sort_array \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"5\") = \"5\" ]]\n [[ $(candidate \"2 4 3 0 1 5\") = \"0 1 2 3 4 5\" ]]\n [[ $(candidate \"2 4 3 0 1 5 6\") = \"6 5 4 3 2 1 0\" ]]\n [[ $(candidate \"2 1\") = \"1 2\" ]]\n [[ $(candidate \"15 42 87 32 11 0\") = \"0 11 15 32 42 87\" ]]\n [[ $(candidate \"21 14 23 11\") = \"23 21 14 11\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "sh", - "prompt": "#!/bin/bash\n# Implement a function that takes an non-negative integer and returns an array of the first n\n# integers that are prime numbers and less than n.\n# for example:\n#\n# $1 is an integer\ncount_up_to() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n count_up_to \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\") = \"2 3\" ]]\n [[ $(candidate \"6\") = \"2 3 5\" ]]\n [[ $(candidate \"7\") = \"2 3 5\" ]]\n [[ $(candidate \"10\") = \"2 3 5 7\" ]]\n [[ $(candidate \"0\") = \"\" ]]\n [[ $(candidate \"22\") = \"2 3 5 7 11 13 17 19\" ]]\n [[ $(candidate \"1\") = \"\" ]]\n [[ $(candidate \"18\") = \"2 3 5 7 11 13 17\" ]]\n [[ $(candidate \"47\") = \"2 3 5 7 11 13 17 19 23 29 31 37 41 43\" ]]\n [[ $(candidate \"101\") = \"2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "sh", - "prompt": "#!/bin/bash\n# Out of list of strings, return the longest one. Return the first one in case of multiple\n# strings of the same length. Return None in case the input list is empty.\n#\n# $1 is a space-separated list\nlongest() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n longest \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"None\" ]]\n [[ $(candidate \"x y z\") = \"x\" ]]\n [[ $(candidate \"x yyy zzzz www kkkk abc\") = \"zzzz\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "sh", - "prompt": "#!/bin/bash\n# Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n# reverse the resulting array, and then replace each digit by its corresponding name from\n# \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n# For example:\n# If the array is empty, return an empty array:\n# If the array has any strange number ignore it:\n#\n# $1 is a space-separated list\nby_length() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n by_length \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2 1 1 4 5 8 2 3\") = \"Eight Five Four Three Two Two One One\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"1 -1 55\") = \"One\" ]]\n [[ $(candidate \"1 -1 3 2\") = \"Three Two One\" ]]\n [[ $(candidate \"9 4 8\") = \"Nine Eight Four\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_106_f", - "language": "sh", - "prompt": "#!/bin/bash\n# Implement the function f that takes n as a parameter,\n# 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\n# or the sum of numbers from 1 to i otherwise.\n# i starts from 1.\n# the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n# Example:\n#\n# $1 is an integer\nf() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n f \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\") = \"1 2 6 24 15\" ]]\n [[ $(candidate \"7\") = \"1 2 6 24 15 720 28\" ]]\n [[ $(candidate \"1\") = \"1\" ]]\n [[ $(candidate \"3\") = \"1 2 6\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "sh", - "prompt": "#!/bin/bash\n# Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n#\n# $1 is an integer\nfizz_buzz() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n fizz_buzz \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"50\") = \"0\" ]]\n [[ $(candidate \"78\") = \"2\" ]]\n [[ $(candidate \"79\") = \"3\" ]]\n [[ $(candidate \"100\") = \"3\" ]]\n [[ $(candidate \"200\") = \"6\" ]]\n [[ $(candidate \"4000\") = \"192\" ]]\n [[ $(candidate \"10000\") = \"639\" ]]\n [[ $(candidate \"100000\") = \"8026\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a positive floating point number, it can be decomposed into\n# and integer part (largest integer smaller than given number) and decimals\n# (leftover part always smaller than 1).\n# Return the decimal part of the number.\n#\n# $1 is a floating point\ntruncate_number() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n truncate_number \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3.5\") = \"0.5\" ]]\n [[ $(candidate \"1.25\") = \"0.25\" ]]\n [[ $(candidate \"123.0\") = \"0.0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "sh", - "prompt": "#!/bin/bash\n# For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n# Empty sum should be equal to 0 and empty product should be equal to 1.\n#\n# $1 is a space-separated list\nsum_product() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n sum_product \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"0 1\" ]]\n [[ $(candidate \"1 1 1\") = \"3 1\" ]]\n [[ $(candidate \"100 0\") = \"100 0\" ]]\n [[ $(candidate \"3 5 7\") = \"15 105\" ]]\n [[ $(candidate \"10\") = \"10 10\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a 2 dimensional data, as a nested lists,\n# which is similar to matrix, however, unlike matrices,\n# each row may contain a different number of columns.\n# Given lst, and integer x, find integers x in the list,\n# and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n# each tuple is a coordinate - (row, columns), starting with 0.\n# Sort coordinates initially by rows in ascending order.\n# Also, sort coordinates of the row by columns in descending order.\n# Examples:\n#\n# $1 is a newline-separated, space-separated list\n# $2 is an integer\nget_row() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n get_row \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3 4 5 6\\n1 2 3 4 1 6\\n1 2 3 4 5 1\" \"1\") = \"0 0\\n1 4\\n1 0\\n2 5\\n2 0\" ]]\n [[ $(candidate \"1 2 3 4 5 6\\n1 2 3 4 5 6\\n1 2 3 4 5 6\\n1 2 3 4 5 6\\n1 2 3 4 5 6\\n1 2 3 4 5 6\" \"2\") = \"0 1\\n1 1\\n2 1\\n3 1\\n4 1\\n5 1\" ]]\n [[ $(candidate \"1 2 3 4 5 6\\n1 2 3 4 5 6\\n1 1 3 4 5 6\\n1 2 1 4 5 6\\n1 2 3 1 5 6\\n1 2 3 4 1 6\\n1 2 3 4 5 1\" \"1\") = \"0 0\\n1 0\\n2 1\\n2 0\\n3 2\\n3 0\\n4 3\\n4 0\\n5 4\\n5 0\\n6 5\\n6 0\" ]]\n [[ $(candidate \"\" \"1\") = \"\" ]]\n [[ $(candidate \"1\" \"2\") = \"\" ]]\n [[ $(candidate \"\\n1\\n1 2 3\" \"3\") = \"2 2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "sh", - "prompt": "#!/bin/bash\n# You're a hungry rabbit, and you already have eaten a certain number of carrots,\n# but now you need to eat more carrots to complete the day's meals.\n# you should return an array of [ total number of eaten carrots after your meals,\n# the number of carrots left after your meals ]\n# if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n# Example:\n# Variables:\n# @number : integer\n# the number of carrots that you have eaten.\n# @need : integer\n# the number of carrots that you need to eat.\n# @remaining : integer\n# the number of remaining carrots thet exist in stock\n# Constrain:\n# * 0 <= number <= 1000\n# * 0 <= need <= 1000\n# * 0 <= remaining <= 1000\n# Have fun :)\n#\n# $1 is an integer\n# $2 is an integer\n# $3 is an integer\neat() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n eat \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\" \"6\" \"10\") = \"11 4\" ]]\n [[ $(candidate \"4\" \"8\" \"9\") = \"12 1\" ]]\n [[ $(candidate \"1\" \"10\" \"10\") = \"11 0\" ]]\n [[ $(candidate \"2\" \"11\" \"5\") = \"7 0\" ]]\n [[ $(candidate \"4\" \"5\" \"7\") = \"9 2\" ]]\n [[ $(candidate \"4\" \"5\" \"1\") = \"5 0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a positive integer N, return the total sum of its digits in binary.\n# Example\n# Variables:\n# @N integer\n# Constraints: 0 \u2264 N \u2264 10000.\n# Output:\n# a string of binary number\n#\n# $1 is an integer\nsolve() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n solve \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1000\") = \"1\" ]]\n [[ $(candidate \"150\") = \"110\" ]]\n [[ $(candidate \"147\") = \"1100\" ]]\n [[ $(candidate \"333\") = \"1001\" ]]\n [[ $(candidate \"963\") = \"10010\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a list of integers.\n# You need to find the largest prime value and return the sum of its digits.\n# Examples:\n#\n# $1 is a space-separated list\nskjkasdkd() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n skjkasdkd \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"0 3 2 1 3 5 7 4 5 5 5 2 181 32 4 32 3 2 32 324 4 3\") = \"10\" ]]\n [[ $(candidate \"1 0 1 8 2 4597 2 1 3 40 1 2 1 2 4 2 5 1\") = \"25\" ]]\n [[ $(candidate \"1 3 1 32 5107 34 83278 109 163 23 2323 32 30 1 9 3\") = \"13\" ]]\n [[ $(candidate \"0 724 32 71 99 32 6 0 5 91 83 0 5 6\") = \"11\" ]]\n [[ $(candidate \"0 81 12 3 1 21\") = \"3\" ]]\n [[ $(candidate \"0 8 1 2 1 7\") = \"7\" ]]\n [[ $(candidate \"8191\") = \"19\" ]]\n [[ $(candidate \"8191 123456 127 7\") = \"19\" ]]\n [[ $(candidate \"127 97 8192\") = \"10\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "sh", - "prompt": "#!/bin/bash\n# Given an array arr of integers, find the minimum number of elements that\n# need to be changed to make the array palindromic. A palindromic array is an array that\n# is read the same backwards and forwards. In one change, you can change one element to any other element.\n# For example:\n#\n# $1 is a space-separated list\nsmallest_change() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n smallest_change \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3 5 4 7 9 6\") = \"4\" ]]\n [[ $(candidate \"1 2 3 4 3 2 2\") = \"1\" ]]\n [[ $(candidate \"1 4 2\") = \"1\" ]]\n [[ $(candidate \"1 4 4 2\") = \"1\" ]]\n [[ $(candidate \"1 2 3 2 1\") = \"0\" ]]\n [[ $(candidate \"3 1 1 3\") = \"0\" ]]\n [[ $(candidate \"1\") = \"0\" ]]\n [[ $(candidate \"0 1\") = \"1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "sh", - "prompt": "#!/bin/bash\n# It is the last week of the semester and the teacher has to give the grades\n# to students. The teacher has been making her own algorithm for grading.\n# The only problem is, she has lost the code she used for grading.\n# She has given you a list of GPAs for some students and you have to write \n# a function that can output a list of letter grades using the following table:\n# GPA | Letter grade\n# 4.0 A+\n# > 3.7 A \n# > 3.3 A- \n# > 3.0 B+\n# > 2.7 B \n# > 2.3 B-\n# > 2.0 C+\n# > 1.7 C\n# > 1.3 C-\n# > 1.0 D+ \n# > 0.7 D \n# > 0.0 D-\n# 0.0 E\n# Example:\n#\n# $1 is a space-separated list\nnumerical_letter_grade() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n numerical_letter_grade \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"4.0 3 1.7 2 3.5\") = \"A+ B C- C A-\" ]]\n [[ $(candidate \"1.2\") = \"D+\" ]]\n [[ $(candidate \"0.5\") = \"D-\" ]]\n [[ $(candidate \"0.0\") = \"E\" ]]\n [[ $(candidate \"1.0 0.3 1.5 2.8 3.3\") = \"D D- C- B B+\" ]]\n [[ $(candidate \"0.0 0.7\") = \"E D-\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "sh", - "prompt": "#!/bin/bash\n# Given the lengths of the three sides of a triangle. Return the area of\n# the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n# Otherwise return -1\n# Three sides make a valid triangle when the sum of any two sides is greater \n# than the third side.\n# Example:\n#\n# $1 is an integer\n# $2 is an integer\n# $3 is an integer\ntriangle_area() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n triangle_area \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3\" \"4\" \"5\") = \"6.0\" ]]\n [[ $(candidate \"1\" \"2\" \"10\") = \"-1\" ]]\n [[ $(candidate \"4\" \"8\" \"5\") = \"8.18\" ]]\n [[ $(candidate \"2\" \"2\" \"2\") = \"1.73\" ]]\n [[ $(candidate \"1\" \"2\" \"3\") = \"-1\" ]]\n [[ $(candidate \"10\" \"5\" \"7\") = \"16.25\" ]]\n [[ $(candidate \"2\" \"6\" \"3\") = \"-1\" ]]\n [[ $(candidate \"1\" \"1\" \"1\") = \"0.43\" ]]\n [[ $(candidate \"2\" \"2\" \"10\") = \"-1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "sh", - "prompt": "#!/bin/bash\n# Check if two words have the same characters.\n#\n# $1 is a string\n# $2 is a string\nsame_chars() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n same_chars \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"eabcdzzzz\" \"dddzzzzzzzddeddabc\") = \"true\" ]]\n [[ $(candidate \"abcd\" \"dddddddabc\") = \"true\" ]]\n [[ $(candidate \"dddddddabc\" \"abcd\") = \"true\" ]]\n [[ $(candidate \"eabcd\" \"dddddddabc\") = \"false\" ]]\n [[ $(candidate \"abcd\" \"dddddddabcf\") = \"false\" ]]\n [[ $(candidate \"eabcdzzzz\" \"dddzzzzzzzddddabc\") = \"false\" ]]\n [[ $(candidate \"aabb\" \"aaccc\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "sh", - "prompt": "#!/bin/bash\n# Given an array of integers nums, find the minimum sum of any non-empty sub-array\n# of nums.\n# Example\n#\n# $1 is a space-separated list\nminSubArraySum() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n minSubArraySum \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2 3 4 1 2 4\") = \"1\" ]]\n [[ $(candidate \"-1 -2 -3\") = \"-6\" ]]\n [[ $(candidate \"-1 -2 -3 2 -10\") = \"-14\" ]]\n [[ $(candidate \"-9999999999999999\") = \"-9999999999999999\" ]]\n [[ $(candidate \"0 10 20 1000000\") = \"0\" ]]\n [[ $(candidate \"-1 -2 -3 10 -5\") = \"-6\" ]]\n [[ $(candidate \"100 -1 -2 -3 10 -5\") = \"-6\" ]]\n [[ $(candidate \"10 11 13 8 3 4\") = \"3\" ]]\n [[ $(candidate \"100 -33 32 -1 0 -2\") = \"-33\" ]]\n [[ $(candidate \"-10\") = \"-10\" ]]\n [[ $(candidate \"7\") = \"7\" ]]\n [[ $(candidate \"1 -1\") = \"-1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a string s and a natural number n, you have been tasked to implement \n# a function that returns a list of all words from string s that contain exactly \n# n consonants, in order these words appear in the string s.\n# If the string s is empty then the function should return an empty list.\n# Note: you may assume the input string contains only letters and spaces.\n# Examples:\n#\n# $1 is a string\n# $2 is an integer\nselect_words() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n select_words \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Mary had a little lamb\" \"4\") = \"little\" ]]\n [[ $(candidate \"Mary had a little lamb\" \"3\") = \"Mary lamb\" ]]\n [[ $(candidate \"simple white space\" \"2\") = \"\" ]]\n [[ $(candidate \"Hello world\" \"4\") = \"world\" ]]\n [[ $(candidate \"Uncle sam\" \"3\") = \"Uncle\" ]]\n [[ $(candidate \"\" \"4\") = \"\" ]]\n [[ $(candidate \"a b c d e f\" \"1\") = \"b c d f\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "sh", - "prompt": "#!/bin/bash\n# Return list of all prefixes from shortest to longest of the input string\n#\n# $1 is a string\nall_prefixes() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n all_prefixes \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"asdfgh\") = \"a as asd asdf asdfg asdfgh\" ]]\n [[ $(candidate \"WWW\") = \"W WW WWW\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function that takes a value (string) representing a number\n# and returns the closest integer to it. If the number is equidistant\n# from two integers, round it away from zero.\n# Examples\n# Note:\n# Rounding away from zero means that if the given number is equidistant\n# from two integers, the one you should return is the one that is the\n# farthest from zero. For example closest_integer(\"14.5\") should\n# return 15 and closest_integer(\"-14.5\") should return -15.\n#\n# $1 is a string\nclosest_integer() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n closest_integer \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"10\") = \"10\" ]]\n [[ $(candidate \"14.5\") = \"15\" ]]\n [[ $(candidate \"-15.5\") = \"-16\" ]]\n [[ $(candidate \"15.3\") = \"15\" ]]\n [[ $(candidate \"0\") = \"0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function which takes a string representing a file's name, and returns\n# 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n# A file's name is considered to be valid if and only if all the following conditions \n# are met:\n# - There should not be more than three digits ('0'-'9') in the file's name.\n# - The file's name contains exactly one dot '.'\n# - The substring before the dot should not be empty, and it starts with a letter from \n# the latin alphapet ('a'-'z' and 'A'-'Z').\n# - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n# Examples:\n#\n# $1 is a string\nfile_name_check() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n file_name_check \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"example.txt\") = \"Yes\" ]]\n [[ $(candidate \"1example.dll\") = \"No\" ]]\n [[ $(candidate \"s1sdf3.asd\") = \"No\" ]]\n [[ $(candidate \"K.dll\") = \"Yes\" ]]\n [[ $(candidate \"MY16FILE3.exe\") = \"Yes\" ]]\n [[ $(candidate \"His12FILE94.exe\") = \"No\" ]]\n [[ $(candidate \"_Y.txt\") = \"No\" ]]\n [[ $(candidate \"?aREYA.exe\") = \"No\" ]]\n [[ $(candidate \"/this_is_valid.dll\") = \"No\" ]]\n [[ $(candidate \"this_is_valid.wow\") = \"No\" ]]\n [[ $(candidate \"this_is_valid.txt\") = \"Yes\" ]]\n [[ $(candidate \"this_is_valid.txtexe\") = \"No\" ]]\n [[ $(candidate \"#this2_i4s_5valid.ten\") = \"No\" ]]\n [[ $(candidate \"@this1_is6_valid.exe\") = \"No\" ]]\n [[ $(candidate \"this_is_12valid.6exe4.txt\") = \"No\" ]]\n [[ $(candidate \"all.exe.txt\") = \"No\" ]]\n [[ $(candidate \"I563_No.exe\") = \"Yes\" ]]\n [[ $(candidate \"Is3youfault.txt\") = \"Yes\" ]]\n [[ $(candidate \"no_one#knows.dll\") = \"Yes\" ]]\n [[ $(candidate \"1I563_Yes3.exe\") = \"No\" ]]\n [[ $(candidate \"I563_Yes3.txtt\") = \"No\" ]]\n [[ $(candidate \"final..txt\") = \"No\" ]]\n [[ $(candidate \"final132\") = \"No\" ]]\n [[ $(candidate \"_f4indsartal132.\") = \"No\" ]]\n [[ $(candidate \".txt\") = \"No\" ]]\n [[ $(candidate \"s.\") = \"No\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given two intervals,\n# where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n# The given intervals are closed which means that the interval (start, end)\n# includes both start and end.\n# For each given interval, it is assumed that its start is less or equal its end.\n# Your task is to determine whether the length of intersection of these two \n# intervals is a prime number.\n# Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n# which its length is 1, which not a prime number.\n# If the length of the intersection is a prime number, return \"YES\",\n# otherwise, return \"NO\".\n# If the two intervals don't intersect, return \"NO\".\n# [input/output] samples:\n#\n# $1 is a space-separated list\n# $2 is a space-separated list\nintersection() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n intersection \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2\" \"2 3\") = \"NO\" ]]\n [[ $(candidate \"-1 1\" \"0 4\") = \"NO\" ]]\n [[ $(candidate \"-3 -1\" \"-5 5\") = \"YES\" ]]\n [[ $(candidate \"-2 2\" \"-4 0\") = \"YES\" ]]\n [[ $(candidate \"-11 2\" \"-1 -1\") = \"NO\" ]]\n [[ $(candidate \"1 2\" \"3 5\") = \"NO\" ]]\n [[ $(candidate \"1 2\" \"1 2\") = \"NO\" ]]\n [[ $(candidate \"-2 -2\" \"-3 -2\") = \"NO\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "sh", - "prompt": "#!/bin/bash\n# Return the largest prime factor of n. Assume n > 1 and is not a prime.\n#\n# $1 is an integer\nlargest_prime_factor() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n largest_prime_factor \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"15\") = \"5\" ]]\n [[ $(candidate \"27\") = \"3\" ]]\n [[ $(candidate \"63\") = \"7\" ]]\n [[ $(candidate \"330\") = \"11\" ]]\n [[ $(candidate \"13195\") = \"29\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a string, find out how many distinct characters (regardless of case) does it consist of\n#\n# $1 is a string\ncount_distinct_characters() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n count_distinct_characters \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"0\" ]]\n [[ $(candidate \"abcde\") = \"5\" ]]\n [[ $(candidate \"abcdecadeCADE\") = \"5\" ]]\n [[ $(candidate \"aaaaAAAAaaaa\") = \"1\" ]]\n [[ $(candidate \"Jerry jERRY JeRRRY\") = \"5\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "sh", - "prompt": "#!/bin/bash\n# You're given a list of deposit and withdrawal operations on a bank account that starts with\n# zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n# at that point function should return True. Otherwise it should return False.\n#\n# $1 is a space-separated list\nbelow_zero() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n below_zero \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"false\" ]]\n [[ $(candidate \"1 2 -3 1 2 -3\") = \"false\" ]]\n [[ $(candidate \"1 2 -4 5 6\") = \"true\" ]]\n [[ $(candidate \"1 -1 2 -2 5 -5 4 -4\") = \"false\" ]]\n [[ $(candidate \"1 -1 2 -2 5 -5 4 -5\") = \"true\" ]]\n [[ $(candidate \"1 -2 2 -2 5 -5 4 -4\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "sh", - "prompt": "#!/bin/bash\n# Find the shortest palindrome that begins with a supplied string.\n# Algorithm idea is simple:\n# - Find the longest postfix of supplied string that is a palindrome.\n# - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n#\n# $1 is a string\nmake_palindrome() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n make_palindrome \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"x\") = \"x\" ]]\n [[ $(candidate \"xyz\") = \"xyzyx\" ]]\n [[ $(candidate \"xyx\") = \"xyx\" ]]\n [[ $(candidate \"jerry\") = \"jerryrrej\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a positive integer, obtain its roman numeral equivalent as a string,\n# and return it in lowercase.\n# Restrictions: 1 <= num <= 1000\n# Examples:\n#\n# $1 is an integer\nint_to_mini_roman() {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n int_to_mini_roman \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"19\") = \"xix\" ]]\n [[ $(candidate \"152\") = \"clii\" ]]\n [[ $(candidate \"251\") = \"ccli\" ]]\n [[ $(candidate \"426\") = \"cdxxvi\" ]]\n [[ $(candidate \"500\") = \"d\" ]]\n [[ $(candidate \"1\") = \"i\" ]]\n [[ $(candidate \"4\") = \"iv\" ]]\n [[ $(candidate \"43\") = \"xliii\" ]]\n [[ $(candidate \"90\") = \"xc\" ]]\n [[ $(candidate \"94\") = \"xciv\" ]]\n [[ $(candidate \"532\") = \"dxxxii\" ]]\n [[ $(candidate \"900\") = \"cm\" ]]\n [[ $(candidate \"994\") = \"cmxciv\" ]]\n [[ $(candidate \"1000\") = \"m\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - } -] \ No newline at end of file diff --git a/data/sh-reworded.json b/data/sh-reworded.json deleted file mode 100644 index 26c42ef01494e7b5843ccbc33998422ee9661bd4..0000000000000000000000000000000000000000 --- a/data/sh-reworded.json +++ /dev/null @@ -1,1898 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "sh", - "prompt": "#!/bin/bash\n# For a given number n, find the largest number that divides n evenly, smaller than n\n# >>> $(largest_divisor \"15\")\n# \"5\"\n#\n# $1 is an integer\nlargest_divisor() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n largest_divisor \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3\") = \"1\" ]]\n [[ $(candidate \"7\") = \"1\" ]]\n [[ $(candidate \"10\") = \"5\" ]]\n [[ $(candidate \"100\") = \"50\" ]]\n [[ $(candidate \"49\") = \"7\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_47_median", - "language": "sh", - "prompt": "#!/bin/bash\n# Return median of elements in the list l.\n# >>> $(median \"3 1 2 4 5\")\n# \"3\"\n# >>> $(median \"-10 4 6 1000 10 20\")\n# \"15.0\"\n#\n# $1 is a space-separated list\nmedian() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n median \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3 1 2 4 5\") = \"3\" ]]\n [[ $(candidate \"-10 4 6 1000 10 20\") = \"8.0\" ]]\n [[ $(candidate \"5\") = \"5\" ]]\n [[ $(candidate \"6 5\") = \"5.5\" ]]\n [[ $(candidate \"8 1 3 9 9 2 7\") = \"7\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "sh", - "prompt": "#!/bin/bash\n# Given two lists operator, and operand. The first list has basic algebra operations, and \n# the second list is a list of integers. Use the two given lists to build the algebric \n# expression and return the evaluation of this expression.\n# The basic algebra operations:\n# Addition ( + ) \n# Subtraction ( - ) \n# Multiplication ( * ) \n# Floor division ( // ) \n# Exponentiation ( ** ) \n# Example:\n# operator['+', '*', '-']\n# array = [2, 3, 4, 5]\n# result = 2 + 3 * 4 - 5\n# => result = 9\n# Note:\n# The length of operator list is equal to the length of operand list minus one.\n# Operand is a list of of non-negative integers.\n# Operator list has at least one operator, and operand list has at least two operands.\n#\n# $1 is a space-separated list\n# $2 is a space-separated list\ndo_algebra() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n do_algebra \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"** * +\" \"2 3 4 5\") = \"37\" ]]\n [[ $(candidate \"+ * -\" \"2 3 4 5\") = \"9\" ]]\n [[ $(candidate \"// *\" \"7 3 4\") = \"8\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "sh", - "prompt": "#!/bin/bash\n# Return maximum element in the list.\n# >>> $(max_element \"1 2 3\")\n# \"3\"\n# >>> $(max_element \"5 3 -5 2 -3 3 9 0 123 1 -10\")\n# \"123\"\n#\n# $1 is a space-separated list\nmax_element() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n max_element \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3\") = \"3\" ]]\n [[ $(candidate \"5 3 -5 2 -3 3 9 0 124 1 -10\") = \"124\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function which returns the largest index of an element which\n# is not greater than or equal to the element immediately preceding it. If\n# no such element exists then return -1. The given array will not contain\n# duplicate values.\n# Examples:\n# >>> $(can_arrange \"1 2 4 3 5\")\n# \"3\"\n# >>> $(can_arrange \"1 2 3\")\n# \"-1\"\n#\n# $1 is a space-separated list\ncan_arrange() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n can_arrange \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 4 3 5\") = \"3\" ]]\n [[ $(candidate \"1 2 4 5\") = \"-1\" ]]\n [[ $(candidate \"1 4 2 5 6 7 8 9 10\") = \"2\" ]]\n [[ $(candidate \"4 8 5 7 3\") = \"4\" ]]\n [[ $(candidate \"\") = \"-1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "sh", - "prompt": "#!/bin/bash\n# Imagine a road that's a perfectly straight infinitely long line.\n# n cars are driving left to right; simultaneously, a different set of n cars\n# are driving right to left. The two sets of cars start out being very far from\n# each other. All cars move in the same speed. Two cars are said to collide\n# when a car that's moving left to right hits a car that's moving right to left.\n# However, the cars are infinitely sturdy and strong; as a result, they continue moving\n# in their trajectory as if they did not collide.\n# This function outputs the number of such collisions.\n#\n# $1 is an integer\ncar_race_collision() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n car_race_collision \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2\") = \"4\" ]]\n [[ $(candidate \"3\") = \"9\" ]]\n [[ $(candidate \"4\") = \"16\" ]]\n [[ $(candidate \"8\") = \"64\" ]]\n [[ $(candidate \"10\") = \"100\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function that returns true if the last character\n# of a given string is an alphabetical character and is not\n# a part of a word, and false otherwise.\n# Note: \"word\" is a group of characters separated by space.\n# Examples:\n# >>> $(check_if_last_char_is_a_letter \"apple pie\")\n# \"false\"\n# >>> $(check_if_last_char_is_a_letter \"apple pi e\")\n# \"true\"\n# >>> $(check_if_last_char_is_a_letter \"apple pi e \")\n# \"false\"\n# >>> $(check_if_last_char_is_a_letter \"\")\n# \"false\"\n#\n# $1 is a string\ncheck_if_last_char_is_a_letter() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n check_if_last_char_is_a_letter \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"apple\") = \"false\" ]]\n [[ $(candidate \"apple pi e\") = \"true\" ]]\n [[ $(candidate \"eeeee\") = \"false\" ]]\n [[ $(candidate \"A\") = \"true\" ]]\n [[ $(candidate \"Pumpkin pie \") = \"false\" ]]\n [[ $(candidate \"Pumpkin pie 1\") = \"false\" ]]\n [[ $(candidate \"\") = \"false\" ]]\n [[ $(candidate \"eeeee e \") = \"false\" ]]\n [[ $(candidate \"apple pie\") = \"false\" ]]\n [[ $(candidate \"apple pi e \") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "sh", - "prompt": "#!/bin/bash\n# Return true if a given number is prime, and false otherwise.\n# >>> $(is_prime \"6\")\n# \"false\"\n# >>> $(is_prime \"101\")\n# \"true\"\n# >>> $(is_prime \"11\")\n# \"true\"\n# >>> $(is_prime \"13441\")\n# \"true\"\n# >>> $(is_prime \"61\")\n# \"true\"\n# >>> $(is_prime \"4\")\n# \"false\"\n# >>> $(is_prime \"1\")\n# \"false\"\n#\n# $1 is an integer\nis_prime() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n is_prime \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"6\") = \"false\" ]]\n [[ $(candidate \"101\") = \"true\" ]]\n [[ $(candidate \"11\") = \"true\" ]]\n [[ $(candidate \"13441\") = \"true\" ]]\n [[ $(candidate \"61\") = \"true\" ]]\n [[ $(candidate \"4\") = \"false\" ]]\n [[ $(candidate \"1\") = \"false\" ]]\n [[ $(candidate \"5\") = \"true\" ]]\n [[ $(candidate \"11\") = \"true\" ]]\n [[ $(candidate \"17\") = \"true\" ]]\n [[ $(candidate \"85\") = \"false\" ]]\n [[ $(candidate \"77\") = \"false\" ]]\n [[ $(candidate \"255379\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a list of positive integers x. return a sorted list of all \n# elements that hasn't any even digit.\n# Note: Returned list should be sorted in increasing order.\n# For example:\n# >>> $(unique_digits \"15 33 1422 1\")\n# ['\"1\"', '\"15\"', '\"33\"']\n# >>> $(unique_digits \"152 323 1422 10\")\n# []\n#\n# $1 is a space-separated list\nunique_digits() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n unique_digits \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"15 33 1422 1\") = \"1 15 33\" ]]\n [[ $(candidate \"152 323 1422 10\") = \"\" ]]\n [[ $(candidate \"12345 2033 111 151\") = \"111 151\" ]]\n [[ $(candidate \"135 103 31\") = \"31 135\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "sh", - "prompt": "#!/bin/bash\n# Input are two strings a and b consisting only of 1s and 0s.\n# Perform binary XOR on these inputs and return result also as a string.\n# >>> $(string_xor \"010\" \"110\")\n# \"100\"\n#\n# $1 is a string\n# $2 is a string\nstring_xor() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n string_xor \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"111000\" \"101010\") = \"010010\" ]]\n [[ $(candidate \"1\" \"1\") = \"0\" ]]\n [[ $(candidate \"0101\" \"0000\") = \"0101\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "sh", - "prompt": "#!/bin/bash\n# sum_to_n is a function that sums numbers from 1 to n.\n# >>> $(sum_to_n \"30\")\n# \"465\"\n# >>> $(sum_to_n \"100\")\n# \"5050\"\n# >>> $(sum_to_n \"5\")\n# \"15\"\n# >>> $(sum_to_n \"10\")\n# \"55\"\n# >>> $(sum_to_n \"1\")\n# \"1\"\n#\n# $1 is an integer\nsum_to_n() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n sum_to_n \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1\") = \"1\" ]]\n [[ $(candidate \"6\") = \"21\" ]]\n [[ $(candidate \"11\") = \"66\" ]]\n [[ $(candidate \"30\") = \"465\" ]]\n [[ $(candidate \"100\") = \"5050\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a list of numbers, return the sum of squares of the numbers\n# in the list that are odd. Ignore numbers that are negative or not integers.\n# >>> $(double_the_difference \"1 3 2 0\")\n# \"10\"\n# >>> $(double_the_difference \"-1 -2 0\")\n# \"0\"\n# >>> $(double_the_difference \"9 -2\")\n# \"81\"\n# >>> $(double_the_difference \"0\")\n# \"0\"\n# If the input list is empty, return 0.\n#\n# $1 is a space-separated list\ndouble_the_difference() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n double_the_difference \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"0\" ]]\n [[ $(candidate \"5.0 4.0\") = \"25\" ]]\n [[ $(candidate \"0.1 0.2 0.3\") = \"0\" ]]\n [[ $(candidate \"-10.0 -20.0 -30.0\") = \"0\" ]]\n [[ $(candidate \"-1.0 -2.0 8.0\") = \"0\" ]]\n [[ $(candidate \"0.2 3.0 5.0\") = \"34\" ]]\n [[ $(candidate \"-9.0 -7.0 -5.0 -3.0 -1.0 1.0 3.0 5.0 7.0 9.0\") = \"165\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "sh", - "prompt": "#!/bin/bash\n# Return length of given string\n# >>> $(strlen \"\")\n# \"0\"\n# >>> $(strlen \"abc\")\n# \"3\"\n#\n# $1 is a string\nstrlen() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n strlen \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"0\" ]]\n [[ $(candidate \"x\") = \"1\" ]]\n [[ $(candidate \"asdasnakj\") = \"9\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "sh", - "prompt": "#!/bin/bash\n# You'll be given a string of words, and your task is to count the number\n# of boredoms. A boredom is a sentence that starts with the word \"I\".\n# Sentences are delimited by '.', '?' or '!'.\n# For example:\n# >>> $(is_bored \"Hello world\")\n# \"0\"\n# >>> $(is_bored \"The sky is blue. The sun is shining. I love this weather\")\n# \"1\"\n#\n# $1 is a string\nis_bored() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n is_bored \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Hello world\") = \"0\" ]]\n [[ $(candidate \"Is the sky blue?\") = \"0\" ]]\n [[ $(candidate \"I love It \\!\") = \"1\" ]]\n [[ $(candidate \"bIt\") = \"0\" ]]\n [[ $(candidate \"I feel good today. I will be productive. will kill It\") = \"2\" ]]\n [[ $(candidate \"You and I are going for a walk\") = \"0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function vowels_count which takes a string representing\n# a word as input and returns the number of vowels in the string.\n# Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n# vowel, but only when it is at the end of the given word.\n# Example:\n# >>> $(vowels_count \"abcde\")\n# \"2\"\n# >>> $(vowels_count \"ACEDY\")\n# \"3\"\n#\n# $1 is a string\nvowels_count() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n vowels_count \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"abcde\") = \"2\" ]]\n [[ $(candidate \"Alone\") = \"3\" ]]\n [[ $(candidate \"key\") = \"2\" ]]\n [[ $(candidate \"bye\") = \"1\" ]]\n [[ $(candidate \"keY\") = \"2\" ]]\n [[ $(candidate \"bYe\") = \"1\" ]]\n [[ $(candidate \"ACEDY\") = \"3\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "sh", - "prompt": "#!/bin/bash\n# Return n-th Fibonacci number.\n# >>> $(fib \"10\")\n# \"55\"\n# >>> $(fib \"1\")\n# \"1\"\n# >>> $(fib \"8\")\n# \"21\"\n#\n# $1 is an integer\nfib() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n fib \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"10\") = \"55\" ]]\n [[ $(candidate \"1\") = \"1\" ]]\n [[ $(candidate \"8\") = \"21\" ]]\n [[ $(candidate \"11\") = \"89\" ]]\n [[ $(candidate \"12\") = \"144\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "sh", - "prompt": "#!/bin/bash\n# Your task is to implement a function that will simplify the expression\n# x * n. The function returns true if x * n evaluates to a whole number and false\n# otherwise. Both x and n, are string representation of a fraction, and have the following format,\n# / where both numerator and denominator are positive whole numbers.\n# You can assume that x, and n are valid fractions, and do not have zero as denominator.\n# >>> $(simplify \"1/5\" \"5/1\")\n# \"true\"\n# >>> $(simplify \"1/6\" \"2/1\")\n# \"false\"\n# >>> $(simplify \"7/10\" \"10/2\")\n# \"false\"\n#\n# $1 is a string\n# $2 is a string\nsimplify() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n simplify \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1/5\" \"5/1\") = \"true\" ]]\n [[ $(candidate \"1/6\" \"2/1\") = \"false\" ]]\n [[ $(candidate \"5/1\" \"3/1\") = \"true\" ]]\n [[ $(candidate \"7/10\" \"10/2\") = \"false\" ]]\n [[ $(candidate \"2/10\" \"50/10\") = \"true\" ]]\n [[ $(candidate \"7/2\" \"4/2\") = \"true\" ]]\n [[ $(candidate \"11/6\" \"6/1\") = \"true\" ]]\n [[ $(candidate \"2/3\" \"5/2\") = \"false\" ]]\n [[ $(candidate \"5/2\" \"3/5\") = \"false\" ]]\n [[ $(candidate \"2/4\" \"8/4\") = \"true\" ]]\n [[ $(candidate \"2/4\" \"4/2\") = \"true\" ]]\n [[ $(candidate \"1/5\" \"5/1\") = \"true\" ]]\n [[ $(candidate \"1/5\" \"1/5\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a string s, count the number of uppercase vowels in even indices.\n# For example:\n# >>> $(count_upper \"aBCdEf\")\n# \"1\"\n# >>> $(count_upper \"abcdefg\")\n# \"0\"\n# >>> $(count_upper \"dBBE\")\n# \"0\"\n#\n# $1 is a string\ncount_upper() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n count_upper \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"aBCdEf\") = \"1\" ]]\n [[ $(candidate \"abcdefg\") = \"0\" ]]\n [[ $(candidate \"dBBE\") = \"0\" ]]\n [[ $(candidate \"B\") = \"0\" ]]\n [[ $(candidate \"U\") = \"1\" ]]\n [[ $(candidate \"\") = \"0\" ]]\n [[ $(candidate \"EEEE\") = \"2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a rectangular grid of wells. Each row represents a single well,\n# and each 1 in a row represents a single unit of water.\n# Each well has a corresponding bucket that can be used to extract water from it, \n# and all buckets have the same capacity.\n# Your task is to use the buckets to empty the wells.\n# Output the number of times you need to lower the buckets.\n# Example 1:\n# >>> $(max_fill \"0 0 1 0\\n0 1 0 0\\n1 1 1 1\" \"1\")\n# \"6\"\n# Example 2:\n# >>> $(max_fill \"0 0 1 1\\n0 0 0 0\\n1 1 1 1\\n0 1 1 1\" \"2\")\n# \"5\"\n# Example 3:\n# >>> $(max_fill \"0 0 0\\n0 0 0\" \"5\")\n# \"0\"\n# Constraints:\n# * all wells have the same length\n# * 1 <= grid.length <= 10^2\n# * 1 <= grid[:,1].length <= 10^2\n# * grid[i][j] -> 0 | 1\n# * 1 <= capacity <= 10\n#\n# $1 is a newline-separated, space-separated list\n# $2 is an integer\nmax_fill() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n max_fill \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"0 0 1 0\\n0 1 0 0\\n1 1 1 1\" \"1\") = \"6\" ]]\n [[ $(candidate \"0 0 1 1\\n0 0 0 0\\n1 1 1 1\\n0 1 1 1\" \"2\") = \"5\" ]]\n [[ $(candidate \"0 0 0\\n0 0 0\" \"5\") = \"0\" ]]\n [[ $(candidate \"1 1 1 1\\n1 1 1 1\" \"2\") = \"4\" ]]\n [[ $(candidate \"1 1 1 1\\n1 1 1 1\" \"9\") = \"2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "sh", - "prompt": "#!/bin/bash\n# Given an array arr of integers and a positive integer k, return a sorted list \n# of length k with the maximum k numbers in arr.\n# Example 1:\n# >>> $(maximum \"-3 -4 5\" \"3\")\n# ['\"-4\"', '\"-3\"', '\"5\"']\n# Example 2:\n# >>> $(maximum \"4 -4 4\" \"2\")\n# ['\"4\"', '\"4\"']\n# Example 3:\n# >>> $(maximum \"-3 2 1 2 -1 -2 1\" \"1\")\n# ['\"2\"']\n# Note:\n# 1. The length of the array will be in the range of [1, 1000].\n# 2. The elements in the array will be in the range of [-1000, 1000].\n# 3. 0 <= k <= len(arr)\n#\n# $1 is a space-separated list\n# $2 is an integer\nmaximum() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n maximum \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"-3 -4 5\" \"3\") = \"-4 -3 5\" ]]\n [[ $(candidate \"4 -4 4\" \"2\") = \"4 4\" ]]\n [[ $(candidate \"-3 2 1 2 -1 -2 1\" \"1\") = \"2\" ]]\n [[ $(candidate \"123 -123 20 0 1 2 -3\" \"3\") = \"2 20 123\" ]]\n [[ $(candidate \"-123 20 0 1 2 -3\" \"4\") = \"0 1 2 20\" ]]\n [[ $(candidate \"5 15 0 3 -13 -8 0\" \"7\") = \"-13 -8 0 0 3 5 15\" ]]\n [[ $(candidate \"-1 0 2 5 3 -10\" \"2\") = \"3 5\" ]]\n [[ $(candidate \"1 0 5 -7\" \"1\") = \"5\" ]]\n [[ $(candidate \"4 -4\" \"2\") = \"-4 4\" ]]\n [[ $(candidate \"-10 10\" \"2\") = \"-10 10\" ]]\n [[ $(candidate \"1 2 3 -23 243 -400 0\" \"0\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that takes a message, and encodes in such a \n# way that it swaps case of all letters, replaces all vowels in \n# the message with the letter that appears 2 places ahead of that \n# vowel in the english alphabet. \n# Assume only letters. \n# Examples:\n# >>> $(encode \"test\")\n# \"TGST\"\n# >>> $(encode \"This is a message\")\n# \"tHKS KS C MGSSCGG\"\n#\n# $1 is a string\nencode() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n encode \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"TEST\") = \"tgst\" ]]\n [[ $(candidate \"Mudasir\") = \"mWDCSKR\" ]]\n [[ $(candidate \"YES\") = \"ygs\" ]]\n [[ $(candidate \"This is a message\") = \"tHKS KS C MGSSCGG\" ]]\n [[ $(candidate \"I DoNt KnOw WhAt tO WrItE\") = \"k dQnT kNqW wHcT Tq wRkTg\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "sh", - "prompt": "#!/bin/bash\n# remove_vowels is a function that takes string and returns string without vowels.\n# >>> $(remove_vowels \"\")\n# \"\"\n# >>> $(remove_vowels \"abcdef\")\n# \"bcdf\"\n# >>> $(remove_vowels \"aaaaa\")\n# \"\"\n# >>> $(remove_vowels \"aaBAA\")\n# \"B\"\n# >>> $(remove_vowels \"zbcd\")\n# \"zbcd\"\n#\n# $1 is a string\nremove_vowels() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n remove_vowels \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"abcdef\\nghijklm\") = \"bcdf\\nghjklm\" ]]\n [[ $(candidate \"fedcba\") = \"fdcb\" ]]\n [[ $(candidate \"eeeee\") = \"\" ]]\n [[ $(candidate \"acBAA\") = \"cB\" ]]\n [[ $(candidate \"EcBOO\") = \"cB\" ]]\n [[ $(candidate \"ybcd\") = \"ybcd\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "sh", - "prompt": "#!/bin/bash\n# Return only positive numbers in the list.\n# >>> $(get_positive \"-1 2 -4 5 6\")\n# ['\"2\"', '\"5\"', '\"6\"']\n# >>> $(get_positive \"5 3 -5 2 -3 3 9 0 123 1 -10\")\n# ['\"5\"', '\"3\"', '\"2\"', '\"3\"', '\"9\"', '\"123\"', '\"1\"']\n#\n# $1 is a space-separated list\nget_positive() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n get_positive \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"-1 -2 4 5 6\") = \"4 5 6\" ]]\n [[ $(candidate \"5 3 -5 2 3 3 9 0 123 1 -10\") = \"5 3 2 3 3 9 123 1\" ]]\n [[ $(candidate \"-1 -2\") = \"\" ]]\n [[ $(candidate \"\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "sh", - "prompt": "#!/bin/bash\n# Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n# >>> $(string_sequence \"0\")\n# \"0\"\n# >>> $(string_sequence \"5\")\n# \"0 1 2 3 4 5\"\n#\n# $1 is an integer\nstring_sequence() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n string_sequence \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"0\") = \"0\" ]]\n [[ $(candidate \"3\") = \"0 1 2 3\" ]]\n [[ $(candidate \"10\") = \"0 1 2 3 4 5 6 7 8 9 10\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a positive integer n, you have to make a pile of n levels of stones.\n# The first level has n stones.\n# The number of stones in the next level is:\n# - the next odd number if n is odd.\n# - the next even number if n is even.\n# Return the number of stones in each level in a list, where element at index\n# i represents the number of stones in the level (i+1).\n# Examples:\n# >>> $(make_a_pile \"3\")\n# ['\"3\"', '\"5\"', '\"7\"']\n#\n# $1 is an integer\nmake_a_pile() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n make_a_pile \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3\") = \"3 5 7\" ]]\n [[ $(candidate \"4\") = \"4 6 8 10\" ]]\n [[ $(candidate \"5\") = \"5 7 9 11 13\" ]]\n [[ $(candidate \"6\") = \"6 8 10 12 14 16\" ]]\n [[ $(candidate \"8\") = \"8 10 12 14 16 18 20 22\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "sh", - "prompt": "#!/bin/bash\n# Task\n# 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\n# then check if the result string is palindrome.\n# A string is called palindrome if it reads the same backward as forward.\n# You should return a list containing the result string and true/false for the check.\n# Example\n# >>> $(reverse_delete \"abcde\" \"ae\")\n# ['\"bcd\"', '\"false\"']\n# >>> $(reverse_delete \"abcdef\" \"b\")\n# ['\"acdef\"', '\"false\"']\n# >>> $(reverse_delete \"abcdedcba\" \"ab\")\n# ['\"cdedc\"', '\"true\"']\n#\n# $1 is a string\n# $2 is a string\nreverse_delete() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n reverse_delete \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"abcde\" \"ae\") = \"bcd false\" ]]\n [[ $(candidate \"abcdef\" \"b\") = \"acdef false\" ]]\n [[ $(candidate \"abcdedcba\" \"ab\") = \"cdedc true\" ]]\n [[ $(candidate \"dwik\" \"w\") = \"dik false\" ]]\n [[ $(candidate \"a\" \"a\") = \" true\" ]]\n [[ $(candidate \"abcdedcba\" \"\") = \"abcdedcba true\" ]]\n [[ $(candidate \"abcdedcba\" \"v\") = \"abcdedcba true\" ]]\n [[ $(candidate \"vabba\" \"v\") = \"abba true\" ]]\n [[ $(candidate \"mamma\" \"mia\") = \" true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "sh", - "prompt": "#!/bin/bash\n# For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n# >>> $(flip_case \"Hello\")\n# \"hELLO\"\n#\n# $1 is a string\nflip_case() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n flip_case \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"Hello\\!\") = \"hELLO\\!\" ]]\n [[ $(candidate \"These violent delights have violent ends\") = \"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a string s.\n# if s[i] is a letter, reverse its case from lower to upper or vise versa, \n# otherwise keep it as it is.\n# If the string contains no letters, reverse the string.\n# The function should return the resulted string.\n# Examples\n# >>> $(solve \"1234\")\n# \"4321\"\n# >>> $(solve \"ab\")\n# \"AB\"\n# >>> $(solve \"#a@C\")\n# \"#A@c\"\n#\n# $1 is a string\nsolve() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n solve \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"AsDf\") = \"aSdF\" ]]\n [[ $(candidate \"1234\") = \"4321\" ]]\n [[ $(candidate \"ab\") = \"AB\" ]]\n [[ $(candidate \"#a@C\") = \"#A@c\" ]]\n [[ $(candidate \"#AsdfW^45\") = \"#aSDFw^45\" ]]\n [[ $(candidate \"#6@2\") = \"2@6#\" ]]\n [[ $(candidate \"#\\$a^D\") = \"#\\$A^d\" ]]\n [[ $(candidate \"#ccc\") = \"#CCC\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "sh", - "prompt": "#!/bin/bash\n# This function takes two positive numbers x and y and returns the\n# biggest even integer number that is in the range [x, y] inclusive. If \n# there's no such number, then the function should return -1.\n# For example:\n# >>> $(choose_num \"12\" \"15\")\n# \"14\"\n# >>> $(choose_num \"13\" \"12\")\n# \"-1\"\n#\n# $1 is an integer\n# $2 is an integer\nchoose_num() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n choose_num \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"12\" \"15\") = \"14\" ]]\n [[ $(candidate \"13\" \"12\") = \"-1\" ]]\n [[ $(candidate \"33\" \"12354\") = \"12354\" ]]\n [[ $(candidate \"5234\" \"5233\") = \"-1\" ]]\n [[ $(candidate \"6\" \"29\") = \"28\" ]]\n [[ $(candidate \"27\" \"10\") = \"-1\" ]]\n [[ $(candidate \"7\" \"7\") = \"-1\" ]]\n [[ $(candidate \"546\" \"546\") = \"546\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a string representing a sentence,\n# the sentence contains some words separated by a space,\n# and you have to return a string that contains the words from the original sentence,\n# whose lengths are prime numbers,\n# the order of the words in the new string should be the same as the original one.\n# Example 1:\n# >>> $(words_in_sentence \"This is a test\")\n# \"is\"\n# Example 2:\n# >>> $(words_in_sentence \"lets go for swimming\")\n# \"go for\"\n# Constraints:\n# * 1 <= len(sentence) <= 100\n# * sentence contains only letters\n#\n# $1 is a string\nwords_in_sentence() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n words_in_sentence \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"This is a test\") = \"is\" ]]\n [[ $(candidate \"lets go for swimming\") = \"go for\" ]]\n [[ $(candidate \"there is no place available here\") = \"there is no place\" ]]\n [[ $(candidate \"Hi I am Hussein\") = \"Hi am Hussein\" ]]\n [[ $(candidate \"go for it\") = \"go for it\" ]]\n [[ $(candidate \"here\") = \"\" ]]\n [[ $(candidate \"here is\") = \"is\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "sh", - "prompt": "#!/bin/bash\n# Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n# >>> $(intersperse \"\" \"4\")\n# []\n# >>> $(intersperse \"1 2 3\" \"4\")\n# ['\"1\"', '\"4\"', '\"2\"', '\"4\"', '\"3\"']\n#\n# $1 is a space-separated list\n# $2 is an integer\nintersperse() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n intersperse \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\" \"7\") = \"\" ]]\n [[ $(candidate \"5 6 3 2\" \"8\") = \"5 8 6 8 3 8 2\" ]]\n [[ $(candidate \"2 2 2\" \"2\") = \"2 2 2 2 2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "sh", - "prompt": "#!/bin/bash\n# Your task is to write a function that returns true if a number x is a simple\n# power of n and false in other cases.\n# x is a simple power of n if n**int=x\n# For example:\n# >>> $(is_simple_power \"1\" \"4\")\n# \"true\"\n# >>> $(is_simple_power \"2\" \"2\")\n# \"true\"\n# >>> $(is_simple_power \"8\" \"2\")\n# \"true\"\n# >>> $(is_simple_power \"3\" \"2\")\n# \"false\"\n# >>> $(is_simple_power \"3\" \"1\")\n# \"false\"\n# >>> $(is_simple_power \"5\" \"3\")\n# \"false\"\n#\n# $1 is an integer\n# $2 is an integer\nis_simple_power() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n is_simple_power \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"16\" \"2\") = \"true\" ]]\n [[ $(candidate \"143214\" \"16\") = \"false\" ]]\n [[ $(candidate \"4\" \"2\") = \"true\" ]]\n [[ $(candidate \"9\" \"3\") = \"true\" ]]\n [[ $(candidate \"16\" \"4\") = \"true\" ]]\n [[ $(candidate \"24\" \"2\") = \"false\" ]]\n [[ $(candidate \"128\" \"4\") = \"false\" ]]\n [[ $(candidate \"12\" \"6\") = \"false\" ]]\n [[ $(candidate \"1\" \"1\") = \"true\" ]]\n [[ $(candidate \"1\" \"12\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that returns true if the given number is the multiplication of 3 prime numbers\n# and false otherwise.\n# Knowing that (a) is less then 100. \n# Example:\n# >>> $(is_multiply_prime \"30\")\n# \"true\"\n# 30 = 2 * 3 * 5\n#\n# $1 is an integer\nis_multiply_prime() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n is_multiply_prime \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\") = \"false\" ]]\n [[ $(candidate \"30\") = \"true\" ]]\n [[ $(candidate \"8\") = \"true\" ]]\n [[ $(candidate \"10\") = \"false\" ]]\n [[ $(candidate \"125\") = \"true\" ]]\n [[ $(candidate \"105\") = \"true\" ]]\n [[ $(candidate \"126\") = \"false\" ]]\n [[ $(candidate \"729\") = \"false\" ]]\n [[ $(candidate \"891\") = \"false\" ]]\n [[ $(candidate \"1001\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "sh", - "prompt": "#!/bin/bash\n# Given the lengths of the three sides of a triangle. Return true if the three\n# sides form a right-angled triangle, false otherwise.\n# A right-angled triangle is a triangle in which one angle is right angle or \n# 90 degree.\n# Example:\n# >>> $(right_angle_triangle \"3\" \"4\" \"5\")\n# \"true\"\n# >>> $(right_angle_triangle \"1\" \"2\" \"3\")\n# \"false\"\n#\n# $1 is an integer\n# $2 is an integer\n# $3 is an integer\nright_angle_triangle() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n right_angle_triangle \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3\" \"4\" \"5\") = \"true\" ]]\n [[ $(candidate \"1\" \"2\" \"3\") = \"false\" ]]\n [[ $(candidate \"10\" \"6\" \"8\") = \"true\" ]]\n [[ $(candidate \"2\" \"2\" \"2\") = \"false\" ]]\n [[ $(candidate \"7\" \"24\" \"25\") = \"true\" ]]\n [[ $(candidate \"10\" \"5\" \"7\") = \"false\" ]]\n [[ $(candidate \"5\" \"12\" \"13\") = \"true\" ]]\n [[ $(candidate \"15\" \"8\" \"17\") = \"true\" ]]\n [[ $(candidate \"48\" \"55\" \"73\") = \"true\" ]]\n [[ $(candidate \"1\" \"1\" \"1\") = \"false\" ]]\n [[ $(candidate \"2\" \"2\" \"10\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function that takes 3 numbers.\n# Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n# Returns false in any other cases.\n# Examples\n# >>> $(any_int \"5\" \"2\" \"7\")\n# \"true\"\n# >>> $(any_int \"3\" \"2\" \"2\")\n# \"false\"\n# >>> $(any_int \"3\" \"-2\" \"1\")\n# \"true\"\n# >>> $(any_int \"3.6\" \"-2.2\" \"2\")\n# \"false\"\n#\n# $1 is a floating point\n# $2 is a floating point\n# $3 is a floating point\nany_int() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n any_int \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2\" \"3\" \"1\") = \"true\" ]]\n [[ $(candidate \"2.5\" \"2\" \"3\") = \"false\" ]]\n [[ $(candidate \"1.5\" \"5\" \"3.5\") = \"false\" ]]\n [[ $(candidate \"2\" \"6\" \"2\") = \"false\" ]]\n [[ $(candidate \"4\" \"2\" \"2\") = \"true\" ]]\n [[ $(candidate \"2.2\" \"2.2\" \"2.2\") = \"false\" ]]\n [[ $(candidate \"-4\" \"6\" \"2\") = \"true\" ]]\n [[ $(candidate \"2\" \"1\" \"1\") = \"true\" ]]\n [[ $(candidate \"3\" \"4\" \"7\") = \"true\" ]]\n [[ $(candidate \"3.0\" \"4\" \"7\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "sh", - "prompt": "#!/bin/bash\n# This function takes a list l and returns a list l' such that\n# l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n# to the values of the corresponding indicies of l, but sorted.\n# >>> $(sort_third \"1 2 3\")\n# ['\"1\"', '\"2\"', '\"3\"']\n# >>> $(sort_third \"5 6 3 4 8 9 2\")\n# ['\"2\"', '\"6\"', '\"3\"', '\"4\"', '\"8\"', '\"9\"', '\"5\"']\n#\n# $1 is a space-separated list\nsort_third() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n sort_third \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5 6 3 4 8 9 2\") = \"2 6 3 4 8 9 5\" ]]\n [[ $(candidate \"5 8 3 4 6 9 2\") = \"2 8 3 4 6 9 5\" ]]\n [[ $(candidate \"5 6 9 4 8 3 2\") = \"2 6 9 4 8 3 5\" ]]\n [[ $(candidate \"5 6 3 4 8 9 2 1\") = \"2 6 3 4 8 9 5 1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_53_add", - "language": "sh", - "prompt": "#!/bin/bash\n# Add two numbers x and y\n# >>> $(add \"2\" \"3\")\n# \"5\"\n# >>> $(add \"5\" \"7\")\n# \"12\"\n#\n# $1 is an integer\n# $2 is an integer\nadd() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n add \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"0\" \"1\") = \"1\" ]]\n [[ $(candidate \"1\" \"0\") = \"1\" ]]\n [[ $(candidate \"2\" \"3\") = \"5\" ]]\n [[ $(candidate \"5\" \"7\") = \"12\" ]]\n [[ $(candidate \"7\" \"5\") = \"12\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_69_search", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n# zero, and has a frequency greater than or equal to the value of the integer itself. \n# The frequency of an integer is the number of times it appears in the list.\n# If no such a value exist, return -1.\n# Examples:\n# >>> $(search \"4 1 2 2 3 1\")\n# \"2\"\n# >>> $(search \"1 2 2 3 3 3 4 4 4\")\n# \"3\"\n# >>> $(search \"5 5 4 4 4\")\n# \"-1\"\n#\n# $1 is a space-separated list\nsearch() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n search \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5 5 5 5 1\") = \"1\" ]]\n [[ $(candidate \"4 1 4 1 4 4\") = \"4\" ]]\n [[ $(candidate \"3 3\") = \"-1\" ]]\n [[ $(candidate \"8 8 8 8 8 8 8 8\") = \"8\" ]]\n [[ $(candidate \"2 3 3 2 2\") = \"2\" ]]\n [[ $(candidate \"2 7 8 8 4 8 7 3 9 6 5 10 4 3 6 7 1 7 4 10 8 1\") = \"1\" ]]\n [[ $(candidate \"3 2 8 2\") = \"2\" ]]\n [[ $(candidate \"6 7 1 8 8 10 5 8 5 3 10\") = \"1\" ]]\n [[ $(candidate \"8 8 3 6 5 6 4\") = \"-1\" ]]\n [[ $(candidate \"6 9 6 7 1 4 7 1 8 8 9 8 10 10 8 4 10 4 10 1 2 9 5 7 9\") = \"1\" ]]\n [[ $(candidate \"1 9 10 1 3\") = \"1\" ]]\n [[ $(candidate \"6 9 7 5 8 7 5 3 7 5 10 10 3 6 10 2 8 6 5 4 9 5 3 10\") = \"5\" ]]\n [[ $(candidate \"1\") = \"1\" ]]\n [[ $(candidate \"8 8 10 6 4 3 5 8 2 4 2 8 4 6 10 4 2 1 10 2 1 1 5\") = \"4\" ]]\n [[ $(candidate \"2 10 4 8 2 10 5 1 2 9 5 5 6 3 8 6 4 10\") = \"2\" ]]\n [[ $(candidate \"1 6 10 1 6 9 10 8 6 8 7 3\") = \"1\" ]]\n [[ $(candidate \"9 2 4 1 5 1 5 2 5 7 7 7 3 10 1 5 4 2 8 4 1 9 10 7 10 2 8 10 9 4\") = \"4\" ]]\n [[ $(candidate \"2 6 4 2 8 7 5 6 4 10 4 6 3 7 8 8 3 1 4 2 2 10 7\") = \"4\" ]]\n [[ $(candidate \"9 8 6 10 2 6 10 2 7 8 10 3 8 2 6 2 3 1\") = \"2\" ]]\n [[ $(candidate \"5 5 3 9 5 6 3 2 8 5 6 10 10 6 8 4 10 7 7 10 8\") = \"-1\" ]]\n [[ $(candidate \"10\") = \"-1\" ]]\n [[ $(candidate \"9 7 7 2 4 7 2 10 9 7 5 7 2\") = \"2\" ]]\n [[ $(candidate \"5 4 10 2 1 1 10 3 6 1 8\") = \"1\" ]]\n [[ $(candidate \"7 9 9 9 3 4 1 5 9 1 2 1 1 10 7 5 6 7 6 7 7 6\") = \"1\" ]]\n [[ $(candidate \"3 10 10 9 2\") = \"-1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that takes a string and returns true if the string\n# length is a prime number or false otherwise\n# Examples\n# >>> $(prime_length \"Hello\")\n# \"true\"\n# >>> $(prime_length \"abcdcba\")\n# \"true\"\n# >>> $(prime_length \"kittens\")\n# \"true\"\n# >>> $(prime_length \"orange\")\n# \"false\"\n#\n# $1 is a string\nprime_length() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n prime_length \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Hello\") = \"true\" ]]\n [[ $(candidate \"abcdcba\") = \"true\" ]]\n [[ $(candidate \"kittens\") = \"true\" ]]\n [[ $(candidate \"orange\") = \"false\" ]]\n [[ $(candidate \"wow\") = \"true\" ]]\n [[ $(candidate \"world\") = \"true\" ]]\n [[ $(candidate \"MadaM\") = \"true\" ]]\n [[ $(candidate \"Wow\") = \"true\" ]]\n [[ $(candidate \"\") = \"false\" ]]\n [[ $(candidate \"HI\") = \"true\" ]]\n [[ $(candidate \"go\") = \"true\" ]]\n [[ $(candidate \"gogo\") = \"false\" ]]\n [[ $(candidate \"aaaaaaaaaaaaaaa\") = \"false\" ]]\n [[ $(candidate \"Madam\") = \"true\" ]]\n [[ $(candidate \"M\") = \"false\" ]]\n [[ $(candidate \"0\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_58_common", - "language": "sh", - "prompt": "#!/bin/bash\n# Return sorted unique common elements for two lists.\n# >>> $(common \"1 4 3 34 653 2 5\" \"5 7 1 5 9 653 121\")\n# ['\"1\"', '\"5\"', '\"653\"']\n# >>> $(common \"5 3 2 8\" \"3 2\")\n# ['\"2\"', '\"3\"']\n#\n# $1 is a space-separated list\n# $2 is a space-separated list\ncommon() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n common \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 4 3 34 653 2 5\" \"5 7 1 5 9 653 121\") = \"1 5 653\" ]]\n [[ $(candidate \"5 3 2 8\" \"3 2\") = \"2 3\" ]]\n [[ $(candidate \"4 3 2 8\" \"3 2 4\") = \"2 3 4\" ]]\n [[ $(candidate \"4 3 2 8\" \"\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "sh", - "prompt": "#!/bin/bash\n# The Brazilian factorial is defined as:\n# brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n# where n > 0\n# For example:\n# >>> $(special_factorial \"4\")\n# \"288\"\n# The function will receive an integer as input and should return the special\n# factorial of this integer.\n#\n# $1 is an integer\nspecial_factorial() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n special_factorial \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"4\") = \"288\" ]]\n [[ $(candidate \"5\") = \"34560\" ]]\n [[ $(candidate \"7\") = \"125411328000\" ]]\n [[ $(candidate \"1\") = \"1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "sh", - "prompt": "#!/bin/bash\n# In this problem, you will implement a function that takes two lists of numbers,\n# and determines whether it is possible to perform an exchange of elements\n# between them to make lst1 a list of only even numbers.\n# There is no limit on the number of exchanged elements between lst1 and lst2.\n# If it is possible to exchange elements between the lst1 and lst2 to make\n# all the elements of lst1 to be even, return \"YES\".\n# Otherwise, return \"NO\".\n# For example:\n# >>> $(exchange \"1 2 3 4\" \"1 2 3 4\")\n# \"YES\"\n# >>> $(exchange \"1 2 3 4\" \"1 5 3 4\")\n# \"NO\"\n# It is assumed that the input lists will be non-empty.\n#\n# $1 is a space-separated list\n# $2 is a space-separated list\nexchange() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n exchange \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3 4\" \"1 2 3 4\") = \"YES\" ]]\n [[ $(candidate \"1 2 3 4\" \"1 5 3 4\") = \"NO\" ]]\n [[ $(candidate \"1 2 3 4\" \"2 1 4 3\") = \"YES\" ]]\n [[ $(candidate \"5 7 3\" \"2 6 4\") = \"YES\" ]]\n [[ $(candidate \"5 7 3\" \"2 6 3\") = \"NO\" ]]\n [[ $(candidate \"3 2 6 1 8 9\" \"3 5 5 1 1 1\") = \"NO\" ]]\n [[ $(candidate \"100 200\" \"200 200\") = \"YES\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a non-empty array of integers arr and an integer k, return\n# the sum of the elements with at most two digits from the first k elements of arr.\n# Example:\n# >>> $(add_elements \"111 21 3 4000 5 6 7 8 9\" \"4\")\n# \"24\"\n# Constraints:\n# 1. 1 <= len(arr) <= 100\n# 2. 1 <= k <= len(arr)\n#\n# $1 is a space-separated list\n# $2 is an integer\nadd_elements() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n add_elements \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 -2 -3 41 57 76 87 88 99\" \"3\") = \"-4\" ]]\n [[ $(candidate \"111 121 3 4000 5 6\" \"2\") = \"0\" ]]\n [[ $(candidate \"11 21 3 90 5 6 7 8 9\" \"4\") = \"125\" ]]\n [[ $(candidate \"111 21 3 4000 5 6 7 8 9\" \"4\") = \"24\" ]]\n [[ $(candidate \"1\" \"1\") = \"1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "sh", - "prompt": "#!/bin/bash\n# A simple program which should return the value of x if n is \n# a prime number and should return the value of y otherwise.\n# Examples:\n# >>> $(x_or_y \"7\" \"34\" \"12\")\n# \"34\"\n# >>> $(x_or_y \"15\" \"8\" \"5\")\n# \"5\"\n#\n# $1 is an integer\n# $2 is an integer\n# $3 is an integer\nx_or_y() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n x_or_y \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"7\" \"34\" \"12\") = \"34\" ]]\n [[ $(candidate \"15\" \"8\" \"5\") = \"5\" ]]\n [[ $(candidate \"3\" \"33\" \"5212\") = \"33\" ]]\n [[ $(candidate \"1259\" \"3\" \"52\") = \"3\" ]]\n [[ $(candidate \"7919\" \"-1\" \"12\") = \"-1\" ]]\n [[ $(candidate \"3609\" \"1245\" \"583\") = \"583\" ]]\n [[ $(candidate \"91\" \"56\" \"129\") = \"129\" ]]\n [[ $(candidate \"6\" \"34\" \"1234\") = \"1234\" ]]\n [[ $(candidate \"1\" \"2\" \"0\") = \"0\" ]]\n [[ $(candidate \"2\" \"2\" \"0\") = \"2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "sh", - "prompt": "#!/bin/bash\n# Given length of a side and high return area for a triangle.\n# >>> $(triangle_area \"5\" \"3\")\n# \"7.5\"\n#\n# $1 is an integer\n# $2 is an integer\ntriangle_area() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n triangle_area \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\" \"3\") = \"7.5\" ]]\n [[ $(candidate \"2\" \"2\") = \"2.0\" ]]\n [[ $(candidate \"10\" \"8\") = \"40.0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "sh", - "prompt": "#!/bin/bash\n# Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n# the last couple centuries. However, what people don't know is Tribonacci sequence.\n# Tribonacci sequence is defined by the recurrence:\n# tri(1) = 3\n# tri(n) = 1 + n / 2, if n is even.\n# tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n# For example:\n# tri(2) = 1 + (2 / 2) = 2\n# tri(4) = 3\n# tri(3) = tri(2) + tri(1) + tri(4)\n# = 2 + 3 + 3 = 8 \n# You are given a non-negative integer number n, you have to a return a list of the \n# first n + 1 numbers of the Tribonacci sequence.\n# Examples:\n# >>> $(tri \"3\")\n# ['\"1\"', '\"3\"', '\"2\"', '\"8\"']\n#\n# $1 is an integer\ntri() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n tri \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3\") = \"1 3 2 8\" ]]\n [[ $(candidate \"4\") = \"1 3 2 8 3\" ]]\n [[ $(candidate \"5\") = \"1 3 2 8 3 15\" ]]\n [[ $(candidate \"6\") = \"1 3 2 8 3 15 4\" ]]\n [[ $(candidate \"7\") = \"1 3 2 8 3 15 4 24\" ]]\n [[ $(candidate \"8\") = \"1 3 2 8 3 15 4 24 5\" ]]\n [[ $(candidate \"9\") = \"1 3 2 8 3 15 4 24 5 35\" ]]\n [[ $(candidate \"20\") = \"1 3 2 8 3 15 4 24 5 35 6 48 7 63 8 80 9 99 10 120 11\" ]]\n [[ $(candidate \"0\") = \"1\" ]]\n [[ $(candidate \"1\") = \"1 3\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a list of two strings, both strings consist of open\n# parentheses '(' or close parentheses ')' only.\n# Your job is to check if it is possible to concatenate the two strings in\n# some order, that the resulting string will be good.\n# A string S is considered to be good if and only if all parentheses in S\n# are balanced. For example: the string '(())()' is good, while the string\n# '())' is not.\n# Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n# Examples:\n# >>> $(match_parens \"()( )\")\n# \"Yes\"\n# >>> $(match_parens \") )\")\n# \"No\"\n#\n# $1 is a space-separated list\nmatch_parens() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n match_parens \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"()( )\") = \"Yes\" ]]\n [[ $(candidate \") )\") = \"No\" ]]\n [[ $(candidate \"(()(()) ())())\") = \"No\" ]]\n [[ $(candidate \")()) (()()(\") = \"Yes\" ]]\n [[ $(candidate \"(()))) (()())((\") = \"Yes\" ]]\n [[ $(candidate \"() ())\") = \"No\" ]]\n [[ $(candidate \"(()( ()))()\") = \"Yes\" ]]\n [[ $(candidate \"(((( ((())\") = \"No\" ]]\n [[ $(candidate \")(() (()(\") = \"No\" ]]\n [[ $(candidate \")( )(\") = \"No\" ]]\n [[ $(candidate \"( )\") = \"Yes\" ]]\n [[ $(candidate \") (\") = \"Yes\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "sh", - "prompt": "#!/bin/bash\n# From a list of integers, remove all elements that occur more than once.\n# Keep order of elements left the same as in the input.\n# >>> $(remove_duplicates \"1 2 3 2 4\")\n# ['\"1\"', '\"3\"', '\"4\"']\n#\n# $1 is a space-separated list\nremove_duplicates() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n remove_duplicates \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"1 2 3 4\") = \"1 2 3 4\" ]]\n [[ $(candidate \"1 2 3 2 4 3 5\") = \"1 4 5\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "sh", - "prompt": "#!/bin/bash\n# Return a greatest common divisor of two integers a and b\n# >>> $(greatest_common_divisor \"3\" \"5\")\n# \"1\"\n# >>> $(greatest_common_divisor \"25\" \"15\")\n# \"5\"\n#\n# $1 is an integer\n# $2 is an integer\ngreatest_common_divisor() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n greatest_common_divisor \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3\" \"7\") = \"1\" ]]\n [[ $(candidate \"10\" \"15\") = \"5\" ]]\n [[ $(candidate \"49\" \"14\") = \"7\" ]]\n [[ $(candidate \"144\" \"60\") = \"12\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "sh", - "prompt": "#!/bin/bash\n# Checks if given string is a palindrome\n# >>> $(is_palindrome \"\")\n# \"true\"\n# >>> $(is_palindrome \"aba\")\n# \"true\"\n# >>> $(is_palindrome \"aaaaa\")\n# \"true\"\n# >>> $(is_palindrome \"zbcd\")\n# \"false\"\n#\n# $1 is a string\nis_palindrome() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n is_palindrome \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"true\" ]]\n [[ $(candidate \"aba\") = \"true\" ]]\n [[ $(candidate \"aaaaa\") = \"true\" ]]\n [[ $(candidate \"zbcd\") = \"false\" ]]\n [[ $(candidate \"xywyx\") = \"true\" ]]\n [[ $(candidate \"xywyz\") = \"false\" ]]\n [[ $(candidate \"xywzx\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "sh", - "prompt": "#!/bin/bash\n# xs represent coefficients of a polynomial.\n# xs[0] + xs[1] * x + xs[2] * x^2 + ....\n# Return derivative of this polynomial in the same form.\n# >>> $(derivative \"3 1 2 4 5\")\n# ['\"1\"', '\"4\"', '\"12\"', '\"20\"']\n# >>> $(derivative \"1 2 3\")\n# ['\"2\"', '\"6\"']\n#\n# $1 is a space-separated list\nderivative() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n derivative \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3 1 2 4 5\") = \"1 4 12 20\" ]]\n [[ $(candidate \"1 2 3\") = \"2 6\" ]]\n [[ $(candidate \"3 2 1\") = \"2 2\" ]]\n [[ $(candidate \"3 2 1 0 4\") = \"2 2 0 16\" ]]\n [[ $(candidate \"1\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "sh", - "prompt": "#!/bin/bash\n# In this task, you will be given a string that represents a number of apples and oranges \n# that are distributed in a basket of fruit this basket contains \n# apples, oranges, and mango fruits. Given the string that represents the total number of \n# the oranges and apples and an integer that represent the total number of the fruits \n# in the basket return the number of the mango fruits in the basket.\n# for examble:\n# >>> $(fruit_distribution \"5 apples and 6 oranges\" \"19\")\n# \"8\"\n# >>> $(fruit_distribution \"0 apples and 1 oranges\" \"3\")\n# \"2\"\n# >>> $(fruit_distribution \"2 apples and 3 oranges\" \"100\")\n# \"95\"\n# >>> $(fruit_distribution \"100 apples and 1 oranges\" \"120\")\n# \"19\"\n#\n# $1 is a string\n# $2 is an integer\nfruit_distribution() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n fruit_distribution \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5 apples and 6 oranges\" \"19\") = \"8\" ]]\n [[ $(candidate \"5 apples and 6 oranges\" \"21\") = \"10\" ]]\n [[ $(candidate \"0 apples and 1 oranges\" \"3\") = \"2\" ]]\n [[ $(candidate \"1 apples and 0 oranges\" \"3\") = \"2\" ]]\n [[ $(candidate \"2 apples and 3 oranges\" \"100\") = \"95\" ]]\n [[ $(candidate \"2 apples and 3 oranges\" \"5\") = \"0\" ]]\n [[ $(candidate \"1 apples and 100 oranges\" \"120\") = \"19\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that takes an integer a and returns true \n# if this ingeger is a cube of some integer number.\n# Note: you may assume the input is always valid.\n# Examples:\n# >>> $(iscube \"1\")\n# \"true\"\n# >>> $(iscube \"2\")\n# \"false\"\n# >>> $(iscube \"-1\")\n# \"true\"\n# >>> $(iscube \"64\")\n# \"true\"\n# >>> $(iscube \"0\")\n# \"true\"\n# >>> $(iscube \"180\")\n# \"false\"\n#\n# $1 is an integer\niscube() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n iscube \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1\") = \"true\" ]]\n [[ $(candidate \"2\") = \"false\" ]]\n [[ $(candidate \"-1\") = \"true\" ]]\n [[ $(candidate \"64\") = \"true\" ]]\n [[ $(candidate \"180\") = \"false\" ]]\n [[ $(candidate \"1000\") = \"true\" ]]\n [[ $(candidate \"0\") = \"true\" ]]\n [[ $(candidate \"1729\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "sh", - "prompt": "#!/bin/bash\n# In this Kata, you have to sort an array of non-negative integers according to\n# number of ones in their binary representation in ascending order.\n# For similar number of ones, sort based on decimal value.\n# It must be implemented like this:\n# >>> $(sort_array \"1 5 2 3 4\")\n# ['\"1\"', '\"2\"', '\"3\"', '\"4\"', '\"5\"']\n# >>> $(sort_array \"-2 -3 -4 -5 -6\")\n# ['\"-6\"', '\"-5\"', '\"-4\"', '\"-3\"', '\"-2\"']\n# >>> $(sort_array \"1 0 2 3 4\")\n# ['\"0\"', '\"1\"', '\"2\"', '\"3\"', '\"4\"']\n#\n# $1 is a space-separated list\nsort_array() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n sort_array \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 5 2 3 4\") = \"1 2 4 3 5\" ]]\n [[ $(candidate \"-2 -3 -4 -5 -6\") = \"-4 -2 -6 -5 -3\" ]]\n [[ $(candidate \"1 0 2 3 4\") = \"0 1 2 4 3\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"2 5 77 4 5 3 5 7 2 3 4\") = \"2 2 4 4 3 3 5 5 5 7 77\" ]]\n [[ $(candidate \"3 6 44 12 32 5\") = \"32 3 5 6 12 44\" ]]\n [[ $(candidate \"2 4 8 16 32\") = \"2 4 8 16 32\" ]]\n [[ $(candidate \"2 4 8 16 32\") = \"2 4 8 16 32\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "sh", - "prompt": "#!/bin/bash\n# brackets is a string of \"(\" and \")\".\n# return true if every opening bracket has a corresponding closing bracket.\n# >>> $(correct_bracketing \"(\")\n# \"false\"\n# >>> $(correct_bracketing \"()\")\n# \"true\"\n# >>> $(correct_bracketing \"(()())\")\n# \"true\"\n# >>> $(correct_bracketing \")(()\")\n# \"false\"\n#\n# $1 is a string\ncorrect_bracketing() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n correct_bracketing \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"()\") = \"true\" ]]\n [[ $(candidate \"(()())\") = \"true\" ]]\n [[ $(candidate \"()()(()())()\") = \"true\" ]]\n [[ $(candidate \"()()((()()())())(()()(()))\") = \"true\" ]]\n [[ $(candidate \"((()())))\") = \"false\" ]]\n [[ $(candidate \")(()\") = \"false\" ]]\n [[ $(candidate \"(\") = \"false\" ]]\n [[ $(candidate \"((((\") = \"false\" ]]\n [[ $(candidate \")\") = \"false\" ]]\n [[ $(candidate \"(()\") = \"false\" ]]\n [[ $(candidate \"()()(()())())(()\") = \"false\" ]]\n [[ $(candidate \"()()(()())()))()\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "sh", - "prompt": "#!/bin/bash\n# Task\n# Write a function that takes a string as input and returns the sum of the upper characters only'\n# ASCII codes.\n# Examples:\n# >>> $(digitSum \"\")\n# \"0\"\n# >>> $(digitSum \"abAB\")\n# \"131\"\n# >>> $(digitSum \"abcCd\")\n# \"67\"\n# >>> $(digitSum \"helloE\")\n# \"69\"\n# >>> $(digitSum \"woArBld\")\n# \"131\"\n# >>> $(digitSum \"aAaaaXa\")\n# \"153\"\n#\n# $1 is a string\ndigitSum() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n digitSum \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"0\" ]]\n [[ $(candidate \"abAB\") = \"131\" ]]\n [[ $(candidate \"abcCd\") = \"67\" ]]\n [[ $(candidate \"helloE\") = \"69\" ]]\n [[ $(candidate \"woArBld\") = \"131\" ]]\n [[ $(candidate \"aAaaaXa\") = \"153\" ]]\n [[ $(candidate \" How are yOu?\") = \"151\" ]]\n [[ $(candidate \"You arE Very Smart\") = \"327\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that accepts a list of strings as a parameter,\n# deletes the strings that have odd lengths from it,\n# and returns the resulted list with a sorted order,\n# The list is always a list of strings and never an array of numbers,\n# and it may contain duplicates.\n# The order of the list should be ascending by length of each word, and you\n# should return the list sorted by that rule.\n# If two words have the same length, sort the list alphabetically.\n# The function should return a list of strings in sorted order.\n# You may assume that all words will have the same length.\n# For example:\n# >>> $(list_sort \"aa a aaa\")\n# ['\"aa\"']\n# >>> $(list_sort \"ab a aaa cd\")\n# ['\"ab\"', '\"cd\"']\n#\n# $1 is a space-separated list\nsorted_list_sum() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n sorted_list_sum \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"aa a aaa\") = \"aa\" ]]\n [[ $(candidate \"school AI asdf b\") = \"AI asdf school\" ]]\n [[ $(candidate \"d b c a\") = \"\" ]]\n [[ $(candidate \"d dcba abcd a\") = \"abcd dcba\" ]]\n [[ $(candidate \"AI ai au\") = \"AI ai au\" ]]\n [[ $(candidate \"a b b c c a\") = \"\" ]]\n [[ $(candidate \"aaaa bbbb dd cc\") = \"cc dd aaaa bbbb\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given an array arr of integers and you need to return\n# sum of magnitudes of integers multiplied by product of all signs\n# of each number in the array, represented by 1, -1 or 0.\n# Note: return None for empty arr.\n# Example:\n# >>> $(prod_signs \"1 2 2 -4\")\n# \"9\"\n# >>> $(prod_signs \"0 1\")\n# \"0\"\n# >>> $(prod_signs \"\")\n# \"None\"\n#\n# $1 is a space-separated list\nprod_signs() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n prod_signs \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 2 -4\") = \"-9\" ]]\n [[ $(candidate \"0 1\") = \"0\" ]]\n [[ $(candidate \"1 1 1 2 3 -1 1\") = \"-10\" ]]\n [[ $(candidate \"\") = \"None\" ]]\n [[ $(candidate \"2 4 1 2 -1 -1 9\") = \"20\" ]]\n [[ $(candidate \"-1 1 -1 1\") = \"4\" ]]\n [[ $(candidate \"-1 1 1 1\") = \"-4\" ]]\n [[ $(candidate \"-1 1 1 0\") = \"0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "sh", - "prompt": "#!/bin/bash\n# Return list with elements incremented by 1.\n# >>> $(incr_list \"1 2 3\")\n# ['\"2\"', '\"3\"', '\"4\"']\n# >>> $(incr_list \"5 3 5 2 3 3 9 0 123\")\n# ['\"6\"', '\"4\"', '\"6\"', '\"3\"', '\"4\"', '\"4\"', '\"10\"', '\"1\"', '\"124\"']\n#\n# $1 is a space-separated list\nincr_list() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n incr_list \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"3 2 1\") = \"4 3 2\" ]]\n [[ $(candidate \"5 2 5 2 3 3 9 0 123\") = \"6 3 6 3 4 4 10 1 124\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "sh", - "prompt": "#!/bin/bash\n# From a given list of integers, generate a list of rolling maximum element found until given moment\n# in the sequence.\n# >>> $(rolling_max \"1 2 3 2 3 4 2\")\n# ['\"1\"', '\"2\"', '\"3\"', '\"3\"', '\"3\"', '\"4\"', '\"4\"']\n#\n# $1 is a space-separated list\nrolling_max() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n rolling_max \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"1 2 3 4\") = \"1 2 3 4\" ]]\n [[ $(candidate \"4 3 2 1\") = \"4 4 4 4\" ]]\n [[ $(candidate \"3 2 3 100 3\") = \"3 3 3 100 100\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "sh", - "prompt": "#!/bin/bash\n# Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n# separate those group into separate strings and return the list of those.\n# Separate groups are balanced (each open brace is properly closed) and not nested within each other\n# Ignore any spaces in the input string.\n# >>> $(separate_paren_groups \"( ) (( )) (( )( ))\")\n# ['\"()\"', '\"(())\"', '\"(()())\"']\n#\n# $1 is a string\nseparate_paren_groups() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n separate_paren_groups \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"(()()) ((())) () ((())()())\") = \"(()()) ((())) () ((())()())\" ]]\n [[ $(candidate \"() (()) ((())) (((())))\") = \"() (()) ((())) (((())))\" ]]\n [[ $(candidate \"(()(())((())))\") = \"(()(())((())))\" ]]\n [[ $(candidate \"( ) (( )) (( )( ))\") = \"() (()) (()())\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "sh", - "prompt": "#!/bin/bash\n# You will be given a string of words separated by commas or spaces. Your task is\n# to split the string into words and return an array of the words.\n# For example:\n# >>> $(words_string \"Hi, my name is John\")\n# ['\"Hi\"', '\"my\"', '\"name\"', '\"is\"', '\"John\"']\n# >>> $(words_string \"One, two, three, four, five, six\")\n# ['\"One\"', '\"two\"', '\"three\"', '\"four\"', '\"five\"', '\"six\"']\n#\n# $1 is a string\nwords_string() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n words_string \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Hi, my name is John\") = \"Hi my name is John\" ]]\n [[ $(candidate \"One, two, three, four, five, six\") = \"One two three four five six\" ]]\n [[ $(candidate \"Hi, my name\") = \"Hi my name\" ]]\n [[ $(candidate \"One,, two, three, four, five, six,\") = \"One two three four five six\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"ahmed , gamal\") = \"ahmed gamal\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function that takes integers, floats, or strings representing\n# real numbers, and returns the larger variable in its given variable type.\n# Return None if the values are equal.\n# Note: If a real number is represented as a string, the floating point might be . or ,\n# >>> $(compare_one \"1\" \"2.5\")\n# \"2.5\"\n# >>> $(compare_one \"1\" \"2,3\")\n# \"2,3\"\n# >>> $(compare_one \"5,1\" \"6\")\n# \"6\"\n# >>> $(compare_one \"1\" \"1\")\n# \"None\"\n#\n# $1 is an argument\n# $2 is an argument\ncompare_one() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n compare_one \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1\" \"2\") = \"2\" ]]\n [[ $(candidate \"1\" \"2.5\") = \"2.5\" ]]\n [[ $(candidate \"2\" \"3\") = \"3\" ]]\n [[ $(candidate \"5\" \"6\") = \"6\" ]]\n [[ $(candidate \"1\" \"2,3\") = \"2,3\" ]]\n [[ $(candidate \"5,1\" \"6\") = \"6\" ]]\n [[ $(candidate \"1\" \"2\") = \"2\" ]]\n [[ $(candidate \"1\" \"1\") = \"None\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "sh", - "prompt": "#!/bin/bash\n# Filter given list of any shthon values only for integers\n# >>> $(filter_integers \"a 3.14 5\")\n# ['\"5\"']\n# >>> $(filter_integers \"1 2 3 abc \")\n# ['\"1\"', '\"2\"', '\"3\"']\n#\n# $1 is a space-separated list\nfilter_integers() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n filter_integers \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"4 23.2 9 adasd\") = \"4 9\" ]]\n [[ $(candidate \"3 c 3 3 a b\") = \"3 3 3\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "sh", - "prompt": "#!/bin/bash\n# This function takes a list l and returns a list l' such that\n# l' is identical to l in the odd indicies, while its values at the even indicies are equal\n# to the values of the even indicies of l, but sorted.\n# >>> $(sort_even \"1 2 3\")\n# ['\"1\"', '\"2\"', '\"3\"']\n# >>> $(sort_even \"5 6 3 4\")\n# ['\"3\"', '\"6\"', '\"5\"', '\"4\"']\n#\n# $1 is a space-separated list\nsort_even() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n sort_even \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3\") = \"1 2 3\" ]]\n [[ $(candidate \"5 3 -5 2 -3 3 9 0 123 1 -10\") = \"-10 3 -5 2 -3 3 5 0 9 1 123\" ]]\n [[ $(candidate \"5 8 -12 4 23 2 3 11 12 -10\") = \"-12 8 3 4 5 2 12 11 23 -10\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "sh", - "prompt": "#!/bin/bash\n# I think we all remember that feeling when the result of some long-awaited\n# event is finally known. The feelings and thoughts you have at that moment are\n# definitely worth noting down and comparing.\n# Your task is to determine if a person correctly guessed the results of a number of matches.\n# You are given two arrays of scores and guesses of equal length, where each index shows a match. \n# Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n# the value is 0, and if not, the value is the absolute difference between the guess and the score.\n# example:\n# >>> $(compare \"1 2 3 4 5 1\" \"1 2 3 4 2 -2\")\n# ['\"0\"', '\"0\"', '\"0\"', '\"0\"', '\"3\"', '\"3\"']\n# >>> $(compare \"0 5 0 0 0 4\" \"4 1 1 0 0 -2\")\n# ['\"4\"', '\"4\"', '\"1\"', '\"0\"', '\"0\"', '\"6\"']\n#\n# $1 is a space-separated list\n# $2 is a space-separated list\ncompare() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n compare \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3 4 5 1\" \"1 2 3 4 2 -2\") = \"0 0 0 0 3 3\" ]]\n [[ $(candidate \"0 0 0 0 0 0\" \"0 0 0 0 0 0\") = \"0 0 0 0 0 0\" ]]\n [[ $(candidate \"1 2 3\" \"-1 -2 -3\") = \"2 4 6\" ]]\n [[ $(candidate \"1 2 3 5\" \"-1 2 3 4\") = \"2 0 0 1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a positive integer n, return a list that has the number of even and odd\n# integer palindromes that fall within the range(1, n), inclusive.\n# Example 1:\n# >>> $(even_odd_palindrome \"3\")\n# ['\"1\"', '\"2\"']\n# Explanation:\n# Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n# Example 2:\n# >>> $(even_odd_palindrome \"12\")\n# ['\"4\"', '\"6\"']\n# Explanation:\n# Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n# Note:\n# 1. 1 <= n <= 10^3\n# 2. returned list has the number of even and odd integer palindromes respectively.\n#\n# $1 is an integer\neven_odd_palindrome() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n even_odd_palindrome \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"123\") = \"8 13\" ]]\n [[ $(candidate \"12\") = \"4 6\" ]]\n [[ $(candidate \"3\") = \"1 2\" ]]\n [[ $(candidate \"63\") = \"6 8\" ]]\n [[ $(candidate \"25\") = \"5 6\" ]]\n [[ $(candidate \"19\") = \"4 6\" ]]\n [[ $(candidate \"9\") = \"4 5\" ]]\n [[ $(candidate \"1\") = \"0 1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "sh", - "prompt": "#!/bin/bash\n# The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fib4(0) -> 0\n# fib4(1) -> 0\n# fib4(2) -> 2\n# fib4(3) -> 0\n# fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n# Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n# >>> $(fib4 \"5\")\n# \"4\"\n# >>> $(fib4 \"6\")\n# \"8\"\n# >>> $(fib4 \"7\")\n# \"14\"\n#\n# $1 is an integer\nfib4() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n fib4 \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\") = \"4\" ]]\n [[ $(candidate \"8\") = \"28\" ]]\n [[ $(candidate \"10\") = \"104\" ]]\n [[ $(candidate \"12\") = \"386\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "sh", - "prompt": "#!/bin/bash\n# Given two positive integers a and b, return the even digits between a\n# and b, in ascending order.\n# For example:\n# >>> $(generate_integers \"2\" \"8\")\n# ['\"2\"', '\"4\"', '\"6\"', '\"8\"']\n# >>> $(generate_integers \"8\" \"2\")\n# ['\"2\"', '\"4\"', '\"6\"', '\"8\"']\n# >>> $(generate_integers \"10\" \"14\")\n# []\n#\n# $1 is an integer\n# $2 is an integer\ngenerate_integers() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n generate_integers \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2\" \"10\") = \"2 4 6 8\" ]]\n [[ $(candidate \"10\" \"2\") = \"2 4 6 8\" ]]\n [[ $(candidate \"132\" \"2\") = \"2 4 6 8\" ]]\n [[ $(candidate \"17\" \"89\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "sh", - "prompt": "#!/bin/bash\n# For a given list of input numbers, calculate Mean Absolute Deviation\n# around the mean of this dataset.\n# Mean Absolute Deviation is the average absolute difference between each\n# element and a centerpoint (mean in this case):\n# MAD = average | x - x_mean |\n# >>> $(mean_absolute_deviation \"1.0 2.0 3.0 4.0\")\n# \"1.0\"\n#\n# $1 is a space-separated list\nmean_absolute_deviation() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n mean_absolute_deviation \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1.0 2.0\") = \"0.5\" ]]\n [[ $(candidate \"1.0 2.0 3.0 4.0\") = \"1.0\" ]]\n [[ $(candidate \"1.0 2.0 3.0 4.0 5.0\") = \"1.2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function encrypt that takes a string as an argument and\n# returns a string encrypted with the alphabet being rotated. \n# The alphabet should be rotated in a manner such that the letters \n# shift down by two multiplied to two places.\n# For example:\n# >>> $(encrypt \"hi\")\n# \"lm\"\n# >>> $(encrypt \"asdfghjkl\")\n# \"ewhjklnop\"\n# >>> $(encrypt \"gf\")\n# \"kj\"\n# >>> $(encrypt \"et\")\n# \"ix\"\n#\n# $1 is a string\nencrypt() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n encrypt \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"hi\") = \"lm\" ]]\n [[ $(candidate \"asdfghjkl\") = \"ewhjklnop\" ]]\n [[ $(candidate \"gf\") = \"kj\" ]]\n [[ $(candidate \"et\") = \"ix\" ]]\n [[ $(candidate \"faewfawefaewg\") = \"jeiajeaijeiak\" ]]\n [[ $(candidate \"hellomyfriend\") = \"lippsqcjvmirh\" ]]\n [[ $(candidate \"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\") = \"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\" ]]\n [[ $(candidate \"a\") = \"e\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n# The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n# as follows: start with any positive integer n. Then each term is obtained from the \n# previous term as follows: if the previous term is even, the next term is one half of \n# the previous term. If the previous term is odd, the next term is 3 times the previous\n# term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n# Note: \n# 1. Collatz(1) is [1].\n# 2. returned list sorted in increasing order.\n# For example:\n# get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n# >>> $(get_odd_collatz \"5\")\n# ['\"1\"', '\"5\"']\n#\n# $1 is an integer\nget_odd_collatz() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n get_odd_collatz \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"14\") = \"1 5 7 11 13 17\" ]]\n [[ $(candidate \"5\") = \"1 5\" ]]\n [[ $(candidate \"12\") = \"1 3 5\" ]]\n [[ $(candidate \"1\") = \"1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "sh", - "prompt": "#!/bin/bash\n# Find how many times a given substring can be found in the original string. Count overlaping cases.\n# >>> $(how_many_times \"\" \"a\")\n# \"0\"\n# >>> $(how_many_times \"aaa\" \"a\")\n# \"3\"\n# >>> $(how_many_times \"aaaa\" \"aa\")\n# \"3\"\n#\n# $1 is a string\n# $2 is a string\nhow_many_times() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n how_many_times \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\" \"x\") = \"0\" ]]\n [[ $(candidate \"xyxyxyx\" \"x\") = \"4\" ]]\n [[ $(candidate \"cacacacac\" \"cac\") = \"4\" ]]\n [[ $(candidate \"john doe\" \"john\") = \"1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "sh", - "prompt": "#!/bin/bash\n# We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n# numbers in the array will be randomly ordered. Your task is to determine if\n# it is possible to get an array sorted in non-decreasing order by performing \n# the following operation on the given array:\n# You are allowed to perform right shift operation any number of times.\n# One right shift operation means shifting all elements of the array by one\n# position in the right direction. The last element of the array will be moved to\n# the starting position in the array i.e. 0th index. \n# If it is possible to obtain the sorted array by performing the above operation\n# then return true else return false.\n# If the given array is empty then return true.\n# Note: The given list is guaranteed to have unique elements.\n# For Example:\n# >>> $(move_one_ball \"3 4 5 1 2\")\n# \"true\"\n# Explanation: By performin 2 right shift operations, non-decreasing order can\n# be achieved for the given array.\n# >>> $(move_one_ball \"3 5 4 1 2\")\n# \"false\"\n# Explanation:It is not possible to get non-decreasing order for the given\n# array by performing any number of right shift operations.\n#\n# $1 is a space-separated list\nmove_one_ball() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n move_one_ball \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3 4 5 1 2\") = \"true\" ]]\n [[ $(candidate \"3 5 10 1 2\") = \"true\" ]]\n [[ $(candidate \"4 3 1 2\") = \"false\" ]]\n [[ $(candidate \"3 5 4 1 2\") = \"false\" ]]\n [[ $(candidate \"\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function which sorts the given list of integers\n# in ascending order according to the sum of their digits.\n# Note: if there are several items with similar sum of their digits,\n# order them based on their index in original list.\n# For example:\n# >>> $(order_by_points \"1 11 -1 -11 -12\")\n# ['\"-1\"', '\"-11\"', '\"1\"', '\"-12\"', '\"11\"']\n# >>> $(order_by_points \"\")\n# []\n#\n# $1 is a space-separated list\norder_by_points() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n order_by_points \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 11 -1 -11 -12\") = \"-1 -11 1 -12 11\" ]]\n [[ $(candidate \"1234 423 463 145 2 423 423 53 6 37 3457 3 56 0 46\") = \"0 2 3 6 53 423 423 423 1234 145 37 46 56 463 3457\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"1 -11 -32 43 54 -98 2 -3\") = \"-3 -32 -98 -11 1 2 43 54\" ]]\n [[ $(candidate \"1 2 3 4 5 6 7 8 9 10 11\") = \"1 10 2 11 3 4 5 6 7 8 9\" ]]\n [[ $(candidate \"0 6 6 -76 -21 23 4\") = \"-76 -21 0 4 23 6 6\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "sh", - "prompt": "#!/bin/bash\n# Return list of prime factors of given integer in the order from smallest to largest.\n# Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n# Input number should be equal to the product of all factors\n# >>> $(factorize \"8\")\n# ['\"2\"', '\"2\"', '\"2\"']\n# >>> $(factorize \"25\")\n# ['\"5\"', '\"5\"']\n# >>> $(factorize \"70\")\n# ['\"2\"', '\"5\"', '\"7\"']\n#\n# $1 is an integer\nfactorize() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n factorize \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2\") = \"2\" ]]\n [[ $(candidate \"4\") = \"2 2\" ]]\n [[ $(candidate \"8\") = \"2 2 2\" ]]\n [[ $(candidate \"57\") = \"3 19\" ]]\n [[ $(candidate \"3249\") = \"3 3 19 19\" ]]\n [[ $(candidate \"185193\") = \"3 3 3 19 19 19\" ]]\n [[ $(candidate \"20577\") = \"3 19 19 19\" ]]\n [[ $(candidate \"18\") = \"2 3 3\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "sh", - "prompt": "#!/bin/bash\n# Return true if all numbers in the list l are below threshold t.\n# >>> $(below_threshold \"1 2 4 10\" \"100\")\n# \"true\"\n# >>> $(below_threshold \"1 20 4 10\" \"5\")\n# \"false\"\n#\n# $1 is a space-separated list\n# $2 is an integer\nbelow_threshold() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n below_threshold \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 4 10\" \"100\") = \"true\" ]]\n [[ $(candidate \"1 20 4 10\" \"5\") = \"false\" ]]\n [[ $(candidate \"1 20 4 10\" \"21\") = \"true\" ]]\n [[ $(candidate \"1 20 4 10\" \"22\") = \"true\" ]]\n [[ $(candidate \"1 8 4 10\" \"11\") = \"true\" ]]\n [[ $(candidate \"1 8 4 10\" \"10\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given two positive integers n and m, and your task is to compute the\n# average of the integers from n through m (including n and m). \n# Round the answer to the nearest integer and convert that to binary.\n# If n is greater than m, return -1.\n# Example:\n# >>> $(rounded_avg \"1\" \"5\")\n# \"0b11\"\n# >>> $(rounded_avg \"7\" \"5\")\n# \"-1\"\n# >>> $(rounded_avg \"10\" \"20\")\n# \"0b1111\"\n# >>> $(rounded_avg \"20\" \"33\")\n# \"0b11010\"\n#\n# $1 is an integer\n# $2 is an integer\nrounded_avg() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n rounded_avg \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1\" \"5\") = \"0b11\" ]]\n [[ $(candidate \"7\" \"13\") = \"0b1010\" ]]\n [[ $(candidate \"964\" \"977\") = \"0b1111001010\" ]]\n [[ $(candidate \"996\" \"997\") = \"0b1111100100\" ]]\n [[ $(candidate \"560\" \"851\") = \"0b1011000010\" ]]\n [[ $(candidate \"185\" \"546\") = \"0b101101110\" ]]\n [[ $(candidate \"362\" \"496\") = \"0b110101101\" ]]\n [[ $(candidate \"350\" \"902\") = \"0b1001110010\" ]]\n [[ $(candidate \"197\" \"233\") = \"0b11010111\" ]]\n [[ $(candidate \"7\" \"5\") = \"-1\" ]]\n [[ $(candidate \"5\" \"1\") = \"-1\" ]]\n [[ $(candidate \"5\" \"5\") = \"0b101\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "sh", - "prompt": "#!/bin/bash\n# Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n# For each of the group, output the deepest level of nesting of parentheses.\n# E.g. (()()) has maximum two levels of nesting while ((())) has three.\n# >>> $(parse_nested_parens \"(()()) ((())) () ((())()())\")\n# ['\"2\"', '\"3\"', '\"1\"', '\"3\"']\n#\n# $1 is a string\nparse_nested_parens() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n parse_nested_parens \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"(()()) ((())) () ((())()())\") = \"2 3 1 3\" ]]\n [[ $(candidate \"() (()) ((())) (((())))\") = \"1 2 3 4\" ]]\n [[ $(candidate \"(()(())((())))\") = \"4\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n# Examples\n# >>> $(solution \"5 8 7 1\")\n# \"12\"\n# >>> $(solution \"3 3 3 3 3\")\n# \"9\"\n# >>> $(solution \"30 13 24 321\")\n# \"0\"\n#\n# $1 is a space-separated list\nsolution() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n solution \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5 8 7 1\") = \"12\" ]]\n [[ $(candidate \"3 3 3 3 3\") = \"9\" ]]\n [[ $(candidate \"30 13 24 321\") = \"0\" ]]\n [[ $(candidate \"5 9\") = \"5\" ]]\n [[ $(candidate \"2 4 8\") = \"0\" ]]\n [[ $(candidate \"30 13 23 32\") = \"23\" ]]\n [[ $(candidate \"3 13 2 9\") = \"3\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a positive integer n. You have to create an integer array a of length n.\n# For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n# Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n# and a[i] + a[j] + a[k] is a multiple of 3.\n# Example :\n# >>> $(get_max_triples \"5\")\n# \"1\"\n# Explanation: \n# a = [1, 3, 7, 13, 21]\n# The only valid triple is (1, 7, 13).\n#\n# $1 is an integer\nget_max_triples() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n get_max_triples \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\") = \"1\" ]]\n [[ $(candidate \"6\") = \"4\" ]]\n [[ $(candidate \"10\") = \"36\" ]]\n [[ $(candidate \"100\") = \"53361\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "sh", - "prompt": "#!/bin/bash\n# There are eight planets in our solar system: the closerst to the Sun \n# is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n# Uranus, Neptune.\n# Write a function that takes two planet names as strings planet1 and planet2. \n# The function should return a list containing all planets whose orbits are \n# located between the orbit of planet1 and the orbit of planet2, sorted by \n# the proximity to the sun. \n# The function should return an empty list if planet1 or planet2\n# are not correct planet names. \n# Examples\n# >>> $(bf \"Jupiter\" \"Neptune\")\n# ['\"Saturn\"', '\"Uranus\"']\n# >>> $(bf \"Earth\" \"Mercury\")\n# \"Venus\"\n# >>> $(bf \"Mercury\" \"Uranus\")\n# ['\"Venus\"', '\"Earth\"', '\"Mars\"', '\"Jupiter\"', '\"Saturn\"']\n#\n# $1 is a string\n# $2 is a string\nbf() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n bf \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Jupiter\" \"Neptune\") = \"Saturn Uranus\" ]]\n [[ $(candidate \"Earth\" \"Mercury\") = \"Venus\" ]]\n [[ $(candidate \"Mercury\" \"Uranus\") = \"Venus Earth Mars Jupiter Saturn\" ]]\n [[ $(candidate \"Neptune\" \"Venus\") = \"Earth Mars Jupiter Saturn Uranus\" ]]\n [[ $(candidate \"Earth\" \"Earth\") = \"\" ]]\n [[ $(candidate \"Mars\" \"Earth\") = \"\" ]]\n [[ $(candidate \"Jupiter\" \"Makemake\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a list of integers.\n# Write a function next_smallest() that returns the 2nd smallest element of the list.\n# Return None if there is no such element.\n# >>> $(next_smallest \"1 2 3 4 5\")\n# \"2\"\n# >>> $(next_smallest \"5 1 4 3 2\")\n# \"2\"\n# >>> $(next_smallest \"\")\n# \"None\"\n# >>> $(next_smallest \"1 1\")\n# \"None\"\n#\n# $1 is a space-separated list\nnext_smallest() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n next_smallest \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3 4 5\") = \"2\" ]]\n [[ $(candidate \"5 1 4 3 2\") = \"2\" ]]\n [[ $(candidate \"\") = \"None\" ]]\n [[ $(candidate \"1 1\") = \"None\" ]]\n [[ $(candidate \"1 1 1 1 0\") = \"1\" ]]\n [[ $(candidate \"1 1\") = \"None\" ]]\n [[ $(candidate \"-35 34 12 -45\") = \"-35\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "sh", - "prompt": "#!/bin/bash\n# Input is a space-delimited string of numberals from 'zero' to 'nine'.\n# Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n# Return the string with numbers sorted from smallest to largest\n# >>> $(sort_numbers \"three one five\")\n# \"one three five\"\n#\n# $1 is a string\nsort_numbers() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n sort_numbers \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"three\") = \"three\" ]]\n [[ $(candidate \"three five nine\") = \"three five nine\" ]]\n [[ $(candidate \"five zero four seven nine eight\") = \"zero four five seven eight nine\" ]]\n [[ $(candidate \"six five four three two one zero\") = \"zero one two three four five six\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given 2 words. You need to return true if the second word or any of its rotations is a substring in the first word\n# >>> $(cycpattern_check \"abcd\" \"abd\")\n# \"false\"\n# >>> $(cycpattern_check \"hello\" \"ell\")\n# \"true\"\n# >>> $(cycpattern_check \"whassup\" \"psus\")\n# \"false\"\n# >>> $(cycpattern_check \"abab\" \"baa\")\n# \"true\"\n# >>> $(cycpattern_check \"efef\" \"eeff\")\n# \"false\"\n# >>> $(cycpattern_check \"himenss\" \"simen\")\n# \"true\"\n#\n# $1 is a string\n# $2 is a string\ncycpattern_check() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n cycpattern_check \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"xyzw\" \"xyw\") = \"false\" ]]\n [[ $(candidate \"yello\" \"ell\") = \"true\" ]]\n [[ $(candidate \"whattup\" \"ptut\") = \"false\" ]]\n [[ $(candidate \"efef\" \"fee\") = \"true\" ]]\n [[ $(candidate \"abab\" \"aabb\") = \"false\" ]]\n [[ $(candidate \"winemtt\" \"tinem\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "sh", - "prompt": "#!/bin/bash\n# You will be given a number in decimal form and your task is to convert it to\n# binary format. The function should return a string, with each character representing a binary\n# number. Each character in the string will be '0' or '1'.\n# There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n# The extra characters are there to help with the format.\n# Examples:\n# >>> $(decimal_to_binary \"15\")\n# \"db1111db\"\n# >>> $(decimal_to_binary \"32\")\n# \"db100000db\"\n#\n# $1 is an integer\ndecimal_to_binary() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n decimal_to_binary \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"0\") = \"db0db\" ]]\n [[ $(candidate \"32\") = \"db100000db\" ]]\n [[ $(candidate \"103\") = \"db1100111db\" ]]\n [[ $(candidate \"15\") = \"db1111db\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "sh", - "prompt": "#!/bin/bash\n# Given an integer. return a list that has the number of even and odd digits respectively.\n# Example:\n# >>> $(even_odd_count \"-12\")\n# ['\"1\"', '\"1\"']\n# >>> $(even_odd_count \"123\")\n# ['\"1\"', '\"2\"']\n#\n# $1 is an integer\neven_odd_count() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n even_odd_count \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"7\") = \"0 1\" ]]\n [[ $(candidate \"-78\") = \"1 1\" ]]\n [[ $(candidate \"3452\") = \"2 2\" ]]\n [[ $(candidate \"346211\") = \"3 3\" ]]\n [[ $(candidate \"-345821\") = \"3 3\" ]]\n [[ $(candidate \"-2\") = \"1 0\" ]]\n [[ $(candidate \"-45347\") = \"2 3\" ]]\n [[ $(candidate \"0\") = \"1 0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that accepts a list of strings.\n# The list contains different words. Return the word with maximum number\n# of unique characters. If multiple strings have maximum number of unique\n# characters, return the one which comes first in lexicographical order.\n# >>> $(find_max \"name of string\")\n# \"string\"\n# >>> $(find_max \"name enam game\")\n# \"enam\"\n# >>> $(find_max \"aaaaaaa bb cc\")\n# \"aaaaaaa\"\n#\n# $1 is a space-separated list\nfind_max() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n find_max \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"name of string\") = \"string\" ]]\n [[ $(candidate \"name enam game\") = \"enam\" ]]\n [[ $(candidate \"aaaaaaa bb cc\") = \"aaaaaaa\" ]]\n [[ $(candidate \"abc cba\") = \"abc\" ]]\n [[ $(candidate \"play this game of footbott\") = \"footbott\" ]]\n [[ $(candidate \"we are gonna rock\") = \"gonna\" ]]\n [[ $(candidate \"we are a mad nation\") = \"nation\" ]]\n [[ $(candidate \"this is a prrk\") = \"this\" ]]\n [[ $(candidate \"b\") = \"b\" ]]\n [[ $(candidate \"play play play\") = \"play\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a positive integer n, return the count of the numbers of n-digit\n# positive integers that start or end with 1.\n#\n# $1 is an integer\nstarts_one_ends() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n starts_one_ends \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1\") = \"1\" ]]\n [[ $(candidate \"2\") = \"18\" ]]\n [[ $(candidate \"3\") = \"180\" ]]\n [[ $(candidate \"4\") = \"1800\" ]]\n [[ $(candidate \"5\") = \"18000\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function that returns a list (a, b), where 'a' is\n# the largest of negative integers, and 'b' is the smallest\n# of positive integers in a list.\n# If there is no negative or positive integers, return them as None.\n# Examples:\n# >>> $(largest_smallest_integers \"2 4 1 3 5 7\")\n# ['\"None\"', '\"1\"']\n# >>> $(largest_smallest_integers \"\")\n# ['\"None\"', '\"None\"']\n# >>> $(largest_smallest_integers \"0\")\n# ['\"None\"', '\"None\"']\n#\n# $1 is a space-separated list\nlargest_smallest_integers() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n largest_smallest_integers \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2 4 1 3 5 7\") = \"None 1\" ]]\n [[ $(candidate \"2 4 1 3 5 7 0\") = \"None 1\" ]]\n [[ $(candidate \"1 3 2 4 5 6 -2\") = \"-2 1\" ]]\n [[ $(candidate \"4 5 3 6 2 7 -7\") = \"-7 2\" ]]\n [[ $(candidate \"7 3 8 4 9 2 5 -9\") = \"-9 2\" ]]\n [[ $(candidate \"\") = \"None None\" ]]\n [[ $(candidate \"0\") = \"None None\" ]]\n [[ $(candidate \"-1 -3 -5 -6\") = \"-1 None\" ]]\n [[ $(candidate \"-1 -3 -5 -6 0\") = \"-1 None\" ]]\n [[ $(candidate \"-6 -4 -4 -3 1\") = \"-3 1\" ]]\n [[ $(candidate \"-6 -4 -4 -3 -100 1\") = \"-3 1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "sh", - "prompt": "#!/bin/bash\n# \"Given an array representing a branch of a tree that has non-negative integer nodes\n# your task is to pluck one of the nodes and return it.\n# The plucked node should be the node with the smallest even value.\n# If multiple nodes with the same smallest even value are found return the node that has smallest index.\n# The plucked node should be returned in a list, [ smalest_value, its index ],\n# If there are no even values or the given array is empty, return [].\n# Example 1:\n# >>> $(pluck \"4 2 3\")\n# ['\"2\"', '\"1\"']\n# Explanation: 2 has the smallest even value, and 2 has the smallest index.\n# Example 2:\n# >>> $(pluck \"1 2 3\")\n# ['\"2\"', '\"1\"']\n# Explanation: 2 has the smallest even value, and 2 has the smallest index.\n# Example 3:\n# >>> $(pluck \"\")\n# []\n# Example 4:\n# >>> $(pluck \"5 0 3 0 4 2\")\n# ['\"0\"', '\"1\"']\n# Explanation: 0 is the smallest value, but there are two zeros,\n# so we will choose the first zero, which has the smallest index.\n# Constraints:\n# * 1 <= nodes.length <= 10000\n# * 0 <= node.value\n#\n# $1 is a space-separated list\npluck() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n pluck \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"4 2 3\") = \"2 1\" ]]\n [[ $(candidate \"1 2 3\") = \"2 1\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"5 0 3 0 4 2\") = \"0 1\" ]]\n [[ $(candidate \"1 2 3 0 5 3\") = \"0 3\" ]]\n [[ $(candidate \"5 4 8 4 8\") = \"4 1\" ]]\n [[ $(candidate \"7 6 7 1\") = \"6 1\" ]]\n [[ $(candidate \"7 9 7 1\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function count_nums which takes an array of integers and returns\n# the number of elements which has a sum of digits > 0.\n# If a number is negative, then its first signed digit will be negative:\n# e.g. -123 has signed digits -1, 2, and 3.\n# >>> $(count_nums \"\")\n# \"0\"\n# >>> $(count_nums \"-1 11 -11\")\n# \"1\"\n# >>> $(count_nums \"1 1 2\")\n# \"3\"\n#\n# $1 is a space-separated list\ncount_nums() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n count_nums \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"0\" ]]\n [[ $(candidate \"-1 -2 0\") = \"0\" ]]\n [[ $(candidate \"1 1 2 -2 3 4 5\") = \"6\" ]]\n [[ $(candidate \"1 6 9 -6 0 1 5\") = \"5\" ]]\n [[ $(candidate \"1 100 98 -7 1 -1\") = \"4\" ]]\n [[ $(candidate \"12 23 34 -45 -56 0\") = \"5\" ]]\n [[ $(candidate \"0 1\") = \"1\" ]]\n [[ $(candidate \"1\") = \"1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n# each cell of the grid contains a value. Every integer in the range [1, N * N]\n# inclusive appears exactly once on the cells of the grid.\n# You have to find the minimum path of length k in the grid. You can start\n# from any cell, and in each step you can move to any of the neighbor cells,\n# in other words, you can go to cells which share an edge with you current\n# cell.\n# Please note that a path of length k means visiting exactly k cells (not\n# necessarily distinct).\n# You CANNOT go off the grid.\n# A path A (of length k) is considered less than a path B (of length k) if\n# after making the ordered lists of the values on the cells that A and B go\n# through (let's call them lst_A and lst_B), lst_A is lexicographically less\n# than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n# such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n# lst_A[j] = lst_B[j].\n# It is guaranteed that the answer is unique.\n# Return an ordered list of the values on the cells that the minimum path go through.\n# Examples: \n# >>> $(minPath \"1 2 3\\n4 5 6\\n7 8 9\" \"3\")\n# ['\"1\"', '\"2\"', '\"1\"']\n# >>> $(minPath \"5 9 3\\n4 1 6\\n7 8 2\" \"1\")\n# ['\"1\"']\n#\n# $1 is a newline-separated, space-separated list\n# $2 is an integer\nminPath() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n minPath \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3\\n4 5 6\\n7 8 9\" \"3\") = \"1 2 1\" ]]\n [[ $(candidate \"5 9 3\\n4 1 6\\n7 8 2\" \"1\") = \"1\" ]]\n [[ $(candidate \"1 2 3 4\\n5 6 7 8\\n9 10 11 12\\n13 14 15 16\" \"4\") = \"1 2 1 2\" ]]\n [[ $(candidate \"6 4 13 10\\n5 7 12 1\\n3 16 11 15\\n8 14 9 2\" \"7\") = \"1 10 1 10 1 10 1\" ]]\n [[ $(candidate \"8 14 9 2\\n6 4 13 15\\n5 7 1 12\\n3 10 11 16\" \"5\") = \"1 7 1 7 1\" ]]\n [[ $(candidate \"11 8 7 2\\n5 16 14 4\\n9 3 15 6\\n12 13 10 1\" \"9\") = \"1 6 1 6 1 6 1 6 1\" ]]\n [[ $(candidate \"12 13 10 1\\n9 3 15 6\\n5 16 14 4\\n11 8 7 2\" \"12\") = \"1 6 1 6 1 6 1 6 1 6 1 6\" ]]\n [[ $(candidate \"2 7 4\\n3 1 5\\n6 8 9\" \"8\") = \"1 3 1 3 1 3 1 3\" ]]\n [[ $(candidate \"6 1 5\\n3 8 9\\n2 7 4\" \"8\") = \"1 5 1 5 1 5 1 5\" ]]\n [[ $(candidate \"1 2\\n3 4\" \"10\") = \"1 2 1 2 1 2 1 2 1 2\" ]]\n [[ $(candidate \"1 3\\n3 2\" \"10\") = \"1 3 1 3 1 3 1 3 1 3\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "sh", - "prompt": "#!/bin/bash\n# Given list of integers, return list in strange order.\n# Strange sorting, is when you start with the minimum value,\n# then maximum of the remaining integers, then minimum and so on.\n# Examples:\n# >>> $(strange_sort_list \"1 2 3 4\")\n# ['\"1\"', '\"4\"', '\"2\"', '\"3\"']\n# >>> $(strange_sort_list \"5 5 5 5\")\n# ['\"5\"', '\"5\"', '\"5\"', '\"5\"']\n# >>> $(strange_sort_list \"\")\n# []\n#\n# $1 is a space-separated list\nstrange_sort_list() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n strange_sort_list \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3 4\") = \"1 4 2 3\" ]]\n [[ $(candidate \"5 6 7 8 9\") = \"5 9 6 8 7\" ]]\n [[ $(candidate \"1 2 3 4 5\") = \"1 5 2 4 3\" ]]\n [[ $(candidate \"5 6 7 8 9 1\") = \"1 9 5 8 6 7\" ]]\n [[ $(candidate \"5 5 5 5\") = \"5 5 5 5\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"1 2 3 4 5 6 7 8\") = \"1 8 2 7 3 6 4 5\" ]]\n [[ $(candidate \"0 2 2 2 5 5 -5 -5\") = \"-5 5 -5 5 0 2 2 2\" ]]\n [[ $(candidate \"111111\") = \"111111\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a string 'text', return its md5 hash equivalent string.\n# If 'text' is an empty string, return None.\n# >>> $(string_to_md5 \"Hello world\")\n# \"3e25960a79dbc69b674cd4ec67a72c62\"\n#\n# $1 is a string\nstring_to_md5() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n string_to_md5 \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Hello world\") = \"3e25960a79dbc69b674cd4ec67a72c62\" ]]\n [[ $(candidate \"\") = \"None\" ]]\n [[ $(candidate \"A B C\") = \"0ef78513b0cb8cef12743f5aeb35f888\" ]]\n [[ $(candidate \"password\") = \"5f4dcc3b5aa765d61d8327deb882cf99\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a word. Your task is to find the closest vowel that stands between \n# two consonants from the right side of the word (case sensitive).\n# Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n# find any vowel met the above condition. \n# You may assume that the given string contains English letter only.\n# Example:\n# >>> $(get_closest_vowel \"yogurt\")\n# \"u\"\n# >>> $(get_closest_vowel \"FULL\")\n# \"U\"\n# >>> $(get_closest_vowel \"quick\")\n# \"\"\n# >>> $(get_closest_vowel \"ab\")\n# \"\"\n#\n# $1 is a string\nget_closest_vowel() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n get_closest_vowel \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"yogurt\") = \"u\" ]]\n [[ $(candidate \"full\") = \"u\" ]]\n [[ $(candidate \"easy\") = \"\" ]]\n [[ $(candidate \"eAsy\") = \"\" ]]\n [[ $(candidate \"ali\") = \"\" ]]\n [[ $(candidate \"bad\") = \"a\" ]]\n [[ $(candidate \"most\") = \"o\" ]]\n [[ $(candidate \"ab\") = \"\" ]]\n [[ $(candidate \"ba\") = \"\" ]]\n [[ $(candidate \"quick\") = \"\" ]]\n [[ $(candidate \"anime\") = \"i\" ]]\n [[ $(candidate \"Asia\") = \"\" ]]\n [[ $(candidate \"Above\") = \"o\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "sh", - "prompt": "#!/bin/bash\n# Change numerical base of input number x to base.\n# return string representation after the conversion.\n# base numbers are less than 10.\n# >>> $(change_base \"8\" \"3\")\n# \"22\"\n# >>> $(change_base \"8\" \"2\")\n# \"1000\"\n# >>> $(change_base \"7\" \"2\")\n# \"111\"\n#\n# $1 is an integer\n# $2 is an integer\nchange_base() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n change_base \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"8\" \"3\") = \"22\" ]]\n [[ $(candidate \"9\" \"3\") = \"100\" ]]\n [[ $(candidate \"234\" \"2\") = \"11101010\" ]]\n [[ $(candidate \"16\" \"2\") = \"10000\" ]]\n [[ $(candidate \"8\" \"2\") = \"1000\" ]]\n [[ $(candidate \"7\" \"2\") = \"111\" ]]\n [[ $(candidate \"2\" \"3\") = \"2\" ]]\n [[ $(candidate \"3\" \"4\") = \"3\" ]]\n [[ $(candidate \"4\" \"5\") = \"4\" ]]\n [[ $(candidate \"5\" \"6\") = \"5\" ]]\n [[ $(candidate \"6\" \"7\") = \"6\" ]]\n [[ $(candidate \"7\" \"8\") = \"7\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "sh", - "prompt": "#!/bin/bash\n# Check if in given list of numbers, are any two numbers closer to each other than\n# given threshold.\n# >>> $(has_close_elements \"1.0 2.0 3.0\" \"0.5\")\n# \"false\"\n# >>> $(has_close_elements \"1.0 2.8 3.0 4.0 5.0 2.0\" \"0.3\")\n# \"true\"\n#\n# $1 is a space-separated list\n# $2 is a floating point\nhas_close_elements() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n has_close_elements \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1.0 2.0 3.9 4.0 5.0 2.2\" \"0.3\") = \"true\" ]]\n [[ $(candidate \"1.0 2.0 3.9 4.0 5.0 2.2\" \"0.05\") = \"false\" ]]\n [[ $(candidate \"1.0 2.0 5.9 4.0 5.0\" \"0.95\") = \"true\" ]]\n [[ $(candidate \"1.0 2.0 5.9 4.0 5.0\" \"0.8\") = \"false\" ]]\n [[ $(candidate \"1.0 2.0 3.0 4.0 5.0 2.0\" \"0.1\") = \"true\" ]]\n [[ $(candidate \"1.1 2.2 3.1 4.1 5.1\" \"1.0\") = \"true\" ]]\n [[ $(candidate \"1.1 2.2 3.1 4.1 5.1\" \"0.5\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function that takes a string as input which contains only square brackets.\n# The function should return true if and only if there is a valid subsequence of brackets \n# where at least one bracket in the subsequence is nested.\n# >>> $(is_nested \"[[]]\")\n# \"true\"\n# >>> $(is_nested \"[]]]]]]][[[[[]\")\n# \"false\"\n# >>> $(is_nested \"[][]\")\n# \"false\"\n# >>> $(is_nested \"[]\")\n# \"false\"\n# >>> $(is_nested \"[[][]]\")\n# \"true\"\n# >>> $(is_nested \"[[]][[\")\n# \"true\"\n#\n# $1 is a string\nis_nested() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n is_nested \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"[[]]\") = \"true\" ]]\n [[ $(candidate \"[]]]]]]][[[[[]\") = \"false\" ]]\n [[ $(candidate \"[][]\") = \"false\" ]]\n [[ $(candidate \"[]\") = \"false\" ]]\n [[ $(candidate \"[[[[]]]]\") = \"true\" ]]\n [[ $(candidate \"[]]]]]]]]]]\") = \"false\" ]]\n [[ $(candidate \"[][][[]]\") = \"true\" ]]\n [[ $(candidate \"[[]\") = \"false\" ]]\n [[ $(candidate \"[]]\") = \"false\" ]]\n [[ $(candidate \"[[]][[\") = \"true\" ]]\n [[ $(candidate \"[[][]]\") = \"true\" ]]\n [[ $(candidate \"\") = \"false\" ]]\n [[ $(candidate \"[[[[[[[[\") = \"false\" ]]\n [[ $(candidate \"]]]]]]]]\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "sh", - "prompt": "#!/bin/bash\n# Concatenate list of strings into a single string\n# >>> $(concatenate \"\")\n# \"\"\n# >>> $(concatenate \"a b c\")\n# \"abc\"\n#\n# $1 is a space-separated list\nconcatenate() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n concatenate \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"x y z\") = \"xyz\" ]]\n [[ $(candidate \"x y z w k\") = \"xyzwk\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "sh", - "prompt": "#!/bin/bash\n# prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n# >>> $(prime_fib \"1\")\n# \"2\"\n# >>> $(prime_fib \"2\")\n# \"3\"\n# >>> $(prime_fib \"3\")\n# \"5\"\n# >>> $(prime_fib \"4\")\n# \"13\"\n# >>> $(prime_fib \"5\")\n# \"89\"\n#\n# $1 is an integer\nprime_fib() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n prime_fib \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1\") = \"2\" ]]\n [[ $(candidate \"2\") = \"3\" ]]\n [[ $(candidate \"3\") = \"5\" ]]\n [[ $(candidate \"4\") = \"13\" ]]\n [[ $(candidate \"5\") = \"89\" ]]\n [[ $(candidate \"6\") = \"233\" ]]\n [[ $(candidate \"7\") = \"1597\" ]]\n [[ $(candidate \"8\") = \"28657\" ]]\n [[ $(candidate \"9\") = \"514229\" ]]\n [[ $(candidate \"10\") = \"433494437\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "sh", - "prompt": "#!/bin/bash\n# From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n# other and return them in order (smaller number, larger number).\n# >>> $(find_closest_elements \"1.0 2.0 3.0 4.0 5.0 2.2\")\n# ['\"2.0\"', '\"2.2\"']\n# >>> $(find_closest_elements \"1.0 2.0 3.0 4.0 5.0 2.0\")\n# ['\"2.0\"', '\"2.0\"']\n#\n# $1 is a space-separated list\nfind_closest_elements() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n find_closest_elements \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1.0 2.0 3.9 4.0 5.0 2.2\") = \"3.9 4.0\" ]]\n [[ $(candidate \"1.0 2.0 5.9 4.0 5.0\") = \"5.0 5.9\" ]]\n [[ $(candidate \"1.0 2.0 3.0 4.0 5.0 2.2\") = \"2.0 2.2\" ]]\n [[ $(candidate \"1.0 2.0 3.0 4.0 5.0 2.0\") = \"2.0 2.0\" ]]\n [[ $(candidate \"1.1 2.2 3.1 4.1 5.1\") = \"2.2 3.1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "sh", - "prompt": "#!/bin/bash\n# You have been tasked to write a function that receives \n# a hexadecimal number as a string and counts the number of hexadecimal \n# digits that are primes (prime number, or a prime, is a natural number \n# greater than 1 that is not a product of two smaller natural numbers).\n# Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n# Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n# So you have to determine a number of the following digits: 2, 3, 5, 7, \n# B (=decimal 11), D (=decimal 13).\n# Note: you may assume the input is always correct or empty string, \n# and symbols A,B,C,D,E,F are always uppercase.\n# Examples:\n# >>> $(hex_key \"AB\")\n# \"1\"\n# >>> $(hex_key \"1077E\")\n# \"2\"\n# >>> $(hex_key \"ABED1A33\")\n# \"4\"\n# >>> $(hex_key \"123456789ABCDEF0\")\n# \"6\"\n# >>> $(hex_key \"2020\")\n# \"2\"\n#\n# $1 is a string\nhex_key() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n hex_key \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"AB\") = \"1\" ]]\n [[ $(candidate \"1077E\") = \"2\" ]]\n [[ $(candidate \"ABED1A33\") = \"4\" ]]\n [[ $(candidate \"2020\") = \"2\" ]]\n [[ $(candidate \"123456789ABCDEF0\") = \"6\" ]]\n [[ $(candidate \"112233445566778899AABBCCDDEEFF00\") = \"12\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "sh", - "prompt": "#!/bin/bash\n# Complete the function that takes two integers and returns \n# the product of their unit digits.\n# Assume the input is always valid.\n# Examples:\n# >>> $(multiply \"148\" \"412\")\n# \"16\"\n# >>> $(multiply \"19\" \"28\")\n# \"72\"\n# >>> $(multiply \"2020\" \"1851\")\n# \"0\"\n# >>> $(multiply \"14\" \"-15\")\n# \"20\"\n#\n# $1 is an integer\n# $2 is an integer\nmultiply() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n multiply \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"148\" \"412\") = \"16\" ]]\n [[ $(candidate \"19\" \"28\") = \"72\" ]]\n [[ $(candidate \"2020\" \"1851\") = \"0\" ]]\n [[ $(candidate \"14\" \"-15\") = \"20\" ]]\n [[ $(candidate \"76\" \"67\") = \"42\" ]]\n [[ $(candidate \"17\" \"27\") = \"49\" ]]\n [[ $(candidate \"0\" \"1\") = \"0\" ]]\n [[ $(candidate \"0\" \"0\") = \"0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "sh", - "prompt": "#!/bin/bash\n# Given list of numbers (of at least two elements), apply a linear transform to that list,\n# such that the smallest number will become 0 and the largest will become 1\n# >>> $(rescale_to_unit \"1.0 2.0 3.0 4.0 5.0\")\n# ['\"0.0\"', '\"0.25\"', '\"0.5\"', '\"0.75\"', '\"1.0\"']\n#\n# $1 is a space-separated list\nrescale_to_unit() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n rescale_to_unit \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2.0 49.9\") = \"0.0 1.0\" ]]\n [[ $(candidate \"100.0 49.9\") = \"1.0 0.0\" ]]\n [[ $(candidate \"1.0 2.0 3.0 4.0 5.0\") = \"0.0 0.25 0.5 0.75 1.0\" ]]\n [[ $(candidate \"2.0 1.0 5.0 3.0 4.0\") = \"0.25 0.0 1.0 0.5 0.75\" ]]\n [[ $(candidate \"12.0 11.0 15.0 13.0 14.0\") = \"0.25 0.0 1.0 0.5 0.75\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a positive integer n, return the product of the odd digits.\n# Return 0 if all digits are even.\n# For example:\n# >>> $(digits \"1\")\n# \"1\"\n# >>> $(digits \"4\")\n# \"0\"\n# >>> $(digits \"235\")\n# \"15\"\n#\n# $1 is an integer\ndigits() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n digits \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\") = \"5\" ]]\n [[ $(candidate \"54\") = \"5\" ]]\n [[ $(candidate \"120\") = \"1\" ]]\n [[ $(candidate \"5014\") = \"5\" ]]\n [[ $(candidate \"98765\") = \"315\" ]]\n [[ $(candidate \"5576543\") = \"2625\" ]]\n [[ $(candidate \"2468\") = \"0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "sh", - "prompt": "#!/bin/bash\n# You will be given the name of a class (a string) and a list of extensions.\n# The extensions are to be used to load additional classes to the class. The\n# strength of the extension is as follows: Let CAP be the number of the uppercase\n# letters in the extension's name, and let SM be the number of lowercase letters \n# in the extension's name, the strength is given by the fraction CAP - SM. \n# You should find the strongest extension and return a string in this \n# format: ClassName.StrongestExtensionName.\n# If there are two or more extensions with the same strength, you should\n# choose the one that comes first in the list.\n# For example, if you are given \"Slices\" as the class and a list of the\n# extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n# return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n# (its strength is -1).\n# Example:\n# >>> $(Strongest_Extension \"my_class\" \"AA Be CC\")\n# \"my_class.AA\"\n#\n# $1 is a string\n# $2 is a space-separated list\nStrongest_Extension() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n Strongest_Extension \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Watashi\" \"tEN niNE eIGHt8OKe\") = \"Watashi.eIGHt8OKe\" ]]\n [[ $(candidate \"Boku123\" \"nani NazeDa YEs.WeCaNe 32145tggg\") = \"Boku123.YEs.WeCaNe\" ]]\n [[ $(candidate \"__YESIMHERE\" \"t eMptY nothing zeR00 NuLl__ 123NoooneB321\") = \"__YESIMHERE.NuLl__\" ]]\n [[ $(candidate \"K\" \"Ta TAR t234An cosSo\") = \"K.TAR\" ]]\n [[ $(candidate \"__HAHA\" \"Tab 123 781345 -_-\") = \"__HAHA.123\" ]]\n [[ $(candidate \"YameRore\" \"HhAas okIWILL123 WorkOut Fails -_-\") = \"YameRore.okIWILL123\" ]]\n [[ $(candidate \"finNNalLLly\" \"Die NowW Wow WoW\") = \"finNNalLLly.WoW\" ]]\n [[ $(candidate \"_\" \"Bb 91245\") = \"_.Bb\" ]]\n [[ $(candidate \"Sp\" \"671235 Bb\") = \"Sp.671235\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a string representing a space separated lowercase letters, return a CSV\n# of the letter with the most repetition and containing the corresponding count.\n# If several letters have the same occurrence, return all of them.\n# Example:\n# >>> $(histogram \"a b c\")\n# {'\"a\"': '\"1\"', '\"b\"': '\"1\"', '\"c\"': '\"1\"'}\n# >>> $(histogram \"a b b a\")\n# {'\"a\"': '\"2\"', '\"b\"': '\"2\"'}\n# >>> $(histogram \"a b c a b\")\n# {'\"a\"': '\"2\"', '\"b\"': '\"2\"'}\n# >>> $(histogram \"b b b b a\")\n# {'\"b\"': '\"4\"'}\n# >>> $(histogram \"\")\n# {}\n#\n# $1 is a string\nhistogram() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n histogram \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"a b b a\") = \"a,2\\nb,2\" ]]\n [[ $(candidate \"a b c a b\") = \"a,2\\nb,2\" ]]\n [[ $(candidate \"a b c d g\") = \"a,1\\nb,1\\nc,1\\nd,1\\ng,1\" ]]\n [[ $(candidate \"r t g\") = \"r,1\\nt,1\\ng,1\" ]]\n [[ $(candidate \"b b b b a\") = \"b,4\" ]]\n [[ $(candidate \"r t g\") = \"r,1\\nt,1\\ng,1\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"a\") = \"a,1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "sh", - "prompt": "#!/bin/bash\n# pairs_sum_to_zero takes a list of integers as an input.\n# it returns true if there are two distinct elements in the list that\n# sum to zero, and false otherwise.\n# >>> $(pairs_sum_to_zero \"1 3 5 0\")\n# \"false\"\n# >>> $(pairs_sum_to_zero \"1 3 -2 1\")\n# \"false\"\n# >>> $(pairs_sum_to_zero \"1 2 3 7\")\n# \"false\"\n# >>> $(pairs_sum_to_zero \"2 4 -5 3 5 7\")\n# \"true\"\n# >>> $(pairs_sum_to_zero \"1\")\n# \"false\"\n#\n# $1 is a space-separated list\npairs_sum_to_zero() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n pairs_sum_to_zero \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 3 5 0\") = \"false\" ]]\n [[ $(candidate \"1 3 -2 1\") = \"false\" ]]\n [[ $(candidate \"1 2 3 7\") = \"false\" ]]\n [[ $(candidate \"2 4 -5 3 5 7\") = \"true\" ]]\n [[ $(candidate \"1\") = \"false\" ]]\n [[ $(candidate \"-3 9 -1 3 2 30\") = \"true\" ]]\n [[ $(candidate \"-3 9 -1 3 2 31\") = \"true\" ]]\n [[ $(candidate \"-3 9 -1 4 2 30\") = \"false\" ]]\n [[ $(candidate \"-3 9 -1 4 2 31\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that accepts two lists of strings and returns the list that has \n# total number of chars in the all strings of the list less than the other list.\n# if the two lists have the same number of chars, return the first list.\n# Examples\n# >>> $(total_match \"\" \"\")\n# []\n# >>> $(total_match \"hi admin\" \"hI Hi\")\n# ['\"hI\"', '\"Hi\"']\n# >>> $(total_match \"hi admin\" \"hi hi admin project\")\n# ['\"hi\"', '\"admin\"']\n# >>> $(total_match \"hi admin\" \"hI hi hi\")\n# ['\"hI\"', '\"hi\"', '\"hi\"']\n# >>> $(total_match \"4\" \"1 2 3 4 5\")\n# ['\"4\"']\n#\n# $1 is a space-separated list\n# $2 is a space-separated list\ntotal_match() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n total_match \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\" \"\") = \"\" ]]\n [[ $(candidate \"hi admin\" \"hi hi\") = \"hi hi\" ]]\n [[ $(candidate \"hi admin\" \"hi hi admin project\") = \"hi admin\" ]]\n [[ $(candidate \"4\" \"1 2 3 4 5\") = \"4\" ]]\n [[ $(candidate \"hi admin\" \"hI Hi\") = \"hI Hi\" ]]\n [[ $(candidate \"hi admin\" \"hI hi hi\") = \"hI hi hi\" ]]\n [[ $(candidate \"hi admin\" \"hI hi hii\") = \"hi admin\" ]]\n [[ $(candidate \"\" \"this\") = \"\" ]]\n [[ $(candidate \"this\" \"\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "sh", - "prompt": "#!/bin/bash\n# Circular shift the digits of the integer x, shift the digits right by shift\n# and return the result as a string.\n# If shift > number of digits, return digits reversed.\n# >>> $(circular_shift \"12\" \"1\")\n# \"21\"\n# >>> $(circular_shift \"12\" \"2\")\n# \"12\"\n#\n# $1 is an integer\n# $2 is an integer\ncircular_shift() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n circular_shift \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"100\" \"2\") = \"001\" ]]\n [[ $(candidate \"12\" \"2\") = \"12\" ]]\n [[ $(candidate \"97\" \"8\") = \"79\" ]]\n [[ $(candidate \"12\" \"1\") = \"21\" ]]\n [[ $(candidate \"11\" \"101\") = \"11\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "sh", - "prompt": "#!/bin/bash\n# Return true is list elements are monotonically increasing or decreasing.\n# >>> $(monotonic \"1 2 4 20\")\n# \"true\"\n# >>> $(monotonic \"1 20 4 10\")\n# \"false\"\n# >>> $(monotonic \"4 1 0 -10\")\n# \"true\"\n#\n# $1 is a space-separated list\nmonotonic() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n monotonic \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 4 10\") = \"true\" ]]\n [[ $(candidate \"1 2 4 20\") = \"true\" ]]\n [[ $(candidate \"1 20 4 10\") = \"false\" ]]\n [[ $(candidate \"4 1 0 -10\") = \"true\" ]]\n [[ $(candidate \"4 1 1 0\") = \"true\" ]]\n [[ $(candidate \"1 2 3 2 5 60\") = \"false\" ]]\n [[ $(candidate \"1 2 3 4 5 60\") = \"true\" ]]\n [[ $(candidate \"9 9 9 9\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "sh", - "prompt": "#!/bin/bash\n# Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n# Example\n# >>> $(is_equal_to_sum_even \"4\")\n# \"false\"\n# >>> $(is_equal_to_sum_even \"6\")\n# \"false\"\n# >>> $(is_equal_to_sum_even \"8\")\n# \"true\"\n#\n# $1 is an integer\nis_equal_to_sum_even() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n is_equal_to_sum_even \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"4\") = \"false\" ]]\n [[ $(candidate \"6\") = \"false\" ]]\n [[ $(candidate \"8\") = \"true\" ]]\n [[ $(candidate \"10\") = \"true\" ]]\n [[ $(candidate \"11\") = \"false\" ]]\n [[ $(candidate \"12\") = \"true\" ]]\n [[ $(candidate \"13\") = \"false\" ]]\n [[ $(candidate \"16\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "sh", - "prompt": "#!/bin/bash\n# Input to this function is a string representing musical notes in a special ASCII format.\n# Your task is to parse this string and return list of integers corresponding to how many beats does each\n# not last.\n# Here is a legend:\n# 'o' - whole note, lasts four beats\n# 'o|' - half note, lasts two beats\n# '.|' - quater note, lasts one beat\n# >>> $(parse_music \"o o| .| o| o| .| .| .| .| o o\")\n# ['\"4\"', '\"2\"', '\"1\"', '\"2\"', '\"2\"', '\"1\"', '\"1\"', '\"1\"', '\"1\"', '\"4\"', '\"4\"']\n#\n# $1 is a string\nparse_music() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n parse_music \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"o o o o\") = \"4 4 4 4\" ]]\n [[ $(candidate \".| .| .| .|\") = \"1 1 1 1\" ]]\n [[ $(candidate \"o| o| .| .| o o o o\") = \"2 2 1 1 4 4 4 4\" ]]\n [[ $(candidate \"o| .| o| .| o o| o o|\") = \"2 1 2 1 4 2 4 2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "sh", - "prompt": "#!/bin/bash\n# \"\n# This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n# multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n# change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n# Examples:\n# >>> lst\n# ['\"1\"', '\"2\"', '\"3\"']\n# >>> lst\n# []\n# >>> lst\n# ['\"-1\"', '\"-5\"', '\"2\"', '\"-1\"', '\"-5\"']\n#\n# $1 is a space-separated list\nsum_squares() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n sum_squares \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3\") = \"6\" ]]\n [[ $(candidate \"1 4 9\") = \"14\" ]]\n [[ $(candidate \"\") = \"0\" ]]\n [[ $(candidate \"1 1 1 1 1 1 1 1 1\") = \"9\" ]]\n [[ $(candidate \"-1 -1 -1 -1 -1 -1 -1 -1 -1\") = \"-3\" ]]\n [[ $(candidate \"0\") = \"0\" ]]\n [[ $(candidate \"-1 -5 2 -1 -5\") = \"-126\" ]]\n [[ $(candidate \"-56 -99 1 0 -2\") = \"3030\" ]]\n [[ $(candidate \"-1 0 0 0 0 0 0 0 -1\") = \"0\" ]]\n [[ $(candidate \"-16 -9 -2 36 36 26 -20 25 -40 20 -4 12 -26 35 37\") = \"-14196\" ]]\n [[ $(candidate \"-1 -3 17 -1 -15 13 -1 14 -14 -12 -5 14 -14 6 13 11 16 16 4 10\") = \"-1448\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "sh", - "prompt": "#!/bin/bash\n# triples_sum_to_zero takes a list of integers as an input.\n# it returns true if there are three distinct elements in the list that\n# sum to zero, and false otherwise.\n# >>> $(triples_sum_to_zero \"1 3 5 0\")\n# \"false\"\n# >>> $(triples_sum_to_zero \"1 3 -2 1\")\n# \"true\"\n# >>> $(triples_sum_to_zero \"1 2 3 7\")\n# \"false\"\n# >>> $(triples_sum_to_zero \"2 4 -5 3 9 7\")\n# \"true\"\n# >>> $(triples_sum_to_zero \"1\")\n# \"false\"\n#\n# $1 is a space-separated list\ntriples_sum_to_zero() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n triples_sum_to_zero \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 3 5 0\") = \"false\" ]]\n [[ $(candidate \"1 3 5 -1\") = \"false\" ]]\n [[ $(candidate \"1 3 -2 1\") = \"true\" ]]\n [[ $(candidate \"1 2 3 7\") = \"false\" ]]\n [[ $(candidate \"1 2 5 7\") = \"false\" ]]\n [[ $(candidate \"2 4 -5 3 9 7\") = \"true\" ]]\n [[ $(candidate \"1\") = \"false\" ]]\n [[ $(candidate \"1 3 5 -100\") = \"false\" ]]\n [[ $(candidate \"100 3 5 -100\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "sh", - "prompt": "#!/bin/bash\n# brackets is a string of \"<\" and \">\".\n# return true if every opening bracket has a corresponding closing bracket.\n# >>> $(correct_bracketing \"<\")\n# \"false\"\n# >>> $(correct_bracketing \"<>\")\n# \"true\"\n# >>> $(correct_bracketing \"<<><>>\")\n# \"true\"\n# >>> $(correct_bracketing \"><<>\")\n# \"false\"\n#\n# $1 is a string\ncorrect_bracketing() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n correct_bracketing \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"<>\") = \"true\" ]]\n [[ $(candidate \"<<><>>\") = \"true\" ]]\n [[ $(candidate \"<><><<><>><>\") = \"true\" ]]\n [[ $(candidate \"<><><<<><><>><>><<><><<>>>\") = \"true\" ]]\n [[ $(candidate \"<<<><>>>>\") = \"false\" ]]\n [[ $(candidate \"><<>\") = \"false\" ]]\n [[ $(candidate \"<\") = \"false\" ]]\n [[ $(candidate \"<<<<\") = \"false\" ]]\n [[ $(candidate \">\") = \"false\" ]]\n [[ $(candidate \"<<>\") = \"false\" ]]\n [[ $(candidate \"<><><<><>><>><<>\") = \"false\" ]]\n [[ $(candidate \"<><><<><>><>>><>\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that takes an array of numbers as input and returns \n# the number of elements in the array that are greater than 10 and both \n# first and last digits of a number are odd (1, 3, 5, 7, 9).\n# For example:\n# >>> $(specialFilter \"15 -73 14 -15\")\n# \"1\"\n# >>> $(specialFilter \"33 -2 -3 45 21 109\")\n# \"2\"\n#\n# $1 is a space-separated list\nspecialFilter() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n specialFilter \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5 -2 1 -5\") = \"0\" ]]\n [[ $(candidate \"15 -73 14 -15\") = \"1\" ]]\n [[ $(candidate \"33 -2 -3 45 21 109\") = \"2\" ]]\n [[ $(candidate \"43 -12 93 125 121 109\") = \"4\" ]]\n [[ $(candidate \"71 -2 -33 75 21 19\") = \"3\" ]]\n [[ $(candidate \"1\") = \"0\" ]]\n [[ $(candidate \"\") = \"0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a CSV, return true if all keys are strings in lower \n# case or all keys are strings in upper case, else return false.\n# The function should return false is the given CSV is empty.\n# Examples:\n# >>> $(check_dict_case \"a,apple\\nb,banana\")\n# \"true\"\n# >>> $(check_dict_case \"a,apple\\nA,banana\\nB,banana\")\n# \"false\"\n# >>> $(check_dict_case \"a,apple\\n8,banana\")\n# \"false\"\n# >>> $(check_dict_case \"Name,John\\nAge,36\\nCity,Houston\")\n# \"false\"\n# >>> $(check_dict_case \"STATE,NC\\nZIP,12345\")\n# \"true\"\n#\n# $1 is a two column CSV in key,value order\ncheck_dict_case() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n check_dict_case \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"p,pineapple\\nb,banana\") = \"true\" ]]\n [[ $(candidate \"p,pineapple\\nA,banana\\nB,banana\") = \"false\" ]]\n [[ $(candidate \"p,pineapple\\n5,banana\\na,apple\") = \"false\" ]]\n [[ $(candidate \"Name,John\\nAge,36\\nCity,Houston\") = \"false\" ]]\n [[ $(candidate \"STATE,NC\\nZIP,12345\") = \"true\" ]]\n [[ $(candidate \"fruit,Orange\\ntaste,Sweet\") = \"true\" ]]\n [[ $(candidate \"\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n# should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n# alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n# Examples\n# >>> $(split_words \"Hello world\\!\")\n# ['\"Hello\"', '\"world\\\\!\"']\n# >>> $(split_words \"Hello,world\\!\")\n# ['\"Hello\"', '\"world\\\\!\"']\n# >>> $(split_words \"abcdef\")\n# \"3\"\n#\n# $1 is a string\nsplit_words() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n split_words \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Hello world\\!\") = \"Hello world\\!\" ]]\n [[ $(candidate \"Hello,world\\!\") = \"Hello world\\!\" ]]\n [[ $(candidate \"Hello world,\\!\") = \"Hello world,\\!\" ]]\n [[ $(candidate \"Hello,Hello,world \\!\") = \"Hello,Hello,world \\!\" ]]\n [[ $(candidate \"abcdef\") = \"3\" ]]\n [[ $(candidate \"aaabb\") = \"2\" ]]\n [[ $(candidate \"aaaBb\") = \"1\" ]]\n [[ $(candidate \"\") = \"0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "sh", - "prompt": "#!/bin/bash\n# The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fibfib(0) == 0\n# fibfib(1) == 0\n# fibfib(2) == 1\n# fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n# Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n# >>> $(fibfib \"1\")\n# \"0\"\n# >>> $(fibfib \"5\")\n# \"4\"\n# >>> $(fibfib \"8\")\n# \"24\"\n#\n# $1 is an integer\nfibfib() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n fibfib \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2\") = \"1\" ]]\n [[ $(candidate \"1\") = \"0\" ]]\n [[ $(candidate \"5\") = \"4\" ]]\n [[ $(candidate \"8\") = \"24\" ]]\n [[ $(candidate \"10\") = \"81\" ]]\n [[ $(candidate \"12\") = \"274\" ]]\n [[ $(candidate \"14\") = \"927\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a list of numbers.\n# You need to return the sum of squared numbers in the given list,\n# round each element in the list to the upper int(Ceiling) first.\n# Examples:\n# >>> $(lst \"1.0 2.0 3.0\")\n# \"14\"\n# >>> $(lst \"1.0 4.0 9.0\")\n# \"98\"\n# >>> $(lst \"1.0 3.0 5.0 7.0\")\n# \"84\"\n# >>> $(lst \"1.4 4.2 0.0\")\n# \"29\"\n# >>> $(lst \"-2.4 1.0 1.0\")\n# \"6\"\n#\n# $1 is a space-separated list\nsum_squares() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n sum_squares \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1.0 2.0 3.0\") = \"14\" ]]\n [[ $(candidate \"1.0 2.0 3.0\") = \"14\" ]]\n [[ $(candidate \"1.0 3.0 5.0 7.0\") = \"84\" ]]\n [[ $(candidate \"1.4 4.2 0.0\") = \"29\" ]]\n [[ $(candidate \"-2.4 1.0 1.0\") = \"6\" ]]\n [[ $(candidate \"100.0 1.0 15.0 2.0\") = \"10230\" ]]\n [[ $(candidate \"10000.0 10000.0\") = \"200000000\" ]]\n [[ $(candidate \"-1.4 4.6 6.3\") = \"75\" ]]\n [[ $(candidate \"-1.4 17.9 18.9 19.9\") = \"1086\" ]]\n [[ $(candidate \"0.0\") = \"0\" ]]\n [[ $(candidate \"-1.0\") = \"1\" ]]\n [[ $(candidate \"-1.0 1.0 0.0\") = \"2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_85_add", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a non-empty list of integers lst. add the even elements that are at odd indices..\n# Examples:\n# >>> $(add \"4 2 6 7\")\n# \"2\"\n#\n# $1 is a space-separated list\nadd() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n add \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"4 88\") = \"88\" ]]\n [[ $(candidate \"4 5 6 7 2 122\") = \"122\" ]]\n [[ $(candidate \"4 0 6 7\") = \"0\" ]]\n [[ $(candidate \"4 4 6 8\") = \"12\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "sh", - "prompt": "#!/bin/bash\n# Return sorted unique elements in a list\n# >>> $(unique \"5 3 5 2 3 3 9 0 123\")\n# ['\"0\"', '\"2\"', '\"3\"', '\"5\"', '\"9\"', '\"123\"']\n#\n# $1 is a space-separated list\nunique() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n unique \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5 3 5 2 3 3 9 0 123\") = \"0 2 3 5 9 123\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a string text, replace all spaces in it with underscores, \n# and if a string has more than 2 consecutive spaces, \n# then replace all consecutive spaces with - \n# >>> $(fix_spaces \" Example\")\n# \"Example\"\n# >>> $(fix_spaces \" Example 1\")\n# \"Example_1\"\n# >>> $(fix_spaces \" Example 2\")\n# \"_Example_2\"\n# >>> $(fix_spaces \" Example 3\")\n# \"_Example-3\"\n#\n# $1 is a string\nfix_spaces() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n fix_spaces \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Example\") = \"Example\" ]]\n [[ $(candidate \"Mudasir Hanif \") = \"Mudasir_Hanif_\" ]]\n [[ $(candidate \"Yellow Yellow Dirty Fellow\") = \"Yellow_Yellow__Dirty__Fellow\" ]]\n [[ $(candidate \"Exa mple\") = \"Exa-mple\" ]]\n [[ $(candidate \" Exa 1 2 2 mple\") = \"-Exa_1_2_2_mple\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "sh", - "prompt": "#!/bin/bash\n# Return 2^n modulo p (be aware of numerics).\n# >>> $(modp \"3\" \"5\")\n# \"3\"\n# >>> $(modp \"1101\" \"101\")\n# \"2\"\n# >>> $(modp \"0\" \"101\")\n# \"1\"\n# >>> $(modp \"3\" \"11\")\n# \"8\"\n# >>> $(modp \"100\" \"101\")\n# \"1\"\n#\n# $1 is an integer\n# $2 is an integer\nmodp() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n modp \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3\" \"5\") = \"3\" ]]\n [[ $(candidate \"1101\" \"101\") = \"2\" ]]\n [[ $(candidate \"0\" \"101\") = \"1\" ]]\n [[ $(candidate \"3\" \"11\") = \"8\" ]]\n [[ $(candidate \"100\" \"101\") = \"1\" ]]\n [[ $(candidate \"30\" \"5\") = \"4\" ]]\n [[ $(candidate \"31\" \"5\") = \"3\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "sh", - "prompt": "#!/bin/bash\n# You have to write a function which validates a given date string and\n# returns true if the date is valid otherwise false.\n# The date is valid if all of the following rules are satisfied:\n# 1. The date string is not empty.\n# 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n# 3. The months should not be less than 1 or higher than 12.\n# 4. The date should be in the format: mm-dd-yyyy\n# >>> $(valid_date \"03-11-2000\")\n# \"true\"\n# >>> $(valid_date \"15-01-2012\")\n# \"false\"\n# >>> $(valid_date \"04-0-2040\")\n# \"false\"\n# >>> $(valid_date \"06-04-2020\")\n# \"true\"\n# >>> $(valid_date \"06/04/2020\")\n# \"false\"\n#\n# $1 is a string\nvalid_date() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n valid_date \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"03-11-2000\") = \"true\" ]]\n [[ $(candidate \"15-01-2012\") = \"false\" ]]\n [[ $(candidate \"04-0-2040\") = \"false\" ]]\n [[ $(candidate \"06-04-2020\") = \"true\" ]]\n [[ $(candidate \"01-01-2007\") = \"true\" ]]\n [[ $(candidate \"03-32-2011\") = \"false\" ]]\n [[ $(candidate \"\") = \"false\" ]]\n [[ $(candidate \"04-31-3000\") = \"false\" ]]\n [[ $(candidate \"06-06-2005\") = \"true\" ]]\n [[ $(candidate \"21-31-2000\") = \"false\" ]]\n [[ $(candidate \"04-12-2003\") = \"true\" ]]\n [[ $(candidate \"04122003\") = \"false\" ]]\n [[ $(candidate \"20030412\") = \"false\" ]]\n [[ $(candidate \"2003-04\") = \"false\" ]]\n [[ $(candidate \"2003-04-12\") = \"false\" ]]\n [[ $(candidate \"04-2003\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that takes a string and returns an ordered version of it.\n# Ordered version of string, is a string where all words (separated by space)\n# are replaced by a new word where all the characters arranged in\n# ascending order based on ascii value.\n# Note: You should keep the order of words and blank spaces in the sentence.\n# For example:\n# >>> $(anti_shuffle \"Hi\")\n# \"Hi\"\n# >>> $(anti_shuffle \"hello\")\n# \"ehllo\"\n# >>> $(anti_shuffle \"Hello World\\!\\!\\!\")\n# \"Hello \\!\\!\\!Wdlor\"\n#\n# $1 is a string\nanti_shuffle() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n anti_shuffle \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Hi\") = \"Hi\" ]]\n [[ $(candidate \"hello\") = \"ehllo\" ]]\n [[ $(candidate \"number\") = \"bemnru\" ]]\n [[ $(candidate \"abcd\") = \"abcd\" ]]\n [[ $(candidate \"Hello World\\!\\!\\!\") = \"Hello \\!\\!\\!Wdlor\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"Hi. My name is Mister Robot. How are you?\") = \".Hi My aemn is Meirst .Rboot How aer ?ouy\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a list of numbers, return whether or not they are sorted\n# in ascending order. If list has more than 1 duplicate of the same\n# number, return false. Assume no negative numbers and only integers.\n# Examples\n# >>> $(is_sorted \"5\")\n# \"true\"\n# >>> $(is_sorted \"1 2 3 4 5\")\n# \"true\"\n# >>> $(is_sorted \"1 3 2 4 5\")\n# \"false\"\n# >>> $(is_sorted \"1 2 3 4 5 6\")\n# \"true\"\n# >>> $(is_sorted \"1 2 3 4 5 6 7\")\n# \"true\"\n# >>> $(is_sorted \"1 3 2 4 5 6 7\")\n# \"false\"\n# >>> $(is_sorted \"1 2 2 3 3 4\")\n# \"true\"\n# >>> $(is_sorted \"1 2 2 2 3 4\")\n# \"false\"\n#\n# $1 is a space-separated list\nis_sorted() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n is_sorted \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\") = \"true\" ]]\n [[ $(candidate \"1 2 3 4 5\") = \"true\" ]]\n [[ $(candidate \"1 3 2 4 5\") = \"false\" ]]\n [[ $(candidate \"1 2 3 4 5 6\") = \"true\" ]]\n [[ $(candidate \"1 2 3 4 5 6 7\") = \"true\" ]]\n [[ $(candidate \"1 3 2 4 5 6 7\") = \"false\" ]]\n [[ $(candidate \"\") = \"true\" ]]\n [[ $(candidate \"1\") = \"true\" ]]\n [[ $(candidate \"3 2 1\") = \"false\" ]]\n [[ $(candidate \"1 2 2 2 3 4\") = \"false\" ]]\n [[ $(candidate \"1 2 3 3 3 4\") = \"false\" ]]\n [[ $(candidate \"1 2 2 3 3 4\") = \"true\" ]]\n [[ $(candidate \"1 2 3 4\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a string s.\n# Your task is to check if the string is hapsh or not.\n# A string is hapsh if its length is at least 3 and every 3 consecutive letters are distinct\n# For example:\n# >>> $(is_happy \"a\")\n# \"false\"\n# >>> $(is_happy \"aa\")\n# \"false\"\n# >>> $(is_happy \"abcd\")\n# \"true\"\n# >>> $(is_happy \"aabb\")\n# \"false\"\n# >>> $(is_happy \"adb\")\n# \"true\"\n# >>> $(is_happy \"xyy\")\n# \"false\"\n#\n# $1 is a string\nis_happy() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n is_happy \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"a\") = \"false\" ]]\n [[ $(candidate \"aa\") = \"false\" ]]\n [[ $(candidate \"abcd\") = \"true\" ]]\n [[ $(candidate \"aabb\") = \"false\" ]]\n [[ $(candidate \"adb\") = \"true\" ]]\n [[ $(candidate \"xyy\") = \"false\" ]]\n [[ $(candidate \"iopaxpoi\") = \"true\" ]]\n [[ $(candidate \"iopaxioi\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that returns true if the object q will fly, and false otherwise.\n# The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n# Example:\n# >>> $(will_it_fly \"1 2\" \"5\")\n# \"false\"\n# # 1+2 is less than the maximum possible weight, but it's unbalanced.\n# >>> $(will_it_fly \"3 2 3\" \"1\")\n# \"false\"\n# # it's balanced, but 3+2+3 is more than the maximum possible weight.\n# >>> $(will_it_fly \"3 2 3\" \"9\")\n# \"true\"\n# # 3+2+3 is less than the maximum possible weight, and it's balanced.\n# >>> $(will_it_fly \"3\" \"5\")\n# \"true\"\n# # 3 is less than the maximum possible weight, and it's balanced.\n#\n# $1 is a space-separated list\n# $2 is an integer\nwill_it_fly() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n will_it_fly \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3 2 3\" \"9\") = \"true\" ]]\n [[ $(candidate \"1 2\" \"5\") = \"false\" ]]\n [[ $(candidate \"3\" \"5\") = \"true\" ]]\n [[ $(candidate \"3 2 3\" \"1\") = \"false\" ]]\n [[ $(candidate \"1 2 3\" \"6\") = \"false\" ]]\n [[ $(candidate \"5\" \"5\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "sh", - "prompt": "#!/bin/bash\n# Given an array of non-negative integers, return a cosh of the given array after sorting,\n# you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n# or sort it in descending order if the sum( first index value, last index value) is even.\n# Note:\n# * don't change the given array.\n# Examples:\n# >>> $(sort_array \"\")\n# []\n# >>> $(sort_array \"5\")\n# ['\"5\"']\n# >>> $(sort_array \"2 4 3 0 1 5\")\n# ['\"0\"', '\"1\"', '\"2\"', '\"3\"', '\"4\"', '\"5\"']\n# >>> $(sort_array \"2 4 3 0 1 5 6\")\n# ['\"6\"', '\"5\"', '\"4\"', '\"3\"', '\"2\"', '\"1\"', '\"0\"']\n#\n# $1 is a space-separated list\nsort_array() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n sort_array \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"5\") = \"5\" ]]\n [[ $(candidate \"2 4 3 0 1 5\") = \"0 1 2 3 4 5\" ]]\n [[ $(candidate \"2 4 3 0 1 5 6\") = \"6 5 4 3 2 1 0\" ]]\n [[ $(candidate \"2 1\") = \"1 2\" ]]\n [[ $(candidate \"15 42 87 32 11 0\") = \"0 11 15 32 42 87\" ]]\n [[ $(candidate \"21 14 23 11\") = \"23 21 14 11\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "sh", - "prompt": "#!/bin/bash\n# Implement a function that takes an non-negative integer and returns an array of the first n\n# integers that are prime numbers and less than n.\n# for example:\n# >>> $(count_up_to \"5\")\n# ['\"2\"', '\"3\"']\n# >>> $(count_up_to \"11\")\n# ['\"2\"', '\"3\"', '\"5\"', '\"7\"']\n# >>> $(count_up_to \"0\")\n# []\n# >>> $(count_up_to \"20\")\n# ['\"2\"', '\"3\"', '\"5\"', '\"7\"', '\"11\"', '\"13\"', '\"17\"', '\"19\"']\n# >>> $(count_up_to \"1\")\n# []\n# >>> $(count_up_to \"18\")\n# ['\"2\"', '\"3\"', '\"5\"', '\"7\"', '\"11\"', '\"13\"', '\"17\"']\n#\n# $1 is an integer\ncount_up_to() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n count_up_to \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\") = \"2 3\" ]]\n [[ $(candidate \"6\") = \"2 3 5\" ]]\n [[ $(candidate \"7\") = \"2 3 5\" ]]\n [[ $(candidate \"10\") = \"2 3 5 7\" ]]\n [[ $(candidate \"0\") = \"\" ]]\n [[ $(candidate \"22\") = \"2 3 5 7 11 13 17 19\" ]]\n [[ $(candidate \"1\") = \"\" ]]\n [[ $(candidate \"18\") = \"2 3 5 7 11 13 17\" ]]\n [[ $(candidate \"47\") = \"2 3 5 7 11 13 17 19 23 29 31 37 41 43\" ]]\n [[ $(candidate \"101\") = \"2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "sh", - "prompt": "#!/bin/bash\n# Out of list of strings, return the longest one. Return the first one in case of multiple\n# strings of the same length. Return None in case the input list is empty.\n# >>> $(longest \"\")\n# \"None\"\n# >>> $(longest \"a b c\")\n# \"a\"\n# >>> $(longest \"a bb ccc\")\n# \"ccc\"\n#\n# $1 is a space-separated list\nlongest() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n longest \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"None\" ]]\n [[ $(candidate \"x y z\") = \"x\" ]]\n [[ $(candidate \"x yyy zzzz www kkkk abc\") = \"zzzz\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "sh", - "prompt": "#!/bin/bash\n# Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n# reverse the resulting array, and then replace each digit by its corresponding name from\n# \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n# For example:\n# >>> $(by_length \"2 1 1 4 5 8 2 3\")\n# ['\"Eight\"', '\"Five\"', '\"Four\"', '\"Three\"', '\"Two\"', '\"Two\"', '\"One\"', '\"One\"']\n# If the array is empty, return an empty array:\n# >>> $(by_length \"\")\n# []\n# If the array has any strange number ignore it:\n# >>> $(by_length \"1 -1 55\")\n# ['\"One\"']\n#\n# $1 is a space-separated list\nby_length() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n by_length \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2 1 1 4 5 8 2 3\") = \"Eight Five Four Three Two Two One One\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"1 -1 55\") = \"One\" ]]\n [[ $(candidate \"1 -1 3 2\") = \"Three Two One\" ]]\n [[ $(candidate \"9 4 8\") = \"Nine Eight Four\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_106_f", - "language": "sh", - "prompt": "#!/bin/bash\n# Implement the function f that takes n as a parameter,\n# 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\n# or the sum of numbers from 1 to i otherwise.\n# i starts from 1.\n# the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n# Example:\n# >>> $(f \"5\")\n# ['\"1\"', '\"2\"', '\"6\"', '\"24\"', '\"15\"']\n#\n# $1 is an integer\nf() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n f \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\") = \"1 2 6 24 15\" ]]\n [[ $(candidate \"7\") = \"1 2 6 24 15 720 28\" ]]\n [[ $(candidate \"1\") = \"1\" ]]\n [[ $(candidate \"3\") = \"1 2 6\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "sh", - "prompt": "#!/bin/bash\n# Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n# >>> $(fizz_buzz \"50\")\n# \"0\"\n# >>> $(fizz_buzz \"78\")\n# \"2\"\n# >>> $(fizz_buzz \"79\")\n# \"3\"\n#\n# $1 is an integer\nfizz_buzz() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n fizz_buzz \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"50\") = \"0\" ]]\n [[ $(candidate \"78\") = \"2\" ]]\n [[ $(candidate \"79\") = \"3\" ]]\n [[ $(candidate \"100\") = \"3\" ]]\n [[ $(candidate \"200\") = \"6\" ]]\n [[ $(candidate \"4000\") = \"192\" ]]\n [[ $(candidate \"10000\") = \"639\" ]]\n [[ $(candidate \"100000\") = \"8026\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a positive floating point number, it can be decomposed into\n# and integer part (largest integer smaller than given number) and decimals\n# (leftover part always smaller than 1).\n# Return the decimal part of the number.\n# >>> $(truncate_number \"3.5\")\n# \"0.5\"\n#\n# $1 is a floating point\ntruncate_number() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n truncate_number \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3.5\") = \"0.5\" ]]\n [[ $(candidate \"1.25\") = \"0.25\" ]]\n [[ $(candidate \"123.0\") = \"0.0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "sh", - "prompt": "#!/bin/bash\n# For a given list of integers, return a list consisting of a sum and a product of all the integers in a list.\n# Empty sum should be equal to 0 and empty product should be equal to 1.\n# >>> $(sum_product \"\")\n# ['\"0\"', '\"1\"']\n# >>> $(sum_product \"1 2 3 4\")\n# ['\"10\"', '\"24\"']\n#\n# $1 is a space-separated list\nsum_product() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n sum_product \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"0 1\" ]]\n [[ $(candidate \"1 1 1\") = \"3 1\" ]]\n [[ $(candidate \"100 0\") = \"100 0\" ]]\n [[ $(candidate \"3 5 7\") = \"15 105\" ]]\n [[ $(candidate \"10\") = \"10 10\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a 2 dimensional data, as a nested lists,\n# which is similar to matrix, however, unlike matrices,\n# each row may contain a different number of columns.\n# Given lst, and integer x, find integers x in the list,\n# and return list of lists, [(x1, y1), (x2, y2) ...] such that\n# each list is a coordinate - (row, columns), starting with 0.\n# Sort coordinates initially by rows in ascending order.\n# Also, sort coordinates of the row by columns in descending order.\n# Examples:\n# >>> $(get_row \"1 2 3 4 5 6\\n1 2 3 4 1 6\\n1 2 3 4 5 1\" \"1\")\n# [['\"0\"', '\"0\"'], ['\"1\"', '\"4\"'], ['\"1\"', '\"0\"'], ['\"2\"', '\"5\"'], ['\"2\"', '\"0\"']]\n# >>> $(get_row \"\" \"1\")\n# []\n# >>> $(get_row \"\\n1\\n1 2 3\" \"3\")\n# [['\"2\"', '\"2\"']]\n#\n# $1 is a newline-separated, space-separated list\n# $2 is an integer\nget_row() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n get_row \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3 4 5 6\\n1 2 3 4 1 6\\n1 2 3 4 5 1\" \"1\") = \"0 0\\n1 4\\n1 0\\n2 5\\n2 0\" ]]\n [[ $(candidate \"1 2 3 4 5 6\\n1 2 3 4 5 6\\n1 2 3 4 5 6\\n1 2 3 4 5 6\\n1 2 3 4 5 6\\n1 2 3 4 5 6\" \"2\") = \"0 1\\n1 1\\n2 1\\n3 1\\n4 1\\n5 1\" ]]\n [[ $(candidate \"1 2 3 4 5 6\\n1 2 3 4 5 6\\n1 1 3 4 5 6\\n1 2 1 4 5 6\\n1 2 3 1 5 6\\n1 2 3 4 1 6\\n1 2 3 4 5 1\" \"1\") = \"0 0\\n1 0\\n2 1\\n2 0\\n3 2\\n3 0\\n4 3\\n4 0\\n5 4\\n5 0\\n6 5\\n6 0\" ]]\n [[ $(candidate \"\" \"1\") = \"\" ]]\n [[ $(candidate \"1\" \"2\") = \"\" ]]\n [[ $(candidate \"\\n1\\n1 2 3\" \"3\") = \"2 2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "sh", - "prompt": "#!/bin/bash\n# You're a hungry rabbit, and you already have eaten a certain number of carrots,\n# but now you need to eat more carrots to complete the day's meals.\n# you should return an array of [ total number of eaten carrots after your meals,\n# the number of carrots left after your meals ]\n# if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n# Example:\n# >>> $(eat \"5\" \"6\" \"10\")\n# ['\"11\"', '\"4\"']\n# >>> $(eat \"4\" \"8\" \"9\")\n# ['\"12\"', '\"1\"']\n# >>> $(eat \"1\" \"10\" \"10\")\n# ['\"11\"', '\"0\"']\n# >>> $(eat \"2\" \"11\" \"5\")\n# ['\"7\"', '\"0\"']\n# Variables:\n# @number : integer\n# the number of carrots that you have eaten.\n# @need : integer\n# the number of carrots that you need to eat.\n# @remaining : integer\n# the number of remaining carrots thet exist in stock\n# Constrain:\n# * 0 <= number <= 1000\n# * 0 <= need <= 1000\n# * 0 <= remaining <= 1000\n# Have fun :)\n#\n# $1 is an integer\n# $2 is an integer\n# $3 is an integer\neat() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n eat \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\" \"6\" \"10\") = \"11 4\" ]]\n [[ $(candidate \"4\" \"8\" \"9\") = \"12 1\" ]]\n [[ $(candidate \"1\" \"10\" \"10\") = \"11 0\" ]]\n [[ $(candidate \"2\" \"11\" \"5\") = \"7 0\" ]]\n [[ $(candidate \"4\" \"5\" \"7\") = \"9 2\" ]]\n [[ $(candidate \"4\" \"5\" \"1\") = \"5 0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a positive integer N, return the total sum of its digits in binary.\n# Example\n# >>> $(solve \"1000\")\n# \"1\"\n# >>> $(solve \"150\")\n# \"110\"\n# >>> $(solve \"147\")\n# \"1100\"\n# Variables:\n# @N integer\n# Constraints: 0 \u2264 N \u2264 10000.\n# Output:\n# a string of binary number\n#\n# $1 is an integer\nsolve() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n solve \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1000\") = \"1\" ]]\n [[ $(candidate \"150\") = \"110\" ]]\n [[ $(candidate \"147\") = \"1100\" ]]\n [[ $(candidate \"333\") = \"1001\" ]]\n [[ $(candidate \"963\") = \"10010\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a list of integers.\n# You need to find the largest prime value and return the sum of its digits.\n# Examples:\n# >>> $(skjkasdkd \"0 3 2 1 3 5 7 4 5 5 5 2 181 32 4 32 3 2 32 324 4 3\")\n# \"10\"\n# >>> $(skjkasdkd \"1 0 1 8 2 4597 2 1 3 40 1 2 1 2 4 2 5 1\")\n# \"25\"\n# >>> $(skjkasdkd \"1 3 1 32 5107 34 83278 109 163 23 2323 32 30 1 9 3\")\n# \"13\"\n# >>> $(skjkasdkd \"0 724 32 71 99 32 6 0 5 91 83 0 5 6\")\n# \"11\"\n# >>> $(skjkasdkd \"0 81 12 3 1 21\")\n# \"3\"\n# >>> $(skjkasdkd \"0 8 1 2 1 7\")\n# \"7\"\n#\n# $1 is a space-separated list\nskjkasdkd() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n skjkasdkd \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"0 3 2 1 3 5 7 4 5 5 5 2 181 32 4 32 3 2 32 324 4 3\") = \"10\" ]]\n [[ $(candidate \"1 0 1 8 2 4597 2 1 3 40 1 2 1 2 4 2 5 1\") = \"25\" ]]\n [[ $(candidate \"1 3 1 32 5107 34 83278 109 163 23 2323 32 30 1 9 3\") = \"13\" ]]\n [[ $(candidate \"0 724 32 71 99 32 6 0 5 91 83 0 5 6\") = \"11\" ]]\n [[ $(candidate \"0 81 12 3 1 21\") = \"3\" ]]\n [[ $(candidate \"0 8 1 2 1 7\") = \"7\" ]]\n [[ $(candidate \"8191\") = \"19\" ]]\n [[ $(candidate \"8191 123456 127 7\") = \"19\" ]]\n [[ $(candidate \"127 97 8192\") = \"10\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "sh", - "prompt": "#!/bin/bash\n# Given an array arr of integers, find the minimum number of elements that\n# need to be changed to make the array palindromic. A palindromic array is an array that\n# is read the same backwards and forwards. In one change, you can change one element to any other element.\n# For example:\n# >>> $(smallest_change \"1 2 3 5 4 7 9 6\")\n# \"4\"\n# >>> $(smallest_change \"1 2 3 4 3 2 2\")\n# \"1\"\n# >>> $(smallest_change \"1 2 3 2 1\")\n# \"0\"\n#\n# $1 is a space-separated list\nsmallest_change() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n smallest_change \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3 5 4 7 9 6\") = \"4\" ]]\n [[ $(candidate \"1 2 3 4 3 2 2\") = \"1\" ]]\n [[ $(candidate \"1 4 2\") = \"1\" ]]\n [[ $(candidate \"1 4 4 2\") = \"1\" ]]\n [[ $(candidate \"1 2 3 2 1\") = \"0\" ]]\n [[ $(candidate \"3 1 1 3\") = \"0\" ]]\n [[ $(candidate \"1\") = \"0\" ]]\n [[ $(candidate \"0 1\") = \"1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "sh", - "prompt": "#!/bin/bash\n# It is the last week of the semester and the teacher has to give the grades\n# to students. The teacher has been making her own algorithm for grading.\n# The only problem is, she has lost the code she used for grading.\n# She has given you a list of GPAs for some students and you have to write \n# a function that can output a list of letter grades using the following table:\n# GPA | Letter grade\n# 4.0 A+\n# > 3.7 A \n# > 3.3 A- \n# > 3.0 B+\n# > 2.7 B \n# > 2.3 B-\n# > 2.0 C+\n# > 1.7 C\n# > 1.3 C-\n# > 1.0 D+ \n# > 0.7 D \n# > 0.0 D-\n# 0.0 E\n# Example:\n# >>> $(grade_equation \"4.0 3 1.7 2 3.5\")\n# ['\"A+\"', '\"B\"', '\"C-\"', '\"C\"', '\"A-\"']\n#\n# $1 is a space-separated list\nnumerical_letter_grade() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n numerical_letter_grade \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"4.0 3 1.7 2 3.5\") = \"A+ B C- C A-\" ]]\n [[ $(candidate \"1.2\") = \"D+\" ]]\n [[ $(candidate \"0.5\") = \"D-\" ]]\n [[ $(candidate \"0.0\") = \"E\" ]]\n [[ $(candidate \"1.0 0.3 1.5 2.8 3.3\") = \"D D- C- B B+\" ]]\n [[ $(candidate \"0.0 0.7\") = \"E D-\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "sh", - "prompt": "#!/bin/bash\n# Given the lengths of the three sides of a triangle. Return the area of\n# the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n# Otherwise return -1\n# Three sides make a valid triangle when the sum of any two sides is greater \n# than the third side.\n# Example:\n# >>> $(triangle_area \"3\" \"4\" \"5\")\n# \"6.0\"\n# >>> $(triangle_area \"1\" \"2\" \"10\")\n# \"-1\"\n#\n# $1 is an integer\n# $2 is an integer\n# $3 is an integer\ntriangle_area() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n triangle_area \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3\" \"4\" \"5\") = \"6.0\" ]]\n [[ $(candidate \"1\" \"2\" \"10\") = \"-1\" ]]\n [[ $(candidate \"4\" \"8\" \"5\") = \"8.18\" ]]\n [[ $(candidate \"2\" \"2\" \"2\") = \"1.73\" ]]\n [[ $(candidate \"1\" \"2\" \"3\") = \"-1\" ]]\n [[ $(candidate \"10\" \"5\" \"7\") = \"16.25\" ]]\n [[ $(candidate \"2\" \"6\" \"3\") = \"-1\" ]]\n [[ $(candidate \"1\" \"1\" \"1\") = \"0.43\" ]]\n [[ $(candidate \"2\" \"2\" \"10\") = \"-1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "sh", - "prompt": "#!/bin/bash\n# Check if two words have the same characters.\n# >>> $(same_chars \"eabcdzzzz\" \"dddzzzzzzzddeddabc\")\n# \"true\"\n# >>> $(same_chars \"abcd\" \"dddddddabc\")\n# \"true\"\n# >>> $(same_chars \"dddddddabc\" \"abcd\")\n# \"true\"\n# >>> $(same_chars \"eabcd\" \"dddddddabc\")\n# \"false\"\n# >>> $(same_chars \"abcd\" \"dddddddabce\")\n# \"false\"\n# >>> $(same_chars \"eabcdzzzz\" \"dddzzzzzzzddddabc\")\n# \"false\"\n#\n# $1 is a string\n# $2 is a string\nsame_chars() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n same_chars \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"eabcdzzzz\" \"dddzzzzzzzddeddabc\") = \"true\" ]]\n [[ $(candidate \"abcd\" \"dddddddabc\") = \"true\" ]]\n [[ $(candidate \"dddddddabc\" \"abcd\") = \"true\" ]]\n [[ $(candidate \"eabcd\" \"dddddddabc\") = \"false\" ]]\n [[ $(candidate \"abcd\" \"dddddddabcf\") = \"false\" ]]\n [[ $(candidate \"eabcdzzzz\" \"dddzzzzzzzddddabc\") = \"false\" ]]\n [[ $(candidate \"aabb\" \"aaccc\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "sh", - "prompt": "#!/bin/bash\n# Given an array of integers nums, find the minimum sum of any non-empty sub-array\n# of nums.\n# Example\n# >>> $(minSubArraySum \"2 3 4 1 2 4\")\n# \"1\"\n# >>> $(minSubArraySum \"-1 -2 -3\")\n# \"-6\"\n#\n# $1 is a space-separated list\nminSubArraySum() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n minSubArraySum \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2 3 4 1 2 4\") = \"1\" ]]\n [[ $(candidate \"-1 -2 -3\") = \"-6\" ]]\n [[ $(candidate \"-1 -2 -3 2 -10\") = \"-14\" ]]\n [[ $(candidate \"-9999999999999999\") = \"-9999999999999999\" ]]\n [[ $(candidate \"0 10 20 1000000\") = \"0\" ]]\n [[ $(candidate \"-1 -2 -3 10 -5\") = \"-6\" ]]\n [[ $(candidate \"100 -1 -2 -3 10 -5\") = \"-6\" ]]\n [[ $(candidate \"10 11 13 8 3 4\") = \"3\" ]]\n [[ $(candidate \"100 -33 32 -1 0 -2\") = \"-33\" ]]\n [[ $(candidate \"-10\") = \"-10\" ]]\n [[ $(candidate \"7\") = \"7\" ]]\n [[ $(candidate \"1 -1\") = \"-1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a string s and a natural number n, you have been tasked to implement \n# a function that returns a list of all words from string s that contain exactly \n# n consonants, in order these words appear in the string s.\n# If the string s is empty then the function should return an empty list.\n# Note: you may assume the input string contains only letters and spaces.\n# Examples:\n# >>> $(select_words \"Mary had a little lamb\" \"4\")\n# ['\"little\"']\n# >>> $(select_words \"Mary had a little lamb\" \"3\")\n# ['\"Mary\"', '\"lamb\"']\n# >>> $(select_words \"simple white space\" \"2\")\n# []\n# >>> $(select_words \"Hello world\" \"4\")\n# ['\"world\"']\n# >>> $(select_words \"Uncle sam\" \"3\")\n# ['\"Uncle\"']\n#\n# $1 is a string\n# $2 is an integer\nselect_words() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n select_words \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Mary had a little lamb\" \"4\") = \"little\" ]]\n [[ $(candidate \"Mary had a little lamb\" \"3\") = \"Mary lamb\" ]]\n [[ $(candidate \"simple white space\" \"2\") = \"\" ]]\n [[ $(candidate \"Hello world\" \"4\") = \"world\" ]]\n [[ $(candidate \"Uncle sam\" \"3\") = \"Uncle\" ]]\n [[ $(candidate \"\" \"4\") = \"\" ]]\n [[ $(candidate \"a b c d e f\" \"1\") = \"b c d f\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "sh", - "prompt": "#!/bin/bash\n# Return list of all prefixes from shortest to longest of the input string\n# >>> $(all_prefixes \"abc\")\n# ['\"a\"', '\"ab\"', '\"abc\"']\n#\n# $1 is a string\nall_prefixes() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n all_prefixes \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"asdfgh\") = \"a as asd asdf asdfg asdfgh\" ]]\n [[ $(candidate \"WWW\") = \"W WW WWW\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function that takes a value (string) representing a number\n# and returns the closest integer to it. If the number is equidistant\n# from two integers, round it away from zero.\n# Examples\n# >>> $(closest_integer \"10\")\n# \"10\"\n# >>> $(closest_integer \"15.3\")\n# \"15\"\n# Note:\n# Rounding away from zero means that if the given number is equidistant\n# from two integers, the one you should return is the one that is the\n# farthest from zero. For example closest_integer(\"14.5\") should\n# return 15 and closest_integer(\"-14.5\") should return -15.\n#\n# $1 is a string\nclosest_integer() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n closest_integer \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"10\") = \"10\" ]]\n [[ $(candidate \"14.5\") = \"15\" ]]\n [[ $(candidate \"-15.5\") = \"-16\" ]]\n [[ $(candidate \"15.3\") = \"15\" ]]\n [[ $(candidate \"0\") = \"0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function which takes a string representing a file's name, and returns\n# 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n# A file's name is considered to be valid if and only if all the following conditions \n# are met:\n# - There should not be more than three digits ('0'-'9') in the file's name.\n# - The file's name contains exactly one dot '.'\n# - The substring before the dot should not be empty, and it starts with a letter from \n# the latin alphapet ('a'-'z' and 'A'-'Z').\n# - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n# Examples:\n# >>> $(file_name_check \"example.txt\")\n# \"Yes\"\n# >>> $(file_name_check \"1example.dll\")\n# \"No\"\n#\n# $1 is a string\nfile_name_check() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n file_name_check \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"example.txt\") = \"Yes\" ]]\n [[ $(candidate \"1example.dll\") = \"No\" ]]\n [[ $(candidate \"s1sdf3.asd\") = \"No\" ]]\n [[ $(candidate \"K.dll\") = \"Yes\" ]]\n [[ $(candidate \"MY16FILE3.exe\") = \"Yes\" ]]\n [[ $(candidate \"His12FILE94.exe\") = \"No\" ]]\n [[ $(candidate \"_Y.txt\") = \"No\" ]]\n [[ $(candidate \"?aREYA.exe\") = \"No\" ]]\n [[ $(candidate \"/this_is_valid.dll\") = \"No\" ]]\n [[ $(candidate \"this_is_valid.wow\") = \"No\" ]]\n [[ $(candidate \"this_is_valid.txt\") = \"Yes\" ]]\n [[ $(candidate \"this_is_valid.txtexe\") = \"No\" ]]\n [[ $(candidate \"#this2_i4s_5valid.ten\") = \"No\" ]]\n [[ $(candidate \"@this1_is6_valid.exe\") = \"No\" ]]\n [[ $(candidate \"this_is_12valid.6exe4.txt\") = \"No\" ]]\n [[ $(candidate \"all.exe.txt\") = \"No\" ]]\n [[ $(candidate \"I563_No.exe\") = \"Yes\" ]]\n [[ $(candidate \"Is3youfault.txt\") = \"Yes\" ]]\n [[ $(candidate \"no_one#knows.dll\") = \"Yes\" ]]\n [[ $(candidate \"1I563_Yes3.exe\") = \"No\" ]]\n [[ $(candidate \"I563_Yes3.txtt\") = \"No\" ]]\n [[ $(candidate \"final..txt\") = \"No\" ]]\n [[ $(candidate \"final132\") = \"No\" ]]\n [[ $(candidate \"_f4indsartal132.\") = \"No\" ]]\n [[ $(candidate \".txt\") = \"No\" ]]\n [[ $(candidate \"s.\") = \"No\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given two intervals,\n# where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n# The given intervals are closed which means that the interval (start, end)\n# includes both start and end.\n# For each given interval, it is assumed that its start is less or equal its end.\n# Your task is to determine whether the length of intersection of these two \n# intervals is a prime number.\n# Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n# which its length is 1, which not a prime number.\n# If the length of the intersection is a prime number, return \"YES\",\n# otherwise, return \"NO\".\n# If the two intervals don't intersect, return \"NO\".\n# [input/output] samples:\n# >>> $(intersection \"1 2\" \"2 3\")\n# \"NO\"\n# >>> $(intersection \"-1 1\" \"0 4\")\n# \"NO\"\n# >>> $(intersection \"-3 -1\" \"-5 5\")\n# \"YES\"\n#\n# $1 is a space-separated list\n# $2 is a space-separated list\nintersection() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n intersection \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2\" \"2 3\") = \"NO\" ]]\n [[ $(candidate \"-1 1\" \"0 4\") = \"NO\" ]]\n [[ $(candidate \"-3 -1\" \"-5 5\") = \"YES\" ]]\n [[ $(candidate \"-2 2\" \"-4 0\") = \"YES\" ]]\n [[ $(candidate \"-11 2\" \"-1 -1\") = \"NO\" ]]\n [[ $(candidate \"1 2\" \"3 5\") = \"NO\" ]]\n [[ $(candidate \"1 2\" \"1 2\") = \"NO\" ]]\n [[ $(candidate \"-2 -2\" \"-3 -2\") = \"NO\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "sh", - "prompt": "#!/bin/bash\n# Return the largest prime factor of n. Assume n > 1 and is not a prime.\n# >>> $(largest_prime_factor \"13195\")\n# \"29\"\n# >>> $(largest_prime_factor \"2048\")\n# \"2\"\n#\n# $1 is an integer\nlargest_prime_factor() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n largest_prime_factor \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"15\") = \"5\" ]]\n [[ $(candidate \"27\") = \"3\" ]]\n [[ $(candidate \"63\") = \"7\" ]]\n [[ $(candidate \"330\") = \"11\" ]]\n [[ $(candidate \"13195\") = \"29\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a string, find out how many distinct characters (regardless of case) does it consist of\n# >>> $(count_distinct_characters \"xyzXYZ\")\n# \"3\"\n# >>> $(count_distinct_characters \"Jerry\")\n# \"4\"\n#\n# $1 is a string\ncount_distinct_characters() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n count_distinct_characters \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"0\" ]]\n [[ $(candidate \"abcde\") = \"5\" ]]\n [[ $(candidate \"abcdecadeCADE\") = \"5\" ]]\n [[ $(candidate \"aaaaAAAAaaaa\") = \"1\" ]]\n [[ $(candidate \"Jerry jERRY JeRRRY\") = \"5\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "sh", - "prompt": "#!/bin/bash\n# You're given a list of deposit and withdrawal operations on a bank account that starts with\n# zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n# at that point function should return true. Otherwise it should return false.\n# >>> $(below_zero \"1 2 3\")\n# \"false\"\n# >>> $(below_zero \"1 2 -4 5\")\n# \"true\"\n#\n# $1 is a space-separated list\nbelow_zero() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n below_zero \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"false\" ]]\n [[ $(candidate \"1 2 -3 1 2 -3\") = \"false\" ]]\n [[ $(candidate \"1 2 -4 5 6\") = \"true\" ]]\n [[ $(candidate \"1 -1 2 -2 5 -5 4 -4\") = \"false\" ]]\n [[ $(candidate \"1 -1 2 -2 5 -5 4 -5\") = \"true\" ]]\n [[ $(candidate \"1 -2 2 -2 5 -5 4 -4\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "sh", - "prompt": "#!/bin/bash\n# Find the shortest palindrome that begins with a supplied string.\n# Algorithm idea is simple:\n# - Find the longest postfix of supplied string that is a palindrome.\n# - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n# >>> $(make_palindrome \"\")\n# \"\"\n# >>> $(make_palindrome \"cat\")\n# \"catac\"\n# >>> $(make_palindrome \"cata\")\n# \"catac\"\n#\n# $1 is a string\nmake_palindrome() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n make_palindrome \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"x\") = \"x\" ]]\n [[ $(candidate \"xyz\") = \"xyzyx\" ]]\n [[ $(candidate \"xyx\") = \"xyx\" ]]\n [[ $(candidate \"jerry\") = \"jerryrrej\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a positive integer, obtain its roman numeral equivalent as a string,\n# and return it in lowercase.\n# Restrictions: 1 <= num <= 1000\n# Examples:\n# >>> $(int_to_mini_roman \"19\")\n# \"xix\"\n# >>> $(int_to_mini_roman \"152\")\n# \"clii\"\n# >>> $(int_to_mini_roman \"426\")\n# \"cdxxvi\"\n#\n# $1 is an integer\nint_to_mini_roman() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "reworded", - "tests": "}\n\ncandidate() {\n int_to_mini_roman \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"19\") = \"xix\" ]]\n [[ $(candidate \"152\") = \"clii\" ]]\n [[ $(candidate \"251\") = \"ccli\" ]]\n [[ $(candidate \"426\") = \"cdxxvi\" ]]\n [[ $(candidate \"500\") = \"d\" ]]\n [[ $(candidate \"1\") = \"i\" ]]\n [[ $(candidate \"4\") = \"iv\" ]]\n [[ $(candidate \"43\") = \"xliii\" ]]\n [[ $(candidate \"90\") = \"xc\" ]]\n [[ $(candidate \"94\") = \"xciv\" ]]\n [[ $(candidate \"532\") = \"dxxxii\" ]]\n [[ $(candidate \"900\") = \"cm\" ]]\n [[ $(candidate \"994\") = \"cmxciv\" ]]\n [[ $(candidate \"1000\") = \"m\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - } -] \ No newline at end of file diff --git a/data/sh-transform.json b/data/sh-transform.json deleted file mode 100644 index 09620b316d1b02946c27f797820d208619779716..0000000000000000000000000000000000000000 --- a/data/sh-transform.json +++ /dev/null @@ -1,1898 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "sh", - "prompt": "#!/bin/bash\n# For a given number n, find the largest number that divides n evenly, smaller than n\n# >>> $(largest_divisor \"15\")\n# \"5\"\n#\n# $1 is an integer\nlargest_divisor() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n largest_divisor \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3\") = \"1\" ]]\n [[ $(candidate \"7\") = \"1\" ]]\n [[ $(candidate \"10\") = \"5\" ]]\n [[ $(candidate \"100\") = \"50\" ]]\n [[ $(candidate \"49\") = \"7\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_47_median", - "language": "sh", - "prompt": "#!/bin/bash\n# Return median of elements in the list l.\n# >>> $(median \"3 1 2 4 5\")\n# \"3\"\n# >>> $(median \"-10 4 6 1000 10 20\")\n# \"15.0\"\n#\n# $1 is a space-separated list\nmedian() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n median \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3 1 2 4 5\") = \"3\" ]]\n [[ $(candidate \"-10 4 6 1000 10 20\") = \"8.0\" ]]\n [[ $(candidate \"5\") = \"5\" ]]\n [[ $(candidate \"6 5\") = \"5.5\" ]]\n [[ $(candidate \"8 1 3 9 9 2 7\") = \"7\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "sh", - "prompt": "#!/bin/bash\n# Given two lists operator, and operand. The first list has basic algebra operations, and \n# the second list is a list of integers. Use the two given lists to build the algebric \n# expression and return the evaluation of this expression.\n# The basic algebra operations:\n# Addition ( + ) \n# Subtraction ( - ) \n# Multiplication ( * ) \n# Floor division ( // ) \n# Exponentiation ( ** ) \n# Example:\n# operator['+', '*', '-']\n# array = [2, 3, 4, 5]\n# result = 2 + 3 * 4 - 5\n# => result = 9\n# Note:\n# The length of operator list is equal to the length of operand list minus one.\n# Operand is a list of of non-negative integers.\n# Operator list has at least one operator, and operand list has at least two operands.\n#\n# $1 is a space-separated list\n# $2 is a space-separated list\ndo_algebra() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n do_algebra \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"** * +\" \"2 3 4 5\") = \"37\" ]]\n [[ $(candidate \"+ * -\" \"2 3 4 5\") = \"9\" ]]\n [[ $(candidate \"// *\" \"7 3 4\") = \"8\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "sh", - "prompt": "#!/bin/bash\n# Return maximum element in the list.\n# >>> $(max_element \"1 2 3\")\n# \"3\"\n# >>> $(max_element \"5 3 -5 2 -3 3 9 0 123 1 -10\")\n# \"123\"\n#\n# $1 is a space-separated list\nmax_element() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n max_element \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3\") = \"3\" ]]\n [[ $(candidate \"5 3 -5 2 -3 3 9 0 124 1 -10\") = \"124\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function which returns the largest index of an element which\n# is not greater than or equal to the element immediately preceding it. If\n# no such element exists then return -1. The given array will not contain\n# duplicate values.\n# Examples:\n# >>> $(can_arrange \"1 2 4 3 5\")\n# \"3\"\n# >>> $(can_arrange \"1 2 3\")\n# \"-1\"\n#\n# $1 is a space-separated list\ncan_arrange() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n can_arrange \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 4 3 5\") = \"3\" ]]\n [[ $(candidate \"1 2 4 5\") = \"-1\" ]]\n [[ $(candidate \"1 4 2 5 6 7 8 9 10\") = \"2\" ]]\n [[ $(candidate \"4 8 5 7 3\") = \"4\" ]]\n [[ $(candidate \"\") = \"-1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "sh", - "prompt": "#!/bin/bash\n# Imagine a road that's a perfectly straight infinitely long line.\n# n cars are driving left to right; simultaneously, a different set of n cars\n# are driving right to left. The two sets of cars start out being very far from\n# each other. All cars move in the same speed. Two cars are said to collide\n# when a car that's moving left to right hits a car that's moving right to left.\n# However, the cars are infinitely sturdy and strong; as a result, they continue moving\n# in their trajectory as if they did not collide.\n# This function outputs the number of such collisions.\n#\n# $1 is an integer\ncar_race_collision() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n car_race_collision \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2\") = \"4\" ]]\n [[ $(candidate \"3\") = \"9\" ]]\n [[ $(candidate \"4\") = \"16\" ]]\n [[ $(candidate \"8\") = \"64\" ]]\n [[ $(candidate \"10\") = \"100\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function that returns True if the last character\n# of a given string is an alphabetical character and is not\n# a part of a word, and False otherwise.\n# Note: \"word\" is a group of characters separated by space.\n# Examples:\n# >>> $(check_if_last_char_is_a_letter \"apple pie\")\n# \"false\"\n# >>> $(check_if_last_char_is_a_letter \"apple pi e\")\n# \"true\"\n# >>> $(check_if_last_char_is_a_letter \"apple pi e \")\n# \"false\"\n# >>> $(check_if_last_char_is_a_letter \"\")\n# \"false\"\n#\n# $1 is a string\ncheck_if_last_char_is_a_letter() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n check_if_last_char_is_a_letter \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"apple\") = \"false\" ]]\n [[ $(candidate \"apple pi e\") = \"true\" ]]\n [[ $(candidate \"eeeee\") = \"false\" ]]\n [[ $(candidate \"A\") = \"true\" ]]\n [[ $(candidate \"Pumpkin pie \") = \"false\" ]]\n [[ $(candidate \"Pumpkin pie 1\") = \"false\" ]]\n [[ $(candidate \"\") = \"false\" ]]\n [[ $(candidate \"eeeee e \") = \"false\" ]]\n [[ $(candidate \"apple pie\") = \"false\" ]]\n [[ $(candidate \"apple pi e \") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "sh", - "prompt": "#!/bin/bash\n# Return true if a given number is prime, and false otherwise.\n# >>> $(is_prime \"6\")\n# \"false\"\n# >>> $(is_prime \"101\")\n# \"true\"\n# >>> $(is_prime \"11\")\n# \"true\"\n# >>> $(is_prime \"13441\")\n# \"true\"\n# >>> $(is_prime \"61\")\n# \"true\"\n# >>> $(is_prime \"4\")\n# \"false\"\n# >>> $(is_prime \"1\")\n# \"false\"\n#\n# $1 is an integer\nis_prime() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n is_prime \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"6\") = \"false\" ]]\n [[ $(candidate \"101\") = \"true\" ]]\n [[ $(candidate \"11\") = \"true\" ]]\n [[ $(candidate \"13441\") = \"true\" ]]\n [[ $(candidate \"61\") = \"true\" ]]\n [[ $(candidate \"4\") = \"false\" ]]\n [[ $(candidate \"1\") = \"false\" ]]\n [[ $(candidate \"5\") = \"true\" ]]\n [[ $(candidate \"11\") = \"true\" ]]\n [[ $(candidate \"17\") = \"true\" ]]\n [[ $(candidate \"85\") = \"false\" ]]\n [[ $(candidate \"77\") = \"false\" ]]\n [[ $(candidate \"255379\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a list of positive integers x. return a sorted list of all \n# elements that hasn't any even digit.\n# Note: Returned list should be sorted in increasing order.\n# For example:\n# >>> $(unique_digits \"15 33 1422 1\")\n# ['\"1\"', '\"15\"', '\"33\"']\n# >>> $(unique_digits \"152 323 1422 10\")\n# []\n#\n# $1 is a space-separated list\nunique_digits() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n unique_digits \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"15 33 1422 1\") = \"1 15 33\" ]]\n [[ $(candidate \"152 323 1422 10\") = \"\" ]]\n [[ $(candidate \"12345 2033 111 151\") = \"111 151\" ]]\n [[ $(candidate \"135 103 31\") = \"31 135\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "sh", - "prompt": "#!/bin/bash\n# Input are two strings a and b consisting only of 1s and 0s.\n# Perform binary XOR on these inputs and return result also as a string.\n# >>> $(string_xor \"010\" \"110\")\n# \"100\"\n#\n# $1 is a string\n# $2 is a string\nstring_xor() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n string_xor \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"111000\" \"101010\") = \"010010\" ]]\n [[ $(candidate \"1\" \"1\") = \"0\" ]]\n [[ $(candidate \"0101\" \"0000\") = \"0101\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "sh", - "prompt": "#!/bin/bash\n# sum_to_n is a function that sums numbers from 1 to n.\n# >>> $(sum_to_n \"30\")\n# \"465\"\n# >>> $(sum_to_n \"100\")\n# \"5050\"\n# >>> $(sum_to_n \"5\")\n# \"15\"\n# >>> $(sum_to_n \"10\")\n# \"55\"\n# >>> $(sum_to_n \"1\")\n# \"1\"\n#\n# $1 is an integer\nsum_to_n() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n sum_to_n \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1\") = \"1\" ]]\n [[ $(candidate \"6\") = \"21\" ]]\n [[ $(candidate \"11\") = \"66\" ]]\n [[ $(candidate \"30\") = \"465\" ]]\n [[ $(candidate \"100\") = \"5050\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a list of numbers, return the sum of squares of the numbers\n# in the list that are odd. Ignore numbers that are negative or not integers.\n# >>> $(double_the_difference \"1 3 2 0\")\n# \"10\"\n# >>> $(double_the_difference \"-1 -2 0\")\n# \"0\"\n# >>> $(double_the_difference \"9 -2\")\n# \"81\"\n# >>> $(double_the_difference \"0\")\n# \"0\"\n# If the input list is empty, return 0.\n#\n# $1 is a space-separated list\ndouble_the_difference() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n double_the_difference \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"0\" ]]\n [[ $(candidate \"5.0 4.0\") = \"25\" ]]\n [[ $(candidate \"0.1 0.2 0.3\") = \"0\" ]]\n [[ $(candidate \"-10.0 -20.0 -30.0\") = \"0\" ]]\n [[ $(candidate \"-1.0 -2.0 8.0\") = \"0\" ]]\n [[ $(candidate \"0.2 3.0 5.0\") = \"34\" ]]\n [[ $(candidate \"-9.0 -7.0 -5.0 -3.0 -1.0 1.0 3.0 5.0 7.0 9.0\") = \"165\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "sh", - "prompt": "#!/bin/bash\n# Return length of given string\n# >>> $(strlen \"\")\n# \"0\"\n# >>> $(strlen \"abc\")\n# \"3\"\n#\n# $1 is a string\nstrlen() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n strlen \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"0\" ]]\n [[ $(candidate \"x\") = \"1\" ]]\n [[ $(candidate \"asdasnakj\") = \"9\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "sh", - "prompt": "#!/bin/bash\n# You'll be given a string of words, and your task is to count the number\n# of boredoms. A boredom is a sentence that starts with the word \"I\".\n# Sentences are delimited by '.', '?' or '!'.\n# For example:\n# >>> $(is_bored \"Hello world\")\n# \"0\"\n# >>> $(is_bored \"The sky is blue. The sun is shining. I love this weather\")\n# \"1\"\n#\n# $1 is a string\nis_bored() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n is_bored \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Hello world\") = \"0\" ]]\n [[ $(candidate \"Is the sky blue?\") = \"0\" ]]\n [[ $(candidate \"I love It \\!\") = \"1\" ]]\n [[ $(candidate \"bIt\") = \"0\" ]]\n [[ $(candidate \"I feel good today. I will be productive. will kill It\") = \"2\" ]]\n [[ $(candidate \"You and I are going for a walk\") = \"0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function vowels_count which takes a string representing\n# a word as input and returns the number of vowels in the string.\n# Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n# vowel, but only when it is at the end of the given word.\n# Example:\n# >>> $(vowels_count \"abcde\")\n# \"2\"\n# >>> $(vowels_count \"ACEDY\")\n# \"3\"\n#\n# $1 is a string\nvowels_count() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n vowels_count \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"abcde\") = \"2\" ]]\n [[ $(candidate \"Alone\") = \"3\" ]]\n [[ $(candidate \"key\") = \"2\" ]]\n [[ $(candidate \"bye\") = \"1\" ]]\n [[ $(candidate \"keY\") = \"2\" ]]\n [[ $(candidate \"bYe\") = \"1\" ]]\n [[ $(candidate \"ACEDY\") = \"3\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "sh", - "prompt": "#!/bin/bash\n# Return n-th Fibonacci number.\n# >>> $(fib \"10\")\n# \"55\"\n# >>> $(fib \"1\")\n# \"1\"\n# >>> $(fib \"8\")\n# \"21\"\n#\n# $1 is an integer\nfib() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n fib \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"10\") = \"55\" ]]\n [[ $(candidate \"1\") = \"1\" ]]\n [[ $(candidate \"8\") = \"21\" ]]\n [[ $(candidate \"11\") = \"89\" ]]\n [[ $(candidate \"12\") = \"144\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "sh", - "prompt": "#!/bin/bash\n# Your task is to implement a function that will simplify the expression\n# x * n. The function returns True if x * n evaluates to a whole number and False\n# otherwise. Both x and n, are string representation of a fraction, and have the following format,\n# / where both numerator and denominator are positive whole numbers.\n# You can assume that x, and n are valid fractions, and do not have zero as denominator.\n# >>> $(simplify \"1/5\" \"5/1\")\n# \"true\"\n# >>> $(simplify \"1/6\" \"2/1\")\n# \"false\"\n# >>> $(simplify \"7/10\" \"10/2\")\n# \"false\"\n#\n# $1 is a string\n# $2 is a string\nsimplify() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n simplify \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1/5\" \"5/1\") = \"true\" ]]\n [[ $(candidate \"1/6\" \"2/1\") = \"false\" ]]\n [[ $(candidate \"5/1\" \"3/1\") = \"true\" ]]\n [[ $(candidate \"7/10\" \"10/2\") = \"false\" ]]\n [[ $(candidate \"2/10\" \"50/10\") = \"true\" ]]\n [[ $(candidate \"7/2\" \"4/2\") = \"true\" ]]\n [[ $(candidate \"11/6\" \"6/1\") = \"true\" ]]\n [[ $(candidate \"2/3\" \"5/2\") = \"false\" ]]\n [[ $(candidate \"5/2\" \"3/5\") = \"false\" ]]\n [[ $(candidate \"2/4\" \"8/4\") = \"true\" ]]\n [[ $(candidate \"2/4\" \"4/2\") = \"true\" ]]\n [[ $(candidate \"1/5\" \"5/1\") = \"true\" ]]\n [[ $(candidate \"1/5\" \"1/5\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a string s, count the number of uppercase vowels in even indices.\n# For example:\n# >>> $(count_upper \"aBCdEf\")\n# \"1\"\n# >>> $(count_upper \"abcdefg\")\n# \"0\"\n# >>> $(count_upper \"dBBE\")\n# \"0\"\n#\n# $1 is a string\ncount_upper() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n count_upper \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"aBCdEf\") = \"1\" ]]\n [[ $(candidate \"abcdefg\") = \"0\" ]]\n [[ $(candidate \"dBBE\") = \"0\" ]]\n [[ $(candidate \"B\") = \"0\" ]]\n [[ $(candidate \"U\") = \"1\" ]]\n [[ $(candidate \"\") = \"0\" ]]\n [[ $(candidate \"EEEE\") = \"2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a rectangular grid of wells. Each row represents a single well,\n# and each 1 in a row represents a single unit of water.\n# Each well has a corresponding bucket that can be used to extract water from it, \n# and all buckets have the same capacity.\n# Your task is to use the buckets to empty the wells.\n# Output the number of times you need to lower the buckets.\n# Example 1:\n# >>> $(max_fill \"0 0 1 0\\n0 1 0 0\\n1 1 1 1\" \"1\")\n# \"6\"\n# Example 2:\n# >>> $(max_fill \"0 0 1 1\\n0 0 0 0\\n1 1 1 1\\n0 1 1 1\" \"2\")\n# \"5\"\n# Example 3:\n# >>> $(max_fill \"0 0 0\\n0 0 0\" \"5\")\n# \"0\"\n# Constraints:\n# * all wells have the same length\n# * 1 <= grid.length <= 10^2\n# * 1 <= grid[:,1].length <= 10^2\n# * grid[i][j] -> 0 | 1\n# * 1 <= capacity <= 10\n#\n# $1 is a newline-separated, space-separated list\n# $2 is an integer\nmax_fill() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n max_fill \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"0 0 1 0\\n0 1 0 0\\n1 1 1 1\" \"1\") = \"6\" ]]\n [[ $(candidate \"0 0 1 1\\n0 0 0 0\\n1 1 1 1\\n0 1 1 1\" \"2\") = \"5\" ]]\n [[ $(candidate \"0 0 0\\n0 0 0\" \"5\") = \"0\" ]]\n [[ $(candidate \"1 1 1 1\\n1 1 1 1\" \"2\") = \"4\" ]]\n [[ $(candidate \"1 1 1 1\\n1 1 1 1\" \"9\") = \"2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "sh", - "prompt": "#!/bin/bash\n# Given an array arr of integers and a positive integer k, return a sorted list \n# of length k with the maximum k numbers in arr.\n# Example 1:\n# >>> $(maximum \"-3 -4 5\" \"3\")\n# ['\"-4\"', '\"-3\"', '\"5\"']\n# Example 2:\n# >>> $(maximum \"4 -4 4\" \"2\")\n# ['\"4\"', '\"4\"']\n# Example 3:\n# >>> $(maximum \"-3 2 1 2 -1 -2 1\" \"1\")\n# ['\"2\"']\n# Note:\n# 1. The length of the array will be in the range of [1, 1000].\n# 2. The elements in the array will be in the range of [-1000, 1000].\n# 3. 0 <= k <= len(arr)\n#\n# $1 is a space-separated list\n# $2 is an integer\nmaximum() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n maximum \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"-3 -4 5\" \"3\") = \"-4 -3 5\" ]]\n [[ $(candidate \"4 -4 4\" \"2\") = \"4 4\" ]]\n [[ $(candidate \"-3 2 1 2 -1 -2 1\" \"1\") = \"2\" ]]\n [[ $(candidate \"123 -123 20 0 1 2 -3\" \"3\") = \"2 20 123\" ]]\n [[ $(candidate \"-123 20 0 1 2 -3\" \"4\") = \"0 1 2 20\" ]]\n [[ $(candidate \"5 15 0 3 -13 -8 0\" \"7\") = \"-13 -8 0 0 3 5 15\" ]]\n [[ $(candidate \"-1 0 2 5 3 -10\" \"2\") = \"3 5\" ]]\n [[ $(candidate \"1 0 5 -7\" \"1\") = \"5\" ]]\n [[ $(candidate \"4 -4\" \"2\") = \"-4 4\" ]]\n [[ $(candidate \"-10 10\" \"2\") = \"-10 10\" ]]\n [[ $(candidate \"1 2 3 -23 243 -400 0\" \"0\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that takes a message, and encodes in such a \n# way that it swaps case of all letters, replaces all vowels in \n# the message with the letter that appears 2 places ahead of that \n# vowel in the english alphabet. \n# Assume only letters. \n# Examples:\n# >>> $(encode \"test\")\n# \"TGST\"\n# >>> $(encode \"This is a message\")\n# \"tHKS KS C MGSSCGG\"\n#\n# $1 is a string\nencode() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n encode \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"TEST\") = \"tgst\" ]]\n [[ $(candidate \"Mudasir\") = \"mWDCSKR\" ]]\n [[ $(candidate \"YES\") = \"ygs\" ]]\n [[ $(candidate \"This is a message\") = \"tHKS KS C MGSSCGG\" ]]\n [[ $(candidate \"I DoNt KnOw WhAt tO WrItE\") = \"k dQnT kNqW wHcT Tq wRkTg\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "sh", - "prompt": "#!/bin/bash\n# remove_vowels is a function that takes string and returns string without vowels.\n# >>> $(remove_vowels \"\")\n# \"\"\n# >>> $(remove_vowels \"abcdef\")\n# \"bcdf\"\n# >>> $(remove_vowels \"aaaaa\")\n# \"\"\n# >>> $(remove_vowels \"aaBAA\")\n# \"B\"\n# >>> $(remove_vowels \"zbcd\")\n# \"zbcd\"\n#\n# $1 is a string\nremove_vowels() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n remove_vowels \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"abcdef\\nghijklm\") = \"bcdf\\nghjklm\" ]]\n [[ $(candidate \"fedcba\") = \"fdcb\" ]]\n [[ $(candidate \"eeeee\") = \"\" ]]\n [[ $(candidate \"acBAA\") = \"cB\" ]]\n [[ $(candidate \"EcBOO\") = \"cB\" ]]\n [[ $(candidate \"ybcd\") = \"ybcd\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "sh", - "prompt": "#!/bin/bash\n# Return only positive numbers in the list.\n# >>> $(get_positive \"-1 2 -4 5 6\")\n# ['\"2\"', '\"5\"', '\"6\"']\n# >>> $(get_positive \"5 3 -5 2 -3 3 9 0 123 1 -10\")\n# ['\"5\"', '\"3\"', '\"2\"', '\"3\"', '\"9\"', '\"123\"', '\"1\"']\n#\n# $1 is a space-separated list\nget_positive() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n get_positive \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"-1 -2 4 5 6\") = \"4 5 6\" ]]\n [[ $(candidate \"5 3 -5 2 3 3 9 0 123 1 -10\") = \"5 3 2 3 3 9 123 1\" ]]\n [[ $(candidate \"-1 -2\") = \"\" ]]\n [[ $(candidate \"\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "sh", - "prompt": "#!/bin/bash\n# Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n# >>> $(string_sequence \"0\")\n# \"0\"\n# >>> $(string_sequence \"5\")\n# \"0 1 2 3 4 5\"\n#\n# $1 is an integer\nstring_sequence() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n string_sequence \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"0\") = \"0\" ]]\n [[ $(candidate \"3\") = \"0 1 2 3\" ]]\n [[ $(candidate \"10\") = \"0 1 2 3 4 5 6 7 8 9 10\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a positive integer n, you have to make a pile of n levels of stones.\n# The first level has n stones.\n# The number of stones in the next level is:\n# - the next odd number if n is odd.\n# - the next even number if n is even.\n# Return the number of stones in each level in a list, where element at index\n# i represents the number of stones in the level (i+1).\n# Examples:\n# >>> $(make_a_pile \"3\")\n# ['\"3\"', '\"5\"', '\"7\"']\n#\n# $1 is an integer\nmake_a_pile() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n make_a_pile \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3\") = \"3 5 7\" ]]\n [[ $(candidate \"4\") = \"4 6 8 10\" ]]\n [[ $(candidate \"5\") = \"5 7 9 11 13\" ]]\n [[ $(candidate \"6\") = \"6 8 10 12 14 16\" ]]\n [[ $(candidate \"8\") = \"8 10 12 14 16 18 20 22\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "sh", - "prompt": "#!/bin/bash\n# Task\n# 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\n# then check if the result string is palindrome.\n# A string is called palindrome if it reads the same backward as forward.\n# You should return a tuple containing the result string and True/False for the check.\n# Example\n# >>> $(reverse_delete \"abcde\" \"ae\")\n# ['\"bcd\"', '\"false\"']\n# >>> $(reverse_delete \"abcdef\" \"b\")\n# ['\"acdef\"', '\"false\"']\n# >>> $(reverse_delete \"abcdedcba\" \"ab\")\n# ['\"cdedc\"', '\"true\"']\n#\n# $1 is a string\n# $2 is a string\nreverse_delete() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n reverse_delete \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"abcde\" \"ae\") = \"bcd false\" ]]\n [[ $(candidate \"abcdef\" \"b\") = \"acdef false\" ]]\n [[ $(candidate \"abcdedcba\" \"ab\") = \"cdedc true\" ]]\n [[ $(candidate \"dwik\" \"w\") = \"dik false\" ]]\n [[ $(candidate \"a\" \"a\") = \" true\" ]]\n [[ $(candidate \"abcdedcba\" \"\") = \"abcdedcba true\" ]]\n [[ $(candidate \"abcdedcba\" \"v\") = \"abcdedcba true\" ]]\n [[ $(candidate \"vabba\" \"v\") = \"abba true\" ]]\n [[ $(candidate \"mamma\" \"mia\") = \" true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "sh", - "prompt": "#!/bin/bash\n# For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n# >>> $(flip_case \"Hello\")\n# \"hELLO\"\n#\n# $1 is a string\nflip_case() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n flip_case \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"Hello\\!\") = \"hELLO\\!\" ]]\n [[ $(candidate \"These violent delights have violent ends\") = \"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a string s.\n# if s[i] is a letter, reverse its case from lower to upper or vise versa, \n# otherwise keep it as it is.\n# If the string contains no letters, reverse the string.\n# The function should return the resulted string.\n# Examples\n# >>> $(solve \"1234\")\n# \"4321\"\n# >>> $(solve \"ab\")\n# \"AB\"\n# >>> $(solve \"#a@C\")\n# \"#A@c\"\n#\n# $1 is a string\nsolve() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n solve \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"AsDf\") = \"aSdF\" ]]\n [[ $(candidate \"1234\") = \"4321\" ]]\n [[ $(candidate \"ab\") = \"AB\" ]]\n [[ $(candidate \"#a@C\") = \"#A@c\" ]]\n [[ $(candidate \"#AsdfW^45\") = \"#aSDFw^45\" ]]\n [[ $(candidate \"#6@2\") = \"2@6#\" ]]\n [[ $(candidate \"#\\$a^D\") = \"#\\$A^d\" ]]\n [[ $(candidate \"#ccc\") = \"#CCC\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "sh", - "prompt": "#!/bin/bash\n# This function takes two positive numbers x and y and returns the\n# biggest even integer number that is in the range [x, y] inclusive. If \n# there's no such number, then the function should return -1.\n# For example:\n# >>> $(choose_num \"12\" \"15\")\n# \"14\"\n# >>> $(choose_num \"13\" \"12\")\n# \"-1\"\n#\n# $1 is an integer\n# $2 is an integer\nchoose_num() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n choose_num \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"12\" \"15\") = \"14\" ]]\n [[ $(candidate \"13\" \"12\") = \"-1\" ]]\n [[ $(candidate \"33\" \"12354\") = \"12354\" ]]\n [[ $(candidate \"5234\" \"5233\") = \"-1\" ]]\n [[ $(candidate \"6\" \"29\") = \"28\" ]]\n [[ $(candidate \"27\" \"10\") = \"-1\" ]]\n [[ $(candidate \"7\" \"7\") = \"-1\" ]]\n [[ $(candidate \"546\" \"546\") = \"546\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a string representing a sentence,\n# the sentence contains some words separated by a space,\n# and you have to return a string that contains the words from the original sentence,\n# whose lengths are prime numbers,\n# the order of the words in the new string should be the same as the original one.\n# Example 1:\n# >>> $(words_in_sentence \"This is a test\")\n# \"is\"\n# Example 2:\n# >>> $(words_in_sentence \"lets go for swimming\")\n# \"go for\"\n# Constraints:\n# * 1 <= len(sentence) <= 100\n# * sentence contains only letters\n#\n# $1 is a string\nwords_in_sentence() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n words_in_sentence \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"This is a test\") = \"is\" ]]\n [[ $(candidate \"lets go for swimming\") = \"go for\" ]]\n [[ $(candidate \"there is no place available here\") = \"there is no place\" ]]\n [[ $(candidate \"Hi I am Hussein\") = \"Hi am Hussein\" ]]\n [[ $(candidate \"go for it\") = \"go for it\" ]]\n [[ $(candidate \"here\") = \"\" ]]\n [[ $(candidate \"here is\") = \"is\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "sh", - "prompt": "#!/bin/bash\n# Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n# >>> $(intersperse \"\" \"4\")\n# []\n# >>> $(intersperse \"1 2 3\" \"4\")\n# ['\"1\"', '\"4\"', '\"2\"', '\"4\"', '\"3\"']\n#\n# $1 is a space-separated list\n# $2 is an integer\nintersperse() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n intersperse \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\" \"7\") = \"\" ]]\n [[ $(candidate \"5 6 3 2\" \"8\") = \"5 8 6 8 3 8 2\" ]]\n [[ $(candidate \"2 2 2\" \"2\") = \"2 2 2 2 2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "sh", - "prompt": "#!/bin/bash\n# Your task is to write a function that returns true if a number x is a simple\n# power of n and false in other cases.\n# x is a simple power of n if n**int=x\n# For example:\n# >>> $(is_simple_power \"1\" \"4\")\n# \"true\"\n# >>> $(is_simple_power \"2\" \"2\")\n# \"true\"\n# >>> $(is_simple_power \"8\" \"2\")\n# \"true\"\n# >>> $(is_simple_power \"3\" \"2\")\n# \"false\"\n# >>> $(is_simple_power \"3\" \"1\")\n# \"false\"\n# >>> $(is_simple_power \"5\" \"3\")\n# \"false\"\n#\n# $1 is an integer\n# $2 is an integer\nis_simple_power() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n is_simple_power \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"16\" \"2\") = \"true\" ]]\n [[ $(candidate \"143214\" \"16\") = \"false\" ]]\n [[ $(candidate \"4\" \"2\") = \"true\" ]]\n [[ $(candidate \"9\" \"3\") = \"true\" ]]\n [[ $(candidate \"16\" \"4\") = \"true\" ]]\n [[ $(candidate \"24\" \"2\") = \"false\" ]]\n [[ $(candidate \"128\" \"4\") = \"false\" ]]\n [[ $(candidate \"12\" \"6\") = \"false\" ]]\n [[ $(candidate \"1\" \"1\") = \"true\" ]]\n [[ $(candidate \"1\" \"12\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that returns true if the given number is the multiplication of 3 prime numbers\n# and false otherwise.\n# Knowing that (a) is less then 100. \n# Example:\n# >>> $(is_multiply_prime \"30\")\n# \"true\"\n# 30 = 2 * 3 * 5\n#\n# $1 is an integer\nis_multiply_prime() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n is_multiply_prime \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\") = \"false\" ]]\n [[ $(candidate \"30\") = \"true\" ]]\n [[ $(candidate \"8\") = \"true\" ]]\n [[ $(candidate \"10\") = \"false\" ]]\n [[ $(candidate \"125\") = \"true\" ]]\n [[ $(candidate \"105\") = \"true\" ]]\n [[ $(candidate \"126\") = \"false\" ]]\n [[ $(candidate \"729\") = \"false\" ]]\n [[ $(candidate \"891\") = \"false\" ]]\n [[ $(candidate \"1001\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "sh", - "prompt": "#!/bin/bash\n# Given the lengths of the three sides of a triangle. Return True if the three\n# sides form a right-angled triangle, False otherwise.\n# A right-angled triangle is a triangle in which one angle is right angle or \n# 90 degree.\n# Example:\n# >>> $(right_angle_triangle \"3\" \"4\" \"5\")\n# \"true\"\n# >>> $(right_angle_triangle \"1\" \"2\" \"3\")\n# \"false\"\n#\n# $1 is an integer\n# $2 is an integer\n# $3 is an integer\nright_angle_triangle() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n right_angle_triangle \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3\" \"4\" \"5\") = \"true\" ]]\n [[ $(candidate \"1\" \"2\" \"3\") = \"false\" ]]\n [[ $(candidate \"10\" \"6\" \"8\") = \"true\" ]]\n [[ $(candidate \"2\" \"2\" \"2\") = \"false\" ]]\n [[ $(candidate \"7\" \"24\" \"25\") = \"true\" ]]\n [[ $(candidate \"10\" \"5\" \"7\") = \"false\" ]]\n [[ $(candidate \"5\" \"12\" \"13\") = \"true\" ]]\n [[ $(candidate \"15\" \"8\" \"17\") = \"true\" ]]\n [[ $(candidate \"48\" \"55\" \"73\") = \"true\" ]]\n [[ $(candidate \"1\" \"1\" \"1\") = \"false\" ]]\n [[ $(candidate \"2\" \"2\" \"10\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function that takes 3 numbers.\n# Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n# Returns false in any other cases.\n# Examples\n# >>> $(any_int \"5\" \"2\" \"7\")\n# \"true\"\n# >>> $(any_int \"3\" \"2\" \"2\")\n# \"false\"\n# >>> $(any_int \"3\" \"-2\" \"1\")\n# \"true\"\n# >>> $(any_int \"3.6\" \"-2.2\" \"2\")\n# \"false\"\n#\n# $1 is a floating point\n# $2 is a floating point\n# $3 is a floating point\nany_int() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n any_int \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2\" \"3\" \"1\") = \"true\" ]]\n [[ $(candidate \"2.5\" \"2\" \"3\") = \"false\" ]]\n [[ $(candidate \"1.5\" \"5\" \"3.5\") = \"false\" ]]\n [[ $(candidate \"2\" \"6\" \"2\") = \"false\" ]]\n [[ $(candidate \"4\" \"2\" \"2\") = \"true\" ]]\n [[ $(candidate \"2.2\" \"2.2\" \"2.2\") = \"false\" ]]\n [[ $(candidate \"-4\" \"6\" \"2\") = \"true\" ]]\n [[ $(candidate \"2\" \"1\" \"1\") = \"true\" ]]\n [[ $(candidate \"3\" \"4\" \"7\") = \"true\" ]]\n [[ $(candidate \"3.0\" \"4\" \"7\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "sh", - "prompt": "#!/bin/bash\n# This function takes a list l and returns a list l' such that\n# l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n# to the values of the corresponding indicies of l, but sorted.\n# >>> $(sort_third \"1 2 3\")\n# ['\"1\"', '\"2\"', '\"3\"']\n# >>> $(sort_third \"5 6 3 4 8 9 2\")\n# ['\"2\"', '\"6\"', '\"3\"', '\"4\"', '\"8\"', '\"9\"', '\"5\"']\n#\n# $1 is a space-separated list\nsort_third() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n sort_third \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5 6 3 4 8 9 2\") = \"2 6 3 4 8 9 5\" ]]\n [[ $(candidate \"5 8 3 4 6 9 2\") = \"2 8 3 4 6 9 5\" ]]\n [[ $(candidate \"5 6 9 4 8 3 2\") = \"2 6 9 4 8 3 5\" ]]\n [[ $(candidate \"5 6 3 4 8 9 2 1\") = \"2 6 3 4 8 9 5 1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_53_add", - "language": "sh", - "prompt": "#!/bin/bash\n# Add two numbers x and y\n# >>> $(add \"2\" \"3\")\n# \"5\"\n# >>> $(add \"5\" \"7\")\n# \"12\"\n#\n# $1 is an integer\n# $2 is an integer\nadd() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n add \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"0\" \"1\") = \"1\" ]]\n [[ $(candidate \"1\" \"0\") = \"1\" ]]\n [[ $(candidate \"2\" \"3\") = \"5\" ]]\n [[ $(candidate \"5\" \"7\") = \"12\" ]]\n [[ $(candidate \"7\" \"5\") = \"12\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_69_search", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n# zero, and has a frequency greater than or equal to the value of the integer itself. \n# The frequency of an integer is the number of times it appears in the list.\n# If no such a value exist, return -1.\n# Examples:\n# >>> $(search \"4 1 2 2 3 1\")\n# \"2\"\n# >>> $(search \"1 2 2 3 3 3 4 4 4\")\n# \"3\"\n# >>> $(search \"5 5 4 4 4\")\n# \"-1\"\n#\n# $1 is a space-separated list\nsearch() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n search \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5 5 5 5 1\") = \"1\" ]]\n [[ $(candidate \"4 1 4 1 4 4\") = \"4\" ]]\n [[ $(candidate \"3 3\") = \"-1\" ]]\n [[ $(candidate \"8 8 8 8 8 8 8 8\") = \"8\" ]]\n [[ $(candidate \"2 3 3 2 2\") = \"2\" ]]\n [[ $(candidate \"2 7 8 8 4 8 7 3 9 6 5 10 4 3 6 7 1 7 4 10 8 1\") = \"1\" ]]\n [[ $(candidate \"3 2 8 2\") = \"2\" ]]\n [[ $(candidate \"6 7 1 8 8 10 5 8 5 3 10\") = \"1\" ]]\n [[ $(candidate \"8 8 3 6 5 6 4\") = \"-1\" ]]\n [[ $(candidate \"6 9 6 7 1 4 7 1 8 8 9 8 10 10 8 4 10 4 10 1 2 9 5 7 9\") = \"1\" ]]\n [[ $(candidate \"1 9 10 1 3\") = \"1\" ]]\n [[ $(candidate \"6 9 7 5 8 7 5 3 7 5 10 10 3 6 10 2 8 6 5 4 9 5 3 10\") = \"5\" ]]\n [[ $(candidate \"1\") = \"1\" ]]\n [[ $(candidate \"8 8 10 6 4 3 5 8 2 4 2 8 4 6 10 4 2 1 10 2 1 1 5\") = \"4\" ]]\n [[ $(candidate \"2 10 4 8 2 10 5 1 2 9 5 5 6 3 8 6 4 10\") = \"2\" ]]\n [[ $(candidate \"1 6 10 1 6 9 10 8 6 8 7 3\") = \"1\" ]]\n [[ $(candidate \"9 2 4 1 5 1 5 2 5 7 7 7 3 10 1 5 4 2 8 4 1 9 10 7 10 2 8 10 9 4\") = \"4\" ]]\n [[ $(candidate \"2 6 4 2 8 7 5 6 4 10 4 6 3 7 8 8 3 1 4 2 2 10 7\") = \"4\" ]]\n [[ $(candidate \"9 8 6 10 2 6 10 2 7 8 10 3 8 2 6 2 3 1\") = \"2\" ]]\n [[ $(candidate \"5 5 3 9 5 6 3 2 8 5 6 10 10 6 8 4 10 7 7 10 8\") = \"-1\" ]]\n [[ $(candidate \"10\") = \"-1\" ]]\n [[ $(candidate \"9 7 7 2 4 7 2 10 9 7 5 7 2\") = \"2\" ]]\n [[ $(candidate \"5 4 10 2 1 1 10 3 6 1 8\") = \"1\" ]]\n [[ $(candidate \"7 9 9 9 3 4 1 5 9 1 2 1 1 10 7 5 6 7 6 7 7 6\") = \"1\" ]]\n [[ $(candidate \"3 10 10 9 2\") = \"-1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that takes a string and returns True if the string\n# length is a prime number or False otherwise\n# Examples\n# >>> $(prime_length \"Hello\")\n# \"true\"\n# >>> $(prime_length \"abcdcba\")\n# \"true\"\n# >>> $(prime_length \"kittens\")\n# \"true\"\n# >>> $(prime_length \"orange\")\n# \"false\"\n#\n# $1 is a string\nprime_length() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n prime_length \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Hello\") = \"true\" ]]\n [[ $(candidate \"abcdcba\") = \"true\" ]]\n [[ $(candidate \"kittens\") = \"true\" ]]\n [[ $(candidate \"orange\") = \"false\" ]]\n [[ $(candidate \"wow\") = \"true\" ]]\n [[ $(candidate \"world\") = \"true\" ]]\n [[ $(candidate \"MadaM\") = \"true\" ]]\n [[ $(candidate \"Wow\") = \"true\" ]]\n [[ $(candidate \"\") = \"false\" ]]\n [[ $(candidate \"HI\") = \"true\" ]]\n [[ $(candidate \"go\") = \"true\" ]]\n [[ $(candidate \"gogo\") = \"false\" ]]\n [[ $(candidate \"aaaaaaaaaaaaaaa\") = \"false\" ]]\n [[ $(candidate \"Madam\") = \"true\" ]]\n [[ $(candidate \"M\") = \"false\" ]]\n [[ $(candidate \"0\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_58_common", - "language": "sh", - "prompt": "#!/bin/bash\n# Return sorted unique common elements for two lists.\n# >>> $(common \"1 4 3 34 653 2 5\" \"5 7 1 5 9 653 121\")\n# ['\"1\"', '\"5\"', '\"653\"']\n# >>> $(common \"5 3 2 8\" \"3 2\")\n# ['\"2\"', '\"3\"']\n#\n# $1 is a space-separated list\n# $2 is a space-separated list\ncommon() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n common \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 4 3 34 653 2 5\" \"5 7 1 5 9 653 121\") = \"1 5 653\" ]]\n [[ $(candidate \"5 3 2 8\" \"3 2\") = \"2 3\" ]]\n [[ $(candidate \"4 3 2 8\" \"3 2 4\") = \"2 3 4\" ]]\n [[ $(candidate \"4 3 2 8\" \"\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "sh", - "prompt": "#!/bin/bash\n# The Brazilian factorial is defined as:\n# brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n# where n > 0\n# For example:\n# >>> $(special_factorial \"4\")\n# \"288\"\n# The function will receive an integer as input and should return the special\n# factorial of this integer.\n#\n# $1 is an integer\nspecial_factorial() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n special_factorial \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"4\") = \"288\" ]]\n [[ $(candidate \"5\") = \"34560\" ]]\n [[ $(candidate \"7\") = \"125411328000\" ]]\n [[ $(candidate \"1\") = \"1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "sh", - "prompt": "#!/bin/bash\n# In this problem, you will implement a function that takes two lists of numbers,\n# and determines whether it is possible to perform an exchange of elements\n# between them to make lst1 a list of only even numbers.\n# There is no limit on the number of exchanged elements between lst1 and lst2.\n# If it is possible to exchange elements between the lst1 and lst2 to make\n# all the elements of lst1 to be even, return \"YES\".\n# Otherwise, return \"NO\".\n# For example:\n# >>> $(exchange \"1 2 3 4\" \"1 2 3 4\")\n# \"YES\"\n# >>> $(exchange \"1 2 3 4\" \"1 5 3 4\")\n# \"NO\"\n# It is assumed that the input lists will be non-empty.\n#\n# $1 is a space-separated list\n# $2 is a space-separated list\nexchange() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n exchange \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3 4\" \"1 2 3 4\") = \"YES\" ]]\n [[ $(candidate \"1 2 3 4\" \"1 5 3 4\") = \"NO\" ]]\n [[ $(candidate \"1 2 3 4\" \"2 1 4 3\") = \"YES\" ]]\n [[ $(candidate \"5 7 3\" \"2 6 4\") = \"YES\" ]]\n [[ $(candidate \"5 7 3\" \"2 6 3\") = \"NO\" ]]\n [[ $(candidate \"3 2 6 1 8 9\" \"3 5 5 1 1 1\") = \"NO\" ]]\n [[ $(candidate \"100 200\" \"200 200\") = \"YES\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a non-empty array of integers arr and an integer k, return\n# the sum of the elements with at most two digits from the first k elements of arr.\n# Example:\n# >>> $(add_elements \"111 21 3 4000 5 6 7 8 9\" \"4\")\n# \"24\"\n# Constraints:\n# 1. 1 <= len(arr) <= 100\n# 2. 1 <= k <= len(arr)\n#\n# $1 is a space-separated list\n# $2 is an integer\nadd_elements() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n add_elements \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 -2 -3 41 57 76 87 88 99\" \"3\") = \"-4\" ]]\n [[ $(candidate \"111 121 3 4000 5 6\" \"2\") = \"0\" ]]\n [[ $(candidate \"11 21 3 90 5 6 7 8 9\" \"4\") = \"125\" ]]\n [[ $(candidate \"111 21 3 4000 5 6 7 8 9\" \"4\") = \"24\" ]]\n [[ $(candidate \"1\" \"1\") = \"1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "sh", - "prompt": "#!/bin/bash\n# A simple program which should return the value of x if n is \n# a prime number and should return the value of y otherwise.\n# Examples:\n# >>> $(x_or_y \"7\" \"34\" \"12\")\n# \"34\"\n# >>> $(x_or_y \"15\" \"8\" \"5\")\n# \"5\"\n#\n# $1 is an integer\n# $2 is an integer\n# $3 is an integer\nx_or_y() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n x_or_y \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"7\" \"34\" \"12\") = \"34\" ]]\n [[ $(candidate \"15\" \"8\" \"5\") = \"5\" ]]\n [[ $(candidate \"3\" \"33\" \"5212\") = \"33\" ]]\n [[ $(candidate \"1259\" \"3\" \"52\") = \"3\" ]]\n [[ $(candidate \"7919\" \"-1\" \"12\") = \"-1\" ]]\n [[ $(candidate \"3609\" \"1245\" \"583\") = \"583\" ]]\n [[ $(candidate \"91\" \"56\" \"129\") = \"129\" ]]\n [[ $(candidate \"6\" \"34\" \"1234\") = \"1234\" ]]\n [[ $(candidate \"1\" \"2\" \"0\") = \"0\" ]]\n [[ $(candidate \"2\" \"2\" \"0\") = \"2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "sh", - "prompt": "#!/bin/bash\n# Given length of a side and high return area for a triangle.\n# >>> $(triangle_area \"5\" \"3\")\n# \"7.5\"\n#\n# $1 is an integer\n# $2 is an integer\ntriangle_area() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n triangle_area \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\" \"3\") = \"7.5\" ]]\n [[ $(candidate \"2\" \"2\") = \"2.0\" ]]\n [[ $(candidate \"10\" \"8\") = \"40.0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "sh", - "prompt": "#!/bin/bash\n# Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n# the last couple centuries. However, what people don't know is Tribonacci sequence.\n# Tribonacci sequence is defined by the recurrence:\n# tri(1) = 3\n# tri(n) = 1 + n / 2, if n is even.\n# tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n# For example:\n# tri(2) = 1 + (2 / 2) = 2\n# tri(4) = 3\n# tri(3) = tri(2) + tri(1) + tri(4)\n# = 2 + 3 + 3 = 8 \n# You are given a non-negative integer number n, you have to a return a list of the \n# first n + 1 numbers of the Tribonacci sequence.\n# Examples:\n# >>> $(tri \"3\")\n# ['\"1\"', '\"3\"', '\"2\"', '\"8\"']\n#\n# $1 is an integer\ntri() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n tri \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3\") = \"1 3 2 8\" ]]\n [[ $(candidate \"4\") = \"1 3 2 8 3\" ]]\n [[ $(candidate \"5\") = \"1 3 2 8 3 15\" ]]\n [[ $(candidate \"6\") = \"1 3 2 8 3 15 4\" ]]\n [[ $(candidate \"7\") = \"1 3 2 8 3 15 4 24\" ]]\n [[ $(candidate \"8\") = \"1 3 2 8 3 15 4 24 5\" ]]\n [[ $(candidate \"9\") = \"1 3 2 8 3 15 4 24 5 35\" ]]\n [[ $(candidate \"20\") = \"1 3 2 8 3 15 4 24 5 35 6 48 7 63 8 80 9 99 10 120 11\" ]]\n [[ $(candidate \"0\") = \"1\" ]]\n [[ $(candidate \"1\") = \"1 3\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a list of two strings, both strings consist of open\n# parentheses '(' or close parentheses ')' only.\n# Your job is to check if it is possible to concatenate the two strings in\n# some order, that the resulting string will be good.\n# A string S is considered to be good if and only if all parentheses in S\n# are balanced. For example: the string '(())()' is good, while the string\n# '())' is not.\n# Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n# Examples:\n# >>> $(match_parens \"()( )\")\n# \"Yes\"\n# >>> $(match_parens \") )\")\n# \"No\"\n#\n# $1 is a space-separated list\nmatch_parens() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n match_parens \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"()( )\") = \"Yes\" ]]\n [[ $(candidate \") )\") = \"No\" ]]\n [[ $(candidate \"(()(()) ())())\") = \"No\" ]]\n [[ $(candidate \")()) (()()(\") = \"Yes\" ]]\n [[ $(candidate \"(()))) (()())((\") = \"Yes\" ]]\n [[ $(candidate \"() ())\") = \"No\" ]]\n [[ $(candidate \"(()( ()))()\") = \"Yes\" ]]\n [[ $(candidate \"(((( ((())\") = \"No\" ]]\n [[ $(candidate \")(() (()(\") = \"No\" ]]\n [[ $(candidate \")( )(\") = \"No\" ]]\n [[ $(candidate \"( )\") = \"Yes\" ]]\n [[ $(candidate \") (\") = \"Yes\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "sh", - "prompt": "#!/bin/bash\n# From a list of integers, remove all elements that occur more than once.\n# Keep order of elements left the same as in the input.\n# >>> $(remove_duplicates \"1 2 3 2 4\")\n# ['\"1\"', '\"3\"', '\"4\"']\n#\n# $1 is a space-separated list\nremove_duplicates() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n remove_duplicates \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"1 2 3 4\") = \"1 2 3 4\" ]]\n [[ $(candidate \"1 2 3 2 4 3 5\") = \"1 4 5\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "sh", - "prompt": "#!/bin/bash\n# Return a greatest common divisor of two integers a and b\n# >>> $(greatest_common_divisor \"3\" \"5\")\n# \"1\"\n# >>> $(greatest_common_divisor \"25\" \"15\")\n# \"5\"\n#\n# $1 is an integer\n# $2 is an integer\ngreatest_common_divisor() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n greatest_common_divisor \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3\" \"7\") = \"1\" ]]\n [[ $(candidate \"10\" \"15\") = \"5\" ]]\n [[ $(candidate \"49\" \"14\") = \"7\" ]]\n [[ $(candidate \"144\" \"60\") = \"12\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "sh", - "prompt": "#!/bin/bash\n# Checks if given string is a palindrome\n# >>> $(is_palindrome \"\")\n# \"true\"\n# >>> $(is_palindrome \"aba\")\n# \"true\"\n# >>> $(is_palindrome \"aaaaa\")\n# \"true\"\n# >>> $(is_palindrome \"zbcd\")\n# \"false\"\n#\n# $1 is a string\nis_palindrome() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n is_palindrome \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"true\" ]]\n [[ $(candidate \"aba\") = \"true\" ]]\n [[ $(candidate \"aaaaa\") = \"true\" ]]\n [[ $(candidate \"zbcd\") = \"false\" ]]\n [[ $(candidate \"xywyx\") = \"true\" ]]\n [[ $(candidate \"xywyz\") = \"false\" ]]\n [[ $(candidate \"xywzx\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "sh", - "prompt": "#!/bin/bash\n# xs represent coefficients of a polynomial.\n# xs[0] + xs[1] * x + xs[2] * x^2 + ....\n# Return derivative of this polynomial in the same form.\n# >>> $(derivative \"3 1 2 4 5\")\n# ['\"1\"', '\"4\"', '\"12\"', '\"20\"']\n# >>> $(derivative \"1 2 3\")\n# ['\"2\"', '\"6\"']\n#\n# $1 is a space-separated list\nderivative() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n derivative \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3 1 2 4 5\") = \"1 4 12 20\" ]]\n [[ $(candidate \"1 2 3\") = \"2 6\" ]]\n [[ $(candidate \"3 2 1\") = \"2 2\" ]]\n [[ $(candidate \"3 2 1 0 4\") = \"2 2 0 16\" ]]\n [[ $(candidate \"1\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "sh", - "prompt": "#!/bin/bash\n# In this task, you will be given a string that represents a number of apples and oranges \n# that are distributed in a basket of fruit this basket contains \n# apples, oranges, and mango fruits. Given the string that represents the total number of \n# the oranges and apples and an integer that represent the total number of the fruits \n# in the basket return the number of the mango fruits in the basket.\n# for examble:\n# >>> $(fruit_distribution \"5 apples and 6 oranges\" \"19\")\n# \"8\"\n# >>> $(fruit_distribution \"0 apples and 1 oranges\" \"3\")\n# \"2\"\n# >>> $(fruit_distribution \"2 apples and 3 oranges\" \"100\")\n# \"95\"\n# >>> $(fruit_distribution \"100 apples and 1 oranges\" \"120\")\n# \"19\"\n#\n# $1 is a string\n# $2 is an integer\nfruit_distribution() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n fruit_distribution \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5 apples and 6 oranges\" \"19\") = \"8\" ]]\n [[ $(candidate \"5 apples and 6 oranges\" \"21\") = \"10\" ]]\n [[ $(candidate \"0 apples and 1 oranges\" \"3\") = \"2\" ]]\n [[ $(candidate \"1 apples and 0 oranges\" \"3\") = \"2\" ]]\n [[ $(candidate \"2 apples and 3 oranges\" \"100\") = \"95\" ]]\n [[ $(candidate \"2 apples and 3 oranges\" \"5\") = \"0\" ]]\n [[ $(candidate \"1 apples and 100 oranges\" \"120\") = \"19\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that takes an integer a and returns True \n# if this ingeger is a cube of some integer number.\n# Note: you may assume the input is always valid.\n# Examples:\n# >>> $(iscube \"1\")\n# \"true\"\n# >>> $(iscube \"2\")\n# \"false\"\n# >>> $(iscube \"-1\")\n# \"true\"\n# >>> $(iscube \"64\")\n# \"true\"\n# >>> $(iscube \"0\")\n# \"true\"\n# >>> $(iscube \"180\")\n# \"false\"\n#\n# $1 is an integer\niscube() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n iscube \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1\") = \"true\" ]]\n [[ $(candidate \"2\") = \"false\" ]]\n [[ $(candidate \"-1\") = \"true\" ]]\n [[ $(candidate \"64\") = \"true\" ]]\n [[ $(candidate \"180\") = \"false\" ]]\n [[ $(candidate \"1000\") = \"true\" ]]\n [[ $(candidate \"0\") = \"true\" ]]\n [[ $(candidate \"1729\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "sh", - "prompt": "#!/bin/bash\n# In this Kata, you have to sort an array of non-negative integers according to\n# number of ones in their binary representation in ascending order.\n# For similar number of ones, sort based on decimal value.\n# It must be implemented like this:\n# >>> $(sort_array \"1 5 2 3 4\")\n# ['\"1\"', '\"2\"', '\"3\"', '\"4\"', '\"5\"']\n# >>> $(sort_array \"-2 -3 -4 -5 -6\")\n# ['\"-6\"', '\"-5\"', '\"-4\"', '\"-3\"', '\"-2\"']\n# >>> $(sort_array \"1 0 2 3 4\")\n# ['\"0\"', '\"1\"', '\"2\"', '\"3\"', '\"4\"']\n#\n# $1 is a space-separated list\nsort_array() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n sort_array \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 5 2 3 4\") = \"1 2 4 3 5\" ]]\n [[ $(candidate \"-2 -3 -4 -5 -6\") = \"-4 -2 -6 -5 -3\" ]]\n [[ $(candidate \"1 0 2 3 4\") = \"0 1 2 4 3\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"2 5 77 4 5 3 5 7 2 3 4\") = \"2 2 4 4 3 3 5 5 5 7 77\" ]]\n [[ $(candidate \"3 6 44 12 32 5\") = \"32 3 5 6 12 44\" ]]\n [[ $(candidate \"2 4 8 16 32\") = \"2 4 8 16 32\" ]]\n [[ $(candidate \"2 4 8 16 32\") = \"2 4 8 16 32\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "sh", - "prompt": "#!/bin/bash\n# brackets is a string of \"(\" and \")\".\n# return True if every opening bracket has a corresponding closing bracket.\n# >>> $(correct_bracketing \"(\")\n# \"false\"\n# >>> $(correct_bracketing \"()\")\n# \"true\"\n# >>> $(correct_bracketing \"(()())\")\n# \"true\"\n# >>> $(correct_bracketing \")(()\")\n# \"false\"\n#\n# $1 is a string\ncorrect_bracketing() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n correct_bracketing \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"()\") = \"true\" ]]\n [[ $(candidate \"(()())\") = \"true\" ]]\n [[ $(candidate \"()()(()())()\") = \"true\" ]]\n [[ $(candidate \"()()((()()())())(()()(()))\") = \"true\" ]]\n [[ $(candidate \"((()())))\") = \"false\" ]]\n [[ $(candidate \")(()\") = \"false\" ]]\n [[ $(candidate \"(\") = \"false\" ]]\n [[ $(candidate \"((((\") = \"false\" ]]\n [[ $(candidate \")\") = \"false\" ]]\n [[ $(candidate \"(()\") = \"false\" ]]\n [[ $(candidate \"()()(()())())(()\") = \"false\" ]]\n [[ $(candidate \"()()(()())()))()\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "sh", - "prompt": "#!/bin/bash\n# Task\n# Write a function that takes a string as input and returns the sum of the upper characters only'\n# ASCII codes.\n# Examples:\n# >>> $(digitSum \"\")\n# \"0\"\n# >>> $(digitSum \"abAB\")\n# \"131\"\n# >>> $(digitSum \"abcCd\")\n# \"67\"\n# >>> $(digitSum \"helloE\")\n# \"69\"\n# >>> $(digitSum \"woArBld\")\n# \"131\"\n# >>> $(digitSum \"aAaaaXa\")\n# \"153\"\n#\n# $1 is a string\ndigitSum() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n digitSum \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"0\" ]]\n [[ $(candidate \"abAB\") = \"131\" ]]\n [[ $(candidate \"abcCd\") = \"67\" ]]\n [[ $(candidate \"helloE\") = \"69\" ]]\n [[ $(candidate \"woArBld\") = \"131\" ]]\n [[ $(candidate \"aAaaaXa\") = \"153\" ]]\n [[ $(candidate \" How are yOu?\") = \"151\" ]]\n [[ $(candidate \"You arE Very Smart\") = \"327\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that accepts a list of strings as a parameter,\n# deletes the strings that have odd lengths from it,\n# and returns the resulted list with a sorted order,\n# The list is always a list of strings and never an array of numbers,\n# and it may contain duplicates.\n# The order of the list should be ascending by length of each word, and you\n# should return the list sorted by that rule.\n# If two words have the same length, sort the list alphabetically.\n# The function should return a list of strings in sorted order.\n# You may assume that all words will have the same length.\n# For example:\n# >>> $(list_sort \"aa a aaa\")\n# ['\"aa\"']\n# >>> $(list_sort \"ab a aaa cd\")\n# ['\"ab\"', '\"cd\"']\n#\n# $1 is a space-separated list\nsorted_list_sum() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n sorted_list_sum \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"aa a aaa\") = \"aa\" ]]\n [[ $(candidate \"school AI asdf b\") = \"AI asdf school\" ]]\n [[ $(candidate \"d b c a\") = \"\" ]]\n [[ $(candidate \"d dcba abcd a\") = \"abcd dcba\" ]]\n [[ $(candidate \"AI ai au\") = \"AI ai au\" ]]\n [[ $(candidate \"a b b c c a\") = \"\" ]]\n [[ $(candidate \"aaaa bbbb dd cc\") = \"cc dd aaaa bbbb\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given an array arr of integers and you need to return\n# sum of magnitudes of integers multiplied by product of all signs\n# of each number in the array, represented by 1, -1 or 0.\n# Note: return None for empty arr.\n# Example:\n# >>> $(prod_signs \"1 2 2 -4\")\n# \"9\"\n# >>> $(prod_signs \"0 1\")\n# \"0\"\n# >>> $(prod_signs \"\")\n# \"None\"\n#\n# $1 is a space-separated list\nprod_signs() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n prod_signs \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 2 -4\") = \"-9\" ]]\n [[ $(candidate \"0 1\") = \"0\" ]]\n [[ $(candidate \"1 1 1 2 3 -1 1\") = \"-10\" ]]\n [[ $(candidate \"\") = \"None\" ]]\n [[ $(candidate \"2 4 1 2 -1 -1 9\") = \"20\" ]]\n [[ $(candidate \"-1 1 -1 1\") = \"4\" ]]\n [[ $(candidate \"-1 1 1 1\") = \"-4\" ]]\n [[ $(candidate \"-1 1 1 0\") = \"0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "sh", - "prompt": "#!/bin/bash\n# Return list with elements incremented by 1.\n# >>> $(incr_list \"1 2 3\")\n# ['\"2\"', '\"3\"', '\"4\"']\n# >>> $(incr_list \"5 3 5 2 3 3 9 0 123\")\n# ['\"6\"', '\"4\"', '\"6\"', '\"3\"', '\"4\"', '\"4\"', '\"10\"', '\"1\"', '\"124\"']\n#\n# $1 is a space-separated list\nincr_list() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n incr_list \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"3 2 1\") = \"4 3 2\" ]]\n [[ $(candidate \"5 2 5 2 3 3 9 0 123\") = \"6 3 6 3 4 4 10 1 124\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "sh", - "prompt": "#!/bin/bash\n# From a given list of integers, generate a list of rolling maximum element found until given moment\n# in the sequence.\n# >>> $(rolling_max \"1 2 3 2 3 4 2\")\n# ['\"1\"', '\"2\"', '\"3\"', '\"3\"', '\"3\"', '\"4\"', '\"4\"']\n#\n# $1 is a space-separated list\nrolling_max() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n rolling_max \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"1 2 3 4\") = \"1 2 3 4\" ]]\n [[ $(candidate \"4 3 2 1\") = \"4 4 4 4\" ]]\n [[ $(candidate \"3 2 3 100 3\") = \"3 3 3 100 100\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "sh", - "prompt": "#!/bin/bash\n# Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n# separate those group into separate strings and return the list of those.\n# Separate groups are balanced (each open brace is properly closed) and not nested within each other\n# Ignore any spaces in the input string.\n# >>> $(separate_paren_groups \"( ) (( )) (( )( ))\")\n# ['\"()\"', '\"(())\"', '\"(()())\"']\n#\n# $1 is a string\nseparate_paren_groups() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n separate_paren_groups \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"(()()) ((())) () ((())()())\") = \"(()()) ((())) () ((())()())\" ]]\n [[ $(candidate \"() (()) ((())) (((())))\") = \"() (()) ((())) (((())))\" ]]\n [[ $(candidate \"(()(())((())))\") = \"(()(())((())))\" ]]\n [[ $(candidate \"( ) (( )) (( )( ))\") = \"() (()) (()())\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "sh", - "prompt": "#!/bin/bash\n# You will be given a string of words separated by commas or spaces. Your task is\n# to split the string into words and return an array of the words.\n# For example:\n# >>> $(words_string \"Hi, my name is John\")\n# ['\"Hi\"', '\"my\"', '\"name\"', '\"is\"', '\"John\"']\n# >>> $(words_string \"One, two, three, four, five, six\")\n# ['\"One\"', '\"two\"', '\"three\"', '\"four\"', '\"five\"', '\"six\"']\n#\n# $1 is a string\nwords_string() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n words_string \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Hi, my name is John\") = \"Hi my name is John\" ]]\n [[ $(candidate \"One, two, three, four, five, six\") = \"One two three four five six\" ]]\n [[ $(candidate \"Hi, my name\") = \"Hi my name\" ]]\n [[ $(candidate \"One,, two, three, four, five, six,\") = \"One two three four five six\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"ahmed , gamal\") = \"ahmed gamal\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function that takes integers, floats, or strings representing\n# real numbers, and returns the larger variable in its given variable type.\n# Return None if the values are equal.\n# Note: If a real number is represented as a string, the floating point might be . or ,\n# >>> $(compare_one \"1\" \"2.5\")\n# \"2.5\"\n# >>> $(compare_one \"1\" \"2,3\")\n# \"2,3\"\n# >>> $(compare_one \"5,1\" \"6\")\n# \"6\"\n# >>> $(compare_one \"1\" \"1\")\n# \"None\"\n#\n# $1 is an argument\n# $2 is an argument\ncompare_one() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n compare_one \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1\" \"2\") = \"2\" ]]\n [[ $(candidate \"1\" \"2.5\") = \"2.5\" ]]\n [[ $(candidate \"2\" \"3\") = \"3\" ]]\n [[ $(candidate \"5\" \"6\") = \"6\" ]]\n [[ $(candidate \"1\" \"2,3\") = \"2,3\" ]]\n [[ $(candidate \"5,1\" \"6\") = \"6\" ]]\n [[ $(candidate \"1\" \"2\") = \"2\" ]]\n [[ $(candidate \"1\" \"1\") = \"None\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "sh", - "prompt": "#!/bin/bash\n# Filter given list of any python values only for integers\n# >>> $(filter_integers \"a 3.14 5\")\n# ['\"5\"']\n# >>> $(filter_integers \"1 2 3 abc \")\n# ['\"1\"', '\"2\"', '\"3\"']\n#\n# $1 is a space-separated list\nfilter_integers() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n filter_integers \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"4 23.2 9 adasd\") = \"4 9\" ]]\n [[ $(candidate \"3 c 3 3 a b\") = \"3 3 3\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "sh", - "prompt": "#!/bin/bash\n# This function takes a list l and returns a list l' such that\n# l' is identical to l in the odd indicies, while its values at the even indicies are equal\n# to the values of the even indicies of l, but sorted.\n# >>> $(sort_even \"1 2 3\")\n# ['\"1\"', '\"2\"', '\"3\"']\n# >>> $(sort_even \"5 6 3 4\")\n# ['\"3\"', '\"6\"', '\"5\"', '\"4\"']\n#\n# $1 is a space-separated list\nsort_even() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n sort_even \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3\") = \"1 2 3\" ]]\n [[ $(candidate \"5 3 -5 2 -3 3 9 0 123 1 -10\") = \"-10 3 -5 2 -3 3 5 0 9 1 123\" ]]\n [[ $(candidate \"5 8 -12 4 23 2 3 11 12 -10\") = \"-12 8 3 4 5 2 12 11 23 -10\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "sh", - "prompt": "#!/bin/bash\n# I think we all remember that feeling when the result of some long-awaited\n# event is finally known. The feelings and thoughts you have at that moment are\n# definitely worth noting down and comparing.\n# Your task is to determine if a person correctly guessed the results of a number of matches.\n# You are given two arrays of scores and guesses of equal length, where each index shows a match. \n# Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n# the value is 0, and if not, the value is the absolute difference between the guess and the score.\n# example:\n# >>> $(compare \"1 2 3 4 5 1\" \"1 2 3 4 2 -2\")\n# ['\"0\"', '\"0\"', '\"0\"', '\"0\"', '\"3\"', '\"3\"']\n# >>> $(compare \"0 5 0 0 0 4\" \"4 1 1 0 0 -2\")\n# ['\"4\"', '\"4\"', '\"1\"', '\"0\"', '\"0\"', '\"6\"']\n#\n# $1 is a space-separated list\n# $2 is a space-separated list\ncompare() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n compare \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3 4 5 1\" \"1 2 3 4 2 -2\") = \"0 0 0 0 3 3\" ]]\n [[ $(candidate \"0 0 0 0 0 0\" \"0 0 0 0 0 0\") = \"0 0 0 0 0 0\" ]]\n [[ $(candidate \"1 2 3\" \"-1 -2 -3\") = \"2 4 6\" ]]\n [[ $(candidate \"1 2 3 5\" \"-1 2 3 4\") = \"2 0 0 1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a positive integer n, return a tuple that has the number of even and odd\n# integer palindromes that fall within the range(1, n), inclusive.\n# Example 1:\n# >>> $(even_odd_palindrome \"3\")\n# ['\"1\"', '\"2\"']\n# Explanation:\n# Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n# Example 2:\n# >>> $(even_odd_palindrome \"12\")\n# ['\"4\"', '\"6\"']\n# Explanation:\n# Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n# Note:\n# 1. 1 <= n <= 10^3\n# 2. returned tuple has the number of even and odd integer palindromes respectively.\n#\n# $1 is an integer\neven_odd_palindrome() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n even_odd_palindrome \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"123\") = \"8 13\" ]]\n [[ $(candidate \"12\") = \"4 6\" ]]\n [[ $(candidate \"3\") = \"1 2\" ]]\n [[ $(candidate \"63\") = \"6 8\" ]]\n [[ $(candidate \"25\") = \"5 6\" ]]\n [[ $(candidate \"19\") = \"4 6\" ]]\n [[ $(candidate \"9\") = \"4 5\" ]]\n [[ $(candidate \"1\") = \"0 1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "sh", - "prompt": "#!/bin/bash\n# The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fib4(0) -> 0\n# fib4(1) -> 0\n# fib4(2) -> 2\n# fib4(3) -> 0\n# fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n# Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n# >>> $(fib4 \"5\")\n# \"4\"\n# >>> $(fib4 \"6\")\n# \"8\"\n# >>> $(fib4 \"7\")\n# \"14\"\n#\n# $1 is an integer\nfib4() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n fib4 \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\") = \"4\" ]]\n [[ $(candidate \"8\") = \"28\" ]]\n [[ $(candidate \"10\") = \"104\" ]]\n [[ $(candidate \"12\") = \"386\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "sh", - "prompt": "#!/bin/bash\n# Given two positive integers a and b, return the even digits between a\n# and b, in ascending order.\n# For example:\n# >>> $(generate_integers \"2\" \"8\")\n# ['\"2\"', '\"4\"', '\"6\"', '\"8\"']\n# >>> $(generate_integers \"8\" \"2\")\n# ['\"2\"', '\"4\"', '\"6\"', '\"8\"']\n# >>> $(generate_integers \"10\" \"14\")\n# []\n#\n# $1 is an integer\n# $2 is an integer\ngenerate_integers() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n generate_integers \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2\" \"10\") = \"2 4 6 8\" ]]\n [[ $(candidate \"10\" \"2\") = \"2 4 6 8\" ]]\n [[ $(candidate \"132\" \"2\") = \"2 4 6 8\" ]]\n [[ $(candidate \"17\" \"89\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "sh", - "prompt": "#!/bin/bash\n# For a given list of input numbers, calculate Mean Absolute Deviation\n# around the mean of this dataset.\n# Mean Absolute Deviation is the average absolute difference between each\n# element and a centerpoint (mean in this case):\n# MAD = average | x - x_mean |\n# >>> $(mean_absolute_deviation \"1.0 2.0 3.0 4.0\")\n# \"1.0\"\n#\n# $1 is a space-separated list\nmean_absolute_deviation() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n mean_absolute_deviation \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1.0 2.0\") = \"0.5\" ]]\n [[ $(candidate \"1.0 2.0 3.0 4.0\") = \"1.0\" ]]\n [[ $(candidate \"1.0 2.0 3.0 4.0 5.0\") = \"1.2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function encrypt that takes a string as an argument and\n# returns a string encrypted with the alphabet being rotated. \n# The alphabet should be rotated in a manner such that the letters \n# shift down by two multiplied to two places.\n# For example:\n# >>> $(encrypt \"hi\")\n# \"lm\"\n# >>> $(encrypt \"asdfghjkl\")\n# \"ewhjklnop\"\n# >>> $(encrypt \"gf\")\n# \"kj\"\n# >>> $(encrypt \"et\")\n# \"ix\"\n#\n# $1 is a string\nencrypt() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n encrypt \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"hi\") = \"lm\" ]]\n [[ $(candidate \"asdfghjkl\") = \"ewhjklnop\" ]]\n [[ $(candidate \"gf\") = \"kj\" ]]\n [[ $(candidate \"et\") = \"ix\" ]]\n [[ $(candidate \"faewfawefaewg\") = \"jeiajeaijeiak\" ]]\n [[ $(candidate \"hellomyfriend\") = \"lippsqcjvmirh\" ]]\n [[ $(candidate \"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\") = \"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\" ]]\n [[ $(candidate \"a\") = \"e\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n# The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n# as follows: start with any positive integer n. Then each term is obtained from the \n# previous term as follows: if the previous term is even, the next term is one half of \n# the previous term. If the previous term is odd, the next term is 3 times the previous\n# term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n# Note: \n# 1. Collatz(1) is [1].\n# 2. returned list sorted in increasing order.\n# For example:\n# get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n# >>> $(get_odd_collatz \"5\")\n# ['\"1\"', '\"5\"']\n#\n# $1 is an integer\nget_odd_collatz() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n get_odd_collatz \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"14\") = \"1 5 7 11 13 17\" ]]\n [[ $(candidate \"5\") = \"1 5\" ]]\n [[ $(candidate \"12\") = \"1 3 5\" ]]\n [[ $(candidate \"1\") = \"1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "sh", - "prompt": "#!/bin/bash\n# Find how many times a given substring can be found in the original string. Count overlaping cases.\n# >>> $(how_many_times \"\" \"a\")\n# \"0\"\n# >>> $(how_many_times \"aaa\" \"a\")\n# \"3\"\n# >>> $(how_many_times \"aaaa\" \"aa\")\n# \"3\"\n#\n# $1 is a string\n# $2 is a string\nhow_many_times() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n how_many_times \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\" \"x\") = \"0\" ]]\n [[ $(candidate \"xyxyxyx\" \"x\") = \"4\" ]]\n [[ $(candidate \"cacacacac\" \"cac\") = \"4\" ]]\n [[ $(candidate \"john doe\" \"john\") = \"1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "sh", - "prompt": "#!/bin/bash\n# We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n# numbers in the array will be randomly ordered. Your task is to determine if\n# it is possible to get an array sorted in non-decreasing order by performing \n# the following operation on the given array:\n# You are allowed to perform right shift operation any number of times.\n# One right shift operation means shifting all elements of the array by one\n# position in the right direction. The last element of the array will be moved to\n# the starting position in the array i.e. 0th index. \n# If it is possible to obtain the sorted array by performing the above operation\n# then return True else return False.\n# If the given array is empty then return True.\n# Note: The given list is guaranteed to have unique elements.\n# For Example:\n# >>> $(move_one_ball \"3 4 5 1 2\")\n# \"true\"\n# Explanation: By performin 2 right shift operations, non-decreasing order can\n# be achieved for the given array.\n# >>> $(move_one_ball \"3 5 4 1 2\")\n# \"false\"\n# Explanation:It is not possible to get non-decreasing order for the given\n# array by performing any number of right shift operations.\n#\n# $1 is a space-separated list\nmove_one_ball() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n move_one_ball \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3 4 5 1 2\") = \"true\" ]]\n [[ $(candidate \"3 5 10 1 2\") = \"true\" ]]\n [[ $(candidate \"4 3 1 2\") = \"false\" ]]\n [[ $(candidate \"3 5 4 1 2\") = \"false\" ]]\n [[ $(candidate \"\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function which sorts the given list of integers\n# in ascending order according to the sum of their digits.\n# Note: if there are several items with similar sum of their digits,\n# order them based on their index in original list.\n# For example:\n# >>> $(order_by_points \"1 11 -1 -11 -12\")\n# ['\"-1\"', '\"-11\"', '\"1\"', '\"-12\"', '\"11\"']\n# >>> $(order_by_points \"\")\n# []\n#\n# $1 is a space-separated list\norder_by_points() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n order_by_points \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 11 -1 -11 -12\") = \"-1 -11 1 -12 11\" ]]\n [[ $(candidate \"1234 423 463 145 2 423 423 53 6 37 3457 3 56 0 46\") = \"0 2 3 6 53 423 423 423 1234 145 37 46 56 463 3457\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"1 -11 -32 43 54 -98 2 -3\") = \"-3 -32 -98 -11 1 2 43 54\" ]]\n [[ $(candidate \"1 2 3 4 5 6 7 8 9 10 11\") = \"1 10 2 11 3 4 5 6 7 8 9\" ]]\n [[ $(candidate \"0 6 6 -76 -21 23 4\") = \"-76 -21 0 4 23 6 6\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "sh", - "prompt": "#!/bin/bash\n# Return list of prime factors of given integer in the order from smallest to largest.\n# Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n# Input number should be equal to the product of all factors\n# >>> $(factorize \"8\")\n# ['\"2\"', '\"2\"', '\"2\"']\n# >>> $(factorize \"25\")\n# ['\"5\"', '\"5\"']\n# >>> $(factorize \"70\")\n# ['\"2\"', '\"5\"', '\"7\"']\n#\n# $1 is an integer\nfactorize() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n factorize \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2\") = \"2\" ]]\n [[ $(candidate \"4\") = \"2 2\" ]]\n [[ $(candidate \"8\") = \"2 2 2\" ]]\n [[ $(candidate \"57\") = \"3 19\" ]]\n [[ $(candidate \"3249\") = \"3 3 19 19\" ]]\n [[ $(candidate \"185193\") = \"3 3 3 19 19 19\" ]]\n [[ $(candidate \"20577\") = \"3 19 19 19\" ]]\n [[ $(candidate \"18\") = \"2 3 3\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "sh", - "prompt": "#!/bin/bash\n# Return True if all numbers in the list l are below threshold t.\n# >>> $(below_threshold \"1 2 4 10\" \"100\")\n# \"true\"\n# >>> $(below_threshold \"1 20 4 10\" \"5\")\n# \"false\"\n#\n# $1 is a space-separated list\n# $2 is an integer\nbelow_threshold() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n below_threshold \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 4 10\" \"100\") = \"true\" ]]\n [[ $(candidate \"1 20 4 10\" \"5\") = \"false\" ]]\n [[ $(candidate \"1 20 4 10\" \"21\") = \"true\" ]]\n [[ $(candidate \"1 20 4 10\" \"22\") = \"true\" ]]\n [[ $(candidate \"1 8 4 10\" \"11\") = \"true\" ]]\n [[ $(candidate \"1 8 4 10\" \"10\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given two positive integers n and m, and your task is to compute the\n# average of the integers from n through m (including n and m). \n# Round the answer to the nearest integer and convert that to binary.\n# If n is greater than m, return -1.\n# Example:\n# >>> $(rounded_avg \"1\" \"5\")\n# \"0b11\"\n# >>> $(rounded_avg \"7\" \"5\")\n# \"-1\"\n# >>> $(rounded_avg \"10\" \"20\")\n# \"0b1111\"\n# >>> $(rounded_avg \"20\" \"33\")\n# \"0b11010\"\n#\n# $1 is an integer\n# $2 is an integer\nrounded_avg() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n rounded_avg \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1\" \"5\") = \"0b11\" ]]\n [[ $(candidate \"7\" \"13\") = \"0b1010\" ]]\n [[ $(candidate \"964\" \"977\") = \"0b1111001010\" ]]\n [[ $(candidate \"996\" \"997\") = \"0b1111100100\" ]]\n [[ $(candidate \"560\" \"851\") = \"0b1011000010\" ]]\n [[ $(candidate \"185\" \"546\") = \"0b101101110\" ]]\n [[ $(candidate \"362\" \"496\") = \"0b110101101\" ]]\n [[ $(candidate \"350\" \"902\") = \"0b1001110010\" ]]\n [[ $(candidate \"197\" \"233\") = \"0b11010111\" ]]\n [[ $(candidate \"7\" \"5\") = \"-1\" ]]\n [[ $(candidate \"5\" \"1\") = \"-1\" ]]\n [[ $(candidate \"5\" \"5\") = \"0b101\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "sh", - "prompt": "#!/bin/bash\n# Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n# For each of the group, output the deepest level of nesting of parentheses.\n# E.g. (()()) has maximum two levels of nesting while ((())) has three.\n# >>> $(parse_nested_parens \"(()()) ((())) () ((())()())\")\n# ['\"2\"', '\"3\"', '\"1\"', '\"3\"']\n#\n# $1 is a string\nparse_nested_parens() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n parse_nested_parens \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"(()()) ((())) () ((())()())\") = \"2 3 1 3\" ]]\n [[ $(candidate \"() (()) ((())) (((())))\") = \"1 2 3 4\" ]]\n [[ $(candidate \"(()(())((())))\") = \"4\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n# Examples\n# >>> $(solution \"5 8 7 1\")\n# \"12\"\n# >>> $(solution \"3 3 3 3 3\")\n# \"9\"\n# >>> $(solution \"30 13 24 321\")\n# \"0\"\n#\n# $1 is a space-separated list\nsolution() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n solution \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5 8 7 1\") = \"12\" ]]\n [[ $(candidate \"3 3 3 3 3\") = \"9\" ]]\n [[ $(candidate \"30 13 24 321\") = \"0\" ]]\n [[ $(candidate \"5 9\") = \"5\" ]]\n [[ $(candidate \"2 4 8\") = \"0\" ]]\n [[ $(candidate \"30 13 23 32\") = \"23\" ]]\n [[ $(candidate \"3 13 2 9\") = \"3\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a positive integer n. You have to create an integer array a of length n.\n# For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n# Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n# and a[i] + a[j] + a[k] is a multiple of 3.\n# Example :\n# >>> $(get_max_triples \"5\")\n# \"1\"\n# Explanation: \n# a = [1, 3, 7, 13, 21]\n# The only valid triple is (1, 7, 13).\n#\n# $1 is an integer\nget_max_triples() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n get_max_triples \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\") = \"1\" ]]\n [[ $(candidate \"6\") = \"4\" ]]\n [[ $(candidate \"10\") = \"36\" ]]\n [[ $(candidate \"100\") = \"53361\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "sh", - "prompt": "#!/bin/bash\n# There are eight planets in our solar system: the closerst to the Sun \n# is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n# Uranus, Neptune.\n# Write a function that takes two planet names as strings planet1 and planet2. \n# The function should return a tuple containing all planets whose orbits are \n# located between the orbit of planet1 and the orbit of planet2, sorted by \n# the proximity to the sun. \n# The function should return an empty tuple if planet1 or planet2\n# are not correct planet names. \n# Examples\n# >>> $(bf \"Jupiter\" \"Neptune\")\n# ['\"Saturn\"', '\"Uranus\"']\n# >>> $(bf \"Earth\" \"Mercury\")\n# \"Venus\"\n# >>> $(bf \"Mercury\" \"Uranus\")\n# ['\"Venus\"', '\"Earth\"', '\"Mars\"', '\"Jupiter\"', '\"Saturn\"']\n#\n# $1 is a string\n# $2 is a string\nbf() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n bf \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Jupiter\" \"Neptune\") = \"Saturn Uranus\" ]]\n [[ $(candidate \"Earth\" \"Mercury\") = \"Venus\" ]]\n [[ $(candidate \"Mercury\" \"Uranus\") = \"Venus Earth Mars Jupiter Saturn\" ]]\n [[ $(candidate \"Neptune\" \"Venus\") = \"Earth Mars Jupiter Saturn Uranus\" ]]\n [[ $(candidate \"Earth\" \"Earth\") = \"\" ]]\n [[ $(candidate \"Mars\" \"Earth\") = \"\" ]]\n [[ $(candidate \"Jupiter\" \"Makemake\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a list of integers.\n# Write a function next_smallest() that returns the 2nd smallest element of the list.\n# Return None if there is no such element.\n# >>> $(next_smallest \"1 2 3 4 5\")\n# \"2\"\n# >>> $(next_smallest \"5 1 4 3 2\")\n# \"2\"\n# >>> $(next_smallest \"\")\n# \"None\"\n# >>> $(next_smallest \"1 1\")\n# \"None\"\n#\n# $1 is a space-separated list\nnext_smallest() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n next_smallest \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3 4 5\") = \"2\" ]]\n [[ $(candidate \"5 1 4 3 2\") = \"2\" ]]\n [[ $(candidate \"\") = \"None\" ]]\n [[ $(candidate \"1 1\") = \"None\" ]]\n [[ $(candidate \"1 1 1 1 0\") = \"1\" ]]\n [[ $(candidate \"1 1\") = \"None\" ]]\n [[ $(candidate \"-35 34 12 -45\") = \"-35\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "sh", - "prompt": "#!/bin/bash\n# Input is a space-delimited string of numberals from 'zero' to 'nine'.\n# Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n# Return the string with numbers sorted from smallest to largest\n# >>> $(sort_numbers \"three one five\")\n# \"one three five\"\n#\n# $1 is a string\nsort_numbers() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n sort_numbers \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"three\") = \"three\" ]]\n [[ $(candidate \"three five nine\") = \"three five nine\" ]]\n [[ $(candidate \"five zero four seven nine eight\") = \"zero four five seven eight nine\" ]]\n [[ $(candidate \"six five four three two one zero\") = \"zero one two three four five six\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n# >>> $(cycpattern_check \"abcd\" \"abd\")\n# \"false\"\n# >>> $(cycpattern_check \"hello\" \"ell\")\n# \"true\"\n# >>> $(cycpattern_check \"whassup\" \"psus\")\n# \"false\"\n# >>> $(cycpattern_check \"abab\" \"baa\")\n# \"true\"\n# >>> $(cycpattern_check \"efef\" \"eeff\")\n# \"false\"\n# >>> $(cycpattern_check \"himenss\" \"simen\")\n# \"true\"\n#\n# $1 is a string\n# $2 is a string\ncycpattern_check() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n cycpattern_check \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"xyzw\" \"xyw\") = \"false\" ]]\n [[ $(candidate \"yello\" \"ell\") = \"true\" ]]\n [[ $(candidate \"whattup\" \"ptut\") = \"false\" ]]\n [[ $(candidate \"efef\" \"fee\") = \"true\" ]]\n [[ $(candidate \"abab\" \"aabb\") = \"false\" ]]\n [[ $(candidate \"winemtt\" \"tinem\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "sh", - "prompt": "#!/bin/bash\n# You will be given a number in decimal form and your task is to convert it to\n# binary format. The function should return a string, with each character representing a binary\n# number. Each character in the string will be '0' or '1'.\n# There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n# The extra characters are there to help with the format.\n# Examples:\n# >>> $(decimal_to_binary \"15\")\n# \"db1111db\"\n# >>> $(decimal_to_binary \"32\")\n# \"db100000db\"\n#\n# $1 is an integer\ndecimal_to_binary() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n decimal_to_binary \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"0\") = \"db0db\" ]]\n [[ $(candidate \"32\") = \"db100000db\" ]]\n [[ $(candidate \"103\") = \"db1100111db\" ]]\n [[ $(candidate \"15\") = \"db1111db\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "sh", - "prompt": "#!/bin/bash\n# Given an integer. return a tuple that has the number of even and odd digits respectively.\n# Example:\n# >>> $(even_odd_count \"-12\")\n# ['\"1\"', '\"1\"']\n# >>> $(even_odd_count \"123\")\n# ['\"1\"', '\"2\"']\n#\n# $1 is an integer\neven_odd_count() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n even_odd_count \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"7\") = \"0 1\" ]]\n [[ $(candidate \"-78\") = \"1 1\" ]]\n [[ $(candidate \"3452\") = \"2 2\" ]]\n [[ $(candidate \"346211\") = \"3 3\" ]]\n [[ $(candidate \"-345821\") = \"3 3\" ]]\n [[ $(candidate \"-2\") = \"1 0\" ]]\n [[ $(candidate \"-45347\") = \"2 3\" ]]\n [[ $(candidate \"0\") = \"1 0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that accepts a list of strings.\n# The list contains different words. Return the word with maximum number\n# of unique characters. If multiple strings have maximum number of unique\n# characters, return the one which comes first in lexicographical order.\n# >>> $(find_max \"name of string\")\n# \"string\"\n# >>> $(find_max \"name enam game\")\n# \"enam\"\n# >>> $(find_max \"aaaaaaa bb cc\")\n# \"aaaaaaa\"\n#\n# $1 is a space-separated list\nfind_max() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n find_max \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"name of string\") = \"string\" ]]\n [[ $(candidate \"name enam game\") = \"enam\" ]]\n [[ $(candidate \"aaaaaaa bb cc\") = \"aaaaaaa\" ]]\n [[ $(candidate \"abc cba\") = \"abc\" ]]\n [[ $(candidate \"play this game of footbott\") = \"footbott\" ]]\n [[ $(candidate \"we are gonna rock\") = \"gonna\" ]]\n [[ $(candidate \"we are a mad nation\") = \"nation\" ]]\n [[ $(candidate \"this is a prrk\") = \"this\" ]]\n [[ $(candidate \"b\") = \"b\" ]]\n [[ $(candidate \"play play play\") = \"play\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a positive integer n, return the count of the numbers of n-digit\n# positive integers that start or end with 1.\n#\n# $1 is an integer\nstarts_one_ends() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n starts_one_ends \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1\") = \"1\" ]]\n [[ $(candidate \"2\") = \"18\" ]]\n [[ $(candidate \"3\") = \"180\" ]]\n [[ $(candidate \"4\") = \"1800\" ]]\n [[ $(candidate \"5\") = \"18000\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function that returns a tuple (a, b), where 'a' is\n# the largest of negative integers, and 'b' is the smallest\n# of positive integers in a list.\n# If there is no negative or positive integers, return them as None.\n# Examples:\n# >>> $(largest_smallest_integers \"2 4 1 3 5 7\")\n# ['\"None\"', '\"1\"']\n# >>> $(largest_smallest_integers \"\")\n# ['\"None\"', '\"None\"']\n# >>> $(largest_smallest_integers \"0\")\n# ['\"None\"', '\"None\"']\n#\n# $1 is a space-separated list\nlargest_smallest_integers() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n largest_smallest_integers \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2 4 1 3 5 7\") = \"None 1\" ]]\n [[ $(candidate \"2 4 1 3 5 7 0\") = \"None 1\" ]]\n [[ $(candidate \"1 3 2 4 5 6 -2\") = \"-2 1\" ]]\n [[ $(candidate \"4 5 3 6 2 7 -7\") = \"-7 2\" ]]\n [[ $(candidate \"7 3 8 4 9 2 5 -9\") = \"-9 2\" ]]\n [[ $(candidate \"\") = \"None None\" ]]\n [[ $(candidate \"0\") = \"None None\" ]]\n [[ $(candidate \"-1 -3 -5 -6\") = \"-1 None\" ]]\n [[ $(candidate \"-1 -3 -5 -6 0\") = \"-1 None\" ]]\n [[ $(candidate \"-6 -4 -4 -3 1\") = \"-3 1\" ]]\n [[ $(candidate \"-6 -4 -4 -3 -100 1\") = \"-3 1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "sh", - "prompt": "#!/bin/bash\n# \"Given an array representing a branch of a tree that has non-negative integer nodes\n# your task is to pluck one of the nodes and return it.\n# The plucked node should be the node with the smallest even value.\n# If multiple nodes with the same smallest even value are found return the node that has smallest index.\n# The plucked node should be returned in a list, [ smalest_value, its index ],\n# If there are no even values or the given array is empty, return [].\n# Example 1:\n# >>> $(pluck \"4 2 3\")\n# ['\"2\"', '\"1\"']\n# Explanation: 2 has the smallest even value, and 2 has the smallest index.\n# Example 2:\n# >>> $(pluck \"1 2 3\")\n# ['\"2\"', '\"1\"']\n# Explanation: 2 has the smallest even value, and 2 has the smallest index.\n# Example 3:\n# >>> $(pluck \"\")\n# []\n# Example 4:\n# >>> $(pluck \"5 0 3 0 4 2\")\n# ['\"0\"', '\"1\"']\n# Explanation: 0 is the smallest value, but there are two zeros,\n# so we will choose the first zero, which has the smallest index.\n# Constraints:\n# * 1 <= nodes.length <= 10000\n# * 0 <= node.value\n#\n# $1 is a space-separated list\npluck() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n pluck \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"4 2 3\") = \"2 1\" ]]\n [[ $(candidate \"1 2 3\") = \"2 1\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"5 0 3 0 4 2\") = \"0 1\" ]]\n [[ $(candidate \"1 2 3 0 5 3\") = \"0 3\" ]]\n [[ $(candidate \"5 4 8 4 8\") = \"4 1\" ]]\n [[ $(candidate \"7 6 7 1\") = \"6 1\" ]]\n [[ $(candidate \"7 9 7 1\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function count_nums which takes an array of integers and returns\n# the number of elements which has a sum of digits > 0.\n# If a number is negative, then its first signed digit will be negative:\n# e.g. -123 has signed digits -1, 2, and 3.\n# >>> $(count_nums \"\")\n# \"0\"\n# >>> $(count_nums \"-1 11 -11\")\n# \"1\"\n# >>> $(count_nums \"1 1 2\")\n# \"3\"\n#\n# $1 is a space-separated list\ncount_nums() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n count_nums \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"0\" ]]\n [[ $(candidate \"-1 -2 0\") = \"0\" ]]\n [[ $(candidate \"1 1 2 -2 3 4 5\") = \"6\" ]]\n [[ $(candidate \"1 6 9 -6 0 1 5\") = \"5\" ]]\n [[ $(candidate \"1 100 98 -7 1 -1\") = \"4\" ]]\n [[ $(candidate \"12 23 34 -45 -56 0\") = \"5\" ]]\n [[ $(candidate \"0 1\") = \"1\" ]]\n [[ $(candidate \"1\") = \"1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n# each cell of the grid contains a value. Every integer in the range [1, N * N]\n# inclusive appears exactly once on the cells of the grid.\n# You have to find the minimum path of length k in the grid. You can start\n# from any cell, and in each step you can move to any of the neighbor cells,\n# in other words, you can go to cells which share an edge with you current\n# cell.\n# Please note that a path of length k means visiting exactly k cells (not\n# necessarily distinct).\n# You CANNOT go off the grid.\n# A path A (of length k) is considered less than a path B (of length k) if\n# after making the ordered lists of the values on the cells that A and B go\n# through (let's call them lst_A and lst_B), lst_A is lexicographically less\n# than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n# such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n# lst_A[j] = lst_B[j].\n# It is guaranteed that the answer is unique.\n# Return an ordered list of the values on the cells that the minimum path go through.\n# Examples: \n# >>> $(minPath \"1 2 3\\n4 5 6\\n7 8 9\" \"3\")\n# ['\"1\"', '\"2\"', '\"1\"']\n# >>> $(minPath \"5 9 3\\n4 1 6\\n7 8 2\" \"1\")\n# ['\"1\"']\n#\n# $1 is a newline-separated, space-separated list\n# $2 is an integer\nminPath() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n minPath \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3\\n4 5 6\\n7 8 9\" \"3\") = \"1 2 1\" ]]\n [[ $(candidate \"5 9 3\\n4 1 6\\n7 8 2\" \"1\") = \"1\" ]]\n [[ $(candidate \"1 2 3 4\\n5 6 7 8\\n9 10 11 12\\n13 14 15 16\" \"4\") = \"1 2 1 2\" ]]\n [[ $(candidate \"6 4 13 10\\n5 7 12 1\\n3 16 11 15\\n8 14 9 2\" \"7\") = \"1 10 1 10 1 10 1\" ]]\n [[ $(candidate \"8 14 9 2\\n6 4 13 15\\n5 7 1 12\\n3 10 11 16\" \"5\") = \"1 7 1 7 1\" ]]\n [[ $(candidate \"11 8 7 2\\n5 16 14 4\\n9 3 15 6\\n12 13 10 1\" \"9\") = \"1 6 1 6 1 6 1 6 1\" ]]\n [[ $(candidate \"12 13 10 1\\n9 3 15 6\\n5 16 14 4\\n11 8 7 2\" \"12\") = \"1 6 1 6 1 6 1 6 1 6 1 6\" ]]\n [[ $(candidate \"2 7 4\\n3 1 5\\n6 8 9\" \"8\") = \"1 3 1 3 1 3 1 3\" ]]\n [[ $(candidate \"6 1 5\\n3 8 9\\n2 7 4\" \"8\") = \"1 5 1 5 1 5 1 5\" ]]\n [[ $(candidate \"1 2\\n3 4\" \"10\") = \"1 2 1 2 1 2 1 2 1 2\" ]]\n [[ $(candidate \"1 3\\n3 2\" \"10\") = \"1 3 1 3 1 3 1 3 1 3\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "sh", - "prompt": "#!/bin/bash\n# Given list of integers, return list in strange order.\n# Strange sorting, is when you start with the minimum value,\n# then maximum of the remaining integers, then minimum and so on.\n# Examples:\n# >>> $(strange_sort_list \"1 2 3 4\")\n# ['\"1\"', '\"4\"', '\"2\"', '\"3\"']\n# >>> $(strange_sort_list \"5 5 5 5\")\n# ['\"5\"', '\"5\"', '\"5\"', '\"5\"']\n# >>> $(strange_sort_list \"\")\n# []\n#\n# $1 is a space-separated list\nstrange_sort_list() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n strange_sort_list \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3 4\") = \"1 4 2 3\" ]]\n [[ $(candidate \"5 6 7 8 9\") = \"5 9 6 8 7\" ]]\n [[ $(candidate \"1 2 3 4 5\") = \"1 5 2 4 3\" ]]\n [[ $(candidate \"5 6 7 8 9 1\") = \"1 9 5 8 6 7\" ]]\n [[ $(candidate \"5 5 5 5\") = \"5 5 5 5\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"1 2 3 4 5 6 7 8\") = \"1 8 2 7 3 6 4 5\" ]]\n [[ $(candidate \"0 2 2 2 5 5 -5 -5\") = \"-5 5 -5 5 0 2 2 2\" ]]\n [[ $(candidate \"111111\") = \"111111\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a string 'text', return its md5 hash equivalent string.\n# If 'text' is an empty string, return None.\n# >>> $(string_to_md5 \"Hello world\")\n# \"3e25960a79dbc69b674cd4ec67a72c62\"\n#\n# $1 is a string\nstring_to_md5() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n string_to_md5 \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Hello world\") = \"3e25960a79dbc69b674cd4ec67a72c62\" ]]\n [[ $(candidate \"\") = \"None\" ]]\n [[ $(candidate \"A B C\") = \"0ef78513b0cb8cef12743f5aeb35f888\" ]]\n [[ $(candidate \"password\") = \"5f4dcc3b5aa765d61d8327deb882cf99\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a word. Your task is to find the closest vowel that stands between \n# two consonants from the right side of the word (case sensitive).\n# Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n# find any vowel met the above condition. \n# You may assume that the given string contains English letter only.\n# Example:\n# >>> $(get_closest_vowel \"yogurt\")\n# \"u\"\n# >>> $(get_closest_vowel \"FULL\")\n# \"U\"\n# >>> $(get_closest_vowel \"quick\")\n# \"\"\n# >>> $(get_closest_vowel \"ab\")\n# \"\"\n#\n# $1 is a string\nget_closest_vowel() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n get_closest_vowel \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"yogurt\") = \"u\" ]]\n [[ $(candidate \"full\") = \"u\" ]]\n [[ $(candidate \"easy\") = \"\" ]]\n [[ $(candidate \"eAsy\") = \"\" ]]\n [[ $(candidate \"ali\") = \"\" ]]\n [[ $(candidate \"bad\") = \"a\" ]]\n [[ $(candidate \"most\") = \"o\" ]]\n [[ $(candidate \"ab\") = \"\" ]]\n [[ $(candidate \"ba\") = \"\" ]]\n [[ $(candidate \"quick\") = \"\" ]]\n [[ $(candidate \"anime\") = \"i\" ]]\n [[ $(candidate \"Asia\") = \"\" ]]\n [[ $(candidate \"Above\") = \"o\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "sh", - "prompt": "#!/bin/bash\n# Change numerical base of input number x to base.\n# return string representation after the conversion.\n# base numbers are less than 10.\n# >>> $(change_base \"8\" \"3\")\n# \"22\"\n# >>> $(change_base \"8\" \"2\")\n# \"1000\"\n# >>> $(change_base \"7\" \"2\")\n# \"111\"\n#\n# $1 is an integer\n# $2 is an integer\nchange_base() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n change_base \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"8\" \"3\") = \"22\" ]]\n [[ $(candidate \"9\" \"3\") = \"100\" ]]\n [[ $(candidate \"234\" \"2\") = \"11101010\" ]]\n [[ $(candidate \"16\" \"2\") = \"10000\" ]]\n [[ $(candidate \"8\" \"2\") = \"1000\" ]]\n [[ $(candidate \"7\" \"2\") = \"111\" ]]\n [[ $(candidate \"2\" \"3\") = \"2\" ]]\n [[ $(candidate \"3\" \"4\") = \"3\" ]]\n [[ $(candidate \"4\" \"5\") = \"4\" ]]\n [[ $(candidate \"5\" \"6\") = \"5\" ]]\n [[ $(candidate \"6\" \"7\") = \"6\" ]]\n [[ $(candidate \"7\" \"8\") = \"7\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "sh", - "prompt": "#!/bin/bash\n# Check if in given list of numbers, are any two numbers closer to each other than\n# given threshold.\n# >>> $(has_close_elements \"1.0 2.0 3.0\" \"0.5\")\n# \"false\"\n# >>> $(has_close_elements \"1.0 2.8 3.0 4.0 5.0 2.0\" \"0.3\")\n# \"true\"\n#\n# $1 is a space-separated list\n# $2 is a floating point\nhas_close_elements() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n has_close_elements \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1.0 2.0 3.9 4.0 5.0 2.2\" \"0.3\") = \"true\" ]]\n [[ $(candidate \"1.0 2.0 3.9 4.0 5.0 2.2\" \"0.05\") = \"false\" ]]\n [[ $(candidate \"1.0 2.0 5.9 4.0 5.0\" \"0.95\") = \"true\" ]]\n [[ $(candidate \"1.0 2.0 5.9 4.0 5.0\" \"0.8\") = \"false\" ]]\n [[ $(candidate \"1.0 2.0 3.0 4.0 5.0 2.0\" \"0.1\") = \"true\" ]]\n [[ $(candidate \"1.1 2.2 3.1 4.1 5.1\" \"1.0\") = \"true\" ]]\n [[ $(candidate \"1.1 2.2 3.1 4.1 5.1\" \"0.5\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function that takes a string as input which contains only square brackets.\n# The function should return True if and only if there is a valid subsequence of brackets \n# where at least one bracket in the subsequence is nested.\n# >>> $(is_nested \"[[]]\")\n# \"true\"\n# >>> $(is_nested \"[]]]]]]][[[[[]\")\n# \"false\"\n# >>> $(is_nested \"[][]\")\n# \"false\"\n# >>> $(is_nested \"[]\")\n# \"false\"\n# >>> $(is_nested \"[[][]]\")\n# \"true\"\n# >>> $(is_nested \"[[]][[\")\n# \"true\"\n#\n# $1 is a string\nis_nested() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n is_nested \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"[[]]\") = \"true\" ]]\n [[ $(candidate \"[]]]]]]][[[[[]\") = \"false\" ]]\n [[ $(candidate \"[][]\") = \"false\" ]]\n [[ $(candidate \"[]\") = \"false\" ]]\n [[ $(candidate \"[[[[]]]]\") = \"true\" ]]\n [[ $(candidate \"[]]]]]]]]]]\") = \"false\" ]]\n [[ $(candidate \"[][][[]]\") = \"true\" ]]\n [[ $(candidate \"[[]\") = \"false\" ]]\n [[ $(candidate \"[]]\") = \"false\" ]]\n [[ $(candidate \"[[]][[\") = \"true\" ]]\n [[ $(candidate \"[[][]]\") = \"true\" ]]\n [[ $(candidate \"\") = \"false\" ]]\n [[ $(candidate \"[[[[[[[[\") = \"false\" ]]\n [[ $(candidate \"]]]]]]]]\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "sh", - "prompt": "#!/bin/bash\n# Concatenate list of strings into a single string\n# >>> $(concatenate \"\")\n# \"\"\n# >>> $(concatenate \"a b c\")\n# \"abc\"\n#\n# $1 is a space-separated list\nconcatenate() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n concatenate \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"x y z\") = \"xyz\" ]]\n [[ $(candidate \"x y z w k\") = \"xyzwk\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "sh", - "prompt": "#!/bin/bash\n# prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n# >>> $(prime_fib \"1\")\n# \"2\"\n# >>> $(prime_fib \"2\")\n# \"3\"\n# >>> $(prime_fib \"3\")\n# \"5\"\n# >>> $(prime_fib \"4\")\n# \"13\"\n# >>> $(prime_fib \"5\")\n# \"89\"\n#\n# $1 is an integer\nprime_fib() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n prime_fib \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1\") = \"2\" ]]\n [[ $(candidate \"2\") = \"3\" ]]\n [[ $(candidate \"3\") = \"5\" ]]\n [[ $(candidate \"4\") = \"13\" ]]\n [[ $(candidate \"5\") = \"89\" ]]\n [[ $(candidate \"6\") = \"233\" ]]\n [[ $(candidate \"7\") = \"1597\" ]]\n [[ $(candidate \"8\") = \"28657\" ]]\n [[ $(candidate \"9\") = \"514229\" ]]\n [[ $(candidate \"10\") = \"433494437\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "sh", - "prompt": "#!/bin/bash\n# From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n# other and return them in order (smaller number, larger number).\n# >>> $(find_closest_elements \"1.0 2.0 3.0 4.0 5.0 2.2\")\n# ['\"2.0\"', '\"2.2\"']\n# >>> $(find_closest_elements \"1.0 2.0 3.0 4.0 5.0 2.0\")\n# ['\"2.0\"', '\"2.0\"']\n#\n# $1 is a space-separated list\nfind_closest_elements() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n find_closest_elements \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1.0 2.0 3.9 4.0 5.0 2.2\") = \"3.9 4.0\" ]]\n [[ $(candidate \"1.0 2.0 5.9 4.0 5.0\") = \"5.0 5.9\" ]]\n [[ $(candidate \"1.0 2.0 3.0 4.0 5.0 2.2\") = \"2.0 2.2\" ]]\n [[ $(candidate \"1.0 2.0 3.0 4.0 5.0 2.0\") = \"2.0 2.0\" ]]\n [[ $(candidate \"1.1 2.2 3.1 4.1 5.1\") = \"2.2 3.1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "sh", - "prompt": "#!/bin/bash\n# You have been tasked to write a function that receives \n# a hexadecimal number as a string and counts the number of hexadecimal \n# digits that are primes (prime number, or a prime, is a natural number \n# greater than 1 that is not a product of two smaller natural numbers).\n# Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n# Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n# So you have to determine a number of the following digits: 2, 3, 5, 7, \n# B (=decimal 11), D (=decimal 13).\n# Note: you may assume the input is always correct or empty string, \n# and symbols A,B,C,D,E,F are always uppercase.\n# Examples:\n# >>> $(hex_key \"AB\")\n# \"1\"\n# >>> $(hex_key \"1077E\")\n# \"2\"\n# >>> $(hex_key \"ABED1A33\")\n# \"4\"\n# >>> $(hex_key \"123456789ABCDEF0\")\n# \"6\"\n# >>> $(hex_key \"2020\")\n# \"2\"\n#\n# $1 is a string\nhex_key() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n hex_key \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"AB\") = \"1\" ]]\n [[ $(candidate \"1077E\") = \"2\" ]]\n [[ $(candidate \"ABED1A33\") = \"4\" ]]\n [[ $(candidate \"2020\") = \"2\" ]]\n [[ $(candidate \"123456789ABCDEF0\") = \"6\" ]]\n [[ $(candidate \"112233445566778899AABBCCDDEEFF00\") = \"12\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "sh", - "prompt": "#!/bin/bash\n# Complete the function that takes two integers and returns \n# the product of their unit digits.\n# Assume the input is always valid.\n# Examples:\n# >>> $(multiply \"148\" \"412\")\n# \"16\"\n# >>> $(multiply \"19\" \"28\")\n# \"72\"\n# >>> $(multiply \"2020\" \"1851\")\n# \"0\"\n# >>> $(multiply \"14\" \"-15\")\n# \"20\"\n#\n# $1 is an integer\n# $2 is an integer\nmultiply() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n multiply \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"148\" \"412\") = \"16\" ]]\n [[ $(candidate \"19\" \"28\") = \"72\" ]]\n [[ $(candidate \"2020\" \"1851\") = \"0\" ]]\n [[ $(candidate \"14\" \"-15\") = \"20\" ]]\n [[ $(candidate \"76\" \"67\") = \"42\" ]]\n [[ $(candidate \"17\" \"27\") = \"49\" ]]\n [[ $(candidate \"0\" \"1\") = \"0\" ]]\n [[ $(candidate \"0\" \"0\") = \"0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "sh", - "prompt": "#!/bin/bash\n# Given list of numbers (of at least two elements), apply a linear transform to that list,\n# such that the smallest number will become 0 and the largest will become 1\n# >>> $(rescale_to_unit \"1.0 2.0 3.0 4.0 5.0\")\n# ['\"0.0\"', '\"0.25\"', '\"0.5\"', '\"0.75\"', '\"1.0\"']\n#\n# $1 is a space-separated list\nrescale_to_unit() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n rescale_to_unit \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2.0 49.9\") = \"0.0 1.0\" ]]\n [[ $(candidate \"100.0 49.9\") = \"1.0 0.0\" ]]\n [[ $(candidate \"1.0 2.0 3.0 4.0 5.0\") = \"0.0 0.25 0.5 0.75 1.0\" ]]\n [[ $(candidate \"2.0 1.0 5.0 3.0 4.0\") = \"0.25 0.0 1.0 0.5 0.75\" ]]\n [[ $(candidate \"12.0 11.0 15.0 13.0 14.0\") = \"0.25 0.0 1.0 0.5 0.75\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a positive integer n, return the product of the odd digits.\n# Return 0 if all digits are even.\n# For example:\n# >>> $(digits \"1\")\n# \"1\"\n# >>> $(digits \"4\")\n# \"0\"\n# >>> $(digits \"235\")\n# \"15\"\n#\n# $1 is an integer\ndigits() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n digits \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\") = \"5\" ]]\n [[ $(candidate \"54\") = \"5\" ]]\n [[ $(candidate \"120\") = \"1\" ]]\n [[ $(candidate \"5014\") = \"5\" ]]\n [[ $(candidate \"98765\") = \"315\" ]]\n [[ $(candidate \"5576543\") = \"2625\" ]]\n [[ $(candidate \"2468\") = \"0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "sh", - "prompt": "#!/bin/bash\n# You will be given the name of a class (a string) and a list of extensions.\n# The extensions are to be used to load additional classes to the class. The\n# strength of the extension is as follows: Let CAP be the number of the uppercase\n# letters in the extension's name, and let SM be the number of lowercase letters \n# in the extension's name, the strength is given by the fraction CAP - SM. \n# You should find the strongest extension and return a string in this \n# format: ClassName.StrongestExtensionName.\n# If there are two or more extensions with the same strength, you should\n# choose the one that comes first in the list.\n# For example, if you are given \"Slices\" as the class and a list of the\n# extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n# return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n# (its strength is -1).\n# Example:\n# >>> $(Strongest_Extension \"my_class\" \"AA Be CC\")\n# \"my_class.AA\"\n#\n# $1 is a string\n# $2 is a space-separated list\nStrongest_Extension() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n Strongest_Extension \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Watashi\" \"tEN niNE eIGHt8OKe\") = \"Watashi.eIGHt8OKe\" ]]\n [[ $(candidate \"Boku123\" \"nani NazeDa YEs.WeCaNe 32145tggg\") = \"Boku123.YEs.WeCaNe\" ]]\n [[ $(candidate \"__YESIMHERE\" \"t eMptY nothing zeR00 NuLl__ 123NoooneB321\") = \"__YESIMHERE.NuLl__\" ]]\n [[ $(candidate \"K\" \"Ta TAR t234An cosSo\") = \"K.TAR\" ]]\n [[ $(candidate \"__HAHA\" \"Tab 123 781345 -_-\") = \"__HAHA.123\" ]]\n [[ $(candidate \"YameRore\" \"HhAas okIWILL123 WorkOut Fails -_-\") = \"YameRore.okIWILL123\" ]]\n [[ $(candidate \"finNNalLLly\" \"Die NowW Wow WoW\") = \"finNNalLLly.WoW\" ]]\n [[ $(candidate \"_\" \"Bb 91245\") = \"_.Bb\" ]]\n [[ $(candidate \"Sp\" \"671235 Bb\") = \"Sp.671235\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a string representing a space separated lowercase letters, return a dictionary\n# of the letter with the most repetition and containing the corresponding count.\n# If several letters have the same occurrence, return all of them.\n# Example:\n# >>> $(histogram \"a b c\")\n# {'\"a\"': '\"1\"', '\"b\"': '\"1\"', '\"c\"': '\"1\"'}\n# >>> $(histogram \"a b b a\")\n# {'\"a\"': '\"2\"', '\"b\"': '\"2\"'}\n# >>> $(histogram \"a b c a b\")\n# {'\"a\"': '\"2\"', '\"b\"': '\"2\"'}\n# >>> $(histogram \"b b b b a\")\n# {'\"b\"': '\"4\"'}\n# >>> $(histogram \"\")\n# {}\n#\n# $1 is a string\nhistogram() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n histogram \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"a b b a\") = \"a,2\\nb,2\" ]]\n [[ $(candidate \"a b c a b\") = \"a,2\\nb,2\" ]]\n [[ $(candidate \"a b c d g\") = \"a,1\\nb,1\\nc,1\\nd,1\\ng,1\" ]]\n [[ $(candidate \"r t g\") = \"r,1\\nt,1\\ng,1\" ]]\n [[ $(candidate \"b b b b a\") = \"b,4\" ]]\n [[ $(candidate \"r t g\") = \"r,1\\nt,1\\ng,1\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"a\") = \"a,1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "sh", - "prompt": "#!/bin/bash\n# pairs_sum_to_zero takes a list of integers as an input.\n# it returns True if there are two distinct elements in the list that\n# sum to zero, and False otherwise.\n# >>> $(pairs_sum_to_zero \"1 3 5 0\")\n# \"false\"\n# >>> $(pairs_sum_to_zero \"1 3 -2 1\")\n# \"false\"\n# >>> $(pairs_sum_to_zero \"1 2 3 7\")\n# \"false\"\n# >>> $(pairs_sum_to_zero \"2 4 -5 3 5 7\")\n# \"true\"\n# >>> $(pairs_sum_to_zero \"1\")\n# \"false\"\n#\n# $1 is a space-separated list\npairs_sum_to_zero() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n pairs_sum_to_zero \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 3 5 0\") = \"false\" ]]\n [[ $(candidate \"1 3 -2 1\") = \"false\" ]]\n [[ $(candidate \"1 2 3 7\") = \"false\" ]]\n [[ $(candidate \"2 4 -5 3 5 7\") = \"true\" ]]\n [[ $(candidate \"1\") = \"false\" ]]\n [[ $(candidate \"-3 9 -1 3 2 30\") = \"true\" ]]\n [[ $(candidate \"-3 9 -1 3 2 31\") = \"true\" ]]\n [[ $(candidate \"-3 9 -1 4 2 30\") = \"false\" ]]\n [[ $(candidate \"-3 9 -1 4 2 31\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that accepts two lists of strings and returns the list that has \n# total number of chars in the all strings of the list less than the other list.\n# if the two lists have the same number of chars, return the first list.\n# Examples\n# >>> $(total_match \"\" \"\")\n# []\n# >>> $(total_match \"hi admin\" \"hI Hi\")\n# ['\"hI\"', '\"Hi\"']\n# >>> $(total_match \"hi admin\" \"hi hi admin project\")\n# ['\"hi\"', '\"admin\"']\n# >>> $(total_match \"hi admin\" \"hI hi hi\")\n# ['\"hI\"', '\"hi\"', '\"hi\"']\n# >>> $(total_match \"4\" \"1 2 3 4 5\")\n# ['\"4\"']\n#\n# $1 is a space-separated list\n# $2 is a space-separated list\ntotal_match() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n total_match \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\" \"\") = \"\" ]]\n [[ $(candidate \"hi admin\" \"hi hi\") = \"hi hi\" ]]\n [[ $(candidate \"hi admin\" \"hi hi admin project\") = \"hi admin\" ]]\n [[ $(candidate \"4\" \"1 2 3 4 5\") = \"4\" ]]\n [[ $(candidate \"hi admin\" \"hI Hi\") = \"hI Hi\" ]]\n [[ $(candidate \"hi admin\" \"hI hi hi\") = \"hI hi hi\" ]]\n [[ $(candidate \"hi admin\" \"hI hi hii\") = \"hi admin\" ]]\n [[ $(candidate \"\" \"this\") = \"\" ]]\n [[ $(candidate \"this\" \"\") = \"\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "sh", - "prompt": "#!/bin/bash\n# Circular shift the digits of the integer x, shift the digits right by shift\n# and return the result as a string.\n# If shift > number of digits, return digits reversed.\n# >>> $(circular_shift \"12\" \"1\")\n# \"21\"\n# >>> $(circular_shift \"12\" \"2\")\n# \"12\"\n#\n# $1 is an integer\n# $2 is an integer\ncircular_shift() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n circular_shift \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"100\" \"2\") = \"001\" ]]\n [[ $(candidate \"12\" \"2\") = \"12\" ]]\n [[ $(candidate \"97\" \"8\") = \"79\" ]]\n [[ $(candidate \"12\" \"1\") = \"21\" ]]\n [[ $(candidate \"11\" \"101\") = \"11\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "sh", - "prompt": "#!/bin/bash\n# Return True is list elements are monotonically increasing or decreasing.\n# >>> $(monotonic \"1 2 4 20\")\n# \"true\"\n# >>> $(monotonic \"1 20 4 10\")\n# \"false\"\n# >>> $(monotonic \"4 1 0 -10\")\n# \"true\"\n#\n# $1 is a space-separated list\nmonotonic() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n monotonic \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 4 10\") = \"true\" ]]\n [[ $(candidate \"1 2 4 20\") = \"true\" ]]\n [[ $(candidate \"1 20 4 10\") = \"false\" ]]\n [[ $(candidate \"4 1 0 -10\") = \"true\" ]]\n [[ $(candidate \"4 1 1 0\") = \"true\" ]]\n [[ $(candidate \"1 2 3 2 5 60\") = \"false\" ]]\n [[ $(candidate \"1 2 3 4 5 60\") = \"true\" ]]\n [[ $(candidate \"9 9 9 9\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "sh", - "prompt": "#!/bin/bash\n# Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n# Example\n# >>> $(is_equal_to_sum_even \"4\")\n# \"false\"\n# >>> $(is_equal_to_sum_even \"6\")\n# \"false\"\n# >>> $(is_equal_to_sum_even \"8\")\n# \"true\"\n#\n# $1 is an integer\nis_equal_to_sum_even() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n is_equal_to_sum_even \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"4\") = \"false\" ]]\n [[ $(candidate \"6\") = \"false\" ]]\n [[ $(candidate \"8\") = \"true\" ]]\n [[ $(candidate \"10\") = \"true\" ]]\n [[ $(candidate \"11\") = \"false\" ]]\n [[ $(candidate \"12\") = \"true\" ]]\n [[ $(candidate \"13\") = \"false\" ]]\n [[ $(candidate \"16\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "sh", - "prompt": "#!/bin/bash\n# Input to this function is a string representing musical notes in a special ASCII format.\n# Your task is to parse this string and return list of integers corresponding to how many beats does each\n# not last.\n# Here is a legend:\n# 'o' - whole note, lasts four beats\n# 'o|' - half note, lasts two beats\n# '.|' - quater note, lasts one beat\n# >>> $(parse_music \"o o| .| o| o| .| .| .| .| o o\")\n# ['\"4\"', '\"2\"', '\"1\"', '\"2\"', '\"2\"', '\"1\"', '\"1\"', '\"1\"', '\"1\"', '\"4\"', '\"4\"']\n#\n# $1 is a string\nparse_music() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n parse_music \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"o o o o\") = \"4 4 4 4\" ]]\n [[ $(candidate \".| .| .| .|\") = \"1 1 1 1\" ]]\n [[ $(candidate \"o| o| .| .| o o o o\") = \"2 2 1 1 4 4 4 4\" ]]\n [[ $(candidate \"o| .| o| .| o o| o o|\") = \"2 1 2 1 4 2 4 2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "sh", - "prompt": "#!/bin/bash\n# \"\n# This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n# multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n# change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n# Examples:\n# >>> lst\n# ['\"1\"', '\"2\"', '\"3\"']\n# >>> lst\n# []\n# >>> lst\n# ['\"-1\"', '\"-5\"', '\"2\"', '\"-1\"', '\"-5\"']\n#\n# $1 is a space-separated list\nsum_squares() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n sum_squares \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3\") = \"6\" ]]\n [[ $(candidate \"1 4 9\") = \"14\" ]]\n [[ $(candidate \"\") = \"0\" ]]\n [[ $(candidate \"1 1 1 1 1 1 1 1 1\") = \"9\" ]]\n [[ $(candidate \"-1 -1 -1 -1 -1 -1 -1 -1 -1\") = \"-3\" ]]\n [[ $(candidate \"0\") = \"0\" ]]\n [[ $(candidate \"-1 -5 2 -1 -5\") = \"-126\" ]]\n [[ $(candidate \"-56 -99 1 0 -2\") = \"3030\" ]]\n [[ $(candidate \"-1 0 0 0 0 0 0 0 -1\") = \"0\" ]]\n [[ $(candidate \"-16 -9 -2 36 36 26 -20 25 -40 20 -4 12 -26 35 37\") = \"-14196\" ]]\n [[ $(candidate \"-1 -3 17 -1 -15 13 -1 14 -14 -12 -5 14 -14 6 13 11 16 16 4 10\") = \"-1448\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "sh", - "prompt": "#!/bin/bash\n# triples_sum_to_zero takes a list of integers as an input.\n# it returns True if there are three distinct elements in the list that\n# sum to zero, and False otherwise.\n# >>> $(triples_sum_to_zero \"1 3 5 0\")\n# \"false\"\n# >>> $(triples_sum_to_zero \"1 3 -2 1\")\n# \"true\"\n# >>> $(triples_sum_to_zero \"1 2 3 7\")\n# \"false\"\n# >>> $(triples_sum_to_zero \"2 4 -5 3 9 7\")\n# \"true\"\n# >>> $(triples_sum_to_zero \"1\")\n# \"false\"\n#\n# $1 is a space-separated list\ntriples_sum_to_zero() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n triples_sum_to_zero \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 3 5 0\") = \"false\" ]]\n [[ $(candidate \"1 3 5 -1\") = \"false\" ]]\n [[ $(candidate \"1 3 -2 1\") = \"true\" ]]\n [[ $(candidate \"1 2 3 7\") = \"false\" ]]\n [[ $(candidate \"1 2 5 7\") = \"false\" ]]\n [[ $(candidate \"2 4 -5 3 9 7\") = \"true\" ]]\n [[ $(candidate \"1\") = \"false\" ]]\n [[ $(candidate \"1 3 5 -100\") = \"false\" ]]\n [[ $(candidate \"100 3 5 -100\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "sh", - "prompt": "#!/bin/bash\n# brackets is a string of \"<\" and \">\".\n# return True if every opening bracket has a corresponding closing bracket.\n# >>> $(correct_bracketing \"<\")\n# \"false\"\n# >>> $(correct_bracketing \"<>\")\n# \"true\"\n# >>> $(correct_bracketing \"<<><>>\")\n# \"true\"\n# >>> $(correct_bracketing \"><<>\")\n# \"false\"\n#\n# $1 is a string\ncorrect_bracketing() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n correct_bracketing \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"<>\") = \"true\" ]]\n [[ $(candidate \"<<><>>\") = \"true\" ]]\n [[ $(candidate \"<><><<><>><>\") = \"true\" ]]\n [[ $(candidate \"<><><<<><><>><>><<><><<>>>\") = \"true\" ]]\n [[ $(candidate \"<<<><>>>>\") = \"false\" ]]\n [[ $(candidate \"><<>\") = \"false\" ]]\n [[ $(candidate \"<\") = \"false\" ]]\n [[ $(candidate \"<<<<\") = \"false\" ]]\n [[ $(candidate \">\") = \"false\" ]]\n [[ $(candidate \"<<>\") = \"false\" ]]\n [[ $(candidate \"<><><<><>><>><<>\") = \"false\" ]]\n [[ $(candidate \"<><><<><>><>>><>\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that takes an array of numbers as input and returns \n# the number of elements in the array that are greater than 10 and both \n# first and last digits of a number are odd (1, 3, 5, 7, 9).\n# For example:\n# >>> $(specialFilter \"15 -73 14 -15\")\n# \"1\"\n# >>> $(specialFilter \"33 -2 -3 45 21 109\")\n# \"2\"\n#\n# $1 is a space-separated list\nspecialFilter() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n specialFilter \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5 -2 1 -5\") = \"0\" ]]\n [[ $(candidate \"15 -73 14 -15\") = \"1\" ]]\n [[ $(candidate \"33 -2 -3 45 21 109\") = \"2\" ]]\n [[ $(candidate \"43 -12 93 125 121 109\") = \"4\" ]]\n [[ $(candidate \"71 -2 -33 75 21 19\") = \"3\" ]]\n [[ $(candidate \"1\") = \"0\" ]]\n [[ $(candidate \"\") = \"0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a dictionary, return True if all keys are strings in lower \n# case or all keys are strings in upper case, else return False.\n# The function should return False is the given dictionary is empty.\n# Examples:\n# >>> $(check_dict_case \"a,apple\\nb,banana\")\n# \"true\"\n# >>> $(check_dict_case \"a,apple\\nA,banana\\nB,banana\")\n# \"false\"\n# >>> $(check_dict_case \"a,apple\\n8,banana\")\n# \"false\"\n# >>> $(check_dict_case \"Name,John\\nAge,36\\nCity,Houston\")\n# \"false\"\n# >>> $(check_dict_case \"STATE,NC\\nZIP,12345\")\n# \"true\"\n#\n# $1 is a two column CSV in key,value order\ncheck_dict_case() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n check_dict_case \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"p,pineapple\\nb,banana\") = \"true\" ]]\n [[ $(candidate \"p,pineapple\\nA,banana\\nB,banana\") = \"false\" ]]\n [[ $(candidate \"p,pineapple\\n5,banana\\na,apple\") = \"false\" ]]\n [[ $(candidate \"Name,John\\nAge,36\\nCity,Houston\") = \"false\" ]]\n [[ $(candidate \"STATE,NC\\nZIP,12345\") = \"true\" ]]\n [[ $(candidate \"fruit,Orange\\ntaste,Sweet\") = \"true\" ]]\n [[ $(candidate \"\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n# should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n# alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n# Examples\n# >>> $(split_words \"Hello world\\!\")\n# ['\"Hello\"', '\"world\\\\!\"']\n# >>> $(split_words \"Hello,world\\!\")\n# ['\"Hello\"', '\"world\\\\!\"']\n# >>> $(split_words \"abcdef\")\n# \"3\"\n#\n# $1 is a string\nsplit_words() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n split_words \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Hello world\\!\") = \"Hello world\\!\" ]]\n [[ $(candidate \"Hello,world\\!\") = \"Hello world\\!\" ]]\n [[ $(candidate \"Hello world,\\!\") = \"Hello world,\\!\" ]]\n [[ $(candidate \"Hello,Hello,world \\!\") = \"Hello,Hello,world \\!\" ]]\n [[ $(candidate \"abcdef\") = \"3\" ]]\n [[ $(candidate \"aaabb\") = \"2\" ]]\n [[ $(candidate \"aaaBb\") = \"1\" ]]\n [[ $(candidate \"\") = \"0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "sh", - "prompt": "#!/bin/bash\n# The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n# fibfib(0) == 0\n# fibfib(1) == 0\n# fibfib(2) == 1\n# fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n# Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n# >>> $(fibfib \"1\")\n# \"0\"\n# >>> $(fibfib \"5\")\n# \"4\"\n# >>> $(fibfib \"8\")\n# \"24\"\n#\n# $1 is an integer\nfibfib() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n fibfib \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2\") = \"1\" ]]\n [[ $(candidate \"1\") = \"0\" ]]\n [[ $(candidate \"5\") = \"4\" ]]\n [[ $(candidate \"8\") = \"24\" ]]\n [[ $(candidate \"10\") = \"81\" ]]\n [[ $(candidate \"12\") = \"274\" ]]\n [[ $(candidate \"14\") = \"927\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a list of numbers.\n# You need to return the sum of squared numbers in the given list,\n# round each element in the list to the upper int(Ceiling) first.\n# Examples:\n# >>> $(lst \"1.0 2.0 3.0\")\n# \"14\"\n# >>> $(lst \"1.0 4.0 9.0\")\n# \"98\"\n# >>> $(lst \"1.0 3.0 5.0 7.0\")\n# \"84\"\n# >>> $(lst \"1.4 4.2 0.0\")\n# \"29\"\n# >>> $(lst \"-2.4 1.0 1.0\")\n# \"6\"\n#\n# $1 is a space-separated list\nsum_squares() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n sum_squares \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1.0 2.0 3.0\") = \"14\" ]]\n [[ $(candidate \"1.0 2.0 3.0\") = \"14\" ]]\n [[ $(candidate \"1.0 3.0 5.0 7.0\") = \"84\" ]]\n [[ $(candidate \"1.4 4.2 0.0\") = \"29\" ]]\n [[ $(candidate \"-2.4 1.0 1.0\") = \"6\" ]]\n [[ $(candidate \"100.0 1.0 15.0 2.0\") = \"10230\" ]]\n [[ $(candidate \"10000.0 10000.0\") = \"200000000\" ]]\n [[ $(candidate \"-1.4 4.6 6.3\") = \"75\" ]]\n [[ $(candidate \"-1.4 17.9 18.9 19.9\") = \"1086\" ]]\n [[ $(candidate \"0.0\") = \"0\" ]]\n [[ $(candidate \"-1.0\") = \"1\" ]]\n [[ $(candidate \"-1.0 1.0 0.0\") = \"2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_85_add", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a non-empty list of integers lst. add the even elements that are at odd indices..\n# Examples:\n# >>> $(add \"4 2 6 7\")\n# \"2\"\n#\n# $1 is a space-separated list\nadd() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n add \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"4 88\") = \"88\" ]]\n [[ $(candidate \"4 5 6 7 2 122\") = \"122\" ]]\n [[ $(candidate \"4 0 6 7\") = \"0\" ]]\n [[ $(candidate \"4 4 6 8\") = \"12\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "sh", - "prompt": "#!/bin/bash\n# Return sorted unique elements in a list\n# >>> $(unique \"5 3 5 2 3 3 9 0 123\")\n# ['\"0\"', '\"2\"', '\"3\"', '\"5\"', '\"9\"', '\"123\"']\n#\n# $1 is a space-separated list\nunique() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n unique \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5 3 5 2 3 3 9 0 123\") = \"0 2 3 5 9 123\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a string text, replace all spaces in it with underscores, \n# and if a string has more than 2 consecutive spaces, \n# then replace all consecutive spaces with - \n# >>> $(fix_spaces \" Example\")\n# \"Example\"\n# >>> $(fix_spaces \" Example 1\")\n# \"Example_1\"\n# >>> $(fix_spaces \" Example 2\")\n# \"_Example_2\"\n# >>> $(fix_spaces \" Example 3\")\n# \"_Example-3\"\n#\n# $1 is a string\nfix_spaces() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n fix_spaces \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Example\") = \"Example\" ]]\n [[ $(candidate \"Mudasir Hanif \") = \"Mudasir_Hanif_\" ]]\n [[ $(candidate \"Yellow Yellow Dirty Fellow\") = \"Yellow_Yellow__Dirty__Fellow\" ]]\n [[ $(candidate \"Exa mple\") = \"Exa-mple\" ]]\n [[ $(candidate \" Exa 1 2 2 mple\") = \"-Exa_1_2_2_mple\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "sh", - "prompt": "#!/bin/bash\n# Return 2^n modulo p (be aware of numerics).\n# >>> $(modp \"3\" \"5\")\n# \"3\"\n# >>> $(modp \"1101\" \"101\")\n# \"2\"\n# >>> $(modp \"0\" \"101\")\n# \"1\"\n# >>> $(modp \"3\" \"11\")\n# \"8\"\n# >>> $(modp \"100\" \"101\")\n# \"1\"\n#\n# $1 is an integer\n# $2 is an integer\nmodp() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n modp \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3\" \"5\") = \"3\" ]]\n [[ $(candidate \"1101\" \"101\") = \"2\" ]]\n [[ $(candidate \"0\" \"101\") = \"1\" ]]\n [[ $(candidate \"3\" \"11\") = \"8\" ]]\n [[ $(candidate \"100\" \"101\") = \"1\" ]]\n [[ $(candidate \"30\" \"5\") = \"4\" ]]\n [[ $(candidate \"31\" \"5\") = \"3\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "sh", - "prompt": "#!/bin/bash\n# You have to write a function which validates a given date string and\n# returns True if the date is valid otherwise False.\n# The date is valid if all of the following rules are satisfied:\n# 1. The date string is not empty.\n# 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n# 3. The months should not be less than 1 or higher than 12.\n# 4. The date should be in the format: mm-dd-yyyy\n# >>> $(valid_date \"03-11-2000\")\n# \"true\"\n# >>> $(valid_date \"15-01-2012\")\n# \"false\"\n# >>> $(valid_date \"04-0-2040\")\n# \"false\"\n# >>> $(valid_date \"06-04-2020\")\n# \"true\"\n# >>> $(valid_date \"06/04/2020\")\n# \"false\"\n#\n# $1 is a string\nvalid_date() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n valid_date \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"03-11-2000\") = \"true\" ]]\n [[ $(candidate \"15-01-2012\") = \"false\" ]]\n [[ $(candidate \"04-0-2040\") = \"false\" ]]\n [[ $(candidate \"06-04-2020\") = \"true\" ]]\n [[ $(candidate \"01-01-2007\") = \"true\" ]]\n [[ $(candidate \"03-32-2011\") = \"false\" ]]\n [[ $(candidate \"\") = \"false\" ]]\n [[ $(candidate \"04-31-3000\") = \"false\" ]]\n [[ $(candidate \"06-06-2005\") = \"true\" ]]\n [[ $(candidate \"21-31-2000\") = \"false\" ]]\n [[ $(candidate \"04-12-2003\") = \"true\" ]]\n [[ $(candidate \"04122003\") = \"false\" ]]\n [[ $(candidate \"20030412\") = \"false\" ]]\n [[ $(candidate \"2003-04\") = \"false\" ]]\n [[ $(candidate \"2003-04-12\") = \"false\" ]]\n [[ $(candidate \"04-2003\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that takes a string and returns an ordered version of it.\n# Ordered version of string, is a string where all words (separated by space)\n# are replaced by a new word where all the characters arranged in\n# ascending order based on ascii value.\n# Note: You should keep the order of words and blank spaces in the sentence.\n# For example:\n# >>> $(anti_shuffle \"Hi\")\n# \"Hi\"\n# >>> $(anti_shuffle \"hello\")\n# \"ehllo\"\n# >>> $(anti_shuffle \"Hello World\\!\\!\\!\")\n# \"Hello \\!\\!\\!Wdlor\"\n#\n# $1 is a string\nanti_shuffle() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n anti_shuffle \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Hi\") = \"Hi\" ]]\n [[ $(candidate \"hello\") = \"ehllo\" ]]\n [[ $(candidate \"number\") = \"bemnru\" ]]\n [[ $(candidate \"abcd\") = \"abcd\" ]]\n [[ $(candidate \"Hello World\\!\\!\\!\") = \"Hello \\!\\!\\!Wdlor\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"Hi. My name is Mister Robot. How are you?\") = \".Hi My aemn is Meirst .Rboot How aer ?ouy\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a list of numbers, return whether or not they are sorted\n# in ascending order. If list has more than 1 duplicate of the same\n# number, return False. Assume no negative numbers and only integers.\n# Examples\n# >>> $(is_sorted \"5\")\n# \"true\"\n# >>> $(is_sorted \"1 2 3 4 5\")\n# \"true\"\n# >>> $(is_sorted \"1 3 2 4 5\")\n# \"false\"\n# >>> $(is_sorted \"1 2 3 4 5 6\")\n# \"true\"\n# >>> $(is_sorted \"1 2 3 4 5 6 7\")\n# \"true\"\n# >>> $(is_sorted \"1 3 2 4 5 6 7\")\n# \"false\"\n# >>> $(is_sorted \"1 2 2 3 3 4\")\n# \"true\"\n# >>> $(is_sorted \"1 2 2 2 3 4\")\n# \"false\"\n#\n# $1 is a space-separated list\nis_sorted() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n is_sorted \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\") = \"true\" ]]\n [[ $(candidate \"1 2 3 4 5\") = \"true\" ]]\n [[ $(candidate \"1 3 2 4 5\") = \"false\" ]]\n [[ $(candidate \"1 2 3 4 5 6\") = \"true\" ]]\n [[ $(candidate \"1 2 3 4 5 6 7\") = \"true\" ]]\n [[ $(candidate \"1 3 2 4 5 6 7\") = \"false\" ]]\n [[ $(candidate \"\") = \"true\" ]]\n [[ $(candidate \"1\") = \"true\" ]]\n [[ $(candidate \"3 2 1\") = \"false\" ]]\n [[ $(candidate \"1 2 2 2 3 4\") = \"false\" ]]\n [[ $(candidate \"1 2 3 3 3 4\") = \"false\" ]]\n [[ $(candidate \"1 2 2 3 3 4\") = \"true\" ]]\n [[ $(candidate \"1 2 3 4\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a string s.\n# Your task is to check if the string is happy or not.\n# A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n# For example:\n# >>> $(is_happy \"a\")\n# \"false\"\n# >>> $(is_happy \"aa\")\n# \"false\"\n# >>> $(is_happy \"abcd\")\n# \"true\"\n# >>> $(is_happy \"aabb\")\n# \"false\"\n# >>> $(is_happy \"adb\")\n# \"true\"\n# >>> $(is_happy \"xyy\")\n# \"false\"\n#\n# $1 is a string\nis_happy() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n is_happy \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"a\") = \"false\" ]]\n [[ $(candidate \"aa\") = \"false\" ]]\n [[ $(candidate \"abcd\") = \"true\" ]]\n [[ $(candidate \"aabb\") = \"false\" ]]\n [[ $(candidate \"adb\") = \"true\" ]]\n [[ $(candidate \"xyy\") = \"false\" ]]\n [[ $(candidate \"iopaxpoi\") = \"true\" ]]\n [[ $(candidate \"iopaxioi\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "sh", - "prompt": "#!/bin/bash\n# Write a function that returns True if the object q will fly, and False otherwise.\n# The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n# Example:\n# >>> $(will_it_fly \"1 2\" \"5\")\n# \"false\"\n# # 1+2 is less than the maximum possible weight, but it's unbalanced.\n# >>> $(will_it_fly \"3 2 3\" \"1\")\n# \"false\"\n# # it's balanced, but 3+2+3 is more than the maximum possible weight.\n# >>> $(will_it_fly \"3 2 3\" \"9\")\n# \"true\"\n# # 3+2+3 is less than the maximum possible weight, and it's balanced.\n# >>> $(will_it_fly \"3\" \"5\")\n# \"true\"\n# # 3 is less than the maximum possible weight, and it's balanced.\n#\n# $1 is a space-separated list\n# $2 is an integer\nwill_it_fly() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n will_it_fly \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3 2 3\" \"9\") = \"true\" ]]\n [[ $(candidate \"1 2\" \"5\") = \"false\" ]]\n [[ $(candidate \"3\" \"5\") = \"true\" ]]\n [[ $(candidate \"3 2 3\" \"1\") = \"false\" ]]\n [[ $(candidate \"1 2 3\" \"6\") = \"false\" ]]\n [[ $(candidate \"5\" \"5\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "sh", - "prompt": "#!/bin/bash\n# Given an array of non-negative integers, return a copy of the given array after sorting,\n# you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n# or sort it in descending order if the sum( first index value, last index value) is even.\n# Note:\n# * don't change the given array.\n# Examples:\n# >>> $(sort_array \"\")\n# []\n# >>> $(sort_array \"5\")\n# ['\"5\"']\n# >>> $(sort_array \"2 4 3 0 1 5\")\n# ['\"0\"', '\"1\"', '\"2\"', '\"3\"', '\"4\"', '\"5\"']\n# >>> $(sort_array \"2 4 3 0 1 5 6\")\n# ['\"6\"', '\"5\"', '\"4\"', '\"3\"', '\"2\"', '\"1\"', '\"0\"']\n#\n# $1 is a space-separated list\nsort_array() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n sort_array \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"5\") = \"5\" ]]\n [[ $(candidate \"2 4 3 0 1 5\") = \"0 1 2 3 4 5\" ]]\n [[ $(candidate \"2 4 3 0 1 5 6\") = \"6 5 4 3 2 1 0\" ]]\n [[ $(candidate \"2 1\") = \"1 2\" ]]\n [[ $(candidate \"15 42 87 32 11 0\") = \"0 11 15 32 42 87\" ]]\n [[ $(candidate \"21 14 23 11\") = \"23 21 14 11\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "sh", - "prompt": "#!/bin/bash\n# Implement a function that takes an non-negative integer and returns an array of the first n\n# integers that are prime numbers and less than n.\n# for example:\n# >>> $(count_up_to \"5\")\n# ['\"2\"', '\"3\"']\n# >>> $(count_up_to \"11\")\n# ['\"2\"', '\"3\"', '\"5\"', '\"7\"']\n# >>> $(count_up_to \"0\")\n# []\n# >>> $(count_up_to \"20\")\n# ['\"2\"', '\"3\"', '\"5\"', '\"7\"', '\"11\"', '\"13\"', '\"17\"', '\"19\"']\n# >>> $(count_up_to \"1\")\n# []\n# >>> $(count_up_to \"18\")\n# ['\"2\"', '\"3\"', '\"5\"', '\"7\"', '\"11\"', '\"13\"', '\"17\"']\n#\n# $1 is an integer\ncount_up_to() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n count_up_to \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\") = \"2 3\" ]]\n [[ $(candidate \"6\") = \"2 3 5\" ]]\n [[ $(candidate \"7\") = \"2 3 5\" ]]\n [[ $(candidate \"10\") = \"2 3 5 7\" ]]\n [[ $(candidate \"0\") = \"\" ]]\n [[ $(candidate \"22\") = \"2 3 5 7 11 13 17 19\" ]]\n [[ $(candidate \"1\") = \"\" ]]\n [[ $(candidate \"18\") = \"2 3 5 7 11 13 17\" ]]\n [[ $(candidate \"47\") = \"2 3 5 7 11 13 17 19 23 29 31 37 41 43\" ]]\n [[ $(candidate \"101\") = \"2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "sh", - "prompt": "#!/bin/bash\n# Out of list of strings, return the longest one. Return the first one in case of multiple\n# strings of the same length. Return None in case the input list is empty.\n# >>> $(longest \"\")\n# \"None\"\n# >>> $(longest \"a b c\")\n# \"a\"\n# >>> $(longest \"a bb ccc\")\n# \"ccc\"\n#\n# $1 is a space-separated list\nlongest() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n longest \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"None\" ]]\n [[ $(candidate \"x y z\") = \"x\" ]]\n [[ $(candidate \"x yyy zzzz www kkkk abc\") = \"zzzz\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "sh", - "prompt": "#!/bin/bash\n# Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n# reverse the resulting array, and then replace each digit by its corresponding name from\n# \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n# For example:\n# >>> $(by_length \"2 1 1 4 5 8 2 3\")\n# ['\"Eight\"', '\"Five\"', '\"Four\"', '\"Three\"', '\"Two\"', '\"Two\"', '\"One\"', '\"One\"']\n# If the array is empty, return an empty array:\n# >>> $(by_length \"\")\n# []\n# If the array has any strange number ignore it:\n# >>> $(by_length \"1 -1 55\")\n# ['\"One\"']\n#\n# $1 is a space-separated list\nby_length() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n by_length \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2 1 1 4 5 8 2 3\") = \"Eight Five Four Three Two Two One One\" ]]\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"1 -1 55\") = \"One\" ]]\n [[ $(candidate \"1 -1 3 2\") = \"Three Two One\" ]]\n [[ $(candidate \"9 4 8\") = \"Nine Eight Four\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_106_f", - "language": "sh", - "prompt": "#!/bin/bash\n# Implement the function f that takes n as a parameter,\n# 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\n# or the sum of numbers from 1 to i otherwise.\n# i starts from 1.\n# the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n# Example:\n# >>> $(f \"5\")\n# ['\"1\"', '\"2\"', '\"6\"', '\"24\"', '\"15\"']\n#\n# $1 is an integer\nf() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n f \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\") = \"1 2 6 24 15\" ]]\n [[ $(candidate \"7\") = \"1 2 6 24 15 720 28\" ]]\n [[ $(candidate \"1\") = \"1\" ]]\n [[ $(candidate \"3\") = \"1 2 6\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "sh", - "prompt": "#!/bin/bash\n# Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n# >>> $(fizz_buzz \"50\")\n# \"0\"\n# >>> $(fizz_buzz \"78\")\n# \"2\"\n# >>> $(fizz_buzz \"79\")\n# \"3\"\n#\n# $1 is an integer\nfizz_buzz() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n fizz_buzz \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"50\") = \"0\" ]]\n [[ $(candidate \"78\") = \"2\" ]]\n [[ $(candidate \"79\") = \"3\" ]]\n [[ $(candidate \"100\") = \"3\" ]]\n [[ $(candidate \"200\") = \"6\" ]]\n [[ $(candidate \"4000\") = \"192\" ]]\n [[ $(candidate \"10000\") = \"639\" ]]\n [[ $(candidate \"100000\") = \"8026\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a positive floating point number, it can be decomposed into\n# and integer part (largest integer smaller than given number) and decimals\n# (leftover part always smaller than 1).\n# Return the decimal part of the number.\n# >>> $(truncate_number \"3.5\")\n# \"0.5\"\n#\n# $1 is a floating point\ntruncate_number() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n truncate_number \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3.5\") = \"0.5\" ]]\n [[ $(candidate \"1.25\") = \"0.25\" ]]\n [[ $(candidate \"123.0\") = \"0.0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "sh", - "prompt": "#!/bin/bash\n# For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n# Empty sum should be equal to 0 and empty product should be equal to 1.\n# >>> $(sum_product \"\")\n# ['\"0\"', '\"1\"']\n# >>> $(sum_product \"1 2 3 4\")\n# ['\"10\"', '\"24\"']\n#\n# $1 is a space-separated list\nsum_product() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n sum_product \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"0 1\" ]]\n [[ $(candidate \"1 1 1\") = \"3 1\" ]]\n [[ $(candidate \"100 0\") = \"100 0\" ]]\n [[ $(candidate \"3 5 7\") = \"15 105\" ]]\n [[ $(candidate \"10\") = \"10 10\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a 2 dimensional data, as a nested lists,\n# which is similar to matrix, however, unlike matrices,\n# each row may contain a different number of columns.\n# Given lst, and integer x, find integers x in the list,\n# and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n# each tuple is a coordinate - (row, columns), starting with 0.\n# Sort coordinates initially by rows in ascending order.\n# Also, sort coordinates of the row by columns in descending order.\n# Examples:\n# >>> $(get_row \"1 2 3 4 5 6\\n1 2 3 4 1 6\\n1 2 3 4 5 1\" \"1\")\n# [['\"0\"', '\"0\"'], ['\"1\"', '\"4\"'], ['\"1\"', '\"0\"'], ['\"2\"', '\"5\"'], ['\"2\"', '\"0\"']]\n# >>> $(get_row \"\" \"1\")\n# []\n# >>> $(get_row \"\\n1\\n1 2 3\" \"3\")\n# [['\"2\"', '\"2\"']]\n#\n# $1 is a newline-separated, space-separated list\n# $2 is an integer\nget_row() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n get_row \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3 4 5 6\\n1 2 3 4 1 6\\n1 2 3 4 5 1\" \"1\") = \"0 0\\n1 4\\n1 0\\n2 5\\n2 0\" ]]\n [[ $(candidate \"1 2 3 4 5 6\\n1 2 3 4 5 6\\n1 2 3 4 5 6\\n1 2 3 4 5 6\\n1 2 3 4 5 6\\n1 2 3 4 5 6\" \"2\") = \"0 1\\n1 1\\n2 1\\n3 1\\n4 1\\n5 1\" ]]\n [[ $(candidate \"1 2 3 4 5 6\\n1 2 3 4 5 6\\n1 1 3 4 5 6\\n1 2 1 4 5 6\\n1 2 3 1 5 6\\n1 2 3 4 1 6\\n1 2 3 4 5 1\" \"1\") = \"0 0\\n1 0\\n2 1\\n2 0\\n3 2\\n3 0\\n4 3\\n4 0\\n5 4\\n5 0\\n6 5\\n6 0\" ]]\n [[ $(candidate \"\" \"1\") = \"\" ]]\n [[ $(candidate \"1\" \"2\") = \"\" ]]\n [[ $(candidate \"\\n1\\n1 2 3\" \"3\") = \"2 2\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "sh", - "prompt": "#!/bin/bash\n# You're a hungry rabbit, and you already have eaten a certain number of carrots,\n# but now you need to eat more carrots to complete the day's meals.\n# you should return an array of [ total number of eaten carrots after your meals,\n# the number of carrots left after your meals ]\n# if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n# Example:\n# >>> $(eat \"5\" \"6\" \"10\")\n# ['\"11\"', '\"4\"']\n# >>> $(eat \"4\" \"8\" \"9\")\n# ['\"12\"', '\"1\"']\n# >>> $(eat \"1\" \"10\" \"10\")\n# ['\"11\"', '\"0\"']\n# >>> $(eat \"2\" \"11\" \"5\")\n# ['\"7\"', '\"0\"']\n# Variables:\n# @number : integer\n# the number of carrots that you have eaten.\n# @need : integer\n# the number of carrots that you need to eat.\n# @remaining : integer\n# the number of remaining carrots thet exist in stock\n# Constrain:\n# * 0 <= number <= 1000\n# * 0 <= need <= 1000\n# * 0 <= remaining <= 1000\n# Have fun :)\n#\n# $1 is an integer\n# $2 is an integer\n# $3 is an integer\neat() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n eat \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"5\" \"6\" \"10\") = \"11 4\" ]]\n [[ $(candidate \"4\" \"8\" \"9\") = \"12 1\" ]]\n [[ $(candidate \"1\" \"10\" \"10\") = \"11 0\" ]]\n [[ $(candidate \"2\" \"11\" \"5\") = \"7 0\" ]]\n [[ $(candidate \"4\" \"5\" \"7\") = \"9 2\" ]]\n [[ $(candidate \"4\" \"5\" \"1\") = \"5 0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a positive integer N, return the total sum of its digits in binary.\n# Example\n# >>> $(solve \"1000\")\n# \"1\"\n# >>> $(solve \"150\")\n# \"110\"\n# >>> $(solve \"147\")\n# \"1100\"\n# Variables:\n# @N integer\n# Constraints: 0 \u2264 N \u2264 10000.\n# Output:\n# a string of binary number\n#\n# $1 is an integer\nsolve() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n solve \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1000\") = \"1\" ]]\n [[ $(candidate \"150\") = \"110\" ]]\n [[ $(candidate \"147\") = \"1100\" ]]\n [[ $(candidate \"333\") = \"1001\" ]]\n [[ $(candidate \"963\") = \"10010\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given a list of integers.\n# You need to find the largest prime value and return the sum of its digits.\n# Examples:\n# >>> $(skjkasdkd \"0 3 2 1 3 5 7 4 5 5 5 2 181 32 4 32 3 2 32 324 4 3\")\n# \"10\"\n# >>> $(skjkasdkd \"1 0 1 8 2 4597 2 1 3 40 1 2 1 2 4 2 5 1\")\n# \"25\"\n# >>> $(skjkasdkd \"1 3 1 32 5107 34 83278 109 163 23 2323 32 30 1 9 3\")\n# \"13\"\n# >>> $(skjkasdkd \"0 724 32 71 99 32 6 0 5 91 83 0 5 6\")\n# \"11\"\n# >>> $(skjkasdkd \"0 81 12 3 1 21\")\n# \"3\"\n# >>> $(skjkasdkd \"0 8 1 2 1 7\")\n# \"7\"\n#\n# $1 is a space-separated list\nskjkasdkd() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n skjkasdkd \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"0 3 2 1 3 5 7 4 5 5 5 2 181 32 4 32 3 2 32 324 4 3\") = \"10\" ]]\n [[ $(candidate \"1 0 1 8 2 4597 2 1 3 40 1 2 1 2 4 2 5 1\") = \"25\" ]]\n [[ $(candidate \"1 3 1 32 5107 34 83278 109 163 23 2323 32 30 1 9 3\") = \"13\" ]]\n [[ $(candidate \"0 724 32 71 99 32 6 0 5 91 83 0 5 6\") = \"11\" ]]\n [[ $(candidate \"0 81 12 3 1 21\") = \"3\" ]]\n [[ $(candidate \"0 8 1 2 1 7\") = \"7\" ]]\n [[ $(candidate \"8191\") = \"19\" ]]\n [[ $(candidate \"8191 123456 127 7\") = \"19\" ]]\n [[ $(candidate \"127 97 8192\") = \"10\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "sh", - "prompt": "#!/bin/bash\n# Given an array arr of integers, find the minimum number of elements that\n# need to be changed to make the array palindromic. A palindromic array is an array that\n# is read the same backwards and forwards. In one change, you can change one element to any other element.\n# For example:\n# >>> $(smallest_change \"1 2 3 5 4 7 9 6\")\n# \"4\"\n# >>> $(smallest_change \"1 2 3 4 3 2 2\")\n# \"1\"\n# >>> $(smallest_change \"1 2 3 2 1\")\n# \"0\"\n#\n# $1 is a space-separated list\nsmallest_change() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n smallest_change \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2 3 5 4 7 9 6\") = \"4\" ]]\n [[ $(candidate \"1 2 3 4 3 2 2\") = \"1\" ]]\n [[ $(candidate \"1 4 2\") = \"1\" ]]\n [[ $(candidate \"1 4 4 2\") = \"1\" ]]\n [[ $(candidate \"1 2 3 2 1\") = \"0\" ]]\n [[ $(candidate \"3 1 1 3\") = \"0\" ]]\n [[ $(candidate \"1\") = \"0\" ]]\n [[ $(candidate \"0 1\") = \"1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "sh", - "prompt": "#!/bin/bash\n# It is the last week of the semester and the teacher has to give the grades\n# to students. The teacher has been making her own algorithm for grading.\n# The only problem is, she has lost the code she used for grading.\n# She has given you a list of GPAs for some students and you have to write \n# a function that can output a list of letter grades using the following table:\n# GPA | Letter grade\n# 4.0 A+\n# > 3.7 A \n# > 3.3 A- \n# > 3.0 B+\n# > 2.7 B \n# > 2.3 B-\n# > 2.0 C+\n# > 1.7 C\n# > 1.3 C-\n# > 1.0 D+ \n# > 0.7 D \n# > 0.0 D-\n# 0.0 E\n# Example:\n# >>> $(grade_equation \"4.0 3 1.7 2 3.5\")\n# ['\"A+\"', '\"B\"', '\"C-\"', '\"C\"', '\"A-\"']\n#\n# $1 is a space-separated list\nnumerical_letter_grade() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n numerical_letter_grade \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"4.0 3 1.7 2 3.5\") = \"A+ B C- C A-\" ]]\n [[ $(candidate \"1.2\") = \"D+\" ]]\n [[ $(candidate \"0.5\") = \"D-\" ]]\n [[ $(candidate \"0.0\") = \"E\" ]]\n [[ $(candidate \"1.0 0.3 1.5 2.8 3.3\") = \"D D- C- B B+\" ]]\n [[ $(candidate \"0.0 0.7\") = \"E D-\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "sh", - "prompt": "#!/bin/bash\n# Given the lengths of the three sides of a triangle. Return the area of\n# the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n# Otherwise return -1\n# Three sides make a valid triangle when the sum of any two sides is greater \n# than the third side.\n# Example:\n# >>> $(triangle_area \"3\" \"4\" \"5\")\n# \"6.0\"\n# >>> $(triangle_area \"1\" \"2\" \"10\")\n# \"-1\"\n#\n# $1 is an integer\n# $2 is an integer\n# $3 is an integer\ntriangle_area() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n triangle_area \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"3\" \"4\" \"5\") = \"6.0\" ]]\n [[ $(candidate \"1\" \"2\" \"10\") = \"-1\" ]]\n [[ $(candidate \"4\" \"8\" \"5\") = \"8.18\" ]]\n [[ $(candidate \"2\" \"2\" \"2\") = \"1.73\" ]]\n [[ $(candidate \"1\" \"2\" \"3\") = \"-1\" ]]\n [[ $(candidate \"10\" \"5\" \"7\") = \"16.25\" ]]\n [[ $(candidate \"2\" \"6\" \"3\") = \"-1\" ]]\n [[ $(candidate \"1\" \"1\" \"1\") = \"0.43\" ]]\n [[ $(candidate \"2\" \"2\" \"10\") = \"-1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "sh", - "prompt": "#!/bin/bash\n# Check if two words have the same characters.\n# >>> $(same_chars \"eabcdzzzz\" \"dddzzzzzzzddeddabc\")\n# \"true\"\n# >>> $(same_chars \"abcd\" \"dddddddabc\")\n# \"true\"\n# >>> $(same_chars \"dddddddabc\" \"abcd\")\n# \"true\"\n# >>> $(same_chars \"eabcd\" \"dddddddabc\")\n# \"false\"\n# >>> $(same_chars \"abcd\" \"dddddddabce\")\n# \"false\"\n# >>> $(same_chars \"eabcdzzzz\" \"dddzzzzzzzddddabc\")\n# \"false\"\n#\n# $1 is a string\n# $2 is a string\nsame_chars() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n same_chars \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"eabcdzzzz\" \"dddzzzzzzzddeddabc\") = \"true\" ]]\n [[ $(candidate \"abcd\" \"dddddddabc\") = \"true\" ]]\n [[ $(candidate \"dddddddabc\" \"abcd\") = \"true\" ]]\n [[ $(candidate \"eabcd\" \"dddddddabc\") = \"false\" ]]\n [[ $(candidate \"abcd\" \"dddddddabcf\") = \"false\" ]]\n [[ $(candidate \"eabcdzzzz\" \"dddzzzzzzzddddabc\") = \"false\" ]]\n [[ $(candidate \"aabb\" \"aaccc\") = \"false\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "sh", - "prompt": "#!/bin/bash\n# Given an array of integers nums, find the minimum sum of any non-empty sub-array\n# of nums.\n# Example\n# >>> $(minSubArraySum \"2 3 4 1 2 4\")\n# \"1\"\n# >>> $(minSubArraySum \"-1 -2 -3\")\n# \"-6\"\n#\n# $1 is a space-separated list\nminSubArraySum() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n minSubArraySum \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"2 3 4 1 2 4\") = \"1\" ]]\n [[ $(candidate \"-1 -2 -3\") = \"-6\" ]]\n [[ $(candidate \"-1 -2 -3 2 -10\") = \"-14\" ]]\n [[ $(candidate \"-9999999999999999\") = \"-9999999999999999\" ]]\n [[ $(candidate \"0 10 20 1000000\") = \"0\" ]]\n [[ $(candidate \"-1 -2 -3 10 -5\") = \"-6\" ]]\n [[ $(candidate \"100 -1 -2 -3 10 -5\") = \"-6\" ]]\n [[ $(candidate \"10 11 13 8 3 4\") = \"3\" ]]\n [[ $(candidate \"100 -33 32 -1 0 -2\") = \"-33\" ]]\n [[ $(candidate \"-10\") = \"-10\" ]]\n [[ $(candidate \"7\") = \"7\" ]]\n [[ $(candidate \"1 -1\") = \"-1\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a string s and a natural number n, you have been tasked to implement \n# a function that returns a list of all words from string s that contain exactly \n# n consonants, in order these words appear in the string s.\n# If the string s is empty then the function should return an empty list.\n# Note: you may assume the input string contains only letters and spaces.\n# Examples:\n# >>> $(select_words \"Mary had a little lamb\" \"4\")\n# ['\"little\"']\n# >>> $(select_words \"Mary had a little lamb\" \"3\")\n# ['\"Mary\"', '\"lamb\"']\n# >>> $(select_words \"simple white space\" \"2\")\n# []\n# >>> $(select_words \"Hello world\" \"4\")\n# ['\"world\"']\n# >>> $(select_words \"Uncle sam\" \"3\")\n# ['\"Uncle\"']\n#\n# $1 is a string\n# $2 is an integer\nselect_words() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n select_words \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"Mary had a little lamb\" \"4\") = \"little\" ]]\n [[ $(candidate \"Mary had a little lamb\" \"3\") = \"Mary lamb\" ]]\n [[ $(candidate \"simple white space\" \"2\") = \"\" ]]\n [[ $(candidate \"Hello world\" \"4\") = \"world\" ]]\n [[ $(candidate \"Uncle sam\" \"3\") = \"Uncle\" ]]\n [[ $(candidate \"\" \"4\") = \"\" ]]\n [[ $(candidate \"a b c d e f\" \"1\") = \"b c d f\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "sh", - "prompt": "#!/bin/bash\n# Return list of all prefixes from shortest to longest of the input string\n# >>> $(all_prefixes \"abc\")\n# ['\"a\"', '\"ab\"', '\"abc\"']\n#\n# $1 is a string\nall_prefixes() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n all_prefixes \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"asdfgh\") = \"a as asd asdf asdfg asdfgh\" ]]\n [[ $(candidate \"WWW\") = \"W WW WWW\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function that takes a value (string) representing a number\n# and returns the closest integer to it. If the number is equidistant\n# from two integers, round it away from zero.\n# Examples\n# >>> $(closest_integer \"10\")\n# \"10\"\n# >>> $(closest_integer \"15.3\")\n# \"15\"\n# Note:\n# Rounding away from zero means that if the given number is equidistant\n# from two integers, the one you should return is the one that is the\n# farthest from zero. For example closest_integer(\"14.5\") should\n# return 15 and closest_integer(\"-14.5\") should return -15.\n#\n# $1 is a string\nclosest_integer() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n closest_integer \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"10\") = \"10\" ]]\n [[ $(candidate \"14.5\") = \"15\" ]]\n [[ $(candidate \"-15.5\") = \"-16\" ]]\n [[ $(candidate \"15.3\") = \"15\" ]]\n [[ $(candidate \"0\") = \"0\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "sh", - "prompt": "#!/bin/bash\n# Create a function which takes a string representing a file's name, and returns\n# 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n# A file's name is considered to be valid if and only if all the following conditions \n# are met:\n# - There should not be more than three digits ('0'-'9') in the file's name.\n# - The file's name contains exactly one dot '.'\n# - The substring before the dot should not be empty, and it starts with a letter from \n# the latin alphapet ('a'-'z' and 'A'-'Z').\n# - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n# Examples:\n# >>> $(file_name_check \"example.txt\")\n# \"Yes\"\n# >>> $(file_name_check \"1example.dll\")\n# \"No\"\n#\n# $1 is a string\nfile_name_check() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n file_name_check \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"example.txt\") = \"Yes\" ]]\n [[ $(candidate \"1example.dll\") = \"No\" ]]\n [[ $(candidate \"s1sdf3.asd\") = \"No\" ]]\n [[ $(candidate \"K.dll\") = \"Yes\" ]]\n [[ $(candidate \"MY16FILE3.exe\") = \"Yes\" ]]\n [[ $(candidate \"His12FILE94.exe\") = \"No\" ]]\n [[ $(candidate \"_Y.txt\") = \"No\" ]]\n [[ $(candidate \"?aREYA.exe\") = \"No\" ]]\n [[ $(candidate \"/this_is_valid.dll\") = \"No\" ]]\n [[ $(candidate \"this_is_valid.wow\") = \"No\" ]]\n [[ $(candidate \"this_is_valid.txt\") = \"Yes\" ]]\n [[ $(candidate \"this_is_valid.txtexe\") = \"No\" ]]\n [[ $(candidate \"#this2_i4s_5valid.ten\") = \"No\" ]]\n [[ $(candidate \"@this1_is6_valid.exe\") = \"No\" ]]\n [[ $(candidate \"this_is_12valid.6exe4.txt\") = \"No\" ]]\n [[ $(candidate \"all.exe.txt\") = \"No\" ]]\n [[ $(candidate \"I563_No.exe\") = \"Yes\" ]]\n [[ $(candidate \"Is3youfault.txt\") = \"Yes\" ]]\n [[ $(candidate \"no_one#knows.dll\") = \"Yes\" ]]\n [[ $(candidate \"1I563_Yes3.exe\") = \"No\" ]]\n [[ $(candidate \"I563_Yes3.txtt\") = \"No\" ]]\n [[ $(candidate \"final..txt\") = \"No\" ]]\n [[ $(candidate \"final132\") = \"No\" ]]\n [[ $(candidate \"_f4indsartal132.\") = \"No\" ]]\n [[ $(candidate \".txt\") = \"No\" ]]\n [[ $(candidate \"s.\") = \"No\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "sh", - "prompt": "#!/bin/bash\n# You are given two intervals,\n# where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n# The given intervals are closed which means that the interval (start, end)\n# includes both start and end.\n# For each given interval, it is assumed that its start is less or equal its end.\n# Your task is to determine whether the length of intersection of these two \n# intervals is a prime number.\n# Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n# which its length is 1, which not a prime number.\n# If the length of the intersection is a prime number, return \"YES\",\n# otherwise, return \"NO\".\n# If the two intervals don't intersect, return \"NO\".\n# [input/output] samples:\n# >>> $(intersection \"1 2\" \"2 3\")\n# \"NO\"\n# >>> $(intersection \"-1 1\" \"0 4\")\n# \"NO\"\n# >>> $(intersection \"-3 -1\" \"-5 5\")\n# \"YES\"\n#\n# $1 is a space-separated list\n# $2 is a space-separated list\nintersection() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n intersection \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"1 2\" \"2 3\") = \"NO\" ]]\n [[ $(candidate \"-1 1\" \"0 4\") = \"NO\" ]]\n [[ $(candidate \"-3 -1\" \"-5 5\") = \"YES\" ]]\n [[ $(candidate \"-2 2\" \"-4 0\") = \"YES\" ]]\n [[ $(candidate \"-11 2\" \"-1 -1\") = \"NO\" ]]\n [[ $(candidate \"1 2\" \"3 5\") = \"NO\" ]]\n [[ $(candidate \"1 2\" \"1 2\") = \"NO\" ]]\n [[ $(candidate \"-2 -2\" \"-3 -2\") = \"NO\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "sh", - "prompt": "#!/bin/bash\n# Return the largest prime factor of n. Assume n > 1 and is not a prime.\n# >>> $(largest_prime_factor \"13195\")\n# \"29\"\n# >>> $(largest_prime_factor \"2048\")\n# \"2\"\n#\n# $1 is an integer\nlargest_prime_factor() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n largest_prime_factor \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"15\") = \"5\" ]]\n [[ $(candidate \"27\") = \"3\" ]]\n [[ $(candidate \"63\") = \"7\" ]]\n [[ $(candidate \"330\") = \"11\" ]]\n [[ $(candidate \"13195\") = \"29\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a string, find out how many distinct characters (regardless of case) does it consist of\n# >>> $(count_distinct_characters \"xyzXYZ\")\n# \"3\"\n# >>> $(count_distinct_characters \"Jerry\")\n# \"4\"\n#\n# $1 is a string\ncount_distinct_characters() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n count_distinct_characters \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"0\" ]]\n [[ $(candidate \"abcde\") = \"5\" ]]\n [[ $(candidate \"abcdecadeCADE\") = \"5\" ]]\n [[ $(candidate \"aaaaAAAAaaaa\") = \"1\" ]]\n [[ $(candidate \"Jerry jERRY JeRRRY\") = \"5\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "sh", - "prompt": "#!/bin/bash\n# You're given a list of deposit and withdrawal operations on a bank account that starts with\n# zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n# at that point function should return True. Otherwise it should return False.\n# >>> $(below_zero \"1 2 3\")\n# \"false\"\n# >>> $(below_zero \"1 2 -4 5\")\n# \"true\"\n#\n# $1 is a space-separated list\nbelow_zero() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n below_zero \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"false\" ]]\n [[ $(candidate \"1 2 -3 1 2 -3\") = \"false\" ]]\n [[ $(candidate \"1 2 -4 5 6\") = \"true\" ]]\n [[ $(candidate \"1 -1 2 -2 5 -5 4 -4\") = \"false\" ]]\n [[ $(candidate \"1 -1 2 -2 5 -5 4 -5\") = \"true\" ]]\n [[ $(candidate \"1 -2 2 -2 5 -5 4 -4\") = \"true\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "sh", - "prompt": "#!/bin/bash\n# Find the shortest palindrome that begins with a supplied string.\n# Algorithm idea is simple:\n# - Find the longest postfix of supplied string that is a palindrome.\n# - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n# >>> $(make_palindrome \"\")\n# \"\"\n# >>> $(make_palindrome \"cat\")\n# \"catac\"\n# >>> $(make_palindrome \"cata\")\n# \"catac\"\n#\n# $1 is a string\nmake_palindrome() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n make_palindrome \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"\") = \"\" ]]\n [[ $(candidate \"x\") = \"x\" ]]\n [[ $(candidate \"xyz\") = \"xyzyx\" ]]\n [[ $(candidate \"xyx\") = \"xyx\" ]]\n [[ $(candidate \"jerry\") = \"jerryrrej\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "sh", - "prompt": "#!/bin/bash\n# Given a positive integer, obtain its roman numeral equivalent as a string,\n# and return it in lowercase.\n# Restrictions: 1 <= num <= 1000\n# Examples:\n# >>> $(int_to_mini_roman \"19\")\n# \"xix\"\n# >>> $(int_to_mini_roman \"152\")\n# \"clii\"\n# >>> $(int_to_mini_roman \"426\")\n# \"cdxxvi\"\n#\n# $1 is an integer\nint_to_mini_roman() {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "}\n\ncandidate() {\n int_to_mini_roman \"$@\"\n}\n\nset -e\nrun_test() {\n [[ $(candidate \"19\") = \"xix\" ]]\n [[ $(candidate \"152\") = \"clii\" ]]\n [[ $(candidate \"251\") = \"ccli\" ]]\n [[ $(candidate \"426\") = \"cdxxvi\" ]]\n [[ $(candidate \"500\") = \"d\" ]]\n [[ $(candidate \"1\") = \"i\" ]]\n [[ $(candidate \"4\") = \"iv\" ]]\n [[ $(candidate \"43\") = \"xliii\" ]]\n [[ $(candidate \"90\") = \"xc\" ]]\n [[ $(candidate \"94\") = \"xciv\" ]]\n [[ $(candidate \"532\") = \"dxxxii\" ]]\n [[ $(candidate \"900\") = \"cm\" ]]\n [[ $(candidate \"994\") = \"cmxciv\" ]]\n [[ $(candidate \"1000\") = \"m\" ]]\n}\n\nrun_test", - "stop_tokens": [ - "\n}" - ] - } -] \ No newline at end of file diff --git a/data/swift-keep.json b/data/swift-keep.json deleted file mode 100644 index c7e8e36cadb75821bf3bacc9e54be9c12f230cbe..0000000000000000000000000000000000000000 --- a/data/swift-keep.json +++ /dev/null @@ -1,1934 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "swift", - "prompt": "\n/// For a given number n, find the largest number that divides n evenly, smaller than n\n/// >>> largest_divisor(15)\n/// 5\nfunc largest_divisor(n: Int) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(largest_divisor(n: 3) == 1)\nassert(largest_divisor(n: 7) == 1)\nassert(largest_divisor(n: 10) == 5)\nassert(largest_divisor(n: 100) == 50)\nassert(largest_divisor(n: 49) == 7)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_47_median", - "language": "swift", - "prompt": "\n/// Return median of elements in the list l.\n/// >>> median([3, 1, 2, 4, 5])\n/// 3\n/// >>> median([-10, 4, 6, 1000, 10, 20])\n/// 15.0\nfunc median(l: [Int]) -> Double {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(median(l: [3, 1, 2, 4, 5]) == 3)\nassert(median(l: [-10, 4, 6, 1000, 10, 20]) == 8.0)\nassert(median(l: [5]) == 5)\nassert(median(l: [6, 5]) == 5.5)\nassert(median(l: [8, 1, 3, 9, 9, 2, 7]) == 7)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "swift", - "prompt": "\n/// Given two lists operator, and operand. The first list has basic algebra operations, and \n/// the second list is a list of integers. Use the two given lists to build the algebric \n/// expression and return the evaluation of this expression.\n/// The basic algebra operations:\n/// Addition ( + ) \n/// Subtraction ( - ) \n/// Multiplication ( * ) \n/// Floor division ( // ) \n/// Exponentiation ( ** ) \n/// Example:\n/// operator['+', '*', '-']\n/// array = [2, 3, 4, 5]\n/// result = 2 + 3 * 4 - 5\n/// => result = 9\n/// Note:\n/// The length of operator list is equal to the length of operand list minus one.\n/// Operand is a list of of non-negative integers.\n/// Operator list has at least one operator, and operand list has at least two operands.\nfunc do_algebra(operator: [String], operand: [Int]) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(do_algebra(operator: [\"**\", \"*\", \"+\"], operand: [2, 3, 4, 5]) == 37)\nassert(do_algebra(operator: [\"+\", \"*\", \"-\"], operand: [2, 3, 4, 5]) == 9)\nassert(do_algebra(operator: [\"//\", \"*\"], operand: [7, 3, 4]) == 8)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "swift", - "prompt": "\n/// Return maximum element in the list.\n/// >>> max_element([1, 2, 3])\n/// 3\n/// >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n/// 123\nfunc max_element(l: [Int]) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(max_element(l: [1, 2, 3]) == 3)\nassert(max_element(l: [5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]) == 124)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "swift", - "prompt": "\n/// Create a function which returns the largest index of an element which\n/// is not greater than or equal to the element immediately preceding it. If\n/// no such element exists then return -1. The given array will not contain\n/// duplicate values.\n/// Examples:\n/// can_arrange([1,2,4,3,5]) = 3\n/// can_arrange([1,2,3]) = -1\nfunc can_arrange(arr: [Int]) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(can_arrange(arr: [1, 2, 4, 3, 5]) == 3)\nassert(can_arrange(arr: [1, 2, 4, 5]) == -1)\nassert(can_arrange(arr: [1, 4, 2, 5, 6, 7, 8, 9, 10]) == 2)\nassert(can_arrange(arr: [4, 8, 5, 7, 3]) == 4)\nassert(can_arrange(arr: [] as [Int]) == -1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "swift", - "prompt": "\n/// Imagine a road that's a perfectly straight infinitely long line.\n/// n cars are driving left to right; simultaneously, a different set of n cars\n/// are driving right to left. The two sets of cars start out being very far from\n/// each other. All cars move in the same speed. Two cars are said to collide\n/// when a car that's moving left to right hits a car that's moving right to left.\n/// However, the cars are infinitely sturdy and strong; as a result, they continue moving\n/// in their trajectory as if they did not collide.\n/// This function outputs the number of such collisions.\nfunc car_race_collision(n: Int) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(car_race_collision(n: 2) == 4)\nassert(car_race_collision(n: 3) == 9)\nassert(car_race_collision(n: 4) == 16)\nassert(car_race_collision(n: 8) == 64)\nassert(car_race_collision(n: 10) == 100)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "swift", - "prompt": "\n/// Create a function that returns True if the last character\n/// of a given string is an alphabetical character and is not\n/// a part of a word, and False otherwise.\n/// Note: \"word\" is a group of characters separated by space.\n/// Examples:\n/// check_if_last_char_is_a_letter(\"apple pie\") \u279e False\n/// check_if_last_char_is_a_letter(\"apple pi e\") \u279e True\n/// check_if_last_char_is_a_letter(\"apple pi e \") \u279e False\n/// check_if_last_char_is_a_letter(\"\") \u279e False\nfunc check_if_last_char_is_a_letter(txt: String) -> Bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(check_if_last_char_is_a_letter(txt: \"apple\") == false)\nassert(check_if_last_char_is_a_letter(txt: \"apple pi e\") == true)\nassert(check_if_last_char_is_a_letter(txt: \"eeeee\") == false)\nassert(check_if_last_char_is_a_letter(txt: \"A\") == true)\nassert(check_if_last_char_is_a_letter(txt: \"Pumpkin pie \") == false)\nassert(check_if_last_char_is_a_letter(txt: \"Pumpkin pie 1\") == false)\nassert(check_if_last_char_is_a_letter(txt: \"\") == false)\nassert(check_if_last_char_is_a_letter(txt: \"eeeee e \") == false)\nassert(check_if_last_char_is_a_letter(txt: \"apple pie\") == false)\nassert(check_if_last_char_is_a_letter(txt: \"apple pi e \") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "swift", - "prompt": "\n/// Return true if a given number is prime, and false otherwise.\n/// >>> is_prime(6)\n/// False\n/// >>> is_prime(101)\n/// True\n/// >>> is_prime(11)\n/// True\n/// >>> is_prime(13441)\n/// True\n/// >>> is_prime(61)\n/// True\n/// >>> is_prime(4)\n/// False\n/// >>> is_prime(1)\n/// False\nfunc is_prime(n: Int) -> Bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_prime(n: 6) == false)\nassert(is_prime(n: 101) == true)\nassert(is_prime(n: 11) == true)\nassert(is_prime(n: 13441) == true)\nassert(is_prime(n: 61) == true)\nassert(is_prime(n: 4) == false)\nassert(is_prime(n: 1) == false)\nassert(is_prime(n: 5) == true)\nassert(is_prime(n: 11) == true)\nassert(is_prime(n: 17) == true)\nassert(is_prime(n: 85) == false)\nassert(is_prime(n: 77) == false)\nassert(is_prime(n: 255379) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "swift", - "prompt": "\n/// Given a list of positive integers x. return a sorted list of all \n/// elements that hasn't any even digit.\n/// Note: Returned list should be sorted in increasing order.\n/// For example:\n/// >>> unique_digits([15, 33, 1422, 1])\n/// [1, 15, 33]\n/// >>> unique_digits([152, 323, 1422, 10])\n/// []\nfunc unique_digits(x: [Int]) -> [Int] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(unique_digits(x: [15, 33, 1422, 1]) == [1, 15, 33])\nassert(unique_digits(x: [152, 323, 1422, 10]) == [] as [Int])\nassert(unique_digits(x: [12345, 2033, 111, 151]) == [111, 151])\nassert(unique_digits(x: [135, 103, 31]) == [31, 135])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "swift", - "prompt": "\n/// Input are two strings a and b consisting only of 1s and 0s.\n/// Perform binary XOR on these inputs and return result also as a string.\n/// >>> string_xor('010', '110')\n/// '100'\nfunc string_xor(a: String, b: String) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(string_xor(a: \"111000\", b: \"101010\") == \"010010\")\nassert(string_xor(a: \"1\", b: \"1\") == \"0\")\nassert(string_xor(a: \"0101\", b: \"0000\") == \"0101\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "swift", - "prompt": "\n/// sum_to_n is a function that sums numbers from 1 to n.\n/// >>> sum_to_n(30)\n/// 465\n/// >>> sum_to_n(100)\n/// 5050\n/// >>> sum_to_n(5)\n/// 15\n/// >>> sum_to_n(10)\n/// 55\n/// >>> sum_to_n(1)\n/// 1\nfunc sum_to_n(n: Int) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sum_to_n(n: 1) == 1)\nassert(sum_to_n(n: 6) == 21)\nassert(sum_to_n(n: 11) == 66)\nassert(sum_to_n(n: 30) == 465)\nassert(sum_to_n(n: 100) == 5050)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "swift", - "prompt": "\n/// Given a list of numbers, return the sum of squares of the numbers\n/// in the list that are odd. Ignore numbers that are negative or not integers.\n/// double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10\n/// double_the_difference([-1, -2, 0]) == 0\n/// double_the_difference([9, -2]) == 81\n/// double_the_difference([0]) == 0 \n/// If the input list is empty, return 0.\nfunc double_the_difference(lst: [Double]) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(double_the_difference(lst: [] as [Double]) == 0)\nassert(double_the_difference(lst: [5.0, 4.0]) == 25)\nassert(double_the_difference(lst: [0.1, 0.2, 0.3]) == 0)\nassert(double_the_difference(lst: [-10.0, -20.0, -30.0]) == 0)\nassert(double_the_difference(lst: [-1.0, -2.0, 8.0]) == 0)\nassert(double_the_difference(lst: [0.2, 3.0, 5.0]) == 34)\nassert(double_the_difference(lst: [-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]) == 165)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "swift", - "prompt": "\n/// Return length of given string\n/// >>> strlen('')\n/// 0\n/// >>> strlen('abc')\n/// 3\nfunc strlen(string: String) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(strlen(string: \"\") == 0)\nassert(strlen(string: \"x\") == 1)\nassert(strlen(string: \"asdasnakj\") == 9)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "swift", - "prompt": "\n/// You'll be given a string of words, and your task is to count the number\n/// of boredoms. A boredom is a sentence that starts with the word \"I\".\n/// Sentences are delimited by '.', '?' or '!'.\n/// For example:\n/// >>> is_bored(\"Hello world\")\n/// 0\n/// >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n/// 1\nfunc is_bored(S: String) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_bored(S: \"Hello world\") == 0)\nassert(is_bored(S: \"Is the sky blue?\") == 0)\nassert(is_bored(S: \"I love It !\") == 1)\nassert(is_bored(S: \"bIt\") == 0)\nassert(is_bored(S: \"I feel good today. I will be productive. will kill It\") == 2)\nassert(is_bored(S: \"You and I are going for a walk\") == 0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "swift", - "prompt": "\n/// Write a function vowels_count which takes a string representing\n/// a word as input and returns the number of vowels in the string.\n/// Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n/// vowel, but only when it is at the end of the given word.\n/// Example:\n/// >>> vowels_count(\"abcde\")\n/// 2\n/// >>> vowels_count(\"ACEDY\")\n/// 3\nfunc vowels_count(s: String) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(vowels_count(s: \"abcde\") == 2)\nassert(vowels_count(s: \"Alone\") == 3)\nassert(vowels_count(s: \"key\") == 2)\nassert(vowels_count(s: \"bye\") == 1)\nassert(vowels_count(s: \"keY\") == 2)\nassert(vowels_count(s: \"bYe\") == 1)\nassert(vowels_count(s: \"ACEDY\") == 3)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "swift", - "prompt": "\n/// Return n-th Fibonacci number.\n/// >>> fib(10)\n/// 55\n/// >>> fib(1)\n/// 1\n/// >>> fib(8)\n/// 21\nfunc fib(n: Int) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(fib(n: 10) == 55)\nassert(fib(n: 1) == 1)\nassert(fib(n: 8) == 21)\nassert(fib(n: 11) == 89)\nassert(fib(n: 12) == 144)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "swift", - "prompt": "\n/// Your task is to implement a function that will simplify the expression\n/// x * n. The function returns True if x * n evaluates to a whole number and False\n/// otherwise. Both x and n, are string representation of a fraction, and have the following format,\n/// / where both numerator and denominator are positive whole numbers.\n/// You can assume that x, and n are valid fractions, and do not have zero as denominator.\n/// simplify(\"1/5\", \"5/1\") = True\n/// simplify(\"1/6\", \"2/1\") = False\n/// simplify(\"7/10\", \"10/2\") = False\nfunc simplify(x: String, n: String) -> Bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(simplify(x: \"1/5\", n: \"5/1\") == true)\nassert(simplify(x: \"1/6\", n: \"2/1\") == false)\nassert(simplify(x: \"5/1\", n: \"3/1\") == true)\nassert(simplify(x: \"7/10\", n: \"10/2\") == false)\nassert(simplify(x: \"2/10\", n: \"50/10\") == true)\nassert(simplify(x: \"7/2\", n: \"4/2\") == true)\nassert(simplify(x: \"11/6\", n: \"6/1\") == true)\nassert(simplify(x: \"2/3\", n: \"5/2\") == false)\nassert(simplify(x: \"5/2\", n: \"3/5\") == false)\nassert(simplify(x: \"2/4\", n: \"8/4\") == true)\nassert(simplify(x: \"2/4\", n: \"4/2\") == true)\nassert(simplify(x: \"1/5\", n: \"5/1\") == true)\nassert(simplify(x: \"1/5\", n: \"1/5\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "swift", - "prompt": "\n/// Given a string s, count the number of uppercase vowels in even indices.\n/// For example:\n/// count_upper('aBCdEf') returns 1\n/// count_upper('abcdefg') returns 0\n/// count_upper('dBBE') returns 0\nfunc count_upper(s: String) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(count_upper(s: \"aBCdEf\") == 1)\nassert(count_upper(s: \"abcdefg\") == 0)\nassert(count_upper(s: \"dBBE\") == 0)\nassert(count_upper(s: \"B\") == 0)\nassert(count_upper(s: \"U\") == 1)\nassert(count_upper(s: \"\") == 0)\nassert(count_upper(s: \"EEEE\") == 2)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "swift", - "prompt": "\n/// You are given a rectangular grid of wells. Each row represents a single well,\n/// and each 1 in a row represents a single unit of water.\n/// Each well has a corresponding bucket that can be used to extract water from it, \n/// and all buckets have the same capacity.\n/// Your task is to use the buckets to empty the wells.\n/// Output the number of times you need to lower the buckets.\n/// Example 1:\n/// Input: \n/// grid : [[0,0,1,0], [0,1,0,0], [1,1,1,1]]\n/// bucket_capacity : 1\n/// Output: 6\n/// Example 2:\n/// Input: \n/// grid : [[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]]\n/// bucket_capacity : 2\n/// Output: 5\n/// Example 3:\n/// Input: \n/// grid : [[0,0,0], [0,0,0]]\n/// bucket_capacity : 5\n/// Output: 0\n/// Constraints:\n/// * all wells have the same length\n/// * 1 <= grid.length <= 10^2\n/// * 1 <= grid[:,1].length <= 10^2\n/// * grid[i][j] -> 0 | 1\n/// * 1 <= capacity <= 10\nfunc max_fill(grid: [[Int]], capacity: Int) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(max_fill(grid: [[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], capacity: 1) == 6)\nassert(max_fill(grid: [[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], capacity: 2) == 5)\nassert(max_fill(grid: [[0, 0, 0], [0, 0, 0]], capacity: 5) == 0)\nassert(max_fill(grid: [[1, 1, 1, 1], [1, 1, 1, 1]], capacity: 2) == 4)\nassert(max_fill(grid: [[1, 1, 1, 1], [1, 1, 1, 1]], capacity: 9) == 2)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "swift", - "prompt": "\n/// Given an array arr of integers and a positive integer k, return a sorted list \n/// of length k with the maximum k numbers in arr.\n/// Example 1:\n/// Input: arr = [-3, -4, 5], k = 3\n/// Output: [-4, -3, 5]\n/// Example 2:\n/// Input: arr = [4, -4, 4], k = 2\n/// Output: [4, 4]\n/// Example 3:\n/// Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1\n/// Output: [2]\n/// Note:\n/// 1. The length of the array will be in the range of [1, 1000].\n/// 2. The elements in the array will be in the range of [-1000, 1000].\n/// 3. 0 <= k <= len(arr)\nfunc maximum(arr: [Int], k: Int) -> [Int] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(maximum(arr: [-3, -4, 5], k: 3) == [-4, -3, 5])\nassert(maximum(arr: [4, -4, 4], k: 2) == [4, 4])\nassert(maximum(arr: [-3, 2, 1, 2, -1, -2, 1], k: 1) == [2])\nassert(maximum(arr: [123, -123, 20, 0, 1, 2, -3], k: 3) == [2, 20, 123])\nassert(maximum(arr: [-123, 20, 0, 1, 2, -3], k: 4) == [0, 1, 2, 20])\nassert(maximum(arr: [5, 15, 0, 3, -13, -8, 0], k: 7) == [-13, -8, 0, 0, 3, 5, 15])\nassert(maximum(arr: [-1, 0, 2, 5, 3, -10], k: 2) == [3, 5])\nassert(maximum(arr: [1, 0, 5, -7], k: 1) == [5])\nassert(maximum(arr: [4, -4], k: 2) == [-4, 4])\nassert(maximum(arr: [-10, 10], k: 2) == [-10, 10])\nassert(maximum(arr: [1, 2, 3, -23, 243, -400, 0], k: 0) == [] as [Int])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "swift", - "prompt": "\n/// Write a function that takes a message, and encodes in such a \n/// way that it swaps case of all letters, replaces all vowels in \n/// the message with the letter that appears 2 places ahead of that \n/// vowel in the english alphabet. \n/// Assume only letters. \n/// Examples:\n/// >>> encode('test')\n/// 'TGST'\n/// >>> encode('This is a message')\n/// 'tHKS KS C MGSSCGG'\nfunc encode(message: String) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(encode(message: \"TEST\") == \"tgst\")\nassert(encode(message: \"Mudasir\") == \"mWDCSKR\")\nassert(encode(message: \"YES\") == \"ygs\")\nassert(encode(message: \"This is a message\") == \"tHKS KS C MGSSCGG\")\nassert(encode(message: \"I DoNt KnOw WhAt tO WrItE\") == \"k dQnT kNqW wHcT Tq wRkTg\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "swift", - "prompt": "\n/// remove_vowels is a function that takes string and returns string without vowels.\n/// >>> remove_vowels('')\n/// ''\n/// >>> remove_vowels('abcdef')\n/// 'bcdf'\n/// >>> remove_vowels('aaaaa')\n/// ''\n/// >>> remove_vowels('aaBAA')\n/// 'B'\n/// >>> remove_vowels('zbcd')\n/// 'zbcd'\nfunc remove_vowels(text: String) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(remove_vowels(text: \"\") == \"\")\nassert(remove_vowels(text: \"abcdef\\nghijklm\") == \"bcdf\\nghjklm\")\nassert(remove_vowels(text: \"fedcba\") == \"fdcb\")\nassert(remove_vowels(text: \"eeeee\") == \"\")\nassert(remove_vowels(text: \"acBAA\") == \"cB\")\nassert(remove_vowels(text: \"EcBOO\") == \"cB\")\nassert(remove_vowels(text: \"ybcd\") == \"ybcd\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "swift", - "prompt": "\n/// Return only positive numbers in the list.\n/// >>> get_positive([-1, 2, -4, 5, 6])\n/// [2, 5, 6]\n/// >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n/// [5, 3, 2, 3, 9, 123, 1]\nfunc get_positive(l: [Int]) -> [Int] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(get_positive(l: [-1, -2, 4, 5, 6]) == [4, 5, 6])\nassert(get_positive(l: [5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]) == [5, 3, 2, 3, 3, 9, 123, 1])\nassert(get_positive(l: [-1, -2]) == [] as [Int])\nassert(get_positive(l: [] as [Int]) == [] as [Int])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "swift", - "prompt": "\n/// Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n/// >>> string_sequence(0)\n/// '0'\n/// >>> string_sequence(5)\n/// '0 1 2 3 4 5'\nfunc string_sequence(n: Int) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(string_sequence(n: 0) == \"0\")\nassert(string_sequence(n: 3) == \"0 1 2 3\")\nassert(string_sequence(n: 10) == \"0 1 2 3 4 5 6 7 8 9 10\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "swift", - "prompt": "\n/// Given a positive integer n, you have to make a pile of n levels of stones.\n/// The first level has n stones.\n/// The number of stones in the next level is:\n/// - the next odd number if n is odd.\n/// - the next even number if n is even.\n/// Return the number of stones in each level in a list, where element at index\n/// i represents the number of stones in the level (i+1).\n/// Examples:\n/// >>> make_a_pile(3)\n/// [3, 5, 7]\nfunc make_a_pile(n: Int) -> [Int] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(make_a_pile(n: 3) == [3, 5, 7])\nassert(make_a_pile(n: 4) == [4, 6, 8, 10])\nassert(make_a_pile(n: 5) == [5, 7, 9, 11, 13])\nassert(make_a_pile(n: 6) == [6, 8, 10, 12, 14, 16])\nassert(make_a_pile(n: 8) == [8, 10, 12, 14, 16, 18, 20, 22])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "swift", - "prompt": "\n/// Task\n/// 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\n/// then check if the result string is palindrome.\n/// A string is called palindrome if it reads the same backward as forward.\n/// You should return a tuple containing the result string and True/False for the check.\n/// Example\n/// For s = \"abcde\", c = \"ae\", the result should be ('bcd',False)\n/// For s = \"abcdef\", c = \"b\" the result should be ('acdef',False)\n/// For s = \"abcdedcba\", c = \"ab\", the result should be ('cdedc',True)\nfunc reverse_delete(s: String, c: String) -> (String, Bool) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(reverse_delete(s: \"abcde\", c: \"ae\") == (\"bcd\", false))\nassert(reverse_delete(s: \"abcdef\", c: \"b\") == (\"acdef\", false))\nassert(reverse_delete(s: \"abcdedcba\", c: \"ab\") == (\"cdedc\", true))\nassert(reverse_delete(s: \"dwik\", c: \"w\") == (\"dik\", false))\nassert(reverse_delete(s: \"a\", c: \"a\") == (\"\", true))\nassert(reverse_delete(s: \"abcdedcba\", c: \"\") == (\"abcdedcba\", true))\nassert(reverse_delete(s: \"abcdedcba\", c: \"v\") == (\"abcdedcba\", true))\nassert(reverse_delete(s: \"vabba\", c: \"v\") == (\"abba\", true))\nassert(reverse_delete(s: \"mamma\", c: \"mia\") == (\"\", true))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "swift", - "prompt": "\n/// For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n/// >>> flip_case('Hello')\n/// 'hELLO'\nfunc flip_case(string: String) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(flip_case(string: \"\") == \"\")\nassert(flip_case(string: \"Hello!\") == \"hELLO!\")\nassert(flip_case(string: \"These violent delights have violent ends\") == \"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "swift", - "prompt": "\n/// You are given a string s.\n/// if s[i] is a letter, reverse its case from lower to upper or vise versa, \n/// otherwise keep it as it is.\n/// If the string contains no letters, reverse the string.\n/// The function should return the resulted string.\n/// Examples\n/// solve(\"1234\") = \"4321\"\n/// solve(\"ab\") = \"AB\"\n/// solve(\"#a@C\") = \"#A@c\"\nfunc solve(s: String) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(solve(s: \"AsDf\") == \"aSdF\")\nassert(solve(s: \"1234\") == \"4321\")\nassert(solve(s: \"ab\") == \"AB\")\nassert(solve(s: \"#a@C\") == \"#A@c\")\nassert(solve(s: \"#AsdfW^45\") == \"#aSDFw^45\")\nassert(solve(s: \"#6@2\") == \"2@6#\")\nassert(solve(s: \"#$a^D\") == \"#$A^d\")\nassert(solve(s: \"#ccc\") == \"#CCC\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "swift", - "prompt": "\n/// Filter an input list of strings only for ones that start with a given prefix.\n/// >>> filter_by_prefix([], 'a')\n/// []\n/// >>> filter_by_prefix(['abc', 'bcd', 'cde', 'array'], 'a')\n/// ['abc', 'array']\nfunc filter_by_prefix(strings: [String], prefix: String) -> [String] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(filter_by_prefix(strings: [] as [String], prefix: \"john\") == [] as [String])\nassert(filter_by_prefix(strings: [\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], prefix: \"xxx\") == [\"xxx\", \"xxxAAA\", \"xxx\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "swift", - "prompt": "\n/// This function takes two positive numbers x and y and returns the\n/// biggest even integer number that is in the range [x, y] inclusive. If \n/// there's no such number, then the function should return -1.\n/// For example:\n/// choose_num(12, 15) = 14\n/// choose_num(13, 12) = -1\nfunc choose_num(x: Int, y: Int) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(choose_num(x: 12, y: 15) == 14)\nassert(choose_num(x: 13, y: 12) == -1)\nassert(choose_num(x: 33, y: 12354) == 12354)\nassert(choose_num(x: 5234, y: 5233) == -1)\nassert(choose_num(x: 6, y: 29) == 28)\nassert(choose_num(x: 27, y: 10) == -1)\nassert(choose_num(x: 7, y: 7) == -1)\nassert(choose_num(x: 546, y: 546) == 546)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "swift", - "prompt": "\n/// You are given a string representing a sentence,\n/// the sentence contains some words separated by a space,\n/// and you have to return a string that contains the words from the original sentence,\n/// whose lengths are prime numbers,\n/// the order of the words in the new string should be the same as the original one.\n/// Example 1:\n/// Input: sentence = \"This is a test\"\n/// Output: \"is\"\n/// Example 2:\n/// Input: sentence = \"lets go for swimming\"\n/// Output: \"go for\"\n/// Constraints:\n/// * 1 <= len(sentence) <= 100\n/// * sentence contains only letters\nfunc words_in_sentence(sentence: String) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(words_in_sentence(sentence: \"This is a test\") == \"is\")\nassert(words_in_sentence(sentence: \"lets go for swimming\") == \"go for\")\nassert(words_in_sentence(sentence: \"there is no place available here\") == \"there is no place\")\nassert(words_in_sentence(sentence: \"Hi I am Hussein\") == \"Hi am Hussein\")\nassert(words_in_sentence(sentence: \"go for it\") == \"go for it\")\nassert(words_in_sentence(sentence: \"here\") == \"\")\nassert(words_in_sentence(sentence: \"here is\") == \"is\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "swift", - "prompt": "\n/// Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n/// >>> intersperse([], 4)\n/// []\n/// >>> intersperse([1, 2, 3], 4)\n/// [1, 4, 2, 4, 3]\nfunc intersperse(numbers: [Int], delimeter: Int) -> [Int] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(intersperse(numbers: [] as [Int], delimeter: 7) == [] as [Int])\nassert(intersperse(numbers: [5, 6, 3, 2], delimeter: 8) == [5, 8, 6, 8, 3, 8, 2])\nassert(intersperse(numbers: [2, 2, 2], delimeter: 2) == [2, 2, 2, 2, 2])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "swift", - "prompt": "\n/// Your task is to write a function that returns true if a number x is a simple\n/// power of n and false in other cases.\n/// x is a simple power of n if n**int=x\n/// For example:\n/// is_simple_power(1, 4) => true\n/// is_simple_power(2, 2) => true\n/// is_simple_power(8, 2) => true\n/// is_simple_power(3, 2) => false\n/// is_simple_power(3, 1) => false\n/// is_simple_power(5, 3) => false\nfunc is_simple_power(x: Int, n: Int) -> Bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_simple_power(x: 16, n: 2) == true)\nassert(is_simple_power(x: 143214, n: 16) == false)\nassert(is_simple_power(x: 4, n: 2) == true)\nassert(is_simple_power(x: 9, n: 3) == true)\nassert(is_simple_power(x: 16, n: 4) == true)\nassert(is_simple_power(x: 24, n: 2) == false)\nassert(is_simple_power(x: 128, n: 4) == false)\nassert(is_simple_power(x: 12, n: 6) == false)\nassert(is_simple_power(x: 1, n: 1) == true)\nassert(is_simple_power(x: 1, n: 12) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "swift", - "prompt": "\n/// Write a function that returns true if the given number is the multiplication of 3 prime numbers\n/// and false otherwise.\n/// Knowing that (a) is less then 100. \n/// Example:\n/// is_multiply_prime(30) == True\n/// 30 = 2 * 3 * 5\nfunc is_multiply_prime(a: Int) -> Bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_multiply_prime(a: 5) == false)\nassert(is_multiply_prime(a: 30) == true)\nassert(is_multiply_prime(a: 8) == true)\nassert(is_multiply_prime(a: 10) == false)\nassert(is_multiply_prime(a: 125) == true)\nassert(is_multiply_prime(a: 105) == true)\nassert(is_multiply_prime(a: 126) == false)\nassert(is_multiply_prime(a: 729) == false)\nassert(is_multiply_prime(a: 891) == false)\nassert(is_multiply_prime(a: 1001) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "swift", - "prompt": "\n/// Given the lengths of the three sides of a triangle. Return True if the three\n/// sides form a right-angled triangle, False otherwise.\n/// A right-angled triangle is a triangle in which one angle is right angle or \n/// 90 degree.\n/// Example:\n/// right_angle_triangle(3, 4, 5) == True\n/// right_angle_triangle(1, 2, 3) == False\nfunc right_angle_triangle(a: Int, b: Int, c: Int) -> Bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(right_angle_triangle(a: 3, b: 4, c: 5) == true)\nassert(right_angle_triangle(a: 1, b: 2, c: 3) == false)\nassert(right_angle_triangle(a: 10, b: 6, c: 8) == true)\nassert(right_angle_triangle(a: 2, b: 2, c: 2) == false)\nassert(right_angle_triangle(a: 7, b: 24, c: 25) == true)\nassert(right_angle_triangle(a: 10, b: 5, c: 7) == false)\nassert(right_angle_triangle(a: 5, b: 12, c: 13) == true)\nassert(right_angle_triangle(a: 15, b: 8, c: 17) == true)\nassert(right_angle_triangle(a: 48, b: 55, c: 73) == true)\nassert(right_angle_triangle(a: 1, b: 1, c: 1) == false)\nassert(right_angle_triangle(a: 2, b: 2, c: 10) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "swift", - "prompt": "\n/// Create a function that takes 3 numbers.\n/// Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n/// Returns false in any other cases.\n/// Examples\n/// any_int(5, 2, 7) \u279e True\n/// any_int(3, 2, 2) \u279e False\n/// any_int(3, -2, 1) \u279e True\n/// any_int(3.6, -2.2, 2) \u279e False\nfunc any_int(x: Double, y: Double, z: Double) -> Bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(any_int(x: 2, y: 3, z: 1) == true)\nassert(any_int(x: 2.5, y: 2, z: 3) == false)\nassert(any_int(x: 1.5, y: 5, z: 3.5) == false)\nassert(any_int(x: 2, y: 6, z: 2) == false)\nassert(any_int(x: 4, y: 2, z: 2) == true)\nassert(any_int(x: 2.2, y: 2.2, z: 2.2) == false)\nassert(any_int(x: -4, y: 6, z: 2) == true)\nassert(any_int(x: 2, y: 1, z: 1) == true)\nassert(any_int(x: 3, y: 4, z: 7) == true)\nassert(any_int(x: 3.0, y: 4, z: 7) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "swift", - "prompt": "\n/// This function takes a list l and returns a list l' such that\n/// l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n/// to the values of the corresponding indicies of l, but sorted.\n/// >>> sort_third([1, 2, 3])\n/// [1, 2, 3]\n/// >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n/// [2, 6, 3, 4, 8, 9, 5]\nfunc sort_third(l: [Int]) -> [Int] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sort_third(l: [5, 6, 3, 4, 8, 9, 2]) == [2, 6, 3, 4, 8, 9, 5])\nassert(sort_third(l: [5, 8, 3, 4, 6, 9, 2]) == [2, 8, 3, 4, 6, 9, 5])\nassert(sort_third(l: [5, 6, 9, 4, 8, 3, 2]) == [2, 6, 9, 4, 8, 3, 5])\nassert(sort_third(l: [5, 6, 3, 4, 8, 9, 2, 1]) == [2, 6, 3, 4, 8, 9, 5, 1])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_53_add", - "language": "swift", - "prompt": "\n/// Add two numbers x and y\n/// >>> add(2, 3)\n/// 5\n/// >>> add(5, 7)\n/// 12\nfunc add(x: Int, y: Int) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(add(x: 0, y: 1) == 1)\nassert(add(x: 1, y: 0) == 1)\nassert(add(x: 2, y: 3) == 5)\nassert(add(x: 5, y: 7) == 12)\nassert(add(x: 7, y: 5) == 12)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_69_search", - "language": "swift", - "prompt": "\n/// You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n/// zero, and has a frequency greater than or equal to the value of the integer itself. \n/// The frequency of an integer is the number of times it appears in the list.\n/// If no such a value exist, return -1.\n/// Examples:\n/// search([4, 1, 2, 2, 3, 1]) == 2\n/// search([1, 2, 2, 3, 3, 3, 4, 4, 4]) == 3\n/// search([5, 5, 4, 4, 4]) == -1\nfunc search(lst: [Int]) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(search(lst: [5, 5, 5, 5, 1]) == 1)\nassert(search(lst: [4, 1, 4, 1, 4, 4]) == 4)\nassert(search(lst: [3, 3]) == -1)\nassert(search(lst: [8, 8, 8, 8, 8, 8, 8, 8]) == 8)\nassert(search(lst: [2, 3, 3, 2, 2]) == 2)\nassert(search(lst: [2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]) == 1)\nassert(search(lst: [3, 2, 8, 2]) == 2)\nassert(search(lst: [6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]) == 1)\nassert(search(lst: [8, 8, 3, 6, 5, 6, 4]) == -1)\nassert(search(lst: [6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]) == 1)\nassert(search(lst: [1, 9, 10, 1, 3]) == 1)\nassert(search(lst: [6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]) == 5)\nassert(search(lst: [1]) == 1)\nassert(search(lst: [8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]) == 4)\nassert(search(lst: [2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]) == 2)\nassert(search(lst: [1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]) == 1)\nassert(search(lst: [9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]) == 4)\nassert(search(lst: [2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]) == 4)\nassert(search(lst: [9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]) == 2)\nassert(search(lst: [5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]) == -1)\nassert(search(lst: [10]) == -1)\nassert(search(lst: [9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]) == 2)\nassert(search(lst: [5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]) == 1)\nassert(search(lst: [7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]) == 1)\nassert(search(lst: [3, 10, 10, 9, 2]) == -1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "swift", - "prompt": "\n/// Write a function that takes a string and returns True if the string\n/// length is a prime number or False otherwise\n/// Examples\n/// prime_length('Hello') == True\n/// prime_length('abcdcba') == True\n/// prime_length('kittens') == True\n/// prime_length('orange') == False\nfunc prime_length(string: String) -> Bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(prime_length(string: \"Hello\") == true)\nassert(prime_length(string: \"abcdcba\") == true)\nassert(prime_length(string: \"kittens\") == true)\nassert(prime_length(string: \"orange\") == false)\nassert(prime_length(string: \"wow\") == true)\nassert(prime_length(string: \"world\") == true)\nassert(prime_length(string: \"MadaM\") == true)\nassert(prime_length(string: \"Wow\") == true)\nassert(prime_length(string: \"\") == false)\nassert(prime_length(string: \"HI\") == true)\nassert(prime_length(string: \"go\") == true)\nassert(prime_length(string: \"gogo\") == false)\nassert(prime_length(string: \"aaaaaaaaaaaaaaa\") == false)\nassert(prime_length(string: \"Madam\") == true)\nassert(prime_length(string: \"M\") == false)\nassert(prime_length(string: \"0\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_58_common", - "language": "swift", - "prompt": "\n/// Return sorted unique common elements for two lists.\n/// >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n/// [1, 5, 653]\n/// >>> common([5, 3, 2, 8], [3, 2])\n/// [2, 3]\nfunc common(l1: [Int], l2: [Int]) -> [Int] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(common(l1: [1, 4, 3, 34, 653, 2, 5], l2: [5, 7, 1, 5, 9, 653, 121]) == [1, 5, 653])\nassert(common(l1: [5, 3, 2, 8], l2: [3, 2]) == [2, 3])\nassert(common(l1: [4, 3, 2, 8], l2: [3, 2, 4]) == [2, 3, 4])\nassert(common(l1: [4, 3, 2, 8], l2: [] as [Int]) == [] as [Int])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "swift", - "prompt": "\n/// The Brazilian factorial is defined as:\n/// brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n/// where n > 0\n/// For example:\n/// >>> special_factorial(4)\n/// 288\n/// The function will receive an integer as input and should return the special\n/// factorial of this integer.\nfunc special_factorial(n: Int) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(special_factorial(n: 4) == 288)\nassert(special_factorial(n: 5) == 34560)\nassert(special_factorial(n: 7) == 125411328000)\nassert(special_factorial(n: 1) == 1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "swift", - "prompt": "\n/// In this problem, you will implement a function that takes two lists of numbers,\n/// and determines whether it is possible to perform an exchange of elements\n/// between them to make lst1 a list of only even numbers.\n/// There is no limit on the number of exchanged elements between lst1 and lst2.\n/// If it is possible to exchange elements between the lst1 and lst2 to make\n/// all the elements of lst1 to be even, return \"YES\".\n/// Otherwise, return \"NO\".\n/// For example:\n/// exchange([1, 2, 3, 4], [1, 2, 3, 4]) => \"YES\"\n/// exchange([1, 2, 3, 4], [1, 5, 3, 4]) => \"NO\"\n/// It is assumed that the input lists will be non-empty.\nfunc exchange(lst1: [Int], lst2: [Int]) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(exchange(lst1: [1, 2, 3, 4], lst2: [1, 2, 3, 4]) == \"YES\")\nassert(exchange(lst1: [1, 2, 3, 4], lst2: [1, 5, 3, 4]) == \"NO\")\nassert(exchange(lst1: [1, 2, 3, 4], lst2: [2, 1, 4, 3]) == \"YES\")\nassert(exchange(lst1: [5, 7, 3], lst2: [2, 6, 4]) == \"YES\")\nassert(exchange(lst1: [5, 7, 3], lst2: [2, 6, 3]) == \"NO\")\nassert(exchange(lst1: [3, 2, 6, 1, 8, 9], lst2: [3, 5, 5, 1, 1, 1]) == \"NO\")\nassert(exchange(lst1: [100, 200], lst2: [200, 200]) == \"YES\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "swift", - "prompt": "\n/// Given a non-empty array of integers arr and an integer k, return\n/// the sum of the elements with at most two digits from the first k elements of arr.\n/// Example:\n/// Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4\n/// Output: 24 # sum of 21 + 3\n/// Constraints:\n/// 1. 1 <= len(arr) <= 100\n/// 2. 1 <= k <= len(arr)\nfunc add_elements(arr: [Int], k: Int) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(add_elements(arr: [1, -2, -3, 41, 57, 76, 87, 88, 99], k: 3) == -4)\nassert(add_elements(arr: [111, 121, 3, 4000, 5, 6], k: 2) == 0)\nassert(add_elements(arr: [11, 21, 3, 90, 5, 6, 7, 8, 9], k: 4) == 125)\nassert(add_elements(arr: [111, 21, 3, 4000, 5, 6, 7, 8, 9], k: 4) == 24)\nassert(add_elements(arr: [1], k: 1) == 1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "swift", - "prompt": "\n/// A simple program which should return the value of x if n is \n/// a prime number and should return the value of y otherwise.\n/// Examples:\n/// for x_or_y(7, 34, 12) == 34\n/// for x_or_y(15, 8, 5) == 5\nfunc x_or_y(n: Int, x: Int, y: Int) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(x_or_y(n: 7, x: 34, y: 12) == 34)\nassert(x_or_y(n: 15, x: 8, y: 5) == 5)\nassert(x_or_y(n: 3, x: 33, y: 5212) == 33)\nassert(x_or_y(n: 1259, x: 3, y: 52) == 3)\nassert(x_or_y(n: 7919, x: -1, y: 12) == -1)\nassert(x_or_y(n: 3609, x: 1245, y: 583) == 583)\nassert(x_or_y(n: 91, x: 56, y: 129) == 129)\nassert(x_or_y(n: 6, x: 34, y: 1234) == 1234)\nassert(x_or_y(n: 1, x: 2, y: 0) == 0)\nassert(x_or_y(n: 2, x: 2, y: 0) == 2)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "swift", - "prompt": "\n/// Given length of a side and high return area for a triangle.\n/// >>> triangle_area(5, 3)\n/// 7.5\nfunc triangle_area(a: Int, h: Int) -> Double {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(triangle_area(a: 5, h: 3) == 7.5)\nassert(triangle_area(a: 2, h: 2) == 2.0)\nassert(triangle_area(a: 10, h: 8) == 40.0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "swift", - "prompt": "\n/// Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n/// the last couple centuries. However, what people don't know is Tribonacci sequence.\n/// Tribonacci sequence is defined by the recurrence:\n/// tri(1) = 3\n/// tri(n) = 1 + n / 2, if n is even.\n/// tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n/// For example:\n/// tri(2) = 1 + (2 / 2) = 2\n/// tri(4) = 3\n/// tri(3) = tri(2) + tri(1) + tri(4)\n/// = 2 + 3 + 3 = 8 \n/// You are given a non-negative integer number n, you have to a return a list of the \n/// first n + 1 numbers of the Tribonacci sequence.\n/// Examples:\n/// tri(3) = [1, 3, 2, 8]\nfunc tri(n: Int) -> [Int] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(tri(n: 3) == [1, 3, 2, 8])\nassert(tri(n: 4) == [1, 3, 2, 8, 3])\nassert(tri(n: 5) == [1, 3, 2, 8, 3, 15])\nassert(tri(n: 6) == [1, 3, 2, 8, 3, 15, 4])\nassert(tri(n: 7) == [1, 3, 2, 8, 3, 15, 4, 24])\nassert(tri(n: 8) == [1, 3, 2, 8, 3, 15, 4, 24, 5])\nassert(tri(n: 9) == [1, 3, 2, 8, 3, 15, 4, 24, 5, 35])\nassert(tri(n: 20) == [1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11])\nassert(tri(n: 0) == [1])\nassert(tri(n: 1) == [1, 3])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "swift", - "prompt": "\n/// You are given a list of two strings, both strings consist of open\n/// parentheses '(' or close parentheses ')' only.\n/// Your job is to check if it is possible to concatenate the two strings in\n/// some order, that the resulting string will be good.\n/// A string S is considered to be good if and only if all parentheses in S\n/// are balanced. For example: the string '(())()' is good, while the string\n/// '())' is not.\n/// Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n/// Examples:\n/// match_parens(['()(', ')']) == 'Yes'\n/// match_parens([')', ')']) == 'No'\nfunc match_parens(lst: [String]) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(match_parens(lst: [\"()(\", \")\"]) == \"Yes\")\nassert(match_parens(lst: [\")\", \")\"]) == \"No\")\nassert(match_parens(lst: [\"(()(())\", \"())())\"]) == \"No\")\nassert(match_parens(lst: [\")())\", \"(()()(\"]) == \"Yes\")\nassert(match_parens(lst: [\"(())))\", \"(()())((\"]) == \"Yes\")\nassert(match_parens(lst: [\"()\", \"())\"]) == \"No\")\nassert(match_parens(lst: [\"(()(\", \"()))()\"]) == \"Yes\")\nassert(match_parens(lst: [\"((((\", \"((())\"]) == \"No\")\nassert(match_parens(lst: [\")(()\", \"(()(\"]) == \"No\")\nassert(match_parens(lst: [\")(\", \")(\"]) == \"No\")\nassert(match_parens(lst: [\"(\", \")\"]) == \"Yes\")\nassert(match_parens(lst: [\")\", \"(\"]) == \"Yes\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "swift", - "prompt": "\n/// From a list of integers, remove all elements that occur more than once.\n/// Keep order of elements left the same as in the input.\n/// >>> remove_duplicates([1, 2, 3, 2, 4])\n/// [1, 3, 4]\nfunc remove_duplicates(numbers: [Int]) -> [Int] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(remove_duplicates(numbers: [] as [Int]) == [] as [Int])\nassert(remove_duplicates(numbers: [1, 2, 3, 4]) == [1, 2, 3, 4])\nassert(remove_duplicates(numbers: [1, 2, 3, 2, 4, 3, 5]) == [1, 4, 5])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "swift", - "prompt": "\n/// Return a greatest common divisor of two integers a and b\n/// >>> greatest_common_divisor(3, 5)\n/// 1\n/// >>> greatest_common_divisor(25, 15)\n/// 5\nfunc greatest_common_divisor(a: Int, b: Int) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(greatest_common_divisor(a: 3, b: 7) == 1)\nassert(greatest_common_divisor(a: 10, b: 15) == 5)\nassert(greatest_common_divisor(a: 49, b: 14) == 7)\nassert(greatest_common_divisor(a: 144, b: 60) == 12)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "swift", - "prompt": "\n/// Checks if given string is a palindrome\n/// >>> is_palindrome('')\n/// True\n/// >>> is_palindrome('aba')\n/// True\n/// >>> is_palindrome('aaaaa')\n/// True\n/// >>> is_palindrome('zbcd')\n/// False\nfunc is_palindrome(text: String) -> Bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_palindrome(text: \"\") == true)\nassert(is_palindrome(text: \"aba\") == true)\nassert(is_palindrome(text: \"aaaaa\") == true)\nassert(is_palindrome(text: \"zbcd\") == false)\nassert(is_palindrome(text: \"xywyx\") == true)\nassert(is_palindrome(text: \"xywyz\") == false)\nassert(is_palindrome(text: \"xywzx\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "swift", - "prompt": "\n/// xs represent coefficients of a polynomial.\n/// xs[0] + xs[1] * x + xs[2] * x^2 + ....\n/// Return derivative of this polynomial in the same form.\n/// >>> derivative([3, 1, 2, 4, 5])\n/// [1, 4, 12, 20]\n/// >>> derivative([1, 2, 3])\n/// [2, 6]\nfunc derivative(xs: [Int]) -> [Int] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(derivative(xs: [3, 1, 2, 4, 5]) == [1, 4, 12, 20])\nassert(derivative(xs: [1, 2, 3]) == [2, 6])\nassert(derivative(xs: [3, 2, 1]) == [2, 2])\nassert(derivative(xs: [3, 2, 1, 0, 4]) == [2, 2, 0, 16])\nassert(derivative(xs: [1]) == [] as [Int])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "swift", - "prompt": "\n/// In this task, you will be given a string that represents a number of apples and oranges \n/// that are distributed in a basket of fruit this basket contains \n/// apples, oranges, and mango fruits. Given the string that represents the total number of \n/// the oranges and apples and an integer that represent the total number of the fruits \n/// in the basket return the number of the mango fruits in the basket.\n/// for examble:\n/// fruit_distribution(\"5 apples and 6 oranges\", 19) ->19 - 5 - 6 = 8\n/// fruit_distribution(\"0 apples and 1 oranges\",3) -> 3 - 0 - 1 = 2\n/// fruit_distribution(\"2 apples and 3 oranges\", 100) -> 100 - 2 - 3 = 95\n/// fruit_distribution(\"100 apples and 1 oranges\",120) -> 120 - 100 - 1 = 19\nfunc fruit_distribution(s: String, n: Int) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(fruit_distribution(s: \"5 apples and 6 oranges\", n: 19) == 8)\nassert(fruit_distribution(s: \"5 apples and 6 oranges\", n: 21) == 10)\nassert(fruit_distribution(s: \"0 apples and 1 oranges\", n: 3) == 2)\nassert(fruit_distribution(s: \"1 apples and 0 oranges\", n: 3) == 2)\nassert(fruit_distribution(s: \"2 apples and 3 oranges\", n: 100) == 95)\nassert(fruit_distribution(s: \"2 apples and 3 oranges\", n: 5) == 0)\nassert(fruit_distribution(s: \"1 apples and 100 oranges\", n: 120) == 19)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "swift", - "prompt": "\n/// Write a function that takes an integer a and returns True \n/// if this ingeger is a cube of some integer number.\n/// Note: you may assume the input is always valid.\n/// Examples:\n/// iscube(1) ==> True\n/// iscube(2) ==> False\n/// iscube(-1) ==> True\n/// iscube(64) ==> True\n/// iscube(0) ==> True\n/// iscube(180) ==> False\nfunc iscube(a: Int) -> Bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(iscube(a: 1) == true)\nassert(iscube(a: 2) == false)\nassert(iscube(a: -1) == true)\nassert(iscube(a: 64) == true)\nassert(iscube(a: 180) == false)\nassert(iscube(a: 1000) == true)\nassert(iscube(a: 0) == true)\nassert(iscube(a: 1729) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "swift", - "prompt": "\n/// In this Kata, you have to sort an array of non-negative integers according to\n/// number of ones in their binary representation in ascending order.\n/// For similar number of ones, sort based on decimal value.\n/// It must be implemented like this:\n/// >>> sort_array([1, 5, 2, 3, 4]) == [1, 2, 3, 4, 5]\n/// >>> sort_array([-2, -3, -4, -5, -6]) == [-6, -5, -4, -3, -2]\n/// >>> sort_array([1, 0, 2, 3, 4]) [0, 1, 2, 3, 4]\nfunc sort_array(arr: [Int]) -> [Int] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sort_array(arr: [1, 5, 2, 3, 4]) == [1, 2, 4, 3, 5])\nassert(sort_array(arr: [-2, -3, -4, -5, -6]) == [-4, -2, -6, -5, -3])\nassert(sort_array(arr: [1, 0, 2, 3, 4]) == [0, 1, 2, 4, 3])\nassert(sort_array(arr: [] as [Int]) == [] as [Int])\nassert(sort_array(arr: [2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]) == [2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77])\nassert(sort_array(arr: [3, 6, 44, 12, 32, 5]) == [32, 3, 5, 6, 12, 44])\nassert(sort_array(arr: [2, 4, 8, 16, 32]) == [2, 4, 8, 16, 32])\nassert(sort_array(arr: [2, 4, 8, 16, 32]) == [2, 4, 8, 16, 32])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "swift", - "prompt": "\n/// Given a list of strings, where each string consists of only digits, return a list.\n/// Each element i of the output should be \"the number of odd elements in the\n/// string i of the input.\" where all the i's should be replaced by the number\n/// of odd digits in the i'th string of the input.\n/// >>> odd_count(['1234567'])\n/// [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n/// >>> odd_count(['3',\"11111111\"])\n/// [\"the number of odd elements 1n the str1ng 1 of the 1nput.\",\n/// \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\nfunc odd_count(lst: [String]) -> [String] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(odd_count(lst: [\"1234567\"]) == [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"])\nassert(odd_count(lst: [\"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.\"])\nassert(odd_count(lst: [\"271\", \"137\", \"314\"]) == [\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "swift", - "prompt": "\n/// brackets is a string of \"(\" and \")\".\n/// return True if every opening bracket has a corresponding closing bracket.\n/// >>> correct_bracketing(\"(\")\n/// False\n/// >>> correct_bracketing(\"()\")\n/// True\n/// >>> correct_bracketing(\"(()())\")\n/// True\n/// >>> correct_bracketing(\")(()\")\n/// False\nfunc correct_bracketing(brackets: String) -> Bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(correct_bracketing(brackets: \"()\") == true)\nassert(correct_bracketing(brackets: \"(()())\") == true)\nassert(correct_bracketing(brackets: \"()()(()())()\") == true)\nassert(correct_bracketing(brackets: \"()()((()()())())(()()(()))\") == true)\nassert(correct_bracketing(brackets: \"((()())))\") == false)\nassert(correct_bracketing(brackets: \")(()\") == false)\nassert(correct_bracketing(brackets: \"(\") == false)\nassert(correct_bracketing(brackets: \"((((\") == false)\nassert(correct_bracketing(brackets: \")\") == false)\nassert(correct_bracketing(brackets: \"(()\") == false)\nassert(correct_bracketing(brackets: \"()()(()())())(()\") == false)\nassert(correct_bracketing(brackets: \"()()(()())()))()\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "swift", - "prompt": "\n/// Task\n/// Write a function that takes a string as input and returns the sum of the upper characters only'\n/// ASCII codes.\n/// Examples:\n/// digitSum(\"\") => 0\n/// digitSum(\"abAB\") => 131\n/// digitSum(\"abcCd\") => 67\n/// digitSum(\"helloE\") => 69\n/// digitSum(\"woArBld\") => 131\n/// digitSum(\"aAaaaXa\") => 153\nfunc digitSum(s: String) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(digitSum(s: \"\") == 0)\nassert(digitSum(s: \"abAB\") == 131)\nassert(digitSum(s: \"abcCd\") == 67)\nassert(digitSum(s: \"helloE\") == 69)\nassert(digitSum(s: \"woArBld\") == 131)\nassert(digitSum(s: \"aAaaaXa\") == 153)\nassert(digitSum(s: \" How are yOu?\") == 151)\nassert(digitSum(s: \"You arE Very Smart\") == 327)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "swift", - "prompt": "\n/// Write a function that accepts a list of strings as a parameter,\n/// deletes the strings that have odd lengths from it,\n/// and returns the resulted list with a sorted order,\n/// The list is always a list of strings and never an array of numbers,\n/// and it may contain duplicates.\n/// The order of the list should be ascending by length of each word, and you\n/// should return the list sorted by that rule.\n/// If two words have the same length, sort the list alphabetically.\n/// The function should return a list of strings in sorted order.\n/// You may assume that all words will have the same length.\n/// For example:\n/// assert list_sort([\"aa\", \"a\", \"aaa\"]) => [\"aa\"]\n/// assert list_sort([\"ab\", \"a\", \"aaa\", \"cd\"]) => [\"ab\", \"cd\"]\nfunc sorted_list_sum(lst: [String]) -> [String] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sorted_list_sum(lst: [\"aa\", \"a\", \"aaa\"]) == [\"aa\"])\nassert(sorted_list_sum(lst: [\"school\", \"AI\", \"asdf\", \"b\"]) == [\"AI\", \"asdf\", \"school\"])\nassert(sorted_list_sum(lst: [\"d\", \"b\", \"c\", \"a\"]) == [] as [String])\nassert(sorted_list_sum(lst: [\"d\", \"dcba\", \"abcd\", \"a\"]) == [\"abcd\", \"dcba\"])\nassert(sorted_list_sum(lst: [\"AI\", \"ai\", \"au\"]) == [\"AI\", \"ai\", \"au\"])\nassert(sorted_list_sum(lst: [\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"]) == [] as [String])\nassert(sorted_list_sum(lst: [\"aaaa\", \"bbbb\", \"dd\", \"cc\"]) == [\"cc\", \"dd\", \"aaaa\", \"bbbb\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "swift", - "prompt": "\n/// You are given an array arr of integers and you need to return\n/// sum of magnitudes of integers multiplied by product of all signs\n/// of each number in the array, represented by 1, -1 or 0.\n/// Note: return None for empty arr.\n/// Example:\n/// >>> prod_signs([1, 2, 2, -4]) == -9\n/// >>> prod_signs([0, 1]) == 0\n/// >>> prod_signs([]) == None\nfunc prod_signs(arr: [Int]) -> Int? {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(prod_signs(arr: [1, 2, 2, -4]) == -9)\nassert(prod_signs(arr: [0, 1]) == 0)\nassert(prod_signs(arr: [1, 1, 1, 2, 3, -1, 1]) == -10)\nassert(prod_signs(arr: [] as [Int]) == nil)\nassert(prod_signs(arr: [2, 4, 1, 2, -1, -1, 9]) == 20)\nassert(prod_signs(arr: [-1, 1, -1, 1]) == 4)\nassert(prod_signs(arr: [-1, 1, 1, 1]) == -4)\nassert(prod_signs(arr: [-1, 1, 1, 0]) == 0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "swift", - "prompt": "\n/// Return list with elements incremented by 1.\n/// >>> incr_list([1, 2, 3])\n/// [2, 3, 4]\n/// >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123])\n/// [6, 4, 6, 3, 4, 4, 10, 1, 124]\nfunc incr_list(l: [Int]) -> [Int] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(incr_list(l: [] as [Int]) == [] as [Int])\nassert(incr_list(l: [3, 2, 1]) == [4, 3, 2])\nassert(incr_list(l: [5, 2, 5, 2, 3, 3, 9, 0, 123]) == [6, 3, 6, 3, 4, 4, 10, 1, 124])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "swift", - "prompt": "\n/// From a given list of integers, generate a list of rolling maximum element found until given moment\n/// in the sequence.\n/// >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n/// [1, 2, 3, 3, 3, 4, 4]\nfunc rolling_max(numbers: [Int]) -> [Int] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(rolling_max(numbers: [] as [Int]) == [] as [Int])\nassert(rolling_max(numbers: [1, 2, 3, 4]) == [1, 2, 3, 4])\nassert(rolling_max(numbers: [4, 3, 2, 1]) == [4, 4, 4, 4])\nassert(rolling_max(numbers: [3, 2, 3, 100, 3]) == [3, 3, 3, 100, 100])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "swift", - "prompt": "\n/// Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n/// separate those group into separate strings and return the list of those.\n/// Separate groups are balanced (each open brace is properly closed) and not nested within each other\n/// Ignore any spaces in the input string.\n/// >>> separate_paren_groups('( ) (( )) (( )( ))')\n/// ['()', '(())', '(()())']\nfunc separate_paren_groups(paren_string: String) -> [String] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(separate_paren_groups(paren_string: \"(()()) ((())) () ((())()())\") == [\"(()())\", \"((()))\", \"()\", \"((())()())\"])\nassert(separate_paren_groups(paren_string: \"() (()) ((())) (((())))\") == [\"()\", \"(())\", \"((()))\", \"(((())))\"])\nassert(separate_paren_groups(paren_string: \"(()(())((())))\") == [\"(()(())((())))\"])\nassert(separate_paren_groups(paren_string: \"( ) (( )) (( )( ))\") == [\"()\", \"(())\", \"(()())\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "swift", - "prompt": "\n/// You will be given a string of words separated by commas or spaces. Your task is\n/// to split the string into words and return an array of the words.\n/// For example:\n/// words_string(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n/// words_string(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\nfunc words_string(s: String) -> [String] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(words_string(s: \"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"])\nassert(words_string(s: \"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"])\nassert(words_string(s: \"Hi, my name\") == [\"Hi\", \"my\", \"name\"])\nassert(words_string(s: \"One,, two, three, four, five, six,\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"])\nassert(words_string(s: \"\") == [] as [String])\nassert(words_string(s: \"ahmed , gamal\") == [\"ahmed\", \"gamal\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "swift", - "prompt": "\nenum Value: Equatable, Hashable {\n case intValue(Int)\n case doubleValue(Double)\n case stringValue(String)\n}\n\n \n/// Create a function that takes integers, floats, or strings representing\n/// real numbers, and returns the larger variable in its given variable type.\n/// Return None if the values are equal.\n/// Note: If a real number is represented as a string, the floating point might be . or ,\n/// compare_one(1, 2.5) \u279e 2.5\n/// compare_one(1, \"2,3\") \u279e \"2,3\"\n/// compare_one(\"5,1\", \"6\") \u279e \"6\"\n/// compare_one(\"1\", 1) \u279e None\nfunc compare_one(a: Value, b: Value) -> Value? {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_137_compare_one.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(compare_one(a: .intValue(1), b: .intValue(2)) == .intValue(2))\nassert(compare_one(a: .intValue(1), b: .doubleValue(2.5)) == .doubleValue(2.5))\nassert(compare_one(a: .intValue(2), b: .intValue(3)) == .intValue(3))\nassert(compare_one(a: .intValue(5), b: .intValue(6)) == .intValue(6))\nassert(compare_one(a: .intValue(1), b: .stringValue(\"2,3\")) == .stringValue(\"2,3\"))\nassert(compare_one(a: .stringValue(\"5,1\"), b: .stringValue(\"6\")) == .stringValue(\"6\"))\nassert(compare_one(a: .stringValue(\"1\"), b: .stringValue(\"2\")) == .stringValue(\"2\"))\nassert(compare_one(a: .stringValue(\"1\"), b: .intValue(1)) == nil)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "swift", - "prompt": "\n/// Filter given list of any python values only for integers\n/// >>> filter_integers(['a', 3.14, 5])\n/// [5]\n/// >>> filter_integers([1, 2, 3, 'abc', {}, []])\n/// [1, 2, 3]\nfunc filter_integers(values: [AnyHashable]) -> [Int] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(filter_integers(values: [] as [AnyHashable]) == [] as [Int])\nassert(filter_integers(values: [4, [:] as [AnyHashable : AnyHashable], [] as [AnyHashable], 23.2, 9, \"adasd\"]) == [4, 9])\nassert(filter_integers(values: [3, \"c\", 3, 3, \"a\", \"b\"]) == [3, 3, 3])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "swift", - "prompt": "\n/// This function takes a list l and returns a list l' such that\n/// l' is identical to l in the odd indicies, while its values at the even indicies are equal\n/// to the values of the even indicies of l, but sorted.\n/// >>> sort_even([1, 2, 3])\n/// [1, 2, 3]\n/// >>> sort_even([5, 6, 3, 4])\n/// [3, 6, 5, 4]\nfunc sort_even(l: [Int]) -> [Int] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sort_even(l: [1, 2, 3]) == [1, 2, 3])\nassert(sort_even(l: [5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]) == [-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123])\nassert(sort_even(l: [5, 8, -12, 4, 23, 2, 3, 11, 12, -10]) == [-12, 8, 3, 4, 5, 2, 12, 11, 23, -10])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "swift", - "prompt": "\n/// I think we all remember that feeling when the result of some long-awaited\n/// event is finally known. The feelings and thoughts you have at that moment are\n/// definitely worth noting down and comparing.\n/// Your task is to determine if a person correctly guessed the results of a number of matches.\n/// You are given two arrays of scores and guesses of equal length, where each index shows a match. \n/// Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n/// the value is 0, and if not, the value is the absolute difference between the guess and the score.\n/// example:\n/// compare([1,2,3,4,5,1],[1,2,3,4,2,-2]) -> [0,0,0,0,3,3]\n/// compare([0,5,0,0,0,4],[4,1,1,0,0,-2]) -> [4,4,1,0,0,6]\nfunc compare(game: [Int], guess: [Int]) -> [Int] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(compare(game: [1, 2, 3, 4, 5, 1], guess: [1, 2, 3, 4, 2, -2]) == [0, 0, 0, 0, 3, 3])\nassert(compare(game: [0, 0, 0, 0, 0, 0], guess: [0, 0, 0, 0, 0, 0]) == [0, 0, 0, 0, 0, 0])\nassert(compare(game: [1, 2, 3], guess: [-1, -2, -3]) == [2, 4, 6])\nassert(compare(game: [1, 2, 3, 5], guess: [-1, 2, 3, 4]) == [2, 0, 0, 1])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "swift", - "prompt": "\n/// Given a positive integer n, return a tuple that has the number of even and odd\n/// integer palindromes that fall within the range(1, n), inclusive.\n/// Example 1:\n/// Input: 3\n/// Output: (1, 2)\n/// Explanation:\n/// Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n/// Example 2:\n/// Input: 12\n/// Output: (4, 6)\n/// Explanation:\n/// Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n/// Note:\n/// 1. 1 <= n <= 10^3\n/// 2. returned tuple has the number of even and odd integer palindromes respectively.\nfunc even_odd_palindrome(n: Int) -> (Int, Int) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(even_odd_palindrome(n: 123) == (8, 13))\nassert(even_odd_palindrome(n: 12) == (4, 6))\nassert(even_odd_palindrome(n: 3) == (1, 2))\nassert(even_odd_palindrome(n: 63) == (6, 8))\nassert(even_odd_palindrome(n: 25) == (5, 6))\nassert(even_odd_palindrome(n: 19) == (4, 6))\nassert(even_odd_palindrome(n: 9) == (4, 5))\nassert(even_odd_palindrome(n: 1) == (0, 1))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "swift", - "prompt": "\n/// The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n/// fib4(0) -> 0\n/// fib4(1) -> 0\n/// fib4(2) -> 2\n/// fib4(3) -> 0\n/// fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n/// Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n/// >>> fib4(5)\n/// 4\n/// >>> fib4(6)\n/// 8\n/// >>> fib4(7)\n/// 14\nfunc fib4(n: Int) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(fib4(n: 5) == 4)\nassert(fib4(n: 8) == 28)\nassert(fib4(n: 10) == 104)\nassert(fib4(n: 12) == 386)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "swift", - "prompt": "\n/// Given two positive integers a and b, return the even digits between a\n/// and b, in ascending order.\n/// For example:\n/// generate_integers(2, 8) => [2, 4, 6, 8]\n/// generate_integers(8, 2) => [2, 4, 6, 8]\n/// generate_integers(10, 14) => []\nfunc generate_integers(a: Int, b: Int) -> [Int] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(generate_integers(a: 2, b: 10) == [2, 4, 6, 8])\nassert(generate_integers(a: 10, b: 2) == [2, 4, 6, 8])\nassert(generate_integers(a: 132, b: 2) == [2, 4, 6, 8])\nassert(generate_integers(a: 17, b: 89) == [] as [Int])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "swift", - "prompt": "\n/// For a given list of input numbers, calculate Mean Absolute Deviation\n/// around the mean of this dataset.\n/// Mean Absolute Deviation is the average absolute difference between each\n/// element and a centerpoint (mean in this case):\n/// MAD = average | x - x_mean |\n/// >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n/// 1.0\nfunc mean_absolute_deviation(numbers: [Double]) -> Double {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(mean_absolute_deviation(numbers: [1.0, 2.0]) == 0.5)\nassert(mean_absolute_deviation(numbers: [1.0, 2.0, 3.0, 4.0]) == 1.0)\nassert(mean_absolute_deviation(numbers: [1.0, 2.0, 3.0, 4.0, 5.0]) == 1.2)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "swift", - "prompt": "\n/// Create a function encrypt that takes a string as an argument and\n/// returns a string encrypted with the alphabet being rotated. \n/// The alphabet should be rotated in a manner such that the letters \n/// shift down by two multiplied to two places.\n/// For example:\n/// encrypt('hi') returns 'lm'\n/// encrypt('asdfghjkl') returns 'ewhjklnop'\n/// encrypt('gf') returns 'kj'\n/// encrypt('et') returns 'ix'\nfunc encrypt(s: String) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(encrypt(s: \"hi\") == \"lm\")\nassert(encrypt(s: \"asdfghjkl\") == \"ewhjklnop\")\nassert(encrypt(s: \"gf\") == \"kj\")\nassert(encrypt(s: \"et\") == \"ix\")\nassert(encrypt(s: \"faewfawefaewg\") == \"jeiajeaijeiak\")\nassert(encrypt(s: \"hellomyfriend\") == \"lippsqcjvmirh\")\nassert(encrypt(s: \"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\") == \"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\")\nassert(encrypt(s: \"a\") == \"e\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "swift", - "prompt": "\n/// Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n/// The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n/// as follows: start with any positive integer n. Then each term is obtained from the \n/// previous term as follows: if the previous term is even, the next term is one half of \n/// the previous term. If the previous term is odd, the next term is 3 times the previous\n/// term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n/// Note: \n/// 1. Collatz(1) is [1].\n/// 2. returned list sorted in increasing order.\n/// For example:\n/// get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\nfunc get_odd_collatz(n: Int) -> [Int] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(get_odd_collatz(n: 14) == [1, 5, 7, 11, 13, 17])\nassert(get_odd_collatz(n: 5) == [1, 5])\nassert(get_odd_collatz(n: 12) == [1, 3, 5])\nassert(get_odd_collatz(n: 1) == [1])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "swift", - "prompt": "\n/// Find how many times a given substring can be found in the original string. Count overlaping cases.\n/// >>> how_many_times('', 'a')\n/// 0\n/// >>> how_many_times('aaa', 'a')\n/// 3\n/// >>> how_many_times('aaaa', 'aa')\n/// 3\nfunc how_many_times(string: String, substring: String) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(how_many_times(string: \"\", substring: \"x\") == 0)\nassert(how_many_times(string: \"xyxyxyx\", substring: \"x\") == 4)\nassert(how_many_times(string: \"cacacacac\", substring: \"cac\") == 4)\nassert(how_many_times(string: \"john doe\", substring: \"john\") == 1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "swift", - "prompt": "\n/// We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n/// numbers in the array will be randomly ordered. Your task is to determine if\n/// it is possible to get an array sorted in non-decreasing order by performing \n/// the following operation on the given array:\n/// You are allowed to perform right shift operation any number of times.\n/// One right shift operation means shifting all elements of the array by one\n/// position in the right direction. The last element of the array will be moved to\n/// the starting position in the array i.e. 0th index. \n/// If it is possible to obtain the sorted array by performing the above operation\n/// then return True else return False.\n/// If the given array is empty then return True.\n/// Note: The given list is guaranteed to have unique elements.\n/// For Example:\n/// move_one_ball([3, 4, 5, 1, 2])==>True\n/// Explanation: By performin 2 right shift operations, non-decreasing order can\n/// be achieved for the given array.\n/// move_one_ball([3, 5, 4, 1, 2])==>False\n/// Explanation:It is not possible to get non-decreasing order for the given\n/// array by performing any number of right shift operations.\nfunc move_one_ball(arr: [Int]) -> Bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(move_one_ball(arr: [3, 4, 5, 1, 2]) == true)\nassert(move_one_ball(arr: [3, 5, 10, 1, 2]) == true)\nassert(move_one_ball(arr: [4, 3, 1, 2]) == false)\nassert(move_one_ball(arr: [3, 5, 4, 1, 2]) == false)\nassert(move_one_ball(arr: [] as [Int]) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "swift", - "prompt": "\n/// Write a function which sorts the given list of integers\n/// in ascending order according to the sum of their digits.\n/// Note: if there are several items with similar sum of their digits,\n/// order them based on their index in original list.\n/// For example:\n/// >>> order_by_points([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]\n/// >>> order_by_points([]) == []\nfunc order_by_points(nums: [Int]) -> [Int] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(order_by_points(nums: [1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11])\nassert(order_by_points(nums: [1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]) == [0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457])\nassert(order_by_points(nums: [] as [Int]) == [] as [Int])\nassert(order_by_points(nums: [1, -11, -32, 43, 54, -98, 2, -3]) == [-3, -32, -98, -11, 1, 2, 43, 54])\nassert(order_by_points(nums: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) == [1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9])\nassert(order_by_points(nums: [0, 6, 6, -76, -21, 23, 4]) == [-76, -21, 0, 4, 23, 6, 6])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "swift", - "prompt": "\n/// Return list of prime factors of given integer in the order from smallest to largest.\n/// Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n/// Input number should be equal to the product of all factors\n/// >>> factorize(8)\n/// [2, 2, 2]\n/// >>> factorize(25)\n/// [5, 5]\n/// >>> factorize(70)\n/// [2, 5, 7]\nfunc factorize(n: Int) -> [Int] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(factorize(n: 2) == [2])\nassert(factorize(n: 4) == [2, 2])\nassert(factorize(n: 8) == [2, 2, 2])\nassert(factorize(n: 57) == [3, 19])\nassert(factorize(n: 3249) == [3, 3, 19, 19])\nassert(factorize(n: 185193) == [3, 3, 3, 19, 19, 19])\nassert(factorize(n: 20577) == [3, 19, 19, 19])\nassert(factorize(n: 18) == [2, 3, 3])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "swift", - "prompt": "\n/// Return True if all numbers in the list l are below threshold t.\n/// >>> below_threshold([1, 2, 4, 10], 100)\n/// True\n/// >>> below_threshold([1, 20, 4, 10], 5)\n/// False\nfunc below_threshold(l: [Int], t: Int) -> Bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(below_threshold(l: [1, 2, 4, 10], t: 100) == true)\nassert(below_threshold(l: [1, 20, 4, 10], t: 5) == false)\nassert(below_threshold(l: [1, 20, 4, 10], t: 21) == true)\nassert(below_threshold(l: [1, 20, 4, 10], t: 22) == true)\nassert(below_threshold(l: [1, 8, 4, 10], t: 11) == true)\nassert(below_threshold(l: [1, 8, 4, 10], t: 10) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "swift", - "prompt": "\nextension Int: Error {}\n \n/// You are given two positive integers n and m, and your task is to compute the\n/// average of the integers from n through m (including n and m). \n/// Round the answer to the nearest integer and convert that to binary.\n/// If n is greater than m, return -1.\n/// Example:\n/// rounded_avg(1, 5) => \"0b11\"\n/// rounded_avg(7, 5) => -1\n/// rounded_avg(10, 20) => \"0b1111\"\n/// rounded_avg(20, 33) => \"0b11010\"\nfunc rounded_avg(n: Int, m: Int) -> Result {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(rounded_avg(n: 1, m: 5) == .success(\"0b11\"))\nassert(rounded_avg(n: 7, m: 13) == .success(\"0b1010\"))\nassert(rounded_avg(n: 964, m: 977) == .success(\"0b1111001010\"))\nassert(rounded_avg(n: 996, m: 997) == .success(\"0b1111100100\"))\nassert(rounded_avg(n: 560, m: 851) == .success(\"0b1011000010\"))\nassert(rounded_avg(n: 185, m: 546) == .success(\"0b101101110\"))\nassert(rounded_avg(n: 362, m: 496) == .success(\"0b110101101\"))\nassert(rounded_avg(n: 350, m: 902) == .success(\"0b1001110010\"))\nassert(rounded_avg(n: 197, m: 233) == .success(\"0b11010111\"))\nassert(rounded_avg(n: 7, m: 5) == .failure(-1))\nassert(rounded_avg(n: 5, m: 1) == .failure(-1))\nassert(rounded_avg(n: 5, m: 5) == .success(\"0b101\"))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "swift", - "prompt": "\n/// Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n/// For each of the group, output the deepest level of nesting of parentheses.\n/// E.g. (()()) has maximum two levels of nesting while ((())) has three.\n/// >>> parse_nested_parens('(()()) ((())) () ((())()())')\n/// [2, 3, 1, 3]\nfunc parse_nested_parens(paren_string: String) -> [Int] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(parse_nested_parens(paren_string: \"(()()) ((())) () ((())()())\") == [2, 3, 1, 3])\nassert(parse_nested_parens(paren_string: \"() (()) ((())) (((())))\") == [1, 2, 3, 4])\nassert(parse_nested_parens(paren_string: \"(()(())((())))\") == [4])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "swift", - "prompt": "\n/// Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n/// Examples\n/// solution([5, 8, 7, 1]) ==> 12\n/// solution([3, 3, 3, 3, 3]) ==> 9\n/// solution([30, 13, 24, 321]) ==>0\nfunc solution(lst: [Int]) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(solution(lst: [5, 8, 7, 1]) == 12)\nassert(solution(lst: [3, 3, 3, 3, 3]) == 9)\nassert(solution(lst: [30, 13, 24, 321]) == 0)\nassert(solution(lst: [5, 9]) == 5)\nassert(solution(lst: [2, 4, 8]) == 0)\nassert(solution(lst: [30, 13, 23, 32]) == 23)\nassert(solution(lst: [3, 13, 2, 9]) == 3)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "swift", - "prompt": "\n/// You are given a positive integer n. You have to create an integer array a of length n.\n/// For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n/// Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n/// and a[i] + a[j] + a[k] is a multiple of 3.\n/// Example :\n/// Input: n = 5\n/// Output: 1\n/// Explanation: \n/// a = [1, 3, 7, 13, 21]\n/// The only valid triple is (1, 7, 13).\nfunc get_max_triples(n: Int) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(get_max_triples(n: 5) == 1)\nassert(get_max_triples(n: 6) == 4)\nassert(get_max_triples(n: 10) == 36)\nassert(get_max_triples(n: 100) == 53361)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "swift", - "prompt": "\n/// There are eight planets in our solar system: the closerst to the Sun \n/// is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n/// Uranus, Neptune.\n/// Write a function that takes two planet names as strings planet1 and planet2. \n/// The function should return a tuple containing all planets whose orbits are \n/// located between the orbit of planet1 and the orbit of planet2, sorted by \n/// the proximity to the sun. \n/// The function should return an empty tuple if planet1 or planet2\n/// are not correct planet names. \n/// Examples\n/// bf(\"Jupiter\", \"Neptune\") ==> (\"Saturn\", \"Uranus\")\n/// bf(\"Earth\", \"Mercury\") ==> (\"Venus\")\n/// bf(\"Mercury\", \"Uranus\") ==> (\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\")\nfunc bf(planet1: String, planet2: String) -> [String] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(bf(planet1: \"Jupiter\", planet2: \"Neptune\") == [\"Saturn\", \"Uranus\"])\nassert(bf(planet1: \"Earth\", planet2: \"Mercury\") == [\"Venus\"])\nassert(bf(planet1: \"Mercury\", planet2: \"Uranus\") == [\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"])\nassert(bf(planet1: \"Neptune\", planet2: \"Venus\") == [\"Earth\", \"Mars\", \"Jupiter\", \"Saturn\", \"Uranus\"])\nassert(bf(planet1: \"Earth\", planet2: \"Earth\") == [] as [String])\nassert(bf(planet1: \"Mars\", planet2: \"Earth\") == [] as [String])\nassert(bf(planet1: \"Jupiter\", planet2: \"Makemake\") == [] as [String])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "swift", - "prompt": "\n/// You are given a list of integers.\n/// Write a function next_smallest() that returns the 2nd smallest element of the list.\n/// Return None if there is no such element.\n/// next_smallest([1, 2, 3, 4, 5]) == 2\n/// next_smallest([5, 1, 4, 3, 2]) == 2\n/// next_smallest([]) == None\n/// next_smallest([1, 1]) == None\nfunc next_smallest(lst: [Int]) -> Int? {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(next_smallest(lst: [1, 2, 3, 4, 5]) == 2)\nassert(next_smallest(lst: [5, 1, 4, 3, 2]) == 2)\nassert(next_smallest(lst: [] as [Int]) == nil)\nassert(next_smallest(lst: [1, 1]) == nil)\nassert(next_smallest(lst: [1, 1, 1, 1, 0]) == 1)\nassert(next_smallest(lst: [1, 1]) == nil)\nassert(next_smallest(lst: [-35, 34, 12, -45]) == -35)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "swift", - "prompt": "\n/// Input is a space-delimited string of numberals from 'zero' to 'nine'.\n/// Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n/// Return the string with numbers sorted from smallest to largest\n/// >>> sort_numbers('three one five')\n/// 'one three five'\nfunc sort_numbers(numbers: String) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sort_numbers(numbers: \"\") == \"\")\nassert(sort_numbers(numbers: \"three\") == \"three\")\nassert(sort_numbers(numbers: \"three five nine\") == \"three five nine\")\nassert(sort_numbers(numbers: \"five zero four seven nine eight\") == \"zero four five seven eight nine\")\nassert(sort_numbers(numbers: \"six five four three two one zero\") == \"zero one two three four five six\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "swift", - "prompt": "\n/// You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n/// cycpattern_check(\"abcd\",\"abd\") => False\n/// cycpattern_check(\"hello\",\"ell\") => True\n/// cycpattern_check(\"whassup\",\"psus\") => False\n/// cycpattern_check(\"abab\",\"baa\") => True\n/// cycpattern_check(\"efef\",\"eeff\") => False\n/// cycpattern_check(\"himenss\",\"simen\") => True\nfunc cycpattern_check(a: String, b: String) -> Bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(cycpattern_check(a: \"xyzw\", b: \"xyw\") == false)\nassert(cycpattern_check(a: \"yello\", b: \"ell\") == true)\nassert(cycpattern_check(a: \"whattup\", b: \"ptut\") == false)\nassert(cycpattern_check(a: \"efef\", b: \"fee\") == true)\nassert(cycpattern_check(a: \"abab\", b: \"aabb\") == false)\nassert(cycpattern_check(a: \"winemtt\", b: \"tinem\") == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "swift", - "prompt": "\n/// You will be given a number in decimal form and your task is to convert it to\n/// binary format. The function should return a string, with each character representing a binary\n/// number. Each character in the string will be '0' or '1'.\n/// There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n/// The extra characters are there to help with the format.\n/// Examples:\n/// decimal_to_binary(15) # returns \"db1111db\"\n/// decimal_to_binary(32) # returns \"db100000db\"\nfunc decimal_to_binary(decimal: Int) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(decimal_to_binary(decimal: 0) == \"db0db\")\nassert(decimal_to_binary(decimal: 32) == \"db100000db\")\nassert(decimal_to_binary(decimal: 103) == \"db1100111db\")\nassert(decimal_to_binary(decimal: 15) == \"db1111db\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "swift", - "prompt": "\n/// Filter an input list of strings only for ones that contain given substring\n/// >>> filter_by_substring([], 'a')\n/// []\n/// >>> filter_by_substring(['abc', 'bacd', 'cde', 'array'], 'a')\n/// ['abc', 'bacd', 'array']\nfunc filter_by_substring(strings: [String], substring: String) -> [String] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(filter_by_substring(strings: [] as [String], substring: \"john\") == [] as [String])\nassert(filter_by_substring(strings: [\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], substring: \"xxx\") == [\"xxx\", \"xxxAAA\", \"xxx\"])\nassert(filter_by_substring(strings: [\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"], substring: \"xx\") == [\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"])\nassert(filter_by_substring(strings: [\"grunt\", \"trumpet\", \"prune\", \"gruesome\"], substring: \"run\") == [\"grunt\", \"prune\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "swift", - "prompt": "\n/// Given an integer. return a tuple that has the number of even and odd digits respectively.\n/// Example:\n/// even_odd_count(-12) ==> (1, 1)\n/// even_odd_count(123) ==> (1, 2)\nfunc even_odd_count(num: Int) -> (Int, Int) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(even_odd_count(num: 7) == (0, 1))\nassert(even_odd_count(num: -78) == (1, 1))\nassert(even_odd_count(num: 3452) == (2, 2))\nassert(even_odd_count(num: 346211) == (3, 3))\nassert(even_odd_count(num: -345821) == (3, 3))\nassert(even_odd_count(num: -2) == (1, 0))\nassert(even_odd_count(num: -45347) == (2, 3))\nassert(even_odd_count(num: 0) == (1, 0))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "swift", - "prompt": "\n/// Write a function that accepts a list of strings.\n/// The list contains different words. Return the word with maximum number\n/// of unique characters. If multiple strings have maximum number of unique\n/// characters, return the one which comes first in lexicographical order.\n/// find_max([\"name\", \"of\", \"string\"]) == \"string\"\n/// find_max([\"name\", \"enam\", \"game\"]) == \"enam\"\n/// find_max([\"aaaaaaa\", \"bb\" ,\"cc\"]) == \"\"aaaaaaa\"\nfunc find_max(words: [String]) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(find_max(words: [\"name\", \"of\", \"string\"]) == \"string\")\nassert(find_max(words: [\"name\", \"enam\", \"game\"]) == \"enam\")\nassert(find_max(words: [\"aaaaaaa\", \"bb\", \"cc\"]) == \"aaaaaaa\")\nassert(find_max(words: [\"abc\", \"cba\"]) == \"abc\")\nassert(find_max(words: [\"play\", \"this\", \"game\", \"of\", \"footbott\"]) == \"footbott\")\nassert(find_max(words: [\"we\", \"are\", \"gonna\", \"rock\"]) == \"gonna\")\nassert(find_max(words: [\"we\", \"are\", \"a\", \"mad\", \"nation\"]) == \"nation\")\nassert(find_max(words: [\"this\", \"is\", \"a\", \"prrk\"]) == \"this\")\nassert(find_max(words: [\"b\"]) == \"b\")\nassert(find_max(words: [\"play\", \"play\", \"play\"]) == \"play\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "swift", - "prompt": "\n/// Given a positive integer n, return the count of the numbers of n-digit\n/// positive integers that start or end with 1.\nfunc starts_one_ends(n: Int) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(starts_one_ends(n: 1) == 1)\nassert(starts_one_ends(n: 2) == 18)\nassert(starts_one_ends(n: 3) == 180)\nassert(starts_one_ends(n: 4) == 1800)\nassert(starts_one_ends(n: 5) == 18000)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "swift", - "prompt": "\n/// Create a function that returns a tuple (a, b), where 'a' is\n/// the largest of negative integers, and 'b' is the smallest\n/// of positive integers in a list.\n/// If there is no negative or positive integers, return them as None.\n/// Examples:\n/// largest_smallest_integers([2, 4, 1, 3, 5, 7]) == (None, 1)\n/// largest_smallest_integers([]) == (None, None)\n/// largest_smallest_integers([0]) == (None, None)\nfunc largest_smallest_integers(lst: [Int]) -> (Int?, Int?) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(largest_smallest_integers(lst: [2, 4, 1, 3, 5, 7]) == (nil, 1))\nassert(largest_smallest_integers(lst: [2, 4, 1, 3, 5, 7, 0]) == (nil, 1))\nassert(largest_smallest_integers(lst: [1, 3, 2, 4, 5, 6, -2]) == (-2, 1))\nassert(largest_smallest_integers(lst: [4, 5, 3, 6, 2, 7, -7]) == (-7, 2))\nassert(largest_smallest_integers(lst: [7, 3, 8, 4, 9, 2, 5, -9]) == (-9, 2))\nassert(largest_smallest_integers(lst: [] as [Int]) == (nil, nil))\nassert(largest_smallest_integers(lst: [0]) == (nil, nil))\nassert(largest_smallest_integers(lst: [-1, -3, -5, -6]) == (-1, nil))\nassert(largest_smallest_integers(lst: [-1, -3, -5, -6, 0]) == (-1, nil))\nassert(largest_smallest_integers(lst: [-6, -4, -4, -3, 1]) == (-3, 1))\nassert(largest_smallest_integers(lst: [-6, -4, -4, -3, -100, 1]) == (-3, 1))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "swift", - "prompt": "\n/// \"Given an array representing a branch of a tree that has non-negative integer nodes\n/// your task is to pluck one of the nodes and return it.\n/// The plucked node should be the node with the smallest even value.\n/// If multiple nodes with the same smallest even value are found return the node that has smallest index.\n/// The plucked node should be returned in a list, [ smalest_value, its index ],\n/// If there are no even values or the given array is empty, return [].\n/// Example 1:\n/// Input: [4,2,3]\n/// Output: [2, 1]\n/// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n/// Example 2:\n/// Input: [1,2,3]\n/// Output: [2, 1]\n/// Explanation: 2 has the smallest even value, and 2 has the smallest index. \n/// Example 3:\n/// Input: []\n/// Output: []\n/// Example 4:\n/// Input: [5, 0, 3, 0, 4, 2]\n/// Output: [0, 1]\n/// Explanation: 0 is the smallest value, but there are two zeros,\n/// so we will choose the first zero, which has the smallest index.\n/// Constraints:\n/// * 1 <= nodes.length <= 10000\n/// * 0 <= node.value\nfunc pluck(arr: [Int]) -> [Int] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(pluck(arr: [4, 2, 3]) == [2, 1])\nassert(pluck(arr: [1, 2, 3]) == [2, 1])\nassert(pluck(arr: [] as [Int]) == [] as [Int])\nassert(pluck(arr: [5, 0, 3, 0, 4, 2]) == [0, 1])\nassert(pluck(arr: [1, 2, 3, 0, 5, 3]) == [0, 3])\nassert(pluck(arr: [5, 4, 8, 4, 8]) == [4, 1])\nassert(pluck(arr: [7, 6, 7, 1]) == [6, 1])\nassert(pluck(arr: [7, 9, 7, 1]) == [] as [Int])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "swift", - "prompt": "\n/// Write a function count_nums which takes an array of integers and returns\n/// the number of elements which has a sum of digits > 0.\n/// If a number is negative, then its first signed digit will be negative:\n/// e.g. -123 has signed digits -1, 2, and 3.\n/// >>> count_nums([]) == 0\n/// >>> count_nums([-1, 11, -11]) == 1\n/// >>> count_nums([1, 1, 2]) == 3\nfunc count_nums(arr: [Int]) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(count_nums(arr: [] as [Int]) == 0)\nassert(count_nums(arr: [-1, -2, 0]) == 0)\nassert(count_nums(arr: [1, 1, 2, -2, 3, 4, 5]) == 6)\nassert(count_nums(arr: [1, 6, 9, -6, 0, 1, 5]) == 5)\nassert(count_nums(arr: [1, 100, 98, -7, 1, -1]) == 4)\nassert(count_nums(arr: [12, 23, 34, -45, -56, 0]) == 5)\nassert(count_nums(arr: [0, 1]) == 1)\nassert(count_nums(arr: [1]) == 1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "swift", - "prompt": "\n/// Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n/// each cell of the grid contains a value. Every integer in the range [1, N * N]\n/// inclusive appears exactly once on the cells of the grid.\n/// You have to find the minimum path of length k in the grid. You can start\n/// from any cell, and in each step you can move to any of the neighbor cells,\n/// in other words, you can go to cells which share an edge with you current\n/// cell.\n/// Please note that a path of length k means visiting exactly k cells (not\n/// necessarily distinct).\n/// You CANNOT go off the grid.\n/// A path A (of length k) is considered less than a path B (of length k) if\n/// after making the ordered lists of the values on the cells that A and B go\n/// through (let's call them lst_A and lst_B), lst_A is lexicographically less\n/// than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n/// such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n/// lst_A[j] = lst_B[j].\n/// It is guaranteed that the answer is unique.\n/// Return an ordered list of the values on the cells that the minimum path go through.\n/// Examples:\n/// Input: grid = [ [1,2,3], [4,5,6], [7,8,9]], k = 3\n/// Output: [1, 2, 1]\n/// Input: grid = [ [5,9,3], [4,1,6], [7,8,2]], k = 1\n/// Output: [1]\nfunc minPath(grid: [[Int]], k: Int) -> [Int] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(minPath(grid: [[1, 2, 3], [4, 5, 6], [7, 8, 9]], k: 3) == [1, 2, 1])\nassert(minPath(grid: [[5, 9, 3], [4, 1, 6], [7, 8, 2]], k: 1) == [1])\nassert(minPath(grid: [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], k: 4) == [1, 2, 1, 2])\nassert(minPath(grid: [[6, 4, 13, 10], [5, 7, 12, 1], [3, 16, 11, 15], [8, 14, 9, 2]], k: 7) == [1, 10, 1, 10, 1, 10, 1])\nassert(minPath(grid: [[8, 14, 9, 2], [6, 4, 13, 15], [5, 7, 1, 12], [3, 10, 11, 16]], k: 5) == [1, 7, 1, 7, 1])\nassert(minPath(grid: [[11, 8, 7, 2], [5, 16, 14, 4], [9, 3, 15, 6], [12, 13, 10, 1]], k: 9) == [1, 6, 1, 6, 1, 6, 1, 6, 1])\nassert(minPath(grid: [[12, 13, 10, 1], [9, 3, 15, 6], [5, 16, 14, 4], [11, 8, 7, 2]], k: 12) == [1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6])\nassert(minPath(grid: [[2, 7, 4], [3, 1, 5], [6, 8, 9]], k: 8) == [1, 3, 1, 3, 1, 3, 1, 3])\nassert(minPath(grid: [[6, 1, 5], [3, 8, 9], [2, 7, 4]], k: 8) == [1, 5, 1, 5, 1, 5, 1, 5])\nassert(minPath(grid: [[1, 2], [3, 4]], k: 10) == [1, 2, 1, 2, 1, 2, 1, 2, 1, 2])\nassert(minPath(grid: [[1, 3], [3, 2]], k: 10) == [1, 3, 1, 3, 1, 3, 1, 3, 1, 3])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "swift", - "prompt": "\n/// Given list of integers, return list in strange order.\n/// Strange sorting, is when you start with the minimum value,\n/// then maximum of the remaining integers, then minimum and so on.\n/// Examples:\n/// strange_sort_list([1, 2, 3, 4]) == [1, 4, 2, 3]\n/// strange_sort_list([5, 5, 5, 5]) == [5, 5, 5, 5]\n/// strange_sort_list([]) == []\nfunc strange_sort_list(lst: [Int]) -> [Int] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(strange_sort_list(lst: [1, 2, 3, 4]) == [1, 4, 2, 3])\nassert(strange_sort_list(lst: [5, 6, 7, 8, 9]) == [5, 9, 6, 8, 7])\nassert(strange_sort_list(lst: [1, 2, 3, 4, 5]) == [1, 5, 2, 4, 3])\nassert(strange_sort_list(lst: [5, 6, 7, 8, 9, 1]) == [1, 9, 5, 8, 6, 7])\nassert(strange_sort_list(lst: [5, 5, 5, 5]) == [5, 5, 5, 5])\nassert(strange_sort_list(lst: [] as [Int]) == [] as [Int])\nassert(strange_sort_list(lst: [1, 2, 3, 4, 5, 6, 7, 8]) == [1, 8, 2, 7, 3, 6, 4, 5])\nassert(strange_sort_list(lst: [0, 2, 2, 2, 5, 5, -5, -5]) == [-5, 5, -5, 5, 0, 2, 2, 2])\nassert(strange_sort_list(lst: [111111]) == [111111])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "swift", - "prompt": "\n/// Given a string 'text', return its md5 hash equivalent string.\n/// If 'text' is an empty string, return None.\n/// >>> string_to_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'\nfunc string_to_md5(text: String) -> String? {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(string_to_md5(text: \"Hello world\") == \"3e25960a79dbc69b674cd4ec67a72c62\")\nassert(string_to_md5(text: \"\") == nil)\nassert(string_to_md5(text: \"A B C\") == \"0ef78513b0cb8cef12743f5aeb35f888\")\nassert(string_to_md5(text: \"password\") == \"5f4dcc3b5aa765d61d8327deb882cf99\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "swift", - "prompt": "\n/// You are given a word. Your task is to find the closest vowel that stands between \n/// two consonants from the right side of the word (case sensitive).\n/// Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n/// find any vowel met the above condition. \n/// You may assume that the given string contains English letter only.\n/// Example:\n/// get_closest_vowel(\"yogurt\") ==> \"u\"\n/// get_closest_vowel(\"FULL\") ==> \"U\"\n/// get_closest_vowel(\"quick\") ==> \"\"\n/// get_closest_vowel(\"ab\") ==> \"\"\nfunc get_closest_vowel(word: String) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(get_closest_vowel(word: \"yogurt\") == \"u\")\nassert(get_closest_vowel(word: \"full\") == \"u\")\nassert(get_closest_vowel(word: \"easy\") == \"\")\nassert(get_closest_vowel(word: \"eAsy\") == \"\")\nassert(get_closest_vowel(word: \"ali\") == \"\")\nassert(get_closest_vowel(word: \"bad\") == \"a\")\nassert(get_closest_vowel(word: \"most\") == \"o\")\nassert(get_closest_vowel(word: \"ab\") == \"\")\nassert(get_closest_vowel(word: \"ba\") == \"\")\nassert(get_closest_vowel(word: \"quick\") == \"\")\nassert(get_closest_vowel(word: \"anime\") == \"i\")\nassert(get_closest_vowel(word: \"Asia\") == \"\")\nassert(get_closest_vowel(word: \"Above\") == \"o\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "swift", - "prompt": "\n/// Change numerical base of input number x to base.\n/// return string representation after the conversion.\n/// base numbers are less than 10.\n/// >>> change_base(8, 3)\n/// '22'\n/// >>> change_base(8, 2)\n/// '1000'\n/// >>> change_base(7, 2)\n/// '111'\nfunc change_base(x: Int, base: Int) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(change_base(x: 8, base: 3) == \"22\")\nassert(change_base(x: 9, base: 3) == \"100\")\nassert(change_base(x: 234, base: 2) == \"11101010\")\nassert(change_base(x: 16, base: 2) == \"10000\")\nassert(change_base(x: 8, base: 2) == \"1000\")\nassert(change_base(x: 7, base: 2) == \"111\")\nassert(change_base(x: 2, base: 3) == \"2\")\nassert(change_base(x: 3, base: 4) == \"3\")\nassert(change_base(x: 4, base: 5) == \"4\")\nassert(change_base(x: 5, base: 6) == \"5\")\nassert(change_base(x: 6, base: 7) == \"6\")\nassert(change_base(x: 7, base: 8) == \"7\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "swift", - "prompt": "\n/// Check if in given list of numbers, are any two numbers closer to each other than\n/// given threshold.\n/// >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n/// False\n/// >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n/// True\nfunc has_close_elements(numbers: [Double], threshold: Double) -> Bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(has_close_elements(numbers: [1.0, 2.0, 3.9, 4.0, 5.0, 2.2], threshold: 0.3) == true)\nassert(has_close_elements(numbers: [1.0, 2.0, 3.9, 4.0, 5.0, 2.2], threshold: 0.05) == false)\nassert(has_close_elements(numbers: [1.0, 2.0, 5.9, 4.0, 5.0], threshold: 0.95) == true)\nassert(has_close_elements(numbers: [1.0, 2.0, 5.9, 4.0, 5.0], threshold: 0.8) == false)\nassert(has_close_elements(numbers: [1.0, 2.0, 3.0, 4.0, 5.0, 2.0], threshold: 0.1) == true)\nassert(has_close_elements(numbers: [1.1, 2.2, 3.1, 4.1, 5.1], threshold: 1.0) == true)\nassert(has_close_elements(numbers: [1.1, 2.2, 3.1, 4.1, 5.1], threshold: 0.5) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "swift", - "prompt": "\n/// Create a function that takes a string as input which contains only square brackets.\n/// The function should return True if and only if there is a valid subsequence of brackets \n/// where at least one bracket in the subsequence is nested.\n/// is_nested('[[]]') \u279e True\n/// is_nested('[]]]]]]][[[[[]') \u279e False\n/// is_nested('[][]') \u279e False\n/// is_nested('[]') \u279e False\n/// is_nested('[[][]]') \u279e True\n/// is_nested('[[]][[') \u279e True\nfunc is_nested(string: String) -> Bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_nested(string: \"[[]]\") == true)\nassert(is_nested(string: \"[]]]]]]][[[[[]\") == false)\nassert(is_nested(string: \"[][]\") == false)\nassert(is_nested(string: \"[]\") == false)\nassert(is_nested(string: \"[[[[]]]]\") == true)\nassert(is_nested(string: \"[]]]]]]]]]]\") == false)\nassert(is_nested(string: \"[][][[]]\") == true)\nassert(is_nested(string: \"[[]\") == false)\nassert(is_nested(string: \"[]]\") == false)\nassert(is_nested(string: \"[[]][[\") == true)\nassert(is_nested(string: \"[[][]]\") == true)\nassert(is_nested(string: \"\") == false)\nassert(is_nested(string: \"[[[[[[[[\") == false)\nassert(is_nested(string: \"]]]]]]]]\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "swift", - "prompt": "\n/// Concatenate list of strings into a single string\n/// >>> concatenate([])\n/// ''\n/// >>> concatenate(['a', 'b', 'c'])\n/// 'abc'\nfunc concatenate(strings: [String]) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(concatenate(strings: [] as [String]) == \"\")\nassert(concatenate(strings: [\"x\", \"y\", \"z\"]) == \"xyz\")\nassert(concatenate(strings: [\"x\", \"y\", \"z\", \"w\", \"k\"]) == \"xyzwk\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "swift", - "prompt": "\n/// prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n/// >>> prime_fib(1)\n/// 2\n/// >>> prime_fib(2)\n/// 3\n/// >>> prime_fib(3)\n/// 5\n/// >>> prime_fib(4)\n/// 13\n/// >>> prime_fib(5)\n/// 89\nfunc prime_fib(n: Int) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(prime_fib(n: 1) == 2)\nassert(prime_fib(n: 2) == 3)\nassert(prime_fib(n: 3) == 5)\nassert(prime_fib(n: 4) == 13)\nassert(prime_fib(n: 5) == 89)\nassert(prime_fib(n: 6) == 233)\nassert(prime_fib(n: 7) == 1597)\nassert(prime_fib(n: 8) == 28657)\nassert(prime_fib(n: 9) == 514229)\nassert(prime_fib(n: 10) == 433494437)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "swift", - "prompt": "\n/// From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n/// other and return them in order (smaller number, larger number).\n/// >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n/// (2.0, 2.2)\n/// >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n/// (2.0, 2.0)\nfunc find_closest_elements(numbers: [Double]) -> (Double, Double) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(find_closest_elements(numbers: [1.0, 2.0, 3.9, 4.0, 5.0, 2.2]) == (3.9, 4.0))\nassert(find_closest_elements(numbers: [1.0, 2.0, 5.9, 4.0, 5.0]) == (5.0, 5.9))\nassert(find_closest_elements(numbers: [1.0, 2.0, 3.0, 4.0, 5.0, 2.2]) == (2.0, 2.2))\nassert(find_closest_elements(numbers: [1.0, 2.0, 3.0, 4.0, 5.0, 2.0]) == (2.0, 2.0))\nassert(find_closest_elements(numbers: [1.1, 2.2, 3.1, 4.1, 5.1]) == (2.2, 3.1))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "swift", - "prompt": "\n/// You have been tasked to write a function that receives \n/// a hexadecimal number as a string and counts the number of hexadecimal \n/// digits that are primes (prime number, or a prime, is a natural number \n/// greater than 1 that is not a product of two smaller natural numbers).\n/// Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n/// Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n/// So you have to determine a number of the following digits: 2, 3, 5, 7, \n/// B (=decimal 11), D (=decimal 13).\n/// Note: you may assume the input is always correct or empty string, \n/// and symbols A,B,C,D,E,F are always uppercase.\n/// Examples:\n/// For num = \"AB\" the output should be 1.\n/// For num = \"1077E\" the output should be 2.\n/// For num = \"ABED1A33\" the output should be 4.\n/// For num = \"123456789ABCDEF0\" the output should be 6.\n/// For num = \"2020\" the output should be 2.\nfunc hex_key(num: String) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(hex_key(num: \"AB\") == 1)\nassert(hex_key(num: \"1077E\") == 2)\nassert(hex_key(num: \"ABED1A33\") == 4)\nassert(hex_key(num: \"2020\") == 2)\nassert(hex_key(num: \"123456789ABCDEF0\") == 6)\nassert(hex_key(num: \"112233445566778899AABBCCDDEEFF00\") == 12)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "swift", - "prompt": "\n/// Complete the function that takes two integers and returns \n/// the product of their unit digits.\n/// Assume the input is always valid.\n/// Examples:\n/// multiply(148, 412) should return 16.\n/// multiply(19, 28) should return 72.\n/// multiply(2020, 1851) should return 0.\n/// multiply(14,-15) should return 20.\nfunc multiply(a: Int, b: Int) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(multiply(a: 148, b: 412) == 16)\nassert(multiply(a: 19, b: 28) == 72)\nassert(multiply(a: 2020, b: 1851) == 0)\nassert(multiply(a: 14, b: -15) == 20)\nassert(multiply(a: 76, b: 67) == 42)\nassert(multiply(a: 17, b: 27) == 49)\nassert(multiply(a: 0, b: 1) == 0)\nassert(multiply(a: 0, b: 0) == 0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "swift", - "prompt": "\n/// Given list of numbers (of at least two elements), apply a linear transform to that list,\n/// such that the smallest number will become 0 and the largest will become 1\n/// >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n/// [0.0, 0.25, 0.5, 0.75, 1.0]\nfunc rescale_to_unit(numbers: [Double]) -> [Double] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(rescale_to_unit(numbers: [2.0, 49.9]) == [0.0, 1.0])\nassert(rescale_to_unit(numbers: [100.0, 49.9]) == [1.0, 0.0])\nassert(rescale_to_unit(numbers: [1.0, 2.0, 3.0, 4.0, 5.0]) == [0.0, 0.25, 0.5, 0.75, 1.0])\nassert(rescale_to_unit(numbers: [2.0, 1.0, 5.0, 3.0, 4.0]) == [0.25, 0.0, 1.0, 0.5, 0.75])\nassert(rescale_to_unit(numbers: [12.0, 11.0, 15.0, 13.0, 14.0]) == [0.25, 0.0, 1.0, 0.5, 0.75])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "swift", - "prompt": "\n/// Given a positive integer n, return the product of the odd digits.\n/// Return 0 if all digits are even.\n/// For example:\n/// digits(1) == 1\n/// digits(4) == 0\n/// digits(235) == 15\nfunc digits(n: Int) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(digits(n: 5) == 5)\nassert(digits(n: 54) == 5)\nassert(digits(n: 120) == 1)\nassert(digits(n: 5014) == 5)\nassert(digits(n: 98765) == 315)\nassert(digits(n: 5576543) == 2625)\nassert(digits(n: 2468) == 0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "swift", - "prompt": "\n/// You will be given the name of a class (a string) and a list of extensions.\n/// The extensions are to be used to load additional classes to the class. The\n/// strength of the extension is as follows: Let CAP be the number of the uppercase\n/// letters in the extension's name, and let SM be the number of lowercase letters \n/// in the extension's name, the strength is given by the fraction CAP - SM. \n/// You should find the strongest extension and return a string in this \n/// format: ClassName.StrongestExtensionName.\n/// If there are two or more extensions with the same strength, you should\n/// choose the one that comes first in the list.\n/// For example, if you are given \"Slices\" as the class and a list of the\n/// extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n/// return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n/// (its strength is -1).\n/// Example:\n/// for Strongest_Extension('my_class', ['AA', 'Be', 'CC']) == 'my_class.AA'\nfunc Strongest_Extension(class_name: String, extensions: [String]) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(Strongest_Extension(class_name: \"Watashi\", extensions: [\"tEN\", \"niNE\", \"eIGHt8OKe\"]) == \"Watashi.eIGHt8OKe\")\nassert(Strongest_Extension(class_name: \"Boku123\", extensions: [\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"]) == \"Boku123.YEs.WeCaNe\")\nassert(Strongest_Extension(class_name: \"__YESIMHERE\", extensions: [\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"]) == \"__YESIMHERE.NuLl__\")\nassert(Strongest_Extension(class_name: \"K\", extensions: [\"Ta\", \"TAR\", \"t234An\", \"cosSo\"]) == \"K.TAR\")\nassert(Strongest_Extension(class_name: \"__HAHA\", extensions: [\"Tab\", \"123\", \"781345\", \"-_-\"]) == \"__HAHA.123\")\nassert(Strongest_Extension(class_name: \"YameRore\", extensions: [\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"]) == \"YameRore.okIWILL123\")\nassert(Strongest_Extension(class_name: \"finNNalLLly\", extensions: [\"Die\", \"NowW\", \"Wow\", \"WoW\"]) == \"finNNalLLly.WoW\")\nassert(Strongest_Extension(class_name: \"_\", extensions: [\"Bb\", \"91245\"]) == \"_.Bb\")\nassert(Strongest_Extension(class_name: \"Sp\", extensions: [\"671235\", \"Bb\"]) == \"Sp.671235\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "swift", - "prompt": "\n/// Given a string representing a space separated lowercase letters, return a dictionary\n/// of the letter with the most repetition and containing the corresponding count.\n/// If several letters have the same occurrence, return all of them.\n/// Example:\n/// histogram('a b c') == {'a': 1, 'b': 1, 'c': 1}\n/// histogram('a b b a') == {'a': 2, 'b': 2}\n/// histogram('a b c a b') == {'a': 2, 'b': 2}\n/// histogram('b b b b a') == {'b': 4}\n/// histogram('') == {}\nfunc histogram(test: String) -> [String : Int] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(histogram(test: \"a b b a\") == [\"a\" : 2, \"b\" : 2])\nassert(histogram(test: \"a b c a b\") == [\"a\" : 2, \"b\" : 2])\nassert(histogram(test: \"a b c d g\") == [\"a\" : 1, \"b\" : 1, \"c\" : 1, \"d\" : 1, \"g\" : 1])\nassert(histogram(test: \"r t g\") == [\"r\" : 1, \"t\" : 1, \"g\" : 1])\nassert(histogram(test: \"b b b b a\") == [\"b\" : 4])\nassert(histogram(test: \"r t g\") == [\"r\" : 1, \"t\" : 1, \"g\" : 1])\nassert(histogram(test: \"\") == [:] as [String : Int])\nassert(histogram(test: \"a\") == [\"a\" : 1])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "swift", - "prompt": "\n/// pairs_sum_to_zero takes a list of integers as an input.\n/// it returns True if there are two distinct elements in the list that\n/// sum to zero, and False otherwise.\n/// >>> pairs_sum_to_zero([1, 3, 5, 0])\n/// False\n/// >>> pairs_sum_to_zero([1, 3, -2, 1])\n/// False\n/// >>> pairs_sum_to_zero([1, 2, 3, 7])\n/// False\n/// >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7])\n/// True\n/// >>> pairs_sum_to_zero([1])\n/// False\nfunc pairs_sum_to_zero(l: [Int]) -> Bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(pairs_sum_to_zero(l: [1, 3, 5, 0]) == false)\nassert(pairs_sum_to_zero(l: [1, 3, -2, 1]) == false)\nassert(pairs_sum_to_zero(l: [1, 2, 3, 7]) == false)\nassert(pairs_sum_to_zero(l: [2, 4, -5, 3, 5, 7]) == true)\nassert(pairs_sum_to_zero(l: [1]) == false)\nassert(pairs_sum_to_zero(l: [-3, 9, -1, 3, 2, 30]) == true)\nassert(pairs_sum_to_zero(l: [-3, 9, -1, 3, 2, 31]) == true)\nassert(pairs_sum_to_zero(l: [-3, 9, -1, 4, 2, 30]) == false)\nassert(pairs_sum_to_zero(l: [-3, 9, -1, 4, 2, 31]) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "swift", - "prompt": "\n/// Write a function that accepts two lists of strings and returns the list that has \n/// total number of chars in the all strings of the list less than the other list.\n/// if the two lists have the same number of chars, return the first list.\n/// Examples\n/// total_match([], []) \u279e []\n/// total_match(['hi', 'admin'], ['hI', 'Hi']) \u279e ['hI', 'Hi']\n/// total_match(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) \u279e ['hi', 'admin']\n/// total_match(['hi', 'admin'], ['hI', 'hi', 'hi']) \u279e ['hI', 'hi', 'hi']\n/// total_match(['4'], ['1', '2', '3', '4', '5']) \u279e ['4']\nfunc total_match(lst1: [String], lst2: [String]) -> [String] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(total_match(lst1: [] as [String], lst2: [] as [String]) == [] as [String])\nassert(total_match(lst1: [\"hi\", \"admin\"], lst2: [\"hi\", \"hi\"]) == [\"hi\", \"hi\"])\nassert(total_match(lst1: [\"hi\", \"admin\"], lst2: [\"hi\", \"hi\", \"admin\", \"project\"]) == [\"hi\", \"admin\"])\nassert(total_match(lst1: [\"4\"], lst2: [\"1\", \"2\", \"3\", \"4\", \"5\"]) == [\"4\"])\nassert(total_match(lst1: [\"hi\", \"admin\"], lst2: [\"hI\", \"Hi\"]) == [\"hI\", \"Hi\"])\nassert(total_match(lst1: [\"hi\", \"admin\"], lst2: [\"hI\", \"hi\", \"hi\"]) == [\"hI\", \"hi\", \"hi\"])\nassert(total_match(lst1: [\"hi\", \"admin\"], lst2: [\"hI\", \"hi\", \"hii\"]) == [\"hi\", \"admin\"])\nassert(total_match(lst1: [] as [String], lst2: [\"this\"]) == [] as [String])\nassert(total_match(lst1: [\"this\"], lst2: [] as [String]) == [] as [String])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "swift", - "prompt": "\n/// Circular shift the digits of the integer x, shift the digits right by shift\n/// and return the result as a string.\n/// If shift > number of digits, return digits reversed.\n/// >>> circular_shift(12, 1)\n/// \"21\"\n/// >>> circular_shift(12, 2)\n/// \"12\"\nfunc circular_shift(x: Int, shift: Int) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(circular_shift(x: 100, shift: 2) == \"001\")\nassert(circular_shift(x: 12, shift: 2) == \"12\")\nassert(circular_shift(x: 97, shift: 8) == \"79\")\nassert(circular_shift(x: 12, shift: 1) == \"21\")\nassert(circular_shift(x: 11, shift: 101) == \"11\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "swift", - "prompt": "\n/// Return True is list elements are monotonically increasing or decreasing.\n/// >>> monotonic([1, 2, 4, 20])\n/// True\n/// >>> monotonic([1, 20, 4, 10])\n/// False\n/// >>> monotonic([4, 1, 0, -10])\n/// True\nfunc monotonic(l: [Int]) -> Bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(monotonic(l: [1, 2, 4, 10]) == true)\nassert(monotonic(l: [1, 2, 4, 20]) == true)\nassert(monotonic(l: [1, 20, 4, 10]) == false)\nassert(monotonic(l: [4, 1, 0, -10]) == true)\nassert(monotonic(l: [4, 1, 1, 0]) == true)\nassert(monotonic(l: [1, 2, 3, 2, 5, 60]) == false)\nassert(monotonic(l: [1, 2, 3, 4, 5, 60]) == true)\nassert(monotonic(l: [9, 9, 9, 9]) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "swift", - "prompt": "\n/// Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n/// Example\n/// is_equal_to_sum_even(4) == False\n/// is_equal_to_sum_even(6) == False\n/// is_equal_to_sum_even(8) == True\nfunc is_equal_to_sum_even(n: Int) -> Bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_equal_to_sum_even(n: 4) == false)\nassert(is_equal_to_sum_even(n: 6) == false)\nassert(is_equal_to_sum_even(n: 8) == true)\nassert(is_equal_to_sum_even(n: 10) == true)\nassert(is_equal_to_sum_even(n: 11) == false)\nassert(is_equal_to_sum_even(n: 12) == true)\nassert(is_equal_to_sum_even(n: 13) == false)\nassert(is_equal_to_sum_even(n: 16) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "swift", - "prompt": "\n/// Input to this function is a string representing musical notes in a special ASCII format.\n/// Your task is to parse this string and return list of integers corresponding to how many beats does each\n/// not last.\n/// Here is a legend:\n/// 'o' - whole note, lasts four beats\n/// 'o|' - half note, lasts two beats\n/// '.|' - quater note, lasts one beat\n/// >>> parse_music('o o| .| o| o| .| .| .| .| o o')\n/// [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\nfunc parse_music(music_string: String) -> [Int] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(parse_music(music_string: \"\") == [] as [Int])\nassert(parse_music(music_string: \"o o o o\") == [4, 4, 4, 4])\nassert(parse_music(music_string: \".| .| .| .|\") == [1, 1, 1, 1])\nassert(parse_music(music_string: \"o| o| .| .| o o o o\") == [2, 2, 1, 1, 4, 4, 4, 4])\nassert(parse_music(music_string: \"o| .| o| .| o o| o o|\") == [2, 1, 2, 1, 4, 2, 4, 2])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "swift", - "prompt": "\n/// \"\n/// This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n/// multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n/// change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n/// Examples:\n/// For lst = [1,2,3] the output should be 6\n/// For lst = [] the output should be 0\n/// For lst = [-1,-5,2,-1,-5] the output should be -126\nfunc sum_squares(lst: [Int]) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sum_squares(lst: [1, 2, 3]) == 6)\nassert(sum_squares(lst: [1, 4, 9]) == 14)\nassert(sum_squares(lst: [] as [Int]) == 0)\nassert(sum_squares(lst: [1, 1, 1, 1, 1, 1, 1, 1, 1]) == 9)\nassert(sum_squares(lst: [-1, -1, -1, -1, -1, -1, -1, -1, -1]) == -3)\nassert(sum_squares(lst: [0]) == 0)\nassert(sum_squares(lst: [-1, -5, 2, -1, -5]) == -126)\nassert(sum_squares(lst: [-56, -99, 1, 0, -2]) == 3030)\nassert(sum_squares(lst: [-1, 0, 0, 0, 0, 0, 0, 0, -1]) == 0)\nassert(sum_squares(lst: [-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37]) == -14196)\nassert(sum_squares(lst: [-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10]) == -1448)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "swift", - "prompt": "\n/// triples_sum_to_zero takes a list of integers as an input.\n/// it returns True if there are three distinct elements in the list that\n/// sum to zero, and False otherwise.\n/// >>> triples_sum_to_zero([1, 3, 5, 0])\n/// False\n/// >>> triples_sum_to_zero([1, 3, -2, 1])\n/// True\n/// >>> triples_sum_to_zero([1, 2, 3, 7])\n/// False\n/// >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n/// True\n/// >>> triples_sum_to_zero([1])\n/// False\nfunc triples_sum_to_zero(l: [Int]) -> Bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(triples_sum_to_zero(l: [1, 3, 5, 0]) == false)\nassert(triples_sum_to_zero(l: [1, 3, 5, -1]) == false)\nassert(triples_sum_to_zero(l: [1, 3, -2, 1]) == true)\nassert(triples_sum_to_zero(l: [1, 2, 3, 7]) == false)\nassert(triples_sum_to_zero(l: [1, 2, 5, 7]) == false)\nassert(triples_sum_to_zero(l: [2, 4, -5, 3, 9, 7]) == true)\nassert(triples_sum_to_zero(l: [1]) == false)\nassert(triples_sum_to_zero(l: [1, 3, 5, -100]) == false)\nassert(triples_sum_to_zero(l: [100, 3, 5, -100]) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "swift", - "prompt": "\n/// brackets is a string of \"<\" and \">\".\n/// return True if every opening bracket has a corresponding closing bracket.\n/// >>> correct_bracketing(\"<\")\n/// False\n/// >>> correct_bracketing(\"<>\")\n/// True\n/// >>> correct_bracketing(\"<<><>>\")\n/// True\n/// >>> correct_bracketing(\"><<>\")\n/// False\nfunc correct_bracketing(brackets: String) -> Bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(correct_bracketing(brackets: \"<>\") == true)\nassert(correct_bracketing(brackets: \"<<><>>\") == true)\nassert(correct_bracketing(brackets: \"<><><<><>><>\") == true)\nassert(correct_bracketing(brackets: \"<><><<<><><>><>><<><><<>>>\") == true)\nassert(correct_bracketing(brackets: \"<<<><>>>>\") == false)\nassert(correct_bracketing(brackets: \"><<>\") == false)\nassert(correct_bracketing(brackets: \"<\") == false)\nassert(correct_bracketing(brackets: \"<<<<\") == false)\nassert(correct_bracketing(brackets: \">\") == false)\nassert(correct_bracketing(brackets: \"<<>\") == false)\nassert(correct_bracketing(brackets: \"<><><<><>><>><<>\") == false)\nassert(correct_bracketing(brackets: \"<><><<><>><>>><>\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "swift", - "prompt": "\n/// Write a function that takes an array of numbers as input and returns \n/// the number of elements in the array that are greater than 10 and both \n/// first and last digits of a number are odd (1, 3, 5, 7, 9).\n/// For example:\n/// specialFilter([15, -73, 14, -15]) => 1 \n/// specialFilter([33, -2, -3, 45, 21, 109]) => 2\nfunc specialFilter(nums: [Int]) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(specialFilter(nums: [5, -2, 1, -5]) == 0)\nassert(specialFilter(nums: [15, -73, 14, -15]) == 1)\nassert(specialFilter(nums: [33, -2, -3, 45, 21, 109]) == 2)\nassert(specialFilter(nums: [43, -12, 93, 125, 121, 109]) == 4)\nassert(specialFilter(nums: [71, -2, -33, 75, 21, 19]) == 3)\nassert(specialFilter(nums: [1]) == 0)\nassert(specialFilter(nums: [] as [Int]) == 0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "swift", - "prompt": "\n/// Given a dictionary, return True if all keys are strings in lower \n/// case or all keys are strings in upper case, else return False.\n/// The function should return False is the given dictionary is empty.\n/// Examples:\n/// check_dict_case({\"a\":\"apple\", \"b\":\"banana\"}) should return True.\n/// check_dict_case({\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}) should return False.\n/// check_dict_case({\"a\":\"apple\", \"8\":\"banana\", \"a\":\"apple\"}) should return False.\n/// check_dict_case({\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}) should return False.\n/// check_dict_case({\"STATE\":\"NC\", \"ZIP\":\"12345\" }) should return True.\nfunc check_dict_case(dict: [String : String]) -> Bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(check_dict_case(dict: [\"p\" : \"pineapple\", \"b\" : \"banana\"]) == true)\nassert(check_dict_case(dict: [\"p\" : \"pineapple\", \"A\" : \"banana\", \"B\" : \"banana\"]) == false)\nassert(check_dict_case(dict: [\"p\" : \"pineapple\", \"5\" : \"banana\", \"a\" : \"apple\"]) == false)\nassert(check_dict_case(dict: [\"Name\" : \"John\", \"Age\" : \"36\", \"City\" : \"Houston\"]) == false)\nassert(check_dict_case(dict: [\"STATE\" : \"NC\", \"ZIP\" : \"12345\"]) == true)\nassert(check_dict_case(dict: [\"fruit\" : \"Orange\", \"taste\" : \"Sweet\"]) == true)\nassert(check_dict_case(dict: [:] as [String : String]) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "swift", - "prompt": "\nextension Int: Error {}\n \n/// Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n/// should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n/// alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n/// Examples\n/// split_words(\"Hello world!\") \u279e [\"Hello\", \"world!\"]\n/// split_words(\"Hello,world!\") \u279e [\"Hello\", \"world!\"]\n/// split_words(\"abcdef\") == 3\nfunc split_words(txt: String) -> Result<[String], Int> {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(split_words(txt: \"Hello world!\") == .success([\"Hello\", \"world!\"]))\nassert(split_words(txt: \"Hello,world!\") == .success([\"Hello\", \"world!\"]))\nassert(split_words(txt: \"Hello world,!\") == .success([\"Hello\", \"world,!\"]))\nassert(split_words(txt: \"Hello,Hello,world !\") == .success([\"Hello,Hello,world\", \"!\"]))\nassert(split_words(txt: \"abcdef\") == .failure(3))\nassert(split_words(txt: \"aaabb\") == .failure(2))\nassert(split_words(txt: \"aaaBb\") == .failure(1))\nassert(split_words(txt: \"\") == .failure(0))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "swift", - "prompt": "\n/// The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n/// fibfib(0) == 0\n/// fibfib(1) == 0\n/// fibfib(2) == 1\n/// fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n/// Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n/// >>> fibfib(1)\n/// 0\n/// >>> fibfib(5)\n/// 4\n/// >>> fibfib(8)\n/// 24\nfunc fibfib(n: Int) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(fibfib(n: 2) == 1)\nassert(fibfib(n: 1) == 0)\nassert(fibfib(n: 5) == 4)\nassert(fibfib(n: 8) == 24)\nassert(fibfib(n: 10) == 81)\nassert(fibfib(n: 12) == 274)\nassert(fibfib(n: 14) == 927)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "swift", - "prompt": "\n/// You are given a list of numbers.\n/// You need to return the sum of squared numbers in the given list,\n/// round each element in the list to the upper int(Ceiling) first.\n/// Examples:\n/// For lst = [1,2,3] the output should be 14\n/// For lst = [1,4,9] the output should be 98\n/// For lst = [1,3,5,7] the output should be 84\n/// For lst = [1.4,4.2,0] the output should be 29\n/// For lst = [-2.4,1,1] the output should be 6\nfunc sum_squares(lst: [Double]) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sum_squares(lst: [1.0, 2.0, 3.0]) == 14)\nassert(sum_squares(lst: [1.0, 2.0, 3.0]) == 14)\nassert(sum_squares(lst: [1.0, 3.0, 5.0, 7.0]) == 84)\nassert(sum_squares(lst: [1.4, 4.2, 0.0]) == 29)\nassert(sum_squares(lst: [-2.4, 1.0, 1.0]) == 6)\nassert(sum_squares(lst: [100.0, 1.0, 15.0, 2.0]) == 10230)\nassert(sum_squares(lst: [10000.0, 10000.0]) == 200000000)\nassert(sum_squares(lst: [-1.4, 4.6, 6.3]) == 75)\nassert(sum_squares(lst: [-1.4, 17.9, 18.9, 19.9]) == 1086)\nassert(sum_squares(lst: [0.0]) == 0)\nassert(sum_squares(lst: [-1.0]) == 1)\nassert(sum_squares(lst: [-1.0, 1.0, 0.0]) == 2)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_85_add", - "language": "swift", - "prompt": "\n/// Given a non-empty list of integers lst. add the even elements that are at odd indices..\n/// Examples:\n/// add([4, 2, 6, 7]) ==> 2\nfunc add(lst: [Int]) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(add(lst: [4, 88]) == 88)\nassert(add(lst: [4, 5, 6, 7, 2, 122]) == 122)\nassert(add(lst: [4, 0, 6, 7]) == 0)\nassert(add(lst: [4, 4, 6, 8]) == 12)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "swift", - "prompt": "\n/// Return sorted unique elements in a list\n/// >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123])\n/// [0, 2, 3, 5, 9, 123]\nfunc unique(l: [Int]) -> [Int] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(unique(l: [5, 3, 5, 2, 3, 3, 9, 0, 123]) == [0, 2, 3, 5, 9, 123])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "swift", - "prompt": "\n/// Given a string text, replace all spaces in it with underscores, \n/// and if a string has more than 2 consecutive spaces, \n/// then replace all consecutive spaces with - \n/// fix_spaces(\"Example\") == \"Example\"\n/// fix_spaces(\"Example 1\") == \"Example_1\"\n/// fix_spaces(\" Example 2\") == \"_Example_2\"\n/// fix_spaces(\" Example 3\") == \"_Example-3\"\nfunc fix_spaces(text: String) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(fix_spaces(text: \"Example\") == \"Example\")\nassert(fix_spaces(text: \"Mudasir Hanif \") == \"Mudasir_Hanif_\")\nassert(fix_spaces(text: \"Yellow Yellow Dirty Fellow\") == \"Yellow_Yellow__Dirty__Fellow\")\nassert(fix_spaces(text: \"Exa mple\") == \"Exa-mple\")\nassert(fix_spaces(text: \" Exa 1 2 2 mple\") == \"-Exa_1_2_2_mple\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "swift", - "prompt": "\n/// Return 2^n modulo p (be aware of numerics).\n/// >>> modp(3, 5)\n/// 3\n/// >>> modp(1101, 101)\n/// 2\n/// >>> modp(0, 101)\n/// 1\n/// >>> modp(3, 11)\n/// 8\n/// >>> modp(100, 101)\n/// 1\nfunc modp(n: Int, p: Int) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(modp(n: 3, p: 5) == 3)\nassert(modp(n: 1101, p: 101) == 2)\nassert(modp(n: 0, p: 101) == 1)\nassert(modp(n: 3, p: 11) == 8)\nassert(modp(n: 100, p: 101) == 1)\nassert(modp(n: 30, p: 5) == 4)\nassert(modp(n: 31, p: 5) == 3)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "swift", - "prompt": "\n/// You have to write a function which validates a given date string and\n/// returns True if the date is valid otherwise False.\n/// The date is valid if all of the following rules are satisfied:\n/// 1. The date string is not empty.\n/// 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n/// 3. The months should not be less than 1 or higher than 12.\n/// 4. The date should be in the format: mm-dd-yyyy\n/// for example: \n/// valid_date('03-11-2000') => True\n/// valid_date('15-01-2012') => False\n/// valid_date('04-0-2040') => False\n/// valid_date('06-04-2020') => True\n/// valid_date('06/04/2020') => False\nfunc valid_date(date: String) -> Bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(valid_date(date: \"03-11-2000\") == true)\nassert(valid_date(date: \"15-01-2012\") == false)\nassert(valid_date(date: \"04-0-2040\") == false)\nassert(valid_date(date: \"06-04-2020\") == true)\nassert(valid_date(date: \"01-01-2007\") == true)\nassert(valid_date(date: \"03-32-2011\") == false)\nassert(valid_date(date: \"\") == false)\nassert(valid_date(date: \"04-31-3000\") == false)\nassert(valid_date(date: \"06-06-2005\") == true)\nassert(valid_date(date: \"21-31-2000\") == false)\nassert(valid_date(date: \"04-12-2003\") == true)\nassert(valid_date(date: \"04122003\") == false)\nassert(valid_date(date: \"20030412\") == false)\nassert(valid_date(date: \"2003-04\") == false)\nassert(valid_date(date: \"2003-04-12\") == false)\nassert(valid_date(date: \"04-2003\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "swift", - "prompt": "\n/// Write a function that takes a string and returns an ordered version of it.\n/// Ordered version of string, is a string where all words (separated by space)\n/// are replaced by a new word where all the characters arranged in\n/// ascending order based on ascii value.\n/// Note: You should keep the order of words and blank spaces in the sentence.\n/// For example:\n/// anti_shuffle('Hi') returns 'Hi'\n/// anti_shuffle('hello') returns 'ehllo'\n/// anti_shuffle('Hello World!!!') returns 'Hello !!!Wdlor'\nfunc anti_shuffle(s: String) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(anti_shuffle(s: \"Hi\") == \"Hi\")\nassert(anti_shuffle(s: \"hello\") == \"ehllo\")\nassert(anti_shuffle(s: \"number\") == \"bemnru\")\nassert(anti_shuffle(s: \"abcd\") == \"abcd\")\nassert(anti_shuffle(s: \"Hello World!!!\") == \"Hello !!!Wdlor\")\nassert(anti_shuffle(s: \"\") == \"\")\nassert(anti_shuffle(s: \"Hi. My name is Mister Robot. How are you?\") == \".Hi My aemn is Meirst .Rboot How aer ?ouy\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "swift", - "prompt": "\n/// Given a list of numbers, return whether or not they are sorted\n/// in ascending order. If list has more than 1 duplicate of the same\n/// number, return False. Assume no negative numbers and only integers.\n/// Examples\n/// is_sorted([5]) \u279e True\n/// is_sorted([1, 2, 3, 4, 5]) \u279e True\n/// is_sorted([1, 3, 2, 4, 5]) \u279e False\n/// is_sorted([1, 2, 3, 4, 5, 6]) \u279e True\n/// is_sorted([1, 2, 3, 4, 5, 6, 7]) \u279e True\n/// is_sorted([1, 3, 2, 4, 5, 6, 7]) \u279e False\n/// is_sorted([1, 2, 2, 3, 3, 4]) \u279e True\n/// is_sorted([1, 2, 2, 2, 3, 4]) \u279e False\nfunc is_sorted(lst: [Int]) -> Bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_sorted(lst: [5]) == true)\nassert(is_sorted(lst: [1, 2, 3, 4, 5]) == true)\nassert(is_sorted(lst: [1, 3, 2, 4, 5]) == false)\nassert(is_sorted(lst: [1, 2, 3, 4, 5, 6]) == true)\nassert(is_sorted(lst: [1, 2, 3, 4, 5, 6, 7]) == true)\nassert(is_sorted(lst: [1, 3, 2, 4, 5, 6, 7]) == false)\nassert(is_sorted(lst: [] as [Int]) == true)\nassert(is_sorted(lst: [1]) == true)\nassert(is_sorted(lst: [3, 2, 1]) == false)\nassert(is_sorted(lst: [1, 2, 2, 2, 3, 4]) == false)\nassert(is_sorted(lst: [1, 2, 3, 3, 3, 4]) == false)\nassert(is_sorted(lst: [1, 2, 2, 3, 3, 4]) == true)\nassert(is_sorted(lst: [1, 2, 3, 4]) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "swift", - "prompt": "\n/// You are given a string s.\n/// Your task is to check if the string is happy or not.\n/// A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n/// For example:\n/// is_happy(a) => False\n/// is_happy(aa) => False\n/// is_happy(abcd) => True\n/// is_happy(aabb) => False\n/// is_happy(adb) => True\n/// is_happy(xyy) => False\nfunc is_happy(s: String) -> Bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_happy(s: \"a\") == false)\nassert(is_happy(s: \"aa\") == false)\nassert(is_happy(s: \"abcd\") == true)\nassert(is_happy(s: \"aabb\") == false)\nassert(is_happy(s: \"adb\") == true)\nassert(is_happy(s: \"xyy\") == false)\nassert(is_happy(s: \"iopaxpoi\") == true)\nassert(is_happy(s: \"iopaxioi\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "swift", - "prompt": "\n/// Write a function that returns True if the object q will fly, and False otherwise.\n/// The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n/// Example:\n/// will_it_fly([1, 2], 5) \u279e False \n/// # 1+2 is less than the maximum possible weight, but it's unbalanced.\n/// will_it_fly([3, 2, 3], 1) \u279e False\n/// # it's balanced, but 3+2+3 is more than the maximum possible weight.\n/// will_it_fly([3, 2, 3], 9) \u279e True\n/// # 3+2+3 is less than the maximum possible weight, and it's balanced.\n/// will_it_fly([3], 5) \u279e True\n/// # 3 is less than the maximum possible weight, and it's balanced.\nfunc will_it_fly(q: [Int], w: Int) -> Bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(will_it_fly(q: [3, 2, 3], w: 9) == true)\nassert(will_it_fly(q: [1, 2], w: 5) == false)\nassert(will_it_fly(q: [3], w: 5) == true)\nassert(will_it_fly(q: [3, 2, 3], w: 1) == false)\nassert(will_it_fly(q: [1, 2, 3], w: 6) == false)\nassert(will_it_fly(q: [5], w: 5) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "swift", - "prompt": "\n/// Given an array of non-negative integers, return a copy of the given array after sorting,\n/// you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n/// or sort it in descending order if the sum( first index value, last index value) is even.\n/// Note:\n/// * don't change the given array.\n/// Examples:\n/// * sort_array([]) => []\n/// * sort_array([5]) => [5]\n/// * sort_array([2, 4, 3, 0, 1, 5]) => [0, 1, 2, 3, 4, 5]\n/// * sort_array([2, 4, 3, 0, 1, 5, 6]) => [6, 5, 4, 3, 2, 1, 0]\nfunc sort_array(array: [Int]) -> [Int] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sort_array(array: [] as [Int]) == [] as [Int])\nassert(sort_array(array: [5]) == [5])\nassert(sort_array(array: [2, 4, 3, 0, 1, 5]) == [0, 1, 2, 3, 4, 5])\nassert(sort_array(array: [2, 4, 3, 0, 1, 5, 6]) == [6, 5, 4, 3, 2, 1, 0])\nassert(sort_array(array: [2, 1]) == [1, 2])\nassert(sort_array(array: [15, 42, 87, 32, 11, 0]) == [0, 11, 15, 32, 42, 87])\nassert(sort_array(array: [21, 14, 23, 11]) == [23, 21, 14, 11])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "swift", - "prompt": "\n/// Implement a function that takes an non-negative integer and returns an array of the first n\n/// integers that are prime numbers and less than n.\n/// for example:\n/// count_up_to(5) => [2,3]\n/// count_up_to(11) => [2,3,5,7]\n/// count_up_to(0) => []\n/// count_up_to(20) => [2,3,5,7,11,13,17,19]\n/// count_up_to(1) => []\n/// count_up_to(18) => [2,3,5,7,11,13,17]\nfunc count_up_to(n: Int) -> [Int] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(count_up_to(n: 5) == [2, 3])\nassert(count_up_to(n: 6) == [2, 3, 5])\nassert(count_up_to(n: 7) == [2, 3, 5])\nassert(count_up_to(n: 10) == [2, 3, 5, 7])\nassert(count_up_to(n: 0) == [] as [Int])\nassert(count_up_to(n: 22) == [2, 3, 5, 7, 11, 13, 17, 19])\nassert(count_up_to(n: 1) == [] as [Int])\nassert(count_up_to(n: 18) == [2, 3, 5, 7, 11, 13, 17])\nassert(count_up_to(n: 47) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43])\nassert(count_up_to(n: 101) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "swift", - "prompt": "\n/// Out of list of strings, return the longest one. Return the first one in case of multiple\n/// strings of the same length. Return None in case the input list is empty.\n/// >>> longest([])\n/// >>> longest(['a', 'b', 'c'])\n/// 'a'\n/// >>> longest(['a', 'bb', 'ccc'])\n/// 'ccc'\nfunc longest(strings: [String]) -> String? {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(longest(strings: [] as [String]) == nil)\nassert(longest(strings: [\"x\", \"y\", \"z\"]) == \"x\")\nassert(longest(strings: [\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"]) == \"zzzz\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "swift", - "prompt": "\n/// Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n/// reverse the resulting array, and then replace each digit by its corresponding name from\n/// \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n/// For example:\n/// arr = [2, 1, 1, 4, 5, 8, 2, 3] \n/// -> sort arr -> [1, 1, 2, 2, 3, 4, 5, 8] \n/// -> reverse arr -> [8, 5, 4, 3, 2, 2, 1, 1]\n/// return [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n/// If the array is empty, return an empty array:\n/// arr = []\n/// return []\n/// If the array has any strange number ignore it:\n/// arr = [1, -1 , 55] \n/// -> sort arr -> [-1, 1, 55]\n/// -> reverse arr -> [55, 1, -1]\n/// return = ['One']\nfunc by_length(arr: [Int]) -> [String] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(by_length(arr: [2, 1, 1, 4, 5, 8, 2, 3]) == [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"])\nassert(by_length(arr: [] as [Int]) == [] as [String])\nassert(by_length(arr: [1, -1, 55]) == [\"One\"])\nassert(by_length(arr: [1, -1, 3, 2]) == [\"Three\", \"Two\", \"One\"])\nassert(by_length(arr: [9, 4, 8]) == [\"Nine\", \"Eight\", \"Four\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_106_f", - "language": "swift", - "prompt": "\n/// Implement the function f that takes n as a parameter,\n/// 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\n/// or the sum of numbers from 1 to i otherwise.\n/// i starts from 1.\n/// the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n/// Example:\n/// f(5) == [1, 2, 6, 24, 15]\nfunc f(n: Int) -> [Int] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(f(n: 5) == [1, 2, 6, 24, 15])\nassert(f(n: 7) == [1, 2, 6, 24, 15, 720, 28])\nassert(f(n: 1) == [1])\nassert(f(n: 3) == [1, 2, 6])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "swift", - "prompt": "\n/// Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n/// >>> fizz_buzz(50)\n/// 0\n/// >>> fizz_buzz(78)\n/// 2\n/// >>> fizz_buzz(79)\n/// 3\nfunc fizz_buzz(n: Int) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(fizz_buzz(n: 50) == 0)\nassert(fizz_buzz(n: 78) == 2)\nassert(fizz_buzz(n: 79) == 3)\nassert(fizz_buzz(n: 100) == 3)\nassert(fizz_buzz(n: 200) == 6)\nassert(fizz_buzz(n: 4000) == 192)\nassert(fizz_buzz(n: 10000) == 639)\nassert(fizz_buzz(n: 100000) == 8026)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "swift", - "prompt": "\n/// Given a positive floating point number, it can be decomposed into\n/// and integer part (largest integer smaller than given number) and decimals\n/// (leftover part always smaller than 1).\n/// Return the decimal part of the number.\n/// >>> truncate_number(3.5)\n/// 0.5\nfunc truncate_number(number: Double) -> Double {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(truncate_number(number: 3.5) == 0.5)\nassert(truncate_number(number: 1.25) == 0.25)\nassert(truncate_number(number: 123.0) == 0.0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "swift", - "prompt": "\n/// For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n/// Empty sum should be equal to 0 and empty product should be equal to 1.\n/// >>> sum_product([])\n/// (0, 1)\n/// >>> sum_product([1, 2, 3, 4])\n/// (10, 24)\nfunc sum_product(numbers: [Int]) -> (Int, Int) {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sum_product(numbers: [] as [Int]) == (0, 1))\nassert(sum_product(numbers: [1, 1, 1]) == (3, 1))\nassert(sum_product(numbers: [100, 0]) == (100, 0))\nassert(sum_product(numbers: [3, 5, 7]) == (15, 105))\nassert(sum_product(numbers: [10]) == (10, 10))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "swift", - "prompt": "\n/// You are given a 2 dimensional data, as a nested lists,\n/// which is similar to matrix, however, unlike matrices,\n/// each row may contain a different number of columns.\n/// Given lst, and integer x, find integers x in the list,\n/// and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n/// each tuple is a coordinate - (row, columns), starting with 0.\n/// Sort coordinates initially by rows in ascending order.\n/// Also, sort coordinates of the row by columns in descending order.\n/// Examples:\n/// get_row([\n/// [1,2,3,4,5,6],\n/// [1,2,3,4,1,6],\n/// [1,2,3,4,5,1]\n/// ], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n/// get_row([], 1) == []\n/// get_row([[], [1], [1, 2, 3]], 3) == [(2, 2)]\nfunc get_row(lst: [[Int]], x: Int) -> [(Int, Int)] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(get_row(lst: [[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], x: 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)])\nassert(get_row(lst: [[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6]], x: 2) == [(0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1)])\nassert(get_row(lst: [[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 1, 3, 4, 5, 6], [1, 2, 1, 4, 5, 6], [1, 2, 3, 1, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], x: 1) == [(0, 0), (1, 0), (2, 1), (2, 0), (3, 2), (3, 0), (4, 3), (4, 0), (5, 4), (5, 0), (6, 5), (6, 0)])\nassert(get_row(lst: [] as [[Int]], x: 1) == [] as [(Int, Int)])\nassert(get_row(lst: [[1]], x: 2) == [] as [(Int, Int)])\nassert(get_row(lst: [[] as [Int], [1], [1, 2, 3]], x: 3) == [(2, 2)])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "swift", - "prompt": "\n/// You're a hungry rabbit, and you already have eaten a certain number of carrots,\n/// but now you need to eat more carrots to complete the day's meals.\n/// you should return an array of [ total number of eaten carrots after your meals,\n/// the number of carrots left after your meals ]\n/// if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n/// Example:\n/// * eat(5, 6, 10) -> [11, 4]\n/// * eat(4, 8, 9) -> [12, 1]\n/// * eat(1, 10, 10) -> [11, 0]\n/// * eat(2, 11, 5) -> [7, 0]\n/// Variables:\n/// @number : integer\n/// the number of carrots that you have eaten.\n/// @need : integer\n/// the number of carrots that you need to eat.\n/// @remaining : integer\n/// the number of remaining carrots thet exist in stock\n/// Constrain:\n/// * 0 <= number <= 1000\n/// * 0 <= need <= 1000\n/// * 0 <= remaining <= 1000\n/// Have fun :)\nfunc eat(number: Int, need: Int, remaining: Int) -> [Int] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(eat(number: 5, need: 6, remaining: 10) == [11, 4])\nassert(eat(number: 4, need: 8, remaining: 9) == [12, 1])\nassert(eat(number: 1, need: 10, remaining: 10) == [11, 0])\nassert(eat(number: 2, need: 11, remaining: 5) == [7, 0])\nassert(eat(number: 4, need: 5, remaining: 7) == [9, 2])\nassert(eat(number: 4, need: 5, remaining: 1) == [5, 0])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "swift", - "prompt": "\n/// Given a positive integer N, return the total sum of its digits in binary.\n/// Example\n/// For N = 1000, the sum of digits will be 1 the output should be \"1\".\n/// For N = 150, the sum of digits will be 6 the output should be \"110\".\n/// For N = 147, the sum of digits will be 12 the output should be \"1100\".\n/// Variables:\n/// @N integer\n/// Constraints: 0 \u2264 N \u2264 10000.\n/// Output:\n/// a string of binary number\nfunc solve(N: Int) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(solve(N: 1000) == \"1\")\nassert(solve(N: 150) == \"110\")\nassert(solve(N: 147) == \"1100\")\nassert(solve(N: 333) == \"1001\")\nassert(solve(N: 963) == \"10010\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "swift", - "prompt": "\n/// You are given a list of integers.\n/// You need to find the largest prime value and return the sum of its digits.\n/// Examples:\n/// For lst = [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] the output should be 10\n/// For lst = [1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1] the output should be 25\n/// For lst = [1,3,1,32,5107,34,83278,109,163,23,2323,32,30,1,9,3] the output should be 13\n/// For lst = [0,724,32,71,99,32,6,0,5,91,83,0,5,6] the output should be 11\n/// For lst = [0,81,12,3,1,21] the output should be 3\n/// For lst = [0,8,1,2,1,7] the output should be 7\nfunc skjkasdkd(lst: [Int]) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(skjkasdkd(lst: [0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]) == 10)\nassert(skjkasdkd(lst: [1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]) == 25)\nassert(skjkasdkd(lst: [1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]) == 13)\nassert(skjkasdkd(lst: [0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]) == 11)\nassert(skjkasdkd(lst: [0, 81, 12, 3, 1, 21]) == 3)\nassert(skjkasdkd(lst: [0, 8, 1, 2, 1, 7]) == 7)\nassert(skjkasdkd(lst: [8191]) == 19)\nassert(skjkasdkd(lst: [8191, 123456, 127, 7]) == 19)\nassert(skjkasdkd(lst: [127, 97, 8192]) == 10)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "swift", - "prompt": "\n/// Given an array arr of integers, find the minimum number of elements that\n/// need to be changed to make the array palindromic. A palindromic array is an array that\n/// is read the same backwards and forwards. In one change, you can change one element to any other element.\n/// For example:\n/// smallest_change([1,2,3,5,4,7,9,6]) == 4\n/// smallest_change([1, 2, 3, 4, 3, 2, 2]) == 1\n/// smallest_change([1, 2, 3, 2, 1]) == 0\nfunc smallest_change(arr: [Int]) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(smallest_change(arr: [1, 2, 3, 5, 4, 7, 9, 6]) == 4)\nassert(smallest_change(arr: [1, 2, 3, 4, 3, 2, 2]) == 1)\nassert(smallest_change(arr: [1, 4, 2]) == 1)\nassert(smallest_change(arr: [1, 4, 4, 2]) == 1)\nassert(smallest_change(arr: [1, 2, 3, 2, 1]) == 0)\nassert(smallest_change(arr: [3, 1, 1, 3]) == 0)\nassert(smallest_change(arr: [1]) == 0)\nassert(smallest_change(arr: [0, 1]) == 1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "swift", - "prompt": "\n/// It is the last week of the semester and the teacher has to give the grades\n/// to students. The teacher has been making her own algorithm for grading.\n/// The only problem is, she has lost the code she used for grading.\n/// She has given you a list of GPAs for some students and you have to write \n/// a function that can output a list of letter grades using the following table:\n/// GPA | Letter grade\n/// 4.0 A+\n/// > 3.7 A \n/// > 3.3 A- \n/// > 3.0 B+\n/// > 2.7 B \n/// > 2.3 B-\n/// > 2.0 C+\n/// > 1.7 C\n/// > 1.3 C-\n/// > 1.0 D+ \n/// > 0.7 D \n/// > 0.0 D-\n/// 0.0 E\n/// Example:\n/// grade_equation([4.0, 3, 1.7, 2, 3.5]) ==> ['A+', 'B', 'C-', 'C', 'A-']\nfunc numerical_letter_grade(grades: [Double]) -> [String] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(numerical_letter_grade(grades: [4.0, 3, 1.7, 2, 3.5]) == [\"A+\", \"B\", \"C-\", \"C\", \"A-\"])\nassert(numerical_letter_grade(grades: [1.2]) == [\"D+\"])\nassert(numerical_letter_grade(grades: [0.5]) == [\"D-\"])\nassert(numerical_letter_grade(grades: [0.0]) == [\"E\"])\nassert(numerical_letter_grade(grades: [1.0, 0.3, 1.5, 2.8, 3.3]) == [\"D\", \"D-\", \"C-\", \"B\", \"B+\"])\nassert(numerical_letter_grade(grades: [0.0, 0.7]) == [\"E\", \"D-\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "swift", - "prompt": "\n/// Given the lengths of the three sides of a triangle. Return the area of\n/// the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n/// Otherwise return -1\n/// Three sides make a valid triangle when the sum of any two sides is greater \n/// than the third side.\n/// Example:\n/// triangle_area(3, 4, 5) == 6.00\n/// triangle_area(1, 2, 10) == -1\nfunc triangle_area(a: Int, b: Int, c: Int) -> Double {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(triangle_area(a: 3, b: 4, c: 5) == 6.0)\nassert(triangle_area(a: 1, b: 2, c: 10) == -1)\nassert(triangle_area(a: 4, b: 8, c: 5) == 8.18)\nassert(triangle_area(a: 2, b: 2, c: 2) == 1.73)\nassert(triangle_area(a: 1, b: 2, c: 3) == -1)\nassert(triangle_area(a: 10, b: 5, c: 7) == 16.25)\nassert(triangle_area(a: 2, b: 6, c: 3) == -1)\nassert(triangle_area(a: 1, b: 1, c: 1) == 0.43)\nassert(triangle_area(a: 2, b: 2, c: 10) == -1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "swift", - "prompt": "\n/// Check if two words have the same characters.\n/// >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n/// True\n/// >>> same_chars('abcd', 'dddddddabc')\n/// True\n/// >>> same_chars('dddddddabc', 'abcd')\n/// True\n/// >>> same_chars('eabcd', 'dddddddabc')\n/// False\n/// >>> same_chars('abcd', 'dddddddabce')\n/// False\n/// >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc')\n/// False\nfunc same_chars(s0: String, s1: String) -> Bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(same_chars(s0: \"eabcdzzzz\", s1: \"dddzzzzzzzddeddabc\") == true)\nassert(same_chars(s0: \"abcd\", s1: \"dddddddabc\") == true)\nassert(same_chars(s0: \"dddddddabc\", s1: \"abcd\") == true)\nassert(same_chars(s0: \"eabcd\", s1: \"dddddddabc\") == false)\nassert(same_chars(s0: \"abcd\", s1: \"dddddddabcf\") == false)\nassert(same_chars(s0: \"eabcdzzzz\", s1: \"dddzzzzzzzddddabc\") == false)\nassert(same_chars(s0: \"aabb\", s1: \"aaccc\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "swift", - "prompt": "\n/// Given an array of integers nums, find the minimum sum of any non-empty sub-array\n/// of nums.\n/// Example\n/// minSubArraySum([2, 3, 4, 1, 2, 4]) == 1\n/// minSubArraySum([-1, -2, -3]) == -6\nfunc minSubArraySum(nums: [Int]) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(minSubArraySum(nums: [2, 3, 4, 1, 2, 4]) == 1)\nassert(minSubArraySum(nums: [-1, -2, -3]) == -6)\nassert(minSubArraySum(nums: [-1, -2, -3, 2, -10]) == -14)\nassert(minSubArraySum(nums: [-9999999999999999]) == -9999999999999999)\nassert(minSubArraySum(nums: [0, 10, 20, 1000000]) == 0)\nassert(minSubArraySum(nums: [-1, -2, -3, 10, -5]) == -6)\nassert(minSubArraySum(nums: [100, -1, -2, -3, 10, -5]) == -6)\nassert(minSubArraySum(nums: [10, 11, 13, 8, 3, 4]) == 3)\nassert(minSubArraySum(nums: [100, -33, 32, -1, 0, -2]) == -33)\nassert(minSubArraySum(nums: [-10]) == -10)\nassert(minSubArraySum(nums: [7]) == 7)\nassert(minSubArraySum(nums: [1, -1]) == -1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "swift", - "prompt": "\n/// Given a string s and a natural number n, you have been tasked to implement \n/// a function that returns a list of all words from string s that contain exactly \n/// n consonants, in order these words appear in the string s.\n/// If the string s is empty then the function should return an empty list.\n/// Note: you may assume the input string contains only letters and spaces.\n/// Examples:\n/// select_words(\"Mary had a little lamb\", 4) ==> [\"little\"]\n/// select_words(\"Mary had a little lamb\", 3) ==> [\"Mary\", \"lamb\"]\n/// select_words(\"simple white space\", 2) ==> []\n/// select_words(\"Hello world\", 4) ==> [\"world\"]\n/// select_words(\"Uncle sam\", 3) ==> [\"Uncle\"]\nfunc select_words(s: String, n: Int) -> [String] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(select_words(s: \"Mary had a little lamb\", n: 4) == [\"little\"])\nassert(select_words(s: \"Mary had a little lamb\", n: 3) == [\"Mary\", \"lamb\"])\nassert(select_words(s: \"simple white space\", n: 2) == [] as [String])\nassert(select_words(s: \"Hello world\", n: 4) == [\"world\"])\nassert(select_words(s: \"Uncle sam\", n: 3) == [\"Uncle\"])\nassert(select_words(s: \"\", n: 4) == [] as [String])\nassert(select_words(s: \"a b c d e f\", n: 1) == [\"b\", \"c\", \"d\", \"f\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "swift", - "prompt": "\n/// Return list of all prefixes from shortest to longest of the input string\n/// >>> all_prefixes('abc')\n/// ['a', 'ab', 'abc']\nfunc all_prefixes(string: String) -> [String] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(all_prefixes(string: \"\") == [] as [String])\nassert(all_prefixes(string: \"asdfgh\") == [\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"])\nassert(all_prefixes(string: \"WWW\") == [\"W\", \"WW\", \"WWW\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "swift", - "prompt": "\n/// Create a function that takes a value (string) representing a number\n/// and returns the closest integer to it. If the number is equidistant\n/// from two integers, round it away from zero.\n/// Examples\n/// >>> closest_integer(\"10\")\n/// 10\n/// >>> closest_integer(\"15.3\")\n/// 15\n/// Note:\n/// Rounding away from zero means that if the given number is equidistant\n/// from two integers, the one you should return is the one that is the\n/// farthest from zero. For example closest_integer(\"14.5\") should\n/// return 15 and closest_integer(\"-14.5\") should return -15.\nfunc closest_integer(value: String) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(closest_integer(value: \"10\") == 10)\nassert(closest_integer(value: \"14.5\") == 15)\nassert(closest_integer(value: \"-15.5\") == -16)\nassert(closest_integer(value: \"15.3\") == 15)\nassert(closest_integer(value: \"0\") == 0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "swift", - "prompt": "\n/// Create a function which takes a string representing a file's name, and returns\n/// 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n/// A file's name is considered to be valid if and only if all the following conditions \n/// are met:\n/// - There should not be more than three digits ('0'-'9') in the file's name.\n/// - The file's name contains exactly one dot '.'\n/// - The substring before the dot should not be empty, and it starts with a letter from \n/// the latin alphapet ('a'-'z' and 'A'-'Z').\n/// - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n/// Examples:\n/// file_name_check(\"example.txt\") # => 'Yes'\n/// file_name_check(\"1example.dll\") # => 'No' (the name should start with a latin alphapet letter)\nfunc file_name_check(file_name: String) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(file_name_check(file_name: \"example.txt\") == \"Yes\")\nassert(file_name_check(file_name: \"1example.dll\") == \"No\")\nassert(file_name_check(file_name: \"s1sdf3.asd\") == \"No\")\nassert(file_name_check(file_name: \"K.dll\") == \"Yes\")\nassert(file_name_check(file_name: \"MY16FILE3.exe\") == \"Yes\")\nassert(file_name_check(file_name: \"His12FILE94.exe\") == \"No\")\nassert(file_name_check(file_name: \"_Y.txt\") == \"No\")\nassert(file_name_check(file_name: \"?aREYA.exe\") == \"No\")\nassert(file_name_check(file_name: \"/this_is_valid.dll\") == \"No\")\nassert(file_name_check(file_name: \"this_is_valid.wow\") == \"No\")\nassert(file_name_check(file_name: \"this_is_valid.txt\") == \"Yes\")\nassert(file_name_check(file_name: \"this_is_valid.txtexe\") == \"No\")\nassert(file_name_check(file_name: \"#this2_i4s_5valid.ten\") == \"No\")\nassert(file_name_check(file_name: \"@this1_is6_valid.exe\") == \"No\")\nassert(file_name_check(file_name: \"this_is_12valid.6exe4.txt\") == \"No\")\nassert(file_name_check(file_name: \"all.exe.txt\") == \"No\")\nassert(file_name_check(file_name: \"I563_No.exe\") == \"Yes\")\nassert(file_name_check(file_name: \"Is3youfault.txt\") == \"Yes\")\nassert(file_name_check(file_name: \"no_one#knows.dll\") == \"Yes\")\nassert(file_name_check(file_name: \"1I563_Yes3.exe\") == \"No\")\nassert(file_name_check(file_name: \"I563_Yes3.txtt\") == \"No\")\nassert(file_name_check(file_name: \"final..txt\") == \"No\")\nassert(file_name_check(file_name: \"final132\") == \"No\")\nassert(file_name_check(file_name: \"_f4indsartal132.\") == \"No\")\nassert(file_name_check(file_name: \".txt\") == \"No\")\nassert(file_name_check(file_name: \"s.\") == \"No\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "swift", - "prompt": "\n/// You are given two intervals,\n/// where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n/// The given intervals are closed which means that the interval (start, end)\n/// includes both start and end.\n/// For each given interval, it is assumed that its start is less or equal its end.\n/// Your task is to determine whether the length of intersection of these two \n/// intervals is a prime number.\n/// Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n/// which its length is 1, which not a prime number.\n/// If the length of the intersection is a prime number, return \"YES\",\n/// otherwise, return \"NO\".\n/// If the two intervals don't intersect, return \"NO\".\n/// [input/output] samples:\n/// intersection((1, 2), (2, 3)) ==> \"NO\"\n/// intersection((-1, 1), (0, 4)) ==> \"NO\"\n/// intersection((-3, -1), (-5, 5)) ==> \"YES\"\nfunc intersection(interval1: (Int, Int), interval2: (Int, Int)) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(intersection(interval1: (1, 2), interval2: (2, 3)) == \"NO\")\nassert(intersection(interval1: (-1, 1), interval2: (0, 4)) == \"NO\")\nassert(intersection(interval1: (-3, -1), interval2: (-5, 5)) == \"YES\")\nassert(intersection(interval1: (-2, 2), interval2: (-4, 0)) == \"YES\")\nassert(intersection(interval1: (-11, 2), interval2: (-1, -1)) == \"NO\")\nassert(intersection(interval1: (1, 2), interval2: (3, 5)) == \"NO\")\nassert(intersection(interval1: (1, 2), interval2: (1, 2)) == \"NO\")\nassert(intersection(interval1: (-2, -2), interval2: (-3, -2)) == \"NO\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "swift", - "prompt": "\n/// Return the largest prime factor of n. Assume n > 1 and is not a prime.\n/// >>> largest_prime_factor(13195)\n/// 29\n/// >>> largest_prime_factor(2048)\n/// 2\nfunc largest_prime_factor(n: Int) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(largest_prime_factor(n: 15) == 5)\nassert(largest_prime_factor(n: 27) == 3)\nassert(largest_prime_factor(n: 63) == 7)\nassert(largest_prime_factor(n: 330) == 11)\nassert(largest_prime_factor(n: 13195) == 29)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "swift", - "prompt": "\n/// Given a string, find out how many distinct characters (regardless of case) does it consist of\n/// >>> count_distinct_characters('xyzXYZ')\n/// 3\n/// >>> count_distinct_characters('Jerry')\n/// 4\nfunc count_distinct_characters(string: String) -> Int {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(count_distinct_characters(string: \"\") == 0)\nassert(count_distinct_characters(string: \"abcde\") == 5)\nassert(count_distinct_characters(string: \"abcdecadeCADE\") == 5)\nassert(count_distinct_characters(string: \"aaaaAAAAaaaa\") == 1)\nassert(count_distinct_characters(string: \"Jerry jERRY JeRRRY\") == 5)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "swift", - "prompt": "\n/// You're given a list of deposit and withdrawal operations on a bank account that starts with\n/// zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n/// at that point function should return True. Otherwise it should return False.\n/// >>> below_zero([1, 2, 3])\n/// False\n/// >>> below_zero([1, 2, -4, 5])\n/// True\nfunc below_zero(operations: [Int]) -> Bool {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(below_zero(operations: [] as [Int]) == false)\nassert(below_zero(operations: [1, 2, -3, 1, 2, -3]) == false)\nassert(below_zero(operations: [1, 2, -4, 5, 6]) == true)\nassert(below_zero(operations: [1, -1, 2, -2, 5, -5, 4, -4]) == false)\nassert(below_zero(operations: [1, -1, 2, -2, 5, -5, 4, -5]) == true)\nassert(below_zero(operations: [1, -2, 2, -2, 5, -5, 4, -4]) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "swift", - "prompt": "\n/// Find the shortest palindrome that begins with a supplied string.\n/// Algorithm idea is simple:\n/// - Find the longest postfix of supplied string that is a palindrome.\n/// - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n/// >>> make_palindrome('')\n/// ''\n/// >>> make_palindrome('cat')\n/// 'catac'\n/// >>> make_palindrome('cata')\n/// 'catac'\nfunc make_palindrome(string: String) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(make_palindrome(string: \"\") == \"\")\nassert(make_palindrome(string: \"x\") == \"x\")\nassert(make_palindrome(string: \"xyz\") == \"xyzyx\")\nassert(make_palindrome(string: \"xyx\") == \"xyx\")\nassert(make_palindrome(string: \"jerry\") == \"jerryrrej\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "swift", - "prompt": "\n/// Given a positive integer, obtain its roman numeral equivalent as a string,\n/// and return it in lowercase.\n/// Restrictions: 1 <= num <= 1000\n/// Examples:\n/// >>> int_to_mini_roman(19) == 'xix'\n/// >>> int_to_mini_roman(152) == 'clii'\n/// >>> int_to_mini_roman(426) == 'cdxxvi'\nfunc int_to_mini_roman(number: Int) -> String {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(int_to_mini_roman(number: 19) == \"xix\")\nassert(int_to_mini_roman(number: 152) == \"clii\")\nassert(int_to_mini_roman(number: 251) == \"ccli\")\nassert(int_to_mini_roman(number: 426) == \"cdxxvi\")\nassert(int_to_mini_roman(number: 500) == \"d\")\nassert(int_to_mini_roman(number: 1) == \"i\")\nassert(int_to_mini_roman(number: 4) == \"iv\")\nassert(int_to_mini_roman(number: 43) == \"xliii\")\nassert(int_to_mini_roman(number: 90) == \"xc\")\nassert(int_to_mini_roman(number: 94) == \"xciv\")\nassert(int_to_mini_roman(number: 532) == \"dxxxii\")\nassert(int_to_mini_roman(number: 900) == \"cm\")\nassert(int_to_mini_roman(number: 994) == \"cmxciv\")\nassert(int_to_mini_roman(number: 1000) == \"m\")", - "stop_tokens": [ - "\n}" - ] - } -] \ No newline at end of file diff --git a/data/swift-remove.json b/data/swift-remove.json deleted file mode 100644 index b20aa11f5fb76b97713ee718d4eb06ee892a5fa3..0000000000000000000000000000000000000000 --- a/data/swift-remove.json +++ /dev/null @@ -1,1898 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "swift", - "prompt": "\n/// For a given number n, find the largest number that divides n evenly, smaller than n\nfunc largest_divisor(n: Int) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(largest_divisor(n: 3) == 1)\nassert(largest_divisor(n: 7) == 1)\nassert(largest_divisor(n: 10) == 5)\nassert(largest_divisor(n: 100) == 50)\nassert(largest_divisor(n: 49) == 7)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_47_median", - "language": "swift", - "prompt": "\n/// Return median of elements in the list l.\nfunc median(l: [Int]) -> Double {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(median(l: [3, 1, 2, 4, 5]) == 3)\nassert(median(l: [-10, 4, 6, 1000, 10, 20]) == 8.0)\nassert(median(l: [5]) == 5)\nassert(median(l: [6, 5]) == 5.5)\nassert(median(l: [8, 1, 3, 9, 9, 2, 7]) == 7)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "swift", - "prompt": "\n/// Return maximum element in the list.\nfunc max_element(l: [Int]) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(max_element(l: [1, 2, 3]) == 3)\nassert(max_element(l: [5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]) == 124)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "swift", - "prompt": "\n/// Create a function which returns the largest index of an element which\n/// is not greater than or equal to the element immediately preceding it. If\n/// no such element exists then return -1. The given array will not contain\n/// duplicate values.\n/// Examples:\nfunc can_arrange(arr: [Int]) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(can_arrange(arr: [1, 2, 4, 3, 5]) == 3)\nassert(can_arrange(arr: [1, 2, 4, 5]) == -1)\nassert(can_arrange(arr: [1, 4, 2, 5, 6, 7, 8, 9, 10]) == 2)\nassert(can_arrange(arr: [4, 8, 5, 7, 3]) == 4)\nassert(can_arrange(arr: [] as [Int]) == -1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "swift", - "prompt": "\n/// Create a function that returns True if the last character\n/// of a given string is an alphabetical character and is not\n/// a part of a word, and False otherwise.\n/// Note: \"word\" is a group of characters separated by space.\n/// Examples:\nfunc check_if_last_char_is_a_letter(txt: String) -> Bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(check_if_last_char_is_a_letter(txt: \"apple\") == false)\nassert(check_if_last_char_is_a_letter(txt: \"apple pi e\") == true)\nassert(check_if_last_char_is_a_letter(txt: \"eeeee\") == false)\nassert(check_if_last_char_is_a_letter(txt: \"A\") == true)\nassert(check_if_last_char_is_a_letter(txt: \"Pumpkin pie \") == false)\nassert(check_if_last_char_is_a_letter(txt: \"Pumpkin pie 1\") == false)\nassert(check_if_last_char_is_a_letter(txt: \"\") == false)\nassert(check_if_last_char_is_a_letter(txt: \"eeeee e \") == false)\nassert(check_if_last_char_is_a_letter(txt: \"apple pie\") == false)\nassert(check_if_last_char_is_a_letter(txt: \"apple pi e \") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "swift", - "prompt": "\n/// Return true if a given number is prime, and false otherwise.\nfunc is_prime(n: Int) -> Bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_prime(n: 6) == false)\nassert(is_prime(n: 101) == true)\nassert(is_prime(n: 11) == true)\nassert(is_prime(n: 13441) == true)\nassert(is_prime(n: 61) == true)\nassert(is_prime(n: 4) == false)\nassert(is_prime(n: 1) == false)\nassert(is_prime(n: 5) == true)\nassert(is_prime(n: 11) == true)\nassert(is_prime(n: 17) == true)\nassert(is_prime(n: 85) == false)\nassert(is_prime(n: 77) == false)\nassert(is_prime(n: 255379) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "swift", - "prompt": "\n/// Given a list of positive integers x. return a sorted list of all \n/// elements that hasn't any even digit.\n/// Note: Returned list should be sorted in increasing order.\n/// For example:\nfunc unique_digits(x: [Int]) -> [Int] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(unique_digits(x: [15, 33, 1422, 1]) == [1, 15, 33])\nassert(unique_digits(x: [152, 323, 1422, 10]) == [] as [Int])\nassert(unique_digits(x: [12345, 2033, 111, 151]) == [111, 151])\nassert(unique_digits(x: [135, 103, 31]) == [31, 135])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "swift", - "prompt": "\n/// Input are two strings a and b consisting only of 1s and 0s.\n/// Perform binary XOR on these inputs and return result also as a string.\nfunc string_xor(a: String, b: String) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(string_xor(a: \"111000\", b: \"101010\") == \"010010\")\nassert(string_xor(a: \"1\", b: \"1\") == \"0\")\nassert(string_xor(a: \"0101\", b: \"0000\") == \"0101\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "swift", - "prompt": "\n/// sum_to_n is a function that sums numbers from 1 to n.\nfunc sum_to_n(n: Int) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sum_to_n(n: 1) == 1)\nassert(sum_to_n(n: 6) == 21)\nassert(sum_to_n(n: 11) == 66)\nassert(sum_to_n(n: 30) == 465)\nassert(sum_to_n(n: 100) == 5050)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "swift", - "prompt": "\n/// Given a list of numbers, return the sum of squares of the numbers\n/// in the list that are odd. Ignore numbers that are negative or not integers.\n/// If the input list is empty, return 0.\nfunc double_the_difference(lst: [Double]) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(double_the_difference(lst: [] as [Double]) == 0)\nassert(double_the_difference(lst: [5.0, 4.0]) == 25)\nassert(double_the_difference(lst: [0.1, 0.2, 0.3]) == 0)\nassert(double_the_difference(lst: [-10.0, -20.0, -30.0]) == 0)\nassert(double_the_difference(lst: [-1.0, -2.0, 8.0]) == 0)\nassert(double_the_difference(lst: [0.2, 3.0, 5.0]) == 34)\nassert(double_the_difference(lst: [-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]) == 165)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "swift", - "prompt": "\n/// Return length of given string\nfunc strlen(string: String) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(strlen(string: \"\") == 0)\nassert(strlen(string: \"x\") == 1)\nassert(strlen(string: \"asdasnakj\") == 9)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "swift", - "prompt": "\n/// You'll be given a string of words, and your task is to count the number\n/// of boredoms. A boredom is a sentence that starts with the word \"I\".\n/// Sentences are delimited by '.', '?' or '!'.\n/// For example:\nfunc is_bored(S: String) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_bored(S: \"Hello world\") == 0)\nassert(is_bored(S: \"Is the sky blue?\") == 0)\nassert(is_bored(S: \"I love It !\") == 1)\nassert(is_bored(S: \"bIt\") == 0)\nassert(is_bored(S: \"I feel good today. I will be productive. will kill It\") == 2)\nassert(is_bored(S: \"You and I are going for a walk\") == 0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "swift", - "prompt": "\n/// Write a function vowels_count which takes a string representing\n/// a word as input and returns the number of vowels in the string.\n/// Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n/// vowel, but only when it is at the end of the given word.\n/// Example:\nfunc vowels_count(s: String) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(vowels_count(s: \"abcde\") == 2)\nassert(vowels_count(s: \"Alone\") == 3)\nassert(vowels_count(s: \"key\") == 2)\nassert(vowels_count(s: \"bye\") == 1)\nassert(vowels_count(s: \"keY\") == 2)\nassert(vowels_count(s: \"bYe\") == 1)\nassert(vowels_count(s: \"ACEDY\") == 3)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "swift", - "prompt": "\n/// Return n-th Fibonacci number.\nfunc fib(n: Int) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(fib(n: 10) == 55)\nassert(fib(n: 1) == 1)\nassert(fib(n: 8) == 21)\nassert(fib(n: 11) == 89)\nassert(fib(n: 12) == 144)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "swift", - "prompt": "\n/// Your task is to implement a function that will simplify the expression\n/// x * n. The function returns True if x * n evaluates to a whole number and False\n/// otherwise. Both x and n, are string representation of a fraction, and have the following format,\n/// / where both numerator and denominator are positive whole numbers.\n/// You can assume that x, and n are valid fractions, and do not have zero as denominator.\nfunc simplify(x: String, n: String) -> Bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(simplify(x: \"1/5\", n: \"5/1\") == true)\nassert(simplify(x: \"1/6\", n: \"2/1\") == false)\nassert(simplify(x: \"5/1\", n: \"3/1\") == true)\nassert(simplify(x: \"7/10\", n: \"10/2\") == false)\nassert(simplify(x: \"2/10\", n: \"50/10\") == true)\nassert(simplify(x: \"7/2\", n: \"4/2\") == true)\nassert(simplify(x: \"11/6\", n: \"6/1\") == true)\nassert(simplify(x: \"2/3\", n: \"5/2\") == false)\nassert(simplify(x: \"5/2\", n: \"3/5\") == false)\nassert(simplify(x: \"2/4\", n: \"8/4\") == true)\nassert(simplify(x: \"2/4\", n: \"4/2\") == true)\nassert(simplify(x: \"1/5\", n: \"5/1\") == true)\nassert(simplify(x: \"1/5\", n: \"1/5\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "swift", - "prompt": "\n/// Given a string s, count the number of uppercase vowels in even indices.\n/// For example:\nfunc count_upper(s: String) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(count_upper(s: \"aBCdEf\") == 1)\nassert(count_upper(s: \"abcdefg\") == 0)\nassert(count_upper(s: \"dBBE\") == 0)\nassert(count_upper(s: \"B\") == 0)\nassert(count_upper(s: \"U\") == 1)\nassert(count_upper(s: \"\") == 0)\nassert(count_upper(s: \"EEEE\") == 2)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "swift", - "prompt": "\n/// You are given a rectangular grid of wells. Each row represents a single well,\n/// and each 1 in a row represents a single unit of water.\n/// Each well has a corresponding bucket that can be used to extract water from it, \n/// and all buckets have the same capacity.\n/// Your task is to use the buckets to empty the wells.\n/// Output the number of times you need to lower the buckets.\n/// Example 1:\n/// Example 2:\n/// Example 3:\n/// Constraints:\n/// * all wells have the same length\n/// * 1 <= grid.length <= 10^2\n/// * 1 <= grid[:,1].length <= 10^2\n/// * grid[i][j] -> 0 | 1\n/// * 1 <= capacity <= 10\nfunc max_fill(grid: [[Int]], capacity: Int) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(max_fill(grid: [[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], capacity: 1) == 6)\nassert(max_fill(grid: [[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], capacity: 2) == 5)\nassert(max_fill(grid: [[0, 0, 0], [0, 0, 0]], capacity: 5) == 0)\nassert(max_fill(grid: [[1, 1, 1, 1], [1, 1, 1, 1]], capacity: 2) == 4)\nassert(max_fill(grid: [[1, 1, 1, 1], [1, 1, 1, 1]], capacity: 9) == 2)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "swift", - "prompt": "\n/// Given an array arr of integers and a positive integer k, return a sorted list \n/// of length k with the maximum k numbers in arr.\n/// Example 1:\n/// Example 2:\n/// Example 3:\n/// Note:\n/// 1. The length of the array will be in the range of [1, 1000].\n/// 2. The elements in the array will be in the range of [-1000, 1000].\n/// 3. 0 <= k <= len(arr)\nfunc maximum(arr: [Int], k: Int) -> [Int] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(maximum(arr: [-3, -4, 5], k: 3) == [-4, -3, 5])\nassert(maximum(arr: [4, -4, 4], k: 2) == [4, 4])\nassert(maximum(arr: [-3, 2, 1, 2, -1, -2, 1], k: 1) == [2])\nassert(maximum(arr: [123, -123, 20, 0, 1, 2, -3], k: 3) == [2, 20, 123])\nassert(maximum(arr: [-123, 20, 0, 1, 2, -3], k: 4) == [0, 1, 2, 20])\nassert(maximum(arr: [5, 15, 0, 3, -13, -8, 0], k: 7) == [-13, -8, 0, 0, 3, 5, 15])\nassert(maximum(arr: [-1, 0, 2, 5, 3, -10], k: 2) == [3, 5])\nassert(maximum(arr: [1, 0, 5, -7], k: 1) == [5])\nassert(maximum(arr: [4, -4], k: 2) == [-4, 4])\nassert(maximum(arr: [-10, 10], k: 2) == [-10, 10])\nassert(maximum(arr: [1, 2, 3, -23, 243, -400, 0], k: 0) == [] as [Int])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "swift", - "prompt": "\n/// Write a function that takes a message, and encodes in such a \n/// way that it swaps case of all letters, replaces all vowels in \n/// the message with the letter that appears 2 places ahead of that \n/// vowel in the english alphabet. \n/// Assume only letters. \n/// Examples:\nfunc encode(message: String) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(encode(message: \"TEST\") == \"tgst\")\nassert(encode(message: \"Mudasir\") == \"mWDCSKR\")\nassert(encode(message: \"YES\") == \"ygs\")\nassert(encode(message: \"This is a message\") == \"tHKS KS C MGSSCGG\")\nassert(encode(message: \"I DoNt KnOw WhAt tO WrItE\") == \"k dQnT kNqW wHcT Tq wRkTg\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "swift", - "prompt": "\n/// remove_vowels is a function that takes string and returns string without vowels.\nfunc remove_vowels(text: String) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(remove_vowels(text: \"\") == \"\")\nassert(remove_vowels(text: \"abcdef\\nghijklm\") == \"bcdf\\nghjklm\")\nassert(remove_vowels(text: \"fedcba\") == \"fdcb\")\nassert(remove_vowels(text: \"eeeee\") == \"\")\nassert(remove_vowels(text: \"acBAA\") == \"cB\")\nassert(remove_vowels(text: \"EcBOO\") == \"cB\")\nassert(remove_vowels(text: \"ybcd\") == \"ybcd\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "swift", - "prompt": "\n/// Return only positive numbers in the list.\nfunc get_positive(l: [Int]) -> [Int] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(get_positive(l: [-1, -2, 4, 5, 6]) == [4, 5, 6])\nassert(get_positive(l: [5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]) == [5, 3, 2, 3, 3, 9, 123, 1])\nassert(get_positive(l: [-1, -2]) == [] as [Int])\nassert(get_positive(l: [] as [Int]) == [] as [Int])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "swift", - "prompt": "\n/// Return a string containing space-delimited numbers starting from 0 upto n inclusive.\nfunc string_sequence(n: Int) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(string_sequence(n: 0) == \"0\")\nassert(string_sequence(n: 3) == \"0 1 2 3\")\nassert(string_sequence(n: 10) == \"0 1 2 3 4 5 6 7 8 9 10\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "swift", - "prompt": "\n/// Given a positive integer n, you have to make a pile of n levels of stones.\n/// The first level has n stones.\n/// The number of stones in the next level is:\n/// - the next odd number if n is odd.\n/// - the next even number if n is even.\n/// Return the number of stones in each level in a list, where element at index\n/// i represents the number of stones in the level (i+1).\n/// Examples:\nfunc make_a_pile(n: Int) -> [Int] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(make_a_pile(n: 3) == [3, 5, 7])\nassert(make_a_pile(n: 4) == [4, 6, 8, 10])\nassert(make_a_pile(n: 5) == [5, 7, 9, 11, 13])\nassert(make_a_pile(n: 6) == [6, 8, 10, 12, 14, 16])\nassert(make_a_pile(n: 8) == [8, 10, 12, 14, 16, 18, 20, 22])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "swift", - "prompt": "\n/// Task\n/// 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\n/// then check if the result string is palindrome.\n/// A string is called palindrome if it reads the same backward as forward.\n/// You should return a tuple containing the result string and True/False for the check.\n/// Example\nfunc reverse_delete(s: String, c: String) -> (String, Bool) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(reverse_delete(s: \"abcde\", c: \"ae\") == (\"bcd\", false))\nassert(reverse_delete(s: \"abcdef\", c: \"b\") == (\"acdef\", false))\nassert(reverse_delete(s: \"abcdedcba\", c: \"ab\") == (\"cdedc\", true))\nassert(reverse_delete(s: \"dwik\", c: \"w\") == (\"dik\", false))\nassert(reverse_delete(s: \"a\", c: \"a\") == (\"\", true))\nassert(reverse_delete(s: \"abcdedcba\", c: \"\") == (\"abcdedcba\", true))\nassert(reverse_delete(s: \"abcdedcba\", c: \"v\") == (\"abcdedcba\", true))\nassert(reverse_delete(s: \"vabba\", c: \"v\") == (\"abba\", true))\nassert(reverse_delete(s: \"mamma\", c: \"mia\") == (\"\", true))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "swift", - "prompt": "\n/// For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\nfunc flip_case(string: String) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(flip_case(string: \"\") == \"\")\nassert(flip_case(string: \"Hello!\") == \"hELLO!\")\nassert(flip_case(string: \"These violent delights have violent ends\") == \"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "swift", - "prompt": "\n/// You are given a string s.\n/// if s[i] is a letter, reverse its case from lower to upper or vise versa, \n/// otherwise keep it as it is.\n/// If the string contains no letters, reverse the string.\n/// The function should return the resulted string.\n/// Examples\nfunc solve(s: String) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(solve(s: \"AsDf\") == \"aSdF\")\nassert(solve(s: \"1234\") == \"4321\")\nassert(solve(s: \"ab\") == \"AB\")\nassert(solve(s: \"#a@C\") == \"#A@c\")\nassert(solve(s: \"#AsdfW^45\") == \"#aSDFw^45\")\nassert(solve(s: \"#6@2\") == \"2@6#\")\nassert(solve(s: \"#$a^D\") == \"#$A^d\")\nassert(solve(s: \"#ccc\") == \"#CCC\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "swift", - "prompt": "\n/// Filter an input list of strings only for ones that start with a given prefix.\nfunc filter_by_prefix(strings: [String], prefix: String) -> [String] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(filter_by_prefix(strings: [] as [String], prefix: \"john\") == [] as [String])\nassert(filter_by_prefix(strings: [\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], prefix: \"xxx\") == [\"xxx\", \"xxxAAA\", \"xxx\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "swift", - "prompt": "\n/// This function takes two positive numbers x and y and returns the\n/// biggest even integer number that is in the range [x, y] inclusive. If \n/// there's no such number, then the function should return -1.\n/// For example:\nfunc choose_num(x: Int, y: Int) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(choose_num(x: 12, y: 15) == 14)\nassert(choose_num(x: 13, y: 12) == -1)\nassert(choose_num(x: 33, y: 12354) == 12354)\nassert(choose_num(x: 5234, y: 5233) == -1)\nassert(choose_num(x: 6, y: 29) == 28)\nassert(choose_num(x: 27, y: 10) == -1)\nassert(choose_num(x: 7, y: 7) == -1)\nassert(choose_num(x: 546, y: 546) == 546)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "swift", - "prompt": "\n/// You are given a string representing a sentence,\n/// the sentence contains some words separated by a space,\n/// and you have to return a string that contains the words from the original sentence,\n/// whose lengths are prime numbers,\n/// the order of the words in the new string should be the same as the original one.\n/// Example 1:\n/// Example 2:\n/// Constraints:\n/// * 1 <= len(sentence) <= 100\n/// * sentence contains only letters\nfunc words_in_sentence(sentence: String) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(words_in_sentence(sentence: \"This is a test\") == \"is\")\nassert(words_in_sentence(sentence: \"lets go for swimming\") == \"go for\")\nassert(words_in_sentence(sentence: \"there is no place available here\") == \"there is no place\")\nassert(words_in_sentence(sentence: \"Hi I am Hussein\") == \"Hi am Hussein\")\nassert(words_in_sentence(sentence: \"go for it\") == \"go for it\")\nassert(words_in_sentence(sentence: \"here\") == \"\")\nassert(words_in_sentence(sentence: \"here is\") == \"is\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "swift", - "prompt": "\n/// Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\nfunc intersperse(numbers: [Int], delimeter: Int) -> [Int] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(intersperse(numbers: [] as [Int], delimeter: 7) == [] as [Int])\nassert(intersperse(numbers: [5, 6, 3, 2], delimeter: 8) == [5, 8, 6, 8, 3, 8, 2])\nassert(intersperse(numbers: [2, 2, 2], delimeter: 2) == [2, 2, 2, 2, 2])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "swift", - "prompt": "\n/// Your task is to write a function that returns true if a number x is a simple\n/// power of n and false in other cases.\n/// x is a simple power of n if n**int=x\n/// For example:\nfunc is_simple_power(x: Int, n: Int) -> Bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_simple_power(x: 16, n: 2) == true)\nassert(is_simple_power(x: 143214, n: 16) == false)\nassert(is_simple_power(x: 4, n: 2) == true)\nassert(is_simple_power(x: 9, n: 3) == true)\nassert(is_simple_power(x: 16, n: 4) == true)\nassert(is_simple_power(x: 24, n: 2) == false)\nassert(is_simple_power(x: 128, n: 4) == false)\nassert(is_simple_power(x: 12, n: 6) == false)\nassert(is_simple_power(x: 1, n: 1) == true)\nassert(is_simple_power(x: 1, n: 12) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "swift", - "prompt": "\n/// Write a function that returns true if the given number is the multiplication of 3 prime numbers\n/// and false otherwise.\n/// Knowing that (a) is less then 100. \n/// Example:\n/// 30 = 2 * 3 * 5\nfunc is_multiply_prime(a: Int) -> Bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_multiply_prime(a: 5) == false)\nassert(is_multiply_prime(a: 30) == true)\nassert(is_multiply_prime(a: 8) == true)\nassert(is_multiply_prime(a: 10) == false)\nassert(is_multiply_prime(a: 125) == true)\nassert(is_multiply_prime(a: 105) == true)\nassert(is_multiply_prime(a: 126) == false)\nassert(is_multiply_prime(a: 729) == false)\nassert(is_multiply_prime(a: 891) == false)\nassert(is_multiply_prime(a: 1001) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "swift", - "prompt": "\n/// Given the lengths of the three sides of a triangle. Return True if the three\n/// sides form a right-angled triangle, False otherwise.\n/// A right-angled triangle is a triangle in which one angle is right angle or \n/// 90 degree.\n/// Example:\nfunc right_angle_triangle(a: Int, b: Int, c: Int) -> Bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(right_angle_triangle(a: 3, b: 4, c: 5) == true)\nassert(right_angle_triangle(a: 1, b: 2, c: 3) == false)\nassert(right_angle_triangle(a: 10, b: 6, c: 8) == true)\nassert(right_angle_triangle(a: 2, b: 2, c: 2) == false)\nassert(right_angle_triangle(a: 7, b: 24, c: 25) == true)\nassert(right_angle_triangle(a: 10, b: 5, c: 7) == false)\nassert(right_angle_triangle(a: 5, b: 12, c: 13) == true)\nassert(right_angle_triangle(a: 15, b: 8, c: 17) == true)\nassert(right_angle_triangle(a: 48, b: 55, c: 73) == true)\nassert(right_angle_triangle(a: 1, b: 1, c: 1) == false)\nassert(right_angle_triangle(a: 2, b: 2, c: 10) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "swift", - "prompt": "\n/// Create a function that takes 3 numbers.\n/// Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n/// Returns false in any other cases.\n/// Examples\nfunc any_int(x: Double, y: Double, z: Double) -> Bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(any_int(x: 2, y: 3, z: 1) == true)\nassert(any_int(x: 2.5, y: 2, z: 3) == false)\nassert(any_int(x: 1.5, y: 5, z: 3.5) == false)\nassert(any_int(x: 2, y: 6, z: 2) == false)\nassert(any_int(x: 4, y: 2, z: 2) == true)\nassert(any_int(x: 2.2, y: 2.2, z: 2.2) == false)\nassert(any_int(x: -4, y: 6, z: 2) == true)\nassert(any_int(x: 2, y: 1, z: 1) == true)\nassert(any_int(x: 3, y: 4, z: 7) == true)\nassert(any_int(x: 3.0, y: 4, z: 7) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "swift", - "prompt": "\n/// This function takes a list l and returns a list l' such that\n/// l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n/// to the values of the corresponding indicies of l, but sorted.\nfunc sort_third(l: [Int]) -> [Int] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sort_third(l: [5, 6, 3, 4, 8, 9, 2]) == [2, 6, 3, 4, 8, 9, 5])\nassert(sort_third(l: [5, 8, 3, 4, 6, 9, 2]) == [2, 8, 3, 4, 6, 9, 5])\nassert(sort_third(l: [5, 6, 9, 4, 8, 3, 2]) == [2, 6, 9, 4, 8, 3, 5])\nassert(sort_third(l: [5, 6, 3, 4, 8, 9, 2, 1]) == [2, 6, 3, 4, 8, 9, 5, 1])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_53_add", - "language": "swift", - "prompt": "\n/// Add two numbers x and y\nfunc add(x: Int, y: Int) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(add(x: 0, y: 1) == 1)\nassert(add(x: 1, y: 0) == 1)\nassert(add(x: 2, y: 3) == 5)\nassert(add(x: 5, y: 7) == 12)\nassert(add(x: 7, y: 5) == 12)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_69_search", - "language": "swift", - "prompt": "\n/// You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n/// zero, and has a frequency greater than or equal to the value of the integer itself. \n/// The frequency of an integer is the number of times it appears in the list.\n/// If no such a value exist, return -1.\n/// Examples:\nfunc search(lst: [Int]) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(search(lst: [5, 5, 5, 5, 1]) == 1)\nassert(search(lst: [4, 1, 4, 1, 4, 4]) == 4)\nassert(search(lst: [3, 3]) == -1)\nassert(search(lst: [8, 8, 8, 8, 8, 8, 8, 8]) == 8)\nassert(search(lst: [2, 3, 3, 2, 2]) == 2)\nassert(search(lst: [2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]) == 1)\nassert(search(lst: [3, 2, 8, 2]) == 2)\nassert(search(lst: [6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]) == 1)\nassert(search(lst: [8, 8, 3, 6, 5, 6, 4]) == -1)\nassert(search(lst: [6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]) == 1)\nassert(search(lst: [1, 9, 10, 1, 3]) == 1)\nassert(search(lst: [6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]) == 5)\nassert(search(lst: [1]) == 1)\nassert(search(lst: [8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]) == 4)\nassert(search(lst: [2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]) == 2)\nassert(search(lst: [1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]) == 1)\nassert(search(lst: [9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]) == 4)\nassert(search(lst: [2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]) == 4)\nassert(search(lst: [9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]) == 2)\nassert(search(lst: [5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]) == -1)\nassert(search(lst: [10]) == -1)\nassert(search(lst: [9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]) == 2)\nassert(search(lst: [5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]) == 1)\nassert(search(lst: [7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]) == 1)\nassert(search(lst: [3, 10, 10, 9, 2]) == -1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "swift", - "prompt": "\n/// Write a function that takes a string and returns True if the string\n/// length is a prime number or False otherwise\n/// Examples\nfunc prime_length(string: String) -> Bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(prime_length(string: \"Hello\") == true)\nassert(prime_length(string: \"abcdcba\") == true)\nassert(prime_length(string: \"kittens\") == true)\nassert(prime_length(string: \"orange\") == false)\nassert(prime_length(string: \"wow\") == true)\nassert(prime_length(string: \"world\") == true)\nassert(prime_length(string: \"MadaM\") == true)\nassert(prime_length(string: \"Wow\") == true)\nassert(prime_length(string: \"\") == false)\nassert(prime_length(string: \"HI\") == true)\nassert(prime_length(string: \"go\") == true)\nassert(prime_length(string: \"gogo\") == false)\nassert(prime_length(string: \"aaaaaaaaaaaaaaa\") == false)\nassert(prime_length(string: \"Madam\") == true)\nassert(prime_length(string: \"M\") == false)\nassert(prime_length(string: \"0\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_58_common", - "language": "swift", - "prompt": "\n/// Return sorted unique common elements for two lists.\nfunc common(l1: [Int], l2: [Int]) -> [Int] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(common(l1: [1, 4, 3, 34, 653, 2, 5], l2: [5, 7, 1, 5, 9, 653, 121]) == [1, 5, 653])\nassert(common(l1: [5, 3, 2, 8], l2: [3, 2]) == [2, 3])\nassert(common(l1: [4, 3, 2, 8], l2: [3, 2, 4]) == [2, 3, 4])\nassert(common(l1: [4, 3, 2, 8], l2: [] as [Int]) == [] as [Int])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "swift", - "prompt": "\n/// The Brazilian factorial is defined as:\n/// brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n/// where n > 0\n/// For example:\n/// The function will receive an integer as input and should return the special\n/// factorial of this integer.\nfunc special_factorial(n: Int) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(special_factorial(n: 4) == 288)\nassert(special_factorial(n: 5) == 34560)\nassert(special_factorial(n: 7) == 125411328000)\nassert(special_factorial(n: 1) == 1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "swift", - "prompt": "\n/// In this problem, you will implement a function that takes two lists of numbers,\n/// and determines whether it is possible to perform an exchange of elements\n/// between them to make lst1 a list of only even numbers.\n/// There is no limit on the number of exchanged elements between lst1 and lst2.\n/// If it is possible to exchange elements between the lst1 and lst2 to make\n/// all the elements of lst1 to be even, return \"YES\".\n/// Otherwise, return \"NO\".\n/// For example:\n/// It is assumed that the input lists will be non-empty.\nfunc exchange(lst1: [Int], lst2: [Int]) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(exchange(lst1: [1, 2, 3, 4], lst2: [1, 2, 3, 4]) == \"YES\")\nassert(exchange(lst1: [1, 2, 3, 4], lst2: [1, 5, 3, 4]) == \"NO\")\nassert(exchange(lst1: [1, 2, 3, 4], lst2: [2, 1, 4, 3]) == \"YES\")\nassert(exchange(lst1: [5, 7, 3], lst2: [2, 6, 4]) == \"YES\")\nassert(exchange(lst1: [5, 7, 3], lst2: [2, 6, 3]) == \"NO\")\nassert(exchange(lst1: [3, 2, 6, 1, 8, 9], lst2: [3, 5, 5, 1, 1, 1]) == \"NO\")\nassert(exchange(lst1: [100, 200], lst2: [200, 200]) == \"YES\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "swift", - "prompt": "\n/// Given a non-empty array of integers arr and an integer k, return\n/// the sum of the elements with at most two digits from the first k elements of arr.\n/// Example:\n/// Constraints:\n/// 1. 1 <= len(arr) <= 100\n/// 2. 1 <= k <= len(arr)\nfunc add_elements(arr: [Int], k: Int) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(add_elements(arr: [1, -2, -3, 41, 57, 76, 87, 88, 99], k: 3) == -4)\nassert(add_elements(arr: [111, 121, 3, 4000, 5, 6], k: 2) == 0)\nassert(add_elements(arr: [11, 21, 3, 90, 5, 6, 7, 8, 9], k: 4) == 125)\nassert(add_elements(arr: [111, 21, 3, 4000, 5, 6, 7, 8, 9], k: 4) == 24)\nassert(add_elements(arr: [1], k: 1) == 1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "swift", - "prompt": "\n/// A simple program which should return the value of x if n is \n/// a prime number and should return the value of y otherwise.\n/// Examples:\nfunc x_or_y(n: Int, x: Int, y: Int) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(x_or_y(n: 7, x: 34, y: 12) == 34)\nassert(x_or_y(n: 15, x: 8, y: 5) == 5)\nassert(x_or_y(n: 3, x: 33, y: 5212) == 33)\nassert(x_or_y(n: 1259, x: 3, y: 52) == 3)\nassert(x_or_y(n: 7919, x: -1, y: 12) == -1)\nassert(x_or_y(n: 3609, x: 1245, y: 583) == 583)\nassert(x_or_y(n: 91, x: 56, y: 129) == 129)\nassert(x_or_y(n: 6, x: 34, y: 1234) == 1234)\nassert(x_or_y(n: 1, x: 2, y: 0) == 0)\nassert(x_or_y(n: 2, x: 2, y: 0) == 2)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "swift", - "prompt": "\n/// Given length of a side and high return area for a triangle.\nfunc triangle_area(a: Int, h: Int) -> Double {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(triangle_area(a: 5, h: 3) == 7.5)\nassert(triangle_area(a: 2, h: 2) == 2.0)\nassert(triangle_area(a: 10, h: 8) == 40.0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "swift", - "prompt": "\n/// Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n/// the last couple centuries. However, what people don't know is Tribonacci sequence.\n/// Tribonacci sequence is defined by the recurrence:\n/// tri(1) = 3\n/// tri(n) = 1 + n / 2, if n is even.\n/// tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n/// For example:\n/// tri(2) = 1 + (2 / 2) = 2\n/// tri(4) = 3\n/// tri(3) = tri(2) + tri(1) + tri(4)\n/// = 2 + 3 + 3 = 8 \n/// You are given a non-negative integer number n, you have to a return a list of the \n/// first n + 1 numbers of the Tribonacci sequence.\n/// Examples:\nfunc tri(n: Int) -> [Int] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(tri(n: 3) == [1, 3, 2, 8])\nassert(tri(n: 4) == [1, 3, 2, 8, 3])\nassert(tri(n: 5) == [1, 3, 2, 8, 3, 15])\nassert(tri(n: 6) == [1, 3, 2, 8, 3, 15, 4])\nassert(tri(n: 7) == [1, 3, 2, 8, 3, 15, 4, 24])\nassert(tri(n: 8) == [1, 3, 2, 8, 3, 15, 4, 24, 5])\nassert(tri(n: 9) == [1, 3, 2, 8, 3, 15, 4, 24, 5, 35])\nassert(tri(n: 20) == [1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11])\nassert(tri(n: 0) == [1])\nassert(tri(n: 1) == [1, 3])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "swift", - "prompt": "\n/// You are given a list of two strings, both strings consist of open\n/// parentheses '(' or close parentheses ')' only.\n/// Your job is to check if it is possible to concatenate the two strings in\n/// some order, that the resulting string will be good.\n/// A string S is considered to be good if and only if all parentheses in S\n/// are balanced. For example: the string '(())()' is good, while the string\n/// '())' is not.\n/// Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n/// Examples:\nfunc match_parens(lst: [String]) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(match_parens(lst: [\"()(\", \")\"]) == \"Yes\")\nassert(match_parens(lst: [\")\", \")\"]) == \"No\")\nassert(match_parens(lst: [\"(()(())\", \"())())\"]) == \"No\")\nassert(match_parens(lst: [\")())\", \"(()()(\"]) == \"Yes\")\nassert(match_parens(lst: [\"(())))\", \"(()())((\"]) == \"Yes\")\nassert(match_parens(lst: [\"()\", \"())\"]) == \"No\")\nassert(match_parens(lst: [\"(()(\", \"()))()\"]) == \"Yes\")\nassert(match_parens(lst: [\"((((\", \"((())\"]) == \"No\")\nassert(match_parens(lst: [\")(()\", \"(()(\"]) == \"No\")\nassert(match_parens(lst: [\")(\", \")(\"]) == \"No\")\nassert(match_parens(lst: [\"(\", \")\"]) == \"Yes\")\nassert(match_parens(lst: [\")\", \"(\"]) == \"Yes\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "swift", - "prompt": "\n/// From a list of integers, remove all elements that occur more than once.\n/// Keep order of elements left the same as in the input.\nfunc remove_duplicates(numbers: [Int]) -> [Int] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(remove_duplicates(numbers: [] as [Int]) == [] as [Int])\nassert(remove_duplicates(numbers: [1, 2, 3, 4]) == [1, 2, 3, 4])\nassert(remove_duplicates(numbers: [1, 2, 3, 2, 4, 3, 5]) == [1, 4, 5])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "swift", - "prompt": "\n/// Return a greatest common divisor of two integers a and b\nfunc greatest_common_divisor(a: Int, b: Int) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(greatest_common_divisor(a: 3, b: 7) == 1)\nassert(greatest_common_divisor(a: 10, b: 15) == 5)\nassert(greatest_common_divisor(a: 49, b: 14) == 7)\nassert(greatest_common_divisor(a: 144, b: 60) == 12)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "swift", - "prompt": "\n/// Checks if given string is a palindrome\nfunc is_palindrome(text: String) -> Bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_palindrome(text: \"\") == true)\nassert(is_palindrome(text: \"aba\") == true)\nassert(is_palindrome(text: \"aaaaa\") == true)\nassert(is_palindrome(text: \"zbcd\") == false)\nassert(is_palindrome(text: \"xywyx\") == true)\nassert(is_palindrome(text: \"xywyz\") == false)\nassert(is_palindrome(text: \"xywzx\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "swift", - "prompt": "\n/// xs represent coefficients of a polynomial.\n/// xs[0] + xs[1] * x + xs[2] * x^2 + ....\n/// Return derivative of this polynomial in the same form.\nfunc derivative(xs: [Int]) -> [Int] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(derivative(xs: [3, 1, 2, 4, 5]) == [1, 4, 12, 20])\nassert(derivative(xs: [1, 2, 3]) == [2, 6])\nassert(derivative(xs: [3, 2, 1]) == [2, 2])\nassert(derivative(xs: [3, 2, 1, 0, 4]) == [2, 2, 0, 16])\nassert(derivative(xs: [1]) == [] as [Int])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "swift", - "prompt": "\n/// In this task, you will be given a string that represents a number of apples and oranges \n/// that are distributed in a basket of fruit this basket contains \n/// apples, oranges, and mango fruits. Given the string that represents the total number of \n/// the oranges and apples and an integer that represent the total number of the fruits \n/// in the basket return the number of the mango fruits in the basket.\n/// for examble:\nfunc fruit_distribution(s: String, n: Int) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(fruit_distribution(s: \"5 apples and 6 oranges\", n: 19) == 8)\nassert(fruit_distribution(s: \"5 apples and 6 oranges\", n: 21) == 10)\nassert(fruit_distribution(s: \"0 apples and 1 oranges\", n: 3) == 2)\nassert(fruit_distribution(s: \"1 apples and 0 oranges\", n: 3) == 2)\nassert(fruit_distribution(s: \"2 apples and 3 oranges\", n: 100) == 95)\nassert(fruit_distribution(s: \"2 apples and 3 oranges\", n: 5) == 0)\nassert(fruit_distribution(s: \"1 apples and 100 oranges\", n: 120) == 19)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "swift", - "prompt": "\n/// Write a function that takes an integer a and returns True \n/// if this ingeger is a cube of some integer number.\n/// Note: you may assume the input is always valid.\n/// Examples:\nfunc iscube(a: Int) -> Bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(iscube(a: 1) == true)\nassert(iscube(a: 2) == false)\nassert(iscube(a: -1) == true)\nassert(iscube(a: 64) == true)\nassert(iscube(a: 180) == false)\nassert(iscube(a: 1000) == true)\nassert(iscube(a: 0) == true)\nassert(iscube(a: 1729) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "swift", - "prompt": "\n/// In this Kata, you have to sort an array of non-negative integers according to\n/// number of ones in their binary representation in ascending order.\n/// For similar number of ones, sort based on decimal value.\n/// It must be implemented like this:\nfunc sort_array(arr: [Int]) -> [Int] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sort_array(arr: [1, 5, 2, 3, 4]) == [1, 2, 4, 3, 5])\nassert(sort_array(arr: [-2, -3, -4, -5, -6]) == [-4, -2, -6, -5, -3])\nassert(sort_array(arr: [1, 0, 2, 3, 4]) == [0, 1, 2, 4, 3])\nassert(sort_array(arr: [] as [Int]) == [] as [Int])\nassert(sort_array(arr: [2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]) == [2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77])\nassert(sort_array(arr: [3, 6, 44, 12, 32, 5]) == [32, 3, 5, 6, 12, 44])\nassert(sort_array(arr: [2, 4, 8, 16, 32]) == [2, 4, 8, 16, 32])\nassert(sort_array(arr: [2, 4, 8, 16, 32]) == [2, 4, 8, 16, 32])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "swift", - "prompt": "\n/// Given a list of strings, where each string consists of only digits, return a list.\n/// Each element i of the output should be \"the number of odd elements in the\n/// string i of the input.\" where all the i's should be replaced by the number\n/// of odd digits in the i'th string of the input.\nfunc odd_count(lst: [String]) -> [String] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(odd_count(lst: [\"1234567\"]) == [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"])\nassert(odd_count(lst: [\"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.\"])\nassert(odd_count(lst: [\"271\", \"137\", \"314\"]) == [\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "swift", - "prompt": "\n/// brackets is a string of \"(\" and \")\".\n/// return True if every opening bracket has a corresponding closing bracket.\nfunc correct_bracketing(brackets: String) -> Bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(correct_bracketing(brackets: \"()\") == true)\nassert(correct_bracketing(brackets: \"(()())\") == true)\nassert(correct_bracketing(brackets: \"()()(()())()\") == true)\nassert(correct_bracketing(brackets: \"()()((()()())())(()()(()))\") == true)\nassert(correct_bracketing(brackets: \"((()())))\") == false)\nassert(correct_bracketing(brackets: \")(()\") == false)\nassert(correct_bracketing(brackets: \"(\") == false)\nassert(correct_bracketing(brackets: \"((((\") == false)\nassert(correct_bracketing(brackets: \")\") == false)\nassert(correct_bracketing(brackets: \"(()\") == false)\nassert(correct_bracketing(brackets: \"()()(()())())(()\") == false)\nassert(correct_bracketing(brackets: \"()()(()())()))()\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "swift", - "prompt": "\n/// Task\n/// Write a function that takes a string as input and returns the sum of the upper characters only'\n/// ASCII codes.\n/// Examples:\nfunc digitSum(s: String) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(digitSum(s: \"\") == 0)\nassert(digitSum(s: \"abAB\") == 131)\nassert(digitSum(s: \"abcCd\") == 67)\nassert(digitSum(s: \"helloE\") == 69)\nassert(digitSum(s: \"woArBld\") == 131)\nassert(digitSum(s: \"aAaaaXa\") == 153)\nassert(digitSum(s: \" How are yOu?\") == 151)\nassert(digitSum(s: \"You arE Very Smart\") == 327)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "swift", - "prompt": "\n/// Write a function that accepts a list of strings as a parameter,\n/// deletes the strings that have odd lengths from it,\n/// and returns the resulted list with a sorted order,\n/// The list is always a list of strings and never an array of numbers,\n/// and it may contain duplicates.\n/// The order of the list should be ascending by length of each word, and you\n/// should return the list sorted by that rule.\n/// If two words have the same length, sort the list alphabetically.\n/// The function should return a list of strings in sorted order.\n/// You may assume that all words will have the same length.\n/// For example:\nfunc sorted_list_sum(lst: [String]) -> [String] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sorted_list_sum(lst: [\"aa\", \"a\", \"aaa\"]) == [\"aa\"])\nassert(sorted_list_sum(lst: [\"school\", \"AI\", \"asdf\", \"b\"]) == [\"AI\", \"asdf\", \"school\"])\nassert(sorted_list_sum(lst: [\"d\", \"b\", \"c\", \"a\"]) == [] as [String])\nassert(sorted_list_sum(lst: [\"d\", \"dcba\", \"abcd\", \"a\"]) == [\"abcd\", \"dcba\"])\nassert(sorted_list_sum(lst: [\"AI\", \"ai\", \"au\"]) == [\"AI\", \"ai\", \"au\"])\nassert(sorted_list_sum(lst: [\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"]) == [] as [String])\nassert(sorted_list_sum(lst: [\"aaaa\", \"bbbb\", \"dd\", \"cc\"]) == [\"cc\", \"dd\", \"aaaa\", \"bbbb\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "swift", - "prompt": "\n/// You are given an array arr of integers and you need to return\n/// sum of magnitudes of integers multiplied by product of all signs\n/// of each number in the array, represented by 1, -1 or 0.\n/// Note: return None for empty arr.\n/// Example:\nfunc prod_signs(arr: [Int]) -> Int? {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(prod_signs(arr: [1, 2, 2, -4]) == -9)\nassert(prod_signs(arr: [0, 1]) == 0)\nassert(prod_signs(arr: [1, 1, 1, 2, 3, -1, 1]) == -10)\nassert(prod_signs(arr: [] as [Int]) == nil)\nassert(prod_signs(arr: [2, 4, 1, 2, -1, -1, 9]) == 20)\nassert(prod_signs(arr: [-1, 1, -1, 1]) == 4)\nassert(prod_signs(arr: [-1, 1, 1, 1]) == -4)\nassert(prod_signs(arr: [-1, 1, 1, 0]) == 0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "swift", - "prompt": "\n/// Return list with elements incremented by 1.\nfunc incr_list(l: [Int]) -> [Int] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(incr_list(l: [] as [Int]) == [] as [Int])\nassert(incr_list(l: [3, 2, 1]) == [4, 3, 2])\nassert(incr_list(l: [5, 2, 5, 2, 3, 3, 9, 0, 123]) == [6, 3, 6, 3, 4, 4, 10, 1, 124])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "swift", - "prompt": "\n/// From a given list of integers, generate a list of rolling maximum element found until given moment\n/// in the sequence.\nfunc rolling_max(numbers: [Int]) -> [Int] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(rolling_max(numbers: [] as [Int]) == [] as [Int])\nassert(rolling_max(numbers: [1, 2, 3, 4]) == [1, 2, 3, 4])\nassert(rolling_max(numbers: [4, 3, 2, 1]) == [4, 4, 4, 4])\nassert(rolling_max(numbers: [3, 2, 3, 100, 3]) == [3, 3, 3, 100, 100])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "swift", - "prompt": "\n/// Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n/// separate those group into separate strings and return the list of those.\n/// Separate groups are balanced (each open brace is properly closed) and not nested within each other\n/// Ignore any spaces in the input string.\nfunc separate_paren_groups(paren_string: String) -> [String] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(separate_paren_groups(paren_string: \"(()()) ((())) () ((())()())\") == [\"(()())\", \"((()))\", \"()\", \"((())()())\"])\nassert(separate_paren_groups(paren_string: \"() (()) ((())) (((())))\") == [\"()\", \"(())\", \"((()))\", \"(((())))\"])\nassert(separate_paren_groups(paren_string: \"(()(())((())))\") == [\"(()(())((())))\"])\nassert(separate_paren_groups(paren_string: \"( ) (( )) (( )( ))\") == [\"()\", \"(())\", \"(()())\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "swift", - "prompt": "\n/// You will be given a string of words separated by commas or spaces. Your task is\n/// to split the string into words and return an array of the words.\n/// For example:\nfunc words_string(s: String) -> [String] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(words_string(s: \"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"])\nassert(words_string(s: \"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"])\nassert(words_string(s: \"Hi, my name\") == [\"Hi\", \"my\", \"name\"])\nassert(words_string(s: \"One,, two, three, four, five, six,\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"])\nassert(words_string(s: \"\") == [] as [String])\nassert(words_string(s: \"ahmed , gamal\") == [\"ahmed\", \"gamal\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "swift", - "prompt": "\nenum Value: Equatable, Hashable {\n case intValue(Int)\n case doubleValue(Double)\n case stringValue(String)\n}\n\n \n/// Create a function that takes integers, floats, or strings representing\n/// real numbers, and returns the larger variable in its given variable type.\n/// Return None if the values are equal.\n/// Note: If a real number is represented as a string, the floating point might be . or ,\nfunc compare_one(a: Value, b: Value) -> Value? {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(compare_one(a: .intValue(1), b: .intValue(2)) == .intValue(2))\nassert(compare_one(a: .intValue(1), b: .doubleValue(2.5)) == .doubleValue(2.5))\nassert(compare_one(a: .intValue(2), b: .intValue(3)) == .intValue(3))\nassert(compare_one(a: .intValue(5), b: .intValue(6)) == .intValue(6))\nassert(compare_one(a: .intValue(1), b: .stringValue(\"2,3\")) == .stringValue(\"2,3\"))\nassert(compare_one(a: .stringValue(\"5,1\"), b: .stringValue(\"6\")) == .stringValue(\"6\"))\nassert(compare_one(a: .stringValue(\"1\"), b: .stringValue(\"2\")) == .stringValue(\"2\"))\nassert(compare_one(a: .stringValue(\"1\"), b: .intValue(1)) == nil)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "swift", - "prompt": "\n/// Filter given list of any python values only for integers\nfunc filter_integers(values: [AnyHashable]) -> [Int] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(filter_integers(values: [] as [AnyHashable]) == [] as [Int])\nassert(filter_integers(values: [4, [:] as [AnyHashable : AnyHashable], [] as [AnyHashable], 23.2, 9, \"adasd\"]) == [4, 9])\nassert(filter_integers(values: [3, \"c\", 3, 3, \"a\", \"b\"]) == [3, 3, 3])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "swift", - "prompt": "\n/// This function takes a list l and returns a list l' such that\n/// l' is identical to l in the odd indicies, while its values at the even indicies are equal\n/// to the values of the even indicies of l, but sorted.\nfunc sort_even(l: [Int]) -> [Int] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sort_even(l: [1, 2, 3]) == [1, 2, 3])\nassert(sort_even(l: [5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]) == [-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123])\nassert(sort_even(l: [5, 8, -12, 4, 23, 2, 3, 11, 12, -10]) == [-12, 8, 3, 4, 5, 2, 12, 11, 23, -10])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "swift", - "prompt": "\n/// I think we all remember that feeling when the result of some long-awaited\n/// event is finally known. The feelings and thoughts you have at that moment are\n/// definitely worth noting down and comparing.\n/// Your task is to determine if a person correctly guessed the results of a number of matches.\n/// You are given two arrays of scores and guesses of equal length, where each index shows a match. \n/// Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n/// the value is 0, and if not, the value is the absolute difference between the guess and the score.\n/// example:\nfunc compare(game: [Int], guess: [Int]) -> [Int] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(compare(game: [1, 2, 3, 4, 5, 1], guess: [1, 2, 3, 4, 2, -2]) == [0, 0, 0, 0, 3, 3])\nassert(compare(game: [0, 0, 0, 0, 0, 0], guess: [0, 0, 0, 0, 0, 0]) == [0, 0, 0, 0, 0, 0])\nassert(compare(game: [1, 2, 3], guess: [-1, -2, -3]) == [2, 4, 6])\nassert(compare(game: [1, 2, 3, 5], guess: [-1, 2, 3, 4]) == [2, 0, 0, 1])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "swift", - "prompt": "\n/// Given a positive integer n, return a tuple that has the number of even and odd\n/// integer palindromes that fall within the range(1, n), inclusive.\n/// Example 1:\n/// Explanation:\n/// Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n/// Example 2:\n/// Explanation:\n/// Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n/// Note:\n/// 1. 1 <= n <= 10^3\n/// 2. returned tuple has the number of even and odd integer palindromes respectively.\nfunc even_odd_palindrome(n: Int) -> (Int, Int) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(even_odd_palindrome(n: 123) == (8, 13))\nassert(even_odd_palindrome(n: 12) == (4, 6))\nassert(even_odd_palindrome(n: 3) == (1, 2))\nassert(even_odd_palindrome(n: 63) == (6, 8))\nassert(even_odd_palindrome(n: 25) == (5, 6))\nassert(even_odd_palindrome(n: 19) == (4, 6))\nassert(even_odd_palindrome(n: 9) == (4, 5))\nassert(even_odd_palindrome(n: 1) == (0, 1))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "swift", - "prompt": "\n/// The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n/// fib4(0) -> 0\n/// fib4(1) -> 0\n/// fib4(2) -> 2\n/// fib4(3) -> 0\n/// fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n/// Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\nfunc fib4(n: Int) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(fib4(n: 5) == 4)\nassert(fib4(n: 8) == 28)\nassert(fib4(n: 10) == 104)\nassert(fib4(n: 12) == 386)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "swift", - "prompt": "\n/// Given two positive integers a and b, return the even digits between a\n/// and b, in ascending order.\n/// For example:\nfunc generate_integers(a: Int, b: Int) -> [Int] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(generate_integers(a: 2, b: 10) == [2, 4, 6, 8])\nassert(generate_integers(a: 10, b: 2) == [2, 4, 6, 8])\nassert(generate_integers(a: 132, b: 2) == [2, 4, 6, 8])\nassert(generate_integers(a: 17, b: 89) == [] as [Int])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "swift", - "prompt": "\n/// For a given list of input numbers, calculate Mean Absolute Deviation\n/// around the mean of this dataset.\n/// Mean Absolute Deviation is the average absolute difference between each\n/// element and a centerpoint (mean in this case):\n/// MAD = average | x - x_mean |\nfunc mean_absolute_deviation(numbers: [Double]) -> Double {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(mean_absolute_deviation(numbers: [1.0, 2.0]) == 0.5)\nassert(mean_absolute_deviation(numbers: [1.0, 2.0, 3.0, 4.0]) == 1.0)\nassert(mean_absolute_deviation(numbers: [1.0, 2.0, 3.0, 4.0, 5.0]) == 1.2)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "swift", - "prompt": "\n/// Create a function encrypt that takes a string as an argument and\n/// returns a string encrypted with the alphabet being rotated. \n/// The alphabet should be rotated in a manner such that the letters \n/// shift down by two multiplied to two places.\n/// For example:\nfunc encrypt(s: String) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(encrypt(s: \"hi\") == \"lm\")\nassert(encrypt(s: \"asdfghjkl\") == \"ewhjklnop\")\nassert(encrypt(s: \"gf\") == \"kj\")\nassert(encrypt(s: \"et\") == \"ix\")\nassert(encrypt(s: \"faewfawefaewg\") == \"jeiajeaijeiak\")\nassert(encrypt(s: \"hellomyfriend\") == \"lippsqcjvmirh\")\nassert(encrypt(s: \"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\") == \"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\")\nassert(encrypt(s: \"a\") == \"e\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "swift", - "prompt": "\n/// Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n/// The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n/// as follows: start with any positive integer n. Then each term is obtained from the \n/// previous term as follows: if the previous term is even, the next term is one half of \n/// the previous term. If the previous term is odd, the next term is 3 times the previous\n/// term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n/// Note: \n/// 1. Collatz(1) is [1].\n/// 2. returned list sorted in increasing order.\n/// For example:\n/// get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\nfunc get_odd_collatz(n: Int) -> [Int] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(get_odd_collatz(n: 14) == [1, 5, 7, 11, 13, 17])\nassert(get_odd_collatz(n: 5) == [1, 5])\nassert(get_odd_collatz(n: 12) == [1, 3, 5])\nassert(get_odd_collatz(n: 1) == [1])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "swift", - "prompt": "\n/// Find how many times a given substring can be found in the original string. Count overlaping cases.\nfunc how_many_times(string: String, substring: String) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(how_many_times(string: \"\", substring: \"x\") == 0)\nassert(how_many_times(string: \"xyxyxyx\", substring: \"x\") == 4)\nassert(how_many_times(string: \"cacacacac\", substring: \"cac\") == 4)\nassert(how_many_times(string: \"john doe\", substring: \"john\") == 1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "swift", - "prompt": "\n/// We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n/// numbers in the array will be randomly ordered. Your task is to determine if\n/// it is possible to get an array sorted in non-decreasing order by performing \n/// the following operation on the given array:\n/// You are allowed to perform right shift operation any number of times.\n/// One right shift operation means shifting all elements of the array by one\n/// position in the right direction. The last element of the array will be moved to\n/// the starting position in the array i.e. 0th index. \n/// If it is possible to obtain the sorted array by performing the above operation\n/// then return True else return False.\n/// If the given array is empty then return True.\n/// Note: The given list is guaranteed to have unique elements.\n/// For Example:\n/// Explanation: By performin 2 right shift operations, non-decreasing order can\n/// be achieved for the given array.\n/// Explanation:It is not possible to get non-decreasing order for the given\n/// array by performing any number of right shift operations.\nfunc move_one_ball(arr: [Int]) -> Bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(move_one_ball(arr: [3, 4, 5, 1, 2]) == true)\nassert(move_one_ball(arr: [3, 5, 10, 1, 2]) == true)\nassert(move_one_ball(arr: [4, 3, 1, 2]) == false)\nassert(move_one_ball(arr: [3, 5, 4, 1, 2]) == false)\nassert(move_one_ball(arr: [] as [Int]) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "swift", - "prompt": "\n/// Write a function which sorts the given list of integers\n/// in ascending order according to the sum of their digits.\n/// Note: if there are several items with similar sum of their digits,\n/// order them based on their index in original list.\n/// For example:\nfunc order_by_points(nums: [Int]) -> [Int] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(order_by_points(nums: [1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11])\nassert(order_by_points(nums: [1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]) == [0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457])\nassert(order_by_points(nums: [] as [Int]) == [] as [Int])\nassert(order_by_points(nums: [1, -11, -32, 43, 54, -98, 2, -3]) == [-3, -32, -98, -11, 1, 2, 43, 54])\nassert(order_by_points(nums: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) == [1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9])\nassert(order_by_points(nums: [0, 6, 6, -76, -21, 23, 4]) == [-76, -21, 0, 4, 23, 6, 6])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "swift", - "prompt": "\n/// Return list of prime factors of given integer in the order from smallest to largest.\n/// Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n/// Input number should be equal to the product of all factors\nfunc factorize(n: Int) -> [Int] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(factorize(n: 2) == [2])\nassert(factorize(n: 4) == [2, 2])\nassert(factorize(n: 8) == [2, 2, 2])\nassert(factorize(n: 57) == [3, 19])\nassert(factorize(n: 3249) == [3, 3, 19, 19])\nassert(factorize(n: 185193) == [3, 3, 3, 19, 19, 19])\nassert(factorize(n: 20577) == [3, 19, 19, 19])\nassert(factorize(n: 18) == [2, 3, 3])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "swift", - "prompt": "\n/// Return True if all numbers in the list l are below threshold t.\nfunc below_threshold(l: [Int], t: Int) -> Bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(below_threshold(l: [1, 2, 4, 10], t: 100) == true)\nassert(below_threshold(l: [1, 20, 4, 10], t: 5) == false)\nassert(below_threshold(l: [1, 20, 4, 10], t: 21) == true)\nassert(below_threshold(l: [1, 20, 4, 10], t: 22) == true)\nassert(below_threshold(l: [1, 8, 4, 10], t: 11) == true)\nassert(below_threshold(l: [1, 8, 4, 10], t: 10) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "swift", - "prompt": "\nextension Int: Error {}\n \n/// You are given two positive integers n and m, and your task is to compute the\n/// average of the integers from n through m (including n and m). \n/// Round the answer to the nearest integer and convert that to binary.\n/// If n is greater than m, return -1.\n/// Example:\nfunc rounded_avg(n: Int, m: Int) -> Result {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(rounded_avg(n: 1, m: 5) == .success(\"0b11\"))\nassert(rounded_avg(n: 7, m: 13) == .success(\"0b1010\"))\nassert(rounded_avg(n: 964, m: 977) == .success(\"0b1111001010\"))\nassert(rounded_avg(n: 996, m: 997) == .success(\"0b1111100100\"))\nassert(rounded_avg(n: 560, m: 851) == .success(\"0b1011000010\"))\nassert(rounded_avg(n: 185, m: 546) == .success(\"0b101101110\"))\nassert(rounded_avg(n: 362, m: 496) == .success(\"0b110101101\"))\nassert(rounded_avg(n: 350, m: 902) == .success(\"0b1001110010\"))\nassert(rounded_avg(n: 197, m: 233) == .success(\"0b11010111\"))\nassert(rounded_avg(n: 7, m: 5) == .failure(-1))\nassert(rounded_avg(n: 5, m: 1) == .failure(-1))\nassert(rounded_avg(n: 5, m: 5) == .success(\"0b101\"))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "swift", - "prompt": "\n/// Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n/// For each of the group, output the deepest level of nesting of parentheses.\n/// E.g. (()()) has maximum two levels of nesting while ((())) has three.\nfunc parse_nested_parens(paren_string: String) -> [Int] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(parse_nested_parens(paren_string: \"(()()) ((())) () ((())()())\") == [2, 3, 1, 3])\nassert(parse_nested_parens(paren_string: \"() (()) ((())) (((())))\") == [1, 2, 3, 4])\nassert(parse_nested_parens(paren_string: \"(()(())((())))\") == [4])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "swift", - "prompt": "\n/// Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n/// Examples\nfunc solution(lst: [Int]) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(solution(lst: [5, 8, 7, 1]) == 12)\nassert(solution(lst: [3, 3, 3, 3, 3]) == 9)\nassert(solution(lst: [30, 13, 24, 321]) == 0)\nassert(solution(lst: [5, 9]) == 5)\nassert(solution(lst: [2, 4, 8]) == 0)\nassert(solution(lst: [30, 13, 23, 32]) == 23)\nassert(solution(lst: [3, 13, 2, 9]) == 3)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "swift", - "prompt": "\n/// You are given a positive integer n. You have to create an integer array a of length n.\n/// For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n/// Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n/// and a[i] + a[j] + a[k] is a multiple of 3.\n/// Example :\n/// Explanation: \n/// a = [1, 3, 7, 13, 21]\n/// The only valid triple is (1, 7, 13).\nfunc get_max_triples(n: Int) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(get_max_triples(n: 5) == 1)\nassert(get_max_triples(n: 6) == 4)\nassert(get_max_triples(n: 10) == 36)\nassert(get_max_triples(n: 100) == 53361)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_148_bf", - "language": "swift", - "prompt": "\n/// There are eight planets in our solar system: the closerst to the Sun \n/// is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, \n/// Uranus, Neptune.\n/// Write a function that takes two planet names as strings planet1 and planet2. \n/// The function should return a tuple containing all planets whose orbits are \n/// located between the orbit of planet1 and the orbit of planet2, sorted by \n/// the proximity to the sun. \n/// The function should return an empty tuple if planet1 or planet2\n/// are not correct planet names. \n/// Examples\nfunc bf(planet1: String, planet2: String) -> [String] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(bf(planet1: \"Jupiter\", planet2: \"Neptune\") == [\"Saturn\", \"Uranus\"])\nassert(bf(planet1: \"Earth\", planet2: \"Mercury\") == [\"Venus\"])\nassert(bf(planet1: \"Mercury\", planet2: \"Uranus\") == [\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"])\nassert(bf(planet1: \"Neptune\", planet2: \"Venus\") == [\"Earth\", \"Mars\", \"Jupiter\", \"Saturn\", \"Uranus\"])\nassert(bf(planet1: \"Earth\", planet2: \"Earth\") == [] as [String])\nassert(bf(planet1: \"Mars\", planet2: \"Earth\") == [] as [String])\nassert(bf(planet1: \"Jupiter\", planet2: \"Makemake\") == [] as [String])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "swift", - "prompt": "\n/// You are given a list of integers.\n/// Write a function next_smallest() that returns the 2nd smallest element of the list.\n/// Return None if there is no such element.\nfunc next_smallest(lst: [Int]) -> Int? {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(next_smallest(lst: [1, 2, 3, 4, 5]) == 2)\nassert(next_smallest(lst: [5, 1, 4, 3, 2]) == 2)\nassert(next_smallest(lst: [] as [Int]) == nil)\nassert(next_smallest(lst: [1, 1]) == nil)\nassert(next_smallest(lst: [1, 1, 1, 1, 0]) == 1)\nassert(next_smallest(lst: [1, 1]) == nil)\nassert(next_smallest(lst: [-35, 34, 12, -45]) == -35)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "swift", - "prompt": "\n/// Input is a space-delimited string of numberals from 'zero' to 'nine'.\n/// Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n/// Return the string with numbers sorted from smallest to largest\nfunc sort_numbers(numbers: String) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sort_numbers(numbers: \"\") == \"\")\nassert(sort_numbers(numbers: \"three\") == \"three\")\nassert(sort_numbers(numbers: \"three five nine\") == \"three five nine\")\nassert(sort_numbers(numbers: \"five zero four seven nine eight\") == \"zero four five seven eight nine\")\nassert(sort_numbers(numbers: \"six five four three two one zero\") == \"zero one two three four five six\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "swift", - "prompt": "\n/// You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\nfunc cycpattern_check(a: String, b: String) -> Bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(cycpattern_check(a: \"xyzw\", b: \"xyw\") == false)\nassert(cycpattern_check(a: \"yello\", b: \"ell\") == true)\nassert(cycpattern_check(a: \"whattup\", b: \"ptut\") == false)\nassert(cycpattern_check(a: \"efef\", b: \"fee\") == true)\nassert(cycpattern_check(a: \"abab\", b: \"aabb\") == false)\nassert(cycpattern_check(a: \"winemtt\", b: \"tinem\") == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "swift", - "prompt": "\n/// You will be given a number in decimal form and your task is to convert it to\n/// binary format. The function should return a string, with each character representing a binary\n/// number. Each character in the string will be '0' or '1'.\n/// There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n/// The extra characters are there to help with the format.\n/// Examples:\nfunc decimal_to_binary(decimal: Int) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(decimal_to_binary(decimal: 0) == \"db0db\")\nassert(decimal_to_binary(decimal: 32) == \"db100000db\")\nassert(decimal_to_binary(decimal: 103) == \"db1100111db\")\nassert(decimal_to_binary(decimal: 15) == \"db1111db\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "swift", - "prompt": "\n/// Filter an input list of strings only for ones that contain given substring\nfunc filter_by_substring(strings: [String], substring: String) -> [String] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(filter_by_substring(strings: [] as [String], substring: \"john\") == [] as [String])\nassert(filter_by_substring(strings: [\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], substring: \"xxx\") == [\"xxx\", \"xxxAAA\", \"xxx\"])\nassert(filter_by_substring(strings: [\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"], substring: \"xx\") == [\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"])\nassert(filter_by_substring(strings: [\"grunt\", \"trumpet\", \"prune\", \"gruesome\"], substring: \"run\") == [\"grunt\", \"prune\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "swift", - "prompt": "\n/// Given an integer. return a tuple that has the number of even and odd digits respectively.\n/// Example:\nfunc even_odd_count(num: Int) -> (Int, Int) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(even_odd_count(num: 7) == (0, 1))\nassert(even_odd_count(num: -78) == (1, 1))\nassert(even_odd_count(num: 3452) == (2, 2))\nassert(even_odd_count(num: 346211) == (3, 3))\nassert(even_odd_count(num: -345821) == (3, 3))\nassert(even_odd_count(num: -2) == (1, 0))\nassert(even_odd_count(num: -45347) == (2, 3))\nassert(even_odd_count(num: 0) == (1, 0))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "swift", - "prompt": "\n/// Write a function that accepts a list of strings.\n/// The list contains different words. Return the word with maximum number\n/// of unique characters. If multiple strings have maximum number of unique\n/// characters, return the one which comes first in lexicographical order.\nfunc find_max(words: [String]) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(find_max(words: [\"name\", \"of\", \"string\"]) == \"string\")\nassert(find_max(words: [\"name\", \"enam\", \"game\"]) == \"enam\")\nassert(find_max(words: [\"aaaaaaa\", \"bb\", \"cc\"]) == \"aaaaaaa\")\nassert(find_max(words: [\"abc\", \"cba\"]) == \"abc\")\nassert(find_max(words: [\"play\", \"this\", \"game\", \"of\", \"footbott\"]) == \"footbott\")\nassert(find_max(words: [\"we\", \"are\", \"gonna\", \"rock\"]) == \"gonna\")\nassert(find_max(words: [\"we\", \"are\", \"a\", \"mad\", \"nation\"]) == \"nation\")\nassert(find_max(words: [\"this\", \"is\", \"a\", \"prrk\"]) == \"this\")\nassert(find_max(words: [\"b\"]) == \"b\")\nassert(find_max(words: [\"play\", \"play\", \"play\"]) == \"play\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "swift", - "prompt": "\n/// Create a function that returns a tuple (a, b), where 'a' is\n/// the largest of negative integers, and 'b' is the smallest\n/// of positive integers in a list.\n/// If there is no negative or positive integers, return them as None.\n/// Examples:\nfunc largest_smallest_integers(lst: [Int]) -> (Int?, Int?) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(largest_smallest_integers(lst: [2, 4, 1, 3, 5, 7]) == (nil, 1))\nassert(largest_smallest_integers(lst: [2, 4, 1, 3, 5, 7, 0]) == (nil, 1))\nassert(largest_smallest_integers(lst: [1, 3, 2, 4, 5, 6, -2]) == (-2, 1))\nassert(largest_smallest_integers(lst: [4, 5, 3, 6, 2, 7, -7]) == (-7, 2))\nassert(largest_smallest_integers(lst: [7, 3, 8, 4, 9, 2, 5, -9]) == (-9, 2))\nassert(largest_smallest_integers(lst: [] as [Int]) == (nil, nil))\nassert(largest_smallest_integers(lst: [0]) == (nil, nil))\nassert(largest_smallest_integers(lst: [-1, -3, -5, -6]) == (-1, nil))\nassert(largest_smallest_integers(lst: [-1, -3, -5, -6, 0]) == (-1, nil))\nassert(largest_smallest_integers(lst: [-6, -4, -4, -3, 1]) == (-3, 1))\nassert(largest_smallest_integers(lst: [-6, -4, -4, -3, -100, 1]) == (-3, 1))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "swift", - "prompt": "\n/// \"Given an array representing a branch of a tree that has non-negative integer nodes\n/// your task is to pluck one of the nodes and return it.\n/// The plucked node should be the node with the smallest even value.\n/// If multiple nodes with the same smallest even value are found return the node that has smallest index.\n/// The plucked node should be returned in a list, [ smalest_value, its index ],\n/// If there are no even values or the given array is empty, return [].\n/// Example 1:\n/// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n/// Example 2:\n/// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n/// Example 3:\n/// Example 4:\n/// Explanation: 0 is the smallest value, but there are two zeros,\n/// so we will choose the first zero, which has the smallest index.\n/// Constraints:\n/// * 1 <= nodes.length <= 10000\n/// * 0 <= node.value\nfunc pluck(arr: [Int]) -> [Int] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(pluck(arr: [4, 2, 3]) == [2, 1])\nassert(pluck(arr: [1, 2, 3]) == [2, 1])\nassert(pluck(arr: [] as [Int]) == [] as [Int])\nassert(pluck(arr: [5, 0, 3, 0, 4, 2]) == [0, 1])\nassert(pluck(arr: [1, 2, 3, 0, 5, 3]) == [0, 3])\nassert(pluck(arr: [5, 4, 8, 4, 8]) == [4, 1])\nassert(pluck(arr: [7, 6, 7, 1]) == [6, 1])\nassert(pluck(arr: [7, 9, 7, 1]) == [] as [Int])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "swift", - "prompt": "\n/// Write a function count_nums which takes an array of integers and returns\n/// the number of elements which has a sum of digits > 0.\n/// If a number is negative, then its first signed digit will be negative:\n/// e.g. -123 has signed digits -1, 2, and 3.\nfunc count_nums(arr: [Int]) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(count_nums(arr: [] as [Int]) == 0)\nassert(count_nums(arr: [-1, -2, 0]) == 0)\nassert(count_nums(arr: [1, 1, 2, -2, 3, 4, 5]) == 6)\nassert(count_nums(arr: [1, 6, 9, -6, 0, 1, 5]) == 5)\nassert(count_nums(arr: [1, 100, 98, -7, 1, -1]) == 4)\nassert(count_nums(arr: [12, 23, 34, -45, -56, 0]) == 5)\nassert(count_nums(arr: [0, 1]) == 1)\nassert(count_nums(arr: [1]) == 1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "swift", - "prompt": "\n/// Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n/// each cell of the grid contains a value. Every integer in the range [1, N * N]\n/// inclusive appears exactly once on the cells of the grid.\n/// You have to find the minimum path of length k in the grid. You can start\n/// from any cell, and in each step you can move to any of the neighbor cells,\n/// in other words, you can go to cells which share an edge with you current\n/// cell.\n/// Please note that a path of length k means visiting exactly k cells (not\n/// necessarily distinct).\n/// You CANNOT go off the grid.\n/// A path A (of length k) is considered less than a path B (of length k) if\n/// after making the ordered lists of the values on the cells that A and B go\n/// through (let's call them lst_A and lst_B), lst_A is lexicographically less\n/// than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n/// such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n/// lst_A[j] = lst_B[j].\n/// It is guaranteed that the answer is unique.\n/// Return an ordered list of the values on the cells that the minimum path go through.\n/// Examples:\nfunc minPath(grid: [[Int]], k: Int) -> [Int] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(minPath(grid: [[1, 2, 3], [4, 5, 6], [7, 8, 9]], k: 3) == [1, 2, 1])\nassert(minPath(grid: [[5, 9, 3], [4, 1, 6], [7, 8, 2]], k: 1) == [1])\nassert(minPath(grid: [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], k: 4) == [1, 2, 1, 2])\nassert(minPath(grid: [[6, 4, 13, 10], [5, 7, 12, 1], [3, 16, 11, 15], [8, 14, 9, 2]], k: 7) == [1, 10, 1, 10, 1, 10, 1])\nassert(minPath(grid: [[8, 14, 9, 2], [6, 4, 13, 15], [5, 7, 1, 12], [3, 10, 11, 16]], k: 5) == [1, 7, 1, 7, 1])\nassert(minPath(grid: [[11, 8, 7, 2], [5, 16, 14, 4], [9, 3, 15, 6], [12, 13, 10, 1]], k: 9) == [1, 6, 1, 6, 1, 6, 1, 6, 1])\nassert(minPath(grid: [[12, 13, 10, 1], [9, 3, 15, 6], [5, 16, 14, 4], [11, 8, 7, 2]], k: 12) == [1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6])\nassert(minPath(grid: [[2, 7, 4], [3, 1, 5], [6, 8, 9]], k: 8) == [1, 3, 1, 3, 1, 3, 1, 3])\nassert(minPath(grid: [[6, 1, 5], [3, 8, 9], [2, 7, 4]], k: 8) == [1, 5, 1, 5, 1, 5, 1, 5])\nassert(minPath(grid: [[1, 2], [3, 4]], k: 10) == [1, 2, 1, 2, 1, 2, 1, 2, 1, 2])\nassert(minPath(grid: [[1, 3], [3, 2]], k: 10) == [1, 3, 1, 3, 1, 3, 1, 3, 1, 3])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "swift", - "prompt": "\n/// Given list of integers, return list in strange order.\n/// Strange sorting, is when you start with the minimum value,\n/// then maximum of the remaining integers, then minimum and so on.\n/// Examples:\nfunc strange_sort_list(lst: [Int]) -> [Int] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(strange_sort_list(lst: [1, 2, 3, 4]) == [1, 4, 2, 3])\nassert(strange_sort_list(lst: [5, 6, 7, 8, 9]) == [5, 9, 6, 8, 7])\nassert(strange_sort_list(lst: [1, 2, 3, 4, 5]) == [1, 5, 2, 4, 3])\nassert(strange_sort_list(lst: [5, 6, 7, 8, 9, 1]) == [1, 9, 5, 8, 6, 7])\nassert(strange_sort_list(lst: [5, 5, 5, 5]) == [5, 5, 5, 5])\nassert(strange_sort_list(lst: [] as [Int]) == [] as [Int])\nassert(strange_sort_list(lst: [1, 2, 3, 4, 5, 6, 7, 8]) == [1, 8, 2, 7, 3, 6, 4, 5])\nassert(strange_sort_list(lst: [0, 2, 2, 2, 5, 5, -5, -5]) == [-5, 5, -5, 5, 0, 2, 2, 2])\nassert(strange_sort_list(lst: [111111]) == [111111])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "swift", - "prompt": "\n/// Given a string 'text', return its md5 hash equivalent string.\n/// If 'text' is an empty string, return None.\nfunc string_to_md5(text: String) -> String? {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(string_to_md5(text: \"Hello world\") == \"3e25960a79dbc69b674cd4ec67a72c62\")\nassert(string_to_md5(text: \"\") == nil)\nassert(string_to_md5(text: \"A B C\") == \"0ef78513b0cb8cef12743f5aeb35f888\")\nassert(string_to_md5(text: \"password\") == \"5f4dcc3b5aa765d61d8327deb882cf99\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "swift", - "prompt": "\n/// You are given a word. Your task is to find the closest vowel that stands between \n/// two consonants from the right side of the word (case sensitive).\n/// Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n/// find any vowel met the above condition. \n/// You may assume that the given string contains English letter only.\n/// Example:\nfunc get_closest_vowel(word: String) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(get_closest_vowel(word: \"yogurt\") == \"u\")\nassert(get_closest_vowel(word: \"full\") == \"u\")\nassert(get_closest_vowel(word: \"easy\") == \"\")\nassert(get_closest_vowel(word: \"eAsy\") == \"\")\nassert(get_closest_vowel(word: \"ali\") == \"\")\nassert(get_closest_vowel(word: \"bad\") == \"a\")\nassert(get_closest_vowel(word: \"most\") == \"o\")\nassert(get_closest_vowel(word: \"ab\") == \"\")\nassert(get_closest_vowel(word: \"ba\") == \"\")\nassert(get_closest_vowel(word: \"quick\") == \"\")\nassert(get_closest_vowel(word: \"anime\") == \"i\")\nassert(get_closest_vowel(word: \"Asia\") == \"\")\nassert(get_closest_vowel(word: \"Above\") == \"o\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "swift", - "prompt": "\n/// Change numerical base of input number x to base.\n/// return string representation after the conversion.\n/// base numbers are less than 10.\nfunc change_base(x: Int, base: Int) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(change_base(x: 8, base: 3) == \"22\")\nassert(change_base(x: 9, base: 3) == \"100\")\nassert(change_base(x: 234, base: 2) == \"11101010\")\nassert(change_base(x: 16, base: 2) == \"10000\")\nassert(change_base(x: 8, base: 2) == \"1000\")\nassert(change_base(x: 7, base: 2) == \"111\")\nassert(change_base(x: 2, base: 3) == \"2\")\nassert(change_base(x: 3, base: 4) == \"3\")\nassert(change_base(x: 4, base: 5) == \"4\")\nassert(change_base(x: 5, base: 6) == \"5\")\nassert(change_base(x: 6, base: 7) == \"6\")\nassert(change_base(x: 7, base: 8) == \"7\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "swift", - "prompt": "\n/// Check if in given list of numbers, are any two numbers closer to each other than\n/// given threshold.\nfunc has_close_elements(numbers: [Double], threshold: Double) -> Bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(has_close_elements(numbers: [1.0, 2.0, 3.9, 4.0, 5.0, 2.2], threshold: 0.3) == true)\nassert(has_close_elements(numbers: [1.0, 2.0, 3.9, 4.0, 5.0, 2.2], threshold: 0.05) == false)\nassert(has_close_elements(numbers: [1.0, 2.0, 5.9, 4.0, 5.0], threshold: 0.95) == true)\nassert(has_close_elements(numbers: [1.0, 2.0, 5.9, 4.0, 5.0], threshold: 0.8) == false)\nassert(has_close_elements(numbers: [1.0, 2.0, 3.0, 4.0, 5.0, 2.0], threshold: 0.1) == true)\nassert(has_close_elements(numbers: [1.1, 2.2, 3.1, 4.1, 5.1], threshold: 1.0) == true)\nassert(has_close_elements(numbers: [1.1, 2.2, 3.1, 4.1, 5.1], threshold: 0.5) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "swift", - "prompt": "\n/// Create a function that takes a string as input which contains only square brackets.\n/// The function should return True if and only if there is a valid subsequence of brackets \n/// where at least one bracket in the subsequence is nested.\nfunc is_nested(string: String) -> Bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_nested(string: \"[[]]\") == true)\nassert(is_nested(string: \"[]]]]]]][[[[[]\") == false)\nassert(is_nested(string: \"[][]\") == false)\nassert(is_nested(string: \"[]\") == false)\nassert(is_nested(string: \"[[[[]]]]\") == true)\nassert(is_nested(string: \"[]]]]]]]]]]\") == false)\nassert(is_nested(string: \"[][][[]]\") == true)\nassert(is_nested(string: \"[[]\") == false)\nassert(is_nested(string: \"[]]\") == false)\nassert(is_nested(string: \"[[]][[\") == true)\nassert(is_nested(string: \"[[][]]\") == true)\nassert(is_nested(string: \"\") == false)\nassert(is_nested(string: \"[[[[[[[[\") == false)\nassert(is_nested(string: \"]]]]]]]]\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "swift", - "prompt": "\n/// Concatenate list of strings into a single string\nfunc concatenate(strings: [String]) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(concatenate(strings: [] as [String]) == \"\")\nassert(concatenate(strings: [\"x\", \"y\", \"z\"]) == \"xyz\")\nassert(concatenate(strings: [\"x\", \"y\", \"z\", \"w\", \"k\"]) == \"xyzwk\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "swift", - "prompt": "\n/// prime_fib returns n-th number that is a Fibonacci number and it's also prime.\nfunc prime_fib(n: Int) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(prime_fib(n: 1) == 2)\nassert(prime_fib(n: 2) == 3)\nassert(prime_fib(n: 3) == 5)\nassert(prime_fib(n: 4) == 13)\nassert(prime_fib(n: 5) == 89)\nassert(prime_fib(n: 6) == 233)\nassert(prime_fib(n: 7) == 1597)\nassert(prime_fib(n: 8) == 28657)\nassert(prime_fib(n: 9) == 514229)\nassert(prime_fib(n: 10) == 433494437)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "swift", - "prompt": "\n/// From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n/// other and return them in order (smaller number, larger number).\nfunc find_closest_elements(numbers: [Double]) -> (Double, Double) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(find_closest_elements(numbers: [1.0, 2.0, 3.9, 4.0, 5.0, 2.2]) == (3.9, 4.0))\nassert(find_closest_elements(numbers: [1.0, 2.0, 5.9, 4.0, 5.0]) == (5.0, 5.9))\nassert(find_closest_elements(numbers: [1.0, 2.0, 3.0, 4.0, 5.0, 2.2]) == (2.0, 2.2))\nassert(find_closest_elements(numbers: [1.0, 2.0, 3.0, 4.0, 5.0, 2.0]) == (2.0, 2.0))\nassert(find_closest_elements(numbers: [1.1, 2.2, 3.1, 4.1, 5.1]) == (2.2, 3.1))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "swift", - "prompt": "\n/// You have been tasked to write a function that receives \n/// a hexadecimal number as a string and counts the number of hexadecimal \n/// digits that are primes (prime number, or a prime, is a natural number \n/// greater than 1 that is not a product of two smaller natural numbers).\n/// Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n/// Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n/// So you have to determine a number of the following digits: 2, 3, 5, 7, \n/// B (=decimal 11), D (=decimal 13).\n/// Note: you may assume the input is always correct or empty string, \n/// and symbols A,B,C,D,E,F are always uppercase.\n/// Examples:\nfunc hex_key(num: String) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(hex_key(num: \"AB\") == 1)\nassert(hex_key(num: \"1077E\") == 2)\nassert(hex_key(num: \"ABED1A33\") == 4)\nassert(hex_key(num: \"2020\") == 2)\nassert(hex_key(num: \"123456789ABCDEF0\") == 6)\nassert(hex_key(num: \"112233445566778899AABBCCDDEEFF00\") == 12)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "swift", - "prompt": "\n/// Complete the function that takes two integers and returns \n/// the product of their unit digits.\n/// Assume the input is always valid.\n/// Examples:\nfunc multiply(a: Int, b: Int) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(multiply(a: 148, b: 412) == 16)\nassert(multiply(a: 19, b: 28) == 72)\nassert(multiply(a: 2020, b: 1851) == 0)\nassert(multiply(a: 14, b: -15) == 20)\nassert(multiply(a: 76, b: 67) == 42)\nassert(multiply(a: 17, b: 27) == 49)\nassert(multiply(a: 0, b: 1) == 0)\nassert(multiply(a: 0, b: 0) == 0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "swift", - "prompt": "\n/// Given list of numbers (of at least two elements), apply a linear transform to that list,\n/// such that the smallest number will become 0 and the largest will become 1\nfunc rescale_to_unit(numbers: [Double]) -> [Double] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(rescale_to_unit(numbers: [2.0, 49.9]) == [0.0, 1.0])\nassert(rescale_to_unit(numbers: [100.0, 49.9]) == [1.0, 0.0])\nassert(rescale_to_unit(numbers: [1.0, 2.0, 3.0, 4.0, 5.0]) == [0.0, 0.25, 0.5, 0.75, 1.0])\nassert(rescale_to_unit(numbers: [2.0, 1.0, 5.0, 3.0, 4.0]) == [0.25, 0.0, 1.0, 0.5, 0.75])\nassert(rescale_to_unit(numbers: [12.0, 11.0, 15.0, 13.0, 14.0]) == [0.25, 0.0, 1.0, 0.5, 0.75])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "swift", - "prompt": "\n/// Given a positive integer n, return the product of the odd digits.\n/// Return 0 if all digits are even.\n/// For example:\nfunc digits(n: Int) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(digits(n: 5) == 5)\nassert(digits(n: 54) == 5)\nassert(digits(n: 120) == 1)\nassert(digits(n: 5014) == 5)\nassert(digits(n: 98765) == 315)\nassert(digits(n: 5576543) == 2625)\nassert(digits(n: 2468) == 0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "swift", - "prompt": "\n/// You will be given the name of a class (a string) and a list of extensions.\n/// The extensions are to be used to load additional classes to the class. The\n/// strength of the extension is as follows: Let CAP be the number of the uppercase\n/// letters in the extension's name, and let SM be the number of lowercase letters \n/// in the extension's name, the strength is given by the fraction CAP - SM. \n/// You should find the strongest extension and return a string in this \n/// format: ClassName.StrongestExtensionName.\n/// If there are two or more extensions with the same strength, you should\n/// choose the one that comes first in the list.\n/// For example, if you are given \"Slices\" as the class and a list of the\n/// extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n/// return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n/// (its strength is -1).\n/// Example:\nfunc Strongest_Extension(class_name: String, extensions: [String]) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(Strongest_Extension(class_name: \"Watashi\", extensions: [\"tEN\", \"niNE\", \"eIGHt8OKe\"]) == \"Watashi.eIGHt8OKe\")\nassert(Strongest_Extension(class_name: \"Boku123\", extensions: [\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"]) == \"Boku123.YEs.WeCaNe\")\nassert(Strongest_Extension(class_name: \"__YESIMHERE\", extensions: [\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"]) == \"__YESIMHERE.NuLl__\")\nassert(Strongest_Extension(class_name: \"K\", extensions: [\"Ta\", \"TAR\", \"t234An\", \"cosSo\"]) == \"K.TAR\")\nassert(Strongest_Extension(class_name: \"__HAHA\", extensions: [\"Tab\", \"123\", \"781345\", \"-_-\"]) == \"__HAHA.123\")\nassert(Strongest_Extension(class_name: \"YameRore\", extensions: [\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"]) == \"YameRore.okIWILL123\")\nassert(Strongest_Extension(class_name: \"finNNalLLly\", extensions: [\"Die\", \"NowW\", \"Wow\", \"WoW\"]) == \"finNNalLLly.WoW\")\nassert(Strongest_Extension(class_name: \"_\", extensions: [\"Bb\", \"91245\"]) == \"_.Bb\")\nassert(Strongest_Extension(class_name: \"Sp\", extensions: [\"671235\", \"Bb\"]) == \"Sp.671235\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "swift", - "prompt": "\n/// Given a string representing a space separated lowercase letters, return a dictionary\n/// of the letter with the most repetition and containing the corresponding count.\n/// If several letters have the same occurrence, return all of them.\n/// Example:\nfunc histogram(test: String) -> [String : Int] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(histogram(test: \"a b b a\") == [\"a\" : 2, \"b\" : 2])\nassert(histogram(test: \"a b c a b\") == [\"a\" : 2, \"b\" : 2])\nassert(histogram(test: \"a b c d g\") == [\"a\" : 1, \"b\" : 1, \"c\" : 1, \"d\" : 1, \"g\" : 1])\nassert(histogram(test: \"r t g\") == [\"r\" : 1, \"t\" : 1, \"g\" : 1])\nassert(histogram(test: \"b b b b a\") == [\"b\" : 4])\nassert(histogram(test: \"r t g\") == [\"r\" : 1, \"t\" : 1, \"g\" : 1])\nassert(histogram(test: \"\") == [:] as [String : Int])\nassert(histogram(test: \"a\") == [\"a\" : 1])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "swift", - "prompt": "\n/// pairs_sum_to_zero takes a list of integers as an input.\n/// it returns True if there are two distinct elements in the list that\n/// sum to zero, and False otherwise.\nfunc pairs_sum_to_zero(l: [Int]) -> Bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(pairs_sum_to_zero(l: [1, 3, 5, 0]) == false)\nassert(pairs_sum_to_zero(l: [1, 3, -2, 1]) == false)\nassert(pairs_sum_to_zero(l: [1, 2, 3, 7]) == false)\nassert(pairs_sum_to_zero(l: [2, 4, -5, 3, 5, 7]) == true)\nassert(pairs_sum_to_zero(l: [1]) == false)\nassert(pairs_sum_to_zero(l: [-3, 9, -1, 3, 2, 30]) == true)\nassert(pairs_sum_to_zero(l: [-3, 9, -1, 3, 2, 31]) == true)\nassert(pairs_sum_to_zero(l: [-3, 9, -1, 4, 2, 30]) == false)\nassert(pairs_sum_to_zero(l: [-3, 9, -1, 4, 2, 31]) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "swift", - "prompt": "\n/// Write a function that accepts two lists of strings and returns the list that has \n/// total number of chars in the all strings of the list less than the other list.\n/// if the two lists have the same number of chars, return the first list.\n/// Examples\nfunc total_match(lst1: [String], lst2: [String]) -> [String] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(total_match(lst1: [] as [String], lst2: [] as [String]) == [] as [String])\nassert(total_match(lst1: [\"hi\", \"admin\"], lst2: [\"hi\", \"hi\"]) == [\"hi\", \"hi\"])\nassert(total_match(lst1: [\"hi\", \"admin\"], lst2: [\"hi\", \"hi\", \"admin\", \"project\"]) == [\"hi\", \"admin\"])\nassert(total_match(lst1: [\"4\"], lst2: [\"1\", \"2\", \"3\", \"4\", \"5\"]) == [\"4\"])\nassert(total_match(lst1: [\"hi\", \"admin\"], lst2: [\"hI\", \"Hi\"]) == [\"hI\", \"Hi\"])\nassert(total_match(lst1: [\"hi\", \"admin\"], lst2: [\"hI\", \"hi\", \"hi\"]) == [\"hI\", \"hi\", \"hi\"])\nassert(total_match(lst1: [\"hi\", \"admin\"], lst2: [\"hI\", \"hi\", \"hii\"]) == [\"hi\", \"admin\"])\nassert(total_match(lst1: [] as [String], lst2: [\"this\"]) == [] as [String])\nassert(total_match(lst1: [\"this\"], lst2: [] as [String]) == [] as [String])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "swift", - "prompt": "\n/// Circular shift the digits of the integer x, shift the digits right by shift\n/// and return the result as a string.\n/// If shift > number of digits, return digits reversed.\nfunc circular_shift(x: Int, shift: Int) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(circular_shift(x: 100, shift: 2) == \"001\")\nassert(circular_shift(x: 12, shift: 2) == \"12\")\nassert(circular_shift(x: 97, shift: 8) == \"79\")\nassert(circular_shift(x: 12, shift: 1) == \"21\")\nassert(circular_shift(x: 11, shift: 101) == \"11\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "swift", - "prompt": "\n/// Return True is list elements are monotonically increasing or decreasing.\nfunc monotonic(l: [Int]) -> Bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(monotonic(l: [1, 2, 4, 10]) == true)\nassert(monotonic(l: [1, 2, 4, 20]) == true)\nassert(monotonic(l: [1, 20, 4, 10]) == false)\nassert(monotonic(l: [4, 1, 0, -10]) == true)\nassert(monotonic(l: [4, 1, 1, 0]) == true)\nassert(monotonic(l: [1, 2, 3, 2, 5, 60]) == false)\nassert(monotonic(l: [1, 2, 3, 4, 5, 60]) == true)\nassert(monotonic(l: [9, 9, 9, 9]) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "swift", - "prompt": "\n/// Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n/// Example\nfunc is_equal_to_sum_even(n: Int) -> Bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_equal_to_sum_even(n: 4) == false)\nassert(is_equal_to_sum_even(n: 6) == false)\nassert(is_equal_to_sum_even(n: 8) == true)\nassert(is_equal_to_sum_even(n: 10) == true)\nassert(is_equal_to_sum_even(n: 11) == false)\nassert(is_equal_to_sum_even(n: 12) == true)\nassert(is_equal_to_sum_even(n: 13) == false)\nassert(is_equal_to_sum_even(n: 16) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "swift", - "prompt": "\n/// Input to this function is a string representing musical notes in a special ASCII format.\n/// Your task is to parse this string and return list of integers corresponding to how many beats does each\n/// not last.\n/// Here is a legend:\n/// 'o' - whole note, lasts four beats\n/// 'o|' - half note, lasts two beats\n/// '.|' - quater note, lasts one beat\nfunc parse_music(music_string: String) -> [Int] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(parse_music(music_string: \"\") == [] as [Int])\nassert(parse_music(music_string: \"o o o o\") == [4, 4, 4, 4])\nassert(parse_music(music_string: \".| .| .| .|\") == [1, 1, 1, 1])\nassert(parse_music(music_string: \"o| o| .| .| o o o o\") == [2, 2, 1, 1, 4, 4, 4, 4])\nassert(parse_music(music_string: \"o| .| o| .| o o| o o|\") == [2, 1, 2, 1, 4, 2, 4, 2])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "swift", - "prompt": "\n/// \"\n/// This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n/// multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n/// change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n/// Examples:\nfunc sum_squares(lst: [Int]) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sum_squares(lst: [1, 2, 3]) == 6)\nassert(sum_squares(lst: [1, 4, 9]) == 14)\nassert(sum_squares(lst: [] as [Int]) == 0)\nassert(sum_squares(lst: [1, 1, 1, 1, 1, 1, 1, 1, 1]) == 9)\nassert(sum_squares(lst: [-1, -1, -1, -1, -1, -1, -1, -1, -1]) == -3)\nassert(sum_squares(lst: [0]) == 0)\nassert(sum_squares(lst: [-1, -5, 2, -1, -5]) == -126)\nassert(sum_squares(lst: [-56, -99, 1, 0, -2]) == 3030)\nassert(sum_squares(lst: [-1, 0, 0, 0, 0, 0, 0, 0, -1]) == 0)\nassert(sum_squares(lst: [-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37]) == -14196)\nassert(sum_squares(lst: [-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10]) == -1448)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "swift", - "prompt": "\n/// triples_sum_to_zero takes a list of integers as an input.\n/// it returns True if there are three distinct elements in the list that\n/// sum to zero, and False otherwise.\nfunc triples_sum_to_zero(l: [Int]) -> Bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(triples_sum_to_zero(l: [1, 3, 5, 0]) == false)\nassert(triples_sum_to_zero(l: [1, 3, 5, -1]) == false)\nassert(triples_sum_to_zero(l: [1, 3, -2, 1]) == true)\nassert(triples_sum_to_zero(l: [1, 2, 3, 7]) == false)\nassert(triples_sum_to_zero(l: [1, 2, 5, 7]) == false)\nassert(triples_sum_to_zero(l: [2, 4, -5, 3, 9, 7]) == true)\nassert(triples_sum_to_zero(l: [1]) == false)\nassert(triples_sum_to_zero(l: [1, 3, 5, -100]) == false)\nassert(triples_sum_to_zero(l: [100, 3, 5, -100]) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "swift", - "prompt": "\n/// brackets is a string of \"<\" and \">\".\n/// return True if every opening bracket has a corresponding closing bracket.\nfunc correct_bracketing(brackets: String) -> Bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(correct_bracketing(brackets: \"<>\") == true)\nassert(correct_bracketing(brackets: \"<<><>>\") == true)\nassert(correct_bracketing(brackets: \"<><><<><>><>\") == true)\nassert(correct_bracketing(brackets: \"<><><<<><><>><>><<><><<>>>\") == true)\nassert(correct_bracketing(brackets: \"<<<><>>>>\") == false)\nassert(correct_bracketing(brackets: \"><<>\") == false)\nassert(correct_bracketing(brackets: \"<\") == false)\nassert(correct_bracketing(brackets: \"<<<<\") == false)\nassert(correct_bracketing(brackets: \">\") == false)\nassert(correct_bracketing(brackets: \"<<>\") == false)\nassert(correct_bracketing(brackets: \"<><><<><>><>><<>\") == false)\nassert(correct_bracketing(brackets: \"<><><<><>><>>><>\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "swift", - "prompt": "\n/// Write a function that takes an array of numbers as input and returns \n/// the number of elements in the array that are greater than 10 and both \n/// first and last digits of a number are odd (1, 3, 5, 7, 9).\n/// For example:\nfunc specialFilter(nums: [Int]) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(specialFilter(nums: [5, -2, 1, -5]) == 0)\nassert(specialFilter(nums: [15, -73, 14, -15]) == 1)\nassert(specialFilter(nums: [33, -2, -3, 45, 21, 109]) == 2)\nassert(specialFilter(nums: [43, -12, 93, 125, 121, 109]) == 4)\nassert(specialFilter(nums: [71, -2, -33, 75, 21, 19]) == 3)\nassert(specialFilter(nums: [1]) == 0)\nassert(specialFilter(nums: [] as [Int]) == 0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "swift", - "prompt": "\n/// Given a dictionary, return True if all keys are strings in lower \n/// case or all keys are strings in upper case, else return False.\n/// The function should return False is the given dictionary is empty.\n/// Examples:\nfunc check_dict_case(dict: [String : String]) -> Bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(check_dict_case(dict: [\"p\" : \"pineapple\", \"b\" : \"banana\"]) == true)\nassert(check_dict_case(dict: [\"p\" : \"pineapple\", \"A\" : \"banana\", \"B\" : \"banana\"]) == false)\nassert(check_dict_case(dict: [\"p\" : \"pineapple\", \"5\" : \"banana\", \"a\" : \"apple\"]) == false)\nassert(check_dict_case(dict: [\"Name\" : \"John\", \"Age\" : \"36\", \"City\" : \"Houston\"]) == false)\nassert(check_dict_case(dict: [\"STATE\" : \"NC\", \"ZIP\" : \"12345\"]) == true)\nassert(check_dict_case(dict: [\"fruit\" : \"Orange\", \"taste\" : \"Sweet\"]) == true)\nassert(check_dict_case(dict: [:] as [String : String]) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "swift", - "prompt": "\nextension Int: Error {}\n \n/// Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n/// should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n/// alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n/// Examples\nfunc split_words(txt: String) -> Result<[String], Int> {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(split_words(txt: \"Hello world!\") == .success([\"Hello\", \"world!\"]))\nassert(split_words(txt: \"Hello,world!\") == .success([\"Hello\", \"world!\"]))\nassert(split_words(txt: \"Hello world,!\") == .success([\"Hello\", \"world,!\"]))\nassert(split_words(txt: \"Hello,Hello,world !\") == .success([\"Hello,Hello,world\", \"!\"]))\nassert(split_words(txt: \"abcdef\") == .failure(3))\nassert(split_words(txt: \"aaabb\") == .failure(2))\nassert(split_words(txt: \"aaaBb\") == .failure(1))\nassert(split_words(txt: \"\") == .failure(0))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "swift", - "prompt": "\n/// The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n/// fibfib(0) == 0\n/// fibfib(1) == 0\n/// fibfib(2) == 1\n/// fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n/// Please write a function to efficiently compute the n-th element of the fibfib number sequence.\nfunc fibfib(n: Int) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(fibfib(n: 2) == 1)\nassert(fibfib(n: 1) == 0)\nassert(fibfib(n: 5) == 4)\nassert(fibfib(n: 8) == 24)\nassert(fibfib(n: 10) == 81)\nassert(fibfib(n: 12) == 274)\nassert(fibfib(n: 14) == 927)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "swift", - "prompt": "\n/// You are given a list of numbers.\n/// You need to return the sum of squared numbers in the given list,\n/// round each element in the list to the upper int(Ceiling) first.\n/// Examples:\nfunc sum_squares(lst: [Double]) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sum_squares(lst: [1.0, 2.0, 3.0]) == 14)\nassert(sum_squares(lst: [1.0, 2.0, 3.0]) == 14)\nassert(sum_squares(lst: [1.0, 3.0, 5.0, 7.0]) == 84)\nassert(sum_squares(lst: [1.4, 4.2, 0.0]) == 29)\nassert(sum_squares(lst: [-2.4, 1.0, 1.0]) == 6)\nassert(sum_squares(lst: [100.0, 1.0, 15.0, 2.0]) == 10230)\nassert(sum_squares(lst: [10000.0, 10000.0]) == 200000000)\nassert(sum_squares(lst: [-1.4, 4.6, 6.3]) == 75)\nassert(sum_squares(lst: [-1.4, 17.9, 18.9, 19.9]) == 1086)\nassert(sum_squares(lst: [0.0]) == 0)\nassert(sum_squares(lst: [-1.0]) == 1)\nassert(sum_squares(lst: [-1.0, 1.0, 0.0]) == 2)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_85_add", - "language": "swift", - "prompt": "\n/// Given a non-empty list of integers lst. add the even elements that are at odd indices..\n/// Examples:\nfunc add(lst: [Int]) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(add(lst: [4, 88]) == 88)\nassert(add(lst: [4, 5, 6, 7, 2, 122]) == 122)\nassert(add(lst: [4, 0, 6, 7]) == 0)\nassert(add(lst: [4, 4, 6, 8]) == 12)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "swift", - "prompt": "\n/// Return sorted unique elements in a list\nfunc unique(l: [Int]) -> [Int] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(unique(l: [5, 3, 5, 2, 3, 3, 9, 0, 123]) == [0, 2, 3, 5, 9, 123])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "swift", - "prompt": "\n/// Given a string text, replace all spaces in it with underscores, \n/// and if a string has more than 2 consecutive spaces, \n/// then replace all consecutive spaces with -\nfunc fix_spaces(text: String) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(fix_spaces(text: \"Example\") == \"Example\")\nassert(fix_spaces(text: \"Mudasir Hanif \") == \"Mudasir_Hanif_\")\nassert(fix_spaces(text: \"Yellow Yellow Dirty Fellow\") == \"Yellow_Yellow__Dirty__Fellow\")\nassert(fix_spaces(text: \"Exa mple\") == \"Exa-mple\")\nassert(fix_spaces(text: \" Exa 1 2 2 mple\") == \"-Exa_1_2_2_mple\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "swift", - "prompt": "\n/// Return 2^n modulo p (be aware of numerics).\nfunc modp(n: Int, p: Int) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(modp(n: 3, p: 5) == 3)\nassert(modp(n: 1101, p: 101) == 2)\nassert(modp(n: 0, p: 101) == 1)\nassert(modp(n: 3, p: 11) == 8)\nassert(modp(n: 100, p: 101) == 1)\nassert(modp(n: 30, p: 5) == 4)\nassert(modp(n: 31, p: 5) == 3)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "swift", - "prompt": "\n/// You have to write a function which validates a given date string and\n/// returns True if the date is valid otherwise False.\n/// The date is valid if all of the following rules are satisfied:\n/// 1. The date string is not empty.\n/// 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n/// 3. The months should not be less than 1 or higher than 12.\n/// 4. The date should be in the format: mm-dd-yyyy\nfunc valid_date(date: String) -> Bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(valid_date(date: \"03-11-2000\") == true)\nassert(valid_date(date: \"15-01-2012\") == false)\nassert(valid_date(date: \"04-0-2040\") == false)\nassert(valid_date(date: \"06-04-2020\") == true)\nassert(valid_date(date: \"01-01-2007\") == true)\nassert(valid_date(date: \"03-32-2011\") == false)\nassert(valid_date(date: \"\") == false)\nassert(valid_date(date: \"04-31-3000\") == false)\nassert(valid_date(date: \"06-06-2005\") == true)\nassert(valid_date(date: \"21-31-2000\") == false)\nassert(valid_date(date: \"04-12-2003\") == true)\nassert(valid_date(date: \"04122003\") == false)\nassert(valid_date(date: \"20030412\") == false)\nassert(valid_date(date: \"2003-04\") == false)\nassert(valid_date(date: \"2003-04-12\") == false)\nassert(valid_date(date: \"04-2003\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "swift", - "prompt": "\n/// Write a function that takes a string and returns an ordered version of it.\n/// Ordered version of string, is a string where all words (separated by space)\n/// are replaced by a new word where all the characters arranged in\n/// ascending order based on ascii value.\n/// Note: You should keep the order of words and blank spaces in the sentence.\n/// For example:\nfunc anti_shuffle(s: String) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(anti_shuffle(s: \"Hi\") == \"Hi\")\nassert(anti_shuffle(s: \"hello\") == \"ehllo\")\nassert(anti_shuffle(s: \"number\") == \"bemnru\")\nassert(anti_shuffle(s: \"abcd\") == \"abcd\")\nassert(anti_shuffle(s: \"Hello World!!!\") == \"Hello !!!Wdlor\")\nassert(anti_shuffle(s: \"\") == \"\")\nassert(anti_shuffle(s: \"Hi. My name is Mister Robot. How are you?\") == \".Hi My aemn is Meirst .Rboot How aer ?ouy\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "swift", - "prompt": "\n/// Given a list of numbers, return whether or not they are sorted\n/// in ascending order. If list has more than 1 duplicate of the same\n/// number, return False. Assume no negative numbers and only integers.\n/// Examples\nfunc is_sorted(lst: [Int]) -> Bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_sorted(lst: [5]) == true)\nassert(is_sorted(lst: [1, 2, 3, 4, 5]) == true)\nassert(is_sorted(lst: [1, 3, 2, 4, 5]) == false)\nassert(is_sorted(lst: [1, 2, 3, 4, 5, 6]) == true)\nassert(is_sorted(lst: [1, 2, 3, 4, 5, 6, 7]) == true)\nassert(is_sorted(lst: [1, 3, 2, 4, 5, 6, 7]) == false)\nassert(is_sorted(lst: [] as [Int]) == true)\nassert(is_sorted(lst: [1]) == true)\nassert(is_sorted(lst: [3, 2, 1]) == false)\nassert(is_sorted(lst: [1, 2, 2, 2, 3, 4]) == false)\nassert(is_sorted(lst: [1, 2, 3, 3, 3, 4]) == false)\nassert(is_sorted(lst: [1, 2, 2, 3, 3, 4]) == true)\nassert(is_sorted(lst: [1, 2, 3, 4]) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "swift", - "prompt": "\n/// You are given a string s.\n/// Your task is to check if the string is happy or not.\n/// A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n/// For example:\nfunc is_happy(s: String) -> Bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_happy(s: \"a\") == false)\nassert(is_happy(s: \"aa\") == false)\nassert(is_happy(s: \"abcd\") == true)\nassert(is_happy(s: \"aabb\") == false)\nassert(is_happy(s: \"adb\") == true)\nassert(is_happy(s: \"xyy\") == false)\nassert(is_happy(s: \"iopaxpoi\") == true)\nassert(is_happy(s: \"iopaxioi\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "swift", - "prompt": "\n/// Write a function that returns True if the object q will fly, and False otherwise.\n/// The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n/// Example:\n/// # 1+2 is less than the maximum possible weight, but it's unbalanced.\n/// # it's balanced, but 3+2+3 is more than the maximum possible weight.\n/// # 3+2+3 is less than the maximum possible weight, and it's balanced.\n/// # 3 is less than the maximum possible weight, and it's balanced.\nfunc will_it_fly(q: [Int], w: Int) -> Bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(will_it_fly(q: [3, 2, 3], w: 9) == true)\nassert(will_it_fly(q: [1, 2], w: 5) == false)\nassert(will_it_fly(q: [3], w: 5) == true)\nassert(will_it_fly(q: [3, 2, 3], w: 1) == false)\nassert(will_it_fly(q: [1, 2, 3], w: 6) == false)\nassert(will_it_fly(q: [5], w: 5) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "swift", - "prompt": "\n/// Given an array of non-negative integers, return a copy of the given array after sorting,\n/// you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n/// or sort it in descending order if the sum( first index value, last index value) is even.\n/// Note:\n/// * don't change the given array.\n/// Examples:\nfunc sort_array(array: [Int]) -> [Int] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sort_array(array: [] as [Int]) == [] as [Int])\nassert(sort_array(array: [5]) == [5])\nassert(sort_array(array: [2, 4, 3, 0, 1, 5]) == [0, 1, 2, 3, 4, 5])\nassert(sort_array(array: [2, 4, 3, 0, 1, 5, 6]) == [6, 5, 4, 3, 2, 1, 0])\nassert(sort_array(array: [2, 1]) == [1, 2])\nassert(sort_array(array: [15, 42, 87, 32, 11, 0]) == [0, 11, 15, 32, 42, 87])\nassert(sort_array(array: [21, 14, 23, 11]) == [23, 21, 14, 11])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "swift", - "prompt": "\n/// Implement a function that takes an non-negative integer and returns an array of the first n\n/// integers that are prime numbers and less than n.\n/// for example:\nfunc count_up_to(n: Int) -> [Int] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(count_up_to(n: 5) == [2, 3])\nassert(count_up_to(n: 6) == [2, 3, 5])\nassert(count_up_to(n: 7) == [2, 3, 5])\nassert(count_up_to(n: 10) == [2, 3, 5, 7])\nassert(count_up_to(n: 0) == [] as [Int])\nassert(count_up_to(n: 22) == [2, 3, 5, 7, 11, 13, 17, 19])\nassert(count_up_to(n: 1) == [] as [Int])\nassert(count_up_to(n: 18) == [2, 3, 5, 7, 11, 13, 17])\nassert(count_up_to(n: 47) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43])\nassert(count_up_to(n: 101) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "swift", - "prompt": "\n/// Out of list of strings, return the longest one. Return the first one in case of multiple\n/// strings of the same length. Return None in case the input list is empty.\nfunc longest(strings: [String]) -> String? {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(longest(strings: [] as [String]) == nil)\nassert(longest(strings: [\"x\", \"y\", \"z\"]) == \"x\")\nassert(longest(strings: [\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"]) == \"zzzz\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "swift", - "prompt": "\n/// Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n/// reverse the resulting array, and then replace each digit by its corresponding name from\n/// \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n/// For example:\n/// If the array is empty, return an empty array:\n/// If the array has any strange number ignore it:\nfunc by_length(arr: [Int]) -> [String] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(by_length(arr: [2, 1, 1, 4, 5, 8, 2, 3]) == [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"])\nassert(by_length(arr: [] as [Int]) == [] as [String])\nassert(by_length(arr: [1, -1, 55]) == [\"One\"])\nassert(by_length(arr: [1, -1, 3, 2]) == [\"Three\", \"Two\", \"One\"])\nassert(by_length(arr: [9, 4, 8]) == [\"Nine\", \"Eight\", \"Four\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_106_f", - "language": "swift", - "prompt": "\n/// Implement the function f that takes n as a parameter,\n/// 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\n/// or the sum of numbers from 1 to i otherwise.\n/// i starts from 1.\n/// the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n/// Example:\nfunc f(n: Int) -> [Int] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(f(n: 5) == [1, 2, 6, 24, 15])\nassert(f(n: 7) == [1, 2, 6, 24, 15, 720, 28])\nassert(f(n: 1) == [1])\nassert(f(n: 3) == [1, 2, 6])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "swift", - "prompt": "\n/// Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\nfunc fizz_buzz(n: Int) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(fizz_buzz(n: 50) == 0)\nassert(fizz_buzz(n: 78) == 2)\nassert(fizz_buzz(n: 79) == 3)\nassert(fizz_buzz(n: 100) == 3)\nassert(fizz_buzz(n: 200) == 6)\nassert(fizz_buzz(n: 4000) == 192)\nassert(fizz_buzz(n: 10000) == 639)\nassert(fizz_buzz(n: 100000) == 8026)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "swift", - "prompt": "\n/// Given a positive floating point number, it can be decomposed into\n/// and integer part (largest integer smaller than given number) and decimals\n/// (leftover part always smaller than 1).\n/// Return the decimal part of the number.\nfunc truncate_number(number: Double) -> Double {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(truncate_number(number: 3.5) == 0.5)\nassert(truncate_number(number: 1.25) == 0.25)\nassert(truncate_number(number: 123.0) == 0.0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "swift", - "prompt": "\n/// For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n/// Empty sum should be equal to 0 and empty product should be equal to 1.\nfunc sum_product(numbers: [Int]) -> (Int, Int) {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sum_product(numbers: [] as [Int]) == (0, 1))\nassert(sum_product(numbers: [1, 1, 1]) == (3, 1))\nassert(sum_product(numbers: [100, 0]) == (100, 0))\nassert(sum_product(numbers: [3, 5, 7]) == (15, 105))\nassert(sum_product(numbers: [10]) == (10, 10))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "swift", - "prompt": "\n/// You are given a 2 dimensional data, as a nested lists,\n/// which is similar to matrix, however, unlike matrices,\n/// each row may contain a different number of columns.\n/// Given lst, and integer x, find integers x in the list,\n/// and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n/// each tuple is a coordinate - (row, columns), starting with 0.\n/// Sort coordinates initially by rows in ascending order.\n/// Also, sort coordinates of the row by columns in descending order.\n/// Examples:\nfunc get_row(lst: [[Int]], x: Int) -> [(Int, Int)] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(get_row(lst: [[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], x: 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)])\nassert(get_row(lst: [[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6]], x: 2) == [(0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1)])\nassert(get_row(lst: [[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 1, 3, 4, 5, 6], [1, 2, 1, 4, 5, 6], [1, 2, 3, 1, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], x: 1) == [(0, 0), (1, 0), (2, 1), (2, 0), (3, 2), (3, 0), (4, 3), (4, 0), (5, 4), (5, 0), (6, 5), (6, 0)])\nassert(get_row(lst: [] as [[Int]], x: 1) == [] as [(Int, Int)])\nassert(get_row(lst: [[1]], x: 2) == [] as [(Int, Int)])\nassert(get_row(lst: [[] as [Int], [1], [1, 2, 3]], x: 3) == [(2, 2)])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "swift", - "prompt": "\n/// You're a hungry rabbit, and you already have eaten a certain number of carrots,\n/// but now you need to eat more carrots to complete the day's meals.\n/// you should return an array of [ total number of eaten carrots after your meals,\n/// the number of carrots left after your meals ]\n/// if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n/// Example:\n/// Variables:\n/// @number : integer\n/// the number of carrots that you have eaten.\n/// @need : integer\n/// the number of carrots that you need to eat.\n/// @remaining : integer\n/// the number of remaining carrots thet exist in stock\n/// Constrain:\n/// * 0 <= number <= 1000\n/// * 0 <= need <= 1000\n/// * 0 <= remaining <= 1000\n/// Have fun :)\nfunc eat(number: Int, need: Int, remaining: Int) -> [Int] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(eat(number: 5, need: 6, remaining: 10) == [11, 4])\nassert(eat(number: 4, need: 8, remaining: 9) == [12, 1])\nassert(eat(number: 1, need: 10, remaining: 10) == [11, 0])\nassert(eat(number: 2, need: 11, remaining: 5) == [7, 0])\nassert(eat(number: 4, need: 5, remaining: 7) == [9, 2])\nassert(eat(number: 4, need: 5, remaining: 1) == [5, 0])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "swift", - "prompt": "\n/// Given a positive integer N, return the total sum of its digits in binary.\n/// Example\n/// Variables:\n/// @N integer\n/// Constraints: 0 \u2264 N \u2264 10000.\n/// Output:\n/// a string of binary number\nfunc solve(N: Int) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(solve(N: 1000) == \"1\")\nassert(solve(N: 150) == \"110\")\nassert(solve(N: 147) == \"1100\")\nassert(solve(N: 333) == \"1001\")\nassert(solve(N: 963) == \"10010\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "swift", - "prompt": "\n/// You are given a list of integers.\n/// You need to find the largest prime value and return the sum of its digits.\n/// Examples:\nfunc skjkasdkd(lst: [Int]) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(skjkasdkd(lst: [0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]) == 10)\nassert(skjkasdkd(lst: [1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]) == 25)\nassert(skjkasdkd(lst: [1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]) == 13)\nassert(skjkasdkd(lst: [0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]) == 11)\nassert(skjkasdkd(lst: [0, 81, 12, 3, 1, 21]) == 3)\nassert(skjkasdkd(lst: [0, 8, 1, 2, 1, 7]) == 7)\nassert(skjkasdkd(lst: [8191]) == 19)\nassert(skjkasdkd(lst: [8191, 123456, 127, 7]) == 19)\nassert(skjkasdkd(lst: [127, 97, 8192]) == 10)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "swift", - "prompt": "\n/// Given an array arr of integers, find the minimum number of elements that\n/// need to be changed to make the array palindromic. A palindromic array is an array that\n/// is read the same backwards and forwards. In one change, you can change one element to any other element.\n/// For example:\nfunc smallest_change(arr: [Int]) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(smallest_change(arr: [1, 2, 3, 5, 4, 7, 9, 6]) == 4)\nassert(smallest_change(arr: [1, 2, 3, 4, 3, 2, 2]) == 1)\nassert(smallest_change(arr: [1, 4, 2]) == 1)\nassert(smallest_change(arr: [1, 4, 4, 2]) == 1)\nassert(smallest_change(arr: [1, 2, 3, 2, 1]) == 0)\nassert(smallest_change(arr: [3, 1, 1, 3]) == 0)\nassert(smallest_change(arr: [1]) == 0)\nassert(smallest_change(arr: [0, 1]) == 1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "swift", - "prompt": "\n/// It is the last week of the semester and the teacher has to give the grades\n/// to students. The teacher has been making her own algorithm for grading.\n/// The only problem is, she has lost the code she used for grading.\n/// She has given you a list of GPAs for some students and you have to write \n/// a function that can output a list of letter grades using the following table:\n/// GPA | Letter grade\n/// 4.0 A+\n/// > 3.7 A \n/// > 3.3 A- \n/// > 3.0 B+\n/// > 2.7 B \n/// > 2.3 B-\n/// > 2.0 C+\n/// > 1.7 C\n/// > 1.3 C-\n/// > 1.0 D+ \n/// > 0.7 D \n/// > 0.0 D-\n/// 0.0 E\n/// Example:\nfunc numerical_letter_grade(grades: [Double]) -> [String] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(numerical_letter_grade(grades: [4.0, 3, 1.7, 2, 3.5]) == [\"A+\", \"B\", \"C-\", \"C\", \"A-\"])\nassert(numerical_letter_grade(grades: [1.2]) == [\"D+\"])\nassert(numerical_letter_grade(grades: [0.5]) == [\"D-\"])\nassert(numerical_letter_grade(grades: [0.0]) == [\"E\"])\nassert(numerical_letter_grade(grades: [1.0, 0.3, 1.5, 2.8, 3.3]) == [\"D\", \"D-\", \"C-\", \"B\", \"B+\"])\nassert(numerical_letter_grade(grades: [0.0, 0.7]) == [\"E\", \"D-\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "swift", - "prompt": "\n/// Given the lengths of the three sides of a triangle. Return the area of\n/// the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n/// Otherwise return -1\n/// Three sides make a valid triangle when the sum of any two sides is greater \n/// than the third side.\n/// Example:\nfunc triangle_area(a: Int, b: Int, c: Int) -> Double {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(triangle_area(a: 3, b: 4, c: 5) == 6.0)\nassert(triangle_area(a: 1, b: 2, c: 10) == -1)\nassert(triangle_area(a: 4, b: 8, c: 5) == 8.18)\nassert(triangle_area(a: 2, b: 2, c: 2) == 1.73)\nassert(triangle_area(a: 1, b: 2, c: 3) == -1)\nassert(triangle_area(a: 10, b: 5, c: 7) == 16.25)\nassert(triangle_area(a: 2, b: 6, c: 3) == -1)\nassert(triangle_area(a: 1, b: 1, c: 1) == 0.43)\nassert(triangle_area(a: 2, b: 2, c: 10) == -1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "swift", - "prompt": "\n/// Check if two words have the same characters.\nfunc same_chars(s0: String, s1: String) -> Bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(same_chars(s0: \"eabcdzzzz\", s1: \"dddzzzzzzzddeddabc\") == true)\nassert(same_chars(s0: \"abcd\", s1: \"dddddddabc\") == true)\nassert(same_chars(s0: \"dddddddabc\", s1: \"abcd\") == true)\nassert(same_chars(s0: \"eabcd\", s1: \"dddddddabc\") == false)\nassert(same_chars(s0: \"abcd\", s1: \"dddddddabcf\") == false)\nassert(same_chars(s0: \"eabcdzzzz\", s1: \"dddzzzzzzzddddabc\") == false)\nassert(same_chars(s0: \"aabb\", s1: \"aaccc\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "swift", - "prompt": "\n/// Given an array of integers nums, find the minimum sum of any non-empty sub-array\n/// of nums.\n/// Example\nfunc minSubArraySum(nums: [Int]) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(minSubArraySum(nums: [2, 3, 4, 1, 2, 4]) == 1)\nassert(minSubArraySum(nums: [-1, -2, -3]) == -6)\nassert(minSubArraySum(nums: [-1, -2, -3, 2, -10]) == -14)\nassert(minSubArraySum(nums: [-9999999999999999]) == -9999999999999999)\nassert(minSubArraySum(nums: [0, 10, 20, 1000000]) == 0)\nassert(minSubArraySum(nums: [-1, -2, -3, 10, -5]) == -6)\nassert(minSubArraySum(nums: [100, -1, -2, -3, 10, -5]) == -6)\nassert(minSubArraySum(nums: [10, 11, 13, 8, 3, 4]) == 3)\nassert(minSubArraySum(nums: [100, -33, 32, -1, 0, -2]) == -33)\nassert(minSubArraySum(nums: [-10]) == -10)\nassert(minSubArraySum(nums: [7]) == 7)\nassert(minSubArraySum(nums: [1, -1]) == -1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "swift", - "prompt": "\n/// Given a string s and a natural number n, you have been tasked to implement \n/// a function that returns a list of all words from string s that contain exactly \n/// n consonants, in order these words appear in the string s.\n/// If the string s is empty then the function should return an empty list.\n/// Note: you may assume the input string contains only letters and spaces.\n/// Examples:\nfunc select_words(s: String, n: Int) -> [String] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(select_words(s: \"Mary had a little lamb\", n: 4) == [\"little\"])\nassert(select_words(s: \"Mary had a little lamb\", n: 3) == [\"Mary\", \"lamb\"])\nassert(select_words(s: \"simple white space\", n: 2) == [] as [String])\nassert(select_words(s: \"Hello world\", n: 4) == [\"world\"])\nassert(select_words(s: \"Uncle sam\", n: 3) == [\"Uncle\"])\nassert(select_words(s: \"\", n: 4) == [] as [String])\nassert(select_words(s: \"a b c d e f\", n: 1) == [\"b\", \"c\", \"d\", \"f\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "swift", - "prompt": "\n/// Return list of all prefixes from shortest to longest of the input string\nfunc all_prefixes(string: String) -> [String] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(all_prefixes(string: \"\") == [] as [String])\nassert(all_prefixes(string: \"asdfgh\") == [\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"])\nassert(all_prefixes(string: \"WWW\") == [\"W\", \"WW\", \"WWW\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "swift", - "prompt": "\n/// Create a function that takes a value (string) representing a number\n/// and returns the closest integer to it. If the number is equidistant\n/// from two integers, round it away from zero.\n/// Examples\n/// Note:\n/// Rounding away from zero means that if the given number is equidistant\n/// from two integers, the one you should return is the one that is the\n/// farthest from zero. For example closest_integer(\"14.5\") should\n/// return 15 and closest_integer(\"-14.5\") should return -15.\nfunc closest_integer(value: String) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(closest_integer(value: \"10\") == 10)\nassert(closest_integer(value: \"14.5\") == 15)\nassert(closest_integer(value: \"-15.5\") == -16)\nassert(closest_integer(value: \"15.3\") == 15)\nassert(closest_integer(value: \"0\") == 0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "swift", - "prompt": "\n/// Create a function which takes a string representing a file's name, and returns\n/// 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n/// A file's name is considered to be valid if and only if all the following conditions \n/// are met:\n/// - There should not be more than three digits ('0'-'9') in the file's name.\n/// - The file's name contains exactly one dot '.'\n/// - The substring before the dot should not be empty, and it starts with a letter from \n/// the latin alphapet ('a'-'z' and 'A'-'Z').\n/// - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n/// Examples:\nfunc file_name_check(file_name: String) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(file_name_check(file_name: \"example.txt\") == \"Yes\")\nassert(file_name_check(file_name: \"1example.dll\") == \"No\")\nassert(file_name_check(file_name: \"s1sdf3.asd\") == \"No\")\nassert(file_name_check(file_name: \"K.dll\") == \"Yes\")\nassert(file_name_check(file_name: \"MY16FILE3.exe\") == \"Yes\")\nassert(file_name_check(file_name: \"His12FILE94.exe\") == \"No\")\nassert(file_name_check(file_name: \"_Y.txt\") == \"No\")\nassert(file_name_check(file_name: \"?aREYA.exe\") == \"No\")\nassert(file_name_check(file_name: \"/this_is_valid.dll\") == \"No\")\nassert(file_name_check(file_name: \"this_is_valid.wow\") == \"No\")\nassert(file_name_check(file_name: \"this_is_valid.txt\") == \"Yes\")\nassert(file_name_check(file_name: \"this_is_valid.txtexe\") == \"No\")\nassert(file_name_check(file_name: \"#this2_i4s_5valid.ten\") == \"No\")\nassert(file_name_check(file_name: \"@this1_is6_valid.exe\") == \"No\")\nassert(file_name_check(file_name: \"this_is_12valid.6exe4.txt\") == \"No\")\nassert(file_name_check(file_name: \"all.exe.txt\") == \"No\")\nassert(file_name_check(file_name: \"I563_No.exe\") == \"Yes\")\nassert(file_name_check(file_name: \"Is3youfault.txt\") == \"Yes\")\nassert(file_name_check(file_name: \"no_one#knows.dll\") == \"Yes\")\nassert(file_name_check(file_name: \"1I563_Yes3.exe\") == \"No\")\nassert(file_name_check(file_name: \"I563_Yes3.txtt\") == \"No\")\nassert(file_name_check(file_name: \"final..txt\") == \"No\")\nassert(file_name_check(file_name: \"final132\") == \"No\")\nassert(file_name_check(file_name: \"_f4indsartal132.\") == \"No\")\nassert(file_name_check(file_name: \".txt\") == \"No\")\nassert(file_name_check(file_name: \"s.\") == \"No\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "swift", - "prompt": "\n/// You are given two intervals,\n/// where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n/// The given intervals are closed which means that the interval (start, end)\n/// includes both start and end.\n/// For each given interval, it is assumed that its start is less or equal its end.\n/// Your task is to determine whether the length of intersection of these two \n/// intervals is a prime number.\n/// Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n/// which its length is 1, which not a prime number.\n/// If the length of the intersection is a prime number, return \"YES\",\n/// otherwise, return \"NO\".\n/// If the two intervals don't intersect, return \"NO\".\n/// [input/output] samples:\nfunc intersection(interval1: (Int, Int), interval2: (Int, Int)) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(intersection(interval1: (1, 2), interval2: (2, 3)) == \"NO\")\nassert(intersection(interval1: (-1, 1), interval2: (0, 4)) == \"NO\")\nassert(intersection(interval1: (-3, -1), interval2: (-5, 5)) == \"YES\")\nassert(intersection(interval1: (-2, 2), interval2: (-4, 0)) == \"YES\")\nassert(intersection(interval1: (-11, 2), interval2: (-1, -1)) == \"NO\")\nassert(intersection(interval1: (1, 2), interval2: (3, 5)) == \"NO\")\nassert(intersection(interval1: (1, 2), interval2: (1, 2)) == \"NO\")\nassert(intersection(interval1: (-2, -2), interval2: (-3, -2)) == \"NO\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "swift", - "prompt": "\n/// Return the largest prime factor of n. Assume n > 1 and is not a prime.\nfunc largest_prime_factor(n: Int) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(largest_prime_factor(n: 15) == 5)\nassert(largest_prime_factor(n: 27) == 3)\nassert(largest_prime_factor(n: 63) == 7)\nassert(largest_prime_factor(n: 330) == 11)\nassert(largest_prime_factor(n: 13195) == 29)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "swift", - "prompt": "\n/// Given a string, find out how many distinct characters (regardless of case) does it consist of\nfunc count_distinct_characters(string: String) -> Int {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(count_distinct_characters(string: \"\") == 0)\nassert(count_distinct_characters(string: \"abcde\") == 5)\nassert(count_distinct_characters(string: \"abcdecadeCADE\") == 5)\nassert(count_distinct_characters(string: \"aaaaAAAAaaaa\") == 1)\nassert(count_distinct_characters(string: \"Jerry jERRY JeRRRY\") == 5)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "swift", - "prompt": "\n/// You're given a list of deposit and withdrawal operations on a bank account that starts with\n/// zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n/// at that point function should return True. Otherwise it should return False.\nfunc below_zero(operations: [Int]) -> Bool {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(below_zero(operations: [] as [Int]) == false)\nassert(below_zero(operations: [1, 2, -3, 1, 2, -3]) == false)\nassert(below_zero(operations: [1, 2, -4, 5, 6]) == true)\nassert(below_zero(operations: [1, -1, 2, -2, 5, -5, 4, -4]) == false)\nassert(below_zero(operations: [1, -1, 2, -2, 5, -5, 4, -5]) == true)\nassert(below_zero(operations: [1, -2, 2, -2, 5, -5, 4, -4]) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "swift", - "prompt": "\n/// Find the shortest palindrome that begins with a supplied string.\n/// Algorithm idea is simple:\n/// - Find the longest postfix of supplied string that is a palindrome.\n/// - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\nfunc make_palindrome(string: String) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(make_palindrome(string: \"\") == \"\")\nassert(make_palindrome(string: \"x\") == \"x\")\nassert(make_palindrome(string: \"xyz\") == \"xyzyx\")\nassert(make_palindrome(string: \"xyx\") == \"xyx\")\nassert(make_palindrome(string: \"jerry\") == \"jerryrrej\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "swift", - "prompt": "\n/// Given a positive integer, obtain its roman numeral equivalent as a string,\n/// and return it in lowercase.\n/// Restrictions: 1 <= num <= 1000\n/// Examples:\nfunc int_to_mini_roman(number: Int) -> String {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(int_to_mini_roman(number: 19) == \"xix\")\nassert(int_to_mini_roman(number: 152) == \"clii\")\nassert(int_to_mini_roman(number: 251) == \"ccli\")\nassert(int_to_mini_roman(number: 426) == \"cdxxvi\")\nassert(int_to_mini_roman(number: 500) == \"d\")\nassert(int_to_mini_roman(number: 1) == \"i\")\nassert(int_to_mini_roman(number: 4) == \"iv\")\nassert(int_to_mini_roman(number: 43) == \"xliii\")\nassert(int_to_mini_roman(number: 90) == \"xc\")\nassert(int_to_mini_roman(number: 94) == \"xciv\")\nassert(int_to_mini_roman(number: 532) == \"dxxxii\")\nassert(int_to_mini_roman(number: 900) == \"cm\")\nassert(int_to_mini_roman(number: 994) == \"cmxciv\")\nassert(int_to_mini_roman(number: 1000) == \"m\")", - "stop_tokens": [ - "\n}" - ] - } -] \ No newline at end of file diff --git a/data/swift-reworded.json b/data/swift-reworded.json deleted file mode 100644 index a7b8a0be23697f85f2dbe79c29960302cfc8e75d..0000000000000000000000000000000000000000 --- a/data/swift-reworded.json +++ /dev/null @@ -1,1898 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "swift", - "prompt": "\n/// For a given number n, find the largest number that divides n evenly, smaller than n\n/// >>> largest_divisor(n: 15)\n/// 5\nfunc largest_divisor(n: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(largest_divisor(n: 3) == 1)\nassert(largest_divisor(n: 7) == 1)\nassert(largest_divisor(n: 10) == 5)\nassert(largest_divisor(n: 100) == 50)\nassert(largest_divisor(n: 49) == 7)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_47_median", - "language": "swift", - "prompt": "\n/// Return median of elements in the array l.\n/// >>> median(l: [3, 1, 2, 4, 5])\n/// 3\n/// >>> median(l: [-10, 4, 6, 1000, 10, 20])\n/// 15.0\nfunc median(l: [Int]) -> Double {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(median(l: [3, 1, 2, 4, 5]) == 3)\nassert(median(l: [-10, 4, 6, 1000, 10, 20]) == 8.0)\nassert(median(l: [5]) == 5)\nassert(median(l: [6, 5]) == 5.5)\nassert(median(l: [8, 1, 3, 9, 9, 2, 7]) == 7)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "swift", - "prompt": "\n/// Given two arrays operator, and operand. The first array has basic algebra operations, and \n/// the second array is an array of integers. Use the two given arrays to build the algebric \n/// expression and return the evaluation of this expression.\n/// The basic algebra operations:\n/// Addition ( + ) \n/// Subtraction ( - ) \n/// Multiplication ( * ) \n/// Floor division ( // ) \n/// Exponentiation ( ** ) \n/// Example:\n/// operator['+', '*', '-']\n/// array = [2, 3, 4, 5]\n/// result = 2 + 3 * 4 - 5\n/// => result = 9\n/// Note:\n/// The length of operator array is equal to the length of operand array minus one.\n/// Operand is an array of of non-negative integers.\n/// Operator array has at least one operator, and operand array has at least two operands.\nfunc do_algebra(operator: [String], operand: [Int]) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(do_algebra(operator: [\"**\", \"*\", \"+\"], operand: [2, 3, 4, 5]) == 37)\nassert(do_algebra(operator: [\"+\", \"*\", \"-\"], operand: [2, 3, 4, 5]) == 9)\nassert(do_algebra(operator: [\"//\", \"*\"], operand: [7, 3, 4]) == 8)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "swift", - "prompt": "\n/// Return maximum element in the array.\n/// >>> max_element(l: [1, 2, 3])\n/// 3\n/// >>> max_element(l: [5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n/// 123\nfunc max_element(l: [Int]) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(max_element(l: [1, 2, 3]) == 3)\nassert(max_element(l: [5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]) == 124)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "swift", - "prompt": "\n/// Create a function which returns the largest index of an element which\n/// is not greater than or equal to the element immediately preceding it. If\n/// no such element exists then return -1. The given array will not contain\n/// duplicate values.\n/// Examples:\n/// >>> can_arrange(arr: [1, 2, 4, 3, 5])\n/// 3\n/// >>> can_arrange(arr: [1, 2, 3])\n/// -1\nfunc can_arrange(arr: [Int]) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(can_arrange(arr: [1, 2, 4, 3, 5]) == 3)\nassert(can_arrange(arr: [1, 2, 4, 5]) == -1)\nassert(can_arrange(arr: [1, 4, 2, 5, 6, 7, 8, 9, 10]) == 2)\nassert(can_arrange(arr: [4, 8, 5, 7, 3]) == 4)\nassert(can_arrange(arr: [] as [Int]) == -1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "swift", - "prompt": "\n/// Imagine a road that's a perfectly straight infinitely long line.\n/// n cars are driving left to right; simultaneously, a different set of n cars\n/// are driving right to left. The two sets of cars start out being very far from\n/// each other. All cars move in the same speed. Two cars are said to collide\n/// when a car that's moving left to right hits a car that's moving right to left.\n/// However, the cars are infinitely sturdy and strong; as a result, they continue moving\n/// in their trajectory as if they did not collide.\n/// This function outputs the number of such collisions.\nfunc car_race_collision(n: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(car_race_collision(n: 2) == 4)\nassert(car_race_collision(n: 3) == 9)\nassert(car_race_collision(n: 4) == 16)\nassert(car_race_collision(n: 8) == 64)\nassert(car_race_collision(n: 10) == 100)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "swift", - "prompt": "\n/// Create a function that returns true if the last character\n/// of a given string is an alphabetical character and is not\n/// a part of a word, and false otherwise.\n/// Note: \"word\" is a group of characters separated by space.\n/// Examples:\n/// >>> check_if_last_char_is_a_letter(txt: \"apple pie\")\n/// false\n/// >>> check_if_last_char_is_a_letter(txt: \"apple pi e\")\n/// true\n/// >>> check_if_last_char_is_a_letter(txt: \"apple pi e \")\n/// false\n/// >>> check_if_last_char_is_a_letter(txt: \"\")\n/// false\nfunc check_if_last_char_is_a_letter(txt: String) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(check_if_last_char_is_a_letter(txt: \"apple\") == false)\nassert(check_if_last_char_is_a_letter(txt: \"apple pi e\") == true)\nassert(check_if_last_char_is_a_letter(txt: \"eeeee\") == false)\nassert(check_if_last_char_is_a_letter(txt: \"A\") == true)\nassert(check_if_last_char_is_a_letter(txt: \"Pumpkin pie \") == false)\nassert(check_if_last_char_is_a_letter(txt: \"Pumpkin pie 1\") == false)\nassert(check_if_last_char_is_a_letter(txt: \"\") == false)\nassert(check_if_last_char_is_a_letter(txt: \"eeeee e \") == false)\nassert(check_if_last_char_is_a_letter(txt: \"apple pie\") == false)\nassert(check_if_last_char_is_a_letter(txt: \"apple pi e \") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "swift", - "prompt": "\n/// Return true if a given number is prime, and false otherwise.\n/// >>> is_prime(n: 6)\n/// false\n/// >>> is_prime(n: 101)\n/// true\n/// >>> is_prime(n: 11)\n/// true\n/// >>> is_prime(n: 13441)\n/// true\n/// >>> is_prime(n: 61)\n/// true\n/// >>> is_prime(n: 4)\n/// false\n/// >>> is_prime(n: 1)\n/// false\nfunc is_prime(n: Int) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_prime(n: 6) == false)\nassert(is_prime(n: 101) == true)\nassert(is_prime(n: 11) == true)\nassert(is_prime(n: 13441) == true)\nassert(is_prime(n: 61) == true)\nassert(is_prime(n: 4) == false)\nassert(is_prime(n: 1) == false)\nassert(is_prime(n: 5) == true)\nassert(is_prime(n: 11) == true)\nassert(is_prime(n: 17) == true)\nassert(is_prime(n: 85) == false)\nassert(is_prime(n: 77) == false)\nassert(is_prime(n: 255379) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "swift", - "prompt": "\n/// Given an array of positive integers x. return a sorted array of all \n/// elements that hasn't any even digit.\n/// Note: Returned array should be sorted in increasing order.\n/// For example:\n/// >>> unique_digits(x: [15, 33, 1422, 1])\n/// [1, 15, 33]\n/// >>> unique_digits(x: [152, 323, 1422, 10])\n/// [] as [Int]\nfunc unique_digits(x: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(unique_digits(x: [15, 33, 1422, 1]) == [1, 15, 33])\nassert(unique_digits(x: [152, 323, 1422, 10]) == [] as [Int])\nassert(unique_digits(x: [12345, 2033, 111, 151]) == [111, 151])\nassert(unique_digits(x: [135, 103, 31]) == [31, 135])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "swift", - "prompt": "\n/// Input are two strings a and b consisting only of 1s and 0s.\n/// Perform binary XOR on these inputs and return result also as a string.\n/// >>> string_xor(a: \"010\", b: \"110\")\n/// \"100\"\nfunc string_xor(a: String, b: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(string_xor(a: \"111000\", b: \"101010\") == \"010010\")\nassert(string_xor(a: \"1\", b: \"1\") == \"0\")\nassert(string_xor(a: \"0101\", b: \"0000\") == \"0101\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "swift", - "prompt": "\n/// sum_to_n is a function that sums numbers from 1 to n.\n/// >>> sum_to_n(n: 30)\n/// 465\n/// >>> sum_to_n(n: 100)\n/// 5050\n/// >>> sum_to_n(n: 5)\n/// 15\n/// >>> sum_to_n(n: 10)\n/// 55\n/// >>> sum_to_n(n: 1)\n/// 1\nfunc sum_to_n(n: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sum_to_n(n: 1) == 1)\nassert(sum_to_n(n: 6) == 21)\nassert(sum_to_n(n: 11) == 66)\nassert(sum_to_n(n: 30) == 465)\nassert(sum_to_n(n: 100) == 5050)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "swift", - "prompt": "\n/// Given an array of numbers, return the sum of squares of the numbers\n/// in the array that are odd. Ignore numbers that are negative or not integers.\n/// >>> double_the_difference(lst: [1, 3, 2, 0])\n/// 10\n/// >>> double_the_difference(lst: [-1, -2, 0])\n/// 0\n/// >>> double_the_difference(lst: [9, -2])\n/// 81\n/// >>> double_the_difference(lst: [0])\n/// 0\n/// If the input array is empty, return 0.\nfunc double_the_difference(lst: [Double]) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(double_the_difference(lst: [] as [Double]) == 0)\nassert(double_the_difference(lst: [5.0, 4.0]) == 25)\nassert(double_the_difference(lst: [0.1, 0.2, 0.3]) == 0)\nassert(double_the_difference(lst: [-10.0, -20.0, -30.0]) == 0)\nassert(double_the_difference(lst: [-1.0, -2.0, 8.0]) == 0)\nassert(double_the_difference(lst: [0.2, 3.0, 5.0]) == 34)\nassert(double_the_difference(lst: [-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]) == 165)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "swift", - "prompt": "\n/// Return length of given string\n/// >>> strlen(string: \"\")\n/// 0\n/// >>> strlen(string: \"abc\")\n/// 3\nfunc strlen(string: String) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(strlen(string: \"\") == 0)\nassert(strlen(string: \"x\") == 1)\nassert(strlen(string: \"asdasnakj\") == 9)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "swift", - "prompt": "\n/// You'll be given a string of words, and your task is to count the number\n/// of boredoms. A boredom is a sentence that starts with the word \"I\".\n/// Sentences are delimited by '.', '?' or '!'.\n/// For example:\n/// >>> is_bored(S: \"Hello world\")\n/// 0\n/// >>> is_bored(S: \"The sky is blue. The sun is shining. I love this weather\")\n/// 1\nfunc is_bored(S: String) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_bored(S: \"Hello world\") == 0)\nassert(is_bored(S: \"Is the sky blue?\") == 0)\nassert(is_bored(S: \"I love It !\") == 1)\nassert(is_bored(S: \"bIt\") == 0)\nassert(is_bored(S: \"I feel good today. I will be productive. will kill It\") == 2)\nassert(is_bored(S: \"You and I are going for a walk\") == 0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "swift", - "prompt": "\n/// Write a function vowels_count which takes a string representing\n/// a word as input and returns the number of vowels in the string.\n/// Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n/// vowel, but only when it is at the end of the given word.\n/// Example:\n/// >>> vowels_count(s: \"abcde\")\n/// 2\n/// >>> vowels_count(s: \"ACEDY\")\n/// 3\nfunc vowels_count(s: String) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(vowels_count(s: \"abcde\") == 2)\nassert(vowels_count(s: \"Alone\") == 3)\nassert(vowels_count(s: \"key\") == 2)\nassert(vowels_count(s: \"bye\") == 1)\nassert(vowels_count(s: \"keY\") == 2)\nassert(vowels_count(s: \"bYe\") == 1)\nassert(vowels_count(s: \"ACEDY\") == 3)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "swift", - "prompt": "\n/// Return n-th Fibonacci number.\n/// >>> fib(n: 10)\n/// 55\n/// >>> fib(n: 1)\n/// 1\n/// >>> fib(n: 8)\n/// 21\nfunc fib(n: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(fib(n: 10) == 55)\nassert(fib(n: 1) == 1)\nassert(fib(n: 8) == 21)\nassert(fib(n: 11) == 89)\nassert(fib(n: 12) == 144)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "swift", - "prompt": "\n/// Your task is to implement a function that will simplify the expression\n/// x * n. The function returns true if x * n evaluates to a whole number and false\n/// otherwise. Both x and n, are string representation of a fraction, and have the following format,\n/// / where both numerator and denominator are positive whole numbers.\n/// You can assume that x, and n are valid fractions, and do not have zero as denominator.\n/// >>> simplify(x: \"1/5\", n: \"5/1\")\n/// true\n/// >>> simplify(x: \"1/6\", n: \"2/1\")\n/// false\n/// >>> simplify(x: \"7/10\", n: \"10/2\")\n/// false\nfunc simplify(x: String, n: String) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(simplify(x: \"1/5\", n: \"5/1\") == true)\nassert(simplify(x: \"1/6\", n: \"2/1\") == false)\nassert(simplify(x: \"5/1\", n: \"3/1\") == true)\nassert(simplify(x: \"7/10\", n: \"10/2\") == false)\nassert(simplify(x: \"2/10\", n: \"50/10\") == true)\nassert(simplify(x: \"7/2\", n: \"4/2\") == true)\nassert(simplify(x: \"11/6\", n: \"6/1\") == true)\nassert(simplify(x: \"2/3\", n: \"5/2\") == false)\nassert(simplify(x: \"5/2\", n: \"3/5\") == false)\nassert(simplify(x: \"2/4\", n: \"8/4\") == true)\nassert(simplify(x: \"2/4\", n: \"4/2\") == true)\nassert(simplify(x: \"1/5\", n: \"5/1\") == true)\nassert(simplify(x: \"1/5\", n: \"1/5\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "swift", - "prompt": "\n/// Given a string s, count the number of uppercase vowels in even indices.\n/// For example:\n/// >>> count_upper(s: \"aBCdEf\")\n/// 1\n/// >>> count_upper(s: \"abcdefg\")\n/// 0\n/// >>> count_upper(s: \"dBBE\")\n/// 0\nfunc count_upper(s: String) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(count_upper(s: \"aBCdEf\") == 1)\nassert(count_upper(s: \"abcdefg\") == 0)\nassert(count_upper(s: \"dBBE\") == 0)\nassert(count_upper(s: \"B\") == 0)\nassert(count_upper(s: \"U\") == 1)\nassert(count_upper(s: \"\") == 0)\nassert(count_upper(s: \"EEEE\") == 2)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "swift", - "prompt": "\n/// You are given a rectangular grid of wells. Each row represents a single well,\n/// and each 1 in a row represents a single unit of water.\n/// Each well has a corresponding bucket that can be used to extract water from it, \n/// and all buckets have the same capacity.\n/// Your task is to use the buckets to empty the wells.\n/// Output the number of times you need to lower the buckets.\n/// Example 1:\n/// >>> max_fill(grid: [[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], capacity: 1)\n/// 6\n/// Example 2:\n/// >>> max_fill(grid: [[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], capacity: 2)\n/// 5\n/// Example 3:\n/// >>> max_fill(grid: [[0, 0, 0], [0, 0, 0]], capacity: 5)\n/// 0\n/// Constraints:\n/// * all wells have the same length\n/// * 1 <= grid.length <= 10^2\n/// * 1 <= grid[:,1].length <= 10^2\n/// * grid[i][j] -> 0 | 1\n/// * 1 <= capacity <= 10\nfunc max_fill(grid: [[Int]], capacity: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(max_fill(grid: [[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], capacity: 1) == 6)\nassert(max_fill(grid: [[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], capacity: 2) == 5)\nassert(max_fill(grid: [[0, 0, 0], [0, 0, 0]], capacity: 5) == 0)\nassert(max_fill(grid: [[1, 1, 1, 1], [1, 1, 1, 1]], capacity: 2) == 4)\nassert(max_fill(grid: [[1, 1, 1, 1], [1, 1, 1, 1]], capacity: 9) == 2)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "swift", - "prompt": "\n/// Given an array arr of integers and a positive integer k, return a sorted array \n/// of length k with the maximum k numbers in arr.\n/// Example 1:\n/// >>> maximum(arr: [-3, -4, 5], k: 3)\n/// [-4, -3, 5]\n/// Example 2:\n/// >>> maximum(arr: [4, -4, 4], k: 2)\n/// [4, 4]\n/// Example 3:\n/// >>> maximum(arr: [-3, 2, 1, 2, -1, -2, 1], k: 1)\n/// [2]\n/// Note:\n/// 1. The length of the array will be in the range of [1, 1000].\n/// 2. The elements in the array will be in the range of [-1000, 1000].\n/// 3. 0 <= k <= len(arr)\nfunc maximum(arr: [Int], k: Int) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(maximum(arr: [-3, -4, 5], k: 3) == [-4, -3, 5])\nassert(maximum(arr: [4, -4, 4], k: 2) == [4, 4])\nassert(maximum(arr: [-3, 2, 1, 2, -1, -2, 1], k: 1) == [2])\nassert(maximum(arr: [123, -123, 20, 0, 1, 2, -3], k: 3) == [2, 20, 123])\nassert(maximum(arr: [-123, 20, 0, 1, 2, -3], k: 4) == [0, 1, 2, 20])\nassert(maximum(arr: [5, 15, 0, 3, -13, -8, 0], k: 7) == [-13, -8, 0, 0, 3, 5, 15])\nassert(maximum(arr: [-1, 0, 2, 5, 3, -10], k: 2) == [3, 5])\nassert(maximum(arr: [1, 0, 5, -7], k: 1) == [5])\nassert(maximum(arr: [4, -4], k: 2) == [-4, 4])\nassert(maximum(arr: [-10, 10], k: 2) == [-10, 10])\nassert(maximum(arr: [1, 2, 3, -23, 243, -400, 0], k: 0) == [] as [Int])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "swift", - "prompt": "\n/// Write a function that takes a message, and encodes in such a \n/// way that it swaps case of all letters, replaces all vowels in \n/// the message with the letter that appears 2 places ahead of that \n/// vowel in the english alphabet. \n/// Assume only letters. \n/// Examples:\n/// >>> encode(message: \"test\")\n/// \"TGST\"\n/// >>> encode(message: \"This is a message\")\n/// \"tHKS KS C MGSSCGG\"\nfunc encode(message: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(encode(message: \"TEST\") == \"tgst\")\nassert(encode(message: \"Mudasir\") == \"mWDCSKR\")\nassert(encode(message: \"YES\") == \"ygs\")\nassert(encode(message: \"This is a message\") == \"tHKS KS C MGSSCGG\")\nassert(encode(message: \"I DoNt KnOw WhAt tO WrItE\") == \"k dQnT kNqW wHcT Tq wRkTg\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "swift", - "prompt": "\n/// remove_vowels is a function that takes string and returns string without vowels.\n/// >>> remove_vowels(text: \"\")\n/// \"\"\n/// >>> remove_vowels(text: \"abcdef\")\n/// \"bcdf\"\n/// >>> remove_vowels(text: \"aaaaa\")\n/// \"\"\n/// >>> remove_vowels(text: \"aaBAA\")\n/// \"B\"\n/// >>> remove_vowels(text: \"zbcd\")\n/// \"zbcd\"\nfunc remove_vowels(text: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(remove_vowels(text: \"\") == \"\")\nassert(remove_vowels(text: \"abcdef\\nghijklm\") == \"bcdf\\nghjklm\")\nassert(remove_vowels(text: \"fedcba\") == \"fdcb\")\nassert(remove_vowels(text: \"eeeee\") == \"\")\nassert(remove_vowels(text: \"acBAA\") == \"cB\")\nassert(remove_vowels(text: \"EcBOO\") == \"cB\")\nassert(remove_vowels(text: \"ybcd\") == \"ybcd\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "swift", - "prompt": "\n/// Return only positive numbers in the array.\n/// >>> get_positive(l: [-1, 2, -4, 5, 6])\n/// [2, 5, 6]\n/// >>> get_positive(l: [5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n/// [5, 3, 2, 3, 9, 123, 1]\nfunc get_positive(l: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(get_positive(l: [-1, -2, 4, 5, 6]) == [4, 5, 6])\nassert(get_positive(l: [5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]) == [5, 3, 2, 3, 3, 9, 123, 1])\nassert(get_positive(l: [-1, -2]) == [] as [Int])\nassert(get_positive(l: [] as [Int]) == [] as [Int])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "swift", - "prompt": "\n/// Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n/// >>> string_sequence(n: 0)\n/// \"0\"\n/// >>> string_sequence(n: 5)\n/// \"0 1 2 3 4 5\"\nfunc string_sequence(n: Int) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(string_sequence(n: 0) == \"0\")\nassert(string_sequence(n: 3) == \"0 1 2 3\")\nassert(string_sequence(n: 10) == \"0 1 2 3 4 5 6 7 8 9 10\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "swift", - "prompt": "\n/// Given a positive integer n, you have to make a pile of n levels of stones.\n/// The first level has n stones.\n/// The number of stones in the next level is:\n/// - the next odd number if n is odd.\n/// - the next even number if n is even.\n/// Return the number of stones in each level in an array, where element at index\n/// i represents the number of stones in the level (i+1).\n/// Examples:\n/// >>> make_a_pile(n: 3)\n/// [3, 5, 7]\nfunc make_a_pile(n: Int) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(make_a_pile(n: 3) == [3, 5, 7])\nassert(make_a_pile(n: 4) == [4, 6, 8, 10])\nassert(make_a_pile(n: 5) == [5, 7, 9, 11, 13])\nassert(make_a_pile(n: 6) == [6, 8, 10, 12, 14, 16])\nassert(make_a_pile(n: 8) == [8, 10, 12, 14, 16, 18, 20, 22])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "swift", - "prompt": "\n/// Task\n/// 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\n/// then check if the result string is palindrome.\n/// A string is called palindrome if it reads the same backward as forward.\n/// You should return a tuple containing the result string and true/false for the check.\n/// Example\n/// >>> reverse_delete(s: \"abcde\", c: \"ae\")\n/// (\"bcd\", false)\n/// >>> reverse_delete(s: \"abcdef\", c: \"b\")\n/// (\"acdef\", false)\n/// >>> reverse_delete(s: \"abcdedcba\", c: \"ab\")\n/// (\"cdedc\", true)\nfunc reverse_delete(s: String, c: String) -> (String, Bool) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(reverse_delete(s: \"abcde\", c: \"ae\") == (\"bcd\", false))\nassert(reverse_delete(s: \"abcdef\", c: \"b\") == (\"acdef\", false))\nassert(reverse_delete(s: \"abcdedcba\", c: \"ab\") == (\"cdedc\", true))\nassert(reverse_delete(s: \"dwik\", c: \"w\") == (\"dik\", false))\nassert(reverse_delete(s: \"a\", c: \"a\") == (\"\", true))\nassert(reverse_delete(s: \"abcdedcba\", c: \"\") == (\"abcdedcba\", true))\nassert(reverse_delete(s: \"abcdedcba\", c: \"v\") == (\"abcdedcba\", true))\nassert(reverse_delete(s: \"vabba\", c: \"v\") == (\"abba\", true))\nassert(reverse_delete(s: \"mamma\", c: \"mia\") == (\"\", true))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "swift", - "prompt": "\n/// For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n/// >>> flip_case(string: \"Hello\")\n/// \"hELLO\"\nfunc flip_case(string: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(flip_case(string: \"\") == \"\")\nassert(flip_case(string: \"Hello!\") == \"hELLO!\")\nassert(flip_case(string: \"These violent delights have violent ends\") == \"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "swift", - "prompt": "\n/// You are given a string s.\n/// if s[i] is a letter, reverse its case from lower to upper or vise versa, \n/// otherwise keep it as it is.\n/// If the string contains no letters, reverse the string.\n/// The function should return the resulted string.\n/// Examples\n/// >>> solve(s: \"1234\")\n/// \"4321\"\n/// >>> solve(s: \"ab\")\n/// \"AB\"\n/// >>> solve(s: \"#a@C\")\n/// \"#A@c\"\nfunc solve(s: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(solve(s: \"AsDf\") == \"aSdF\")\nassert(solve(s: \"1234\") == \"4321\")\nassert(solve(s: \"ab\") == \"AB\")\nassert(solve(s: \"#a@C\") == \"#A@c\")\nassert(solve(s: \"#AsdfW^45\") == \"#aSDFw^45\")\nassert(solve(s: \"#6@2\") == \"2@6#\")\nassert(solve(s: \"#$a^D\") == \"#$A^d\")\nassert(solve(s: \"#ccc\") == \"#CCC\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "swift", - "prompt": "\n/// Filter an input array of strings only for ones that start with a given prefix.\n/// >>> filter_by_prefix(strings: [] as [String], prefix: \"a\")\n/// [] as [String]\n/// >>> filter_by_prefix(strings: [\"abc\", \"bcd\", \"cde\", \"array\"], prefix: \"a\")\n/// [\"abc\", \"array\"]\nfunc filter_by_prefix(strings: [String], prefix: String) -> [String] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(filter_by_prefix(strings: [] as [String], prefix: \"john\") == [] as [String])\nassert(filter_by_prefix(strings: [\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], prefix: \"xxx\") == [\"xxx\", \"xxxAAA\", \"xxx\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "swift", - "prompt": "\n/// This function takes two positive numbers x and y and returns the\n/// biggest even integer number that is in the range [x, y] inclusive. If \n/// there's no such number, then the function should return -1.\n/// For example:\n/// >>> choose_num(x: 12, y: 15)\n/// 14\n/// >>> choose_num(x: 13, y: 12)\n/// -1\nfunc choose_num(x: Int, y: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(choose_num(x: 12, y: 15) == 14)\nassert(choose_num(x: 13, y: 12) == -1)\nassert(choose_num(x: 33, y: 12354) == 12354)\nassert(choose_num(x: 5234, y: 5233) == -1)\nassert(choose_num(x: 6, y: 29) == 28)\nassert(choose_num(x: 27, y: 10) == -1)\nassert(choose_num(x: 7, y: 7) == -1)\nassert(choose_num(x: 546, y: 546) == 546)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "swift", - "prompt": "\n/// You are given a string representing a sentence,\n/// the sentence contains some words separated by a space,\n/// and you have to return a string that contains the words from the original sentence,\n/// whose lengths are prime numbers,\n/// the order of the words in the new string should be the same as the original one.\n/// Example 1:\n/// >>> words_in_sentence(sentence: \"This is a test\")\n/// \"is\"\n/// Example 2:\n/// >>> words_in_sentence(sentence: \"lets go for swimming\")\n/// \"go for\"\n/// Constraints:\n/// * 1 <= len(sentence) <= 100\n/// * sentence contains only letters\nfunc words_in_sentence(sentence: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(words_in_sentence(sentence: \"This is a test\") == \"is\")\nassert(words_in_sentence(sentence: \"lets go for swimming\") == \"go for\")\nassert(words_in_sentence(sentence: \"there is no place available here\") == \"there is no place\")\nassert(words_in_sentence(sentence: \"Hi I am Hussein\") == \"Hi am Hussein\")\nassert(words_in_sentence(sentence: \"go for it\") == \"go for it\")\nassert(words_in_sentence(sentence: \"here\") == \"\")\nassert(words_in_sentence(sentence: \"here is\") == \"is\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "swift", - "prompt": "\n/// Insert a number 'delimeter' between every two consecutive elements of input array `numbers'\n/// >>> intersperse(numbers: [] as [Int], delimeter: 4)\n/// [] as [Int]\n/// >>> intersperse(numbers: [1, 2, 3], delimeter: 4)\n/// [1, 4, 2, 4, 3]\nfunc intersperse(numbers: [Int], delimeter: Int) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(intersperse(numbers: [] as [Int], delimeter: 7) == [] as [Int])\nassert(intersperse(numbers: [5, 6, 3, 2], delimeter: 8) == [5, 8, 6, 8, 3, 8, 2])\nassert(intersperse(numbers: [2, 2, 2], delimeter: 2) == [2, 2, 2, 2, 2])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "swift", - "prompt": "\n/// Your task is to write a function that returns true if a number x is a simple\n/// power of n and false in other cases.\n/// x is a simple power of n if n**int=x\n/// For example:\n/// >>> is_simple_power(x: 1, n: 4)\n/// true\n/// >>> is_simple_power(x: 2, n: 2)\n/// true\n/// >>> is_simple_power(x: 8, n: 2)\n/// true\n/// >>> is_simple_power(x: 3, n: 2)\n/// false\n/// >>> is_simple_power(x: 3, n: 1)\n/// false\n/// >>> is_simple_power(x: 5, n: 3)\n/// false\nfunc is_simple_power(x: Int, n: Int) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_simple_power(x: 16, n: 2) == true)\nassert(is_simple_power(x: 143214, n: 16) == false)\nassert(is_simple_power(x: 4, n: 2) == true)\nassert(is_simple_power(x: 9, n: 3) == true)\nassert(is_simple_power(x: 16, n: 4) == true)\nassert(is_simple_power(x: 24, n: 2) == false)\nassert(is_simple_power(x: 128, n: 4) == false)\nassert(is_simple_power(x: 12, n: 6) == false)\nassert(is_simple_power(x: 1, n: 1) == true)\nassert(is_simple_power(x: 1, n: 12) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "swift", - "prompt": "\n/// Write a function that returns true if the given number is the multiplication of 3 prime numbers\n/// and false otherwise.\n/// Knowing that (a) is less then 100. \n/// Example:\n/// >>> is_multiply_prime(a: 30)\n/// true\n/// 30 = 2 * 3 * 5\nfunc is_multiply_prime(a: Int) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_multiply_prime(a: 5) == false)\nassert(is_multiply_prime(a: 30) == true)\nassert(is_multiply_prime(a: 8) == true)\nassert(is_multiply_prime(a: 10) == false)\nassert(is_multiply_prime(a: 125) == true)\nassert(is_multiply_prime(a: 105) == true)\nassert(is_multiply_prime(a: 126) == false)\nassert(is_multiply_prime(a: 729) == false)\nassert(is_multiply_prime(a: 891) == false)\nassert(is_multiply_prime(a: 1001) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "swift", - "prompt": "\n/// Given the lengths of the three sides of a triangle. Return true if the three\n/// sides form a right-angled triangle, false otherwise.\n/// A right-angled triangle is a triangle in which one angle is right angle or \n/// 90 degree.\n/// Example:\n/// >>> right_angle_triangle(a: 3, b: 4, c: 5)\n/// true\n/// >>> right_angle_triangle(a: 1, b: 2, c: 3)\n/// false\nfunc right_angle_triangle(a: Int, b: Int, c: Int) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(right_angle_triangle(a: 3, b: 4, c: 5) == true)\nassert(right_angle_triangle(a: 1, b: 2, c: 3) == false)\nassert(right_angle_triangle(a: 10, b: 6, c: 8) == true)\nassert(right_angle_triangle(a: 2, b: 2, c: 2) == false)\nassert(right_angle_triangle(a: 7, b: 24, c: 25) == true)\nassert(right_angle_triangle(a: 10, b: 5, c: 7) == false)\nassert(right_angle_triangle(a: 5, b: 12, c: 13) == true)\nassert(right_angle_triangle(a: 15, b: 8, c: 17) == true)\nassert(right_angle_triangle(a: 48, b: 55, c: 73) == true)\nassert(right_angle_triangle(a: 1, b: 1, c: 1) == false)\nassert(right_angle_triangle(a: 2, b: 2, c: 10) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "swift", - "prompt": "\n/// Create a function that takes 3 numbers.\n/// Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n/// Returns false in any other cases.\n/// Examples\n/// >>> any_int(x: 5, y: 2, z: 7)\n/// true\n/// >>> any_int(x: 3, y: 2, z: 2)\n/// false\n/// >>> any_int(x: 3, y: -2, z: 1)\n/// true\n/// >>> any_int(x: 3.6, y: -2.2, z: 2)\n/// false\nfunc any_int(x: Double, y: Double, z: Double) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(any_int(x: 2, y: 3, z: 1) == true)\nassert(any_int(x: 2.5, y: 2, z: 3) == false)\nassert(any_int(x: 1.5, y: 5, z: 3.5) == false)\nassert(any_int(x: 2, y: 6, z: 2) == false)\nassert(any_int(x: 4, y: 2, z: 2) == true)\nassert(any_int(x: 2.2, y: 2.2, z: 2.2) == false)\nassert(any_int(x: -4, y: 6, z: 2) == true)\nassert(any_int(x: 2, y: 1, z: 1) == true)\nassert(any_int(x: 3, y: 4, z: 7) == true)\nassert(any_int(x: 3.0, y: 4, z: 7) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "swift", - "prompt": "\n/// This function takes an array l and returns an array l' such that\n/// l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n/// to the values of the corresponding indicies of l, but sorted.\n/// >>> sort_third(l: [1, 2, 3])\n/// [1, 2, 3]\n/// >>> sort_third(l: [5, 6, 3, 4, 8, 9, 2])\n/// [2, 6, 3, 4, 8, 9, 5]\nfunc sort_third(l: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sort_third(l: [5, 6, 3, 4, 8, 9, 2]) == [2, 6, 3, 4, 8, 9, 5])\nassert(sort_third(l: [5, 8, 3, 4, 6, 9, 2]) == [2, 8, 3, 4, 6, 9, 5])\nassert(sort_third(l: [5, 6, 9, 4, 8, 3, 2]) == [2, 6, 9, 4, 8, 3, 5])\nassert(sort_third(l: [5, 6, 3, 4, 8, 9, 2, 1]) == [2, 6, 3, 4, 8, 9, 5, 1])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_53_add", - "language": "swift", - "prompt": "\n/// Add two numbers x and y\n/// >>> add(x: 2, y: 3)\n/// 5\n/// >>> add(x: 5, y: 7)\n/// 12\nfunc add(x: Int, y: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(add(x: 0, y: 1) == 1)\nassert(add(x: 1, y: 0) == 1)\nassert(add(x: 2, y: 3) == 5)\nassert(add(x: 5, y: 7) == 12)\nassert(add(x: 7, y: 5) == 12)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_69_search", - "language": "swift", - "prompt": "\n/// You are given a non-empty array of positive integers. Return the greatest integer that is greater than \n/// zero, and has a frequency greater than or equal to the value of the integer itself. \n/// The frequency of an integer is the number of times it appears in the array.\n/// If no such a value exist, return -1.\n/// Examples:\n/// >>> search(lst: [4, 1, 2, 2, 3, 1])\n/// 2\n/// >>> search(lst: [1, 2, 2, 3, 3, 3, 4, 4, 4])\n/// 3\n/// >>> search(lst: [5, 5, 4, 4, 4])\n/// -1\nfunc search(lst: [Int]) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(search(lst: [5, 5, 5, 5, 1]) == 1)\nassert(search(lst: [4, 1, 4, 1, 4, 4]) == 4)\nassert(search(lst: [3, 3]) == -1)\nassert(search(lst: [8, 8, 8, 8, 8, 8, 8, 8]) == 8)\nassert(search(lst: [2, 3, 3, 2, 2]) == 2)\nassert(search(lst: [2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]) == 1)\nassert(search(lst: [3, 2, 8, 2]) == 2)\nassert(search(lst: [6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]) == 1)\nassert(search(lst: [8, 8, 3, 6, 5, 6, 4]) == -1)\nassert(search(lst: [6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]) == 1)\nassert(search(lst: [1, 9, 10, 1, 3]) == 1)\nassert(search(lst: [6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]) == 5)\nassert(search(lst: [1]) == 1)\nassert(search(lst: [8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]) == 4)\nassert(search(lst: [2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]) == 2)\nassert(search(lst: [1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]) == 1)\nassert(search(lst: [9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]) == 4)\nassert(search(lst: [2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]) == 4)\nassert(search(lst: [9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]) == 2)\nassert(search(lst: [5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]) == -1)\nassert(search(lst: [10]) == -1)\nassert(search(lst: [9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]) == 2)\nassert(search(lst: [5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]) == 1)\nassert(search(lst: [7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]) == 1)\nassert(search(lst: [3, 10, 10, 9, 2]) == -1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "swift", - "prompt": "\n/// Write a function that takes a string and returns true if the string\n/// length is a prime number or false otherwise\n/// Examples\n/// >>> prime_length(string: \"Hello\")\n/// true\n/// >>> prime_length(string: \"abcdcba\")\n/// true\n/// >>> prime_length(string: \"kittens\")\n/// true\n/// >>> prime_length(string: \"orange\")\n/// false\nfunc prime_length(string: String) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(prime_length(string: \"Hello\") == true)\nassert(prime_length(string: \"abcdcba\") == true)\nassert(prime_length(string: \"kittens\") == true)\nassert(prime_length(string: \"orange\") == false)\nassert(prime_length(string: \"wow\") == true)\nassert(prime_length(string: \"world\") == true)\nassert(prime_length(string: \"MadaM\") == true)\nassert(prime_length(string: \"Wow\") == true)\nassert(prime_length(string: \"\") == false)\nassert(prime_length(string: \"HI\") == true)\nassert(prime_length(string: \"go\") == true)\nassert(prime_length(string: \"gogo\") == false)\nassert(prime_length(string: \"aaaaaaaaaaaaaaa\") == false)\nassert(prime_length(string: \"Madam\") == true)\nassert(prime_length(string: \"M\") == false)\nassert(prime_length(string: \"0\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_58_common", - "language": "swift", - "prompt": "\n/// Return sorted unique common elements for two arrays.\n/// >>> common(l1: [1, 4, 3, 34, 653, 2, 5], l2: [5, 7, 1, 5, 9, 653, 121])\n/// [1, 5, 653]\n/// >>> common(l1: [5, 3, 2, 8], l2: [3, 2])\n/// [2, 3]\nfunc common(l1: [Int], l2: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(common(l1: [1, 4, 3, 34, 653, 2, 5], l2: [5, 7, 1, 5, 9, 653, 121]) == [1, 5, 653])\nassert(common(l1: [5, 3, 2, 8], l2: [3, 2]) == [2, 3])\nassert(common(l1: [4, 3, 2, 8], l2: [3, 2, 4]) == [2, 3, 4])\nassert(common(l1: [4, 3, 2, 8], l2: [] as [Int]) == [] as [Int])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "swift", - "prompt": "\n/// The Brazilian factorial is defined as:\n/// brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n/// where n > 0\n/// For example:\n/// >>> special_factorial(n: 4)\n/// 288\n/// The function will receive an integer as input and should return the special\n/// factorial of this integer.\nfunc special_factorial(n: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(special_factorial(n: 4) == 288)\nassert(special_factorial(n: 5) == 34560)\nassert(special_factorial(n: 7) == 125411328000)\nassert(special_factorial(n: 1) == 1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "swift", - "prompt": "\n/// In this problem, you will implement a function that takes two arrays of numbers,\n/// and determines whether it is possible to perform an exchange of elements\n/// between them to make lst1 an array of only even numbers.\n/// There is no limit on the number of exchanged elements between lst1 and lst2.\n/// If it is possible to exchange elements between the lst1 and lst2 to make\n/// all the elements of lst1 to be even, return \"YES\".\n/// Otherwise, return \"NO\".\n/// For example:\n/// >>> exchange(lst1: [1, 2, 3, 4], lst2: [1, 2, 3, 4])\n/// \"YES\"\n/// >>> exchange(lst1: [1, 2, 3, 4], lst2: [1, 5, 3, 4])\n/// \"NO\"\n/// It is assumed that the input arrays will be non-empty.\nfunc exchange(lst1: [Int], lst2: [Int]) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(exchange(lst1: [1, 2, 3, 4], lst2: [1, 2, 3, 4]) == \"YES\")\nassert(exchange(lst1: [1, 2, 3, 4], lst2: [1, 5, 3, 4]) == \"NO\")\nassert(exchange(lst1: [1, 2, 3, 4], lst2: [2, 1, 4, 3]) == \"YES\")\nassert(exchange(lst1: [5, 7, 3], lst2: [2, 6, 4]) == \"YES\")\nassert(exchange(lst1: [5, 7, 3], lst2: [2, 6, 3]) == \"NO\")\nassert(exchange(lst1: [3, 2, 6, 1, 8, 9], lst2: [3, 5, 5, 1, 1, 1]) == \"NO\")\nassert(exchange(lst1: [100, 200], lst2: [200, 200]) == \"YES\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "swift", - "prompt": "\n/// Given a non-empty array of integers arr and an integer k, return\n/// the sum of the elements with at most two digits from the first k elements of arr.\n/// Example:\n/// >>> add_elements(arr: [111, 21, 3, 4000, 5, 6, 7, 8, 9], k: 4)\n/// 24\n/// Constraints:\n/// 1. 1 <= len(arr) <= 100\n/// 2. 1 <= k <= len(arr)\nfunc add_elements(arr: [Int], k: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(add_elements(arr: [1, -2, -3, 41, 57, 76, 87, 88, 99], k: 3) == -4)\nassert(add_elements(arr: [111, 121, 3, 4000, 5, 6], k: 2) == 0)\nassert(add_elements(arr: [11, 21, 3, 90, 5, 6, 7, 8, 9], k: 4) == 125)\nassert(add_elements(arr: [111, 21, 3, 4000, 5, 6, 7, 8, 9], k: 4) == 24)\nassert(add_elements(arr: [1], k: 1) == 1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "swift", - "prompt": "\n/// A simple program which should return the value of x if n is \n/// a prime number and should return the value of y otherwise.\n/// Examples:\n/// >>> x_or_y(n: 7, x: 34, y: 12)\n/// 34\n/// >>> x_or_y(n: 15, x: 8, y: 5)\n/// 5\nfunc x_or_y(n: Int, x: Int, y: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(x_or_y(n: 7, x: 34, y: 12) == 34)\nassert(x_or_y(n: 15, x: 8, y: 5) == 5)\nassert(x_or_y(n: 3, x: 33, y: 5212) == 33)\nassert(x_or_y(n: 1259, x: 3, y: 52) == 3)\nassert(x_or_y(n: 7919, x: -1, y: 12) == -1)\nassert(x_or_y(n: 3609, x: 1245, y: 583) == 583)\nassert(x_or_y(n: 91, x: 56, y: 129) == 129)\nassert(x_or_y(n: 6, x: 34, y: 1234) == 1234)\nassert(x_or_y(n: 1, x: 2, y: 0) == 0)\nassert(x_or_y(n: 2, x: 2, y: 0) == 2)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "swift", - "prompt": "\n/// Given length of a side and high return area for a triangle.\n/// >>> triangle_area(a: 5, h: 3)\n/// 7.5\nfunc triangle_area(a: Int, h: Int) -> Double {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(triangle_area(a: 5, h: 3) == 7.5)\nassert(triangle_area(a: 2, h: 2) == 2.0)\nassert(triangle_area(a: 10, h: 8) == 40.0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "swift", - "prompt": "\n/// Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n/// the last couple centuries. However, what people don't know is Tribonacci sequence.\n/// Tribonacci sequence is defined by the recurrence:\n/// tri(1) = 3\n/// tri(n) = 1 + n / 2, if n is even.\n/// tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n/// For example:\n/// tri(2) = 1 + (2 / 2) = 2\n/// tri(4) = 3\n/// tri(3) = tri(2) + tri(1) + tri(4)\n/// = 2 + 3 + 3 = 8 \n/// You are given a non-negative integer number n, you have to a return an array of the \n/// first n + 1 numbers of the Tribonacci sequence.\n/// Examples:\n/// >>> tri(n: 3)\n/// [1, 3, 2, 8]\nfunc tri(n: Int) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(tri(n: 3) == [1, 3, 2, 8])\nassert(tri(n: 4) == [1, 3, 2, 8, 3])\nassert(tri(n: 5) == [1, 3, 2, 8, 3, 15])\nassert(tri(n: 6) == [1, 3, 2, 8, 3, 15, 4])\nassert(tri(n: 7) == [1, 3, 2, 8, 3, 15, 4, 24])\nassert(tri(n: 8) == [1, 3, 2, 8, 3, 15, 4, 24, 5])\nassert(tri(n: 9) == [1, 3, 2, 8, 3, 15, 4, 24, 5, 35])\nassert(tri(n: 20) == [1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11])\nassert(tri(n: 0) == [1])\nassert(tri(n: 1) == [1, 3])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "swift", - "prompt": "\n/// You are given an array of two strings, both strings consist of open\n/// parentheses '(' or close parentheses ')' only.\n/// Your job is to check if it is possible to concatenate the two strings in\n/// some order, that the resulting string will be good.\n/// A string S is considered to be good if and only if all parentheses in S\n/// are balanced. For example: the string '(())()' is good, while the string\n/// '())' is not.\n/// Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n/// Examples:\n/// >>> match_parens(lst: [\"()(\", \")\"])\n/// \"Yes\"\n/// >>> match_parens(lst: [\")\", \")\"])\n/// \"No\"\nfunc match_parens(lst: [String]) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(match_parens(lst: [\"()(\", \")\"]) == \"Yes\")\nassert(match_parens(lst: [\")\", \")\"]) == \"No\")\nassert(match_parens(lst: [\"(()(())\", \"())())\"]) == \"No\")\nassert(match_parens(lst: [\")())\", \"(()()(\"]) == \"Yes\")\nassert(match_parens(lst: [\"(())))\", \"(()())((\"]) == \"Yes\")\nassert(match_parens(lst: [\"()\", \"())\"]) == \"No\")\nassert(match_parens(lst: [\"(()(\", \"()))()\"]) == \"Yes\")\nassert(match_parens(lst: [\"((((\", \"((())\"]) == \"No\")\nassert(match_parens(lst: [\")(()\", \"(()(\"]) == \"No\")\nassert(match_parens(lst: [\")(\", \")(\"]) == \"No\")\nassert(match_parens(lst: [\"(\", \")\"]) == \"Yes\")\nassert(match_parens(lst: [\")\", \"(\"]) == \"Yes\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "swift", - "prompt": "\n/// From an array of integers, remove all elements that occur more than once.\n/// Keep order of elements left the same as in the input.\n/// >>> remove_duplicates(numbers: [1, 2, 3, 2, 4])\n/// [1, 3, 4]\nfunc remove_duplicates(numbers: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(remove_duplicates(numbers: [] as [Int]) == [] as [Int])\nassert(remove_duplicates(numbers: [1, 2, 3, 4]) == [1, 2, 3, 4])\nassert(remove_duplicates(numbers: [1, 2, 3, 2, 4, 3, 5]) == [1, 4, 5])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "swift", - "prompt": "\n/// Return a greatest common divisor of two integers a and b\n/// >>> greatest_common_divisor(a: 3, b: 5)\n/// 1\n/// >>> greatest_common_divisor(a: 25, b: 15)\n/// 5\nfunc greatest_common_divisor(a: Int, b: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(greatest_common_divisor(a: 3, b: 7) == 1)\nassert(greatest_common_divisor(a: 10, b: 15) == 5)\nassert(greatest_common_divisor(a: 49, b: 14) == 7)\nassert(greatest_common_divisor(a: 144, b: 60) == 12)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "swift", - "prompt": "\n/// Checks if given string is a palindrome\n/// >>> is_palindrome(text: \"\")\n/// true\n/// >>> is_palindrome(text: \"aba\")\n/// true\n/// >>> is_palindrome(text: \"aaaaa\")\n/// true\n/// >>> is_palindrome(text: \"zbcd\")\n/// false\nfunc is_palindrome(text: String) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_palindrome(text: \"\") == true)\nassert(is_palindrome(text: \"aba\") == true)\nassert(is_palindrome(text: \"aaaaa\") == true)\nassert(is_palindrome(text: \"zbcd\") == false)\nassert(is_palindrome(text: \"xywyx\") == true)\nassert(is_palindrome(text: \"xywyz\") == false)\nassert(is_palindrome(text: \"xywzx\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "swift", - "prompt": "\n/// xs represent coefficients of a polynomial.\n/// xs[0] + xs[1] * x + xs[2] * x^2 + ....\n/// Return derivative of this polynomial in the same form.\n/// >>> derivative(xs: [3, 1, 2, 4, 5])\n/// [1, 4, 12, 20]\n/// >>> derivative(xs: [1, 2, 3])\n/// [2, 6]\nfunc derivative(xs: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(derivative(xs: [3, 1, 2, 4, 5]) == [1, 4, 12, 20])\nassert(derivative(xs: [1, 2, 3]) == [2, 6])\nassert(derivative(xs: [3, 2, 1]) == [2, 2])\nassert(derivative(xs: [3, 2, 1, 0, 4]) == [2, 2, 0, 16])\nassert(derivative(xs: [1]) == [] as [Int])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "swift", - "prompt": "\n/// In this task, you will be given a string that represents a number of apples and oranges \n/// that are distributed in a basket of fruit this basket contains \n/// apples, oranges, and mango fruits. Given the string that represents the total number of \n/// the oranges and apples and an integer that represent the total number of the fruits \n/// in the basket return the number of the mango fruits in the basket.\n/// for examble:\n/// >>> fruit_distribution(s: \"5 apples and 6 oranges\", n: 19)\n/// 8\n/// >>> fruit_distribution(s: \"0 apples and 1 oranges\", n: 3)\n/// 2\n/// >>> fruit_distribution(s: \"2 apples and 3 oranges\", n: 100)\n/// 95\n/// >>> fruit_distribution(s: \"100 apples and 1 oranges\", n: 120)\n/// 19\nfunc fruit_distribution(s: String, n: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(fruit_distribution(s: \"5 apples and 6 oranges\", n: 19) == 8)\nassert(fruit_distribution(s: \"5 apples and 6 oranges\", n: 21) == 10)\nassert(fruit_distribution(s: \"0 apples and 1 oranges\", n: 3) == 2)\nassert(fruit_distribution(s: \"1 apples and 0 oranges\", n: 3) == 2)\nassert(fruit_distribution(s: \"2 apples and 3 oranges\", n: 100) == 95)\nassert(fruit_distribution(s: \"2 apples and 3 oranges\", n: 5) == 0)\nassert(fruit_distribution(s: \"1 apples and 100 oranges\", n: 120) == 19)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "swift", - "prompt": "\n/// Write a function that takes an integer a and returns true \n/// if this ingeger is a cube of some integer number.\n/// Note: you may assume the input is always valid.\n/// Examples:\n/// >>> iscube(a: 1)\n/// true\n/// >>> iscube(a: 2)\n/// false\n/// >>> iscube(a: -1)\n/// true\n/// >>> iscube(a: 64)\n/// true\n/// >>> iscube(a: 0)\n/// true\n/// >>> iscube(a: 180)\n/// false\nfunc iscube(a: Int) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(iscube(a: 1) == true)\nassert(iscube(a: 2) == false)\nassert(iscube(a: -1) == true)\nassert(iscube(a: 64) == true)\nassert(iscube(a: 180) == false)\nassert(iscube(a: 1000) == true)\nassert(iscube(a: 0) == true)\nassert(iscube(a: 1729) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "swift", - "prompt": "\n/// In this Kata, you have to sort an array of non-negative integers according to\n/// number of ones in their binary representation in ascending order.\n/// For similar number of ones, sort based on decimal value.\n/// It must be implemented like this:\n/// >>> sort_array(arr: [1, 5, 2, 3, 4])\n/// [1, 2, 3, 4, 5]\n/// >>> sort_array(arr: [-2, -3, -4, -5, -6])\n/// [-6, -5, -4, -3, -2]\n/// >>> sort_array(arr: [1, 0, 2, 3, 4])\n/// [0, 1, 2, 3, 4]\nfunc sort_array(arr: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sort_array(arr: [1, 5, 2, 3, 4]) == [1, 2, 4, 3, 5])\nassert(sort_array(arr: [-2, -3, -4, -5, -6]) == [-4, -2, -6, -5, -3])\nassert(sort_array(arr: [1, 0, 2, 3, 4]) == [0, 1, 2, 4, 3])\nassert(sort_array(arr: [] as [Int]) == [] as [Int])\nassert(sort_array(arr: [2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]) == [2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77])\nassert(sort_array(arr: [3, 6, 44, 12, 32, 5]) == [32, 3, 5, 6, 12, 44])\nassert(sort_array(arr: [2, 4, 8, 16, 32]) == [2, 4, 8, 16, 32])\nassert(sort_array(arr: [2, 4, 8, 16, 32]) == [2, 4, 8, 16, 32])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "swift", - "prompt": "\n/// Given an array of strings, where each string consists of only digits, return an array.\n/// Each element i of the output should be \"the number of odd elements in the\n/// string i of the input.\" where all the i's should be replaced by the number\n/// of odd digits in the i'th string of the input.\n/// >>> odd_count(lst: [\"1234567\"])\n/// [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n/// >>> odd_count(lst: [\"3\", \"11111111\"])\n/// [\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\nfunc odd_count(lst: [String]) -> [String] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(odd_count(lst: [\"1234567\"]) == [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"])\nassert(odd_count(lst: [\"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.\"])\nassert(odd_count(lst: [\"271\", \"137\", \"314\"]) == [\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "swift", - "prompt": "\n/// brackets is a string of \"(\" and \")\".\n/// return true if every opening bracket has a corresponding closing bracket.\n/// >>> correct_bracketing(brackets: \"(\")\n/// false\n/// >>> correct_bracketing(brackets: \"()\")\n/// true\n/// >>> correct_bracketing(brackets: \"(()())\")\n/// true\n/// >>> correct_bracketing(brackets: \")(()\")\n/// false\nfunc correct_bracketing(brackets: String) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(correct_bracketing(brackets: \"()\") == true)\nassert(correct_bracketing(brackets: \"(()())\") == true)\nassert(correct_bracketing(brackets: \"()()(()())()\") == true)\nassert(correct_bracketing(brackets: \"()()((()()())())(()()(()))\") == true)\nassert(correct_bracketing(brackets: \"((()())))\") == false)\nassert(correct_bracketing(brackets: \")(()\") == false)\nassert(correct_bracketing(brackets: \"(\") == false)\nassert(correct_bracketing(brackets: \"((((\") == false)\nassert(correct_bracketing(brackets: \")\") == false)\nassert(correct_bracketing(brackets: \"(()\") == false)\nassert(correct_bracketing(brackets: \"()()(()())())(()\") == false)\nassert(correct_bracketing(brackets: \"()()(()())()))()\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "swift", - "prompt": "\n/// Task\n/// Write a function that takes a string as input and returns the sum of the upper characters only'\n/// ASCII codes.\n/// Examples:\n/// >>> digitSum(s: \"\")\n/// 0\n/// >>> digitSum(s: \"abAB\")\n/// 131\n/// >>> digitSum(s: \"abcCd\")\n/// 67\n/// >>> digitSum(s: \"helloE\")\n/// 69\n/// >>> digitSum(s: \"woArBld\")\n/// 131\n/// >>> digitSum(s: \"aAaaaXa\")\n/// 153\nfunc digitSum(s: String) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(digitSum(s: \"\") == 0)\nassert(digitSum(s: \"abAB\") == 131)\nassert(digitSum(s: \"abcCd\") == 67)\nassert(digitSum(s: \"helloE\") == 69)\nassert(digitSum(s: \"woArBld\") == 131)\nassert(digitSum(s: \"aAaaaXa\") == 153)\nassert(digitSum(s: \" How are yOu?\") == 151)\nassert(digitSum(s: \"You arE Very Smart\") == 327)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "swift", - "prompt": "\n/// Write a function that accepts an array of strings as a parameter,\n/// deletes the strings that have odd lengths from it,\n/// and returns the resulted array with a sorted order,\n/// The array is always an array of strings and never an array of numbers,\n/// and it may contain duplicates.\n/// The order of the array should be ascending by length of each word, and you\n/// should return the array sorted by that rule.\n/// If two words have the same length, sort the array alphabetically.\n/// The function should return an array of strings in sorted order.\n/// You may assume that all words will have the same length.\n/// For example:\n/// >>> sorted_list_sum(lst: [\"aa\", \"a\", \"aaa\"])\n/// [\"aa\"]\n/// >>> sorted_list_sum(lst: [\"ab\", \"a\", \"aaa\", \"cd\"])\n/// [\"ab\", \"cd\"]\nfunc sorted_list_sum(lst: [String]) -> [String] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sorted_list_sum(lst: [\"aa\", \"a\", \"aaa\"]) == [\"aa\"])\nassert(sorted_list_sum(lst: [\"school\", \"AI\", \"asdf\", \"b\"]) == [\"AI\", \"asdf\", \"school\"])\nassert(sorted_list_sum(lst: [\"d\", \"b\", \"c\", \"a\"]) == [] as [String])\nassert(sorted_list_sum(lst: [\"d\", \"dcba\", \"abcd\", \"a\"]) == [\"abcd\", \"dcba\"])\nassert(sorted_list_sum(lst: [\"AI\", \"ai\", \"au\"]) == [\"AI\", \"ai\", \"au\"])\nassert(sorted_list_sum(lst: [\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"]) == [] as [String])\nassert(sorted_list_sum(lst: [\"aaaa\", \"bbbb\", \"dd\", \"cc\"]) == [\"cc\", \"dd\", \"aaaa\", \"bbbb\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "swift", - "prompt": "\n/// You are given an array arr of integers and you need to return\n/// sum of magnitudes of integers multiplied by product of all signs\n/// of each number in the array, represented by 1, -1 or 0.\n/// Note: return nil for empty arr.\n/// Example:\n/// >>> prod_signs(arr: [1, 2, 2, -4])\n/// 9\n/// >>> prod_signs(arr: [0, 1])\n/// 0\n/// >>> prod_signs(arr: [] as [Int])\n/// nil\nfunc prod_signs(arr: [Int]) -> Int? {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(prod_signs(arr: [1, 2, 2, -4]) == -9)\nassert(prod_signs(arr: [0, 1]) == 0)\nassert(prod_signs(arr: [1, 1, 1, 2, 3, -1, 1]) == -10)\nassert(prod_signs(arr: [] as [Int]) == nil)\nassert(prod_signs(arr: [2, 4, 1, 2, -1, -1, 9]) == 20)\nassert(prod_signs(arr: [-1, 1, -1, 1]) == 4)\nassert(prod_signs(arr: [-1, 1, 1, 1]) == -4)\nassert(prod_signs(arr: [-1, 1, 1, 0]) == 0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "swift", - "prompt": "\n/// Return array with elements incremented by 1.\n/// >>> incr_list(l: [1, 2, 3])\n/// [2, 3, 4]\n/// >>> incr_list(l: [5, 3, 5, 2, 3, 3, 9, 0, 123])\n/// [6, 4, 6, 3, 4, 4, 10, 1, 124]\nfunc incr_list(l: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(incr_list(l: [] as [Int]) == [] as [Int])\nassert(incr_list(l: [3, 2, 1]) == [4, 3, 2])\nassert(incr_list(l: [5, 2, 5, 2, 3, 3, 9, 0, 123]) == [6, 3, 6, 3, 4, 4, 10, 1, 124])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "swift", - "prompt": "\n/// From a given array of integers, generate an array of rolling maximum element found until given moment\n/// in the sequence.\n/// >>> rolling_max(numbers: [1, 2, 3, 2, 3, 4, 2])\n/// [1, 2, 3, 3, 3, 4, 4]\nfunc rolling_max(numbers: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(rolling_max(numbers: [] as [Int]) == [] as [Int])\nassert(rolling_max(numbers: [1, 2, 3, 4]) == [1, 2, 3, 4])\nassert(rolling_max(numbers: [4, 3, 2, 1]) == [4, 4, 4, 4])\nassert(rolling_max(numbers: [3, 2, 3, 100, 3]) == [3, 3, 3, 100, 100])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "swift", - "prompt": "\n/// Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n/// separate those group into separate strings and return the array of those.\n/// Separate groups are balanced (each open brace is properly closed) and not nested within each other\n/// Ignore any spaces in the input string.\n/// >>> separate_paren_groups(paren_string: \"( ) (( )) (( )( ))\")\n/// [\"()\", \"(())\", \"(()())\"]\nfunc separate_paren_groups(paren_string: String) -> [String] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(separate_paren_groups(paren_string: \"(()()) ((())) () ((())()())\") == [\"(()())\", \"((()))\", \"()\", \"((())()())\"])\nassert(separate_paren_groups(paren_string: \"() (()) ((())) (((())))\") == [\"()\", \"(())\", \"((()))\", \"(((())))\"])\nassert(separate_paren_groups(paren_string: \"(()(())((())))\") == [\"(()(())((())))\"])\nassert(separate_paren_groups(paren_string: \"( ) (( )) (( )( ))\") == [\"()\", \"(())\", \"(()())\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "swift", - "prompt": "\n/// You will be given a string of words separated by commas or spaces. Your task is\n/// to split the string into words and return an array of the words.\n/// For example:\n/// >>> words_string(s: \"Hi, my name is John\")\n/// [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n/// >>> words_string(s: \"One, two, three, four, five, six\")\n/// [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\nfunc words_string(s: String) -> [String] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(words_string(s: \"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"])\nassert(words_string(s: \"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"])\nassert(words_string(s: \"Hi, my name\") == [\"Hi\", \"my\", \"name\"])\nassert(words_string(s: \"One,, two, three, four, five, six,\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"])\nassert(words_string(s: \"\") == [] as [String])\nassert(words_string(s: \"ahmed , gamal\") == [\"ahmed\", \"gamal\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "swift", - "prompt": "\nenum Value: Equatable, Hashable {\n case intValue(Int)\n case doubleValue(Double)\n case stringValue(String)\n}\n\n \n/// Create a function that takes integers, floats, or strings representing\n/// real numbers, and returns the larger variable in its given variable type.\n/// Return nil if the values are equal.\n/// Note: If a real number is represented as a string, the floating point might be . or ,\n/// >>> compare_one(a: .intValue(1), b: .doubleValue(2.5))\n/// .doubleValue(2.5)\n/// >>> compare_one(a: .intValue(1), b: .stringValue(\"2,3\"))\n/// .stringValue(\"2,3\")\n/// >>> compare_one(a: .stringValue(\"5,1\"), b: .stringValue(\"6\"))\n/// .stringValue(\"6\")\n/// >>> compare_one(a: .stringValue(\"1\"), b: .intValue(1))\n/// nil\nfunc compare_one(a: Value, b: Value) -> Value? {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(compare_one(a: .intValue(1), b: .intValue(2)) == .intValue(2))\nassert(compare_one(a: .intValue(1), b: .doubleValue(2.5)) == .doubleValue(2.5))\nassert(compare_one(a: .intValue(2), b: .intValue(3)) == .intValue(3))\nassert(compare_one(a: .intValue(5), b: .intValue(6)) == .intValue(6))\nassert(compare_one(a: .intValue(1), b: .stringValue(\"2,3\")) == .stringValue(\"2,3\"))\nassert(compare_one(a: .stringValue(\"5,1\"), b: .stringValue(\"6\")) == .stringValue(\"6\"))\nassert(compare_one(a: .stringValue(\"1\"), b: .stringValue(\"2\")) == .stringValue(\"2\"))\nassert(compare_one(a: .stringValue(\"1\"), b: .intValue(1)) == nil)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "swift", - "prompt": "\n/// Filter given array of any swiftthon values only for integers\n/// >>> filter_integers(values: [\"a\", 3.14, 5])\n/// [5]\n/// >>> filter_integers(values: [1, 2, 3, \"abc\", [:] as [AnyHashable : AnyHashable], [] as [AnyHashable]])\n/// [1, 2, 3]\nfunc filter_integers(values: [AnyHashable]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(filter_integers(values: [] as [AnyHashable]) == [] as [Int])\nassert(filter_integers(values: [4, [:] as [AnyHashable : AnyHashable], [] as [AnyHashable], 23.2, 9, \"adasd\"]) == [4, 9])\nassert(filter_integers(values: [3, \"c\", 3, 3, \"a\", \"b\"]) == [3, 3, 3])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "swift", - "prompt": "\n/// This function takes an array l and returns an array l' such that\n/// l' is identical to l in the odd indicies, while its values at the even indicies are equal\n/// to the values of the even indicies of l, but sorted.\n/// >>> sort_even(l: [1, 2, 3])\n/// [1, 2, 3]\n/// >>> sort_even(l: [5, 6, 3, 4])\n/// [3, 6, 5, 4]\nfunc sort_even(l: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sort_even(l: [1, 2, 3]) == [1, 2, 3])\nassert(sort_even(l: [5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]) == [-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123])\nassert(sort_even(l: [5, 8, -12, 4, 23, 2, 3, 11, 12, -10]) == [-12, 8, 3, 4, 5, 2, 12, 11, 23, -10])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "swift", - "prompt": "\n/// I think we all remember that feeling when the result of some long-awaited\n/// event is finally known. The feelings and thoughts you have at that moment are\n/// definitely worth noting down and comparing.\n/// Your task is to determine if a person correctly guessed the results of a number of matches.\n/// You are given two arrays of scores and guesses of equal length, where each index shows a match. \n/// Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n/// the value is 0, and if not, the value is the absolute difference between the guess and the score.\n/// example:\n/// >>> compare(game: [1, 2, 3, 4, 5, 1], guess: [1, 2, 3, 4, 2, -2])\n/// [0, 0, 0, 0, 3, 3]\n/// >>> compare(game: [0, 5, 0, 0, 0, 4], guess: [4, 1, 1, 0, 0, -2])\n/// [4, 4, 1, 0, 0, 6]\nfunc compare(game: [Int], guess: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(compare(game: [1, 2, 3, 4, 5, 1], guess: [1, 2, 3, 4, 2, -2]) == [0, 0, 0, 0, 3, 3])\nassert(compare(game: [0, 0, 0, 0, 0, 0], guess: [0, 0, 0, 0, 0, 0]) == [0, 0, 0, 0, 0, 0])\nassert(compare(game: [1, 2, 3], guess: [-1, -2, -3]) == [2, 4, 6])\nassert(compare(game: [1, 2, 3, 5], guess: [-1, 2, 3, 4]) == [2, 0, 0, 1])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "swift", - "prompt": "\n/// Given a positive integer n, return a tuple that has the number of even and odd\n/// integer palindromes that fall within the range(1, n), inclusive.\n/// Example 1:\n/// >>> even_odd_palindrome(n: 3)\n/// (1, 2)\n/// Explanation:\n/// Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n/// Example 2:\n/// >>> even_odd_palindrome(n: 12)\n/// (4, 6)\n/// Explanation:\n/// Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n/// Note:\n/// 1. 1 <= n <= 10^3\n/// 2. returned tuple has the number of even and odd integer palindromes respectively.\nfunc even_odd_palindrome(n: Int) -> (Int, Int) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(even_odd_palindrome(n: 123) == (8, 13))\nassert(even_odd_palindrome(n: 12) == (4, 6))\nassert(even_odd_palindrome(n: 3) == (1, 2))\nassert(even_odd_palindrome(n: 63) == (6, 8))\nassert(even_odd_palindrome(n: 25) == (5, 6))\nassert(even_odd_palindrome(n: 19) == (4, 6))\nassert(even_odd_palindrome(n: 9) == (4, 5))\nassert(even_odd_palindrome(n: 1) == (0, 1))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "swift", - "prompt": "\n/// The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n/// fib4(0) -> 0\n/// fib4(1) -> 0\n/// fib4(2) -> 2\n/// fib4(3) -> 0\n/// fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n/// Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n/// >>> fib4(n: 5)\n/// 4\n/// >>> fib4(n: 6)\n/// 8\n/// >>> fib4(n: 7)\n/// 14\nfunc fib4(n: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(fib4(n: 5) == 4)\nassert(fib4(n: 8) == 28)\nassert(fib4(n: 10) == 104)\nassert(fib4(n: 12) == 386)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "swift", - "prompt": "\n/// Given two positive integers a and b, return the even digits between a\n/// and b, in ascending order.\n/// For example:\n/// >>> generate_integers(a: 2, b: 8)\n/// [2, 4, 6, 8]\n/// >>> generate_integers(a: 8, b: 2)\n/// [2, 4, 6, 8]\n/// >>> generate_integers(a: 10, b: 14)\n/// [] as [Int]\nfunc generate_integers(a: Int, b: Int) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(generate_integers(a: 2, b: 10) == [2, 4, 6, 8])\nassert(generate_integers(a: 10, b: 2) == [2, 4, 6, 8])\nassert(generate_integers(a: 132, b: 2) == [2, 4, 6, 8])\nassert(generate_integers(a: 17, b: 89) == [] as [Int])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "swift", - "prompt": "\n/// For a given array of input numbers, calculate Mean Absolute Deviation\n/// around the mean of this dataset.\n/// Mean Absolute Deviation is the average absolute difference between each\n/// element and a centerpoint (mean in this case):\n/// MAD = average | x - x_mean |\n/// >>> mean_absolute_deviation(numbers: [1.0, 2.0, 3.0, 4.0])\n/// 1.0\nfunc mean_absolute_deviation(numbers: [Double]) -> Double {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(mean_absolute_deviation(numbers: [1.0, 2.0]) == 0.5)\nassert(mean_absolute_deviation(numbers: [1.0, 2.0, 3.0, 4.0]) == 1.0)\nassert(mean_absolute_deviation(numbers: [1.0, 2.0, 3.0, 4.0, 5.0]) == 1.2)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "swift", - "prompt": "\n/// Create a function encrypt that takes a string as an argument and\n/// returns a string encrypted with the alphabet being rotated. \n/// The alphabet should be rotated in a manner such that the letters \n/// shift down by two multiplied to two places.\n/// For example:\n/// >>> encrypt(s: \"hi\")\n/// \"lm\"\n/// >>> encrypt(s: \"asdfghjkl\")\n/// \"ewhjklnop\"\n/// >>> encrypt(s: \"gf\")\n/// \"kj\"\n/// >>> encrypt(s: \"et\")\n/// \"ix\"\nfunc encrypt(s: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(encrypt(s: \"hi\") == \"lm\")\nassert(encrypt(s: \"asdfghjkl\") == \"ewhjklnop\")\nassert(encrypt(s: \"gf\") == \"kj\")\nassert(encrypt(s: \"et\") == \"ix\")\nassert(encrypt(s: \"faewfawefaewg\") == \"jeiajeaijeiak\")\nassert(encrypt(s: \"hellomyfriend\") == \"lippsqcjvmirh\")\nassert(encrypt(s: \"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\") == \"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\")\nassert(encrypt(s: \"a\") == \"e\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "swift", - "prompt": "\n/// Given a positive integer n, return a sorted array that has the odd numbers in collatz sequence.\n/// The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n/// as follows: start with any positive integer n. Then each term is obtained from the \n/// previous term as follows: if the previous term is even, the next term is one half of \n/// the previous term. If the previous term is odd, the next term is 3 times the previous\n/// term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n/// Note: \n/// 1. Collatz(1) is [1].\n/// 2. returned array sorted in increasing order.\n/// For example:\n/// get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n/// >>> get_odd_collatz(n: 5)\n/// [1, 5]\nfunc get_odd_collatz(n: Int) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(get_odd_collatz(n: 14) == [1, 5, 7, 11, 13, 17])\nassert(get_odd_collatz(n: 5) == [1, 5])\nassert(get_odd_collatz(n: 12) == [1, 3, 5])\nassert(get_odd_collatz(n: 1) == [1])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "swift", - "prompt": "\n/// Find how many times a given substring can be found in the original string. Count overlaping cases.\n/// >>> how_many_times(string: \"\", substring: \"a\")\n/// 0\n/// >>> how_many_times(string: \"aaa\", substring: \"a\")\n/// 3\n/// >>> how_many_times(string: \"aaaa\", substring: \"aa\")\n/// 3\nfunc how_many_times(string: String, substring: String) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(how_many_times(string: \"\", substring: \"x\") == 0)\nassert(how_many_times(string: \"xyxyxyx\", substring: \"x\") == 4)\nassert(how_many_times(string: \"cacacacac\", substring: \"cac\") == 4)\nassert(how_many_times(string: \"john doe\", substring: \"john\") == 1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "swift", - "prompt": "\n/// We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n/// numbers in the array will be randomly ordered. Your task is to determine if\n/// it is possible to get an array sorted in non-decreasing order by performing \n/// the following operation on the given array:\n/// You are allowed to perform right shift operation any number of times.\n/// One right shift operation means shifting all elements of the array by one\n/// position in the right direction. The last element of the array will be moved to\n/// the starting position in the array i.e. 0th index. \n/// If it is possible to obtain the sorted array by performing the above operation\n/// then return true else return false.\n/// If the given array is empty then return true.\n/// Note: The given array is guaranteed to have unique elements.\n/// For Example:\n/// >>> move_one_ball(arr: [3, 4, 5, 1, 2])\n/// true\n/// Explanation: By performin 2 right shift operations, non-decreasing order can\n/// be achieved for the given array.\n/// >>> move_one_ball(arr: [3, 5, 4, 1, 2])\n/// false\n/// Explanation:It is not possible to get non-decreasing order for the given\n/// array by performing any number of right shift operations.\nfunc move_one_ball(arr: [Int]) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(move_one_ball(arr: [3, 4, 5, 1, 2]) == true)\nassert(move_one_ball(arr: [3, 5, 10, 1, 2]) == true)\nassert(move_one_ball(arr: [4, 3, 1, 2]) == false)\nassert(move_one_ball(arr: [3, 5, 4, 1, 2]) == false)\nassert(move_one_ball(arr: [] as [Int]) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "swift", - "prompt": "\n/// Write a function which sorts the given array of integers\n/// in ascending order according to the sum of their digits.\n/// Note: if there are several items with similar sum of their digits,\n/// order them based on their index in original array.\n/// For example:\n/// >>> order_by_points(nums: [1, 11, -1, -11, -12])\n/// [-1, -11, 1, -12, 11]\n/// >>> order_by_points(nums: [] as [Int])\n/// [] as [Int]\nfunc order_by_points(nums: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(order_by_points(nums: [1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11])\nassert(order_by_points(nums: [1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]) == [0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457])\nassert(order_by_points(nums: [] as [Int]) == [] as [Int])\nassert(order_by_points(nums: [1, -11, -32, 43, 54, -98, 2, -3]) == [-3, -32, -98, -11, 1, 2, 43, 54])\nassert(order_by_points(nums: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) == [1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9])\nassert(order_by_points(nums: [0, 6, 6, -76, -21, 23, 4]) == [-76, -21, 0, 4, 23, 6, 6])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "swift", - "prompt": "\n/// Return array of prime factors of given integer in the order from smallest to largest.\n/// Each of the factors should be arrayed number of times corresponding to how many times it appeares in factorization.\n/// Input number should be equal to the product of all factors\n/// >>> factorize(n: 8)\n/// [2, 2, 2]\n/// >>> factorize(n: 25)\n/// [5, 5]\n/// >>> factorize(n: 70)\n/// [2, 5, 7]\nfunc factorize(n: Int) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(factorize(n: 2) == [2])\nassert(factorize(n: 4) == [2, 2])\nassert(factorize(n: 8) == [2, 2, 2])\nassert(factorize(n: 57) == [3, 19])\nassert(factorize(n: 3249) == [3, 3, 19, 19])\nassert(factorize(n: 185193) == [3, 3, 3, 19, 19, 19])\nassert(factorize(n: 20577) == [3, 19, 19, 19])\nassert(factorize(n: 18) == [2, 3, 3])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "swift", - "prompt": "\n/// Return true if all numbers in the array l are below threshold t.\n/// >>> below_threshold(l: [1, 2, 4, 10], t: 100)\n/// true\n/// >>> below_threshold(l: [1, 20, 4, 10], t: 5)\n/// false\nfunc below_threshold(l: [Int], t: Int) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(below_threshold(l: [1, 2, 4, 10], t: 100) == true)\nassert(below_threshold(l: [1, 20, 4, 10], t: 5) == false)\nassert(below_threshold(l: [1, 20, 4, 10], t: 21) == true)\nassert(below_threshold(l: [1, 20, 4, 10], t: 22) == true)\nassert(below_threshold(l: [1, 8, 4, 10], t: 11) == true)\nassert(below_threshold(l: [1, 8, 4, 10], t: 10) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "swift", - "prompt": "\nextension Int: Error {}\n \n/// You are given two positive integers n and m, and your task is to compute the\n/// average of the integers from n through m (including n and m). \n/// Round the answer to the nearest integer and convert that to binary.\n/// If n is greater than m, return -1.\n/// Example:\n/// >>> rounded_avg(n: 1, m: 5)\n/// .success(\"0b11\")\n/// >>> rounded_avg(n: 7, m: 5)\n/// .failure(-1)\n/// >>> rounded_avg(n: 10, m: 20)\n/// .success(\"0b1111\")\n/// >>> rounded_avg(n: 20, m: 33)\n/// .success(\"0b11010\")\nfunc rounded_avg(n: Int, m: Int) -> Result {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(rounded_avg(n: 1, m: 5) == .success(\"0b11\"))\nassert(rounded_avg(n: 7, m: 13) == .success(\"0b1010\"))\nassert(rounded_avg(n: 964, m: 977) == .success(\"0b1111001010\"))\nassert(rounded_avg(n: 996, m: 997) == .success(\"0b1111100100\"))\nassert(rounded_avg(n: 560, m: 851) == .success(\"0b1011000010\"))\nassert(rounded_avg(n: 185, m: 546) == .success(\"0b101101110\"))\nassert(rounded_avg(n: 362, m: 496) == .success(\"0b110101101\"))\nassert(rounded_avg(n: 350, m: 902) == .success(\"0b1001110010\"))\nassert(rounded_avg(n: 197, m: 233) == .success(\"0b11010111\"))\nassert(rounded_avg(n: 7, m: 5) == .failure(-1))\nassert(rounded_avg(n: 5, m: 1) == .failure(-1))\nassert(rounded_avg(n: 5, m: 5) == .success(\"0b101\"))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "swift", - "prompt": "\n/// Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n/// For each of the group, output the deepest level of nesting of parentheses.\n/// E.g. (()()) has maximum two levels of nesting while ((())) has three.\n/// >>> parse_nested_parens(paren_string: \"(()()) ((())) () ((())()())\")\n/// [2, 3, 1, 3]\nfunc parse_nested_parens(paren_string: String) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(parse_nested_parens(paren_string: \"(()()) ((())) () ((())()())\") == [2, 3, 1, 3])\nassert(parse_nested_parens(paren_string: \"() (()) ((())) (((())))\") == [1, 2, 3, 4])\nassert(parse_nested_parens(paren_string: \"(()(())((())))\") == [4])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "swift", - "prompt": "\n/// Given a non-empty array of integers, return the sum of all of the odd elements that are in even positions.\n/// Examples\n/// >>> solution(lst: [5, 8, 7, 1])\n/// 12\n/// >>> solution(lst: [3, 3, 3, 3, 3])\n/// 9\n/// >>> solution(lst: [30, 13, 24, 321])\n/// 0\nfunc solution(lst: [Int]) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(solution(lst: [5, 8, 7, 1]) == 12)\nassert(solution(lst: [3, 3, 3, 3, 3]) == 9)\nassert(solution(lst: [30, 13, 24, 321]) == 0)\nassert(solution(lst: [5, 9]) == 5)\nassert(solution(lst: [2, 4, 8]) == 0)\nassert(solution(lst: [30, 13, 23, 32]) == 23)\nassert(solution(lst: [3, 13, 2, 9]) == 3)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "swift", - "prompt": "\n/// You are given a positive integer n. You have to create an integer array a of length n.\n/// For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n/// Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n/// and a[i] + a[j] + a[k] is a multiple of 3.\n/// Example :\n/// >>> get_max_triples(n: 5)\n/// 1\n/// Explanation: \n/// a = [1, 3, 7, 13, 21]\n/// The only valid triple is (1, 7, 13).\nfunc get_max_triples(n: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(get_max_triples(n: 5) == 1)\nassert(get_max_triples(n: 6) == 4)\nassert(get_max_triples(n: 10) == 36)\nassert(get_max_triples(n: 100) == 53361)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "swift", - "prompt": "\n/// You are given an array of integers.\n/// Write a function next_smallest() that returns the 2nd smallest element of the array.\n/// Return nil if there is no such element.\n/// >>> next_smallest(lst: [1, 2, 3, 4, 5])\n/// 2\n/// >>> next_smallest(lst: [5, 1, 4, 3, 2])\n/// 2\n/// >>> next_smallest(lst: [] as [Int])\n/// nil\n/// >>> next_smallest(lst: [1, 1])\n/// nil\nfunc next_smallest(lst: [Int]) -> Int? {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(next_smallest(lst: [1, 2, 3, 4, 5]) == 2)\nassert(next_smallest(lst: [5, 1, 4, 3, 2]) == 2)\nassert(next_smallest(lst: [] as [Int]) == nil)\nassert(next_smallest(lst: [1, 1]) == nil)\nassert(next_smallest(lst: [1, 1, 1, 1, 0]) == 1)\nassert(next_smallest(lst: [1, 1]) == nil)\nassert(next_smallest(lst: [-35, 34, 12, -45]) == -35)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "swift", - "prompt": "\n/// Input is a space-delimited string of numberals from 'zero' to 'nine'.\n/// Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n/// Return the string with numbers sorted from smallest to largest\n/// >>> sort_numbers(numbers: \"three one five\")\n/// \"one three five\"\nfunc sort_numbers(numbers: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sort_numbers(numbers: \"\") == \"\")\nassert(sort_numbers(numbers: \"three\") == \"three\")\nassert(sort_numbers(numbers: \"three five nine\") == \"three five nine\")\nassert(sort_numbers(numbers: \"five zero four seven nine eight\") == \"zero four five seven eight nine\")\nassert(sort_numbers(numbers: \"six five four three two one zero\") == \"zero one two three four five six\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "swift", - "prompt": "\n/// You are given 2 words. You need to return true if the second word or any of its rotations is a substring in the first word\n/// >>> cycpattern_check(a: \"abcd\", b: \"abd\")\n/// false\n/// >>> cycpattern_check(a: \"hello\", b: \"ell\")\n/// true\n/// >>> cycpattern_check(a: \"whassup\", b: \"psus\")\n/// false\n/// >>> cycpattern_check(a: \"abab\", b: \"baa\")\n/// true\n/// >>> cycpattern_check(a: \"efef\", b: \"eeff\")\n/// false\n/// >>> cycpattern_check(a: \"himenss\", b: \"simen\")\n/// true\nfunc cycpattern_check(a: String, b: String) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(cycpattern_check(a: \"xyzw\", b: \"xyw\") == false)\nassert(cycpattern_check(a: \"yello\", b: \"ell\") == true)\nassert(cycpattern_check(a: \"whattup\", b: \"ptut\") == false)\nassert(cycpattern_check(a: \"efef\", b: \"fee\") == true)\nassert(cycpattern_check(a: \"abab\", b: \"aabb\") == false)\nassert(cycpattern_check(a: \"winemtt\", b: \"tinem\") == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "swift", - "prompt": "\n/// You will be given a number in decimal form and your task is to convert it to\n/// binary format. The function should return a string, with each character representing a binary\n/// number. Each character in the string will be '0' or '1'.\n/// There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n/// The extra characters are there to help with the format.\n/// Examples:\n/// >>> decimal_to_binary(decimal: 15)\n/// \"db1111db\"\n/// >>> decimal_to_binary(decimal: 32)\n/// \"db100000db\"\nfunc decimal_to_binary(decimal: Int) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(decimal_to_binary(decimal: 0) == \"db0db\")\nassert(decimal_to_binary(decimal: 32) == \"db100000db\")\nassert(decimal_to_binary(decimal: 103) == \"db1100111db\")\nassert(decimal_to_binary(decimal: 15) == \"db1111db\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "swift", - "prompt": "\n/// Filter an input array of strings only for ones that contain given substring\n/// >>> filter_by_substring(strings: [] as [String], substring: \"a\")\n/// [] as [String]\n/// >>> filter_by_substring(strings: [\"abc\", \"bacd\", \"cde\", \"array\"], substring: \"a\")\n/// [\"abc\", \"bacd\", \"array\"]\nfunc filter_by_substring(strings: [String], substring: String) -> [String] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(filter_by_substring(strings: [] as [String], substring: \"john\") == [] as [String])\nassert(filter_by_substring(strings: [\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], substring: \"xxx\") == [\"xxx\", \"xxxAAA\", \"xxx\"])\nassert(filter_by_substring(strings: [\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"], substring: \"xx\") == [\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"])\nassert(filter_by_substring(strings: [\"grunt\", \"trumpet\", \"prune\", \"gruesome\"], substring: \"run\") == [\"grunt\", \"prune\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "swift", - "prompt": "\n/// Given an integer. return a tuple that has the number of even and odd digits respectively.\n/// Example:\n/// >>> even_odd_count(num: -12)\n/// (1, 1)\n/// >>> even_odd_count(num: 123)\n/// (1, 2)\nfunc even_odd_count(num: Int) -> (Int, Int) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(even_odd_count(num: 7) == (0, 1))\nassert(even_odd_count(num: -78) == (1, 1))\nassert(even_odd_count(num: 3452) == (2, 2))\nassert(even_odd_count(num: 346211) == (3, 3))\nassert(even_odd_count(num: -345821) == (3, 3))\nassert(even_odd_count(num: -2) == (1, 0))\nassert(even_odd_count(num: -45347) == (2, 3))\nassert(even_odd_count(num: 0) == (1, 0))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "swift", - "prompt": "\n/// Write a function that accepts an array of strings.\n/// The array contains different words. Return the word with maximum number\n/// of unique characters. If multiple strings have maximum number of unique\n/// characters, return the one which comes first in lexicographical order.\n/// >>> find_max(words: [\"name\", \"of\", \"string\"])\n/// \"string\"\n/// >>> find_max(words: [\"name\", \"enam\", \"game\"])\n/// \"enam\"\n/// >>> find_max(words: [\"aaaaaaa\", \"bb\", \"cc\"])\n/// \"aaaaaaa\"\nfunc find_max(words: [String]) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(find_max(words: [\"name\", \"of\", \"string\"]) == \"string\")\nassert(find_max(words: [\"name\", \"enam\", \"game\"]) == \"enam\")\nassert(find_max(words: [\"aaaaaaa\", \"bb\", \"cc\"]) == \"aaaaaaa\")\nassert(find_max(words: [\"abc\", \"cba\"]) == \"abc\")\nassert(find_max(words: [\"play\", \"this\", \"game\", \"of\", \"footbott\"]) == \"footbott\")\nassert(find_max(words: [\"we\", \"are\", \"gonna\", \"rock\"]) == \"gonna\")\nassert(find_max(words: [\"we\", \"are\", \"a\", \"mad\", \"nation\"]) == \"nation\")\nassert(find_max(words: [\"this\", \"is\", \"a\", \"prrk\"]) == \"this\")\nassert(find_max(words: [\"b\"]) == \"b\")\nassert(find_max(words: [\"play\", \"play\", \"play\"]) == \"play\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "swift", - "prompt": "\n/// Given a positive integer n, return the count of the numbers of n-digit\n/// positive integers that start or end with 1.\nfunc starts_one_ends(n: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(starts_one_ends(n: 1) == 1)\nassert(starts_one_ends(n: 2) == 18)\nassert(starts_one_ends(n: 3) == 180)\nassert(starts_one_ends(n: 4) == 1800)\nassert(starts_one_ends(n: 5) == 18000)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "swift", - "prompt": "\n/// Create a function that returns a tuple (a, b), where 'a' is\n/// the largest of negative integers, and 'b' is the smallest\n/// of positive integers in an array.\n/// If there is no negative or positive integers, return them as nil.\n/// Examples:\n/// >>> largest_smallest_integers(lst: [2, 4, 1, 3, 5, 7])\n/// (nil, 1)\n/// >>> largest_smallest_integers(lst: [] as [Int])\n/// (nil, nil)\n/// >>> largest_smallest_integers(lst: [0])\n/// (nil, nil)\nfunc largest_smallest_integers(lst: [Int]) -> (Int?, Int?) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(largest_smallest_integers(lst: [2, 4, 1, 3, 5, 7]) == (nil, 1))\nassert(largest_smallest_integers(lst: [2, 4, 1, 3, 5, 7, 0]) == (nil, 1))\nassert(largest_smallest_integers(lst: [1, 3, 2, 4, 5, 6, -2]) == (-2, 1))\nassert(largest_smallest_integers(lst: [4, 5, 3, 6, 2, 7, -7]) == (-7, 2))\nassert(largest_smallest_integers(lst: [7, 3, 8, 4, 9, 2, 5, -9]) == (-9, 2))\nassert(largest_smallest_integers(lst: [] as [Int]) == (nil, nil))\nassert(largest_smallest_integers(lst: [0]) == (nil, nil))\nassert(largest_smallest_integers(lst: [-1, -3, -5, -6]) == (-1, nil))\nassert(largest_smallest_integers(lst: [-1, -3, -5, -6, 0]) == (-1, nil))\nassert(largest_smallest_integers(lst: [-6, -4, -4, -3, 1]) == (-3, 1))\nassert(largest_smallest_integers(lst: [-6, -4, -4, -3, -100, 1]) == (-3, 1))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "swift", - "prompt": "\n/// \"Given an array representing a branch of a tree that has non-negative integer nodes\n/// your task is to pluck one of the nodes and return it.\n/// The plucked node should be the node with the smallest even value.\n/// If multiple nodes with the same smallest even value are found return the node that has smallest index.\n/// The plucked node should be returned in an array, [ smalest_value, its index ],\n/// If there are no even values or the given array is empty, return [].\n/// Example 1:\n/// >>> pluck(arr: [4, 2, 3])\n/// [2, 1]\n/// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n/// Example 2:\n/// >>> pluck(arr: [1, 2, 3])\n/// [2, 1]\n/// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n/// Example 3:\n/// >>> pluck(arr: [] as [Int])\n/// [] as [Int]\n/// Example 4:\n/// >>> pluck(arr: [5, 0, 3, 0, 4, 2])\n/// [0, 1]\n/// Explanation: 0 is the smallest value, but there are two zeros,\n/// so we will choose the first zero, which has the smallest index.\n/// Constraints:\n/// * 1 <= nodes.length <= 10000\n/// * 0 <= node.value\nfunc pluck(arr: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(pluck(arr: [4, 2, 3]) == [2, 1])\nassert(pluck(arr: [1, 2, 3]) == [2, 1])\nassert(pluck(arr: [] as [Int]) == [] as [Int])\nassert(pluck(arr: [5, 0, 3, 0, 4, 2]) == [0, 1])\nassert(pluck(arr: [1, 2, 3, 0, 5, 3]) == [0, 3])\nassert(pluck(arr: [5, 4, 8, 4, 8]) == [4, 1])\nassert(pluck(arr: [7, 6, 7, 1]) == [6, 1])\nassert(pluck(arr: [7, 9, 7, 1]) == [] as [Int])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "swift", - "prompt": "\n/// Write a function count_nums which takes an array of integers and returns\n/// the number of elements which has a sum of digits > 0.\n/// If a number is negative, then its first signed digit will be negative:\n/// e.g. -123 has signed digits -1, 2, and 3.\n/// >>> count_nums(arr: [] as [Int])\n/// 0\n/// >>> count_nums(arr: [-1, 11, -11])\n/// 1\n/// >>> count_nums(arr: [1, 1, 2])\n/// 3\nfunc count_nums(arr: [Int]) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(count_nums(arr: [] as [Int]) == 0)\nassert(count_nums(arr: [-1, -2, 0]) == 0)\nassert(count_nums(arr: [1, 1, 2, -2, 3, 4, 5]) == 6)\nassert(count_nums(arr: [1, 6, 9, -6, 0, 1, 5]) == 5)\nassert(count_nums(arr: [1, 100, 98, -7, 1, -1]) == 4)\nassert(count_nums(arr: [12, 23, 34, -45, -56, 0]) == 5)\nassert(count_nums(arr: [0, 1]) == 1)\nassert(count_nums(arr: [1]) == 1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "swift", - "prompt": "\n/// Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n/// each cell of the grid contains a value. Every integer in the range [1, N * N]\n/// inclusive appears exactly once on the cells of the grid.\n/// You have to find the minimum path of length k in the grid. You can start\n/// from any cell, and in each step you can move to any of the neighbor cells,\n/// in other words, you can go to cells which share an edge with you current\n/// cell.\n/// Please note that a path of length k means visiting exactly k cells (not\n/// necessarily distinct).\n/// You CANNOT go off the grid.\n/// A path A (of length k) is considered less than a path B (of length k) if\n/// after making the ordered arrays of the values on the cells that A and B go\n/// through (let's call them lst_A and lst_B), lst_A is lexicographically less\n/// than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n/// such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n/// lst_A[j] = lst_B[j].\n/// It is guaranteed that the answer is unique.\n/// Return an ordered array of the values on the cells that the minimum path go through.\n/// Examples: \n/// >>> minPath(grid: [[1, 2, 3], [4, 5, 6], [7, 8, 9]], k: 3)\n/// [1, 2, 1]\n/// >>> minPath(grid: [[5, 9, 3], [4, 1, 6], [7, 8, 2]], k: 1)\n/// [1]\nfunc minPath(grid: [[Int]], k: Int) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(minPath(grid: [[1, 2, 3], [4, 5, 6], [7, 8, 9]], k: 3) == [1, 2, 1])\nassert(minPath(grid: [[5, 9, 3], [4, 1, 6], [7, 8, 2]], k: 1) == [1])\nassert(minPath(grid: [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], k: 4) == [1, 2, 1, 2])\nassert(minPath(grid: [[6, 4, 13, 10], [5, 7, 12, 1], [3, 16, 11, 15], [8, 14, 9, 2]], k: 7) == [1, 10, 1, 10, 1, 10, 1])\nassert(minPath(grid: [[8, 14, 9, 2], [6, 4, 13, 15], [5, 7, 1, 12], [3, 10, 11, 16]], k: 5) == [1, 7, 1, 7, 1])\nassert(minPath(grid: [[11, 8, 7, 2], [5, 16, 14, 4], [9, 3, 15, 6], [12, 13, 10, 1]], k: 9) == [1, 6, 1, 6, 1, 6, 1, 6, 1])\nassert(minPath(grid: [[12, 13, 10, 1], [9, 3, 15, 6], [5, 16, 14, 4], [11, 8, 7, 2]], k: 12) == [1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6])\nassert(minPath(grid: [[2, 7, 4], [3, 1, 5], [6, 8, 9]], k: 8) == [1, 3, 1, 3, 1, 3, 1, 3])\nassert(minPath(grid: [[6, 1, 5], [3, 8, 9], [2, 7, 4]], k: 8) == [1, 5, 1, 5, 1, 5, 1, 5])\nassert(minPath(grid: [[1, 2], [3, 4]], k: 10) == [1, 2, 1, 2, 1, 2, 1, 2, 1, 2])\nassert(minPath(grid: [[1, 3], [3, 2]], k: 10) == [1, 3, 1, 3, 1, 3, 1, 3, 1, 3])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "swift", - "prompt": "\n/// Given array of integers, return array in strange order.\n/// Strange sorting, is when you start with the minimum value,\n/// then maximum of the remaining integers, then minimum and so on.\n/// Examples:\n/// >>> strange_sort_list(lst: [1, 2, 3, 4])\n/// [1, 4, 2, 3]\n/// >>> strange_sort_list(lst: [5, 5, 5, 5])\n/// [5, 5, 5, 5]\n/// >>> strange_sort_list(lst: [] as [Int])\n/// [] as [Int]\nfunc strange_sort_list(lst: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(strange_sort_list(lst: [1, 2, 3, 4]) == [1, 4, 2, 3])\nassert(strange_sort_list(lst: [5, 6, 7, 8, 9]) == [5, 9, 6, 8, 7])\nassert(strange_sort_list(lst: [1, 2, 3, 4, 5]) == [1, 5, 2, 4, 3])\nassert(strange_sort_list(lst: [5, 6, 7, 8, 9, 1]) == [1, 9, 5, 8, 6, 7])\nassert(strange_sort_list(lst: [5, 5, 5, 5]) == [5, 5, 5, 5])\nassert(strange_sort_list(lst: [] as [Int]) == [] as [Int])\nassert(strange_sort_list(lst: [1, 2, 3, 4, 5, 6, 7, 8]) == [1, 8, 2, 7, 3, 6, 4, 5])\nassert(strange_sort_list(lst: [0, 2, 2, 2, 5, 5, -5, -5]) == [-5, 5, -5, 5, 0, 2, 2, 2])\nassert(strange_sort_list(lst: [111111]) == [111111])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "swift", - "prompt": "\n/// Given a string 'text', return its md5 hash equivalent string.\n/// If 'text' is an empty string, return nil.\n/// >>> string_to_md5(text: \"Hello world\")\n/// \"3e25960a79dbc69b674cd4ec67a72c62\"\nfunc string_to_md5(text: String) -> String? {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(string_to_md5(text: \"Hello world\") == \"3e25960a79dbc69b674cd4ec67a72c62\")\nassert(string_to_md5(text: \"\") == nil)\nassert(string_to_md5(text: \"A B C\") == \"0ef78513b0cb8cef12743f5aeb35f888\")\nassert(string_to_md5(text: \"password\") == \"5f4dcc3b5aa765d61d8327deb882cf99\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "swift", - "prompt": "\n/// You are given a word. Your task is to find the closest vowel that stands between \n/// two consonants from the right side of the word (case sensitive).\n/// Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n/// find any vowel met the above condition. \n/// You may assume that the given string contains English letter only.\n/// Example:\n/// >>> get_closest_vowel(word: \"yogurt\")\n/// \"u\"\n/// >>> get_closest_vowel(word: \"FULL\")\n/// \"U\"\n/// >>> get_closest_vowel(word: \"quick\")\n/// \"\"\n/// >>> get_closest_vowel(word: \"ab\")\n/// \"\"\nfunc get_closest_vowel(word: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(get_closest_vowel(word: \"yogurt\") == \"u\")\nassert(get_closest_vowel(word: \"full\") == \"u\")\nassert(get_closest_vowel(word: \"easy\") == \"\")\nassert(get_closest_vowel(word: \"eAsy\") == \"\")\nassert(get_closest_vowel(word: \"ali\") == \"\")\nassert(get_closest_vowel(word: \"bad\") == \"a\")\nassert(get_closest_vowel(word: \"most\") == \"o\")\nassert(get_closest_vowel(word: \"ab\") == \"\")\nassert(get_closest_vowel(word: \"ba\") == \"\")\nassert(get_closest_vowel(word: \"quick\") == \"\")\nassert(get_closest_vowel(word: \"anime\") == \"i\")\nassert(get_closest_vowel(word: \"Asia\") == \"\")\nassert(get_closest_vowel(word: \"Above\") == \"o\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "swift", - "prompt": "\n/// Change numerical base of input number x to base.\n/// return string representation after the conversion.\n/// base numbers are less than 10.\n/// >>> change_base(x: 8, base: 3)\n/// \"22\"\n/// >>> change_base(x: 8, base: 2)\n/// \"1000\"\n/// >>> change_base(x: 7, base: 2)\n/// \"111\"\nfunc change_base(x: Int, base: Int) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(change_base(x: 8, base: 3) == \"22\")\nassert(change_base(x: 9, base: 3) == \"100\")\nassert(change_base(x: 234, base: 2) == \"11101010\")\nassert(change_base(x: 16, base: 2) == \"10000\")\nassert(change_base(x: 8, base: 2) == \"1000\")\nassert(change_base(x: 7, base: 2) == \"111\")\nassert(change_base(x: 2, base: 3) == \"2\")\nassert(change_base(x: 3, base: 4) == \"3\")\nassert(change_base(x: 4, base: 5) == \"4\")\nassert(change_base(x: 5, base: 6) == \"5\")\nassert(change_base(x: 6, base: 7) == \"6\")\nassert(change_base(x: 7, base: 8) == \"7\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "swift", - "prompt": "\n/// Check if in given array of numbers, are any two numbers closer to each other than\n/// given threshold.\n/// >>> has_close_elements(numbers: [1.0, 2.0, 3.0], threshold: 0.5)\n/// false\n/// >>> has_close_elements(numbers: [1.0, 2.8, 3.0, 4.0, 5.0, 2.0], threshold: 0.3)\n/// true\nfunc has_close_elements(numbers: [Double], threshold: Double) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(has_close_elements(numbers: [1.0, 2.0, 3.9, 4.0, 5.0, 2.2], threshold: 0.3) == true)\nassert(has_close_elements(numbers: [1.0, 2.0, 3.9, 4.0, 5.0, 2.2], threshold: 0.05) == false)\nassert(has_close_elements(numbers: [1.0, 2.0, 5.9, 4.0, 5.0], threshold: 0.95) == true)\nassert(has_close_elements(numbers: [1.0, 2.0, 5.9, 4.0, 5.0], threshold: 0.8) == false)\nassert(has_close_elements(numbers: [1.0, 2.0, 3.0, 4.0, 5.0, 2.0], threshold: 0.1) == true)\nassert(has_close_elements(numbers: [1.1, 2.2, 3.1, 4.1, 5.1], threshold: 1.0) == true)\nassert(has_close_elements(numbers: [1.1, 2.2, 3.1, 4.1, 5.1], threshold: 0.5) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "swift", - "prompt": "\n/// Create a function that takes a string as input which contains only square brackets.\n/// The function should return true if and only if there is a valid subsequence of brackets \n/// where at least one bracket in the subsequence is nested.\n/// >>> is_nested(string: \"[[]]\")\n/// true\n/// >>> is_nested(string: \"[]]]]]]][[[[[]\")\n/// false\n/// >>> is_nested(string: \"[][]\")\n/// false\n/// >>> is_nested(string: \"[]\")\n/// false\n/// >>> is_nested(string: \"[[][]]\")\n/// true\n/// >>> is_nested(string: \"[[]][[\")\n/// true\nfunc is_nested(string: String) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_nested(string: \"[[]]\") == true)\nassert(is_nested(string: \"[]]]]]]][[[[[]\") == false)\nassert(is_nested(string: \"[][]\") == false)\nassert(is_nested(string: \"[]\") == false)\nassert(is_nested(string: \"[[[[]]]]\") == true)\nassert(is_nested(string: \"[]]]]]]]]]]\") == false)\nassert(is_nested(string: \"[][][[]]\") == true)\nassert(is_nested(string: \"[[]\") == false)\nassert(is_nested(string: \"[]]\") == false)\nassert(is_nested(string: \"[[]][[\") == true)\nassert(is_nested(string: \"[[][]]\") == true)\nassert(is_nested(string: \"\") == false)\nassert(is_nested(string: \"[[[[[[[[\") == false)\nassert(is_nested(string: \"]]]]]]]]\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "swift", - "prompt": "\n/// Concatenate array of strings into a single string\n/// >>> concatenate(strings: [] as [String])\n/// \"\"\n/// >>> concatenate(strings: [\"a\", \"b\", \"c\"])\n/// \"abc\"\nfunc concatenate(strings: [String]) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(concatenate(strings: [] as [String]) == \"\")\nassert(concatenate(strings: [\"x\", \"y\", \"z\"]) == \"xyz\")\nassert(concatenate(strings: [\"x\", \"y\", \"z\", \"w\", \"k\"]) == \"xyzwk\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "swift", - "prompt": "\n/// prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n/// >>> prime_fib(n: 1)\n/// 2\n/// >>> prime_fib(n: 2)\n/// 3\n/// >>> prime_fib(n: 3)\n/// 5\n/// >>> prime_fib(n: 4)\n/// 13\n/// >>> prime_fib(n: 5)\n/// 89\nfunc prime_fib(n: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(prime_fib(n: 1) == 2)\nassert(prime_fib(n: 2) == 3)\nassert(prime_fib(n: 3) == 5)\nassert(prime_fib(n: 4) == 13)\nassert(prime_fib(n: 5) == 89)\nassert(prime_fib(n: 6) == 233)\nassert(prime_fib(n: 7) == 1597)\nassert(prime_fib(n: 8) == 28657)\nassert(prime_fib(n: 9) == 514229)\nassert(prime_fib(n: 10) == 433494437)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "swift", - "prompt": "\n/// From a supplied array of numbers (of length at least two) select and return two that are the closest to each\n/// other and return them in order (smaller number, larger number).\n/// >>> find_closest_elements(numbers: [1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n/// (2.0, 2.2)\n/// >>> find_closest_elements(numbers: [1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n/// (2.0, 2.0)\nfunc find_closest_elements(numbers: [Double]) -> (Double, Double) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(find_closest_elements(numbers: [1.0, 2.0, 3.9, 4.0, 5.0, 2.2]) == (3.9, 4.0))\nassert(find_closest_elements(numbers: [1.0, 2.0, 5.9, 4.0, 5.0]) == (5.0, 5.9))\nassert(find_closest_elements(numbers: [1.0, 2.0, 3.0, 4.0, 5.0, 2.2]) == (2.0, 2.2))\nassert(find_closest_elements(numbers: [1.0, 2.0, 3.0, 4.0, 5.0, 2.0]) == (2.0, 2.0))\nassert(find_closest_elements(numbers: [1.1, 2.2, 3.1, 4.1, 5.1]) == (2.2, 3.1))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "swift", - "prompt": "\n/// You have been tasked to write a function that receives \n/// a hexadecimal number as a string and counts the number of hexadecimal \n/// digits that are primes (prime number, or a prime, is a natural number \n/// greater than 1 that is not a product of two smaller natural numbers).\n/// Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n/// Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n/// So you have to determine a number of the following digits: 2, 3, 5, 7, \n/// B (=decimal 11), D (=decimal 13).\n/// Note: you may assume the input is always correct or empty string, \n/// and symbols A,B,C,D,E,F are always uppercase.\n/// Examples:\n/// >>> hex_key(num: \"AB\")\n/// 1\n/// >>> hex_key(num: \"1077E\")\n/// 2\n/// >>> hex_key(num: \"ABED1A33\")\n/// 4\n/// >>> hex_key(num: \"123456789ABCDEF0\")\n/// 6\n/// >>> hex_key(num: \"2020\")\n/// 2\nfunc hex_key(num: String) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(hex_key(num: \"AB\") == 1)\nassert(hex_key(num: \"1077E\") == 2)\nassert(hex_key(num: \"ABED1A33\") == 4)\nassert(hex_key(num: \"2020\") == 2)\nassert(hex_key(num: \"123456789ABCDEF0\") == 6)\nassert(hex_key(num: \"112233445566778899AABBCCDDEEFF00\") == 12)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "swift", - "prompt": "\n/// Complete the function that takes two integers and returns \n/// the product of their unit digits.\n/// Assume the input is always valid.\n/// Examples:\n/// >>> multiply(a: 148, b: 412)\n/// 16\n/// >>> multiply(a: 19, b: 28)\n/// 72\n/// >>> multiply(a: 2020, b: 1851)\n/// 0\n/// >>> multiply(a: 14, b: -15)\n/// 20\nfunc multiply(a: Int, b: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(multiply(a: 148, b: 412) == 16)\nassert(multiply(a: 19, b: 28) == 72)\nassert(multiply(a: 2020, b: 1851) == 0)\nassert(multiply(a: 14, b: -15) == 20)\nassert(multiply(a: 76, b: 67) == 42)\nassert(multiply(a: 17, b: 27) == 49)\nassert(multiply(a: 0, b: 1) == 0)\nassert(multiply(a: 0, b: 0) == 0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "swift", - "prompt": "\n/// Given array of numbers (of at least two elements), apply a linear transform to that array,\n/// such that the smallest number will become 0 and the largest will become 1\n/// >>> rescale_to_unit(numbers: [1.0, 2.0, 3.0, 4.0, 5.0])\n/// [0.0, 0.25, 0.5, 0.75, 1.0]\nfunc rescale_to_unit(numbers: [Double]) -> [Double] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(rescale_to_unit(numbers: [2.0, 49.9]) == [0.0, 1.0])\nassert(rescale_to_unit(numbers: [100.0, 49.9]) == [1.0, 0.0])\nassert(rescale_to_unit(numbers: [1.0, 2.0, 3.0, 4.0, 5.0]) == [0.0, 0.25, 0.5, 0.75, 1.0])\nassert(rescale_to_unit(numbers: [2.0, 1.0, 5.0, 3.0, 4.0]) == [0.25, 0.0, 1.0, 0.5, 0.75])\nassert(rescale_to_unit(numbers: [12.0, 11.0, 15.0, 13.0, 14.0]) == [0.25, 0.0, 1.0, 0.5, 0.75])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "swift", - "prompt": "\n/// Given a positive integer n, return the product of the odd digits.\n/// Return 0 if all digits are even.\n/// For example:\n/// >>> digits(n: 1)\n/// 1\n/// >>> digits(n: 4)\n/// 0\n/// >>> digits(n: 235)\n/// 15\nfunc digits(n: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(digits(n: 5) == 5)\nassert(digits(n: 54) == 5)\nassert(digits(n: 120) == 1)\nassert(digits(n: 5014) == 5)\nassert(digits(n: 98765) == 315)\nassert(digits(n: 5576543) == 2625)\nassert(digits(n: 2468) == 0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "swift", - "prompt": "\n/// You will be given the name of a class (a string) and an array of extensions.\n/// The extensions are to be used to load additional classes to the class. The\n/// strength of the extension is as follows: Let CAP be the number of the uppercase\n/// letters in the extension's name, and let SM be the number of lowercase letters \n/// in the extension's name, the strength is given by the fraction CAP - SM. \n/// You should find the strongest extension and return a string in this \n/// format: ClassName.StrongestExtensionName.\n/// If there are two or more extensions with the same strength, you should\n/// choose the one that comes first in the array.\n/// For example, if you are given \"Slices\" as the class and an array of the\n/// extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n/// return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n/// (its strength is -1).\n/// Example:\n/// >>> Strongest_Extension(class_name: \"my_class\", extensions: [\"AA\", \"Be\", \"CC\"])\n/// \"my_class.AA\"\nfunc Strongest_Extension(class_name: String, extensions: [String]) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(Strongest_Extension(class_name: \"Watashi\", extensions: [\"tEN\", \"niNE\", \"eIGHt8OKe\"]) == \"Watashi.eIGHt8OKe\")\nassert(Strongest_Extension(class_name: \"Boku123\", extensions: [\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"]) == \"Boku123.YEs.WeCaNe\")\nassert(Strongest_Extension(class_name: \"__YESIMHERE\", extensions: [\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"]) == \"__YESIMHERE.NuLl__\")\nassert(Strongest_Extension(class_name: \"K\", extensions: [\"Ta\", \"TAR\", \"t234An\", \"cosSo\"]) == \"K.TAR\")\nassert(Strongest_Extension(class_name: \"__HAHA\", extensions: [\"Tab\", \"123\", \"781345\", \"-_-\"]) == \"__HAHA.123\")\nassert(Strongest_Extension(class_name: \"YameRore\", extensions: [\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"]) == \"YameRore.okIWILL123\")\nassert(Strongest_Extension(class_name: \"finNNalLLly\", extensions: [\"Die\", \"NowW\", \"Wow\", \"WoW\"]) == \"finNNalLLly.WoW\")\nassert(Strongest_Extension(class_name: \"_\", extensions: [\"Bb\", \"91245\"]) == \"_.Bb\")\nassert(Strongest_Extension(class_name: \"Sp\", extensions: [\"671235\", \"Bb\"]) == \"Sp.671235\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "swift", - "prompt": "\n/// Given a string representing a space separated lowercase letters, return a dictionary\n/// of the letter with the most repetition and containing the corresponding count.\n/// If several letters have the same occurrence, return all of them.\n/// Example:\n/// >>> histogram(test: \"a b c\")\n/// [\"a\" : 1, \"b\" : 1, \"c\" : 1]\n/// >>> histogram(test: \"a b b a\")\n/// [\"a\" : 2, \"b\" : 2]\n/// >>> histogram(test: \"a b c a b\")\n/// [\"a\" : 2, \"b\" : 2]\n/// >>> histogram(test: \"b b b b a\")\n/// [\"b\" : 4]\n/// >>> histogram(test: \"\")\n/// [:] as [String : Int]\nfunc histogram(test: String) -> [String : Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(histogram(test: \"a b b a\") == [\"a\" : 2, \"b\" : 2])\nassert(histogram(test: \"a b c a b\") == [\"a\" : 2, \"b\" : 2])\nassert(histogram(test: \"a b c d g\") == [\"a\" : 1, \"b\" : 1, \"c\" : 1, \"d\" : 1, \"g\" : 1])\nassert(histogram(test: \"r t g\") == [\"r\" : 1, \"t\" : 1, \"g\" : 1])\nassert(histogram(test: \"b b b b a\") == [\"b\" : 4])\nassert(histogram(test: \"r t g\") == [\"r\" : 1, \"t\" : 1, \"g\" : 1])\nassert(histogram(test: \"\") == [:] as [String : Int])\nassert(histogram(test: \"a\") == [\"a\" : 1])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "swift", - "prompt": "\n/// pairs_sum_to_zero takes an array of integers as an input.\n/// it returns true if there are two distinct elements in the array that\n/// sum to zero, and false otherwise.\n/// >>> pairs_sum_to_zero(l: [1, 3, 5, 0])\n/// false\n/// >>> pairs_sum_to_zero(l: [1, 3, -2, 1])\n/// false\n/// >>> pairs_sum_to_zero(l: [1, 2, 3, 7])\n/// false\n/// >>> pairs_sum_to_zero(l: [2, 4, -5, 3, 5, 7])\n/// true\n/// >>> pairs_sum_to_zero(l: [1])\n/// false\nfunc pairs_sum_to_zero(l: [Int]) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(pairs_sum_to_zero(l: [1, 3, 5, 0]) == false)\nassert(pairs_sum_to_zero(l: [1, 3, -2, 1]) == false)\nassert(pairs_sum_to_zero(l: [1, 2, 3, 7]) == false)\nassert(pairs_sum_to_zero(l: [2, 4, -5, 3, 5, 7]) == true)\nassert(pairs_sum_to_zero(l: [1]) == false)\nassert(pairs_sum_to_zero(l: [-3, 9, -1, 3, 2, 30]) == true)\nassert(pairs_sum_to_zero(l: [-3, 9, -1, 3, 2, 31]) == true)\nassert(pairs_sum_to_zero(l: [-3, 9, -1, 4, 2, 30]) == false)\nassert(pairs_sum_to_zero(l: [-3, 9, -1, 4, 2, 31]) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "swift", - "prompt": "\n/// Write a function that accepts two arrays of strings and returns the array that has \n/// total number of chars in the all strings of the array less than the other array.\n/// if the two arrays have the same number of chars, return the first array.\n/// Examples\n/// >>> total_match(lst1: [] as [String], lst2: [] as [String])\n/// [] as [String]\n/// >>> total_match(lst1: [\"hi\", \"admin\"], lst2: [\"hI\", \"Hi\"])\n/// [\"hI\", \"Hi\"]\n/// >>> total_match(lst1: [\"hi\", \"admin\"], lst2: [\"hi\", \"hi\", \"admin\", \"project\"])\n/// [\"hi\", \"admin\"]\n/// >>> total_match(lst1: [\"hi\", \"admin\"], lst2: [\"hI\", \"hi\", \"hi\"])\n/// [\"hI\", \"hi\", \"hi\"]\n/// >>> total_match(lst1: [\"4\"], lst2: [\"1\", \"2\", \"3\", \"4\", \"5\"])\n/// [\"4\"]\nfunc total_match(lst1: [String], lst2: [String]) -> [String] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(total_match(lst1: [] as [String], lst2: [] as [String]) == [] as [String])\nassert(total_match(lst1: [\"hi\", \"admin\"], lst2: [\"hi\", \"hi\"]) == [\"hi\", \"hi\"])\nassert(total_match(lst1: [\"hi\", \"admin\"], lst2: [\"hi\", \"hi\", \"admin\", \"project\"]) == [\"hi\", \"admin\"])\nassert(total_match(lst1: [\"4\"], lst2: [\"1\", \"2\", \"3\", \"4\", \"5\"]) == [\"4\"])\nassert(total_match(lst1: [\"hi\", \"admin\"], lst2: [\"hI\", \"Hi\"]) == [\"hI\", \"Hi\"])\nassert(total_match(lst1: [\"hi\", \"admin\"], lst2: [\"hI\", \"hi\", \"hi\"]) == [\"hI\", \"hi\", \"hi\"])\nassert(total_match(lst1: [\"hi\", \"admin\"], lst2: [\"hI\", \"hi\", \"hii\"]) == [\"hi\", \"admin\"])\nassert(total_match(lst1: [] as [String], lst2: [\"this\"]) == [] as [String])\nassert(total_match(lst1: [\"this\"], lst2: [] as [String]) == [] as [String])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "swift", - "prompt": "\n/// Circular shift the digits of the integer x, shift the digits right by shift\n/// and return the result as a string.\n/// If shift > number of digits, return digits reversed.\n/// >>> circular_shift(x: 12, shift: 1)\n/// \"21\"\n/// >>> circular_shift(x: 12, shift: 2)\n/// \"12\"\nfunc circular_shift(x: Int, shift: Int) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(circular_shift(x: 100, shift: 2) == \"001\")\nassert(circular_shift(x: 12, shift: 2) == \"12\")\nassert(circular_shift(x: 97, shift: 8) == \"79\")\nassert(circular_shift(x: 12, shift: 1) == \"21\")\nassert(circular_shift(x: 11, shift: 101) == \"11\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "swift", - "prompt": "\n/// Return true is array elements are monotonically increasing or decreasing.\n/// >>> monotonic(l: [1, 2, 4, 20])\n/// true\n/// >>> monotonic(l: [1, 20, 4, 10])\n/// false\n/// >>> monotonic(l: [4, 1, 0, -10])\n/// true\nfunc monotonic(l: [Int]) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(monotonic(l: [1, 2, 4, 10]) == true)\nassert(monotonic(l: [1, 2, 4, 20]) == true)\nassert(monotonic(l: [1, 20, 4, 10]) == false)\nassert(monotonic(l: [4, 1, 0, -10]) == true)\nassert(monotonic(l: [4, 1, 1, 0]) == true)\nassert(monotonic(l: [1, 2, 3, 2, 5, 60]) == false)\nassert(monotonic(l: [1, 2, 3, 4, 5, 60]) == true)\nassert(monotonic(l: [9, 9, 9, 9]) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "swift", - "prompt": "\n/// Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n/// Example\n/// >>> is_equal_to_sum_even(n: 4)\n/// false\n/// >>> is_equal_to_sum_even(n: 6)\n/// false\n/// >>> is_equal_to_sum_even(n: 8)\n/// true\nfunc is_equal_to_sum_even(n: Int) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_equal_to_sum_even(n: 4) == false)\nassert(is_equal_to_sum_even(n: 6) == false)\nassert(is_equal_to_sum_even(n: 8) == true)\nassert(is_equal_to_sum_even(n: 10) == true)\nassert(is_equal_to_sum_even(n: 11) == false)\nassert(is_equal_to_sum_even(n: 12) == true)\nassert(is_equal_to_sum_even(n: 13) == false)\nassert(is_equal_to_sum_even(n: 16) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "swift", - "prompt": "\n/// Input to this function is a string representing musical notes in a special ASCII format.\n/// Your task is to parse this string and return array of integers corresponding to how many beats does each\n/// not last.\n/// Here is a legend:\n/// 'o' - whole note, lasts four beats\n/// 'o|' - half note, lasts two beats\n/// '.|' - quater note, lasts one beat\n/// >>> parse_music(music_string: \"o o| .| o| o| .| .| .| .| o o\")\n/// [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\nfunc parse_music(music_string: String) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(parse_music(music_string: \"\") == [] as [Int])\nassert(parse_music(music_string: \"o o o o\") == [4, 4, 4, 4])\nassert(parse_music(music_string: \".| .| .| .|\") == [1, 1, 1, 1])\nassert(parse_music(music_string: \"o| o| .| .| o o o o\") == [2, 2, 1, 1, 4, 4, 4, 4])\nassert(parse_music(music_string: \"o| .| o| .| o o| o o|\") == [2, 1, 2, 1, 4, 2, 4, 2])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "swift", - "prompt": "\n/// triples_sum_to_zero takes an array of integers as an input.\n/// it returns true if there are three distinct elements in the array that\n/// sum to zero, and false otherwise.\n/// >>> triples_sum_to_zero(l: [1, 3, 5, 0])\n/// false\n/// >>> triples_sum_to_zero(l: [1, 3, -2, 1])\n/// true\n/// >>> triples_sum_to_zero(l: [1, 2, 3, 7])\n/// false\n/// >>> triples_sum_to_zero(l: [2, 4, -5, 3, 9, 7])\n/// true\n/// >>> triples_sum_to_zero(l: [1])\n/// false\nfunc triples_sum_to_zero(l: [Int]) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(triples_sum_to_zero(l: [1, 3, 5, 0]) == false)\nassert(triples_sum_to_zero(l: [1, 3, 5, -1]) == false)\nassert(triples_sum_to_zero(l: [1, 3, -2, 1]) == true)\nassert(triples_sum_to_zero(l: [1, 2, 3, 7]) == false)\nassert(triples_sum_to_zero(l: [1, 2, 5, 7]) == false)\nassert(triples_sum_to_zero(l: [2, 4, -5, 3, 9, 7]) == true)\nassert(triples_sum_to_zero(l: [1]) == false)\nassert(triples_sum_to_zero(l: [1, 3, 5, -100]) == false)\nassert(triples_sum_to_zero(l: [100, 3, 5, -100]) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "swift", - "prompt": "\n/// brackets is a string of \"<\" and \">\".\n/// return true if every opening bracket has a corresponding closing bracket.\n/// >>> correct_bracketing(brackets: \"<\")\n/// false\n/// >>> correct_bracketing(brackets: \"<>\")\n/// true\n/// >>> correct_bracketing(brackets: \"<<><>>\")\n/// true\n/// >>> correct_bracketing(brackets: \"><<>\")\n/// false\nfunc correct_bracketing(brackets: String) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(correct_bracketing(brackets: \"<>\") == true)\nassert(correct_bracketing(brackets: \"<<><>>\") == true)\nassert(correct_bracketing(brackets: \"<><><<><>><>\") == true)\nassert(correct_bracketing(brackets: \"<><><<<><><>><>><<><><<>>>\") == true)\nassert(correct_bracketing(brackets: \"<<<><>>>>\") == false)\nassert(correct_bracketing(brackets: \"><<>\") == false)\nassert(correct_bracketing(brackets: \"<\") == false)\nassert(correct_bracketing(brackets: \"<<<<\") == false)\nassert(correct_bracketing(brackets: \">\") == false)\nassert(correct_bracketing(brackets: \"<<>\") == false)\nassert(correct_bracketing(brackets: \"<><><<><>><>><<>\") == false)\nassert(correct_bracketing(brackets: \"<><><<><>><>>><>\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "swift", - "prompt": "\n/// Write a function that takes an array of numbers as input and returns \n/// the number of elements in the array that are greater than 10 and both \n/// first and last digits of a number are odd (1, 3, 5, 7, 9).\n/// For example:\n/// >>> specialFilter(nums: [15, -73, 14, -15])\n/// 1\n/// >>> specialFilter(nums: [33, -2, -3, 45, 21, 109])\n/// 2\nfunc specialFilter(nums: [Int]) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(specialFilter(nums: [5, -2, 1, -5]) == 0)\nassert(specialFilter(nums: [15, -73, 14, -15]) == 1)\nassert(specialFilter(nums: [33, -2, -3, 45, 21, 109]) == 2)\nassert(specialFilter(nums: [43, -12, 93, 125, 121, 109]) == 4)\nassert(specialFilter(nums: [71, -2, -33, 75, 21, 19]) == 3)\nassert(specialFilter(nums: [1]) == 0)\nassert(specialFilter(nums: [] as [Int]) == 0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "swift", - "prompt": "\nextension Int: Error {}\n \n/// Given a string of words, return an array of words split on whitespace, if no whitespaces exists in the text you\n/// should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n/// alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n/// Examples\n/// >>> split_words(txt: \"Hello world!\")\n/// .success([\"Hello\", \"world!\"])\n/// >>> split_words(txt: \"Hello,world!\")\n/// .success([\"Hello\", \"world!\"])\n/// >>> split_words(txt: \"abcdef\")\n/// .failure(3)\nfunc split_words(txt: String) -> Result<[String], Int> {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(split_words(txt: \"Hello world!\") == .success([\"Hello\", \"world!\"]))\nassert(split_words(txt: \"Hello,world!\") == .success([\"Hello\", \"world!\"]))\nassert(split_words(txt: \"Hello world,!\") == .success([\"Hello\", \"world,!\"]))\nassert(split_words(txt: \"Hello,Hello,world !\") == .success([\"Hello,Hello,world\", \"!\"]))\nassert(split_words(txt: \"abcdef\") == .failure(3))\nassert(split_words(txt: \"aaabb\") == .failure(2))\nassert(split_words(txt: \"aaaBb\") == .failure(1))\nassert(split_words(txt: \"\") == .failure(0))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "swift", - "prompt": "\n/// The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n/// fibfib(0) == 0\n/// fibfib(1) == 0\n/// fibfib(2) == 1\n/// fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n/// Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n/// >>> fibfib(n: 1)\n/// 0\n/// >>> fibfib(n: 5)\n/// 4\n/// >>> fibfib(n: 8)\n/// 24\nfunc fibfib(n: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(fibfib(n: 2) == 1)\nassert(fibfib(n: 1) == 0)\nassert(fibfib(n: 5) == 4)\nassert(fibfib(n: 8) == 24)\nassert(fibfib(n: 10) == 81)\nassert(fibfib(n: 12) == 274)\nassert(fibfib(n: 14) == 927)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "swift", - "prompt": "\n/// You are given an array of numbers.\n/// You need to return the sum of squared numbers in the given array,\n/// round each element in the array to the upper int(Ceiling) first.\n/// Examples:\n/// >>> sum_squares(lst: [1.0, 2.0, 3.0])\n/// 14\n/// >>> sum_squares(lst: [1.0, 4.0, 9.0])\n/// 98\n/// >>> sum_squares(lst: [1.0, 3.0, 5.0, 7.0])\n/// 84\n/// >>> sum_squares(lst: [1.4, 4.2, 0.0])\n/// 29\n/// >>> sum_squares(lst: [-2.4, 1.0, 1.0])\n/// 6\nfunc sum_squares(lst: [Double]) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sum_squares(lst: [1.0, 2.0, 3.0]) == 14)\nassert(sum_squares(lst: [1.0, 2.0, 3.0]) == 14)\nassert(sum_squares(lst: [1.0, 3.0, 5.0, 7.0]) == 84)\nassert(sum_squares(lst: [1.4, 4.2, 0.0]) == 29)\nassert(sum_squares(lst: [-2.4, 1.0, 1.0]) == 6)\nassert(sum_squares(lst: [100.0, 1.0, 15.0, 2.0]) == 10230)\nassert(sum_squares(lst: [10000.0, 10000.0]) == 200000000)\nassert(sum_squares(lst: [-1.4, 4.6, 6.3]) == 75)\nassert(sum_squares(lst: [-1.4, 17.9, 18.9, 19.9]) == 1086)\nassert(sum_squares(lst: [0.0]) == 0)\nassert(sum_squares(lst: [-1.0]) == 1)\nassert(sum_squares(lst: [-1.0, 1.0, 0.0]) == 2)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_85_add", - "language": "swift", - "prompt": "\n/// Given a non-empty array of integers lst. add the even elements that are at odd indices..\n/// Examples:\n/// >>> add(lst: [4, 2, 6, 7])\n/// 2\nfunc add(lst: [Int]) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(add(lst: [4, 88]) == 88)\nassert(add(lst: [4, 5, 6, 7, 2, 122]) == 122)\nassert(add(lst: [4, 0, 6, 7]) == 0)\nassert(add(lst: [4, 4, 6, 8]) == 12)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "swift", - "prompt": "\n/// Return sorted unique elements in an array\n/// >>> unique(l: [5, 3, 5, 2, 3, 3, 9, 0, 123])\n/// [0, 2, 3, 5, 9, 123]\nfunc unique(l: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(unique(l: [5, 3, 5, 2, 3, 3, 9, 0, 123]) == [0, 2, 3, 5, 9, 123])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "swift", - "prompt": "\n/// Given a string text, replace all spaces in it with underscores, \n/// and if a string has more than 2 consecutive spaces, \n/// then replace all consecutive spaces with - \n/// >>> fix_spaces(text: \" Example\")\n/// \"Example\"\n/// >>> fix_spaces(text: \" Example 1\")\n/// \"Example_1\"\n/// >>> fix_spaces(text: \" Example 2\")\n/// \"_Example_2\"\n/// >>> fix_spaces(text: \" Example 3\")\n/// \"_Example-3\"\nfunc fix_spaces(text: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(fix_spaces(text: \"Example\") == \"Example\")\nassert(fix_spaces(text: \"Mudasir Hanif \") == \"Mudasir_Hanif_\")\nassert(fix_spaces(text: \"Yellow Yellow Dirty Fellow\") == \"Yellow_Yellow__Dirty__Fellow\")\nassert(fix_spaces(text: \"Exa mple\") == \"Exa-mple\")\nassert(fix_spaces(text: \" Exa 1 2 2 mple\") == \"-Exa_1_2_2_mple\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "swift", - "prompt": "\n/// Return 2^n modulo p (be aware of numerics).\n/// >>> modp(n: 3, p: 5)\n/// 3\n/// >>> modp(n: 1101, p: 101)\n/// 2\n/// >>> modp(n: 0, p: 101)\n/// 1\n/// >>> modp(n: 3, p: 11)\n/// 8\n/// >>> modp(n: 100, p: 101)\n/// 1\nfunc modp(n: Int, p: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(modp(n: 3, p: 5) == 3)\nassert(modp(n: 1101, p: 101) == 2)\nassert(modp(n: 0, p: 101) == 1)\nassert(modp(n: 3, p: 11) == 8)\nassert(modp(n: 100, p: 101) == 1)\nassert(modp(n: 30, p: 5) == 4)\nassert(modp(n: 31, p: 5) == 3)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "swift", - "prompt": "\n/// You have to write a function which validates a given date string and\n/// returns true if the date is valid otherwise false.\n/// The date is valid if all of the following rules are satisfied:\n/// 1. The date string is not empty.\n/// 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n/// 3. The months should not be less than 1 or higher than 12.\n/// 4. The date should be in the format: mm-dd-yyyy\n/// >>> valid_date(date: \"03-11-2000\")\n/// true\n/// >>> valid_date(date: \"15-01-2012\")\n/// false\n/// >>> valid_date(date: \"04-0-2040\")\n/// false\n/// >>> valid_date(date: \"06-04-2020\")\n/// true\n/// >>> valid_date(date: \"06/04/2020\")\n/// false\nfunc valid_date(date: String) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(valid_date(date: \"03-11-2000\") == true)\nassert(valid_date(date: \"15-01-2012\") == false)\nassert(valid_date(date: \"04-0-2040\") == false)\nassert(valid_date(date: \"06-04-2020\") == true)\nassert(valid_date(date: \"01-01-2007\") == true)\nassert(valid_date(date: \"03-32-2011\") == false)\nassert(valid_date(date: \"\") == false)\nassert(valid_date(date: \"04-31-3000\") == false)\nassert(valid_date(date: \"06-06-2005\") == true)\nassert(valid_date(date: \"21-31-2000\") == false)\nassert(valid_date(date: \"04-12-2003\") == true)\nassert(valid_date(date: \"04122003\") == false)\nassert(valid_date(date: \"20030412\") == false)\nassert(valid_date(date: \"2003-04\") == false)\nassert(valid_date(date: \"2003-04-12\") == false)\nassert(valid_date(date: \"04-2003\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "swift", - "prompt": "\n/// Write a function that takes a string and returns an ordered version of it.\n/// Ordered version of string, is a string where all words (separated by space)\n/// are replaced by a new word where all the characters arranged in\n/// ascending order based on ascii value.\n/// Note: You should keep the order of words and blank spaces in the sentence.\n/// For example:\n/// >>> anti_shuffle(s: \"Hi\")\n/// \"Hi\"\n/// >>> anti_shuffle(s: \"hello\")\n/// \"ehllo\"\n/// >>> anti_shuffle(s: \"Hello World!!!\")\n/// \"Hello !!!Wdlor\"\nfunc anti_shuffle(s: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(anti_shuffle(s: \"Hi\") == \"Hi\")\nassert(anti_shuffle(s: \"hello\") == \"ehllo\")\nassert(anti_shuffle(s: \"number\") == \"bemnru\")\nassert(anti_shuffle(s: \"abcd\") == \"abcd\")\nassert(anti_shuffle(s: \"Hello World!!!\") == \"Hello !!!Wdlor\")\nassert(anti_shuffle(s: \"\") == \"\")\nassert(anti_shuffle(s: \"Hi. My name is Mister Robot. How are you?\") == \".Hi My aemn is Meirst .Rboot How aer ?ouy\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "swift", - "prompt": "\n/// Given an array of numbers, return whether or not they are sorted\n/// in ascending order. If array has more than 1 duplicate of the same\n/// number, return false. Assume no negative numbers and only integers.\n/// Examples\n/// >>> is_sorted(lst: [5])\n/// true\n/// >>> is_sorted(lst: [1, 2, 3, 4, 5])\n/// true\n/// >>> is_sorted(lst: [1, 3, 2, 4, 5])\n/// false\n/// >>> is_sorted(lst: [1, 2, 3, 4, 5, 6])\n/// true\n/// >>> is_sorted(lst: [1, 2, 3, 4, 5, 6, 7])\n/// true\n/// >>> is_sorted(lst: [1, 3, 2, 4, 5, 6, 7])\n/// false\n/// >>> is_sorted(lst: [1, 2, 2, 3, 3, 4])\n/// true\n/// >>> is_sorted(lst: [1, 2, 2, 2, 3, 4])\n/// false\nfunc is_sorted(lst: [Int]) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_sorted(lst: [5]) == true)\nassert(is_sorted(lst: [1, 2, 3, 4, 5]) == true)\nassert(is_sorted(lst: [1, 3, 2, 4, 5]) == false)\nassert(is_sorted(lst: [1, 2, 3, 4, 5, 6]) == true)\nassert(is_sorted(lst: [1, 2, 3, 4, 5, 6, 7]) == true)\nassert(is_sorted(lst: [1, 3, 2, 4, 5, 6, 7]) == false)\nassert(is_sorted(lst: [] as [Int]) == true)\nassert(is_sorted(lst: [1]) == true)\nassert(is_sorted(lst: [3, 2, 1]) == false)\nassert(is_sorted(lst: [1, 2, 2, 2, 3, 4]) == false)\nassert(is_sorted(lst: [1, 2, 3, 3, 3, 4]) == false)\nassert(is_sorted(lst: [1, 2, 2, 3, 3, 4]) == true)\nassert(is_sorted(lst: [1, 2, 3, 4]) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "swift", - "prompt": "\n/// You are given a string s.\n/// Your task is to check if the string is hapswift or not.\n/// A string is hapswift if its length is at least 3 and every 3 consecutive letters are distinct\n/// For example:\n/// >>> is_happy(s: \"a\")\n/// false\n/// >>> is_happy(s: \"aa\")\n/// false\n/// >>> is_happy(s: \"abcd\")\n/// true\n/// >>> is_happy(s: \"aabb\")\n/// false\n/// >>> is_happy(s: \"adb\")\n/// true\n/// >>> is_happy(s: \"xyy\")\n/// false\nfunc is_happy(s: String) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_happy(s: \"a\") == false)\nassert(is_happy(s: \"aa\") == false)\nassert(is_happy(s: \"abcd\") == true)\nassert(is_happy(s: \"aabb\") == false)\nassert(is_happy(s: \"adb\") == true)\nassert(is_happy(s: \"xyy\") == false)\nassert(is_happy(s: \"iopaxpoi\") == true)\nassert(is_happy(s: \"iopaxioi\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "swift", - "prompt": "\n/// Write a function that returns true if the object q will fly, and false otherwise.\n/// The object q will fly if it's balanced (it is a palindromic array) and the sum of its elements is less than or equal the maximum possible weight w.\n/// Example:\n/// >>> will_it_fly(q: [1, 2], w: 5)\n/// false\n/// # 1+2 is less than the maximum possible weight, but it's unbalanced.\n/// >>> will_it_fly(q: [3, 2, 3], w: 1)\n/// false\n/// # it's balanced, but 3+2+3 is more than the maximum possible weight.\n/// >>> will_it_fly(q: [3, 2, 3], w: 9)\n/// true\n/// # 3+2+3 is less than the maximum possible weight, and it's balanced.\n/// >>> will_it_fly(q: [3], w: 5)\n/// true\n/// # 3 is less than the maximum possible weight, and it's balanced.\nfunc will_it_fly(q: [Int], w: Int) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(will_it_fly(q: [3, 2, 3], w: 9) == true)\nassert(will_it_fly(q: [1, 2], w: 5) == false)\nassert(will_it_fly(q: [3], w: 5) == true)\nassert(will_it_fly(q: [3, 2, 3], w: 1) == false)\nassert(will_it_fly(q: [1, 2, 3], w: 6) == false)\nassert(will_it_fly(q: [5], w: 5) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "swift", - "prompt": "\n/// Given an array of non-negative integers, return a coswift of the given array after sorting,\n/// you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n/// or sort it in descending order if the sum( first index value, last index value) is even.\n/// Note:\n/// * don't change the given array.\n/// Examples:\n/// >>> sort_array(array: [] as [Int])\n/// [] as [Int]\n/// >>> sort_array(array: [5])\n/// [5]\n/// >>> sort_array(array: [2, 4, 3, 0, 1, 5])\n/// [0, 1, 2, 3, 4, 5]\n/// >>> sort_array(array: [2, 4, 3, 0, 1, 5, 6])\n/// [6, 5, 4, 3, 2, 1, 0]\nfunc sort_array(array: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sort_array(array: [] as [Int]) == [] as [Int])\nassert(sort_array(array: [5]) == [5])\nassert(sort_array(array: [2, 4, 3, 0, 1, 5]) == [0, 1, 2, 3, 4, 5])\nassert(sort_array(array: [2, 4, 3, 0, 1, 5, 6]) == [6, 5, 4, 3, 2, 1, 0])\nassert(sort_array(array: [2, 1]) == [1, 2])\nassert(sort_array(array: [15, 42, 87, 32, 11, 0]) == [0, 11, 15, 32, 42, 87])\nassert(sort_array(array: [21, 14, 23, 11]) == [23, 21, 14, 11])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "swift", - "prompt": "\n/// Implement a function that takes an non-negative integer and returns an array of the first n\n/// integers that are prime numbers and less than n.\n/// for example:\n/// >>> count_up_to(n: 5)\n/// [2, 3]\n/// >>> count_up_to(n: 11)\n/// [2, 3, 5, 7]\n/// >>> count_up_to(n: 0)\n/// [] as [Int]\n/// >>> count_up_to(n: 20)\n/// [2, 3, 5, 7, 11, 13, 17, 19]\n/// >>> count_up_to(n: 1)\n/// [] as [Int]\n/// >>> count_up_to(n: 18)\n/// [2, 3, 5, 7, 11, 13, 17]\nfunc count_up_to(n: Int) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(count_up_to(n: 5) == [2, 3])\nassert(count_up_to(n: 6) == [2, 3, 5])\nassert(count_up_to(n: 7) == [2, 3, 5])\nassert(count_up_to(n: 10) == [2, 3, 5, 7])\nassert(count_up_to(n: 0) == [] as [Int])\nassert(count_up_to(n: 22) == [2, 3, 5, 7, 11, 13, 17, 19])\nassert(count_up_to(n: 1) == [] as [Int])\nassert(count_up_to(n: 18) == [2, 3, 5, 7, 11, 13, 17])\nassert(count_up_to(n: 47) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43])\nassert(count_up_to(n: 101) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "swift", - "prompt": "\n/// Out of array of strings, return the longest one. Return the first one in case of multiple\n/// strings of the same length. Return nil in case the input array is empty.\n/// >>> longest(strings: [] as [String])\n/// nil\n/// >>> longest(strings: [\"a\", \"b\", \"c\"])\n/// \"a\"\n/// >>> longest(strings: [\"a\", \"bb\", \"ccc\"])\n/// \"ccc\"\nfunc longest(strings: [String]) -> String? {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(longest(strings: [] as [String]) == nil)\nassert(longest(strings: [\"x\", \"y\", \"z\"]) == \"x\")\nassert(longest(strings: [\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"]) == \"zzzz\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "swift", - "prompt": "\n/// Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n/// reverse the resulting array, and then replace each digit by its corresponding name from\n/// \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n/// For example:\n/// >>> by_length(arr: [2, 1, 1, 4, 5, 8, 2, 3])\n/// [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n/// If the array is empty, return an empty array:\n/// >>> by_length(arr: [] as [Int])\n/// [] as [String]\n/// If the array has any strange number ignore it:\n/// >>> by_length(arr: [1, -1, 55])\n/// [\"One\"]\nfunc by_length(arr: [Int]) -> [String] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(by_length(arr: [2, 1, 1, 4, 5, 8, 2, 3]) == [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"])\nassert(by_length(arr: [] as [Int]) == [] as [String])\nassert(by_length(arr: [1, -1, 55]) == [\"One\"])\nassert(by_length(arr: [1, -1, 3, 2]) == [\"Three\", \"Two\", \"One\"])\nassert(by_length(arr: [9, 4, 8]) == [\"Nine\", \"Eight\", \"Four\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_106_f", - "language": "swift", - "prompt": "\n/// Implement the function f that takes n as a parameter,\n/// and returns an array of size n, such that the value of the element at index i is the factorial of i if i is even\n/// or the sum of numbers from 1 to i otherwise.\n/// i starts from 1.\n/// the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n/// Example:\n/// >>> f(n: 5)\n/// [1, 2, 6, 24, 15]\nfunc f(n: Int) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(f(n: 5) == [1, 2, 6, 24, 15])\nassert(f(n: 7) == [1, 2, 6, 24, 15, 720, 28])\nassert(f(n: 1) == [1])\nassert(f(n: 3) == [1, 2, 6])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "swift", - "prompt": "\n/// Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n/// >>> fizz_buzz(n: 50)\n/// 0\n/// >>> fizz_buzz(n: 78)\n/// 2\n/// >>> fizz_buzz(n: 79)\n/// 3\nfunc fizz_buzz(n: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(fizz_buzz(n: 50) == 0)\nassert(fizz_buzz(n: 78) == 2)\nassert(fizz_buzz(n: 79) == 3)\nassert(fizz_buzz(n: 100) == 3)\nassert(fizz_buzz(n: 200) == 6)\nassert(fizz_buzz(n: 4000) == 192)\nassert(fizz_buzz(n: 10000) == 639)\nassert(fizz_buzz(n: 100000) == 8026)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "swift", - "prompt": "\n/// Given a positive floating point number, it can be decomposed into\n/// and integer part (largest integer smaller than given number) and decimals\n/// (leftover part always smaller than 1).\n/// Return the decimal part of the number.\n/// >>> truncate_number(number: 3.5)\n/// 0.5\nfunc truncate_number(number: Double) -> Double {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(truncate_number(number: 3.5) == 0.5)\nassert(truncate_number(number: 1.25) == 0.25)\nassert(truncate_number(number: 123.0) == 0.0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "swift", - "prompt": "\n/// For a given array of integers, return a tuple consisting of a sum and a product of all the integers in an array.\n/// Empty sum should be equal to 0 and empty product should be equal to 1.\n/// >>> sum_product(numbers: [] as [Int])\n/// (0, 1)\n/// >>> sum_product(numbers: [1, 2, 3, 4])\n/// (10, 24)\nfunc sum_product(numbers: [Int]) -> (Int, Int) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sum_product(numbers: [] as [Int]) == (0, 1))\nassert(sum_product(numbers: [1, 1, 1]) == (3, 1))\nassert(sum_product(numbers: [100, 0]) == (100, 0))\nassert(sum_product(numbers: [3, 5, 7]) == (15, 105))\nassert(sum_product(numbers: [10]) == (10, 10))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "swift", - "prompt": "\n/// You are given a 2 dimensional data, as a nested arrays,\n/// which is similar to matrix, however, unlike matrices,\n/// each row may contain a different number of columns.\n/// Given lst, and integer x, find integers x in the array,\n/// and return array of tuples, [(x1, y1), (x2, y2) ...] such that\n/// each tuple is a coordinate - (row, columns), starting with 0.\n/// Sort coordinates initially by rows in ascending order.\n/// Also, sort coordinates of the row by columns in descending order.\n/// Examples:\n/// >>> get_row(lst: [[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], x: 1)\n/// [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n/// >>> get_row(lst: [] as [[Int]], x: 1)\n/// [] as [(Int, Int)]\n/// >>> get_row(lst: [[] as [Int], [1], [1, 2, 3]], x: 3)\n/// [(2, 2)]\nfunc get_row(lst: [[Int]], x: Int) -> [(Int, Int)] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(get_row(lst: [[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], x: 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)])\nassert(get_row(lst: [[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6]], x: 2) == [(0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1)])\nassert(get_row(lst: [[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 1, 3, 4, 5, 6], [1, 2, 1, 4, 5, 6], [1, 2, 3, 1, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], x: 1) == [(0, 0), (1, 0), (2, 1), (2, 0), (3, 2), (3, 0), (4, 3), (4, 0), (5, 4), (5, 0), (6, 5), (6, 0)])\nassert(get_row(lst: [] as [[Int]], x: 1) == [] as [(Int, Int)])\nassert(get_row(lst: [[1]], x: 2) == [] as [(Int, Int)])\nassert(get_row(lst: [[] as [Int], [1], [1, 2, 3]], x: 3) == [(2, 2)])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "swift", - "prompt": "\n/// You're a hungry rabbit, and you already have eaten a certain number of carrots,\n/// but now you need to eat more carrots to complete the day's meals.\n/// you should return an array of [ total number of eaten carrots after your meals,\n/// the number of carrots left after your meals ]\n/// if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n/// Example:\n/// >>> eat(number: 5, need: 6, remaining: 10)\n/// [11, 4]\n/// >>> eat(number: 4, need: 8, remaining: 9)\n/// [12, 1]\n/// >>> eat(number: 1, need: 10, remaining: 10)\n/// [11, 0]\n/// >>> eat(number: 2, need: 11, remaining: 5)\n/// [7, 0]\n/// Variables:\n/// @number : integer\n/// the number of carrots that you have eaten.\n/// @need : integer\n/// the number of carrots that you need to eat.\n/// @remaining : integer\n/// the number of remaining carrots thet exist in stock\n/// Constrain:\n/// * 0 <= number <= 1000\n/// * 0 <= need <= 1000\n/// * 0 <= remaining <= 1000\n/// Have fun :)\nfunc eat(number: Int, need: Int, remaining: Int) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(eat(number: 5, need: 6, remaining: 10) == [11, 4])\nassert(eat(number: 4, need: 8, remaining: 9) == [12, 1])\nassert(eat(number: 1, need: 10, remaining: 10) == [11, 0])\nassert(eat(number: 2, need: 11, remaining: 5) == [7, 0])\nassert(eat(number: 4, need: 5, remaining: 7) == [9, 2])\nassert(eat(number: 4, need: 5, remaining: 1) == [5, 0])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "swift", - "prompt": "\n/// Given a positive integer N, return the total sum of its digits in binary.\n/// Example\n/// >>> solve(N: 1000)\n/// \"1\"\n/// >>> solve(N: 150)\n/// \"110\"\n/// >>> solve(N: 147)\n/// \"1100\"\n/// Variables:\n/// @N integer\n/// Constraints: 0 \u2264 N \u2264 10000.\n/// Output:\n/// a string of binary number\nfunc solve(N: Int) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(solve(N: 1000) == \"1\")\nassert(solve(N: 150) == \"110\")\nassert(solve(N: 147) == \"1100\")\nassert(solve(N: 333) == \"1001\")\nassert(solve(N: 963) == \"10010\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "swift", - "prompt": "\n/// You are given an array of integers.\n/// You need to find the largest prime value and return the sum of its digits.\n/// Examples:\n/// >>> skjkasdkd(lst: [0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3])\n/// 10\n/// >>> skjkasdkd(lst: [1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1])\n/// 25\n/// >>> skjkasdkd(lst: [1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3])\n/// 13\n/// >>> skjkasdkd(lst: [0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6])\n/// 11\n/// >>> skjkasdkd(lst: [0, 81, 12, 3, 1, 21])\n/// 3\n/// >>> skjkasdkd(lst: [0, 8, 1, 2, 1, 7])\n/// 7\nfunc skjkasdkd(lst: [Int]) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(skjkasdkd(lst: [0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]) == 10)\nassert(skjkasdkd(lst: [1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]) == 25)\nassert(skjkasdkd(lst: [1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]) == 13)\nassert(skjkasdkd(lst: [0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]) == 11)\nassert(skjkasdkd(lst: [0, 81, 12, 3, 1, 21]) == 3)\nassert(skjkasdkd(lst: [0, 8, 1, 2, 1, 7]) == 7)\nassert(skjkasdkd(lst: [8191]) == 19)\nassert(skjkasdkd(lst: [8191, 123456, 127, 7]) == 19)\nassert(skjkasdkd(lst: [127, 97, 8192]) == 10)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "swift", - "prompt": "\n/// Given an array arr of integers, find the minimum number of elements that\n/// need to be changed to make the array palindromic. A palindromic array is an array that\n/// is read the same backwards and forwards. In one change, you can change one element to any other element.\n/// For example:\n/// >>> smallest_change(arr: [1, 2, 3, 5, 4, 7, 9, 6])\n/// 4\n/// >>> smallest_change(arr: [1, 2, 3, 4, 3, 2, 2])\n/// 1\n/// >>> smallest_change(arr: [1, 2, 3, 2, 1])\n/// 0\nfunc smallest_change(arr: [Int]) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(smallest_change(arr: [1, 2, 3, 5, 4, 7, 9, 6]) == 4)\nassert(smallest_change(arr: [1, 2, 3, 4, 3, 2, 2]) == 1)\nassert(smallest_change(arr: [1, 4, 2]) == 1)\nassert(smallest_change(arr: [1, 4, 4, 2]) == 1)\nassert(smallest_change(arr: [1, 2, 3, 2, 1]) == 0)\nassert(smallest_change(arr: [3, 1, 1, 3]) == 0)\nassert(smallest_change(arr: [1]) == 0)\nassert(smallest_change(arr: [0, 1]) == 1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "swift", - "prompt": "\n/// It is the last week of the semester and the teacher has to give the grades\n/// to students. The teacher has been making her own algorithm for grading.\n/// The only problem is, she has lost the code she used for grading.\n/// She has given you an array of GPAs for some students and you have to write \n/// a function that can output an array of letter grades using the following table:\n/// GPA | Letter grade\n/// 4.0 A+\n/// > 3.7 A \n/// > 3.3 A- \n/// > 3.0 B+\n/// > 2.7 B \n/// > 2.3 B-\n/// > 2.0 C+\n/// > 1.7 C\n/// > 1.3 C-\n/// > 1.0 D+ \n/// > 0.7 D \n/// > 0.0 D-\n/// 0.0 E\n/// Example:\n/// >>> numerical_letter_grade(grades: [4.0, 3, 1.7, 2, 3.5])\n/// [\"A+\", \"B\", \"C-\", \"C\", \"A-\"]\nfunc numerical_letter_grade(grades: [Double]) -> [String] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(numerical_letter_grade(grades: [4.0, 3, 1.7, 2, 3.5]) == [\"A+\", \"B\", \"C-\", \"C\", \"A-\"])\nassert(numerical_letter_grade(grades: [1.2]) == [\"D+\"])\nassert(numerical_letter_grade(grades: [0.5]) == [\"D-\"])\nassert(numerical_letter_grade(grades: [0.0]) == [\"E\"])\nassert(numerical_letter_grade(grades: [1.0, 0.3, 1.5, 2.8, 3.3]) == [\"D\", \"D-\", \"C-\", \"B\", \"B+\"])\nassert(numerical_letter_grade(grades: [0.0, 0.7]) == [\"E\", \"D-\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "swift", - "prompt": "\n/// Given the lengths of the three sides of a triangle. Return the area of\n/// the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n/// Otherwise return -1\n/// Three sides make a valid triangle when the sum of any two sides is greater \n/// than the third side.\n/// Example:\n/// >>> triangle_area(a: 3, b: 4, c: 5)\n/// 6.0\n/// >>> triangle_area(a: 1, b: 2, c: 10)\n/// -1\nfunc triangle_area(a: Int, b: Int, c: Int) -> Double {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(triangle_area(a: 3, b: 4, c: 5) == 6.0)\nassert(triangle_area(a: 1, b: 2, c: 10) == -1)\nassert(triangle_area(a: 4, b: 8, c: 5) == 8.18)\nassert(triangle_area(a: 2, b: 2, c: 2) == 1.73)\nassert(triangle_area(a: 1, b: 2, c: 3) == -1)\nassert(triangle_area(a: 10, b: 5, c: 7) == 16.25)\nassert(triangle_area(a: 2, b: 6, c: 3) == -1)\nassert(triangle_area(a: 1, b: 1, c: 1) == 0.43)\nassert(triangle_area(a: 2, b: 2, c: 10) == -1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "swift", - "prompt": "\n/// Check if two words have the same characters.\n/// >>> same_chars(s0: \"eabcdzzzz\", s1: \"dddzzzzzzzddeddabc\")\n/// true\n/// >>> same_chars(s0: \"abcd\", s1: \"dddddddabc\")\n/// true\n/// >>> same_chars(s0: \"dddddddabc\", s1: \"abcd\")\n/// true\n/// >>> same_chars(s0: \"eabcd\", s1: \"dddddddabc\")\n/// false\n/// >>> same_chars(s0: \"abcd\", s1: \"dddddddabce\")\n/// false\n/// >>> same_chars(s0: \"eabcdzzzz\", s1: \"dddzzzzzzzddddabc\")\n/// false\nfunc same_chars(s0: String, s1: String) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(same_chars(s0: \"eabcdzzzz\", s1: \"dddzzzzzzzddeddabc\") == true)\nassert(same_chars(s0: \"abcd\", s1: \"dddddddabc\") == true)\nassert(same_chars(s0: \"dddddddabc\", s1: \"abcd\") == true)\nassert(same_chars(s0: \"eabcd\", s1: \"dddddddabc\") == false)\nassert(same_chars(s0: \"abcd\", s1: \"dddddddabcf\") == false)\nassert(same_chars(s0: \"eabcdzzzz\", s1: \"dddzzzzzzzddddabc\") == false)\nassert(same_chars(s0: \"aabb\", s1: \"aaccc\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "swift", - "prompt": "\n/// Given an array of integers nums, find the minimum sum of any non-empty sub-array\n/// of nums.\n/// Example\n/// >>> minSubArraySum(nums: [2, 3, 4, 1, 2, 4])\n/// 1\n/// >>> minSubArraySum(nums: [-1, -2, -3])\n/// -6\nfunc minSubArraySum(nums: [Int]) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(minSubArraySum(nums: [2, 3, 4, 1, 2, 4]) == 1)\nassert(minSubArraySum(nums: [-1, -2, -3]) == -6)\nassert(minSubArraySum(nums: [-1, -2, -3, 2, -10]) == -14)\nassert(minSubArraySum(nums: [-9999999999999999]) == -9999999999999999)\nassert(minSubArraySum(nums: [0, 10, 20, 1000000]) == 0)\nassert(minSubArraySum(nums: [-1, -2, -3, 10, -5]) == -6)\nassert(minSubArraySum(nums: [100, -1, -2, -3, 10, -5]) == -6)\nassert(minSubArraySum(nums: [10, 11, 13, 8, 3, 4]) == 3)\nassert(minSubArraySum(nums: [100, -33, 32, -1, 0, -2]) == -33)\nassert(minSubArraySum(nums: [-10]) == -10)\nassert(minSubArraySum(nums: [7]) == 7)\nassert(minSubArraySum(nums: [1, -1]) == -1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "swift", - "prompt": "\n/// Given a string s and a natural number n, you have been tasked to implement \n/// a function that returns an array of all words from string s that contain exactly \n/// n consonants, in order these words appear in the string s.\n/// If the string s is empty then the function should return an empty array.\n/// Note: you may assume the input string contains only letters and spaces.\n/// Examples:\n/// >>> select_words(s: \"Mary had a little lamb\", n: 4)\n/// [\"little\"]\n/// >>> select_words(s: \"Mary had a little lamb\", n: 3)\n/// [\"Mary\", \"lamb\"]\n/// >>> select_words(s: \"simple white space\", n: 2)\n/// [] as [String]\n/// >>> select_words(s: \"Hello world\", n: 4)\n/// [\"world\"]\n/// >>> select_words(s: \"Uncle sam\", n: 3)\n/// [\"Uncle\"]\nfunc select_words(s: String, n: Int) -> [String] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(select_words(s: \"Mary had a little lamb\", n: 4) == [\"little\"])\nassert(select_words(s: \"Mary had a little lamb\", n: 3) == [\"Mary\", \"lamb\"])\nassert(select_words(s: \"simple white space\", n: 2) == [] as [String])\nassert(select_words(s: \"Hello world\", n: 4) == [\"world\"])\nassert(select_words(s: \"Uncle sam\", n: 3) == [\"Uncle\"])\nassert(select_words(s: \"\", n: 4) == [] as [String])\nassert(select_words(s: \"a b c d e f\", n: 1) == [\"b\", \"c\", \"d\", \"f\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "swift", - "prompt": "\n/// Return array of all prefixes from shortest to longest of the input string\n/// >>> all_prefixes(string: \"abc\")\n/// [\"a\", \"ab\", \"abc\"]\nfunc all_prefixes(string: String) -> [String] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(all_prefixes(string: \"\") == [] as [String])\nassert(all_prefixes(string: \"asdfgh\") == [\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"])\nassert(all_prefixes(string: \"WWW\") == [\"W\", \"WW\", \"WWW\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "swift", - "prompt": "\n/// Create a function that takes a value (string) representing a number\n/// and returns the closest integer to it. If the number is equidistant\n/// from two integers, round it away from zero.\n/// Examples\n/// >>> closest_integer(value: \"10\")\n/// 10\n/// >>> closest_integer(value: \"15.3\")\n/// 15\n/// Note:\n/// Rounding away from zero means that if the given number is equidistant\n/// from two integers, the one you should return is the one that is the\n/// farthest from zero. For example closest_integer(\"14.5\") should\n/// return 15 and closest_integer(\"-14.5\") should return -15.\nfunc closest_integer(value: String) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(closest_integer(value: \"10\") == 10)\nassert(closest_integer(value: \"14.5\") == 15)\nassert(closest_integer(value: \"-15.5\") == -16)\nassert(closest_integer(value: \"15.3\") == 15)\nassert(closest_integer(value: \"0\") == 0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "swift", - "prompt": "\n/// Create a function which takes a string representing a file's name, and returns\n/// 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n/// A file's name is considered to be valid if and only if all the following conditions \n/// are met:\n/// - There should not be more than three digits ('0'-'9') in the file's name.\n/// - The file's name contains exactly one dot '.'\n/// - The substring before the dot should not be empty, and it starts with a letter from \n/// the latin alphapet ('a'-'z' and 'A'-'Z').\n/// - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n/// Examples:\n/// >>> file_name_check(file_name: \"example.txt\")\n/// \"Yes\"\n/// >>> file_name_check(file_name: \"1example.dll\")\n/// \"No\"\nfunc file_name_check(file_name: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(file_name_check(file_name: \"example.txt\") == \"Yes\")\nassert(file_name_check(file_name: \"1example.dll\") == \"No\")\nassert(file_name_check(file_name: \"s1sdf3.asd\") == \"No\")\nassert(file_name_check(file_name: \"K.dll\") == \"Yes\")\nassert(file_name_check(file_name: \"MY16FILE3.exe\") == \"Yes\")\nassert(file_name_check(file_name: \"His12FILE94.exe\") == \"No\")\nassert(file_name_check(file_name: \"_Y.txt\") == \"No\")\nassert(file_name_check(file_name: \"?aREYA.exe\") == \"No\")\nassert(file_name_check(file_name: \"/this_is_valid.dll\") == \"No\")\nassert(file_name_check(file_name: \"this_is_valid.wow\") == \"No\")\nassert(file_name_check(file_name: \"this_is_valid.txt\") == \"Yes\")\nassert(file_name_check(file_name: \"this_is_valid.txtexe\") == \"No\")\nassert(file_name_check(file_name: \"#this2_i4s_5valid.ten\") == \"No\")\nassert(file_name_check(file_name: \"@this1_is6_valid.exe\") == \"No\")\nassert(file_name_check(file_name: \"this_is_12valid.6exe4.txt\") == \"No\")\nassert(file_name_check(file_name: \"all.exe.txt\") == \"No\")\nassert(file_name_check(file_name: \"I563_No.exe\") == \"Yes\")\nassert(file_name_check(file_name: \"Is3youfault.txt\") == \"Yes\")\nassert(file_name_check(file_name: \"no_one#knows.dll\") == \"Yes\")\nassert(file_name_check(file_name: \"1I563_Yes3.exe\") == \"No\")\nassert(file_name_check(file_name: \"I563_Yes3.txtt\") == \"No\")\nassert(file_name_check(file_name: \"final..txt\") == \"No\")\nassert(file_name_check(file_name: \"final132\") == \"No\")\nassert(file_name_check(file_name: \"_f4indsartal132.\") == \"No\")\nassert(file_name_check(file_name: \".txt\") == \"No\")\nassert(file_name_check(file_name: \"s.\") == \"No\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "swift", - "prompt": "\n/// You are given two intervals,\n/// where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n/// The given intervals are closed which means that the interval (start, end)\n/// includes both start and end.\n/// For each given interval, it is assumed that its start is less or equal its end.\n/// Your task is to determine whether the length of intersection of these two \n/// intervals is a prime number.\n/// Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n/// which its length is 1, which not a prime number.\n/// If the length of the intersection is a prime number, return \"YES\",\n/// otherwise, return \"NO\".\n/// If the two intervals don't intersect, return \"NO\".\n/// [input/output] samples:\n/// >>> intersection(interval1: (1, 2), interval2: (2, 3))\n/// \"NO\"\n/// >>> intersection(interval1: (-1, 1), interval2: (0, 4))\n/// \"NO\"\n/// >>> intersection(interval1: (-3, -1), interval2: (-5, 5))\n/// \"YES\"\nfunc intersection(interval1: (Int, Int), interval2: (Int, Int)) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(intersection(interval1: (1, 2), interval2: (2, 3)) == \"NO\")\nassert(intersection(interval1: (-1, 1), interval2: (0, 4)) == \"NO\")\nassert(intersection(interval1: (-3, -1), interval2: (-5, 5)) == \"YES\")\nassert(intersection(interval1: (-2, 2), interval2: (-4, 0)) == \"YES\")\nassert(intersection(interval1: (-11, 2), interval2: (-1, -1)) == \"NO\")\nassert(intersection(interval1: (1, 2), interval2: (3, 5)) == \"NO\")\nassert(intersection(interval1: (1, 2), interval2: (1, 2)) == \"NO\")\nassert(intersection(interval1: (-2, -2), interval2: (-3, -2)) == \"NO\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "swift", - "prompt": "\n/// Return the largest prime factor of n. Assume n > 1 and is not a prime.\n/// >>> largest_prime_factor(n: 13195)\n/// 29\n/// >>> largest_prime_factor(n: 2048)\n/// 2\nfunc largest_prime_factor(n: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(largest_prime_factor(n: 15) == 5)\nassert(largest_prime_factor(n: 27) == 3)\nassert(largest_prime_factor(n: 63) == 7)\nassert(largest_prime_factor(n: 330) == 11)\nassert(largest_prime_factor(n: 13195) == 29)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "swift", - "prompt": "\n/// Given a string, find out how many distinct characters (regardless of case) does it consist of\n/// >>> count_distinct_characters(string: \"xyzXYZ\")\n/// 3\n/// >>> count_distinct_characters(string: \"Jerry\")\n/// 4\nfunc count_distinct_characters(string: String) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(count_distinct_characters(string: \"\") == 0)\nassert(count_distinct_characters(string: \"abcde\") == 5)\nassert(count_distinct_characters(string: \"abcdecadeCADE\") == 5)\nassert(count_distinct_characters(string: \"aaaaAAAAaaaa\") == 1)\nassert(count_distinct_characters(string: \"Jerry jERRY JeRRRY\") == 5)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "swift", - "prompt": "\n/// You're given an array of deposit and withdrawal operations on a bank account that starts with\n/// zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n/// at that point function should return true. Otherwise it should return false.\n/// >>> below_zero(operations: [1, 2, 3])\n/// false\n/// >>> below_zero(operations: [1, 2, -4, 5])\n/// true\nfunc below_zero(operations: [Int]) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(below_zero(operations: [] as [Int]) == false)\nassert(below_zero(operations: [1, 2, -3, 1, 2, -3]) == false)\nassert(below_zero(operations: [1, 2, -4, 5, 6]) == true)\nassert(below_zero(operations: [1, -1, 2, -2, 5, -5, 4, -4]) == false)\nassert(below_zero(operations: [1, -1, 2, -2, 5, -5, 4, -5]) == true)\nassert(below_zero(operations: [1, -2, 2, -2, 5, -5, 4, -4]) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "swift", - "prompt": "\n/// Find the shortest palindrome that begins with a supplied string.\n/// Algorithm idea is simple:\n/// - Find the longest postfix of supplied string that is a palindrome.\n/// - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n/// >>> make_palindrome(string: \"\")\n/// \"\"\n/// >>> make_palindrome(string: \"cat\")\n/// \"catac\"\n/// >>> make_palindrome(string: \"cata\")\n/// \"catac\"\nfunc make_palindrome(string: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(make_palindrome(string: \"\") == \"\")\nassert(make_palindrome(string: \"x\") == \"x\")\nassert(make_palindrome(string: \"xyz\") == \"xyzyx\")\nassert(make_palindrome(string: \"xyx\") == \"xyx\")\nassert(make_palindrome(string: \"jerry\") == \"jerryrrej\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "swift", - "prompt": "\n/// Given a positive integer, obtain its roman numeral equivalent as a string,\n/// and return it in lowercase.\n/// Restrictions: 1 <= num <= 1000\n/// Examples:\n/// >>> int_to_mini_roman(number: 19)\n/// \"xix\"\n/// >>> int_to_mini_roman(number: 152)\n/// \"clii\"\n/// >>> int_to_mini_roman(number: 426)\n/// \"cdxxvi\"\nfunc int_to_mini_roman(number: Int) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "reworded", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(int_to_mini_roman(number: 19) == \"xix\")\nassert(int_to_mini_roman(number: 152) == \"clii\")\nassert(int_to_mini_roman(number: 251) == \"ccli\")\nassert(int_to_mini_roman(number: 426) == \"cdxxvi\")\nassert(int_to_mini_roman(number: 500) == \"d\")\nassert(int_to_mini_roman(number: 1) == \"i\")\nassert(int_to_mini_roman(number: 4) == \"iv\")\nassert(int_to_mini_roman(number: 43) == \"xliii\")\nassert(int_to_mini_roman(number: 90) == \"xc\")\nassert(int_to_mini_roman(number: 94) == \"xciv\")\nassert(int_to_mini_roman(number: 532) == \"dxxxii\")\nassert(int_to_mini_roman(number: 900) == \"cm\")\nassert(int_to_mini_roman(number: 994) == \"cmxciv\")\nassert(int_to_mini_roman(number: 1000) == \"m\")", - "stop_tokens": [ - "\n}" - ] - } -] \ No newline at end of file diff --git a/data/swift-transform.json b/data/swift-transform.json deleted file mode 100644 index e3548c814d932da4c5b7ca3c1021adc788075e5e..0000000000000000000000000000000000000000 --- a/data/swift-transform.json +++ /dev/null @@ -1,1898 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "swift", - "prompt": "\n/// For a given number n, find the largest number that divides n evenly, smaller than n\n/// >>> largest_divisor(n: 15)\n/// 5\nfunc largest_divisor(n: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(largest_divisor(n: 3) == 1)\nassert(largest_divisor(n: 7) == 1)\nassert(largest_divisor(n: 10) == 5)\nassert(largest_divisor(n: 100) == 50)\nassert(largest_divisor(n: 49) == 7)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_47_median", - "language": "swift", - "prompt": "\n/// Return median of elements in the list l.\n/// >>> median(l: [3, 1, 2, 4, 5])\n/// 3\n/// >>> median(l: [-10, 4, 6, 1000, 10, 20])\n/// 15.0\nfunc median(l: [Int]) -> Double {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(median(l: [3, 1, 2, 4, 5]) == 3)\nassert(median(l: [-10, 4, 6, 1000, 10, 20]) == 8.0)\nassert(median(l: [5]) == 5)\nassert(median(l: [6, 5]) == 5.5)\nassert(median(l: [8, 1, 3, 9, 9, 2, 7]) == 7)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "swift", - "prompt": "\n/// Given two lists operator, and operand. The first list has basic algebra operations, and \n/// the second list is a list of integers. Use the two given lists to build the algebric \n/// expression and return the evaluation of this expression.\n/// The basic algebra operations:\n/// Addition ( + ) \n/// Subtraction ( - ) \n/// Multiplication ( * ) \n/// Floor division ( // ) \n/// Exponentiation ( ** ) \n/// Example:\n/// operator['+', '*', '-']\n/// array = [2, 3, 4, 5]\n/// result = 2 + 3 * 4 - 5\n/// => result = 9\n/// Note:\n/// The length of operator list is equal to the length of operand list minus one.\n/// Operand is a list of of non-negative integers.\n/// Operator list has at least one operator, and operand list has at least two operands.\nfunc do_algebra(operator: [String], operand: [Int]) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(do_algebra(operator: [\"**\", \"*\", \"+\"], operand: [2, 3, 4, 5]) == 37)\nassert(do_algebra(operator: [\"+\", \"*\", \"-\"], operand: [2, 3, 4, 5]) == 9)\nassert(do_algebra(operator: [\"//\", \"*\"], operand: [7, 3, 4]) == 8)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "swift", - "prompt": "\n/// Return maximum element in the list.\n/// >>> max_element(l: [1, 2, 3])\n/// 3\n/// >>> max_element(l: [5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n/// 123\nfunc max_element(l: [Int]) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(max_element(l: [1, 2, 3]) == 3)\nassert(max_element(l: [5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]) == 124)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "swift", - "prompt": "\n/// Create a function which returns the largest index of an element which\n/// is not greater than or equal to the element immediately preceding it. If\n/// no such element exists then return -1. The given array will not contain\n/// duplicate values.\n/// Examples:\n/// >>> can_arrange(arr: [1, 2, 4, 3, 5])\n/// 3\n/// >>> can_arrange(arr: [1, 2, 3])\n/// -1\nfunc can_arrange(arr: [Int]) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(can_arrange(arr: [1, 2, 4, 3, 5]) == 3)\nassert(can_arrange(arr: [1, 2, 4, 5]) == -1)\nassert(can_arrange(arr: [1, 4, 2, 5, 6, 7, 8, 9, 10]) == 2)\nassert(can_arrange(arr: [4, 8, 5, 7, 3]) == 4)\nassert(can_arrange(arr: [] as [Int]) == -1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "swift", - "prompt": "\n/// Imagine a road that's a perfectly straight infinitely long line.\n/// n cars are driving left to right; simultaneously, a different set of n cars\n/// are driving right to left. The two sets of cars start out being very far from\n/// each other. All cars move in the same speed. Two cars are said to collide\n/// when a car that's moving left to right hits a car that's moving right to left.\n/// However, the cars are infinitely sturdy and strong; as a result, they continue moving\n/// in their trajectory as if they did not collide.\n/// This function outputs the number of such collisions.\nfunc car_race_collision(n: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(car_race_collision(n: 2) == 4)\nassert(car_race_collision(n: 3) == 9)\nassert(car_race_collision(n: 4) == 16)\nassert(car_race_collision(n: 8) == 64)\nassert(car_race_collision(n: 10) == 100)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "swift", - "prompt": "\n/// Create a function that returns True if the last character\n/// of a given string is an alphabetical character and is not\n/// a part of a word, and False otherwise.\n/// Note: \"word\" is a group of characters separated by space.\n/// Examples:\n/// >>> check_if_last_char_is_a_letter(txt: \"apple pie\")\n/// false\n/// >>> check_if_last_char_is_a_letter(txt: \"apple pi e\")\n/// true\n/// >>> check_if_last_char_is_a_letter(txt: \"apple pi e \")\n/// false\n/// >>> check_if_last_char_is_a_letter(txt: \"\")\n/// false\nfunc check_if_last_char_is_a_letter(txt: String) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(check_if_last_char_is_a_letter(txt: \"apple\") == false)\nassert(check_if_last_char_is_a_letter(txt: \"apple pi e\") == true)\nassert(check_if_last_char_is_a_letter(txt: \"eeeee\") == false)\nassert(check_if_last_char_is_a_letter(txt: \"A\") == true)\nassert(check_if_last_char_is_a_letter(txt: \"Pumpkin pie \") == false)\nassert(check_if_last_char_is_a_letter(txt: \"Pumpkin pie 1\") == false)\nassert(check_if_last_char_is_a_letter(txt: \"\") == false)\nassert(check_if_last_char_is_a_letter(txt: \"eeeee e \") == false)\nassert(check_if_last_char_is_a_letter(txt: \"apple pie\") == false)\nassert(check_if_last_char_is_a_letter(txt: \"apple pi e \") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "swift", - "prompt": "\n/// Return true if a given number is prime, and false otherwise.\n/// >>> is_prime(n: 6)\n/// false\n/// >>> is_prime(n: 101)\n/// true\n/// >>> is_prime(n: 11)\n/// true\n/// >>> is_prime(n: 13441)\n/// true\n/// >>> is_prime(n: 61)\n/// true\n/// >>> is_prime(n: 4)\n/// false\n/// >>> is_prime(n: 1)\n/// false\nfunc is_prime(n: Int) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_prime(n: 6) == false)\nassert(is_prime(n: 101) == true)\nassert(is_prime(n: 11) == true)\nassert(is_prime(n: 13441) == true)\nassert(is_prime(n: 61) == true)\nassert(is_prime(n: 4) == false)\nassert(is_prime(n: 1) == false)\nassert(is_prime(n: 5) == true)\nassert(is_prime(n: 11) == true)\nassert(is_prime(n: 17) == true)\nassert(is_prime(n: 85) == false)\nassert(is_prime(n: 77) == false)\nassert(is_prime(n: 255379) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "swift", - "prompt": "\n/// Given a list of positive integers x. return a sorted list of all \n/// elements that hasn't any even digit.\n/// Note: Returned list should be sorted in increasing order.\n/// For example:\n/// >>> unique_digits(x: [15, 33, 1422, 1])\n/// [1, 15, 33]\n/// >>> unique_digits(x: [152, 323, 1422, 10])\n/// [] as [Int]\nfunc unique_digits(x: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(unique_digits(x: [15, 33, 1422, 1]) == [1, 15, 33])\nassert(unique_digits(x: [152, 323, 1422, 10]) == [] as [Int])\nassert(unique_digits(x: [12345, 2033, 111, 151]) == [111, 151])\nassert(unique_digits(x: [135, 103, 31]) == [31, 135])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "swift", - "prompt": "\n/// Input are two strings a and b consisting only of 1s and 0s.\n/// Perform binary XOR on these inputs and return result also as a string.\n/// >>> string_xor(a: \"010\", b: \"110\")\n/// \"100\"\nfunc string_xor(a: String, b: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(string_xor(a: \"111000\", b: \"101010\") == \"010010\")\nassert(string_xor(a: \"1\", b: \"1\") == \"0\")\nassert(string_xor(a: \"0101\", b: \"0000\") == \"0101\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "swift", - "prompt": "\n/// sum_to_n is a function that sums numbers from 1 to n.\n/// >>> sum_to_n(n: 30)\n/// 465\n/// >>> sum_to_n(n: 100)\n/// 5050\n/// >>> sum_to_n(n: 5)\n/// 15\n/// >>> sum_to_n(n: 10)\n/// 55\n/// >>> sum_to_n(n: 1)\n/// 1\nfunc sum_to_n(n: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sum_to_n(n: 1) == 1)\nassert(sum_to_n(n: 6) == 21)\nassert(sum_to_n(n: 11) == 66)\nassert(sum_to_n(n: 30) == 465)\nassert(sum_to_n(n: 100) == 5050)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "swift", - "prompt": "\n/// Given a list of numbers, return the sum of squares of the numbers\n/// in the list that are odd. Ignore numbers that are negative or not integers.\n/// >>> double_the_difference(lst: [1, 3, 2, 0])\n/// 10\n/// >>> double_the_difference(lst: [-1, -2, 0])\n/// 0\n/// >>> double_the_difference(lst: [9, -2])\n/// 81\n/// >>> double_the_difference(lst: [0])\n/// 0\n/// If the input list is empty, return 0.\nfunc double_the_difference(lst: [Double]) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(double_the_difference(lst: [] as [Double]) == 0)\nassert(double_the_difference(lst: [5.0, 4.0]) == 25)\nassert(double_the_difference(lst: [0.1, 0.2, 0.3]) == 0)\nassert(double_the_difference(lst: [-10.0, -20.0, -30.0]) == 0)\nassert(double_the_difference(lst: [-1.0, -2.0, 8.0]) == 0)\nassert(double_the_difference(lst: [0.2, 3.0, 5.0]) == 34)\nassert(double_the_difference(lst: [-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]) == 165)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "swift", - "prompt": "\n/// Return length of given string\n/// >>> strlen(string: \"\")\n/// 0\n/// >>> strlen(string: \"abc\")\n/// 3\nfunc strlen(string: String) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(strlen(string: \"\") == 0)\nassert(strlen(string: \"x\") == 1)\nassert(strlen(string: \"asdasnakj\") == 9)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "swift", - "prompt": "\n/// You'll be given a string of words, and your task is to count the number\n/// of boredoms. A boredom is a sentence that starts with the word \"I\".\n/// Sentences are delimited by '.', '?' or '!'.\n/// For example:\n/// >>> is_bored(S: \"Hello world\")\n/// 0\n/// >>> is_bored(S: \"The sky is blue. The sun is shining. I love this weather\")\n/// 1\nfunc is_bored(S: String) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_bored(S: \"Hello world\") == 0)\nassert(is_bored(S: \"Is the sky blue?\") == 0)\nassert(is_bored(S: \"I love It !\") == 1)\nassert(is_bored(S: \"bIt\") == 0)\nassert(is_bored(S: \"I feel good today. I will be productive. will kill It\") == 2)\nassert(is_bored(S: \"You and I are going for a walk\") == 0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "swift", - "prompt": "\n/// Write a function vowels_count which takes a string representing\n/// a word as input and returns the number of vowels in the string.\n/// Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n/// vowel, but only when it is at the end of the given word.\n/// Example:\n/// >>> vowels_count(s: \"abcde\")\n/// 2\n/// >>> vowels_count(s: \"ACEDY\")\n/// 3\nfunc vowels_count(s: String) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(vowels_count(s: \"abcde\") == 2)\nassert(vowels_count(s: \"Alone\") == 3)\nassert(vowels_count(s: \"key\") == 2)\nassert(vowels_count(s: \"bye\") == 1)\nassert(vowels_count(s: \"keY\") == 2)\nassert(vowels_count(s: \"bYe\") == 1)\nassert(vowels_count(s: \"ACEDY\") == 3)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "swift", - "prompt": "\n/// Return n-th Fibonacci number.\n/// >>> fib(n: 10)\n/// 55\n/// >>> fib(n: 1)\n/// 1\n/// >>> fib(n: 8)\n/// 21\nfunc fib(n: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(fib(n: 10) == 55)\nassert(fib(n: 1) == 1)\nassert(fib(n: 8) == 21)\nassert(fib(n: 11) == 89)\nassert(fib(n: 12) == 144)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "swift", - "prompt": "\n/// Your task is to implement a function that will simplify the expression\n/// x * n. The function returns True if x * n evaluates to a whole number and False\n/// otherwise. Both x and n, are string representation of a fraction, and have the following format,\n/// / where both numerator and denominator are positive whole numbers.\n/// You can assume that x, and n are valid fractions, and do not have zero as denominator.\n/// >>> simplify(x: \"1/5\", n: \"5/1\")\n/// true\n/// >>> simplify(x: \"1/6\", n: \"2/1\")\n/// false\n/// >>> simplify(x: \"7/10\", n: \"10/2\")\n/// false\nfunc simplify(x: String, n: String) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(simplify(x: \"1/5\", n: \"5/1\") == true)\nassert(simplify(x: \"1/6\", n: \"2/1\") == false)\nassert(simplify(x: \"5/1\", n: \"3/1\") == true)\nassert(simplify(x: \"7/10\", n: \"10/2\") == false)\nassert(simplify(x: \"2/10\", n: \"50/10\") == true)\nassert(simplify(x: \"7/2\", n: \"4/2\") == true)\nassert(simplify(x: \"11/6\", n: \"6/1\") == true)\nassert(simplify(x: \"2/3\", n: \"5/2\") == false)\nassert(simplify(x: \"5/2\", n: \"3/5\") == false)\nassert(simplify(x: \"2/4\", n: \"8/4\") == true)\nassert(simplify(x: \"2/4\", n: \"4/2\") == true)\nassert(simplify(x: \"1/5\", n: \"5/1\") == true)\nassert(simplify(x: \"1/5\", n: \"1/5\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "swift", - "prompt": "\n/// Given a string s, count the number of uppercase vowels in even indices.\n/// For example:\n/// >>> count_upper(s: \"aBCdEf\")\n/// 1\n/// >>> count_upper(s: \"abcdefg\")\n/// 0\n/// >>> count_upper(s: \"dBBE\")\n/// 0\nfunc count_upper(s: String) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(count_upper(s: \"aBCdEf\") == 1)\nassert(count_upper(s: \"abcdefg\") == 0)\nassert(count_upper(s: \"dBBE\") == 0)\nassert(count_upper(s: \"B\") == 0)\nassert(count_upper(s: \"U\") == 1)\nassert(count_upper(s: \"\") == 0)\nassert(count_upper(s: \"EEEE\") == 2)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "swift", - "prompt": "\n/// You are given a rectangular grid of wells. Each row represents a single well,\n/// and each 1 in a row represents a single unit of water.\n/// Each well has a corresponding bucket that can be used to extract water from it, \n/// and all buckets have the same capacity.\n/// Your task is to use the buckets to empty the wells.\n/// Output the number of times you need to lower the buckets.\n/// Example 1:\n/// >>> max_fill(grid: [[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], capacity: 1)\n/// 6\n/// Example 2:\n/// >>> max_fill(grid: [[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], capacity: 2)\n/// 5\n/// Example 3:\n/// >>> max_fill(grid: [[0, 0, 0], [0, 0, 0]], capacity: 5)\n/// 0\n/// Constraints:\n/// * all wells have the same length\n/// * 1 <= grid.length <= 10^2\n/// * 1 <= grid[:,1].length <= 10^2\n/// * grid[i][j] -> 0 | 1\n/// * 1 <= capacity <= 10\nfunc max_fill(grid: [[Int]], capacity: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(max_fill(grid: [[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], capacity: 1) == 6)\nassert(max_fill(grid: [[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], capacity: 2) == 5)\nassert(max_fill(grid: [[0, 0, 0], [0, 0, 0]], capacity: 5) == 0)\nassert(max_fill(grid: [[1, 1, 1, 1], [1, 1, 1, 1]], capacity: 2) == 4)\nassert(max_fill(grid: [[1, 1, 1, 1], [1, 1, 1, 1]], capacity: 9) == 2)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "swift", - "prompt": "\n/// Given an array arr of integers and a positive integer k, return a sorted list \n/// of length k with the maximum k numbers in arr.\n/// Example 1:\n/// >>> maximum(arr: [-3, -4, 5], k: 3)\n/// [-4, -3, 5]\n/// Example 2:\n/// >>> maximum(arr: [4, -4, 4], k: 2)\n/// [4, 4]\n/// Example 3:\n/// >>> maximum(arr: [-3, 2, 1, 2, -1, -2, 1], k: 1)\n/// [2]\n/// Note:\n/// 1. The length of the array will be in the range of [1, 1000].\n/// 2. The elements in the array will be in the range of [-1000, 1000].\n/// 3. 0 <= k <= len(arr)\nfunc maximum(arr: [Int], k: Int) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(maximum(arr: [-3, -4, 5], k: 3) == [-4, -3, 5])\nassert(maximum(arr: [4, -4, 4], k: 2) == [4, 4])\nassert(maximum(arr: [-3, 2, 1, 2, -1, -2, 1], k: 1) == [2])\nassert(maximum(arr: [123, -123, 20, 0, 1, 2, -3], k: 3) == [2, 20, 123])\nassert(maximum(arr: [-123, 20, 0, 1, 2, -3], k: 4) == [0, 1, 2, 20])\nassert(maximum(arr: [5, 15, 0, 3, -13, -8, 0], k: 7) == [-13, -8, 0, 0, 3, 5, 15])\nassert(maximum(arr: [-1, 0, 2, 5, 3, -10], k: 2) == [3, 5])\nassert(maximum(arr: [1, 0, 5, -7], k: 1) == [5])\nassert(maximum(arr: [4, -4], k: 2) == [-4, 4])\nassert(maximum(arr: [-10, 10], k: 2) == [-10, 10])\nassert(maximum(arr: [1, 2, 3, -23, 243, -400, 0], k: 0) == [] as [Int])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "swift", - "prompt": "\n/// Write a function that takes a message, and encodes in such a \n/// way that it swaps case of all letters, replaces all vowels in \n/// the message with the letter that appears 2 places ahead of that \n/// vowel in the english alphabet. \n/// Assume only letters. \n/// Examples:\n/// >>> encode(message: \"test\")\n/// \"TGST\"\n/// >>> encode(message: \"This is a message\")\n/// \"tHKS KS C MGSSCGG\"\nfunc encode(message: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(encode(message: \"TEST\") == \"tgst\")\nassert(encode(message: \"Mudasir\") == \"mWDCSKR\")\nassert(encode(message: \"YES\") == \"ygs\")\nassert(encode(message: \"This is a message\") == \"tHKS KS C MGSSCGG\")\nassert(encode(message: \"I DoNt KnOw WhAt tO WrItE\") == \"k dQnT kNqW wHcT Tq wRkTg\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "swift", - "prompt": "\n/// remove_vowels is a function that takes string and returns string without vowels.\n/// >>> remove_vowels(text: \"\")\n/// \"\"\n/// >>> remove_vowels(text: \"abcdef\")\n/// \"bcdf\"\n/// >>> remove_vowels(text: \"aaaaa\")\n/// \"\"\n/// >>> remove_vowels(text: \"aaBAA\")\n/// \"B\"\n/// >>> remove_vowels(text: \"zbcd\")\n/// \"zbcd\"\nfunc remove_vowels(text: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(remove_vowels(text: \"\") == \"\")\nassert(remove_vowels(text: \"abcdef\\nghijklm\") == \"bcdf\\nghjklm\")\nassert(remove_vowels(text: \"fedcba\") == \"fdcb\")\nassert(remove_vowels(text: \"eeeee\") == \"\")\nassert(remove_vowels(text: \"acBAA\") == \"cB\")\nassert(remove_vowels(text: \"EcBOO\") == \"cB\")\nassert(remove_vowels(text: \"ybcd\") == \"ybcd\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "swift", - "prompt": "\n/// Return only positive numbers in the list.\n/// >>> get_positive(l: [-1, 2, -4, 5, 6])\n/// [2, 5, 6]\n/// >>> get_positive(l: [5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n/// [5, 3, 2, 3, 9, 123, 1]\nfunc get_positive(l: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(get_positive(l: [-1, -2, 4, 5, 6]) == [4, 5, 6])\nassert(get_positive(l: [5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]) == [5, 3, 2, 3, 3, 9, 123, 1])\nassert(get_positive(l: [-1, -2]) == [] as [Int])\nassert(get_positive(l: [] as [Int]) == [] as [Int])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "swift", - "prompt": "\n/// Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n/// >>> string_sequence(n: 0)\n/// \"0\"\n/// >>> string_sequence(n: 5)\n/// \"0 1 2 3 4 5\"\nfunc string_sequence(n: Int) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(string_sequence(n: 0) == \"0\")\nassert(string_sequence(n: 3) == \"0 1 2 3\")\nassert(string_sequence(n: 10) == \"0 1 2 3 4 5 6 7 8 9 10\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "swift", - "prompt": "\n/// Given a positive integer n, you have to make a pile of n levels of stones.\n/// The first level has n stones.\n/// The number of stones in the next level is:\n/// - the next odd number if n is odd.\n/// - the next even number if n is even.\n/// Return the number of stones in each level in a list, where element at index\n/// i represents the number of stones in the level (i+1).\n/// Examples:\n/// >>> make_a_pile(n: 3)\n/// [3, 5, 7]\nfunc make_a_pile(n: Int) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(make_a_pile(n: 3) == [3, 5, 7])\nassert(make_a_pile(n: 4) == [4, 6, 8, 10])\nassert(make_a_pile(n: 5) == [5, 7, 9, 11, 13])\nassert(make_a_pile(n: 6) == [6, 8, 10, 12, 14, 16])\nassert(make_a_pile(n: 8) == [8, 10, 12, 14, 16, 18, 20, 22])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "swift", - "prompt": "\n/// Task\n/// 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\n/// then check if the result string is palindrome.\n/// A string is called palindrome if it reads the same backward as forward.\n/// You should return a tuple containing the result string and True/False for the check.\n/// Example\n/// >>> reverse_delete(s: \"abcde\", c: \"ae\")\n/// (\"bcd\", false)\n/// >>> reverse_delete(s: \"abcdef\", c: \"b\")\n/// (\"acdef\", false)\n/// >>> reverse_delete(s: \"abcdedcba\", c: \"ab\")\n/// (\"cdedc\", true)\nfunc reverse_delete(s: String, c: String) -> (String, Bool) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(reverse_delete(s: \"abcde\", c: \"ae\") == (\"bcd\", false))\nassert(reverse_delete(s: \"abcdef\", c: \"b\") == (\"acdef\", false))\nassert(reverse_delete(s: \"abcdedcba\", c: \"ab\") == (\"cdedc\", true))\nassert(reverse_delete(s: \"dwik\", c: \"w\") == (\"dik\", false))\nassert(reverse_delete(s: \"a\", c: \"a\") == (\"\", true))\nassert(reverse_delete(s: \"abcdedcba\", c: \"\") == (\"abcdedcba\", true))\nassert(reverse_delete(s: \"abcdedcba\", c: \"v\") == (\"abcdedcba\", true))\nassert(reverse_delete(s: \"vabba\", c: \"v\") == (\"abba\", true))\nassert(reverse_delete(s: \"mamma\", c: \"mia\") == (\"\", true))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "swift", - "prompt": "\n/// For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n/// >>> flip_case(string: \"Hello\")\n/// \"hELLO\"\nfunc flip_case(string: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(flip_case(string: \"\") == \"\")\nassert(flip_case(string: \"Hello!\") == \"hELLO!\")\nassert(flip_case(string: \"These violent delights have violent ends\") == \"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "swift", - "prompt": "\n/// You are given a string s.\n/// if s[i] is a letter, reverse its case from lower to upper or vise versa, \n/// otherwise keep it as it is.\n/// If the string contains no letters, reverse the string.\n/// The function should return the resulted string.\n/// Examples\n/// >>> solve(s: \"1234\")\n/// \"4321\"\n/// >>> solve(s: \"ab\")\n/// \"AB\"\n/// >>> solve(s: \"#a@C\")\n/// \"#A@c\"\nfunc solve(s: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(solve(s: \"AsDf\") == \"aSdF\")\nassert(solve(s: \"1234\") == \"4321\")\nassert(solve(s: \"ab\") == \"AB\")\nassert(solve(s: \"#a@C\") == \"#A@c\")\nassert(solve(s: \"#AsdfW^45\") == \"#aSDFw^45\")\nassert(solve(s: \"#6@2\") == \"2@6#\")\nassert(solve(s: \"#$a^D\") == \"#$A^d\")\nassert(solve(s: \"#ccc\") == \"#CCC\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "swift", - "prompt": "\n/// Filter an input list of strings only for ones that start with a given prefix.\n/// >>> filter_by_prefix(strings: [] as [String], prefix: \"a\")\n/// [] as [String]\n/// >>> filter_by_prefix(strings: [\"abc\", \"bcd\", \"cde\", \"array\"], prefix: \"a\")\n/// [\"abc\", \"array\"]\nfunc filter_by_prefix(strings: [String], prefix: String) -> [String] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(filter_by_prefix(strings: [] as [String], prefix: \"john\") == [] as [String])\nassert(filter_by_prefix(strings: [\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], prefix: \"xxx\") == [\"xxx\", \"xxxAAA\", \"xxx\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "swift", - "prompt": "\n/// This function takes two positive numbers x and y and returns the\n/// biggest even integer number that is in the range [x, y] inclusive. If \n/// there's no such number, then the function should return -1.\n/// For example:\n/// >>> choose_num(x: 12, y: 15)\n/// 14\n/// >>> choose_num(x: 13, y: 12)\n/// -1\nfunc choose_num(x: Int, y: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(choose_num(x: 12, y: 15) == 14)\nassert(choose_num(x: 13, y: 12) == -1)\nassert(choose_num(x: 33, y: 12354) == 12354)\nassert(choose_num(x: 5234, y: 5233) == -1)\nassert(choose_num(x: 6, y: 29) == 28)\nassert(choose_num(x: 27, y: 10) == -1)\nassert(choose_num(x: 7, y: 7) == -1)\nassert(choose_num(x: 546, y: 546) == 546)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "swift", - "prompt": "\n/// You are given a string representing a sentence,\n/// the sentence contains some words separated by a space,\n/// and you have to return a string that contains the words from the original sentence,\n/// whose lengths are prime numbers,\n/// the order of the words in the new string should be the same as the original one.\n/// Example 1:\n/// >>> words_in_sentence(sentence: \"This is a test\")\n/// \"is\"\n/// Example 2:\n/// >>> words_in_sentence(sentence: \"lets go for swimming\")\n/// \"go for\"\n/// Constraints:\n/// * 1 <= len(sentence) <= 100\n/// * sentence contains only letters\nfunc words_in_sentence(sentence: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(words_in_sentence(sentence: \"This is a test\") == \"is\")\nassert(words_in_sentence(sentence: \"lets go for swimming\") == \"go for\")\nassert(words_in_sentence(sentence: \"there is no place available here\") == \"there is no place\")\nassert(words_in_sentence(sentence: \"Hi I am Hussein\") == \"Hi am Hussein\")\nassert(words_in_sentence(sentence: \"go for it\") == \"go for it\")\nassert(words_in_sentence(sentence: \"here\") == \"\")\nassert(words_in_sentence(sentence: \"here is\") == \"is\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "swift", - "prompt": "\n/// Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n/// >>> intersperse(numbers: [] as [Int], delimeter: 4)\n/// [] as [Int]\n/// >>> intersperse(numbers: [1, 2, 3], delimeter: 4)\n/// [1, 4, 2, 4, 3]\nfunc intersperse(numbers: [Int], delimeter: Int) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(intersperse(numbers: [] as [Int], delimeter: 7) == [] as [Int])\nassert(intersperse(numbers: [5, 6, 3, 2], delimeter: 8) == [5, 8, 6, 8, 3, 8, 2])\nassert(intersperse(numbers: [2, 2, 2], delimeter: 2) == [2, 2, 2, 2, 2])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "swift", - "prompt": "\n/// Your task is to write a function that returns true if a number x is a simple\n/// power of n and false in other cases.\n/// x is a simple power of n if n**int=x\n/// For example:\n/// >>> is_simple_power(x: 1, n: 4)\n/// true\n/// >>> is_simple_power(x: 2, n: 2)\n/// true\n/// >>> is_simple_power(x: 8, n: 2)\n/// true\n/// >>> is_simple_power(x: 3, n: 2)\n/// false\n/// >>> is_simple_power(x: 3, n: 1)\n/// false\n/// >>> is_simple_power(x: 5, n: 3)\n/// false\nfunc is_simple_power(x: Int, n: Int) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_simple_power(x: 16, n: 2) == true)\nassert(is_simple_power(x: 143214, n: 16) == false)\nassert(is_simple_power(x: 4, n: 2) == true)\nassert(is_simple_power(x: 9, n: 3) == true)\nassert(is_simple_power(x: 16, n: 4) == true)\nassert(is_simple_power(x: 24, n: 2) == false)\nassert(is_simple_power(x: 128, n: 4) == false)\nassert(is_simple_power(x: 12, n: 6) == false)\nassert(is_simple_power(x: 1, n: 1) == true)\nassert(is_simple_power(x: 1, n: 12) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "swift", - "prompt": "\n/// Write a function that returns true if the given number is the multiplication of 3 prime numbers\n/// and false otherwise.\n/// Knowing that (a) is less then 100. \n/// Example:\n/// >>> is_multiply_prime(a: 30)\n/// true\n/// 30 = 2 * 3 * 5\nfunc is_multiply_prime(a: Int) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_multiply_prime(a: 5) == false)\nassert(is_multiply_prime(a: 30) == true)\nassert(is_multiply_prime(a: 8) == true)\nassert(is_multiply_prime(a: 10) == false)\nassert(is_multiply_prime(a: 125) == true)\nassert(is_multiply_prime(a: 105) == true)\nassert(is_multiply_prime(a: 126) == false)\nassert(is_multiply_prime(a: 729) == false)\nassert(is_multiply_prime(a: 891) == false)\nassert(is_multiply_prime(a: 1001) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "swift", - "prompt": "\n/// Given the lengths of the three sides of a triangle. Return True if the three\n/// sides form a right-angled triangle, False otherwise.\n/// A right-angled triangle is a triangle in which one angle is right angle or \n/// 90 degree.\n/// Example:\n/// >>> right_angle_triangle(a: 3, b: 4, c: 5)\n/// true\n/// >>> right_angle_triangle(a: 1, b: 2, c: 3)\n/// false\nfunc right_angle_triangle(a: Int, b: Int, c: Int) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(right_angle_triangle(a: 3, b: 4, c: 5) == true)\nassert(right_angle_triangle(a: 1, b: 2, c: 3) == false)\nassert(right_angle_triangle(a: 10, b: 6, c: 8) == true)\nassert(right_angle_triangle(a: 2, b: 2, c: 2) == false)\nassert(right_angle_triangle(a: 7, b: 24, c: 25) == true)\nassert(right_angle_triangle(a: 10, b: 5, c: 7) == false)\nassert(right_angle_triangle(a: 5, b: 12, c: 13) == true)\nassert(right_angle_triangle(a: 15, b: 8, c: 17) == true)\nassert(right_angle_triangle(a: 48, b: 55, c: 73) == true)\nassert(right_angle_triangle(a: 1, b: 1, c: 1) == false)\nassert(right_angle_triangle(a: 2, b: 2, c: 10) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "swift", - "prompt": "\n/// Create a function that takes 3 numbers.\n/// Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n/// Returns false in any other cases.\n/// Examples\n/// >>> any_int(x: 5, y: 2, z: 7)\n/// true\n/// >>> any_int(x: 3, y: 2, z: 2)\n/// false\n/// >>> any_int(x: 3, y: -2, z: 1)\n/// true\n/// >>> any_int(x: 3.6, y: -2.2, z: 2)\n/// false\nfunc any_int(x: Double, y: Double, z: Double) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(any_int(x: 2, y: 3, z: 1) == true)\nassert(any_int(x: 2.5, y: 2, z: 3) == false)\nassert(any_int(x: 1.5, y: 5, z: 3.5) == false)\nassert(any_int(x: 2, y: 6, z: 2) == false)\nassert(any_int(x: 4, y: 2, z: 2) == true)\nassert(any_int(x: 2.2, y: 2.2, z: 2.2) == false)\nassert(any_int(x: -4, y: 6, z: 2) == true)\nassert(any_int(x: 2, y: 1, z: 1) == true)\nassert(any_int(x: 3, y: 4, z: 7) == true)\nassert(any_int(x: 3.0, y: 4, z: 7) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "swift", - "prompt": "\n/// This function takes a list l and returns a list l' such that\n/// l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n/// to the values of the corresponding indicies of l, but sorted.\n/// >>> sort_third(l: [1, 2, 3])\n/// [1, 2, 3]\n/// >>> sort_third(l: [5, 6, 3, 4, 8, 9, 2])\n/// [2, 6, 3, 4, 8, 9, 5]\nfunc sort_third(l: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sort_third(l: [5, 6, 3, 4, 8, 9, 2]) == [2, 6, 3, 4, 8, 9, 5])\nassert(sort_third(l: [5, 8, 3, 4, 6, 9, 2]) == [2, 8, 3, 4, 6, 9, 5])\nassert(sort_third(l: [5, 6, 9, 4, 8, 3, 2]) == [2, 6, 9, 4, 8, 3, 5])\nassert(sort_third(l: [5, 6, 3, 4, 8, 9, 2, 1]) == [2, 6, 3, 4, 8, 9, 5, 1])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_53_add", - "language": "swift", - "prompt": "\n/// Add two numbers x and y\n/// >>> add(x: 2, y: 3)\n/// 5\n/// >>> add(x: 5, y: 7)\n/// 12\nfunc add(x: Int, y: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(add(x: 0, y: 1) == 1)\nassert(add(x: 1, y: 0) == 1)\nassert(add(x: 2, y: 3) == 5)\nassert(add(x: 5, y: 7) == 12)\nassert(add(x: 7, y: 5) == 12)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_69_search", - "language": "swift", - "prompt": "\n/// You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n/// zero, and has a frequency greater than or equal to the value of the integer itself. \n/// The frequency of an integer is the number of times it appears in the list.\n/// If no such a value exist, return -1.\n/// Examples:\n/// >>> search(lst: [4, 1, 2, 2, 3, 1])\n/// 2\n/// >>> search(lst: [1, 2, 2, 3, 3, 3, 4, 4, 4])\n/// 3\n/// >>> search(lst: [5, 5, 4, 4, 4])\n/// -1\nfunc search(lst: [Int]) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(search(lst: [5, 5, 5, 5, 1]) == 1)\nassert(search(lst: [4, 1, 4, 1, 4, 4]) == 4)\nassert(search(lst: [3, 3]) == -1)\nassert(search(lst: [8, 8, 8, 8, 8, 8, 8, 8]) == 8)\nassert(search(lst: [2, 3, 3, 2, 2]) == 2)\nassert(search(lst: [2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]) == 1)\nassert(search(lst: [3, 2, 8, 2]) == 2)\nassert(search(lst: [6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]) == 1)\nassert(search(lst: [8, 8, 3, 6, 5, 6, 4]) == -1)\nassert(search(lst: [6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]) == 1)\nassert(search(lst: [1, 9, 10, 1, 3]) == 1)\nassert(search(lst: [6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]) == 5)\nassert(search(lst: [1]) == 1)\nassert(search(lst: [8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]) == 4)\nassert(search(lst: [2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]) == 2)\nassert(search(lst: [1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]) == 1)\nassert(search(lst: [9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]) == 4)\nassert(search(lst: [2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]) == 4)\nassert(search(lst: [9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]) == 2)\nassert(search(lst: [5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]) == -1)\nassert(search(lst: [10]) == -1)\nassert(search(lst: [9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]) == 2)\nassert(search(lst: [5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]) == 1)\nassert(search(lst: [7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]) == 1)\nassert(search(lst: [3, 10, 10, 9, 2]) == -1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "swift", - "prompt": "\n/// Write a function that takes a string and returns True if the string\n/// length is a prime number or False otherwise\n/// Examples\n/// >>> prime_length(string: \"Hello\")\n/// true\n/// >>> prime_length(string: \"abcdcba\")\n/// true\n/// >>> prime_length(string: \"kittens\")\n/// true\n/// >>> prime_length(string: \"orange\")\n/// false\nfunc prime_length(string: String) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(prime_length(string: \"Hello\") == true)\nassert(prime_length(string: \"abcdcba\") == true)\nassert(prime_length(string: \"kittens\") == true)\nassert(prime_length(string: \"orange\") == false)\nassert(prime_length(string: \"wow\") == true)\nassert(prime_length(string: \"world\") == true)\nassert(prime_length(string: \"MadaM\") == true)\nassert(prime_length(string: \"Wow\") == true)\nassert(prime_length(string: \"\") == false)\nassert(prime_length(string: \"HI\") == true)\nassert(prime_length(string: \"go\") == true)\nassert(prime_length(string: \"gogo\") == false)\nassert(prime_length(string: \"aaaaaaaaaaaaaaa\") == false)\nassert(prime_length(string: \"Madam\") == true)\nassert(prime_length(string: \"M\") == false)\nassert(prime_length(string: \"0\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_58_common", - "language": "swift", - "prompt": "\n/// Return sorted unique common elements for two lists.\n/// >>> common(l1: [1, 4, 3, 34, 653, 2, 5], l2: [5, 7, 1, 5, 9, 653, 121])\n/// [1, 5, 653]\n/// >>> common(l1: [5, 3, 2, 8], l2: [3, 2])\n/// [2, 3]\nfunc common(l1: [Int], l2: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(common(l1: [1, 4, 3, 34, 653, 2, 5], l2: [5, 7, 1, 5, 9, 653, 121]) == [1, 5, 653])\nassert(common(l1: [5, 3, 2, 8], l2: [3, 2]) == [2, 3])\nassert(common(l1: [4, 3, 2, 8], l2: [3, 2, 4]) == [2, 3, 4])\nassert(common(l1: [4, 3, 2, 8], l2: [] as [Int]) == [] as [Int])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "swift", - "prompt": "\n/// The Brazilian factorial is defined as:\n/// brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n/// where n > 0\n/// For example:\n/// >>> special_factorial(n: 4)\n/// 288\n/// The function will receive an integer as input and should return the special\n/// factorial of this integer.\nfunc special_factorial(n: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(special_factorial(n: 4) == 288)\nassert(special_factorial(n: 5) == 34560)\nassert(special_factorial(n: 7) == 125411328000)\nassert(special_factorial(n: 1) == 1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "swift", - "prompt": "\n/// In this problem, you will implement a function that takes two lists of numbers,\n/// and determines whether it is possible to perform an exchange of elements\n/// between them to make lst1 a list of only even numbers.\n/// There is no limit on the number of exchanged elements between lst1 and lst2.\n/// If it is possible to exchange elements between the lst1 and lst2 to make\n/// all the elements of lst1 to be even, return \"YES\".\n/// Otherwise, return \"NO\".\n/// For example:\n/// >>> exchange(lst1: [1, 2, 3, 4], lst2: [1, 2, 3, 4])\n/// \"YES\"\n/// >>> exchange(lst1: [1, 2, 3, 4], lst2: [1, 5, 3, 4])\n/// \"NO\"\n/// It is assumed that the input lists will be non-empty.\nfunc exchange(lst1: [Int], lst2: [Int]) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(exchange(lst1: [1, 2, 3, 4], lst2: [1, 2, 3, 4]) == \"YES\")\nassert(exchange(lst1: [1, 2, 3, 4], lst2: [1, 5, 3, 4]) == \"NO\")\nassert(exchange(lst1: [1, 2, 3, 4], lst2: [2, 1, 4, 3]) == \"YES\")\nassert(exchange(lst1: [5, 7, 3], lst2: [2, 6, 4]) == \"YES\")\nassert(exchange(lst1: [5, 7, 3], lst2: [2, 6, 3]) == \"NO\")\nassert(exchange(lst1: [3, 2, 6, 1, 8, 9], lst2: [3, 5, 5, 1, 1, 1]) == \"NO\")\nassert(exchange(lst1: [100, 200], lst2: [200, 200]) == \"YES\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "swift", - "prompt": "\n/// Given a non-empty array of integers arr and an integer k, return\n/// the sum of the elements with at most two digits from the first k elements of arr.\n/// Example:\n/// >>> add_elements(arr: [111, 21, 3, 4000, 5, 6, 7, 8, 9], k: 4)\n/// 24\n/// Constraints:\n/// 1. 1 <= len(arr) <= 100\n/// 2. 1 <= k <= len(arr)\nfunc add_elements(arr: [Int], k: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(add_elements(arr: [1, -2, -3, 41, 57, 76, 87, 88, 99], k: 3) == -4)\nassert(add_elements(arr: [111, 121, 3, 4000, 5, 6], k: 2) == 0)\nassert(add_elements(arr: [11, 21, 3, 90, 5, 6, 7, 8, 9], k: 4) == 125)\nassert(add_elements(arr: [111, 21, 3, 4000, 5, 6, 7, 8, 9], k: 4) == 24)\nassert(add_elements(arr: [1], k: 1) == 1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "swift", - "prompt": "\n/// A simple program which should return the value of x if n is \n/// a prime number and should return the value of y otherwise.\n/// Examples:\n/// >>> x_or_y(n: 7, x: 34, y: 12)\n/// 34\n/// >>> x_or_y(n: 15, x: 8, y: 5)\n/// 5\nfunc x_or_y(n: Int, x: Int, y: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(x_or_y(n: 7, x: 34, y: 12) == 34)\nassert(x_or_y(n: 15, x: 8, y: 5) == 5)\nassert(x_or_y(n: 3, x: 33, y: 5212) == 33)\nassert(x_or_y(n: 1259, x: 3, y: 52) == 3)\nassert(x_or_y(n: 7919, x: -1, y: 12) == -1)\nassert(x_or_y(n: 3609, x: 1245, y: 583) == 583)\nassert(x_or_y(n: 91, x: 56, y: 129) == 129)\nassert(x_or_y(n: 6, x: 34, y: 1234) == 1234)\nassert(x_or_y(n: 1, x: 2, y: 0) == 0)\nassert(x_or_y(n: 2, x: 2, y: 0) == 2)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "swift", - "prompt": "\n/// Given length of a side and high return area for a triangle.\n/// >>> triangle_area(a: 5, h: 3)\n/// 7.5\nfunc triangle_area(a: Int, h: Int) -> Double {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(triangle_area(a: 5, h: 3) == 7.5)\nassert(triangle_area(a: 2, h: 2) == 2.0)\nassert(triangle_area(a: 10, h: 8) == 40.0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "swift", - "prompt": "\n/// Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n/// the last couple centuries. However, what people don't know is Tribonacci sequence.\n/// Tribonacci sequence is defined by the recurrence:\n/// tri(1) = 3\n/// tri(n) = 1 + n / 2, if n is even.\n/// tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n/// For example:\n/// tri(2) = 1 + (2 / 2) = 2\n/// tri(4) = 3\n/// tri(3) = tri(2) + tri(1) + tri(4)\n/// = 2 + 3 + 3 = 8 \n/// You are given a non-negative integer number n, you have to a return a list of the \n/// first n + 1 numbers of the Tribonacci sequence.\n/// Examples:\n/// >>> tri(n: 3)\n/// [1, 3, 2, 8]\nfunc tri(n: Int) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(tri(n: 3) == [1, 3, 2, 8])\nassert(tri(n: 4) == [1, 3, 2, 8, 3])\nassert(tri(n: 5) == [1, 3, 2, 8, 3, 15])\nassert(tri(n: 6) == [1, 3, 2, 8, 3, 15, 4])\nassert(tri(n: 7) == [1, 3, 2, 8, 3, 15, 4, 24])\nassert(tri(n: 8) == [1, 3, 2, 8, 3, 15, 4, 24, 5])\nassert(tri(n: 9) == [1, 3, 2, 8, 3, 15, 4, 24, 5, 35])\nassert(tri(n: 20) == [1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11])\nassert(tri(n: 0) == [1])\nassert(tri(n: 1) == [1, 3])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "swift", - "prompt": "\n/// You are given a list of two strings, both strings consist of open\n/// parentheses '(' or close parentheses ')' only.\n/// Your job is to check if it is possible to concatenate the two strings in\n/// some order, that the resulting string will be good.\n/// A string S is considered to be good if and only if all parentheses in S\n/// are balanced. For example: the string '(())()' is good, while the string\n/// '())' is not.\n/// Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n/// Examples:\n/// >>> match_parens(lst: [\"()(\", \")\"])\n/// \"Yes\"\n/// >>> match_parens(lst: [\")\", \")\"])\n/// \"No\"\nfunc match_parens(lst: [String]) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(match_parens(lst: [\"()(\", \")\"]) == \"Yes\")\nassert(match_parens(lst: [\")\", \")\"]) == \"No\")\nassert(match_parens(lst: [\"(()(())\", \"())())\"]) == \"No\")\nassert(match_parens(lst: [\")())\", \"(()()(\"]) == \"Yes\")\nassert(match_parens(lst: [\"(())))\", \"(()())((\"]) == \"Yes\")\nassert(match_parens(lst: [\"()\", \"())\"]) == \"No\")\nassert(match_parens(lst: [\"(()(\", \"()))()\"]) == \"Yes\")\nassert(match_parens(lst: [\"((((\", \"((())\"]) == \"No\")\nassert(match_parens(lst: [\")(()\", \"(()(\"]) == \"No\")\nassert(match_parens(lst: [\")(\", \")(\"]) == \"No\")\nassert(match_parens(lst: [\"(\", \")\"]) == \"Yes\")\nassert(match_parens(lst: [\")\", \"(\"]) == \"Yes\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "swift", - "prompt": "\n/// From a list of integers, remove all elements that occur more than once.\n/// Keep order of elements left the same as in the input.\n/// >>> remove_duplicates(numbers: [1, 2, 3, 2, 4])\n/// [1, 3, 4]\nfunc remove_duplicates(numbers: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(remove_duplicates(numbers: [] as [Int]) == [] as [Int])\nassert(remove_duplicates(numbers: [1, 2, 3, 4]) == [1, 2, 3, 4])\nassert(remove_duplicates(numbers: [1, 2, 3, 2, 4, 3, 5]) == [1, 4, 5])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "swift", - "prompt": "\n/// Return a greatest common divisor of two integers a and b\n/// >>> greatest_common_divisor(a: 3, b: 5)\n/// 1\n/// >>> greatest_common_divisor(a: 25, b: 15)\n/// 5\nfunc greatest_common_divisor(a: Int, b: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(greatest_common_divisor(a: 3, b: 7) == 1)\nassert(greatest_common_divisor(a: 10, b: 15) == 5)\nassert(greatest_common_divisor(a: 49, b: 14) == 7)\nassert(greatest_common_divisor(a: 144, b: 60) == 12)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "swift", - "prompt": "\n/// Checks if given string is a palindrome\n/// >>> is_palindrome(text: \"\")\n/// true\n/// >>> is_palindrome(text: \"aba\")\n/// true\n/// >>> is_palindrome(text: \"aaaaa\")\n/// true\n/// >>> is_palindrome(text: \"zbcd\")\n/// false\nfunc is_palindrome(text: String) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_palindrome(text: \"\") == true)\nassert(is_palindrome(text: \"aba\") == true)\nassert(is_palindrome(text: \"aaaaa\") == true)\nassert(is_palindrome(text: \"zbcd\") == false)\nassert(is_palindrome(text: \"xywyx\") == true)\nassert(is_palindrome(text: \"xywyz\") == false)\nassert(is_palindrome(text: \"xywzx\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "swift", - "prompt": "\n/// xs represent coefficients of a polynomial.\n/// xs[0] + xs[1] * x + xs[2] * x^2 + ....\n/// Return derivative of this polynomial in the same form.\n/// >>> derivative(xs: [3, 1, 2, 4, 5])\n/// [1, 4, 12, 20]\n/// >>> derivative(xs: [1, 2, 3])\n/// [2, 6]\nfunc derivative(xs: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(derivative(xs: [3, 1, 2, 4, 5]) == [1, 4, 12, 20])\nassert(derivative(xs: [1, 2, 3]) == [2, 6])\nassert(derivative(xs: [3, 2, 1]) == [2, 2])\nassert(derivative(xs: [3, 2, 1, 0, 4]) == [2, 2, 0, 16])\nassert(derivative(xs: [1]) == [] as [Int])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "swift", - "prompt": "\n/// In this task, you will be given a string that represents a number of apples and oranges \n/// that are distributed in a basket of fruit this basket contains \n/// apples, oranges, and mango fruits. Given the string that represents the total number of \n/// the oranges and apples and an integer that represent the total number of the fruits \n/// in the basket return the number of the mango fruits in the basket.\n/// for examble:\n/// >>> fruit_distribution(s: \"5 apples and 6 oranges\", n: 19)\n/// 8\n/// >>> fruit_distribution(s: \"0 apples and 1 oranges\", n: 3)\n/// 2\n/// >>> fruit_distribution(s: \"2 apples and 3 oranges\", n: 100)\n/// 95\n/// >>> fruit_distribution(s: \"100 apples and 1 oranges\", n: 120)\n/// 19\nfunc fruit_distribution(s: String, n: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(fruit_distribution(s: \"5 apples and 6 oranges\", n: 19) == 8)\nassert(fruit_distribution(s: \"5 apples and 6 oranges\", n: 21) == 10)\nassert(fruit_distribution(s: \"0 apples and 1 oranges\", n: 3) == 2)\nassert(fruit_distribution(s: \"1 apples and 0 oranges\", n: 3) == 2)\nassert(fruit_distribution(s: \"2 apples and 3 oranges\", n: 100) == 95)\nassert(fruit_distribution(s: \"2 apples and 3 oranges\", n: 5) == 0)\nassert(fruit_distribution(s: \"1 apples and 100 oranges\", n: 120) == 19)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "swift", - "prompt": "\n/// Write a function that takes an integer a and returns True \n/// if this ingeger is a cube of some integer number.\n/// Note: you may assume the input is always valid.\n/// Examples:\n/// >>> iscube(a: 1)\n/// true\n/// >>> iscube(a: 2)\n/// false\n/// >>> iscube(a: -1)\n/// true\n/// >>> iscube(a: 64)\n/// true\n/// >>> iscube(a: 0)\n/// true\n/// >>> iscube(a: 180)\n/// false\nfunc iscube(a: Int) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(iscube(a: 1) == true)\nassert(iscube(a: 2) == false)\nassert(iscube(a: -1) == true)\nassert(iscube(a: 64) == true)\nassert(iscube(a: 180) == false)\nassert(iscube(a: 1000) == true)\nassert(iscube(a: 0) == true)\nassert(iscube(a: 1729) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "swift", - "prompt": "\n/// In this Kata, you have to sort an array of non-negative integers according to\n/// number of ones in their binary representation in ascending order.\n/// For similar number of ones, sort based on decimal value.\n/// It must be implemented like this:\n/// >>> sort_array(arr: [1, 5, 2, 3, 4])\n/// [1, 2, 3, 4, 5]\n/// >>> sort_array(arr: [-2, -3, -4, -5, -6])\n/// [-6, -5, -4, -3, -2]\n/// >>> sort_array(arr: [1, 0, 2, 3, 4])\n/// [0, 1, 2, 3, 4]\nfunc sort_array(arr: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sort_array(arr: [1, 5, 2, 3, 4]) == [1, 2, 4, 3, 5])\nassert(sort_array(arr: [-2, -3, -4, -5, -6]) == [-4, -2, -6, -5, -3])\nassert(sort_array(arr: [1, 0, 2, 3, 4]) == [0, 1, 2, 4, 3])\nassert(sort_array(arr: [] as [Int]) == [] as [Int])\nassert(sort_array(arr: [2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]) == [2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77])\nassert(sort_array(arr: [3, 6, 44, 12, 32, 5]) == [32, 3, 5, 6, 12, 44])\nassert(sort_array(arr: [2, 4, 8, 16, 32]) == [2, 4, 8, 16, 32])\nassert(sort_array(arr: [2, 4, 8, 16, 32]) == [2, 4, 8, 16, 32])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "swift", - "prompt": "\n/// Given a list of strings, where each string consists of only digits, return a list.\n/// Each element i of the output should be \"the number of odd elements in the\n/// string i of the input.\" where all the i's should be replaced by the number\n/// of odd digits in the i'th string of the input.\n/// >>> odd_count(lst: [\"1234567\"])\n/// [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n/// >>> odd_count(lst: [\"3\", \"11111111\"])\n/// [\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\nfunc odd_count(lst: [String]) -> [String] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(odd_count(lst: [\"1234567\"]) == [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"])\nassert(odd_count(lst: [\"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.\"])\nassert(odd_count(lst: [\"271\", \"137\", \"314\"]) == [\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "swift", - "prompt": "\n/// brackets is a string of \"(\" and \")\".\n/// return True if every opening bracket has a corresponding closing bracket.\n/// >>> correct_bracketing(brackets: \"(\")\n/// false\n/// >>> correct_bracketing(brackets: \"()\")\n/// true\n/// >>> correct_bracketing(brackets: \"(()())\")\n/// true\n/// >>> correct_bracketing(brackets: \")(()\")\n/// false\nfunc correct_bracketing(brackets: String) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(correct_bracketing(brackets: \"()\") == true)\nassert(correct_bracketing(brackets: \"(()())\") == true)\nassert(correct_bracketing(brackets: \"()()(()())()\") == true)\nassert(correct_bracketing(brackets: \"()()((()()())())(()()(()))\") == true)\nassert(correct_bracketing(brackets: \"((()())))\") == false)\nassert(correct_bracketing(brackets: \")(()\") == false)\nassert(correct_bracketing(brackets: \"(\") == false)\nassert(correct_bracketing(brackets: \"((((\") == false)\nassert(correct_bracketing(brackets: \")\") == false)\nassert(correct_bracketing(brackets: \"(()\") == false)\nassert(correct_bracketing(brackets: \"()()(()())())(()\") == false)\nassert(correct_bracketing(brackets: \"()()(()())()))()\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "swift", - "prompt": "\n/// Task\n/// Write a function that takes a string as input and returns the sum of the upper characters only'\n/// ASCII codes.\n/// Examples:\n/// >>> digitSum(s: \"\")\n/// 0\n/// >>> digitSum(s: \"abAB\")\n/// 131\n/// >>> digitSum(s: \"abcCd\")\n/// 67\n/// >>> digitSum(s: \"helloE\")\n/// 69\n/// >>> digitSum(s: \"woArBld\")\n/// 131\n/// >>> digitSum(s: \"aAaaaXa\")\n/// 153\nfunc digitSum(s: String) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(digitSum(s: \"\") == 0)\nassert(digitSum(s: \"abAB\") == 131)\nassert(digitSum(s: \"abcCd\") == 67)\nassert(digitSum(s: \"helloE\") == 69)\nassert(digitSum(s: \"woArBld\") == 131)\nassert(digitSum(s: \"aAaaaXa\") == 153)\nassert(digitSum(s: \" How are yOu?\") == 151)\nassert(digitSum(s: \"You arE Very Smart\") == 327)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "swift", - "prompt": "\n/// Write a function that accepts a list of strings as a parameter,\n/// deletes the strings that have odd lengths from it,\n/// and returns the resulted list with a sorted order,\n/// The list is always a list of strings and never an array of numbers,\n/// and it may contain duplicates.\n/// The order of the list should be ascending by length of each word, and you\n/// should return the list sorted by that rule.\n/// If two words have the same length, sort the list alphabetically.\n/// The function should return a list of strings in sorted order.\n/// You may assume that all words will have the same length.\n/// For example:\n/// >>> sorted_list_sum(lst: [\"aa\", \"a\", \"aaa\"])\n/// [\"aa\"]\n/// >>> sorted_list_sum(lst: [\"ab\", \"a\", \"aaa\", \"cd\"])\n/// [\"ab\", \"cd\"]\nfunc sorted_list_sum(lst: [String]) -> [String] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sorted_list_sum(lst: [\"aa\", \"a\", \"aaa\"]) == [\"aa\"])\nassert(sorted_list_sum(lst: [\"school\", \"AI\", \"asdf\", \"b\"]) == [\"AI\", \"asdf\", \"school\"])\nassert(sorted_list_sum(lst: [\"d\", \"b\", \"c\", \"a\"]) == [] as [String])\nassert(sorted_list_sum(lst: [\"d\", \"dcba\", \"abcd\", \"a\"]) == [\"abcd\", \"dcba\"])\nassert(sorted_list_sum(lst: [\"AI\", \"ai\", \"au\"]) == [\"AI\", \"ai\", \"au\"])\nassert(sorted_list_sum(lst: [\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"]) == [] as [String])\nassert(sorted_list_sum(lst: [\"aaaa\", \"bbbb\", \"dd\", \"cc\"]) == [\"cc\", \"dd\", \"aaaa\", \"bbbb\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "swift", - "prompt": "\n/// You are given an array arr of integers and you need to return\n/// sum of magnitudes of integers multiplied by product of all signs\n/// of each number in the array, represented by 1, -1 or 0.\n/// Note: return None for empty arr.\n/// Example:\n/// >>> prod_signs(arr: [1, 2, 2, -4])\n/// 9\n/// >>> prod_signs(arr: [0, 1])\n/// 0\n/// >>> prod_signs(arr: [] as [Int])\n/// nil\nfunc prod_signs(arr: [Int]) -> Int? {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(prod_signs(arr: [1, 2, 2, -4]) == -9)\nassert(prod_signs(arr: [0, 1]) == 0)\nassert(prod_signs(arr: [1, 1, 1, 2, 3, -1, 1]) == -10)\nassert(prod_signs(arr: [] as [Int]) == nil)\nassert(prod_signs(arr: [2, 4, 1, 2, -1, -1, 9]) == 20)\nassert(prod_signs(arr: [-1, 1, -1, 1]) == 4)\nassert(prod_signs(arr: [-1, 1, 1, 1]) == -4)\nassert(prod_signs(arr: [-1, 1, 1, 0]) == 0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "swift", - "prompt": "\n/// Return list with elements incremented by 1.\n/// >>> incr_list(l: [1, 2, 3])\n/// [2, 3, 4]\n/// >>> incr_list(l: [5, 3, 5, 2, 3, 3, 9, 0, 123])\n/// [6, 4, 6, 3, 4, 4, 10, 1, 124]\nfunc incr_list(l: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(incr_list(l: [] as [Int]) == [] as [Int])\nassert(incr_list(l: [3, 2, 1]) == [4, 3, 2])\nassert(incr_list(l: [5, 2, 5, 2, 3, 3, 9, 0, 123]) == [6, 3, 6, 3, 4, 4, 10, 1, 124])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "swift", - "prompt": "\n/// From a given list of integers, generate a list of rolling maximum element found until given moment\n/// in the sequence.\n/// >>> rolling_max(numbers: [1, 2, 3, 2, 3, 4, 2])\n/// [1, 2, 3, 3, 3, 4, 4]\nfunc rolling_max(numbers: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(rolling_max(numbers: [] as [Int]) == [] as [Int])\nassert(rolling_max(numbers: [1, 2, 3, 4]) == [1, 2, 3, 4])\nassert(rolling_max(numbers: [4, 3, 2, 1]) == [4, 4, 4, 4])\nassert(rolling_max(numbers: [3, 2, 3, 100, 3]) == [3, 3, 3, 100, 100])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "swift", - "prompt": "\n/// Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n/// separate those group into separate strings and return the list of those.\n/// Separate groups are balanced (each open brace is properly closed) and not nested within each other\n/// Ignore any spaces in the input string.\n/// >>> separate_paren_groups(paren_string: \"( ) (( )) (( )( ))\")\n/// [\"()\", \"(())\", \"(()())\"]\nfunc separate_paren_groups(paren_string: String) -> [String] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(separate_paren_groups(paren_string: \"(()()) ((())) () ((())()())\") == [\"(()())\", \"((()))\", \"()\", \"((())()())\"])\nassert(separate_paren_groups(paren_string: \"() (()) ((())) (((())))\") == [\"()\", \"(())\", \"((()))\", \"(((())))\"])\nassert(separate_paren_groups(paren_string: \"(()(())((())))\") == [\"(()(())((())))\"])\nassert(separate_paren_groups(paren_string: \"( ) (( )) (( )( ))\") == [\"()\", \"(())\", \"(()())\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "swift", - "prompt": "\n/// You will be given a string of words separated by commas or spaces. Your task is\n/// to split the string into words and return an array of the words.\n/// For example:\n/// >>> words_string(s: \"Hi, my name is John\")\n/// [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n/// >>> words_string(s: \"One, two, three, four, five, six\")\n/// [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\nfunc words_string(s: String) -> [String] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(words_string(s: \"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"])\nassert(words_string(s: \"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"])\nassert(words_string(s: \"Hi, my name\") == [\"Hi\", \"my\", \"name\"])\nassert(words_string(s: \"One,, two, three, four, five, six,\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"])\nassert(words_string(s: \"\") == [] as [String])\nassert(words_string(s: \"ahmed , gamal\") == [\"ahmed\", \"gamal\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_137_compare_one", - "language": "swift", - "prompt": "\nenum Value: Equatable, Hashable {\n case intValue(Int)\n case doubleValue(Double)\n case stringValue(String)\n}\n\n \n/// Create a function that takes integers, floats, or strings representing\n/// real numbers, and returns the larger variable in its given variable type.\n/// Return None if the values are equal.\n/// Note: If a real number is represented as a string, the floating point might be . or ,\n/// >>> compare_one(a: .intValue(1), b: .doubleValue(2.5))\n/// .doubleValue(2.5)\n/// >>> compare_one(a: .intValue(1), b: .stringValue(\"2,3\"))\n/// .stringValue(\"2,3\")\n/// >>> compare_one(a: .stringValue(\"5,1\"), b: .stringValue(\"6\"))\n/// .stringValue(\"6\")\n/// >>> compare_one(a: .stringValue(\"1\"), b: .intValue(1))\n/// nil\nfunc compare_one(a: Value, b: Value) -> Value? {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(compare_one(a: .intValue(1), b: .intValue(2)) == .intValue(2))\nassert(compare_one(a: .intValue(1), b: .doubleValue(2.5)) == .doubleValue(2.5))\nassert(compare_one(a: .intValue(2), b: .intValue(3)) == .intValue(3))\nassert(compare_one(a: .intValue(5), b: .intValue(6)) == .intValue(6))\nassert(compare_one(a: .intValue(1), b: .stringValue(\"2,3\")) == .stringValue(\"2,3\"))\nassert(compare_one(a: .stringValue(\"5,1\"), b: .stringValue(\"6\")) == .stringValue(\"6\"))\nassert(compare_one(a: .stringValue(\"1\"), b: .stringValue(\"2\")) == .stringValue(\"2\"))\nassert(compare_one(a: .stringValue(\"1\"), b: .intValue(1)) == nil)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "swift", - "prompt": "\n/// Filter given list of any python values only for integers\n/// >>> filter_integers(values: [\"a\", 3.14, 5])\n/// [5]\n/// >>> filter_integers(values: [1, 2, 3, \"abc\", [:] as [AnyHashable : AnyHashable], [] as [AnyHashable]])\n/// [1, 2, 3]\nfunc filter_integers(values: [AnyHashable]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(filter_integers(values: [] as [AnyHashable]) == [] as [Int])\nassert(filter_integers(values: [4, [:] as [AnyHashable : AnyHashable], [] as [AnyHashable], 23.2, 9, \"adasd\"]) == [4, 9])\nassert(filter_integers(values: [3, \"c\", 3, 3, \"a\", \"b\"]) == [3, 3, 3])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "swift", - "prompt": "\n/// This function takes a list l and returns a list l' such that\n/// l' is identical to l in the odd indicies, while its values at the even indicies are equal\n/// to the values of the even indicies of l, but sorted.\n/// >>> sort_even(l: [1, 2, 3])\n/// [1, 2, 3]\n/// >>> sort_even(l: [5, 6, 3, 4])\n/// [3, 6, 5, 4]\nfunc sort_even(l: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sort_even(l: [1, 2, 3]) == [1, 2, 3])\nassert(sort_even(l: [5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]) == [-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123])\nassert(sort_even(l: [5, 8, -12, 4, 23, 2, 3, 11, 12, -10]) == [-12, 8, 3, 4, 5, 2, 12, 11, 23, -10])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "swift", - "prompt": "\n/// I think we all remember that feeling when the result of some long-awaited\n/// event is finally known. The feelings and thoughts you have at that moment are\n/// definitely worth noting down and comparing.\n/// Your task is to determine if a person correctly guessed the results of a number of matches.\n/// You are given two arrays of scores and guesses of equal length, where each index shows a match. \n/// Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n/// the value is 0, and if not, the value is the absolute difference between the guess and the score.\n/// example:\n/// >>> compare(game: [1, 2, 3, 4, 5, 1], guess: [1, 2, 3, 4, 2, -2])\n/// [0, 0, 0, 0, 3, 3]\n/// >>> compare(game: [0, 5, 0, 0, 0, 4], guess: [4, 1, 1, 0, 0, -2])\n/// [4, 4, 1, 0, 0, 6]\nfunc compare(game: [Int], guess: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(compare(game: [1, 2, 3, 4, 5, 1], guess: [1, 2, 3, 4, 2, -2]) == [0, 0, 0, 0, 3, 3])\nassert(compare(game: [0, 0, 0, 0, 0, 0], guess: [0, 0, 0, 0, 0, 0]) == [0, 0, 0, 0, 0, 0])\nassert(compare(game: [1, 2, 3], guess: [-1, -2, -3]) == [2, 4, 6])\nassert(compare(game: [1, 2, 3, 5], guess: [-1, 2, 3, 4]) == [2, 0, 0, 1])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "swift", - "prompt": "\n/// Given a positive integer n, return a tuple that has the number of even and odd\n/// integer palindromes that fall within the range(1, n), inclusive.\n/// Example 1:\n/// >>> even_odd_palindrome(n: 3)\n/// (1, 2)\n/// Explanation:\n/// Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n/// Example 2:\n/// >>> even_odd_palindrome(n: 12)\n/// (4, 6)\n/// Explanation:\n/// Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n/// Note:\n/// 1. 1 <= n <= 10^3\n/// 2. returned tuple has the number of even and odd integer palindromes respectively.\nfunc even_odd_palindrome(n: Int) -> (Int, Int) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(even_odd_palindrome(n: 123) == (8, 13))\nassert(even_odd_palindrome(n: 12) == (4, 6))\nassert(even_odd_palindrome(n: 3) == (1, 2))\nassert(even_odd_palindrome(n: 63) == (6, 8))\nassert(even_odd_palindrome(n: 25) == (5, 6))\nassert(even_odd_palindrome(n: 19) == (4, 6))\nassert(even_odd_palindrome(n: 9) == (4, 5))\nassert(even_odd_palindrome(n: 1) == (0, 1))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "swift", - "prompt": "\n/// The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n/// fib4(0) -> 0\n/// fib4(1) -> 0\n/// fib4(2) -> 2\n/// fib4(3) -> 0\n/// fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n/// Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n/// >>> fib4(n: 5)\n/// 4\n/// >>> fib4(n: 6)\n/// 8\n/// >>> fib4(n: 7)\n/// 14\nfunc fib4(n: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(fib4(n: 5) == 4)\nassert(fib4(n: 8) == 28)\nassert(fib4(n: 10) == 104)\nassert(fib4(n: 12) == 386)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "swift", - "prompt": "\n/// Given two positive integers a and b, return the even digits between a\n/// and b, in ascending order.\n/// For example:\n/// >>> generate_integers(a: 2, b: 8)\n/// [2, 4, 6, 8]\n/// >>> generate_integers(a: 8, b: 2)\n/// [2, 4, 6, 8]\n/// >>> generate_integers(a: 10, b: 14)\n/// [] as [Int]\nfunc generate_integers(a: Int, b: Int) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(generate_integers(a: 2, b: 10) == [2, 4, 6, 8])\nassert(generate_integers(a: 10, b: 2) == [2, 4, 6, 8])\nassert(generate_integers(a: 132, b: 2) == [2, 4, 6, 8])\nassert(generate_integers(a: 17, b: 89) == [] as [Int])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "swift", - "prompt": "\n/// For a given list of input numbers, calculate Mean Absolute Deviation\n/// around the mean of this dataset.\n/// Mean Absolute Deviation is the average absolute difference between each\n/// element and a centerpoint (mean in this case):\n/// MAD = average | x - x_mean |\n/// >>> mean_absolute_deviation(numbers: [1.0, 2.0, 3.0, 4.0])\n/// 1.0\nfunc mean_absolute_deviation(numbers: [Double]) -> Double {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(mean_absolute_deviation(numbers: [1.0, 2.0]) == 0.5)\nassert(mean_absolute_deviation(numbers: [1.0, 2.0, 3.0, 4.0]) == 1.0)\nassert(mean_absolute_deviation(numbers: [1.0, 2.0, 3.0, 4.0, 5.0]) == 1.2)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "swift", - "prompt": "\n/// Create a function encrypt that takes a string as an argument and\n/// returns a string encrypted with the alphabet being rotated. \n/// The alphabet should be rotated in a manner such that the letters \n/// shift down by two multiplied to two places.\n/// For example:\n/// >>> encrypt(s: \"hi\")\n/// \"lm\"\n/// >>> encrypt(s: \"asdfghjkl\")\n/// \"ewhjklnop\"\n/// >>> encrypt(s: \"gf\")\n/// \"kj\"\n/// >>> encrypt(s: \"et\")\n/// \"ix\"\nfunc encrypt(s: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(encrypt(s: \"hi\") == \"lm\")\nassert(encrypt(s: \"asdfghjkl\") == \"ewhjklnop\")\nassert(encrypt(s: \"gf\") == \"kj\")\nassert(encrypt(s: \"et\") == \"ix\")\nassert(encrypt(s: \"faewfawefaewg\") == \"jeiajeaijeiak\")\nassert(encrypt(s: \"hellomyfriend\") == \"lippsqcjvmirh\")\nassert(encrypt(s: \"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\") == \"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\")\nassert(encrypt(s: \"a\") == \"e\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "swift", - "prompt": "\n/// Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n/// The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n/// as follows: start with any positive integer n. Then each term is obtained from the \n/// previous term as follows: if the previous term is even, the next term is one half of \n/// the previous term. If the previous term is odd, the next term is 3 times the previous\n/// term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n/// Note: \n/// 1. Collatz(1) is [1].\n/// 2. returned list sorted in increasing order.\n/// For example:\n/// get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n/// >>> get_odd_collatz(n: 5)\n/// [1, 5]\nfunc get_odd_collatz(n: Int) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(get_odd_collatz(n: 14) == [1, 5, 7, 11, 13, 17])\nassert(get_odd_collatz(n: 5) == [1, 5])\nassert(get_odd_collatz(n: 12) == [1, 3, 5])\nassert(get_odd_collatz(n: 1) == [1])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "swift", - "prompt": "\n/// Find how many times a given substring can be found in the original string. Count overlaping cases.\n/// >>> how_many_times(string: \"\", substring: \"a\")\n/// 0\n/// >>> how_many_times(string: \"aaa\", substring: \"a\")\n/// 3\n/// >>> how_many_times(string: \"aaaa\", substring: \"aa\")\n/// 3\nfunc how_many_times(string: String, substring: String) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(how_many_times(string: \"\", substring: \"x\") == 0)\nassert(how_many_times(string: \"xyxyxyx\", substring: \"x\") == 4)\nassert(how_many_times(string: \"cacacacac\", substring: \"cac\") == 4)\nassert(how_many_times(string: \"john doe\", substring: \"john\") == 1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "swift", - "prompt": "\n/// We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n/// numbers in the array will be randomly ordered. Your task is to determine if\n/// it is possible to get an array sorted in non-decreasing order by performing \n/// the following operation on the given array:\n/// You are allowed to perform right shift operation any number of times.\n/// One right shift operation means shifting all elements of the array by one\n/// position in the right direction. The last element of the array will be moved to\n/// the starting position in the array i.e. 0th index. \n/// If it is possible to obtain the sorted array by performing the above operation\n/// then return True else return False.\n/// If the given array is empty then return True.\n/// Note: The given list is guaranteed to have unique elements.\n/// For Example:\n/// >>> move_one_ball(arr: [3, 4, 5, 1, 2])\n/// true\n/// Explanation: By performin 2 right shift operations, non-decreasing order can\n/// be achieved for the given array.\n/// >>> move_one_ball(arr: [3, 5, 4, 1, 2])\n/// false\n/// Explanation:It is not possible to get non-decreasing order for the given\n/// array by performing any number of right shift operations.\nfunc move_one_ball(arr: [Int]) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(move_one_ball(arr: [3, 4, 5, 1, 2]) == true)\nassert(move_one_ball(arr: [3, 5, 10, 1, 2]) == true)\nassert(move_one_ball(arr: [4, 3, 1, 2]) == false)\nassert(move_one_ball(arr: [3, 5, 4, 1, 2]) == false)\nassert(move_one_ball(arr: [] as [Int]) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "swift", - "prompt": "\n/// Write a function which sorts the given list of integers\n/// in ascending order according to the sum of their digits.\n/// Note: if there are several items with similar sum of their digits,\n/// order them based on their index in original list.\n/// For example:\n/// >>> order_by_points(nums: [1, 11, -1, -11, -12])\n/// [-1, -11, 1, -12, 11]\n/// >>> order_by_points(nums: [] as [Int])\n/// [] as [Int]\nfunc order_by_points(nums: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(order_by_points(nums: [1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11])\nassert(order_by_points(nums: [1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]) == [0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457])\nassert(order_by_points(nums: [] as [Int]) == [] as [Int])\nassert(order_by_points(nums: [1, -11, -32, 43, 54, -98, 2, -3]) == [-3, -32, -98, -11, 1, 2, 43, 54])\nassert(order_by_points(nums: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) == [1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9])\nassert(order_by_points(nums: [0, 6, 6, -76, -21, 23, 4]) == [-76, -21, 0, 4, 23, 6, 6])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "swift", - "prompt": "\n/// Return list of prime factors of given integer in the order from smallest to largest.\n/// Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n/// Input number should be equal to the product of all factors\n/// >>> factorize(n: 8)\n/// [2, 2, 2]\n/// >>> factorize(n: 25)\n/// [5, 5]\n/// >>> factorize(n: 70)\n/// [2, 5, 7]\nfunc factorize(n: Int) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(factorize(n: 2) == [2])\nassert(factorize(n: 4) == [2, 2])\nassert(factorize(n: 8) == [2, 2, 2])\nassert(factorize(n: 57) == [3, 19])\nassert(factorize(n: 3249) == [3, 3, 19, 19])\nassert(factorize(n: 185193) == [3, 3, 3, 19, 19, 19])\nassert(factorize(n: 20577) == [3, 19, 19, 19])\nassert(factorize(n: 18) == [2, 3, 3])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "swift", - "prompt": "\n/// Return True if all numbers in the list l are below threshold t.\n/// >>> below_threshold(l: [1, 2, 4, 10], t: 100)\n/// true\n/// >>> below_threshold(l: [1, 20, 4, 10], t: 5)\n/// false\nfunc below_threshold(l: [Int], t: Int) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(below_threshold(l: [1, 2, 4, 10], t: 100) == true)\nassert(below_threshold(l: [1, 20, 4, 10], t: 5) == false)\nassert(below_threshold(l: [1, 20, 4, 10], t: 21) == true)\nassert(below_threshold(l: [1, 20, 4, 10], t: 22) == true)\nassert(below_threshold(l: [1, 8, 4, 10], t: 11) == true)\nassert(below_threshold(l: [1, 8, 4, 10], t: 10) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "swift", - "prompt": "\nextension Int: Error {}\n \n/// You are given two positive integers n and m, and your task is to compute the\n/// average of the integers from n through m (including n and m). \n/// Round the answer to the nearest integer and convert that to binary.\n/// If n is greater than m, return -1.\n/// Example:\n/// >>> rounded_avg(n: 1, m: 5)\n/// .success(\"0b11\")\n/// >>> rounded_avg(n: 7, m: 5)\n/// .failure(-1)\n/// >>> rounded_avg(n: 10, m: 20)\n/// .success(\"0b1111\")\n/// >>> rounded_avg(n: 20, m: 33)\n/// .success(\"0b11010\")\nfunc rounded_avg(n: Int, m: Int) -> Result {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(rounded_avg(n: 1, m: 5) == .success(\"0b11\"))\nassert(rounded_avg(n: 7, m: 13) == .success(\"0b1010\"))\nassert(rounded_avg(n: 964, m: 977) == .success(\"0b1111001010\"))\nassert(rounded_avg(n: 996, m: 997) == .success(\"0b1111100100\"))\nassert(rounded_avg(n: 560, m: 851) == .success(\"0b1011000010\"))\nassert(rounded_avg(n: 185, m: 546) == .success(\"0b101101110\"))\nassert(rounded_avg(n: 362, m: 496) == .success(\"0b110101101\"))\nassert(rounded_avg(n: 350, m: 902) == .success(\"0b1001110010\"))\nassert(rounded_avg(n: 197, m: 233) == .success(\"0b11010111\"))\nassert(rounded_avg(n: 7, m: 5) == .failure(-1))\nassert(rounded_avg(n: 5, m: 1) == .failure(-1))\nassert(rounded_avg(n: 5, m: 5) == .success(\"0b101\"))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "swift", - "prompt": "\n/// Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n/// For each of the group, output the deepest level of nesting of parentheses.\n/// E.g. (()()) has maximum two levels of nesting while ((())) has three.\n/// >>> parse_nested_parens(paren_string: \"(()()) ((())) () ((())()())\")\n/// [2, 3, 1, 3]\nfunc parse_nested_parens(paren_string: String) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(parse_nested_parens(paren_string: \"(()()) ((())) () ((())()())\") == [2, 3, 1, 3])\nassert(parse_nested_parens(paren_string: \"() (()) ((())) (((())))\") == [1, 2, 3, 4])\nassert(parse_nested_parens(paren_string: \"(()(())((())))\") == [4])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "swift", - "prompt": "\n/// Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n/// Examples\n/// >>> solution(lst: [5, 8, 7, 1])\n/// 12\n/// >>> solution(lst: [3, 3, 3, 3, 3])\n/// 9\n/// >>> solution(lst: [30, 13, 24, 321])\n/// 0\nfunc solution(lst: [Int]) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(solution(lst: [5, 8, 7, 1]) == 12)\nassert(solution(lst: [3, 3, 3, 3, 3]) == 9)\nassert(solution(lst: [30, 13, 24, 321]) == 0)\nassert(solution(lst: [5, 9]) == 5)\nassert(solution(lst: [2, 4, 8]) == 0)\nassert(solution(lst: [30, 13, 23, 32]) == 23)\nassert(solution(lst: [3, 13, 2, 9]) == 3)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "swift", - "prompt": "\n/// You are given a positive integer n. You have to create an integer array a of length n.\n/// For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n/// Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n/// and a[i] + a[j] + a[k] is a multiple of 3.\n/// Example :\n/// >>> get_max_triples(n: 5)\n/// 1\n/// Explanation: \n/// a = [1, 3, 7, 13, 21]\n/// The only valid triple is (1, 7, 13).\nfunc get_max_triples(n: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(get_max_triples(n: 5) == 1)\nassert(get_max_triples(n: 6) == 4)\nassert(get_max_triples(n: 10) == 36)\nassert(get_max_triples(n: 100) == 53361)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "swift", - "prompt": "\n/// You are given a list of integers.\n/// Write a function next_smallest() that returns the 2nd smallest element of the list.\n/// Return None if there is no such element.\n/// >>> next_smallest(lst: [1, 2, 3, 4, 5])\n/// 2\n/// >>> next_smallest(lst: [5, 1, 4, 3, 2])\n/// 2\n/// >>> next_smallest(lst: [] as [Int])\n/// nil\n/// >>> next_smallest(lst: [1, 1])\n/// nil\nfunc next_smallest(lst: [Int]) -> Int? {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(next_smallest(lst: [1, 2, 3, 4, 5]) == 2)\nassert(next_smallest(lst: [5, 1, 4, 3, 2]) == 2)\nassert(next_smallest(lst: [] as [Int]) == nil)\nassert(next_smallest(lst: [1, 1]) == nil)\nassert(next_smallest(lst: [1, 1, 1, 1, 0]) == 1)\nassert(next_smallest(lst: [1, 1]) == nil)\nassert(next_smallest(lst: [-35, 34, 12, -45]) == -35)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "swift", - "prompt": "\n/// Input is a space-delimited string of numberals from 'zero' to 'nine'.\n/// Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n/// Return the string with numbers sorted from smallest to largest\n/// >>> sort_numbers(numbers: \"three one five\")\n/// \"one three five\"\nfunc sort_numbers(numbers: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sort_numbers(numbers: \"\") == \"\")\nassert(sort_numbers(numbers: \"three\") == \"three\")\nassert(sort_numbers(numbers: \"three five nine\") == \"three five nine\")\nassert(sort_numbers(numbers: \"five zero four seven nine eight\") == \"zero four five seven eight nine\")\nassert(sort_numbers(numbers: \"six five four three two one zero\") == \"zero one two three four five six\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "swift", - "prompt": "\n/// You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n/// >>> cycpattern_check(a: \"abcd\", b: \"abd\")\n/// false\n/// >>> cycpattern_check(a: \"hello\", b: \"ell\")\n/// true\n/// >>> cycpattern_check(a: \"whassup\", b: \"psus\")\n/// false\n/// >>> cycpattern_check(a: \"abab\", b: \"baa\")\n/// true\n/// >>> cycpattern_check(a: \"efef\", b: \"eeff\")\n/// false\n/// >>> cycpattern_check(a: \"himenss\", b: \"simen\")\n/// true\nfunc cycpattern_check(a: String, b: String) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(cycpattern_check(a: \"xyzw\", b: \"xyw\") == false)\nassert(cycpattern_check(a: \"yello\", b: \"ell\") == true)\nassert(cycpattern_check(a: \"whattup\", b: \"ptut\") == false)\nassert(cycpattern_check(a: \"efef\", b: \"fee\") == true)\nassert(cycpattern_check(a: \"abab\", b: \"aabb\") == false)\nassert(cycpattern_check(a: \"winemtt\", b: \"tinem\") == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "swift", - "prompt": "\n/// You will be given a number in decimal form and your task is to convert it to\n/// binary format. The function should return a string, with each character representing a binary\n/// number. Each character in the string will be '0' or '1'.\n/// There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n/// The extra characters are there to help with the format.\n/// Examples:\n/// >>> decimal_to_binary(decimal: 15)\n/// \"db1111db\"\n/// >>> decimal_to_binary(decimal: 32)\n/// \"db100000db\"\nfunc decimal_to_binary(decimal: Int) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(decimal_to_binary(decimal: 0) == \"db0db\")\nassert(decimal_to_binary(decimal: 32) == \"db100000db\")\nassert(decimal_to_binary(decimal: 103) == \"db1100111db\")\nassert(decimal_to_binary(decimal: 15) == \"db1111db\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "swift", - "prompt": "\n/// Filter an input list of strings only for ones that contain given substring\n/// >>> filter_by_substring(strings: [] as [String], substring: \"a\")\n/// [] as [String]\n/// >>> filter_by_substring(strings: [\"abc\", \"bacd\", \"cde\", \"array\"], substring: \"a\")\n/// [\"abc\", \"bacd\", \"array\"]\nfunc filter_by_substring(strings: [String], substring: String) -> [String] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(filter_by_substring(strings: [] as [String], substring: \"john\") == [] as [String])\nassert(filter_by_substring(strings: [\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], substring: \"xxx\") == [\"xxx\", \"xxxAAA\", \"xxx\"])\nassert(filter_by_substring(strings: [\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"], substring: \"xx\") == [\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"])\nassert(filter_by_substring(strings: [\"grunt\", \"trumpet\", \"prune\", \"gruesome\"], substring: \"run\") == [\"grunt\", \"prune\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "swift", - "prompt": "\n/// Given an integer. return a tuple that has the number of even and odd digits respectively.\n/// Example:\n/// >>> even_odd_count(num: -12)\n/// (1, 1)\n/// >>> even_odd_count(num: 123)\n/// (1, 2)\nfunc even_odd_count(num: Int) -> (Int, Int) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(even_odd_count(num: 7) == (0, 1))\nassert(even_odd_count(num: -78) == (1, 1))\nassert(even_odd_count(num: 3452) == (2, 2))\nassert(even_odd_count(num: 346211) == (3, 3))\nassert(even_odd_count(num: -345821) == (3, 3))\nassert(even_odd_count(num: -2) == (1, 0))\nassert(even_odd_count(num: -45347) == (2, 3))\nassert(even_odd_count(num: 0) == (1, 0))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "swift", - "prompt": "\n/// Write a function that accepts a list of strings.\n/// The list contains different words. Return the word with maximum number\n/// of unique characters. If multiple strings have maximum number of unique\n/// characters, return the one which comes first in lexicographical order.\n/// >>> find_max(words: [\"name\", \"of\", \"string\"])\n/// \"string\"\n/// >>> find_max(words: [\"name\", \"enam\", \"game\"])\n/// \"enam\"\n/// >>> find_max(words: [\"aaaaaaa\", \"bb\", \"cc\"])\n/// \"aaaaaaa\"\nfunc find_max(words: [String]) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(find_max(words: [\"name\", \"of\", \"string\"]) == \"string\")\nassert(find_max(words: [\"name\", \"enam\", \"game\"]) == \"enam\")\nassert(find_max(words: [\"aaaaaaa\", \"bb\", \"cc\"]) == \"aaaaaaa\")\nassert(find_max(words: [\"abc\", \"cba\"]) == \"abc\")\nassert(find_max(words: [\"play\", \"this\", \"game\", \"of\", \"footbott\"]) == \"footbott\")\nassert(find_max(words: [\"we\", \"are\", \"gonna\", \"rock\"]) == \"gonna\")\nassert(find_max(words: [\"we\", \"are\", \"a\", \"mad\", \"nation\"]) == \"nation\")\nassert(find_max(words: [\"this\", \"is\", \"a\", \"prrk\"]) == \"this\")\nassert(find_max(words: [\"b\"]) == \"b\")\nassert(find_max(words: [\"play\", \"play\", \"play\"]) == \"play\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "swift", - "prompt": "\n/// Given a positive integer n, return the count of the numbers of n-digit\n/// positive integers that start or end with 1.\nfunc starts_one_ends(n: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(starts_one_ends(n: 1) == 1)\nassert(starts_one_ends(n: 2) == 18)\nassert(starts_one_ends(n: 3) == 180)\nassert(starts_one_ends(n: 4) == 1800)\nassert(starts_one_ends(n: 5) == 18000)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "swift", - "prompt": "\n/// Create a function that returns a tuple (a, b), where 'a' is\n/// the largest of negative integers, and 'b' is the smallest\n/// of positive integers in a list.\n/// If there is no negative or positive integers, return them as None.\n/// Examples:\n/// >>> largest_smallest_integers(lst: [2, 4, 1, 3, 5, 7])\n/// (nil, 1)\n/// >>> largest_smallest_integers(lst: [] as [Int])\n/// (nil, nil)\n/// >>> largest_smallest_integers(lst: [0])\n/// (nil, nil)\nfunc largest_smallest_integers(lst: [Int]) -> (Int?, Int?) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(largest_smallest_integers(lst: [2, 4, 1, 3, 5, 7]) == (nil, 1))\nassert(largest_smallest_integers(lst: [2, 4, 1, 3, 5, 7, 0]) == (nil, 1))\nassert(largest_smallest_integers(lst: [1, 3, 2, 4, 5, 6, -2]) == (-2, 1))\nassert(largest_smallest_integers(lst: [4, 5, 3, 6, 2, 7, -7]) == (-7, 2))\nassert(largest_smallest_integers(lst: [7, 3, 8, 4, 9, 2, 5, -9]) == (-9, 2))\nassert(largest_smallest_integers(lst: [] as [Int]) == (nil, nil))\nassert(largest_smallest_integers(lst: [0]) == (nil, nil))\nassert(largest_smallest_integers(lst: [-1, -3, -5, -6]) == (-1, nil))\nassert(largest_smallest_integers(lst: [-1, -3, -5, -6, 0]) == (-1, nil))\nassert(largest_smallest_integers(lst: [-6, -4, -4, -3, 1]) == (-3, 1))\nassert(largest_smallest_integers(lst: [-6, -4, -4, -3, -100, 1]) == (-3, 1))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "swift", - "prompt": "\n/// \"Given an array representing a branch of a tree that has non-negative integer nodes\n/// your task is to pluck one of the nodes and return it.\n/// The plucked node should be the node with the smallest even value.\n/// If multiple nodes with the same smallest even value are found return the node that has smallest index.\n/// The plucked node should be returned in a list, [ smalest_value, its index ],\n/// If there are no even values or the given array is empty, return [].\n/// Example 1:\n/// >>> pluck(arr: [4, 2, 3])\n/// [2, 1]\n/// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n/// Example 2:\n/// >>> pluck(arr: [1, 2, 3])\n/// [2, 1]\n/// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n/// Example 3:\n/// >>> pluck(arr: [] as [Int])\n/// [] as [Int]\n/// Example 4:\n/// >>> pluck(arr: [5, 0, 3, 0, 4, 2])\n/// [0, 1]\n/// Explanation: 0 is the smallest value, but there are two zeros,\n/// so we will choose the first zero, which has the smallest index.\n/// Constraints:\n/// * 1 <= nodes.length <= 10000\n/// * 0 <= node.value\nfunc pluck(arr: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(pluck(arr: [4, 2, 3]) == [2, 1])\nassert(pluck(arr: [1, 2, 3]) == [2, 1])\nassert(pluck(arr: [] as [Int]) == [] as [Int])\nassert(pluck(arr: [5, 0, 3, 0, 4, 2]) == [0, 1])\nassert(pluck(arr: [1, 2, 3, 0, 5, 3]) == [0, 3])\nassert(pluck(arr: [5, 4, 8, 4, 8]) == [4, 1])\nassert(pluck(arr: [7, 6, 7, 1]) == [6, 1])\nassert(pluck(arr: [7, 9, 7, 1]) == [] as [Int])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "swift", - "prompt": "\n/// Write a function count_nums which takes an array of integers and returns\n/// the number of elements which has a sum of digits > 0.\n/// If a number is negative, then its first signed digit will be negative:\n/// e.g. -123 has signed digits -1, 2, and 3.\n/// >>> count_nums(arr: [] as [Int])\n/// 0\n/// >>> count_nums(arr: [-1, 11, -11])\n/// 1\n/// >>> count_nums(arr: [1, 1, 2])\n/// 3\nfunc count_nums(arr: [Int]) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(count_nums(arr: [] as [Int]) == 0)\nassert(count_nums(arr: [-1, -2, 0]) == 0)\nassert(count_nums(arr: [1, 1, 2, -2, 3, 4, 5]) == 6)\nassert(count_nums(arr: [1, 6, 9, -6, 0, 1, 5]) == 5)\nassert(count_nums(arr: [1, 100, 98, -7, 1, -1]) == 4)\nassert(count_nums(arr: [12, 23, 34, -45, -56, 0]) == 5)\nassert(count_nums(arr: [0, 1]) == 1)\nassert(count_nums(arr: [1]) == 1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "swift", - "prompt": "\n/// Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n/// each cell of the grid contains a value. Every integer in the range [1, N * N]\n/// inclusive appears exactly once on the cells of the grid.\n/// You have to find the minimum path of length k in the grid. You can start\n/// from any cell, and in each step you can move to any of the neighbor cells,\n/// in other words, you can go to cells which share an edge with you current\n/// cell.\n/// Please note that a path of length k means visiting exactly k cells (not\n/// necessarily distinct).\n/// You CANNOT go off the grid.\n/// A path A (of length k) is considered less than a path B (of length k) if\n/// after making the ordered lists of the values on the cells that A and B go\n/// through (let's call them lst_A and lst_B), lst_A is lexicographically less\n/// than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n/// such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n/// lst_A[j] = lst_B[j].\n/// It is guaranteed that the answer is unique.\n/// Return an ordered list of the values on the cells that the minimum path go through.\n/// Examples: \n/// >>> minPath(grid: [[1, 2, 3], [4, 5, 6], [7, 8, 9]], k: 3)\n/// [1, 2, 1]\n/// >>> minPath(grid: [[5, 9, 3], [4, 1, 6], [7, 8, 2]], k: 1)\n/// [1]\nfunc minPath(grid: [[Int]], k: Int) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(minPath(grid: [[1, 2, 3], [4, 5, 6], [7, 8, 9]], k: 3) == [1, 2, 1])\nassert(minPath(grid: [[5, 9, 3], [4, 1, 6], [7, 8, 2]], k: 1) == [1])\nassert(minPath(grid: [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], k: 4) == [1, 2, 1, 2])\nassert(minPath(grid: [[6, 4, 13, 10], [5, 7, 12, 1], [3, 16, 11, 15], [8, 14, 9, 2]], k: 7) == [1, 10, 1, 10, 1, 10, 1])\nassert(minPath(grid: [[8, 14, 9, 2], [6, 4, 13, 15], [5, 7, 1, 12], [3, 10, 11, 16]], k: 5) == [1, 7, 1, 7, 1])\nassert(minPath(grid: [[11, 8, 7, 2], [5, 16, 14, 4], [9, 3, 15, 6], [12, 13, 10, 1]], k: 9) == [1, 6, 1, 6, 1, 6, 1, 6, 1])\nassert(minPath(grid: [[12, 13, 10, 1], [9, 3, 15, 6], [5, 16, 14, 4], [11, 8, 7, 2]], k: 12) == [1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6])\nassert(minPath(grid: [[2, 7, 4], [3, 1, 5], [6, 8, 9]], k: 8) == [1, 3, 1, 3, 1, 3, 1, 3])\nassert(minPath(grid: [[6, 1, 5], [3, 8, 9], [2, 7, 4]], k: 8) == [1, 5, 1, 5, 1, 5, 1, 5])\nassert(minPath(grid: [[1, 2], [3, 4]], k: 10) == [1, 2, 1, 2, 1, 2, 1, 2, 1, 2])\nassert(minPath(grid: [[1, 3], [3, 2]], k: 10) == [1, 3, 1, 3, 1, 3, 1, 3, 1, 3])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "swift", - "prompt": "\n/// Given list of integers, return list in strange order.\n/// Strange sorting, is when you start with the minimum value,\n/// then maximum of the remaining integers, then minimum and so on.\n/// Examples:\n/// >>> strange_sort_list(lst: [1, 2, 3, 4])\n/// [1, 4, 2, 3]\n/// >>> strange_sort_list(lst: [5, 5, 5, 5])\n/// [5, 5, 5, 5]\n/// >>> strange_sort_list(lst: [] as [Int])\n/// [] as [Int]\nfunc strange_sort_list(lst: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(strange_sort_list(lst: [1, 2, 3, 4]) == [1, 4, 2, 3])\nassert(strange_sort_list(lst: [5, 6, 7, 8, 9]) == [5, 9, 6, 8, 7])\nassert(strange_sort_list(lst: [1, 2, 3, 4, 5]) == [1, 5, 2, 4, 3])\nassert(strange_sort_list(lst: [5, 6, 7, 8, 9, 1]) == [1, 9, 5, 8, 6, 7])\nassert(strange_sort_list(lst: [5, 5, 5, 5]) == [5, 5, 5, 5])\nassert(strange_sort_list(lst: [] as [Int]) == [] as [Int])\nassert(strange_sort_list(lst: [1, 2, 3, 4, 5, 6, 7, 8]) == [1, 8, 2, 7, 3, 6, 4, 5])\nassert(strange_sort_list(lst: [0, 2, 2, 2, 5, 5, -5, -5]) == [-5, 5, -5, 5, 0, 2, 2, 2])\nassert(strange_sort_list(lst: [111111]) == [111111])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "swift", - "prompt": "\n/// Given a string 'text', return its md5 hash equivalent string.\n/// If 'text' is an empty string, return None.\n/// >>> string_to_md5(text: \"Hello world\")\n/// \"3e25960a79dbc69b674cd4ec67a72c62\"\nfunc string_to_md5(text: String) -> String? {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(string_to_md5(text: \"Hello world\") == \"3e25960a79dbc69b674cd4ec67a72c62\")\nassert(string_to_md5(text: \"\") == nil)\nassert(string_to_md5(text: \"A B C\") == \"0ef78513b0cb8cef12743f5aeb35f888\")\nassert(string_to_md5(text: \"password\") == \"5f4dcc3b5aa765d61d8327deb882cf99\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "swift", - "prompt": "\n/// You are given a word. Your task is to find the closest vowel that stands between \n/// two consonants from the right side of the word (case sensitive).\n/// Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n/// find any vowel met the above condition. \n/// You may assume that the given string contains English letter only.\n/// Example:\n/// >>> get_closest_vowel(word: \"yogurt\")\n/// \"u\"\n/// >>> get_closest_vowel(word: \"FULL\")\n/// \"U\"\n/// >>> get_closest_vowel(word: \"quick\")\n/// \"\"\n/// >>> get_closest_vowel(word: \"ab\")\n/// \"\"\nfunc get_closest_vowel(word: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(get_closest_vowel(word: \"yogurt\") == \"u\")\nassert(get_closest_vowel(word: \"full\") == \"u\")\nassert(get_closest_vowel(word: \"easy\") == \"\")\nassert(get_closest_vowel(word: \"eAsy\") == \"\")\nassert(get_closest_vowel(word: \"ali\") == \"\")\nassert(get_closest_vowel(word: \"bad\") == \"a\")\nassert(get_closest_vowel(word: \"most\") == \"o\")\nassert(get_closest_vowel(word: \"ab\") == \"\")\nassert(get_closest_vowel(word: \"ba\") == \"\")\nassert(get_closest_vowel(word: \"quick\") == \"\")\nassert(get_closest_vowel(word: \"anime\") == \"i\")\nassert(get_closest_vowel(word: \"Asia\") == \"\")\nassert(get_closest_vowel(word: \"Above\") == \"o\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "swift", - "prompt": "\n/// Change numerical base of input number x to base.\n/// return string representation after the conversion.\n/// base numbers are less than 10.\n/// >>> change_base(x: 8, base: 3)\n/// \"22\"\n/// >>> change_base(x: 8, base: 2)\n/// \"1000\"\n/// >>> change_base(x: 7, base: 2)\n/// \"111\"\nfunc change_base(x: Int, base: Int) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(change_base(x: 8, base: 3) == \"22\")\nassert(change_base(x: 9, base: 3) == \"100\")\nassert(change_base(x: 234, base: 2) == \"11101010\")\nassert(change_base(x: 16, base: 2) == \"10000\")\nassert(change_base(x: 8, base: 2) == \"1000\")\nassert(change_base(x: 7, base: 2) == \"111\")\nassert(change_base(x: 2, base: 3) == \"2\")\nassert(change_base(x: 3, base: 4) == \"3\")\nassert(change_base(x: 4, base: 5) == \"4\")\nassert(change_base(x: 5, base: 6) == \"5\")\nassert(change_base(x: 6, base: 7) == \"6\")\nassert(change_base(x: 7, base: 8) == \"7\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "swift", - "prompt": "\n/// Check if in given list of numbers, are any two numbers closer to each other than\n/// given threshold.\n/// >>> has_close_elements(numbers: [1.0, 2.0, 3.0], threshold: 0.5)\n/// false\n/// >>> has_close_elements(numbers: [1.0, 2.8, 3.0, 4.0, 5.0, 2.0], threshold: 0.3)\n/// true\nfunc has_close_elements(numbers: [Double], threshold: Double) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(has_close_elements(numbers: [1.0, 2.0, 3.9, 4.0, 5.0, 2.2], threshold: 0.3) == true)\nassert(has_close_elements(numbers: [1.0, 2.0, 3.9, 4.0, 5.0, 2.2], threshold: 0.05) == false)\nassert(has_close_elements(numbers: [1.0, 2.0, 5.9, 4.0, 5.0], threshold: 0.95) == true)\nassert(has_close_elements(numbers: [1.0, 2.0, 5.9, 4.0, 5.0], threshold: 0.8) == false)\nassert(has_close_elements(numbers: [1.0, 2.0, 3.0, 4.0, 5.0, 2.0], threshold: 0.1) == true)\nassert(has_close_elements(numbers: [1.1, 2.2, 3.1, 4.1, 5.1], threshold: 1.0) == true)\nassert(has_close_elements(numbers: [1.1, 2.2, 3.1, 4.1, 5.1], threshold: 0.5) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "swift", - "prompt": "\n/// Create a function that takes a string as input which contains only square brackets.\n/// The function should return True if and only if there is a valid subsequence of brackets \n/// where at least one bracket in the subsequence is nested.\n/// >>> is_nested(string: \"[[]]\")\n/// true\n/// >>> is_nested(string: \"[]]]]]]][[[[[]\")\n/// false\n/// >>> is_nested(string: \"[][]\")\n/// false\n/// >>> is_nested(string: \"[]\")\n/// false\n/// >>> is_nested(string: \"[[][]]\")\n/// true\n/// >>> is_nested(string: \"[[]][[\")\n/// true\nfunc is_nested(string: String) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_nested(string: \"[[]]\") == true)\nassert(is_nested(string: \"[]]]]]]][[[[[]\") == false)\nassert(is_nested(string: \"[][]\") == false)\nassert(is_nested(string: \"[]\") == false)\nassert(is_nested(string: \"[[[[]]]]\") == true)\nassert(is_nested(string: \"[]]]]]]]]]]\") == false)\nassert(is_nested(string: \"[][][[]]\") == true)\nassert(is_nested(string: \"[[]\") == false)\nassert(is_nested(string: \"[]]\") == false)\nassert(is_nested(string: \"[[]][[\") == true)\nassert(is_nested(string: \"[[][]]\") == true)\nassert(is_nested(string: \"\") == false)\nassert(is_nested(string: \"[[[[[[[[\") == false)\nassert(is_nested(string: \"]]]]]]]]\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "swift", - "prompt": "\n/// Concatenate list of strings into a single string\n/// >>> concatenate(strings: [] as [String])\n/// \"\"\n/// >>> concatenate(strings: [\"a\", \"b\", \"c\"])\n/// \"abc\"\nfunc concatenate(strings: [String]) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(concatenate(strings: [] as [String]) == \"\")\nassert(concatenate(strings: [\"x\", \"y\", \"z\"]) == \"xyz\")\nassert(concatenate(strings: [\"x\", \"y\", \"z\", \"w\", \"k\"]) == \"xyzwk\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "swift", - "prompt": "\n/// prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n/// >>> prime_fib(n: 1)\n/// 2\n/// >>> prime_fib(n: 2)\n/// 3\n/// >>> prime_fib(n: 3)\n/// 5\n/// >>> prime_fib(n: 4)\n/// 13\n/// >>> prime_fib(n: 5)\n/// 89\nfunc prime_fib(n: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(prime_fib(n: 1) == 2)\nassert(prime_fib(n: 2) == 3)\nassert(prime_fib(n: 3) == 5)\nassert(prime_fib(n: 4) == 13)\nassert(prime_fib(n: 5) == 89)\nassert(prime_fib(n: 6) == 233)\nassert(prime_fib(n: 7) == 1597)\nassert(prime_fib(n: 8) == 28657)\nassert(prime_fib(n: 9) == 514229)\nassert(prime_fib(n: 10) == 433494437)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "swift", - "prompt": "\n/// From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n/// other and return them in order (smaller number, larger number).\n/// >>> find_closest_elements(numbers: [1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n/// (2.0, 2.2)\n/// >>> find_closest_elements(numbers: [1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n/// (2.0, 2.0)\nfunc find_closest_elements(numbers: [Double]) -> (Double, Double) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(find_closest_elements(numbers: [1.0, 2.0, 3.9, 4.0, 5.0, 2.2]) == (3.9, 4.0))\nassert(find_closest_elements(numbers: [1.0, 2.0, 5.9, 4.0, 5.0]) == (5.0, 5.9))\nassert(find_closest_elements(numbers: [1.0, 2.0, 3.0, 4.0, 5.0, 2.2]) == (2.0, 2.2))\nassert(find_closest_elements(numbers: [1.0, 2.0, 3.0, 4.0, 5.0, 2.0]) == (2.0, 2.0))\nassert(find_closest_elements(numbers: [1.1, 2.2, 3.1, 4.1, 5.1]) == (2.2, 3.1))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "swift", - "prompt": "\n/// You have been tasked to write a function that receives \n/// a hexadecimal number as a string and counts the number of hexadecimal \n/// digits that are primes (prime number, or a prime, is a natural number \n/// greater than 1 that is not a product of two smaller natural numbers).\n/// Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n/// Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n/// So you have to determine a number of the following digits: 2, 3, 5, 7, \n/// B (=decimal 11), D (=decimal 13).\n/// Note: you may assume the input is always correct or empty string, \n/// and symbols A,B,C,D,E,F are always uppercase.\n/// Examples:\n/// >>> hex_key(num: \"AB\")\n/// 1\n/// >>> hex_key(num: \"1077E\")\n/// 2\n/// >>> hex_key(num: \"ABED1A33\")\n/// 4\n/// >>> hex_key(num: \"123456789ABCDEF0\")\n/// 6\n/// >>> hex_key(num: \"2020\")\n/// 2\nfunc hex_key(num: String) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(hex_key(num: \"AB\") == 1)\nassert(hex_key(num: \"1077E\") == 2)\nassert(hex_key(num: \"ABED1A33\") == 4)\nassert(hex_key(num: \"2020\") == 2)\nassert(hex_key(num: \"123456789ABCDEF0\") == 6)\nassert(hex_key(num: \"112233445566778899AABBCCDDEEFF00\") == 12)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "swift", - "prompt": "\n/// Complete the function that takes two integers and returns \n/// the product of their unit digits.\n/// Assume the input is always valid.\n/// Examples:\n/// >>> multiply(a: 148, b: 412)\n/// 16\n/// >>> multiply(a: 19, b: 28)\n/// 72\n/// >>> multiply(a: 2020, b: 1851)\n/// 0\n/// >>> multiply(a: 14, b: -15)\n/// 20\nfunc multiply(a: Int, b: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(multiply(a: 148, b: 412) == 16)\nassert(multiply(a: 19, b: 28) == 72)\nassert(multiply(a: 2020, b: 1851) == 0)\nassert(multiply(a: 14, b: -15) == 20)\nassert(multiply(a: 76, b: 67) == 42)\nassert(multiply(a: 17, b: 27) == 49)\nassert(multiply(a: 0, b: 1) == 0)\nassert(multiply(a: 0, b: 0) == 0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "swift", - "prompt": "\n/// Given list of numbers (of at least two elements), apply a linear transform to that list,\n/// such that the smallest number will become 0 and the largest will become 1\n/// >>> rescale_to_unit(numbers: [1.0, 2.0, 3.0, 4.0, 5.0])\n/// [0.0, 0.25, 0.5, 0.75, 1.0]\nfunc rescale_to_unit(numbers: [Double]) -> [Double] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(rescale_to_unit(numbers: [2.0, 49.9]) == [0.0, 1.0])\nassert(rescale_to_unit(numbers: [100.0, 49.9]) == [1.0, 0.0])\nassert(rescale_to_unit(numbers: [1.0, 2.0, 3.0, 4.0, 5.0]) == [0.0, 0.25, 0.5, 0.75, 1.0])\nassert(rescale_to_unit(numbers: [2.0, 1.0, 5.0, 3.0, 4.0]) == [0.25, 0.0, 1.0, 0.5, 0.75])\nassert(rescale_to_unit(numbers: [12.0, 11.0, 15.0, 13.0, 14.0]) == [0.25, 0.0, 1.0, 0.5, 0.75])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "swift", - "prompt": "\n/// Given a positive integer n, return the product of the odd digits.\n/// Return 0 if all digits are even.\n/// For example:\n/// >>> digits(n: 1)\n/// 1\n/// >>> digits(n: 4)\n/// 0\n/// >>> digits(n: 235)\n/// 15\nfunc digits(n: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(digits(n: 5) == 5)\nassert(digits(n: 54) == 5)\nassert(digits(n: 120) == 1)\nassert(digits(n: 5014) == 5)\nassert(digits(n: 98765) == 315)\nassert(digits(n: 5576543) == 2625)\nassert(digits(n: 2468) == 0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "swift", - "prompt": "\n/// You will be given the name of a class (a string) and a list of extensions.\n/// The extensions are to be used to load additional classes to the class. The\n/// strength of the extension is as follows: Let CAP be the number of the uppercase\n/// letters in the extension's name, and let SM be the number of lowercase letters \n/// in the extension's name, the strength is given by the fraction CAP - SM. \n/// You should find the strongest extension and return a string in this \n/// format: ClassName.StrongestExtensionName.\n/// If there are two or more extensions with the same strength, you should\n/// choose the one that comes first in the list.\n/// For example, if you are given \"Slices\" as the class and a list of the\n/// extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n/// return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n/// (its strength is -1).\n/// Example:\n/// >>> Strongest_Extension(class_name: \"my_class\", extensions: [\"AA\", \"Be\", \"CC\"])\n/// \"my_class.AA\"\nfunc Strongest_Extension(class_name: String, extensions: [String]) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(Strongest_Extension(class_name: \"Watashi\", extensions: [\"tEN\", \"niNE\", \"eIGHt8OKe\"]) == \"Watashi.eIGHt8OKe\")\nassert(Strongest_Extension(class_name: \"Boku123\", extensions: [\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"]) == \"Boku123.YEs.WeCaNe\")\nassert(Strongest_Extension(class_name: \"__YESIMHERE\", extensions: [\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"]) == \"__YESIMHERE.NuLl__\")\nassert(Strongest_Extension(class_name: \"K\", extensions: [\"Ta\", \"TAR\", \"t234An\", \"cosSo\"]) == \"K.TAR\")\nassert(Strongest_Extension(class_name: \"__HAHA\", extensions: [\"Tab\", \"123\", \"781345\", \"-_-\"]) == \"__HAHA.123\")\nassert(Strongest_Extension(class_name: \"YameRore\", extensions: [\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"]) == \"YameRore.okIWILL123\")\nassert(Strongest_Extension(class_name: \"finNNalLLly\", extensions: [\"Die\", \"NowW\", \"Wow\", \"WoW\"]) == \"finNNalLLly.WoW\")\nassert(Strongest_Extension(class_name: \"_\", extensions: [\"Bb\", \"91245\"]) == \"_.Bb\")\nassert(Strongest_Extension(class_name: \"Sp\", extensions: [\"671235\", \"Bb\"]) == \"Sp.671235\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "swift", - "prompt": "\n/// Given a string representing a space separated lowercase letters, return a dictionary\n/// of the letter with the most repetition and containing the corresponding count.\n/// If several letters have the same occurrence, return all of them.\n/// Example:\n/// >>> histogram(test: \"a b c\")\n/// [\"a\" : 1, \"b\" : 1, \"c\" : 1]\n/// >>> histogram(test: \"a b b a\")\n/// [\"a\" : 2, \"b\" : 2]\n/// >>> histogram(test: \"a b c a b\")\n/// [\"a\" : 2, \"b\" : 2]\n/// >>> histogram(test: \"b b b b a\")\n/// [\"b\" : 4]\n/// >>> histogram(test: \"\")\n/// [:] as [String : Int]\nfunc histogram(test: String) -> [String : Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(histogram(test: \"a b b a\") == [\"a\" : 2, \"b\" : 2])\nassert(histogram(test: \"a b c a b\") == [\"a\" : 2, \"b\" : 2])\nassert(histogram(test: \"a b c d g\") == [\"a\" : 1, \"b\" : 1, \"c\" : 1, \"d\" : 1, \"g\" : 1])\nassert(histogram(test: \"r t g\") == [\"r\" : 1, \"t\" : 1, \"g\" : 1])\nassert(histogram(test: \"b b b b a\") == [\"b\" : 4])\nassert(histogram(test: \"r t g\") == [\"r\" : 1, \"t\" : 1, \"g\" : 1])\nassert(histogram(test: \"\") == [:] as [String : Int])\nassert(histogram(test: \"a\") == [\"a\" : 1])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "swift", - "prompt": "\n/// pairs_sum_to_zero takes a list of integers as an input.\n/// it returns True if there are two distinct elements in the list that\n/// sum to zero, and False otherwise.\n/// >>> pairs_sum_to_zero(l: [1, 3, 5, 0])\n/// false\n/// >>> pairs_sum_to_zero(l: [1, 3, -2, 1])\n/// false\n/// >>> pairs_sum_to_zero(l: [1, 2, 3, 7])\n/// false\n/// >>> pairs_sum_to_zero(l: [2, 4, -5, 3, 5, 7])\n/// true\n/// >>> pairs_sum_to_zero(l: [1])\n/// false\nfunc pairs_sum_to_zero(l: [Int]) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(pairs_sum_to_zero(l: [1, 3, 5, 0]) == false)\nassert(pairs_sum_to_zero(l: [1, 3, -2, 1]) == false)\nassert(pairs_sum_to_zero(l: [1, 2, 3, 7]) == false)\nassert(pairs_sum_to_zero(l: [2, 4, -5, 3, 5, 7]) == true)\nassert(pairs_sum_to_zero(l: [1]) == false)\nassert(pairs_sum_to_zero(l: [-3, 9, -1, 3, 2, 30]) == true)\nassert(pairs_sum_to_zero(l: [-3, 9, -1, 3, 2, 31]) == true)\nassert(pairs_sum_to_zero(l: [-3, 9, -1, 4, 2, 30]) == false)\nassert(pairs_sum_to_zero(l: [-3, 9, -1, 4, 2, 31]) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "swift", - "prompt": "\n/// Write a function that accepts two lists of strings and returns the list that has \n/// total number of chars in the all strings of the list less than the other list.\n/// if the two lists have the same number of chars, return the first list.\n/// Examples\n/// >>> total_match(lst1: [] as [String], lst2: [] as [String])\n/// [] as [String]\n/// >>> total_match(lst1: [\"hi\", \"admin\"], lst2: [\"hI\", \"Hi\"])\n/// [\"hI\", \"Hi\"]\n/// >>> total_match(lst1: [\"hi\", \"admin\"], lst2: [\"hi\", \"hi\", \"admin\", \"project\"])\n/// [\"hi\", \"admin\"]\n/// >>> total_match(lst1: [\"hi\", \"admin\"], lst2: [\"hI\", \"hi\", \"hi\"])\n/// [\"hI\", \"hi\", \"hi\"]\n/// >>> total_match(lst1: [\"4\"], lst2: [\"1\", \"2\", \"3\", \"4\", \"5\"])\n/// [\"4\"]\nfunc total_match(lst1: [String], lst2: [String]) -> [String] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(total_match(lst1: [] as [String], lst2: [] as [String]) == [] as [String])\nassert(total_match(lst1: [\"hi\", \"admin\"], lst2: [\"hi\", \"hi\"]) == [\"hi\", \"hi\"])\nassert(total_match(lst1: [\"hi\", \"admin\"], lst2: [\"hi\", \"hi\", \"admin\", \"project\"]) == [\"hi\", \"admin\"])\nassert(total_match(lst1: [\"4\"], lst2: [\"1\", \"2\", \"3\", \"4\", \"5\"]) == [\"4\"])\nassert(total_match(lst1: [\"hi\", \"admin\"], lst2: [\"hI\", \"Hi\"]) == [\"hI\", \"Hi\"])\nassert(total_match(lst1: [\"hi\", \"admin\"], lst2: [\"hI\", \"hi\", \"hi\"]) == [\"hI\", \"hi\", \"hi\"])\nassert(total_match(lst1: [\"hi\", \"admin\"], lst2: [\"hI\", \"hi\", \"hii\"]) == [\"hi\", \"admin\"])\nassert(total_match(lst1: [] as [String], lst2: [\"this\"]) == [] as [String])\nassert(total_match(lst1: [\"this\"], lst2: [] as [String]) == [] as [String])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "swift", - "prompt": "\n/// Circular shift the digits of the integer x, shift the digits right by shift\n/// and return the result as a string.\n/// If shift > number of digits, return digits reversed.\n/// >>> circular_shift(x: 12, shift: 1)\n/// \"21\"\n/// >>> circular_shift(x: 12, shift: 2)\n/// \"12\"\nfunc circular_shift(x: Int, shift: Int) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(circular_shift(x: 100, shift: 2) == \"001\")\nassert(circular_shift(x: 12, shift: 2) == \"12\")\nassert(circular_shift(x: 97, shift: 8) == \"79\")\nassert(circular_shift(x: 12, shift: 1) == \"21\")\nassert(circular_shift(x: 11, shift: 101) == \"11\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "swift", - "prompt": "\n/// Return True is list elements are monotonically increasing or decreasing.\n/// >>> monotonic(l: [1, 2, 4, 20])\n/// true\n/// >>> monotonic(l: [1, 20, 4, 10])\n/// false\n/// >>> monotonic(l: [4, 1, 0, -10])\n/// true\nfunc monotonic(l: [Int]) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(monotonic(l: [1, 2, 4, 10]) == true)\nassert(monotonic(l: [1, 2, 4, 20]) == true)\nassert(monotonic(l: [1, 20, 4, 10]) == false)\nassert(monotonic(l: [4, 1, 0, -10]) == true)\nassert(monotonic(l: [4, 1, 1, 0]) == true)\nassert(monotonic(l: [1, 2, 3, 2, 5, 60]) == false)\nassert(monotonic(l: [1, 2, 3, 4, 5, 60]) == true)\nassert(monotonic(l: [9, 9, 9, 9]) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "swift", - "prompt": "\n/// Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n/// Example\n/// >>> is_equal_to_sum_even(n: 4)\n/// false\n/// >>> is_equal_to_sum_even(n: 6)\n/// false\n/// >>> is_equal_to_sum_even(n: 8)\n/// true\nfunc is_equal_to_sum_even(n: Int) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_equal_to_sum_even(n: 4) == false)\nassert(is_equal_to_sum_even(n: 6) == false)\nassert(is_equal_to_sum_even(n: 8) == true)\nassert(is_equal_to_sum_even(n: 10) == true)\nassert(is_equal_to_sum_even(n: 11) == false)\nassert(is_equal_to_sum_even(n: 12) == true)\nassert(is_equal_to_sum_even(n: 13) == false)\nassert(is_equal_to_sum_even(n: 16) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "swift", - "prompt": "\n/// Input to this function is a string representing musical notes in a special ASCII format.\n/// Your task is to parse this string and return list of integers corresponding to how many beats does each\n/// not last.\n/// Here is a legend:\n/// 'o' - whole note, lasts four beats\n/// 'o|' - half note, lasts two beats\n/// '.|' - quater note, lasts one beat\n/// >>> parse_music(music_string: \"o o| .| o| o| .| .| .| .| o o\")\n/// [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\nfunc parse_music(music_string: String) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(parse_music(music_string: \"\") == [] as [Int])\nassert(parse_music(music_string: \"o o o o\") == [4, 4, 4, 4])\nassert(parse_music(music_string: \".| .| .| .|\") == [1, 1, 1, 1])\nassert(parse_music(music_string: \"o| o| .| .| o o o o\") == [2, 2, 1, 1, 4, 4, 4, 4])\nassert(parse_music(music_string: \"o| .| o| .| o o| o o|\") == [2, 1, 2, 1, 4, 2, 4, 2])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "swift", - "prompt": "\n/// triples_sum_to_zero takes a list of integers as an input.\n/// it returns True if there are three distinct elements in the list that\n/// sum to zero, and False otherwise.\n/// >>> triples_sum_to_zero(l: [1, 3, 5, 0])\n/// false\n/// >>> triples_sum_to_zero(l: [1, 3, -2, 1])\n/// true\n/// >>> triples_sum_to_zero(l: [1, 2, 3, 7])\n/// false\n/// >>> triples_sum_to_zero(l: [2, 4, -5, 3, 9, 7])\n/// true\n/// >>> triples_sum_to_zero(l: [1])\n/// false\nfunc triples_sum_to_zero(l: [Int]) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(triples_sum_to_zero(l: [1, 3, 5, 0]) == false)\nassert(triples_sum_to_zero(l: [1, 3, 5, -1]) == false)\nassert(triples_sum_to_zero(l: [1, 3, -2, 1]) == true)\nassert(triples_sum_to_zero(l: [1, 2, 3, 7]) == false)\nassert(triples_sum_to_zero(l: [1, 2, 5, 7]) == false)\nassert(triples_sum_to_zero(l: [2, 4, -5, 3, 9, 7]) == true)\nassert(triples_sum_to_zero(l: [1]) == false)\nassert(triples_sum_to_zero(l: [1, 3, 5, -100]) == false)\nassert(triples_sum_to_zero(l: [100, 3, 5, -100]) == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "swift", - "prompt": "\n/// brackets is a string of \"<\" and \">\".\n/// return True if every opening bracket has a corresponding closing bracket.\n/// >>> correct_bracketing(brackets: \"<\")\n/// false\n/// >>> correct_bracketing(brackets: \"<>\")\n/// true\n/// >>> correct_bracketing(brackets: \"<<><>>\")\n/// true\n/// >>> correct_bracketing(brackets: \"><<>\")\n/// false\nfunc correct_bracketing(brackets: String) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(correct_bracketing(brackets: \"<>\") == true)\nassert(correct_bracketing(brackets: \"<<><>>\") == true)\nassert(correct_bracketing(brackets: \"<><><<><>><>\") == true)\nassert(correct_bracketing(brackets: \"<><><<<><><>><>><<><><<>>>\") == true)\nassert(correct_bracketing(brackets: \"<<<><>>>>\") == false)\nassert(correct_bracketing(brackets: \"><<>\") == false)\nassert(correct_bracketing(brackets: \"<\") == false)\nassert(correct_bracketing(brackets: \"<<<<\") == false)\nassert(correct_bracketing(brackets: \">\") == false)\nassert(correct_bracketing(brackets: \"<<>\") == false)\nassert(correct_bracketing(brackets: \"<><><<><>><>><<>\") == false)\nassert(correct_bracketing(brackets: \"<><><<><>><>>><>\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "swift", - "prompt": "\n/// Write a function that takes an array of numbers as input and returns \n/// the number of elements in the array that are greater than 10 and both \n/// first and last digits of a number are odd (1, 3, 5, 7, 9).\n/// For example:\n/// >>> specialFilter(nums: [15, -73, 14, -15])\n/// 1\n/// >>> specialFilter(nums: [33, -2, -3, 45, 21, 109])\n/// 2\nfunc specialFilter(nums: [Int]) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(specialFilter(nums: [5, -2, 1, -5]) == 0)\nassert(specialFilter(nums: [15, -73, 14, -15]) == 1)\nassert(specialFilter(nums: [33, -2, -3, 45, 21, 109]) == 2)\nassert(specialFilter(nums: [43, -12, 93, 125, 121, 109]) == 4)\nassert(specialFilter(nums: [71, -2, -33, 75, 21, 19]) == 3)\nassert(specialFilter(nums: [1]) == 0)\nassert(specialFilter(nums: [] as [Int]) == 0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "swift", - "prompt": "\nextension Int: Error {}\n \n/// Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n/// should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n/// alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n/// Examples\n/// >>> split_words(txt: \"Hello world!\")\n/// .success([\"Hello\", \"world!\"])\n/// >>> split_words(txt: \"Hello,world!\")\n/// .success([\"Hello\", \"world!\"])\n/// >>> split_words(txt: \"abcdef\")\n/// .failure(3)\nfunc split_words(txt: String) -> Result<[String], Int> {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(split_words(txt: \"Hello world!\") == .success([\"Hello\", \"world!\"]))\nassert(split_words(txt: \"Hello,world!\") == .success([\"Hello\", \"world!\"]))\nassert(split_words(txt: \"Hello world,!\") == .success([\"Hello\", \"world,!\"]))\nassert(split_words(txt: \"Hello,Hello,world !\") == .success([\"Hello,Hello,world\", \"!\"]))\nassert(split_words(txt: \"abcdef\") == .failure(3))\nassert(split_words(txt: \"aaabb\") == .failure(2))\nassert(split_words(txt: \"aaaBb\") == .failure(1))\nassert(split_words(txt: \"\") == .failure(0))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "swift", - "prompt": "\n/// The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n/// fibfib(0) == 0\n/// fibfib(1) == 0\n/// fibfib(2) == 1\n/// fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n/// Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n/// >>> fibfib(n: 1)\n/// 0\n/// >>> fibfib(n: 5)\n/// 4\n/// >>> fibfib(n: 8)\n/// 24\nfunc fibfib(n: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(fibfib(n: 2) == 1)\nassert(fibfib(n: 1) == 0)\nassert(fibfib(n: 5) == 4)\nassert(fibfib(n: 8) == 24)\nassert(fibfib(n: 10) == 81)\nassert(fibfib(n: 12) == 274)\nassert(fibfib(n: 14) == 927)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "swift", - "prompt": "\n/// You are given a list of numbers.\n/// You need to return the sum of squared numbers in the given list,\n/// round each element in the list to the upper int(Ceiling) first.\n/// Examples:\n/// >>> sum_squares(lst: [1.0, 2.0, 3.0])\n/// 14\n/// >>> sum_squares(lst: [1.0, 4.0, 9.0])\n/// 98\n/// >>> sum_squares(lst: [1.0, 3.0, 5.0, 7.0])\n/// 84\n/// >>> sum_squares(lst: [1.4, 4.2, 0.0])\n/// 29\n/// >>> sum_squares(lst: [-2.4, 1.0, 1.0])\n/// 6\nfunc sum_squares(lst: [Double]) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sum_squares(lst: [1.0, 2.0, 3.0]) == 14)\nassert(sum_squares(lst: [1.0, 2.0, 3.0]) == 14)\nassert(sum_squares(lst: [1.0, 3.0, 5.0, 7.0]) == 84)\nassert(sum_squares(lst: [1.4, 4.2, 0.0]) == 29)\nassert(sum_squares(lst: [-2.4, 1.0, 1.0]) == 6)\nassert(sum_squares(lst: [100.0, 1.0, 15.0, 2.0]) == 10230)\nassert(sum_squares(lst: [10000.0, 10000.0]) == 200000000)\nassert(sum_squares(lst: [-1.4, 4.6, 6.3]) == 75)\nassert(sum_squares(lst: [-1.4, 17.9, 18.9, 19.9]) == 1086)\nassert(sum_squares(lst: [0.0]) == 0)\nassert(sum_squares(lst: [-1.0]) == 1)\nassert(sum_squares(lst: [-1.0, 1.0, 0.0]) == 2)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_85_add", - "language": "swift", - "prompt": "\n/// Given a non-empty list of integers lst. add the even elements that are at odd indices..\n/// Examples:\n/// >>> add(lst: [4, 2, 6, 7])\n/// 2\nfunc add(lst: [Int]) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(add(lst: [4, 88]) == 88)\nassert(add(lst: [4, 5, 6, 7, 2, 122]) == 122)\nassert(add(lst: [4, 0, 6, 7]) == 0)\nassert(add(lst: [4, 4, 6, 8]) == 12)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "swift", - "prompt": "\n/// Return sorted unique elements in a list\n/// >>> unique(l: [5, 3, 5, 2, 3, 3, 9, 0, 123])\n/// [0, 2, 3, 5, 9, 123]\nfunc unique(l: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(unique(l: [5, 3, 5, 2, 3, 3, 9, 0, 123]) == [0, 2, 3, 5, 9, 123])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "swift", - "prompt": "\n/// Given a string text, replace all spaces in it with underscores, \n/// and if a string has more than 2 consecutive spaces, \n/// then replace all consecutive spaces with - \n/// >>> fix_spaces(text: \" Example\")\n/// \"Example\"\n/// >>> fix_spaces(text: \" Example 1\")\n/// \"Example_1\"\n/// >>> fix_spaces(text: \" Example 2\")\n/// \"_Example_2\"\n/// >>> fix_spaces(text: \" Example 3\")\n/// \"_Example-3\"\nfunc fix_spaces(text: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(fix_spaces(text: \"Example\") == \"Example\")\nassert(fix_spaces(text: \"Mudasir Hanif \") == \"Mudasir_Hanif_\")\nassert(fix_spaces(text: \"Yellow Yellow Dirty Fellow\") == \"Yellow_Yellow__Dirty__Fellow\")\nassert(fix_spaces(text: \"Exa mple\") == \"Exa-mple\")\nassert(fix_spaces(text: \" Exa 1 2 2 mple\") == \"-Exa_1_2_2_mple\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "swift", - "prompt": "\n/// Return 2^n modulo p (be aware of numerics).\n/// >>> modp(n: 3, p: 5)\n/// 3\n/// >>> modp(n: 1101, p: 101)\n/// 2\n/// >>> modp(n: 0, p: 101)\n/// 1\n/// >>> modp(n: 3, p: 11)\n/// 8\n/// >>> modp(n: 100, p: 101)\n/// 1\nfunc modp(n: Int, p: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(modp(n: 3, p: 5) == 3)\nassert(modp(n: 1101, p: 101) == 2)\nassert(modp(n: 0, p: 101) == 1)\nassert(modp(n: 3, p: 11) == 8)\nassert(modp(n: 100, p: 101) == 1)\nassert(modp(n: 30, p: 5) == 4)\nassert(modp(n: 31, p: 5) == 3)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "swift", - "prompt": "\n/// You have to write a function which validates a given date string and\n/// returns True if the date is valid otherwise False.\n/// The date is valid if all of the following rules are satisfied:\n/// 1. The date string is not empty.\n/// 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n/// 3. The months should not be less than 1 or higher than 12.\n/// 4. The date should be in the format: mm-dd-yyyy\n/// >>> valid_date(date: \"03-11-2000\")\n/// true\n/// >>> valid_date(date: \"15-01-2012\")\n/// false\n/// >>> valid_date(date: \"04-0-2040\")\n/// false\n/// >>> valid_date(date: \"06-04-2020\")\n/// true\n/// >>> valid_date(date: \"06/04/2020\")\n/// false\nfunc valid_date(date: String) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(valid_date(date: \"03-11-2000\") == true)\nassert(valid_date(date: \"15-01-2012\") == false)\nassert(valid_date(date: \"04-0-2040\") == false)\nassert(valid_date(date: \"06-04-2020\") == true)\nassert(valid_date(date: \"01-01-2007\") == true)\nassert(valid_date(date: \"03-32-2011\") == false)\nassert(valid_date(date: \"\") == false)\nassert(valid_date(date: \"04-31-3000\") == false)\nassert(valid_date(date: \"06-06-2005\") == true)\nassert(valid_date(date: \"21-31-2000\") == false)\nassert(valid_date(date: \"04-12-2003\") == true)\nassert(valid_date(date: \"04122003\") == false)\nassert(valid_date(date: \"20030412\") == false)\nassert(valid_date(date: \"2003-04\") == false)\nassert(valid_date(date: \"2003-04-12\") == false)\nassert(valid_date(date: \"04-2003\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "swift", - "prompt": "\n/// Write a function that takes a string and returns an ordered version of it.\n/// Ordered version of string, is a string where all words (separated by space)\n/// are replaced by a new word where all the characters arranged in\n/// ascending order based on ascii value.\n/// Note: You should keep the order of words and blank spaces in the sentence.\n/// For example:\n/// >>> anti_shuffle(s: \"Hi\")\n/// \"Hi\"\n/// >>> anti_shuffle(s: \"hello\")\n/// \"ehllo\"\n/// >>> anti_shuffle(s: \"Hello World!!!\")\n/// \"Hello !!!Wdlor\"\nfunc anti_shuffle(s: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(anti_shuffle(s: \"Hi\") == \"Hi\")\nassert(anti_shuffle(s: \"hello\") == \"ehllo\")\nassert(anti_shuffle(s: \"number\") == \"bemnru\")\nassert(anti_shuffle(s: \"abcd\") == \"abcd\")\nassert(anti_shuffle(s: \"Hello World!!!\") == \"Hello !!!Wdlor\")\nassert(anti_shuffle(s: \"\") == \"\")\nassert(anti_shuffle(s: \"Hi. My name is Mister Robot. How are you?\") == \".Hi My aemn is Meirst .Rboot How aer ?ouy\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "swift", - "prompt": "\n/// Given a list of numbers, return whether or not they are sorted\n/// in ascending order. If list has more than 1 duplicate of the same\n/// number, return False. Assume no negative numbers and only integers.\n/// Examples\n/// >>> is_sorted(lst: [5])\n/// true\n/// >>> is_sorted(lst: [1, 2, 3, 4, 5])\n/// true\n/// >>> is_sorted(lst: [1, 3, 2, 4, 5])\n/// false\n/// >>> is_sorted(lst: [1, 2, 3, 4, 5, 6])\n/// true\n/// >>> is_sorted(lst: [1, 2, 3, 4, 5, 6, 7])\n/// true\n/// >>> is_sorted(lst: [1, 3, 2, 4, 5, 6, 7])\n/// false\n/// >>> is_sorted(lst: [1, 2, 2, 3, 3, 4])\n/// true\n/// >>> is_sorted(lst: [1, 2, 2, 2, 3, 4])\n/// false\nfunc is_sorted(lst: [Int]) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_sorted(lst: [5]) == true)\nassert(is_sorted(lst: [1, 2, 3, 4, 5]) == true)\nassert(is_sorted(lst: [1, 3, 2, 4, 5]) == false)\nassert(is_sorted(lst: [1, 2, 3, 4, 5, 6]) == true)\nassert(is_sorted(lst: [1, 2, 3, 4, 5, 6, 7]) == true)\nassert(is_sorted(lst: [1, 3, 2, 4, 5, 6, 7]) == false)\nassert(is_sorted(lst: [] as [Int]) == true)\nassert(is_sorted(lst: [1]) == true)\nassert(is_sorted(lst: [3, 2, 1]) == false)\nassert(is_sorted(lst: [1, 2, 2, 2, 3, 4]) == false)\nassert(is_sorted(lst: [1, 2, 3, 3, 3, 4]) == false)\nassert(is_sorted(lst: [1, 2, 2, 3, 3, 4]) == true)\nassert(is_sorted(lst: [1, 2, 3, 4]) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "swift", - "prompt": "\n/// You are given a string s.\n/// Your task is to check if the string is happy or not.\n/// A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n/// For example:\n/// >>> is_happy(s: \"a\")\n/// false\n/// >>> is_happy(s: \"aa\")\n/// false\n/// >>> is_happy(s: \"abcd\")\n/// true\n/// >>> is_happy(s: \"aabb\")\n/// false\n/// >>> is_happy(s: \"adb\")\n/// true\n/// >>> is_happy(s: \"xyy\")\n/// false\nfunc is_happy(s: String) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(is_happy(s: \"a\") == false)\nassert(is_happy(s: \"aa\") == false)\nassert(is_happy(s: \"abcd\") == true)\nassert(is_happy(s: \"aabb\") == false)\nassert(is_happy(s: \"adb\") == true)\nassert(is_happy(s: \"xyy\") == false)\nassert(is_happy(s: \"iopaxpoi\") == true)\nassert(is_happy(s: \"iopaxioi\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "swift", - "prompt": "\n/// Write a function that returns True if the object q will fly, and False otherwise.\n/// The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n/// Example:\n/// >>> will_it_fly(q: [1, 2], w: 5)\n/// false\n/// # 1+2 is less than the maximum possible weight, but it's unbalanced.\n/// >>> will_it_fly(q: [3, 2, 3], w: 1)\n/// false\n/// # it's balanced, but 3+2+3 is more than the maximum possible weight.\n/// >>> will_it_fly(q: [3, 2, 3], w: 9)\n/// true\n/// # 3+2+3 is less than the maximum possible weight, and it's balanced.\n/// >>> will_it_fly(q: [3], w: 5)\n/// true\n/// # 3 is less than the maximum possible weight, and it's balanced.\nfunc will_it_fly(q: [Int], w: Int) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(will_it_fly(q: [3, 2, 3], w: 9) == true)\nassert(will_it_fly(q: [1, 2], w: 5) == false)\nassert(will_it_fly(q: [3], w: 5) == true)\nassert(will_it_fly(q: [3, 2, 3], w: 1) == false)\nassert(will_it_fly(q: [1, 2, 3], w: 6) == false)\nassert(will_it_fly(q: [5], w: 5) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "swift", - "prompt": "\n/// Given an array of non-negative integers, return a copy of the given array after sorting,\n/// you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n/// or sort it in descending order if the sum( first index value, last index value) is even.\n/// Note:\n/// * don't change the given array.\n/// Examples:\n/// >>> sort_array(array: [] as [Int])\n/// [] as [Int]\n/// >>> sort_array(array: [5])\n/// [5]\n/// >>> sort_array(array: [2, 4, 3, 0, 1, 5])\n/// [0, 1, 2, 3, 4, 5]\n/// >>> sort_array(array: [2, 4, 3, 0, 1, 5, 6])\n/// [6, 5, 4, 3, 2, 1, 0]\nfunc sort_array(array: [Int]) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sort_array(array: [] as [Int]) == [] as [Int])\nassert(sort_array(array: [5]) == [5])\nassert(sort_array(array: [2, 4, 3, 0, 1, 5]) == [0, 1, 2, 3, 4, 5])\nassert(sort_array(array: [2, 4, 3, 0, 1, 5, 6]) == [6, 5, 4, 3, 2, 1, 0])\nassert(sort_array(array: [2, 1]) == [1, 2])\nassert(sort_array(array: [15, 42, 87, 32, 11, 0]) == [0, 11, 15, 32, 42, 87])\nassert(sort_array(array: [21, 14, 23, 11]) == [23, 21, 14, 11])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "swift", - "prompt": "\n/// Implement a function that takes an non-negative integer and returns an array of the first n\n/// integers that are prime numbers and less than n.\n/// for example:\n/// >>> count_up_to(n: 5)\n/// [2, 3]\n/// >>> count_up_to(n: 11)\n/// [2, 3, 5, 7]\n/// >>> count_up_to(n: 0)\n/// [] as [Int]\n/// >>> count_up_to(n: 20)\n/// [2, 3, 5, 7, 11, 13, 17, 19]\n/// >>> count_up_to(n: 1)\n/// [] as [Int]\n/// >>> count_up_to(n: 18)\n/// [2, 3, 5, 7, 11, 13, 17]\nfunc count_up_to(n: Int) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(count_up_to(n: 5) == [2, 3])\nassert(count_up_to(n: 6) == [2, 3, 5])\nassert(count_up_to(n: 7) == [2, 3, 5])\nassert(count_up_to(n: 10) == [2, 3, 5, 7])\nassert(count_up_to(n: 0) == [] as [Int])\nassert(count_up_to(n: 22) == [2, 3, 5, 7, 11, 13, 17, 19])\nassert(count_up_to(n: 1) == [] as [Int])\nassert(count_up_to(n: 18) == [2, 3, 5, 7, 11, 13, 17])\nassert(count_up_to(n: 47) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43])\nassert(count_up_to(n: 101) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "swift", - "prompt": "\n/// Out of list of strings, return the longest one. Return the first one in case of multiple\n/// strings of the same length. Return None in case the input list is empty.\n/// >>> longest(strings: [] as [String])\n/// nil\n/// >>> longest(strings: [\"a\", \"b\", \"c\"])\n/// \"a\"\n/// >>> longest(strings: [\"a\", \"bb\", \"ccc\"])\n/// \"ccc\"\nfunc longest(strings: [String]) -> String? {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(longest(strings: [] as [String]) == nil)\nassert(longest(strings: [\"x\", \"y\", \"z\"]) == \"x\")\nassert(longest(strings: [\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"]) == \"zzzz\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "swift", - "prompt": "\n/// Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n/// reverse the resulting array, and then replace each digit by its corresponding name from\n/// \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n/// For example:\n/// >>> by_length(arr: [2, 1, 1, 4, 5, 8, 2, 3])\n/// [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n/// If the array is empty, return an empty array:\n/// >>> by_length(arr: [] as [Int])\n/// [] as [String]\n/// If the array has any strange number ignore it:\n/// >>> by_length(arr: [1, -1, 55])\n/// [\"One\"]\nfunc by_length(arr: [Int]) -> [String] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(by_length(arr: [2, 1, 1, 4, 5, 8, 2, 3]) == [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"])\nassert(by_length(arr: [] as [Int]) == [] as [String])\nassert(by_length(arr: [1, -1, 55]) == [\"One\"])\nassert(by_length(arr: [1, -1, 3, 2]) == [\"Three\", \"Two\", \"One\"])\nassert(by_length(arr: [9, 4, 8]) == [\"Nine\", \"Eight\", \"Four\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_106_f", - "language": "swift", - "prompt": "\n/// Implement the function f that takes n as a parameter,\n/// 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\n/// or the sum of numbers from 1 to i otherwise.\n/// i starts from 1.\n/// the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n/// Example:\n/// >>> f(n: 5)\n/// [1, 2, 6, 24, 15]\nfunc f(n: Int) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(f(n: 5) == [1, 2, 6, 24, 15])\nassert(f(n: 7) == [1, 2, 6, 24, 15, 720, 28])\nassert(f(n: 1) == [1])\nassert(f(n: 3) == [1, 2, 6])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "swift", - "prompt": "\n/// Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n/// >>> fizz_buzz(n: 50)\n/// 0\n/// >>> fizz_buzz(n: 78)\n/// 2\n/// >>> fizz_buzz(n: 79)\n/// 3\nfunc fizz_buzz(n: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(fizz_buzz(n: 50) == 0)\nassert(fizz_buzz(n: 78) == 2)\nassert(fizz_buzz(n: 79) == 3)\nassert(fizz_buzz(n: 100) == 3)\nassert(fizz_buzz(n: 200) == 6)\nassert(fizz_buzz(n: 4000) == 192)\nassert(fizz_buzz(n: 10000) == 639)\nassert(fizz_buzz(n: 100000) == 8026)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "swift", - "prompt": "\n/// Given a positive floating point number, it can be decomposed into\n/// and integer part (largest integer smaller than given number) and decimals\n/// (leftover part always smaller than 1).\n/// Return the decimal part of the number.\n/// >>> truncate_number(number: 3.5)\n/// 0.5\nfunc truncate_number(number: Double) -> Double {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(truncate_number(number: 3.5) == 0.5)\nassert(truncate_number(number: 1.25) == 0.25)\nassert(truncate_number(number: 123.0) == 0.0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "swift", - "prompt": "\n/// For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n/// Empty sum should be equal to 0 and empty product should be equal to 1.\n/// >>> sum_product(numbers: [] as [Int])\n/// (0, 1)\n/// >>> sum_product(numbers: [1, 2, 3, 4])\n/// (10, 24)\nfunc sum_product(numbers: [Int]) -> (Int, Int) {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(sum_product(numbers: [] as [Int]) == (0, 1))\nassert(sum_product(numbers: [1, 1, 1]) == (3, 1))\nassert(sum_product(numbers: [100, 0]) == (100, 0))\nassert(sum_product(numbers: [3, 5, 7]) == (15, 105))\nassert(sum_product(numbers: [10]) == (10, 10))", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "swift", - "prompt": "\n/// You are given a 2 dimensional data, as a nested lists,\n/// which is similar to matrix, however, unlike matrices,\n/// each row may contain a different number of columns.\n/// Given lst, and integer x, find integers x in the list,\n/// and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n/// each tuple is a coordinate - (row, columns), starting with 0.\n/// Sort coordinates initially by rows in ascending order.\n/// Also, sort coordinates of the row by columns in descending order.\n/// Examples:\n/// >>> get_row(lst: [[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], x: 1)\n/// [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n/// >>> get_row(lst: [] as [[Int]], x: 1)\n/// [] as [(Int, Int)]\n/// >>> get_row(lst: [[] as [Int], [1], [1, 2, 3]], x: 3)\n/// [(2, 2)]\nfunc get_row(lst: [[Int]], x: Int) -> [(Int, Int)] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(get_row(lst: [[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], x: 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)])\nassert(get_row(lst: [[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6]], x: 2) == [(0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1)])\nassert(get_row(lst: [[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 1, 3, 4, 5, 6], [1, 2, 1, 4, 5, 6], [1, 2, 3, 1, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], x: 1) == [(0, 0), (1, 0), (2, 1), (2, 0), (3, 2), (3, 0), (4, 3), (4, 0), (5, 4), (5, 0), (6, 5), (6, 0)])\nassert(get_row(lst: [] as [[Int]], x: 1) == [] as [(Int, Int)])\nassert(get_row(lst: [[1]], x: 2) == [] as [(Int, Int)])\nassert(get_row(lst: [[] as [Int], [1], [1, 2, 3]], x: 3) == [(2, 2)])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "swift", - "prompt": "\n/// You're a hungry rabbit, and you already have eaten a certain number of carrots,\n/// but now you need to eat more carrots to complete the day's meals.\n/// you should return an array of [ total number of eaten carrots after your meals,\n/// the number of carrots left after your meals ]\n/// if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n/// Example:\n/// >>> eat(number: 5, need: 6, remaining: 10)\n/// [11, 4]\n/// >>> eat(number: 4, need: 8, remaining: 9)\n/// [12, 1]\n/// >>> eat(number: 1, need: 10, remaining: 10)\n/// [11, 0]\n/// >>> eat(number: 2, need: 11, remaining: 5)\n/// [7, 0]\n/// Variables:\n/// @number : integer\n/// the number of carrots that you have eaten.\n/// @need : integer\n/// the number of carrots that you need to eat.\n/// @remaining : integer\n/// the number of remaining carrots thet exist in stock\n/// Constrain:\n/// * 0 <= number <= 1000\n/// * 0 <= need <= 1000\n/// * 0 <= remaining <= 1000\n/// Have fun :)\nfunc eat(number: Int, need: Int, remaining: Int) -> [Int] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(eat(number: 5, need: 6, remaining: 10) == [11, 4])\nassert(eat(number: 4, need: 8, remaining: 9) == [12, 1])\nassert(eat(number: 1, need: 10, remaining: 10) == [11, 0])\nassert(eat(number: 2, need: 11, remaining: 5) == [7, 0])\nassert(eat(number: 4, need: 5, remaining: 7) == [9, 2])\nassert(eat(number: 4, need: 5, remaining: 1) == [5, 0])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "swift", - "prompt": "\n/// Given a positive integer N, return the total sum of its digits in binary.\n/// Example\n/// >>> solve(N: 1000)\n/// \"1\"\n/// >>> solve(N: 150)\n/// \"110\"\n/// >>> solve(N: 147)\n/// \"1100\"\n/// Variables:\n/// @N integer\n/// Constraints: 0 \u2264 N \u2264 10000.\n/// Output:\n/// a string of binary number\nfunc solve(N: Int) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(solve(N: 1000) == \"1\")\nassert(solve(N: 150) == \"110\")\nassert(solve(N: 147) == \"1100\")\nassert(solve(N: 333) == \"1001\")\nassert(solve(N: 963) == \"10010\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "swift", - "prompt": "\n/// You are given a list of integers.\n/// You need to find the largest prime value and return the sum of its digits.\n/// Examples:\n/// >>> skjkasdkd(lst: [0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3])\n/// 10\n/// >>> skjkasdkd(lst: [1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1])\n/// 25\n/// >>> skjkasdkd(lst: [1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3])\n/// 13\n/// >>> skjkasdkd(lst: [0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6])\n/// 11\n/// >>> skjkasdkd(lst: [0, 81, 12, 3, 1, 21])\n/// 3\n/// >>> skjkasdkd(lst: [0, 8, 1, 2, 1, 7])\n/// 7\nfunc skjkasdkd(lst: [Int]) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(skjkasdkd(lst: [0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]) == 10)\nassert(skjkasdkd(lst: [1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]) == 25)\nassert(skjkasdkd(lst: [1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]) == 13)\nassert(skjkasdkd(lst: [0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]) == 11)\nassert(skjkasdkd(lst: [0, 81, 12, 3, 1, 21]) == 3)\nassert(skjkasdkd(lst: [0, 8, 1, 2, 1, 7]) == 7)\nassert(skjkasdkd(lst: [8191]) == 19)\nassert(skjkasdkd(lst: [8191, 123456, 127, 7]) == 19)\nassert(skjkasdkd(lst: [127, 97, 8192]) == 10)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "swift", - "prompt": "\n/// Given an array arr of integers, find the minimum number of elements that\n/// need to be changed to make the array palindromic. A palindromic array is an array that\n/// is read the same backwards and forwards. In one change, you can change one element to any other element.\n/// For example:\n/// >>> smallest_change(arr: [1, 2, 3, 5, 4, 7, 9, 6])\n/// 4\n/// >>> smallest_change(arr: [1, 2, 3, 4, 3, 2, 2])\n/// 1\n/// >>> smallest_change(arr: [1, 2, 3, 2, 1])\n/// 0\nfunc smallest_change(arr: [Int]) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(smallest_change(arr: [1, 2, 3, 5, 4, 7, 9, 6]) == 4)\nassert(smallest_change(arr: [1, 2, 3, 4, 3, 2, 2]) == 1)\nassert(smallest_change(arr: [1, 4, 2]) == 1)\nassert(smallest_change(arr: [1, 4, 4, 2]) == 1)\nassert(smallest_change(arr: [1, 2, 3, 2, 1]) == 0)\nassert(smallest_change(arr: [3, 1, 1, 3]) == 0)\nassert(smallest_change(arr: [1]) == 0)\nassert(smallest_change(arr: [0, 1]) == 1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "swift", - "prompt": "\n/// It is the last week of the semester and the teacher has to give the grades\n/// to students. The teacher has been making her own algorithm for grading.\n/// The only problem is, she has lost the code she used for grading.\n/// She has given you a list of GPAs for some students and you have to write \n/// a function that can output a list of letter grades using the following table:\n/// GPA | Letter grade\n/// 4.0 A+\n/// > 3.7 A \n/// > 3.3 A- \n/// > 3.0 B+\n/// > 2.7 B \n/// > 2.3 B-\n/// > 2.0 C+\n/// > 1.7 C\n/// > 1.3 C-\n/// > 1.0 D+ \n/// > 0.7 D \n/// > 0.0 D-\n/// 0.0 E\n/// Example:\n/// >>> numerical_letter_grade(grades: [4.0, 3, 1.7, 2, 3.5])\n/// [\"A+\", \"B\", \"C-\", \"C\", \"A-\"]\nfunc numerical_letter_grade(grades: [Double]) -> [String] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(numerical_letter_grade(grades: [4.0, 3, 1.7, 2, 3.5]) == [\"A+\", \"B\", \"C-\", \"C\", \"A-\"])\nassert(numerical_letter_grade(grades: [1.2]) == [\"D+\"])\nassert(numerical_letter_grade(grades: [0.5]) == [\"D-\"])\nassert(numerical_letter_grade(grades: [0.0]) == [\"E\"])\nassert(numerical_letter_grade(grades: [1.0, 0.3, 1.5, 2.8, 3.3]) == [\"D\", \"D-\", \"C-\", \"B\", \"B+\"])\nassert(numerical_letter_grade(grades: [0.0, 0.7]) == [\"E\", \"D-\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "swift", - "prompt": "\n/// Given the lengths of the three sides of a triangle. Return the area of\n/// the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n/// Otherwise return -1\n/// Three sides make a valid triangle when the sum of any two sides is greater \n/// than the third side.\n/// Example:\n/// >>> triangle_area(a: 3, b: 4, c: 5)\n/// 6.0\n/// >>> triangle_area(a: 1, b: 2, c: 10)\n/// -1\nfunc triangle_area(a: Int, b: Int, c: Int) -> Double {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(triangle_area(a: 3, b: 4, c: 5) == 6.0)\nassert(triangle_area(a: 1, b: 2, c: 10) == -1)\nassert(triangle_area(a: 4, b: 8, c: 5) == 8.18)\nassert(triangle_area(a: 2, b: 2, c: 2) == 1.73)\nassert(triangle_area(a: 1, b: 2, c: 3) == -1)\nassert(triangle_area(a: 10, b: 5, c: 7) == 16.25)\nassert(triangle_area(a: 2, b: 6, c: 3) == -1)\nassert(triangle_area(a: 1, b: 1, c: 1) == 0.43)\nassert(triangle_area(a: 2, b: 2, c: 10) == -1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "swift", - "prompt": "\n/// Check if two words have the same characters.\n/// >>> same_chars(s0: \"eabcdzzzz\", s1: \"dddzzzzzzzddeddabc\")\n/// true\n/// >>> same_chars(s0: \"abcd\", s1: \"dddddddabc\")\n/// true\n/// >>> same_chars(s0: \"dddddddabc\", s1: \"abcd\")\n/// true\n/// >>> same_chars(s0: \"eabcd\", s1: \"dddddddabc\")\n/// false\n/// >>> same_chars(s0: \"abcd\", s1: \"dddddddabce\")\n/// false\n/// >>> same_chars(s0: \"eabcdzzzz\", s1: \"dddzzzzzzzddddabc\")\n/// false\nfunc same_chars(s0: String, s1: String) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(same_chars(s0: \"eabcdzzzz\", s1: \"dddzzzzzzzddeddabc\") == true)\nassert(same_chars(s0: \"abcd\", s1: \"dddddddabc\") == true)\nassert(same_chars(s0: \"dddddddabc\", s1: \"abcd\") == true)\nassert(same_chars(s0: \"eabcd\", s1: \"dddddddabc\") == false)\nassert(same_chars(s0: \"abcd\", s1: \"dddddddabcf\") == false)\nassert(same_chars(s0: \"eabcdzzzz\", s1: \"dddzzzzzzzddddabc\") == false)\nassert(same_chars(s0: \"aabb\", s1: \"aaccc\") == false)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "swift", - "prompt": "\n/// Given an array of integers nums, find the minimum sum of any non-empty sub-array\n/// of nums.\n/// Example\n/// >>> minSubArraySum(nums: [2, 3, 4, 1, 2, 4])\n/// 1\n/// >>> minSubArraySum(nums: [-1, -2, -3])\n/// -6\nfunc minSubArraySum(nums: [Int]) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(minSubArraySum(nums: [2, 3, 4, 1, 2, 4]) == 1)\nassert(minSubArraySum(nums: [-1, -2, -3]) == -6)\nassert(minSubArraySum(nums: [-1, -2, -3, 2, -10]) == -14)\nassert(minSubArraySum(nums: [-9999999999999999]) == -9999999999999999)\nassert(minSubArraySum(nums: [0, 10, 20, 1000000]) == 0)\nassert(minSubArraySum(nums: [-1, -2, -3, 10, -5]) == -6)\nassert(minSubArraySum(nums: [100, -1, -2, -3, 10, -5]) == -6)\nassert(minSubArraySum(nums: [10, 11, 13, 8, 3, 4]) == 3)\nassert(minSubArraySum(nums: [100, -33, 32, -1, 0, -2]) == -33)\nassert(minSubArraySum(nums: [-10]) == -10)\nassert(minSubArraySum(nums: [7]) == 7)\nassert(minSubArraySum(nums: [1, -1]) == -1)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "swift", - "prompt": "\n/// Given a string s and a natural number n, you have been tasked to implement \n/// a function that returns a list of all words from string s that contain exactly \n/// n consonants, in order these words appear in the string s.\n/// If the string s is empty then the function should return an empty list.\n/// Note: you may assume the input string contains only letters and spaces.\n/// Examples:\n/// >>> select_words(s: \"Mary had a little lamb\", n: 4)\n/// [\"little\"]\n/// >>> select_words(s: \"Mary had a little lamb\", n: 3)\n/// [\"Mary\", \"lamb\"]\n/// >>> select_words(s: \"simple white space\", n: 2)\n/// [] as [String]\n/// >>> select_words(s: \"Hello world\", n: 4)\n/// [\"world\"]\n/// >>> select_words(s: \"Uncle sam\", n: 3)\n/// [\"Uncle\"]\nfunc select_words(s: String, n: Int) -> [String] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(select_words(s: \"Mary had a little lamb\", n: 4) == [\"little\"])\nassert(select_words(s: \"Mary had a little lamb\", n: 3) == [\"Mary\", \"lamb\"])\nassert(select_words(s: \"simple white space\", n: 2) == [] as [String])\nassert(select_words(s: \"Hello world\", n: 4) == [\"world\"])\nassert(select_words(s: \"Uncle sam\", n: 3) == [\"Uncle\"])\nassert(select_words(s: \"\", n: 4) == [] as [String])\nassert(select_words(s: \"a b c d e f\", n: 1) == [\"b\", \"c\", \"d\", \"f\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "swift", - "prompt": "\n/// Return list of all prefixes from shortest to longest of the input string\n/// >>> all_prefixes(string: \"abc\")\n/// [\"a\", \"ab\", \"abc\"]\nfunc all_prefixes(string: String) -> [String] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(all_prefixes(string: \"\") == [] as [String])\nassert(all_prefixes(string: \"asdfgh\") == [\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"])\nassert(all_prefixes(string: \"WWW\") == [\"W\", \"WW\", \"WWW\"])", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "swift", - "prompt": "\n/// Create a function that takes a value (string) representing a number\n/// and returns the closest integer to it. If the number is equidistant\n/// from two integers, round it away from zero.\n/// Examples\n/// >>> closest_integer(value: \"10\")\n/// 10\n/// >>> closest_integer(value: \"15.3\")\n/// 15\n/// Note:\n/// Rounding away from zero means that if the given number is equidistant\n/// from two integers, the one you should return is the one that is the\n/// farthest from zero. For example closest_integer(\"14.5\") should\n/// return 15 and closest_integer(\"-14.5\") should return -15.\nfunc closest_integer(value: String) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(closest_integer(value: \"10\") == 10)\nassert(closest_integer(value: \"14.5\") == 15)\nassert(closest_integer(value: \"-15.5\") == -16)\nassert(closest_integer(value: \"15.3\") == 15)\nassert(closest_integer(value: \"0\") == 0)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "swift", - "prompt": "\n/// Create a function which takes a string representing a file's name, and returns\n/// 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n/// A file's name is considered to be valid if and only if all the following conditions \n/// are met:\n/// - There should not be more than three digits ('0'-'9') in the file's name.\n/// - The file's name contains exactly one dot '.'\n/// - The substring before the dot should not be empty, and it starts with a letter from \n/// the latin alphapet ('a'-'z' and 'A'-'Z').\n/// - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n/// Examples:\n/// >>> file_name_check(file_name: \"example.txt\")\n/// \"Yes\"\n/// >>> file_name_check(file_name: \"1example.dll\")\n/// \"No\"\nfunc file_name_check(file_name: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(file_name_check(file_name: \"example.txt\") == \"Yes\")\nassert(file_name_check(file_name: \"1example.dll\") == \"No\")\nassert(file_name_check(file_name: \"s1sdf3.asd\") == \"No\")\nassert(file_name_check(file_name: \"K.dll\") == \"Yes\")\nassert(file_name_check(file_name: \"MY16FILE3.exe\") == \"Yes\")\nassert(file_name_check(file_name: \"His12FILE94.exe\") == \"No\")\nassert(file_name_check(file_name: \"_Y.txt\") == \"No\")\nassert(file_name_check(file_name: \"?aREYA.exe\") == \"No\")\nassert(file_name_check(file_name: \"/this_is_valid.dll\") == \"No\")\nassert(file_name_check(file_name: \"this_is_valid.wow\") == \"No\")\nassert(file_name_check(file_name: \"this_is_valid.txt\") == \"Yes\")\nassert(file_name_check(file_name: \"this_is_valid.txtexe\") == \"No\")\nassert(file_name_check(file_name: \"#this2_i4s_5valid.ten\") == \"No\")\nassert(file_name_check(file_name: \"@this1_is6_valid.exe\") == \"No\")\nassert(file_name_check(file_name: \"this_is_12valid.6exe4.txt\") == \"No\")\nassert(file_name_check(file_name: \"all.exe.txt\") == \"No\")\nassert(file_name_check(file_name: \"I563_No.exe\") == \"Yes\")\nassert(file_name_check(file_name: \"Is3youfault.txt\") == \"Yes\")\nassert(file_name_check(file_name: \"no_one#knows.dll\") == \"Yes\")\nassert(file_name_check(file_name: \"1I563_Yes3.exe\") == \"No\")\nassert(file_name_check(file_name: \"I563_Yes3.txtt\") == \"No\")\nassert(file_name_check(file_name: \"final..txt\") == \"No\")\nassert(file_name_check(file_name: \"final132\") == \"No\")\nassert(file_name_check(file_name: \"_f4indsartal132.\") == \"No\")\nassert(file_name_check(file_name: \".txt\") == \"No\")\nassert(file_name_check(file_name: \"s.\") == \"No\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "swift", - "prompt": "\n/// You are given two intervals,\n/// where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n/// The given intervals are closed which means that the interval (start, end)\n/// includes both start and end.\n/// For each given interval, it is assumed that its start is less or equal its end.\n/// Your task is to determine whether the length of intersection of these two \n/// intervals is a prime number.\n/// Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n/// which its length is 1, which not a prime number.\n/// If the length of the intersection is a prime number, return \"YES\",\n/// otherwise, return \"NO\".\n/// If the two intervals don't intersect, return \"NO\".\n/// [input/output] samples:\n/// >>> intersection(interval1: (1, 2), interval2: (2, 3))\n/// \"NO\"\n/// >>> intersection(interval1: (-1, 1), interval2: (0, 4))\n/// \"NO\"\n/// >>> intersection(interval1: (-3, -1), interval2: (-5, 5))\n/// \"YES\"\nfunc intersection(interval1: (Int, Int), interval2: (Int, Int)) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(intersection(interval1: (1, 2), interval2: (2, 3)) == \"NO\")\nassert(intersection(interval1: (-1, 1), interval2: (0, 4)) == \"NO\")\nassert(intersection(interval1: (-3, -1), interval2: (-5, 5)) == \"YES\")\nassert(intersection(interval1: (-2, 2), interval2: (-4, 0)) == \"YES\")\nassert(intersection(interval1: (-11, 2), interval2: (-1, -1)) == \"NO\")\nassert(intersection(interval1: (1, 2), interval2: (3, 5)) == \"NO\")\nassert(intersection(interval1: (1, 2), interval2: (1, 2)) == \"NO\")\nassert(intersection(interval1: (-2, -2), interval2: (-3, -2)) == \"NO\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "swift", - "prompt": "\n/// Return the largest prime factor of n. Assume n > 1 and is not a prime.\n/// >>> largest_prime_factor(n: 13195)\n/// 29\n/// >>> largest_prime_factor(n: 2048)\n/// 2\nfunc largest_prime_factor(n: Int) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(largest_prime_factor(n: 15) == 5)\nassert(largest_prime_factor(n: 27) == 3)\nassert(largest_prime_factor(n: 63) == 7)\nassert(largest_prime_factor(n: 330) == 11)\nassert(largest_prime_factor(n: 13195) == 29)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "swift", - "prompt": "\n/// Given a string, find out how many distinct characters (regardless of case) does it consist of\n/// >>> count_distinct_characters(string: \"xyzXYZ\")\n/// 3\n/// >>> count_distinct_characters(string: \"Jerry\")\n/// 4\nfunc count_distinct_characters(string: String) -> Int {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(count_distinct_characters(string: \"\") == 0)\nassert(count_distinct_characters(string: \"abcde\") == 5)\nassert(count_distinct_characters(string: \"abcdecadeCADE\") == 5)\nassert(count_distinct_characters(string: \"aaaaAAAAaaaa\") == 1)\nassert(count_distinct_characters(string: \"Jerry jERRY JeRRRY\") == 5)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "swift", - "prompt": "\n/// You're given a list of deposit and withdrawal operations on a bank account that starts with\n/// zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n/// at that point function should return True. Otherwise it should return False.\n/// >>> below_zero(operations: [1, 2, 3])\n/// false\n/// >>> below_zero(operations: [1, 2, -4, 5])\n/// true\nfunc below_zero(operations: [Int]) -> Bool {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(below_zero(operations: [] as [Int]) == false)\nassert(below_zero(operations: [1, 2, -3, 1, 2, -3]) == false)\nassert(below_zero(operations: [1, 2, -4, 5, 6]) == true)\nassert(below_zero(operations: [1, -1, 2, -2, 5, -5, 4, -4]) == false)\nassert(below_zero(operations: [1, -1, 2, -2, 5, -5, 4, -5]) == true)\nassert(below_zero(operations: [1, -2, 2, -2, 5, -5, 4, -4]) == true)", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "swift", - "prompt": "\n/// Find the shortest palindrome that begins with a supplied string.\n/// Algorithm idea is simple:\n/// - Find the longest postfix of supplied string that is a palindrome.\n/// - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n/// >>> make_palindrome(string: \"\")\n/// \"\"\n/// >>> make_palindrome(string: \"cat\")\n/// \"catac\"\n/// >>> make_palindrome(string: \"cata\")\n/// \"catac\"\nfunc make_palindrome(string: String) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(make_palindrome(string: \"\") == \"\")\nassert(make_palindrome(string: \"x\") == \"x\")\nassert(make_palindrome(string: \"xyz\") == \"xyzyx\")\nassert(make_palindrome(string: \"xyx\") == \"xyx\")\nassert(make_palindrome(string: \"jerry\") == \"jerryrrej\")", - "stop_tokens": [ - "\n}" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "swift", - "prompt": "\n/// Given a positive integer, obtain its roman numeral equivalent as a string,\n/// and return it in lowercase.\n/// Restrictions: 1 <= num <= 1000\n/// Examples:\n/// >>> int_to_mini_roman(number: 19)\n/// \"xix\"\n/// >>> int_to_mini_roman(number: 152)\n/// \"clii\"\n/// >>> int_to_mini_roman(number: 426)\n/// \"cdxxvi\"\nfunc int_to_mini_roman(number: Int) -> String {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "}\n\n\nfunc ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {\n if left.count != right.count {\n return false\n }\n for (l, r) in zip(left, right) {\n if l != r {\n return false\n }\n }\n return true\n}\n \nassert(int_to_mini_roman(number: 19) == \"xix\")\nassert(int_to_mini_roman(number: 152) == \"clii\")\nassert(int_to_mini_roman(number: 251) == \"ccli\")\nassert(int_to_mini_roman(number: 426) == \"cdxxvi\")\nassert(int_to_mini_roman(number: 500) == \"d\")\nassert(int_to_mini_roman(number: 1) == \"i\")\nassert(int_to_mini_roman(number: 4) == \"iv\")\nassert(int_to_mini_roman(number: 43) == \"xliii\")\nassert(int_to_mini_roman(number: 90) == \"xc\")\nassert(int_to_mini_roman(number: 94) == \"xciv\")\nassert(int_to_mini_roman(number: 532) == \"dxxxii\")\nassert(int_to_mini_roman(number: 900) == \"cm\")\nassert(int_to_mini_roman(number: 994) == \"cmxciv\")\nassert(int_to_mini_roman(number: 1000) == \"m\")", - "stop_tokens": [ - "\n}" - ] - } -] \ No newline at end of file diff --git a/data/ts-keep.json b/data/ts-keep.json deleted file mode 100644 index 99f2e34fe843bcaa5b0048ead7da008ae933588a..0000000000000000000000000000000000000000 --- a/data/ts-keep.json +++ /dev/null @@ -1,2387 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "ts", - "prompt": "//For a given number n, find the largest number that divides n evenly, smaller than n\n// >>> largest_divisor(15)\n// 5\nfunction largest_divisor(n: number): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = largest_divisor;\n assert.deepEqual(candidate(3),1);\n assert.deepEqual(candidate(7),1);\n assert.deepEqual(candidate(10),5);\n assert.deepEqual(candidate(100),50);\n assert.deepEqual(candidate(49),7);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_47_median", - "language": "ts", - "prompt": "//Return median of elements in the list l.\n// >>> median([3, 1, 2, 4, 5])\n// 3\n// >>> median([-10, 4, 6, 1000, 10, 20])\n// 15.0\nfunction median(l: number[]): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = median;\n assert.deepEqual(candidate([3, 1, 2, 4, 5]),3);\n assert.deepEqual(candidate([-10, 4, 6, 1000, 10, 20]),8.0);\n assert.deepEqual(candidate([5]),5);\n assert.deepEqual(candidate([6, 5]),5.5);\n assert.deepEqual(candidate([8, 1, 3, 9, 9, 2, 7]),7);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "ts", - "prompt": "//Given two lists operator, and operand. The first list has basic algebra operations, and \n// the second list is a list of integers. Use the two given lists to build the algebric \n// expression and return the evaluation of this expression.\n// The basic algebra operations:\n// Addition ( + ) \n// Subtraction ( - ) \n// Multiplication ( * ) \n// Floor division ( // ) \n// Exponentiation ( ** ) \n// Example:\n// operator['+', '*', '-']\n// array = [2, 3, 4, 5]\n// result = 2 + 3 * 4 - 5\n// => result = 9\n// Note:\n// The length of operator list is equal to the length of operand list minus one.\n// Operand is a list of of non-negative integers.\n// Operator list has at least one operator, and operand list has at least two operands.\nfunction do_algebra(operator: string[], operand: number[]): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = do_algebra;\n assert.deepEqual(candidate([\"**\", \"*\", \"+\"], [2, 3, 4, 5]),37);\n assert.deepEqual(candidate([\"+\", \"*\", \"-\"], [2, 3, 4, 5]),9);\n assert.deepEqual(candidate([\"//\", \"*\"], [7, 3, 4]),8);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "ts", - "prompt": "//Return maximum element in the list.\n// >>> max_element([1, 2, 3])\n// 3\n// >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n// 123\nfunction max_element(l: number[]): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = max_element;\n assert.deepEqual(candidate([1, 2, 3]),3);\n assert.deepEqual(candidate([5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]),124);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "ts", - "prompt": "//Create a function which returns the largest index of an element which\n// is not greater than or equal to the element immediately preceding it. If\n// no such element exists then return -1. The given array will not contain\n// duplicate values.\n// Examples:\n// can_arrange([1,2,4,3,5]) = 3\n// can_arrange([1,2,3]) = -1\nfunction can_arrange(arr: number[]): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = can_arrange;\n assert.deepEqual(candidate([1, 2, 4, 3, 5]),3);\n assert.deepEqual(candidate([1, 2, 4, 5]),-1);\n assert.deepEqual(candidate([1, 4, 2, 5, 6, 7, 8, 9, 10]),2);\n assert.deepEqual(candidate([4, 8, 5, 7, 3]),4);\n assert.deepEqual(candidate([]),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "ts", - "prompt": "//Imagine a road that's a perfectly straight infinitely long line.\n// n cars are driving left to right; simultaneously, a different set of n cars\n// are driving right to left. The two sets of cars start out being very far from\n// each other. All cars move in the same speed. Two cars are said to collide\n// when a car that's moving left to right hits a car that's moving right to left.\n// However, the cars are infinitely sturdy and strong; as a result, they continue moving\n// in their trajectory as if they did not collide.\n// This function outputs the number of such collisions.\nfunction car_race_collision(n: number): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = car_race_collision;\n assert.deepEqual(candidate(2),4);\n assert.deepEqual(candidate(3),9);\n assert.deepEqual(candidate(4),16);\n assert.deepEqual(candidate(8),64);\n assert.deepEqual(candidate(10),100);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "ts", - "prompt": "//Create a function that returns True if the last character\n// of a given string is an alphabetical character and is not\n// a part of a word, and False otherwise.\n// Note: \"word\" is a group of characters separated by space.\n// Examples:\n// check_if_last_char_is_a_letter(\"apple pie\") \u279e False\n// check_if_last_char_is_a_letter(\"apple pi e\") \u279e True\n// check_if_last_char_is_a_letter(\"apple pi e \") \u279e False\n// check_if_last_char_is_a_letter(\"\") \u279e False\nfunction check_if_last_char_is_a_letter(txt: string): boolean {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = check_if_last_char_is_a_letter;\n assert.deepEqual(candidate(\"apple\"),false);\n assert.deepEqual(candidate(\"apple pi e\"),true);\n assert.deepEqual(candidate(\"eeeee\"),false);\n assert.deepEqual(candidate(\"A\"),true);\n assert.deepEqual(candidate(\"Pumpkin pie \"),false);\n assert.deepEqual(candidate(\"Pumpkin pie 1\"),false);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"eeeee e \"),false);\n assert.deepEqual(candidate(\"apple pie\"),false);\n assert.deepEqual(candidate(\"apple pi e \"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "ts", - "prompt": "//Return true if a given number is prime, and false otherwise.\n// >>> is_prime(6)\n// False\n// >>> is_prime(101)\n// True\n// >>> is_prime(11)\n// True\n// >>> is_prime(13441)\n// True\n// >>> is_prime(61)\n// True\n// >>> is_prime(4)\n// False\n// >>> is_prime(1)\n// False\nfunction is_prime(n: number): boolean {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_prime;\n assert.deepEqual(candidate(6),false);\n assert.deepEqual(candidate(101),true);\n assert.deepEqual(candidate(11),true);\n assert.deepEqual(candidate(13441),true);\n assert.deepEqual(candidate(61),true);\n assert.deepEqual(candidate(4),false);\n assert.deepEqual(candidate(1),false);\n assert.deepEqual(candidate(5),true);\n assert.deepEqual(candidate(11),true);\n assert.deepEqual(candidate(17),true);\n assert.deepEqual(candidate(85),false);\n assert.deepEqual(candidate(77),false);\n assert.deepEqual(candidate(255379),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "ts", - "prompt": "//Given a list of positive integers x. return a sorted list of all \n// elements that hasn't any even digit.\n// Note: Returned list should be sorted in increasing order.\n// For example:\n// >>> unique_digits([15, 33, 1422, 1])\n// [1, 15, 33]\n// >>> unique_digits([152, 323, 1422, 10])\n// []\nfunction unique_digits(x: number[]): number[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = unique_digits;\n assert.deepEqual(candidate([15, 33, 1422, 1]),[1, 15, 33]);\n assert.deepEqual(candidate([152, 323, 1422, 10]),[]);\n assert.deepEqual(candidate([12345, 2033, 111, 151]),[111, 151]);\n assert.deepEqual(candidate([135, 103, 31]),[31, 135]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "ts", - "prompt": "//Input are two strings a and b consisting only of 1s and 0s.\n// Perform binary XOR on these inputs and return result also as a string.\n// >>> string_xor('010', '110')\n// '100'\nfunction string_xor(a: string, b: string): string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = string_xor;\n assert.deepEqual(candidate(\"111000\", \"101010\"),\"010010\");\n assert.deepEqual(candidate(\"1\", \"1\"),\"0\");\n assert.deepEqual(candidate(\"0101\", \"0000\"),\"0101\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "ts", - "prompt": "//sum_to_n is a function that sums numbers from 1 to n.\n// >>> sum_to_n(30)\n// 465\n// >>> sum_to_n(100)\n// 5050\n// >>> sum_to_n(5)\n// 15\n// >>> sum_to_n(10)\n// 55\n// >>> sum_to_n(1)\n// 1\nfunction sum_to_n(n: number): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_to_n;\n assert.deepEqual(candidate(1),1);\n assert.deepEqual(candidate(6),21);\n assert.deepEqual(candidate(11),66);\n assert.deepEqual(candidate(30),465);\n assert.deepEqual(candidate(100),5050);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "ts", - "prompt": "//Given a list of numbers, return the sum of squares of the numbers\n// in the list that are odd. Ignore numbers that are negative or not integers.\n// double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10\n// double_the_difference([-1, -2, 0]) == 0\n// double_the_difference([9, -2]) == 81\n// double_the_difference([0]) == 0 \n// If the input list is empty, return 0.\nfunction double_the_difference(lst: number[]): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = double_the_difference;\n assert.deepEqual(candidate([]),0);\n assert.deepEqual(candidate([5.0, 4.0]),25);\n assert.deepEqual(candidate([0.1, 0.2, 0.3]),0);\n assert.deepEqual(candidate([-10.0, -20.0, -30.0]),0);\n assert.deepEqual(candidate([-1.0, -2.0, 8.0]),0);\n assert.deepEqual(candidate([0.2, 3.0, 5.0]),34);\n assert.deepEqual(candidate([-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]),165);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "ts", - "prompt": "//Return length of given string\n// >>> strlen('')\n// 0\n// >>> strlen('abc')\n// 3\nfunction strlen(string: string): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = strlen;\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"x\"),1);\n assert.deepEqual(candidate(\"asdasnakj\"),9);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "ts", - "prompt": "//You'll be given a string of words, and your task is to count the number\n// of boredoms. A boredom is a sentence that starts with the word \"I\".\n// Sentences are delimited by '.', '?' or '!'.\n// For example:\n// >>> is_bored(\"Hello world\")\n// 0\n// >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n// 1\nfunction is_bored(S: string): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_bored;\n assert.deepEqual(candidate(\"Hello world\"),0);\n assert.deepEqual(candidate(\"Is the sky blue?\"),0);\n assert.deepEqual(candidate(\"I love It !\"),1);\n assert.deepEqual(candidate(\"bIt\"),0);\n assert.deepEqual(candidate(\"I feel good today. I will be productive. will kill It\"),2);\n assert.deepEqual(candidate(\"You and I are going for a walk\"),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "ts", - "prompt": "//Write a function vowels_count which takes a string representing\n// a word as input and returns the number of vowels in the string.\n// Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n// vowel, but only when it is at the end of the given word.\n// Example:\n// >>> vowels_count(\"abcde\")\n// 2\n// >>> vowels_count(\"ACEDY\")\n// 3\nfunction vowels_count(s: string): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = vowels_count;\n assert.deepEqual(candidate(\"abcde\"),2);\n assert.deepEqual(candidate(\"Alone\"),3);\n assert.deepEqual(candidate(\"key\"),2);\n assert.deepEqual(candidate(\"bye\"),1);\n assert.deepEqual(candidate(\"keY\"),2);\n assert.deepEqual(candidate(\"bYe\"),1);\n assert.deepEqual(candidate(\"ACEDY\"),3);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "ts", - "prompt": "//Return n-th Fibonacci number.\n// >>> fib(10)\n// 55\n// >>> fib(1)\n// 1\n// >>> fib(8)\n// 21\nfunction fib(n: number): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fib;\n assert.deepEqual(candidate(10),55);\n assert.deepEqual(candidate(1),1);\n assert.deepEqual(candidate(8),21);\n assert.deepEqual(candidate(11),89);\n assert.deepEqual(candidate(12),144);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "ts", - "prompt": "//Your task is to implement a function that will simplify the expression\n// x * n. The function returns True if x * n evaluates to a whole number and False\n// otherwise. Both x and n, are string representation of a fraction, and have the following format,\n// / where both numerator and denominator are positive whole numbers.\n// You can assume that x, and n are valid fractions, and do not have zero as denominator.\n// simplify(\"1/5\", \"5/1\") = True\n// simplify(\"1/6\", \"2/1\") = False\n// simplify(\"7/10\", \"10/2\") = False\nfunction simplify(x: string, n: string): boolean {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = simplify;\n assert.deepEqual(candidate(\"1/5\", \"5/1\"),true);\n assert.deepEqual(candidate(\"1/6\", \"2/1\"),false);\n assert.deepEqual(candidate(\"5/1\", \"3/1\"),true);\n assert.deepEqual(candidate(\"7/10\", \"10/2\"),false);\n assert.deepEqual(candidate(\"2/10\", \"50/10\"),true);\n assert.deepEqual(candidate(\"7/2\", \"4/2\"),true);\n assert.deepEqual(candidate(\"11/6\", \"6/1\"),true);\n assert.deepEqual(candidate(\"2/3\", \"5/2\"),false);\n assert.deepEqual(candidate(\"5/2\", \"3/5\"),false);\n assert.deepEqual(candidate(\"2/4\", \"8/4\"),true);\n assert.deepEqual(candidate(\"2/4\", \"4/2\"),true);\n assert.deepEqual(candidate(\"1/5\", \"5/1\"),true);\n assert.deepEqual(candidate(\"1/5\", \"1/5\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "ts", - "prompt": "//Given a string s, count the number of uppercase vowels in even indices.\n// For example:\n// count_upper('aBCdEf') returns 1\n// count_upper('abcdefg') returns 0\n// count_upper('dBBE') returns 0\nfunction count_upper(s: string): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_upper;\n assert.deepEqual(candidate(\"aBCdEf\"),1);\n assert.deepEqual(candidate(\"abcdefg\"),0);\n assert.deepEqual(candidate(\"dBBE\"),0);\n assert.deepEqual(candidate(\"B\"),0);\n assert.deepEqual(candidate(\"U\"),1);\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"EEEE\"),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "ts", - "prompt": "//You are given a rectangular grid of wells. Each row represents a single well,\n// and each 1 in a row represents a single unit of water.\n// Each well has a corresponding bucket that can be used to extract water from it, \n// and all buckets have the same capacity.\n// Your task is to use the buckets to empty the wells.\n// Output the number of times you need to lower the buckets.\n// Example 1:\n// Input: \n// grid : [[0,0,1,0], [0,1,0,0], [1,1,1,1]]\n// bucket_capacity : 1\n// Output: 6\n// Example 2:\n// Input: \n// grid : [[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]]\n// bucket_capacity : 2\n// Output: 5\n// Example 3:\n// Input: \n// grid : [[0,0,0], [0,0,0]]\n// bucket_capacity : 5\n// Output: 0\n// Constraints:\n// * all wells have the same length\n// * 1 <= grid.length <= 10^2\n// * 1 <= grid[:,1].length <= 10^2\n// * grid[i][j] -> 0 | 1\n// * 1 <= capacity <= 10\nfunction max_fill(grid: number[][], capacity: number): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = max_fill;\n assert.deepEqual(candidate([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1),6);\n assert.deepEqual(candidate([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2),5);\n assert.deepEqual(candidate([[0, 0, 0], [0, 0, 0]], 5),0);\n assert.deepEqual(candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 2),4);\n assert.deepEqual(candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 9),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "ts", - "prompt": "//Given an array arr of integers and a positive integer k, return a sorted list \n// of length k with the maximum k numbers in arr.\n// Example 1:\n// Input: arr = [-3, -4, 5], k = 3\n// Output: [-4, -3, 5]\n// Example 2:\n// Input: arr = [4, -4, 4], k = 2\n// Output: [4, 4]\n// Example 3:\n// Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1\n// Output: [2]\n// Note:\n// 1. The length of the array will be in the range of [1, 1000].\n// 2. The elements in the array will be in the range of [-1000, 1000].\n// 3. 0 <= k <= len(arr)\nfunction maximum(arr: number[], k: number): number[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = maximum;\n assert.deepEqual(candidate([-3, -4, 5], 3),[-4, -3, 5]);\n assert.deepEqual(candidate([4, -4, 4], 2),[4, 4]);\n assert.deepEqual(candidate([-3, 2, 1, 2, -1, -2, 1], 1),[2]);\n assert.deepEqual(candidate([123, -123, 20, 0, 1, 2, -3], 3),[2, 20, 123]);\n assert.deepEqual(candidate([-123, 20, 0, 1, 2, -3], 4),[0, 1, 2, 20]);\n assert.deepEqual(candidate([5, 15, 0, 3, -13, -8, 0], 7),[-13, -8, 0, 0, 3, 5, 15]);\n assert.deepEqual(candidate([-1, 0, 2, 5, 3, -10], 2),[3, 5]);\n assert.deepEqual(candidate([1, 0, 5, -7], 1),[5]);\n assert.deepEqual(candidate([4, -4], 2),[-4, 4]);\n assert.deepEqual(candidate([-10, 10], 2),[-10, 10]);\n assert.deepEqual(candidate([1, 2, 3, -23, 243, -400, 0], 0),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "ts", - "prompt": "//Write a function that takes a message, and encodes in such a \n// way that it swaps case of all letters, replaces all vowels in \n// the message with the letter that appears 2 places ahead of that \n// vowel in the english alphabet. \n// Assume only letters. \n// Examples:\n// >>> encode('test')\n// 'TGST'\n// >>> encode('This is a message')\n// 'tHKS KS C MGSSCGG'\nfunction encode(message: string): string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = encode;\n assert.deepEqual(candidate(\"TEST\"),\"tgst\");\n assert.deepEqual(candidate(\"Mudasir\"),\"mWDCSKR\");\n assert.deepEqual(candidate(\"YES\"),\"ygs\");\n assert.deepEqual(candidate(\"This is a message\"),\"tHKS KS C MGSSCGG\");\n assert.deepEqual(candidate(\"I DoNt KnOw WhAt tO WrItE\"),\"k dQnT kNqW wHcT Tq wRkTg\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "ts", - "prompt": "//remove_vowels is a function that takes string and returns string without vowels.\n// >>> remove_vowels('')\n// ''\n// >>> remove_vowels('abcdef')\n// 'bcdf'\n// >>> remove_vowels('aaaaa')\n// ''\n// >>> remove_vowels('aaBAA')\n// 'B'\n// >>> remove_vowels('zbcd')\n// 'zbcd'\nfunction remove_vowels(text: string): string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = remove_vowels;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"abcdef\\nghijklm\"),\"bcdf\\nghjklm\");\n assert.deepEqual(candidate(\"fedcba\"),\"fdcb\");\n assert.deepEqual(candidate(\"eeeee\"),\"\");\n assert.deepEqual(candidate(\"acBAA\"),\"cB\");\n assert.deepEqual(candidate(\"EcBOO\"),\"cB\");\n assert.deepEqual(candidate(\"ybcd\"),\"ybcd\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "ts", - "prompt": "//Return only positive numbers in the list.\n// >>> get_positive([-1, 2, -4, 5, 6])\n// [2, 5, 6]\n// >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n// [5, 3, 2, 3, 9, 123, 1]\nfunction get_positive(l: number[]): number[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_positive;\n assert.deepEqual(candidate([-1, -2, 4, 5, 6]),[4, 5, 6]);\n assert.deepEqual(candidate([5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]),[5, 3, 2, 3, 3, 9, 123, 1]);\n assert.deepEqual(candidate([-1, -2]),[]);\n assert.deepEqual(candidate([]),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "ts", - "prompt": "//Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n// >>> string_sequence(0)\n// '0'\n// >>> string_sequence(5)\n// '0 1 2 3 4 5'\nfunction string_sequence(n: number): string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = string_sequence;\n assert.deepEqual(candidate(0),\"0\");\n assert.deepEqual(candidate(3),\"0 1 2 3\");\n assert.deepEqual(candidate(10),\"0 1 2 3 4 5 6 7 8 9 10\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "ts", - "prompt": "//Given a positive integer n, you have to make a pile of n levels of stones.\n// The first level has n stones.\n// The number of stones in the next level is:\n// - the next odd number if n is odd.\n// - the next even number if n is even.\n// Return the number of stones in each level in a list, where element at index\n// i represents the number of stones in the level (i+1).\n// Examples:\n// >>> make_a_pile(3)\n// [3, 5, 7]\nfunction make_a_pile(n: number): number[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = make_a_pile;\n assert.deepEqual(candidate(3),[3, 5, 7]);\n assert.deepEqual(candidate(4),[4, 6, 8, 10]);\n assert.deepEqual(candidate(5),[5, 7, 9, 11, 13]);\n assert.deepEqual(candidate(6),[6, 8, 10, 12, 14, 16]);\n assert.deepEqual(candidate(8),[8, 10, 12, 14, 16, 18, 20, 22]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "ts", - "prompt": "//Task\n// 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\n// then check if the result string is palindrome.\n// A string is called palindrome if it reads the same backward as forward.\n// You should return a tuple containing the result string and True/False for the check.\n// Example\n// For s = \"abcde\", c = \"ae\", the result should be ('bcd',False)\n// For s = \"abcdef\", c = \"b\" the result should be ('acdef',False)\n// For s = \"abcdedcba\", c = \"ab\", the result should be ('cdedc',True)\nfunction reverse_delete(s: string, c: string): [string, boolean] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = reverse_delete;\n assert.deepEqual(candidate(\"abcde\", \"ae\"),[\"bcd\", false]);\n assert.deepEqual(candidate(\"abcdef\", \"b\"),[\"acdef\", false]);\n assert.deepEqual(candidate(\"abcdedcba\", \"ab\"),[\"cdedc\", true]);\n assert.deepEqual(candidate(\"dwik\", \"w\"),[\"dik\", false]);\n assert.deepEqual(candidate(\"a\", \"a\"),[\"\", true]);\n assert.deepEqual(candidate(\"abcdedcba\", \"\"),[\"abcdedcba\", true]);\n assert.deepEqual(candidate(\"abcdedcba\", \"v\"),[\"abcdedcba\", true]);\n assert.deepEqual(candidate(\"vabba\", \"v\"),[\"abba\", true]);\n assert.deepEqual(candidate(\"mamma\", \"mia\"),[\"\", true]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "ts", - "prompt": "//For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n// >>> flip_case('Hello')\n// 'hELLO'\nfunction flip_case(string: string): string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = flip_case;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"Hello!\"),\"hELLO!\");\n assert.deepEqual(candidate(\"These violent delights have violent ends\"),\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "ts", - "prompt": "//You are given a string s.\n// if s[i] is a letter, reverse its case from lower to upper or vise versa, \n// otherwise keep it as it is.\n// If the string contains no letters, reverse the string.\n// The function should return the resulted string.\n// Examples\n// solve(\"1234\") = \"4321\"\n// solve(\"ab\") = \"AB\"\n// solve(\"#a@C\") = \"#A@c\"\nfunction solve(s: string): string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = solve;\n assert.deepEqual(candidate(\"AsDf\"),\"aSdF\");\n assert.deepEqual(candidate(\"1234\"),\"4321\");\n assert.deepEqual(candidate(\"ab\"),\"AB\");\n assert.deepEqual(candidate(\"#a@C\"),\"#A@c\");\n assert.deepEqual(candidate(\"#AsdfW^45\"),\"#aSDFw^45\");\n assert.deepEqual(candidate(\"#6@2\"),\"2@6#\");\n assert.deepEqual(candidate(\"#$a^D\"),\"#$A^d\");\n assert.deepEqual(candidate(\"#ccc\"),\"#CCC\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "ts", - "prompt": "//Filter an input list of strings only for ones that start with a given prefix.\n// >>> filter_by_prefix([], 'a')\n// []\n// >>> filter_by_prefix(['abc', 'bcd', 'cde', 'array'], 'a')\n// ['abc', 'array']\nfunction filter_by_prefix(strings: string[], prefix: string): string[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = filter_by_prefix;\n assert.deepEqual(candidate([], \"john\"),[]);\n assert.deepEqual(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"),[\"xxx\", \"xxxAAA\", \"xxx\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "ts", - "prompt": "//This function takes two positive numbers x and y and returns the\n// biggest even integer number that is in the range [x, y] inclusive. If \n// there's no such number, then the function should return -1.\n// For example:\n// choose_num(12, 15) = 14\n// choose_num(13, 12) = -1\nfunction choose_num(x: number, y: number): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = choose_num;\n assert.deepEqual(candidate(12, 15),14);\n assert.deepEqual(candidate(13, 12),-1);\n assert.deepEqual(candidate(33, 12354),12354);\n assert.deepEqual(candidate(5234, 5233),-1);\n assert.deepEqual(candidate(6, 29),28);\n assert.deepEqual(candidate(27, 10),-1);\n assert.deepEqual(candidate(7, 7),-1);\n assert.deepEqual(candidate(546, 546),546);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "ts", - "prompt": "//You are given a string representing a sentence,\n// the sentence contains some words separated by a space,\n// and you have to return a string that contains the words from the original sentence,\n// whose lengths are prime numbers,\n// the order of the words in the new string should be the same as the original one.\n// Example 1:\n// Input: sentence = \"This is a test\"\n// Output: \"is\"\n// Example 2:\n// Input: sentence = \"lets go for swimming\"\n// Output: \"go for\"\n// Constraints:\n// * 1 <= len(sentence) <= 100\n// * sentence contains only letters\nfunction words_in_sentence(sentence: string): string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = words_in_sentence;\n assert.deepEqual(candidate(\"This is a test\"),\"is\");\n assert.deepEqual(candidate(\"lets go for swimming\"),\"go for\");\n assert.deepEqual(candidate(\"there is no place available here\"),\"there is no place\");\n assert.deepEqual(candidate(\"Hi I am Hussein\"),\"Hi am Hussein\");\n assert.deepEqual(candidate(\"go for it\"),\"go for it\");\n assert.deepEqual(candidate(\"here\"),\"\");\n assert.deepEqual(candidate(\"here is\"),\"is\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "ts", - "prompt": "//Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n// >>> intersperse([], 4)\n// []\n// >>> intersperse([1, 2, 3], 4)\n// [1, 4, 2, 4, 3]\nfunction intersperse(numbers: number[], delimeter: number): number[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = intersperse;\n assert.deepEqual(candidate([], 7),[]);\n assert.deepEqual(candidate([5, 6, 3, 2], 8),[5, 8, 6, 8, 3, 8, 2]);\n assert.deepEqual(candidate([2, 2, 2], 2),[2, 2, 2, 2, 2]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "ts", - "prompt": "//Your task is to write a function that returns true if a number x is a simple\n// power of n and false in other cases.\n// x is a simple power of n if n**int=x\n// For example:\n// is_simple_power(1, 4) => true\n// is_simple_power(2, 2) => true\n// is_simple_power(8, 2) => true\n// is_simple_power(3, 2) => false\n// is_simple_power(3, 1) => false\n// is_simple_power(5, 3) => false\nfunction is_simple_power(x: number, n: number): boolean {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_simple_power;\n assert.deepEqual(candidate(16, 2),true);\n assert.deepEqual(candidate(143214, 16),false);\n assert.deepEqual(candidate(4, 2),true);\n assert.deepEqual(candidate(9, 3),true);\n assert.deepEqual(candidate(16, 4),true);\n assert.deepEqual(candidate(24, 2),false);\n assert.deepEqual(candidate(128, 4),false);\n assert.deepEqual(candidate(12, 6),false);\n assert.deepEqual(candidate(1, 1),true);\n assert.deepEqual(candidate(1, 12),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "ts", - "prompt": "//Write a function that returns true if the given number is the multiplication of 3 prime numbers\n// and false otherwise.\n// Knowing that (a) is less then 100. \n// Example:\n// is_multiply_prime(30) == True\n// 30 = 2 * 3 * 5\nfunction is_multiply_prime(a: number): boolean {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_multiply_prime;\n assert.deepEqual(candidate(5),false);\n assert.deepEqual(candidate(30),true);\n assert.deepEqual(candidate(8),true);\n assert.deepEqual(candidate(10),false);\n assert.deepEqual(candidate(125),true);\n assert.deepEqual(candidate(105),true);\n assert.deepEqual(candidate(126),false);\n assert.deepEqual(candidate(729),false);\n assert.deepEqual(candidate(891),false);\n assert.deepEqual(candidate(1001),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "ts", - "prompt": "//Given the lengths of the three sides of a triangle. Return True if the three\n// sides form a right-angled triangle, False otherwise.\n// A right-angled triangle is a triangle in which one angle is right angle or \n// 90 degree.\n// Example:\n// right_angle_triangle(3, 4, 5) == True\n// right_angle_triangle(1, 2, 3) == False\nfunction right_angle_triangle(a: number, b: number, c: number): boolean {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = right_angle_triangle;\n assert.deepEqual(candidate(3, 4, 5),true);\n assert.deepEqual(candidate(1, 2, 3),false);\n assert.deepEqual(candidate(10, 6, 8),true);\n assert.deepEqual(candidate(2, 2, 2),false);\n assert.deepEqual(candidate(7, 24, 25),true);\n assert.deepEqual(candidate(10, 5, 7),false);\n assert.deepEqual(candidate(5, 12, 13),true);\n assert.deepEqual(candidate(15, 8, 17),true);\n assert.deepEqual(candidate(48, 55, 73),true);\n assert.deepEqual(candidate(1, 1, 1),false);\n assert.deepEqual(candidate(2, 2, 10),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "ts", - "prompt": "//Create a function that takes 3 numbers.\n// Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n// Returns false in any other cases.\n// Examples\n// any_int(5, 2, 7) \u279e True\n// any_int(3, 2, 2) \u279e False\n// any_int(3, -2, 1) \u279e True\n// any_int(3.6, -2.2, 2) \u279e False\nfunction any_int(x: number, y: number, z: number): boolean {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = any_int;\n assert.deepEqual(candidate(2, 3, 1),true);\n assert.deepEqual(candidate(2.5, 2, 3),false);\n assert.deepEqual(candidate(1.5, 5, 3.5),false);\n assert.deepEqual(candidate(2, 6, 2),false);\n assert.deepEqual(candidate(4, 2, 2),true);\n assert.deepEqual(candidate(2.2, 2.2, 2.2),false);\n assert.deepEqual(candidate(-4, 6, 2),true);\n assert.deepEqual(candidate(2, 1, 1),true);\n assert.deepEqual(candidate(3, 4, 7),true);\n assert.deepEqual(candidate(3.0, 4, 7),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "ts", - "prompt": "//This function takes a list l and returns a list l' such that\n// l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n// to the values of the corresponding indicies of l, but sorted.\n// >>> sort_third([1, 2, 3])\n// [1, 2, 3]\n// >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n// [2, 6, 3, 4, 8, 9, 5]\nfunction sort_third(l: number[]): number[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_third;\n assert.deepEqual(candidate([5, 6, 3, 4, 8, 9, 2]),[2, 6, 3, 4, 8, 9, 5]);\n assert.deepEqual(candidate([5, 8, 3, 4, 6, 9, 2]),[2, 8, 3, 4, 6, 9, 5]);\n assert.deepEqual(candidate([5, 6, 9, 4, 8, 3, 2]),[2, 6, 9, 4, 8, 3, 5]);\n assert.deepEqual(candidate([5, 6, 3, 4, 8, 9, 2, 1]),[2, 6, 3, 4, 8, 9, 5, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_53_add", - "language": "ts", - "prompt": "//Add two numbers x and y\n// >>> add(2, 3)\n// 5\n// >>> add(5, 7)\n// 12\nfunction add(x: number, y: number): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = add;\n assert.deepEqual(candidate(0, 1),1);\n assert.deepEqual(candidate(1, 0),1);\n assert.deepEqual(candidate(2, 3),5);\n assert.deepEqual(candidate(5, 7),12);\n assert.deepEqual(candidate(7, 5),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_69_search", - "language": "ts", - "prompt": "//You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n// zero, and has a frequency greater than or equal to the value of the integer itself. \n// The frequency of an integer is the number of times it appears in the list.\n// If no such a value exist, return -1.\n// Examples:\n// search([4, 1, 2, 2, 3, 1]) == 2\n// search([1, 2, 2, 3, 3, 3, 4, 4, 4]) == 3\n// search([5, 5, 4, 4, 4]) == -1\nfunction search(lst: number[]): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = search;\n assert.deepEqual(candidate([5, 5, 5, 5, 1]),1);\n assert.deepEqual(candidate([4, 1, 4, 1, 4, 4]),4);\n assert.deepEqual(candidate([3, 3]),-1);\n assert.deepEqual(candidate([8, 8, 8, 8, 8, 8, 8, 8]),8);\n assert.deepEqual(candidate([2, 3, 3, 2, 2]),2);\n assert.deepEqual(candidate([2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]),1);\n assert.deepEqual(candidate([3, 2, 8, 2]),2);\n assert.deepEqual(candidate([6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]),1);\n assert.deepEqual(candidate([8, 8, 3, 6, 5, 6, 4]),-1);\n assert.deepEqual(candidate([6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]),1);\n assert.deepEqual(candidate([1, 9, 10, 1, 3]),1);\n assert.deepEqual(candidate([6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]),5);\n assert.deepEqual(candidate([1]),1);\n assert.deepEqual(candidate([8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]),4);\n assert.deepEqual(candidate([2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]),2);\n assert.deepEqual(candidate([1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]),1);\n assert.deepEqual(candidate([9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]),4);\n assert.deepEqual(candidate([2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]),4);\n assert.deepEqual(candidate([9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]),2);\n assert.deepEqual(candidate([5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]),-1);\n assert.deepEqual(candidate([10]),-1);\n assert.deepEqual(candidate([9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]),2);\n assert.deepEqual(candidate([5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]),1);\n assert.deepEqual(candidate([7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]),1);\n assert.deepEqual(candidate([3, 10, 10, 9, 2]),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "ts", - "prompt": "//Write a function that takes a string and returns True if the string\n// length is a prime number or False otherwise\n// Examples\n// prime_length('Hello') == True\n// prime_length('abcdcba') == True\n// prime_length('kittens') == True\n// prime_length('orange') == False\nfunction prime_length(string: string): boolean {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = prime_length;\n assert.deepEqual(candidate(\"Hello\"),true);\n assert.deepEqual(candidate(\"abcdcba\"),true);\n assert.deepEqual(candidate(\"kittens\"),true);\n assert.deepEqual(candidate(\"orange\"),false);\n assert.deepEqual(candidate(\"wow\"),true);\n assert.deepEqual(candidate(\"world\"),true);\n assert.deepEqual(candidate(\"MadaM\"),true);\n assert.deepEqual(candidate(\"Wow\"),true);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"HI\"),true);\n assert.deepEqual(candidate(\"go\"),true);\n assert.deepEqual(candidate(\"gogo\"),false);\n assert.deepEqual(candidate(\"aaaaaaaaaaaaaaa\"),false);\n assert.deepEqual(candidate(\"Madam\"),true);\n assert.deepEqual(candidate(\"M\"),false);\n assert.deepEqual(candidate(\"0\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_58_common", - "language": "ts", - "prompt": "//Return sorted unique common elements for two lists.\n// >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n// [1, 5, 653]\n// >>> common([5, 3, 2, 8], [3, 2])\n// [2, 3]\nfunction common(l1: number[], l2: number[]): number[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = common;\n assert.deepEqual(candidate([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]),[1, 5, 653]);\n assert.deepEqual(candidate([5, 3, 2, 8], [3, 2]),[2, 3]);\n assert.deepEqual(candidate([4, 3, 2, 8], [3, 2, 4]),[2, 3, 4]);\n assert.deepEqual(candidate([4, 3, 2, 8], []),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "ts", - "prompt": "//The Brazilian factorial is defined as:\n// brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n// where n > 0\n// For example:\n// >>> special_factorial(4)\n// 288\n// The function will receive an integer as input and should return the special\n// factorial of this integer.\nfunction special_factorial(n: number): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = special_factorial;\n assert.deepEqual(candidate(4),288);\n assert.deepEqual(candidate(5),34560);\n assert.deepEqual(candidate(7),125411328000);\n assert.deepEqual(candidate(1),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "ts", - "prompt": "//In this problem, you will implement a function that takes two lists of numbers,\n// and determines whether it is possible to perform an exchange of elements\n// between them to make lst1 a list of only even numbers.\n// There is no limit on the number of exchanged elements between lst1 and lst2.\n// If it is possible to exchange elements between the lst1 and lst2 to make\n// all the elements of lst1 to be even, return \"YES\".\n// Otherwise, return \"NO\".\n// For example:\n// exchange([1, 2, 3, 4], [1, 2, 3, 4]) => \"YES\"\n// exchange([1, 2, 3, 4], [1, 5, 3, 4]) => \"NO\"\n// It is assumed that the input lists will be non-empty.\nfunction exchange(lst1: number[], lst2: number[]): string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = exchange;\n assert.deepEqual(candidate([1, 2, 3, 4], [1, 2, 3, 4]),\"YES\");\n assert.deepEqual(candidate([1, 2, 3, 4], [1, 5, 3, 4]),\"NO\");\n assert.deepEqual(candidate([1, 2, 3, 4], [2, 1, 4, 3]),\"YES\");\n assert.deepEqual(candidate([5, 7, 3], [2, 6, 4]),\"YES\");\n assert.deepEqual(candidate([5, 7, 3], [2, 6, 3]),\"NO\");\n assert.deepEqual(candidate([3, 2, 6, 1, 8, 9], [3, 5, 5, 1, 1, 1]),\"NO\");\n assert.deepEqual(candidate([100, 200], [200, 200]),\"YES\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "ts", - "prompt": "//Given a non-empty array of integers arr and an integer k, return\n// the sum of the elements with at most two digits from the first k elements of arr.\n// Example:\n// Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4\n// Output: 24 # sum of 21 + 3\n// Constraints:\n// 1. 1 <= len(arr) <= 100\n// 2. 1 <= k <= len(arr)\nfunction add_elements(arr: number[], k: number): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = add_elements;\n assert.deepEqual(candidate([1, -2, -3, 41, 57, 76, 87, 88, 99], 3),-4);\n assert.deepEqual(candidate([111, 121, 3, 4000, 5, 6], 2),0);\n assert.deepEqual(candidate([11, 21, 3, 90, 5, 6, 7, 8, 9], 4),125);\n assert.deepEqual(candidate([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4),24);\n assert.deepEqual(candidate([1], 1),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "ts", - "prompt": "//A simple program which should return the value of x if n is \n// a prime number and should return the value of y otherwise.\n// Examples:\n// for x_or_y(7, 34, 12) == 34\n// for x_or_y(15, 8, 5) == 5\nfunction x_or_y(n: number, x: number, y: number): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = x_or_y;\n assert.deepEqual(candidate(7, 34, 12),34);\n assert.deepEqual(candidate(15, 8, 5),5);\n assert.deepEqual(candidate(3, 33, 5212),33);\n assert.deepEqual(candidate(1259, 3, 52),3);\n assert.deepEqual(candidate(7919, -1, 12),-1);\n assert.deepEqual(candidate(3609, 1245, 583),583);\n assert.deepEqual(candidate(91, 56, 129),129);\n assert.deepEqual(candidate(6, 34, 1234),1234);\n assert.deepEqual(candidate(1, 2, 0),0);\n assert.deepEqual(candidate(2, 2, 0),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "ts", - "prompt": "//Given length of a side and high return area for a triangle.\n// >>> triangle_area(5, 3)\n// 7.5\nfunction triangle_area(a: number, h: number): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = triangle_area;\n assert.deepEqual(candidate(5, 3),7.5);\n assert.deepEqual(candidate(2, 2),2.0);\n assert.deepEqual(candidate(10, 8),40.0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "ts", - "prompt": "//Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n// the last couple centuries. However, what people don't know is Tribonacci sequence.\n// Tribonacci sequence is defined by the recurrence:\n// tri(1) = 3\n// tri(n) = 1 + n / 2, if n is even.\n// tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n// For example:\n// tri(2) = 1 + (2 / 2) = 2\n// tri(4) = 3\n// tri(3) = tri(2) + tri(1) + tri(4)\n// = 2 + 3 + 3 = 8 \n// You are given a non-negative integer number n, you have to a return a list of the \n// first n + 1 numbers of the Tribonacci sequence.\n// Examples:\n// tri(3) = [1, 3, 2, 8]\nfunction tri(n: number): number[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = tri;\n assert.deepEqual(candidate(3),[1, 3, 2, 8]);\n assert.deepEqual(candidate(4),[1, 3, 2, 8, 3]);\n assert.deepEqual(candidate(5),[1, 3, 2, 8, 3, 15]);\n assert.deepEqual(candidate(6),[1, 3, 2, 8, 3, 15, 4]);\n assert.deepEqual(candidate(7),[1, 3, 2, 8, 3, 15, 4, 24]);\n assert.deepEqual(candidate(8),[1, 3, 2, 8, 3, 15, 4, 24, 5]);\n assert.deepEqual(candidate(9),[1, 3, 2, 8, 3, 15, 4, 24, 5, 35]);\n assert.deepEqual(candidate(20),[1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11]);\n assert.deepEqual(candidate(0),[1]);\n assert.deepEqual(candidate(1),[1, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "ts", - "prompt": "//You are given a list of two strings, both strings consist of open\n// parentheses '(' or close parentheses ')' only.\n// Your job is to check if it is possible to concatenate the two strings in\n// some order, that the resulting string will be good.\n// A string S is considered to be good if and only if all parentheses in S\n// are balanced. For example: the string '(())()' is good, while the string\n// '())' is not.\n// Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n// Examples:\n// match_parens(['()(', ')']) == 'Yes'\n// match_parens([')', ')']) == 'No'\nfunction match_parens(lst: string[]): string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = match_parens;\n assert.deepEqual(candidate([\"()(\", \")\"]),\"Yes\");\n assert.deepEqual(candidate([\")\", \")\"]),\"No\");\n assert.deepEqual(candidate([\"(()(())\", \"())())\"]),\"No\");\n assert.deepEqual(candidate([\")())\", \"(()()(\"]),\"Yes\");\n assert.deepEqual(candidate([\"(())))\", \"(()())((\"]),\"Yes\");\n assert.deepEqual(candidate([\"()\", \"())\"]),\"No\");\n assert.deepEqual(candidate([\"(()(\", \"()))()\"]),\"Yes\");\n assert.deepEqual(candidate([\"((((\", \"((())\"]),\"No\");\n assert.deepEqual(candidate([\")(()\", \"(()(\"]),\"No\");\n assert.deepEqual(candidate([\")(\", \")(\"]),\"No\");\n assert.deepEqual(candidate([\"(\", \")\"]),\"Yes\");\n assert.deepEqual(candidate([\")\", \"(\"]),\"Yes\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "ts", - "prompt": "//From a list of integers, remove all elements that occur more than once.\n// Keep order of elements left the same as in the input.\n// >>> remove_duplicates([1, 2, 3, 2, 4])\n// [1, 3, 4]\nfunction remove_duplicates(numbers: number[]): number[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = remove_duplicates;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, 2, 3, 4]),[1, 2, 3, 4]);\n assert.deepEqual(candidate([1, 2, 3, 2, 4, 3, 5]),[1, 4, 5]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "ts", - "prompt": "//Return a greatest common divisor of two integers a and b\n// >>> greatest_common_divisor(3, 5)\n// 1\n// >>> greatest_common_divisor(25, 15)\n// 5\nfunction greatest_common_divisor(a: number, b: number): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = greatest_common_divisor;\n assert.deepEqual(candidate(3, 7),1);\n assert.deepEqual(candidate(10, 15),5);\n assert.deepEqual(candidate(49, 14),7);\n assert.deepEqual(candidate(144, 60),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "ts", - "prompt": "//Checks if given string is a palindrome\n// >>> is_palindrome('')\n// True\n// >>> is_palindrome('aba')\n// True\n// >>> is_palindrome('aaaaa')\n// True\n// >>> is_palindrome('zbcd')\n// False\nfunction is_palindrome(text: string): boolean {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_palindrome;\n assert.deepEqual(candidate(\"\"),true);\n assert.deepEqual(candidate(\"aba\"),true);\n assert.deepEqual(candidate(\"aaaaa\"),true);\n assert.deepEqual(candidate(\"zbcd\"),false);\n assert.deepEqual(candidate(\"xywyx\"),true);\n assert.deepEqual(candidate(\"xywyz\"),false);\n assert.deepEqual(candidate(\"xywzx\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "ts", - "prompt": "//xs represent coefficients of a polynomial.\n// xs[0] + xs[1] * x + xs[2] * x^2 + ....\n// Return derivative of this polynomial in the same form.\n// >>> derivative([3, 1, 2, 4, 5])\n// [1, 4, 12, 20]\n// >>> derivative([1, 2, 3])\n// [2, 6]\nfunction derivative(xs: number[]): number[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = derivative;\n assert.deepEqual(candidate([3, 1, 2, 4, 5]),[1, 4, 12, 20]);\n assert.deepEqual(candidate([1, 2, 3]),[2, 6]);\n assert.deepEqual(candidate([3, 2, 1]),[2, 2]);\n assert.deepEqual(candidate([3, 2, 1, 0, 4]),[2, 2, 0, 16]);\n assert.deepEqual(candidate([1]),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "ts", - "prompt": "//In this task, you will be given a string that represents a number of apples and oranges \n// that are distributed in a basket of fruit this basket contains \n// apples, oranges, and mango fruits. Given the string that represents the total number of \n// the oranges and apples and an integer that represent the total number of the fruits \n// in the basket return the number of the mango fruits in the basket.\n// for examble:\n// fruit_distribution(\"5 apples and 6 oranges\", 19) ->19 - 5 - 6 = 8\n// fruit_distribution(\"0 apples and 1 oranges\",3) -> 3 - 0 - 1 = 2\n// fruit_distribution(\"2 apples and 3 oranges\", 100) -> 100 - 2 - 3 = 95\n// fruit_distribution(\"100 apples and 1 oranges\",120) -> 120 - 100 - 1 = 19\nfunction fruit_distribution(s: string, n: number): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fruit_distribution;\n assert.deepEqual(candidate(\"5 apples and 6 oranges\", 19),8);\n assert.deepEqual(candidate(\"5 apples and 6 oranges\", 21),10);\n assert.deepEqual(candidate(\"0 apples and 1 oranges\", 3),2);\n assert.deepEqual(candidate(\"1 apples and 0 oranges\", 3),2);\n assert.deepEqual(candidate(\"2 apples and 3 oranges\", 100),95);\n assert.deepEqual(candidate(\"2 apples and 3 oranges\", 5),0);\n assert.deepEqual(candidate(\"1 apples and 100 oranges\", 120),19);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "ts", - "prompt": "//Write a function that takes an integer a and returns True \n// if this ingeger is a cube of some integer number.\n// Note: you may assume the input is always valid.\n// Examples:\n// iscube(1) ==> True\n// iscube(2) ==> False\n// iscube(-1) ==> True\n// iscube(64) ==> True\n// iscube(0) ==> True\n// iscube(180) ==> False\nfunction iscube(a: number): boolean {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = iscube;\n assert.deepEqual(candidate(1),true);\n assert.deepEqual(candidate(2),false);\n assert.deepEqual(candidate(-1),true);\n assert.deepEqual(candidate(64),true);\n assert.deepEqual(candidate(180),false);\n assert.deepEqual(candidate(1000),true);\n assert.deepEqual(candidate(0),true);\n assert.deepEqual(candidate(1729),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "ts", - "prompt": "//In this Kata, you have to sort an array of non-negative integers according to\n// number of ones in their binary representation in ascending order.\n// For similar number of ones, sort based on decimal value.\n// It must be implemented like this:\n// >>> sort_array([1, 5, 2, 3, 4]) == [1, 2, 3, 4, 5]\n// >>> sort_array([-2, -3, -4, -5, -6]) == [-6, -5, -4, -3, -2]\n// >>> sort_array([1, 0, 2, 3, 4]) [0, 1, 2, 3, 4]\nfunction sort_array(arr: number[]): number[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_array;\n assert.deepEqual(candidate([1, 5, 2, 3, 4]),[1, 2, 4, 3, 5]);\n assert.deepEqual(candidate([-2, -3, -4, -5, -6]),[-4, -2, -6, -5, -3]);\n assert.deepEqual(candidate([1, 0, 2, 3, 4]),[0, 1, 2, 4, 3]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]),[2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77]);\n assert.deepEqual(candidate([3, 6, 44, 12, 32, 5]),[32, 3, 5, 6, 12, 44]);\n assert.deepEqual(candidate([2, 4, 8, 16, 32]),[2, 4, 8, 16, 32]);\n assert.deepEqual(candidate([2, 4, 8, 16, 32]),[2, 4, 8, 16, 32]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "ts", - "prompt": "//Given a list of strings, where each string consists of only digits, return a list.\n// Each element i of the output should be \"the number of odd elements in the\n// string i of the input.\" where all the i's should be replaced by the number\n// of odd digits in the i'th string of the input.\n// >>> odd_count(['1234567'])\n// [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n// >>> odd_count(['3',\"11111111\"])\n// [\"the number of odd elements 1n the str1ng 1 of the 1nput.\",\n// \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\nfunction odd_count(lst: string[]): string[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = odd_count;\n assert.deepEqual(candidate([\"1234567\"]),[\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]);\n assert.deepEqual(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.\"]);\n assert.deepEqual(candidate([\"271\", \"137\", \"314\"]),[\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "ts", - "prompt": "//brackets is a string of \"(\" and \")\".\n// return True if every opening bracket has a corresponding closing bracket.\n// >>> correct_bracketing(\"(\")\n// False\n// >>> correct_bracketing(\"()\")\n// True\n// >>> correct_bracketing(\"(()())\")\n// True\n// >>> correct_bracketing(\")(()\")\n// False\nfunction correct_bracketing(brackets: string): boolean {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = correct_bracketing;\n assert.deepEqual(candidate(\"()\"),true);\n assert.deepEqual(candidate(\"(()())\"),true);\n assert.deepEqual(candidate(\"()()(()())()\"),true);\n assert.deepEqual(candidate(\"()()((()()())())(()()(()))\"),true);\n assert.deepEqual(candidate(\"((()())))\"),false);\n assert.deepEqual(candidate(\")(()\"),false);\n assert.deepEqual(candidate(\"(\"),false);\n assert.deepEqual(candidate(\"((((\"),false);\n assert.deepEqual(candidate(\")\"),false);\n assert.deepEqual(candidate(\"(()\"),false);\n assert.deepEqual(candidate(\"()()(()())())(()\"),false);\n assert.deepEqual(candidate(\"()()(()())()))()\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "ts", - "prompt": "//Task\n// Write a function that takes a string as input and returns the sum of the upper characters only'\n// ASCII codes.\n// Examples:\n// digitSum(\"\") => 0\n// digitSum(\"abAB\") => 131\n// digitSum(\"abcCd\") => 67\n// digitSum(\"helloE\") => 69\n// digitSum(\"woArBld\") => 131\n// digitSum(\"aAaaaXa\") => 153\nfunction digitSum(s: string): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = digitSum;\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"abAB\"),131);\n assert.deepEqual(candidate(\"abcCd\"),67);\n assert.deepEqual(candidate(\"helloE\"),69);\n assert.deepEqual(candidate(\"woArBld\"),131);\n assert.deepEqual(candidate(\"aAaaaXa\"),153);\n assert.deepEqual(candidate(\" How are yOu?\"),151);\n assert.deepEqual(candidate(\"You arE Very Smart\"),327);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "ts", - "prompt": "//Write a function that accepts a list of strings as a parameter,\n// deletes the strings that have odd lengths from it,\n// and returns the resulted list with a sorted order,\n// The list is always a list of strings and never an array of numbers,\n// and it may contain duplicates.\n// The order of the list should be ascending by length of each word, and you\n// should return the list sorted by that rule.\n// If two words have the same length, sort the list alphabetically.\n// The function should return a list of strings in sorted order.\n// You may assume that all words will have the same length.\n// For example:\n// assert list_sort([\"aa\", \"a\", \"aaa\"]) => [\"aa\"]\n// assert list_sort([\"ab\", \"a\", \"aaa\", \"cd\"]) => [\"ab\", \"cd\"]\nfunction sorted_list_sum(lst: string[]): string[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sorted_list_sum;\n assert.deepEqual(candidate([\"aa\", \"a\", \"aaa\"]),[\"aa\"]);\n assert.deepEqual(candidate([\"school\", \"AI\", \"asdf\", \"b\"]),[\"AI\", \"asdf\", \"school\"]);\n assert.deepEqual(candidate([\"d\", \"b\", \"c\", \"a\"]),[]);\n assert.deepEqual(candidate([\"d\", \"dcba\", \"abcd\", \"a\"]),[\"abcd\", \"dcba\"]);\n assert.deepEqual(candidate([\"AI\", \"ai\", \"au\"]),[\"AI\", \"ai\", \"au\"]);\n assert.deepEqual(candidate([\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"]),[]);\n assert.deepEqual(candidate([\"aaaa\", \"bbbb\", \"dd\", \"cc\"]),[\"cc\", \"dd\", \"aaaa\", \"bbbb\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "ts", - "prompt": "//You are given an array arr of integers and you need to return\n// sum of magnitudes of integers multiplied by product of all signs\n// of each number in the array, represented by 1, -1 or 0.\n// Note: return None for empty arr.\n// Example:\n// >>> prod_signs([1, 2, 2, -4]) == -9\n// >>> prod_signs([0, 1]) == 0\n// >>> prod_signs([]) == None\nfunction prod_signs(arr: number[]): number | undefined {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = prod_signs;\n assert.deepEqual(candidate([1, 2, 2, -4]),-9);\n assert.deepEqual(candidate([0, 1]),0);\n assert.deepEqual(candidate([1, 1, 1, 2, 3, -1, 1]),-10);\n assert.deepEqual(candidate([]),undefined);\n assert.deepEqual(candidate([2, 4, 1, 2, -1, -1, 9]),20);\n assert.deepEqual(candidate([-1, 1, -1, 1]),4);\n assert.deepEqual(candidate([-1, 1, 1, 1]),-4);\n assert.deepEqual(candidate([-1, 1, 1, 0]),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "ts", - "prompt": "//Return list with elements incremented by 1.\n// >>> incr_list([1, 2, 3])\n// [2, 3, 4]\n// >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123])\n// [6, 4, 6, 3, 4, 4, 10, 1, 124]\nfunction incr_list(l: number[]): number[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = incr_list;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([3, 2, 1]),[4, 3, 2]);\n assert.deepEqual(candidate([5, 2, 5, 2, 3, 3, 9, 0, 123]),[6, 3, 6, 3, 4, 4, 10, 1, 124]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "ts", - "prompt": "//From a given list of integers, generate a list of rolling maximum element found until given moment\n// in the sequence.\n// >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n// [1, 2, 3, 3, 3, 4, 4]\nfunction rolling_max(numbers: number[]): number[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = rolling_max;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, 2, 3, 4]),[1, 2, 3, 4]);\n assert.deepEqual(candidate([4, 3, 2, 1]),[4, 4, 4, 4]);\n assert.deepEqual(candidate([3, 2, 3, 100, 3]),[3, 3, 3, 100, 100]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "ts", - "prompt": "//Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n// separate those group into separate strings and return the list of those.\n// Separate groups are balanced (each open brace is properly closed) and not nested within each other\n// Ignore any spaces in the input string.\n// >>> separate_paren_groups('( ) (( )) (( )( ))')\n// ['()', '(())', '(()())']\nfunction separate_paren_groups(paren_string: string): string[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = separate_paren_groups;\n assert.deepEqual(candidate(\"(()()) ((())) () ((())()())\"),[\"(()())\", \"((()))\", \"()\", \"((())()())\"]);\n assert.deepEqual(candidate(\"() (()) ((())) (((())))\"),[\"()\", \"(())\", \"((()))\", \"(((())))\"]);\n assert.deepEqual(candidate(\"(()(())((())))\"),[\"(()(())((())))\"]);\n assert.deepEqual(candidate(\"( ) (( )) (( )( ))\"),[\"()\", \"(())\", \"(()())\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "ts", - "prompt": "//You will be given a string of words separated by commas or spaces. Your task is\n// to split the string into words and return an array of the words.\n// For example:\n// words_string(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n// words_string(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\nfunction words_string(s: string): string[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = words_string;\n assert.deepEqual(candidate(\"Hi, my name is John\"),[\"Hi\", \"my\", \"name\", \"is\", \"John\"]);\n assert.deepEqual(candidate(\"One, two, three, four, five, six\"),[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]);\n assert.deepEqual(candidate(\"Hi, my name\"),[\"Hi\", \"my\", \"name\"]);\n assert.deepEqual(candidate(\"One,, two, three, four, five, six,\"),[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]);\n assert.deepEqual(candidate(\"\"),[]);\n assert.deepEqual(candidate(\"ahmed , gamal\"),[\"ahmed\", \"gamal\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "ts", - "prompt": "//Filter given list of any python values only for integers\n// >>> filter_integers(['a', 3.14, 5])\n// [5]\n// >>> filter_integers([1, 2, 3, 'abc', {}, []])\n// [1, 2, 3]\nfunction filter_integers(values: any[]): number[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = filter_integers;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([4, {}, [], 23.2, 9, \"adasd\"]),[4, 9]);\n assert.deepEqual(candidate([3, \"c\", 3, 3, \"a\", \"b\"]),[3, 3, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "ts", - "prompt": "//This function takes a list l and returns a list l' such that\n// l' is identical to l in the odd indicies, while its values at the even indicies are equal\n// to the values of the even indicies of l, but sorted.\n// >>> sort_even([1, 2, 3])\n// [1, 2, 3]\n// >>> sort_even([5, 6, 3, 4])\n// [3, 6, 5, 4]\nfunction sort_even(l: number[]): number[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_even;\n assert.deepEqual(candidate([1, 2, 3]),[1, 2, 3]);\n assert.deepEqual(candidate([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]),[-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123]);\n assert.deepEqual(candidate([5, 8, -12, 4, 23, 2, 3, 11, 12, -10]),[-12, 8, 3, 4, 5, 2, 12, 11, 23, -10]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "ts", - "prompt": "//I think we all remember that feeling when the result of some long-awaited\n// event is finally known. The feelings and thoughts you have at that moment are\n// definitely worth noting down and comparing.\n// Your task is to determine if a person correctly guessed the results of a number of matches.\n// You are given two arrays of scores and guesses of equal length, where each index shows a match. \n// Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n// the value is 0, and if not, the value is the absolute difference between the guess and the score.\n// example:\n// compare([1,2,3,4,5,1],[1,2,3,4,2,-2]) -> [0,0,0,0,3,3]\n// compare([0,5,0,0,0,4],[4,1,1,0,0,-2]) -> [4,4,1,0,0,6]\nfunction compare(game: number[], guess: number[]): number[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = compare;\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2]),[0, 0, 0, 0, 3, 3]);\n assert.deepEqual(candidate([0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]),[0, 0, 0, 0, 0, 0]);\n assert.deepEqual(candidate([1, 2, 3], [-1, -2, -3]),[2, 4, 6]);\n assert.deepEqual(candidate([1, 2, 3, 5], [-1, 2, 3, 4]),[2, 0, 0, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "ts", - "prompt": "//Given a positive integer n, return a tuple that has the number of even and odd\n// integer palindromes that fall within the range(1, n), inclusive.\n// Example 1:\n// Input: 3\n// Output: (1, 2)\n// Explanation:\n// Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n// Example 2:\n// Input: 12\n// Output: (4, 6)\n// Explanation:\n// Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n// Note:\n// 1. 1 <= n <= 10^3\n// 2. returned tuple has the number of even and odd integer palindromes respectively.\nfunction even_odd_palindrome(n: number): [number, number] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = even_odd_palindrome;\n assert.deepEqual(candidate(123),[8, 13]);\n assert.deepEqual(candidate(12),[4, 6]);\n assert.deepEqual(candidate(3),[1, 2]);\n assert.deepEqual(candidate(63),[6, 8]);\n assert.deepEqual(candidate(25),[5, 6]);\n assert.deepEqual(candidate(19),[4, 6]);\n assert.deepEqual(candidate(9),[4, 5]);\n assert.deepEqual(candidate(1),[0, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "ts", - "prompt": "//The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fib4(0) -> 0\n// fib4(1) -> 0\n// fib4(2) -> 2\n// fib4(3) -> 0\n// fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n// Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n// >>> fib4(5)\n// 4\n// >>> fib4(6)\n// 8\n// >>> fib4(7)\n// 14\nfunction fib4(n: number): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fib4;\n assert.deepEqual(candidate(5),4);\n assert.deepEqual(candidate(8),28);\n assert.deepEqual(candidate(10),104);\n assert.deepEqual(candidate(12),386);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "ts", - "prompt": "//Given two positive integers a and b, return the even digits between a\n// and b, in ascending order.\n// For example:\n// generate_integers(2, 8) => [2, 4, 6, 8]\n// generate_integers(8, 2) => [2, 4, 6, 8]\n// generate_integers(10, 14) => []\nfunction generate_integers(a: number, b: number): number[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = generate_integers;\n assert.deepEqual(candidate(2, 10),[2, 4, 6, 8]);\n assert.deepEqual(candidate(10, 2),[2, 4, 6, 8]);\n assert.deepEqual(candidate(132, 2),[2, 4, 6, 8]);\n assert.deepEqual(candidate(17, 89),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "ts", - "prompt": "//For a given list of input numbers, calculate Mean Absolute Deviation\n// around the mean of this dataset.\n// Mean Absolute Deviation is the average absolute difference between each\n// element and a centerpoint (mean in this case):\n// MAD = average | x - x_mean |\n// >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n// 1.0\nfunction mean_absolute_deviation(numbers: number[]): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = mean_absolute_deviation;\n assert.deepEqual(candidate([1.0, 2.0]),0.5);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0]),1.0);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0]),1.2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "ts", - "prompt": "//Create a function encrypt that takes a string as an argument and\n// returns a string encrypted with the alphabet being rotated. \n// The alphabet should be rotated in a manner such that the letters \n// shift down by two multiplied to two places.\n// For example:\n// encrypt('hi') returns 'lm'\n// encrypt('asdfghjkl') returns 'ewhjklnop'\n// encrypt('gf') returns 'kj'\n// encrypt('et') returns 'ix'\nfunction encrypt(s: string): string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = encrypt;\n assert.deepEqual(candidate(\"hi\"),\"lm\");\n assert.deepEqual(candidate(\"asdfghjkl\"),\"ewhjklnop\");\n assert.deepEqual(candidate(\"gf\"),\"kj\");\n assert.deepEqual(candidate(\"et\"),\"ix\");\n assert.deepEqual(candidate(\"faewfawefaewg\"),\"jeiajeaijeiak\");\n assert.deepEqual(candidate(\"hellomyfriend\"),\"lippsqcjvmirh\");\n assert.deepEqual(candidate(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\"),\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\");\n assert.deepEqual(candidate(\"a\"),\"e\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "ts", - "prompt": "//Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n// The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n// as follows: start with any positive integer n. Then each term is obtained from the \n// previous term as follows: if the previous term is even, the next term is one half of \n// the previous term. If the previous term is odd, the next term is 3 times the previous\n// term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n// Note: \n// 1. Collatz(1) is [1].\n// 2. returned list sorted in increasing order.\n// For example:\n// get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\nfunction get_odd_collatz(n: number): number[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_odd_collatz;\n assert.deepEqual(candidate(14),[1, 5, 7, 11, 13, 17]);\n assert.deepEqual(candidate(5),[1, 5]);\n assert.deepEqual(candidate(12),[1, 3, 5]);\n assert.deepEqual(candidate(1),[1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "ts", - "prompt": "//Find how many times a given substring can be found in the original string. Count overlaping cases.\n// >>> how_many_times('', 'a')\n// 0\n// >>> how_many_times('aaa', 'a')\n// 3\n// >>> how_many_times('aaaa', 'aa')\n// 3\nfunction how_many_times(string: string, substring: string): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = how_many_times;\n assert.deepEqual(candidate(\"\", \"x\"),0);\n assert.deepEqual(candidate(\"xyxyxyx\", \"x\"),4);\n assert.deepEqual(candidate(\"cacacacac\", \"cac\"),4);\n assert.deepEqual(candidate(\"john doe\", \"john\"),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "ts", - "prompt": "//We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n// numbers in the array will be randomly ordered. Your task is to determine if\n// it is possible to get an array sorted in non-decreasing order by performing \n// the following operation on the given array:\n// You are allowed to perform right shift operation any number of times.\n// One right shift operation means shifting all elements of the array by one\n// position in the right direction. The last element of the array will be moved to\n// the starting position in the array i.e. 0th index. \n// If it is possible to obtain the sorted array by performing the above operation\n// then return True else return False.\n// If the given array is empty then return True.\n// Note: The given list is guaranteed to have unique elements.\n// For Example:\n// move_one_ball([3, 4, 5, 1, 2])==>True\n// Explanation: By performin 2 right shift operations, non-decreasing order can\n// be achieved for the given array.\n// move_one_ball([3, 5, 4, 1, 2])==>False\n// Explanation:It is not possible to get non-decreasing order for the given\n// array by performing any number of right shift operations.\nfunction move_one_ball(arr: number[]): boolean {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = move_one_ball;\n assert.deepEqual(candidate([3, 4, 5, 1, 2]),true);\n assert.deepEqual(candidate([3, 5, 10, 1, 2]),true);\n assert.deepEqual(candidate([4, 3, 1, 2]),false);\n assert.deepEqual(candidate([3, 5, 4, 1, 2]),false);\n assert.deepEqual(candidate([]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "ts", - "prompt": "//Write a function which sorts the given list of integers\n// in ascending order according to the sum of their digits.\n// Note: if there are several items with similar sum of their digits,\n// order them based on their index in original list.\n// For example:\n// >>> order_by_points([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]\n// >>> order_by_points([]) == []\nfunction order_by_points(nums: number[]): number[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = order_by_points;\n assert.deepEqual(candidate([1, 11, -1, -11, -12]),[-1, -11, 1, -12, 11]);\n assert.deepEqual(candidate([1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]),[0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, -11, -32, 43, 54, -98, 2, -3]),[-3, -32, -98, -11, 1, 2, 43, 54]);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]),[1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9]);\n assert.deepEqual(candidate([0, 6, 6, -76, -21, 23, 4]),[-76, -21, 0, 4, 23, 6, 6]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "ts", - "prompt": "//Return list of prime factors of given integer in the order from smallest to largest.\n// Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n// Input number should be equal to the product of all factors\n// >>> factorize(8)\n// [2, 2, 2]\n// >>> factorize(25)\n// [5, 5]\n// >>> factorize(70)\n// [2, 5, 7]\nfunction factorize(n: number): number[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = factorize;\n assert.deepEqual(candidate(2),[2]);\n assert.deepEqual(candidate(4),[2, 2]);\n assert.deepEqual(candidate(8),[2, 2, 2]);\n assert.deepEqual(candidate(57),[3, 19]);\n assert.deepEqual(candidate(3249),[3, 3, 19, 19]);\n assert.deepEqual(candidate(185193),[3, 3, 3, 19, 19, 19]);\n assert.deepEqual(candidate(20577),[3, 19, 19, 19]);\n assert.deepEqual(candidate(18),[2, 3, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "ts", - "prompt": "//Return True if all numbers in the list l are below threshold t.\n// >>> below_threshold([1, 2, 4, 10], 100)\n// True\n// >>> below_threshold([1, 20, 4, 10], 5)\n// False\nfunction below_threshold(l: number[], t: number): boolean {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = below_threshold;\n assert.deepEqual(candidate([1, 2, 4, 10], 100),true);\n assert.deepEqual(candidate([1, 20, 4, 10], 5),false);\n assert.deepEqual(candidate([1, 20, 4, 10], 21),true);\n assert.deepEqual(candidate([1, 20, 4, 10], 22),true);\n assert.deepEqual(candidate([1, 8, 4, 10], 11),true);\n assert.deepEqual(candidate([1, 8, 4, 10], 10),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "ts", - "prompt": "//You are given two positive integers n and m, and your task is to compute the\n// average of the integers from n through m (including n and m). \n// Round the answer to the nearest integer and convert that to binary.\n// If n is greater than m, return -1.\n// Example:\n// rounded_avg(1, 5) => \"0b11\"\n// rounded_avg(7, 5) => -1\n// rounded_avg(10, 20) => \"0b1111\"\n// rounded_avg(20, 33) => \"0b11010\"\nfunction rounded_avg(n: number, m: number): string| number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = rounded_avg;\n assert.deepEqual(candidate(1, 5),\"0b11\");\n assert.deepEqual(candidate(7, 13),\"0b1010\");\n assert.deepEqual(candidate(964, 977),\"0b1111001010\");\n assert.deepEqual(candidate(996, 997),\"0b1111100100\");\n assert.deepEqual(candidate(560, 851),\"0b1011000010\");\n assert.deepEqual(candidate(185, 546),\"0b101101110\");\n assert.deepEqual(candidate(362, 496),\"0b110101101\");\n assert.deepEqual(candidate(350, 902),\"0b1001110010\");\n assert.deepEqual(candidate(197, 233),\"0b11010111\");\n assert.deepEqual(candidate(7, 5),-1);\n assert.deepEqual(candidate(5, 1),-1);\n assert.deepEqual(candidate(5, 5),\"0b101\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "ts", - "prompt": "//Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n// For each of the group, output the deepest level of nesting of parentheses.\n// E.g. (()()) has maximum two levels of nesting while ((())) has three.\n// >>> parse_nested_parens('(()()) ((())) () ((())()())')\n// [2, 3, 1, 3]\nfunction parse_nested_parens(paren_string: string): number[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = parse_nested_parens;\n assert.deepEqual(candidate(\"(()()) ((())) () ((())()())\"),[2, 3, 1, 3]);\n assert.deepEqual(candidate(\"() (()) ((())) (((())))\"),[1, 2, 3, 4]);\n assert.deepEqual(candidate(\"(()(())((())))\"),[4]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "ts", - "prompt": "//Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n// Examples\n// solution([5, 8, 7, 1]) ==> 12\n// solution([3, 3, 3, 3, 3]) ==> 9\n// solution([30, 13, 24, 321]) ==>0\nfunction solution(lst: number[]): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = solution;\n assert.deepEqual(candidate([5, 8, 7, 1]),12);\n assert.deepEqual(candidate([3, 3, 3, 3, 3]),9);\n assert.deepEqual(candidate([30, 13, 24, 321]),0);\n assert.deepEqual(candidate([5, 9]),5);\n assert.deepEqual(candidate([2, 4, 8]),0);\n assert.deepEqual(candidate([30, 13, 23, 32]),23);\n assert.deepEqual(candidate([3, 13, 2, 9]),3);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "ts", - "prompt": "//You are given a positive integer n. You have to create an integer array a of length n.\n// For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n// Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n// and a[i] + a[j] + a[k] is a multiple of 3.\n// Example :\n// Input: n = 5\n// Output: 1\n// Explanation: \n// a = [1, 3, 7, 13, 21]\n// The only valid triple is (1, 7, 13).\nfunction get_max_triples(n: number): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_max_triples;\n assert.deepEqual(candidate(5),1);\n assert.deepEqual(candidate(6),4);\n assert.deepEqual(candidate(10),36);\n assert.deepEqual(candidate(100),53361);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "ts", - "prompt": "//You are given a list of integers.\n// Write a function next_smallest() that returns the 2nd smallest element of the list.\n// Return None if there is no such element.\n// next_smallest([1, 2, 3, 4, 5]) == 2\n// next_smallest([5, 1, 4, 3, 2]) == 2\n// next_smallest([]) == None\n// next_smallest([1, 1]) == None\nfunction next_smallest(lst: number[]): number | undefined {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = next_smallest;\n assert.deepEqual(candidate([1, 2, 3, 4, 5]),2);\n assert.deepEqual(candidate([5, 1, 4, 3, 2]),2);\n assert.deepEqual(candidate([]),undefined);\n assert.deepEqual(candidate([1, 1]),undefined);\n assert.deepEqual(candidate([1, 1, 1, 1, 0]),1);\n assert.deepEqual(candidate([1, 1]),undefined);\n assert.deepEqual(candidate([-35, 34, 12, -45]),-35);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "ts", - "prompt": "//Input is a space-delimited string of numberals from 'zero' to 'nine'.\n// Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n// Return the string with numbers sorted from smallest to largest\n// >>> sort_numbers('three one five')\n// 'one three five'\nfunction sort_numbers(numbers: string): string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_numbers;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"three\"),\"three\");\n assert.deepEqual(candidate(\"three five nine\"),\"three five nine\");\n assert.deepEqual(candidate(\"five zero four seven nine eight\"),\"zero four five seven eight nine\");\n assert.deepEqual(candidate(\"six five four three two one zero\"),\"zero one two three four five six\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "ts", - "prompt": "//You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n// cycpattern_check(\"abcd\",\"abd\") => False\n// cycpattern_check(\"hello\",\"ell\") => True\n// cycpattern_check(\"whassup\",\"psus\") => False\n// cycpattern_check(\"abab\",\"baa\") => True\n// cycpattern_check(\"efef\",\"eeff\") => False\n// cycpattern_check(\"himenss\",\"simen\") => True\nfunction cycpattern_check(a: string, b: string): boolean {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = cycpattern_check;\n assert.deepEqual(candidate(\"xyzw\", \"xyw\"),false);\n assert.deepEqual(candidate(\"yello\", \"ell\"),true);\n assert.deepEqual(candidate(\"whattup\", \"ptut\"),false);\n assert.deepEqual(candidate(\"efef\", \"fee\"),true);\n assert.deepEqual(candidate(\"abab\", \"aabb\"),false);\n assert.deepEqual(candidate(\"winemtt\", \"tinem\"),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "ts", - "prompt": "//You will be given a number in decimal form and your task is to convert it to\n// binary format. The function should return a string, with each character representing a binary\n// number. Each character in the string will be '0' or '1'.\n// There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n// The extra characters are there to help with the format.\n// Examples:\n// decimal_to_binary(15) # returns \"db1111db\"\n// decimal_to_binary(32) # returns \"db100000db\"\nfunction decimal_to_binary(decimal: number): string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = decimal_to_binary;\n assert.deepEqual(candidate(0),\"db0db\");\n assert.deepEqual(candidate(32),\"db100000db\");\n assert.deepEqual(candidate(103),\"db1100111db\");\n assert.deepEqual(candidate(15),\"db1111db\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "ts", - "prompt": "//Filter an input list of strings only for ones that contain given substring\n// >>> filter_by_substring([], 'a')\n// []\n// >>> filter_by_substring(['abc', 'bacd', 'cde', 'array'], 'a')\n// ['abc', 'bacd', 'array']\nfunction filter_by_substring(strings: string[], substring: string): string[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = filter_by_substring;\n assert.deepEqual(candidate([], \"john\"),[]);\n assert.deepEqual(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"),[\"xxx\", \"xxxAAA\", \"xxx\"]);\n assert.deepEqual(candidate([\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xx\"),[\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"]);\n assert.deepEqual(candidate([\"grunt\", \"trumpet\", \"prune\", \"gruesome\"], \"run\"),[\"grunt\", \"prune\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "ts", - "prompt": "//Given an integer. return a tuple that has the number of even and odd digits respectively.\n// Example:\n// even_odd_count(-12) ==> (1, 1)\n// even_odd_count(123) ==> (1, 2)\nfunction even_odd_count(num: number): [number, number] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = even_odd_count;\n assert.deepEqual(candidate(7),[0, 1]);\n assert.deepEqual(candidate(-78),[1, 1]);\n assert.deepEqual(candidate(3452),[2, 2]);\n assert.deepEqual(candidate(346211),[3, 3]);\n assert.deepEqual(candidate(-345821),[3, 3]);\n assert.deepEqual(candidate(-2),[1, 0]);\n assert.deepEqual(candidate(-45347),[2, 3]);\n assert.deepEqual(candidate(0),[1, 0]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "ts", - "prompt": "//Write a function that accepts a list of strings.\n// The list contains different words. Return the word with maximum number\n// of unique characters. If multiple strings have maximum number of unique\n// characters, return the one which comes first in lexicographical order.\n// find_max([\"name\", \"of\", \"string\"]) == \"string\"\n// find_max([\"name\", \"enam\", \"game\"]) == \"enam\"\n// find_max([\"aaaaaaa\", \"bb\" ,\"cc\"]) == \"\"aaaaaaa\"\nfunction find_max(words: string[]): string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = find_max;\n assert.deepEqual(candidate([\"name\", \"of\", \"string\"]),\"string\");\n assert.deepEqual(candidate([\"name\", \"enam\", \"game\"]),\"enam\");\n assert.deepEqual(candidate([\"aaaaaaa\", \"bb\", \"cc\"]),\"aaaaaaa\");\n assert.deepEqual(candidate([\"abc\", \"cba\"]),\"abc\");\n assert.deepEqual(candidate([\"play\", \"this\", \"game\", \"of\", \"footbott\"]),\"footbott\");\n assert.deepEqual(candidate([\"we\", \"are\", \"gonna\", \"rock\"]),\"gonna\");\n assert.deepEqual(candidate([\"we\", \"are\", \"a\", \"mad\", \"nation\"]),\"nation\");\n assert.deepEqual(candidate([\"this\", \"is\", \"a\", \"prrk\"]),\"this\");\n assert.deepEqual(candidate([\"b\"]),\"b\");\n assert.deepEqual(candidate([\"play\", \"play\", \"play\"]),\"play\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "ts", - "prompt": "//Given a positive integer n, return the count of the numbers of n-digit\n// positive integers that start or end with 1.\nfunction starts_one_ends(n: number): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = starts_one_ends;\n assert.deepEqual(candidate(1),1);\n assert.deepEqual(candidate(2),18);\n assert.deepEqual(candidate(3),180);\n assert.deepEqual(candidate(4),1800);\n assert.deepEqual(candidate(5),18000);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "ts", - "prompt": "//Create a function that returns a tuple (a, b), where 'a' is\n// the largest of negative integers, and 'b' is the smallest\n// of positive integers in a list.\n// If there is no negative or positive integers, return them as None.\n// Examples:\n// largest_smallest_integers([2, 4, 1, 3, 5, 7]) == (None, 1)\n// largest_smallest_integers([]) == (None, None)\n// largest_smallest_integers([0]) == (None, None)\nfunction largest_smallest_integers(lst: number[]): [number | undefined, number | undefined] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = largest_smallest_integers;\n assert.deepEqual(candidate([2, 4, 1, 3, 5, 7]),[undefined, 1]);\n assert.deepEqual(candidate([2, 4, 1, 3, 5, 7, 0]),[undefined, 1]);\n assert.deepEqual(candidate([1, 3, 2, 4, 5, 6, -2]),[-2, 1]);\n assert.deepEqual(candidate([4, 5, 3, 6, 2, 7, -7]),[-7, 2]);\n assert.deepEqual(candidate([7, 3, 8, 4, 9, 2, 5, -9]),[-9, 2]);\n assert.deepEqual(candidate([]),[undefined, undefined]);\n assert.deepEqual(candidate([0]),[undefined, undefined]);\n assert.deepEqual(candidate([-1, -3, -5, -6]),[-1, undefined]);\n assert.deepEqual(candidate([-1, -3, -5, -6, 0]),[-1, undefined]);\n assert.deepEqual(candidate([-6, -4, -4, -3, 1]),[-3, 1]);\n assert.deepEqual(candidate([-6, -4, -4, -3, -100, 1]),[-3, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "ts", - "prompt": "//\"Given an array representing a branch of a tree that has non-negative integer nodes\n// your task is to pluck one of the nodes and return it.\n// The plucked node should be the node with the smallest even value.\n// If multiple nodes with the same smallest even value are found return the node that has smallest index.\n// The plucked node should be returned in a list, [ smalest_value, its index ],\n// If there are no even values or the given array is empty, return [].\n// Example 1:\n// Input: [4,2,3]\n// Output: [2, 1]\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 2:\n// Input: [1,2,3]\n// Output: [2, 1]\n// Explanation: 2 has the smallest even value, and 2 has the smallest index. \n// Example 3:\n// Input: []\n// Output: []\n// Example 4:\n// Input: [5, 0, 3, 0, 4, 2]\n// Output: [0, 1]\n// Explanation: 0 is the smallest value, but there are two zeros,\n// so we will choose the first zero, which has the smallest index.\n// Constraints:\n// * 1 <= nodes.length <= 10000\n// * 0 <= node.value\nfunction pluck(arr: number[]): number[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = pluck;\n assert.deepEqual(candidate([4, 2, 3]),[2, 1]);\n assert.deepEqual(candidate([1, 2, 3]),[2, 1]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([5, 0, 3, 0, 4, 2]),[0, 1]);\n assert.deepEqual(candidate([1, 2, 3, 0, 5, 3]),[0, 3]);\n assert.deepEqual(candidate([5, 4, 8, 4, 8]),[4, 1]);\n assert.deepEqual(candidate([7, 6, 7, 1]),[6, 1]);\n assert.deepEqual(candidate([7, 9, 7, 1]),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "ts", - "prompt": "//Write a function count_nums which takes an array of integers and returns\n// the number of elements which has a sum of digits > 0.\n// If a number is negative, then its first signed digit will be negative:\n// e.g. -123 has signed digits -1, 2, and 3.\n// >>> count_nums([]) == 0\n// >>> count_nums([-1, 11, -11]) == 1\n// >>> count_nums([1, 1, 2]) == 3\nfunction count_nums(arr: number[]): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_nums;\n assert.deepEqual(candidate([]),0);\n assert.deepEqual(candidate([-1, -2, 0]),0);\n assert.deepEqual(candidate([1, 1, 2, -2, 3, 4, 5]),6);\n assert.deepEqual(candidate([1, 6, 9, -6, 0, 1, 5]),5);\n assert.deepEqual(candidate([1, 100, 98, -7, 1, -1]),4);\n assert.deepEqual(candidate([12, 23, 34, -45, -56, 0]),5);\n assert.deepEqual(candidate([0, 1]),1);\n assert.deepEqual(candidate([1]),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "ts", - "prompt": "//Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n// each cell of the grid contains a value. Every integer in the range [1, N * N]\n// inclusive appears exactly once on the cells of the grid.\n// You have to find the minimum path of length k in the grid. You can start\n// from any cell, and in each step you can move to any of the neighbor cells,\n// in other words, you can go to cells which share an edge with you current\n// cell.\n// Please note that a path of length k means visiting exactly k cells (not\n// necessarily distinct).\n// You CANNOT go off the grid.\n// A path A (of length k) is considered less than a path B (of length k) if\n// after making the ordered lists of the values on the cells that A and B go\n// through (let's call them lst_A and lst_B), lst_A is lexicographically less\n// than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n// such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n// lst_A[j] = lst_B[j].\n// It is guaranteed that the answer is unique.\n// Return an ordered list of the values on the cells that the minimum path go through.\n// Examples:\n// Input: grid = [ [1,2,3], [4,5,6], [7,8,9]], k = 3\n// Output: [1, 2, 1]\n// Input: grid = [ [5,9,3], [4,1,6], [7,8,2]], k = 1\n// Output: [1]\nfunction minPath(grid: number[][], k: number): number[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = minPath;\n assert.deepEqual(candidate([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3),[1, 2, 1]);\n assert.deepEqual(candidate([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1),[1]);\n assert.deepEqual(candidate([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], 4),[1, 2, 1, 2]);\n assert.deepEqual(candidate([[6, 4, 13, 10], [5, 7, 12, 1], [3, 16, 11, 15], [8, 14, 9, 2]], 7),[1, 10, 1, 10, 1, 10, 1]);\n assert.deepEqual(candidate([[8, 14, 9, 2], [6, 4, 13, 15], [5, 7, 1, 12], [3, 10, 11, 16]], 5),[1, 7, 1, 7, 1]);\n assert.deepEqual(candidate([[11, 8, 7, 2], [5, 16, 14, 4], [9, 3, 15, 6], [12, 13, 10, 1]], 9),[1, 6, 1, 6, 1, 6, 1, 6, 1]);\n assert.deepEqual(candidate([[12, 13, 10, 1], [9, 3, 15, 6], [5, 16, 14, 4], [11, 8, 7, 2]], 12),[1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6]);\n assert.deepEqual(candidate([[2, 7, 4], [3, 1, 5], [6, 8, 9]], 8),[1, 3, 1, 3, 1, 3, 1, 3]);\n assert.deepEqual(candidate([[6, 1, 5], [3, 8, 9], [2, 7, 4]], 8),[1, 5, 1, 5, 1, 5, 1, 5]);\n assert.deepEqual(candidate([[1, 2], [3, 4]], 10),[1, 2, 1, 2, 1, 2, 1, 2, 1, 2]);\n assert.deepEqual(candidate([[1, 3], [3, 2]], 10),[1, 3, 1, 3, 1, 3, 1, 3, 1, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "ts", - "prompt": "//Given list of integers, return list in strange order.\n// Strange sorting, is when you start with the minimum value,\n// then maximum of the remaining integers, then minimum and so on.\n// Examples:\n// strange_sort_list([1, 2, 3, 4]) == [1, 4, 2, 3]\n// strange_sort_list([5, 5, 5, 5]) == [5, 5, 5, 5]\n// strange_sort_list([]) == []\nfunction strange_sort_list(lst: number[]): number[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = strange_sort_list;\n assert.deepEqual(candidate([1, 2, 3, 4]),[1, 4, 2, 3]);\n assert.deepEqual(candidate([5, 6, 7, 8, 9]),[5, 9, 6, 8, 7]);\n assert.deepEqual(candidate([1, 2, 3, 4, 5]),[1, 5, 2, 4, 3]);\n assert.deepEqual(candidate([5, 6, 7, 8, 9, 1]),[1, 9, 5, 8, 6, 7]);\n assert.deepEqual(candidate([5, 5, 5, 5]),[5, 5, 5, 5]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6, 7, 8]),[1, 8, 2, 7, 3, 6, 4, 5]);\n assert.deepEqual(candidate([0, 2, 2, 2, 5, 5, -5, -5]),[-5, 5, -5, 5, 0, 2, 2, 2]);\n assert.deepEqual(candidate([111111]),[111111]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "ts", - "prompt": "//Given a string 'text', return its md5 hash equivalent string.\n// If 'text' is an empty string, return None.\n// >>> string_to_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'\nfunction string_to_md5(text: string): string | undefined {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = string_to_md5;\n assert.deepEqual(candidate(\"Hello world\"),\"3e25960a79dbc69b674cd4ec67a72c62\");\n assert.deepEqual(candidate(\"\"),undefined);\n assert.deepEqual(candidate(\"A B C\"),\"0ef78513b0cb8cef12743f5aeb35f888\");\n assert.deepEqual(candidate(\"password\"),\"5f4dcc3b5aa765d61d8327deb882cf99\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "ts", - "prompt": "//You are given a word. Your task is to find the closest vowel that stands between \n// two consonants from the right side of the word (case sensitive).\n// Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n// find any vowel met the above condition. \n// You may assume that the given string contains English letter only.\n// Example:\n// get_closest_vowel(\"yogurt\") ==> \"u\"\n// get_closest_vowel(\"FULL\") ==> \"U\"\n// get_closest_vowel(\"quick\") ==> \"\"\n// get_closest_vowel(\"ab\") ==> \"\"\nfunction get_closest_vowel(word: string): string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_closest_vowel;\n assert.deepEqual(candidate(\"yogurt\"),\"u\");\n assert.deepEqual(candidate(\"full\"),\"u\");\n assert.deepEqual(candidate(\"easy\"),\"\");\n assert.deepEqual(candidate(\"eAsy\"),\"\");\n assert.deepEqual(candidate(\"ali\"),\"\");\n assert.deepEqual(candidate(\"bad\"),\"a\");\n assert.deepEqual(candidate(\"most\"),\"o\");\n assert.deepEqual(candidate(\"ab\"),\"\");\n assert.deepEqual(candidate(\"ba\"),\"\");\n assert.deepEqual(candidate(\"quick\"),\"\");\n assert.deepEqual(candidate(\"anime\"),\"i\");\n assert.deepEqual(candidate(\"Asia\"),\"\");\n assert.deepEqual(candidate(\"Above\"),\"o\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "ts", - "prompt": "//Change numerical base of input number x to base.\n// return string representation after the conversion.\n// base numbers are less than 10.\n// >>> change_base(8, 3)\n// '22'\n// >>> change_base(8, 2)\n// '1000'\n// >>> change_base(7, 2)\n// '111'\nfunction change_base(x: number, base: number): string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = change_base;\n assert.deepEqual(candidate(8, 3),\"22\");\n assert.deepEqual(candidate(9, 3),\"100\");\n assert.deepEqual(candidate(234, 2),\"11101010\");\n assert.deepEqual(candidate(16, 2),\"10000\");\n assert.deepEqual(candidate(8, 2),\"1000\");\n assert.deepEqual(candidate(7, 2),\"111\");\n assert.deepEqual(candidate(2, 3),\"2\");\n assert.deepEqual(candidate(3, 4),\"3\");\n assert.deepEqual(candidate(4, 5),\"4\");\n assert.deepEqual(candidate(5, 6),\"5\");\n assert.deepEqual(candidate(6, 7),\"6\");\n assert.deepEqual(candidate(7, 8),\"7\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "ts", - "prompt": "//Check if in given list of numbers, are any two numbers closer to each other than\n// given threshold.\n// >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n// False\n// >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n// True\nfunction has_close_elements(numbers: number[], threshold: number): boolean {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = has_close_elements;\n assert.deepEqual(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3),true);\n assert.deepEqual(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05),false);\n assert.deepEqual(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.95),true);\n assert.deepEqual(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.8),false);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1),true);\n assert.deepEqual(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 1.0),true);\n assert.deepEqual(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 0.5),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "ts", - "prompt": "//Create a function that takes a string as input which contains only square brackets.\n// The function should return True if and only if there is a valid subsequence of brackets \n// where at least one bracket in the subsequence is nested.\n// is_nested('[[]]') \u279e True\n// is_nested('[]]]]]]][[[[[]') \u279e False\n// is_nested('[][]') \u279e False\n// is_nested('[]') \u279e False\n// is_nested('[[][]]') \u279e True\n// is_nested('[[]][[') \u279e True\nfunction is_nested(string: string): boolean {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_nested;\n assert.deepEqual(candidate(\"[[]]\"),true);\n assert.deepEqual(candidate(\"[]]]]]]][[[[[]\"),false);\n assert.deepEqual(candidate(\"[][]\"),false);\n assert.deepEqual(candidate(\"[]\"),false);\n assert.deepEqual(candidate(\"[[[[]]]]\"),true);\n assert.deepEqual(candidate(\"[]]]]]]]]]]\"),false);\n assert.deepEqual(candidate(\"[][][[]]\"),true);\n assert.deepEqual(candidate(\"[[]\"),false);\n assert.deepEqual(candidate(\"[]]\"),false);\n assert.deepEqual(candidate(\"[[]][[\"),true);\n assert.deepEqual(candidate(\"[[][]]\"),true);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"[[[[[[[[\"),false);\n assert.deepEqual(candidate(\"]]]]]]]]\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "ts", - "prompt": "//Concatenate list of strings into a single string\n// >>> concatenate([])\n// ''\n// >>> concatenate(['a', 'b', 'c'])\n// 'abc'\nfunction concatenate(strings: string[]): string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = concatenate;\n assert.deepEqual(candidate([]),\"\");\n assert.deepEqual(candidate([\"x\", \"y\", \"z\"]),\"xyz\");\n assert.deepEqual(candidate([\"x\", \"y\", \"z\", \"w\", \"k\"]),\"xyzwk\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "ts", - "prompt": "//prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n// >>> prime_fib(1)\n// 2\n// >>> prime_fib(2)\n// 3\n// >>> prime_fib(3)\n// 5\n// >>> prime_fib(4)\n// 13\n// >>> prime_fib(5)\n// 89\nfunction prime_fib(n: number): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = prime_fib;\n assert.deepEqual(candidate(1),2);\n assert.deepEqual(candidate(2),3);\n assert.deepEqual(candidate(3),5);\n assert.deepEqual(candidate(4),13);\n assert.deepEqual(candidate(5),89);\n assert.deepEqual(candidate(6),233);\n assert.deepEqual(candidate(7),1597);\n assert.deepEqual(candidate(8),28657);\n assert.deepEqual(candidate(9),514229);\n assert.deepEqual(candidate(10),433494437);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "ts", - "prompt": "//From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n// other and return them in order (smaller number, larger number).\n// >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n// (2.0, 2.2)\n// >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n// (2.0, 2.0)\nfunction find_closest_elements(numbers: number[]): [number, number] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = find_closest_elements;\n assert.deepEqual(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2]),[3.9, 4.0]);\n assert.deepEqual(candidate([1.0, 2.0, 5.9, 4.0, 5.0]),[5.0, 5.9]);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]),[2.0, 2.2]);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]),[2.0, 2.0]);\n assert.deepEqual(candidate([1.1, 2.2, 3.1, 4.1, 5.1]),[2.2, 3.1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "ts", - "prompt": "//You have been tasked to write a function that receives \n// a hexadecimal number as a string and counts the number of hexadecimal \n// digits that are primes (prime number, or a prime, is a natural number \n// greater than 1 that is not a product of two smaller natural numbers).\n// Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n// Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n// So you have to determine a number of the following digits: 2, 3, 5, 7, \n// B (=decimal 11), D (=decimal 13).\n// Note: you may assume the input is always correct or empty string, \n// and symbols A,B,C,D,E,F are always uppercase.\n// Examples:\n// For num = \"AB\" the output should be 1.\n// For num = \"1077E\" the output should be 2.\n// For num = \"ABED1A33\" the output should be 4.\n// For num = \"123456789ABCDEF0\" the output should be 6.\n// For num = \"2020\" the output should be 2.\nfunction hex_key(num: string): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = hex_key;\n assert.deepEqual(candidate(\"AB\"),1);\n assert.deepEqual(candidate(\"1077E\"),2);\n assert.deepEqual(candidate(\"ABED1A33\"),4);\n assert.deepEqual(candidate(\"2020\"),2);\n assert.deepEqual(candidate(\"123456789ABCDEF0\"),6);\n assert.deepEqual(candidate(\"112233445566778899AABBCCDDEEFF00\"),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "ts", - "prompt": "//Complete the function that takes two integers and returns \n// the product of their unit digits.\n// Assume the input is always valid.\n// Examples:\n// multiply(148, 412) should return 16.\n// multiply(19, 28) should return 72.\n// multiply(2020, 1851) should return 0.\n// multiply(14,-15) should return 20.\nfunction multiply(a: number, b: number): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = multiply;\n assert.deepEqual(candidate(148, 412),16);\n assert.deepEqual(candidate(19, 28),72);\n assert.deepEqual(candidate(2020, 1851),0);\n assert.deepEqual(candidate(14, -15),20);\n assert.deepEqual(candidate(76, 67),42);\n assert.deepEqual(candidate(17, 27),49);\n assert.deepEqual(candidate(0, 1),0);\n assert.deepEqual(candidate(0, 0),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "ts", - "prompt": "//Given list of numbers (of at least two elements), apply a linear transform to that list,\n// such that the smallest number will become 0 and the largest will become 1\n// >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n// [0.0, 0.25, 0.5, 0.75, 1.0]\nfunction rescale_to_unit(numbers: number[]): number[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = rescale_to_unit;\n assert.deepEqual(candidate([2.0, 49.9]),[0.0, 1.0]);\n assert.deepEqual(candidate([100.0, 49.9]),[1.0, 0.0]);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0]),[0.0, 0.25, 0.5, 0.75, 1.0]);\n assert.deepEqual(candidate([2.0, 1.0, 5.0, 3.0, 4.0]),[0.25, 0.0, 1.0, 0.5, 0.75]);\n assert.deepEqual(candidate([12.0, 11.0, 15.0, 13.0, 14.0]),[0.25, 0.0, 1.0, 0.5, 0.75]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "ts", - "prompt": "//Given a positive integer n, return the product of the odd digits.\n// Return 0 if all digits are even.\n// For example:\n// digits(1) == 1\n// digits(4) == 0\n// digits(235) == 15\nfunction digits(n: number): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = digits;\n assert.deepEqual(candidate(5),5);\n assert.deepEqual(candidate(54),5);\n assert.deepEqual(candidate(120),1);\n assert.deepEqual(candidate(5014),5);\n assert.deepEqual(candidate(98765),315);\n assert.deepEqual(candidate(5576543),2625);\n assert.deepEqual(candidate(2468),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "ts", - "prompt": "//You will be given the name of a class (a string) and a list of extensions.\n// The extensions are to be used to load additional classes to the class. The\n// strength of the extension is as follows: Let CAP be the number of the uppercase\n// letters in the extension's name, and let SM be the number of lowercase letters \n// in the extension's name, the strength is given by the fraction CAP - SM. \n// You should find the strongest extension and return a string in this \n// format: ClassName.StrongestExtensionName.\n// If there are two or more extensions with the same strength, you should\n// choose the one that comes first in the list.\n// For example, if you are given \"Slices\" as the class and a list of the\n// extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n// return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n// (its strength is -1).\n// Example:\n// for Strongest_Extension('my_class', ['AA', 'Be', 'CC']) == 'my_class.AA'\nfunction Strongest_Extension(class_name: string, extensions: string[]): string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = Strongest_Extension;\n assert.deepEqual(candidate(\"Watashi\", [\"tEN\", \"niNE\", \"eIGHt8OKe\"]),\"Watashi.eIGHt8OKe\");\n assert.deepEqual(candidate(\"Boku123\", [\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"]),\"Boku123.YEs.WeCaNe\");\n assert.deepEqual(candidate(\"__YESIMHERE\", [\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"]),\"__YESIMHERE.NuLl__\");\n assert.deepEqual(candidate(\"K\", [\"Ta\", \"TAR\", \"t234An\", \"cosSo\"]),\"K.TAR\");\n assert.deepEqual(candidate(\"__HAHA\", [\"Tab\", \"123\", \"781345\", \"-_-\"]),\"__HAHA.123\");\n assert.deepEqual(candidate(\"YameRore\", [\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"]),\"YameRore.okIWILL123\");\n assert.deepEqual(candidate(\"finNNalLLly\", [\"Die\", \"NowW\", \"Wow\", \"WoW\"]),\"finNNalLLly.WoW\");\n assert.deepEqual(candidate(\"_\", [\"Bb\", \"91245\"]),\"_.Bb\");\n assert.deepEqual(candidate(\"Sp\", [\"671235\", \"Bb\"]),\"Sp.671235\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "ts", - "prompt": "//Given a string representing a space separated lowercase letters, return a dictionary\n// of the letter with the most repetition and containing the corresponding count.\n// If several letters have the same occurrence, return all of them.\n// Example:\n// histogram('a b c') == {'a': 1, 'b': 1, 'c': 1}\n// histogram('a b b a') == {'a': 2, 'b': 2}\n// histogram('a b c a b') == {'a': 2, 'b': 2}\n// histogram('b b b b a') == {'b': 4}\n// histogram('') == {}\nfunction histogram(test: string): {[key: string]: number} {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = histogram;\n assert.deepEqual(candidate(\"a b b a\"),{\"a\": 2, \"b\": 2});\n assert.deepEqual(candidate(\"a b c a b\"),{\"a\": 2, \"b\": 2});\n assert.deepEqual(candidate(\"a b c d g\"),{\"a\": 1, \"b\": 1, \"c\": 1, \"d\": 1, \"g\": 1});\n assert.deepEqual(candidate(\"r t g\"),{\"r\": 1, \"t\": 1, \"g\": 1});\n assert.deepEqual(candidate(\"b b b b a\"),{\"b\": 4});\n assert.deepEqual(candidate(\"r t g\"),{\"r\": 1, \"t\": 1, \"g\": 1});\n assert.deepEqual(candidate(\"\"),{});\n assert.deepEqual(candidate(\"a\"),{\"a\": 1});\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "ts", - "prompt": "//pairs_sum_to_zero takes a list of integers as an input.\n// it returns True if there are two distinct elements in the list that\n// sum to zero, and False otherwise.\n// >>> pairs_sum_to_zero([1, 3, 5, 0])\n// False\n// >>> pairs_sum_to_zero([1, 3, -2, 1])\n// False\n// >>> pairs_sum_to_zero([1, 2, 3, 7])\n// False\n// >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7])\n// True\n// >>> pairs_sum_to_zero([1])\n// False\nfunction pairs_sum_to_zero(l: number[]): boolean {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = pairs_sum_to_zero;\n assert.deepEqual(candidate([1, 3, 5, 0]),false);\n assert.deepEqual(candidate([1, 3, -2, 1]),false);\n assert.deepEqual(candidate([1, 2, 3, 7]),false);\n assert.deepEqual(candidate([2, 4, -5, 3, 5, 7]),true);\n assert.deepEqual(candidate([1]),false);\n assert.deepEqual(candidate([-3, 9, -1, 3, 2, 30]),true);\n assert.deepEqual(candidate([-3, 9, -1, 3, 2, 31]),true);\n assert.deepEqual(candidate([-3, 9, -1, 4, 2, 30]),false);\n assert.deepEqual(candidate([-3, 9, -1, 4, 2, 31]),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "ts", - "prompt": "//Write a function that accepts two lists of strings and returns the list that has \n// total number of chars in the all strings of the list less than the other list.\n// if the two lists have the same number of chars, return the first list.\n// Examples\n// total_match([], []) \u279e []\n// total_match(['hi', 'admin'], ['hI', 'Hi']) \u279e ['hI', 'Hi']\n// total_match(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) \u279e ['hi', 'admin']\n// total_match(['hi', 'admin'], ['hI', 'hi', 'hi']) \u279e ['hI', 'hi', 'hi']\n// total_match(['4'], ['1', '2', '3', '4', '5']) \u279e ['4']\nfunction total_match(lst1: string[], lst2: string[]): string[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = total_match;\n assert.deepEqual(candidate([], []),[]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\"]),[\"hi\", \"hi\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"]),[\"hi\", \"admin\"]);\n assert.deepEqual(candidate([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"]),[\"4\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hI\", \"Hi\"]),[\"hI\", \"Hi\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"]),[\"hI\", \"hi\", \"hi\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hii\"]),[\"hi\", \"admin\"]);\n assert.deepEqual(candidate([], [\"this\"]),[]);\n assert.deepEqual(candidate([\"this\"], []),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "ts", - "prompt": "//Circular shift the digits of the integer x, shift the digits right by shift\n// and return the result as a string.\n// If shift > number of digits, return digits reversed.\n// >>> circular_shift(12, 1)\n// \"21\"\n// >>> circular_shift(12, 2)\n// \"12\"\nfunction circular_shift(x: number, shift: number): string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = circular_shift;\n assert.deepEqual(candidate(100, 2),\"001\");\n assert.deepEqual(candidate(12, 2),\"12\");\n assert.deepEqual(candidate(97, 8),\"79\");\n assert.deepEqual(candidate(12, 1),\"21\");\n assert.deepEqual(candidate(11, 101),\"11\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "ts", - "prompt": "//Return True is list elements are monotonically increasing or decreasing.\n// >>> monotonic([1, 2, 4, 20])\n// True\n// >>> monotonic([1, 20, 4, 10])\n// False\n// >>> monotonic([4, 1, 0, -10])\n// True\nfunction monotonic(l: number[]): boolean {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = monotonic;\n assert.deepEqual(candidate([1, 2, 4, 10]),true);\n assert.deepEqual(candidate([1, 2, 4, 20]),true);\n assert.deepEqual(candidate([1, 20, 4, 10]),false);\n assert.deepEqual(candidate([4, 1, 0, -10]),true);\n assert.deepEqual(candidate([4, 1, 1, 0]),true);\n assert.deepEqual(candidate([1, 2, 3, 2, 5, 60]),false);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 60]),true);\n assert.deepEqual(candidate([9, 9, 9, 9]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "ts", - "prompt": "//Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n// Example\n// is_equal_to_sum_even(4) == False\n// is_equal_to_sum_even(6) == False\n// is_equal_to_sum_even(8) == True\nfunction is_equal_to_sum_even(n: number): boolean {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_equal_to_sum_even;\n assert.deepEqual(candidate(4),false);\n assert.deepEqual(candidate(6),false);\n assert.deepEqual(candidate(8),true);\n assert.deepEqual(candidate(10),true);\n assert.deepEqual(candidate(11),false);\n assert.deepEqual(candidate(12),true);\n assert.deepEqual(candidate(13),false);\n assert.deepEqual(candidate(16),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "ts", - "prompt": "//Input to this function is a string representing musical notes in a special ASCII format.\n// Your task is to parse this string and return list of integers corresponding to how many beats does each\n// not last.\n// Here is a legend:\n// 'o' - whole note, lasts four beats\n// 'o|' - half note, lasts two beats\n// '.|' - quater note, lasts one beat\n// >>> parse_music('o o| .| o| o| .| .| .| .| o o')\n// [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\nfunction parse_music(music_string: string): number[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = parse_music;\n assert.deepEqual(candidate(\"\"),[]);\n assert.deepEqual(candidate(\"o o o o\"),[4, 4, 4, 4]);\n assert.deepEqual(candidate(\".| .| .| .|\"),[1, 1, 1, 1]);\n assert.deepEqual(candidate(\"o| o| .| .| o o o o\"),[2, 2, 1, 1, 4, 4, 4, 4]);\n assert.deepEqual(candidate(\"o| .| o| .| o o| o o|\"),[2, 1, 2, 1, 4, 2, 4, 2]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "ts", - "prompt": "//\"\n// This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n// multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n// change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n// Examples:\n// For lst = [1,2,3] the output should be 6\n// For lst = [] the output should be 0\n// For lst = [-1,-5,2,-1,-5] the output should be -126\nfunction sum_squares(lst: number[]): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_squares;\n assert.deepEqual(candidate([1, 2, 3]),6);\n assert.deepEqual(candidate([1, 4, 9]),14);\n assert.deepEqual(candidate([]),0);\n assert.deepEqual(candidate([1, 1, 1, 1, 1, 1, 1, 1, 1]),9);\n assert.deepEqual(candidate([-1, -1, -1, -1, -1, -1, -1, -1, -1]),-3);\n assert.deepEqual(candidate([0]),0);\n assert.deepEqual(candidate([-1, -5, 2, -1, -5]),-126);\n assert.deepEqual(candidate([-56, -99, 1, 0, -2]),3030);\n assert.deepEqual(candidate([-1, 0, 0, 0, 0, 0, 0, 0, -1]),0);\n assert.deepEqual(candidate([-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37]),-14196);\n assert.deepEqual(candidate([-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10]),-1448);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "ts", - "prompt": "//triples_sum_to_zero takes a list of integers as an input.\n// it returns True if there are three distinct elements in the list that\n// sum to zero, and False otherwise.\n// >>> triples_sum_to_zero([1, 3, 5, 0])\n// False\n// >>> triples_sum_to_zero([1, 3, -2, 1])\n// True\n// >>> triples_sum_to_zero([1, 2, 3, 7])\n// False\n// >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n// True\n// >>> triples_sum_to_zero([1])\n// False\nfunction triples_sum_to_zero(l: number[]): boolean {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = triples_sum_to_zero;\n assert.deepEqual(candidate([1, 3, 5, 0]),false);\n assert.deepEqual(candidate([1, 3, 5, -1]),false);\n assert.deepEqual(candidate([1, 3, -2, 1]),true);\n assert.deepEqual(candidate([1, 2, 3, 7]),false);\n assert.deepEqual(candidate([1, 2, 5, 7]),false);\n assert.deepEqual(candidate([2, 4, -5, 3, 9, 7]),true);\n assert.deepEqual(candidate([1]),false);\n assert.deepEqual(candidate([1, 3, 5, -100]),false);\n assert.deepEqual(candidate([100, 3, 5, -100]),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "ts", - "prompt": "//brackets is a string of \"<\" and \">\".\n// return True if every opening bracket has a corresponding closing bracket.\n// >>> correct_bracketing(\"<\")\n// False\n// >>> correct_bracketing(\"<>\")\n// True\n// >>> correct_bracketing(\"<<><>>\")\n// True\n// >>> correct_bracketing(\"><<>\")\n// False\nfunction correct_bracketing(brackets: string): boolean {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = correct_bracketing;\n assert.deepEqual(candidate(\"<>\"),true);\n assert.deepEqual(candidate(\"<<><>>\"),true);\n assert.deepEqual(candidate(\"<><><<><>><>\"),true);\n assert.deepEqual(candidate(\"<><><<<><><>><>><<><><<>>>\"),true);\n assert.deepEqual(candidate(\"<<<><>>>>\"),false);\n assert.deepEqual(candidate(\"><<>\"),false);\n assert.deepEqual(candidate(\"<\"),false);\n assert.deepEqual(candidate(\"<<<<\"),false);\n assert.deepEqual(candidate(\">\"),false);\n assert.deepEqual(candidate(\"<<>\"),false);\n assert.deepEqual(candidate(\"<><><<><>><>><<>\"),false);\n assert.deepEqual(candidate(\"<><><<><>><>>><>\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "ts", - "prompt": "//Write a function that takes an array of numbers as input and returns \n// the number of elements in the array that are greater than 10 and both \n// first and last digits of a number are odd (1, 3, 5, 7, 9).\n// For example:\n// specialFilter([15, -73, 14, -15]) => 1 \n// specialFilter([33, -2, -3, 45, 21, 109]) => 2\nfunction specialFilter(nums: number[]): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = specialFilter;\n assert.deepEqual(candidate([5, -2, 1, -5]),0);\n assert.deepEqual(candidate([15, -73, 14, -15]),1);\n assert.deepEqual(candidate([33, -2, -3, 45, 21, 109]),2);\n assert.deepEqual(candidate([43, -12, 93, 125, 121, 109]),4);\n assert.deepEqual(candidate([71, -2, -33, 75, 21, 19]),3);\n assert.deepEqual(candidate([1]),0);\n assert.deepEqual(candidate([]),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "ts", - "prompt": "//Given a dictionary, return True if all keys are strings in lower \n// case or all keys are strings in upper case, else return False.\n// The function should return False is the given dictionary is empty.\n// Examples:\n// check_dict_case({\"a\":\"apple\", \"b\":\"banana\"}) should return True.\n// check_dict_case({\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}) should return False.\n// check_dict_case({\"a\":\"apple\", \"8\":\"banana\", \"a\":\"apple\"}) should return False.\n// check_dict_case({\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}) should return False.\n// check_dict_case({\"STATE\":\"NC\", \"ZIP\":\"12345\" }) should return True.\nfunction check_dict_case(dict: {[key: string]: string}): boolean {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = check_dict_case;\n assert.deepEqual(candidate({\"p\": \"pineapple\", \"b\": \"banana\"}),true);\n assert.deepEqual(candidate({\"p\": \"pineapple\", \"A\": \"banana\", \"B\": \"banana\"}),false);\n assert.deepEqual(candidate({\"p\": \"pineapple\", \"5\": \"banana\", \"a\": \"apple\"}),false);\n assert.deepEqual(candidate({\"Name\": \"John\", \"Age\": \"36\", \"City\": \"Houston\"}),false);\n assert.deepEqual(candidate({\"STATE\": \"NC\", \"ZIP\": \"12345\"}),true);\n assert.deepEqual(candidate({\"fruit\": \"Orange\", \"taste\": \"Sweet\"}),true);\n assert.deepEqual(candidate({}),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "ts", - "prompt": "//Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n// should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n// alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n// Examples\n// split_words(\"Hello world!\") \u279e [\"Hello\", \"world!\"]\n// split_words(\"Hello,world!\") \u279e [\"Hello\", \"world!\"]\n// split_words(\"abcdef\") == 3\nfunction split_words(txt: string): string[]| number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = split_words;\n assert.deepEqual(candidate(\"Hello world!\"),[\"Hello\", \"world!\"]);\n assert.deepEqual(candidate(\"Hello,world!\"),[\"Hello\", \"world!\"]);\n assert.deepEqual(candidate(\"Hello world,!\"),[\"Hello\", \"world,!\"]);\n assert.deepEqual(candidate(\"Hello,Hello,world !\"),[\"Hello,Hello,world\", \"!\"]);\n assert.deepEqual(candidate(\"abcdef\"),3);\n assert.deepEqual(candidate(\"aaabb\"),2);\n assert.deepEqual(candidate(\"aaaBb\"),1);\n assert.deepEqual(candidate(\"\"),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "ts", - "prompt": "//The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fibfib(0) == 0\n// fibfib(1) == 0\n// fibfib(2) == 1\n// fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n// Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n// >>> fibfib(1)\n// 0\n// >>> fibfib(5)\n// 4\n// >>> fibfib(8)\n// 24\nfunction fibfib(n: number): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fibfib;\n assert.deepEqual(candidate(2),1);\n assert.deepEqual(candidate(1),0);\n assert.deepEqual(candidate(5),4);\n assert.deepEqual(candidate(8),24);\n assert.deepEqual(candidate(10),81);\n assert.deepEqual(candidate(12),274);\n assert.deepEqual(candidate(14),927);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "ts", - "prompt": "//You are given a list of numbers.\n// You need to return the sum of squared numbers in the given list,\n// round each element in the list to the upper int(Ceiling) first.\n// Examples:\n// For lst = [1,2,3] the output should be 14\n// For lst = [1,4,9] the output should be 98\n// For lst = [1,3,5,7] the output should be 84\n// For lst = [1.4,4.2,0] the output should be 29\n// For lst = [-2.4,1,1] the output should be 6\nfunction sum_squares(lst: number[]): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_squares;\n assert.deepEqual(candidate([1.0, 2.0, 3.0]),14);\n assert.deepEqual(candidate([1.0, 2.0, 3.0]),14);\n assert.deepEqual(candidate([1.0, 3.0, 5.0, 7.0]),84);\n assert.deepEqual(candidate([1.4, 4.2, 0.0]),29);\n assert.deepEqual(candidate([-2.4, 1.0, 1.0]),6);\n assert.deepEqual(candidate([100.0, 1.0, 15.0, 2.0]),10230);\n assert.deepEqual(candidate([10000.0, 10000.0]),200000000);\n assert.deepEqual(candidate([-1.4, 4.6, 6.3]),75);\n assert.deepEqual(candidate([-1.4, 17.9, 18.9, 19.9]),1086);\n assert.deepEqual(candidate([0.0]),0);\n assert.deepEqual(candidate([-1.0]),1);\n assert.deepEqual(candidate([-1.0, 1.0, 0.0]),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_85_add", - "language": "ts", - "prompt": "//Given a non-empty list of integers lst. add the even elements that are at odd indices..\n// Examples:\n// add([4, 2, 6, 7]) ==> 2\nfunction add(lst: number[]): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = add;\n assert.deepEqual(candidate([4, 88]),88);\n assert.deepEqual(candidate([4, 5, 6, 7, 2, 122]),122);\n assert.deepEqual(candidate([4, 0, 6, 7]),0);\n assert.deepEqual(candidate([4, 4, 6, 8]),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "ts", - "prompt": "//Return sorted unique elements in a list\n// >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123])\n// [0, 2, 3, 5, 9, 123]\nfunction unique(l: number[]): number[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = unique;\n assert.deepEqual(candidate([5, 3, 5, 2, 3, 3, 9, 0, 123]),[0, 2, 3, 5, 9, 123]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "ts", - "prompt": "//Given a string text, replace all spaces in it with underscores, \n// and if a string has more than 2 consecutive spaces, \n// then replace all consecutive spaces with - \n// fix_spaces(\"Example\") == \"Example\"\n// fix_spaces(\"Example 1\") == \"Example_1\"\n// fix_spaces(\" Example 2\") == \"_Example_2\"\n// fix_spaces(\" Example 3\") == \"_Example-3\"\nfunction fix_spaces(text: string): string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fix_spaces;\n assert.deepEqual(candidate(\"Example\"),\"Example\");\n assert.deepEqual(candidate(\"Mudasir Hanif \"),\"Mudasir_Hanif_\");\n assert.deepEqual(candidate(\"Yellow Yellow Dirty Fellow\"),\"Yellow_Yellow__Dirty__Fellow\");\n assert.deepEqual(candidate(\"Exa mple\"),\"Exa-mple\");\n assert.deepEqual(candidate(\" Exa 1 2 2 mple\"),\"-Exa_1_2_2_mple\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "ts", - "prompt": "//Return 2^n modulo p (be aware of numerics).\n// >>> modp(3, 5)\n// 3\n// >>> modp(1101, 101)\n// 2\n// >>> modp(0, 101)\n// 1\n// >>> modp(3, 11)\n// 8\n// >>> modp(100, 101)\n// 1\nfunction modp(n: number, p: number): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = modp;\n assert.deepEqual(candidate(3, 5),3);\n assert.deepEqual(candidate(1101, 101),2);\n assert.deepEqual(candidate(0, 101),1);\n assert.deepEqual(candidate(3, 11),8);\n assert.deepEqual(candidate(100, 101),1);\n assert.deepEqual(candidate(30, 5),4);\n assert.deepEqual(candidate(31, 5),3);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "ts", - "prompt": "//You have to write a function which validates a given date string and\n// returns True if the date is valid otherwise False.\n// The date is valid if all of the following rules are satisfied:\n// 1. The date string is not empty.\n// 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n// 3. The months should not be less than 1 or higher than 12.\n// 4. The date should be in the format: mm-dd-yyyy\n// for example: \n// valid_date('03-11-2000') => True\n// valid_date('15-01-2012') => False\n// valid_date('04-0-2040') => False\n// valid_date('06-04-2020') => True\n// valid_date('06/04/2020') => False\nfunction valid_date(date: string): boolean {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = valid_date;\n assert.deepEqual(candidate(\"03-11-2000\"),true);\n assert.deepEqual(candidate(\"15-01-2012\"),false);\n assert.deepEqual(candidate(\"04-0-2040\"),false);\n assert.deepEqual(candidate(\"06-04-2020\"),true);\n assert.deepEqual(candidate(\"01-01-2007\"),true);\n assert.deepEqual(candidate(\"03-32-2011\"),false);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"04-31-3000\"),false);\n assert.deepEqual(candidate(\"06-06-2005\"),true);\n assert.deepEqual(candidate(\"21-31-2000\"),false);\n assert.deepEqual(candidate(\"04-12-2003\"),true);\n assert.deepEqual(candidate(\"04122003\"),false);\n assert.deepEqual(candidate(\"20030412\"),false);\n assert.deepEqual(candidate(\"2003-04\"),false);\n assert.deepEqual(candidate(\"2003-04-12\"),false);\n assert.deepEqual(candidate(\"04-2003\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "ts", - "prompt": "//Write a function that takes a string and returns an ordered version of it.\n// Ordered version of string, is a string where all words (separated by space)\n// are replaced by a new word where all the characters arranged in\n// ascending order based on ascii value.\n// Note: You should keep the order of words and blank spaces in the sentence.\n// For example:\n// anti_shuffle('Hi') returns 'Hi'\n// anti_shuffle('hello') returns 'ehllo'\n// anti_shuffle('Hello World!!!') returns 'Hello !!!Wdlor'\nfunction anti_shuffle(s: string): string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = anti_shuffle;\n assert.deepEqual(candidate(\"Hi\"),\"Hi\");\n assert.deepEqual(candidate(\"hello\"),\"ehllo\");\n assert.deepEqual(candidate(\"number\"),\"bemnru\");\n assert.deepEqual(candidate(\"abcd\"),\"abcd\");\n assert.deepEqual(candidate(\"Hello World!!!\"),\"Hello !!!Wdlor\");\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"Hi. My name is Mister Robot. How are you?\"),\".Hi My aemn is Meirst .Rboot How aer ?ouy\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "ts", - "prompt": "//Given a list of numbers, return whether or not they are sorted\n// in ascending order. If list has more than 1 duplicate of the same\n// number, return False. Assume no negative numbers and only integers.\n// Examples\n// is_sorted([5]) \u279e True\n// is_sorted([1, 2, 3, 4, 5]) \u279e True\n// is_sorted([1, 3, 2, 4, 5]) \u279e False\n// is_sorted([1, 2, 3, 4, 5, 6]) \u279e True\n// is_sorted([1, 2, 3, 4, 5, 6, 7]) \u279e True\n// is_sorted([1, 3, 2, 4, 5, 6, 7]) \u279e False\n// is_sorted([1, 2, 2, 3, 3, 4]) \u279e True\n// is_sorted([1, 2, 2, 2, 3, 4]) \u279e False\nfunction is_sorted(lst: number[]): boolean {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_sorted;\n assert.deepEqual(candidate([5]),true);\n assert.deepEqual(candidate([1, 2, 3, 4, 5]),true);\n assert.deepEqual(candidate([1, 3, 2, 4, 5]),false);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6]),true);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6, 7]),true);\n assert.deepEqual(candidate([1, 3, 2, 4, 5, 6, 7]),false);\n assert.deepEqual(candidate([]),true);\n assert.deepEqual(candidate([1]),true);\n assert.deepEqual(candidate([3, 2, 1]),false);\n assert.deepEqual(candidate([1, 2, 2, 2, 3, 4]),false);\n assert.deepEqual(candidate([1, 2, 3, 3, 3, 4]),false);\n assert.deepEqual(candidate([1, 2, 2, 3, 3, 4]),true);\n assert.deepEqual(candidate([1, 2, 3, 4]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "ts", - "prompt": "//You are given a string s.\n// Your task is to check if the string is happy or not.\n// A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n// For example:\n// is_happy(a) => False\n// is_happy(aa) => False\n// is_happy(abcd) => True\n// is_happy(aabb) => False\n// is_happy(adb) => True\n// is_happy(xyy) => False\nfunction is_happy(s: string): boolean {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_happy;\n assert.deepEqual(candidate(\"a\"),false);\n assert.deepEqual(candidate(\"aa\"),false);\n assert.deepEqual(candidate(\"abcd\"),true);\n assert.deepEqual(candidate(\"aabb\"),false);\n assert.deepEqual(candidate(\"adb\"),true);\n assert.deepEqual(candidate(\"xyy\"),false);\n assert.deepEqual(candidate(\"iopaxpoi\"),true);\n assert.deepEqual(candidate(\"iopaxioi\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "ts", - "prompt": "//Write a function that returns True if the object q will fly, and False otherwise.\n// The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n// Example:\n// will_it_fly([1, 2], 5) \u279e False \n// # 1+2 is less than the maximum possible weight, but it's unbalanced.\n// will_it_fly([3, 2, 3], 1) \u279e False\n// # it's balanced, but 3+2+3 is more than the maximum possible weight.\n// will_it_fly([3, 2, 3], 9) \u279e True\n// # 3+2+3 is less than the maximum possible weight, and it's balanced.\n// will_it_fly([3], 5) \u279e True\n// # 3 is less than the maximum possible weight, and it's balanced.\nfunction will_it_fly(q: number[], w: number): boolean {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = will_it_fly;\n assert.deepEqual(candidate([3, 2, 3], 9),true);\n assert.deepEqual(candidate([1, 2], 5),false);\n assert.deepEqual(candidate([3], 5),true);\n assert.deepEqual(candidate([3, 2, 3], 1),false);\n assert.deepEqual(candidate([1, 2, 3], 6),false);\n assert.deepEqual(candidate([5], 5),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "ts", - "prompt": "//Given an array of non-negative integers, return a copy of the given array after sorting,\n// you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n// or sort it in descending order if the sum( first index value, last index value) is even.\n// Note:\n// * don't change the given array.\n// Examples:\n// * sort_array([]) => []\n// * sort_array([5]) => [5]\n// * sort_array([2, 4, 3, 0, 1, 5]) => [0, 1, 2, 3, 4, 5]\n// * sort_array([2, 4, 3, 0, 1, 5, 6]) => [6, 5, 4, 3, 2, 1, 0]\nfunction sort_array(array: number[]): number[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_array;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([5]),[5]);\n assert.deepEqual(candidate([2, 4, 3, 0, 1, 5]),[0, 1, 2, 3, 4, 5]);\n assert.deepEqual(candidate([2, 4, 3, 0, 1, 5, 6]),[6, 5, 4, 3, 2, 1, 0]);\n assert.deepEqual(candidate([2, 1]),[1, 2]);\n assert.deepEqual(candidate([15, 42, 87, 32, 11, 0]),[0, 11, 15, 32, 42, 87]);\n assert.deepEqual(candidate([21, 14, 23, 11]),[23, 21, 14, 11]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "ts", - "prompt": "//Implement a function that takes an non-negative integer and returns an array of the first n\n// integers that are prime numbers and less than n.\n// for example:\n// count_up_to(5) => [2,3]\n// count_up_to(11) => [2,3,5,7]\n// count_up_to(0) => []\n// count_up_to(20) => [2,3,5,7,11,13,17,19]\n// count_up_to(1) => []\n// count_up_to(18) => [2,3,5,7,11,13,17]\nfunction count_up_to(n: number): number[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_up_to;\n assert.deepEqual(candidate(5),[2, 3]);\n assert.deepEqual(candidate(6),[2, 3, 5]);\n assert.deepEqual(candidate(7),[2, 3, 5]);\n assert.deepEqual(candidate(10),[2, 3, 5, 7]);\n assert.deepEqual(candidate(0),[]);\n assert.deepEqual(candidate(22),[2, 3, 5, 7, 11, 13, 17, 19]);\n assert.deepEqual(candidate(1),[]);\n assert.deepEqual(candidate(18),[2, 3, 5, 7, 11, 13, 17]);\n assert.deepEqual(candidate(47),[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43]);\n assert.deepEqual(candidate(101),[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "ts", - "prompt": "//Out of list of strings, return the longest one. Return the first one in case of multiple\n// strings of the same length. Return None in case the input list is empty.\n// >>> longest([])\n// >>> longest(['a', 'b', 'c'])\n// 'a'\n// >>> longest(['a', 'bb', 'ccc'])\n// 'ccc'\nfunction longest(strings: string[]): string | undefined {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = longest;\n assert.deepEqual(candidate([]),undefined);\n assert.deepEqual(candidate([\"x\", \"y\", \"z\"]),\"x\");\n assert.deepEqual(candidate([\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"]),\"zzzz\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "ts", - "prompt": "//Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n// reverse the resulting array, and then replace each digit by its corresponding name from\n// \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n// For example:\n// arr = [2, 1, 1, 4, 5, 8, 2, 3] \n// -> sort arr -> [1, 1, 2, 2, 3, 4, 5, 8] \n// -> reverse arr -> [8, 5, 4, 3, 2, 2, 1, 1]\n// return [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n// If the array is empty, return an empty array:\n// arr = []\n// return []\n// If the array has any strange number ignore it:\n// arr = [1, -1 , 55] \n// -> sort arr -> [-1, 1, 55]\n// -> reverse arr -> [55, 1, -1]\n// return = ['One']\nfunction by_length(arr: number[]): string[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = by_length;\n assert.deepEqual(candidate([2, 1, 1, 4, 5, 8, 2, 3]),[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, -1, 55]),[\"One\"]);\n assert.deepEqual(candidate([1, -1, 3, 2]),[\"Three\", \"Two\", \"One\"]);\n assert.deepEqual(candidate([9, 4, 8]),[\"Nine\", \"Eight\", \"Four\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_106_f", - "language": "ts", - "prompt": "//Implement the function f that takes n as a parameter,\n// 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\n// or the sum of numbers from 1 to i otherwise.\n// i starts from 1.\n// the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n// Example:\n// f(5) == [1, 2, 6, 24, 15]\nfunction f(n: number): number[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = f;\n assert.deepEqual(candidate(5),[1, 2, 6, 24, 15]);\n assert.deepEqual(candidate(7),[1, 2, 6, 24, 15, 720, 28]);\n assert.deepEqual(candidate(1),[1]);\n assert.deepEqual(candidate(3),[1, 2, 6]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "ts", - "prompt": "//Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n// >>> fizz_buzz(50)\n// 0\n// >>> fizz_buzz(78)\n// 2\n// >>> fizz_buzz(79)\n// 3\nfunction fizz_buzz(n: number): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fizz_buzz;\n assert.deepEqual(candidate(50),0);\n assert.deepEqual(candidate(78),2);\n assert.deepEqual(candidate(79),3);\n assert.deepEqual(candidate(100),3);\n assert.deepEqual(candidate(200),6);\n assert.deepEqual(candidate(4000),192);\n assert.deepEqual(candidate(10000),639);\n assert.deepEqual(candidate(100000),8026);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "ts", - "prompt": "//Given a positive floating point number, it can be decomposed into\n// and integer part (largest integer smaller than given number) and decimals\n// (leftover part always smaller than 1).\n// Return the decimal part of the number.\n// >>> truncate_number(3.5)\n// 0.5\nfunction truncate_number(number: number): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = truncate_number;\n assert.deepEqual(candidate(3.5),0.5);\n assert.deepEqual(candidate(1.25),0.25);\n assert.deepEqual(candidate(123.0),0.0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "ts", - "prompt": "//For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n// Empty sum should be equal to 0 and empty product should be equal to 1.\n// >>> sum_product([])\n// (0, 1)\n// >>> sum_product([1, 2, 3, 4])\n// (10, 24)\nfunction sum_product(numbers: number[]): [number, number] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_product;\n assert.deepEqual(candidate([]),[0, 1]);\n assert.deepEqual(candidate([1, 1, 1]),[3, 1]);\n assert.deepEqual(candidate([100, 0]),[100, 0]);\n assert.deepEqual(candidate([3, 5, 7]),[15, 105]);\n assert.deepEqual(candidate([10]),[10, 10]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "ts", - "prompt": "//You are given a 2 dimensional data, as a nested lists,\n// which is similar to matrix, however, unlike matrices,\n// each row may contain a different number of columns.\n// Given lst, and integer x, find integers x in the list,\n// and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n// each tuple is a coordinate - (row, columns), starting with 0.\n// Sort coordinates initially by rows in ascending order.\n// Also, sort coordinates of the row by columns in descending order.\n// Examples:\n// get_row([\n// [1,2,3,4,5,6],\n// [1,2,3,4,1,6],\n// [1,2,3,4,5,1]\n// ], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n// get_row([], 1) == []\n// get_row([[], [1], [1, 2, 3]], 3) == [(2, 2)]\nfunction get_row(lst: number[][], x: number): [number, number][] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_row;\n assert.deepEqual(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1),[[0, 0], [1, 4], [1, 0], [2, 5], [2, 0]]);\n assert.deepEqual(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6]], 2),[[0, 1], [1, 1], [2, 1], [3, 1], [4, 1], [5, 1]]);\n assert.deepEqual(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 1, 3, 4, 5, 6], [1, 2, 1, 4, 5, 6], [1, 2, 3, 1, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1),[[0, 0], [1, 0], [2, 1], [2, 0], [3, 2], [3, 0], [4, 3], [4, 0], [5, 4], [5, 0], [6, 5], [6, 0]]);\n assert.deepEqual(candidate([], 1),[]);\n assert.deepEqual(candidate([[1]], 2),[]);\n assert.deepEqual(candidate([[], [1], [1, 2, 3]], 3),[[2, 2]]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "ts", - "prompt": "//You're a hungry rabbit, and you already have eaten a certain number of carrots,\n// but now you need to eat more carrots to complete the day's meals.\n// you should return an array of [ total number of eaten carrots after your meals,\n// the number of carrots left after your meals ]\n// if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n// Example:\n// * eat(5, 6, 10) -> [11, 4]\n// * eat(4, 8, 9) -> [12, 1]\n// * eat(1, 10, 10) -> [11, 0]\n// * eat(2, 11, 5) -> [7, 0]\n// Variables:\n// @number : integer\n// the number of carrots that you have eaten.\n// @need : integer\n// the number of carrots that you need to eat.\n// @remaining : integer\n// the number of remaining carrots thet exist in stock\n// Constrain:\n// * 0 <= number <= 1000\n// * 0 <= need <= 1000\n// * 0 <= remaining <= 1000\n// Have fun :)\nfunction eat(number: number, need: number, remaining: number): number[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = eat;\n assert.deepEqual(candidate(5, 6, 10),[11, 4]);\n assert.deepEqual(candidate(4, 8, 9),[12, 1]);\n assert.deepEqual(candidate(1, 10, 10),[11, 0]);\n assert.deepEqual(candidate(2, 11, 5),[7, 0]);\n assert.deepEqual(candidate(4, 5, 7),[9, 2]);\n assert.deepEqual(candidate(4, 5, 1),[5, 0]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "ts", - "prompt": "//Given a positive integer N, return the total sum of its digits in binary.\n// Example\n// For N = 1000, the sum of digits will be 1 the output should be \"1\".\n// For N = 150, the sum of digits will be 6 the output should be \"110\".\n// For N = 147, the sum of digits will be 12 the output should be \"1100\".\n// Variables:\n// @N integer\n// Constraints: 0 \u2264 N \u2264 10000.\n// Output:\n// a string of binary number\nfunction solve(N: number): string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = solve;\n assert.deepEqual(candidate(1000),\"1\");\n assert.deepEqual(candidate(150),\"110\");\n assert.deepEqual(candidate(147),\"1100\");\n assert.deepEqual(candidate(333),\"1001\");\n assert.deepEqual(candidate(963),\"10010\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "ts", - "prompt": "//You are given a list of integers.\n// You need to find the largest prime value and return the sum of its digits.\n// Examples:\n// For lst = [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] the output should be 10\n// For lst = [1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1] the output should be 25\n// For lst = [1,3,1,32,5107,34,83278,109,163,23,2323,32,30,1,9,3] the output should be 13\n// For lst = [0,724,32,71,99,32,6,0,5,91,83,0,5,6] the output should be 11\n// For lst = [0,81,12,3,1,21] the output should be 3\n// For lst = [0,8,1,2,1,7] the output should be 7\nfunction skjkasdkd(lst: number[]): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = skjkasdkd;\n assert.deepEqual(candidate([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]),10);\n assert.deepEqual(candidate([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]),25);\n assert.deepEqual(candidate([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]),13);\n assert.deepEqual(candidate([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]),11);\n assert.deepEqual(candidate([0, 81, 12, 3, 1, 21]),3);\n assert.deepEqual(candidate([0, 8, 1, 2, 1, 7]),7);\n assert.deepEqual(candidate([8191]),19);\n assert.deepEqual(candidate([8191, 123456, 127, 7]),19);\n assert.deepEqual(candidate([127, 97, 8192]),10);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "ts", - "prompt": "//Given an array arr of integers, find the minimum number of elements that\n// need to be changed to make the array palindromic. A palindromic array is an array that\n// is read the same backwards and forwards. In one change, you can change one element to any other element.\n// For example:\n// smallest_change([1,2,3,5,4,7,9,6]) == 4\n// smallest_change([1, 2, 3, 4, 3, 2, 2]) == 1\n// smallest_change([1, 2, 3, 2, 1]) == 0\nfunction smallest_change(arr: number[]): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = smallest_change;\n assert.deepEqual(candidate([1, 2, 3, 5, 4, 7, 9, 6]),4);\n assert.deepEqual(candidate([1, 2, 3, 4, 3, 2, 2]),1);\n assert.deepEqual(candidate([1, 4, 2]),1);\n assert.deepEqual(candidate([1, 4, 4, 2]),1);\n assert.deepEqual(candidate([1, 2, 3, 2, 1]),0);\n assert.deepEqual(candidate([3, 1, 1, 3]),0);\n assert.deepEqual(candidate([1]),0);\n assert.deepEqual(candidate([0, 1]),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "ts", - "prompt": "//It is the last week of the semester and the teacher has to give the grades\n// to students. The teacher has been making her own algorithm for grading.\n// The only problem is, she has lost the code she used for grading.\n// She has given you a list of GPAs for some students and you have to write \n// a function that can output a list of letter grades using the following table:\n// GPA | Letter grade\n// 4.0 A+\n// > 3.7 A \n// > 3.3 A- \n// > 3.0 B+\n// > 2.7 B \n// > 2.3 B-\n// > 2.0 C+\n// > 1.7 C\n// > 1.3 C-\n// > 1.0 D+ \n// > 0.7 D \n// > 0.0 D-\n// 0.0 E\n// Example:\n// grade_equation([4.0, 3, 1.7, 2, 3.5]) ==> ['A+', 'B', 'C-', 'C', 'A-']\nfunction numerical_letter_grade(grades: number[]): string[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = numerical_letter_grade;\n assert.deepEqual(candidate([4.0, 3, 1.7, 2, 3.5]),[\"A+\", \"B\", \"C-\", \"C\", \"A-\"]);\n assert.deepEqual(candidate([1.2]),[\"D+\"]);\n assert.deepEqual(candidate([0.5]),[\"D-\"]);\n assert.deepEqual(candidate([0.0]),[\"E\"]);\n assert.deepEqual(candidate([1.0, 0.3, 1.5, 2.8, 3.3]),[\"D\", \"D-\", \"C-\", \"B\", \"B+\"]);\n assert.deepEqual(candidate([0.0, 0.7]),[\"E\", \"D-\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "ts", - "prompt": "//Given the lengths of the three sides of a triangle. Return the area of\n// the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n// Otherwise return -1\n// Three sides make a valid triangle when the sum of any two sides is greater \n// than the third side.\n// Example:\n// triangle_area(3, 4, 5) == 6.00\n// triangle_area(1, 2, 10) == -1\nfunction triangle_area(a: number, b: number, c: number): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = triangle_area;\n assert.deepEqual(candidate(3, 4, 5),6.0);\n assert.deepEqual(candidate(1, 2, 10),-1);\n assert.deepEqual(candidate(4, 8, 5),8.18);\n assert.deepEqual(candidate(2, 2, 2),1.73);\n assert.deepEqual(candidate(1, 2, 3),-1);\n assert.deepEqual(candidate(10, 5, 7),16.25);\n assert.deepEqual(candidate(2, 6, 3),-1);\n assert.deepEqual(candidate(1, 1, 1),0.43);\n assert.deepEqual(candidate(2, 2, 10),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "ts", - "prompt": "//Check if two words have the same characters.\n// >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n// True\n// >>> same_chars('abcd', 'dddddddabc')\n// True\n// >>> same_chars('dddddddabc', 'abcd')\n// True\n// >>> same_chars('eabcd', 'dddddddabc')\n// False\n// >>> same_chars('abcd', 'dddddddabce')\n// False\n// >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc')\n// False\nfunction same_chars(s0: string, s1: string): boolean {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = same_chars;\n assert.deepEqual(candidate(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\"),true);\n assert.deepEqual(candidate(\"abcd\", \"dddddddabc\"),true);\n assert.deepEqual(candidate(\"dddddddabc\", \"abcd\"),true);\n assert.deepEqual(candidate(\"eabcd\", \"dddddddabc\"),false);\n assert.deepEqual(candidate(\"abcd\", \"dddddddabcf\"),false);\n assert.deepEqual(candidate(\"eabcdzzzz\", \"dddzzzzzzzddddabc\"),false);\n assert.deepEqual(candidate(\"aabb\", \"aaccc\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "ts", - "prompt": "//Given an array of integers nums, find the minimum sum of any non-empty sub-array\n// of nums.\n// Example\n// minSubArraySum([2, 3, 4, 1, 2, 4]) == 1\n// minSubArraySum([-1, -2, -3]) == -6\nfunction minSubArraySum(nums: number[]): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = minSubArraySum;\n assert.deepEqual(candidate([2, 3, 4, 1, 2, 4]),1);\n assert.deepEqual(candidate([-1, -2, -3]),-6);\n assert.deepEqual(candidate([-1, -2, -3, 2, -10]),-14);\n assert.deepEqual(candidate([-9999999999999999]),-9999999999999999);\n assert.deepEqual(candidate([0, 10, 20, 1000000]),0);\n assert.deepEqual(candidate([-1, -2, -3, 10, -5]),-6);\n assert.deepEqual(candidate([100, -1, -2, -3, 10, -5]),-6);\n assert.deepEqual(candidate([10, 11, 13, 8, 3, 4]),3);\n assert.deepEqual(candidate([100, -33, 32, -1, 0, -2]),-33);\n assert.deepEqual(candidate([-10]),-10);\n assert.deepEqual(candidate([7]),7);\n assert.deepEqual(candidate([1, -1]),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "ts", - "prompt": "//Given a string s and a natural number n, you have been tasked to implement \n// a function that returns a list of all words from string s that contain exactly \n// n consonants, in order these words appear in the string s.\n// If the string s is empty then the function should return an empty list.\n// Note: you may assume the input string contains only letters and spaces.\n// Examples:\n// select_words(\"Mary had a little lamb\", 4) ==> [\"little\"]\n// select_words(\"Mary had a little lamb\", 3) ==> [\"Mary\", \"lamb\"]\n// select_words(\"simple white space\", 2) ==> []\n// select_words(\"Hello world\", 4) ==> [\"world\"]\n// select_words(\"Uncle sam\", 3) ==> [\"Uncle\"]\nfunction select_words(s: string, n: number): string[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = select_words;\n assert.deepEqual(candidate(\"Mary had a little lamb\", 4),[\"little\"]);\n assert.deepEqual(candidate(\"Mary had a little lamb\", 3),[\"Mary\", \"lamb\"]);\n assert.deepEqual(candidate(\"simple white space\", 2),[]);\n assert.deepEqual(candidate(\"Hello world\", 4),[\"world\"]);\n assert.deepEqual(candidate(\"Uncle sam\", 3),[\"Uncle\"]);\n assert.deepEqual(candidate(\"\", 4),[]);\n assert.deepEqual(candidate(\"a b c d e f\", 1),[\"b\", \"c\", \"d\", \"f\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "ts", - "prompt": "//Return list of all prefixes from shortest to longest of the input string\n// >>> all_prefixes('abc')\n// ['a', 'ab', 'abc']\nfunction all_prefixes(string: string): string[] {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = all_prefixes;\n assert.deepEqual(candidate(\"\"),[]);\n assert.deepEqual(candidate(\"asdfgh\"),[\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"]);\n assert.deepEqual(candidate(\"WWW\"),[\"W\", \"WW\", \"WWW\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "ts", - "prompt": "//Create a function that takes a value (string) representing a number\n// and returns the closest integer to it. If the number is equidistant\n// from two integers, round it away from zero.\n// Examples\n// >>> closest_integer(\"10\")\n// 10\n// >>> closest_integer(\"15.3\")\n// 15\n// Note:\n// Rounding away from zero means that if the given number is equidistant\n// from two integers, the one you should return is the one that is the\n// farthest from zero. For example closest_integer(\"14.5\") should\n// return 15 and closest_integer(\"-14.5\") should return -15.\nfunction closest_integer(value: string): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = closest_integer;\n assert.deepEqual(candidate(\"10\"),10);\n assert.deepEqual(candidate(\"14.5\"),15);\n assert.deepEqual(candidate(\"-15.5\"),-16);\n assert.deepEqual(candidate(\"15.3\"),15);\n assert.deepEqual(candidate(\"0\"),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "ts", - "prompt": "//Create a function which takes a string representing a file's name, and returns\n// 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n// A file's name is considered to be valid if and only if all the following conditions \n// are met:\n// - There should not be more than three digits ('0'-'9') in the file's name.\n// - The file's name contains exactly one dot '.'\n// - The substring before the dot should not be empty, and it starts with a letter from \n// the latin alphapet ('a'-'z' and 'A'-'Z').\n// - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n// Examples:\n// file_name_check(\"example.txt\") # => 'Yes'\n// file_name_check(\"1example.dll\") # => 'No' (the name should start with a latin alphapet letter)\nfunction file_name_check(file_name: string): string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = file_name_check;\n assert.deepEqual(candidate(\"example.txt\"),\"Yes\");\n assert.deepEqual(candidate(\"1example.dll\"),\"No\");\n assert.deepEqual(candidate(\"s1sdf3.asd\"),\"No\");\n assert.deepEqual(candidate(\"K.dll\"),\"Yes\");\n assert.deepEqual(candidate(\"MY16FILE3.exe\"),\"Yes\");\n assert.deepEqual(candidate(\"His12FILE94.exe\"),\"No\");\n assert.deepEqual(candidate(\"_Y.txt\"),\"No\");\n assert.deepEqual(candidate(\"?aREYA.exe\"),\"No\");\n assert.deepEqual(candidate(\"/this_is_valid.dll\"),\"No\");\n assert.deepEqual(candidate(\"this_is_valid.wow\"),\"No\");\n assert.deepEqual(candidate(\"this_is_valid.txt\"),\"Yes\");\n assert.deepEqual(candidate(\"this_is_valid.txtexe\"),\"No\");\n assert.deepEqual(candidate(\"#this2_i4s_5valid.ten\"),\"No\");\n assert.deepEqual(candidate(\"@this1_is6_valid.exe\"),\"No\");\n assert.deepEqual(candidate(\"this_is_12valid.6exe4.txt\"),\"No\");\n assert.deepEqual(candidate(\"all.exe.txt\"),\"No\");\n assert.deepEqual(candidate(\"I563_No.exe\"),\"Yes\");\n assert.deepEqual(candidate(\"Is3youfault.txt\"),\"Yes\");\n assert.deepEqual(candidate(\"no_one#knows.dll\"),\"Yes\");\n assert.deepEqual(candidate(\"1I563_Yes3.exe\"),\"No\");\n assert.deepEqual(candidate(\"I563_Yes3.txtt\"),\"No\");\n assert.deepEqual(candidate(\"final..txt\"),\"No\");\n assert.deepEqual(candidate(\"final132\"),\"No\");\n assert.deepEqual(candidate(\"_f4indsartal132.\"),\"No\");\n assert.deepEqual(candidate(\".txt\"),\"No\");\n assert.deepEqual(candidate(\"s.\"),\"No\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "ts", - "prompt": "//You are given two intervals,\n// where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n// The given intervals are closed which means that the interval (start, end)\n// includes both start and end.\n// For each given interval, it is assumed that its start is less or equal its end.\n// Your task is to determine whether the length of intersection of these two \n// intervals is a prime number.\n// Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n// which its length is 1, which not a prime number.\n// If the length of the intersection is a prime number, return \"YES\",\n// otherwise, return \"NO\".\n// If the two intervals don't intersect, return \"NO\".\n// [input/output] samples:\n// intersection((1, 2), (2, 3)) ==> \"NO\"\n// intersection((-1, 1), (0, 4)) ==> \"NO\"\n// intersection((-3, -1), (-5, 5)) ==> \"YES\"\nfunction intersection(interval1: [number, number], interval2: [number, number]): string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = intersection;\n assert.deepEqual(candidate([1, 2], [2, 3]),\"NO\");\n assert.deepEqual(candidate([-1, 1], [0, 4]),\"NO\");\n assert.deepEqual(candidate([-3, -1], [-5, 5]),\"YES\");\n assert.deepEqual(candidate([-2, 2], [-4, 0]),\"YES\");\n assert.deepEqual(candidate([-11, 2], [-1, -1]),\"NO\");\n assert.deepEqual(candidate([1, 2], [3, 5]),\"NO\");\n assert.deepEqual(candidate([1, 2], [1, 2]),\"NO\");\n assert.deepEqual(candidate([-2, -2], [-3, -2]),\"NO\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "ts", - "prompt": "//Return the largest prime factor of n. Assume n > 1 and is not a prime.\n// >>> largest_prime_factor(13195)\n// 29\n// >>> largest_prime_factor(2048)\n// 2\nfunction largest_prime_factor(n: number): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = largest_prime_factor;\n assert.deepEqual(candidate(15),5);\n assert.deepEqual(candidate(27),3);\n assert.deepEqual(candidate(63),7);\n assert.deepEqual(candidate(330),11);\n assert.deepEqual(candidate(13195),29);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "ts", - "prompt": "//Given a string, find out how many distinct characters (regardless of case) does it consist of\n// >>> count_distinct_characters('xyzXYZ')\n// 3\n// >>> count_distinct_characters('Jerry')\n// 4\nfunction count_distinct_characters(string: string): number {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_distinct_characters;\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"abcde\"),5);\n assert.deepEqual(candidate(\"abcdecadeCADE\"),5);\n assert.deepEqual(candidate(\"aaaaAAAAaaaa\"),1);\n assert.deepEqual(candidate(\"Jerry jERRY JeRRRY\"),5);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "ts", - "prompt": "//You're given a list of deposit and withdrawal operations on a bank account that starts with\n// zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n// at that point function should return True. Otherwise it should return False.\n// >>> below_zero([1, 2, 3])\n// False\n// >>> below_zero([1, 2, -4, 5])\n// True\nfunction below_zero(operations: number[]): boolean {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = below_zero;\n assert.deepEqual(candidate([]),false);\n assert.deepEqual(candidate([1, 2, -3, 1, 2, -3]),false);\n assert.deepEqual(candidate([1, 2, -4, 5, 6]),true);\n assert.deepEqual(candidate([1, -1, 2, -2, 5, -5, 4, -4]),false);\n assert.deepEqual(candidate([1, -1, 2, -2, 5, -5, 4, -5]),true);\n assert.deepEqual(candidate([1, -2, 2, -2, 5, -5, 4, -4]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "ts", - "prompt": "//Find the shortest palindrome that begins with a supplied string.\n// Algorithm idea is simple:\n// - Find the longest postfix of supplied string that is a palindrome.\n// - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n// >>> make_palindrome('')\n// ''\n// >>> make_palindrome('cat')\n// 'catac'\n// >>> make_palindrome('cata')\n// 'catac'\nfunction make_palindrome(string: string): string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = make_palindrome;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"x\"),\"x\");\n assert.deepEqual(candidate(\"xyz\"),\"xyzyx\");\n assert.deepEqual(candidate(\"xyx\"),\"xyx\");\n assert.deepEqual(candidate(\"jerry\"),\"jerryrrej\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "ts", - "prompt": "//Given a positive integer, obtain its roman numeral equivalent as a string,\n// and return it in lowercase.\n// Restrictions: 1 <= num <= 1000\n// Examples:\n// >>> int_to_mini_roman(19) == 'xix'\n// >>> int_to_mini_roman(152) == 'clii'\n// >>> int_to_mini_roman(426) == 'cdxxvi'\nfunction int_to_mini_roman(number: number): string {\n", - "doctests": "keep", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = int_to_mini_roman;\n assert.deepEqual(candidate(19),\"xix\");\n assert.deepEqual(candidate(152),\"clii\");\n assert.deepEqual(candidate(251),\"ccli\");\n assert.deepEqual(candidate(426),\"cdxxvi\");\n assert.deepEqual(candidate(500),\"d\");\n assert.deepEqual(candidate(1),\"i\");\n assert.deepEqual(candidate(4),\"iv\");\n assert.deepEqual(candidate(43),\"xliii\");\n assert.deepEqual(candidate(90),\"xc\");\n assert.deepEqual(candidate(94),\"xciv\");\n assert.deepEqual(candidate(532),\"dxxxii\");\n assert.deepEqual(candidate(900),\"cm\");\n assert.deepEqual(candidate(994),\"cmxciv\");\n assert.deepEqual(candidate(1000),\"m\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - } -] \ No newline at end of file diff --git a/data/ts-remove.json b/data/ts-remove.json deleted file mode 100644 index e8f38ad0650d6b5ddff036ab0201c51bbba2e3c4..0000000000000000000000000000000000000000 --- a/data/ts-remove.json +++ /dev/null @@ -1,2342 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "ts", - "prompt": "//For a given number n, find the largest number that divides n evenly, smaller than n\nfunction largest_divisor(n: number): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = largest_divisor;\n assert.deepEqual(candidate(3),1);\n assert.deepEqual(candidate(7),1);\n assert.deepEqual(candidate(10),5);\n assert.deepEqual(candidate(100),50);\n assert.deepEqual(candidate(49),7);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_47_median", - "language": "ts", - "prompt": "//Return median of elements in the list l.\nfunction median(l: number[]): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = median;\n assert.deepEqual(candidate([3, 1, 2, 4, 5]),3);\n assert.deepEqual(candidate([-10, 4, 6, 1000, 10, 20]),8.0);\n assert.deepEqual(candidate([5]),5);\n assert.deepEqual(candidate([6, 5]),5.5);\n assert.deepEqual(candidate([8, 1, 3, 9, 9, 2, 7]),7);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "ts", - "prompt": "//Return maximum element in the list.\nfunction max_element(l: number[]): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = max_element;\n assert.deepEqual(candidate([1, 2, 3]),3);\n assert.deepEqual(candidate([5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]),124);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "ts", - "prompt": "//Create a function which returns the largest index of an element which\n// is not greater than or equal to the element immediately preceding it. If\n// no such element exists then return -1. The given array will not contain\n// duplicate values.\n// Examples:\nfunction can_arrange(arr: number[]): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = can_arrange;\n assert.deepEqual(candidate([1, 2, 4, 3, 5]),3);\n assert.deepEqual(candidate([1, 2, 4, 5]),-1);\n assert.deepEqual(candidate([1, 4, 2, 5, 6, 7, 8, 9, 10]),2);\n assert.deepEqual(candidate([4, 8, 5, 7, 3]),4);\n assert.deepEqual(candidate([]),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "ts", - "prompt": "//Create a function that returns True if the last character\n// of a given string is an alphabetical character and is not\n// a part of a word, and False otherwise.\n// Note: \"word\" is a group of characters separated by space.\n// Examples:\nfunction check_if_last_char_is_a_letter(txt: string): boolean {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = check_if_last_char_is_a_letter;\n assert.deepEqual(candidate(\"apple\"),false);\n assert.deepEqual(candidate(\"apple pi e\"),true);\n assert.deepEqual(candidate(\"eeeee\"),false);\n assert.deepEqual(candidate(\"A\"),true);\n assert.deepEqual(candidate(\"Pumpkin pie \"),false);\n assert.deepEqual(candidate(\"Pumpkin pie 1\"),false);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"eeeee e \"),false);\n assert.deepEqual(candidate(\"apple pie\"),false);\n assert.deepEqual(candidate(\"apple pi e \"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "ts", - "prompt": "//Return true if a given number is prime, and false otherwise.\nfunction is_prime(n: number): boolean {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_prime;\n assert.deepEqual(candidate(6),false);\n assert.deepEqual(candidate(101),true);\n assert.deepEqual(candidate(11),true);\n assert.deepEqual(candidate(13441),true);\n assert.deepEqual(candidate(61),true);\n assert.deepEqual(candidate(4),false);\n assert.deepEqual(candidate(1),false);\n assert.deepEqual(candidate(5),true);\n assert.deepEqual(candidate(11),true);\n assert.deepEqual(candidate(17),true);\n assert.deepEqual(candidate(85),false);\n assert.deepEqual(candidate(77),false);\n assert.deepEqual(candidate(255379),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "ts", - "prompt": "//Given a list of positive integers x. return a sorted list of all \n// elements that hasn't any even digit.\n// Note: Returned list should be sorted in increasing order.\n// For example:\nfunction unique_digits(x: number[]): number[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = unique_digits;\n assert.deepEqual(candidate([15, 33, 1422, 1]),[1, 15, 33]);\n assert.deepEqual(candidate([152, 323, 1422, 10]),[]);\n assert.deepEqual(candidate([12345, 2033, 111, 151]),[111, 151]);\n assert.deepEqual(candidate([135, 103, 31]),[31, 135]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "ts", - "prompt": "//Input are two strings a and b consisting only of 1s and 0s.\n// Perform binary XOR on these inputs and return result also as a string.\nfunction string_xor(a: string, b: string): string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = string_xor;\n assert.deepEqual(candidate(\"111000\", \"101010\"),\"010010\");\n assert.deepEqual(candidate(\"1\", \"1\"),\"0\");\n assert.deepEqual(candidate(\"0101\", \"0000\"),\"0101\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "ts", - "prompt": "//sum_to_n is a function that sums numbers from 1 to n.\nfunction sum_to_n(n: number): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_to_n;\n assert.deepEqual(candidate(1),1);\n assert.deepEqual(candidate(6),21);\n assert.deepEqual(candidate(11),66);\n assert.deepEqual(candidate(30),465);\n assert.deepEqual(candidate(100),5050);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "ts", - "prompt": "//Given a list of numbers, return the sum of squares of the numbers\n// in the list that are odd. Ignore numbers that are negative or not integers.\n// If the input list is empty, return 0.\nfunction double_the_difference(lst: number[]): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = double_the_difference;\n assert.deepEqual(candidate([]),0);\n assert.deepEqual(candidate([5.0, 4.0]),25);\n assert.deepEqual(candidate([0.1, 0.2, 0.3]),0);\n assert.deepEqual(candidate([-10.0, -20.0, -30.0]),0);\n assert.deepEqual(candidate([-1.0, -2.0, 8.0]),0);\n assert.deepEqual(candidate([0.2, 3.0, 5.0]),34);\n assert.deepEqual(candidate([-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]),165);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "ts", - "prompt": "//Return length of given string\nfunction strlen(string: string): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = strlen;\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"x\"),1);\n assert.deepEqual(candidate(\"asdasnakj\"),9);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "ts", - "prompt": "//You'll be given a string of words, and your task is to count the number\n// of boredoms. A boredom is a sentence that starts with the word \"I\".\n// Sentences are delimited by '.', '?' or '!'.\n// For example:\nfunction is_bored(S: string): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_bored;\n assert.deepEqual(candidate(\"Hello world\"),0);\n assert.deepEqual(candidate(\"Is the sky blue?\"),0);\n assert.deepEqual(candidate(\"I love It !\"),1);\n assert.deepEqual(candidate(\"bIt\"),0);\n assert.deepEqual(candidate(\"I feel good today. I will be productive. will kill It\"),2);\n assert.deepEqual(candidate(\"You and I are going for a walk\"),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "ts", - "prompt": "//Write a function vowels_count which takes a string representing\n// a word as input and returns the number of vowels in the string.\n// Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n// vowel, but only when it is at the end of the given word.\n// Example:\nfunction vowels_count(s: string): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = vowels_count;\n assert.deepEqual(candidate(\"abcde\"),2);\n assert.deepEqual(candidate(\"Alone\"),3);\n assert.deepEqual(candidate(\"key\"),2);\n assert.deepEqual(candidate(\"bye\"),1);\n assert.deepEqual(candidate(\"keY\"),2);\n assert.deepEqual(candidate(\"bYe\"),1);\n assert.deepEqual(candidate(\"ACEDY\"),3);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "ts", - "prompt": "//Return n-th Fibonacci number.\nfunction fib(n: number): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fib;\n assert.deepEqual(candidate(10),55);\n assert.deepEqual(candidate(1),1);\n assert.deepEqual(candidate(8),21);\n assert.deepEqual(candidate(11),89);\n assert.deepEqual(candidate(12),144);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "ts", - "prompt": "//Your task is to implement a function that will simplify the expression\n// x * n. The function returns True if x * n evaluates to a whole number and False\n// otherwise. Both x and n, are string representation of a fraction, and have the following format,\n// / where both numerator and denominator are positive whole numbers.\n// You can assume that x, and n are valid fractions, and do not have zero as denominator.\nfunction simplify(x: string, n: string): boolean {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = simplify;\n assert.deepEqual(candidate(\"1/5\", \"5/1\"),true);\n assert.deepEqual(candidate(\"1/6\", \"2/1\"),false);\n assert.deepEqual(candidate(\"5/1\", \"3/1\"),true);\n assert.deepEqual(candidate(\"7/10\", \"10/2\"),false);\n assert.deepEqual(candidate(\"2/10\", \"50/10\"),true);\n assert.deepEqual(candidate(\"7/2\", \"4/2\"),true);\n assert.deepEqual(candidate(\"11/6\", \"6/1\"),true);\n assert.deepEqual(candidate(\"2/3\", \"5/2\"),false);\n assert.deepEqual(candidate(\"5/2\", \"3/5\"),false);\n assert.deepEqual(candidate(\"2/4\", \"8/4\"),true);\n assert.deepEqual(candidate(\"2/4\", \"4/2\"),true);\n assert.deepEqual(candidate(\"1/5\", \"5/1\"),true);\n assert.deepEqual(candidate(\"1/5\", \"1/5\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "ts", - "prompt": "//Given a string s, count the number of uppercase vowels in even indices.\n// For example:\nfunction count_upper(s: string): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_upper;\n assert.deepEqual(candidate(\"aBCdEf\"),1);\n assert.deepEqual(candidate(\"abcdefg\"),0);\n assert.deepEqual(candidate(\"dBBE\"),0);\n assert.deepEqual(candidate(\"B\"),0);\n assert.deepEqual(candidate(\"U\"),1);\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"EEEE\"),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "ts", - "prompt": "//You are given a rectangular grid of wells. Each row represents a single well,\n// and each 1 in a row represents a single unit of water.\n// Each well has a corresponding bucket that can be used to extract water from it, \n// and all buckets have the same capacity.\n// Your task is to use the buckets to empty the wells.\n// Output the number of times you need to lower the buckets.\n// Example 1:\n// Example 2:\n// Example 3:\n// Constraints:\n// * all wells have the same length\n// * 1 <= grid.length <= 10^2\n// * 1 <= grid[:,1].length <= 10^2\n// * grid[i][j] -> 0 | 1\n// * 1 <= capacity <= 10\nfunction max_fill(grid: number[][], capacity: number): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = max_fill;\n assert.deepEqual(candidate([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1),6);\n assert.deepEqual(candidate([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2),5);\n assert.deepEqual(candidate([[0, 0, 0], [0, 0, 0]], 5),0);\n assert.deepEqual(candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 2),4);\n assert.deepEqual(candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 9),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "ts", - "prompt": "//Given an array arr of integers and a positive integer k, return a sorted list \n// of length k with the maximum k numbers in arr.\n// Example 1:\n// Example 2:\n// Example 3:\n// Note:\n// 1. The length of the array will be in the range of [1, 1000].\n// 2. The elements in the array will be in the range of [-1000, 1000].\n// 3. 0 <= k <= len(arr)\nfunction maximum(arr: number[], k: number): number[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = maximum;\n assert.deepEqual(candidate([-3, -4, 5], 3),[-4, -3, 5]);\n assert.deepEqual(candidate([4, -4, 4], 2),[4, 4]);\n assert.deepEqual(candidate([-3, 2, 1, 2, -1, -2, 1], 1),[2]);\n assert.deepEqual(candidate([123, -123, 20, 0, 1, 2, -3], 3),[2, 20, 123]);\n assert.deepEqual(candidate([-123, 20, 0, 1, 2, -3], 4),[0, 1, 2, 20]);\n assert.deepEqual(candidate([5, 15, 0, 3, -13, -8, 0], 7),[-13, -8, 0, 0, 3, 5, 15]);\n assert.deepEqual(candidate([-1, 0, 2, 5, 3, -10], 2),[3, 5]);\n assert.deepEqual(candidate([1, 0, 5, -7], 1),[5]);\n assert.deepEqual(candidate([4, -4], 2),[-4, 4]);\n assert.deepEqual(candidate([-10, 10], 2),[-10, 10]);\n assert.deepEqual(candidate([1, 2, 3, -23, 243, -400, 0], 0),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "ts", - "prompt": "//Write a function that takes a message, and encodes in such a \n// way that it swaps case of all letters, replaces all vowels in \n// the message with the letter that appears 2 places ahead of that \n// vowel in the english alphabet. \n// Assume only letters. \n// Examples:\nfunction encode(message: string): string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = encode;\n assert.deepEqual(candidate(\"TEST\"),\"tgst\");\n assert.deepEqual(candidate(\"Mudasir\"),\"mWDCSKR\");\n assert.deepEqual(candidate(\"YES\"),\"ygs\");\n assert.deepEqual(candidate(\"This is a message\"),\"tHKS KS C MGSSCGG\");\n assert.deepEqual(candidate(\"I DoNt KnOw WhAt tO WrItE\"),\"k dQnT kNqW wHcT Tq wRkTg\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "ts", - "prompt": "//remove_vowels is a function that takes string and returns string without vowels.\nfunction remove_vowels(text: string): string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = remove_vowels;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"abcdef\\nghijklm\"),\"bcdf\\nghjklm\");\n assert.deepEqual(candidate(\"fedcba\"),\"fdcb\");\n assert.deepEqual(candidate(\"eeeee\"),\"\");\n assert.deepEqual(candidate(\"acBAA\"),\"cB\");\n assert.deepEqual(candidate(\"EcBOO\"),\"cB\");\n assert.deepEqual(candidate(\"ybcd\"),\"ybcd\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "ts", - "prompt": "//Return only positive numbers in the list.\nfunction get_positive(l: number[]): number[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_positive;\n assert.deepEqual(candidate([-1, -2, 4, 5, 6]),[4, 5, 6]);\n assert.deepEqual(candidate([5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]),[5, 3, 2, 3, 3, 9, 123, 1]);\n assert.deepEqual(candidate([-1, -2]),[]);\n assert.deepEqual(candidate([]),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "ts", - "prompt": "//Return a string containing space-delimited numbers starting from 0 upto n inclusive.\nfunction string_sequence(n: number): string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = string_sequence;\n assert.deepEqual(candidate(0),\"0\");\n assert.deepEqual(candidate(3),\"0 1 2 3\");\n assert.deepEqual(candidate(10),\"0 1 2 3 4 5 6 7 8 9 10\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "ts", - "prompt": "//Given a positive integer n, you have to make a pile of n levels of stones.\n// The first level has n stones.\n// The number of stones in the next level is:\n// - the next odd number if n is odd.\n// - the next even number if n is even.\n// Return the number of stones in each level in a list, where element at index\n// i represents the number of stones in the level (i+1).\n// Examples:\nfunction make_a_pile(n: number): number[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = make_a_pile;\n assert.deepEqual(candidate(3),[3, 5, 7]);\n assert.deepEqual(candidate(4),[4, 6, 8, 10]);\n assert.deepEqual(candidate(5),[5, 7, 9, 11, 13]);\n assert.deepEqual(candidate(6),[6, 8, 10, 12, 14, 16]);\n assert.deepEqual(candidate(8),[8, 10, 12, 14, 16, 18, 20, 22]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "ts", - "prompt": "//Task\n// 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\n// then check if the result string is palindrome.\n// A string is called palindrome if it reads the same backward as forward.\n// You should return a tuple containing the result string and True/False for the check.\n// Example\nfunction reverse_delete(s: string, c: string): [string, boolean] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = reverse_delete;\n assert.deepEqual(candidate(\"abcde\", \"ae\"),[\"bcd\", false]);\n assert.deepEqual(candidate(\"abcdef\", \"b\"),[\"acdef\", false]);\n assert.deepEqual(candidate(\"abcdedcba\", \"ab\"),[\"cdedc\", true]);\n assert.deepEqual(candidate(\"dwik\", \"w\"),[\"dik\", false]);\n assert.deepEqual(candidate(\"a\", \"a\"),[\"\", true]);\n assert.deepEqual(candidate(\"abcdedcba\", \"\"),[\"abcdedcba\", true]);\n assert.deepEqual(candidate(\"abcdedcba\", \"v\"),[\"abcdedcba\", true]);\n assert.deepEqual(candidate(\"vabba\", \"v\"),[\"abba\", true]);\n assert.deepEqual(candidate(\"mamma\", \"mia\"),[\"\", true]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "ts", - "prompt": "//For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\nfunction flip_case(string: string): string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = flip_case;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"Hello!\"),\"hELLO!\");\n assert.deepEqual(candidate(\"These violent delights have violent ends\"),\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "ts", - "prompt": "//You are given a string s.\n// if s[i] is a letter, reverse its case from lower to upper or vise versa, \n// otherwise keep it as it is.\n// If the string contains no letters, reverse the string.\n// The function should return the resulted string.\n// Examples\nfunction solve(s: string): string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = solve;\n assert.deepEqual(candidate(\"AsDf\"),\"aSdF\");\n assert.deepEqual(candidate(\"1234\"),\"4321\");\n assert.deepEqual(candidate(\"ab\"),\"AB\");\n assert.deepEqual(candidate(\"#a@C\"),\"#A@c\");\n assert.deepEqual(candidate(\"#AsdfW^45\"),\"#aSDFw^45\");\n assert.deepEqual(candidate(\"#6@2\"),\"2@6#\");\n assert.deepEqual(candidate(\"#$a^D\"),\"#$A^d\");\n assert.deepEqual(candidate(\"#ccc\"),\"#CCC\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "ts", - "prompt": "//Filter an input list of strings only for ones that start with a given prefix.\nfunction filter_by_prefix(strings: string[], prefix: string): string[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = filter_by_prefix;\n assert.deepEqual(candidate([], \"john\"),[]);\n assert.deepEqual(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"),[\"xxx\", \"xxxAAA\", \"xxx\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "ts", - "prompt": "//This function takes two positive numbers x and y and returns the\n// biggest even integer number that is in the range [x, y] inclusive. If \n// there's no such number, then the function should return -1.\n// For example:\nfunction choose_num(x: number, y: number): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = choose_num;\n assert.deepEqual(candidate(12, 15),14);\n assert.deepEqual(candidate(13, 12),-1);\n assert.deepEqual(candidate(33, 12354),12354);\n assert.deepEqual(candidate(5234, 5233),-1);\n assert.deepEqual(candidate(6, 29),28);\n assert.deepEqual(candidate(27, 10),-1);\n assert.deepEqual(candidate(7, 7),-1);\n assert.deepEqual(candidate(546, 546),546);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "ts", - "prompt": "//You are given a string representing a sentence,\n// the sentence contains some words separated by a space,\n// and you have to return a string that contains the words from the original sentence,\n// whose lengths are prime numbers,\n// the order of the words in the new string should be the same as the original one.\n// Example 1:\n// Example 2:\n// Constraints:\n// * 1 <= len(sentence) <= 100\n// * sentence contains only letters\nfunction words_in_sentence(sentence: string): string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = words_in_sentence;\n assert.deepEqual(candidate(\"This is a test\"),\"is\");\n assert.deepEqual(candidate(\"lets go for swimming\"),\"go for\");\n assert.deepEqual(candidate(\"there is no place available here\"),\"there is no place\");\n assert.deepEqual(candidate(\"Hi I am Hussein\"),\"Hi am Hussein\");\n assert.deepEqual(candidate(\"go for it\"),\"go for it\");\n assert.deepEqual(candidate(\"here\"),\"\");\n assert.deepEqual(candidate(\"here is\"),\"is\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "ts", - "prompt": "//Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\nfunction intersperse(numbers: number[], delimeter: number): number[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = intersperse;\n assert.deepEqual(candidate([], 7),[]);\n assert.deepEqual(candidate([5, 6, 3, 2], 8),[5, 8, 6, 8, 3, 8, 2]);\n assert.deepEqual(candidate([2, 2, 2], 2),[2, 2, 2, 2, 2]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "ts", - "prompt": "//Your task is to write a function that returns true if a number x is a simple\n// power of n and false in other cases.\n// x is a simple power of n if n**int=x\n// For example:\nfunction is_simple_power(x: number, n: number): boolean {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_simple_power;\n assert.deepEqual(candidate(16, 2),true);\n assert.deepEqual(candidate(143214, 16),false);\n assert.deepEqual(candidate(4, 2),true);\n assert.deepEqual(candidate(9, 3),true);\n assert.deepEqual(candidate(16, 4),true);\n assert.deepEqual(candidate(24, 2),false);\n assert.deepEqual(candidate(128, 4),false);\n assert.deepEqual(candidate(12, 6),false);\n assert.deepEqual(candidate(1, 1),true);\n assert.deepEqual(candidate(1, 12),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "ts", - "prompt": "//Write a function that returns true if the given number is the multiplication of 3 prime numbers\n// and false otherwise.\n// Knowing that (a) is less then 100. \n// Example:\n// 30 = 2 * 3 * 5\nfunction is_multiply_prime(a: number): boolean {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_multiply_prime;\n assert.deepEqual(candidate(5),false);\n assert.deepEqual(candidate(30),true);\n assert.deepEqual(candidate(8),true);\n assert.deepEqual(candidate(10),false);\n assert.deepEqual(candidate(125),true);\n assert.deepEqual(candidate(105),true);\n assert.deepEqual(candidate(126),false);\n assert.deepEqual(candidate(729),false);\n assert.deepEqual(candidate(891),false);\n assert.deepEqual(candidate(1001),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "ts", - "prompt": "//Given the lengths of the three sides of a triangle. Return True if the three\n// sides form a right-angled triangle, False otherwise.\n// A right-angled triangle is a triangle in which one angle is right angle or \n// 90 degree.\n// Example:\nfunction right_angle_triangle(a: number, b: number, c: number): boolean {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = right_angle_triangle;\n assert.deepEqual(candidate(3, 4, 5),true);\n assert.deepEqual(candidate(1, 2, 3),false);\n assert.deepEqual(candidate(10, 6, 8),true);\n assert.deepEqual(candidate(2, 2, 2),false);\n assert.deepEqual(candidate(7, 24, 25),true);\n assert.deepEqual(candidate(10, 5, 7),false);\n assert.deepEqual(candidate(5, 12, 13),true);\n assert.deepEqual(candidate(15, 8, 17),true);\n assert.deepEqual(candidate(48, 55, 73),true);\n assert.deepEqual(candidate(1, 1, 1),false);\n assert.deepEqual(candidate(2, 2, 10),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "ts", - "prompt": "//Create a function that takes 3 numbers.\n// Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n// Returns false in any other cases.\n// Examples\nfunction any_int(x: number, y: number, z: number): boolean {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = any_int;\n assert.deepEqual(candidate(2, 3, 1),true);\n assert.deepEqual(candidate(2.5, 2, 3),false);\n assert.deepEqual(candidate(1.5, 5, 3.5),false);\n assert.deepEqual(candidate(2, 6, 2),false);\n assert.deepEqual(candidate(4, 2, 2),true);\n assert.deepEqual(candidate(2.2, 2.2, 2.2),false);\n assert.deepEqual(candidate(-4, 6, 2),true);\n assert.deepEqual(candidate(2, 1, 1),true);\n assert.deepEqual(candidate(3, 4, 7),true);\n assert.deepEqual(candidate(3.0, 4, 7),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "ts", - "prompt": "//This function takes a list l and returns a list l' such that\n// l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n// to the values of the corresponding indicies of l, but sorted.\nfunction sort_third(l: number[]): number[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_third;\n assert.deepEqual(candidate([5, 6, 3, 4, 8, 9, 2]),[2, 6, 3, 4, 8, 9, 5]);\n assert.deepEqual(candidate([5, 8, 3, 4, 6, 9, 2]),[2, 8, 3, 4, 6, 9, 5]);\n assert.deepEqual(candidate([5, 6, 9, 4, 8, 3, 2]),[2, 6, 9, 4, 8, 3, 5]);\n assert.deepEqual(candidate([5, 6, 3, 4, 8, 9, 2, 1]),[2, 6, 3, 4, 8, 9, 5, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_53_add", - "language": "ts", - "prompt": "//Add two numbers x and y\nfunction add(x: number, y: number): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = add;\n assert.deepEqual(candidate(0, 1),1);\n assert.deepEqual(candidate(1, 0),1);\n assert.deepEqual(candidate(2, 3),5);\n assert.deepEqual(candidate(5, 7),12);\n assert.deepEqual(candidate(7, 5),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_69_search", - "language": "ts", - "prompt": "//You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n// zero, and has a frequency greater than or equal to the value of the integer itself. \n// The frequency of an integer is the number of times it appears in the list.\n// If no such a value exist, return -1.\n// Examples:\nfunction search(lst: number[]): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = search;\n assert.deepEqual(candidate([5, 5, 5, 5, 1]),1);\n assert.deepEqual(candidate([4, 1, 4, 1, 4, 4]),4);\n assert.deepEqual(candidate([3, 3]),-1);\n assert.deepEqual(candidate([8, 8, 8, 8, 8, 8, 8, 8]),8);\n assert.deepEqual(candidate([2, 3, 3, 2, 2]),2);\n assert.deepEqual(candidate([2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]),1);\n assert.deepEqual(candidate([3, 2, 8, 2]),2);\n assert.deepEqual(candidate([6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]),1);\n assert.deepEqual(candidate([8, 8, 3, 6, 5, 6, 4]),-1);\n assert.deepEqual(candidate([6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]),1);\n assert.deepEqual(candidate([1, 9, 10, 1, 3]),1);\n assert.deepEqual(candidate([6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]),5);\n assert.deepEqual(candidate([1]),1);\n assert.deepEqual(candidate([8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]),4);\n assert.deepEqual(candidate([2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]),2);\n assert.deepEqual(candidate([1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]),1);\n assert.deepEqual(candidate([9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]),4);\n assert.deepEqual(candidate([2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]),4);\n assert.deepEqual(candidate([9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]),2);\n assert.deepEqual(candidate([5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]),-1);\n assert.deepEqual(candidate([10]),-1);\n assert.deepEqual(candidate([9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]),2);\n assert.deepEqual(candidate([5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]),1);\n assert.deepEqual(candidate([7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]),1);\n assert.deepEqual(candidate([3, 10, 10, 9, 2]),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "ts", - "prompt": "//Write a function that takes a string and returns True if the string\n// length is a prime number or False otherwise\n// Examples\nfunction prime_length(string: string): boolean {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = prime_length;\n assert.deepEqual(candidate(\"Hello\"),true);\n assert.deepEqual(candidate(\"abcdcba\"),true);\n assert.deepEqual(candidate(\"kittens\"),true);\n assert.deepEqual(candidate(\"orange\"),false);\n assert.deepEqual(candidate(\"wow\"),true);\n assert.deepEqual(candidate(\"world\"),true);\n assert.deepEqual(candidate(\"MadaM\"),true);\n assert.deepEqual(candidate(\"Wow\"),true);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"HI\"),true);\n assert.deepEqual(candidate(\"go\"),true);\n assert.deepEqual(candidate(\"gogo\"),false);\n assert.deepEqual(candidate(\"aaaaaaaaaaaaaaa\"),false);\n assert.deepEqual(candidate(\"Madam\"),true);\n assert.deepEqual(candidate(\"M\"),false);\n assert.deepEqual(candidate(\"0\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_58_common", - "language": "ts", - "prompt": "//Return sorted unique common elements for two lists.\nfunction common(l1: number[], l2: number[]): number[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = common;\n assert.deepEqual(candidate([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]),[1, 5, 653]);\n assert.deepEqual(candidate([5, 3, 2, 8], [3, 2]),[2, 3]);\n assert.deepEqual(candidate([4, 3, 2, 8], [3, 2, 4]),[2, 3, 4]);\n assert.deepEqual(candidate([4, 3, 2, 8], []),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "ts", - "prompt": "//The Brazilian factorial is defined as:\n// brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n// where n > 0\n// For example:\n// The function will receive an integer as input and should return the special\n// factorial of this integer.\nfunction special_factorial(n: number): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = special_factorial;\n assert.deepEqual(candidate(4),288);\n assert.deepEqual(candidate(5),34560);\n assert.deepEqual(candidate(7),125411328000);\n assert.deepEqual(candidate(1),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "ts", - "prompt": "//In this problem, you will implement a function that takes two lists of numbers,\n// and determines whether it is possible to perform an exchange of elements\n// between them to make lst1 a list of only even numbers.\n// There is no limit on the number of exchanged elements between lst1 and lst2.\n// If it is possible to exchange elements between the lst1 and lst2 to make\n// all the elements of lst1 to be even, return \"YES\".\n// Otherwise, return \"NO\".\n// For example:\n// It is assumed that the input lists will be non-empty.\nfunction exchange(lst1: number[], lst2: number[]): string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = exchange;\n assert.deepEqual(candidate([1, 2, 3, 4], [1, 2, 3, 4]),\"YES\");\n assert.deepEqual(candidate([1, 2, 3, 4], [1, 5, 3, 4]),\"NO\");\n assert.deepEqual(candidate([1, 2, 3, 4], [2, 1, 4, 3]),\"YES\");\n assert.deepEqual(candidate([5, 7, 3], [2, 6, 4]),\"YES\");\n assert.deepEqual(candidate([5, 7, 3], [2, 6, 3]),\"NO\");\n assert.deepEqual(candidate([3, 2, 6, 1, 8, 9], [3, 5, 5, 1, 1, 1]),\"NO\");\n assert.deepEqual(candidate([100, 200], [200, 200]),\"YES\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "ts", - "prompt": "//Given a non-empty array of integers arr and an integer k, return\n// the sum of the elements with at most two digits from the first k elements of arr.\n// Example:\n// Constraints:\n// 1. 1 <= len(arr) <= 100\n// 2. 1 <= k <= len(arr)\nfunction add_elements(arr: number[], k: number): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = add_elements;\n assert.deepEqual(candidate([1, -2, -3, 41, 57, 76, 87, 88, 99], 3),-4);\n assert.deepEqual(candidate([111, 121, 3, 4000, 5, 6], 2),0);\n assert.deepEqual(candidate([11, 21, 3, 90, 5, 6, 7, 8, 9], 4),125);\n assert.deepEqual(candidate([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4),24);\n assert.deepEqual(candidate([1], 1),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "ts", - "prompt": "//A simple program which should return the value of x if n is \n// a prime number and should return the value of y otherwise.\n// Examples:\nfunction x_or_y(n: number, x: number, y: number): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = x_or_y;\n assert.deepEqual(candidate(7, 34, 12),34);\n assert.deepEqual(candidate(15, 8, 5),5);\n assert.deepEqual(candidate(3, 33, 5212),33);\n assert.deepEqual(candidate(1259, 3, 52),3);\n assert.deepEqual(candidate(7919, -1, 12),-1);\n assert.deepEqual(candidate(3609, 1245, 583),583);\n assert.deepEqual(candidate(91, 56, 129),129);\n assert.deepEqual(candidate(6, 34, 1234),1234);\n assert.deepEqual(candidate(1, 2, 0),0);\n assert.deepEqual(candidate(2, 2, 0),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "ts", - "prompt": "//Given length of a side and high return area for a triangle.\nfunction triangle_area(a: number, h: number): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = triangle_area;\n assert.deepEqual(candidate(5, 3),7.5);\n assert.deepEqual(candidate(2, 2),2.0);\n assert.deepEqual(candidate(10, 8),40.0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "ts", - "prompt": "//Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n// the last couple centuries. However, what people don't know is Tribonacci sequence.\n// Tribonacci sequence is defined by the recurrence:\n// tri(1) = 3\n// tri(n) = 1 + n / 2, if n is even.\n// tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n// For example:\n// tri(2) = 1 + (2 / 2) = 2\n// tri(4) = 3\n// tri(3) = tri(2) + tri(1) + tri(4)\n// = 2 + 3 + 3 = 8 \n// You are given a non-negative integer number n, you have to a return a list of the \n// first n + 1 numbers of the Tribonacci sequence.\n// Examples:\nfunction tri(n: number): number[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = tri;\n assert.deepEqual(candidate(3),[1, 3, 2, 8]);\n assert.deepEqual(candidate(4),[1, 3, 2, 8, 3]);\n assert.deepEqual(candidate(5),[1, 3, 2, 8, 3, 15]);\n assert.deepEqual(candidate(6),[1, 3, 2, 8, 3, 15, 4]);\n assert.deepEqual(candidate(7),[1, 3, 2, 8, 3, 15, 4, 24]);\n assert.deepEqual(candidate(8),[1, 3, 2, 8, 3, 15, 4, 24, 5]);\n assert.deepEqual(candidate(9),[1, 3, 2, 8, 3, 15, 4, 24, 5, 35]);\n assert.deepEqual(candidate(20),[1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11]);\n assert.deepEqual(candidate(0),[1]);\n assert.deepEqual(candidate(1),[1, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "ts", - "prompt": "//You are given a list of two strings, both strings consist of open\n// parentheses '(' or close parentheses ')' only.\n// Your job is to check if it is possible to concatenate the two strings in\n// some order, that the resulting string will be good.\n// A string S is considered to be good if and only if all parentheses in S\n// are balanced. For example: the string '(())()' is good, while the string\n// '())' is not.\n// Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n// Examples:\nfunction match_parens(lst: string[]): string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = match_parens;\n assert.deepEqual(candidate([\"()(\", \")\"]),\"Yes\");\n assert.deepEqual(candidate([\")\", \")\"]),\"No\");\n assert.deepEqual(candidate([\"(()(())\", \"())())\"]),\"No\");\n assert.deepEqual(candidate([\")())\", \"(()()(\"]),\"Yes\");\n assert.deepEqual(candidate([\"(())))\", \"(()())((\"]),\"Yes\");\n assert.deepEqual(candidate([\"()\", \"())\"]),\"No\");\n assert.deepEqual(candidate([\"(()(\", \"()))()\"]),\"Yes\");\n assert.deepEqual(candidate([\"((((\", \"((())\"]),\"No\");\n assert.deepEqual(candidate([\")(()\", \"(()(\"]),\"No\");\n assert.deepEqual(candidate([\")(\", \")(\"]),\"No\");\n assert.deepEqual(candidate([\"(\", \")\"]),\"Yes\");\n assert.deepEqual(candidate([\")\", \"(\"]),\"Yes\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "ts", - "prompt": "//From a list of integers, remove all elements that occur more than once.\n// Keep order of elements left the same as in the input.\nfunction remove_duplicates(numbers: number[]): number[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = remove_duplicates;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, 2, 3, 4]),[1, 2, 3, 4]);\n assert.deepEqual(candidate([1, 2, 3, 2, 4, 3, 5]),[1, 4, 5]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "ts", - "prompt": "//Return a greatest common divisor of two integers a and b\nfunction greatest_common_divisor(a: number, b: number): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = greatest_common_divisor;\n assert.deepEqual(candidate(3, 7),1);\n assert.deepEqual(candidate(10, 15),5);\n assert.deepEqual(candidate(49, 14),7);\n assert.deepEqual(candidate(144, 60),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "ts", - "prompt": "//Checks if given string is a palindrome\nfunction is_palindrome(text: string): boolean {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_palindrome;\n assert.deepEqual(candidate(\"\"),true);\n assert.deepEqual(candidate(\"aba\"),true);\n assert.deepEqual(candidate(\"aaaaa\"),true);\n assert.deepEqual(candidate(\"zbcd\"),false);\n assert.deepEqual(candidate(\"xywyx\"),true);\n assert.deepEqual(candidate(\"xywyz\"),false);\n assert.deepEqual(candidate(\"xywzx\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "ts", - "prompt": "//xs represent coefficients of a polynomial.\n// xs[0] + xs[1] * x + xs[2] * x^2 + ....\n// Return derivative of this polynomial in the same form.\nfunction derivative(xs: number[]): number[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = derivative;\n assert.deepEqual(candidate([3, 1, 2, 4, 5]),[1, 4, 12, 20]);\n assert.deepEqual(candidate([1, 2, 3]),[2, 6]);\n assert.deepEqual(candidate([3, 2, 1]),[2, 2]);\n assert.deepEqual(candidate([3, 2, 1, 0, 4]),[2, 2, 0, 16]);\n assert.deepEqual(candidate([1]),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "ts", - "prompt": "//In this task, you will be given a string that represents a number of apples and oranges \n// that are distributed in a basket of fruit this basket contains \n// apples, oranges, and mango fruits. Given the string that represents the total number of \n// the oranges and apples and an integer that represent the total number of the fruits \n// in the basket return the number of the mango fruits in the basket.\n// for examble:\nfunction fruit_distribution(s: string, n: number): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fruit_distribution;\n assert.deepEqual(candidate(\"5 apples and 6 oranges\", 19),8);\n assert.deepEqual(candidate(\"5 apples and 6 oranges\", 21),10);\n assert.deepEqual(candidate(\"0 apples and 1 oranges\", 3),2);\n assert.deepEqual(candidate(\"1 apples and 0 oranges\", 3),2);\n assert.deepEqual(candidate(\"2 apples and 3 oranges\", 100),95);\n assert.deepEqual(candidate(\"2 apples and 3 oranges\", 5),0);\n assert.deepEqual(candidate(\"1 apples and 100 oranges\", 120),19);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "ts", - "prompt": "//Write a function that takes an integer a and returns True \n// if this ingeger is a cube of some integer number.\n// Note: you may assume the input is always valid.\n// Examples:\nfunction iscube(a: number): boolean {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = iscube;\n assert.deepEqual(candidate(1),true);\n assert.deepEqual(candidate(2),false);\n assert.deepEqual(candidate(-1),true);\n assert.deepEqual(candidate(64),true);\n assert.deepEqual(candidate(180),false);\n assert.deepEqual(candidate(1000),true);\n assert.deepEqual(candidate(0),true);\n assert.deepEqual(candidate(1729),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "ts", - "prompt": "//In this Kata, you have to sort an array of non-negative integers according to\n// number of ones in their binary representation in ascending order.\n// For similar number of ones, sort based on decimal value.\n// It must be implemented like this:\nfunction sort_array(arr: number[]): number[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_array;\n assert.deepEqual(candidate([1, 5, 2, 3, 4]),[1, 2, 4, 3, 5]);\n assert.deepEqual(candidate([-2, -3, -4, -5, -6]),[-4, -2, -6, -5, -3]);\n assert.deepEqual(candidate([1, 0, 2, 3, 4]),[0, 1, 2, 4, 3]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]),[2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77]);\n assert.deepEqual(candidate([3, 6, 44, 12, 32, 5]),[32, 3, 5, 6, 12, 44]);\n assert.deepEqual(candidate([2, 4, 8, 16, 32]),[2, 4, 8, 16, 32]);\n assert.deepEqual(candidate([2, 4, 8, 16, 32]),[2, 4, 8, 16, 32]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "ts", - "prompt": "//Given a list of strings, where each string consists of only digits, return a list.\n// Each element i of the output should be \"the number of odd elements in the\n// string i of the input.\" where all the i's should be replaced by the number\n// of odd digits in the i'th string of the input.\nfunction odd_count(lst: string[]): string[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = odd_count;\n assert.deepEqual(candidate([\"1234567\"]),[\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]);\n assert.deepEqual(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.\"]);\n assert.deepEqual(candidate([\"271\", \"137\", \"314\"]),[\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "ts", - "prompt": "//brackets is a string of \"(\" and \")\".\n// return True if every opening bracket has a corresponding closing bracket.\nfunction correct_bracketing(brackets: string): boolean {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = correct_bracketing;\n assert.deepEqual(candidate(\"()\"),true);\n assert.deepEqual(candidate(\"(()())\"),true);\n assert.deepEqual(candidate(\"()()(()())()\"),true);\n assert.deepEqual(candidate(\"()()((()()())())(()()(()))\"),true);\n assert.deepEqual(candidate(\"((()())))\"),false);\n assert.deepEqual(candidate(\")(()\"),false);\n assert.deepEqual(candidate(\"(\"),false);\n assert.deepEqual(candidate(\"((((\"),false);\n assert.deepEqual(candidate(\")\"),false);\n assert.deepEqual(candidate(\"(()\"),false);\n assert.deepEqual(candidate(\"()()(()())())(()\"),false);\n assert.deepEqual(candidate(\"()()(()())()))()\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "ts", - "prompt": "//Task\n// Write a function that takes a string as input and returns the sum of the upper characters only'\n// ASCII codes.\n// Examples:\nfunction digitSum(s: string): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = digitSum;\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"abAB\"),131);\n assert.deepEqual(candidate(\"abcCd\"),67);\n assert.deepEqual(candidate(\"helloE\"),69);\n assert.deepEqual(candidate(\"woArBld\"),131);\n assert.deepEqual(candidate(\"aAaaaXa\"),153);\n assert.deepEqual(candidate(\" How are yOu?\"),151);\n assert.deepEqual(candidate(\"You arE Very Smart\"),327);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "ts", - "prompt": "//Write a function that accepts a list of strings as a parameter,\n// deletes the strings that have odd lengths from it,\n// and returns the resulted list with a sorted order,\n// The list is always a list of strings and never an array of numbers,\n// and it may contain duplicates.\n// The order of the list should be ascending by length of each word, and you\n// should return the list sorted by that rule.\n// If two words have the same length, sort the list alphabetically.\n// The function should return a list of strings in sorted order.\n// You may assume that all words will have the same length.\n// For example:\nfunction sorted_list_sum(lst: string[]): string[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sorted_list_sum;\n assert.deepEqual(candidate([\"aa\", \"a\", \"aaa\"]),[\"aa\"]);\n assert.deepEqual(candidate([\"school\", \"AI\", \"asdf\", \"b\"]),[\"AI\", \"asdf\", \"school\"]);\n assert.deepEqual(candidate([\"d\", \"b\", \"c\", \"a\"]),[]);\n assert.deepEqual(candidate([\"d\", \"dcba\", \"abcd\", \"a\"]),[\"abcd\", \"dcba\"]);\n assert.deepEqual(candidate([\"AI\", \"ai\", \"au\"]),[\"AI\", \"ai\", \"au\"]);\n assert.deepEqual(candidate([\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"]),[]);\n assert.deepEqual(candidate([\"aaaa\", \"bbbb\", \"dd\", \"cc\"]),[\"cc\", \"dd\", \"aaaa\", \"bbbb\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "ts", - "prompt": "//You are given an array arr of integers and you need to return\n// sum of magnitudes of integers multiplied by product of all signs\n// of each number in the array, represented by 1, -1 or 0.\n// Note: return None for empty arr.\n// Example:\nfunction prod_signs(arr: number[]): number | undefined {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = prod_signs;\n assert.deepEqual(candidate([1, 2, 2, -4]),-9);\n assert.deepEqual(candidate([0, 1]),0);\n assert.deepEqual(candidate([1, 1, 1, 2, 3, -1, 1]),-10);\n assert.deepEqual(candidate([]),undefined);\n assert.deepEqual(candidate([2, 4, 1, 2, -1, -1, 9]),20);\n assert.deepEqual(candidate([-1, 1, -1, 1]),4);\n assert.deepEqual(candidate([-1, 1, 1, 1]),-4);\n assert.deepEqual(candidate([-1, 1, 1, 0]),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "ts", - "prompt": "//Return list with elements incremented by 1.\nfunction incr_list(l: number[]): number[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = incr_list;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([3, 2, 1]),[4, 3, 2]);\n assert.deepEqual(candidate([5, 2, 5, 2, 3, 3, 9, 0, 123]),[6, 3, 6, 3, 4, 4, 10, 1, 124]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "ts", - "prompt": "//From a given list of integers, generate a list of rolling maximum element found until given moment\n// in the sequence.\nfunction rolling_max(numbers: number[]): number[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = rolling_max;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, 2, 3, 4]),[1, 2, 3, 4]);\n assert.deepEqual(candidate([4, 3, 2, 1]),[4, 4, 4, 4]);\n assert.deepEqual(candidate([3, 2, 3, 100, 3]),[3, 3, 3, 100, 100]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "ts", - "prompt": "//Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n// separate those group into separate strings and return the list of those.\n// Separate groups are balanced (each open brace is properly closed) and not nested within each other\n// Ignore any spaces in the input string.\nfunction separate_paren_groups(paren_string: string): string[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = separate_paren_groups;\n assert.deepEqual(candidate(\"(()()) ((())) () ((())()())\"),[\"(()())\", \"((()))\", \"()\", \"((())()())\"]);\n assert.deepEqual(candidate(\"() (()) ((())) (((())))\"),[\"()\", \"(())\", \"((()))\", \"(((())))\"]);\n assert.deepEqual(candidate(\"(()(())((())))\"),[\"(()(())((())))\"]);\n assert.deepEqual(candidate(\"( ) (( )) (( )( ))\"),[\"()\", \"(())\", \"(()())\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "ts", - "prompt": "//You will be given a string of words separated by commas or spaces. Your task is\n// to split the string into words and return an array of the words.\n// For example:\nfunction words_string(s: string): string[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = words_string;\n assert.deepEqual(candidate(\"Hi, my name is John\"),[\"Hi\", \"my\", \"name\", \"is\", \"John\"]);\n assert.deepEqual(candidate(\"One, two, three, four, five, six\"),[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]);\n assert.deepEqual(candidate(\"Hi, my name\"),[\"Hi\", \"my\", \"name\"]);\n assert.deepEqual(candidate(\"One,, two, three, four, five, six,\"),[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]);\n assert.deepEqual(candidate(\"\"),[]);\n assert.deepEqual(candidate(\"ahmed , gamal\"),[\"ahmed\", \"gamal\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "ts", - "prompt": "//Filter given list of any python values only for integers\nfunction filter_integers(values: any[]): number[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = filter_integers;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([4, {}, [], 23.2, 9, \"adasd\"]),[4, 9]);\n assert.deepEqual(candidate([3, \"c\", 3, 3, \"a\", \"b\"]),[3, 3, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "ts", - "prompt": "//This function takes a list l and returns a list l' such that\n// l' is identical to l in the odd indicies, while its values at the even indicies are equal\n// to the values of the even indicies of l, but sorted.\nfunction sort_even(l: number[]): number[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_even;\n assert.deepEqual(candidate([1, 2, 3]),[1, 2, 3]);\n assert.deepEqual(candidate([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]),[-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123]);\n assert.deepEqual(candidate([5, 8, -12, 4, 23, 2, 3, 11, 12, -10]),[-12, 8, 3, 4, 5, 2, 12, 11, 23, -10]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "ts", - "prompt": "//I think we all remember that feeling when the result of some long-awaited\n// event is finally known. The feelings and thoughts you have at that moment are\n// definitely worth noting down and comparing.\n// Your task is to determine if a person correctly guessed the results of a number of matches.\n// You are given two arrays of scores and guesses of equal length, where each index shows a match. \n// Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n// the value is 0, and if not, the value is the absolute difference between the guess and the score.\n// example:\nfunction compare(game: number[], guess: number[]): number[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = compare;\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2]),[0, 0, 0, 0, 3, 3]);\n assert.deepEqual(candidate([0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]),[0, 0, 0, 0, 0, 0]);\n assert.deepEqual(candidate([1, 2, 3], [-1, -2, -3]),[2, 4, 6]);\n assert.deepEqual(candidate([1, 2, 3, 5], [-1, 2, 3, 4]),[2, 0, 0, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "ts", - "prompt": "//Given a positive integer n, return a tuple that has the number of even and odd\n// integer palindromes that fall within the range(1, n), inclusive.\n// Example 1:\n// Explanation:\n// Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n// Example 2:\n// Explanation:\n// Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n// Note:\n// 1. 1 <= n <= 10^3\n// 2. returned tuple has the number of even and odd integer palindromes respectively.\nfunction even_odd_palindrome(n: number): [number, number] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = even_odd_palindrome;\n assert.deepEqual(candidate(123),[8, 13]);\n assert.deepEqual(candidate(12),[4, 6]);\n assert.deepEqual(candidate(3),[1, 2]);\n assert.deepEqual(candidate(63),[6, 8]);\n assert.deepEqual(candidate(25),[5, 6]);\n assert.deepEqual(candidate(19),[4, 6]);\n assert.deepEqual(candidate(9),[4, 5]);\n assert.deepEqual(candidate(1),[0, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "ts", - "prompt": "//The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fib4(0) -> 0\n// fib4(1) -> 0\n// fib4(2) -> 2\n// fib4(3) -> 0\n// fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n// Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\nfunction fib4(n: number): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fib4;\n assert.deepEqual(candidate(5),4);\n assert.deepEqual(candidate(8),28);\n assert.deepEqual(candidate(10),104);\n assert.deepEqual(candidate(12),386);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "ts", - "prompt": "//Given two positive integers a and b, return the even digits between a\n// and b, in ascending order.\n// For example:\nfunction generate_integers(a: number, b: number): number[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = generate_integers;\n assert.deepEqual(candidate(2, 10),[2, 4, 6, 8]);\n assert.deepEqual(candidate(10, 2),[2, 4, 6, 8]);\n assert.deepEqual(candidate(132, 2),[2, 4, 6, 8]);\n assert.deepEqual(candidate(17, 89),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "ts", - "prompt": "//For a given list of input numbers, calculate Mean Absolute Deviation\n// around the mean of this dataset.\n// Mean Absolute Deviation is the average absolute difference between each\n// element and a centerpoint (mean in this case):\n// MAD = average | x - x_mean |\nfunction mean_absolute_deviation(numbers: number[]): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = mean_absolute_deviation;\n assert.deepEqual(candidate([1.0, 2.0]),0.5);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0]),1.0);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0]),1.2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "ts", - "prompt": "//Create a function encrypt that takes a string as an argument and\n// returns a string encrypted with the alphabet being rotated. \n// The alphabet should be rotated in a manner such that the letters \n// shift down by two multiplied to two places.\n// For example:\nfunction encrypt(s: string): string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = encrypt;\n assert.deepEqual(candidate(\"hi\"),\"lm\");\n assert.deepEqual(candidate(\"asdfghjkl\"),\"ewhjklnop\");\n assert.deepEqual(candidate(\"gf\"),\"kj\");\n assert.deepEqual(candidate(\"et\"),\"ix\");\n assert.deepEqual(candidate(\"faewfawefaewg\"),\"jeiajeaijeiak\");\n assert.deepEqual(candidate(\"hellomyfriend\"),\"lippsqcjvmirh\");\n assert.deepEqual(candidate(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\"),\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\");\n assert.deepEqual(candidate(\"a\"),\"e\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "ts", - "prompt": "//Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n// The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n// as follows: start with any positive integer n. Then each term is obtained from the \n// previous term as follows: if the previous term is even, the next term is one half of \n// the previous term. If the previous term is odd, the next term is 3 times the previous\n// term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n// Note: \n// 1. Collatz(1) is [1].\n// 2. returned list sorted in increasing order.\n// For example:\n// get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\nfunction get_odd_collatz(n: number): number[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_odd_collatz;\n assert.deepEqual(candidate(14),[1, 5, 7, 11, 13, 17]);\n assert.deepEqual(candidate(5),[1, 5]);\n assert.deepEqual(candidate(12),[1, 3, 5]);\n assert.deepEqual(candidate(1),[1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "ts", - "prompt": "//Find how many times a given substring can be found in the original string. Count overlaping cases.\nfunction how_many_times(string: string, substring: string): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = how_many_times;\n assert.deepEqual(candidate(\"\", \"x\"),0);\n assert.deepEqual(candidate(\"xyxyxyx\", \"x\"),4);\n assert.deepEqual(candidate(\"cacacacac\", \"cac\"),4);\n assert.deepEqual(candidate(\"john doe\", \"john\"),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "ts", - "prompt": "//We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n// numbers in the array will be randomly ordered. Your task is to determine if\n// it is possible to get an array sorted in non-decreasing order by performing \n// the following operation on the given array:\n// You are allowed to perform right shift operation any number of times.\n// One right shift operation means shifting all elements of the array by one\n// position in the right direction. The last element of the array will be moved to\n// the starting position in the array i.e. 0th index. \n// If it is possible to obtain the sorted array by performing the above operation\n// then return True else return False.\n// If the given array is empty then return True.\n// Note: The given list is guaranteed to have unique elements.\n// For Example:\n// Explanation: By performin 2 right shift operations, non-decreasing order can\n// be achieved for the given array.\n// Explanation:It is not possible to get non-decreasing order for the given\n// array by performing any number of right shift operations.\nfunction move_one_ball(arr: number[]): boolean {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = move_one_ball;\n assert.deepEqual(candidate([3, 4, 5, 1, 2]),true);\n assert.deepEqual(candidate([3, 5, 10, 1, 2]),true);\n assert.deepEqual(candidate([4, 3, 1, 2]),false);\n assert.deepEqual(candidate([3, 5, 4, 1, 2]),false);\n assert.deepEqual(candidate([]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "ts", - "prompt": "//Write a function which sorts the given list of integers\n// in ascending order according to the sum of their digits.\n// Note: if there are several items with similar sum of their digits,\n// order them based on their index in original list.\n// For example:\nfunction order_by_points(nums: number[]): number[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = order_by_points;\n assert.deepEqual(candidate([1, 11, -1, -11, -12]),[-1, -11, 1, -12, 11]);\n assert.deepEqual(candidate([1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]),[0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, -11, -32, 43, 54, -98, 2, -3]),[-3, -32, -98, -11, 1, 2, 43, 54]);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]),[1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9]);\n assert.deepEqual(candidate([0, 6, 6, -76, -21, 23, 4]),[-76, -21, 0, 4, 23, 6, 6]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "ts", - "prompt": "//Return list of prime factors of given integer in the order from smallest to largest.\n// Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n// Input number should be equal to the product of all factors\nfunction factorize(n: number): number[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = factorize;\n assert.deepEqual(candidate(2),[2]);\n assert.deepEqual(candidate(4),[2, 2]);\n assert.deepEqual(candidate(8),[2, 2, 2]);\n assert.deepEqual(candidate(57),[3, 19]);\n assert.deepEqual(candidate(3249),[3, 3, 19, 19]);\n assert.deepEqual(candidate(185193),[3, 3, 3, 19, 19, 19]);\n assert.deepEqual(candidate(20577),[3, 19, 19, 19]);\n assert.deepEqual(candidate(18),[2, 3, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "ts", - "prompt": "//Return True if all numbers in the list l are below threshold t.\nfunction below_threshold(l: number[], t: number): boolean {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = below_threshold;\n assert.deepEqual(candidate([1, 2, 4, 10], 100),true);\n assert.deepEqual(candidate([1, 20, 4, 10], 5),false);\n assert.deepEqual(candidate([1, 20, 4, 10], 21),true);\n assert.deepEqual(candidate([1, 20, 4, 10], 22),true);\n assert.deepEqual(candidate([1, 8, 4, 10], 11),true);\n assert.deepEqual(candidate([1, 8, 4, 10], 10),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "ts", - "prompt": "//You are given two positive integers n and m, and your task is to compute the\n// average of the integers from n through m (including n and m). \n// Round the answer to the nearest integer and convert that to binary.\n// If n is greater than m, return -1.\n// Example:\nfunction rounded_avg(n: number, m: number): string| number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = rounded_avg;\n assert.deepEqual(candidate(1, 5),\"0b11\");\n assert.deepEqual(candidate(7, 13),\"0b1010\");\n assert.deepEqual(candidate(964, 977),\"0b1111001010\");\n assert.deepEqual(candidate(996, 997),\"0b1111100100\");\n assert.deepEqual(candidate(560, 851),\"0b1011000010\");\n assert.deepEqual(candidate(185, 546),\"0b101101110\");\n assert.deepEqual(candidate(362, 496),\"0b110101101\");\n assert.deepEqual(candidate(350, 902),\"0b1001110010\");\n assert.deepEqual(candidate(197, 233),\"0b11010111\");\n assert.deepEqual(candidate(7, 5),-1);\n assert.deepEqual(candidate(5, 1),-1);\n assert.deepEqual(candidate(5, 5),\"0b101\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "ts", - "prompt": "//Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n// For each of the group, output the deepest level of nesting of parentheses.\n// E.g. (()()) has maximum two levels of nesting while ((())) has three.\nfunction parse_nested_parens(paren_string: string): number[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = parse_nested_parens;\n assert.deepEqual(candidate(\"(()()) ((())) () ((())()())\"),[2, 3, 1, 3]);\n assert.deepEqual(candidate(\"() (()) ((())) (((())))\"),[1, 2, 3, 4]);\n assert.deepEqual(candidate(\"(()(())((())))\"),[4]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "ts", - "prompt": "//Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n// Examples\nfunction solution(lst: number[]): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = solution;\n assert.deepEqual(candidate([5, 8, 7, 1]),12);\n assert.deepEqual(candidate([3, 3, 3, 3, 3]),9);\n assert.deepEqual(candidate([30, 13, 24, 321]),0);\n assert.deepEqual(candidate([5, 9]),5);\n assert.deepEqual(candidate([2, 4, 8]),0);\n assert.deepEqual(candidate([30, 13, 23, 32]),23);\n assert.deepEqual(candidate([3, 13, 2, 9]),3);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "ts", - "prompt": "//You are given a positive integer n. You have to create an integer array a of length n.\n// For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n// Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n// and a[i] + a[j] + a[k] is a multiple of 3.\n// Example :\n// Explanation: \n// a = [1, 3, 7, 13, 21]\n// The only valid triple is (1, 7, 13).\nfunction get_max_triples(n: number): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_max_triples;\n assert.deepEqual(candidate(5),1);\n assert.deepEqual(candidate(6),4);\n assert.deepEqual(candidate(10),36);\n assert.deepEqual(candidate(100),53361);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "ts", - "prompt": "//You are given a list of integers.\n// Write a function next_smallest() that returns the 2nd smallest element of the list.\n// Return None if there is no such element.\nfunction next_smallest(lst: number[]): number | undefined {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = next_smallest;\n assert.deepEqual(candidate([1, 2, 3, 4, 5]),2);\n assert.deepEqual(candidate([5, 1, 4, 3, 2]),2);\n assert.deepEqual(candidate([]),undefined);\n assert.deepEqual(candidate([1, 1]),undefined);\n assert.deepEqual(candidate([1, 1, 1, 1, 0]),1);\n assert.deepEqual(candidate([1, 1]),undefined);\n assert.deepEqual(candidate([-35, 34, 12, -45]),-35);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "ts", - "prompt": "//Input is a space-delimited string of numberals from 'zero' to 'nine'.\n// Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n// Return the string with numbers sorted from smallest to largest\nfunction sort_numbers(numbers: string): string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_numbers;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"three\"),\"three\");\n assert.deepEqual(candidate(\"three five nine\"),\"three five nine\");\n assert.deepEqual(candidate(\"five zero four seven nine eight\"),\"zero four five seven eight nine\");\n assert.deepEqual(candidate(\"six five four three two one zero\"),\"zero one two three four five six\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "ts", - "prompt": "//You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\nfunction cycpattern_check(a: string, b: string): boolean {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = cycpattern_check;\n assert.deepEqual(candidate(\"xyzw\", \"xyw\"),false);\n assert.deepEqual(candidate(\"yello\", \"ell\"),true);\n assert.deepEqual(candidate(\"whattup\", \"ptut\"),false);\n assert.deepEqual(candidate(\"efef\", \"fee\"),true);\n assert.deepEqual(candidate(\"abab\", \"aabb\"),false);\n assert.deepEqual(candidate(\"winemtt\", \"tinem\"),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "ts", - "prompt": "//You will be given a number in decimal form and your task is to convert it to\n// binary format. The function should return a string, with each character representing a binary\n// number. Each character in the string will be '0' or '1'.\n// There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n// The extra characters are there to help with the format.\n// Examples:\nfunction decimal_to_binary(decimal: number): string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = decimal_to_binary;\n assert.deepEqual(candidate(0),\"db0db\");\n assert.deepEqual(candidate(32),\"db100000db\");\n assert.deepEqual(candidate(103),\"db1100111db\");\n assert.deepEqual(candidate(15),\"db1111db\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "ts", - "prompt": "//Filter an input list of strings only for ones that contain given substring\nfunction filter_by_substring(strings: string[], substring: string): string[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = filter_by_substring;\n assert.deepEqual(candidate([], \"john\"),[]);\n assert.deepEqual(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"),[\"xxx\", \"xxxAAA\", \"xxx\"]);\n assert.deepEqual(candidate([\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xx\"),[\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"]);\n assert.deepEqual(candidate([\"grunt\", \"trumpet\", \"prune\", \"gruesome\"], \"run\"),[\"grunt\", \"prune\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "ts", - "prompt": "//Given an integer. return a tuple that has the number of even and odd digits respectively.\n// Example:\nfunction even_odd_count(num: number): [number, number] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = even_odd_count;\n assert.deepEqual(candidate(7),[0, 1]);\n assert.deepEqual(candidate(-78),[1, 1]);\n assert.deepEqual(candidate(3452),[2, 2]);\n assert.deepEqual(candidate(346211),[3, 3]);\n assert.deepEqual(candidate(-345821),[3, 3]);\n assert.deepEqual(candidate(-2),[1, 0]);\n assert.deepEqual(candidate(-45347),[2, 3]);\n assert.deepEqual(candidate(0),[1, 0]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "ts", - "prompt": "//Write a function that accepts a list of strings.\n// The list contains different words. Return the word with maximum number\n// of unique characters. If multiple strings have maximum number of unique\n// characters, return the one which comes first in lexicographical order.\nfunction find_max(words: string[]): string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = find_max;\n assert.deepEqual(candidate([\"name\", \"of\", \"string\"]),\"string\");\n assert.deepEqual(candidate([\"name\", \"enam\", \"game\"]),\"enam\");\n assert.deepEqual(candidate([\"aaaaaaa\", \"bb\", \"cc\"]),\"aaaaaaa\");\n assert.deepEqual(candidate([\"abc\", \"cba\"]),\"abc\");\n assert.deepEqual(candidate([\"play\", \"this\", \"game\", \"of\", \"footbott\"]),\"footbott\");\n assert.deepEqual(candidate([\"we\", \"are\", \"gonna\", \"rock\"]),\"gonna\");\n assert.deepEqual(candidate([\"we\", \"are\", \"a\", \"mad\", \"nation\"]),\"nation\");\n assert.deepEqual(candidate([\"this\", \"is\", \"a\", \"prrk\"]),\"this\");\n assert.deepEqual(candidate([\"b\"]),\"b\");\n assert.deepEqual(candidate([\"play\", \"play\", \"play\"]),\"play\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "ts", - "prompt": "//Create a function that returns a tuple (a, b), where 'a' is\n// the largest of negative integers, and 'b' is the smallest\n// of positive integers in a list.\n// If there is no negative or positive integers, return them as None.\n// Examples:\nfunction largest_smallest_integers(lst: number[]): [number | undefined, number | undefined] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = largest_smallest_integers;\n assert.deepEqual(candidate([2, 4, 1, 3, 5, 7]),[undefined, 1]);\n assert.deepEqual(candidate([2, 4, 1, 3, 5, 7, 0]),[undefined, 1]);\n assert.deepEqual(candidate([1, 3, 2, 4, 5, 6, -2]),[-2, 1]);\n assert.deepEqual(candidate([4, 5, 3, 6, 2, 7, -7]),[-7, 2]);\n assert.deepEqual(candidate([7, 3, 8, 4, 9, 2, 5, -9]),[-9, 2]);\n assert.deepEqual(candidate([]),[undefined, undefined]);\n assert.deepEqual(candidate([0]),[undefined, undefined]);\n assert.deepEqual(candidate([-1, -3, -5, -6]),[-1, undefined]);\n assert.deepEqual(candidate([-1, -3, -5, -6, 0]),[-1, undefined]);\n assert.deepEqual(candidate([-6, -4, -4, -3, 1]),[-3, 1]);\n assert.deepEqual(candidate([-6, -4, -4, -3, -100, 1]),[-3, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "ts", - "prompt": "//\"Given an array representing a branch of a tree that has non-negative integer nodes\n// your task is to pluck one of the nodes and return it.\n// The plucked node should be the node with the smallest even value.\n// If multiple nodes with the same smallest even value are found return the node that has smallest index.\n// The plucked node should be returned in a list, [ smalest_value, its index ],\n// If there are no even values or the given array is empty, return [].\n// Example 1:\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 2:\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 3:\n// Example 4:\n// Explanation: 0 is the smallest value, but there are two zeros,\n// so we will choose the first zero, which has the smallest index.\n// Constraints:\n// * 1 <= nodes.length <= 10000\n// * 0 <= node.value\nfunction pluck(arr: number[]): number[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = pluck;\n assert.deepEqual(candidate([4, 2, 3]),[2, 1]);\n assert.deepEqual(candidate([1, 2, 3]),[2, 1]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([5, 0, 3, 0, 4, 2]),[0, 1]);\n assert.deepEqual(candidate([1, 2, 3, 0, 5, 3]),[0, 3]);\n assert.deepEqual(candidate([5, 4, 8, 4, 8]),[4, 1]);\n assert.deepEqual(candidate([7, 6, 7, 1]),[6, 1]);\n assert.deepEqual(candidate([7, 9, 7, 1]),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "ts", - "prompt": "//Write a function count_nums which takes an array of integers and returns\n// the number of elements which has a sum of digits > 0.\n// If a number is negative, then its first signed digit will be negative:\n// e.g. -123 has signed digits -1, 2, and 3.\nfunction count_nums(arr: number[]): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_nums;\n assert.deepEqual(candidate([]),0);\n assert.deepEqual(candidate([-1, -2, 0]),0);\n assert.deepEqual(candidate([1, 1, 2, -2, 3, 4, 5]),6);\n assert.deepEqual(candidate([1, 6, 9, -6, 0, 1, 5]),5);\n assert.deepEqual(candidate([1, 100, 98, -7, 1, -1]),4);\n assert.deepEqual(candidate([12, 23, 34, -45, -56, 0]),5);\n assert.deepEqual(candidate([0, 1]),1);\n assert.deepEqual(candidate([1]),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "ts", - "prompt": "//Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n// each cell of the grid contains a value. Every integer in the range [1, N * N]\n// inclusive appears exactly once on the cells of the grid.\n// You have to find the minimum path of length k in the grid. You can start\n// from any cell, and in each step you can move to any of the neighbor cells,\n// in other words, you can go to cells which share an edge with you current\n// cell.\n// Please note that a path of length k means visiting exactly k cells (not\n// necessarily distinct).\n// You CANNOT go off the grid.\n// A path A (of length k) is considered less than a path B (of length k) if\n// after making the ordered lists of the values on the cells that A and B go\n// through (let's call them lst_A and lst_B), lst_A is lexicographically less\n// than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n// such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n// lst_A[j] = lst_B[j].\n// It is guaranteed that the answer is unique.\n// Return an ordered list of the values on the cells that the minimum path go through.\n// Examples:\nfunction minPath(grid: number[][], k: number): number[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = minPath;\n assert.deepEqual(candidate([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3),[1, 2, 1]);\n assert.deepEqual(candidate([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1),[1]);\n assert.deepEqual(candidate([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], 4),[1, 2, 1, 2]);\n assert.deepEqual(candidate([[6, 4, 13, 10], [5, 7, 12, 1], [3, 16, 11, 15], [8, 14, 9, 2]], 7),[1, 10, 1, 10, 1, 10, 1]);\n assert.deepEqual(candidate([[8, 14, 9, 2], [6, 4, 13, 15], [5, 7, 1, 12], [3, 10, 11, 16]], 5),[1, 7, 1, 7, 1]);\n assert.deepEqual(candidate([[11, 8, 7, 2], [5, 16, 14, 4], [9, 3, 15, 6], [12, 13, 10, 1]], 9),[1, 6, 1, 6, 1, 6, 1, 6, 1]);\n assert.deepEqual(candidate([[12, 13, 10, 1], [9, 3, 15, 6], [5, 16, 14, 4], [11, 8, 7, 2]], 12),[1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6]);\n assert.deepEqual(candidate([[2, 7, 4], [3, 1, 5], [6, 8, 9]], 8),[1, 3, 1, 3, 1, 3, 1, 3]);\n assert.deepEqual(candidate([[6, 1, 5], [3, 8, 9], [2, 7, 4]], 8),[1, 5, 1, 5, 1, 5, 1, 5]);\n assert.deepEqual(candidate([[1, 2], [3, 4]], 10),[1, 2, 1, 2, 1, 2, 1, 2, 1, 2]);\n assert.deepEqual(candidate([[1, 3], [3, 2]], 10),[1, 3, 1, 3, 1, 3, 1, 3, 1, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "ts", - "prompt": "//Given list of integers, return list in strange order.\n// Strange sorting, is when you start with the minimum value,\n// then maximum of the remaining integers, then minimum and so on.\n// Examples:\nfunction strange_sort_list(lst: number[]): number[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = strange_sort_list;\n assert.deepEqual(candidate([1, 2, 3, 4]),[1, 4, 2, 3]);\n assert.deepEqual(candidate([5, 6, 7, 8, 9]),[5, 9, 6, 8, 7]);\n assert.deepEqual(candidate([1, 2, 3, 4, 5]),[1, 5, 2, 4, 3]);\n assert.deepEqual(candidate([5, 6, 7, 8, 9, 1]),[1, 9, 5, 8, 6, 7]);\n assert.deepEqual(candidate([5, 5, 5, 5]),[5, 5, 5, 5]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6, 7, 8]),[1, 8, 2, 7, 3, 6, 4, 5]);\n assert.deepEqual(candidate([0, 2, 2, 2, 5, 5, -5, -5]),[-5, 5, -5, 5, 0, 2, 2, 2]);\n assert.deepEqual(candidate([111111]),[111111]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "ts", - "prompt": "//Given a string 'text', return its md5 hash equivalent string.\n// If 'text' is an empty string, return None.\nfunction string_to_md5(text: string): string | undefined {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = string_to_md5;\n assert.deepEqual(candidate(\"Hello world\"),\"3e25960a79dbc69b674cd4ec67a72c62\");\n assert.deepEqual(candidate(\"\"),undefined);\n assert.deepEqual(candidate(\"A B C\"),\"0ef78513b0cb8cef12743f5aeb35f888\");\n assert.deepEqual(candidate(\"password\"),\"5f4dcc3b5aa765d61d8327deb882cf99\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "ts", - "prompt": "//You are given a word. Your task is to find the closest vowel that stands between \n// two consonants from the right side of the word (case sensitive).\n// Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n// find any vowel met the above condition. \n// You may assume that the given string contains English letter only.\n// Example:\nfunction get_closest_vowel(word: string): string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_closest_vowel;\n assert.deepEqual(candidate(\"yogurt\"),\"u\");\n assert.deepEqual(candidate(\"full\"),\"u\");\n assert.deepEqual(candidate(\"easy\"),\"\");\n assert.deepEqual(candidate(\"eAsy\"),\"\");\n assert.deepEqual(candidate(\"ali\"),\"\");\n assert.deepEqual(candidate(\"bad\"),\"a\");\n assert.deepEqual(candidate(\"most\"),\"o\");\n assert.deepEqual(candidate(\"ab\"),\"\");\n assert.deepEqual(candidate(\"ba\"),\"\");\n assert.deepEqual(candidate(\"quick\"),\"\");\n assert.deepEqual(candidate(\"anime\"),\"i\");\n assert.deepEqual(candidate(\"Asia\"),\"\");\n assert.deepEqual(candidate(\"Above\"),\"o\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "ts", - "prompt": "//Change numerical base of input number x to base.\n// return string representation after the conversion.\n// base numbers are less than 10.\nfunction change_base(x: number, base: number): string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = change_base;\n assert.deepEqual(candidate(8, 3),\"22\");\n assert.deepEqual(candidate(9, 3),\"100\");\n assert.deepEqual(candidate(234, 2),\"11101010\");\n assert.deepEqual(candidate(16, 2),\"10000\");\n assert.deepEqual(candidate(8, 2),\"1000\");\n assert.deepEqual(candidate(7, 2),\"111\");\n assert.deepEqual(candidate(2, 3),\"2\");\n assert.deepEqual(candidate(3, 4),\"3\");\n assert.deepEqual(candidate(4, 5),\"4\");\n assert.deepEqual(candidate(5, 6),\"5\");\n assert.deepEqual(candidate(6, 7),\"6\");\n assert.deepEqual(candidate(7, 8),\"7\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "ts", - "prompt": "//Check if in given list of numbers, are any two numbers closer to each other than\n// given threshold.\nfunction has_close_elements(numbers: number[], threshold: number): boolean {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = has_close_elements;\n assert.deepEqual(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3),true);\n assert.deepEqual(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05),false);\n assert.deepEqual(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.95),true);\n assert.deepEqual(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.8),false);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1),true);\n assert.deepEqual(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 1.0),true);\n assert.deepEqual(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 0.5),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "ts", - "prompt": "//Create a function that takes a string as input which contains only square brackets.\n// The function should return True if and only if there is a valid subsequence of brackets \n// where at least one bracket in the subsequence is nested.\nfunction is_nested(string: string): boolean {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_nested;\n assert.deepEqual(candidate(\"[[]]\"),true);\n assert.deepEqual(candidate(\"[]]]]]]][[[[[]\"),false);\n assert.deepEqual(candidate(\"[][]\"),false);\n assert.deepEqual(candidate(\"[]\"),false);\n assert.deepEqual(candidate(\"[[[[]]]]\"),true);\n assert.deepEqual(candidate(\"[]]]]]]]]]]\"),false);\n assert.deepEqual(candidate(\"[][][[]]\"),true);\n assert.deepEqual(candidate(\"[[]\"),false);\n assert.deepEqual(candidate(\"[]]\"),false);\n assert.deepEqual(candidate(\"[[]][[\"),true);\n assert.deepEqual(candidate(\"[[][]]\"),true);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"[[[[[[[[\"),false);\n assert.deepEqual(candidate(\"]]]]]]]]\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "ts", - "prompt": "//Concatenate list of strings into a single string\nfunction concatenate(strings: string[]): string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = concatenate;\n assert.deepEqual(candidate([]),\"\");\n assert.deepEqual(candidate([\"x\", \"y\", \"z\"]),\"xyz\");\n assert.deepEqual(candidate([\"x\", \"y\", \"z\", \"w\", \"k\"]),\"xyzwk\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "ts", - "prompt": "//prime_fib returns n-th number that is a Fibonacci number and it's also prime.\nfunction prime_fib(n: number): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = prime_fib;\n assert.deepEqual(candidate(1),2);\n assert.deepEqual(candidate(2),3);\n assert.deepEqual(candidate(3),5);\n assert.deepEqual(candidate(4),13);\n assert.deepEqual(candidate(5),89);\n assert.deepEqual(candidate(6),233);\n assert.deepEqual(candidate(7),1597);\n assert.deepEqual(candidate(8),28657);\n assert.deepEqual(candidate(9),514229);\n assert.deepEqual(candidate(10),433494437);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "ts", - "prompt": "//From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n// other and return them in order (smaller number, larger number).\nfunction find_closest_elements(numbers: number[]): [number, number] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = find_closest_elements;\n assert.deepEqual(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2]),[3.9, 4.0]);\n assert.deepEqual(candidate([1.0, 2.0, 5.9, 4.0, 5.0]),[5.0, 5.9]);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]),[2.0, 2.2]);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]),[2.0, 2.0]);\n assert.deepEqual(candidate([1.1, 2.2, 3.1, 4.1, 5.1]),[2.2, 3.1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "ts", - "prompt": "//You have been tasked to write a function that receives \n// a hexadecimal number as a string and counts the number of hexadecimal \n// digits that are primes (prime number, or a prime, is a natural number \n// greater than 1 that is not a product of two smaller natural numbers).\n// Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n// Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n// So you have to determine a number of the following digits: 2, 3, 5, 7, \n// B (=decimal 11), D (=decimal 13).\n// Note: you may assume the input is always correct or empty string, \n// and symbols A,B,C,D,E,F are always uppercase.\n// Examples:\nfunction hex_key(num: string): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = hex_key;\n assert.deepEqual(candidate(\"AB\"),1);\n assert.deepEqual(candidate(\"1077E\"),2);\n assert.deepEqual(candidate(\"ABED1A33\"),4);\n assert.deepEqual(candidate(\"2020\"),2);\n assert.deepEqual(candidate(\"123456789ABCDEF0\"),6);\n assert.deepEqual(candidate(\"112233445566778899AABBCCDDEEFF00\"),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "ts", - "prompt": "//Complete the function that takes two integers and returns \n// the product of their unit digits.\n// Assume the input is always valid.\n// Examples:\nfunction multiply(a: number, b: number): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = multiply;\n assert.deepEqual(candidate(148, 412),16);\n assert.deepEqual(candidate(19, 28),72);\n assert.deepEqual(candidate(2020, 1851),0);\n assert.deepEqual(candidate(14, -15),20);\n assert.deepEqual(candidate(76, 67),42);\n assert.deepEqual(candidate(17, 27),49);\n assert.deepEqual(candidate(0, 1),0);\n assert.deepEqual(candidate(0, 0),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "ts", - "prompt": "//Given list of numbers (of at least two elements), apply a linear transform to that list,\n// such that the smallest number will become 0 and the largest will become 1\nfunction rescale_to_unit(numbers: number[]): number[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = rescale_to_unit;\n assert.deepEqual(candidate([2.0, 49.9]),[0.0, 1.0]);\n assert.deepEqual(candidate([100.0, 49.9]),[1.0, 0.0]);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0]),[0.0, 0.25, 0.5, 0.75, 1.0]);\n assert.deepEqual(candidate([2.0, 1.0, 5.0, 3.0, 4.0]),[0.25, 0.0, 1.0, 0.5, 0.75]);\n assert.deepEqual(candidate([12.0, 11.0, 15.0, 13.0, 14.0]),[0.25, 0.0, 1.0, 0.5, 0.75]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "ts", - "prompt": "//Given a positive integer n, return the product of the odd digits.\n// Return 0 if all digits are even.\n// For example:\nfunction digits(n: number): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = digits;\n assert.deepEqual(candidate(5),5);\n assert.deepEqual(candidate(54),5);\n assert.deepEqual(candidate(120),1);\n assert.deepEqual(candidate(5014),5);\n assert.deepEqual(candidate(98765),315);\n assert.deepEqual(candidate(5576543),2625);\n assert.deepEqual(candidate(2468),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "ts", - "prompt": "//You will be given the name of a class (a string) and a list of extensions.\n// The extensions are to be used to load additional classes to the class. The\n// strength of the extension is as follows: Let CAP be the number of the uppercase\n// letters in the extension's name, and let SM be the number of lowercase letters \n// in the extension's name, the strength is given by the fraction CAP - SM. \n// You should find the strongest extension and return a string in this \n// format: ClassName.StrongestExtensionName.\n// If there are two or more extensions with the same strength, you should\n// choose the one that comes first in the list.\n// For example, if you are given \"Slices\" as the class and a list of the\n// extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n// return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n// (its strength is -1).\n// Example:\nfunction Strongest_Extension(class_name: string, extensions: string[]): string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = Strongest_Extension;\n assert.deepEqual(candidate(\"Watashi\", [\"tEN\", \"niNE\", \"eIGHt8OKe\"]),\"Watashi.eIGHt8OKe\");\n assert.deepEqual(candidate(\"Boku123\", [\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"]),\"Boku123.YEs.WeCaNe\");\n assert.deepEqual(candidate(\"__YESIMHERE\", [\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"]),\"__YESIMHERE.NuLl__\");\n assert.deepEqual(candidate(\"K\", [\"Ta\", \"TAR\", \"t234An\", \"cosSo\"]),\"K.TAR\");\n assert.deepEqual(candidate(\"__HAHA\", [\"Tab\", \"123\", \"781345\", \"-_-\"]),\"__HAHA.123\");\n assert.deepEqual(candidate(\"YameRore\", [\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"]),\"YameRore.okIWILL123\");\n assert.deepEqual(candidate(\"finNNalLLly\", [\"Die\", \"NowW\", \"Wow\", \"WoW\"]),\"finNNalLLly.WoW\");\n assert.deepEqual(candidate(\"_\", [\"Bb\", \"91245\"]),\"_.Bb\");\n assert.deepEqual(candidate(\"Sp\", [\"671235\", \"Bb\"]),\"Sp.671235\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "ts", - "prompt": "//Given a string representing a space separated lowercase letters, return a dictionary\n// of the letter with the most repetition and containing the corresponding count.\n// If several letters have the same occurrence, return all of them.\n// Example:\nfunction histogram(test: string): {[key: string]: number} {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = histogram;\n assert.deepEqual(candidate(\"a b b a\"),{\"a\": 2, \"b\": 2});\n assert.deepEqual(candidate(\"a b c a b\"),{\"a\": 2, \"b\": 2});\n assert.deepEqual(candidate(\"a b c d g\"),{\"a\": 1, \"b\": 1, \"c\": 1, \"d\": 1, \"g\": 1});\n assert.deepEqual(candidate(\"r t g\"),{\"r\": 1, \"t\": 1, \"g\": 1});\n assert.deepEqual(candidate(\"b b b b a\"),{\"b\": 4});\n assert.deepEqual(candidate(\"r t g\"),{\"r\": 1, \"t\": 1, \"g\": 1});\n assert.deepEqual(candidate(\"\"),{});\n assert.deepEqual(candidate(\"a\"),{\"a\": 1});\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "ts", - "prompt": "//pairs_sum_to_zero takes a list of integers as an input.\n// it returns True if there are two distinct elements in the list that\n// sum to zero, and False otherwise.\nfunction pairs_sum_to_zero(l: number[]): boolean {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = pairs_sum_to_zero;\n assert.deepEqual(candidate([1, 3, 5, 0]),false);\n assert.deepEqual(candidate([1, 3, -2, 1]),false);\n assert.deepEqual(candidate([1, 2, 3, 7]),false);\n assert.deepEqual(candidate([2, 4, -5, 3, 5, 7]),true);\n assert.deepEqual(candidate([1]),false);\n assert.deepEqual(candidate([-3, 9, -1, 3, 2, 30]),true);\n assert.deepEqual(candidate([-3, 9, -1, 3, 2, 31]),true);\n assert.deepEqual(candidate([-3, 9, -1, 4, 2, 30]),false);\n assert.deepEqual(candidate([-3, 9, -1, 4, 2, 31]),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "ts", - "prompt": "//Write a function that accepts two lists of strings and returns the list that has \n// total number of chars in the all strings of the list less than the other list.\n// if the two lists have the same number of chars, return the first list.\n// Examples\nfunction total_match(lst1: string[], lst2: string[]): string[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = total_match;\n assert.deepEqual(candidate([], []),[]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\"]),[\"hi\", \"hi\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"]),[\"hi\", \"admin\"]);\n assert.deepEqual(candidate([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"]),[\"4\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hI\", \"Hi\"]),[\"hI\", \"Hi\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"]),[\"hI\", \"hi\", \"hi\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hii\"]),[\"hi\", \"admin\"]);\n assert.deepEqual(candidate([], [\"this\"]),[]);\n assert.deepEqual(candidate([\"this\"], []),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "ts", - "prompt": "//Circular shift the digits of the integer x, shift the digits right by shift\n// and return the result as a string.\n// If shift > number of digits, return digits reversed.\nfunction circular_shift(x: number, shift: number): string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = circular_shift;\n assert.deepEqual(candidate(100, 2),\"001\");\n assert.deepEqual(candidate(12, 2),\"12\");\n assert.deepEqual(candidate(97, 8),\"79\");\n assert.deepEqual(candidate(12, 1),\"21\");\n assert.deepEqual(candidate(11, 101),\"11\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "ts", - "prompt": "//Return True is list elements are monotonically increasing or decreasing.\nfunction monotonic(l: number[]): boolean {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = monotonic;\n assert.deepEqual(candidate([1, 2, 4, 10]),true);\n assert.deepEqual(candidate([1, 2, 4, 20]),true);\n assert.deepEqual(candidate([1, 20, 4, 10]),false);\n assert.deepEqual(candidate([4, 1, 0, -10]),true);\n assert.deepEqual(candidate([4, 1, 1, 0]),true);\n assert.deepEqual(candidate([1, 2, 3, 2, 5, 60]),false);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 60]),true);\n assert.deepEqual(candidate([9, 9, 9, 9]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "ts", - "prompt": "//Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n// Example\nfunction is_equal_to_sum_even(n: number): boolean {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_equal_to_sum_even;\n assert.deepEqual(candidate(4),false);\n assert.deepEqual(candidate(6),false);\n assert.deepEqual(candidate(8),true);\n assert.deepEqual(candidate(10),true);\n assert.deepEqual(candidate(11),false);\n assert.deepEqual(candidate(12),true);\n assert.deepEqual(candidate(13),false);\n assert.deepEqual(candidate(16),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "ts", - "prompt": "//Input to this function is a string representing musical notes in a special ASCII format.\n// Your task is to parse this string and return list of integers corresponding to how many beats does each\n// not last.\n// Here is a legend:\n// 'o' - whole note, lasts four beats\n// 'o|' - half note, lasts two beats\n// '.|' - quater note, lasts one beat\nfunction parse_music(music_string: string): number[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = parse_music;\n assert.deepEqual(candidate(\"\"),[]);\n assert.deepEqual(candidate(\"o o o o\"),[4, 4, 4, 4]);\n assert.deepEqual(candidate(\".| .| .| .|\"),[1, 1, 1, 1]);\n assert.deepEqual(candidate(\"o| o| .| .| o o o o\"),[2, 2, 1, 1, 4, 4, 4, 4]);\n assert.deepEqual(candidate(\"o| .| o| .| o o| o o|\"),[2, 1, 2, 1, 4, 2, 4, 2]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "ts", - "prompt": "//\"\n// This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n// multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n// change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n// Examples:\nfunction sum_squares(lst: number[]): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_squares;\n assert.deepEqual(candidate([1, 2, 3]),6);\n assert.deepEqual(candidate([1, 4, 9]),14);\n assert.deepEqual(candidate([]),0);\n assert.deepEqual(candidate([1, 1, 1, 1, 1, 1, 1, 1, 1]),9);\n assert.deepEqual(candidate([-1, -1, -1, -1, -1, -1, -1, -1, -1]),-3);\n assert.deepEqual(candidate([0]),0);\n assert.deepEqual(candidate([-1, -5, 2, -1, -5]),-126);\n assert.deepEqual(candidate([-56, -99, 1, 0, -2]),3030);\n assert.deepEqual(candidate([-1, 0, 0, 0, 0, 0, 0, 0, -1]),0);\n assert.deepEqual(candidate([-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37]),-14196);\n assert.deepEqual(candidate([-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10]),-1448);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "ts", - "prompt": "//triples_sum_to_zero takes a list of integers as an input.\n// it returns True if there are three distinct elements in the list that\n// sum to zero, and False otherwise.\nfunction triples_sum_to_zero(l: number[]): boolean {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = triples_sum_to_zero;\n assert.deepEqual(candidate([1, 3, 5, 0]),false);\n assert.deepEqual(candidate([1, 3, 5, -1]),false);\n assert.deepEqual(candidate([1, 3, -2, 1]),true);\n assert.deepEqual(candidate([1, 2, 3, 7]),false);\n assert.deepEqual(candidate([1, 2, 5, 7]),false);\n assert.deepEqual(candidate([2, 4, -5, 3, 9, 7]),true);\n assert.deepEqual(candidate([1]),false);\n assert.deepEqual(candidate([1, 3, 5, -100]),false);\n assert.deepEqual(candidate([100, 3, 5, -100]),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "ts", - "prompt": "//brackets is a string of \"<\" and \">\".\n// return True if every opening bracket has a corresponding closing bracket.\nfunction correct_bracketing(brackets: string): boolean {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = correct_bracketing;\n assert.deepEqual(candidate(\"<>\"),true);\n assert.deepEqual(candidate(\"<<><>>\"),true);\n assert.deepEqual(candidate(\"<><><<><>><>\"),true);\n assert.deepEqual(candidate(\"<><><<<><><>><>><<><><<>>>\"),true);\n assert.deepEqual(candidate(\"<<<><>>>>\"),false);\n assert.deepEqual(candidate(\"><<>\"),false);\n assert.deepEqual(candidate(\"<\"),false);\n assert.deepEqual(candidate(\"<<<<\"),false);\n assert.deepEqual(candidate(\">\"),false);\n assert.deepEqual(candidate(\"<<>\"),false);\n assert.deepEqual(candidate(\"<><><<><>><>><<>\"),false);\n assert.deepEqual(candidate(\"<><><<><>><>>><>\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "ts", - "prompt": "//Write a function that takes an array of numbers as input and returns \n// the number of elements in the array that are greater than 10 and both \n// first and last digits of a number are odd (1, 3, 5, 7, 9).\n// For example:\nfunction specialFilter(nums: number[]): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = specialFilter;\n assert.deepEqual(candidate([5, -2, 1, -5]),0);\n assert.deepEqual(candidate([15, -73, 14, -15]),1);\n assert.deepEqual(candidate([33, -2, -3, 45, 21, 109]),2);\n assert.deepEqual(candidate([43, -12, 93, 125, 121, 109]),4);\n assert.deepEqual(candidate([71, -2, -33, 75, 21, 19]),3);\n assert.deepEqual(candidate([1]),0);\n assert.deepEqual(candidate([]),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "ts", - "prompt": "//Given a dictionary, return True if all keys are strings in lower \n// case or all keys are strings in upper case, else return False.\n// The function should return False is the given dictionary is empty.\n// Examples:\nfunction check_dict_case(dict: {[key: string]: string}): boolean {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = check_dict_case;\n assert.deepEqual(candidate({\"p\": \"pineapple\", \"b\": \"banana\"}),true);\n assert.deepEqual(candidate({\"p\": \"pineapple\", \"A\": \"banana\", \"B\": \"banana\"}),false);\n assert.deepEqual(candidate({\"p\": \"pineapple\", \"5\": \"banana\", \"a\": \"apple\"}),false);\n assert.deepEqual(candidate({\"Name\": \"John\", \"Age\": \"36\", \"City\": \"Houston\"}),false);\n assert.deepEqual(candidate({\"STATE\": \"NC\", \"ZIP\": \"12345\"}),true);\n assert.deepEqual(candidate({\"fruit\": \"Orange\", \"taste\": \"Sweet\"}),true);\n assert.deepEqual(candidate({}),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "ts", - "prompt": "//Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n// should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n// alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n// Examples\nfunction split_words(txt: string): string[]| number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = split_words;\n assert.deepEqual(candidate(\"Hello world!\"),[\"Hello\", \"world!\"]);\n assert.deepEqual(candidate(\"Hello,world!\"),[\"Hello\", \"world!\"]);\n assert.deepEqual(candidate(\"Hello world,!\"),[\"Hello\", \"world,!\"]);\n assert.deepEqual(candidate(\"Hello,Hello,world !\"),[\"Hello,Hello,world\", \"!\"]);\n assert.deepEqual(candidate(\"abcdef\"),3);\n assert.deepEqual(candidate(\"aaabb\"),2);\n assert.deepEqual(candidate(\"aaaBb\"),1);\n assert.deepEqual(candidate(\"\"),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "ts", - "prompt": "//The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fibfib(0) == 0\n// fibfib(1) == 0\n// fibfib(2) == 1\n// fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n// Please write a function to efficiently compute the n-th element of the fibfib number sequence.\nfunction fibfib(n: number): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fibfib;\n assert.deepEqual(candidate(2),1);\n assert.deepEqual(candidate(1),0);\n assert.deepEqual(candidate(5),4);\n assert.deepEqual(candidate(8),24);\n assert.deepEqual(candidate(10),81);\n assert.deepEqual(candidate(12),274);\n assert.deepEqual(candidate(14),927);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "ts", - "prompt": "//You are given a list of numbers.\n// You need to return the sum of squared numbers in the given list,\n// round each element in the list to the upper int(Ceiling) first.\n// Examples:\nfunction sum_squares(lst: number[]): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_squares;\n assert.deepEqual(candidate([1.0, 2.0, 3.0]),14);\n assert.deepEqual(candidate([1.0, 2.0, 3.0]),14);\n assert.deepEqual(candidate([1.0, 3.0, 5.0, 7.0]),84);\n assert.deepEqual(candidate([1.4, 4.2, 0.0]),29);\n assert.deepEqual(candidate([-2.4, 1.0, 1.0]),6);\n assert.deepEqual(candidate([100.0, 1.0, 15.0, 2.0]),10230);\n assert.deepEqual(candidate([10000.0, 10000.0]),200000000);\n assert.deepEqual(candidate([-1.4, 4.6, 6.3]),75);\n assert.deepEqual(candidate([-1.4, 17.9, 18.9, 19.9]),1086);\n assert.deepEqual(candidate([0.0]),0);\n assert.deepEqual(candidate([-1.0]),1);\n assert.deepEqual(candidate([-1.0, 1.0, 0.0]),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_85_add", - "language": "ts", - "prompt": "//Given a non-empty list of integers lst. add the even elements that are at odd indices..\n// Examples:\nfunction add(lst: number[]): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = add;\n assert.deepEqual(candidate([4, 88]),88);\n assert.deepEqual(candidate([4, 5, 6, 7, 2, 122]),122);\n assert.deepEqual(candidate([4, 0, 6, 7]),0);\n assert.deepEqual(candidate([4, 4, 6, 8]),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "ts", - "prompt": "//Return sorted unique elements in a list\nfunction unique(l: number[]): number[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = unique;\n assert.deepEqual(candidate([5, 3, 5, 2, 3, 3, 9, 0, 123]),[0, 2, 3, 5, 9, 123]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "ts", - "prompt": "//Given a string text, replace all spaces in it with underscores, \n// and if a string has more than 2 consecutive spaces, \n// then replace all consecutive spaces with -\nfunction fix_spaces(text: string): string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fix_spaces;\n assert.deepEqual(candidate(\"Example\"),\"Example\");\n assert.deepEqual(candidate(\"Mudasir Hanif \"),\"Mudasir_Hanif_\");\n assert.deepEqual(candidate(\"Yellow Yellow Dirty Fellow\"),\"Yellow_Yellow__Dirty__Fellow\");\n assert.deepEqual(candidate(\"Exa mple\"),\"Exa-mple\");\n assert.deepEqual(candidate(\" Exa 1 2 2 mple\"),\"-Exa_1_2_2_mple\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "ts", - "prompt": "//Return 2^n modulo p (be aware of numerics).\nfunction modp(n: number, p: number): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = modp;\n assert.deepEqual(candidate(3, 5),3);\n assert.deepEqual(candidate(1101, 101),2);\n assert.deepEqual(candidate(0, 101),1);\n assert.deepEqual(candidate(3, 11),8);\n assert.deepEqual(candidate(100, 101),1);\n assert.deepEqual(candidate(30, 5),4);\n assert.deepEqual(candidate(31, 5),3);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "ts", - "prompt": "//You have to write a function which validates a given date string and\n// returns True if the date is valid otherwise False.\n// The date is valid if all of the following rules are satisfied:\n// 1. The date string is not empty.\n// 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n// 3. The months should not be less than 1 or higher than 12.\n// 4. The date should be in the format: mm-dd-yyyy\nfunction valid_date(date: string): boolean {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = valid_date;\n assert.deepEqual(candidate(\"03-11-2000\"),true);\n assert.deepEqual(candidate(\"15-01-2012\"),false);\n assert.deepEqual(candidate(\"04-0-2040\"),false);\n assert.deepEqual(candidate(\"06-04-2020\"),true);\n assert.deepEqual(candidate(\"01-01-2007\"),true);\n assert.deepEqual(candidate(\"03-32-2011\"),false);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"04-31-3000\"),false);\n assert.deepEqual(candidate(\"06-06-2005\"),true);\n assert.deepEqual(candidate(\"21-31-2000\"),false);\n assert.deepEqual(candidate(\"04-12-2003\"),true);\n assert.deepEqual(candidate(\"04122003\"),false);\n assert.deepEqual(candidate(\"20030412\"),false);\n assert.deepEqual(candidate(\"2003-04\"),false);\n assert.deepEqual(candidate(\"2003-04-12\"),false);\n assert.deepEqual(candidate(\"04-2003\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "ts", - "prompt": "//Write a function that takes a string and returns an ordered version of it.\n// Ordered version of string, is a string where all words (separated by space)\n// are replaced by a new word where all the characters arranged in\n// ascending order based on ascii value.\n// Note: You should keep the order of words and blank spaces in the sentence.\n// For example:\nfunction anti_shuffle(s: string): string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = anti_shuffle;\n assert.deepEqual(candidate(\"Hi\"),\"Hi\");\n assert.deepEqual(candidate(\"hello\"),\"ehllo\");\n assert.deepEqual(candidate(\"number\"),\"bemnru\");\n assert.deepEqual(candidate(\"abcd\"),\"abcd\");\n assert.deepEqual(candidate(\"Hello World!!!\"),\"Hello !!!Wdlor\");\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"Hi. My name is Mister Robot. How are you?\"),\".Hi My aemn is Meirst .Rboot How aer ?ouy\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "ts", - "prompt": "//Given a list of numbers, return whether or not they are sorted\n// in ascending order. If list has more than 1 duplicate of the same\n// number, return False. Assume no negative numbers and only integers.\n// Examples\nfunction is_sorted(lst: number[]): boolean {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_sorted;\n assert.deepEqual(candidate([5]),true);\n assert.deepEqual(candidate([1, 2, 3, 4, 5]),true);\n assert.deepEqual(candidate([1, 3, 2, 4, 5]),false);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6]),true);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6, 7]),true);\n assert.deepEqual(candidate([1, 3, 2, 4, 5, 6, 7]),false);\n assert.deepEqual(candidate([]),true);\n assert.deepEqual(candidate([1]),true);\n assert.deepEqual(candidate([3, 2, 1]),false);\n assert.deepEqual(candidate([1, 2, 2, 2, 3, 4]),false);\n assert.deepEqual(candidate([1, 2, 3, 3, 3, 4]),false);\n assert.deepEqual(candidate([1, 2, 2, 3, 3, 4]),true);\n assert.deepEqual(candidate([1, 2, 3, 4]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "ts", - "prompt": "//You are given a string s.\n// Your task is to check if the string is happy or not.\n// A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n// For example:\nfunction is_happy(s: string): boolean {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_happy;\n assert.deepEqual(candidate(\"a\"),false);\n assert.deepEqual(candidate(\"aa\"),false);\n assert.deepEqual(candidate(\"abcd\"),true);\n assert.deepEqual(candidate(\"aabb\"),false);\n assert.deepEqual(candidate(\"adb\"),true);\n assert.deepEqual(candidate(\"xyy\"),false);\n assert.deepEqual(candidate(\"iopaxpoi\"),true);\n assert.deepEqual(candidate(\"iopaxioi\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "ts", - "prompt": "//Write a function that returns True if the object q will fly, and False otherwise.\n// The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n// Example:\n// # 1+2 is less than the maximum possible weight, but it's unbalanced.\n// # it's balanced, but 3+2+3 is more than the maximum possible weight.\n// # 3+2+3 is less than the maximum possible weight, and it's balanced.\n// # 3 is less than the maximum possible weight, and it's balanced.\nfunction will_it_fly(q: number[], w: number): boolean {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = will_it_fly;\n assert.deepEqual(candidate([3, 2, 3], 9),true);\n assert.deepEqual(candidate([1, 2], 5),false);\n assert.deepEqual(candidate([3], 5),true);\n assert.deepEqual(candidate([3, 2, 3], 1),false);\n assert.deepEqual(candidate([1, 2, 3], 6),false);\n assert.deepEqual(candidate([5], 5),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "ts", - "prompt": "//Given an array of non-negative integers, return a copy of the given array after sorting,\n// you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n// or sort it in descending order if the sum( first index value, last index value) is even.\n// Note:\n// * don't change the given array.\n// Examples:\nfunction sort_array(array: number[]): number[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_array;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([5]),[5]);\n assert.deepEqual(candidate([2, 4, 3, 0, 1, 5]),[0, 1, 2, 3, 4, 5]);\n assert.deepEqual(candidate([2, 4, 3, 0, 1, 5, 6]),[6, 5, 4, 3, 2, 1, 0]);\n assert.deepEqual(candidate([2, 1]),[1, 2]);\n assert.deepEqual(candidate([15, 42, 87, 32, 11, 0]),[0, 11, 15, 32, 42, 87]);\n assert.deepEqual(candidate([21, 14, 23, 11]),[23, 21, 14, 11]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "ts", - "prompt": "//Implement a function that takes an non-negative integer and returns an array of the first n\n// integers that are prime numbers and less than n.\n// for example:\nfunction count_up_to(n: number): number[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_up_to;\n assert.deepEqual(candidate(5),[2, 3]);\n assert.deepEqual(candidate(6),[2, 3, 5]);\n assert.deepEqual(candidate(7),[2, 3, 5]);\n assert.deepEqual(candidate(10),[2, 3, 5, 7]);\n assert.deepEqual(candidate(0),[]);\n assert.deepEqual(candidate(22),[2, 3, 5, 7, 11, 13, 17, 19]);\n assert.deepEqual(candidate(1),[]);\n assert.deepEqual(candidate(18),[2, 3, 5, 7, 11, 13, 17]);\n assert.deepEqual(candidate(47),[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43]);\n assert.deepEqual(candidate(101),[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "ts", - "prompt": "//Out of list of strings, return the longest one. Return the first one in case of multiple\n// strings of the same length. Return None in case the input list is empty.\nfunction longest(strings: string[]): string | undefined {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = longest;\n assert.deepEqual(candidate([]),undefined);\n assert.deepEqual(candidate([\"x\", \"y\", \"z\"]),\"x\");\n assert.deepEqual(candidate([\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"]),\"zzzz\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "ts", - "prompt": "//Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n// reverse the resulting array, and then replace each digit by its corresponding name from\n// \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n// For example:\n// If the array is empty, return an empty array:\n// If the array has any strange number ignore it:\nfunction by_length(arr: number[]): string[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = by_length;\n assert.deepEqual(candidate([2, 1, 1, 4, 5, 8, 2, 3]),[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, -1, 55]),[\"One\"]);\n assert.deepEqual(candidate([1, -1, 3, 2]),[\"Three\", \"Two\", \"One\"]);\n assert.deepEqual(candidate([9, 4, 8]),[\"Nine\", \"Eight\", \"Four\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_106_f", - "language": "ts", - "prompt": "//Implement the function f that takes n as a parameter,\n// 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\n// or the sum of numbers from 1 to i otherwise.\n// i starts from 1.\n// the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n// Example:\nfunction f(n: number): number[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = f;\n assert.deepEqual(candidate(5),[1, 2, 6, 24, 15]);\n assert.deepEqual(candidate(7),[1, 2, 6, 24, 15, 720, 28]);\n assert.deepEqual(candidate(1),[1]);\n assert.deepEqual(candidate(3),[1, 2, 6]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "ts", - "prompt": "//Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\nfunction fizz_buzz(n: number): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fizz_buzz;\n assert.deepEqual(candidate(50),0);\n assert.deepEqual(candidate(78),2);\n assert.deepEqual(candidate(79),3);\n assert.deepEqual(candidate(100),3);\n assert.deepEqual(candidate(200),6);\n assert.deepEqual(candidate(4000),192);\n assert.deepEqual(candidate(10000),639);\n assert.deepEqual(candidate(100000),8026);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "ts", - "prompt": "//Given a positive floating point number, it can be decomposed into\n// and integer part (largest integer smaller than given number) and decimals\n// (leftover part always smaller than 1).\n// Return the decimal part of the number.\nfunction truncate_number(number: number): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = truncate_number;\n assert.deepEqual(candidate(3.5),0.5);\n assert.deepEqual(candidate(1.25),0.25);\n assert.deepEqual(candidate(123.0),0.0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "ts", - "prompt": "//For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n// Empty sum should be equal to 0 and empty product should be equal to 1.\nfunction sum_product(numbers: number[]): [number, number] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_product;\n assert.deepEqual(candidate([]),[0, 1]);\n assert.deepEqual(candidate([1, 1, 1]),[3, 1]);\n assert.deepEqual(candidate([100, 0]),[100, 0]);\n assert.deepEqual(candidate([3, 5, 7]),[15, 105]);\n assert.deepEqual(candidate([10]),[10, 10]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "ts", - "prompt": "//You are given a 2 dimensional data, as a nested lists,\n// which is similar to matrix, however, unlike matrices,\n// each row may contain a different number of columns.\n// Given lst, and integer x, find integers x in the list,\n// and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n// each tuple is a coordinate - (row, columns), starting with 0.\n// Sort coordinates initially by rows in ascending order.\n// Also, sort coordinates of the row by columns in descending order.\n// Examples:\nfunction get_row(lst: number[][], x: number): [number, number][] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_row;\n assert.deepEqual(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1),[[0, 0], [1, 4], [1, 0], [2, 5], [2, 0]]);\n assert.deepEqual(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6]], 2),[[0, 1], [1, 1], [2, 1], [3, 1], [4, 1], [5, 1]]);\n assert.deepEqual(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 1, 3, 4, 5, 6], [1, 2, 1, 4, 5, 6], [1, 2, 3, 1, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1),[[0, 0], [1, 0], [2, 1], [2, 0], [3, 2], [3, 0], [4, 3], [4, 0], [5, 4], [5, 0], [6, 5], [6, 0]]);\n assert.deepEqual(candidate([], 1),[]);\n assert.deepEqual(candidate([[1]], 2),[]);\n assert.deepEqual(candidate([[], [1], [1, 2, 3]], 3),[[2, 2]]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "ts", - "prompt": "//You're a hungry rabbit, and you already have eaten a certain number of carrots,\n// but now you need to eat more carrots to complete the day's meals.\n// you should return an array of [ total number of eaten carrots after your meals,\n// the number of carrots left after your meals ]\n// if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n// Example:\n// Variables:\n// @number : integer\n// the number of carrots that you have eaten.\n// @need : integer\n// the number of carrots that you need to eat.\n// @remaining : integer\n// the number of remaining carrots thet exist in stock\n// Constrain:\n// * 0 <= number <= 1000\n// * 0 <= need <= 1000\n// * 0 <= remaining <= 1000\n// Have fun :)\nfunction eat(number: number, need: number, remaining: number): number[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = eat;\n assert.deepEqual(candidate(5, 6, 10),[11, 4]);\n assert.deepEqual(candidate(4, 8, 9),[12, 1]);\n assert.deepEqual(candidate(1, 10, 10),[11, 0]);\n assert.deepEqual(candidate(2, 11, 5),[7, 0]);\n assert.deepEqual(candidate(4, 5, 7),[9, 2]);\n assert.deepEqual(candidate(4, 5, 1),[5, 0]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "ts", - "prompt": "//Given a positive integer N, return the total sum of its digits in binary.\n// Example\n// Variables:\n// @N integer\n// Constraints: 0 \u2264 N \u2264 10000.\n// Output:\n// a string of binary number\nfunction solve(N: number): string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = solve;\n assert.deepEqual(candidate(1000),\"1\");\n assert.deepEqual(candidate(150),\"110\");\n assert.deepEqual(candidate(147),\"1100\");\n assert.deepEqual(candidate(333),\"1001\");\n assert.deepEqual(candidate(963),\"10010\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "ts", - "prompt": "//You are given a list of integers.\n// You need to find the largest prime value and return the sum of its digits.\n// Examples:\nfunction skjkasdkd(lst: number[]): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = skjkasdkd;\n assert.deepEqual(candidate([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]),10);\n assert.deepEqual(candidate([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]),25);\n assert.deepEqual(candidate([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]),13);\n assert.deepEqual(candidate([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]),11);\n assert.deepEqual(candidate([0, 81, 12, 3, 1, 21]),3);\n assert.deepEqual(candidate([0, 8, 1, 2, 1, 7]),7);\n assert.deepEqual(candidate([8191]),19);\n assert.deepEqual(candidate([8191, 123456, 127, 7]),19);\n assert.deepEqual(candidate([127, 97, 8192]),10);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "ts", - "prompt": "//Given an array arr of integers, find the minimum number of elements that\n// need to be changed to make the array palindromic. A palindromic array is an array that\n// is read the same backwards and forwards. In one change, you can change one element to any other element.\n// For example:\nfunction smallest_change(arr: number[]): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = smallest_change;\n assert.deepEqual(candidate([1, 2, 3, 5, 4, 7, 9, 6]),4);\n assert.deepEqual(candidate([1, 2, 3, 4, 3, 2, 2]),1);\n assert.deepEqual(candidate([1, 4, 2]),1);\n assert.deepEqual(candidate([1, 4, 4, 2]),1);\n assert.deepEqual(candidate([1, 2, 3, 2, 1]),0);\n assert.deepEqual(candidate([3, 1, 1, 3]),0);\n assert.deepEqual(candidate([1]),0);\n assert.deepEqual(candidate([0, 1]),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "ts", - "prompt": "//It is the last week of the semester and the teacher has to give the grades\n// to students. The teacher has been making her own algorithm for grading.\n// The only problem is, she has lost the code she used for grading.\n// She has given you a list of GPAs for some students and you have to write \n// a function that can output a list of letter grades using the following table:\n// GPA | Letter grade\n// 4.0 A+\n// > 3.7 A \n// > 3.3 A- \n// > 3.0 B+\n// > 2.7 B \n// > 2.3 B-\n// > 2.0 C+\n// > 1.7 C\n// > 1.3 C-\n// > 1.0 D+ \n// > 0.7 D \n// > 0.0 D-\n// 0.0 E\n// Example:\nfunction numerical_letter_grade(grades: number[]): string[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = numerical_letter_grade;\n assert.deepEqual(candidate([4.0, 3, 1.7, 2, 3.5]),[\"A+\", \"B\", \"C-\", \"C\", \"A-\"]);\n assert.deepEqual(candidate([1.2]),[\"D+\"]);\n assert.deepEqual(candidate([0.5]),[\"D-\"]);\n assert.deepEqual(candidate([0.0]),[\"E\"]);\n assert.deepEqual(candidate([1.0, 0.3, 1.5, 2.8, 3.3]),[\"D\", \"D-\", \"C-\", \"B\", \"B+\"]);\n assert.deepEqual(candidate([0.0, 0.7]),[\"E\", \"D-\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "ts", - "prompt": "//Given the lengths of the three sides of a triangle. Return the area of\n// the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n// Otherwise return -1\n// Three sides make a valid triangle when the sum of any two sides is greater \n// than the third side.\n// Example:\nfunction triangle_area(a: number, b: number, c: number): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = triangle_area;\n assert.deepEqual(candidate(3, 4, 5),6.0);\n assert.deepEqual(candidate(1, 2, 10),-1);\n assert.deepEqual(candidate(4, 8, 5),8.18);\n assert.deepEqual(candidate(2, 2, 2),1.73);\n assert.deepEqual(candidate(1, 2, 3),-1);\n assert.deepEqual(candidate(10, 5, 7),16.25);\n assert.deepEqual(candidate(2, 6, 3),-1);\n assert.deepEqual(candidate(1, 1, 1),0.43);\n assert.deepEqual(candidate(2, 2, 10),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "ts", - "prompt": "//Check if two words have the same characters.\nfunction same_chars(s0: string, s1: string): boolean {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = same_chars;\n assert.deepEqual(candidate(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\"),true);\n assert.deepEqual(candidate(\"abcd\", \"dddddddabc\"),true);\n assert.deepEqual(candidate(\"dddddddabc\", \"abcd\"),true);\n assert.deepEqual(candidate(\"eabcd\", \"dddddddabc\"),false);\n assert.deepEqual(candidate(\"abcd\", \"dddddddabcf\"),false);\n assert.deepEqual(candidate(\"eabcdzzzz\", \"dddzzzzzzzddddabc\"),false);\n assert.deepEqual(candidate(\"aabb\", \"aaccc\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "ts", - "prompt": "//Given an array of integers nums, find the minimum sum of any non-empty sub-array\n// of nums.\n// Example\nfunction minSubArraySum(nums: number[]): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = minSubArraySum;\n assert.deepEqual(candidate([2, 3, 4, 1, 2, 4]),1);\n assert.deepEqual(candidate([-1, -2, -3]),-6);\n assert.deepEqual(candidate([-1, -2, -3, 2, -10]),-14);\n assert.deepEqual(candidate([-9999999999999999]),-9999999999999999);\n assert.deepEqual(candidate([0, 10, 20, 1000000]),0);\n assert.deepEqual(candidate([-1, -2, -3, 10, -5]),-6);\n assert.deepEqual(candidate([100, -1, -2, -3, 10, -5]),-6);\n assert.deepEqual(candidate([10, 11, 13, 8, 3, 4]),3);\n assert.deepEqual(candidate([100, -33, 32, -1, 0, -2]),-33);\n assert.deepEqual(candidate([-10]),-10);\n assert.deepEqual(candidate([7]),7);\n assert.deepEqual(candidate([1, -1]),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "ts", - "prompt": "//Given a string s and a natural number n, you have been tasked to implement \n// a function that returns a list of all words from string s that contain exactly \n// n consonants, in order these words appear in the string s.\n// If the string s is empty then the function should return an empty list.\n// Note: you may assume the input string contains only letters and spaces.\n// Examples:\nfunction select_words(s: string, n: number): string[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = select_words;\n assert.deepEqual(candidate(\"Mary had a little lamb\", 4),[\"little\"]);\n assert.deepEqual(candidate(\"Mary had a little lamb\", 3),[\"Mary\", \"lamb\"]);\n assert.deepEqual(candidate(\"simple white space\", 2),[]);\n assert.deepEqual(candidate(\"Hello world\", 4),[\"world\"]);\n assert.deepEqual(candidate(\"Uncle sam\", 3),[\"Uncle\"]);\n assert.deepEqual(candidate(\"\", 4),[]);\n assert.deepEqual(candidate(\"a b c d e f\", 1),[\"b\", \"c\", \"d\", \"f\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "ts", - "prompt": "//Return list of all prefixes from shortest to longest of the input string\nfunction all_prefixes(string: string): string[] {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = all_prefixes;\n assert.deepEqual(candidate(\"\"),[]);\n assert.deepEqual(candidate(\"asdfgh\"),[\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"]);\n assert.deepEqual(candidate(\"WWW\"),[\"W\", \"WW\", \"WWW\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "ts", - "prompt": "//Create a function that takes a value (string) representing a number\n// and returns the closest integer to it. If the number is equidistant\n// from two integers, round it away from zero.\n// Examples\n// Note:\n// Rounding away from zero means that if the given number is equidistant\n// from two integers, the one you should return is the one that is the\n// farthest from zero. For example closest_integer(\"14.5\") should\n// return 15 and closest_integer(\"-14.5\") should return -15.\nfunction closest_integer(value: string): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = closest_integer;\n assert.deepEqual(candidate(\"10\"),10);\n assert.deepEqual(candidate(\"14.5\"),15);\n assert.deepEqual(candidate(\"-15.5\"),-16);\n assert.deepEqual(candidate(\"15.3\"),15);\n assert.deepEqual(candidate(\"0\"),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "ts", - "prompt": "//Create a function which takes a string representing a file's name, and returns\n// 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n// A file's name is considered to be valid if and only if all the following conditions \n// are met:\n// - There should not be more than three digits ('0'-'9') in the file's name.\n// - The file's name contains exactly one dot '.'\n// - The substring before the dot should not be empty, and it starts with a letter from \n// the latin alphapet ('a'-'z' and 'A'-'Z').\n// - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n// Examples:\nfunction file_name_check(file_name: string): string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = file_name_check;\n assert.deepEqual(candidate(\"example.txt\"),\"Yes\");\n assert.deepEqual(candidate(\"1example.dll\"),\"No\");\n assert.deepEqual(candidate(\"s1sdf3.asd\"),\"No\");\n assert.deepEqual(candidate(\"K.dll\"),\"Yes\");\n assert.deepEqual(candidate(\"MY16FILE3.exe\"),\"Yes\");\n assert.deepEqual(candidate(\"His12FILE94.exe\"),\"No\");\n assert.deepEqual(candidate(\"_Y.txt\"),\"No\");\n assert.deepEqual(candidate(\"?aREYA.exe\"),\"No\");\n assert.deepEqual(candidate(\"/this_is_valid.dll\"),\"No\");\n assert.deepEqual(candidate(\"this_is_valid.wow\"),\"No\");\n assert.deepEqual(candidate(\"this_is_valid.txt\"),\"Yes\");\n assert.deepEqual(candidate(\"this_is_valid.txtexe\"),\"No\");\n assert.deepEqual(candidate(\"#this2_i4s_5valid.ten\"),\"No\");\n assert.deepEqual(candidate(\"@this1_is6_valid.exe\"),\"No\");\n assert.deepEqual(candidate(\"this_is_12valid.6exe4.txt\"),\"No\");\n assert.deepEqual(candidate(\"all.exe.txt\"),\"No\");\n assert.deepEqual(candidate(\"I563_No.exe\"),\"Yes\");\n assert.deepEqual(candidate(\"Is3youfault.txt\"),\"Yes\");\n assert.deepEqual(candidate(\"no_one#knows.dll\"),\"Yes\");\n assert.deepEqual(candidate(\"1I563_Yes3.exe\"),\"No\");\n assert.deepEqual(candidate(\"I563_Yes3.txtt\"),\"No\");\n assert.deepEqual(candidate(\"final..txt\"),\"No\");\n assert.deepEqual(candidate(\"final132\"),\"No\");\n assert.deepEqual(candidate(\"_f4indsartal132.\"),\"No\");\n assert.deepEqual(candidate(\".txt\"),\"No\");\n assert.deepEqual(candidate(\"s.\"),\"No\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "ts", - "prompt": "//You are given two intervals,\n// where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n// The given intervals are closed which means that the interval (start, end)\n// includes both start and end.\n// For each given interval, it is assumed that its start is less or equal its end.\n// Your task is to determine whether the length of intersection of these two \n// intervals is a prime number.\n// Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n// which its length is 1, which not a prime number.\n// If the length of the intersection is a prime number, return \"YES\",\n// otherwise, return \"NO\".\n// If the two intervals don't intersect, return \"NO\".\n// [input/output] samples:\nfunction intersection(interval1: [number, number], interval2: [number, number]): string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = intersection;\n assert.deepEqual(candidate([1, 2], [2, 3]),\"NO\");\n assert.deepEqual(candidate([-1, 1], [0, 4]),\"NO\");\n assert.deepEqual(candidate([-3, -1], [-5, 5]),\"YES\");\n assert.deepEqual(candidate([-2, 2], [-4, 0]),\"YES\");\n assert.deepEqual(candidate([-11, 2], [-1, -1]),\"NO\");\n assert.deepEqual(candidate([1, 2], [3, 5]),\"NO\");\n assert.deepEqual(candidate([1, 2], [1, 2]),\"NO\");\n assert.deepEqual(candidate([-2, -2], [-3, -2]),\"NO\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "ts", - "prompt": "//Return the largest prime factor of n. Assume n > 1 and is not a prime.\nfunction largest_prime_factor(n: number): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = largest_prime_factor;\n assert.deepEqual(candidate(15),5);\n assert.deepEqual(candidate(27),3);\n assert.deepEqual(candidate(63),7);\n assert.deepEqual(candidate(330),11);\n assert.deepEqual(candidate(13195),29);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "ts", - "prompt": "//Given a string, find out how many distinct characters (regardless of case) does it consist of\nfunction count_distinct_characters(string: string): number {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_distinct_characters;\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"abcde\"),5);\n assert.deepEqual(candidate(\"abcdecadeCADE\"),5);\n assert.deepEqual(candidate(\"aaaaAAAAaaaa\"),1);\n assert.deepEqual(candidate(\"Jerry jERRY JeRRRY\"),5);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "ts", - "prompt": "//You're given a list of deposit and withdrawal operations on a bank account that starts with\n// zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n// at that point function should return True. Otherwise it should return False.\nfunction below_zero(operations: number[]): boolean {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = below_zero;\n assert.deepEqual(candidate([]),false);\n assert.deepEqual(candidate([1, 2, -3, 1, 2, -3]),false);\n assert.deepEqual(candidate([1, 2, -4, 5, 6]),true);\n assert.deepEqual(candidate([1, -1, 2, -2, 5, -5, 4, -4]),false);\n assert.deepEqual(candidate([1, -1, 2, -2, 5, -5, 4, -5]),true);\n assert.deepEqual(candidate([1, -2, 2, -2, 5, -5, 4, -4]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "ts", - "prompt": "//Find the shortest palindrome that begins with a supplied string.\n// Algorithm idea is simple:\n// - Find the longest postfix of supplied string that is a palindrome.\n// - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\nfunction make_palindrome(string: string): string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = make_palindrome;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"x\"),\"x\");\n assert.deepEqual(candidate(\"xyz\"),\"xyzyx\");\n assert.deepEqual(candidate(\"xyx\"),\"xyx\");\n assert.deepEqual(candidate(\"jerry\"),\"jerryrrej\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "ts", - "prompt": "//Given a positive integer, obtain its roman numeral equivalent as a string,\n// and return it in lowercase.\n// Restrictions: 1 <= num <= 1000\n// Examples:\nfunction int_to_mini_roman(number: number): string {\n", - "doctests": "remove", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = int_to_mini_roman;\n assert.deepEqual(candidate(19),\"xix\");\n assert.deepEqual(candidate(152),\"clii\");\n assert.deepEqual(candidate(251),\"ccli\");\n assert.deepEqual(candidate(426),\"cdxxvi\");\n assert.deepEqual(candidate(500),\"d\");\n assert.deepEqual(candidate(1),\"i\");\n assert.deepEqual(candidate(4),\"iv\");\n assert.deepEqual(candidate(43),\"xliii\");\n assert.deepEqual(candidate(90),\"xc\");\n assert.deepEqual(candidate(94),\"xciv\");\n assert.deepEqual(candidate(532),\"dxxxii\");\n assert.deepEqual(candidate(900),\"cm\");\n assert.deepEqual(candidate(994),\"cmxciv\");\n assert.deepEqual(candidate(1000),\"m\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - } -] \ No newline at end of file diff --git a/data/ts-reworded.json b/data/ts-reworded.json deleted file mode 100644 index 467bf8815be7423d348813b85566dc5fc64d6759..0000000000000000000000000000000000000000 --- a/data/ts-reworded.json +++ /dev/null @@ -1,2387 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "ts", - "prompt": "//For a given number n, find the largest number that divides n evenly, smaller than n\n// >>> largest_divisor(15)\n// 5\nfunction largest_divisor(n: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = largest_divisor;\n assert.deepEqual(candidate(3),1);\n assert.deepEqual(candidate(7),1);\n assert.deepEqual(candidate(10),5);\n assert.deepEqual(candidate(100),50);\n assert.deepEqual(candidate(49),7);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_47_median", - "language": "ts", - "prompt": "//Return median of elements in the array l.\n// >>> median([3, 1, 2, 4, 5])\n// 3\n// >>> median([-10, 4, 6, 1000, 10, 20])\n// 15.0\nfunction median(l: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = median;\n assert.deepEqual(candidate([3, 1, 2, 4, 5]),3);\n assert.deepEqual(candidate([-10, 4, 6, 1000, 10, 20]),8.0);\n assert.deepEqual(candidate([5]),5);\n assert.deepEqual(candidate([6, 5]),5.5);\n assert.deepEqual(candidate([8, 1, 3, 9, 9, 2, 7]),7);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "ts", - "prompt": "//Given two arrays operator, and operand. The first array has basic algebra operations, and \n// the second array is an array of integers. Use the two given arrays to build the algebric \n// expression and return the evaluation of this expression.\n// The basic algebra operations:\n// Addition ( + ) \n// Subtraction ( - ) \n// Multiplication ( * ) \n// Floor division ( // ) \n// Exponentiation ( ** ) \n// Example:\n// operator['+', '*', '-']\n// array = [2, 3, 4, 5]\n// result = 2 + 3 * 4 - 5\n// => result = 9\n// Note:\n// The length of operator array is equal to the length of operand array minus one.\n// Operand is an array of of non-negative integers.\n// Operator array has at least one operator, and operand array has at least two operands.\nfunction do_algebra(operator: string[], operand: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = do_algebra;\n assert.deepEqual(candidate([\"**\", \"*\", \"+\"], [2, 3, 4, 5]),37);\n assert.deepEqual(candidate([\"+\", \"*\", \"-\"], [2, 3, 4, 5]),9);\n assert.deepEqual(candidate([\"//\", \"*\"], [7, 3, 4]),8);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "ts", - "prompt": "//Return maximum element in the array.\n// >>> max_element([1, 2, 3])\n// 3\n// >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n// 123\nfunction max_element(l: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = max_element;\n assert.deepEqual(candidate([1, 2, 3]),3);\n assert.deepEqual(candidate([5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]),124);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "ts", - "prompt": "//Create a function which returns the largest index of an element which\n// is not greater than or equal to the element immediately preceding it. If\n// no such element exists then return -1. The given array will not contain\n// duplicate values.\n// Examples:\n// >>> can_arrange([1, 2, 4, 3, 5])\n// 3\n// >>> can_arrange([1, 2, 3])\n// -1\nfunction can_arrange(arr: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = can_arrange;\n assert.deepEqual(candidate([1, 2, 4, 3, 5]),3);\n assert.deepEqual(candidate([1, 2, 4, 5]),-1);\n assert.deepEqual(candidate([1, 4, 2, 5, 6, 7, 8, 9, 10]),2);\n assert.deepEqual(candidate([4, 8, 5, 7, 3]),4);\n assert.deepEqual(candidate([]),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "ts", - "prompt": "//Imagine a road that's a perfectly straight infinitely long line.\n// n cars are driving left to right; simultaneously, a different set of n cars\n// are driving right to left. The two sets of cars start out being very far from\n// each other. All cars move in the same speed. Two cars are said to collide\n// when a car that's moving left to right hits a car that's moving right to left.\n// However, the cars are infinitely sturdy and strong; as a result, they continue moving\n// in their trajectory as if they did not collide.\n// This function outputs the number of such collisions.\nfunction car_race_collision(n: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = car_race_collision;\n assert.deepEqual(candidate(2),4);\n assert.deepEqual(candidate(3),9);\n assert.deepEqual(candidate(4),16);\n assert.deepEqual(candidate(8),64);\n assert.deepEqual(candidate(10),100);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "ts", - "prompt": "//Create a function that returns true if the last character\n// of a given string is an alphabetical character and is not\n// a part of a word, and false otherwise.\n// Note: \"word\" is a group of characters separated by space.\n// Examples:\n// >>> check_if_last_char_is_a_letter(\"apple pie\")\n// false\n// >>> check_if_last_char_is_a_letter(\"apple pi e\")\n// true\n// >>> check_if_last_char_is_a_letter(\"apple pi e \")\n// false\n// >>> check_if_last_char_is_a_letter(\"\")\n// false\nfunction check_if_last_char_is_a_letter(txt: string): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = check_if_last_char_is_a_letter;\n assert.deepEqual(candidate(\"apple\"),false);\n assert.deepEqual(candidate(\"apple pi e\"),true);\n assert.deepEqual(candidate(\"eeeee\"),false);\n assert.deepEqual(candidate(\"A\"),true);\n assert.deepEqual(candidate(\"Pumpkin pie \"),false);\n assert.deepEqual(candidate(\"Pumpkin pie 1\"),false);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"eeeee e \"),false);\n assert.deepEqual(candidate(\"apple pie\"),false);\n assert.deepEqual(candidate(\"apple pi e \"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "ts", - "prompt": "//Return true if a given number is prime, and false otherwise.\n// >>> is_prime(6)\n// false\n// >>> is_prime(101)\n// true\n// >>> is_prime(11)\n// true\n// >>> is_prime(13441)\n// true\n// >>> is_prime(61)\n// true\n// >>> is_prime(4)\n// false\n// >>> is_prime(1)\n// false\nfunction is_prime(n: number): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_prime;\n assert.deepEqual(candidate(6),false);\n assert.deepEqual(candidate(101),true);\n assert.deepEqual(candidate(11),true);\n assert.deepEqual(candidate(13441),true);\n assert.deepEqual(candidate(61),true);\n assert.deepEqual(candidate(4),false);\n assert.deepEqual(candidate(1),false);\n assert.deepEqual(candidate(5),true);\n assert.deepEqual(candidate(11),true);\n assert.deepEqual(candidate(17),true);\n assert.deepEqual(candidate(85),false);\n assert.deepEqual(candidate(77),false);\n assert.deepEqual(candidate(255379),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "ts", - "prompt": "//Given an array of positive integers x. return a sorted array of all \n// elements that hasn't any even digit.\n// Note: Returned array should be sorted in increasing order.\n// For example:\n// >>> unique_digits([15, 33, 1422, 1])\n// [1, 15, 33]\n// >>> unique_digits([152, 323, 1422, 10])\n// []\nfunction unique_digits(x: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = unique_digits;\n assert.deepEqual(candidate([15, 33, 1422, 1]),[1, 15, 33]);\n assert.deepEqual(candidate([152, 323, 1422, 10]),[]);\n assert.deepEqual(candidate([12345, 2033, 111, 151]),[111, 151]);\n assert.deepEqual(candidate([135, 103, 31]),[31, 135]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "ts", - "prompt": "//Input are two strings a and b consisting only of 1s and 0s.\n// Perform binary XOR on these inputs and return result also as a string.\n// >>> string_xor(\"010\", \"110\")\n// \"100\"\nfunction string_xor(a: string, b: string): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = string_xor;\n assert.deepEqual(candidate(\"111000\", \"101010\"),\"010010\");\n assert.deepEqual(candidate(\"1\", \"1\"),\"0\");\n assert.deepEqual(candidate(\"0101\", \"0000\"),\"0101\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "ts", - "prompt": "//sum_to_n is a function that sums numbers from 1 to n.\n// >>> sum_to_n(30)\n// 465\n// >>> sum_to_n(100)\n// 5050\n// >>> sum_to_n(5)\n// 15\n// >>> sum_to_n(10)\n// 55\n// >>> sum_to_n(1)\n// 1\nfunction sum_to_n(n: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_to_n;\n assert.deepEqual(candidate(1),1);\n assert.deepEqual(candidate(6),21);\n assert.deepEqual(candidate(11),66);\n assert.deepEqual(candidate(30),465);\n assert.deepEqual(candidate(100),5050);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "ts", - "prompt": "//Given an array of numbers, return the sum of squares of the numbers\n// in the array that are odd. Ignore numbers that are negative or not integers.\n// >>> double_the_difference([1, 3, 2, 0])\n// 10\n// >>> double_the_difference([-1, -2, 0])\n// 0\n// >>> double_the_difference([9, -2])\n// 81\n// >>> double_the_difference([0])\n// 0\n// If the input array is empty, return 0.\nfunction double_the_difference(lst: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = double_the_difference;\n assert.deepEqual(candidate([]),0);\n assert.deepEqual(candidate([5.0, 4.0]),25);\n assert.deepEqual(candidate([0.1, 0.2, 0.3]),0);\n assert.deepEqual(candidate([-10.0, -20.0, -30.0]),0);\n assert.deepEqual(candidate([-1.0, -2.0, 8.0]),0);\n assert.deepEqual(candidate([0.2, 3.0, 5.0]),34);\n assert.deepEqual(candidate([-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]),165);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "ts", - "prompt": "//Return length of given string\n// >>> strlen(\"\")\n// 0\n// >>> strlen(\"abc\")\n// 3\nfunction strlen(string: string): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = strlen;\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"x\"),1);\n assert.deepEqual(candidate(\"asdasnakj\"),9);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "ts", - "prompt": "//You'll be given a string of words, and your task is to count the number\n// of boredoms. A boredom is a sentence that starts with the word \"I\".\n// Sentences are delimited by '.', '?' or '!'.\n// For example:\n// >>> is_bored(\"Hello world\")\n// 0\n// >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n// 1\nfunction is_bored(S: string): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_bored;\n assert.deepEqual(candidate(\"Hello world\"),0);\n assert.deepEqual(candidate(\"Is the sky blue?\"),0);\n assert.deepEqual(candidate(\"I love It !\"),1);\n assert.deepEqual(candidate(\"bIt\"),0);\n assert.deepEqual(candidate(\"I feel good today. I will be productive. will kill It\"),2);\n assert.deepEqual(candidate(\"You and I are going for a walk\"),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "ts", - "prompt": "//Write a function vowels_count which takes a string representing\n// a word as input and returns the number of vowels in the string.\n// Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n// vowel, but only when it is at the end of the given word.\n// Example:\n// >>> vowels_count(\"abcde\")\n// 2\n// >>> vowels_count(\"ACEDY\")\n// 3\nfunction vowels_count(s: string): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = vowels_count;\n assert.deepEqual(candidate(\"abcde\"),2);\n assert.deepEqual(candidate(\"Alone\"),3);\n assert.deepEqual(candidate(\"key\"),2);\n assert.deepEqual(candidate(\"bye\"),1);\n assert.deepEqual(candidate(\"keY\"),2);\n assert.deepEqual(candidate(\"bYe\"),1);\n assert.deepEqual(candidate(\"ACEDY\"),3);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "ts", - "prompt": "//Return n-th Fibonacci number.\n// >>> fib(10)\n// 55\n// >>> fib(1)\n// 1\n// >>> fib(8)\n// 21\nfunction fib(n: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fib;\n assert.deepEqual(candidate(10),55);\n assert.deepEqual(candidate(1),1);\n assert.deepEqual(candidate(8),21);\n assert.deepEqual(candidate(11),89);\n assert.deepEqual(candidate(12),144);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "ts", - "prompt": "//Your task is to implement a function that will simplify the expression\n// x * n. The function returns true if x * n evaluates to a whole number and false\n// otherwise. Both x and n, are string representation of a fraction, and have the following format,\n// / where both numerator and denominator are positive whole numbers.\n// You can assume that x, and n are valid fractions, and do not have zero as denominator.\n// >>> simplify(\"1/5\", \"5/1\")\n// true\n// >>> simplify(\"1/6\", \"2/1\")\n// false\n// >>> simplify(\"7/10\", \"10/2\")\n// false\nfunction simplify(x: string, n: string): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = simplify;\n assert.deepEqual(candidate(\"1/5\", \"5/1\"),true);\n assert.deepEqual(candidate(\"1/6\", \"2/1\"),false);\n assert.deepEqual(candidate(\"5/1\", \"3/1\"),true);\n assert.deepEqual(candidate(\"7/10\", \"10/2\"),false);\n assert.deepEqual(candidate(\"2/10\", \"50/10\"),true);\n assert.deepEqual(candidate(\"7/2\", \"4/2\"),true);\n assert.deepEqual(candidate(\"11/6\", \"6/1\"),true);\n assert.deepEqual(candidate(\"2/3\", \"5/2\"),false);\n assert.deepEqual(candidate(\"5/2\", \"3/5\"),false);\n assert.deepEqual(candidate(\"2/4\", \"8/4\"),true);\n assert.deepEqual(candidate(\"2/4\", \"4/2\"),true);\n assert.deepEqual(candidate(\"1/5\", \"5/1\"),true);\n assert.deepEqual(candidate(\"1/5\", \"1/5\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "ts", - "prompt": "//Given a string s, count the number of uppercase vowels in even indices.\n// For example:\n// >>> count_upper(\"aBCdEf\")\n// 1\n// >>> count_upper(\"abcdefg\")\n// 0\n// >>> count_upper(\"dBBE\")\n// 0\nfunction count_upper(s: string): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_upper;\n assert.deepEqual(candidate(\"aBCdEf\"),1);\n assert.deepEqual(candidate(\"abcdefg\"),0);\n assert.deepEqual(candidate(\"dBBE\"),0);\n assert.deepEqual(candidate(\"B\"),0);\n assert.deepEqual(candidate(\"U\"),1);\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"EEEE\"),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "ts", - "prompt": "//You are given a rectangular grid of wells. Each row represents a single well,\n// and each 1 in a row represents a single unit of water.\n// Each well has a corresponding bucket that can be used to extract water from it, \n// and all buckets have the same capacity.\n// Your task is to use the buckets to empty the wells.\n// Output the number of times you need to lower the buckets.\n// Example 1:\n// >>> max_fill([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1)\n// 6\n// Example 2:\n// >>> max_fill([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2)\n// 5\n// Example 3:\n// >>> max_fill([[0, 0, 0], [0, 0, 0]], 5)\n// 0\n// Constraints:\n// * all wells have the same length\n// * 1 <= grid.length <= 10^2\n// * 1 <= grid[:,1].length <= 10^2\n// * grid[i][j] -> 0 | 1\n// * 1 <= capacity <= 10\nfunction max_fill(grid: number[][], capacity: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = max_fill;\n assert.deepEqual(candidate([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1),6);\n assert.deepEqual(candidate([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2),5);\n assert.deepEqual(candidate([[0, 0, 0], [0, 0, 0]], 5),0);\n assert.deepEqual(candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 2),4);\n assert.deepEqual(candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 9),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "ts", - "prompt": "//Given an array arr of integers and a positive integer k, return a sorted array \n// of length k with the maximum k numbers in arr.\n// Example 1:\n// >>> maximum([-3, -4, 5], 3)\n// [-4, -3, 5]\n// Example 2:\n// >>> maximum([4, -4, 4], 2)\n// [4, 4]\n// Example 3:\n// >>> maximum([-3, 2, 1, 2, -1, -2, 1], 1)\n// [2]\n// Note:\n// 1. The length of the array will be in the range of [1, 1000].\n// 2. The elements in the array will be in the range of [-1000, 1000].\n// 3. 0 <= k <= len(arr)\nfunction maximum(arr: number[], k: number): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = maximum;\n assert.deepEqual(candidate([-3, -4, 5], 3),[-4, -3, 5]);\n assert.deepEqual(candidate([4, -4, 4], 2),[4, 4]);\n assert.deepEqual(candidate([-3, 2, 1, 2, -1, -2, 1], 1),[2]);\n assert.deepEqual(candidate([123, -123, 20, 0, 1, 2, -3], 3),[2, 20, 123]);\n assert.deepEqual(candidate([-123, 20, 0, 1, 2, -3], 4),[0, 1, 2, 20]);\n assert.deepEqual(candidate([5, 15, 0, 3, -13, -8, 0], 7),[-13, -8, 0, 0, 3, 5, 15]);\n assert.deepEqual(candidate([-1, 0, 2, 5, 3, -10], 2),[3, 5]);\n assert.deepEqual(candidate([1, 0, 5, -7], 1),[5]);\n assert.deepEqual(candidate([4, -4], 2),[-4, 4]);\n assert.deepEqual(candidate([-10, 10], 2),[-10, 10]);\n assert.deepEqual(candidate([1, 2, 3, -23, 243, -400, 0], 0),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "ts", - "prompt": "//Write a function that takes a message, and encodes in such a \n// way that it swaps case of all letters, replaces all vowels in \n// the message with the letter that appears 2 places ahead of that \n// vowel in the english alphabet. \n// Assume only letters. \n// Examples:\n// >>> encode(\"test\")\n// \"TGST\"\n// >>> encode(\"This is a message\")\n// \"tHKS KS C MGSSCGG\"\nfunction encode(message: string): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = encode;\n assert.deepEqual(candidate(\"TEST\"),\"tgst\");\n assert.deepEqual(candidate(\"Mudasir\"),\"mWDCSKR\");\n assert.deepEqual(candidate(\"YES\"),\"ygs\");\n assert.deepEqual(candidate(\"This is a message\"),\"tHKS KS C MGSSCGG\");\n assert.deepEqual(candidate(\"I DoNt KnOw WhAt tO WrItE\"),\"k dQnT kNqW wHcT Tq wRkTg\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "ts", - "prompt": "//remove_vowels is a function that takes string and returns string without vowels.\n// >>> remove_vowels(\"\")\n// \"\"\n// >>> remove_vowels(\"abcdef\")\n// \"bcdf\"\n// >>> remove_vowels(\"aaaaa\")\n// \"\"\n// >>> remove_vowels(\"aaBAA\")\n// \"B\"\n// >>> remove_vowels(\"zbcd\")\n// \"zbcd\"\nfunction remove_vowels(text: string): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = remove_vowels;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"abcdef\\nghijklm\"),\"bcdf\\nghjklm\");\n assert.deepEqual(candidate(\"fedcba\"),\"fdcb\");\n assert.deepEqual(candidate(\"eeeee\"),\"\");\n assert.deepEqual(candidate(\"acBAA\"),\"cB\");\n assert.deepEqual(candidate(\"EcBOO\"),\"cB\");\n assert.deepEqual(candidate(\"ybcd\"),\"ybcd\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "ts", - "prompt": "//Return only positive numbers in the array.\n// >>> get_positive([-1, 2, -4, 5, 6])\n// [2, 5, 6]\n// >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n// [5, 3, 2, 3, 9, 123, 1]\nfunction get_positive(l: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_positive;\n assert.deepEqual(candidate([-1, -2, 4, 5, 6]),[4, 5, 6]);\n assert.deepEqual(candidate([5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]),[5, 3, 2, 3, 3, 9, 123, 1]);\n assert.deepEqual(candidate([-1, -2]),[]);\n assert.deepEqual(candidate([]),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "ts", - "prompt": "//Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n// >>> string_sequence(0)\n// \"0\"\n// >>> string_sequence(5)\n// \"0 1 2 3 4 5\"\nfunction string_sequence(n: number): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = string_sequence;\n assert.deepEqual(candidate(0),\"0\");\n assert.deepEqual(candidate(3),\"0 1 2 3\");\n assert.deepEqual(candidate(10),\"0 1 2 3 4 5 6 7 8 9 10\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "ts", - "prompt": "//Given a positive integer n, you have to make a pile of n levels of stones.\n// The first level has n stones.\n// The number of stones in the next level is:\n// - the next odd number if n is odd.\n// - the next even number if n is even.\n// Return the number of stones in each level in an array, where element at index\n// i represents the number of stones in the level (i+1).\n// Examples:\n// >>> make_a_pile(3)\n// [3, 5, 7]\nfunction make_a_pile(n: number): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = make_a_pile;\n assert.deepEqual(candidate(3),[3, 5, 7]);\n assert.deepEqual(candidate(4),[4, 6, 8, 10]);\n assert.deepEqual(candidate(5),[5, 7, 9, 11, 13]);\n assert.deepEqual(candidate(6),[6, 8, 10, 12, 14, 16]);\n assert.deepEqual(candidate(8),[8, 10, 12, 14, 16, 18, 20, 22]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "ts", - "prompt": "//Task\n// 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\n// then check if the result string is palindrome.\n// A string is called palindrome if it reads the same backward as forward.\n// You should return an array containing the result string and true/false for the check.\n// Example\n// >>> reverse_delete(\"abcde\", \"ae\")\n// [\"bcd\", false]\n// >>> reverse_delete(\"abcdef\", \"b\")\n// [\"acdef\", false]\n// >>> reverse_delete(\"abcdedcba\", \"ab\")\n// [\"cdedc\", true]\nfunction reverse_delete(s: string, c: string): [string, boolean] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = reverse_delete;\n assert.deepEqual(candidate(\"abcde\", \"ae\"),[\"bcd\", false]);\n assert.deepEqual(candidate(\"abcdef\", \"b\"),[\"acdef\", false]);\n assert.deepEqual(candidate(\"abcdedcba\", \"ab\"),[\"cdedc\", true]);\n assert.deepEqual(candidate(\"dwik\", \"w\"),[\"dik\", false]);\n assert.deepEqual(candidate(\"a\", \"a\"),[\"\", true]);\n assert.deepEqual(candidate(\"abcdedcba\", \"\"),[\"abcdedcba\", true]);\n assert.deepEqual(candidate(\"abcdedcba\", \"v\"),[\"abcdedcba\", true]);\n assert.deepEqual(candidate(\"vabba\", \"v\"),[\"abba\", true]);\n assert.deepEqual(candidate(\"mamma\", \"mia\"),[\"\", true]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "ts", - "prompt": "//For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n// >>> flip_case(\"Hello\")\n// \"hELLO\"\nfunction flip_case(string: string): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = flip_case;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"Hello!\"),\"hELLO!\");\n assert.deepEqual(candidate(\"These violent delights have violent ends\"),\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "ts", - "prompt": "//You are given a string s.\n// if s[i] is a letter, reverse its case from lower to upper or vise versa, \n// otherwise keep it as it is.\n// If the string contains no letters, reverse the string.\n// The function should return the resulted string.\n// Examples\n// >>> solve(\"1234\")\n// \"4321\"\n// >>> solve(\"ab\")\n// \"AB\"\n// >>> solve(\"#a@C\")\n// \"#A@c\"\nfunction solve(s: string): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = solve;\n assert.deepEqual(candidate(\"AsDf\"),\"aSdF\");\n assert.deepEqual(candidate(\"1234\"),\"4321\");\n assert.deepEqual(candidate(\"ab\"),\"AB\");\n assert.deepEqual(candidate(\"#a@C\"),\"#A@c\");\n assert.deepEqual(candidate(\"#AsdfW^45\"),\"#aSDFw^45\");\n assert.deepEqual(candidate(\"#6@2\"),\"2@6#\");\n assert.deepEqual(candidate(\"#$a^D\"),\"#$A^d\");\n assert.deepEqual(candidate(\"#ccc\"),\"#CCC\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "ts", - "prompt": "//Filter an input array of strings only for ones that start with a given prefix.\n// >>> filter_by_prefix([], \"a\")\n// []\n// >>> filter_by_prefix([\"abc\", \"bcd\", \"cde\", \"array\"], \"a\")\n// [\"abc\", \"array\"]\nfunction filter_by_prefix(strings: string[], prefix: string): string[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = filter_by_prefix;\n assert.deepEqual(candidate([], \"john\"),[]);\n assert.deepEqual(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"),[\"xxx\", \"xxxAAA\", \"xxx\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "ts", - "prompt": "//This function takes two positive numbers x and y and returns the\n// biggest even integer number that is in the range [x, y] inclusive. If \n// there's no such number, then the function should return -1.\n// For example:\n// >>> choose_num(12, 15)\n// 14\n// >>> choose_num(13, 12)\n// -1\nfunction choose_num(x: number, y: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = choose_num;\n assert.deepEqual(candidate(12, 15),14);\n assert.deepEqual(candidate(13, 12),-1);\n assert.deepEqual(candidate(33, 12354),12354);\n assert.deepEqual(candidate(5234, 5233),-1);\n assert.deepEqual(candidate(6, 29),28);\n assert.deepEqual(candidate(27, 10),-1);\n assert.deepEqual(candidate(7, 7),-1);\n assert.deepEqual(candidate(546, 546),546);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "ts", - "prompt": "//You are given a string representing a sentence,\n// the sentence contains some words separated by a space,\n// and you have to return a string that contains the words from the original sentence,\n// whose lengths are prime numbers,\n// the order of the words in the new string should be the same as the original one.\n// Example 1:\n// >>> words_in_sentence(\"This is a test\")\n// \"is\"\n// Example 2:\n// >>> words_in_sentence(\"lets go for swimming\")\n// \"go for\"\n// Constraints:\n// * 1 <= len(sentence) <= 100\n// * sentence contains only letters\nfunction words_in_sentence(sentence: string): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = words_in_sentence;\n assert.deepEqual(candidate(\"This is a test\"),\"is\");\n assert.deepEqual(candidate(\"lets go for swimming\"),\"go for\");\n assert.deepEqual(candidate(\"there is no place available here\"),\"there is no place\");\n assert.deepEqual(candidate(\"Hi I am Hussein\"),\"Hi am Hussein\");\n assert.deepEqual(candidate(\"go for it\"),\"go for it\");\n assert.deepEqual(candidate(\"here\"),\"\");\n assert.deepEqual(candidate(\"here is\"),\"is\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "ts", - "prompt": "//Insert a number 'delimeter' between every two consecutive elements of input array `numbers'\n// >>> intersperse([], 4)\n// []\n// >>> intersperse([1, 2, 3], 4)\n// [1, 4, 2, 4, 3]\nfunction intersperse(numbers: number[], delimeter: number): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = intersperse;\n assert.deepEqual(candidate([], 7),[]);\n assert.deepEqual(candidate([5, 6, 3, 2], 8),[5, 8, 6, 8, 3, 8, 2]);\n assert.deepEqual(candidate([2, 2, 2], 2),[2, 2, 2, 2, 2]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "ts", - "prompt": "//Your task is to write a function that returns true if a number x is a simple\n// power of n and false in other cases.\n// x is a simple power of n if n**int=x\n// For example:\n// >>> is_simple_power(1, 4)\n// true\n// >>> is_simple_power(2, 2)\n// true\n// >>> is_simple_power(8, 2)\n// true\n// >>> is_simple_power(3, 2)\n// false\n// >>> is_simple_power(3, 1)\n// false\n// >>> is_simple_power(5, 3)\n// false\nfunction is_simple_power(x: number, n: number): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_simple_power;\n assert.deepEqual(candidate(16, 2),true);\n assert.deepEqual(candidate(143214, 16),false);\n assert.deepEqual(candidate(4, 2),true);\n assert.deepEqual(candidate(9, 3),true);\n assert.deepEqual(candidate(16, 4),true);\n assert.deepEqual(candidate(24, 2),false);\n assert.deepEqual(candidate(128, 4),false);\n assert.deepEqual(candidate(12, 6),false);\n assert.deepEqual(candidate(1, 1),true);\n assert.deepEqual(candidate(1, 12),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "ts", - "prompt": "//Write a function that returns true if the given number is the multiplication of 3 prime numbers\n// and false otherwise.\n// Knowing that (a) is less then 100. \n// Example:\n// >>> is_multiply_prime(30)\n// true\n// 30 = 2 * 3 * 5\nfunction is_multiply_prime(a: number): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_multiply_prime;\n assert.deepEqual(candidate(5),false);\n assert.deepEqual(candidate(30),true);\n assert.deepEqual(candidate(8),true);\n assert.deepEqual(candidate(10),false);\n assert.deepEqual(candidate(125),true);\n assert.deepEqual(candidate(105),true);\n assert.deepEqual(candidate(126),false);\n assert.deepEqual(candidate(729),false);\n assert.deepEqual(candidate(891),false);\n assert.deepEqual(candidate(1001),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "ts", - "prompt": "//Given the lengths of the three sides of a triangle. Return true if the three\n// sides form a right-angled triangle, false otherwise.\n// A right-angled triangle is a triangle in which one angle is right angle or \n// 90 degree.\n// Example:\n// >>> right_angle_triangle(3, 4, 5)\n// true\n// >>> right_angle_triangle(1, 2, 3)\n// false\nfunction right_angle_triangle(a: number, b: number, c: number): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = right_angle_triangle;\n assert.deepEqual(candidate(3, 4, 5),true);\n assert.deepEqual(candidate(1, 2, 3),false);\n assert.deepEqual(candidate(10, 6, 8),true);\n assert.deepEqual(candidate(2, 2, 2),false);\n assert.deepEqual(candidate(7, 24, 25),true);\n assert.deepEqual(candidate(10, 5, 7),false);\n assert.deepEqual(candidate(5, 12, 13),true);\n assert.deepEqual(candidate(15, 8, 17),true);\n assert.deepEqual(candidate(48, 55, 73),true);\n assert.deepEqual(candidate(1, 1, 1),false);\n assert.deepEqual(candidate(2, 2, 10),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "ts", - "prompt": "//Create a function that takes 3 numbers.\n// Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n// Returns false in any other cases.\n// Examples\n// >>> any_int(5, 2, 7)\n// true\n// >>> any_int(3, 2, 2)\n// false\n// >>> any_int(3, -2, 1)\n// true\n// >>> any_int(3.6, -2.2, 2)\n// false\nfunction any_int(x: number, y: number, z: number): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = any_int;\n assert.deepEqual(candidate(2, 3, 1),true);\n assert.deepEqual(candidate(2.5, 2, 3),false);\n assert.deepEqual(candidate(1.5, 5, 3.5),false);\n assert.deepEqual(candidate(2, 6, 2),false);\n assert.deepEqual(candidate(4, 2, 2),true);\n assert.deepEqual(candidate(2.2, 2.2, 2.2),false);\n assert.deepEqual(candidate(-4, 6, 2),true);\n assert.deepEqual(candidate(2, 1, 1),true);\n assert.deepEqual(candidate(3, 4, 7),true);\n assert.deepEqual(candidate(3.0, 4, 7),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "ts", - "prompt": "//This function takes an array l and returns an array l' such that\n// l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n// to the values of the corresponding indicies of l, but sorted.\n// >>> sort_third([1, 2, 3])\n// [1, 2, 3]\n// >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n// [2, 6, 3, 4, 8, 9, 5]\nfunction sort_third(l: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_third;\n assert.deepEqual(candidate([5, 6, 3, 4, 8, 9, 2]),[2, 6, 3, 4, 8, 9, 5]);\n assert.deepEqual(candidate([5, 8, 3, 4, 6, 9, 2]),[2, 8, 3, 4, 6, 9, 5]);\n assert.deepEqual(candidate([5, 6, 9, 4, 8, 3, 2]),[2, 6, 9, 4, 8, 3, 5]);\n assert.deepEqual(candidate([5, 6, 3, 4, 8, 9, 2, 1]),[2, 6, 3, 4, 8, 9, 5, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_53_add", - "language": "ts", - "prompt": "//Add two numbers x and y\n// >>> add(2, 3)\n// 5\n// >>> add(5, 7)\n// 12\nfunction add(x: number, y: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = add;\n assert.deepEqual(candidate(0, 1),1);\n assert.deepEqual(candidate(1, 0),1);\n assert.deepEqual(candidate(2, 3),5);\n assert.deepEqual(candidate(5, 7),12);\n assert.deepEqual(candidate(7, 5),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_69_search", - "language": "ts", - "prompt": "//You are given a non-empty array of positive integers. Return the greatest integer that is greater than \n// zero, and has a frequency greater than or equal to the value of the integer itself. \n// The frequency of an integer is the number of times it appears in the array.\n// If no such a value exist, return -1.\n// Examples:\n// >>> search([4, 1, 2, 2, 3, 1])\n// 2\n// >>> search([1, 2, 2, 3, 3, 3, 4, 4, 4])\n// 3\n// >>> search([5, 5, 4, 4, 4])\n// -1\nfunction search(lst: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = search;\n assert.deepEqual(candidate([5, 5, 5, 5, 1]),1);\n assert.deepEqual(candidate([4, 1, 4, 1, 4, 4]),4);\n assert.deepEqual(candidate([3, 3]),-1);\n assert.deepEqual(candidate([8, 8, 8, 8, 8, 8, 8, 8]),8);\n assert.deepEqual(candidate([2, 3, 3, 2, 2]),2);\n assert.deepEqual(candidate([2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]),1);\n assert.deepEqual(candidate([3, 2, 8, 2]),2);\n assert.deepEqual(candidate([6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]),1);\n assert.deepEqual(candidate([8, 8, 3, 6, 5, 6, 4]),-1);\n assert.deepEqual(candidate([6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]),1);\n assert.deepEqual(candidate([1, 9, 10, 1, 3]),1);\n assert.deepEqual(candidate([6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]),5);\n assert.deepEqual(candidate([1]),1);\n assert.deepEqual(candidate([8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]),4);\n assert.deepEqual(candidate([2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]),2);\n assert.deepEqual(candidate([1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]),1);\n assert.deepEqual(candidate([9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]),4);\n assert.deepEqual(candidate([2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]),4);\n assert.deepEqual(candidate([9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]),2);\n assert.deepEqual(candidate([5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]),-1);\n assert.deepEqual(candidate([10]),-1);\n assert.deepEqual(candidate([9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]),2);\n assert.deepEqual(candidate([5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]),1);\n assert.deepEqual(candidate([7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]),1);\n assert.deepEqual(candidate([3, 10, 10, 9, 2]),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "ts", - "prompt": "//Write a function that takes a string and returns true if the string\n// length is a prime number or false otherwise\n// Examples\n// >>> prime_length(\"Hello\")\n// true\n// >>> prime_length(\"abcdcba\")\n// true\n// >>> prime_length(\"kittens\")\n// true\n// >>> prime_length(\"orange\")\n// false\nfunction prime_length(string: string): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = prime_length;\n assert.deepEqual(candidate(\"Hello\"),true);\n assert.deepEqual(candidate(\"abcdcba\"),true);\n assert.deepEqual(candidate(\"kittens\"),true);\n assert.deepEqual(candidate(\"orange\"),false);\n assert.deepEqual(candidate(\"wow\"),true);\n assert.deepEqual(candidate(\"world\"),true);\n assert.deepEqual(candidate(\"MadaM\"),true);\n assert.deepEqual(candidate(\"Wow\"),true);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"HI\"),true);\n assert.deepEqual(candidate(\"go\"),true);\n assert.deepEqual(candidate(\"gogo\"),false);\n assert.deepEqual(candidate(\"aaaaaaaaaaaaaaa\"),false);\n assert.deepEqual(candidate(\"Madam\"),true);\n assert.deepEqual(candidate(\"M\"),false);\n assert.deepEqual(candidate(\"0\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_58_common", - "language": "ts", - "prompt": "//Return sorted unique common elements for two arrays.\n// >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n// [1, 5, 653]\n// >>> common([5, 3, 2, 8], [3, 2])\n// [2, 3]\nfunction common(l1: number[], l2: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = common;\n assert.deepEqual(candidate([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]),[1, 5, 653]);\n assert.deepEqual(candidate([5, 3, 2, 8], [3, 2]),[2, 3]);\n assert.deepEqual(candidate([4, 3, 2, 8], [3, 2, 4]),[2, 3, 4]);\n assert.deepEqual(candidate([4, 3, 2, 8], []),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "ts", - "prompt": "//The Brazilian factorial is defined as:\n// brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n// where n > 0\n// For example:\n// >>> special_factorial(4)\n// 288\n// The function will receive an integer as input and should return the special\n// factorial of this integer.\nfunction special_factorial(n: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = special_factorial;\n assert.deepEqual(candidate(4),288);\n assert.deepEqual(candidate(5),34560);\n assert.deepEqual(candidate(7),125411328000);\n assert.deepEqual(candidate(1),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "ts", - "prompt": "//In this problem, you will implement a function that takes two arrays of numbers,\n// and determines whether it is possible to perform an exchange of elements\n// between them to make lst1 an array of only even numbers.\n// There is no limit on the number of exchanged elements between lst1 and lst2.\n// If it is possible to exchange elements between the lst1 and lst2 to make\n// all the elements of lst1 to be even, return \"YES\".\n// Otherwise, return \"NO\".\n// For example:\n// >>> exchange([1, 2, 3, 4], [1, 2, 3, 4])\n// \"YES\"\n// >>> exchange([1, 2, 3, 4], [1, 5, 3, 4])\n// \"NO\"\n// It is assumed that the input arrays will be non-empty.\nfunction exchange(lst1: number[], lst2: number[]): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = exchange;\n assert.deepEqual(candidate([1, 2, 3, 4], [1, 2, 3, 4]),\"YES\");\n assert.deepEqual(candidate([1, 2, 3, 4], [1, 5, 3, 4]),\"NO\");\n assert.deepEqual(candidate([1, 2, 3, 4], [2, 1, 4, 3]),\"YES\");\n assert.deepEqual(candidate([5, 7, 3], [2, 6, 4]),\"YES\");\n assert.deepEqual(candidate([5, 7, 3], [2, 6, 3]),\"NO\");\n assert.deepEqual(candidate([3, 2, 6, 1, 8, 9], [3, 5, 5, 1, 1, 1]),\"NO\");\n assert.deepEqual(candidate([100, 200], [200, 200]),\"YES\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "ts", - "prompt": "//Given a non-empty array of integers arr and an integer k, return\n// the sum of the elements with at most two digits from the first k elements of arr.\n// Example:\n// >>> add_elements([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4)\n// 24\n// Constraints:\n// 1. 1 <= len(arr) <= 100\n// 2. 1 <= k <= len(arr)\nfunction add_elements(arr: number[], k: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = add_elements;\n assert.deepEqual(candidate([1, -2, -3, 41, 57, 76, 87, 88, 99], 3),-4);\n assert.deepEqual(candidate([111, 121, 3, 4000, 5, 6], 2),0);\n assert.deepEqual(candidate([11, 21, 3, 90, 5, 6, 7, 8, 9], 4),125);\n assert.deepEqual(candidate([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4),24);\n assert.deepEqual(candidate([1], 1),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "ts", - "prompt": "//A simple program which should return the value of x if n is \n// a prime number and should return the value of y otherwise.\n// Examples:\n// >>> x_or_y(7, 34, 12)\n// 34\n// >>> x_or_y(15, 8, 5)\n// 5\nfunction x_or_y(n: number, x: number, y: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = x_or_y;\n assert.deepEqual(candidate(7, 34, 12),34);\n assert.deepEqual(candidate(15, 8, 5),5);\n assert.deepEqual(candidate(3, 33, 5212),33);\n assert.deepEqual(candidate(1259, 3, 52),3);\n assert.deepEqual(candidate(7919, -1, 12),-1);\n assert.deepEqual(candidate(3609, 1245, 583),583);\n assert.deepEqual(candidate(91, 56, 129),129);\n assert.deepEqual(candidate(6, 34, 1234),1234);\n assert.deepEqual(candidate(1, 2, 0),0);\n assert.deepEqual(candidate(2, 2, 0),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "ts", - "prompt": "//Given length of a side and high return area for a triangle.\n// >>> triangle_area(5, 3)\n// 7.5\nfunction triangle_area(a: number, h: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = triangle_area;\n assert.deepEqual(candidate(5, 3),7.5);\n assert.deepEqual(candidate(2, 2),2.0);\n assert.deepEqual(candidate(10, 8),40.0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "ts", - "prompt": "//Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n// the last couple centuries. However, what people don't know is Tribonacci sequence.\n// Tribonacci sequence is defined by the recurrence:\n// tri(1) = 3\n// tri(n) = 1 + n / 2, if n is even.\n// tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n// For example:\n// tri(2) = 1 + (2 / 2) = 2\n// tri(4) = 3\n// tri(3) = tri(2) + tri(1) + tri(4)\n// = 2 + 3 + 3 = 8 \n// You are given a non-negative integer number n, you have to a return an array of the \n// first n + 1 numbers of the Tribonacci sequence.\n// Examples:\n// >>> tri(3)\n// [1, 3, 2, 8]\nfunction tri(n: number): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = tri;\n assert.deepEqual(candidate(3),[1, 3, 2, 8]);\n assert.deepEqual(candidate(4),[1, 3, 2, 8, 3]);\n assert.deepEqual(candidate(5),[1, 3, 2, 8, 3, 15]);\n assert.deepEqual(candidate(6),[1, 3, 2, 8, 3, 15, 4]);\n assert.deepEqual(candidate(7),[1, 3, 2, 8, 3, 15, 4, 24]);\n assert.deepEqual(candidate(8),[1, 3, 2, 8, 3, 15, 4, 24, 5]);\n assert.deepEqual(candidate(9),[1, 3, 2, 8, 3, 15, 4, 24, 5, 35]);\n assert.deepEqual(candidate(20),[1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11]);\n assert.deepEqual(candidate(0),[1]);\n assert.deepEqual(candidate(1),[1, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "ts", - "prompt": "//You are given an array of two strings, both strings consist of open\n// parentheses '(' or close parentheses ')' only.\n// Your job is to check if it is possible to concatenate the two strings in\n// some order, that the resulting string will be good.\n// A string S is considered to be good if and only if all parentheses in S\n// are balanced. For example: the string '(())()' is good, while the string\n// '())' is not.\n// Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n// Examples:\n// >>> match_parens([\"()(\", \")\"])\n// \"Yes\"\n// >>> match_parens([\")\", \")\"])\n// \"No\"\nfunction match_parens(lst: string[]): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = match_parens;\n assert.deepEqual(candidate([\"()(\", \")\"]),\"Yes\");\n assert.deepEqual(candidate([\")\", \")\"]),\"No\");\n assert.deepEqual(candidate([\"(()(())\", \"())())\"]),\"No\");\n assert.deepEqual(candidate([\")())\", \"(()()(\"]),\"Yes\");\n assert.deepEqual(candidate([\"(())))\", \"(()())((\"]),\"Yes\");\n assert.deepEqual(candidate([\"()\", \"())\"]),\"No\");\n assert.deepEqual(candidate([\"(()(\", \"()))()\"]),\"Yes\");\n assert.deepEqual(candidate([\"((((\", \"((())\"]),\"No\");\n assert.deepEqual(candidate([\")(()\", \"(()(\"]),\"No\");\n assert.deepEqual(candidate([\")(\", \")(\"]),\"No\");\n assert.deepEqual(candidate([\"(\", \")\"]),\"Yes\");\n assert.deepEqual(candidate([\")\", \"(\"]),\"Yes\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "ts", - "prompt": "//From an array of integers, remove all elements that occur more than once.\n// Keep order of elements left the same as in the input.\n// >>> remove_duplicates([1, 2, 3, 2, 4])\n// [1, 3, 4]\nfunction remove_duplicates(numbers: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = remove_duplicates;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, 2, 3, 4]),[1, 2, 3, 4]);\n assert.deepEqual(candidate([1, 2, 3, 2, 4, 3, 5]),[1, 4, 5]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "ts", - "prompt": "//Return a greatest common divisor of two integers a and b\n// >>> greatest_common_divisor(3, 5)\n// 1\n// >>> greatest_common_divisor(25, 15)\n// 5\nfunction greatest_common_divisor(a: number, b: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = greatest_common_divisor;\n assert.deepEqual(candidate(3, 7),1);\n assert.deepEqual(candidate(10, 15),5);\n assert.deepEqual(candidate(49, 14),7);\n assert.deepEqual(candidate(144, 60),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "ts", - "prompt": "//Checks if given string is a palindrome\n// >>> is_palindrome(\"\")\n// true\n// >>> is_palindrome(\"aba\")\n// true\n// >>> is_palindrome(\"aaaaa\")\n// true\n// >>> is_palindrome(\"zbcd\")\n// false\nfunction is_palindrome(text: string): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_palindrome;\n assert.deepEqual(candidate(\"\"),true);\n assert.deepEqual(candidate(\"aba\"),true);\n assert.deepEqual(candidate(\"aaaaa\"),true);\n assert.deepEqual(candidate(\"zbcd\"),false);\n assert.deepEqual(candidate(\"xywyx\"),true);\n assert.deepEqual(candidate(\"xywyz\"),false);\n assert.deepEqual(candidate(\"xywzx\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "ts", - "prompt": "//xs represent coefficients of a polynomial.\n// xs[0] + xs[1] * x + xs[2] * x^2 + ....\n// Return derivative of this polynomial in the same form.\n// >>> derivative([3, 1, 2, 4, 5])\n// [1, 4, 12, 20]\n// >>> derivative([1, 2, 3])\n// [2, 6]\nfunction derivative(xs: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = derivative;\n assert.deepEqual(candidate([3, 1, 2, 4, 5]),[1, 4, 12, 20]);\n assert.deepEqual(candidate([1, 2, 3]),[2, 6]);\n assert.deepEqual(candidate([3, 2, 1]),[2, 2]);\n assert.deepEqual(candidate([3, 2, 1, 0, 4]),[2, 2, 0, 16]);\n assert.deepEqual(candidate([1]),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "ts", - "prompt": "//In this task, you will be given a string that represents a number of apples and oranges \n// that are distributed in a basket of fruit this basket contains \n// apples, oranges, and mango fruits. Given the string that represents the total number of \n// the oranges and apples and an integer that represent the total number of the fruits \n// in the basket return the number of the mango fruits in the basket.\n// for examble:\n// >>> fruit_distribution(\"5 apples and 6 oranges\", 19)\n// 8\n// >>> fruit_distribution(\"0 apples and 1 oranges\", 3)\n// 2\n// >>> fruit_distribution(\"2 apples and 3 oranges\", 100)\n// 95\n// >>> fruit_distribution(\"100 apples and 1 oranges\", 120)\n// 19\nfunction fruit_distribution(s: string, n: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fruit_distribution;\n assert.deepEqual(candidate(\"5 apples and 6 oranges\", 19),8);\n assert.deepEqual(candidate(\"5 apples and 6 oranges\", 21),10);\n assert.deepEqual(candidate(\"0 apples and 1 oranges\", 3),2);\n assert.deepEqual(candidate(\"1 apples and 0 oranges\", 3),2);\n assert.deepEqual(candidate(\"2 apples and 3 oranges\", 100),95);\n assert.deepEqual(candidate(\"2 apples and 3 oranges\", 5),0);\n assert.deepEqual(candidate(\"1 apples and 100 oranges\", 120),19);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "ts", - "prompt": "//Write a function that takes an integer a and returns true \n// if this ingeger is a cube of some integer number.\n// Note: you may assume the input is always valid.\n// Examples:\n// >>> iscube(1)\n// true\n// >>> iscube(2)\n// false\n// >>> iscube(-1)\n// true\n// >>> iscube(64)\n// true\n// >>> iscube(0)\n// true\n// >>> iscube(180)\n// false\nfunction iscube(a: number): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = iscube;\n assert.deepEqual(candidate(1),true);\n assert.deepEqual(candidate(2),false);\n assert.deepEqual(candidate(-1),true);\n assert.deepEqual(candidate(64),true);\n assert.deepEqual(candidate(180),false);\n assert.deepEqual(candidate(1000),true);\n assert.deepEqual(candidate(0),true);\n assert.deepEqual(candidate(1729),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "ts", - "prompt": "//In this Kata, you have to sort an array of non-negative integers according to\n// number of ones in their binary representation in ascending order.\n// For similar number of ones, sort based on decimal value.\n// It must be implemented like this:\n// >>> sort_array([1, 5, 2, 3, 4])\n// [1, 2, 3, 4, 5]\n// >>> sort_array([-2, -3, -4, -5, -6])\n// [-6, -5, -4, -3, -2]\n// >>> sort_array([1, 0, 2, 3, 4])\n// [0, 1, 2, 3, 4]\nfunction sort_array(arr: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_array;\n assert.deepEqual(candidate([1, 5, 2, 3, 4]),[1, 2, 4, 3, 5]);\n assert.deepEqual(candidate([-2, -3, -4, -5, -6]),[-4, -2, -6, -5, -3]);\n assert.deepEqual(candidate([1, 0, 2, 3, 4]),[0, 1, 2, 4, 3]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]),[2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77]);\n assert.deepEqual(candidate([3, 6, 44, 12, 32, 5]),[32, 3, 5, 6, 12, 44]);\n assert.deepEqual(candidate([2, 4, 8, 16, 32]),[2, 4, 8, 16, 32]);\n assert.deepEqual(candidate([2, 4, 8, 16, 32]),[2, 4, 8, 16, 32]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "ts", - "prompt": "//Given an array of strings, where each string consists of only digits, return an array.\n// Each element i of the output should be \"the number of odd elements in the\n// string i of the input.\" where all the i's should be replaced by the number\n// of odd digits in the i'th string of the input.\n// >>> odd_count([\"1234567\"])\n// [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n// >>> odd_count([\"3\", \"11111111\"])\n// [\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\nfunction odd_count(lst: string[]): string[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = odd_count;\n assert.deepEqual(candidate([\"1234567\"]),[\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]);\n assert.deepEqual(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.\"]);\n assert.deepEqual(candidate([\"271\", \"137\", \"314\"]),[\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "ts", - "prompt": "//brackets is a string of \"(\" and \")\".\n// return true if every opening bracket has a corresponding closing bracket.\n// >>> correct_bracketing(\"(\")\n// false\n// >>> correct_bracketing(\"()\")\n// true\n// >>> correct_bracketing(\"(()())\")\n// true\n// >>> correct_bracketing(\")(()\")\n// false\nfunction correct_bracketing(brackets: string): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = correct_bracketing;\n assert.deepEqual(candidate(\"()\"),true);\n assert.deepEqual(candidate(\"(()())\"),true);\n assert.deepEqual(candidate(\"()()(()())()\"),true);\n assert.deepEqual(candidate(\"()()((()()())())(()()(()))\"),true);\n assert.deepEqual(candidate(\"((()())))\"),false);\n assert.deepEqual(candidate(\")(()\"),false);\n assert.deepEqual(candidate(\"(\"),false);\n assert.deepEqual(candidate(\"((((\"),false);\n assert.deepEqual(candidate(\")\"),false);\n assert.deepEqual(candidate(\"(()\"),false);\n assert.deepEqual(candidate(\"()()(()())())(()\"),false);\n assert.deepEqual(candidate(\"()()(()())()))()\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "ts", - "prompt": "//Task\n// Write a function that takes a string as input and returns the sum of the upper characters only'\n// ASCII codes.\n// Examples:\n// >>> digitSum(\"\")\n// 0\n// >>> digitSum(\"abAB\")\n// 131\n// >>> digitSum(\"abcCd\")\n// 67\n// >>> digitSum(\"helloE\")\n// 69\n// >>> digitSum(\"woArBld\")\n// 131\n// >>> digitSum(\"aAaaaXa\")\n// 153\nfunction digitSum(s: string): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = digitSum;\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"abAB\"),131);\n assert.deepEqual(candidate(\"abcCd\"),67);\n assert.deepEqual(candidate(\"helloE\"),69);\n assert.deepEqual(candidate(\"woArBld\"),131);\n assert.deepEqual(candidate(\"aAaaaXa\"),153);\n assert.deepEqual(candidate(\" How are yOu?\"),151);\n assert.deepEqual(candidate(\"You arE Very Smart\"),327);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "ts", - "prompt": "//Write a function that accepts an array of strings as a parameter,\n// deletes the strings that have odd lengths from it,\n// and returns the resulted array with a sorted order,\n// The array is always an array of strings and never an array of numbers,\n// and it may contain duplicates.\n// The order of the array should be ascending by length of each word, and you\n// should return the array sorted by that rule.\n// If two words have the same length, sort the array alphabetically.\n// The function should return an array of strings in sorted order.\n// You may assume that all words will have the same length.\n// For example:\n// >>> list_sort([\"aa\", \"a\", \"aaa\"])\n// [\"aa\"]\n// >>> list_sort([\"ab\", \"a\", \"aaa\", \"cd\"])\n// [\"ab\", \"cd\"]\nfunction sorted_list_sum(lst: string[]): string[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sorted_list_sum;\n assert.deepEqual(candidate([\"aa\", \"a\", \"aaa\"]),[\"aa\"]);\n assert.deepEqual(candidate([\"school\", \"AI\", \"asdf\", \"b\"]),[\"AI\", \"asdf\", \"school\"]);\n assert.deepEqual(candidate([\"d\", \"b\", \"c\", \"a\"]),[]);\n assert.deepEqual(candidate([\"d\", \"dcba\", \"abcd\", \"a\"]),[\"abcd\", \"dcba\"]);\n assert.deepEqual(candidate([\"AI\", \"ai\", \"au\"]),[\"AI\", \"ai\", \"au\"]);\n assert.deepEqual(candidate([\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"]),[]);\n assert.deepEqual(candidate([\"aaaa\", \"bbbb\", \"dd\", \"cc\"]),[\"cc\", \"dd\", \"aaaa\", \"bbbb\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "ts", - "prompt": "//You are given an array arr of integers and you need to return\n// sum of magnitudes of integers multiplied by product of all signs\n// of each number in the array, represented by 1, -1 or 0.\n// Note: return undefined for empty arr.\n// Example:\n// >>> prod_signs([1, 2, 2, -4])\n// 9\n// >>> prod_signs([0, 1])\n// 0\n// >>> prod_signs([])\n// undefined\nfunction prod_signs(arr: number[]): number | undefined {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = prod_signs;\n assert.deepEqual(candidate([1, 2, 2, -4]),-9);\n assert.deepEqual(candidate([0, 1]),0);\n assert.deepEqual(candidate([1, 1, 1, 2, 3, -1, 1]),-10);\n assert.deepEqual(candidate([]),undefined);\n assert.deepEqual(candidate([2, 4, 1, 2, -1, -1, 9]),20);\n assert.deepEqual(candidate([-1, 1, -1, 1]),4);\n assert.deepEqual(candidate([-1, 1, 1, 1]),-4);\n assert.deepEqual(candidate([-1, 1, 1, 0]),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "ts", - "prompt": "//Return array with elements incremented by 1.\n// >>> incr_list([1, 2, 3])\n// [2, 3, 4]\n// >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123])\n// [6, 4, 6, 3, 4, 4, 10, 1, 124]\nfunction incr_list(l: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = incr_list;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([3, 2, 1]),[4, 3, 2]);\n assert.deepEqual(candidate([5, 2, 5, 2, 3, 3, 9, 0, 123]),[6, 3, 6, 3, 4, 4, 10, 1, 124]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "ts", - "prompt": "//From a given array of integers, generate an array of rolling maximum element found until given moment\n// in the sequence.\n// >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n// [1, 2, 3, 3, 3, 4, 4]\nfunction rolling_max(numbers: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = rolling_max;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, 2, 3, 4]),[1, 2, 3, 4]);\n assert.deepEqual(candidate([4, 3, 2, 1]),[4, 4, 4, 4]);\n assert.deepEqual(candidate([3, 2, 3, 100, 3]),[3, 3, 3, 100, 100]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "ts", - "prompt": "//Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n// separate those group into separate strings and return the array of those.\n// Separate groups are balanced (each open brace is properly closed) and not nested within each other\n// Ignore any spaces in the input string.\n// >>> separate_paren_groups(\"( ) (( )) (( )( ))\")\n// [\"()\", \"(())\", \"(()())\"]\nfunction separate_paren_groups(paren_string: string): string[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = separate_paren_groups;\n assert.deepEqual(candidate(\"(()()) ((())) () ((())()())\"),[\"(()())\", \"((()))\", \"()\", \"((())()())\"]);\n assert.deepEqual(candidate(\"() (()) ((())) (((())))\"),[\"()\", \"(())\", \"((()))\", \"(((())))\"]);\n assert.deepEqual(candidate(\"(()(())((())))\"),[\"(()(())((())))\"]);\n assert.deepEqual(candidate(\"( ) (( )) (( )( ))\"),[\"()\", \"(())\", \"(()())\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "ts", - "prompt": "//You will be given a string of words separated by commas or spaces. Your task is\n// to split the string into words and return an array of the words.\n// For example:\n// >>> words_string(\"Hi, my name is John\")\n// [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n// >>> words_string(\"One, two, three, four, five, six\")\n// [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\nfunction words_string(s: string): string[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = words_string;\n assert.deepEqual(candidate(\"Hi, my name is John\"),[\"Hi\", \"my\", \"name\", \"is\", \"John\"]);\n assert.deepEqual(candidate(\"One, two, three, four, five, six\"),[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]);\n assert.deepEqual(candidate(\"Hi, my name\"),[\"Hi\", \"my\", \"name\"]);\n assert.deepEqual(candidate(\"One,, two, three, four, five, six,\"),[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]);\n assert.deepEqual(candidate(\"\"),[]);\n assert.deepEqual(candidate(\"ahmed , gamal\"),[\"ahmed\", \"gamal\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "ts", - "prompt": "//Filter given array of any tsthon values only for integers\n// >>> filter_integers([\"a\", 3.14, 5])\n// [5]\n// >>> filter_integers([1, 2, 3, \"abc\", {}, []])\n// [1, 2, 3]\nfunction filter_integers(values: any[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = filter_integers;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([4, {}, [], 23.2, 9, \"adasd\"]),[4, 9]);\n assert.deepEqual(candidate([3, \"c\", 3, 3, \"a\", \"b\"]),[3, 3, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "ts", - "prompt": "//This function takes an array l and returns an array l' such that\n// l' is identical to l in the odd indicies, while its values at the even indicies are equal\n// to the values of the even indicies of l, but sorted.\n// >>> sort_even([1, 2, 3])\n// [1, 2, 3]\n// >>> sort_even([5, 6, 3, 4])\n// [3, 6, 5, 4]\nfunction sort_even(l: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_even;\n assert.deepEqual(candidate([1, 2, 3]),[1, 2, 3]);\n assert.deepEqual(candidate([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]),[-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123]);\n assert.deepEqual(candidate([5, 8, -12, 4, 23, 2, 3, 11, 12, -10]),[-12, 8, 3, 4, 5, 2, 12, 11, 23, -10]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "ts", - "prompt": "//I think we all remember that feeling when the result of some long-awaited\n// event is finally known. The feelings and thoughts you have at that moment are\n// definitely worth noting down and comparing.\n// Your task is to determine if a person correctly guessed the results of a number of matches.\n// You are given two arrays of scores and guesses of equal length, where each index shows a match. \n// Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n// the value is 0, and if not, the value is the absolute difference between the guess and the score.\n// example:\n// >>> compare([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2])\n// [0, 0, 0, 0, 3, 3]\n// >>> compare([0, 5, 0, 0, 0, 4], [4, 1, 1, 0, 0, -2])\n// [4, 4, 1, 0, 0, 6]\nfunction compare(game: number[], guess: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = compare;\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2]),[0, 0, 0, 0, 3, 3]);\n assert.deepEqual(candidate([0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]),[0, 0, 0, 0, 0, 0]);\n assert.deepEqual(candidate([1, 2, 3], [-1, -2, -3]),[2, 4, 6]);\n assert.deepEqual(candidate([1, 2, 3, 5], [-1, 2, 3, 4]),[2, 0, 0, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "ts", - "prompt": "//Given a positive integer n, return an array that has the number of even and odd\n// integer palindromes that fall within the range(1, n), inclusive.\n// Example 1:\n// >>> even_odd_palindrome(3)\n// [1, 2]\n// Explanation:\n// Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n// Example 2:\n// >>> even_odd_palindrome(12)\n// [4, 6]\n// Explanation:\n// Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n// Note:\n// 1. 1 <= n <= 10^3\n// 2. returned array has the number of even and odd integer palindromes respectively.\nfunction even_odd_palindrome(n: number): [number, number] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = even_odd_palindrome;\n assert.deepEqual(candidate(123),[8, 13]);\n assert.deepEqual(candidate(12),[4, 6]);\n assert.deepEqual(candidate(3),[1, 2]);\n assert.deepEqual(candidate(63),[6, 8]);\n assert.deepEqual(candidate(25),[5, 6]);\n assert.deepEqual(candidate(19),[4, 6]);\n assert.deepEqual(candidate(9),[4, 5]);\n assert.deepEqual(candidate(1),[0, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "ts", - "prompt": "//The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fib4(0) -> 0\n// fib4(1) -> 0\n// fib4(2) -> 2\n// fib4(3) -> 0\n// fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n// Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n// >>> fib4(5)\n// 4\n// >>> fib4(6)\n// 8\n// >>> fib4(7)\n// 14\nfunction fib4(n: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fib4;\n assert.deepEqual(candidate(5),4);\n assert.deepEqual(candidate(8),28);\n assert.deepEqual(candidate(10),104);\n assert.deepEqual(candidate(12),386);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "ts", - "prompt": "//Given two positive integers a and b, return the even digits between a\n// and b, in ascending order.\n// For example:\n// >>> generate_integers(2, 8)\n// [2, 4, 6, 8]\n// >>> generate_integers(8, 2)\n// [2, 4, 6, 8]\n// >>> generate_integers(10, 14)\n// []\nfunction generate_integers(a: number, b: number): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = generate_integers;\n assert.deepEqual(candidate(2, 10),[2, 4, 6, 8]);\n assert.deepEqual(candidate(10, 2),[2, 4, 6, 8]);\n assert.deepEqual(candidate(132, 2),[2, 4, 6, 8]);\n assert.deepEqual(candidate(17, 89),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "ts", - "prompt": "//For a given array of input numbers, calculate Mean Absolute Deviation\n// around the mean of this dataset.\n// Mean Absolute Deviation is the average absolute difference between each\n// element and a centerpoint (mean in this case):\n// MAD = average | x - x_mean |\n// >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n// 1.0\nfunction mean_absolute_deviation(numbers: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = mean_absolute_deviation;\n assert.deepEqual(candidate([1.0, 2.0]),0.5);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0]),1.0);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0]),1.2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "ts", - "prompt": "//Create a function encrypt that takes a string as an argument and\n// returns a string encrypted with the alphabet being rotated. \n// The alphabet should be rotated in a manner such that the letters \n// shift down by two multiplied to two places.\n// For example:\n// >>> encrypt(\"hi\")\n// \"lm\"\n// >>> encrypt(\"asdfghjkl\")\n// \"ewhjklnop\"\n// >>> encrypt(\"gf\")\n// \"kj\"\n// >>> encrypt(\"et\")\n// \"ix\"\nfunction encrypt(s: string): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = encrypt;\n assert.deepEqual(candidate(\"hi\"),\"lm\");\n assert.deepEqual(candidate(\"asdfghjkl\"),\"ewhjklnop\");\n assert.deepEqual(candidate(\"gf\"),\"kj\");\n assert.deepEqual(candidate(\"et\"),\"ix\");\n assert.deepEqual(candidate(\"faewfawefaewg\"),\"jeiajeaijeiak\");\n assert.deepEqual(candidate(\"hellomyfriend\"),\"lippsqcjvmirh\");\n assert.deepEqual(candidate(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\"),\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\");\n assert.deepEqual(candidate(\"a\"),\"e\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "ts", - "prompt": "//Given a positive integer n, return a sorted array that has the odd numbers in collatz sequence.\n// The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n// as follows: start with any positive integer n. Then each term is obtained from the \n// previous term as follows: if the previous term is even, the next term is one half of \n// the previous term. If the previous term is odd, the next term is 3 times the previous\n// term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n// Note: \n// 1. Collatz(1) is [1].\n// 2. returned array sorted in increasing order.\n// For example:\n// get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n// >>> get_odd_collatz(5)\n// [1, 5]\nfunction get_odd_collatz(n: number): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_odd_collatz;\n assert.deepEqual(candidate(14),[1, 5, 7, 11, 13, 17]);\n assert.deepEqual(candidate(5),[1, 5]);\n assert.deepEqual(candidate(12),[1, 3, 5]);\n assert.deepEqual(candidate(1),[1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "ts", - "prompt": "//Find how many times a given substring can be found in the original string. Count overlaping cases.\n// >>> how_many_times(\"\", \"a\")\n// 0\n// >>> how_many_times(\"aaa\", \"a\")\n// 3\n// >>> how_many_times(\"aaaa\", \"aa\")\n// 3\nfunction how_many_times(string: string, substring: string): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = how_many_times;\n assert.deepEqual(candidate(\"\", \"x\"),0);\n assert.deepEqual(candidate(\"xyxyxyx\", \"x\"),4);\n assert.deepEqual(candidate(\"cacacacac\", \"cac\"),4);\n assert.deepEqual(candidate(\"john doe\", \"john\"),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "ts", - "prompt": "//We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n// numbers in the array will be randomly ordered. Your task is to determine if\n// it is possible to get an array sorted in non-decreasing order by performing \n// the following operation on the given array:\n// You are allowed to perform right shift operation any number of times.\n// One right shift operation means shifting all elements of the array by one\n// position in the right direction. The last element of the array will be moved to\n// the starting position in the array i.e. 0th index. \n// If it is possible to obtain the sorted array by performing the above operation\n// then return true else return false.\n// If the given array is empty then return true.\n// Note: The given array is guaranteed to have unique elements.\n// For Example:\n// >>> move_one_ball([3, 4, 5, 1, 2])\n// true\n// Explanation: By performin 2 right shift operations, non-decreasing order can\n// be achieved for the given array.\n// >>> move_one_ball([3, 5, 4, 1, 2])\n// false\n// Explanation:It is not possible to get non-decreasing order for the given\n// array by performing any number of right shift operations.\nfunction move_one_ball(arr: number[]): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = move_one_ball;\n assert.deepEqual(candidate([3, 4, 5, 1, 2]),true);\n assert.deepEqual(candidate([3, 5, 10, 1, 2]),true);\n assert.deepEqual(candidate([4, 3, 1, 2]),false);\n assert.deepEqual(candidate([3, 5, 4, 1, 2]),false);\n assert.deepEqual(candidate([]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "ts", - "prompt": "//Write a function which sorts the given array of integers\n// in ascending order according to the sum of their digits.\n// Note: if there are several items with similar sum of their digits,\n// order them based on their index in original array.\n// For example:\n// >>> order_by_points([1, 11, -1, -11, -12])\n// [-1, -11, 1, -12, 11]\n// >>> order_by_points([])\n// []\nfunction order_by_points(nums: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = order_by_points;\n assert.deepEqual(candidate([1, 11, -1, -11, -12]),[-1, -11, 1, -12, 11]);\n assert.deepEqual(candidate([1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]),[0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, -11, -32, 43, 54, -98, 2, -3]),[-3, -32, -98, -11, 1, 2, 43, 54]);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]),[1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9]);\n assert.deepEqual(candidate([0, 6, 6, -76, -21, 23, 4]),[-76, -21, 0, 4, 23, 6, 6]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "ts", - "prompt": "//Return array of prime factors of given integer in the order from smallest to largest.\n// Each of the factors should be arrayed number of times corresponding to how many times it appeares in factorization.\n// Input number should be equal to the product of all factors\n// >>> factorize(8)\n// [2, 2, 2]\n// >>> factorize(25)\n// [5, 5]\n// >>> factorize(70)\n// [2, 5, 7]\nfunction factorize(n: number): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = factorize;\n assert.deepEqual(candidate(2),[2]);\n assert.deepEqual(candidate(4),[2, 2]);\n assert.deepEqual(candidate(8),[2, 2, 2]);\n assert.deepEqual(candidate(57),[3, 19]);\n assert.deepEqual(candidate(3249),[3, 3, 19, 19]);\n assert.deepEqual(candidate(185193),[3, 3, 3, 19, 19, 19]);\n assert.deepEqual(candidate(20577),[3, 19, 19, 19]);\n assert.deepEqual(candidate(18),[2, 3, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "ts", - "prompt": "//Return true if all numbers in the array l are below threshold t.\n// >>> below_threshold([1, 2, 4, 10], 100)\n// true\n// >>> below_threshold([1, 20, 4, 10], 5)\n// false\nfunction below_threshold(l: number[], t: number): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = below_threshold;\n assert.deepEqual(candidate([1, 2, 4, 10], 100),true);\n assert.deepEqual(candidate([1, 20, 4, 10], 5),false);\n assert.deepEqual(candidate([1, 20, 4, 10], 21),true);\n assert.deepEqual(candidate([1, 20, 4, 10], 22),true);\n assert.deepEqual(candidate([1, 8, 4, 10], 11),true);\n assert.deepEqual(candidate([1, 8, 4, 10], 10),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "ts", - "prompt": "//You are given two positive integers n and m, and your task is to compute the\n// average of the integers from n through m (including n and m). \n// Round the answer to the nearest integer and convert that to binary.\n// If n is greater than m, return -1.\n// Example:\n// >>> rounded_avg(1, 5)\n// \"0b11\"\n// >>> rounded_avg(7, 5)\n// -1\n// >>> rounded_avg(10, 20)\n// \"0b1111\"\n// >>> rounded_avg(20, 33)\n// \"0b11010\"\nfunction rounded_avg(n: number, m: number): string| number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = rounded_avg;\n assert.deepEqual(candidate(1, 5),\"0b11\");\n assert.deepEqual(candidate(7, 13),\"0b1010\");\n assert.deepEqual(candidate(964, 977),\"0b1111001010\");\n assert.deepEqual(candidate(996, 997),\"0b1111100100\");\n assert.deepEqual(candidate(560, 851),\"0b1011000010\");\n assert.deepEqual(candidate(185, 546),\"0b101101110\");\n assert.deepEqual(candidate(362, 496),\"0b110101101\");\n assert.deepEqual(candidate(350, 902),\"0b1001110010\");\n assert.deepEqual(candidate(197, 233),\"0b11010111\");\n assert.deepEqual(candidate(7, 5),-1);\n assert.deepEqual(candidate(5, 1),-1);\n assert.deepEqual(candidate(5, 5),\"0b101\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "ts", - "prompt": "//Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n// For each of the group, output the deepest level of nesting of parentheses.\n// E.g. (()()) has maximum two levels of nesting while ((())) has three.\n// >>> parse_nested_parens(\"(()()) ((())) () ((())()())\")\n// [2, 3, 1, 3]\nfunction parse_nested_parens(paren_string: string): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = parse_nested_parens;\n assert.deepEqual(candidate(\"(()()) ((())) () ((())()())\"),[2, 3, 1, 3]);\n assert.deepEqual(candidate(\"() (()) ((())) (((())))\"),[1, 2, 3, 4]);\n assert.deepEqual(candidate(\"(()(())((())))\"),[4]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "ts", - "prompt": "//Given a non-empty array of integers, return the sum of all of the odd elements that are in even positions.\n// Examples\n// >>> solution([5, 8, 7, 1])\n// 12\n// >>> solution([3, 3, 3, 3, 3])\n// 9\n// >>> solution([30, 13, 24, 321])\n// 0\nfunction solution(lst: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = solution;\n assert.deepEqual(candidate([5, 8, 7, 1]),12);\n assert.deepEqual(candidate([3, 3, 3, 3, 3]),9);\n assert.deepEqual(candidate([30, 13, 24, 321]),0);\n assert.deepEqual(candidate([5, 9]),5);\n assert.deepEqual(candidate([2, 4, 8]),0);\n assert.deepEqual(candidate([30, 13, 23, 32]),23);\n assert.deepEqual(candidate([3, 13, 2, 9]),3);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "ts", - "prompt": "//You are given a positive integer n. You have to create an integer array a of length n.\n// For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n// Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n// and a[i] + a[j] + a[k] is a multiple of 3.\n// Example :\n// >>> get_max_triples(5)\n// 1\n// Explanation: \n// a = [1, 3, 7, 13, 21]\n// The only valid triple is (1, 7, 13).\nfunction get_max_triples(n: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_max_triples;\n assert.deepEqual(candidate(5),1);\n assert.deepEqual(candidate(6),4);\n assert.deepEqual(candidate(10),36);\n assert.deepEqual(candidate(100),53361);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "ts", - "prompt": "//You are given an array of integers.\n// Write a function next_smallest() that returns the 2nd smallest element of the array.\n// Return undefined if there is no such element.\n// >>> next_smallest([1, 2, 3, 4, 5])\n// 2\n// >>> next_smallest([5, 1, 4, 3, 2])\n// 2\n// >>> next_smallest([])\n// undefined\n// >>> next_smallest([1, 1])\n// undefined\nfunction next_smallest(lst: number[]): number | undefined {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = next_smallest;\n assert.deepEqual(candidate([1, 2, 3, 4, 5]),2);\n assert.deepEqual(candidate([5, 1, 4, 3, 2]),2);\n assert.deepEqual(candidate([]),undefined);\n assert.deepEqual(candidate([1, 1]),undefined);\n assert.deepEqual(candidate([1, 1, 1, 1, 0]),1);\n assert.deepEqual(candidate([1, 1]),undefined);\n assert.deepEqual(candidate([-35, 34, 12, -45]),-35);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "ts", - "prompt": "//Input is a space-delimited string of numberals from 'zero' to 'nine'.\n// Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n// Return the string with numbers sorted from smallest to largest\n// >>> sort_numbers(\"three one five\")\n// \"one three five\"\nfunction sort_numbers(numbers: string): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_numbers;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"three\"),\"three\");\n assert.deepEqual(candidate(\"three five nine\"),\"three five nine\");\n assert.deepEqual(candidate(\"five zero four seven nine eight\"),\"zero four five seven eight nine\");\n assert.deepEqual(candidate(\"six five four three two one zero\"),\"zero one two three four five six\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "ts", - "prompt": "//You are given 2 words. You need to return true if the second word or any of its rotations is a substring in the first word\n// >>> cycpattern_check(\"abcd\", \"abd\")\n// false\n// >>> cycpattern_check(\"hello\", \"ell\")\n// true\n// >>> cycpattern_check(\"whassup\", \"psus\")\n// false\n// >>> cycpattern_check(\"abab\", \"baa\")\n// true\n// >>> cycpattern_check(\"efef\", \"eeff\")\n// false\n// >>> cycpattern_check(\"himenss\", \"simen\")\n// true\nfunction cycpattern_check(a: string, b: string): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = cycpattern_check;\n assert.deepEqual(candidate(\"xyzw\", \"xyw\"),false);\n assert.deepEqual(candidate(\"yello\", \"ell\"),true);\n assert.deepEqual(candidate(\"whattup\", \"ptut\"),false);\n assert.deepEqual(candidate(\"efef\", \"fee\"),true);\n assert.deepEqual(candidate(\"abab\", \"aabb\"),false);\n assert.deepEqual(candidate(\"winemtt\", \"tinem\"),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "ts", - "prompt": "//You will be given a number in decimal form and your task is to convert it to\n// binary format. The function should return a string, with each character representing a binary\n// number. Each character in the string will be '0' or '1'.\n// There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n// The extra characters are there to help with the format.\n// Examples:\n// >>> decimal_to_binary(15)\n// \"db1111db\"\n// >>> decimal_to_binary(32)\n// \"db100000db\"\nfunction decimal_to_binary(decimal: number): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = decimal_to_binary;\n assert.deepEqual(candidate(0),\"db0db\");\n assert.deepEqual(candidate(32),\"db100000db\");\n assert.deepEqual(candidate(103),\"db1100111db\");\n assert.deepEqual(candidate(15),\"db1111db\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "ts", - "prompt": "//Filter an input array of strings only for ones that contain given substring\n// >>> filter_by_substring([], \"a\")\n// []\n// >>> filter_by_substring([\"abc\", \"bacd\", \"cde\", \"array\"], \"a\")\n// [\"abc\", \"bacd\", \"array\"]\nfunction filter_by_substring(strings: string[], substring: string): string[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = filter_by_substring;\n assert.deepEqual(candidate([], \"john\"),[]);\n assert.deepEqual(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"),[\"xxx\", \"xxxAAA\", \"xxx\"]);\n assert.deepEqual(candidate([\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xx\"),[\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"]);\n assert.deepEqual(candidate([\"grunt\", \"trumpet\", \"prune\", \"gruesome\"], \"run\"),[\"grunt\", \"prune\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "ts", - "prompt": "//Given an integer. return an array that has the number of even and odd digits respectively.\n// Example:\n// >>> even_odd_count(-12)\n// [1, 1]\n// >>> even_odd_count(123)\n// [1, 2]\nfunction even_odd_count(num: number): [number, number] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = even_odd_count;\n assert.deepEqual(candidate(7),[0, 1]);\n assert.deepEqual(candidate(-78),[1, 1]);\n assert.deepEqual(candidate(3452),[2, 2]);\n assert.deepEqual(candidate(346211),[3, 3]);\n assert.deepEqual(candidate(-345821),[3, 3]);\n assert.deepEqual(candidate(-2),[1, 0]);\n assert.deepEqual(candidate(-45347),[2, 3]);\n assert.deepEqual(candidate(0),[1, 0]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "ts", - "prompt": "//Write a function that accepts an array of strings.\n// The array contains different words. Return the word with maximum number\n// of unique characters. If multiple strings have maximum number of unique\n// characters, return the one which comes first in lexicographical order.\n// >>> find_max([\"name\", \"of\", \"string\"])\n// \"string\"\n// >>> find_max([\"name\", \"enam\", \"game\"])\n// \"enam\"\n// >>> find_max([\"aaaaaaa\", \"bb\", \"cc\"])\n// \"aaaaaaa\"\nfunction find_max(words: string[]): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = find_max;\n assert.deepEqual(candidate([\"name\", \"of\", \"string\"]),\"string\");\n assert.deepEqual(candidate([\"name\", \"enam\", \"game\"]),\"enam\");\n assert.deepEqual(candidate([\"aaaaaaa\", \"bb\", \"cc\"]),\"aaaaaaa\");\n assert.deepEqual(candidate([\"abc\", \"cba\"]),\"abc\");\n assert.deepEqual(candidate([\"play\", \"this\", \"game\", \"of\", \"footbott\"]),\"footbott\");\n assert.deepEqual(candidate([\"we\", \"are\", \"gonna\", \"rock\"]),\"gonna\");\n assert.deepEqual(candidate([\"we\", \"are\", \"a\", \"mad\", \"nation\"]),\"nation\");\n assert.deepEqual(candidate([\"this\", \"is\", \"a\", \"prrk\"]),\"this\");\n assert.deepEqual(candidate([\"b\"]),\"b\");\n assert.deepEqual(candidate([\"play\", \"play\", \"play\"]),\"play\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "ts", - "prompt": "//Given a positive integer n, return the count of the numbers of n-digit\n// positive integers that start or end with 1.\nfunction starts_one_ends(n: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = starts_one_ends;\n assert.deepEqual(candidate(1),1);\n assert.deepEqual(candidate(2),18);\n assert.deepEqual(candidate(3),180);\n assert.deepEqual(candidate(4),1800);\n assert.deepEqual(candidate(5),18000);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "ts", - "prompt": "//Create a function that returns an array (a, b), where 'a' is\n// the largest of negative integers, and 'b' is the smallest\n// of positive integers in an array.\n// If there is no negative or positive integers, return them as undefined.\n// Examples:\n// >>> largest_smallest_integers([2, 4, 1, 3, 5, 7])\n// [undefined, 1]\n// >>> largest_smallest_integers([])\n// [undefined, undefined]\n// >>> largest_smallest_integers([0])\n// [undefined, undefined]\nfunction largest_smallest_integers(lst: number[]): [number | undefined, number | undefined] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = largest_smallest_integers;\n assert.deepEqual(candidate([2, 4, 1, 3, 5, 7]),[undefined, 1]);\n assert.deepEqual(candidate([2, 4, 1, 3, 5, 7, 0]),[undefined, 1]);\n assert.deepEqual(candidate([1, 3, 2, 4, 5, 6, -2]),[-2, 1]);\n assert.deepEqual(candidate([4, 5, 3, 6, 2, 7, -7]),[-7, 2]);\n assert.deepEqual(candidate([7, 3, 8, 4, 9, 2, 5, -9]),[-9, 2]);\n assert.deepEqual(candidate([]),[undefined, undefined]);\n assert.deepEqual(candidate([0]),[undefined, undefined]);\n assert.deepEqual(candidate([-1, -3, -5, -6]),[-1, undefined]);\n assert.deepEqual(candidate([-1, -3, -5, -6, 0]),[-1, undefined]);\n assert.deepEqual(candidate([-6, -4, -4, -3, 1]),[-3, 1]);\n assert.deepEqual(candidate([-6, -4, -4, -3, -100, 1]),[-3, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "ts", - "prompt": "//\"Given an array representing a branch of a tree that has non-negative integer nodes\n// your task is to pluck one of the nodes and return it.\n// The plucked node should be the node with the smallest even value.\n// If multiple nodes with the same smallest even value are found return the node that has smallest index.\n// The plucked node should be returned in an array, [ smalest_value, its index ],\n// If there are no even values or the given array is empty, return [].\n// Example 1:\n// >>> pluck([4, 2, 3])\n// [2, 1]\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 2:\n// >>> pluck([1, 2, 3])\n// [2, 1]\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 3:\n// >>> pluck([])\n// []\n// Example 4:\n// >>> pluck([5, 0, 3, 0, 4, 2])\n// [0, 1]\n// Explanation: 0 is the smallest value, but there are two zeros,\n// so we will choose the first zero, which has the smallest index.\n// Constraints:\n// * 1 <= nodes.length <= 10000\n// * 0 <= node.value\nfunction pluck(arr: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = pluck;\n assert.deepEqual(candidate([4, 2, 3]),[2, 1]);\n assert.deepEqual(candidate([1, 2, 3]),[2, 1]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([5, 0, 3, 0, 4, 2]),[0, 1]);\n assert.deepEqual(candidate([1, 2, 3, 0, 5, 3]),[0, 3]);\n assert.deepEqual(candidate([5, 4, 8, 4, 8]),[4, 1]);\n assert.deepEqual(candidate([7, 6, 7, 1]),[6, 1]);\n assert.deepEqual(candidate([7, 9, 7, 1]),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "ts", - "prompt": "//Write a function count_nums which takes an array of integers and returns\n// the number of elements which has a sum of digits > 0.\n// If a number is negative, then its first signed digit will be negative:\n// e.g. -123 has signed digits -1, 2, and 3.\n// >>> count_nums([])\n// 0\n// >>> count_nums([-1, 11, -11])\n// 1\n// >>> count_nums([1, 1, 2])\n// 3\nfunction count_nums(arr: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_nums;\n assert.deepEqual(candidate([]),0);\n assert.deepEqual(candidate([-1, -2, 0]),0);\n assert.deepEqual(candidate([1, 1, 2, -2, 3, 4, 5]),6);\n assert.deepEqual(candidate([1, 6, 9, -6, 0, 1, 5]),5);\n assert.deepEqual(candidate([1, 100, 98, -7, 1, -1]),4);\n assert.deepEqual(candidate([12, 23, 34, -45, -56, 0]),5);\n assert.deepEqual(candidate([0, 1]),1);\n assert.deepEqual(candidate([1]),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "ts", - "prompt": "//Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n// each cell of the grid contains a value. Every integer in the range [1, N * N]\n// inclusive appears exactly once on the cells of the grid.\n// You have to find the minimum path of length k in the grid. You can start\n// from any cell, and in each step you can move to any of the neighbor cells,\n// in other words, you can go to cells which share an edge with you current\n// cell.\n// Please note that a path of length k means visiting exactly k cells (not\n// necessarily distinct).\n// You CANNOT go off the grid.\n// A path A (of length k) is considered less than a path B (of length k) if\n// after making the ordered arrays of the values on the cells that A and B go\n// through (let's call them lst_A and lst_B), lst_A is lexicographically less\n// than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n// such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n// lst_A[j] = lst_B[j].\n// It is guaranteed that the answer is unique.\n// Return an ordered array of the values on the cells that the minimum path go through.\n// Examples: \n// >>> minPath([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3)\n// [1, 2, 1]\n// >>> minPath([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1)\n// [1]\nfunction minPath(grid: number[][], k: number): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = minPath;\n assert.deepEqual(candidate([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3),[1, 2, 1]);\n assert.deepEqual(candidate([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1),[1]);\n assert.deepEqual(candidate([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], 4),[1, 2, 1, 2]);\n assert.deepEqual(candidate([[6, 4, 13, 10], [5, 7, 12, 1], [3, 16, 11, 15], [8, 14, 9, 2]], 7),[1, 10, 1, 10, 1, 10, 1]);\n assert.deepEqual(candidate([[8, 14, 9, 2], [6, 4, 13, 15], [5, 7, 1, 12], [3, 10, 11, 16]], 5),[1, 7, 1, 7, 1]);\n assert.deepEqual(candidate([[11, 8, 7, 2], [5, 16, 14, 4], [9, 3, 15, 6], [12, 13, 10, 1]], 9),[1, 6, 1, 6, 1, 6, 1, 6, 1]);\n assert.deepEqual(candidate([[12, 13, 10, 1], [9, 3, 15, 6], [5, 16, 14, 4], [11, 8, 7, 2]], 12),[1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6]);\n assert.deepEqual(candidate([[2, 7, 4], [3, 1, 5], [6, 8, 9]], 8),[1, 3, 1, 3, 1, 3, 1, 3]);\n assert.deepEqual(candidate([[6, 1, 5], [3, 8, 9], [2, 7, 4]], 8),[1, 5, 1, 5, 1, 5, 1, 5]);\n assert.deepEqual(candidate([[1, 2], [3, 4]], 10),[1, 2, 1, 2, 1, 2, 1, 2, 1, 2]);\n assert.deepEqual(candidate([[1, 3], [3, 2]], 10),[1, 3, 1, 3, 1, 3, 1, 3, 1, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "ts", - "prompt": "//Given array of integers, return array in strange order.\n// Strange sorting, is when you start with the minimum value,\n// then maximum of the remaining integers, then minimum and so on.\n// Examples:\n// >>> strange_sort_list([1, 2, 3, 4])\n// [1, 4, 2, 3]\n// >>> strange_sort_list([5, 5, 5, 5])\n// [5, 5, 5, 5]\n// >>> strange_sort_list([])\n// []\nfunction strange_sort_list(lst: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = strange_sort_list;\n assert.deepEqual(candidate([1, 2, 3, 4]),[1, 4, 2, 3]);\n assert.deepEqual(candidate([5, 6, 7, 8, 9]),[5, 9, 6, 8, 7]);\n assert.deepEqual(candidate([1, 2, 3, 4, 5]),[1, 5, 2, 4, 3]);\n assert.deepEqual(candidate([5, 6, 7, 8, 9, 1]),[1, 9, 5, 8, 6, 7]);\n assert.deepEqual(candidate([5, 5, 5, 5]),[5, 5, 5, 5]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6, 7, 8]),[1, 8, 2, 7, 3, 6, 4, 5]);\n assert.deepEqual(candidate([0, 2, 2, 2, 5, 5, -5, -5]),[-5, 5, -5, 5, 0, 2, 2, 2]);\n assert.deepEqual(candidate([111111]),[111111]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "ts", - "prompt": "//Given a string 'text', return its md5 hash equivalent string.\n// If 'text' is an empty string, return undefined.\n// >>> string_to_md5(\"Hello world\")\n// \"3e25960a79dbc69b674cd4ec67a72c62\"\nfunction string_to_md5(text: string): string | undefined {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = string_to_md5;\n assert.deepEqual(candidate(\"Hello world\"),\"3e25960a79dbc69b674cd4ec67a72c62\");\n assert.deepEqual(candidate(\"\"),undefined);\n assert.deepEqual(candidate(\"A B C\"),\"0ef78513b0cb8cef12743f5aeb35f888\");\n assert.deepEqual(candidate(\"password\"),\"5f4dcc3b5aa765d61d8327deb882cf99\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "ts", - "prompt": "//You are given a word. Your task is to find the closest vowel that stands between \n// two consonants from the right side of the word (case sensitive).\n// Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n// find any vowel met the above condition. \n// You may assume that the given string contains English letter only.\n// Example:\n// >>> get_closest_vowel(\"yogurt\")\n// \"u\"\n// >>> get_closest_vowel(\"FULL\")\n// \"U\"\n// >>> get_closest_vowel(\"quick\")\n// \"\"\n// >>> get_closest_vowel(\"ab\")\n// \"\"\nfunction get_closest_vowel(word: string): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_closest_vowel;\n assert.deepEqual(candidate(\"yogurt\"),\"u\");\n assert.deepEqual(candidate(\"full\"),\"u\");\n assert.deepEqual(candidate(\"easy\"),\"\");\n assert.deepEqual(candidate(\"eAsy\"),\"\");\n assert.deepEqual(candidate(\"ali\"),\"\");\n assert.deepEqual(candidate(\"bad\"),\"a\");\n assert.deepEqual(candidate(\"most\"),\"o\");\n assert.deepEqual(candidate(\"ab\"),\"\");\n assert.deepEqual(candidate(\"ba\"),\"\");\n assert.deepEqual(candidate(\"quick\"),\"\");\n assert.deepEqual(candidate(\"anime\"),\"i\");\n assert.deepEqual(candidate(\"Asia\"),\"\");\n assert.deepEqual(candidate(\"Above\"),\"o\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "ts", - "prompt": "//Change numerical base of input number x to base.\n// return string representation after the conversion.\n// base numbers are less than 10.\n// >>> change_base(8, 3)\n// \"22\"\n// >>> change_base(8, 2)\n// \"1000\"\n// >>> change_base(7, 2)\n// \"111\"\nfunction change_base(x: number, base: number): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = change_base;\n assert.deepEqual(candidate(8, 3),\"22\");\n assert.deepEqual(candidate(9, 3),\"100\");\n assert.deepEqual(candidate(234, 2),\"11101010\");\n assert.deepEqual(candidate(16, 2),\"10000\");\n assert.deepEqual(candidate(8, 2),\"1000\");\n assert.deepEqual(candidate(7, 2),\"111\");\n assert.deepEqual(candidate(2, 3),\"2\");\n assert.deepEqual(candidate(3, 4),\"3\");\n assert.deepEqual(candidate(4, 5),\"4\");\n assert.deepEqual(candidate(5, 6),\"5\");\n assert.deepEqual(candidate(6, 7),\"6\");\n assert.deepEqual(candidate(7, 8),\"7\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "ts", - "prompt": "//Check if in given array of numbers, are any two numbers closer to each other than\n// given threshold.\n// >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n// false\n// >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n// true\nfunction has_close_elements(numbers: number[], threshold: number): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = has_close_elements;\n assert.deepEqual(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3),true);\n assert.deepEqual(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05),false);\n assert.deepEqual(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.95),true);\n assert.deepEqual(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.8),false);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1),true);\n assert.deepEqual(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 1.0),true);\n assert.deepEqual(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 0.5),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "ts", - "prompt": "//Create a function that takes a string as input which contains only square brackets.\n// The function should return true if and only if there is a valid subsequence of brackets \n// where at least one bracket in the subsequence is nested.\n// >>> is_nested(\"[[]]\")\n// true\n// >>> is_nested(\"[]]]]]]][[[[[]\")\n// false\n// >>> is_nested(\"[][]\")\n// false\n// >>> is_nested(\"[]\")\n// false\n// >>> is_nested(\"[[][]]\")\n// true\n// >>> is_nested(\"[[]][[\")\n// true\nfunction is_nested(string: string): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_nested;\n assert.deepEqual(candidate(\"[[]]\"),true);\n assert.deepEqual(candidate(\"[]]]]]]][[[[[]\"),false);\n assert.deepEqual(candidate(\"[][]\"),false);\n assert.deepEqual(candidate(\"[]\"),false);\n assert.deepEqual(candidate(\"[[[[]]]]\"),true);\n assert.deepEqual(candidate(\"[]]]]]]]]]]\"),false);\n assert.deepEqual(candidate(\"[][][[]]\"),true);\n assert.deepEqual(candidate(\"[[]\"),false);\n assert.deepEqual(candidate(\"[]]\"),false);\n assert.deepEqual(candidate(\"[[]][[\"),true);\n assert.deepEqual(candidate(\"[[][]]\"),true);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"[[[[[[[[\"),false);\n assert.deepEqual(candidate(\"]]]]]]]]\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "ts", - "prompt": "//Concatenate array of strings into a single string\n// >>> concatenate([])\n// \"\"\n// >>> concatenate([\"a\", \"b\", \"c\"])\n// \"abc\"\nfunction concatenate(strings: string[]): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = concatenate;\n assert.deepEqual(candidate([]),\"\");\n assert.deepEqual(candidate([\"x\", \"y\", \"z\"]),\"xyz\");\n assert.deepEqual(candidate([\"x\", \"y\", \"z\", \"w\", \"k\"]),\"xyzwk\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "ts", - "prompt": "//prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n// >>> prime_fib(1)\n// 2\n// >>> prime_fib(2)\n// 3\n// >>> prime_fib(3)\n// 5\n// >>> prime_fib(4)\n// 13\n// >>> prime_fib(5)\n// 89\nfunction prime_fib(n: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = prime_fib;\n assert.deepEqual(candidate(1),2);\n assert.deepEqual(candidate(2),3);\n assert.deepEqual(candidate(3),5);\n assert.deepEqual(candidate(4),13);\n assert.deepEqual(candidate(5),89);\n assert.deepEqual(candidate(6),233);\n assert.deepEqual(candidate(7),1597);\n assert.deepEqual(candidate(8),28657);\n assert.deepEqual(candidate(9),514229);\n assert.deepEqual(candidate(10),433494437);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "ts", - "prompt": "//From a supplied array of numbers (of length at least two) select and return two that are the closest to each\n// other and return them in order (smaller number, larger number).\n// >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n// [2.0, 2.2]\n// >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n// [2.0, 2.0]\nfunction find_closest_elements(numbers: number[]): [number, number] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = find_closest_elements;\n assert.deepEqual(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2]),[3.9, 4.0]);\n assert.deepEqual(candidate([1.0, 2.0, 5.9, 4.0, 5.0]),[5.0, 5.9]);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]),[2.0, 2.2]);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]),[2.0, 2.0]);\n assert.deepEqual(candidate([1.1, 2.2, 3.1, 4.1, 5.1]),[2.2, 3.1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "ts", - "prompt": "//You have been tasked to write a function that receives \n// a hexadecimal number as a string and counts the number of hexadecimal \n// digits that are primes (prime number, or a prime, is a natural number \n// greater than 1 that is not a product of two smaller natural numbers).\n// Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n// Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n// So you have to determine a number of the following digits: 2, 3, 5, 7, \n// B (=decimal 11), D (=decimal 13).\n// Note: you may assume the input is always correct or empty string, \n// and symbols A,B,C,D,E,F are always uppercase.\n// Examples:\n// >>> hex_key(\"AB\")\n// 1\n// >>> hex_key(\"1077E\")\n// 2\n// >>> hex_key(\"ABED1A33\")\n// 4\n// >>> hex_key(\"123456789ABCDEF0\")\n// 6\n// >>> hex_key(\"2020\")\n// 2\nfunction hex_key(num: string): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = hex_key;\n assert.deepEqual(candidate(\"AB\"),1);\n assert.deepEqual(candidate(\"1077E\"),2);\n assert.deepEqual(candidate(\"ABED1A33\"),4);\n assert.deepEqual(candidate(\"2020\"),2);\n assert.deepEqual(candidate(\"123456789ABCDEF0\"),6);\n assert.deepEqual(candidate(\"112233445566778899AABBCCDDEEFF00\"),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "ts", - "prompt": "//Complete the function that takes two integers and returns \n// the product of their unit digits.\n// Assume the input is always valid.\n// Examples:\n// >>> multiply(148, 412)\n// 16\n// >>> multiply(19, 28)\n// 72\n// >>> multiply(2020, 1851)\n// 0\n// >>> multiply(14, -15)\n// 20\nfunction multiply(a: number, b: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = multiply;\n assert.deepEqual(candidate(148, 412),16);\n assert.deepEqual(candidate(19, 28),72);\n assert.deepEqual(candidate(2020, 1851),0);\n assert.deepEqual(candidate(14, -15),20);\n assert.deepEqual(candidate(76, 67),42);\n assert.deepEqual(candidate(17, 27),49);\n assert.deepEqual(candidate(0, 1),0);\n assert.deepEqual(candidate(0, 0),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "ts", - "prompt": "//Given array of numbers (of at least two elements), apply a linear transform to that array,\n// such that the smallest number will become 0 and the largest will become 1\n// >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n// [0.0, 0.25, 0.5, 0.75, 1.0]\nfunction rescale_to_unit(numbers: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = rescale_to_unit;\n assert.deepEqual(candidate([2.0, 49.9]),[0.0, 1.0]);\n assert.deepEqual(candidate([100.0, 49.9]),[1.0, 0.0]);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0]),[0.0, 0.25, 0.5, 0.75, 1.0]);\n assert.deepEqual(candidate([2.0, 1.0, 5.0, 3.0, 4.0]),[0.25, 0.0, 1.0, 0.5, 0.75]);\n assert.deepEqual(candidate([12.0, 11.0, 15.0, 13.0, 14.0]),[0.25, 0.0, 1.0, 0.5, 0.75]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "ts", - "prompt": "//Given a positive integer n, return the product of the odd digits.\n// Return 0 if all digits are even.\n// For example:\n// >>> digits(1)\n// 1\n// >>> digits(4)\n// 0\n// >>> digits(235)\n// 15\nfunction digits(n: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = digits;\n assert.deepEqual(candidate(5),5);\n assert.deepEqual(candidate(54),5);\n assert.deepEqual(candidate(120),1);\n assert.deepEqual(candidate(5014),5);\n assert.deepEqual(candidate(98765),315);\n assert.deepEqual(candidate(5576543),2625);\n assert.deepEqual(candidate(2468),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "ts", - "prompt": "//You will be given the name of a class (a string) and an array of extensions.\n// The extensions are to be used to load additional classes to the class. The\n// strength of the extension is as follows: Let CAP be the number of the uppercase\n// letters in the extension's name, and let SM be the number of lowercase letters \n// in the extension's name, the strength is given by the fraction CAP - SM. \n// You should find the strongest extension and return a string in this \n// format: ClassName.StrongestExtensionName.\n// If there are two or more extensions with the same strength, you should\n// choose the one that comes first in the array.\n// For example, if you are given \"Slices\" as the class and an array of the\n// extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n// return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n// (its strength is -1).\n// Example:\n// >>> Strongest_Extension(\"my_class\", [\"AA\", \"Be\", \"CC\"])\n// \"my_class.AA\"\nfunction Strongest_Extension(class_name: string, extensions: string[]): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = Strongest_Extension;\n assert.deepEqual(candidate(\"Watashi\", [\"tEN\", \"niNE\", \"eIGHt8OKe\"]),\"Watashi.eIGHt8OKe\");\n assert.deepEqual(candidate(\"Boku123\", [\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"]),\"Boku123.YEs.WeCaNe\");\n assert.deepEqual(candidate(\"__YESIMHERE\", [\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"]),\"__YESIMHERE.NuLl__\");\n assert.deepEqual(candidate(\"K\", [\"Ta\", \"TAR\", \"t234An\", \"cosSo\"]),\"K.TAR\");\n assert.deepEqual(candidate(\"__HAHA\", [\"Tab\", \"123\", \"781345\", \"-_-\"]),\"__HAHA.123\");\n assert.deepEqual(candidate(\"YameRore\", [\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"]),\"YameRore.okIWILL123\");\n assert.deepEqual(candidate(\"finNNalLLly\", [\"Die\", \"NowW\", \"Wow\", \"WoW\"]),\"finNNalLLly.WoW\");\n assert.deepEqual(candidate(\"_\", [\"Bb\", \"91245\"]),\"_.Bb\");\n assert.deepEqual(candidate(\"Sp\", [\"671235\", \"Bb\"]),\"Sp.671235\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "ts", - "prompt": "//Given a string representing a space separated lowercase letters, return an object\n// of the letter with the most repetition and containing the corresponding count.\n// If several letters have the same occurrence, return all of them.\n// Example:\n// >>> histogram(\"a b c\")\n// {\"a\": 1, \"b\": 1, \"c\": 1}\n// >>> histogram(\"a b b a\")\n// {\"a\": 2, \"b\": 2}\n// >>> histogram(\"a b c a b\")\n// {\"a\": 2, \"b\": 2}\n// >>> histogram(\"b b b b a\")\n// {\"b\": 4}\n// >>> histogram(\"\")\n// {}\nfunction histogram(test: string): {[key: string]: number} {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = histogram;\n assert.deepEqual(candidate(\"a b b a\"),{\"a\": 2, \"b\": 2});\n assert.deepEqual(candidate(\"a b c a b\"),{\"a\": 2, \"b\": 2});\n assert.deepEqual(candidate(\"a b c d g\"),{\"a\": 1, \"b\": 1, \"c\": 1, \"d\": 1, \"g\": 1});\n assert.deepEqual(candidate(\"r t g\"),{\"r\": 1, \"t\": 1, \"g\": 1});\n assert.deepEqual(candidate(\"b b b b a\"),{\"b\": 4});\n assert.deepEqual(candidate(\"r t g\"),{\"r\": 1, \"t\": 1, \"g\": 1});\n assert.deepEqual(candidate(\"\"),{});\n assert.deepEqual(candidate(\"a\"),{\"a\": 1});\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "ts", - "prompt": "//pairs_sum_to_zero takes an array of integers as an input.\n// it returns true if there are two distinct elements in the array that\n// sum to zero, and false otherwise.\n// >>> pairs_sum_to_zero([1, 3, 5, 0])\n// false\n// >>> pairs_sum_to_zero([1, 3, -2, 1])\n// false\n// >>> pairs_sum_to_zero([1, 2, 3, 7])\n// false\n// >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7])\n// true\n// >>> pairs_sum_to_zero([1])\n// false\nfunction pairs_sum_to_zero(l: number[]): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = pairs_sum_to_zero;\n assert.deepEqual(candidate([1, 3, 5, 0]),false);\n assert.deepEqual(candidate([1, 3, -2, 1]),false);\n assert.deepEqual(candidate([1, 2, 3, 7]),false);\n assert.deepEqual(candidate([2, 4, -5, 3, 5, 7]),true);\n assert.deepEqual(candidate([1]),false);\n assert.deepEqual(candidate([-3, 9, -1, 3, 2, 30]),true);\n assert.deepEqual(candidate([-3, 9, -1, 3, 2, 31]),true);\n assert.deepEqual(candidate([-3, 9, -1, 4, 2, 30]),false);\n assert.deepEqual(candidate([-3, 9, -1, 4, 2, 31]),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "ts", - "prompt": "//Write a function that accepts two arrays of strings and returns the array that has \n// total number of chars in the all strings of the array less than the other array.\n// if the two arrays have the same number of chars, return the first array.\n// Examples\n// >>> total_match([], [])\n// []\n// >>> total_match([\"hi\", \"admin\"], [\"hI\", \"Hi\"])\n// [\"hI\", \"Hi\"]\n// >>> total_match([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"])\n// [\"hi\", \"admin\"]\n// >>> total_match([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"])\n// [\"hI\", \"hi\", \"hi\"]\n// >>> total_match([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"])\n// [\"4\"]\nfunction total_match(lst1: string[], lst2: string[]): string[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = total_match;\n assert.deepEqual(candidate([], []),[]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\"]),[\"hi\", \"hi\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"]),[\"hi\", \"admin\"]);\n assert.deepEqual(candidate([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"]),[\"4\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hI\", \"Hi\"]),[\"hI\", \"Hi\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"]),[\"hI\", \"hi\", \"hi\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hii\"]),[\"hi\", \"admin\"]);\n assert.deepEqual(candidate([], [\"this\"]),[]);\n assert.deepEqual(candidate([\"this\"], []),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "ts", - "prompt": "//Circular shift the digits of the integer x, shift the digits right by shift\n// and return the result as a string.\n// If shift > number of digits, return digits reversed.\n// >>> circular_shift(12, 1)\n// \"21\"\n// >>> circular_shift(12, 2)\n// \"12\"\nfunction circular_shift(x: number, shift: number): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = circular_shift;\n assert.deepEqual(candidate(100, 2),\"001\");\n assert.deepEqual(candidate(12, 2),\"12\");\n assert.deepEqual(candidate(97, 8),\"79\");\n assert.deepEqual(candidate(12, 1),\"21\");\n assert.deepEqual(candidate(11, 101),\"11\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "ts", - "prompt": "//Return true is array elements are monotonically increasing or decreasing.\n// >>> monotonic([1, 2, 4, 20])\n// true\n// >>> monotonic([1, 20, 4, 10])\n// false\n// >>> monotonic([4, 1, 0, -10])\n// true\nfunction monotonic(l: number[]): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = monotonic;\n assert.deepEqual(candidate([1, 2, 4, 10]),true);\n assert.deepEqual(candidate([1, 2, 4, 20]),true);\n assert.deepEqual(candidate([1, 20, 4, 10]),false);\n assert.deepEqual(candidate([4, 1, 0, -10]),true);\n assert.deepEqual(candidate([4, 1, 1, 0]),true);\n assert.deepEqual(candidate([1, 2, 3, 2, 5, 60]),false);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 60]),true);\n assert.deepEqual(candidate([9, 9, 9, 9]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "ts", - "prompt": "//Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n// Example\n// >>> is_equal_to_sum_even(4)\n// false\n// >>> is_equal_to_sum_even(6)\n// false\n// >>> is_equal_to_sum_even(8)\n// true\nfunction is_equal_to_sum_even(n: number): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_equal_to_sum_even;\n assert.deepEqual(candidate(4),false);\n assert.deepEqual(candidate(6),false);\n assert.deepEqual(candidate(8),true);\n assert.deepEqual(candidate(10),true);\n assert.deepEqual(candidate(11),false);\n assert.deepEqual(candidate(12),true);\n assert.deepEqual(candidate(13),false);\n assert.deepEqual(candidate(16),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "ts", - "prompt": "//Input to this function is a string representing musical notes in a special ASCII format.\n// Your task is to parse this string and return array of integers corresponding to how many beats does each\n// not last.\n// Here is a legend:\n// 'o' - whole note, lasts four beats\n// 'o|' - half note, lasts two beats\n// '.|' - quater note, lasts one beat\n// >>> parse_music(\"o o| .| o| o| .| .| .| .| o o\")\n// [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\nfunction parse_music(music_string: string): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = parse_music;\n assert.deepEqual(candidate(\"\"),[]);\n assert.deepEqual(candidate(\"o o o o\"),[4, 4, 4, 4]);\n assert.deepEqual(candidate(\".| .| .| .|\"),[1, 1, 1, 1]);\n assert.deepEqual(candidate(\"o| o| .| .| o o o o\"),[2, 2, 1, 1, 4, 4, 4, 4]);\n assert.deepEqual(candidate(\"o| .| o| .| o o| o o|\"),[2, 1, 2, 1, 4, 2, 4, 2]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "ts", - "prompt": "//\"\n// This function will take an array of integers. For all entries in the array, the function shall square the integer entry if its index is a \n// multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n// change the entries in the array whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n// Examples:\n// >>> lst\n// [1, 2, 3]\n// >>> lst\n// []\n// >>> lst\n// [-1, -5, 2, -1, -5]\nfunction sum_squares(lst: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_squares;\n assert.deepEqual(candidate([1, 2, 3]),6);\n assert.deepEqual(candidate([1, 4, 9]),14);\n assert.deepEqual(candidate([]),0);\n assert.deepEqual(candidate([1, 1, 1, 1, 1, 1, 1, 1, 1]),9);\n assert.deepEqual(candidate([-1, -1, -1, -1, -1, -1, -1, -1, -1]),-3);\n assert.deepEqual(candidate([0]),0);\n assert.deepEqual(candidate([-1, -5, 2, -1, -5]),-126);\n assert.deepEqual(candidate([-56, -99, 1, 0, -2]),3030);\n assert.deepEqual(candidate([-1, 0, 0, 0, 0, 0, 0, 0, -1]),0);\n assert.deepEqual(candidate([-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37]),-14196);\n assert.deepEqual(candidate([-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10]),-1448);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "ts", - "prompt": "//triples_sum_to_zero takes an array of integers as an input.\n// it returns true if there are three distinct elements in the array that\n// sum to zero, and false otherwise.\n// >>> triples_sum_to_zero([1, 3, 5, 0])\n// false\n// >>> triples_sum_to_zero([1, 3, -2, 1])\n// true\n// >>> triples_sum_to_zero([1, 2, 3, 7])\n// false\n// >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n// true\n// >>> triples_sum_to_zero([1])\n// false\nfunction triples_sum_to_zero(l: number[]): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = triples_sum_to_zero;\n assert.deepEqual(candidate([1, 3, 5, 0]),false);\n assert.deepEqual(candidate([1, 3, 5, -1]),false);\n assert.deepEqual(candidate([1, 3, -2, 1]),true);\n assert.deepEqual(candidate([1, 2, 3, 7]),false);\n assert.deepEqual(candidate([1, 2, 5, 7]),false);\n assert.deepEqual(candidate([2, 4, -5, 3, 9, 7]),true);\n assert.deepEqual(candidate([1]),false);\n assert.deepEqual(candidate([1, 3, 5, -100]),false);\n assert.deepEqual(candidate([100, 3, 5, -100]),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "ts", - "prompt": "//brackets is a string of \"<\" and \">\".\n// return true if every opening bracket has a corresponding closing bracket.\n// >>> correct_bracketing(\"<\")\n// false\n// >>> correct_bracketing(\"<>\")\n// true\n// >>> correct_bracketing(\"<<><>>\")\n// true\n// >>> correct_bracketing(\"><<>\")\n// false\nfunction correct_bracketing(brackets: string): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = correct_bracketing;\n assert.deepEqual(candidate(\"<>\"),true);\n assert.deepEqual(candidate(\"<<><>>\"),true);\n assert.deepEqual(candidate(\"<><><<><>><>\"),true);\n assert.deepEqual(candidate(\"<><><<<><><>><>><<><><<>>>\"),true);\n assert.deepEqual(candidate(\"<<<><>>>>\"),false);\n assert.deepEqual(candidate(\"><<>\"),false);\n assert.deepEqual(candidate(\"<\"),false);\n assert.deepEqual(candidate(\"<<<<\"),false);\n assert.deepEqual(candidate(\">\"),false);\n assert.deepEqual(candidate(\"<<>\"),false);\n assert.deepEqual(candidate(\"<><><<><>><>><<>\"),false);\n assert.deepEqual(candidate(\"<><><<><>><>>><>\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "ts", - "prompt": "//Write a function that takes an array of numbers as input and returns \n// the number of elements in the array that are greater than 10 and both \n// first and last digits of a number are odd (1, 3, 5, 7, 9).\n// For example:\n// >>> specialFilter([15, -73, 14, -15])\n// 1\n// >>> specialFilter([33, -2, -3, 45, 21, 109])\n// 2\nfunction specialFilter(nums: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = specialFilter;\n assert.deepEqual(candidate([5, -2, 1, -5]),0);\n assert.deepEqual(candidate([15, -73, 14, -15]),1);\n assert.deepEqual(candidate([33, -2, -3, 45, 21, 109]),2);\n assert.deepEqual(candidate([43, -12, 93, 125, 121, 109]),4);\n assert.deepEqual(candidate([71, -2, -33, 75, 21, 19]),3);\n assert.deepEqual(candidate([1]),0);\n assert.deepEqual(candidate([]),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "ts", - "prompt": "//Given an object, return true if all keys are strings in lower \n// case or all keys are strings in upper case, else return false.\n// The function should return false is the given object is empty.\n// Examples:\n// >>> check_dict_case({\"a\": \"apple\", \"b\": \"banana\"})\n// true\n// >>> check_dict_case({\"a\": \"apple\", \"A\": \"banana\", \"B\": \"banana\"})\n// false\n// >>> check_dict_case({\"a\": \"apple\", 8: \"banana\", \"a\": \"apple\"})\n// false\n// >>> check_dict_case({\"Name\": \"John\", \"Age\": \"36\", \"City\": \"Houston\"})\n// false\n// >>> check_dict_case({\"STATE\": \"NC\", \"ZIP\": \"12345\"})\n// true\nfunction check_dict_case(dict: {[key: string]: string}): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = check_dict_case;\n assert.deepEqual(candidate({\"p\": \"pineapple\", \"b\": \"banana\"}),true);\n assert.deepEqual(candidate({\"p\": \"pineapple\", \"A\": \"banana\", \"B\": \"banana\"}),false);\n assert.deepEqual(candidate({\"p\": \"pineapple\", \"5\": \"banana\", \"a\": \"apple\"}),false);\n assert.deepEqual(candidate({\"Name\": \"John\", \"Age\": \"36\", \"City\": \"Houston\"}),false);\n assert.deepEqual(candidate({\"STATE\": \"NC\", \"ZIP\": \"12345\"}),true);\n assert.deepEqual(candidate({\"fruit\": \"Orange\", \"taste\": \"Sweet\"}),true);\n assert.deepEqual(candidate({}),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "ts", - "prompt": "//Given a string of words, return an array of words split on whitespace, if no whitespaces exists in the text you\n// should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n// alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n// Examples\n// >>> split_words(\"Hello world!\")\n// [\"Hello\", \"world!\"]\n// >>> split_words(\"Hello,world!\")\n// [\"Hello\", \"world!\"]\n// >>> split_words(\"abcdef\")\n// 3\nfunction split_words(txt: string): string[]| number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = split_words;\n assert.deepEqual(candidate(\"Hello world!\"),[\"Hello\", \"world!\"]);\n assert.deepEqual(candidate(\"Hello,world!\"),[\"Hello\", \"world!\"]);\n assert.deepEqual(candidate(\"Hello world,!\"),[\"Hello\", \"world,!\"]);\n assert.deepEqual(candidate(\"Hello,Hello,world !\"),[\"Hello,Hello,world\", \"!\"]);\n assert.deepEqual(candidate(\"abcdef\"),3);\n assert.deepEqual(candidate(\"aaabb\"),2);\n assert.deepEqual(candidate(\"aaaBb\"),1);\n assert.deepEqual(candidate(\"\"),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "ts", - "prompt": "//The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fibfib(0) == 0\n// fibfib(1) == 0\n// fibfib(2) == 1\n// fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n// Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n// >>> fibfib(1)\n// 0\n// >>> fibfib(5)\n// 4\n// >>> fibfib(8)\n// 24\nfunction fibfib(n: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fibfib;\n assert.deepEqual(candidate(2),1);\n assert.deepEqual(candidate(1),0);\n assert.deepEqual(candidate(5),4);\n assert.deepEqual(candidate(8),24);\n assert.deepEqual(candidate(10),81);\n assert.deepEqual(candidate(12),274);\n assert.deepEqual(candidate(14),927);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "ts", - "prompt": "//You are given an array of numbers.\n// You need to return the sum of squared numbers in the given array,\n// round each element in the array to the upper int(Ceiling) first.\n// Examples:\n// >>> lst([1.0, 2.0, 3.0])\n// 14\n// >>> lst([1.0, 4.0, 9.0])\n// 98\n// >>> lst([1.0, 3.0, 5.0, 7.0])\n// 84\n// >>> lst([1.4, 4.2, 0.0])\n// 29\n// >>> lst([-2.4, 1.0, 1.0])\n// 6\nfunction sum_squares(lst: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_squares;\n assert.deepEqual(candidate([1.0, 2.0, 3.0]),14);\n assert.deepEqual(candidate([1.0, 2.0, 3.0]),14);\n assert.deepEqual(candidate([1.0, 3.0, 5.0, 7.0]),84);\n assert.deepEqual(candidate([1.4, 4.2, 0.0]),29);\n assert.deepEqual(candidate([-2.4, 1.0, 1.0]),6);\n assert.deepEqual(candidate([100.0, 1.0, 15.0, 2.0]),10230);\n assert.deepEqual(candidate([10000.0, 10000.0]),200000000);\n assert.deepEqual(candidate([-1.4, 4.6, 6.3]),75);\n assert.deepEqual(candidate([-1.4, 17.9, 18.9, 19.9]),1086);\n assert.deepEqual(candidate([0.0]),0);\n assert.deepEqual(candidate([-1.0]),1);\n assert.deepEqual(candidate([-1.0, 1.0, 0.0]),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_85_add", - "language": "ts", - "prompt": "//Given a non-empty array of integers lst. add the even elements that are at odd indices..\n// Examples:\n// >>> add([4, 2, 6, 7])\n// 2\nfunction add(lst: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = add;\n assert.deepEqual(candidate([4, 88]),88);\n assert.deepEqual(candidate([4, 5, 6, 7, 2, 122]),122);\n assert.deepEqual(candidate([4, 0, 6, 7]),0);\n assert.deepEqual(candidate([4, 4, 6, 8]),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "ts", - "prompt": "//Return sorted unique elements in an array\n// >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123])\n// [0, 2, 3, 5, 9, 123]\nfunction unique(l: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = unique;\n assert.deepEqual(candidate([5, 3, 5, 2, 3, 3, 9, 0, 123]),[0, 2, 3, 5, 9, 123]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "ts", - "prompt": "//Given a string text, replace all spaces in it with underscores, \n// and if a string has more than 2 consecutive spaces, \n// then replace all consecutive spaces with - \n// >>> fix_spaces(\" Example\")\n// \"Example\"\n// >>> fix_spaces(\" Example 1\")\n// \"Example_1\"\n// >>> fix_spaces(\" Example 2\")\n// \"_Example_2\"\n// >>> fix_spaces(\" Example 3\")\n// \"_Example-3\"\nfunction fix_spaces(text: string): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fix_spaces;\n assert.deepEqual(candidate(\"Example\"),\"Example\");\n assert.deepEqual(candidate(\"Mudasir Hanif \"),\"Mudasir_Hanif_\");\n assert.deepEqual(candidate(\"Yellow Yellow Dirty Fellow\"),\"Yellow_Yellow__Dirty__Fellow\");\n assert.deepEqual(candidate(\"Exa mple\"),\"Exa-mple\");\n assert.deepEqual(candidate(\" Exa 1 2 2 mple\"),\"-Exa_1_2_2_mple\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "ts", - "prompt": "//Return 2^n modulo p (be aware of numerics).\n// >>> modp(3, 5)\n// 3\n// >>> modp(1101, 101)\n// 2\n// >>> modp(0, 101)\n// 1\n// >>> modp(3, 11)\n// 8\n// >>> modp(100, 101)\n// 1\nfunction modp(n: number, p: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = modp;\n assert.deepEqual(candidate(3, 5),3);\n assert.deepEqual(candidate(1101, 101),2);\n assert.deepEqual(candidate(0, 101),1);\n assert.deepEqual(candidate(3, 11),8);\n assert.deepEqual(candidate(100, 101),1);\n assert.deepEqual(candidate(30, 5),4);\n assert.deepEqual(candidate(31, 5),3);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "ts", - "prompt": "//You have to write a function which validates a given date string and\n// returns true if the date is valid otherwise false.\n// The date is valid if all of the following rules are satisfied:\n// 1. The date string is not empty.\n// 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n// 3. The months should not be less than 1 or higher than 12.\n// 4. The date should be in the format: mm-dd-yyyy\n// >>> valid_date(\"03-11-2000\")\n// true\n// >>> valid_date(\"15-01-2012\")\n// false\n// >>> valid_date(\"04-0-2040\")\n// false\n// >>> valid_date(\"06-04-2020\")\n// true\n// >>> valid_date(\"06/04/2020\")\n// false\nfunction valid_date(date: string): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = valid_date;\n assert.deepEqual(candidate(\"03-11-2000\"),true);\n assert.deepEqual(candidate(\"15-01-2012\"),false);\n assert.deepEqual(candidate(\"04-0-2040\"),false);\n assert.deepEqual(candidate(\"06-04-2020\"),true);\n assert.deepEqual(candidate(\"01-01-2007\"),true);\n assert.deepEqual(candidate(\"03-32-2011\"),false);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"04-31-3000\"),false);\n assert.deepEqual(candidate(\"06-06-2005\"),true);\n assert.deepEqual(candidate(\"21-31-2000\"),false);\n assert.deepEqual(candidate(\"04-12-2003\"),true);\n assert.deepEqual(candidate(\"04122003\"),false);\n assert.deepEqual(candidate(\"20030412\"),false);\n assert.deepEqual(candidate(\"2003-04\"),false);\n assert.deepEqual(candidate(\"2003-04-12\"),false);\n assert.deepEqual(candidate(\"04-2003\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "ts", - "prompt": "//Write a function that takes a string and returns an ordered version of it.\n// Ordered version of string, is a string where all words (separated by space)\n// are replaced by a new word where all the characters arranged in\n// ascending order based on ascii value.\n// Note: You should keep the order of words and blank spaces in the sentence.\n// For example:\n// >>> anti_shuffle(\"Hi\")\n// \"Hi\"\n// >>> anti_shuffle(\"hello\")\n// \"ehllo\"\n// >>> anti_shuffle(\"Hello World!!!\")\n// \"Hello !!!Wdlor\"\nfunction anti_shuffle(s: string): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = anti_shuffle;\n assert.deepEqual(candidate(\"Hi\"),\"Hi\");\n assert.deepEqual(candidate(\"hello\"),\"ehllo\");\n assert.deepEqual(candidate(\"number\"),\"bemnru\");\n assert.deepEqual(candidate(\"abcd\"),\"abcd\");\n assert.deepEqual(candidate(\"Hello World!!!\"),\"Hello !!!Wdlor\");\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"Hi. My name is Mister Robot. How are you?\"),\".Hi My aemn is Meirst .Rboot How aer ?ouy\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "ts", - "prompt": "//Given an array of numbers, return whether or not they are sorted\n// in ascending order. If array has more than 1 duplicate of the same\n// number, return false. Assume no negative numbers and only integers.\n// Examples\n// >>> is_sorted([5])\n// true\n// >>> is_sorted([1, 2, 3, 4, 5])\n// true\n// >>> is_sorted([1, 3, 2, 4, 5])\n// false\n// >>> is_sorted([1, 2, 3, 4, 5, 6])\n// true\n// >>> is_sorted([1, 2, 3, 4, 5, 6, 7])\n// true\n// >>> is_sorted([1, 3, 2, 4, 5, 6, 7])\n// false\n// >>> is_sorted([1, 2, 2, 3, 3, 4])\n// true\n// >>> is_sorted([1, 2, 2, 2, 3, 4])\n// false\nfunction is_sorted(lst: number[]): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_sorted;\n assert.deepEqual(candidate([5]),true);\n assert.deepEqual(candidate([1, 2, 3, 4, 5]),true);\n assert.deepEqual(candidate([1, 3, 2, 4, 5]),false);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6]),true);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6, 7]),true);\n assert.deepEqual(candidate([1, 3, 2, 4, 5, 6, 7]),false);\n assert.deepEqual(candidate([]),true);\n assert.deepEqual(candidate([1]),true);\n assert.deepEqual(candidate([3, 2, 1]),false);\n assert.deepEqual(candidate([1, 2, 2, 2, 3, 4]),false);\n assert.deepEqual(candidate([1, 2, 3, 3, 3, 4]),false);\n assert.deepEqual(candidate([1, 2, 2, 3, 3, 4]),true);\n assert.deepEqual(candidate([1, 2, 3, 4]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "ts", - "prompt": "//You are given a string s.\n// Your task is to check if the string is hapts or not.\n// A string is hapts if its length is at least 3 and every 3 consecutive letters are distinct\n// For example:\n// >>> is_happy(\"a\")\n// false\n// >>> is_happy(\"aa\")\n// false\n// >>> is_happy(\"abcd\")\n// true\n// >>> is_happy(\"aabb\")\n// false\n// >>> is_happy(\"adb\")\n// true\n// >>> is_happy(\"xyy\")\n// false\nfunction is_happy(s: string): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_happy;\n assert.deepEqual(candidate(\"a\"),false);\n assert.deepEqual(candidate(\"aa\"),false);\n assert.deepEqual(candidate(\"abcd\"),true);\n assert.deepEqual(candidate(\"aabb\"),false);\n assert.deepEqual(candidate(\"adb\"),true);\n assert.deepEqual(candidate(\"xyy\"),false);\n assert.deepEqual(candidate(\"iopaxpoi\"),true);\n assert.deepEqual(candidate(\"iopaxioi\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "ts", - "prompt": "//Write a function that returns true if the object q will fly, and false otherwise.\n// The object q will fly if it's balanced (it is a palindromic array) and the sum of its elements is less than or equal the maximum possible weight w.\n// Example:\n// >>> will_it_fly([1, 2], 5)\n// false\n// # 1+2 is less than the maximum possible weight, but it's unbalanced.\n// >>> will_it_fly([3, 2, 3], 1)\n// false\n// # it's balanced, but 3+2+3 is more than the maximum possible weight.\n// >>> will_it_fly([3, 2, 3], 9)\n// true\n// # 3+2+3 is less than the maximum possible weight, and it's balanced.\n// >>> will_it_fly([3], 5)\n// true\n// # 3 is less than the maximum possible weight, and it's balanced.\nfunction will_it_fly(q: number[], w: number): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = will_it_fly;\n assert.deepEqual(candidate([3, 2, 3], 9),true);\n assert.deepEqual(candidate([1, 2], 5),false);\n assert.deepEqual(candidate([3], 5),true);\n assert.deepEqual(candidate([3, 2, 3], 1),false);\n assert.deepEqual(candidate([1, 2, 3], 6),false);\n assert.deepEqual(candidate([5], 5),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "ts", - "prompt": "//Given an array of non-negative integers, return a cots of the given array after sorting,\n// you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n// or sort it in descending order if the sum( first index value, last index value) is even.\n// Note:\n// * don't change the given array.\n// Examples:\n// >>> sort_array([])\n// []\n// >>> sort_array([5])\n// [5]\n// >>> sort_array([2, 4, 3, 0, 1, 5])\n// [0, 1, 2, 3, 4, 5]\n// >>> sort_array([2, 4, 3, 0, 1, 5, 6])\n// [6, 5, 4, 3, 2, 1, 0]\nfunction sort_array(array: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_array;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([5]),[5]);\n assert.deepEqual(candidate([2, 4, 3, 0, 1, 5]),[0, 1, 2, 3, 4, 5]);\n assert.deepEqual(candidate([2, 4, 3, 0, 1, 5, 6]),[6, 5, 4, 3, 2, 1, 0]);\n assert.deepEqual(candidate([2, 1]),[1, 2]);\n assert.deepEqual(candidate([15, 42, 87, 32, 11, 0]),[0, 11, 15, 32, 42, 87]);\n assert.deepEqual(candidate([21, 14, 23, 11]),[23, 21, 14, 11]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "ts", - "prompt": "//Implement a function that takes an non-negative integer and returns an array of the first n\n// integers that are prime numbers and less than n.\n// for example:\n// >>> count_up_to(5)\n// [2, 3]\n// >>> count_up_to(11)\n// [2, 3, 5, 7]\n// >>> count_up_to(0)\n// []\n// >>> count_up_to(20)\n// [2, 3, 5, 7, 11, 13, 17, 19]\n// >>> count_up_to(1)\n// []\n// >>> count_up_to(18)\n// [2, 3, 5, 7, 11, 13, 17]\nfunction count_up_to(n: number): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_up_to;\n assert.deepEqual(candidate(5),[2, 3]);\n assert.deepEqual(candidate(6),[2, 3, 5]);\n assert.deepEqual(candidate(7),[2, 3, 5]);\n assert.deepEqual(candidate(10),[2, 3, 5, 7]);\n assert.deepEqual(candidate(0),[]);\n assert.deepEqual(candidate(22),[2, 3, 5, 7, 11, 13, 17, 19]);\n assert.deepEqual(candidate(1),[]);\n assert.deepEqual(candidate(18),[2, 3, 5, 7, 11, 13, 17]);\n assert.deepEqual(candidate(47),[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43]);\n assert.deepEqual(candidate(101),[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "ts", - "prompt": "//Out of array of strings, return the longest one. Return the first one in case of multiple\n// strings of the same length. Return undefined in case the input array is empty.\n// >>> longest([])\n// undefined\n// >>> longest([\"a\", \"b\", \"c\"])\n// \"a\"\n// >>> longest([\"a\", \"bb\", \"ccc\"])\n// \"ccc\"\nfunction longest(strings: string[]): string | undefined {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = longest;\n assert.deepEqual(candidate([]),undefined);\n assert.deepEqual(candidate([\"x\", \"y\", \"z\"]),\"x\");\n assert.deepEqual(candidate([\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"]),\"zzzz\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "ts", - "prompt": "//Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n// reverse the resulting array, and then replace each digit by its corresponding name from\n// \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n// For example:\n// >>> by_length([2, 1, 1, 4, 5, 8, 2, 3])\n// [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n// If the array is empty, return an empty array:\n// >>> by_length([])\n// []\n// If the array has any strange number ignore it:\n// >>> by_length([1, -1, 55])\n// [\"One\"]\nfunction by_length(arr: number[]): string[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = by_length;\n assert.deepEqual(candidate([2, 1, 1, 4, 5, 8, 2, 3]),[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, -1, 55]),[\"One\"]);\n assert.deepEqual(candidate([1, -1, 3, 2]),[\"Three\", \"Two\", \"One\"]);\n assert.deepEqual(candidate([9, 4, 8]),[\"Nine\", \"Eight\", \"Four\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_106_f", - "language": "ts", - "prompt": "//Implement the function f that takes n as a parameter,\n// and returns an array of size n, such that the value of the element at index i is the factorial of i if i is even\n// or the sum of numbers from 1 to i otherwise.\n// i starts from 1.\n// the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n// Example:\n// >>> f(5)\n// [1, 2, 6, 24, 15]\nfunction f(n: number): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = f;\n assert.deepEqual(candidate(5),[1, 2, 6, 24, 15]);\n assert.deepEqual(candidate(7),[1, 2, 6, 24, 15, 720, 28]);\n assert.deepEqual(candidate(1),[1]);\n assert.deepEqual(candidate(3),[1, 2, 6]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "ts", - "prompt": "//Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n// >>> fizz_buzz(50)\n// 0\n// >>> fizz_buzz(78)\n// 2\n// >>> fizz_buzz(79)\n// 3\nfunction fizz_buzz(n: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fizz_buzz;\n assert.deepEqual(candidate(50),0);\n assert.deepEqual(candidate(78),2);\n assert.deepEqual(candidate(79),3);\n assert.deepEqual(candidate(100),3);\n assert.deepEqual(candidate(200),6);\n assert.deepEqual(candidate(4000),192);\n assert.deepEqual(candidate(10000),639);\n assert.deepEqual(candidate(100000),8026);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "ts", - "prompt": "//Given a positive floating point number, it can be decomposed into\n// and integer part (largest integer smaller than given number) and decimals\n// (leftover part always smaller than 1).\n// Return the decimal part of the number.\n// >>> truncate_number(3.5)\n// 0.5\nfunction truncate_number(number: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = truncate_number;\n assert.deepEqual(candidate(3.5),0.5);\n assert.deepEqual(candidate(1.25),0.25);\n assert.deepEqual(candidate(123.0),0.0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "ts", - "prompt": "//For a given array of integers, return an array consisting of a sum and a product of all the integers in an array.\n// Empty sum should be equal to 0 and empty product should be equal to 1.\n// >>> sum_product([])\n// [0, 1]\n// >>> sum_product([1, 2, 3, 4])\n// [10, 24]\nfunction sum_product(numbers: number[]): [number, number] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_product;\n assert.deepEqual(candidate([]),[0, 1]);\n assert.deepEqual(candidate([1, 1, 1]),[3, 1]);\n assert.deepEqual(candidate([100, 0]),[100, 0]);\n assert.deepEqual(candidate([3, 5, 7]),[15, 105]);\n assert.deepEqual(candidate([10]),[10, 10]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "ts", - "prompt": "//You are given a 2 dimensional data, as a nested arrays,\n// which is similar to matrix, however, unlike matrices,\n// each row may contain a different number of columns.\n// Given lst, and integer x, find integers x in the array,\n// and return array of arrays, [(x1, y1), (x2, y2) ...] such that\n// each array is a coordinate - (row, columns), starting with 0.\n// Sort coordinates initially by rows in ascending order.\n// Also, sort coordinates of the row by columns in descending order.\n// Examples:\n// >>> get_row([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1)\n// [[0, 0], [1, 4], [1, 0], [2, 5], [2, 0]]\n// >>> get_row([], 1)\n// []\n// >>> get_row([[], [1], [1, 2, 3]], 3)\n// [[2, 2]]\nfunction get_row(lst: number[][], x: number): [number, number][] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_row;\n assert.deepEqual(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1),[[0, 0], [1, 4], [1, 0], [2, 5], [2, 0]]);\n assert.deepEqual(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6]], 2),[[0, 1], [1, 1], [2, 1], [3, 1], [4, 1], [5, 1]]);\n assert.deepEqual(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 1, 3, 4, 5, 6], [1, 2, 1, 4, 5, 6], [1, 2, 3, 1, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1),[[0, 0], [1, 0], [2, 1], [2, 0], [3, 2], [3, 0], [4, 3], [4, 0], [5, 4], [5, 0], [6, 5], [6, 0]]);\n assert.deepEqual(candidate([], 1),[]);\n assert.deepEqual(candidate([[1]], 2),[]);\n assert.deepEqual(candidate([[], [1], [1, 2, 3]], 3),[[2, 2]]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "ts", - "prompt": "//You're a hungry rabbit, and you already have eaten a certain number of carrots,\n// but now you need to eat more carrots to complete the day's meals.\n// you should return an array of [ total number of eaten carrots after your meals,\n// the number of carrots left after your meals ]\n// if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n// Example:\n// >>> eat(5, 6, 10)\n// [11, 4]\n// >>> eat(4, 8, 9)\n// [12, 1]\n// >>> eat(1, 10, 10)\n// [11, 0]\n// >>> eat(2, 11, 5)\n// [7, 0]\n// Variables:\n// @number : integer\n// the number of carrots that you have eaten.\n// @need : integer\n// the number of carrots that you need to eat.\n// @remaining : integer\n// the number of remaining carrots thet exist in stock\n// Constrain:\n// * 0 <= number <= 1000\n// * 0 <= need <= 1000\n// * 0 <= remaining <= 1000\n// Have fun :)\nfunction eat(number: number, need: number, remaining: number): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = eat;\n assert.deepEqual(candidate(5, 6, 10),[11, 4]);\n assert.deepEqual(candidate(4, 8, 9),[12, 1]);\n assert.deepEqual(candidate(1, 10, 10),[11, 0]);\n assert.deepEqual(candidate(2, 11, 5),[7, 0]);\n assert.deepEqual(candidate(4, 5, 7),[9, 2]);\n assert.deepEqual(candidate(4, 5, 1),[5, 0]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "ts", - "prompt": "//Given a positive integer N, return the total sum of its digits in binary.\n// Example\n// >>> solve(1000)\n// \"1\"\n// >>> solve(150)\n// \"110\"\n// >>> solve(147)\n// \"1100\"\n// Variables:\n// @N integer\n// Constraints: 0 \u2264 N \u2264 10000.\n// Output:\n// a string of binary number\nfunction solve(N: number): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = solve;\n assert.deepEqual(candidate(1000),\"1\");\n assert.deepEqual(candidate(150),\"110\");\n assert.deepEqual(candidate(147),\"1100\");\n assert.deepEqual(candidate(333),\"1001\");\n assert.deepEqual(candidate(963),\"10010\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "ts", - "prompt": "//You are given an array of integers.\n// You need to find the largest prime value and return the sum of its digits.\n// Examples:\n// >>> skjkasdkd([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3])\n// 10\n// >>> skjkasdkd([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1])\n// 25\n// >>> skjkasdkd([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3])\n// 13\n// >>> skjkasdkd([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6])\n// 11\n// >>> skjkasdkd([0, 81, 12, 3, 1, 21])\n// 3\n// >>> skjkasdkd([0, 8, 1, 2, 1, 7])\n// 7\nfunction skjkasdkd(lst: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = skjkasdkd;\n assert.deepEqual(candidate([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]),10);\n assert.deepEqual(candidate([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]),25);\n assert.deepEqual(candidate([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]),13);\n assert.deepEqual(candidate([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]),11);\n assert.deepEqual(candidate([0, 81, 12, 3, 1, 21]),3);\n assert.deepEqual(candidate([0, 8, 1, 2, 1, 7]),7);\n assert.deepEqual(candidate([8191]),19);\n assert.deepEqual(candidate([8191, 123456, 127, 7]),19);\n assert.deepEqual(candidate([127, 97, 8192]),10);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "ts", - "prompt": "//Given an array arr of integers, find the minimum number of elements that\n// need to be changed to make the array palindromic. A palindromic array is an array that\n// is read the same backwards and forwards. In one change, you can change one element to any other element.\n// For example:\n// >>> smallest_change([1, 2, 3, 5, 4, 7, 9, 6])\n// 4\n// >>> smallest_change([1, 2, 3, 4, 3, 2, 2])\n// 1\n// >>> smallest_change([1, 2, 3, 2, 1])\n// 0\nfunction smallest_change(arr: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = smallest_change;\n assert.deepEqual(candidate([1, 2, 3, 5, 4, 7, 9, 6]),4);\n assert.deepEqual(candidate([1, 2, 3, 4, 3, 2, 2]),1);\n assert.deepEqual(candidate([1, 4, 2]),1);\n assert.deepEqual(candidate([1, 4, 4, 2]),1);\n assert.deepEqual(candidate([1, 2, 3, 2, 1]),0);\n assert.deepEqual(candidate([3, 1, 1, 3]),0);\n assert.deepEqual(candidate([1]),0);\n assert.deepEqual(candidate([0, 1]),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "ts", - "prompt": "//It is the last week of the semester and the teacher has to give the grades\n// to students. The teacher has been making her own algorithm for grading.\n// The only problem is, she has lost the code she used for grading.\n// She has given you an array of GPAs for some students and you have to write \n// a function that can output an array of letter grades using the following table:\n// GPA | Letter grade\n// 4.0 A+\n// > 3.7 A \n// > 3.3 A- \n// > 3.0 B+\n// > 2.7 B \n// > 2.3 B-\n// > 2.0 C+\n// > 1.7 C\n// > 1.3 C-\n// > 1.0 D+ \n// > 0.7 D \n// > 0.0 D-\n// 0.0 E\n// Example:\n// >>> grade_equation([4.0, 3, 1.7, 2, 3.5])\n// [\"A+\", \"B\", \"C-\", \"C\", \"A-\"]\nfunction numerical_letter_grade(grades: number[]): string[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = numerical_letter_grade;\n assert.deepEqual(candidate([4.0, 3, 1.7, 2, 3.5]),[\"A+\", \"B\", \"C-\", \"C\", \"A-\"]);\n assert.deepEqual(candidate([1.2]),[\"D+\"]);\n assert.deepEqual(candidate([0.5]),[\"D-\"]);\n assert.deepEqual(candidate([0.0]),[\"E\"]);\n assert.deepEqual(candidate([1.0, 0.3, 1.5, 2.8, 3.3]),[\"D\", \"D-\", \"C-\", \"B\", \"B+\"]);\n assert.deepEqual(candidate([0.0, 0.7]),[\"E\", \"D-\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "ts", - "prompt": "//Given the lengths of the three sides of a triangle. Return the area of\n// the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n// Otherwise return -1\n// Three sides make a valid triangle when the sum of any two sides is greater \n// than the third side.\n// Example:\n// >>> triangle_area(3, 4, 5)\n// 6.0\n// >>> triangle_area(1, 2, 10)\n// -1\nfunction triangle_area(a: number, b: number, c: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = triangle_area;\n assert.deepEqual(candidate(3, 4, 5),6.0);\n assert.deepEqual(candidate(1, 2, 10),-1);\n assert.deepEqual(candidate(4, 8, 5),8.18);\n assert.deepEqual(candidate(2, 2, 2),1.73);\n assert.deepEqual(candidate(1, 2, 3),-1);\n assert.deepEqual(candidate(10, 5, 7),16.25);\n assert.deepEqual(candidate(2, 6, 3),-1);\n assert.deepEqual(candidate(1, 1, 1),0.43);\n assert.deepEqual(candidate(2, 2, 10),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "ts", - "prompt": "//Check if two words have the same characters.\n// >>> same_chars(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\")\n// true\n// >>> same_chars(\"abcd\", \"dddddddabc\")\n// true\n// >>> same_chars(\"dddddddabc\", \"abcd\")\n// true\n// >>> same_chars(\"eabcd\", \"dddddddabc\")\n// false\n// >>> same_chars(\"abcd\", \"dddddddabce\")\n// false\n// >>> same_chars(\"eabcdzzzz\", \"dddzzzzzzzddddabc\")\n// false\nfunction same_chars(s0: string, s1: string): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = same_chars;\n assert.deepEqual(candidate(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\"),true);\n assert.deepEqual(candidate(\"abcd\", \"dddddddabc\"),true);\n assert.deepEqual(candidate(\"dddddddabc\", \"abcd\"),true);\n assert.deepEqual(candidate(\"eabcd\", \"dddddddabc\"),false);\n assert.deepEqual(candidate(\"abcd\", \"dddddddabcf\"),false);\n assert.deepEqual(candidate(\"eabcdzzzz\", \"dddzzzzzzzddddabc\"),false);\n assert.deepEqual(candidate(\"aabb\", \"aaccc\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "ts", - "prompt": "//Given an array of integers nums, find the minimum sum of any non-empty sub-array\n// of nums.\n// Example\n// >>> minSubArraySum([2, 3, 4, 1, 2, 4])\n// 1\n// >>> minSubArraySum([-1, -2, -3])\n// -6\nfunction minSubArraySum(nums: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = minSubArraySum;\n assert.deepEqual(candidate([2, 3, 4, 1, 2, 4]),1);\n assert.deepEqual(candidate([-1, -2, -3]),-6);\n assert.deepEqual(candidate([-1, -2, -3, 2, -10]),-14);\n assert.deepEqual(candidate([-9999999999999999]),-9999999999999999);\n assert.deepEqual(candidate([0, 10, 20, 1000000]),0);\n assert.deepEqual(candidate([-1, -2, -3, 10, -5]),-6);\n assert.deepEqual(candidate([100, -1, -2, -3, 10, -5]),-6);\n assert.deepEqual(candidate([10, 11, 13, 8, 3, 4]),3);\n assert.deepEqual(candidate([100, -33, 32, -1, 0, -2]),-33);\n assert.deepEqual(candidate([-10]),-10);\n assert.deepEqual(candidate([7]),7);\n assert.deepEqual(candidate([1, -1]),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "ts", - "prompt": "//Given a string s and a natural number n, you have been tasked to implement \n// a function that returns an array of all words from string s that contain exactly \n// n consonants, in order these words appear in the string s.\n// If the string s is empty then the function should return an empty array.\n// Note: you may assume the input string contains only letters and spaces.\n// Examples:\n// >>> select_words(\"Mary had a little lamb\", 4)\n// [\"little\"]\n// >>> select_words(\"Mary had a little lamb\", 3)\n// [\"Mary\", \"lamb\"]\n// >>> select_words(\"simple white space\", 2)\n// []\n// >>> select_words(\"Hello world\", 4)\n// [\"world\"]\n// >>> select_words(\"Uncle sam\", 3)\n// [\"Uncle\"]\nfunction select_words(s: string, n: number): string[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = select_words;\n assert.deepEqual(candidate(\"Mary had a little lamb\", 4),[\"little\"]);\n assert.deepEqual(candidate(\"Mary had a little lamb\", 3),[\"Mary\", \"lamb\"]);\n assert.deepEqual(candidate(\"simple white space\", 2),[]);\n assert.deepEqual(candidate(\"Hello world\", 4),[\"world\"]);\n assert.deepEqual(candidate(\"Uncle sam\", 3),[\"Uncle\"]);\n assert.deepEqual(candidate(\"\", 4),[]);\n assert.deepEqual(candidate(\"a b c d e f\", 1),[\"b\", \"c\", \"d\", \"f\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "ts", - "prompt": "//Return array of all prefixes from shortest to longest of the input string\n// >>> all_prefixes(\"abc\")\n// [\"a\", \"ab\", \"abc\"]\nfunction all_prefixes(string: string): string[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = all_prefixes;\n assert.deepEqual(candidate(\"\"),[]);\n assert.deepEqual(candidate(\"asdfgh\"),[\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"]);\n assert.deepEqual(candidate(\"WWW\"),[\"W\", \"WW\", \"WWW\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "ts", - "prompt": "//Create a function that takes a value (string) representing a number\n// and returns the closest integer to it. If the number is equidistant\n// from two integers, round it away from zero.\n// Examples\n// >>> closest_integer(\"10\")\n// 10\n// >>> closest_integer(\"15.3\")\n// 15\n// Note:\n// Rounding away from zero means that if the given number is equidistant\n// from two integers, the one you should return is the one that is the\n// farthest from zero. For example closest_integer(\"14.5\") should\n// return 15 and closest_integer(\"-14.5\") should return -15.\nfunction closest_integer(value: string): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = closest_integer;\n assert.deepEqual(candidate(\"10\"),10);\n assert.deepEqual(candidate(\"14.5\"),15);\n assert.deepEqual(candidate(\"-15.5\"),-16);\n assert.deepEqual(candidate(\"15.3\"),15);\n assert.deepEqual(candidate(\"0\"),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "ts", - "prompt": "//Create a function which takes a string representing a file's name, and returns\n// 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n// A file's name is considered to be valid if and only if all the following conditions \n// are met:\n// - There should not be more than three digits ('0'-'9') in the file's name.\n// - The file's name contains exactly one dot '.'\n// - The substring before the dot should not be empty, and it starts with a letter from \n// the latin alphapet ('a'-'z' and 'A'-'Z').\n// - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n// Examples:\n// >>> file_name_check(\"example.txt\")\n// \"Yes\"\n// >>> file_name_check(\"1example.dll\")\n// \"No\"\nfunction file_name_check(file_name: string): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = file_name_check;\n assert.deepEqual(candidate(\"example.txt\"),\"Yes\");\n assert.deepEqual(candidate(\"1example.dll\"),\"No\");\n assert.deepEqual(candidate(\"s1sdf3.asd\"),\"No\");\n assert.deepEqual(candidate(\"K.dll\"),\"Yes\");\n assert.deepEqual(candidate(\"MY16FILE3.exe\"),\"Yes\");\n assert.deepEqual(candidate(\"His12FILE94.exe\"),\"No\");\n assert.deepEqual(candidate(\"_Y.txt\"),\"No\");\n assert.deepEqual(candidate(\"?aREYA.exe\"),\"No\");\n assert.deepEqual(candidate(\"/this_is_valid.dll\"),\"No\");\n assert.deepEqual(candidate(\"this_is_valid.wow\"),\"No\");\n assert.deepEqual(candidate(\"this_is_valid.txt\"),\"Yes\");\n assert.deepEqual(candidate(\"this_is_valid.txtexe\"),\"No\");\n assert.deepEqual(candidate(\"#this2_i4s_5valid.ten\"),\"No\");\n assert.deepEqual(candidate(\"@this1_is6_valid.exe\"),\"No\");\n assert.deepEqual(candidate(\"this_is_12valid.6exe4.txt\"),\"No\");\n assert.deepEqual(candidate(\"all.exe.txt\"),\"No\");\n assert.deepEqual(candidate(\"I563_No.exe\"),\"Yes\");\n assert.deepEqual(candidate(\"Is3youfault.txt\"),\"Yes\");\n assert.deepEqual(candidate(\"no_one#knows.dll\"),\"Yes\");\n assert.deepEqual(candidate(\"1I563_Yes3.exe\"),\"No\");\n assert.deepEqual(candidate(\"I563_Yes3.txtt\"),\"No\");\n assert.deepEqual(candidate(\"final..txt\"),\"No\");\n assert.deepEqual(candidate(\"final132\"),\"No\");\n assert.deepEqual(candidate(\"_f4indsartal132.\"),\"No\");\n assert.deepEqual(candidate(\".txt\"),\"No\");\n assert.deepEqual(candidate(\"s.\"),\"No\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "ts", - "prompt": "//You are given two intervals,\n// where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n// The given intervals are closed which means that the interval (start, end)\n// includes both start and end.\n// For each given interval, it is assumed that its start is less or equal its end.\n// Your task is to determine whether the length of intersection of these two \n// intervals is a prime number.\n// Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n// which its length is 1, which not a prime number.\n// If the length of the intersection is a prime number, return \"YES\",\n// otherwise, return \"NO\".\n// If the two intervals don't intersect, return \"NO\".\n// [input/output] samples:\n// >>> intersection([1, 2], [2, 3])\n// \"NO\"\n// >>> intersection([-1, 1], [0, 4])\n// \"NO\"\n// >>> intersection([-3, -1], [-5, 5])\n// \"YES\"\nfunction intersection(interval1: [number, number], interval2: [number, number]): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = intersection;\n assert.deepEqual(candidate([1, 2], [2, 3]),\"NO\");\n assert.deepEqual(candidate([-1, 1], [0, 4]),\"NO\");\n assert.deepEqual(candidate([-3, -1], [-5, 5]),\"YES\");\n assert.deepEqual(candidate([-2, 2], [-4, 0]),\"YES\");\n assert.deepEqual(candidate([-11, 2], [-1, -1]),\"NO\");\n assert.deepEqual(candidate([1, 2], [3, 5]),\"NO\");\n assert.deepEqual(candidate([1, 2], [1, 2]),\"NO\");\n assert.deepEqual(candidate([-2, -2], [-3, -2]),\"NO\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "ts", - "prompt": "//Return the largest prime factor of n. Assume n > 1 and is not a prime.\n// >>> largest_prime_factor(13195)\n// 29\n// >>> largest_prime_factor(2048)\n// 2\nfunction largest_prime_factor(n: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = largest_prime_factor;\n assert.deepEqual(candidate(15),5);\n assert.deepEqual(candidate(27),3);\n assert.deepEqual(candidate(63),7);\n assert.deepEqual(candidate(330),11);\n assert.deepEqual(candidate(13195),29);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "ts", - "prompt": "//Given a string, find out how many distinct characters (regardless of case) does it consist of\n// >>> count_distinct_characters(\"xyzXYZ\")\n// 3\n// >>> count_distinct_characters(\"Jerry\")\n// 4\nfunction count_distinct_characters(string: string): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_distinct_characters;\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"abcde\"),5);\n assert.deepEqual(candidate(\"abcdecadeCADE\"),5);\n assert.deepEqual(candidate(\"aaaaAAAAaaaa\"),1);\n assert.deepEqual(candidate(\"Jerry jERRY JeRRRY\"),5);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "ts", - "prompt": "//You're given an array of deposit and withdrawal operations on a bank account that starts with\n// zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n// at that point function should return true. Otherwise it should return false.\n// >>> below_zero([1, 2, 3])\n// false\n// >>> below_zero([1, 2, -4, 5])\n// true\nfunction below_zero(operations: number[]): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = below_zero;\n assert.deepEqual(candidate([]),false);\n assert.deepEqual(candidate([1, 2, -3, 1, 2, -3]),false);\n assert.deepEqual(candidate([1, 2, -4, 5, 6]),true);\n assert.deepEqual(candidate([1, -1, 2, -2, 5, -5, 4, -4]),false);\n assert.deepEqual(candidate([1, -1, 2, -2, 5, -5, 4, -5]),true);\n assert.deepEqual(candidate([1, -2, 2, -2, 5, -5, 4, -4]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "ts", - "prompt": "//Find the shortest palindrome that begins with a supplied string.\n// Algorithm idea is simple:\n// - Find the longest postfix of supplied string that is a palindrome.\n// - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n// >>> make_palindrome(\"\")\n// \"\"\n// >>> make_palindrome(\"cat\")\n// \"catac\"\n// >>> make_palindrome(\"cata\")\n// \"catac\"\nfunction make_palindrome(string: string): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = make_palindrome;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"x\"),\"x\");\n assert.deepEqual(candidate(\"xyz\"),\"xyzyx\");\n assert.deepEqual(candidate(\"xyx\"),\"xyx\");\n assert.deepEqual(candidate(\"jerry\"),\"jerryrrej\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "ts", - "prompt": "//Given a positive integer, obtain its roman numeral equivalent as a string,\n// and return it in lowercase.\n// Restrictions: 1 <= num <= 1000\n// Examples:\n// >>> int_to_mini_roman(19)\n// \"xix\"\n// >>> int_to_mini_roman(152)\n// \"clii\"\n// >>> int_to_mini_roman(426)\n// \"cdxxvi\"\nfunction int_to_mini_roman(number: number): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "reworded", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = int_to_mini_roman;\n assert.deepEqual(candidate(19),\"xix\");\n assert.deepEqual(candidate(152),\"clii\");\n assert.deepEqual(candidate(251),\"ccli\");\n assert.deepEqual(candidate(426),\"cdxxvi\");\n assert.deepEqual(candidate(500),\"d\");\n assert.deepEqual(candidate(1),\"i\");\n assert.deepEqual(candidate(4),\"iv\");\n assert.deepEqual(candidate(43),\"xliii\");\n assert.deepEqual(candidate(90),\"xc\");\n assert.deepEqual(candidate(94),\"xciv\");\n assert.deepEqual(candidate(532),\"dxxxii\");\n assert.deepEqual(candidate(900),\"cm\");\n assert.deepEqual(candidate(994),\"cmxciv\");\n assert.deepEqual(candidate(1000),\"m\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - } -] \ No newline at end of file diff --git a/data/ts-transform.json b/data/ts-transform.json deleted file mode 100644 index 6c4809bddeef3154db5cb1ddf3ed506921df3358..0000000000000000000000000000000000000000 --- a/data/ts-transform.json +++ /dev/null @@ -1,2387 +0,0 @@ -[ - { - "name": "HumanEval_24_largest_divisor", - "language": "ts", - "prompt": "//For a given number n, find the largest number that divides n evenly, smaller than n\n// >>> largest_divisor(15)\n// 5\nfunction largest_divisor(n: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = largest_divisor;\n assert.deepEqual(candidate(3),1);\n assert.deepEqual(candidate(7),1);\n assert.deepEqual(candidate(10),5);\n assert.deepEqual(candidate(100),50);\n assert.deepEqual(candidate(49),7);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_47_median", - "language": "ts", - "prompt": "//Return median of elements in the list l.\n// >>> median([3, 1, 2, 4, 5])\n// 3\n// >>> median([-10, 4, 6, 1000, 10, 20])\n// 15.0\nfunction median(l: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = median;\n assert.deepEqual(candidate([3, 1, 2, 4, 5]),3);\n assert.deepEqual(candidate([-10, 4, 6, 1000, 10, 20]),8.0);\n assert.deepEqual(candidate([5]),5);\n assert.deepEqual(candidate([6, 5]),5.5);\n assert.deepEqual(candidate([8, 1, 3, 9, 9, 2, 7]),7);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_160_do_algebra", - "language": "ts", - "prompt": "//Given two lists operator, and operand. The first list has basic algebra operations, and \n// the second list is a list of integers. Use the two given lists to build the algebric \n// expression and return the evaluation of this expression.\n// The basic algebra operations:\n// Addition ( + ) \n// Subtraction ( - ) \n// Multiplication ( * ) \n// Floor division ( // ) \n// Exponentiation ( ** ) \n// Example:\n// operator['+', '*', '-']\n// array = [2, 3, 4, 5]\n// result = 2 + 3 * 4 - 5\n// => result = 9\n// Note:\n// The length of operator list is equal to the length of operand list minus one.\n// Operand is a list of of non-negative integers.\n// Operator list has at least one operator, and operand list has at least two operands.\nfunction do_algebra(operator: string[], operand: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = do_algebra;\n assert.deepEqual(candidate([\"**\", \"*\", \"+\"], [2, 3, 4, 5]),37);\n assert.deepEqual(candidate([\"+\", \"*\", \"-\"], [2, 3, 4, 5]),9);\n assert.deepEqual(candidate([\"//\", \"*\"], [7, 3, 4]),8);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_35_max_element", - "language": "ts", - "prompt": "//Return maximum element in the list.\n// >>> max_element([1, 2, 3])\n// 3\n// >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n// 123\nfunction max_element(l: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = max_element;\n assert.deepEqual(candidate([1, 2, 3]),3);\n assert.deepEqual(candidate([5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]),124);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_135_can_arrange", - "language": "ts", - "prompt": "//Create a function which returns the largest index of an element which\n// is not greater than or equal to the element immediately preceding it. If\n// no such element exists then return -1. The given array will not contain\n// duplicate values.\n// Examples:\n// >>> can_arrange([1, 2, 4, 3, 5])\n// 3\n// >>> can_arrange([1, 2, 3])\n// -1\nfunction can_arrange(arr: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = can_arrange;\n assert.deepEqual(candidate([1, 2, 4, 3, 5]),3);\n assert.deepEqual(candidate([1, 2, 4, 5]),-1);\n assert.deepEqual(candidate([1, 4, 2, 5, 6, 7, 8, 9, 10]),2);\n assert.deepEqual(candidate([4, 8, 5, 7, 3]),4);\n assert.deepEqual(candidate([]),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_41_car_race_collision", - "language": "ts", - "prompt": "//Imagine a road that's a perfectly straight infinitely long line.\n// n cars are driving left to right; simultaneously, a different set of n cars\n// are driving right to left. The two sets of cars start out being very far from\n// each other. All cars move in the same speed. Two cars are said to collide\n// when a car that's moving left to right hits a car that's moving right to left.\n// However, the cars are infinitely sturdy and strong; as a result, they continue moving\n// in their trajectory as if they did not collide.\n// This function outputs the number of such collisions.\nfunction car_race_collision(n: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = car_race_collision;\n assert.deepEqual(candidate(2),4);\n assert.deepEqual(candidate(3),9);\n assert.deepEqual(candidate(4),16);\n assert.deepEqual(candidate(8),64);\n assert.deepEqual(candidate(10),100);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_134_check_if_last_char_is_a_letter", - "language": "ts", - "prompt": "//Create a function that returns True if the last character\n// of a given string is an alphabetical character and is not\n// a part of a word, and False otherwise.\n// Note: \"word\" is a group of characters separated by space.\n// Examples:\n// >>> check_if_last_char_is_a_letter(\"apple pie\")\n// false\n// >>> check_if_last_char_is_a_letter(\"apple pi e\")\n// true\n// >>> check_if_last_char_is_a_letter(\"apple pi e \")\n// false\n// >>> check_if_last_char_is_a_letter(\"\")\n// false\nfunction check_if_last_char_is_a_letter(txt: string): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = check_if_last_char_is_a_letter;\n assert.deepEqual(candidate(\"apple\"),false);\n assert.deepEqual(candidate(\"apple pi e\"),true);\n assert.deepEqual(candidate(\"eeeee\"),false);\n assert.deepEqual(candidate(\"A\"),true);\n assert.deepEqual(candidate(\"Pumpkin pie \"),false);\n assert.deepEqual(candidate(\"Pumpkin pie 1\"),false);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"eeeee e \"),false);\n assert.deepEqual(candidate(\"apple pie\"),false);\n assert.deepEqual(candidate(\"apple pi e \"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_31_is_prime", - "language": "ts", - "prompt": "//Return true if a given number is prime, and false otherwise.\n// >>> is_prime(6)\n// false\n// >>> is_prime(101)\n// true\n// >>> is_prime(11)\n// true\n// >>> is_prime(13441)\n// true\n// >>> is_prime(61)\n// true\n// >>> is_prime(4)\n// false\n// >>> is_prime(1)\n// false\nfunction is_prime(n: number): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_prime;\n assert.deepEqual(candidate(6),false);\n assert.deepEqual(candidate(101),true);\n assert.deepEqual(candidate(11),true);\n assert.deepEqual(candidate(13441),true);\n assert.deepEqual(candidate(61),true);\n assert.deepEqual(candidate(4),false);\n assert.deepEqual(candidate(1),false);\n assert.deepEqual(candidate(5),true);\n assert.deepEqual(candidate(11),true);\n assert.deepEqual(candidate(17),true);\n assert.deepEqual(candidate(85),false);\n assert.deepEqual(candidate(77),false);\n assert.deepEqual(candidate(255379),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_104_unique_digits", - "language": "ts", - "prompt": "//Given a list of positive integers x. return a sorted list of all \n// elements that hasn't any even digit.\n// Note: Returned list should be sorted in increasing order.\n// For example:\n// >>> unique_digits([15, 33, 1422, 1])\n// [1, 15, 33]\n// >>> unique_digits([152, 323, 1422, 10])\n// []\nfunction unique_digits(x: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = unique_digits;\n assert.deepEqual(candidate([15, 33, 1422, 1]),[1, 15, 33]);\n assert.deepEqual(candidate([152, 323, 1422, 10]),[]);\n assert.deepEqual(candidate([12345, 2033, 111, 151]),[111, 151]);\n assert.deepEqual(candidate([135, 103, 31]),[31, 135]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_11_string_xor", - "language": "ts", - "prompt": "//Input are two strings a and b consisting only of 1s and 0s.\n// Perform binary XOR on these inputs and return result also as a string.\n// >>> string_xor(\"010\", \"110\")\n// \"100\"\nfunction string_xor(a: string, b: string): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = string_xor;\n assert.deepEqual(candidate(\"111000\", \"101010\"),\"010010\");\n assert.deepEqual(candidate(\"1\", \"1\"),\"0\");\n assert.deepEqual(candidate(\"0101\", \"0000\"),\"0101\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_60_sum_to_n", - "language": "ts", - "prompt": "//sum_to_n is a function that sums numbers from 1 to n.\n// >>> sum_to_n(30)\n// 465\n// >>> sum_to_n(100)\n// 5050\n// >>> sum_to_n(5)\n// 15\n// >>> sum_to_n(10)\n// 55\n// >>> sum_to_n(1)\n// 1\nfunction sum_to_n(n: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_to_n;\n assert.deepEqual(candidate(1),1);\n assert.deepEqual(candidate(6),21);\n assert.deepEqual(candidate(11),66);\n assert.deepEqual(candidate(30),465);\n assert.deepEqual(candidate(100),5050);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_151_double_the_difference", - "language": "ts", - "prompt": "//Given a list of numbers, return the sum of squares of the numbers\n// in the list that are odd. Ignore numbers that are negative or not integers.\n// >>> double_the_difference([1, 3, 2, 0])\n// 10\n// >>> double_the_difference([-1, -2, 0])\n// 0\n// >>> double_the_difference([9, -2])\n// 81\n// >>> double_the_difference([0])\n// 0\n// If the input list is empty, return 0.\nfunction double_the_difference(lst: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = double_the_difference;\n assert.deepEqual(candidate([]),0);\n assert.deepEqual(candidate([5.0, 4.0]),25);\n assert.deepEqual(candidate([0.1, 0.2, 0.3]),0);\n assert.deepEqual(candidate([-10.0, -20.0, -30.0]),0);\n assert.deepEqual(candidate([-1.0, -2.0, 8.0]),0);\n assert.deepEqual(candidate([0.2, 3.0, 5.0]),34);\n assert.deepEqual(candidate([-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]),165);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_23_strlen", - "language": "ts", - "prompt": "//Return length of given string\n// >>> strlen(\"\")\n// 0\n// >>> strlen(\"abc\")\n// 3\nfunction strlen(string: string): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = strlen;\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"x\"),1);\n assert.deepEqual(candidate(\"asdasnakj\"),9);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_91_is_bored", - "language": "ts", - "prompt": "//You'll be given a string of words, and your task is to count the number\n// of boredoms. A boredom is a sentence that starts with the word \"I\".\n// Sentences are delimited by '.', '?' or '!'.\n// For example:\n// >>> is_bored(\"Hello world\")\n// 0\n// >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n// 1\nfunction is_bored(S: string): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_bored;\n assert.deepEqual(candidate(\"Hello world\"),0);\n assert.deepEqual(candidate(\"Is the sky blue?\"),0);\n assert.deepEqual(candidate(\"I love It !\"),1);\n assert.deepEqual(candidate(\"bIt\"),0);\n assert.deepEqual(candidate(\"I feel good today. I will be productive. will kill It\"),2);\n assert.deepEqual(candidate(\"You and I are going for a walk\"),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_64_vowels_count", - "language": "ts", - "prompt": "//Write a function vowels_count which takes a string representing\n// a word as input and returns the number of vowels in the string.\n// Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n// vowel, but only when it is at the end of the given word.\n// Example:\n// >>> vowels_count(\"abcde\")\n// 2\n// >>> vowels_count(\"ACEDY\")\n// 3\nfunction vowels_count(s: string): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = vowels_count;\n assert.deepEqual(candidate(\"abcde\"),2);\n assert.deepEqual(candidate(\"Alone\"),3);\n assert.deepEqual(candidate(\"key\"),2);\n assert.deepEqual(candidate(\"bye\"),1);\n assert.deepEqual(candidate(\"keY\"),2);\n assert.deepEqual(candidate(\"bYe\"),1);\n assert.deepEqual(candidate(\"ACEDY\"),3);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_55_fib", - "language": "ts", - "prompt": "//Return n-th Fibonacci number.\n// >>> fib(10)\n// 55\n// >>> fib(1)\n// 1\n// >>> fib(8)\n// 21\nfunction fib(n: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fib;\n assert.deepEqual(candidate(10),55);\n assert.deepEqual(candidate(1),1);\n assert.deepEqual(candidate(8),21);\n assert.deepEqual(candidate(11),89);\n assert.deepEqual(candidate(12),144);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_144_simplify", - "language": "ts", - "prompt": "//Your task is to implement a function that will simplify the expression\n// x * n. The function returns True if x * n evaluates to a whole number and False\n// otherwise. Both x and n, are string representation of a fraction, and have the following format,\n// / where both numerator and denominator are positive whole numbers.\n// You can assume that x, and n are valid fractions, and do not have zero as denominator.\n// >>> simplify(\"1/5\", \"5/1\")\n// true\n// >>> simplify(\"1/6\", \"2/1\")\n// false\n// >>> simplify(\"7/10\", \"10/2\")\n// false\nfunction simplify(x: string, n: string): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = simplify;\n assert.deepEqual(candidate(\"1/5\", \"5/1\"),true);\n assert.deepEqual(candidate(\"1/6\", \"2/1\"),false);\n assert.deepEqual(candidate(\"5/1\", \"3/1\"),true);\n assert.deepEqual(candidate(\"7/10\", \"10/2\"),false);\n assert.deepEqual(candidate(\"2/10\", \"50/10\"),true);\n assert.deepEqual(candidate(\"7/2\", \"4/2\"),true);\n assert.deepEqual(candidate(\"11/6\", \"6/1\"),true);\n assert.deepEqual(candidate(\"2/3\", \"5/2\"),false);\n assert.deepEqual(candidate(\"5/2\", \"3/5\"),false);\n assert.deepEqual(candidate(\"2/4\", \"8/4\"),true);\n assert.deepEqual(candidate(\"2/4\", \"4/2\"),true);\n assert.deepEqual(candidate(\"1/5\", \"5/1\"),true);\n assert.deepEqual(candidate(\"1/5\", \"1/5\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_98_count_upper", - "language": "ts", - "prompt": "//Given a string s, count the number of uppercase vowels in even indices.\n// For example:\n// >>> count_upper(\"aBCdEf\")\n// 1\n// >>> count_upper(\"abcdefg\")\n// 0\n// >>> count_upper(\"dBBE\")\n// 0\nfunction count_upper(s: string): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_upper;\n assert.deepEqual(candidate(\"aBCdEf\"),1);\n assert.deepEqual(candidate(\"abcdefg\"),0);\n assert.deepEqual(candidate(\"dBBE\"),0);\n assert.deepEqual(candidate(\"B\"),0);\n assert.deepEqual(candidate(\"U\"),1);\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"EEEE\"),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_115_max_fill", - "language": "ts", - "prompt": "//You are given a rectangular grid of wells. Each row represents a single well,\n// and each 1 in a row represents a single unit of water.\n// Each well has a corresponding bucket that can be used to extract water from it, \n// and all buckets have the same capacity.\n// Your task is to use the buckets to empty the wells.\n// Output the number of times you need to lower the buckets.\n// Example 1:\n// >>> max_fill([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1)\n// 6\n// Example 2:\n// >>> max_fill([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2)\n// 5\n// Example 3:\n// >>> max_fill([[0, 0, 0], [0, 0, 0]], 5)\n// 0\n// Constraints:\n// * all wells have the same length\n// * 1 <= grid.length <= 10^2\n// * 1 <= grid[:,1].length <= 10^2\n// * grid[i][j] -> 0 | 1\n// * 1 <= capacity <= 10\nfunction max_fill(grid: number[][], capacity: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = max_fill;\n assert.deepEqual(candidate([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1),6);\n assert.deepEqual(candidate([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2),5);\n assert.deepEqual(candidate([[0, 0, 0], [0, 0, 0]], 5),0);\n assert.deepEqual(candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 2),4);\n assert.deepEqual(candidate([[1, 1, 1, 1], [1, 1, 1, 1]], 9),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_120_maximum", - "language": "ts", - "prompt": "//Given an array arr of integers and a positive integer k, return a sorted list \n// of length k with the maximum k numbers in arr.\n// Example 1:\n// >>> maximum([-3, -4, 5], 3)\n// [-4, -3, 5]\n// Example 2:\n// >>> maximum([4, -4, 4], 2)\n// [4, 4]\n// Example 3:\n// >>> maximum([-3, 2, 1, 2, -1, -2, 1], 1)\n// [2]\n// Note:\n// 1. The length of the array will be in the range of [1, 1000].\n// 2. The elements in the array will be in the range of [-1000, 1000].\n// 3. 0 <= k <= len(arr)\nfunction maximum(arr: number[], k: number): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = maximum;\n assert.deepEqual(candidate([-3, -4, 5], 3),[-4, -3, 5]);\n assert.deepEqual(candidate([4, -4, 4], 2),[4, 4]);\n assert.deepEqual(candidate([-3, 2, 1, 2, -1, -2, 1], 1),[2]);\n assert.deepEqual(candidate([123, -123, 20, 0, 1, 2, -3], 3),[2, 20, 123]);\n assert.deepEqual(candidate([-123, 20, 0, 1, 2, -3], 4),[0, 1, 2, 20]);\n assert.deepEqual(candidate([5, 15, 0, 3, -13, -8, 0], 7),[-13, -8, 0, 0, 3, 5, 15]);\n assert.deepEqual(candidate([-1, 0, 2, 5, 3, -10], 2),[3, 5]);\n assert.deepEqual(candidate([1, 0, 5, -7], 1),[5]);\n assert.deepEqual(candidate([4, -4], 2),[-4, 4]);\n assert.deepEqual(candidate([-10, 10], 2),[-10, 10]);\n assert.deepEqual(candidate([1, 2, 3, -23, 243, -400, 0], 0),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_93_encode", - "language": "ts", - "prompt": "//Write a function that takes a message, and encodes in such a \n// way that it swaps case of all letters, replaces all vowels in \n// the message with the letter that appears 2 places ahead of that \n// vowel in the english alphabet. \n// Assume only letters. \n// Examples:\n// >>> encode(\"test\")\n// \"TGST\"\n// >>> encode(\"This is a message\")\n// \"tHKS KS C MGSSCGG\"\nfunction encode(message: string): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = encode;\n assert.deepEqual(candidate(\"TEST\"),\"tgst\");\n assert.deepEqual(candidate(\"Mudasir\"),\"mWDCSKR\");\n assert.deepEqual(candidate(\"YES\"),\"ygs\");\n assert.deepEqual(candidate(\"This is a message\"),\"tHKS KS C MGSSCGG\");\n assert.deepEqual(candidate(\"I DoNt KnOw WhAt tO WrItE\"),\"k dQnT kNqW wHcT Tq wRkTg\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_51_remove_vowels", - "language": "ts", - "prompt": "//remove_vowels is a function that takes string and returns string without vowels.\n// >>> remove_vowels(\"\")\n// \"\"\n// >>> remove_vowels(\"abcdef\")\n// \"bcdf\"\n// >>> remove_vowels(\"aaaaa\")\n// \"\"\n// >>> remove_vowels(\"aaBAA\")\n// \"B\"\n// >>> remove_vowels(\"zbcd\")\n// \"zbcd\"\nfunction remove_vowels(text: string): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = remove_vowels;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"abcdef\\nghijklm\"),\"bcdf\\nghjklm\");\n assert.deepEqual(candidate(\"fedcba\"),\"fdcb\");\n assert.deepEqual(candidate(\"eeeee\"),\"\");\n assert.deepEqual(candidate(\"acBAA\"),\"cB\");\n assert.deepEqual(candidate(\"EcBOO\"),\"cB\");\n assert.deepEqual(candidate(\"ybcd\"),\"ybcd\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_30_get_positive", - "language": "ts", - "prompt": "//Return only positive numbers in the list.\n// >>> get_positive([-1, 2, -4, 5, 6])\n// [2, 5, 6]\n// >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n// [5, 3, 2, 3, 9, 123, 1]\nfunction get_positive(l: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_positive;\n assert.deepEqual(candidate([-1, -2, 4, 5, 6]),[4, 5, 6]);\n assert.deepEqual(candidate([5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]),[5, 3, 2, 3, 3, 9, 123, 1]);\n assert.deepEqual(candidate([-1, -2]),[]);\n assert.deepEqual(candidate([]),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_15_string_sequence", - "language": "ts", - "prompt": "//Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n// >>> string_sequence(0)\n// \"0\"\n// >>> string_sequence(5)\n// \"0 1 2 3 4 5\"\nfunction string_sequence(n: number): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = string_sequence;\n assert.deepEqual(candidate(0),\"0\");\n assert.deepEqual(candidate(3),\"0 1 2 3\");\n assert.deepEqual(candidate(10),\"0 1 2 3 4 5 6 7 8 9 10\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_100_make_a_pile", - "language": "ts", - "prompt": "//Given a positive integer n, you have to make a pile of n levels of stones.\n// The first level has n stones.\n// The number of stones in the next level is:\n// - the next odd number if n is odd.\n// - the next even number if n is even.\n// Return the number of stones in each level in a list, where element at index\n// i represents the number of stones in the level (i+1).\n// Examples:\n// >>> make_a_pile(3)\n// [3, 5, 7]\nfunction make_a_pile(n: number): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = make_a_pile;\n assert.deepEqual(candidate(3),[3, 5, 7]);\n assert.deepEqual(candidate(4),[4, 6, 8, 10]);\n assert.deepEqual(candidate(5),[5, 7, 9, 11, 13]);\n assert.deepEqual(candidate(6),[6, 8, 10, 12, 14, 16]);\n assert.deepEqual(candidate(8),[8, 10, 12, 14, 16, 18, 20, 22]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_112_reverse_delete", - "language": "ts", - "prompt": "//Task\n// 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\n// then check if the result string is palindrome.\n// A string is called palindrome if it reads the same backward as forward.\n// You should return a tuple containing the result string and True/False for the check.\n// Example\n// >>> reverse_delete(\"abcde\", \"ae\")\n// [\"bcd\", false]\n// >>> reverse_delete(\"abcdef\", \"b\")\n// [\"acdef\", false]\n// >>> reverse_delete(\"abcdedcba\", \"ab\")\n// [\"cdedc\", true]\nfunction reverse_delete(s: string, c: string): [string, boolean] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = reverse_delete;\n assert.deepEqual(candidate(\"abcde\", \"ae\"),[\"bcd\", false]);\n assert.deepEqual(candidate(\"abcdef\", \"b\"),[\"acdef\", false]);\n assert.deepEqual(candidate(\"abcdedcba\", \"ab\"),[\"cdedc\", true]);\n assert.deepEqual(candidate(\"dwik\", \"w\"),[\"dik\", false]);\n assert.deepEqual(candidate(\"a\", \"a\"),[\"\", true]);\n assert.deepEqual(candidate(\"abcdedcba\", \"\"),[\"abcdedcba\", true]);\n assert.deepEqual(candidate(\"abcdedcba\", \"v\"),[\"abcdedcba\", true]);\n assert.deepEqual(candidate(\"vabba\", \"v\"),[\"abba\", true]);\n assert.deepEqual(candidate(\"mamma\", \"mia\"),[\"\", true]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_27_flip_case", - "language": "ts", - "prompt": "//For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n// >>> flip_case(\"Hello\")\n// \"hELLO\"\nfunction flip_case(string: string): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = flip_case;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"Hello!\"),\"hELLO!\");\n assert.deepEqual(candidate(\"These violent delights have violent ends\"),\"tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_161_solve", - "language": "ts", - "prompt": "//You are given a string s.\n// if s[i] is a letter, reverse its case from lower to upper or vise versa, \n// otherwise keep it as it is.\n// If the string contains no letters, reverse the string.\n// The function should return the resulted string.\n// Examples\n// >>> solve(\"1234\")\n// \"4321\"\n// >>> solve(\"ab\")\n// \"AB\"\n// >>> solve(\"#a@C\")\n// \"#A@c\"\nfunction solve(s: string): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = solve;\n assert.deepEqual(candidate(\"AsDf\"),\"aSdF\");\n assert.deepEqual(candidate(\"1234\"),\"4321\");\n assert.deepEqual(candidate(\"ab\"),\"AB\");\n assert.deepEqual(candidate(\"#a@C\"),\"#A@c\");\n assert.deepEqual(candidate(\"#AsdfW^45\"),\"#aSDFw^45\");\n assert.deepEqual(candidate(\"#6@2\"),\"2@6#\");\n assert.deepEqual(candidate(\"#$a^D\"),\"#$A^d\");\n assert.deepEqual(candidate(\"#ccc\"),\"#CCC\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_29_filter_by_prefix", - "language": "ts", - "prompt": "//Filter an input list of strings only for ones that start with a given prefix.\n// >>> filter_by_prefix([], \"a\")\n// []\n// >>> filter_by_prefix([\"abc\", \"bcd\", \"cde\", \"array\"], \"a\")\n// [\"abc\", \"array\"]\nfunction filter_by_prefix(strings: string[], prefix: string): string[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = filter_by_prefix;\n assert.deepEqual(candidate([], \"john\"),[]);\n assert.deepEqual(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"),[\"xxx\", \"xxxAAA\", \"xxx\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_102_choose_num", - "language": "ts", - "prompt": "//This function takes two positive numbers x and y and returns the\n// biggest even integer number that is in the range [x, y] inclusive. If \n// there's no such number, then the function should return -1.\n// For example:\n// >>> choose_num(12, 15)\n// 14\n// >>> choose_num(13, 12)\n// -1\nfunction choose_num(x: number, y: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = choose_num;\n assert.deepEqual(candidate(12, 15),14);\n assert.deepEqual(candidate(13, 12),-1);\n assert.deepEqual(candidate(33, 12354),12354);\n assert.deepEqual(candidate(5234, 5233),-1);\n assert.deepEqual(candidate(6, 29),28);\n assert.deepEqual(candidate(27, 10),-1);\n assert.deepEqual(candidate(7, 7),-1);\n assert.deepEqual(candidate(546, 546),546);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_143_words_in_sentence", - "language": "ts", - "prompt": "//You are given a string representing a sentence,\n// the sentence contains some words separated by a space,\n// and you have to return a string that contains the words from the original sentence,\n// whose lengths are prime numbers,\n// the order of the words in the new string should be the same as the original one.\n// Example 1:\n// >>> words_in_sentence(\"This is a test\")\n// \"is\"\n// Example 2:\n// >>> words_in_sentence(\"lets go for swimming\")\n// \"go for\"\n// Constraints:\n// * 1 <= len(sentence) <= 100\n// * sentence contains only letters\nfunction words_in_sentence(sentence: string): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = words_in_sentence;\n assert.deepEqual(candidate(\"This is a test\"),\"is\");\n assert.deepEqual(candidate(\"lets go for swimming\"),\"go for\");\n assert.deepEqual(candidate(\"there is no place available here\"),\"there is no place\");\n assert.deepEqual(candidate(\"Hi I am Hussein\"),\"Hi am Hussein\");\n assert.deepEqual(candidate(\"go for it\"),\"go for it\");\n assert.deepEqual(candidate(\"here\"),\"\");\n assert.deepEqual(candidate(\"here is\"),\"is\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_5_intersperse", - "language": "ts", - "prompt": "//Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n// >>> intersperse([], 4)\n// []\n// >>> intersperse([1, 2, 3], 4)\n// [1, 4, 2, 4, 3]\nfunction intersperse(numbers: number[], delimeter: number): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = intersperse;\n assert.deepEqual(candidate([], 7),[]);\n assert.deepEqual(candidate([5, 6, 3, 2], 8),[5, 8, 6, 8, 3, 8, 2]);\n assert.deepEqual(candidate([2, 2, 2], 2),[2, 2, 2, 2, 2]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_76_is_simple_power", - "language": "ts", - "prompt": "//Your task is to write a function that returns true if a number x is a simple\n// power of n and false in other cases.\n// x is a simple power of n if n**int=x\n// For example:\n// >>> is_simple_power(1, 4)\n// true\n// >>> is_simple_power(2, 2)\n// true\n// >>> is_simple_power(8, 2)\n// true\n// >>> is_simple_power(3, 2)\n// false\n// >>> is_simple_power(3, 1)\n// false\n// >>> is_simple_power(5, 3)\n// false\nfunction is_simple_power(x: number, n: number): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_simple_power;\n assert.deepEqual(candidate(16, 2),true);\n assert.deepEqual(candidate(143214, 16),false);\n assert.deepEqual(candidate(4, 2),true);\n assert.deepEqual(candidate(9, 3),true);\n assert.deepEqual(candidate(16, 4),true);\n assert.deepEqual(candidate(24, 2),false);\n assert.deepEqual(candidate(128, 4),false);\n assert.deepEqual(candidate(12, 6),false);\n assert.deepEqual(candidate(1, 1),true);\n assert.deepEqual(candidate(1, 12),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_75_is_multiply_prime", - "language": "ts", - "prompt": "//Write a function that returns true if the given number is the multiplication of 3 prime numbers\n// and false otherwise.\n// Knowing that (a) is less then 100. \n// Example:\n// >>> is_multiply_prime(30)\n// true\n// 30 = 2 * 3 * 5\nfunction is_multiply_prime(a: number): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_multiply_prime;\n assert.deepEqual(candidate(5),false);\n assert.deepEqual(candidate(30),true);\n assert.deepEqual(candidate(8),true);\n assert.deepEqual(candidate(10),false);\n assert.deepEqual(candidate(125),true);\n assert.deepEqual(candidate(105),true);\n assert.deepEqual(candidate(126),false);\n assert.deepEqual(candidate(729),false);\n assert.deepEqual(candidate(891),false);\n assert.deepEqual(candidate(1001),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_157_right_angle_triangle", - "language": "ts", - "prompt": "//Given the lengths of the three sides of a triangle. Return True if the three\n// sides form a right-angled triangle, False otherwise.\n// A right-angled triangle is a triangle in which one angle is right angle or \n// 90 degree.\n// Example:\n// >>> right_angle_triangle(3, 4, 5)\n// true\n// >>> right_angle_triangle(1, 2, 3)\n// false\nfunction right_angle_triangle(a: number, b: number, c: number): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = right_angle_triangle;\n assert.deepEqual(candidate(3, 4, 5),true);\n assert.deepEqual(candidate(1, 2, 3),false);\n assert.deepEqual(candidate(10, 6, 8),true);\n assert.deepEqual(candidate(2, 2, 2),false);\n assert.deepEqual(candidate(7, 24, 25),true);\n assert.deepEqual(candidate(10, 5, 7),false);\n assert.deepEqual(candidate(5, 12, 13),true);\n assert.deepEqual(candidate(15, 8, 17),true);\n assert.deepEqual(candidate(48, 55, 73),true);\n assert.deepEqual(candidate(1, 1, 1),false);\n assert.deepEqual(candidate(2, 2, 10),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_92_any_int", - "language": "ts", - "prompt": "//Create a function that takes 3 numbers.\n// Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n// Returns false in any other cases.\n// Examples\n// >>> any_int(5, 2, 7)\n// true\n// >>> any_int(3, 2, 2)\n// false\n// >>> any_int(3, -2, 1)\n// true\n// >>> any_int(3.6, -2.2, 2)\n// false\nfunction any_int(x: number, y: number, z: number): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = any_int;\n assert.deepEqual(candidate(2, 3, 1),true);\n assert.deepEqual(candidate(2.5, 2, 3),false);\n assert.deepEqual(candidate(1.5, 5, 3.5),false);\n assert.deepEqual(candidate(2, 6, 2),false);\n assert.deepEqual(candidate(4, 2, 2),true);\n assert.deepEqual(candidate(2.2, 2.2, 2.2),false);\n assert.deepEqual(candidate(-4, 6, 2),true);\n assert.deepEqual(candidate(2, 1, 1),true);\n assert.deepEqual(candidate(3, 4, 7),true);\n assert.deepEqual(candidate(3.0, 4, 7),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_33_sort_third", - "language": "ts", - "prompt": "//This function takes a list l and returns a list l' such that\n// l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n// to the values of the corresponding indicies of l, but sorted.\n// >>> sort_third([1, 2, 3])\n// [1, 2, 3]\n// >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n// [2, 6, 3, 4, 8, 9, 5]\nfunction sort_third(l: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_third;\n assert.deepEqual(candidate([5, 6, 3, 4, 8, 9, 2]),[2, 6, 3, 4, 8, 9, 5]);\n assert.deepEqual(candidate([5, 8, 3, 4, 6, 9, 2]),[2, 8, 3, 4, 6, 9, 5]);\n assert.deepEqual(candidate([5, 6, 9, 4, 8, 3, 2]),[2, 6, 9, 4, 8, 3, 5]);\n assert.deepEqual(candidate([5, 6, 3, 4, 8, 9, 2, 1]),[2, 6, 3, 4, 8, 9, 5, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_53_add", - "language": "ts", - "prompt": "//Add two numbers x and y\n// >>> add(2, 3)\n// 5\n// >>> add(5, 7)\n// 12\nfunction add(x: number, y: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = add;\n assert.deepEqual(candidate(0, 1),1);\n assert.deepEqual(candidate(1, 0),1);\n assert.deepEqual(candidate(2, 3),5);\n assert.deepEqual(candidate(5, 7),12);\n assert.deepEqual(candidate(7, 5),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_69_search", - "language": "ts", - "prompt": "//You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n// zero, and has a frequency greater than or equal to the value of the integer itself. \n// The frequency of an integer is the number of times it appears in the list.\n// If no such a value exist, return -1.\n// Examples:\n// >>> search([4, 1, 2, 2, 3, 1])\n// 2\n// >>> search([1, 2, 2, 3, 3, 3, 4, 4, 4])\n// 3\n// >>> search([5, 5, 4, 4, 4])\n// -1\nfunction search(lst: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = search;\n assert.deepEqual(candidate([5, 5, 5, 5, 1]),1);\n assert.deepEqual(candidate([4, 1, 4, 1, 4, 4]),4);\n assert.deepEqual(candidate([3, 3]),-1);\n assert.deepEqual(candidate([8, 8, 8, 8, 8, 8, 8, 8]),8);\n assert.deepEqual(candidate([2, 3, 3, 2, 2]),2);\n assert.deepEqual(candidate([2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1]),1);\n assert.deepEqual(candidate([3, 2, 8, 2]),2);\n assert.deepEqual(candidate([6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10]),1);\n assert.deepEqual(candidate([8, 8, 3, 6, 5, 6, 4]),-1);\n assert.deepEqual(candidate([6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9]),1);\n assert.deepEqual(candidate([1, 9, 10, 1, 3]),1);\n assert.deepEqual(candidate([6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10]),5);\n assert.deepEqual(candidate([1]),1);\n assert.deepEqual(candidate([8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5]),4);\n assert.deepEqual(candidate([2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10]),2);\n assert.deepEqual(candidate([1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3]),1);\n assert.deepEqual(candidate([9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4]),4);\n assert.deepEqual(candidate([2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7]),4);\n assert.deepEqual(candidate([9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1]),2);\n assert.deepEqual(candidate([5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8]),-1);\n assert.deepEqual(candidate([10]),-1);\n assert.deepEqual(candidate([9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2]),2);\n assert.deepEqual(candidate([5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8]),1);\n assert.deepEqual(candidate([7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6]),1);\n assert.deepEqual(candidate([3, 10, 10, 9, 2]),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_82_prime_length", - "language": "ts", - "prompt": "//Write a function that takes a string and returns True if the string\n// length is a prime number or False otherwise\n// Examples\n// >>> prime_length(\"Hello\")\n// true\n// >>> prime_length(\"abcdcba\")\n// true\n// >>> prime_length(\"kittens\")\n// true\n// >>> prime_length(\"orange\")\n// false\nfunction prime_length(string: string): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = prime_length;\n assert.deepEqual(candidate(\"Hello\"),true);\n assert.deepEqual(candidate(\"abcdcba\"),true);\n assert.deepEqual(candidate(\"kittens\"),true);\n assert.deepEqual(candidate(\"orange\"),false);\n assert.deepEqual(candidate(\"wow\"),true);\n assert.deepEqual(candidate(\"world\"),true);\n assert.deepEqual(candidate(\"MadaM\"),true);\n assert.deepEqual(candidate(\"Wow\"),true);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"HI\"),true);\n assert.deepEqual(candidate(\"go\"),true);\n assert.deepEqual(candidate(\"gogo\"),false);\n assert.deepEqual(candidate(\"aaaaaaaaaaaaaaa\"),false);\n assert.deepEqual(candidate(\"Madam\"),true);\n assert.deepEqual(candidate(\"M\"),false);\n assert.deepEqual(candidate(\"0\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_58_common", - "language": "ts", - "prompt": "//Return sorted unique common elements for two lists.\n// >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n// [1, 5, 653]\n// >>> common([5, 3, 2, 8], [3, 2])\n// [2, 3]\nfunction common(l1: number[], l2: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = common;\n assert.deepEqual(candidate([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]),[1, 5, 653]);\n assert.deepEqual(candidate([5, 3, 2, 8], [3, 2]),[2, 3]);\n assert.deepEqual(candidate([4, 3, 2, 8], [3, 2, 4]),[2, 3, 4]);\n assert.deepEqual(candidate([4, 3, 2, 8], []),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_139_special_factorial", - "language": "ts", - "prompt": "//The Brazilian factorial is defined as:\n// brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n// where n > 0\n// For example:\n// >>> special_factorial(4)\n// 288\n// The function will receive an integer as input and should return the special\n// factorial of this integer.\nfunction special_factorial(n: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = special_factorial;\n assert.deepEqual(candidate(4),288);\n assert.deepEqual(candidate(5),34560);\n assert.deepEqual(candidate(7),125411328000);\n assert.deepEqual(candidate(1),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_110_exchange", - "language": "ts", - "prompt": "//In this problem, you will implement a function that takes two lists of numbers,\n// and determines whether it is possible to perform an exchange of elements\n// between them to make lst1 a list of only even numbers.\n// There is no limit on the number of exchanged elements between lst1 and lst2.\n// If it is possible to exchange elements between the lst1 and lst2 to make\n// all the elements of lst1 to be even, return \"YES\".\n// Otherwise, return \"NO\".\n// For example:\n// >>> exchange([1, 2, 3, 4], [1, 2, 3, 4])\n// \"YES\"\n// >>> exchange([1, 2, 3, 4], [1, 5, 3, 4])\n// \"NO\"\n// It is assumed that the input lists will be non-empty.\nfunction exchange(lst1: number[], lst2: number[]): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = exchange;\n assert.deepEqual(candidate([1, 2, 3, 4], [1, 2, 3, 4]),\"YES\");\n assert.deepEqual(candidate([1, 2, 3, 4], [1, 5, 3, 4]),\"NO\");\n assert.deepEqual(candidate([1, 2, 3, 4], [2, 1, 4, 3]),\"YES\");\n assert.deepEqual(candidate([5, 7, 3], [2, 6, 4]),\"YES\");\n assert.deepEqual(candidate([5, 7, 3], [2, 6, 3]),\"NO\");\n assert.deepEqual(candidate([3, 2, 6, 1, 8, 9], [3, 5, 5, 1, 1, 1]),\"NO\");\n assert.deepEqual(candidate([100, 200], [200, 200]),\"YES\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_122_add_elements", - "language": "ts", - "prompt": "//Given a non-empty array of integers arr and an integer k, return\n// the sum of the elements with at most two digits from the first k elements of arr.\n// Example:\n// >>> add_elements([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4)\n// 24\n// Constraints:\n// 1. 1 <= len(arr) <= 100\n// 2. 1 <= k <= len(arr)\nfunction add_elements(arr: number[], k: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = add_elements;\n assert.deepEqual(candidate([1, -2, -3, 41, 57, 76, 87, 88, 99], 3),-4);\n assert.deepEqual(candidate([111, 121, 3, 4000, 5, 6], 2),0);\n assert.deepEqual(candidate([11, 21, 3, 90, 5, 6, 7, 8, 9], 4),125);\n assert.deepEqual(candidate([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4),24);\n assert.deepEqual(candidate([1], 1),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_150_x_or_y", - "language": "ts", - "prompt": "//A simple program which should return the value of x if n is \n// a prime number and should return the value of y otherwise.\n// Examples:\n// >>> x_or_y(7, 34, 12)\n// 34\n// >>> x_or_y(15, 8, 5)\n// 5\nfunction x_or_y(n: number, x: number, y: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = x_or_y;\n assert.deepEqual(candidate(7, 34, 12),34);\n assert.deepEqual(candidate(15, 8, 5),5);\n assert.deepEqual(candidate(3, 33, 5212),33);\n assert.deepEqual(candidate(1259, 3, 52),3);\n assert.deepEqual(candidate(7919, -1, 12),-1);\n assert.deepEqual(candidate(3609, 1245, 583),583);\n assert.deepEqual(candidate(91, 56, 129),129);\n assert.deepEqual(candidate(6, 34, 1234),1234);\n assert.deepEqual(candidate(1, 2, 0),0);\n assert.deepEqual(candidate(2, 2, 0),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_45_triangle_area", - "language": "ts", - "prompt": "//Given length of a side and high return area for a triangle.\n// >>> triangle_area(5, 3)\n// 7.5\nfunction triangle_area(a: number, h: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = triangle_area;\n assert.deepEqual(candidate(5, 3),7.5);\n assert.deepEqual(candidate(2, 2),2.0);\n assert.deepEqual(candidate(10, 8),40.0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_130_tri", - "language": "ts", - "prompt": "//Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n// the last couple centuries. However, what people don't know is Tribonacci sequence.\n// Tribonacci sequence is defined by the recurrence:\n// tri(1) = 3\n// tri(n) = 1 + n / 2, if n is even.\n// tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n// For example:\n// tri(2) = 1 + (2 / 2) = 2\n// tri(4) = 3\n// tri(3) = tri(2) + tri(1) + tri(4)\n// = 2 + 3 + 3 = 8 \n// You are given a non-negative integer number n, you have to a return a list of the \n// first n + 1 numbers of the Tribonacci sequence.\n// Examples:\n// >>> tri(3)\n// [1, 3, 2, 8]\nfunction tri(n: number): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = tri;\n assert.deepEqual(candidate(3),[1, 3, 2, 8]);\n assert.deepEqual(candidate(4),[1, 3, 2, 8, 3]);\n assert.deepEqual(candidate(5),[1, 3, 2, 8, 3, 15]);\n assert.deepEqual(candidate(6),[1, 3, 2, 8, 3, 15, 4]);\n assert.deepEqual(candidate(7),[1, 3, 2, 8, 3, 15, 4, 24]);\n assert.deepEqual(candidate(8),[1, 3, 2, 8, 3, 15, 4, 24, 5]);\n assert.deepEqual(candidate(9),[1, 3, 2, 8, 3, 15, 4, 24, 5, 35]);\n assert.deepEqual(candidate(20),[1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11]);\n assert.deepEqual(candidate(0),[1]);\n assert.deepEqual(candidate(1),[1, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_119_match_parens", - "language": "ts", - "prompt": "//You are given a list of two strings, both strings consist of open\n// parentheses '(' or close parentheses ')' only.\n// Your job is to check if it is possible to concatenate the two strings in\n// some order, that the resulting string will be good.\n// A string S is considered to be good if and only if all parentheses in S\n// are balanced. For example: the string '(())()' is good, while the string\n// '())' is not.\n// Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n// Examples:\n// >>> match_parens([\"()(\", \")\"])\n// \"Yes\"\n// >>> match_parens([\")\", \")\"])\n// \"No\"\nfunction match_parens(lst: string[]): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = match_parens;\n assert.deepEqual(candidate([\"()(\", \")\"]),\"Yes\");\n assert.deepEqual(candidate([\")\", \")\"]),\"No\");\n assert.deepEqual(candidate([\"(()(())\", \"())())\"]),\"No\");\n assert.deepEqual(candidate([\")())\", \"(()()(\"]),\"Yes\");\n assert.deepEqual(candidate([\"(())))\", \"(()())((\"]),\"Yes\");\n assert.deepEqual(candidate([\"()\", \"())\"]),\"No\");\n assert.deepEqual(candidate([\"(()(\", \"()))()\"]),\"Yes\");\n assert.deepEqual(candidate([\"((((\", \"((())\"]),\"No\");\n assert.deepEqual(candidate([\")(()\", \"(()(\"]),\"No\");\n assert.deepEqual(candidate([\")(\", \")(\"]),\"No\");\n assert.deepEqual(candidate([\"(\", \")\"]),\"Yes\");\n assert.deepEqual(candidate([\")\", \"(\"]),\"Yes\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_26_remove_duplicates", - "language": "ts", - "prompt": "//From a list of integers, remove all elements that occur more than once.\n// Keep order of elements left the same as in the input.\n// >>> remove_duplicates([1, 2, 3, 2, 4])\n// [1, 3, 4]\nfunction remove_duplicates(numbers: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = remove_duplicates;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, 2, 3, 4]),[1, 2, 3, 4]);\n assert.deepEqual(candidate([1, 2, 3, 2, 4, 3, 5]),[1, 4, 5]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_13_greatest_common_divisor", - "language": "ts", - "prompt": "//Return a greatest common divisor of two integers a and b\n// >>> greatest_common_divisor(3, 5)\n// 1\n// >>> greatest_common_divisor(25, 15)\n// 5\nfunction greatest_common_divisor(a: number, b: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = greatest_common_divisor;\n assert.deepEqual(candidate(3, 7),1);\n assert.deepEqual(candidate(10, 15),5);\n assert.deepEqual(candidate(49, 14),7);\n assert.deepEqual(candidate(144, 60),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_48_is_palindrome", - "language": "ts", - "prompt": "//Checks if given string is a palindrome\n// >>> is_palindrome(\"\")\n// true\n// >>> is_palindrome(\"aba\")\n// true\n// >>> is_palindrome(\"aaaaa\")\n// true\n// >>> is_palindrome(\"zbcd\")\n// false\nfunction is_palindrome(text: string): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_palindrome;\n assert.deepEqual(candidate(\"\"),true);\n assert.deepEqual(candidate(\"aba\"),true);\n assert.deepEqual(candidate(\"aaaaa\"),true);\n assert.deepEqual(candidate(\"zbcd\"),false);\n assert.deepEqual(candidate(\"xywyx\"),true);\n assert.deepEqual(candidate(\"xywyz\"),false);\n assert.deepEqual(candidate(\"xywzx\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_62_derivative", - "language": "ts", - "prompt": "//xs represent coefficients of a polynomial.\n// xs[0] + xs[1] * x + xs[2] * x^2 + ....\n// Return derivative of this polynomial in the same form.\n// >>> derivative([3, 1, 2, 4, 5])\n// [1, 4, 12, 20]\n// >>> derivative([1, 2, 3])\n// [2, 6]\nfunction derivative(xs: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = derivative;\n assert.deepEqual(candidate([3, 1, 2, 4, 5]),[1, 4, 12, 20]);\n assert.deepEqual(candidate([1, 2, 3]),[2, 6]);\n assert.deepEqual(candidate([3, 2, 1]),[2, 2]);\n assert.deepEqual(candidate([3, 2, 1, 0, 4]),[2, 2, 0, 16]);\n assert.deepEqual(candidate([1]),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_67_fruit_distribution", - "language": "ts", - "prompt": "//In this task, you will be given a string that represents a number of apples and oranges \n// that are distributed in a basket of fruit this basket contains \n// apples, oranges, and mango fruits. Given the string that represents the total number of \n// the oranges and apples and an integer that represent the total number of the fruits \n// in the basket return the number of the mango fruits in the basket.\n// for examble:\n// >>> fruit_distribution(\"5 apples and 6 oranges\", 19)\n// 8\n// >>> fruit_distribution(\"0 apples and 1 oranges\", 3)\n// 2\n// >>> fruit_distribution(\"2 apples and 3 oranges\", 100)\n// 95\n// >>> fruit_distribution(\"100 apples and 1 oranges\", 120)\n// 19\nfunction fruit_distribution(s: string, n: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fruit_distribution;\n assert.deepEqual(candidate(\"5 apples and 6 oranges\", 19),8);\n assert.deepEqual(candidate(\"5 apples and 6 oranges\", 21),10);\n assert.deepEqual(candidate(\"0 apples and 1 oranges\", 3),2);\n assert.deepEqual(candidate(\"1 apples and 0 oranges\", 3),2);\n assert.deepEqual(candidate(\"2 apples and 3 oranges\", 100),95);\n assert.deepEqual(candidate(\"2 apples and 3 oranges\", 5),0);\n assert.deepEqual(candidate(\"1 apples and 100 oranges\", 120),19);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_77_iscube", - "language": "ts", - "prompt": "//Write a function that takes an integer a and returns True \n// if this ingeger is a cube of some integer number.\n// Note: you may assume the input is always valid.\n// Examples:\n// >>> iscube(1)\n// true\n// >>> iscube(2)\n// false\n// >>> iscube(-1)\n// true\n// >>> iscube(64)\n// true\n// >>> iscube(0)\n// true\n// >>> iscube(180)\n// false\nfunction iscube(a: number): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = iscube;\n assert.deepEqual(candidate(1),true);\n assert.deepEqual(candidate(2),false);\n assert.deepEqual(candidate(-1),true);\n assert.deepEqual(candidate(64),true);\n assert.deepEqual(candidate(180),false);\n assert.deepEqual(candidate(1000),true);\n assert.deepEqual(candidate(0),true);\n assert.deepEqual(candidate(1729),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_116_sort_array", - "language": "ts", - "prompt": "//In this Kata, you have to sort an array of non-negative integers according to\n// number of ones in their binary representation in ascending order.\n// For similar number of ones, sort based on decimal value.\n// It must be implemented like this:\n// >>> sort_array([1, 5, 2, 3, 4])\n// [1, 2, 3, 4, 5]\n// >>> sort_array([-2, -3, -4, -5, -6])\n// [-6, -5, -4, -3, -2]\n// >>> sort_array([1, 0, 2, 3, 4])\n// [0, 1, 2, 3, 4]\nfunction sort_array(arr: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_array;\n assert.deepEqual(candidate([1, 5, 2, 3, 4]),[1, 2, 4, 3, 5]);\n assert.deepEqual(candidate([-2, -3, -4, -5, -6]),[-4, -2, -6, -5, -3]);\n assert.deepEqual(candidate([1, 0, 2, 3, 4]),[0, 1, 2, 4, 3]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]),[2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77]);\n assert.deepEqual(candidate([3, 6, 44, 12, 32, 5]),[32, 3, 5, 6, 12, 44]);\n assert.deepEqual(candidate([2, 4, 8, 16, 32]),[2, 4, 8, 16, 32]);\n assert.deepEqual(candidate([2, 4, 8, 16, 32]),[2, 4, 8, 16, 32]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_113_odd_count", - "language": "ts", - "prompt": "//Given a list of strings, where each string consists of only digits, return a list.\n// Each element i of the output should be \"the number of odd elements in the\n// string i of the input.\" where all the i's should be replaced by the number\n// of odd digits in the i'th string of the input.\n// >>> odd_count([\"1234567\"])\n// [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n// >>> odd_count([\"3\", \"11111111\"])\n// [\"the number of odd elements 1n the str1ng 1 of the 1nput.\", \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\nfunction odd_count(lst: string[]): string[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = odd_count;\n assert.deepEqual(candidate([\"1234567\"]),[\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]);\n assert.deepEqual(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.\"]);\n assert.deepEqual(candidate([\"271\", \"137\", \"314\"]),[\"the number of odd elements 2n the str2ng 2 of the 2nput.\", \"the number of odd elements 3n the str3ng 3 of the 3nput.\", \"the number of odd elements 2n the str2ng 2 of the 2nput.\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_61_correct_bracketing", - "language": "ts", - "prompt": "//brackets is a string of \"(\" and \")\".\n// return True if every opening bracket has a corresponding closing bracket.\n// >>> correct_bracketing(\"(\")\n// false\n// >>> correct_bracketing(\"()\")\n// true\n// >>> correct_bracketing(\"(()())\")\n// true\n// >>> correct_bracketing(\")(()\")\n// false\nfunction correct_bracketing(brackets: string): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = correct_bracketing;\n assert.deepEqual(candidate(\"()\"),true);\n assert.deepEqual(candidate(\"(()())\"),true);\n assert.deepEqual(candidate(\"()()(()())()\"),true);\n assert.deepEqual(candidate(\"()()((()()())())(()()(()))\"),true);\n assert.deepEqual(candidate(\"((()())))\"),false);\n assert.deepEqual(candidate(\")(()\"),false);\n assert.deepEqual(candidate(\"(\"),false);\n assert.deepEqual(candidate(\"((((\"),false);\n assert.deepEqual(candidate(\")\"),false);\n assert.deepEqual(candidate(\"(()\"),false);\n assert.deepEqual(candidate(\"()()(()())())(()\"),false);\n assert.deepEqual(candidate(\"()()(()())()))()\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_66_digitSum", - "language": "ts", - "prompt": "//Task\n// Write a function that takes a string as input and returns the sum of the upper characters only'\n// ASCII codes.\n// Examples:\n// >>> digitSum(\"\")\n// 0\n// >>> digitSum(\"abAB\")\n// 131\n// >>> digitSum(\"abcCd\")\n// 67\n// >>> digitSum(\"helloE\")\n// 69\n// >>> digitSum(\"woArBld\")\n// 131\n// >>> digitSum(\"aAaaaXa\")\n// 153\nfunction digitSum(s: string): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = digitSum;\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"abAB\"),131);\n assert.deepEqual(candidate(\"abcCd\"),67);\n assert.deepEqual(candidate(\"helloE\"),69);\n assert.deepEqual(candidate(\"woArBld\"),131);\n assert.deepEqual(candidate(\"aAaaaXa\"),153);\n assert.deepEqual(candidate(\" How are yOu?\"),151);\n assert.deepEqual(candidate(\"You arE Very Smart\"),327);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_149_sorted_list_sum", - "language": "ts", - "prompt": "//Write a function that accepts a list of strings as a parameter,\n// deletes the strings that have odd lengths from it,\n// and returns the resulted list with a sorted order,\n// The list is always a list of strings and never an array of numbers,\n// and it may contain duplicates.\n// The order of the list should be ascending by length of each word, and you\n// should return the list sorted by that rule.\n// If two words have the same length, sort the list alphabetically.\n// The function should return a list of strings in sorted order.\n// You may assume that all words will have the same length.\n// For example:\n// >>> list_sort([\"aa\", \"a\", \"aaa\"])\n// [\"aa\"]\n// >>> list_sort([\"ab\", \"a\", \"aaa\", \"cd\"])\n// [\"ab\", \"cd\"]\nfunction sorted_list_sum(lst: string[]): string[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sorted_list_sum;\n assert.deepEqual(candidate([\"aa\", \"a\", \"aaa\"]),[\"aa\"]);\n assert.deepEqual(candidate([\"school\", \"AI\", \"asdf\", \"b\"]),[\"AI\", \"asdf\", \"school\"]);\n assert.deepEqual(candidate([\"d\", \"b\", \"c\", \"a\"]),[]);\n assert.deepEqual(candidate([\"d\", \"dcba\", \"abcd\", \"a\"]),[\"abcd\", \"dcba\"]);\n assert.deepEqual(candidate([\"AI\", \"ai\", \"au\"]),[\"AI\", \"ai\", \"au\"]);\n assert.deepEqual(candidate([\"a\", \"b\", \"b\", \"c\", \"c\", \"a\"]),[]);\n assert.deepEqual(candidate([\"aaaa\", \"bbbb\", \"dd\", \"cc\"]),[\"cc\", \"dd\", \"aaaa\", \"bbbb\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_128_prod_signs", - "language": "ts", - "prompt": "//You are given an array arr of integers and you need to return\n// sum of magnitudes of integers multiplied by product of all signs\n// of each number in the array, represented by 1, -1 or 0.\n// Note: return None for empty arr.\n// Example:\n// >>> prod_signs([1, 2, 2, -4])\n// 9\n// >>> prod_signs([0, 1])\n// 0\n// >>> prod_signs([])\n// undefined\nfunction prod_signs(arr: number[]): number | undefined {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = prod_signs;\n assert.deepEqual(candidate([1, 2, 2, -4]),-9);\n assert.deepEqual(candidate([0, 1]),0);\n assert.deepEqual(candidate([1, 1, 1, 2, 3, -1, 1]),-10);\n assert.deepEqual(candidate([]),undefined);\n assert.deepEqual(candidate([2, 4, 1, 2, -1, -1, 9]),20);\n assert.deepEqual(candidate([-1, 1, -1, 1]),4);\n assert.deepEqual(candidate([-1, 1, 1, 1]),-4);\n assert.deepEqual(candidate([-1, 1, 1, 0]),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_42_incr_list", - "language": "ts", - "prompt": "//Return list with elements incremented by 1.\n// >>> incr_list([1, 2, 3])\n// [2, 3, 4]\n// >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123])\n// [6, 4, 6, 3, 4, 4, 10, 1, 124]\nfunction incr_list(l: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = incr_list;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([3, 2, 1]),[4, 3, 2]);\n assert.deepEqual(candidate([5, 2, 5, 2, 3, 3, 9, 0, 123]),[6, 3, 6, 3, 4, 4, 10, 1, 124]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_9_rolling_max", - "language": "ts", - "prompt": "//From a given list of integers, generate a list of rolling maximum element found until given moment\n// in the sequence.\n// >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n// [1, 2, 3, 3, 3, 4, 4]\nfunction rolling_max(numbers: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = rolling_max;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, 2, 3, 4]),[1, 2, 3, 4]);\n assert.deepEqual(candidate([4, 3, 2, 1]),[4, 4, 4, 4]);\n assert.deepEqual(candidate([3, 2, 3, 100, 3]),[3, 3, 3, 100, 100]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_1_separate_paren_groups", - "language": "ts", - "prompt": "//Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n// separate those group into separate strings and return the list of those.\n// Separate groups are balanced (each open brace is properly closed) and not nested within each other\n// Ignore any spaces in the input string.\n// >>> separate_paren_groups(\"( ) (( )) (( )( ))\")\n// [\"()\", \"(())\", \"(()())\"]\nfunction separate_paren_groups(paren_string: string): string[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = separate_paren_groups;\n assert.deepEqual(candidate(\"(()()) ((())) () ((())()())\"),[\"(()())\", \"((()))\", \"()\", \"((())()())\"]);\n assert.deepEqual(candidate(\"() (()) ((())) (((())))\"),[\"()\", \"(())\", \"((()))\", \"(((())))\"]);\n assert.deepEqual(candidate(\"(()(())((())))\"),[\"(()(())((())))\"]);\n assert.deepEqual(candidate(\"( ) (( )) (( )( ))\"),[\"()\", \"(())\", \"(()())\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_101_words_string", - "language": "ts", - "prompt": "//You will be given a string of words separated by commas or spaces. Your task is\n// to split the string into words and return an array of the words.\n// For example:\n// >>> words_string(\"Hi, my name is John\")\n// [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n// >>> words_string(\"One, two, three, four, five, six\")\n// [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\nfunction words_string(s: string): string[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = words_string;\n assert.deepEqual(candidate(\"Hi, my name is John\"),[\"Hi\", \"my\", \"name\", \"is\", \"John\"]);\n assert.deepEqual(candidate(\"One, two, three, four, five, six\"),[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]);\n assert.deepEqual(candidate(\"Hi, my name\"),[\"Hi\", \"my\", \"name\"]);\n assert.deepEqual(candidate(\"One,, two, three, four, five, six,\"),[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]);\n assert.deepEqual(candidate(\"\"),[]);\n assert.deepEqual(candidate(\"ahmed , gamal\"),[\"ahmed\", \"gamal\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_22_filter_integers", - "language": "ts", - "prompt": "//Filter given list of any python values only for integers\n// >>> filter_integers([\"a\", 3.14, 5])\n// [5]\n// >>> filter_integers([1, 2, 3, \"abc\", {}, []])\n// [1, 2, 3]\nfunction filter_integers(values: any[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = filter_integers;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([4, {}, [], 23.2, 9, \"adasd\"]),[4, 9]);\n assert.deepEqual(candidate([3, \"c\", 3, 3, \"a\", \"b\"]),[3, 3, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_37_sort_even", - "language": "ts", - "prompt": "//This function takes a list l and returns a list l' such that\n// l' is identical to l in the odd indicies, while its values at the even indicies are equal\n// to the values of the even indicies of l, but sorted.\n// >>> sort_even([1, 2, 3])\n// [1, 2, 3]\n// >>> sort_even([5, 6, 3, 4])\n// [3, 6, 5, 4]\nfunction sort_even(l: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_even;\n assert.deepEqual(candidate([1, 2, 3]),[1, 2, 3]);\n assert.deepEqual(candidate([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]),[-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123]);\n assert.deepEqual(candidate([5, 8, -12, 4, 23, 2, 3, 11, 12, -10]),[-12, 8, 3, 4, 5, 2, 12, 11, 23, -10]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_152_compare", - "language": "ts", - "prompt": "//I think we all remember that feeling when the result of some long-awaited\n// event is finally known. The feelings and thoughts you have at that moment are\n// definitely worth noting down and comparing.\n// Your task is to determine if a person correctly guessed the results of a number of matches.\n// You are given two arrays of scores and guesses of equal length, where each index shows a match. \n// Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n// the value is 0, and if not, the value is the absolute difference between the guess and the score.\n// example:\n// >>> compare([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2])\n// [0, 0, 0, 0, 3, 3]\n// >>> compare([0, 5, 0, 0, 0, 4], [4, 1, 1, 0, 0, -2])\n// [4, 4, 1, 0, 0, 6]\nfunction compare(game: number[], guess: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = compare;\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2]),[0, 0, 0, 0, 3, 3]);\n assert.deepEqual(candidate([0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]),[0, 0, 0, 0, 0, 0]);\n assert.deepEqual(candidate([1, 2, 3], [-1, -2, -3]),[2, 4, 6]);\n assert.deepEqual(candidate([1, 2, 3, 5], [-1, 2, 3, 4]),[2, 0, 0, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_107_even_odd_palindrome", - "language": "ts", - "prompt": "//Given a positive integer n, return a tuple that has the number of even and odd\n// integer palindromes that fall within the range(1, n), inclusive.\n// Example 1:\n// >>> even_odd_palindrome(3)\n// [1, 2]\n// Explanation:\n// Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n// Example 2:\n// >>> even_odd_palindrome(12)\n// [4, 6]\n// Explanation:\n// Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n// Note:\n// 1. 1 <= n <= 10^3\n// 2. returned tuple has the number of even and odd integer palindromes respectively.\nfunction even_odd_palindrome(n: number): [number, number] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = even_odd_palindrome;\n assert.deepEqual(candidate(123),[8, 13]);\n assert.deepEqual(candidate(12),[4, 6]);\n assert.deepEqual(candidate(3),[1, 2]);\n assert.deepEqual(candidate(63),[6, 8]);\n assert.deepEqual(candidate(25),[5, 6]);\n assert.deepEqual(candidate(19),[4, 6]);\n assert.deepEqual(candidate(9),[4, 5]);\n assert.deepEqual(candidate(1),[0, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_46_fib4", - "language": "ts", - "prompt": "//The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fib4(0) -> 0\n// fib4(1) -> 0\n// fib4(2) -> 2\n// fib4(3) -> 0\n// fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n// Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n// >>> fib4(5)\n// 4\n// >>> fib4(6)\n// 8\n// >>> fib4(7)\n// 14\nfunction fib4(n: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fib4;\n assert.deepEqual(candidate(5),4);\n assert.deepEqual(candidate(8),28);\n assert.deepEqual(candidate(10),104);\n assert.deepEqual(candidate(12),386);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_163_generate_integers", - "language": "ts", - "prompt": "//Given two positive integers a and b, return the even digits between a\n// and b, in ascending order.\n// For example:\n// >>> generate_integers(2, 8)\n// [2, 4, 6, 8]\n// >>> generate_integers(8, 2)\n// [2, 4, 6, 8]\n// >>> generate_integers(10, 14)\n// []\nfunction generate_integers(a: number, b: number): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = generate_integers;\n assert.deepEqual(candidate(2, 10),[2, 4, 6, 8]);\n assert.deepEqual(candidate(10, 2),[2, 4, 6, 8]);\n assert.deepEqual(candidate(132, 2),[2, 4, 6, 8]);\n assert.deepEqual(candidate(17, 89),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_4_mean_absolute_deviation", - "language": "ts", - "prompt": "//For a given list of input numbers, calculate Mean Absolute Deviation\n// around the mean of this dataset.\n// Mean Absolute Deviation is the average absolute difference between each\n// element and a centerpoint (mean in this case):\n// MAD = average | x - x_mean |\n// >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n// 1.0\nfunction mean_absolute_deviation(numbers: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = mean_absolute_deviation;\n assert.deepEqual(candidate([1.0, 2.0]),0.5);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0]),1.0);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0]),1.2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_89_encrypt", - "language": "ts", - "prompt": "//Create a function encrypt that takes a string as an argument and\n// returns a string encrypted with the alphabet being rotated. \n// The alphabet should be rotated in a manner such that the letters \n// shift down by two multiplied to two places.\n// For example:\n// >>> encrypt(\"hi\")\n// \"lm\"\n// >>> encrypt(\"asdfghjkl\")\n// \"ewhjklnop\"\n// >>> encrypt(\"gf\")\n// \"kj\"\n// >>> encrypt(\"et\")\n// \"ix\"\nfunction encrypt(s: string): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = encrypt;\n assert.deepEqual(candidate(\"hi\"),\"lm\");\n assert.deepEqual(candidate(\"asdfghjkl\"),\"ewhjklnop\");\n assert.deepEqual(candidate(\"gf\"),\"kj\");\n assert.deepEqual(candidate(\"et\"),\"ix\");\n assert.deepEqual(candidate(\"faewfawefaewg\"),\"jeiajeaijeiak\");\n assert.deepEqual(candidate(\"hellomyfriend\"),\"lippsqcjvmirh\");\n assert.deepEqual(candidate(\"dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh\"),\"hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl\");\n assert.deepEqual(candidate(\"a\"),\"e\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_123_get_odd_collatz", - "language": "ts", - "prompt": "//Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n// The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n// as follows: start with any positive integer n. Then each term is obtained from the \n// previous term as follows: if the previous term is even, the next term is one half of \n// the previous term. If the previous term is odd, the next term is 3 times the previous\n// term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n// Note: \n// 1. Collatz(1) is [1].\n// 2. returned list sorted in increasing order.\n// For example:\n// get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n// >>> get_odd_collatz(5)\n// [1, 5]\nfunction get_odd_collatz(n: number): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_odd_collatz;\n assert.deepEqual(candidate(14),[1, 5, 7, 11, 13, 17]);\n assert.deepEqual(candidate(5),[1, 5]);\n assert.deepEqual(candidate(12),[1, 3, 5]);\n assert.deepEqual(candidate(1),[1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_18_how_many_times", - "language": "ts", - "prompt": "//Find how many times a given substring can be found in the original string. Count overlaping cases.\n// >>> how_many_times(\"\", \"a\")\n// 0\n// >>> how_many_times(\"aaa\", \"a\")\n// 3\n// >>> how_many_times(\"aaaa\", \"aa\")\n// 3\nfunction how_many_times(string: string, substring: string): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = how_many_times;\n assert.deepEqual(candidate(\"\", \"x\"),0);\n assert.deepEqual(candidate(\"xyxyxyx\", \"x\"),4);\n assert.deepEqual(candidate(\"cacacacac\", \"cac\"),4);\n assert.deepEqual(candidate(\"john doe\", \"john\"),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_109_move_one_ball", - "language": "ts", - "prompt": "//We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n// numbers in the array will be randomly ordered. Your task is to determine if\n// it is possible to get an array sorted in non-decreasing order by performing \n// the following operation on the given array:\n// You are allowed to perform right shift operation any number of times.\n// One right shift operation means shifting all elements of the array by one\n// position in the right direction. The last element of the array will be moved to\n// the starting position in the array i.e. 0th index. \n// If it is possible to obtain the sorted array by performing the above operation\n// then return True else return False.\n// If the given array is empty then return True.\n// Note: The given list is guaranteed to have unique elements.\n// For Example:\n// >>> move_one_ball([3, 4, 5, 1, 2])\n// true\n// Explanation: By performin 2 right shift operations, non-decreasing order can\n// be achieved for the given array.\n// >>> move_one_ball([3, 5, 4, 1, 2])\n// false\n// Explanation:It is not possible to get non-decreasing order for the given\n// array by performing any number of right shift operations.\nfunction move_one_ball(arr: number[]): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = move_one_ball;\n assert.deepEqual(candidate([3, 4, 5, 1, 2]),true);\n assert.deepEqual(candidate([3, 5, 10, 1, 2]),true);\n assert.deepEqual(candidate([4, 3, 1, 2]),false);\n assert.deepEqual(candidate([3, 5, 4, 1, 2]),false);\n assert.deepEqual(candidate([]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_145_order_by_points", - "language": "ts", - "prompt": "//Write a function which sorts the given list of integers\n// in ascending order according to the sum of their digits.\n// Note: if there are several items with similar sum of their digits,\n// order them based on their index in original list.\n// For example:\n// >>> order_by_points([1, 11, -1, -11, -12])\n// [-1, -11, 1, -12, 11]\n// >>> order_by_points([])\n// []\nfunction order_by_points(nums: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = order_by_points;\n assert.deepEqual(candidate([1, 11, -1, -11, -12]),[-1, -11, 1, -12, 11]);\n assert.deepEqual(candidate([1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]),[0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, -11, -32, 43, 54, -98, 2, -3]),[-3, -32, -98, -11, 1, 2, 43, 54]);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]),[1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9]);\n assert.deepEqual(candidate([0, 6, 6, -76, -21, 23, 4]),[-76, -21, 0, 4, 23, 6, 6]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_25_factorize", - "language": "ts", - "prompt": "//Return list of prime factors of given integer in the order from smallest to largest.\n// Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n// Input number should be equal to the product of all factors\n// >>> factorize(8)\n// [2, 2, 2]\n// >>> factorize(25)\n// [5, 5]\n// >>> factorize(70)\n// [2, 5, 7]\nfunction factorize(n: number): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = factorize;\n assert.deepEqual(candidate(2),[2]);\n assert.deepEqual(candidate(4),[2, 2]);\n assert.deepEqual(candidate(8),[2, 2, 2]);\n assert.deepEqual(candidate(57),[3, 19]);\n assert.deepEqual(candidate(3249),[3, 3, 19, 19]);\n assert.deepEqual(candidate(185193),[3, 3, 3, 19, 19, 19]);\n assert.deepEqual(candidate(20577),[3, 19, 19, 19]);\n assert.deepEqual(candidate(18),[2, 3, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_52_below_threshold", - "language": "ts", - "prompt": "//Return True if all numbers in the list l are below threshold t.\n// >>> below_threshold([1, 2, 4, 10], 100)\n// true\n// >>> below_threshold([1, 20, 4, 10], 5)\n// false\nfunction below_threshold(l: number[], t: number): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = below_threshold;\n assert.deepEqual(candidate([1, 2, 4, 10], 100),true);\n assert.deepEqual(candidate([1, 20, 4, 10], 5),false);\n assert.deepEqual(candidate([1, 20, 4, 10], 21),true);\n assert.deepEqual(candidate([1, 20, 4, 10], 22),true);\n assert.deepEqual(candidate([1, 8, 4, 10], 11),true);\n assert.deepEqual(candidate([1, 8, 4, 10], 10),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_103_rounded_avg", - "language": "ts", - "prompt": "//You are given two positive integers n and m, and your task is to compute the\n// average of the integers from n through m (including n and m). \n// Round the answer to the nearest integer and convert that to binary.\n// If n is greater than m, return -1.\n// Example:\n// >>> rounded_avg(1, 5)\n// \"0b11\"\n// >>> rounded_avg(7, 5)\n// -1\n// >>> rounded_avg(10, 20)\n// \"0b1111\"\n// >>> rounded_avg(20, 33)\n// \"0b11010\"\nfunction rounded_avg(n: number, m: number): string| number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = rounded_avg;\n assert.deepEqual(candidate(1, 5),\"0b11\");\n assert.deepEqual(candidate(7, 13),\"0b1010\");\n assert.deepEqual(candidate(964, 977),\"0b1111001010\");\n assert.deepEqual(candidate(996, 997),\"0b1111100100\");\n assert.deepEqual(candidate(560, 851),\"0b1011000010\");\n assert.deepEqual(candidate(185, 546),\"0b101101110\");\n assert.deepEqual(candidate(362, 496),\"0b110101101\");\n assert.deepEqual(candidate(350, 902),\"0b1001110010\");\n assert.deepEqual(candidate(197, 233),\"0b11010111\");\n assert.deepEqual(candidate(7, 5),-1);\n assert.deepEqual(candidate(5, 1),-1);\n assert.deepEqual(candidate(5, 5),\"0b101\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_6_parse_nested_parens", - "language": "ts", - "prompt": "//Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n// For each of the group, output the deepest level of nesting of parentheses.\n// E.g. (()()) has maximum two levels of nesting while ((())) has three.\n// >>> parse_nested_parens(\"(()()) ((())) () ((())()())\")\n// [2, 3, 1, 3]\nfunction parse_nested_parens(paren_string: string): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = parse_nested_parens;\n assert.deepEqual(candidate(\"(()()) ((())) () ((())()())\"),[2, 3, 1, 3]);\n assert.deepEqual(candidate(\"() (()) ((())) (((())))\"),[1, 2, 3, 4]);\n assert.deepEqual(candidate(\"(()(())((())))\"),[4]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_121_solution", - "language": "ts", - "prompt": "//Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n// Examples\n// >>> solution([5, 8, 7, 1])\n// 12\n// >>> solution([3, 3, 3, 3, 3])\n// 9\n// >>> solution([30, 13, 24, 321])\n// 0\nfunction solution(lst: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = solution;\n assert.deepEqual(candidate([5, 8, 7, 1]),12);\n assert.deepEqual(candidate([3, 3, 3, 3, 3]),9);\n assert.deepEqual(candidate([30, 13, 24, 321]),0);\n assert.deepEqual(candidate([5, 9]),5);\n assert.deepEqual(candidate([2, 4, 8]),0);\n assert.deepEqual(candidate([30, 13, 23, 32]),23);\n assert.deepEqual(candidate([3, 13, 2, 9]),3);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_147_get_max_triples", - "language": "ts", - "prompt": "//You are given a positive integer n. You have to create an integer array a of length n.\n// For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n// Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n// and a[i] + a[j] + a[k] is a multiple of 3.\n// Example :\n// >>> get_max_triples(5)\n// 1\n// Explanation: \n// a = [1, 3, 7, 13, 21]\n// The only valid triple is (1, 7, 13).\nfunction get_max_triples(n: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_max_triples;\n assert.deepEqual(candidate(5),1);\n assert.deepEqual(candidate(6),4);\n assert.deepEqual(candidate(10),36);\n assert.deepEqual(candidate(100),53361);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_90_next_smallest", - "language": "ts", - "prompt": "//You are given a list of integers.\n// Write a function next_smallest() that returns the 2nd smallest element of the list.\n// Return None if there is no such element.\n// >>> next_smallest([1, 2, 3, 4, 5])\n// 2\n// >>> next_smallest([5, 1, 4, 3, 2])\n// 2\n// >>> next_smallest([])\n// undefined\n// >>> next_smallest([1, 1])\n// undefined\nfunction next_smallest(lst: number[]): number | undefined {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = next_smallest;\n assert.deepEqual(candidate([1, 2, 3, 4, 5]),2);\n assert.deepEqual(candidate([5, 1, 4, 3, 2]),2);\n assert.deepEqual(candidate([]),undefined);\n assert.deepEqual(candidate([1, 1]),undefined);\n assert.deepEqual(candidate([1, 1, 1, 1, 0]),1);\n assert.deepEqual(candidate([1, 1]),undefined);\n assert.deepEqual(candidate([-35, 34, 12, -45]),-35);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_19_sort_numbers", - "language": "ts", - "prompt": "//Input is a space-delimited string of numberals from 'zero' to 'nine'.\n// Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n// Return the string with numbers sorted from smallest to largest\n// >>> sort_numbers(\"three one five\")\n// \"one three five\"\nfunction sort_numbers(numbers: string): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_numbers;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"three\"),\"three\");\n assert.deepEqual(candidate(\"three five nine\"),\"three five nine\");\n assert.deepEqual(candidate(\"five zero four seven nine eight\"),\"zero four five seven eight nine\");\n assert.deepEqual(candidate(\"six five four three two one zero\"),\"zero one two three four five six\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_154_cycpattern_check", - "language": "ts", - "prompt": "//You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n// >>> cycpattern_check(\"abcd\", \"abd\")\n// false\n// >>> cycpattern_check(\"hello\", \"ell\")\n// true\n// >>> cycpattern_check(\"whassup\", \"psus\")\n// false\n// >>> cycpattern_check(\"abab\", \"baa\")\n// true\n// >>> cycpattern_check(\"efef\", \"eeff\")\n// false\n// >>> cycpattern_check(\"himenss\", \"simen\")\n// true\nfunction cycpattern_check(a: string, b: string): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = cycpattern_check;\n assert.deepEqual(candidate(\"xyzw\", \"xyw\"),false);\n assert.deepEqual(candidate(\"yello\", \"ell\"),true);\n assert.deepEqual(candidate(\"whattup\", \"ptut\"),false);\n assert.deepEqual(candidate(\"efef\", \"fee\"),true);\n assert.deepEqual(candidate(\"abab\", \"aabb\"),false);\n assert.deepEqual(candidate(\"winemtt\", \"tinem\"),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_79_decimal_to_binary", - "language": "ts", - "prompt": "//You will be given a number in decimal form and your task is to convert it to\n// binary format. The function should return a string, with each character representing a binary\n// number. Each character in the string will be '0' or '1'.\n// There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n// The extra characters are there to help with the format.\n// Examples:\n// >>> decimal_to_binary(15)\n// \"db1111db\"\n// >>> decimal_to_binary(32)\n// \"db100000db\"\nfunction decimal_to_binary(decimal: number): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = decimal_to_binary;\n assert.deepEqual(candidate(0),\"db0db\");\n assert.deepEqual(candidate(32),\"db100000db\");\n assert.deepEqual(candidate(103),\"db1100111db\");\n assert.deepEqual(candidate(15),\"db1111db\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_7_filter_by_substring", - "language": "ts", - "prompt": "//Filter an input list of strings only for ones that contain given substring\n// >>> filter_by_substring([], \"a\")\n// []\n// >>> filter_by_substring([\"abc\", \"bacd\", \"cde\", \"array\"], \"a\")\n// [\"abc\", \"bacd\", \"array\"]\nfunction filter_by_substring(strings: string[], substring: string): string[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = filter_by_substring;\n assert.deepEqual(candidate([], \"john\"),[]);\n assert.deepEqual(candidate([\"xxx\", \"asd\", \"xxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xxx\"),[\"xxx\", \"xxxAAA\", \"xxx\"]);\n assert.deepEqual(candidate([\"xxx\", \"asd\", \"aaaxxy\", \"john doe\", \"xxxAAA\", \"xxx\"], \"xx\"),[\"xxx\", \"aaaxxy\", \"xxxAAA\", \"xxx\"]);\n assert.deepEqual(candidate([\"grunt\", \"trumpet\", \"prune\", \"gruesome\"], \"run\"),[\"grunt\", \"prune\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_155_even_odd_count", - "language": "ts", - "prompt": "//Given an integer. return a tuple that has the number of even and odd digits respectively.\n// Example:\n// >>> even_odd_count(-12)\n// [1, 1]\n// >>> even_odd_count(123)\n// [1, 2]\nfunction even_odd_count(num: number): [number, number] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = even_odd_count;\n assert.deepEqual(candidate(7),[0, 1]);\n assert.deepEqual(candidate(-78),[1, 1]);\n assert.deepEqual(candidate(3452),[2, 2]);\n assert.deepEqual(candidate(346211),[3, 3]);\n assert.deepEqual(candidate(-345821),[3, 3]);\n assert.deepEqual(candidate(-2),[1, 0]);\n assert.deepEqual(candidate(-45347),[2, 3]);\n assert.deepEqual(candidate(0),[1, 0]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_158_find_max", - "language": "ts", - "prompt": "//Write a function that accepts a list of strings.\n// The list contains different words. Return the word with maximum number\n// of unique characters. If multiple strings have maximum number of unique\n// characters, return the one which comes first in lexicographical order.\n// >>> find_max([\"name\", \"of\", \"string\"])\n// \"string\"\n// >>> find_max([\"name\", \"enam\", \"game\"])\n// \"enam\"\n// >>> find_max([\"aaaaaaa\", \"bb\", \"cc\"])\n// \"aaaaaaa\"\nfunction find_max(words: string[]): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = find_max;\n assert.deepEqual(candidate([\"name\", \"of\", \"string\"]),\"string\");\n assert.deepEqual(candidate([\"name\", \"enam\", \"game\"]),\"enam\");\n assert.deepEqual(candidate([\"aaaaaaa\", \"bb\", \"cc\"]),\"aaaaaaa\");\n assert.deepEqual(candidate([\"abc\", \"cba\"]),\"abc\");\n assert.deepEqual(candidate([\"play\", \"this\", \"game\", \"of\", \"footbott\"]),\"footbott\");\n assert.deepEqual(candidate([\"we\", \"are\", \"gonna\", \"rock\"]),\"gonna\");\n assert.deepEqual(candidate([\"we\", \"are\", \"a\", \"mad\", \"nation\"]),\"nation\");\n assert.deepEqual(candidate([\"this\", \"is\", \"a\", \"prrk\"]),\"this\");\n assert.deepEqual(candidate([\"b\"]),\"b\");\n assert.deepEqual(candidate([\"play\", \"play\", \"play\"]),\"play\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_83_starts_one_ends", - "language": "ts", - "prompt": "//Given a positive integer n, return the count of the numbers of n-digit\n// positive integers that start or end with 1.\nfunction starts_one_ends(n: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = starts_one_ends;\n assert.deepEqual(candidate(1),1);\n assert.deepEqual(candidate(2),18);\n assert.deepEqual(candidate(3),180);\n assert.deepEqual(candidate(4),1800);\n assert.deepEqual(candidate(5),18000);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_136_largest_smallest_integers", - "language": "ts", - "prompt": "//Create a function that returns a tuple (a, b), where 'a' is\n// the largest of negative integers, and 'b' is the smallest\n// of positive integers in a list.\n// If there is no negative or positive integers, return them as None.\n// Examples:\n// >>> largest_smallest_integers([2, 4, 1, 3, 5, 7])\n// [undefined, 1]\n// >>> largest_smallest_integers([])\n// [undefined, undefined]\n// >>> largest_smallest_integers([0])\n// [undefined, undefined]\nfunction largest_smallest_integers(lst: number[]): [number | undefined, number | undefined] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = largest_smallest_integers;\n assert.deepEqual(candidate([2, 4, 1, 3, 5, 7]),[undefined, 1]);\n assert.deepEqual(candidate([2, 4, 1, 3, 5, 7, 0]),[undefined, 1]);\n assert.deepEqual(candidate([1, 3, 2, 4, 5, 6, -2]),[-2, 1]);\n assert.deepEqual(candidate([4, 5, 3, 6, 2, 7, -7]),[-7, 2]);\n assert.deepEqual(candidate([7, 3, 8, 4, 9, 2, 5, -9]),[-9, 2]);\n assert.deepEqual(candidate([]),[undefined, undefined]);\n assert.deepEqual(candidate([0]),[undefined, undefined]);\n assert.deepEqual(candidate([-1, -3, -5, -6]),[-1, undefined]);\n assert.deepEqual(candidate([-1, -3, -5, -6, 0]),[-1, undefined]);\n assert.deepEqual(candidate([-6, -4, -4, -3, 1]),[-3, 1]);\n assert.deepEqual(candidate([-6, -4, -4, -3, -100, 1]),[-3, 1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_68_pluck", - "language": "ts", - "prompt": "//\"Given an array representing a branch of a tree that has non-negative integer nodes\n// your task is to pluck one of the nodes and return it.\n// The plucked node should be the node with the smallest even value.\n// If multiple nodes with the same smallest even value are found return the node that has smallest index.\n// The plucked node should be returned in a list, [ smalest_value, its index ],\n// If there are no even values or the given array is empty, return [].\n// Example 1:\n// >>> pluck([4, 2, 3])\n// [2, 1]\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 2:\n// >>> pluck([1, 2, 3])\n// [2, 1]\n// Explanation: 2 has the smallest even value, and 2 has the smallest index.\n// Example 3:\n// >>> pluck([])\n// []\n// Example 4:\n// >>> pluck([5, 0, 3, 0, 4, 2])\n// [0, 1]\n// Explanation: 0 is the smallest value, but there are two zeros,\n// so we will choose the first zero, which has the smallest index.\n// Constraints:\n// * 1 <= nodes.length <= 10000\n// * 0 <= node.value\nfunction pluck(arr: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = pluck;\n assert.deepEqual(candidate([4, 2, 3]),[2, 1]);\n assert.deepEqual(candidate([1, 2, 3]),[2, 1]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([5, 0, 3, 0, 4, 2]),[0, 1]);\n assert.deepEqual(candidate([1, 2, 3, 0, 5, 3]),[0, 3]);\n assert.deepEqual(candidate([5, 4, 8, 4, 8]),[4, 1]);\n assert.deepEqual(candidate([7, 6, 7, 1]),[6, 1]);\n assert.deepEqual(candidate([7, 9, 7, 1]),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_108_count_nums", - "language": "ts", - "prompt": "//Write a function count_nums which takes an array of integers and returns\n// the number of elements which has a sum of digits > 0.\n// If a number is negative, then its first signed digit will be negative:\n// e.g. -123 has signed digits -1, 2, and 3.\n// >>> count_nums([])\n// 0\n// >>> count_nums([-1, 11, -11])\n// 1\n// >>> count_nums([1, 1, 2])\n// 3\nfunction count_nums(arr: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_nums;\n assert.deepEqual(candidate([]),0);\n assert.deepEqual(candidate([-1, -2, 0]),0);\n assert.deepEqual(candidate([1, 1, 2, -2, 3, 4, 5]),6);\n assert.deepEqual(candidate([1, 6, 9, -6, 0, 1, 5]),5);\n assert.deepEqual(candidate([1, 100, 98, -7, 1, -1]),4);\n assert.deepEqual(candidate([12, 23, 34, -45, -56, 0]),5);\n assert.deepEqual(candidate([0, 1]),1);\n assert.deepEqual(candidate([1]),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_129_minPath", - "language": "ts", - "prompt": "//Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n// each cell of the grid contains a value. Every integer in the range [1, N * N]\n// inclusive appears exactly once on the cells of the grid.\n// You have to find the minimum path of length k in the grid. You can start\n// from any cell, and in each step you can move to any of the neighbor cells,\n// in other words, you can go to cells which share an edge with you current\n// cell.\n// Please note that a path of length k means visiting exactly k cells (not\n// necessarily distinct).\n// You CANNOT go off the grid.\n// A path A (of length k) is considered less than a path B (of length k) if\n// after making the ordered lists of the values on the cells that A and B go\n// through (let's call them lst_A and lst_B), lst_A is lexicographically less\n// than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n// such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n// lst_A[j] = lst_B[j].\n// It is guaranteed that the answer is unique.\n// Return an ordered list of the values on the cells that the minimum path go through.\n// Examples: \n// >>> minPath([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3)\n// [1, 2, 1]\n// >>> minPath([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1)\n// [1]\nfunction minPath(grid: number[][], k: number): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = minPath;\n assert.deepEqual(candidate([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3),[1, 2, 1]);\n assert.deepEqual(candidate([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1),[1]);\n assert.deepEqual(candidate([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], 4),[1, 2, 1, 2]);\n assert.deepEqual(candidate([[6, 4, 13, 10], [5, 7, 12, 1], [3, 16, 11, 15], [8, 14, 9, 2]], 7),[1, 10, 1, 10, 1, 10, 1]);\n assert.deepEqual(candidate([[8, 14, 9, 2], [6, 4, 13, 15], [5, 7, 1, 12], [3, 10, 11, 16]], 5),[1, 7, 1, 7, 1]);\n assert.deepEqual(candidate([[11, 8, 7, 2], [5, 16, 14, 4], [9, 3, 15, 6], [12, 13, 10, 1]], 9),[1, 6, 1, 6, 1, 6, 1, 6, 1]);\n assert.deepEqual(candidate([[12, 13, 10, 1], [9, 3, 15, 6], [5, 16, 14, 4], [11, 8, 7, 2]], 12),[1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6]);\n assert.deepEqual(candidate([[2, 7, 4], [3, 1, 5], [6, 8, 9]], 8),[1, 3, 1, 3, 1, 3, 1, 3]);\n assert.deepEqual(candidate([[6, 1, 5], [3, 8, 9], [2, 7, 4]], 8),[1, 5, 1, 5, 1, 5, 1, 5]);\n assert.deepEqual(candidate([[1, 2], [3, 4]], 10),[1, 2, 1, 2, 1, 2, 1, 2, 1, 2]);\n assert.deepEqual(candidate([[1, 3], [3, 2]], 10),[1, 3, 1, 3, 1, 3, 1, 3, 1, 3]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_70_strange_sort_list", - "language": "ts", - "prompt": "//Given list of integers, return list in strange order.\n// Strange sorting, is when you start with the minimum value,\n// then maximum of the remaining integers, then minimum and so on.\n// Examples:\n// >>> strange_sort_list([1, 2, 3, 4])\n// [1, 4, 2, 3]\n// >>> strange_sort_list([5, 5, 5, 5])\n// [5, 5, 5, 5]\n// >>> strange_sort_list([])\n// []\nfunction strange_sort_list(lst: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = strange_sort_list;\n assert.deepEqual(candidate([1, 2, 3, 4]),[1, 4, 2, 3]);\n assert.deepEqual(candidate([5, 6, 7, 8, 9]),[5, 9, 6, 8, 7]);\n assert.deepEqual(candidate([1, 2, 3, 4, 5]),[1, 5, 2, 4, 3]);\n assert.deepEqual(candidate([5, 6, 7, 8, 9, 1]),[1, 9, 5, 8, 6, 7]);\n assert.deepEqual(candidate([5, 5, 5, 5]),[5, 5, 5, 5]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6, 7, 8]),[1, 8, 2, 7, 3, 6, 4, 5]);\n assert.deepEqual(candidate([0, 2, 2, 2, 5, 5, -5, -5]),[-5, 5, -5, 5, 0, 2, 2, 2]);\n assert.deepEqual(candidate([111111]),[111111]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_162_string_to_md5", - "language": "ts", - "prompt": "//Given a string 'text', return its md5 hash equivalent string.\n// If 'text' is an empty string, return None.\n// >>> string_to_md5(\"Hello world\")\n// \"3e25960a79dbc69b674cd4ec67a72c62\"\nfunction string_to_md5(text: string): string | undefined {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = string_to_md5;\n assert.deepEqual(candidate(\"Hello world\"),\"3e25960a79dbc69b674cd4ec67a72c62\");\n assert.deepEqual(candidate(\"\"),undefined);\n assert.deepEqual(candidate(\"A B C\"),\"0ef78513b0cb8cef12743f5aeb35f888\");\n assert.deepEqual(candidate(\"password\"),\"5f4dcc3b5aa765d61d8327deb882cf99\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_118_get_closest_vowel", - "language": "ts", - "prompt": "//You are given a word. Your task is to find the closest vowel that stands between \n// two consonants from the right side of the word (case sensitive).\n// Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n// find any vowel met the above condition. \n// You may assume that the given string contains English letter only.\n// Example:\n// >>> get_closest_vowel(\"yogurt\")\n// \"u\"\n// >>> get_closest_vowel(\"FULL\")\n// \"U\"\n// >>> get_closest_vowel(\"quick\")\n// \"\"\n// >>> get_closest_vowel(\"ab\")\n// \"\"\nfunction get_closest_vowel(word: string): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_closest_vowel;\n assert.deepEqual(candidate(\"yogurt\"),\"u\");\n assert.deepEqual(candidate(\"full\"),\"u\");\n assert.deepEqual(candidate(\"easy\"),\"\");\n assert.deepEqual(candidate(\"eAsy\"),\"\");\n assert.deepEqual(candidate(\"ali\"),\"\");\n assert.deepEqual(candidate(\"bad\"),\"a\");\n assert.deepEqual(candidate(\"most\"),\"o\");\n assert.deepEqual(candidate(\"ab\"),\"\");\n assert.deepEqual(candidate(\"ba\"),\"\");\n assert.deepEqual(candidate(\"quick\"),\"\");\n assert.deepEqual(candidate(\"anime\"),\"i\");\n assert.deepEqual(candidate(\"Asia\"),\"\");\n assert.deepEqual(candidate(\"Above\"),\"o\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_44_change_base", - "language": "ts", - "prompt": "//Change numerical base of input number x to base.\n// return string representation after the conversion.\n// base numbers are less than 10.\n// >>> change_base(8, 3)\n// \"22\"\n// >>> change_base(8, 2)\n// \"1000\"\n// >>> change_base(7, 2)\n// \"111\"\nfunction change_base(x: number, base: number): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = change_base;\n assert.deepEqual(candidate(8, 3),\"22\");\n assert.deepEqual(candidate(9, 3),\"100\");\n assert.deepEqual(candidate(234, 2),\"11101010\");\n assert.deepEqual(candidate(16, 2),\"10000\");\n assert.deepEqual(candidate(8, 2),\"1000\");\n assert.deepEqual(candidate(7, 2),\"111\");\n assert.deepEqual(candidate(2, 3),\"2\");\n assert.deepEqual(candidate(3, 4),\"3\");\n assert.deepEqual(candidate(4, 5),\"4\");\n assert.deepEqual(candidate(5, 6),\"5\");\n assert.deepEqual(candidate(6, 7),\"6\");\n assert.deepEqual(candidate(7, 8),\"7\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_0_has_close_elements", - "language": "ts", - "prompt": "//Check if in given list of numbers, are any two numbers closer to each other than\n// given threshold.\n// >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n// false\n// >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n// true\nfunction has_close_elements(numbers: number[], threshold: number): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = has_close_elements;\n assert.deepEqual(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3),true);\n assert.deepEqual(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05),false);\n assert.deepEqual(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.95),true);\n assert.deepEqual(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.8),false);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1),true);\n assert.deepEqual(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 1.0),true);\n assert.deepEqual(candidate([1.1, 2.2, 3.1, 4.1, 5.1], 0.5),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_132_is_nested", - "language": "ts", - "prompt": "//Create a function that takes a string as input which contains only square brackets.\n// The function should return True if and only if there is a valid subsequence of brackets \n// where at least one bracket in the subsequence is nested.\n// >>> is_nested(\"[[]]\")\n// true\n// >>> is_nested(\"[]]]]]]][[[[[]\")\n// false\n// >>> is_nested(\"[][]\")\n// false\n// >>> is_nested(\"[]\")\n// false\n// >>> is_nested(\"[[][]]\")\n// true\n// >>> is_nested(\"[[]][[\")\n// true\nfunction is_nested(string: string): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_nested;\n assert.deepEqual(candidate(\"[[]]\"),true);\n assert.deepEqual(candidate(\"[]]]]]]][[[[[]\"),false);\n assert.deepEqual(candidate(\"[][]\"),false);\n assert.deepEqual(candidate(\"[]\"),false);\n assert.deepEqual(candidate(\"[[[[]]]]\"),true);\n assert.deepEqual(candidate(\"[]]]]]]]]]]\"),false);\n assert.deepEqual(candidate(\"[][][[]]\"),true);\n assert.deepEqual(candidate(\"[[]\"),false);\n assert.deepEqual(candidate(\"[]]\"),false);\n assert.deepEqual(candidate(\"[[]][[\"),true);\n assert.deepEqual(candidate(\"[[][]]\"),true);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"[[[[[[[[\"),false);\n assert.deepEqual(candidate(\"]]]]]]]]\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_28_concatenate", - "language": "ts", - "prompt": "//Concatenate list of strings into a single string\n// >>> concatenate([])\n// \"\"\n// >>> concatenate([\"a\", \"b\", \"c\"])\n// \"abc\"\nfunction concatenate(strings: string[]): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = concatenate;\n assert.deepEqual(candidate([]),\"\");\n assert.deepEqual(candidate([\"x\", \"y\", \"z\"]),\"xyz\");\n assert.deepEqual(candidate([\"x\", \"y\", \"z\", \"w\", \"k\"]),\"xyzwk\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_39_prime_fib", - "language": "ts", - "prompt": "//prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n// >>> prime_fib(1)\n// 2\n// >>> prime_fib(2)\n// 3\n// >>> prime_fib(3)\n// 5\n// >>> prime_fib(4)\n// 13\n// >>> prime_fib(5)\n// 89\nfunction prime_fib(n: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = prime_fib;\n assert.deepEqual(candidate(1),2);\n assert.deepEqual(candidate(2),3);\n assert.deepEqual(candidate(3),5);\n assert.deepEqual(candidate(4),13);\n assert.deepEqual(candidate(5),89);\n assert.deepEqual(candidate(6),233);\n assert.deepEqual(candidate(7),1597);\n assert.deepEqual(candidate(8),28657);\n assert.deepEqual(candidate(9),514229);\n assert.deepEqual(candidate(10),433494437);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_20_find_closest_elements", - "language": "ts", - "prompt": "//From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n// other and return them in order (smaller number, larger number).\n// >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n// [2.0, 2.2]\n// >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n// [2.0, 2.0]\nfunction find_closest_elements(numbers: number[]): [number, number] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = find_closest_elements;\n assert.deepEqual(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2]),[3.9, 4.0]);\n assert.deepEqual(candidate([1.0, 2.0, 5.9, 4.0, 5.0]),[5.0, 5.9]);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]),[2.0, 2.2]);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]),[2.0, 2.0]);\n assert.deepEqual(candidate([1.1, 2.2, 3.1, 4.1, 5.1]),[2.2, 3.1]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_78_hex_key", - "language": "ts", - "prompt": "//You have been tasked to write a function that receives \n// a hexadecimal number as a string and counts the number of hexadecimal \n// digits that are primes (prime number, or a prime, is a natural number \n// greater than 1 that is not a product of two smaller natural numbers).\n// Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n// Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n// So you have to determine a number of the following digits: 2, 3, 5, 7, \n// B (=decimal 11), D (=decimal 13).\n// Note: you may assume the input is always correct or empty string, \n// and symbols A,B,C,D,E,F are always uppercase.\n// Examples:\n// >>> hex_key(\"AB\")\n// 1\n// >>> hex_key(\"1077E\")\n// 2\n// >>> hex_key(\"ABED1A33\")\n// 4\n// >>> hex_key(\"123456789ABCDEF0\")\n// 6\n// >>> hex_key(\"2020\")\n// 2\nfunction hex_key(num: string): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = hex_key;\n assert.deepEqual(candidate(\"AB\"),1);\n assert.deepEqual(candidate(\"1077E\"),2);\n assert.deepEqual(candidate(\"ABED1A33\"),4);\n assert.deepEqual(candidate(\"2020\"),2);\n assert.deepEqual(candidate(\"123456789ABCDEF0\"),6);\n assert.deepEqual(candidate(\"112233445566778899AABBCCDDEEFF00\"),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_97_multiply", - "language": "ts", - "prompt": "//Complete the function that takes two integers and returns \n// the product of their unit digits.\n// Assume the input is always valid.\n// Examples:\n// >>> multiply(148, 412)\n// 16\n// >>> multiply(19, 28)\n// 72\n// >>> multiply(2020, 1851)\n// 0\n// >>> multiply(14, -15)\n// 20\nfunction multiply(a: number, b: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = multiply;\n assert.deepEqual(candidate(148, 412),16);\n assert.deepEqual(candidate(19, 28),72);\n assert.deepEqual(candidate(2020, 1851),0);\n assert.deepEqual(candidate(14, -15),20);\n assert.deepEqual(candidate(76, 67),42);\n assert.deepEqual(candidate(17, 27),49);\n assert.deepEqual(candidate(0, 1),0);\n assert.deepEqual(candidate(0, 0),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_21_rescale_to_unit", - "language": "ts", - "prompt": "//Given list of numbers (of at least two elements), apply a linear transform to that list,\n// such that the smallest number will become 0 and the largest will become 1\n// >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n// [0.0, 0.25, 0.5, 0.75, 1.0]\nfunction rescale_to_unit(numbers: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = rescale_to_unit;\n assert.deepEqual(candidate([2.0, 49.9]),[0.0, 1.0]);\n assert.deepEqual(candidate([100.0, 49.9]),[1.0, 0.0]);\n assert.deepEqual(candidate([1.0, 2.0, 3.0, 4.0, 5.0]),[0.0, 0.25, 0.5, 0.75, 1.0]);\n assert.deepEqual(candidate([2.0, 1.0, 5.0, 3.0, 4.0]),[0.25, 0.0, 1.0, 0.5, 0.75]);\n assert.deepEqual(candidate([12.0, 11.0, 15.0, 13.0, 14.0]),[0.25, 0.0, 1.0, 0.5, 0.75]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_131_digits", - "language": "ts", - "prompt": "//Given a positive integer n, return the product of the odd digits.\n// Return 0 if all digits are even.\n// For example:\n// >>> digits(1)\n// 1\n// >>> digits(4)\n// 0\n// >>> digits(235)\n// 15\nfunction digits(n: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = digits;\n assert.deepEqual(candidate(5),5);\n assert.deepEqual(candidate(54),5);\n assert.deepEqual(candidate(120),1);\n assert.deepEqual(candidate(5014),5);\n assert.deepEqual(candidate(98765),315);\n assert.deepEqual(candidate(5576543),2625);\n assert.deepEqual(candidate(2468),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_153_Strongest_Extension", - "language": "ts", - "prompt": "//You will be given the name of a class (a string) and a list of extensions.\n// The extensions are to be used to load additional classes to the class. The\n// strength of the extension is as follows: Let CAP be the number of the uppercase\n// letters in the extension's name, and let SM be the number of lowercase letters \n// in the extension's name, the strength is given by the fraction CAP - SM. \n// You should find the strongest extension and return a string in this \n// format: ClassName.StrongestExtensionName.\n// If there are two or more extensions with the same strength, you should\n// choose the one that comes first in the list.\n// For example, if you are given \"Slices\" as the class and a list of the\n// extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n// return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n// (its strength is -1).\n// Example:\n// >>> Strongest_Extension(\"my_class\", [\"AA\", \"Be\", \"CC\"])\n// \"my_class.AA\"\nfunction Strongest_Extension(class_name: string, extensions: string[]): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = Strongest_Extension;\n assert.deepEqual(candidate(\"Watashi\", [\"tEN\", \"niNE\", \"eIGHt8OKe\"]),\"Watashi.eIGHt8OKe\");\n assert.deepEqual(candidate(\"Boku123\", [\"nani\", \"NazeDa\", \"YEs.WeCaNe\", \"32145tggg\"]),\"Boku123.YEs.WeCaNe\");\n assert.deepEqual(candidate(\"__YESIMHERE\", [\"t\", \"eMptY\", \"nothing\", \"zeR00\", \"NuLl__\", \"123NoooneB321\"]),\"__YESIMHERE.NuLl__\");\n assert.deepEqual(candidate(\"K\", [\"Ta\", \"TAR\", \"t234An\", \"cosSo\"]),\"K.TAR\");\n assert.deepEqual(candidate(\"__HAHA\", [\"Tab\", \"123\", \"781345\", \"-_-\"]),\"__HAHA.123\");\n assert.deepEqual(candidate(\"YameRore\", [\"HhAas\", \"okIWILL123\", \"WorkOut\", \"Fails\", \"-_-\"]),\"YameRore.okIWILL123\");\n assert.deepEqual(candidate(\"finNNalLLly\", [\"Die\", \"NowW\", \"Wow\", \"WoW\"]),\"finNNalLLly.WoW\");\n assert.deepEqual(candidate(\"_\", [\"Bb\", \"91245\"]),\"_.Bb\");\n assert.deepEqual(candidate(\"Sp\", [\"671235\", \"Bb\"]),\"Sp.671235\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_111_histogram", - "language": "ts", - "prompt": "//Given a string representing a space separated lowercase letters, return a dictionary\n// of the letter with the most repetition and containing the corresponding count.\n// If several letters have the same occurrence, return all of them.\n// Example:\n// >>> histogram(\"a b c\")\n// {\"a\": 1, \"b\": 1, \"c\": 1}\n// >>> histogram(\"a b b a\")\n// {\"a\": 2, \"b\": 2}\n// >>> histogram(\"a b c a b\")\n// {\"a\": 2, \"b\": 2}\n// >>> histogram(\"b b b b a\")\n// {\"b\": 4}\n// >>> histogram(\"\")\n// {}\nfunction histogram(test: string): {[key: string]: number} {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = histogram;\n assert.deepEqual(candidate(\"a b b a\"),{\"a\": 2, \"b\": 2});\n assert.deepEqual(candidate(\"a b c a b\"),{\"a\": 2, \"b\": 2});\n assert.deepEqual(candidate(\"a b c d g\"),{\"a\": 1, \"b\": 1, \"c\": 1, \"d\": 1, \"g\": 1});\n assert.deepEqual(candidate(\"r t g\"),{\"r\": 1, \"t\": 1, \"g\": 1});\n assert.deepEqual(candidate(\"b b b b a\"),{\"b\": 4});\n assert.deepEqual(candidate(\"r t g\"),{\"r\": 1, \"t\": 1, \"g\": 1});\n assert.deepEqual(candidate(\"\"),{});\n assert.deepEqual(candidate(\"a\"),{\"a\": 1});\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_43_pairs_sum_to_zero", - "language": "ts", - "prompt": "//pairs_sum_to_zero takes a list of integers as an input.\n// it returns True if there are two distinct elements in the list that\n// sum to zero, and False otherwise.\n// >>> pairs_sum_to_zero([1, 3, 5, 0])\n// false\n// >>> pairs_sum_to_zero([1, 3, -2, 1])\n// false\n// >>> pairs_sum_to_zero([1, 2, 3, 7])\n// false\n// >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7])\n// true\n// >>> pairs_sum_to_zero([1])\n// false\nfunction pairs_sum_to_zero(l: number[]): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = pairs_sum_to_zero;\n assert.deepEqual(candidate([1, 3, 5, 0]),false);\n assert.deepEqual(candidate([1, 3, -2, 1]),false);\n assert.deepEqual(candidate([1, 2, 3, 7]),false);\n assert.deepEqual(candidate([2, 4, -5, 3, 5, 7]),true);\n assert.deepEqual(candidate([1]),false);\n assert.deepEqual(candidate([-3, 9, -1, 3, 2, 30]),true);\n assert.deepEqual(candidate([-3, 9, -1, 3, 2, 31]),true);\n assert.deepEqual(candidate([-3, 9, -1, 4, 2, 30]),false);\n assert.deepEqual(candidate([-3, 9, -1, 4, 2, 31]),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_74_total_match", - "language": "ts", - "prompt": "//Write a function that accepts two lists of strings and returns the list that has \n// total number of chars in the all strings of the list less than the other list.\n// if the two lists have the same number of chars, return the first list.\n// Examples\n// >>> total_match([], [])\n// []\n// >>> total_match([\"hi\", \"admin\"], [\"hI\", \"Hi\"])\n// [\"hI\", \"Hi\"]\n// >>> total_match([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"])\n// [\"hi\", \"admin\"]\n// >>> total_match([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"])\n// [\"hI\", \"hi\", \"hi\"]\n// >>> total_match([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"])\n// [\"4\"]\nfunction total_match(lst1: string[], lst2: string[]): string[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = total_match;\n assert.deepEqual(candidate([], []),[]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\"]),[\"hi\", \"hi\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hi\", \"hi\", \"admin\", \"project\"]),[\"hi\", \"admin\"]);\n assert.deepEqual(candidate([\"4\"], [\"1\", \"2\", \"3\", \"4\", \"5\"]),[\"4\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hI\", \"Hi\"]),[\"hI\", \"Hi\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hi\"]),[\"hI\", \"hi\", \"hi\"]);\n assert.deepEqual(candidate([\"hi\", \"admin\"], [\"hI\", \"hi\", \"hii\"]),[\"hi\", \"admin\"]);\n assert.deepEqual(candidate([], [\"this\"]),[]);\n assert.deepEqual(candidate([\"this\"], []),[]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_65_circular_shift", - "language": "ts", - "prompt": "//Circular shift the digits of the integer x, shift the digits right by shift\n// and return the result as a string.\n// If shift > number of digits, return digits reversed.\n// >>> circular_shift(12, 1)\n// \"21\"\n// >>> circular_shift(12, 2)\n// \"12\"\nfunction circular_shift(x: number, shift: number): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = circular_shift;\n assert.deepEqual(candidate(100, 2),\"001\");\n assert.deepEqual(candidate(12, 2),\"12\");\n assert.deepEqual(candidate(97, 8),\"79\");\n assert.deepEqual(candidate(12, 1),\"21\");\n assert.deepEqual(candidate(11, 101),\"11\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_57_monotonic", - "language": "ts", - "prompt": "//Return True is list elements are monotonically increasing or decreasing.\n// >>> monotonic([1, 2, 4, 20])\n// true\n// >>> monotonic([1, 20, 4, 10])\n// false\n// >>> monotonic([4, 1, 0, -10])\n// true\nfunction monotonic(l: number[]): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = monotonic;\n assert.deepEqual(candidate([1, 2, 4, 10]),true);\n assert.deepEqual(candidate([1, 2, 4, 20]),true);\n assert.deepEqual(candidate([1, 20, 4, 10]),false);\n assert.deepEqual(candidate([4, 1, 0, -10]),true);\n assert.deepEqual(candidate([4, 1, 1, 0]),true);\n assert.deepEqual(candidate([1, 2, 3, 2, 5, 60]),false);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 60]),true);\n assert.deepEqual(candidate([9, 9, 9, 9]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_138_is_equal_to_sum_even", - "language": "ts", - "prompt": "//Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n// Example\n// >>> is_equal_to_sum_even(4)\n// false\n// >>> is_equal_to_sum_even(6)\n// false\n// >>> is_equal_to_sum_even(8)\n// true\nfunction is_equal_to_sum_even(n: number): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_equal_to_sum_even;\n assert.deepEqual(candidate(4),false);\n assert.deepEqual(candidate(6),false);\n assert.deepEqual(candidate(8),true);\n assert.deepEqual(candidate(10),true);\n assert.deepEqual(candidate(11),false);\n assert.deepEqual(candidate(12),true);\n assert.deepEqual(candidate(13),false);\n assert.deepEqual(candidate(16),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_17_parse_music", - "language": "ts", - "prompt": "//Input to this function is a string representing musical notes in a special ASCII format.\n// Your task is to parse this string and return list of integers corresponding to how many beats does each\n// not last.\n// Here is a legend:\n// 'o' - whole note, lasts four beats\n// 'o|' - half note, lasts two beats\n// '.|' - quater note, lasts one beat\n// >>> parse_music(\"o o| .| o| o| .| .| .| .| o o\")\n// [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\nfunction parse_music(music_string: string): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = parse_music;\n assert.deepEqual(candidate(\"\"),[]);\n assert.deepEqual(candidate(\"o o o o\"),[4, 4, 4, 4]);\n assert.deepEqual(candidate(\".| .| .| .|\"),[1, 1, 1, 1]);\n assert.deepEqual(candidate(\"o| o| .| .| o o o o\"),[2, 2, 1, 1, 4, 4, 4, 4]);\n assert.deepEqual(candidate(\"o| .| o| .| o o| o o|\"),[2, 1, 2, 1, 4, 2, 4, 2]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_142_sum_squares", - "language": "ts", - "prompt": "//\"\n// This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n// multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n// change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n// Examples:\n// >>> lst\n// [1, 2, 3]\n// >>> lst\n// []\n// >>> lst\n// [-1, -5, 2, -1, -5]\nfunction sum_squares(lst: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_squares;\n assert.deepEqual(candidate([1, 2, 3]),6);\n assert.deepEqual(candidate([1, 4, 9]),14);\n assert.deepEqual(candidate([]),0);\n assert.deepEqual(candidate([1, 1, 1, 1, 1, 1, 1, 1, 1]),9);\n assert.deepEqual(candidate([-1, -1, -1, -1, -1, -1, -1, -1, -1]),-3);\n assert.deepEqual(candidate([0]),0);\n assert.deepEqual(candidate([-1, -5, 2, -1, -5]),-126);\n assert.deepEqual(candidate([-56, -99, 1, 0, -2]),3030);\n assert.deepEqual(candidate([-1, 0, 0, 0, 0, 0, 0, 0, -1]),0);\n assert.deepEqual(candidate([-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37]),-14196);\n assert.deepEqual(candidate([-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10]),-1448);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_40_triples_sum_to_zero", - "language": "ts", - "prompt": "//triples_sum_to_zero takes a list of integers as an input.\n// it returns True if there are three distinct elements in the list that\n// sum to zero, and False otherwise.\n// >>> triples_sum_to_zero([1, 3, 5, 0])\n// false\n// >>> triples_sum_to_zero([1, 3, -2, 1])\n// true\n// >>> triples_sum_to_zero([1, 2, 3, 7])\n// false\n// >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n// true\n// >>> triples_sum_to_zero([1])\n// false\nfunction triples_sum_to_zero(l: number[]): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = triples_sum_to_zero;\n assert.deepEqual(candidate([1, 3, 5, 0]),false);\n assert.deepEqual(candidate([1, 3, 5, -1]),false);\n assert.deepEqual(candidate([1, 3, -2, 1]),true);\n assert.deepEqual(candidate([1, 2, 3, 7]),false);\n assert.deepEqual(candidate([1, 2, 5, 7]),false);\n assert.deepEqual(candidate([2, 4, -5, 3, 9, 7]),true);\n assert.deepEqual(candidate([1]),false);\n assert.deepEqual(candidate([1, 3, 5, -100]),false);\n assert.deepEqual(candidate([100, 3, 5, -100]),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_56_correct_bracketing", - "language": "ts", - "prompt": "//brackets is a string of \"<\" and \">\".\n// return True if every opening bracket has a corresponding closing bracket.\n// >>> correct_bracketing(\"<\")\n// false\n// >>> correct_bracketing(\"<>\")\n// true\n// >>> correct_bracketing(\"<<><>>\")\n// true\n// >>> correct_bracketing(\"><<>\")\n// false\nfunction correct_bracketing(brackets: string): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = correct_bracketing;\n assert.deepEqual(candidate(\"<>\"),true);\n assert.deepEqual(candidate(\"<<><>>\"),true);\n assert.deepEqual(candidate(\"<><><<><>><>\"),true);\n assert.deepEqual(candidate(\"<><><<<><><>><>><<><><<>>>\"),true);\n assert.deepEqual(candidate(\"<<<><>>>>\"),false);\n assert.deepEqual(candidate(\"><<>\"),false);\n assert.deepEqual(candidate(\"<\"),false);\n assert.deepEqual(candidate(\"<<<<\"),false);\n assert.deepEqual(candidate(\">\"),false);\n assert.deepEqual(candidate(\"<<>\"),false);\n assert.deepEqual(candidate(\"<><><<><>><>><<>\"),false);\n assert.deepEqual(candidate(\"<><><<><>><>>><>\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_146_specialFilter", - "language": "ts", - "prompt": "//Write a function that takes an array of numbers as input and returns \n// the number of elements in the array that are greater than 10 and both \n// first and last digits of a number are odd (1, 3, 5, 7, 9).\n// For example:\n// >>> specialFilter([15, -73, 14, -15])\n// 1\n// >>> specialFilter([33, -2, -3, 45, 21, 109])\n// 2\nfunction specialFilter(nums: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = specialFilter;\n assert.deepEqual(candidate([5, -2, 1, -5]),0);\n assert.deepEqual(candidate([15, -73, 14, -15]),1);\n assert.deepEqual(candidate([33, -2, -3, 45, 21, 109]),2);\n assert.deepEqual(candidate([43, -12, 93, 125, 121, 109]),4);\n assert.deepEqual(candidate([71, -2, -33, 75, 21, 19]),3);\n assert.deepEqual(candidate([1]),0);\n assert.deepEqual(candidate([]),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_95_check_dict_case", - "language": "ts", - "prompt": "//Given a dictionary, return True if all keys are strings in lower \n// case or all keys are strings in upper case, else return False.\n// The function should return False is the given dictionary is empty.\n// Examples:\n// >>> check_dict_case({\"a\": \"apple\", \"b\": \"banana\"})\n// true\n// >>> check_dict_case({\"a\": \"apple\", \"A\": \"banana\", \"B\": \"banana\"})\n// false\n// >>> check_dict_case({\"a\": \"apple\", 8: \"banana\", \"a\": \"apple\"})\n// false\n// >>> check_dict_case({\"Name\": \"John\", \"Age\": \"36\", \"City\": \"Houston\"})\n// false\n// >>> check_dict_case({\"STATE\": \"NC\", \"ZIP\": \"12345\"})\n// true\nfunction check_dict_case(dict: {[key: string]: string}): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = check_dict_case;\n assert.deepEqual(candidate({\"p\": \"pineapple\", \"b\": \"banana\"}),true);\n assert.deepEqual(candidate({\"p\": \"pineapple\", \"A\": \"banana\", \"B\": \"banana\"}),false);\n assert.deepEqual(candidate({\"p\": \"pineapple\", \"5\": \"banana\", \"a\": \"apple\"}),false);\n assert.deepEqual(candidate({\"Name\": \"John\", \"Age\": \"36\", \"City\": \"Houston\"}),false);\n assert.deepEqual(candidate({\"STATE\": \"NC\", \"ZIP\": \"12345\"}),true);\n assert.deepEqual(candidate({\"fruit\": \"Orange\", \"taste\": \"Sweet\"}),true);\n assert.deepEqual(candidate({}),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_125_split_words", - "language": "ts", - "prompt": "//Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n// should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n// alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n// Examples\n// >>> split_words(\"Hello world!\")\n// [\"Hello\", \"world!\"]\n// >>> split_words(\"Hello,world!\")\n// [\"Hello\", \"world!\"]\n// >>> split_words(\"abcdef\")\n// 3\nfunction split_words(txt: string): string[]| number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = split_words;\n assert.deepEqual(candidate(\"Hello world!\"),[\"Hello\", \"world!\"]);\n assert.deepEqual(candidate(\"Hello,world!\"),[\"Hello\", \"world!\"]);\n assert.deepEqual(candidate(\"Hello world,!\"),[\"Hello\", \"world,!\"]);\n assert.deepEqual(candidate(\"Hello,Hello,world !\"),[\"Hello,Hello,world\", \"!\"]);\n assert.deepEqual(candidate(\"abcdef\"),3);\n assert.deepEqual(candidate(\"aaabb\"),2);\n assert.deepEqual(candidate(\"aaaBb\"),1);\n assert.deepEqual(candidate(\"\"),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_63_fibfib", - "language": "ts", - "prompt": "//The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n// fibfib(0) == 0\n// fibfib(1) == 0\n// fibfib(2) == 1\n// fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n// Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n// >>> fibfib(1)\n// 0\n// >>> fibfib(5)\n// 4\n// >>> fibfib(8)\n// 24\nfunction fibfib(n: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fibfib;\n assert.deepEqual(candidate(2),1);\n assert.deepEqual(candidate(1),0);\n assert.deepEqual(candidate(5),4);\n assert.deepEqual(candidate(8),24);\n assert.deepEqual(candidate(10),81);\n assert.deepEqual(candidate(12),274);\n assert.deepEqual(candidate(14),927);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_133_sum_squares", - "language": "ts", - "prompt": "//You are given a list of numbers.\n// You need to return the sum of squared numbers in the given list,\n// round each element in the list to the upper int(Ceiling) first.\n// Examples:\n// >>> lst([1.0, 2.0, 3.0])\n// 14\n// >>> lst([1.0, 4.0, 9.0])\n// 98\n// >>> lst([1.0, 3.0, 5.0, 7.0])\n// 84\n// >>> lst([1.4, 4.2, 0.0])\n// 29\n// >>> lst([-2.4, 1.0, 1.0])\n// 6\nfunction sum_squares(lst: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_squares;\n assert.deepEqual(candidate([1.0, 2.0, 3.0]),14);\n assert.deepEqual(candidate([1.0, 2.0, 3.0]),14);\n assert.deepEqual(candidate([1.0, 3.0, 5.0, 7.0]),84);\n assert.deepEqual(candidate([1.4, 4.2, 0.0]),29);\n assert.deepEqual(candidate([-2.4, 1.0, 1.0]),6);\n assert.deepEqual(candidate([100.0, 1.0, 15.0, 2.0]),10230);\n assert.deepEqual(candidate([10000.0, 10000.0]),200000000);\n assert.deepEqual(candidate([-1.4, 4.6, 6.3]),75);\n assert.deepEqual(candidate([-1.4, 17.9, 18.9, 19.9]),1086);\n assert.deepEqual(candidate([0.0]),0);\n assert.deepEqual(candidate([-1.0]),1);\n assert.deepEqual(candidate([-1.0, 1.0, 0.0]),2);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_85_add", - "language": "ts", - "prompt": "//Given a non-empty list of integers lst. add the even elements that are at odd indices..\n// Examples:\n// >>> add([4, 2, 6, 7])\n// 2\nfunction add(lst: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = add;\n assert.deepEqual(candidate([4, 88]),88);\n assert.deepEqual(candidate([4, 5, 6, 7, 2, 122]),122);\n assert.deepEqual(candidate([4, 0, 6, 7]),0);\n assert.deepEqual(candidate([4, 4, 6, 8]),12);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_34_unique", - "language": "ts", - "prompt": "//Return sorted unique elements in a list\n// >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123])\n// [0, 2, 3, 5, 9, 123]\nfunction unique(l: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = unique;\n assert.deepEqual(candidate([5, 3, 5, 2, 3, 3, 9, 0, 123]),[0, 2, 3, 5, 9, 123]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_140_fix_spaces", - "language": "ts", - "prompt": "//Given a string text, replace all spaces in it with underscores, \n// and if a string has more than 2 consecutive spaces, \n// then replace all consecutive spaces with - \n// >>> fix_spaces(\" Example\")\n// \"Example\"\n// >>> fix_spaces(\" Example 1\")\n// \"Example_1\"\n// >>> fix_spaces(\" Example 2\")\n// \"_Example_2\"\n// >>> fix_spaces(\" Example 3\")\n// \"_Example-3\"\nfunction fix_spaces(text: string): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fix_spaces;\n assert.deepEqual(candidate(\"Example\"),\"Example\");\n assert.deepEqual(candidate(\"Mudasir Hanif \"),\"Mudasir_Hanif_\");\n assert.deepEqual(candidate(\"Yellow Yellow Dirty Fellow\"),\"Yellow_Yellow__Dirty__Fellow\");\n assert.deepEqual(candidate(\"Exa mple\"),\"Exa-mple\");\n assert.deepEqual(candidate(\" Exa 1 2 2 mple\"),\"-Exa_1_2_2_mple\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_49_modp", - "language": "ts", - "prompt": "//Return 2^n modulo p (be aware of numerics).\n// >>> modp(3, 5)\n// 3\n// >>> modp(1101, 101)\n// 2\n// >>> modp(0, 101)\n// 1\n// >>> modp(3, 11)\n// 8\n// >>> modp(100, 101)\n// 1\nfunction modp(n: number, p: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = modp;\n assert.deepEqual(candidate(3, 5),3);\n assert.deepEqual(candidate(1101, 101),2);\n assert.deepEqual(candidate(0, 101),1);\n assert.deepEqual(candidate(3, 11),8);\n assert.deepEqual(candidate(100, 101),1);\n assert.deepEqual(candidate(30, 5),4);\n assert.deepEqual(candidate(31, 5),3);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_124_valid_date", - "language": "ts", - "prompt": "//You have to write a function which validates a given date string and\n// returns True if the date is valid otherwise False.\n// The date is valid if all of the following rules are satisfied:\n// 1. The date string is not empty.\n// 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n// 3. The months should not be less than 1 or higher than 12.\n// 4. The date should be in the format: mm-dd-yyyy\n// >>> valid_date(\"03-11-2000\")\n// true\n// >>> valid_date(\"15-01-2012\")\n// false\n// >>> valid_date(\"04-0-2040\")\n// false\n// >>> valid_date(\"06-04-2020\")\n// true\n// >>> valid_date(\"06/04/2020\")\n// false\nfunction valid_date(date: string): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = valid_date;\n assert.deepEqual(candidate(\"03-11-2000\"),true);\n assert.deepEqual(candidate(\"15-01-2012\"),false);\n assert.deepEqual(candidate(\"04-0-2040\"),false);\n assert.deepEqual(candidate(\"06-04-2020\"),true);\n assert.deepEqual(candidate(\"01-01-2007\"),true);\n assert.deepEqual(candidate(\"03-32-2011\"),false);\n assert.deepEqual(candidate(\"\"),false);\n assert.deepEqual(candidate(\"04-31-3000\"),false);\n assert.deepEqual(candidate(\"06-06-2005\"),true);\n assert.deepEqual(candidate(\"21-31-2000\"),false);\n assert.deepEqual(candidate(\"04-12-2003\"),true);\n assert.deepEqual(candidate(\"04122003\"),false);\n assert.deepEqual(candidate(\"20030412\"),false);\n assert.deepEqual(candidate(\"2003-04\"),false);\n assert.deepEqual(candidate(\"2003-04-12\"),false);\n assert.deepEqual(candidate(\"04-2003\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_86_anti_shuffle", - "language": "ts", - "prompt": "//Write a function that takes a string and returns an ordered version of it.\n// Ordered version of string, is a string where all words (separated by space)\n// are replaced by a new word where all the characters arranged in\n// ascending order based on ascii value.\n// Note: You should keep the order of words and blank spaces in the sentence.\n// For example:\n// >>> anti_shuffle(\"Hi\")\n// \"Hi\"\n// >>> anti_shuffle(\"hello\")\n// \"ehllo\"\n// >>> anti_shuffle(\"Hello World!!!\")\n// \"Hello !!!Wdlor\"\nfunction anti_shuffle(s: string): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = anti_shuffle;\n assert.deepEqual(candidate(\"Hi\"),\"Hi\");\n assert.deepEqual(candidate(\"hello\"),\"ehllo\");\n assert.deepEqual(candidate(\"number\"),\"bemnru\");\n assert.deepEqual(candidate(\"abcd\"),\"abcd\");\n assert.deepEqual(candidate(\"Hello World!!!\"),\"Hello !!!Wdlor\");\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"Hi. My name is Mister Robot. How are you?\"),\".Hi My aemn is Meirst .Rboot How aer ?ouy\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_126_is_sorted", - "language": "ts", - "prompt": "//Given a list of numbers, return whether or not they are sorted\n// in ascending order. If list has more than 1 duplicate of the same\n// number, return False. Assume no negative numbers and only integers.\n// Examples\n// >>> is_sorted([5])\n// true\n// >>> is_sorted([1, 2, 3, 4, 5])\n// true\n// >>> is_sorted([1, 3, 2, 4, 5])\n// false\n// >>> is_sorted([1, 2, 3, 4, 5, 6])\n// true\n// >>> is_sorted([1, 2, 3, 4, 5, 6, 7])\n// true\n// >>> is_sorted([1, 3, 2, 4, 5, 6, 7])\n// false\n// >>> is_sorted([1, 2, 2, 3, 3, 4])\n// true\n// >>> is_sorted([1, 2, 2, 2, 3, 4])\n// false\nfunction is_sorted(lst: number[]): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_sorted;\n assert.deepEqual(candidate([5]),true);\n assert.deepEqual(candidate([1, 2, 3, 4, 5]),true);\n assert.deepEqual(candidate([1, 3, 2, 4, 5]),false);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6]),true);\n assert.deepEqual(candidate([1, 2, 3, 4, 5, 6, 7]),true);\n assert.deepEqual(candidate([1, 3, 2, 4, 5, 6, 7]),false);\n assert.deepEqual(candidate([]),true);\n assert.deepEqual(candidate([1]),true);\n assert.deepEqual(candidate([3, 2, 1]),false);\n assert.deepEqual(candidate([1, 2, 2, 2, 3, 4]),false);\n assert.deepEqual(candidate([1, 2, 3, 3, 3, 4]),false);\n assert.deepEqual(candidate([1, 2, 2, 3, 3, 4]),true);\n assert.deepEqual(candidate([1, 2, 3, 4]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_80_is_happy", - "language": "ts", - "prompt": "//You are given a string s.\n// Your task is to check if the string is happy or not.\n// A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n// For example:\n// >>> is_happy(\"a\")\n// false\n// >>> is_happy(\"aa\")\n// false\n// >>> is_happy(\"abcd\")\n// true\n// >>> is_happy(\"aabb\")\n// false\n// >>> is_happy(\"adb\")\n// true\n// >>> is_happy(\"xyy\")\n// false\nfunction is_happy(s: string): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = is_happy;\n assert.deepEqual(candidate(\"a\"),false);\n assert.deepEqual(candidate(\"aa\"),false);\n assert.deepEqual(candidate(\"abcd\"),true);\n assert.deepEqual(candidate(\"aabb\"),false);\n assert.deepEqual(candidate(\"adb\"),true);\n assert.deepEqual(candidate(\"xyy\"),false);\n assert.deepEqual(candidate(\"iopaxpoi\"),true);\n assert.deepEqual(candidate(\"iopaxioi\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_72_will_it_fly", - "language": "ts", - "prompt": "//Write a function that returns True if the object q will fly, and False otherwise.\n// The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n// Example:\n// >>> will_it_fly([1, 2], 5)\n// false\n// # 1+2 is less than the maximum possible weight, but it's unbalanced.\n// >>> will_it_fly([3, 2, 3], 1)\n// false\n// # it's balanced, but 3+2+3 is more than the maximum possible weight.\n// >>> will_it_fly([3, 2, 3], 9)\n// true\n// # 3+2+3 is less than the maximum possible weight, and it's balanced.\n// >>> will_it_fly([3], 5)\n// true\n// # 3 is less than the maximum possible weight, and it's balanced.\nfunction will_it_fly(q: number[], w: number): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = will_it_fly;\n assert.deepEqual(candidate([3, 2, 3], 9),true);\n assert.deepEqual(candidate([1, 2], 5),false);\n assert.deepEqual(candidate([3], 5),true);\n assert.deepEqual(candidate([3, 2, 3], 1),false);\n assert.deepEqual(candidate([1, 2, 3], 6),false);\n assert.deepEqual(candidate([5], 5),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_88_sort_array", - "language": "ts", - "prompt": "//Given an array of non-negative integers, return a copy of the given array after sorting,\n// you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n// or sort it in descending order if the sum( first index value, last index value) is even.\n// Note:\n// * don't change the given array.\n// Examples:\n// >>> sort_array([])\n// []\n// >>> sort_array([5])\n// [5]\n// >>> sort_array([2, 4, 3, 0, 1, 5])\n// [0, 1, 2, 3, 4, 5]\n// >>> sort_array([2, 4, 3, 0, 1, 5, 6])\n// [6, 5, 4, 3, 2, 1, 0]\nfunction sort_array(array: number[]): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sort_array;\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([5]),[5]);\n assert.deepEqual(candidate([2, 4, 3, 0, 1, 5]),[0, 1, 2, 3, 4, 5]);\n assert.deepEqual(candidate([2, 4, 3, 0, 1, 5, 6]),[6, 5, 4, 3, 2, 1, 0]);\n assert.deepEqual(candidate([2, 1]),[1, 2]);\n assert.deepEqual(candidate([15, 42, 87, 32, 11, 0]),[0, 11, 15, 32, 42, 87]);\n assert.deepEqual(candidate([21, 14, 23, 11]),[23, 21, 14, 11]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_96_count_up_to", - "language": "ts", - "prompt": "//Implement a function that takes an non-negative integer and returns an array of the first n\n// integers that are prime numbers and less than n.\n// for example:\n// >>> count_up_to(5)\n// [2, 3]\n// >>> count_up_to(11)\n// [2, 3, 5, 7]\n// >>> count_up_to(0)\n// []\n// >>> count_up_to(20)\n// [2, 3, 5, 7, 11, 13, 17, 19]\n// >>> count_up_to(1)\n// []\n// >>> count_up_to(18)\n// [2, 3, 5, 7, 11, 13, 17]\nfunction count_up_to(n: number): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_up_to;\n assert.deepEqual(candidate(5),[2, 3]);\n assert.deepEqual(candidate(6),[2, 3, 5]);\n assert.deepEqual(candidate(7),[2, 3, 5]);\n assert.deepEqual(candidate(10),[2, 3, 5, 7]);\n assert.deepEqual(candidate(0),[]);\n assert.deepEqual(candidate(22),[2, 3, 5, 7, 11, 13, 17, 19]);\n assert.deepEqual(candidate(1),[]);\n assert.deepEqual(candidate(18),[2, 3, 5, 7, 11, 13, 17]);\n assert.deepEqual(candidate(47),[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43]);\n assert.deepEqual(candidate(101),[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_12_longest", - "language": "ts", - "prompt": "//Out of list of strings, return the longest one. Return the first one in case of multiple\n// strings of the same length. Return None in case the input list is empty.\n// >>> longest([])\n// undefined\n// >>> longest([\"a\", \"b\", \"c\"])\n// \"a\"\n// >>> longest([\"a\", \"bb\", \"ccc\"])\n// \"ccc\"\nfunction longest(strings: string[]): string | undefined {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = longest;\n assert.deepEqual(candidate([]),undefined);\n assert.deepEqual(candidate([\"x\", \"y\", \"z\"]),\"x\");\n assert.deepEqual(candidate([\"x\", \"yyy\", \"zzzz\", \"www\", \"kkkk\", \"abc\"]),\"zzzz\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_105_by_length", - "language": "ts", - "prompt": "//Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n// reverse the resulting array, and then replace each digit by its corresponding name from\n// \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n// For example:\n// >>> by_length([2, 1, 1, 4, 5, 8, 2, 3])\n// [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n// If the array is empty, return an empty array:\n// >>> by_length([])\n// []\n// If the array has any strange number ignore it:\n// >>> by_length([1, -1, 55])\n// [\"One\"]\nfunction by_length(arr: number[]): string[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = by_length;\n assert.deepEqual(candidate([2, 1, 1, 4, 5, 8, 2, 3]),[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]);\n assert.deepEqual(candidate([]),[]);\n assert.deepEqual(candidate([1, -1, 55]),[\"One\"]);\n assert.deepEqual(candidate([1, -1, 3, 2]),[\"Three\", \"Two\", \"One\"]);\n assert.deepEqual(candidate([9, 4, 8]),[\"Nine\", \"Eight\", \"Four\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_106_f", - "language": "ts", - "prompt": "//Implement the function f that takes n as a parameter,\n// 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\n// or the sum of numbers from 1 to i otherwise.\n// i starts from 1.\n// the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n// Example:\n// >>> f(5)\n// [1, 2, 6, 24, 15]\nfunction f(n: number): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = f;\n assert.deepEqual(candidate(5),[1, 2, 6, 24, 15]);\n assert.deepEqual(candidate(7),[1, 2, 6, 24, 15, 720, 28]);\n assert.deepEqual(candidate(1),[1]);\n assert.deepEqual(candidate(3),[1, 2, 6]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_36_fizz_buzz", - "language": "ts", - "prompt": "//Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n// >>> fizz_buzz(50)\n// 0\n// >>> fizz_buzz(78)\n// 2\n// >>> fizz_buzz(79)\n// 3\nfunction fizz_buzz(n: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = fizz_buzz;\n assert.deepEqual(candidate(50),0);\n assert.deepEqual(candidate(78),2);\n assert.deepEqual(candidate(79),3);\n assert.deepEqual(candidate(100),3);\n assert.deepEqual(candidate(200),6);\n assert.deepEqual(candidate(4000),192);\n assert.deepEqual(candidate(10000),639);\n assert.deepEqual(candidate(100000),8026);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_2_truncate_number", - "language": "ts", - "prompt": "//Given a positive floating point number, it can be decomposed into\n// and integer part (largest integer smaller than given number) and decimals\n// (leftover part always smaller than 1).\n// Return the decimal part of the number.\n// >>> truncate_number(3.5)\n// 0.5\nfunction truncate_number(number: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = truncate_number;\n assert.deepEqual(candidate(3.5),0.5);\n assert.deepEqual(candidate(1.25),0.25);\n assert.deepEqual(candidate(123.0),0.0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_8_sum_product", - "language": "ts", - "prompt": "//For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n// Empty sum should be equal to 0 and empty product should be equal to 1.\n// >>> sum_product([])\n// [0, 1]\n// >>> sum_product([1, 2, 3, 4])\n// [10, 24]\nfunction sum_product(numbers: number[]): [number, number] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = sum_product;\n assert.deepEqual(candidate([]),[0, 1]);\n assert.deepEqual(candidate([1, 1, 1]),[3, 1]);\n assert.deepEqual(candidate([100, 0]),[100, 0]);\n assert.deepEqual(candidate([3, 5, 7]),[15, 105]);\n assert.deepEqual(candidate([10]),[10, 10]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_87_get_row", - "language": "ts", - "prompt": "//You are given a 2 dimensional data, as a nested lists,\n// which is similar to matrix, however, unlike matrices,\n// each row may contain a different number of columns.\n// Given lst, and integer x, find integers x in the list,\n// and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n// each tuple is a coordinate - (row, columns), starting with 0.\n// Sort coordinates initially by rows in ascending order.\n// Also, sort coordinates of the row by columns in descending order.\n// Examples:\n// >>> get_row([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1)\n// [[0, 0], [1, 4], [1, 0], [2, 5], [2, 0]]\n// >>> get_row([], 1)\n// []\n// >>> get_row([[], [1], [1, 2, 3]], 3)\n// [[2, 2]]\nfunction get_row(lst: number[][], x: number): [number, number][] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = get_row;\n assert.deepEqual(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1),[[0, 0], [1, 4], [1, 0], [2, 5], [2, 0]]);\n assert.deepEqual(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6]], 2),[[0, 1], [1, 1], [2, 1], [3, 1], [4, 1], [5, 1]]);\n assert.deepEqual(candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 1, 3, 4, 5, 6], [1, 2, 1, 4, 5, 6], [1, 2, 3, 1, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1),[[0, 0], [1, 0], [2, 1], [2, 0], [3, 2], [3, 0], [4, 3], [4, 0], [5, 4], [5, 0], [6, 5], [6, 0]]);\n assert.deepEqual(candidate([], 1),[]);\n assert.deepEqual(candidate([[1]], 2),[]);\n assert.deepEqual(candidate([[], [1], [1, 2, 3]], 3),[[2, 2]]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_159_eat", - "language": "ts", - "prompt": "//You're a hungry rabbit, and you already have eaten a certain number of carrots,\n// but now you need to eat more carrots to complete the day's meals.\n// you should return an array of [ total number of eaten carrots after your meals,\n// the number of carrots left after your meals ]\n// if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n// Example:\n// >>> eat(5, 6, 10)\n// [11, 4]\n// >>> eat(4, 8, 9)\n// [12, 1]\n// >>> eat(1, 10, 10)\n// [11, 0]\n// >>> eat(2, 11, 5)\n// [7, 0]\n// Variables:\n// @number : integer\n// the number of carrots that you have eaten.\n// @need : integer\n// the number of carrots that you need to eat.\n// @remaining : integer\n// the number of remaining carrots thet exist in stock\n// Constrain:\n// * 0 <= number <= 1000\n// * 0 <= need <= 1000\n// * 0 <= remaining <= 1000\n// Have fun :)\nfunction eat(number: number, need: number, remaining: number): number[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = eat;\n assert.deepEqual(candidate(5, 6, 10),[11, 4]);\n assert.deepEqual(candidate(4, 8, 9),[12, 1]);\n assert.deepEqual(candidate(1, 10, 10),[11, 0]);\n assert.deepEqual(candidate(2, 11, 5),[7, 0]);\n assert.deepEqual(candidate(4, 5, 7),[9, 2]);\n assert.deepEqual(candidate(4, 5, 1),[5, 0]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_84_solve", - "language": "ts", - "prompt": "//Given a positive integer N, return the total sum of its digits in binary.\n// Example\n// >>> solve(1000)\n// \"1\"\n// >>> solve(150)\n// \"110\"\n// >>> solve(147)\n// \"1100\"\n// Variables:\n// @N integer\n// Constraints: 0 \u2264 N \u2264 10000.\n// Output:\n// a string of binary number\nfunction solve(N: number): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = solve;\n assert.deepEqual(candidate(1000),\"1\");\n assert.deepEqual(candidate(150),\"110\");\n assert.deepEqual(candidate(147),\"1100\");\n assert.deepEqual(candidate(333),\"1001\");\n assert.deepEqual(candidate(963),\"10010\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_94_skjkasdkd", - "language": "ts", - "prompt": "//You are given a list of integers.\n// You need to find the largest prime value and return the sum of its digits.\n// Examples:\n// >>> skjkasdkd([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3])\n// 10\n// >>> skjkasdkd([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1])\n// 25\n// >>> skjkasdkd([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3])\n// 13\n// >>> skjkasdkd([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6])\n// 11\n// >>> skjkasdkd([0, 81, 12, 3, 1, 21])\n// 3\n// >>> skjkasdkd([0, 8, 1, 2, 1, 7])\n// 7\nfunction skjkasdkd(lst: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = skjkasdkd;\n assert.deepEqual(candidate([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]),10);\n assert.deepEqual(candidate([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]),25);\n assert.deepEqual(candidate([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]),13);\n assert.deepEqual(candidate([0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6]),11);\n assert.deepEqual(candidate([0, 81, 12, 3, 1, 21]),3);\n assert.deepEqual(candidate([0, 8, 1, 2, 1, 7]),7);\n assert.deepEqual(candidate([8191]),19);\n assert.deepEqual(candidate([8191, 123456, 127, 7]),19);\n assert.deepEqual(candidate([127, 97, 8192]),10);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_73_smallest_change", - "language": "ts", - "prompt": "//Given an array arr of integers, find the minimum number of elements that\n// need to be changed to make the array palindromic. A palindromic array is an array that\n// is read the same backwards and forwards. In one change, you can change one element to any other element.\n// For example:\n// >>> smallest_change([1, 2, 3, 5, 4, 7, 9, 6])\n// 4\n// >>> smallest_change([1, 2, 3, 4, 3, 2, 2])\n// 1\n// >>> smallest_change([1, 2, 3, 2, 1])\n// 0\nfunction smallest_change(arr: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = smallest_change;\n assert.deepEqual(candidate([1, 2, 3, 5, 4, 7, 9, 6]),4);\n assert.deepEqual(candidate([1, 2, 3, 4, 3, 2, 2]),1);\n assert.deepEqual(candidate([1, 4, 2]),1);\n assert.deepEqual(candidate([1, 4, 4, 2]),1);\n assert.deepEqual(candidate([1, 2, 3, 2, 1]),0);\n assert.deepEqual(candidate([3, 1, 1, 3]),0);\n assert.deepEqual(candidate([1]),0);\n assert.deepEqual(candidate([0, 1]),1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_81_numerical_letter_grade", - "language": "ts", - "prompt": "//It is the last week of the semester and the teacher has to give the grades\n// to students. The teacher has been making her own algorithm for grading.\n// The only problem is, she has lost the code she used for grading.\n// She has given you a list of GPAs for some students and you have to write \n// a function that can output a list of letter grades using the following table:\n// GPA | Letter grade\n// 4.0 A+\n// > 3.7 A \n// > 3.3 A- \n// > 3.0 B+\n// > 2.7 B \n// > 2.3 B-\n// > 2.0 C+\n// > 1.7 C\n// > 1.3 C-\n// > 1.0 D+ \n// > 0.7 D \n// > 0.0 D-\n// 0.0 E\n// Example:\n// >>> grade_equation([4.0, 3, 1.7, 2, 3.5])\n// [\"A+\", \"B\", \"C-\", \"C\", \"A-\"]\nfunction numerical_letter_grade(grades: number[]): string[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = numerical_letter_grade;\n assert.deepEqual(candidate([4.0, 3, 1.7, 2, 3.5]),[\"A+\", \"B\", \"C-\", \"C\", \"A-\"]);\n assert.deepEqual(candidate([1.2]),[\"D+\"]);\n assert.deepEqual(candidate([0.5]),[\"D-\"]);\n assert.deepEqual(candidate([0.0]),[\"E\"]);\n assert.deepEqual(candidate([1.0, 0.3, 1.5, 2.8, 3.3]),[\"D\", \"D-\", \"C-\", \"B\", \"B+\"]);\n assert.deepEqual(candidate([0.0, 0.7]),[\"E\", \"D-\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_71_triangle_area", - "language": "ts", - "prompt": "//Given the lengths of the three sides of a triangle. Return the area of\n// the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n// Otherwise return -1\n// Three sides make a valid triangle when the sum of any two sides is greater \n// than the third side.\n// Example:\n// >>> triangle_area(3, 4, 5)\n// 6.0\n// >>> triangle_area(1, 2, 10)\n// -1\nfunction triangle_area(a: number, b: number, c: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = triangle_area;\n assert.deepEqual(candidate(3, 4, 5),6.0);\n assert.deepEqual(candidate(1, 2, 10),-1);\n assert.deepEqual(candidate(4, 8, 5),8.18);\n assert.deepEqual(candidate(2, 2, 2),1.73);\n assert.deepEqual(candidate(1, 2, 3),-1);\n assert.deepEqual(candidate(10, 5, 7),16.25);\n assert.deepEqual(candidate(2, 6, 3),-1);\n assert.deepEqual(candidate(1, 1, 1),0.43);\n assert.deepEqual(candidate(2, 2, 10),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_54_same_chars", - "language": "ts", - "prompt": "//Check if two words have the same characters.\n// >>> same_chars(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\")\n// true\n// >>> same_chars(\"abcd\", \"dddddddabc\")\n// true\n// >>> same_chars(\"dddddddabc\", \"abcd\")\n// true\n// >>> same_chars(\"eabcd\", \"dddddddabc\")\n// false\n// >>> same_chars(\"abcd\", \"dddddddabce\")\n// false\n// >>> same_chars(\"eabcdzzzz\", \"dddzzzzzzzddddabc\")\n// false\nfunction same_chars(s0: string, s1: string): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = same_chars;\n assert.deepEqual(candidate(\"eabcdzzzz\", \"dddzzzzzzzddeddabc\"),true);\n assert.deepEqual(candidate(\"abcd\", \"dddddddabc\"),true);\n assert.deepEqual(candidate(\"dddddddabc\", \"abcd\"),true);\n assert.deepEqual(candidate(\"eabcd\", \"dddddddabc\"),false);\n assert.deepEqual(candidate(\"abcd\", \"dddddddabcf\"),false);\n assert.deepEqual(candidate(\"eabcdzzzz\", \"dddzzzzzzzddddabc\"),false);\n assert.deepEqual(candidate(\"aabb\", \"aaccc\"),false);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_114_minSubArraySum", - "language": "ts", - "prompt": "//Given an array of integers nums, find the minimum sum of any non-empty sub-array\n// of nums.\n// Example\n// >>> minSubArraySum([2, 3, 4, 1, 2, 4])\n// 1\n// >>> minSubArraySum([-1, -2, -3])\n// -6\nfunction minSubArraySum(nums: number[]): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = minSubArraySum;\n assert.deepEqual(candidate([2, 3, 4, 1, 2, 4]),1);\n assert.deepEqual(candidate([-1, -2, -3]),-6);\n assert.deepEqual(candidate([-1, -2, -3, 2, -10]),-14);\n assert.deepEqual(candidate([-9999999999999999]),-9999999999999999);\n assert.deepEqual(candidate([0, 10, 20, 1000000]),0);\n assert.deepEqual(candidate([-1, -2, -3, 10, -5]),-6);\n assert.deepEqual(candidate([100, -1, -2, -3, 10, -5]),-6);\n assert.deepEqual(candidate([10, 11, 13, 8, 3, 4]),3);\n assert.deepEqual(candidate([100, -33, 32, -1, 0, -2]),-33);\n assert.deepEqual(candidate([-10]),-10);\n assert.deepEqual(candidate([7]),7);\n assert.deepEqual(candidate([1, -1]),-1);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_117_select_words", - "language": "ts", - "prompt": "//Given a string s and a natural number n, you have been tasked to implement \n// a function that returns a list of all words from string s that contain exactly \n// n consonants, in order these words appear in the string s.\n// If the string s is empty then the function should return an empty list.\n// Note: you may assume the input string contains only letters and spaces.\n// Examples:\n// >>> select_words(\"Mary had a little lamb\", 4)\n// [\"little\"]\n// >>> select_words(\"Mary had a little lamb\", 3)\n// [\"Mary\", \"lamb\"]\n// >>> select_words(\"simple white space\", 2)\n// []\n// >>> select_words(\"Hello world\", 4)\n// [\"world\"]\n// >>> select_words(\"Uncle sam\", 3)\n// [\"Uncle\"]\nfunction select_words(s: string, n: number): string[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = select_words;\n assert.deepEqual(candidate(\"Mary had a little lamb\", 4),[\"little\"]);\n assert.deepEqual(candidate(\"Mary had a little lamb\", 3),[\"Mary\", \"lamb\"]);\n assert.deepEqual(candidate(\"simple white space\", 2),[]);\n assert.deepEqual(candidate(\"Hello world\", 4),[\"world\"]);\n assert.deepEqual(candidate(\"Uncle sam\", 3),[\"Uncle\"]);\n assert.deepEqual(candidate(\"\", 4),[]);\n assert.deepEqual(candidate(\"a b c d e f\", 1),[\"b\", \"c\", \"d\", \"f\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_14_all_prefixes", - "language": "ts", - "prompt": "//Return list of all prefixes from shortest to longest of the input string\n// >>> all_prefixes(\"abc\")\n// [\"a\", \"ab\", \"abc\"]\nfunction all_prefixes(string: string): string[] {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = all_prefixes;\n assert.deepEqual(candidate(\"\"),[]);\n assert.deepEqual(candidate(\"asdfgh\"),[\"a\", \"as\", \"asd\", \"asdf\", \"asdfg\", \"asdfgh\"]);\n assert.deepEqual(candidate(\"WWW\"),[\"W\", \"WW\", \"WWW\"]);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_99_closest_integer", - "language": "ts", - "prompt": "//Create a function that takes a value (string) representing a number\n// and returns the closest integer to it. If the number is equidistant\n// from two integers, round it away from zero.\n// Examples\n// >>> closest_integer(\"10\")\n// 10\n// >>> closest_integer(\"15.3\")\n// 15\n// Note:\n// Rounding away from zero means that if the given number is equidistant\n// from two integers, the one you should return is the one that is the\n// farthest from zero. For example closest_integer(\"14.5\") should\n// return 15 and closest_integer(\"-14.5\") should return -15.\nfunction closest_integer(value: string): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = closest_integer;\n assert.deepEqual(candidate(\"10\"),10);\n assert.deepEqual(candidate(\"14.5\"),15);\n assert.deepEqual(candidate(\"-15.5\"),-16);\n assert.deepEqual(candidate(\"15.3\"),15);\n assert.deepEqual(candidate(\"0\"),0);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_141_file_name_check", - "language": "ts", - "prompt": "//Create a function which takes a string representing a file's name, and returns\n// 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n// A file's name is considered to be valid if and only if all the following conditions \n// are met:\n// - There should not be more than three digits ('0'-'9') in the file's name.\n// - The file's name contains exactly one dot '.'\n// - The substring before the dot should not be empty, and it starts with a letter from \n// the latin alphapet ('a'-'z' and 'A'-'Z').\n// - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n// Examples:\n// >>> file_name_check(\"example.txt\")\n// \"Yes\"\n// >>> file_name_check(\"1example.dll\")\n// \"No\"\nfunction file_name_check(file_name: string): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = file_name_check;\n assert.deepEqual(candidate(\"example.txt\"),\"Yes\");\n assert.deepEqual(candidate(\"1example.dll\"),\"No\");\n assert.deepEqual(candidate(\"s1sdf3.asd\"),\"No\");\n assert.deepEqual(candidate(\"K.dll\"),\"Yes\");\n assert.deepEqual(candidate(\"MY16FILE3.exe\"),\"Yes\");\n assert.deepEqual(candidate(\"His12FILE94.exe\"),\"No\");\n assert.deepEqual(candidate(\"_Y.txt\"),\"No\");\n assert.deepEqual(candidate(\"?aREYA.exe\"),\"No\");\n assert.deepEqual(candidate(\"/this_is_valid.dll\"),\"No\");\n assert.deepEqual(candidate(\"this_is_valid.wow\"),\"No\");\n assert.deepEqual(candidate(\"this_is_valid.txt\"),\"Yes\");\n assert.deepEqual(candidate(\"this_is_valid.txtexe\"),\"No\");\n assert.deepEqual(candidate(\"#this2_i4s_5valid.ten\"),\"No\");\n assert.deepEqual(candidate(\"@this1_is6_valid.exe\"),\"No\");\n assert.deepEqual(candidate(\"this_is_12valid.6exe4.txt\"),\"No\");\n assert.deepEqual(candidate(\"all.exe.txt\"),\"No\");\n assert.deepEqual(candidate(\"I563_No.exe\"),\"Yes\");\n assert.deepEqual(candidate(\"Is3youfault.txt\"),\"Yes\");\n assert.deepEqual(candidate(\"no_one#knows.dll\"),\"Yes\");\n assert.deepEqual(candidate(\"1I563_Yes3.exe\"),\"No\");\n assert.deepEqual(candidate(\"I563_Yes3.txtt\"),\"No\");\n assert.deepEqual(candidate(\"final..txt\"),\"No\");\n assert.deepEqual(candidate(\"final132\"),\"No\");\n assert.deepEqual(candidate(\"_f4indsartal132.\"),\"No\");\n assert.deepEqual(candidate(\".txt\"),\"No\");\n assert.deepEqual(candidate(\"s.\"),\"No\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_127_intersection", - "language": "ts", - "prompt": "//You are given two intervals,\n// where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n// The given intervals are closed which means that the interval (start, end)\n// includes both start and end.\n// For each given interval, it is assumed that its start is less or equal its end.\n// Your task is to determine whether the length of intersection of these two \n// intervals is a prime number.\n// Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n// which its length is 1, which not a prime number.\n// If the length of the intersection is a prime number, return \"YES\",\n// otherwise, return \"NO\".\n// If the two intervals don't intersect, return \"NO\".\n// [input/output] samples:\n// >>> intersection([1, 2], [2, 3])\n// \"NO\"\n// >>> intersection([-1, 1], [0, 4])\n// \"NO\"\n// >>> intersection([-3, -1], [-5, 5])\n// \"YES\"\nfunction intersection(interval1: [number, number], interval2: [number, number]): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = intersection;\n assert.deepEqual(candidate([1, 2], [2, 3]),\"NO\");\n assert.deepEqual(candidate([-1, 1], [0, 4]),\"NO\");\n assert.deepEqual(candidate([-3, -1], [-5, 5]),\"YES\");\n assert.deepEqual(candidate([-2, 2], [-4, 0]),\"YES\");\n assert.deepEqual(candidate([-11, 2], [-1, -1]),\"NO\");\n assert.deepEqual(candidate([1, 2], [3, 5]),\"NO\");\n assert.deepEqual(candidate([1, 2], [1, 2]),\"NO\");\n assert.deepEqual(candidate([-2, -2], [-3, -2]),\"NO\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_59_largest_prime_factor", - "language": "ts", - "prompt": "//Return the largest prime factor of n. Assume n > 1 and is not a prime.\n// >>> largest_prime_factor(13195)\n// 29\n// >>> largest_prime_factor(2048)\n// 2\nfunction largest_prime_factor(n: number): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = largest_prime_factor;\n assert.deepEqual(candidate(15),5);\n assert.deepEqual(candidate(27),3);\n assert.deepEqual(candidate(63),7);\n assert.deepEqual(candidate(330),11);\n assert.deepEqual(candidate(13195),29);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_16_count_distinct_characters", - "language": "ts", - "prompt": "//Given a string, find out how many distinct characters (regardless of case) does it consist of\n// >>> count_distinct_characters(\"xyzXYZ\")\n// 3\n// >>> count_distinct_characters(\"Jerry\")\n// 4\nfunction count_distinct_characters(string: string): number {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = count_distinct_characters;\n assert.deepEqual(candidate(\"\"),0);\n assert.deepEqual(candidate(\"abcde\"),5);\n assert.deepEqual(candidate(\"abcdecadeCADE\"),5);\n assert.deepEqual(candidate(\"aaaaAAAAaaaa\"),1);\n assert.deepEqual(candidate(\"Jerry jERRY JeRRRY\"),5);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_3_below_zero", - "language": "ts", - "prompt": "//You're given a list of deposit and withdrawal operations on a bank account that starts with\n// zero balance. Your task is to detect if at any point the balance of account fallls below zero, and\n// at that point function should return True. Otherwise it should return False.\n// >>> below_zero([1, 2, 3])\n// false\n// >>> below_zero([1, 2, -4, 5])\n// true\nfunction below_zero(operations: number[]): boolean {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = below_zero;\n assert.deepEqual(candidate([]),false);\n assert.deepEqual(candidate([1, 2, -3, 1, 2, -3]),false);\n assert.deepEqual(candidate([1, 2, -4, 5, 6]),true);\n assert.deepEqual(candidate([1, -1, 2, -2, 5, -5, 4, -4]),false);\n assert.deepEqual(candidate([1, -1, 2, -2, 5, -5, 4, -5]),true);\n assert.deepEqual(candidate([1, -2, 2, -2, 5, -5, 4, -4]),true);\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_10_make_palindrome", - "language": "ts", - "prompt": "//Find the shortest palindrome that begins with a supplied string.\n// Algorithm idea is simple:\n// - Find the longest postfix of supplied string that is a palindrome.\n// - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n// >>> make_palindrome(\"\")\n// \"\"\n// >>> make_palindrome(\"cat\")\n// \"catac\"\n// >>> make_palindrome(\"cata\")\n// \"catac\"\nfunction make_palindrome(string: string): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = make_palindrome;\n assert.deepEqual(candidate(\"\"),\"\");\n assert.deepEqual(candidate(\"x\"),\"x\");\n assert.deepEqual(candidate(\"xyz\"),\"xyzyx\");\n assert.deepEqual(candidate(\"xyx\"),\"xyx\");\n assert.deepEqual(candidate(\"jerry\"),\"jerryrrej\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - }, - { - "name": "HumanEval_156_int_to_mini_roman", - "language": "ts", - "prompt": "//Given a positive integer, obtain its roman numeral equivalent as a string,\n// and return it in lowercase.\n// Restrictions: 1 <= num <= 1000\n// Examples:\n// >>> int_to_mini_roman(19)\n// \"xix\"\n// >>> int_to_mini_roman(152)\n// \"clii\"\n// >>> int_to_mini_roman(426)\n// \"cdxxvi\"\nfunction int_to_mini_roman(number: number): string {\n", - "doctests": "transform", - "original": "/home/arjun/repos/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", - "prompt_terminology": "verbatim", - "tests": "declare var require: any;\nconst assert = require('node:assert');\n\n\nfunction test() {\n let candidate = int_to_mini_roman;\n assert.deepEqual(candidate(19),\"xix\");\n assert.deepEqual(candidate(152),\"clii\");\n assert.deepEqual(candidate(251),\"ccli\");\n assert.deepEqual(candidate(426),\"cdxxvi\");\n assert.deepEqual(candidate(500),\"d\");\n assert.deepEqual(candidate(1),\"i\");\n assert.deepEqual(candidate(4),\"iv\");\n assert.deepEqual(candidate(43),\"xliii\");\n assert.deepEqual(candidate(90),\"xc\");\n assert.deepEqual(candidate(94),\"xciv\");\n assert.deepEqual(candidate(532),\"dxxxii\");\n assert.deepEqual(candidate(900),\"cm\");\n assert.deepEqual(candidate(994),\"cmxciv\");\n assert.deepEqual(candidate(1000),\"m\");\n}\n\ntest();", - "stop_tokens": [ - "\nfunction ", - "\n/*", - "\n//", - "\nclass" - ] - } -] \ No newline at end of file diff --git a/dataset_infos.json b/dataset_infos.json index e6c86d61df727ec321e8236f704e5ce2ecebf75a..1f106b860de422c0e2880b0afb79587b064670ea 100644 --- a/dataset_infos.json +++ b/dataset_infos.json @@ -1 +1 @@ -{"cpp-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "cpp-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 217792, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/cpp-keep.json": {"num_bytes": 248493, "checksum": "56d81141f7b29c237796e14173b8e2884e97d27a8d57c3644a237c09f59227b4"}}, "download_size": 248493, "post_processing_size": null, "dataset_size": 217792, "size_in_bytes": 466285}, "cpp-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "cpp-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 239517, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/cpp-transform.json": {"num_bytes": 270773, "checksum": "cb154fc45bef323590b79bb70c14aba4bad59b6a2180615d8937485d41a93d1e"}}, "download_size": 270773, "post_processing_size": null, "dataset_size": 239517, "size_in_bytes": 510290}, "cpp-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "cpp-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 239767, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/cpp-reworded.json": {"num_bytes": 271023, "checksum": "ac639faf8c79348712cb2cd1d95df135a226a49006461245acf810039b9420ce"}}, "download_size": 271023, "post_processing_size": null, "dataset_size": 239767, "size_in_bytes": 510790}, "cpp-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "cpp-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 198566, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/cpp-remove.json": {"num_bytes": 227555, "checksum": "729a5a6e1d68668554f77de56ef17b44eab57beea03f2fb920c075cb4f6a905f"}}, "download_size": 227555, "post_processing_size": null, "dataset_size": 198566, "size_in_bytes": 426121}, "cs-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "cs-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 259874, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/cs-keep.json": {"num_bytes": 291137, "checksum": "db62ab52665a2742d0bef4de662ca187a703227083881177dad4f2712da5199a"}}, "download_size": 291137, "post_processing_size": null, "dataset_size": 259874, "size_in_bytes": 551011}, "cs-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "cs-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 283738, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/cs-transform.json": {"num_bytes": 315563, "checksum": "505f4892388ede789dd09a256c3dbc801549c8d1d372fa60b4db339fe09d6319"}}, "download_size": 315563, "post_processing_size": null, "dataset_size": 283738, "size_in_bytes": 599301}, "cs-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "cs-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 283673, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/cs-reworded.json": {"num_bytes": 315498, "checksum": "0304b710180681c9a68fe97684a87e71ab35aec9f229fd1d592e0b0ea698d8c2"}}, "download_size": 315498, "post_processing_size": null, "dataset_size": 283673, "size_in_bytes": 599171}, "cs-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "cs-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 237663, "num_examples": 155, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/cs-remove.json": {"num_bytes": 267251, "checksum": "8e2295c157152f2105d805dc06b26ab91e31000cdc8710f31e693bc65de1b753"}}, "download_size": 267251, "post_processing_size": null, "dataset_size": 237663, "size_in_bytes": 504914}, "d-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "d-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 175592, "num_examples": 156, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/d-keep.json": {"num_bytes": 209568, "checksum": "e34578f5aabf7a3664eee62f77b00cc908c3db8a6a7aeb071965de247f9750e7"}}, "download_size": 209568, "post_processing_size": null, "dataset_size": 175592, "size_in_bytes": 385160}, "d-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "d-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 181121, "num_examples": 156, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/d-transform.json": {"num_bytes": 215649, "checksum": "a9d182b3a60e4f951e2235f2a4157b91f518623b6ae21260e1d5d6703cf77a78"}}, "download_size": 215649, "post_processing_size": null, "dataset_size": 181121, "size_in_bytes": 396770}, "d-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "d-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 181296, "num_examples": 156, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/d-reworded.json": {"num_bytes": 215824, "checksum": "6a021fd31c45c3f68742f7d60d27082d45d17229daae221d46c70ace9d61bc2b"}}, "download_size": 215824, "post_processing_size": null, "dataset_size": 181296, "size_in_bytes": 397120}, "d-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "d-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 157938, "num_examples": 153, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/d-remove.json": {"num_bytes": 190211, "checksum": "9a36e460e3f0e7fcb92fa6d9f1da5e9d62cf5ee6787af73468bb2a54dada295a"}}, "download_size": 190211, "post_processing_size": null, "dataset_size": 157938, "size_in_bytes": 348149}, "go-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "go-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 241130, "num_examples": 154, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/go-keep.json": {"num_bytes": 280424, "checksum": "6de07406cbf81f3a6d0199ec9fc85eaf78a20d9954f8f3ea22e7d1b2fa9a92b6"}}, "download_size": 280424, "post_processing_size": null, "dataset_size": 241130, "size_in_bytes": 521554}, "go-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "go-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 247448, "num_examples": 154, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/go-transform.json": {"num_bytes": 287275, "checksum": "084a15fb951dd89dc33a06cf49acaf2610ee0e2de0c9f8d1325b08a4a88b2ebc"}}, "download_size": 287275, "post_processing_size": null, "dataset_size": 247448, "size_in_bytes": 534723}, "go-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "go-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 247354, "num_examples": 154, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/go-reworded.json": {"num_bytes": 287181, "checksum": "b5fee01832bc349cab80f50aa68ec6e8df37cf054457ccfd0333229acae60b08"}}, "download_size": 287181, "post_processing_size": null, "dataset_size": 247354, "size_in_bytes": 534535}, "go-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "go-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 221519, "num_examples": 151, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/go-remove.json": {"num_bytes": 258980, "checksum": "e4bbf884adf71965e8b0978ff20ff779de60f50bd7da8912b620b713de3bc376"}}, "download_size": 258980, "post_processing_size": null, "dataset_size": 221519, "size_in_bytes": 480499}, "java-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "java-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 259836, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/java-keep.json": {"num_bytes": 291099, "checksum": "7bf1559d86c8a92fd15b4ed812d885c99c50551f392b2ad816a8e7060527e89c"}}, "download_size": 291099, "post_processing_size": null, "dataset_size": 259836, "size_in_bytes": 550935}, "java-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "java-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 286548, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/java-transform.json": {"num_bytes": 318373, "checksum": "b5da36d56612e80384d9e6a46407241934730d3ba5bca98c5e7ccfb112f9d628"}}, "download_size": 318373, "post_processing_size": null, "dataset_size": 286548, "size_in_bytes": 604921}, "java-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "java-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 288031, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/java-reworded.json": {"num_bytes": 319856, "checksum": "893dabdd6b521f3e05ab84748cd27a1e6debbe9400478c8ca889953940145ca1"}}, "download_size": 319856, "post_processing_size": null, "dataset_size": 288031, "size_in_bytes": 607887}, "java-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "java-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 237672, "num_examples": 155, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/java-remove.json": {"num_bytes": 267260, "checksum": "a6c69545169e760eb802d953af94dde684146430b281d43ffa98f72f1416a34d"}}, "download_size": 267260, "post_processing_size": null, "dataset_size": 237672, "size_in_bytes": 504932}, "jl-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "jl-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 163708, "num_examples": 159, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/jl-keep.json": {"num_bytes": 198696, "checksum": "7fa3f79aa3d56fadae3414684f0f102f87d529099d84a6f5d30a652714419d7b"}}, "download_size": 198696, "post_processing_size": null, "dataset_size": 163708, "size_in_bytes": 362404}, "jl-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "jl-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 167969, "num_examples": 159, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/jl-transform.json": {"num_bytes": 203514, "checksum": "255731ab55a8eb128bcf6b3ececbd0dcd5fcb087753b830f148788c53ebfee8e"}}, "download_size": 203514, "post_processing_size": null, "dataset_size": 167969, "size_in_bytes": 371483}, "jl-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "jl-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 168251, "num_examples": 159, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/jl-reworded.json": {"num_bytes": 203796, "checksum": "ceef60793f1d2c97d96df7e8ef54695a17a6a1d47a11e4c9c7a202c50300aff3"}}, "download_size": 203796, "post_processing_size": null, "dataset_size": 168251, "size_in_bytes": 372047}, "jl-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "jl-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 145913, "num_examples": 156, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/jl-remove.json": {"num_bytes": 179158, "checksum": "221e77ae9a1c3c3ab95d0c5010b119f9fd6f1fea9afaa79e5cf033f9a62e9d11"}}, "download_size": 179158, "post_processing_size": null, "dataset_size": 145913, "size_in_bytes": 325071}, "js-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "js-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 177635, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/js-keep.json": {"num_bytes": 211822, "checksum": "02e56da39247f31c4f399a62210fdbe97bb45f6ec239140c3985432b72485bf2"}}, "download_size": 211822, "post_processing_size": null, "dataset_size": 177635, "size_in_bytes": 389457}, "js-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "js-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 181987, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/js-transform.json": {"num_bytes": 216729, "checksum": "d90db81d52580d6d21cca9b16662fdac11b4ff5f2b50521652014c3c4d66b9c0"}}, "download_size": 216729, "post_processing_size": null, "dataset_size": 181987, "size_in_bytes": 398716}, "js-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "js-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 182171, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/js-reworded.json": {"num_bytes": 216913, "checksum": "ed2aa0a25d0fd9dd963668079e334d88acd8caf0bf020a33964f7cd4700eb670"}}, "download_size": 216913, "post_processing_size": null, "dataset_size": 182171, "size_in_bytes": 399084}, "js-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "js-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 158619, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/js-remove.json": {"num_bytes": 191028, "checksum": "8b0d17122dac1a1efef793d71e73473892aba8c8ebf8bf2238e4be8f7cd2685d"}}, "download_size": 191028, "post_processing_size": null, "dataset_size": 158619, "size_in_bytes": 349647}, "lua-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "lua-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 180398, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/lua-keep.json": {"num_bytes": 212511, "checksum": "fb7466e8b89c92fab70dbd7f0074972cf0c6e970f94f7203c4fa01797af59e67"}}, "download_size": 212511, "post_processing_size": null, "dataset_size": 180398, "size_in_bytes": 392909}, "lua-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "lua-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 184763, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/lua-transform.json": {"num_bytes": 216595, "checksum": "fba904e9325bb59360bb4e583f796bce78587695db92c6a4b4145a6bbb8778df"}}, "download_size": 216595, "post_processing_size": null, "dataset_size": 184763, "size_in_bytes": 401358}, "lua-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "lua-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 184853, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/lua-reworded.json": {"num_bytes": 216685, "checksum": "54b8881bd6d2ba52b1d2e77388f20429edd60e705cf2c8cc87c58db966ceb2ff"}}, "download_size": 216685, "post_processing_size": null, "dataset_size": 184853, "size_in_bytes": 401538}, "lua-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "lua-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 161339, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/lua-remove.json": {"num_bytes": 191690, "checksum": "e12d5519c6f740d9341136043e93f42986a13b7f00a64c393592bca83400f45e"}}, "download_size": 191690, "post_processing_size": null, "dataset_size": 161339, "size_in_bytes": 353029}, "php-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "php-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 219526, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/php-keep.json": {"num_bytes": 256134, "checksum": "6e8bbef0effb50396b752e4e2ee3cd42e9f1edcf253e684dffe0d60efd447af4"}}, "download_size": 256134, "post_processing_size": null, "dataset_size": 219526, "size_in_bytes": 475660}, "php-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "php-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 225575, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/php-transform.json": {"num_bytes": 262738, "checksum": "113c46223db9f1235ba2f0a390a0f01a9775400a671537e70755ea471e99088c"}}, "download_size": 262738, "post_processing_size": null, "dataset_size": 225575, "size_in_bytes": 488313}, "php-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "php-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 225730, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/php-reworded.json": {"num_bytes": 262893, "checksum": "a27a5093957369e68f16ec973cc3fe16a400a6b1e0efa2469ef607ea5529b176"}}, "download_size": 262893, "post_processing_size": null, "dataset_size": 225730, "size_in_bytes": 488623}, "php-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "php-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 200047, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/php-remove.json": {"num_bytes": 234848, "checksum": "3b13b33434a08c9bcff8db2a72e3ec89c85a794b8c1ca576a10614693d3b27b0"}}, "download_size": 234848, "post_processing_size": null, "dataset_size": 200047, "size_in_bytes": 434895}, "pl-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "pl-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 239874, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/pl-keep.json": {"num_bytes": 279351, "checksum": "116f82cec38a8a9f38bd14bbd9348d18f13879a98c293c7ce9ff38829da8bf3f"}}, "download_size": 279351, "post_processing_size": null, "dataset_size": 239874, "size_in_bytes": 519225}, "pl-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "pl-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 243611, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/pl-transform.json": {"num_bytes": 283767, "checksum": "552decb4ad799ae7204b0434600d0a7b1b2136dc34dbaa1a3e6ca7acb681173e"}}, "download_size": 283767, "post_processing_size": null, "dataset_size": 243611, "size_in_bytes": 527378}, "pl-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "pl-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 243661, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/pl-reworded.json": {"num_bytes": 283817, "checksum": "52010c713c3cb0ee07b691f0c04be20baf35223019bc8dfeb08720b82fd8ce58"}}, "download_size": 283817, "post_processing_size": null, "dataset_size": 243661, "size_in_bytes": 527478}, "pl-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "pl-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 220817, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/pl-remove.json": {"num_bytes": 258463, "checksum": "94723d826be5a900f975ffd97039dba9de878945f6d81fa0a59bdebed5c87ef6"}}, "download_size": 258463, "post_processing_size": null, "dataset_size": 220817, "size_in_bytes": 479280}, "py-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "py-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 173537, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/py-keep.json": {"num_bytes": 207009, "checksum": "c583508bfd9ca7f7d8730f7cf618cd5d0fb4d2000f48d39d5311b4eeb06fb6a3"}}, "download_size": 207009, "post_processing_size": null, "dataset_size": 173537, "size_in_bytes": 380546}, "py-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "py-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 177787, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/py-transform.json": {"num_bytes": 210975, "checksum": "9518a25d142569e8adf490d2cf6ed0df3ed16663991f73900d8477152f9a00c3"}}, "download_size": 210975, "post_processing_size": null, "dataset_size": 177787, "size_in_bytes": 388762}, "py-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "py-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 177787, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/py-reworded.json": {"num_bytes": 210975, "checksum": "56360077d2f35ca58965a85084205b31d4c296563d3fd93f1248bca308535f7f"}}, "download_size": 210975, "post_processing_size": null, "dataset_size": 177787, "size_in_bytes": 388762}, "py-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "py-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 155389, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/py-remove.json": {"num_bytes": 187068, "checksum": "491dc22f69bd7e4098c9b927addec8a3f9e7f0a7f93bac655bdc4440c26008a1"}}, "download_size": 187068, "post_processing_size": null, "dataset_size": 155389, "size_in_bytes": 342457}, "r-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "r-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 186803, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/r-keep.json": {"num_bytes": 215857, "checksum": "efd573dd3afcf7e6bdbea508dda54067e73777fc0d2e9e6570a52dfda63aa0fa"}}, "download_size": 215857, "post_processing_size": null, "dataset_size": 186803, "size_in_bytes": 402660}, "r-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "r-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 191732, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/r-transform.json": {"num_bytes": 220505, "checksum": "5a7b5f28ae59eec006d012623f594c9143fe9854487bd98817ed075d4d2abb97"}}, "download_size": 220505, "post_processing_size": null, "dataset_size": 191732, "size_in_bytes": 412237}, "r-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "r-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 191747, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/r-reworded.json": {"num_bytes": 220520, "checksum": "7d4063b824313d807dc8901bf86aab318b6a905549a2229fa9fdf286a526f215"}}, "download_size": 220520, "post_processing_size": null, "dataset_size": 191747, "size_in_bytes": 412267}, "r-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "r-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 168422, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/r-remove.json": {"num_bytes": 195771, "checksum": "32085e69d9f3975f38ce336e8e90b34124b19b8d581cdf7d0c5c902c14d6f012"}}, "download_size": 195771, "post_processing_size": null, "dataset_size": 168422, "size_in_bytes": 364193}, "rb-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "rb-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 181999, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/rb-keep.json": {"num_bytes": 216186, "checksum": "d8e86b7408460ff14841666c7514971db6092cdd1b5565d629bf908a71046ba1"}}, "download_size": 216186, "post_processing_size": null, "dataset_size": 181999, "size_in_bytes": 398185}, "rb-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "rb-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 188317, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/rb-transform.json": {"num_bytes": 223059, "checksum": "b53abcc9538e2c743d5bfc0e86f18e0832e6ec0dbd611a98566b05950436d31c"}}, "download_size": 223059, "post_processing_size": null, "dataset_size": 188317, "size_in_bytes": 411376}, "rb-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "rb-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 188457, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/rb-reworded.json": {"num_bytes": 223199, "checksum": "17d1d757c496a5230aacc106a6e61146cb8d8c29f5c9de9c3cd1000e7123b9ad"}}, "download_size": 223199, "post_processing_size": null, "dataset_size": 188457, "size_in_bytes": 411656}, "rb-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "rb-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 163569, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/rb-remove.json": {"num_bytes": 195978, "checksum": "02488606f2897203cf131aeb57eec365b93ecb0e7dd7a73d048890f0fd060e72"}}, "download_size": 195978, "post_processing_size": null, "dataset_size": 163569, "size_in_bytes": 359547}, "rkt-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "rkt-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 177757, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/rkt-keep.json": {"num_bytes": 212266, "checksum": "7086c9ca18882c7f0a18a4b46dfe84c0b5293b69a4c9d8964ad72a797ad72871"}}, "download_size": 212266, "post_processing_size": null, "dataset_size": 177757, "size_in_bytes": 390023}, "rkt-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "rkt-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 182937, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/rkt-transform.json": {"num_bytes": 218001, "checksum": "360afce46e550266f91f096d22e8a5e31e3b7f234c1d465a45c72a82ef2bda17"}}, "download_size": 218001, "post_processing_size": null, "dataset_size": 182937, "size_in_bytes": 400938}, "rkt-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "rkt-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 182754, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/rkt-reworded.json": {"num_bytes": 217818, "checksum": "6d399f13b03d66d107c56736285bddd09c4be707a7bfba5d3865c964ea467d8a"}}, "download_size": 217818, "post_processing_size": null, "dataset_size": 182754, "size_in_bytes": 400572}, "rkt-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "rkt-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 158729, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/rkt-remove.json": {"num_bytes": 191454, "checksum": "4b9e8bd27090d5d21882ac505f579d0825b079af5769c3ca9d8e7585e0e7005a"}}, "download_size": 191454, "post_processing_size": null, "dataset_size": 158729, "size_in_bytes": 350183}, "rs-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "rs-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 177191, "num_examples": 156, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/rs-keep.json": {"num_bytes": 206604, "checksum": "d5960e79973aea8bc30d276d5aa8c2750d336b80ff26be4ecc93495a77fd597b"}}, "download_size": 206604, "post_processing_size": null, "dataset_size": 177191, "size_in_bytes": 383795}, "rs-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "rs-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 188587, "num_examples": 156, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/rs-transform.json": {"num_bytes": 218555, "checksum": "1cd4f2931c17a8d9ee3aa8e646b818f2f2d5981b252639ff723d34ea5a13f973"}}, "download_size": 218555, "post_processing_size": null, "dataset_size": 188587, "size_in_bytes": 407142}, "rs-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "rs-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 188841, "num_examples": 156, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/rs-reworded.json": {"num_bytes": 218809, "checksum": "78d55aaa02b3faf1b0005b1b3757364274adebd294ee2281653230ebd829b594"}}, "download_size": 218809, "post_processing_size": null, "dataset_size": 188841, "size_in_bytes": 407650}, "rs-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "rs-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 158191, "num_examples": 153, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/rs-remove.json": {"num_bytes": 185991, "checksum": "064b21353df32e13ad02e7bf68b9a977f78000b632b73828487f5d47a0a9c610"}}, "download_size": 185991, "post_processing_size": null, "dataset_size": 158191, "size_in_bytes": 344182}, "scala-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "scala-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 222118, "num_examples": 160, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/scala-keep.json": {"num_bytes": 253027, "checksum": "eb90cccebedf54864fa5fe487141d5467962aecd05d1eee25403a0369e6ffde6"}}, "download_size": 253027, "post_processing_size": null, "dataset_size": 222118, "size_in_bytes": 475145}, "scala-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "scala-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 240540, "num_examples": 160, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/scala-transform.json": {"num_bytes": 272012, "checksum": "48669c1583008ffdd607006c3d4d0df65c0be452b1b7fa5429d15b4739495b34"}}, "download_size": 272012, "post_processing_size": null, "dataset_size": 240540, "size_in_bytes": 512552}, "scala-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "scala-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 240466, "num_examples": 160, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/scala-reworded.json": {"num_bytes": 271938, "checksum": "06b28cd512364d4b69a1ff5bfc61b7db620fb21dd73aff0c15db5a547879d38a"}}, "download_size": 271938, "post_processing_size": null, "dataset_size": 240466, "size_in_bytes": 512404}, "scala-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "scala-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 200261, "num_examples": 157, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/scala-remove.json": {"num_bytes": 229477, "checksum": "1fc1cc45643a50b0a54e467506582d72c8a7ff1124d07502599f6d16cb51fa93"}}, "download_size": 229477, "post_processing_size": null, "dataset_size": 200261, "size_in_bytes": 429738}, "sh-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "sh-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 158460, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/sh-keep.json": {"num_bytes": 193268, "checksum": "4f7240af8ed75b8448061713aa5e92352119b8db4618f0da4378ecd78478d81a"}}, "download_size": 193268, "post_processing_size": null, "dataset_size": 158460, "size_in_bytes": 351728}, "sh-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "sh-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 164552, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/sh-transform.json": {"num_bytes": 201631, "checksum": "961c6ce6bf00bb9422c809065fc185da86fb5eadf2d87a40f29f63b855fc032e"}}, "download_size": 201631, "post_processing_size": null, "dataset_size": 164552, "size_in_bytes": 366183}, "sh-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "sh-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 164521, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/sh-reworded.json": {"num_bytes": 201600, "checksum": "9f1e19a95aa83cf8ef4a9a23acbd3a1cee176ec13e049f57ade645126ca56ad8"}}, "download_size": 201600, "post_processing_size": null, "dataset_size": 164521, "size_in_bytes": 366121}, "sh-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "sh-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 140720, "num_examples": 155, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/sh-remove.json": {"num_bytes": 173767, "checksum": "0e3e37a23e2a2183ead389b70d46a487a31a96e82de8cc3fb1bf7f43d2ae00d9"}}, "download_size": 173767, "post_processing_size": null, "dataset_size": 140720, "size_in_bytes": 314487}, "swift-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "swift-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 201798, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/swift-keep.json": {"num_bytes": 233903, "checksum": "2f47aae44c26a505bce9a7c456377c015ddb35952017f626cac03c0cd6655642"}}, "download_size": 233903, "post_processing_size": null, "dataset_size": 201798, "size_in_bytes": 435701}, "swift-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "swift-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 204760, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/swift-transform.json": {"num_bytes": 236660, "checksum": "c0b76d009ffc75e26040f13c511e78bdfdb4fafe7743fbc2b1315173e638c438"}}, "download_size": 236660, "post_processing_size": null, "dataset_size": 204760, "size_in_bytes": 441420}, "swift-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "swift-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 204920, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/swift-reworded.json": {"num_bytes": 236820, "checksum": "193c6907ee55129c7ce823ad9162e9a52f0c0f1657220e6a329718385d31c969"}}, "download_size": 236820, "post_processing_size": null, "dataset_size": 204920, "size_in_bytes": 441740}, "swift-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "swift-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 181681, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/swift-remove.json": {"num_bytes": 212047, "checksum": "9c5aadcab3e2bed9592808321c2f5abbf18c257b71b329bc41689c4a54972ead"}}, "download_size": 212047, "post_processing_size": null, "dataset_size": 181681, "size_in_bytes": 393728}, "ts-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "ts-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 181763, "num_examples": 159, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/ts-keep.json": {"num_bytes": 215589, "checksum": "bea4e1776118c9bb9f3211deeaa6ce03dde208031b8d90f533f7d5b1d7bb5830"}}, "download_size": 215589, "post_processing_size": null, "dataset_size": 181763, "size_in_bytes": 397352}, "ts-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "ts-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 186037, "num_examples": 159, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/ts-transform.json": {"num_bytes": 220423, "checksum": "6081b604f3673a39bd5e8fc68a67977a3855f477cdfc1431a6cf0e2fb0be00bf"}}, "download_size": 220423, "post_processing_size": null, "dataset_size": 186037, "size_in_bytes": 406460}, "ts-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "ts-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 186215, "num_examples": 159, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/ts-reworded.json": {"num_bytes": 220601, "checksum": "e64fa52e9e95e4daa62a9e8162b4ba1a6ec3e2881a7968ba4a69eaa3d8ba61e3"}}, "download_size": 220601, "post_processing_size": null, "dataset_size": 186215, "size_in_bytes": 406816}, "ts-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "ts-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 162881, "num_examples": 156, "dataset_name": "multipl_e"}}, "download_checksums": {"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/ts-remove.json": {"num_bytes": 194985, "checksum": "7a98910e983f01a13325280b3d9d383bbd1454eced4b5b08b4f7da9daf781f32"}}, "download_size": 194985, "post_processing_size": null, "dataset_size": 162881, "size_in_bytes": 357866}} \ No newline at end of file +{"cpp-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "cpp-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 217792, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/cpp-keep.json": {"num_bytes": 248493, "checksum": "56d81141f7b29c237796e14173b8e2884e97d27a8d57c3644a237c09f59227b4"}}, "download_size": 248493, "post_processing_size": null, "dataset_size": 217792, "size_in_bytes": 466285}, "cpp-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "cpp-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 239517, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/cpp-transform.json": {"num_bytes": 270773, "checksum": "cb154fc45bef323590b79bb70c14aba4bad59b6a2180615d8937485d41a93d1e"}}, "download_size": 270773, "post_processing_size": null, "dataset_size": 239517, "size_in_bytes": 510290}, "cpp-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "cpp-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 239767, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/cpp-reworded.json": {"num_bytes": 271023, "checksum": "ac639faf8c79348712cb2cd1d95df135a226a49006461245acf810039b9420ce"}}, "download_size": 271023, "post_processing_size": null, "dataset_size": 239767, "size_in_bytes": 510790}, "cpp-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "cpp-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 198566, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/cpp-remove.json": {"num_bytes": 227555, "checksum": "729a5a6e1d68668554f77de56ef17b44eab57beea03f2fb920c075cb4f6a905f"}}, "download_size": 227555, "post_processing_size": null, "dataset_size": 198566, "size_in_bytes": 426121}, "cs-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "cs-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 259874, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/cs-keep.json": {"num_bytes": 291137, "checksum": "db62ab52665a2742d0bef4de662ca187a703227083881177dad4f2712da5199a"}}, "download_size": 291137, "post_processing_size": null, "dataset_size": 259874, "size_in_bytes": 551011}, "cs-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "cs-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 283738, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/cs-transform.json": {"num_bytes": 315563, "checksum": "505f4892388ede789dd09a256c3dbc801549c8d1d372fa60b4db339fe09d6319"}}, "download_size": 315563, "post_processing_size": null, "dataset_size": 283738, "size_in_bytes": 599301}, "cs-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "cs-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 283673, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/cs-reworded.json": {"num_bytes": 315498, "checksum": "0304b710180681c9a68fe97684a87e71ab35aec9f229fd1d592e0b0ea698d8c2"}}, "download_size": 315498, "post_processing_size": null, "dataset_size": 283673, "size_in_bytes": 599171}, "cs-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "cs-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 237663, "num_examples": 155, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/cs-remove.json": {"num_bytes": 267251, "checksum": "8e2295c157152f2105d805dc06b26ab91e31000cdc8710f31e693bc65de1b753"}}, "download_size": 267251, "post_processing_size": null, "dataset_size": 237663, "size_in_bytes": 504914}, "d-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "d-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 175592, "num_examples": 156, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/d-keep.json": {"num_bytes": 209568, "checksum": "e34578f5aabf7a3664eee62f77b00cc908c3db8a6a7aeb071965de247f9750e7"}}, "download_size": 209568, "post_processing_size": null, "dataset_size": 175592, "size_in_bytes": 385160}, "d-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "d-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 181121, "num_examples": 156, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/d-transform.json": {"num_bytes": 215649, "checksum": "a9d182b3a60e4f951e2235f2a4157b91f518623b6ae21260e1d5d6703cf77a78"}}, "download_size": 215649, "post_processing_size": null, "dataset_size": 181121, "size_in_bytes": 396770}, "d-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "d-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 181296, "num_examples": 156, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/d-reworded.json": {"num_bytes": 215824, "checksum": "6a021fd31c45c3f68742f7d60d27082d45d17229daae221d46c70ace9d61bc2b"}}, "download_size": 215824, "post_processing_size": null, "dataset_size": 181296, "size_in_bytes": 397120}, "d-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "d-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 157938, "num_examples": 153, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/d-remove.json": {"num_bytes": 190211, "checksum": "9a36e460e3f0e7fcb92fa6d9f1da5e9d62cf5ee6787af73468bb2a54dada295a"}}, "download_size": 190211, "post_processing_size": null, "dataset_size": 157938, "size_in_bytes": 348149}, "go-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "go-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 241130, "num_examples": 154, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/go-keep.json": {"num_bytes": 280424, "checksum": "6de07406cbf81f3a6d0199ec9fc85eaf78a20d9954f8f3ea22e7d1b2fa9a92b6"}}, "download_size": 280424, "post_processing_size": null, "dataset_size": 241130, "size_in_bytes": 521554}, "go-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "go-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 247448, "num_examples": 154, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/go-transform.json": {"num_bytes": 287275, "checksum": "084a15fb951dd89dc33a06cf49acaf2610ee0e2de0c9f8d1325b08a4a88b2ebc"}}, "download_size": 287275, "post_processing_size": null, "dataset_size": 247448, "size_in_bytes": 534723}, "go-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "go-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 247354, "num_examples": 154, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/go-reworded.json": {"num_bytes": 287181, "checksum": "b5fee01832bc349cab80f50aa68ec6e8df37cf054457ccfd0333229acae60b08"}}, "download_size": 287181, "post_processing_size": null, "dataset_size": 247354, "size_in_bytes": 534535}, "go-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "go-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 221519, "num_examples": 151, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/go-remove.json": {"num_bytes": 258980, "checksum": "e4bbf884adf71965e8b0978ff20ff779de60f50bd7da8912b620b713de3bc376"}}, "download_size": 258980, "post_processing_size": null, "dataset_size": 221519, "size_in_bytes": 480499}, "java-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "java-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 259836, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/java-keep.json": {"num_bytes": 291099, "checksum": "7bf1559d86c8a92fd15b4ed812d885c99c50551f392b2ad816a8e7060527e89c"}}, "download_size": 291099, "post_processing_size": null, "dataset_size": 259836, "size_in_bytes": 550935}, "java-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "java-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 286548, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/java-transform.json": {"num_bytes": 318373, "checksum": "b5da36d56612e80384d9e6a46407241934730d3ba5bca98c5e7ccfb112f9d628"}}, "download_size": 318373, "post_processing_size": null, "dataset_size": 286548, "size_in_bytes": 604921}, "java-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "java-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 288031, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/java-reworded.json": {"num_bytes": 319856, "checksum": "893dabdd6b521f3e05ab84748cd27a1e6debbe9400478c8ca889953940145ca1"}}, "download_size": 319856, "post_processing_size": null, "dataset_size": 288031, "size_in_bytes": 607887}, "java-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "java-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 237672, "num_examples": 155, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/java-remove.json": {"num_bytes": 267260, "checksum": "a6c69545169e760eb802d953af94dde684146430b281d43ffa98f72f1416a34d"}}, "download_size": 267260, "post_processing_size": null, "dataset_size": 237672, "size_in_bytes": 504932}, "jl-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "jl-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 163708, "num_examples": 159, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/jl-keep.json": {"num_bytes": 198696, "checksum": "7fa3f79aa3d56fadae3414684f0f102f87d529099d84a6f5d30a652714419d7b"}}, "download_size": 198696, "post_processing_size": null, "dataset_size": 163708, "size_in_bytes": 362404}, "jl-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "jl-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 167969, "num_examples": 159, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/jl-transform.json": {"num_bytes": 203514, "checksum": "255731ab55a8eb128bcf6b3ececbd0dcd5fcb087753b830f148788c53ebfee8e"}}, "download_size": 203514, "post_processing_size": null, "dataset_size": 167969, "size_in_bytes": 371483}, "jl-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "jl-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 168251, "num_examples": 159, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/jl-reworded.json": {"num_bytes": 203796, "checksum": "ceef60793f1d2c97d96df7e8ef54695a17a6a1d47a11e4c9c7a202c50300aff3"}}, "download_size": 203796, "post_processing_size": null, "dataset_size": 168251, "size_in_bytes": 372047}, "jl-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "jl-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 145913, "num_examples": 156, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/jl-remove.json": {"num_bytes": 179158, "checksum": "221e77ae9a1c3c3ab95d0c5010b119f9fd6f1fea9afaa79e5cf033f9a62e9d11"}}, "download_size": 179158, "post_processing_size": null, "dataset_size": 145913, "size_in_bytes": 325071}, "js-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "js-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 177635, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/js-keep.json": {"num_bytes": 211822, "checksum": "02e56da39247f31c4f399a62210fdbe97bb45f6ec239140c3985432b72485bf2"}}, "download_size": 211822, "post_processing_size": null, "dataset_size": 177635, "size_in_bytes": 389457}, "js-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "js-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 181987, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/js-transform.json": {"num_bytes": 216729, "checksum": "d90db81d52580d6d21cca9b16662fdac11b4ff5f2b50521652014c3c4d66b9c0"}}, "download_size": 216729, "post_processing_size": null, "dataset_size": 181987, "size_in_bytes": 398716}, "js-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "js-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 182171, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/js-reworded.json": {"num_bytes": 216913, "checksum": "ed2aa0a25d0fd9dd963668079e334d88acd8caf0bf020a33964f7cd4700eb670"}}, "download_size": 216913, "post_processing_size": null, "dataset_size": 182171, "size_in_bytes": 399084}, "js-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "js-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 158619, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/js-remove.json": {"num_bytes": 191028, "checksum": "8b0d17122dac1a1efef793d71e73473892aba8c8ebf8bf2238e4be8f7cd2685d"}}, "download_size": 191028, "post_processing_size": null, "dataset_size": 158619, "size_in_bytes": 349647}, "lua-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "lua-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 180398, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/lua-keep.json": {"num_bytes": 212511, "checksum": "fb7466e8b89c92fab70dbd7f0074972cf0c6e970f94f7203c4fa01797af59e67"}}, "download_size": 212511, "post_processing_size": null, "dataset_size": 180398, "size_in_bytes": 392909}, "lua-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "lua-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 184763, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/lua-transform.json": {"num_bytes": 216595, "checksum": "fba904e9325bb59360bb4e583f796bce78587695db92c6a4b4145a6bbb8778df"}}, "download_size": 216595, "post_processing_size": null, "dataset_size": 184763, "size_in_bytes": 401358}, "lua-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "lua-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 184853, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/lua-reworded.json": {"num_bytes": 216685, "checksum": "54b8881bd6d2ba52b1d2e77388f20429edd60e705cf2c8cc87c58db966ceb2ff"}}, "download_size": 216685, "post_processing_size": null, "dataset_size": 184853, "size_in_bytes": 401538}, "lua-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "lua-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 161339, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/lua-remove.json": {"num_bytes": 191690, "checksum": "e12d5519c6f740d9341136043e93f42986a13b7f00a64c393592bca83400f45e"}}, "download_size": 191690, "post_processing_size": null, "dataset_size": 161339, "size_in_bytes": 353029}, "php-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "php-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 219526, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/php-keep.json": {"num_bytes": 256134, "checksum": "6e8bbef0effb50396b752e4e2ee3cd42e9f1edcf253e684dffe0d60efd447af4"}}, "download_size": 256134, "post_processing_size": null, "dataset_size": 219526, "size_in_bytes": 475660}, "php-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "php-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 225575, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/php-transform.json": {"num_bytes": 262738, "checksum": "113c46223db9f1235ba2f0a390a0f01a9775400a671537e70755ea471e99088c"}}, "download_size": 262738, "post_processing_size": null, "dataset_size": 225575, "size_in_bytes": 488313}, "php-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "php-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 225730, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/php-reworded.json": {"num_bytes": 262893, "checksum": "a27a5093957369e68f16ec973cc3fe16a400a6b1e0efa2469ef607ea5529b176"}}, "download_size": 262893, "post_processing_size": null, "dataset_size": 225730, "size_in_bytes": 488623}, "php-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "php-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 200047, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/php-remove.json": {"num_bytes": 234848, "checksum": "3b13b33434a08c9bcff8db2a72e3ec89c85a794b8c1ca576a10614693d3b27b0"}}, "download_size": 234848, "post_processing_size": null, "dataset_size": 200047, "size_in_bytes": 434895}, "pl-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "pl-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 239874, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/pl-keep.json": {"num_bytes": 279351, "checksum": "116f82cec38a8a9f38bd14bbd9348d18f13879a98c293c7ce9ff38829da8bf3f"}}, "download_size": 279351, "post_processing_size": null, "dataset_size": 239874, "size_in_bytes": 519225}, "pl-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "pl-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 243611, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/pl-transform.json": {"num_bytes": 283767, "checksum": "552decb4ad799ae7204b0434600d0a7b1b2136dc34dbaa1a3e6ca7acb681173e"}}, "download_size": 283767, "post_processing_size": null, "dataset_size": 243611, "size_in_bytes": 527378}, "pl-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "pl-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 243661, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/pl-reworded.json": {"num_bytes": 283817, "checksum": "52010c713c3cb0ee07b691f0c04be20baf35223019bc8dfeb08720b82fd8ce58"}}, "download_size": 283817, "post_processing_size": null, "dataset_size": 243661, "size_in_bytes": 527478}, "pl-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "pl-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 220817, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/pl-remove.json": {"num_bytes": 258463, "checksum": "94723d826be5a900f975ffd97039dba9de878945f6d81fa0a59bdebed5c87ef6"}}, "download_size": 258463, "post_processing_size": null, "dataset_size": 220817, "size_in_bytes": 479280}, "py-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "py-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 173537, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/py-keep.json": {"num_bytes": 207009, "checksum": "c583508bfd9ca7f7d8730f7cf618cd5d0fb4d2000f48d39d5311b4eeb06fb6a3"}}, "download_size": 207009, "post_processing_size": null, "dataset_size": 173537, "size_in_bytes": 380546}, "py-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "py-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 177787, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/py-transform.json": {"num_bytes": 210975, "checksum": "9518a25d142569e8adf490d2cf6ed0df3ed16663991f73900d8477152f9a00c3"}}, "download_size": 210975, "post_processing_size": null, "dataset_size": 177787, "size_in_bytes": 388762}, "py-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "py-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 177787, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/py-reworded.json": {"num_bytes": 210975, "checksum": "56360077d2f35ca58965a85084205b31d4c296563d3fd93f1248bca308535f7f"}}, "download_size": 210975, "post_processing_size": null, "dataset_size": 177787, "size_in_bytes": 388762}, "py-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "py-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 155389, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/py-remove.json": {"num_bytes": 187068, "checksum": "491dc22f69bd7e4098c9b927addec8a3f9e7f0a7f93bac655bdc4440c26008a1"}}, "download_size": 187068, "post_processing_size": null, "dataset_size": 155389, "size_in_bytes": 342457}, "r-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "r-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 186803, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/r-keep.json": {"num_bytes": 215857, "checksum": "efd573dd3afcf7e6bdbea508dda54067e73777fc0d2e9e6570a52dfda63aa0fa"}}, "download_size": 215857, "post_processing_size": null, "dataset_size": 186803, "size_in_bytes": 402660}, "r-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "r-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 191732, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/r-transform.json": {"num_bytes": 220505, "checksum": "5a7b5f28ae59eec006d012623f594c9143fe9854487bd98817ed075d4d2abb97"}}, "download_size": 220505, "post_processing_size": null, "dataset_size": 191732, "size_in_bytes": 412237}, "r-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "r-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 191747, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/r-reworded.json": {"num_bytes": 220520, "checksum": "7d4063b824313d807dc8901bf86aab318b6a905549a2229fa9fdf286a526f215"}}, "download_size": 220520, "post_processing_size": null, "dataset_size": 191747, "size_in_bytes": 412267}, "r-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "r-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 168422, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/r-remove.json": {"num_bytes": 195771, "checksum": "32085e69d9f3975f38ce336e8e90b34124b19b8d581cdf7d0c5c902c14d6f012"}}, "download_size": 195771, "post_processing_size": null, "dataset_size": 168422, "size_in_bytes": 364193}, "rb-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "rb-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 181999, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/rb-keep.json": {"num_bytes": 216186, "checksum": "d8e86b7408460ff14841666c7514971db6092cdd1b5565d629bf908a71046ba1"}}, "download_size": 216186, "post_processing_size": null, "dataset_size": 181999, "size_in_bytes": 398185}, "rb-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "rb-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 188317, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/rb-transform.json": {"num_bytes": 223059, "checksum": "b53abcc9538e2c743d5bfc0e86f18e0832e6ec0dbd611a98566b05950436d31c"}}, "download_size": 223059, "post_processing_size": null, "dataset_size": 188317, "size_in_bytes": 411376}, "rb-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "rb-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 188457, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/rb-reworded.json": {"num_bytes": 223199, "checksum": "17d1d757c496a5230aacc106a6e61146cb8d8c29f5c9de9c3cd1000e7123b9ad"}}, "download_size": 223199, "post_processing_size": null, "dataset_size": 188457, "size_in_bytes": 411656}, "rb-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "rb-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 163569, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/rb-remove.json": {"num_bytes": 195978, "checksum": "02488606f2897203cf131aeb57eec365b93ecb0e7dd7a73d048890f0fd060e72"}}, "download_size": 195978, "post_processing_size": null, "dataset_size": 163569, "size_in_bytes": 359547}, "rkt-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "rkt-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 177757, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/rkt-keep.json": {"num_bytes": 212266, "checksum": "7086c9ca18882c7f0a18a4b46dfe84c0b5293b69a4c9d8964ad72a797ad72871"}}, "download_size": 212266, "post_processing_size": null, "dataset_size": 177757, "size_in_bytes": 390023}, "rkt-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "rkt-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 182937, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/rkt-transform.json": {"num_bytes": 218001, "checksum": "360afce46e550266f91f096d22e8a5e31e3b7f234c1d465a45c72a82ef2bda17"}}, "download_size": 218001, "post_processing_size": null, "dataset_size": 182937, "size_in_bytes": 400938}, "rkt-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "rkt-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 182754, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/rkt-reworded.json": {"num_bytes": 217818, "checksum": "6d399f13b03d66d107c56736285bddd09c4be707a7bfba5d3865c964ea467d8a"}}, "download_size": 217818, "post_processing_size": null, "dataset_size": 182754, "size_in_bytes": 400572}, "rkt-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "rkt-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 158729, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/rkt-remove.json": {"num_bytes": 191454, "checksum": "4b9e8bd27090d5d21882ac505f579d0825b079af5769c3ca9d8e7585e0e7005a"}}, "download_size": 191454, "post_processing_size": null, "dataset_size": 158729, "size_in_bytes": 350183}, "rs-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "rs-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 177191, "num_examples": 156, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/rs-keep.json": {"num_bytes": 206604, "checksum": "d5960e79973aea8bc30d276d5aa8c2750d336b80ff26be4ecc93495a77fd597b"}}, "download_size": 206604, "post_processing_size": null, "dataset_size": 177191, "size_in_bytes": 383795}, "rs-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "rs-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 188587, "num_examples": 156, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/rs-transform.json": {"num_bytes": 218555, "checksum": "1cd4f2931c17a8d9ee3aa8e646b818f2f2d5981b252639ff723d34ea5a13f973"}}, "download_size": 218555, "post_processing_size": null, "dataset_size": 188587, "size_in_bytes": 407142}, "rs-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "rs-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 188841, "num_examples": 156, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/rs-reworded.json": {"num_bytes": 218809, "checksum": "78d55aaa02b3faf1b0005b1b3757364274adebd294ee2281653230ebd829b594"}}, "download_size": 218809, "post_processing_size": null, "dataset_size": 188841, "size_in_bytes": 407650}, "rs-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "rs-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 158191, "num_examples": 153, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/rs-remove.json": {"num_bytes": 185991, "checksum": "064b21353df32e13ad02e7bf68b9a977f78000b632b73828487f5d47a0a9c610"}}, "download_size": 185991, "post_processing_size": null, "dataset_size": 158191, "size_in_bytes": 344182}, "scala-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "scala-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 222118, "num_examples": 160, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/scala-keep.json": {"num_bytes": 253027, "checksum": "eb90cccebedf54864fa5fe487141d5467962aecd05d1eee25403a0369e6ffde6"}}, "download_size": 253027, "post_processing_size": null, "dataset_size": 222118, "size_in_bytes": 475145}, "scala-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "scala-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 240540, "num_examples": 160, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/scala-transform.json": {"num_bytes": 272012, "checksum": "48669c1583008ffdd607006c3d4d0df65c0be452b1b7fa5429d15b4739495b34"}}, "download_size": 272012, "post_processing_size": null, "dataset_size": 240540, "size_in_bytes": 512552}, "scala-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "scala-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 240466, "num_examples": 160, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/scala-reworded.json": {"num_bytes": 271938, "checksum": "06b28cd512364d4b69a1ff5bfc61b7db620fb21dd73aff0c15db5a547879d38a"}}, "download_size": 271938, "post_processing_size": null, "dataset_size": 240466, "size_in_bytes": 512404}, "scala-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "scala-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 200261, "num_examples": 157, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/scala-remove.json": {"num_bytes": 229477, "checksum": "1fc1cc45643a50b0a54e467506582d72c8a7ff1124d07502599f6d16cb51fa93"}}, "download_size": 229477, "post_processing_size": null, "dataset_size": 200261, "size_in_bytes": 429738}, "sh-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "sh-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 158460, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/sh-keep.json": {"num_bytes": 193268, "checksum": "4f7240af8ed75b8448061713aa5e92352119b8db4618f0da4378ecd78478d81a"}}, "download_size": 193268, "post_processing_size": null, "dataset_size": 158460, "size_in_bytes": 351728}, "sh-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "sh-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 164552, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/sh-transform.json": {"num_bytes": 201631, "checksum": "961c6ce6bf00bb9422c809065fc185da86fb5eadf2d87a40f29f63b855fc032e"}}, "download_size": 201631, "post_processing_size": null, "dataset_size": 164552, "size_in_bytes": 366183}, "sh-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "sh-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 164521, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/sh-reworded.json": {"num_bytes": 201600, "checksum": "9f1e19a95aa83cf8ef4a9a23acbd3a1cee176ec13e049f57ade645126ca56ad8"}}, "download_size": 201600, "post_processing_size": null, "dataset_size": 164521, "size_in_bytes": 366121}, "sh-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "sh-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 140720, "num_examples": 155, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/sh-remove.json": {"num_bytes": 173767, "checksum": "0e3e37a23e2a2183ead389b70d46a487a31a96e82de8cc3fb1bf7f43d2ae00d9"}}, "download_size": 173767, "post_processing_size": null, "dataset_size": 140720, "size_in_bytes": 314487}, "swift-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "swift-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 201798, "num_examples": 161, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/swift-keep.json": {"num_bytes": 233903, "checksum": "2f47aae44c26a505bce9a7c456377c015ddb35952017f626cac03c0cd6655642"}}, "download_size": 233903, "post_processing_size": null, "dataset_size": 201798, "size_in_bytes": 435701}, "swift-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "swift-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 204760, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/swift-transform.json": {"num_bytes": 236660, "checksum": "c0b76d009ffc75e26040f13c511e78bdfdb4fafe7743fbc2b1315173e638c438"}}, "download_size": 236660, "post_processing_size": null, "dataset_size": 204760, "size_in_bytes": 441420}, "swift-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "swift-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 204920, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/swift-reworded.json": {"num_bytes": 236820, "checksum": "193c6907ee55129c7ce823ad9162e9a52f0c0f1657220e6a329718385d31c969"}}, "download_size": 236820, "post_processing_size": null, "dataset_size": 204920, "size_in_bytes": 441740}, "swift-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "swift-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 181681, "num_examples": 158, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/swift-remove.json": {"num_bytes": 212047, "checksum": "9c5aadcab3e2bed9592808321c2f5abbf18c257b71b329bc41689c4a54972ead"}}, "download_size": 212047, "post_processing_size": null, "dataset_size": 181681, "size_in_bytes": 393728}, "ts-keep": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "ts-keep", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 181763, "num_examples": 159, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/ts-keep.json": {"num_bytes": 215589, "checksum": "bea4e1776118c9bb9f3211deeaa6ce03dde208031b8d90f533f7d5b1d7bb5830"}}, "download_size": 215589, "post_processing_size": null, "dataset_size": 181763, "size_in_bytes": 397352}, "ts-transform": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "ts-transform", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 186037, "num_examples": 159, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/ts-transform.json": {"num_bytes": 220423, "checksum": "6081b604f3673a39bd5e8fc68a67977a3855f477cdfc1431a6cf0e2fb0be00bf"}}, "download_size": 220423, "post_processing_size": null, "dataset_size": 186037, "size_in_bytes": 406460}, "ts-reworded": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "ts-reworded", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 186215, "num_examples": 159, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/ts-reworded.json": {"num_bytes": 220601, "checksum": "e64fa52e9e95e4daa62a9e8162b4ba1a6ec3e2881a7968ba4a69eaa3d8ba61e3"}}, "download_size": 220601, "post_processing_size": null, "dataset_size": 186215, "size_in_bytes": 406816}, "ts-remove": {"description": "MultiPL-E is a dataset for evaluating large language models for code generation that supports 18 programming languages. It takes the OpenAI \"HumanEval\" Python benchmarks and uses little compilers to translate them to other languages. It is easy to add support for new languages and benchmarks.\n", "citation": "@misc{multipl-e,\n doi = {10.48550/ARXIV.2208.08227},\n url = {https://arxiv.org/abs/2208.08227},\n author = {Cassano, Federico and Gouwar, John and Nguyen, Daniel and\n Nguyen, Sydney and Phipps-Costin, Luna and Pinckney, Donald and \n Yee, Ming-Ho and Zi, Yangtian and Anderson, Carolyn Jane and \n Feldman, Molly Q and Guha, Arjun and \n Greenberg, Michael and Jangda, Abhinav},\n title = {A Scalable and Extensible Approach to Benchmarking NL2Code for 18\n Programming Languages},\n publisher = {arXiv},\n year = {2022},\n}\n", "homepage": "https://nuprl.github.io/MultiPL-E/", "license": "MIT", "features": {"name": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "doctests": {"dtype": "string", "id": null, "_type": "Value"}, "original": {"dtype": "string", "id": null, "_type": "Value"}, "prompt_terminology": {"dtype": "string", "id": null, "_type": "Value"}, "tests": {"dtype": "string", "id": null, "_type": "Value"}, "stop_tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [], "builder_name": "multipl_e", "config_name": "ts-remove", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 162881, "num_examples": 156, "dataset_name": "multipl_e"}}, "download_checksums": {"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/ts-remove.json": {"num_bytes": 194985, "checksum": "7a98910e983f01a13325280b3d9d383bbd1454eced4b5b08b4f7da9daf781f32"}}, "download_size": 194985, "post_processing_size": null, "dataset_size": 162881, "size_in_bytes": 357866}} \ No newline at end of file diff --git a/multipl_e.py b/multipl_e.py index 10a46fbc5f4f6c07e69b06a438a2f0c9cf29a381..14cf8e62d0994f83c4a936f417892722c9ac3f15 100644 --- a/multipl_e.py +++ b/multipl_e.py @@ -85,7 +85,8 @@ class MultiPLE(datasets.GeneratorBasedBuilder): def _split_generators(self, dl_manager: datasets.DownloadManager): files = dl_manager.download( - f"https://huggingface.co/datasets/nuprl/MultiPL-E/resolve/aa5a052b03ef86b25a092752dbbab0bce6a676c8/data/{self.config.name}.json") + f"https://raw.githubusercontent.com/nuprl/MultiPL-E/375e903198713b7f5faa95a4047c6928cf7348f9/prompts/{self.config.name}.json" + ) return [ datasets.SplitGenerator( name=datasets.Split.TEST,